<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Mermaid Renderer</title>
  <style>
    body {
      margin: 0;
      padding: 20px;
      background: white;
      display: flex;
      justify-content: center;
      align-items: flex-start;
    }
    #container {
      display: inline-block;
    }
    .mermaid {
      display: inline-block;
    }
  </style>
  <script type="module" crossorigin>(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const a of i)if(a.type==="childList")for(const s of a.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&n(s)}).observe(document,{childList:!0,subtree:!0});function r(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerPolicy&&(a.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?a.credentials="include":i.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function n(i){if(i.ep)return;i.ep=!0;const a=r(i);fetch(i.href,a)}})();const Qq="modulepreload",Jq=function(t,e){return new URL(t,e).href},AS={},ir=function(e,r,n){let i=Promise.resolve();if(r&&r.length>0){const s=document.getElementsByTagName("link"),o=document.querySelector("meta[property=csp-nonce]"),l=o?.nonce||o?.getAttribute("nonce");i=Promise.allSettled(r.map(u=>{if(u=Jq(u,n),u in AS)return;AS[u]=!0;const h=u.endsWith(".css"),d=h?'[rel="stylesheet"]':"";if(!!n)for(let g=s.length-1;g>=0;g--){const m=s[g];if(m.href===u&&(!h||m.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${u}"]${d}`))return;const p=document.createElement("link");if(p.rel=h?"stylesheet":Qq,h||(p.as="script"),p.crossOrigin="",p.href=u,l&&p.setAttribute("nonce",l),document.head.appendChild(p),h)return new Promise((g,m)=>{p.addEventListener("load",g),p.addEventListener("error",()=>m(new Error(`Unable to preload CSS for ${u}`)))})}))}function a(s){const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=s,window.dispatchEvent(o),!o.defaultPrevented)throw s}return i.then(s=>{for(const o of s||[])o.status==="rejected"&&a(o.reason);return e().catch(a)})};var $3={name:"mermaid",version:"11.12.1",description:"Markdown-ish syntax for generating flowcharts, mindmaps, sequence diagrams, class diagrams, gantt charts, git graphs and more.",type:"module",module:"./dist/mermaid.core.mjs",types:"./dist/mermaid.d.ts",exports:{".":{types:"./dist/mermaid.d.ts",import:"./dist/mermaid.core.mjs",default:"./dist/mermaid.core.mjs"},"./*":"./*"},keywords:["diagram","markdown","flowchart","sequence diagram","gantt","class diagram","git graph","mindmap","packet diagram","c4 diagram","er diagram","pie chart","pie diagram","quadrant chart","requirement diagram","graph"],scripts:{clean:"rimraf dist",dev:"pnpm -w dev","docs:code":"typedoc src/defaultConfig.ts src/config.ts src/mermaid.ts && prettier --write ./src/docs/config/setup","docs:build":"rimraf ../../docs && pnpm docs:code && pnpm docs:spellcheck && tsx scripts/docs.cli.mts","docs:verify":"pnpm docs:code && pnpm docs:spellcheck && tsx scripts/docs.cli.mts --verify","docs:pre:vitepress":"pnpm --filter ./src/docs prefetch && rimraf src/vitepress && pnpm docs:code && tsx scripts/docs.cli.mts --vitepress && pnpm --filter ./src/vitepress install --no-frozen-lockfile --ignore-scripts","docs:build:vitepress":"pnpm docs:pre:vitepress && (cd src/vitepress && pnpm run build) && cpy --flat src/docs/landing/ ./src/vitepress/.vitepress/dist/landing","docs:dev":'pnpm docs:pre:vitepress && concurrently "pnpm --filter ./src/vitepress dev" "tsx scripts/docs.cli.mts --watch --vitepress"',"docs:dev:docker":'pnpm docs:pre:vitepress && concurrently "pnpm --filter ./src/vitepress dev:docker" "tsx scripts/docs.cli.mts --watch --vitepress"',"docs:serve":"pnpm docs:build:vitepress && vitepress serve src/vitepress","docs:spellcheck":'cspell "src/docs/**/*.md"',"docs:release-version":"tsx scripts/update-release-version.mts","docs:verify-version":"tsx scripts/update-release-version.mts --verify","types:build-config":"tsx scripts/create-types-from-json-schema.mts","types:verify-config":"tsx scripts/create-types-from-json-schema.mts --verify",checkCircle:"npx madge --circular ./src",prepublishOnly:"pnpm docs:verify-version"},repository:{type:"git",url:"https://github.com/mermaid-js/mermaid"},author:"Knut Sveidqvist",license:"MIT",standard:{ignore:["**/parser/*.js","dist/**/*.js","cypress/**/*.js"],globals:["page"]},dependencies:{"@braintree/sanitize-url":"^7.1.1","@iconify/utils":"^3.0.1","@mermaid-js/parser":"workspace:^","@types/d3":"^7.4.3",cytoscape:"^3.29.3","cytoscape-cose-bilkent":"^4.1.0","cytoscape-fcose":"^2.2.0",d3:"^7.9.0","d3-sankey":"^0.12.3","dagre-d3-es":"7.0.13",dayjs:"^1.11.18",dompurify:"^3.2.5",katex:"^0.16.22",khroma:"^2.1.0","lodash-es":"^4.17.21",marked:"^16.2.1",roughjs:"^4.6.6",stylis:"^4.3.6","ts-dedent":"^2.2.0",uuid:"^11.1.0"},devDependencies:{"@adobe/jsonschema2md":"^8.0.5","@iconify/types":"^2.0.0","@types/cytoscape":"^3.21.9","@types/cytoscape-fcose":"^2.2.4","@types/d3-sankey":"^0.12.4","@types/d3-scale":"^4.0.9","@types/d3-scale-chromatic":"^3.1.0","@types/d3-selection":"^3.0.11","@types/d3-shape":"^3.1.7","@types/jsdom":"^21.1.7","@types/katex":"^0.16.7","@types/lodash-es":"^4.17.12","@types/micromatch":"^4.0.9","@types/stylis":"^4.2.7","@types/uuid":"^10.0.0",ajv:"^8.17.1",canvas:"^3.1.2",chokidar:"3.6.0",concurrently:"^9.1.2","csstree-validator":"^4.0.1",globby:"^14.1.0",jison:"^0.4.18","js-base64":"^3.7.8",jsdom:"^26.1.0","json-schema-to-typescript":"^15.0.4",micromatch:"^4.0.8","path-browserify":"^1.0.1",prettier:"^3.5.3",remark:"^15.0.1","remark-frontmatter":"^5.0.0","remark-gfm":"^4.0.1",rimraf:"^6.0.1","start-server-and-test":"^2.0.13","type-fest":"^4.35.0",typedoc:"^0.28.12","typedoc-plugin-markdown":"^4.8.1",typescript:"~5.7.3","unist-util-flatmap":"^1.0.0","unist-util-visit":"^5.0.0",vitepress:"^1.6.4","vitepress-plugin-search":"1.0.4-alpha.22"},files:["dist/","README.md"],publishConfig:{access:"public"}},to=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function yd(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var lN={exports:{}};(function(t,e){(function(r,n){t.exports=n()})(to,function(){var r=1e3,n=6e4,i=36e5,a="millisecond",s="second",o="minute",l="hour",u="day",h="week",d="month",f="quarter",p="year",g="date",m="Invalid Date",v=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|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(k){var R=["th","st","nd","rd"],I=k%100;return"["+k+(R[(I-20)%10]||R[I]||R[0])+"]"}},w=function(k,R,I){var M=String(k);return!M||M.length>=R?k:""+Array(R+1-M.length).join(I)+k},T={s:w,z:function(k){var R=-k.utcOffset(),I=Math.abs(R),M=Math.floor(I/60),D=I%60;return(R<=0?"+":"-")+w(M,2,"0")+":"+w(D,2,"0")},m:function k(R,I){if(R.date()<I.date())return-k(I,R);var M=12*(I.year()-R.year())+(I.month()-R.month()),D=R.clone().add(M,d),B=I-D<0,$=R.clone().add(M+(B?-1:1),d);return+(-(M+(I-D)/(B?D-$:$-D))||0)},a:function(k){return k<0?Math.ceil(k)||0:Math.floor(k)},p:function(k){return{M:d,y:p,w:h,d:u,D:g,h:l,m:o,s,ms:a,Q:f}[k]||String(k||"").toLowerCase().replace(/s$/,"")},u:function(k){return k===void 0}},E="en",L={};L[E]=b;var S="$isDayjsObject",C=function(k){return k instanceof O||!(!k||!k[S])},A=function k(R,I,M){var D;if(!R)return E;if(typeof R=="string"){var B=R.toLowerCase();L[B]&&(D=B),I&&(L[B]=I,D=B);var $=R.split("-");if(!D&&$.length>1)return k($[0])}else{var F=R.name;L[F]=R,D=F}return!M&&D&&(E=D),D||!M&&E},N=function(k,R){if(C(k))return k.clone();var I=typeof R=="object"?R:{};return I.date=k,I.args=arguments,new O(I)},_=T;_.l=A,_.i=C,_.w=function(k,R){return N(k,{locale:R.$L,utc:R.$u,x:R.$x,$offset:R.$offset})};var O=function(){function k(I){this.$L=A(I.locale,null,!0),this.parse(I),this.$x=this.$x||I.x||{},this[S]=!0}var R=k.prototype;return R.parse=function(I){this.$d=function(M){var D=M.date,B=M.utc;if(D===null)return new Date(NaN);if(_.u(D))return new Date;if(D instanceof Date)return new Date(D);if(typeof D=="string"&&!/Z$/i.test(D)){var $=D.match(v);if($){var F=$[2]-1||0,G=($[7]||"0").substring(0,3);return B?new Date(Date.UTC($[1],F,$[3]||1,$[4]||0,$[5]||0,$[6]||0,G)):new Date($[1],F,$[3]||1,$[4]||0,$[5]||0,$[6]||0,G)}}return new Date(D)}(I),this.init()},R.init=function(){var I=this.$d;this.$y=I.getFullYear(),this.$M=I.getMonth(),this.$D=I.getDate(),this.$W=I.getDay(),this.$H=I.getHours(),this.$m=I.getMinutes(),this.$s=I.getSeconds(),this.$ms=I.getMilliseconds()},R.$utils=function(){return _},R.isValid=function(){return this.$d.toString()!==m},R.isSame=function(I,M){var D=N(I);return this.startOf(M)<=D&&D<=this.endOf(M)},R.isAfter=function(I,M){return N(I)<this.startOf(M)},R.isBefore=function(I,M){return this.endOf(M)<N(I)},R.$g=function(I,M,D){return _.u(I)?this[M]:this.set(D,I)},R.unix=function(){return Math.floor(this.valueOf()/1e3)},R.valueOf=function(){return this.$d.getTime()},R.startOf=function(I,M){var D=this,B=!!_.u(M)||M,$=_.p(I),F=function(K,Z){var X=_.w(D.$u?Date.UTC(D.$y,Z,K):new Date(D.$y,Z,K),D);return B?X:X.endOf(u)},G=function(K,Z){return _.w(D.toDate()[K].apply(D.toDate("s"),(B?[0,0,0,0]:[23,59,59,999]).slice(Z)),D)},W=this.$W,J=this.$M,q=this.$D,ne="set"+(this.$u?"UTC":"");switch($){case p:return B?F(1,0):F(31,11);case d:return B?F(1,J):F(0,J+1);case h:var ae=this.$locale().weekStart||0,pe=(W<ae?W+7:W)-ae;return F(B?q-pe:q+(6-pe),J);case u:case g:return G(ne+"Hours",0);case l:return G(ne+"Minutes",1);case o:return G(ne+"Seconds",2);case s:return G(ne+"Milliseconds",3);default:return this.clone()}},R.endOf=function(I){return this.startOf(I,!1)},R.$set=function(I,M){var D,B=_.p(I),$="set"+(this.$u?"UTC":""),F=(D={},D[u]=$+"Date",D[g]=$+"Date",D[d]=$+"Month",D[p]=$+"FullYear",D[l]=$+"Hours",D[o]=$+"Minutes",D[s]=$+"Seconds",D[a]=$+"Milliseconds",D)[B],G=B===u?this.$D+(M-this.$W):M;if(B===d||B===p){var W=this.clone().set(g,1);W.$d[F](G),W.init(),this.$d=W.set(g,Math.min(this.$D,W.daysInMonth())).$d}else F&&this.$d[F](G);return this.init(),this},R.set=function(I,M){return this.clone().$set(I,M)},R.get=function(I){return this[_.p(I)]()},R.add=function(I,M){var D,B=this;I=Number(I);var $=_.p(M),F=function(J){var q=N(B);return _.w(q.date(q.date()+Math.round(J*I)),B)};if($===d)return this.set(d,this.$M+I);if($===p)return this.set(p,this.$y+I);if($===u)return F(1);if($===h)return F(7);var G=(D={},D[o]=n,D[l]=i,D[s]=r,D)[$]||1,W=this.$d.getTime()+I*G;return _.w(W,this)},R.subtract=function(I,M){return this.add(-1*I,M)},R.format=function(I){var M=this,D=this.$locale();if(!this.isValid())return D.invalidDate||m;var B=I||"YYYY-MM-DDTHH:mm:ssZ",$=_.z(this),F=this.$H,G=this.$m,W=this.$M,J=D.weekdays,q=D.months,ne=D.meridiem,ae=function(Z,X,Y,ee){return Z&&(Z[X]||Z(M,B))||Y[X].slice(0,ee)},pe=function(Z){return _.s(F%12||12,Z,"0")},K=ne||function(Z,X,Y){var ee=Z<12?"AM":"PM";return Y?ee.toLowerCase():ee};return B.replace(y,function(Z,X){return X||function(Y){switch(Y){case"YY":return String(M.$y).slice(-2);case"YYYY":return _.s(M.$y,4,"0");case"M":return W+1;case"MM":return _.s(W+1,2,"0");case"MMM":return ae(D.monthsShort,W,q,3);case"MMMM":return ae(q,W);case"D":return M.$D;case"DD":return _.s(M.$D,2,"0");case"d":return String(M.$W);case"dd":return ae(D.weekdaysMin,M.$W,J,2);case"ddd":return ae(D.weekdaysShort,M.$W,J,3);case"dddd":return J[M.$W];case"H":return String(F);case"HH":return _.s(F,2,"0");case"h":return pe(1);case"hh":return pe(2);case"a":return K(F,G,!0);case"A":return K(F,G,!1);case"m":return String(G);case"mm":return _.s(G,2,"0");case"s":return String(M.$s);case"ss":return _.s(M.$s,2,"0");case"SSS":return _.s(M.$ms,3,"0");case"Z":return $}return null}(Z)||$.replace(":","")})},R.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},R.diff=function(I,M,D){var B,$=this,F=_.p(M),G=N(I),W=(G.utcOffset()-this.utcOffset())*n,J=this-G,q=function(){return _.m($,G)};switch(F){case p:B=q()/12;break;case d:B=q();break;case f:B=q()/3;break;case h:B=(J-W)/6048e5;break;case u:B=(J-W)/864e5;break;case l:B=J/i;break;case o:B=J/n;break;case s:B=J/r;break;default:B=J}return D?B:_.a(B)},R.daysInMonth=function(){return this.endOf(d).$D},R.$locale=function(){return L[this.$L]},R.locale=function(I,M){if(!I)return this.$L;var D=this.clone(),B=A(I,M,!0);return B&&(D.$L=B),D},R.clone=function(){return _.w(this.$d,this)},R.toDate=function(){return new Date(this.valueOf())},R.toJSON=function(){return this.isValid()?this.toISOString():null},R.toISOString=function(){return this.$d.toISOString()},R.toString=function(){return this.$d.toUTCString()},k}(),P=O.prototype;return N.prototype=P,[["$ms",a],["$s",s],["$m",o],["$H",l],["$W",u],["$M",d],["$y",p],["$D",g]].forEach(function(k){P[k[1]]=function(R){return this.$g(R,k[0],k[1])}}),N.extend=function(k,R){return k.$i||(k(R,O,N),k.$i=!0),N},N.locale=A,N.isDayjs=C,N.unix=function(k){return N(1e3*k)},N.en=L[E],N.Ls=L,N.p={},N})})(lN);var eY=lN.exports;const wi=yd(eY);var cN=Object.defineProperty,x=(t,e)=>cN(t,"name",{value:e,configurable:!0}),Dy=(t,e)=>{for(var r in e)cN(t,r,{get:e[r],enumerable:!0})},po={trace:0,debug:1,info:2,warn:3,error:4,fatal:5},ie={trace:x((...t)=>{},"trace"),debug:x((...t)=>{},"debug"),info:x((...t)=>{},"info"),warn:x((...t)=>{},"warn"),error:x((...t)=>{},"error"),fatal:x((...t)=>{},"fatal")},YT=x(function(t="fatal"){let e=po.fatal;typeof t=="string"?t.toLowerCase()in po&&(e=po[t]):typeof t=="number"&&(e=t),ie.trace=()=>{},ie.debug=()=>{},ie.info=()=>{},ie.warn=()=>{},ie.error=()=>{},ie.fatal=()=>{},e<=po.fatal&&(ie.fatal=console.error?console.error.bind(console,Ba("FATAL"),"color: orange"):console.log.bind(console,"\x1B[35m",Ba("FATAL"))),e<=po.error&&(ie.error=console.error?console.error.bind(console,Ba("ERROR"),"color: orange"):console.log.bind(console,"\x1B[31m",Ba("ERROR"))),e<=po.warn&&(ie.warn=console.warn?console.warn.bind(console,Ba("WARN"),"color: orange"):console.log.bind(console,"\x1B[33m",Ba("WARN"))),e<=po.info&&(ie.info=console.info?console.info.bind(console,Ba("INFO"),"color: lightblue"):console.log.bind(console,"\x1B[34m",Ba("INFO"))),e<=po.debug&&(ie.debug=console.debug?console.debug.bind(console,Ba("DEBUG"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",Ba("DEBUG"))),e<=po.trace&&(ie.trace=console.debug?console.debug.bind(console,Ba("TRACE"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",Ba("TRACE")))},"setLogLevel"),Ba=x(t=>`%c${wi().format("ss.SSS")} : ${t} : `,"format");const O1={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:t=>t>=255?255:t<0?0:t,g:t=>t>=255?255:t<0?0:t,b:t=>t>=255?255:t<0?0:t,h:t=>t%360,s:t=>t>=100?100:t<0?0:t,l:t=>t>=100?100:t<0?0:t,a:t=>t>=1?1:t<0?0:t},toLinear:t=>{const e=t/255;return t>.03928?Math.pow((e+.055)/1.055,2.4):e/12.92},hue2rgb:(t,e,r)=>(r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+(e-t)*6*r:r<1/2?e:r<2/3?t+(e-t)*(2/3-r)*6:t),hsl2rgb:({h:t,s:e,l:r},n)=>{if(!e)return r*2.55;t/=360,e/=100,r/=100;const i=r<.5?r*(1+e):r+e-r*e,a=2*r-i;switch(n){case"r":return O1.hue2rgb(a,i,t+1/3)*255;case"g":return O1.hue2rgb(a,i,t)*255;case"b":return O1.hue2rgb(a,i,t-1/3)*255}},rgb2hsl:({r:t,g:e,b:r},n)=>{t/=255,e/=255,r/=255;const i=Math.max(t,e,r),a=Math.min(t,e,r),s=(i+a)/2;if(n==="l")return s*100;if(i===a)return 0;const o=i-a,l=s>.5?o/(2-i-a):o/(i+a);if(n==="s")return l*100;switch(i){case t:return((e-r)/o+(e<r?6:0))*60;case e:return((r-t)/o+2)*60;case r:return((t-e)/o+4)*60;default:return-1}}},tY={clamp:(t,e,r)=>e>r?Math.min(e,Math.max(r,t)):Math.min(r,Math.max(e,t)),round:t=>Math.round(t*1e10)/1e10},rY={dec2hex:t=>{const e=Math.round(t).toString(16);return e.length>1?e:`0${e}`}},Xt={channel:O1,lang:tY,unit:rY},fl={};for(let t=0;t<=255;t++)fl[t]=Xt.unit.dec2hex(t);const gi={ALL:0,RGB:1,HSL:2};let nY=class{constructor(){this.type=gi.ALL}get(){return this.type}set(e){if(this.type&&this.type!==e)throw new Error("Cannot change both RGB and HSL channels at the same time");this.type=e}reset(){this.type=gi.ALL}is(e){return this.type===e}};class iY{constructor(e,r){this.color=r,this.changed=!1,this.data=e,this.type=new nY}set(e,r){return this.color=r,this.changed=!1,this.data=e,this.type.type=gi.ALL,this}_ensureHSL(){const e=this.data,{h:r,s:n,l:i}=e;r===void 0&&(e.h=Xt.channel.rgb2hsl(e,"h")),n===void 0&&(e.s=Xt.channel.rgb2hsl(e,"s")),i===void 0&&(e.l=Xt.channel.rgb2hsl(e,"l"))}_ensureRGB(){const e=this.data,{r,g:n,b:i}=e;r===void 0&&(e.r=Xt.channel.hsl2rgb(e,"r")),n===void 0&&(e.g=Xt.channel.hsl2rgb(e,"g")),i===void 0&&(e.b=Xt.channel.hsl2rgb(e,"b"))}get r(){const e=this.data,r=e.r;return!this.type.is(gi.HSL)&&r!==void 0?r:(this._ensureHSL(),Xt.channel.hsl2rgb(e,"r"))}get g(){const e=this.data,r=e.g;return!this.type.is(gi.HSL)&&r!==void 0?r:(this._ensureHSL(),Xt.channel.hsl2rgb(e,"g"))}get b(){const e=this.data,r=e.b;return!this.type.is(gi.HSL)&&r!==void 0?r:(this._ensureHSL(),Xt.channel.hsl2rgb(e,"b"))}get h(){const e=this.data,r=e.h;return!this.type.is(gi.RGB)&&r!==void 0?r:(this._ensureRGB(),Xt.channel.rgb2hsl(e,"h"))}get s(){const e=this.data,r=e.s;return!this.type.is(gi.RGB)&&r!==void 0?r:(this._ensureRGB(),Xt.channel.rgb2hsl(e,"s"))}get l(){const e=this.data,r=e.l;return!this.type.is(gi.RGB)&&r!==void 0?r:(this._ensureRGB(),Xt.channel.rgb2hsl(e,"l"))}get a(){return this.data.a}set r(e){this.type.set(gi.RGB),this.changed=!0,this.data.r=e}set g(e){this.type.set(gi.RGB),this.changed=!0,this.data.g=e}set b(e){this.type.set(gi.RGB),this.changed=!0,this.data.b=e}set h(e){this.type.set(gi.HSL),this.changed=!0,this.data.h=e}set s(e){this.type.set(gi.HSL),this.changed=!0,this.data.s=e}set l(e){this.type.set(gi.HSL),this.changed=!0,this.data.l=e}set a(e){this.changed=!0,this.data.a=e}}const My=new iY({r:0,g:0,b:0,a:0},"transparent"),kh={re:/^#((?:[a-f0-9]{2}){2,4}|[a-f0-9]{3})$/i,parse:t=>{if(t.charCodeAt(0)!==35)return;const e=t.match(kh.re);if(!e)return;const r=e[1],n=parseInt(r,16),i=r.length,a=i%4===0,s=i>4,o=s?1:17,l=s?8:4,u=a?0:-1,h=s?255:15;return My.set({r:(n>>l*(u+3)&h)*o,g:(n>>l*(u+2)&h)*o,b:(n>>l*(u+1)&h)*o,a:a?(n&h)*o/255:1},t)},stringify:t=>{const{r:e,g:r,b:n,a:i}=t;return i<1?`#${fl[Math.round(e)]}${fl[Math.round(r)]}${fl[Math.round(n)]}${fl[Math.round(i*255)]}`:`#${fl[Math.round(e)]}${fl[Math.round(r)]}${fl[Math.round(n)]}`}},Vc={re:/^hsla?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(?:deg|grad|rad|turn)?)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(%)?))?\s*?\)$/i,hueRe:/^(.+?)(deg|grad|rad|turn)$/i,_hue2deg:t=>{const e=t.match(Vc.hueRe);if(e){const[,r,n]=e;switch(n){case"grad":return Xt.channel.clamp.h(parseFloat(r)*.9);case"rad":return Xt.channel.clamp.h(parseFloat(r)*180/Math.PI);case"turn":return Xt.channel.clamp.h(parseFloat(r)*360)}}return Xt.channel.clamp.h(parseFloat(t))},parse:t=>{const e=t.charCodeAt(0);if(e!==104&&e!==72)return;const r=t.match(Vc.re);if(!r)return;const[,n,i,a,s,o]=r;return My.set({h:Vc._hue2deg(n),s:Xt.channel.clamp.s(parseFloat(i)),l:Xt.channel.clamp.l(parseFloat(a)),a:s?Xt.channel.clamp.a(o?parseFloat(s)/100:parseFloat(s)):1},t)},stringify:t=>{const{h:e,s:r,l:n,a:i}=t;return i<1?`hsla(${Xt.lang.round(e)}, ${Xt.lang.round(r)}%, ${Xt.lang.round(n)}%, ${i})`:`hsl(${Xt.lang.round(e)}, ${Xt.lang.round(r)}%, ${Xt.lang.round(n)}%)`}},y0={colors:{aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyanaqua:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",transparent:"#00000000",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},parse:t=>{t=t.toLowerCase();const e=y0.colors[t];if(e)return kh.parse(e)},stringify:t=>{const e=kh.stringify(t);for(const r in y0.colors)if(y0.colors[r]===e)return r}},mf={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:t=>{const e=t.charCodeAt(0);if(e!==114&&e!==82)return;const r=t.match(mf.re);if(!r)return;const[,n,i,a,s,o,l,u,h]=r;return My.set({r:Xt.channel.clamp.r(i?parseFloat(n)*2.55:parseFloat(n)),g:Xt.channel.clamp.g(s?parseFloat(a)*2.55:parseFloat(a)),b:Xt.channel.clamp.b(l?parseFloat(o)*2.55:parseFloat(o)),a:u?Xt.channel.clamp.a(h?parseFloat(u)/100:parseFloat(u)):1},t)},stringify:t=>{const{r:e,g:r,b:n,a:i}=t;return i<1?`rgba(${Xt.lang.round(e)}, ${Xt.lang.round(r)}, ${Xt.lang.round(n)}, ${Xt.lang.round(i)})`:`rgb(${Xt.lang.round(e)}, ${Xt.lang.round(r)}, ${Xt.lang.round(n)})`}},ws={format:{keyword:y0,hex:kh,rgb:mf,rgba:mf,hsl:Vc,hsla:Vc},parse:t=>{if(typeof t!="string")return t;const e=kh.parse(t)||mf.parse(t)||Vc.parse(t)||y0.parse(t);if(e)return e;throw new Error(`Unsupported color format: "${t}"`)},stringify:t=>!t.changed&&t.color?t.color:t.type.is(gi.HSL)||t.data.r===void 0?Vc.stringify(t):t.a<1||!Number.isInteger(t.r)||!Number.isInteger(t.g)||!Number.isInteger(t.b)?mf.stringify(t):kh.stringify(t)},uN=(t,e)=>{const r=ws.parse(t);for(const n in e)r[n]=Xt.channel.clamp[n](e[n]);return ws.stringify(r)},Al=(t,e,r=0,n=1)=>{if(typeof t!="number")return uN(t,{a:e});const i=My.set({r:Xt.channel.clamp.r(t),g:Xt.channel.clamp.g(e),b:Xt.channel.clamp.b(r),a:Xt.channel.clamp.a(n)});return ws.stringify(i)},XT=(t,e)=>Xt.lang.round(ws.parse(t)[e]),aY=t=>{const{r:e,g:r,b:n}=ws.parse(t),i=.2126*Xt.channel.toLinear(e)+.7152*Xt.channel.toLinear(r)+.0722*Xt.channel.toLinear(n);return Xt.lang.round(i)},sY=t=>aY(t)>=.5,ec=t=>!sY(t),hN=(t,e,r)=>{const n=ws.parse(t),i=n[e],a=Xt.channel.clamp[e](i+r);return i!==a&&(n[e]=a),ws.stringify(n)},_t=(t,e)=>hN(t,"l",e),It=(t,e)=>hN(t,"l",-e),Me=(t,e)=>{const r=ws.parse(t),n={};for(const i in e)e[i]&&(n[i]=r[i]+e[i]);return uN(t,n)},oY=(t,e,r=50)=>{const{r:n,g:i,b:a,a:s}=ws.parse(t),{r:o,g:l,b:u,a:h}=ws.parse(e),d=r/100,f=d*2-1,p=s-h,m=((f*p===-1?f:(f+p)/(1+f*p))+1)/2,v=1-m,y=n*m+o*v,b=i*m+l*v,w=a*m+u*v,T=s*d+h*(1-d);return Al(y,b,w,T)},xt=(t,e=100)=>{const r=ws.parse(t);return r.r=255-r.r,r.g=255-r.g,r.b=255-r.b,oY(r,t,e)};/*! @license DOMPurify 3.3.0 | (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.0/LICENSE */const{entries:dN,setPrototypeOf:_S,isFrozen:lY,getPrototypeOf:cY,getOwnPropertyDescriptor:uY}=Object;let{freeze:Ui,seal:Ka,create:z3}=Object,{apply:V3,construct:G3}=typeof Reflect<"u"&&Reflect;Ui||(Ui=function(e){return e});Ka||(Ka=function(e){return e});V3||(V3=function(e,r){for(var n=arguments.length,i=new Array(n>2?n-2:0),a=2;a<n;a++)i[a-2]=arguments[a];return e.apply(r,i)});G3||(G3=function(e){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];return new e(...n)});const Eg=Wi(Array.prototype.forEach),hY=Wi(Array.prototype.lastIndexOf),LS=Wi(Array.prototype.pop),Vd=Wi(Array.prototype.push),dY=Wi(Array.prototype.splice),P1=Wi(String.prototype.toLowerCase),kx=Wi(String.prototype.toString),Sx=Wi(String.prototype.match),Gd=Wi(String.prototype.replace),fY=Wi(String.prototype.indexOf),pY=Wi(String.prototype.trim),as=Wi(Object.prototype.hasOwnProperty),Ni=Wi(RegExp.prototype.test),Ud=gY(TypeError);function Wi(t){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];return V3(t,e,n)}}function gY(t){return function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return G3(t,r)}}function nr(t,e){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:P1;_S&&_S(t,null);let n=e.length;for(;n--;){let i=e[n];if(typeof i=="string"){const a=r(i);a!==i&&(lY(e)||(e[n]=a),i=a)}t[i]=!0}return t}function mY(t){for(let e=0;e<t.length;e++)as(t,e)||(t[e]=null);return t}function bo(t){const e=z3(null);for(const[r,n]of dN(t))as(t,r)&&(Array.isArray(n)?e[r]=mY(n):n&&typeof n=="object"&&n.constructor===Object?e[r]=bo(n):e[r]=n);return e}function Wd(t,e){for(;t!==null;){const n=uY(t,e);if(n){if(n.get)return Wi(n.get);if(typeof n.value=="function")return Wi(n.value)}t=cY(t)}function r(){return null}return r}const RS=Ui(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Cx=Ui(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Ax=Ui(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),vY=Ui(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),_x=Ui(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),yY=Ui(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),NS=Ui(["#text"]),DS=Ui(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),Lx=Ui(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),MS=Ui(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),kg=Ui(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),xY=Ka(/\{\{[\w\W]*|[\w\W]*\}\}/gm),bY=Ka(/<%[\w\W]*|[\w\W]*%>/gm),wY=Ka(/\$\{[\w\W]*/gm),TY=Ka(/^data-[\-\w.\u00B7-\uFFFF]+$/),EY=Ka(/^aria-[\-\w]+$/),fN=Ka(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),kY=Ka(/^(?:\w+script|data):/i),SY=Ka(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),pN=Ka(/^html$/i),CY=Ka(/^[a-z][.\w]*(-[.\w]+)+$/i);var IS=Object.freeze({__proto__:null,ARIA_ATTR:EY,ATTR_WHITESPACE:SY,CUSTOM_ELEMENT:CY,DATA_ATTR:TY,DOCTYPE_NAME:pN,ERB_EXPR:bY,IS_ALLOWED_URI:fN,IS_SCRIPT_OR_DATA:kY,MUSTACHE_EXPR:xY,TMPLIT_EXPR:wY});const Hd={element:1,text:3,progressingInstruction:7,comment:8,document:9},AY=function(){return typeof window>"u"?null:window},_Y=function(e,r){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let n=null;const i="data-tt-policy-suffix";r&&r.hasAttribute(i)&&(n=r.getAttribute(i));const a="dompurify"+(n?"#"+n:"");try{return e.createPolicy(a,{createHTML(s){return s},createScriptURL(s){return s}})}catch{return console.warn("TrustedTypes policy "+a+" could not be created."),null}},OS=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function gN(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:AY();const e=dt=>gN(dt);if(e.version="3.3.0",e.removed=[],!t||!t.document||t.document.nodeType!==Hd.document||!t.Element)return e.isSupported=!1,e;let{document:r}=t;const n=r,i=n.currentScript,{DocumentFragment:a,HTMLTemplateElement:s,Node:o,Element:l,NodeFilter:u,NamedNodeMap:h=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:d,DOMParser:f,trustedTypes:p}=t,g=l.prototype,m=Wd(g,"cloneNode"),v=Wd(g,"remove"),y=Wd(g,"nextSibling"),b=Wd(g,"childNodes"),w=Wd(g,"parentNode");if(typeof s=="function"){const dt=r.createElement("template");dt.content&&dt.content.ownerDocument&&(r=dt.content.ownerDocument)}let T,E="";const{implementation:L,createNodeIterator:S,createDocumentFragment:C,getElementsByTagName:A}=r,{importNode:N}=n;let _=OS();e.isSupported=typeof dN=="function"&&typeof w=="function"&&L&&L.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:O,ERB_EXPR:P,TMPLIT_EXPR:k,DATA_ATTR:R,ARIA_ATTR:I,IS_SCRIPT_OR_DATA:M,ATTR_WHITESPACE:D,CUSTOM_ELEMENT:B}=IS;let{IS_ALLOWED_URI:$}=IS,F=null;const G=nr({},[...RS,...Cx,...Ax,..._x,...NS]);let W=null;const J=nr({},[...DS,...Lx,...MS,...kg]);let q=Object.seal(z3(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}})),ne=null,ae=null;const pe=Object.seal(z3(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let K=!0,Z=!0,X=!1,Y=!0,ee=!1,j=!0,fe=!1,te=!1,Ae=!1,H=!1,Oe=!1,ue=!1,Ve=!0,Ge=!1;const Ue="user-content-";let ke=!0,Pe=!1,Se={},_e=null;const ze=nr({},["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 me=null;const De=nr({},["audio","video","img","source","image","track"]);let Q=null;const ce=nr({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),z="http://www.w3.org/1998/Math/MathML",oe="http://www.w3.org/2000/svg",se="http://www.w3.org/1999/xhtml";let ge=se,he=!1,be=null;const Ce=nr({},[z,oe,se],kx);let Te=nr({},["mi","mo","mn","ms","mtext"]),Ne=nr({},["annotation-xml"]);const Xe=nr({},["title","style","font","a","script"]);let Ye=null;const Ke=["application/xhtml+xml","text/html"],Ze="text/html";let Be=null,He=null;const ht=r.createElement("form"),st=function(Ee){return Ee instanceof RegExp||Ee instanceof Function},We=function(){let Ee=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(He&&He===Ee)){if((!Ee||typeof Ee!="object")&&(Ee={}),Ee=bo(Ee),Ye=Ke.indexOf(Ee.PARSER_MEDIA_TYPE)===-1?Ze:Ee.PARSER_MEDIA_TYPE,Be=Ye==="application/xhtml+xml"?kx:P1,F=as(Ee,"ALLOWED_TAGS")?nr({},Ee.ALLOWED_TAGS,Be):G,W=as(Ee,"ALLOWED_ATTR")?nr({},Ee.ALLOWED_ATTR,Be):J,be=as(Ee,"ALLOWED_NAMESPACES")?nr({},Ee.ALLOWED_NAMESPACES,kx):Ce,Q=as(Ee,"ADD_URI_SAFE_ATTR")?nr(bo(ce),Ee.ADD_URI_SAFE_ATTR,Be):ce,me=as(Ee,"ADD_DATA_URI_TAGS")?nr(bo(De),Ee.ADD_DATA_URI_TAGS,Be):De,_e=as(Ee,"FORBID_CONTENTS")?nr({},Ee.FORBID_CONTENTS,Be):ze,ne=as(Ee,"FORBID_TAGS")?nr({},Ee.FORBID_TAGS,Be):bo({}),ae=as(Ee,"FORBID_ATTR")?nr({},Ee.FORBID_ATTR,Be):bo({}),Se=as(Ee,"USE_PROFILES")?Ee.USE_PROFILES:!1,K=Ee.ALLOW_ARIA_ATTR!==!1,Z=Ee.ALLOW_DATA_ATTR!==!1,X=Ee.ALLOW_UNKNOWN_PROTOCOLS||!1,Y=Ee.ALLOW_SELF_CLOSE_IN_ATTR!==!1,ee=Ee.SAFE_FOR_TEMPLATES||!1,j=Ee.SAFE_FOR_XML!==!1,fe=Ee.WHOLE_DOCUMENT||!1,H=Ee.RETURN_DOM||!1,Oe=Ee.RETURN_DOM_FRAGMENT||!1,ue=Ee.RETURN_TRUSTED_TYPE||!1,Ae=Ee.FORCE_BODY||!1,Ve=Ee.SANITIZE_DOM!==!1,Ge=Ee.SANITIZE_NAMED_PROPS||!1,ke=Ee.KEEP_CONTENT!==!1,Pe=Ee.IN_PLACE||!1,$=Ee.ALLOWED_URI_REGEXP||fN,ge=Ee.NAMESPACE||se,Te=Ee.MATHML_TEXT_INTEGRATION_POINTS||Te,Ne=Ee.HTML_INTEGRATION_POINTS||Ne,q=Ee.CUSTOM_ELEMENT_HANDLING||{},Ee.CUSTOM_ELEMENT_HANDLING&&st(Ee.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(q.tagNameCheck=Ee.CUSTOM_ELEMENT_HANDLING.tagNameCheck),Ee.CUSTOM_ELEMENT_HANDLING&&st(Ee.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(q.attributeNameCheck=Ee.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),Ee.CUSTOM_ELEMENT_HANDLING&&typeof Ee.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(q.allowCustomizedBuiltInElements=Ee.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),ee&&(Z=!1),Oe&&(H=!0),Se&&(F=nr({},NS),W=[],Se.html===!0&&(nr(F,RS),nr(W,DS)),Se.svg===!0&&(nr(F,Cx),nr(W,Lx),nr(W,kg)),Se.svgFilters===!0&&(nr(F,Ax),nr(W,Lx),nr(W,kg)),Se.mathMl===!0&&(nr(F,_x),nr(W,MS),nr(W,kg))),Ee.ADD_TAGS&&(typeof Ee.ADD_TAGS=="function"?pe.tagCheck=Ee.ADD_TAGS:(F===G&&(F=bo(F)),nr(F,Ee.ADD_TAGS,Be))),Ee.ADD_ATTR&&(typeof Ee.ADD_ATTR=="function"?pe.attributeCheck=Ee.ADD_ATTR:(W===J&&(W=bo(W)),nr(W,Ee.ADD_ATTR,Be))),Ee.ADD_URI_SAFE_ATTR&&nr(Q,Ee.ADD_URI_SAFE_ATTR,Be),Ee.FORBID_CONTENTS&&(_e===ze&&(_e=bo(_e)),nr(_e,Ee.FORBID_CONTENTS,Be)),ke&&(F["#text"]=!0),fe&&nr(F,["html","head","body"]),F.table&&(nr(F,["tbody"]),delete ne.tbody),Ee.TRUSTED_TYPES_POLICY){if(typeof Ee.TRUSTED_TYPES_POLICY.createHTML!="function")throw Ud('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof Ee.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Ud('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');T=Ee.TRUSTED_TYPES_POLICY,E=T.createHTML("")}else T===void 0&&(T=_Y(p,i)),T!==null&&typeof E=="string"&&(E=T.createHTML(""));Ui&&Ui(Ee),He=Ee}},kt=nr({},[...Cx,...Ax,...vY]),qe=nr({},[..._x,...yY]),rt=function(Ee){let Je=w(Ee);(!Je||!Je.tagName)&&(Je={namespaceURI:ge,tagName:"template"});const wt=P1(Ee.tagName),or=P1(Je.tagName);return be[Ee.namespaceURI]?Ee.namespaceURI===oe?Je.namespaceURI===se?wt==="svg":Je.namespaceURI===z?wt==="svg"&&(or==="annotation-xml"||Te[or]):!!kt[wt]:Ee.namespaceURI===z?Je.namespaceURI===se?wt==="math":Je.namespaceURI===oe?wt==="math"&&Ne[or]:!!qe[wt]:Ee.namespaceURI===se?Je.namespaceURI===oe&&!Ne[or]||Je.namespaceURI===z&&!Te[or]?!1:!qe[wt]&&(Xe[wt]||!kt[wt]):!!(Ye==="application/xhtml+xml"&&be[Ee.namespaceURI]):!1},ct=function(Ee){Vd(e.removed,{element:Ee});try{w(Ee).removeChild(Ee)}catch{v(Ee)}},ut=function(Ee,Je){try{Vd(e.removed,{attribute:Je.getAttributeNode(Ee),from:Je})}catch{Vd(e.removed,{attribute:null,from:Je})}if(Je.removeAttribute(Ee),Ee==="is")if(H||Oe)try{ct(Je)}catch{}else try{Je.setAttribute(Ee,"")}catch{}},nt=function(Ee){let Je=null,wt=null;if(Ae)Ee="<remove></remove>"+Ee;else{const ur=Sx(Ee,/^[\r\n\t ]+/);wt=ur&&ur[0]}Ye==="application/xhtml+xml"&&ge===se&&(Ee='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+Ee+"</body></html>");const or=T?T.createHTML(Ee):Ee;if(ge===se)try{Je=new f().parseFromString(or,Ye)}catch{}if(!Je||!Je.documentElement){Je=L.createDocument(ge,"template",null);try{Je.documentElement.innerHTML=he?E:or}catch{}}const Ur=Je.body||Je.documentElement;return Ee&&wt&&Ur.insertBefore(r.createTextNode(wt),Ur.childNodes[0]||null),ge===se?A.call(Je,fe?"html":"body")[0]:fe?Je.documentElement:Ur},bt=function(Ee){return S.call(Ee.ownerDocument||Ee,Ee,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT|u.SHOW_PROCESSING_INSTRUCTION|u.SHOW_CDATA_SECTION,null)},Zt=function(Ee){return Ee instanceof d&&(typeof Ee.nodeName!="string"||typeof Ee.textContent!="string"||typeof Ee.removeChild!="function"||!(Ee.attributes instanceof h)||typeof Ee.removeAttribute!="function"||typeof Ee.setAttribute!="function"||typeof Ee.namespaceURI!="string"||typeof Ee.insertBefore!="function"||typeof Ee.hasChildNodes!="function")},Ot=function(Ee){return typeof o=="function"&&Ee instanceof o};function tr(dt,Ee,Je){Eg(dt,wt=>{wt.call(e,Ee,Je,He)})}const xr=function(Ee){let Je=null;if(tr(_.beforeSanitizeElements,Ee,null),Zt(Ee))return ct(Ee),!0;const wt=Be(Ee.nodeName);if(tr(_.uponSanitizeElement,Ee,{tagName:wt,allowedTags:F}),j&&Ee.hasChildNodes()&&!Ot(Ee.firstElementChild)&&Ni(/<[/\w!]/g,Ee.innerHTML)&&Ni(/<[/\w!]/g,Ee.textContent)||Ee.nodeType===Hd.progressingInstruction||j&&Ee.nodeType===Hd.comment&&Ni(/<[/\w]/g,Ee.data))return ct(Ee),!0;if(!(pe.tagCheck instanceof Function&&pe.tagCheck(wt))&&(!F[wt]||ne[wt])){if(!ne[wt]&&Wt(wt)&&(q.tagNameCheck instanceof RegExp&&Ni(q.tagNameCheck,wt)||q.tagNameCheck instanceof Function&&q.tagNameCheck(wt)))return!1;if(ke&&!_e[wt]){const or=w(Ee)||Ee.parentNode,Ur=b(Ee)||Ee.childNodes;if(Ur&&or){const ur=Ur.length;for(let Yr=ur-1;Yr>=0;--Yr){const fi=m(Ur[Yr],!0);fi.__removalCount=(Ee.__removalCount||0)+1,or.insertBefore(fi,y(Ee))}}}return ct(Ee),!0}return Ee instanceof l&&!rt(Ee)||(wt==="noscript"||wt==="noembed"||wt==="noframes")&&Ni(/<\/no(script|embed|frames)/i,Ee.innerHTML)?(ct(Ee),!0):(ee&&Ee.nodeType===Hd.text&&(Je=Ee.textContent,Eg([O,P,k],or=>{Je=Gd(Je,or," ")}),Ee.textContent!==Je&&(Vd(e.removed,{element:Ee.cloneNode()}),Ee.textContent=Je)),tr(_.afterSanitizeElements,Ee,null),!1)},rr=function(Ee,Je,wt){if(Ve&&(Je==="id"||Je==="name")&&(wt in r||wt in ht))return!1;if(!(Z&&!ae[Je]&&Ni(R,Je))){if(!(K&&Ni(I,Je))){if(!(pe.attributeCheck instanceof Function&&pe.attributeCheck(Je,Ee))){if(!W[Je]||ae[Je]){if(!(Wt(Ee)&&(q.tagNameCheck instanceof RegExp&&Ni(q.tagNameCheck,Ee)||q.tagNameCheck instanceof Function&&q.tagNameCheck(Ee))&&(q.attributeNameCheck instanceof RegExp&&Ni(q.attributeNameCheck,Je)||q.attributeNameCheck instanceof Function&&q.attributeNameCheck(Je,Ee))||Je==="is"&&q.allowCustomizedBuiltInElements&&(q.tagNameCheck instanceof RegExp&&Ni(q.tagNameCheck,wt)||q.tagNameCheck instanceof Function&&q.tagNameCheck(wt))))return!1}else if(!Q[Je]){if(!Ni($,Gd(wt,D,""))){if(!((Je==="src"||Je==="xlink:href"||Je==="href")&&Ee!=="script"&&fY(wt,"data:")===0&&me[Ee])){if(!(X&&!Ni(M,Gd(wt,D,"")))){if(wt)return!1}}}}}}}return!0},Wt=function(Ee){return Ee!=="annotation-xml"&&Sx(Ee,B)},cr=function(Ee){tr(_.beforeSanitizeAttributes,Ee,null);const{attributes:Je}=Ee;if(!Je||Zt(Ee))return;const wt={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:W,forceKeepAttr:void 0};let or=Je.length;for(;or--;){const Ur=Je[or],{name:ur,namespaceURI:Yr,value:fi}=Ur,xn=Be(ur),bn=fi;let pt=ur==="value"?bn:pY(bn);if(wt.attrName=xn,wt.attrValue=pt,wt.keepAttr=!0,wt.forceKeepAttr=void 0,tr(_.uponSanitizeAttribute,Ee,wt),pt=wt.attrValue,Ge&&(xn==="id"||xn==="name")&&(ut(ur,Ee),pt=Ue+pt),j&&Ni(/((--!?|])>)|<\/(style|title|textarea)/i,pt)){ut(ur,Ee);continue}if(xn==="attributename"&&Sx(pt,"href")){ut(ur,Ee);continue}if(wt.forceKeepAttr)continue;if(!wt.keepAttr){ut(ur,Ee);continue}if(!Y&&Ni(/\/>/i,pt)){ut(ur,Ee);continue}ee&&Eg([O,P,k],lt=>{pt=Gd(pt,lt," ")});const Tt=Be(Ee.nodeName);if(!rr(Tt,xn,pt)){ut(ur,Ee);continue}if(T&&typeof p=="object"&&typeof p.getAttributeType=="function"&&!Yr)switch(p.getAttributeType(Tt,xn)){case"TrustedHTML":{pt=T.createHTML(pt);break}case"TrustedScriptURL":{pt=T.createScriptURL(pt);break}}if(pt!==bn)try{Yr?Ee.setAttributeNS(Yr,ur,pt):Ee.setAttribute(ur,pt),Zt(Ee)?ct(Ee):LS(e.removed)}catch{ut(ur,Ee)}}tr(_.afterSanitizeAttributes,Ee,null)},an=function dt(Ee){let Je=null;const wt=bt(Ee);for(tr(_.beforeSanitizeShadowDOM,Ee,null);Je=wt.nextNode();)tr(_.uponSanitizeShadowNode,Je,null),xr(Je),cr(Je),Je.content instanceof a&&dt(Je.content);tr(_.afterSanitizeShadowDOM,Ee,null)};return e.sanitize=function(dt){let Ee=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Je=null,wt=null,or=null,Ur=null;if(he=!dt,he&&(dt="\x3C!-->"),typeof dt!="string"&&!Ot(dt))if(typeof dt.toString=="function"){if(dt=dt.toString(),typeof dt!="string")throw Ud("dirty is not a string, aborting")}else throw Ud("toString is not a function");if(!e.isSupported)return dt;if(te||We(Ee),e.removed=[],typeof dt=="string"&&(Pe=!1),Pe){if(dt.nodeName){const fi=Be(dt.nodeName);if(!F[fi]||ne[fi])throw Ud("root node is forbidden and cannot be sanitized in-place")}}else if(dt instanceof o)Je=nt("\x3C!---->"),wt=Je.ownerDocument.importNode(dt,!0),wt.nodeType===Hd.element&&wt.nodeName==="BODY"||wt.nodeName==="HTML"?Je=wt:Je.appendChild(wt);else{if(!H&&!ee&&!fe&&dt.indexOf("<")===-1)return T&&ue?T.createHTML(dt):dt;if(Je=nt(dt),!Je)return H?null:ue?E:""}Je&&Ae&&ct(Je.firstChild);const ur=bt(Pe?dt:Je);for(;or=ur.nextNode();)xr(or),cr(or),or.content instanceof a&&an(or.content);if(Pe)return dt;if(H){if(Oe)for(Ur=C.call(Je.ownerDocument);Je.firstChild;)Ur.appendChild(Je.firstChild);else Ur=Je;return(W.shadowroot||W.shadowrootmode)&&(Ur=N.call(n,Ur,!0)),Ur}let Yr=fe?Je.outerHTML:Je.innerHTML;return fe&&F["!doctype"]&&Je.ownerDocument&&Je.ownerDocument.doctype&&Je.ownerDocument.doctype.name&&Ni(pN,Je.ownerDocument.doctype.name)&&(Yr="<!DOCTYPE "+Je.ownerDocument.doctype.name+`>
`+Yr),ee&&Eg([O,P,k],fi=>{Yr=Gd(Yr,fi," ")}),T&&ue?T.createHTML(Yr):Yr},e.setConfig=function(){let dt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};We(dt),te=!0},e.clearConfig=function(){He=null,te=!1},e.isValidAttribute=function(dt,Ee,Je){He||We({});const wt=Be(dt),or=Be(Ee);return rr(wt,or,Je)},e.addHook=function(dt,Ee){typeof Ee=="function"&&Vd(_[dt],Ee)},e.removeHook=function(dt,Ee){if(Ee!==void 0){const Je=hY(_[dt],Ee);return Je===-1?void 0:dY(_[dt],Je,1)[0]}return LS(_[dt])},e.removeHooks=function(dt){_[dt]=[]},e.removeAllHooks=function(){_=OS()},e}var zh=gN(),mN=/^-{3}\s*[\n\r](.*?)[\n\r]-{3}\s*[\n\r]+/s,x0=/%{2}{\s*(?:(\w+)\s*:|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,LY=/\s*%%.*\n/gm,vN=class extends Error{static{x(this,"UnknownDiagramError")}constructor(t){super(t),this.name="UnknownDiagramError"}},Jc={},jT=x(function(t,e){t=t.replace(mN,"").replace(x0,"").replace(LY,`
`);for(const[r,{detector:n}]of Object.entries(Jc))if(n(t,e))return r;throw new vN(`No diagram type detected matching given configuration for text: ${t}`)},"detectType"),U3=x((...t)=>{for(const{id:e,detector:r,loader:n}of t)yN(e,r,n)},"registerLazyLoadedDiagrams"),yN=x((t,e,r)=>{Jc[t]&&ie.warn(`Detector with key ${t} already exists. Overwriting.`),Jc[t]={detector:e,loader:r},ie.debug(`Detector with key ${t} added${r?" with loader":""}`)},"addDetector"),RY=x(t=>Jc[t].loader,"getDiagramLoader"),W3=x((t,e,{depth:r=2,clobber:n=!1}={})=>{const i={depth:r,clobber:n};return Array.isArray(e)&&!Array.isArray(t)?(e.forEach(a=>W3(t,a,i)),t):Array.isArray(e)&&Array.isArray(t)?(e.forEach(a=>{t.includes(a)||t.push(a)}),t):t===void 0||r<=0?t!=null&&typeof t=="object"&&typeof e=="object"?Object.assign(t,e):e:(e!==void 0&&typeof t=="object"&&typeof e=="object"&&Object.keys(e).forEach(a=>{typeof e[a]=="object"&&(t[a]===void 0||typeof t[a]=="object")?(t[a]===void 0&&(t[a]=Array.isArray(e[a])?[]:{}),t[a]=W3(t[a],e[a],{depth:r-1,clobber:n})):(n||typeof t[a]!="object"&&typeof e[a]!="object")&&(t[a]=e[a])}),t)},"assignWithDepth"),mn=W3,Iy="#ffffff",Oy="#f2f2f2",Bi=x((t,e)=>e?Me(t,{s:-40,l:10}):Me(t,{s:-40,l:-10}),"mkBorder"),NY=class{static{x(this,"Theme")}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(){if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||Me(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||Me(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||Bi(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||Bi(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||Bi(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||Bi(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||xt(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||xt(this.tertiaryColor),this.lineColor=this.lineColor||xt(this.background),this.arrowheadColor=this.arrowheadColor||xt(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?It(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||It(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||xt(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||_t(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||It(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||It(this.mainBkg,10)):(this.rowOdd=this.rowOdd||_t(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||_t(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||Me(this.primaryColor,{h:30}),this.cScale4=this.cScale4||Me(this.primaryColor,{h:60}),this.cScale5=this.cScale5||Me(this.primaryColor,{h:90}),this.cScale6=this.cScale6||Me(this.primaryColor,{h:120}),this.cScale7=this.cScale7||Me(this.primaryColor,{h:150}),this.cScale8=this.cScale8||Me(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||Me(this.primaryColor,{h:270}),this.cScale10=this.cScale10||Me(this.primaryColor,{h:300}),this.cScale11=this.cScale11||Me(this.primaryColor,{h:330}),this.darkMode)for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this["cScale"+e]=It(this["cScale"+e],75);else for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this["cScale"+e]=It(this["cScale"+e],25);for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this["cScaleInv"+e]=this["cScaleInv"+e]||xt(this["cScale"+e]);for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this.darkMode?this["cScalePeer"+e]=this["cScalePeer"+e]||_t(this["cScale"+e],10):this["cScalePeer"+e]=this["cScalePeer"+e]||It(this["cScale"+e],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this["cScaleLabel"+e]=this["cScaleLabel"+e]||this.scaleLabelColor;const t=this.darkMode?-4:-1;for(let e=0;e<5;e++)this["surface"+e]=this["surface"+e]||Me(this.mainBkg,{h:180,s:-15,l:t*(5+e*3)}),this["surfacePeer"+e]=this["surfacePeer"+e]||Me(this.mainBkg,{h:180,s:-15,l:t*(8+e*3)});this.classText=this.classText||this.textColor,this.fillType0=this.fillType0||this.primaryColor,this.fillType1=this.fillType1||this.secondaryColor,this.fillType2=this.fillType2||Me(this.primaryColor,{h:64}),this.fillType3=this.fillType3||Me(this.secondaryColor,{h:64}),this.fillType4=this.fillType4||Me(this.primaryColor,{h:-64}),this.fillType5=this.fillType5||Me(this.secondaryColor,{h:-64}),this.fillType6=this.fillType6||Me(this.primaryColor,{h:128}),this.fillType7=this.fillType7||Me(this.secondaryColor,{h:128}),this.pie1=this.pie1||this.primaryColor,this.pie2=this.pie2||this.secondaryColor,this.pie3=this.pie3||this.tertiaryColor,this.pie4=this.pie4||Me(this.primaryColor,{l:-10}),this.pie5=this.pie5||Me(this.secondaryColor,{l:-10}),this.pie6=this.pie6||Me(this.tertiaryColor,{l:-10}),this.pie7=this.pie7||Me(this.primaryColor,{h:60,l:-10}),this.pie8=this.pie8||Me(this.primaryColor,{h:-60,l:-10}),this.pie9=this.pie9||Me(this.primaryColor,{h:120,l:0}),this.pie10=this.pie10||Me(this.primaryColor,{h:60,l:-20}),this.pie11=this.pie11||Me(this.primaryColor,{h:-60,l:-20}),this.pie12=this.pie12||Me(this.primaryColor,{h:120,l:-10}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.radar={axisColor:this.radar?.axisColor||this.lineColor,axisStrokeWidth:this.radar?.axisStrokeWidth||2,axisLabelFontSize:this.radar?.axisLabelFontSize||12,curveOpacity:this.radar?.curveOpacity||.5,curveStrokeWidth:this.radar?.curveStrokeWidth||2,graticuleColor:this.radar?.graticuleColor||"#DEDEDE",graticuleStrokeWidth:this.radar?.graticuleStrokeWidth||1,graticuleOpacity:this.radar?.graticuleOpacity||.3,legendBoxSize:this.radar?.legendBoxSize||12,legendFontSize:this.radar?.legendFontSize||12},this.archEdgeColor=this.archEdgeColor||"#777",this.archEdgeArrowColor=this.archEdgeArrowColor||"#777",this.archEdgeWidth=this.archEdgeWidth||"3",this.archGroupBorderColor=this.archGroupBorderColor||"#000",this.archGroupBorderWidth=this.archGroupBorderWidth||"2px",this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||Me(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||Me(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||Me(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||Me(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||Me(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||Me(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||ec(this.quadrant1Fill)?_t(this.quadrant1Fill):It(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#FFF4DD,#FFD8B1,#FFA07A,#ECEFF1,#D6DBDF,#C3E0A8,#FFB6A4,#FFD74D,#738FA7,#FFFFF0"},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?It(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||this.primaryColor,this.git1=this.git1||this.secondaryColor,this.git2=this.git2||this.tertiaryColor,this.git3=this.git3||Me(this.primaryColor,{h:-30}),this.git4=this.git4||Me(this.primaryColor,{h:-60}),this.git5=this.git5||Me(this.primaryColor,{h:-90}),this.git6=this.git6||Me(this.primaryColor,{h:60}),this.git7=this.git7||Me(this.primaryColor,{h:120}),this.darkMode?(this.git0=_t(this.git0,25),this.git1=_t(this.git1,25),this.git2=_t(this.git2,25),this.git3=_t(this.git3,25),this.git4=_t(this.git4,25),this.git5=_t(this.git5,25),this.git6=_t(this.git6,25),this.git7=_t(this.git7,25)):(this.git0=It(this.git0,25),this.git1=It(this.git1,25),this.git2=It(this.git2,25),this.git3=It(this.git3,25),this.git4=It(this.git4,25),this.git5=It(this.git5,25),this.git6=It(this.git6,25),this.git7=It(this.git7,25)),this.gitInv0=this.gitInv0||xt(this.git0),this.gitInv1=this.gitInv1||xt(this.git1),this.gitInv2=this.gitInv2||xt(this.git2),this.gitInv3=this.gitInv3||xt(this.git3),this.gitInv4=this.gitInv4||xt(this.git4),this.gitInv5=this.gitInv5||xt(this.git5),this.gitInv6=this.gitInv6||xt(this.git6),this.gitInv7=this.gitInv7||xt(this.git7),this.branchLabelColor=this.branchLabelColor||(this.darkMode?"black":this.labelTextColor),this.gitBranchLabel0=this.gitBranchLabel0||this.branchLabelColor,this.gitBranchLabel1=this.gitBranchLabel1||this.branchLabelColor,this.gitBranchLabel2=this.gitBranchLabel2||this.branchLabelColor,this.gitBranchLabel3=this.gitBranchLabel3||this.branchLabelColor,this.gitBranchLabel4=this.gitBranchLabel4||this.branchLabelColor,this.gitBranchLabel5=this.gitBranchLabel5||this.branchLabelColor,this.gitBranchLabel6=this.gitBranchLabel6||this.branchLabelColor,this.gitBranchLabel7=this.gitBranchLabel7||this.branchLabelColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||Iy,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Oy}calculate(t){if(typeof t!="object"){this.updateColors();return}const e=Object.keys(t);e.forEach(r=>{this[r]=t[r]}),this.updateColors(),e.forEach(r=>{this[r]=t[r]})}},DY=x(t=>{const e=new NY;return e.calculate(t),e},"getThemeVariables"),MY=class{static{x(this,"Theme")}constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=_t(this.primaryColor,16),this.tertiaryColor=Me(this.primaryColor,{h:-160}),this.primaryBorderColor=xt(this.background),this.secondaryBorderColor=Bi(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Bi(this.tertiaryColor,this.darkMode),this.primaryTextColor=xt(this.primaryColor),this.secondaryTextColor=xt(this.secondaryColor),this.tertiaryTextColor=xt(this.tertiaryColor),this.lineColor=xt(this.background),this.textColor=xt(this.background),this.mainBkg="#1f2020",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=_t(xt("#323D47"),10),this.lineColor="calculated",this.border1="#ccc",this.border2=Al(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=It("#EAE8D9",30),this.altSectionBkgColor="calculated",this.sectionBkgColor2="#EAE8D9",this.excludeBkgColor=It(this.sectionBkgColor,10),this.taskBorderColor=Al(255,255,255,70),this.taskBkgColor="calculated",this.taskTextColor="calculated",this.taskTextLightColor="calculated",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor=Al(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||_t(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||It(this.mainBkg,10),this.labelColor="calculated",this.errorBkgColor="#a44141",this.errorTextColor="#ddd"}updateColors(){this.secondBkg=_t(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=_t(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=_t(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=this.darkTextColor,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=Me(this.primaryColor,{h:64}),this.fillType3=Me(this.secondaryColor,{h:64}),this.fillType4=Me(this.primaryColor,{h:-64}),this.fillType5=Me(this.secondaryColor,{h:-64}),this.fillType6=Me(this.primaryColor,{h:128}),this.fillType7=Me(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||Me(this.primaryColor,{h:30}),this.cScale4=this.cScale4||Me(this.primaryColor,{h:60}),this.cScale5=this.cScale5||Me(this.primaryColor,{h:90}),this.cScale6=this.cScale6||Me(this.primaryColor,{h:120}),this.cScale7=this.cScale7||Me(this.primaryColor,{h:150}),this.cScale8=this.cScale8||Me(this.primaryColor,{h:210}),this.cScale9=this.cScale9||Me(this.primaryColor,{h:270}),this.cScale10=this.cScale10||Me(this.primaryColor,{h:300}),this.cScale11=this.cScale11||Me(this.primaryColor,{h:330});for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleInv"+t]=this["cScaleInv"+t]||xt(this["cScale"+t]);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScalePeer"+t]=this["cScalePeer"+t]||_t(this["cScale"+t],10);for(let t=0;t<5;t++)this["surface"+t]=this["surface"+t]||Me(this.mainBkg,{h:30,s:-30,l:-(-10+t*4)}),this["surfacePeer"+t]=this["surfacePeer"+t]||Me(this.mainBkg,{h:30,s:-30,l:-(-7+t*4)});this.scaleLabelColor=this.scaleLabelColor||(this.darkMode?"black":this.labelTextColor);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleLabel"+t]=this["cScaleLabel"+t]||this.scaleLabelColor;for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["pie"+t]=this["cScale"+t];this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||Me(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||Me(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||Me(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||Me(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||Me(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||Me(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||ec(this.quadrant1Fill)?_t(this.quadrant1Fill):It(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#3498db,#2ecc71,#e74c3c,#f1c40f,#bdc3c7,#ffffff,#34495e,#9b59b6,#1abc9c,#e67e22"},this.packet={startByteColor:this.primaryTextColor,endByteColor:this.primaryTextColor,labelColor:this.primaryTextColor,titleColor:this.primaryTextColor,blockStrokeColor:this.primaryTextColor,blockFillColor:this.background},this.radar={axisColor:this.radar?.axisColor||this.lineColor,axisStrokeWidth:this.radar?.axisStrokeWidth||2,axisLabelFontSize:this.radar?.axisLabelFontSize||12,curveOpacity:this.radar?.curveOpacity||.5,curveStrokeWidth:this.radar?.curveStrokeWidth||2,graticuleColor:this.radar?.graticuleColor||"#DEDEDE",graticuleStrokeWidth:this.radar?.graticuleStrokeWidth||1,graticuleOpacity:this.radar?.graticuleOpacity||.3,legendBoxSize:this.radar?.legendBoxSize||12,legendFontSize:this.radar?.legendFontSize||12},this.classText=this.primaryTextColor,this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?It(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=_t(this.secondaryColor,20),this.git1=_t(this.pie2||this.secondaryColor,20),this.git2=_t(this.pie3||this.tertiaryColor,20),this.git3=_t(this.pie4||Me(this.primaryColor,{h:-30}),20),this.git4=_t(this.pie5||Me(this.primaryColor,{h:-60}),20),this.git5=_t(this.pie6||Me(this.primaryColor,{h:-90}),10),this.git6=_t(this.pie7||Me(this.primaryColor,{h:60}),10),this.git7=_t(this.pie8||Me(this.primaryColor,{h:120}),20),this.gitInv0=this.gitInv0||xt(this.git0),this.gitInv1=this.gitInv1||xt(this.git1),this.gitInv2=this.gitInv2||xt(this.git2),this.gitInv3=this.gitInv3||xt(this.git3),this.gitInv4=this.gitInv4||xt(this.git4),this.gitInv5=this.gitInv5||xt(this.git5),this.gitInv6=this.gitInv6||xt(this.git6),this.gitInv7=this.gitInv7||xt(this.git7),this.gitBranchLabel0=this.gitBranchLabel0||xt(this.labelTextColor),this.gitBranchLabel1=this.gitBranchLabel1||this.labelTextColor,this.gitBranchLabel2=this.gitBranchLabel2||this.labelTextColor,this.gitBranchLabel3=this.gitBranchLabel3||xt(this.labelTextColor),this.gitBranchLabel4=this.gitBranchLabel4||this.labelTextColor,this.gitBranchLabel5=this.gitBranchLabel5||this.labelTextColor,this.gitBranchLabel6=this.gitBranchLabel6||this.labelTextColor,this.gitBranchLabel7=this.gitBranchLabel7||this.labelTextColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||_t(this.background,12),this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||_t(this.background,2),this.nodeBorder=this.nodeBorder||"#999"}calculate(t){if(typeof t!="object"){this.updateColors();return}const e=Object.keys(t);e.forEach(r=>{this[r]=t[r]}),this.updateColors(),e.forEach(r=>{this[r]=t[r]})}},IY=x(t=>{const e=new MY;return e.calculate(t),e},"getThemeVariables"),OY=class{static{x(this,"Theme")}constructor(){this.background="#f4f4f4",this.primaryColor="#ECECFF",this.secondaryColor=Me(this.primaryColor,{h:120}),this.secondaryColor="#ffffde",this.tertiaryColor=Me(this.primaryColor,{h:-160}),this.primaryBorderColor=Bi(this.primaryColor,this.darkMode),this.secondaryBorderColor=Bi(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Bi(this.tertiaryColor,this.darkMode),this.primaryTextColor=xt(this.primaryColor),this.secondaryTextColor=xt(this.secondaryColor),this.tertiaryTextColor=xt(this.tertiaryColor),this.lineColor=xt(this.background),this.textColor=xt(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=Al(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(){this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||Me(this.primaryColor,{h:30}),this.cScale4=this.cScale4||Me(this.primaryColor,{h:60}),this.cScale5=this.cScale5||Me(this.primaryColor,{h:90}),this.cScale6=this.cScale6||Me(this.primaryColor,{h:120}),this.cScale7=this.cScale7||Me(this.primaryColor,{h:150}),this.cScale8=this.cScale8||Me(this.primaryColor,{h:210}),this.cScale9=this.cScale9||Me(this.primaryColor,{h:270}),this.cScale10=this.cScale10||Me(this.primaryColor,{h:300}),this.cScale11=this.cScale11||Me(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||It(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||It(this.tertiaryColor,40);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScale"+t]=It(this["cScale"+t],10),this["cScalePeer"+t]=this["cScalePeer"+t]||It(this["cScale"+t],25);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleInv"+t]=this["cScaleInv"+t]||Me(this["cScale"+t],{h:180});for(let t=0;t<5;t++)this["surface"+t]=this["surface"+t]||Me(this.mainBkg,{h:30,l:-(5+t*5)}),this["surfacePeer"+t]=this["surfacePeer"+t]||Me(this.mainBkg,{h:30,l:-(7+t*5)});if(this.scaleLabelColor=this.scaleLabelColor!=="calculated"&&this.scaleLabelColor?this.scaleLabelColor:this.labelTextColor,this.labelTextColor!=="calculated"){this.cScaleLabel0=this.cScaleLabel0||xt(this.labelTextColor),this.cScaleLabel3=this.cScaleLabel3||xt(this.labelTextColor);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleLabel"+t]=this["cScaleLabel"+t]||this.labelTextColor}this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.titleColor=this.textColor,this.edgeLabelBackground=this.labelBackground,this.actorBorder=_t(this.border1,23),this.actorBkg=this.mainBkg,this.labelBoxBkgColor=this.actorBkg,this.signalColor=this.textColor,this.signalTextColor=this.textColor,this.labelBoxBorderColor=this.actorBorder,this.labelTextColor=this.actorTextColor,this.loopTextColor=this.actorTextColor,this.noteBorderColor=this.border2,this.noteTextColor=this.actorTextColor,this.actorLineColor=this.actorBorder,this.taskTextColor=this.taskTextLightColor,this.taskTextOutsideColor=this.taskTextDarkColor,this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.rowOdd=this.rowOdd||_t(this.primaryColor,75)||"#ffffff",this.rowEven=this.rowEven||_t(this.primaryColor,1),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||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.specialStateColor=this.lineColor,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.classText=this.primaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=Me(this.primaryColor,{h:64}),this.fillType3=Me(this.secondaryColor,{h:64}),this.fillType4=Me(this.primaryColor,{h:-64}),this.fillType5=Me(this.secondaryColor,{h:-64}),this.fillType6=Me(this.primaryColor,{h:128}),this.fillType7=Me(this.secondaryColor,{h:128}),this.pie1=this.pie1||this.primaryColor,this.pie2=this.pie2||this.secondaryColor,this.pie3=this.pie3||Me(this.tertiaryColor,{l:-40}),this.pie4=this.pie4||Me(this.primaryColor,{l:-10}),this.pie5=this.pie5||Me(this.secondaryColor,{l:-30}),this.pie6=this.pie6||Me(this.tertiaryColor,{l:-20}),this.pie7=this.pie7||Me(this.primaryColor,{h:60,l:-20}),this.pie8=this.pie8||Me(this.primaryColor,{h:-60,l:-40}),this.pie9=this.pie9||Me(this.primaryColor,{h:120,l:-40}),this.pie10=this.pie10||Me(this.primaryColor,{h:60,l:-40}),this.pie11=this.pie11||Me(this.primaryColor,{h:-90,l:-40}),this.pie12=this.pie12||Me(this.primaryColor,{h:120,l:-30}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||Me(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||Me(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||Me(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||Me(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||Me(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||Me(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||ec(this.quadrant1Fill)?_t(this.quadrant1Fill):It(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.radar={axisColor:this.radar?.axisColor||this.lineColor,axisStrokeWidth:this.radar?.axisStrokeWidth||2,axisLabelFontSize:this.radar?.axisLabelFontSize||12,curveOpacity:this.radar?.curveOpacity||.5,curveStrokeWidth:this.radar?.curveStrokeWidth||2,graticuleColor:this.radar?.graticuleColor||"#DEDEDE",graticuleStrokeWidth:this.radar?.graticuleStrokeWidth||1,graticuleOpacity:this.radar?.graticuleOpacity||.3,legendBoxSize:this.radar?.legendBoxSize||12,legendFontSize:this.radar?.legendFontSize||12},this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#ECECFF,#8493A6,#FFC3A0,#DCDDE1,#B8E994,#D1A36F,#C3CDE6,#FFB6C1,#496078,#F8F3E3"},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||this.labelBackground,this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||this.primaryColor,this.git1=this.git1||this.secondaryColor,this.git2=this.git2||this.tertiaryColor,this.git3=this.git3||Me(this.primaryColor,{h:-30}),this.git4=this.git4||Me(this.primaryColor,{h:-60}),this.git5=this.git5||Me(this.primaryColor,{h:-90}),this.git6=this.git6||Me(this.primaryColor,{h:60}),this.git7=this.git7||Me(this.primaryColor,{h:120}),this.darkMode?(this.git0=_t(this.git0,25),this.git1=_t(this.git1,25),this.git2=_t(this.git2,25),this.git3=_t(this.git3,25),this.git4=_t(this.git4,25),this.git5=_t(this.git5,25),this.git6=_t(this.git6,25),this.git7=_t(this.git7,25)):(this.git0=It(this.git0,25),this.git1=It(this.git1,25),this.git2=It(this.git2,25),this.git3=It(this.git3,25),this.git4=It(this.git4,25),this.git5=It(this.git5,25),this.git6=It(this.git6,25),this.git7=It(this.git7,25)),this.gitInv0=this.gitInv0||It(xt(this.git0),25),this.gitInv1=this.gitInv1||xt(this.git1),this.gitInv2=this.gitInv2||xt(this.git2),this.gitInv3=this.gitInv3||xt(this.git3),this.gitInv4=this.gitInv4||xt(this.git4),this.gitInv5=this.gitInv5||xt(this.git5),this.gitInv6=this.gitInv6||xt(this.git6),this.gitInv7=this.gitInv7||xt(this.git7),this.gitBranchLabel0=this.gitBranchLabel0||xt(this.labelTextColor),this.gitBranchLabel1=this.gitBranchLabel1||this.labelTextColor,this.gitBranchLabel2=this.gitBranchLabel2||this.labelTextColor,this.gitBranchLabel3=this.gitBranchLabel3||xt(this.labelTextColor),this.gitBranchLabel4=this.gitBranchLabel4||this.labelTextColor,this.gitBranchLabel5=this.gitBranchLabel5||this.labelTextColor,this.gitBranchLabel6=this.gitBranchLabel6||this.labelTextColor,this.gitBranchLabel7=this.gitBranchLabel7||this.labelTextColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||Iy,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Oy}calculate(t){if(Object.keys(this).forEach(r=>{this[r]==="calculated"&&(this[r]=void 0)}),typeof t!="object"){this.updateColors();return}const e=Object.keys(t);e.forEach(r=>{this[r]=t[r]}),this.updateColors(),e.forEach(r=>{this[r]=t[r]})}},Py=x(t=>{const e=new OY;return e.calculate(t),e},"getThemeVariables"),PY=class{static{x(this,"Theme")}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=_t("#cde498",10),this.primaryBorderColor=Bi(this.primaryColor,this.darkMode),this.secondaryBorderColor=Bi(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Bi(this.tertiaryColor,this.darkMode),this.primaryTextColor=xt(this.primaryColor),this.secondaryTextColor=xt(this.secondaryColor),this.tertiaryTextColor=xt(this.primaryColor),this.lineColor=xt(this.background),this.textColor=xt(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(){this.actorBorder=It(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||Me(this.primaryColor,{h:30}),this.cScale4=this.cScale4||Me(this.primaryColor,{h:60}),this.cScale5=this.cScale5||Me(this.primaryColor,{h:90}),this.cScale6=this.cScale6||Me(this.primaryColor,{h:120}),this.cScale7=this.cScale7||Me(this.primaryColor,{h:150}),this.cScale8=this.cScale8||Me(this.primaryColor,{h:210}),this.cScale9=this.cScale9||Me(this.primaryColor,{h:270}),this.cScale10=this.cScale10||Me(this.primaryColor,{h:300}),this.cScale11=this.cScale11||Me(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||It(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||It(this.tertiaryColor,40);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScale"+t]=It(this["cScale"+t],10),this["cScalePeer"+t]=this["cScalePeer"+t]||It(this["cScale"+t],25);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleInv"+t]=this["cScaleInv"+t]||Me(this["cScale"+t],{h:180});this.scaleLabelColor=this.scaleLabelColor!=="calculated"&&this.scaleLabelColor?this.scaleLabelColor:this.labelTextColor;for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleLabel"+t]=this["cScaleLabel"+t]||this.scaleLabelColor;for(let t=0;t<5;t++)this["surface"+t]=this["surface"+t]||Me(this.mainBkg,{h:30,s:-30,l:-(5+t*5)}),this["surfacePeer"+t]=this["surfacePeer"+t]||Me(this.mainBkg,{h:30,s:-30,l:-(8+t*5)});this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.taskBorderColor=this.border1,this.taskTextColor=this.taskTextLightColor,this.taskTextOutsideColor=this.taskTextDarkColor,this.activeTaskBorderColor=this.taskBorderColor,this.activeTaskBkgColor=this.mainBkg,this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.rowOdd=this.rowOdd||_t(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||_t(this.mainBkg,20),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||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.primaryBorderColor,this.specialStateColor=this.lineColor,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.classText=this.primaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=Me(this.primaryColor,{h:64}),this.fillType3=Me(this.secondaryColor,{h:64}),this.fillType4=Me(this.primaryColor,{h:-64}),this.fillType5=Me(this.secondaryColor,{h:-64}),this.fillType6=Me(this.primaryColor,{h:128}),this.fillType7=Me(this.secondaryColor,{h:128}),this.pie1=this.pie1||this.primaryColor,this.pie2=this.pie2||this.secondaryColor,this.pie3=this.pie3||this.tertiaryColor,this.pie4=this.pie4||Me(this.primaryColor,{l:-30}),this.pie5=this.pie5||Me(this.secondaryColor,{l:-30}),this.pie6=this.pie6||Me(this.tertiaryColor,{h:40,l:-40}),this.pie7=this.pie7||Me(this.primaryColor,{h:60,l:-10}),this.pie8=this.pie8||Me(this.primaryColor,{h:-60,l:-10}),this.pie9=this.pie9||Me(this.primaryColor,{h:120,l:0}),this.pie10=this.pie10||Me(this.primaryColor,{h:60,l:-50}),this.pie11=this.pie11||Me(this.primaryColor,{h:-60,l:-50}),this.pie12=this.pie12||Me(this.primaryColor,{h:120,l:-50}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||Me(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||Me(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||Me(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||Me(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||Me(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||Me(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||ec(this.quadrant1Fill)?_t(this.quadrant1Fill):It(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.packet={startByteColor:this.primaryTextColor,endByteColor:this.primaryTextColor,labelColor:this.primaryTextColor,titleColor:this.primaryTextColor,blockStrokeColor:this.primaryTextColor,blockFillColor:this.mainBkg},this.radar={axisColor:this.radar?.axisColor||this.lineColor,axisStrokeWidth:this.radar?.axisStrokeWidth||2,axisLabelFontSize:this.radar?.axisLabelFontSize||12,curveOpacity:this.radar?.curveOpacity||.5,curveStrokeWidth:this.radar?.curveStrokeWidth||2,graticuleColor:this.radar?.graticuleColor||"#DEDEDE",graticuleStrokeWidth:this.radar?.graticuleStrokeWidth||1,graticuleOpacity:this.radar?.graticuleOpacity||.3,legendBoxSize:this.radar?.legendBoxSize||12,legendFontSize:this.radar?.legendFontSize||12},this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#CDE498,#FF6B6B,#A0D2DB,#D7BDE2,#F0F0F0,#FFC3A0,#7FD8BE,#FF9A8B,#FAF3E0,#FFF176"},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||this.edgeLabelBackground,this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||this.primaryColor,this.git1=this.git1||this.secondaryColor,this.git2=this.git2||this.tertiaryColor,this.git3=this.git3||Me(this.primaryColor,{h:-30}),this.git4=this.git4||Me(this.primaryColor,{h:-60}),this.git5=this.git5||Me(this.primaryColor,{h:-90}),this.git6=this.git6||Me(this.primaryColor,{h:60}),this.git7=this.git7||Me(this.primaryColor,{h:120}),this.darkMode?(this.git0=_t(this.git0,25),this.git1=_t(this.git1,25),this.git2=_t(this.git2,25),this.git3=_t(this.git3,25),this.git4=_t(this.git4,25),this.git5=_t(this.git5,25),this.git6=_t(this.git6,25),this.git7=_t(this.git7,25)):(this.git0=It(this.git0,25),this.git1=It(this.git1,25),this.git2=It(this.git2,25),this.git3=It(this.git3,25),this.git4=It(this.git4,25),this.git5=It(this.git5,25),this.git6=It(this.git6,25),this.git7=It(this.git7,25)),this.gitInv0=this.gitInv0||xt(this.git0),this.gitInv1=this.gitInv1||xt(this.git1),this.gitInv2=this.gitInv2||xt(this.git2),this.gitInv3=this.gitInv3||xt(this.git3),this.gitInv4=this.gitInv4||xt(this.git4),this.gitInv5=this.gitInv5||xt(this.git5),this.gitInv6=this.gitInv6||xt(this.git6),this.gitInv7=this.gitInv7||xt(this.git7),this.gitBranchLabel0=this.gitBranchLabel0||xt(this.labelTextColor),this.gitBranchLabel1=this.gitBranchLabel1||this.labelTextColor,this.gitBranchLabel2=this.gitBranchLabel2||this.labelTextColor,this.gitBranchLabel3=this.gitBranchLabel3||xt(this.labelTextColor),this.gitBranchLabel4=this.gitBranchLabel4||this.labelTextColor,this.gitBranchLabel5=this.gitBranchLabel5||this.labelTextColor,this.gitBranchLabel6=this.gitBranchLabel6||this.labelTextColor,this.gitBranchLabel7=this.gitBranchLabel7||this.labelTextColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||Iy,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Oy}calculate(t){if(typeof t!="object"){this.updateColors();return}const e=Object.keys(t);e.forEach(r=>{this[r]=t[r]}),this.updateColors(),e.forEach(r=>{this[r]=t[r]})}},BY=x(t=>{const e=new PY;return e.calculate(t),e},"getThemeVariables"),FY=class{static{x(this,"Theme")}constructor(){this.primaryColor="#eee",this.contrast="#707070",this.secondaryColor=_t(this.contrast,55),this.background="#ffffff",this.tertiaryColor=Me(this.primaryColor,{h:-160}),this.primaryBorderColor=Bi(this.primaryColor,this.darkMode),this.secondaryBorderColor=Bi(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Bi(this.tertiaryColor,this.darkMode),this.primaryTextColor=xt(this.primaryColor),this.secondaryTextColor=xt(this.secondaryColor),this.tertiaryTextColor=xt(this.tertiaryColor),this.lineColor=xt(this.background),this.textColor=xt(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||_t(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||"#f4f4f4",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222"}updateColors(){this.secondBkg=_t(this.contrast,55),this.border2=this.contrast,this.actorBorder=_t(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 t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleInv"+t]=this["cScaleInv"+t]||xt(this["cScale"+t]);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this.darkMode?this["cScalePeer"+t]=this["cScalePeer"+t]||_t(this["cScale"+t],10):this["cScalePeer"+t]=this["cScalePeer"+t]||It(this["cScale"+t],10);this.scaleLabelColor=this.scaleLabelColor||(this.darkMode?"black":this.labelTextColor),this.cScaleLabel0=this.cScaleLabel0||this.cScale1,this.cScaleLabel2=this.cScaleLabel2||this.cScale1;for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleLabel"+t]=this["cScaleLabel"+t]||this.scaleLabelColor;for(let t=0;t<5;t++)this["surface"+t]=this["surface"+t]||Me(this.mainBkg,{l:-(5+t*5)}),this["surfacePeer"+t]=this["surfacePeer"+t]||Me(this.mainBkg,{l:-(8+t*5)});this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.titleColor=this.text,this.sectionBkgColor=_t(this.contrast,30),this.sectionBkgColor2=_t(this.contrast,30),this.taskBorderColor=It(this.contrast,10),this.taskBkgColor=this.contrast,this.taskTextColor=this.taskTextLightColor,this.taskTextDarkColor=this.text,this.taskTextOutsideColor=this.taskTextDarkColor,this.activeTaskBorderColor=this.taskBorderColor,this.activeTaskBkgColor=this.mainBkg,this.gridColor=_t(this.border1,30),this.doneTaskBkgColor=this.done,this.doneTaskBorderColor=this.lineColor,this.critBkgColor=this.critical,this.critBorderColor=It(this.critBkgColor,10),this.todayLineColor=this.critBkgColor,this.vertLineColor=this.critBkgColor,this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.transitionColor=this.transitionColor||"#000",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||"#f4f4f4",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.stateBorder=this.stateBorder||"#000",this.innerEndBackground=this.primaryBorderColor,this.specialStateColor="#222",this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.classText=this.primaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=Me(this.primaryColor,{h:64}),this.fillType3=Me(this.secondaryColor,{h:64}),this.fillType4=Me(this.primaryColor,{h:-64}),this.fillType5=Me(this.secondaryColor,{h:-64}),this.fillType6=Me(this.primaryColor,{h:128}),this.fillType7=Me(this.secondaryColor,{h:128});for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["pie"+t]=this["cScale"+t];this.pie12=this.pie0,this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||Me(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||Me(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||Me(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||Me(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||Me(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||Me(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||ec(this.quadrant1Fill)?_t(this.quadrant1Fill):It(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#EEE,#6BB8E4,#8ACB88,#C7ACD6,#E8DCC2,#FFB2A8,#FFF380,#7E8D91,#FFD8B1,#FAF3E0"},this.radar={axisColor:this.radar?.axisColor||this.lineColor,axisStrokeWidth:this.radar?.axisStrokeWidth||2,axisLabelFontSize:this.radar?.axisLabelFontSize||12,curveOpacity:this.radar?.curveOpacity||.5,curveStrokeWidth:this.radar?.curveStrokeWidth||2,graticuleColor:this.radar?.graticuleColor||"#DEDEDE",graticuleStrokeWidth:this.radar?.graticuleStrokeWidth||1,graticuleOpacity:this.radar?.graticuleOpacity||.3,legendBoxSize:this.radar?.legendBoxSize||12,legendFontSize:this.radar?.legendFontSize||12},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||this.edgeLabelBackground,this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=It(this.pie1,25)||this.primaryColor,this.git1=this.pie2||this.secondaryColor,this.git2=this.pie3||this.tertiaryColor,this.git3=this.pie4||Me(this.primaryColor,{h:-30}),this.git4=this.pie5||Me(this.primaryColor,{h:-60}),this.git5=this.pie6||Me(this.primaryColor,{h:-90}),this.git6=this.pie7||Me(this.primaryColor,{h:60}),this.git7=this.pie8||Me(this.primaryColor,{h:120}),this.gitInv0=this.gitInv0||xt(this.git0),this.gitInv1=this.gitInv1||xt(this.git1),this.gitInv2=this.gitInv2||xt(this.git2),this.gitInv3=this.gitInv3||xt(this.git3),this.gitInv4=this.gitInv4||xt(this.git4),this.gitInv5=this.gitInv5||xt(this.git5),this.gitInv6=this.gitInv6||xt(this.git6),this.gitInv7=this.gitInv7||xt(this.git7),this.branchLabelColor=this.branchLabelColor||this.labelTextColor,this.gitBranchLabel0=this.branchLabelColor,this.gitBranchLabel1="white",this.gitBranchLabel2=this.branchLabelColor,this.gitBranchLabel3="white",this.gitBranchLabel4=this.branchLabelColor,this.gitBranchLabel5=this.branchLabelColor,this.gitBranchLabel6=this.branchLabelColor,this.gitBranchLabel7=this.branchLabelColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||Iy,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Oy}calculate(t){if(typeof t!="object"){this.updateColors();return}const e=Object.keys(t);e.forEach(r=>{this[r]=t[r]}),this.updateColors(),e.forEach(r=>{this[r]=t[r]})}},$Y=x(t=>{const e=new FY;return e.calculate(t),e},"getThemeVariables"),Po={base:{getThemeVariables:DY},dark:{getThemeVariables:IY},default:{getThemeVariables:Py},forest:{getThemeVariables:BY},neutral:{getThemeVariables:$Y}},Ls={flowchart:{useMaxWidth:!0,titleTopMargin:25,subGraphTitleMargin:{top:0,bottom:0},diagramPadding:8,htmlLabels:!0,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"},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},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},xN={...Ls,deterministicIDSeed:void 0,elk:{mergeEdges:!1,nodePlacementStrategy:"BRANDES_KOEPF",forceNodeModelOrder:!1,considerModelOrder:"NODES_AND_EDGES"},themeCSS:void 0,themeVariables:Po.default.getThemeVariables(),sequence:{...Ls.sequence,messageFont:x(function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},"messageFont"),noteFont:x(function(){return{fontFamily:this.noteFontFamily,fontSize:this.noteFontSize,fontWeight:this.noteFontWeight}},"noteFont"),actorFont:x(function(){return{fontFamily:this.actorFontFamily,fontSize:this.actorFontSize,fontWeight:this.actorFontWeight}},"actorFont")},class:{hideEmptyMembersBox:!1},gantt:{...Ls.gantt,tickInterval:void 0,useWidth:void 0},c4:{...Ls.c4,useWidth:void 0,personFont:x(function(){return{fontFamily:this.personFontFamily,fontSize:this.personFontSize,fontWeight:this.personFontWeight}},"personFont"),flowchart:{...Ls.flowchart,inheritDir:!1},external_personFont:x(function(){return{fontFamily:this.external_personFontFamily,fontSize:this.external_personFontSize,fontWeight:this.external_personFontWeight}},"external_personFont"),systemFont:x(function(){return{fontFamily:this.systemFontFamily,fontSize:this.systemFontSize,fontWeight:this.systemFontWeight}},"systemFont"),external_systemFont:x(function(){return{fontFamily:this.external_systemFontFamily,fontSize:this.external_systemFontSize,fontWeight:this.external_systemFontWeight}},"external_systemFont"),system_dbFont:x(function(){return{fontFamily:this.system_dbFontFamily,fontSize:this.system_dbFontSize,fontWeight:this.system_dbFontWeight}},"system_dbFont"),external_system_dbFont:x(function(){return{fontFamily:this.external_system_dbFontFamily,fontSize:this.external_system_dbFontSize,fontWeight:this.external_system_dbFontWeight}},"external_system_dbFont"),system_queueFont:x(function(){return{fontFamily:this.system_queueFontFamily,fontSize:this.system_queueFontSize,fontWeight:this.system_queueFontWeight}},"system_queueFont"),external_system_queueFont:x(function(){return{fontFamily:this.external_system_queueFontFamily,fontSize:this.external_system_queueFontSize,fontWeight:this.external_system_queueFontWeight}},"external_system_queueFont"),containerFont:x(function(){return{fontFamily:this.containerFontFamily,fontSize:this.containerFontSize,fontWeight:this.containerFontWeight}},"containerFont"),external_containerFont:x(function(){return{fontFamily:this.external_containerFontFamily,fontSize:this.external_containerFontSize,fontWeight:this.external_containerFontWeight}},"external_containerFont"),container_dbFont:x(function(){return{fontFamily:this.container_dbFontFamily,fontSize:this.container_dbFontSize,fontWeight:this.container_dbFontWeight}},"container_dbFont"),external_container_dbFont:x(function(){return{fontFamily:this.external_container_dbFontFamily,fontSize:this.external_container_dbFontSize,fontWeight:this.external_container_dbFontWeight}},"external_container_dbFont"),container_queueFont:x(function(){return{fontFamily:this.container_queueFontFamily,fontSize:this.container_queueFontSize,fontWeight:this.container_queueFontWeight}},"container_queueFont"),external_container_queueFont:x(function(){return{fontFamily:this.external_container_queueFontFamily,fontSize:this.external_container_queueFontSize,fontWeight:this.external_container_queueFontWeight}},"external_container_queueFont"),componentFont:x(function(){return{fontFamily:this.componentFontFamily,fontSize:this.componentFontSize,fontWeight:this.componentFontWeight}},"componentFont"),external_componentFont:x(function(){return{fontFamily:this.external_componentFontFamily,fontSize:this.external_componentFontSize,fontWeight:this.external_componentFontWeight}},"external_componentFont"),component_dbFont:x(function(){return{fontFamily:this.component_dbFontFamily,fontSize:this.component_dbFontSize,fontWeight:this.component_dbFontWeight}},"component_dbFont"),external_component_dbFont:x(function(){return{fontFamily:this.external_component_dbFontFamily,fontSize:this.external_component_dbFontSize,fontWeight:this.external_component_dbFontWeight}},"external_component_dbFont"),component_queueFont:x(function(){return{fontFamily:this.component_queueFontFamily,fontSize:this.component_queueFontSize,fontWeight:this.component_queueFontWeight}},"component_queueFont"),external_component_queueFont:x(function(){return{fontFamily:this.external_component_queueFontFamily,fontSize:this.external_component_queueFontSize,fontWeight:this.external_component_queueFontWeight}},"external_component_queueFont"),boundaryFont:x(function(){return{fontFamily:this.boundaryFontFamily,fontSize:this.boundaryFontSize,fontWeight:this.boundaryFontWeight}},"boundaryFont"),messageFont:x(function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},"messageFont")},pie:{...Ls.pie,useWidth:984},xyChart:{...Ls.xyChart,useWidth:void 0},requirement:{...Ls.requirement,useWidth:void 0},packet:{...Ls.packet},radar:{...Ls.radar},treemap:{useMaxWidth:!0,padding:10,diagramPadding:8,showValues:!0,nodeWidth:100,nodeHeight:40,borderWidth:1,valueFontSize:12,labelFontSize:14,valueFormat:","}},bN=x((t,e="")=>Object.keys(t).reduce((r,n)=>Array.isArray(t[n])?r:typeof t[n]=="object"&&t[n]!==null?[...r,e+n,...bN(t[n],"")]:[...r,e+n],[]),"keyify"),zY=new Set(bN(xN,"")),hr=xN,Dm=x(t=>{if(ie.debug("sanitizeDirective called with",t),!(typeof t!="object"||t==null)){if(Array.isArray(t)){t.forEach(e=>Dm(e));return}for(const e of Object.keys(t)){if(ie.debug("Checking key",e),e.startsWith("__")||e.includes("proto")||e.includes("constr")||!zY.has(e)||t[e]==null){ie.debug("sanitize deleting key: ",e),delete t[e];continue}if(typeof t[e]=="object"){ie.debug("sanitizing object",e),Dm(t[e]);continue}const r=["themeCSS","fontFamily","altFontFamily"];for(const n of r)e.includes(n)&&(ie.debug("sanitizing css option",e),t[e]=VY(t[e]))}if(t.themeVariables)for(const e of Object.keys(t.themeVariables)){const r=t.themeVariables[e];r?.match&&!r.match(/^[\d "#%(),.;A-Za-z]+$/)&&(t.themeVariables[e]="")}ie.debug("After sanitization",t)}},"sanitizeDirective"),VY=x(t=>{let e=0,r=0;for(const n of t){if(e<r)return"{ /* ERROR: Unbalanced CSS */ }";n==="{"?e++:n==="}"&&r++}return e!==r?"{ /* ERROR: Unbalanced CSS */ }":t},"sanitizeCss"),Vh=Object.freeze(hr),na=mn({},Vh),Mm,eu=[],b0=mn({},Vh),By=x((t,e)=>{let r=mn({},t),n={};for(const i of e)EN(i),n=mn(n,i);if(r=mn(r,n),n.theme&&n.theme in Po){const i=mn({},Mm),a=mn(i.themeVariables||{},n.themeVariables);r.theme&&r.theme in Po&&(r.themeVariables=Po[r.theme].getThemeVariables(a))}return b0=r,kN(b0),b0},"updateCurrentConfig"),GY=x(t=>(na=mn({},Vh),na=mn(na,t),t.theme&&Po[t.theme]&&(na.themeVariables=Po[t.theme].getThemeVariables(t.themeVariables)),By(na,eu),na),"setSiteConfig"),UY=x(t=>{Mm=mn({},t)},"saveConfigFromInitialize"),WY=x(t=>(na=mn(na,t),By(na,eu),na),"updateSiteConfig"),wN=x(()=>mn({},na),"getSiteConfig"),TN=x(t=>(kN(t),mn(b0,t),gr()),"setConfig"),gr=x(()=>mn({},b0),"getConfig"),EN=x(t=>{t&&(["secure",...na.secure??[]].forEach(e=>{Object.hasOwn(t,e)&&(ie.debug(`Denied attempt to modify a secure key ${e}`,t[e]),delete t[e])}),Object.keys(t).forEach(e=>{e.startsWith("__")&&delete t[e]}),Object.keys(t).forEach(e=>{typeof t[e]=="string"&&(t[e].includes("<")||t[e].includes(">")||t[e].includes("url(data:"))&&delete t[e],typeof t[e]=="object"&&EN(t[e])}))},"sanitize"),HY=x(t=>{Dm(t),t.fontFamily&&!t.themeVariables?.fontFamily&&(t.themeVariables={...t.themeVariables,fontFamily:t.fontFamily}),eu.push(t),By(na,eu)},"addDirective"),Im=x((t=na)=>{eu=[],By(t,eu)},"reset"),qY={LAZY_LOAD_DEPRECATED:"The configuration options lazyLoadedDiagrams and loadExternalDiagramsAtStartup are deprecated. Please use registerExternalDiagrams instead."},PS={},YY=x(t=>{PS[t]||(ie.warn(qY[t]),PS[t]=!0)},"issueWarning"),kN=x(t=>{t&&(t.lazyLoadedDiagrams||t.loadExternalDiagramsAtStartup)&&YY("LAZY_LOAD_DEPRECATED")},"checkConfig"),XY=x(()=>{let t={};Mm&&(t=mn(t,Mm));for(const e of eu)t=mn(t,e);return t},"getUserDefinedConfig"),xd=/<br\s*\/?>/gi,jY=x(t=>t?AN(t).replace(/\\n/g,"#br#").split("#br#"):[""],"getRows"),KY=(()=>{let t=!1;return()=>{t||(SN(),t=!0)}})();function SN(){const t="data-temp-href-target";zh.addHook("beforeSanitizeAttributes",e=>{e.tagName==="A"&&e.hasAttribute("target")&&e.setAttribute(t,e.getAttribute("target")??"")}),zh.addHook("afterSanitizeAttributes",e=>{e.tagName==="A"&&e.hasAttribute(t)&&(e.setAttribute("target",e.getAttribute(t)??""),e.removeAttribute(t),e.getAttribute("target")==="_blank"&&e.setAttribute("rel","noopener"))})}x(SN,"setupDompurifyHooks");var CN=x(t=>(KY(),zh.sanitize(t)),"removeScript"),BS=x((t,e)=>{if(e.flowchart?.htmlLabels!==!1){const r=e.securityLevel;r==="antiscript"||r==="strict"?t=CN(t):r!=="loose"&&(t=AN(t),t=t.replace(/</g,"&lt;").replace(/>/g,"&gt;"),t=t.replace(/=/g,"&equals;"),t=eX(t))}return t},"sanitizeMore"),fr=x((t,e)=>t&&(e.dompurifyConfig?t=zh.sanitize(BS(t,e),e.dompurifyConfig).toString():t=zh.sanitize(BS(t,e),{FORBID_TAGS:["style"]}).toString(),t),"sanitizeText"),ZY=x((t,e)=>typeof t=="string"?fr(t,e):t.flat().map(r=>fr(r,e)),"sanitizeTextOrArray"),QY=x(t=>xd.test(t),"hasBreaks"),JY=x(t=>t.split(xd),"splitBreaks"),eX=x(t=>t.replace(/#br#/g,"<br/>"),"placeholderToBreak"),AN=x(t=>t.replace(xd,"#br#"),"breakToPlaceholder"),Fy=x(t=>{let e="";return t&&(e=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,e=CSS.escape(e)),e},"getUrl"),Ir=x(t=>!(t===!1||["false","null","0"].includes(String(t).trim().toLowerCase())),"evaluate"),tX=x(function(...t){const e=t.filter(r=>!isNaN(r));return Math.max(...e)},"getMax"),rX=x(function(...t){const e=t.filter(r=>!isNaN(r));return Math.min(...e)},"getMin"),pl=x(function(t){const e=t.split(/(,)/),r=[];for(let n=0;n<e.length;n++){let i=e[n];if(i===","&&n>0&&n+1<e.length){const a=e[n-1],s=e[n+1];nX(a,s)&&(i=a+","+s,n++,r.pop())}r.push(iX(i))}return r.join("")},"parseGenericTypes"),H3=x((t,e)=>Math.max(0,t.split(e).length-1),"countOccurrence"),nX=x((t,e)=>{const r=H3(t,"~"),n=H3(e,"~");return r===1&&n===1},"shouldCombineSets"),iX=x(t=>{const e=H3(t,"~");let r=!1;if(e<=1)return t;e%2!==0&&t.startsWith("~")&&(t=t.substring(1),r=!0);const n=[...t];let i=n.indexOf("~"),a=n.lastIndexOf("~");for(;i!==-1&&a!==-1&&i!==a;)n[i]="<",n[a]=">",i=n.indexOf("~"),a=n.lastIndexOf("~");return r&&n.unshift("~"),n.join("")},"processSet"),FS=x(()=>window.MathMLElement!==void 0,"isMathMLSupported"),q3=/\$\$(.*)\$\$/g,un=x(t=>(t.match(q3)?.length??0)>0,"hasKatex"),Cp=x(async(t,e)=>{const r=document.createElement("div");r.innerHTML=await Ap(t,e),r.id="katex-temp",r.style.visibility="hidden",r.style.position="absolute",r.style.top="0",document.querySelector("body")?.insertAdjacentElement("beforeend",r);const i={width:r.clientWidth,height:r.clientHeight};return r.remove(),i},"calculateMathMLDimensions"),aX=x(async(t,e)=>{if(!un(t))return t;if(!(FS()||e.legacyMathML||e.forceLegacyMathML))return t.replace(q3,"MathML is unsupported in this environment.");{const{default:r}=await ir(async()=>{const{default:i}=await Promise.resolve().then(()=>Khe);return{default:i}},void 0,import.meta.url),n=e.forceLegacyMathML||!FS()&&e.legacyMathML?"htmlAndMathml":"mathml";return t.split(xd).map(i=>un(i)?`<div style="display: flex; align-items: center; justify-content: center; white-space: nowrap;">${i}</div>`:`<div>${i}</div>`).join("").replace(q3,(i,a)=>r.renderToString(a,{throwOnError:!0,displayMode:!0,output:n}).replace(/\n/g," ").replace(/<annotation.*<\/annotation>/g,""))}},"renderKatexUnsanitized"),Ap=x(async(t,e)=>fr(await aX(t,e),e),"renderKatexSanitized"),at={getRows:jY,sanitizeText:fr,sanitizeTextOrArray:ZY,hasBreaks:QY,splitBreaks:JY,lineBreakRegex:xd,removeScript:CN,getUrl:Fy,evaluate:Ir,getMax:tX,getMin:rX},sX=x(function(t,e){for(let r of e)t.attr(r[0],r[1])},"d3Attrs"),oX=x(function(t,e,r){let n=new Map;return r?(n.set("width","100%"),n.set("style",`max-width: ${e}px;`)):(n.set("height",t),n.set("width",e)),n},"calculateSvgSizeAttrs"),ji=x(function(t,e,r,n){const i=oX(e,r,n);sX(t,i)},"configureSvgSize"),_p=x(function(t,e,r,n){const i=e.node().getBBox(),a=i.width,s=i.height;ie.info(`SVG bounds: ${a}x${s}`,i);let o=0,l=0;ie.info(`Graph bounds: ${o}x${l}`,t),o=a+r*2,l=s+r*2,ie.info(`Calculated bounds: ${o}x${l}`),ji(e,l,o,n);const u=`${i.x-r} ${i.y-r} ${i.width+2*r} ${i.height+2*r}`;e.attr("viewBox",u)},"setupGraphViewbox"),B1={},lX=x((t,e,r)=>{let n="";return t in B1&&B1[t]?n=B1[t](r):ie.warn(`No theme found for ${t}`),` & {
    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
   }

  ${n}

  ${e}
`},"getStyles"),cX=x((t,e)=>{e!==void 0&&(B1[t]=e)},"addStylesForDiagram"),uX=lX,KT={};Dy(KT,{clear:()=>An,getAccDescription:()=>Gn,getAccTitle:()=>zn,getDiagramTitle:()=>_n,setAccDescription:()=>Vn,setAccTitle:()=>Sn,setDiagramTitle:()=>Zn});var ZT="",QT="",JT="",e6=x(t=>fr(t,gr()),"sanitizeText"),An=x(()=>{ZT="",JT="",QT=""},"clear"),Sn=x(t=>{ZT=e6(t).replace(/^\s+/g,"")},"setAccTitle"),zn=x(()=>ZT,"getAccTitle"),Vn=x(t=>{JT=e6(t).replace(/\n\s+/g,`
`)},"setAccDescription"),Gn=x(()=>JT,"getAccDescription"),Zn=x(t=>{QT=e6(t)},"setDiagramTitle"),_n=x(()=>QT,"getDiagramTitle"),$S=ie,hX=YT,we=gr,Y3=TN,_N=Vh,t6=x(t=>fr(t,we()),"sanitizeText"),LN=_p,dX=x(()=>KT,"getCommonDb"),Om={},Pm=x((t,e,r)=>{Om[t]&&$S.warn(`Diagram with id ${t} already registered. Overwriting.`),Om[t]=e,r&&yN(t,r),cX(t,e.styles),e.injectUtils?.($S,hX,we,t6,LN,dX(),()=>{})},"registerDiagram"),X3=x(t=>{if(t in Om)return Om[t];throw new fX(t)},"getDiagram"),fX=class extends Error{static{x(this,"DiagramNotFoundError")}constructor(t){super(`Diagram ${t} not found.`)}};function F1(t,e){return t==null||e==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function pX(t,e){return t==null||e==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function r6(t){let e,r,n;t.length!==2?(e=F1,r=(o,l)=>F1(t(o),l),n=(o,l)=>t(o)-l):(e=t===F1||t===pX?t:gX,r=t,n=t);function i(o,l,u=0,h=o.length){if(u<h){if(e(l,l)!==0)return h;do{const d=u+h>>>1;r(o[d],l)<0?u=d+1:h=d}while(u<h)}return u}function a(o,l,u=0,h=o.length){if(u<h){if(e(l,l)!==0)return h;do{const d=u+h>>>1;r(o[d],l)<=0?u=d+1:h=d}while(u<h)}return u}function s(o,l,u=0,h=o.length){const d=i(o,l,u,h-1);return d>u&&n(o[d-1],l)>-n(o[d],l)?d-1:d}return{left:i,center:s,right:a}}function gX(){return 0}function mX(t){return t===null?NaN:+t}const vX=r6(F1),yX=vX.right;r6(mX).center;class zS extends Map{constructor(e,r=wX){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),e!=null)for(const[n,i]of e)this.set(n,i)}get(e){return super.get(VS(this,e))}has(e){return super.has(VS(this,e))}set(e,r){return super.set(xX(this,e),r)}delete(e){return super.delete(bX(this,e))}}function VS({_intern:t,_key:e},r){const n=e(r);return t.has(n)?t.get(n):r}function xX({_intern:t,_key:e},r){const n=e(r);return t.has(n)?t.get(n):(t.set(n,r),r)}function bX({_intern:t,_key:e},r){const n=e(r);return t.has(n)&&(r=t.get(n),t.delete(n)),r}function wX(t){return t!==null&&typeof t=="object"?t.valueOf():t}const TX=Math.sqrt(50),EX=Math.sqrt(10),kX=Math.sqrt(2);function Bm(t,e,r){const n=(e-t)/Math.max(0,r),i=Math.floor(Math.log10(n)),a=n/Math.pow(10,i),s=a>=TX?10:a>=EX?5:a>=kX?2:1;let o,l,u;return i<0?(u=Math.pow(10,-i)/s,o=Math.round(t*u),l=Math.round(e*u),o/u<t&&++o,l/u>e&&--l,u=-u):(u=Math.pow(10,i)*s,o=Math.round(t/u),l=Math.round(e/u),o*u<t&&++o,l*u>e&&--l),l<o&&.5<=r&&r<2?Bm(t,e,r*2):[o,l,u]}function SX(t,e,r){if(e=+e,t=+t,r=+r,!(r>0))return[];if(t===e)return[t];const n=e<t,[i,a,s]=n?Bm(e,t,r):Bm(t,e,r);if(!(a>=i))return[];const o=a-i+1,l=new Array(o);if(n)if(s<0)for(let u=0;u<o;++u)l[u]=(a-u)/-s;else for(let u=0;u<o;++u)l[u]=(a-u)*s;else if(s<0)for(let u=0;u<o;++u)l[u]=(i+u)/-s;else for(let u=0;u<o;++u)l[u]=(i+u)*s;return l}function j3(t,e,r){return e=+e,t=+t,r=+r,Bm(t,e,r)[2]}function K3(t,e,r){e=+e,t=+t,r=+r;const n=e<t,i=n?j3(e,t,r):j3(t,e,r);return(n?-1:1)*(i<0?1/-i:i)}function CX(t,e){let r;if(e===void 0)for(const n of t)n!=null&&(r<n||r===void 0&&n>=n)&&(r=n);else{let n=-1;for(let i of t)(i=e(i,++n,t))!=null&&(r<i||r===void 0&&i>=i)&&(r=i)}return r}function AX(t,e){let r;if(e===void 0)for(const n of t)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);else{let n=-1;for(let i of t)(i=e(i,++n,t))!=null&&(r>i||r===void 0&&i>=i)&&(r=i)}return r}function _X(t,e,r){t=+t,e=+e,r=(i=arguments.length)<2?(e=t,t=0,1):i<3?1:+r;for(var n=-1,i=Math.max(0,Math.ceil((e-t)/r))|0,a=new Array(i);++n<i;)a[n]=t+n*r;return a}function LX(t){return t}var $1=1,Rx=2,Z3=3,Sg=4,GS=1e-6;function RX(t){return"translate("+t+",0)"}function NX(t){return"translate(0,"+t+")"}function DX(t){return e=>+t(e)}function MX(t,e){return e=Math.max(0,t.bandwidth()-e*2)/2,t.round()&&(e=Math.round(e)),r=>+t(r)+e}function IX(){return!this.__axis}function RN(t,e){var r=[],n=null,i=null,a=6,s=6,o=3,l=typeof window<"u"&&window.devicePixelRatio>1?0:.5,u=t===$1||t===Sg?-1:1,h=t===Sg||t===Rx?"x":"y",d=t===$1||t===Z3?RX:NX;function f(p){var g=n??(e.ticks?e.ticks.apply(e,r):e.domain()),m=i??(e.tickFormat?e.tickFormat.apply(e,r):LX),v=Math.max(a,0)+o,y=e.range(),b=+y[0]+l,w=+y[y.length-1]+l,T=(e.bandwidth?MX:DX)(e.copy(),l),E=p.selection?p.selection():p,L=E.selectAll(".domain").data([null]),S=E.selectAll(".tick").data(g,e).order(),C=S.exit(),A=S.enter().append("g").attr("class","tick"),N=S.select("line"),_=S.select("text");L=L.merge(L.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),S=S.merge(A),N=N.merge(A.append("line").attr("stroke","currentColor").attr(h+"2",u*a)),_=_.merge(A.append("text").attr("fill","currentColor").attr(h,u*v).attr("dy",t===$1?"0em":t===Z3?"0.71em":"0.32em")),p!==E&&(L=L.transition(p),S=S.transition(p),N=N.transition(p),_=_.transition(p),C=C.transition(p).attr("opacity",GS).attr("transform",function(O){return isFinite(O=T(O))?d(O+l):this.getAttribute("transform")}),A.attr("opacity",GS).attr("transform",function(O){var P=this.parentNode.__axis;return d((P&&isFinite(P=P(O))?P:T(O))+l)})),C.remove(),L.attr("d",t===Sg||t===Rx?s?"M"+u*s+","+b+"H"+l+"V"+w+"H"+u*s:"M"+l+","+b+"V"+w:s?"M"+b+","+u*s+"V"+l+"H"+w+"V"+u*s:"M"+b+","+l+"H"+w),S.attr("opacity",1).attr("transform",function(O){return d(T(O)+l)}),N.attr(h+"2",u*a),_.attr(h,u*v).text(m),E.filter(IX).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",t===Rx?"start":t===Sg?"end":"middle"),E.each(function(){this.__axis=T})}return f.scale=function(p){return arguments.length?(e=p,f):e},f.ticks=function(){return r=Array.from(arguments),f},f.tickArguments=function(p){return arguments.length?(r=p==null?[]:Array.from(p),f):r.slice()},f.tickValues=function(p){return arguments.length?(n=p==null?null:Array.from(p),f):n&&n.slice()},f.tickFormat=function(p){return arguments.length?(i=p,f):i},f.tickSize=function(p){return arguments.length?(a=s=+p,f):a},f.tickSizeInner=function(p){return arguments.length?(a=+p,f):a},f.tickSizeOuter=function(p){return arguments.length?(s=+p,f):s},f.tickPadding=function(p){return arguments.length?(o=+p,f):o},f.offset=function(p){return arguments.length?(l=+p,f):l},f}function OX(t){return RN($1,t)}function PX(t){return RN(Z3,t)}var BX={value:()=>{}};function NN(){for(var t=0,e=arguments.length,r={},n;t<e;++t){if(!(n=arguments[t]+"")||n in r||/[\s.]/.test(n))throw new Error("illegal type: "+n);r[n]=[]}return new z1(r)}function z1(t){this._=t}function FX(t,e){return t.trim().split(/^|\s+/).map(function(r){var n="",i=r.indexOf(".");if(i>=0&&(n=r.slice(i+1),r=r.slice(0,i)),r&&!e.hasOwnProperty(r))throw new Error("unknown type: "+r);return{type:r,name:n}})}z1.prototype=NN.prototype={constructor:z1,on:function(t,e){var r=this._,n=FX(t+"",r),i,a=-1,s=n.length;if(arguments.length<2){for(;++a<s;)if((i=(t=n[a]).type)&&(i=$X(r[i],t.name)))return i;return}if(e!=null&&typeof e!="function")throw new Error("invalid callback: "+e);for(;++a<s;)if(i=(t=n[a]).type)r[i]=US(r[i],t.name,e);else if(e==null)for(i in r)r[i]=US(r[i],t.name,null);return this},copy:function(){var t={},e=this._;for(var r in e)t[r]=e[r].slice();return new z1(t)},call:function(t,e){if((i=arguments.length-2)>0)for(var r=new Array(i),n=0,i,a;n<i;++n)r[n]=arguments[n+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(a=this._[t],n=0,i=a.length;n<i;++n)a[n].value.apply(e,r)},apply:function(t,e,r){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var n=this._[t],i=0,a=n.length;i<a;++i)n[i].value.apply(e,r)}};function $X(t,e){for(var r=0,n=t.length,i;r<n;++r)if((i=t[r]).name===e)return i.value}function US(t,e,r){for(var n=0,i=t.length;n<i;++n)if(t[n].name===e){t[n]=BX,t=t.slice(0,n).concat(t.slice(n+1));break}return r!=null&&t.push({name:e,value:r}),t}var Q3="http://www.w3.org/1999/xhtml";const WS={svg:"http://www.w3.org/2000/svg",xhtml:Q3,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function $y(t){var e=t+="",r=e.indexOf(":");return r>=0&&(e=t.slice(0,r))!=="xmlns"&&(t=t.slice(r+1)),WS.hasOwnProperty(e)?{space:WS[e],local:t}:t}function zX(t){return function(){var e=this.ownerDocument,r=this.namespaceURI;return r===Q3&&e.documentElement.namespaceURI===Q3?e.createElement(t):e.createElementNS(r,t)}}function VX(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function DN(t){var e=$y(t);return(e.local?VX:zX)(e)}function GX(){}function n6(t){return t==null?GX:function(){return this.querySelector(t)}}function UX(t){typeof t!="function"&&(t=n6(t));for(var e=this._groups,r=e.length,n=new Array(r),i=0;i<r;++i)for(var a=e[i],s=a.length,o=n[i]=new Array(s),l,u,h=0;h<s;++h)(l=a[h])&&(u=t.call(l,l.__data__,h,a))&&("__data__"in l&&(u.__data__=l.__data__),o[h]=u);return new _a(n,this._parents)}function WX(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function HX(){return[]}function MN(t){return t==null?HX:function(){return this.querySelectorAll(t)}}function qX(t){return function(){return WX(t.apply(this,arguments))}}function YX(t){typeof t=="function"?t=qX(t):t=MN(t);for(var e=this._groups,r=e.length,n=[],i=[],a=0;a<r;++a)for(var s=e[a],o=s.length,l,u=0;u<o;++u)(l=s[u])&&(n.push(t.call(l,l.__data__,u,s)),i.push(l));return new _a(n,i)}function IN(t){return function(){return this.matches(t)}}function ON(t){return function(e){return e.matches(t)}}var XX=Array.prototype.find;function jX(t){return function(){return XX.call(this.children,t)}}function KX(){return this.firstElementChild}function ZX(t){return this.select(t==null?KX:jX(typeof t=="function"?t:ON(t)))}var QX=Array.prototype.filter;function JX(){return Array.from(this.children)}function ej(t){return function(){return QX.call(this.children,t)}}function tj(t){return this.selectAll(t==null?JX:ej(typeof t=="function"?t:ON(t)))}function rj(t){typeof t!="function"&&(t=IN(t));for(var e=this._groups,r=e.length,n=new Array(r),i=0;i<r;++i)for(var a=e[i],s=a.length,o=n[i]=[],l,u=0;u<s;++u)(l=a[u])&&t.call(l,l.__data__,u,a)&&o.push(l);return new _a(n,this._parents)}function PN(t){return new Array(t.length)}function nj(){return new _a(this._enter||this._groups.map(PN),this._parents)}function Fm(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}Fm.prototype={constructor:Fm,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};function ij(t){return function(){return t}}function aj(t,e,r,n,i,a){for(var s=0,o,l=e.length,u=a.length;s<u;++s)(o=e[s])?(o.__data__=a[s],n[s]=o):r[s]=new Fm(t,a[s]);for(;s<l;++s)(o=e[s])&&(i[s]=o)}function sj(t,e,r,n,i,a,s){var o,l,u=new Map,h=e.length,d=a.length,f=new Array(h),p;for(o=0;o<h;++o)(l=e[o])&&(f[o]=p=s.call(l,l.__data__,o,e)+"",u.has(p)?i[o]=l:u.set(p,l));for(o=0;o<d;++o)p=s.call(t,a[o],o,a)+"",(l=u.get(p))?(n[o]=l,l.__data__=a[o],u.delete(p)):r[o]=new Fm(t,a[o]);for(o=0;o<h;++o)(l=e[o])&&u.get(f[o])===l&&(i[o]=l)}function oj(t){return t.__data__}function lj(t,e){if(!arguments.length)return Array.from(this,oj);var r=e?sj:aj,n=this._parents,i=this._groups;typeof t!="function"&&(t=ij(t));for(var a=i.length,s=new Array(a),o=new Array(a),l=new Array(a),u=0;u<a;++u){var h=n[u],d=i[u],f=d.length,p=cj(t.call(h,h&&h.__data__,u,n)),g=p.length,m=o[u]=new Array(g),v=s[u]=new Array(g),y=l[u]=new Array(f);r(h,d,m,v,y,p,e);for(var b=0,w=0,T,E;b<g;++b)if(T=m[b]){for(b>=w&&(w=b+1);!(E=v[w])&&++w<g;);T._next=E||null}}return s=new _a(s,n),s._enter=o,s._exit=l,s}function cj(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function uj(){return new _a(this._exit||this._groups.map(PN),this._parents)}function hj(t,e,r){var n=this.enter(),i=this,a=this.exit();return typeof t=="function"?(n=t(n),n&&(n=n.selection())):n=n.append(t+""),e!=null&&(i=e(i),i&&(i=i.selection())),r==null?a.remove():r(a),n&&i?n.merge(i).order():i}function dj(t){for(var e=t.selection?t.selection():t,r=this._groups,n=e._groups,i=r.length,a=n.length,s=Math.min(i,a),o=new Array(i),l=0;l<s;++l)for(var u=r[l],h=n[l],d=u.length,f=o[l]=new Array(d),p,g=0;g<d;++g)(p=u[g]||h[g])&&(f[g]=p);for(;l<i;++l)o[l]=r[l];return new _a(o,this._parents)}function fj(){for(var t=this._groups,e=-1,r=t.length;++e<r;)for(var n=t[e],i=n.length-1,a=n[i],s;--i>=0;)(s=n[i])&&(a&&s.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(s,a),a=s);return this}function pj(t){t||(t=gj);function e(d,f){return d&&f?t(d.__data__,f.__data__):!d-!f}for(var r=this._groups,n=r.length,i=new Array(n),a=0;a<n;++a){for(var s=r[a],o=s.length,l=i[a]=new Array(o),u,h=0;h<o;++h)(u=s[h])&&(l[h]=u);l.sort(e)}return new _a(i,this._parents).order()}function gj(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function mj(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function vj(){return Array.from(this)}function yj(){for(var t=this._groups,e=0,r=t.length;e<r;++e)for(var n=t[e],i=0,a=n.length;i<a;++i){var s=n[i];if(s)return s}return null}function xj(){let t=0;for(const e of this)++t;return t}function bj(){return!this.node()}function wj(t){for(var e=this._groups,r=0,n=e.length;r<n;++r)for(var i=e[r],a=0,s=i.length,o;a<s;++a)(o=i[a])&&t.call(o,o.__data__,a,i);return this}function Tj(t){return function(){this.removeAttribute(t)}}function Ej(t){return function(){this.removeAttributeNS(t.space,t.local)}}function kj(t,e){return function(){this.setAttribute(t,e)}}function Sj(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function Cj(t,e){return function(){var r=e.apply(this,arguments);r==null?this.removeAttribute(t):this.setAttribute(t,r)}}function Aj(t,e){return function(){var r=e.apply(this,arguments);r==null?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,r)}}function _j(t,e){var r=$y(t);if(arguments.length<2){var n=this.node();return r.local?n.getAttributeNS(r.space,r.local):n.getAttribute(r)}return this.each((e==null?r.local?Ej:Tj:typeof e=="function"?r.local?Aj:Cj:r.local?Sj:kj)(r,e))}function BN(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function Lj(t){return function(){this.style.removeProperty(t)}}function Rj(t,e,r){return function(){this.style.setProperty(t,e,r)}}function Nj(t,e,r){return function(){var n=e.apply(this,arguments);n==null?this.style.removeProperty(t):this.style.setProperty(t,n,r)}}function Dj(t,e,r){return arguments.length>1?this.each((e==null?Lj:typeof e=="function"?Nj:Rj)(t,e,r??"")):Gh(this.node(),t)}function Gh(t,e){return t.style.getPropertyValue(e)||BN(t).getComputedStyle(t,null).getPropertyValue(e)}function Mj(t){return function(){delete this[t]}}function Ij(t,e){return function(){this[t]=e}}function Oj(t,e){return function(){var r=e.apply(this,arguments);r==null?delete this[t]:this[t]=r}}function Pj(t,e){return arguments.length>1?this.each((e==null?Mj:typeof e=="function"?Oj:Ij)(t,e)):this.node()[t]}function FN(t){return t.trim().split(/^|\s+/)}function i6(t){return t.classList||new $N(t)}function $N(t){this._node=t,this._names=FN(t.getAttribute("class")||"")}$N.prototype={add:function(t){var e=this._names.indexOf(t);e<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function zN(t,e){for(var r=i6(t),n=-1,i=e.length;++n<i;)r.add(e[n])}function VN(t,e){for(var r=i6(t),n=-1,i=e.length;++n<i;)r.remove(e[n])}function Bj(t){return function(){zN(this,t)}}function Fj(t){return function(){VN(this,t)}}function $j(t,e){return function(){(e.apply(this,arguments)?zN:VN)(this,t)}}function zj(t,e){var r=FN(t+"");if(arguments.length<2){for(var n=i6(this.node()),i=-1,a=r.length;++i<a;)if(!n.contains(r[i]))return!1;return!0}return this.each((typeof e=="function"?$j:e?Bj:Fj)(r,e))}function Vj(){this.textContent=""}function Gj(t){return function(){this.textContent=t}}function Uj(t){return function(){var e=t.apply(this,arguments);this.textContent=e??""}}function Wj(t){return arguments.length?this.each(t==null?Vj:(typeof t=="function"?Uj:Gj)(t)):this.node().textContent}function Hj(){this.innerHTML=""}function qj(t){return function(){this.innerHTML=t}}function Yj(t){return function(){var e=t.apply(this,arguments);this.innerHTML=e??""}}function Xj(t){return arguments.length?this.each(t==null?Hj:(typeof t=="function"?Yj:qj)(t)):this.node().innerHTML}function jj(){this.nextSibling&&this.parentNode.appendChild(this)}function Kj(){return this.each(jj)}function Zj(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Qj(){return this.each(Zj)}function Jj(t){var e=typeof t=="function"?t:DN(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}function eK(){return null}function tK(t,e){var r=typeof t=="function"?t:DN(t),n=e==null?eK:typeof e=="function"?e:n6(e);return this.select(function(){return this.insertBefore(r.apply(this,arguments),n.apply(this,arguments)||null)})}function rK(){var t=this.parentNode;t&&t.removeChild(this)}function nK(){return this.each(rK)}function iK(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function aK(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function sK(t){return this.select(t?aK:iK)}function oK(t){return arguments.length?this.property("__data__",t):this.node().__data__}function lK(t){return function(e){t.call(this,e,this.__data__)}}function cK(t){return t.trim().split(/^|\s+/).map(function(e){var r="",n=e.indexOf(".");return n>=0&&(r=e.slice(n+1),e=e.slice(0,n)),{type:e,name:r}})}function uK(t){return function(){var e=this.__on;if(e){for(var r=0,n=-1,i=e.length,a;r<i;++r)a=e[r],(!t.type||a.type===t.type)&&a.name===t.name?this.removeEventListener(a.type,a.listener,a.options):e[++n]=a;++n?e.length=n:delete this.__on}}}function hK(t,e,r){return function(){var n=this.__on,i,a=lK(e);if(n){for(var s=0,o=n.length;s<o;++s)if((i=n[s]).type===t.type&&i.name===t.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=a,i.options=r),i.value=e;return}}this.addEventListener(t.type,a,r),i={type:t.type,name:t.name,value:e,listener:a,options:r},n?n.push(i):this.__on=[i]}}function dK(t,e,r){var n=cK(t+""),i,a=n.length,s;if(arguments.length<2){var o=this.node().__on;if(o){for(var l=0,u=o.length,h;l<u;++l)for(i=0,h=o[l];i<a;++i)if((s=n[i]).type===h.type&&s.name===h.name)return h.value}return}for(o=e?hK:uK,i=0;i<a;++i)this.each(o(n[i],e,r));return this}function GN(t,e,r){var n=BN(t),i=n.CustomEvent;typeof i=="function"?i=new i(e,r):(i=n.document.createEvent("Event"),r?(i.initEvent(e,r.bubbles,r.cancelable),i.detail=r.detail):i.initEvent(e,!1,!1)),t.dispatchEvent(i)}function fK(t,e){return function(){return GN(this,t,e)}}function pK(t,e){return function(){return GN(this,t,e.apply(this,arguments))}}function gK(t,e){return this.each((typeof e=="function"?pK:fK)(t,e))}function*mK(){for(var t=this._groups,e=0,r=t.length;e<r;++e)for(var n=t[e],i=0,a=n.length,s;i<a;++i)(s=n[i])&&(yield s)}var UN=[null];function _a(t,e){this._groups=t,this._parents=e}function Lp(){return new _a([[document.documentElement]],UN)}function vK(){return this}_a.prototype=Lp.prototype={constructor:_a,select:UX,selectAll:YX,selectChild:ZX,selectChildren:tj,filter:rj,data:lj,enter:nj,exit:uj,join:hj,merge:dj,selection:vK,order:fj,sort:pj,call:mj,nodes:vj,node:yj,size:xj,empty:bj,each:wj,attr:_j,style:Dj,property:Pj,classed:zj,text:Wj,html:Xj,raise:Kj,lower:Qj,append:Jj,insert:tK,remove:nK,clone:sK,datum:oK,on:dK,dispatch:gK,[Symbol.iterator]:mK};function Qe(t){return typeof t=="string"?new _a([[document.querySelector(t)]],[document.documentElement]):new _a([[t]],UN)}function Rp(t,e,r){t.prototype=e.prototype=r,r.constructor=t}function zy(t,e){var r=Object.create(t.prototype);for(var n in e)r[n]=e[n];return r}function ku(){}var M0=.7,$m=1/M0,Sh="\\s*([+-]?\\d+)\\s*",I0="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Ys="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",yK=/^#([0-9a-f]{3,8})$/,xK=new RegExp(`^rgb\\(${Sh},${Sh},${Sh}\\)$`),bK=new RegExp(`^rgb\\(${Ys},${Ys},${Ys}\\)$`),wK=new RegExp(`^rgba\\(${Sh},${Sh},${Sh},${I0}\\)$`),TK=new RegExp(`^rgba\\(${Ys},${Ys},${Ys},${I0}\\)$`),EK=new RegExp(`^hsl\\(${I0},${Ys},${Ys}\\)$`),kK=new RegExp(`^hsla\\(${I0},${Ys},${Ys},${I0}\\)$`),HS={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Rp(ku,tu,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:qS,formatHex:qS,formatHex8:SK,formatHsl:CK,formatRgb:YS,toString:YS});function qS(){return this.rgb().formatHex()}function SK(){return this.rgb().formatHex8()}function CK(){return HN(this).formatHsl()}function YS(){return this.rgb().formatRgb()}function tu(t){var e,r;return t=(t+"").trim().toLowerCase(),(e=yK.exec(t))?(r=e[1].length,e=parseInt(e[1],16),r===6?XS(e):r===3?new Ti(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):r===8?Cg(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):r===4?Cg(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=xK.exec(t))?new Ti(e[1],e[2],e[3],1):(e=bK.exec(t))?new Ti(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=wK.exec(t))?Cg(e[1],e[2],e[3],e[4]):(e=TK.exec(t))?Cg(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=EK.exec(t))?ZS(e[1],e[2]/100,e[3]/100,1):(e=kK.exec(t))?ZS(e[1],e[2]/100,e[3]/100,e[4]):HS.hasOwnProperty(t)?XS(HS[t]):t==="transparent"?new Ti(NaN,NaN,NaN,0):null}function XS(t){return new Ti(t>>16&255,t>>8&255,t&255,1)}function Cg(t,e,r,n){return n<=0&&(t=e=r=NaN),new Ti(t,e,r,n)}function WN(t){return t instanceof ku||(t=tu(t)),t?(t=t.rgb(),new Ti(t.r,t.g,t.b,t.opacity)):new Ti}function J3(t,e,r,n){return arguments.length===1?WN(t):new Ti(t,e,r,n??1)}function Ti(t,e,r,n){this.r=+t,this.g=+e,this.b=+r,this.opacity=+n}Rp(Ti,J3,zy(ku,{brighter(t){return t=t==null?$m:Math.pow($m,t),new Ti(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?M0:Math.pow(M0,t),new Ti(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Ti(Kc(this.r),Kc(this.g),Kc(this.b),zm(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:jS,formatHex:jS,formatHex8:AK,formatRgb:KS,toString:KS}));function jS(){return`#${Gc(this.r)}${Gc(this.g)}${Gc(this.b)}`}function AK(){return`#${Gc(this.r)}${Gc(this.g)}${Gc(this.b)}${Gc((isNaN(this.opacity)?1:this.opacity)*255)}`}function KS(){const t=zm(this.opacity);return`${t===1?"rgb(":"rgba("}${Kc(this.r)}, ${Kc(this.g)}, ${Kc(this.b)}${t===1?")":`, ${t})`}`}function zm(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Kc(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Gc(t){return t=Kc(t),(t<16?"0":"")+t.toString(16)}function ZS(t,e,r,n){return n<=0?t=e=r=NaN:r<=0||r>=1?t=e=NaN:e<=0&&(t=NaN),new ds(t,e,r,n)}function HN(t){if(t instanceof ds)return new ds(t.h,t.s,t.l,t.opacity);if(t instanceof ku||(t=tu(t)),!t)return new ds;if(t instanceof ds)return t;t=t.rgb();var e=t.r/255,r=t.g/255,n=t.b/255,i=Math.min(e,r,n),a=Math.max(e,r,n),s=NaN,o=a-i,l=(a+i)/2;return o?(e===a?s=(r-n)/o+(r<n)*6:r===a?s=(n-e)/o+2:s=(e-r)/o+4,o/=l<.5?a+i:2-a-i,s*=60):o=l>0&&l<1?0:s,new ds(s,o,l,t.opacity)}function _K(t,e,r,n){return arguments.length===1?HN(t):new ds(t,e,r,n??1)}function ds(t,e,r,n){this.h=+t,this.s=+e,this.l=+r,this.opacity=+n}Rp(ds,_K,zy(ku,{brighter(t){return t=t==null?$m:Math.pow($m,t),new ds(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?M0:Math.pow(M0,t),new ds(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*e,i=2*r-n;return new Ti(Nx(t>=240?t-240:t+120,i,n),Nx(t,i,n),Nx(t<120?t+240:t-120,i,n),this.opacity)},clamp(){return new ds(QS(this.h),Ag(this.s),Ag(this.l),zm(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=zm(this.opacity);return`${t===1?"hsl(":"hsla("}${QS(this.h)}, ${Ag(this.s)*100}%, ${Ag(this.l)*100}%${t===1?")":`, ${t})`}`}}));function QS(t){return t=(t||0)%360,t<0?t+360:t}function Ag(t){return Math.max(0,Math.min(1,t||0))}function Nx(t,e,r){return(t<60?e+(r-e)*t/60:t<180?r:t<240?e+(r-e)*(240-t)/60:e)*255}const LK=Math.PI/180,RK=180/Math.PI,Vm=18,qN=.96422,YN=1,XN=.82521,jN=4/29,Ch=6/29,KN=3*Ch*Ch,NK=Ch*Ch*Ch;function ZN(t){if(t instanceof Xs)return new Xs(t.l,t.a,t.b,t.opacity);if(t instanceof Ro)return QN(t);t instanceof Ti||(t=WN(t));var e=Ox(t.r),r=Ox(t.g),n=Ox(t.b),i=Dx((.2225045*e+.7168786*r+.0606169*n)/YN),a,s;return e===r&&r===n?a=s=i:(a=Dx((.4360747*e+.3850649*r+.1430804*n)/qN),s=Dx((.0139322*e+.0971045*r+.7141733*n)/XN)),new Xs(116*i-16,500*(a-i),200*(i-s),t.opacity)}function DK(t,e,r,n){return arguments.length===1?ZN(t):new Xs(t,e,r,n??1)}function Xs(t,e,r,n){this.l=+t,this.a=+e,this.b=+r,this.opacity=+n}Rp(Xs,DK,zy(ku,{brighter(t){return new Xs(this.l+Vm*(t??1),this.a,this.b,this.opacity)},darker(t){return new Xs(this.l-Vm*(t??1),this.a,this.b,this.opacity)},rgb(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,r=isNaN(this.b)?t:t-this.b/200;return e=qN*Mx(e),t=YN*Mx(t),r=XN*Mx(r),new Ti(Ix(3.1338561*e-1.6168667*t-.4906146*r),Ix(-.9787684*e+1.9161415*t+.033454*r),Ix(.0719453*e-.2289914*t+1.4052427*r),this.opacity)}}));function Dx(t){return t>NK?Math.pow(t,1/3):t/KN+jN}function Mx(t){return t>Ch?t*t*t:KN*(t-jN)}function Ix(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function Ox(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function MK(t){if(t instanceof Ro)return new Ro(t.h,t.c,t.l,t.opacity);if(t instanceof Xs||(t=ZN(t)),t.a===0&&t.b===0)return new Ro(NaN,0<t.l&&t.l<100?0:NaN,t.l,t.opacity);var e=Math.atan2(t.b,t.a)*RK;return new Ro(e<0?e+360:e,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}function e5(t,e,r,n){return arguments.length===1?MK(t):new Ro(t,e,r,n??1)}function Ro(t,e,r,n){this.h=+t,this.c=+e,this.l=+r,this.opacity=+n}function QN(t){if(isNaN(t.h))return new Xs(t.l,0,0,t.opacity);var e=t.h*LK;return new Xs(t.l,Math.cos(e)*t.c,Math.sin(e)*t.c,t.opacity)}Rp(Ro,e5,zy(ku,{brighter(t){return new Ro(this.h,this.c,this.l+Vm*(t??1),this.opacity)},darker(t){return new Ro(this.h,this.c,this.l-Vm*(t??1),this.opacity)},rgb(){return QN(this).rgb()}}));const Vy=t=>()=>t;function JN(t,e){return function(r){return t+r*e}}function IK(t,e,r){return t=Math.pow(t,r),e=Math.pow(e,r)-t,r=1/r,function(n){return Math.pow(t+n*e,r)}}function OK(t,e){var r=e-t;return r?JN(t,r>180||r<-180?r-360*Math.round(r/360):r):Vy(isNaN(t)?e:t)}function PK(t){return(t=+t)==1?w0:function(e,r){return r-e?IK(e,r,t):Vy(isNaN(e)?r:e)}}function w0(t,e){var r=e-t;return r?JN(t,r):Vy(isNaN(t)?e:t)}const Gm=function t(e){var r=PK(e);function n(i,a){var s=r((i=J3(i)).r,(a=J3(a)).r),o=r(i.g,a.g),l=r(i.b,a.b),u=w0(i.opacity,a.opacity);return function(h){return i.r=s(h),i.g=o(h),i.b=l(h),i.opacity=u(h),i+""}}return n.gamma=t,n}(1);function BK(t,e){e||(e=[]);var r=t?Math.min(e.length,t.length):0,n=e.slice(),i;return function(a){for(i=0;i<r;++i)n[i]=t[i]*(1-a)+e[i]*a;return n}}function FK(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function $K(t,e){var r=e?e.length:0,n=t?Math.min(r,t.length):0,i=new Array(n),a=new Array(r),s;for(s=0;s<n;++s)i[s]=a6(t[s],e[s]);for(;s<r;++s)a[s]=e[s];return function(o){for(s=0;s<n;++s)a[s]=i[s](o);return a}}function zK(t,e){var r=new Date;return t=+t,e=+e,function(n){return r.setTime(t*(1-n)+e*n),r}}function cs(t,e){return t=+t,e=+e,function(r){return t*(1-r)+e*r}}function VK(t,e){var r={},n={},i;(t===null||typeof t!="object")&&(t={}),(e===null||typeof e!="object")&&(e={});for(i in e)i in t?r[i]=a6(t[i],e[i]):n[i]=e[i];return function(a){for(i in r)n[i]=r[i](a);return n}}var t5=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Px=new RegExp(t5.source,"g");function GK(t){return function(){return t}}function UK(t){return function(e){return t(e)+""}}function eD(t,e){var r=t5.lastIndex=Px.lastIndex=0,n,i,a,s=-1,o=[],l=[];for(t=t+"",e=e+"";(n=t5.exec(t))&&(i=Px.exec(e));)(a=i.index)>r&&(a=e.slice(r,a),o[s]?o[s]+=a:o[++s]=a),(n=n[0])===(i=i[0])?o[s]?o[s]+=i:o[++s]=i:(o[++s]=null,l.push({i:s,x:cs(n,i)})),r=Px.lastIndex;return r<e.length&&(a=e.slice(r),o[s]?o[s]+=a:o[++s]=a),o.length<2?l[0]?UK(l[0].x):GK(e):(e=l.length,function(u){for(var h=0,d;h<e;++h)o[(d=l[h]).i]=d.x(u);return o.join("")})}function a6(t,e){var r=typeof e,n;return e==null||r==="boolean"?Vy(e):(r==="number"?cs:r==="string"?(n=tu(e))?(e=n,Gm):eD:e instanceof tu?Gm:e instanceof Date?zK:FK(e)?BK:Array.isArray(e)?$K:typeof e.valueOf!="function"&&typeof e.toString!="function"||isNaN(e)?VK:cs)(t,e)}function WK(t,e){return t=+t,e=+e,function(r){return Math.round(t*(1-r)+e*r)}}var JS=180/Math.PI,r5={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function tD(t,e,r,n,i,a){var s,o,l;return(s=Math.sqrt(t*t+e*e))&&(t/=s,e/=s),(l=t*r+e*n)&&(r-=t*l,n-=e*l),(o=Math.sqrt(r*r+n*n))&&(r/=o,n/=o,l/=o),t*n<e*r&&(t=-t,e=-e,l=-l,s=-s),{translateX:i,translateY:a,rotate:Math.atan2(e,t)*JS,skewX:Math.atan(l)*JS,scaleX:s,scaleY:o}}var _g;function HK(t){const e=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?r5:tD(e.a,e.b,e.c,e.d,e.e,e.f)}function qK(t){return t==null||(_g||(_g=document.createElementNS("http://www.w3.org/2000/svg","g")),_g.setAttribute("transform",t),!(t=_g.transform.baseVal.consolidate()))?r5:(t=t.matrix,tD(t.a,t.b,t.c,t.d,t.e,t.f))}function rD(t,e,r,n){function i(u){return u.length?u.pop()+" ":""}function a(u,h,d,f,p,g){if(u!==d||h!==f){var m=p.push("translate(",null,e,null,r);g.push({i:m-4,x:cs(u,d)},{i:m-2,x:cs(h,f)})}else(d||f)&&p.push("translate("+d+e+f+r)}function s(u,h,d,f){u!==h?(u-h>180?h+=360:h-u>180&&(u+=360),f.push({i:d.push(i(d)+"rotate(",null,n)-2,x:cs(u,h)})):h&&d.push(i(d)+"rotate("+h+n)}function o(u,h,d,f){u!==h?f.push({i:d.push(i(d)+"skewX(",null,n)-2,x:cs(u,h)}):h&&d.push(i(d)+"skewX("+h+n)}function l(u,h,d,f,p,g){if(u!==d||h!==f){var m=p.push(i(p)+"scale(",null,",",null,")");g.push({i:m-4,x:cs(u,d)},{i:m-2,x:cs(h,f)})}else(d!==1||f!==1)&&p.push(i(p)+"scale("+d+","+f+")")}return function(u,h){var d=[],f=[];return u=t(u),h=t(h),a(u.translateX,u.translateY,h.translateX,h.translateY,d,f),s(u.rotate,h.rotate,d,f),o(u.skewX,h.skewX,d,f),l(u.scaleX,u.scaleY,h.scaleX,h.scaleY,d,f),u=h=null,function(p){for(var g=-1,m=f.length,v;++g<m;)d[(v=f[g]).i]=v.x(p);return d.join("")}}}var YK=rD(HK,"px, ","px)","deg)"),XK=rD(qK,", ",")",")");function jK(t){return function(e,r){var n=t((e=e5(e)).h,(r=e5(r)).h),i=w0(e.c,r.c),a=w0(e.l,r.l),s=w0(e.opacity,r.opacity);return function(o){return e.h=n(o),e.c=i(o),e.l=a(o),e.opacity=s(o),e+""}}}const KK=jK(OK);var Uh=0,vf=0,qd=0,nD=1e3,Um,yf,Wm=0,ru=0,Gy=0,O0=typeof performance=="object"&&performance.now?performance:Date,iD=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function s6(){return ru||(iD(ZK),ru=O0.now()+Gy)}function ZK(){ru=0}function Hm(){this._call=this._time=this._next=null}Hm.prototype=aD.prototype={constructor:Hm,restart:function(t,e,r){if(typeof t!="function")throw new TypeError("callback is not a function");r=(r==null?s6():+r)+(e==null?0:+e),!this._next&&yf!==this&&(yf?yf._next=this:Um=this,yf=this),this._call=t,this._time=r,n5()},stop:function(){this._call&&(this._call=null,this._time=1/0,n5())}};function aD(t,e,r){var n=new Hm;return n.restart(t,e,r),n}function QK(){s6(),++Uh;for(var t=Um,e;t;)(e=ru-t._time)>=0&&t._call.call(void 0,e),t=t._next;--Uh}function e7(){ru=(Wm=O0.now())+Gy,Uh=vf=0;try{QK()}finally{Uh=0,eZ(),ru=0}}function JK(){var t=O0.now(),e=t-Wm;e>nD&&(Gy-=e,Wm=t)}function eZ(){for(var t,e=Um,r,n=1/0;e;)e._call?(n>e._time&&(n=e._time),t=e,e=e._next):(r=e._next,e._next=null,e=t?t._next=r:Um=r);yf=t,n5(n)}function n5(t){if(!Uh){vf&&(vf=clearTimeout(vf));var e=t-ru;e>24?(t<1/0&&(vf=setTimeout(e7,t-O0.now()-Gy)),qd&&(qd=clearInterval(qd))):(qd||(Wm=O0.now(),qd=setInterval(JK,nD)),Uh=1,iD(e7))}}function t7(t,e,r){var n=new Hm;return e=e==null?0:+e,n.restart(i=>{n.stop(),t(i+e)},e,r),n}var tZ=NN("start","end","cancel","interrupt"),rZ=[],sD=0,r7=1,i5=2,V1=3,n7=4,a5=5,G1=6;function Uy(t,e,r,n,i,a){var s=t.__transition;if(!s)t.__transition={};else if(r in s)return;nZ(t,r,{name:e,index:n,group:i,on:tZ,tween:rZ,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:sD})}function o6(t,e){var r=Ss(t,e);if(r.state>sD)throw new Error("too late; already scheduled");return r}function ro(t,e){var r=Ss(t,e);if(r.state>V1)throw new Error("too late; already running");return r}function Ss(t,e){var r=t.__transition;if(!r||!(r=r[e]))throw new Error("transition not found");return r}function nZ(t,e,r){var n=t.__transition,i;n[e]=r,r.timer=aD(a,0,r.time);function a(u){r.state=r7,r.timer.restart(s,r.delay,r.time),r.delay<=u&&s(u-r.delay)}function s(u){var h,d,f,p;if(r.state!==r7)return l();for(h in n)if(p=n[h],p.name===r.name){if(p.state===V1)return t7(s);p.state===n7?(p.state=G1,p.timer.stop(),p.on.call("interrupt",t,t.__data__,p.index,p.group),delete n[h]):+h<e&&(p.state=G1,p.timer.stop(),p.on.call("cancel",t,t.__data__,p.index,p.group),delete n[h])}if(t7(function(){r.state===V1&&(r.state=n7,r.timer.restart(o,r.delay,r.time),o(u))}),r.state=i5,r.on.call("start",t,t.__data__,r.index,r.group),r.state===i5){for(r.state=V1,i=new Array(f=r.tween.length),h=0,d=-1;h<f;++h)(p=r.tween[h].value.call(t,t.__data__,r.index,r.group))&&(i[++d]=p);i.length=d+1}}function o(u){for(var h=u<r.duration?r.ease.call(null,u/r.duration):(r.timer.restart(l),r.state=a5,1),d=-1,f=i.length;++d<f;)i[d].call(t,h);r.state===a5&&(r.on.call("end",t,t.__data__,r.index,r.group),l())}function l(){r.state=G1,r.timer.stop(),delete n[e];for(var u in n)return;delete t.__transition}}function iZ(t,e){var r=t.__transition,n,i,a=!0,s;if(r){e=e==null?null:e+"";for(s in r){if((n=r[s]).name!==e){a=!1;continue}i=n.state>i5&&n.state<a5,n.state=G1,n.timer.stop(),n.on.call(i?"interrupt":"cancel",t,t.__data__,n.index,n.group),delete r[s]}a&&delete t.__transition}}function aZ(t){return this.each(function(){iZ(this,t)})}function sZ(t,e){var r,n;return function(){var i=ro(this,t),a=i.tween;if(a!==r){n=r=a;for(var s=0,o=n.length;s<o;++s)if(n[s].name===e){n=n.slice(),n.splice(s,1);break}}i.tween=n}}function oZ(t,e,r){var n,i;if(typeof r!="function")throw new Error;return function(){var a=ro(this,t),s=a.tween;if(s!==n){i=(n=s).slice();for(var o={name:e,value:r},l=0,u=i.length;l<u;++l)if(i[l].name===e){i[l]=o;break}l===u&&i.push(o)}a.tween=i}}function lZ(t,e){var r=this._id;if(t+="",arguments.length<2){for(var n=Ss(this.node(),r).tween,i=0,a=n.length,s;i<a;++i)if((s=n[i]).name===t)return s.value;return null}return this.each((e==null?sZ:oZ)(r,t,e))}function l6(t,e,r){var n=t._id;return t.each(function(){var i=ro(this,n);(i.value||(i.value={}))[e]=r.apply(this,arguments)}),function(i){return Ss(i,n).value[e]}}function oD(t,e){var r;return(typeof e=="number"?cs:e instanceof tu?Gm:(r=tu(e))?(e=r,Gm):eD)(t,e)}function cZ(t){return function(){this.removeAttribute(t)}}function uZ(t){return function(){this.removeAttributeNS(t.space,t.local)}}function hZ(t,e,r){var n,i=r+"",a;return function(){var s=this.getAttribute(t);return s===i?null:s===n?a:a=e(n=s,r)}}function dZ(t,e,r){var n,i=r+"",a;return function(){var s=this.getAttributeNS(t.space,t.local);return s===i?null:s===n?a:a=e(n=s,r)}}function fZ(t,e,r){var n,i,a;return function(){var s,o=r(this),l;return o==null?void this.removeAttribute(t):(s=this.getAttribute(t),l=o+"",s===l?null:s===n&&l===i?a:(i=l,a=e(n=s,o)))}}function pZ(t,e,r){var n,i,a;return function(){var s,o=r(this),l;return o==null?void this.removeAttributeNS(t.space,t.local):(s=this.getAttributeNS(t.space,t.local),l=o+"",s===l?null:s===n&&l===i?a:(i=l,a=e(n=s,o)))}}function gZ(t,e){var r=$y(t),n=r==="transform"?XK:oD;return this.attrTween(t,typeof e=="function"?(r.local?pZ:fZ)(r,n,l6(this,"attr."+t,e)):e==null?(r.local?uZ:cZ)(r):(r.local?dZ:hZ)(r,n,e))}function mZ(t,e){return function(r){this.setAttribute(t,e.call(this,r))}}function vZ(t,e){return function(r){this.setAttributeNS(t.space,t.local,e.call(this,r))}}function yZ(t,e){var r,n;function i(){var a=e.apply(this,arguments);return a!==n&&(r=(n=a)&&vZ(t,a)),r}return i._value=e,i}function xZ(t,e){var r,n;function i(){var a=e.apply(this,arguments);return a!==n&&(r=(n=a)&&mZ(t,a)),r}return i._value=e,i}function bZ(t,e){var r="attr."+t;if(arguments.length<2)return(r=this.tween(r))&&r._value;if(e==null)return this.tween(r,null);if(typeof e!="function")throw new Error;var n=$y(t);return this.tween(r,(n.local?yZ:xZ)(n,e))}function wZ(t,e){return function(){o6(this,t).delay=+e.apply(this,arguments)}}function TZ(t,e){return e=+e,function(){o6(this,t).delay=e}}function EZ(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?wZ:TZ)(e,t)):Ss(this.node(),e).delay}function kZ(t,e){return function(){ro(this,t).duration=+e.apply(this,arguments)}}function SZ(t,e){return e=+e,function(){ro(this,t).duration=e}}function CZ(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?kZ:SZ)(e,t)):Ss(this.node(),e).duration}function AZ(t,e){if(typeof e!="function")throw new Error;return function(){ro(this,t).ease=e}}function _Z(t){var e=this._id;return arguments.length?this.each(AZ(e,t)):Ss(this.node(),e).ease}function LZ(t,e){return function(){var r=e.apply(this,arguments);if(typeof r!="function")throw new Error;ro(this,t).ease=r}}function RZ(t){if(typeof t!="function")throw new Error;return this.each(LZ(this._id,t))}function NZ(t){typeof t!="function"&&(t=IN(t));for(var e=this._groups,r=e.length,n=new Array(r),i=0;i<r;++i)for(var a=e[i],s=a.length,o=n[i]=[],l,u=0;u<s;++u)(l=a[u])&&t.call(l,l.__data__,u,a)&&o.push(l);return new Vo(n,this._parents,this._name,this._id)}function DZ(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,r=t._groups,n=e.length,i=r.length,a=Math.min(n,i),s=new Array(n),o=0;o<a;++o)for(var l=e[o],u=r[o],h=l.length,d=s[o]=new Array(h),f,p=0;p<h;++p)(f=l[p]||u[p])&&(d[p]=f);for(;o<n;++o)s[o]=e[o];return new Vo(s,this._parents,this._name,this._id)}function MZ(t){return(t+"").trim().split(/^|\s+/).every(function(e){var r=e.indexOf(".");return r>=0&&(e=e.slice(0,r)),!e||e==="start"})}function IZ(t,e,r){var n,i,a=MZ(e)?o6:ro;return function(){var s=a(this,t),o=s.on;o!==n&&(i=(n=o).copy()).on(e,r),s.on=i}}function OZ(t,e){var r=this._id;return arguments.length<2?Ss(this.node(),r).on.on(t):this.each(IZ(r,t,e))}function PZ(t){return function(){var e=this.parentNode;for(var r in this.__transition)if(+r!==t)return;e&&e.removeChild(this)}}function BZ(){return this.on("end.remove",PZ(this._id))}function FZ(t){var e=this._name,r=this._id;typeof t!="function"&&(t=n6(t));for(var n=this._groups,i=n.length,a=new Array(i),s=0;s<i;++s)for(var o=n[s],l=o.length,u=a[s]=new Array(l),h,d,f=0;f<l;++f)(h=o[f])&&(d=t.call(h,h.__data__,f,o))&&("__data__"in h&&(d.__data__=h.__data__),u[f]=d,Uy(u[f],e,r,f,u,Ss(h,r)));return new Vo(a,this._parents,e,r)}function $Z(t){var e=this._name,r=this._id;typeof t!="function"&&(t=MN(t));for(var n=this._groups,i=n.length,a=[],s=[],o=0;o<i;++o)for(var l=n[o],u=l.length,h,d=0;d<u;++d)if(h=l[d]){for(var f=t.call(h,h.__data__,d,l),p,g=Ss(h,r),m=0,v=f.length;m<v;++m)(p=f[m])&&Uy(p,e,r,m,f,g);a.push(f),s.push(h)}return new Vo(a,s,e,r)}var zZ=Lp.prototype.constructor;function VZ(){return new zZ(this._groups,this._parents)}function GZ(t,e){var r,n,i;return function(){var a=Gh(this,t),s=(this.style.removeProperty(t),Gh(this,t));return a===s?null:a===r&&s===n?i:i=e(r=a,n=s)}}function lD(t){return function(){this.style.removeProperty(t)}}function UZ(t,e,r){var n,i=r+"",a;return function(){var s=Gh(this,t);return s===i?null:s===n?a:a=e(n=s,r)}}function WZ(t,e,r){var n,i,a;return function(){var s=Gh(this,t),o=r(this),l=o+"";return o==null&&(l=o=(this.style.removeProperty(t),Gh(this,t))),s===l?null:s===n&&l===i?a:(i=l,a=e(n=s,o))}}function HZ(t,e){var r,n,i,a="style."+e,s="end."+a,o;return function(){var l=ro(this,t),u=l.on,h=l.value[a]==null?o||(o=lD(e)):void 0;(u!==r||i!==h)&&(n=(r=u).copy()).on(s,i=h),l.on=n}}function qZ(t,e,r){var n=(t+="")=="transform"?YK:oD;return e==null?this.styleTween(t,GZ(t,n)).on("end.style."+t,lD(t)):typeof e=="function"?this.styleTween(t,WZ(t,n,l6(this,"style."+t,e))).each(HZ(this._id,t)):this.styleTween(t,UZ(t,n,e),r).on("end.style."+t,null)}function YZ(t,e,r){return function(n){this.style.setProperty(t,e.call(this,n),r)}}function XZ(t,e,r){var n,i;function a(){var s=e.apply(this,arguments);return s!==i&&(n=(i=s)&&YZ(t,s,r)),n}return a._value=e,a}function jZ(t,e,r){var n="style."+(t+="");if(arguments.length<2)return(n=this.tween(n))&&n._value;if(e==null)return this.tween(n,null);if(typeof e!="function")throw new Error;return this.tween(n,XZ(t,e,r??""))}function KZ(t){return function(){this.textContent=t}}function ZZ(t){return function(){var e=t(this);this.textContent=e??""}}function QZ(t){return this.tween("text",typeof t=="function"?ZZ(l6(this,"text",t)):KZ(t==null?"":t+""))}function JZ(t){return function(e){this.textContent=t.call(this,e)}}function eQ(t){var e,r;function n(){var i=t.apply(this,arguments);return i!==r&&(e=(r=i)&&JZ(i)),e}return n._value=t,n}function tQ(t){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(t==null)return this.tween(e,null);if(typeof t!="function")throw new Error;return this.tween(e,eQ(t))}function rQ(){for(var t=this._name,e=this._id,r=cD(),n=this._groups,i=n.length,a=0;a<i;++a)for(var s=n[a],o=s.length,l,u=0;u<o;++u)if(l=s[u]){var h=Ss(l,e);Uy(l,t,r,u,s,{time:h.time+h.delay+h.duration,delay:0,duration:h.duration,ease:h.ease})}return new Vo(n,this._parents,t,r)}function nQ(){var t,e,r=this,n=r._id,i=r.size();return new Promise(function(a,s){var o={value:s},l={value:function(){--i===0&&a()}};r.each(function(){var u=ro(this,n),h=u.on;h!==t&&(e=(t=h).copy(),e._.cancel.push(o),e._.interrupt.push(o),e._.end.push(l)),u.on=e}),i===0&&a()})}var iQ=0;function Vo(t,e,r,n){this._groups=t,this._parents=e,this._name=r,this._id=n}function cD(){return++iQ}var go=Lp.prototype;Vo.prototype={constructor:Vo,select:FZ,selectAll:$Z,selectChild:go.selectChild,selectChildren:go.selectChildren,filter:NZ,merge:DZ,selection:VZ,transition:rQ,call:go.call,nodes:go.nodes,node:go.node,size:go.size,empty:go.empty,each:go.each,on:OZ,attr:gZ,attrTween:bZ,style:qZ,styleTween:jZ,text:QZ,textTween:tQ,remove:BZ,tween:lZ,delay:EZ,duration:CZ,ease:_Z,easeVarying:RZ,end:nQ,[Symbol.iterator]:go[Symbol.iterator]};function aQ(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var sQ={time:null,delay:0,duration:250,ease:aQ};function oQ(t,e){for(var r;!(r=t.__transition)||!(r=r[e]);)if(!(t=t.parentNode))throw new Error(`transition ${e} not found`);return r}function lQ(t){var e,r;t instanceof Vo?(e=t._id,t=t._name):(e=cD(),(r=sQ).time=s6(),t=t==null?null:t+"");for(var n=this._groups,i=n.length,a=0;a<i;++a)for(var s=n[a],o=s.length,l,u=0;u<o;++u)(l=s[u])&&Uy(l,t,e,u,s,r||oQ(l,e));return new Vo(n,this._parents,t,e)}Lp.prototype.interrupt=aZ;Lp.prototype.transition=lQ;const s5=Math.PI,o5=2*s5,Rc=1e-6,cQ=o5-Rc;function uD(t){this._+=t[0];for(let e=1,r=t.length;e<r;++e)this._+=arguments[e]+t[e]}function uQ(t){let e=Math.floor(t);if(!(e>=0))throw new Error(`invalid digits: ${t}`);if(e>15)return uD;const r=10**e;return function(n){this._+=n[0];for(let i=1,a=n.length;i<a;++i)this._+=Math.round(arguments[i]*r)/r+n[i]}}let hQ=class{constructor(e){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=e==null?uD:uQ(e)}moveTo(e,r){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+r}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(e,r){this._append`L${this._x1=+e},${this._y1=+r}`}quadraticCurveTo(e,r,n,i){this._append`Q${+e},${+r},${this._x1=+n},${this._y1=+i}`}bezierCurveTo(e,r,n,i,a,s){this._append`C${+e},${+r},${+n},${+i},${this._x1=+a},${this._y1=+s}`}arcTo(e,r,n,i,a){if(e=+e,r=+r,n=+n,i=+i,a=+a,a<0)throw new Error(`negative radius: ${a}`);let s=this._x1,o=this._y1,l=n-e,u=i-r,h=s-e,d=o-r,f=h*h+d*d;if(this._x1===null)this._append`M${this._x1=e},${this._y1=r}`;else if(f>Rc)if(!(Math.abs(d*l-u*h)>Rc)||!a)this._append`L${this._x1=e},${this._y1=r}`;else{let p=n-s,g=i-o,m=l*l+u*u,v=p*p+g*g,y=Math.sqrt(m),b=Math.sqrt(f),w=a*Math.tan((s5-Math.acos((m+f-v)/(2*y*b)))/2),T=w/b,E=w/y;Math.abs(T-1)>Rc&&this._append`L${e+T*h},${r+T*d}`,this._append`A${a},${a},0,0,${+(d*p>h*g)},${this._x1=e+E*l},${this._y1=r+E*u}`}}arc(e,r,n,i,a,s){if(e=+e,r=+r,n=+n,s=!!s,n<0)throw new Error(`negative radius: ${n}`);let o=n*Math.cos(i),l=n*Math.sin(i),u=e+o,h=r+l,d=1^s,f=s?i-a:a-i;this._x1===null?this._append`M${u},${h}`:(Math.abs(this._x1-u)>Rc||Math.abs(this._y1-h)>Rc)&&this._append`L${u},${h}`,n&&(f<0&&(f=f%o5+o5),f>cQ?this._append`A${n},${n},0,1,${d},${e-o},${r-l}A${n},${n},0,1,${d},${this._x1=u},${this._y1=h}`:f>Rc&&this._append`A${n},${n},0,${+(f>=s5)},${d},${this._x1=e+n*Math.cos(a)},${this._y1=r+n*Math.sin(a)}`)}rect(e,r,n,i){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+r}h${n=+n}v${+i}h${-n}Z`}toString(){return this._}};function dQ(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function qm(t,e){if((r=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var r,n=t.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+t.slice(r+1)]}function Wh(t){return t=qm(Math.abs(t)),t?t[1]:NaN}function fQ(t,e){return function(r,n){for(var i=r.length,a=[],s=0,o=t[0],l=0;i>0&&o>0&&(l+o+1>n&&(o=Math.max(1,n-l)),a.push(r.substring(i-=o,i+o)),!((l+=o+1)>n));)o=t[s=(s+1)%t.length];return a.reverse().join(e)}}function pQ(t){return function(e){return e.replace(/[0-9]/g,function(r){return t[+r]})}}var gQ=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Ym(t){if(!(e=gQ.exec(t)))throw new Error("invalid format: "+t);var e;return new c6({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}Ym.prototype=c6.prototype;function c6(t){this.fill=t.fill===void 0?" ":t.fill+"",this.align=t.align===void 0?">":t.align+"",this.sign=t.sign===void 0?"-":t.sign+"",this.symbol=t.symbol===void 0?"":t.symbol+"",this.zero=!!t.zero,this.width=t.width===void 0?void 0:+t.width,this.comma=!!t.comma,this.precision=t.precision===void 0?void 0:+t.precision,this.trim=!!t.trim,this.type=t.type===void 0?"":t.type+""}c6.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function mQ(t){e:for(var e=t.length,r=1,n=-1,i;r<e;++r)switch(t[r]){case".":n=i=r;break;case"0":n===0&&(n=r),i=r;break;default:if(!+t[r])break e;n>0&&(n=0);break}return n>0?t.slice(0,n)+t.slice(i+1):t}var hD;function vQ(t,e){var r=qm(t,e);if(!r)return t+"";var n=r[0],i=r[1],a=i-(hD=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,s=n.length;return a===s?n:a>s?n+new Array(a-s+1).join("0"):a>0?n.slice(0,a)+"."+n.slice(a):"0."+new Array(1-a).join("0")+qm(t,Math.max(0,e+a-1))[0]}function i7(t,e){var r=qm(t,e);if(!r)return t+"";var n=r[0],i=r[1];return i<0?"0."+new Array(-i).join("0")+n:n.length>i+1?n.slice(0,i+1)+"."+n.slice(i+1):n+new Array(i-n.length+2).join("0")}const a7={"%":(t,e)=>(t*100).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:dQ,e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>i7(t*100,e),r:i7,s:vQ,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function s7(t){return t}var o7=Array.prototype.map,l7=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function yQ(t){var e=t.grouping===void 0||t.thousands===void 0?s7:fQ(o7.call(t.grouping,Number),t.thousands+""),r=t.currency===void 0?"":t.currency[0]+"",n=t.currency===void 0?"":t.currency[1]+"",i=t.decimal===void 0?".":t.decimal+"",a=t.numerals===void 0?s7:pQ(o7.call(t.numerals,String)),s=t.percent===void 0?"%":t.percent+"",o=t.minus===void 0?"−":t.minus+"",l=t.nan===void 0?"NaN":t.nan+"";function u(d){d=Ym(d);var f=d.fill,p=d.align,g=d.sign,m=d.symbol,v=d.zero,y=d.width,b=d.comma,w=d.precision,T=d.trim,E=d.type;E==="n"?(b=!0,E="g"):a7[E]||(w===void 0&&(w=12),T=!0,E="g"),(v||f==="0"&&p==="=")&&(v=!0,f="0",p="=");var L=m==="$"?r:m==="#"&&/[boxX]/.test(E)?"0"+E.toLowerCase():"",S=m==="$"?n:/[%p]/.test(E)?s:"",C=a7[E],A=/[defgprs%]/.test(E);w=w===void 0?6:/[gprs]/.test(E)?Math.max(1,Math.min(21,w)):Math.max(0,Math.min(20,w));function N(_){var O=L,P=S,k,R,I;if(E==="c")P=C(_)+P,_="";else{_=+_;var M=_<0||1/_<0;if(_=isNaN(_)?l:C(Math.abs(_),w),T&&(_=mQ(_)),M&&+_==0&&g!=="+"&&(M=!1),O=(M?g==="("?g:o:g==="-"||g==="("?"":g)+O,P=(E==="s"?l7[8+hD/3]:"")+P+(M&&g==="("?")":""),A){for(k=-1,R=_.length;++k<R;)if(I=_.charCodeAt(k),48>I||I>57){P=(I===46?i+_.slice(k+1):_.slice(k))+P,_=_.slice(0,k);break}}}b&&!v&&(_=e(_,1/0));var D=O.length+_.length+P.length,B=D<y?new Array(y-D+1).join(f):"";switch(b&&v&&(_=e(B+_,B.length?y-P.length:1/0),B=""),p){case"<":_=O+_+P+B;break;case"=":_=O+B+_+P;break;case"^":_=B.slice(0,D=B.length>>1)+O+_+P+B.slice(D);break;default:_=B+O+_+P;break}return a(_)}return N.toString=function(){return d+""},N}function h(d,f){var p=u((d=Ym(d),d.type="f",d)),g=Math.max(-8,Math.min(8,Math.floor(Wh(f)/3)))*3,m=Math.pow(10,-g),v=l7[8+g/3];return function(y){return p(m*y)+v}}return{format:u,formatPrefix:h}}var Lg,Oc,dD;xQ({thousands:",",grouping:[3],currency:["$",""]});function xQ(t){return Lg=yQ(t),Oc=Lg.format,dD=Lg.formatPrefix,Lg}function bQ(t){return Math.max(0,-Wh(Math.abs(t)))}function wQ(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Wh(e)/3)))*3-Wh(Math.abs(t)))}function TQ(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,Wh(e)-Wh(t))+1}function EQ(t){var e=0,r=t.children,n=r&&r.length;if(!n)e=1;else for(;--n>=0;)e+=r[n].value;t.value=e}function kQ(){return this.eachAfter(EQ)}function SQ(t,e){let r=-1;for(const n of this)t.call(e,n,++r,this);return this}function CQ(t,e){for(var r=this,n=[r],i,a,s=-1;r=n.pop();)if(t.call(e,r,++s,this),i=r.children)for(a=i.length-1;a>=0;--a)n.push(i[a]);return this}function AQ(t,e){for(var r=this,n=[r],i=[],a,s,o,l=-1;r=n.pop();)if(i.push(r),a=r.children)for(s=0,o=a.length;s<o;++s)n.push(a[s]);for(;r=i.pop();)t.call(e,r,++l,this);return this}function _Q(t,e){let r=-1;for(const n of this)if(t.call(e,n,++r,this))return n}function LQ(t){return this.eachAfter(function(e){for(var r=+t(e.data)||0,n=e.children,i=n&&n.length;--i>=0;)r+=n[i].value;e.value=r})}function RQ(t){return this.eachBefore(function(e){e.children&&e.children.sort(t)})}function NQ(t){for(var e=this,r=DQ(e,t),n=[e];e!==r;)e=e.parent,n.push(e);for(var i=n.length;t!==r;)n.splice(i,0,t),t=t.parent;return n}function DQ(t,e){if(t===e)return t;var r=t.ancestors(),n=e.ancestors(),i=null;for(t=r.pop(),e=n.pop();t===e;)i=t,t=r.pop(),e=n.pop();return i}function MQ(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e}function IQ(){return Array.from(this)}function OQ(){var t=[];return this.eachBefore(function(e){e.children||t.push(e)}),t}function PQ(){var t=this,e=[];return t.each(function(r){r!==t&&e.push({source:r.parent,target:r})}),e}function*BQ(){var t=this,e,r=[t],n,i,a;do for(e=r.reverse(),r=[];t=e.pop();)if(yield t,n=t.children)for(i=0,a=n.length;i<a;++i)r.push(n[i]);while(r.length)}function u6(t,e){t instanceof Map?(t=[void 0,t],e===void 0&&(e=zQ)):e===void 0&&(e=$Q);for(var r=new Xm(t),n,i=[r],a,s,o,l;n=i.pop();)if((s=e(n.data))&&(l=(s=Array.from(s)).length))for(n.children=s,o=l-1;o>=0;--o)i.push(a=s[o]=new Xm(s[o])),a.parent=n,a.depth=n.depth+1;return r.eachBefore(GQ)}function FQ(){return u6(this).eachBefore(VQ)}function $Q(t){return t.children}function zQ(t){return Array.isArray(t)?t[1]:null}function VQ(t){t.data.value!==void 0&&(t.value=t.data.value),t.data=t.data.data}function GQ(t){var e=0;do t.height=e;while((t=t.parent)&&t.height<++e)}function Xm(t){this.data=t,this.depth=this.height=0,this.parent=null}Xm.prototype=u6.prototype={constructor:Xm,count:kQ,each:SQ,eachAfter:AQ,eachBefore:CQ,find:_Q,sum:LQ,sort:RQ,path:NQ,ancestors:MQ,descendants:IQ,leaves:OQ,links:PQ,copy:FQ,[Symbol.iterator]:BQ};function UQ(t){if(typeof t!="function")throw new Error;return t}function Yd(){return 0}function Xd(t){return function(){return t}}function WQ(t){t.x0=Math.round(t.x0),t.y0=Math.round(t.y0),t.x1=Math.round(t.x1),t.y1=Math.round(t.y1)}function HQ(t,e,r,n,i){for(var a=t.children,s,o=-1,l=a.length,u=t.value&&(n-e)/t.value;++o<l;)s=a[o],s.y0=r,s.y1=i,s.x0=e,s.x1=e+=s.value*u}function qQ(t,e,r,n,i){for(var a=t.children,s,o=-1,l=a.length,u=t.value&&(i-r)/t.value;++o<l;)s=a[o],s.x0=e,s.x1=n,s.y0=r,s.y1=r+=s.value*u}var YQ=(1+Math.sqrt(5))/2;function XQ(t,e,r,n,i,a){for(var s=[],o=e.children,l,u,h=0,d=0,f=o.length,p,g,m=e.value,v,y,b,w,T,E,L;h<f;){p=i-r,g=a-n;do v=o[d++].value;while(!v&&d<f);for(y=b=v,E=Math.max(g/p,p/g)/(m*t),L=v*v*E,T=Math.max(b/L,L/y);d<f;++d){if(v+=u=o[d].value,u<y&&(y=u),u>b&&(b=u),L=v*v*E,w=Math.max(b/L,L/y),w>T){v-=u;break}T=w}s.push(l={value:v,dice:p<g,children:o.slice(h,d)}),l.dice?HQ(l,r,n,i,m?n+=g*v/m:a):qQ(l,r,n,m?r+=p*v/m:i,a),m-=v,h=d}return s}const jQ=function t(e){function r(n,i,a,s,o){XQ(e,n,i,a,s,o)}return r.ratio=function(n){return t((n=+n)>1?n:1)},r}(YQ);function KQ(){var t=jQ,e=!1,r=1,n=1,i=[0],a=Yd,s=Yd,o=Yd,l=Yd,u=Yd;function h(f){return f.x0=f.y0=0,f.x1=r,f.y1=n,f.eachBefore(d),i=[0],e&&f.eachBefore(WQ),f}function d(f){var p=i[f.depth],g=f.x0+p,m=f.y0+p,v=f.x1-p,y=f.y1-p;v<g&&(g=v=(g+v)/2),y<m&&(m=y=(m+y)/2),f.x0=g,f.y0=m,f.x1=v,f.y1=y,f.children&&(p=i[f.depth+1]=a(f)/2,g+=u(f)-p,m+=s(f)-p,v-=o(f)-p,y-=l(f)-p,v<g&&(g=v=(g+v)/2),y<m&&(m=y=(m+y)/2),t(f,g,m,v,y))}return h.round=function(f){return arguments.length?(e=!!f,h):e},h.size=function(f){return arguments.length?(r=+f[0],n=+f[1],h):[r,n]},h.tile=function(f){return arguments.length?(t=UQ(f),h):t},h.padding=function(f){return arguments.length?h.paddingInner(f).paddingOuter(f):h.paddingInner()},h.paddingInner=function(f){return arguments.length?(a=typeof f=="function"?f:Xd(+f),h):a},h.paddingOuter=function(f){return arguments.length?h.paddingTop(f).paddingRight(f).paddingBottom(f).paddingLeft(f):h.paddingTop()},h.paddingTop=function(f){return arguments.length?(s=typeof f=="function"?f:Xd(+f),h):s},h.paddingRight=function(f){return arguments.length?(o=typeof f=="function"?f:Xd(+f),h):o},h.paddingBottom=function(f){return arguments.length?(l=typeof f=="function"?f:Xd(+f),h):l},h.paddingLeft=function(f){return arguments.length?(u=typeof f=="function"?f:Xd(+f),h):u},h}function Wy(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t);break}return this}const c7=Symbol("implicit");function Zc(){var t=new zS,e=[],r=[],n=c7;function i(a){let s=t.get(a);if(s===void 0){if(n!==c7)return n;t.set(a,s=e.push(a)-1)}return r[s%r.length]}return i.domain=function(a){if(!arguments.length)return e.slice();e=[],t=new zS;for(const s of a)t.has(s)||t.set(s,e.push(s)-1);return i},i.range=function(a){return arguments.length?(r=Array.from(a),i):r.slice()},i.unknown=function(a){return arguments.length?(n=a,i):n},i.copy=function(){return Zc(e,r).unknown(n)},Wy.apply(i,arguments),i}function l5(){var t=Zc().unknown(void 0),e=t.domain,r=t.range,n=0,i=1,a,s,o=!1,l=0,u=0,h=.5;delete t.unknown;function d(){var f=e().length,p=i<n,g=p?i:n,m=p?n:i;a=(m-g)/Math.max(1,f-l+u*2),o&&(a=Math.floor(a)),g+=(m-g-a*(f-l))*h,s=a*(1-l),o&&(g=Math.round(g),s=Math.round(s));var v=_X(f).map(function(y){return g+a*y});return r(p?v.reverse():v)}return t.domain=function(f){return arguments.length?(e(f),d()):e()},t.range=function(f){return arguments.length?([n,i]=f,n=+n,i=+i,d()):[n,i]},t.rangeRound=function(f){return[n,i]=f,n=+n,i=+i,o=!0,d()},t.bandwidth=function(){return s},t.step=function(){return a},t.round=function(f){return arguments.length?(o=!!f,d()):o},t.padding=function(f){return arguments.length?(l=Math.min(1,u=+f),d()):l},t.paddingInner=function(f){return arguments.length?(l=Math.min(1,f),d()):l},t.paddingOuter=function(f){return arguments.length?(u=+f,d()):u},t.align=function(f){return arguments.length?(h=Math.max(0,Math.min(1,f)),d()):h},t.copy=function(){return l5(e(),[n,i]).round(o).paddingInner(l).paddingOuter(u).align(h)},Wy.apply(d(),arguments)}function ZQ(t){return function(){return t}}function QQ(t){return+t}var u7=[0,1];function gh(t){return t}function c5(t,e){return(e-=t=+t)?function(r){return(r-t)/e}:ZQ(isNaN(e)?NaN:.5)}function JQ(t,e){var r;return t>e&&(r=t,t=e,e=r),function(n){return Math.max(t,Math.min(e,n))}}function eJ(t,e,r){var n=t[0],i=t[1],a=e[0],s=e[1];return i<n?(n=c5(i,n),a=r(s,a)):(n=c5(n,i),a=r(a,s)),function(o){return a(n(o))}}function tJ(t,e,r){var n=Math.min(t.length,e.length)-1,i=new Array(n),a=new Array(n),s=-1;for(t[n]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++s<n;)i[s]=c5(t[s],t[s+1]),a[s]=r(e[s],e[s+1]);return function(o){var l=yX(t,o,1,n)-1;return a[l](i[l](o))}}function fD(t,e){return e.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown())}function rJ(){var t=u7,e=u7,r=a6,n,i,a,s=gh,o,l,u;function h(){var f=Math.min(t.length,e.length);return s!==gh&&(s=JQ(t[0],t[f-1])),o=f>2?tJ:eJ,l=u=null,d}function d(f){return f==null||isNaN(f=+f)?a:(l||(l=o(t.map(n),e,r)))(n(s(f)))}return d.invert=function(f){return s(i((u||(u=o(e,t.map(n),cs)))(f)))},d.domain=function(f){return arguments.length?(t=Array.from(f,QQ),h()):t.slice()},d.range=function(f){return arguments.length?(e=Array.from(f),h()):e.slice()},d.rangeRound=function(f){return e=Array.from(f),r=WK,h()},d.clamp=function(f){return arguments.length?(s=f?!0:gh,h()):s!==gh},d.interpolate=function(f){return arguments.length?(r=f,h()):r},d.unknown=function(f){return arguments.length?(a=f,d):a},function(f,p){return n=f,i=p,h()}}function pD(){return rJ()(gh,gh)}function nJ(t,e,r,n){var i=K3(t,e,r),a;switch(n=Ym(n??",f"),n.type){case"s":{var s=Math.max(Math.abs(t),Math.abs(e));return n.precision==null&&!isNaN(a=wQ(i,s))&&(n.precision=a),dD(n,s)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(a=TQ(i,Math.max(Math.abs(t),Math.abs(e))))&&(n.precision=a-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(a=bQ(i))&&(n.precision=a-(n.type==="%")*2);break}}return Oc(n)}function iJ(t){var e=t.domain;return t.ticks=function(r){var n=e();return SX(n[0],n[n.length-1],r??10)},t.tickFormat=function(r,n){var i=e();return nJ(i[0],i[i.length-1],r??10,n)},t.nice=function(r){r==null&&(r=10);var n=e(),i=0,a=n.length-1,s=n[i],o=n[a],l,u,h=10;for(o<s&&(u=s,s=o,o=u,u=i,i=a,a=u);h-- >0;){if(u=j3(s,o,r),u===l)return n[i]=s,n[a]=o,e(n);if(u>0)s=Math.floor(s/u)*u,o=Math.ceil(o/u)*u;else if(u<0)s=Math.ceil(s*u)/u,o=Math.floor(o*u)/u;else break;l=u}return t},t}function Hh(){var t=pD();return t.copy=function(){return fD(t,Hh())},Wy.apply(t,arguments),iJ(t)}function aJ(t,e){t=t.slice();var r=0,n=t.length-1,i=t[r],a=t[n],s;return a<i&&(s=r,r=n,n=s,s=i,i=a,a=s),t[r]=e.floor(i),t[n]=e.ceil(a),t}const Bx=new Date,Fx=new Date;function Un(t,e,r,n){function i(a){return t(a=arguments.length===0?new Date:new Date(+a)),a}return i.floor=a=>(t(a=new Date(+a)),a),i.ceil=a=>(t(a=new Date(a-1)),e(a,1),t(a),a),i.round=a=>{const s=i(a),o=i.ceil(a);return a-s<o-a?s:o},i.offset=(a,s)=>(e(a=new Date(+a),s==null?1:Math.floor(s)),a),i.range=(a,s,o)=>{const l=[];if(a=i.ceil(a),o=o==null?1:Math.floor(o),!(a<s)||!(o>0))return l;let u;do l.push(u=new Date(+a)),e(a,o),t(a);while(u<a&&a<s);return l},i.filter=a=>Un(s=>{if(s>=s)for(;t(s),!a(s);)s.setTime(s-1)},(s,o)=>{if(s>=s)if(o<0)for(;++o<=0;)for(;e(s,-1),!a(s););else for(;--o>=0;)for(;e(s,1),!a(s););}),r&&(i.count=(a,s)=>(Bx.setTime(+a),Fx.setTime(+s),t(Bx),t(Fx),Math.floor(r(Bx,Fx))),i.every=a=>(a=Math.floor(a),!isFinite(a)||!(a>0)?null:a>1?i.filter(n?s=>n(s)%a===0:s=>i.count(0,s)%a===0):i)),i}const qh=Un(()=>{},(t,e)=>{t.setTime(+t+e)},(t,e)=>e-t);qh.every=t=>(t=Math.floor(t),!isFinite(t)||!(t>0)?null:t>1?Un(e=>{e.setTime(Math.floor(e/t)*t)},(e,r)=>{e.setTime(+e+r*t)},(e,r)=>(r-e)/t):qh);qh.range;const No=1e3,qa=No*60,Do=qa*60,Go=Do*24,h6=Go*7,h7=Go*30,$x=Go*365,xl=Un(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+e*No)},(t,e)=>(e-t)/No,t=>t.getUTCSeconds());xl.range;const P0=Un(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*No)},(t,e)=>{t.setTime(+t+e*qa)},(t,e)=>(e-t)/qa,t=>t.getMinutes());P0.range;const sJ=Un(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+e*qa)},(t,e)=>(e-t)/qa,t=>t.getUTCMinutes());sJ.range;const B0=Un(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*No-t.getMinutes()*qa)},(t,e)=>{t.setTime(+t+e*Do)},(t,e)=>(e-t)/Do,t=>t.getHours());B0.range;const oJ=Un(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+e*Do)},(t,e)=>(e-t)/Do,t=>t.getUTCHours());oJ.range;const nu=Un(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*qa)/Go,t=>t.getDate()-1);nu.range;const d6=Un(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/Go,t=>t.getUTCDate()-1);d6.range;const lJ=Un(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/Go,t=>Math.floor(t/Go));lJ.range;function Su(t){return Un(e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},(e,r)=>{e.setDate(e.getDate()+r*7)},(e,r)=>(r-e-(r.getTimezoneOffset()-e.getTimezoneOffset())*qa)/h6)}const Np=Su(0),F0=Su(1),gD=Su(2),mD=Su(3),iu=Su(4),vD=Su(5),yD=Su(6);Np.range;F0.range;gD.range;mD.range;iu.range;vD.range;yD.range;function Cu(t){return Un(e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)},(e,r)=>{e.setUTCDate(e.getUTCDate()+r*7)},(e,r)=>(r-e)/h6)}const xD=Cu(0),jm=Cu(1),cJ=Cu(2),uJ=Cu(3),Yh=Cu(4),hJ=Cu(5),dJ=Cu(6);xD.range;jm.range;cJ.range;uJ.range;Yh.range;hJ.range;dJ.range;const $0=Un(t=>{t.setDate(1),t.setHours(0,0,0,0)},(t,e)=>{t.setMonth(t.getMonth()+e)},(t,e)=>e.getMonth()-t.getMonth()+(e.getFullYear()-t.getFullYear())*12,t=>t.getMonth());$0.range;const fJ=Un(t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCMonth(t.getUTCMonth()+e)},(t,e)=>e.getUTCMonth()-t.getUTCMonth()+(e.getUTCFullYear()-t.getUTCFullYear())*12,t=>t.getUTCMonth());fJ.range;const Uo=Un(t=>{t.setMonth(0,1),t.setHours(0,0,0,0)},(t,e)=>{t.setFullYear(t.getFullYear()+e)},(t,e)=>e.getFullYear()-t.getFullYear(),t=>t.getFullYear());Uo.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:Un(e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},(e,r)=>{e.setFullYear(e.getFullYear()+r*t)});Uo.range;const au=Un(t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e)},(t,e)=>e.getUTCFullYear()-t.getUTCFullYear(),t=>t.getUTCFullYear());au.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:Un(e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,r)=>{e.setUTCFullYear(e.getUTCFullYear()+r*t)});au.range;function pJ(t,e,r,n,i,a){const s=[[xl,1,No],[xl,5,5*No],[xl,15,15*No],[xl,30,30*No],[a,1,qa],[a,5,5*qa],[a,15,15*qa],[a,30,30*qa],[i,1,Do],[i,3,3*Do],[i,6,6*Do],[i,12,12*Do],[n,1,Go],[n,2,2*Go],[r,1,h6],[e,1,h7],[e,3,3*h7],[t,1,$x]];function o(u,h,d){const f=h<u;f&&([u,h]=[h,u]);const p=d&&typeof d.range=="function"?d:l(u,h,d),g=p?p.range(u,+h+1):[];return f?g.reverse():g}function l(u,h,d){const f=Math.abs(h-u)/d,p=r6(([,,v])=>v).right(s,f);if(p===s.length)return t.every(K3(u/$x,h/$x,d));if(p===0)return qh.every(Math.max(K3(u,h,d),1));const[g,m]=s[f/s[p-1][2]<s[p][2]/f?p-1:p];return g.every(m)}return[o,l]}const[gJ,mJ]=pJ(Uo,$0,Np,nu,B0,P0);function zx(t){if(0<=t.y&&t.y<100){var e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function Vx(t){if(0<=t.y&&t.y<100){var e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function jd(t,e,r){return{y:t,m:e,d:r,H:0,M:0,S:0,L:0}}function vJ(t){var e=t.dateTime,r=t.date,n=t.time,i=t.periods,a=t.days,s=t.shortDays,o=t.months,l=t.shortMonths,u=Kd(i),h=Zd(i),d=Kd(a),f=Zd(a),p=Kd(s),g=Zd(s),m=Kd(o),v=Zd(o),y=Kd(l),b=Zd(l),w={a:M,A:D,b:B,B:$,c:null,d:v7,e:v7,f:zJ,g:KJ,G:QJ,H:BJ,I:FJ,j:$J,L:bD,m:VJ,M:GJ,p:F,q:G,Q:b7,s:w7,S:UJ,u:WJ,U:HJ,V:qJ,w:YJ,W:XJ,x:null,X:null,y:jJ,Y:ZJ,Z:JJ,"%":x7},T={a:W,A:J,b:q,B:ne,c:null,d:y7,e:y7,f:nee,g:fee,G:gee,H:eee,I:tee,j:ree,L:TD,m:iee,M:aee,p:ae,q:pe,Q:b7,s:w7,S:see,u:oee,U:lee,V:cee,w:uee,W:hee,x:null,X:null,y:dee,Y:pee,Z:mee,"%":x7},E={a:N,A:_,b:O,B:P,c:k,d:g7,e:g7,f:MJ,g:p7,G:f7,H:m7,I:m7,j:LJ,L:DJ,m:_J,M:RJ,p:A,q:AJ,Q:OJ,s:PJ,S:NJ,u:TJ,U:EJ,V:kJ,w:wJ,W:SJ,x:R,X:I,y:p7,Y:f7,Z:CJ,"%":IJ};w.x=L(r,w),w.X=L(n,w),w.c=L(e,w),T.x=L(r,T),T.X=L(n,T),T.c=L(e,T);function L(K,Z){return function(X){var Y=[],ee=-1,j=0,fe=K.length,te,Ae,H;for(X instanceof Date||(X=new Date(+X));++ee<fe;)K.charCodeAt(ee)===37&&(Y.push(K.slice(j,ee)),(Ae=d7[te=K.charAt(++ee)])!=null?te=K.charAt(++ee):Ae=te==="e"?" ":"0",(H=Z[te])&&(te=H(X,Ae)),Y.push(te),j=ee+1);return Y.push(K.slice(j,ee)),Y.join("")}}function S(K,Z){return function(X){var Y=jd(1900,void 0,1),ee=C(Y,K,X+="",0),j,fe;if(ee!=X.length)return null;if("Q"in Y)return new Date(Y.Q);if("s"in Y)return new Date(Y.s*1e3+("L"in Y?Y.L:0));if(Z&&!("Z"in Y)&&(Y.Z=0),"p"in Y&&(Y.H=Y.H%12+Y.p*12),Y.m===void 0&&(Y.m="q"in Y?Y.q:0),"V"in Y){if(Y.V<1||Y.V>53)return null;"w"in Y||(Y.w=1),"Z"in Y?(j=Vx(jd(Y.y,0,1)),fe=j.getUTCDay(),j=fe>4||fe===0?jm.ceil(j):jm(j),j=d6.offset(j,(Y.V-1)*7),Y.y=j.getUTCFullYear(),Y.m=j.getUTCMonth(),Y.d=j.getUTCDate()+(Y.w+6)%7):(j=zx(jd(Y.y,0,1)),fe=j.getDay(),j=fe>4||fe===0?F0.ceil(j):F0(j),j=nu.offset(j,(Y.V-1)*7),Y.y=j.getFullYear(),Y.m=j.getMonth(),Y.d=j.getDate()+(Y.w+6)%7)}else("W"in Y||"U"in Y)&&("w"in Y||(Y.w="u"in Y?Y.u%7:"W"in Y?1:0),fe="Z"in Y?Vx(jd(Y.y,0,1)).getUTCDay():zx(jd(Y.y,0,1)).getDay(),Y.m=0,Y.d="W"in Y?(Y.w+6)%7+Y.W*7-(fe+5)%7:Y.w+Y.U*7-(fe+6)%7);return"Z"in Y?(Y.H+=Y.Z/100|0,Y.M+=Y.Z%100,Vx(Y)):zx(Y)}}function C(K,Z,X,Y){for(var ee=0,j=Z.length,fe=X.length,te,Ae;ee<j;){if(Y>=fe)return-1;if(te=Z.charCodeAt(ee++),te===37){if(te=Z.charAt(ee++),Ae=E[te in d7?Z.charAt(ee++):te],!Ae||(Y=Ae(K,X,Y))<0)return-1}else if(te!=X.charCodeAt(Y++))return-1}return Y}function A(K,Z,X){var Y=u.exec(Z.slice(X));return Y?(K.p=h.get(Y[0].toLowerCase()),X+Y[0].length):-1}function N(K,Z,X){var Y=p.exec(Z.slice(X));return Y?(K.w=g.get(Y[0].toLowerCase()),X+Y[0].length):-1}function _(K,Z,X){var Y=d.exec(Z.slice(X));return Y?(K.w=f.get(Y[0].toLowerCase()),X+Y[0].length):-1}function O(K,Z,X){var Y=y.exec(Z.slice(X));return Y?(K.m=b.get(Y[0].toLowerCase()),X+Y[0].length):-1}function P(K,Z,X){var Y=m.exec(Z.slice(X));return Y?(K.m=v.get(Y[0].toLowerCase()),X+Y[0].length):-1}function k(K,Z,X){return C(K,e,Z,X)}function R(K,Z,X){return C(K,r,Z,X)}function I(K,Z,X){return C(K,n,Z,X)}function M(K){return s[K.getDay()]}function D(K){return a[K.getDay()]}function B(K){return l[K.getMonth()]}function $(K){return o[K.getMonth()]}function F(K){return i[+(K.getHours()>=12)]}function G(K){return 1+~~(K.getMonth()/3)}function W(K){return s[K.getUTCDay()]}function J(K){return a[K.getUTCDay()]}function q(K){return l[K.getUTCMonth()]}function ne(K){return o[K.getUTCMonth()]}function ae(K){return i[+(K.getUTCHours()>=12)]}function pe(K){return 1+~~(K.getUTCMonth()/3)}return{format:function(K){var Z=L(K+="",w);return Z.toString=function(){return K},Z},parse:function(K){var Z=S(K+="",!1);return Z.toString=function(){return K},Z},utcFormat:function(K){var Z=L(K+="",T);return Z.toString=function(){return K},Z},utcParse:function(K){var Z=S(K+="",!0);return Z.toString=function(){return K},Z}}}var d7={"-":"",_:" ",0:"0"},Qn=/^\s*\d+/,yJ=/^%/,xJ=/[\\^$*+?|[\]().{}]/g;function Er(t,e,r){var n=t<0?"-":"",i=(n?-t:t)+"",a=i.length;return n+(a<r?new Array(r-a+1).join(e)+i:i)}function bJ(t){return t.replace(xJ,"\\$&")}function Kd(t){return new RegExp("^(?:"+t.map(bJ).join("|")+")","i")}function Zd(t){return new Map(t.map((e,r)=>[e.toLowerCase(),r]))}function wJ(t,e,r){var n=Qn.exec(e.slice(r,r+1));return n?(t.w=+n[0],r+n[0].length):-1}function TJ(t,e,r){var n=Qn.exec(e.slice(r,r+1));return n?(t.u=+n[0],r+n[0].length):-1}function EJ(t,e,r){var n=Qn.exec(e.slice(r,r+2));return n?(t.U=+n[0],r+n[0].length):-1}function kJ(t,e,r){var n=Qn.exec(e.slice(r,r+2));return n?(t.V=+n[0],r+n[0].length):-1}function SJ(t,e,r){var n=Qn.exec(e.slice(r,r+2));return n?(t.W=+n[0],r+n[0].length):-1}function f7(t,e,r){var n=Qn.exec(e.slice(r,r+4));return n?(t.y=+n[0],r+n[0].length):-1}function p7(t,e,r){var n=Qn.exec(e.slice(r,r+2));return n?(t.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function CJ(t,e,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(r,r+6));return n?(t.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function AJ(t,e,r){var n=Qn.exec(e.slice(r,r+1));return n?(t.q=n[0]*3-3,r+n[0].length):-1}function _J(t,e,r){var n=Qn.exec(e.slice(r,r+2));return n?(t.m=n[0]-1,r+n[0].length):-1}function g7(t,e,r){var n=Qn.exec(e.slice(r,r+2));return n?(t.d=+n[0],r+n[0].length):-1}function LJ(t,e,r){var n=Qn.exec(e.slice(r,r+3));return n?(t.m=0,t.d=+n[0],r+n[0].length):-1}function m7(t,e,r){var n=Qn.exec(e.slice(r,r+2));return n?(t.H=+n[0],r+n[0].length):-1}function RJ(t,e,r){var n=Qn.exec(e.slice(r,r+2));return n?(t.M=+n[0],r+n[0].length):-1}function NJ(t,e,r){var n=Qn.exec(e.slice(r,r+2));return n?(t.S=+n[0],r+n[0].length):-1}function DJ(t,e,r){var n=Qn.exec(e.slice(r,r+3));return n?(t.L=+n[0],r+n[0].length):-1}function MJ(t,e,r){var n=Qn.exec(e.slice(r,r+6));return n?(t.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function IJ(t,e,r){var n=yJ.exec(e.slice(r,r+1));return n?r+n[0].length:-1}function OJ(t,e,r){var n=Qn.exec(e.slice(r));return n?(t.Q=+n[0],r+n[0].length):-1}function PJ(t,e,r){var n=Qn.exec(e.slice(r));return n?(t.s=+n[0],r+n[0].length):-1}function v7(t,e){return Er(t.getDate(),e,2)}function BJ(t,e){return Er(t.getHours(),e,2)}function FJ(t,e){return Er(t.getHours()%12||12,e,2)}function $J(t,e){return Er(1+nu.count(Uo(t),t),e,3)}function bD(t,e){return Er(t.getMilliseconds(),e,3)}function zJ(t,e){return bD(t,e)+"000"}function VJ(t,e){return Er(t.getMonth()+1,e,2)}function GJ(t,e){return Er(t.getMinutes(),e,2)}function UJ(t,e){return Er(t.getSeconds(),e,2)}function WJ(t){var e=t.getDay();return e===0?7:e}function HJ(t,e){return Er(Np.count(Uo(t)-1,t),e,2)}function wD(t){var e=t.getDay();return e>=4||e===0?iu(t):iu.ceil(t)}function qJ(t,e){return t=wD(t),Er(iu.count(Uo(t),t)+(Uo(t).getDay()===4),e,2)}function YJ(t){return t.getDay()}function XJ(t,e){return Er(F0.count(Uo(t)-1,t),e,2)}function jJ(t,e){return Er(t.getFullYear()%100,e,2)}function KJ(t,e){return t=wD(t),Er(t.getFullYear()%100,e,2)}function ZJ(t,e){return Er(t.getFullYear()%1e4,e,4)}function QJ(t,e){var r=t.getDay();return t=r>=4||r===0?iu(t):iu.ceil(t),Er(t.getFullYear()%1e4,e,4)}function JJ(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+Er(e/60|0,"0",2)+Er(e%60,"0",2)}function y7(t,e){return Er(t.getUTCDate(),e,2)}function eee(t,e){return Er(t.getUTCHours(),e,2)}function tee(t,e){return Er(t.getUTCHours()%12||12,e,2)}function ree(t,e){return Er(1+d6.count(au(t),t),e,3)}function TD(t,e){return Er(t.getUTCMilliseconds(),e,3)}function nee(t,e){return TD(t,e)+"000"}function iee(t,e){return Er(t.getUTCMonth()+1,e,2)}function aee(t,e){return Er(t.getUTCMinutes(),e,2)}function see(t,e){return Er(t.getUTCSeconds(),e,2)}function oee(t){var e=t.getUTCDay();return e===0?7:e}function lee(t,e){return Er(xD.count(au(t)-1,t),e,2)}function ED(t){var e=t.getUTCDay();return e>=4||e===0?Yh(t):Yh.ceil(t)}function cee(t,e){return t=ED(t),Er(Yh.count(au(t),t)+(au(t).getUTCDay()===4),e,2)}function uee(t){return t.getUTCDay()}function hee(t,e){return Er(jm.count(au(t)-1,t),e,2)}function dee(t,e){return Er(t.getUTCFullYear()%100,e,2)}function fee(t,e){return t=ED(t),Er(t.getUTCFullYear()%100,e,2)}function pee(t,e){return Er(t.getUTCFullYear()%1e4,e,4)}function gee(t,e){var r=t.getUTCDay();return t=r>=4||r===0?Yh(t):Yh.ceil(t),Er(t.getUTCFullYear()%1e4,e,4)}function mee(){return"+0000"}function x7(){return"%"}function b7(t){return+t}function w7(t){return Math.floor(+t/1e3)}var Yu,Km;vee({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function vee(t){return Yu=vJ(t),Km=Yu.format,Yu.parse,Yu.utcFormat,Yu.utcParse,Yu}function yee(t){return new Date(t)}function xee(t){return t instanceof Date?+t:+new Date(+t)}function kD(t,e,r,n,i,a,s,o,l,u){var h=pD(),d=h.invert,f=h.domain,p=u(".%L"),g=u(":%S"),m=u("%I:%M"),v=u("%I %p"),y=u("%a %d"),b=u("%b %d"),w=u("%B"),T=u("%Y");function E(L){return(l(L)<L?p:o(L)<L?g:s(L)<L?m:a(L)<L?v:n(L)<L?i(L)<L?y:b:r(L)<L?w:T)(L)}return h.invert=function(L){return new Date(d(L))},h.domain=function(L){return arguments.length?f(Array.from(L,xee)):f().map(yee)},h.ticks=function(L){var S=f();return t(S[0],S[S.length-1],L??10)},h.tickFormat=function(L,S){return S==null?E:u(S)},h.nice=function(L){var S=f();return(!L||typeof L.range!="function")&&(L=e(S[0],S[S.length-1],L??10)),L?f(aJ(S,L)):h},h.copy=function(){return fD(h,kD(t,e,r,n,i,a,s,o,l,u))},h}function bee(){return Wy.apply(kD(gJ,mJ,Uo,$0,Np,nu,B0,P0,xl,Km).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function wee(t){for(var e=t.length/6|0,r=new Array(e),n=0;n<e;)r[n]="#"+t.slice(n*6,++n*6);return r}const Tee=wee("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab");function gn(t){return function(){return t}}const T7=Math.abs,pi=Math.atan2,Tc=Math.cos,Eee=Math.max,Gx=Math.min,Rs=Math.sin,mh=Math.sqrt,mi=1e-12,z0=Math.PI,Zm=z0/2,U1=2*z0;function kee(t){return t>1?0:t<-1?z0:Math.acos(t)}function E7(t){return t>=1?Zm:t<=-1?-Zm:Math.asin(t)}function SD(t){let e=3;return t.digits=function(r){if(!arguments.length)return e;if(r==null)e=null;else{const n=Math.floor(r);if(!(n>=0))throw new RangeError(`invalid digits: ${r}`);e=n}return t},()=>new hQ(e)}function See(t){return t.innerRadius}function Cee(t){return t.outerRadius}function Aee(t){return t.startAngle}function _ee(t){return t.endAngle}function Lee(t){return t&&t.padAngle}function Ree(t,e,r,n,i,a,s,o){var l=r-t,u=n-e,h=s-i,d=o-a,f=d*l-h*u;if(!(f*f<mi))return f=(h*(e-a)-d*(t-i))/f,[t+f*l,e+f*u]}function Rg(t,e,r,n,i,a,s){var o=t-r,l=e-n,u=(s?a:-a)/mh(o*o+l*l),h=u*l,d=-u*o,f=t+h,p=e+d,g=r+h,m=n+d,v=(f+g)/2,y=(p+m)/2,b=g-f,w=m-p,T=b*b+w*w,E=i-a,L=f*m-g*p,S=(w<0?-1:1)*mh(Eee(0,E*E*T-L*L)),C=(L*w-b*S)/T,A=(-L*b-w*S)/T,N=(L*w+b*S)/T,_=(-L*b+w*S)/T,O=C-v,P=A-y,k=N-v,R=_-y;return O*O+P*P>k*k+R*R&&(C=N,A=_),{cx:C,cy:A,x01:-h,y01:-d,x11:C*(i/E-1),y11:A*(i/E-1)}}function Xh(){var t=See,e=Cee,r=gn(0),n=null,i=Aee,a=_ee,s=Lee,o=null,l=SD(u);function u(){var h,d,f=+t.apply(this,arguments),p=+e.apply(this,arguments),g=i.apply(this,arguments)-Zm,m=a.apply(this,arguments)-Zm,v=T7(m-g),y=m>g;if(o||(o=h=l()),p<f&&(d=p,p=f,f=d),!(p>mi))o.moveTo(0,0);else if(v>U1-mi)o.moveTo(p*Tc(g),p*Rs(g)),o.arc(0,0,p,g,m,!y),f>mi&&(o.moveTo(f*Tc(m),f*Rs(m)),o.arc(0,0,f,m,g,y));else{var b=g,w=m,T=g,E=m,L=v,S=v,C=s.apply(this,arguments)/2,A=C>mi&&(n?+n.apply(this,arguments):mh(f*f+p*p)),N=Gx(T7(p-f)/2,+r.apply(this,arguments)),_=N,O=N,P,k;if(A>mi){var R=E7(A/f*Rs(C)),I=E7(A/p*Rs(C));(L-=R*2)>mi?(R*=y?1:-1,T+=R,E-=R):(L=0,T=E=(g+m)/2),(S-=I*2)>mi?(I*=y?1:-1,b+=I,w-=I):(S=0,b=w=(g+m)/2)}var M=p*Tc(b),D=p*Rs(b),B=f*Tc(E),$=f*Rs(E);if(N>mi){var F=p*Tc(w),G=p*Rs(w),W=f*Tc(T),J=f*Rs(T),q;if(v<z0)if(q=Ree(M,D,W,J,F,G,B,$)){var ne=M-q[0],ae=D-q[1],pe=F-q[0],K=G-q[1],Z=1/Rs(kee((ne*pe+ae*K)/(mh(ne*ne+ae*ae)*mh(pe*pe+K*K)))/2),X=mh(q[0]*q[0]+q[1]*q[1]);_=Gx(N,(f-X)/(Z-1)),O=Gx(N,(p-X)/(Z+1))}else _=O=0}S>mi?O>mi?(P=Rg(W,J,M,D,p,O,y),k=Rg(F,G,B,$,p,O,y),o.moveTo(P.cx+P.x01,P.cy+P.y01),O<N?o.arc(P.cx,P.cy,O,pi(P.y01,P.x01),pi(k.y01,k.x01),!y):(o.arc(P.cx,P.cy,O,pi(P.y01,P.x01),pi(P.y11,P.x11),!y),o.arc(0,0,p,pi(P.cy+P.y11,P.cx+P.x11),pi(k.cy+k.y11,k.cx+k.x11),!y),o.arc(k.cx,k.cy,O,pi(k.y11,k.x11),pi(k.y01,k.x01),!y))):(o.moveTo(M,D),o.arc(0,0,p,b,w,!y)):o.moveTo(M,D),!(f>mi)||!(L>mi)?o.lineTo(B,$):_>mi?(P=Rg(B,$,F,G,f,-_,y),k=Rg(M,D,W,J,f,-_,y),o.lineTo(P.cx+P.x01,P.cy+P.y01),_<N?o.arc(P.cx,P.cy,_,pi(P.y01,P.x01),pi(k.y01,k.x01),!y):(o.arc(P.cx,P.cy,_,pi(P.y01,P.x01),pi(P.y11,P.x11),!y),o.arc(0,0,f,pi(P.cy+P.y11,P.cx+P.x11),pi(k.cy+k.y11,k.cx+k.x11),y),o.arc(k.cx,k.cy,_,pi(k.y11,k.x11),pi(k.y01,k.x01),!y))):o.arc(0,0,f,E,T,y)}if(o.closePath(),h)return o=null,h+""||null}return u.centroid=function(){var h=(+t.apply(this,arguments)+ +e.apply(this,arguments))/2,d=(+i.apply(this,arguments)+ +a.apply(this,arguments))/2-z0/2;return[Tc(d)*h,Rs(d)*h]},u.innerRadius=function(h){return arguments.length?(t=typeof h=="function"?h:gn(+h),u):t},u.outerRadius=function(h){return arguments.length?(e=typeof h=="function"?h:gn(+h),u):e},u.cornerRadius=function(h){return arguments.length?(r=typeof h=="function"?h:gn(+h),u):r},u.padRadius=function(h){return arguments.length?(n=h==null?null:typeof h=="function"?h:gn(+h),u):n},u.startAngle=function(h){return arguments.length?(i=typeof h=="function"?h:gn(+h),u):i},u.endAngle=function(h){return arguments.length?(a=typeof h=="function"?h:gn(+h),u):a},u.padAngle=function(h){return arguments.length?(s=typeof h=="function"?h:gn(+h),u):s},u.context=function(h){return arguments.length?(o=h??null,u):o},u}function CD(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function AD(t){this._context=t}AD.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(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e);break}}};function Qm(t){return new AD(t)}function Nee(t){return t[0]}function Dee(t){return t[1]}function V0(t,e){var r=gn(!0),n=null,i=Qm,a=null,s=SD(o);t=typeof t=="function"?t:t===void 0?Nee:gn(t),e=typeof e=="function"?e:e===void 0?Dee:gn(e);function o(l){var u,h=(l=CD(l)).length,d,f=!1,p;for(n==null&&(a=i(p=s())),u=0;u<=h;++u)!(u<h&&r(d=l[u],u,l))===f&&((f=!f)?a.lineStart():a.lineEnd()),f&&a.point(+t(d,u,l),+e(d,u,l));if(p)return a=null,p+""||null}return o.x=function(l){return arguments.length?(t=typeof l=="function"?l:gn(+l),o):t},o.y=function(l){return arguments.length?(e=typeof l=="function"?l:gn(+l),o):e},o.defined=function(l){return arguments.length?(r=typeof l=="function"?l:gn(!!l),o):r},o.curve=function(l){return arguments.length?(i=l,n!=null&&(a=i(n)),o):i},o.context=function(l){return arguments.length?(l==null?n=a=null:a=i(n=l),o):n},o}function Mee(t,e){return e<t?-1:e>t?1:e>=t?0:NaN}function Iee(t){return t}function Oee(){var t=Iee,e=Mee,r=null,n=gn(0),i=gn(U1),a=gn(0);function s(o){var l,u=(o=CD(o)).length,h,d,f=0,p=new Array(u),g=new Array(u),m=+n.apply(this,arguments),v=Math.min(U1,Math.max(-U1,i.apply(this,arguments)-m)),y,b=Math.min(Math.abs(v)/u,a.apply(this,arguments)),w=b*(v<0?-1:1),T;for(l=0;l<u;++l)(T=g[p[l]=l]=+t(o[l],l,o))>0&&(f+=T);for(e!=null?p.sort(function(E,L){return e(g[E],g[L])}):r!=null&&p.sort(function(E,L){return r(o[E],o[L])}),l=0,d=f?(v-u*w)/f:0;l<u;++l,m=y)h=p[l],T=g[h],y=m+(T>0?T*d:0)+w,g[h]={data:o[h],index:l,value:T,startAngle:m,endAngle:y,padAngle:b};return g}return s.value=function(o){return arguments.length?(t=typeof o=="function"?o:gn(+o),s):t},s.sortValues=function(o){return arguments.length?(e=o,r=null,s):e},s.sort=function(o){return arguments.length?(r=o,e=null,s):r},s.startAngle=function(o){return arguments.length?(n=typeof o=="function"?o:gn(+o),s):n},s.endAngle=function(o){return arguments.length?(i=typeof o=="function"?o:gn(+o),s):i},s.padAngle=function(o){return arguments.length?(a=typeof o=="function"?o:gn(+o),s):a},s}class _D{constructor(e,r){this._context=e,this._x=r}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(e,r){switch(e=+e,r=+r,this._point){case 0:{this._point=1,this._line?this._context.lineTo(e,r):this._context.moveTo(e,r);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+e)/2,this._y0,this._x0,r,e,r):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+r)/2,e,this._y0,e,r);break}}this._x0=e,this._y0=r}}function LD(t){return new _D(t,!0)}function RD(t){return new _D(t,!1)}function Dl(){}function Jm(t,e,r){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+r)/6)}function Hy(t){this._context=t}Hy.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:Jm(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Jm(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function Ah(t){return new Hy(t)}function ND(t){this._context=t}ND.prototype={areaStart:Dl,areaEnd:Dl,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x2=t,this._y2=e;break;case 1:this._point=2,this._x3=t,this._y3=e;break;case 2:this._point=3,this._x4=t,this._y4=e,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+e)/6);break;default:Jm(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function Pee(t){return new ND(t)}function DD(t){this._context=t}DD.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var r=(this._x0+4*this._x1+t)/6,n=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(r,n):this._context.moveTo(r,n);break;case 3:this._point=4;default:Jm(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function Bee(t){return new DD(t)}function MD(t,e){this._basis=new Hy(t),this._beta=e}MD.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,e=this._y,r=t.length-1;if(r>0)for(var n=t[0],i=e[0],a=t[r]-n,s=e[r]-i,o=-1,l;++o<=r;)l=o/r,this._basis.point(this._beta*t[o]+(1-this._beta)*(n+l*a),this._beta*e[o]+(1-this._beta)*(i+l*s));this._x=this._y=null,this._basis.lineEnd()},point:function(t,e){this._x.push(+t),this._y.push(+e)}};const Fee=function t(e){function r(n){return e===1?new Hy(n):new MD(n,e)}return r.beta=function(n){return t(+n)},r}(.85);function ev(t,e,r){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-r),t._x2,t._y2)}function f6(t,e){this._context=t,this._k=(1-e)/6}f6.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:ev(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:ev(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const ID=function t(e){function r(n){return new f6(n,e)}return r.tension=function(n){return t(+n)},r}(0);function p6(t,e){this._context=t,this._k=(1-e)/6}p6.prototype={areaStart:Dl,areaEnd:Dl,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:ev(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const $ee=function t(e){function r(n){return new p6(n,e)}return r.tension=function(n){return t(+n)},r}(0);function g6(t,e){this._context=t,this._k=(1-e)/6}g6.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,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:ev(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const zee=function t(e){function r(n){return new g6(n,e)}return r.tension=function(n){return t(+n)},r}(0);function m6(t,e,r){var n=t._x1,i=t._y1,a=t._x2,s=t._y2;if(t._l01_a>mi){var o=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,l=3*t._l01_a*(t._l01_a+t._l12_a);n=(n*o-t._x0*t._l12_2a+t._x2*t._l01_2a)/l,i=(i*o-t._y0*t._l12_2a+t._y2*t._l01_2a)/l}if(t._l23_a>mi){var u=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,h=3*t._l23_a*(t._l23_a+t._l12_a);a=(a*u+t._x1*t._l23_2a-e*t._l12_2a)/h,s=(s*u+t._y1*t._l23_2a-r*t._l12_2a)/h}t._context.bezierCurveTo(n,i,a,s,t._x2,t._y2)}function OD(t,e){this._context=t,this._alpha=e}OD.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(t,e){if(t=+t,e=+e,this._point){var r=this._x2-t,n=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:m6(this,t,e);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=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const PD=function t(e){function r(n){return e?new OD(n,e):new f6(n,0)}return r.alpha=function(n){return t(+n)},r}(.5);function BD(t,e){this._context=t,this._alpha=e}BD.prototype={areaStart:Dl,areaEnd:Dl,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(t,e){if(t=+t,e=+e,this._point){var r=this._x2-t,n=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:m6(this,t,e);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=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const Vee=function t(e){function r(n){return e?new BD(n,e):new p6(n,0)}return r.alpha=function(n){return t(+n)},r}(.5);function FD(t,e){this._context=t,this._alpha=e}FD.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(t,e){if(t=+t,e=+e,this._point){var r=this._x2-t,n=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,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:m6(this,t,e);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=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const Gee=function t(e){function r(n){return e?new FD(n,e):new g6(n,0)}return r.alpha=function(n){return t(+n)},r}(.5);function $D(t){this._context=t}$D.prototype={areaStart:Dl,areaEnd:Dl,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,e){t=+t,e=+e,this._point?this._context.lineTo(t,e):(this._point=1,this._context.moveTo(t,e))}};function Uee(t){return new $D(t)}function k7(t){return t<0?-1:1}function S7(t,e,r){var n=t._x1-t._x0,i=e-t._x1,a=(t._y1-t._y0)/(n||i<0&&-0),s=(r-t._y1)/(i||n<0&&-0),o=(a*i+s*n)/(n+i);return(k7(a)+k7(s))*Math.min(Math.abs(a),Math.abs(s),.5*Math.abs(o))||0}function C7(t,e){var r=t._x1-t._x0;return r?(3*(t._y1-t._y0)/r-e)/2:e}function Ux(t,e,r){var n=t._x0,i=t._y0,a=t._x1,s=t._y1,o=(a-n)/3;t._context.bezierCurveTo(n+o,i+o*e,a-o,s-o*r,a,s)}function tv(t){this._context=t}tv.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:Ux(this,this._t0,C7(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){var r=NaN;if(t=+t,e=+e,!(t===this._x1&&e===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,Ux(this,C7(this,r=S7(this,t,e)),r);break;default:Ux(this,this._t0,r=S7(this,t,e));break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=r}}};function zD(t){this._context=new VD(t)}(zD.prototype=Object.create(tv.prototype)).point=function(t,e){tv.prototype.point.call(this,e,t)};function VD(t){this._context=t}VD.prototype={moveTo:function(t,e){this._context.moveTo(e,t)},closePath:function(){this._context.closePath()},lineTo:function(t,e){this._context.lineTo(e,t)},bezierCurveTo:function(t,e,r,n,i,a){this._context.bezierCurveTo(e,t,n,r,a,i)}};function GD(t){return new tv(t)}function UD(t){return new zD(t)}function WD(t){this._context=t}WD.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var t=this._x,e=this._y,r=t.length;if(r)if(this._line?this._context.lineTo(t[0],e[0]):this._context.moveTo(t[0],e[0]),r===2)this._context.lineTo(t[1],e[1]);else for(var n=A7(t),i=A7(e),a=0,s=1;s<r;++a,++s)this._context.bezierCurveTo(n[0][a],i[0][a],n[1][a],i[1][a],t[s],e[s]);(this._line||this._line!==0&&r===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(t,e){this._x.push(+t),this._y.push(+e)}};function A7(t){var e,r=t.length-1,n,i=new Array(r),a=new Array(r),s=new Array(r);for(i[0]=0,a[0]=2,s[0]=t[0]+2*t[1],e=1;e<r-1;++e)i[e]=1,a[e]=4,s[e]=4*t[e]+2*t[e+1];for(i[r-1]=2,a[r-1]=7,s[r-1]=8*t[r-1]+t[r],e=1;e<r;++e)n=i[e]/a[e-1],a[e]-=n,s[e]-=n*s[e-1];for(i[r-1]=s[r-1]/a[r-1],e=r-2;e>=0;--e)i[e]=(s[e]-i[e+1])/a[e];for(a[r-1]=(t[r]+i[r-1])/2,e=0;e<r-1;++e)a[e]=2*t[e+1]-i[e+1];return[i,a]}function HD(t){return new WD(t)}function qy(t,e){this._context=t,this._t=e}qy.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var r=this._x*(1-this._t)+t*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,e)}break}}this._x=t,this._y=e}};function qD(t){return new qy(t,.5)}function YD(t){return new qy(t,0)}function XD(t){return new qy(t,1)}function xf(t,e,r){this.k=t,this.x=e,this.y=r}xf.prototype={constructor:xf,scale:function(t){return t===1?this:new xf(this.k*t,this.x,this.y)},translate:function(t,e){return t===0&e===0?this:new xf(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};xf.prototype;var el=x(t=>{const{securityLevel:e}=we();let r=Qe("body");if(e==="sandbox"){const a=Qe(`#i${t}`).node()?.contentDocument??document;r=Qe(a.body)}return r.select(`#${t}`)},"selectSvgElement");function v6(t){return typeof t>"u"||t===null}x(v6,"isNothing");function jD(t){return typeof t=="object"&&t!==null}x(jD,"isObject");function KD(t){return Array.isArray(t)?t:v6(t)?[]:[t]}x(KD,"toArray");function ZD(t,e){var r,n,i,a;if(e)for(a=Object.keys(e),r=0,n=a.length;r<n;r+=1)i=a[r],t[i]=e[i];return t}x(ZD,"extend");function QD(t,e){var r="",n;for(n=0;n<e;n+=1)r+=t;return r}x(QD,"repeat");function JD(t){return t===0&&Number.NEGATIVE_INFINITY===1/t}x(JD,"isNegativeZero");var Wee=v6,Hee=jD,qee=KD,Yee=QD,Xee=JD,jee=ZD,On={isNothing:Wee,isObject:Hee,toArray:qee,repeat:Yee,isNegativeZero:Xee,extend:jee};function y6(t,e){var r="",n=t.reason||"(unknown reason)";return t.mark?(t.mark.name&&(r+='in "'+t.mark.name+'" '),r+="("+(t.mark.line+1)+":"+(t.mark.column+1)+")",!e&&t.mark.snippet&&(r+=`

`+t.mark.snippet),n+" "+r):n}x(y6,"formatError");function jh(t,e){Error.call(this),this.name="YAMLException",this.reason=t,this.mark=e,this.message=y6(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}x(jh,"YAMLException$1");jh.prototype=Object.create(Error.prototype);jh.prototype.constructor=jh;jh.prototype.toString=x(function(e){return this.name+": "+y6(this,e)},"toString");var sa=jh;function W1(t,e,r,n,i){var a="",s="",o=Math.floor(i/2)-1;return n-e>o&&(a=" ... ",e=n-o+a.length),r-n>o&&(s=" ...",r=n+o-s.length),{str:a+t.slice(e,r).replace(/\t/g,"→")+s,pos:n-e+a.length}}x(W1,"getLine");function H1(t,e){return On.repeat(" ",e-t.length)+t}x(H1,"padStart");function eM(t,e){if(e=Object.create(e||null),!t.buffer)return null;e.maxLength||(e.maxLength=79),typeof e.indent!="number"&&(e.indent=1),typeof e.linesBefore!="number"&&(e.linesBefore=3),typeof e.linesAfter!="number"&&(e.linesAfter=2);for(var r=/\r?\n|\r|\0/g,n=[0],i=[],a,s=-1;a=r.exec(t.buffer);)i.push(a.index),n.push(a.index+a[0].length),t.position<=a.index&&s<0&&(s=n.length-2);s<0&&(s=n.length-1);var o="",l,u,h=Math.min(t.line+e.linesAfter,i.length).toString().length,d=e.maxLength-(e.indent+h+3);for(l=1;l<=e.linesBefore&&!(s-l<0);l++)u=W1(t.buffer,n[s-l],i[s-l],t.position-(n[s]-n[s-l]),d),o=On.repeat(" ",e.indent)+H1((t.line-l+1).toString(),h)+" | "+u.str+`
`+o;for(u=W1(t.buffer,n[s],i[s],t.position,d),o+=On.repeat(" ",e.indent)+H1((t.line+1).toString(),h)+" | "+u.str+`
`,o+=On.repeat("-",e.indent+h+3+u.pos)+`^
`,l=1;l<=e.linesAfter&&!(s+l>=i.length);l++)u=W1(t.buffer,n[s+l],i[s+l],t.position-(n[s]-n[s+l]),d),o+=On.repeat(" ",e.indent)+H1((t.line+l+1).toString(),h)+" | "+u.str+`
`;return o.replace(/\n$/,"")}x(eM,"makeSnippet");var Kee=eM,Zee=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],Qee=["scalar","sequence","mapping"];function tM(t){var e={};return t!==null&&Object.keys(t).forEach(function(r){t[r].forEach(function(n){e[String(n)]=r})}),e}x(tM,"compileStyleAliases");function rM(t,e){if(e=e||{},Object.keys(e).forEach(function(r){if(Zee.indexOf(r)===-1)throw new sa('Unknown option "'+r+'" is met in definition of "'+t+'" YAML type.')}),this.options=e,this.tag=t,this.kind=e.kind||null,this.resolve=e.resolve||function(){return!0},this.construct=e.construct||function(r){return r},this.instanceOf=e.instanceOf||null,this.predicate=e.predicate||null,this.represent=e.represent||null,this.representName=e.representName||null,this.defaultStyle=e.defaultStyle||null,this.multi=e.multi||!1,this.styleAliases=tM(e.styleAliases||null),Qee.indexOf(this.kind)===-1)throw new sa('Unknown kind "'+this.kind+'" is specified for "'+t+'" YAML type.')}x(rM,"Type$1");var ki=rM;function u5(t,e){var r=[];return t[e].forEach(function(n){var i=r.length;r.forEach(function(a,s){a.tag===n.tag&&a.kind===n.kind&&a.multi===n.multi&&(i=s)}),r[i]=n}),r}x(u5,"compileList");function nM(){var t={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},e,r;function n(i){i.multi?(t.multi[i.kind].push(i),t.multi.fallback.push(i)):t[i.kind][i.tag]=t.fallback[i.tag]=i}for(x(n,"collectType"),e=0,r=arguments.length;e<r;e+=1)arguments[e].forEach(n);return t}x(nM,"compileMap");function rv(t){return this.extend(t)}x(rv,"Schema$1");rv.prototype.extend=x(function(e){var r=[],n=[];if(e instanceof ki)n.push(e);else if(Array.isArray(e))n=n.concat(e);else if(e&&(Array.isArray(e.implicit)||Array.isArray(e.explicit)))e.implicit&&(r=r.concat(e.implicit)),e.explicit&&(n=n.concat(e.explicit));else throw new sa("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");r.forEach(function(a){if(!(a instanceof ki))throw new sa("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(a.loadKind&&a.loadKind!=="scalar")throw new sa("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(a.multi)throw new sa("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),n.forEach(function(a){if(!(a instanceof ki))throw new sa("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var i=Object.create(rv.prototype);return i.implicit=(this.implicit||[]).concat(r),i.explicit=(this.explicit||[]).concat(n),i.compiledImplicit=u5(i,"implicit"),i.compiledExplicit=u5(i,"explicit"),i.compiledTypeMap=nM(i.compiledImplicit,i.compiledExplicit),i},"extend");var Jee=rv,ete=new ki("tag:yaml.org,2002:str",{kind:"scalar",construct:x(function(t){return t!==null?t:""},"construct")}),tte=new ki("tag:yaml.org,2002:seq",{kind:"sequence",construct:x(function(t){return t!==null?t:[]},"construct")}),rte=new ki("tag:yaml.org,2002:map",{kind:"mapping",construct:x(function(t){return t!==null?t:{}},"construct")}),nte=new Jee({explicit:[ete,tte,rte]});function iM(t){if(t===null)return!0;var e=t.length;return e===1&&t==="~"||e===4&&(t==="null"||t==="Null"||t==="NULL")}x(iM,"resolveYamlNull");function aM(){return null}x(aM,"constructYamlNull");function sM(t){return t===null}x(sM,"isNull");var ite=new ki("tag:yaml.org,2002:null",{kind:"scalar",resolve:iM,construct:aM,predicate:sM,represent:{canonical:x(function(){return"~"},"canonical"),lowercase:x(function(){return"null"},"lowercase"),uppercase:x(function(){return"NULL"},"uppercase"),camelcase:x(function(){return"Null"},"camelcase"),empty:x(function(){return""},"empty")},defaultStyle:"lowercase"});function oM(t){if(t===null)return!1;var e=t.length;return e===4&&(t==="true"||t==="True"||t==="TRUE")||e===5&&(t==="false"||t==="False"||t==="FALSE")}x(oM,"resolveYamlBoolean");function lM(t){return t==="true"||t==="True"||t==="TRUE"}x(lM,"constructYamlBoolean");function cM(t){return Object.prototype.toString.call(t)==="[object Boolean]"}x(cM,"isBoolean");var ate=new ki("tag:yaml.org,2002:bool",{kind:"scalar",resolve:oM,construct:lM,predicate:cM,represent:{lowercase:x(function(t){return t?"true":"false"},"lowercase"),uppercase:x(function(t){return t?"TRUE":"FALSE"},"uppercase"),camelcase:x(function(t){return t?"True":"False"},"camelcase")},defaultStyle:"lowercase"});function uM(t){return 48<=t&&t<=57||65<=t&&t<=70||97<=t&&t<=102}x(uM,"isHexCode");function hM(t){return 48<=t&&t<=55}x(hM,"isOctCode");function dM(t){return 48<=t&&t<=57}x(dM,"isDecCode");function fM(t){if(t===null)return!1;var e=t.length,r=0,n=!1,i;if(!e)return!1;if(i=t[r],(i==="-"||i==="+")&&(i=t[++r]),i==="0"){if(r+1===e)return!0;if(i=t[++r],i==="b"){for(r++;r<e;r++)if(i=t[r],i!=="_"){if(i!=="0"&&i!=="1")return!1;n=!0}return n&&i!=="_"}if(i==="x"){for(r++;r<e;r++)if(i=t[r],i!=="_"){if(!uM(t.charCodeAt(r)))return!1;n=!0}return n&&i!=="_"}if(i==="o"){for(r++;r<e;r++)if(i=t[r],i!=="_"){if(!hM(t.charCodeAt(r)))return!1;n=!0}return n&&i!=="_"}}if(i==="_")return!1;for(;r<e;r++)if(i=t[r],i!=="_"){if(!dM(t.charCodeAt(r)))return!1;n=!0}return!(!n||i==="_")}x(fM,"resolveYamlInteger");function pM(t){var e=t,r=1,n;if(e.indexOf("_")!==-1&&(e=e.replace(/_/g,"")),n=e[0],(n==="-"||n==="+")&&(n==="-"&&(r=-1),e=e.slice(1),n=e[0]),e==="0")return 0;if(n==="0"){if(e[1]==="b")return r*parseInt(e.slice(2),2);if(e[1]==="x")return r*parseInt(e.slice(2),16);if(e[1]==="o")return r*parseInt(e.slice(2),8)}return r*parseInt(e,10)}x(pM,"constructYamlInteger");function gM(t){return Object.prototype.toString.call(t)==="[object Number]"&&t%1===0&&!On.isNegativeZero(t)}x(gM,"isInteger");var ste=new ki("tag:yaml.org,2002:int",{kind:"scalar",resolve:fM,construct:pM,predicate:gM,represent:{binary:x(function(t){return t>=0?"0b"+t.toString(2):"-0b"+t.toString(2).slice(1)},"binary"),octal:x(function(t){return t>=0?"0o"+t.toString(8):"-0o"+t.toString(8).slice(1)},"octal"),decimal:x(function(t){return t.toString(10)},"decimal"),hexadecimal:x(function(t){return t>=0?"0x"+t.toString(16).toUpperCase():"-0x"+t.toString(16).toUpperCase().slice(1)},"hexadecimal")},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),ote=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function mM(t){return!(t===null||!ote.test(t)||t[t.length-1]==="_")}x(mM,"resolveYamlFloat");function vM(t){var e,r;return e=t.replace(/_/g,"").toLowerCase(),r=e[0]==="-"?-1:1,"+-".indexOf(e[0])>=0&&(e=e.slice(1)),e===".inf"?r===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:e===".nan"?NaN:r*parseFloat(e,10)}x(vM,"constructYamlFloat");var lte=/^[-+]?[0-9]+e/;function yM(t,e){var r;if(isNaN(t))switch(e){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===t)switch(e){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===t)switch(e){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(On.isNegativeZero(t))return"-0.0";return r=t.toString(10),lte.test(r)?r.replace("e",".e"):r}x(yM,"representYamlFloat");function xM(t){return Object.prototype.toString.call(t)==="[object Number]"&&(t%1!==0||On.isNegativeZero(t))}x(xM,"isFloat");var cte=new ki("tag:yaml.org,2002:float",{kind:"scalar",resolve:mM,construct:vM,predicate:xM,represent:yM,defaultStyle:"lowercase"}),bM=nte.extend({implicit:[ite,ate,ste,cte]}),ute=bM,wM=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),TM=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 EM(t){return t===null?!1:wM.exec(t)!==null||TM.exec(t)!==null}x(EM,"resolveYamlTimestamp");function kM(t){var e,r,n,i,a,s,o,l=0,u=null,h,d,f;if(e=wM.exec(t),e===null&&(e=TM.exec(t)),e===null)throw new Error("Date resolve error");if(r=+e[1],n=+e[2]-1,i=+e[3],!e[4])return new Date(Date.UTC(r,n,i));if(a=+e[4],s=+e[5],o=+e[6],e[7]){for(l=e[7].slice(0,3);l.length<3;)l+="0";l=+l}return e[9]&&(h=+e[10],d=+(e[11]||0),u=(h*60+d)*6e4,e[9]==="-"&&(u=-u)),f=new Date(Date.UTC(r,n,i,a,s,o,l)),u&&f.setTime(f.getTime()-u),f}x(kM,"constructYamlTimestamp");function SM(t){return t.toISOString()}x(SM,"representYamlTimestamp");var hte=new ki("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:EM,construct:kM,instanceOf:Date,represent:SM});function CM(t){return t==="<<"||t===null}x(CM,"resolveYamlMerge");var dte=new ki("tag:yaml.org,2002:merge",{kind:"scalar",resolve:CM}),x6=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
\r`;function AM(t){if(t===null)return!1;var e,r,n=0,i=t.length,a=x6;for(r=0;r<i;r++)if(e=a.indexOf(t.charAt(r)),!(e>64)){if(e<0)return!1;n+=6}return n%8===0}x(AM,"resolveYamlBinary");function _M(t){var e,r,n=t.replace(/[\r\n=]/g,""),i=n.length,a=x6,s=0,o=[];for(e=0;e<i;e++)e%4===0&&e&&(o.push(s>>16&255),o.push(s>>8&255),o.push(s&255)),s=s<<6|a.indexOf(n.charAt(e));return r=i%4*6,r===0?(o.push(s>>16&255),o.push(s>>8&255),o.push(s&255)):r===18?(o.push(s>>10&255),o.push(s>>2&255)):r===12&&o.push(s>>4&255),new Uint8Array(o)}x(_M,"constructYamlBinary");function LM(t){var e="",r=0,n,i,a=t.length,s=x6;for(n=0;n<a;n++)n%3===0&&n&&(e+=s[r>>18&63],e+=s[r>>12&63],e+=s[r>>6&63],e+=s[r&63]),r=(r<<8)+t[n];return i=a%3,i===0?(e+=s[r>>18&63],e+=s[r>>12&63],e+=s[r>>6&63],e+=s[r&63]):i===2?(e+=s[r>>10&63],e+=s[r>>4&63],e+=s[r<<2&63],e+=s[64]):i===1&&(e+=s[r>>2&63],e+=s[r<<4&63],e+=s[64],e+=s[64]),e}x(LM,"representYamlBinary");function RM(t){return Object.prototype.toString.call(t)==="[object Uint8Array]"}x(RM,"isBinary");var fte=new ki("tag:yaml.org,2002:binary",{kind:"scalar",resolve:AM,construct:_M,predicate:RM,represent:LM}),pte=Object.prototype.hasOwnProperty,gte=Object.prototype.toString;function NM(t){if(t===null)return!0;var e=[],r,n,i,a,s,o=t;for(r=0,n=o.length;r<n;r+=1){if(i=o[r],s=!1,gte.call(i)!=="[object Object]")return!1;for(a in i)if(pte.call(i,a))if(!s)s=!0;else return!1;if(!s)return!1;if(e.indexOf(a)===-1)e.push(a);else return!1}return!0}x(NM,"resolveYamlOmap");function DM(t){return t!==null?t:[]}x(DM,"constructYamlOmap");var mte=new ki("tag:yaml.org,2002:omap",{kind:"sequence",resolve:NM,construct:DM}),vte=Object.prototype.toString;function MM(t){if(t===null)return!0;var e,r,n,i,a,s=t;for(a=new Array(s.length),e=0,r=s.length;e<r;e+=1){if(n=s[e],vte.call(n)!=="[object Object]"||(i=Object.keys(n),i.length!==1))return!1;a[e]=[i[0],n[i[0]]]}return!0}x(MM,"resolveYamlPairs");function IM(t){if(t===null)return[];var e,r,n,i,a,s=t;for(a=new Array(s.length),e=0,r=s.length;e<r;e+=1)n=s[e],i=Object.keys(n),a[e]=[i[0],n[i[0]]];return a}x(IM,"constructYamlPairs");var yte=new ki("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:MM,construct:IM}),xte=Object.prototype.hasOwnProperty;function OM(t){if(t===null)return!0;var e,r=t;for(e in r)if(xte.call(r,e)&&r[e]!==null)return!1;return!0}x(OM,"resolveYamlSet");function PM(t){return t!==null?t:{}}x(PM,"constructYamlSet");var bte=new ki("tag:yaml.org,2002:set",{kind:"mapping",resolve:OM,construct:PM}),BM=ute.extend({implicit:[hte,dte],explicit:[fte,mte,yte,bte]}),Ml=Object.prototype.hasOwnProperty,nv=1,FM=2,$M=3,iv=4,Wx=1,wte=2,_7=3,Tte=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,Ete=/[\x85\u2028\u2029]/,kte=/[,\[\]\{\}]/,zM=/^(?:!|!!|![a-z\-]+!)$/i,VM=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function h5(t){return Object.prototype.toString.call(t)}x(h5,"_class");function ps(t){return t===10||t===13}x(ps,"is_EOL");function _l(t){return t===9||t===32}x(_l,"is_WHITE_SPACE");function Fi(t){return t===9||t===32||t===10||t===13}x(Fi,"is_WS_OR_EOL");function Uc(t){return t===44||t===91||t===93||t===123||t===125}x(Uc,"is_FLOW_INDICATOR");function GM(t){var e;return 48<=t&&t<=57?t-48:(e=t|32,97<=e&&e<=102?e-97+10:-1)}x(GM,"fromHexCode");function UM(t){return t===120?2:t===117?4:t===85?8:0}x(UM,"escapedHexLen");function WM(t){return 48<=t&&t<=57?t-48:-1}x(WM,"fromDecimalCode");function d5(t){return t===48?"\0":t===97?"\x07":t===98?"\b":t===116||t===9?"	":t===110?`
`:t===118?"\v":t===102?"\f":t===114?"\r":t===101?"\x1B":t===32?" ":t===34?'"':t===47?"/":t===92?"\\":t===78?"":t===95?" ":t===76?"\u2028":t===80?"\u2029":""}x(d5,"simpleEscapeSequence");function HM(t){return t<=65535?String.fromCharCode(t):String.fromCharCode((t-65536>>10)+55296,(t-65536&1023)+56320)}x(HM,"charFromCodepoint");var qM=new Array(256),YM=new Array(256);for(Ec=0;Ec<256;Ec++)qM[Ec]=d5(Ec)?1:0,YM[Ec]=d5(Ec);var Ec;function XM(t,e){this.input=t,this.filename=e.filename||null,this.schema=e.schema||BM,this.onWarning=e.onWarning||null,this.legacy=e.legacy||!1,this.json=e.json||!1,this.listener=e.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=t.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}x(XM,"State$1");function b6(t,e){var r={name:t.filename,buffer:t.input.slice(0,-1),position:t.position,line:t.line,column:t.position-t.lineStart};return r.snippet=Kee(r),new sa(e,r)}x(b6,"generateError");function Pt(t,e){throw b6(t,e)}x(Pt,"throwError");function G0(t,e){t.onWarning&&t.onWarning.call(null,b6(t,e))}x(G0,"throwWarning");var L7={YAML:x(function(e,r,n){var i,a,s;e.version!==null&&Pt(e,"duplication of %YAML directive"),n.length!==1&&Pt(e,"YAML directive accepts exactly one argument"),i=/^([0-9]+)\.([0-9]+)$/.exec(n[0]),i===null&&Pt(e,"ill-formed argument of the YAML directive"),a=parseInt(i[1],10),s=parseInt(i[2],10),a!==1&&Pt(e,"unacceptable YAML version of the document"),e.version=n[0],e.checkLineBreaks=s<2,s!==1&&s!==2&&G0(e,"unsupported YAML version of the document")},"handleYamlDirective"),TAG:x(function(e,r,n){var i,a;n.length!==2&&Pt(e,"TAG directive accepts exactly two arguments"),i=n[0],a=n[1],zM.test(i)||Pt(e,"ill-formed tag handle (first argument) of the TAG directive"),Ml.call(e.tagMap,i)&&Pt(e,'there is a previously declared suffix for "'+i+'" tag handle'),VM.test(a)||Pt(e,"ill-formed tag prefix (second argument) of the TAG directive");try{a=decodeURIComponent(a)}catch{Pt(e,"tag prefix is malformed: "+a)}e.tagMap[i]=a},"handleTagDirective")};function Bo(t,e,r,n){var i,a,s,o;if(e<r){if(o=t.input.slice(e,r),n)for(i=0,a=o.length;i<a;i+=1)s=o.charCodeAt(i),s===9||32<=s&&s<=1114111||Pt(t,"expected valid JSON character");else Tte.test(o)&&Pt(t,"the stream contains non-printable characters");t.result+=o}}x(Bo,"captureSegment");function f5(t,e,r,n){var i,a,s,o;for(On.isObject(r)||Pt(t,"cannot merge mappings; the provided source object is unacceptable"),i=Object.keys(r),s=0,o=i.length;s<o;s+=1)a=i[s],Ml.call(e,a)||(e[a]=r[a],n[a]=!0)}x(f5,"mergeMappings");function Wc(t,e,r,n,i,a,s,o,l){var u,h;if(Array.isArray(i))for(i=Array.prototype.slice.call(i),u=0,h=i.length;u<h;u+=1)Array.isArray(i[u])&&Pt(t,"nested arrays are not supported inside keys"),typeof i=="object"&&h5(i[u])==="[object Object]"&&(i[u]="[object Object]");if(typeof i=="object"&&h5(i)==="[object Object]"&&(i="[object Object]"),i=String(i),e===null&&(e={}),n==="tag:yaml.org,2002:merge")if(Array.isArray(a))for(u=0,h=a.length;u<h;u+=1)f5(t,e,a[u],r);else f5(t,e,a,r);else!t.json&&!Ml.call(r,i)&&Ml.call(e,i)&&(t.line=s||t.line,t.lineStart=o||t.lineStart,t.position=l||t.position,Pt(t,"duplicated mapping key")),i==="__proto__"?Object.defineProperty(e,i,{configurable:!0,enumerable:!0,writable:!0,value:a}):e[i]=a,delete r[i];return e}x(Wc,"storeMappingPair");function Yy(t){var e;e=t.input.charCodeAt(t.position),e===10?t.position++:e===13?(t.position++,t.input.charCodeAt(t.position)===10&&t.position++):Pt(t,"a line break is expected"),t.line+=1,t.lineStart=t.position,t.firstTabInLine=-1}x(Yy,"readLineBreak");function vn(t,e,r){for(var n=0,i=t.input.charCodeAt(t.position);i!==0;){for(;_l(i);)i===9&&t.firstTabInLine===-1&&(t.firstTabInLine=t.position),i=t.input.charCodeAt(++t.position);if(e&&i===35)do i=t.input.charCodeAt(++t.position);while(i!==10&&i!==13&&i!==0);if(ps(i))for(Yy(t),i=t.input.charCodeAt(t.position),n++,t.lineIndent=0;i===32;)t.lineIndent++,i=t.input.charCodeAt(++t.position);else break}return r!==-1&&n!==0&&t.lineIndent<r&&G0(t,"deficient indentation"),n}x(vn,"skipSeparationSpace");function Dp(t){var e=t.position,r;return r=t.input.charCodeAt(e),!!((r===45||r===46)&&r===t.input.charCodeAt(e+1)&&r===t.input.charCodeAt(e+2)&&(e+=3,r=t.input.charCodeAt(e),r===0||Fi(r)))}x(Dp,"testDocumentSeparator");function Xy(t,e){e===1?t.result+=" ":e>1&&(t.result+=On.repeat(`
`,e-1))}x(Xy,"writeFoldedLines");function jM(t,e,r){var n,i,a,s,o,l,u,h,d=t.kind,f=t.result,p;if(p=t.input.charCodeAt(t.position),Fi(p)||Uc(p)||p===35||p===38||p===42||p===33||p===124||p===62||p===39||p===34||p===37||p===64||p===96||(p===63||p===45)&&(i=t.input.charCodeAt(t.position+1),Fi(i)||r&&Uc(i)))return!1;for(t.kind="scalar",t.result="",a=s=t.position,o=!1;p!==0;){if(p===58){if(i=t.input.charCodeAt(t.position+1),Fi(i)||r&&Uc(i))break}else if(p===35){if(n=t.input.charCodeAt(t.position-1),Fi(n))break}else{if(t.position===t.lineStart&&Dp(t)||r&&Uc(p))break;if(ps(p))if(l=t.line,u=t.lineStart,h=t.lineIndent,vn(t,!1,-1),t.lineIndent>=e){o=!0,p=t.input.charCodeAt(t.position);continue}else{t.position=s,t.line=l,t.lineStart=u,t.lineIndent=h;break}}o&&(Bo(t,a,s,!1),Xy(t,t.line-l),a=s=t.position,o=!1),_l(p)||(s=t.position+1),p=t.input.charCodeAt(++t.position)}return Bo(t,a,s,!1),t.result?!0:(t.kind=d,t.result=f,!1)}x(jM,"readPlainScalar");function KM(t,e){var r,n,i;if(r=t.input.charCodeAt(t.position),r!==39)return!1;for(t.kind="scalar",t.result="",t.position++,n=i=t.position;(r=t.input.charCodeAt(t.position))!==0;)if(r===39)if(Bo(t,n,t.position,!0),r=t.input.charCodeAt(++t.position),r===39)n=t.position,t.position++,i=t.position;else return!0;else ps(r)?(Bo(t,n,i,!0),Xy(t,vn(t,!1,e)),n=i=t.position):t.position===t.lineStart&&Dp(t)?Pt(t,"unexpected end of the document within a single quoted scalar"):(t.position++,i=t.position);Pt(t,"unexpected end of the stream within a single quoted scalar")}x(KM,"readSingleQuotedScalar");function ZM(t,e){var r,n,i,a,s,o;if(o=t.input.charCodeAt(t.position),o!==34)return!1;for(t.kind="scalar",t.result="",t.position++,r=n=t.position;(o=t.input.charCodeAt(t.position))!==0;){if(o===34)return Bo(t,r,t.position,!0),t.position++,!0;if(o===92){if(Bo(t,r,t.position,!0),o=t.input.charCodeAt(++t.position),ps(o))vn(t,!1,e);else if(o<256&&qM[o])t.result+=YM[o],t.position++;else if((s=UM(o))>0){for(i=s,a=0;i>0;i--)o=t.input.charCodeAt(++t.position),(s=GM(o))>=0?a=(a<<4)+s:Pt(t,"expected hexadecimal character");t.result+=HM(a),t.position++}else Pt(t,"unknown escape sequence");r=n=t.position}else ps(o)?(Bo(t,r,n,!0),Xy(t,vn(t,!1,e)),r=n=t.position):t.position===t.lineStart&&Dp(t)?Pt(t,"unexpected end of the document within a double quoted scalar"):(t.position++,n=t.position)}Pt(t,"unexpected end of the stream within a double quoted scalar")}x(ZM,"readDoubleQuotedScalar");function QM(t,e){var r=!0,n,i,a,s=t.tag,o,l=t.anchor,u,h,d,f,p,g=Object.create(null),m,v,y,b;if(b=t.input.charCodeAt(t.position),b===91)h=93,p=!1,o=[];else if(b===123)h=125,p=!0,o={};else return!1;for(t.anchor!==null&&(t.anchorMap[t.anchor]=o),b=t.input.charCodeAt(++t.position);b!==0;){if(vn(t,!0,e),b=t.input.charCodeAt(t.position),b===h)return t.position++,t.tag=s,t.anchor=l,t.kind=p?"mapping":"sequence",t.result=o,!0;r?b===44&&Pt(t,"expected the node content, but found ','"):Pt(t,"missed comma between flow collection entries"),v=m=y=null,d=f=!1,b===63&&(u=t.input.charCodeAt(t.position+1),Fi(u)&&(d=f=!0,t.position++,vn(t,!0,e))),n=t.line,i=t.lineStart,a=t.position,su(t,e,nv,!1,!0),v=t.tag,m=t.result,vn(t,!0,e),b=t.input.charCodeAt(t.position),(f||t.line===n)&&b===58&&(d=!0,b=t.input.charCodeAt(++t.position),vn(t,!0,e),su(t,e,nv,!1,!0),y=t.result),p?Wc(t,o,g,v,m,y,n,i,a):d?o.push(Wc(t,null,g,v,m,y,n,i,a)):o.push(m),vn(t,!0,e),b=t.input.charCodeAt(t.position),b===44?(r=!0,b=t.input.charCodeAt(++t.position)):r=!1}Pt(t,"unexpected end of the stream within a flow collection")}x(QM,"readFlowCollection");function JM(t,e){var r,n,i=Wx,a=!1,s=!1,o=e,l=0,u=!1,h,d;if(d=t.input.charCodeAt(t.position),d===124)n=!1;else if(d===62)n=!0;else return!1;for(t.kind="scalar",t.result="";d!==0;)if(d=t.input.charCodeAt(++t.position),d===43||d===45)Wx===i?i=d===43?_7:wte:Pt(t,"repeat of a chomping mode identifier");else if((h=WM(d))>=0)h===0?Pt(t,"bad explicit indentation width of a block scalar; it cannot be less than one"):s?Pt(t,"repeat of an indentation width identifier"):(o=e+h-1,s=!0);else break;if(_l(d)){do d=t.input.charCodeAt(++t.position);while(_l(d));if(d===35)do d=t.input.charCodeAt(++t.position);while(!ps(d)&&d!==0)}for(;d!==0;){for(Yy(t),t.lineIndent=0,d=t.input.charCodeAt(t.position);(!s||t.lineIndent<o)&&d===32;)t.lineIndent++,d=t.input.charCodeAt(++t.position);if(!s&&t.lineIndent>o&&(o=t.lineIndent),ps(d)){l++;continue}if(t.lineIndent<o){i===_7?t.result+=On.repeat(`
`,a?1+l:l):i===Wx&&a&&(t.result+=`
`);break}for(n?_l(d)?(u=!0,t.result+=On.repeat(`
`,a?1+l:l)):u?(u=!1,t.result+=On.repeat(`
`,l+1)):l===0?a&&(t.result+=" "):t.result+=On.repeat(`
`,l):t.result+=On.repeat(`
`,a?1+l:l),a=!0,s=!0,l=0,r=t.position;!ps(d)&&d!==0;)d=t.input.charCodeAt(++t.position);Bo(t,r,t.position,!1)}return!0}x(JM,"readBlockScalar");function p5(t,e){var r,n=t.tag,i=t.anchor,a=[],s,o=!1,l;if(t.firstTabInLine!==-1)return!1;for(t.anchor!==null&&(t.anchorMap[t.anchor]=a),l=t.input.charCodeAt(t.position);l!==0&&(t.firstTabInLine!==-1&&(t.position=t.firstTabInLine,Pt(t,"tab characters must not be used in indentation")),!(l!==45||(s=t.input.charCodeAt(t.position+1),!Fi(s))));){if(o=!0,t.position++,vn(t,!0,-1)&&t.lineIndent<=e){a.push(null),l=t.input.charCodeAt(t.position);continue}if(r=t.line,su(t,e,$M,!1,!0),a.push(t.result),vn(t,!0,-1),l=t.input.charCodeAt(t.position),(t.line===r||t.lineIndent>e)&&l!==0)Pt(t,"bad indentation of a sequence entry");else if(t.lineIndent<e)break}return o?(t.tag=n,t.anchor=i,t.kind="sequence",t.result=a,!0):!1}x(p5,"readBlockSequence");function eI(t,e,r){var n,i,a,s,o,l,u=t.tag,h=t.anchor,d={},f=Object.create(null),p=null,g=null,m=null,v=!1,y=!1,b;if(t.firstTabInLine!==-1)return!1;for(t.anchor!==null&&(t.anchorMap[t.anchor]=d),b=t.input.charCodeAt(t.position);b!==0;){if(!v&&t.firstTabInLine!==-1&&(t.position=t.firstTabInLine,Pt(t,"tab characters must not be used in indentation")),n=t.input.charCodeAt(t.position+1),a=t.line,(b===63||b===58)&&Fi(n))b===63?(v&&(Wc(t,d,f,p,g,null,s,o,l),p=g=m=null),y=!0,v=!0,i=!0):v?(v=!1,i=!0):Pt(t,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),t.position+=1,b=n;else{if(s=t.line,o=t.lineStart,l=t.position,!su(t,r,FM,!1,!0))break;if(t.line===a){for(b=t.input.charCodeAt(t.position);_l(b);)b=t.input.charCodeAt(++t.position);if(b===58)b=t.input.charCodeAt(++t.position),Fi(b)||Pt(t,"a whitespace character is expected after the key-value separator within a block mapping"),v&&(Wc(t,d,f,p,g,null,s,o,l),p=g=m=null),y=!0,v=!1,i=!1,p=t.tag,g=t.result;else if(y)Pt(t,"can not read an implicit mapping pair; a colon is missed");else return t.tag=u,t.anchor=h,!0}else if(y)Pt(t,"can not read a block mapping entry; a multiline key may not be an implicit key");else return t.tag=u,t.anchor=h,!0}if((t.line===a||t.lineIndent>e)&&(v&&(s=t.line,o=t.lineStart,l=t.position),su(t,e,iv,!0,i)&&(v?g=t.result:m=t.result),v||(Wc(t,d,f,p,g,m,s,o,l),p=g=m=null),vn(t,!0,-1),b=t.input.charCodeAt(t.position)),(t.line===a||t.lineIndent>e)&&b!==0)Pt(t,"bad indentation of a mapping entry");else if(t.lineIndent<e)break}return v&&Wc(t,d,f,p,g,null,s,o,l),y&&(t.tag=u,t.anchor=h,t.kind="mapping",t.result=d),y}x(eI,"readBlockMapping");function tI(t){var e,r=!1,n=!1,i,a,s;if(s=t.input.charCodeAt(t.position),s!==33)return!1;if(t.tag!==null&&Pt(t,"duplication of a tag property"),s=t.input.charCodeAt(++t.position),s===60?(r=!0,s=t.input.charCodeAt(++t.position)):s===33?(n=!0,i="!!",s=t.input.charCodeAt(++t.position)):i="!",e=t.position,r){do s=t.input.charCodeAt(++t.position);while(s!==0&&s!==62);t.position<t.length?(a=t.input.slice(e,t.position),s=t.input.charCodeAt(++t.position)):Pt(t,"unexpected end of the stream within a verbatim tag")}else{for(;s!==0&&!Fi(s);)s===33&&(n?Pt(t,"tag suffix cannot contain exclamation marks"):(i=t.input.slice(e-1,t.position+1),zM.test(i)||Pt(t,"named tag handle cannot contain such characters"),n=!0,e=t.position+1)),s=t.input.charCodeAt(++t.position);a=t.input.slice(e,t.position),kte.test(a)&&Pt(t,"tag suffix cannot contain flow indicator characters")}a&&!VM.test(a)&&Pt(t,"tag name cannot contain such characters: "+a);try{a=decodeURIComponent(a)}catch{Pt(t,"tag name is malformed: "+a)}return r?t.tag=a:Ml.call(t.tagMap,i)?t.tag=t.tagMap[i]+a:i==="!"?t.tag="!"+a:i==="!!"?t.tag="tag:yaml.org,2002:"+a:Pt(t,'undeclared tag handle "'+i+'"'),!0}x(tI,"readTagProperty");function rI(t){var e,r;if(r=t.input.charCodeAt(t.position),r!==38)return!1;for(t.anchor!==null&&Pt(t,"duplication of an anchor property"),r=t.input.charCodeAt(++t.position),e=t.position;r!==0&&!Fi(r)&&!Uc(r);)r=t.input.charCodeAt(++t.position);return t.position===e&&Pt(t,"name of an anchor node must contain at least one character"),t.anchor=t.input.slice(e,t.position),!0}x(rI,"readAnchorProperty");function nI(t){var e,r,n;if(n=t.input.charCodeAt(t.position),n!==42)return!1;for(n=t.input.charCodeAt(++t.position),e=t.position;n!==0&&!Fi(n)&&!Uc(n);)n=t.input.charCodeAt(++t.position);return t.position===e&&Pt(t,"name of an alias node must contain at least one character"),r=t.input.slice(e,t.position),Ml.call(t.anchorMap,r)||Pt(t,'unidentified alias "'+r+'"'),t.result=t.anchorMap[r],vn(t,!0,-1),!0}x(nI,"readAlias");function su(t,e,r,n,i){var a,s,o,l=1,u=!1,h=!1,d,f,p,g,m,v;if(t.listener!==null&&t.listener("open",t),t.tag=null,t.anchor=null,t.kind=null,t.result=null,a=s=o=iv===r||$M===r,n&&vn(t,!0,-1)&&(u=!0,t.lineIndent>e?l=1:t.lineIndent===e?l=0:t.lineIndent<e&&(l=-1)),l===1)for(;tI(t)||rI(t);)vn(t,!0,-1)?(u=!0,o=a,t.lineIndent>e?l=1:t.lineIndent===e?l=0:t.lineIndent<e&&(l=-1)):o=!1;if(o&&(o=u||i),(l===1||iv===r)&&(nv===r||FM===r?m=e:m=e+1,v=t.position-t.lineStart,l===1?o&&(p5(t,v)||eI(t,v,m))||QM(t,m)?h=!0:(s&&JM(t,m)||KM(t,m)||ZM(t,m)?h=!0:nI(t)?(h=!0,(t.tag!==null||t.anchor!==null)&&Pt(t,"alias node should not have any properties")):jM(t,m,nv===r)&&(h=!0,t.tag===null&&(t.tag="?")),t.anchor!==null&&(t.anchorMap[t.anchor]=t.result)):l===0&&(h=o&&p5(t,v))),t.tag===null)t.anchor!==null&&(t.anchorMap[t.anchor]=t.result);else if(t.tag==="?"){for(t.result!==null&&t.kind!=="scalar"&&Pt(t,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+t.kind+'"'),d=0,f=t.implicitTypes.length;d<f;d+=1)if(g=t.implicitTypes[d],g.resolve(t.result)){t.result=g.construct(t.result),t.tag=g.tag,t.anchor!==null&&(t.anchorMap[t.anchor]=t.result);break}}else if(t.tag!=="!"){if(Ml.call(t.typeMap[t.kind||"fallback"],t.tag))g=t.typeMap[t.kind||"fallback"][t.tag];else for(g=null,p=t.typeMap.multi[t.kind||"fallback"],d=0,f=p.length;d<f;d+=1)if(t.tag.slice(0,p[d].tag.length)===p[d].tag){g=p[d];break}g||Pt(t,"unknown tag !<"+t.tag+">"),t.result!==null&&g.kind!==t.kind&&Pt(t,"unacceptable node kind for !<"+t.tag+'> tag; it should be "'+g.kind+'", not "'+t.kind+'"'),g.resolve(t.result,t.tag)?(t.result=g.construct(t.result,t.tag),t.anchor!==null&&(t.anchorMap[t.anchor]=t.result)):Pt(t,"cannot resolve a node with !<"+t.tag+"> explicit tag")}return t.listener!==null&&t.listener("close",t),t.tag!==null||t.anchor!==null||h}x(su,"composeNode");function iI(t){var e=t.position,r,n,i,a=!1,s;for(t.version=null,t.checkLineBreaks=t.legacy,t.tagMap=Object.create(null),t.anchorMap=Object.create(null);(s=t.input.charCodeAt(t.position))!==0&&(vn(t,!0,-1),s=t.input.charCodeAt(t.position),!(t.lineIndent>0||s!==37));){for(a=!0,s=t.input.charCodeAt(++t.position),r=t.position;s!==0&&!Fi(s);)s=t.input.charCodeAt(++t.position);for(n=t.input.slice(r,t.position),i=[],n.length<1&&Pt(t,"directive name must not be less than one character in length");s!==0;){for(;_l(s);)s=t.input.charCodeAt(++t.position);if(s===35){do s=t.input.charCodeAt(++t.position);while(s!==0&&!ps(s));break}if(ps(s))break;for(r=t.position;s!==0&&!Fi(s);)s=t.input.charCodeAt(++t.position);i.push(t.input.slice(r,t.position))}s!==0&&Yy(t),Ml.call(L7,n)?L7[n](t,n,i):G0(t,'unknown document directive "'+n+'"')}if(vn(t,!0,-1),t.lineIndent===0&&t.input.charCodeAt(t.position)===45&&t.input.charCodeAt(t.position+1)===45&&t.input.charCodeAt(t.position+2)===45?(t.position+=3,vn(t,!0,-1)):a&&Pt(t,"directives end mark is expected"),su(t,t.lineIndent-1,iv,!1,!0),vn(t,!0,-1),t.checkLineBreaks&&Ete.test(t.input.slice(e,t.position))&&G0(t,"non-ASCII line breaks are interpreted as content"),t.documents.push(t.result),t.position===t.lineStart&&Dp(t)){t.input.charCodeAt(t.position)===46&&(t.position+=3,vn(t,!0,-1));return}if(t.position<t.length-1)Pt(t,"end of the stream or a document separator is expected");else return}x(iI,"readDocument");function w6(t,e){t=String(t),e=e||{},t.length!==0&&(t.charCodeAt(t.length-1)!==10&&t.charCodeAt(t.length-1)!==13&&(t+=`
`),t.charCodeAt(0)===65279&&(t=t.slice(1)));var r=new XM(t,e),n=t.indexOf("\0");for(n!==-1&&(r.position=n,Pt(r,"null byte is not allowed in input")),r.input+="\0";r.input.charCodeAt(r.position)===32;)r.lineIndent+=1,r.position+=1;for(;r.position<r.length-1;)iI(r);return r.documents}x(w6,"loadDocuments");function Ste(t,e,r){e!==null&&typeof e=="object"&&typeof r>"u"&&(r=e,e=null);var n=w6(t,r);if(typeof e!="function")return n;for(var i=0,a=n.length;i<a;i+=1)e(n[i])}x(Ste,"loadAll$1");function aI(t,e){var r=w6(t,e);if(r.length!==0){if(r.length===1)return r[0];throw new sa("expected a single document in the stream, but found more")}}x(aI,"load$1");var Cte=aI,Ate={load:Cte},sI=Object.prototype.toString,oI=Object.prototype.hasOwnProperty,T6=65279,_te=9,U0=10,Lte=13,Rte=32,Nte=33,Dte=34,g5=35,Mte=37,Ite=38,Ote=39,Pte=42,lI=44,Bte=45,av=58,Fte=61,$te=62,zte=63,Vte=64,cI=91,uI=93,Gte=96,hI=123,Ute=124,dI=125,Li={};Li[0]="\\0";Li[7]="\\a";Li[8]="\\b";Li[9]="\\t";Li[10]="\\n";Li[11]="\\v";Li[12]="\\f";Li[13]="\\r";Li[27]="\\e";Li[34]='\\"';Li[92]="\\\\";Li[133]="\\N";Li[160]="\\_";Li[8232]="\\L";Li[8233]="\\P";var Wte=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],Hte=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function fI(t,e){var r,n,i,a,s,o,l;if(e===null)return{};for(r={},n=Object.keys(e),i=0,a=n.length;i<a;i+=1)s=n[i],o=String(e[s]),s.slice(0,2)==="!!"&&(s="tag:yaml.org,2002:"+s.slice(2)),l=t.compiledTypeMap.fallback[s],l&&oI.call(l.styleAliases,o)&&(o=l.styleAliases[o]),r[s]=o;return r}x(fI,"compileStyleMap");function pI(t){var e,r,n;if(e=t.toString(16).toUpperCase(),t<=255)r="x",n=2;else if(t<=65535)r="u",n=4;else if(t<=4294967295)r="U",n=8;else throw new sa("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+r+On.repeat("0",n-e.length)+e}x(pI,"encodeHex");var qte=1,W0=2;function gI(t){this.schema=t.schema||BM,this.indent=Math.max(1,t.indent||2),this.noArrayIndent=t.noArrayIndent||!1,this.skipInvalid=t.skipInvalid||!1,this.flowLevel=On.isNothing(t.flowLevel)?-1:t.flowLevel,this.styleMap=fI(this.schema,t.styles||null),this.sortKeys=t.sortKeys||!1,this.lineWidth=t.lineWidth||80,this.noRefs=t.noRefs||!1,this.noCompatMode=t.noCompatMode||!1,this.condenseFlow=t.condenseFlow||!1,this.quotingType=t.quotingType==='"'?W0:qte,this.forceQuotes=t.forceQuotes||!1,this.replacer=typeof t.replacer=="function"?t.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}x(gI,"State");function m5(t,e){for(var r=On.repeat(" ",e),n=0,i=-1,a="",s,o=t.length;n<o;)i=t.indexOf(`
`,n),i===-1?(s=t.slice(n),n=o):(s=t.slice(n,i+1),n=i+1),s.length&&s!==`
`&&(a+=r),a+=s;return a}x(m5,"indentString");function sv(t,e){return`
`+On.repeat(" ",t.indent*e)}x(sv,"generateNextLine");function mI(t,e){var r,n,i;for(r=0,n=t.implicitTypes.length;r<n;r+=1)if(i=t.implicitTypes[r],i.resolve(e))return!0;return!1}x(mI,"testImplicitResolving");function H0(t){return t===Rte||t===_te}x(H0,"isWhitespace");function Kh(t){return 32<=t&&t<=126||161<=t&&t<=55295&&t!==8232&&t!==8233||57344<=t&&t<=65533&&t!==T6||65536<=t&&t<=1114111}x(Kh,"isPrintable");function v5(t){return Kh(t)&&t!==T6&&t!==Lte&&t!==U0}x(v5,"isNsCharOrWhitespace");function y5(t,e,r){var n=v5(t),i=n&&!H0(t);return(r?n:n&&t!==lI&&t!==cI&&t!==uI&&t!==hI&&t!==dI)&&t!==g5&&!(e===av&&!i)||v5(e)&&!H0(e)&&t===g5||e===av&&i}x(y5,"isPlainSafe");function vI(t){return Kh(t)&&t!==T6&&!H0(t)&&t!==Bte&&t!==zte&&t!==av&&t!==lI&&t!==cI&&t!==uI&&t!==hI&&t!==dI&&t!==g5&&t!==Ite&&t!==Pte&&t!==Nte&&t!==Ute&&t!==Fte&&t!==$te&&t!==Ote&&t!==Dte&&t!==Mte&&t!==Vte&&t!==Gte}x(vI,"isPlainSafeFirst");function yI(t){return!H0(t)&&t!==av}x(yI,"isPlainSafeLast");function vh(t,e){var r=t.charCodeAt(e),n;return r>=55296&&r<=56319&&e+1<t.length&&(n=t.charCodeAt(e+1),n>=56320&&n<=57343)?(r-55296)*1024+n-56320+65536:r}x(vh,"codePointAt");function E6(t){var e=/^\n* /;return e.test(t)}x(E6,"needIndentIndicator");var xI=1,x5=2,bI=3,wI=4,lh=5;function TI(t,e,r,n,i,a,s,o){var l,u=0,h=null,d=!1,f=!1,p=n!==-1,g=-1,m=vI(vh(t,0))&&yI(vh(t,t.length-1));if(e||s)for(l=0;l<t.length;u>=65536?l+=2:l++){if(u=vh(t,l),!Kh(u))return lh;m=m&&y5(u,h,o),h=u}else{for(l=0;l<t.length;u>=65536?l+=2:l++){if(u=vh(t,l),u===U0)d=!0,p&&(f=f||l-g-1>n&&t[g+1]!==" ",g=l);else if(!Kh(u))return lh;m=m&&y5(u,h,o),h=u}f=f||p&&l-g-1>n&&t[g+1]!==" "}return!d&&!f?m&&!s&&!i(t)?xI:a===W0?lh:x5:r>9&&E6(t)?lh:s?a===W0?lh:x5:f?wI:bI}x(TI,"chooseScalarStyle");function EI(t,e,r,n,i){t.dump=function(){if(e.length===0)return t.quotingType===W0?'""':"''";if(!t.noCompatMode&&(Wte.indexOf(e)!==-1||Hte.test(e)))return t.quotingType===W0?'"'+e+'"':"'"+e+"'";var a=t.indent*Math.max(1,r),s=t.lineWidth===-1?-1:Math.max(Math.min(t.lineWidth,40),t.lineWidth-a),o=n||t.flowLevel>-1&&r>=t.flowLevel;function l(u){return mI(t,u)}switch(x(l,"testAmbiguity"),TI(e,o,t.indent,s,l,t.quotingType,t.forceQuotes&&!n,i)){case xI:return e;case x5:return"'"+e.replace(/'/g,"''")+"'";case bI:return"|"+b5(e,t.indent)+w5(m5(e,a));case wI:return">"+b5(e,t.indent)+w5(m5(kI(e,s),a));case lh:return'"'+SI(e)+'"';default:throw new sa("impossible error: invalid scalar style")}}()}x(EI,"writeScalar");function b5(t,e){var r=E6(t)?String(e):"",n=t[t.length-1]===`
`,i=n&&(t[t.length-2]===`
`||t===`
`),a=i?"+":n?"":"-";return r+a+`
`}x(b5,"blockHeader");function w5(t){return t[t.length-1]===`
`?t.slice(0,-1):t}x(w5,"dropEndingNewline");function kI(t,e){for(var r=/(\n+)([^\n]*)/g,n=function(){var u=t.indexOf(`
`);return u=u!==-1?u:t.length,r.lastIndex=u,T5(t.slice(0,u),e)}(),i=t[0]===`
`||t[0]===" ",a,s;s=r.exec(t);){var o=s[1],l=s[2];a=l[0]===" ",n+=o+(!i&&!a&&l!==""?`
`:"")+T5(l,e),i=a}return n}x(kI,"foldString");function T5(t,e){if(t===""||t[0]===" ")return t;for(var r=/ [^ ]/g,n,i=0,a,s=0,o=0,l="";n=r.exec(t);)o=n.index,o-i>e&&(a=s>i?s:o,l+=`
`+t.slice(i,a),i=a+1),s=o;return l+=`
`,t.length-i>e&&s>i?l+=t.slice(i,s)+`
`+t.slice(s+1):l+=t.slice(i),l.slice(1)}x(T5,"foldLine");function SI(t){for(var e="",r=0,n,i=0;i<t.length;r>=65536?i+=2:i++)r=vh(t,i),n=Li[r],!n&&Kh(r)?(e+=t[i],r>=65536&&(e+=t[i+1])):e+=n||pI(r);return e}x(SI,"escapeString");function CI(t,e,r){var n="",i=t.tag,a,s,o;for(a=0,s=r.length;a<s;a+=1)o=r[a],t.replacer&&(o=t.replacer.call(r,String(a),o)),(js(t,e,o,!1,!1)||typeof o>"u"&&js(t,e,null,!1,!1))&&(n!==""&&(n+=","+(t.condenseFlow?"":" ")),n+=t.dump);t.tag=i,t.dump="["+n+"]"}x(CI,"writeFlowSequence");function E5(t,e,r,n){var i="",a=t.tag,s,o,l;for(s=0,o=r.length;s<o;s+=1)l=r[s],t.replacer&&(l=t.replacer.call(r,String(s),l)),(js(t,e+1,l,!0,!0,!1,!0)||typeof l>"u"&&js(t,e+1,null,!0,!0,!1,!0))&&((!n||i!=="")&&(i+=sv(t,e)),t.dump&&U0===t.dump.charCodeAt(0)?i+="-":i+="- ",i+=t.dump);t.tag=a,t.dump=i||"[]"}x(E5,"writeBlockSequence");function AI(t,e,r){var n="",i=t.tag,a=Object.keys(r),s,o,l,u,h;for(s=0,o=a.length;s<o;s+=1)h="",n!==""&&(h+=", "),t.condenseFlow&&(h+='"'),l=a[s],u=r[l],t.replacer&&(u=t.replacer.call(r,l,u)),js(t,e,l,!1,!1)&&(t.dump.length>1024&&(h+="? "),h+=t.dump+(t.condenseFlow?'"':"")+":"+(t.condenseFlow?"":" "),js(t,e,u,!1,!1)&&(h+=t.dump,n+=h));t.tag=i,t.dump="{"+n+"}"}x(AI,"writeFlowMapping");function _I(t,e,r,n){var i="",a=t.tag,s=Object.keys(r),o,l,u,h,d,f;if(t.sortKeys===!0)s.sort();else if(typeof t.sortKeys=="function")s.sort(t.sortKeys);else if(t.sortKeys)throw new sa("sortKeys must be a boolean or a function");for(o=0,l=s.length;o<l;o+=1)f="",(!n||i!=="")&&(f+=sv(t,e)),u=s[o],h=r[u],t.replacer&&(h=t.replacer.call(r,u,h)),js(t,e+1,u,!0,!0,!0)&&(d=t.tag!==null&&t.tag!=="?"||t.dump&&t.dump.length>1024,d&&(t.dump&&U0===t.dump.charCodeAt(0)?f+="?":f+="? "),f+=t.dump,d&&(f+=sv(t,e)),js(t,e+1,h,!0,d)&&(t.dump&&U0===t.dump.charCodeAt(0)?f+=":":f+=": ",f+=t.dump,i+=f));t.tag=a,t.dump=i||"{}"}x(_I,"writeBlockMapping");function k5(t,e,r){var n,i,a,s,o,l;for(i=r?t.explicitTypes:t.implicitTypes,a=0,s=i.length;a<s;a+=1)if(o=i[a],(o.instanceOf||o.predicate)&&(!o.instanceOf||typeof e=="object"&&e instanceof o.instanceOf)&&(!o.predicate||o.predicate(e))){if(r?o.multi&&o.representName?t.tag=o.representName(e):t.tag=o.tag:t.tag="?",o.represent){if(l=t.styleMap[o.tag]||o.defaultStyle,sI.call(o.represent)==="[object Function]")n=o.represent(e,l);else if(oI.call(o.represent,l))n=o.represent[l](e,l);else throw new sa("!<"+o.tag+'> tag resolver accepts not "'+l+'" style');t.dump=n}return!0}return!1}x(k5,"detectType");function js(t,e,r,n,i,a,s){t.tag=null,t.dump=r,k5(t,r,!1)||k5(t,r,!0);var o=sI.call(t.dump),l=n,u;n&&(n=t.flowLevel<0||t.flowLevel>e);var h=o==="[object Object]"||o==="[object Array]",d,f;if(h&&(d=t.duplicates.indexOf(r),f=d!==-1),(t.tag!==null&&t.tag!=="?"||f||t.indent!==2&&e>0)&&(i=!1),f&&t.usedDuplicates[d])t.dump="*ref_"+d;else{if(h&&f&&!t.usedDuplicates[d]&&(t.usedDuplicates[d]=!0),o==="[object Object]")n&&Object.keys(t.dump).length!==0?(_I(t,e,t.dump,i),f&&(t.dump="&ref_"+d+t.dump)):(AI(t,e,t.dump),f&&(t.dump="&ref_"+d+" "+t.dump));else if(o==="[object Array]")n&&t.dump.length!==0?(t.noArrayIndent&&!s&&e>0?E5(t,e-1,t.dump,i):E5(t,e,t.dump,i),f&&(t.dump="&ref_"+d+t.dump)):(CI(t,e,t.dump),f&&(t.dump="&ref_"+d+" "+t.dump));else if(o==="[object String]")t.tag!=="?"&&EI(t,t.dump,e,a,l);else{if(o==="[object Undefined]")return!1;if(t.skipInvalid)return!1;throw new sa("unacceptable kind of an object to dump "+o)}t.tag!==null&&t.tag!=="?"&&(u=encodeURI(t.tag[0]==="!"?t.tag.slice(1):t.tag).replace(/!/g,"%21"),t.tag[0]==="!"?u="!"+u:u.slice(0,18)==="tag:yaml.org,2002:"?u="!!"+u.slice(18):u="!<"+u+">",t.dump=u+" "+t.dump)}return!0}x(js,"writeNode");function LI(t,e){var r=[],n=[],i,a;for(ov(t,r,n),i=0,a=n.length;i<a;i+=1)e.duplicates.push(r[n[i]]);e.usedDuplicates=new Array(a)}x(LI,"getDuplicateReferences");function ov(t,e,r){var n,i,a;if(t!==null&&typeof t=="object")if(i=e.indexOf(t),i!==-1)r.indexOf(i)===-1&&r.push(i);else if(e.push(t),Array.isArray(t))for(i=0,a=t.length;i<a;i+=1)ov(t[i],e,r);else for(n=Object.keys(t),i=0,a=n.length;i<a;i+=1)ov(t[n[i]],e,r)}x(ov,"inspectNode");function Yte(t,e){e=e||{};var r=new gI(e);r.noRefs||LI(t,r);var n=t;return r.replacer&&(n=r.replacer.call({"":n},"",n)),js(r,0,n,!0,!0)?r.dump+`
`:""}x(Yte,"dump$1");function Xte(t,e){return function(){throw new Error("Function yaml."+t+" is removed in js-yaml 4. Use yaml."+e+" instead, which is now safe by default.")}}x(Xte,"renamed");var jy=bM,Ky=Ate.load;/*! Bundled license information:

js-yaml/dist/js-yaml.mjs:
  (*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT *)
*/var yi={aggregation:17.25,extension:17.25,composition:17.25,dependency:6,lollipop:13.5,arrow_point:4},R7={arrow_point:9,arrow_cross:12.5,arrow_circle:12.5};function bf(t,e){if(t===void 0||e===void 0)return{angle:0,deltaX:0,deltaY:0};t=Xr(t),e=Xr(e);const[r,n]=[t.x,t.y],[i,a]=[e.x,e.y],s=i-r,o=a-n;return{angle:Math.atan(o/s),deltaX:s,deltaY:o}}x(bf,"calculateDeltaAndAngle");var Xr=x(t=>Array.isArray(t)?{x:t[0],y:t[1]}:t,"pointTransformer"),RI=x(t=>({x:x(function(e,r,n){let i=0;const a=Xr(n[0]).x<Xr(n[n.length-1]).x?"left":"right";if(r===0&&Object.hasOwn(yi,t.arrowTypeStart)){const{angle:p,deltaX:g}=bf(n[0],n[1]);i=yi[t.arrowTypeStart]*Math.cos(p)*(g>=0?1:-1)}else if(r===n.length-1&&Object.hasOwn(yi,t.arrowTypeEnd)){const{angle:p,deltaX:g}=bf(n[n.length-1],n[n.length-2]);i=yi[t.arrowTypeEnd]*Math.cos(p)*(g>=0?1:-1)}const s=Math.abs(Xr(e).x-Xr(n[n.length-1]).x),o=Math.abs(Xr(e).y-Xr(n[n.length-1]).y),l=Math.abs(Xr(e).x-Xr(n[0]).x),u=Math.abs(Xr(e).y-Xr(n[0]).y),h=yi[t.arrowTypeStart],d=yi[t.arrowTypeEnd],f=1;if(s<d&&s>0&&o<d){let p=d+f-s;p*=a==="right"?-1:1,i-=p}if(l<h&&l>0&&u<h){let p=h+f-l;p*=a==="right"?-1:1,i+=p}return Xr(e).x+i},"x"),y:x(function(e,r,n){let i=0;const a=Xr(n[0]).y<Xr(n[n.length-1]).y?"down":"up";if(r===0&&Object.hasOwn(yi,t.arrowTypeStart)){const{angle:p,deltaY:g}=bf(n[0],n[1]);i=yi[t.arrowTypeStart]*Math.abs(Math.sin(p))*(g>=0?1:-1)}else if(r===n.length-1&&Object.hasOwn(yi,t.arrowTypeEnd)){const{angle:p,deltaY:g}=bf(n[n.length-1],n[n.length-2]);i=yi[t.arrowTypeEnd]*Math.abs(Math.sin(p))*(g>=0?1:-1)}const s=Math.abs(Xr(e).y-Xr(n[n.length-1]).y),o=Math.abs(Xr(e).x-Xr(n[n.length-1]).x),l=Math.abs(Xr(e).y-Xr(n[0]).y),u=Math.abs(Xr(e).x-Xr(n[0]).x),h=yi[t.arrowTypeStart],d=yi[t.arrowTypeEnd],f=1;if(s<d&&s>0&&o<d){let p=d+f-s;p*=a==="up"?-1:1,i-=p}if(l<h&&l>0&&u<h){let p=h+f-l;p*=a==="up"?-1:1,i+=p}return Xr(e).y+i},"y")}),"getLineFunctionsWithOffset"),Mp=x(({flowchart:t})=>{const e=t?.subGraphTitleMargin?.top??0,r=t?.subGraphTitleMargin?.bottom??0,n=e+r;return{subGraphTitleTopMargin:e,subGraphTitleBottomMargin:r,subGraphTitleTotalMargin:n}},"getSubGraphTitleMargins"),jte=x(t=>{const{handDrawnSeed:e}=we();return{fill:t,hachureAngle:120,hachureGap:4,fillWeight:2,roughness:.7,stroke:t,seed:e}},"solidStateFill"),bd=x(t=>{const e=Kte([...t.cssCompiledStyles||[],...t.cssStyles||[],...t.labelStyle||[]]);return{stylesMap:e,stylesArray:[...e]}},"compileStyles"),Kte=x(t=>{const e=new Map;return t.forEach(r=>{const[n,i]=r.split(":");e.set(n.trim(),i?.trim())}),e},"styles2Map"),k6=x(t=>t==="color"||t==="font-size"||t==="font-family"||t==="font-weight"||t==="font-style"||t==="text-decoration"||t==="text-align"||t==="text-transform"||t==="line-height"||t==="letter-spacing"||t==="word-spacing"||t==="text-shadow"||t==="text-overflow"||t==="white-space"||t==="word-wrap"||t==="word-break"||t==="overflow-wrap"||t==="hyphens","isLabelStyle"),Ct=x(t=>{const{stylesArray:e}=bd(t),r=[],n=[],i=[],a=[];return e.forEach(s=>{const o=s[0];k6(o)?r.push(s.join(":")+" !important"):(n.push(s.join(":")+" !important"),o.includes("stroke")&&i.push(s.join(":")+" !important"),o==="fill"&&a.push(s.join(":")+" !important"))}),{labelStyles:r.join(";"),nodeStyles:n.join(";"),stylesArray:e,borderStyles:i,backgroundStyles:a}},"styles2String"),Nt=x((t,e)=>{const{themeVariables:r,handDrawnSeed:n}=we(),{nodeBorder:i,mainBkg:a}=r,{stylesMap:s}=bd(t);return Object.assign({roughness:.7,fill:s.get("fill")||a,fillStyle:"hachure",fillWeight:4,hachureGap:5.2,stroke:s.get("stroke")||i,seed:n,strokeWidth:s.get("stroke-width")?.replace("px","")||1.3,fillLineDash:[0,0],strokeLineDash:Zte(s.get("stroke-dasharray"))},e)},"userNodeOverrides"),Zte=x(t=>{if(!t)return[0,0];const e=t.trim().split(/\s+/).map(Number);if(e.length===1){const i=isNaN(e[0])?0:e[0];return[i,i]}const r=isNaN(e[0])?0:e[0],n=isNaN(e[1])?0:e[1];return[r,n]},"getStrokeDashArray"),S6={},Yn={};Object.defineProperty(Yn,"__esModule",{value:!0});Yn.BLANK_URL=Yn.relativeFirstCharacters=Yn.whitespaceEscapeCharsRegex=Yn.urlSchemeRegex=Yn.ctrlCharactersRegex=Yn.htmlCtrlEntityRegex=Yn.htmlEntitiesRegex=Yn.invalidProtocolRegex=void 0;Yn.invalidProtocolRegex=/^([^\w]*)(javascript|data|vbscript)/im;Yn.htmlEntitiesRegex=/&#(\w+)(^\w|;)?/g;Yn.htmlCtrlEntityRegex=/&(newline|tab);/gi;Yn.ctrlCharactersRegex=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim;Yn.urlSchemeRegex=/^.+(:|&colon;)/gim;Yn.whitespaceEscapeCharsRegex=/(\\|%5[cC])((%(6[eE]|72|74))|[nrt])/g;Yn.relativeFirstCharacters=[".","/"];Yn.BLANK_URL="about:blank";Object.defineProperty(S6,"__esModule",{value:!0});var tc=S6.sanitizeUrl=void 0,vi=Yn;function Qte(t){return vi.relativeFirstCharacters.indexOf(t[0])>-1}function Jte(t){var e=t.replace(vi.ctrlCharactersRegex,"");return e.replace(vi.htmlEntitiesRegex,function(r,n){return String.fromCharCode(n)})}function ere(t){return URL.canParse(t)}function N7(t){try{return decodeURIComponent(t)}catch{return t}}function tre(t){if(!t)return vi.BLANK_URL;var e,r=N7(t.trim());do r=Jte(r).replace(vi.htmlCtrlEntityRegex,"").replace(vi.ctrlCharactersRegex,"").replace(vi.whitespaceEscapeCharsRegex,"").trim(),r=N7(r),e=r.match(vi.ctrlCharactersRegex)||r.match(vi.htmlEntitiesRegex)||r.match(vi.htmlCtrlEntityRegex)||r.match(vi.whitespaceEscapeCharsRegex);while(e&&e.length>0);var n=r;if(!n)return vi.BLANK_URL;if(Qte(n))return n;var i=n.trimStart(),a=i.match(vi.urlSchemeRegex);if(!a)return n;var s=a[0].toLowerCase().trim();if(vi.invalidProtocolRegex.test(s))return vi.BLANK_URL;var o=i.replace(/\\/g,"/");if(s==="mailto:"||s.includes("://"))return o;if(s==="http:"||s==="https:"){if(!ere(o))return vi.BLANK_URL;var l=new URL(o);return l.protocol=l.protocol.toLowerCase(),l.hostname=l.hostname.toLowerCase(),l.toString()}return o}tc=S6.sanitizeUrl=tre;var NI=typeof global=="object"&&global&&global.Object===Object&&global,rre=typeof self=="object"&&self&&self.Object===Object&&self,no=NI||rre||Function("return this")(),Za=no.Symbol,DI=Object.prototype,nre=DI.hasOwnProperty,ire=DI.toString,Qd=Za?Za.toStringTag:void 0;function are(t){var e=nre.call(t,Qd),r=t[Qd];try{t[Qd]=void 0;var n=!0}catch{}var i=ire.call(t);return n&&(e?t[Qd]=r:delete t[Qd]),i}var sre=Object.prototype,ore=sre.toString;function lre(t){return ore.call(t)}var cre="[object Null]",ure="[object Undefined]",D7=Za?Za.toStringTag:void 0;function tl(t){return t==null?t===void 0?ure:cre:D7&&D7 in Object(t)?are(t):lre(t)}function ha(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var hre="[object AsyncFunction]",dre="[object Function]",fre="[object GeneratorFunction]",pre="[object Proxy]";function Qa(t){if(!ha(t))return!1;var e=tl(t);return e==dre||e==fre||e==hre||e==pre}var Hx=no["__core-js_shared__"],M7=function(){var t=/[^.]+$/.exec(Hx&&Hx.keys&&Hx.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function gre(t){return!!M7&&M7 in t}var mre=Function.prototype,vre=mre.toString;function Au(t){if(t!=null){try{return vre.call(t)}catch{}try{return t+""}catch{}}return""}var yre=/[\\^$.*+?()[\]{}|]/g,xre=/^\[object .+?Constructor\]$/,bre=Function.prototype,wre=Object.prototype,Tre=bre.toString,Ere=wre.hasOwnProperty,kre=RegExp("^"+Tre.call(Ere).replace(yre,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Sre(t){if(!ha(t)||gre(t))return!1;var e=Qa(t)?kre:xre;return e.test(Au(t))}function Cre(t,e){return t?.[e]}function _u(t,e){var r=Cre(t,e);return Sre(r)?r:void 0}var q0=_u(Object,"create");function Are(){this.__data__=q0?q0(null):{},this.size=0}function _re(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var Lre="__lodash_hash_undefined__",Rre=Object.prototype,Nre=Rre.hasOwnProperty;function Dre(t){var e=this.__data__;if(q0){var r=e[t];return r===Lre?void 0:r}return Nre.call(e,t)?e[t]:void 0}var Mre=Object.prototype,Ire=Mre.hasOwnProperty;function Ore(t){var e=this.__data__;return q0?e[t]!==void 0:Ire.call(e,t)}var Pre="__lodash_hash_undefined__";function Bre(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=q0&&e===void 0?Pre:e,this}function ou(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}ou.prototype.clear=Are;ou.prototype.delete=_re;ou.prototype.get=Dre;ou.prototype.has=Ore;ou.prototype.set=Bre;function Fre(){this.__data__=[],this.size=0}function wd(t,e){return t===e||t!==t&&e!==e}function Zy(t,e){for(var r=t.length;r--;)if(wd(t[r][0],e))return r;return-1}var $re=Array.prototype,zre=$re.splice;function Vre(t){var e=this.__data__,r=Zy(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():zre.call(e,r,1),--this.size,!0}function Gre(t){var e=this.__data__,r=Zy(e,t);return r<0?void 0:e[r][1]}function Ure(t){return Zy(this.__data__,t)>-1}function Wre(t,e){var r=this.__data__,n=Zy(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}function rl(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}rl.prototype.clear=Fre;rl.prototype.delete=Vre;rl.prototype.get=Gre;rl.prototype.has=Ure;rl.prototype.set=Wre;var Y0=_u(no,"Map");function Hre(){this.size=0,this.__data__={hash:new ou,map:new(Y0||rl),string:new ou}}function qre(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function Qy(t,e){var r=t.__data__;return qre(e)?r[typeof e=="string"?"string":"hash"]:r.map}function Yre(t){var e=Qy(this,t).delete(t);return this.size-=e?1:0,e}function Xre(t){return Qy(this,t).get(t)}function jre(t){return Qy(this,t).has(t)}function Kre(t,e){var r=Qy(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this}function nl(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}nl.prototype.clear=Hre;nl.prototype.delete=Yre;nl.prototype.get=Xre;nl.prototype.has=jre;nl.prototype.set=Kre;var Zre="Expected a function";function Td(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(Zre);var r=function(){var n=arguments,i=e?e.apply(this,n):n[0],a=r.cache;if(a.has(i))return a.get(i);var s=t.apply(this,n);return r.cache=a.set(i,s)||a,s};return r.cache=new(Td.Cache||nl),r}Td.Cache=nl;function Qre(){this.__data__=new rl,this.size=0}function Jre(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}function ene(t){return this.__data__.get(t)}function tne(t){return this.__data__.has(t)}var rne=200;function nne(t,e){var r=this.__data__;if(r instanceof rl){var n=r.__data__;if(!Y0||n.length<rne-1)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new nl(n)}return r.set(t,e),this.size=r.size,this}function gs(t){var e=this.__data__=new rl(t);this.size=e.size}gs.prototype.clear=Qre;gs.prototype.delete=Jre;gs.prototype.get=ene;gs.prototype.has=tne;gs.prototype.set=nne;var lv=function(){try{var t=_u(Object,"defineProperty");return t({},"",{}),t}catch{}}();function Ip(t,e,r){e=="__proto__"&&lv?lv(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}function S5(t,e,r){(r!==void 0&&!wd(t[e],r)||r===void 0&&!(e in t))&&Ip(t,e,r)}function ine(t){return function(e,r,n){for(var i=-1,a=Object(e),s=n(e),o=s.length;o--;){var l=s[++i];if(r(a[l],l,a)===!1)break}return e}}var C6=ine(),MI=typeof exports=="object"&&exports&&!exports.nodeType&&exports,I7=MI&&typeof module=="object"&&module&&!module.nodeType&&module,ane=I7&&I7.exports===MI,O7=ane?no.Buffer:void 0,P7=O7?O7.allocUnsafe:void 0;function II(t,e){if(e)return t.slice();var r=t.length,n=P7?P7(r):new t.constructor(r);return t.copy(n),n}var cv=no.Uint8Array;function A6(t){var e=new t.constructor(t.byteLength);return new cv(e).set(new cv(t)),e}function OI(t,e){var r=e?A6(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}function PI(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e}var B7=Object.create,sne=function(){function t(){}return function(e){if(!ha(e))return{};if(B7)return B7(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}}();function BI(t,e){return function(r){return t(e(r))}}var _6=BI(Object.getPrototypeOf,Object),one=Object.prototype;function Op(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||one;return t===r}function FI(t){return typeof t.constructor=="function"&&!Op(t)?sne(_6(t)):{}}function Ja(t){return t!=null&&typeof t=="object"}var lne="[object Arguments]";function F7(t){return Ja(t)&&tl(t)==lne}var $I=Object.prototype,cne=$I.hasOwnProperty,une=$I.propertyIsEnumerable,Zh=F7(function(){return arguments}())?F7:function(t){return Ja(t)&&cne.call(t,"callee")&&!une.call(t,"callee")},ar=Array.isArray,hne=9007199254740991;function L6(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=hne}function io(t){return t!=null&&L6(t.length)&&!Qa(t)}function uv(t){return Ja(t)&&io(t)}function dne(){return!1}var zI=typeof exports=="object"&&exports&&!exports.nodeType&&exports,$7=zI&&typeof module=="object"&&module&&!module.nodeType&&module,fne=$7&&$7.exports===zI,z7=fne?no.Buffer:void 0,pne=z7?z7.isBuffer:void 0,Qh=pne||dne,gne="[object Object]",mne=Function.prototype,vne=Object.prototype,VI=mne.toString,yne=vne.hasOwnProperty,xne=VI.call(Object);function bne(t){if(!Ja(t)||tl(t)!=gne)return!1;var e=_6(t);if(e===null)return!0;var r=yne.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&VI.call(r)==xne}var wne="[object Arguments]",Tne="[object Array]",Ene="[object Boolean]",kne="[object Date]",Sne="[object Error]",Cne="[object Function]",Ane="[object Map]",_ne="[object Number]",Lne="[object Object]",Rne="[object RegExp]",Nne="[object Set]",Dne="[object String]",Mne="[object WeakMap]",Ine="[object ArrayBuffer]",One="[object DataView]",Pne="[object Float32Array]",Bne="[object Float64Array]",Fne="[object Int8Array]",$ne="[object Int16Array]",zne="[object Int32Array]",Vne="[object Uint8Array]",Gne="[object Uint8ClampedArray]",Une="[object Uint16Array]",Wne="[object Uint32Array]",Wr={};Wr[Pne]=Wr[Bne]=Wr[Fne]=Wr[$ne]=Wr[zne]=Wr[Vne]=Wr[Gne]=Wr[Une]=Wr[Wne]=!0;Wr[wne]=Wr[Tne]=Wr[Ine]=Wr[Ene]=Wr[One]=Wr[kne]=Wr[Sne]=Wr[Cne]=Wr[Ane]=Wr[_ne]=Wr[Lne]=Wr[Rne]=Wr[Nne]=Wr[Dne]=Wr[Mne]=!1;function Hne(t){return Ja(t)&&L6(t.length)&&!!Wr[tl(t)]}function Pp(t){return function(e){return t(e)}}var GI=typeof exports=="object"&&exports&&!exports.nodeType&&exports,T0=GI&&typeof module=="object"&&module&&!module.nodeType&&module,qne=T0&&T0.exports===GI,qx=qne&&NI.process,Il=function(){try{var t=T0&&T0.require&&T0.require("util").types;return t||qx&&qx.binding&&qx.binding("util")}catch{}}(),V7=Il&&Il.isTypedArray,Jy=V7?Pp(V7):Hne;function C5(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}var Yne=Object.prototype,Xne=Yne.hasOwnProperty;function Bp(t,e,r){var n=t[e];(!(Xne.call(t,e)&&wd(n,r))||r===void 0&&!(e in t))&&Ip(t,e,r)}function Ed(t,e,r,n){var i=!r;r||(r={});for(var a=-1,s=e.length;++a<s;){var o=e[a],l=void 0;l===void 0&&(l=t[o]),i?Ip(r,o,l):Bp(r,o,l)}return r}function jne(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}var Kne=9007199254740991,Zne=/^(?:0|[1-9]\d*)$/;function e2(t,e){var r=typeof t;return e=e??Kne,!!e&&(r=="number"||r!="symbol"&&Zne.test(t))&&t>-1&&t%1==0&&t<e}var Qne=Object.prototype,Jne=Qne.hasOwnProperty;function UI(t,e){var r=ar(t),n=!r&&Zh(t),i=!r&&!n&&Qh(t),a=!r&&!n&&!i&&Jy(t),s=r||n||i||a,o=s?jne(t.length,String):[],l=o.length;for(var u in t)(e||Jne.call(t,u))&&!(s&&(u=="length"||i&&(u=="offset"||u=="parent")||a&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||e2(u,l)))&&o.push(u);return o}function eie(t){var e=[];if(t!=null)for(var r in Object(t))e.push(r);return e}var tie=Object.prototype,rie=tie.hasOwnProperty;function nie(t){if(!ha(t))return eie(t);var e=Op(t),r=[];for(var n in t)n=="constructor"&&(e||!rie.call(t,n))||r.push(n);return r}function Lu(t){return io(t)?UI(t,!0):nie(t)}function iie(t){return Ed(t,Lu(t))}function aie(t,e,r,n,i,a,s){var o=C5(t,r),l=C5(e,r),u=s.get(l);if(u){S5(t,r,u);return}var h=a?a(o,l,r+"",t,e,s):void 0,d=h===void 0;if(d){var f=ar(l),p=!f&&Qh(l),g=!f&&!p&&Jy(l);h=l,f||p||g?ar(o)?h=o:uv(o)?h=PI(o):p?(d=!1,h=II(l,!0)):g?(d=!1,h=OI(l,!0)):h=[]:bne(l)||Zh(l)?(h=o,Zh(o)?h=iie(o):(!ha(o)||Qa(o))&&(h=FI(l))):d=!1}d&&(s.set(l,h),i(h,l,n,a,s),s.delete(l)),S5(t,r,h)}function WI(t,e,r,n,i){t!==e&&C6(e,function(a,s){if(i||(i=new gs),ha(a))aie(t,e,s,r,WI,n,i);else{var o=n?n(C5(t,s),a,s+"",t,e,i):void 0;o===void 0&&(o=a),S5(t,s,o)}},Lu)}function Wo(t){return t}function sie(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}var G7=Math.max;function HI(t,e,r){return e=G7(e===void 0?t.length-1:e,0),function(){for(var n=arguments,i=-1,a=G7(n.length-e,0),s=Array(a);++i<a;)s[i]=n[e+i];i=-1;for(var o=Array(e+1);++i<e;)o[i]=n[i];return o[e]=r(s),sie(t,this,o)}}function yh(t){return function(){return t}}var oie=lv?function(t,e){return lv(t,"toString",{configurable:!0,enumerable:!1,value:yh(e),writable:!0})}:Wo,lie=800,cie=16,uie=Date.now;function hie(t){var e=0,r=0;return function(){var n=uie(),i=cie-(n-r);if(r=n,i>0){if(++e>=lie)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}var qI=hie(oie);function Fp(t,e){return qI(HI(t,e,Wo),t+"")}function X0(t,e,r){if(!ha(r))return!1;var n=typeof e;return(n=="number"?io(r)&&e2(e,r.length):n=="string"&&e in r)?wd(r[e],t):!1}function YI(t){return Fp(function(e,r){var n=-1,i=r.length,a=i>1?r[i-1]:void 0,s=i>2?r[2]:void 0;for(a=t.length>3&&typeof a=="function"?(i--,a):void 0,s&&X0(r[0],r[1],s)&&(a=i<3?void 0:a,i=1),e=Object(e);++n<i;){var o=r[n];o&&t(e,o,n,a)}return e})}var hv=YI(function(t,e,r){WI(t,e,r)}),XI="​",die={curveBasis:Ah,curveBasisClosed:Pee,curveBasisOpen:Bee,curveBumpX:LD,curveBumpY:RD,curveBundle:Fee,curveCardinalClosed:$ee,curveCardinalOpen:zee,curveCardinal:ID,curveCatmullRomClosed:Vee,curveCatmullRomOpen:Gee,curveCatmullRom:PD,curveLinear:Qm,curveLinearClosed:Uee,curveMonotoneX:GD,curveMonotoneY:UD,curveNatural:HD,curveStep:qD,curveStepAfter:XD,curveStepBefore:YD},fie=/\s*(?:(\w+)(?=:):|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,pie=x(function(t,e){const r=jI(t,/(?:init\b)|(?:initialize\b)/);let n={};if(Array.isArray(r)){const s=r.map(o=>o.args);Dm(s),n=mn(n,[...s])}else n=r.args;if(!n)return;let i=jT(t,e);const a="config";return n[a]!==void 0&&(i==="flowchart-v2"&&(i="flowchart"),n[i]=n[a],delete n[a]),n},"detectInit"),jI=x(function(t,e=null){try{const r=new RegExp(`[%]{2}(?![{]${fie.source})(?=[}][%]{2}).*
`,"ig");t=t.trim().replace(r,"").replace(/'/gm,'"'),ie.debug(`Detecting diagram directive${e!==null?" type:"+e:""} based on the text:${t}`);let n;const i=[];for(;(n=x0.exec(t))!==null;)if(n.index===x0.lastIndex&&x0.lastIndex++,n&&!e||e&&n[1]?.match(e)||e&&n[2]?.match(e)){const a=n[1]?n[1]:n[2],s=n[3]?n[3].trim():n[4]?JSON.parse(n[4].trim()):null;i.push({type:a,args:s})}return i.length===0?{type:t,args:null}:i.length===1?i[0]:i}catch(r){return ie.error(`ERROR: ${r.message} - Unable to parse directive type: '${e}' based on the text: '${t}'`),{type:void 0,args:null}}},"detectDirective"),gie=x(function(t){return t.replace(x0,"")},"removeDirectives"),mie=x(function(t,e){for(const[r,n]of e.entries())if(n.match(t))return r;return-1},"isSubstringInArray");function R6(t,e){if(!t)return e;const r=`curve${t.charAt(0).toUpperCase()+t.slice(1)}`;return die[r]??e}x(R6,"interpolateToCurve");function KI(t,e){const r=t.trim();if(r)return e.securityLevel!=="loose"?tc(r):r}x(KI,"formatUrl");var vie=x((t,...e)=>{const r=t.split("."),n=r.length-1,i=r[n];let a=window;for(let s=0;s<n;s++)if(a=a[r[s]],!a){ie.error(`Function name: ${t} not found in window`);return}a[i](...e)},"runFunc");function N6(t,e){return!t||!e?0:Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}x(N6,"distance");function ZI(t){let e,r=0;t.forEach(i=>{r+=N6(i,e),e=i});const n=r/2;return D6(t,n)}x(ZI,"traverseEdge");function QI(t){return t.length===1?t[0]:ZI(t)}x(QI,"calcLabelPosition");var U7=x((t,e=2)=>{const r=Math.pow(10,e);return Math.round(t*r)/r},"roundNumber"),D6=x((t,e)=>{let r,n=e;for(const i of t){if(r){const a=N6(i,r);if(a===0)return r;if(a<n)n-=a;else{const s=n/a;if(s<=0)return r;if(s>=1)return{x:i.x,y:i.y};if(s>0&&s<1)return{x:U7((1-s)*r.x+s*i.x,5),y:U7((1-s)*r.y+s*i.y,5)}}}r=i}throw new Error("Could not find a suitable point for the given distance")},"calculatePoint"),yie=x((t,e,r)=>{ie.info(`our points ${JSON.stringify(e)}`),e[0]!==r&&(e=e.reverse());const i=D6(e,25),a=t?10:5,s=Math.atan2(e[0].y-i.y,e[0].x-i.x),o={x:0,y:0};return o.x=Math.sin(s)*a+(e[0].x+i.x)/2,o.y=-Math.cos(s)*a+(e[0].y+i.y)/2,o},"calcCardinalityPosition");function JI(t,e,r){const n=structuredClone(r);ie.info("our points",n),e!=="start_left"&&e!=="start_right"&&n.reverse();const i=25+t,a=D6(n,i),s=10+t*.5,o=Math.atan2(n[0].y-a.y,n[0].x-a.x),l={x:0,y:0};return e==="start_left"?(l.x=Math.sin(o+Math.PI)*s+(n[0].x+a.x)/2,l.y=-Math.cos(o+Math.PI)*s+(n[0].y+a.y)/2):e==="end_right"?(l.x=Math.sin(o-Math.PI)*s+(n[0].x+a.x)/2-5,l.y=-Math.cos(o-Math.PI)*s+(n[0].y+a.y)/2-5):e==="end_left"?(l.x=Math.sin(o)*s+(n[0].x+a.x)/2-5,l.y=-Math.cos(o)*s+(n[0].y+a.y)/2-5):(l.x=Math.sin(o)*s+(n[0].x+a.x)/2,l.y=-Math.cos(o)*s+(n[0].y+a.y)/2),l}x(JI,"calcTerminalLabelPosition");function M6(t){let e="",r="";for(const n of t)n!==void 0&&(n.startsWith("color:")||n.startsWith("text-align:")?r=r+n+";":e=e+n+";");return{style:e,labelStyle:r}}x(M6,"getStylesFromArray");var W7=0,eO=x(()=>(W7++,"id-"+Math.random().toString(36).substr(2,12)+"-"+W7),"generateId");function tO(t){let e="";const r="0123456789abcdef",n=r.length;for(let i=0;i<t;i++)e+=r.charAt(Math.floor(Math.random()*n));return e}x(tO,"makeRandomHex");var rO=x(t=>tO(t.length),"random"),xie=x(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"),bie=x(function(t,e){const r=e.text.replace(at.lineBreakRegex," "),[,n]=Ru(e.fontSize),i=t.append("text");i.attr("x",e.x),i.attr("y",e.y),i.style("text-anchor",e.anchor),i.style("font-family",e.fontFamily),i.style("font-size",n),i.style("font-weight",e.fontWeight),i.attr("fill",e.fill),e.class!==void 0&&i.attr("class",e.class);const a=i.append("tspan");return a.attr("x",e.x+e.textMargin*2),a.attr("fill",e.fill),a.text(r),i},"drawSimpleText"),nO=Td((t,e,r)=>{if(!t||(r=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",joinWith:"<br/>"},r),at.lineBreakRegex.test(t)))return t;const n=t.split(" ").filter(Boolean),i=[];let a="";return n.forEach((s,o)=>{const l=Vi(`${s} `,r),u=Vi(a,r);if(l>e){const{hyphenatedStrings:f,remainingWord:p}=wie(s,e,"-",r);i.push(a,...f),a=p}else u+l>=e?(i.push(a),a=s):a=[a,s].filter(Boolean).join(" ");o+1===n.length&&i.push(a)}),i.filter(s=>s!=="").join(r.joinWith)},(t,e,r)=>`${t}${e}${r.fontSize}${r.fontWeight}${r.fontFamily}${r.joinWith}`),wie=Td((t,e,r="-",n)=>{n=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",margin:0},n);const i=[...t],a=[];let s="";return i.forEach((o,l)=>{const u=`${s}${o}`;if(Vi(u,n)>=e){const d=l+1,f=i.length===d,p=`${u}${r}`;a.push(f?u:p),s=""}else s=u}),{hyphenatedStrings:a,remainingWord:s}},(t,e,r="-",n)=>`${t}${e}${r}${n.fontSize}${n.fontWeight}${n.fontFamily}`);function dv(t,e){return I6(t,e).height}x(dv,"calculateTextHeight");function Vi(t,e){return I6(t,e).width}x(Vi,"calculateTextWidth");var I6=Td((t,e)=>{const{fontSize:r=12,fontFamily:n="Arial",fontWeight:i=400}=e;if(!t)return{width:0,height:0};const[,a]=Ru(r),s=["sans-serif",n],o=t.split(at.lineBreakRegex),l=[],u=Qe("body");if(!u.remove)return{width:0,height:0,lineHeight:0};const h=u.append("svg");for(const f of s){let p=0;const g={width:0,height:0,lineHeight:0};for(const m of o){const v=xie();v.text=m||XI;const y=bie(h,v).style("font-size",a).style("font-weight",i).style("font-family",f),b=(y._groups||y)[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)),p=Math.round(b.height),g.height+=p,g.lineHeight=Math.round(Math.max(g.lineHeight,p))}l.push(g)}h.remove();const d=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[d]},(t,e)=>`${t}${e.fontSize}${e.fontWeight}${e.fontFamily}`),Tie=class{constructor(t=!1,e){this.count=0,this.count=e?e.length:0,this.next=t?()=>this.count++:()=>Date.now()}static{x(this,"InitIDGenerator")}},Ng,Eie=x(function(t){return Ng=Ng||document.createElement("div"),t=escape(t).replace(/%26/g,"&").replace(/%23/g,"#").replace(/%3B/g,";"),Ng.innerHTML=t,unescape(Ng.textContent)},"entityDecode");function O6(t){return"str"in t}x(O6,"isDetailedError");var kie=x((t,e,r,n)=>{if(!n)return;const i=t.node()?.getBBox();i&&t.append("text").text(n).attr("text-anchor","middle").attr("x",i.x+i.width/2).attr("y",-r).attr("class",e)},"insertTitle"),Ru=x(t=>{if(typeof t=="number")return[t,t+"px"];const e=parseInt(t??"",10);return Number.isNaN(e)?[void 0,void 0]:t===String(e)?[e,t+"px"]:[e,t]},"parseFontSize");function Hi(t,e){return hv({},t,e)}x(Hi,"cleanAndMerge");var Kt={assignWithDepth:mn,wrapLabel:nO,calculateTextHeight:dv,calculateTextWidth:Vi,calculateTextDimensions:I6,cleanAndMerge:Hi,detectInit:pie,detectDirective:jI,isSubstringInArray:mie,interpolateToCurve:R6,calcLabelPosition:QI,calcCardinalityPosition:yie,calcTerminalLabelPosition:JI,formatUrl:KI,getStylesFromArray:M6,generateId:eO,random:rO,runFunc:vie,entityDecode:Eie,insertTitle:kie,isLabelCoordinateInPath:iO,parseFontSize:Ru,InitIDGenerator:Tie},Sie=x(function(t){let e=t;return e=e.replace(/style.*:\S*#.*;/g,function(r){return r.substring(0,r.length-1)}),e=e.replace(/classDef.*:\S*#.*;/g,function(r){return r.substring(0,r.length-1)}),e=e.replace(/#\w+;/g,function(r){const n=r.substring(1,r.length-1);return/^\+?\d+$/.test(n)?"ﬂ°°"+n+"¶ß":"ﬂ°"+n+"¶ß"}),e},"encodeEntities"),Ks=x(function(t){return t.replace(/ﬂ°°/g,"&#").replace(/ﬂ°/g,"&").replace(/¶ß/g,";")},"decodeEntities"),_h=x((t,e,{counter:r=0,prefix:n,suffix:i},a)=>a||`${n?`${n}_`:""}${t}_${e}_${r}${i?`_${i}`:""}`,"getEdgeId");function Si(t){return t??null}x(Si,"handleUndefinedAttr");function iO(t,e){const r=Math.round(t.x),n=Math.round(t.y),i=e.replace(/(\d+\.\d+)/g,a=>Math.round(parseFloat(a)).toString());return i.includes(r.toString())||i.includes(n.toString())}x(iO,"isLabelCoordinateInPath");const Cie=Object.freeze({left:0,top:0,width:16,height:16}),fv=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),aO=Object.freeze({...Cie,...fv}),Aie=Object.freeze({...aO,body:"",hidden:!1}),_ie=Object.freeze({width:null,height:null}),Lie=Object.freeze({..._ie,...fv}),Rie=(t,e,r,n="")=>{const i=t.split(":");if(t.slice(0,1)==="@"){if(i.length<2||i.length>3)return null;n=i.shift().slice(1)}if(i.length>3||!i.length)return null;if(i.length>1){const o=i.pop(),l=i.pop(),u={provider:i.length>0?i[0]:n,prefix:l,name:o};return Yx(u)?u:null}const a=i[0],s=a.split("-");if(s.length>1){const o={provider:n,prefix:s.shift(),name:s.join("-")};return Yx(o)?o:null}if(r&&n===""){const o={provider:n,prefix:"",name:a};return Yx(o,r)?o:null}return null},Yx=(t,e)=>t?!!((e&&t.prefix===""||t.prefix)&&t.name):!1;function Nie(t,e){const r={};!t.hFlip!=!e.hFlip&&(r.hFlip=!0),!t.vFlip!=!e.vFlip&&(r.vFlip=!0);const n=((t.rotate||0)+(e.rotate||0))%4;return n&&(r.rotate=n),r}function H7(t,e){const r=Nie(t,e);for(const n in Aie)n in fv?n in t&&!(n in r)&&(r[n]=fv[n]):n in e?r[n]=e[n]:n in t&&(r[n]=t[n]);return r}function Die(t,e){const r=t.icons,n=t.aliases||Object.create(null),i=Object.create(null);function a(s){if(r[s])return i[s]=[];if(!(s in i)){i[s]=null;const o=n[s]&&n[s].parent,l=o&&a(o);l&&(i[s]=[o].concat(l))}return i[s]}return(e||Object.keys(r).concat(Object.keys(n))).forEach(a),i}function q7(t,e,r){const n=t.icons,i=t.aliases||Object.create(null);let a={};function s(o){a=H7(n[o]||i[o],a)}return s(e),r.forEach(s),H7(t,a)}function Mie(t,e){if(t.icons[e])return q7(t,e,[]);const r=Die(t,[e])[e];return r?q7(t,e,r):null}const Iie=/(-?[0-9.]*[0-9]+[0-9.]*)/g,Oie=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function Y7(t,e,r){if(e===1)return t;if(r=r||100,typeof t=="number")return Math.ceil(t*e*r)/r;if(typeof t!="string")return t;const n=t.split(Iie);if(n===null||!n.length)return t;const i=[];let a=n.shift(),s=Oie.test(a);for(;;){if(s){const o=parseFloat(a);isNaN(o)?i.push(a):i.push(Math.ceil(o*e*r)/r)}else i.push(a);if(a=n.shift(),a===void 0)return i.join("");s=!s}}function Pie(t,e="defs"){let r="";const n=t.indexOf("<"+e);for(;n>=0;){const i=t.indexOf(">",n),a=t.indexOf("</"+e);if(i===-1||a===-1)break;const s=t.indexOf(">",a);if(s===-1)break;r+=t.slice(i+1,a).trim(),t=t.slice(0,n).trim()+t.slice(s+1)}return{defs:r,content:t}}function Bie(t,e){return t?"<defs>"+t+"</defs>"+e:e}function Fie(t,e,r){const n=Pie(t);return Bie(n.defs,e+n.content+r)}const $ie=t=>t==="unset"||t==="undefined"||t==="none";function zie(t,e){const r={...aO,...t},n={...Lie,...e},i={left:r.left,top:r.top,width:r.width,height:r.height};let a=r.body;[r,n].forEach(m=>{const v=[],y=m.hFlip,b=m.vFlip;let w=m.rotate;y?b?w+=2:(v.push("translate("+(i.width+i.left).toString()+" "+(0-i.top).toString()+")"),v.push("scale(-1 1)"),i.top=i.left=0):b&&(v.push("translate("+(0-i.left).toString()+" "+(i.height+i.top).toString()+")"),v.push("scale(1 -1)"),i.top=i.left=0);let T;switch(w<0&&(w-=Math.floor(w/4)*4),w=w%4,w){case 1:T=i.height/2+i.top,v.unshift("rotate(90 "+T.toString()+" "+T.toString()+")");break;case 2:v.unshift("rotate(180 "+(i.width/2+i.left).toString()+" "+(i.height/2+i.top).toString()+")");break;case 3:T=i.width/2+i.left,v.unshift("rotate(-90 "+T.toString()+" "+T.toString()+")");break}w%2===1&&(i.left!==i.top&&(T=i.left,i.left=i.top,i.top=T),i.width!==i.height&&(T=i.width,i.width=i.height,i.height=T)),v.length&&(a=Fie(a,'<g transform="'+v.join(" ")+'">',"</g>"))});const s=n.width,o=n.height,l=i.width,u=i.height;let h,d;s===null?(d=o===null?"1em":o==="auto"?u:o,h=Y7(d,l/u)):(h=s==="auto"?l:s,d=o===null?Y7(h,u/l):o==="auto"?u:o);const f={},p=(m,v)=>{$ie(v)||(f[m]=v.toString())};p("width",h),p("height",d);const g=[i.left,i.top,l,u];return f.viewBox=g.join(" "),{attributes:f,viewBox:g,body:a}}const Vie=/\sid="(\S+)"/g,X7=new Map;function Gie(t){t=t.replace(/[0-9]+$/,"")||"a";const e=X7.get(t)||0;return X7.set(t,e+1),e?`${t}${e}`:t}function Uie(t){const e=[];let r;for(;r=Vie.exec(t);)e.push(r[1]);if(!e.length)return t;const n="suffix"+(Math.random()*16777216|Date.now()).toString(16);return e.forEach(i=>{const a=Gie(i),s=i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");t=t.replace(new RegExp('([#;"])('+s+')([")]|\\.[a-z])',"g"),"$1"+a+n+"$3")}),t=t.replace(new RegExp(n,"g"),""),t}function Wie(t,e){let r=t.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const n in e)r+=" "+n+'="'+e[n]+'"';return'<svg xmlns="http://www.w3.org/2000/svg"'+r+">"+t+"</svg>"}function P6(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Nu=P6();function sO(t){Nu=t}var E0={exec:()=>null};function kr(t,e=""){let r=typeof t=="string"?t:t.source,n={replace:(i,a)=>{let s=typeof a=="string"?a:a.source;return s=s.replace($i.caret,"$1"),r=r.replace(i,s),n},getRegex:()=>new RegExp(r,e)};return n}var Hie=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),$i={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,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:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/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:t=>new RegExp(`^( {0,3}${t})((?:[	 ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ 	][^\\n]*)?(?:\\n|$))`),hrRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}#`),htmlBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}<(?:[a-z].*>|!--)`,"i")},qie=/^(?:[ \t]*(?:\n|$))+/,Yie=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Xie=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,$p=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,jie=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,B6=/(?:[*+-]|\d{1,9}[.)])/,oO=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,lO=kr(oO).replace(/bull/g,B6).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>]+>\n/).replace(/\|table/g,"").getRegex(),Kie=kr(oO).replace(/bull/g,B6).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>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),F6=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Zie=/^[^\n]+/,$6=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Qie=kr(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",$6).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Jie=kr(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,B6).getRegex(),t2="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",z6=/\x3C!--(?:-?>|[\s\S]*?(?:-->|$))/,eae=kr("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ 	]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ 	]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ 	]*)+\\n|$))","i").replace("comment",z6).replace("tag",t2).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),cO=kr(F6).replace("hr",$p).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|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",t2).getRegex(),tae=kr(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",cO).getRegex(),V6={blockquote:tae,code:Yie,def:Qie,fences:Xie,heading:jie,hr:$p,html:eae,lheading:lO,list:Jie,newline:qie,paragraph:cO,table:E0,text:Zie},j7=kr("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",$p).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|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",t2).getRegex(),rae={...V6,lheading:Kie,table:j7,paragraph:kr(F6).replace("hr",$p).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",j7).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",t2).getRegex()},nae={...V6,html:kr(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",z6).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:E0,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:kr(F6).replace("hr",$p).replace("heading",` *#{1,6} *[^
]`).replace("lheading",lO).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},iae=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,aae=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,uO=/^( {2,}|\\)\n(?!\s*$)/,sae=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,r2=/[\p{P}\p{S}]/u,G6=/[\s\p{P}\p{S}]/u,hO=/[^\s\p{P}\p{S}]/u,oae=kr(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,G6).getRegex(),dO=/(?!~)[\p{P}\p{S}]/u,lae=/(?!~)[\s\p{P}\p{S}]/u,cae=/(?:[^\s\p{P}\p{S}]|~)/u,uae=kr(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",Hie?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),fO=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,hae=kr(fO,"u").replace(/punct/g,r2).getRegex(),dae=kr(fO,"u").replace(/punct/g,dO).getRegex(),pO="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",fae=kr(pO,"gu").replace(/notPunctSpace/g,hO).replace(/punctSpace/g,G6).replace(/punct/g,r2).getRegex(),pae=kr(pO,"gu").replace(/notPunctSpace/g,cae).replace(/punctSpace/g,lae).replace(/punct/g,dO).getRegex(),gae=kr("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,hO).replace(/punctSpace/g,G6).replace(/punct/g,r2).getRegex(),mae=kr(/\\(punct)/,"gu").replace(/punct/g,r2).getRegex(),vae=kr(/^<(scheme:[^\s\x00-\x1f<>]*|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(),yae=kr(z6).replace("(?:-->|$)","-->").getRegex(),xae=kr("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",yae).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),pv=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,bae=kr(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",pv).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),gO=kr(/^!?\[(label)\]\[(ref)\]/).replace("label",pv).replace("ref",$6).getRegex(),mO=kr(/^!?\[(ref)\](?:\[\])?/).replace("ref",$6).getRegex(),wae=kr("reflink|nolink(?!\\()","g").replace("reflink",gO).replace("nolink",mO).getRegex(),K7=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,U6={_backpedal:E0,anyPunctuation:mae,autolink:vae,blockSkip:uae,br:uO,code:aae,del:E0,emStrongLDelim:hae,emStrongRDelimAst:fae,emStrongRDelimUnd:gae,escape:iae,link:bae,nolink:mO,punctuation:oae,reflink:gO,reflinkSearch:wae,tag:xae,text:sae,url:E0},Tae={...U6,link:kr(/^!?\[(label)\]\((.*?)\)/).replace("label",pv).getRegex(),reflink:kr(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",pv).getRegex()},A5={...U6,emStrongRDelimAst:pae,emStrongLDelim:dae,url:kr(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",K7).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:kr(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",K7).getRegex()},Eae={...A5,br:kr(uO).replace("{2,}","*").getRegex(),text:kr(A5.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Dg={normal:V6,gfm:rae,pedantic:nae},Jd={normal:U6,gfm:A5,breaks:Eae,pedantic:Tae},kae={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Z7=t=>kae[t];function Ms(t,e){if(e){if($i.escapeTest.test(t))return t.replace($i.escapeReplace,Z7)}else if($i.escapeTestNoEncode.test(t))return t.replace($i.escapeReplaceNoEncode,Z7);return t}function Q7(t){try{t=encodeURI(t).replace($i.percentDecode,"%")}catch{return null}return t}function J7(t,e){let r=t.replace($i.findPipe,(a,s,o)=>{let l=!1,u=s;for(;--u>=0&&o[u]==="\\";)l=!l;return l?"|":" |"}),n=r.split($i.splitPipe),i=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),e)if(n.length>e)n.splice(e);else for(;n.length<e;)n.push("");for(;i<n.length;i++)n[i]=n[i].trim().replace($i.slashPipe,"|");return n}function ef(t,e,r){let n=t.length;if(n===0)return"";let i=0;for(;i<n&&t.charAt(n-i-1)===e;)i++;return t.slice(0,n-i)}function Sae(t,e){if(t.indexOf(e[1])===-1)return-1;let r=0;for(let n=0;n<t.length;n++)if(t[n]==="\\")n++;else if(t[n]===e[0])r++;else if(t[n]===e[1]&&(r--,r<0))return n;return r>0?-2:-1}function eC(t,e,r,n,i){let a=e.href,s=e.title||null,o=t[1].replace(i.other.outputLinkReplace,"$1");n.state.inLink=!0;let l={type:t[0].charAt(0)==="!"?"image":"link",raw:r,href:a,title:s,text:o,tokens:n.inlineTokens(o)};return n.state.inLink=!1,l}function Cae(t,e,r){let n=t.match(r.other.indentCodeCompensation);if(n===null)return e;let i=n[1];return e.split(`
`).map(a=>{let s=a.match(r.other.beginningSpace);if(s===null)return a;let[o]=s;return o.length>=i.length?a.slice(i.length):a}).join(`
`)}var gv=class{options;rules;lexer;constructor(e){this.options=e||Nu}space(e){let r=this.rules.block.newline.exec(e);if(r&&r[0].length>0)return{type:"space",raw:r[0]}}code(e){let r=this.rules.block.code.exec(e);if(r){let n=r[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:r[0],codeBlockStyle:"indented",text:this.options.pedantic?n:ef(n,`
`)}}}fences(e){let r=this.rules.block.fences.exec(e);if(r){let n=r[0],i=Cae(n,r[3]||"",this.rules);return{type:"code",raw:n,lang:r[2]?r[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):r[2],text:i}}}heading(e){let r=this.rules.block.heading.exec(e);if(r){let n=r[2].trim();if(this.rules.other.endingHash.test(n)){let i=ef(n,"#");(this.options.pedantic||!i||this.rules.other.endingSpaceChar.test(i))&&(n=i.trim())}return{type:"heading",raw:r[0],depth:r[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(e){let r=this.rules.block.hr.exec(e);if(r)return{type:"hr",raw:ef(r[0],`
`)}}blockquote(e){let r=this.rules.block.blockquote.exec(e);if(r){let n=ef(r[0],`
`).split(`
`),i="",a="",s=[];for(;n.length>0;){let o=!1,l=[],u;for(u=0;u<n.length;u++)if(this.rules.other.blockquoteStart.test(n[u]))l.push(n[u]),o=!0;else if(!o)l.push(n[u]);else break;n=n.slice(u);let h=l.join(`
`),d=h.replace(this.rules.other.blockquoteSetextReplace,`
    $1`).replace(this.rules.other.blockquoteSetextReplace2,"");i=i?`${i}
${h}`:h,a=a?`${a}
${d}`:d;let f=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(d,s,!0),this.lexer.state.top=f,n.length===0)break;let p=s.at(-1);if(p?.type==="code")break;if(p?.type==="blockquote"){let g=p,m=g.raw+`
`+n.join(`
`),v=this.blockquote(m);s[s.length-1]=v,i=i.substring(0,i.length-g.raw.length)+v.raw,a=a.substring(0,a.length-g.text.length)+v.text;break}else if(p?.type==="list"){let g=p,m=g.raw+`
`+n.join(`
`),v=this.list(m);s[s.length-1]=v,i=i.substring(0,i.length-p.raw.length)+v.raw,a=a.substring(0,a.length-g.raw.length)+v.raw,n=m.substring(s.at(-1).raw.length).split(`
`);continue}}return{type:"blockquote",raw:i,tokens:s,text:a}}}list(e){let r=this.rules.block.list.exec(e);if(r){let n=r[1].trim(),i=n.length>1,a={type:"list",raw:"",ordered:i,start:i?+n.slice(0,-1):"",loose:!1,items:[]};n=i?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=i?n:"[*+-]");let s=this.rules.other.listItemRegex(n),o=!1;for(;e;){let u=!1,h="",d="";if(!(r=s.exec(e))||this.rules.block.hr.test(e))break;h=r[0],e=e.substring(h.length);let f=r[2].split(`
`,1)[0].replace(this.rules.other.listReplaceTabs,b=>" ".repeat(3*b.length)),p=e.split(`
`,1)[0],g=!f.trim(),m=0;if(this.options.pedantic?(m=2,d=f.trimStart()):g?m=r[1].length+1:(m=r[2].search(this.rules.other.nonSpaceChar),m=m>4?1:m,d=f.slice(m),m+=r[1].length),g&&this.rules.other.blankLine.test(p)&&(h+=p+`
`,e=e.substring(p.length+1),u=!0),!u){let b=this.rules.other.nextBulletRegex(m),w=this.rules.other.hrRegex(m),T=this.rules.other.fencesBeginRegex(m),E=this.rules.other.headingBeginRegex(m),L=this.rules.other.htmlBeginRegex(m);for(;e;){let S=e.split(`
`,1)[0],C;if(p=S,this.options.pedantic?(p=p.replace(this.rules.other.listReplaceNesting,"  "),C=p):C=p.replace(this.rules.other.tabCharGlobal,"    "),T.test(p)||E.test(p)||L.test(p)||b.test(p)||w.test(p))break;if(C.search(this.rules.other.nonSpaceChar)>=m||!p.trim())d+=`
`+C.slice(m);else{if(g||f.replace(this.rules.other.tabCharGlobal,"    ").search(this.rules.other.nonSpaceChar)>=4||T.test(f)||E.test(f)||w.test(f))break;d+=`
`+p}!g&&!p.trim()&&(g=!0),h+=S+`
`,e=e.substring(S.length+1),f=C.slice(m)}}a.loose||(o?a.loose=!0:this.rules.other.doubleBlankLine.test(h)&&(o=!0));let v=null,y;this.options.gfm&&(v=this.rules.other.listIsTask.exec(d),v&&(y=v[0]!=="[ ] ",d=d.replace(this.rules.other.listReplaceTask,""))),a.items.push({type:"list_item",raw:h,task:!!v,checked:y,loose:!1,text:d,tokens:[]}),a.raw+=h}let l=a.items.at(-1);if(l)l.raw=l.raw.trimEnd(),l.text=l.text.trimEnd();else return;a.raw=a.raw.trimEnd();for(let u=0;u<a.items.length;u++)if(this.lexer.state.top=!1,a.items[u].tokens=this.lexer.blockTokens(a.items[u].text,[]),!a.loose){let h=a.items[u].tokens.filter(f=>f.type==="space"),d=h.length>0&&h.some(f=>this.rules.other.anyLine.test(f.raw));a.loose=d}if(a.loose)for(let u=0;u<a.items.length;u++)a.items[u].loose=!0;return a}}html(e){let r=this.rules.block.html.exec(e);if(r)return{type:"html",block:!0,raw:r[0],pre:r[1]==="pre"||r[1]==="script"||r[1]==="style",text:r[0]}}def(e){let r=this.rules.block.def.exec(e);if(r){let n=r[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),i=r[2]?r[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",a=r[3]?r[3].substring(1,r[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):r[3];return{type:"def",tag:n,raw:r[0],href:i,title:a}}}table(e){let r=this.rules.block.table.exec(e);if(!r||!this.rules.other.tableDelimiter.test(r[2]))return;let n=J7(r[1]),i=r[2].replace(this.rules.other.tableAlignChars,"").split("|"),a=r[3]?.trim()?r[3].replace(this.rules.other.tableRowBlankLine,"").split(`
`):[],s={type:"table",raw:r[0],header:[],align:[],rows:[]};if(n.length===i.length){for(let o of i)this.rules.other.tableAlignRight.test(o)?s.align.push("right"):this.rules.other.tableAlignCenter.test(o)?s.align.push("center"):this.rules.other.tableAlignLeft.test(o)?s.align.push("left"):s.align.push(null);for(let o=0;o<n.length;o++)s.header.push({text:n[o],tokens:this.lexer.inline(n[o]),header:!0,align:s.align[o]});for(let o of a)s.rows.push(J7(o,s.header.length).map((l,u)=>({text:l,tokens:this.lexer.inline(l),header:!1,align:s.align[u]})));return s}}lheading(e){let r=this.rules.block.lheading.exec(e);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(e){let r=this.rules.block.paragraph.exec(e);if(r){let n=r[1].charAt(r[1].length-1)===`
`?r[1].slice(0,-1):r[1];return{type:"paragraph",raw:r[0],text:n,tokens:this.lexer.inline(n)}}}text(e){let r=this.rules.block.text.exec(e);if(r)return{type:"text",raw:r[0],text:r[0],tokens:this.lexer.inline(r[0])}}escape(e){let r=this.rules.inline.escape.exec(e);if(r)return{type:"escape",raw:r[0],text:r[1]}}tag(e){let r=this.rules.inline.tag.exec(e);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(e){let r=this.rules.inline.link.exec(e);if(r){let n=r[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;let s=ef(n.slice(0,-1),"\\");if((n.length-s.length)%2===0)return}else{let s=Sae(r[2],"()");if(s===-2)return;if(s>-1){let o=(r[0].indexOf("!")===0?5:4)+r[1].length+s;r[2]=r[2].substring(0,s),r[0]=r[0].substring(0,o).trim(),r[3]=""}}let i=r[2],a="";if(this.options.pedantic){let s=this.rules.other.pedanticHrefTitle.exec(i);s&&(i=s[1],a=s[3])}else a=r[3]?r[3].slice(1,-1):"";return i=i.trim(),this.rules.other.startAngleBracket.test(i)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?i=i.slice(1):i=i.slice(1,-1)),eC(r,{href:i&&i.replace(this.rules.inline.anyPunctuation,"$1"),title:a&&a.replace(this.rules.inline.anyPunctuation,"$1")},r[0],this.lexer,this.rules)}}reflink(e,r){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let i=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),a=r[i.toLowerCase()];if(!a){let s=n[0].charAt(0);return{type:"text",raw:s,text:s}}return eC(n,a,n[0],this.lexer,this.rules)}}emStrong(e,r,n=""){let i=this.rules.inline.emStrongLDelim.exec(e);if(!(!i||i[3]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(i[1]||i[2])||!n||this.rules.inline.punctuation.exec(n))){let a=[...i[0]].length-1,s,o,l=a,u=0,h=i[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(h.lastIndex=0,r=r.slice(-1*e.length+a);(i=h.exec(r))!=null;){if(s=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!s)continue;if(o=[...s].length,i[3]||i[4]){l+=o;continue}else if((i[5]||i[6])&&a%3&&!((a+o)%3)){u+=o;continue}if(l-=o,l>0)continue;o=Math.min(o,o+l+u);let d=[...i[0]][0].length,f=e.slice(0,a+i.index+d+o);if(Math.min(a,o)%2){let g=f.slice(1,-1);return{type:"em",raw:f,text:g,tokens:this.lexer.inlineTokens(g)}}let p=f.slice(2,-2);return{type:"strong",raw:f,text:p,tokens:this.lexer.inlineTokens(p)}}}}codespan(e){let r=this.rules.inline.code.exec(e);if(r){let n=r[2].replace(this.rules.other.newLineCharGlobal," "),i=this.rules.other.nonSpaceChar.test(n),a=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return i&&a&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:r[0],text:n}}}br(e){let r=this.rules.inline.br.exec(e);if(r)return{type:"br",raw:r[0]}}del(e){let r=this.rules.inline.del.exec(e);if(r)return{type:"del",raw:r[0],text:r[2],tokens:this.lexer.inlineTokens(r[2])}}autolink(e){let r=this.rules.inline.autolink.exec(e);if(r){let n,i;return r[2]==="@"?(n=r[1],i="mailto:"+n):(n=r[1],i=n),{type:"link",raw:r[0],text:n,href:i,tokens:[{type:"text",raw:n,text:n}]}}}url(e){let r;if(r=this.rules.inline.url.exec(e)){let n,i;if(r[2]==="@")n=r[0],i="mailto:"+n;else{let a;do a=r[0],r[0]=this.rules.inline._backpedal.exec(r[0])?.[0]??"";while(a!==r[0]);n=r[0],r[1]==="www."?i="http://"+r[0]:i=r[0]}return{type:"link",raw:r[0],text:n,href:i,tokens:[{type:"text",raw:n,text:n}]}}}inlineText(e){let r=this.rules.inline.text.exec(e);if(r){let n=this.lexer.state.inRawBlock;return{type:"text",raw:r[0],text:r[0],escaped:n}}}},us=class _5{tokens;options;state;tokenizer;inlineQueue;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||Nu,this.options.tokenizer=this.options.tokenizer||new gv,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:$i,block:Dg.normal,inline:Jd.normal};this.options.pedantic?(r.block=Dg.pedantic,r.inline=Jd.pedantic):this.options.gfm&&(r.block=Dg.gfm,this.options.breaks?r.inline=Jd.breaks:r.inline=Jd.gfm),this.tokenizer.rules=r}static get rules(){return{block:Dg,inline:Jd}}static lex(e,r){return new _5(r).lex(e)}static lexInline(e,r){return new _5(r).inlineTokens(e)}lex(e){e=e.replace($i.carriageReturn,`
`),this.blockTokens(e,this.tokens);for(let r=0;r<this.inlineQueue.length;r++){let n=this.inlineQueue[r];this.inlineTokens(n.src,n.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,r=[],n=!1){for(this.options.pedantic&&(e=e.replace($i.tabCharGlobal,"    ").replace($i.spaceLine,""));e;){let i;if(this.options.extensions?.block?.some(s=>(i=s.call({lexer:this},e,r))?(e=e.substring(i.raw.length),r.push(i),!0):!1))continue;if(i=this.tokenizer.space(e)){e=e.substring(i.raw.length);let s=r.at(-1);i.raw.length===1&&s!==void 0?s.raw+=`
`:r.push(i);continue}if(i=this.tokenizer.code(e)){e=e.substring(i.raw.length);let s=r.at(-1);s?.type==="paragraph"||s?.type==="text"?(s.raw+=(s.raw.endsWith(`
`)?"":`
`)+i.raw,s.text+=`
`+i.text,this.inlineQueue.at(-1).src=s.text):r.push(i);continue}if(i=this.tokenizer.fences(e)){e=e.substring(i.raw.length),r.push(i);continue}if(i=this.tokenizer.heading(e)){e=e.substring(i.raw.length),r.push(i);continue}if(i=this.tokenizer.hr(e)){e=e.substring(i.raw.length),r.push(i);continue}if(i=this.tokenizer.blockquote(e)){e=e.substring(i.raw.length),r.push(i);continue}if(i=this.tokenizer.list(e)){e=e.substring(i.raw.length),r.push(i);continue}if(i=this.tokenizer.html(e)){e=e.substring(i.raw.length),r.push(i);continue}if(i=this.tokenizer.def(e)){e=e.substring(i.raw.length);let s=r.at(-1);s?.type==="paragraph"||s?.type==="text"?(s.raw+=(s.raw.endsWith(`
`)?"":`
`)+i.raw,s.text+=`
`+i.raw,this.inlineQueue.at(-1).src=s.text):this.tokens.links[i.tag]||(this.tokens.links[i.tag]={href:i.href,title:i.title},r.push(i));continue}if(i=this.tokenizer.table(e)){e=e.substring(i.raw.length),r.push(i);continue}if(i=this.tokenizer.lheading(e)){e=e.substring(i.raw.length),r.push(i);continue}let a=e;if(this.options.extensions?.startBlock){let s=1/0,o=e.slice(1),l;this.options.extensions.startBlock.forEach(u=>{l=u.call({lexer:this},o),typeof l=="number"&&l>=0&&(s=Math.min(s,l))}),s<1/0&&s>=0&&(a=e.substring(0,s+1))}if(this.state.top&&(i=this.tokenizer.paragraph(a))){let s=r.at(-1);n&&s?.type==="paragraph"?(s.raw+=(s.raw.endsWith(`
`)?"":`
`)+i.raw,s.text+=`
`+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=s.text):r.push(i),n=a.length!==e.length,e=e.substring(i.raw.length);continue}if(i=this.tokenizer.text(e)){e=e.substring(i.raw.length);let s=r.at(-1);s?.type==="text"?(s.raw+=(s.raw.endsWith(`
`)?"":`
`)+i.raw,s.text+=`
`+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=s.text):r.push(i);continue}if(e){let s="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(s);break}else throw new Error(s)}}return this.state.top=!0,r}inline(e,r=[]){return this.inlineQueue.push({src:e,tokens:r}),r}inlineTokens(e,r=[]){let n=e,i=null;if(this.tokens.links){let l=Object.keys(this.tokens.links);if(l.length>0)for(;(i=this.tokenizer.rules.inline.reflinkSearch.exec(n))!=null;)l.includes(i[0].slice(i[0].lastIndexOf("[")+1,-1))&&(n=n.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(i=this.tokenizer.rules.inline.anyPunctuation.exec(n))!=null;)n=n.slice(0,i.index)+"++"+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let a;for(;(i=this.tokenizer.rules.inline.blockSkip.exec(n))!=null;)a=i[2]?i[2].length:0,n=n.slice(0,i.index+a)+"["+"a".repeat(i[0].length-a-2)+"]"+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);n=this.options.hooks?.emStrongMask?.call({lexer:this},n)??n;let s=!1,o="";for(;e;){s||(o=""),s=!1;let l;if(this.options.extensions?.inline?.some(h=>(l=h.call({lexer:this},e,r))?(e=e.substring(l.raw.length),r.push(l),!0):!1))continue;if(l=this.tokenizer.escape(e)){e=e.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.tag(e)){e=e.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.link(e)){e=e.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(l.raw.length);let h=r.at(-1);l.type==="text"&&h?.type==="text"?(h.raw+=l.raw,h.text+=l.text):r.push(l);continue}if(l=this.tokenizer.emStrong(e,n,o)){e=e.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.codespan(e)){e=e.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.br(e)){e=e.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.del(e)){e=e.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.autolink(e)){e=e.substring(l.raw.length),r.push(l);continue}if(!this.state.inLink&&(l=this.tokenizer.url(e))){e=e.substring(l.raw.length),r.push(l);continue}let u=e;if(this.options.extensions?.startInline){let h=1/0,d=e.slice(1),f;this.options.extensions.startInline.forEach(p=>{f=p.call({lexer:this},d),typeof f=="number"&&f>=0&&(h=Math.min(h,f))}),h<1/0&&h>=0&&(u=e.substring(0,h+1))}if(l=this.tokenizer.inlineText(u)){e=e.substring(l.raw.length),l.raw.slice(-1)!=="_"&&(o=l.raw.slice(-1)),s=!0;let h=r.at(-1);h?.type==="text"?(h.raw+=l.raw,h.text+=l.text):r.push(l);continue}if(e){let h="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(h);break}else throw new Error(h)}}return r}},mv=class{options;parser;constructor(e){this.options=e||Nu}space(e){return""}code({text:e,lang:r,escaped:n}){let i=(r||"").match($i.notSpaceStart)?.[0],a=e.replace($i.endingNewline,"")+`
`;return i?'<pre><code class="language-'+Ms(i)+'">'+(n?a:Ms(a,!0))+`</code></pre>
`:"<pre><code>"+(n?a:Ms(a,!0))+`</code></pre>
`}blockquote({tokens:e}){return`<blockquote>
${this.parser.parse(e)}</blockquote>
`}html({text:e}){return e}def(e){return""}heading({tokens:e,depth:r}){return`<h${r}>${this.parser.parseInline(e)}</h${r}>
`}hr(e){return`<hr>
`}list(e){let r=e.ordered,n=e.start,i="";for(let o=0;o<e.items.length;o++){let l=e.items[o];i+=this.listitem(l)}let a=r?"ol":"ul",s=r&&n!==1?' start="'+n+'"':"";return"<"+a+s+`>
`+i+"</"+a+`>
`}listitem(e){let r="";if(e.task){let n=this.checkbox({checked:!!e.checked});e.loose?e.tokens[0]?.type==="paragraph"?(e.tokens[0].text=n+" "+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&e.tokens[0].tokens[0].type==="text"&&(e.tokens[0].tokens[0].text=n+" "+Ms(e.tokens[0].tokens[0].text),e.tokens[0].tokens[0].escaped=!0)):e.tokens.unshift({type:"text",raw:n+" ",text:n+" ",escaped:!0}):r+=n+" "}return r+=this.parser.parse(e.tokens,!!e.loose),`<li>${r}</li>
`}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
`}table(e){let r="",n="";for(let a=0;a<e.header.length;a++)n+=this.tablecell(e.header[a]);r+=this.tablerow({text:n});let i="";for(let a=0;a<e.rows.length;a++){let s=e.rows[a];n="";for(let o=0;o<s.length;o++)n+=this.tablecell(s[o]);i+=this.tablerow({text:n})}return i&&(i=`<tbody>${i}</tbody>`),`<table>
<thead>
`+r+`</thead>
`+i+`</table>
`}tablerow({text:e}){return`<tr>
${e}</tr>
`}tablecell(e){let r=this.parser.parseInline(e.tokens),n=e.header?"th":"td";return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+r+`</${n}>
`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${Ms(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:r,tokens:n}){let i=this.parser.parseInline(n),a=Q7(e);if(a===null)return i;e=a;let s='<a href="'+e+'"';return r&&(s+=' title="'+Ms(r)+'"'),s+=">"+i+"</a>",s}image({href:e,title:r,text:n,tokens:i}){i&&(n=this.parser.parseInline(i,this.parser.textRenderer));let a=Q7(e);if(a===null)return Ms(n);e=a;let s=`<img src="${e}" alt="${n}"`;return r&&(s+=` title="${Ms(r)}"`),s+=">",s}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:Ms(e.text)}},W6=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}},hs=class L5{options;renderer;textRenderer;constructor(e){this.options=e||Nu,this.options.renderer=this.options.renderer||new mv,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new W6}static parse(e,r){return new L5(r).parse(e)}static parseInline(e,r){return new L5(r).parseInline(e)}parse(e,r=!0){let n="";for(let i=0;i<e.length;i++){let a=e[i];if(this.options.extensions?.renderers?.[a.type]){let o=a,l=this.options.extensions.renderers[o.type].call({parser:this},o);if(l!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(o.type)){n+=l||"";continue}}let s=a;switch(s.type){case"space":{n+=this.renderer.space(s);continue}case"hr":{n+=this.renderer.hr(s);continue}case"heading":{n+=this.renderer.heading(s);continue}case"code":{n+=this.renderer.code(s);continue}case"table":{n+=this.renderer.table(s);continue}case"blockquote":{n+=this.renderer.blockquote(s);continue}case"list":{n+=this.renderer.list(s);continue}case"html":{n+=this.renderer.html(s);continue}case"def":{n+=this.renderer.def(s);continue}case"paragraph":{n+=this.renderer.paragraph(s);continue}case"text":{let o=s,l=this.renderer.text(o);for(;i+1<e.length&&e[i+1].type==="text";)o=e[++i],l+=`
`+this.renderer.text(o);r?n+=this.renderer.paragraph({type:"paragraph",raw:l,text:l,tokens:[{type:"text",raw:l,text:l,escaped:!0}]}):n+=l;continue}default:{let o='Token with "'+s.type+'" type was not found.';if(this.options.silent)return console.error(o),"";throw new Error(o)}}}return n}parseInline(e,r=this.renderer){let n="";for(let i=0;i<e.length;i++){let a=e[i];if(this.options.extensions?.renderers?.[a.type]){let o=this.options.extensions.renderers[a.type].call({parser:this},a);if(o!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(a.type)){n+=o||"";continue}}let s=a;switch(s.type){case"escape":{n+=r.text(s);break}case"html":{n+=r.html(s);break}case"link":{n+=r.link(s);break}case"image":{n+=r.image(s);break}case"strong":{n+=r.strong(s);break}case"em":{n+=r.em(s);break}case"codespan":{n+=r.codespan(s);break}case"br":{n+=r.br(s);break}case"del":{n+=r.del(s);break}case"text":{n+=r.text(s);break}default:{let o='Token with "'+s.type+'" type was not found.';if(this.options.silent)return console.error(o),"";throw new Error(o)}}}return n}},wf=class{options;block;constructor(e){this.options=e||Nu}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(){return this.block?us.lex:us.lexInline}provideParser(){return this.block?hs.parse:hs.parseInline}},Aae=class{defaults=P6();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=hs;Renderer=mv;TextRenderer=W6;Lexer=us;Tokenizer=gv;Hooks=wf;constructor(...e){this.use(...e)}walkTokens(e,r){let n=[];for(let i of e)switch(n=n.concat(r.call(this,i)),i.type){case"table":{let a=i;for(let s of a.header)n=n.concat(this.walkTokens(s.tokens,r));for(let s of a.rows)for(let o of s)n=n.concat(this.walkTokens(o.tokens,r));break}case"list":{let a=i;n=n.concat(this.walkTokens(a.items,r));break}default:{let a=i;this.defaults.extensions?.childTokens?.[a.type]?this.defaults.extensions.childTokens[a.type].forEach(s=>{let o=a[s].flat(1/0);n=n.concat(this.walkTokens(o,r))}):a.tokens&&(n=n.concat(this.walkTokens(a.tokens,r)))}}return n}use(...e){let r=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(n=>{let i={...n};if(i.async=this.defaults.async||i.async||!1,n.extensions&&(n.extensions.forEach(a=>{if(!a.name)throw new Error("extension name required");if("renderer"in a){let s=r.renderers[a.name];s?r.renderers[a.name]=function(...o){let l=a.renderer.apply(this,o);return l===!1&&(l=s.apply(this,o)),l}:r.renderers[a.name]=a.renderer}if("tokenizer"in a){if(!a.level||a.level!=="block"&&a.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let s=r[a.level];s?s.unshift(a.tokenizer):r[a.level]=[a.tokenizer],a.start&&(a.level==="block"?r.startBlock?r.startBlock.push(a.start):r.startBlock=[a.start]:a.level==="inline"&&(r.startInline?r.startInline.push(a.start):r.startInline=[a.start]))}"childTokens"in a&&a.childTokens&&(r.childTokens[a.name]=a.childTokens)}),i.extensions=r),n.renderer){let a=this.defaults.renderer||new mv(this.defaults);for(let s in n.renderer){if(!(s in a))throw new Error(`renderer '${s}' does not exist`);if(["options","parser"].includes(s))continue;let o=s,l=n.renderer[o],u=a[o];a[o]=(...h)=>{let d=l.apply(a,h);return d===!1&&(d=u.apply(a,h)),d||""}}i.renderer=a}if(n.tokenizer){let a=this.defaults.tokenizer||new gv(this.defaults);for(let s in n.tokenizer){if(!(s in a))throw new Error(`tokenizer '${s}' does not exist`);if(["options","rules","lexer"].includes(s))continue;let o=s,l=n.tokenizer[o],u=a[o];a[o]=(...h)=>{let d=l.apply(a,h);return d===!1&&(d=u.apply(a,h)),d}}i.tokenizer=a}if(n.hooks){let a=this.defaults.hooks||new wf;for(let s in n.hooks){if(!(s in a))throw new Error(`hook '${s}' does not exist`);if(["options","block"].includes(s))continue;let o=s,l=n.hooks[o],u=a[o];wf.passThroughHooks.has(s)?a[o]=h=>{if(this.defaults.async&&wf.passThroughHooksRespectAsync.has(s))return(async()=>{let f=await l.call(a,h);return u.call(a,f)})();let d=l.call(a,h);return u.call(a,d)}:a[o]=(...h)=>{if(this.defaults.async)return(async()=>{let f=await l.apply(a,h);return f===!1&&(f=await u.apply(a,h)),f})();let d=l.apply(a,h);return d===!1&&(d=u.apply(a,h)),d}}i.hooks=a}if(n.walkTokens){let a=this.defaults.walkTokens,s=n.walkTokens;i.walkTokens=function(o){let l=[];return l.push(s.call(this,o)),a&&(l=l.concat(a.call(this,o))),l}}this.defaults={...this.defaults,...i}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,r){return us.lex(e,r??this.defaults)}parser(e,r){return hs.parse(e,r??this.defaults)}parseMarkdown(e){return(r,n)=>{let i={...n},a={...this.defaults,...i},s=this.onError(!!a.silent,!!a.async);if(this.defaults.async===!0&&i.async===!1)return s(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 s(new Error("marked(): input parameter is undefined or null"));if(typeof r!="string")return s(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(r)+", string expected"));if(a.hooks&&(a.hooks.options=a,a.hooks.block=e),a.async)return(async()=>{let o=a.hooks?await a.hooks.preprocess(r):r,l=await(a.hooks?await a.hooks.provideLexer():e?us.lex:us.lexInline)(o,a),u=a.hooks?await a.hooks.processAllTokens(l):l;a.walkTokens&&await Promise.all(this.walkTokens(u,a.walkTokens));let h=await(a.hooks?await a.hooks.provideParser():e?hs.parse:hs.parseInline)(u,a);return a.hooks?await a.hooks.postprocess(h):h})().catch(s);try{a.hooks&&(r=a.hooks.preprocess(r));let o=(a.hooks?a.hooks.provideLexer():e?us.lex:us.lexInline)(r,a);a.hooks&&(o=a.hooks.processAllTokens(o)),a.walkTokens&&this.walkTokens(o,a.walkTokens);let l=(a.hooks?a.hooks.provideParser():e?hs.parse:hs.parseInline)(o,a);return a.hooks&&(l=a.hooks.postprocess(l)),l}catch(o){return s(o)}}}onError(e,r){return n=>{if(n.message+=`
Please report this to https://github.com/markedjs/marked.`,e){let i="<p>An error occurred:</p><pre>"+Ms(n.message+"",!0)+"</pre>";return r?Promise.resolve(i):i}if(r)return Promise.reject(n);throw n}}},lu=new Aae;function Lr(t,e){return lu.parse(t,e)}Lr.options=Lr.setOptions=function(t){return lu.setOptions(t),Lr.defaults=lu.defaults,sO(Lr.defaults),Lr};Lr.getDefaults=P6;Lr.defaults=Nu;Lr.use=function(...t){return lu.use(...t),Lr.defaults=lu.defaults,sO(Lr.defaults),Lr};Lr.walkTokens=function(t,e){return lu.walkTokens(t,e)};Lr.parseInline=lu.parseInline;Lr.Parser=hs;Lr.parser=hs.parse;Lr.Renderer=mv;Lr.TextRenderer=W6;Lr.Lexer=us;Lr.lexer=us.lex;Lr.Tokenizer=gv;Lr.Hooks=wf;Lr.parse=Lr;Lr.options;Lr.setOptions;Lr.use;Lr.walkTokens;Lr.parseInline;hs.parse;us.lex;function vO(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];var n=Array.from(typeof t=="string"?[t]:t);n[n.length-1]=n[n.length-1].replace(/\r?\n([\t ]*)$/,"");var i=n.reduce(function(o,l){var u=l.match(/\n([\t ]+|(?!\s).)/g);return u?o.concat(u.map(function(h){var d,f;return(f=(d=h.match(/[\t ]/g))===null||d===void 0?void 0:d.length)!==null&&f!==void 0?f:0})):o},[]);if(i.length){var a=new RegExp(`
[	 ]{`+Math.min.apply(Math,i)+"}","g");n=n.map(function(o){return o.replace(a,`
`)})}n[0]=n[0].replace(/^\r?\n/,"");var s=n[0];return e.forEach(function(o,l){var u=s.match(/(?:^|\n)( *)$/),h=u?u[1]:"",d=o;typeof o=="string"&&o.includes(`
`)&&(d=String(o).split(`
`).map(function(f,p){return p===0?f:""+h+f}).join(`
`)),s+=d+n[l+1]}),s}var yO={body:'<g><rect width="80" height="80" style="fill: #087ebf; stroke-width: 0px;"/><text transform="translate(21.16 64.67)" style="fill: #fff; font-family: ArialMT, Arial; font-size: 67.75px;"><tspan x="0" y="0">?</tspan></text></g>',height:80,width:80},R5=new Map,xO=new Map,bO=x(t=>{for(const e of t){if(!e.name)throw new Error('Invalid icon loader. Must have a "name" property with non-empty string value.');if(ie.debug("Registering icon pack:",e.name),"loader"in e)xO.set(e.name,e.loader);else if("icons"in e)R5.set(e.name,e.icons);else throw ie.error("Invalid icon loader:",e),new Error('Invalid icon loader. Must have either "icons" or "loader" property.')}},"registerIconPacks"),wO=x(async(t,e)=>{const r=Rie(t,!0,e!==void 0);if(!r)throw new Error(`Invalid icon name: ${t}`);const n=r.prefix||e;if(!n)throw new Error(`Icon name must contain a prefix: ${t}`);let i=R5.get(n);if(!i){const s=xO.get(n);if(!s)throw new Error(`Icon set not found: ${r.prefix}`);try{i={...await s(),prefix:n},R5.set(n,i)}catch(o){throw ie.error(o),new Error(`Failed to load icon set: ${r.prefix}`)}}const a=Mie(i,r.name);if(!a)throw new Error(`Icon not found: ${t}`);return a},"getRegisteredIconData"),_ae=x(async t=>{try{return await wO(t),!0}catch{return!1}},"isIconAvailable"),Ol=x(async(t,e,r)=>{let n;try{n=await wO(t,e?.fallbackPrefix)}catch(s){ie.error(s),n=yO}const i=zie(n,e),a=Wie(Uie(i.body),{...i.attributes,...r});return fr(a,gr())},"getIconSVG");function TO(t,{markdownAutoWrap:e}){const n=t.replace(/<br\/>/g,`
`).replace(/\n{2,}/g,`
`),i=vO(n);return e===!1?i.replace(/ /g,"&nbsp;"):i}x(TO,"preprocessMarkdown");function EO(t,e={}){const r=TO(t,e),n=Lr.lexer(r),i=[[]];let a=0;function s(o,l="normal"){o.type==="text"?o.text.split(`
`).forEach((h,d)=>{d!==0&&(a++,i.push([])),h.split(" ").forEach(f=>{f=f.replace(/&#39;/g,"'"),f&&i[a].push({content:f,type:l})})}):o.type==="strong"||o.type==="em"?o.tokens.forEach(u=>{s(u,o.type)}):o.type==="html"&&i[a].push({content:o.text,type:"normal"})}return x(s,"processNode"),n.forEach(o=>{o.type==="paragraph"?o.tokens?.forEach(l=>{s(l)}):o.type==="html"?i[a].push({content:o.text,type:"normal"}):i[a].push({content:o.raw,type:"normal"})}),i}x(EO,"markdownToLines");function kO(t,{markdownAutoWrap:e}={}){const r=Lr.lexer(t);function n(i){return i.type==="text"?e===!1?i.text.replace(/\n */g,"<br/>").replace(/ /g,"&nbsp;"):i.text.replace(/\n */g,"<br/>"):i.type==="strong"?`<strong>${i.tokens?.map(n).join("")}</strong>`:i.type==="em"?`<em>${i.tokens?.map(n).join("")}</em>`:i.type==="paragraph"?`<p>${i.tokens?.map(n).join("")}</p>`:i.type==="space"?"":i.type==="html"?`${i.text}`:i.type==="escape"?i.text:(ie.warn(`Unsupported markdown: ${i.type}`),i.raw)}return x(n,"output"),r.map(n).join("")}x(kO,"markdownToHTML");function SO(t){return Intl.Segmenter?[...new Intl.Segmenter().segment(t)].map(e=>e.segment):[...t]}x(SO,"splitTextToChars");function CO(t,e){const r=SO(e.content);return H6(t,[],r,e.type)}x(CO,"splitWordToFitWidth");function H6(t,e,r,n){if(r.length===0)return[{content:e.join(""),type:n},{content:"",type:n}];const[i,...a]=r,s=[...e,i];return t([{content:s.join(""),type:n}])?H6(t,s,a,n):(e.length===0&&i&&(e.push(i),r.shift()),[{content:e.join(""),type:n},{content:r.join(""),type:n}])}x(H6,"splitWordToFitWidthRecursion");function AO(t,e){if(t.some(({content:r})=>r.includes(`
`)))throw new Error("splitLineToFitWidth does not support newlines in the line");return vv(t,e)}x(AO,"splitLineToFitWidth");function vv(t,e,r=[],n=[]){if(t.length===0)return n.length>0&&r.push(n),r.length>0?r:[];let i="";t[0].content===" "&&(i=" ",t.shift());const a=t.shift()??{content:" ",type:"normal"},s=[...n];if(i!==""&&s.push({content:i,type:"normal"}),s.push(a),e(s))return vv(t,e,r,s);if(n.length>0)r.push(n),t.unshift(a);else if(a.content){const[o,l]=CO(e,a);r.push([o]),l.content&&t.unshift(l)}return vv(t,e,r)}x(vv,"splitLineToFitWidthRecursion");function N5(t,e){e&&t.attr("style",e)}x(N5,"applyStyle");async function _O(t,e,r,n,i=!1,a=gr()){const s=t.append("foreignObject");s.attr("width",`${10*r}px`),s.attr("height",`${10*r}px`);const o=s.append("xhtml:div"),l=un(e.label)?await Ap(e.label.replace(at.lineBreakRegex,`
`),a):fr(e.label,a),u=e.isNode?"nodeLabel":"edgeLabel",h=o.append("span");h.html(l),N5(h,e.labelStyle),h.attr("class",`${u} ${n}`),N5(o,e.labelStyle),o.style("display","table-cell"),o.style("white-space","nowrap"),o.style("line-height","1.5"),o.style("max-width",r+"px"),o.style("text-align","center"),o.attr("xmlns","http://www.w3.org/1999/xhtml"),i&&o.attr("class","labelBkg");let d=o.node().getBoundingClientRect();return d.width===r&&(o.style("display","table"),o.style("white-space","break-spaces"),o.style("width",r+"px"),d=o.node().getBoundingClientRect()),s.node()}x(_O,"addHtmlSpan");function n2(t,e,r){return t.append("tspan").attr("class","text-outer-tspan").attr("x",0).attr("y",e*r-.1+"em").attr("dy",r+"em")}x(n2,"createTspan");function LO(t,e,r){const n=t.append("text"),i=n2(n,1,e);i2(i,r);const a=i.node().getComputedTextLength();return n.remove(),a}x(LO,"computeWidthOfText");function RO(t,e,r){const n=t.append("text"),i=n2(n,1,e);i2(i,[{content:r,type:"normal"}]);const a=i.node()?.getBoundingClientRect();return a&&n.remove(),a}x(RO,"computeDimensionOfText");function NO(t,e,r,n=!1){const a=e.append("g"),s=a.insert("rect").attr("class","background").attr("style","stroke: none"),o=a.append("text").attr("y","-10.1");let l=0;for(const u of r){const h=x(f=>LO(a,1.1,f)<=t,"checkWidth"),d=h(u)?[u]:AO(u,h);for(const f of d){const p=n2(o,l,1.1);i2(p,f),l++}}if(n){const u=o.node().getBBox(),h=2;return s.attr("x",u.x-h).attr("y",u.y-h).attr("width",u.width+2*h).attr("height",u.height+2*h),a.node()}else return o.node()}x(NO,"createFormattedText");function i2(t,e){t.text(""),e.forEach((r,n)=>{const i=t.append("tspan").attr("font-style",r.type==="em"?"italic":"normal").attr("class","text-inner-tspan").attr("font-weight",r.type==="strong"?"bold":"normal");n===0?i.text(r.content):i.text(" "+r.content)})}x(i2,"updateTextContentAndStyles");async function q6(t,e={}){const r=[];t.replace(/(fa[bklrs]?):fa-([\w-]+)/g,(i,a,s)=>(r.push((async()=>{const o=`${a}:${s}`;return await _ae(o)?await Ol(o,void 0,{class:"label-icon"}):`<i class='${fr(i,e).replace(":"," ")}'></i>`})()),i));const n=await Promise.all(r);return t.replace(/(fa[bklrs]?):fa-([\w-]+)/g,()=>n.shift()??"")}x(q6,"replaceIconSubstring");var Ra=x(async(t,e="",{style:r="",isTitle:n=!1,classes:i="",useHtmlLabels:a=!0,isNode:s=!0,width:o=200,addSvgBackground:l=!1}={},u)=>{if(ie.debug("XYZ createText",e,r,n,i,a,s,"addSvgBackground: ",l),a){const h=kO(e,u),d=await q6(Ks(h),u),f=e.replace(/\\\\/g,"\\"),p={isNode:s,label:un(e)?f:d,labelStyle:r.replace("fill:","color:")};return await _O(t,p,o,i,l,u)}else{const h=e.replace(/<br\s*\/?>/g,"<br/>"),d=EO(h.replace("<br>","<br/>"),u),f=NO(o,t,d,e?l:!1);if(s){/stroke:/.exec(r)&&(r=r.replace("stroke:","lineColor:"));const p=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");Qe(f).attr("style",p)}else{const p=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/background:/g,"fill:");Qe(f).select("rect").attr("style",p.replace(/background:/g,"fill:"));const g=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");Qe(f).select("text").attr("style",g)}return f}},"createText");function Xx(t,e,r){if(t&&t.length){const[n,i]=e,a=Math.PI/180*r,s=Math.cos(a),o=Math.sin(a);for(const l of t){const[u,h]=l;l[0]=(u-n)*s-(h-i)*o+n,l[1]=(u-n)*o+(h-i)*s+i}}}function Lae(t,e){return t[0]===e[0]&&t[1]===e[1]}function Rae(t,e,r,n=1){const i=r,a=Math.max(e,.1),s=t[0]&&t[0][0]&&typeof t[0][0]=="number"?[t]:t,o=[0,0];if(i)for(const u of s)Xx(u,o,i);const l=function(u,h,d){const f=[];for(const b of u){const w=[...b];Lae(w[0],w[w.length-1])||w.push([w[0][0],w[0][1]]),w.length>2&&f.push(w)}const p=[];h=Math.max(h,.1);const g=[];for(const b of f)for(let w=0;w<b.length-1;w++){const T=b[w],E=b[w+1];if(T[1]!==E[1]){const L=Math.min(T[1],E[1]);g.push({ymin:L,ymax:Math.max(T[1],E[1]),x:L===T[1]?T[0]:E[0],islope:(E[0]-T[0])/(E[1]-T[1])})}}if(g.sort((b,w)=>b.ymin<w.ymin?-1:b.ymin>w.ymin?1:b.x<w.x?-1:b.x>w.x?1:b.ymax===w.ymax?0:(b.ymax-w.ymax)/Math.abs(b.ymax-w.ymax)),!g.length)return p;let m=[],v=g[0].ymin,y=0;for(;m.length||g.length;){if(g.length){let b=-1;for(let w=0;w<g.length&&!(g[w].ymin>v);w++)b=w;g.splice(0,b+1).forEach(w=>{m.push({s:v,edge:w})})}if(m=m.filter(b=>!(b.edge.ymax<=v)),m.sort((b,w)=>b.edge.x===w.edge.x?0:(b.edge.x-w.edge.x)/Math.abs(b.edge.x-w.edge.x)),(d!==1||y%h==0)&&m.length>1)for(let b=0;b<m.length;b+=2){const w=b+1;if(w>=m.length)break;const T=m[b].edge,E=m[w].edge;p.push([[Math.round(T.x),v],[Math.round(E.x),v]])}v+=d,m.forEach(b=>{b.edge.x=b.edge.x+d*b.edge.islope}),y++}return p}(s,a,n);if(i){for(const u of s)Xx(u,o,-i);(function(u,h,d){const f=[];u.forEach(p=>f.push(...p)),Xx(f,h,d)})(l,o,-i)}return l}function zp(t,e){var r;const n=e.hachureAngle+90;let i=e.hachureGap;i<0&&(i=4*e.strokeWidth),i=Math.round(Math.max(i,.1));let a=1;return e.roughness>=1&&(((r=e.randomizer)===null||r===void 0?void 0:r.next())||Math.random())>.7&&(a=i),Rae(t,i,n,a||1)}class Y6{constructor(e){this.helper=e}fillPolygons(e,r){return this._fillPolygons(e,r)}_fillPolygons(e,r){const n=zp(e,r);return{type:"fillSketch",ops:this.renderLines(n,r)}}renderLines(e,r){const n=[];for(const i of e)n.push(...this.helper.doubleLineOps(i[0][0],i[0][1],i[1][0],i[1][1],r));return n}}function a2(t){const e=t[0],r=t[1];return Math.sqrt(Math.pow(e[0]-r[0],2)+Math.pow(e[1]-r[1],2))}class Nae extends Y6{fillPolygons(e,r){let n=r.hachureGap;n<0&&(n=4*r.strokeWidth),n=Math.max(n,.1);const i=zp(e,Object.assign({},r,{hachureGap:n})),a=Math.PI/180*r.hachureAngle,s=[],o=.5*n*Math.cos(a),l=.5*n*Math.sin(a);for(const[u,h]of i)a2([u,h])&&s.push([[u[0]-o,u[1]+l],[...h]],[[u[0]+o,u[1]-l],[...h]]);return{type:"fillSketch",ops:this.renderLines(s,r)}}}class Dae extends Y6{fillPolygons(e,r){const n=this._fillPolygons(e,r),i=Object.assign({},r,{hachureAngle:r.hachureAngle+90}),a=this._fillPolygons(e,i);return n.ops=n.ops.concat(a.ops),n}}let Mae=class{constructor(e){this.helper=e}fillPolygons(e,r){const n=zp(e,r=Object.assign({},r,{hachureAngle:0}));return this.dotsOnLines(n,r)}dotsOnLines(e,r){const n=[];let i=r.hachureGap;i<0&&(i=4*r.strokeWidth),i=Math.max(i,.1);let a=r.fillWeight;a<0&&(a=r.strokeWidth/2);const s=i/4;for(const o of e){const l=a2(o),u=l/i,h=Math.ceil(u)-1,d=l-h*i,f=(o[0][0]+o[1][0])/2-i/4,p=Math.min(o[0][1],o[1][1]);for(let g=0;g<h;g++){const m=p+d+g*i,v=f-s+2*Math.random()*s,y=m-s+2*Math.random()*s,b=this.helper.ellipse(v,y,a,a,r);n.push(...b.ops)}}return{type:"fillSketch",ops:n}}},Iae=class{constructor(e){this.helper=e}fillPolygons(e,r){const n=zp(e,r);return{type:"fillSketch",ops:this.dashedLine(n,r)}}dashedLine(e,r){const n=r.dashOffset<0?r.hachureGap<0?4*r.strokeWidth:r.hachureGap:r.dashOffset,i=r.dashGap<0?r.hachureGap<0?4*r.strokeWidth:r.hachureGap:r.dashGap,a=[];return e.forEach(s=>{const o=a2(s),l=Math.floor(o/(n+i)),u=(o+i-l*(n+i))/2;let h=s[0],d=s[1];h[0]>d[0]&&(h=s[1],d=s[0]);const f=Math.atan((d[1]-h[1])/(d[0]-h[0]));for(let p=0;p<l;p++){const g=p*(n+i),m=g+n,v=[h[0]+g*Math.cos(f)+u*Math.cos(f),h[1]+g*Math.sin(f)+u*Math.sin(f)],y=[h[0]+m*Math.cos(f)+u*Math.cos(f),h[1]+m*Math.sin(f)+u*Math.sin(f)];a.push(...this.helper.doubleLineOps(v[0],v[1],y[0],y[1],r))}}),a}};class Oae{constructor(e){this.helper=e}fillPolygons(e,r){const n=r.hachureGap<0?4*r.strokeWidth:r.hachureGap,i=r.zigzagOffset<0?n:r.zigzagOffset,a=zp(e,r=Object.assign({},r,{hachureGap:n+i}));return{type:"fillSketch",ops:this.zigzagLines(a,i,r)}}zigzagLines(e,r,n){const i=[];return e.forEach(a=>{const s=a2(a),o=Math.round(s/(2*r));let l=a[0],u=a[1];l[0]>u[0]&&(l=a[1],u=a[0]);const h=Math.atan((u[1]-l[1])/(u[0]-l[0]));for(let d=0;d<o;d++){const f=2*d*r,p=2*(d+1)*r,g=Math.sqrt(2*Math.pow(r,2)),m=[l[0]+f*Math.cos(h),l[1]+f*Math.sin(h)],v=[l[0]+p*Math.cos(h),l[1]+p*Math.sin(h)],y=[m[0]+g*Math.cos(h+Math.PI/4),m[1]+g*Math.sin(h+Math.PI/4)];i.push(...this.helper.doubleLineOps(m[0],m[1],y[0],y[1],n),...this.helper.doubleLineOps(y[0],y[1],v[0],v[1],n))}}),i}}const ea={};let Pae=class{constructor(e){this.seed=e}next(){return this.seed?(2**31-1&(this.seed=Math.imul(48271,this.seed)))/2**31:Math.random()}};const Bae=0,jx=1,tC=2,Mg={A:7,a:7,C:6,c:6,H:1,h:1,L:2,l:2,M:2,m:2,Q:4,q:4,S:4,s:4,T:2,t:2,V:1,v:1,Z:0,z:0};function Kx(t,e){return t.type===e}function X6(t){const e=[],r=function(s){const o=new Array;for(;s!=="";)if(s.match(/^([ \t\r\n,]+)/))s=s.substr(RegExp.$1.length);else if(s.match(/^([aAcChHlLmMqQsStTvVzZ])/))o[o.length]={type:Bae,text:RegExp.$1},s=s.substr(RegExp.$1.length);else{if(!s.match(/^(([-+]?[0-9]+(\.[0-9]*)?|[-+]?\.[0-9]+)([eE][-+]?[0-9]+)?)/))return[];o[o.length]={type:jx,text:`${parseFloat(RegExp.$1)}`},s=s.substr(RegExp.$1.length)}return o[o.length]={type:tC,text:""},o}(t);let n="BOD",i=0,a=r[i];for(;!Kx(a,tC);){let s=0;const o=[];if(n==="BOD"){if(a.text!=="M"&&a.text!=="m")return X6("M0,0"+t);i++,s=Mg[a.text],n=a.text}else Kx(a,jx)?s=Mg[n]:(i++,s=Mg[a.text],n=a.text);if(!(i+s<r.length))throw new Error("Path data ended short");for(let l=i;l<i+s;l++){const u=r[l];if(!Kx(u,jx))throw new Error("Param not a number: "+n+","+u.text);o[o.length]=+u.text}if(typeof Mg[n]!="number")throw new Error("Bad segment: "+n);{const l={key:n,data:o};e.push(l),i+=s,a=r[i],n==="M"&&(n="L"),n==="m"&&(n="l")}}return e}function DO(t){let e=0,r=0,n=0,i=0;const a=[];for(const{key:s,data:o}of t)switch(s){case"M":a.push({key:"M",data:[...o]}),[e,r]=o,[n,i]=o;break;case"m":e+=o[0],r+=o[1],a.push({key:"M",data:[e,r]}),n=e,i=r;break;case"L":a.push({key:"L",data:[...o]}),[e,r]=o;break;case"l":e+=o[0],r+=o[1],a.push({key:"L",data:[e,r]});break;case"C":a.push({key:"C",data:[...o]}),e=o[4],r=o[5];break;case"c":{const l=o.map((u,h)=>h%2?u+r:u+e);a.push({key:"C",data:l}),e=l[4],r=l[5];break}case"Q":a.push({key:"Q",data:[...o]}),e=o[2],r=o[3];break;case"q":{const l=o.map((u,h)=>h%2?u+r:u+e);a.push({key:"Q",data:l}),e=l[2],r=l[3];break}case"A":a.push({key:"A",data:[...o]}),e=o[5],r=o[6];break;case"a":e+=o[5],r+=o[6],a.push({key:"A",data:[o[0],o[1],o[2],o[3],o[4],e,r]});break;case"H":a.push({key:"H",data:[...o]}),e=o[0];break;case"h":e+=o[0],a.push({key:"H",data:[e]});break;case"V":a.push({key:"V",data:[...o]}),r=o[0];break;case"v":r+=o[0],a.push({key:"V",data:[r]});break;case"S":a.push({key:"S",data:[...o]}),e=o[2],r=o[3];break;case"s":{const l=o.map((u,h)=>h%2?u+r:u+e);a.push({key:"S",data:l}),e=l[2],r=l[3];break}case"T":a.push({key:"T",data:[...o]}),e=o[0],r=o[1];break;case"t":e+=o[0],r+=o[1],a.push({key:"T",data:[e,r]});break;case"Z":case"z":a.push({key:"Z",data:[]}),e=n,r=i}return a}function MO(t){const e=[];let r="",n=0,i=0,a=0,s=0,o=0,l=0;for(const{key:u,data:h}of t){switch(u){case"M":e.push({key:"M",data:[...h]}),[n,i]=h,[a,s]=h;break;case"C":e.push({key:"C",data:[...h]}),n=h[4],i=h[5],o=h[2],l=h[3];break;case"L":e.push({key:"L",data:[...h]}),[n,i]=h;break;case"H":n=h[0],e.push({key:"L",data:[n,i]});break;case"V":i=h[0],e.push({key:"L",data:[n,i]});break;case"S":{let d=0,f=0;r==="C"||r==="S"?(d=n+(n-o),f=i+(i-l)):(d=n,f=i),e.push({key:"C",data:[d,f,...h]}),o=h[0],l=h[1],n=h[2],i=h[3];break}case"T":{const[d,f]=h;let p=0,g=0;r==="Q"||r==="T"?(p=n+(n-o),g=i+(i-l)):(p=n,g=i);const m=n+2*(p-n)/3,v=i+2*(g-i)/3,y=d+2*(p-d)/3,b=f+2*(g-f)/3;e.push({key:"C",data:[m,v,y,b,d,f]}),o=p,l=g,n=d,i=f;break}case"Q":{const[d,f,p,g]=h,m=n+2*(d-n)/3,v=i+2*(f-i)/3,y=p+2*(d-p)/3,b=g+2*(f-g)/3;e.push({key:"C",data:[m,v,y,b,p,g]}),o=d,l=f,n=p,i=g;break}case"A":{const d=Math.abs(h[0]),f=Math.abs(h[1]),p=h[2],g=h[3],m=h[4],v=h[5],y=h[6];d===0||f===0?(e.push({key:"C",data:[n,i,v,y,v,y]}),n=v,i=y):(n!==v||i!==y)&&(IO(n,i,v,y,d,f,p,g,m).forEach(function(b){e.push({key:"C",data:b})}),n=v,i=y);break}case"Z":e.push({key:"Z",data:[]}),n=a,i=s}r=u}return e}function tf(t,e,r){return[t*Math.cos(r)-e*Math.sin(r),t*Math.sin(r)+e*Math.cos(r)]}function IO(t,e,r,n,i,a,s,o,l,u){const h=(d=s,Math.PI*d/180);var d;let f=[],p=0,g=0,m=0,v=0;if(u)[p,g,m,v]=u;else{[t,e]=tf(t,e,-h),[r,n]=tf(r,n,-h);const P=(t-r)/2,k=(e-n)/2;let R=P*P/(i*i)+k*k/(a*a);R>1&&(R=Math.sqrt(R),i*=R,a*=R);const I=i*i,M=a*a,D=I*M-I*k*k-M*P*P,B=I*k*k+M*P*P,$=(o===l?-1:1)*Math.sqrt(Math.abs(D/B));m=$*i*k/a+(t+r)/2,v=$*-a*P/i+(e+n)/2,p=Math.asin(parseFloat(((e-v)/a).toFixed(9))),g=Math.asin(parseFloat(((n-v)/a).toFixed(9))),t<m&&(p=Math.PI-p),r<m&&(g=Math.PI-g),p<0&&(p=2*Math.PI+p),g<0&&(g=2*Math.PI+g),l&&p>g&&(p-=2*Math.PI),!l&&g>p&&(g-=2*Math.PI)}let y=g-p;if(Math.abs(y)>120*Math.PI/180){const P=g,k=r,R=n;g=l&&g>p?p+120*Math.PI/180*1:p+120*Math.PI/180*-1,f=IO(r=m+i*Math.cos(g),n=v+a*Math.sin(g),k,R,i,a,s,0,l,[g,P,m,v])}y=g-p;const b=Math.cos(p),w=Math.sin(p),T=Math.cos(g),E=Math.sin(g),L=Math.tan(y/4),S=4/3*i*L,C=4/3*a*L,A=[t,e],N=[t+S*w,e-C*b],_=[r+S*E,n-C*T],O=[r,n];if(N[0]=2*A[0]-N[0],N[1]=2*A[1]-N[1],u)return[N,_,O].concat(f);{f=[N,_,O].concat(f);const P=[];for(let k=0;k<f.length;k+=3){const R=tf(f[k][0],f[k][1],h),I=tf(f[k+1][0],f[k+1][1],h),M=tf(f[k+2][0],f[k+2][1],h);P.push([R[0],R[1],I[0],I[1],M[0],M[1]])}return P}}const Fae={randOffset:function(t,e){return Ht(t,e)},randOffsetWithRange:function(t,e,r){return yv(t,e,r)},ellipse:function(t,e,r,n,i){const a=PO(r,n,i);return D5(t,e,i,a).opset},doubleLineOps:function(t,e,r,n,i){return Pl(t,e,r,n,i,!0)}};function OO(t,e,r,n,i){return{type:"path",ops:Pl(t,e,r,n,i)}}function q1(t,e,r){const n=(t||[]).length;if(n>2){const i=[];for(let a=0;a<n-1;a++)i.push(...Pl(t[a][0],t[a][1],t[a+1][0],t[a+1][1],r));return e&&i.push(...Pl(t[n-1][0],t[n-1][1],t[0][0],t[0][1],r)),{type:"path",ops:i}}return n===2?OO(t[0][0],t[0][1],t[1][0],t[1][1],r):{type:"path",ops:[]}}function $ae(t,e,r,n,i){return function(a,s){return q1(a,!0,s)}([[t,e],[t+r,e],[t+r,e+n],[t,e+n]],i)}function rC(t,e){if(t.length){const r=typeof t[0][0]=="number"?[t]:t,n=Ig(r[0],1*(1+.2*e.roughness),e),i=e.disableMultiStroke?[]:Ig(r[0],1.5*(1+.22*e.roughness),aC(e));for(let a=1;a<r.length;a++){const s=r[a];if(s.length){const o=Ig(s,1*(1+.2*e.roughness),e),l=e.disableMultiStroke?[]:Ig(s,1.5*(1+.22*e.roughness),aC(e));for(const u of o)u.op!=="move"&&n.push(u);for(const u of l)u.op!=="move"&&i.push(u)}}return{type:"path",ops:n.concat(i)}}return{type:"path",ops:[]}}function PO(t,e,r){const n=Math.sqrt(2*Math.PI*Math.sqrt((Math.pow(t/2,2)+Math.pow(e/2,2))/2)),i=Math.ceil(Math.max(r.curveStepCount,r.curveStepCount/Math.sqrt(200)*n)),a=2*Math.PI/i;let s=Math.abs(t/2),o=Math.abs(e/2);const l=1-r.curveFitting;return s+=Ht(s*l,r),o+=Ht(o*l,r),{increment:a,rx:s,ry:o}}function D5(t,e,r,n){const[i,a]=sC(n.increment,t,e,n.rx,n.ry,1,n.increment*yv(.1,yv(.4,1,r),r),r);let s=xv(i,null,r);if(!r.disableMultiStroke&&r.roughness!==0){const[o]=sC(n.increment,t,e,n.rx,n.ry,1.5,0,r),l=xv(o,null,r);s=s.concat(l)}return{estimatedPoints:a,opset:{type:"path",ops:s}}}function nC(t,e,r,n,i,a,s,o,l){const u=t,h=e;let d=Math.abs(r/2),f=Math.abs(n/2);d+=Ht(.01*d,l),f+=Ht(.01*f,l);let p=i,g=a;for(;p<0;)p+=2*Math.PI,g+=2*Math.PI;g-p>2*Math.PI&&(p=0,g=2*Math.PI);const m=2*Math.PI/l.curveStepCount,v=Math.min(m/2,(g-p)/2),y=oC(v,u,h,d,f,p,g,1,l);if(!l.disableMultiStroke){const b=oC(v,u,h,d,f,p,g,1.5,l);y.push(...b)}return s&&(o?y.push(...Pl(u,h,u+d*Math.cos(p),h+f*Math.sin(p),l),...Pl(u,h,u+d*Math.cos(g),h+f*Math.sin(g),l)):y.push({op:"lineTo",data:[u,h]},{op:"lineTo",data:[u+d*Math.cos(p),h+f*Math.sin(p)]})),{type:"path",ops:y}}function iC(t,e){const r=MO(DO(X6(t))),n=[];let i=[0,0],a=[0,0];for(const{key:s,data:o}of r)switch(s){case"M":a=[o[0],o[1]],i=[o[0],o[1]];break;case"L":n.push(...Pl(a[0],a[1],o[0],o[1],e)),a=[o[0],o[1]];break;case"C":{const[l,u,h,d,f,p]=o;n.push(...zae(l,u,h,d,f,p,a,e)),a=[f,p];break}case"Z":n.push(...Pl(a[0],a[1],i[0],i[1],e)),a=[i[0],i[1]]}return{type:"path",ops:n}}function Zx(t,e){const r=[];for(const n of t)if(n.length){const i=e.maxRandomnessOffset||0,a=n.length;if(a>2){r.push({op:"move",data:[n[0][0]+Ht(i,e),n[0][1]+Ht(i,e)]});for(let s=1;s<a;s++)r.push({op:"lineTo",data:[n[s][0]+Ht(i,e),n[s][1]+Ht(i,e)]})}}return{type:"fillPath",ops:r}}function Xu(t,e){return function(r,n){let i=r.fillStyle||"hachure";if(!ea[i])switch(i){case"zigzag":ea[i]||(ea[i]=new Nae(n));break;case"cross-hatch":ea[i]||(ea[i]=new Dae(n));break;case"dots":ea[i]||(ea[i]=new Mae(n));break;case"dashed":ea[i]||(ea[i]=new Iae(n));break;case"zigzag-line":ea[i]||(ea[i]=new Oae(n));break;default:i="hachure",ea[i]||(ea[i]=new Y6(n))}return ea[i]}(e,Fae).fillPolygons(t,e)}function aC(t){const e=Object.assign({},t);return e.randomizer=void 0,t.seed&&(e.seed=t.seed+1),e}function BO(t){return t.randomizer||(t.randomizer=new Pae(t.seed||0)),t.randomizer.next()}function yv(t,e,r,n=1){return r.roughness*n*(BO(r)*(e-t)+t)}function Ht(t,e,r=1){return yv(-t,t,e,r)}function Pl(t,e,r,n,i,a=!1){const s=a?i.disableMultiStrokeFill:i.disableMultiStroke,o=M5(t,e,r,n,i,!0,!1);if(s)return o;const l=M5(t,e,r,n,i,!0,!0);return o.concat(l)}function M5(t,e,r,n,i,a,s){const o=Math.pow(t-r,2)+Math.pow(e-n,2),l=Math.sqrt(o);let u=1;u=l<200?1:l>500?.4:-.0016668*l+1.233334;let h=i.maxRandomnessOffset||0;h*h*100>o&&(h=l/10);const d=h/2,f=.2+.2*BO(i);let p=i.bowing*i.maxRandomnessOffset*(n-e)/200,g=i.bowing*i.maxRandomnessOffset*(t-r)/200;p=Ht(p,i,u),g=Ht(g,i,u);const m=[],v=()=>Ht(d,i,u),y=()=>Ht(h,i,u),b=i.preserveVertices;return s?m.push({op:"move",data:[t+(b?0:v()),e+(b?0:v())]}):m.push({op:"move",data:[t+(b?0:Ht(h,i,u)),e+(b?0:Ht(h,i,u))]}),s?m.push({op:"bcurveTo",data:[p+t+(r-t)*f+v(),g+e+(n-e)*f+v(),p+t+2*(r-t)*f+v(),g+e+2*(n-e)*f+v(),r+(b?0:v()),n+(b?0:v())]}):m.push({op:"bcurveTo",data:[p+t+(r-t)*f+y(),g+e+(n-e)*f+y(),p+t+2*(r-t)*f+y(),g+e+2*(n-e)*f+y(),r+(b?0:y()),n+(b?0:y())]}),m}function Ig(t,e,r){if(!t.length)return[];const n=[];n.push([t[0][0]+Ht(e,r),t[0][1]+Ht(e,r)]),n.push([t[0][0]+Ht(e,r),t[0][1]+Ht(e,r)]);for(let i=1;i<t.length;i++)n.push([t[i][0]+Ht(e,r),t[i][1]+Ht(e,r)]),i===t.length-1&&n.push([t[i][0]+Ht(e,r),t[i][1]+Ht(e,r)]);return xv(n,null,r)}function xv(t,e,r){const n=t.length,i=[];if(n>3){const a=[],s=1-r.curveTightness;i.push({op:"move",data:[t[1][0],t[1][1]]});for(let o=1;o+2<n;o++){const l=t[o];a[0]=[l[0],l[1]],a[1]=[l[0]+(s*t[o+1][0]-s*t[o-1][0])/6,l[1]+(s*t[o+1][1]-s*t[o-1][1])/6],a[2]=[t[o+1][0]+(s*t[o][0]-s*t[o+2][0])/6,t[o+1][1]+(s*t[o][1]-s*t[o+2][1])/6],a[3]=[t[o+1][0],t[o+1][1]],i.push({op:"bcurveTo",data:[a[1][0],a[1][1],a[2][0],a[2][1],a[3][0],a[3][1]]})}}else n===3?(i.push({op:"move",data:[t[1][0],t[1][1]]}),i.push({op:"bcurveTo",data:[t[1][0],t[1][1],t[2][0],t[2][1],t[2][0],t[2][1]]})):n===2&&i.push(...M5(t[0][0],t[0][1],t[1][0],t[1][1],r,!0,!0));return i}function sC(t,e,r,n,i,a,s,o){const l=[],u=[];if(o.roughness===0){t/=4,u.push([e+n*Math.cos(-t),r+i*Math.sin(-t)]);for(let h=0;h<=2*Math.PI;h+=t){const d=[e+n*Math.cos(h),r+i*Math.sin(h)];l.push(d),u.push(d)}u.push([e+n*Math.cos(0),r+i*Math.sin(0)]),u.push([e+n*Math.cos(t),r+i*Math.sin(t)])}else{const h=Ht(.5,o)-Math.PI/2;u.push([Ht(a,o)+e+.9*n*Math.cos(h-t),Ht(a,o)+r+.9*i*Math.sin(h-t)]);const d=2*Math.PI+h-.01;for(let f=h;f<d;f+=t){const p=[Ht(a,o)+e+n*Math.cos(f),Ht(a,o)+r+i*Math.sin(f)];l.push(p),u.push(p)}u.push([Ht(a,o)+e+n*Math.cos(h+2*Math.PI+.5*s),Ht(a,o)+r+i*Math.sin(h+2*Math.PI+.5*s)]),u.push([Ht(a,o)+e+.98*n*Math.cos(h+s),Ht(a,o)+r+.98*i*Math.sin(h+s)]),u.push([Ht(a,o)+e+.9*n*Math.cos(h+.5*s),Ht(a,o)+r+.9*i*Math.sin(h+.5*s)])}return[u,l]}function oC(t,e,r,n,i,a,s,o,l){const u=a+Ht(.1,l),h=[];h.push([Ht(o,l)+e+.9*n*Math.cos(u-t),Ht(o,l)+r+.9*i*Math.sin(u-t)]);for(let d=u;d<=s;d+=t)h.push([Ht(o,l)+e+n*Math.cos(d),Ht(o,l)+r+i*Math.sin(d)]);return h.push([e+n*Math.cos(s),r+i*Math.sin(s)]),h.push([e+n*Math.cos(s),r+i*Math.sin(s)]),xv(h,null,l)}function zae(t,e,r,n,i,a,s,o){const l=[],u=[o.maxRandomnessOffset||1,(o.maxRandomnessOffset||1)+.3];let h=[0,0];const d=o.disableMultiStroke?1:2,f=o.preserveVertices;for(let p=0;p<d;p++)p===0?l.push({op:"move",data:[s[0],s[1]]}):l.push({op:"move",data:[s[0]+(f?0:Ht(u[0],o)),s[1]+(f?0:Ht(u[0],o))]}),h=f?[i,a]:[i+Ht(u[p],o),a+Ht(u[p],o)],l.push({op:"bcurveTo",data:[t+Ht(u[p],o),e+Ht(u[p],o),r+Ht(u[p],o),n+Ht(u[p],o),h[0],h[1]]});return l}function rf(t){return[...t]}function lC(t,e=0){const r=t.length;if(r<3)throw new Error("A curve must have at least three points.");const n=[];if(r===3)n.push(rf(t[0]),rf(t[1]),rf(t[2]),rf(t[2]));else{const i=[];i.push(t[0],t[0]);for(let o=1;o<t.length;o++)i.push(t[o]),o===t.length-1&&i.push(t[o]);const a=[],s=1-e;n.push(rf(i[0]));for(let o=1;o+2<i.length;o++){const l=i[o];a[0]=[l[0],l[1]],a[1]=[l[0]+(s*i[o+1][0]-s*i[o-1][0])/6,l[1]+(s*i[o+1][1]-s*i[o-1][1])/6],a[2]=[i[o+1][0]+(s*i[o][0]-s*i[o+2][0])/6,i[o+1][1]+(s*i[o][1]-s*i[o+2][1])/6],a[3]=[i[o+1][0],i[o+1][1]],n.push(a[1],a[2],a[3])}}return n}function Y1(t,e){return Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2)}function Vae(t,e,r){const n=Y1(e,r);if(n===0)return Y1(t,e);let i=((t[0]-e[0])*(r[0]-e[0])+(t[1]-e[1])*(r[1]-e[1]))/n;return i=Math.max(0,Math.min(1,i)),Y1(t,Nc(e,r,i))}function Nc(t,e,r){return[t[0]+(e[0]-t[0])*r,t[1]+(e[1]-t[1])*r]}function I5(t,e,r,n){const i=n||[];if(function(o,l){const u=o[l+0],h=o[l+1],d=o[l+2],f=o[l+3];let p=3*h[0]-2*u[0]-f[0];p*=p;let g=3*h[1]-2*u[1]-f[1];g*=g;let m=3*d[0]-2*f[0]-u[0];m*=m;let v=3*d[1]-2*f[1]-u[1];return v*=v,p<m&&(p=m),g<v&&(g=v),p+g}(t,e)<r){const o=t[e+0];i.length?(a=i[i.length-1],s=o,Math.sqrt(Y1(a,s))>1&&i.push(o)):i.push(o),i.push(t[e+3])}else{const l=t[e+0],u=t[e+1],h=t[e+2],d=t[e+3],f=Nc(l,u,.5),p=Nc(u,h,.5),g=Nc(h,d,.5),m=Nc(f,p,.5),v=Nc(p,g,.5),y=Nc(m,v,.5);I5([l,f,m,y],0,r,i),I5([y,v,g,d],0,r,i)}var a,s;return i}function Gae(t,e){return bv(t,0,t.length,e)}function bv(t,e,r,n,i){const a=i||[],s=t[e],o=t[r-1];let l=0,u=1;for(let h=e+1;h<r-1;++h){const d=Vae(t[h],s,o);d>l&&(l=d,u=h)}return Math.sqrt(l)>n?(bv(t,e,u+1,n,a),bv(t,u,r,n,a)):(a.length||a.push(s),a.push(o)),a}function Qx(t,e=.15,r){const n=[],i=(t.length-1)/3;for(let a=0;a<i;a++)I5(t,3*a,e,n);return r&&r>0?bv(n,0,n.length,r):n}const ba="none";class wv{constructor(e){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=e||{},this.config.options&&(this.defaultOptions=this._o(this.config.options))}static newSeed(){return Math.floor(Math.random()*2**31)}_o(e){return e?Object.assign({},this.defaultOptions,e):this.defaultOptions}_d(e,r,n){return{shape:e,sets:r||[],options:n||this.defaultOptions}}line(e,r,n,i,a){const s=this._o(a);return this._d("line",[OO(e,r,n,i,s)],s)}rectangle(e,r,n,i,a){const s=this._o(a),o=[],l=$ae(e,r,n,i,s);if(s.fill){const u=[[e,r],[e+n,r],[e+n,r+i],[e,r+i]];s.fillStyle==="solid"?o.push(Zx([u],s)):o.push(Xu([u],s))}return s.stroke!==ba&&o.push(l),this._d("rectangle",o,s)}ellipse(e,r,n,i,a){const s=this._o(a),o=[],l=PO(n,i,s),u=D5(e,r,s,l);if(s.fill)if(s.fillStyle==="solid"){const h=D5(e,r,s,l).opset;h.type="fillPath",o.push(h)}else o.push(Xu([u.estimatedPoints],s));return s.stroke!==ba&&o.push(u.opset),this._d("ellipse",o,s)}circle(e,r,n,i){const a=this.ellipse(e,r,n,n,i);return a.shape="circle",a}linearPath(e,r){const n=this._o(r);return this._d("linearPath",[q1(e,!1,n)],n)}arc(e,r,n,i,a,s,o=!1,l){const u=this._o(l),h=[],d=nC(e,r,n,i,a,s,o,!0,u);if(o&&u.fill)if(u.fillStyle==="solid"){const f=Object.assign({},u);f.disableMultiStroke=!0;const p=nC(e,r,n,i,a,s,!0,!1,f);p.type="fillPath",h.push(p)}else h.push(function(f,p,g,m,v,y,b){const w=f,T=p;let E=Math.abs(g/2),L=Math.abs(m/2);E+=Ht(.01*E,b),L+=Ht(.01*L,b);let S=v,C=y;for(;S<0;)S+=2*Math.PI,C+=2*Math.PI;C-S>2*Math.PI&&(S=0,C=2*Math.PI);const A=(C-S)/b.curveStepCount,N=[];for(let _=S;_<=C;_+=A)N.push([w+E*Math.cos(_),T+L*Math.sin(_)]);return N.push([w+E*Math.cos(C),T+L*Math.sin(C)]),N.push([w,T]),Xu([N],b)}(e,r,n,i,a,s,u));return u.stroke!==ba&&h.push(d),this._d("arc",h,u)}curve(e,r){const n=this._o(r),i=[],a=rC(e,n);if(n.fill&&n.fill!==ba)if(n.fillStyle==="solid"){const s=rC(e,Object.assign(Object.assign({},n),{disableMultiStroke:!0,roughness:n.roughness?n.roughness+n.fillShapeRoughnessGain:0}));i.push({type:"fillPath",ops:this._mergedShape(s.ops)})}else{const s=[],o=e;if(o.length){const l=typeof o[0][0]=="number"?[o]:o;for(const u of l)u.length<3?s.push(...u):u.length===3?s.push(...Qx(lC([u[0],u[0],u[1],u[2]]),10,(1+n.roughness)/2)):s.push(...Qx(lC(u),10,(1+n.roughness)/2))}s.length&&i.push(Xu([s],n))}return n.stroke!==ba&&i.push(a),this._d("curve",i,n)}polygon(e,r){const n=this._o(r),i=[],a=q1(e,!0,n);return n.fill&&(n.fillStyle==="solid"?i.push(Zx([e],n)):i.push(Xu([e],n))),n.stroke!==ba&&i.push(a),this._d("polygon",i,n)}path(e,r){const n=this._o(r),i=[];if(!e)return this._d("path",i,n);e=(e||"").replace(/\n/g," ").replace(/(-\s)/g,"-").replace("/(ss)/g"," ");const a=n.fill&&n.fill!=="transparent"&&n.fill!==ba,s=n.stroke!==ba,o=!!(n.simplification&&n.simplification<1),l=function(h,d,f){const p=MO(DO(X6(h))),g=[];let m=[],v=[0,0],y=[];const b=()=>{y.length>=4&&m.push(...Qx(y,d)),y=[]},w=()=>{b(),m.length&&(g.push(m),m=[])};for(const{key:E,data:L}of p)switch(E){case"M":w(),v=[L[0],L[1]],m.push(v);break;case"L":b(),m.push([L[0],L[1]]);break;case"C":if(!y.length){const S=m.length?m[m.length-1]:v;y.push([S[0],S[1]])}y.push([L[0],L[1]]),y.push([L[2],L[3]]),y.push([L[4],L[5]]);break;case"Z":b(),m.push([v[0],v[1]])}if(w(),!f)return g;const T=[];for(const E of g){const L=Gae(E,f);L.length&&T.push(L)}return T}(e,1,o?4-4*(n.simplification||1):(1+n.roughness)/2),u=iC(e,n);if(a)if(n.fillStyle==="solid")if(l.length===1){const h=iC(e,Object.assign(Object.assign({},n),{disableMultiStroke:!0,roughness:n.roughness?n.roughness+n.fillShapeRoughnessGain:0}));i.push({type:"fillPath",ops:this._mergedShape(h.ops)})}else i.push(Zx(l,n));else i.push(Xu(l,n));return s&&(o?l.forEach(h=>{i.push(q1(h,!1,n))}):i.push(u)),this._d("path",i,n)}opsToPath(e,r){let n="";for(const i of e.ops){const a=typeof r=="number"&&r>=0?i.data.map(s=>+s.toFixed(r)):i.data;switch(i.op){case"move":n+=`M${a[0]} ${a[1]} `;break;case"bcurveTo":n+=`C${a[0]} ${a[1]}, ${a[2]} ${a[3]}, ${a[4]} ${a[5]} `;break;case"lineTo":n+=`L${a[0]} ${a[1]} `}}return n.trim()}toPaths(e){const r=e.sets||[],n=e.options||this.defaultOptions,i=[];for(const a of r){let s=null;switch(a.type){case"path":s={d:this.opsToPath(a),stroke:n.stroke,strokeWidth:n.strokeWidth,fill:ba};break;case"fillPath":s={d:this.opsToPath(a),stroke:ba,strokeWidth:0,fill:n.fill||ba};break;case"fillSketch":s=this.fillSketch(a,n)}s&&i.push(s)}return i}fillSketch(e,r){let n=r.fillWeight;return n<0&&(n=r.strokeWidth/2),{d:this.opsToPath(e),stroke:r.fill||ba,strokeWidth:n,fill:ba}}_mergedShape(e){return e.filter((r,n)=>n===0||r.op!=="move")}}class Uae{constructor(e,r){this.canvas=e,this.ctx=this.canvas.getContext("2d"),this.gen=new wv(r)}draw(e){const r=e.sets||[],n=e.options||this.getDefaultOptions(),i=this.ctx,a=e.options.fixedDecimalPlaceDigits;for(const s of r)switch(s.type){case"path":i.save(),i.strokeStyle=n.stroke==="none"?"transparent":n.stroke,i.lineWidth=n.strokeWidth,n.strokeLineDash&&i.setLineDash(n.strokeLineDash),n.strokeLineDashOffset&&(i.lineDashOffset=n.strokeLineDashOffset),this._drawToContext(i,s,a),i.restore();break;case"fillPath":{i.save(),i.fillStyle=n.fill||"";const o=e.shape==="curve"||e.shape==="polygon"||e.shape==="path"?"evenodd":"nonzero";this._drawToContext(i,s,a,o),i.restore();break}case"fillSketch":this.fillSketch(i,s,n)}}fillSketch(e,r,n){let i=n.fillWeight;i<0&&(i=n.strokeWidth/2),e.save(),n.fillLineDash&&e.setLineDash(n.fillLineDash),n.fillLineDashOffset&&(e.lineDashOffset=n.fillLineDashOffset),e.strokeStyle=n.fill||"",e.lineWidth=i,this._drawToContext(e,r,n.fixedDecimalPlaceDigits),e.restore()}_drawToContext(e,r,n,i="nonzero"){e.beginPath();for(const a of r.ops){const s=typeof n=="number"&&n>=0?a.data.map(o=>+o.toFixed(n)):a.data;switch(a.op){case"move":e.moveTo(s[0],s[1]);break;case"bcurveTo":e.bezierCurveTo(s[0],s[1],s[2],s[3],s[4],s[5]);break;case"lineTo":e.lineTo(s[0],s[1])}}r.type==="fillPath"?e.fill(i):e.stroke()}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}line(e,r,n,i,a){const s=this.gen.line(e,r,n,i,a);return this.draw(s),s}rectangle(e,r,n,i,a){const s=this.gen.rectangle(e,r,n,i,a);return this.draw(s),s}ellipse(e,r,n,i,a){const s=this.gen.ellipse(e,r,n,i,a);return this.draw(s),s}circle(e,r,n,i){const a=this.gen.circle(e,r,n,i);return this.draw(a),a}linearPath(e,r){const n=this.gen.linearPath(e,r);return this.draw(n),n}polygon(e,r){const n=this.gen.polygon(e,r);return this.draw(n),n}arc(e,r,n,i,a,s,o=!1,l){const u=this.gen.arc(e,r,n,i,a,s,o,l);return this.draw(u),u}curve(e,r){const n=this.gen.curve(e,r);return this.draw(n),n}path(e,r){const n=this.gen.path(e,r);return this.draw(n),n}}const Og="http://www.w3.org/2000/svg";class Wae{constructor(e,r){this.svg=e,this.gen=new wv(r)}draw(e){const r=e.sets||[],n=e.options||this.getDefaultOptions(),i=this.svg.ownerDocument||window.document,a=i.createElementNS(Og,"g"),s=e.options.fixedDecimalPlaceDigits;for(const o of r){let l=null;switch(o.type){case"path":l=i.createElementNS(Og,"path"),l.setAttribute("d",this.opsToPath(o,s)),l.setAttribute("stroke",n.stroke),l.setAttribute("stroke-width",n.strokeWidth+""),l.setAttribute("fill","none"),n.strokeLineDash&&l.setAttribute("stroke-dasharray",n.strokeLineDash.join(" ").trim()),n.strokeLineDashOffset&&l.setAttribute("stroke-dashoffset",`${n.strokeLineDashOffset}`);break;case"fillPath":l=i.createElementNS(Og,"path"),l.setAttribute("d",this.opsToPath(o,s)),l.setAttribute("stroke","none"),l.setAttribute("stroke-width","0"),l.setAttribute("fill",n.fill||""),e.shape!=="curve"&&e.shape!=="polygon"||l.setAttribute("fill-rule","evenodd");break;case"fillSketch":l=this.fillSketch(i,o,n)}l&&a.appendChild(l)}return a}fillSketch(e,r,n){let i=n.fillWeight;i<0&&(i=n.strokeWidth/2);const a=e.createElementNS(Og,"path");return a.setAttribute("d",this.opsToPath(r,n.fixedDecimalPlaceDigits)),a.setAttribute("stroke",n.fill||""),a.setAttribute("stroke-width",i+""),a.setAttribute("fill","none"),n.fillLineDash&&a.setAttribute("stroke-dasharray",n.fillLineDash.join(" ").trim()),n.fillLineDashOffset&&a.setAttribute("stroke-dashoffset",`${n.fillLineDashOffset}`),a}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}opsToPath(e,r){return this.gen.opsToPath(e,r)}line(e,r,n,i,a){const s=this.gen.line(e,r,n,i,a);return this.draw(s)}rectangle(e,r,n,i,a){const s=this.gen.rectangle(e,r,n,i,a);return this.draw(s)}ellipse(e,r,n,i,a){const s=this.gen.ellipse(e,r,n,i,a);return this.draw(s)}circle(e,r,n,i){const a=this.gen.circle(e,r,n,i);return this.draw(a)}linearPath(e,r){const n=this.gen.linearPath(e,r);return this.draw(n)}polygon(e,r){const n=this.gen.polygon(e,r);return this.draw(n)}arc(e,r,n,i,a,s,o=!1,l){const u=this.gen.arc(e,r,n,i,a,s,o,l);return this.draw(u)}curve(e,r){const n=this.gen.curve(e,r);return this.draw(n)}path(e,r){const n=this.gen.path(e,r);return this.draw(n)}}var Rt={canvas:(t,e)=>new Uae(t,e),svg:(t,e)=>new Wae(t,e),generator:t=>new wv(t),newSeed:()=>wv.newSeed()},Ut=x(async(t,e,r)=>{let n;const i=e.useHtmlLabels||Ir(we()?.htmlLabels);r?n=r:n="node default";const a=t.insert("g").attr("class",n).attr("id",e.domId||e.id),s=a.insert("g").attr("class","label").attr("style",Si(e.labelStyle));let o;e.label===void 0?o="":o=typeof e.label=="string"?e.label:e.label[0];const l=await Ra(s,fr(Ks(o),we()),{useHtmlLabels:i,width:e.width||we().flowchart?.wrappingWidth,cssClasses:"markdown-node-label",style:e.labelStyle,addSvgBackground:!!e.icon||!!e.img});let u=l.getBBox();const h=(e?.padding??0)/2;if(i){const d=l.children[0],f=Qe(l),p=d.getElementsByTagName("img");if(p){const g=o.replace(/<img[^>]*>/g,"").trim()==="";await Promise.all([...p].map(m=>new Promise(v=>{function y(){if(m.style.display="flex",m.style.flexDirection="column",g){const b=we().fontSize?we().fontSize:window.getComputedStyle(document.body).fontSize,w=5,[T=hr.fontSize]=Ru(b),E=T*w+"px";m.style.minWidth=E,m.style.maxWidth=E}else m.style.width="100%";v(m)}x(y,"setupImage"),setTimeout(()=>{m.complete&&y()}),m.addEventListener("error",y),m.addEventListener("load",y)})))}u=d.getBoundingClientRect(),f.attr("width",u.width),f.attr("height",u.height)}return i?s.attr("transform","translate("+-u.width/2+", "+-u.height/2+")"):s.attr("transform","translate(0, "+-u.height/2+")"),e.centerLabel&&s.attr("transform","translate("+-u.width/2+", "+-u.height/2+")"),s.insert("rect",":first-child"),{shapeSvg:a,bbox:u,halfPadding:h,label:s}},"labelHelper"),Jx=x(async(t,e,r)=>{const n=r.useHtmlLabels||Ir(we()?.flowchart?.htmlLabels),i=t.insert("g").attr("class","label").attr("style",r.labelStyle||""),a=await Ra(i,fr(Ks(e),we()),{useHtmlLabels:n,width:r.width||we()?.flowchart?.wrappingWidth,style:r.labelStyle,addSvgBackground:!!r.icon||!!r.img});let s=a.getBBox();const o=r.padding/2;if(Ir(we()?.flowchart?.htmlLabels)){const l=a.children[0],u=Qe(a);s=l.getBoundingClientRect(),u.attr("width",s.width),u.attr("height",s.height)}return n?i.attr("transform","translate("+-s.width/2+", "+-s.height/2+")"):i.attr("transform","translate(0, "+-s.height/2+")"),r.centerLabel&&i.attr("transform","translate("+-s.width/2+", "+-s.height/2+")"),i.insert("rect",":first-child"),{shapeSvg:t,bbox:s,halfPadding:o,label:i}},"insertLabel"),Dt=x((t,e)=>{const r=e.node().getBBox();t.width=r.width,t.height=r.height},"updateNodeBounds"),$t=x((t,e)=>(t.look==="handDrawn"?"rough-node":"node")+" "+t.cssClasses+" "+(e||""),"getNodeClasses");function sr(t){const e=t.map((r,n)=>`${n===0?"M":"L"}${r.x},${r.y}`);return e.push("Z"),e.join(" ")}x(sr,"createPathFromPoints");function Bl(t,e,r,n,i,a){const s=[],l=r-t,u=n-e,h=l/a,d=2*Math.PI/h,f=e+u/2;for(let p=0;p<=50;p++){const g=p/50,m=t+g*l,v=f+i*Math.sin(d*(m-t));s.push({x:m,y:v})}return s}x(Bl,"generateFullSineWavePoints");function j0(t,e,r,n,i,a){const s=[],o=i*Math.PI/180,h=(a*Math.PI/180-o)/(n-1);for(let d=0;d<n;d++){const f=o+d*h,p=t+r*Math.cos(f),g=e+r*Math.sin(f);s.push({x:-p,y:-g})}return s}x(j0,"generateCirclePoints");var Hae=x((t,e)=>{var r=t.x,n=t.y,i=e.x-r,a=e.y-n,s=t.width/2,o=t.height/2,l,u;return Math.abs(a)*s>Math.abs(i)*o?(a<0&&(o=-o),l=a===0?0:o*i/a,u=o):(i<0&&(s=-s),l=s,u=i===0?0:s*a/i),{x:r+l,y:n+u}},"intersectRect"),kd=Hae;function FO(t,e){e&&t.attr("style",e)}x(FO,"applyStyle");async function $O(t){const e=Qe(document.createElementNS("http://www.w3.org/2000/svg","foreignObject")),r=e.append("xhtml:div"),n=we();let i=t.label;t.label&&un(t.label)&&(i=await Ap(t.label.replace(at.lineBreakRegex,`
`),n));const s='<span class="'+(t.isNode?"nodeLabel":"edgeLabel")+'" '+(t.labelStyle?'style="'+t.labelStyle+'"':"")+">"+i+"</span>";return r.html(fr(s,n)),FO(r,t.labelStyle),r.style("display","inline-block"),r.style("padding-right","1px"),r.style("white-space","nowrap"),r.attr("xmlns","http://www.w3.org/1999/xhtml"),e.node()}x($O,"addHtmlLabel");var qae=x(async(t,e,r,n)=>{let i=t||"";if(typeof i=="object"&&(i=i[0]),Ir(we().flowchart.htmlLabels)){i=i.replace(/\\n|\n/g,"<br />"),ie.info("vertexText"+i);const a={isNode:n,label:Ks(i).replace(/fa[blrs]?:fa-[\w-]+/g,o=>`<i class='${o.replace(":"," ")}'></i>`),labelStyle:e&&e.replace("fill:","color:")};return await $O(a)}else{const a=document.createElementNS("http://www.w3.org/2000/svg","text");a.setAttribute("style",e.replace("color:","fill:"));let s=[];typeof i=="string"?s=i.split(/\\n|\n|<br\s*\/?>/gi):Array.isArray(i)?s=i:s=[];for(const o of s){const l=document.createElementNS("http://www.w3.org/2000/svg","tspan");l.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),l.setAttribute("dy","1em"),l.setAttribute("x","0"),r?l.setAttribute("class","title-row"):l.setAttribute("class","row"),l.textContent=o.trim(),a.appendChild(l)}return a}},"createLabel"),Hc=qae,rc=x((t,e,r,n,i)=>["M",t+i,e,"H",t+r-i,"A",i,i,0,0,1,t+r,e+i,"V",e+n-i,"A",i,i,0,0,1,t+r-i,e+n,"H",t+i,"A",i,i,0,0,1,t,e+n-i,"V",e+i,"A",i,i,0,0,1,t+i,e,"Z"].join(" "),"createRoundedRectPathD"),zO=x(async(t,e)=>{ie.info("Creating subgraph rect for ",e.id,e);const r=we(),{themeVariables:n,handDrawnSeed:i}=r,{clusterBkg:a,clusterBorder:s}=n,{labelStyles:o,nodeStyles:l,borderStyles:u,backgroundStyles:h}=Ct(e),d=t.insert("g").attr("class","cluster "+e.cssClasses).attr("id",e.id).attr("data-look",e.look),f=Ir(r.flowchart.htmlLabels),p=d.insert("g").attr("class","cluster-label "),g=await Ra(p,e.label,{style:e.labelStyle,useHtmlLabels:f,isNode:!0});let m=g.getBBox();if(Ir(r.flowchart.htmlLabels)){const S=g.children[0],C=Qe(g);m=S.getBoundingClientRect(),C.attr("width",m.width),C.attr("height",m.height)}const v=e.width<=m.width+e.padding?m.width+e.padding:e.width;e.width<=m.width+e.padding?e.diff=(v-e.width)/2-e.padding:e.diff=-e.padding;const y=e.height,b=e.x-v/2,w=e.y-y/2;ie.trace("Data ",e,JSON.stringify(e));let T;if(e.look==="handDrawn"){const S=Rt.svg(d),C=Nt(e,{roughness:.7,fill:a,stroke:s,fillWeight:3,seed:i}),A=S.path(rc(b,w,v,y,0),C);T=d.insert(()=>(ie.debug("Rough node insert CXC",A),A),":first-child"),T.select("path:nth-child(2)").attr("style",u.join(";")),T.select("path").attr("style",h.join(";").replace("fill","stroke"))}else T=d.insert("rect",":first-child"),T.attr("style",l).attr("rx",e.rx).attr("ry",e.ry).attr("x",b).attr("y",w).attr("width",v).attr("height",y);const{subGraphTitleTopMargin:E}=Mp(r);if(p.attr("transform",`translate(${e.x-m.width/2}, ${e.y-e.height/2+E})`),o){const S=p.select("span");S&&S.attr("style",o)}const L=T.node().getBBox();return e.offsetX=0,e.width=L.width,e.height=L.height,e.offsetY=m.height-e.padding/2,e.intersect=function(S){return kd(e,S)},{cluster:d,labelBBox:m}},"rect"),Yae=x((t,e)=>{const r=t.insert("g").attr("class","note-cluster").attr("id",e.id),n=r.insert("rect",":first-child"),i=0*e.padding,a=i/2;n.attr("rx",e.rx).attr("ry",e.ry).attr("x",e.x-e.width/2-a).attr("y",e.y-e.height/2-a).attr("width",e.width+i).attr("height",e.height+i).attr("fill","none");const s=n.node().getBBox();return e.width=s.width,e.height=s.height,e.intersect=function(o){return kd(e,o)},{cluster:r,labelBBox:{width:0,height:0}}},"noteGroup"),Xae=x(async(t,e)=>{const r=we(),{themeVariables:n,handDrawnSeed:i}=r,{altBackground:a,compositeBackground:s,compositeTitleBackground:o,nodeBorder:l}=n,u=t.insert("g").attr("class",e.cssClasses).attr("id",e.id).attr("data-id",e.id).attr("data-look",e.look),h=u.insert("g",":first-child"),d=u.insert("g").attr("class","cluster-label");let f=u.append("rect");const p=d.node().appendChild(await Hc(e.label,e.labelStyle,void 0,!0));let g=p.getBBox();if(Ir(r.flowchart.htmlLabels)){const A=p.children[0],N=Qe(p);g=A.getBoundingClientRect(),N.attr("width",g.width),N.attr("height",g.height)}const m=0*e.padding,v=m/2,y=(e.width<=g.width+e.padding?g.width+e.padding:e.width)+m;e.width<=g.width+e.padding?e.diff=(y-e.width)/2-e.padding:e.diff=-e.padding;const b=e.height+m,w=e.height+m-g.height-6,T=e.x-y/2,E=e.y-b/2;e.width=y;const L=e.y-e.height/2-v+g.height+2;let S;if(e.look==="handDrawn"){const A=e.cssClasses.includes("statediagram-cluster-alt"),N=Rt.svg(u),_=e.rx||e.ry?N.path(rc(T,E,y,b,10),{roughness:.7,fill:o,fillStyle:"solid",stroke:l,seed:i}):N.rectangle(T,E,y,b,{seed:i});S=u.insert(()=>_,":first-child");const O=N.rectangle(T,L,y,w,{fill:A?a:s,fillStyle:A?"hachure":"solid",stroke:l,seed:i});S=u.insert(()=>_,":first-child"),f=u.insert(()=>O)}else S=h.insert("rect",":first-child"),S.attr("class","outer").attr("x",T).attr("y",E).attr("width",y).attr("height",b).attr("data-look",e.look),f.attr("class","inner").attr("x",T).attr("y",L).attr("width",y).attr("height",w);d.attr("transform",`translate(${e.x-g.width/2}, ${E+1-(Ir(r.flowchart.htmlLabels)?0:3)})`);const C=S.node().getBBox();return e.height=C.height,e.offsetX=0,e.offsetY=g.height-e.padding/2,e.labelBBox=g,e.intersect=function(A){return kd(e,A)},{cluster:u,labelBBox:g}},"roundedWithTitle"),jae=x(async(t,e)=>{ie.info("Creating subgraph rect for ",e.id,e);const r=we(),{themeVariables:n,handDrawnSeed:i}=r,{clusterBkg:a,clusterBorder:s}=n,{labelStyles:o,nodeStyles:l,borderStyles:u,backgroundStyles:h}=Ct(e),d=t.insert("g").attr("class","cluster "+e.cssClasses).attr("id",e.id).attr("data-look",e.look),f=Ir(r.flowchart.htmlLabels),p=d.insert("g").attr("class","cluster-label "),g=await Ra(p,e.label,{style:e.labelStyle,useHtmlLabels:f,isNode:!0,width:e.width});let m=g.getBBox();if(Ir(r.flowchart.htmlLabels)){const S=g.children[0],C=Qe(g);m=S.getBoundingClientRect(),C.attr("width",m.width),C.attr("height",m.height)}const v=e.width<=m.width+e.padding?m.width+e.padding:e.width;e.width<=m.width+e.padding?e.diff=(v-e.width)/2-e.padding:e.diff=-e.padding;const y=e.height,b=e.x-v/2,w=e.y-y/2;ie.trace("Data ",e,JSON.stringify(e));let T;if(e.look==="handDrawn"){const S=Rt.svg(d),C=Nt(e,{roughness:.7,fill:a,stroke:s,fillWeight:4,seed:i}),A=S.path(rc(b,w,v,y,e.rx),C);T=d.insert(()=>(ie.debug("Rough node insert CXC",A),A),":first-child"),T.select("path:nth-child(2)").attr("style",u.join(";")),T.select("path").attr("style",h.join(";").replace("fill","stroke"))}else T=d.insert("rect",":first-child"),T.attr("style",l).attr("rx",e.rx).attr("ry",e.ry).attr("x",b).attr("y",w).attr("width",v).attr("height",y);const{subGraphTitleTopMargin:E}=Mp(r);if(p.attr("transform",`translate(${e.x-m.width/2}, ${e.y-e.height/2+E})`),o){const S=p.select("span");S&&S.attr("style",o)}const L=T.node().getBBox();return e.offsetX=0,e.width=L.width,e.height=L.height,e.offsetY=m.height-e.padding/2,e.intersect=function(S){return kd(e,S)},{cluster:d,labelBBox:m}},"kanbanSection"),Kae=x((t,e)=>{const r=we(),{themeVariables:n,handDrawnSeed:i}=r,{nodeBorder:a}=n,s=t.insert("g").attr("class",e.cssClasses).attr("id",e.id).attr("data-look",e.look),o=s.insert("g",":first-child"),l=0*e.padding,u=e.width+l;e.diff=-e.padding;const h=e.height+l,d=e.x-u/2,f=e.y-h/2;e.width=u;let p;if(e.look==="handDrawn"){const v=Rt.svg(s).rectangle(d,f,u,h,{fill:"lightgrey",roughness:.5,strokeLineDash:[5],stroke:a,seed:i});p=s.insert(()=>v,":first-child")}else p=o.insert("rect",":first-child"),p.attr("class","divider").attr("x",d).attr("y",f).attr("width",u).attr("height",h).attr("data-look",e.look);const g=p.node().getBBox();return e.height=g.height,e.offsetX=0,e.offsetY=0,e.intersect=function(m){return kd(e,m)},{cluster:s,labelBBox:{}}},"divider"),Zae=zO,Qae={rect:zO,squareRect:Zae,roundedWithTitle:Xae,noteGroup:Yae,divider:Kae,kanbanSection:jae},VO=new Map,j6=x(async(t,e)=>{const r=e.shape||"rect",n=await Qae[r](t,e);return VO.set(e.id,n),n},"insertCluster"),Jae=x(()=>{VO=new Map},"clear");function GO(t,e){return t.intersect(e)}x(GO,"intersectNode");var ese=GO;function UO(t,e,r,n){var i=t.x,a=t.y,s=i-n.x,o=a-n.y,l=Math.sqrt(e*e*o*o+r*r*s*s),u=Math.abs(e*r*s/l);n.x<i&&(u=-u);var h=Math.abs(e*r*o/l);return n.y<a&&(h=-h),{x:i+u,y:a+h}}x(UO,"intersectEllipse");var WO=UO;function HO(t,e,r){return WO(t,e,e,r)}x(HO,"intersectCircle");var tse=HO;function qO(t,e,r,n){{const i=e.y-t.y,a=t.x-e.x,s=e.x*t.y-t.x*e.y,o=i*r.x+a*r.y+s,l=i*n.x+a*n.y+s,u=1e-6;if(o!==0&&l!==0&&O5(o,l))return;const h=n.y-r.y,d=r.x-n.x,f=n.x*r.y-r.x*n.y,p=h*t.x+d*t.y+f,g=h*e.x+d*e.y+f;if(Math.abs(p)<u&&Math.abs(g)<u&&O5(p,g))return;const m=i*d-h*a;if(m===0)return;const v=Math.abs(m/2);let y=a*f-d*s;const b=y<0?(y-v)/m:(y+v)/m;y=h*s-i*f;const w=y<0?(y-v)/m:(y+v)/m;return{x:b,y:w}}}x(qO,"intersectLine");function O5(t,e){return t*e>0}x(O5,"sameSign");var rse=qO;function YO(t,e,r){let n=t.x,i=t.y,a=[],s=Number.POSITIVE_INFINITY,o=Number.POSITIVE_INFINITY;typeof e.forEach=="function"?e.forEach(function(h){s=Math.min(s,h.x),o=Math.min(o,h.y)}):(s=Math.min(s,e.x),o=Math.min(o,e.y));let l=n-t.width/2-s,u=i-t.height/2-o;for(let h=0;h<e.length;h++){let d=e[h],f=e[h<e.length-1?h+1:0],p=rse(t,r,{x:l+d.x,y:u+d.y},{x:l+f.x,y:u+f.y});p&&a.push(p)}return a.length?(a.length>1&&a.sort(function(h,d){let f=h.x-r.x,p=h.y-r.y,g=Math.sqrt(f*f+p*p),m=d.x-r.x,v=d.y-r.y,y=Math.sqrt(m*m+v*v);return g<y?-1:g===y?0:1}),a[0]):t}x(YO,"intersectPolygon");var nse=YO,St={node:ese,circle:tse,ellipse:WO,polygon:nse,rect:kd};function XO(t,e){const{labelStyles:r}=Ct(e);e.labelStyle=r;const n=$t(e);let i=n;n||(i="anchor");const a=t.insert("g").attr("class",i).attr("id",e.domId||e.id),s=1,{cssStyles:o}=e,l=Rt.svg(a),u=Nt(e,{fill:"black",stroke:"none",fillStyle:"solid"});e.look!=="handDrawn"&&(u.roughness=0);const h=l.circle(0,0,s*2,u),d=a.insert(()=>h,":first-child");return d.attr("class","anchor").attr("style",Si(o)),Dt(e,d),e.intersect=function(f){return ie.info("Circle intersect",e,s,f),St.circle(e,s,f)},a}x(XO,"anchor");function P5(t,e,r,n,i,a,s){const l=(t+r)/2,u=(e+n)/2,h=Math.atan2(n-e,r-t),d=(r-t)/2,f=(n-e)/2,p=d/i,g=f/a,m=Math.sqrt(p**2+g**2);if(m>1)throw new Error("The given radii are too small to create an arc between the points.");const v=Math.sqrt(1-m**2),y=l+v*a*Math.sin(h)*(s?-1:1),b=u-v*i*Math.cos(h)*(s?-1:1),w=Math.atan2((e-b)/a,(t-y)/i);let E=Math.atan2((n-b)/a,(r-y)/i)-w;s&&E<0&&(E+=2*Math.PI),!s&&E>0&&(E-=2*Math.PI);const L=[];for(let S=0;S<20;S++){const C=S/19,A=w+C*E,N=y+i*Math.cos(A),_=b+a*Math.sin(A);L.push({x:N,y:_})}return L}x(P5,"generateArcPoints");async function jO(t,e){const{labelStyles:r,nodeStyles:n}=Ct(e);e.labelStyle=r;const{shapeSvg:i,bbox:a}=await Ut(t,e,$t(e)),s=a.width+e.padding+20,o=a.height+e.padding,l=o/2,u=l/(2.5+o/50),{cssStyles:h}=e,d=[{x:s/2,y:-o/2},{x:-s/2,y:-o/2},...P5(-s/2,-o/2,-s/2,o/2,u,l,!1),{x:s/2,y:o/2},...P5(s/2,o/2,s/2,-o/2,u,l,!0)],f=Rt.svg(i),p=Nt(e,{});e.look!=="handDrawn"&&(p.roughness=0,p.fillStyle="solid");const g=sr(d),m=f.path(g,p),v=i.insert(()=>m,":first-child");return v.attr("class","basic label-container"),h&&e.look!=="handDrawn"&&v.selectAll("path").attr("style",h),n&&e.look!=="handDrawn"&&v.selectAll("path").attr("style",n),v.attr("transform",`translate(${u/2}, 0)`),Dt(e,v),e.intersect=function(y){return St.polygon(e,d,y)},i}x(jO,"bowTieRect");function nc(t,e,r,n){return t.insert("polygon",":first-child").attr("points",n.map(function(i){return i.x+","+i.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-e/2+","+r/2+")")}x(nc,"insertPolygonShape");async function KO(t,e){const{labelStyles:r,nodeStyles:n}=Ct(e);e.labelStyle=r;const{shapeSvg:i,bbox:a}=await Ut(t,e,$t(e)),s=a.height+e.padding,o=12,l=a.width+e.padding+o,u=0,h=l,d=-s,f=0,p=[{x:u+o,y:d},{x:h,y:d},{x:h,y:f},{x:u,y:f},{x:u,y:d+o},{x:u+o,y:d}];let g;const{cssStyles:m}=e;if(e.look==="handDrawn"){const v=Rt.svg(i),y=Nt(e,{}),b=sr(p),w=v.path(b,y);g=i.insert(()=>w,":first-child").attr("transform",`translate(${-l/2}, ${s/2})`),m&&g.attr("style",m)}else g=nc(i,l,s,p);return n&&g.attr("style",n),Dt(e,g),e.intersect=function(v){return St.polygon(e,p,v)},i}x(KO,"card");function ZO(t,e){const{nodeStyles:r}=Ct(e);e.label="";const n=t.insert("g").attr("class",$t(e)).attr("id",e.domId??e.id),{cssStyles:i}=e,a=Math.max(28,e.width??0),s=[{x:0,y:a/2},{x:a/2,y:0},{x:0,y:-a/2},{x:-a/2,y:0}],o=Rt.svg(n),l=Nt(e,{});e.look!=="handDrawn"&&(l.roughness=0,l.fillStyle="solid");const u=sr(s),h=o.path(u,l),d=n.insert(()=>h,":first-child");return i&&e.look!=="handDrawn"&&d.selectAll("path").attr("style",i),r&&e.look!=="handDrawn"&&d.selectAll("path").attr("style",r),e.width=28,e.height=28,e.intersect=function(f){return St.polygon(e,s,f)},n}x(ZO,"choice");async function K6(t,e,r){const{labelStyles:n,nodeStyles:i}=Ct(e);e.labelStyle=n;const{shapeSvg:a,bbox:s,halfPadding:o}=await Ut(t,e,$t(e)),l=r?.padding??o,u=s.width/2+l;let h;const{cssStyles:d}=e;if(e.look==="handDrawn"){const f=Rt.svg(a),p=Nt(e,{}),g=f.circle(0,0,u*2,p);h=a.insert(()=>g,":first-child"),h.attr("class","basic label-container").attr("style",Si(d))}else h=a.insert("circle",":first-child").attr("class","basic label-container").attr("style",i).attr("r",u).attr("cx",0).attr("cy",0);return Dt(e,h),e.calcIntersect=function(f,p){const g=f.width/2;return St.circle(f,g,p)},e.intersect=function(f){return ie.info("Circle intersect",e,u,f),St.circle(e,u,f)},a}x(K6,"circle");function QO(t){const e=Math.cos(Math.PI/4),r=Math.sin(Math.PI/4),n=t*2,i={x:n/2*e,y:n/2*r},a={x:-(n/2)*e,y:n/2*r},s={x:-(n/2)*e,y:-(n/2)*r},o={x:n/2*e,y:-(n/2)*r};return`M ${a.x},${a.y} L ${o.x},${o.y}
                   M ${i.x},${i.y} L ${s.x},${s.y}`}x(QO,"createLine");function JO(t,e){const{labelStyles:r,nodeStyles:n}=Ct(e);e.labelStyle=r,e.label="";const i=t.insert("g").attr("class",$t(e)).attr("id",e.domId??e.id),a=Math.max(30,e?.width??0),{cssStyles:s}=e,o=Rt.svg(i),l=Nt(e,{});e.look!=="handDrawn"&&(l.roughness=0,l.fillStyle="solid");const u=o.circle(0,0,a*2,l),h=QO(a),d=o.path(h,l),f=i.insert(()=>u,":first-child");return f.insert(()=>d),s&&e.look!=="handDrawn"&&f.selectAll("path").attr("style",s),n&&e.look!=="handDrawn"&&f.selectAll("path").attr("style",n),Dt(e,f),e.intersect=function(p){return ie.info("crossedCircle intersect",e,{radius:a,point:p}),St.circle(e,a,p)},i}x(JO,"crossedCircle");function wo(t,e,r,n=100,i=0,a=180){const s=[],o=i*Math.PI/180,h=(a*Math.PI/180-o)/(n-1);for(let d=0;d<n;d++){const f=o+d*h,p=t+r*Math.cos(f),g=e+r*Math.sin(f);s.push({x:-p,y:-g})}return s}x(wo,"generateCirclePoints");async function eP(t,e){const{labelStyles:r,nodeStyles:n}=Ct(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,label:s}=await Ut(t,e,$t(e)),o=a.width+(e.padding??0),l=a.height+(e.padding??0),u=Math.max(5,l*.1),{cssStyles:h}=e,d=[...wo(o/2,-l/2,u,30,-90,0),{x:-o/2-u,y:u},...wo(o/2+u*2,-u,u,20,-180,-270),...wo(o/2+u*2,u,u,20,-90,-180),{x:-o/2-u,y:-l/2},...wo(o/2,l/2,u,20,0,90)],f=[{x:o/2,y:-l/2-u},{x:-o/2,y:-l/2-u},...wo(o/2,-l/2,u,20,-90,0),{x:-o/2-u,y:-u},...wo(o/2+o*.1,-u,u,20,-180,-270),...wo(o/2+o*.1,u,u,20,-90,-180),{x:-o/2-u,y:l/2},...wo(o/2,l/2,u,20,0,90),{x:-o/2,y:l/2+u},{x:o/2,y:l/2+u}],p=Rt.svg(i),g=Nt(e,{fill:"none"});e.look!=="handDrawn"&&(g.roughness=0,g.fillStyle="solid");const v=sr(d).replace("Z",""),y=p.path(v,g),b=sr(f),w=p.path(b,{...g}),T=i.insert("g",":first-child");return T.insert(()=>w,":first-child").attr("stroke-opacity",0),T.insert(()=>y,":first-child"),T.attr("class","text"),h&&e.look!=="handDrawn"&&T.selectAll("path").attr("style",h),n&&e.look!=="handDrawn"&&T.selectAll("path").attr("style",n),T.attr("transform",`translate(${u}, 0)`),s.attr("transform",`translate(${-o/2+u-(a.x-(a.left??0))},${-l/2+(e.padding??0)/2-(a.y-(a.top??0))})`),Dt(e,T),e.intersect=function(E){return St.polygon(e,f,E)},i}x(eP,"curlyBraceLeft");function To(t,e,r,n=100,i=0,a=180){const s=[],o=i*Math.PI/180,h=(a*Math.PI/180-o)/(n-1);for(let d=0;d<n;d++){const f=o+d*h,p=t+r*Math.cos(f),g=e+r*Math.sin(f);s.push({x:p,y:g})}return s}x(To,"generateCirclePoints");async function tP(t,e){const{labelStyles:r,nodeStyles:n}=Ct(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,label:s}=await Ut(t,e,$t(e)),o=a.width+(e.padding??0),l=a.height+(e.padding??0),u=Math.max(5,l*.1),{cssStyles:h}=e,d=[...To(o/2,-l/2,u,20,-90,0),{x:o/2+u,y:-u},...To(o/2+u*2,-u,u,20,-180,-270),...To(o/2+u*2,u,u,20,-90,-180),{x:o/2+u,y:l/2},...To(o/2,l/2,u,20,0,90)],f=[{x:-o/2,y:-l/2-u},{x:o/2,y:-l/2-u},...To(o/2,-l/2,u,20,-90,0),{x:o/2+u,y:-u},...To(o/2+u*2,-u,u,20,-180,-270),...To(o/2+u*2,u,u,20,-90,-180),{x:o/2+u,y:l/2},...To(o/2,l/2,u,20,0,90),{x:o/2,y:l/2+u},{x:-o/2,y:l/2+u}],p=Rt.svg(i),g=Nt(e,{fill:"none"});e.look!=="handDrawn"&&(g.roughness=0,g.fillStyle="solid");const v=sr(d).replace("Z",""),y=p.path(v,g),b=sr(f),w=p.path(b,{...g}),T=i.insert("g",":first-child");return T.insert(()=>w,":first-child").attr("stroke-opacity",0),T.insert(()=>y,":first-child"),T.attr("class","text"),h&&e.look!=="handDrawn"&&T.selectAll("path").attr("style",h),n&&e.look!=="handDrawn"&&T.selectAll("path").attr("style",n),T.attr("transform",`translate(${-u}, 0)`),s.attr("transform",`translate(${-o/2+(e.padding??0)/2-(a.x-(a.left??0))},${-l/2+(e.padding??0)/2-(a.y-(a.top??0))})`),Dt(e,T),e.intersect=function(E){return St.polygon(e,f,E)},i}x(tP,"curlyBraceRight");function ti(t,e,r,n=100,i=0,a=180){const s=[],o=i*Math.PI/180,h=(a*Math.PI/180-o)/(n-1);for(let d=0;d<n;d++){const f=o+d*h,p=t+r*Math.cos(f),g=e+r*Math.sin(f);s.push({x:-p,y:-g})}return s}x(ti,"generateCirclePoints");async function rP(t,e){const{labelStyles:r,nodeStyles:n}=Ct(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,label:s}=await Ut(t,e,$t(e)),o=a.width+(e.padding??0),l=a.height+(e.padding??0),u=Math.max(5,l*.1),{cssStyles:h}=e,d=[...ti(o/2,-l/2,u,30,-90,0),{x:-o/2-u,y:u},...ti(o/2+u*2,-u,u,20,-180,-270),...ti(o/2+u*2,u,u,20,-90,-180),{x:-o/2-u,y:-l/2},...ti(o/2,l/2,u,20,0,90)],f=[...ti(-o/2+u+u/2,-l/2,u,20,-90,-180),{x:o/2-u/2,y:u},...ti(-o/2-u/2,-u,u,20,0,90),...ti(-o/2-u/2,u,u,20,-90,0),{x:o/2-u/2,y:-u},...ti(-o/2+u+u/2,l/2,u,30,-180,-270)],p=[{x:o/2,y:-l/2-u},{x:-o/2,y:-l/2-u},...ti(o/2,-l/2,u,20,-90,0),{x:-o/2-u,y:-u},...ti(o/2+u*2,-u,u,20,-180,-270),...ti(o/2+u*2,u,u,20,-90,-180),{x:-o/2-u,y:l/2},...ti(o/2,l/2,u,20,0,90),{x:-o/2,y:l/2+u},{x:o/2-u-u/2,y:l/2+u},...ti(-o/2+u+u/2,-l/2,u,20,-90,-180),{x:o/2-u/2,y:u},...ti(-o/2-u/2,-u,u,20,0,90),...ti(-o/2-u/2,u,u,20,-90,0),{x:o/2-u/2,y:-u},...ti(-o/2+u+u/2,l/2,u,30,-180,-270)],g=Rt.svg(i),m=Nt(e,{fill:"none"});e.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=sr(d).replace("Z",""),b=g.path(y,m),T=sr(f).replace("Z",""),E=g.path(T,m),L=sr(p),S=g.path(L,{...m}),C=i.insert("g",":first-child");return C.insert(()=>S,":first-child").attr("stroke-opacity",0),C.insert(()=>b,":first-child"),C.insert(()=>E,":first-child"),C.attr("class","text"),h&&e.look!=="handDrawn"&&C.selectAll("path").attr("style",h),n&&e.look!=="handDrawn"&&C.selectAll("path").attr("style",n),C.attr("transform",`translate(${u-u/4}, 0)`),s.attr("transform",`translate(${-o/2+(e.padding??0)/2-(a.x-(a.left??0))},${-l/2+(e.padding??0)/2-(a.y-(a.top??0))})`),Dt(e,C),e.intersect=function(A){return St.polygon(e,p,A)},i}x(rP,"curlyBraces");async function nP(t,e){const{labelStyles:r,nodeStyles:n}=Ct(e);e.labelStyle=r;const{shapeSvg:i,bbox:a}=await Ut(t,e,$t(e)),s=80,o=20,l=Math.max(s,(a.width+(e.padding??0)*2)*1.25,e?.width??0),u=Math.max(o,a.height+(e.padding??0)*2,e?.height??0),h=u/2,{cssStyles:d}=e,f=Rt.svg(i),p=Nt(e,{});e.look!=="handDrawn"&&(p.roughness=0,p.fillStyle="solid");const g=l,m=u,v=g-h,y=m/4,b=[{x:v,y:0},{x:y,y:0},{x:0,y:m/2},{x:y,y:m},{x:v,y:m},...j0(-v,-m/2,h,50,270,90)],w=sr(b),T=f.path(w,p),E=i.insert(()=>T,":first-child");return E.attr("class","basic label-container"),d&&e.look!=="handDrawn"&&E.selectChildren("path").attr("style",d),n&&e.look!=="handDrawn"&&E.selectChildren("path").attr("style",n),E.attr("transform",`translate(${-l/2}, ${-u/2})`),Dt(e,E),e.intersect=function(L){return St.polygon(e,b,L)},i}x(nP,"curvedTrapezoid");var ise=x((t,e,r,n,i,a)=>[`M${t},${e+a}`,`a${i},${a} 0,0,0 ${r},0`,`a${i},${a} 0,0,0 ${-r},0`,`l0,${n}`,`a${i},${a} 0,0,0 ${r},0`,`l0,${-n}`].join(" "),"createCylinderPathD"),ase=x((t,e,r,n,i,a)=>[`M${t},${e+a}`,`M${t+r},${e+a}`,`a${i},${a} 0,0,0 ${-r},0`,`l0,${n}`,`a${i},${a} 0,0,0 ${r},0`,`l0,${-n}`].join(" "),"createOuterCylinderPathD"),sse=x((t,e,r,n,i,a)=>[`M${t-r/2},${-n/2}`,`a${i},${a} 0,0,0 ${r},0`].join(" "),"createInnerCylinderPathD");async function iP(t,e){const{labelStyles:r,nodeStyles:n}=Ct(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,label:s}=await Ut(t,e,$t(e)),o=Math.max(a.width+e.padding,e.width??0),l=o/2,u=l/(2.5+o/50),h=Math.max(a.height+u+e.padding,e.height??0);let d;const{cssStyles:f}=e;if(e.look==="handDrawn"){const p=Rt.svg(i),g=ase(0,0,o,h,l,u),m=sse(0,u,o,h,l,u),v=p.path(g,Nt(e,{})),y=p.path(m,Nt(e,{fill:"none"}));d=i.insert(()=>y,":first-child"),d=i.insert(()=>v,":first-child"),d.attr("class","basic label-container"),f&&d.attr("style",f)}else{const p=ise(0,0,o,h,l,u);d=i.insert("path",":first-child").attr("d",p).attr("class","basic label-container").attr("style",Si(f)).attr("style",n)}return d.attr("label-offset-y",u),d.attr("transform",`translate(${-o/2}, ${-(h/2+u)})`),Dt(e,d),s.attr("transform",`translate(${-(a.width/2)-(a.x-(a.left??0))}, ${-(a.height/2)+(e.padding??0)/1.5-(a.y-(a.top??0))})`),e.intersect=function(p){const g=St.rect(e,p),m=g.x-(e.x??0);if(l!=0&&(Math.abs(m)<(e.width??0)/2||Math.abs(m)==(e.width??0)/2&&Math.abs(g.y-(e.y??0))>(e.height??0)/2-u)){let v=u*u*(1-m*m/(l*l));v>0&&(v=Math.sqrt(v)),v=u-v,p.y-(e.y??0)>0&&(v=-v),g.y+=v}return g},i}x(iP,"cylinder");async function aP(t,e){const{labelStyles:r,nodeStyles:n}=Ct(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,label:s}=await Ut(t,e,$t(e)),o=a.width+e.padding,l=a.height+e.padding,u=l*.2,h=-o/2,d=-l/2-u/2,{cssStyles:f}=e,p=Rt.svg(i),g=Nt(e,{});e.look!=="handDrawn"&&(g.roughness=0,g.fillStyle="solid");const m=[{x:h,y:d+u},{x:-h,y:d+u},{x:-h,y:-d},{x:h,y:-d},{x:h,y:d},{x:-h,y:d},{x:-h,y:d+u}],v=p.polygon(m.map(b=>[b.x,b.y]),g),y=i.insert(()=>v,":first-child");return y.attr("class","basic label-container"),f&&e.look!=="handDrawn"&&y.selectAll("path").attr("style",f),n&&e.look!=="handDrawn"&&y.selectAll("path").attr("style",n),s.attr("transform",`translate(${h+(e.padding??0)/2-(a.x-(a.left??0))}, ${d+u+(e.padding??0)/2-(a.y-(a.top??0))})`),Dt(e,y),e.intersect=function(b){return St.rect(e,b)},i}x(aP,"dividedRectangle");async function sP(t,e){const{labelStyles:r,nodeStyles:n}=Ct(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,halfPadding:s}=await Ut(t,e,$t(e)),l=a.width/2+s+5,u=a.width/2+s;let h;const{cssStyles:d}=e;if(e.look==="handDrawn"){const f=Rt.svg(i),p=Nt(e,{roughness:.2,strokeWidth:2.5}),g=Nt(e,{roughness:.2,strokeWidth:1.5}),m=f.circle(0,0,l*2,p),v=f.circle(0,0,u*2,g);h=i.insert("g",":first-child"),h.attr("class",Si(e.cssClasses)).attr("style",Si(d)),h.node()?.appendChild(m),h.node()?.appendChild(v)}else{h=i.insert("g",":first-child");const f=h.insert("circle",":first-child"),p=h.insert("circle");h.attr("class","basic label-container").attr("style",n),f.attr("class","outer-circle").attr("style",n).attr("r",l).attr("cx",0).attr("cy",0),p.attr("class","inner-circle").attr("style",n).attr("r",u).attr("cx",0).attr("cy",0)}return Dt(e,h),e.intersect=function(f){return ie.info("DoubleCircle intersect",e,l,f),St.circle(e,l,f)},i}x(sP,"doublecircle");function oP(t,e,{config:{themeVariables:r}}){const{labelStyles:n,nodeStyles:i}=Ct(e);e.label="",e.labelStyle=n;const a=t.insert("g").attr("class",$t(e)).attr("id",e.domId??e.id),s=7,{cssStyles:o}=e,l=Rt.svg(a),{nodeBorder:u}=r,h=Nt(e,{fillStyle:"solid"});e.look!=="handDrawn"&&(h.roughness=0);const d=l.circle(0,0,s*2,h),f=a.insert(()=>d,":first-child");return f.selectAll("path").attr("style",`fill: ${u} !important;`),o&&o.length>0&&e.look!=="handDrawn"&&f.selectAll("path").attr("style",o),i&&e.look!=="handDrawn"&&f.selectAll("path").attr("style",i),Dt(e,f),e.intersect=function(p){return ie.info("filledCircle intersect",e,{radius:s,point:p}),St.circle(e,s,p)},a}x(oP,"filledCircle");async function lP(t,e){const{labelStyles:r,nodeStyles:n}=Ct(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,label:s}=await Ut(t,e,$t(e)),o=a.width+(e.padding??0),l=o+a.height,u=o+a.height,h=[{x:0,y:-l},{x:u,y:-l},{x:u/2,y:0}],{cssStyles:d}=e,f=Rt.svg(i),p=Nt(e,{});e.look!=="handDrawn"&&(p.roughness=0,p.fillStyle="solid");const g=sr(h),m=f.path(g,p),v=i.insert(()=>m,":first-child").attr("transform",`translate(${-l/2}, ${l/2})`);return d&&e.look!=="handDrawn"&&v.selectChildren("path").attr("style",d),n&&e.look!=="handDrawn"&&v.selectChildren("path").attr("style",n),e.width=o,e.height=l,Dt(e,v),s.attr("transform",`translate(${-a.width/2-(a.x-(a.left??0))}, ${-l/2+(e.padding??0)/2+(a.y-(a.top??0))})`),e.intersect=function(y){return ie.info("Triangle intersect",e,h,y),St.polygon(e,h,y)},i}x(lP,"flippedTriangle");function cP(t,e,{dir:r,config:{state:n,themeVariables:i}}){const{nodeStyles:a}=Ct(e);e.label="";const s=t.insert("g").attr("class",$t(e)).attr("id",e.domId??e.id),{cssStyles:o}=e;let l=Math.max(70,e?.width??0),u=Math.max(10,e?.height??0);r==="LR"&&(l=Math.max(10,e?.width??0),u=Math.max(70,e?.height??0));const h=-1*l/2,d=-1*u/2,f=Rt.svg(s),p=Nt(e,{stroke:i.lineColor,fill:i.lineColor});e.look!=="handDrawn"&&(p.roughness=0,p.fillStyle="solid");const g=f.rectangle(h,d,l,u,p),m=s.insert(()=>g,":first-child");o&&e.look!=="handDrawn"&&m.selectAll("path").attr("style",o),a&&e.look!=="handDrawn"&&m.selectAll("path").attr("style",a),Dt(e,m);const v=n?.padding??0;return e.width&&e.height&&(e.width+=v/2||0,e.height+=v/2||0),e.intersect=function(y){return St.rect(e,y)},s}x(cP,"forkJoin");async function uP(t,e){const{labelStyles:r,nodeStyles:n}=Ct(e);e.labelStyle=r;const i=80,a=50,{shapeSvg:s,bbox:o}=await Ut(t,e,$t(e)),l=Math.max(i,o.width+(e.padding??0)*2,e?.width??0),u=Math.max(a,o.height+(e.padding??0)*2,e?.height??0),h=u/2,{cssStyles:d}=e,f=Rt.svg(s),p=Nt(e,{});e.look!=="handDrawn"&&(p.roughness=0,p.fillStyle="solid");const g=[{x:-l/2,y:-u/2},{x:l/2-h,y:-u/2},...j0(-l/2+h,0,h,50,90,270),{x:l/2-h,y:u/2},{x:-l/2,y:u/2}],m=sr(g),v=f.path(m,p),y=s.insert(()=>v,":first-child");return y.attr("class","basic label-container"),d&&e.look!=="handDrawn"&&y.selectChildren("path").attr("style",d),n&&e.look!=="handDrawn"&&y.selectChildren("path").attr("style",n),Dt(e,y),e.intersect=function(b){return ie.info("Pill intersect",e,{radius:h,point:b}),St.polygon(e,g,b)},s}x(uP,"halfRoundedRectangle");async function hP(t,e){const{labelStyles:r,nodeStyles:n}=Ct(e);e.labelStyle=r;const{shapeSvg:i,bbox:a}=await Ut(t,e,$t(e)),s=a.height+(e.padding??0),o=a.width+(e.padding??0)*2.5,{cssStyles:l}=e,u=Rt.svg(i),h=Nt(e,{});e.look!=="handDrawn"&&(h.roughness=0,h.fillStyle="solid");let d=o/2;const f=d/6;d=d+f;const p=s/2,g=p/2,m=d-g,v=[{x:-m,y:-p},{x:0,y:-p},{x:m,y:-p},{x:d,y:0},{x:m,y:p},{x:0,y:p},{x:-m,y:p},{x:-d,y:0}],y=sr(v),b=u.path(y,h),w=i.insert(()=>b,":first-child");return w.attr("class","basic label-container"),l&&e.look!=="handDrawn"&&w.selectChildren("path").attr("style",l),n&&e.look!=="handDrawn"&&w.selectChildren("path").attr("style",n),e.width=o,e.height=s,Dt(e,w),e.intersect=function(T){return St.polygon(e,v,T)},i}x(hP,"hexagon");async function dP(t,e){const{labelStyles:r,nodeStyles:n}=Ct(e);e.label="",e.labelStyle=r;const{shapeSvg:i}=await Ut(t,e,$t(e)),a=Math.max(30,e?.width??0),s=Math.max(30,e?.height??0),{cssStyles:o}=e,l=Rt.svg(i),u=Nt(e,{});e.look!=="handDrawn"&&(u.roughness=0,u.fillStyle="solid");const h=[{x:0,y:0},{x:a,y:0},{x:0,y:s},{x:a,y:s}],d=sr(h),f=l.path(d,u),p=i.insert(()=>f,":first-child");return p.attr("class","basic label-container"),o&&e.look!=="handDrawn"&&p.selectChildren("path").attr("style",o),n&&e.look!=="handDrawn"&&p.selectChildren("path").attr("style",n),p.attr("transform",`translate(${-a/2}, ${-s/2})`),Dt(e,p),e.intersect=function(g){return ie.info("Pill intersect",e,{points:h}),St.polygon(e,h,g)},i}x(dP,"hourglass");async function fP(t,e,{config:{themeVariables:r,flowchart:n}}){const{labelStyles:i}=Ct(e);e.labelStyle=i;const a=e.assetHeight??48,s=e.assetWidth??48,o=Math.max(a,s),l=n?.wrappingWidth;e.width=Math.max(o,l??0);const{shapeSvg:u,bbox:h,label:d}=await Ut(t,e,"icon-shape default"),f=e.pos==="t",p=o,g=o,{nodeBorder:m}=r,{stylesMap:v}=bd(e),y=-g/2,b=-p/2,w=e.label?8:0,T=Rt.svg(u),E=Nt(e,{stroke:"none",fill:"none"});e.look!=="handDrawn"&&(E.roughness=0,E.fillStyle="solid");const L=T.rectangle(y,b,g,p,E),S=Math.max(g,h.width),C=p+h.height+w,A=T.rectangle(-S/2,-C/2,S,C,{...E,fill:"transparent",stroke:"none"}),N=u.insert(()=>L,":first-child"),_=u.insert(()=>A);if(e.icon){const O=u.append("g");O.html(`<g>${await Ol(e.icon,{height:o,width:o,fallbackPrefix:""})}</g>`);const P=O.node().getBBox(),k=P.width,R=P.height,I=P.x,M=P.y;O.attr("transform",`translate(${-k/2-I},${f?h.height/2+w/2-R/2-M:-h.height/2-w/2-R/2-M})`),O.attr("style",`color: ${v.get("stroke")??m};`)}return d.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${f?-C/2:C/2-h.height})`),N.attr("transform",`translate(0,${f?h.height/2+w/2:-h.height/2-w/2})`),Dt(e,_),e.intersect=function(O){if(ie.info("iconSquare intersect",e,O),!e.label)return St.rect(e,O);const P=e.x??0,k=e.y??0,R=e.height??0;let I=[];return f?I=[{x:P-h.width/2,y:k-R/2},{x:P+h.width/2,y:k-R/2},{x:P+h.width/2,y:k-R/2+h.height+w},{x:P+g/2,y:k-R/2+h.height+w},{x:P+g/2,y:k+R/2},{x:P-g/2,y:k+R/2},{x:P-g/2,y:k-R/2+h.height+w},{x:P-h.width/2,y:k-R/2+h.height+w}]:I=[{x:P-g/2,y:k-R/2},{x:P+g/2,y:k-R/2},{x:P+g/2,y:k-R/2+p},{x:P+h.width/2,y:k-R/2+p},{x:P+h.width/2/2,y:k+R/2},{x:P-h.width/2,y:k+R/2},{x:P-h.width/2,y:k-R/2+p},{x:P-g/2,y:k-R/2+p}],St.polygon(e,I,O)},u}x(fP,"icon");async function pP(t,e,{config:{themeVariables:r,flowchart:n}}){const{labelStyles:i}=Ct(e);e.labelStyle=i;const a=e.assetHeight??48,s=e.assetWidth??48,o=Math.max(a,s),l=n?.wrappingWidth;e.width=Math.max(o,l??0);const{shapeSvg:u,bbox:h,label:d}=await Ut(t,e,"icon-shape default"),f=20,p=e.label?8:0,g=e.pos==="t",{nodeBorder:m,mainBkg:v}=r,{stylesMap:y}=bd(e),b=Rt.svg(u),w=Nt(e,{});e.look!=="handDrawn"&&(w.roughness=0,w.fillStyle="solid");const T=y.get("fill");w.stroke=T??v;const E=u.append("g");e.icon&&E.html(`<g>${await Ol(e.icon,{height:o,width:o,fallbackPrefix:""})}</g>`);const L=E.node().getBBox(),S=L.width,C=L.height,A=L.x,N=L.y,_=Math.max(S,C)*Math.SQRT2+f*2,O=b.circle(0,0,_,w),P=Math.max(_,h.width),k=_+h.height+p,R=b.rectangle(-P/2,-k/2,P,k,{...w,fill:"transparent",stroke:"none"}),I=u.insert(()=>O,":first-child"),M=u.insert(()=>R);return E.attr("transform",`translate(${-S/2-A},${g?h.height/2+p/2-C/2-N:-h.height/2-p/2-C/2-N})`),E.attr("style",`color: ${y.get("stroke")??m};`),d.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${g?-k/2:k/2-h.height})`),I.attr("transform",`translate(0,${g?h.height/2+p/2:-h.height/2-p/2})`),Dt(e,M),e.intersect=function(D){return ie.info("iconSquare intersect",e,D),St.rect(e,D)},u}x(pP,"iconCircle");async function gP(t,e,{config:{themeVariables:r,flowchart:n}}){const{labelStyles:i}=Ct(e);e.labelStyle=i;const a=e.assetHeight??48,s=e.assetWidth??48,o=Math.max(a,s),l=n?.wrappingWidth;e.width=Math.max(o,l??0);const{shapeSvg:u,bbox:h,halfPadding:d,label:f}=await Ut(t,e,"icon-shape default"),p=e.pos==="t",g=o+d*2,m=o+d*2,{nodeBorder:v,mainBkg:y}=r,{stylesMap:b}=bd(e),w=-m/2,T=-g/2,E=e.label?8:0,L=Rt.svg(u),S=Nt(e,{});e.look!=="handDrawn"&&(S.roughness=0,S.fillStyle="solid");const C=b.get("fill");S.stroke=C??y;const A=L.path(rc(w,T,m,g,5),S),N=Math.max(m,h.width),_=g+h.height+E,O=L.rectangle(-N/2,-_/2,N,_,{...S,fill:"transparent",stroke:"none"}),P=u.insert(()=>A,":first-child").attr("class","icon-shape2"),k=u.insert(()=>O);if(e.icon){const R=u.append("g");R.html(`<g>${await Ol(e.icon,{height:o,width:o,fallbackPrefix:""})}</g>`);const I=R.node().getBBox(),M=I.width,D=I.height,B=I.x,$=I.y;R.attr("transform",`translate(${-M/2-B},${p?h.height/2+E/2-D/2-$:-h.height/2-E/2-D/2-$})`),R.attr("style",`color: ${b.get("stroke")??v};`)}return f.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${p?-_/2:_/2-h.height})`),P.attr("transform",`translate(0,${p?h.height/2+E/2:-h.height/2-E/2})`),Dt(e,k),e.intersect=function(R){if(ie.info("iconSquare intersect",e,R),!e.label)return St.rect(e,R);const I=e.x??0,M=e.y??0,D=e.height??0;let B=[];return p?B=[{x:I-h.width/2,y:M-D/2},{x:I+h.width/2,y:M-D/2},{x:I+h.width/2,y:M-D/2+h.height+E},{x:I+m/2,y:M-D/2+h.height+E},{x:I+m/2,y:M+D/2},{x:I-m/2,y:M+D/2},{x:I-m/2,y:M-D/2+h.height+E},{x:I-h.width/2,y:M-D/2+h.height+E}]:B=[{x:I-m/2,y:M-D/2},{x:I+m/2,y:M-D/2},{x:I+m/2,y:M-D/2+g},{x:I+h.width/2,y:M-D/2+g},{x:I+h.width/2/2,y:M+D/2},{x:I-h.width/2,y:M+D/2},{x:I-h.width/2,y:M-D/2+g},{x:I-m/2,y:M-D/2+g}],St.polygon(e,B,R)},u}x(gP,"iconRounded");async function mP(t,e,{config:{themeVariables:r,flowchart:n}}){const{labelStyles:i}=Ct(e);e.labelStyle=i;const a=e.assetHeight??48,s=e.assetWidth??48,o=Math.max(a,s),l=n?.wrappingWidth;e.width=Math.max(o,l??0);const{shapeSvg:u,bbox:h,halfPadding:d,label:f}=await Ut(t,e,"icon-shape default"),p=e.pos==="t",g=o+d*2,m=o+d*2,{nodeBorder:v,mainBkg:y}=r,{stylesMap:b}=bd(e),w=-m/2,T=-g/2,E=e.label?8:0,L=Rt.svg(u),S=Nt(e,{});e.look!=="handDrawn"&&(S.roughness=0,S.fillStyle="solid");const C=b.get("fill");S.stroke=C??y;const A=L.path(rc(w,T,m,g,.1),S),N=Math.max(m,h.width),_=g+h.height+E,O=L.rectangle(-N/2,-_/2,N,_,{...S,fill:"transparent",stroke:"none"}),P=u.insert(()=>A,":first-child"),k=u.insert(()=>O);if(e.icon){const R=u.append("g");R.html(`<g>${await Ol(e.icon,{height:o,width:o,fallbackPrefix:""})}</g>`);const I=R.node().getBBox(),M=I.width,D=I.height,B=I.x,$=I.y;R.attr("transform",`translate(${-M/2-B},${p?h.height/2+E/2-D/2-$:-h.height/2-E/2-D/2-$})`),R.attr("style",`color: ${b.get("stroke")??v};`)}return f.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${p?-_/2:_/2-h.height})`),P.attr("transform",`translate(0,${p?h.height/2+E/2:-h.height/2-E/2})`),Dt(e,k),e.intersect=function(R){if(ie.info("iconSquare intersect",e,R),!e.label)return St.rect(e,R);const I=e.x??0,M=e.y??0,D=e.height??0;let B=[];return p?B=[{x:I-h.width/2,y:M-D/2},{x:I+h.width/2,y:M-D/2},{x:I+h.width/2,y:M-D/2+h.height+E},{x:I+m/2,y:M-D/2+h.height+E},{x:I+m/2,y:M+D/2},{x:I-m/2,y:M+D/2},{x:I-m/2,y:M-D/2+h.height+E},{x:I-h.width/2,y:M-D/2+h.height+E}]:B=[{x:I-m/2,y:M-D/2},{x:I+m/2,y:M-D/2},{x:I+m/2,y:M-D/2+g},{x:I+h.width/2,y:M-D/2+g},{x:I+h.width/2/2,y:M+D/2},{x:I-h.width/2,y:M+D/2},{x:I-h.width/2,y:M-D/2+g},{x:I-m/2,y:M-D/2+g}],St.polygon(e,B,R)},u}x(mP,"iconSquare");async function vP(t,e,{config:{flowchart:r}}){const n=new Image;n.src=e?.img??"",await n.decode();const i=Number(n.naturalWidth.toString().replace("px","")),a=Number(n.naturalHeight.toString().replace("px",""));e.imageAspectRatio=i/a;const{labelStyles:s}=Ct(e);e.labelStyle=s;const o=r?.wrappingWidth;e.defaultWidth=r?.wrappingWidth;const l=Math.max(e.label?o??0:0,e?.assetWidth??i),u=e.constraint==="on"&&e?.assetHeight?e.assetHeight*e.imageAspectRatio:l,h=e.constraint==="on"?u/e.imageAspectRatio:e?.assetHeight??a;e.width=Math.max(u,o??0);const{shapeSvg:d,bbox:f,label:p}=await Ut(t,e,"image-shape default"),g=e.pos==="t",m=-u/2,v=-h/2,y=e.label?8:0,b=Rt.svg(d),w=Nt(e,{});e.look!=="handDrawn"&&(w.roughness=0,w.fillStyle="solid");const T=b.rectangle(m,v,u,h,w),E=Math.max(u,f.width),L=h+f.height+y,S=b.rectangle(-E/2,-L/2,E,L,{...w,fill:"none",stroke:"none"}),C=d.insert(()=>T,":first-child"),A=d.insert(()=>S);if(e.img){const N=d.append("image");N.attr("href",e.img),N.attr("width",u),N.attr("height",h),N.attr("preserveAspectRatio","none"),N.attr("transform",`translate(${-u/2},${g?L/2-h:-L/2})`)}return p.attr("transform",`translate(${-f.width/2-(f.x-(f.left??0))},${g?-h/2-f.height/2-y/2:h/2-f.height/2+y/2})`),C.attr("transform",`translate(0,${g?f.height/2+y/2:-f.height/2-y/2})`),Dt(e,A),e.intersect=function(N){if(ie.info("iconSquare intersect",e,N),!e.label)return St.rect(e,N);const _=e.x??0,O=e.y??0,P=e.height??0;let k=[];return g?k=[{x:_-f.width/2,y:O-P/2},{x:_+f.width/2,y:O-P/2},{x:_+f.width/2,y:O-P/2+f.height+y},{x:_+u/2,y:O-P/2+f.height+y},{x:_+u/2,y:O+P/2},{x:_-u/2,y:O+P/2},{x:_-u/2,y:O-P/2+f.height+y},{x:_-f.width/2,y:O-P/2+f.height+y}]:k=[{x:_-u/2,y:O-P/2},{x:_+u/2,y:O-P/2},{x:_+u/2,y:O-P/2+h},{x:_+f.width/2,y:O-P/2+h},{x:_+f.width/2/2,y:O+P/2},{x:_-f.width/2,y:O+P/2},{x:_-f.width/2,y:O-P/2+h},{x:_-u/2,y:O-P/2+h}],St.polygon(e,k,N)},d}x(vP,"imageSquare");async function yP(t,e){const{labelStyles:r,nodeStyles:n}=Ct(e);e.labelStyle=r;const{shapeSvg:i,bbox:a}=await Ut(t,e,$t(e)),s=Math.max(a.width+(e.padding??0)*2,e?.width??0),o=Math.max(a.height+(e.padding??0)*2,e?.height??0),l=[{x:0,y:0},{x:s,y:0},{x:s+3*o/6,y:-o},{x:-3*o/6,y:-o}];let u;const{cssStyles:h}=e;if(e.look==="handDrawn"){const d=Rt.svg(i),f=Nt(e,{}),p=sr(l),g=d.path(p,f);u=i.insert(()=>g,":first-child").attr("transform",`translate(${-s/2}, ${o/2})`),h&&u.attr("style",h)}else u=nc(i,s,o,l);return n&&u.attr("style",n),e.width=s,e.height=o,Dt(e,u),e.intersect=function(d){return St.polygon(e,l,d)},i}x(yP,"inv_trapezoid");async function s2(t,e,r){const{labelStyles:n,nodeStyles:i}=Ct(e);e.labelStyle=n;const{shapeSvg:a,bbox:s}=await Ut(t,e,$t(e)),o=Math.max(s.width+r.labelPaddingX*2,e?.width||0),l=Math.max(s.height+r.labelPaddingY*2,e?.height||0),u=-o/2,h=-l/2;let d,{rx:f,ry:p}=e;const{cssStyles:g}=e;if(r?.rx&&r.ry&&(f=r.rx,p=r.ry),e.look==="handDrawn"){const m=Rt.svg(a),v=Nt(e,{}),y=f||p?m.path(rc(u,h,o,l,f||0),v):m.rectangle(u,h,o,l,v);d=a.insert(()=>y,":first-child"),d.attr("class","basic label-container").attr("style",Si(g))}else d=a.insert("rect",":first-child"),d.attr("class","basic label-container").attr("style",i).attr("rx",Si(f)).attr("ry",Si(p)).attr("x",u).attr("y",h).attr("width",o).attr("height",l);return Dt(e,d),e.calcIntersect=function(m,v){return St.rect(m,v)},e.intersect=function(m){return St.rect(e,m)},a}x(s2,"drawRect");async function xP(t,e){const{shapeSvg:r,bbox:n,label:i}=await Ut(t,e,"label"),a=r.insert("rect",":first-child");return a.attr("width",.1).attr("height",.1),r.attr("class","label edgeLabel"),i.attr("transform",`translate(${-(n.width/2)-(n.x-(n.left??0))}, ${-(n.height/2)-(n.y-(n.top??0))})`),Dt(e,a),e.intersect=function(l){return St.rect(e,l)},r}x(xP,"labelRect");async function bP(t,e){const{labelStyles:r,nodeStyles:n}=Ct(e);e.labelStyle=r;const{shapeSvg:i,bbox:a}=await Ut(t,e,$t(e)),s=Math.max(a.width+(e.padding??0),e?.width??0),o=Math.max(a.height+(e.padding??0),e?.height??0),l=[{x:0,y:0},{x:s+3*o/6,y:0},{x:s,y:-o},{x:-(3*o)/6,y:-o}];let u;const{cssStyles:h}=e;if(e.look==="handDrawn"){const d=Rt.svg(i),f=Nt(e,{}),p=sr(l),g=d.path(p,f);u=i.insert(()=>g,":first-child").attr("transform",`translate(${-s/2}, ${o/2})`),h&&u.attr("style",h)}else u=nc(i,s,o,l);return n&&u.attr("style",n),e.width=s,e.height=o,Dt(e,u),e.intersect=function(d){return St.polygon(e,l,d)},i}x(bP,"lean_left");async function wP(t,e){const{labelStyles:r,nodeStyles:n}=Ct(e);e.labelStyle=r;const{shapeSvg:i,bbox:a}=await Ut(t,e,$t(e)),s=Math.max(a.width+(e.padding??0),e?.width??0),o=Math.max(a.height+(e.padding??0),e?.height??0),l=[{x:-3*o/6,y:0},{x:s,y:0},{x:s+3*o/6,y:-o},{x:0,y:-o}];let u;const{cssStyles:h}=e;if(e.look==="handDrawn"){const d=Rt.svg(i),f=Nt(e,{}),p=sr(l),g=d.path(p,f);u=i.insert(()=>g,":first-child").attr("transform",`translate(${-s/2}, ${o/2})`),h&&u.attr("style",h)}else u=nc(i,s,o,l);return n&&u.attr("style",n),e.width=s,e.height=o,Dt(e,u),e.intersect=function(d){return St.polygon(e,l,d)},i}x(wP,"lean_right");function TP(t,e){const{labelStyles:r,nodeStyles:n}=Ct(e);e.label="",e.labelStyle=r;const i=t.insert("g").attr("class",$t(e)).attr("id",e.domId??e.id),{cssStyles:a}=e,s=Math.max(35,e?.width??0),o=Math.max(35,e?.height??0),l=7,u=[{x:s,y:0},{x:0,y:o+l/2},{x:s-2*l,y:o+l/2},{x:0,y:2*o},{x:s,y:o-l/2},{x:2*l,y:o-l/2}],h=Rt.svg(i),d=Nt(e,{});e.look!=="handDrawn"&&(d.roughness=0,d.fillStyle="solid");const f=sr(u),p=h.path(f,d),g=i.insert(()=>p,":first-child");return a&&e.look!=="handDrawn"&&g.selectAll("path").attr("style",a),n&&e.look!=="handDrawn"&&g.selectAll("path").attr("style",n),g.attr("transform",`translate(-${s/2},${-o})`),Dt(e,g),e.intersect=function(m){return ie.info("lightningBolt intersect",e,m),St.polygon(e,u,m)},i}x(TP,"lightningBolt");var ose=x((t,e,r,n,i,a,s)=>[`M${t},${e+a}`,`a${i},${a} 0,0,0 ${r},0`,`a${i},${a} 0,0,0 ${-r},0`,`l0,${n}`,`a${i},${a} 0,0,0 ${r},0`,`l0,${-n}`,`M${t},${e+a+s}`,`a${i},${a} 0,0,0 ${r},0`].join(" "),"createCylinderPathD"),lse=x((t,e,r,n,i,a,s)=>[`M${t},${e+a}`,`M${t+r},${e+a}`,`a${i},${a} 0,0,0 ${-r},0`,`l0,${n}`,`a${i},${a} 0,0,0 ${r},0`,`l0,${-n}`,`M${t},${e+a+s}`,`a${i},${a} 0,0,0 ${r},0`].join(" "),"createOuterCylinderPathD"),cse=x((t,e,r,n,i,a)=>[`M${t-r/2},${-n/2}`,`a${i},${a} 0,0,0 ${r},0`].join(" "),"createInnerCylinderPathD");async function EP(t,e){const{labelStyles:r,nodeStyles:n}=Ct(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,label:s}=await Ut(t,e,$t(e)),o=Math.max(a.width+(e.padding??0),e.width??0),l=o/2,u=l/(2.5+o/50),h=Math.max(a.height+u+(e.padding??0),e.height??0),d=h*.1;let f;const{cssStyles:p}=e;if(e.look==="handDrawn"){const g=Rt.svg(i),m=lse(0,0,o,h,l,u,d),v=cse(0,u,o,h,l,u),y=Nt(e,{}),b=g.path(m,y),w=g.path(v,y);i.insert(()=>w,":first-child").attr("class","line"),f=i.insert(()=>b,":first-child"),f.attr("class","basic label-container"),p&&f.attr("style",p)}else{const g=ose(0,0,o,h,l,u,d);f=i.insert("path",":first-child").attr("d",g).attr("class","basic label-container").attr("style",Si(p)).attr("style",n)}return f.attr("label-offset-y",u),f.attr("transform",`translate(${-o/2}, ${-(h/2+u)})`),Dt(e,f),s.attr("transform",`translate(${-(a.width/2)-(a.x-(a.left??0))}, ${-(a.height/2)+u-(a.y-(a.top??0))})`),e.intersect=function(g){const m=St.rect(e,g),v=m.x-(e.x??0);if(l!=0&&(Math.abs(v)<(e.width??0)/2||Math.abs(v)==(e.width??0)/2&&Math.abs(m.y-(e.y??0))>(e.height??0)/2-u)){let y=u*u*(1-v*v/(l*l));y>0&&(y=Math.sqrt(y)),y=u-y,g.y-(e.y??0)>0&&(y=-y),m.y+=y}return m},i}x(EP,"linedCylinder");async function kP(t,e){const{labelStyles:r,nodeStyles:n}=Ct(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,label:s}=await Ut(t,e,$t(e)),o=Math.max(a.width+(e.padding??0)*2,e?.width??0),l=Math.max(a.height+(e.padding??0)*2,e?.height??0),u=l/4,h=l+u,{cssStyles:d}=e,f=Rt.svg(i),p=Nt(e,{});e.look!=="handDrawn"&&(p.roughness=0,p.fillStyle="solid");const g=[{x:-o/2-o/2*.1,y:-h/2},{x:-o/2-o/2*.1,y:h/2},...Bl(-o/2-o/2*.1,h/2,o/2+o/2*.1,h/2,u,.8),{x:o/2+o/2*.1,y:-h/2},{x:-o/2-o/2*.1,y:-h/2},{x:-o/2,y:-h/2},{x:-o/2,y:h/2*1.1},{x:-o/2,y:-h/2}],m=f.polygon(g.map(y=>[y.x,y.y]),p),v=i.insert(()=>m,":first-child");return v.attr("class","basic label-container"),d&&e.look!=="handDrawn"&&v.selectAll("path").attr("style",d),n&&e.look!=="handDrawn"&&v.selectAll("path").attr("style",n),v.attr("transform",`translate(0,${-u/2})`),s.attr("transform",`translate(${-o/2+(e.padding??0)+o/2*.1/2-(a.x-(a.left??0))},${-l/2+(e.padding??0)-u/2-(a.y-(a.top??0))})`),Dt(e,v),e.intersect=function(y){return St.polygon(e,g,y)},i}x(kP,"linedWaveEdgedRect");async function SP(t,e){const{labelStyles:r,nodeStyles:n}=Ct(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,label:s}=await Ut(t,e,$t(e)),o=Math.max(a.width+(e.padding??0)*2,e?.width??0),l=Math.max(a.height+(e.padding??0)*2,e?.height??0),u=5,h=-o/2,d=-l/2,{cssStyles:f}=e,p=Rt.svg(i),g=Nt(e,{}),m=[{x:h-u,y:d+u},{x:h-u,y:d+l+u},{x:h+o-u,y:d+l+u},{x:h+o-u,y:d+l},{x:h+o,y:d+l},{x:h+o,y:d+l-u},{x:h+o+u,y:d+l-u},{x:h+o+u,y:d-u},{x:h+u,y:d-u},{x:h+u,y:d},{x:h,y:d},{x:h,y:d+u}],v=[{x:h,y:d+u},{x:h+o-u,y:d+u},{x:h+o-u,y:d+l},{x:h+o,y:d+l},{x:h+o,y:d},{x:h,y:d}];e.look!=="handDrawn"&&(g.roughness=0,g.fillStyle="solid");const y=sr(m),b=p.path(y,g),w=sr(v),T=p.path(w,{...g,fill:"none"}),E=i.insert(()=>T,":first-child");return E.insert(()=>b,":first-child"),E.attr("class","basic label-container"),f&&e.look!=="handDrawn"&&E.selectAll("path").attr("style",f),n&&e.look!=="handDrawn"&&E.selectAll("path").attr("style",n),s.attr("transform",`translate(${-(a.width/2)-u-(a.x-(a.left??0))}, ${-(a.height/2)+u-(a.y-(a.top??0))})`),Dt(e,E),e.intersect=function(L){return St.polygon(e,m,L)},i}x(SP,"multiRect");async function CP(t,e){const{labelStyles:r,nodeStyles:n}=Ct(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,label:s}=await Ut(t,e,$t(e)),o=Math.max(a.width+(e.padding??0)*2,e?.width??0),l=Math.max(a.height+(e.padding??0)*2,e?.height??0),u=l/4,h=l+u,d=-o/2,f=-h/2,p=5,{cssStyles:g}=e,m=Bl(d-p,f+h+p,d+o-p,f+h+p,u,.8),v=m?.[m.length-1],y=[{x:d-p,y:f+p},{x:d-p,y:f+h+p},...m,{x:d+o-p,y:v.y-p},{x:d+o,y:v.y-p},{x:d+o,y:v.y-2*p},{x:d+o+p,y:v.y-2*p},{x:d+o+p,y:f-p},{x:d+p,y:f-p},{x:d+p,y:f},{x:d,y:f},{x:d,y:f+p}],b=[{x:d,y:f+p},{x:d+o-p,y:f+p},{x:d+o-p,y:v.y-p},{x:d+o,y:v.y-p},{x:d+o,y:f},{x:d,y:f}],w=Rt.svg(i),T=Nt(e,{});e.look!=="handDrawn"&&(T.roughness=0,T.fillStyle="solid");const E=sr(y),L=w.path(E,T),S=sr(b),C=w.path(S,T),A=i.insert(()=>L,":first-child");return A.insert(()=>C),A.attr("class","basic label-container"),g&&e.look!=="handDrawn"&&A.selectAll("path").attr("style",g),n&&e.look!=="handDrawn"&&A.selectAll("path").attr("style",n),A.attr("transform",`translate(0,${-u/2})`),s.attr("transform",`translate(${-(a.width/2)-p-(a.x-(a.left??0))}, ${-(a.height/2)+p-u/2-(a.y-(a.top??0))})`),Dt(e,A),e.intersect=function(N){return St.polygon(e,y,N)},i}x(CP,"multiWaveEdgedRectangle");async function AP(t,e,{config:{themeVariables:r}}){const{labelStyles:n,nodeStyles:i}=Ct(e);e.labelStyle=n,e.useHtmlLabels||gr().flowchart?.htmlLabels!==!1||(e.centerLabel=!0);const{shapeSvg:s,bbox:o,label:l}=await Ut(t,e,$t(e)),u=Math.max(o.width+(e.padding??0)*2,e?.width??0),h=Math.max(o.height+(e.padding??0)*2,e?.height??0),d=-u/2,f=-h/2,{cssStyles:p}=e,g=Rt.svg(s),m=Nt(e,{fill:r.noteBkgColor,stroke:r.noteBorderColor});e.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const v=g.rectangle(d,f,u,h,m),y=s.insert(()=>v,":first-child");return y.attr("class","basic label-container"),p&&e.look!=="handDrawn"&&y.selectAll("path").attr("style",p),i&&e.look!=="handDrawn"&&y.selectAll("path").attr("style",i),l.attr("transform",`translate(${-o.width/2-(o.x-(o.left??0))}, ${-(o.height/2)-(o.y-(o.top??0))})`),Dt(e,y),e.intersect=function(b){return St.rect(e,b)},s}x(AP,"note");var use=x((t,e,r)=>[`M${t+r/2},${e}`,`L${t+r},${e-r/2}`,`L${t+r/2},${e-r}`,`L${t},${e-r/2}`,"Z"].join(" "),"createDecisionBoxPathD");async function _P(t,e){const{labelStyles:r,nodeStyles:n}=Ct(e);e.labelStyle=r;const{shapeSvg:i,bbox:a}=await Ut(t,e,$t(e)),s=a.width+e.padding,o=a.height+e.padding,l=s+o,u=.5,h=[{x:l/2,y:0},{x:l,y:-l/2},{x:l/2,y:-l},{x:0,y:-l/2}];let d;const{cssStyles:f}=e;if(e.look==="handDrawn"){const p=Rt.svg(i),g=Nt(e,{}),m=use(0,0,l),v=p.path(m,g);d=i.insert(()=>v,":first-child").attr("transform",`translate(${-l/2+u}, ${l/2})`),f&&d.attr("style",f)}else d=nc(i,l,l,h),d.attr("transform",`translate(${-l/2+u}, ${l/2})`);return n&&d.attr("style",n),Dt(e,d),e.calcIntersect=function(p,g){const m=p.width,v=[{x:m/2,y:0},{x:m,y:-m/2},{x:m/2,y:-m},{x:0,y:-m/2}],y=St.polygon(p,v,g);return{x:y.x-.5,y:y.y-.5}},e.intersect=function(p){return this.calcIntersect(e,p)},i}x(_P,"question");async function LP(t,e){const{labelStyles:r,nodeStyles:n}=Ct(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,label:s}=await Ut(t,e,$t(e)),o=Math.max(a.width+(e.padding??0),e?.width??0),l=Math.max(a.height+(e.padding??0),e?.height??0),u=-o/2,h=-l/2,d=h/2,f=[{x:u+d,y:h},{x:u,y:0},{x:u+d,y:-h},{x:-u,y:-h},{x:-u,y:h}],{cssStyles:p}=e,g=Rt.svg(i),m=Nt(e,{});e.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const v=sr(f),y=g.path(v,m),b=i.insert(()=>y,":first-child");return b.attr("class","basic label-container"),p&&e.look!=="handDrawn"&&b.selectAll("path").attr("style",p),n&&e.look!=="handDrawn"&&b.selectAll("path").attr("style",n),b.attr("transform",`translate(${-d/2},0)`),s.attr("transform",`translate(${-d/2-a.width/2-(a.x-(a.left??0))}, ${-(a.height/2)-(a.y-(a.top??0))})`),Dt(e,b),e.intersect=function(w){return St.polygon(e,f,w)},i}x(LP,"rect_left_inv_arrow");async function RP(t,e){const{labelStyles:r,nodeStyles:n}=Ct(e);e.labelStyle=r;let i;e.cssClasses?i="node "+e.cssClasses:i="node default";const a=t.insert("g").attr("class",i).attr("id",e.domId||e.id),s=a.insert("g"),o=a.insert("g").attr("class","label").attr("style",n),l=e.description,u=e.label,h=o.node().appendChild(await Hc(u,e.labelStyle,!0,!0));let d={width:0,height:0};if(Ir(we()?.flowchart?.htmlLabels)){const C=h.children[0],A=Qe(h);d=C.getBoundingClientRect(),A.attr("width",d.width),A.attr("height",d.height)}ie.info("Text 2",l);const f=l||[],p=h.getBBox(),g=o.node().appendChild(await Hc(f.join?f.join("<br/>"):f,e.labelStyle,!0,!0)),m=g.children[0],v=Qe(g);d=m.getBoundingClientRect(),v.attr("width",d.width),v.attr("height",d.height);const y=(e.padding||0)/2;Qe(g).attr("transform","translate( "+(d.width>p.width?0:(p.width-d.width)/2)+", "+(p.height+y+5)+")"),Qe(h).attr("transform","translate( "+(d.width<p.width?0:-(p.width-d.width)/2)+", 0)"),d=o.node().getBBox(),o.attr("transform","translate("+-d.width/2+", "+(-d.height/2-y+3)+")");const b=d.width+(e.padding||0),w=d.height+(e.padding||0),T=-d.width/2-y,E=-d.height/2-y;let L,S;if(e.look==="handDrawn"){const C=Rt.svg(a),A=Nt(e,{}),N=C.path(rc(T,E,b,w,e.rx||0),A),_=C.line(-d.width/2-y,-d.height/2-y+p.height+y,d.width/2+y,-d.height/2-y+p.height+y,A);S=a.insert(()=>(ie.debug("Rough node insert CXC",N),_),":first-child"),L=a.insert(()=>(ie.debug("Rough node insert CXC",N),N),":first-child")}else L=s.insert("rect",":first-child"),S=s.insert("line"),L.attr("class","outer title-state").attr("style",n).attr("x",-d.width/2-y).attr("y",-d.height/2-y).attr("width",d.width+(e.padding||0)).attr("height",d.height+(e.padding||0)),S.attr("class","divider").attr("x1",-d.width/2-y).attr("x2",d.width/2+y).attr("y1",-d.height/2-y+p.height+y).attr("y2",-d.height/2-y+p.height+y);return Dt(e,L),e.intersect=function(C){return St.rect(e,C)},a}x(RP,"rectWithTitle");function Tf(t,e,r,n,i,a,s){const l=(t+r)/2,u=(e+n)/2,h=Math.atan2(n-e,r-t),d=(r-t)/2,f=(n-e)/2,p=d/i,g=f/a,m=Math.sqrt(p**2+g**2);if(m>1)throw new Error("The given radii are too small to create an arc between the points.");const v=Math.sqrt(1-m**2),y=l+v*a*Math.sin(h)*(s?-1:1),b=u-v*i*Math.cos(h)*(s?-1:1),w=Math.atan2((e-b)/a,(t-y)/i);let E=Math.atan2((n-b)/a,(r-y)/i)-w;s&&E<0&&(E+=2*Math.PI),!s&&E>0&&(E-=2*Math.PI);const L=[];for(let S=0;S<20;S++){const C=S/19,A=w+C*E,N=y+i*Math.cos(A),_=b+a*Math.sin(A);L.push({x:N,y:_})}return L}x(Tf,"generateArcPoints");async function NP(t,e){const{labelStyles:r,nodeStyles:n}=Ct(e);e.labelStyle=r;const{shapeSvg:i,bbox:a}=await Ut(t,e,$t(e)),s=e?.padding??0,o=e?.padding??0,l=(e?.width?e?.width:a.width)+s*2,u=(e?.height?e?.height:a.height)+o*2,h=e.radius||5,d=e.taper||5,{cssStyles:f}=e,p=Rt.svg(i),g=Nt(e,{});e.stroke&&(g.stroke=e.stroke),e.look!=="handDrawn"&&(g.roughness=0,g.fillStyle="solid");const m=[{x:-l/2+d,y:-u/2},{x:l/2-d,y:-u/2},...Tf(l/2-d,-u/2,l/2,-u/2+d,h,h,!0),{x:l/2,y:-u/2+d},{x:l/2,y:u/2-d},...Tf(l/2,u/2-d,l/2-d,u/2,h,h,!0),{x:l/2-d,y:u/2},{x:-l/2+d,y:u/2},...Tf(-l/2+d,u/2,-l/2,u/2-d,h,h,!0),{x:-l/2,y:u/2-d},{x:-l/2,y:-u/2+d},...Tf(-l/2,-u/2+d,-l/2+d,-u/2,h,h,!0)],v=sr(m),y=p.path(v,g),b=i.insert(()=>y,":first-child");return b.attr("class","basic label-container outer-path"),f&&e.look!=="handDrawn"&&b.selectChildren("path").attr("style",f),n&&e.look!=="handDrawn"&&b.selectChildren("path").attr("style",n),Dt(e,b),e.intersect=function(w){return St.polygon(e,m,w)},i}x(NP,"roundedRect");async function DP(t,e){const{labelStyles:r,nodeStyles:n}=Ct(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,label:s}=await Ut(t,e,$t(e)),o=e?.padding??0,l=Math.max(a.width+(e.padding??0)*2,e?.width??0),u=Math.max(a.height+(e.padding??0)*2,e?.height??0),h=-a.width/2-o,d=-a.height/2-o,{cssStyles:f}=e,p=Rt.svg(i),g=Nt(e,{});e.look!=="handDrawn"&&(g.roughness=0,g.fillStyle="solid");const m=[{x:h,y:d},{x:h+l+8,y:d},{x:h+l+8,y:d+u},{x:h-8,y:d+u},{x:h-8,y:d},{x:h,y:d},{x:h,y:d+u}],v=p.polygon(m.map(b=>[b.x,b.y]),g),y=i.insert(()=>v,":first-child");return y.attr("class","basic label-container").attr("style",Si(f)),n&&e.look!=="handDrawn"&&y.selectAll("path").attr("style",n),f&&e.look!=="handDrawn"&&y.selectAll("path").attr("style",n),s.attr("transform",`translate(${-l/2+4+(e.padding??0)-(a.x-(a.left??0))},${-u/2+(e.padding??0)-(a.y-(a.top??0))})`),Dt(e,y),e.intersect=function(b){return St.rect(e,b)},i}x(DP,"shadedProcess");async function MP(t,e){const{labelStyles:r,nodeStyles:n}=Ct(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,label:s}=await Ut(t,e,$t(e)),o=Math.max(a.width+(e.padding??0)*2,e?.width??0),l=Math.max(a.height+(e.padding??0)*2,e?.height??0),u=-o/2,h=-l/2,{cssStyles:d}=e,f=Rt.svg(i),p=Nt(e,{});e.look!=="handDrawn"&&(p.roughness=0,p.fillStyle="solid");const g=[{x:u,y:h},{x:u,y:h+l},{x:u+o,y:h+l},{x:u+o,y:h-l/2}],m=sr(g),v=f.path(m,p),y=i.insert(()=>v,":first-child");return y.attr("class","basic label-container"),d&&e.look!=="handDrawn"&&y.selectChildren("path").attr("style",d),n&&e.look!=="handDrawn"&&y.selectChildren("path").attr("style",n),y.attr("transform",`translate(0, ${l/4})`),s.attr("transform",`translate(${-o/2+(e.padding??0)-(a.x-(a.left??0))}, ${-l/4+(e.padding??0)-(a.y-(a.top??0))})`),Dt(e,y),e.intersect=function(b){return St.polygon(e,g,b)},i}x(MP,"slopedRect");async function IP(t,e){const r={rx:0,ry:0,labelPaddingX:e.labelPaddingX??(e?.padding||0)*2,labelPaddingY:(e?.padding||0)*1};return s2(t,e,r)}x(IP,"squareRect");async function OP(t,e){const{labelStyles:r,nodeStyles:n}=Ct(e);e.labelStyle=r;const{shapeSvg:i,bbox:a}=await Ut(t,e,$t(e)),s=a.height+e.padding,o=a.width+s/4+e.padding,l=s/2,{cssStyles:u}=e,h=Rt.svg(i),d=Nt(e,{});e.look!=="handDrawn"&&(d.roughness=0,d.fillStyle="solid");const f=[{x:-o/2+l,y:-s/2},{x:o/2-l,y:-s/2},...j0(-o/2+l,0,l,50,90,270),{x:o/2-l,y:s/2},...j0(o/2-l,0,l,50,270,450)],p=sr(f),g=h.path(p,d),m=i.insert(()=>g,":first-child");return m.attr("class","basic label-container outer-path"),u&&e.look!=="handDrawn"&&m.selectChildren("path").attr("style",u),n&&e.look!=="handDrawn"&&m.selectChildren("path").attr("style",n),Dt(e,m),e.intersect=function(v){return St.polygon(e,f,v)},i}x(OP,"stadium");async function PP(t,e){return s2(t,e,{rx:5,ry:5})}x(PP,"state");function BP(t,e,{config:{themeVariables:r}}){const{labelStyles:n,nodeStyles:i}=Ct(e);e.labelStyle=n;const{cssStyles:a}=e,{lineColor:s,stateBorder:o,nodeBorder:l}=r,u=t.insert("g").attr("class","node default").attr("id",e.domId||e.id),h=Rt.svg(u),d=Nt(e,{});e.look!=="handDrawn"&&(d.roughness=0,d.fillStyle="solid");const f=h.circle(0,0,14,{...d,stroke:s,strokeWidth:2}),p=o??l,g=h.circle(0,0,5,{...d,fill:p,stroke:p,strokeWidth:2,fillStyle:"solid"}),m=u.insert(()=>f,":first-child");return m.insert(()=>g),a&&m.selectAll("path").attr("style",a),i&&m.selectAll("path").attr("style",i),Dt(e,m),e.intersect=function(v){return St.circle(e,7,v)},u}x(BP,"stateEnd");function FP(t,e,{config:{themeVariables:r}}){const{lineColor:n}=r,i=t.insert("g").attr("class","node default").attr("id",e.domId||e.id);let a;if(e.look==="handDrawn"){const o=Rt.svg(i).circle(0,0,14,jte(n));a=i.insert(()=>o),a.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14)}else a=i.insert("circle",":first-child"),a.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14);return Dt(e,a),e.intersect=function(s){return St.circle(e,7,s)},i}x(FP,"stateStart");async function $P(t,e){const{labelStyles:r,nodeStyles:n}=Ct(e);e.labelStyle=r;const{shapeSvg:i,bbox:a}=await Ut(t,e,$t(e)),s=(e?.padding||0)/2,o=a.width+e.padding,l=a.height+e.padding,u=-a.width/2-s,h=-a.height/2-s,d=[{x:0,y:0},{x:o,y:0},{x:o,y:-l},{x:0,y:-l},{x:0,y:0},{x:-8,y:0},{x:o+8,y:0},{x:o+8,y:-l},{x:-8,y:-l},{x:-8,y:0}];if(e.look==="handDrawn"){const f=Rt.svg(i),p=Nt(e,{}),g=f.rectangle(u-8,h,o+16,l,p),m=f.line(u,h,u,h+l,p),v=f.line(u+o,h,u+o,h+l,p);i.insert(()=>m,":first-child"),i.insert(()=>v,":first-child");const y=i.insert(()=>g,":first-child"),{cssStyles:b}=e;y.attr("class","basic label-container").attr("style",Si(b)),Dt(e,y)}else{const f=nc(i,o,l,d);n&&f.attr("style",n),Dt(e,f)}return e.intersect=function(f){return St.polygon(e,d,f)},i}x($P,"subroutine");async function zP(t,e){const{labelStyles:r,nodeStyles:n}=Ct(e);e.labelStyle=r;const{shapeSvg:i,bbox:a}=await Ut(t,e,$t(e)),s=Math.max(a.width+(e.padding??0)*2,e?.width??0),o=Math.max(a.height+(e.padding??0)*2,e?.height??0),l=-s/2,u=-o/2,h=.2*o,d=.2*o,{cssStyles:f}=e,p=Rt.svg(i),g=Nt(e,{}),m=[{x:l-h/2,y:u},{x:l+s+h/2,y:u},{x:l+s+h/2,y:u+o},{x:l-h/2,y:u+o}],v=[{x:l+s-h/2,y:u+o},{x:l+s+h/2,y:u+o},{x:l+s+h/2,y:u+o-d}];e.look!=="handDrawn"&&(g.roughness=0,g.fillStyle="solid");const y=sr(m),b=p.path(y,g),w=sr(v),T=p.path(w,{...g,fillStyle:"solid"}),E=i.insert(()=>T,":first-child");return E.insert(()=>b,":first-child"),E.attr("class","basic label-container"),f&&e.look!=="handDrawn"&&E.selectAll("path").attr("style",f),n&&e.look!=="handDrawn"&&E.selectAll("path").attr("style",n),Dt(e,E),e.intersect=function(L){return St.polygon(e,m,L)},i}x(zP,"taggedRect");async function VP(t,e){const{labelStyles:r,nodeStyles:n}=Ct(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,label:s}=await Ut(t,e,$t(e)),o=Math.max(a.width+(e.padding??0)*2,e?.width??0),l=Math.max(a.height+(e.padding??0)*2,e?.height??0),u=l/4,h=.2*o,d=.2*l,f=l+u,{cssStyles:p}=e,g=Rt.svg(i),m=Nt(e,{});e.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const v=[{x:-o/2-o/2*.1,y:f/2},...Bl(-o/2-o/2*.1,f/2,o/2+o/2*.1,f/2,u,.8),{x:o/2+o/2*.1,y:-f/2},{x:-o/2-o/2*.1,y:-f/2}],y=-o/2+o/2*.1,b=-f/2-d*.4,w=[{x:y+o-h,y:(b+l)*1.4},{x:y+o,y:b+l-d},{x:y+o,y:(b+l)*.9},...Bl(y+o,(b+l)*1.3,y+o-h,(b+l)*1.5,-l*.03,.5)],T=sr(v),E=g.path(T,m),L=sr(w),S=g.path(L,{...m,fillStyle:"solid"}),C=i.insert(()=>S,":first-child");return C.insert(()=>E,":first-child"),C.attr("class","basic label-container"),p&&e.look!=="handDrawn"&&C.selectAll("path").attr("style",p),n&&e.look!=="handDrawn"&&C.selectAll("path").attr("style",n),C.attr("transform",`translate(0,${-u/2})`),s.attr("transform",`translate(${-o/2+(e.padding??0)-(a.x-(a.left??0))},${-l/2+(e.padding??0)-u/2-(a.y-(a.top??0))})`),Dt(e,C),e.intersect=function(A){return St.polygon(e,v,A)},i}x(VP,"taggedWaveEdgedRectangle");async function GP(t,e){const{labelStyles:r,nodeStyles:n}=Ct(e);e.labelStyle=r;const{shapeSvg:i,bbox:a}=await Ut(t,e,$t(e)),s=Math.max(a.width+e.padding,e?.width||0),o=Math.max(a.height+e.padding,e?.height||0),l=-s/2,u=-o/2,h=i.insert("rect",":first-child");return h.attr("class","text").attr("style",n).attr("rx",0).attr("ry",0).attr("x",l).attr("y",u).attr("width",s).attr("height",o),Dt(e,h),e.intersect=function(d){return St.rect(e,d)},i}x(GP,"text");var hse=x((t,e,r,n,i,a)=>`M${t},${e}
    a${i},${a} 0,0,1 0,${-n}
    l${r},0
    a${i},${a} 0,0,1 0,${n}
    M${r},${-n}
    a${i},${a} 0,0,0 0,${n}
    l${-r},0`,"createCylinderPathD"),dse=x((t,e,r,n,i,a)=>[`M${t},${e}`,`M${t+r},${e}`,`a${i},${a} 0,0,0 0,${-n}`,`l${-r},0`,`a${i},${a} 0,0,0 0,${n}`,`l${r},0`].join(" "),"createOuterCylinderPathD"),fse=x((t,e,r,n,i,a)=>[`M${t+r/2},${-n/2}`,`a${i},${a} 0,0,0 0,${n}`].join(" "),"createInnerCylinderPathD");async function UP(t,e){const{labelStyles:r,nodeStyles:n}=Ct(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,label:s,halfPadding:o}=await Ut(t,e,$t(e)),l=e.look==="neo"?o*2:o,u=a.height+l,h=u/2,d=h/(2.5+u/50),f=a.width+d+l,{cssStyles:p}=e;let g;if(e.look==="handDrawn"){const m=Rt.svg(i),v=dse(0,0,f,u,d,h),y=fse(0,0,f,u,d,h),b=m.path(v,Nt(e,{})),w=m.path(y,Nt(e,{fill:"none"}));g=i.insert(()=>w,":first-child"),g=i.insert(()=>b,":first-child"),g.attr("class","basic label-container"),p&&g.attr("style",p)}else{const m=hse(0,0,f,u,d,h);g=i.insert("path",":first-child").attr("d",m).attr("class","basic label-container").attr("style",Si(p)).attr("style",n),g.attr("class","basic label-container"),p&&g.selectAll("path").attr("style",p),n&&g.selectAll("path").attr("style",n)}return g.attr("label-offset-x",d),g.attr("transform",`translate(${-f/2}, ${u/2} )`),s.attr("transform",`translate(${-(a.width/2)-d-(a.x-(a.left??0))}, ${-(a.height/2)-(a.y-(a.top??0))})`),Dt(e,g),e.intersect=function(m){const v=St.rect(e,m),y=v.y-(e.y??0);if(h!=0&&(Math.abs(y)<(e.height??0)/2||Math.abs(y)==(e.height??0)/2&&Math.abs(v.x-(e.x??0))>(e.width??0)/2-d)){let b=d*d*(1-y*y/(h*h));b!=0&&(b=Math.sqrt(Math.abs(b))),b=d-b,m.x-(e.x??0)>0&&(b=-b),v.x+=b}return v},i}x(UP,"tiltedCylinder");async function WP(t,e){const{labelStyles:r,nodeStyles:n}=Ct(e);e.labelStyle=r;const{shapeSvg:i,bbox:a}=await Ut(t,e,$t(e)),s=a.width+e.padding,o=a.height+e.padding,l=[{x:-3*o/6,y:0},{x:s+3*o/6,y:0},{x:s,y:-o},{x:0,y:-o}];let u;const{cssStyles:h}=e;if(e.look==="handDrawn"){const d=Rt.svg(i),f=Nt(e,{}),p=sr(l),g=d.path(p,f);u=i.insert(()=>g,":first-child").attr("transform",`translate(${-s/2}, ${o/2})`),h&&u.attr("style",h)}else u=nc(i,s,o,l);return n&&u.attr("style",n),e.width=s,e.height=o,Dt(e,u),e.intersect=function(d){return St.polygon(e,l,d)},i}x(WP,"trapezoid");async function HP(t,e){const{labelStyles:r,nodeStyles:n}=Ct(e);e.labelStyle=r;const{shapeSvg:i,bbox:a}=await Ut(t,e,$t(e)),s=60,o=20,l=Math.max(s,a.width+(e.padding??0)*2,e?.width??0),u=Math.max(o,a.height+(e.padding??0)*2,e?.height??0),{cssStyles:h}=e,d=Rt.svg(i),f=Nt(e,{});e.look!=="handDrawn"&&(f.roughness=0,f.fillStyle="solid");const p=[{x:-l/2*.8,y:-u/2},{x:l/2*.8,y:-u/2},{x:l/2,y:-u/2*.6},{x:l/2,y:u/2},{x:-l/2,y:u/2},{x:-l/2,y:-u/2*.6}],g=sr(p),m=d.path(g,f),v=i.insert(()=>m,":first-child");return v.attr("class","basic label-container"),h&&e.look!=="handDrawn"&&v.selectChildren("path").attr("style",h),n&&e.look!=="handDrawn"&&v.selectChildren("path").attr("style",n),Dt(e,v),e.intersect=function(y){return St.polygon(e,p,y)},i}x(HP,"trapezoidalPentagon");async function qP(t,e){const{labelStyles:r,nodeStyles:n}=Ct(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,label:s}=await Ut(t,e,$t(e)),o=Ir(we().flowchart?.htmlLabels),l=a.width+(e.padding??0),u=l+a.height,h=l+a.height,d=[{x:0,y:0},{x:h,y:0},{x:h/2,y:-u}],{cssStyles:f}=e,p=Rt.svg(i),g=Nt(e,{});e.look!=="handDrawn"&&(g.roughness=0,g.fillStyle="solid");const m=sr(d),v=p.path(m,g),y=i.insert(()=>v,":first-child").attr("transform",`translate(${-u/2}, ${u/2})`);return f&&e.look!=="handDrawn"&&y.selectChildren("path").attr("style",f),n&&e.look!=="handDrawn"&&y.selectChildren("path").attr("style",n),e.width=l,e.height=u,Dt(e,y),s.attr("transform",`translate(${-a.width/2-(a.x-(a.left??0))}, ${u/2-(a.height+(e.padding??0)/(o?2:1)-(a.y-(a.top??0)))})`),e.intersect=function(b){return ie.info("Triangle intersect",e,d,b),St.polygon(e,d,b)},i}x(qP,"triangle");async function YP(t,e){const{labelStyles:r,nodeStyles:n}=Ct(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,label:s}=await Ut(t,e,$t(e)),o=Math.max(a.width+(e.padding??0)*2,e?.width??0),l=Math.max(a.height+(e.padding??0)*2,e?.height??0),u=l/8,h=l+u,{cssStyles:d}=e,p=70-o,g=p>0?p/2:0,m=Rt.svg(i),v=Nt(e,{});e.look!=="handDrawn"&&(v.roughness=0,v.fillStyle="solid");const y=[{x:-o/2-g,y:h/2},...Bl(-o/2-g,h/2,o/2+g,h/2,u,.8),{x:o/2+g,y:-h/2},{x:-o/2-g,y:-h/2}],b=sr(y),w=m.path(b,v),T=i.insert(()=>w,":first-child");return T.attr("class","basic label-container"),d&&e.look!=="handDrawn"&&T.selectAll("path").attr("style",d),n&&e.look!=="handDrawn"&&T.selectAll("path").attr("style",n),T.attr("transform",`translate(0,${-u/2})`),s.attr("transform",`translate(${-o/2+(e.padding??0)-(a.x-(a.left??0))},${-l/2+(e.padding??0)-u-(a.y-(a.top??0))})`),Dt(e,T),e.intersect=function(E){return St.polygon(e,y,E)},i}x(YP,"waveEdgedRectangle");async function XP(t,e){const{labelStyles:r,nodeStyles:n}=Ct(e);e.labelStyle=r;const{shapeSvg:i,bbox:a}=await Ut(t,e,$t(e)),s=100,o=50,l=Math.max(a.width+(e.padding??0)*2,e?.width??0),u=Math.max(a.height+(e.padding??0)*2,e?.height??0),h=l/u;let d=l,f=u;d>f*h?f=d/h:d=f*h,d=Math.max(d,s),f=Math.max(f,o);const p=Math.min(f*.2,f/4),g=f+p*2,{cssStyles:m}=e,v=Rt.svg(i),y=Nt(e,{});e.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const b=[{x:-d/2,y:g/2},...Bl(-d/2,g/2,d/2,g/2,p,1),{x:d/2,y:-g/2},...Bl(d/2,-g/2,-d/2,-g/2,p,-1)],w=sr(b),T=v.path(w,y),E=i.insert(()=>T,":first-child");return E.attr("class","basic label-container"),m&&e.look!=="handDrawn"&&E.selectAll("path").attr("style",m),n&&e.look!=="handDrawn"&&E.selectAll("path").attr("style",n),Dt(e,E),e.intersect=function(L){return St.polygon(e,b,L)},i}x(XP,"waveRectangle");async function jP(t,e){const{labelStyles:r,nodeStyles:n}=Ct(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,label:s}=await Ut(t,e,$t(e)),o=Math.max(a.width+(e.padding??0)*2,e?.width??0),l=Math.max(a.height+(e.padding??0)*2,e?.height??0),u=5,h=-o/2,d=-l/2,{cssStyles:f}=e,p=Rt.svg(i),g=Nt(e,{}),m=[{x:h-u,y:d-u},{x:h-u,y:d+l},{x:h+o,y:d+l},{x:h+o,y:d-u}],v=`M${h-u},${d-u} L${h+o},${d-u} L${h+o},${d+l} L${h-u},${d+l} L${h-u},${d-u}
                M${h-u},${d} L${h+o},${d}
                M${h},${d-u} L${h},${d+l}`;e.look!=="handDrawn"&&(g.roughness=0,g.fillStyle="solid");const y=p.path(v,g),b=i.insert(()=>y,":first-child");return b.attr("transform",`translate(${u/2}, ${u/2})`),b.attr("class","basic label-container"),f&&e.look!=="handDrawn"&&b.selectAll("path").attr("style",f),n&&e.look!=="handDrawn"&&b.selectAll("path").attr("style",n),s.attr("transform",`translate(${-(a.width/2)+u/2-(a.x-(a.left??0))}, ${-(a.height/2)+u/2-(a.y-(a.top??0))})`),Dt(e,b),e.intersect=function(w){return St.polygon(e,m,w)},i}x(jP,"windowPane");async function Z6(t,e){const r=e;if(r.alias&&(e.label=r.alias),e.look==="handDrawn"){const{themeVariables:G}=gr(),{background:W}=G,J={...e,id:e.id+"-background",look:"default",cssStyles:["stroke: none",`fill: ${W}`]};await Z6(t,J)}const n=gr();e.useHtmlLabels=n.htmlLabels;let i=n.er?.diagramPadding??10,a=n.er?.entityPadding??6;const{cssStyles:s}=e,{labelStyles:o,nodeStyles:l}=Ct(e);if(r.attributes.length===0&&e.label){const G={rx:0,ry:0,labelPaddingX:i,labelPaddingY:i*1.5};Vi(e.label,n)+G.labelPaddingX*2<n.er.minEntityWidth&&(e.width=n.er.minEntityWidth);const W=await s2(t,e,G);if(!Ir(n.htmlLabels)){const J=W.select("text"),q=J.node()?.getBBox();J.attr("transform",`translate(${-q.width/2}, 0)`)}return W}n.htmlLabels||(i*=1.25,a*=1.25);let u=$t(e);u||(u="node default");const h=t.insert("g").attr("class",u).attr("id",e.domId||e.id),d=await ch(h,e.label??"",n,0,0,["name"],o);d.height+=a;let f=0;const p=[],g=[];let m=0,v=0,y=0,b=0,w=!0,T=!0;for(const G of r.attributes){const W=await ch(h,G.type,n,0,f,["attribute-type"],o);m=Math.max(m,W.width+i);const J=await ch(h,G.name,n,0,f,["attribute-name"],o);v=Math.max(v,J.width+i);const q=await ch(h,G.keys.join(),n,0,f,["attribute-keys"],o);y=Math.max(y,q.width+i);const ne=await ch(h,G.comment,n,0,f,["attribute-comment"],o);b=Math.max(b,ne.width+i);const ae=Math.max(W.height,J.height,q.height,ne.height)+a;g.push({yOffset:f,rowHeight:ae}),f+=ae}let E=4;y<=i&&(w=!1,y=0,E--),b<=i&&(T=!1,b=0,E--);const L=h.node().getBBox();if(d.width+i*2-(m+v+y+b)>0){const G=d.width+i*2-(m+v+y+b);m+=G/E,v+=G/E,y>0&&(y+=G/E),b>0&&(b+=G/E)}const S=m+v+y+b,C=Rt.svg(h),A=Nt(e,{});e.look!=="handDrawn"&&(A.roughness=0,A.fillStyle="solid");let N=0;g.length>0&&(N=g.reduce((G,W)=>G+(W?.rowHeight??0),0));const _=Math.max(L.width+i*2,e?.width||0,S),O=Math.max((N??0)+d.height,e?.height||0),P=-_/2,k=-O/2;h.selectAll("g:not(:first-child)").each((G,W,J)=>{const q=Qe(J[W]),ne=q.attr("transform");let ae=0,pe=0;if(ne){const Z=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(ne);Z&&(ae=parseFloat(Z[1]),pe=parseFloat(Z[2]),q.attr("class").includes("attribute-name")?ae+=m:q.attr("class").includes("attribute-keys")?ae+=m+v:q.attr("class").includes("attribute-comment")&&(ae+=m+v+y))}q.attr("transform",`translate(${P+i/2+ae}, ${pe+k+d.height+a/2})`)}),h.select(".name").attr("transform","translate("+-d.width/2+", "+(k+a/2)+")");const R=C.rectangle(P,k,_,O,A),I=h.insert(()=>R,":first-child").attr("style",s.join("")),{themeVariables:M}=gr(),{rowEven:D,rowOdd:B,nodeBorder:$}=M;p.push(0);for(const[G,W]of g.entries()){const q=(G+1)%2===0&&W.yOffset!==0,ne=C.rectangle(P,d.height+k+W?.yOffset,_,W?.rowHeight,{...A,fill:q?D:B,stroke:$});h.insert(()=>ne,"g.label").attr("style",s.join("")).attr("class",`row-rect-${q?"even":"odd"}`)}let F=C.line(P,d.height+k,_+P,d.height+k,A);h.insert(()=>F).attr("class","divider"),F=C.line(m+P,d.height+k,m+P,O+k,A),h.insert(()=>F).attr("class","divider"),w&&(F=C.line(m+v+P,d.height+k,m+v+P,O+k,A),h.insert(()=>F).attr("class","divider")),T&&(F=C.line(m+v+y+P,d.height+k,m+v+y+P,O+k,A),h.insert(()=>F).attr("class","divider"));for(const G of p)F=C.line(P,d.height+k+G,_+P,d.height+k+G,A),h.insert(()=>F).attr("class","divider");if(Dt(e,I),l&&e.look!=="handDrawn"){const W=l.split(";")?.filter(J=>J.includes("stroke"))?.map(J=>`${J}`).join("; ");h.selectAll("path").attr("style",W??""),h.selectAll(".row-rect-even path").attr("style",l)}return e.intersect=function(G){return St.rect(e,G)},h}x(Z6,"erBox");async function ch(t,e,r,n=0,i=0,a=[],s=""){const o=t.insert("g").attr("class",`label ${a.join(" ")}`).attr("transform",`translate(${n}, ${i})`).attr("style",s);e!==pl(e)&&(e=pl(e),e=e.replaceAll("<","&lt;").replaceAll(">","&gt;"));const l=o.node().appendChild(await Ra(o,e,{width:Vi(e,r)+100,style:s,useHtmlLabels:r.htmlLabels},r));if(e.includes("&lt;")||e.includes("&gt;")){let h=l.children[0];for(h.textContent=h.textContent.replaceAll("&lt;","<").replaceAll("&gt;",">");h.childNodes[0];)h=h.childNodes[0],h.textContent=h.textContent.replaceAll("&lt;","<").replaceAll("&gt;",">")}let u=l.getBBox();if(Ir(r.htmlLabels)){const h=l.children[0];h.style.textAlign="start";const d=Qe(l);u=h.getBoundingClientRect(),d.attr("width",u.width),d.attr("height",u.height)}return u}x(ch,"addText");async function KP(t,e,r,n,i=r.class.padding??12){const a=n?0:3,s=t.insert("g").attr("class",$t(e)).attr("id",e.domId||e.id);let o=null,l=null,u=null,h=null,d=0,f=0,p=0;if(o=s.insert("g").attr("class","annotation-group text"),e.annotations.length>0){const b=e.annotations[0];await Ef(o,{text:`«${b}»`},0),d=o.node().getBBox().height}l=s.insert("g").attr("class","label-group text"),await Ef(l,e,0,["font-weight: bolder"]);const g=l.node().getBBox();f=g.height,u=s.insert("g").attr("class","members-group text");let m=0;for(const b of e.members){const w=await Ef(u,b,m,[b.parseClassifier()]);m+=w+a}p=u.node().getBBox().height,p<=0&&(p=i/2),h=s.insert("g").attr("class","methods-group text");let v=0;for(const b of e.methods){const w=await Ef(h,b,v,[b.parseClassifier()]);v+=w+a}let y=s.node().getBBox();if(o!==null){const b=o.node().getBBox();o.attr("transform",`translate(${-b.width/2})`)}return l.attr("transform",`translate(${-g.width/2}, ${d})`),y=s.node().getBBox(),u.attr("transform",`translate(0, ${d+f+i*2})`),y=s.node().getBBox(),h.attr("transform",`translate(0, ${d+f+(p?p+i*4:i*2)})`),y=s.node().getBBox(),{shapeSvg:s,bbox:y}}x(KP,"textHelper");async function Ef(t,e,r,n=[]){const i=t.insert("g").attr("class","label").attr("style",n.join("; ")),a=gr();let s="useHtmlLabels"in e?e.useHtmlLabels:Ir(a.htmlLabels)??!0,o="";"text"in e?o=e.text:o=e.label,!s&&o.startsWith("\\")&&(o=o.substring(1)),un(o)&&(s=!0);const l=await Ra(i,t6(Ks(o)),{width:Vi(o,a)+50,classes:"markdown-node-label",useHtmlLabels:s},a);let u,h=1;if(s){const d=l.children[0],f=Qe(l);h=d.innerHTML.split("<br>").length,d.innerHTML.includes("</math>")&&(h+=d.innerHTML.split("<mrow>").length-1);const p=d.getElementsByTagName("img");if(p){const g=o.replace(/<img[^>]*>/g,"").trim()==="";await Promise.all([...p].map(m=>new Promise(v=>{function y(){if(m.style.display="flex",m.style.flexDirection="column",g){const b=a.fontSize?.toString()??window.getComputedStyle(document.body).fontSize,T=parseInt(b,10)*5+"px";m.style.minWidth=T,m.style.maxWidth=T}else m.style.width="100%";v(m)}x(y,"setupImage"),setTimeout(()=>{m.complete&&y()}),m.addEventListener("error",y),m.addEventListener("load",y)})))}u=d.getBoundingClientRect(),f.attr("width",u.width),f.attr("height",u.height)}else{n.includes("font-weight: bolder")&&Qe(l).selectAll("tspan").attr("font-weight",""),h=l.children.length;const d=l.children[0];(l.textContent===""||l.textContent.includes("&gt"))&&(d.textContent=o[0]+o.substring(1).replaceAll("&gt;",">").replaceAll("&lt;","<").trim(),o[1]===" "&&(d.textContent=d.textContent[0]+" "+d.textContent.substring(1))),d.textContent==="undefined"&&(d.textContent=""),u=l.getBBox()}return i.attr("transform","translate(0,"+(-u.height/(2*h)+r)+")"),u.height}x(Ef,"addText");async function ZP(t,e){const r=we(),n=r.class.padding??12,i=n,a=e.useHtmlLabels??Ir(r.htmlLabels)??!0,s=e;s.annotations=s.annotations??[],s.members=s.members??[],s.methods=s.methods??[];const{shapeSvg:o,bbox:l}=await KP(t,e,r,a,i),{labelStyles:u,nodeStyles:h}=Ct(e);e.labelStyle=u,e.cssStyles=s.styles||"";const d=s.styles?.join(";")||h||"";e.cssStyles||(e.cssStyles=d.replaceAll("!important","").split(";"));const f=s.members.length===0&&s.methods.length===0&&!r.class?.hideEmptyMembersBox,p=Rt.svg(o),g=Nt(e,{});e.look!=="handDrawn"&&(g.roughness=0,g.fillStyle="solid");const m=l.width;let v=l.height;s.members.length===0&&s.methods.length===0?v+=i:s.members.length>0&&s.methods.length===0&&(v+=i*2);const y=-m/2,b=-v/2,w=p.rectangle(y-n,b-n-(f?n:s.members.length===0&&s.methods.length===0?-n/2:0),m+2*n,v+2*n+(f?n*2:s.members.length===0&&s.methods.length===0?-n:0),g),T=o.insert(()=>w,":first-child");T.attr("class","basic label-container");const E=T.node().getBBox();o.selectAll(".text").each((A,N,_)=>{const O=Qe(_[N]),P=O.attr("transform");let k=0;if(P){const D=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(P);D&&(k=parseFloat(D[2]))}let R=k+b+n-(f?n:s.members.length===0&&s.methods.length===0?-n/2:0);a||(R-=4);let I=y;(O.attr("class").includes("label-group")||O.attr("class").includes("annotation-group"))&&(I=-O.node()?.getBBox().width/2||0,o.selectAll("text").each(function(M,D,B){window.getComputedStyle(B[D]).textAnchor==="middle"&&(I=0)})),O.attr("transform",`translate(${I}, ${R})`)});const L=o.select(".annotation-group").node().getBBox().height-(f?n/2:0)||0,S=o.select(".label-group").node().getBBox().height-(f?n/2:0)||0,C=o.select(".members-group").node().getBBox().height-(f?n/2:0)||0;if(s.members.length>0||s.methods.length>0||f){const A=p.line(E.x,L+S+b+n,E.x+E.width,L+S+b+n,g);o.insert(()=>A).attr("class","divider").attr("style",d)}if(f||s.members.length>0||s.methods.length>0){const A=p.line(E.x,L+S+C+b+i*2+n,E.x+E.width,L+S+C+b+n+i*2,g);o.insert(()=>A).attr("class","divider").attr("style",d)}if(s.look!=="handDrawn"&&o.selectAll("path").attr("style",d),T.select(":nth-child(2)").attr("style",d),o.selectAll(".divider").select("path").attr("style",d),e.labelStyle?o.selectAll("span").attr("style",e.labelStyle):o.selectAll("span").attr("style",d),!a){const A=RegExp(/color\s*:\s*([^;]*)/),N=A.exec(d);if(N){const _=N[0].replace("color","fill");o.selectAll("tspan").attr("style",_)}else if(u){const _=A.exec(u);if(_){const O=_[0].replace("color","fill");o.selectAll("tspan").attr("style",O)}}}return Dt(e,T),e.intersect=function(A){return St.rect(e,A)},o}x(ZP,"classBox");async function QP(t,e){const{labelStyles:r,nodeStyles:n}=Ct(e);e.labelStyle=r;const i=e,a=e,s=20,o=20,l="verifyMethod"in e,u=$t(e),h=t.insert("g").attr("class",u).attr("id",e.domId??e.id);let d;l?d=await Is(h,`&lt;&lt;${i.type}&gt;&gt;`,0,e.labelStyle):d=await Is(h,"&lt;&lt;Element&gt;&gt;",0,e.labelStyle);let f=d;const p=await Is(h,i.name,f,e.labelStyle+"; font-weight: bold;");if(f+=p+o,l){const L=await Is(h,`${i.requirementId?`ID: ${i.requirementId}`:""}`,f,e.labelStyle);f+=L;const S=await Is(h,`${i.text?`Text: ${i.text}`:""}`,f,e.labelStyle);f+=S;const C=await Is(h,`${i.risk?`Risk: ${i.risk}`:""}`,f,e.labelStyle);f+=C,await Is(h,`${i.verifyMethod?`Verification: ${i.verifyMethod}`:""}`,f,e.labelStyle)}else{const L=await Is(h,`${a.type?`Type: ${a.type}`:""}`,f,e.labelStyle);f+=L,await Is(h,`${a.docRef?`Doc Ref: ${a.docRef}`:""}`,f,e.labelStyle)}const g=(h.node()?.getBBox().width??200)+s,m=(h.node()?.getBBox().height??200)+s,v=-g/2,y=-m/2,b=Rt.svg(h),w=Nt(e,{});e.look!=="handDrawn"&&(w.roughness=0,w.fillStyle="solid");const T=b.rectangle(v,y,g,m,w),E=h.insert(()=>T,":first-child");if(E.attr("class","basic label-container").attr("style",n),h.selectAll(".label").each((L,S,C)=>{const A=Qe(C[S]),N=A.attr("transform");let _=0,O=0;if(N){const I=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(N);I&&(_=parseFloat(I[1]),O=parseFloat(I[2]))}const P=O-m/2;let k=v+s/2;(S===0||S===1)&&(k=_),A.attr("transform",`translate(${k}, ${P+s})`)}),f>d+p+o){const L=b.line(v,y+d+p+o,v+g,y+d+p+o,w);h.insert(()=>L).attr("style",n)}return Dt(e,E),e.intersect=function(L){return St.rect(e,L)},h}x(QP,"requirementBox");async function Is(t,e,r,n=""){if(e==="")return 0;const i=t.insert("g").attr("class","label").attr("style",n),a=we(),s=a.htmlLabels??!0,o=await Ra(i,t6(Ks(e)),{width:Vi(e,a)+50,classes:"markdown-node-label",useHtmlLabels:s,style:n},a);let l;if(s){const u=o.children[0],h=Qe(o);l=u.getBoundingClientRect(),h.attr("width",l.width),h.attr("height",l.height)}else{const u=o.children[0];for(const h of u.children)h.textContent=h.textContent.replaceAll("&gt;",">").replaceAll("&lt;","<"),n&&h.setAttribute("style",n);l=o.getBBox(),l.height+=6}return i.attr("transform",`translate(${-l.width/2},${-l.height/2+r})`),l.height}x(Is,"addText");var pse=x(t=>{switch(t){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 JP(t,e,{config:r}){const{labelStyles:n,nodeStyles:i}=Ct(e);e.labelStyle=n||"";const a=10,s=e.width;e.width=(e.width??200)-10;const{shapeSvg:o,bbox:l,label:u}=await Ut(t,e,$t(e)),h=e.padding||10;let d="",f;"ticket"in e&&e.ticket&&r?.kanban?.ticketBaseUrl&&(d=r?.kanban?.ticketBaseUrl.replace("#TICKET#",e.ticket),f=o.insert("svg:a",":first-child").attr("class","kanban-ticket-link").attr("xlink:href",d).attr("target","_blank"));const p={useHtmlLabels:e.useHtmlLabels,labelStyle:e.labelStyle||"",width:e.width,img:e.img,padding:e.padding||8,centerLabel:!1};let g,m;f?{label:g,bbox:m}=await Jx(f,"ticket"in e&&e.ticket||"",p):{label:g,bbox:m}=await Jx(o,"ticket"in e&&e.ticket||"",p);const{label:v,bbox:y}=await Jx(o,"assigned"in e&&e.assigned||"",p);e.width=s;const b=10,w=e?.width||0,T=Math.max(m.height,y.height)/2,E=Math.max(l.height+b*2,e?.height||0)+T,L=-w/2,S=-E/2;u.attr("transform","translate("+(h-w/2)+", "+(-T-l.height/2)+")"),g.attr("transform","translate("+(h-w/2)+", "+(-T+l.height/2)+")"),v.attr("transform","translate("+(h+w/2-y.width-2*a)+", "+(-T+l.height/2)+")");let C;const{rx:A,ry:N}=e,{cssStyles:_}=e;if(e.look==="handDrawn"){const O=Rt.svg(o),P=Nt(e,{}),k=A||N?O.path(rc(L,S,w,E,A||0),P):O.rectangle(L,S,w,E,P);C=o.insert(()=>k,":first-child"),C.attr("class","basic label-container").attr("style",_||null)}else{C=o.insert("rect",":first-child"),C.attr("class","basic label-container __APA__").attr("style",i).attr("rx",A??5).attr("ry",N??5).attr("x",L).attr("y",S).attr("width",w).attr("height",E);const O="priority"in e&&e.priority;if(O){const P=o.append("line"),k=L+2,R=S+Math.floor((A??0)/2),I=S+E-Math.floor((A??0)/2);P.attr("x1",k).attr("y1",R).attr("x2",k).attr("y2",I).attr("stroke-width","4").attr("stroke",pse(O))}}return Dt(e,C),e.height=E,e.intersect=function(O){return St.rect(e,O)},o}x(JP,"kanbanItem");async function eB(t,e){const{labelStyles:r,nodeStyles:n}=Ct(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,halfPadding:s,label:o}=await Ut(t,e,$t(e)),l=a.width+10*s,u=a.height+8*s,h=.15*l,{cssStyles:d}=e,f=a.width+20,p=a.height+20,g=Math.max(l,f),m=Math.max(u,p);o.attr("transform",`translate(${-a.width/2}, ${-a.height/2})`);let v;const y=`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(e.look==="handDrawn"){const b=Rt.svg(i),w=Nt(e,{}),T=b.path(y,w);v=i.insert(()=>T,":first-child"),v.attr("class","basic label-container").attr("style",Si(d))}else v=i.insert("path",":first-child").attr("class","basic label-container").attr("style",n).attr("d",y);return v.attr("transform",`translate(${-g/2}, ${-m/2})`),Dt(e,v),e.calcIntersect=function(b,w){return St.rect(b,w)},e.intersect=function(b){return ie.info("Bang intersect",e,b),St.rect(e,b)},i}x(eB,"bang");async function tB(t,e){const{labelStyles:r,nodeStyles:n}=Ct(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,halfPadding:s,label:o}=await Ut(t,e,$t(e)),l=a.width+2*s,u=a.height+2*s,h=.15*l,d=.25*l,f=.35*l,p=.2*l,{cssStyles:g}=e;let m;const v=`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${d},${d} 1 0,1 ${l*.35},${l*.2}

    a${h},${h} 1 0,1 ${l*.15},${u*.35}
    a${p},${p} 1 0,1 ${-1*l*.15},${u*.65}

    a${d},${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*u*.35}
    a${p},${p} 1 0,1 ${l*.1},${-1*u*.65}
  H0 V0 Z`;if(e.look==="handDrawn"){const y=Rt.svg(i),b=Nt(e,{}),w=y.path(v,b);m=i.insert(()=>w,":first-child"),m.attr("class","basic label-container").attr("style",Si(g))}else m=i.insert("path",":first-child").attr("class","basic label-container").attr("style",n).attr("d",v);return o.attr("transform",`translate(${-a.width/2}, ${-a.height/2})`),m.attr("transform",`translate(${-l/2}, ${-u/2})`),Dt(e,m),e.calcIntersect=function(y,b){return St.rect(y,b)},e.intersect=function(y){return ie.info("Cloud intersect",e,y),St.rect(e,y)},i}x(tB,"cloud");async function rB(t,e){const{labelStyles:r,nodeStyles:n}=Ct(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,halfPadding:s,label:o}=await Ut(t,e,$t(e)),l=a.width+8*s,u=a.height+2*s,h=5,d=`
    M${-l/2} ${u/2-h}
    v${-u+2*h}
    q0,-${h} ${h},-${h}
    h${l-2*h}
    q${h},0 ${h},${h}
    v${u-2*h}
    q0,${h} -${h},${h}
    h${-l+2*h}
    q-${h},0 -${h},-${h}
    Z
  `,f=i.append("path").attr("id","node-"+e.id).attr("class","node-bkg node-"+e.type).attr("style",n).attr("d",d);return i.append("line").attr("class","node-line-").attr("x1",-l/2).attr("y1",u/2).attr("x2",l/2).attr("y2",u/2),o.attr("transform",`translate(${-a.width/2}, ${-a.height/2})`),i.append(()=>o.node()),Dt(e,f),e.calcIntersect=function(p,g){return St.rect(p,g)},e.intersect=function(p){return St.rect(e,p)},i}x(rB,"defaultMindmapNode");async function nB(t,e){const r={padding:e.padding??0};return K6(t,e,r)}x(nB,"mindmapCircle");var gse=[{semanticName:"Process",name:"Rectangle",shortName:"rect",description:"Standard process shape",aliases:["proc","process","rectangle"],internalAliases:["squareRect"],handler:IP},{semanticName:"Event",name:"Rounded Rectangle",shortName:"rounded",description:"Represents an event",aliases:["event"],internalAliases:["roundedRect"],handler:NP},{semanticName:"Terminal Point",name:"Stadium",shortName:"stadium",description:"Terminal point",aliases:["terminal","pill"],handler:OP},{semanticName:"Subprocess",name:"Framed Rectangle",shortName:"fr-rect",description:"Subprocess",aliases:["subprocess","subproc","framed-rectangle","subroutine"],handler:$P},{semanticName:"Database",name:"Cylinder",shortName:"cyl",description:"Database storage",aliases:["db","database","cylinder"],handler:iP},{semanticName:"Start",name:"Circle",shortName:"circle",description:"Starting point",aliases:["circ"],handler:K6},{semanticName:"Bang",name:"Bang",shortName:"bang",description:"Bang",aliases:["bang"],handler:eB},{semanticName:"Cloud",name:"Cloud",shortName:"cloud",description:"cloud",aliases:["cloud"],handler:tB},{semanticName:"Decision",name:"Diamond",shortName:"diam",description:"Decision-making step",aliases:["decision","diamond","question"],handler:_P},{semanticName:"Prepare Conditional",name:"Hexagon",shortName:"hex",description:"Preparation or condition step",aliases:["hexagon","prepare"],handler:hP},{semanticName:"Data Input/Output",name:"Lean Right",shortName:"lean-r",description:"Represents input or output",aliases:["lean-right","in-out"],internalAliases:["lean_right"],handler:wP},{semanticName:"Data Input/Output",name:"Lean Left",shortName:"lean-l",description:"Represents output or input",aliases:["lean-left","out-in"],internalAliases:["lean_left"],handler:bP},{semanticName:"Priority Action",name:"Trapezoid Base Bottom",shortName:"trap-b",description:"Priority action",aliases:["priority","trapezoid-bottom","trapezoid"],handler:WP},{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:yP},{semanticName:"Stop",name:"Double Circle",shortName:"dbl-circ",description:"Represents a stop point",aliases:["double-circle"],internalAliases:["doublecircle"],handler:sP},{semanticName:"Text Block",name:"Text Block",shortName:"text",description:"Text block",handler:GP},{semanticName:"Card",name:"Notched Rectangle",shortName:"notch-rect",description:"Represents a card",aliases:["card","notched-rectangle"],handler:KO},{semanticName:"Lined/Shaded Process",name:"Lined Rectangle",shortName:"lin-rect",description:"Lined process shape",aliases:["lined-rectangle","lined-process","lin-proc","shaded-process"],handler:DP},{semanticName:"Start",name:"Small Circle",shortName:"sm-circ",description:"Small starting point",aliases:["start","small-circle"],internalAliases:["stateStart"],handler:FP},{semanticName:"Stop",name:"Framed Circle",shortName:"fr-circ",description:"Stop point",aliases:["stop","framed-circle"],internalAliases:["stateEnd"],handler:BP},{semanticName:"Fork/Join",name:"Filled Rectangle",shortName:"fork",description:"Fork or join in process flow",aliases:["join"],internalAliases:["forkJoin"],handler:cP},{semanticName:"Collate",name:"Hourglass",shortName:"hourglass",description:"Represents a collate operation",aliases:["hourglass","collate"],handler:dP},{semanticName:"Comment",name:"Curly Brace",shortName:"brace",description:"Adds a comment",aliases:["comment","brace-l"],handler:eP},{semanticName:"Comment Right",name:"Curly Brace",shortName:"brace-r",description:"Adds a comment",handler:tP},{semanticName:"Comment with braces on both sides",name:"Curly Braces",shortName:"braces",description:"Adds a comment",handler:rP},{semanticName:"Com Link",name:"Lightning Bolt",shortName:"bolt",description:"Communication link",aliases:["com-link","lightning-bolt"],handler:TP},{semanticName:"Document",name:"Document",shortName:"doc",description:"Represents a document",aliases:["doc","document"],handler:YP},{semanticName:"Delay",name:"Half-Rounded Rectangle",shortName:"delay",description:"Represents a delay",aliases:["half-rounded-rectangle"],handler:uP},{semanticName:"Direct Access Storage",name:"Horizontal Cylinder",shortName:"h-cyl",description:"Direct access storage",aliases:["das","horizontal-cylinder"],handler:UP},{semanticName:"Disk Storage",name:"Lined Cylinder",shortName:"lin-cyl",description:"Disk storage",aliases:["disk","lined-cylinder"],handler:EP},{semanticName:"Display",name:"Curved Trapezoid",shortName:"curv-trap",description:"Represents a display",aliases:["curved-trapezoid","display"],handler:nP},{semanticName:"Divided Process",name:"Divided Rectangle",shortName:"div-rect",description:"Divided process shape",aliases:["div-proc","divided-rectangle","divided-process"],handler:aP},{semanticName:"Extract",name:"Triangle",shortName:"tri",description:"Extraction process",aliases:["extract","triangle"],handler:qP},{semanticName:"Internal Storage",name:"Window Pane",shortName:"win-pane",description:"Internal storage",aliases:["internal-storage","window-pane"],handler:jP},{semanticName:"Junction",name:"Filled Circle",shortName:"f-circ",description:"Junction point",aliases:["junction","filled-circle"],handler:oP},{semanticName:"Loop Limit",name:"Trapezoidal Pentagon",shortName:"notch-pent",description:"Loop limit step",aliases:["loop-limit","notched-pentagon"],handler:HP},{semanticName:"Manual File",name:"Flipped Triangle",shortName:"flip-tri",description:"Manual file operation",aliases:["manual-file","flipped-triangle"],handler:lP},{semanticName:"Manual Input",name:"Sloped Rectangle",shortName:"sl-rect",description:"Manual input step",aliases:["manual-input","sloped-rectangle"],handler:MP},{semanticName:"Multi-Document",name:"Stacked Document",shortName:"docs",description:"Multiple documents",aliases:["documents","st-doc","stacked-document"],handler:CP},{semanticName:"Multi-Process",name:"Stacked Rectangle",shortName:"st-rect",description:"Multiple processes",aliases:["procs","processes","stacked-rectangle"],handler:SP},{semanticName:"Stored Data",name:"Bow Tie Rectangle",shortName:"bow-rect",description:"Stored data",aliases:["stored-data","bow-tie-rectangle"],handler:jO},{semanticName:"Summary",name:"Crossed Circle",shortName:"cross-circ",description:"Summary",aliases:["summary","crossed-circle"],handler:JO},{semanticName:"Tagged Document",name:"Tagged Document",shortName:"tag-doc",description:"Tagged document",aliases:["tag-doc","tagged-document"],handler:VP},{semanticName:"Tagged Process",name:"Tagged Rectangle",shortName:"tag-rect",description:"Tagged process",aliases:["tagged-rectangle","tag-proc","tagged-process"],handler:zP},{semanticName:"Paper Tape",name:"Flag",shortName:"flag",description:"Paper tape",aliases:["paper-tape"],handler:XP},{semanticName:"Odd",name:"Odd",shortName:"odd",description:"Odd shape",internalAliases:["rect_left_inv_arrow"],handler:LP},{semanticName:"Lined Document",name:"Lined Document",shortName:"lin-doc",description:"Lined document",aliases:["lined-document"],handler:kP}],mse=x(()=>{const e=[...Object.entries({state:PP,choice:ZO,note:AP,rectWithTitle:RP,labelRect:xP,iconSquare:mP,iconCircle:pP,icon:fP,iconRounded:gP,imageSquare:vP,anchor:XO,kanbanItem:JP,mindmapCircle:nB,defaultMindmapNode:rB,classBox:ZP,erBox:Z6,requirementBox:QP}),...gse.flatMap(r=>[r.shortName,..."aliases"in r?r.aliases:[],..."internalAliases"in r?r.internalAliases:[]].map(i=>[i,r.handler]))];return Object.fromEntries(e)},"generateShapeMap"),iB=mse();function aB(t){return t in iB}x(aB,"isValidShape");var o2=new Map;async function l2(t,e,r){let n,i;e.shape==="rect"&&(e.rx&&e.ry?e.shape="roundedRect":e.shape="squareRect");const a=e.shape?iB[e.shape]:void 0;if(!a)throw new Error(`No such shape: ${e.shape}. Please check your syntax.`);if(e.link){let s;r.config.securityLevel==="sandbox"?s="_top":e.linkTarget&&(s=e.linkTarget||"_blank"),n=t.insert("svg:a").attr("xlink:href",e.link).attr("target",s??null),i=await a(n,e,r)}else i=await a(t,e,r),n=i;return e.tooltip&&i.attr("title",e.tooltip),o2.set(e.id,n),e.haveCallback&&n.attr("class",n.attr("class")+" clickable"),n}x(l2,"insertNode");var vse=x((t,e)=>{o2.set(e.id,t)},"setNodeElem"),yse=x(()=>{o2.clear()},"clear"),B5=x(t=>{const e=o2.get(t.id);ie.trace("Transforming node",t.diff,t,"translate("+(t.x-t.width/2-5)+", "+t.width/2+")");const r=8,n=t.diff||0;return t.clusterNode?e.attr("transform","translate("+(t.x+n-t.width/2)+", "+(t.y-t.height/2-r)+")"):e.attr("transform","translate("+t.x+", "+t.y+")"),n},"positionNode"),xse=x((t,e,r,n,i,a)=>{e.arrowTypeStart&&cC(t,"start",e.arrowTypeStart,r,n,i,a),e.arrowTypeEnd&&cC(t,"end",e.arrowTypeEnd,r,n,i,a)},"addEdgeMarkers"),bse={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}},cC=x((t,e,r,n,i,a,s)=>{const o=bse[r];if(!o){ie.warn(`Unknown arrow type: ${r}`);return}const l=o.type,h=`${i}_${a}-${l}${e==="start"?"Start":"End"}`;if(s&&s.trim()!==""){const d=s.replace(/[^\dA-Za-z]/g,"_"),f=`${h}_${d}`;if(!document.getElementById(f)){const p=document.getElementById(h);if(p){const g=p.cloneNode(!0);g.id=f,g.querySelectorAll("path, circle, line").forEach(v=>{v.setAttribute("stroke",s),o.fill&&v.setAttribute("fill",s)}),p.parentNode?.appendChild(g)}}t.attr(`marker-${e}`,`url(${n}#${f})`)}else t.attr(`marker-${e}`,`url(${n}#${h})`)},"addEdgeMarker"),Tv=new Map,ii=new Map,wse=x(()=>{Tv.clear(),ii.clear()},"clear"),Pg=x(t=>t?t.reduce((r,n)=>r+";"+n,""):"","getLabelStyles"),sB=x(async(t,e)=>{let r=Ir(we().flowchart.htmlLabels);const{labelStyles:n}=Ct(e);e.labelStyle=n;const i=await Ra(t,e.label,{style:e.labelStyle,useHtmlLabels:r,addSvgBackground:!0,isNode:!1});ie.info("abc82",e,e.labelType);const a=t.insert("g").attr("class","edgeLabel"),s=a.insert("g").attr("class","label").attr("data-id",e.id);s.node().appendChild(i);let o=i.getBBox();if(r){const u=i.children[0],h=Qe(i);o=u.getBoundingClientRect(),h.attr("width",o.width),h.attr("height",o.height)}s.attr("transform","translate("+-o.width/2+", "+-o.height/2+")"),Tv.set(e.id,a),e.width=o.width,e.height=o.height;let l;if(e.startLabelLeft){const u=await Hc(e.startLabelLeft,Pg(e.labelStyle)),h=t.insert("g").attr("class","edgeTerminals"),d=h.insert("g").attr("class","inner");l=d.node().appendChild(u);const f=u.getBBox();d.attr("transform","translate("+-f.width/2+", "+-f.height/2+")"),ii.get(e.id)||ii.set(e.id,{}),ii.get(e.id).startLeft=h,kf(l,e.startLabelLeft)}if(e.startLabelRight){const u=await Hc(e.startLabelRight,Pg(e.labelStyle)),h=t.insert("g").attr("class","edgeTerminals"),d=h.insert("g").attr("class","inner");l=h.node().appendChild(u),d.node().appendChild(u);const f=u.getBBox();d.attr("transform","translate("+-f.width/2+", "+-f.height/2+")"),ii.get(e.id)||ii.set(e.id,{}),ii.get(e.id).startRight=h,kf(l,e.startLabelRight)}if(e.endLabelLeft){const u=await Hc(e.endLabelLeft,Pg(e.labelStyle)),h=t.insert("g").attr("class","edgeTerminals"),d=h.insert("g").attr("class","inner");l=d.node().appendChild(u);const f=u.getBBox();d.attr("transform","translate("+-f.width/2+", "+-f.height/2+")"),h.node().appendChild(u),ii.get(e.id)||ii.set(e.id,{}),ii.get(e.id).endLeft=h,kf(l,e.endLabelLeft)}if(e.endLabelRight){const u=await Hc(e.endLabelRight,Pg(e.labelStyle)),h=t.insert("g").attr("class","edgeTerminals"),d=h.insert("g").attr("class","inner");l=d.node().appendChild(u);const f=u.getBBox();d.attr("transform","translate("+-f.width/2+", "+-f.height/2+")"),h.node().appendChild(u),ii.get(e.id)||ii.set(e.id,{}),ii.get(e.id).endRight=h,kf(l,e.endLabelRight)}return i},"insertEdgeLabel");function kf(t,e){we().flowchart.htmlLabels&&t&&(t.style.width=e.length*9+"px",t.style.height="12px")}x(kf,"setTerminalWidth");var oB=x((t,e)=>{ie.debug("Moving label abc88 ",t.id,t.label,Tv.get(t.id),e);let r=e.updatedPath?e.updatedPath:e.originalPath;const n=we(),{subGraphTitleTotalMargin:i}=Mp(n);if(t.label){const a=Tv.get(t.id);let s=t.x,o=t.y;if(r){const l=Kt.calcLabelPosition(r);ie.debug("Moving label "+t.label+" from (",s,",",o,") to (",l.x,",",l.y,") abc88"),e.updatedPath&&(s=l.x,o=l.y)}a.attr("transform",`translate(${s}, ${o+i/2})`)}if(t.startLabelLeft){const a=ii.get(t.id).startLeft;let s=t.x,o=t.y;if(r){const l=Kt.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_left",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}if(t.startLabelRight){const a=ii.get(t.id).startRight;let s=t.x,o=t.y;if(r){const l=Kt.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_right",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}if(t.endLabelLeft){const a=ii.get(t.id).endLeft;let s=t.x,o=t.y;if(r){const l=Kt.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_left",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}if(t.endLabelRight){const a=ii.get(t.id).endRight;let s=t.x,o=t.y;if(r){const l=Kt.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_right",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}},"positionEdgeLabel"),Tse=x((t,e)=>{const r=t.x,n=t.y,i=Math.abs(e.x-r),a=Math.abs(e.y-n),s=t.width/2,o=t.height/2;return i>=s||a>=o},"outsideNode"),Ese=x((t,e,r)=>{ie.debug(`intersection calc abc89:
  outsidePoint: ${JSON.stringify(e)}
  insidePoint : ${JSON.stringify(r)}
  node        : x:${t.x} y:${t.y} w:${t.width} h:${t.height}`);const n=t.x,i=t.y,a=Math.abs(n-r.x),s=t.width/2;let o=r.x<e.x?s-a:s+a;const l=t.height/2,u=Math.abs(e.y-r.y),h=Math.abs(e.x-r.x);if(Math.abs(i-e.y)*s>Math.abs(n-e.x)*l){let d=r.y<e.y?e.y-l-i:i-l-e.y;o=h*d/u;const f={x:r.x<e.x?r.x+o:r.x-h+o,y:r.y<e.y?r.y+u-d:r.y-u+d};return o===0&&(f.x=e.x,f.y=e.y),h===0&&(f.x=e.x),u===0&&(f.y=e.y),ie.debug(`abc89 top/bottom calc, Q ${u}, q ${d}, R ${h}, r ${o}`,f),f}else{r.x<e.x?o=e.x-s-n:o=n-s-e.x;let d=u*o/h,f=r.x<e.x?r.x+h-o:r.x-h+o,p=r.y<e.y?r.y+d:r.y-d;return ie.debug(`sides calc abc89, Q ${u}, q ${d}, R ${h}, r ${o}`,{_x:f,_y:p}),o===0&&(f=e.x,p=e.y),h===0&&(f=e.x),u===0&&(p=e.y),{x:f,y:p}}},"intersection"),uC=x((t,e)=>{ie.warn("abc88 cutPathAtIntersect",t,e);let r=[],n=t[0],i=!1;return t.forEach(a=>{if(ie.info("abc88 checking point",a,e),!Tse(e,a)&&!i){const s=Ese(e,n,a);ie.debug("abc88 inside",a,n,s),ie.debug("abc88 intersection",s,e);let o=!1;r.forEach(l=>{o=o||l.x===s.x&&l.y===s.y}),r.some(l=>l.x===s.x&&l.y===s.y)?ie.warn("abc88 no intersect",s,r):r.push(s),i=!0}else ie.warn("abc88 outside",a,n),n=a,i||r.push(a)}),ie.debug("returning points",r),r},"cutPathAtIntersect");function lB(t){const e=[],r=[];for(let n=1;n<t.length-1;n++){const i=t[n-1],a=t[n],s=t[n+1];(i.x===a.x&&a.y===s.y&&Math.abs(a.x-s.x)>5&&Math.abs(a.y-i.y)>5||i.y===a.y&&a.x===s.x&&Math.abs(a.x-i.x)>5&&Math.abs(a.y-s.y)>5)&&(e.push(a),r.push(n))}return{cornerPoints:e,cornerPointPositions:r}}x(lB,"extractCornerPoints");var hC=x(function(t,e,r){const n=e.x-t.x,i=e.y-t.y,a=Math.sqrt(n*n+i*i),s=r/a;return{x:e.x-s*n,y:e.y-s*i}},"findAdjacentPoint"),kse=x(function(t){const{cornerPointPositions:e}=lB(t),r=[];for(let n=0;n<t.length;n++)if(e.includes(n)){const i=t[n-1],a=t[n+1],s=t[n],o=hC(i,s,5),l=hC(a,s,5),u=l.x-o.x,h=l.y-o.y;r.push(o);const d=Math.sqrt(2)*2;let f={x:s.x,y:s.y};if(Math.abs(a.x-i.x)>10&&Math.abs(a.y-i.y)>=10){ie.debug("Corner point fixing",Math.abs(a.x-i.x),Math.abs(a.y-i.y));const p=5;s.x===o.x?f={x:u<0?o.x-p+d:o.x+p-d,y:h<0?o.y-d:o.y+d}:f={x:u<0?o.x-d:o.x+d,y:h<0?o.y-p+d:o.y+p-d}}else ie.debug("Corner point skipping fixing",Math.abs(a.x-i.x),Math.abs(a.y-i.y));r.push(f,l)}else r.push(t[n]);return r},"fixCorners"),Sse=x((t,e,r)=>{const n=t-e-r,i=2,a=2,s=i+a,o=Math.floor(n/s),l=Array(o).fill(`${i} ${a}`).join(" ");return`0 ${e} ${l} ${r}`},"generateDashArray"),cB=x(function(t,e,r,n,i,a,s,o=!1){const{handDrawnSeed:l}=we();let u=e.points,h=!1;const d=i;var f=a;const p=[];for(const k in e.cssCompiledStyles)k6(k)||p.push(e.cssCompiledStyles[k]);ie.debug("UIO intersect check",e.points,f.x,d.x),f.intersect&&d.intersect&&!o&&(u=u.slice(1,e.points.length-1),u.unshift(d.intersect(u[0])),ie.debug("Last point UIO",e.start,"-->",e.end,u[u.length-1],f,f.intersect(u[u.length-1])),u.push(f.intersect(u[u.length-1])));const g=btoa(JSON.stringify(u));e.toCluster&&(ie.info("to cluster abc88",r.get(e.toCluster)),u=uC(e.points,r.get(e.toCluster).node),h=!0),e.fromCluster&&(ie.debug("from cluster abc88",r.get(e.fromCluster),JSON.stringify(u,null,2)),u=uC(u.reverse(),r.get(e.fromCluster).node).reverse(),h=!0);let m=u.filter(k=>!Number.isNaN(k.y));m=kse(m);let v=Ah;switch(v=Qm,e.curve){case"linear":v=Qm;break;case"basis":v=Ah;break;case"cardinal":v=ID;break;case"bumpX":v=LD;break;case"bumpY":v=RD;break;case"catmullRom":v=PD;break;case"monotoneX":v=GD;break;case"monotoneY":v=UD;break;case"natural":v=HD;break;case"step":v=qD;break;case"stepAfter":v=XD;break;case"stepBefore":v=YD;break;default:v=Ah}const{x:y,y:b}=RI(e),w=V0().x(y).y(b).curve(v);let T;switch(e.thickness){case"normal":T="edge-thickness-normal";break;case"thick":T="edge-thickness-thick";break;case"invisible":T="edge-thickness-invisible";break;default:T="edge-thickness-normal"}switch(e.pattern){case"solid":T+=" edge-pattern-solid";break;case"dotted":T+=" edge-pattern-dotted";break;case"dashed":T+=" edge-pattern-dashed";break;default:T+=" edge-pattern-solid"}let E,L=e.curve==="rounded"?uB(hB(m,e),5):w(m);const S=Array.isArray(e.style)?e.style:[e.style];let C=S.find(k=>k?.startsWith("stroke:")),A=!1;if(e.look==="handDrawn"){const k=Rt.svg(t);Object.assign([],m);const R=k.path(L,{roughness:.3,seed:l});T+=" transition",E=Qe(R).select("path").attr("id",e.id).attr("class"," "+T+(e.classes?" "+e.classes:"")).attr("style",S?S.reduce((M,D)=>M+";"+D,""):"");let I=E.attr("d");E.attr("d",I),t.node().appendChild(E.node())}else{const k=p.join(";"),R=S?S.reduce((G,W)=>G+W+";",""):"";let I="";e.animate&&(I=" edge-animation-fast"),e.animation&&(I=" edge-animation-"+e.animation);const M=(k?k+";"+R+";":R)+";"+(S?S.reduce((G,W)=>G+";"+W,""):"");E=t.append("path").attr("d",L).attr("id",e.id).attr("class"," "+T+(e.classes?" "+e.classes:"")+(I??"")).attr("style",M),C=M.match(/stroke:([^;]+)/)?.[1],A=e.animate===!0||!!e.animation||k.includes("animation");const D=E.node(),B=typeof D.getTotalLength=="function"?D.getTotalLength():0,$=R7[e.arrowTypeStart]||0,F=R7[e.arrowTypeEnd]||0;if(e.look==="neo"&&!A){const W=`stroke-dasharray: ${e.pattern==="dotted"||e.pattern==="dashed"?Sse(B,$,F):`0 ${$} ${B-$-F} ${F}`}; stroke-dashoffset: 0;`;E.attr("style",W+E.attr("style"))}}E.attr("data-edge",!0),E.attr("data-et","edge"),E.attr("data-id",e.id),E.attr("data-points",g),e.showPoints&&m.forEach(k=>{t.append("circle").style("stroke","red").style("fill","red").attr("r",1).attr("cx",k.x).attr("cy",k.y)});let N="";(we().flowchart.arrowMarkerAbsolute||we().state.arrowMarkerAbsolute)&&(N=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,N=N.replace(/\(/g,"\\(").replace(/\)/g,"\\)")),ie.info("arrowTypeStart",e.arrowTypeStart),ie.info("arrowTypeEnd",e.arrowTypeEnd),xse(E,e,N,s,n,C);const _=Math.floor(u.length/2),O=u[_];Kt.isLabelCoordinateInPath(O,E.attr("d"))||(h=!0);let P={};return h&&(P.updatedPath=u),P.originalPath=e.points,P},"insertEdge");function uB(t,e){if(t.length<2)return"";let r="";const n=t.length,i=1e-5;for(let a=0;a<n;a++){const s=t[a],o=t[a-1],l=t[a+1];if(a===0)r+=`M${s.x},${s.y}`;else if(a===n-1)r+=`L${s.x},${s.y}`;else{const u=s.x-o.x,h=s.y-o.y,d=l.x-s.x,f=l.y-s.y,p=Math.hypot(u,h),g=Math.hypot(d,f);if(p<i||g<i){r+=`L${s.x},${s.y}`;continue}const m=u/p,v=h/p,y=d/g,b=f/g,w=m*y+v*b,T=Math.max(-1,Math.min(1,w)),E=Math.acos(T);if(E<i||Math.abs(Math.PI-E)<i){r+=`L${s.x},${s.y}`;continue}const L=Math.min(e/Math.sin(E/2),p/2,g/2),S=s.x-m*L,C=s.y-v*L,A=s.x+y*L,N=s.y+b*L;r+=`L${S},${C}`,r+=`Q${s.x},${s.y} ${A},${N}`}}return r}x(uB,"generateRoundedPath");function F5(t,e){if(!t||!e)return{angle:0,deltaX:0,deltaY:0};const r=e.x-t.x,n=e.y-t.y;return{angle:Math.atan2(n,r),deltaX:r,deltaY:n}}x(F5,"calculateDeltaAndAngle");function hB(t,e){const r=t.map(i=>({...i}));if(t.length>=2&&yi[e.arrowTypeStart]){const i=yi[e.arrowTypeStart],a=t[0],s=t[1],{angle:o}=F5(a,s),l=i*Math.cos(o),u=i*Math.sin(o);r[0].x=a.x+l,r[0].y=a.y+u}const n=t.length;if(n>=2&&yi[e.arrowTypeEnd]){const i=yi[e.arrowTypeEnd],a=t[n-1],s=t[n-2],{angle:o}=F5(s,a),l=i*Math.cos(o),u=i*Math.sin(o);r[n-1].x=a.x-l,r[n-1].y=a.y-u}return r}x(hB,"applyMarkerOffsetsToPoints");var Cse=x((t,e,r,n)=>{e.forEach(i=>{Gse[i](t,r,n)})},"insertMarkers"),Ase=x((t,e,r)=>{ie.trace("Making markers for ",r),t.append("defs").append("marker").attr("id",r+"_"+e+"-extensionStart").attr("class","marker extension "+e).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"),t.append("defs").append("marker").attr("id",r+"_"+e+"-extensionEnd").attr("class","marker extension "+e).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"),_se=x((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-compositionStart").attr("class","marker composition "+e).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"),t.append("defs").append("marker").attr("id",r+"_"+e+"-compositionEnd").attr("class","marker composition "+e).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"),Lse=x((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-aggregationStart").attr("class","marker aggregation "+e).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"),t.append("defs").append("marker").attr("id",r+"_"+e+"-aggregationEnd").attr("class","marker aggregation "+e).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"),Rse=x((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-dependencyStart").attr("class","marker dependency "+e).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"),t.append("defs").append("marker").attr("id",r+"_"+e+"-dependencyEnd").attr("class","marker dependency "+e).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"),Nse=x((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-lollipopStart").attr("class","marker lollipop "+e).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),t.append("defs").append("marker").attr("id",r+"_"+e+"-lollipopEnd").attr("class","marker lollipop "+e).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6)},"lollipop"),Dse=x((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-pointEnd").attr("class","marker "+e).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"),t.append("marker").attr("id",r+"_"+e+"-pointStart").attr("class","marker "+e).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"),Mse=x((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-circleEnd").attr("class","marker "+e).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"),t.append("marker").attr("id",r+"_"+e+"-circleStart").attr("class","marker "+e).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"),Ise=x((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-crossEnd").attr("class","marker cross "+e).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"),t.append("marker").attr("id",r+"_"+e+"-crossStart").attr("class","marker cross "+e).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"),Ose=x((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-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"),Pse=x((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-onlyOneStart").attr("class","marker onlyOne "+e).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"),t.append("defs").append("marker").attr("id",r+"_"+e+"-onlyOneEnd").attr("class","marker onlyOne "+e).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"),Bse=x((t,e,r)=>{const n=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrOneStart").attr("class","marker zeroOrOne "+e).attr("refX",0).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto");n.append("circle").attr("fill","white").attr("cx",21).attr("cy",9).attr("r",6),n.append("path").attr("d","M9,0 L9,18");const i=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrOneEnd").attr("class","marker zeroOrOne "+e).attr("refX",30).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto");i.append("circle").attr("fill","white").attr("cx",9).attr("cy",9).attr("r",6),i.append("path").attr("d","M21,0 L21,18")},"zero_or_one"),Fse=x((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-oneOrMoreStart").attr("class","marker oneOrMore "+e).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"),t.append("defs").append("marker").attr("id",r+"_"+e+"-oneOrMoreEnd").attr("class","marker oneOrMore "+e).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"),$se=x((t,e,r)=>{const n=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrMoreStart").attr("class","marker zeroOrMore "+e).attr("refX",18).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto");n.append("circle").attr("fill","white").attr("cx",48).attr("cy",18).attr("r",6),n.append("path").attr("d","M0,18 Q18,0 36,18 Q18,36 0,18");const i=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrMoreEnd").attr("class","marker zeroOrMore "+e).attr("refX",39).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto");i.append("circle").attr("fill","white").attr("cx",9).attr("cy",18).attr("r",6),i.append("path").attr("d","M21,18 Q39,0 57,18 Q39,36 21,18")},"zero_or_more"),zse=x((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-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"),Vse=x((t,e,r)=>{const n=t.append("defs").append("marker").attr("id",r+"_"+e+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("g");n.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),n.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),n.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10)},"requirement_contains"),Gse={extension:Ase,composition:_se,aggregation:Lse,dependency:Rse,lollipop:Nse,point:Dse,circle:Mse,cross:Ise,barb:Ose,only_one:Pse,zero_or_one:Bse,one_or_more:Fse,zero_or_more:$se,requirement_arrow:zse,requirement_contains:Vse},dB=Cse,Use={common:at,getConfig:gr,insertCluster:j6,insertEdge:cB,insertEdgeLabel:sB,insertMarkers:dB,insertNode:l2,interpolateToCurve:R6,labelHelper:Ut,log:ie,positionEdgeLabel:oB},K0={},fB=x(t=>{for(const e of t)K0[e.name]=e},"registerLayoutLoaders"),Wse=x(()=>{fB([{name:"dagre",loader:x(async()=>await ir(()=>Promise.resolve().then(()=>g1e),void 0,import.meta.url),"loader")},{name:"cose-bilkent",loader:x(async()=>await ir(()=>Promise.resolve().then(()=>Qbe),void 0,import.meta.url),"loader")}])},"registerDefaultLayoutLoaders");Wse();var Sd=x(async(t,e)=>{if(!(t.layoutAlgorithm in K0))throw new Error(`Unknown layout algorithm: ${t.layoutAlgorithm}`);const r=K0[t.layoutAlgorithm];return(await r.loader()).render(t,e,Use,{algorithm:r.algorithm})},"render"),Vp=x((t="",{fallback:e="dagre"}={})=>{if(t in K0)return t;if(e in K0)return ie.warn(`Layout algorithm ${t} is not registered. Using ${e} as fallback.`),e;throw new Error(`Both layout algorithms ${t} and ${e} are not registered.`)},"getRegisteredLayoutAlgorithm"),pB="comm",gB="rule",mB="decl",Hse="@import",qse="@namespace",Yse="@keyframes",Xse="@layer",vB=Math.abs,Q6=String.fromCharCode;function yB(t){return t.trim()}function X1(t,e,r){return t.replace(e,r)}function jse(t,e,r){return t.indexOf(e,r)}function Lh(t,e){return t.charCodeAt(e)|0}function Jh(t,e,r){return t.slice(e,r)}function Bs(t){return t.length}function Kse(t){return t.length}function Bg(t,e){return e.push(t),t}var c2=1,ed=1,xB=0,es=0,kn=0,Cd="";function J6(t,e,r,n,i,a,s,o){return{value:t,root:e,parent:r,type:n,props:i,children:a,line:c2,column:ed,length:s,return:"",siblings:o}}function Zse(){return kn}function Qse(){return kn=es>0?Lh(Cd,--es):0,ed--,kn===10&&(ed=1,c2--),kn}function ms(){return kn=es<xB?Lh(Cd,es++):0,ed++,kn===10&&(ed=1,c2++),kn}function bl(){return Lh(Cd,es)}function j1(){return es}function u2(t,e){return Jh(Cd,t,e)}function Z0(t){switch(t){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function Jse(t){return c2=ed=1,xB=Bs(Cd=t),es=0,[]}function eoe(t){return Cd="",t}function eb(t){return yB(u2(es-1,$5(t===91?t+2:t===40?t+1:t)))}function toe(t){for(;(kn=bl())&&kn<33;)ms();return Z0(t)>2||Z0(kn)>3?"":" "}function roe(t,e){for(;--e&&ms()&&!(kn<48||kn>102||kn>57&&kn<65||kn>70&&kn<97););return u2(t,j1()+(e<6&&bl()==32&&ms()==32))}function $5(t){for(;ms();)switch(kn){case t:return es;case 34:case 39:t!==34&&t!==39&&$5(kn);break;case 40:t===41&&$5(t);break;case 92:ms();break}return es}function noe(t,e){for(;ms()&&t+kn!==57;)if(t+kn===84&&bl()===47)break;return"/*"+u2(e,es-1)+"*"+Q6(t===47?t:ms())}function ioe(t){for(;!Z0(bl());)ms();return u2(t,es)}function aoe(t){return eoe(K1("",null,null,null,[""],t=Jse(t),0,[0],t))}function K1(t,e,r,n,i,a,s,o,l){for(var u=0,h=0,d=s,f=0,p=0,g=0,m=1,v=1,y=1,b=0,w="",T=i,E=a,L=n,S=w;v;)switch(g=b,b=ms()){case 40:if(g!=108&&Lh(S,d-1)==58){jse(S+=X1(eb(b),"&","&\f"),"&\f",vB(u?o[u-1]:0))!=-1&&(y=-1);break}case 34:case 39:case 91:S+=eb(b);break;case 9:case 10:case 13:case 32:S+=toe(g);break;case 92:S+=roe(j1()-1,7);continue;case 47:switch(bl()){case 42:case 47:Bg(soe(noe(ms(),j1()),e,r,l),l),(Z0(g||1)==5||Z0(bl()||1)==5)&&Bs(S)&&Jh(S,-1,void 0)!==" "&&(S+=" ");break;default:S+="/"}break;case 123*m:o[u++]=Bs(S)*y;case 125*m:case 59:case 0:switch(b){case 0:case 125:v=0;case 59+h:y==-1&&(S=X1(S,/\f/g,"")),p>0&&(Bs(S)-d||m===0&&g===47)&&Bg(p>32?fC(S+";",n,r,d-1,l):fC(X1(S," ","")+";",n,r,d-2,l),l);break;case 59:S+=";";default:if(Bg(L=dC(S,e,r,u,h,i,o,w,T=[],E=[],d,a),a),b===123)if(h===0)K1(S,e,L,L,T,a,d,o,E);else{switch(f){case 99:if(Lh(S,3)===110)break;case 108:if(Lh(S,2)===97)break;default:h=0;case 100:case 109:case 115:}h?K1(t,L,L,n&&Bg(dC(t,L,L,0,0,i,o,w,i,T=[],d,E),E),i,E,d,o,n?T:E):K1(S,L,L,L,[""],E,0,o,E)}}u=h=p=0,m=y=1,w=S="",d=s;break;case 58:d=1+Bs(S),p=g;default:if(m<1){if(b==123)--m;else if(b==125&&m++==0&&Qse()==125)continue}switch(S+=Q6(b),b*m){case 38:y=h>0?1:(S+="\f",-1);break;case 44:o[u++]=(Bs(S)-1)*y,y=1;break;case 64:bl()===45&&(S+=eb(ms())),f=bl(),h=d=Bs(w=S+=ioe(j1())),b++;break;case 45:g===45&&Bs(S)==2&&(m=0)}}return a}function dC(t,e,r,n,i,a,s,o,l,u,h,d){for(var f=i-1,p=i===0?a:[""],g=Kse(p),m=0,v=0,y=0;m<n;++m)for(var b=0,w=Jh(t,f+1,f=vB(v=s[m])),T=t;b<g;++b)(T=yB(v>0?p[b]+" "+w:X1(w,/&\f/g,p[b])))&&(l[y++]=T);return J6(t,e,r,i===0?gB:o,l,u,h,d)}function soe(t,e,r,n){return J6(t,e,r,pB,Q6(Zse()),Jh(t,2,-2),0,n)}function fC(t,e,r,n,i){return J6(t,e,r,mB,Jh(t,0,n),Jh(t,n+1,-1),n,i)}function z5(t,e){for(var r="",n=0;n<t.length;n++)r+=e(t[n],n,t,e)||"";return r}function ooe(t,e,r,n){switch(t.type){case Xse:if(t.children.length)break;case Hse:case qse:case mB:return t.return=t.return||t.value;case pB:return"";case Yse:return t.return=t.value+"{"+z5(t.children,n)+"}";case gB:if(!Bs(t.value=t.props.join(",")))return""}return Bs(r=z5(t.children,n))?t.return=t.value+"{"+r+"}":""}var loe=BI(Object.keys,Object),coe=Object.prototype,uoe=coe.hasOwnProperty;function bB(t){if(!Op(t))return loe(t);var e=[];for(var r in Object(t))uoe.call(t,r)&&r!="constructor"&&e.push(r);return e}var V5=_u(no,"DataView"),G5=_u(no,"Promise"),Rh=_u(no,"Set"),U5=_u(no,"WeakMap"),pC="[object Map]",hoe="[object Object]",gC="[object Promise]",mC="[object Set]",vC="[object WeakMap]",yC="[object DataView]",doe=Au(V5),foe=Au(Y0),poe=Au(G5),goe=Au(Rh),moe=Au(U5),Ga=tl;(V5&&Ga(new V5(new ArrayBuffer(1)))!=yC||Y0&&Ga(new Y0)!=pC||G5&&Ga(G5.resolve())!=gC||Rh&&Ga(new Rh)!=mC||U5&&Ga(new U5)!=vC)&&(Ga=function(t){var e=tl(t),r=e==hoe?t.constructor:void 0,n=r?Au(r):"";if(n)switch(n){case doe:return yC;case foe:return pC;case poe:return gC;case goe:return mC;case moe:return vC}return e});var voe="[object Map]",yoe="[object Set]",xoe=Object.prototype,boe=xoe.hasOwnProperty;function Sr(t){if(t==null)return!0;if(io(t)&&(ar(t)||typeof t=="string"||typeof t.splice=="function"||Qh(t)||Jy(t)||Zh(t)))return!t.length;var e=Ga(t);if(e==voe||e==yoe)return!t.size;if(Op(t))return!bB(t).length;for(var r in t)if(boe.call(t,r))return!1;return!0}var wB="c4",woe=x(t=>/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(t),"detector"),Toe=x(async()=>{const{diagram:t}=await ir(async()=>{const{diagram:e}=await Promise.resolve().then(()=>X4e);return{diagram:e}},void 0,import.meta.url);return{id:wB,diagram:t}},"loader"),Eoe={id:wB,detector:woe,loader:Toe},koe=Eoe,TB="flowchart",Soe=x((t,e)=>e?.flowchart?.defaultRenderer==="dagre-wrapper"||e?.flowchart?.defaultRenderer==="elk"?!1:/^\s*graph/.test(t),"detector"),Coe=x(async()=>{const{diagram:t}=await ir(async()=>{const{diagram:e}=await Promise.resolve().then(()=>yk);return{diagram:e}},void 0,import.meta.url);return{id:TB,diagram:t}},"loader"),Aoe={id:TB,detector:Soe,loader:Coe},_oe=Aoe,EB="flowchart-v2",Loe=x((t,e)=>e?.flowchart?.defaultRenderer==="dagre-d3"?!1:(e?.flowchart?.defaultRenderer==="elk"&&(e.layout="elk"),/^\s*graph/.test(t)&&e?.flowchart?.defaultRenderer==="dagre-wrapper"?!0:/^\s*flowchart/.test(t)),"detector"),Roe=x(async()=>{const{diagram:t}=await ir(async()=>{const{diagram:e}=await Promise.resolve().then(()=>yk);return{diagram:e}},void 0,import.meta.url);return{id:EB,diagram:t}},"loader"),Noe={id:EB,detector:Loe,loader:Roe},Doe=Noe,kB="er",Moe=x(t=>/^\s*erDiagram/.test(t),"detector"),Ioe=x(async()=>{const{diagram:t}=await ir(async()=>{const{diagram:e}=await Promise.resolve().then(()=>p3e);return{diagram:e}},void 0,import.meta.url);return{id:kB,diagram:t}},"loader"),Ooe={id:kB,detector:Moe,loader:Ioe},Poe=Ooe,SB="gitGraph",Boe=x(t=>/^\s*gitGraph/.test(t),"detector"),Foe=x(async()=>{const{diagram:t}=await ir(async()=>{const{diagram:e}=await Promise.resolve().then(()=>RSe);return{diagram:e}},void 0,import.meta.url);return{id:SB,diagram:t}},"loader"),$oe={id:SB,detector:Boe,loader:Foe},zoe=$oe,CB="gantt",Voe=x(t=>/^\s*gantt/.test(t),"detector"),Goe=x(async()=>{const{diagram:t}=await ir(async()=>{const{diagram:e}=await Promise.resolve().then(()=>A7e);return{diagram:e}},void 0,import.meta.url);return{id:CB,diagram:t}},"loader"),Uoe={id:CB,detector:Voe,loader:Goe},Woe=Uoe,AB="info",Hoe=x(t=>/^\s*info/.test(t),"detector"),qoe=x(async()=>{const{diagram:t}=await ir(async()=>{const{diagram:e}=await Promise.resolve().then(()=>O7e);return{diagram:e}},void 0,import.meta.url);return{id:AB,diagram:t}},"loader"),Yoe={id:AB,detector:Hoe,loader:qoe},_B="pie",Xoe=x(t=>/^\s*pie/.test(t),"detector"),joe=x(async()=>{const{diagram:t}=await ir(async()=>{const{diagram:e}=await Promise.resolve().then(()=>Q7e);return{diagram:e}},void 0,import.meta.url);return{id:_B,diagram:t}},"loader"),Koe={id:_B,detector:Xoe,loader:joe},LB="quadrantChart",Zoe=x(t=>/^\s*quadrantChart/.test(t),"detector"),Qoe=x(async()=>{const{diagram:t}=await ir(async()=>{const{diagram:e}=await Promise.resolve().then(()=>oCe);return{diagram:e}},void 0,import.meta.url);return{id:LB,diagram:t}},"loader"),Joe={id:LB,detector:Zoe,loader:Qoe},ele=Joe,RB="xychart",tle=x(t=>/^\s*xychart(-beta)?/.test(t),"detector"),rle=x(async()=>{const{diagram:t}=await ir(async()=>{const{diagram:e}=await Promise.resolve().then(()=>TCe);return{diagram:e}},void 0,import.meta.url);return{id:RB,diagram:t}},"loader"),nle={id:RB,detector:tle,loader:rle},ile=nle,NB="requirement",ale=x(t=>/^\s*requirement(Diagram)?/.test(t),"detector"),sle=x(async()=>{const{diagram:t}=await ir(async()=>{const{diagram:e}=await Promise.resolve().then(()=>LCe);return{diagram:e}},void 0,import.meta.url);return{id:NB,diagram:t}},"loader"),ole={id:NB,detector:ale,loader:sle},lle=ole,DB="sequence",cle=x(t=>/^\s*sequenceDiagram/.test(t),"detector"),ule=x(async()=>{const{diagram:t}=await ir(async()=>{const{diagram:e}=await Promise.resolve().then(()=>m8e);return{diagram:e}},void 0,import.meta.url);return{id:DB,diagram:t}},"loader"),hle={id:DB,detector:cle,loader:ule},dle=hle,MB="class",fle=x((t,e)=>e?.class?.defaultRenderer==="dagre-wrapper"?!1:/^\s*classDiagram/.test(t),"detector"),ple=x(async()=>{const{diagram:t}=await ir(async()=>{const{diagram:e}=await Promise.resolve().then(()=>T8e);return{diagram:e}},void 0,import.meta.url);return{id:MB,diagram:t}},"loader"),gle={id:MB,detector:fle,loader:ple},mle=gle,IB="classDiagram",vle=x((t,e)=>/^\s*classDiagram/.test(t)&&e?.class?.defaultRenderer==="dagre-wrapper"?!0:/^\s*classDiagram-v2/.test(t),"detector"),yle=x(async()=>{const{diagram:t}=await ir(async()=>{const{diagram:e}=await Promise.resolve().then(()=>k8e);return{diagram:e}},void 0,import.meta.url);return{id:IB,diagram:t}},"loader"),xle={id:IB,detector:vle,loader:yle},ble=xle,OB="state",wle=x((t,e)=>e?.state?.defaultRenderer==="dagre-wrapper"?!1:/^\s*stateDiagram/.test(t),"detector"),Tle=x(async()=>{const{diagram:t}=await ir(async()=>{const{diagram:e}=await Promise.resolve().then(()=>fAe);return{diagram:e}},void 0,import.meta.url);return{id:OB,diagram:t}},"loader"),Ele={id:OB,detector:wle,loader:Tle},kle=Ele,PB="stateDiagram",Sle=x((t,e)=>!!(/^\s*stateDiagram-v2/.test(t)||/^\s*stateDiagram/.test(t)&&e?.state?.defaultRenderer==="dagre-wrapper"),"detector"),Cle=x(async()=>{const{diagram:t}=await ir(async()=>{const{diagram:e}=await Promise.resolve().then(()=>gAe);return{diagram:e}},void 0,import.meta.url);return{id:PB,diagram:t}},"loader"),Ale={id:PB,detector:Sle,loader:Cle},_le=Ale,BB="journey",Lle=x(t=>/^\s*journey/.test(t),"detector"),Rle=x(async()=>{const{diagram:t}=await ir(async()=>{const{diagram:e}=await Promise.resolve().then(()=>BAe);return{diagram:e}},void 0,import.meta.url);return{id:BB,diagram:t}},"loader"),Nle={id:BB,detector:Lle,loader:Rle},Dle=Nle,Mle=x((t,e,r)=>{ie.debug(`rendering svg for syntax error
`);const n=el(e),i=n.append("g");n.attr("viewBox","0 0 2412 512"),ji(n,100,512,!0),i.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"),i.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"),i.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"),i.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"),i.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"),i.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"),i.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"),i.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"),FB={draw:Mle},Ile=FB,Ole={db:{},renderer:FB,parser:{parse:x(()=>{},"parse")}},Ple=Ole,$B="flowchart-elk",Ble=x((t,e={})=>/^\s*flowchart-elk/.test(t)||/^\s*(flowchart|graph)/.test(t)&&e?.flowchart?.defaultRenderer==="elk"?(e.layout="elk",!0):!1,"detector"),Fle=x(async()=>{const{diagram:t}=await ir(async()=>{const{diagram:e}=await Promise.resolve().then(()=>yk);return{diagram:e}},void 0,import.meta.url);return{id:$B,diagram:t}},"loader"),$le={id:$B,detector:Ble,loader:Fle},zle=$le,zB="timeline",Vle=x(t=>/^\s*timeline/.test(t),"detector"),Gle=x(async()=>{const{diagram:t}=await ir(async()=>{const{diagram:e}=await Promise.resolve().then(()=>a_e);return{diagram:e}},void 0,import.meta.url);return{id:zB,diagram:t}},"loader"),Ule={id:zB,detector:Vle,loader:Gle},Wle=Ule,VB="mindmap",Hle=x(t=>/^\s*mindmap/.test(t),"detector"),qle=x(async()=>{const{diagram:t}=await ir(async()=>{const{diagram:e}=await Promise.resolve().then(()=>x_e);return{diagram:e}},void 0,import.meta.url);return{id:VB,diagram:t}},"loader"),Yle={id:VB,detector:Hle,loader:qle},Xle=Yle,GB="kanban",jle=x(t=>/^\s*kanban/.test(t),"detector"),Kle=x(async()=>{const{diagram:t}=await ir(async()=>{const{diagram:e}=await Promise.resolve().then(()=>$_e);return{diagram:e}},void 0,import.meta.url);return{id:GB,diagram:t}},"loader"),Zle={id:GB,detector:jle,loader:Kle},Qle=Zle,UB="sankey",Jle=x(t=>/^\s*sankey(-beta)?/.test(t),"detector"),ece=x(async()=>{const{diagram:t}=await ir(async()=>{const{diagram:e}=await Promise.resolve().then(()=>E9e);return{diagram:e}},void 0,import.meta.url);return{id:UB,diagram:t}},"loader"),tce={id:UB,detector:Jle,loader:ece},rce=tce,WB="packet",nce=x(t=>/^\s*packet(-beta)?/.test(t),"detector"),ice=x(async()=>{const{diagram:t}=await ir(async()=>{const{diagram:e}=await Promise.resolve().then(()=>I9e);return{diagram:e}},void 0,import.meta.url);return{id:WB,diagram:t}},"loader"),ace={id:WB,detector:nce,loader:ice},HB="radar",sce=x(t=>/^\s*radar-beta/.test(t),"detector"),oce=x(async()=>{const{diagram:t}=await ir(async()=>{const{diagram:e}=await Promise.resolve().then(()=>tLe);return{diagram:e}},void 0,import.meta.url);return{id:HB,diagram:t}},"loader"),lce={id:HB,detector:sce,loader:oce},qB="block",cce=x(t=>/^\s*block(-beta)?/.test(t),"detector"),uce=x(async()=>{const{diagram:t}=await ir(async()=>{const{diagram:e}=await Promise.resolve().then(()=>ARe);return{diagram:e}},void 0,import.meta.url);return{id:qB,diagram:t}},"loader"),hce={id:qB,detector:cce,loader:uce},dce=hce,YB="architecture",fce=x(t=>/^\s*architecture/.test(t),"detector"),pce=x(async()=>{const{diagram:t}=await ir(async()=>{const{diagram:e}=await Promise.resolve().then(()=>ZRe);return{diagram:e}},void 0,import.meta.url);return{id:YB,diagram:t}},"loader"),gce={id:YB,detector:fce,loader:pce},mce=gce,XB="treemap",vce=x(t=>/^\s*treemap/.test(t),"detector"),yce=x(async()=>{const{diagram:t}=await ir(async()=>{const{diagram:e}=await Promise.resolve().then(()=>lNe);return{diagram:e}},void 0,import.meta.url);return{id:XB,diagram:t}},"loader"),xce={id:XB,detector:vce,loader:yce},xC=!1,h2=x(()=>{xC||(xC=!0,Pm("error",Ple,t=>t.toLowerCase().trim()==="error"),Pm("---",{db:{clear:x(()=>{},"clear")},styles:{},renderer:{draw:x(()=>{},"draw")},parser:{parse:x(()=>{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:x(()=>null,"init")},t=>t.toLowerCase().trimStart().startsWith("---")),U3(zle,Xle,mce),U3(koe,Qle,ble,mle,Poe,Woe,Yoe,Koe,lle,dle,Doe,_oe,Wle,zoe,_le,kle,Dle,ele,rce,ace,ile,dce,lce,xce))},"addDiagrams"),bce=x(async()=>{ie.debug("Loading registered diagrams");const e=(await Promise.allSettled(Object.entries(Jc).map(async([r,{detector:n,loader:i}])=>{if(i)try{X3(r)}catch{try{const{diagram:a,id:s}=await i();Pm(s,a,n)}catch(a){throw ie.error(`Failed to load external diagram with key ${r}. Removing from detectors.`),delete Jc[r],a}}}))).filter(r=>r.status==="rejected");if(e.length>0){ie.error(`Failed to load ${e.length} external diagrams`);for(const r of e)ie.error(r);throw new Error(`Failed to load ${e.length} external diagrams`)}},"loadRegisteredDiagrams"),wce="graphics-document document";function jB(t,e){t.attr("role",wce),e!==""&&t.attr("aria-roledescription",e)}x(jB,"setA11yDiagramInfo");function KB(t,e,r,n){if(t.insert!==void 0){if(r){const i=`chart-desc-${n}`;t.attr("aria-describedby",i),t.insert("desc",":first-child").attr("id",i).text(r)}if(e){const i=`chart-title-${n}`;t.attr("aria-labelledby",i),t.insert("title",":first-child").attr("id",i).text(e)}}}x(KB,"addSVGa11yTitleDescription");var W5=class ZB{constructor(e,r,n,i,a){this.type=e,this.text=r,this.db=n,this.parser=i,this.renderer=a}static{x(this,"Diagram")}static async fromText(e,r={}){const n=gr(),i=jT(e,n);e=Sie(e)+`
`;try{X3(i)}catch{const u=RY(i);if(!u)throw new vN(`Diagram ${i} not found.`);const{id:h,diagram:d}=await u();Pm(h,d)}const{db:a,parser:s,renderer:o,init:l}=X3(i);return s.parser&&(s.parser.yy=a),a.clear?.(),l?.(n),r.title&&a.setDiagramTitle?.(r.title),await s.parse(e),new ZB(i,e,a,s,o)}async render(e,r){await this.renderer.draw(this.text,e,r,this)}getParser(){return this.parser}getType(){return this.type}},bC=[],Tce=x(()=>{bC.forEach(t=>{t()}),bC=[]},"attachFunctions"),Ece=x(t=>t.replace(/^\s*%%(?!{)[^\n]+\n?/gm,"").trimStart(),"cleanupComments");function QB(t){const e=t.match(mN);if(!e)return{text:t,metadata:{}};let r=Ky(e[1],{schema:jy})??{};r=typeof r=="object"&&!Array.isArray(r)?r:{};const n={};return r.displayMode&&(n.displayMode=r.displayMode.toString()),r.title&&(n.title=r.title.toString()),r.config&&(n.config=r.config),{text:t.slice(e[0].length),metadata:n}}x(QB,"extractFrontMatter");var kce=x(t=>t.replace(/\r\n?/g,`
`).replace(/<(\w+)([^>]*)>/g,(e,r,n)=>"<"+r+n.replace(/="([^"]*)"/g,"='$1'")+">"),"cleanupText"),Sce=x(t=>{const{text:e,metadata:r}=QB(t),{displayMode:n,title:i,config:a={}}=r;return n&&(a.gantt||(a.gantt={}),a.gantt.displayMode=n),{title:i,config:a,text:e}},"processFrontmatter"),Cce=x(t=>{const e=Kt.detectInit(t)??{},r=Kt.detectDirective(t,"wrap");return Array.isArray(r)?e.wrap=r.some(({type:n})=>n==="wrap"):r?.type==="wrap"&&(e.wrap=!0),{text:gie(t),directive:e}},"processDirectives");function eE(t){const e=kce(t),r=Sce(e),n=Cce(r.text),i=Hi(r.config,n.directive);return t=Ece(n.text),{code:t,title:r.title,config:i}}x(eE,"preprocessDiagram");function JB(t){const e=new TextEncoder().encode(t),r=Array.from(e,n=>String.fromCodePoint(n)).join("");return btoa(r)}x(JB,"toBase64");var Ace=5e4,_ce="graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa",Lce="sandbox",Rce="loose",Nce="http://www.w3.org/2000/svg",Dce="http://www.w3.org/1999/xlink",Mce="http://www.w3.org/1999/xhtml",Ice="100%",Oce="100%",Pce="border:0;margin:0;",Bce="margin:0",Fce="allow-top-navigation-by-user-activation allow-popups",$ce='The "iframe" tag is not supported by your browser.',zce=["foreignobject"],Vce=["dominant-baseline"];function tE(t){const e=eE(t);return Im(),HY(e.config??{}),e}x(tE,"processAndSetConfigs");async function eF(t,e){h2();try{const{code:r,config:n}=tE(t);return{diagramType:(await rF(r)).type,config:n}}catch(r){if(e?.suppressErrors)return!1;throw r}}x(eF,"parse");var wC=x((t,e,r=[])=>`
.${t} ${e} { ${r.join(" !important; ")} !important; }`,"cssImportantStyles"),Gce=x((t,e=new Map)=>{let r="";if(t.themeCSS!==void 0&&(r+=`
${t.themeCSS}`),t.fontFamily!==void 0&&(r+=`
:root { --mermaid-font-family: ${t.fontFamily}}`),t.altFontFamily!==void 0&&(r+=`
:root { --mermaid-alt-font-family: ${t.altFontFamily}}`),e instanceof Map){const s=t.htmlLabels??t.flowchart?.htmlLabels?["> *","span"]:["rect","polygon","ellipse","circle","path"];e.forEach(o=>{Sr(o.styles)||s.forEach(l=>{r+=wC(o.id,l,o.styles)}),Sr(o.textStyles)||(r+=wC(o.id,"tspan",(o?.textStyles||[]).map(l=>l.replace("color","fill"))))})}return r},"createCssStyles"),Uce=x((t,e,r,n)=>{const i=Gce(t,r),a=uX(e,i,t.themeVariables);return z5(aoe(`${n}{${a}}`),ooe)},"createUserStyles"),Wce=x((t="",e,r)=>{let n=t;return!r&&!e&&(n=n.replace(/marker-end="url\([\d+./:=?A-Za-z-]*?#/g,'marker-end="url(#')),n=Ks(n),n=n.replace(/<br>/g,"<br/>"),n},"cleanUpSvgCode"),Hce=x((t="",e)=>{const r=e?.viewBox?.baseVal?.height?e.viewBox.baseVal.height+"px":Oce,n=JB(`<body style="${Bce}">${t}</body>`);return`<iframe style="width:${Ice};height:${r};${Pce}" src="data:text/html;charset=UTF-8;base64,${n}" sandbox="${Fce}">
  ${$ce}
</iframe>`},"putIntoIFrame"),TC=x((t,e,r,n,i)=>{const a=t.append("div");a.attr("id",r),n&&a.attr("style",n);const s=a.append("svg").attr("id",e).attr("width","100%").attr("xmlns",Nce);return i&&s.attr("xmlns:xlink",i),s.append("g"),t},"appendDivSvgG");function H5(t,e){return t.append("iframe").attr("id",e).attr("style","width: 100%; height: 100%;").attr("sandbox","")}x(H5,"sandboxedIframe");var qce=x((t,e,r,n)=>{t.getElementById(e)?.remove(),t.getElementById(r)?.remove(),t.getElementById(n)?.remove()},"removeExistingElements"),Yce=x(async function(t,e,r){h2();const n=tE(e);e=n.code;const i=gr();ie.debug(i),e.length>(i?.maxTextSize??Ace)&&(e=_ce);const a="#"+t,s="i"+t,o="#"+s,l="d"+t,u="#"+l,h=x(()=>{const P=Qe(f?o:u).node();P&&"remove"in P&&P.remove()},"removeTempElements");let d=Qe("body");const f=i.securityLevel===Lce,p=i.securityLevel===Rce,g=i.fontFamily;if(r!==void 0){if(r&&(r.innerHTML=""),f){const O=H5(Qe(r),s);d=Qe(O.nodes()[0].contentDocument.body),d.node().style.margin=0}else d=Qe(r);TC(d,t,l,`font-family: ${g}`,Dce)}else{if(qce(document,t,l,s),f){const O=H5(Qe("body"),s);d=Qe(O.nodes()[0].contentDocument.body),d.node().style.margin=0}else d=Qe("body");TC(d,t,l)}let m,v;try{m=await W5.fromText(e,{title:n.title})}catch(O){if(i.suppressErrorRendering)throw h(),O;m=await W5.fromText("error"),v=O}const y=d.select(u).node(),b=m.type,w=y.firstChild,T=w.firstChild,E=m.renderer.getClasses?.(e,m),L=Uce(i,b,E,a),S=document.createElement("style");S.innerHTML=L,w.insertBefore(S,T);try{await m.renderer.draw(e,t,$3.version,m)}catch(O){throw i.suppressErrorRendering?h():Ile.draw(e,t,$3.version),O}const C=d.select(`${u} svg`),A=m.db.getAccTitle?.(),N=m.db.getAccDescription?.();nF(b,C,A,N),d.select(`[id="${t}"]`).selectAll("foreignobject > *").attr("xmlns",Mce);let _=d.select(u).node().innerHTML;if(ie.debug("config.arrowMarkerAbsolute",i.arrowMarkerAbsolute),_=Wce(_,f,Ir(i.arrowMarkerAbsolute)),f){const O=d.select(u+" svg").node();_=Hce(_,O)}else p||(_=zh.sanitize(_,{ADD_TAGS:zce,ADD_ATTR:Vce,HTML_INTEGRATION_POINTS:{foreignobject:!0}}));if(Tce(),v)throw v;return h(),{diagramType:b,svg:_,bindFunctions:m.db.bindFunctions}},"render");function tF(t={}){const e=mn({},t);e?.fontFamily&&!e.themeVariables?.fontFamily&&(e.themeVariables||(e.themeVariables={}),e.themeVariables.fontFamily=e.fontFamily),UY(e),e?.theme&&e.theme in Po?e.themeVariables=Po[e.theme].getThemeVariables(e.themeVariables):e&&(e.themeVariables=Po.default.getThemeVariables(e.themeVariables));const r=typeof e=="object"?GY(e):wN();YT(r.logLevel),h2()}x(tF,"initialize");var rF=x((t,e={})=>{const{code:r}=eE(t);return W5.fromText(r,e)},"getDiagramFromText");function nF(t,e,r,n){jB(e,t),KB(e,r,n,e.attr("id"))}x(nF,"addA11yInfo");var cu=Object.freeze({render:Yce,parse:eF,getDiagramFromText:rF,initialize:tF,getConfig:gr,setConfig:TN,getSiteConfig:wN,updateSiteConfig:WY,reset:x(()=>{Im()},"reset"),globalReset:x(()=>{Im(Vh)},"globalReset"),defaultConfig:Vh});YT(gr().logLevel);Im(gr());var Xce=x((t,e,r)=>{ie.warn(t),O6(t)?(r&&r(t.str,t.hash),e.push({...t,message:t.str,error:t})):(r&&r(t),t instanceof Error&&e.push({str:t.message,message:t.message,hash:t.name,error:t}))},"handleError"),iF=x(async function(t={querySelector:".mermaid"}){try{await jce(t)}catch(e){if(O6(e)&&ie.error(e.str),Ho.parseError&&Ho.parseError(e),!t.suppressErrors)throw ie.error("Use the suppressErrors option to suppress these errors"),e}},"run"),jce=x(async function({postRenderCallback:t,querySelector:e,nodes:r}={querySelector:".mermaid"}){const n=cu.getConfig();ie.debug(`${t?"":"No "}Callback function found`);let i;if(r)i=r;else if(e)i=document.querySelectorAll(e);else throw new Error("Nodes and querySelector are both undefined");ie.debug(`Found ${i.length} diagrams`),n?.startOnLoad!==void 0&&(ie.debug("Start On Load: "+n?.startOnLoad),cu.updateSiteConfig({startOnLoad:n?.startOnLoad}));const a=new Kt.InitIDGenerator(n.deterministicIds,n.deterministicIDSeed);let s;const o=[];for(const l of Array.from(i)){if(ie.info("Rendering diagram: "+l.id),l.getAttribute("data-processed"))continue;l.setAttribute("data-processed","true");const u=`mermaid-${a.next()}`;s=l.innerHTML,s=vO(Kt.entityDecode(s)).trim().replace(/<br\s*\/?>/gi,"<br/>");const h=Kt.detectInit(s);h&&ie.debug("Detected early reinit: ",h);try{const{svg:d,bindFunctions:f}=await lF(u,s,l);l.innerHTML=d,t&&await t(u),f&&f(l)}catch(d){Xce(d,o,Ho.parseError)}}if(o.length>0)throw o[0]},"runThrowsErrors"),aF=x(function(t){cu.initialize(t)},"initialize"),Kce=x(async function(t,e,r){ie.warn("mermaid.init is deprecated. Please use run instead."),t&&aF(t);const n={postRenderCallback:r,querySelector:".mermaid"};typeof e=="string"?n.querySelector=e:e&&(e instanceof HTMLElement?n.nodes=[e]:n.nodes=e),await iF(n)},"init"),Zce=x(async(t,{lazyLoad:e=!0}={})=>{h2(),U3(...t),e===!1&&await bce()},"registerExternalDiagrams"),sF=x(function(){if(Ho.startOnLoad){const{startOnLoad:t}=cu.getConfig();t&&Ho.run().catch(e=>ie.error("Mermaid failed to initialize",e))}},"contentLoaded");typeof document<"u"&&window.addEventListener("load",sF,!1);var Qce=x(function(t){Ho.parseError=t},"setParseErrorHandler"),Ev=[],tb=!1,oF=x(async()=>{if(!tb){for(tb=!0;Ev.length>0;){const t=Ev.shift();if(t)try{await t()}catch(e){ie.error("Error executing queue",e)}}tb=!1}},"executeQueue"),Jce=x(async(t,e)=>new Promise((r,n)=>{const i=x(()=>new Promise((a,s)=>{cu.parse(t,e).then(o=>{a(o),r(o)},o=>{ie.error("Error parsing",o),Ho.parseError?.(o),s(o),n(o)})}),"performCall");Ev.push(i),oF().catch(n)}),"parse"),lF=x((t,e,r)=>new Promise((n,i)=>{const a=x(()=>new Promise((s,o)=>{cu.render(t,e,r).then(l=>{s(l),n(l)},l=>{ie.error("Error parsing",l),Ho.parseError?.(l),o(l),i(l)})}),"performCall");Ev.push(a),oF().catch(i)}),"render"),eue=x(()=>Object.keys(Jc).map(t=>({id:t})),"getRegisteredDiagramsMetadata"),Ho={startOnLoad:!0,mermaidAPI:cu,parse:Jce,render:lF,init:Kce,run:iF,registerExternalDiagrams:Zce,registerLayoutLoaders:fB,initialize:aF,parseError:void 0,contentLoaded:sF,setParseErrorHandler:Qce,detectType:jT,registerIconPacks:bO,getRegisteredDiagramsMetadata:eue},EC=Ho;/*! Check if previously processed *//*!
 * Wait for document loaded before starting the execution
 */async function tue(){const t=atob(globalThis.fileBase64);EC.initialize({startOnLoad:!1,theme:"default",securityLevel:"loose",fontFamily:"system-ui, -apple-system, sans-serif"});const e=document.getElementById("mermaid-source");if(!e)throw new Error("Mermaid source element not found");e.textContent=t,await EC.run({nodes:[e]}),await new Promise(u=>setTimeout(u,100));const r=document.getElementById("container");if(!r)throw new Error("Container not found");const n=r.querySelector("svg");if(!n)throw new Error("Rendered SVG not found");const i=n.getBoundingClientRect();let a=Math.ceil(i.width)+40,s=Math.ceil(i.height)+40;const o=1280;let l=1;return a>o&&(l=o/a,a=o,s=Math.ceil(s*l)),{width:a,height:s,pageCount:1,pageNumber:1,scale:l}}window.renderComplete=tue();class ra{constructor(e,r,n){this.lexer=void 0,this.start=void 0,this.end=void 0,this.lexer=e,this.start=r,this.end=n}static range(e,r){return r?!e||!e.loc||!r.loc||e.loc.lexer!==r.loc.lexer?null:new ra(e.loc.lexer,e.loc.start,r.loc.end):e&&e.loc}}class Sa{constructor(e,r){this.text=void 0,this.loc=void 0,this.noexpand=void 0,this.treatAsRelax=void 0,this.text=e,this.loc=r}range(e,r){return new Sa(r,ra.range(this,e))}}class ot{constructor(e,r){this.name=void 0,this.position=void 0,this.length=void 0,this.rawMessage=void 0;var n="KaTeX parse error: "+e,i,a,s=r&&r.loc;if(s&&s.start<=s.end){var o=s.lexer.input;i=s.start,a=s.end,i===o.length?n+=" at end of input: ":n+=" at position "+(i+1)+": ";var l=o.slice(i,a).replace(/[^]/g,"$&̲"),u;i>15?u="…"+o.slice(i-15,i):u=o.slice(0,i);var h;a+15<o.length?h=o.slice(a,a+15)+"…":h=o.slice(a),n+=u+l+h}var d=new Error(n);return d.name="ParseError",d.__proto__=ot.prototype,d.position=i,i!=null&&a!=null&&(d.length=a-i),d.rawMessage=e,d}}ot.prototype.__proto__=Error.prototype;var rue=function(e,r){return e===void 0?r:e},nue=/([A-Z])/g,iue=function(e){return e.replace(nue,"-$1").toLowerCase()},aue={"&":"&amp;",">":"&gt;","<":"&lt;",'"':"&quot;","'":"&#x27;"},sue=/[&><"']/g;function oue(t){return String(t).replace(sue,e=>aue[e])}var cF=function t(e){return e.type==="ordgroup"||e.type==="color"?e.body.length===1?t(e.body[0]):e:e.type==="font"?t(e.body):e},lue=function(e){var r=cF(e);return r.type==="mathord"||r.type==="textord"||r.type==="atom"},cue=function(e){if(!e)throw new Error("Expected non-null, but got "+String(e));return e},uue=function(e){var r=/^[\x00-\x20]*([^\\/#?]*?)(:|&#0*58|&#x0*3a|&colon)/i.exec(e);return r?r[2]!==":"||!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(r[1])?null:r[1].toLowerCase():"_relative"},Tr={deflt:rue,escape:oue,hyphenate:iue,getBaseElem:cF,isCharacterBox:lue,protocolFromUrl:uue},k0={displayMode:{type:"boolean",description:"Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.",cli:"-d, --display-mode"},output:{type:{enum:["htmlAndMathml","html","mathml"]},description:"Determines the markup language of the output.",cli:"-F, --format <type>"},leqno:{type:"boolean",description:"Render display math in leqno style (left-justified tags)."},fleqn:{type:"boolean",description:"Render display math flush left."},throwOnError:{type:"boolean",default:!0,cli:"-t, --no-throw-on-error",cliDescription:"Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error."},errorColor:{type:"string",default:"#cc0000",cli:"-c, --error-color <color>",cliDescription:"A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.",cliProcessor:t=>"#"+t},macros:{type:"object",cli:"-m, --macro <def>",cliDescription:"Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).",cliDefault:[],cliProcessor:(t,e)=>(e.push(t),e)},minRuleThickness:{type:"number",description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:t=>Math.max(0,t),cli:"--min-rule-thickness <size>",cliProcessor:parseFloat},colorIsTextColor:{type:"boolean",description:"Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.",cli:"-b, --color-is-text-color"},strict:{type:[{enum:["warn","ignore","error"]},"boolean","function"],description:"Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.",cli:"-S, --strict",cliDefault:!1},trust:{type:["boolean","function"],description:"Trust the input, enabling all HTML features such as \\url.",cli:"-T, --trust"},maxSize:{type:"number",default:1/0,description:"If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large",processor:t=>Math.max(0,t),cli:"-s, --max-size <n>",cliProcessor:parseInt},maxExpand:{type:"number",default:1e3,description:"Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.",processor:t=>Math.max(0,t),cli:"-e, --max-expand <n>",cliProcessor:t=>t==="Infinity"?1/0:parseInt(t)},globalGroup:{type:"boolean",cli:!1}};function hue(t){if(t.default)return t.default;var e=t.type,r=Array.isArray(e)?e[0]:e;if(typeof r!="string")return r.enum[0];switch(r){case"boolean":return!1;case"string":return"";case"number":return 0;case"object":return{}}}class rE{constructor(e){this.displayMode=void 0,this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,this.globalGroup=void 0,e=e||{};for(var r in k0)if(k0.hasOwnProperty(r)){var n=k0[r];this[r]=e[r]!==void 0?n.processor?n.processor(e[r]):e[r]:hue(n)}}reportNonstrict(e,r,n){var i=this.strict;if(typeof i=="function"&&(i=i(e,r,n)),!(!i||i==="ignore")){if(i===!0||i==="error")throw new ot("LaTeX-incompatible input and strict mode is set to 'error': "+(r+" ["+e+"]"),n);i==="warn"?typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(r+" ["+e+"]")):typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+i+"': "+r+" ["+e+"]"))}}useStrictBehavior(e,r,n){var i=this.strict;if(typeof i=="function")try{i=i(e,r,n)}catch{i="error"}return!i||i==="ignore"?!1:i===!0||i==="error"?!0:i==="warn"?(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(r+" ["+e+"]")),!1):(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+i+"': "+r+" ["+e+"]")),!1)}isTrusted(e){if(e.url&&!e.protocol){var r=Tr.protocolFromUrl(e.url);if(r==null)return!1;e.protocol=r}var n=typeof this.trust=="function"?this.trust(e):this.trust;return!!n}}class cl{constructor(e,r,n){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=e,this.size=r,this.cramped=n}sup(){return $s[due[this.id]]}sub(){return $s[fue[this.id]]}fracNum(){return $s[pue[this.id]]}fracDen(){return $s[gue[this.id]]}cramp(){return $s[mue[this.id]]}text(){return $s[vue[this.id]]}isTight(){return this.size>=2}}var nE=0,kv=1,Nh=2,Fo=3,Q0=4,Ya=5,td=6,zi=7,$s=[new cl(nE,0,!1),new cl(kv,0,!0),new cl(Nh,1,!1),new cl(Fo,1,!0),new cl(Q0,2,!1),new cl(Ya,2,!0),new cl(td,3,!1),new cl(zi,3,!0)],due=[Q0,Ya,Q0,Ya,td,zi,td,zi],fue=[Ya,Ya,Ya,Ya,zi,zi,zi,zi],pue=[Nh,Fo,Q0,Ya,td,zi,td,zi],gue=[Fo,Fo,Ya,Ya,zi,zi,zi,zi],mue=[kv,kv,Fo,Fo,Ya,Ya,zi,zi],vue=[nE,kv,Nh,Fo,Nh,Fo,Nh,Fo],Vt={DISPLAY:$s[nE],TEXT:$s[Nh],SCRIPT:$s[Q0],SCRIPTSCRIPT:$s[td]},q5=[{name:"latin",blocks:[[256,591],[768,879]]},{name:"cyrillic",blocks:[[1024,1279]]},{name:"armenian",blocks:[[1328,1423]]},{name:"brahmic",blocks:[[2304,4255]]},{name:"georgian",blocks:[[4256,4351]]},{name:"cjk",blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:"hangul",blocks:[[44032,55215]]}];function yue(t){for(var e=0;e<q5.length;e++)for(var r=q5[e],n=0;n<r.blocks.length;n++){var i=r.blocks[n];if(t>=i[0]&&t<=i[1])return r.name}return null}var Z1=[];q5.forEach(t=>t.blocks.forEach(e=>Z1.push(...e)));function uF(t){for(var e=0;e<Z1.length;e+=2)if(t>=Z1[e]&&t<=Z1[e+1])return!0;return!1}var ju=80,xue=function(e,r){return"M95,"+(622+e+r)+`
c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14
c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54
c44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10
s173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429
c69,-144,104.5,-217.7,106.5,-221
l`+e/2.075+" -"+e+`
c5.3,-9.3,12,-14,20,-14
H400000v`+(40+e)+`H845.2724
s-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7
c-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z
M`+(834+e)+" "+r+"h400000v"+(40+e)+"h-400000z"},bue=function(e,r){return"M263,"+(601+e+r)+`c0.7,0,18,39.7,52,119
c34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120
c340,-704.7,510.7,-1060.3,512,-1067
l`+e/2.084+" -"+e+`
c4.7,-7.3,11,-11,19,-11
H40000v`+(40+e)+`H1012.3
s-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5,232
c-22.3,46.7,-33.8,70.3,-34.5,71c-4.7,4.7,-12.3,7,-23,7s-12,-1,-12,-1
s-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26
c-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z
M`+(1001+e)+" "+r+"h400000v"+(40+e)+"h-400000z"},wue=function(e,r){return"M983 "+(10+e+r)+`
l`+e/3.13+" -"+e+`
c4,-6.7,10,-10,18,-10 H400000v`+(40+e)+`
H1013.1s-83.4,268,-264.1,840c-180.7,572,-277,876.3,-289,913c-4.7,4.7,-12.7,7,-24,7
s-12,0,-12,0c-1.3,-3.3,-3.7,-11.7,-7,-25c-35.3,-125.3,-106.7,-373.3,-214,-744
c-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30
c26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722
c56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5
c53.7,-170.3,84.5,-266.8,92.5,-289.5z
M`+(1001+e)+" "+r+"h400000v"+(40+e)+"h-400000z"},Tue=function(e,r){return"M424,"+(2398+e+r)+`
c-1.3,-0.7,-38.5,-172,-111.5,-514c-73,-342,-109.8,-513.3,-110.5,-514
c0,-2,-10.7,14.3,-32,49c-4.7,7.3,-9.8,15.7,-15.5,25c-5.7,9.3,-9.8,16,-12.5,20
s-5,7,-5,7c-4,-3.3,-8.3,-7.7,-13,-13s-13,-13,-13,-13s76,-122,76,-122s77,-121,77,-121
s209,968,209,968c0,-2,84.7,-361.7,254,-1079c169.3,-717.3,254.7,-1077.7,256,-1081
l`+e/4.223+" -"+e+`c4,-6.7,10,-10,18,-10 H400000
v`+(40+e)+`H1014.6
s-87.3,378.7,-272.6,1166c-185.3,787.3,-279.3,1182.3,-282,1185
c-2,6,-10,9,-24,9
c-8,0,-12,-0.7,-12,-2z M`+(1001+e)+" "+r+`
h400000v`+(40+e)+"h-400000z"},Eue=function(e,r){return"M473,"+(2713+e+r)+`
c339.3,-1799.3,509.3,-2700,510,-2702 l`+e/5.298+" -"+e+`
c3.3,-7.3,9.3,-11,18,-11 H400000v`+(40+e)+`H1017.7
s-90.5,478,-276.2,1466c-185.7,988,-279.5,1483,-281.5,1485c-2,6,-10,9,-24,9
c-8,0,-12,-0.7,-12,-2c0,-1.3,-5.3,-32,-16,-92c-50.7,-293.3,-119.7,-693.3,-207,-1200
c0,-1.3,-5.3,8.7,-16,30c-10.7,21.3,-21.3,42.7,-32,64s-16,33,-16,33s-26,-26,-26,-26
s76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104,
606zM`+(1001+e)+" "+r+"h400000v"+(40+e)+"H1017.7z"},kue=function(e){var r=e/2;return"M400000 "+e+" H0 L"+r+" 0 l65 45 L145 "+(e-80)+" H400000z"},Sue=function(e,r,n){var i=n-54-r-e;return"M702 "+(e+r)+"H400000"+(40+e)+`
H742v`+i+`l-4 4-4 4c-.667.7 -2 1.5-4 2.5s-4.167 1.833-6.5 2.5-5.5 1-9.5 1
h-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170
c-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667
219 661 l218 661zM702 `+r+"H400000v"+(40+e)+"H742z"},Cue=function(e,r,n){r=1e3*r;var i="";switch(e){case"sqrtMain":i=xue(r,ju);break;case"sqrtSize1":i=bue(r,ju);break;case"sqrtSize2":i=wue(r,ju);break;case"sqrtSize3":i=Tue(r,ju);break;case"sqrtSize4":i=Eue(r,ju);break;case"sqrtTall":i=Sue(r,ju,n)}return i},Aue=function(e,r){switch(e){case"⎜":return"M291 0 H417 V"+r+" H291z M291 0 H417 V"+r+" H291z";case"∣":return"M145 0 H188 V"+r+" H145z M145 0 H188 V"+r+" H145z";case"∥":return"M145 0 H188 V"+r+" H145z M145 0 H188 V"+r+" H145z"+("M367 0 H410 V"+r+" H367z M367 0 H410 V"+r+" H367z");case"⎟":return"M457 0 H583 V"+r+" H457z M457 0 H583 V"+r+" H457z";case"⎢":return"M319 0 H403 V"+r+" H319z M319 0 H403 V"+r+" H319z";case"⎥":return"M263 0 H347 V"+r+" H263z M263 0 H347 V"+r+" H263z";case"⎪":return"M384 0 H504 V"+r+" H384z M384 0 H504 V"+r+" H384z";case"⏐":return"M312 0 H355 V"+r+" H312z M312 0 H355 V"+r+" H312z";case"‖":return"M257 0 H300 V"+r+" H257z M257 0 H300 V"+r+" H257z"+("M478 0 H521 V"+r+" H478z M478 0 H521 V"+r+" H478z");default:return""}},kC={doubleleftarrow:`M262 157
l10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.3
 0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-28
 14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.5
c2 1.7 6.3 3.5 13 5.5 68 17.3 128.2 47.8 180.5 91.5 52.3 43.7 93.8 96.2 124.5
 157.5 9.3 8 15.3 12.3 18 13h6c12-.7 18-4 18-10 0-2-1.7-7-5-15-23.3-46-52-87
-86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.7
-2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z
m8 0v40h399730v-40zm0 194v40h399730v-40z`,doublerightarrow:`M399738 392l
-10 10c-34 36-62.7 77-86 123-3.3 8-5 13.3-5 16 0 5.3 6.7 8 20 8 7.3 0 12.2-.5
 14.5-1.5 2.3-1 4.8-4.5 7.5-10.5 49.3-97.3 121.7-169.3 217-216 28-14 57.3-25 88
-33 6.7-2 11-3.8 13-5.5 2-1.7 3-4.2 3-7.5s-1-5.8-3-7.5c-2-1.7-6.3-3.5-13-5.5-68
-17.3-128.2-47.8-180.5-91.5-52.3-43.7-93.8-96.2-124.5-157.5-9.3-8-15.3-12.3-18
-13h-6c-12 .7-18 4-18 10 0 2 1.7 7 5 15 23.3 46 52 87 86 123l10 10H0v40h399782
c-328 0 0 0 0 0l10 8c26.7 20 65.7 43 117 69-2.7 2-6 3.7-10 5-36.7 16-72.3 37.3
-107 64l-10 8H0v40zM0 157v40h399730v-40zm0 194v40h399730v-40z`,leftarrow:`M400000 241H110l3-3c68.7-52.7 113.7-120
 135-202 4-14.7 6-23 6-25 0-7.3-7-11-21-11-8 0-13.2.8-15.5 2.5-2.3 1.7-4.2 5.8
-5.5 12.5-1.3 4.7-2.7 10.3-4 17-12 48.7-34.8 92-68.5 130S65.3 228.3 18 247
c-10 4-16 7.7-18 11 0 8.7 6 14.3 18 17 47.3 18.7 87.8 47 121.5 85S196 441.3 208
 490c.7 2 1.3 5 2 9s1.2 6.7 1.5 8c.3 1.3 1 3.3 2 6s2.2 4.5 3.5 5.5c1.3 1 3.3
 1.8 6 2.5s6 1 10 1c14 0 21-3.7 21-11 0-2-2-10.3-6-25-20-79.3-65-146.7-135-202
 l-3-3h399890zM100 241v40h399900v-40z`,leftbrace:`M6 548l-6-6v-35l6-11c56-104 135.3-181.3 238-232 57.3-28.7 117
-45 179-50h399577v120H403c-43.3 7-81 15-113 26-100.7 33-179.7 91-237 174-2.7
 5-6 9-10 13-.7 1-7.3 1-20 1H6z`,leftbraceunder:`M0 6l6-6h17c12.688 0 19.313.3 20 1 4 4 7.313 8.3 10 13
 35.313 51.3 80.813 93.8 136.5 127.5 55.688 33.7 117.188 55.8 184.5 66.5.688
 0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7
-331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z`,leftgroup:`M400000 80
H435C64 80 168.3 229.4 21 260c-5.9 1.2-18 0-18 0-2 0-3-1-3-3v-38C76 61 257 0
 435 0h399565z`,leftgroupunder:`M400000 262
H435C64 262 168.3 112.6 21 82c-5.9-1.2-18 0-18 0-2 0-3 1-3 3v38c76 158 257 219
 435 219h399565z`,leftharpoon:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3
-3.3 10.2-9.5 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5
-18.3 3-21-1.3-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7
-196 228-6.7 4.7-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40z`,leftharpoonplus:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3-3.3 10.2-9.5
 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5-18.3 3-21-1.3
-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7-196 228-6.7 4.7
-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40zM0 435v40h400000v-40z
m0 0v40h400000v-40z`,leftharpoondown:`M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 2 11s5.333
 5.333 12 10c90.667 54 156 130 196 228 3.333 10.667 6.333 16.333 9 17 2 .667 5
 1 9 1h5c10.667 0 16.667-2 18-6 2-2.667 1-9.667-3-21-32-87.333-82.667-157.667
-152-211l-3-3h399907v-40zM93 281 H400000 v-40L7 241z`,leftharpoondownplus:`M7 435c-4 4-6.3 8.7-7 14 0 5.3.7 9 2 11s5.3 5.3 12
 10c90.7 54 156 130 196 228 3.3 10.7 6.3 16.3 9 17 2 .7 5 1 9 1h5c10.7 0 16.7
-2 18-6 2-2.7 1-9.7-3-21-32-87.3-82.7-157.7-152-211l-3-3h399907v-40H7zm93 0
v40h399900v-40zM0 241v40h399900v-40zm0 0v40h399900v-40z`,lefthook:`M400000 281 H103s-33-11.2-61-33.5S0 197.3 0 164s14.2-61.2 42.5
-83.5C70.8 58.2 104 47 142 47 c16.7 0 25 6.7 25 20 0 12-8.7 18.7-26 20-40 3.3
-68.7 15.7-86 37-10 12-15 25.3-15 40 0 22.7 9.8 40.7 29.5 54 19.7 13.3 43.5 21
 71.5 23h399859zM103 281v-40h399897v40z`,leftlinesegment:`M40 281 V428 H0 V94 H40 V241 H400000 v40z
M40 281 V428 H0 V94 H40 V241 H400000 v40z`,leftmapsto:`M40 281 V448H0V74H40V241H400000v40z
M40 281 V448H0V74H40V241H400000v40z`,leftToFrom:`M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23
-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69-70-101l-7-8h399905v-40H95l7-8
c28.7-32 52-65.7 70-101 10.7-23.3 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 265.3
 68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z`,longequal:`M0 50 h400000 v40H0z m0 194h40000v40H0z
M0 50 h400000 v40H0z m0 194h40000v40H0z`,midbrace:`M200428 334
c-100.7-8.3-195.3-44-280-108-55.3-42-101.7-93-139-153l-9-14c-2.7 4-5.7 8.7-9 14
-53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7
 311.7-78.3 403-201 6-8 9.7-12 11-12 .7-.7 6.7-1 18-1s17.3.3 18 1c1.3 0 5 4 11
 12 44.7 59.3 101.3 106.3 170 141s145.3 54.3 229 60h199572v120z`,midbraceunder:`M199572 214
c100.7 8.3 195.3 44 280 108 55.3 42 101.7 93 139 153l9 14c2.7-4 5.7-8.7 9-14
 53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3
 11.7-311.7 78.3-403 201-6 8-9.7 12-11 12-.7.7-6.7 1-18 1s-17.3-.3-18-1c-1.3 0
-5-4-11-12-44.7-59.3-101.3-106.3-170-141s-145.3-54.3-229-60H0V214z`,oiintSize1:`M512.6 71.6c272.6 0 320.3 106.8 320.3 178.2 0 70.8-47.7 177.6
-320.3 177.6S193.1 320.6 193.1 249.8c0-71.4 46.9-178.2 319.5-178.2z
m368.1 178.2c0-86.4-60.9-215.4-368.1-215.4-306.4 0-367.3 129-367.3 215.4 0 85.8
60.9 214.8 367.3 214.8 307.2 0 368.1-129 368.1-214.8z`,oiintSize2:`M757.8 100.1c384.7 0 451.1 137.6 451.1 230 0 91.3-66.4 228.8
-451.1 228.8-386.3 0-452.7-137.5-452.7-228.8 0-92.4 66.4-230 452.7-230z
m502.4 230c0-111.2-82.4-277.2-502.4-277.2s-504 166-504 277.2
c0 110 84 276 504 276s502.4-166 502.4-276z`,oiiintSize1:`M681.4 71.6c408.9 0 480.5 106.8 480.5 178.2 0 70.8-71.6 177.6
-480.5 177.6S202.1 320.6 202.1 249.8c0-71.4 70.5-178.2 479.3-178.2z
m525.8 178.2c0-86.4-86.8-215.4-525.7-215.4-437.9 0-524.7 129-524.7 215.4 0
85.8 86.8 214.8 524.7 214.8 438.9 0 525.7-129 525.7-214.8z`,oiiintSize2:`M1021.2 53c603.6 0 707.8 165.8 707.8 277.2 0 110-104.2 275.8
-707.8 275.8-606 0-710.2-165.8-710.2-275.8C311 218.8 415.2 53 1021.2 53z
m770.4 277.1c0-131.2-126.4-327.6-770.5-327.6S248.4 198.9 248.4 330.1
c0 130 128.8 326.4 772.7 326.4s770.5-196.4 770.5-326.4z`,rightarrow:`M0 241v40h399891c-47.3 35.3-84 78-110 128
-16.7 32-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20
 11 8 0 13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7
 39-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85
-40.5-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5
-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67
 151.7 139 205zm0 0v40h399900v-40z`,rightbrace:`M400000 542l
-6 6h-17c-12.7 0-19.3-.3-20-1-4-4-7.3-8.3-10-13-35.3-51.3-80.8-93.8-136.5-127.5
s-117.2-55.8-184.5-66.5c-.7 0-2-.3-4-1-18.7-2.7-76-4.3-172-5H0V214h399571l6 1
c124.7 8 235 61.7 331 161 31.3 33.3 59.7 72.7 85 118l7 13v35z`,rightbraceunder:`M399994 0l6 6v35l-6 11c-56 104-135.3 181.3-238 232-57.3
 28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237
-174 2.7-5 6-9 10-13 .7-1 7.3-1 20-1h17z`,rightgroup:`M0 80h399565c371 0 266.7 149.4 414 180 5.9 1.2 18 0 18 0 2 0
 3-1 3-3v-38c-76-158-257-219-435-219H0z`,rightgroupunder:`M0 262h399565c371 0 266.7-149.4 414-180 5.9-1.2 18 0 18
 0 2 0 3 1 3 3v38c-76 158-257 219-435 219H0z`,rightharpoon:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3
-3.7-15.3-11-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2
-10.7 0-16.7 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58
 69.2 92 94.5zm0 0v40h399900v-40z`,rightharpoonplus:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3-3.7-15.3-11
-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2-10.7 0-16.7
 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 69.2 92 94.5z
m0 0v40h399900v-40z m100 194v40h399900v-40zm0 0v40h399900v-40z`,rightharpoondown:`M399747 511c0 7.3 6.7 11 20 11 8 0 13-.8 15-2.5s4.7-6.8
 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 8.5-5.8 9.5
-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3-64.7 57-92 95
-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 241v40h399900v-40z`,rightharpoondownplus:`M399747 705c0 7.3 6.7 11 20 11 8 0 13-.8
 15-2.5s4.7-6.8 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3
 8.5-5.8 9.5-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3
-64.7 57-92 95-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 435v40h399900v-40z
m0-194v40h400000v-40zm0 0v40h400000v-40z`,righthook:`M399859 241c-764 0 0 0 0 0 40-3.3 68.7-15.7 86-37 10-12 15-25.3
 15-40 0-22.7-9.8-40.7-29.5-54-19.7-13.3-43.5-21-71.5-23-17.3-1.3-26-8-26-20 0
-13.3 8.7-20 26-20 38 0 71 11.2 99 33.5 0 0 7 5.6 21 16.7 14 11.2 21 33.5 21
 66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z`,rightlinesegment:`M399960 241 V94 h40 V428 h-40 V281 H0 v-40z
M399960 241 V94 h40 V428 h-40 V281 H0 v-40z`,rightToFrom:`M400000 167c-70.7-42-118-97.7-142-167h-23c-15.3 0-23 .3-23
 1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32
-52 65.7-70 101-10.7 23.3-16 35.7-16 37 0 .7 7.7 1 23 1h23c24-69.3 71.3-125 142
-167z M100 147v40h399900v-40zM0 341v40h399900v-40z`,twoheadleftarrow:`M0 167c68 40
 115.7 95.7 143 167h22c15.3 0 23-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69
-70-101l-7-8h125l9 7c50.7 39.3 85 86 103 140h46c0-4.7-6.3-18.7-19-42-18-35.3
-40-67.3-66-96l-9-9h399716v-40H284l9-9c26-28.7 48-60.7 66-96 12.7-23.333 19
-37.333 19-42h-46c-18 54-52.3 100.7-103 140l-9 7H95l7-8c28.7-32 52-65.7 70-101
 10.7-23.333 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 71.3 68 127 0 167z`,twoheadrightarrow:`M400000 167
c-68-40-115.7-95.7-143-167h-22c-15.3 0-23 .3-23 1 0 1.3 5.3 13.7 16 37 18 35.3
 41.3 69 70 101l7 8h-125l-9-7c-50.7-39.3-85-86-103-140h-46c0 4.7 6.3 18.7 19 42
 18 35.3 40 67.3 66 96l9 9H0v40h399716l-9 9c-26 28.7-48 60.7-66 96-12.7 23.333
-19 37.333-19 42h46c18-54 52.3-100.7 103-140l9-7h125l-7 8c-28.7 32-52 65.7-70
 101-10.7 23.333-16 35.7-16 37 0 .7 7.7 1 23 1h22c27.3-71.3 75-127 143-167z`,tilde1:`M200 55.538c-77 0-168 73.953-177 73.953-3 0-7
-2.175-9-5.437L2 97c-1-2-2-4-2-6 0-4 2-7 5-9l20-12C116 12 171 0 207 0c86 0
 114 68 191 68 78 0 168-68 177-68 4 0 7 2 9 5l12 19c1 2.175 2 4.35 2 6.525 0
 4.35-2 7.613-5 9.788l-19 13.05c-92 63.077-116.937 75.308-183 76.128
-68.267.847-113-73.952-191-73.952z`,tilde2:`M344 55.266c-142 0-300.638 81.316-311.5 86.418
-8.01 3.762-22.5 10.91-23.5 5.562L1 120c-1-2-1-3-1-4 0-5 3-9 8-10l18.4-9C160.9
 31.9 283 0 358 0c148 0 188 122 331 122s314-97 326-97c4 0 8 2 10 7l7 21.114
c1 2.14 1 3.21 1 4.28 0 5.347-3 9.626-7 10.696l-22.3 12.622C852.6 158.372 751
 181.476 676 181.476c-149 0-189-126.21-332-126.21z`,tilde3:`M786 59C457 59 32 175.242 13 175.242c-6 0-10-3.457
-11-10.37L.15 138c-1-7 3-12 10-13l19.2-6.4C378.4 40.7 634.3 0 804.3 0c337 0
 411.8 157 746.8 157 328 0 754-112 773-112 5 0 10 3 11 9l1 14.075c1 8.066-.697
 16.595-6.697 17.492l-21.052 7.31c-367.9 98.146-609.15 122.696-778.15 122.696
 -338 0-409-156.573-744-156.573z`,tilde4:`M786 58C457 58 32 177.487 13 177.487c-6 0-10-3.345
-11-10.035L.15 143c-1-7 3-12 10-13l22-6.7C381.2 35 637.15 0 807.15 0c337 0 409
 177 744 177 328 0 754-127 773-127 5 0 10 3 11 9l1 14.794c1 7.805-3 13.38-9
 14.495l-20.7 5.574c-366.85 99.79-607.3 139.372-776.3 139.372-338 0-409
 -175.236-744-175.236z`,vec:`M377 20c0-5.333 1.833-10 5.5-14S391 0 397 0c4.667 0 8.667 1.667 12 5
3.333 2.667 6.667 9 10 19 6.667 24.667 20.333 43.667 41 57 7.333 4.667 11
10.667 11 18 0 6-1 10-3 12s-6.667 5-14 9c-28.667 14.667-53.667 35.667-75 63
-1.333 1.333-3.167 3.5-5.5 6.5s-4 4.833-5 5.5c-1 .667-2.5 1.333-4.5 2s-4.333 1
-7 1c-4.667 0-9.167-1.833-13.5-5.5S337 184 337 178c0-12.667 15.667-32.333 47-59
H213l-171-1c-8.667-6-13-12.333-13-19 0-4.667 4.333-11.333 13-20h359
c-16-25.333-24-45-24-59z`,widehat1:`M529 0h5l519 115c5 1 9 5 9 10 0 1-1 2-1 3l-4 22
c-1 5-5 9-11 9h-2L532 67 19 159h-2c-5 0-9-4-11-9l-5-22c-1-6 2-12 8-13z`,widehat2:`M1181 0h2l1171 176c6 0 10 5 10 11l-2 23c-1 6-5 10
-11 10h-1L1182 67 15 220h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat3:`M1181 0h2l1171 236c6 0 10 5 10 11l-2 23c-1 6-5 10
-11 10h-1L1182 67 15 280h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat4:`M1181 0h2l1171 296c6 0 10 5 10 11l-2 23c-1 6-5 10
-11 10h-1L1182 67 15 340h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widecheck1:`M529,159h5l519,-115c5,-1,9,-5,9,-10c0,-1,-1,-2,-1,-3l-4,-22c-1,
-5,-5,-9,-11,-9h-2l-512,92l-513,-92h-2c-5,0,-9,4,-11,9l-5,22c-1,6,2,12,8,13z`,widecheck2:`M1181,220h2l1171,-176c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
-11,-10h-1l-1168,153l-1167,-153h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck3:`M1181,280h2l1171,-236c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
-11,-10h-1l-1168,213l-1167,-213h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck4:`M1181,340h2l1171,-296c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
-11,-10h-1l-1168,273l-1167,-273h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,baraboveleftarrow:`M400000 620h-399890l3 -3c68.7 -52.7 113.7 -120 135 -202
c4 -14.7 6 -23 6 -25c0 -7.3 -7 -11 -21 -11c-8 0 -13.2 0.8 -15.5 2.5
c-2.3 1.7 -4.2 5.8 -5.5 12.5c-1.3 4.7 -2.7 10.3 -4 17c-12 48.7 -34.8 92 -68.5 130
s-74.2 66.3 -121.5 85c-10 4 -16 7.7 -18 11c0 8.7 6 14.3 18 17c47.3 18.7 87.8 47
121.5 85s56.5 81.3 68.5 130c0.7 2 1.3 5 2 9s1.2 6.7 1.5 8c0.3 1.3 1 3.3 2 6
s2.2 4.5 3.5 5.5c1.3 1 3.3 1.8 6 2.5s6 1 10 1c14 0 21 -3.7 21 -11
c0 -2 -2 -10.3 -6 -25c-20 -79.3 -65 -146.7 -135 -202l-3 -3h399890z
M100 620v40h399900v-40z M0 241v40h399900v-40zM0 241v40h399900v-40z`,rightarrowabovebar:`M0 241v40h399891c-47.3 35.3-84 78-110 128-16.7 32
-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 11 8 0
13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 39
-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85-40.5
-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5
-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67
151.7 139 205zm96 379h399894v40H0zm0 0h399904v40H0z`,baraboveshortleftharpoon:`M507,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11
c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17
c2,0.7,5,1,9,1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21
c-32,-87.3,-82.7,-157.7,-152,-211c0,0,-3,-3,-3,-3l399351,0l0,-40
c-398570,0,-399437,0,-399437,0z M593 435 v40 H399500 v-40z
M0 281 v-40 H399908 v40z M0 281 v-40 H399908 v40z`,rightharpoonaboveshortbar:`M0,241 l0,40c399126,0,399993,0,399993,0
c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,
-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6
c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z
M0 241 v40 H399908 v-40z M0 475 v-40 H399500 v40z M0 475 v-40 H399500 v40z`,shortbaraboveleftharpoon:`M7,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11
c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17c2,0.7,5,1,9,
1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21c-32,-87.3,-82.7,-157.7,
-152,-211c0,0,-3,-3,-3,-3l399907,0l0,-40c-399126,0,-399993,0,-399993,0z
M93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z`,shortrightharpoonabovebar:`M53,241l0,40c398570,0,399437,0,399437,0
c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,
-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6
c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z
M500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z`},_ue=function(e,r){switch(e){case"lbrack":return"M403 1759 V84 H666 V0 H319 V1759 v"+r+` v1759 h347 v-84
H403z M403 1759 V0 H319 V1759 v`+r+" v1759 h84z";case"rbrack":return"M347 1759 V0 H0 V84 H263 V1759 v"+r+` v1759 H0 v84 H347z
M347 1759 V0 H263 V1759 v`+r+" v1759 h84z";case"vert":return"M145 15 v585 v"+r+` v585 c2.667,10,9.667,15,21,15
c10,0,16.667,-5,20,-15 v-585 v`+-r+` v-585 c-2.667,-10,-9.667,-15,-21,-15
c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+r+" v585 h43z";case"doublevert":return"M145 15 v585 v"+r+` v585 c2.667,10,9.667,15,21,15
c10,0,16.667,-5,20,-15 v-585 v`+-r+` v-585 c-2.667,-10,-9.667,-15,-21,-15
c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+r+` v585 h43z
M367 15 v585 v`+r+` v585 c2.667,10,9.667,15,21,15
c10,0,16.667,-5,20,-15 v-585 v`+-r+` v-585 c-2.667,-10,-9.667,-15,-21,-15
c-10,0,-16.667,5,-20,15z M410 15 H367 v585 v`+r+" v585 h43z";case"lfloor":return"M319 602 V0 H403 V602 v"+r+` v1715 h263 v84 H319z
MM319 602 V0 H403 V602 v`+r+" v1715 H319z";case"rfloor":return"M319 602 V0 H403 V602 v"+r+` v1799 H0 v-84 H319z
MM319 602 V0 H403 V602 v`+r+" v1715 H319z";case"lceil":return"M403 1759 V84 H666 V0 H319 V1759 v"+r+` v602 h84z
M403 1759 V0 H319 V1759 v`+r+" v602 h84z";case"rceil":return"M347 1759 V0 H0 V84 H263 V1759 v"+r+` v602 h84z
M347 1759 V0 h-84 V1759 v`+r+" v602 h84z";case"lparen":return`M863,9c0,-2,-2,-5,-6,-9c0,0,-17,0,-17,0c-12.7,0,-19.3,0.3,-20,1
c-5.3,5.3,-10.3,11,-15,17c-242.7,294.7,-395.3,682,-458,1162c-21.3,163.3,-33.3,349,
-36,557 l0,`+(r+84)+`c0.2,6,0,26,0,60c2,159.3,10,310.7,24,454c53.3,528,210,
949.7,470,1265c4.7,6,9.7,11.7,15,17c0.7,0.7,7,1,19,1c0,0,18,0,18,0c4,-4,6,-7,6,-9
c0,-2.7,-3.3,-8.7,-10,-18c-135.3,-192.7,-235.5,-414.3,-300.5,-665c-65,-250.7,-102.5,
-544.7,-112.5,-882c-2,-104,-3,-167,-3,-189
l0,-`+(r+92)+`c0,-162.7,5.7,-314,17,-454c20.7,-272,63.7,-513,129,-723c65.3,
-210,155.3,-396.3,270,-559c6.7,-9.3,10,-15.3,10,-18z`;case"rparen":return`M76,0c-16.7,0,-25,3,-25,9c0,2,2,6.3,6,13c21.3,28.7,42.3,60.3,
63,95c96.7,156.7,172.8,332.5,228.5,527.5c55.7,195,92.8,416.5,111.5,664.5
c11.3,139.3,17,290.7,17,454c0,28,1.7,43,3.3,45l0,`+(r+9)+`
c-3,4,-3.3,16.7,-3.3,38c0,162,-5.7,313.7,-17,455c-18.7,248,-55.8,469.3,-111.5,664
c-55.7,194.7,-131.8,370.3,-228.5,527c-20.7,34.7,-41.7,66.3,-63,95c-2,3.3,-4,7,-6,11
c0,7.3,5.7,11,17,11c0,0,11,0,11,0c9.3,0,14.3,-0.3,15,-1c5.3,-5.3,10.3,-11,15,-17
c242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558
l0,-`+(r+144)+`c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7,
-470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z`;default:throw new Error("Unknown stretchy delimiter.")}};class Gp{constructor(e){this.children=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.children=e,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(e){return this.classes.includes(e)}toNode(){for(var e=document.createDocumentFragment(),r=0;r<this.children.length;r++)e.appendChild(this.children[r].toNode());return e}toMarkup(){for(var e="",r=0;r<this.children.length;r++)e+=this.children[r].toMarkup();return e}toText(){var e=r=>r.toText();return this.children.map(e).join("")}}var Vs={"AMS-Regular":{32:[0,0,0,0,.25],65:[0,.68889,0,0,.72222],66:[0,.68889,0,0,.66667],67:[0,.68889,0,0,.72222],68:[0,.68889,0,0,.72222],69:[0,.68889,0,0,.66667],70:[0,.68889,0,0,.61111],71:[0,.68889,0,0,.77778],72:[0,.68889,0,0,.77778],73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:[0,.68889,0,0,.77778],76:[0,.68889,0,0,.66667],77:[0,.68889,0,0,.94445],78:[0,.68889,0,0,.72222],79:[.16667,.68889,0,0,.77778],80:[0,.68889,0,0,.61111],81:[.16667,.68889,0,0,.77778],82:[0,.68889,0,0,.72222],83:[0,.68889,0,0,.55556],84:[0,.68889,0,0,.66667],85:[0,.68889,0,0,.72222],86:[0,.68889,0,0,.72222],87:[0,.68889,0,0,1],88:[0,.68889,0,0,.72222],89:[0,.68889,0,0,.72222],90:[0,.68889,0,0,.66667],107:[0,.68889,0,0,.55556],160:[0,0,0,0,.25],165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:[0,.68889,0,0,.55556],295:[0,.68889,0,0,.54028],710:[0,.825,0,0,2.33334],732:[0,.9,0,0,2.33334],770:[0,.825,0,0,2.33334],771:[0,.9,0,0,2.33334],989:[.08167,.58167,0,0,.77778],1008:[0,.43056,.04028,0,.66667],8245:[0,.54986,0,0,.275],8463:[0,.68889,0,0,.54028],8487:[0,.68889,0,0,.72222],8498:[0,.68889,0,0,.55556],8502:[0,.68889,0,0,.66667],8503:[0,.68889,0,0,.44445],8504:[0,.68889,0,0,.66667],8513:[0,.68889,0,0,.63889],8592:[-.03598,.46402,0,0,.5],8594:[-.03598,.46402,0,0,.5],8602:[-.13313,.36687,0,0,1],8603:[-.13313,.36687,0,0,1],8606:[.01354,.52239,0,0,1],8608:[.01354,.52239,0,0,1],8610:[.01354,.52239,0,0,1.11111],8611:[.01354,.52239,0,0,1.11111],8619:[0,.54986,0,0,1],8620:[0,.54986,0,0,1],8621:[-.13313,.37788,0,0,1.38889],8622:[-.13313,.36687,0,0,1],8624:[0,.69224,0,0,.5],8625:[0,.69224,0,0,.5],8630:[0,.43056,0,0,1],8631:[0,.43056,0,0,1],8634:[.08198,.58198,0,0,.77778],8635:[.08198,.58198,0,0,.77778],8638:[.19444,.69224,0,0,.41667],8639:[.19444,.69224,0,0,.41667],8642:[.19444,.69224,0,0,.41667],8643:[.19444,.69224,0,0,.41667],8644:[.1808,.675,0,0,1],8646:[.1808,.675,0,0,1],8647:[.1808,.675,0,0,1],8648:[.19444,.69224,0,0,.83334],8649:[.1808,.675,0,0,1],8650:[.19444,.69224,0,0,.83334],8651:[.01354,.52239,0,0,1],8652:[.01354,.52239,0,0,1],8653:[-.13313,.36687,0,0,1],8654:[-.13313,.36687,0,0,1],8655:[-.13313,.36687,0,0,1],8666:[.13667,.63667,0,0,1],8667:[.13667,.63667,0,0,1],8669:[-.13313,.37788,0,0,1],8672:[-.064,.437,0,0,1.334],8674:[-.064,.437,0,0,1.334],8705:[0,.825,0,0,.5],8708:[0,.68889,0,0,.55556],8709:[.08167,.58167,0,0,.77778],8717:[0,.43056,0,0,.42917],8722:[-.03598,.46402,0,0,.5],8724:[.08198,.69224,0,0,.77778],8726:[.08167,.58167,0,0,.77778],8733:[0,.69224,0,0,.77778],8736:[0,.69224,0,0,.72222],8737:[0,.69224,0,0,.72222],8738:[.03517,.52239,0,0,.72222],8739:[.08167,.58167,0,0,.22222],8740:[.25142,.74111,0,0,.27778],8741:[.08167,.58167,0,0,.38889],8742:[.25142,.74111,0,0,.5],8756:[0,.69224,0,0,.66667],8757:[0,.69224,0,0,.66667],8764:[-.13313,.36687,0,0,.77778],8765:[-.13313,.37788,0,0,.77778],8769:[-.13313,.36687,0,0,.77778],8770:[-.03625,.46375,0,0,.77778],8774:[.30274,.79383,0,0,.77778],8776:[-.01688,.48312,0,0,.77778],8778:[.08167,.58167,0,0,.77778],8782:[.06062,.54986,0,0,.77778],8783:[.06062,.54986,0,0,.77778],8785:[.08198,.58198,0,0,.77778],8786:[.08198,.58198,0,0,.77778],8787:[.08198,.58198,0,0,.77778],8790:[0,.69224,0,0,.77778],8791:[.22958,.72958,0,0,.77778],8796:[.08198,.91667,0,0,.77778],8806:[.25583,.75583,0,0,.77778],8807:[.25583,.75583,0,0,.77778],8808:[.25142,.75726,0,0,.77778],8809:[.25142,.75726,0,0,.77778],8812:[.25583,.75583,0,0,.5],8814:[.20576,.70576,0,0,.77778],8815:[.20576,.70576,0,0,.77778],8816:[.30274,.79383,0,0,.77778],8817:[.30274,.79383,0,0,.77778],8818:[.22958,.72958,0,0,.77778],8819:[.22958,.72958,0,0,.77778],8822:[.1808,.675,0,0,.77778],8823:[.1808,.675,0,0,.77778],8828:[.13667,.63667,0,0,.77778],8829:[.13667,.63667,0,0,.77778],8830:[.22958,.72958,0,0,.77778],8831:[.22958,.72958,0,0,.77778],8832:[.20576,.70576,0,0,.77778],8833:[.20576,.70576,0,0,.77778],8840:[.30274,.79383,0,0,.77778],8841:[.30274,.79383,0,0,.77778],8842:[.13597,.63597,0,0,.77778],8843:[.13597,.63597,0,0,.77778],8847:[.03517,.54986,0,0,.77778],8848:[.03517,.54986,0,0,.77778],8858:[.08198,.58198,0,0,.77778],8859:[.08198,.58198,0,0,.77778],8861:[.08198,.58198,0,0,.77778],8862:[0,.675,0,0,.77778],8863:[0,.675,0,0,.77778],8864:[0,.675,0,0,.77778],8865:[0,.675,0,0,.77778],8872:[0,.69224,0,0,.61111],8873:[0,.69224,0,0,.72222],8874:[0,.69224,0,0,.88889],8876:[0,.68889,0,0,.61111],8877:[0,.68889,0,0,.61111],8878:[0,.68889,0,0,.72222],8879:[0,.68889,0,0,.72222],8882:[.03517,.54986,0,0,.77778],8883:[.03517,.54986,0,0,.77778],8884:[.13667,.63667,0,0,.77778],8885:[.13667,.63667,0,0,.77778],8888:[0,.54986,0,0,1.11111],8890:[.19444,.43056,0,0,.55556],8891:[.19444,.69224,0,0,.61111],8892:[.19444,.69224,0,0,.61111],8901:[0,.54986,0,0,.27778],8903:[.08167,.58167,0,0,.77778],8905:[.08167,.58167,0,0,.77778],8906:[.08167,.58167,0,0,.77778],8907:[0,.69224,0,0,.77778],8908:[0,.69224,0,0,.77778],8909:[-.03598,.46402,0,0,.77778],8910:[0,.54986,0,0,.76042],8911:[0,.54986,0,0,.76042],8912:[.03517,.54986,0,0,.77778],8913:[.03517,.54986,0,0,.77778],8914:[0,.54986,0,0,.66667],8915:[0,.54986,0,0,.66667],8916:[0,.69224,0,0,.66667],8918:[.0391,.5391,0,0,.77778],8919:[.0391,.5391,0,0,.77778],8920:[.03517,.54986,0,0,1.33334],8921:[.03517,.54986,0,0,1.33334],8922:[.38569,.88569,0,0,.77778],8923:[.38569,.88569,0,0,.77778],8926:[.13667,.63667,0,0,.77778],8927:[.13667,.63667,0,0,.77778],8928:[.30274,.79383,0,0,.77778],8929:[.30274,.79383,0,0,.77778],8934:[.23222,.74111,0,0,.77778],8935:[.23222,.74111,0,0,.77778],8936:[.23222,.74111,0,0,.77778],8937:[.23222,.74111,0,0,.77778],8938:[.20576,.70576,0,0,.77778],8939:[.20576,.70576,0,0,.77778],8940:[.30274,.79383,0,0,.77778],8941:[.30274,.79383,0,0,.77778],8994:[.19444,.69224,0,0,.77778],8995:[.19444,.69224,0,0,.77778],9416:[.15559,.69224,0,0,.90222],9484:[0,.69224,0,0,.5],9488:[0,.69224,0,0,.5],9492:[0,.37788,0,0,.5],9496:[0,.37788,0,0,.5],9585:[.19444,.68889,0,0,.88889],9586:[.19444,.74111,0,0,.88889],9632:[0,.675,0,0,.77778],9633:[0,.675,0,0,.77778],9650:[0,.54986,0,0,.72222],9651:[0,.54986,0,0,.72222],9654:[.03517,.54986,0,0,.77778],9660:[0,.54986,0,0,.72222],9661:[0,.54986,0,0,.72222],9664:[.03517,.54986,0,0,.77778],9674:[.11111,.69224,0,0,.66667],9733:[.19444,.69224,0,0,.94445],10003:[0,.69224,0,0,.83334],10016:[0,.69224,0,0,.83334],10731:[.11111,.69224,0,0,.66667],10846:[.19444,.75583,0,0,.61111],10877:[.13667,.63667,0,0,.77778],10878:[.13667,.63667,0,0,.77778],10885:[.25583,.75583,0,0,.77778],10886:[.25583,.75583,0,0,.77778],10887:[.13597,.63597,0,0,.77778],10888:[.13597,.63597,0,0,.77778],10889:[.26167,.75726,0,0,.77778],10890:[.26167,.75726,0,0,.77778],10891:[.48256,.98256,0,0,.77778],10892:[.48256,.98256,0,0,.77778],10901:[.13667,.63667,0,0,.77778],10902:[.13667,.63667,0,0,.77778],10933:[.25142,.75726,0,0,.77778],10934:[.25142,.75726,0,0,.77778],10935:[.26167,.75726,0,0,.77778],10936:[.26167,.75726,0,0,.77778],10937:[.26167,.75726,0,0,.77778],10938:[.26167,.75726,0,0,.77778],10949:[.25583,.75583,0,0,.77778],10950:[.25583,.75583,0,0,.77778],10955:[.28481,.79383,0,0,.77778],10956:[.28481,.79383,0,0,.77778],57350:[.08167,.58167,0,0,.22222],57351:[.08167,.58167,0,0,.38889],57352:[.08167,.58167,0,0,.77778],57353:[0,.43056,.04028,0,.66667],57356:[.25142,.75726,0,0,.77778],57357:[.25142,.75726,0,0,.77778],57358:[.41951,.91951,0,0,.77778],57359:[.30274,.79383,0,0,.77778],57360:[.30274,.79383,0,0,.77778],57361:[.41951,.91951,0,0,.77778],57366:[.25142,.75726,0,0,.77778],57367:[.25142,.75726,0,0,.77778],57368:[.25142,.75726,0,0,.77778],57369:[.25142,.75726,0,0,.77778],57370:[.13597,.63597,0,0,.77778],57371:[.13597,.63597,0,0,.77778]},"Caligraphic-Regular":{32:[0,0,0,0,.25],65:[0,.68333,0,.19445,.79847],66:[0,.68333,.03041,.13889,.65681],67:[0,.68333,.05834,.13889,.52653],68:[0,.68333,.02778,.08334,.77139],69:[0,.68333,.08944,.11111,.52778],70:[0,.68333,.09931,.11111,.71875],71:[.09722,.68333,.0593,.11111,.59487],72:[0,.68333,.00965,.11111,.84452],73:[0,.68333,.07382,0,.54452],74:[.09722,.68333,.18472,.16667,.67778],75:[0,.68333,.01445,.05556,.76195],76:[0,.68333,0,.13889,.68972],77:[0,.68333,0,.13889,1.2009],78:[0,.68333,.14736,.08334,.82049],79:[0,.68333,.02778,.11111,.79611],80:[0,.68333,.08222,.08334,.69556],81:[.09722,.68333,0,.11111,.81667],82:[0,.68333,0,.08334,.8475],83:[0,.68333,.075,.13889,.60556],84:[0,.68333,.25417,0,.54464],85:[0,.68333,.09931,.08334,.62583],86:[0,.68333,.08222,0,.61278],87:[0,.68333,.08222,.08334,.98778],88:[0,.68333,.14643,.13889,.7133],89:[.09722,.68333,.08222,.08334,.66834],90:[0,.68333,.07944,.13889,.72473],160:[0,0,0,0,.25]},"Fraktur-Regular":{32:[0,0,0,0,.25],33:[0,.69141,0,0,.29574],34:[0,.69141,0,0,.21471],38:[0,.69141,0,0,.73786],39:[0,.69141,0,0,.21201],40:[.24982,.74947,0,0,.38865],41:[.24982,.74947,0,0,.38865],42:[0,.62119,0,0,.27764],43:[.08319,.58283,0,0,.75623],44:[0,.10803,0,0,.27764],45:[.08319,.58283,0,0,.75623],46:[0,.10803,0,0,.27764],47:[.24982,.74947,0,0,.50181],48:[0,.47534,0,0,.50181],49:[0,.47534,0,0,.50181],50:[0,.47534,0,0,.50181],51:[.18906,.47534,0,0,.50181],52:[.18906,.47534,0,0,.50181],53:[.18906,.47534,0,0,.50181],54:[0,.69141,0,0,.50181],55:[.18906,.47534,0,0,.50181],56:[0,.69141,0,0,.50181],57:[.18906,.47534,0,0,.50181],58:[0,.47534,0,0,.21606],59:[.12604,.47534,0,0,.21606],61:[-.13099,.36866,0,0,.75623],63:[0,.69141,0,0,.36245],65:[0,.69141,0,0,.7176],66:[0,.69141,0,0,.88397],67:[0,.69141,0,0,.61254],68:[0,.69141,0,0,.83158],69:[0,.69141,0,0,.66278],70:[.12604,.69141,0,0,.61119],71:[0,.69141,0,0,.78539],72:[.06302,.69141,0,0,.7203],73:[0,.69141,0,0,.55448],74:[.12604,.69141,0,0,.55231],75:[0,.69141,0,0,.66845],76:[0,.69141,0,0,.66602],77:[0,.69141,0,0,1.04953],78:[0,.69141,0,0,.83212],79:[0,.69141,0,0,.82699],80:[.18906,.69141,0,0,.82753],81:[.03781,.69141,0,0,.82699],82:[0,.69141,0,0,.82807],83:[0,.69141,0,0,.82861],84:[0,.69141,0,0,.66899],85:[0,.69141,0,0,.64576],86:[0,.69141,0,0,.83131],87:[0,.69141,0,0,1.04602],88:[0,.69141,0,0,.71922],89:[.18906,.69141,0,0,.83293],90:[.12604,.69141,0,0,.60201],91:[.24982,.74947,0,0,.27764],93:[.24982,.74947,0,0,.27764],94:[0,.69141,0,0,.49965],97:[0,.47534,0,0,.50046],98:[0,.69141,0,0,.51315],99:[0,.47534,0,0,.38946],100:[0,.62119,0,0,.49857],101:[0,.47534,0,0,.40053],102:[.18906,.69141,0,0,.32626],103:[.18906,.47534,0,0,.5037],104:[.18906,.69141,0,0,.52126],105:[0,.69141,0,0,.27899],106:[0,.69141,0,0,.28088],107:[0,.69141,0,0,.38946],108:[0,.69141,0,0,.27953],109:[0,.47534,0,0,.76676],110:[0,.47534,0,0,.52666],111:[0,.47534,0,0,.48885],112:[.18906,.52396,0,0,.50046],113:[.18906,.47534,0,0,.48912],114:[0,.47534,0,0,.38919],115:[0,.47534,0,0,.44266],116:[0,.62119,0,0,.33301],117:[0,.47534,0,0,.5172],118:[0,.52396,0,0,.5118],119:[0,.52396,0,0,.77351],120:[.18906,.47534,0,0,.38865],121:[.18906,.47534,0,0,.49884],122:[.18906,.47534,0,0,.39054],160:[0,0,0,0,.25],8216:[0,.69141,0,0,.21471],8217:[0,.69141,0,0,.21471],58112:[0,.62119,0,0,.49749],58113:[0,.62119,0,0,.4983],58114:[.18906,.69141,0,0,.33328],58115:[.18906,.69141,0,0,.32923],58116:[.18906,.47534,0,0,.50343],58117:[0,.69141,0,0,.33301],58118:[0,.62119,0,0,.33409],58119:[0,.47534,0,0,.50073]},"Main-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.35],34:[0,.69444,0,0,.60278],35:[.19444,.69444,0,0,.95833],36:[.05556,.75,0,0,.575],37:[.05556,.75,0,0,.95833],38:[0,.69444,0,0,.89444],39:[0,.69444,0,0,.31944],40:[.25,.75,0,0,.44722],41:[.25,.75,0,0,.44722],42:[0,.75,0,0,.575],43:[.13333,.63333,0,0,.89444],44:[.19444,.15556,0,0,.31944],45:[0,.44444,0,0,.38333],46:[0,.15556,0,0,.31944],47:[.25,.75,0,0,.575],48:[0,.64444,0,0,.575],49:[0,.64444,0,0,.575],50:[0,.64444,0,0,.575],51:[0,.64444,0,0,.575],52:[0,.64444,0,0,.575],53:[0,.64444,0,0,.575],54:[0,.64444,0,0,.575],55:[0,.64444,0,0,.575],56:[0,.64444,0,0,.575],57:[0,.64444,0,0,.575],58:[0,.44444,0,0,.31944],59:[.19444,.44444,0,0,.31944],60:[.08556,.58556,0,0,.89444],61:[-.10889,.39111,0,0,.89444],62:[.08556,.58556,0,0,.89444],63:[0,.69444,0,0,.54305],64:[0,.69444,0,0,.89444],65:[0,.68611,0,0,.86944],66:[0,.68611,0,0,.81805],67:[0,.68611,0,0,.83055],68:[0,.68611,0,0,.88194],69:[0,.68611,0,0,.75555],70:[0,.68611,0,0,.72361],71:[0,.68611,0,0,.90416],72:[0,.68611,0,0,.9],73:[0,.68611,0,0,.43611],74:[0,.68611,0,0,.59444],75:[0,.68611,0,0,.90138],76:[0,.68611,0,0,.69166],77:[0,.68611,0,0,1.09166],78:[0,.68611,0,0,.9],79:[0,.68611,0,0,.86388],80:[0,.68611,0,0,.78611],81:[.19444,.68611,0,0,.86388],82:[0,.68611,0,0,.8625],83:[0,.68611,0,0,.63889],84:[0,.68611,0,0,.8],85:[0,.68611,0,0,.88472],86:[0,.68611,.01597,0,.86944],87:[0,.68611,.01597,0,1.18888],88:[0,.68611,0,0,.86944],89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:[.25,.75,0,0,.31944],92:[.25,.75,0,0,.575],93:[.25,.75,0,0,.31944],94:[0,.69444,0,0,.575],95:[.31,.13444,.03194,0,.575],97:[0,.44444,0,0,.55902],98:[0,.69444,0,0,.63889],99:[0,.44444,0,0,.51111],100:[0,.69444,0,0,.63889],101:[0,.44444,0,0,.52708],102:[0,.69444,.10903,0,.35139],103:[.19444,.44444,.01597,0,.575],104:[0,.69444,0,0,.63889],105:[0,.69444,0,0,.31944],106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:[0,.69444,0,0,.31944],109:[0,.44444,0,0,.95833],110:[0,.44444,0,0,.63889],111:[0,.44444,0,0,.575],112:[.19444,.44444,0,0,.63889],113:[.19444,.44444,0,0,.60694],114:[0,.44444,0,0,.47361],115:[0,.44444,0,0,.45361],116:[0,.63492,0,0,.44722],117:[0,.44444,0,0,.63889],118:[0,.44444,.01597,0,.60694],119:[0,.44444,.01597,0,.83055],120:[0,.44444,0,0,.60694],121:[.19444,.44444,.01597,0,.60694],122:[0,.44444,0,0,.51111],123:[.25,.75,0,0,.575],124:[.25,.75,0,0,.31944],125:[.25,.75,0,0,.575],126:[.35,.34444,0,0,.575],160:[0,0,0,0,.25],163:[0,.69444,0,0,.86853],168:[0,.69444,0,0,.575],172:[0,.44444,0,0,.76666],176:[0,.69444,0,0,.86944],177:[.13333,.63333,0,0,.89444],184:[.17014,0,0,0,.51111],198:[0,.68611,0,0,1.04166],215:[.13333,.63333,0,0,.89444],216:[.04861,.73472,0,0,.89444],223:[0,.69444,0,0,.59722],230:[0,.44444,0,0,.83055],247:[.13333,.63333,0,0,.89444],248:[.09722,.54167,0,0,.575],305:[0,.44444,0,0,.31944],338:[0,.68611,0,0,1.16944],339:[0,.44444,0,0,.89444],567:[.19444,.44444,0,0,.35139],710:[0,.69444,0,0,.575],711:[0,.63194,0,0,.575],713:[0,.59611,0,0,.575],714:[0,.69444,0,0,.575],715:[0,.69444,0,0,.575],728:[0,.69444,0,0,.575],729:[0,.69444,0,0,.31944],730:[0,.69444,0,0,.86944],732:[0,.69444,0,0,.575],733:[0,.69444,0,0,.575],915:[0,.68611,0,0,.69166],916:[0,.68611,0,0,.95833],920:[0,.68611,0,0,.89444],923:[0,.68611,0,0,.80555],926:[0,.68611,0,0,.76666],928:[0,.68611,0,0,.9],931:[0,.68611,0,0,.83055],933:[0,.68611,0,0,.89444],934:[0,.68611,0,0,.83055],936:[0,.68611,0,0,.89444],937:[0,.68611,0,0,.83055],8211:[0,.44444,.03194,0,.575],8212:[0,.44444,.03194,0,1.14999],8216:[0,.69444,0,0,.31944],8217:[0,.69444,0,0,.31944],8220:[0,.69444,0,0,.60278],8221:[0,.69444,0,0,.60278],8224:[.19444,.69444,0,0,.51111],8225:[.19444,.69444,0,0,.51111],8242:[0,.55556,0,0,.34444],8407:[0,.72444,.15486,0,.575],8463:[0,.69444,0,0,.66759],8465:[0,.69444,0,0,.83055],8467:[0,.69444,0,0,.47361],8472:[.19444,.44444,0,0,.74027],8476:[0,.69444,0,0,.83055],8501:[0,.69444,0,0,.70277],8592:[-.10889,.39111,0,0,1.14999],8593:[.19444,.69444,0,0,.575],8594:[-.10889,.39111,0,0,1.14999],8595:[.19444,.69444,0,0,.575],8596:[-.10889,.39111,0,0,1.14999],8597:[.25,.75,0,0,.575],8598:[.19444,.69444,0,0,1.14999],8599:[.19444,.69444,0,0,1.14999],8600:[.19444,.69444,0,0,1.14999],8601:[.19444,.69444,0,0,1.14999],8636:[-.10889,.39111,0,0,1.14999],8637:[-.10889,.39111,0,0,1.14999],8640:[-.10889,.39111,0,0,1.14999],8641:[-.10889,.39111,0,0,1.14999],8656:[-.10889,.39111,0,0,1.14999],8657:[.19444,.69444,0,0,.70277],8658:[-.10889,.39111,0,0,1.14999],8659:[.19444,.69444,0,0,.70277],8660:[-.10889,.39111,0,0,1.14999],8661:[.25,.75,0,0,.70277],8704:[0,.69444,0,0,.63889],8706:[0,.69444,.06389,0,.62847],8707:[0,.69444,0,0,.63889],8709:[.05556,.75,0,0,.575],8711:[0,.68611,0,0,.95833],8712:[.08556,.58556,0,0,.76666],8715:[.08556,.58556,0,0,.76666],8722:[.13333,.63333,0,0,.89444],8723:[.13333,.63333,0,0,.89444],8725:[.25,.75,0,0,.575],8726:[.25,.75,0,0,.575],8727:[-.02778,.47222,0,0,.575],8728:[-.02639,.47361,0,0,.575],8729:[-.02639,.47361,0,0,.575],8730:[.18,.82,0,0,.95833],8733:[0,.44444,0,0,.89444],8734:[0,.44444,0,0,1.14999],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.31944],8741:[.25,.75,0,0,.575],8743:[0,.55556,0,0,.76666],8744:[0,.55556,0,0,.76666],8745:[0,.55556,0,0,.76666],8746:[0,.55556,0,0,.76666],8747:[.19444,.69444,.12778,0,.56875],8764:[-.10889,.39111,0,0,.89444],8768:[.19444,.69444,0,0,.31944],8771:[.00222,.50222,0,0,.89444],8773:[.027,.638,0,0,.894],8776:[.02444,.52444,0,0,.89444],8781:[.00222,.50222,0,0,.89444],8801:[.00222,.50222,0,0,.89444],8804:[.19667,.69667,0,0,.89444],8805:[.19667,.69667,0,0,.89444],8810:[.08556,.58556,0,0,1.14999],8811:[.08556,.58556,0,0,1.14999],8826:[.08556,.58556,0,0,.89444],8827:[.08556,.58556,0,0,.89444],8834:[.08556,.58556,0,0,.89444],8835:[.08556,.58556,0,0,.89444],8838:[.19667,.69667,0,0,.89444],8839:[.19667,.69667,0,0,.89444],8846:[0,.55556,0,0,.76666],8849:[.19667,.69667,0,0,.89444],8850:[.19667,.69667,0,0,.89444],8851:[0,.55556,0,0,.76666],8852:[0,.55556,0,0,.76666],8853:[.13333,.63333,0,0,.89444],8854:[.13333,.63333,0,0,.89444],8855:[.13333,.63333,0,0,.89444],8856:[.13333,.63333,0,0,.89444],8857:[.13333,.63333,0,0,.89444],8866:[0,.69444,0,0,.70277],8867:[0,.69444,0,0,.70277],8868:[0,.69444,0,0,.89444],8869:[0,.69444,0,0,.89444],8900:[-.02639,.47361,0,0,.575],8901:[-.02639,.47361,0,0,.31944],8902:[-.02778,.47222,0,0,.575],8968:[.25,.75,0,0,.51111],8969:[.25,.75,0,0,.51111],8970:[.25,.75,0,0,.51111],8971:[.25,.75,0,0,.51111],8994:[-.13889,.36111,0,0,1.14999],8995:[-.13889,.36111,0,0,1.14999],9651:[.19444,.69444,0,0,1.02222],9657:[-.02778,.47222,0,0,.575],9661:[.19444,.69444,0,0,1.02222],9667:[-.02778,.47222,0,0,.575],9711:[.19444,.69444,0,0,1.14999],9824:[.12963,.69444,0,0,.89444],9825:[.12963,.69444,0,0,.89444],9826:[.12963,.69444,0,0,.89444],9827:[.12963,.69444,0,0,.89444],9837:[0,.75,0,0,.44722],9838:[.19444,.69444,0,0,.44722],9839:[.19444,.69444,0,0,.44722],10216:[.25,.75,0,0,.44722],10217:[.25,.75,0,0,.44722],10815:[0,.68611,0,0,.9],10927:[.19667,.69667,0,0,.89444],10928:[.19667,.69667,0,0,.89444],57376:[.19444,.69444,0,0,0]},"Main-BoldItalic":{32:[0,0,0,0,.25],33:[0,.69444,.11417,0,.38611],34:[0,.69444,.07939,0,.62055],35:[.19444,.69444,.06833,0,.94444],37:[.05556,.75,.12861,0,.94444],38:[0,.69444,.08528,0,.88555],39:[0,.69444,.12945,0,.35555],40:[.25,.75,.15806,0,.47333],41:[.25,.75,.03306,0,.47333],42:[0,.75,.14333,0,.59111],43:[.10333,.60333,.03306,0,.88555],44:[.19444,.14722,0,0,.35555],45:[0,.44444,.02611,0,.41444],46:[0,.14722,0,0,.35555],47:[.25,.75,.15806,0,.59111],48:[0,.64444,.13167,0,.59111],49:[0,.64444,.13167,0,.59111],50:[0,.64444,.13167,0,.59111],51:[0,.64444,.13167,0,.59111],52:[.19444,.64444,.13167,0,.59111],53:[0,.64444,.13167,0,.59111],54:[0,.64444,.13167,0,.59111],55:[.19444,.64444,.13167,0,.59111],56:[0,.64444,.13167,0,.59111],57:[0,.64444,.13167,0,.59111],58:[0,.44444,.06695,0,.35555],59:[.19444,.44444,.06695,0,.35555],61:[-.10889,.39111,.06833,0,.88555],63:[0,.69444,.11472,0,.59111],64:[0,.69444,.09208,0,.88555],65:[0,.68611,0,0,.86555],66:[0,.68611,.0992,0,.81666],67:[0,.68611,.14208,0,.82666],68:[0,.68611,.09062,0,.87555],69:[0,.68611,.11431,0,.75666],70:[0,.68611,.12903,0,.72722],71:[0,.68611,.07347,0,.89527],72:[0,.68611,.17208,0,.8961],73:[0,.68611,.15681,0,.47166],74:[0,.68611,.145,0,.61055],75:[0,.68611,.14208,0,.89499],76:[0,.68611,0,0,.69777],77:[0,.68611,.17208,0,1.07277],78:[0,.68611,.17208,0,.8961],79:[0,.68611,.09062,0,.85499],80:[0,.68611,.0992,0,.78721],81:[.19444,.68611,.09062,0,.85499],82:[0,.68611,.02559,0,.85944],83:[0,.68611,.11264,0,.64999],84:[0,.68611,.12903,0,.7961],85:[0,.68611,.17208,0,.88083],86:[0,.68611,.18625,0,.86555],87:[0,.68611,.18625,0,1.15999],88:[0,.68611,.15681,0,.86555],89:[0,.68611,.19803,0,.86555],90:[0,.68611,.14208,0,.70888],91:[.25,.75,.1875,0,.35611],93:[.25,.75,.09972,0,.35611],94:[0,.69444,.06709,0,.59111],95:[.31,.13444,.09811,0,.59111],97:[0,.44444,.09426,0,.59111],98:[0,.69444,.07861,0,.53222],99:[0,.44444,.05222,0,.53222],100:[0,.69444,.10861,0,.59111],101:[0,.44444,.085,0,.53222],102:[.19444,.69444,.21778,0,.4],103:[.19444,.44444,.105,0,.53222],104:[0,.69444,.09426,0,.59111],105:[0,.69326,.11387,0,.35555],106:[.19444,.69326,.1672,0,.35555],107:[0,.69444,.11111,0,.53222],108:[0,.69444,.10861,0,.29666],109:[0,.44444,.09426,0,.94444],110:[0,.44444,.09426,0,.64999],111:[0,.44444,.07861,0,.59111],112:[.19444,.44444,.07861,0,.59111],113:[.19444,.44444,.105,0,.53222],114:[0,.44444,.11111,0,.50167],115:[0,.44444,.08167,0,.48694],116:[0,.63492,.09639,0,.385],117:[0,.44444,.09426,0,.62055],118:[0,.44444,.11111,0,.53222],119:[0,.44444,.11111,0,.76777],120:[0,.44444,.12583,0,.56055],121:[.19444,.44444,.105,0,.56166],122:[0,.44444,.13889,0,.49055],126:[.35,.34444,.11472,0,.59111],160:[0,0,0,0,.25],168:[0,.69444,.11473,0,.59111],176:[0,.69444,0,0,.94888],184:[.17014,0,0,0,.53222],198:[0,.68611,.11431,0,1.02277],216:[.04861,.73472,.09062,0,.88555],223:[.19444,.69444,.09736,0,.665],230:[0,.44444,.085,0,.82666],248:[.09722,.54167,.09458,0,.59111],305:[0,.44444,.09426,0,.35555],338:[0,.68611,.11431,0,1.14054],339:[0,.44444,.085,0,.82666],567:[.19444,.44444,.04611,0,.385],710:[0,.69444,.06709,0,.59111],711:[0,.63194,.08271,0,.59111],713:[0,.59444,.10444,0,.59111],714:[0,.69444,.08528,0,.59111],715:[0,.69444,0,0,.59111],728:[0,.69444,.10333,0,.59111],729:[0,.69444,.12945,0,.35555],730:[0,.69444,0,0,.94888],732:[0,.69444,.11472,0,.59111],733:[0,.69444,.11472,0,.59111],915:[0,.68611,.12903,0,.69777],916:[0,.68611,0,0,.94444],920:[0,.68611,.09062,0,.88555],923:[0,.68611,0,0,.80666],926:[0,.68611,.15092,0,.76777],928:[0,.68611,.17208,0,.8961],931:[0,.68611,.11431,0,.82666],933:[0,.68611,.10778,0,.88555],934:[0,.68611,.05632,0,.82666],936:[0,.68611,.10778,0,.88555],937:[0,.68611,.0992,0,.82666],8211:[0,.44444,.09811,0,.59111],8212:[0,.44444,.09811,0,1.18221],8216:[0,.69444,.12945,0,.35555],8217:[0,.69444,.12945,0,.35555],8220:[0,.69444,.16772,0,.62055],8221:[0,.69444,.07939,0,.62055]},"Main-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.12417,0,.30667],34:[0,.69444,.06961,0,.51444],35:[.19444,.69444,.06616,0,.81777],37:[.05556,.75,.13639,0,.81777],38:[0,.69444,.09694,0,.76666],39:[0,.69444,.12417,0,.30667],40:[.25,.75,.16194,0,.40889],41:[.25,.75,.03694,0,.40889],42:[0,.75,.14917,0,.51111],43:[.05667,.56167,.03694,0,.76666],44:[.19444,.10556,0,0,.30667],45:[0,.43056,.02826,0,.35778],46:[0,.10556,0,0,.30667],47:[.25,.75,.16194,0,.51111],48:[0,.64444,.13556,0,.51111],49:[0,.64444,.13556,0,.51111],50:[0,.64444,.13556,0,.51111],51:[0,.64444,.13556,0,.51111],52:[.19444,.64444,.13556,0,.51111],53:[0,.64444,.13556,0,.51111],54:[0,.64444,.13556,0,.51111],55:[.19444,.64444,.13556,0,.51111],56:[0,.64444,.13556,0,.51111],57:[0,.64444,.13556,0,.51111],58:[0,.43056,.0582,0,.30667],59:[.19444,.43056,.0582,0,.30667],61:[-.13313,.36687,.06616,0,.76666],63:[0,.69444,.1225,0,.51111],64:[0,.69444,.09597,0,.76666],65:[0,.68333,0,0,.74333],66:[0,.68333,.10257,0,.70389],67:[0,.68333,.14528,0,.71555],68:[0,.68333,.09403,0,.755],69:[0,.68333,.12028,0,.67833],70:[0,.68333,.13305,0,.65277],71:[0,.68333,.08722,0,.77361],72:[0,.68333,.16389,0,.74333],73:[0,.68333,.15806,0,.38555],74:[0,.68333,.14028,0,.525],75:[0,.68333,.14528,0,.76888],76:[0,.68333,0,0,.62722],77:[0,.68333,.16389,0,.89666],78:[0,.68333,.16389,0,.74333],79:[0,.68333,.09403,0,.76666],80:[0,.68333,.10257,0,.67833],81:[.19444,.68333,.09403,0,.76666],82:[0,.68333,.03868,0,.72944],83:[0,.68333,.11972,0,.56222],84:[0,.68333,.13305,0,.71555],85:[0,.68333,.16389,0,.74333],86:[0,.68333,.18361,0,.74333],87:[0,.68333,.18361,0,.99888],88:[0,.68333,.15806,0,.74333],89:[0,.68333,.19383,0,.74333],90:[0,.68333,.14528,0,.61333],91:[.25,.75,.1875,0,.30667],93:[.25,.75,.10528,0,.30667],94:[0,.69444,.06646,0,.51111],95:[.31,.12056,.09208,0,.51111],97:[0,.43056,.07671,0,.51111],98:[0,.69444,.06312,0,.46],99:[0,.43056,.05653,0,.46],100:[0,.69444,.10333,0,.51111],101:[0,.43056,.07514,0,.46],102:[.19444,.69444,.21194,0,.30667],103:[.19444,.43056,.08847,0,.46],104:[0,.69444,.07671,0,.51111],105:[0,.65536,.1019,0,.30667],106:[.19444,.65536,.14467,0,.30667],107:[0,.69444,.10764,0,.46],108:[0,.69444,.10333,0,.25555],109:[0,.43056,.07671,0,.81777],110:[0,.43056,.07671,0,.56222],111:[0,.43056,.06312,0,.51111],112:[.19444,.43056,.06312,0,.51111],113:[.19444,.43056,.08847,0,.46],114:[0,.43056,.10764,0,.42166],115:[0,.43056,.08208,0,.40889],116:[0,.61508,.09486,0,.33222],117:[0,.43056,.07671,0,.53666],118:[0,.43056,.10764,0,.46],119:[0,.43056,.10764,0,.66444],120:[0,.43056,.12042,0,.46389],121:[.19444,.43056,.08847,0,.48555],122:[0,.43056,.12292,0,.40889],126:[.35,.31786,.11585,0,.51111],160:[0,0,0,0,.25],168:[0,.66786,.10474,0,.51111],176:[0,.69444,0,0,.83129],184:[.17014,0,0,0,.46],198:[0,.68333,.12028,0,.88277],216:[.04861,.73194,.09403,0,.76666],223:[.19444,.69444,.10514,0,.53666],230:[0,.43056,.07514,0,.71555],248:[.09722,.52778,.09194,0,.51111],338:[0,.68333,.12028,0,.98499],339:[0,.43056,.07514,0,.71555],710:[0,.69444,.06646,0,.51111],711:[0,.62847,.08295,0,.51111],713:[0,.56167,.10333,0,.51111],714:[0,.69444,.09694,0,.51111],715:[0,.69444,0,0,.51111],728:[0,.69444,.10806,0,.51111],729:[0,.66786,.11752,0,.30667],730:[0,.69444,0,0,.83129],732:[0,.66786,.11585,0,.51111],733:[0,.69444,.1225,0,.51111],915:[0,.68333,.13305,0,.62722],916:[0,.68333,0,0,.81777],920:[0,.68333,.09403,0,.76666],923:[0,.68333,0,0,.69222],926:[0,.68333,.15294,0,.66444],928:[0,.68333,.16389,0,.74333],931:[0,.68333,.12028,0,.71555],933:[0,.68333,.11111,0,.76666],934:[0,.68333,.05986,0,.71555],936:[0,.68333,.11111,0,.76666],937:[0,.68333,.10257,0,.71555],8211:[0,.43056,.09208,0,.51111],8212:[0,.43056,.09208,0,1.02222],8216:[0,.69444,.12417,0,.30667],8217:[0,.69444,.12417,0,.30667],8220:[0,.69444,.1685,0,.51444],8221:[0,.69444,.06961,0,.51444],8463:[0,.68889,0,0,.54028]},"Main-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.27778],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.77778],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.19444,.10556,0,0,.27778],45:[0,.43056,0,0,.33333],46:[0,.10556,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.64444,0,0,.5],49:[0,.64444,0,0,.5],50:[0,.64444,0,0,.5],51:[0,.64444,0,0,.5],52:[0,.64444,0,0,.5],53:[0,.64444,0,0,.5],54:[0,.64444,0,0,.5],55:[0,.64444,0,0,.5],56:[0,.64444,0,0,.5],57:[0,.64444,0,0,.5],58:[0,.43056,0,0,.27778],59:[.19444,.43056,0,0,.27778],60:[.0391,.5391,0,0,.77778],61:[-.13313,.36687,0,0,.77778],62:[.0391,.5391,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.77778],65:[0,.68333,0,0,.75],66:[0,.68333,0,0,.70834],67:[0,.68333,0,0,.72222],68:[0,.68333,0,0,.76389],69:[0,.68333,0,0,.68056],70:[0,.68333,0,0,.65278],71:[0,.68333,0,0,.78472],72:[0,.68333,0,0,.75],73:[0,.68333,0,0,.36111],74:[0,.68333,0,0,.51389],75:[0,.68333,0,0,.77778],76:[0,.68333,0,0,.625],77:[0,.68333,0,0,.91667],78:[0,.68333,0,0,.75],79:[0,.68333,0,0,.77778],80:[0,.68333,0,0,.68056],81:[.19444,.68333,0,0,.77778],82:[0,.68333,0,0,.73611],83:[0,.68333,0,0,.55556],84:[0,.68333,0,0,.72222],85:[0,.68333,0,0,.75],86:[0,.68333,.01389,0,.75],87:[0,.68333,.01389,0,1.02778],88:[0,.68333,0,0,.75],89:[0,.68333,.025,0,.75],90:[0,.68333,0,0,.61111],91:[.25,.75,0,0,.27778],92:[.25,.75,0,0,.5],93:[.25,.75,0,0,.27778],94:[0,.69444,0,0,.5],95:[.31,.12056,.02778,0,.5],97:[0,.43056,0,0,.5],98:[0,.69444,0,0,.55556],99:[0,.43056,0,0,.44445],100:[0,.69444,0,0,.55556],101:[0,.43056,0,0,.44445],102:[0,.69444,.07778,0,.30556],103:[.19444,.43056,.01389,0,.5],104:[0,.69444,0,0,.55556],105:[0,.66786,0,0,.27778],106:[.19444,.66786,0,0,.30556],107:[0,.69444,0,0,.52778],108:[0,.69444,0,0,.27778],109:[0,.43056,0,0,.83334],110:[0,.43056,0,0,.55556],111:[0,.43056,0,0,.5],112:[.19444,.43056,0,0,.55556],113:[.19444,.43056,0,0,.52778],114:[0,.43056,0,0,.39167],115:[0,.43056,0,0,.39445],116:[0,.61508,0,0,.38889],117:[0,.43056,0,0,.55556],118:[0,.43056,.01389,0,.52778],119:[0,.43056,.01389,0,.72222],120:[0,.43056,0,0,.52778],121:[.19444,.43056,.01389,0,.52778],122:[0,.43056,0,0,.44445],123:[.25,.75,0,0,.5],124:[.25,.75,0,0,.27778],125:[.25,.75,0,0,.5],126:[.35,.31786,0,0,.5],160:[0,0,0,0,.25],163:[0,.69444,0,0,.76909],167:[.19444,.69444,0,0,.44445],168:[0,.66786,0,0,.5],172:[0,.43056,0,0,.66667],176:[0,.69444,0,0,.75],177:[.08333,.58333,0,0,.77778],182:[.19444,.69444,0,0,.61111],184:[.17014,0,0,0,.44445],198:[0,.68333,0,0,.90278],215:[.08333,.58333,0,0,.77778],216:[.04861,.73194,0,0,.77778],223:[0,.69444,0,0,.5],230:[0,.43056,0,0,.72222],247:[.08333,.58333,0,0,.77778],248:[.09722,.52778,0,0,.5],305:[0,.43056,0,0,.27778],338:[0,.68333,0,0,1.01389],339:[0,.43056,0,0,.77778],567:[.19444,.43056,0,0,.30556],710:[0,.69444,0,0,.5],711:[0,.62847,0,0,.5],713:[0,.56778,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.66786,0,0,.27778],730:[0,.69444,0,0,.75],732:[0,.66786,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.68333,0,0,.625],916:[0,.68333,0,0,.83334],920:[0,.68333,0,0,.77778],923:[0,.68333,0,0,.69445],926:[0,.68333,0,0,.66667],928:[0,.68333,0,0,.75],931:[0,.68333,0,0,.72222],933:[0,.68333,0,0,.77778],934:[0,.68333,0,0,.72222],936:[0,.68333,0,0,.77778],937:[0,.68333,0,0,.72222],8211:[0,.43056,.02778,0,.5],8212:[0,.43056,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5],8224:[.19444,.69444,0,0,.44445],8225:[.19444,.69444,0,0,.44445],8230:[0,.123,0,0,1.172],8242:[0,.55556,0,0,.275],8407:[0,.71444,.15382,0,.5],8463:[0,.68889,0,0,.54028],8465:[0,.69444,0,0,.72222],8467:[0,.69444,0,.11111,.41667],8472:[.19444,.43056,0,.11111,.63646],8476:[0,.69444,0,0,.72222],8501:[0,.69444,0,0,.61111],8592:[-.13313,.36687,0,0,1],8593:[.19444,.69444,0,0,.5],8594:[-.13313,.36687,0,0,1],8595:[.19444,.69444,0,0,.5],8596:[-.13313,.36687,0,0,1],8597:[.25,.75,0,0,.5],8598:[.19444,.69444,0,0,1],8599:[.19444,.69444,0,0,1],8600:[.19444,.69444,0,0,1],8601:[.19444,.69444,0,0,1],8614:[.011,.511,0,0,1],8617:[.011,.511,0,0,1.126],8618:[.011,.511,0,0,1.126],8636:[-.13313,.36687,0,0,1],8637:[-.13313,.36687,0,0,1],8640:[-.13313,.36687,0,0,1],8641:[-.13313,.36687,0,0,1],8652:[.011,.671,0,0,1],8656:[-.13313,.36687,0,0,1],8657:[.19444,.69444,0,0,.61111],8658:[-.13313,.36687,0,0,1],8659:[.19444,.69444,0,0,.61111],8660:[-.13313,.36687,0,0,1],8661:[.25,.75,0,0,.61111],8704:[0,.69444,0,0,.55556],8706:[0,.69444,.05556,.08334,.5309],8707:[0,.69444,0,0,.55556],8709:[.05556,.75,0,0,.5],8711:[0,.68333,0,0,.83334],8712:[.0391,.5391,0,0,.66667],8715:[.0391,.5391,0,0,.66667],8722:[.08333,.58333,0,0,.77778],8723:[.08333,.58333,0,0,.77778],8725:[.25,.75,0,0,.5],8726:[.25,.75,0,0,.5],8727:[-.03472,.46528,0,0,.5],8728:[-.05555,.44445,0,0,.5],8729:[-.05555,.44445,0,0,.5],8730:[.2,.8,0,0,.83334],8733:[0,.43056,0,0,.77778],8734:[0,.43056,0,0,1],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.27778],8741:[.25,.75,0,0,.5],8743:[0,.55556,0,0,.66667],8744:[0,.55556,0,0,.66667],8745:[0,.55556,0,0,.66667],8746:[0,.55556,0,0,.66667],8747:[.19444,.69444,.11111,0,.41667],8764:[-.13313,.36687,0,0,.77778],8768:[.19444,.69444,0,0,.27778],8771:[-.03625,.46375,0,0,.77778],8773:[-.022,.589,0,0,.778],8776:[-.01688,.48312,0,0,.77778],8781:[-.03625,.46375,0,0,.77778],8784:[-.133,.673,0,0,.778],8801:[-.03625,.46375,0,0,.77778],8804:[.13597,.63597,0,0,.77778],8805:[.13597,.63597,0,0,.77778],8810:[.0391,.5391,0,0,1],8811:[.0391,.5391,0,0,1],8826:[.0391,.5391,0,0,.77778],8827:[.0391,.5391,0,0,.77778],8834:[.0391,.5391,0,0,.77778],8835:[.0391,.5391,0,0,.77778],8838:[.13597,.63597,0,0,.77778],8839:[.13597,.63597,0,0,.77778],8846:[0,.55556,0,0,.66667],8849:[.13597,.63597,0,0,.77778],8850:[.13597,.63597,0,0,.77778],8851:[0,.55556,0,0,.66667],8852:[0,.55556,0,0,.66667],8853:[.08333,.58333,0,0,.77778],8854:[.08333,.58333,0,0,.77778],8855:[.08333,.58333,0,0,.77778],8856:[.08333,.58333,0,0,.77778],8857:[.08333,.58333,0,0,.77778],8866:[0,.69444,0,0,.61111],8867:[0,.69444,0,0,.61111],8868:[0,.69444,0,0,.77778],8869:[0,.69444,0,0,.77778],8872:[.249,.75,0,0,.867],8900:[-.05555,.44445,0,0,.5],8901:[-.05555,.44445,0,0,.27778],8902:[-.03472,.46528,0,0,.5],8904:[.005,.505,0,0,.9],8942:[.03,.903,0,0,.278],8943:[-.19,.313,0,0,1.172],8945:[-.1,.823,0,0,1.282],8968:[.25,.75,0,0,.44445],8969:[.25,.75,0,0,.44445],8970:[.25,.75,0,0,.44445],8971:[.25,.75,0,0,.44445],8994:[-.14236,.35764,0,0,1],8995:[-.14236,.35764,0,0,1],9136:[.244,.744,0,0,.412],9137:[.244,.745,0,0,.412],9651:[.19444,.69444,0,0,.88889],9657:[-.03472,.46528,0,0,.5],9661:[.19444,.69444,0,0,.88889],9667:[-.03472,.46528,0,0,.5],9711:[.19444,.69444,0,0,1],9824:[.12963,.69444,0,0,.77778],9825:[.12963,.69444,0,0,.77778],9826:[.12963,.69444,0,0,.77778],9827:[.12963,.69444,0,0,.77778],9837:[0,.75,0,0,.38889],9838:[.19444,.69444,0,0,.38889],9839:[.19444,.69444,0,0,.38889],10216:[.25,.75,0,0,.38889],10217:[.25,.75,0,0,.38889],10222:[.244,.744,0,0,.412],10223:[.244,.745,0,0,.412],10229:[.011,.511,0,0,1.609],10230:[.011,.511,0,0,1.638],10231:[.011,.511,0,0,1.859],10232:[.024,.525,0,0,1.609],10233:[.024,.525,0,0,1.638],10234:[.024,.525,0,0,1.858],10236:[.011,.511,0,0,1.638],10815:[0,.68333,0,0,.75],10927:[.13597,.63597,0,0,.77778],10928:[.13597,.63597,0,0,.77778],57376:[.19444,.69444,0,0,0]},"Math-BoldItalic":{32:[0,0,0,0,.25],48:[0,.44444,0,0,.575],49:[0,.44444,0,0,.575],50:[0,.44444,0,0,.575],51:[.19444,.44444,0,0,.575],52:[.19444,.44444,0,0,.575],53:[.19444,.44444,0,0,.575],54:[0,.64444,0,0,.575],55:[.19444,.44444,0,0,.575],56:[0,.64444,0,0,.575],57:[.19444,.44444,0,0,.575],65:[0,.68611,0,0,.86944],66:[0,.68611,.04835,0,.8664],67:[0,.68611,.06979,0,.81694],68:[0,.68611,.03194,0,.93812],69:[0,.68611,.05451,0,.81007],70:[0,.68611,.15972,0,.68889],71:[0,.68611,0,0,.88673],72:[0,.68611,.08229,0,.98229],73:[0,.68611,.07778,0,.51111],74:[0,.68611,.10069,0,.63125],75:[0,.68611,.06979,0,.97118],76:[0,.68611,0,0,.75555],77:[0,.68611,.11424,0,1.14201],78:[0,.68611,.11424,0,.95034],79:[0,.68611,.03194,0,.83666],80:[0,.68611,.15972,0,.72309],81:[.19444,.68611,0,0,.86861],82:[0,.68611,.00421,0,.87235],83:[0,.68611,.05382,0,.69271],84:[0,.68611,.15972,0,.63663],85:[0,.68611,.11424,0,.80027],86:[0,.68611,.25555,0,.67778],87:[0,.68611,.15972,0,1.09305],88:[0,.68611,.07778,0,.94722],89:[0,.68611,.25555,0,.67458],90:[0,.68611,.06979,0,.77257],97:[0,.44444,0,0,.63287],98:[0,.69444,0,0,.52083],99:[0,.44444,0,0,.51342],100:[0,.69444,0,0,.60972],101:[0,.44444,0,0,.55361],102:[.19444,.69444,.11042,0,.56806],103:[.19444,.44444,.03704,0,.5449],104:[0,.69444,0,0,.66759],105:[0,.69326,0,0,.4048],106:[.19444,.69326,.0622,0,.47083],107:[0,.69444,.01852,0,.6037],108:[0,.69444,.0088,0,.34815],109:[0,.44444,0,0,1.0324],110:[0,.44444,0,0,.71296],111:[0,.44444,0,0,.58472],112:[.19444,.44444,0,0,.60092],113:[.19444,.44444,.03704,0,.54213],114:[0,.44444,.03194,0,.5287],115:[0,.44444,0,0,.53125],116:[0,.63492,0,0,.41528],117:[0,.44444,0,0,.68102],118:[0,.44444,.03704,0,.56666],119:[0,.44444,.02778,0,.83148],120:[0,.44444,0,0,.65903],121:[.19444,.44444,.03704,0,.59028],122:[0,.44444,.04213,0,.55509],160:[0,0,0,0,.25],915:[0,.68611,.15972,0,.65694],916:[0,.68611,0,0,.95833],920:[0,.68611,.03194,0,.86722],923:[0,.68611,0,0,.80555],926:[0,.68611,.07458,0,.84125],928:[0,.68611,.08229,0,.98229],931:[0,.68611,.05451,0,.88507],933:[0,.68611,.15972,0,.67083],934:[0,.68611,0,0,.76666],936:[0,.68611,.11653,0,.71402],937:[0,.68611,.04835,0,.8789],945:[0,.44444,0,0,.76064],946:[.19444,.69444,.03403,0,.65972],947:[.19444,.44444,.06389,0,.59003],948:[0,.69444,.03819,0,.52222],949:[0,.44444,0,0,.52882],950:[.19444,.69444,.06215,0,.50833],951:[.19444,.44444,.03704,0,.6],952:[0,.69444,.03194,0,.5618],953:[0,.44444,0,0,.41204],954:[0,.44444,0,0,.66759],955:[0,.69444,0,0,.67083],956:[.19444,.44444,0,0,.70787],957:[0,.44444,.06898,0,.57685],958:[.19444,.69444,.03021,0,.50833],959:[0,.44444,0,0,.58472],960:[0,.44444,.03704,0,.68241],961:[.19444,.44444,0,0,.6118],962:[.09722,.44444,.07917,0,.42361],963:[0,.44444,.03704,0,.68588],964:[0,.44444,.13472,0,.52083],965:[0,.44444,.03704,0,.63055],966:[.19444,.44444,0,0,.74722],967:[.19444,.44444,0,0,.71805],968:[.19444,.69444,.03704,0,.75833],969:[0,.44444,.03704,0,.71782],977:[0,.69444,0,0,.69155],981:[.19444,.69444,0,0,.7125],982:[0,.44444,.03194,0,.975],1009:[.19444,.44444,0,0,.6118],1013:[0,.44444,0,0,.48333],57649:[0,.44444,0,0,.39352],57911:[.19444,.44444,0,0,.43889]},"Math-Italic":{32:[0,0,0,0,.25],48:[0,.43056,0,0,.5],49:[0,.43056,0,0,.5],50:[0,.43056,0,0,.5],51:[.19444,.43056,0,0,.5],52:[.19444,.43056,0,0,.5],53:[.19444,.43056,0,0,.5],54:[0,.64444,0,0,.5],55:[.19444,.43056,0,0,.5],56:[0,.64444,0,0,.5],57:[.19444,.43056,0,0,.5],65:[0,.68333,0,.13889,.75],66:[0,.68333,.05017,.08334,.75851],67:[0,.68333,.07153,.08334,.71472],68:[0,.68333,.02778,.05556,.82792],69:[0,.68333,.05764,.08334,.7382],70:[0,.68333,.13889,.08334,.64306],71:[0,.68333,0,.08334,.78625],72:[0,.68333,.08125,.05556,.83125],73:[0,.68333,.07847,.11111,.43958],74:[0,.68333,.09618,.16667,.55451],75:[0,.68333,.07153,.05556,.84931],76:[0,.68333,0,.02778,.68056],77:[0,.68333,.10903,.08334,.97014],78:[0,.68333,.10903,.08334,.80347],79:[0,.68333,.02778,.08334,.76278],80:[0,.68333,.13889,.08334,.64201],81:[.19444,.68333,0,.08334,.79056],82:[0,.68333,.00773,.08334,.75929],83:[0,.68333,.05764,.08334,.6132],84:[0,.68333,.13889,.08334,.58438],85:[0,.68333,.10903,.02778,.68278],86:[0,.68333,.22222,0,.58333],87:[0,.68333,.13889,0,.94445],88:[0,.68333,.07847,.08334,.82847],89:[0,.68333,.22222,0,.58056],90:[0,.68333,.07153,.08334,.68264],97:[0,.43056,0,0,.52859],98:[0,.69444,0,0,.42917],99:[0,.43056,0,.05556,.43276],100:[0,.69444,0,.16667,.52049],101:[0,.43056,0,.05556,.46563],102:[.19444,.69444,.10764,.16667,.48959],103:[.19444,.43056,.03588,.02778,.47697],104:[0,.69444,0,0,.57616],105:[0,.65952,0,0,.34451],106:[.19444,.65952,.05724,0,.41181],107:[0,.69444,.03148,0,.5206],108:[0,.69444,.01968,.08334,.29838],109:[0,.43056,0,0,.87801],110:[0,.43056,0,0,.60023],111:[0,.43056,0,.05556,.48472],112:[.19444,.43056,0,.08334,.50313],113:[.19444,.43056,.03588,.08334,.44641],114:[0,.43056,.02778,.05556,.45116],115:[0,.43056,0,.05556,.46875],116:[0,.61508,0,.08334,.36111],117:[0,.43056,0,.02778,.57246],118:[0,.43056,.03588,.02778,.48472],119:[0,.43056,.02691,.08334,.71592],120:[0,.43056,0,.02778,.57153],121:[.19444,.43056,.03588,.05556,.49028],122:[0,.43056,.04398,.05556,.46505],160:[0,0,0,0,.25],915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:[0,.68333,.02778,.08334,.76278],923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:[0,.68333,.08125,.05556,.83125],931:[0,.68333,.05764,.08334,.77986],933:[0,.68333,.13889,.05556,.58333],934:[0,.68333,0,.08334,.66667],936:[0,.68333,.11,.05556,.61222],937:[0,.68333,.05017,.08334,.7724],945:[0,.43056,.0037,.02778,.6397],946:[.19444,.69444,.05278,.08334,.56563],947:[.19444,.43056,.05556,0,.51773],948:[0,.69444,.03785,.05556,.44444],949:[0,.43056,0,.08334,.46632],950:[.19444,.69444,.07378,.08334,.4375],951:[.19444,.43056,.03588,.05556,.49653],952:[0,.69444,.02778,.08334,.46944],953:[0,.43056,0,.05556,.35394],954:[0,.43056,0,0,.57616],955:[0,.69444,0,0,.58334],956:[.19444,.43056,0,.02778,.60255],957:[0,.43056,.06366,.02778,.49398],958:[.19444,.69444,.04601,.11111,.4375],959:[0,.43056,0,.05556,.48472],960:[0,.43056,.03588,0,.57003],961:[.19444,.43056,0,.08334,.51702],962:[.09722,.43056,.07986,.08334,.36285],963:[0,.43056,.03588,0,.57141],964:[0,.43056,.1132,.02778,.43715],965:[0,.43056,.03588,.02778,.54028],966:[.19444,.43056,0,.08334,.65417],967:[.19444,.43056,0,.05556,.62569],968:[.19444,.69444,.03588,.11111,.65139],969:[0,.43056,.03588,0,.62245],977:[0,.69444,0,.08334,.59144],981:[.19444,.69444,0,.08334,.59583],982:[0,.43056,.02778,0,.82813],1009:[.19444,.43056,0,.08334,.51702],1013:[0,.43056,0,.05556,.4059],57649:[0,.43056,0,.02778,.32246],57911:[.19444,.43056,0,.08334,.38403]},"SansSerif-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.36667],34:[0,.69444,0,0,.55834],35:[.19444,.69444,0,0,.91667],36:[.05556,.75,0,0,.55],37:[.05556,.75,0,0,1.02912],38:[0,.69444,0,0,.83056],39:[0,.69444,0,0,.30556],40:[.25,.75,0,0,.42778],41:[.25,.75,0,0,.42778],42:[0,.75,0,0,.55],43:[.11667,.61667,0,0,.85556],44:[.10556,.13056,0,0,.30556],45:[0,.45833,0,0,.36667],46:[0,.13056,0,0,.30556],47:[.25,.75,0,0,.55],48:[0,.69444,0,0,.55],49:[0,.69444,0,0,.55],50:[0,.69444,0,0,.55],51:[0,.69444,0,0,.55],52:[0,.69444,0,0,.55],53:[0,.69444,0,0,.55],54:[0,.69444,0,0,.55],55:[0,.69444,0,0,.55],56:[0,.69444,0,0,.55],57:[0,.69444,0,0,.55],58:[0,.45833,0,0,.30556],59:[.10556,.45833,0,0,.30556],61:[-.09375,.40625,0,0,.85556],63:[0,.69444,0,0,.51945],64:[0,.69444,0,0,.73334],65:[0,.69444,0,0,.73334],66:[0,.69444,0,0,.73334],67:[0,.69444,0,0,.70278],68:[0,.69444,0,0,.79445],69:[0,.69444,0,0,.64167],70:[0,.69444,0,0,.61111],71:[0,.69444,0,0,.73334],72:[0,.69444,0,0,.79445],73:[0,.69444,0,0,.33056],74:[0,.69444,0,0,.51945],75:[0,.69444,0,0,.76389],76:[0,.69444,0,0,.58056],77:[0,.69444,0,0,.97778],78:[0,.69444,0,0,.79445],79:[0,.69444,0,0,.79445],80:[0,.69444,0,0,.70278],81:[.10556,.69444,0,0,.79445],82:[0,.69444,0,0,.70278],83:[0,.69444,0,0,.61111],84:[0,.69444,0,0,.73334],85:[0,.69444,0,0,.76389],86:[0,.69444,.01528,0,.73334],87:[0,.69444,.01528,0,1.03889],88:[0,.69444,0,0,.73334],89:[0,.69444,.0275,0,.73334],90:[0,.69444,0,0,.67223],91:[.25,.75,0,0,.34306],93:[.25,.75,0,0,.34306],94:[0,.69444,0,0,.55],95:[.35,.10833,.03056,0,.55],97:[0,.45833,0,0,.525],98:[0,.69444,0,0,.56111],99:[0,.45833,0,0,.48889],100:[0,.69444,0,0,.56111],101:[0,.45833,0,0,.51111],102:[0,.69444,.07639,0,.33611],103:[.19444,.45833,.01528,0,.55],104:[0,.69444,0,0,.56111],105:[0,.69444,0,0,.25556],106:[.19444,.69444,0,0,.28611],107:[0,.69444,0,0,.53056],108:[0,.69444,0,0,.25556],109:[0,.45833,0,0,.86667],110:[0,.45833,0,0,.56111],111:[0,.45833,0,0,.55],112:[.19444,.45833,0,0,.56111],113:[.19444,.45833,0,0,.56111],114:[0,.45833,.01528,0,.37222],115:[0,.45833,0,0,.42167],116:[0,.58929,0,0,.40417],117:[0,.45833,0,0,.56111],118:[0,.45833,.01528,0,.5],119:[0,.45833,.01528,0,.74445],120:[0,.45833,0,0,.5],121:[.19444,.45833,.01528,0,.5],122:[0,.45833,0,0,.47639],126:[.35,.34444,0,0,.55],160:[0,0,0,0,.25],168:[0,.69444,0,0,.55],176:[0,.69444,0,0,.73334],180:[0,.69444,0,0,.55],184:[.17014,0,0,0,.48889],305:[0,.45833,0,0,.25556],567:[.19444,.45833,0,0,.28611],710:[0,.69444,0,0,.55],711:[0,.63542,0,0,.55],713:[0,.63778,0,0,.55],728:[0,.69444,0,0,.55],729:[0,.69444,0,0,.30556],730:[0,.69444,0,0,.73334],732:[0,.69444,0,0,.55],733:[0,.69444,0,0,.55],915:[0,.69444,0,0,.58056],916:[0,.69444,0,0,.91667],920:[0,.69444,0,0,.85556],923:[0,.69444,0,0,.67223],926:[0,.69444,0,0,.73334],928:[0,.69444,0,0,.79445],931:[0,.69444,0,0,.79445],933:[0,.69444,0,0,.85556],934:[0,.69444,0,0,.79445],936:[0,.69444,0,0,.85556],937:[0,.69444,0,0,.79445],8211:[0,.45833,.03056,0,.55],8212:[0,.45833,.03056,0,1.10001],8216:[0,.69444,0,0,.30556],8217:[0,.69444,0,0,.30556],8220:[0,.69444,0,0,.55834],8221:[0,.69444,0,0,.55834]},"SansSerif-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.05733,0,.31945],34:[0,.69444,.00316,0,.5],35:[.19444,.69444,.05087,0,.83334],36:[.05556,.75,.11156,0,.5],37:[.05556,.75,.03126,0,.83334],38:[0,.69444,.03058,0,.75834],39:[0,.69444,.07816,0,.27778],40:[.25,.75,.13164,0,.38889],41:[.25,.75,.02536,0,.38889],42:[0,.75,.11775,0,.5],43:[.08333,.58333,.02536,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,.01946,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,.13164,0,.5],48:[0,.65556,.11156,0,.5],49:[0,.65556,.11156,0,.5],50:[0,.65556,.11156,0,.5],51:[0,.65556,.11156,0,.5],52:[0,.65556,.11156,0,.5],53:[0,.65556,.11156,0,.5],54:[0,.65556,.11156,0,.5],55:[0,.65556,.11156,0,.5],56:[0,.65556,.11156,0,.5],57:[0,.65556,.11156,0,.5],58:[0,.44444,.02502,0,.27778],59:[.125,.44444,.02502,0,.27778],61:[-.13,.37,.05087,0,.77778],63:[0,.69444,.11809,0,.47222],64:[0,.69444,.07555,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,.08293,0,.66667],67:[0,.69444,.11983,0,.63889],68:[0,.69444,.07555,0,.72223],69:[0,.69444,.11983,0,.59722],70:[0,.69444,.13372,0,.56945],71:[0,.69444,.11983,0,.66667],72:[0,.69444,.08094,0,.70834],73:[0,.69444,.13372,0,.27778],74:[0,.69444,.08094,0,.47222],75:[0,.69444,.11983,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,.08094,0,.875],78:[0,.69444,.08094,0,.70834],79:[0,.69444,.07555,0,.73611],80:[0,.69444,.08293,0,.63889],81:[.125,.69444,.07555,0,.73611],82:[0,.69444,.08293,0,.64584],83:[0,.69444,.09205,0,.55556],84:[0,.69444,.13372,0,.68056],85:[0,.69444,.08094,0,.6875],86:[0,.69444,.1615,0,.66667],87:[0,.69444,.1615,0,.94445],88:[0,.69444,.13372,0,.66667],89:[0,.69444,.17261,0,.66667],90:[0,.69444,.11983,0,.61111],91:[.25,.75,.15942,0,.28889],93:[.25,.75,.08719,0,.28889],94:[0,.69444,.0799,0,.5],95:[.35,.09444,.08616,0,.5],97:[0,.44444,.00981,0,.48056],98:[0,.69444,.03057,0,.51667],99:[0,.44444,.08336,0,.44445],100:[0,.69444,.09483,0,.51667],101:[0,.44444,.06778,0,.44445],102:[0,.69444,.21705,0,.30556],103:[.19444,.44444,.10836,0,.5],104:[0,.69444,.01778,0,.51667],105:[0,.67937,.09718,0,.23889],106:[.19444,.67937,.09162,0,.26667],107:[0,.69444,.08336,0,.48889],108:[0,.69444,.09483,0,.23889],109:[0,.44444,.01778,0,.79445],110:[0,.44444,.01778,0,.51667],111:[0,.44444,.06613,0,.5],112:[.19444,.44444,.0389,0,.51667],113:[.19444,.44444,.04169,0,.51667],114:[0,.44444,.10836,0,.34167],115:[0,.44444,.0778,0,.38333],116:[0,.57143,.07225,0,.36111],117:[0,.44444,.04169,0,.51667],118:[0,.44444,.10836,0,.46111],119:[0,.44444,.10836,0,.68334],120:[0,.44444,.09169,0,.46111],121:[.19444,.44444,.10836,0,.46111],122:[0,.44444,.08752,0,.43472],126:[.35,.32659,.08826,0,.5],160:[0,0,0,0,.25],168:[0,.67937,.06385,0,.5],176:[0,.69444,0,0,.73752],184:[.17014,0,0,0,.44445],305:[0,.44444,.04169,0,.23889],567:[.19444,.44444,.04169,0,.26667],710:[0,.69444,.0799,0,.5],711:[0,.63194,.08432,0,.5],713:[0,.60889,.08776,0,.5],714:[0,.69444,.09205,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,.09483,0,.5],729:[0,.67937,.07774,0,.27778],730:[0,.69444,0,0,.73752],732:[0,.67659,.08826,0,.5],733:[0,.69444,.09205,0,.5],915:[0,.69444,.13372,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,.07555,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,.12816,0,.66667],928:[0,.69444,.08094,0,.70834],931:[0,.69444,.11983,0,.72222],933:[0,.69444,.09031,0,.77778],934:[0,.69444,.04603,0,.72222],936:[0,.69444,.09031,0,.77778],937:[0,.69444,.08293,0,.72222],8211:[0,.44444,.08616,0,.5],8212:[0,.44444,.08616,0,1],8216:[0,.69444,.07816,0,.27778],8217:[0,.69444,.07816,0,.27778],8220:[0,.69444,.14205,0,.5],8221:[0,.69444,.00316,0,.5]},"SansSerif-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.31945],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.75834],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,0,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.65556,0,0,.5],49:[0,.65556,0,0,.5],50:[0,.65556,0,0,.5],51:[0,.65556,0,0,.5],52:[0,.65556,0,0,.5],53:[0,.65556,0,0,.5],54:[0,.65556,0,0,.5],55:[0,.65556,0,0,.5],56:[0,.65556,0,0,.5],57:[0,.65556,0,0,.5],58:[0,.44444,0,0,.27778],59:[.125,.44444,0,0,.27778],61:[-.13,.37,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,0,0,.66667],67:[0,.69444,0,0,.63889],68:[0,.69444,0,0,.72223],69:[0,.69444,0,0,.59722],70:[0,.69444,0,0,.56945],71:[0,.69444,0,0,.66667],72:[0,.69444,0,0,.70834],73:[0,.69444,0,0,.27778],74:[0,.69444,0,0,.47222],75:[0,.69444,0,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,0,0,.875],78:[0,.69444,0,0,.70834],79:[0,.69444,0,0,.73611],80:[0,.69444,0,0,.63889],81:[.125,.69444,0,0,.73611],82:[0,.69444,0,0,.64584],83:[0,.69444,0,0,.55556],84:[0,.69444,0,0,.68056],85:[0,.69444,0,0,.6875],86:[0,.69444,.01389,0,.66667],87:[0,.69444,.01389,0,.94445],88:[0,.69444,0,0,.66667],89:[0,.69444,.025,0,.66667],90:[0,.69444,0,0,.61111],91:[.25,.75,0,0,.28889],93:[.25,.75,0,0,.28889],94:[0,.69444,0,0,.5],95:[.35,.09444,.02778,0,.5],97:[0,.44444,0,0,.48056],98:[0,.69444,0,0,.51667],99:[0,.44444,0,0,.44445],100:[0,.69444,0,0,.51667],101:[0,.44444,0,0,.44445],102:[0,.69444,.06944,0,.30556],103:[.19444,.44444,.01389,0,.5],104:[0,.69444,0,0,.51667],105:[0,.67937,0,0,.23889],106:[.19444,.67937,0,0,.26667],107:[0,.69444,0,0,.48889],108:[0,.69444,0,0,.23889],109:[0,.44444,0,0,.79445],110:[0,.44444,0,0,.51667],111:[0,.44444,0,0,.5],112:[.19444,.44444,0,0,.51667],113:[.19444,.44444,0,0,.51667],114:[0,.44444,.01389,0,.34167],115:[0,.44444,0,0,.38333],116:[0,.57143,0,0,.36111],117:[0,.44444,0,0,.51667],118:[0,.44444,.01389,0,.46111],119:[0,.44444,.01389,0,.68334],120:[0,.44444,0,0,.46111],121:[.19444,.44444,.01389,0,.46111],122:[0,.44444,0,0,.43472],126:[.35,.32659,0,0,.5],160:[0,0,0,0,.25],168:[0,.67937,0,0,.5],176:[0,.69444,0,0,.66667],184:[.17014,0,0,0,.44445],305:[0,.44444,0,0,.23889],567:[.19444,.44444,0,0,.26667],710:[0,.69444,0,0,.5],711:[0,.63194,0,0,.5],713:[0,.60889,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.67937,0,0,.27778],730:[0,.69444,0,0,.66667],732:[0,.67659,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.69444,0,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,0,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,0,0,.66667],928:[0,.69444,0,0,.70834],931:[0,.69444,0,0,.72222],933:[0,.69444,0,0,.77778],934:[0,.69444,0,0,.72222],936:[0,.69444,0,0,.77778],937:[0,.69444,0,0,.72222],8211:[0,.44444,.02778,0,.5],8212:[0,.44444,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5]},"Script-Regular":{32:[0,0,0,0,.25],65:[0,.7,.22925,0,.80253],66:[0,.7,.04087,0,.90757],67:[0,.7,.1689,0,.66619],68:[0,.7,.09371,0,.77443],69:[0,.7,.18583,0,.56162],70:[0,.7,.13634,0,.89544],71:[0,.7,.17322,0,.60961],72:[0,.7,.29694,0,.96919],73:[0,.7,.19189,0,.80907],74:[.27778,.7,.19189,0,1.05159],75:[0,.7,.31259,0,.91364],76:[0,.7,.19189,0,.87373],77:[0,.7,.15981,0,1.08031],78:[0,.7,.3525,0,.9015],79:[0,.7,.08078,0,.73787],80:[0,.7,.08078,0,1.01262],81:[0,.7,.03305,0,.88282],82:[0,.7,.06259,0,.85],83:[0,.7,.19189,0,.86767],84:[0,.7,.29087,0,.74697],85:[0,.7,.25815,0,.79996],86:[0,.7,.27523,0,.62204],87:[0,.7,.27523,0,.80532],88:[0,.7,.26006,0,.94445],89:[0,.7,.2939,0,.70961],90:[0,.7,.24037,0,.8212],160:[0,0,0,0,.25]},"Size1-Regular":{32:[0,0,0,0,.25],40:[.35001,.85,0,0,.45834],41:[.35001,.85,0,0,.45834],47:[.35001,.85,0,0,.57778],91:[.35001,.85,0,0,.41667],92:[.35001,.85,0,0,.57778],93:[.35001,.85,0,0,.41667],123:[.35001,.85,0,0,.58334],125:[.35001,.85,0,0,.58334],160:[0,0,0,0,.25],710:[0,.72222,0,0,.55556],732:[0,.72222,0,0,.55556],770:[0,.72222,0,0,.55556],771:[0,.72222,0,0,.55556],8214:[-99e-5,.601,0,0,.77778],8593:[1e-5,.6,0,0,.66667],8595:[1e-5,.6,0,0,.66667],8657:[1e-5,.6,0,0,.77778],8659:[1e-5,.6,0,0,.77778],8719:[.25001,.75,0,0,.94445],8720:[.25001,.75,0,0,.94445],8721:[.25001,.75,0,0,1.05556],8730:[.35001,.85,0,0,1],8739:[-.00599,.606,0,0,.33333],8741:[-.00599,.606,0,0,.55556],8747:[.30612,.805,.19445,0,.47222],8748:[.306,.805,.19445,0,.47222],8749:[.306,.805,.19445,0,.47222],8750:[.30612,.805,.19445,0,.47222],8896:[.25001,.75,0,0,.83334],8897:[.25001,.75,0,0,.83334],8898:[.25001,.75,0,0,.83334],8899:[.25001,.75,0,0,.83334],8968:[.35001,.85,0,0,.47222],8969:[.35001,.85,0,0,.47222],8970:[.35001,.85,0,0,.47222],8971:[.35001,.85,0,0,.47222],9168:[-99e-5,.601,0,0,.66667],10216:[.35001,.85,0,0,.47222],10217:[.35001,.85,0,0,.47222],10752:[.25001,.75,0,0,1.11111],10753:[.25001,.75,0,0,1.11111],10754:[.25001,.75,0,0,1.11111],10756:[.25001,.75,0,0,.83334],10758:[.25001,.75,0,0,.83334]},"Size2-Regular":{32:[0,0,0,0,.25],40:[.65002,1.15,0,0,.59722],41:[.65002,1.15,0,0,.59722],47:[.65002,1.15,0,0,.81111],91:[.65002,1.15,0,0,.47222],92:[.65002,1.15,0,0,.81111],93:[.65002,1.15,0,0,.47222],123:[.65002,1.15,0,0,.66667],125:[.65002,1.15,0,0,.66667],160:[0,0,0,0,.25],710:[0,.75,0,0,1],732:[0,.75,0,0,1],770:[0,.75,0,0,1],771:[0,.75,0,0,1],8719:[.55001,1.05,0,0,1.27778],8720:[.55001,1.05,0,0,1.27778],8721:[.55001,1.05,0,0,1.44445],8730:[.65002,1.15,0,0,1],8747:[.86225,1.36,.44445,0,.55556],8748:[.862,1.36,.44445,0,.55556],8749:[.862,1.36,.44445,0,.55556],8750:[.86225,1.36,.44445,0,.55556],8896:[.55001,1.05,0,0,1.11111],8897:[.55001,1.05,0,0,1.11111],8898:[.55001,1.05,0,0,1.11111],8899:[.55001,1.05,0,0,1.11111],8968:[.65002,1.15,0,0,.52778],8969:[.65002,1.15,0,0,.52778],8970:[.65002,1.15,0,0,.52778],8971:[.65002,1.15,0,0,.52778],10216:[.65002,1.15,0,0,.61111],10217:[.65002,1.15,0,0,.61111],10752:[.55001,1.05,0,0,1.51112],10753:[.55001,1.05,0,0,1.51112],10754:[.55001,1.05,0,0,1.51112],10756:[.55001,1.05,0,0,1.11111],10758:[.55001,1.05,0,0,1.11111]},"Size3-Regular":{32:[0,0,0,0,.25],40:[.95003,1.45,0,0,.73611],41:[.95003,1.45,0,0,.73611],47:[.95003,1.45,0,0,1.04445],91:[.95003,1.45,0,0,.52778],92:[.95003,1.45,0,0,1.04445],93:[.95003,1.45,0,0,.52778],123:[.95003,1.45,0,0,.75],125:[.95003,1.45,0,0,.75],160:[0,0,0,0,.25],710:[0,.75,0,0,1.44445],732:[0,.75,0,0,1.44445],770:[0,.75,0,0,1.44445],771:[0,.75,0,0,1.44445],8730:[.95003,1.45,0,0,1],8968:[.95003,1.45,0,0,.58334],8969:[.95003,1.45,0,0,.58334],8970:[.95003,1.45,0,0,.58334],8971:[.95003,1.45,0,0,.58334],10216:[.95003,1.45,0,0,.75],10217:[.95003,1.45,0,0,.75]},"Size4-Regular":{32:[0,0,0,0,.25],40:[1.25003,1.75,0,0,.79167],41:[1.25003,1.75,0,0,.79167],47:[1.25003,1.75,0,0,1.27778],91:[1.25003,1.75,0,0,.58334],92:[1.25003,1.75,0,0,1.27778],93:[1.25003,1.75,0,0,.58334],123:[1.25003,1.75,0,0,.80556],125:[1.25003,1.75,0,0,.80556],160:[0,0,0,0,.25],710:[0,.825,0,0,1.8889],732:[0,.825,0,0,1.8889],770:[0,.825,0,0,1.8889],771:[0,.825,0,0,1.8889],8730:[1.25003,1.75,0,0,1],8968:[1.25003,1.75,0,0,.63889],8969:[1.25003,1.75,0,0,.63889],8970:[1.25003,1.75,0,0,.63889],8971:[1.25003,1.75,0,0,.63889],9115:[.64502,1.155,0,0,.875],9116:[1e-5,.6,0,0,.875],9117:[.64502,1.155,0,0,.875],9118:[.64502,1.155,0,0,.875],9119:[1e-5,.6,0,0,.875],9120:[.64502,1.155,0,0,.875],9121:[.64502,1.155,0,0,.66667],9122:[-99e-5,.601,0,0,.66667],9123:[.64502,1.155,0,0,.66667],9124:[.64502,1.155,0,0,.66667],9125:[-99e-5,.601,0,0,.66667],9126:[.64502,1.155,0,0,.66667],9127:[1e-5,.9,0,0,.88889],9128:[.65002,1.15,0,0,.88889],9129:[.90001,0,0,0,.88889],9130:[0,.3,0,0,.88889],9131:[1e-5,.9,0,0,.88889],9132:[.65002,1.15,0,0,.88889],9133:[.90001,0,0,0,.88889],9143:[.88502,.915,0,0,1.05556],10216:[1.25003,1.75,0,0,.80556],10217:[1.25003,1.75,0,0,.80556],57344:[-.00499,.605,0,0,1.05556],57345:[-.00499,.605,0,0,1.05556],57680:[0,.12,0,0,.45],57681:[0,.12,0,0,.45],57682:[0,.12,0,0,.45],57683:[0,.12,0,0,.45]},"Typewriter-Regular":{32:[0,0,0,0,.525],33:[0,.61111,0,0,.525],34:[0,.61111,0,0,.525],35:[0,.61111,0,0,.525],36:[.08333,.69444,0,0,.525],37:[.08333,.69444,0,0,.525],38:[0,.61111,0,0,.525],39:[0,.61111,0,0,.525],40:[.08333,.69444,0,0,.525],41:[.08333,.69444,0,0,.525],42:[0,.52083,0,0,.525],43:[-.08056,.53055,0,0,.525],44:[.13889,.125,0,0,.525],45:[-.08056,.53055,0,0,.525],46:[0,.125,0,0,.525],47:[.08333,.69444,0,0,.525],48:[0,.61111,0,0,.525],49:[0,.61111,0,0,.525],50:[0,.61111,0,0,.525],51:[0,.61111,0,0,.525],52:[0,.61111,0,0,.525],53:[0,.61111,0,0,.525],54:[0,.61111,0,0,.525],55:[0,.61111,0,0,.525],56:[0,.61111,0,0,.525],57:[0,.61111,0,0,.525],58:[0,.43056,0,0,.525],59:[.13889,.43056,0,0,.525],60:[-.05556,.55556,0,0,.525],61:[-.19549,.41562,0,0,.525],62:[-.05556,.55556,0,0,.525],63:[0,.61111,0,0,.525],64:[0,.61111,0,0,.525],65:[0,.61111,0,0,.525],66:[0,.61111,0,0,.525],67:[0,.61111,0,0,.525],68:[0,.61111,0,0,.525],69:[0,.61111,0,0,.525],70:[0,.61111,0,0,.525],71:[0,.61111,0,0,.525],72:[0,.61111,0,0,.525],73:[0,.61111,0,0,.525],74:[0,.61111,0,0,.525],75:[0,.61111,0,0,.525],76:[0,.61111,0,0,.525],77:[0,.61111,0,0,.525],78:[0,.61111,0,0,.525],79:[0,.61111,0,0,.525],80:[0,.61111,0,0,.525],81:[.13889,.61111,0,0,.525],82:[0,.61111,0,0,.525],83:[0,.61111,0,0,.525],84:[0,.61111,0,0,.525],85:[0,.61111,0,0,.525],86:[0,.61111,0,0,.525],87:[0,.61111,0,0,.525],88:[0,.61111,0,0,.525],89:[0,.61111,0,0,.525],90:[0,.61111,0,0,.525],91:[.08333,.69444,0,0,.525],92:[.08333,.69444,0,0,.525],93:[.08333,.69444,0,0,.525],94:[0,.61111,0,0,.525],95:[.09514,0,0,0,.525],96:[0,.61111,0,0,.525],97:[0,.43056,0,0,.525],98:[0,.61111,0,0,.525],99:[0,.43056,0,0,.525],100:[0,.61111,0,0,.525],101:[0,.43056,0,0,.525],102:[0,.61111,0,0,.525],103:[.22222,.43056,0,0,.525],104:[0,.61111,0,0,.525],105:[0,.61111,0,0,.525],106:[.22222,.61111,0,0,.525],107:[0,.61111,0,0,.525],108:[0,.61111,0,0,.525],109:[0,.43056,0,0,.525],110:[0,.43056,0,0,.525],111:[0,.43056,0,0,.525],112:[.22222,.43056,0,0,.525],113:[.22222,.43056,0,0,.525],114:[0,.43056,0,0,.525],115:[0,.43056,0,0,.525],116:[0,.55358,0,0,.525],117:[0,.43056,0,0,.525],118:[0,.43056,0,0,.525],119:[0,.43056,0,0,.525],120:[0,.43056,0,0,.525],121:[.22222,.43056,0,0,.525],122:[0,.43056,0,0,.525],123:[.08333,.69444,0,0,.525],124:[.08333,.69444,0,0,.525],125:[.08333,.69444,0,0,.525],126:[0,.61111,0,0,.525],127:[0,.61111,0,0,.525],160:[0,0,0,0,.525],176:[0,.61111,0,0,.525],184:[.19445,0,0,0,.525],305:[0,.43056,0,0,.525],567:[.22222,.43056,0,0,.525],711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:[0,.61111,0,0,.525],715:[0,.61111,0,0,.525],728:[0,.61111,0,0,.525],730:[0,.61111,0,0,.525],770:[0,.61111,0,0,.525],771:[0,.61111,0,0,.525],776:[0,.61111,0,0,.525],915:[0,.61111,0,0,.525],916:[0,.61111,0,0,.525],920:[0,.61111,0,0,.525],923:[0,.61111,0,0,.525],926:[0,.61111,0,0,.525],928:[0,.61111,0,0,.525],931:[0,.61111,0,0,.525],933:[0,.61111,0,0,.525],934:[0,.61111,0,0,.525],936:[0,.61111,0,0,.525],937:[0,.61111,0,0,.525],8216:[0,.61111,0,0,.525],8217:[0,.61111,0,0,.525],8242:[0,.61111,0,0,.525],9251:[.11111,.21944,0,0,.525]}},Fg={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25],defaultRuleThickness:[.04,.049,.049],bigOpSpacing1:[.111,.111,.111],bigOpSpacing2:[.166,.166,.166],bigOpSpacing3:[.2,.2,.2],bigOpSpacing4:[.6,.611,.611],bigOpSpacing5:[.1,.143,.143],sqrtRuleThickness:[.04,.04,.04],ptPerEm:[10,10,10],doubleRuleSep:[.2,.2,.2],arrayRuleWidth:[.04,.04,.04],fboxsep:[.3,.3,.3],fboxrule:[.04,.04,.04]},SC={Å:"A",Ð:"D",Þ:"o",å:"a",ð:"d",þ:"o",А:"A",Б:"B",В:"B",Г:"F",Д:"A",Е:"E",Ж:"K",З:"3",И:"N",Й:"N",К:"K",Л:"N",М:"M",Н:"H",О:"O",П:"N",Р:"P",С:"C",Т:"T",У:"y",Ф:"O",Х:"X",Ц:"U",Ч:"h",Ш:"W",Щ:"W",Ъ:"B",Ы:"X",Ь:"B",Э:"3",Ю:"X",Я:"R",а:"a",б:"b",в:"a",г:"r",д:"y",е:"e",ж:"m",з:"e",и:"n",й:"n",к:"n",л:"n",м:"m",н:"n",о:"o",п:"n",р:"p",с:"c",т:"o",у:"y",ф:"b",х:"x",ц:"n",ч:"n",ш:"w",щ:"w",ъ:"a",ы:"m",ь:"a",э:"e",ю:"m",я:"r"};function hF(t,e){Vs[t]=e}function iE(t,e,r){if(!Vs[e])throw new Error("Font metrics not found for font: "+e+".");var n=t.charCodeAt(0),i=Vs[e][n];if(!i&&t[0]in SC&&(n=SC[t[0]].charCodeAt(0),i=Vs[e][n]),!i&&r==="text"&&uF(n)&&(i=Vs[e][77]),i)return{depth:i[0],height:i[1],italic:i[2],skew:i[3],width:i[4]}}var rb={};function Lue(t){var e;if(t>=5?e=0:t>=3?e=1:e=2,!rb[e]){var r=rb[e]={cssEmPerMu:Fg.quad[e]/18};for(var n in Fg)Fg.hasOwnProperty(n)&&(r[n]=Fg[n][e])}return rb[e]}var Rue=[[1,1,1],[2,1,1],[3,1,1],[4,2,1],[5,2,1],[6,3,1],[7,4,2],[8,6,3],[9,7,6],[10,8,7],[11,10,9]],CC=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],AC=function(e,r){return r.size<2?e:Rue[e-1][r.size-1]};class So{constructor(e){this.style=void 0,this.color=void 0,this.size=void 0,this.textSize=void 0,this.phantom=void 0,this.font=void 0,this.fontFamily=void 0,this.fontWeight=void 0,this.fontShape=void 0,this.sizeMultiplier=void 0,this.maxSize=void 0,this.minRuleThickness=void 0,this._fontMetrics=void 0,this.style=e.style,this.color=e.color,this.size=e.size||So.BASESIZE,this.textSize=e.textSize||this.size,this.phantom=!!e.phantom,this.font=e.font||"",this.fontFamily=e.fontFamily||"",this.fontWeight=e.fontWeight||"",this.fontShape=e.fontShape||"",this.sizeMultiplier=CC[this.size-1],this.maxSize=e.maxSize,this.minRuleThickness=e.minRuleThickness,this._fontMetrics=void 0}extend(e){var r={style:this.style,size:this.size,textSize:this.textSize,color:this.color,phantom:this.phantom,font:this.font,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontShape:this.fontShape,maxSize:this.maxSize,minRuleThickness:this.minRuleThickness};for(var n in e)e.hasOwnProperty(n)&&(r[n]=e[n]);return new So(r)}havingStyle(e){return this.style===e?this:this.extend({style:e,size:AC(this.textSize,e)})}havingCrampedStyle(){return this.havingStyle(this.style.cramp())}havingSize(e){return this.size===e&&this.textSize===e?this:this.extend({style:this.style.text(),size:e,textSize:e,sizeMultiplier:CC[e-1]})}havingBaseStyle(e){e=e||this.style.text();var r=AC(So.BASESIZE,e);return this.size===r&&this.textSize===So.BASESIZE&&this.style===e?this:this.extend({style:e,size:r})}havingBaseSizing(){var e;switch(this.style.id){case 4:case 5:e=3;break;case 6:case 7:e=1;break;default:e=6}return this.extend({style:this.style.text(),size:e})}withColor(e){return this.extend({color:e})}withPhantom(){return this.extend({phantom:!0})}withFont(e){return this.extend({font:e})}withTextFontFamily(e){return this.extend({fontFamily:e,font:""})}withTextFontWeight(e){return this.extend({fontWeight:e,font:""})}withTextFontShape(e){return this.extend({fontShape:e,font:""})}sizingClasses(e){return e.size!==this.size?["sizing","reset-size"+e.size,"size"+this.size]:[]}baseSizingClasses(){return this.size!==So.BASESIZE?["sizing","reset-size"+this.size,"size"+So.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=Lue(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}}So.BASESIZE=6;var Y5={pt:1,mm:7227/2540,cm:7227/254,in:72.27,bp:803/800,pc:12,dd:1238/1157,cc:14856/1157,nd:685/642,nc:1370/107,sp:1/65536,px:803/800},Nue={ex:!0,em:!0,mu:!0},dF=function(e){return typeof e!="string"&&(e=e.unit),e in Y5||e in Nue||e==="ex"},en=function(e,r){var n;if(e.unit in Y5)n=Y5[e.unit]/r.fontMetrics().ptPerEm/r.sizeMultiplier;else if(e.unit==="mu")n=r.fontMetrics().cssEmPerMu;else{var i;if(r.style.isTight()?i=r.havingStyle(r.style.text()):i=r,e.unit==="ex")n=i.fontMetrics().xHeight;else if(e.unit==="em")n=i.fontMetrics().quad;else throw new ot("Invalid unit: '"+e.unit+"'");i!==r&&(n*=i.sizeMultiplier/r.sizeMultiplier)}return Math.min(e.number*n,r.maxSize)},gt=function(e){return+e.toFixed(4)+"em"},Fl=function(e){return e.filter(r=>r).join(" ")},fF=function(e,r,n){if(this.classes=e||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=n||{},r){r.style.isTight()&&this.classes.push("mtight");var i=r.getColor();i&&(this.style.color=i)}},pF=function(e){var r=document.createElement(e);r.className=Fl(this.classes);for(var n in this.style)this.style.hasOwnProperty(n)&&(r.style[n]=this.style[n]);for(var i in this.attributes)this.attributes.hasOwnProperty(i)&&r.setAttribute(i,this.attributes[i]);for(var a=0;a<this.children.length;a++)r.appendChild(this.children[a].toNode());return r},Due=/[\s"'>/=\x00-\x1f]/,gF=function(e){var r="<"+e;this.classes.length&&(r+=' class="'+Tr.escape(Fl(this.classes))+'"');var n="";for(var i in this.style)this.style.hasOwnProperty(i)&&(n+=Tr.hyphenate(i)+":"+this.style[i]+";");n&&(r+=' style="'+Tr.escape(n)+'"');for(var a in this.attributes)if(this.attributes.hasOwnProperty(a)){if(Due.test(a))throw new ot("Invalid attribute name '"+a+"'");r+=" "+a+'="'+Tr.escape(this.attributes[a])+'"'}r+=">";for(var s=0;s<this.children.length;s++)r+=this.children[s].toMarkup();return r+="</"+e+">",r};class Up{constructor(e,r,n,i){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.width=void 0,this.maxFontSize=void 0,this.style=void 0,fF.call(this,e,n,i),this.children=r||[]}setAttribute(e,r){this.attributes[e]=r}hasClass(e){return this.classes.includes(e)}toNode(){return pF.call(this,"span")}toMarkup(){return gF.call(this,"span")}}class aE{constructor(e,r,n,i){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,fF.call(this,r,i),this.children=n||[],this.setAttribute("href",e)}setAttribute(e,r){this.attributes[e]=r}hasClass(e){return this.classes.includes(e)}toNode(){return pF.call(this,"a")}toMarkup(){return gF.call(this,"a")}}class Mue{constructor(e,r,n){this.src=void 0,this.alt=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.alt=r,this.src=e,this.classes=["mord"],this.style=n}hasClass(e){return this.classes.includes(e)}toNode(){var e=document.createElement("img");e.src=this.src,e.alt=this.alt,e.className="mord";for(var r in this.style)this.style.hasOwnProperty(r)&&(e.style[r]=this.style[r]);return e}toMarkup(){var e='<img src="'+Tr.escape(this.src)+'"'+(' alt="'+Tr.escape(this.alt)+'"'),r="";for(var n in this.style)this.style.hasOwnProperty(n)&&(r+=Tr.hyphenate(n)+":"+this.style[n]+";");return r&&(e+=' style="'+Tr.escape(r)+'"'),e+="'/>",e}}var Iue={î:"ı̂",ï:"ı̈",í:"ı́",ì:"ı̀"};class ts{constructor(e,r,n,i,a,s,o,l){this.text=void 0,this.height=void 0,this.depth=void 0,this.italic=void 0,this.skew=void 0,this.width=void 0,this.maxFontSize=void 0,this.classes=void 0,this.style=void 0,this.text=e,this.height=r||0,this.depth=n||0,this.italic=i||0,this.skew=a||0,this.width=s||0,this.classes=o||[],this.style=l||{},this.maxFontSize=0;var u=yue(this.text.charCodeAt(0));u&&this.classes.push(u+"_fallback"),/[îïíì]/.test(this.text)&&(this.text=Iue[this.text])}hasClass(e){return this.classes.includes(e)}toNode(){var e=document.createTextNode(this.text),r=null;this.italic>0&&(r=document.createElement("span"),r.style.marginRight=gt(this.italic)),this.classes.length>0&&(r=r||document.createElement("span"),r.className=Fl(this.classes));for(var n in this.style)this.style.hasOwnProperty(n)&&(r=r||document.createElement("span"),r.style[n]=this.style[n]);return r?(r.appendChild(e),r):e}toMarkup(){var e=!1,r="<span";this.classes.length&&(e=!0,r+=' class="',r+=Tr.escape(Fl(this.classes)),r+='"');var n="";this.italic>0&&(n+="margin-right:"+this.italic+"em;");for(var i in this.style)this.style.hasOwnProperty(i)&&(n+=Tr.hyphenate(i)+":"+this.style[i]+";");n&&(e=!0,r+=' style="'+Tr.escape(n)+'"');var a=Tr.escape(this.text);return e?(r+=">",r+=a,r+="</span>",r):a}}class qo{constructor(e,r){this.children=void 0,this.attributes=void 0,this.children=e||[],this.attributes=r||{}}toNode(){var e="http://www.w3.org/2000/svg",r=document.createElementNS(e,"svg");for(var n in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,n)&&r.setAttribute(n,this.attributes[n]);for(var i=0;i<this.children.length;i++)r.appendChild(this.children[i].toNode());return r}toMarkup(){var e='<svg xmlns="http://www.w3.org/2000/svg"';for(var r in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,r)&&(e+=" "+r+'="'+Tr.escape(this.attributes[r])+'"');e+=">";for(var n=0;n<this.children.length;n++)e+=this.children[n].toMarkup();return e+="</svg>",e}}class $l{constructor(e,r){this.pathName=void 0,this.alternate=void 0,this.pathName=e,this.alternate=r}toNode(){var e="http://www.w3.org/2000/svg",r=document.createElementNS(e,"path");return this.alternate?r.setAttribute("d",this.alternate):r.setAttribute("d",kC[this.pathName]),r}toMarkup(){return this.alternate?'<path d="'+Tr.escape(this.alternate)+'"/>':'<path d="'+Tr.escape(kC[this.pathName])+'"/>'}}class X5{constructor(e){this.attributes=void 0,this.attributes=e||{}}toNode(){var e="http://www.w3.org/2000/svg",r=document.createElementNS(e,"line");for(var n in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,n)&&r.setAttribute(n,this.attributes[n]);return r}toMarkup(){var e="<line";for(var r in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,r)&&(e+=" "+r+'="'+Tr.escape(this.attributes[r])+'"');return e+="/>",e}}function _C(t){if(t instanceof ts)return t;throw new Error("Expected symbolNode but got "+String(t)+".")}function Oue(t){if(t instanceof Up)return t;throw new Error("Expected span<HtmlDomNode> but got "+String(t)+".")}var Pue={bin:1,close:1,inner:1,open:1,punct:1,rel:1},Bue={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1},Vr={math:{},text:{}};function V(t,e,r,n,i,a){Vr[t][i]={font:e,group:r,replace:n},a&&n&&(Vr[t][n]=Vr[t][i])}var U="math",tt="text",re="main",ye="ams",Zr="accent-token",At="bin",Ki="close",Ad="inner",zt="mathord",Ln="op-token",Na="open",d2="punct",xe="rel",il="spacing",Le="textord";V(U,re,xe,"≡","\\equiv",!0);V(U,re,xe,"≺","\\prec",!0);V(U,re,xe,"≻","\\succ",!0);V(U,re,xe,"∼","\\sim",!0);V(U,re,xe,"⊥","\\perp");V(U,re,xe,"⪯","\\preceq",!0);V(U,re,xe,"⪰","\\succeq",!0);V(U,re,xe,"≃","\\simeq",!0);V(U,re,xe,"∣","\\mid",!0);V(U,re,xe,"≪","\\ll",!0);V(U,re,xe,"≫","\\gg",!0);V(U,re,xe,"≍","\\asymp",!0);V(U,re,xe,"∥","\\parallel");V(U,re,xe,"⋈","\\bowtie",!0);V(U,re,xe,"⌣","\\smile",!0);V(U,re,xe,"⊑","\\sqsubseteq",!0);V(U,re,xe,"⊒","\\sqsupseteq",!0);V(U,re,xe,"≐","\\doteq",!0);V(U,re,xe,"⌢","\\frown",!0);V(U,re,xe,"∋","\\ni",!0);V(U,re,xe,"∝","\\propto",!0);V(U,re,xe,"⊢","\\vdash",!0);V(U,re,xe,"⊣","\\dashv",!0);V(U,re,xe,"∋","\\owns");V(U,re,d2,".","\\ldotp");V(U,re,d2,"⋅","\\cdotp");V(U,re,Le,"#","\\#");V(tt,re,Le,"#","\\#");V(U,re,Le,"&","\\&");V(tt,re,Le,"&","\\&");V(U,re,Le,"ℵ","\\aleph",!0);V(U,re,Le,"∀","\\forall",!0);V(U,re,Le,"ℏ","\\hbar",!0);V(U,re,Le,"∃","\\exists",!0);V(U,re,Le,"∇","\\nabla",!0);V(U,re,Le,"♭","\\flat",!0);V(U,re,Le,"ℓ","\\ell",!0);V(U,re,Le,"♮","\\natural",!0);V(U,re,Le,"♣","\\clubsuit",!0);V(U,re,Le,"℘","\\wp",!0);V(U,re,Le,"♯","\\sharp",!0);V(U,re,Le,"♢","\\diamondsuit",!0);V(U,re,Le,"ℜ","\\Re",!0);V(U,re,Le,"♡","\\heartsuit",!0);V(U,re,Le,"ℑ","\\Im",!0);V(U,re,Le,"♠","\\spadesuit",!0);V(U,re,Le,"§","\\S",!0);V(tt,re,Le,"§","\\S");V(U,re,Le,"¶","\\P",!0);V(tt,re,Le,"¶","\\P");V(U,re,Le,"†","\\dag");V(tt,re,Le,"†","\\dag");V(tt,re,Le,"†","\\textdagger");V(U,re,Le,"‡","\\ddag");V(tt,re,Le,"‡","\\ddag");V(tt,re,Le,"‡","\\textdaggerdbl");V(U,re,Ki,"⎱","\\rmoustache",!0);V(U,re,Na,"⎰","\\lmoustache",!0);V(U,re,Ki,"⟯","\\rgroup",!0);V(U,re,Na,"⟮","\\lgroup",!0);V(U,re,At,"∓","\\mp",!0);V(U,re,At,"⊖","\\ominus",!0);V(U,re,At,"⊎","\\uplus",!0);V(U,re,At,"⊓","\\sqcap",!0);V(U,re,At,"∗","\\ast");V(U,re,At,"⊔","\\sqcup",!0);V(U,re,At,"◯","\\bigcirc",!0);V(U,re,At,"∙","\\bullet",!0);V(U,re,At,"‡","\\ddagger");V(U,re,At,"≀","\\wr",!0);V(U,re,At,"⨿","\\amalg");V(U,re,At,"&","\\And");V(U,re,xe,"⟵","\\longleftarrow",!0);V(U,re,xe,"⇐","\\Leftarrow",!0);V(U,re,xe,"⟸","\\Longleftarrow",!0);V(U,re,xe,"⟶","\\longrightarrow",!0);V(U,re,xe,"⇒","\\Rightarrow",!0);V(U,re,xe,"⟹","\\Longrightarrow",!0);V(U,re,xe,"↔","\\leftrightarrow",!0);V(U,re,xe,"⟷","\\longleftrightarrow",!0);V(U,re,xe,"⇔","\\Leftrightarrow",!0);V(U,re,xe,"⟺","\\Longleftrightarrow",!0);V(U,re,xe,"↦","\\mapsto",!0);V(U,re,xe,"⟼","\\longmapsto",!0);V(U,re,xe,"↗","\\nearrow",!0);V(U,re,xe,"↩","\\hookleftarrow",!0);V(U,re,xe,"↪","\\hookrightarrow",!0);V(U,re,xe,"↘","\\searrow",!0);V(U,re,xe,"↼","\\leftharpoonup",!0);V(U,re,xe,"⇀","\\rightharpoonup",!0);V(U,re,xe,"↙","\\swarrow",!0);V(U,re,xe,"↽","\\leftharpoondown",!0);V(U,re,xe,"⇁","\\rightharpoondown",!0);V(U,re,xe,"↖","\\nwarrow",!0);V(U,re,xe,"⇌","\\rightleftharpoons",!0);V(U,ye,xe,"≮","\\nless",!0);V(U,ye,xe,"","\\@nleqslant");V(U,ye,xe,"","\\@nleqq");V(U,ye,xe,"⪇","\\lneq",!0);V(U,ye,xe,"≨","\\lneqq",!0);V(U,ye,xe,"","\\@lvertneqq");V(U,ye,xe,"⋦","\\lnsim",!0);V(U,ye,xe,"⪉","\\lnapprox",!0);V(U,ye,xe,"⊀","\\nprec",!0);V(U,ye,xe,"⋠","\\npreceq",!0);V(U,ye,xe,"⋨","\\precnsim",!0);V(U,ye,xe,"⪹","\\precnapprox",!0);V(U,ye,xe,"≁","\\nsim",!0);V(U,ye,xe,"","\\@nshortmid");V(U,ye,xe,"∤","\\nmid",!0);V(U,ye,xe,"⊬","\\nvdash",!0);V(U,ye,xe,"⊭","\\nvDash",!0);V(U,ye,xe,"⋪","\\ntriangleleft");V(U,ye,xe,"⋬","\\ntrianglelefteq",!0);V(U,ye,xe,"⊊","\\subsetneq",!0);V(U,ye,xe,"","\\@varsubsetneq");V(U,ye,xe,"⫋","\\subsetneqq",!0);V(U,ye,xe,"","\\@varsubsetneqq");V(U,ye,xe,"≯","\\ngtr",!0);V(U,ye,xe,"","\\@ngeqslant");V(U,ye,xe,"","\\@ngeqq");V(U,ye,xe,"⪈","\\gneq",!0);V(U,ye,xe,"≩","\\gneqq",!0);V(U,ye,xe,"","\\@gvertneqq");V(U,ye,xe,"⋧","\\gnsim",!0);V(U,ye,xe,"⪊","\\gnapprox",!0);V(U,ye,xe,"⊁","\\nsucc",!0);V(U,ye,xe,"⋡","\\nsucceq",!0);V(U,ye,xe,"⋩","\\succnsim",!0);V(U,ye,xe,"⪺","\\succnapprox",!0);V(U,ye,xe,"≆","\\ncong",!0);V(U,ye,xe,"","\\@nshortparallel");V(U,ye,xe,"∦","\\nparallel",!0);V(U,ye,xe,"⊯","\\nVDash",!0);V(U,ye,xe,"⋫","\\ntriangleright");V(U,ye,xe,"⋭","\\ntrianglerighteq",!0);V(U,ye,xe,"","\\@nsupseteqq");V(U,ye,xe,"⊋","\\supsetneq",!0);V(U,ye,xe,"","\\@varsupsetneq");V(U,ye,xe,"⫌","\\supsetneqq",!0);V(U,ye,xe,"","\\@varsupsetneqq");V(U,ye,xe,"⊮","\\nVdash",!0);V(U,ye,xe,"⪵","\\precneqq",!0);V(U,ye,xe,"⪶","\\succneqq",!0);V(U,ye,xe,"","\\@nsubseteqq");V(U,ye,At,"⊴","\\unlhd");V(U,ye,At,"⊵","\\unrhd");V(U,ye,xe,"↚","\\nleftarrow",!0);V(U,ye,xe,"↛","\\nrightarrow",!0);V(U,ye,xe,"⇍","\\nLeftarrow",!0);V(U,ye,xe,"⇏","\\nRightarrow",!0);V(U,ye,xe,"↮","\\nleftrightarrow",!0);V(U,ye,xe,"⇎","\\nLeftrightarrow",!0);V(U,ye,xe,"△","\\vartriangle");V(U,ye,Le,"ℏ","\\hslash");V(U,ye,Le,"▽","\\triangledown");V(U,ye,Le,"◊","\\lozenge");V(U,ye,Le,"Ⓢ","\\circledS");V(U,ye,Le,"®","\\circledR");V(tt,ye,Le,"®","\\circledR");V(U,ye,Le,"∡","\\measuredangle",!0);V(U,ye,Le,"∄","\\nexists");V(U,ye,Le,"℧","\\mho");V(U,ye,Le,"Ⅎ","\\Finv",!0);V(U,ye,Le,"⅁","\\Game",!0);V(U,ye,Le,"‵","\\backprime");V(U,ye,Le,"▲","\\blacktriangle");V(U,ye,Le,"▼","\\blacktriangledown");V(U,ye,Le,"■","\\blacksquare");V(U,ye,Le,"⧫","\\blacklozenge");V(U,ye,Le,"★","\\bigstar");V(U,ye,Le,"∢","\\sphericalangle",!0);V(U,ye,Le,"∁","\\complement",!0);V(U,ye,Le,"ð","\\eth",!0);V(tt,re,Le,"ð","ð");V(U,ye,Le,"╱","\\diagup");V(U,ye,Le,"╲","\\diagdown");V(U,ye,Le,"□","\\square");V(U,ye,Le,"□","\\Box");V(U,ye,Le,"◊","\\Diamond");V(U,ye,Le,"¥","\\yen",!0);V(tt,ye,Le,"¥","\\yen",!0);V(U,ye,Le,"✓","\\checkmark",!0);V(tt,ye,Le,"✓","\\checkmark");V(U,ye,Le,"ℶ","\\beth",!0);V(U,ye,Le,"ℸ","\\daleth",!0);V(U,ye,Le,"ℷ","\\gimel",!0);V(U,ye,Le,"ϝ","\\digamma",!0);V(U,ye,Le,"ϰ","\\varkappa");V(U,ye,Na,"┌","\\@ulcorner",!0);V(U,ye,Ki,"┐","\\@urcorner",!0);V(U,ye,Na,"└","\\@llcorner",!0);V(U,ye,Ki,"┘","\\@lrcorner",!0);V(U,ye,xe,"≦","\\leqq",!0);V(U,ye,xe,"⩽","\\leqslant",!0);V(U,ye,xe,"⪕","\\eqslantless",!0);V(U,ye,xe,"≲","\\lesssim",!0);V(U,ye,xe,"⪅","\\lessapprox",!0);V(U,ye,xe,"≊","\\approxeq",!0);V(U,ye,At,"⋖","\\lessdot");V(U,ye,xe,"⋘","\\lll",!0);V(U,ye,xe,"≶","\\lessgtr",!0);V(U,ye,xe,"⋚","\\lesseqgtr",!0);V(U,ye,xe,"⪋","\\lesseqqgtr",!0);V(U,ye,xe,"≑","\\doteqdot");V(U,ye,xe,"≓","\\risingdotseq",!0);V(U,ye,xe,"≒","\\fallingdotseq",!0);V(U,ye,xe,"∽","\\backsim",!0);V(U,ye,xe,"⋍","\\backsimeq",!0);V(U,ye,xe,"⫅","\\subseteqq",!0);V(U,ye,xe,"⋐","\\Subset",!0);V(U,ye,xe,"⊏","\\sqsubset",!0);V(U,ye,xe,"≼","\\preccurlyeq",!0);V(U,ye,xe,"⋞","\\curlyeqprec",!0);V(U,ye,xe,"≾","\\precsim",!0);V(U,ye,xe,"⪷","\\precapprox",!0);V(U,ye,xe,"⊲","\\vartriangleleft");V(U,ye,xe,"⊴","\\trianglelefteq");V(U,ye,xe,"⊨","\\vDash",!0);V(U,ye,xe,"⊪","\\Vvdash",!0);V(U,ye,xe,"⌣","\\smallsmile");V(U,ye,xe,"⌢","\\smallfrown");V(U,ye,xe,"≏","\\bumpeq",!0);V(U,ye,xe,"≎","\\Bumpeq",!0);V(U,ye,xe,"≧","\\geqq",!0);V(U,ye,xe,"⩾","\\geqslant",!0);V(U,ye,xe,"⪖","\\eqslantgtr",!0);V(U,ye,xe,"≳","\\gtrsim",!0);V(U,ye,xe,"⪆","\\gtrapprox",!0);V(U,ye,At,"⋗","\\gtrdot");V(U,ye,xe,"⋙","\\ggg",!0);V(U,ye,xe,"≷","\\gtrless",!0);V(U,ye,xe,"⋛","\\gtreqless",!0);V(U,ye,xe,"⪌","\\gtreqqless",!0);V(U,ye,xe,"≖","\\eqcirc",!0);V(U,ye,xe,"≗","\\circeq",!0);V(U,ye,xe,"≜","\\triangleq",!0);V(U,ye,xe,"∼","\\thicksim");V(U,ye,xe,"≈","\\thickapprox");V(U,ye,xe,"⫆","\\supseteqq",!0);V(U,ye,xe,"⋑","\\Supset",!0);V(U,ye,xe,"⊐","\\sqsupset",!0);V(U,ye,xe,"≽","\\succcurlyeq",!0);V(U,ye,xe,"⋟","\\curlyeqsucc",!0);V(U,ye,xe,"≿","\\succsim",!0);V(U,ye,xe,"⪸","\\succapprox",!0);V(U,ye,xe,"⊳","\\vartriangleright");V(U,ye,xe,"⊵","\\trianglerighteq");V(U,ye,xe,"⊩","\\Vdash",!0);V(U,ye,xe,"∣","\\shortmid");V(U,ye,xe,"∥","\\shortparallel");V(U,ye,xe,"≬","\\between",!0);V(U,ye,xe,"⋔","\\pitchfork",!0);V(U,ye,xe,"∝","\\varpropto");V(U,ye,xe,"◀","\\blacktriangleleft");V(U,ye,xe,"∴","\\therefore",!0);V(U,ye,xe,"∍","\\backepsilon");V(U,ye,xe,"▶","\\blacktriangleright");V(U,ye,xe,"∵","\\because",!0);V(U,ye,xe,"⋘","\\llless");V(U,ye,xe,"⋙","\\gggtr");V(U,ye,At,"⊲","\\lhd");V(U,ye,At,"⊳","\\rhd");V(U,ye,xe,"≂","\\eqsim",!0);V(U,re,xe,"⋈","\\Join");V(U,ye,xe,"≑","\\Doteq",!0);V(U,ye,At,"∔","\\dotplus",!0);V(U,ye,At,"∖","\\smallsetminus");V(U,ye,At,"⋒","\\Cap",!0);V(U,ye,At,"⋓","\\Cup",!0);V(U,ye,At,"⩞","\\doublebarwedge",!0);V(U,ye,At,"⊟","\\boxminus",!0);V(U,ye,At,"⊞","\\boxplus",!0);V(U,ye,At,"⋇","\\divideontimes",!0);V(U,ye,At,"⋉","\\ltimes",!0);V(U,ye,At,"⋊","\\rtimes",!0);V(U,ye,At,"⋋","\\leftthreetimes",!0);V(U,ye,At,"⋌","\\rightthreetimes",!0);V(U,ye,At,"⋏","\\curlywedge",!0);V(U,ye,At,"⋎","\\curlyvee",!0);V(U,ye,At,"⊝","\\circleddash",!0);V(U,ye,At,"⊛","\\circledast",!0);V(U,ye,At,"⋅","\\centerdot");V(U,ye,At,"⊺","\\intercal",!0);V(U,ye,At,"⋒","\\doublecap");V(U,ye,At,"⋓","\\doublecup");V(U,ye,At,"⊠","\\boxtimes",!0);V(U,ye,xe,"⇢","\\dashrightarrow",!0);V(U,ye,xe,"⇠","\\dashleftarrow",!0);V(U,ye,xe,"⇇","\\leftleftarrows",!0);V(U,ye,xe,"⇆","\\leftrightarrows",!0);V(U,ye,xe,"⇚","\\Lleftarrow",!0);V(U,ye,xe,"↞","\\twoheadleftarrow",!0);V(U,ye,xe,"↢","\\leftarrowtail",!0);V(U,ye,xe,"↫","\\looparrowleft",!0);V(U,ye,xe,"⇋","\\leftrightharpoons",!0);V(U,ye,xe,"↶","\\curvearrowleft",!0);V(U,ye,xe,"↺","\\circlearrowleft",!0);V(U,ye,xe,"↰","\\Lsh",!0);V(U,ye,xe,"⇈","\\upuparrows",!0);V(U,ye,xe,"↿","\\upharpoonleft",!0);V(U,ye,xe,"⇃","\\downharpoonleft",!0);V(U,re,xe,"⊶","\\origof",!0);V(U,re,xe,"⊷","\\imageof",!0);V(U,ye,xe,"⊸","\\multimap",!0);V(U,ye,xe,"↭","\\leftrightsquigarrow",!0);V(U,ye,xe,"⇉","\\rightrightarrows",!0);V(U,ye,xe,"⇄","\\rightleftarrows",!0);V(U,ye,xe,"↠","\\twoheadrightarrow",!0);V(U,ye,xe,"↣","\\rightarrowtail",!0);V(U,ye,xe,"↬","\\looparrowright",!0);V(U,ye,xe,"↷","\\curvearrowright",!0);V(U,ye,xe,"↻","\\circlearrowright",!0);V(U,ye,xe,"↱","\\Rsh",!0);V(U,ye,xe,"⇊","\\downdownarrows",!0);V(U,ye,xe,"↾","\\upharpoonright",!0);V(U,ye,xe,"⇂","\\downharpoonright",!0);V(U,ye,xe,"⇝","\\rightsquigarrow",!0);V(U,ye,xe,"⇝","\\leadsto");V(U,ye,xe,"⇛","\\Rrightarrow",!0);V(U,ye,xe,"↾","\\restriction");V(U,re,Le,"‘","`");V(U,re,Le,"$","\\$");V(tt,re,Le,"$","\\$");V(tt,re,Le,"$","\\textdollar");V(U,re,Le,"%","\\%");V(tt,re,Le,"%","\\%");V(U,re,Le,"_","\\_");V(tt,re,Le,"_","\\_");V(tt,re,Le,"_","\\textunderscore");V(U,re,Le,"∠","\\angle",!0);V(U,re,Le,"∞","\\infty",!0);V(U,re,Le,"′","\\prime");V(U,re,Le,"△","\\triangle");V(U,re,Le,"Γ","\\Gamma",!0);V(U,re,Le,"Δ","\\Delta",!0);V(U,re,Le,"Θ","\\Theta",!0);V(U,re,Le,"Λ","\\Lambda",!0);V(U,re,Le,"Ξ","\\Xi",!0);V(U,re,Le,"Π","\\Pi",!0);V(U,re,Le,"Σ","\\Sigma",!0);V(U,re,Le,"Υ","\\Upsilon",!0);V(U,re,Le,"Φ","\\Phi",!0);V(U,re,Le,"Ψ","\\Psi",!0);V(U,re,Le,"Ω","\\Omega",!0);V(U,re,Le,"A","Α");V(U,re,Le,"B","Β");V(U,re,Le,"E","Ε");V(U,re,Le,"Z","Ζ");V(U,re,Le,"H","Η");V(U,re,Le,"I","Ι");V(U,re,Le,"K","Κ");V(U,re,Le,"M","Μ");V(U,re,Le,"N","Ν");V(U,re,Le,"O","Ο");V(U,re,Le,"P","Ρ");V(U,re,Le,"T","Τ");V(U,re,Le,"X","Χ");V(U,re,Le,"¬","\\neg",!0);V(U,re,Le,"¬","\\lnot");V(U,re,Le,"⊤","\\top");V(U,re,Le,"⊥","\\bot");V(U,re,Le,"∅","\\emptyset");V(U,ye,Le,"∅","\\varnothing");V(U,re,zt,"α","\\alpha",!0);V(U,re,zt,"β","\\beta",!0);V(U,re,zt,"γ","\\gamma",!0);V(U,re,zt,"δ","\\delta",!0);V(U,re,zt,"ϵ","\\epsilon",!0);V(U,re,zt,"ζ","\\zeta",!0);V(U,re,zt,"η","\\eta",!0);V(U,re,zt,"θ","\\theta",!0);V(U,re,zt,"ι","\\iota",!0);V(U,re,zt,"κ","\\kappa",!0);V(U,re,zt,"λ","\\lambda",!0);V(U,re,zt,"μ","\\mu",!0);V(U,re,zt,"ν","\\nu",!0);V(U,re,zt,"ξ","\\xi",!0);V(U,re,zt,"ο","\\omicron",!0);V(U,re,zt,"π","\\pi",!0);V(U,re,zt,"ρ","\\rho",!0);V(U,re,zt,"σ","\\sigma",!0);V(U,re,zt,"τ","\\tau",!0);V(U,re,zt,"υ","\\upsilon",!0);V(U,re,zt,"ϕ","\\phi",!0);V(U,re,zt,"χ","\\chi",!0);V(U,re,zt,"ψ","\\psi",!0);V(U,re,zt,"ω","\\omega",!0);V(U,re,zt,"ε","\\varepsilon",!0);V(U,re,zt,"ϑ","\\vartheta",!0);V(U,re,zt,"ϖ","\\varpi",!0);V(U,re,zt,"ϱ","\\varrho",!0);V(U,re,zt,"ς","\\varsigma",!0);V(U,re,zt,"φ","\\varphi",!0);V(U,re,At,"∗","*",!0);V(U,re,At,"+","+");V(U,re,At,"−","-",!0);V(U,re,At,"⋅","\\cdot",!0);V(U,re,At,"∘","\\circ",!0);V(U,re,At,"÷","\\div",!0);V(U,re,At,"±","\\pm",!0);V(U,re,At,"×","\\times",!0);V(U,re,At,"∩","\\cap",!0);V(U,re,At,"∪","\\cup",!0);V(U,re,At,"∖","\\setminus",!0);V(U,re,At,"∧","\\land");V(U,re,At,"∨","\\lor");V(U,re,At,"∧","\\wedge",!0);V(U,re,At,"∨","\\vee",!0);V(U,re,Le,"√","\\surd");V(U,re,Na,"⟨","\\langle",!0);V(U,re,Na,"∣","\\lvert");V(U,re,Na,"∥","\\lVert");V(U,re,Ki,"?","?");V(U,re,Ki,"!","!");V(U,re,Ki,"⟩","\\rangle",!0);V(U,re,Ki,"∣","\\rvert");V(U,re,Ki,"∥","\\rVert");V(U,re,xe,"=","=");V(U,re,xe,":",":");V(U,re,xe,"≈","\\approx",!0);V(U,re,xe,"≅","\\cong",!0);V(U,re,xe,"≥","\\ge");V(U,re,xe,"≥","\\geq",!0);V(U,re,xe,"←","\\gets");V(U,re,xe,">","\\gt",!0);V(U,re,xe,"∈","\\in",!0);V(U,re,xe,"","\\@not");V(U,re,xe,"⊂","\\subset",!0);V(U,re,xe,"⊃","\\supset",!0);V(U,re,xe,"⊆","\\subseteq",!0);V(U,re,xe,"⊇","\\supseteq",!0);V(U,ye,xe,"⊈","\\nsubseteq",!0);V(U,ye,xe,"⊉","\\nsupseteq",!0);V(U,re,xe,"⊨","\\models");V(U,re,xe,"←","\\leftarrow",!0);V(U,re,xe,"≤","\\le");V(U,re,xe,"≤","\\leq",!0);V(U,re,xe,"<","\\lt",!0);V(U,re,xe,"→","\\rightarrow",!0);V(U,re,xe,"→","\\to");V(U,ye,xe,"≱","\\ngeq",!0);V(U,ye,xe,"≰","\\nleq",!0);V(U,re,il," ","\\ ");V(U,re,il," ","\\space");V(U,re,il," ","\\nobreakspace");V(tt,re,il," ","\\ ");V(tt,re,il," "," ");V(tt,re,il," ","\\space");V(tt,re,il," ","\\nobreakspace");V(U,re,il,null,"\\nobreak");V(U,re,il,null,"\\allowbreak");V(U,re,d2,",",",");V(U,re,d2,";",";");V(U,ye,At,"⊼","\\barwedge",!0);V(U,ye,At,"⊻","\\veebar",!0);V(U,re,At,"⊙","\\odot",!0);V(U,re,At,"⊕","\\oplus",!0);V(U,re,At,"⊗","\\otimes",!0);V(U,re,Le,"∂","\\partial",!0);V(U,re,At,"⊘","\\oslash",!0);V(U,ye,At,"⊚","\\circledcirc",!0);V(U,ye,At,"⊡","\\boxdot",!0);V(U,re,At,"△","\\bigtriangleup");V(U,re,At,"▽","\\bigtriangledown");V(U,re,At,"†","\\dagger");V(U,re,At,"⋄","\\diamond");V(U,re,At,"⋆","\\star");V(U,re,At,"◃","\\triangleleft");V(U,re,At,"▹","\\triangleright");V(U,re,Na,"{","\\{");V(tt,re,Le,"{","\\{");V(tt,re,Le,"{","\\textbraceleft");V(U,re,Ki,"}","\\}");V(tt,re,Le,"}","\\}");V(tt,re,Le,"}","\\textbraceright");V(U,re,Na,"{","\\lbrace");V(U,re,Ki,"}","\\rbrace");V(U,re,Na,"[","\\lbrack",!0);V(tt,re,Le,"[","\\lbrack",!0);V(U,re,Ki,"]","\\rbrack",!0);V(tt,re,Le,"]","\\rbrack",!0);V(U,re,Na,"(","\\lparen",!0);V(U,re,Ki,")","\\rparen",!0);V(tt,re,Le,"<","\\textless",!0);V(tt,re,Le,">","\\textgreater",!0);V(U,re,Na,"⌊","\\lfloor",!0);V(U,re,Ki,"⌋","\\rfloor",!0);V(U,re,Na,"⌈","\\lceil",!0);V(U,re,Ki,"⌉","\\rceil",!0);V(U,re,Le,"\\","\\backslash");V(U,re,Le,"∣","|");V(U,re,Le,"∣","\\vert");V(tt,re,Le,"|","\\textbar",!0);V(U,re,Le,"∥","\\|");V(U,re,Le,"∥","\\Vert");V(tt,re,Le,"∥","\\textbardbl");V(tt,re,Le,"~","\\textasciitilde");V(tt,re,Le,"\\","\\textbackslash");V(tt,re,Le,"^","\\textasciicircum");V(U,re,xe,"↑","\\uparrow",!0);V(U,re,xe,"⇑","\\Uparrow",!0);V(U,re,xe,"↓","\\downarrow",!0);V(U,re,xe,"⇓","\\Downarrow",!0);V(U,re,xe,"↕","\\updownarrow",!0);V(U,re,xe,"⇕","\\Updownarrow",!0);V(U,re,Ln,"∐","\\coprod");V(U,re,Ln,"⋁","\\bigvee");V(U,re,Ln,"⋀","\\bigwedge");V(U,re,Ln,"⨄","\\biguplus");V(U,re,Ln,"⋂","\\bigcap");V(U,re,Ln,"⋃","\\bigcup");V(U,re,Ln,"∫","\\int");V(U,re,Ln,"∫","\\intop");V(U,re,Ln,"∬","\\iint");V(U,re,Ln,"∭","\\iiint");V(U,re,Ln,"∏","\\prod");V(U,re,Ln,"∑","\\sum");V(U,re,Ln,"⨂","\\bigotimes");V(U,re,Ln,"⨁","\\bigoplus");V(U,re,Ln,"⨀","\\bigodot");V(U,re,Ln,"∮","\\oint");V(U,re,Ln,"∯","\\oiint");V(U,re,Ln,"∰","\\oiiint");V(U,re,Ln,"⨆","\\bigsqcup");V(U,re,Ln,"∫","\\smallint");V(tt,re,Ad,"…","\\textellipsis");V(U,re,Ad,"…","\\mathellipsis");V(tt,re,Ad,"…","\\ldots",!0);V(U,re,Ad,"…","\\ldots",!0);V(U,re,Ad,"⋯","\\@cdots",!0);V(U,re,Ad,"⋱","\\ddots",!0);V(U,re,Le,"⋮","\\varvdots");V(tt,re,Le,"⋮","\\varvdots");V(U,re,Zr,"ˊ","\\acute");V(U,re,Zr,"ˋ","\\grave");V(U,re,Zr,"¨","\\ddot");V(U,re,Zr,"~","\\tilde");V(U,re,Zr,"ˉ","\\bar");V(U,re,Zr,"˘","\\breve");V(U,re,Zr,"ˇ","\\check");V(U,re,Zr,"^","\\hat");V(U,re,Zr,"⃗","\\vec");V(U,re,Zr,"˙","\\dot");V(U,re,Zr,"˚","\\mathring");V(U,re,zt,"","\\@imath");V(U,re,zt,"","\\@jmath");V(U,re,Le,"ı","ı");V(U,re,Le,"ȷ","ȷ");V(tt,re,Le,"ı","\\i",!0);V(tt,re,Le,"ȷ","\\j",!0);V(tt,re,Le,"ß","\\ss",!0);V(tt,re,Le,"æ","\\ae",!0);V(tt,re,Le,"œ","\\oe",!0);V(tt,re,Le,"ø","\\o",!0);V(tt,re,Le,"Æ","\\AE",!0);V(tt,re,Le,"Œ","\\OE",!0);V(tt,re,Le,"Ø","\\O",!0);V(tt,re,Zr,"ˊ","\\'");V(tt,re,Zr,"ˋ","\\`");V(tt,re,Zr,"ˆ","\\^");V(tt,re,Zr,"˜","\\~");V(tt,re,Zr,"ˉ","\\=");V(tt,re,Zr,"˘","\\u");V(tt,re,Zr,"˙","\\.");V(tt,re,Zr,"¸","\\c");V(tt,re,Zr,"˚","\\r");V(tt,re,Zr,"ˇ","\\v");V(tt,re,Zr,"¨",'\\"');V(tt,re,Zr,"˝","\\H");V(tt,re,Zr,"◯","\\textcircled");var mF={"--":!0,"---":!0,"``":!0,"''":!0};V(tt,re,Le,"–","--",!0);V(tt,re,Le,"–","\\textendash");V(tt,re,Le,"—","---",!0);V(tt,re,Le,"—","\\textemdash");V(tt,re,Le,"‘","`",!0);V(tt,re,Le,"‘","\\textquoteleft");V(tt,re,Le,"’","'",!0);V(tt,re,Le,"’","\\textquoteright");V(tt,re,Le,"“","``",!0);V(tt,re,Le,"“","\\textquotedblleft");V(tt,re,Le,"”","''",!0);V(tt,re,Le,"”","\\textquotedblright");V(U,re,Le,"°","\\degree",!0);V(tt,re,Le,"°","\\degree");V(tt,re,Le,"°","\\textdegree",!0);V(U,re,Le,"£","\\pounds");V(U,re,Le,"£","\\mathsterling",!0);V(tt,re,Le,"£","\\pounds");V(tt,re,Le,"£","\\textsterling",!0);V(U,ye,Le,"✠","\\maltese");V(tt,ye,Le,"✠","\\maltese");var LC='0123456789/@."';for(var nb=0;nb<LC.length;nb++){var RC=LC.charAt(nb);V(U,re,Le,RC,RC)}var NC='0123456789!@*()-=+";:?/.,';for(var ib=0;ib<NC.length;ib++){var DC=NC.charAt(ib);V(tt,re,Le,DC,DC)}var Sv="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";for(var ab=0;ab<Sv.length;ab++){var $g=Sv.charAt(ab);V(U,re,zt,$g,$g),V(tt,re,Le,$g,$g)}V(U,ye,Le,"C","ℂ");V(tt,ye,Le,"C","ℂ");V(U,ye,Le,"H","ℍ");V(tt,ye,Le,"H","ℍ");V(U,ye,Le,"N","ℕ");V(tt,ye,Le,"N","ℕ");V(U,ye,Le,"P","ℙ");V(tt,ye,Le,"P","ℙ");V(U,ye,Le,"Q","ℚ");V(tt,ye,Le,"Q","ℚ");V(U,ye,Le,"R","ℝ");V(tt,ye,Le,"R","ℝ");V(U,ye,Le,"Z","ℤ");V(tt,ye,Le,"Z","ℤ");V(U,re,zt,"h","ℎ");V(tt,re,zt,"h","ℎ");var qt="";for(var Di=0;Di<Sv.length;Di++){var sn=Sv.charAt(Di);qt=String.fromCharCode(55349,56320+Di),V(U,re,zt,sn,qt),V(tt,re,Le,sn,qt),qt=String.fromCharCode(55349,56372+Di),V(U,re,zt,sn,qt),V(tt,re,Le,sn,qt),qt=String.fromCharCode(55349,56424+Di),V(U,re,zt,sn,qt),V(tt,re,Le,sn,qt),qt=String.fromCharCode(55349,56580+Di),V(U,re,zt,sn,qt),V(tt,re,Le,sn,qt),qt=String.fromCharCode(55349,56684+Di),V(U,re,zt,sn,qt),V(tt,re,Le,sn,qt),qt=String.fromCharCode(55349,56736+Di),V(U,re,zt,sn,qt),V(tt,re,Le,sn,qt),qt=String.fromCharCode(55349,56788+Di),V(U,re,zt,sn,qt),V(tt,re,Le,sn,qt),qt=String.fromCharCode(55349,56840+Di),V(U,re,zt,sn,qt),V(tt,re,Le,sn,qt),qt=String.fromCharCode(55349,56944+Di),V(U,re,zt,sn,qt),V(tt,re,Le,sn,qt),Di<26&&(qt=String.fromCharCode(55349,56632+Di),V(U,re,zt,sn,qt),V(tt,re,Le,sn,qt),qt=String.fromCharCode(55349,56476+Di),V(U,re,zt,sn,qt),V(tt,re,Le,sn,qt))}qt="𝕜";V(U,re,zt,"k",qt);V(tt,re,Le,"k",qt);for(var kc=0;kc<10;kc++){var ul=kc.toString();qt=String.fromCharCode(55349,57294+kc),V(U,re,zt,ul,qt),V(tt,re,Le,ul,qt),qt=String.fromCharCode(55349,57314+kc),V(U,re,zt,ul,qt),V(tt,re,Le,ul,qt),qt=String.fromCharCode(55349,57324+kc),V(U,re,zt,ul,qt),V(tt,re,Le,ul,qt),qt=String.fromCharCode(55349,57334+kc),V(U,re,zt,ul,qt),V(tt,re,Le,ul,qt)}var j5="ÐÞþ";for(var sb=0;sb<j5.length;sb++){var zg=j5.charAt(sb);V(U,re,zt,zg,zg),V(tt,re,Le,zg,zg)}var Vg=[["mathbf","textbf","Main-Bold"],["mathbf","textbf","Main-Bold"],["mathnormal","textit","Math-Italic"],["mathnormal","textit","Math-Italic"],["boldsymbol","boldsymbol","Main-BoldItalic"],["boldsymbol","boldsymbol","Main-BoldItalic"],["mathscr","textscr","Script-Regular"],["","",""],["","",""],["","",""],["mathfrak","textfrak","Fraktur-Regular"],["mathfrak","textfrak","Fraktur-Regular"],["mathbb","textbb","AMS-Regular"],["mathbb","textbb","AMS-Regular"],["mathboldfrak","textboldfrak","Fraktur-Regular"],["mathboldfrak","textboldfrak","Fraktur-Regular"],["mathsf","textsf","SansSerif-Regular"],["mathsf","textsf","SansSerif-Regular"],["mathboldsf","textboldsf","SansSerif-Bold"],["mathboldsf","textboldsf","SansSerif-Bold"],["mathitsf","textitsf","SansSerif-Italic"],["mathitsf","textitsf","SansSerif-Italic"],["","",""],["","",""],["mathtt","texttt","Typewriter-Regular"],["mathtt","texttt","Typewriter-Regular"]],MC=[["mathbf","textbf","Main-Bold"],["","",""],["mathsf","textsf","SansSerif-Regular"],["mathboldsf","textboldsf","SansSerif-Bold"],["mathtt","texttt","Typewriter-Regular"]],Fue=function(e,r){var n=e.charCodeAt(0),i=e.charCodeAt(1),a=(n-55296)*1024+(i-56320)+65536,s=r==="math"?0:1;if(119808<=a&&a<120484){var o=Math.floor((a-119808)/26);return[Vg[o][2],Vg[o][s]]}else if(120782<=a&&a<=120831){var l=Math.floor((a-120782)/10);return[MC[l][2],MC[l][s]]}else{if(a===120485||a===120486)return[Vg[0][2],Vg[0][s]];if(120486<a&&a<120782)return["",""];throw new ot("Unsupported character: "+e)}},f2=function(e,r,n){return Vr[n][e]&&Vr[n][e].replace&&(e=Vr[n][e].replace),{value:e,metrics:iE(e,r,n)}},os=function(e,r,n,i,a){var s=f2(e,r,n),o=s.metrics;e=s.value;var l;if(o){var u=o.italic;(n==="text"||i&&i.font==="mathit")&&(u=0),l=new ts(e,o.height,o.depth,u,o.skew,o.width,a)}else typeof console<"u"&&console.warn("No character metrics "+("for '"+e+"' in style '"+r+"' and mode '"+n+"'")),l=new ts(e,0,0,0,0,0,a);if(i){l.maxFontSize=i.sizeMultiplier,i.style.isTight()&&l.classes.push("mtight");var h=i.getColor();h&&(l.style.color=h)}return l},$ue=function(e,r,n,i){return i===void 0&&(i=[]),n.font==="boldsymbol"&&f2(e,"Main-Bold",r).metrics?os(e,"Main-Bold",r,n,i.concat(["mathbf"])):e==="\\"||Vr[r][e].font==="main"?os(e,"Main-Regular",r,n,i):os(e,"AMS-Regular",r,n,i.concat(["amsrm"]))},zue=function(e,r,n,i,a){return a!=="textord"&&f2(e,"Math-BoldItalic",r).metrics?{fontName:"Math-BoldItalic",fontClass:"boldsymbol"}:{fontName:"Main-Bold",fontClass:"mathbf"}},Vue=function(e,r,n){var i=e.mode,a=e.text,s=["mord"],o=i==="math"||i==="text"&&r.font,l=o?r.font:r.fontFamily,u="",h="";if(a.charCodeAt(0)===55349&&([u,h]=Fue(a,i)),u.length>0)return os(a,u,i,r,s.concat(h));if(l){var d,f;if(l==="boldsymbol"){var p=zue(a,i,r,s,n);d=p.fontName,f=[p.fontClass]}else o?(d=xF[l].fontName,f=[l]):(d=Gg(l,r.fontWeight,r.fontShape),f=[l,r.fontWeight,r.fontShape]);if(f2(a,d,i).metrics)return os(a,d,i,r,s.concat(f));if(mF.hasOwnProperty(a)&&d.slice(0,10)==="Typewriter"){for(var g=[],m=0;m<a.length;m++)g.push(os(a[m],d,i,r,s.concat(f)));return yF(g)}}if(n==="mathord")return os(a,"Math-Italic",i,r,s.concat(["mathnormal"]));if(n==="textord"){var v=Vr[i][a]&&Vr[i][a].font;if(v==="ams"){var y=Gg("amsrm",r.fontWeight,r.fontShape);return os(a,y,i,r,s.concat("amsrm",r.fontWeight,r.fontShape))}else if(v==="main"||!v){var b=Gg("textrm",r.fontWeight,r.fontShape);return os(a,b,i,r,s.concat(r.fontWeight,r.fontShape))}else{var w=Gg(v,r.fontWeight,r.fontShape);return os(a,w,i,r,s.concat(w,r.fontWeight,r.fontShape))}}else throw new Error("unexpected type: "+n+" in makeOrd")},Gue=(t,e)=>{if(Fl(t.classes)!==Fl(e.classes)||t.skew!==e.skew||t.maxFontSize!==e.maxFontSize)return!1;if(t.classes.length===1){var r=t.classes[0];if(r==="mbin"||r==="mord")return!1}for(var n in t.style)if(t.style.hasOwnProperty(n)&&t.style[n]!==e.style[n])return!1;for(var i in e.style)if(e.style.hasOwnProperty(i)&&t.style[i]!==e.style[i])return!1;return!0},Uue=t=>{for(var e=0;e<t.length-1;e++){var r=t[e],n=t[e+1];r instanceof ts&&n instanceof ts&&Gue(r,n)&&(r.text+=n.text,r.height=Math.max(r.height,n.height),r.depth=Math.max(r.depth,n.depth),r.italic=n.italic,t.splice(e+1,1),e--)}return t},sE=function(e){for(var r=0,n=0,i=0,a=0;a<e.children.length;a++){var s=e.children[a];s.height>r&&(r=s.height),s.depth>n&&(n=s.depth),s.maxFontSize>i&&(i=s.maxFontSize)}e.height=r,e.depth=n,e.maxFontSize=i},ta=function(e,r,n,i){var a=new Up(e,r,n,i);return sE(a),a},vF=(t,e,r,n)=>new Up(t,e,r,n),Wue=function(e,r,n){var i=ta([e],[],r);return i.height=Math.max(n||r.fontMetrics().defaultRuleThickness,r.minRuleThickness),i.style.borderBottomWidth=gt(i.height),i.maxFontSize=1,i},Hue=function(e,r,n,i){var a=new aE(e,r,n,i);return sE(a),a},yF=function(e){var r=new Gp(e);return sE(r),r},que=function(e,r){return e instanceof Gp?ta([],[e],r):e},Yue=function(e){if(e.positionType==="individualShift"){for(var r=e.children,n=[r[0]],i=-r[0].shift-r[0].elem.depth,a=i,s=1;s<r.length;s++){var o=-r[s].shift-a-r[s].elem.depth,l=o-(r[s-1].elem.height+r[s-1].elem.depth);a=a+o,n.push({type:"kern",size:l}),n.push(r[s])}return{children:n,depth:i}}var u;if(e.positionType==="top"){for(var h=e.positionData,d=0;d<e.children.length;d++){var f=e.children[d];h-=f.type==="kern"?f.size:f.elem.height+f.elem.depth}u=h}else if(e.positionType==="bottom")u=-e.positionData;else{var p=e.children[0];if(p.type!=="elem")throw new Error('First child must have type "elem".');if(e.positionType==="shift")u=-p.elem.depth-e.positionData;else if(e.positionType==="firstBaseline")u=-p.elem.depth;else throw new Error("Invalid positionType "+e.positionType+".")}return{children:e.children,depth:u}},Xue=function(e,r){for(var{children:n,depth:i}=Yue(e),a=0,s=0;s<n.length;s++){var o=n[s];if(o.type==="elem"){var l=o.elem;a=Math.max(a,l.maxFontSize,l.height)}}a+=2;var u=ta(["pstrut"],[]);u.style.height=gt(a);for(var h=[],d=i,f=i,p=i,g=0;g<n.length;g++){var m=n[g];if(m.type==="kern")p+=m.size;else{var v=m.elem,y=m.wrapperClasses||[],b=m.wrapperStyle||{},w=ta(y,[u,v],void 0,b);w.style.top=gt(-a-p-v.depth),m.marginLeft&&(w.style.marginLeft=m.marginLeft),m.marginRight&&(w.style.marginRight=m.marginRight),h.push(w),p+=v.height+v.depth}d=Math.min(d,p),f=Math.max(f,p)}var T=ta(["vlist"],h);T.style.height=gt(f);var E;if(d<0){var L=ta([],[]),S=ta(["vlist"],[L]);S.style.height=gt(-d);var C=ta(["vlist-s"],[new ts("​")]);E=[ta(["vlist-r"],[T,C]),ta(["vlist-r"],[S])]}else E=[ta(["vlist-r"],[T])];var A=ta(["vlist-t"],E);return E.length===2&&A.classes.push("vlist-t2"),A.height=f,A.depth=-d,A},jue=(t,e)=>{var r=ta(["mspace"],[],e),n=en(t,e);return r.style.marginRight=gt(n),r},Gg=function(e,r,n){var i="";switch(e){case"amsrm":i="AMS";break;case"textrm":i="Main";break;case"textsf":i="SansSerif";break;case"texttt":i="Typewriter";break;default:i=e}var a;return r==="textbf"&&n==="textit"?a="BoldItalic":r==="textbf"?a="Bold":r==="textit"?a="Italic":a="Regular",i+"-"+a},xF={mathbf:{variant:"bold",fontName:"Main-Bold"},mathrm:{variant:"normal",fontName:"Main-Regular"},textit:{variant:"italic",fontName:"Main-Italic"},mathit:{variant:"italic",fontName:"Main-Italic"},mathnormal:{variant:"italic",fontName:"Math-Italic"},mathsfit:{variant:"sans-serif-italic",fontName:"SansSerif-Italic"},mathbb:{variant:"double-struck",fontName:"AMS-Regular"},mathcal:{variant:"script",fontName:"Caligraphic-Regular"},mathfrak:{variant:"fraktur",fontName:"Fraktur-Regular"},mathscr:{variant:"script",fontName:"Script-Regular"},mathsf:{variant:"sans-serif",fontName:"SansSerif-Regular"},mathtt:{variant:"monospace",fontName:"Typewriter-Regular"}},bF={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},Kue=function(e,r){var[n,i,a]=bF[e],s=new $l(n),o=new qo([s],{width:gt(i),height:gt(a),style:"width:"+gt(i),viewBox:"0 0 "+1e3*i+" "+1e3*a,preserveAspectRatio:"xMinYMin"}),l=vF(["overlay"],[o],r);return l.height=a,l.style.height=gt(a),l.style.width=gt(i),l},Fe={fontMap:xF,makeSymbol:os,mathsym:$ue,makeSpan:ta,makeSvgSpan:vF,makeLineSpan:Wue,makeAnchor:Hue,makeFragment:yF,wrapFragment:que,makeVList:Xue,makeOrd:Vue,makeGlue:jue,staticSvg:Kue,svgData:bF,tryCombineChars:Uue},Jr={number:3,unit:"mu"},Sc={number:4,unit:"mu"},mo={number:5,unit:"mu"},Zue={mord:{mop:Jr,mbin:Sc,mrel:mo,minner:Jr},mop:{mord:Jr,mop:Jr,mrel:mo,minner:Jr},mbin:{mord:Sc,mop:Sc,mopen:Sc,minner:Sc},mrel:{mord:mo,mop:mo,mopen:mo,minner:mo},mopen:{},mclose:{mop:Jr,mbin:Sc,mrel:mo,minner:Jr},mpunct:{mord:Jr,mop:Jr,mrel:mo,mopen:Jr,mclose:Jr,mpunct:Jr,minner:Jr},minner:{mord:Jr,mop:Jr,mbin:Sc,mrel:mo,mopen:Jr,mpunct:Jr,minner:Jr}},Que={mord:{mop:Jr},mop:{mord:Jr,mop:Jr},mbin:{},mrel:{},mopen:{},mclose:{mop:Jr},mpunct:{},minner:{mop:Jr}},wF={},Cv={},Av={};function Et(t){for(var{type:e,names:r,props:n,handler:i,htmlBuilder:a,mathmlBuilder:s}=t,o={type:e,numArgs:n.numArgs,argTypes:n.argTypes,allowedInArgument:!!n.allowedInArgument,allowedInText:!!n.allowedInText,allowedInMath:n.allowedInMath===void 0?!0:n.allowedInMath,numOptionalArgs:n.numOptionalArgs||0,infix:!!n.infix,primitive:!!n.primitive,handler:i},l=0;l<r.length;++l)wF[r[l]]=o;e&&(a&&(Cv[e]=a),s&&(Av[e]=s))}function Du(t){var{type:e,htmlBuilder:r,mathmlBuilder:n}=t;Et({type:e,names:[],props:{numArgs:0},handler(){throw new Error("Should never be called.")},htmlBuilder:r,mathmlBuilder:n})}var _v=function(e){return e.type==="ordgroup"&&e.body.length===1?e.body[0]:e},yn=function(e){return e.type==="ordgroup"?e.body:[e]},Yo=Fe.makeSpan,Jue=["leftmost","mbin","mopen","mrel","mop","mpunct"],ehe=["rightmost","mrel","mclose","mpunct"],the={display:Vt.DISPLAY,text:Vt.TEXT,script:Vt.SCRIPT,scriptscript:Vt.SCRIPTSCRIPT},rhe={mord:"mord",mop:"mop",mbin:"mbin",mrel:"mrel",mopen:"mopen",mclose:"mclose",mpunct:"mpunct",minner:"minner"},Bn=function(e,r,n,i){i===void 0&&(i=[null,null]);for(var a=[],s=0;s<e.length;s++){var o=yr(e[s],r);if(o instanceof Gp){var l=o.children;a.push(...l)}else a.push(o)}if(Fe.tryCombineChars(a),!n)return a;var u=r;if(e.length===1){var h=e[0];h.type==="sizing"?u=r.havingSize(h.size):h.type==="styling"&&(u=r.havingStyle(the[h.style]))}var d=Yo([i[0]||"leftmost"],[],r),f=Yo([i[1]||"rightmost"],[],r),p=n==="root";return IC(a,(g,m)=>{var v=m.classes[0],y=g.classes[0];v==="mbin"&&ehe.includes(y)?m.classes[0]="mord":y==="mbin"&&Jue.includes(v)&&(g.classes[0]="mord")},{node:d},f,p),IC(a,(g,m)=>{var v=K5(m),y=K5(g),b=v&&y?g.hasClass("mtight")?Que[v][y]:Zue[v][y]:null;if(b)return Fe.makeGlue(b,u)},{node:d},f,p),a},IC=function t(e,r,n,i,a){i&&e.push(i);for(var s=0;s<e.length;s++){var o=e[s],l=TF(o);if(l){t(l.children,r,n,null,a);continue}var u=!o.hasClass("mspace");if(u){var h=r(o,n.node);h&&(n.insertAfter?n.insertAfter(h):(e.unshift(h),s++))}u?n.node=o:a&&o.hasClass("newline")&&(n.node=Yo(["leftmost"])),n.insertAfter=(d=>f=>{e.splice(d+1,0,f),s++})(s)}i&&e.pop()},TF=function(e){return e instanceof Gp||e instanceof aE||e instanceof Up&&e.hasClass("enclosing")?e:null},nhe=function t(e,r){var n=TF(e);if(n){var i=n.children;if(i.length){if(r==="right")return t(i[i.length-1],"right");if(r==="left")return t(i[0],"left")}}return e},K5=function(e,r){return e?(r&&(e=nhe(e,r)),rhe[e.classes[0]]||null):null},J0=function(e,r){var n=["nulldelimiter"].concat(e.baseSizingClasses());return Yo(r.concat(n))},yr=function(e,r,n){if(!e)return Yo();if(Cv[e.type]){var i=Cv[e.type](e,r);if(n&&r.size!==n.size){i=Yo(r.sizingClasses(n),[i],r);var a=r.sizeMultiplier/n.sizeMultiplier;i.height*=a,i.depth*=a}return i}else throw new ot("Got group of unknown type: '"+e.type+"'")};function Ug(t,e){var r=Yo(["base"],t,e),n=Yo(["strut"]);return n.style.height=gt(r.height+r.depth),r.depth&&(n.style.verticalAlign=gt(-r.depth)),r.children.unshift(n),r}function Z5(t,e){var r=null;t.length===1&&t[0].type==="tag"&&(r=t[0].tag,t=t[0].body);var n=Bn(t,e,"root"),i;n.length===2&&n[1].hasClass("tag")&&(i=n.pop());for(var a=[],s=[],o=0;o<n.length;o++)if(s.push(n[o]),n[o].hasClass("mbin")||n[o].hasClass("mrel")||n[o].hasClass("allowbreak")){for(var l=!1;o<n.length-1&&n[o+1].hasClass("mspace")&&!n[o+1].hasClass("newline");)o++,s.push(n[o]),n[o].hasClass("nobreak")&&(l=!0);l||(a.push(Ug(s,e)),s=[])}else n[o].hasClass("newline")&&(s.pop(),s.length>0&&(a.push(Ug(s,e)),s=[]),a.push(n[o]));s.length>0&&a.push(Ug(s,e));var u;r?(u=Ug(Bn(r,e,!0)),u.classes=["tag"],a.push(u)):i&&a.push(i);var h=Yo(["katex-html"],a);if(h.setAttribute("aria-hidden","true"),u){var d=u.children[0];d.style.height=gt(h.height+h.depth),h.depth&&(d.style.verticalAlign=gt(-h.depth))}return h}function EF(t){return new Gp(t)}class Ea{constructor(e,r,n){this.type=void 0,this.attributes=void 0,this.children=void 0,this.classes=void 0,this.type=e,this.attributes={},this.children=r||[],this.classes=n||[]}setAttribute(e,r){this.attributes[e]=r}getAttribute(e){return this.attributes[e]}toNode(){var e=document.createElementNS("http://www.w3.org/1998/Math/MathML",this.type);for(var r in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,r)&&e.setAttribute(r,this.attributes[r]);this.classes.length>0&&(e.className=Fl(this.classes));for(var n=0;n<this.children.length;n++)if(this.children[n]instanceof Gs&&this.children[n+1]instanceof Gs){for(var i=this.children[n].toText()+this.children[++n].toText();this.children[n+1]instanceof Gs;)i+=this.children[++n].toText();e.appendChild(new Gs(i).toNode())}else e.appendChild(this.children[n].toNode());return e}toMarkup(){var e="<"+this.type;for(var r in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,r)&&(e+=" "+r+'="',e+=Tr.escape(this.attributes[r]),e+='"');this.classes.length>0&&(e+=' class ="'+Tr.escape(Fl(this.classes))+'"'),e+=">";for(var n=0;n<this.children.length;n++)e+=this.children[n].toMarkup();return e+="</"+this.type+">",e}toText(){return this.children.map(e=>e.toText()).join("")}}class Gs{constructor(e){this.text=void 0,this.text=e}toNode(){return document.createTextNode(this.text)}toMarkup(){return Tr.escape(this.toText())}toText(){return this.text}}class ihe{constructor(e){this.width=void 0,this.character=void 0,this.width=e,e>=.05555&&e<=.05556?this.character=" ":e>=.1666&&e<=.1667?this.character=" ":e>=.2222&&e<=.2223?this.character=" ":e>=.2777&&e<=.2778?this.character="  ":e>=-.05556&&e<=-.05555?this.character=" ⁣":e>=-.1667&&e<=-.1666?this.character=" ⁣":e>=-.2223&&e<=-.2222?this.character=" ⁣":e>=-.2778&&e<=-.2777?this.character=" ⁣":this.character=null}toNode(){if(this.character)return document.createTextNode(this.character);var e=document.createElementNS("http://www.w3.org/1998/Math/MathML","mspace");return e.setAttribute("width",gt(this.width)),e}toMarkup(){return this.character?"<mtext>"+this.character+"</mtext>":'<mspace width="'+gt(this.width)+'"/>'}toText(){return this.character?this.character:" "}}var it={MathNode:Ea,TextNode:Gs,SpaceNode:ihe,newDocumentFragment:EF},rs=function(e,r,n){return Vr[r][e]&&Vr[r][e].replace&&e.charCodeAt(0)!==55349&&!(mF.hasOwnProperty(e)&&n&&(n.fontFamily&&n.fontFamily.slice(4,6)==="tt"||n.font&&n.font.slice(4,6)==="tt"))&&(e=Vr[r][e].replace),new it.TextNode(e)},oE=function(e){return e.length===1?e[0]:new it.MathNode("mrow",e)},lE=function(e,r){if(r.fontFamily==="texttt")return"monospace";if(r.fontFamily==="textsf")return r.fontShape==="textit"&&r.fontWeight==="textbf"?"sans-serif-bold-italic":r.fontShape==="textit"?"sans-serif-italic":r.fontWeight==="textbf"?"bold-sans-serif":"sans-serif";if(r.fontShape==="textit"&&r.fontWeight==="textbf")return"bold-italic";if(r.fontShape==="textit")return"italic";if(r.fontWeight==="textbf")return"bold";var n=r.font;if(!n||n==="mathnormal")return null;var i=e.mode;if(n==="mathit")return"italic";if(n==="boldsymbol")return e.type==="textord"?"bold":"bold-italic";if(n==="mathbf")return"bold";if(n==="mathbb")return"double-struck";if(n==="mathsfit")return"sans-serif-italic";if(n==="mathfrak")return"fraktur";if(n==="mathscr"||n==="mathcal")return"script";if(n==="mathsf")return"sans-serif";if(n==="mathtt")return"monospace";var a=e.text;if(["\\imath","\\jmath"].includes(a))return null;Vr[i][a]&&Vr[i][a].replace&&(a=Vr[i][a].replace);var s=Fe.fontMap[n].fontName;return iE(a,s,i)?Fe.fontMap[n].variant:null};function ob(t){if(!t)return!1;if(t.type==="mi"&&t.children.length===1){var e=t.children[0];return e instanceof Gs&&e.text==="."}else if(t.type==="mo"&&t.children.length===1&&t.getAttribute("separator")==="true"&&t.getAttribute("lspace")==="0em"&&t.getAttribute("rspace")==="0em"){var r=t.children[0];return r instanceof Gs&&r.text===","}else return!1}var pa=function(e,r,n){if(e.length===1){var i=Fr(e[0],r);return n&&i instanceof Ea&&i.type==="mo"&&(i.setAttribute("lspace","0em"),i.setAttribute("rspace","0em")),[i]}for(var a=[],s,o=0;o<e.length;o++){var l=Fr(e[o],r);if(l instanceof Ea&&s instanceof Ea){if(l.type==="mtext"&&s.type==="mtext"&&l.getAttribute("mathvariant")===s.getAttribute("mathvariant")){s.children.push(...l.children);continue}else if(l.type==="mn"&&s.type==="mn"){s.children.push(...l.children);continue}else if(ob(l)&&s.type==="mn"){s.children.push(...l.children);continue}else if(l.type==="mn"&&ob(s))l.children=[...s.children,...l.children],a.pop();else if((l.type==="msup"||l.type==="msub")&&l.children.length>=1&&(s.type==="mn"||ob(s))){var u=l.children[0];u instanceof Ea&&u.type==="mn"&&(u.children=[...s.children,...u.children],a.pop())}else if(s.type==="mi"&&s.children.length===1){var h=s.children[0];if(h instanceof Gs&&h.text==="̸"&&(l.type==="mo"||l.type==="mi"||l.type==="mn")){var d=l.children[0];d instanceof Gs&&d.text.length>0&&(d.text=d.text.slice(0,1)+"̸"+d.text.slice(1),a.pop())}}}a.push(l),s=l}return a},zl=function(e,r,n){return oE(pa(e,r,n))},Fr=function(e,r){if(!e)return new it.MathNode("mrow");if(Av[e.type]){var n=Av[e.type](e,r);return n}else throw new ot("Got group of unknown type: '"+e.type+"'")};function OC(t,e,r,n,i){var a=pa(t,r),s;a.length===1&&a[0]instanceof Ea&&["mrow","mtable"].includes(a[0].type)?s=a[0]:s=new it.MathNode("mrow",a);var o=new it.MathNode("annotation",[new it.TextNode(e)]);o.setAttribute("encoding","application/x-tex");var l=new it.MathNode("semantics",[s,o]),u=new it.MathNode("math",[l]);u.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),n&&u.setAttribute("display","block");var h=i?"katex":"katex-mathml";return Fe.makeSpan([h],[u])}var kF=function(e){return new So({style:e.displayMode?Vt.DISPLAY:Vt.TEXT,maxSize:e.maxSize,minRuleThickness:e.minRuleThickness})},SF=function(e,r){if(r.displayMode){var n=["katex-display"];r.leqno&&n.push("leqno"),r.fleqn&&n.push("fleqn"),e=Fe.makeSpan(n,[e])}return e},ahe=function(e,r,n){var i=kF(n),a;if(n.output==="mathml")return OC(e,r,i,n.displayMode,!0);if(n.output==="html"){var s=Z5(e,i);a=Fe.makeSpan(["katex"],[s])}else{var o=OC(e,r,i,n.displayMode,!1),l=Z5(e,i);a=Fe.makeSpan(["katex"],[o,l])}return SF(a,n)},she=function(e,r,n){var i=kF(n),a=Z5(e,i),s=Fe.makeSpan(["katex"],[a]);return SF(s,n)},ohe={widehat:"^",widecheck:"ˇ",widetilde:"~",utilde:"~",overleftarrow:"←",underleftarrow:"←",xleftarrow:"←",overrightarrow:"→",underrightarrow:"→",xrightarrow:"→",underbrace:"⏟",overbrace:"⏞",overgroup:"⏠",undergroup:"⏡",overleftrightarrow:"↔",underleftrightarrow:"↔",xleftrightarrow:"↔",Overrightarrow:"⇒",xRightarrow:"⇒",overleftharpoon:"↼",xleftharpoonup:"↼",overrightharpoon:"⇀",xrightharpoonup:"⇀",xLeftarrow:"⇐",xLeftrightarrow:"⇔",xhookleftarrow:"↩",xhookrightarrow:"↪",xmapsto:"↦",xrightharpoondown:"⇁",xleftharpoondown:"↽",xrightleftharpoons:"⇌",xleftrightharpoons:"⇋",xtwoheadleftarrow:"↞",xtwoheadrightarrow:"↠",xlongequal:"=",xtofrom:"⇄",xrightleftarrows:"⇄",xrightequilibrium:"⇌",xleftequilibrium:"⇋","\\cdrightarrow":"→","\\cdleftarrow":"←","\\cdlongequal":"="},lhe=function(e){var r=new it.MathNode("mo",[new it.TextNode(ohe[e.replace(/^\\/,"")])]);return r.setAttribute("stretchy","true"),r},che={overrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],overleftarrow:[["leftarrow"],.888,522,"xMinYMin"],underrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],underleftarrow:[["leftarrow"],.888,522,"xMinYMin"],xrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],"\\cdrightarrow":[["rightarrow"],3,522,"xMaxYMin"],xleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],"\\cdleftarrow":[["leftarrow"],3,522,"xMinYMin"],Overrightarrow:[["doublerightarrow"],.888,560,"xMaxYMin"],xRightarrow:[["doublerightarrow"],1.526,560,"xMaxYMin"],xLeftarrow:[["doubleleftarrow"],1.526,560,"xMinYMin"],overleftharpoon:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoonup:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoondown:[["leftharpoondown"],.888,522,"xMinYMin"],overrightharpoon:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoonup:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoondown:[["rightharpoondown"],.888,522,"xMaxYMin"],xlongequal:[["longequal"],.888,334,"xMinYMin"],"\\cdlongequal":[["longequal"],3,334,"xMinYMin"],xtwoheadleftarrow:[["twoheadleftarrow"],.888,334,"xMinYMin"],xtwoheadrightarrow:[["twoheadrightarrow"],.888,334,"xMaxYMin"],overleftrightarrow:[["leftarrow","rightarrow"],.888,522],overbrace:[["leftbrace","midbrace","rightbrace"],1.6,548],underbrace:[["leftbraceunder","midbraceunder","rightbraceunder"],1.6,548],underleftrightarrow:[["leftarrow","rightarrow"],.888,522],xleftrightarrow:[["leftarrow","rightarrow"],1.75,522],xLeftrightarrow:[["doubleleftarrow","doublerightarrow"],1.75,560],xrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],xleftrightharpoons:[["leftharpoonplus","rightharpoondownplus"],1.75,716],xhookleftarrow:[["leftarrow","righthook"],1.08,522],xhookrightarrow:[["lefthook","rightarrow"],1.08,522],overlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],underlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],overgroup:[["leftgroup","rightgroup"],.888,342],undergroup:[["leftgroupunder","rightgroupunder"],.888,342],xmapsto:[["leftmapsto","rightarrow"],1.5,522],xtofrom:[["leftToFrom","rightToFrom"],1.75,528],xrightleftarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],xrightequilibrium:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],xleftequilibrium:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716]},uhe=function(e){return e.type==="ordgroup"?e.body.length:1},hhe=function(e,r){function n(){var o=4e5,l=e.label.slice(1);if(["widehat","widecheck","widetilde","utilde"].includes(l)){var u=e,h=uhe(u.base),d,f,p;if(h>5)l==="widehat"||l==="widecheck"?(d=420,o=2364,p=.42,f=l+"4"):(d=312,o=2340,p=.34,f="tilde4");else{var g=[1,1,2,2,3,3][h];l==="widehat"||l==="widecheck"?(o=[0,1062,2364,2364,2364][g],d=[0,239,300,360,420][g],p=[0,.24,.3,.3,.36,.42][g],f=l+g):(o=[0,600,1033,2339,2340][g],d=[0,260,286,306,312][g],p=[0,.26,.286,.3,.306,.34][g],f="tilde"+g)}var m=new $l(f),v=new qo([m],{width:"100%",height:gt(p),viewBox:"0 0 "+o+" "+d,preserveAspectRatio:"none"});return{span:Fe.makeSvgSpan([],[v],r),minWidth:0,height:p}}else{var y=[],b=che[l],[w,T,E]=b,L=E/1e3,S=w.length,C,A;if(S===1){var N=b[3];C=["hide-tail"],A=[N]}else if(S===2)C=["halfarrow-left","halfarrow-right"],A=["xMinYMin","xMaxYMin"];else if(S===3)C=["brace-left","brace-center","brace-right"],A=["xMinYMin","xMidYMin","xMaxYMin"];else throw new Error(`Correct katexImagesData or update code here to support
                    `+S+" children.");for(var _=0;_<S;_++){var O=new $l(w[_]),P=new qo([O],{width:"400em",height:gt(L),viewBox:"0 0 "+o+" "+E,preserveAspectRatio:A[_]+" slice"}),k=Fe.makeSvgSpan([C[_]],[P],r);if(S===1)return{span:k,minWidth:T,height:L};k.style.height=gt(L),y.push(k)}return{span:Fe.makeSpan(["stretchy"],y,r),minWidth:T,height:L}}}var{span:i,minWidth:a,height:s}=n();return i.height=s,i.style.height=gt(s),a>0&&(i.style.minWidth=gt(a)),i},dhe=function(e,r,n,i,a){var s,o=e.height+e.depth+n+i;if(/fbox|color|angl/.test(r)){if(s=Fe.makeSpan(["stretchy",r],[],a),r==="fbox"){var l=a.color&&a.getColor();l&&(s.style.borderColor=l)}}else{var u=[];/^[bx]cancel$/.test(r)&&u.push(new X5({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(r)&&u.push(new X5({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var h=new qo(u,{width:"100%",height:gt(o)});s=Fe.makeSvgSpan([],[h],a)}return s.height=o,s.style.height=gt(o),s},Xo={encloseSpan:dhe,mathMLnode:lhe,svgSpan:hhe};function Qt(t,e){if(!t||t.type!==e)throw new Error("Expected node of type "+e+", but got "+(t?"node of type "+t.type:String(t)));return t}function cE(t){var e=p2(t);if(!e)throw new Error("Expected node of symbol group type, but got "+(t?"node of type "+t.type:String(t)));return e}function p2(t){return t&&(t.type==="atom"||Bue.hasOwnProperty(t.type))?t:null}var uE=(t,e)=>{var r,n,i;t&&t.type==="supsub"?(n=Qt(t.base,"accent"),r=n.base,t.base=r,i=Oue(yr(t,e)),t.base=n):(n=Qt(t,"accent"),r=n.base);var a=yr(r,e.havingCrampedStyle()),s=n.isShifty&&Tr.isCharacterBox(r),o=0;if(s){var l=Tr.getBaseElem(r),u=yr(l,e.havingCrampedStyle());o=_C(u).skew}var h=n.label==="\\c",d=h?a.height+a.depth:Math.min(a.height,e.fontMetrics().xHeight),f;if(n.isStretchy)f=Xo.svgSpan(n,e),f=Fe.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"elem",elem:f,wrapperClasses:["svg-align"],wrapperStyle:o>0?{width:"calc(100% - "+gt(2*o)+")",marginLeft:gt(2*o)}:void 0}]},e);else{var p,g;n.label==="\\vec"?(p=Fe.staticSvg("vec",e),g=Fe.svgData.vec[1]):(p=Fe.makeOrd({mode:n.mode,text:n.label},e,"textord"),p=_C(p),p.italic=0,g=p.width,h&&(d+=p.depth)),f=Fe.makeSpan(["accent-body"],[p]);var m=n.label==="\\textcircled";m&&(f.classes.push("accent-full"),d=a.height);var v=o;m||(v-=g/2),f.style.left=gt(v),n.label==="\\textcircled"&&(f.style.top=".2em"),f=Fe.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"kern",size:-d},{type:"elem",elem:f}]},e)}var y=Fe.makeSpan(["mord","accent"],[f],e);return i?(i.children[0]=y,i.height=Math.max(y.height,i.height),i.classes[0]="mord",i):y},CF=(t,e)=>{var r=t.isStretchy?Xo.mathMLnode(t.label):new it.MathNode("mo",[rs(t.label,t.mode)]),n=new it.MathNode("mover",[Fr(t.base,e),r]);return n.setAttribute("accent","true"),n},fhe=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(t=>"\\"+t).join("|"));Et({type:"accent",names:["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring","\\widecheck","\\widehat","\\widetilde","\\overrightarrow","\\overleftarrow","\\Overrightarrow","\\overleftrightarrow","\\overgroup","\\overlinesegment","\\overleftharpoon","\\overrightharpoon"],props:{numArgs:1},handler:(t,e)=>{var r=_v(e[0]),n=!fhe.test(t.funcName),i=!n||t.funcName==="\\widehat"||t.funcName==="\\widetilde"||t.funcName==="\\widecheck";return{type:"accent",mode:t.parser.mode,label:t.funcName,isStretchy:n,isShifty:i,base:r}},htmlBuilder:uE,mathmlBuilder:CF});Et({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"]},handler:(t,e)=>{var r=e[0],n=t.parser.mode;return n==="math"&&(t.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+t.funcName+" works only in text mode"),n="text"),{type:"accent",mode:n,label:t.funcName,isStretchy:!1,isShifty:!0,base:r}},htmlBuilder:uE,mathmlBuilder:CF});Et({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:(t,e)=>{var{parser:r,funcName:n}=t,i=e[0];return{type:"accentUnder",mode:r.mode,label:n,base:i}},htmlBuilder:(t,e)=>{var r=yr(t.base,e),n=Xo.svgSpan(t,e),i=t.label==="\\utilde"?.12:0,a=Fe.makeVList({positionType:"top",positionData:r.height,children:[{type:"elem",elem:n,wrapperClasses:["svg-align"]},{type:"kern",size:i},{type:"elem",elem:r}]},e);return Fe.makeSpan(["mord","accentunder"],[a],e)},mathmlBuilder:(t,e)=>{var r=Xo.mathMLnode(t.label),n=new it.MathNode("munder",[Fr(t.base,e),r]);return n.setAttribute("accentunder","true"),n}});var Wg=t=>{var e=new it.MathNode("mpadded",t?[t]:[]);return e.setAttribute("width","+0.6em"),e.setAttribute("lspace","0.3em"),e};Et({type:"xArrow",names:["\\xleftarrow","\\xrightarrow","\\xLeftarrow","\\xRightarrow","\\xleftrightarrow","\\xLeftrightarrow","\\xhookleftarrow","\\xhookrightarrow","\\xmapsto","\\xrightharpoondown","\\xrightharpoonup","\\xleftharpoondown","\\xleftharpoonup","\\xrightleftharpoons","\\xleftrightharpoons","\\xlongequal","\\xtwoheadrightarrow","\\xtwoheadleftarrow","\\xtofrom","\\xrightleftarrows","\\xrightequilibrium","\\xleftequilibrium","\\\\cdrightarrow","\\\\cdleftarrow","\\\\cdlongequal"],props:{numArgs:1,numOptionalArgs:1},handler(t,e,r){var{parser:n,funcName:i}=t;return{type:"xArrow",mode:n.mode,label:i,body:e[0],below:r[0]}},htmlBuilder(t,e){var r=e.style,n=e.havingStyle(r.sup()),i=Fe.wrapFragment(yr(t.body,n,e),e),a=t.label.slice(0,2)==="\\x"?"x":"cd";i.classes.push(a+"-arrow-pad");var s;t.below&&(n=e.havingStyle(r.sub()),s=Fe.wrapFragment(yr(t.below,n,e),e),s.classes.push(a+"-arrow-pad"));var o=Xo.svgSpan(t,e),l=-e.fontMetrics().axisHeight+.5*o.height,u=-e.fontMetrics().axisHeight-.5*o.height-.111;(i.depth>.25||t.label==="\\xleftequilibrium")&&(u-=i.depth);var h;if(s){var d=-e.fontMetrics().axisHeight+s.height+.5*o.height+.111;h=Fe.makeVList({positionType:"individualShift",children:[{type:"elem",elem:i,shift:u},{type:"elem",elem:o,shift:l},{type:"elem",elem:s,shift:d}]},e)}else h=Fe.makeVList({positionType:"individualShift",children:[{type:"elem",elem:i,shift:u},{type:"elem",elem:o,shift:l}]},e);return h.children[0].children[0].children[1].classes.push("svg-align"),Fe.makeSpan(["mrel","x-arrow"],[h],e)},mathmlBuilder(t,e){var r=Xo.mathMLnode(t.label);r.setAttribute("minsize",t.label.charAt(0)==="x"?"1.75em":"3.0em");var n;if(t.body){var i=Wg(Fr(t.body,e));if(t.below){var a=Wg(Fr(t.below,e));n=new it.MathNode("munderover",[r,a,i])}else n=new it.MathNode("mover",[r,i])}else if(t.below){var s=Wg(Fr(t.below,e));n=new it.MathNode("munder",[r,s])}else n=Wg(),n=new it.MathNode("mover",[r,n]);return n}});var phe=Fe.makeSpan;function AF(t,e){var r=Bn(t.body,e,!0);return phe([t.mclass],r,e)}function _F(t,e){var r,n=pa(t.body,e);return t.mclass==="minner"?r=new it.MathNode("mpadded",n):t.mclass==="mord"?t.isCharacterBox?(r=n[0],r.type="mi"):r=new it.MathNode("mi",n):(t.isCharacterBox?(r=n[0],r.type="mo"):r=new it.MathNode("mo",n),t.mclass==="mbin"?(r.attributes.lspace="0.22em",r.attributes.rspace="0.22em"):t.mclass==="mpunct"?(r.attributes.lspace="0em",r.attributes.rspace="0.17em"):t.mclass==="mopen"||t.mclass==="mclose"?(r.attributes.lspace="0em",r.attributes.rspace="0em"):t.mclass==="minner"&&(r.attributes.lspace="0.0556em",r.attributes.width="+0.1111em")),r}Et({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],props:{numArgs:1,primitive:!0},handler(t,e){var{parser:r,funcName:n}=t,i=e[0];return{type:"mclass",mode:r.mode,mclass:"m"+n.slice(5),body:yn(i),isCharacterBox:Tr.isCharacterBox(i)}},htmlBuilder:AF,mathmlBuilder:_F});var g2=t=>{var e=t.type==="ordgroup"&&t.body.length?t.body[0]:t;return e.type==="atom"&&(e.family==="bin"||e.family==="rel")?"m"+e.family:"mord"};Et({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler(t,e){var{parser:r}=t;return{type:"mclass",mode:r.mode,mclass:g2(e[0]),body:yn(e[1]),isCharacterBox:Tr.isCharacterBox(e[1])}}});Et({type:"mclass",names:["\\stackrel","\\overset","\\underset"],props:{numArgs:2},handler(t,e){var{parser:r,funcName:n}=t,i=e[1],a=e[0],s;n!=="\\stackrel"?s=g2(i):s="mrel";var o={type:"op",mode:i.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:n!=="\\stackrel",body:yn(i)},l={type:"supsub",mode:a.mode,base:o,sup:n==="\\underset"?null:a,sub:n==="\\underset"?a:null};return{type:"mclass",mode:r.mode,mclass:s,body:[l],isCharacterBox:Tr.isCharacterBox(l)}},htmlBuilder:AF,mathmlBuilder:_F});Et({type:"pmb",names:["\\pmb"],props:{numArgs:1,allowedInText:!0},handler(t,e){var{parser:r}=t;return{type:"pmb",mode:r.mode,mclass:g2(e[0]),body:yn(e[0])}},htmlBuilder(t,e){var r=Bn(t.body,e,!0),n=Fe.makeSpan([t.mclass],r,e);return n.style.textShadow="0.02em 0.01em 0.04px",n},mathmlBuilder(t,e){var r=pa(t.body,e),n=new it.MathNode("mstyle",r);return n.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),n}});var ghe={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},PC=()=>({type:"styling",body:[],mode:"math",style:"display"}),BC=t=>t.type==="textord"&&t.text==="@",mhe=(t,e)=>(t.type==="mathord"||t.type==="atom")&&t.text===e;function vhe(t,e,r){var n=ghe[t];switch(n){case"\\\\cdrightarrow":case"\\\\cdleftarrow":return r.callFunction(n,[e[0]],[e[1]]);case"\\uparrow":case"\\downarrow":{var i=r.callFunction("\\\\cdleft",[e[0]],[]),a={type:"atom",text:n,mode:"math",family:"rel"},s=r.callFunction("\\Big",[a],[]),o=r.callFunction("\\\\cdright",[e[1]],[]),l={type:"ordgroup",mode:"math",body:[i,s,o]};return r.callFunction("\\\\cdparent",[l],[])}case"\\\\cdlongequal":return r.callFunction("\\\\cdlongequal",[],[]);case"\\Vert":{var u={type:"textord",text:"\\Vert",mode:"math"};return r.callFunction("\\Big",[u],[])}default:return{type:"textord",text:" ",mode:"math"}}}function yhe(t){var e=[];for(t.gullet.beginGroup(),t.gullet.macros.set("\\cr","\\\\\\relax"),t.gullet.beginGroup();;){e.push(t.parseExpression(!1,"\\\\")),t.gullet.endGroup(),t.gullet.beginGroup();var r=t.fetch().text;if(r==="&"||r==="\\\\")t.consume();else if(r==="\\end"){e[e.length-1].length===0&&e.pop();break}else throw new ot("Expected \\\\ or \\cr or \\end",t.nextToken)}for(var n=[],i=[n],a=0;a<e.length;a++){for(var s=e[a],o=PC(),l=0;l<s.length;l++)if(!BC(s[l]))o.body.push(s[l]);else{n.push(o),l+=1;var u=cE(s[l]).text,h=new Array(2);if(h[0]={type:"ordgroup",mode:"math",body:[]},h[1]={type:"ordgroup",mode:"math",body:[]},!("=|.".indexOf(u)>-1))if("<>AV".indexOf(u)>-1)for(var d=0;d<2;d++){for(var f=!0,p=l+1;p<s.length;p++){if(mhe(s[p],u)){f=!1,l=p;break}if(BC(s[p]))throw new ot("Missing a "+u+" character to complete a CD arrow.",s[p]);h[d].body.push(s[p])}if(f)throw new ot("Missing a "+u+" character to complete a CD arrow.",s[l])}else throw new ot('Expected one of "<>AV=|." after @',s[l]);var g=vhe(u,h,t),m={type:"styling",body:[g],mode:"math",style:"display"};n.push(m),o=PC()}a%2===0?n.push(o):n.shift(),n=[],i.push(n)}t.gullet.endGroup(),t.gullet.endGroup();var v=new Array(i[0].length).fill({type:"align",align:"c",pregap:.25,postgap:.25});return{type:"array",mode:"math",body:i,arraystretch:1,addJot:!0,rowGaps:[null],cols:v,colSeparationType:"CD",hLinesBeforeRow:new Array(i.length+1).fill([])}}Et({type:"cdlabel",names:["\\\\cdleft","\\\\cdright"],props:{numArgs:1},handler(t,e){var{parser:r,funcName:n}=t;return{type:"cdlabel",mode:r.mode,side:n.slice(4),label:e[0]}},htmlBuilder(t,e){var r=e.havingStyle(e.style.sup()),n=Fe.wrapFragment(yr(t.label,r,e),e);return n.classes.push("cd-label-"+t.side),n.style.bottom=gt(.8-n.depth),n.height=0,n.depth=0,n},mathmlBuilder(t,e){var r=new it.MathNode("mrow",[Fr(t.label,e)]);return r=new it.MathNode("mpadded",[r]),r.setAttribute("width","0"),t.side==="left"&&r.setAttribute("lspace","-1width"),r.setAttribute("voffset","0.7em"),r=new it.MathNode("mstyle",[r]),r.setAttribute("displaystyle","false"),r.setAttribute("scriptlevel","1"),r}});Et({type:"cdlabelparent",names:["\\\\cdparent"],props:{numArgs:1},handler(t,e){var{parser:r}=t;return{type:"cdlabelparent",mode:r.mode,fragment:e[0]}},htmlBuilder(t,e){var r=Fe.wrapFragment(yr(t.fragment,e),e);return r.classes.push("cd-vert-arrow"),r},mathmlBuilder(t,e){return new it.MathNode("mrow",[Fr(t.fragment,e)])}});Et({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler(t,e){for(var{parser:r}=t,n=Qt(e[0],"ordgroup"),i=n.body,a="",s=0;s<i.length;s++){var o=Qt(i[s],"textord");a+=o.text}var l=parseInt(a),u;if(isNaN(l))throw new ot("\\@char has non-numeric argument "+a);if(l<0||l>=1114111)throw new ot("\\@char with invalid code point "+a);return l<=65535?u=String.fromCharCode(l):(l-=65536,u=String.fromCharCode((l>>10)+55296,(l&1023)+56320)),{type:"textord",mode:r.mode,text:u}}});var LF=(t,e)=>{var r=Bn(t.body,e.withColor(t.color),!1);return Fe.makeFragment(r)},RF=(t,e)=>{var r=pa(t.body,e.withColor(t.color)),n=new it.MathNode("mstyle",r);return n.setAttribute("mathcolor",t.color),n};Et({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,argTypes:["color","original"]},handler(t,e){var{parser:r}=t,n=Qt(e[0],"color-token").color,i=e[1];return{type:"color",mode:r.mode,color:n,body:yn(i)}},htmlBuilder:LF,mathmlBuilder:RF});Et({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,argTypes:["color"]},handler(t,e){var{parser:r,breakOnTokenText:n}=t,i=Qt(e[0],"color-token").color;r.gullet.macros.set("\\current@color",i);var a=r.parseExpression(!0,n);return{type:"color",mode:r.mode,color:i,body:a}},htmlBuilder:LF,mathmlBuilder:RF});Et({type:"cr",names:["\\\\"],props:{numArgs:0,numOptionalArgs:0,allowedInText:!0},handler(t,e,r){var{parser:n}=t,i=n.gullet.future().text==="["?n.parseSizeGroup(!0):null,a=!n.settings.displayMode||!n.settings.useStrictBehavior("newLineInDisplayMode","In LaTeX, \\\\ or \\newline does nothing in display mode");return{type:"cr",mode:n.mode,newLine:a,size:i&&Qt(i,"size").value}},htmlBuilder(t,e){var r=Fe.makeSpan(["mspace"],[],e);return t.newLine&&(r.classes.push("newline"),t.size&&(r.style.marginTop=gt(en(t.size,e)))),r},mathmlBuilder(t,e){var r=new it.MathNode("mspace");return t.newLine&&(r.setAttribute("linebreak","newline"),t.size&&r.setAttribute("height",gt(en(t.size,e)))),r}});var Q5={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},NF=t=>{var e=t.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(e))throw new ot("Expected a control sequence",t);return e},xhe=t=>{var e=t.gullet.popToken();return e.text==="="&&(e=t.gullet.popToken(),e.text===" "&&(e=t.gullet.popToken())),e},DF=(t,e,r,n)=>{var i=t.gullet.macros.get(r.text);i==null&&(r.noexpand=!0,i={tokens:[r],numArgs:0,unexpandable:!t.gullet.isExpandable(r.text)}),t.gullet.macros.set(e,i,n)};Et({type:"internal",names:["\\global","\\long","\\\\globallong"],props:{numArgs:0,allowedInText:!0},handler(t){var{parser:e,funcName:r}=t;e.consumeSpaces();var n=e.fetch();if(Q5[n.text])return(r==="\\global"||r==="\\\\globallong")&&(n.text=Q5[n.text]),Qt(e.parseFunction(),"internal");throw new ot("Invalid token after macro prefix",n)}});Et({type:"internal",names:["\\def","\\gdef","\\edef","\\xdef"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t){var{parser:e,funcName:r}=t,n=e.gullet.popToken(),i=n.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(i))throw new ot("Expected a control sequence",n);for(var a=0,s,o=[[]];e.gullet.future().text!=="{";)if(n=e.gullet.popToken(),n.text==="#"){if(e.gullet.future().text==="{"){s=e.gullet.future(),o[a].push("{");break}if(n=e.gullet.popToken(),!/^[1-9]$/.test(n.text))throw new ot('Invalid argument number "'+n.text+'"');if(parseInt(n.text)!==a+1)throw new ot('Argument number "'+n.text+'" out of order');a++,o.push([])}else{if(n.text==="EOF")throw new ot("Expected a macro definition");o[a].push(n.text)}var{tokens:l}=e.gullet.consumeArg();return s&&l.unshift(s),(r==="\\edef"||r==="\\xdef")&&(l=e.gullet.expandTokens(l),l.reverse()),e.gullet.macros.set(i,{tokens:l,numArgs:a,delimiters:o},r===Q5[r]),{type:"internal",mode:e.mode}}});Et({type:"internal",names:["\\let","\\\\globallet"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t){var{parser:e,funcName:r}=t,n=NF(e.gullet.popToken());e.gullet.consumeSpaces();var i=xhe(e);return DF(e,n,i,r==="\\\\globallet"),{type:"internal",mode:e.mode}}});Et({type:"internal",names:["\\futurelet","\\\\globalfuture"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t){var{parser:e,funcName:r}=t,n=NF(e.gullet.popToken()),i=e.gullet.popToken(),a=e.gullet.popToken();return DF(e,n,a,r==="\\\\globalfuture"),e.gullet.pushToken(a),e.gullet.pushToken(i),{type:"internal",mode:e.mode}}});var Sf=function(e,r,n){var i=Vr.math[e]&&Vr.math[e].replace,a=iE(i||e,r,n);if(!a)throw new Error("Unsupported symbol "+e+" and font size "+r+".");return a},hE=function(e,r,n,i){var a=n.havingBaseStyle(r),s=Fe.makeSpan(i.concat(a.sizingClasses(n)),[e],n),o=a.sizeMultiplier/n.sizeMultiplier;return s.height*=o,s.depth*=o,s.maxFontSize=a.sizeMultiplier,s},MF=function(e,r,n){var i=r.havingBaseStyle(n),a=(1-r.sizeMultiplier/i.sizeMultiplier)*r.fontMetrics().axisHeight;e.classes.push("delimcenter"),e.style.top=gt(a),e.height-=a,e.depth+=a},bhe=function(e,r,n,i,a,s){var o=Fe.makeSymbol(e,"Main-Regular",a,i),l=hE(o,r,i,s);return n&&MF(l,i,r),l},whe=function(e,r,n,i){return Fe.makeSymbol(e,"Size"+r+"-Regular",n,i)},IF=function(e,r,n,i,a,s){var o=whe(e,r,a,i),l=hE(Fe.makeSpan(["delimsizing","size"+r],[o],i),Vt.TEXT,i,s);return n&&MF(l,i,Vt.TEXT),l},lb=function(e,r,n){var i;r==="Size1-Regular"?i="delim-size1":i="delim-size4";var a=Fe.makeSpan(["delimsizinginner",i],[Fe.makeSpan([],[Fe.makeSymbol(e,r,n)])]);return{type:"elem",elem:a}},cb=function(e,r,n){var i=Vs["Size4-Regular"][e.charCodeAt(0)]?Vs["Size4-Regular"][e.charCodeAt(0)][4]:Vs["Size1-Regular"][e.charCodeAt(0)][4],a=new $l("inner",Aue(e,Math.round(1e3*r))),s=new qo([a],{width:gt(i),height:gt(r),style:"width:"+gt(i),viewBox:"0 0 "+1e3*i+" "+Math.round(1e3*r),preserveAspectRatio:"xMinYMin"}),o=Fe.makeSvgSpan([],[s],n);return o.height=r,o.style.height=gt(r),o.style.width=gt(i),{type:"elem",elem:o}},J5=.008,Hg={type:"kern",size:-1*J5},The=["|","\\lvert","\\rvert","\\vert"],Ehe=["\\|","\\lVert","\\rVert","\\Vert"],OF=function(e,r,n,i,a,s){var o,l,u,h,d="",f=0;o=u=h=e,l=null;var p="Size1-Regular";e==="\\uparrow"?u=h="⏐":e==="\\Uparrow"?u=h="‖":e==="\\downarrow"?o=u="⏐":e==="\\Downarrow"?o=u="‖":e==="\\updownarrow"?(o="\\uparrow",u="⏐",h="\\downarrow"):e==="\\Updownarrow"?(o="\\Uparrow",u="‖",h="\\Downarrow"):The.includes(e)?(u="∣",d="vert",f=333):Ehe.includes(e)?(u="∥",d="doublevert",f=556):e==="["||e==="\\lbrack"?(o="⎡",u="⎢",h="⎣",p="Size4-Regular",d="lbrack",f=667):e==="]"||e==="\\rbrack"?(o="⎤",u="⎥",h="⎦",p="Size4-Regular",d="rbrack",f=667):e==="\\lfloor"||e==="⌊"?(u=o="⎢",h="⎣",p="Size4-Regular",d="lfloor",f=667):e==="\\lceil"||e==="⌈"?(o="⎡",u=h="⎢",p="Size4-Regular",d="lceil",f=667):e==="\\rfloor"||e==="⌋"?(u=o="⎥",h="⎦",p="Size4-Regular",d="rfloor",f=667):e==="\\rceil"||e==="⌉"?(o="⎤",u=h="⎥",p="Size4-Regular",d="rceil",f=667):e==="("||e==="\\lparen"?(o="⎛",u="⎜",h="⎝",p="Size4-Regular",d="lparen",f=875):e===")"||e==="\\rparen"?(o="⎞",u="⎟",h="⎠",p="Size4-Regular",d="rparen",f=875):e==="\\{"||e==="\\lbrace"?(o="⎧",l="⎨",h="⎩",u="⎪",p="Size4-Regular"):e==="\\}"||e==="\\rbrace"?(o="⎫",l="⎬",h="⎭",u="⎪",p="Size4-Regular"):e==="\\lgroup"||e==="⟮"?(o="⎧",h="⎩",u="⎪",p="Size4-Regular"):e==="\\rgroup"||e==="⟯"?(o="⎫",h="⎭",u="⎪",p="Size4-Regular"):e==="\\lmoustache"||e==="⎰"?(o="⎧",h="⎭",u="⎪",p="Size4-Regular"):(e==="\\rmoustache"||e==="⎱")&&(o="⎫",h="⎩",u="⎪",p="Size4-Regular");var g=Sf(o,p,a),m=g.height+g.depth,v=Sf(u,p,a),y=v.height+v.depth,b=Sf(h,p,a),w=b.height+b.depth,T=0,E=1;if(l!==null){var L=Sf(l,p,a);T=L.height+L.depth,E=2}var S=m+w+T,C=Math.max(0,Math.ceil((r-S)/(E*y))),A=S+C*E*y,N=i.fontMetrics().axisHeight;n&&(N*=i.sizeMultiplier);var _=A/2-N,O=[];if(d.length>0){var P=A-m-w,k=Math.round(A*1e3),R=_ue(d,Math.round(P*1e3)),I=new $l(d,R),M=(f/1e3).toFixed(3)+"em",D=(k/1e3).toFixed(3)+"em",B=new qo([I],{width:M,height:D,viewBox:"0 0 "+f+" "+k}),$=Fe.makeSvgSpan([],[B],i);$.height=k/1e3,$.style.width=M,$.style.height=D,O.push({type:"elem",elem:$})}else{if(O.push(lb(h,p,a)),O.push(Hg),l===null){var F=A-m-w+2*J5;O.push(cb(u,F,i))}else{var G=(A-m-w-T)/2+2*J5;O.push(cb(u,G,i)),O.push(Hg),O.push(lb(l,p,a)),O.push(Hg),O.push(cb(u,G,i))}O.push(Hg),O.push(lb(o,p,a))}var W=i.havingBaseStyle(Vt.TEXT),J=Fe.makeVList({positionType:"bottom",positionData:_,children:O},W);return hE(Fe.makeSpan(["delimsizing","mult"],[J],W),Vt.TEXT,i,s)},ub=80,hb=.08,db=function(e,r,n,i,a){var s=Cue(e,i,n),o=new $l(e,s),l=new qo([o],{width:"400em",height:gt(r),viewBox:"0 0 400000 "+n,preserveAspectRatio:"xMinYMin slice"});return Fe.makeSvgSpan(["hide-tail"],[l],a)},khe=function(e,r){var n=r.havingBaseSizing(),i=$F("\\surd",e*n.sizeMultiplier,FF,n),a=n.sizeMultiplier,s=Math.max(0,r.minRuleThickness-r.fontMetrics().sqrtRuleThickness),o,l=0,u=0,h=0,d;return i.type==="small"?(h=1e3+1e3*s+ub,e<1?a=1:e<1.4&&(a=.7),l=(1+s+hb)/a,u=(1+s)/a,o=db("sqrtMain",l,h,s,r),o.style.minWidth="0.853em",d=.833/a):i.type==="large"?(h=(1e3+ub)*S0[i.size],u=(S0[i.size]+s)/a,l=(S0[i.size]+s+hb)/a,o=db("sqrtSize"+i.size,l,h,s,r),o.style.minWidth="1.02em",d=1/a):(l=e+s+hb,u=e+s,h=Math.floor(1e3*e+s)+ub,o=db("sqrtTall",l,h,s,r),o.style.minWidth="0.742em",d=1.056),o.height=u,o.style.height=gt(l),{span:o,advanceWidth:d,ruleWidth:(r.fontMetrics().sqrtRuleThickness+s)*a}},PF=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","\\surd"],She=["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱"],BF=["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"],S0=[0,1.2,1.8,2.4,3],Che=function(e,r,n,i,a){if(e==="<"||e==="\\lt"||e==="⟨"?e="\\langle":(e===">"||e==="\\gt"||e==="⟩")&&(e="\\rangle"),PF.includes(e)||BF.includes(e))return IF(e,r,!1,n,i,a);if(She.includes(e))return OF(e,S0[r],!1,n,i,a);throw new ot("Illegal delimiter: '"+e+"'")},Ahe=[{type:"small",style:Vt.SCRIPTSCRIPT},{type:"small",style:Vt.SCRIPT},{type:"small",style:Vt.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],_he=[{type:"small",style:Vt.SCRIPTSCRIPT},{type:"small",style:Vt.SCRIPT},{type:"small",style:Vt.TEXT},{type:"stack"}],FF=[{type:"small",style:Vt.SCRIPTSCRIPT},{type:"small",style:Vt.SCRIPT},{type:"small",style:Vt.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],Lhe=function(e){if(e.type==="small")return"Main-Regular";if(e.type==="large")return"Size"+e.size+"-Regular";if(e.type==="stack")return"Size4-Regular";throw new Error("Add support for delim type '"+e.type+"' here.")},$F=function(e,r,n,i){for(var a=Math.min(2,3-i.style.size),s=a;s<n.length&&n[s].type!=="stack";s++){var o=Sf(e,Lhe(n[s]),"math"),l=o.height+o.depth;if(n[s].type==="small"){var u=i.havingBaseStyle(n[s].style);l*=u.sizeMultiplier}if(l>r)return n[s]}return n[n.length-1]},zF=function(e,r,n,i,a,s){e==="<"||e==="\\lt"||e==="⟨"?e="\\langle":(e===">"||e==="\\gt"||e==="⟩")&&(e="\\rangle");var o;BF.includes(e)?o=Ahe:PF.includes(e)?o=FF:o=_he;var l=$F(e,r,o,i);return l.type==="small"?bhe(e,l.style,n,i,a,s):l.type==="large"?IF(e,l.size,n,i,a,s):OF(e,r,n,i,a,s)},Rhe=function(e,r,n,i,a,s){var o=i.fontMetrics().axisHeight*i.sizeMultiplier,l=901,u=5/i.fontMetrics().ptPerEm,h=Math.max(r-o,n+o),d=Math.max(h/500*l,2*h-u);return zF(e,d,!0,i,a,s)},$o={sqrtImage:khe,sizedDelim:Che,sizeToMaxHeight:S0,customSizedDelim:zF,leftRightDelim:Rhe},FC={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}},Nhe=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","<",">","\\langle","⟨","\\rangle","⟩","\\lt","\\gt","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱","/","\\backslash","|","\\vert","\\|","\\Vert","\\uparrow","\\Uparrow","\\downarrow","\\Downarrow","\\updownarrow","\\Updownarrow","."];function m2(t,e){var r=p2(t);if(r&&Nhe.includes(r.text))return r;throw r?new ot("Invalid delimiter '"+r.text+"' after '"+e.funcName+"'",t):new ot("Invalid delimiter type '"+t.type+"'",t)}Et({type:"delimsizing",names:["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],props:{numArgs:1,argTypes:["primitive"]},handler:(t,e)=>{var r=m2(e[0],t);return{type:"delimsizing",mode:t.parser.mode,size:FC[t.funcName].size,mclass:FC[t.funcName].mclass,delim:r.text}},htmlBuilder:(t,e)=>t.delim==="."?Fe.makeSpan([t.mclass]):$o.sizedDelim(t.delim,t.size,e,t.mode,[t.mclass]),mathmlBuilder:t=>{var e=[];t.delim!=="."&&e.push(rs(t.delim,t.mode));var r=new it.MathNode("mo",e);t.mclass==="mopen"||t.mclass==="mclose"?r.setAttribute("fence","true"):r.setAttribute("fence","false"),r.setAttribute("stretchy","true");var n=gt($o.sizeToMaxHeight[t.size]);return r.setAttribute("minsize",n),r.setAttribute("maxsize",n),r}});function $C(t){if(!t.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}Et({type:"leftright-right",names:["\\right"],props:{numArgs:1,primitive:!0},handler:(t,e)=>{var r=t.parser.gullet.macros.get("\\current@color");if(r&&typeof r!="string")throw new ot("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:t.parser.mode,delim:m2(e[0],t).text,color:r}}});Et({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:(t,e)=>{var r=m2(e[0],t),n=t.parser;++n.leftrightDepth;var i=n.parseExpression(!1);--n.leftrightDepth,n.expect("\\right",!1);var a=Qt(n.parseFunction(),"leftright-right");return{type:"leftright",mode:n.mode,body:i,left:r.text,right:a.delim,rightColor:a.color}},htmlBuilder:(t,e)=>{$C(t);for(var r=Bn(t.body,e,!0,["mopen","mclose"]),n=0,i=0,a=!1,s=0;s<r.length;s++)r[s].isMiddle?a=!0:(n=Math.max(r[s].height,n),i=Math.max(r[s].depth,i));n*=e.sizeMultiplier,i*=e.sizeMultiplier;var o;if(t.left==="."?o=J0(e,["mopen"]):o=$o.leftRightDelim(t.left,n,i,e,t.mode,["mopen"]),r.unshift(o),a)for(var l=1;l<r.length;l++){var u=r[l],h=u.isMiddle;h&&(r[l]=$o.leftRightDelim(h.delim,n,i,h.options,t.mode,[]))}var d;if(t.right===".")d=J0(e,["mclose"]);else{var f=t.rightColor?e.withColor(t.rightColor):e;d=$o.leftRightDelim(t.right,n,i,f,t.mode,["mclose"])}return r.push(d),Fe.makeSpan(["minner"],r,e)},mathmlBuilder:(t,e)=>{$C(t);var r=pa(t.body,e);if(t.left!=="."){var n=new it.MathNode("mo",[rs(t.left,t.mode)]);n.setAttribute("fence","true"),r.unshift(n)}if(t.right!=="."){var i=new it.MathNode("mo",[rs(t.right,t.mode)]);i.setAttribute("fence","true"),t.rightColor&&i.setAttribute("mathcolor",t.rightColor),r.push(i)}return oE(r)}});Et({type:"middle",names:["\\middle"],props:{numArgs:1,primitive:!0},handler:(t,e)=>{var r=m2(e[0],t);if(!t.parser.leftrightDepth)throw new ot("\\middle without preceding \\left",r);return{type:"middle",mode:t.parser.mode,delim:r.text}},htmlBuilder:(t,e)=>{var r;if(t.delim===".")r=J0(e,[]);else{r=$o.sizedDelim(t.delim,1,e,t.mode,[]);var n={delim:t.delim,options:e};r.isMiddle=n}return r},mathmlBuilder:(t,e)=>{var r=t.delim==="\\vert"||t.delim==="|"?rs("|","text"):rs(t.delim,t.mode),n=new it.MathNode("mo",[r]);return n.setAttribute("fence","true"),n.setAttribute("lspace","0.05em"),n.setAttribute("rspace","0.05em"),n}});var dE=(t,e)=>{var r=Fe.wrapFragment(yr(t.body,e),e),n=t.label.slice(1),i=e.sizeMultiplier,a,s=0,o=Tr.isCharacterBox(t.body);if(n==="sout")a=Fe.makeSpan(["stretchy","sout"]),a.height=e.fontMetrics().defaultRuleThickness/i,s=-.5*e.fontMetrics().xHeight;else if(n==="phase"){var l=en({number:.6,unit:"pt"},e),u=en({number:.35,unit:"ex"},e),h=e.havingBaseSizing();i=i/h.sizeMultiplier;var d=r.height+r.depth+l+u;r.style.paddingLeft=gt(d/2+l);var f=Math.floor(1e3*d*i),p=kue(f),g=new qo([new $l("phase",p)],{width:"400em",height:gt(f/1e3),viewBox:"0 0 400000 "+f,preserveAspectRatio:"xMinYMin slice"});a=Fe.makeSvgSpan(["hide-tail"],[g],e),a.style.height=gt(d),s=r.depth+l+u}else{/cancel/.test(n)?o||r.classes.push("cancel-pad"):n==="angl"?r.classes.push("anglpad"):r.classes.push("boxpad");var m=0,v=0,y=0;/box/.test(n)?(y=Math.max(e.fontMetrics().fboxrule,e.minRuleThickness),m=e.fontMetrics().fboxsep+(n==="colorbox"?0:y),v=m):n==="angl"?(y=Math.max(e.fontMetrics().defaultRuleThickness,e.minRuleThickness),m=4*y,v=Math.max(0,.25-r.depth)):(m=o?.2:0,v=m),a=Xo.encloseSpan(r,n,m,v,e),/fbox|boxed|fcolorbox/.test(n)?(a.style.borderStyle="solid",a.style.borderWidth=gt(y)):n==="angl"&&y!==.049&&(a.style.borderTopWidth=gt(y),a.style.borderRightWidth=gt(y)),s=r.depth+v,t.backgroundColor&&(a.style.backgroundColor=t.backgroundColor,t.borderColor&&(a.style.borderColor=t.borderColor))}var b;if(t.backgroundColor)b=Fe.makeVList({positionType:"individualShift",children:[{type:"elem",elem:a,shift:s},{type:"elem",elem:r,shift:0}]},e);else{var w=/cancel|phase/.test(n)?["svg-align"]:[];b=Fe.makeVList({positionType:"individualShift",children:[{type:"elem",elem:r,shift:0},{type:"elem",elem:a,shift:s,wrapperClasses:w}]},e)}return/cancel/.test(n)&&(b.height=r.height,b.depth=r.depth),/cancel/.test(n)&&!o?Fe.makeSpan(["mord","cancel-lap"],[b],e):Fe.makeSpan(["mord"],[b],e)},fE=(t,e)=>{var r=0,n=new it.MathNode(t.label.indexOf("colorbox")>-1?"mpadded":"menclose",[Fr(t.body,e)]);switch(t.label){case"\\cancel":n.setAttribute("notation","updiagonalstrike");break;case"\\bcancel":n.setAttribute("notation","downdiagonalstrike");break;case"\\phase":n.setAttribute("notation","phasorangle");break;case"\\sout":n.setAttribute("notation","horizontalstrike");break;case"\\fbox":n.setAttribute("notation","box");break;case"\\angl":n.setAttribute("notation","actuarial");break;case"\\fcolorbox":case"\\colorbox":if(r=e.fontMetrics().fboxsep*e.fontMetrics().ptPerEm,n.setAttribute("width","+"+2*r+"pt"),n.setAttribute("height","+"+2*r+"pt"),n.setAttribute("lspace",r+"pt"),n.setAttribute("voffset",r+"pt"),t.label==="\\fcolorbox"){var i=Math.max(e.fontMetrics().fboxrule,e.minRuleThickness);n.setAttribute("style","border: "+i+"em solid "+String(t.borderColor))}break;case"\\xcancel":n.setAttribute("notation","updiagonalstrike downdiagonalstrike");break}return t.backgroundColor&&n.setAttribute("mathbackground",t.backgroundColor),n};Et({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,argTypes:["color","text"]},handler(t,e,r){var{parser:n,funcName:i}=t,a=Qt(e[0],"color-token").color,s=e[1];return{type:"enclose",mode:n.mode,label:i,backgroundColor:a,body:s}},htmlBuilder:dE,mathmlBuilder:fE});Et({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,argTypes:["color","color","text"]},handler(t,e,r){var{parser:n,funcName:i}=t,a=Qt(e[0],"color-token").color,s=Qt(e[1],"color-token").color,o=e[2];return{type:"enclose",mode:n.mode,label:i,backgroundColor:s,borderColor:a,body:o}},htmlBuilder:dE,mathmlBuilder:fE});Et({type:"enclose",names:["\\fbox"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!0},handler(t,e){var{parser:r}=t;return{type:"enclose",mode:r.mode,label:"\\fbox",body:e[0]}}});Et({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\sout","\\phase"],props:{numArgs:1},handler(t,e){var{parser:r,funcName:n}=t,i=e[0];return{type:"enclose",mode:r.mode,label:n,body:i}},htmlBuilder:dE,mathmlBuilder:fE});Et({type:"enclose",names:["\\angl"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!1},handler(t,e){var{parser:r}=t;return{type:"enclose",mode:r.mode,label:"\\angl",body:e[0]}}});var VF={};function ao(t){for(var{type:e,names:r,props:n,handler:i,htmlBuilder:a,mathmlBuilder:s}=t,o={type:e,numArgs:n.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:i},l=0;l<r.length;++l)VF[r[l]]=o;a&&(Cv[e]=a),s&&(Av[e]=s)}var GF={};function le(t,e){GF[t]=e}function zC(t){var e=[];t.consumeSpaces();var r=t.fetch().text;for(r==="\\relax"&&(t.consume(),t.consumeSpaces(),r=t.fetch().text);r==="\\hline"||r==="\\hdashline";)t.consume(),e.push(r==="\\hdashline"),t.consumeSpaces(),r=t.fetch().text;return e}var v2=t=>{var e=t.parser.settings;if(!e.displayMode)throw new ot("{"+t.envName+"} can be used only in display mode.")};function pE(t){if(t.indexOf("ed")===-1)return t.indexOf("*")===-1}function ic(t,e,r){var{hskipBeforeAndAfter:n,addJot:i,cols:a,arraystretch:s,colSeparationType:o,autoTag:l,singleRow:u,emptySingleRow:h,maxNumCols:d,leqno:f}=e;if(t.gullet.beginGroup(),u||t.gullet.macros.set("\\cr","\\\\\\relax"),!s){var p=t.gullet.expandMacroAsText("\\arraystretch");if(p==null)s=1;else if(s=parseFloat(p),!s||s<0)throw new ot("Invalid \\arraystretch: "+p)}t.gullet.beginGroup();var g=[],m=[g],v=[],y=[],b=l!=null?[]:void 0;function w(){l&&t.gullet.macros.set("\\@eqnsw","1",!0)}function T(){b&&(t.gullet.macros.get("\\df@tag")?(b.push(t.subparse([new Sa("\\df@tag")])),t.gullet.macros.set("\\df@tag",void 0,!0)):b.push(!!l&&t.gullet.macros.get("\\@eqnsw")==="1"))}for(w(),y.push(zC(t));;){var E=t.parseExpression(!1,u?"\\end":"\\\\");t.gullet.endGroup(),t.gullet.beginGroup(),E={type:"ordgroup",mode:t.mode,body:E},r&&(E={type:"styling",mode:t.mode,style:r,body:[E]}),g.push(E);var L=t.fetch().text;if(L==="&"){if(d&&g.length===d){if(u||o)throw new ot("Too many tab characters: &",t.nextToken);t.settings.reportNonstrict("textEnv","Too few columns specified in the {array} column argument.")}t.consume()}else if(L==="\\end"){T(),g.length===1&&E.type==="styling"&&E.body[0].body.length===0&&(m.length>1||!h)&&m.pop(),y.length<m.length+1&&y.push([]);break}else if(L==="\\\\"){t.consume();var S=void 0;t.gullet.future().text!==" "&&(S=t.parseSizeGroup(!0)),v.push(S?S.value:null),T(),y.push(zC(t)),g=[],m.push(g),w()}else throw new ot("Expected & or \\\\ or \\cr or \\end",t.nextToken)}return t.gullet.endGroup(),t.gullet.endGroup(),{type:"array",mode:t.mode,addJot:i,arraystretch:s,body:m,cols:a,rowGaps:v,hskipBeforeAndAfter:n,hLinesBeforeRow:y,colSeparationType:o,tags:b,leqno:f}}function gE(t){return t.slice(0,1)==="d"?"display":"text"}var so=function(e,r){var n,i,a=e.body.length,s=e.hLinesBeforeRow,o=0,l=new Array(a),u=[],h=Math.max(r.fontMetrics().arrayRuleWidth,r.minRuleThickness),d=1/r.fontMetrics().ptPerEm,f=5*d;if(e.colSeparationType&&e.colSeparationType==="small"){var p=r.havingStyle(Vt.SCRIPT).sizeMultiplier;f=.2778*(p/r.sizeMultiplier)}var g=e.colSeparationType==="CD"?en({number:3,unit:"ex"},r):12*d,m=3*d,v=e.arraystretch*g,y=.7*v,b=.3*v,w=0;function T(H){for(var Oe=0;Oe<H.length;++Oe)Oe>0&&(w+=.25),u.push({pos:w,isDashed:H[Oe]})}for(T(s[0]),n=0;n<e.body.length;++n){var E=e.body[n],L=y,S=b;o<E.length&&(o=E.length);var C=new Array(E.length);for(i=0;i<E.length;++i){var A=yr(E[i],r);S<A.depth&&(S=A.depth),L<A.height&&(L=A.height),C[i]=A}var N=e.rowGaps[n],_=0;N&&(_=en(N,r),_>0&&(_+=b,S<_&&(S=_),_=0)),e.addJot&&(S+=m),C.height=L,C.depth=S,w+=L,C.pos=w,w+=S+_,l[n]=C,T(s[n+1])}var O=w/2+r.fontMetrics().axisHeight,P=e.cols||[],k=[],R,I,M=[];if(e.tags&&e.tags.some(H=>H))for(n=0;n<a;++n){var D=l[n],B=D.pos-O,$=e.tags[n],F=void 0;$===!0?F=Fe.makeSpan(["eqn-num"],[],r):$===!1?F=Fe.makeSpan([],[],r):F=Fe.makeSpan([],Bn($,r,!0),r),F.depth=D.depth,F.height=D.height,M.push({type:"elem",elem:F,shift:B})}for(i=0,I=0;i<o||I<P.length;++i,++I){for(var G=P[I]||{},W=!0;G.type==="separator";){if(W||(R=Fe.makeSpan(["arraycolsep"],[]),R.style.width=gt(r.fontMetrics().doubleRuleSep),k.push(R)),G.separator==="|"||G.separator===":"){var J=G.separator==="|"?"solid":"dashed",q=Fe.makeSpan(["vertical-separator"],[],r);q.style.height=gt(w),q.style.borderRightWidth=gt(h),q.style.borderRightStyle=J,q.style.margin="0 "+gt(-h/2);var ne=w-O;ne&&(q.style.verticalAlign=gt(-ne)),k.push(q)}else throw new ot("Invalid separator type: "+G.separator);I++,G=P[I]||{},W=!1}if(!(i>=o)){var ae=void 0;(i>0||e.hskipBeforeAndAfter)&&(ae=Tr.deflt(G.pregap,f),ae!==0&&(R=Fe.makeSpan(["arraycolsep"],[]),R.style.width=gt(ae),k.push(R)));var pe=[];for(n=0;n<a;++n){var K=l[n],Z=K[i];if(Z){var X=K.pos-O;Z.depth=K.depth,Z.height=K.height,pe.push({type:"elem",elem:Z,shift:X})}}pe=Fe.makeVList({positionType:"individualShift",children:pe},r),pe=Fe.makeSpan(["col-align-"+(G.align||"c")],[pe]),k.push(pe),(i<o-1||e.hskipBeforeAndAfter)&&(ae=Tr.deflt(G.postgap,f),ae!==0&&(R=Fe.makeSpan(["arraycolsep"],[]),R.style.width=gt(ae),k.push(R)))}}if(l=Fe.makeSpan(["mtable"],k),u.length>0){for(var Y=Fe.makeLineSpan("hline",r,h),ee=Fe.makeLineSpan("hdashline",r,h),j=[{type:"elem",elem:l,shift:0}];u.length>0;){var fe=u.pop(),te=fe.pos-O;fe.isDashed?j.push({type:"elem",elem:ee,shift:te}):j.push({type:"elem",elem:Y,shift:te})}l=Fe.makeVList({positionType:"individualShift",children:j},r)}if(M.length===0)return Fe.makeSpan(["mord"],[l],r);var Ae=Fe.makeVList({positionType:"individualShift",children:M},r);return Ae=Fe.makeSpan(["tag"],[Ae],r),Fe.makeFragment([l,Ae])},Dhe={c:"center ",l:"left ",r:"right "},oo=function(e,r){for(var n=[],i=new it.MathNode("mtd",[],["mtr-glue"]),a=new it.MathNode("mtd",[],["mml-eqn-num"]),s=0;s<e.body.length;s++){for(var o=e.body[s],l=[],u=0;u<o.length;u++)l.push(new it.MathNode("mtd",[Fr(o[u],r)]));e.tags&&e.tags[s]&&(l.unshift(i),l.push(i),e.leqno?l.unshift(a):l.push(a)),n.push(new it.MathNode("mtr",l))}var h=new it.MathNode("mtable",n),d=e.arraystretch===.5?.1:.16+e.arraystretch-1+(e.addJot?.09:0);h.setAttribute("rowspacing",gt(d));var f="",p="";if(e.cols&&e.cols.length>0){var g=e.cols,m="",v=!1,y=0,b=g.length;g[0].type==="separator"&&(f+="top ",y=1),g[g.length-1].type==="separator"&&(f+="bottom ",b-=1);for(var w=y;w<b;w++)g[w].type==="align"?(p+=Dhe[g[w].align],v&&(m+="none "),v=!0):g[w].type==="separator"&&v&&(m+=g[w].separator==="|"?"solid ":"dashed ",v=!1);h.setAttribute("columnalign",p.trim()),/[sd]/.test(m)&&h.setAttribute("columnlines",m.trim())}if(e.colSeparationType==="align"){for(var T=e.cols||[],E="",L=1;L<T.length;L++)E+=L%2?"0em ":"1em ";h.setAttribute("columnspacing",E.trim())}else e.colSeparationType==="alignat"||e.colSeparationType==="gather"?h.setAttribute("columnspacing","0em"):e.colSeparationType==="small"?h.setAttribute("columnspacing","0.2778em"):e.colSeparationType==="CD"?h.setAttribute("columnspacing","0.5em"):h.setAttribute("columnspacing","1em");var S="",C=e.hLinesBeforeRow;f+=C[0].length>0?"left ":"",f+=C[C.length-1].length>0?"right ":"";for(var A=1;A<C.length-1;A++)S+=C[A].length===0?"none ":C[A][0]?"dashed ":"solid ";return/[sd]/.test(S)&&h.setAttribute("rowlines",S.trim()),f!==""&&(h=new it.MathNode("menclose",[h]),h.setAttribute("notation",f.trim())),e.arraystretch&&e.arraystretch<1&&(h=new it.MathNode("mstyle",[h]),h.setAttribute("scriptlevel","1")),h},UF=function(e,r){e.envName.indexOf("ed")===-1&&v2(e);var n=[],i=e.envName.indexOf("at")>-1?"alignat":"align",a=e.envName==="split",s=ic(e.parser,{cols:n,addJot:!0,autoTag:a?void 0:pE(e.envName),emptySingleRow:!0,colSeparationType:i,maxNumCols:a?2:void 0,leqno:e.parser.settings.leqno},"display"),o,l=0,u={type:"ordgroup",mode:e.mode,body:[]};if(r[0]&&r[0].type==="ordgroup"){for(var h="",d=0;d<r[0].body.length;d++){var f=Qt(r[0].body[d],"textord");h+=f.text}o=Number(h),l=o*2}var p=!l;s.body.forEach(function(y){for(var b=1;b<y.length;b+=2){var w=Qt(y[b],"styling"),T=Qt(w.body[0],"ordgroup");T.body.unshift(u)}if(p)l<y.length&&(l=y.length);else{var E=y.length/2;if(o<E)throw new ot("Too many math in a row: "+("expected "+o+", but got "+E),y[0])}});for(var g=0;g<l;++g){var m="r",v=0;g%2===1?m="l":g>0&&p&&(v=1),n[g]={type:"align",align:m,pregap:v,postgap:0}}return s.colSeparationType=p?"align":"alignat",s};ao({type:"array",names:["array","darray"],props:{numArgs:1},handler(t,e){var r=p2(e[0]),n=r?[e[0]]:Qt(e[0],"ordgroup").body,i=n.map(function(s){var o=cE(s),l=o.text;if("lcr".indexOf(l)!==-1)return{type:"align",align:l};if(l==="|")return{type:"separator",separator:"|"};if(l===":")return{type:"separator",separator:":"};throw new ot("Unknown column alignment: "+l,s)}),a={cols:i,hskipBeforeAndAfter:!0,maxNumCols:i.length};return ic(t.parser,a,gE(t.envName))},htmlBuilder:so,mathmlBuilder:oo});ao({type:"array",names:["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],props:{numArgs:0},handler(t){var e={matrix:null,pmatrix:["(",")"],bmatrix:["[","]"],Bmatrix:["\\{","\\}"],vmatrix:["|","|"],Vmatrix:["\\Vert","\\Vert"]}[t.envName.replace("*","")],r="c",n={hskipBeforeAndAfter:!1,cols:[{type:"align",align:r}]};if(t.envName.charAt(t.envName.length-1)==="*"){var i=t.parser;if(i.consumeSpaces(),i.fetch().text==="["){if(i.consume(),i.consumeSpaces(),r=i.fetch().text,"lcr".indexOf(r)===-1)throw new ot("Expected l or c or r",i.nextToken);i.consume(),i.consumeSpaces(),i.expect("]"),i.consume(),n.cols=[{type:"align",align:r}]}}var a=ic(t.parser,n,gE(t.envName)),s=Math.max(0,...a.body.map(o=>o.length));return a.cols=new Array(s).fill({type:"align",align:r}),e?{type:"leftright",mode:t.mode,body:[a],left:e[0],right:e[1],rightColor:void 0}:a},htmlBuilder:so,mathmlBuilder:oo});ao({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(t){var e={arraystretch:.5},r=ic(t.parser,e,"script");return r.colSeparationType="small",r},htmlBuilder:so,mathmlBuilder:oo});ao({type:"array",names:["subarray"],props:{numArgs:1},handler(t,e){var r=p2(e[0]),n=r?[e[0]]:Qt(e[0],"ordgroup").body,i=n.map(function(s){var o=cE(s),l=o.text;if("lc".indexOf(l)!==-1)return{type:"align",align:l};throw new ot("Unknown column alignment: "+l,s)});if(i.length>1)throw new ot("{subarray} can contain only one column");var a={cols:i,hskipBeforeAndAfter:!1,arraystretch:.5};if(a=ic(t.parser,a,"script"),a.body.length>0&&a.body[0].length>1)throw new ot("{subarray} can contain only one column");return a},htmlBuilder:so,mathmlBuilder:oo});ao({type:"array",names:["cases","dcases","rcases","drcases"],props:{numArgs:0},handler(t){var e={arraystretch:1.2,cols:[{type:"align",align:"l",pregap:0,postgap:1},{type:"align",align:"l",pregap:0,postgap:0}]},r=ic(t.parser,e,gE(t.envName));return{type:"leftright",mode:t.mode,body:[r],left:t.envName.indexOf("r")>-1?".":"\\{",right:t.envName.indexOf("r")>-1?"\\}":".",rightColor:void 0}},htmlBuilder:so,mathmlBuilder:oo});ao({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:UF,htmlBuilder:so,mathmlBuilder:oo});ao({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(t){["gather","gather*"].includes(t.envName)&&v2(t);var e={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:pE(t.envName),emptySingleRow:!0,leqno:t.parser.settings.leqno};return ic(t.parser,e,"display")},htmlBuilder:so,mathmlBuilder:oo});ao({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:UF,htmlBuilder:so,mathmlBuilder:oo});ao({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(t){v2(t);var e={autoTag:pE(t.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:t.parser.settings.leqno};return ic(t.parser,e,"display")},htmlBuilder:so,mathmlBuilder:oo});ao({type:"array",names:["CD"],props:{numArgs:0},handler(t){return v2(t),yhe(t.parser)},htmlBuilder:so,mathmlBuilder:oo});le("\\nonumber","\\gdef\\@eqnsw{0}");le("\\notag","\\nonumber");Et({type:"text",names:["\\hline","\\hdashline"],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler(t,e){throw new ot(t.funcName+" valid only within array environment")}});var VC=VF;Et({type:"environment",names:["\\begin","\\end"],props:{numArgs:1,argTypes:["text"]},handler(t,e){var{parser:r,funcName:n}=t,i=e[0];if(i.type!=="ordgroup")throw new ot("Invalid environment name",i);for(var a="",s=0;s<i.body.length;++s)a+=Qt(i.body[s],"textord").text;if(n==="\\begin"){if(!VC.hasOwnProperty(a))throw new ot("No such environment: "+a,i);var o=VC[a],{args:l,optArgs:u}=r.parseArguments("\\begin{"+a+"}",o),h={mode:r.mode,envName:a,parser:r},d=o.handler(h,l,u);r.expect("\\end",!1);var f=r.nextToken,p=Qt(r.parseFunction(),"environment");if(p.name!==a)throw new ot("Mismatch: \\begin{"+a+"} matched by \\end{"+p.name+"}",f);return d}return{type:"environment",mode:r.mode,name:a,nameGroup:i}}});var WF=(t,e)=>{var r=t.font,n=e.withFont(r);return yr(t.body,n)},HF=(t,e)=>{var r=t.font,n=e.withFont(r);return Fr(t.body,n)},GC={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak","\\bm":"\\boldsymbol"};Et({type:"font",names:["\\mathrm","\\mathit","\\mathbf","\\mathnormal","\\mathsfit","\\mathbb","\\mathcal","\\mathfrak","\\mathscr","\\mathsf","\\mathtt","\\Bbb","\\bold","\\frak"],props:{numArgs:1,allowedInArgument:!0},handler:(t,e)=>{var{parser:r,funcName:n}=t,i=_v(e[0]),a=n;return a in GC&&(a=GC[a]),{type:"font",mode:r.mode,font:a.slice(1),body:i}},htmlBuilder:WF,mathmlBuilder:HF});Et({type:"mclass",names:["\\boldsymbol","\\bm"],props:{numArgs:1},handler:(t,e)=>{var{parser:r}=t,n=e[0],i=Tr.isCharacterBox(n);return{type:"mclass",mode:r.mode,mclass:g2(n),body:[{type:"font",mode:r.mode,font:"boldsymbol",body:n}],isCharacterBox:i}}});Et({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it","\\cal"],props:{numArgs:0,allowedInText:!0},handler:(t,e)=>{var{parser:r,funcName:n,breakOnTokenText:i}=t,{mode:a}=r,s=r.parseExpression(!0,i),o="math"+n.slice(1);return{type:"font",mode:a,font:o,body:{type:"ordgroup",mode:r.mode,body:s}}},htmlBuilder:WF,mathmlBuilder:HF});var qF=(t,e)=>{var r=e;return t==="display"?r=r.id>=Vt.SCRIPT.id?r.text():Vt.DISPLAY:t==="text"&&r.size===Vt.DISPLAY.size?r=Vt.TEXT:t==="script"?r=Vt.SCRIPT:t==="scriptscript"&&(r=Vt.SCRIPTSCRIPT),r},mE=(t,e)=>{var r=qF(t.size,e.style),n=r.fracNum(),i=r.fracDen(),a;a=e.havingStyle(n);var s=yr(t.numer,a,e);if(t.continued){var o=8.5/e.fontMetrics().ptPerEm,l=3.5/e.fontMetrics().ptPerEm;s.height=s.height<o?o:s.height,s.depth=s.depth<l?l:s.depth}a=e.havingStyle(i);var u=yr(t.denom,a,e),h,d,f;t.hasBarLine?(t.barSize?(d=en(t.barSize,e),h=Fe.makeLineSpan("frac-line",e,d)):h=Fe.makeLineSpan("frac-line",e),d=h.height,f=h.height):(h=null,d=0,f=e.fontMetrics().defaultRuleThickness);var p,g,m;r.size===Vt.DISPLAY.size||t.size==="display"?(p=e.fontMetrics().num1,d>0?g=3*f:g=7*f,m=e.fontMetrics().denom1):(d>0?(p=e.fontMetrics().num2,g=f):(p=e.fontMetrics().num3,g=3*f),m=e.fontMetrics().denom2);var v;if(h){var b=e.fontMetrics().axisHeight;p-s.depth-(b+.5*d)<g&&(p+=g-(p-s.depth-(b+.5*d))),b-.5*d-(u.height-m)<g&&(m+=g-(b-.5*d-(u.height-m)));var w=-(b-.5*d);v=Fe.makeVList({positionType:"individualShift",children:[{type:"elem",elem:u,shift:m},{type:"elem",elem:h,shift:w},{type:"elem",elem:s,shift:-p}]},e)}else{var y=p-s.depth-(u.height-m);y<g&&(p+=.5*(g-y),m+=.5*(g-y)),v=Fe.makeVList({positionType:"individualShift",children:[{type:"elem",elem:u,shift:m},{type:"elem",elem:s,shift:-p}]},e)}a=e.havingStyle(r),v.height*=a.sizeMultiplier/e.sizeMultiplier,v.depth*=a.sizeMultiplier/e.sizeMultiplier;var T;r.size===Vt.DISPLAY.size?T=e.fontMetrics().delim1:r.size===Vt.SCRIPTSCRIPT.size?T=e.havingStyle(Vt.SCRIPT).fontMetrics().delim2:T=e.fontMetrics().delim2;var E,L;return t.leftDelim==null?E=J0(e,["mopen"]):E=$o.customSizedDelim(t.leftDelim,T,!0,e.havingStyle(r),t.mode,["mopen"]),t.continued?L=Fe.makeSpan([]):t.rightDelim==null?L=J0(e,["mclose"]):L=$o.customSizedDelim(t.rightDelim,T,!0,e.havingStyle(r),t.mode,["mclose"]),Fe.makeSpan(["mord"].concat(a.sizingClasses(e)),[E,Fe.makeSpan(["mfrac"],[v]),L],e)},vE=(t,e)=>{var r=new it.MathNode("mfrac",[Fr(t.numer,e),Fr(t.denom,e)]);if(!t.hasBarLine)r.setAttribute("linethickness","0px");else if(t.barSize){var n=en(t.barSize,e);r.setAttribute("linethickness",gt(n))}var i=qF(t.size,e.style);if(i.size!==e.style.size){r=new it.MathNode("mstyle",[r]);var a=i.size===Vt.DISPLAY.size?"true":"false";r.setAttribute("displaystyle",a),r.setAttribute("scriptlevel","0")}if(t.leftDelim!=null||t.rightDelim!=null){var s=[];if(t.leftDelim!=null){var o=new it.MathNode("mo",[new it.TextNode(t.leftDelim.replace("\\",""))]);o.setAttribute("fence","true"),s.push(o)}if(s.push(r),t.rightDelim!=null){var l=new it.MathNode("mo",[new it.TextNode(t.rightDelim.replace("\\",""))]);l.setAttribute("fence","true"),s.push(l)}return oE(s)}return r};Et({type:"genfrac",names:["\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac","\\\\bracefrac","\\\\brackfrac"],props:{numArgs:2,allowedInArgument:!0},handler:(t,e)=>{var{parser:r,funcName:n}=t,i=e[0],a=e[1],s,o=null,l=null,u="auto";switch(n){case"\\dfrac":case"\\frac":case"\\tfrac":s=!0;break;case"\\\\atopfrac":s=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":s=!1,o="(",l=")";break;case"\\\\bracefrac":s=!1,o="\\{",l="\\}";break;case"\\\\brackfrac":s=!1,o="[",l="]";break;default:throw new Error("Unrecognized genfrac command")}switch(n){case"\\dfrac":case"\\dbinom":u="display";break;case"\\tfrac":case"\\tbinom":u="text";break}return{type:"genfrac",mode:r.mode,continued:!1,numer:i,denom:a,hasBarLine:s,leftDelim:o,rightDelim:l,size:u,barSize:null}},htmlBuilder:mE,mathmlBuilder:vE});Et({type:"genfrac",names:["\\cfrac"],props:{numArgs:2},handler:(t,e)=>{var{parser:r,funcName:n}=t,i=e[0],a=e[1];return{type:"genfrac",mode:r.mode,continued:!0,numer:i,denom:a,hasBarLine:!0,leftDelim:null,rightDelim:null,size:"display",barSize:null}}});Et({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],props:{numArgs:0,infix:!0},handler(t){var{parser:e,funcName:r,token:n}=t,i;switch(r){case"\\over":i="\\frac";break;case"\\choose":i="\\binom";break;case"\\atop":i="\\\\atopfrac";break;case"\\brace":i="\\\\bracefrac";break;case"\\brack":i="\\\\brackfrac";break;default:throw new Error("Unrecognized infix genfrac command")}return{type:"infix",mode:e.mode,replaceWith:i,token:n}}});var UC=["display","text","script","scriptscript"],WC=function(e){var r=null;return e.length>0&&(r=e,r=r==="."?null:r),r};Et({type:"genfrac",names:["\\genfrac"],props:{numArgs:6,allowedInArgument:!0,argTypes:["math","math","size","text","math","math"]},handler(t,e){var{parser:r}=t,n=e[4],i=e[5],a=_v(e[0]),s=a.type==="atom"&&a.family==="open"?WC(a.text):null,o=_v(e[1]),l=o.type==="atom"&&o.family==="close"?WC(o.text):null,u=Qt(e[2],"size"),h,d=null;u.isBlank?h=!0:(d=u.value,h=d.number>0);var f="auto",p=e[3];if(p.type==="ordgroup"){if(p.body.length>0){var g=Qt(p.body[0],"textord");f=UC[Number(g.text)]}}else p=Qt(p,"textord"),f=UC[Number(p.text)];return{type:"genfrac",mode:r.mode,numer:n,denom:i,continued:!1,hasBarLine:h,barSize:d,leftDelim:s,rightDelim:l,size:f}},htmlBuilder:mE,mathmlBuilder:vE});Et({type:"infix",names:["\\above"],props:{numArgs:1,argTypes:["size"],infix:!0},handler(t,e){var{parser:r,funcName:n,token:i}=t;return{type:"infix",mode:r.mode,replaceWith:"\\\\abovefrac",size:Qt(e[0],"size").value,token:i}}});Et({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:(t,e)=>{var{parser:r,funcName:n}=t,i=e[0],a=cue(Qt(e[1],"infix").size),s=e[2],o=a.number>0;return{type:"genfrac",mode:r.mode,numer:i,denom:s,continued:!1,hasBarLine:o,barSize:a,leftDelim:null,rightDelim:null,size:"auto"}},htmlBuilder:mE,mathmlBuilder:vE});var YF=(t,e)=>{var r=e.style,n,i;t.type==="supsub"?(n=t.sup?yr(t.sup,e.havingStyle(r.sup()),e):yr(t.sub,e.havingStyle(r.sub()),e),i=Qt(t.base,"horizBrace")):i=Qt(t,"horizBrace");var a=yr(i.base,e.havingBaseStyle(Vt.DISPLAY)),s=Xo.svgSpan(i,e),o;if(i.isOver?(o=Fe.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"kern",size:.1},{type:"elem",elem:s}]},e),o.children[0].children[0].children[1].classes.push("svg-align")):(o=Fe.makeVList({positionType:"bottom",positionData:a.depth+.1+s.height,children:[{type:"elem",elem:s},{type:"kern",size:.1},{type:"elem",elem:a}]},e),o.children[0].children[0].children[0].classes.push("svg-align")),n){var l=Fe.makeSpan(["mord",i.isOver?"mover":"munder"],[o],e);i.isOver?o=Fe.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:l},{type:"kern",size:.2},{type:"elem",elem:n}]},e):o=Fe.makeVList({positionType:"bottom",positionData:l.depth+.2+n.height+n.depth,children:[{type:"elem",elem:n},{type:"kern",size:.2},{type:"elem",elem:l}]},e)}return Fe.makeSpan(["mord",i.isOver?"mover":"munder"],[o],e)},Mhe=(t,e)=>{var r=Xo.mathMLnode(t.label);return new it.MathNode(t.isOver?"mover":"munder",[Fr(t.base,e),r])};Et({type:"horizBrace",names:["\\overbrace","\\underbrace"],props:{numArgs:1},handler(t,e){var{parser:r,funcName:n}=t;return{type:"horizBrace",mode:r.mode,label:n,isOver:/^\\over/.test(n),base:e[0]}},htmlBuilder:YF,mathmlBuilder:Mhe});Et({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:(t,e)=>{var{parser:r}=t,n=e[1],i=Qt(e[0],"url").url;return r.settings.isTrusted({command:"\\href",url:i})?{type:"href",mode:r.mode,href:i,body:yn(n)}:r.formatUnsupportedCmd("\\href")},htmlBuilder:(t,e)=>{var r=Bn(t.body,e,!1);return Fe.makeAnchor(t.href,[],r,e)},mathmlBuilder:(t,e)=>{var r=zl(t.body,e);return r instanceof Ea||(r=new Ea("mrow",[r])),r.setAttribute("href",t.href),r}});Et({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:(t,e)=>{var{parser:r}=t,n=Qt(e[0],"url").url;if(!r.settings.isTrusted({command:"\\url",url:n}))return r.formatUnsupportedCmd("\\url");for(var i=[],a=0;a<n.length;a++){var s=n[a];s==="~"&&(s="\\textasciitilde"),i.push({type:"textord",mode:"text",text:s})}var o={type:"text",mode:r.mode,font:"\\texttt",body:i};return{type:"href",mode:r.mode,href:n,body:yn(o)}}});Et({type:"hbox",names:["\\hbox"],props:{numArgs:1,argTypes:["text"],allowedInText:!0,primitive:!0},handler(t,e){var{parser:r}=t;return{type:"hbox",mode:r.mode,body:yn(e[0])}},htmlBuilder(t,e){var r=Bn(t.body,e,!1);return Fe.makeFragment(r)},mathmlBuilder(t,e){return new it.MathNode("mrow",pa(t.body,e))}});Et({type:"html",names:["\\htmlClass","\\htmlId","\\htmlStyle","\\htmlData"],props:{numArgs:2,argTypes:["raw","original"],allowedInText:!0},handler:(t,e)=>{var{parser:r,funcName:n,token:i}=t,a=Qt(e[0],"raw").string,s=e[1];r.settings.strict&&r.settings.reportNonstrict("htmlExtension","HTML extension is disabled on strict mode");var o,l={};switch(n){case"\\htmlClass":l.class=a,o={command:"\\htmlClass",class:a};break;case"\\htmlId":l.id=a,o={command:"\\htmlId",id:a};break;case"\\htmlStyle":l.style=a,o={command:"\\htmlStyle",style:a};break;case"\\htmlData":{for(var u=a.split(","),h=0;h<u.length;h++){var d=u[h].split("=");if(d.length!==2)throw new ot("Error parsing key-value for \\htmlData");l["data-"+d[0].trim()]=d[1].trim()}o={command:"\\htmlData",attributes:l};break}default:throw new Error("Unrecognized html command")}return r.settings.isTrusted(o)?{type:"html",mode:r.mode,attributes:l,body:yn(s)}:r.formatUnsupportedCmd(n)},htmlBuilder:(t,e)=>{var r=Bn(t.body,e,!1),n=["enclosing"];t.attributes.class&&n.push(...t.attributes.class.trim().split(/\s+/));var i=Fe.makeSpan(n,r,e);for(var a in t.attributes)a!=="class"&&t.attributes.hasOwnProperty(a)&&i.setAttribute(a,t.attributes[a]);return i},mathmlBuilder:(t,e)=>zl(t.body,e)});Et({type:"htmlmathml",names:["\\html@mathml"],props:{numArgs:2,allowedInText:!0},handler:(t,e)=>{var{parser:r}=t;return{type:"htmlmathml",mode:r.mode,html:yn(e[0]),mathml:yn(e[1])}},htmlBuilder:(t,e)=>{var r=Bn(t.html,e,!1);return Fe.makeFragment(r)},mathmlBuilder:(t,e)=>zl(t.mathml,e)});var fb=function(e){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(e))return{number:+e,unit:"bp"};var r=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(e);if(!r)throw new ot("Invalid size: '"+e+"' in \\includegraphics");var n={number:+(r[1]+r[2]),unit:r[3]};if(!dF(n))throw new ot("Invalid unit: '"+n.unit+"' in \\includegraphics.");return n};Et({type:"includegraphics",names:["\\includegraphics"],props:{numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1},handler:(t,e,r)=>{var{parser:n}=t,i={number:0,unit:"em"},a={number:.9,unit:"em"},s={number:0,unit:"em"},o="";if(r[0])for(var l=Qt(r[0],"raw").string,u=l.split(","),h=0;h<u.length;h++){var d=u[h].split("=");if(d.length===2){var f=d[1].trim();switch(d[0].trim()){case"alt":o=f;break;case"width":i=fb(f);break;case"height":a=fb(f);break;case"totalheight":s=fb(f);break;default:throw new ot("Invalid key: '"+d[0]+"' in \\includegraphics.")}}}var p=Qt(e[0],"url").url;return o===""&&(o=p,o=o.replace(/^.*[\\/]/,""),o=o.substring(0,o.lastIndexOf("."))),n.settings.isTrusted({command:"\\includegraphics",url:p})?{type:"includegraphics",mode:n.mode,alt:o,width:i,height:a,totalheight:s,src:p}:n.formatUnsupportedCmd("\\includegraphics")},htmlBuilder:(t,e)=>{var r=en(t.height,e),n=0;t.totalheight.number>0&&(n=en(t.totalheight,e)-r);var i=0;t.width.number>0&&(i=en(t.width,e));var a={height:gt(r+n)};i>0&&(a.width=gt(i)),n>0&&(a.verticalAlign=gt(-n));var s=new Mue(t.src,t.alt,a);return s.height=r,s.depth=n,s},mathmlBuilder:(t,e)=>{var r=new it.MathNode("mglyph",[]);r.setAttribute("alt",t.alt);var n=en(t.height,e),i=0;if(t.totalheight.number>0&&(i=en(t.totalheight,e)-n,r.setAttribute("valign",gt(-i))),r.setAttribute("height",gt(n+i)),t.width.number>0){var a=en(t.width,e);r.setAttribute("width",gt(a))}return r.setAttribute("src",t.src),r}});Et({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],props:{numArgs:1,argTypes:["size"],primitive:!0,allowedInText:!0},handler(t,e){var{parser:r,funcName:n}=t,i=Qt(e[0],"size");if(r.settings.strict){var a=n[1]==="m",s=i.value.unit==="mu";a?(s||r.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+n+" supports only mu units, "+("not "+i.value.unit+" units")),r.mode!=="math"&&r.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+n+" works only in math mode")):s&&r.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+n+" doesn't support mu units")}return{type:"kern",mode:r.mode,dimension:i.value}},htmlBuilder(t,e){return Fe.makeGlue(t.dimension,e)},mathmlBuilder(t,e){var r=en(t.dimension,e);return new it.SpaceNode(r)}});Et({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],props:{numArgs:1,allowedInText:!0},handler:(t,e)=>{var{parser:r,funcName:n}=t,i=e[0];return{type:"lap",mode:r.mode,alignment:n.slice(5),body:i}},htmlBuilder:(t,e)=>{var r;t.alignment==="clap"?(r=Fe.makeSpan([],[yr(t.body,e)]),r=Fe.makeSpan(["inner"],[r],e)):r=Fe.makeSpan(["inner"],[yr(t.body,e)]);var n=Fe.makeSpan(["fix"],[]),i=Fe.makeSpan([t.alignment],[r,n],e),a=Fe.makeSpan(["strut"]);return a.style.height=gt(i.height+i.depth),i.depth&&(a.style.verticalAlign=gt(-i.depth)),i.children.unshift(a),i=Fe.makeSpan(["thinbox"],[i],e),Fe.makeSpan(["mord","vbox"],[i],e)},mathmlBuilder:(t,e)=>{var r=new it.MathNode("mpadded",[Fr(t.body,e)]);if(t.alignment!=="rlap"){var n=t.alignment==="llap"?"-1":"-0.5";r.setAttribute("lspace",n+"width")}return r.setAttribute("width","0px"),r}});Et({type:"styling",names:["\\(","$"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(t,e){var{funcName:r,parser:n}=t,i=n.mode;n.switchMode("math");var a=r==="\\("?"\\)":"$",s=n.parseExpression(!1,a);return n.expect(a),n.switchMode(i),{type:"styling",mode:n.mode,style:"text",body:s}}});Et({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(t,e){throw new ot("Mismatched "+t.funcName)}});var HC=(t,e)=>{switch(e.style.size){case Vt.DISPLAY.size:return t.display;case Vt.TEXT.size:return t.text;case Vt.SCRIPT.size:return t.script;case Vt.SCRIPTSCRIPT.size:return t.scriptscript;default:return t.text}};Et({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4,primitive:!0},handler:(t,e)=>{var{parser:r}=t;return{type:"mathchoice",mode:r.mode,display:yn(e[0]),text:yn(e[1]),script:yn(e[2]),scriptscript:yn(e[3])}},htmlBuilder:(t,e)=>{var r=HC(t,e),n=Bn(r,e,!1);return Fe.makeFragment(n)},mathmlBuilder:(t,e)=>{var r=HC(t,e);return zl(r,e)}});var XF=(t,e,r,n,i,a,s)=>{t=Fe.makeSpan([],[t]);var o=r&&Tr.isCharacterBox(r),l,u;if(e){var h=yr(e,n.havingStyle(i.sup()),n);u={elem:h,kern:Math.max(n.fontMetrics().bigOpSpacing1,n.fontMetrics().bigOpSpacing3-h.depth)}}if(r){var d=yr(r,n.havingStyle(i.sub()),n);l={elem:d,kern:Math.max(n.fontMetrics().bigOpSpacing2,n.fontMetrics().bigOpSpacing4-d.height)}}var f;if(u&&l){var p=n.fontMetrics().bigOpSpacing5+l.elem.height+l.elem.depth+l.kern+t.depth+s;f=Fe.makeVList({positionType:"bottom",positionData:p,children:[{type:"kern",size:n.fontMetrics().bigOpSpacing5},{type:"elem",elem:l.elem,marginLeft:gt(-a)},{type:"kern",size:l.kern},{type:"elem",elem:t},{type:"kern",size:u.kern},{type:"elem",elem:u.elem,marginLeft:gt(a)},{type:"kern",size:n.fontMetrics().bigOpSpacing5}]},n)}else if(l){var g=t.height-s;f=Fe.makeVList({positionType:"top",positionData:g,children:[{type:"kern",size:n.fontMetrics().bigOpSpacing5},{type:"elem",elem:l.elem,marginLeft:gt(-a)},{type:"kern",size:l.kern},{type:"elem",elem:t}]},n)}else if(u){var m=t.depth+s;f=Fe.makeVList({positionType:"bottom",positionData:m,children:[{type:"elem",elem:t},{type:"kern",size:u.kern},{type:"elem",elem:u.elem,marginLeft:gt(a)},{type:"kern",size:n.fontMetrics().bigOpSpacing5}]},n)}else return t;var v=[f];if(l&&a!==0&&!o){var y=Fe.makeSpan(["mspace"],[],n);y.style.marginRight=gt(a),v.unshift(y)}return Fe.makeSpan(["mop","op-limits"],v,n)},jF=["\\smallint"],_d=(t,e)=>{var r,n,i=!1,a;t.type==="supsub"?(r=t.sup,n=t.sub,a=Qt(t.base,"op"),i=!0):a=Qt(t,"op");var s=e.style,o=!1;s.size===Vt.DISPLAY.size&&a.symbol&&!jF.includes(a.name)&&(o=!0);var l;if(a.symbol){var u=o?"Size2-Regular":"Size1-Regular",h="";if((a.name==="\\oiint"||a.name==="\\oiiint")&&(h=a.name.slice(1),a.name=h==="oiint"?"\\iint":"\\iiint"),l=Fe.makeSymbol(a.name,u,"math",e,["mop","op-symbol",o?"large-op":"small-op"]),h.length>0){var d=l.italic,f=Fe.staticSvg(h+"Size"+(o?"2":"1"),e);l=Fe.makeVList({positionType:"individualShift",children:[{type:"elem",elem:l,shift:0},{type:"elem",elem:f,shift:o?.08:0}]},e),a.name="\\"+h,l.classes.unshift("mop"),l.italic=d}}else if(a.body){var p=Bn(a.body,e,!0);p.length===1&&p[0]instanceof ts?(l=p[0],l.classes[0]="mop"):l=Fe.makeSpan(["mop"],p,e)}else{for(var g=[],m=1;m<a.name.length;m++)g.push(Fe.mathsym(a.name[m],a.mode,e));l=Fe.makeSpan(["mop"],g,e)}var v=0,y=0;return(l instanceof ts||a.name==="\\oiint"||a.name==="\\oiiint")&&!a.suppressBaseShift&&(v=(l.height-l.depth)/2-e.fontMetrics().axisHeight,y=l.italic),i?XF(l,r,n,e,s,y,v):(v&&(l.style.position="relative",l.style.top=gt(v)),l)},Wp=(t,e)=>{var r;if(t.symbol)r=new Ea("mo",[rs(t.name,t.mode)]),jF.includes(t.name)&&r.setAttribute("largeop","false");else if(t.body)r=new Ea("mo",pa(t.body,e));else{r=new Ea("mi",[new Gs(t.name.slice(1))]);var n=new Ea("mo",[rs("⁡","text")]);t.parentIsSupSub?r=new Ea("mrow",[r,n]):r=EF([r,n])}return r},Ihe={"∏":"\\prod","∐":"\\coprod","∑":"\\sum","⋀":"\\bigwedge","⋁":"\\bigvee","⋂":"\\bigcap","⋃":"\\bigcup","⨀":"\\bigodot","⨁":"\\bigoplus","⨂":"\\bigotimes","⨄":"\\biguplus","⨆":"\\bigsqcup"};Et({type:"op",names:["\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigcap","\\bigcup","\\intop","\\prod","\\sum","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","∏","∐","∑","⋀","⋁","⋂","⋃","⨀","⨁","⨂","⨄","⨆"],props:{numArgs:0},handler:(t,e)=>{var{parser:r,funcName:n}=t,i=n;return i.length===1&&(i=Ihe[i]),{type:"op",mode:r.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:i}},htmlBuilder:_d,mathmlBuilder:Wp});Et({type:"op",names:["\\mathop"],props:{numArgs:1,primitive:!0},handler:(t,e)=>{var{parser:r}=t,n=e[0];return{type:"op",mode:r.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:yn(n)}},htmlBuilder:_d,mathmlBuilder:Wp});var Ohe={"∫":"\\int","∬":"\\iint","∭":"\\iiint","∮":"\\oint","∯":"\\oiint","∰":"\\oiiint"};Et({type:"op",names:["\\arcsin","\\arccos","\\arctan","\\arctg","\\arcctg","\\arg","\\ch","\\cos","\\cosec","\\cosh","\\cot","\\cotg","\\coth","\\csc","\\ctg","\\cth","\\deg","\\dim","\\exp","\\hom","\\ker","\\lg","\\ln","\\log","\\sec","\\sin","\\sinh","\\sh","\\tan","\\tanh","\\tg","\\th"],props:{numArgs:0},handler(t){var{parser:e,funcName:r}=t;return{type:"op",mode:e.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:r}},htmlBuilder:_d,mathmlBuilder:Wp});Et({type:"op",names:["\\det","\\gcd","\\inf","\\lim","\\max","\\min","\\Pr","\\sup"],props:{numArgs:0},handler(t){var{parser:e,funcName:r}=t;return{type:"op",mode:e.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:r}},htmlBuilder:_d,mathmlBuilder:Wp});Et({type:"op",names:["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","∫","∬","∭","∮","∯","∰"],props:{numArgs:0},handler(t){var{parser:e,funcName:r}=t,n=r;return n.length===1&&(n=Ohe[n]),{type:"op",mode:e.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:n}},htmlBuilder:_d,mathmlBuilder:Wp});var KF=(t,e)=>{var r,n,i=!1,a;t.type==="supsub"?(r=t.sup,n=t.sub,a=Qt(t.base,"operatorname"),i=!0):a=Qt(t,"operatorname");var s;if(a.body.length>0){for(var o=a.body.map(d=>{var f=d.text;return typeof f=="string"?{type:"textord",mode:d.mode,text:f}:d}),l=Bn(o,e.withFont("mathrm"),!0),u=0;u<l.length;u++){var h=l[u];h instanceof ts&&(h.text=h.text.replace(/\u2212/,"-").replace(/\u2217/,"*"))}s=Fe.makeSpan(["mop"],l,e)}else s=Fe.makeSpan(["mop"],[],e);return i?XF(s,r,n,e,e.style,0,0):s},Phe=(t,e)=>{for(var r=pa(t.body,e.withFont("mathrm")),n=!0,i=0;i<r.length;i++){var a=r[i];if(!(a instanceof it.SpaceNode))if(a instanceof it.MathNode)switch(a.type){case"mi":case"mn":case"ms":case"mspace":case"mtext":break;case"mo":{var s=a.children[0];a.children.length===1&&s instanceof it.TextNode?s.text=s.text.replace(/\u2212/,"-").replace(/\u2217/,"*"):n=!1;break}default:n=!1}else n=!1}if(n){var o=r.map(h=>h.toText()).join("");r=[new it.TextNode(o)]}var l=new it.MathNode("mi",r);l.setAttribute("mathvariant","normal");var u=new it.MathNode("mo",[rs("⁡","text")]);return t.parentIsSupSub?new it.MathNode("mrow",[l,u]):it.newDocumentFragment([l,u])};Et({type:"operatorname",names:["\\operatorname@","\\operatornamewithlimits"],props:{numArgs:1},handler:(t,e)=>{var{parser:r,funcName:n}=t,i=e[0];return{type:"operatorname",mode:r.mode,body:yn(i),alwaysHandleSupSub:n==="\\operatornamewithlimits",limits:!1,parentIsSupSub:!1}},htmlBuilder:KF,mathmlBuilder:Phe});le("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@");Du({type:"ordgroup",htmlBuilder(t,e){return t.semisimple?Fe.makeFragment(Bn(t.body,e,!1)):Fe.makeSpan(["mord"],Bn(t.body,e,!0),e)},mathmlBuilder(t,e){return zl(t.body,e,!0)}});Et({type:"overline",names:["\\overline"],props:{numArgs:1},handler(t,e){var{parser:r}=t,n=e[0];return{type:"overline",mode:r.mode,body:n}},htmlBuilder(t,e){var r=yr(t.body,e.havingCrampedStyle()),n=Fe.makeLineSpan("overline-line",e),i=e.fontMetrics().defaultRuleThickness,a=Fe.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:r},{type:"kern",size:3*i},{type:"elem",elem:n},{type:"kern",size:i}]},e);return Fe.makeSpan(["mord","overline"],[a],e)},mathmlBuilder(t,e){var r=new it.MathNode("mo",[new it.TextNode("‾")]);r.setAttribute("stretchy","true");var n=new it.MathNode("mover",[Fr(t.body,e),r]);return n.setAttribute("accent","true"),n}});Et({type:"phantom",names:["\\phantom"],props:{numArgs:1,allowedInText:!0},handler:(t,e)=>{var{parser:r}=t,n=e[0];return{type:"phantom",mode:r.mode,body:yn(n)}},htmlBuilder:(t,e)=>{var r=Bn(t.body,e.withPhantom(),!1);return Fe.makeFragment(r)},mathmlBuilder:(t,e)=>{var r=pa(t.body,e);return new it.MathNode("mphantom",r)}});Et({type:"hphantom",names:["\\hphantom"],props:{numArgs:1,allowedInText:!0},handler:(t,e)=>{var{parser:r}=t,n=e[0];return{type:"hphantom",mode:r.mode,body:n}},htmlBuilder:(t,e)=>{var r=Fe.makeSpan([],[yr(t.body,e.withPhantom())]);if(r.height=0,r.depth=0,r.children)for(var n=0;n<r.children.length;n++)r.children[n].height=0,r.children[n].depth=0;return r=Fe.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:r}]},e),Fe.makeSpan(["mord"],[r],e)},mathmlBuilder:(t,e)=>{var r=pa(yn(t.body),e),n=new it.MathNode("mphantom",r),i=new it.MathNode("mpadded",[n]);return i.setAttribute("height","0px"),i.setAttribute("depth","0px"),i}});Et({type:"vphantom",names:["\\vphantom"],props:{numArgs:1,allowedInText:!0},handler:(t,e)=>{var{parser:r}=t,n=e[0];return{type:"vphantom",mode:r.mode,body:n}},htmlBuilder:(t,e)=>{var r=Fe.makeSpan(["inner"],[yr(t.body,e.withPhantom())]),n=Fe.makeSpan(["fix"],[]);return Fe.makeSpan(["mord","rlap"],[r,n],e)},mathmlBuilder:(t,e)=>{var r=pa(yn(t.body),e),n=new it.MathNode("mphantom",r),i=new it.MathNode("mpadded",[n]);return i.setAttribute("width","0px"),i}});Et({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler(t,e){var{parser:r}=t,n=Qt(e[0],"size").value,i=e[1];return{type:"raisebox",mode:r.mode,dy:n,body:i}},htmlBuilder(t,e){var r=yr(t.body,e),n=en(t.dy,e);return Fe.makeVList({positionType:"shift",positionData:-n,children:[{type:"elem",elem:r}]},e)},mathmlBuilder(t,e){var r=new it.MathNode("mpadded",[Fr(t.body,e)]),n=t.dy.number+t.dy.unit;return r.setAttribute("voffset",n),r}});Et({type:"internal",names:["\\relax"],props:{numArgs:0,allowedInText:!0,allowedInArgument:!0},handler(t){var{parser:e}=t;return{type:"internal",mode:e.mode}}});Et({type:"rule",names:["\\rule"],props:{numArgs:2,numOptionalArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["size","size","size"]},handler(t,e,r){var{parser:n}=t,i=r[0],a=Qt(e[0],"size"),s=Qt(e[1],"size");return{type:"rule",mode:n.mode,shift:i&&Qt(i,"size").value,width:a.value,height:s.value}},htmlBuilder(t,e){var r=Fe.makeSpan(["mord","rule"],[],e),n=en(t.width,e),i=en(t.height,e),a=t.shift?en(t.shift,e):0;return r.style.borderRightWidth=gt(n),r.style.borderTopWidth=gt(i),r.style.bottom=gt(a),r.width=n,r.height=i+a,r.depth=-a,r.maxFontSize=i*1.125*e.sizeMultiplier,r},mathmlBuilder(t,e){var r=en(t.width,e),n=en(t.height,e),i=t.shift?en(t.shift,e):0,a=e.color&&e.getColor()||"black",s=new it.MathNode("mspace");s.setAttribute("mathbackground",a),s.setAttribute("width",gt(r)),s.setAttribute("height",gt(n));var o=new it.MathNode("mpadded",[s]);return i>=0?o.setAttribute("height",gt(i)):(o.setAttribute("height",gt(i)),o.setAttribute("depth",gt(-i))),o.setAttribute("voffset",gt(i)),o}});function ZF(t,e,r){for(var n=Bn(t,e,!1),i=e.sizeMultiplier/r.sizeMultiplier,a=0;a<n.length;a++){var s=n[a].classes.indexOf("sizing");s<0?Array.prototype.push.apply(n[a].classes,e.sizingClasses(r)):n[a].classes[s+1]==="reset-size"+e.size&&(n[a].classes[s+1]="reset-size"+r.size),n[a].height*=i,n[a].depth*=i}return Fe.makeFragment(n)}var qC=["\\tiny","\\sixptsize","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"],Bhe=(t,e)=>{var r=e.havingSize(t.size);return ZF(t.body,r,e)};Et({type:"sizing",names:qC,props:{numArgs:0,allowedInText:!0},handler:(t,e)=>{var{breakOnTokenText:r,funcName:n,parser:i}=t,a=i.parseExpression(!1,r);return{type:"sizing",mode:i.mode,size:qC.indexOf(n)+1,body:a}},htmlBuilder:Bhe,mathmlBuilder:(t,e)=>{var r=e.havingSize(t.size),n=pa(t.body,r),i=new it.MathNode("mstyle",n);return i.setAttribute("mathsize",gt(r.sizeMultiplier)),i}});Et({type:"smash",names:["\\smash"],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:(t,e,r)=>{var{parser:n}=t,i=!1,a=!1,s=r[0]&&Qt(r[0],"ordgroup");if(s)for(var o="",l=0;l<s.body.length;++l){var u=s.body[l];if(o=u.text,o==="t")i=!0;else if(o==="b")a=!0;else{i=!1,a=!1;break}}else i=!0,a=!0;var h=e[0];return{type:"smash",mode:n.mode,body:h,smashHeight:i,smashDepth:a}},htmlBuilder:(t,e)=>{var r=Fe.makeSpan([],[yr(t.body,e)]);if(!t.smashHeight&&!t.smashDepth)return r;if(t.smashHeight&&(r.height=0,r.children))for(var n=0;n<r.children.length;n++)r.children[n].height=0;if(t.smashDepth&&(r.depth=0,r.children))for(var i=0;i<r.children.length;i++)r.children[i].depth=0;var a=Fe.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:r}]},e);return Fe.makeSpan(["mord"],[a],e)},mathmlBuilder:(t,e)=>{var r=new it.MathNode("mpadded",[Fr(t.body,e)]);return t.smashHeight&&r.setAttribute("height","0px"),t.smashDepth&&r.setAttribute("depth","0px"),r}});Et({type:"sqrt",names:["\\sqrt"],props:{numArgs:1,numOptionalArgs:1},handler(t,e,r){var{parser:n}=t,i=r[0],a=e[0];return{type:"sqrt",mode:n.mode,body:a,index:i}},htmlBuilder(t,e){var r=yr(t.body,e.havingCrampedStyle());r.height===0&&(r.height=e.fontMetrics().xHeight),r=Fe.wrapFragment(r,e);var n=e.fontMetrics(),i=n.defaultRuleThickness,a=i;e.style.id<Vt.TEXT.id&&(a=e.fontMetrics().xHeight);var s=i+a/4,o=r.height+r.depth+s+i,{span:l,ruleWidth:u,advanceWidth:h}=$o.sqrtImage(o,e),d=l.height-u;d>r.height+r.depth+s&&(s=(s+d-r.height-r.depth)/2);var f=l.height-r.height-s-u;r.style.paddingLeft=gt(h);var p=Fe.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:r,wrapperClasses:["svg-align"]},{type:"kern",size:-(r.height+f)},{type:"elem",elem:l},{type:"kern",size:u}]},e);if(t.index){var g=e.havingStyle(Vt.SCRIPTSCRIPT),m=yr(t.index,g,e),v=.6*(p.height-p.depth),y=Fe.makeVList({positionType:"shift",positionData:-v,children:[{type:"elem",elem:m}]},e),b=Fe.makeSpan(["root"],[y]);return Fe.makeSpan(["mord","sqrt"],[b,p],e)}else return Fe.makeSpan(["mord","sqrt"],[p],e)},mathmlBuilder(t,e){var{body:r,index:n}=t;return n?new it.MathNode("mroot",[Fr(r,e),Fr(n,e)]):new it.MathNode("msqrt",[Fr(r,e)])}});var YC={display:Vt.DISPLAY,text:Vt.TEXT,script:Vt.SCRIPT,scriptscript:Vt.SCRIPTSCRIPT};Et({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t,e){var{breakOnTokenText:r,funcName:n,parser:i}=t,a=i.parseExpression(!0,r),s=n.slice(1,n.length-5);return{type:"styling",mode:i.mode,style:s,body:a}},htmlBuilder(t,e){var r=YC[t.style],n=e.havingStyle(r).withFont("");return ZF(t.body,n,e)},mathmlBuilder(t,e){var r=YC[t.style],n=e.havingStyle(r),i=pa(t.body,n),a=new it.MathNode("mstyle",i),s={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]},o=s[t.style];return a.setAttribute("scriptlevel",o[0]),a.setAttribute("displaystyle",o[1]),a}});var Fhe=function(e,r){var n=e.base;if(n)if(n.type==="op"){var i=n.limits&&(r.style.size===Vt.DISPLAY.size||n.alwaysHandleSupSub);return i?_d:null}else if(n.type==="operatorname"){var a=n.alwaysHandleSupSub&&(r.style.size===Vt.DISPLAY.size||n.limits);return a?KF:null}else{if(n.type==="accent")return Tr.isCharacterBox(n.base)?uE:null;if(n.type==="horizBrace"){var s=!e.sub;return s===n.isOver?YF:null}else return null}else return null};Du({type:"supsub",htmlBuilder(t,e){var r=Fhe(t,e);if(r)return r(t,e);var{base:n,sup:i,sub:a}=t,s=yr(n,e),o,l,u=e.fontMetrics(),h=0,d=0,f=n&&Tr.isCharacterBox(n);if(i){var p=e.havingStyle(e.style.sup());o=yr(i,p,e),f||(h=s.height-p.fontMetrics().supDrop*p.sizeMultiplier/e.sizeMultiplier)}if(a){var g=e.havingStyle(e.style.sub());l=yr(a,g,e),f||(d=s.depth+g.fontMetrics().subDrop*g.sizeMultiplier/e.sizeMultiplier)}var m;e.style===Vt.DISPLAY?m=u.sup1:e.style.cramped?m=u.sup3:m=u.sup2;var v=e.sizeMultiplier,y=gt(.5/u.ptPerEm/v),b=null;if(l){var w=t.base&&t.base.type==="op"&&t.base.name&&(t.base.name==="\\oiint"||t.base.name==="\\oiiint");(s instanceof ts||w)&&(b=gt(-s.italic))}var T;if(o&&l){h=Math.max(h,m,o.depth+.25*u.xHeight),d=Math.max(d,u.sub2);var E=u.defaultRuleThickness,L=4*E;if(h-o.depth-(l.height-d)<L){d=L-(h-o.depth)+l.height;var S=.8*u.xHeight-(h-o.depth);S>0&&(h+=S,d-=S)}var C=[{type:"elem",elem:l,shift:d,marginRight:y,marginLeft:b},{type:"elem",elem:o,shift:-h,marginRight:y}];T=Fe.makeVList({positionType:"individualShift",children:C},e)}else if(l){d=Math.max(d,u.sub1,l.height-.8*u.xHeight);var A=[{type:"elem",elem:l,marginLeft:b,marginRight:y}];T=Fe.makeVList({positionType:"shift",positionData:d,children:A},e)}else if(o)h=Math.max(h,m,o.depth+.25*u.xHeight),T=Fe.makeVList({positionType:"shift",positionData:-h,children:[{type:"elem",elem:o,marginRight:y}]},e);else throw new Error("supsub must have either sup or sub.");var N=K5(s,"right")||"mord";return Fe.makeSpan([N],[s,Fe.makeSpan(["msupsub"],[T])],e)},mathmlBuilder(t,e){var r=!1,n,i;t.base&&t.base.type==="horizBrace"&&(i=!!t.sup,i===t.base.isOver&&(r=!0,n=t.base.isOver)),t.base&&(t.base.type==="op"||t.base.type==="operatorname")&&(t.base.parentIsSupSub=!0);var a=[Fr(t.base,e)];t.sub&&a.push(Fr(t.sub,e)),t.sup&&a.push(Fr(t.sup,e));var s;if(r)s=n?"mover":"munder";else if(t.sub)if(t.sup){var u=t.base;u&&u.type==="op"&&u.limits&&e.style===Vt.DISPLAY||u&&u.type==="operatorname"&&u.alwaysHandleSupSub&&(e.style===Vt.DISPLAY||u.limits)?s="munderover":s="msubsup"}else{var l=t.base;l&&l.type==="op"&&l.limits&&(e.style===Vt.DISPLAY||l.alwaysHandleSupSub)||l&&l.type==="operatorname"&&l.alwaysHandleSupSub&&(l.limits||e.style===Vt.DISPLAY)?s="munder":s="msub"}else{var o=t.base;o&&o.type==="op"&&o.limits&&(e.style===Vt.DISPLAY||o.alwaysHandleSupSub)||o&&o.type==="operatorname"&&o.alwaysHandleSupSub&&(o.limits||e.style===Vt.DISPLAY)?s="mover":s="msup"}return new it.MathNode(s,a)}});Du({type:"atom",htmlBuilder(t,e){return Fe.mathsym(t.text,t.mode,e,["m"+t.family])},mathmlBuilder(t,e){var r=new it.MathNode("mo",[rs(t.text,t.mode)]);if(t.family==="bin"){var n=lE(t,e);n==="bold-italic"&&r.setAttribute("mathvariant",n)}else t.family==="punct"?r.setAttribute("separator","true"):(t.family==="open"||t.family==="close")&&r.setAttribute("stretchy","false");return r}});var QF={mi:"italic",mn:"normal",mtext:"normal"};Du({type:"mathord",htmlBuilder(t,e){return Fe.makeOrd(t,e,"mathord")},mathmlBuilder(t,e){var r=new it.MathNode("mi",[rs(t.text,t.mode,e)]),n=lE(t,e)||"italic";return n!==QF[r.type]&&r.setAttribute("mathvariant",n),r}});Du({type:"textord",htmlBuilder(t,e){return Fe.makeOrd(t,e,"textord")},mathmlBuilder(t,e){var r=rs(t.text,t.mode,e),n=lE(t,e)||"normal",i;return t.mode==="text"?i=new it.MathNode("mtext",[r]):/[0-9]/.test(t.text)?i=new it.MathNode("mn",[r]):t.text==="\\prime"?i=new it.MathNode("mo",[r]):i=new it.MathNode("mi",[r]),n!==QF[i.type]&&i.setAttribute("mathvariant",n),i}});var pb={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},gb={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};Du({type:"spacing",htmlBuilder(t,e){if(gb.hasOwnProperty(t.text)){var r=gb[t.text].className||"";if(t.mode==="text"){var n=Fe.makeOrd(t,e,"textord");return n.classes.push(r),n}else return Fe.makeSpan(["mspace",r],[Fe.mathsym(t.text,t.mode,e)],e)}else{if(pb.hasOwnProperty(t.text))return Fe.makeSpan(["mspace",pb[t.text]],[],e);throw new ot('Unknown type of space "'+t.text+'"')}},mathmlBuilder(t,e){var r;if(gb.hasOwnProperty(t.text))r=new it.MathNode("mtext",[new it.TextNode(" ")]);else{if(pb.hasOwnProperty(t.text))return new it.MathNode("mspace");throw new ot('Unknown type of space "'+t.text+'"')}return r}});var XC=()=>{var t=new it.MathNode("mtd",[]);return t.setAttribute("width","50%"),t};Du({type:"tag",mathmlBuilder(t,e){var r=new it.MathNode("mtable",[new it.MathNode("mtr",[XC(),new it.MathNode("mtd",[zl(t.body,e)]),XC(),new it.MathNode("mtd",[zl(t.tag,e)])])]);return r.setAttribute("width","100%"),r}});var jC={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},KC={"\\textbf":"textbf","\\textmd":"textmd"},$he={"\\textit":"textit","\\textup":"textup"},ZC=(t,e)=>{var r=t.font;if(r){if(jC[r])return e.withTextFontFamily(jC[r]);if(KC[r])return e.withTextFontWeight(KC[r]);if(r==="\\emph")return e.fontShape==="textit"?e.withTextFontShape("textup"):e.withTextFontShape("textit")}else return e;return e.withTextFontShape($he[r])};Et({type:"text",names:["\\text","\\textrm","\\textsf","\\texttt","\\textnormal","\\textbf","\\textmd","\\textit","\\textup","\\emph"],props:{numArgs:1,argTypes:["text"],allowedInArgument:!0,allowedInText:!0},handler(t,e){var{parser:r,funcName:n}=t,i=e[0];return{type:"text",mode:r.mode,body:yn(i),font:n}},htmlBuilder(t,e){var r=ZC(t,e),n=Bn(t.body,r,!0);return Fe.makeSpan(["mord","text"],n,r)},mathmlBuilder(t,e){var r=ZC(t,e);return zl(t.body,r)}});Et({type:"underline",names:["\\underline"],props:{numArgs:1,allowedInText:!0},handler(t,e){var{parser:r}=t;return{type:"underline",mode:r.mode,body:e[0]}},htmlBuilder(t,e){var r=yr(t.body,e),n=Fe.makeLineSpan("underline-line",e),i=e.fontMetrics().defaultRuleThickness,a=Fe.makeVList({positionType:"top",positionData:r.height,children:[{type:"kern",size:i},{type:"elem",elem:n},{type:"kern",size:3*i},{type:"elem",elem:r}]},e);return Fe.makeSpan(["mord","underline"],[a],e)},mathmlBuilder(t,e){var r=new it.MathNode("mo",[new it.TextNode("‾")]);r.setAttribute("stretchy","true");var n=new it.MathNode("munder",[Fr(t.body,e),r]);return n.setAttribute("accentunder","true"),n}});Et({type:"vcenter",names:["\\vcenter"],props:{numArgs:1,argTypes:["original"],allowedInText:!1},handler(t,e){var{parser:r}=t;return{type:"vcenter",mode:r.mode,body:e[0]}},htmlBuilder(t,e){var r=yr(t.body,e),n=e.fontMetrics().axisHeight,i=.5*(r.height-n-(r.depth+n));return Fe.makeVList({positionType:"shift",positionData:i,children:[{type:"elem",elem:r}]},e)},mathmlBuilder(t,e){return new it.MathNode("mpadded",[Fr(t.body,e)],["vcenter"])}});Et({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler(t,e,r){throw new ot("\\verb ended by end of line instead of matching delimiter")},htmlBuilder(t,e){for(var r=QC(t),n=[],i=e.havingStyle(e.style.text()),a=0;a<r.length;a++){var s=r[a];s==="~"&&(s="\\textasciitilde"),n.push(Fe.makeSymbol(s,"Typewriter-Regular",t.mode,i,["mord","texttt"]))}return Fe.makeSpan(["mord","text"].concat(i.sizingClasses(e)),Fe.tryCombineChars(n),i)},mathmlBuilder(t,e){var r=new it.TextNode(QC(t)),n=new it.MathNode("mtext",[r]);return n.setAttribute("mathvariant","monospace"),n}});var QC=t=>t.body.replace(/ /g,t.star?"␣":" "),wl=wF,JF=`[ \r
	]`,zhe="\\\\[a-zA-Z@]+",Vhe="\\\\[^\uD800-\uDFFF]",Ghe="("+zhe+")"+JF+"*",Uhe=`\\\\(
|[ \r	]+
?)[ \r	]*`,ew="[̀-ͯ]",Whe=new RegExp(ew+"+$"),Hhe="("+JF+"+)|"+(Uhe+"|")+"([!-\\[\\]-‧‪-퟿豈-]"+(ew+"*")+"|[\uD800-\uDBFF][\uDC00-\uDFFF]"+(ew+"*")+"|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5"+("|"+Ghe)+("|"+Vhe+")");let JC=class{constructor(e,r){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=e,this.settings=r,this.tokenRegex=new RegExp(Hhe,"g"),this.catcodes={"%":14,"~":13}}setCatcode(e,r){this.catcodes[e]=r}lex(){var e=this.input,r=this.tokenRegex.lastIndex;if(r===e.length)return new Sa("EOF",new ra(this,r,r));var n=this.tokenRegex.exec(e);if(n===null||n.index!==r)throw new ot("Unexpected character: '"+e[r]+"'",new Sa(e[r],new ra(this,r,r+1)));var i=n[6]||n[3]||(n[2]?"\\ ":" ");if(this.catcodes[i]===14){var a=e.indexOf(`
`,this.tokenRegex.lastIndex);return a===-1?(this.tokenRegex.lastIndex=e.length,this.settings.reportNonstrict("commentAtEnd","% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)")):this.tokenRegex.lastIndex=a+1,this.lex()}return new Sa(i,new ra(this,r,this.tokenRegex.lastIndex))}};class qhe{constructor(e,r){e===void 0&&(e={}),r===void 0&&(r={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=r,this.builtins=e,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(this.undefStack.length===0)throw new ot("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");var e=this.undefStack.pop();for(var r in e)e.hasOwnProperty(r)&&(e[r]==null?delete this.current[r]:this.current[r]=e[r])}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(e){return this.current.hasOwnProperty(e)||this.builtins.hasOwnProperty(e)}get(e){return this.current.hasOwnProperty(e)?this.current[e]:this.builtins[e]}set(e,r,n){if(n===void 0&&(n=!1),n){for(var i=0;i<this.undefStack.length;i++)delete this.undefStack[i][e];this.undefStack.length>0&&(this.undefStack[this.undefStack.length-1][e]=r)}else{var a=this.undefStack[this.undefStack.length-1];a&&!a.hasOwnProperty(e)&&(a[e]=this.current[e])}r==null?delete this.current[e]:this.current[e]=r}}var Yhe=GF;le("\\noexpand",function(t){var e=t.popToken();return t.isExpandable(e.text)&&(e.noexpand=!0,e.treatAsRelax=!0),{tokens:[e],numArgs:0}});le("\\expandafter",function(t){var e=t.popToken();return t.expandOnce(!0),{tokens:[e],numArgs:0}});le("\\@firstoftwo",function(t){var e=t.consumeArgs(2);return{tokens:e[0],numArgs:0}});le("\\@secondoftwo",function(t){var e=t.consumeArgs(2);return{tokens:e[1],numArgs:0}});le("\\@ifnextchar",function(t){var e=t.consumeArgs(3);t.consumeSpaces();var r=t.future();return e[0].length===1&&e[0][0].text===r.text?{tokens:e[1],numArgs:0}:{tokens:e[2],numArgs:0}});le("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}");le("\\TextOrMath",function(t){var e=t.consumeArgs(2);return t.mode==="text"?{tokens:e[0],numArgs:0}:{tokens:e[1],numArgs:0}});var e8={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};le("\\char",function(t){var e=t.popToken(),r,n="";if(e.text==="'")r=8,e=t.popToken();else if(e.text==='"')r=16,e=t.popToken();else if(e.text==="`")if(e=t.popToken(),e.text[0]==="\\")n=e.text.charCodeAt(1);else{if(e.text==="EOF")throw new ot("\\char` missing argument");n=e.text.charCodeAt(0)}else r=10;if(r){if(n=e8[e.text],n==null||n>=r)throw new ot("Invalid base-"+r+" digit "+e.text);for(var i;(i=e8[t.future().text])!=null&&i<r;)n*=r,n+=i,t.popToken()}return"\\@char{"+n+"}"});var yE=(t,e,r,n)=>{var i=t.consumeArg().tokens;if(i.length!==1)throw new ot("\\newcommand's first argument must be a macro name");var a=i[0].text,s=t.isDefined(a);if(s&&!e)throw new ot("\\newcommand{"+a+"} attempting to redefine "+(a+"; use \\renewcommand"));if(!s&&!r)throw new ot("\\renewcommand{"+a+"} when command "+a+" does not yet exist; use \\newcommand");var o=0;if(i=t.consumeArg().tokens,i.length===1&&i[0].text==="["){for(var l="",u=t.expandNextToken();u.text!=="]"&&u.text!=="EOF";)l+=u.text,u=t.expandNextToken();if(!l.match(/^\s*[0-9]+\s*$/))throw new ot("Invalid number of arguments: "+l);o=parseInt(l),i=t.consumeArg().tokens}return s&&n||t.macros.set(a,{tokens:i,numArgs:o}),""};le("\\newcommand",t=>yE(t,!1,!0,!1));le("\\renewcommand",t=>yE(t,!0,!1,!1));le("\\providecommand",t=>yE(t,!0,!0,!0));le("\\message",t=>{var e=t.consumeArgs(1)[0];return console.log(e.reverse().map(r=>r.text).join("")),""});le("\\errmessage",t=>{var e=t.consumeArgs(1)[0];return console.error(e.reverse().map(r=>r.text).join("")),""});le("\\show",t=>{var e=t.popToken(),r=e.text;return console.log(e,t.macros.get(r),wl[r],Vr.math[r],Vr.text[r]),""});le("\\bgroup","{");le("\\egroup","}");le("~","\\nobreakspace");le("\\lq","`");le("\\rq","'");le("\\aa","\\r a");le("\\AA","\\r A");le("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}");le("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}");le("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}");le("ℬ","\\mathscr{B}");le("ℰ","\\mathscr{E}");le("ℱ","\\mathscr{F}");le("ℋ","\\mathscr{H}");le("ℐ","\\mathscr{I}");le("ℒ","\\mathscr{L}");le("ℳ","\\mathscr{M}");le("ℛ","\\mathscr{R}");le("ℭ","\\mathfrak{C}");le("ℌ","\\mathfrak{H}");le("ℨ","\\mathfrak{Z}");le("\\Bbbk","\\Bbb{k}");le("·","\\cdotp");le("\\llap","\\mathllap{\\textrm{#1}}");le("\\rlap","\\mathrlap{\\textrm{#1}}");le("\\clap","\\mathclap{\\textrm{#1}}");le("\\mathstrut","\\vphantom{(}");le("\\underbar","\\underline{\\text{#1}}");le("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}}{\\char"338}');le("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}");le("\\ne","\\neq");le("≠","\\neq");le("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}");le("∉","\\notin");le("≘","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}");le("≙","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}");le("≚","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}");le("≛","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}");le("≝","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}");le("≞","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}");le("≟","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}");le("⟂","\\perp");le("‼","\\mathclose{!\\mkern-0.8mu!}");le("∌","\\notni");le("⌜","\\ulcorner");le("⌝","\\urcorner");le("⌞","\\llcorner");le("⌟","\\lrcorner");le("©","\\copyright");le("®","\\textregistered");le("️","\\textregistered");le("\\ulcorner",'\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}');le("\\urcorner",'\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}');le("\\llcorner",'\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}');le("\\lrcorner",'\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}');le("\\vdots","{\\varvdots\\rule{0pt}{15pt}}");le("⋮","\\vdots");le("\\varGamma","\\mathit{\\Gamma}");le("\\varDelta","\\mathit{\\Delta}");le("\\varTheta","\\mathit{\\Theta}");le("\\varLambda","\\mathit{\\Lambda}");le("\\varXi","\\mathit{\\Xi}");le("\\varPi","\\mathit{\\Pi}");le("\\varSigma","\\mathit{\\Sigma}");le("\\varUpsilon","\\mathit{\\Upsilon}");le("\\varPhi","\\mathit{\\Phi}");le("\\varPsi","\\mathit{\\Psi}");le("\\varOmega","\\mathit{\\Omega}");le("\\substack","\\begin{subarray}{c}#1\\end{subarray}");le("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax");le("\\boxed","\\fbox{$\\displaystyle{#1}$}");le("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;");le("\\implies","\\DOTSB\\;\\Longrightarrow\\;");le("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;");le("\\dddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}");le("\\ddddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}");var t8={",":"\\dotsc","\\not":"\\dotsb","+":"\\dotsb","=":"\\dotsb","<":"\\dotsb",">":"\\dotsb","-":"\\dotsb","*":"\\dotsb",":":"\\dotsb","\\DOTSB":"\\dotsb","\\coprod":"\\dotsb","\\bigvee":"\\dotsb","\\bigwedge":"\\dotsb","\\biguplus":"\\dotsb","\\bigcap":"\\dotsb","\\bigcup":"\\dotsb","\\prod":"\\dotsb","\\sum":"\\dotsb","\\bigotimes":"\\dotsb","\\bigoplus":"\\dotsb","\\bigodot":"\\dotsb","\\bigsqcup":"\\dotsb","\\And":"\\dotsb","\\longrightarrow":"\\dotsb","\\Longrightarrow":"\\dotsb","\\longleftarrow":"\\dotsb","\\Longleftarrow":"\\dotsb","\\longleftrightarrow":"\\dotsb","\\Longleftrightarrow":"\\dotsb","\\mapsto":"\\dotsb","\\longmapsto":"\\dotsb","\\hookrightarrow":"\\dotsb","\\doteq":"\\dotsb","\\mathbin":"\\dotsb","\\mathrel":"\\dotsb","\\relbar":"\\dotsb","\\Relbar":"\\dotsb","\\xrightarrow":"\\dotsb","\\xleftarrow":"\\dotsb","\\DOTSI":"\\dotsi","\\int":"\\dotsi","\\oint":"\\dotsi","\\iint":"\\dotsi","\\iiint":"\\dotsi","\\iiiint":"\\dotsi","\\idotsint":"\\dotsi","\\DOTSX":"\\dotsx"};le("\\dots",function(t){var e="\\dotso",r=t.expandAfterFuture().text;return r in t8?e=t8[r]:(r.slice(0,4)==="\\not"||r in Vr.math&&["bin","rel"].includes(Vr.math[r].group))&&(e="\\dotsb"),e});var xE={")":!0,"]":!0,"\\rbrack":!0,"\\}":!0,"\\rbrace":!0,"\\rangle":!0,"\\rceil":!0,"\\rfloor":!0,"\\rgroup":!0,"\\rmoustache":!0,"\\right":!0,"\\bigr":!0,"\\biggr":!0,"\\Bigr":!0,"\\Biggr":!0,$:!0,";":!0,".":!0,",":!0};le("\\dotso",function(t){var e=t.future().text;return e in xE?"\\ldots\\,":"\\ldots"});le("\\dotsc",function(t){var e=t.future().text;return e in xE&&e!==","?"\\ldots\\,":"\\ldots"});le("\\cdots",function(t){var e=t.future().text;return e in xE?"\\@cdots\\,":"\\@cdots"});le("\\dotsb","\\cdots");le("\\dotsm","\\cdots");le("\\dotsi","\\!\\cdots");le("\\dotsx","\\ldots\\,");le("\\DOTSI","\\relax");le("\\DOTSB","\\relax");le("\\DOTSX","\\relax");le("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax");le("\\,","\\tmspace+{3mu}{.1667em}");le("\\thinspace","\\,");le("\\>","\\mskip{4mu}");le("\\:","\\tmspace+{4mu}{.2222em}");le("\\medspace","\\:");le("\\;","\\tmspace+{5mu}{.2777em}");le("\\thickspace","\\;");le("\\!","\\tmspace-{3mu}{.1667em}");le("\\negthinspace","\\!");le("\\negmedspace","\\tmspace-{4mu}{.2222em}");le("\\negthickspace","\\tmspace-{5mu}{.277em}");le("\\enspace","\\kern.5em ");le("\\enskip","\\hskip.5em\\relax");le("\\quad","\\hskip1em\\relax");le("\\qquad","\\hskip2em\\relax");le("\\tag","\\@ifstar\\tag@literal\\tag@paren");le("\\tag@paren","\\tag@literal{({#1})}");le("\\tag@literal",t=>{if(t.macros.get("\\df@tag"))throw new ot("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"});le("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}");le("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)");le("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}");le("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1");le("\\newline","\\\\\\relax");le("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");var e$=gt(Vs["Main-Regular"][84][1]-.7*Vs["Main-Regular"][65][1]);le("\\LaTeX","\\textrm{\\html@mathml{"+("L\\kern-.36em\\raisebox{"+e$+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{LaTeX}}");le("\\KaTeX","\\textrm{\\html@mathml{"+("K\\kern-.17em\\raisebox{"+e$+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{KaTeX}}");le("\\hspace","\\@ifstar\\@hspacer\\@hspace");le("\\@hspace","\\hskip #1\\relax");le("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax");le("\\ordinarycolon",":");le("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}");le("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}');le("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}');le("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}');le("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}');le("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}');le("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}');le("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}');le("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}');le("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}');le("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}');le("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}');le("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}');le("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}');le("∷","\\dblcolon");le("∹","\\eqcolon");le("≔","\\coloneqq");le("≕","\\eqqcolon");le("⩴","\\Coloneqq");le("\\ratio","\\vcentcolon");le("\\coloncolon","\\dblcolon");le("\\colonequals","\\coloneqq");le("\\coloncolonequals","\\Coloneqq");le("\\equalscolon","\\eqqcolon");le("\\equalscoloncolon","\\Eqqcolon");le("\\colonminus","\\coloneq");le("\\coloncolonminus","\\Coloneq");le("\\minuscolon","\\eqcolon");le("\\minuscoloncolon","\\Eqcolon");le("\\coloncolonapprox","\\Colonapprox");le("\\coloncolonsim","\\Colonsim");le("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}");le("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}");le("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}");le("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}");le("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}");le("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}");le("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}");le("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}");le("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}");le("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}");le("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}");le("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}");le("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}");le("\\gvertneqq","\\html@mathml{\\@gvertneqq}{≩}");le("\\lvertneqq","\\html@mathml{\\@lvertneqq}{≨}");le("\\ngeqq","\\html@mathml{\\@ngeqq}{≱}");le("\\ngeqslant","\\html@mathml{\\@ngeqslant}{≱}");le("\\nleqq","\\html@mathml{\\@nleqq}{≰}");le("\\nleqslant","\\html@mathml{\\@nleqslant}{≰}");le("\\nshortmid","\\html@mathml{\\@nshortmid}{∤}");le("\\nshortparallel","\\html@mathml{\\@nshortparallel}{∦}");le("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{⊈}");le("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{⊉}");le("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{⊊}");le("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{⫋}");le("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{⊋}");le("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{⫌}");le("\\imath","\\html@mathml{\\@imath}{ı}");le("\\jmath","\\html@mathml{\\@jmath}{ȷ}");le("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}");le("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}");le("⟦","\\llbracket");le("⟧","\\rrbracket");le("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}");le("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}");le("⦃","\\lBrace");le("⦄","\\rBrace");le("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}");le("⦵","\\minuso");le("\\darr","\\downarrow");le("\\dArr","\\Downarrow");le("\\Darr","\\Downarrow");le("\\lang","\\langle");le("\\rang","\\rangle");le("\\uarr","\\uparrow");le("\\uArr","\\Uparrow");le("\\Uarr","\\Uparrow");le("\\N","\\mathbb{N}");le("\\R","\\mathbb{R}");le("\\Z","\\mathbb{Z}");le("\\alef","\\aleph");le("\\alefsym","\\aleph");le("\\Alpha","\\mathrm{A}");le("\\Beta","\\mathrm{B}");le("\\bull","\\bullet");le("\\Chi","\\mathrm{X}");le("\\clubs","\\clubsuit");le("\\cnums","\\mathbb{C}");le("\\Complex","\\mathbb{C}");le("\\Dagger","\\ddagger");le("\\diamonds","\\diamondsuit");le("\\empty","\\emptyset");le("\\Epsilon","\\mathrm{E}");le("\\Eta","\\mathrm{H}");le("\\exist","\\exists");le("\\harr","\\leftrightarrow");le("\\hArr","\\Leftrightarrow");le("\\Harr","\\Leftrightarrow");le("\\hearts","\\heartsuit");le("\\image","\\Im");le("\\infin","\\infty");le("\\Iota","\\mathrm{I}");le("\\isin","\\in");le("\\Kappa","\\mathrm{K}");le("\\larr","\\leftarrow");le("\\lArr","\\Leftarrow");le("\\Larr","\\Leftarrow");le("\\lrarr","\\leftrightarrow");le("\\lrArr","\\Leftrightarrow");le("\\Lrarr","\\Leftrightarrow");le("\\Mu","\\mathrm{M}");le("\\natnums","\\mathbb{N}");le("\\Nu","\\mathrm{N}");le("\\Omicron","\\mathrm{O}");le("\\plusmn","\\pm");le("\\rarr","\\rightarrow");le("\\rArr","\\Rightarrow");le("\\Rarr","\\Rightarrow");le("\\real","\\Re");le("\\reals","\\mathbb{R}");le("\\Reals","\\mathbb{R}");le("\\Rho","\\mathrm{P}");le("\\sdot","\\cdot");le("\\sect","\\S");le("\\spades","\\spadesuit");le("\\sub","\\subset");le("\\sube","\\subseteq");le("\\supe","\\supseteq");le("\\Tau","\\mathrm{T}");le("\\thetasym","\\vartheta");le("\\weierp","\\wp");le("\\Zeta","\\mathrm{Z}");le("\\argmin","\\DOTSB\\operatorname*{arg\\,min}");le("\\argmax","\\DOTSB\\operatorname*{arg\\,max}");le("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits");le("\\bra","\\mathinner{\\langle{#1}|}");le("\\ket","\\mathinner{|{#1}\\rangle}");le("\\braket","\\mathinner{\\langle{#1}\\rangle}");le("\\Bra","\\left\\langle#1\\right|");le("\\Ket","\\left|#1\\right\\rangle");var t$=t=>e=>{var r=e.consumeArg().tokens,n=e.consumeArg().tokens,i=e.consumeArg().tokens,a=e.consumeArg().tokens,s=e.macros.get("|"),o=e.macros.get("\\|");e.macros.beginGroup();var l=d=>f=>{t&&(f.macros.set("|",s),i.length&&f.macros.set("\\|",o));var p=d;if(!d&&i.length){var g=f.future();g.text==="|"&&(f.popToken(),p=!0)}return{tokens:p?i:n,numArgs:0}};e.macros.set("|",l(!1)),i.length&&e.macros.set("\\|",l(!0));var u=e.consumeArg().tokens,h=e.expandTokens([...a,...u,...r]);return e.macros.endGroup(),{tokens:h.reverse(),numArgs:0}};le("\\bra@ket",t$(!1));le("\\bra@set",t$(!0));le("\\Braket","\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}");le("\\Set","\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}");le("\\set","\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}");le("\\angln","{\\angl n}");le("\\blue","\\textcolor{##6495ed}{#1}");le("\\orange","\\textcolor{##ffa500}{#1}");le("\\pink","\\textcolor{##ff00af}{#1}");le("\\red","\\textcolor{##df0030}{#1}");le("\\green","\\textcolor{##28ae7b}{#1}");le("\\gray","\\textcolor{gray}{#1}");le("\\purple","\\textcolor{##9d38bd}{#1}");le("\\blueA","\\textcolor{##ccfaff}{#1}");le("\\blueB","\\textcolor{##80f6ff}{#1}");le("\\blueC","\\textcolor{##63d9ea}{#1}");le("\\blueD","\\textcolor{##11accd}{#1}");le("\\blueE","\\textcolor{##0c7f99}{#1}");le("\\tealA","\\textcolor{##94fff5}{#1}");le("\\tealB","\\textcolor{##26edd5}{#1}");le("\\tealC","\\textcolor{##01d1c1}{#1}");le("\\tealD","\\textcolor{##01a995}{#1}");le("\\tealE","\\textcolor{##208170}{#1}");le("\\greenA","\\textcolor{##b6ffb0}{#1}");le("\\greenB","\\textcolor{##8af281}{#1}");le("\\greenC","\\textcolor{##74cf70}{#1}");le("\\greenD","\\textcolor{##1fab54}{#1}");le("\\greenE","\\textcolor{##0d923f}{#1}");le("\\goldA","\\textcolor{##ffd0a9}{#1}");le("\\goldB","\\textcolor{##ffbb71}{#1}");le("\\goldC","\\textcolor{##ff9c39}{#1}");le("\\goldD","\\textcolor{##e07d10}{#1}");le("\\goldE","\\textcolor{##a75a05}{#1}");le("\\redA","\\textcolor{##fca9a9}{#1}");le("\\redB","\\textcolor{##ff8482}{#1}");le("\\redC","\\textcolor{##f9685d}{#1}");le("\\redD","\\textcolor{##e84d39}{#1}");le("\\redE","\\textcolor{##bc2612}{#1}");le("\\maroonA","\\textcolor{##ffbde0}{#1}");le("\\maroonB","\\textcolor{##ff92c6}{#1}");le("\\maroonC","\\textcolor{##ed5fa6}{#1}");le("\\maroonD","\\textcolor{##ca337c}{#1}");le("\\maroonE","\\textcolor{##9e034e}{#1}");le("\\purpleA","\\textcolor{##ddd7ff}{#1}");le("\\purpleB","\\textcolor{##c6b9fc}{#1}");le("\\purpleC","\\textcolor{##aa87ff}{#1}");le("\\purpleD","\\textcolor{##7854ab}{#1}");le("\\purpleE","\\textcolor{##543b78}{#1}");le("\\mintA","\\textcolor{##f5f9e8}{#1}");le("\\mintB","\\textcolor{##edf2df}{#1}");le("\\mintC","\\textcolor{##e0e5cc}{#1}");le("\\grayA","\\textcolor{##f6f7f7}{#1}");le("\\grayB","\\textcolor{##f0f1f2}{#1}");le("\\grayC","\\textcolor{##e3e5e6}{#1}");le("\\grayD","\\textcolor{##d6d8da}{#1}");le("\\grayE","\\textcolor{##babec2}{#1}");le("\\grayF","\\textcolor{##888d93}{#1}");le("\\grayG","\\textcolor{##626569}{#1}");le("\\grayH","\\textcolor{##3b3e40}{#1}");le("\\grayI","\\textcolor{##21242c}{#1}");le("\\kaBlue","\\textcolor{##314453}{#1}");le("\\kaGreen","\\textcolor{##71B307}{#1}");var r$={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0};class Xhe{constructor(e,r,n){this.settings=void 0,this.expansionCount=void 0,this.lexer=void 0,this.macros=void 0,this.stack=void 0,this.mode=void 0,this.settings=r,this.expansionCount=0,this.feed(e),this.macros=new qhe(Yhe,r.macros),this.mode=n,this.stack=[]}feed(e){this.lexer=new JC(e,this.settings)}switchMode(e){this.mode=e}beginGroup(){this.macros.beginGroup()}endGroup(){this.macros.endGroup()}endGroups(){this.macros.endGroups()}future(){return this.stack.length===0&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]}popToken(){return this.future(),this.stack.pop()}pushToken(e){this.stack.push(e)}pushTokens(e){this.stack.push(...e)}scanArgument(e){var r,n,i;if(e){if(this.consumeSpaces(),this.future().text!=="[")return null;r=this.popToken(),{tokens:i,end:n}=this.consumeArg(["]"])}else({tokens:i,start:r,end:n}=this.consumeArg());return this.pushToken(new Sa("EOF",n.loc)),this.pushTokens(i),new Sa("",ra.range(r,n))}consumeSpaces(){for(;;){var e=this.future();if(e.text===" ")this.stack.pop();else break}}consumeArg(e){var r=[],n=e&&e.length>0;n||this.consumeSpaces();var i=this.future(),a,s=0,o=0;do{if(a=this.popToken(),r.push(a),a.text==="{")++s;else if(a.text==="}"){if(--s,s===-1)throw new ot("Extra }",a)}else if(a.text==="EOF")throw new ot("Unexpected end of input in a macro argument, expected '"+(e&&n?e[o]:"}")+"'",a);if(e&&n)if((s===0||s===1&&e[o]==="{")&&a.text===e[o]){if(++o,o===e.length){r.splice(-o,o);break}}else o=0}while(s!==0||n);return i.text==="{"&&r[r.length-1].text==="}"&&(r.pop(),r.shift()),r.reverse(),{tokens:r,start:i,end:a}}consumeArgs(e,r){if(r){if(r.length!==e+1)throw new ot("The length of delimiters doesn't match the number of args!");for(var n=r[0],i=0;i<n.length;i++){var a=this.popToken();if(n[i]!==a.text)throw new ot("Use of the macro doesn't match its definition",a)}}for(var s=[],o=0;o<e;o++)s.push(this.consumeArg(r&&r[o+1]).tokens);return s}countExpansion(e){if(this.expansionCount+=e,this.expansionCount>this.settings.maxExpand)throw new ot("Too many expansions: infinite loop or need to increase maxExpand setting")}expandOnce(e){var r=this.popToken(),n=r.text,i=r.noexpand?null:this._getExpansion(n);if(i==null||e&&i.unexpandable){if(e&&i==null&&n[0]==="\\"&&!this.isDefined(n))throw new ot("Undefined control sequence: "+n);return this.pushToken(r),!1}this.countExpansion(1);var a=i.tokens,s=this.consumeArgs(i.numArgs,i.delimiters);if(i.numArgs){a=a.slice();for(var o=a.length-1;o>=0;--o){var l=a[o];if(l.text==="#"){if(o===0)throw new ot("Incomplete placeholder at end of macro body",l);if(l=a[--o],l.text==="#")a.splice(o+1,1);else if(/^[1-9]$/.test(l.text))a.splice(o,2,...s[+l.text-1]);else throw new ot("Not a valid argument number",l)}}}return this.pushTokens(a),a.length}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;)if(this.expandOnce()===!1){var e=this.stack.pop();return e.treatAsRelax&&(e.text="\\relax"),e}throw new Error}expandMacro(e){return this.macros.has(e)?this.expandTokens([new Sa(e)]):void 0}expandTokens(e){var r=[],n=this.stack.length;for(this.pushTokens(e);this.stack.length>n;)if(this.expandOnce(!0)===!1){var i=this.stack.pop();i.treatAsRelax&&(i.noexpand=!1,i.treatAsRelax=!1),r.push(i)}return this.countExpansion(r.length),r}expandMacroAsText(e){var r=this.expandMacro(e);return r&&r.map(n=>n.text).join("")}_getExpansion(e){var r=this.macros.get(e);if(r==null)return r;if(e.length===1){var n=this.lexer.catcodes[e];if(n!=null&&n!==13)return}var i=typeof r=="function"?r(this):r;if(typeof i=="string"){var a=0;if(i.indexOf("#")!==-1)for(var s=i.replace(/##/g,"");s.indexOf("#"+(a+1))!==-1;)++a;for(var o=new JC(i,this.settings),l=[],u=o.lex();u.text!=="EOF";)l.push(u),u=o.lex();l.reverse();var h={tokens:l,numArgs:a};return h}return i}isDefined(e){return this.macros.has(e)||wl.hasOwnProperty(e)||Vr.math.hasOwnProperty(e)||Vr.text.hasOwnProperty(e)||r$.hasOwnProperty(e)}isExpandable(e){var r=this.macros.get(e);return r!=null?typeof r=="string"||typeof r=="function"||!r.unexpandable:wl.hasOwnProperty(e)&&!wl[e].primitive}}var r8=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,qg=Object.freeze({"₊":"+","₋":"-","₌":"=","₍":"(","₎":")","₀":"0","₁":"1","₂":"2","₃":"3","₄":"4","₅":"5","₆":"6","₇":"7","₈":"8","₉":"9","ₐ":"a","ₑ":"e","ₕ":"h","ᵢ":"i","ⱼ":"j","ₖ":"k","ₗ":"l","ₘ":"m","ₙ":"n","ₒ":"o","ₚ":"p","ᵣ":"r","ₛ":"s","ₜ":"t","ᵤ":"u","ᵥ":"v","ₓ":"x","ᵦ":"β","ᵧ":"γ","ᵨ":"ρ","ᵩ":"ϕ","ᵪ":"χ","⁺":"+","⁻":"-","⁼":"=","⁽":"(","⁾":")","⁰":"0","¹":"1","²":"2","³":"3","⁴":"4","⁵":"5","⁶":"6","⁷":"7","⁸":"8","⁹":"9","ᴬ":"A","ᴮ":"B","ᴰ":"D","ᴱ":"E","ᴳ":"G","ᴴ":"H","ᴵ":"I","ᴶ":"J","ᴷ":"K","ᴸ":"L","ᴹ":"M","ᴺ":"N","ᴼ":"O","ᴾ":"P","ᴿ":"R","ᵀ":"T","ᵁ":"U","ⱽ":"V","ᵂ":"W","ᵃ":"a","ᵇ":"b","ᶜ":"c","ᵈ":"d","ᵉ":"e","ᶠ":"f","ᵍ":"g",ʰ:"h","ⁱ":"i",ʲ:"j","ᵏ":"k",ˡ:"l","ᵐ":"m",ⁿ:"n","ᵒ":"o","ᵖ":"p",ʳ:"r",ˢ:"s","ᵗ":"t","ᵘ":"u","ᵛ":"v",ʷ:"w",ˣ:"x",ʸ:"y","ᶻ":"z","ᵝ":"β","ᵞ":"γ","ᵟ":"δ","ᵠ":"ϕ","ᵡ":"χ","ᶿ":"θ"}),mb={"́":{text:"\\'",math:"\\acute"},"̀":{text:"\\`",math:"\\grave"},"̈":{text:'\\"',math:"\\ddot"},"̃":{text:"\\~",math:"\\tilde"},"̄":{text:"\\=",math:"\\bar"},"̆":{text:"\\u",math:"\\breve"},"̌":{text:"\\v",math:"\\check"},"̂":{text:"\\^",math:"\\hat"},"̇":{text:"\\.",math:"\\dot"},"̊":{text:"\\r",math:"\\mathring"},"̋":{text:"\\H"},"̧":{text:"\\c"}},n8={á:"á",à:"à",ä:"ä",ǟ:"ǟ",ã:"ã",ā:"ā",ă:"ă",ắ:"ắ",ằ:"ằ",ẵ:"ẵ",ǎ:"ǎ",â:"â",ấ:"ấ",ầ:"ầ",ẫ:"ẫ",ȧ:"ȧ",ǡ:"ǡ",å:"å",ǻ:"ǻ",ḃ:"ḃ",ć:"ć",ḉ:"ḉ",č:"č",ĉ:"ĉ",ċ:"ċ",ç:"ç",ď:"ď",ḋ:"ḋ",ḑ:"ḑ",é:"é",è:"è",ë:"ë",ẽ:"ẽ",ē:"ē",ḗ:"ḗ",ḕ:"ḕ",ĕ:"ĕ",ḝ:"ḝ",ě:"ě",ê:"ê",ế:"ế",ề:"ề",ễ:"ễ",ė:"ė",ȩ:"ȩ",ḟ:"ḟ",ǵ:"ǵ",ḡ:"ḡ",ğ:"ğ",ǧ:"ǧ",ĝ:"ĝ",ġ:"ġ",ģ:"ģ",ḧ:"ḧ",ȟ:"ȟ",ĥ:"ĥ",ḣ:"ḣ",ḩ:"ḩ",í:"í",ì:"ì",ï:"ï",ḯ:"ḯ",ĩ:"ĩ",ī:"ī",ĭ:"ĭ",ǐ:"ǐ",î:"î",ǰ:"ǰ",ĵ:"ĵ",ḱ:"ḱ",ǩ:"ǩ",ķ:"ķ",ĺ:"ĺ",ľ:"ľ",ļ:"ļ",ḿ:"ḿ",ṁ:"ṁ",ń:"ń",ǹ:"ǹ",ñ:"ñ",ň:"ň",ṅ:"ṅ",ņ:"ņ",ó:"ó",ò:"ò",ö:"ö",ȫ:"ȫ",õ:"õ",ṍ:"ṍ",ṏ:"ṏ",ȭ:"ȭ",ō:"ō",ṓ:"ṓ",ṑ:"ṑ",ŏ:"ŏ",ǒ:"ǒ",ô:"ô",ố:"ố",ồ:"ồ",ỗ:"ỗ",ȯ:"ȯ",ȱ:"ȱ",ő:"ő",ṕ:"ṕ",ṗ:"ṗ",ŕ:"ŕ",ř:"ř",ṙ:"ṙ",ŗ:"ŗ",ś:"ś",ṥ:"ṥ",š:"š",ṧ:"ṧ",ŝ:"ŝ",ṡ:"ṡ",ş:"ş",ẗ:"ẗ",ť:"ť",ṫ:"ṫ",ţ:"ţ",ú:"ú",ù:"ù",ü:"ü",ǘ:"ǘ",ǜ:"ǜ",ǖ:"ǖ",ǚ:"ǚ",ũ:"ũ",ṹ:"ṹ",ū:"ū",ṻ:"ṻ",ŭ:"ŭ",ǔ:"ǔ",û:"û",ů:"ů",ű:"ű",ṽ:"ṽ",ẃ:"ẃ",ẁ:"ẁ",ẅ:"ẅ",ŵ:"ŵ",ẇ:"ẇ",ẘ:"ẘ",ẍ:"ẍ",ẋ:"ẋ",ý:"ý",ỳ:"ỳ",ÿ:"ÿ",ỹ:"ỹ",ȳ:"ȳ",ŷ:"ŷ",ẏ:"ẏ",ẙ:"ẙ",ź:"ź",ž:"ž",ẑ:"ẑ",ż:"ż",Á:"Á",À:"À",Ä:"Ä",Ǟ:"Ǟ",Ã:"Ã",Ā:"Ā",Ă:"Ă",Ắ:"Ắ",Ằ:"Ằ",Ẵ:"Ẵ",Ǎ:"Ǎ",Â:"Â",Ấ:"Ấ",Ầ:"Ầ",Ẫ:"Ẫ",Ȧ:"Ȧ",Ǡ:"Ǡ",Å:"Å",Ǻ:"Ǻ",Ḃ:"Ḃ",Ć:"Ć",Ḉ:"Ḉ",Č:"Č",Ĉ:"Ĉ",Ċ:"Ċ",Ç:"Ç",Ď:"Ď",Ḋ:"Ḋ",Ḑ:"Ḑ",É:"É",È:"È",Ë:"Ë",Ẽ:"Ẽ",Ē:"Ē",Ḗ:"Ḗ",Ḕ:"Ḕ",Ĕ:"Ĕ",Ḝ:"Ḝ",Ě:"Ě",Ê:"Ê",Ế:"Ế",Ề:"Ề",Ễ:"Ễ",Ė:"Ė",Ȩ:"Ȩ",Ḟ:"Ḟ",Ǵ:"Ǵ",Ḡ:"Ḡ",Ğ:"Ğ",Ǧ:"Ǧ",Ĝ:"Ĝ",Ġ:"Ġ",Ģ:"Ģ",Ḧ:"Ḧ",Ȟ:"Ȟ",Ĥ:"Ĥ",Ḣ:"Ḣ",Ḩ:"Ḩ",Í:"Í",Ì:"Ì",Ï:"Ï",Ḯ:"Ḯ",Ĩ:"Ĩ",Ī:"Ī",Ĭ:"Ĭ",Ǐ:"Ǐ",Î:"Î",İ:"İ",Ĵ:"Ĵ",Ḱ:"Ḱ",Ǩ:"Ǩ",Ķ:"Ķ",Ĺ:"Ĺ",Ľ:"Ľ",Ļ:"Ļ",Ḿ:"Ḿ",Ṁ:"Ṁ",Ń:"Ń",Ǹ:"Ǹ",Ñ:"Ñ",Ň:"Ň",Ṅ:"Ṅ",Ņ:"Ņ",Ó:"Ó",Ò:"Ò",Ö:"Ö",Ȫ:"Ȫ",Õ:"Õ",Ṍ:"Ṍ",Ṏ:"Ṏ",Ȭ:"Ȭ",Ō:"Ō",Ṓ:"Ṓ",Ṑ:"Ṑ",Ŏ:"Ŏ",Ǒ:"Ǒ",Ô:"Ô",Ố:"Ố",Ồ:"Ồ",Ỗ:"Ỗ",Ȯ:"Ȯ",Ȱ:"Ȱ",Ő:"Ő",Ṕ:"Ṕ",Ṗ:"Ṗ",Ŕ:"Ŕ",Ř:"Ř",Ṙ:"Ṙ",Ŗ:"Ŗ",Ś:"Ś",Ṥ:"Ṥ",Š:"Š",Ṧ:"Ṧ",Ŝ:"Ŝ",Ṡ:"Ṡ",Ş:"Ş",Ť:"Ť",Ṫ:"Ṫ",Ţ:"Ţ",Ú:"Ú",Ù:"Ù",Ü:"Ü",Ǘ:"Ǘ",Ǜ:"Ǜ",Ǖ:"Ǖ",Ǚ:"Ǚ",Ũ:"Ũ",Ṹ:"Ṹ",Ū:"Ū",Ṻ:"Ṻ",Ŭ:"Ŭ",Ǔ:"Ǔ",Û:"Û",Ů:"Ů",Ű:"Ű",Ṽ:"Ṽ",Ẃ:"Ẃ",Ẁ:"Ẁ",Ẅ:"Ẅ",Ŵ:"Ŵ",Ẇ:"Ẇ",Ẍ:"Ẍ",Ẋ:"Ẋ",Ý:"Ý",Ỳ:"Ỳ",Ÿ:"Ÿ",Ỹ:"Ỹ",Ȳ:"Ȳ",Ŷ:"Ŷ",Ẏ:"Ẏ",Ź:"Ź",Ž:"Ž",Ẑ:"Ẑ",Ż:"Ż",ά:"ά",ὰ:"ὰ",ᾱ:"ᾱ",ᾰ:"ᾰ",έ:"έ",ὲ:"ὲ",ή:"ή",ὴ:"ὴ",ί:"ί",ὶ:"ὶ",ϊ:"ϊ",ΐ:"ΐ",ῒ:"ῒ",ῑ:"ῑ",ῐ:"ῐ",ό:"ό",ὸ:"ὸ",ύ:"ύ",ὺ:"ὺ",ϋ:"ϋ",ΰ:"ΰ",ῢ:"ῢ",ῡ:"ῡ",ῠ:"ῠ",ώ:"ώ",ὼ:"ὼ",Ύ:"Ύ",Ὺ:"Ὺ",Ϋ:"Ϋ",Ῡ:"Ῡ",Ῠ:"Ῠ",Ώ:"Ώ",Ὼ:"Ὼ"};let n$=class i${constructor(e,r){this.mode=void 0,this.gullet=void 0,this.settings=void 0,this.leftrightDepth=void 0,this.nextToken=void 0,this.mode="math",this.gullet=new Xhe(e,r,this.mode),this.settings=r,this.leftrightDepth=0}expect(e,r){if(r===void 0&&(r=!0),this.fetch().text!==e)throw new ot("Expected '"+e+"', got '"+this.fetch().text+"'",this.fetch());r&&this.consume()}consume(){this.nextToken=null}fetch(){return this.nextToken==null&&(this.nextToken=this.gullet.expandNextToken()),this.nextToken}switchMode(e){this.mode=e,this.gullet.switchMode(e)}parse(){this.settings.globalGroup||this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set("\\color","\\textcolor");try{var e=this.parseExpression(!1);return this.expect("EOF"),this.settings.globalGroup||this.gullet.endGroup(),e}finally{this.gullet.endGroups()}}subparse(e){var r=this.nextToken;this.consume(),this.gullet.pushToken(new Sa("}")),this.gullet.pushTokens(e);var n=this.parseExpression(!1);return this.expect("}"),this.nextToken=r,n}parseExpression(e,r){for(var n=[];;){this.mode==="math"&&this.consumeSpaces();var i=this.fetch();if(i$.endOfExpression.indexOf(i.text)!==-1||r&&i.text===r||e&&wl[i.text]&&wl[i.text].infix)break;var a=this.parseAtom(r);if(a){if(a.type==="internal")continue}else break;n.push(a)}return this.mode==="text"&&this.formLigatures(n),this.handleInfixNodes(n)}handleInfixNodes(e){for(var r=-1,n,i=0;i<e.length;i++)if(e[i].type==="infix"){if(r!==-1)throw new ot("only one infix operator per group",e[i].token);r=i,n=e[i].replaceWith}if(r!==-1&&n){var a,s,o=e.slice(0,r),l=e.slice(r+1);o.length===1&&o[0].type==="ordgroup"?a=o[0]:a={type:"ordgroup",mode:this.mode,body:o},l.length===1&&l[0].type==="ordgroup"?s=l[0]:s={type:"ordgroup",mode:this.mode,body:l};var u;return n==="\\\\abovefrac"?u=this.callFunction(n,[a,e[r],s],[]):u=this.callFunction(n,[a,s],[]),[u]}else return e}handleSupSubscript(e){var r=this.fetch(),n=r.text;this.consume(),this.consumeSpaces();var i;do{var a;i=this.parseGroup(e)}while(((a=i)==null?void 0:a.type)==="internal");if(!i)throw new ot("Expected group after '"+n+"'",r);return i}formatUnsupportedCmd(e){for(var r=[],n=0;n<e.length;n++)r.push({type:"textord",mode:"text",text:e[n]});var i={type:"text",mode:this.mode,body:r},a={type:"color",mode:this.mode,color:this.settings.errorColor,body:[i]};return a}parseAtom(e){var r=this.parseGroup("atom",e);if(r?.type==="internal"||this.mode==="text")return r;for(var n,i;;){this.consumeSpaces();var a=this.fetch();if(a.text==="\\limits"||a.text==="\\nolimits"){if(r&&r.type==="op"){var s=a.text==="\\limits";r.limits=s,r.alwaysHandleSupSub=!0}else if(r&&r.type==="operatorname")r.alwaysHandleSupSub&&(r.limits=a.text==="\\limits");else throw new ot("Limit controls must follow a math operator",a);this.consume()}else if(a.text==="^"){if(n)throw new ot("Double superscript",a);n=this.handleSupSubscript("superscript")}else if(a.text==="_"){if(i)throw new ot("Double subscript",a);i=this.handleSupSubscript("subscript")}else if(a.text==="'"){if(n)throw new ot("Double superscript",a);var o={type:"textord",mode:this.mode,text:"\\prime"},l=[o];for(this.consume();this.fetch().text==="'";)l.push(o),this.consume();this.fetch().text==="^"&&l.push(this.handleSupSubscript("superscript")),n={type:"ordgroup",mode:this.mode,body:l}}else if(qg[a.text]){var u=r8.test(a.text),h=[];for(h.push(new Sa(qg[a.text])),this.consume();;){var d=this.fetch().text;if(!qg[d]||r8.test(d)!==u)break;h.unshift(new Sa(qg[d])),this.consume()}var f=this.subparse(h);u?i={type:"ordgroup",mode:"math",body:f}:n={type:"ordgroup",mode:"math",body:f}}else break}return n||i?{type:"supsub",mode:this.mode,base:r,sup:n,sub:i}:r}parseFunction(e,r){var n=this.fetch(),i=n.text,a=wl[i];if(!a)return null;if(this.consume(),r&&r!=="atom"&&!a.allowedInArgument)throw new ot("Got function '"+i+"' with no arguments"+(r?" as "+r:""),n);if(this.mode==="text"&&!a.allowedInText)throw new ot("Can't use function '"+i+"' in text mode",n);if(this.mode==="math"&&a.allowedInMath===!1)throw new ot("Can't use function '"+i+"' in math mode",n);var{args:s,optArgs:o}=this.parseArguments(i,a);return this.callFunction(i,s,o,n,e)}callFunction(e,r,n,i,a){var s={funcName:e,parser:this,token:i,breakOnTokenText:a},o=wl[e];if(o&&o.handler)return o.handler(s,r,n);throw new ot("No function handler for "+e)}parseArguments(e,r){var n=r.numArgs+r.numOptionalArgs;if(n===0)return{args:[],optArgs:[]};for(var i=[],a=[],s=0;s<n;s++){var o=r.argTypes&&r.argTypes[s],l=s<r.numOptionalArgs;(r.primitive&&o==null||r.type==="sqrt"&&s===1&&a[0]==null)&&(o="primitive");var u=this.parseGroupOfType("argument to '"+e+"'",o,l);if(l)a.push(u);else if(u!=null)i.push(u);else throw new ot("Null argument, please report this as a bug")}return{args:i,optArgs:a}}parseGroupOfType(e,r,n){switch(r){case"color":return this.parseColorGroup(n);case"size":return this.parseSizeGroup(n);case"url":return this.parseUrlGroup(n);case"math":case"text":return this.parseArgumentGroup(n,r);case"hbox":{var i=this.parseArgumentGroup(n,"text");return i!=null?{type:"styling",mode:i.mode,body:[i],style:"text"}:null}case"raw":{var a=this.parseStringGroup("raw",n);return a!=null?{type:"raw",mode:"text",string:a.text}:null}case"primitive":{if(n)throw new ot("A primitive argument cannot be optional");var s=this.parseGroup(e);if(s==null)throw new ot("Expected group as "+e,this.fetch());return s}case"original":case null:case void 0:return this.parseArgumentGroup(n);default:throw new ot("Unknown group type as "+e,this.fetch())}}consumeSpaces(){for(;this.fetch().text===" ";)this.consume()}parseStringGroup(e,r){var n=this.gullet.scanArgument(r);if(n==null)return null;for(var i="",a;(a=this.fetch()).text!=="EOF";)i+=a.text,this.consume();return this.consume(),n.text=i,n}parseRegexGroup(e,r){for(var n=this.fetch(),i=n,a="",s;(s=this.fetch()).text!=="EOF"&&e.test(a+s.text);)i=s,a+=i.text,this.consume();if(a==="")throw new ot("Invalid "+r+": '"+n.text+"'",n);return n.range(i,a)}parseColorGroup(e){var r=this.parseStringGroup("color",e);if(r==null)return null;var n=/^(#[a-f0-9]{3,4}|#[a-f0-9]{6}|#[a-f0-9]{8}|[a-f0-9]{6}|[a-z]+)$/i.exec(r.text);if(!n)throw new ot("Invalid color: '"+r.text+"'",r);var i=n[0];return/^[0-9a-f]{6}$/i.test(i)&&(i="#"+i),{type:"color-token",mode:this.mode,color:i}}parseSizeGroup(e){var r,n=!1;if(this.gullet.consumeSpaces(),!e&&this.gullet.future().text!=="{"?r=this.parseRegexGroup(/^[-+]? *(?:$|\d+|\d+\.\d*|\.\d*) *[a-z]{0,2} *$/,"size"):r=this.parseStringGroup("size",e),!r)return null;!e&&r.text.length===0&&(r.text="0pt",n=!0);var i=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(r.text);if(!i)throw new ot("Invalid size: '"+r.text+"'",r);var a={number:+(i[1]+i[2]),unit:i[3]};if(!dF(a))throw new ot("Invalid unit: '"+a.unit+"'",r);return{type:"size",mode:this.mode,value:a,isBlank:n}}parseUrlGroup(e){this.gullet.lexer.setCatcode("%",13),this.gullet.lexer.setCatcode("~",12);var r=this.parseStringGroup("url",e);if(this.gullet.lexer.setCatcode("%",14),this.gullet.lexer.setCatcode("~",13),r==null)return null;var n=r.text.replace(/\\([#$%&~_^{}])/g,"$1");return{type:"url",mode:this.mode,url:n}}parseArgumentGroup(e,r){var n=this.gullet.scanArgument(e);if(n==null)return null;var i=this.mode;r&&this.switchMode(r),this.gullet.beginGroup();var a=this.parseExpression(!1,"EOF");this.expect("EOF"),this.gullet.endGroup();var s={type:"ordgroup",mode:this.mode,loc:n.loc,body:a};return r&&this.switchMode(i),s}parseGroup(e,r){var n=this.fetch(),i=n.text,a;if(i==="{"||i==="\\begingroup"){this.consume();var s=i==="{"?"}":"\\endgroup";this.gullet.beginGroup();var o=this.parseExpression(!1,s),l=this.fetch();this.expect(s),this.gullet.endGroup(),a={type:"ordgroup",mode:this.mode,loc:ra.range(n,l),body:o,semisimple:i==="\\begingroup"||void 0}}else if(a=this.parseFunction(r,e)||this.parseSymbol(),a==null&&i[0]==="\\"&&!r$.hasOwnProperty(i)){if(this.settings.throwOnError)throw new ot("Undefined control sequence: "+i,n);a=this.formatUnsupportedCmd(i),this.consume()}return a}formLigatures(e){for(var r=e.length-1,n=0;n<r;++n){var i=e[n],a=i.text;a==="-"&&e[n+1].text==="-"&&(n+1<r&&e[n+2].text==="-"?(e.splice(n,3,{type:"textord",mode:"text",loc:ra.range(i,e[n+2]),text:"---"}),r-=2):(e.splice(n,2,{type:"textord",mode:"text",loc:ra.range(i,e[n+1]),text:"--"}),r-=1)),(a==="'"||a==="`")&&e[n+1].text===a&&(e.splice(n,2,{type:"textord",mode:"text",loc:ra.range(i,e[n+1]),text:a+a}),r-=1)}}parseSymbol(){var e=this.fetch(),r=e.text;if(/^\\verb[^a-zA-Z]/.test(r)){this.consume();var n=r.slice(5),i=n.charAt(0)==="*";if(i&&(n=n.slice(1)),n.length<2||n.charAt(0)!==n.slice(-1))throw new ot(`\\verb assertion failed --
                    please report what input caused this bug`);return n=n.slice(1,-1),{type:"verb",mode:"text",body:n,star:i}}n8.hasOwnProperty(r[0])&&!Vr[this.mode][r[0]]&&(this.settings.strict&&this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Accented Unicode text character "'+r[0]+'" used in math mode',e),r=n8[r[0]]+r.slice(1));var a=Whe.exec(r);a&&(r=r.substring(0,a.index),r==="i"?r="ı":r==="j"&&(r="ȷ"));var s;if(Vr[this.mode][r]){this.settings.strict&&this.mode==="math"&&j5.indexOf(r)>=0&&this.settings.reportNonstrict("unicodeTextInMathMode",'Latin-1/Unicode text character "'+r[0]+'" used in math mode',e);var o=Vr[this.mode][r].group,l=ra.range(e),u;if(Pue.hasOwnProperty(o)){var h=o;u={type:"atom",mode:this.mode,family:h,loc:l,text:r}}else u={type:o,mode:this.mode,loc:l,text:r};s=u}else if(r.charCodeAt(0)>=128)this.settings.strict&&(uF(r.charCodeAt(0))?this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+r[0]+'" used in math mode',e):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+r[0]+'"'+(" ("+r.charCodeAt(0)+")"),e)),s={type:"textord",mode:"text",loc:ra.range(e),text:r};else return null;if(this.consume(),a)for(var d=0;d<a[0].length;d++){var f=a[0][d];if(!mb[f])throw new ot("Unknown accent ' "+f+"'",e);var p=mb[f][this.mode]||mb[f].text;if(!p)throw new ot("Accent "+f+" unsupported in "+this.mode+" mode",e);s={type:"accent",mode:this.mode,loc:ra.range(e),label:p,isStretchy:!1,isShifty:!0,base:s}}return s}};n$.endOfExpression=["}","\\endgroup","\\end","\\right","&"];var bE=function(e,r){if(!(typeof e=="string"||e instanceof String))throw new TypeError("KaTeX can only parse string typed expression");var n=new n$(e,r);delete n.gullet.macros.current["\\df@tag"];var i=n.parse();if(delete n.gullet.macros.current["\\current@color"],delete n.gullet.macros.current["\\color"],n.gullet.macros.get("\\df@tag")){if(!r.displayMode)throw new ot("\\tag works only in display equations");i=[{type:"tag",mode:"text",body:i,tag:n.subparse([new Sa("\\df@tag")])}]}return i},wE=function(e,r,n){r.textContent="";var i=y2(e,n).toNode();r.appendChild(i)};typeof document<"u"&&document.compatMode!=="CSS1Compat"&&(typeof console<"u"&&console.warn("Warning: KaTeX doesn't work in quirks mode. Make sure your website has a suitable doctype."),wE=function(){throw new ot("KaTeX doesn't work in quirks mode.")});var a$=function(e,r){var n=y2(e,r).toMarkup();return n},s$=function(e,r){var n=new rE(r);return bE(e,n)},o$=function(e,r,n){if(n.throwOnError||!(e instanceof ot))throw e;var i=Fe.makeSpan(["katex-error"],[new ts(r)]);return i.setAttribute("title",e.toString()),i.setAttribute("style","color:"+n.errorColor),i},y2=function(e,r){var n=new rE(r);try{var i=bE(e,n);return ahe(i,e,n)}catch(a){return o$(a,e,n)}},l$=function(e,r){var n=new rE(r);try{var i=bE(e,n);return she(i,e,n)}catch(a){return o$(a,e,n)}},c$="0.16.25",u$={Span:Up,Anchor:aE,SymbolNode:ts,SvgNode:qo,PathNode:$l,LineNode:X5},jhe={version:c$,render:wE,renderToString:a$,ParseError:ot,SETTINGS_SCHEMA:k0,__parse:s$,__renderToDomTree:y2,__renderToHTMLTree:l$,__setFontMetrics:hF,__defineSymbol:V,__defineFunction:Et,__defineMacro:le,__domTree:u$};const Khe=Object.freeze(Object.defineProperty({__proto__:null,ParseError:ot,SETTINGS_SCHEMA:k0,__defineFunction:Et,__defineMacro:le,__defineSymbol:V,__domTree:u$,__parse:s$,__renderToDomTree:y2,__renderToHTMLTree:l$,__setFontMetrics:hF,default:jhe,get render(){return wE},renderToString:a$,version:c$},Symbol.toStringTag,{value:"Module"}));var Zhe="[object Symbol]";function uu(t){return typeof t=="symbol"||Ja(t)&&tl(t)==Zhe}function Qc(t,e){for(var r=-1,n=t==null?0:t.length,i=Array(n);++r<n;)i[r]=e(t[r],r,t);return i}var i8=Za?Za.prototype:void 0,a8=i8?i8.toString:void 0;function h$(t){if(typeof t=="string")return t;if(ar(t))return Qc(t,h$)+"";if(uu(t))return a8?a8.call(t):"";var e=t+"";return e=="0"&&1/t==-1/0?"-0":e}var Qhe=/\s/;function Jhe(t){for(var e=t.length;e--&&Qhe.test(t.charAt(e)););return e}var ede=/^\s+/;function tde(t){return t&&t.slice(0,Jhe(t)+1).replace(ede,"")}var s8=NaN,rde=/^[-+]0x[0-9a-f]+$/i,nde=/^0b[01]+$/i,ide=/^0o[0-7]+$/i,ade=parseInt;function sde(t){if(typeof t=="number")return t;if(uu(t))return s8;if(ha(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=ha(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=tde(t);var r=nde.test(t);return r||ide.test(t)?ade(t.slice(2),r?2:8):rde.test(t)?s8:+t}var o8=1/0,ode=17976931348623157e292;function Q1(t){if(!t)return t===0?t:0;if(t=sde(t),t===o8||t===-o8){var e=t<0?-1:1;return e*ode}return t===t?t:0}function x2(t){var e=Q1(t),r=e%1;return e===e?r?e-r:e:0}function Rn(){}function d$(t,e){for(var r=-1,n=t==null?0:t.length;++r<n&&e(t[r],r,t)!==!1;);return t}function f$(t,e,r,n){for(var i=t.length,a=r+-1;++a<i;)if(e(t[a],a,t))return a;return-1}function lde(t){return t!==t}function cde(t,e,r){for(var n=r-1,i=t.length;++n<i;)if(t[n]===e)return n;return-1}function TE(t,e,r){return e===e?cde(t,e,r):f$(t,lde,r)}function p$(t,e){var r=t==null?0:t.length;return!!r&&TE(t,e,0)>-1}function In(t){return io(t)?UI(t):bB(t)}var ude=Object.prototype,hde=ude.hasOwnProperty,La=YI(function(t,e){if(Op(e)||io(e)){Ed(e,In(e),t);return}for(var r in e)hde.call(e,r)&&Bp(t,r,e[r])}),dde=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,fde=/^\w*$/;function EE(t,e){if(ar(t))return!1;var r=typeof t;return r=="number"||r=="symbol"||r=="boolean"||t==null||uu(t)?!0:fde.test(t)||!dde.test(t)||e!=null&&t in Object(e)}var pde=500;function gde(t){var e=Td(t,function(n){return r.size===pde&&r.clear(),n}),r=e.cache;return e}var mde=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,vde=/\\(\\)?/g,yde=gde(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(mde,function(r,n,i,a){e.push(i?a.replace(vde,"$1"):n||r)}),e});function g$(t){return t==null?"":h$(t)}function b2(t,e){return ar(t)?t:EE(t,e)?[t]:yde(g$(t))}function Hp(t){if(typeof t=="string"||uu(t))return t;var e=t+"";return e=="0"&&1/t==-1/0?"-0":e}function w2(t,e){e=b2(e,t);for(var r=0,n=e.length;t!=null&&r<n;)t=t[Hp(e[r++])];return r&&r==n?t:void 0}function xde(t,e,r){var n=t==null?void 0:w2(t,e);return n===void 0?r:n}function kE(t,e){for(var r=-1,n=e.length,i=t.length;++r<n;)t[i+r]=e[r];return t}var l8=Za?Za.isConcatSpreadable:void 0;function bde(t){return ar(t)||Zh(t)||!!(l8&&t&&t[l8])}function qp(t,e,r,n,i){var a=-1,s=t.length;for(r||(r=bde),i||(i=[]);++a<s;){var o=t[a];r(o)?kE(i,o):n||(i[i.length]=o)}return i}function Xn(t){var e=t==null?0:t.length;return e?qp(t):[]}function wde(t){return qI(HI(t,void 0,Xn),t+"")}function m$(t,e,r){var n=-1,i=t.length;e<0&&(e=-e>i?0:i+e),r=r>i?i:r,r<0&&(r+=i),i=e>r?0:r-e>>>0,e>>>=0;for(var a=Array(i);++n<i;)a[n]=t[n+e];return a}function Tde(t,e,r,n){var i=-1,a=t==null?0:t.length;for(n&&a&&(r=t[++i]);++i<a;)r=e(r,t[i],i,t);return r}function Ede(t,e){return t&&Ed(e,In(e),t)}function kde(t,e){return t&&Ed(e,Lu(e),t)}function SE(t,e){for(var r=-1,n=t==null?0:t.length,i=0,a=[];++r<n;){var s=t[r];e(s,r,t)&&(a[i++]=s)}return a}function v$(){return[]}var Sde=Object.prototype,Cde=Sde.propertyIsEnumerable,c8=Object.getOwnPropertySymbols,CE=c8?function(t){return t==null?[]:(t=Object(t),SE(c8(t),function(e){return Cde.call(t,e)}))}:v$;function Ade(t,e){return Ed(t,CE(t),e)}var _de=Object.getOwnPropertySymbols,y$=_de?function(t){for(var e=[];t;)kE(e,CE(t)),t=_6(t);return e}:v$;function Lde(t,e){return Ed(t,y$(t),e)}function x$(t,e,r){var n=e(t);return ar(t)?n:kE(n,r(t))}function tw(t){return x$(t,In,CE)}function b$(t){return x$(t,Lu,y$)}var Rde=Object.prototype,Nde=Rde.hasOwnProperty;function Dde(t){var e=t.length,r=new t.constructor(e);return e&&typeof t[0]=="string"&&Nde.call(t,"index")&&(r.index=t.index,r.input=t.input),r}function Mde(t,e){var r=e?A6(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}var Ide=/\w*$/;function Ode(t){var e=new t.constructor(t.source,Ide.exec(t));return e.lastIndex=t.lastIndex,e}var u8=Za?Za.prototype:void 0,h8=u8?u8.valueOf:void 0;function Pde(t){return h8?Object(h8.call(t)):{}}var Bde="[object Boolean]",Fde="[object Date]",$de="[object Map]",zde="[object Number]",Vde="[object RegExp]",Gde="[object Set]",Ude="[object String]",Wde="[object Symbol]",Hde="[object ArrayBuffer]",qde="[object DataView]",Yde="[object Float32Array]",Xde="[object Float64Array]",jde="[object Int8Array]",Kde="[object Int16Array]",Zde="[object Int32Array]",Qde="[object Uint8Array]",Jde="[object Uint8ClampedArray]",efe="[object Uint16Array]",tfe="[object Uint32Array]";function rfe(t,e,r){var n=t.constructor;switch(e){case Hde:return A6(t);case Bde:case Fde:return new n(+t);case qde:return Mde(t,r);case Yde:case Xde:case jde:case Kde:case Zde:case Qde:case Jde:case efe:case tfe:return OI(t,r);case $de:return new n;case zde:case Ude:return new n(t);case Vde:return Ode(t);case Gde:return new n;case Wde:return Pde(t)}}var nfe="[object Map]";function ife(t){return Ja(t)&&Ga(t)==nfe}var d8=Il&&Il.isMap,afe=d8?Pp(d8):ife,sfe="[object Set]";function ofe(t){return Ja(t)&&Ga(t)==sfe}var f8=Il&&Il.isSet,lfe=f8?Pp(f8):ofe,cfe=1,ufe=2,hfe=4,w$="[object Arguments]",dfe="[object Array]",ffe="[object Boolean]",pfe="[object Date]",gfe="[object Error]",T$="[object Function]",mfe="[object GeneratorFunction]",vfe="[object Map]",yfe="[object Number]",E$="[object Object]",xfe="[object RegExp]",bfe="[object Set]",wfe="[object String]",Tfe="[object Symbol]",Efe="[object WeakMap]",kfe="[object ArrayBuffer]",Sfe="[object DataView]",Cfe="[object Float32Array]",Afe="[object Float64Array]",_fe="[object Int8Array]",Lfe="[object Int16Array]",Rfe="[object Int32Array]",Nfe="[object Uint8Array]",Dfe="[object Uint8ClampedArray]",Mfe="[object Uint16Array]",Ife="[object Uint32Array]",zr={};zr[w$]=zr[dfe]=zr[kfe]=zr[Sfe]=zr[ffe]=zr[pfe]=zr[Cfe]=zr[Afe]=zr[_fe]=zr[Lfe]=zr[Rfe]=zr[vfe]=zr[yfe]=zr[E$]=zr[xfe]=zr[bfe]=zr[wfe]=zr[Tfe]=zr[Nfe]=zr[Dfe]=zr[Mfe]=zr[Ife]=!0;zr[gfe]=zr[T$]=zr[Efe]=!1;function C0(t,e,r,n,i,a){var s,o=e&cfe,l=e&ufe,u=e&hfe;if(s!==void 0)return s;if(!ha(t))return t;var h=ar(t);if(h){if(s=Dde(t),!o)return PI(t,s)}else{var d=Ga(t),f=d==T$||d==mfe;if(Qh(t))return II(t,o);if(d==E$||d==w$||f&&!i){if(s=l||f?{}:FI(t),!o)return l?Lde(t,kde(s,t)):Ade(t,Ede(s,t))}else{if(!zr[d])return i?t:{};s=rfe(t,d,o)}}a||(a=new gs);var p=a.get(t);if(p)return p;a.set(t,s),lfe(t)?t.forEach(function(v){s.add(C0(v,e,r,v,t,a))}):afe(t)&&t.forEach(function(v,y){s.set(y,C0(v,e,r,y,t,a))});var g=u?l?b$:tw:l?Lu:In,m=h?void 0:g(t);return d$(m||t,function(v,y){m&&(y=v,v=t[y]),Bp(s,y,C0(v,e,r,y,t,a))}),s}var Ofe=4;function Fn(t){return C0(t,Ofe)}var Pfe=1,Bfe=4;function Ffe(t){return C0(t,Pfe|Bfe)}function Yp(t){for(var e=-1,r=t==null?0:t.length,n=0,i=[];++e<r;){var a=t[e];a&&(i[n++]=a)}return i}var $fe="__lodash_hash_undefined__";function zfe(t){return this.__data__.set(t,$fe),this}function Vfe(t){return this.__data__.has(t)}function rd(t){var e=-1,r=t==null?0:t.length;for(this.__data__=new nl;++e<r;)this.add(t[e])}rd.prototype.add=rd.prototype.push=zfe;rd.prototype.has=Vfe;function k$(t,e){for(var r=-1,n=t==null?0:t.length;++r<n;)if(e(t[r],r,t))return!0;return!1}function AE(t,e){return t.has(e)}var Gfe=1,Ufe=2;function S$(t,e,r,n,i,a){var s=r&Gfe,o=t.length,l=e.length;if(o!=l&&!(s&&l>o))return!1;var u=a.get(t),h=a.get(e);if(u&&h)return u==e&&h==t;var d=-1,f=!0,p=r&Ufe?new rd:void 0;for(a.set(t,e),a.set(e,t);++d<o;){var g=t[d],m=e[d];if(n)var v=s?n(m,g,d,e,t,a):n(g,m,d,t,e,a);if(v!==void 0){if(v)continue;f=!1;break}if(p){if(!k$(e,function(y,b){if(!AE(p,b)&&(g===y||i(g,y,r,n,a)))return p.push(b)})){f=!1;break}}else if(!(g===m||i(g,m,r,n,a))){f=!1;break}}return a.delete(t),a.delete(e),f}function Wfe(t){var e=-1,r=Array(t.size);return t.forEach(function(n,i){r[++e]=[i,n]}),r}function _E(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}var Hfe=1,qfe=2,Yfe="[object Boolean]",Xfe="[object Date]",jfe="[object Error]",Kfe="[object Map]",Zfe="[object Number]",Qfe="[object RegExp]",Jfe="[object Set]",e0e="[object String]",t0e="[object Symbol]",r0e="[object ArrayBuffer]",n0e="[object DataView]",p8=Za?Za.prototype:void 0,vb=p8?p8.valueOf:void 0;function i0e(t,e,r,n,i,a,s){switch(r){case n0e:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case r0e:return!(t.byteLength!=e.byteLength||!a(new cv(t),new cv(e)));case Yfe:case Xfe:case Zfe:return wd(+t,+e);case jfe:return t.name==e.name&&t.message==e.message;case Qfe:case e0e:return t==e+"";case Kfe:var o=Wfe;case Jfe:var l=n&Hfe;if(o||(o=_E),t.size!=e.size&&!l)return!1;var u=s.get(t);if(u)return u==e;n|=qfe,s.set(t,e);var h=S$(o(t),o(e),n,i,a,s);return s.delete(t),h;case t0e:if(vb)return vb.call(t)==vb.call(e)}return!1}var a0e=1,s0e=Object.prototype,o0e=s0e.hasOwnProperty;function l0e(t,e,r,n,i,a){var s=r&a0e,o=tw(t),l=o.length,u=tw(e),h=u.length;if(l!=h&&!s)return!1;for(var d=l;d--;){var f=o[d];if(!(s?f in e:o0e.call(e,f)))return!1}var p=a.get(t),g=a.get(e);if(p&&g)return p==e&&g==t;var m=!0;a.set(t,e),a.set(e,t);for(var v=s;++d<l;){f=o[d];var y=t[f],b=e[f];if(n)var w=s?n(b,y,f,e,t,a):n(y,b,f,t,e,a);if(!(w===void 0?y===b||i(y,b,r,n,a):w)){m=!1;break}v||(v=f=="constructor")}if(m&&!v){var T=t.constructor,E=e.constructor;T!=E&&"constructor"in t&&"constructor"in e&&!(typeof T=="function"&&T instanceof T&&typeof E=="function"&&E instanceof E)&&(m=!1)}return a.delete(t),a.delete(e),m}var c0e=1,g8="[object Arguments]",m8="[object Array]",Yg="[object Object]",u0e=Object.prototype,v8=u0e.hasOwnProperty;function h0e(t,e,r,n,i,a){var s=ar(t),o=ar(e),l=s?m8:Ga(t),u=o?m8:Ga(e);l=l==g8?Yg:l,u=u==g8?Yg:u;var h=l==Yg,d=u==Yg,f=l==u;if(f&&Qh(t)){if(!Qh(e))return!1;s=!0,h=!1}if(f&&!h)return a||(a=new gs),s||Jy(t)?S$(t,e,r,n,i,a):i0e(t,e,l,r,n,i,a);if(!(r&c0e)){var p=h&&v8.call(t,"__wrapped__"),g=d&&v8.call(e,"__wrapped__");if(p||g){var m=p?t.value():t,v=g?e.value():e;return a||(a=new gs),i(m,v,r,n,a)}}return f?(a||(a=new gs),l0e(t,e,r,n,i,a)):!1}function LE(t,e,r,n,i){return t===e?!0:t==null||e==null||!Ja(t)&&!Ja(e)?t!==t&&e!==e:h0e(t,e,r,n,LE,i)}var d0e=1,f0e=2;function p0e(t,e,r,n){var i=r.length,a=i;if(t==null)return!a;for(t=Object(t);i--;){var s=r[i];if(s[2]?s[1]!==t[s[0]]:!(s[0]in t))return!1}for(;++i<a;){s=r[i];var o=s[0],l=t[o],u=s[1];if(s[2]){if(l===void 0&&!(o in t))return!1}else{var h=new gs,d;if(!(d===void 0?LE(u,l,d0e|f0e,n,h):d))return!1}}return!0}function C$(t){return t===t&&!ha(t)}function g0e(t){for(var e=In(t),r=e.length;r--;){var n=e[r],i=t[n];e[r]=[n,i,C$(i)]}return e}function A$(t,e){return function(r){return r==null?!1:r[t]===e&&(e!==void 0||t in Object(r))}}function m0e(t){var e=g0e(t);return e.length==1&&e[0][2]?A$(e[0][0],e[0][1]):function(r){return r===t||p0e(r,t,e)}}function v0e(t,e){return t!=null&&e in Object(t)}function _$(t,e,r){e=b2(e,t);for(var n=-1,i=e.length,a=!1;++n<i;){var s=Hp(e[n]);if(!(a=t!=null&&r(t,s)))break;t=t[s]}return a||++n!=i?a:(i=t==null?0:t.length,!!i&&L6(i)&&e2(s,i)&&(ar(t)||Zh(t)))}function L$(t,e){return t!=null&&_$(t,e,v0e)}var y0e=1,x0e=2;function b0e(t,e){return EE(t)&&C$(e)?A$(Hp(t),e):function(r){var n=xde(r,t);return n===void 0&&n===e?L$(r,t):LE(e,n,y0e|x0e)}}function w0e(t){return function(e){return e?.[t]}}function T0e(t){return function(e){return w2(e,t)}}function E0e(t){return EE(t)?w0e(Hp(t)):T0e(t)}function ga(t){return typeof t=="function"?t:t==null?Wo:typeof t=="object"?ar(t)?b0e(t[0],t[1]):m0e(t):E0e(t)}function k0e(t,e,r,n){for(var i=-1,a=t==null?0:t.length;++i<a;){var s=t[i];e(n,s,r(s),t)}return n}function RE(t,e){return t&&C6(t,e,In)}function S0e(t,e){return function(r,n){if(r==null)return r;if(!io(r))return t(r,n);for(var i=r.length,a=-1,s=Object(r);++a<i&&n(s[a],a,s)!==!1;);return r}}var Mu=S0e(RE);function C0e(t,e,r,n){return Mu(t,function(i,a,s){e(n,i,r(i),s)}),n}function A0e(t,e){return function(r,n){var i=ar(r)?k0e:C0e,a=e?e():{};return i(r,t,ga(n),a)}}var R$=Object.prototype,_0e=R$.hasOwnProperty,T2=Fp(function(t,e){t=Object(t);var r=-1,n=e.length,i=n>2?e[2]:void 0;for(i&&X0(e[0],e[1],i)&&(n=1);++r<n;)for(var a=e[r],s=Lu(a),o=-1,l=s.length;++o<l;){var u=s[o],h=t[u];(h===void 0||wd(h,R$[u])&&!_0e.call(t,u))&&(t[u]=a[u])}return t}),L0e=200;function R0e(t,e,r,n){var i=-1,a=p$,s=!0,o=t.length,l=[],u=e.length;if(!o)return l;e.length>=L0e&&(a=AE,s=!1,e=new rd(e));e:for(;++i<o;){var h=t[i],d=h;if(h=h!==0?h:0,s&&d===d){for(var f=u;f--;)if(e[f]===d)continue e;l.push(h)}else a(e,d,n)||l.push(h)}return l}var E2=Fp(function(t,e){return uv(t)?R0e(t,qp(e,1,uv,!0)):[]});function Zs(t){var e=t==null?0:t.length;return e?t[e-1]:void 0}function ni(t,e,r){var n=t==null?0:t.length;return n?(e=e===void 0?1:x2(e),m$(t,e<0?0:e,n)):[]}function ep(t,e,r){var n=t==null?0:t.length;return n?(e=e===void 0?1:x2(e),e=n-e,m$(t,0,e<0?0:e)):[]}function NE(t){return typeof t=="function"?t:Wo}function Ie(t,e){var r=ar(t)?d$:Mu;return r(t,NE(e))}function N0e(t,e){for(var r=-1,n=t==null?0:t.length;++r<n;)if(!e(t[r],r,t))return!1;return!0}function D0e(t,e){var r=!0;return Mu(t,function(n,i,a){return r=!!e(n,i,a),r}),r}function vs(t,e,r){var n=ar(t)?N0e:D0e;return n(t,ga(e))}function N$(t,e){var r=[];return Mu(t,function(n,i,a){e(n,i,a)&&r.push(n)}),r}function cn(t,e){var r=ar(t)?SE:N$;return r(t,ga(e))}function M0e(t){return function(e,r,n){var i=Object(e);if(!io(e)){var a=ga(r);e=In(e),r=function(o){return a(i[o],o,i)}}var s=t(e,r,n);return s>-1?i[a?e[s]:s]:void 0}}var I0e=Math.max;function O0e(t,e,r){var n=t==null?0:t.length;if(!n)return-1;var i=r==null?0:x2(r);return i<0&&(i=I0e(n+i,0)),f$(t,ga(e),i)}var jo=M0e(O0e);function Ts(t){return t&&t.length?t[0]:void 0}function D$(t,e){var r=-1,n=io(t)?Array(t.length):[];return Mu(t,function(i,a,s){n[++r]=e(i,a,s)}),n}function ft(t,e){var r=ar(t)?Qc:D$;return r(t,ga(e))}function Ca(t,e){return qp(ft(t,e))}function P0e(t,e){return t==null?t:C6(t,NE(e),Lu)}function B0e(t,e){return t&&RE(t,NE(e))}var F0e=Object.prototype,$0e=F0e.hasOwnProperty,z0e=A0e(function(t,e,r){$0e.call(t,r)?t[r].push(e):Ip(t,r,[e])});function V0e(t,e){return t>e}var G0e=Object.prototype,U0e=G0e.hasOwnProperty;function W0e(t,e){return t!=null&&U0e.call(t,e)}function Ft(t,e){return t!=null&&_$(t,e,W0e)}var H0e="[object String]";function da(t){return typeof t=="string"||!ar(t)&&Ja(t)&&tl(t)==H0e}function q0e(t,e){return Qc(e,function(r){return t[r]})}function Pr(t){return t==null?[]:q0e(t,In(t))}var Y0e=Math.max;function Zi(t,e,r,n){t=io(t)?t:Pr(t),r=r?x2(r):0;var i=t.length;return r<0&&(r=Y0e(i+r,0)),da(t)?r<=i&&t.indexOf(e,r)>-1:!!i&&TE(t,e,r)>-1}function y8(t,e,r){var n=t==null?0:t.length;if(!n)return-1;var i=0;return TE(t,e,i)}var X0e="[object RegExp]";function j0e(t){return Ja(t)&&tl(t)==X0e}var x8=Il&&Il.isRegExp,Ko=x8?Pp(x8):j0e;function Rr(t){return t===void 0}function M$(t,e){return t<e}function k2(t,e){var r={};return e=ga(e),RE(t,function(n,i,a){Ip(r,i,e(n,i,a))}),r}function DE(t,e,r){for(var n=-1,i=t.length;++n<i;){var a=t[n],s=e(a);if(s!=null&&(o===void 0?s===s&&!uu(s):r(s,o)))var o=s,l=a}return l}function hu(t){return t&&t.length?DE(t,Wo,V0e):void 0}function nd(t){return t&&t.length?DE(t,Wo,M$):void 0}function ME(t,e){return t&&t.length?DE(t,ga(e),M$):void 0}var K0e="Expected a function";function Z0e(t){if(typeof t!="function")throw new TypeError(K0e);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}function Q0e(t,e,r,n){if(!ha(t))return t;e=b2(e,t);for(var i=-1,a=e.length,s=a-1,o=t;o!=null&&++i<a;){var l=Hp(e[i]),u=r;if(l==="__proto__"||l==="constructor"||l==="prototype")return t;if(i!=s){var h=o[l];u=void 0,u===void 0&&(u=ha(h)?h:e2(e[i+1])?[]:{})}Bp(o,l,u),o=o[l]}return t}function I$(t,e,r){for(var n=-1,i=e.length,a={};++n<i;){var s=e[n],o=w2(t,s);r(o,s)&&Q0e(a,b2(s,t),o)}return a}function Cs(t,e){if(t==null)return{};var r=Qc(b$(t),function(n){return[n]});return e=ga(e),I$(t,r,function(n,i){return e(n,i[0])})}function J0e(t,e){var r=t.length;for(t.sort(e);r--;)t[r]=t[r].value;return t}function epe(t,e){if(t!==e){var r=t!==void 0,n=t===null,i=t===t,a=uu(t),s=e!==void 0,o=e===null,l=e===e,u=uu(e);if(!o&&!u&&!a&&t>e||a&&s&&l&&!o&&!u||n&&s&&l||!r&&l||!i)return 1;if(!n&&!a&&!u&&t<e||u&&r&&i&&!n&&!a||o&&r&&i||!s&&i||!l)return-1}return 0}function tpe(t,e,r){for(var n=-1,i=t.criteria,a=e.criteria,s=i.length,o=r.length;++n<s;){var l=epe(i[n],a[n]);if(l){if(n>=o)return l;var u=r[n];return l*(u=="desc"?-1:1)}}return t.index-e.index}function rpe(t,e,r){e.length?e=Qc(e,function(a){return ar(a)?function(s){return w2(s,a.length===1?a[0]:a)}:a}):e=[Wo];var n=-1;e=Qc(e,Pp(ga));var i=D$(t,function(a,s,o){var l=Qc(e,function(u){return u(a)});return{criteria:l,index:++n,value:a}});return J0e(i,function(a,s){return tpe(a,s,r)})}function npe(t,e){return I$(t,e,function(r,n){return L$(t,n)})}var Lv=wde(function(t,e){return t==null?{}:npe(t,e)}),ipe=Math.ceil,ape=Math.max;function spe(t,e,r,n){for(var i=-1,a=ape(ipe((e-t)/(r||1)),0),s=Array(a);a--;)s[++i]=t,t+=r;return s}function ope(t){return function(e,r,n){return n&&typeof n!="number"&&X0(e,r,n)&&(r=n=void 0),e=Q1(e),r===void 0?(r=e,e=0):r=Q1(r),n=n===void 0?e<r?1:-1:Q1(n),spe(e,r,n)}}var id=ope();function lpe(t,e,r,n,i){return i(t,function(a,s,o){r=n?(n=!1,a):e(r,a,s,o)}),r}function Cn(t,e,r){var n=ar(t)?Tde:lpe,i=arguments.length<3;return n(t,ga(e),r,i,Mu)}function S2(t,e){var r=ar(t)?SE:N$;return r(t,Z0e(ga(e)))}function cpe(t,e){var r;return Mu(t,function(n,i,a){return r=e(n,i,a),!r}),!!r}function O$(t,e,r){var n=ar(t)?k$:cpe;return n(t,ga(e))}var Xp=Fp(function(t,e){if(t==null)return[];var r=e.length;return r>1&&X0(t,e[0],e[1])?e=[]:r>2&&X0(e[0],e[1],e[2])&&(e=[e[0]]),rpe(t,qp(e),[])}),upe=1/0,hpe=Rh&&1/_E(new Rh([,-0]))[1]==upe?function(t){return new Rh(t)}:Rn,dpe=200;function IE(t,e,r){var n=-1,i=p$,a=t.length,s=!0,o=[],l=o;if(a>=dpe){var u=e?null:hpe(t);if(u)return _E(u);s=!1,i=AE,l=new rd}else l=e?[]:o;e:for(;++n<a;){var h=t[n],d=e?e(h):h;if(h=h!==0?h:0,s&&d===d){for(var f=l.length;f--;)if(l[f]===d)continue e;e&&l.push(d),o.push(h)}else i(l,d,r)||(l!==o&&l.push(d),o.push(h))}return o}var fpe=Fp(function(t){return IE(qp(t,1,uv,!0))});function OE(t){return t&&t.length?IE(t):[]}function ppe(t,e){return t&&t.length?IE(t,ga(e)):[]}var gpe=0;function PE(t){var e=++gpe;return g$(t)+e}function mpe(t,e,r){for(var n=-1,i=t.length,a=e.length,s={};++n<i;){var o=n<a?e[n]:void 0;r(s,t[n],o)}return s}function vpe(t,e){return mpe(t||[],e||[],Bp)}var ype="\0",Cc="\0",b8="";class ma{constructor(e={}){this._isDirected=Object.prototype.hasOwnProperty.call(e,"directed")?e.directed:!0,this._isMultigraph=Object.prototype.hasOwnProperty.call(e,"multigraph")?e.multigraph:!1,this._isCompound=Object.prototype.hasOwnProperty.call(e,"compound")?e.compound:!1,this._label=void 0,this._defaultNodeLabelFn=yh(void 0),this._defaultEdgeLabelFn=yh(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children[Cc]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(e){return this._label=e,this}graph(){return this._label}setDefaultNodeLabel(e){return Qa(e)||(e=yh(e)),this._defaultNodeLabelFn=e,this}nodeCount(){return this._nodeCount}nodes(){return In(this._nodes)}sources(){var e=this;return cn(this.nodes(),function(r){return Sr(e._in[r])})}sinks(){var e=this;return cn(this.nodes(),function(r){return Sr(e._out[r])})}setNodes(e,r){var n=arguments,i=this;return Ie(e,function(a){n.length>1?i.setNode(a,r):i.setNode(a)}),this}setNode(e,r){return Object.prototype.hasOwnProperty.call(this._nodes,e)?(arguments.length>1&&(this._nodes[e]=r),this):(this._nodes[e]=arguments.length>1?r:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]=Cc,this._children[e]={},this._children[Cc][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount,this)}node(e){return this._nodes[e]}hasNode(e){return Object.prototype.hasOwnProperty.call(this._nodes,e)}removeNode(e){if(Object.prototype.hasOwnProperty.call(this._nodes,e)){var r=n=>this.removeEdge(this._edgeObjs[n]);delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],Ie(this.children(e),n=>{this.setParent(n)}),delete this._children[e]),Ie(In(this._in[e]),r),delete this._in[e],delete this._preds[e],Ie(In(this._out[e]),r),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this}setParent(e,r){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(Rr(r))r=Cc;else{r+="";for(var n=r;!Rr(n);n=this.parent(n))if(n===e)throw new Error("Setting "+r+" as parent of "+e+" would create a cycle");this.setNode(r)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=r,this._children[r][e]=!0,this}_removeFromParentsChildList(e){delete this._children[this._parent[e]][e]}parent(e){if(this._isCompound){var r=this._parent[e];if(r!==Cc)return r}}children(e){if(Rr(e)&&(e=Cc),this._isCompound){var r=this._children[e];if(r)return In(r)}else{if(e===Cc)return this.nodes();if(this.hasNode(e))return[]}}predecessors(e){var r=this._preds[e];if(r)return In(r)}successors(e){var r=this._sucs[e];if(r)return In(r)}neighbors(e){var r=this.predecessors(e);if(r)return fpe(r,this.successors(e))}isLeaf(e){var r;return this.isDirected()?r=this.successors(e):r=this.neighbors(e),r.length===0}filterNodes(e){var r=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});r.setGraph(this.graph());var n=this;Ie(this._nodes,function(s,o){e(o)&&r.setNode(o,s)}),Ie(this._edgeObjs,function(s){r.hasNode(s.v)&&r.hasNode(s.w)&&r.setEdge(s,n.edge(s))});var i={};function a(s){var o=n.parent(s);return o===void 0||r.hasNode(o)?(i[s]=o,o):o in i?i[o]:a(o)}return this._isCompound&&Ie(r.nodes(),function(s){r.setParent(s,a(s))}),r}setDefaultEdgeLabel(e){return Qa(e)||(e=yh(e)),this._defaultEdgeLabelFn=e,this}edgeCount(){return this._edgeCount}edges(){return Pr(this._edgeObjs)}setPath(e,r){var n=this,i=arguments;return Cn(e,function(a,s){return i.length>1?n.setEdge(a,s,r):n.setEdge(a,s),s}),this}setEdge(){var e,r,n,i,a=!1,s=arguments[0];typeof s=="object"&&s!==null&&"v"in s?(e=s.v,r=s.w,n=s.name,arguments.length===2&&(i=arguments[1],a=!0)):(e=s,r=arguments[1],n=arguments[3],arguments.length>2&&(i=arguments[2],a=!0)),e=""+e,r=""+r,Rr(n)||(n=""+n);var o=Cf(this._isDirected,e,r,n);if(Object.prototype.hasOwnProperty.call(this._edgeLabels,o))return a&&(this._edgeLabels[o]=i),this;if(!Rr(n)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(e),this.setNode(r),this._edgeLabels[o]=a?i:this._defaultEdgeLabelFn(e,r,n);var l=xpe(this._isDirected,e,r,n);return e=l.v,r=l.w,Object.freeze(l),this._edgeObjs[o]=l,w8(this._preds[r],e),w8(this._sucs[e],r),this._in[r][o]=l,this._out[e][o]=l,this._edgeCount++,this}edge(e,r,n){var i=arguments.length===1?yb(this._isDirected,arguments[0]):Cf(this._isDirected,e,r,n);return this._edgeLabels[i]}hasEdge(e,r,n){var i=arguments.length===1?yb(this._isDirected,arguments[0]):Cf(this._isDirected,e,r,n);return Object.prototype.hasOwnProperty.call(this._edgeLabels,i)}removeEdge(e,r,n){var i=arguments.length===1?yb(this._isDirected,arguments[0]):Cf(this._isDirected,e,r,n),a=this._edgeObjs[i];return a&&(e=a.v,r=a.w,delete this._edgeLabels[i],delete this._edgeObjs[i],T8(this._preds[r],e),T8(this._sucs[e],r),delete this._in[r][i],delete this._out[e][i],this._edgeCount--),this}inEdges(e,r){var n=this._in[e];if(n){var i=Pr(n);return r?cn(i,function(a){return a.v===r}):i}}outEdges(e,r){var n=this._out[e];if(n){var i=Pr(n);return r?cn(i,function(a){return a.w===r}):i}}nodeEdges(e,r){var n=this.inEdges(e,r);if(n)return n.concat(this.outEdges(e,r))}}ma.prototype._nodeCount=0;ma.prototype._edgeCount=0;function w8(t,e){t[e]?t[e]++:t[e]=1}function T8(t,e){--t[e]||delete t[e]}function Cf(t,e,r,n){var i=""+e,a=""+r;if(!t&&i>a){var s=i;i=a,a=s}return i+b8+a+b8+(Rr(n)?ype:n)}function xpe(t,e,r,n){var i=""+e,a=""+r;if(!t&&i>a){var s=i;i=a,a=s}var o={v:i,w:a};return n&&(o.name=n),o}function yb(t,e){return Cf(t,e.v,e.w,e.name)}class bpe{constructor(){var e={};e._next=e._prev=e,this._sentinel=e}dequeue(){var e=this._sentinel,r=e._prev;if(r!==e)return E8(r),r}enqueue(e){var r=this._sentinel;e._prev&&e._next&&E8(e),e._next=r._next,r._next._prev=e,r._next=e,e._prev=r}toString(){for(var e=[],r=this._sentinel,n=r._prev;n!==r;)e.push(JSON.stringify(n,wpe)),n=n._prev;return"["+e.join(", ")+"]"}}function E8(t){t._prev._next=t._next,t._next._prev=t._prev,delete t._next,delete t._prev}function wpe(t,e){if(t!=="_next"&&t!=="_prev")return e}var Tpe=yh(1);function Epe(t,e){if(t.nodeCount()<=1)return[];var r=Spe(t,e||Tpe),n=kpe(r.graph,r.buckets,r.zeroIdx);return Xn(ft(n,function(i){return t.outEdges(i.v,i.w)}))}function kpe(t,e,r){for(var n=[],i=e[e.length-1],a=e[0],s;t.nodeCount();){for(;s=a.dequeue();)xb(t,e,r,s);for(;s=i.dequeue();)xb(t,e,r,s);if(t.nodeCount()){for(var o=e.length-2;o>0;--o)if(s=e[o].dequeue(),s){n=n.concat(xb(t,e,r,s,!0));break}}}return n}function xb(t,e,r,n,i){var a=i?[]:void 0;return Ie(t.inEdges(n.v),function(s){var o=t.edge(s),l=t.node(s.v);i&&a.push({v:s.v,w:s.w}),l.out-=o,rw(e,r,l)}),Ie(t.outEdges(n.v),function(s){var o=t.edge(s),l=s.w,u=t.node(l);u.in-=o,rw(e,r,u)}),t.removeNode(n.v),a}function Spe(t,e){var r=new ma,n=0,i=0;Ie(t.nodes(),function(o){r.setNode(o,{v:o,in:0,out:0})}),Ie(t.edges(),function(o){var l=r.edge(o.v,o.w)||0,u=e(o),h=l+u;r.setEdge(o.v,o.w,h),i=Math.max(i,r.node(o.v).out+=u),n=Math.max(n,r.node(o.w).in+=u)});var a=id(i+n+3).map(function(){return new bpe}),s=n+1;return Ie(r.nodes(),function(o){rw(a,s,r.node(o))}),{graph:r,buckets:a,zeroIdx:s}}function rw(t,e,r){r.out?r.in?t[r.out-r.in+e].enqueue(r):t[t.length-1].enqueue(r):t[0].enqueue(r)}function Cpe(t){var e=t.graph().acyclicer==="greedy"?Epe(t,r(t)):Ape(t);Ie(e,function(n){var i=t.edge(n);t.removeEdge(n),i.forwardName=n.name,i.reversed=!0,t.setEdge(n.w,n.v,i,PE("rev"))});function r(n){return function(i){return n.edge(i).weight}}}function Ape(t){var e=[],r={},n={};function i(a){Object.prototype.hasOwnProperty.call(n,a)||(n[a]=!0,r[a]=!0,Ie(t.outEdges(a),function(s){Object.prototype.hasOwnProperty.call(r,s.w)?e.push(s):i(s.w)}),delete r[a])}return Ie(t.nodes(),i),e}function _pe(t){Ie(t.edges(),function(e){var r=t.edge(e);if(r.reversed){t.removeEdge(e);var n=r.forwardName;delete r.reversed,delete r.forwardName,t.setEdge(e.w,e.v,r,n)}})}function Ld(t,e,r,n){var i;do i=PE(n);while(t.hasNode(i));return r.dummy=e,t.setNode(i,r),i}function Lpe(t){var e=new ma().setGraph(t.graph());return Ie(t.nodes(),function(r){e.setNode(r,t.node(r))}),Ie(t.edges(),function(r){var n=e.edge(r.v,r.w)||{weight:0,minlen:1},i=t.edge(r);e.setEdge(r.v,r.w,{weight:n.weight+i.weight,minlen:Math.max(n.minlen,i.minlen)})}),e}function P$(t){var e=new ma({multigraph:t.isMultigraph()}).setGraph(t.graph());return Ie(t.nodes(),function(r){t.children(r).length||e.setNode(r,t.node(r))}),Ie(t.edges(),function(r){e.setEdge(r,t.edge(r))}),e}function k8(t,e){var r=t.x,n=t.y,i=e.x-r,a=e.y-n,s=t.width/2,o=t.height/2;if(!i&&!a)throw new Error("Not possible to find intersection inside of the rectangle");var l,u;return Math.abs(a)*s>Math.abs(i)*o?(a<0&&(o=-o),l=o*i/a,u=o):(i<0&&(s=-s),l=s,u=s*a/i),{x:r+l,y:n+u}}function C2(t){var e=ft(id(B$(t)+1),function(){return[]});return Ie(t.nodes(),function(r){var n=t.node(r),i=n.rank;Rr(i)||(e[i][n.order]=r)}),e}function Rpe(t){var e=nd(ft(t.nodes(),function(r){return t.node(r).rank}));Ie(t.nodes(),function(r){var n=t.node(r);Ft(n,"rank")&&(n.rank-=e)})}function Npe(t){var e=nd(ft(t.nodes(),function(a){return t.node(a).rank})),r=[];Ie(t.nodes(),function(a){var s=t.node(a).rank-e;r[s]||(r[s]=[]),r[s].push(a)});var n=0,i=t.graph().nodeRankFactor;Ie(r,function(a,s){Rr(a)&&s%i!==0?--n:n&&Ie(a,function(o){t.node(o).rank+=n})})}function S8(t,e,r,n){var i={width:0,height:0};return arguments.length>=4&&(i.rank=r,i.order=n),Ld(t,"border",i,e)}function B$(t){return hu(ft(t.nodes(),function(e){var r=t.node(e).rank;if(!Rr(r))return r}))}function Dpe(t,e){var r={lhs:[],rhs:[]};return Ie(t,function(n){e(n)?r.lhs.push(n):r.rhs.push(n)}),r}function Mpe(t,e){return e()}function Ipe(t){function e(r){var n=t.children(r),i=t.node(r);if(n.length&&Ie(n,e),Object.prototype.hasOwnProperty.call(i,"minRank")){i.borderLeft=[],i.borderRight=[];for(var a=i.minRank,s=i.maxRank+1;a<s;++a)C8(t,"borderLeft","_bl",r,i,a),C8(t,"borderRight","_br",r,i,a)}}Ie(t.children(),e)}function C8(t,e,r,n,i,a){var s={width:0,height:0,rank:a,borderType:e},o=i[e][a-1],l=Ld(t,"border",s,r);i[e][a]=l,t.setParent(l,n),o&&t.setEdge(o,l,{weight:1})}function Ope(t){var e=t.graph().rankdir.toLowerCase();(e==="lr"||e==="rl")&&F$(t)}function Ppe(t){var e=t.graph().rankdir.toLowerCase();(e==="bt"||e==="rl")&&Bpe(t),(e==="lr"||e==="rl")&&(Fpe(t),F$(t))}function F$(t){Ie(t.nodes(),function(e){A8(t.node(e))}),Ie(t.edges(),function(e){A8(t.edge(e))})}function A8(t){var e=t.width;t.width=t.height,t.height=e}function Bpe(t){Ie(t.nodes(),function(e){bb(t.node(e))}),Ie(t.edges(),function(e){var r=t.edge(e);Ie(r.points,bb),Object.prototype.hasOwnProperty.call(r,"y")&&bb(r)})}function bb(t){t.y=-t.y}function Fpe(t){Ie(t.nodes(),function(e){wb(t.node(e))}),Ie(t.edges(),function(e){var r=t.edge(e);Ie(r.points,wb),Object.prototype.hasOwnProperty.call(r,"x")&&wb(r)})}function wb(t){var e=t.x;t.x=t.y,t.y=e}function $pe(t){t.graph().dummyChains=[],Ie(t.edges(),function(e){zpe(t,e)})}function zpe(t,e){var r=e.v,n=t.node(r).rank,i=e.w,a=t.node(i).rank,s=e.name,o=t.edge(e),l=o.labelRank;if(a!==n+1){t.removeEdge(e);var u=void 0,h,d;for(d=0,++n;n<a;++d,++n)o.points=[],u={width:0,height:0,edgeLabel:o,edgeObj:e,rank:n},h=Ld(t,"edge",u,"_d"),n===l&&(u.width=o.width,u.height=o.height,u.dummy="edge-label",u.labelpos=o.labelpos),t.setEdge(r,h,{weight:o.weight},s),d===0&&t.graph().dummyChains.push(h),r=h;t.setEdge(r,i,{weight:o.weight},s)}}function Vpe(t){Ie(t.graph().dummyChains,function(e){var r=t.node(e),n=r.edgeLabel,i;for(t.setEdge(r.edgeObj,n);r.dummy;)i=t.successors(e)[0],t.removeNode(e),n.points.push({x:r.x,y:r.y}),r.dummy==="edge-label"&&(n.x=r.x,n.y=r.y,n.width=r.width,n.height=r.height),e=i,r=t.node(e)})}function BE(t){var e={};function r(n){var i=t.node(n);if(Object.prototype.hasOwnProperty.call(e,n))return i.rank;e[n]=!0;var a=nd(ft(t.outEdges(n),function(s){return r(s.w)-t.edge(s).minlen}));return(a===Number.POSITIVE_INFINITY||a===void 0||a===null)&&(a=0),i.rank=a}Ie(t.sources(),r)}function tp(t,e){return t.node(e.w).rank-t.node(e.v).rank-t.edge(e).minlen}function $$(t){var e=new ma({directed:!1}),r=t.nodes()[0],n=t.nodeCount();e.setNode(r,{});for(var i,a;Gpe(e,t)<n;)i=Upe(e,t),a=e.hasNode(i.v)?tp(t,i):-tp(t,i),Wpe(e,t,a);return e}function Gpe(t,e){function r(n){Ie(e.nodeEdges(n),function(i){var a=i.v,s=n===a?i.w:a;!t.hasNode(s)&&!tp(e,i)&&(t.setNode(s,{}),t.setEdge(n,s,{}),r(s))})}return Ie(t.nodes(),r),t.nodeCount()}function Upe(t,e){return ME(e.edges(),function(r){if(t.hasNode(r.v)!==t.hasNode(r.w))return tp(e,r)})}function Wpe(t,e,r){Ie(t.nodes(),function(n){e.node(n).rank+=r})}function Hpe(){}Hpe.prototype=new Error;function z$(t,e,r){ar(e)||(e=[e]);var n=(t.isDirected()?t.successors:t.neighbors).bind(t),i=[],a={};return Ie(e,function(s){if(!t.hasNode(s))throw new Error("Graph does not have node: "+s);V$(t,s,r==="post",a,n,i)}),i}function V$(t,e,r,n,i,a){Object.prototype.hasOwnProperty.call(n,e)||(n[e]=!0,r||a.push(e),Ie(i(e),function(s){V$(t,s,r,n,i,a)}),r&&a.push(e))}function qpe(t,e){return z$(t,e,"post")}function Ype(t,e){return z$(t,e,"pre")}Iu.initLowLimValues=$E;Iu.initCutValues=FE;Iu.calcCutValue=G$;Iu.leaveEdge=W$;Iu.enterEdge=H$;Iu.exchangeEdges=q$;function Iu(t){t=Lpe(t),BE(t);var e=$$(t);$E(e),FE(e,t);for(var r,n;r=W$(e);)n=H$(e,t,r),q$(e,t,r,n)}function FE(t,e){var r=qpe(t,t.nodes());r=r.slice(0,r.length-1),Ie(r,function(n){Xpe(t,e,n)})}function Xpe(t,e,r){var n=t.node(r),i=n.parent;t.edge(r,i).cutvalue=G$(t,e,r)}function G$(t,e,r){var n=t.node(r),i=n.parent,a=!0,s=e.edge(r,i),o=0;return s||(a=!1,s=e.edge(i,r)),o=s.weight,Ie(e.nodeEdges(r),function(l){var u=l.v===r,h=u?l.w:l.v;if(h!==i){var d=u===a,f=e.edge(l).weight;if(o+=d?f:-f,Kpe(t,r,h)){var p=t.edge(r,h).cutvalue;o+=d?-p:p}}}),o}function $E(t,e){arguments.length<2&&(e=t.nodes()[0]),U$(t,{},1,e)}function U$(t,e,r,n,i){var a=r,s=t.node(n);return e[n]=!0,Ie(t.neighbors(n),function(o){Object.prototype.hasOwnProperty.call(e,o)||(r=U$(t,e,r,o,n))}),s.low=a,s.lim=r++,i?s.parent=i:delete s.parent,r}function W$(t){return jo(t.edges(),function(e){return t.edge(e).cutvalue<0})}function H$(t,e,r){var n=r.v,i=r.w;e.hasEdge(n,i)||(n=r.w,i=r.v);var a=t.node(n),s=t.node(i),o=a,l=!1;a.lim>s.lim&&(o=s,l=!0);var u=cn(e.edges(),function(h){return l===_8(t,t.node(h.v),o)&&l!==_8(t,t.node(h.w),o)});return ME(u,function(h){return tp(e,h)})}function q$(t,e,r,n){var i=r.v,a=r.w;t.removeEdge(i,a),t.setEdge(n.v,n.w,{}),$E(t),FE(t,e),jpe(t,e)}function jpe(t,e){var r=jo(t.nodes(),function(i){return!e.node(i).parent}),n=Ype(t,r);n=n.slice(1),Ie(n,function(i){var a=t.node(i).parent,s=e.edge(i,a),o=!1;s||(s=e.edge(a,i),o=!0),e.node(i).rank=e.node(a).rank+(o?s.minlen:-s.minlen)})}function Kpe(t,e,r){return t.hasEdge(e,r)}function _8(t,e,r){return r.low<=e.lim&&e.lim<=r.lim}function Zpe(t){switch(t.graph().ranker){case"network-simplex":L8(t);break;case"tight-tree":Jpe(t);break;case"longest-path":Qpe(t);break;default:L8(t)}}var Qpe=BE;function Jpe(t){BE(t),$$(t)}function L8(t){Iu(t)}function ege(t){var e=Ld(t,"root",{},"_root"),r=tge(t),n=hu(Pr(r))-1,i=2*n+1;t.graph().nestingRoot=e,Ie(t.edges(),function(s){t.edge(s).minlen*=i});var a=rge(t)+1;Ie(t.children(),function(s){Y$(t,e,i,a,n,r,s)}),t.graph().nodeRankFactor=i}function Y$(t,e,r,n,i,a,s){var o=t.children(s);if(!o.length){s!==e&&t.setEdge(e,s,{weight:0,minlen:r});return}var l=S8(t,"_bt"),u=S8(t,"_bb"),h=t.node(s);t.setParent(l,s),h.borderTop=l,t.setParent(u,s),h.borderBottom=u,Ie(o,function(d){Y$(t,e,r,n,i,a,d);var f=t.node(d),p=f.borderTop?f.borderTop:d,g=f.borderBottom?f.borderBottom:d,m=f.borderTop?n:2*n,v=p!==g?1:i-a[s]+1;t.setEdge(l,p,{weight:m,minlen:v,nestingEdge:!0}),t.setEdge(g,u,{weight:m,minlen:v,nestingEdge:!0})}),t.parent(s)||t.setEdge(e,l,{weight:0,minlen:i+a[s]})}function tge(t){var e={};function r(n,i){var a=t.children(n);a&&a.length&&Ie(a,function(s){r(s,i+1)}),e[n]=i}return Ie(t.children(),function(n){r(n,1)}),e}function rge(t){return Cn(t.edges(),function(e,r){return e+t.edge(r).weight},0)}function nge(t){var e=t.graph();t.removeNode(e.nestingRoot),delete e.nestingRoot,Ie(t.edges(),function(r){var n=t.edge(r);n.nestingEdge&&t.removeEdge(r)})}function ige(t,e,r){var n={},i;Ie(r,function(a){for(var s=t.parent(a),o,l;s;){if(o=t.parent(s),o?(l=n[o],n[o]=s):(l=i,i=s),l&&l!==s){e.setEdge(l,s);return}s=o}})}function age(t,e,r){var n=sge(t),i=new ma({compound:!0}).setGraph({root:n}).setDefaultNodeLabel(function(a){return t.node(a)});return Ie(t.nodes(),function(a){var s=t.node(a),o=t.parent(a);(s.rank===e||s.minRank<=e&&e<=s.maxRank)&&(i.setNode(a),i.setParent(a,o||n),Ie(t[r](a),function(l){var u=l.v===a?l.w:l.v,h=i.edge(u,a),d=Rr(h)?0:h.weight;i.setEdge(u,a,{weight:t.edge(l).weight+d})}),Object.prototype.hasOwnProperty.call(s,"minRank")&&i.setNode(a,{borderLeft:s.borderLeft[e],borderRight:s.borderRight[e]}))}),i}function sge(t){for(var e;t.hasNode(e=PE("_root")););return e}function oge(t,e){for(var r=0,n=1;n<e.length;++n)r+=lge(t,e[n-1],e[n]);return r}function lge(t,e,r){for(var n=vpe(r,ft(r,function(u,h){return h})),i=Xn(ft(e,function(u){return Xp(ft(t.outEdges(u),function(h){return{pos:n[h.w],weight:t.edge(h).weight}}),"pos")})),a=1;a<r.length;)a<<=1;var s=2*a-1;a-=1;var o=ft(new Array(s),function(){return 0}),l=0;return Ie(i.forEach(function(u){var h=u.pos+a;o[h]+=u.weight;for(var d=0;h>0;)h%2&&(d+=o[h+1]),h=h-1>>1,o[h]+=u.weight;l+=u.weight*d})),l}function cge(t){var e={},r=cn(t.nodes(),function(o){return!t.children(o).length}),n=hu(ft(r,function(o){return t.node(o).rank})),i=ft(id(n+1),function(){return[]});function a(o){if(!Ft(e,o)){e[o]=!0;var l=t.node(o);i[l.rank].push(o),Ie(t.successors(o),a)}}var s=Xp(r,function(o){return t.node(o).rank});return Ie(s,a),i}function uge(t,e){return ft(e,function(r){var n=t.inEdges(r);if(n.length){var i=Cn(n,function(a,s){var o=t.edge(s),l=t.node(s.v);return{sum:a.sum+o.weight*l.order,weight:a.weight+o.weight}},{sum:0,weight:0});return{v:r,barycenter:i.sum/i.weight,weight:i.weight}}else return{v:r}})}function hge(t,e){var r={};Ie(t,function(i,a){var s=r[i.v]={indegree:0,in:[],out:[],vs:[i.v],i:a};Rr(i.barycenter)||(s.barycenter=i.barycenter,s.weight=i.weight)}),Ie(e.edges(),function(i){var a=r[i.v],s=r[i.w];!Rr(a)&&!Rr(s)&&(s.indegree++,a.out.push(r[i.w]))});var n=cn(r,function(i){return!i.indegree});return dge(n)}function dge(t){var e=[];function r(a){return function(s){s.merged||(Rr(s.barycenter)||Rr(a.barycenter)||s.barycenter>=a.barycenter)&&fge(a,s)}}function n(a){return function(s){s.in.push(a),--s.indegree===0&&t.push(s)}}for(;t.length;){var i=t.pop();e.push(i),Ie(i.in.reverse(),r(i)),Ie(i.out,n(i))}return ft(cn(e,function(a){return!a.merged}),function(a){return Lv(a,["vs","i","barycenter","weight"])})}function fge(t,e){var r=0,n=0;t.weight&&(r+=t.barycenter*t.weight,n+=t.weight),e.weight&&(r+=e.barycenter*e.weight,n+=e.weight),t.vs=e.vs.concat(t.vs),t.barycenter=r/n,t.weight=n,t.i=Math.min(e.i,t.i),e.merged=!0}function pge(t,e){var r=Dpe(t,function(h){return Object.prototype.hasOwnProperty.call(h,"barycenter")}),n=r.lhs,i=Xp(r.rhs,function(h){return-h.i}),a=[],s=0,o=0,l=0;n.sort(gge(!!e)),l=R8(a,i,l),Ie(n,function(h){l+=h.vs.length,a.push(h.vs),s+=h.barycenter*h.weight,o+=h.weight,l=R8(a,i,l)});var u={vs:Xn(a)};return o&&(u.barycenter=s/o,u.weight=o),u}function R8(t,e,r){for(var n;e.length&&(n=Zs(e)).i<=r;)e.pop(),t.push(n.vs),r++;return r}function gge(t){return function(e,r){return e.barycenter<r.barycenter?-1:e.barycenter>r.barycenter?1:t?r.i-e.i:e.i-r.i}}function X$(t,e,r,n){var i=t.children(e),a=t.node(e),s=a?a.borderLeft:void 0,o=a?a.borderRight:void 0,l={};s&&(i=cn(i,function(g){return g!==s&&g!==o}));var u=uge(t,i);Ie(u,function(g){if(t.children(g.v).length){var m=X$(t,g.v,r,n);l[g.v]=m,Object.prototype.hasOwnProperty.call(m,"barycenter")&&vge(g,m)}});var h=hge(u,r);mge(h,l);var d=pge(h,n);if(s&&(d.vs=Xn([s,d.vs,o]),t.predecessors(s).length)){var f=t.node(t.predecessors(s)[0]),p=t.node(t.predecessors(o)[0]);Object.prototype.hasOwnProperty.call(d,"barycenter")||(d.barycenter=0,d.weight=0),d.barycenter=(d.barycenter*d.weight+f.order+p.order)/(d.weight+2),d.weight+=2}return d}function mge(t,e){Ie(t,function(r){r.vs=Xn(r.vs.map(function(n){return e[n]?e[n].vs:n}))})}function vge(t,e){Rr(t.barycenter)?(t.barycenter=e.barycenter,t.weight=e.weight):(t.barycenter=(t.barycenter*t.weight+e.barycenter*e.weight)/(t.weight+e.weight),t.weight+=e.weight)}function yge(t){var e=B$(t),r=N8(t,id(1,e+1),"inEdges"),n=N8(t,id(e-1,-1,-1),"outEdges"),i=cge(t);D8(t,i);for(var a=Number.POSITIVE_INFINITY,s,o=0,l=0;l<4;++o,++l){xge(o%2?r:n,o%4>=2),i=C2(t);var u=oge(t,i);u<a&&(l=0,s=Ffe(i),a=u)}D8(t,s)}function N8(t,e,r){return ft(e,function(n){return age(t,n,r)})}function xge(t,e){var r=new ma;Ie(t,function(n){var i=n.graph().root,a=X$(n,i,r,e);Ie(a.vs,function(s,o){n.node(s).order=o}),ige(n,r,a.vs)})}function D8(t,e){Ie(e,function(r){Ie(r,function(n,i){t.node(n).order=i})})}function bge(t){var e=Tge(t);Ie(t.graph().dummyChains,function(r){for(var n=t.node(r),i=n.edgeObj,a=wge(t,e,i.v,i.w),s=a.path,o=a.lca,l=0,u=s[l],h=!0;r!==i.w;){if(n=t.node(r),h){for(;(u=s[l])!==o&&t.node(u).maxRank<n.rank;)l++;u===o&&(h=!1)}if(!h){for(;l<s.length-1&&t.node(u=s[l+1]).minRank<=n.rank;)l++;u=s[l]}t.setParent(r,u),r=t.successors(r)[0]}})}function wge(t,e,r,n){var i=[],a=[],s=Math.min(e[r].low,e[n].low),o=Math.max(e[r].lim,e[n].lim),l,u;l=r;do l=t.parent(l),i.push(l);while(l&&(e[l].low>s||o>e[l].lim));for(u=l,l=n;(l=t.parent(l))!==u;)a.push(l);return{path:i.concat(a.reverse()),lca:u}}function Tge(t){var e={},r=0;function n(i){var a=r;Ie(t.children(i),n),e[i]={low:a,lim:r++}}return Ie(t.children(),n),e}function Ege(t,e){var r={};function n(i,a){var s=0,o=0,l=i.length,u=Zs(a);return Ie(a,function(h,d){var f=Sge(t,h),p=f?t.node(f).order:l;(f||h===u)&&(Ie(a.slice(o,d+1),function(g){Ie(t.predecessors(g),function(m){var v=t.node(m),y=v.order;(y<s||p<y)&&!(v.dummy&&t.node(g).dummy)&&j$(r,m,g)})}),o=d+1,s=p)}),a}return Cn(e,n),r}function kge(t,e){var r={};function n(a,s,o,l,u){var h;Ie(id(s,o),function(d){h=a[d],t.node(h).dummy&&Ie(t.predecessors(h),function(f){var p=t.node(f);p.dummy&&(p.order<l||p.order>u)&&j$(r,f,h)})})}function i(a,s){var o=-1,l,u=0;return Ie(s,function(h,d){if(t.node(h).dummy==="border"){var f=t.predecessors(h);f.length&&(l=t.node(f[0]).order,n(s,u,d,o,l),u=d,o=l)}n(s,u,s.length,l,a.length)}),s}return Cn(e,i),r}function Sge(t,e){if(t.node(e).dummy)return jo(t.predecessors(e),function(r){return t.node(r).dummy})}function j$(t,e,r){if(e>r){var n=e;e=r,r=n}Object.prototype.hasOwnProperty.call(t,e)||Object.defineProperty(t,e,{enumerable:!0,configurable:!0,value:{},writable:!0});var i=t[e];Object.defineProperty(i,r,{enumerable:!0,configurable:!0,value:!0,writable:!0})}function Cge(t,e,r){if(e>r){var n=e;e=r,r=n}return!!t[e]&&Object.prototype.hasOwnProperty.call(t[e],r)}function Age(t,e,r,n){var i={},a={},s={};return Ie(e,function(o){Ie(o,function(l,u){i[l]=l,a[l]=l,s[l]=u})}),Ie(e,function(o){var l=-1;Ie(o,function(u){var h=n(u);if(h.length){h=Xp(h,function(m){return s[m]});for(var d=(h.length-1)/2,f=Math.floor(d),p=Math.ceil(d);f<=p;++f){var g=h[f];a[u]===u&&l<s[g]&&!Cge(r,u,g)&&(a[g]=u,a[u]=i[u]=i[g],l=s[g])}}})}),{root:i,align:a}}function _ge(t,e,r,n,i){var a={},s=Lge(t,e,r,i),o=i?"borderLeft":"borderRight";function l(d,f){for(var p=s.nodes(),g=p.pop(),m={};g;)m[g]?d(g):(m[g]=!0,p.push(g),p=p.concat(f(g))),g=p.pop()}function u(d){a[d]=s.inEdges(d).reduce(function(f,p){return Math.max(f,a[p.v]+s.edge(p))},0)}function h(d){var f=s.outEdges(d).reduce(function(g,m){return Math.min(g,a[m.w]-s.edge(m))},Number.POSITIVE_INFINITY),p=t.node(d);f!==Number.POSITIVE_INFINITY&&p.borderType!==o&&(a[d]=Math.max(a[d],f))}return l(u,s.predecessors.bind(s)),l(h,s.successors.bind(s)),Ie(n,function(d){a[d]=a[r[d]]}),a}function Lge(t,e,r,n){var i=new ma,a=t.graph(),s=Ige(a.nodesep,a.edgesep,n);return Ie(e,function(o){var l;Ie(o,function(u){var h=r[u];if(i.setNode(h),l){var d=r[l],f=i.edge(d,h);i.setEdge(d,h,Math.max(s(t,u,l),f||0))}l=u})}),i}function Rge(t,e){return ME(Pr(e),function(r){var n=Number.NEGATIVE_INFINITY,i=Number.POSITIVE_INFINITY;return P0e(r,function(a,s){var o=Oge(t,s)/2;n=Math.max(a+o,n),i=Math.min(a-o,i)}),n-i})}function Nge(t,e){var r=Pr(e),n=nd(r),i=hu(r);Ie(["u","d"],function(a){Ie(["l","r"],function(s){var o=a+s,l=t[o],u;if(l!==e){var h=Pr(l);u=s==="l"?n-nd(h):i-hu(h),u&&(t[o]=k2(l,function(d){return d+u}))}})})}function Dge(t,e){return k2(t.ul,function(r,n){if(e)return t[e.toLowerCase()][n];var i=Xp(ft(t,n));return(i[1]+i[2])/2})}function Mge(t){var e=C2(t),r=hv(Ege(t,e),kge(t,e)),n={},i;Ie(["u","d"],function(s){i=s==="u"?e:Pr(e).reverse(),Ie(["l","r"],function(o){o==="r"&&(i=ft(i,function(d){return Pr(d).reverse()}));var l=(s==="u"?t.predecessors:t.successors).bind(t),u=Age(t,i,r,l),h=_ge(t,i,u.root,u.align,o==="r");o==="r"&&(h=k2(h,function(d){return-d})),n[s+o]=h})});var a=Rge(t,n);return Nge(n,a),Dge(n,t.graph().align)}function Ige(t,e,r){return function(n,i,a){var s=n.node(i),o=n.node(a),l=0,u;if(l+=s.width/2,Object.prototype.hasOwnProperty.call(s,"labelpos"))switch(s.labelpos.toLowerCase()){case"l":u=-s.width/2;break;case"r":u=s.width/2;break}if(u&&(l+=r?u:-u),u=0,l+=(s.dummy?e:t)/2,l+=(o.dummy?e:t)/2,l+=o.width/2,Object.prototype.hasOwnProperty.call(o,"labelpos"))switch(o.labelpos.toLowerCase()){case"l":u=o.width/2;break;case"r":u=-o.width/2;break}return u&&(l+=r?u:-u),u=0,l}}function Oge(t,e){return t.node(e).width}function Pge(t){t=P$(t),Bge(t),B0e(Mge(t),function(e,r){t.node(r).x=e})}function Bge(t){var e=C2(t),r=t.graph().ranksep,n=0;Ie(e,function(i){var a=hu(ft(i,function(s){return t.node(s).height}));Ie(i,function(s){t.node(s).y=n+a/2}),n+=a+r})}function K$(t,e){var r=Mpe;r("layout",()=>{var n=r("  buildLayoutGraph",()=>Xge(t));r("  runLayout",()=>Fge(n,r)),r("  updateInputGraph",()=>$ge(t,n))})}function Fge(t,e){e("    makeSpaceForEdgeLabels",()=>jge(t)),e("    removeSelfEdges",()=>i1e(t)),e("    acyclic",()=>Cpe(t)),e("    nestingGraph.run",()=>ege(t)),e("    rank",()=>Zpe(P$(t))),e("    injectEdgeLabelProxies",()=>Kge(t)),e("    removeEmptyRanks",()=>Npe(t)),e("    nestingGraph.cleanup",()=>nge(t)),e("    normalizeRanks",()=>Rpe(t)),e("    assignRankMinMax",()=>Zge(t)),e("    removeEdgeLabelProxies",()=>Qge(t)),e("    normalize.run",()=>$pe(t)),e("    parentDummyChains",()=>bge(t)),e("    addBorderSegments",()=>Ipe(t)),e("    order",()=>yge(t)),e("    insertSelfEdges",()=>a1e(t)),e("    adjustCoordinateSystem",()=>Ope(t)),e("    position",()=>Pge(t)),e("    positionSelfEdges",()=>s1e(t)),e("    removeBorderNodes",()=>n1e(t)),e("    normalize.undo",()=>Vpe(t)),e("    fixupEdgeLabelCoords",()=>t1e(t)),e("    undoCoordinateSystem",()=>Ppe(t)),e("    translateGraph",()=>Jge(t)),e("    assignNodeIntersects",()=>e1e(t)),e("    reversePoints",()=>r1e(t)),e("    acyclic.undo",()=>_pe(t))}function $ge(t,e){Ie(t.nodes(),function(r){var n=t.node(r),i=e.node(r);n&&(n.x=i.x,n.y=i.y,e.children(r).length&&(n.width=i.width,n.height=i.height))}),Ie(t.edges(),function(r){var n=t.edge(r),i=e.edge(r);n.points=i.points,Object.prototype.hasOwnProperty.call(i,"x")&&(n.x=i.x,n.y=i.y)}),t.graph().width=e.graph().width,t.graph().height=e.graph().height}var zge=["nodesep","edgesep","ranksep","marginx","marginy"],Vge={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},Gge=["acyclicer","ranker","rankdir","align"],Uge=["width","height"],Wge={width:0,height:0},Hge=["minlen","weight","width","height","labeloffset"],qge={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},Yge=["labelpos"];function Xge(t){var e=new ma({multigraph:!0,compound:!0}),r=Eb(t.graph());return e.setGraph(hv({},Vge,Tb(r,zge),Lv(r,Gge))),Ie(t.nodes(),function(n){var i=Eb(t.node(n));e.setNode(n,T2(Tb(i,Uge),Wge)),e.setParent(n,t.parent(n))}),Ie(t.edges(),function(n){var i=Eb(t.edge(n));e.setEdge(n,hv({},qge,Tb(i,Hge),Lv(i,Yge)))}),e}function jge(t){var e=t.graph();e.ranksep/=2,Ie(t.edges(),function(r){var n=t.edge(r);n.minlen*=2,n.labelpos.toLowerCase()!=="c"&&(e.rankdir==="TB"||e.rankdir==="BT"?n.width+=n.labeloffset:n.height+=n.labeloffset)})}function Kge(t){Ie(t.edges(),function(e){var r=t.edge(e);if(r.width&&r.height){var n=t.node(e.v),i=t.node(e.w),a={rank:(i.rank-n.rank)/2+n.rank,e};Ld(t,"edge-proxy",a,"_ep")}})}function Zge(t){var e=0;Ie(t.nodes(),function(r){var n=t.node(r);n.borderTop&&(n.minRank=t.node(n.borderTop).rank,n.maxRank=t.node(n.borderBottom).rank,e=hu(e,n.maxRank))}),t.graph().maxRank=e}function Qge(t){Ie(t.nodes(),function(e){var r=t.node(e);r.dummy==="edge-proxy"&&(t.edge(r.e).labelRank=r.rank,t.removeNode(e))})}function Jge(t){var e=Number.POSITIVE_INFINITY,r=0,n=Number.POSITIVE_INFINITY,i=0,a=t.graph(),s=a.marginx||0,o=a.marginy||0;function l(u){var h=u.x,d=u.y,f=u.width,p=u.height;e=Math.min(e,h-f/2),r=Math.max(r,h+f/2),n=Math.min(n,d-p/2),i=Math.max(i,d+p/2)}Ie(t.nodes(),function(u){l(t.node(u))}),Ie(t.edges(),function(u){var h=t.edge(u);Object.prototype.hasOwnProperty.call(h,"x")&&l(h)}),e-=s,n-=o,Ie(t.nodes(),function(u){var h=t.node(u);h.x-=e,h.y-=n}),Ie(t.edges(),function(u){var h=t.edge(u);Ie(h.points,function(d){d.x-=e,d.y-=n}),Object.prototype.hasOwnProperty.call(h,"x")&&(h.x-=e),Object.prototype.hasOwnProperty.call(h,"y")&&(h.y-=n)}),a.width=r-e+s,a.height=i-n+o}function e1e(t){Ie(t.edges(),function(e){var r=t.edge(e),n=t.node(e.v),i=t.node(e.w),a,s;r.points?(a=r.points[0],s=r.points[r.points.length-1]):(r.points=[],a=i,s=n),r.points.unshift(k8(n,a)),r.points.push(k8(i,s))})}function t1e(t){Ie(t.edges(),function(e){var r=t.edge(e);if(Object.prototype.hasOwnProperty.call(r,"x"))switch((r.labelpos==="l"||r.labelpos==="r")&&(r.width-=r.labeloffset),r.labelpos){case"l":r.x-=r.width/2+r.labeloffset;break;case"r":r.x+=r.width/2+r.labeloffset;break}})}function r1e(t){Ie(t.edges(),function(e){var r=t.edge(e);r.reversed&&r.points.reverse()})}function n1e(t){Ie(t.nodes(),function(e){if(t.children(e).length){var r=t.node(e),n=t.node(r.borderTop),i=t.node(r.borderBottom),a=t.node(Zs(r.borderLeft)),s=t.node(Zs(r.borderRight));r.width=Math.abs(s.x-a.x),r.height=Math.abs(i.y-n.y),r.x=a.x+r.width/2,r.y=n.y+r.height/2}}),Ie(t.nodes(),function(e){t.node(e).dummy==="border"&&t.removeNode(e)})}function i1e(t){Ie(t.edges(),function(e){if(e.v===e.w){var r=t.node(e.v);r.selfEdges||(r.selfEdges=[]),r.selfEdges.push({e,label:t.edge(e)}),t.removeEdge(e)}})}function a1e(t){var e=C2(t);Ie(e,function(r){var n=0;Ie(r,function(i,a){var s=t.node(i);s.order=a+n,Ie(s.selfEdges,function(o){Ld(t,"selfedge",{width:o.label.width,height:o.label.height,rank:s.rank,order:a+ ++n,e:o.e,label:o.label},"_se")}),delete s.selfEdges})})}function s1e(t){Ie(t.nodes(),function(e){var r=t.node(e);if(r.dummy==="selfedge"){var n=t.node(r.e.v),i=n.x+n.width/2,a=n.y,s=r.x-i,o=n.height/2;t.setEdge(r.e,r.label),t.removeNode(e),r.label.points=[{x:i+2*s/3,y:a-o},{x:i+5*s/6,y:a-o},{x:i+s,y:a},{x:i+5*s/6,y:a+o},{x:i+2*s/3,y:a+o}],r.label.x=r.x,r.label.y=r.y}})}function Tb(t,e){return k2(Lv(t,e),Number)}function Eb(t){var e={};return Ie(t,function(r,n){e[n.toLowerCase()]=r}),e}function Us(t){var e={options:{directed:t.isDirected(),multigraph:t.isMultigraph(),compound:t.isCompound()},nodes:o1e(t),edges:l1e(t)};return Rr(t.graph())||(e.value=Fn(t.graph())),e}function o1e(t){return ft(t.nodes(),function(e){var r=t.node(e),n=t.parent(e),i={v:e};return Rr(r)||(i.value=r),Rr(n)||(i.parent=n),i})}function l1e(t){return ft(t.edges(),function(e){var r=t.edge(e),n={v:e.v,w:e.w};return Rr(e.name)||(n.name=e.name),Rr(r)||(n.value=r),n})}var er=new Map,qc=new Map,Z$=new Map,c1e=x(()=>{qc.clear(),Z$.clear(),er.clear()},"clear"),Rv=x((t,e)=>{const r=qc.get(e)||[];return ie.trace("In isDescendant",e," ",t," = ",r.includes(t)),r.includes(t)},"isDescendant"),u1e=x((t,e)=>{const r=qc.get(e)||[];return ie.info("Descendants of ",e," is ",r),ie.info("Edge is ",t),t.v===e||t.w===e?!1:r?r.includes(t.v)||Rv(t.v,e)||Rv(t.w,e)||r.includes(t.w):(ie.debug("Tilt, ",e,",not in descendants"),!1)},"edgeInCluster"),Q$=x((t,e,r,n)=>{ie.warn("Copying children of ",t,"root",n,"data",e.node(t),n);const i=e.children(t)||[];t!==n&&i.push(t),ie.warn("Copying (nodes) clusterId",t,"nodes",i),i.forEach(a=>{if(e.children(a).length>0)Q$(a,e,r,n);else{const s=e.node(a);ie.info("cp ",a," to ",n," with parent ",t),r.setNode(a,s),n!==e.parent(a)&&(ie.warn("Setting parent",a,e.parent(a)),r.setParent(a,e.parent(a))),t!==n&&a!==t?(ie.debug("Setting parent",a,t),r.setParent(a,t)):(ie.info("In copy ",t,"root",n,"data",e.node(t),n),ie.debug("Not Setting parent for node=",a,"cluster!==rootId",t!==n,"node!==clusterId",a!==t));const o=e.edges(a);ie.debug("Copying Edges",o),o.forEach(l=>{ie.info("Edge",l);const u=e.edge(l.v,l.w,l.name);ie.info("Edge data",u,n);try{u1e(l,n)?(ie.info("Copying as ",l.v,l.w,u,l.name),r.setEdge(l.v,l.w,u,l.name),ie.info("newGraph edges ",r.edges(),r.edge(r.edges()[0]))):ie.info("Skipping copy of edge ",l.v,"-->",l.w," rootId: ",n," clusterId:",t)}catch(h){ie.error(h)}})}ie.debug("Removing node",a),e.removeNode(a)})},"copy"),J$=x((t,e)=>{const r=e.children(t);let n=[...r];for(const i of r)Z$.set(i,t),n=[...n,...J$(i,e)];return n},"extractDescendants"),h1e=x((t,e,r)=>{const n=t.edges().filter(l=>l.v===e||l.w===e),i=t.edges().filter(l=>l.v===r||l.w===r),a=n.map(l=>({v:l.v===e?r:l.v,w:l.w===e?e:l.w})),s=i.map(l=>({v:l.v,w:l.w}));return a.filter(l=>s.some(u=>l.v===u.v&&l.w===u.w))},"findCommonEdges"),rp=x((t,e,r)=>{const n=e.children(t);if(ie.trace("Searching children of id ",t,n),n.length<1)return t;let i;for(const a of n){const s=rp(a,e,r),o=h1e(e,r,s);if(s)if(o.length>0)i=s;else return s}return i},"findNonClusterChild"),M8=x(t=>!er.has(t)||!er.get(t).externalConnections?t:er.has(t)?er.get(t).id:t,"getAnchorId"),d1e=x((t,e)=>{if(!t||e>10){ie.debug("Opting out, no graph ");return}else ie.debug("Opting in, graph ");t.nodes().forEach(function(r){t.children(r).length>0&&(ie.warn("Cluster identified",r," Replacement id in edges: ",rp(r,t,r)),qc.set(r,J$(r,t)),er.set(r,{id:rp(r,t,r),clusterData:t.node(r)}))}),t.nodes().forEach(function(r){const n=t.children(r),i=t.edges();n.length>0?(ie.debug("Cluster identified",r,qc),i.forEach(a=>{const s=Rv(a.v,r),o=Rv(a.w,r);s^o&&(ie.warn("Edge: ",a," leaves cluster ",r),ie.warn("Descendants of XXX ",r,": ",qc.get(r)),er.get(r).externalConnections=!0)})):ie.debug("Not a cluster ",r,qc)});for(let r of er.keys()){const n=er.get(r).id,i=t.parent(n);i!==r&&er.has(i)&&!er.get(i).externalConnections&&(er.get(r).id=i)}t.edges().forEach(function(r){const n=t.edge(r);ie.warn("Edge "+r.v+" -> "+r.w+": "+JSON.stringify(r)),ie.warn("Edge "+r.v+" -> "+r.w+": "+JSON.stringify(t.edge(r)));let i=r.v,a=r.w;if(ie.warn("Fix XXX",er,"ids:",r.v,r.w,"Translating: ",er.get(r.v)," --- ",er.get(r.w)),er.get(r.v)||er.get(r.w)){if(ie.warn("Fixing and trying - removing XXX",r.v,r.w,r.name),i=M8(r.v),a=M8(r.w),t.removeEdge(r.v,r.w,r.name),i!==r.v){const s=t.parent(i);er.get(s).externalConnections=!0,n.fromCluster=r.v}if(a!==r.w){const s=t.parent(a);er.get(s).externalConnections=!0,n.toCluster=r.w}ie.warn("Fix Replacing with XXX",i,a,r.name),t.setEdge(i,a,n,r.name)}}),ie.warn("Adjusted Graph",Us(t)),ez(t,0),ie.trace(er)},"adjustClustersAndEdges"),ez=x((t,e)=>{if(ie.warn("extractor - ",e,Us(t),t.children("D")),e>10){ie.error("Bailing out");return}let r=t.nodes(),n=!1;for(const i of r){const a=t.children(i);n=n||a.length>0}if(!n){ie.debug("Done, no node has children",t.nodes());return}ie.debug("Nodes = ",r,e);for(const i of r)if(ie.debug("Extracting node",i,er,er.has(i)&&!er.get(i).externalConnections,!t.parent(i),t.node(i),t.children("D")," Depth ",e),!er.has(i))ie.debug("Not a cluster",i,e);else if(!er.get(i).externalConnections&&t.children(i)&&t.children(i).length>0){ie.warn("Cluster without external connections, without a parent and with children",i,e);let s=t.graph().rankdir==="TB"?"LR":"TB";er.get(i)?.clusterData?.dir&&(s=er.get(i).clusterData.dir,ie.warn("Fixing dir",er.get(i).clusterData.dir,s));const o=new ma({multigraph:!0,compound:!0}).setGraph({rankdir:s,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});ie.warn("Old graph before copy",Us(t)),Q$(i,t,o,i),t.setNode(i,{clusterNode:!0,id:i,clusterData:er.get(i).clusterData,label:er.get(i).label,graph:o}),ie.warn("New graph after copy node: (",i,")",Us(o)),ie.debug("Old graph after copy",Us(t))}else ie.warn("Cluster ** ",i," **not meeting the criteria !externalConnections:",!er.get(i).externalConnections," no parent: ",!t.parent(i)," children ",t.children(i)&&t.children(i).length>0,t.children("D"),e),ie.debug(er);r=t.nodes(),ie.warn("New list of nodes",r);for(const i of r){const a=t.node(i);ie.warn(" Now next level",i,a),a?.clusterNode&&ez(a.graph,e+1)}},"extractor"),tz=x((t,e)=>{if(e.length===0)return[];let r=Object.assign([],e);return e.forEach(n=>{const i=t.children(n),a=tz(t,i);r=[...r,...a]}),r},"sorter"),f1e=x(t=>tz(t,t.children()),"sortNodesByHierarchy"),rz=x(async(t,e,r,n,i,a)=>{ie.warn("Graph in recursive render:XAX",Us(e),i);const s=e.graph().rankdir;ie.trace("Dir in recursive render - dir:",s);const o=t.insert("g").attr("class","root");e.nodes()?ie.info("Recursive render XXX",e.nodes()):ie.info("No nodes found for",e),e.edges().length>0&&ie.info("Recursive edges",e.edge(e.edges()[0]));const l=o.insert("g").attr("class","clusters"),u=o.insert("g").attr("class","edgePaths"),h=o.insert("g").attr("class","edgeLabels"),d=o.insert("g").attr("class","nodes");await Promise.all(e.nodes().map(async function(m){const v=e.node(m);if(i!==void 0){const y=JSON.parse(JSON.stringify(i.clusterData));ie.trace(`Setting data for parent cluster XXX
 Node.id = `,m,`
 data=`,y.height,`
Parent cluster`,i.height),e.setNode(i.id,y),e.parent(m)||(ie.trace("Setting parent",m,i.id),e.setParent(m,i.id,y))}if(ie.info("(Insert) Node XXX"+m+": "+JSON.stringify(e.node(m))),v?.clusterNode){ie.info("Cluster identified XBX",m,v.width,e.node(m));const{ranksep:y,nodesep:b}=e.graph();v.graph.setGraph({...v.graph.graph(),ranksep:y+25,nodesep:b});const w=await rz(d,v.graph,r,n,e.node(m),a),T=w.elem;Dt(v,T),v.diff=w.diff||0,ie.info("New compound node after recursive render XAX",m,"width",v.width,"height",v.height),vse(T,v)}else e.children(m).length>0?(ie.trace("Cluster - the non recursive path XBX",m,v.id,v,v.width,"Graph:",e),ie.trace(rp(v.id,e)),er.set(v.id,{id:rp(v.id,e),node:v})):(ie.trace("Node - the non recursive path XAX",m,d,e.node(m),s),await l2(d,e.node(m),{config:a,dir:s}))})),await x(async()=>{const m=e.edges().map(async function(v){const y=e.edge(v.v,v.w,v.name);ie.info("Edge "+v.v+" -> "+v.w+": "+JSON.stringify(v)),ie.info("Edge "+v.v+" -> "+v.w+": ",v," ",JSON.stringify(e.edge(v))),ie.info("Fix",er,"ids:",v.v,v.w,"Translating: ",er.get(v.v),er.get(v.w)),await sB(h,y)});await Promise.all(m)},"processEdges")(),ie.info("Graph before layout:",JSON.stringify(Us(e))),ie.info("############################################# XXX"),ie.info("###                Layout                 ### XXX"),ie.info("############################################# XXX"),K$(e),ie.info("Graph after layout:",JSON.stringify(Us(e)));let p=0,{subGraphTitleTotalMargin:g}=Mp(a);return await Promise.all(f1e(e).map(async function(m){const v=e.node(m);if(ie.info("Position XBX => "+m+": ("+v.x,","+v.y,") width: ",v.width," height: ",v.height),v?.clusterNode)v.y+=g,ie.info("A tainted cluster node XBX1",m,v.id,v.width,v.height,v.x,v.y,e.parent(m)),er.get(v.id).node=v,B5(v);else if(e.children(m).length>0){ie.info("A pure cluster node XBX1",m,v.id,v.x,v.y,v.width,v.height,e.parent(m)),v.height+=g,e.node(v.parentId);const y=v?.padding/2||0,b=v?.labelBBox?.height||0,w=b-y||0;ie.debug("OffsetY",w,"labelHeight",b,"halfPadding",y),await j6(l,v),er.get(v.id).node=v}else{const y=e.node(v.parentId);v.y+=g/2,ie.info("A regular node XBX1 - using the padding",v.id,"parent",v.parentId,v.width,v.height,v.x,v.y,"offsetY",v.offsetY,"parent",y,y?.offsetY,v),B5(v)}})),e.edges().forEach(function(m){const v=e.edge(m);ie.info("Edge "+m.v+" -> "+m.w+": "+JSON.stringify(v),v),v.points.forEach(T=>T.y+=g/2);const y=e.node(m.v);var b=e.node(m.w);const w=cB(u,v,er,r,y,b,n);oB(v,w)}),e.nodes().forEach(function(m){const v=e.node(m);ie.info(m,v.type,v.diff),v.isGroup&&(p=v.diff)}),ie.warn("Returning from recursive render XAX",o,p),{elem:o,diff:p}},"recursiveRender"),p1e=x(async(t,e)=>{const r=new ma({multigraph:!0,compound:!0}).setGraph({rankdir:t.direction,nodesep:t.config?.nodeSpacing||t.config?.flowchart?.nodeSpacing||t.nodeSpacing,ranksep:t.config?.rankSpacing||t.config?.flowchart?.rankSpacing||t.rankSpacing,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}}),n=e.select("g");dB(n,t.markers,t.type,t.diagramId),yse(),wse(),Jae(),c1e(),t.nodes.forEach(a=>{r.setNode(a.id,{...a}),a.parentId&&r.setParent(a.id,a.parentId)}),ie.debug("Edges:",t.edges),t.edges.forEach(a=>{if(a.start===a.end){const s=a.start,o=s+"---"+s+"---1",l=s+"---"+s+"---2",u=r.node(s);r.setNode(o,{domId:o,id:o,parentId:u.parentId,labelStyle:"",label:"",padding:0,shape:"labelRect",style:"",width:10,height:10}),r.setParent(o,u.parentId),r.setNode(l,{domId:l,id:l,parentId:u.parentId,labelStyle:"",padding:0,shape:"labelRect",label:"",style:"",width:10,height:10}),r.setParent(l,u.parentId);const h=structuredClone(a),d=structuredClone(a),f=structuredClone(a);h.label="",h.arrowTypeEnd="none",h.id=s+"-cyclic-special-1",d.arrowTypeStart="none",d.arrowTypeEnd="none",d.id=s+"-cyclic-special-mid",f.label="",u.isGroup&&(h.fromCluster=s,f.toCluster=s),f.id=s+"-cyclic-special-2",f.arrowTypeStart="none",r.setEdge(s,o,h,s+"-cyclic-special-0"),r.setEdge(o,l,d,s+"-cyclic-special-1"),r.setEdge(l,s,f,s+"-cyc<lic-special-2")}else r.setEdge(a.start,a.end,{...a},a.id)}),ie.warn("Graph at first:",JSON.stringify(Us(r))),d1e(r),ie.warn("Graph after XAX:",JSON.stringify(Us(r)));const i=we();await rz(n,r,t.type,t.diagramId,void 0,i)},"render");const g1e=Object.freeze(Object.defineProperty({__proto__:null,render:p1e},Symbol.toStringTag,{value:"Module"}));function nw(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function m1e(t){if(Array.isArray(t))return t}function v1e(t){if(Array.isArray(t))return nw(t)}function ac(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function y1e(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,iz(n.key),n)}}function sc(t,e,r){return e&&y1e(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function la(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=zE(t))||e){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a,s=!0,o=!1;return{s:function(){r=r.call(t)},n:function(){var l=r.next();return s=l.done,l},e:function(l){o=!0,a=l},f:function(){try{s||r.return==null||r.return()}finally{if(o)throw a}}}}function nz(t,e,r){return(e=iz(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function x1e(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function b1e(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,a,s,o=[],l=!0,u=!1;try{if(a=(r=r.call(t)).next,e===0){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(o.push(n.value),o.length!==e);l=!0);}catch(h){u=!0,i=h}finally{try{if(!l&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(u)throw i}}return o}}function w1e(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function T1e(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Tn(t,e){return m1e(t)||b1e(t,e)||zE(t,e)||w1e()}function Nv(t){return v1e(t)||x1e(t)||zE(t)||T1e()}function E1e(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function iz(t){var e=E1e(t,"string");return typeof e=="symbol"?e:e+""}function $n(t){"@babel/helpers - typeof";return $n=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},$n(t)}function zE(t,e){if(t){if(typeof t=="string")return nw(t,e);var r={}.toString.call(t).slice(8,-1);return r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set"?Array.from(t):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?nw(t,e):void 0}}var Dn=typeof window>"u"?null:window,I8=Dn?Dn.navigator:null;Dn&&Dn.document;var k1e=$n(""),az=$n({}),S1e=$n(function(){}),C1e=typeof HTMLElement>"u"?"undefined":$n(HTMLElement),jp=function(e){return e&&e.instanceString&&nn(e.instanceString)?e.instanceString():null},Bt=function(e){return e!=null&&$n(e)==k1e},nn=function(e){return e!=null&&$n(e)===S1e},Br=function(e){return!Aa(e)&&(Array.isArray?Array.isArray(e):e!=null&&e instanceof Array)},vr=function(e){return e!=null&&$n(e)===az&&!Br(e)&&e.constructor===Object},A1e=function(e){return e!=null&&$n(e)===az},vt=function(e){return e!=null&&$n(e)===$n(1)&&!isNaN(e)},_1e=function(e){return vt(e)&&Math.floor(e)===e},Dv=function(e){if(C1e!=="undefined")return e!=null&&e instanceof HTMLElement},Aa=function(e){return Kp(e)||sz(e)},Kp=function(e){return jp(e)==="collection"&&e._private.single},sz=function(e){return jp(e)==="collection"&&!e._private.single},VE=function(e){return jp(e)==="core"},oz=function(e){return jp(e)==="stylesheet"},L1e=function(e){return jp(e)==="event"},Vl=function(e){return e==null?!0:!!(e===""||e.match(/^\s+$/))},R1e=function(e){return typeof HTMLElement>"u"?!1:e instanceof HTMLElement},N1e=function(e){return vr(e)&&vt(e.x1)&&vt(e.x2)&&vt(e.y1)&&vt(e.y2)},D1e=function(e){return A1e(e)&&nn(e.then)},M1e=function(){return I8&&I8.userAgent.match(/msie|trident|edge/i)},ad=function(e,r){r||(r=function(){if(arguments.length===1)return arguments[0];if(arguments.length===0)return"undefined";for(var a=[],s=0;s<arguments.length;s++)a.push(arguments[s]);return a.join("$")});var n=function(){var a=this,s=arguments,o,l=r.apply(a,s),u=n.cache;return(o=u[l])||(o=u[l]=e.apply(a,s)),o};return n.cache={},n},GE=ad(function(t){return t.replace(/([A-Z])/g,function(e){return"-"+e.toLowerCase()})}),A2=ad(function(t){return t.replace(/(-\w)/g,function(e){return e[1].toUpperCase()})}),lz=ad(function(t,e){return t+e[0].toUpperCase()+e.substring(1)},function(t,e){return t+"$"+e}),O8=function(e){return Vl(e)?e:e.charAt(0).toUpperCase()+e.substring(1)},Tl=function(e,r){return e.slice(-1*r.length)===r},Pn="(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))",I1e="rgb[a]?\\(("+Pn+"[%]?)\\s*,\\s*("+Pn+"[%]?)\\s*,\\s*("+Pn+"[%]?)(?:\\s*,\\s*("+Pn+"))?\\)",O1e="rgb[a]?\\((?:"+Pn+"[%]?)\\s*,\\s*(?:"+Pn+"[%]?)\\s*,\\s*(?:"+Pn+"[%]?)(?:\\s*,\\s*(?:"+Pn+"))?\\)",P1e="hsl[a]?\\(("+Pn+")\\s*,\\s*("+Pn+"[%])\\s*,\\s*("+Pn+"[%])(?:\\s*,\\s*("+Pn+"))?\\)",B1e="hsl[a]?\\((?:"+Pn+")\\s*,\\s*(?:"+Pn+"[%])\\s*,\\s*(?:"+Pn+"[%])(?:\\s*,\\s*(?:"+Pn+"))?\\)",F1e="\\#[0-9a-fA-F]{3}",$1e="\\#[0-9a-fA-F]{6}",cz=function(e,r){return e<r?-1:e>r?1:0},z1e=function(e,r){return-1*cz(e,r)},Gt=Object.assign!=null?Object.assign.bind(Object):function(t){for(var e=arguments,r=1;r<e.length;r++){var n=e[r];if(n!=null)for(var i=Object.keys(n),a=0;a<i.length;a++){var s=i[a];t[s]=n[s]}}return t},V1e=function(e){if(!(!(e.length===4||e.length===7)||e[0]!=="#")){var r=e.length===4,n,i,a,s=16;return r?(n=parseInt(e[1]+e[1],s),i=parseInt(e[2]+e[2],s),a=parseInt(e[3]+e[3],s)):(n=parseInt(e[1]+e[2],s),i=parseInt(e[3]+e[4],s),a=parseInt(e[5]+e[6],s)),[n,i,a]}},G1e=function(e){var r,n,i,a,s,o,l,u;function h(g,m,v){return v<0&&(v+=1),v>1&&(v-=1),v<1/6?g+(m-g)*6*v:v<1/2?m:v<2/3?g+(m-g)*(2/3-v)*6:g}var d=new RegExp("^"+P1e+"$").exec(e);if(d){if(n=parseInt(d[1]),n<0?n=(360- -1*n%360)%360:n>360&&(n=n%360),n/=360,i=parseFloat(d[2]),i<0||i>100||(i=i/100,a=parseFloat(d[3]),a<0||a>100)||(a=a/100,s=d[4],s!==void 0&&(s=parseFloat(s),s<0||s>1)))return;if(i===0)o=l=u=Math.round(a*255);else{var f=a<.5?a*(1+i):a+i-a*i,p=2*a-f;o=Math.round(255*h(p,f,n+1/3)),l=Math.round(255*h(p,f,n)),u=Math.round(255*h(p,f,n-1/3))}r=[o,l,u,s]}return r},U1e=function(e){var r,n=new RegExp("^"+I1e+"$").exec(e);if(n){r=[];for(var i=[],a=1;a<=3;a++){var s=n[a];if(s[s.length-1]==="%"&&(i[a]=!0),s=parseFloat(s),i[a]&&(s=s/100*255),s<0||s>255)return;r.push(Math.floor(s))}var o=i[1]||i[2]||i[3],l=i[1]&&i[2]&&i[3];if(o&&!l)return;var u=n[4];if(u!==void 0){if(u=parseFloat(u),u<0||u>1)return;r.push(u)}}return r},W1e=function(e){return H1e[e.toLowerCase()]},uz=function(e){return(Br(e)?e:null)||W1e(e)||V1e(e)||U1e(e)||G1e(e)},H1e={transparent:[0,0,0,0],aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],grey:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},hz=function(e){for(var r=e.map,n=e.keys,i=n.length,a=0;a<i;a++){var s=n[a];if(vr(s))throw Error("Tried to set map with object key");a<n.length-1?(r[s]==null&&(r[s]={}),r=r[s]):r[s]=e.value}},dz=function(e){for(var r=e.map,n=e.keys,i=n.length,a=0;a<i;a++){var s=n[a];if(vr(s))throw Error("Tried to get map with object key");if(r=r[s],r==null)return r}return r},Xg=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Zp(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var kb,P8;function Qp(){if(P8)return kb;P8=1;function t(e){var r=typeof e;return e!=null&&(r=="object"||r=="function")}return kb=t,kb}var Sb,B8;function q1e(){if(B8)return Sb;B8=1;var t=typeof Xg=="object"&&Xg&&Xg.Object===Object&&Xg;return Sb=t,Sb}var Cb,F8;function _2(){if(F8)return Cb;F8=1;var t=q1e(),e=typeof self=="object"&&self&&self.Object===Object&&self,r=t||e||Function("return this")();return Cb=r,Cb}var Ab,$8;function Y1e(){if($8)return Ab;$8=1;var t=_2(),e=function(){return t.Date.now()};return Ab=e,Ab}var _b,z8;function X1e(){if(z8)return _b;z8=1;var t=/\s/;function e(r){for(var n=r.length;n--&&t.test(r.charAt(n)););return n}return _b=e,_b}var Lb,V8;function j1e(){if(V8)return Lb;V8=1;var t=X1e(),e=/^\s+/;function r(n){return n&&n.slice(0,t(n)+1).replace(e,"")}return Lb=r,Lb}var Rb,G8;function UE(){if(G8)return Rb;G8=1;var t=_2(),e=t.Symbol;return Rb=e,Rb}var Nb,U8;function K1e(){if(U8)return Nb;U8=1;var t=UE(),e=Object.prototype,r=e.hasOwnProperty,n=e.toString,i=t?t.toStringTag:void 0;function a(s){var o=r.call(s,i),l=s[i];try{s[i]=void 0;var u=!0}catch{}var h=n.call(s);return u&&(o?s[i]=l:delete s[i]),h}return Nb=a,Nb}var Db,W8;function Z1e(){if(W8)return Db;W8=1;var t=Object.prototype,e=t.toString;function r(n){return e.call(n)}return Db=r,Db}var Mb,H8;function fz(){if(H8)return Mb;H8=1;var t=UE(),e=K1e(),r=Z1e(),n="[object Null]",i="[object Undefined]",a=t?t.toStringTag:void 0;function s(o){return o==null?o===void 0?i:n:a&&a in Object(o)?e(o):r(o)}return Mb=s,Mb}var Ib,q8;function Q1e(){if(q8)return Ib;q8=1;function t(e){return e!=null&&typeof e=="object"}return Ib=t,Ib}var Ob,Y8;function Jp(){if(Y8)return Ob;Y8=1;var t=fz(),e=Q1e(),r="[object Symbol]";function n(i){return typeof i=="symbol"||e(i)&&t(i)==r}return Ob=n,Ob}var Pb,X8;function J1e(){if(X8)return Pb;X8=1;var t=j1e(),e=Qp(),r=Jp(),n=NaN,i=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,s=/^0o[0-7]+$/i,o=parseInt;function l(u){if(typeof u=="number")return u;if(r(u))return n;if(e(u)){var h=typeof u.valueOf=="function"?u.valueOf():u;u=e(h)?h+"":h}if(typeof u!="string")return u===0?u:+u;u=t(u);var d=a.test(u);return d||s.test(u)?o(u.slice(2),d?2:8):i.test(u)?n:+u}return Pb=l,Pb}var Bb,j8;function eme(){if(j8)return Bb;j8=1;var t=Qp(),e=Y1e(),r=J1e(),n="Expected a function",i=Math.max,a=Math.min;function s(o,l,u){var h,d,f,p,g,m,v=0,y=!1,b=!1,w=!0;if(typeof o!="function")throw new TypeError(n);l=r(l)||0,t(u)&&(y=!!u.leading,b="maxWait"in u,f=b?i(r(u.maxWait)||0,l):f,w="trailing"in u?!!u.trailing:w);function T(P){var k=h,R=d;return h=d=void 0,v=P,p=o.apply(R,k),p}function E(P){return v=P,g=setTimeout(C,l),y?T(P):p}function L(P){var k=P-m,R=P-v,I=l-k;return b?a(I,f-R):I}function S(P){var k=P-m,R=P-v;return m===void 0||k>=l||k<0||b&&R>=f}function C(){var P=e();if(S(P))return A(P);g=setTimeout(C,L(P))}function A(P){return g=void 0,w&&h?T(P):(h=d=void 0,p)}function N(){g!==void 0&&clearTimeout(g),v=0,h=m=d=g=void 0}function _(){return g===void 0?p:A(e())}function O(){var P=e(),k=S(P);if(h=arguments,d=this,m=P,k){if(g===void 0)return E(m);if(b)return clearTimeout(g),g=setTimeout(C,l),T(m)}return g===void 0&&(g=setTimeout(C,l)),p}return O.cancel=N,O.flush=_,O}return Bb=s,Bb}var tme=eme(),eg=Zp(tme),Fb=Dn?Dn.performance:null,pz=Fb&&Fb.now?function(){return Fb.now()}:function(){return Date.now()},rme=function(){if(Dn){if(Dn.requestAnimationFrame)return function(t){Dn.requestAnimationFrame(t)};if(Dn.mozRequestAnimationFrame)return function(t){Dn.mozRequestAnimationFrame(t)};if(Dn.webkitRequestAnimationFrame)return function(t){Dn.webkitRequestAnimationFrame(t)};if(Dn.msRequestAnimationFrame)return function(t){Dn.msRequestAnimationFrame(t)}}return function(t){t&&setTimeout(function(){t(pz())},1e3/60)}}(),Mv=function(e){return rme(e)},Zo=pz,Pc=9261,gz=65599,uh=5381,mz=function(e){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Pc,n=r,i;i=e.next(),!i.done;)n=n*gz+i.value|0;return n},np=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Pc;return r*gz+e|0},ip=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:uh;return(r<<5)+r+e|0},nme=function(e,r){return e*2097152+r},hl=function(e){return e[0]*2097152+e[1]},jg=function(e,r){return[np(e[0],r[0]),ip(e[1],r[1])]},K8=function(e,r){var n={value:0,done:!1},i=0,a=e.length,s={next:function(){return i<a?n.value=e[i++]:n.done=!0,n}};return mz(s,r)},du=function(e,r){var n={value:0,done:!1},i=0,a=e.length,s={next:function(){return i<a?n.value=e.charCodeAt(i++):n.done=!0,n}};return mz(s,r)},vz=function(){return ime(arguments)},ime=function(e){for(var r,n=0;n<e.length;n++){var i=e[n];n===0?r=du(i):r=du(i,r)}return r};function ame(t,e,r,n,i){var a=i*Math.PI/180,s=Math.cos(a)*(t-r)-Math.sin(a)*(e-n)+r,o=Math.sin(a)*(t-r)+Math.cos(a)*(e-n)+n;return{x:s,y:o}}var sme=function(e,r,n,i,a,s){return{x:(e-n)*a+n,y:(r-i)*s+i}};function ome(t,e,r){if(r===0)return t;var n=(e.x1+e.x2)/2,i=(e.y1+e.y2)/2,a=e.w/e.h,s=1/a,o=ame(t.x,t.y,n,i,r),l=sme(o.x,o.y,n,i,a,s);return{x:l.x,y:l.y}}var Z8=!0,lme=console.warn!=null,cme=console.trace!=null,WE=Number.MAX_SAFE_INTEGER||9007199254740991,yz=function(){return!0},Iv=function(){return!1},Q8=function(){return 0},HE=function(){},Kr=function(e){throw new Error(e)},xz=function(e){if(e!==void 0)Z8=!!e;else return Z8},Nr=function(e){xz()&&(lme?console.warn(e):(console.log(e),cme&&console.trace()))},ume=function(e){return Gt({},e)},Ws=function(e){return e==null?e:Br(e)?e.slice():vr(e)?ume(e):e},hme=function(e){return e.slice()},bz=function(e,r){for(r=e="";e++<36;r+=e*51&52?(e^15?8^Math.random()*(e^20?16:4):4).toString(16):"-");return r},dme={},wz=function(){return dme},hi=function(e){var r=Object.keys(e);return function(n){for(var i={},a=0;a<r.length;a++){var s=r[a],o=n?.[s];i[s]=o===void 0?e[s]:o}return i}},Gl=function(e,r,n){for(var i=e.length-1;i>=0;i--)e[i]===r&&e.splice(i,1)},qE=function(e){e.splice(0,e.length)},fme=function(e,r){for(var n=0;n<r.length;n++){var i=r[n];e.push(i)}},ia=function(e,r,n){return n&&(r=lz(n,r)),e[r]},Co=function(e,r,n,i){n&&(r=lz(n,r)),e[r]=i},pme=function(){function t(){ac(this,t),this._obj={}}return sc(t,[{key:"set",value:function(r,n){return this._obj[r]=n,this}},{key:"delete",value:function(r){return this._obj[r]=void 0,this}},{key:"clear",value:function(){this._obj={}}},{key:"has",value:function(r){return this._obj[r]!==void 0}},{key:"get",value:function(r){return this._obj[r]}}])}(),Mo=typeof Map<"u"?Map:pme,gme="undefined",mme=function(){function t(e){if(ac(this,t),this._obj=Object.create(null),this.size=0,e!=null){var r;e.instanceString!=null&&e.instanceString()===this.instanceString()?r=e.toArray():r=e;for(var n=0;n<r.length;n++)this.add(r[n])}}return sc(t,[{key:"instanceString",value:function(){return"set"}},{key:"add",value:function(r){var n=this._obj;n[r]!==1&&(n[r]=1,this.size++)}},{key:"delete",value:function(r){var n=this._obj;n[r]===1&&(n[r]=0,this.size--)}},{key:"clear",value:function(){this._obj=Object.create(null)}},{key:"has",value:function(r){return this._obj[r]===1}},{key:"toArray",value:function(){var r=this;return Object.keys(this._obj).filter(function(n){return r.has(n)})}},{key:"forEach",value:function(r,n){return this.toArray().forEach(r,n)}}])}(),Rd=(typeof Set>"u"?"undefined":$n(Set))!==gme?Set:mme,L2=function(e,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(e===void 0||r===void 0||!VE(e)){Kr("An element must have a core reference and parameters set");return}var i=r.group;if(i==null&&(r.data&&r.data.source!=null&&r.data.target!=null?i="edges":i="nodes"),i!=="nodes"&&i!=="edges"){Kr("An element must be of type `nodes` or `edges`; you specified `"+i+"`");return}this.length=1,this[0]=this;var a=this._private={cy:e,single:!0,data:r.data||{},position:r.position||{x:0,y:0},autoWidth:void 0,autoHeight:void 0,autoPadding:void 0,compoundBoundsClean:!1,listeners:[],group:i,style:{},rstyle:{},styleCxts:[],styleKeys:{},removed:!0,selected:!!r.selected,selectable:r.selectable===void 0?!0:!!r.selectable,locked:!!r.locked,grabbed:!1,grabbable:r.grabbable===void 0?!0:!!r.grabbable,pannable:r.pannable===void 0?i==="edges":!!r.pannable,active:!1,classes:new Rd,animation:{current:[],queue:[]},rscratch:{},scratch:r.scratch||{},edges:[],children:[],parent:r.parent&&r.parent.isNode()?r.parent:null,traversalCache:{},backgrounding:!1,bbCache:null,bbCacheShift:{x:0,y:0},bodyBounds:null,overlayBounds:null,labelBounds:{all:null,source:null,target:null,main:null},arrowBounds:{source:null,target:null,"mid-source":null,"mid-target":null}};if(a.position.x==null&&(a.position.x=0),a.position.y==null&&(a.position.y=0),r.renderedPosition){var s=r.renderedPosition,o=e.pan(),l=e.zoom();a.position={x:(s.x-o.x)/l,y:(s.y-o.y)/l}}var u=[];Br(r.classes)?u=r.classes:Bt(r.classes)&&(u=r.classes.split(/\s+/));for(var h=0,d=u.length;h<d;h++){var f=u[h];!f||f===""||a.classes.add(f)}this.createEmitter(),(n===void 0||n)&&this.restore();var p=r.style||r.css;p&&(Nr("Setting a `style` bypass at element creation should be done only when absolutely necessary.  Try to use the stylesheet instead."),this.style(p))},J8=function(e){return e={bfs:e.bfs||!e.dfs,dfs:e.dfs||!e.bfs},function(n,i,a){var s;vr(n)&&!Aa(n)&&(s=n,n=s.roots||s.root,i=s.visit,a=s.directed),a=arguments.length===2&&!nn(i)?i:a,i=nn(i)?i:function(){};for(var o=this._private.cy,l=n=Bt(n)?this.filter(n):n,u=[],h=[],d={},f={},p={},g=0,m,v=this.byGroup(),y=v.nodes,b=v.edges,w=0;w<l.length;w++){var T=l[w],E=T.id();T.isNode()&&(u.unshift(T),e.bfs&&(p[E]=!0,h.push(T)),f[E]=0)}for(var L=function(){var P=e.bfs?u.shift():u.pop(),k=P.id();if(e.dfs){if(p[k])return 0;p[k]=!0,h.push(P)}var R=f[k],I=d[k],M=I!=null?I.source():null,D=I!=null?I.target():null,B=I==null?void 0:P.same(M)?D[0]:M[0],$;if($=i(P,I,B,g++,R),$===!0)return m=P,1;if($===!1)return 1;for(var F=P.connectedEdges().filter(function(ne){return(!a||ne.source().same(P))&&b.has(ne)}),G=0;G<F.length;G++){var W=F[G],J=W.connectedNodes().filter(function(ne){return!ne.same(P)&&y.has(ne)}),q=J.id();J.length!==0&&!p[q]&&(J=J[0],u.push(J),e.bfs&&(p[q]=!0,h.push(J)),d[q]=W,f[q]=f[k]+1)}},S;u.length!==0&&(S=L(),!(S!==0&&S===1)););for(var C=o.collection(),A=0;A<h.length;A++){var N=h[A],_=d[N.id()];_!=null&&C.push(_),C.push(N)}return{path:o.collection(C),found:o.collection(m)}}},ap={breadthFirstSearch:J8({bfs:!0}),depthFirstSearch:J8({dfs:!0})};ap.bfs=ap.breadthFirstSearch;ap.dfs=ap.depthFirstSearch;var J1={exports:{}},vme=J1.exports,eA;function yme(){return eA||(eA=1,function(t,e){(function(){var r,n,i,a,s,o,l,u,h,d,f,p,g,m,v;i=Math.floor,d=Math.min,n=function(y,b){return y<b?-1:y>b?1:0},h=function(y,b,w,T,E){var L;if(w==null&&(w=0),E==null&&(E=n),w<0)throw new Error("lo must be non-negative");for(T==null&&(T=y.length);w<T;)L=i((w+T)/2),E(b,y[L])<0?T=L:w=L+1;return[].splice.apply(y,[w,w-w].concat(b)),b},o=function(y,b,w){return w==null&&(w=n),y.push(b),m(y,0,y.length-1,w)},s=function(y,b){var w,T;return b==null&&(b=n),w=y.pop(),y.length?(T=y[0],y[0]=w,v(y,0,b)):T=w,T},u=function(y,b,w){var T;return w==null&&(w=n),T=y[0],y[0]=b,v(y,0,w),T},l=function(y,b,w){var T;return w==null&&(w=n),y.length&&w(y[0],b)<0&&(T=[y[0],b],b=T[0],y[0]=T[1],v(y,0,w)),b},a=function(y,b){var w,T,E,L,S,C;for(b==null&&(b=n),L=function(){C=[];for(var A=0,N=i(y.length/2);0<=N?A<N:A>N;0<=N?A++:A--)C.push(A);return C}.apply(this).reverse(),S=[],T=0,E=L.length;T<E;T++)w=L[T],S.push(v(y,w,b));return S},g=function(y,b,w){var T;if(w==null&&(w=n),T=y.indexOf(b),T!==-1)return m(y,0,T,w),v(y,T,w)},f=function(y,b,w){var T,E,L,S,C;if(w==null&&(w=n),E=y.slice(0,b),!E.length)return E;for(a(E,w),C=y.slice(b),L=0,S=C.length;L<S;L++)T=C[L],l(E,T,w);return E.sort(w).reverse()},p=function(y,b,w){var T,E,L,S,C,A,N,_,O;if(w==null&&(w=n),b*10<=y.length){if(L=y.slice(0,b).sort(w),!L.length)return L;for(E=L[L.length-1],N=y.slice(b),S=0,A=N.length;S<A;S++)T=N[S],w(T,E)<0&&(h(L,T,0,null,w),L.pop(),E=L[L.length-1]);return L}for(a(y,w),O=[],C=0,_=d(b,y.length);0<=_?C<_:C>_;0<=_?++C:--C)O.push(s(y,w));return O},m=function(y,b,w,T){var E,L,S;for(T==null&&(T=n),E=y[w];w>b;){if(S=w-1>>1,L=y[S],T(E,L)<0){y[w]=L,w=S;continue}break}return y[w]=E},v=function(y,b,w){var T,E,L,S,C;for(w==null&&(w=n),E=y.length,C=b,L=y[b],T=2*b+1;T<E;)S=T+1,S<E&&!(w(y[T],y[S])<0)&&(T=S),y[b]=y[T],b=T,T=2*b+1;return y[b]=L,m(y,C,b,w)},r=function(){y.push=o,y.pop=s,y.replace=u,y.pushpop=l,y.heapify=a,y.updateItem=g,y.nlargest=f,y.nsmallest=p;function y(b){this.cmp=b??n,this.nodes=[]}return y.prototype.push=function(b){return o(this.nodes,b,this.cmp)},y.prototype.pop=function(){return s(this.nodes,this.cmp)},y.prototype.peek=function(){return this.nodes[0]},y.prototype.contains=function(b){return this.nodes.indexOf(b)!==-1},y.prototype.replace=function(b){return u(this.nodes,b,this.cmp)},y.prototype.pushpop=function(b){return l(this.nodes,b,this.cmp)},y.prototype.heapify=function(){return a(this.nodes,this.cmp)},y.prototype.updateItem=function(b){return g(this.nodes,b,this.cmp)},y.prototype.clear=function(){return this.nodes=[]},y.prototype.empty=function(){return this.nodes.length===0},y.prototype.size=function(){return this.nodes.length},y.prototype.clone=function(){var b;return b=new y,b.nodes=this.nodes.slice(0),b},y.prototype.toArray=function(){return this.nodes.slice(0)},y.prototype.insert=y.prototype.push,y.prototype.top=y.prototype.peek,y.prototype.front=y.prototype.peek,y.prototype.has=y.prototype.contains,y.prototype.copy=y.prototype.clone,y}(),function(y,b){return t.exports=b()}(this,function(){return r})}).call(vme)}(J1)),J1.exports}var $b,tA;function xme(){return tA||(tA=1,$b=yme()),$b}var bme=xme(),tg=Zp(bme),wme=hi({root:null,weight:function(e){return 1},directed:!1}),Tme={dijkstra:function(e){if(!vr(e)){var r=arguments;e={root:r[0],weight:r[1],directed:r[2]}}var n=wme(e),i=n.root,a=n.weight,s=n.directed,o=this,l=a,u=Bt(i)?this.filter(i)[0]:i[0],h={},d={},f={},p=this.byGroup(),g=p.nodes,m=p.edges;m.unmergeBy(function(R){return R.isLoop()});for(var v=function(I){return h[I.id()]},y=function(I,M){h[I.id()]=M,b.updateItem(I)},b=new tg(function(R,I){return v(R)-v(I)}),w=0;w<g.length;w++){var T=g[w];h[T.id()]=T.same(u)?0:1/0,b.push(T)}for(var E=function(I,M){for(var D=(s?I.edgesTo(M):I.edgesWith(M)).intersect(m),B=1/0,$,F=0;F<D.length;F++){var G=D[F],W=l(G);(W<B||!$)&&(B=W,$=G)}return{edge:$,dist:B}};b.size()>0;){var L=b.pop(),S=v(L),C=L.id();if(f[C]=S,S!==1/0)for(var A=L.neighborhood().intersect(g),N=0;N<A.length;N++){var _=A[N],O=_.id(),P=E(L,_),k=S+P.dist;k<v(_)&&(y(_,k),d[O]={node:L,edge:P.edge})}}return{distanceTo:function(I){var M=Bt(I)?g.filter(I)[0]:I[0];return f[M.id()]},pathTo:function(I){var M=Bt(I)?g.filter(I)[0]:I[0],D=[],B=M,$=B.id();if(M.length>0)for(D.unshift(M);d[$];){var F=d[$];D.unshift(F.edge),D.unshift(F.node),B=F.node,$=B.id()}return o.spawn(D)}}}},Eme={kruskal:function(e){e=e||function(w){return 1};for(var r=this.byGroup(),n=r.nodes,i=r.edges,a=n.length,s=new Array(a),o=n,l=function(T){for(var E=0;E<s.length;E++){var L=s[E];if(L.has(T))return E}},u=0;u<a;u++)s[u]=this.spawn(n[u]);for(var h=i.sort(function(w,T){return e(w)-e(T)}),d=0;d<h.length;d++){var f=h[d],p=f.source()[0],g=f.target()[0],m=l(p),v=l(g),y=s[m],b=s[v];m!==v&&(o.merge(f),y.merge(b),s.splice(v,1))}return o}},kme=hi({root:null,goal:null,weight:function(e){return 1},heuristic:function(e){return 0},directed:!1}),Sme={aStar:function(e){var r=this.cy(),n=kme(e),i=n.root,a=n.goal,s=n.heuristic,o=n.directed,l=n.weight;i=r.collection(i)[0],a=r.collection(a)[0];var u=i.id(),h=a.id(),d={},f={},p={},g=new tg(function($,F){return f[$.id()]-f[F.id()]}),m=new Rd,v={},y={},b=function(F,G){g.push(F),m.add(G)},w,T,E=function(){w=g.pop(),T=w.id(),m.delete(T)},L=function(F){return m.has(F)};b(i,u),d[u]=0,f[u]=s(i);for(var S=0;g.size()>0;){if(E(),S++,T===h){for(var C=[],A=a,N=h,_=y[N];C.unshift(A),_!=null&&C.unshift(_),A=v[N],A!=null;)N=A.id(),_=y[N];return{found:!0,distance:d[T],path:this.spawn(C),steps:S}}p[T]=!0;for(var O=w._private.edges,P=0;P<O.length;P++){var k=O[P];if(this.hasElementWithId(k.id())&&!(o&&k.data("source")!==T)){var R=k.source(),I=k.target(),M=R.id()!==T?R:I,D=M.id();if(this.hasElementWithId(D)&&!p[D]){var B=d[T]+l(k);if(!L(D)){d[D]=B,f[D]=B+s(M),b(M,D),v[D]=w,y[D]=k;continue}B<d[D]&&(d[D]=B,f[D]=B+s(M),v[D]=w,y[D]=k)}}}}return{found:!1,distance:void 0,path:void 0,steps:S}}},Cme=hi({weight:function(e){return 1},directed:!1}),Ame={floydWarshall:function(e){for(var r=this.cy(),n=Cme(e),i=n.weight,a=n.directed,s=i,o=this.byGroup(),l=o.nodes,u=o.edges,h=l.length,d=h*h,f=function(W){return l.indexOf(W)},p=function(W){return l[W]},g=new Array(d),m=0;m<d;m++){var v=m%h,y=(m-v)/h;y===v?g[m]=0:g[m]=1/0}for(var b=new Array(d),w=new Array(d),T=0;T<u.length;T++){var E=u[T],L=E.source()[0],S=E.target()[0];if(L!==S){var C=f(L),A=f(S),N=C*h+A,_=s(E);if(g[N]>_&&(g[N]=_,b[N]=A,w[N]=E),!a){var O=A*h+C;!a&&g[O]>_&&(g[O]=_,b[O]=C,w[O]=E)}}}for(var P=0;P<h;P++)for(var k=0;k<h;k++)for(var R=k*h+P,I=0;I<h;I++){var M=k*h+I,D=P*h+I;g[R]+g[D]<g[M]&&(g[M]=g[R]+g[D],b[M]=b[R])}var B=function(W){return(Bt(W)?r.filter(W):W)[0]},$=function(W){return f(B(W))},F={distance:function(W,J){var q=$(W),ne=$(J);return g[q*h+ne]},path:function(W,J){var q=$(W),ne=$(J),ae=p(q);if(q===ne)return ae.collection();if(b[q*h+ne]==null)return r.collection();var pe=r.collection(),K=q,Z;for(pe.merge(ae);q!==ne;)K=q,q=b[q*h+ne],Z=w[K*h+q],pe.merge(Z),pe.merge(p(q));return pe}};return F}},_me=hi({weight:function(e){return 1},directed:!1,root:null}),Lme={bellmanFord:function(e){var r=this,n=_me(e),i=n.weight,a=n.directed,s=n.root,o=i,l=this,u=this.cy(),h=this.byGroup(),d=h.edges,f=h.nodes,p=f.length,g=new Mo,m=!1,v=[];s=u.collection(s)[0],d.unmergeBy(function(Ae){return Ae.isLoop()});for(var y=d.length,b=function(H){var Oe=g.get(H.id());return Oe||(Oe={},g.set(H.id(),Oe)),Oe},w=function(H){return(Bt(H)?u.$(H):H)[0]},T=function(H){return b(w(H)).dist},E=function(H){for(var Oe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:s,ue=w(H),Ve=[],Ge=ue;;){if(Ge==null)return r.spawn();var Ue=b(Ge),ke=Ue.edge,Pe=Ue.pred;if(Ve.unshift(Ge[0]),Ge.same(Oe)&&Ve.length>0)break;ke!=null&&Ve.unshift(ke),Ge=Pe}return l.spawn(Ve)},L=0;L<p;L++){var S=f[L],C=b(S);S.same(s)?C.dist=0:C.dist=1/0,C.pred=null,C.edge=null}for(var A=!1,N=function(H,Oe,ue,Ve,Ge,Ue){var ke=Ve.dist+Ue;ke<Ge.dist&&!ue.same(Ve.edge)&&(Ge.dist=ke,Ge.pred=H,Ge.edge=ue,A=!0)},_=1;_<p;_++){A=!1;for(var O=0;O<y;O++){var P=d[O],k=P.source(),R=P.target(),I=o(P),M=b(k),D=b(R);N(k,R,P,M,D,I),a||N(R,k,P,D,M,I)}if(!A)break}if(A)for(var B=[],$=0;$<y;$++){var F=d[$],G=F.source(),W=F.target(),J=o(F),q=b(G).dist,ne=b(W).dist;if(q+J<ne||!a&&ne+J<q)if(m||(Nr("Graph contains a negative weight cycle for Bellman-Ford"),m=!0),e.findNegativeWeightCycles!==!1){var ae=[];q+J<ne&&ae.push(G),!a&&ne+J<q&&ae.push(W);for(var pe=ae.length,K=0;K<pe;K++){var Z=ae[K],X=[Z];X.push(b(Z).edge);for(var Y=b(Z).pred;X.indexOf(Y)===-1;)X.push(Y),X.push(b(Y).edge),Y=b(Y).pred;X=X.slice(X.indexOf(Y));for(var ee=X[0].id(),j=0,fe=2;fe<X.length;fe+=2)X[fe].id()<ee&&(ee=X[fe].id(),j=fe);X=X.slice(j).concat(X.slice(0,j)),X.push(X[0]);var te=X.map(function(Ae){return Ae.id()}).join(",");B.indexOf(te)===-1&&(v.push(l.spawn(X)),B.push(te))}}else break}return{distanceTo:T,pathTo:E,hasNegativeWeightCycle:m,negativeWeightCycles:v}}},Rme=Math.sqrt(2),Nme=function(e,r,n){n.length===0&&Kr("Karger-Stein must be run on a connected (sub)graph");for(var i=n[e],a=i[1],s=i[2],o=r[a],l=r[s],u=n,h=u.length-1;h>=0;h--){var d=u[h],f=d[1],p=d[2];(r[f]===o&&r[p]===l||r[f]===l&&r[p]===o)&&u.splice(h,1)}for(var g=0;g<u.length;g++){var m=u[g];m[1]===l?(u[g]=m.slice(),u[g][1]=o):m[2]===l&&(u[g]=m.slice(),u[g][2]=o)}for(var v=0;v<r.length;v++)r[v]===l&&(r[v]=o);return u},zb=function(e,r,n,i){for(;n>i;){var a=Math.floor(Math.random()*r.length);r=Nme(a,e,r),n--}return r},Dme={kargerStein:function(){var e=this,r=this.byGroup(),n=r.nodes,i=r.edges;i.unmergeBy(function(D){return D.isLoop()});var a=n.length,s=i.length,o=Math.ceil(Math.pow(Math.log(a)/Math.LN2,2)),l=Math.floor(a/Rme);if(a<2){Kr("At least 2 nodes are required for Karger-Stein algorithm");return}for(var u=[],h=0;h<s;h++){var d=i[h];u.push([h,n.indexOf(d.source()),n.indexOf(d.target())])}for(var f=1/0,p=[],g=new Array(a),m=new Array(a),v=new Array(a),y=function(B,$){for(var F=0;F<a;F++)$[F]=B[F]},b=0;b<=o;b++){for(var w=0;w<a;w++)m[w]=w;var T=zb(m,u.slice(),a,l),E=T.slice();y(m,v);var L=zb(m,T,l,2),S=zb(v,E,l,2);L.length<=S.length&&L.length<f?(f=L.length,p=L,y(m,g)):S.length<=L.length&&S.length<f&&(f=S.length,p=S,y(v,g))}for(var C=this.spawn(p.map(function(D){return i[D[0]]})),A=this.spawn(),N=this.spawn(),_=g[0],O=0;O<g.length;O++){var P=g[O],k=n[O];P===_?A.merge(k):N.merge(k)}var R=function(B){var $=e.spawn();return B.forEach(function(F){$.merge(F),F.connectedEdges().forEach(function(G){e.contains(G)&&!C.contains(G)&&$.merge(G)})}),$},I=[R(A),R(N)],M={cut:C,components:I,partition1:A,partition2:N};return M}},Vb,Mme=function(e){return{x:e.x,y:e.y}},R2=function(e,r,n){return{x:e.x*r+n.x,y:e.y*r+n.y}},Tz=function(e,r,n){return{x:(e.x-n.x)/r,y:(e.y-n.y)/r}},xh=function(e){return{x:e[0],y:e[1]}},Ime=function(e){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,i=1/0,a=r;a<n;a++){var s=e[a];isFinite(s)&&(i=Math.min(s,i))}return i},Ome=function(e){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,i=-1/0,a=r;a<n;a++){var s=e[a];isFinite(s)&&(i=Math.max(s,i))}return i},Pme=function(e){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,i=0,a=0,s=r;s<n;s++){var o=e[s];isFinite(o)&&(i+=o,a++)}return i/a},Bme=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0;i?e=e.slice(r,n):(n<e.length&&e.splice(n,e.length-n),r>0&&e.splice(0,r));for(var o=0,l=e.length-1;l>=0;l--){var u=e[l];s?isFinite(u)||(e[l]=-1/0,o++):e.splice(l,1)}a&&e.sort(function(f,p){return f-p});var h=e.length,d=Math.floor(h/2);return h%2!==0?e[d+1+o]:(e[d-1+o]+e[d+o])/2},Fme=function(e){return Math.PI*e/180},Kg=function(e,r){return Math.atan2(r,e)-Math.PI/2},YE=Math.log2||function(t){return Math.log(t)/Math.log(2)},XE=function(e){return e>0?1:e<0?-1:0},fu=function(e,r){return Math.sqrt(Dc(e,r))},Dc=function(e,r){var n=r.x-e.x,i=r.y-e.y;return n*n+i*i},$me=function(e){for(var r=e.length,n=0,i=0;i<r;i++)n+=e[i];for(var a=0;a<r;a++)e[a]=e[a]/n;return e},qn=function(e,r,n,i){return(1-i)*(1-i)*e+2*(1-i)*i*r+i*i*n},Dh=function(e,r,n,i){return{x:qn(e.x,r.x,n.x,i),y:qn(e.y,r.y,n.y,i)}},zme=function(e,r,n,i){var a={x:r.x-e.x,y:r.y-e.y},s=fu(e,r),o={x:a.x/s,y:a.y/s};return n=n??0,i=i??n*s,{x:e.x+o.x*i,y:e.y+o.y*i}},sp=function(e,r,n){return Math.max(e,Math.min(n,r))},qi=function(e){if(e==null)return{x1:1/0,y1:1/0,x2:-1/0,y2:-1/0,w:0,h:0};if(e.x1!=null&&e.y1!=null){if(e.x2!=null&&e.y2!=null&&e.x2>=e.x1&&e.y2>=e.y1)return{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,w:e.x2-e.x1,h:e.y2-e.y1};if(e.w!=null&&e.h!=null&&e.w>=0&&e.h>=0)return{x1:e.x1,y1:e.y1,x2:e.x1+e.w,y2:e.y1+e.h,w:e.w,h:e.h}}},Vme=function(e){return{x1:e.x1,x2:e.x2,w:e.w,y1:e.y1,y2:e.y2,h:e.h}},Gme=function(e){e.x1=1/0,e.y1=1/0,e.x2=-1/0,e.y2=-1/0,e.w=0,e.h=0},Ume=function(e,r){e.x1=Math.min(e.x1,r.x1),e.x2=Math.max(e.x2,r.x2),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,r.y1),e.y2=Math.max(e.y2,r.y2),e.h=e.y2-e.y1},Ez=function(e,r,n){e.x1=Math.min(e.x1,r),e.x2=Math.max(e.x2,r),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,n),e.y2=Math.max(e.y2,n),e.h=e.y2-e.y1},em=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return e.x1-=r,e.x2+=r,e.y1-=r,e.y2+=r,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},tm=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0],n,i,a,s;if(r.length===1)n=i=a=s=r[0];else if(r.length===2)n=a=r[0],s=i=r[1];else if(r.length===4){var o=Tn(r,4);n=o[0],i=o[1],a=o[2],s=o[3]}return e.x1-=s,e.x2+=i,e.y1-=n,e.y2+=a,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},rA=function(e,r){e.x1=r.x1,e.y1=r.y1,e.x2=r.x2,e.y2=r.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1},jE=function(e,r){return!(e.x1>r.x2||r.x1>e.x2||e.x2<r.x1||r.x2<e.x1||e.y2<r.y1||r.y2<e.y1||e.y1>r.y2||r.y1>e.y2)},El=function(e,r,n){return e.x1<=r&&r<=e.x2&&e.y1<=n&&n<=e.y2},nA=function(e,r){return El(e,r.x,r.y)},kz=function(e,r){return El(e,r.x1,r.y1)&&El(e,r.x2,r.y2)},Wme=(Vb=Math.hypot)!==null&&Vb!==void 0?Vb:function(t,e){return Math.sqrt(t*t+e*e)};function Hme(t,e){if(t.length<3)throw new Error("Need at least 3 vertices");var r=function(C,A){return{x:C.x+A.x,y:C.y+A.y}},n=function(C,A){return{x:C.x-A.x,y:C.y-A.y}},i=function(C,A){return{x:C.x*A,y:C.y*A}},a=function(C,A){return C.x*A.y-C.y*A.x},s=function(C){var A=Wme(C.x,C.y);return A===0?{x:0,y:0}:{x:C.x/A,y:C.y/A}},o=function(C){for(var A=0,N=0;N<C.length;N++){var _=C[N],O=C[(N+1)%C.length];A+=_.x*O.y-O.x*_.y}return A/2},l=function(C,A,N,_){var O=n(A,C),P=n(_,N),k=a(O,P);if(Math.abs(k)<1e-9)return r(C,i(O,.5));var R=a(n(N,C),P)/k;return r(C,i(O,R))},u=t.map(function(S){return{x:S.x,y:S.y}});o(u)<0&&u.reverse();for(var h=u.length,d=[],f=0;f<h;f++){var p=u[f],g=u[(f+1)%h],m=n(g,p),v=s({x:m.y,y:-m.x});d.push(v)}for(var y=d.map(function(S,C){var A=r(u[C],i(S,e)),N=r(u[(C+1)%h],i(S,e));return{p1:A,p2:N}}),b=[],w=0;w<h;w++){var T=y[(w-1+h)%h],E=y[w],L=l(T.p1,T.p2,E.p1,E.p2);b.push(L)}return b}function qme(t,e,r,n,i,a){var s=tve(t,e,r,n,i),o=Hme(s,a),l=qi();return o.forEach(function(u){return Ez(l,u.x,u.y)}),l}var Sz=function(e,r,n,i,a,s,o){var l=arguments.length>7&&arguments[7]!==void 0?arguments[7]:"auto",u=l==="auto"?Ul(a,s):l,h=a/2,d=s/2;u=Math.min(u,h,d);var f=u!==h,p=u!==d,g;if(f){var m=n-h+u-o,v=i-d-o,y=n+h-u+o,b=v;if(g=kl(e,r,n,i,m,v,y,b,!1),g.length>0)return g}if(p){var w=n+h+o,T=i-d+u-o,E=w,L=i+d-u+o;if(g=kl(e,r,n,i,w,T,E,L,!1),g.length>0)return g}if(f){var S=n-h+u-o,C=i+d+o,A=n+h-u+o,N=C;if(g=kl(e,r,n,i,S,C,A,N,!1),g.length>0)return g}if(p){var _=n-h-o,O=i-d+u-o,P=_,k=i+d-u+o;if(g=kl(e,r,n,i,_,O,P,k,!1),g.length>0)return g}var R;{var I=n-h+u,M=i-d+u;if(R=Af(e,r,n,i,I,M,u+o),R.length>0&&R[0]<=I&&R[1]<=M)return[R[0],R[1]]}{var D=n+h-u,B=i-d+u;if(R=Af(e,r,n,i,D,B,u+o),R.length>0&&R[0]>=D&&R[1]<=B)return[R[0],R[1]]}{var $=n+h-u,F=i+d-u;if(R=Af(e,r,n,i,$,F,u+o),R.length>0&&R[0]>=$&&R[1]>=F)return[R[0],R[1]]}{var G=n-h+u,W=i+d-u;if(R=Af(e,r,n,i,G,W,u+o),R.length>0&&R[0]<=G&&R[1]>=W)return[R[0],R[1]]}return[]},Yme=function(e,r,n,i,a,s,o){var l=o,u=Math.min(n,a),h=Math.max(n,a),d=Math.min(i,s),f=Math.max(i,s);return u-l<=e&&e<=h+l&&d-l<=r&&r<=f+l},Xme=function(e,r,n,i,a,s,o,l,u){var h={x1:Math.min(n,o,a)-u,x2:Math.max(n,o,a)+u,y1:Math.min(i,l,s)-u,y2:Math.max(i,l,s)+u};return!(e<h.x1||e>h.x2||r<h.y1||r>h.y2)},jme=function(e,r,n,i){n-=i;var a=r*r-4*e*n;if(a<0)return[];var s=Math.sqrt(a),o=2*e,l=(-r+s)/o,u=(-r-s)/o;return[l,u]},Kme=function(e,r,n,i,a){var s=1e-5;e===0&&(e=s),r/=e,n/=e,i/=e;var o,l,u,h,d,f,p,g;if(l=(3*n-r*r)/9,u=-(27*i)+r*(9*n-2*(r*r)),u/=54,o=l*l*l+u*u,a[1]=0,p=r/3,o>0){d=u+Math.sqrt(o),d=d<0?-Math.pow(-d,1/3):Math.pow(d,1/3),f=u-Math.sqrt(o),f=f<0?-Math.pow(-f,1/3):Math.pow(f,1/3),a[0]=-p+d+f,p+=(d+f)/2,a[4]=a[2]=-p,p=Math.sqrt(3)*(-f+d)/2,a[3]=p,a[5]=-p;return}if(a[5]=a[3]=0,o===0){g=u<0?-Math.pow(-u,1/3):Math.pow(u,1/3),a[0]=-p+2*g,a[4]=a[2]=-(g+p);return}l=-l,h=l*l*l,h=Math.acos(u/Math.sqrt(h)),g=2*Math.sqrt(l),a[0]=-p+g*Math.cos(h/3),a[2]=-p+g*Math.cos((h+2*Math.PI)/3),a[4]=-p+g*Math.cos((h+4*Math.PI)/3)},Zme=function(e,r,n,i,a,s,o,l){var u=1*n*n-4*n*a+2*n*o+4*a*a-4*a*o+o*o+i*i-4*i*s+2*i*l+4*s*s-4*s*l+l*l,h=1*9*n*a-3*n*n-3*n*o-6*a*a+3*a*o+9*i*s-3*i*i-3*i*l-6*s*s+3*s*l,d=1*3*n*n-6*n*a+n*o-n*e+2*a*a+2*a*e-o*e+3*i*i-6*i*s+i*l-i*r+2*s*s+2*s*r-l*r,f=1*n*a-n*n+n*e-a*e+i*s-i*i+i*r-s*r,p=[];Kme(u,h,d,f,p);for(var g=1e-7,m=[],v=0;v<6;v+=2)Math.abs(p[v+1])<g&&p[v]>=0&&p[v]<=1&&m.push(p[v]);m.push(1),m.push(0);for(var y=-1,b,w,T,E=0;E<m.length;E++)b=Math.pow(1-m[E],2)*n+2*(1-m[E])*m[E]*a+m[E]*m[E]*o,w=Math.pow(1-m[E],2)*i+2*(1-m[E])*m[E]*s+m[E]*m[E]*l,T=Math.pow(b-e,2)+Math.pow(w-r,2),y>=0?T<y&&(y=T):y=T;return y},Qme=function(e,r,n,i,a,s){var o=[e-n,r-i],l=[a-n,s-i],u=l[0]*l[0]+l[1]*l[1],h=o[0]*o[0]+o[1]*o[1],d=o[0]*l[0]+o[1]*l[1],f=d*d/u;return d<0?h:f>u?(e-a)*(e-a)+(r-s)*(r-s):h-f},aa=function(e,r,n){for(var i,a,s,o,l,u=0,h=0;h<n.length/2;h++)if(i=n[h*2],a=n[h*2+1],h+1<n.length/2?(s=n[(h+1)*2],o=n[(h+1)*2+1]):(s=n[(h+1-n.length/2)*2],o=n[(h+1-n.length/2)*2+1]),!(i==e&&s==e))if(i>=e&&e>=s||i<=e&&e<=s)l=(e-i)/(s-i)*(o-a)+a,l>r&&u++;else continue;return u%2!==0},Qo=function(e,r,n,i,a,s,o,l,u){var h=new Array(n.length),d;l[0]!=null?(d=Math.atan(l[1]/l[0]),l[0]<0?d=d+Math.PI/2:d=-d-Math.PI/2):d=l;for(var f=Math.cos(-d),p=Math.sin(-d),g=0;g<h.length/2;g++)h[g*2]=s/2*(n[g*2]*f-n[g*2+1]*p),h[g*2+1]=o/2*(n[g*2+1]*f+n[g*2]*p),h[g*2]+=i,h[g*2+1]+=a;var m;if(u>0){var v=Pv(h,-u);m=Ov(v)}else m=h;return aa(e,r,m)},Jme=function(e,r,n,i,a,s,o,l){for(var u=new Array(n.length*2),h=0;h<l.length;h++){var d=l[h];u[h*4+0]=d.startX,u[h*4+1]=d.startY,u[h*4+2]=d.stopX,u[h*4+3]=d.stopY;var f=Math.pow(d.cx-e,2)+Math.pow(d.cy-r,2);if(f<=Math.pow(d.radius,2))return!0}return aa(e,r,u)},Ov=function(e){for(var r=new Array(e.length/2),n,i,a,s,o,l,u,h,d=0;d<e.length/4;d++){n=e[d*4],i=e[d*4+1],a=e[d*4+2],s=e[d*4+3],d<e.length/4-1?(o=e[(d+1)*4],l=e[(d+1)*4+1],u=e[(d+1)*4+2],h=e[(d+1)*4+3]):(o=e[0],l=e[1],u=e[2],h=e[3]);var f=kl(n,i,a,s,o,l,u,h,!0);r[d*2]=f[0],r[d*2+1]=f[1]}return r},Pv=function(e,r){for(var n=new Array(e.length*2),i,a,s,o,l=0;l<e.length/2;l++){i=e[l*2],a=e[l*2+1],l<e.length/2-1?(s=e[(l+1)*2],o=e[(l+1)*2+1]):(s=e[0],o=e[1]);var u=o-a,h=-(s-i),d=Math.sqrt(u*u+h*h),f=u/d,p=h/d;n[l*4]=i+f*r,n[l*4+1]=a+p*r,n[l*4+2]=s+f*r,n[l*4+3]=o+p*r}return n},eve=function(e,r,n,i,a,s){var o=n-e,l=i-r;o/=a,l/=s;var u=Math.sqrt(o*o+l*l),h=u-1;if(h<0)return[];var d=h/u;return[(n-e)*d+e,(i-r)*d+r]},Yc=function(e,r,n,i,a,s,o){return e-=a,r-=s,e/=n/2+o,r/=i/2+o,e*e+r*r<=1},Af=function(e,r,n,i,a,s,o){var l=[n-e,i-r],u=[e-a,r-s],h=l[0]*l[0]+l[1]*l[1],d=2*(u[0]*l[0]+u[1]*l[1]),f=u[0]*u[0]+u[1]*u[1]-o*o,p=d*d-4*h*f;if(p<0)return[];var g=(-d+Math.sqrt(p))/(2*h),m=(-d-Math.sqrt(p))/(2*h),v=Math.min(g,m),y=Math.max(g,m),b=[];if(v>=0&&v<=1&&b.push(v),y>=0&&y<=1&&b.push(y),b.length===0)return[];var w=b[0]*l[0]+e,T=b[0]*l[1]+r;if(b.length>1){if(b[0]==b[1])return[w,T];var E=b[1]*l[0]+e,L=b[1]*l[1]+r;return[w,T,E,L]}else return[w,T]},Gb=function(e,r,n){return r<=e&&e<=n||n<=e&&e<=r?e:e<=r&&r<=n||n<=r&&r<=e?r:n},kl=function(e,r,n,i,a,s,o,l,u){var h=e-a,d=n-e,f=o-a,p=r-s,g=i-r,m=l-s,v=f*p-m*h,y=d*p-g*h,b=m*d-f*g;if(b!==0){var w=v/b,T=y/b,E=.001,L=0-E,S=1+E;return L<=w&&w<=S&&L<=T&&T<=S?[e+w*d,r+w*g]:u?[e+w*d,r+w*g]:[]}else return v===0||y===0?Gb(e,n,o)===o?[o,l]:Gb(e,n,a)===a?[a,s]:Gb(a,o,n)===n?[n,i]:[]:[]},tve=function(e,r,n,i,a){var s=[],o=i/2,l=a/2,u=r,h=n;s.push({x:u+o*e[0],y:h+l*e[1]});for(var d=1;d<e.length/2;d++)s.push({x:u+o*e[d*2],y:h+l*e[d*2+1]});return s},op=function(e,r,n,i,a,s,o,l){var u=[],h,d=new Array(n.length),f=!0;s==null&&(f=!1);var p;if(f){for(var g=0;g<d.length/2;g++)d[g*2]=n[g*2]*s+i,d[g*2+1]=n[g*2+1]*o+a;if(l>0){var m=Pv(d,-l);p=Ov(m)}else p=d}else p=n;for(var v,y,b,w,T=0;T<p.length/2;T++)v=p[T*2],y=p[T*2+1],T<p.length/2-1?(b=p[(T+1)*2],w=p[(T+1)*2+1]):(b=p[0],w=p[1]),h=kl(e,r,i,a,v,y,b,w),h.length!==0&&u.push(h[0],h[1]);return u},rve=function(e,r,n,i,a,s,o,l,u){var h=[],d,f=new Array(n.length*2);u.forEach(function(b,w){w===0?(f[f.length-2]=b.startX,f[f.length-1]=b.startY):(f[w*4-2]=b.startX,f[w*4-1]=b.startY),f[w*4]=b.stopX,f[w*4+1]=b.stopY,d=Af(e,r,i,a,b.cx,b.cy,b.radius),d.length!==0&&h.push(d[0],d[1])});for(var p=0;p<f.length/4;p++)d=kl(e,r,i,a,f[p*4],f[p*4+1],f[p*4+2],f[p*4+3],!1),d.length!==0&&h.push(d[0],d[1]);if(h.length>2){for(var g=[h[0],h[1]],m=Math.pow(g[0]-e,2)+Math.pow(g[1]-r,2),v=1;v<h.length/2;v++){var y=Math.pow(h[v*2]-e,2)+Math.pow(h[v*2+1]-r,2);y<=m&&(g[0]=h[v*2],g[1]=h[v*2+1],m=y)}return g}return h},Zg=function(e,r,n){var i=[e[0]-r[0],e[1]-r[1]],a=Math.sqrt(i[0]*i[0]+i[1]*i[1]),s=(a-n)/a;return s<0&&(s=1e-5),[r[0]+s*i[0],r[1]+s*i[1]]},Oi=function(e,r){var n=iw(e,r);return n=Cz(n),n},Cz=function(e){for(var r,n,i=e.length/2,a=1/0,s=1/0,o=-1/0,l=-1/0,u=0;u<i;u++)r=e[2*u],n=e[2*u+1],a=Math.min(a,r),o=Math.max(o,r),s=Math.min(s,n),l=Math.max(l,n);for(var h=2/(o-a),d=2/(l-s),f=0;f<i;f++)r=e[2*f]=e[2*f]*h,n=e[2*f+1]=e[2*f+1]*d,a=Math.min(a,r),o=Math.max(o,r),s=Math.min(s,n),l=Math.max(l,n);if(s<-1)for(var p=0;p<i;p++)n=e[2*p+1]=e[2*p+1]+(-1-s);return e},iw=function(e,r){var n=1/e*2*Math.PI,i=e%2===0?Math.PI/2+n/2:Math.PI/2;i+=r;for(var a=new Array(e*2),s,o=0;o<e;o++)s=o*n+i,a[2*o]=Math.cos(s),a[2*o+1]=Math.sin(-s);return a},Ul=function(e,r){return Math.min(e/4,r/4,8)},Az=function(e,r){return Math.min(e/10,r/10,8)},KE=function(){return 8},nve=function(e,r,n){return[e-2*r+n,2*(r-e),e]},aw=function(e,r){return{heightOffset:Math.min(15,.05*r),widthOffset:Math.min(100,.25*e),ctrlPtOffsetPct:.05}};function Ub(t,e){function r(d){for(var f=[],p=0;p<d.length;p++){var g=d[p],m=d[(p+1)%d.length],v={x:m.x-g.x,y:m.y-g.y},y={x:-v.y,y:v.x},b=Math.sqrt(y.x*y.x+y.y*y.y);f.push({x:y.x/b,y:y.y/b})}return f}function n(d,f){var p=1/0,g=-1/0,m=la(d),v;try{for(m.s();!(v=m.n()).done;){var y=v.value,b=y.x*f.x+y.y*f.y;p=Math.min(p,b),g=Math.max(g,b)}}catch(w){m.e(w)}finally{m.f()}return{min:p,max:g}}function i(d,f){return!(d.max<f.min||f.max<d.min)}var a=[].concat(Nv(r(t)),Nv(r(e))),s=la(a),o;try{for(s.s();!(o=s.n()).done;){var l=o.value,u=n(t,l),h=n(e,l);if(!i(u,h))return!1}}catch(d){s.e(d)}finally{s.f()}return!0}var ive=hi({dampingFactor:.8,precision:1e-6,iterations:200,weight:function(e){return 1}}),ave={pageRank:function(e){for(var r=ive(e),n=r.dampingFactor,i=r.precision,a=r.iterations,s=r.weight,o=this._private.cy,l=this.byGroup(),u=l.nodes,h=l.edges,d=u.length,f=d*d,p=h.length,g=new Array(f),m=new Array(d),v=(1-n)/d,y=0;y<d;y++){for(var b=0;b<d;b++){var w=y*d+b;g[w]=0}m[y]=0}for(var T=0;T<p;T++){var E=h[T],L=E.data("source"),S=E.data("target");if(L!==S){var C=u.indexOfId(L),A=u.indexOfId(S),N=s(E),_=A*d+C;g[_]+=N,m[C]+=N}}for(var O=1/d+v,P=0;P<d;P++)if(m[P]===0)for(var k=0;k<d;k++){var R=k*d+P;g[R]=O}else for(var I=0;I<d;I++){var M=I*d+P;g[M]=g[M]/m[P]+v}for(var D=new Array(d),B=new Array(d),$,F=0;F<d;F++)D[F]=1;for(var G=0;G<a;G++){for(var W=0;W<d;W++)B[W]=0;for(var J=0;J<d;J++)for(var q=0;q<d;q++){var ne=J*d+q;B[J]+=g[ne]*D[q]}$me(B),$=D,D=B,B=$;for(var ae=0,pe=0;pe<d;pe++){var K=$[pe]-D[pe];ae+=K*K}if(ae<i)break}var Z={rank:function(Y){return Y=o.collection(Y)[0],D[u.indexOf(Y)]}};return Z}},iA=hi({root:null,weight:function(e){return 1},directed:!1,alpha:0}),Mh={degreeCentralityNormalized:function(e){e=iA(e);var r=this.cy(),n=this.nodes(),i=n.length;if(e.directed){for(var h={},d={},f=0,p=0,g=0;g<i;g++){var m=n[g],v=m.id();e.root=m;var y=this.degreeCentrality(e);f<y.indegree&&(f=y.indegree),p<y.outdegree&&(p=y.outdegree),h[v]=y.indegree,d[v]=y.outdegree}return{indegree:function(w){return f==0?0:(Bt(w)&&(w=r.filter(w)),h[w.id()]/f)},outdegree:function(w){return p===0?0:(Bt(w)&&(w=r.filter(w)),d[w.id()]/p)}}}else{for(var a={},s=0,o=0;o<i;o++){var l=n[o];e.root=l;var u=this.degreeCentrality(e);s<u.degree&&(s=u.degree),a[l.id()]=u.degree}return{degree:function(w){return s===0?0:(Bt(w)&&(w=r.filter(w)),a[w.id()]/s)}}}},degreeCentrality:function(e){e=iA(e);var r=this.cy(),n=this,i=e,a=i.root,s=i.weight,o=i.directed,l=i.alpha;if(a=r.collection(a)[0],o){for(var p=a.connectedEdges(),g=p.filter(function(L){return L.target().same(a)&&n.has(L)}),m=p.filter(function(L){return L.source().same(a)&&n.has(L)}),v=g.length,y=m.length,b=0,w=0,T=0;T<g.length;T++)b+=s(g[T]);for(var E=0;E<m.length;E++)w+=s(m[E]);return{indegree:Math.pow(v,1-l)*Math.pow(b,l),outdegree:Math.pow(y,1-l)*Math.pow(w,l)}}else{for(var u=a.connectedEdges().intersection(n),h=u.length,d=0,f=0;f<u.length;f++)d+=s(u[f]);return{degree:Math.pow(h,1-l)*Math.pow(d,l)}}}};Mh.dc=Mh.degreeCentrality;Mh.dcn=Mh.degreeCentralityNormalised=Mh.degreeCentralityNormalized;var aA=hi({harmonic:!0,weight:function(){return 1},directed:!1,root:null}),Ih={closenessCentralityNormalized:function(e){for(var r=aA(e),n=r.harmonic,i=r.weight,a=r.directed,s=this.cy(),o={},l=0,u=this.nodes(),h=this.floydWarshall({weight:i,directed:a}),d=0;d<u.length;d++){for(var f=0,p=u[d],g=0;g<u.length;g++)if(d!==g){var m=h.distance(p,u[g]);n?f+=1/m:f+=m}n||(f=1/f),l<f&&(l=f),o[p.id()]=f}return{closeness:function(y){return l==0?0:(Bt(y)?y=s.filter(y)[0].id():y=y.id(),o[y]/l)}}},closenessCentrality:function(e){var r=aA(e),n=r.root,i=r.weight,a=r.directed,s=r.harmonic;n=this.filter(n)[0];for(var o=this.dijkstra({root:n,weight:i,directed:a}),l=0,u=this.nodes(),h=0;h<u.length;h++){var d=u[h];if(!d.same(n)){var f=o.distanceTo(d);s?l+=1/f:l+=f}}return s?l:1/l}};Ih.cc=Ih.closenessCentrality;Ih.ccn=Ih.closenessCentralityNormalised=Ih.closenessCentralityNormalized;var sve=hi({weight:null,directed:!1}),sw={betweennessCentrality:function(e){for(var r=sve(e),n=r.directed,i=r.weight,a=i!=null,s=this.cy(),o=this.nodes(),l={},u={},h=0,d={set:function(w,T){u[w]=T,T>h&&(h=T)},get:function(w){return u[w]}},f=0;f<o.length;f++){var p=o[f],g=p.id();n?l[g]=p.outgoers().nodes():l[g]=p.openNeighborhood().nodes(),d.set(g,0)}for(var m=function(){for(var w=o[v].id(),T=[],E={},L={},S={},C=new tg(function(J,q){return S[J]-S[q]}),A=0;A<o.length;A++){var N=o[A].id();E[N]=[],L[N]=0,S[N]=1/0}for(L[w]=1,S[w]=0,C.push(w);!C.empty();){var _=C.pop();if(T.push(_),a)for(var O=0;O<l[_].length;O++){var P=l[_][O],k=s.getElementById(_),R=void 0;k.edgesTo(P).length>0?R=k.edgesTo(P)[0]:R=P.edgesTo(k)[0];var I=i(R);P=P.id(),S[P]>S[_]+I&&(S[P]=S[_]+I,C.nodes.indexOf(P)<0?C.push(P):C.updateItem(P),L[P]=0,E[P]=[]),S[P]==S[_]+I&&(L[P]=L[P]+L[_],E[P].push(_))}else for(var M=0;M<l[_].length;M++){var D=l[_][M].id();S[D]==1/0&&(C.push(D),S[D]=S[_]+1),S[D]==S[_]+1&&(L[D]=L[D]+L[_],E[D].push(_))}}for(var B={},$=0;$<o.length;$++)B[o[$].id()]=0;for(;T.length>0;){for(var F=T.pop(),G=0;G<E[F].length;G++){var W=E[F][G];B[W]=B[W]+L[W]/L[F]*(1+B[F])}F!=o[v].id()&&d.set(F,d.get(F)+B[F])}},v=0;v<o.length;v++)m();var y={betweenness:function(w){var T=s.collection(w).id();return d.get(T)},betweennessNormalized:function(w){if(h==0)return 0;var T=s.collection(w).id();return d.get(T)/h}};return y.betweennessNormalised=y.betweennessNormalized,y}};sw.bc=sw.betweennessCentrality;var ove=hi({expandFactor:2,inflateFactor:2,multFactor:1,maxIterations:20,attributes:[function(t){return 1}]}),lve=function(e){return ove(e)},cve=function(e,r){for(var n=0,i=0;i<r.length;i++)n+=r[i](e);return n},uve=function(e,r,n){for(var i=0;i<r;i++)e[i*r+i]=n},_z=function(e,r){for(var n,i=0;i<r;i++){n=0;for(var a=0;a<r;a++)n+=e[a*r+i];for(var s=0;s<r;s++)e[s*r+i]=e[s*r+i]/n}},hve=function(e,r,n){for(var i=new Array(n*n),a=0;a<n;a++){for(var s=0;s<n;s++)i[a*n+s]=0;for(var o=0;o<n;o++)for(var l=0;l<n;l++)i[a*n+l]+=e[a*n+o]*r[o*n+l]}return i},dve=function(e,r,n){for(var i=e.slice(0),a=1;a<n;a++)e=hve(e,i,r);return e},fve=function(e,r,n){for(var i=new Array(r*r),a=0;a<r*r;a++)i[a]=Math.pow(e[a],n);return _z(i,r),i},pve=function(e,r,n,i){for(var a=0;a<n;a++){var s=Math.round(e[a]*Math.pow(10,i))/Math.pow(10,i),o=Math.round(r[a]*Math.pow(10,i))/Math.pow(10,i);if(s!==o)return!1}return!0},gve=function(e,r,n,i){for(var a=[],s=0;s<r;s++){for(var o=[],l=0;l<r;l++)Math.round(e[s*r+l]*1e3)/1e3>0&&o.push(n[l]);o.length!==0&&a.push(i.collection(o))}return a},mve=function(e,r){for(var n=0;n<e.length;n++)if(!r[n]||e[n].id()!==r[n].id())return!1;return!0},vve=function(e){for(var r=0;r<e.length;r++)for(var n=0;n<e.length;n++)r!=n&&mve(e[r],e[n])&&e.splice(n,1);return e},sA=function(e){for(var r=this.nodes(),n=this.edges(),i=this.cy(),a=lve(e),s={},o=0;o<r.length;o++)s[r[o].id()]=o;for(var l=r.length,u=l*l,h=new Array(u),d,f=0;f<u;f++)h[f]=0;for(var p=0;p<n.length;p++){var g=n[p],m=s[g.source().id()],v=s[g.target().id()],y=cve(g,a.attributes);h[m*l+v]+=y,h[v*l+m]+=y}uve(h,l,a.multFactor),_z(h,l);for(var b=!0,w=0;b&&w<a.maxIterations;)b=!1,d=dve(h,l,a.expandFactor),h=fve(d,l,a.inflateFactor),pve(h,d,u,4)||(b=!0),w++;var T=gve(h,l,r,i);return T=vve(T),T},yve={markovClustering:sA,mcl:sA},xve=function(e){return e},Lz=function(e,r){return Math.abs(r-e)},oA=function(e,r,n){return e+Lz(r,n)},lA=function(e,r,n){return e+Math.pow(n-r,2)},bve=function(e){return Math.sqrt(e)},wve=function(e,r,n){return Math.max(e,Lz(r,n))},nf=function(e,r,n,i,a){for(var s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:xve,o=i,l,u,h=0;h<e;h++)l=r(h),u=n(h),o=a(o,l,u);return s(o)},sd={euclidean:function(e,r,n){return e>=2?nf(e,r,n,0,lA,bve):nf(e,r,n,0,oA)},squaredEuclidean:function(e,r,n){return nf(e,r,n,0,lA)},manhattan:function(e,r,n){return nf(e,r,n,0,oA)},max:function(e,r,n){return nf(e,r,n,-1/0,wve)}};sd["squared-euclidean"]=sd.squaredEuclidean;sd.squaredeuclidean=sd.squaredEuclidean;function N2(t,e,r,n,i,a){var s;return nn(t)?s=t:s=sd[t]||sd.euclidean,e===0&&nn(t)?s(i,a):s(e,r,n,i,a)}var Tve=hi({k:2,m:2,sensitivityThreshold:1e-4,distance:"euclidean",maxIterations:10,attributes:[],testMode:!1,testCentroids:null}),ZE=function(e){return Tve(e)},Bv=function(e,r,n,i,a){var s=a!=="kMedoids",o=s?function(d){return n[d]}:function(d){return i[d](n)},l=function(f){return i[f](r)},u=n,h=r;return N2(e,i.length,o,l,u,h)},Wb=function(e,r,n){for(var i=n.length,a=new Array(i),s=new Array(i),o=new Array(r),l=null,u=0;u<i;u++)a[u]=e.min(n[u]).value,s[u]=e.max(n[u]).value;for(var h=0;h<r;h++){l=[];for(var d=0;d<i;d++)l[d]=Math.random()*(s[d]-a[d])+a[d];o[h]=l}return o},Rz=function(e,r,n,i,a){for(var s=1/0,o=0,l=0;l<r.length;l++){var u=Bv(n,e,r[l],i,a);u<s&&(s=u,o=l)}return o},Nz=function(e,r,n){for(var i=[],a=null,s=0;s<r.length;s++)a=r[s],n[a.id()]===e&&i.push(a);return i},Eve=function(e,r,n){return Math.abs(r-e)<=n},kve=function(e,r,n){for(var i=0;i<e.length;i++)for(var a=0;a<e[i].length;a++){var s=Math.abs(e[i][a]-r[i][a]);if(s>n)return!1}return!0},Sve=function(e,r,n){for(var i=0;i<n;i++)if(e===r[i])return!0;return!1},cA=function(e,r){var n=new Array(r);if(e.length<50)for(var i=0;i<r;i++){for(var a=e[Math.floor(Math.random()*e.length)];Sve(a,n,i);)a=e[Math.floor(Math.random()*e.length)];n[i]=a}else for(var s=0;s<r;s++)n[s]=e[Math.floor(Math.random()*e.length)];return n},uA=function(e,r,n){for(var i=0,a=0;a<r.length;a++)i+=Bv("manhattan",r[a],e,n,"kMedoids");return i},Cve=function(e){var r=this.cy(),n=this.nodes(),i=null,a=ZE(e),s=new Array(a.k),o={},l;a.testMode?typeof a.testCentroids=="number"?(a.testCentroids,l=Wb(n,a.k,a.attributes)):$n(a.testCentroids)==="object"?l=a.testCentroids:l=Wb(n,a.k,a.attributes):l=Wb(n,a.k,a.attributes);for(var u=!0,h=0;u&&h<a.maxIterations;){for(var d=0;d<n.length;d++)i=n[d],o[i.id()]=Rz(i,l,a.distance,a.attributes,"kMeans");u=!1;for(var f=0;f<a.k;f++){var p=Nz(f,n,o);if(p.length!==0){for(var g=a.attributes.length,m=l[f],v=new Array(g),y=new Array(g),b=0;b<g;b++){y[b]=0;for(var w=0;w<p.length;w++)i=p[w],y[b]+=a.attributes[b](i);v[b]=y[b]/p.length,Eve(v[b],m[b],a.sensitivityThreshold)||(u=!0)}l[f]=v,s[f]=r.collection(p)}}h++}return s},Ave=function(e){var r=this.cy(),n=this.nodes(),i=null,a=ZE(e),s=new Array(a.k),o,l={},u,h=new Array(a.k);a.testMode?typeof a.testCentroids=="number"||($n(a.testCentroids)==="object"?o=a.testCentroids:o=cA(n,a.k)):o=cA(n,a.k);for(var d=!0,f=0;d&&f<a.maxIterations;){for(var p=0;p<n.length;p++)i=n[p],l[i.id()]=Rz(i,o,a.distance,a.attributes,"kMedoids");d=!1;for(var g=0;g<o.length;g++){var m=Nz(g,n,l);if(m.length!==0){h[g]=uA(o[g],m,a.attributes);for(var v=0;v<m.length;v++)u=uA(m[v],m,a.attributes),u<h[g]&&(h[g]=u,o[g]=m[v],d=!0);s[g]=r.collection(m)}}f++}return s},_ve=function(e,r,n,i,a){for(var s,o,l=0;l<r.length;l++)for(var u=0;u<e.length;u++)i[l][u]=Math.pow(n[l][u],a.m);for(var h=0;h<e.length;h++)for(var d=0;d<a.attributes.length;d++){s=0,o=0;for(var f=0;f<r.length;f++)s+=i[f][h]*a.attributes[d](r[f]),o+=i[f][h];e[h][d]=s/o}},Lve=function(e,r,n,i,a){for(var s=0;s<e.length;s++)r[s]=e[s].slice();for(var o,l,u,h=2/(a.m-1),d=0;d<n.length;d++)for(var f=0;f<i.length;f++){o=0;for(var p=0;p<n.length;p++)l=Bv(a.distance,i[f],n[d],a.attributes,"cmeans"),u=Bv(a.distance,i[f],n[p],a.attributes,"cmeans"),o+=Math.pow(l/u,h);e[f][d]=1/o}},Rve=function(e,r,n,i){for(var a=new Array(n.k),s=0;s<a.length;s++)a[s]=[];for(var o,l,u=0;u<r.length;u++){o=-1/0,l=-1;for(var h=0;h<r[0].length;h++)r[u][h]>o&&(o=r[u][h],l=h);a[l].push(e[u])}for(var d=0;d<a.length;d++)a[d]=i.collection(a[d]);return a},hA=function(e){var r=this.cy(),n=this.nodes(),i=ZE(e),a,s,o,l,u;l=new Array(n.length);for(var h=0;h<n.length;h++)l[h]=new Array(i.k);o=new Array(n.length);for(var d=0;d<n.length;d++)o[d]=new Array(i.k);for(var f=0;f<n.length;f++){for(var p=0,g=0;g<i.k;g++)o[f][g]=Math.random(),p+=o[f][g];for(var m=0;m<i.k;m++)o[f][m]=o[f][m]/p}s=new Array(i.k);for(var v=0;v<i.k;v++)s[v]=new Array(i.attributes.length);u=new Array(n.length);for(var y=0;y<n.length;y++)u[y]=new Array(i.k);for(var b=!0,w=0;b&&w<i.maxIterations;)b=!1,_ve(s,n,o,u,i),Lve(o,l,s,n,i),kve(o,l,i.sensitivityThreshold)||(b=!0),w++;return a=Rve(n,o,i,r),{clusters:a,degreeOfMembership:o}},Nve={kMeans:Cve,kMedoids:Ave,fuzzyCMeans:hA,fcm:hA},Dve=hi({distance:"euclidean",linkage:"min",mode:"threshold",threshold:1/0,addDendrogram:!1,dendrogramDepth:0,attributes:[]}),Mve={single:"min",complete:"max"},Ive=function(e){var r=Dve(e),n=Mve[r.linkage];return n!=null&&(r.linkage=n),r},dA=function(e,r,n,i,a){for(var s=0,o=1/0,l,u=a.attributes,h=function(A,N){return N2(a.distance,u.length,function(_){return u[_](A)},function(_){return u[_](N)},A,N)},d=0;d<e.length;d++){var f=e[d].key,p=n[f][i[f]];p<o&&(s=f,o=p)}if(a.mode==="threshold"&&o>=a.threshold||a.mode==="dendrogram"&&e.length===1)return!1;var g=r[s],m=r[i[s]],v;a.mode==="dendrogram"?v={left:g,right:m,key:g.key}:v={value:g.value.concat(m.value),key:g.key},e[g.index]=v,e.splice(m.index,1),r[g.key]=v;for(var y=0;y<e.length;y++){var b=e[y];g.key===b.key?l=1/0:a.linkage==="min"?(l=n[g.key][b.key],n[g.key][b.key]>n[m.key][b.key]&&(l=n[m.key][b.key])):a.linkage==="max"?(l=n[g.key][b.key],n[g.key][b.key]<n[m.key][b.key]&&(l=n[m.key][b.key])):a.linkage==="mean"?l=(n[g.key][b.key]*g.size+n[m.key][b.key]*m.size)/(g.size+m.size):a.mode==="dendrogram"?l=h(b.value,g.value):l=h(b.value[0],g.value[0]),n[g.key][b.key]=n[b.key][g.key]=l}for(var w=0;w<e.length;w++){var T=e[w].key;if(i[T]===g.key||i[T]===m.key){for(var E=T,L=0;L<e.length;L++){var S=e[L].key;n[T][S]<n[T][E]&&(E=S)}i[T]=E}e[w].index=w}return g.key=m.key=g.index=m.index=null,!0},bh=function(e,r,n){e&&(e.value?r.push(e.value):(e.left&&bh(e.left,r),e.right&&bh(e.right,r)))},ow=function(e,r){if(!e)return"";if(e.left&&e.right){var n=ow(e.left,r),i=ow(e.right,r),a=r.add({group:"nodes",data:{id:n+","+i}});return r.add({group:"edges",data:{source:n,target:a.id()}}),r.add({group:"edges",data:{source:i,target:a.id()}}),a.id()}else if(e.value)return e.value.id()},lw=function(e,r,n){if(!e)return[];var i=[],a=[],s=[];return r===0?(e.left&&bh(e.left,i),e.right&&bh(e.right,a),s=i.concat(a),[n.collection(s)]):r===1?e.value?[n.collection(e.value)]:(e.left&&bh(e.left,i),e.right&&bh(e.right,a),[n.collection(i),n.collection(a)]):e.value?[n.collection(e.value)]:(e.left&&(i=lw(e.left,r-1,n)),e.right&&(a=lw(e.right,r-1,n)),i.concat(a))},fA=function(e){for(var r=this.cy(),n=this.nodes(),i=Ive(e),a=i.attributes,s=function(w,T){return N2(i.distance,a.length,function(E){return a[E](w)},function(E){return a[E](T)},w,T)},o=[],l=[],u=[],h=[],d=0;d<n.length;d++){var f={value:i.mode==="dendrogram"?n[d]:[n[d]],key:d,index:d};o[d]=f,h[d]=f,l[d]=[],u[d]=0}for(var p=0;p<o.length;p++)for(var g=0;g<=p;g++){var m=void 0;i.mode==="dendrogram"?m=p===g?1/0:s(o[p].value,o[g].value):m=p===g?1/0:s(o[p].value[0],o[g].value[0]),l[p][g]=m,l[g][p]=m,m<l[p][u[p]]&&(u[p]=g)}for(var v=dA(o,h,l,u,i);v;)v=dA(o,h,l,u,i);var y;return i.mode==="dendrogram"?(y=lw(o[0],i.dendrogramDepth,r),i.addDendrogram&&ow(o[0],r)):(y=new Array(o.length),o.forEach(function(b,w){b.key=b.index=null,y[w]=r.collection(b.value)})),y},Ove={hierarchicalClustering:fA,hca:fA},Pve=hi({distance:"euclidean",preference:"median",damping:.8,maxIterations:1e3,minIterations:100,attributes:[]}),Bve=function(e){var r=e.damping,n=e.preference;.5<=r&&r<1||Kr("Damping must range on [0.5, 1).  Got: ".concat(r));var i=["median","mean","min","max"];return i.some(function(a){return a===n})||vt(n)||Kr("Preference must be one of [".concat(i.map(function(a){return"'".concat(a,"'")}).join(", "),"] or a number.  Got: ").concat(n)),Pve(e)},Fve=function(e,r,n,i){var a=function(o,l){return i[l](o)};return-N2(e,i.length,function(s){return a(r,s)},function(s){return a(n,s)},r,n)},$ve=function(e,r){var n=null;return r==="median"?n=Bme(e):r==="mean"?n=Pme(e):r==="min"?n=Ime(e):r==="max"?n=Ome(e):n=r,n},zve=function(e,r,n){for(var i=[],a=0;a<e;a++)r[a*e+a]+n[a*e+a]>0&&i.push(a);return i},pA=function(e,r,n){for(var i=[],a=0;a<e;a++){for(var s=-1,o=-1/0,l=0;l<n.length;l++){var u=n[l];r[a*e+u]>o&&(s=u,o=r[a*e+u])}s>0&&i.push(s)}for(var h=0;h<n.length;h++)i[n[h]]=n[h];return i},Vve=function(e,r,n){for(var i=pA(e,r,n),a=0;a<n.length;a++){for(var s=[],o=0;o<i.length;o++)i[o]===n[a]&&s.push(o);for(var l=-1,u=-1/0,h=0;h<s.length;h++){for(var d=0,f=0;f<s.length;f++)d+=r[s[f]*e+s[h]];d>u&&(l=h,u=d)}n[a]=s[l]}return i=pA(e,r,n),i},gA=function(e){for(var r=this.cy(),n=this.nodes(),i=Bve(e),a={},s=0;s<n.length;s++)a[n[s].id()]=s;var o,l,u,h,d,f;o=n.length,l=o*o,u=new Array(l);for(var p=0;p<l;p++)u[p]=-1/0;for(var g=0;g<o;g++)for(var m=0;m<o;m++)g!==m&&(u[g*o+m]=Fve(i.distance,n[g],n[m],i.attributes));h=$ve(u,i.preference);for(var v=0;v<o;v++)u[v*o+v]=h;d=new Array(l);for(var y=0;y<l;y++)d[y]=0;f=new Array(l);for(var b=0;b<l;b++)f[b]=0;for(var w=new Array(o),T=new Array(o),E=new Array(o),L=0;L<o;L++)w[L]=0,T[L]=0,E[L]=0;for(var S=new Array(o*i.minIterations),C=0;C<S.length;C++)S[C]=0;var A;for(A=0;A<i.maxIterations;A++){for(var N=0;N<o;N++){for(var _=-1/0,O=-1/0,P=-1,k=0,R=0;R<o;R++)w[R]=d[N*o+R],k=f[N*o+R]+u[N*o+R],k>=_?(O=_,_=k,P=R):k>O&&(O=k);for(var I=0;I<o;I++)d[N*o+I]=(1-i.damping)*(u[N*o+I]-_)+i.damping*w[I];d[N*o+P]=(1-i.damping)*(u[N*o+P]-O)+i.damping*w[P]}for(var M=0;M<o;M++){for(var D=0,B=0;B<o;B++)w[B]=f[B*o+M],T[B]=Math.max(0,d[B*o+M]),D+=T[B];D-=T[M],T[M]=d[M*o+M],D+=T[M];for(var $=0;$<o;$++)f[$*o+M]=(1-i.damping)*Math.min(0,D-T[$])+i.damping*w[$];f[M*o+M]=(1-i.damping)*(D-T[M])+i.damping*w[M]}for(var F=0,G=0;G<o;G++){var W=f[G*o+G]+d[G*o+G]>0?1:0;S[A%i.minIterations*o+G]=W,F+=W}if(F>0&&(A>=i.minIterations-1||A==i.maxIterations-1)){for(var J=0,q=0;q<o;q++){E[q]=0;for(var ne=0;ne<i.minIterations;ne++)E[q]+=S[ne*o+q];(E[q]===0||E[q]===i.minIterations)&&J++}if(J===o)break}}for(var ae=zve(o,d,f),pe=Vve(o,u,ae),K={},Z=0;Z<ae.length;Z++)K[ae[Z]]=[];for(var X=0;X<n.length;X++){var Y=a[n[X].id()],ee=pe[Y];ee!=null&&K[ee].push(n[X])}for(var j=new Array(ae.length),fe=0;fe<ae.length;fe++)j[fe]=r.collection(K[ae[fe]]);return j},Gve={affinityPropagation:gA,ap:gA},Uve=hi({root:void 0,directed:!1}),Wve={hierholzer:function(e){if(!vr(e)){var r=arguments;e={root:r[0],directed:r[1]}}var n=Uve(e),i=n.root,a=n.directed,s=this,o=!1,l,u,h;i&&(h=Bt(i)?this.filter(i)[0].id():i[0].id());var d={},f={};a?s.forEach(function(b){var w=b.id();if(b.isNode()){var T=b.indegree(!0),E=b.outdegree(!0),L=T-E,S=E-T;L==1?l?o=!0:l=w:S==1?u?o=!0:u=w:(S>1||L>1)&&(o=!0),d[w]=[],b.outgoers().forEach(function(C){C.isEdge()&&d[w].push(C.id())})}else f[w]=[void 0,b.target().id()]}):s.forEach(function(b){var w=b.id();if(b.isNode()){var T=b.degree(!0);T%2&&(l?u?o=!0:u=w:l=w),d[w]=[],b.connectedEdges().forEach(function(E){return d[w].push(E.id())})}else f[w]=[b.source().id(),b.target().id()]});var p={found:!1,trail:void 0};if(o)return p;if(u&&l)if(a){if(h&&u!=h)return p;h=u}else{if(h&&u!=h&&l!=h)return p;h||(h=u)}else h||(h=s[0].id());var g=function(w){for(var T=w,E=[w],L,S,C;d[T].length;)L=d[T].shift(),S=f[L][0],C=f[L][1],T!=C?(d[C]=d[C].filter(function(A){return A!=L}),T=C):!a&&T!=S&&(d[S]=d[S].filter(function(A){return A!=L}),T=S),E.unshift(L),E.unshift(T);return E},m=[],v=[];for(v=g(h);v.length!=1;)d[v[0]].length==0?(m.unshift(s.getElementById(v.shift())),m.unshift(s.getElementById(v.shift()))):v=g(v.shift()).concat(v);m.unshift(s.getElementById(v.shift()));for(var y in d)if(d[y].length)return p;return p.found=!0,p.trail=this.spawn(m,!0),p}},Qg=function(){var e=this,r={},n=0,i=0,a=[],s=[],o={},l=function(f,p){for(var g=s.length-1,m=[],v=e.spawn();s[g].x!=f||s[g].y!=p;)m.push(s.pop().edge),g--;m.push(s.pop().edge),m.forEach(function(y){var b=y.connectedNodes().intersection(e);v.merge(y),b.forEach(function(w){var T=w.id(),E=w.connectedEdges().intersection(e);v.merge(w),r[T].cutVertex?v.merge(E.filter(function(L){return L.isLoop()})):v.merge(E)})}),a.push(v)},u=function(f,p,g){f===g&&(i+=1),r[p]={id:n,low:n++,cutVertex:!1};var m=e.getElementById(p).connectedEdges().intersection(e);if(m.size()===0)a.push(e.spawn(e.getElementById(p)));else{var v,y,b,w;m.forEach(function(T){v=T.source().id(),y=T.target().id(),b=v===p?y:v,b!==g&&(w=T.id(),o[w]||(o[w]=!0,s.push({x:p,y:b,edge:T})),b in r?r[p].low=Math.min(r[p].low,r[b].id):(u(f,b,p),r[p].low=Math.min(r[p].low,r[b].low),r[p].id<=r[b].low&&(r[p].cutVertex=!0,l(p,b))))})}};e.forEach(function(d){if(d.isNode()){var f=d.id();f in r||(i=0,u(f,f),r[f].cutVertex=i>1)}});var h=Object.keys(r).filter(function(d){return r[d].cutVertex}).map(function(d){return e.getElementById(d)});return{cut:e.spawn(h),components:a}},Hve={hopcroftTarjanBiconnected:Qg,htbc:Qg,htb:Qg,hopcroftTarjanBiconnectedComponents:Qg},Jg=function(){var e=this,r={},n=0,i=[],a=[],s=e.spawn(e),o=function(u){a.push(u),r[u]={index:n,low:n++,explored:!1};var h=e.getElementById(u).connectedEdges().intersection(e);if(h.forEach(function(m){var v=m.target().id();v!==u&&(v in r||o(v),r[v].explored||(r[u].low=Math.min(r[u].low,r[v].low)))}),r[u].index===r[u].low){for(var d=e.spawn();;){var f=a.pop();if(d.merge(e.getElementById(f)),r[f].low=r[u].index,r[f].explored=!0,f===u)break}var p=d.edgesWith(d),g=d.merge(p);i.push(g),s=s.difference(g)}};return e.forEach(function(l){if(l.isNode()){var u=l.id();u in r||o(u)}}),{cut:s,components:i}},qve={tarjanStronglyConnected:Jg,tsc:Jg,tscc:Jg,tarjanStronglyConnectedComponents:Jg},Dz={};[ap,Tme,Eme,Sme,Ame,Lme,Dme,ave,Mh,Ih,sw,yve,Nve,Ove,Gve,Wve,Hve,qve].forEach(function(t){Gt(Dz,t)});/*!
Embeddable Minimum Strictly-Compliant Promises/A+ 1.1.1 Thenable
Copyright (c) 2013-2014 Ralf S. Engelschall (http://engelschall.com)
Licensed under The MIT License (http://opensource.org/licenses/MIT)
*/var Mz=0,Iz=1,Oz=2,Es=function(e){if(!(this instanceof Es))return new Es(e);this.id="Thenable/1.0.7",this.state=Mz,this.fulfillValue=void 0,this.rejectReason=void 0,this.onFulfilled=[],this.onRejected=[],this.proxy={then:this.then.bind(this)},typeof e=="function"&&e.call(this,this.fulfill.bind(this),this.reject.bind(this))};Es.prototype={fulfill:function(e){return mA(this,Iz,"fulfillValue",e)},reject:function(e){return mA(this,Oz,"rejectReason",e)},then:function(e,r){var n=this,i=new Es;return n.onFulfilled.push(yA(e,i,"fulfill")),n.onRejected.push(yA(r,i,"reject")),Pz(n),i.proxy}};var mA=function(e,r,n,i){return e.state===Mz&&(e.state=r,e[n]=i,Pz(e)),e},Pz=function(e){e.state===Iz?vA(e,"onFulfilled",e.fulfillValue):e.state===Oz&&vA(e,"onRejected",e.rejectReason)},vA=function(e,r,n){if(e[r].length!==0){var i=e[r];e[r]=[];var a=function(){for(var o=0;o<i.length;o++)i[o](n)};typeof setImmediate=="function"?setImmediate(a):setTimeout(a,0)}},yA=function(e,r,n){return function(i){if(typeof e!="function")r[n].call(r,i);else{var a;try{a=e(i)}catch(s){r.reject(s);return}Bz(r,a)}}},Bz=function(e,r){if(e===r||e.proxy===r){e.reject(new TypeError("cannot resolve promise with itself"));return}var n;if($n(r)==="object"&&r!==null||typeof r=="function")try{n=r.then}catch(a){e.reject(a);return}if(typeof n=="function"){var i=!1;try{n.call(r,function(a){i||(i=!0,a===r?e.reject(new TypeError("circular thenable chain")):Bz(e,a))},function(a){i||(i=!0,e.reject(a))})}catch(a){i||e.reject(a)}return}e.fulfill(r)};Es.all=function(t){return new Es(function(e,r){for(var n=new Array(t.length),i=0,a=function(l,u){n[l]=u,i++,i===t.length&&e(n)},s=0;s<t.length;s++)(function(o){var l=t[o],u=l!=null&&l.then!=null;if(u)l.then(function(d){a(o,d)},function(d){r(d)});else{var h=l;a(o,h)}})(s)})};Es.resolve=function(t){return new Es(function(e,r){e(t)})};Es.reject=function(t){return new Es(function(e,r){r(t)})};var Nd=typeof Promise<"u"?Promise:Es,cw=function(e,r,n){var i=VE(e),a=!i,s=this._private=Gt({duration:1e3},r,n);if(s.target=e,s.style=s.style||s.css,s.started=!1,s.playing=!1,s.hooked=!1,s.applying=!1,s.progress=0,s.completes=[],s.frames=[],s.complete&&nn(s.complete)&&s.completes.push(s.complete),a){var o=e.position();s.startPosition=s.startPosition||{x:o.x,y:o.y},s.startStyle=s.startStyle||e.cy().style().getAnimationStartStyle(e,s.style)}if(i){var l=e.pan();s.startPan={x:l.x,y:l.y},s.startZoom=e.zoom()}this.length=1,this[0]=this},pu=cw.prototype;Gt(pu,{instanceString:function(){return"animation"},hook:function(){var e=this._private;if(!e.hooked){var r,n=e.target._private.animation;e.queue?r=n.queue:r=n.current,r.push(this),Aa(e.target)&&e.target.cy().addToAnimationPool(e.target),e.hooked=!0}return this},play:function(){var e=this._private;return e.progress===1&&(e.progress=0),e.playing=!0,e.started=!1,e.stopped=!1,this.hook(),this},playing:function(){return this._private.playing},apply:function(){var e=this._private;return e.applying=!0,e.started=!1,e.stopped=!1,this.hook(),this},applying:function(){return this._private.applying},pause:function(){var e=this._private;return e.playing=!1,e.started=!1,this},stop:function(){var e=this._private;return e.playing=!1,e.started=!1,e.stopped=!0,this},rewind:function(){return this.progress(0)},fastforward:function(){return this.progress(1)},time:function(e){var r=this._private;return e===void 0?r.progress*r.duration:this.progress(e/r.duration)},progress:function(e){var r=this._private,n=r.playing;return e===void 0?r.progress:(n&&this.pause(),r.progress=e,r.started=!1,n&&this.play(),this)},completed:function(){return this._private.progress===1},reverse:function(){var e=this._private,r=e.playing;r&&this.pause(),e.progress=1-e.progress,e.started=!1;var n=function(u,h){var d=e[u];d!=null&&(e[u]=e[h],e[h]=d)};if(n("zoom","startZoom"),n("pan","startPan"),n("position","startPosition"),e.style)for(var i=0;i<e.style.length;i++){var a=e.style[i],s=a.name,o=e.startStyle[s];e.startStyle[s]=a,e.style[i]=o}return r&&this.play(),this},promise:function(e){var r=this._private,n;switch(e){case"frame":n=r.frames;break;default:case"complete":case"completed":n=r.completes}return new Nd(function(i,a){n.push(function(){i()})})}});pu.complete=pu.completed;pu.run=pu.play;pu.running=pu.playing;var Yve={animated:function(){return function(){var r=this,n=r.length!==void 0,i=n?r:[r],a=this._private.cy||this;if(!a.styleEnabled())return!1;var s=i[0];if(s)return s._private.animation.current.length>0}},clearQueue:function(){return function(){var r=this,n=r.length!==void 0,i=n?r:[r],a=this._private.cy||this;if(!a.styleEnabled())return this;for(var s=0;s<i.length;s++){var o=i[s];o._private.animation.queue=[]}return this}},delay:function(){return function(r,n){var i=this._private.cy||this;return i.styleEnabled()?this.animate({delay:r,duration:r,complete:n}):this}},delayAnimation:function(){return function(r,n){var i=this._private.cy||this;return i.styleEnabled()?this.animation({delay:r,duration:r,complete:n}):this}},animation:function(){return function(r,n){var i=this,a=i.length!==void 0,s=a?i:[i],o=this._private.cy||this,l=!a,u=!l;if(!o.styleEnabled())return this;var h=o.style();r=Gt({},r,n);var d=Object.keys(r).length===0;if(d)return new cw(s[0],r);switch(r.duration===void 0&&(r.duration=400),r.duration){case"slow":r.duration=600;break;case"fast":r.duration=200;break}if(u&&(r.style=h.getPropsList(r.style||r.css),r.css=void 0),u&&r.renderedPosition!=null){var f=r.renderedPosition,p=o.pan(),g=o.zoom();r.position=Tz(f,g,p)}if(l&&r.panBy!=null){var m=r.panBy,v=o.pan();r.pan={x:v.x+m.x,y:v.y+m.y}}var y=r.center||r.centre;if(l&&y!=null){var b=o.getCenterPan(y.eles,r.zoom);b!=null&&(r.pan=b)}if(l&&r.fit!=null){var w=r.fit,T=o.getFitViewport(w.eles||w.boundingBox,w.padding);T!=null&&(r.pan=T.pan,r.zoom=T.zoom)}if(l&&vr(r.zoom)){var E=o.getZoomedViewport(r.zoom);E!=null?(E.zoomed&&(r.zoom=E.zoom),E.panned&&(r.pan=E.pan)):r.zoom=null}return new cw(s[0],r)}},animate:function(){return function(r,n){var i=this,a=i.length!==void 0,s=a?i:[i],o=this._private.cy||this;if(!o.styleEnabled())return this;n&&(r=Gt({},r,n));for(var l=0;l<s.length;l++){var u=s[l],h=u.animated()&&(r.queue===void 0||r.queue),d=u.animation(r,h?{queue:!0}:void 0);d.play()}return this}},stop:function(){return function(r,n){var i=this,a=i.length!==void 0,s=a?i:[i],o=this._private.cy||this;if(!o.styleEnabled())return this;for(var l=0;l<s.length;l++){for(var u=s[l],h=u._private,d=h.animation.current,f=0;f<d.length;f++){var p=d[f],g=p._private;n&&(g.duration=0)}r&&(h.animation.queue=[]),n||(h.animation.current=[])}return o.notify("draw"),this}}},Hb,xA;function D2(){if(xA)return Hb;xA=1;var t=Array.isArray;return Hb=t,Hb}var qb,bA;function Xve(){if(bA)return qb;bA=1;var t=D2(),e=Jp(),r=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,n=/^\w*$/;function i(a,s){if(t(a))return!1;var o=typeof a;return o=="number"||o=="symbol"||o=="boolean"||a==null||e(a)?!0:n.test(a)||!r.test(a)||s!=null&&a in Object(s)}return qb=i,qb}var Yb,wA;function jve(){if(wA)return Yb;wA=1;var t=fz(),e=Qp(),r="[object AsyncFunction]",n="[object Function]",i="[object GeneratorFunction]",a="[object Proxy]";function s(o){if(!e(o))return!1;var l=t(o);return l==n||l==i||l==r||l==a}return Yb=s,Yb}var Xb,TA;function Kve(){if(TA)return Xb;TA=1;var t=_2(),e=t["__core-js_shared__"];return Xb=e,Xb}var jb,EA;function Zve(){if(EA)return jb;EA=1;var t=Kve(),e=function(){var n=/[^.]+$/.exec(t&&t.keys&&t.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""}();function r(n){return!!e&&e in n}return jb=r,jb}var Kb,kA;function Qve(){if(kA)return Kb;kA=1;var t=Function.prototype,e=t.toString;function r(n){if(n!=null){try{return e.call(n)}catch{}try{return n+""}catch{}}return""}return Kb=r,Kb}var Zb,SA;function Jve(){if(SA)return Zb;SA=1;var t=jve(),e=Zve(),r=Qp(),n=Qve(),i=/[\\^$.*+?()[\]{}|]/g,a=/^\[object .+?Constructor\]$/,s=Function.prototype,o=Object.prototype,l=s.toString,u=o.hasOwnProperty,h=RegExp("^"+l.call(u).replace(i,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function d(f){if(!r(f)||e(f))return!1;var p=t(f)?h:a;return p.test(n(f))}return Zb=d,Zb}var Qb,CA;function eye(){if(CA)return Qb;CA=1;function t(e,r){return e?.[r]}return Qb=t,Qb}var Jb,AA;function QE(){if(AA)return Jb;AA=1;var t=Jve(),e=eye();function r(n,i){var a=e(n,i);return t(a)?a:void 0}return Jb=r,Jb}var e4,_A;function M2(){if(_A)return e4;_A=1;var t=QE(),e=t(Object,"create");return e4=e,e4}var t4,LA;function tye(){if(LA)return t4;LA=1;var t=M2();function e(){this.__data__=t?t(null):{},this.size=0}return t4=e,t4}var r4,RA;function rye(){if(RA)return r4;RA=1;function t(e){var r=this.has(e)&&delete this.__data__[e];return this.size-=r?1:0,r}return r4=t,r4}var n4,NA;function nye(){if(NA)return n4;NA=1;var t=M2(),e="__lodash_hash_undefined__",r=Object.prototype,n=r.hasOwnProperty;function i(a){var s=this.__data__;if(t){var o=s[a];return o===e?void 0:o}return n.call(s,a)?s[a]:void 0}return n4=i,n4}var i4,DA;function iye(){if(DA)return i4;DA=1;var t=M2(),e=Object.prototype,r=e.hasOwnProperty;function n(i){var a=this.__data__;return t?a[i]!==void 0:r.call(a,i)}return i4=n,i4}var a4,MA;function aye(){if(MA)return a4;MA=1;var t=M2(),e="__lodash_hash_undefined__";function r(n,i){var a=this.__data__;return this.size+=this.has(n)?0:1,a[n]=t&&i===void 0?e:i,this}return a4=r,a4}var s4,IA;function sye(){if(IA)return s4;IA=1;var t=tye(),e=rye(),r=nye(),n=iye(),i=aye();function a(s){var o=-1,l=s==null?0:s.length;for(this.clear();++o<l;){var u=s[o];this.set(u[0],u[1])}}return a.prototype.clear=t,a.prototype.delete=e,a.prototype.get=r,a.prototype.has=n,a.prototype.set=i,s4=a,s4}var o4,OA;function oye(){if(OA)return o4;OA=1;function t(){this.__data__=[],this.size=0}return o4=t,o4}var l4,PA;function Fz(){if(PA)return l4;PA=1;function t(e,r){return e===r||e!==e&&r!==r}return l4=t,l4}var c4,BA;function I2(){if(BA)return c4;BA=1;var t=Fz();function e(r,n){for(var i=r.length;i--;)if(t(r[i][0],n))return i;return-1}return c4=e,c4}var u4,FA;function lye(){if(FA)return u4;FA=1;var t=I2(),e=Array.prototype,r=e.splice;function n(i){var a=this.__data__,s=t(a,i);if(s<0)return!1;var o=a.length-1;return s==o?a.pop():r.call(a,s,1),--this.size,!0}return u4=n,u4}var h4,$A;function cye(){if($A)return h4;$A=1;var t=I2();function e(r){var n=this.__data__,i=t(n,r);return i<0?void 0:n[i][1]}return h4=e,h4}var d4,zA;function uye(){if(zA)return d4;zA=1;var t=I2();function e(r){return t(this.__data__,r)>-1}return d4=e,d4}var f4,VA;function hye(){if(VA)return f4;VA=1;var t=I2();function e(r,n){var i=this.__data__,a=t(i,r);return a<0?(++this.size,i.push([r,n])):i[a][1]=n,this}return f4=e,f4}var p4,GA;function dye(){if(GA)return p4;GA=1;var t=oye(),e=lye(),r=cye(),n=uye(),i=hye();function a(s){var o=-1,l=s==null?0:s.length;for(this.clear();++o<l;){var u=s[o];this.set(u[0],u[1])}}return a.prototype.clear=t,a.prototype.delete=e,a.prototype.get=r,a.prototype.has=n,a.prototype.set=i,p4=a,p4}var g4,UA;function fye(){if(UA)return g4;UA=1;var t=QE(),e=_2(),r=t(e,"Map");return g4=r,g4}var m4,WA;function pye(){if(WA)return m4;WA=1;var t=sye(),e=dye(),r=fye();function n(){this.size=0,this.__data__={hash:new t,map:new(r||e),string:new t}}return m4=n,m4}var v4,HA;function gye(){if(HA)return v4;HA=1;function t(e){var r=typeof e;return r=="string"||r=="number"||r=="symbol"||r=="boolean"?e!=="__proto__":e===null}return v4=t,v4}var y4,qA;function O2(){if(qA)return y4;qA=1;var t=gye();function e(r,n){var i=r.__data__;return t(n)?i[typeof n=="string"?"string":"hash"]:i.map}return y4=e,y4}var x4,YA;function mye(){if(YA)return x4;YA=1;var t=O2();function e(r){var n=t(this,r).delete(r);return this.size-=n?1:0,n}return x4=e,x4}var b4,XA;function vye(){if(XA)return b4;XA=1;var t=O2();function e(r){return t(this,r).get(r)}return b4=e,b4}var w4,jA;function yye(){if(jA)return w4;jA=1;var t=O2();function e(r){return t(this,r).has(r)}return w4=e,w4}var T4,KA;function xye(){if(KA)return T4;KA=1;var t=O2();function e(r,n){var i=t(this,r),a=i.size;return i.set(r,n),this.size+=i.size==a?0:1,this}return T4=e,T4}var E4,ZA;function bye(){if(ZA)return E4;ZA=1;var t=pye(),e=mye(),r=vye(),n=yye(),i=xye();function a(s){var o=-1,l=s==null?0:s.length;for(this.clear();++o<l;){var u=s[o];this.set(u[0],u[1])}}return a.prototype.clear=t,a.prototype.delete=e,a.prototype.get=r,a.prototype.has=n,a.prototype.set=i,E4=a,E4}var k4,QA;function wye(){if(QA)return k4;QA=1;var t=bye(),e="Expected a function";function r(n,i){if(typeof n!="function"||i!=null&&typeof i!="function")throw new TypeError(e);var a=function(){var s=arguments,o=i?i.apply(this,s):s[0],l=a.cache;if(l.has(o))return l.get(o);var u=n.apply(this,s);return a.cache=l.set(o,u)||l,u};return a.cache=new(r.Cache||t),a}return r.Cache=t,k4=r,k4}var S4,JA;function Tye(){if(JA)return S4;JA=1;var t=wye(),e=500;function r(n){var i=t(n,function(s){return a.size===e&&a.clear(),s}),a=i.cache;return i}return S4=r,S4}var C4,e_;function $z(){if(e_)return C4;e_=1;var t=Tye(),e=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,r=/\\(\\)?/g,n=t(function(i){var a=[];return i.charCodeAt(0)===46&&a.push(""),i.replace(e,function(s,o,l,u){a.push(l?u.replace(r,"$1"):o||s)}),a});return C4=n,C4}var A4,t_;function zz(){if(t_)return A4;t_=1;function t(e,r){for(var n=-1,i=e==null?0:e.length,a=Array(i);++n<i;)a[n]=r(e[n],n,e);return a}return A4=t,A4}var _4,r_;function Eye(){if(r_)return _4;r_=1;var t=UE(),e=zz(),r=D2(),n=Jp(),i=t?t.prototype:void 0,a=i?i.toString:void 0;function s(o){if(typeof o=="string")return o;if(r(o))return e(o,s)+"";if(n(o))return a?a.call(o):"";var l=o+"";return l=="0"&&1/o==-1/0?"-0":l}return _4=s,_4}var L4,n_;function Vz(){if(n_)return L4;n_=1;var t=Eye();function e(r){return r==null?"":t(r)}return L4=e,L4}var R4,i_;function Gz(){if(i_)return R4;i_=1;var t=D2(),e=Xve(),r=$z(),n=Vz();function i(a,s){return t(a)?a:e(a,s)?[a]:r(n(a))}return R4=i,R4}var N4,a_;function JE(){if(a_)return N4;a_=1;var t=Jp();function e(r){if(typeof r=="string"||t(r))return r;var n=r+"";return n=="0"&&1/r==-1/0?"-0":n}return N4=e,N4}var D4,s_;function kye(){if(s_)return D4;s_=1;var t=Gz(),e=JE();function r(n,i){i=t(i,n);for(var a=0,s=i.length;n!=null&&a<s;)n=n[e(i[a++])];return a&&a==s?n:void 0}return D4=r,D4}var M4,o_;function Sye(){if(o_)return M4;o_=1;var t=kye();function e(r,n,i){var a=r==null?void 0:t(r,n);return a===void 0?i:a}return M4=e,M4}var Cye=Sye(),Aye=Zp(Cye),I4,l_;function _ye(){if(l_)return I4;l_=1;var t=QE(),e=function(){try{var r=t(Object,"defineProperty");return r({},"",{}),r}catch{}}();return I4=e,I4}var O4,c_;function Lye(){if(c_)return O4;c_=1;var t=_ye();function e(r,n,i){n=="__proto__"&&t?t(r,n,{configurable:!0,enumerable:!0,value:i,writable:!0}):r[n]=i}return O4=e,O4}var P4,u_;function Rye(){if(u_)return P4;u_=1;var t=Lye(),e=Fz(),r=Object.prototype,n=r.hasOwnProperty;function i(a,s,o){var l=a[s];(!(n.call(a,s)&&e(l,o))||o===void 0&&!(s in a))&&t(a,s,o)}return P4=i,P4}var B4,h_;function Nye(){if(h_)return B4;h_=1;var t=9007199254740991,e=/^(?:0|[1-9]\d*)$/;function r(n,i){var a=typeof n;return i=i??t,!!i&&(a=="number"||a!="symbol"&&e.test(n))&&n>-1&&n%1==0&&n<i}return B4=r,B4}var F4,d_;function Dye(){if(d_)return F4;d_=1;var t=Rye(),e=Gz(),r=Nye(),n=Qp(),i=JE();function a(s,o,l,u){if(!n(s))return s;o=e(o,s);for(var h=-1,d=o.length,f=d-1,p=s;p!=null&&++h<d;){var g=i(o[h]),m=l;if(g==="__proto__"||g==="constructor"||g==="prototype")return s;if(h!=f){var v=p[g];m=u?u(v,g,p):void 0,m===void 0&&(m=n(v)?v:r(o[h+1])?[]:{})}t(p,g,m),p=p[g]}return s}return F4=a,F4}var $4,f_;function Mye(){if(f_)return $4;f_=1;var t=Dye();function e(r,n,i){return r==null?r:t(r,n,i)}return $4=e,$4}var Iye=Mye(),Oye=Zp(Iye),z4,p_;function Pye(){if(p_)return z4;p_=1;function t(e,r){var n=-1,i=e.length;for(r||(r=Array(i));++n<i;)r[n]=e[n];return r}return z4=t,z4}var V4,g_;function Bye(){if(g_)return V4;g_=1;var t=zz(),e=Pye(),r=D2(),n=Jp(),i=$z(),a=JE(),s=Vz();function o(l){return r(l)?t(l,a):n(l)?[l]:e(i(s(l)))}return V4=o,V4}var Fye=Bye(),$ye=Zp(Fye),zye={data:function(e){var r={field:"data",bindingEvent:"data",allowBinding:!1,allowSetting:!1,allowGetting:!1,settingEvent:"data",settingTriggersEvent:!1,triggerFnName:"trigger",immutableKeys:{},updateStyle:!1,beforeGet:function(i){},beforeSet:function(i,a){},onSet:function(i){},canSet:function(i){return!0}};return e=Gt({},r,e),function(i,a){var s=e,o=this,l=o.length!==void 0,u=l?o:[o],h=l?o[0]:o;if(Bt(i)){var d=i.indexOf(".")!==-1,f=d&&$ye(i);if(s.allowGetting&&a===void 0){var p;return h&&(s.beforeGet(h),f&&h._private[s.field][i]===void 0?p=Aye(h._private[s.field],f):p=h._private[s.field][i]),p}else if(s.allowSetting&&a!==void 0){var g=!s.immutableKeys[i];if(g){var m=nz({},i,a);s.beforeSet(o,m);for(var v=0,y=u.length;v<y;v++){var b=u[v];s.canSet(b)&&(f&&h._private[s.field][i]===void 0?Oye(b._private[s.field],f,a):b._private[s.field][i]=a)}s.updateStyle&&o.updateStyle(),s.onSet(o),s.settingTriggersEvent&&o[s.triggerFnName](s.settingEvent)}}}else if(s.allowSetting&&vr(i)){var w=i,T,E,L=Object.keys(w);s.beforeSet(o,w);for(var S=0;S<L.length;S++){T=L[S],E=w[T];var C=!s.immutableKeys[T];if(C)for(var A=0;A<u.length;A++){var N=u[A];s.canSet(N)&&(N._private[s.field][T]=E)}}s.updateStyle&&o.updateStyle(),s.onSet(o),s.settingTriggersEvent&&o[s.triggerFnName](s.settingEvent)}else if(s.allowBinding&&nn(i)){var _=i;o.on(s.bindingEvent,_)}else if(s.allowGetting&&i===void 0){var O;return h&&(s.beforeGet(h),O=h._private[s.field]),O}return o}},removeData:function(e){var r={field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!1,immutableKeys:{}};return e=Gt({},r,e),function(i){var a=e,s=this,o=s.length!==void 0,l=o?s:[s];if(Bt(i)){for(var u=i.split(/\s+/),h=u.length,d=0;d<h;d++){var f=u[d];if(!Vl(f)){var p=!a.immutableKeys[f];if(p)for(var g=0,m=l.length;g<m;g++)l[g]._private[a.field][f]=void 0}}a.triggerEvent&&s[a.triggerFnName](a.event)}else if(i===void 0){for(var v=0,y=l.length;v<y;v++)for(var b=l[v]._private[a.field],w=Object.keys(b),T=0;T<w.length;T++){var E=w[T],L=!a.immutableKeys[E];L&&(b[E]=void 0)}a.triggerEvent&&s[a.triggerFnName](a.event)}return s}}},Vye={eventAliasesOn:function(e){var r=e;r.addListener=r.listen=r.bind=r.on,r.unlisten=r.unbind=r.off=r.removeListener,r.trigger=r.emit,r.pon=r.promiseOn=function(n,i){var a=this,s=Array.prototype.slice.call(arguments,0);return new Nd(function(o,l){var u=function(p){a.off.apply(a,d),o(p)},h=s.concat([u]),d=h.concat([]);a.on.apply(a,h)})}}},_r={};[Yve,zye,Vye].forEach(function(t){Gt(_r,t)});var Gye={animate:_r.animate(),animation:_r.animation(),animated:_r.animated(),clearQueue:_r.clearQueue(),delay:_r.delay(),delayAnimation:_r.delayAnimation(),stop:_r.stop()},rm={classes:function(e){var r=this;if(e===void 0){var n=[];return r[0]._private.classes.forEach(function(g){return n.push(g)}),n}else Br(e)||(e=(e||"").match(/\S+/g)||[]);for(var i=[],a=new Rd(e),s=0;s<r.length;s++){for(var o=r[s],l=o._private,u=l.classes,h=!1,d=0;d<e.length;d++){var f=e[d],p=u.has(f);if(!p){h=!0;break}}h||(h=u.size!==e.length),h&&(l.classes=a,i.push(o))}return i.length>0&&this.spawn(i).updateStyle().emit("class"),r},addClass:function(e){return this.toggleClass(e,!0)},hasClass:function(e){var r=this[0];return r!=null&&r._private.classes.has(e)},toggleClass:function(e,r){Br(e)||(e=e.match(/\S+/g)||[]);for(var n=this,i=r===void 0,a=[],s=0,o=n.length;s<o;s++)for(var l=n[s],u=l._private.classes,h=!1,d=0;d<e.length;d++){var f=e[d],p=u.has(f),g=!1;r||i&&!p?(u.add(f),g=!0):(!r||i&&p)&&(u.delete(f),g=!0),!h&&g&&(a.push(l),h=!0)}return a.length>0&&this.spawn(a).updateStyle().emit("class"),n},removeClass:function(e){return this.toggleClass(e,!1)},flashClass:function(e,r){var n=this;if(r==null)r=250;else if(r===0)return n;return n.addClass(e),setTimeout(function(){n.removeClass(e)},r),n}};rm.className=rm.classNames=rm.classes;var mr={metaChar:"[\\!\\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\]\\^\\`\\{\\|\\}\\~]",comparatorOp:"=|\\!=|>|>=|<|<=|\\$=|\\^=|\\*=",boolOp:"\\?|\\!|\\^",string:`"(?:\\\\"|[^"])*"|'(?:\\\\'|[^'])*'`,number:Pn,meta:"degree|indegree|outdegree",separator:"\\s*,\\s*",descendant:"\\s+",child:"\\s+>\\s+",subject:"\\$",group:"node|edge|\\*",directedEdge:"\\s+->\\s+",undirectedEdge:"\\s+<->\\s+"};mr.variable="(?:[\\w-.]|(?:\\\\"+mr.metaChar+"))+";mr.className="(?:[\\w-]|(?:\\\\"+mr.metaChar+"))+";mr.value=mr.string+"|"+mr.number;mr.id=mr.variable;(function(){var t,e,r;for(t=mr.comparatorOp.split("|"),r=0;r<t.length;r++)e=t[r],mr.comparatorOp+="|@"+e;for(t=mr.comparatorOp.split("|"),r=0;r<t.length;r++)e=t[r],!(e.indexOf("!")>=0)&&e!=="="&&(mr.comparatorOp+="|\\!"+e)})();var Or=function(){return{checks:[]}},Lt={GROUP:0,COLLECTION:1,FILTER:2,DATA_COMPARE:3,DATA_EXIST:4,DATA_BOOL:5,META_COMPARE:6,STATE:7,ID:8,CLASS:9,UNDIRECTED_EDGE:10,DIRECTED_EDGE:11,NODE_SOURCE:12,NODE_TARGET:13,NODE_NEIGHBOR:14,CHILD:15,DESCENDANT:16,PARENT:17,ANCESTOR:18,COMPOUND_SPLIT:19,TRUE:20},uw=[{selector:":selected",matches:function(e){return e.selected()}},{selector:":unselected",matches:function(e){return!e.selected()}},{selector:":selectable",matches:function(e){return e.selectable()}},{selector:":unselectable",matches:function(e){return!e.selectable()}},{selector:":locked",matches:function(e){return e.locked()}},{selector:":unlocked",matches:function(e){return!e.locked()}},{selector:":visible",matches:function(e){return e.visible()}},{selector:":hidden",matches:function(e){return!e.visible()}},{selector:":transparent",matches:function(e){return e.transparent()}},{selector:":grabbed",matches:function(e){return e.grabbed()}},{selector:":free",matches:function(e){return!e.grabbed()}},{selector:":removed",matches:function(e){return e.removed()}},{selector:":inside",matches:function(e){return!e.removed()}},{selector:":grabbable",matches:function(e){return e.grabbable()}},{selector:":ungrabbable",matches:function(e){return!e.grabbable()}},{selector:":animated",matches:function(e){return e.animated()}},{selector:":unanimated",matches:function(e){return!e.animated()}},{selector:":parent",matches:function(e){return e.isParent()}},{selector:":childless",matches:function(e){return e.isChildless()}},{selector:":child",matches:function(e){return e.isChild()}},{selector:":orphan",matches:function(e){return e.isOrphan()}},{selector:":nonorphan",matches:function(e){return e.isChild()}},{selector:":compound",matches:function(e){return e.isNode()?e.isParent():e.source().isParent()||e.target().isParent()}},{selector:":loop",matches:function(e){return e.isLoop()}},{selector:":simple",matches:function(e){return e.isSimple()}},{selector:":active",matches:function(e){return e.active()}},{selector:":inactive",matches:function(e){return!e.active()}},{selector:":backgrounding",matches:function(e){return e.backgrounding()}},{selector:":nonbackgrounding",matches:function(e){return!e.backgrounding()}}].sort(function(t,e){return z1e(t.selector,e.selector)}),Uye=function(){for(var t={},e,r=0;r<uw.length;r++)e=uw[r],t[e.selector]=e.matches;return t}(),Wye=function(e,r){return Uye[e](r)},Hye="("+uw.map(function(t){return t.selector}).join("|")+")",Ku=function(e){return e.replace(new RegExp("\\\\("+mr.metaChar+")","g"),function(r,n){return n})},dl=function(e,r,n){e[e.length-1]=n},hw=[{name:"group",query:!0,regex:"("+mr.group+")",populate:function(e,r,n){var i=Tn(n,1),a=i[0];r.checks.push({type:Lt.GROUP,value:a==="*"?a:a+"s"})}},{name:"state",query:!0,regex:Hye,populate:function(e,r,n){var i=Tn(n,1),a=i[0];r.checks.push({type:Lt.STATE,value:a})}},{name:"id",query:!0,regex:"\\#("+mr.id+")",populate:function(e,r,n){var i=Tn(n,1),a=i[0];r.checks.push({type:Lt.ID,value:Ku(a)})}},{name:"className",query:!0,regex:"\\.("+mr.className+")",populate:function(e,r,n){var i=Tn(n,1),a=i[0];r.checks.push({type:Lt.CLASS,value:Ku(a)})}},{name:"dataExists",query:!0,regex:"\\[\\s*("+mr.variable+")\\s*\\]",populate:function(e,r,n){var i=Tn(n,1),a=i[0];r.checks.push({type:Lt.DATA_EXIST,field:Ku(a)})}},{name:"dataCompare",query:!0,regex:"\\[\\s*("+mr.variable+")\\s*("+mr.comparatorOp+")\\s*("+mr.value+")\\s*\\]",populate:function(e,r,n){var i=Tn(n,3),a=i[0],s=i[1],o=i[2],l=new RegExp("^"+mr.string+"$").exec(o)!=null;l?o=o.substring(1,o.length-1):o=parseFloat(o),r.checks.push({type:Lt.DATA_COMPARE,field:Ku(a),operator:s,value:o})}},{name:"dataBool",query:!0,regex:"\\[\\s*("+mr.boolOp+")\\s*("+mr.variable+")\\s*\\]",populate:function(e,r,n){var i=Tn(n,2),a=i[0],s=i[1];r.checks.push({type:Lt.DATA_BOOL,field:Ku(s),operator:a})}},{name:"metaCompare",query:!0,regex:"\\[\\[\\s*("+mr.meta+")\\s*("+mr.comparatorOp+")\\s*("+mr.number+")\\s*\\]\\]",populate:function(e,r,n){var i=Tn(n,3),a=i[0],s=i[1],o=i[2];r.checks.push({type:Lt.META_COMPARE,field:Ku(a),operator:s,value:parseFloat(o)})}},{name:"nextQuery",separator:!0,regex:mr.separator,populate:function(e,r){var n=e.currentSubject,i=e.edgeCount,a=e.compoundCount,s=e[e.length-1];n!=null&&(s.subject=n,e.currentSubject=null),s.edgeCount=i,s.compoundCount=a,e.edgeCount=0,e.compoundCount=0;var o=e[e.length++]=Or();return o}},{name:"directedEdge",separator:!0,regex:mr.directedEdge,populate:function(e,r){if(e.currentSubject==null){var n=Or(),i=r,a=Or();return n.checks.push({type:Lt.DIRECTED_EDGE,source:i,target:a}),dl(e,r,n),e.edgeCount++,a}else{var s=Or(),o=r,l=Or();return s.checks.push({type:Lt.NODE_SOURCE,source:o,target:l}),dl(e,r,s),e.edgeCount++,l}}},{name:"undirectedEdge",separator:!0,regex:mr.undirectedEdge,populate:function(e,r){if(e.currentSubject==null){var n=Or(),i=r,a=Or();return n.checks.push({type:Lt.UNDIRECTED_EDGE,nodes:[i,a]}),dl(e,r,n),e.edgeCount++,a}else{var s=Or(),o=r,l=Or();return s.checks.push({type:Lt.NODE_NEIGHBOR,node:o,neighbor:l}),dl(e,r,s),l}}},{name:"child",separator:!0,regex:mr.child,populate:function(e,r){if(e.currentSubject==null){var n=Or(),i=Or(),a=e[e.length-1];return n.checks.push({type:Lt.CHILD,parent:a,child:i}),dl(e,r,n),e.compoundCount++,i}else if(e.currentSubject===r){var s=Or(),o=e[e.length-1],l=Or(),u=Or(),h=Or(),d=Or();return s.checks.push({type:Lt.COMPOUND_SPLIT,left:o,right:l,subject:u}),u.checks=r.checks,r.checks=[{type:Lt.TRUE}],d.checks.push({type:Lt.TRUE}),l.checks.push({type:Lt.PARENT,parent:d,child:h}),dl(e,o,s),e.currentSubject=u,e.compoundCount++,h}else{var f=Or(),p=Or(),g=[{type:Lt.PARENT,parent:f,child:p}];return f.checks=r.checks,r.checks=g,e.compoundCount++,p}}},{name:"descendant",separator:!0,regex:mr.descendant,populate:function(e,r){if(e.currentSubject==null){var n=Or(),i=Or(),a=e[e.length-1];return n.checks.push({type:Lt.DESCENDANT,ancestor:a,descendant:i}),dl(e,r,n),e.compoundCount++,i}else if(e.currentSubject===r){var s=Or(),o=e[e.length-1],l=Or(),u=Or(),h=Or(),d=Or();return s.checks.push({type:Lt.COMPOUND_SPLIT,left:o,right:l,subject:u}),u.checks=r.checks,r.checks=[{type:Lt.TRUE}],d.checks.push({type:Lt.TRUE}),l.checks.push({type:Lt.ANCESTOR,ancestor:d,descendant:h}),dl(e,o,s),e.currentSubject=u,e.compoundCount++,h}else{var f=Or(),p=Or(),g=[{type:Lt.ANCESTOR,ancestor:f,descendant:p}];return f.checks=r.checks,r.checks=g,e.compoundCount++,p}}},{name:"subject",modifier:!0,regex:mr.subject,populate:function(e,r){if(e.currentSubject!=null&&e.currentSubject!==r)return Nr("Redefinition of subject in selector `"+e.toString()+"`"),!1;e.currentSubject=r;var n=e[e.length-1],i=n.checks[0],a=i==null?null:i.type;a===Lt.DIRECTED_EDGE?i.type=Lt.NODE_TARGET:a===Lt.UNDIRECTED_EDGE&&(i.type=Lt.NODE_NEIGHBOR,i.node=i.nodes[1],i.neighbor=i.nodes[0],i.nodes=null)}}];hw.forEach(function(t){return t.regexObj=new RegExp("^"+t.regex)});var qye=function(e){for(var r,n,i,a=0;a<hw.length;a++){var s=hw[a],o=s.name,l=e.match(s.regexObj);if(l!=null){n=l,r=s,i=o;var u=l[0];e=e.substring(u.length);break}}return{expr:r,match:n,name:i,remaining:e}},Yye=function(e){var r=e.match(/^\s+/);if(r){var n=r[0];e=e.substring(n.length)}return e},Xye=function(e){var r=this,n=r.inputText=e,i=r[0]=Or();for(r.length=1,n=Yye(n);;){var a=qye(n);if(a.expr==null)return Nr("The selector `"+e+"`is invalid"),!1;var s=a.match.slice(1),o=a.expr.populate(r,i,s);if(o===!1)return!1;if(o!=null&&(i=o),n=a.remaining,n.match(/^\s*$/))break}var l=r[r.length-1];r.currentSubject!=null&&(l.subject=r.currentSubject),l.edgeCount=r.edgeCount,l.compoundCount=r.compoundCount;for(var u=0;u<r.length;u++){var h=r[u];if(h.compoundCount>0&&h.edgeCount>0)return Nr("The selector `"+e+"` is invalid because it uses both a compound selector and an edge selector"),!1;if(h.edgeCount>1)return Nr("The selector `"+e+"` is invalid because it uses multiple edge selectors"),!1;h.edgeCount===1&&Nr("The selector `"+e+"` is deprecated.  Edge selectors do not take effect on changes to source and target nodes after an edge is added, for performance reasons.  Use a class or data selector on edges instead, updating the class or data of an edge when your app detects a change in source or target nodes.")}return!0},jye=function(){if(this.toStringCache!=null)return this.toStringCache;for(var e=function(h){return h??""},r=function(h){return Bt(h)?'"'+h+'"':e(h)},n=function(h){return" "+h+" "},i=function(h,d){var f=h.type,p=h.value;switch(f){case Lt.GROUP:{var g=e(p);return g.substring(0,g.length-1)}case Lt.DATA_COMPARE:{var m=h.field,v=h.operator;return"["+m+n(e(v))+r(p)+"]"}case Lt.DATA_BOOL:{var y=h.operator,b=h.field;return"["+e(y)+b+"]"}case Lt.DATA_EXIST:{var w=h.field;return"["+w+"]"}case Lt.META_COMPARE:{var T=h.operator,E=h.field;return"[["+E+n(e(T))+r(p)+"]]"}case Lt.STATE:return p;case Lt.ID:return"#"+p;case Lt.CLASS:return"."+p;case Lt.PARENT:case Lt.CHILD:return a(h.parent,d)+n(">")+a(h.child,d);case Lt.ANCESTOR:case Lt.DESCENDANT:return a(h.ancestor,d)+" "+a(h.descendant,d);case Lt.COMPOUND_SPLIT:{var L=a(h.left,d),S=a(h.subject,d),C=a(h.right,d);return L+(L.length>0?" ":"")+S+C}case Lt.TRUE:return""}},a=function(h,d){return h.checks.reduce(function(f,p,g){return f+(d===h&&g===0?"$":"")+i(p,d)},"")},s="",o=0;o<this.length;o++){var l=this[o];s+=a(l,l.subject),this.length>1&&o<this.length-1&&(s+=", ")}return this.toStringCache=s,s},Kye={parse:Xye,toString:jye},Uz=function(e,r,n){var i,a=Bt(e),s=vt(e),o=Bt(n),l,u,h=!1,d=!1,f=!1;switch(r.indexOf("!")>=0&&(r=r.replace("!",""),d=!0),r.indexOf("@")>=0&&(r=r.replace("@",""),h=!0),(a||o||h)&&(l=!a&&!s?"":""+e,u=""+n),h&&(e=l=l.toLowerCase(),n=u=u.toLowerCase()),r){case"*=":i=l.indexOf(u)>=0;break;case"$=":i=l.indexOf(u,l.length-u.length)>=0;break;case"^=":i=l.indexOf(u)===0;break;case"=":i=e===n;break;case">":f=!0,i=e>n;break;case">=":f=!0,i=e>=n;break;case"<":f=!0,i=e<n;break;case"<=":f=!0,i=e<=n;break;default:i=!1;break}return d&&(e!=null||!f)&&(i=!i),i},Zye=function(e,r){switch(r){case"?":return!!e;case"!":return!e;case"^":return e===void 0}},Qye=function(e){return e!==void 0},ek=function(e,r){return e.data(r)},Jye=function(e,r){return e[r]()},hn=[],Hr=function(e,r){return e.checks.every(function(n){return hn[n.type](n,r)})};hn[Lt.GROUP]=function(t,e){var r=t.value;return r==="*"||r===e.group()};hn[Lt.STATE]=function(t,e){var r=t.value;return Wye(r,e)};hn[Lt.ID]=function(t,e){var r=t.value;return e.id()===r};hn[Lt.CLASS]=function(t,e){var r=t.value;return e.hasClass(r)};hn[Lt.META_COMPARE]=function(t,e){var r=t.field,n=t.operator,i=t.value;return Uz(Jye(e,r),n,i)};hn[Lt.DATA_COMPARE]=function(t,e){var r=t.field,n=t.operator,i=t.value;return Uz(ek(e,r),n,i)};hn[Lt.DATA_BOOL]=function(t,e){var r=t.field,n=t.operator;return Zye(ek(e,r),n)};hn[Lt.DATA_EXIST]=function(t,e){var r=t.field;return t.operator,Qye(ek(e,r))};hn[Lt.UNDIRECTED_EDGE]=function(t,e){var r=t.nodes[0],n=t.nodes[1],i=e.source(),a=e.target();return Hr(r,i)&&Hr(n,a)||Hr(n,i)&&Hr(r,a)};hn[Lt.NODE_NEIGHBOR]=function(t,e){return Hr(t.node,e)&&e.neighborhood().some(function(r){return r.isNode()&&Hr(t.neighbor,r)})};hn[Lt.DIRECTED_EDGE]=function(t,e){return Hr(t.source,e.source())&&Hr(t.target,e.target())};hn[Lt.NODE_SOURCE]=function(t,e){return Hr(t.source,e)&&e.outgoers().some(function(r){return r.isNode()&&Hr(t.target,r)})};hn[Lt.NODE_TARGET]=function(t,e){return Hr(t.target,e)&&e.incomers().some(function(r){return r.isNode()&&Hr(t.source,r)})};hn[Lt.CHILD]=function(t,e){return Hr(t.child,e)&&Hr(t.parent,e.parent())};hn[Lt.PARENT]=function(t,e){return Hr(t.parent,e)&&e.children().some(function(r){return Hr(t.child,r)})};hn[Lt.DESCENDANT]=function(t,e){return Hr(t.descendant,e)&&e.ancestors().some(function(r){return Hr(t.ancestor,r)})};hn[Lt.ANCESTOR]=function(t,e){return Hr(t.ancestor,e)&&e.descendants().some(function(r){return Hr(t.descendant,r)})};hn[Lt.COMPOUND_SPLIT]=function(t,e){return Hr(t.subject,e)&&Hr(t.left,e)&&Hr(t.right,e)};hn[Lt.TRUE]=function(){return!0};hn[Lt.COLLECTION]=function(t,e){var r=t.value;return r.has(e)};hn[Lt.FILTER]=function(t,e){var r=t.value;return r(e)};var e2e=function(e){var r=this;if(r.length===1&&r[0].checks.length===1&&r[0].checks[0].type===Lt.ID)return e.getElementById(r[0].checks[0].value).collection();var n=function(a){for(var s=0;s<r.length;s++){var o=r[s];if(Hr(o,a))return!0}return!1};return r.text()==null&&(n=function(){return!0}),e.filter(n)},t2e=function(e){for(var r=this,n=0;n<r.length;n++){var i=r[n];if(Hr(i,e))return!0}return!1},r2e={matches:t2e,filter:e2e},Wl=function(e){this.inputText=e,this.currentSubject=null,this.compoundCount=0,this.edgeCount=0,this.length=0,e==null||Bt(e)&&e.match(/^\s*$/)||(Aa(e)?this.addQuery({checks:[{type:Lt.COLLECTION,value:e.collection()}]}):nn(e)?this.addQuery({checks:[{type:Lt.FILTER,value:e}]}):Bt(e)?this.parse(e)||(this.invalid=!0):Kr("A selector must be created from a string; found "))},Hl=Wl.prototype;[Kye,r2e].forEach(function(t){return Gt(Hl,t)});Hl.text=function(){return this.inputText};Hl.size=function(){return this.length};Hl.eq=function(t){return this[t]};Hl.sameText=function(t){return!this.invalid&&!t.invalid&&this.text()===t.text()};Hl.addQuery=function(t){this[this.length++]=t};Hl.selector=Hl.toString;var Ll={allAre:function(e){var r=new Wl(e);return this.every(function(n){return r.matches(n)})},is:function(e){var r=new Wl(e);return this.some(function(n){return r.matches(n)})},some:function(e,r){for(var n=0;n<this.length;n++){var i=r?e.apply(r,[this[n],n,this]):e(this[n],n,this);if(i)return!0}return!1},every:function(e,r){for(var n=0;n<this.length;n++){var i=r?e.apply(r,[this[n],n,this]):e(this[n],n,this);if(!i)return!1}return!0},same:function(e){if(this===e)return!0;e=this.cy().collection(e);var r=this.length,n=e.length;return r!==n?!1:r===1?this[0]===e[0]:this.every(function(i){return e.hasElementWithId(i.id())})},anySame:function(e){return e=this.cy().collection(e),this.some(function(r){return e.hasElementWithId(r.id())})},allAreNeighbors:function(e){e=this.cy().collection(e);var r=this.neighborhood();return e.every(function(n){return r.hasElementWithId(n.id())})},contains:function(e){e=this.cy().collection(e);var r=this;return e.every(function(n){return r.hasElementWithId(n.id())})}};Ll.allAreNeighbours=Ll.allAreNeighbors;Ll.has=Ll.contains;Ll.equal=Ll.equals=Ll.same;var Xa=function(e,r){return function(i,a,s,o){var l=i,u=this,h;if(l==null?h="":Aa(l)&&l.length===1&&(h=l.id()),u.length===1&&h){var d=u[0]._private,f=d.traversalCache=d.traversalCache||{},p=f[r]=f[r]||[],g=du(h),m=p[g];return m||(p[g]=e.call(u,i,a,s,o))}else return e.call(u,i,a,s,o)}},od={parent:function(e){var r=[];if(this.length===1){var n=this[0]._private.parent;if(n)return n}for(var i=0;i<this.length;i++){var a=this[i],s=a._private.parent;s&&r.push(s)}return this.spawn(r,!0).filter(e)},parents:function(e){for(var r=[],n=this.parent();n.nonempty();){for(var i=0;i<n.length;i++){var a=n[i];r.push(a)}n=n.parent()}return this.spawn(r,!0).filter(e)},commonAncestors:function(e){for(var r,n=0;n<this.length;n++){var i=this[n],a=i.parents();r=r||a,r=r.intersect(a)}return r.filter(e)},orphans:function(e){return this.stdFilter(function(r){return r.isOrphan()}).filter(e)},nonorphans:function(e){return this.stdFilter(function(r){return r.isChild()}).filter(e)},children:Xa(function(t){for(var e=[],r=0;r<this.length;r++)for(var n=this[r],i=n._private.children,a=0;a<i.length;a++)e.push(i[a]);return this.spawn(e,!0).filter(t)},"children"),siblings:function(e){return this.parent().children().not(this).filter(e)},isParent:function(){var e=this[0];if(e)return e.isNode()&&e._private.children.length!==0},isChildless:function(){var e=this[0];if(e)return e.isNode()&&e._private.children.length===0},isChild:function(){var e=this[0];if(e)return e.isNode()&&e._private.parent!=null},isOrphan:function(){var e=this[0];if(e)return e.isNode()&&e._private.parent==null},descendants:function(e){var r=[];function n(i){for(var a=0;a<i.length;a++){var s=i[a];r.push(s),s.children().nonempty()&&n(s.children())}}return n(this.children()),this.spawn(r,!0).filter(e)}};function tk(t,e,r,n){for(var i=[],a=new Rd,s=t.cy(),o=s.hasCompoundNodes(),l=0;l<t.length;l++){var u=t[l];r?i.push(u):o&&n(i,a,u)}for(;i.length>0;){var h=i.shift();e(h),a.add(h.id()),o&&n(i,a,h)}return t}function Wz(t,e,r){if(r.isParent())for(var n=r._private.children,i=0;i<n.length;i++){var a=n[i];e.has(a.id())||t.push(a)}}od.forEachDown=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return tk(this,t,e,Wz)};function Hz(t,e,r){if(r.isChild()){var n=r._private.parent;e.has(n.id())||t.push(n)}}od.forEachUp=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return tk(this,t,e,Hz)};function n2e(t,e,r){Hz(t,e,r),Wz(t,e,r)}od.forEachUpAndDown=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return tk(this,t,e,n2e)};od.ancestors=od.parents;var lp,qz;lp=qz={data:_r.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),removeData:_r.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),scratch:_r.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:_r.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),rscratch:_r.data({field:"rscratch",allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!0}),removeRscratch:_r.removeData({field:"rscratch",triggerEvent:!1}),id:function(){var e=this[0];if(e)return e._private.data.id}};lp.attr=lp.data;lp.removeAttr=lp.removeData;var i2e=qz,P2={};function G4(t){return function(e){var r=this;if(e===void 0&&(e=!0),r.length!==0)if(r.isNode()&&!r.removed()){for(var n=0,i=r[0],a=i._private.edges,s=0;s<a.length;s++){var o=a[s];!e&&o.isLoop()||(n+=t(i,o))}return n}else return}}Gt(P2,{degree:G4(function(t,e){return e.source().same(e.target())?2:1}),indegree:G4(function(t,e){return e.target().same(t)?1:0}),outdegree:G4(function(t,e){return e.source().same(t)?1:0})});function Zu(t,e){return function(r){for(var n,i=this.nodes(),a=0;a<i.length;a++){var s=i[a],o=s[t](r);o!==void 0&&(n===void 0||e(o,n))&&(n=o)}return n}}Gt(P2,{minDegree:Zu("degree",function(t,e){return t<e}),maxDegree:Zu("degree",function(t,e){return t>e}),minIndegree:Zu("indegree",function(t,e){return t<e}),maxIndegree:Zu("indegree",function(t,e){return t>e}),minOutdegree:Zu("outdegree",function(t,e){return t<e}),maxOutdegree:Zu("outdegree",function(t,e){return t>e})});Gt(P2,{totalDegree:function(e){for(var r=0,n=this.nodes(),i=0;i<n.length;i++)r+=n[i].degree(e);return r}});var ys,Yz,Xz=function(e,r,n){for(var i=0;i<e.length;i++){var a=e[i];if(!a.locked()){var s=a._private.position,o={x:r.x!=null?r.x-s.x:0,y:r.y!=null?r.y-s.y:0};a.isParent()&&!(o.x===0&&o.y===0)&&a.children().shift(o,n),a.dirtyBoundingBoxCache()}}},m_={field:"position",bindingEvent:"position",allowBinding:!0,allowSetting:!0,settingEvent:"position",settingTriggersEvent:!0,triggerFnName:"emitAndNotify",allowGetting:!0,validKeys:["x","y"],beforeGet:function(e){e.updateCompoundBounds()},beforeSet:function(e,r){Xz(e,r,!1)},onSet:function(e){e.dirtyCompoundBoundsCache()},canSet:function(e){return!e.locked()}};ys=Yz={position:_r.data(m_),silentPosition:_r.data(Gt({},m_,{allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!1,beforeSet:function(e,r){Xz(e,r,!0)},onSet:function(e){e.dirtyCompoundBoundsCache()}})),positions:function(e,r){if(vr(e))r?this.silentPosition(e):this.position(e);else if(nn(e)){var n=e,i=this.cy();i.startBatch();for(var a=0;a<this.length;a++){var s=this[a],o=void 0;(o=n(s,a))&&(r?s.silentPosition(o):s.position(o))}i.endBatch()}return this},silentPositions:function(e){return this.positions(e,!0)},shift:function(e,r,n){var i;if(vr(e)?(i={x:vt(e.x)?e.x:0,y:vt(e.y)?e.y:0},n=r):Bt(e)&&vt(r)&&(i={x:0,y:0},i[e]=r),i!=null){var a=this.cy();a.startBatch();for(var s=0;s<this.length;s++){var o=this[s];if(!(a.hasCompoundNodes()&&o.isChild()&&o.ancestors().anySame(this))){var l=o.position(),u={x:l.x+i.x,y:l.y+i.y};n?o.silentPosition(u):o.position(u)}}a.endBatch()}return this},silentShift:function(e,r){return vr(e)?this.shift(e,!0):Bt(e)&&vt(r)&&this.shift(e,r,!0),this},renderedPosition:function(e,r){var n=this[0],i=this.cy(),a=i.zoom(),s=i.pan(),o=vr(e)?e:void 0,l=o!==void 0||r!==void 0&&Bt(e);if(n&&n.isNode())if(l)for(var u=0;u<this.length;u++){var h=this[u];r!==void 0?h.position(e,(r-s[e])/a):o!==void 0&&h.position(Tz(o,a,s))}else{var d=n.position();return o=R2(d,a,s),e===void 0?o:o[e]}else if(!l)return;return this},relativePosition:function(e,r){var n=this[0],i=this.cy(),a=vr(e)?e:void 0,s=a!==void 0||r!==void 0&&Bt(e),o=i.hasCompoundNodes();if(n&&n.isNode())if(s)for(var l=0;l<this.length;l++){var u=this[l],h=o?u.parent():null,d=h&&h.length>0,f=d;d&&(h=h[0]);var p=f?h.position():{x:0,y:0};r!==void 0?u.position(e,r+p[e]):a!==void 0&&u.position({x:a.x+p.x,y:a.y+p.y})}else{var g=n.position(),m=o?n.parent():null,v=m&&m.length>0,y=v;v&&(m=m[0]);var b=y?m.position():{x:0,y:0};return a={x:g.x-b.x,y:g.y-b.y},e===void 0?a:a[e]}else if(!s)return;return this}};ys.modelPosition=ys.point=ys.position;ys.modelPositions=ys.points=ys.positions;ys.renderedPoint=ys.renderedPosition;ys.relativePoint=ys.relativePosition;var a2e=Yz,Oh,oc;Oh=oc={};oc.renderedBoundingBox=function(t){var e=this.boundingBox(t),r=this.cy(),n=r.zoom(),i=r.pan(),a=e.x1*n+i.x,s=e.x2*n+i.x,o=e.y1*n+i.y,l=e.y2*n+i.y;return{x1:a,x2:s,y1:o,y2:l,w:s-a,h:l-o}};oc.dirtyCompoundBoundsCache=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,e=this.cy();return!e.styleEnabled()||!e.hasCompoundNodes()?this:(this.forEachUp(function(r){if(r.isParent()){var n=r._private;n.compoundBoundsClean=!1,n.bbCache=null,t||r.emitAndNotify("bounds")}}),this)};oc.updateCompoundBounds=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,e=this.cy();if(!e.styleEnabled()||!e.hasCompoundNodes())return this;if(!t&&e.batching())return this;function r(s){if(!s.isParent())return;var o=s._private,l=s.children(),u=s.pstyle("compound-sizing-wrt-labels").value==="include",h={width:{val:s.pstyle("min-width").pfValue,left:s.pstyle("min-width-bias-left"),right:s.pstyle("min-width-bias-right")},height:{val:s.pstyle("min-height").pfValue,top:s.pstyle("min-height-bias-top"),bottom:s.pstyle("min-height-bias-bottom")}},d=l.boundingBox({includeLabels:u,includeOverlays:!1,useCache:!1}),f=o.position;(d.w===0||d.h===0)&&(d={w:s.pstyle("width").pfValue,h:s.pstyle("height").pfValue},d.x1=f.x-d.w/2,d.x2=f.x+d.w/2,d.y1=f.y-d.h/2,d.y2=f.y+d.h/2);function p(A,N,_){var O=0,P=0,k=N+_;return A>0&&k>0&&(O=N/k*A,P=_/k*A),{biasDiff:O,biasComplementDiff:P}}function g(A,N,_,O){if(_.units==="%")switch(O){case"width":return A>0?_.pfValue*A:0;case"height":return N>0?_.pfValue*N:0;case"average":return A>0&&N>0?_.pfValue*(A+N)/2:0;case"min":return A>0&&N>0?A>N?_.pfValue*N:_.pfValue*A:0;case"max":return A>0&&N>0?A>N?_.pfValue*A:_.pfValue*N:0;default:return 0}else return _.units==="px"?_.pfValue:0}var m=h.width.left.value;h.width.left.units==="px"&&h.width.val>0&&(m=m*100/h.width.val);var v=h.width.right.value;h.width.right.units==="px"&&h.width.val>0&&(v=v*100/h.width.val);var y=h.height.top.value;h.height.top.units==="px"&&h.height.val>0&&(y=y*100/h.height.val);var b=h.height.bottom.value;h.height.bottom.units==="px"&&h.height.val>0&&(b=b*100/h.height.val);var w=p(h.width.val-d.w,m,v),T=w.biasDiff,E=w.biasComplementDiff,L=p(h.height.val-d.h,y,b),S=L.biasDiff,C=L.biasComplementDiff;o.autoPadding=g(d.w,d.h,s.pstyle("padding"),s.pstyle("padding-relative-to").value),o.autoWidth=Math.max(d.w,h.width.val),f.x=(-T+d.x1+d.x2+E)/2,o.autoHeight=Math.max(d.h,h.height.val),f.y=(-S+d.y1+d.y2+C)/2}for(var n=0;n<this.length;n++){var i=this[n],a=i._private;(!a.compoundBoundsClean||t)&&(r(i),e.batching()||(a.compoundBoundsClean=!0))}return this};var Ua=function(e){return e===1/0||e===-1/0?0:e},ls=function(e,r,n,i,a){i-r===0||a-n===0||r==null||n==null||i==null||a==null||(e.x1=r<e.x1?r:e.x1,e.x2=i>e.x2?i:e.x2,e.y1=n<e.y1?n:e.y1,e.y2=a>e.y2?a:e.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1)},gl=function(e,r){return r==null?e:ls(e,r.x1,r.y1,r.x2,r.y2)},af=function(e,r,n){return ia(e,r,n)},e1=function(e,r,n){if(!r.cy().headless()){var i=r._private,a=i.rstyle,s=a.arrowWidth/2,o=r.pstyle(n+"-arrow-shape").value,l,u;if(o!=="none"){n==="source"?(l=a.srcX,u=a.srcY):n==="target"?(l=a.tgtX,u=a.tgtY):(l=a.midX,u=a.midY);var h=i.arrowBounds=i.arrowBounds||{},d=h[n]=h[n]||{};d.x1=l-s,d.y1=u-s,d.x2=l+s,d.y2=u+s,d.w=d.x2-d.x1,d.h=d.y2-d.y1,em(d,1),ls(e,d.x1,d.y1,d.x2,d.y2)}}},U4=function(e,r,n){if(!r.cy().headless()){var i;n?i=n+"-":i="";var a=r._private,s=a.rstyle,o=r.pstyle(i+"label").strValue;if(o){var l=r.pstyle("text-halign"),u=r.pstyle("text-valign"),h=af(s,"labelWidth",n),d=af(s,"labelHeight",n),f=af(s,"labelX",n),p=af(s,"labelY",n),g=r.pstyle(i+"text-margin-x").pfValue,m=r.pstyle(i+"text-margin-y").pfValue,v=r.isEdge(),y=r.pstyle(i+"text-rotation"),b=r.pstyle("text-outline-width").pfValue,w=r.pstyle("text-border-width").pfValue,T=w/2,E=r.pstyle("text-background-padding").pfValue,L=2,S=d,C=h,A=C/2,N=S/2,_,O,P,k;if(v)_=f-A,O=f+A,P=p-N,k=p+N;else{switch(l.value){case"left":_=f-C,O=f;break;case"center":_=f-A,O=f+A;break;case"right":_=f,O=f+C;break}switch(u.value){case"top":P=p-S,k=p;break;case"center":P=p-N,k=p+N;break;case"bottom":P=p,k=p+S;break}}var R=g-Math.max(b,T)-E-L,I=g+Math.max(b,T)+E+L,M=m-Math.max(b,T)-E-L,D=m+Math.max(b,T)+E+L;_+=R,O+=I,P+=M,k+=D;var B=n||"main",$=a.labelBounds,F=$[B]=$[B]||{};F.x1=_,F.y1=P,F.x2=O,F.y2=k,F.w=O-_,F.h=k-P,F.leftPad=R,F.rightPad=I,F.topPad=M,F.botPad=D;var G=v&&y.strValue==="autorotate",W=y.pfValue!=null&&y.pfValue!==0;if(G||W){var J=G?af(a.rstyle,"labelAngle",n):y.pfValue,q=Math.cos(J),ne=Math.sin(J),ae=(_+O)/2,pe=(P+k)/2;if(!v){switch(l.value){case"left":ae=O;break;case"right":ae=_;break}switch(u.value){case"top":pe=k;break;case"bottom":pe=P;break}}var K=function(Ae,H){return Ae=Ae-ae,H=H-pe,{x:Ae*q-H*ne+ae,y:Ae*ne+H*q+pe}},Z=K(_,P),X=K(_,k),Y=K(O,P),ee=K(O,k);_=Math.min(Z.x,X.x,Y.x,ee.x),O=Math.max(Z.x,X.x,Y.x,ee.x),P=Math.min(Z.y,X.y,Y.y,ee.y),k=Math.max(Z.y,X.y,Y.y,ee.y)}var j=B+"Rot",fe=$[j]=$[j]||{};fe.x1=_,fe.y1=P,fe.x2=O,fe.y2=k,fe.w=O-_,fe.h=k-P,ls(e,_,P,O,k),ls(a.labelBounds.all,_,P,O,k)}return e}},v_=function(e,r){if(!r.cy().headless()){var n=r.pstyle("outline-opacity").value,i=r.pstyle("outline-width").value,a=r.pstyle("outline-offset").value,s=i+a;jz(e,r,n,s,"outside",s/2)}},jz=function(e,r,n,i,a,s){if(!(n===0||i<=0||a==="inside")){var o=r.cy(),l=r.pstyle("shape").value,u=o.renderer().nodeShapes[l],h=r.position(),d=h.x,f=h.y,p=r.width(),g=r.height();if(u.hasMiterBounds){a==="center"&&(i/=2);var m=u.miterBounds(d,f,p,g,i);gl(e,m)}else s!=null&&s>0&&tm(e,[s,s,s,s])}},s2e=function(e,r){if(!r.cy().headless()){var n=r.pstyle("border-opacity").value,i=r.pstyle("border-width").pfValue,a=r.pstyle("border-position").value;jz(e,r,n,i,a)}},o2e=function(e,r){var n=e._private.cy,i=n.styleEnabled(),a=n.headless(),s=qi(),o=e._private,l=e.isNode(),u=e.isEdge(),h,d,f,p,g,m,v=o.rstyle,y=l&&i?e.pstyle("bounds-expansion").pfValue:[0],b=function(te){return te.pstyle("display").value!=="none"},w=!i||b(e)&&(!u||b(e.source())&&b(e.target()));if(w){var T=0,E=0;i&&r.includeOverlays&&(T=e.pstyle("overlay-opacity").value,T!==0&&(E=e.pstyle("overlay-padding").value));var L=0,S=0;i&&r.includeUnderlays&&(L=e.pstyle("underlay-opacity").value,L!==0&&(S=e.pstyle("underlay-padding").value));var C=Math.max(E,S),A=0,N=0;if(i&&(A=e.pstyle("width").pfValue,N=A/2),l&&r.includeNodes){var _=e.position();g=_.x,m=_.y;var O=e.outerWidth(),P=O/2,k=e.outerHeight(),R=k/2;h=g-P,d=g+P,f=m-R,p=m+R,ls(s,h,f,d,p),i&&v_(s,e),i&&r.includeOutlines&&!a&&v_(s,e),i&&s2e(s,e)}else if(u&&r.includeEdges)if(i&&!a){var I=e.pstyle("curve-style").strValue;if(h=Math.min(v.srcX,v.midX,v.tgtX),d=Math.max(v.srcX,v.midX,v.tgtX),f=Math.min(v.srcY,v.midY,v.tgtY),p=Math.max(v.srcY,v.midY,v.tgtY),h-=N,d+=N,f-=N,p+=N,ls(s,h,f,d,p),I==="haystack"){var M=v.haystackPts;if(M&&M.length===2){if(h=M[0].x,f=M[0].y,d=M[1].x,p=M[1].y,h>d){var D=h;h=d,d=D}if(f>p){var B=f;f=p,p=B}ls(s,h-N,f-N,d+N,p+N)}}else if(I==="bezier"||I==="unbundled-bezier"||Tl(I,"segments")||Tl(I,"taxi")){var $;switch(I){case"bezier":case"unbundled-bezier":$=v.bezierPts;break;case"segments":case"taxi":case"round-segments":case"round-taxi":$=v.linePts;break}if($!=null)for(var F=0;F<$.length;F++){var G=$[F];h=G.x-N,d=G.x+N,f=G.y-N,p=G.y+N,ls(s,h,f,d,p)}}}else{var W=e.source(),J=W.position(),q=e.target(),ne=q.position();if(h=J.x,d=ne.x,f=J.y,p=ne.y,h>d){var ae=h;h=d,d=ae}if(f>p){var pe=f;f=p,p=pe}h-=N,d+=N,f-=N,p+=N,ls(s,h,f,d,p)}if(i&&r.includeEdges&&u&&(e1(s,e,"mid-source"),e1(s,e,"mid-target"),e1(s,e,"source"),e1(s,e,"target")),i){var K=e.pstyle("ghost").value==="yes";if(K){var Z=e.pstyle("ghost-offset-x").pfValue,X=e.pstyle("ghost-offset-y").pfValue;ls(s,s.x1+Z,s.y1+X,s.x2+Z,s.y2+X)}}var Y=o.bodyBounds=o.bodyBounds||{};rA(Y,s),tm(Y,y),em(Y,1),i&&(h=s.x1,d=s.x2,f=s.y1,p=s.y2,ls(s,h-C,f-C,d+C,p+C));var ee=o.overlayBounds=o.overlayBounds||{};rA(ee,s),tm(ee,y),em(ee,1);var j=o.labelBounds=o.labelBounds||{};j.all!=null?Gme(j.all):j.all=qi(),i&&r.includeLabels&&(r.includeMainLabels&&U4(s,e,null),u&&(r.includeSourceLabels&&U4(s,e,"source"),r.includeTargetLabels&&U4(s,e,"target")))}return s.x1=Ua(s.x1),s.y1=Ua(s.y1),s.x2=Ua(s.x2),s.y2=Ua(s.y2),s.w=Ua(s.x2-s.x1),s.h=Ua(s.y2-s.y1),s.w>0&&s.h>0&&w&&(tm(s,y),em(s,1)),s},Kz=function(e){var r=0,n=function(s){return(s?1:0)<<r++},i=0;return i+=n(e.incudeNodes),i+=n(e.includeEdges),i+=n(e.includeLabels),i+=n(e.includeMainLabels),i+=n(e.includeSourceLabels),i+=n(e.includeTargetLabels),i+=n(e.includeOverlays),i+=n(e.includeOutlines),i},Zz=function(e){var r=function(o){return Math.round(o)};if(e.isEdge()){var n=e.source().position(),i=e.target().position();return K8([r(n.x),r(n.y),r(i.x),r(i.y)])}else{var a=e.position();return K8([r(a.x),r(a.y)])}},y_=function(e,r){var n=e._private,i,a=e.isEdge(),s=r==null?x_:Kz(r),o=s===x_;if(n.bbCache==null?(i=o2e(e,cp),n.bbCache=i,n.bbCachePosKey=Zz(e)):i=n.bbCache,!o){var l=e.isNode();i=qi(),(r.includeNodes&&l||r.includeEdges&&!l)&&(r.includeOverlays?gl(i,n.overlayBounds):gl(i,n.bodyBounds)),r.includeLabels&&(r.includeMainLabels&&(!a||r.includeSourceLabels&&r.includeTargetLabels)?gl(i,n.labelBounds.all):(r.includeMainLabels&&gl(i,n.labelBounds.mainRot),r.includeSourceLabels&&gl(i,n.labelBounds.sourceRot),r.includeTargetLabels&&gl(i,n.labelBounds.targetRot))),i.w=i.x2-i.x1,i.h=i.y2-i.y1}return i},cp={includeNodes:!0,includeEdges:!0,includeLabels:!0,includeMainLabels:!0,includeSourceLabels:!0,includeTargetLabels:!0,includeOverlays:!0,includeUnderlays:!0,includeOutlines:!0,useCache:!0},x_=Kz(cp),b_=hi(cp);oc.boundingBox=function(t){var e,r=t===void 0||t.useCache===void 0||t.useCache===!0,n=ad(function(h){var d=h._private;return d.bbCache==null||d.styleDirty||d.bbCachePosKey!==Zz(h)},function(h){return h.id()});if(r&&this.length===1&&!n(this[0]))t===void 0?t=cp:t=b_(t),e=y_(this[0],t);else{e=qi(),t=t||cp;var i=b_(t),a=this,s=a.cy(),o=s.styleEnabled();this.edges().forEach(n),this.nodes().forEach(n),o&&this.recalculateRenderedStyle(r),this.updateCompoundBounds(!r);for(var l=0;l<a.length;l++){var u=a[l];n(u)&&u.dirtyBoundingBoxCache(),gl(e,y_(u,i))}}return e.x1=Ua(e.x1),e.y1=Ua(e.y1),e.x2=Ua(e.x2),e.y2=Ua(e.y2),e.w=Ua(e.x2-e.x1),e.h=Ua(e.y2-e.y1),e};oc.dirtyBoundingBoxCache=function(){for(var t=0;t<this.length;t++){var e=this[t]._private;e.bbCache=null,e.bbCachePosKey=null,e.bodyBounds=null,e.overlayBounds=null,e.labelBounds.all=null,e.labelBounds.source=null,e.labelBounds.target=null,e.labelBounds.main=null,e.labelBounds.sourceRot=null,e.labelBounds.targetRot=null,e.labelBounds.mainRot=null,e.arrowBounds.source=null,e.arrowBounds.target=null,e.arrowBounds["mid-source"]=null,e.arrowBounds["mid-target"]=null}return this.emitAndNotify("bounds"),this};oc.boundingBoxAt=function(t){var e=this.nodes(),r=this.cy(),n=r.hasCompoundNodes(),i=r.collection();if(n&&(i=e.filter(function(u){return u.isParent()}),e=e.not(i)),vr(t)){var a=t;t=function(){return a}}var s=function(h,d){return h._private.bbAtOldPos=t(h,d)},o=function(h){return h._private.bbAtOldPos};r.startBatch(),e.forEach(s).silentPositions(t),n&&(i.dirtyCompoundBoundsCache(),i.dirtyBoundingBoxCache(),i.updateCompoundBounds(!0));var l=Vme(this.boundingBox({useCache:!1}));return e.silentPositions(o),n&&(i.dirtyCompoundBoundsCache(),i.dirtyBoundingBoxCache(),i.updateCompoundBounds(!0)),r.endBatch(),l};Oh.boundingbox=Oh.bb=Oh.boundingBox;Oh.renderedBoundingbox=Oh.renderedBoundingBox;var l2e=oc,_f,rg;_f=rg={};var Qz=function(e){e.uppercaseName=O8(e.name),e.autoName="auto"+e.uppercaseName,e.labelName="label"+e.uppercaseName,e.outerName="outer"+e.uppercaseName,e.uppercaseOuterName=O8(e.outerName),_f[e.name]=function(){var n=this[0],i=n._private,a=i.cy,s=a._private.styleEnabled;if(n)if(s){if(n.isParent())return n.updateCompoundBounds(),i[e.autoName]||0;var o=n.pstyle(e.name);switch(o.strValue){case"label":return n.recalculateRenderedStyle(),i.rstyle[e.labelName]||0;default:return o.pfValue}}else return 1},_f["outer"+e.uppercaseName]=function(){var n=this[0],i=n._private,a=i.cy,s=a._private.styleEnabled;if(n)if(s){var o=n[e.name](),l=n.pstyle("border-position").value,u;l==="center"?u=n.pstyle("border-width").pfValue:l==="outside"?u=2*n.pstyle("border-width").pfValue:u=0;var h=2*n.padding();return o+u+h}else return 1},_f["rendered"+e.uppercaseName]=function(){var n=this[0];if(n){var i=n[e.name]();return i*this.cy().zoom()}},_f["rendered"+e.uppercaseOuterName]=function(){var n=this[0];if(n){var i=n[e.outerName]();return i*this.cy().zoom()}}};Qz({name:"width"});Qz({name:"height"});rg.padding=function(){var t=this[0],e=t._private;return t.isParent()?(t.updateCompoundBounds(),e.autoPadding!==void 0?e.autoPadding:t.pstyle("padding").pfValue):t.pstyle("padding").pfValue};rg.paddedHeight=function(){var t=this[0];return t.height()+2*t.padding()};rg.paddedWidth=function(){var t=this[0];return t.width()+2*t.padding()};var c2e=rg,u2e=function(e,r){if(e.isEdge()&&e.takesUpSpace())return r(e)},h2e=function(e,r){if(e.isEdge()&&e.takesUpSpace()){var n=e.cy();return R2(r(e),n.zoom(),n.pan())}},d2e=function(e,r){if(e.isEdge()&&e.takesUpSpace()){var n=e.cy(),i=n.pan(),a=n.zoom();return r(e).map(function(s){return R2(s,a,i)})}},f2e=function(e){return e.renderer().getControlPoints(e)},p2e=function(e){return e.renderer().getSegmentPoints(e)},g2e=function(e){return e.renderer().getSourceEndpoint(e)},m2e=function(e){return e.renderer().getTargetEndpoint(e)},v2e=function(e){return e.renderer().getEdgeMidpoint(e)},w_={controlPoints:{get:f2e,mult:!0},segmentPoints:{get:p2e,mult:!0},sourceEndpoint:{get:g2e},targetEndpoint:{get:m2e},midpoint:{get:v2e}},y2e=function(e){return"rendered"+e[0].toUpperCase()+e.substr(1)},x2e=Object.keys(w_).reduce(function(t,e){var r=w_[e],n=y2e(e);return t[e]=function(){return u2e(this,r.get)},r.mult?t[n]=function(){return d2e(this,r.get)}:t[n]=function(){return h2e(this,r.get)},t},{}),b2e=Gt({},a2e,l2e,c2e,x2e);/*!
Event object based on jQuery events, MIT license

https://jquery.org/license/
https://tldrlegal.com/license/mit-license
https://github.com/jquery/jquery/blob/master/src/event.js
*/var Jz=function(e,r){this.recycle(e,r)};function sf(){return!1}function t1(){return!0}Jz.prototype={instanceString:function(){return"event"},recycle:function(e,r){if(this.isImmediatePropagationStopped=this.isPropagationStopped=this.isDefaultPrevented=sf,e!=null&&e.preventDefault?(this.type=e.type,this.isDefaultPrevented=e.defaultPrevented?t1:sf):e!=null&&e.type?r=e:this.type=e,r!=null&&(this.originalEvent=r.originalEvent,this.type=r.type!=null?r.type:this.type,this.cy=r.cy,this.target=r.target,this.position=r.position,this.renderedPosition=r.renderedPosition,this.namespace=r.namespace,this.layout=r.layout),this.cy!=null&&this.position!=null&&this.renderedPosition==null){var n=this.position,i=this.cy.zoom(),a=this.cy.pan();this.renderedPosition={x:n.x*i+a.x,y:n.y*i+a.y}}this.timeStamp=e&&e.timeStamp||Date.now()},preventDefault:function(){this.isDefaultPrevented=t1;var e=this.originalEvent;e&&e.preventDefault&&e.preventDefault()},stopPropagation:function(){this.isPropagationStopped=t1;var e=this.originalEvent;e&&e.stopPropagation&&e.stopPropagation()},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=t1,this.stopPropagation()},isDefaultPrevented:sf,isPropagationStopped:sf,isImmediatePropagationStopped:sf};var eV=/^([^.]+)(\.(?:[^.]+))?$/,w2e=".*",tV={qualifierCompare:function(e,r){return e===r},eventMatches:function(){return!0},addEventFields:function(){},callbackContext:function(e){return e},beforeEmit:function(){},afterEmit:function(){},bubble:function(){return!1},parent:function(){return null},context:null},T_=Object.keys(tV),T2e={};function B2(){for(var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:T2e,e=arguments.length>1?arguments[1]:void 0,r=0;r<T_.length;r++){var n=T_[r];this[n]=t[n]||tV[n]}this.context=e||this.context,this.listeners=[],this.emitting=0}var ql=B2.prototype,rV=function(e,r,n,i,a,s,o){nn(i)&&(a=i,i=null),o&&(s==null?s=o:s=Gt({},s,o));for(var l=Br(n)?n:n.split(/\s+/),u=0;u<l.length;u++){var h=l[u];if(!Vl(h)){var d=h.match(eV);if(d){var f=d[1],p=d[2]?d[2]:null,g=r(e,h,f,p,i,a,s);if(g===!1)break}}}},E_=function(e,r){return e.addEventFields(e.context,r),new Jz(r.type,r)},E2e=function(e,r,n){if(L1e(n)){r(e,n);return}else if(vr(n)){r(e,E_(e,n));return}for(var i=Br(n)?n:n.split(/\s+/),a=0;a<i.length;a++){var s=i[a];if(!Vl(s)){var o=s.match(eV);if(o){var l=o[1],u=o[2]?o[2]:null,h=E_(e,{type:l,namespace:u,target:e.context});r(e,h)}}}};ql.on=ql.addListener=function(t,e,r,n,i){return rV(this,function(a,s,o,l,u,h,d){nn(h)&&a.listeners.push({event:s,callback:h,type:o,namespace:l,qualifier:u,conf:d})},t,e,r,n,i),this};ql.one=function(t,e,r,n){return this.on(t,e,r,n,{one:!0})};ql.removeListener=ql.off=function(t,e,r,n){var i=this;this.emitting!==0&&(this.listeners=hme(this.listeners));for(var a=this.listeners,s=function(u){var h=a[u];rV(i,function(d,f,p,g,m,v){if((h.type===p||t==="*")&&(!g&&h.namespace!==".*"||h.namespace===g)&&(!m||d.qualifierCompare(h.qualifier,m))&&(!v||h.callback===v))return a.splice(u,1),!1},t,e,r,n)},o=a.length-1;o>=0;o--)s(o);return this};ql.removeAllListeners=function(){return this.removeListener("*")};ql.emit=ql.trigger=function(t,e,r){var n=this.listeners,i=n.length;return this.emitting++,Br(e)||(e=[e]),E2e(this,function(a,s){r!=null&&(n=[{event:s.event,type:s.type,namespace:s.namespace,callback:r}],i=n.length);for(var o=function(){var h=n[l];if(h.type===s.type&&(!h.namespace||h.namespace===s.namespace||h.namespace===w2e)&&a.eventMatches(a.context,h,s)){var d=[s];e!=null&&fme(d,e),a.beforeEmit(a.context,h,s),h.conf&&h.conf.one&&(a.listeners=a.listeners.filter(function(g){return g!==h}));var f=a.callbackContext(a.context,h,s),p=h.callback.apply(f,d);a.afterEmit(a.context,h,s),p===!1&&(s.stopPropagation(),s.preventDefault())}},l=0;l<i;l++)o();a.bubble(a.context)&&!s.isPropagationStopped()&&a.parent(a.context).emit(s,e)},t),this.emitting--,this};var k2e={qualifierCompare:function(e,r){return e==null||r==null?e==null&&r==null:e.sameText(r)},eventMatches:function(e,r,n){var i=r.qualifier;return i!=null?e!==n.target&&Kp(n.target)&&i.matches(n.target):!0},addEventFields:function(e,r){r.cy=e.cy(),r.target=e},callbackContext:function(e,r,n){return r.qualifier!=null?n.target:e},beforeEmit:function(e,r){r.conf&&r.conf.once&&r.conf.onceCollection.removeListener(r.event,r.qualifier,r.callback)},bubble:function(){return!0},parent:function(e){return e.isChild()?e.parent():e.cy()}},r1=function(e){return Bt(e)?new Wl(e):e},nV={createEmitter:function(){for(var e=0;e<this.length;e++){var r=this[e],n=r._private;n.emitter||(n.emitter=new B2(k2e,r))}return this},emitter:function(){return this._private.emitter},on:function(e,r,n){for(var i=r1(r),a=0;a<this.length;a++){var s=this[a];s.emitter().on(e,i,n)}return this},removeListener:function(e,r,n){for(var i=r1(r),a=0;a<this.length;a++){var s=this[a];s.emitter().removeListener(e,i,n)}return this},removeAllListeners:function(){for(var e=0;e<this.length;e++){var r=this[e];r.emitter().removeAllListeners()}return this},one:function(e,r,n){for(var i=r1(r),a=0;a<this.length;a++){var s=this[a];s.emitter().one(e,i,n)}return this},once:function(e,r,n){for(var i=r1(r),a=0;a<this.length;a++){var s=this[a];s.emitter().on(e,i,n,{once:!0,onceCollection:this})}},emit:function(e,r){for(var n=0;n<this.length;n++){var i=this[n];i.emitter().emit(e,r)}return this},emitAndNotify:function(e,r){if(this.length!==0)return this.cy().notify(e,this),this.emit(e,r),this}};_r.eventAliasesOn(nV);var iV={nodes:function(e){return this.filter(function(r){return r.isNode()}).filter(e)},edges:function(e){return this.filter(function(r){return r.isEdge()}).filter(e)},byGroup:function(){for(var e=this.spawn(),r=this.spawn(),n=0;n<this.length;n++){var i=this[n];i.isNode()?e.push(i):r.push(i)}return{nodes:e,edges:r}},filter:function(e,r){if(e===void 0)return this;if(Bt(e)||Aa(e))return new Wl(e).filter(this);if(nn(e)){for(var n=this.spawn(),i=this,a=0;a<i.length;a++){var s=i[a],o=r?e.apply(r,[s,a,i]):e(s,a,i);o&&n.push(s)}return n}return this.spawn()},not:function(e){if(e){Bt(e)&&(e=this.filter(e));for(var r=this.spawn(),n=0;n<this.length;n++){var i=this[n],a=e.has(i);a||r.push(i)}return r}else return this},absoluteComplement:function(){var e=this.cy();return e.mutableElements().not(this)},intersect:function(e){if(Bt(e)){var r=e;return this.filter(r)}for(var n=this.spawn(),i=this,a=e,s=this.length<e.length,o=s?i:a,l=s?a:i,u=0;u<o.length;u++){var h=o[u];l.has(h)&&n.push(h)}return n},xor:function(e){var r=this._private.cy;Bt(e)&&(e=r.$(e));var n=this.spawn(),i=this,a=e,s=function(l,u){for(var h=0;h<l.length;h++){var d=l[h],f=d._private.data.id,p=u.hasElementWithId(f);p||n.push(d)}};return s(i,a),s(a,i),n},diff:function(e){var r=this._private.cy;Bt(e)&&(e=r.$(e));var n=this.spawn(),i=this.spawn(),a=this.spawn(),s=this,o=e,l=function(h,d,f){for(var p=0;p<h.length;p++){var g=h[p],m=g._private.data.id,v=d.hasElementWithId(m);v?a.merge(g):f.push(g)}};return l(s,o,n),l(o,s,i),{left:n,right:i,both:a}},add:function(e){var r=this._private.cy;if(!e)return this;if(Bt(e)){var n=e;e=r.mutableElements().filter(n)}for(var i=this.spawnSelf(),a=0;a<e.length;a++){var s=e[a],o=!this.has(s);o&&i.push(s)}return i},merge:function(e){var r=this._private,n=r.cy;if(!e)return this;if(e&&Bt(e)){var i=e;e=n.mutableElements().filter(i)}for(var a=r.map,s=0;s<e.length;s++){var o=e[s],l=o._private.data.id,u=!a.has(l);if(u){var h=this.length++;this[h]=o,a.set(l,{ele:o,index:h})}}return this},unmergeAt:function(e){var r=this[e],n=r.id(),i=this._private,a=i.map;this[e]=void 0,a.delete(n);var s=e===this.length-1;if(this.length>1&&!s){var o=this.length-1,l=this[o],u=l._private.data.id;this[o]=void 0,this[e]=l,a.set(u,{ele:l,index:e})}return this.length--,this},unmergeOne:function(e){e=e[0];var r=this._private,n=e._private.data.id,i=r.map,a=i.get(n);if(!a)return this;var s=a.index;return this.unmergeAt(s),this},unmerge:function(e){var r=this._private.cy;if(!e)return this;if(e&&Bt(e)){var n=e;e=r.mutableElements().filter(n)}for(var i=0;i<e.length;i++)this.unmergeOne(e[i]);return this},unmergeBy:function(e){for(var r=this.length-1;r>=0;r--){var n=this[r];e(n)&&this.unmergeAt(r)}return this},map:function(e,r){for(var n=[],i=this,a=0;a<i.length;a++){var s=i[a],o=r?e.apply(r,[s,a,i]):e(s,a,i);n.push(o)}return n},reduce:function(e,r){for(var n=r,i=this,a=0;a<i.length;a++)n=e(n,i[a],a,i);return n},max:function(e,r){for(var n=-1/0,i,a=this,s=0;s<a.length;s++){var o=a[s],l=r?e.apply(r,[o,s,a]):e(o,s,a);l>n&&(n=l,i=o)}return{value:n,ele:i}},min:function(e,r){for(var n=1/0,i,a=this,s=0;s<a.length;s++){var o=a[s],l=r?e.apply(r,[o,s,a]):e(o,s,a);l<n&&(n=l,i=o)}return{value:n,ele:i}}},wr=iV;wr.u=wr["|"]=wr["+"]=wr.union=wr.or=wr.add;wr["\\"]=wr["!"]=wr["-"]=wr.difference=wr.relativeComplement=wr.subtract=wr.not;wr.n=wr["&"]=wr["."]=wr.and=wr.intersection=wr.intersect;wr["^"]=wr["(+)"]=wr["(-)"]=wr.symmetricDifference=wr.symdiff=wr.xor;wr.fnFilter=wr.filterFn=wr.stdFilter=wr.filter;wr.complement=wr.abscomp=wr.absoluteComplement;var S2e={isNode:function(){return this.group()==="nodes"},isEdge:function(){return this.group()==="edges"},isLoop:function(){return this.isEdge()&&this.source()[0]===this.target()[0]},isSimple:function(){return this.isEdge()&&this.source()[0]!==this.target()[0]},group:function(){var e=this[0];if(e)return e._private.group}},aV=function(e,r){var n=e.cy(),i=n.hasCompoundNodes();function a(h){var d=h.pstyle("z-compound-depth");return d.value==="auto"?i?h.zDepth():0:d.value==="bottom"?-1:d.value==="top"?WE:0}var s=a(e)-a(r);if(s!==0)return s;function o(h){var d=h.pstyle("z-index-compare");return d.value==="auto"&&h.isNode()?1:0}var l=o(e)-o(r);if(l!==0)return l;var u=e.pstyle("z-index").value-r.pstyle("z-index").value;return u!==0?u:e.poolIndex()-r.poolIndex()},Fv={forEach:function(e,r){if(nn(e))for(var n=this.length,i=0;i<n;i++){var a=this[i],s=r?e.apply(r,[a,i,this]):e(a,i,this);if(s===!1)break}return this},toArray:function(){for(var e=[],r=0;r<this.length;r++)e.push(this[r]);return e},slice:function(e,r){var n=[],i=this.length;r==null&&(r=i),e==null&&(e=0),e<0&&(e=i+e),r<0&&(r=i+r);for(var a=e;a>=0&&a<r&&a<i;a++)n.push(this[a]);return this.spawn(n)},size:function(){return this.length},eq:function(e){return this[e]||this.spawn()},first:function(){return this[0]||this.spawn()},last:function(){return this[this.length-1]||this.spawn()},empty:function(){return this.length===0},nonempty:function(){return!this.empty()},sort:function(e){if(!nn(e))return this;var r=this.toArray().sort(e);return this.spawn(r)},sortByZIndex:function(){return this.sort(aV)},zDepth:function(){var e=this[0];if(e){var r=e._private,n=r.group;if(n==="nodes"){var i=r.data.parent?e.parents().size():0;return e.isParent()?i:WE-1}else{var a=r.source,s=r.target,o=a.zDepth(),l=s.zDepth();return Math.max(o,l,0)}}}};Fv.each=Fv.forEach;var C2e=function(){var e="undefined",r=(typeof Symbol>"u"?"undefined":$n(Symbol))!=e&&$n(Symbol.iterator)!=e;r&&(Fv[Symbol.iterator]=function(){var n=this,i={value:void 0,done:!1},a=0,s=this.length;return nz({next:function(){return a<s?i.value=n[a++]:(i.value=void 0,i.done=!0),i}},Symbol.iterator,function(){return this})})};C2e();var A2e=hi({nodeDimensionsIncludeLabels:!1}),nm={layoutDimensions:function(e){e=A2e(e);var r;if(!this.takesUpSpace())r={w:0,h:0};else if(e.nodeDimensionsIncludeLabels){var n=this.boundingBox();r={w:n.w,h:n.h}}else r={w:this.outerWidth(),h:this.outerHeight()};return(r.w===0||r.h===0)&&(r.w=r.h=1),r},layoutPositions:function(e,r,n){var i=this.nodes().filter(function(E){return!E.isParent()}),a=this.cy(),s=r.eles,o=function(L){return L.id()},l=ad(n,o);e.emit({type:"layoutstart",layout:e}),e.animations=[];var u=function(L,S,C){var A={x:S.x1+S.w/2,y:S.y1+S.h/2},N={x:(C.x-A.x)*L,y:(C.y-A.y)*L};return{x:A.x+N.x,y:A.y+N.y}},h=r.spacingFactor&&r.spacingFactor!==1,d=function(){if(!h)return null;for(var L=qi(),S=0;S<i.length;S++){var C=i[S],A=l(C,S);Ez(L,A.x,A.y)}return L},f=d(),p=ad(function(E,L){var S=l(E,L);if(h){var C=Math.abs(r.spacingFactor);S=u(C,f,S)}return r.transform!=null&&(S=r.transform(E,S)),S},o);if(r.animate){for(var g=0;g<i.length;g++){var m=i[g],v=p(m,g),y=r.animateFilter==null||r.animateFilter(m,g);if(y){var b=m.animation({position:v,duration:r.animationDuration,easing:r.animationEasing});e.animations.push(b)}else m.position(v)}if(r.fit){var w=a.animation({fit:{boundingBox:s.boundingBoxAt(p),padding:r.padding},duration:r.animationDuration,easing:r.animationEasing});e.animations.push(w)}else if(r.zoom!==void 0&&r.pan!==void 0){var T=a.animation({zoom:r.zoom,pan:r.pan,duration:r.animationDuration,easing:r.animationEasing});e.animations.push(T)}e.animations.forEach(function(E){return E.play()}),e.one("layoutready",r.ready),e.emit({type:"layoutready",layout:e}),Nd.all(e.animations.map(function(E){return E.promise()})).then(function(){e.one("layoutstop",r.stop),e.emit({type:"layoutstop",layout:e})})}else i.positions(p),r.fit&&a.fit(r.eles,r.padding),r.zoom!=null&&a.zoom(r.zoom),r.pan&&a.pan(r.pan),e.one("layoutready",r.ready),e.emit({type:"layoutready",layout:e}),e.one("layoutstop",r.stop),e.emit({type:"layoutstop",layout:e});return this},layout:function(e){var r=this.cy();return r.makeLayout(Gt({},e,{eles:this}))}};nm.createLayout=nm.makeLayout=nm.layout;function sV(t,e,r){var n=r._private,i=n.styleCache=n.styleCache||[],a;return(a=i[t])!=null||(a=i[t]=e(r)),a}function F2(t,e){return t=du(t),function(n){return sV(t,e,n)}}function $2(t,e){t=du(t);var r=function(i){return e.call(i)};return function(){var i=this[0];if(i)return sV(t,r,i)}}var li={recalculateRenderedStyle:function(e){var r=this.cy(),n=r.renderer(),i=r.styleEnabled();return n&&i&&n.recalculateRenderedStyle(this,e),this},dirtyStyleCache:function(){var e=this.cy(),r=function(a){return a._private.styleCache=null};if(e.hasCompoundNodes()){var n;n=this.spawnSelf().merge(this.descendants()).merge(this.parents()),n.merge(n.connectedEdges()),n.forEach(r)}else this.forEach(function(i){r(i),i.connectedEdges().forEach(r)});return this},updateStyle:function(e){var r=this._private.cy;if(!r.styleEnabled())return this;if(r.batching()){var n=r._private.batchStyleEles;return n.merge(this),this}var i=r.hasCompoundNodes(),a=this;e=!!(e||e===void 0),i&&(a=this.spawnSelf().merge(this.descendants()).merge(this.parents()));var s=a;return e?s.emitAndNotify("style"):s.emit("style"),a.forEach(function(o){return o._private.styleDirty=!0}),this},cleanStyle:function(){var e=this.cy();if(e.styleEnabled())for(var r=0;r<this.length;r++){var n=this[r];n._private.styleDirty&&(n._private.styleDirty=!1,e.style().apply(n))}},parsedStyle:function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,n=this[0],i=n.cy();if(i.styleEnabled()&&n){n._private.styleDirty&&(n._private.styleDirty=!1,i.style().apply(n));var a=n._private.style[e];return a??(r?i.style().getDefaultProperty(e):null)}},numericStyle:function(e){var r=this[0];if(r.cy().styleEnabled()&&r){var n=r.pstyle(e);return n.pfValue!==void 0?n.pfValue:n.value}},numericStyleUnits:function(e){var r=this[0];if(r.cy().styleEnabled()&&r)return r.pstyle(e).units},renderedStyle:function(e){var r=this.cy();if(!r.styleEnabled())return this;var n=this[0];if(n)return r.style().getRenderedStyle(n,e)},style:function(e,r){var n=this.cy();if(!n.styleEnabled())return this;var i=!1,a=n.style();if(vr(e)){var s=e;a.applyBypass(this,s,i),this.emitAndNotify("style")}else if(Bt(e))if(r===void 0){var o=this[0];return o?a.getStylePropertyValue(o,e):void 0}else a.applyBypass(this,e,r,i),this.emitAndNotify("style");else if(e===void 0){var l=this[0];return l?a.getRawStyle(l):void 0}return this},removeStyle:function(e){var r=this.cy();if(!r.styleEnabled())return this;var n=!1,i=r.style(),a=this;if(e===void 0)for(var s=0;s<a.length;s++){var o=a[s];i.removeAllBypasses(o,n)}else{e=e.split(/\s+/);for(var l=0;l<a.length;l++){var u=a[l];i.removeBypasses(u,e,n)}}return this.emitAndNotify("style"),this},show:function(){return this.css("display","element"),this},hide:function(){return this.css("display","none"),this},effectiveOpacity:function(){var e=this.cy();if(!e.styleEnabled())return 1;var r=e.hasCompoundNodes(),n=this[0];if(n){var i=n._private,a=n.pstyle("opacity").value;if(!r)return a;var s=i.data.parent?n.parents():null;if(s)for(var o=0;o<s.length;o++){var l=s[o],u=l.pstyle("opacity").value;a=u*a}return a}},transparent:function(){var e=this.cy();if(!e.styleEnabled())return!1;var r=this[0],n=r.cy().hasCompoundNodes();if(r)return n?r.effectiveOpacity()===0:r.pstyle("opacity").value===0},backgrounding:function(){var e=this.cy();if(!e.styleEnabled())return!1;var r=this[0];return!!r._private.backgrounding}};function W4(t,e){var r=t._private,n=r.data.parent?t.parents():null;if(n)for(var i=0;i<n.length;i++){var a=n[i];if(!e(a))return!1}return!0}function rk(t){var e=t.ok,r=t.edgeOkViaNode||t.ok,n=t.parentOk||t.ok;return function(){var i=this.cy();if(!i.styleEnabled())return!0;var a=this[0],s=i.hasCompoundNodes();if(a){var o=a._private;if(!e(a))return!1;if(a.isNode())return!s||W4(a,n);var l=o.source,u=o.target;return r(l)&&(!s||W4(l,r))&&(l===u||r(u)&&(!s||W4(u,r)))}}}var Dd=F2("eleTakesUpSpace",function(t){return t.pstyle("display").value==="element"&&t.width()!==0&&(t.isNode()?t.height()!==0:!0)});li.takesUpSpace=$2("takesUpSpace",rk({ok:Dd}));var _2e=F2("eleInteractive",function(t){return t.pstyle("events").value==="yes"&&t.pstyle("visibility").value==="visible"&&Dd(t)}),L2e=F2("parentInteractive",function(t){return t.pstyle("visibility").value==="visible"&&Dd(t)});li.interactive=$2("interactive",rk({ok:_2e,parentOk:L2e,edgeOkViaNode:Dd}));li.noninteractive=function(){var t=this[0];if(t)return!t.interactive()};var R2e=F2("eleVisible",function(t){return t.pstyle("visibility").value==="visible"&&t.pstyle("opacity").pfValue!==0&&Dd(t)}),N2e=Dd;li.visible=$2("visible",rk({ok:R2e,edgeOkViaNode:N2e}));li.hidden=function(){var t=this[0];if(t)return!t.visible()};li.isBundledBezier=$2("isBundledBezier",function(){return this.cy().styleEnabled()?!this.removed()&&this.pstyle("curve-style").value==="bezier"&&this.takesUpSpace():!1});li.bypass=li.css=li.style;li.renderedCss=li.renderedStyle;li.removeBypass=li.removeCss=li.removeStyle;li.pstyle=li.parsedStyle;var Rl={};function k_(t){return function(){var e=arguments,r=[];if(e.length===2){var n=e[0],i=e[1];this.on(t.event,n,i)}else if(e.length===1&&nn(e[0])){var a=e[0];this.on(t.event,a)}else if(e.length===0||e.length===1&&Br(e[0])){for(var s=e.length===1?e[0]:null,o=0;o<this.length;o++){var l=this[o],u=!t.ableField||l._private[t.ableField],h=l._private[t.field]!=t.value;if(t.overrideAble){var d=t.overrideAble(l);if(d!==void 0&&(u=d,!d))return this}u&&(l._private[t.field]=t.value,h&&r.push(l))}var f=this.spawn(r);f.updateStyle(),f.emit(t.event),s&&f.emit(s)}return this}}function Md(t){Rl[t.field]=function(){var e=this[0];if(e){if(t.overrideField){var r=t.overrideField(e);if(r!==void 0)return r}return e._private[t.field]}},Rl[t.on]=k_({event:t.on,field:t.field,ableField:t.ableField,overrideAble:t.overrideAble,value:!0}),Rl[t.off]=k_({event:t.off,field:t.field,ableField:t.ableField,overrideAble:t.overrideAble,value:!1})}Md({field:"locked",overrideField:function(e){return e.cy().autolock()?!0:void 0},on:"lock",off:"unlock"});Md({field:"grabbable",overrideField:function(e){return e.cy().autoungrabify()||e.pannable()?!1:void 0},on:"grabify",off:"ungrabify"});Md({field:"selected",ableField:"selectable",overrideAble:function(e){return e.cy().autounselectify()?!1:void 0},on:"select",off:"unselect"});Md({field:"selectable",overrideField:function(e){return e.cy().autounselectify()?!1:void 0},on:"selectify",off:"unselectify"});Rl.deselect=Rl.unselect;Rl.grabbed=function(){var t=this[0];if(t)return t._private.grabbed};Md({field:"active",on:"activate",off:"unactivate"});Md({field:"pannable",on:"panify",off:"unpanify"});Rl.inactive=function(){var t=this[0];if(t)return!t._private.active};var Ci={},S_=function(e){return function(n){for(var i=this,a=[],s=0;s<i.length;s++){var o=i[s];if(o.isNode()){for(var l=!1,u=o.connectedEdges(),h=0;h<u.length;h++){var d=u[h],f=d.source(),p=d.target();if(e.noIncomingEdges&&p===o&&f!==o||e.noOutgoingEdges&&f===o&&p!==o){l=!0;break}}l||a.push(o)}}return this.spawn(a,!0).filter(n)}},C_=function(e){return function(r){for(var n=this,i=[],a=0;a<n.length;a++){var s=n[a];if(s.isNode())for(var o=s.connectedEdges(),l=0;l<o.length;l++){var u=o[l],h=u.source(),d=u.target();e.outgoing&&h===s?(i.push(u),i.push(d)):e.incoming&&d===s&&(i.push(u),i.push(h))}}return this.spawn(i,!0).filter(r)}},A_=function(e){return function(r){for(var n=this,i=[],a={};;){var s=e.outgoing?n.outgoers():n.incomers();if(s.length===0)break;for(var o=!1,l=0;l<s.length;l++){var u=s[l],h=u.id();a[h]||(a[h]=!0,i.push(u),o=!0)}if(!o)break;n=s}return this.spawn(i,!0).filter(r)}};Ci.clearTraversalCache=function(){for(var t=0;t<this.length;t++)this[t]._private.traversalCache=null};Gt(Ci,{roots:S_({noIncomingEdges:!0}),leaves:S_({noOutgoingEdges:!0}),outgoers:Xa(C_({outgoing:!0}),"outgoers"),successors:A_({outgoing:!0}),incomers:Xa(C_({incoming:!0}),"incomers"),predecessors:A_({})});Gt(Ci,{neighborhood:Xa(function(t){for(var e=[],r=this.nodes(),n=0;n<r.length;n++)for(var i=r[n],a=i.connectedEdges(),s=0;s<a.length;s++){var o=a[s],l=o.source(),u=o.target(),h=i===l?u:l;h.length>0&&e.push(h[0]),e.push(o[0])}return this.spawn(e,!0).filter(t)},"neighborhood"),closedNeighborhood:function(e){return this.neighborhood().add(this).filter(e)},openNeighborhood:function(e){return this.neighborhood(e)}});Ci.neighbourhood=Ci.neighborhood;Ci.closedNeighbourhood=Ci.closedNeighborhood;Ci.openNeighbourhood=Ci.openNeighborhood;Gt(Ci,{source:Xa(function(e){var r=this[0],n;return r&&(n=r._private.source||r.cy().collection()),n&&e?n.filter(e):n},"source"),target:Xa(function(e){var r=this[0],n;return r&&(n=r._private.target||r.cy().collection()),n&&e?n.filter(e):n},"target"),sources:__({attr:"source"}),targets:__({attr:"target"})});function __(t){return function(r){for(var n=[],i=0;i<this.length;i++){var a=this[i],s=a._private[t.attr];s&&n.push(s)}return this.spawn(n,!0).filter(r)}}Gt(Ci,{edgesWith:Xa(L_(),"edgesWith"),edgesTo:Xa(L_({thisIsSrc:!0}),"edgesTo")});function L_(t){return function(r){var n=[],i=this._private.cy,a=t||{};Bt(r)&&(r=i.$(r));for(var s=0;s<r.length;s++)for(var o=r[s]._private.edges,l=0;l<o.length;l++){var u=o[l],h=u._private.data,d=this.hasElementWithId(h.source)&&r.hasElementWithId(h.target),f=r.hasElementWithId(h.source)&&this.hasElementWithId(h.target),p=d||f;p&&((a.thisIsSrc||a.thisIsTgt)&&(a.thisIsSrc&&!d||a.thisIsTgt&&!f)||n.push(u))}return this.spawn(n,!0)}}Gt(Ci,{connectedEdges:Xa(function(t){for(var e=[],r=this,n=0;n<r.length;n++){var i=r[n];if(i.isNode())for(var a=i._private.edges,s=0;s<a.length;s++){var o=a[s];e.push(o)}}return this.spawn(e,!0).filter(t)},"connectedEdges"),connectedNodes:Xa(function(t){for(var e=[],r=this,n=0;n<r.length;n++){var i=r[n];i.isEdge()&&(e.push(i.source()[0]),e.push(i.target()[0]))}return this.spawn(e,!0).filter(t)},"connectedNodes"),parallelEdges:Xa(R_(),"parallelEdges"),codirectedEdges:Xa(R_({codirected:!0}),"codirectedEdges")});function R_(t){var e={codirected:!1};return t=Gt({},e,t),function(n){for(var i=[],a=this.edges(),s=t,o=0;o<a.length;o++)for(var l=a[o],u=l._private,h=u.source,d=h._private.data.id,f=u.data.target,p=h._private.edges,g=0;g<p.length;g++){var m=p[g],v=m._private.data,y=v.target,b=v.source,w=y===f&&b===d,T=d===y&&f===b;(s.codirected&&w||!s.codirected&&(w||T))&&i.push(m)}return this.spawn(i,!0).filter(n)}}Gt(Ci,{components:function(e){var r=this,n=r.cy(),i=n.collection(),a=e==null?r.nodes():e.nodes(),s=[];e!=null&&a.empty()&&(a=e.sources());var o=function(h,d){i.merge(h),a.unmerge(h),d.merge(h)};if(a.empty())return r.spawn();var l=function(){var h=n.collection();s.push(h);var d=a[0];o(d,h),r.bfs({directed:!1,roots:d,visit:function(p){return o(p,h)}}),h.forEach(function(f){f.connectedEdges().forEach(function(p){r.has(p)&&h.has(p.source())&&h.has(p.target())&&h.merge(p)})})};do l();while(a.length>0);return s},component:function(){var e=this[0];return e.cy().mutableElements().components(e)[0]}});Ci.componentsOf=Ci.components;var ci=function(e,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(e===void 0){Kr("A collection must have a reference to the core");return}var a=new Mo,s=!1;if(!r)r=[];else if(r.length>0&&vr(r[0])&&!Kp(r[0])){s=!0;for(var o=[],l=new Rd,u=0,h=r.length;u<h;u++){var d=r[u];d.data==null&&(d.data={});var f=d.data;if(f.id==null)f.id=bz();else if(e.hasElementWithId(f.id)||l.has(f.id))continue;var p=new L2(e,d,!1);o.push(p),l.add(f.id)}r=o}this.length=0;for(var g=0,m=r.length;g<m;g++){var v=r[g][0];if(v!=null){var y=v._private.data.id;(!n||!a.has(y))&&(n&&a.set(y,{index:this.length,ele:v}),this[this.length]=v,this.length++)}}this._private={eles:this,cy:e,get map(){return this.lazyMap==null&&this.rebuildMap(),this.lazyMap},set map(b){this.lazyMap=b},rebuildMap:function(){for(var w=this.lazyMap=new Mo,T=this.eles,E=0;E<T.length;E++){var L=T[E];w.set(L.id(),{index:E,ele:L})}}},n&&(this._private.map=a),s&&!i&&this.restore()},Gr=L2.prototype=ci.prototype=Object.create(Array.prototype);Gr.instanceString=function(){return"collection"};Gr.spawn=function(t,e){return new ci(this.cy(),t,e)};Gr.spawnSelf=function(){return this.spawn(this)};Gr.cy=function(){return this._private.cy};Gr.renderer=function(){return this._private.cy.renderer()};Gr.element=function(){return this[0]};Gr.collection=function(){return sz(this)?this:new ci(this._private.cy,[this])};Gr.unique=function(){return new ci(this._private.cy,this,!0)};Gr.hasElementWithId=function(t){return t=""+t,this._private.map.has(t)};Gr.getElementById=function(t){t=""+t;var e=this._private.cy,r=this._private.map.get(t);return r?r.ele:new ci(e)};Gr.$id=Gr.getElementById;Gr.poolIndex=function(){var t=this._private.cy,e=t._private.elements,r=this[0]._private.data.id;return e._private.map.get(r).index};Gr.indexOf=function(t){var e=t[0]._private.data.id;return this._private.map.get(e).index};Gr.indexOfId=function(t){return t=""+t,this._private.map.get(t).index};Gr.json=function(t){var e=this.element(),r=this.cy();if(e==null&&t)return this;if(e!=null){var n=e._private;if(vr(t)){if(r.startBatch(),t.data){e.data(t.data);var i=n.data;if(e.isEdge()){var a=!1,s={},o=t.data.source,l=t.data.target;o!=null&&o!=i.source&&(s.source=""+o,a=!0),l!=null&&l!=i.target&&(s.target=""+l,a=!0),a&&(e=e.move(s))}else{var u="parent"in t.data,h=t.data.parent;u&&(h!=null||i.parent!=null)&&h!=i.parent&&(h===void 0&&(h=null),h!=null&&(h=""+h),e=e.move({parent:h}))}}t.position&&e.position(t.position);var d=function(m,v,y){var b=t[m];b!=null&&b!==n[m]&&(b?e[v]():e[y]())};return d("removed","remove","restore"),d("selected","select","unselect"),d("selectable","selectify","unselectify"),d("locked","lock","unlock"),d("grabbable","grabify","ungrabify"),d("pannable","panify","unpanify"),t.classes!=null&&e.classes(t.classes),r.endBatch(),this}else if(t===void 0){var f={data:Ws(n.data),position:Ws(n.position),group:n.group,removed:n.removed,selected:n.selected,selectable:n.selectable,locked:n.locked,grabbable:n.grabbable,pannable:n.pannable,classes:null};f.classes="";var p=0;return n.classes.forEach(function(g){return f.classes+=p++===0?g:" "+g}),f}}};Gr.jsons=function(){for(var t=[],e=0;e<this.length;e++){var r=this[e],n=r.json();t.push(n)}return t};Gr.clone=function(){for(var t=this.cy(),e=[],r=0;r<this.length;r++){var n=this[r],i=n.json(),a=new L2(t,i,!1);e.push(a)}return new ci(t,e)};Gr.copy=Gr.clone;Gr.restore=function(){for(var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=this,n=r.cy(),i=n._private,a=[],s=[],o,l=0,u=r.length;l<u;l++){var h=r[l];e&&!h.removed()||(h.isNode()?a.push(h):s.push(h))}o=a.concat(s);var d,f=function(){o.splice(d,1),d--};for(d=0;d<o.length;d++){var p=o[d],g=p._private,m=g.data;if(p.clearTraversalCache(),!(!e&&!g.removed)){if(m.id===void 0)m.id=bz();else if(vt(m.id))m.id=""+m.id;else if(Vl(m.id)||!Bt(m.id)){Kr("Can not create element with invalid string ID `"+m.id+"`"),f();continue}else if(n.hasElementWithId(m.id)){Kr("Can not create second element with ID `"+m.id+"`"),f();continue}}var v=m.id;if(p.isNode()){var y=g.position;y.x==null&&(y.x=0),y.y==null&&(y.y=0)}if(p.isEdge()){for(var b=p,w=["source","target"],T=w.length,E=!1,L=0;L<T;L++){var S=w[L],C=m[S];vt(C)&&(C=m[S]=""+m[S]),C==null||C===""?(Kr("Can not create edge `"+v+"` with unspecified "+S),E=!0):n.hasElementWithId(C)||(Kr("Can not create edge `"+v+"` with nonexistant "+S+" `"+C+"`"),E=!0)}if(E){f();continue}var A=n.getElementById(m.source),N=n.getElementById(m.target);A.same(N)?A._private.edges.push(b):(A._private.edges.push(b),N._private.edges.push(b)),b._private.source=A,b._private.target=N}g.map=new Mo,g.map.set(v,{ele:p,index:0}),g.removed=!1,e&&n.addToPool(p)}for(var _=0;_<a.length;_++){var O=a[_],P=O._private.data;vt(P.parent)&&(P.parent=""+P.parent);var k=P.parent,R=k!=null;if(R||O._private.parent){var I=O._private.parent?n.collection().merge(O._private.parent):n.getElementById(k);if(I.empty())P.parent=void 0;else if(I[0].removed())Nr("Node added with missing parent, reference to parent removed"),P.parent=void 0,O._private.parent=null;else{for(var M=!1,D=I;!D.empty();){if(O.same(D)){M=!0,P.parent=void 0;break}D=D.parent()}M||(I[0]._private.children.push(O),O._private.parent=I[0],i.hasCompoundNodes=!0)}}}if(o.length>0){for(var B=o.length===r.length?r:new ci(n,o),$=0;$<B.length;$++){var F=B[$];F.isNode()||(F.parallelEdges().clearTraversalCache(),F.source().clearTraversalCache(),F.target().clearTraversalCache())}var G;i.hasCompoundNodes?G=n.collection().merge(B).merge(B.connectedNodes()).merge(B.parent()):G=B,G.dirtyCompoundBoundsCache().dirtyBoundingBoxCache().updateStyle(t),t?B.emitAndNotify("add"):e&&B.emit("add")}return r};Gr.removed=function(){var t=this[0];return t&&t._private.removed};Gr.inside=function(){var t=this[0];return t&&!t._private.removed};Gr.remove=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=this,n=[],i={},a=r._private.cy;function s(k){for(var R=k._private.edges,I=0;I<R.length;I++)l(R[I])}function o(k){for(var R=k._private.children,I=0;I<R.length;I++)l(R[I])}function l(k){var R=i[k.id()];e&&k.removed()||R||(i[k.id()]=!0,k.isNode()?(n.push(k),s(k),o(k)):n.unshift(k))}for(var u=0,h=r.length;u<h;u++){var d=r[u];l(d)}function f(k,R){var I=k._private.edges;Gl(I,R),k.clearTraversalCache()}function p(k){k.clearTraversalCache()}var g=[];g.ids={};function m(k,R){R=R[0],k=k[0];var I=k._private.children,M=k.id();Gl(I,R),R._private.parent=null,g.ids[M]||(g.ids[M]=!0,g.push(k))}r.dirtyCompoundBoundsCache(),e&&a.removeFromPool(n);for(var v=0;v<n.length;v++){var y=n[v];if(y.isEdge()){var b=y.source()[0],w=y.target()[0];f(b,y),f(w,y);for(var T=y.parallelEdges(),E=0;E<T.length;E++){var L=T[E];p(L),L.isBundledBezier()&&L.dirtyBoundingBoxCache()}}else{var S=y.parent();S.length!==0&&m(S,y)}e&&(y._private.removed=!0)}var C=a._private.elements;a._private.hasCompoundNodes=!1;for(var A=0;A<C.length;A++){var N=C[A];if(N.isParent()){a._private.hasCompoundNodes=!0;break}}var _=new ci(this.cy(),n);_.size()>0&&(t?_.emitAndNotify("remove"):e&&_.emit("remove"));for(var O=0;O<g.length;O++){var P=g[O];(!e||!P.removed())&&P.updateStyle()}return _};Gr.move=function(t){var e=this._private.cy,r=this,n=!1,i=!1,a=function(g){return g==null?g:""+g};if(t.source!==void 0||t.target!==void 0){var s=a(t.source),o=a(t.target),l=s!=null&&e.hasElementWithId(s),u=o!=null&&e.hasElementWithId(o);(l||u)&&(e.batch(function(){r.remove(n,i),r.emitAndNotify("moveout");for(var p=0;p<r.length;p++){var g=r[p],m=g._private.data;g.isEdge()&&(l&&(m.source=s),u&&(m.target=o))}r.restore(n,i)}),r.emitAndNotify("move"))}else if(t.parent!==void 0){var h=a(t.parent),d=h===null||e.hasElementWithId(h);if(d){var f=h===null?void 0:h;e.batch(function(){var p=r.remove(n,i);p.emitAndNotify("moveout");for(var g=0;g<r.length;g++){var m=r[g],v=m._private.data;m.isNode()&&(v.parent=f)}p.restore(n,i)}),r.emitAndNotify("move")}}return this};[Dz,Gye,rm,Ll,od,i2e,P2,b2e,nV,iV,S2e,Fv,nm,li,Rl,Ci].forEach(function(t){Gt(Gr,t)});var D2e={add:function(e){var r,n=this;if(Aa(e)){var i=e;if(i._private.cy===n)r=i.restore();else{for(var a=[],s=0;s<i.length;s++){var o=i[s];a.push(o.json())}r=new ci(n,a)}}else if(Br(e)){var l=e;r=new ci(n,l)}else if(vr(e)&&(Br(e.nodes)||Br(e.edges))){for(var u=e,h=[],d=["nodes","edges"],f=0,p=d.length;f<p;f++){var g=d[f],m=u[g];if(Br(m))for(var v=0,y=m.length;v<y;v++){var b=Gt({group:g},m[v]);h.push(b)}}r=new ci(n,h)}else{var w=e;r=new L2(n,w).collection()}return r},remove:function(e){if(!Aa(e)){if(Bt(e)){var r=e;e=this.$(r)}}return e.remove()}};/*! Bezier curve function generator. Copyright Gaetan Renaudeau. MIT License: http://en.wikipedia.org/wiki/MIT_License */function M2e(t,e,r,n){var i=4,a=.001,s=1e-7,o=10,l=11,u=1/(l-1),h=typeof Float32Array<"u";if(arguments.length!==4)return!1;for(var d=0;d<4;++d)if(typeof arguments[d]!="number"||isNaN(arguments[d])||!isFinite(arguments[d]))return!1;t=Math.min(t,1),r=Math.min(r,1),t=Math.max(t,0),r=Math.max(r,0);var f=h?new Float32Array(l):new Array(l);function p(N,_){return 1-3*_+3*N}function g(N,_){return 3*_-6*N}function m(N){return 3*N}function v(N,_,O){return((p(_,O)*N+g(_,O))*N+m(_))*N}function y(N,_,O){return 3*p(_,O)*N*N+2*g(_,O)*N+m(_)}function b(N,_){for(var O=0;O<i;++O){var P=y(_,t,r);if(P===0)return _;var k=v(_,t,r)-N;_-=k/P}return _}function w(){for(var N=0;N<l;++N)f[N]=v(N*u,t,r)}function T(N,_,O){var P,k,R=0;do k=_+(O-_)/2,P=v(k,t,r)-N,P>0?O=k:_=k;while(Math.abs(P)>s&&++R<o);return k}function E(N){for(var _=0,O=1,P=l-1;O!==P&&f[O]<=N;++O)_+=u;--O;var k=(N-f[O])/(f[O+1]-f[O]),R=_+k*u,I=y(R,t,r);return I>=a?b(N,R):I===0?R:T(N,_,_+u)}var L=!1;function S(){L=!0,(t!==e||r!==n)&&w()}var C=function(_){return L||S(),t===e&&r===n?_:_===0?0:_===1?1:v(E(_),e,n)};C.getControlPoints=function(){return[{x:t,y:e},{x:r,y:n}]};var A="generateBezier("+[t,e,r,n]+")";return C.toString=function(){return A},C}/*! Runge-Kutta spring physics function generator. Adapted from Framer.js, copyright Koen Bok. MIT License: http://en.wikipedia.org/wiki/MIT_License */var I2e=function(){function t(n){return-n.tension*n.x-n.friction*n.v}function e(n,i,a){var s={x:n.x+a.dx*i,v:n.v+a.dv*i,tension:n.tension,friction:n.friction};return{dx:s.v,dv:t(s)}}function r(n,i){var a={dx:n.v,dv:t(n)},s=e(n,i*.5,a),o=e(n,i*.5,s),l=e(n,i,o),u=1/6*(a.dx+2*(s.dx+o.dx)+l.dx),h=1/6*(a.dv+2*(s.dv+o.dv)+l.dv);return n.x=n.x+u*i,n.v=n.v+h*i,n}return function n(i,a,s){var o={x:-1,v:0,tension:null,friction:null},l=[0],u=0,h=1/1e4,d=16/1e3,f,p,g;for(i=parseFloat(i)||500,a=parseFloat(a)||20,s=s||null,o.tension=i,o.friction=a,f=s!==null,f?(u=n(i,a),p=u/s*d):p=d;g=r(g||o,p),l.push(1+g.x),u+=16,Math.abs(g.x)>h&&Math.abs(g.v)>h;);return f?function(m){return l[m*(l.length-1)|0]}:u}}(),$r=function(e,r,n,i){var a=M2e(e,r,n,i);return function(s,o,l){return s+(o-s)*a(l)}},im={linear:function(e,r,n){return e+(r-e)*n},ease:$r(.25,.1,.25,1),"ease-in":$r(.42,0,1,1),"ease-out":$r(0,0,.58,1),"ease-in-out":$r(.42,0,.58,1),"ease-in-sine":$r(.47,0,.745,.715),"ease-out-sine":$r(.39,.575,.565,1),"ease-in-out-sine":$r(.445,.05,.55,.95),"ease-in-quad":$r(.55,.085,.68,.53),"ease-out-quad":$r(.25,.46,.45,.94),"ease-in-out-quad":$r(.455,.03,.515,.955),"ease-in-cubic":$r(.55,.055,.675,.19),"ease-out-cubic":$r(.215,.61,.355,1),"ease-in-out-cubic":$r(.645,.045,.355,1),"ease-in-quart":$r(.895,.03,.685,.22),"ease-out-quart":$r(.165,.84,.44,1),"ease-in-out-quart":$r(.77,0,.175,1),"ease-in-quint":$r(.755,.05,.855,.06),"ease-out-quint":$r(.23,1,.32,1),"ease-in-out-quint":$r(.86,0,.07,1),"ease-in-expo":$r(.95,.05,.795,.035),"ease-out-expo":$r(.19,1,.22,1),"ease-in-out-expo":$r(1,0,0,1),"ease-in-circ":$r(.6,.04,.98,.335),"ease-out-circ":$r(.075,.82,.165,1),"ease-in-out-circ":$r(.785,.135,.15,.86),spring:function(e,r,n){if(n===0)return im.linear;var i=I2e(e,r,n);return function(a,s,o){return a+(s-a)*i(o)}},"cubic-bezier":$r};function N_(t,e,r,n,i){if(n===1||e===r)return r;var a=i(e,r,n);return t==null||((t.roundValue||t.color)&&(a=Math.round(a)),t.min!==void 0&&(a=Math.max(a,t.min)),t.max!==void 0&&(a=Math.min(a,t.max))),a}function D_(t,e){return t.pfValue!=null||t.value!=null?t.pfValue!=null&&(e==null||e.type.units!=="%")?t.pfValue:t.value:t}function Qu(t,e,r,n,i){var a=i!=null?i.type:null;r<0?r=0:r>1&&(r=1);var s=D_(t,i),o=D_(e,i);if(vt(s)&&vt(o))return N_(a,s,o,r,n);if(Br(s)&&Br(o)){for(var l=[],u=0;u<o.length;u++){var h=s[u],d=o[u];if(h!=null&&d!=null){var f=N_(a,h,d,r,n);l.push(f)}else l.push(d)}return l}}function O2e(t,e,r,n){var i=!n,a=t._private,s=e._private,o=s.easing,l=s.startTime,u=n?t:t.cy(),h=u.style();if(!s.easingImpl)if(o==null)s.easingImpl=im.linear;else{var d;if(Bt(o)){var f=h.parse("transition-timing-function",o);d=f.value}else d=o;var p,g;Bt(d)?(p=d,g=[]):(p=d[1],g=d.slice(2).map(function(B){return+B})),g.length>0?(p==="spring"&&g.push(s.duration),s.easingImpl=im[p].apply(null,g)):s.easingImpl=im[p]}var m=s.easingImpl,v;if(s.duration===0?v=1:v=(r-l)/s.duration,s.applying&&(v=s.progress),v<0?v=0:v>1&&(v=1),s.delay==null){var y=s.startPosition,b=s.position;if(b&&i&&!t.locked()){var w={};of(y.x,b.x)&&(w.x=Qu(y.x,b.x,v,m)),of(y.y,b.y)&&(w.y=Qu(y.y,b.y,v,m)),t.position(w)}var T=s.startPan,E=s.pan,L=a.pan,S=E!=null&&n;S&&(of(T.x,E.x)&&(L.x=Qu(T.x,E.x,v,m)),of(T.y,E.y)&&(L.y=Qu(T.y,E.y,v,m)),t.emit("pan"));var C=s.startZoom,A=s.zoom,N=A!=null&&n;N&&(of(C,A)&&(a.zoom=sp(a.minZoom,Qu(C,A,v,m),a.maxZoom)),t.emit("zoom")),(S||N)&&t.emit("viewport");var _=s.style;if(_&&_.length>0&&i){for(var O=0;O<_.length;O++){var P=_[O],k=P.name,R=P,I=s.startStyle[k],M=h.properties[I.name],D=Qu(I,R,v,m,M);h.overrideBypass(t,k,D)}t.emit("style")}}return s.progress=v,v}function of(t,e){return t==null||e==null?!1:vt(t)&&vt(e)?!0:!!(t&&e)}function P2e(t,e,r,n){var i=e._private;i.started=!0,i.startTime=r-i.progress*i.duration}function M_(t,e){var r=e._private.aniEles,n=[];function i(h,d){var f=h._private,p=f.animation.current,g=f.animation.queue,m=!1;if(p.length===0){var v=g.shift();v&&p.push(v)}for(var y=function(L){for(var S=L.length-1;S>=0;S--){var C=L[S];C()}L.splice(0,L.length)},b=p.length-1;b>=0;b--){var w=p[b],T=w._private;if(T.stopped){p.splice(b,1),T.hooked=!1,T.playing=!1,T.started=!1,y(T.frames);continue}!T.playing&&!T.applying||(T.playing&&T.applying&&(T.applying=!1),T.started||P2e(h,w,t),O2e(h,w,t,d),T.applying&&(T.applying=!1),y(T.frames),T.step!=null&&T.step(t),w.completed()&&(p.splice(b,1),T.hooked=!1,T.playing=!1,T.started=!1,y(T.completes)),m=!0)}return!d&&p.length===0&&g.length===0&&n.push(h),m}for(var a=!1,s=0;s<r.length;s++){var o=r[s],l=i(o);a=a||l}var u=i(e,!0);(a||u)&&(r.length>0?e.notify("draw",r):e.notify("draw")),r.unmerge(n),e.emit("step")}var B2e={animate:_r.animate(),animation:_r.animation(),animated:_r.animated(),clearQueue:_r.clearQueue(),delay:_r.delay(),delayAnimation:_r.delayAnimation(),stop:_r.stop(),addToAnimationPool:function(e){var r=this;r.styleEnabled()&&r._private.aniEles.merge(e)},stopAnimationLoop:function(){this._private.animationsRunning=!1},startAnimationLoop:function(){var e=this;if(e._private.animationsRunning=!0,!e.styleEnabled())return;function r(){e._private.animationsRunning&&Mv(function(a){M_(a,e),r()})}var n=e.renderer();n&&n.beforeRender?n.beforeRender(function(a,s){M_(s,e)},n.beforeRenderPriorities.animations):r()}},F2e={qualifierCompare:function(e,r){return e==null||r==null?e==null&&r==null:e.sameText(r)},eventMatches:function(e,r,n){var i=r.qualifier;return i!=null?e!==n.target&&Kp(n.target)&&i.matches(n.target):!0},addEventFields:function(e,r){r.cy=e,r.target=e},callbackContext:function(e,r,n){return r.qualifier!=null?n.target:e}},n1=function(e){return Bt(e)?new Wl(e):e},oV={createEmitter:function(){var e=this._private;return e.emitter||(e.emitter=new B2(F2e,this)),this},emitter:function(){return this._private.emitter},on:function(e,r,n){return this.emitter().on(e,n1(r),n),this},removeListener:function(e,r,n){return this.emitter().removeListener(e,n1(r),n),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},one:function(e,r,n){return this.emitter().one(e,n1(r),n),this},once:function(e,r,n){return this.emitter().one(e,n1(r),n),this},emit:function(e,r){return this.emitter().emit(e,r),this},emitAndNotify:function(e,r){return this.emit(e),this.notify(e,r),this}};_r.eventAliasesOn(oV);var dw={png:function(e){var r=this._private.renderer;return e=e||{},r.png(e)},jpg:function(e){var r=this._private.renderer;return e=e||{},e.bg=e.bg||"#fff",r.jpg(e)}};dw.jpeg=dw.jpg;var am={layout:function(e){var r=this;if(e==null){Kr("Layout options must be specified to make a layout");return}if(e.name==null){Kr("A `name` must be specified to make a layout");return}var n=e.name,i=r.extension("layout",n);if(i==null){Kr("No such layout `"+n+"` found.  Did you forget to import it and `cytoscape.use()` it?");return}var a;Bt(e.eles)?a=r.$(e.eles):a=e.eles!=null?e.eles:r.$();var s=new i(Gt({},e,{cy:r,eles:a}));return s}};am.createLayout=am.makeLayout=am.layout;var $2e={notify:function(e,r){var n=this._private;if(this.batching()){n.batchNotifications=n.batchNotifications||{};var i=n.batchNotifications[e]=n.batchNotifications[e]||this.collection();r!=null&&i.merge(r);return}if(n.notificationsEnabled){var a=this.renderer();this.destroyed()||!a||a.notify(e,r)}},notifications:function(e){var r=this._private;return e===void 0?r.notificationsEnabled:(r.notificationsEnabled=!!e,this)},noNotifications:function(e){this.notifications(!1),e(),this.notifications(!0)},batching:function(){return this._private.batchCount>0},startBatch:function(){var e=this._private;return e.batchCount==null&&(e.batchCount=0),e.batchCount===0&&(e.batchStyleEles=this.collection(),e.batchNotifications={}),e.batchCount++,this},endBatch:function(){var e=this._private;if(e.batchCount===0)return this;if(e.batchCount--,e.batchCount===0){e.batchStyleEles.updateStyle();var r=this.renderer();Object.keys(e.batchNotifications).forEach(function(n){var i=e.batchNotifications[n];i.empty()?r.notify(n):r.notify(n,i)})}return this},batch:function(e){return this.startBatch(),e(),this.endBatch(),this},batchData:function(e){var r=this;return this.batch(function(){for(var n=Object.keys(e),i=0;i<n.length;i++){var a=n[i],s=e[a],o=r.getElementById(a);o.data(s)}})}},z2e=hi({hideEdgesOnViewport:!1,textureOnViewport:!1,motionBlur:!1,motionBlurOpacity:.05,pixelRatio:void 0,desktopTapThreshold:4,touchTapThreshold:8,wheelSensitivity:1,debug:!1,showFps:!1,webgl:!1,webglDebug:!1,webglDebugShowAtlases:!1,webglTexSize:2048,webglTexRows:36,webglTexRowsNodes:18,webglBatchSize:2048,webglTexPerBatch:14,webglBgColor:[255,255,255]}),fw={renderTo:function(e,r,n,i){var a=this._private.renderer;return a.renderTo(e,r,n,i),this},renderer:function(){return this._private.renderer},forceRender:function(){return this.notify("draw"),this},resize:function(){return this.invalidateSize(),this.emitAndNotify("resize"),this},initRenderer:function(e){var r=this,n=r.extension("renderer",e.name);if(n==null){Kr("Can not initialise: No such renderer `".concat(e.name,"` found. Did you forget to import it and `cytoscape.use()` it?"));return}e.wheelSensitivity!==void 0&&Nr("You have set a custom wheel sensitivity.  This will make your app zoom unnaturally when using mainstream mice.  You should change this value from the default only if you can guarantee that all your users will use the same hardware and OS configuration as your current machine.");var i=z2e(e);i.cy=r,r._private.renderer=new n(i),this.notify("init")},destroyRenderer:function(){var e=this;e.notify("destroy");var r=e.container();if(r)for(r._cyreg=null;r.childNodes.length>0;)r.removeChild(r.childNodes[0]);e._private.renderer=null,e.mutableElements().forEach(function(n){var i=n._private;i.rscratch={},i.rstyle={},i.animation.current=[],i.animation.queue=[]})},onRender:function(e){return this.on("render",e)},offRender:function(e){return this.off("render",e)}};fw.invalidateDimensions=fw.resize;var sm={collection:function(e,r){return Bt(e)?this.$(e):Aa(e)?e.collection():Br(e)?(r||(r={}),new ci(this,e,r.unique,r.removed)):new ci(this)},nodes:function(e){var r=this.$(function(n){return n.isNode()});return e?r.filter(e):r},edges:function(e){var r=this.$(function(n){return n.isEdge()});return e?r.filter(e):r},$:function(e){var r=this._private.elements;return e?r.filter(e):r.spawnSelf()},mutableElements:function(){return this._private.elements}};sm.elements=sm.filter=sm.$;var Jn={},A0="t",V2e="f";Jn.apply=function(t){for(var e=this,r=e._private,n=r.cy,i=n.collection(),a=0;a<t.length;a++){var s=t[a],o=e.getContextMeta(s);if(!o.empty){var l=e.getContextStyle(o),u=e.applyContextStyle(o,l,s);s._private.appliedInitStyle?e.updateTransitions(s,u.diffProps):s._private.appliedInitStyle=!0;var h=e.updateStyleHints(s);h&&i.push(s)}}return i};Jn.getPropertiesDiff=function(t,e){var r=this,n=r._private.propDiffs=r._private.propDiffs||{},i=t+"-"+e,a=n[i];if(a)return a;for(var s=[],o={},l=0;l<r.length;l++){var u=r[l],h=t[l]===A0,d=e[l]===A0,f=h!==d,p=u.mappedProperties.length>0;if(f||d&&p){var g=void 0;f&&p||f?g=u.properties:p&&(g=u.mappedProperties);for(var m=0;m<g.length;m++){for(var v=g[m],y=v.name,b=!1,w=l+1;w<r.length;w++){var T=r[w],E=e[w]===A0;if(E&&(b=T.properties[v.name]!=null,b))break}!o[y]&&!b&&(o[y]=!0,s.push(y))}}}return n[i]=s,s};Jn.getContextMeta=function(t){for(var e=this,r="",n,i=t._private.styleCxtKey||"",a=0;a<e.length;a++){var s=e[a],o=s.selector&&s.selector.matches(t);o?r+=A0:r+=V2e}return n=e.getPropertiesDiff(i,r),t._private.styleCxtKey=r,{key:r,diffPropNames:n,empty:n.length===0}};Jn.getContextStyle=function(t){var e=t.key,r=this,n=this._private.contextStyles=this._private.contextStyles||{};if(n[e])return n[e];for(var i={_private:{key:e}},a=0;a<r.length;a++){var s=r[a],o=e[a]===A0;if(o)for(var l=0;l<s.properties.length;l++){var u=s.properties[l];i[u.name]=u}}return n[e]=i,i};Jn.applyContextStyle=function(t,e,r){for(var n=this,i=t.diffPropNames,a={},s=n.types,o=0;o<i.length;o++){var l=i[o],u=e[l],h=r.pstyle(l);if(!u)if(h)h.bypass?u={name:l,deleteBypassed:!0}:u={name:l,delete:!0};else continue;if(h!==u){if(u.mapped===s.fn&&h!=null&&h.mapping!=null&&h.mapping.value===u.value){var d=h.mapping,f=d.fnValue=u.value(r);if(f===d.prevFnValue)continue}var p=a[l]={prev:h};n.applyParsedProperty(r,u),p.next=r.pstyle(l),p.next&&p.next.bypass&&(p.next=p.next.bypassed)}}return{diffProps:a}};Jn.updateStyleHints=function(t){var e=t._private,r=this,n=r.propertyGroupNames,i=r.propertyGroupKeys,a=function(Y,ee,j){return r.getPropertiesHash(Y,ee,j)},s=e.styleKey;if(t.removed())return!1;var o=e.group==="nodes",l=t._private.style;n=Object.keys(l);for(var u=0;u<i.length;u++){var h=i[u];e.styleKeys[h]=[Pc,uh]}for(var d=function(Y,ee){return e.styleKeys[ee][0]=np(Y,e.styleKeys[ee][0])},f=function(Y,ee){return e.styleKeys[ee][1]=ip(Y,e.styleKeys[ee][1])},p=function(Y,ee){d(Y,ee),f(Y,ee)},g=function(Y,ee){for(var j=0;j<Y.length;j++){var fe=Y.charCodeAt(j);d(fe,ee),f(fe,ee)}},m=2e9,v=function(Y){return-128<Y&&Y<128&&Math.floor(Y)!==Y?m-(Y*1024|0):Y},y=0;y<n.length;y++){var b=n[y],w=l[b];if(w!=null){var T=this.properties[b],E=T.type,L=T.groupKey,S=void 0;T.hashOverride!=null?S=T.hashOverride(t,w):w.pfValue!=null&&(S=w.pfValue);var C=T.enums==null?w.value:null,A=S!=null,N=C!=null,_=A||N,O=w.units;if(E.number&&_&&!E.multiple){var P=A?S:C;p(v(P),L),!A&&O!=null&&g(O,L)}else g(w.strValue,L)}}for(var k=[Pc,uh],R=0;R<i.length;R++){var I=i[R],M=e.styleKeys[I];k[0]=np(M[0],k[0]),k[1]=ip(M[1],k[1])}e.styleKey=nme(k[0],k[1]);var D=e.styleKeys;e.labelDimsKey=hl(D.labelDimensions);var B=a(t,["label"],D.labelDimensions);if(e.labelKey=hl(B),e.labelStyleKey=hl(jg(D.commonLabel,B)),!o){var $=a(t,["source-label"],D.labelDimensions);e.sourceLabelKey=hl($),e.sourceLabelStyleKey=hl(jg(D.commonLabel,$));var F=a(t,["target-label"],D.labelDimensions);e.targetLabelKey=hl(F),e.targetLabelStyleKey=hl(jg(D.commonLabel,F))}if(o){var G=e.styleKeys,W=G.nodeBody,J=G.nodeBorder,q=G.nodeOutline,ne=G.backgroundImage,ae=G.compound,pe=G.pie,K=G.stripe,Z=[W,J,q,ne,ae,pe,K].filter(function(X){return X!=null}).reduce(jg,[Pc,uh]);e.nodeKey=hl(Z),e.hasPie=pe!=null&&pe[0]!==Pc&&pe[1]!==uh,e.hasStripe=K!=null&&K[0]!==Pc&&K[1]!==uh}return s!==e.styleKey};Jn.clearStyleHints=function(t){var e=t._private;e.styleCxtKey="",e.styleKeys={},e.styleKey=null,e.labelKey=null,e.labelStyleKey=null,e.sourceLabelKey=null,e.sourceLabelStyleKey=null,e.targetLabelKey=null,e.targetLabelStyleKey=null,e.nodeKey=null,e.hasPie=null,e.hasStripe=null};Jn.applyParsedProperty=function(t,e){var r=this,n=e,i=t._private.style,a,s=r.types,o=r.properties[n.name].type,l=n.bypass,u=i[n.name],h=u&&u.bypass,d=t._private,f="mapping",p=function(W){return W==null?null:W.pfValue!=null?W.pfValue:W.value},g=function(){var W=p(u),J=p(n);r.checkTriggers(t,n.name,W,J)};if(e.name==="curve-style"&&t.isEdge()&&(e.value!=="bezier"&&t.isLoop()||e.value==="haystack"&&(t.source().isParent()||t.target().isParent()))&&(n=e=this.parse(e.name,"bezier",l)),n.delete)return i[n.name]=void 0,g(),!0;if(n.deleteBypassed)return u?u.bypass?(u.bypassed=void 0,g(),!0):!1:(g(),!0);if(n.deleteBypass)return u?u.bypass?(i[n.name]=u.bypassed,g(),!0):!1:(g(),!0);var m=function(){Nr("Do not assign mappings to elements without corresponding data (i.e. ele `"+t.id()+"` has no mapping for property `"+n.name+"` with data field `"+n.field+"`); try a `["+n.field+"]` selector to limit scope to elements with `"+n.field+"` defined")};switch(n.mapped){case s.mapData:{for(var v=n.field.split("."),y=d.data,b=0;b<v.length&&y;b++){var w=v[b];y=y[w]}if(y==null)return m(),!1;var T;if(vt(y)){var E=n.fieldMax-n.fieldMin;E===0?T=0:T=(y-n.fieldMin)/E}else return Nr("Do not use continuous mappers without specifying numeric data (i.e. `"+n.field+": "+y+"` for `"+t.id()+"` is non-numeric)"),!1;if(T<0?T=0:T>1&&(T=1),o.color){var L=n.valueMin[0],S=n.valueMax[0],C=n.valueMin[1],A=n.valueMax[1],N=n.valueMin[2],_=n.valueMax[2],O=n.valueMin[3]==null?1:n.valueMin[3],P=n.valueMax[3]==null?1:n.valueMax[3],k=[Math.round(L+(S-L)*T),Math.round(C+(A-C)*T),Math.round(N+(_-N)*T),Math.round(O+(P-O)*T)];a={bypass:n.bypass,name:n.name,value:k,strValue:"rgb("+k[0]+", "+k[1]+", "+k[2]+")"}}else if(o.number){var R=n.valueMin+(n.valueMax-n.valueMin)*T;a=this.parse(n.name,R,n.bypass,f)}else return!1;if(!a)return m(),!1;a.mapping=n,n=a;break}case s.data:{for(var I=n.field.split("."),M=d.data,D=0;D<I.length&&M;D++){var B=I[D];M=M[B]}if(M!=null&&(a=this.parse(n.name,M,n.bypass,f)),!a)return m(),!1;a.mapping=n,n=a;break}case s.fn:{var $=n.value,F=n.fnValue!=null?n.fnValue:$(t);if(n.prevFnValue=F,F==null)return Nr("Custom function mappers may not return null (i.e. `"+n.name+"` for ele `"+t.id()+"` is null)"),!1;if(a=this.parse(n.name,F,n.bypass,f),!a)return Nr("Custom function mappers may not return invalid values for the property type (i.e. `"+n.name+"` for ele `"+t.id()+"` is invalid)"),!1;a.mapping=Ws(n),n=a;break}case void 0:break;default:return!1}return l?(h?n.bypassed=u.bypassed:n.bypassed=u,i[n.name]=n):h?u.bypassed=n:i[n.name]=n,g(),!0};Jn.cleanElements=function(t,e){for(var r=0;r<t.length;r++){var n=t[r];if(this.clearStyleHints(n),n.dirtyCompoundBoundsCache(),n.dirtyBoundingBoxCache(),!e)n._private.style={};else for(var i=n._private.style,a=Object.keys(i),s=0;s<a.length;s++){var o=a[s],l=i[o];l!=null&&(l.bypass?l.bypassed=null:i[o]=null)}}};Jn.update=function(){var t=this._private.cy,e=t.mutableElements();e.updateStyle()};Jn.updateTransitions=function(t,e){var r=this,n=t._private,i=t.pstyle("transition-property").value,a=t.pstyle("transition-duration").pfValue,s=t.pstyle("transition-delay").pfValue;if(i.length>0&&a>0){for(var o={},l=!1,u=0;u<i.length;u++){var h=i[u],d=t.pstyle(h),f=e[h];if(f){var p=f.prev,g=p,m=f.next!=null?f.next:d,v=!1,y=void 0,b=1e-6;g&&(vt(g.pfValue)&&vt(m.pfValue)?(v=m.pfValue-g.pfValue,y=g.pfValue+b*v):vt(g.value)&&vt(m.value)?(v=m.value-g.value,y=g.value+b*v):Br(g.value)&&Br(m.value)&&(v=g.value[0]!==m.value[0]||g.value[1]!==m.value[1]||g.value[2]!==m.value[2],y=g.strValue),v&&(o[h]=m.strValue,this.applyBypass(t,h,y),l=!0))}}if(!l)return;n.transitioning=!0,new Nd(function(w){s>0?t.delayAnimation(s).play().promise().then(w):w()}).then(function(){return t.animation({style:o,duration:a,easing:t.pstyle("transition-timing-function").value,queue:!1}).play().promise()}).then(function(){r.removeBypasses(t,i),t.emitAndNotify("style"),n.transitioning=!1})}else n.transitioning&&(this.removeBypasses(t,i),t.emitAndNotify("style"),n.transitioning=!1)};Jn.checkTrigger=function(t,e,r,n,i,a){var s=this.properties[e],o=i(s);t.removed()||o!=null&&o(r,n,t)&&a(s)};Jn.checkZOrderTrigger=function(t,e,r,n){var i=this;this.checkTrigger(t,e,r,n,function(a){return a.triggersZOrder},function(){i._private.cy.notify("zorder",t)})};Jn.checkBoundsTrigger=function(t,e,r,n){this.checkTrigger(t,e,r,n,function(i){return i.triggersBounds},function(i){t.dirtyCompoundBoundsCache(),t.dirtyBoundingBoxCache()})};Jn.checkConnectedEdgesBoundsTrigger=function(t,e,r,n){this.checkTrigger(t,e,r,n,function(i){return i.triggersBoundsOfConnectedEdges},function(i){t.connectedEdges().forEach(function(a){a.dirtyBoundingBoxCache()})})};Jn.checkParallelEdgesBoundsTrigger=function(t,e,r,n){this.checkTrigger(t,e,r,n,function(i){return i.triggersBoundsOfParallelEdges},function(i){t.parallelEdges().forEach(function(a){a.dirtyBoundingBoxCache()})})};Jn.checkTriggers=function(t,e,r,n){t.dirtyStyleCache(),this.checkZOrderTrigger(t,e,r,n),this.checkBoundsTrigger(t,e,r,n),this.checkConnectedEdgesBoundsTrigger(t,e,r,n),this.checkParallelEdgesBoundsTrigger(t,e,r,n)};var ng={};ng.applyBypass=function(t,e,r,n){var i=this,a=[],s=!0;if(e==="*"||e==="**"){if(r!==void 0)for(var o=0;o<i.properties.length;o++){var l=i.properties[o],u=l.name,h=this.parse(u,r,!0);h&&a.push(h)}}else if(Bt(e)){var d=this.parse(e,r,!0);d&&a.push(d)}else if(vr(e)){var f=e;n=r;for(var p=Object.keys(f),g=0;g<p.length;g++){var m=p[g],v=f[m];if(v===void 0&&(v=f[A2(m)]),v!==void 0){var y=this.parse(m,v,!0);y&&a.push(y)}}}else return!1;if(a.length===0)return!1;for(var b=!1,w=0;w<t.length;w++){for(var T=t[w],E={},L=void 0,S=0;S<a.length;S++){var C=a[S];if(n){var A=T.pstyle(C.name);L=E[C.name]={prev:A}}b=this.applyParsedProperty(T,Ws(C))||b,n&&(L.next=T.pstyle(C.name))}b&&this.updateStyleHints(T),n&&this.updateTransitions(T,E,s)}return b};ng.overrideBypass=function(t,e,r){e=GE(e);for(var n=0;n<t.length;n++){var i=t[n],a=i._private.style[e],s=this.properties[e].type,o=s.color,l=s.mutiple,u=a?a.pfValue!=null?a.pfValue:a.value:null;!a||!a.bypass?this.applyBypass(i,e,r):(a.value=r,a.pfValue!=null&&(a.pfValue=r),o?a.strValue="rgb("+r.join(",")+")":l?a.strValue=r.join(" "):a.strValue=""+r,this.updateStyleHints(i)),this.checkTriggers(i,e,u,r)}};ng.removeAllBypasses=function(t,e){return this.removeBypasses(t,this.propertyNames,e)};ng.removeBypasses=function(t,e,r){for(var n=!0,i=0;i<t.length;i++){for(var a=t[i],s={},o=0;o<e.length;o++){var l=e[o],u=this.properties[l],h=a.pstyle(u.name);if(!(!h||!h.bypass)){var d="",f=this.parse(l,d,!0),p=s[u.name]={prev:h};this.applyParsedProperty(a,f),p.next=a.pstyle(u.name)}}this.updateStyleHints(a),r&&this.updateTransitions(a,s,n)}};var nk={};nk.getEmSizeInPixels=function(){var t=this.containerCss("font-size");return t!=null?parseFloat(t):1};nk.containerCss=function(t){var e=this._private.cy,r=e.container(),n=e.window();if(n&&r&&n.getComputedStyle)return n.getComputedStyle(r).getPropertyValue(t)};var Qs={};Qs.getRenderedStyle=function(t,e){return e?this.getStylePropertyValue(t,e,!0):this.getRawStyle(t,!0)};Qs.getRawStyle=function(t,e){var r=this;if(t=t[0],t){for(var n={},i=0;i<r.properties.length;i++){var a=r.properties[i],s=r.getStylePropertyValue(t,a.name,e);s!=null&&(n[a.name]=s,n[A2(a.name)]=s)}return n}};Qs.getIndexedStyle=function(t,e,r,n){var i=t.pstyle(e)[r][n];return i??t.cy().style().getDefaultProperty(e)[r][0]};Qs.getStylePropertyValue=function(t,e,r){var n=this;if(t=t[0],t){var i=n.properties[e];i.alias&&(i=i.pointsTo);var a=i.type,s=t.pstyle(i.name);if(s){var o=s.value,l=s.units,u=s.strValue;if(r&&a.number&&o!=null&&vt(o)){var h=t.cy().zoom(),d=function(v){return v*h},f=function(v,y){return d(v)+y},p=Br(o),g=p?l.every(function(m){return m!=null}):l!=null;return g?p?o.map(function(m,v){return f(m,l[v])}).join(" "):f(o,l):p?o.map(function(m){return Bt(m)?m:""+d(m)}).join(" "):""+d(o)}else if(u!=null)return u}return null}};Qs.getAnimationStartStyle=function(t,e){for(var r={},n=0;n<e.length;n++){var i=e[n],a=i.name,s=t.pstyle(a);s!==void 0&&(vr(s)?s=this.parse(a,s.strValue):s=this.parse(a,s)),s&&(r[a]=s)}return r};Qs.getPropsList=function(t){var e=this,r=[],n=t,i=e.properties;if(n)for(var a=Object.keys(n),s=0;s<a.length;s++){var o=a[s],l=n[o],u=i[o]||i[GE(o)],h=this.parse(u.name,l);h&&r.push(h)}return r};Qs.getNonDefaultPropertiesHash=function(t,e,r){var n=r.slice(),i,a,s,o,l,u;for(l=0;l<e.length;l++)if(i=e[l],a=t.pstyle(i,!1),a!=null)if(a.pfValue!=null)n[0]=np(o,n[0]),n[1]=ip(o,n[1]);else for(s=a.strValue,u=0;u<s.length;u++)o=s.charCodeAt(u),n[0]=np(o,n[0]),n[1]=ip(o,n[1]);return n};Qs.getPropertiesHash=Qs.getNonDefaultPropertiesHash;var z2={};z2.appendFromJson=function(t){for(var e=this,r=0;r<t.length;r++){var n=t[r],i=n.selector,a=n.style||n.css,s=Object.keys(a);e.selector(i);for(var o=0;o<s.length;o++){var l=s[o],u=a[l];e.css(l,u)}}return e};z2.fromJson=function(t){var e=this;return e.resetToDefault(),e.appendFromJson(t),e};z2.json=function(){for(var t=[],e=this.defaultLength;e<this.length;e++){for(var r=this[e],n=r.selector,i=r.properties,a={},s=0;s<i.length;s++){var o=i[s];a[o.name]=o.strValue}t.push({selector:n?n.toString():"core",style:a})}return t};var ik={};ik.appendFromString=function(t){var e=this,r=this,n=""+t,i,a,s;n=n.replace(/[/][*](\s|.)+?[*][/]/g,"");function o(){n.length>i.length?n=n.substr(i.length):n=""}function l(){a.length>s.length?a=a.substr(s.length):a=""}for(;;){var u=n.match(/^\s*$/);if(u)break;var h=n.match(/^\s*((?:.|\s)+?)\s*\{((?:.|\s)+?)\}/);if(!h){Nr("Halting stylesheet parsing: String stylesheet contains more to parse but no selector and block found in: "+n);break}i=h[0];var d=h[1];if(d!=="core"){var f=new Wl(d);if(f.invalid){Nr("Skipping parsing of block: Invalid selector found in string stylesheet: "+d),o();continue}}var p=h[2],g=!1;a=p;for(var m=[];;){var v=a.match(/^\s*$/);if(v)break;var y=a.match(/^\s*(.+?)\s*:\s*(.+?)(?:\s*;|\s*$)/);if(!y){Nr("Skipping parsing of block: Invalid formatting of style property and value definitions found in:"+p),g=!0;break}s=y[0];var b=y[1],w=y[2],T=e.properties[b];if(!T){Nr("Skipping property: Invalid property name in: "+s),l();continue}var E=r.parse(b,w);if(!E){Nr("Skipping property: Invalid property definition in: "+s),l();continue}m.push({name:b,val:w}),l()}if(g){o();break}r.selector(d);for(var L=0;L<m.length;L++){var S=m[L];r.css(S.name,S.val)}o()}return r};ik.fromString=function(t){var e=this;return e.resetToDefault(),e.appendFromString(t),e};var wn={};(function(){var t=Pn,e=O1e,r=B1e,n=F1e,i=$1e,a=function(X){return"^"+X+"\\s*\\(\\s*([\\w\\.]+)\\s*\\)$"},s=function(X){var Y=t+"|\\w+|"+e+"|"+r+"|"+n+"|"+i;return"^"+X+"\\s*\\(([\\w\\.]+)\\s*\\,\\s*("+t+")\\s*\\,\\s*("+t+")\\s*,\\s*("+Y+")\\s*\\,\\s*("+Y+")\\)$"},o=[`^url\\s*\\(\\s*['"]?(.+?)['"]?\\s*\\)$`,"^(none)$","^(.+)$"];wn.types={time:{number:!0,min:0,units:"s|ms",implicitUnits:"ms"},percent:{number:!0,min:0,max:100,units:"%",implicitUnits:"%"},percentages:{number:!0,min:0,max:100,units:"%",implicitUnits:"%",multiple:!0},zeroOneNumber:{number:!0,min:0,max:1,unitless:!0},zeroOneNumbers:{number:!0,min:0,max:1,unitless:!0,multiple:!0},nOneOneNumber:{number:!0,min:-1,max:1,unitless:!0},nonNegativeInt:{number:!0,min:0,integer:!0,unitless:!0},nonNegativeNumber:{number:!0,min:0,unitless:!0},position:{enums:["parent","origin"]},nodeSize:{number:!0,min:0,enums:["label"]},number:{number:!0,unitless:!0},numbers:{number:!0,unitless:!0,multiple:!0},positiveNumber:{number:!0,unitless:!0,min:0,strictMin:!0},size:{number:!0,min:0},bidirectionalSize:{number:!0},bidirectionalSizeMaybePercent:{number:!0,allowPercent:!0},bidirectionalSizes:{number:!0,multiple:!0},sizeMaybePercent:{number:!0,min:0,allowPercent:!0},axisDirection:{enums:["horizontal","leftward","rightward","vertical","upward","downward","auto"]},axisDirectionExplicit:{enums:["leftward","rightward","upward","downward"]},axisDirectionPrimary:{enums:["horizontal","vertical"]},paddingRelativeTo:{enums:["width","height","average","min","max"]},bgWH:{number:!0,min:0,allowPercent:!0,enums:["auto"],multiple:!0},bgPos:{number:!0,allowPercent:!0,multiple:!0},bgRelativeTo:{enums:["inner","include-padding"],multiple:!0},bgRepeat:{enums:["repeat","repeat-x","repeat-y","no-repeat"],multiple:!0},bgFit:{enums:["none","contain","cover"],multiple:!0},bgCrossOrigin:{enums:["anonymous","use-credentials","null"],multiple:!0},bgClip:{enums:["none","node"],multiple:!0},bgContainment:{enums:["inside","over"],multiple:!0},boxSelection:{enums:["contain","overlap","none"]},color:{color:!0},colors:{color:!0,multiple:!0},fill:{enums:["solid","linear-gradient","radial-gradient"]},bool:{enums:["yes","no"]},bools:{enums:["yes","no"],multiple:!0},lineStyle:{enums:["solid","dotted","dashed"]},lineCap:{enums:["butt","round","square"]},linePosition:{enums:["center","inside","outside"]},lineJoin:{enums:["round","bevel","miter"]},borderStyle:{enums:["solid","dotted","dashed","double"]},curveStyle:{enums:["bezier","unbundled-bezier","haystack","segments","straight","straight-triangle","taxi","round-segments","round-taxi"]},radiusType:{enums:["arc-radius","influence-radius"],multiple:!0},fontFamily:{regex:'^([\\w- \\"]+(?:\\s*,\\s*[\\w- \\"]+)*)$'},fontStyle:{enums:["italic","normal","oblique"]},fontWeight:{enums:["normal","bold","bolder","lighter","100","200","300","400","500","600","800","900",100,200,300,400,500,600,700,800,900]},textDecoration:{enums:["none","underline","overline","line-through"]},textTransform:{enums:["none","uppercase","lowercase"]},textWrap:{enums:["none","wrap","ellipsis"]},textOverflowWrap:{enums:["whitespace","anywhere"]},textBackgroundShape:{enums:["rectangle","roundrectangle","round-rectangle","circle"]},nodeShape:{enums:["rectangle","roundrectangle","round-rectangle","cutrectangle","cut-rectangle","bottomroundrectangle","bottom-round-rectangle","barrel","ellipse","triangle","round-triangle","square","pentagon","round-pentagon","hexagon","round-hexagon","concavehexagon","concave-hexagon","heptagon","round-heptagon","octagon","round-octagon","tag","round-tag","star","diamond","round-diamond","vee","rhomboid","right-rhomboid","polygon"]},overlayShape:{enums:["roundrectangle","round-rectangle","ellipse"]},cornerRadius:{number:!0,min:0,units:"px|em",implicitUnits:"px",enums:["auto"]},compoundIncludeLabels:{enums:["include","exclude"]},arrowShape:{enums:["tee","triangle","triangle-tee","circle-triangle","triangle-cross","triangle-backcurve","vee","square","circle","diamond","chevron","none"]},arrowFill:{enums:["filled","hollow"]},arrowWidth:{number:!0,units:"%|px|em",implicitUnits:"px",enums:["match-line"]},display:{enums:["element","none"]},visibility:{enums:["hidden","visible"]},zCompoundDepth:{enums:["bottom","orphan","auto","top"]},zIndexCompare:{enums:["auto","manual"]},valign:{enums:["top","center","bottom"]},halign:{enums:["left","center","right"]},justification:{enums:["left","center","right","auto"]},text:{string:!0},data:{mapping:!0,regex:a("data")},layoutData:{mapping:!0,regex:a("layoutData")},scratch:{mapping:!0,regex:a("scratch")},mapData:{mapping:!0,regex:s("mapData")},mapLayoutData:{mapping:!0,regex:s("mapLayoutData")},mapScratch:{mapping:!0,regex:s("mapScratch")},fn:{mapping:!0,fn:!0},url:{regexes:o,singleRegexMatchValue:!0},urls:{regexes:o,singleRegexMatchValue:!0,multiple:!0},propList:{propList:!0},angle:{number:!0,units:"deg|rad",implicitUnits:"rad"},textRotation:{number:!0,units:"deg|rad",implicitUnits:"rad",enums:["none","autorotate"]},polygonPointList:{number:!0,multiple:!0,evenMultiple:!0,min:-1,max:1,unitless:!0},edgeDistances:{enums:["intersection","node-position","endpoints"]},edgeEndpoint:{number:!0,multiple:!0,units:"%|px|em|deg|rad",implicitUnits:"px",enums:["inside-to-node","outside-to-node","outside-to-node-or-label","outside-to-line","outside-to-line-or-label"],singleEnum:!0,validate:function(X,Y){switch(X.length){case 2:return Y[0]!=="deg"&&Y[0]!=="rad"&&Y[1]!=="deg"&&Y[1]!=="rad";case 1:return Bt(X[0])||Y[0]==="deg"||Y[0]==="rad";default:return!1}}},easing:{regexes:["^(spring)\\s*\\(\\s*("+t+")\\s*,\\s*("+t+")\\s*\\)$","^(cubic-bezier)\\s*\\(\\s*("+t+")\\s*,\\s*("+t+")\\s*,\\s*("+t+")\\s*,\\s*("+t+")\\s*\\)$"],enums:["linear","ease","ease-in","ease-out","ease-in-out","ease-in-sine","ease-out-sine","ease-in-out-sine","ease-in-quad","ease-out-quad","ease-in-out-quad","ease-in-cubic","ease-out-cubic","ease-in-out-cubic","ease-in-quart","ease-out-quart","ease-in-out-quart","ease-in-quint","ease-out-quint","ease-in-out-quint","ease-in-expo","ease-out-expo","ease-in-out-expo","ease-in-circ","ease-out-circ","ease-in-out-circ"]},gradientDirection:{enums:["to-bottom","to-top","to-left","to-right","to-bottom-right","to-bottom-left","to-top-right","to-top-left","to-right-bottom","to-left-bottom","to-right-top","to-left-top"]},boundsExpansion:{number:!0,multiple:!0,min:0,validate:function(X){var Y=X.length;return Y===1||Y===2||Y===4}}};var l={zeroNonZero:function(X,Y){return(X==null||Y==null)&&X!==Y||X==0&&Y!=0?!0:X!=0&&Y==0},any:function(X,Y){return X!=Y},emptyNonEmpty:function(X,Y){var ee=Vl(X),j=Vl(Y);return ee&&!j||!ee&&j}},u=wn.types,h=[{name:"label",type:u.text,triggersBounds:l.any,triggersZOrder:l.emptyNonEmpty},{name:"text-rotation",type:u.textRotation,triggersBounds:l.any},{name:"text-margin-x",type:u.bidirectionalSize,triggersBounds:l.any},{name:"text-margin-y",type:u.bidirectionalSize,triggersBounds:l.any}],d=[{name:"source-label",type:u.text,triggersBounds:l.any},{name:"source-text-rotation",type:u.textRotation,triggersBounds:l.any},{name:"source-text-margin-x",type:u.bidirectionalSize,triggersBounds:l.any},{name:"source-text-margin-y",type:u.bidirectionalSize,triggersBounds:l.any},{name:"source-text-offset",type:u.size,triggersBounds:l.any}],f=[{name:"target-label",type:u.text,triggersBounds:l.any},{name:"target-text-rotation",type:u.textRotation,triggersBounds:l.any},{name:"target-text-margin-x",type:u.bidirectionalSize,triggersBounds:l.any},{name:"target-text-margin-y",type:u.bidirectionalSize,triggersBounds:l.any},{name:"target-text-offset",type:u.size,triggersBounds:l.any}],p=[{name:"font-family",type:u.fontFamily,triggersBounds:l.any},{name:"font-style",type:u.fontStyle,triggersBounds:l.any},{name:"font-weight",type:u.fontWeight,triggersBounds:l.any},{name:"font-size",type:u.size,triggersBounds:l.any},{name:"text-transform",type:u.textTransform,triggersBounds:l.any},{name:"text-wrap",type:u.textWrap,triggersBounds:l.any},{name:"text-overflow-wrap",type:u.textOverflowWrap,triggersBounds:l.any},{name:"text-max-width",type:u.size,triggersBounds:l.any},{name:"text-outline-width",type:u.size,triggersBounds:l.any},{name:"line-height",type:u.positiveNumber,triggersBounds:l.any}],g=[{name:"text-valign",type:u.valign,triggersBounds:l.any},{name:"text-halign",type:u.halign,triggersBounds:l.any},{name:"color",type:u.color},{name:"text-outline-color",type:u.color},{name:"text-outline-opacity",type:u.zeroOneNumber},{name:"text-background-color",type:u.color},{name:"text-background-opacity",type:u.zeroOneNumber},{name:"text-background-padding",type:u.size,triggersBounds:l.any},{name:"text-border-opacity",type:u.zeroOneNumber},{name:"text-border-color",type:u.color},{name:"text-border-width",type:u.size,triggersBounds:l.any},{name:"text-border-style",type:u.borderStyle,triggersBounds:l.any},{name:"text-background-shape",type:u.textBackgroundShape,triggersBounds:l.any},{name:"text-justification",type:u.justification},{name:"box-select-labels",type:u.bool,triggersBounds:l.any}],m=[{name:"events",type:u.bool,triggersZOrder:l.any},{name:"text-events",type:u.bool,triggersZOrder:l.any},{name:"box-selection",type:u.boxSelection,triggersZOrder:l.any}],v=[{name:"display",type:u.display,triggersZOrder:l.any,triggersBounds:l.any,triggersBoundsOfConnectedEdges:l.any,triggersBoundsOfParallelEdges:function(X,Y,ee){return X===Y?!1:ee.pstyle("curve-style").value==="bezier"}},{name:"visibility",type:u.visibility,triggersZOrder:l.any},{name:"opacity",type:u.zeroOneNumber,triggersZOrder:l.zeroNonZero},{name:"text-opacity",type:u.zeroOneNumber},{name:"min-zoomed-font-size",type:u.size},{name:"z-compound-depth",type:u.zCompoundDepth,triggersZOrder:l.any},{name:"z-index-compare",type:u.zIndexCompare,triggersZOrder:l.any},{name:"z-index",type:u.number,triggersZOrder:l.any}],y=[{name:"overlay-padding",type:u.size,triggersBounds:l.any},{name:"overlay-color",type:u.color},{name:"overlay-opacity",type:u.zeroOneNumber,triggersBounds:l.zeroNonZero},{name:"overlay-shape",type:u.overlayShape,triggersBounds:l.any},{name:"overlay-corner-radius",type:u.cornerRadius}],b=[{name:"underlay-padding",type:u.size,triggersBounds:l.any},{name:"underlay-color",type:u.color},{name:"underlay-opacity",type:u.zeroOneNumber,triggersBounds:l.zeroNonZero},{name:"underlay-shape",type:u.overlayShape,triggersBounds:l.any},{name:"underlay-corner-radius",type:u.cornerRadius}],w=[{name:"transition-property",type:u.propList},{name:"transition-duration",type:u.time},{name:"transition-delay",type:u.time},{name:"transition-timing-function",type:u.easing}],T=function(X,Y){return Y.value==="label"?-X.poolIndex():Y.pfValue},E=[{name:"height",type:u.nodeSize,triggersBounds:l.any,hashOverride:T},{name:"width",type:u.nodeSize,triggersBounds:l.any,hashOverride:T},{name:"shape",type:u.nodeShape,triggersBounds:l.any},{name:"shape-polygon-points",type:u.polygonPointList,triggersBounds:l.any},{name:"corner-radius",type:u.cornerRadius},{name:"background-color",type:u.color},{name:"background-fill",type:u.fill},{name:"background-opacity",type:u.zeroOneNumber},{name:"background-blacken",type:u.nOneOneNumber},{name:"background-gradient-stop-colors",type:u.colors},{name:"background-gradient-stop-positions",type:u.percentages},{name:"background-gradient-direction",type:u.gradientDirection},{name:"padding",type:u.sizeMaybePercent,triggersBounds:l.any},{name:"padding-relative-to",type:u.paddingRelativeTo,triggersBounds:l.any},{name:"bounds-expansion",type:u.boundsExpansion,triggersBounds:l.any}],L=[{name:"border-color",type:u.color},{name:"border-opacity",type:u.zeroOneNumber},{name:"border-width",type:u.size,triggersBounds:l.any},{name:"border-style",type:u.borderStyle},{name:"border-cap",type:u.lineCap},{name:"border-join",type:u.lineJoin},{name:"border-dash-pattern",type:u.numbers},{name:"border-dash-offset",type:u.number},{name:"border-position",type:u.linePosition}],S=[{name:"outline-color",type:u.color},{name:"outline-opacity",type:u.zeroOneNumber},{name:"outline-width",type:u.size,triggersBounds:l.any},{name:"outline-style",type:u.borderStyle},{name:"outline-offset",type:u.size,triggersBounds:l.any}],C=[{name:"background-image",type:u.urls},{name:"background-image-crossorigin",type:u.bgCrossOrigin},{name:"background-image-opacity",type:u.zeroOneNumbers},{name:"background-image-containment",type:u.bgContainment},{name:"background-image-smoothing",type:u.bools},{name:"background-position-x",type:u.bgPos},{name:"background-position-y",type:u.bgPos},{name:"background-width-relative-to",type:u.bgRelativeTo},{name:"background-height-relative-to",type:u.bgRelativeTo},{name:"background-repeat",type:u.bgRepeat},{name:"background-fit",type:u.bgFit},{name:"background-clip",type:u.bgClip},{name:"background-width",type:u.bgWH},{name:"background-height",type:u.bgWH},{name:"background-offset-x",type:u.bgPos},{name:"background-offset-y",type:u.bgPos}],A=[{name:"position",type:u.position,triggersBounds:l.any},{name:"compound-sizing-wrt-labels",type:u.compoundIncludeLabels,triggersBounds:l.any},{name:"min-width",type:u.size,triggersBounds:l.any},{name:"min-width-bias-left",type:u.sizeMaybePercent,triggersBounds:l.any},{name:"min-width-bias-right",type:u.sizeMaybePercent,triggersBounds:l.any},{name:"min-height",type:u.size,triggersBounds:l.any},{name:"min-height-bias-top",type:u.sizeMaybePercent,triggersBounds:l.any},{name:"min-height-bias-bottom",type:u.sizeMaybePercent,triggersBounds:l.any}],N=[{name:"line-style",type:u.lineStyle},{name:"line-color",type:u.color},{name:"line-fill",type:u.fill},{name:"line-cap",type:u.lineCap},{name:"line-opacity",type:u.zeroOneNumber},{name:"line-dash-pattern",type:u.numbers},{name:"line-dash-offset",type:u.number},{name:"line-outline-width",type:u.size},{name:"line-outline-color",type:u.color},{name:"line-gradient-stop-colors",type:u.colors},{name:"line-gradient-stop-positions",type:u.percentages},{name:"curve-style",type:u.curveStyle,triggersBounds:l.any,triggersBoundsOfParallelEdges:function(X,Y){return X===Y?!1:X==="bezier"||Y==="bezier"}},{name:"haystack-radius",type:u.zeroOneNumber,triggersBounds:l.any},{name:"source-endpoint",type:u.edgeEndpoint,triggersBounds:l.any},{name:"target-endpoint",type:u.edgeEndpoint,triggersBounds:l.any},{name:"control-point-step-size",type:u.size,triggersBounds:l.any},{name:"control-point-distances",type:u.bidirectionalSizes,triggersBounds:l.any},{name:"control-point-weights",type:u.numbers,triggersBounds:l.any},{name:"segment-distances",type:u.bidirectionalSizes,triggersBounds:l.any},{name:"segment-weights",type:u.numbers,triggersBounds:l.any},{name:"segment-radii",type:u.numbers,triggersBounds:l.any},{name:"radius-type",type:u.radiusType,triggersBounds:l.any},{name:"taxi-turn",type:u.bidirectionalSizeMaybePercent,triggersBounds:l.any},{name:"taxi-turn-min-distance",type:u.size,triggersBounds:l.any},{name:"taxi-direction",type:u.axisDirection,triggersBounds:l.any},{name:"taxi-radius",type:u.number,triggersBounds:l.any},{name:"edge-distances",type:u.edgeDistances,triggersBounds:l.any},{name:"arrow-scale",type:u.positiveNumber,triggersBounds:l.any},{name:"loop-direction",type:u.angle,triggersBounds:l.any},{name:"loop-sweep",type:u.angle,triggersBounds:l.any},{name:"source-distance-from-node",type:u.size,triggersBounds:l.any},{name:"target-distance-from-node",type:u.size,triggersBounds:l.any}],_=[{name:"ghost",type:u.bool,triggersBounds:l.any},{name:"ghost-offset-x",type:u.bidirectionalSize,triggersBounds:l.any},{name:"ghost-offset-y",type:u.bidirectionalSize,triggersBounds:l.any},{name:"ghost-opacity",type:u.zeroOneNumber}],O=[{name:"selection-box-color",type:u.color},{name:"selection-box-opacity",type:u.zeroOneNumber},{name:"selection-box-border-color",type:u.color},{name:"selection-box-border-width",type:u.size},{name:"active-bg-color",type:u.color},{name:"active-bg-opacity",type:u.zeroOneNumber},{name:"active-bg-size",type:u.size},{name:"outside-texture-bg-color",type:u.color},{name:"outside-texture-bg-opacity",type:u.zeroOneNumber}],P=[];wn.pieBackgroundN=16,P.push({name:"pie-size",type:u.sizeMaybePercent}),P.push({name:"pie-hole",type:u.sizeMaybePercent}),P.push({name:"pie-start-angle",type:u.angle});for(var k=1;k<=wn.pieBackgroundN;k++)P.push({name:"pie-"+k+"-background-color",type:u.color}),P.push({name:"pie-"+k+"-background-size",type:u.percent}),P.push({name:"pie-"+k+"-background-opacity",type:u.zeroOneNumber});var R=[];wn.stripeBackgroundN=16,R.push({name:"stripe-size",type:u.sizeMaybePercent}),R.push({name:"stripe-direction",type:u.axisDirectionPrimary});for(var I=1;I<=wn.stripeBackgroundN;I++)R.push({name:"stripe-"+I+"-background-color",type:u.color}),R.push({name:"stripe-"+I+"-background-size",type:u.percent}),R.push({name:"stripe-"+I+"-background-opacity",type:u.zeroOneNumber});var M=[],D=wn.arrowPrefixes=["source","mid-source","target","mid-target"];[{name:"arrow-shape",type:u.arrowShape,triggersBounds:l.any},{name:"arrow-color",type:u.color},{name:"arrow-fill",type:u.arrowFill},{name:"arrow-width",type:u.arrowWidth}].forEach(function(Z){D.forEach(function(X){var Y=X+"-"+Z.name,ee=Z.type,j=Z.triggersBounds;M.push({name:Y,type:ee,triggersBounds:j})})},{});var B=wn.properties=[].concat(m,w,v,y,b,_,g,p,h,d,f,E,L,S,C,P,R,A,N,M,O),$=wn.propertyGroups={behavior:m,transition:w,visibility:v,overlay:y,underlay:b,ghost:_,commonLabel:g,labelDimensions:p,mainLabel:h,sourceLabel:d,targetLabel:f,nodeBody:E,nodeBorder:L,nodeOutline:S,backgroundImage:C,pie:P,stripe:R,compound:A,edgeLine:N,edgeArrow:M,core:O},F=wn.propertyGroupNames={},G=wn.propertyGroupKeys=Object.keys($);G.forEach(function(Z){F[Z]=$[Z].map(function(X){return X.name}),$[Z].forEach(function(X){return X.groupKey=Z})});var W=wn.aliases=[{name:"content",pointsTo:"label"},{name:"control-point-distance",pointsTo:"control-point-distances"},{name:"control-point-weight",pointsTo:"control-point-weights"},{name:"segment-distance",pointsTo:"segment-distances"},{name:"segment-weight",pointsTo:"segment-weights"},{name:"segment-radius",pointsTo:"segment-radii"},{name:"edge-text-rotation",pointsTo:"text-rotation"},{name:"padding-left",pointsTo:"padding"},{name:"padding-right",pointsTo:"padding"},{name:"padding-top",pointsTo:"padding"},{name:"padding-bottom",pointsTo:"padding"}];wn.propertyNames=B.map(function(Z){return Z.name});for(var J=0;J<B.length;J++){var q=B[J];B[q.name]=q}for(var ne=0;ne<W.length;ne++){var ae=W[ne],pe=B[ae.pointsTo],K={name:ae.name,alias:!0,pointsTo:pe};B.push(K),B[ae.name]=K}})();wn.getDefaultProperty=function(t){return this.getDefaultProperties()[t]};wn.getDefaultProperties=function(){var t=this._private;if(t.defaultProperties!=null)return t.defaultProperties;for(var e=Gt({"selection-box-color":"#ddd","selection-box-opacity":.65,"selection-box-border-color":"#aaa","selection-box-border-width":1,"active-bg-color":"black","active-bg-opacity":.15,"active-bg-size":30,"outside-texture-bg-color":"#000","outside-texture-bg-opacity":.125,events:"yes","text-events":"no","text-valign":"top","text-halign":"center","text-justification":"auto","line-height":1,color:"#000","box-selection":"contain","text-outline-color":"#000","text-outline-width":0,"text-outline-opacity":1,"text-opacity":1,"text-decoration":"none","text-transform":"none","text-wrap":"none","text-overflow-wrap":"whitespace","text-max-width":9999,"text-background-color":"#000","text-background-opacity":0,"text-background-shape":"rectangle","text-background-padding":0,"text-border-opacity":0,"text-border-width":0,"text-border-style":"solid","text-border-color":"#000","font-family":"Helvetica Neue, Helvetica, sans-serif","font-style":"normal","font-weight":"normal","font-size":16,"min-zoomed-font-size":0,"text-rotation":"none","source-text-rotation":"none","target-text-rotation":"none",visibility:"visible",display:"element",opacity:1,"z-compound-depth":"auto","z-index-compare":"auto","z-index":0,label:"","text-margin-x":0,"text-margin-y":0,"source-label":"","source-text-offset":0,"source-text-margin-x":0,"source-text-margin-y":0,"target-label":"","target-text-offset":0,"target-text-margin-x":0,"target-text-margin-y":0,"overlay-opacity":0,"overlay-color":"#000","overlay-padding":10,"overlay-shape":"round-rectangle","overlay-corner-radius":"auto","underlay-opacity":0,"underlay-color":"#000","underlay-padding":10,"underlay-shape":"round-rectangle","underlay-corner-radius":"auto","transition-property":"none","transition-duration":0,"transition-delay":0,"transition-timing-function":"linear","box-select-labels":"no","background-blacken":0,"background-color":"#999","background-fill":"solid","background-opacity":1,"background-image":"none","background-image-crossorigin":"anonymous","background-image-opacity":1,"background-image-containment":"inside","background-image-smoothing":"yes","background-position-x":"50%","background-position-y":"50%","background-offset-x":0,"background-offset-y":0,"background-width-relative-to":"include-padding","background-height-relative-to":"include-padding","background-repeat":"no-repeat","background-fit":"none","background-clip":"node","background-width":"auto","background-height":"auto","border-color":"#000","border-opacity":1,"border-width":0,"border-style":"solid","border-dash-pattern":[4,2],"border-dash-offset":0,"border-cap":"butt","border-join":"miter","border-position":"center","outline-color":"#999","outline-opacity":1,"outline-width":0,"outline-offset":0,"outline-style":"solid",height:30,width:30,shape:"ellipse","shape-polygon-points":"-1, -1,   1, -1,   1, 1,   -1, 1","corner-radius":"auto","bounds-expansion":0,"background-gradient-direction":"to-bottom","background-gradient-stop-colors":"#999","background-gradient-stop-positions":"0%",ghost:"no","ghost-offset-y":0,"ghost-offset-x":0,"ghost-opacity":0,padding:0,"padding-relative-to":"width",position:"origin","compound-sizing-wrt-labels":"include","min-width":0,"min-width-bias-left":0,"min-width-bias-right":0,"min-height":0,"min-height-bias-top":0,"min-height-bias-bottom":0},{"pie-size":"100%","pie-hole":0,"pie-start-angle":"0deg"},[{name:"pie-{{i}}-background-color",value:"black"},{name:"pie-{{i}}-background-size",value:"0%"},{name:"pie-{{i}}-background-opacity",value:1}].reduce(function(l,u){for(var h=1;h<=wn.pieBackgroundN;h++){var d=u.name.replace("{{i}}",h),f=u.value;l[d]=f}return l},{}),{"stripe-size":"100%","stripe-direction":"horizontal"},[{name:"stripe-{{i}}-background-color",value:"black"},{name:"stripe-{{i}}-background-size",value:"0%"},{name:"stripe-{{i}}-background-opacity",value:1}].reduce(function(l,u){for(var h=1;h<=wn.stripeBackgroundN;h++){var d=u.name.replace("{{i}}",h),f=u.value;l[d]=f}return l},{}),{"line-style":"solid","line-color":"#999","line-fill":"solid","line-cap":"butt","line-opacity":1,"line-outline-width":0,"line-outline-color":"#000","line-gradient-stop-colors":"#999","line-gradient-stop-positions":"0%","control-point-step-size":40,"control-point-weights":.5,"segment-weights":.5,"segment-distances":20,"segment-radii":15,"radius-type":"arc-radius","taxi-turn":"50%","taxi-radius":15,"taxi-turn-min-distance":10,"taxi-direction":"auto","edge-distances":"intersection","curve-style":"haystack","haystack-radius":0,"arrow-scale":1,"loop-direction":"-45deg","loop-sweep":"-90deg","source-distance-from-node":0,"target-distance-from-node":0,"source-endpoint":"outside-to-node","target-endpoint":"outside-to-node","line-dash-pattern":[6,3],"line-dash-offset":0},[{name:"arrow-shape",value:"none"},{name:"arrow-color",value:"#999"},{name:"arrow-fill",value:"filled"},{name:"arrow-width",value:1}].reduce(function(l,u){return wn.arrowPrefixes.forEach(function(h){var d=h+"-"+u.name,f=u.value;l[d]=f}),l},{})),r={},n=0;n<this.properties.length;n++){var i=this.properties[n];if(!i.pointsTo){var a=i.name,s=e[a],o=this.parse(a,s);r[a]=o}}return t.defaultProperties=r,t.defaultProperties};wn.addDefaultStylesheet=function(){this.selector(":parent").css({shape:"rectangle",padding:10,"background-color":"#eee","border-color":"#ccc","border-width":1}).selector("edge").css({width:3}).selector(":loop").css({"curve-style":"bezier"}).selector("edge:compound").css({"curve-style":"bezier","source-endpoint":"outside-to-line","target-endpoint":"outside-to-line"}).selector(":selected").css({"background-color":"#0169D9","line-color":"#0169D9","source-arrow-color":"#0169D9","target-arrow-color":"#0169D9","mid-source-arrow-color":"#0169D9","mid-target-arrow-color":"#0169D9"}).selector(":parent:selected").css({"background-color":"#CCE1F9","border-color":"#aec8e5"}).selector(":active").css({"overlay-color":"black","overlay-padding":10,"overlay-opacity":.25}),this.defaultLength=this.length};var V2={};V2.parse=function(t,e,r,n){var i=this;if(nn(e))return i.parseImplWarn(t,e,r,n);var a=n==="mapping"||n===!0||n===!1||n==null?"dontcare":n,s=r?"t":"f",o=""+e,l=vz(t,o,s,a),u=i.propCache=i.propCache||[],h;return(h=u[l])||(h=u[l]=i.parseImplWarn(t,e,r,n)),(r||n==="mapping")&&(h=Ws(h),h&&(h.value=Ws(h.value))),h};V2.parseImplWarn=function(t,e,r,n){var i=this.parseImpl(t,e,r,n);return!i&&e!=null&&Nr("The style property `".concat(t,": ").concat(e,"` is invalid")),i&&(i.name==="width"||i.name==="height")&&e==="label"&&Nr("The style value of `label` is deprecated for `"+i.name+"`"),i};V2.parseImpl=function(t,e,r,n){var i=this;t=GE(t);var a=i.properties[t],s=e,o=i.types;if(!a||e===void 0)return null;a.alias&&(a=a.pointsTo,t=a.name);var l=Bt(e);l&&(e=e.trim());var u=a.type;if(!u)return null;if(r&&(e===""||e===null))return{name:t,value:e,bypass:!0,deleteBypass:!0};if(nn(e))return{name:t,value:e,strValue:"fn",mapped:o.fn,bypass:r};var h,d;if(!(!l||n||e.length<7||e[1]!=="a")){if(e.length>=7&&e[0]==="d"&&(h=new RegExp(o.data.regex).exec(e))){if(r)return!1;var f=o.data;return{name:t,value:h,strValue:""+e,mapped:f,field:h[1],bypass:r}}else if(e.length>=10&&e[0]==="m"&&(d=new RegExp(o.mapData.regex).exec(e))){if(r||u.multiple)return!1;var p=o.mapData;if(!(u.color||u.number))return!1;var g=this.parse(t,d[4]);if(!g||g.mapped)return!1;var m=this.parse(t,d[5]);if(!m||m.mapped)return!1;if(g.pfValue===m.pfValue||g.strValue===m.strValue)return Nr("`"+t+": "+e+"` is not a valid mapper because the output range is zero; converting to `"+t+": "+g.strValue+"`"),this.parse(t,g.strValue);if(u.color){var v=g.value,y=m.value,b=v[0]===y[0]&&v[1]===y[1]&&v[2]===y[2]&&(v[3]===y[3]||(v[3]==null||v[3]===1)&&(y[3]==null||y[3]===1));if(b)return!1}return{name:t,value:d,strValue:""+e,mapped:p,field:d[1],fieldMin:parseFloat(d[2]),fieldMax:parseFloat(d[3]),valueMin:g.value,valueMax:m.value,bypass:r}}}if(u.multiple&&n!=="multiple"){var w;if(l?w=e.split(/\s+/):Br(e)?w=e:w=[e],u.evenMultiple&&w.length%2!==0)return null;for(var T=[],E=[],L=[],S="",C=!1,A=0;A<w.length;A++){var N=i.parse(t,w[A],r,"multiple");C=C||Bt(N.value),T.push(N.value),L.push(N.pfValue!=null?N.pfValue:N.value),E.push(N.units),S+=(A>0?" ":"")+N.strValue}return u.validate&&!u.validate(T,E)?null:u.singleEnum&&C?T.length===1&&Bt(T[0])?{name:t,value:T[0],strValue:T[0],bypass:r}:null:{name:t,value:T,pfValue:L,strValue:S,bypass:r,units:E}}var _=function(){for(var K=0;K<u.enums.length;K++){var Z=u.enums[K];if(Z===e)return{name:t,value:e,strValue:""+e,bypass:r}}return null};if(u.number){var O,P="px";if(u.units&&(O=u.units),u.implicitUnits&&(P=u.implicitUnits),!u.unitless)if(l){var k="px|em"+(u.allowPercent?"|\\%":"");O&&(k=O);var R=e.match("^("+Pn+")("+k+")?$");R&&(e=R[1],O=R[2]||P)}else(!O||u.implicitUnits)&&(O=P);if(e=parseFloat(e),isNaN(e)&&u.enums===void 0)return null;if(isNaN(e)&&u.enums!==void 0)return e=s,_();if(u.integer&&!_1e(e)||u.min!==void 0&&(e<u.min||u.strictMin&&e===u.min)||u.max!==void 0&&(e>u.max||u.strictMax&&e===u.max))return null;var I={name:t,value:e,strValue:""+e+(O||""),units:O,bypass:r};return u.unitless||O!=="px"&&O!=="em"?I.pfValue=e:I.pfValue=O==="px"||!O?e:this.getEmSizeInPixels()*e,(O==="ms"||O==="s")&&(I.pfValue=O==="ms"?e:1e3*e),(O==="deg"||O==="rad")&&(I.pfValue=O==="rad"?e:Fme(e)),O==="%"&&(I.pfValue=e/100),I}else if(u.propList){var M=[],D=""+e;if(D!=="none"){for(var B=D.split(/\s*,\s*|\s+/),$=0;$<B.length;$++){var F=B[$].trim();i.properties[F]?M.push(F):Nr("`"+F+"` is not a valid property name")}if(M.length===0)return null}return{name:t,value:M,strValue:M.length===0?"none":M.join(" "),bypass:r}}else if(u.color){var G=uz(e);return G?{name:t,value:G,pfValue:G,strValue:"rgb("+G[0]+","+G[1]+","+G[2]+")",bypass:r}:null}else if(u.regex||u.regexes){if(u.enums){var W=_();if(W)return W}for(var J=u.regexes?u.regexes:[u.regex],q=0;q<J.length;q++){var ne=new RegExp(J[q]),ae=ne.exec(e);if(ae)return{name:t,value:u.singleRegexMatchValue?ae[1]:ae,strValue:""+e,bypass:r}}return null}else return u.string?{name:t,value:""+e,strValue:""+e,bypass:r}:u.enums?_():null};var jn=function(e){if(!(this instanceof jn))return new jn(e);if(!VE(e)){Kr("A style must have a core reference");return}this._private={cy:e,coreStyle:{}},this.length=0,this.resetToDefault()},Ai=jn.prototype;Ai.instanceString=function(){return"style"};Ai.clear=function(){for(var t=this._private,e=t.cy,r=e.elements(),n=0;n<this.length;n++)this[n]=void 0;return this.length=0,t.contextStyles={},t.propDiffs={},this.cleanElements(r,!0),r.forEach(function(i){var a=i[0]._private;a.styleDirty=!0,a.appliedInitStyle=!1}),this};Ai.resetToDefault=function(){return this.clear(),this.addDefaultStylesheet(),this};Ai.core=function(t){return this._private.coreStyle[t]||this.getDefaultProperty(t)};Ai.selector=function(t){var e=t==="core"?null:new Wl(t),r=this.length++;return this[r]={selector:e,properties:[],mappedProperties:[],index:r},this};Ai.css=function(){var t=this,e=arguments;if(e.length===1)for(var r=e[0],n=0;n<t.properties.length;n++){var i=t.properties[n],a=r[i.name];a===void 0&&(a=r[A2(i.name)]),a!==void 0&&this.cssRule(i.name,a)}else e.length===2&&this.cssRule(e[0],e[1]);return this};Ai.style=Ai.css;Ai.cssRule=function(t,e){var r=this.parse(t,e);if(r){var n=this.length-1;this[n].properties.push(r),this[n].properties[r.name]=r,r.name.match(/pie-(\d+)-background-size/)&&r.value&&(this._private.hasPie=!0),r.name.match(/stripe-(\d+)-background-size/)&&r.value&&(this._private.hasStripe=!0),r.mapped&&this[n].mappedProperties.push(r);var i=!this[n].selector;i&&(this._private.coreStyle[r.name]=r)}return this};Ai.append=function(t){return oz(t)?t.appendToStyle(this):Br(t)?this.appendFromJson(t):Bt(t)&&this.appendFromString(t),this};jn.fromJson=function(t,e){var r=new jn(t);return r.fromJson(e),r};jn.fromString=function(t,e){return new jn(t).fromString(e)};[Jn,ng,nk,Qs,z2,ik,wn,V2].forEach(function(t){Gt(Ai,t)});jn.types=Ai.types;jn.properties=Ai.properties;jn.propertyGroups=Ai.propertyGroups;jn.propertyGroupNames=Ai.propertyGroupNames;jn.propertyGroupKeys=Ai.propertyGroupKeys;var G2e={style:function(e){if(e){var r=this.setStyle(e);r.update()}return this._private.style},setStyle:function(e){var r=this._private;return oz(e)?r.style=e.generateStyle(this):Br(e)?r.style=jn.fromJson(this,e):Bt(e)?r.style=jn.fromString(this,e):r.style=jn(this),r.style},updateStyle:function(){this.mutableElements().updateStyle()}},U2e="single",gu={autolock:function(e){if(e!==void 0)this._private.autolock=!!e;else return this._private.autolock;return this},autoungrabify:function(e){if(e!==void 0)this._private.autoungrabify=!!e;else return this._private.autoungrabify;return this},autounselectify:function(e){if(e!==void 0)this._private.autounselectify=!!e;else return this._private.autounselectify;return this},selectionType:function(e){var r=this._private;if(r.selectionType==null&&(r.selectionType=U2e),e!==void 0)(e==="additive"||e==="single")&&(r.selectionType=e);else return r.selectionType;return this},panningEnabled:function(e){if(e!==void 0)this._private.panningEnabled=!!e;else return this._private.panningEnabled;return this},userPanningEnabled:function(e){if(e!==void 0)this._private.userPanningEnabled=!!e;else return this._private.userPanningEnabled;return this},zoomingEnabled:function(e){if(e!==void 0)this._private.zoomingEnabled=!!e;else return this._private.zoomingEnabled;return this},userZoomingEnabled:function(e){if(e!==void 0)this._private.userZoomingEnabled=!!e;else return this._private.userZoomingEnabled;return this},boxSelectionEnabled:function(e){if(e!==void 0)this._private.boxSelectionEnabled=!!e;else return this._private.boxSelectionEnabled;return this},pan:function(){var e=arguments,r=this._private.pan,n,i,a,s,o;switch(e.length){case 0:return r;case 1:if(Bt(e[0]))return n=e[0],r[n];if(vr(e[0])){if(!this._private.panningEnabled)return this;a=e[0],s=a.x,o=a.y,vt(s)&&(r.x=s),vt(o)&&(r.y=o),this.emit("pan viewport")}break;case 2:if(!this._private.panningEnabled)return this;n=e[0],i=e[1],(n==="x"||n==="y")&&vt(i)&&(r[n]=i),this.emit("pan viewport");break}return this.notify("viewport"),this},panBy:function(e,r){var n=arguments,i=this._private.pan,a,s,o,l,u;if(!this._private.panningEnabled)return this;switch(n.length){case 1:vr(e)&&(o=n[0],l=o.x,u=o.y,vt(l)&&(i.x+=l),vt(u)&&(i.y+=u),this.emit("pan viewport"));break;case 2:a=e,s=r,(a==="x"||a==="y")&&vt(s)&&(i[a]+=s),this.emit("pan viewport");break}return this.notify("viewport"),this},gc:function(){this.notify("gc")},fit:function(e,r){var n=this.getFitViewport(e,r);if(n){var i=this._private;i.zoom=n.zoom,i.pan=n.pan,this.emit("pan zoom viewport"),this.notify("viewport")}return this},getFitViewport:function(e,r){if(vt(e)&&r===void 0&&(r=e,e=void 0),!(!this._private.panningEnabled||!this._private.zoomingEnabled)){var n;if(Bt(e)){var i=e;e=this.$(i)}else if(N1e(e)){var a=e;n={x1:a.x1,y1:a.y1,x2:a.x2,y2:a.y2},n.w=n.x2-n.x1,n.h=n.y2-n.y1}else Aa(e)||(e=this.mutableElements());if(!(Aa(e)&&e.empty())){n=n||e.boundingBox();var s=this.width(),o=this.height(),l;if(r=vt(r)?r:0,!isNaN(s)&&!isNaN(o)&&s>0&&o>0&&!isNaN(n.w)&&!isNaN(n.h)&&n.w>0&&n.h>0){l=Math.min((s-2*r)/n.w,(o-2*r)/n.h),l=l>this._private.maxZoom?this._private.maxZoom:l,l=l<this._private.minZoom?this._private.minZoom:l;var u={x:(s-l*(n.x1+n.x2))/2,y:(o-l*(n.y1+n.y2))/2};return{zoom:l,pan:u}}}}},zoomRange:function(e,r){var n=this._private;if(r==null){var i=e;e=i.min,r=i.max}return vt(e)&&vt(r)&&e<=r?(n.minZoom=e,n.maxZoom=r):vt(e)&&r===void 0&&e<=n.maxZoom?n.minZoom=e:vt(r)&&e===void 0&&r>=n.minZoom&&(n.maxZoom=r),this},minZoom:function(e){return e===void 0?this._private.minZoom:this.zoomRange({min:e})},maxZoom:function(e){return e===void 0?this._private.maxZoom:this.zoomRange({max:e})},getZoomedViewport:function(e){var r=this._private,n=r.pan,i=r.zoom,a,s,o=!1;if(r.zoomingEnabled||(o=!0),vt(e)?s=e:vr(e)&&(s=e.level,e.position!=null?a=R2(e.position,i,n):e.renderedPosition!=null&&(a=e.renderedPosition),a!=null&&!r.panningEnabled&&(o=!0)),s=s>r.maxZoom?r.maxZoom:s,s=s<r.minZoom?r.minZoom:s,o||!vt(s)||s===i||a!=null&&(!vt(a.x)||!vt(a.y)))return null;if(a!=null){var l=n,u=i,h=s,d={x:-h/u*(a.x-l.x)+a.x,y:-h/u*(a.y-l.y)+a.y};return{zoomed:!0,panned:!0,zoom:h,pan:d}}else return{zoomed:!0,panned:!1,zoom:s,pan:n}},zoom:function(e){if(e===void 0)return this._private.zoom;var r=this.getZoomedViewport(e),n=this._private;return r==null||!r.zoomed?this:(n.zoom=r.zoom,r.panned&&(n.pan.x=r.pan.x,n.pan.y=r.pan.y),this.emit("zoom"+(r.panned?" pan":"")+" viewport"),this.notify("viewport"),this)},viewport:function(e){var r=this._private,n=!0,i=!0,a=[],s=!1,o=!1;if(!e)return this;if(vt(e.zoom)||(n=!1),vr(e.pan)||(i=!1),!n&&!i)return this;if(n){var l=e.zoom;l<r.minZoom||l>r.maxZoom||!r.zoomingEnabled?s=!0:(r.zoom=l,a.push("zoom"))}if(i&&(!s||!e.cancelOnFailedZoom)&&r.panningEnabled){var u=e.pan;vt(u.x)&&(r.pan.x=u.x,o=!1),vt(u.y)&&(r.pan.y=u.y,o=!1),o||a.push("pan")}return a.length>0&&(a.push("viewport"),this.emit(a.join(" ")),this.notify("viewport")),this},center:function(e){var r=this.getCenterPan(e);return r&&(this._private.pan=r,this.emit("pan viewport"),this.notify("viewport")),this},getCenterPan:function(e,r){if(this._private.panningEnabled){if(Bt(e)){var n=e;e=this.mutableElements().filter(n)}else Aa(e)||(e=this.mutableElements());if(e.length!==0){var i=e.boundingBox(),a=this.width(),s=this.height();r=r===void 0?this._private.zoom:r;var o={x:(a-r*(i.x1+i.x2))/2,y:(s-r*(i.y1+i.y2))/2};return o}}},reset:function(){return!this._private.panningEnabled||!this._private.zoomingEnabled?this:(this.viewport({pan:{x:0,y:0},zoom:1}),this)},invalidateSize:function(){this._private.sizeCache=null},size:function(){var e=this._private,r=e.container,n=this;return e.sizeCache=e.sizeCache||(r?function(){var i=n.window().getComputedStyle(r),a=function(o){return parseFloat(i.getPropertyValue(o))};return{width:r.clientWidth-a("padding-left")-a("padding-right"),height:r.clientHeight-a("padding-top")-a("padding-bottom")}}():{width:1,height:1})},width:function(){return this.size().width},height:function(){return this.size().height},extent:function(){var e=this._private.pan,r=this._private.zoom,n=this.renderedExtent(),i={x1:(n.x1-e.x)/r,x2:(n.x2-e.x)/r,y1:(n.y1-e.y)/r,y2:(n.y2-e.y)/r};return i.w=i.x2-i.x1,i.h=i.y2-i.y1,i},renderedExtent:function(){var e=this.width(),r=this.height();return{x1:0,y1:0,x2:e,y2:r,w:e,h:r}},multiClickDebounceTime:function(e){if(e)this._private.multiClickDebounceTime=e;else return this._private.multiClickDebounceTime;return this}};gu.centre=gu.center;gu.autolockNodes=gu.autolock;gu.autoungrabifyNodes=gu.autoungrabify;var up={data:_r.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeData:_r.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),scratch:_r.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:_r.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0})};up.attr=up.data;up.removeAttr=up.removeData;var hp=function(e){var r=this;e=Gt({},e);var n=e.container;n&&!Dv(n)&&Dv(n[0])&&(n=n[0]);var i=n?n._cyreg:null;i=i||{},i&&i.cy&&(i.cy.destroy(),i={});var a=i.readies=i.readies||[];n&&(n._cyreg=i),i.cy=r;var s=Dn!==void 0&&n!==void 0&&!e.headless,o=e;o.layout=Gt({name:s?"grid":"null"},o.layout),o.renderer=Gt({name:s?"canvas":"null"},o.renderer);var l=function(g,m,v){return m!==void 0?m:v!==void 0?v:g},u=this._private={container:n,ready:!1,options:o,elements:new ci(this),listeners:[],aniEles:new ci(this),data:o.data||{},scratch:{},layout:null,renderer:null,destroyed:!1,notificationsEnabled:!0,minZoom:1e-50,maxZoom:1e50,zoomingEnabled:l(!0,o.zoomingEnabled),userZoomingEnabled:l(!0,o.userZoomingEnabled),panningEnabled:l(!0,o.panningEnabled),userPanningEnabled:l(!0,o.userPanningEnabled),boxSelectionEnabled:l(!0,o.boxSelectionEnabled),autolock:l(!1,o.autolock,o.autolockNodes),autoungrabify:l(!1,o.autoungrabify,o.autoungrabifyNodes),autounselectify:l(!1,o.autounselectify),styleEnabled:o.styleEnabled===void 0?s:o.styleEnabled,zoom:vt(o.zoom)?o.zoom:1,pan:{x:vr(o.pan)&&vt(o.pan.x)?o.pan.x:0,y:vr(o.pan)&&vt(o.pan.y)?o.pan.y:0},animation:{current:[],queue:[]},hasCompoundNodes:!1,multiClickDebounceTime:l(250,o.multiClickDebounceTime)};this.createEmitter(),this.selectionType(o.selectionType),this.zoomRange({min:o.minZoom,max:o.maxZoom});var h=function(g,m){var v=g.some(D1e);if(v)return Nd.all(g).then(m);m(g)};u.styleEnabled&&r.setStyle([]);var d=Gt({},o,o.renderer);r.initRenderer(d);var f=function(g,m,v){r.notifications(!1);var y=r.mutableElements();y.length>0&&y.remove(),g!=null&&(vr(g)||Br(g))&&r.add(g),r.one("layoutready",function(w){r.notifications(!0),r.emit(w),r.one("load",m),r.emitAndNotify("load")}).one("layoutstop",function(){r.one("done",v),r.emit("done")});var b=Gt({},r._private.options.layout);b.eles=r.elements(),r.layout(b).run()};h([o.style,o.elements],function(p){var g=p[0],m=p[1];u.styleEnabled&&r.style().append(g),f(m,function(){r.startAnimationLoop(),u.ready=!0,nn(o.ready)&&r.on("ready",o.ready);for(var v=0;v<a.length;v++){var y=a[v];r.on("ready",y)}i&&(i.readies=[]),r.emit("ready")},o.done)})},$v=hp.prototype;Gt($v,{instanceString:function(){return"core"},isReady:function(){return this._private.ready},destroyed:function(){return this._private.destroyed},ready:function(e){return this.isReady()?this.emitter().emit("ready",[],e):this.on("ready",e),this},destroy:function(){var e=this;if(!e.destroyed())return e.stopAnimationLoop(),e.destroyRenderer(),this.emit("destroy"),e._private.destroyed=!0,e},hasElementWithId:function(e){return this._private.elements.hasElementWithId(e)},getElementById:function(e){return this._private.elements.getElementById(e)},hasCompoundNodes:function(){return this._private.hasCompoundNodes},headless:function(){return this._private.renderer.isHeadless()},styleEnabled:function(){return this._private.styleEnabled},addToPool:function(e){return this._private.elements.merge(e),this},removeFromPool:function(e){return this._private.elements.unmerge(e),this},container:function(){return this._private.container||null},window:function(){var e=this._private.container;if(e==null)return Dn;var r=this._private.container.ownerDocument;return r===void 0||r==null?Dn:r.defaultView||Dn},mount:function(e){if(e!=null){var r=this,n=r._private,i=n.options;return!Dv(e)&&Dv(e[0])&&(e=e[0]),r.stopAnimationLoop(),r.destroyRenderer(),n.container=e,n.styleEnabled=!0,r.invalidateSize(),r.initRenderer(Gt({},i,i.renderer,{name:i.renderer.name==="null"?"canvas":i.renderer.name})),r.startAnimationLoop(),r.style(i.style),r.emit("mount"),r}},unmount:function(){var e=this;return e.stopAnimationLoop(),e.destroyRenderer(),e.initRenderer({name:"null"}),e.emit("unmount"),e},options:function(){return Ws(this._private.options)},json:function(e){var r=this,n=r._private,i=r.mutableElements(),a=function(T){return r.getElementById(T.id())};if(vr(e)){if(r.startBatch(),e.elements){var s={},o=function(T,E){for(var L=[],S=[],C=0;C<T.length;C++){var A=T[C];if(!A.data.id){Nr("cy.json() cannot handle elements without an ID attribute");continue}var N=""+A.data.id,_=r.getElementById(N);s[N]=!0,_.length!==0?S.push({ele:_,json:A}):(E&&(A.group=E),L.push(A))}r.add(L);for(var O=0;O<S.length;O++){var P=S[O],k=P.ele,R=P.json;k.json(R)}};if(Br(e.elements))o(e.elements);else for(var l=["nodes","edges"],u=0;u<l.length;u++){var h=l[u],d=e.elements[h];Br(d)&&o(d,h)}var f=r.collection();i.filter(function(w){return!s[w.id()]}).forEach(function(w){w.isParent()?f.merge(w):w.remove()}),f.forEach(function(w){return w.children().move({parent:null})}),f.forEach(function(w){return a(w).remove()})}e.style&&r.style(e.style),e.zoom!=null&&e.zoom!==n.zoom&&r.zoom(e.zoom),e.pan&&(e.pan.x!==n.pan.x||e.pan.y!==n.pan.y)&&r.pan(e.pan),e.data&&r.data(e.data);for(var p=["minZoom","maxZoom","zoomingEnabled","userZoomingEnabled","panningEnabled","userPanningEnabled","boxSelectionEnabled","autolock","autoungrabify","autounselectify","multiClickDebounceTime"],g=0;g<p.length;g++){var m=p[g];e[m]!=null&&r[m](e[m])}return r.endBatch(),this}else{var v=!!e,y={};v?y.elements=this.elements().map(function(w){return w.json()}):(y.elements={},i.forEach(function(w){var T=w.group();y.elements[T]||(y.elements[T]=[]),y.elements[T].push(w.json())})),this._private.styleEnabled&&(y.style=r.style().json()),y.data=Ws(r.data());var b=n.options;return y.zoomingEnabled=n.zoomingEnabled,y.userZoomingEnabled=n.userZoomingEnabled,y.zoom=n.zoom,y.minZoom=n.minZoom,y.maxZoom=n.maxZoom,y.panningEnabled=n.panningEnabled,y.userPanningEnabled=n.userPanningEnabled,y.pan=Ws(n.pan),y.boxSelectionEnabled=n.boxSelectionEnabled,y.renderer=Ws(b.renderer),y.hideEdgesOnViewport=b.hideEdgesOnViewport,y.textureOnViewport=b.textureOnViewport,y.wheelSensitivity=b.wheelSensitivity,y.motionBlur=b.motionBlur,y.multiClickDebounceTime=b.multiClickDebounceTime,y}}});$v.$id=$v.getElementById;[D2e,B2e,oV,dw,am,$2e,fw,sm,G2e,gu,up].forEach(function(t){Gt($v,t)});var W2e={fit:!0,directed:!1,direction:"downward",padding:30,circle:!1,grid:!1,spacingFactor:1.75,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,roots:void 0,depthSort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}},H2e={maximal:!1,acyclic:!1},Ju=function(e){return e.scratch("breadthfirst")},I_=function(e,r){return e.scratch("breadthfirst",r)};function lV(t){this.options=Gt({},W2e,H2e,t)}lV.prototype.run=function(){var t=this.options,e=t.cy,r=t.eles,n=r.nodes().filter(function(Oe){return Oe.isChildless()}),i=r,a=t.directed,s=t.acyclic||t.maximal||t.maximalAdjustments>0,o=!!t.boundingBox,l=qi(o?t.boundingBox:structuredClone(e.extent())),u;if(Aa(t.roots))u=t.roots;else if(Br(t.roots)){for(var h=[],d=0;d<t.roots.length;d++){var f=t.roots[d],p=e.getElementById(f);h.push(p)}u=e.collection(h)}else if(Bt(t.roots))u=e.$(t.roots);else if(a)u=n.roots();else{var g=r.components();u=e.collection();for(var m=function(){var ue=g[v],Ve=ue.maxDegree(!1),Ge=ue.filter(function(Ue){return Ue.degree(!1)===Ve});u=u.add(Ge)},v=0;v<g.length;v++)m()}var y=[],b={},w=function(ue,Ve){y[Ve]==null&&(y[Ve]=[]);var Ge=y[Ve].length;y[Ve].push(ue),I_(ue,{index:Ge,depth:Ve})},T=function(ue,Ve){var Ge=Ju(ue),Ue=Ge.depth,ke=Ge.index;y[Ue][ke]=null,ue.isChildless()&&w(ue,Ve)};i.bfs({roots:u,directed:t.directed,visit:function(ue,Ve,Ge,Ue,ke){var Pe=ue[0],Se=Pe.id();Pe.isChildless()&&w(Pe,ke),b[Se]=!0}});for(var E=[],L=0;L<n.length;L++){var S=n[L];b[S.id()]||E.push(S)}var C=function(ue){for(var Ve=y[ue],Ge=0;Ge<Ve.length;Ge++){var Ue=Ve[Ge];if(Ue==null){Ve.splice(Ge,1),Ge--;continue}I_(Ue,{depth:ue,index:Ge})}},A=function(ue,Ve){for(var Ge=Ju(ue),Ue=ue.incomers().filter(function(De){return De.isNode()&&r.has(De)}),ke=-1,Pe=ue.id(),Se=0;Se<Ue.length;Se++){var _e=Ue[Se],ze=Ju(_e);ke=Math.max(ke,ze.depth)}if(Ge.depth<=ke){if(!t.acyclic&&Ve[Pe])return null;var me=ke+1;return T(ue,me),Ve[Pe]=me,!0}return!1};if(a&&s){var N=[],_={},O=function(ue){return N.push(ue)},P=function(){return N.shift()};for(n.forEach(function(Oe){return N.push(Oe)});N.length>0;){var k=P(),R=A(k,_);if(R)k.outgoers().filter(function(Oe){return Oe.isNode()&&r.has(Oe)}).forEach(O);else if(R===null){Nr("Detected double maximal shift for node `"+k.id()+"`.  Bailing maximal adjustment due to cycle.  Use `options.maximal: true` only on DAGs.");break}}}var I=0;if(t.avoidOverlap)for(var M=0;M<n.length;M++){var D=n[M],B=D.layoutDimensions(t),$=B.w,F=B.h;I=Math.max(I,$,F)}var G={},W=function(ue){if(G[ue.id()])return G[ue.id()];for(var Ve=Ju(ue).depth,Ge=ue.neighborhood(),Ue=0,ke=0,Pe=0;Pe<Ge.length;Pe++){var Se=Ge[Pe];if(!(Se.isEdge()||Se.isParent()||!n.has(Se))){var _e=Ju(Se);if(_e!=null){var ze=_e.index,me=_e.depth;if(!(ze==null||me==null)){var De=y[me].length;me<Ve&&(Ue+=ze/De,ke++)}}}}return ke=Math.max(1,ke),Ue=Ue/ke,ke===0&&(Ue=0),G[ue.id()]=Ue,Ue},J=function(ue,Ve){var Ge=W(ue),Ue=W(Ve),ke=Ge-Ue;return ke===0?cz(ue.id(),Ve.id()):ke};t.depthSort!==void 0&&(J=t.depthSort);for(var q=y.length,ne=0;ne<q;ne++)y[ne].sort(J),C(ne);for(var ae=[],pe=0;pe<E.length;pe++)ae.push(E[pe]);var K=function(){for(var ue=0;ue<q;ue++)C(ue)};ae.length&&(y.unshift(ae),q=y.length,K());for(var Z=0,X=0;X<q;X++)Z=Math.max(y[X].length,Z);var Y={x:l.x1+l.w/2,y:l.y1+l.h/2},ee=n.reduce(function(Oe,ue){return function(Ve){return{w:Oe.w===-1?Ve.w:(Oe.w+Ve.w)/2,h:Oe.h===-1?Ve.h:(Oe.h+Ve.h)/2}}(ue.boundingBox({includeLabels:t.nodeDimensionsIncludeLabels}))},{w:-1,h:-1}),j=Math.max(q===1?0:o?(l.h-t.padding*2-ee.h)/(q-1):(l.h-t.padding*2-ee.h)/(q+1),I),fe=y.reduce(function(Oe,ue){return Math.max(Oe,ue.length)},0),te=function(ue){var Ve=Ju(ue),Ge=Ve.depth,Ue=Ve.index;if(t.circle){var ke=Math.min(l.w/2/q,l.h/2/q);ke=Math.max(ke,I);var Pe=ke*Ge+ke-(q>0&&y[0].length<=3?ke/2:0),Se=2*Math.PI/y[Ge].length*Ue;return Ge===0&&y[0].length===1&&(Pe=1),{x:Y.x+Pe*Math.cos(Se),y:Y.y+Pe*Math.sin(Se)}}else{var _e=y[Ge].length,ze=Math.max(_e===1?0:o?(l.w-t.padding*2-ee.w)/((t.grid?fe:_e)-1):(l.w-t.padding*2-ee.w)/((t.grid?fe:_e)+1),I),me={x:Y.x+(Ue+1-(_e+1)/2)*ze,y:Y.y+(Ge+1-(q+1)/2)*j};return me}},Ae={downward:0,leftward:90,upward:180,rightward:-90};Object.keys(Ae).indexOf(t.direction)===-1&&Kr("Invalid direction '".concat(t.direction,"' specified for breadthfirst layout. Valid values are: ").concat(Object.keys(Ae).join(", ")));var H=function(ue){return ome(te(ue),l,Ae[t.direction])};return r.nodes().layoutPositions(this,t,H),this};var q2e={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,radius:void 0,startAngle:3/2*Math.PI,sweep:void 0,clockwise:!0,sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}};function cV(t){this.options=Gt({},q2e,t)}cV.prototype.run=function(){var t=this.options,e=t,r=t.cy,n=e.eles,i=e.counterclockwise!==void 0?!e.counterclockwise:e.clockwise,a=n.nodes().not(":parent");e.sort&&(a=a.sort(e.sort));for(var s=qi(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()}),o={x:s.x1+s.w/2,y:s.y1+s.h/2},l=e.sweep===void 0?2*Math.PI-2*Math.PI/a.length:e.sweep,u=l/Math.max(1,a.length-1),h,d=0,f=0;f<a.length;f++){var p=a[f],g=p.layoutDimensions(e),m=g.w,v=g.h;d=Math.max(d,m,v)}if(vt(e.radius)?h=e.radius:a.length<=1?h=0:h=Math.min(s.h,s.w)/2-d,a.length>1&&e.avoidOverlap){d*=1.75;var y=Math.cos(u)-Math.cos(0),b=Math.sin(u)-Math.sin(0),w=Math.sqrt(d*d/(y*y+b*b));h=Math.max(w,h)}var T=function(L,S){var C=e.startAngle+S*u*(i?1:-1),A=h*Math.cos(C),N=h*Math.sin(C),_={x:o.x+A,y:o.y+N};return _};return n.nodes().layoutPositions(this,e,T),this};var Y2e={fit:!0,padding:30,startAngle:3/2*Math.PI,sweep:void 0,clockwise:!0,equidistant:!1,minNodeSpacing:10,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,height:void 0,width:void 0,spacingFactor:void 0,concentric:function(e){return e.degree()},levelWidth:function(e){return e.maxDegree()/4},animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}};function uV(t){this.options=Gt({},Y2e,t)}uV.prototype.run=function(){for(var t=this.options,e=t,r=e.counterclockwise!==void 0?!e.counterclockwise:e.clockwise,n=t.cy,i=e.eles,a=i.nodes().not(":parent"),s=qi(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()}),o={x:s.x1+s.w/2,y:s.y1+s.h/2},l=[],u=0,h=0;h<a.length;h++){var d=a[h],f=void 0;f=e.concentric(d),l.push({value:f,node:d}),d._private.scratch.concentric=f}a.updateStyle();for(var p=0;p<a.length;p++){var g=a[p],m=g.layoutDimensions(e);u=Math.max(u,m.w,m.h)}l.sort(function(j,fe){return fe.value-j.value});for(var v=e.levelWidth(a),y=[[]],b=y[0],w=0;w<l.length;w++){var T=l[w];if(b.length>0){var E=Math.abs(b[0].value-T.value);E>=v&&(b=[],y.push(b))}b.push(T)}var L=u+e.minNodeSpacing;if(!e.avoidOverlap){var S=y.length>0&&y[0].length>1,C=Math.min(s.w,s.h)/2-L,A=C/(y.length+S?1:0);L=Math.min(L,A)}for(var N=0,_=0;_<y.length;_++){var O=y[_],P=e.sweep===void 0?2*Math.PI-2*Math.PI/O.length:e.sweep,k=O.dTheta=P/Math.max(1,O.length-1);if(O.length>1&&e.avoidOverlap){var R=Math.cos(k)-Math.cos(0),I=Math.sin(k)-Math.sin(0),M=Math.sqrt(L*L/(R*R+I*I));N=Math.max(M,N)}O.r=N,N+=L}if(e.equidistant){for(var D=0,B=0,$=0;$<y.length;$++){var F=y[$],G=F.r-B;D=Math.max(D,G)}B=0;for(var W=0;W<y.length;W++){var J=y[W];W===0&&(B=J.r),J.r=B,B+=D}}for(var q={},ne=0;ne<y.length;ne++)for(var ae=y[ne],pe=ae.dTheta,K=ae.r,Z=0;Z<ae.length;Z++){var X=ae[Z],Y=e.startAngle+(r?1:-1)*pe*Z,ee={x:o.x+K*Math.cos(Y),y:o.y+K*Math.sin(Y)};q[X.node.id()]=ee}return i.nodes().layoutPositions(this,e,function(j){var fe=j.id();return q[fe]}),this};var H4,X2e={ready:function(){},stop:function(){},animate:!0,animationEasing:void 0,animationDuration:void 0,animateFilter:function(e,r){return!0},animationThreshold:250,refresh:20,fit:!0,padding:30,boundingBox:void 0,nodeDimensionsIncludeLabels:!1,randomize:!1,componentSpacing:40,nodeRepulsion:function(e){return 2048},nodeOverlap:4,idealEdgeLength:function(e){return 32},edgeElasticity:function(e){return 32},nestingFactor:1.2,gravity:1,numIter:1e3,initialTemp:1e3,coolingFactor:.99,minTemp:1};function G2(t){this.options=Gt({},X2e,t),this.options.layout=this;var e=this.options.eles.nodes(),r=this.options.eles.edges(),n=r.filter(function(i){var a=i.source().data("id"),s=i.target().data("id"),o=e.some(function(u){return u.data("id")===a}),l=e.some(function(u){return u.data("id")===s});return!o||!l});this.options.eles=this.options.eles.not(n)}G2.prototype.run=function(){var t=this.options,e=t.cy,r=this;r.stopped=!1,(t.animate===!0||t.animate===!1)&&r.emit({type:"layoutstart",layout:r}),t.debug===!0?H4=!0:H4=!1;var n=j2e(e,r,t);H4&&Z2e(n),t.randomize&&Q2e(n);var i=Zo(),a=function(){J2e(n,e,t),t.fit===!0&&e.fit(t.padding)},s=function(f){return!(r.stopped||f>=t.numIter||(exe(n,t),n.temperature=n.temperature*t.coolingFactor,n.temperature<t.minTemp))},o=function(){if(t.animate===!0||t.animate===!1)a(),r.one("layoutstop",t.stop),r.emit({type:"layoutstop",layout:r});else{var f=t.eles.nodes(),p=dV(n,t,f);f.layoutPositions(r,t,p)}},l=0,u=!0;if(t.animate===!0){var h=function(){for(var f=0;u&&f<t.refresh;)u=s(l),l++,f++;if(!u)P_(n,t),o();else{var p=Zo();p-i>=t.animationThreshold&&a(),Mv(h)}};h()}else{for(;u;)u=s(l),l++;P_(n,t),o()}return this};G2.prototype.stop=function(){return this.stopped=!0,this.thread&&this.thread.stop(),this.emit("layoutstop"),this};G2.prototype.destroy=function(){return this.thread&&this.thread.stop(),this};var j2e=function(e,r,n){for(var i=n.eles.edges(),a=n.eles.nodes(),s=qi(n.boundingBox?n.boundingBox:{x1:0,y1:0,w:e.width(),h:e.height()}),o={isCompound:e.hasCompoundNodes(),layoutNodes:[],idToIndex:{},nodeSize:a.size(),graphSet:[],indexToGraph:[],layoutEdges:[],edgeSize:i.size(),temperature:n.initialTemp,clientWidth:s.w,clientHeight:s.h,boundingBox:s},l=n.eles.components(),u={},h=0;h<l.length;h++)for(var d=l[h],f=0;f<d.length;f++){var p=d[f];u[p.id()]=h}for(var h=0;h<o.nodeSize;h++){var g=a[h],m=g.layoutDimensions(n),v={};v.isLocked=g.locked(),v.id=g.data("id"),v.parentId=g.data("parent"),v.cmptId=u[g.id()],v.children=[],v.positionX=g.position("x"),v.positionY=g.position("y"),v.offsetX=0,v.offsetY=0,v.height=m.w,v.width=m.h,v.maxX=v.positionX+v.width/2,v.minX=v.positionX-v.width/2,v.maxY=v.positionY+v.height/2,v.minY=v.positionY-v.height/2,v.padLeft=parseFloat(g.style("padding")),v.padRight=parseFloat(g.style("padding")),v.padTop=parseFloat(g.style("padding")),v.padBottom=parseFloat(g.style("padding")),v.nodeRepulsion=nn(n.nodeRepulsion)?n.nodeRepulsion(g):n.nodeRepulsion,o.layoutNodes.push(v),o.idToIndex[v.id]=h}for(var y=[],b=0,w=-1,T=[],h=0;h<o.nodeSize;h++){var g=o.layoutNodes[h],E=g.parentId;E!=null?o.layoutNodes[o.idToIndex[E]].children.push(g.id):(y[++w]=g.id,T.push(g.id))}for(o.graphSet.push(T);b<=w;){var L=y[b++],S=o.idToIndex[L],p=o.layoutNodes[S],C=p.children;if(C.length>0){o.graphSet.push(C);for(var h=0;h<C.length;h++)y[++w]=C[h]}}for(var h=0;h<o.graphSet.length;h++)for(var A=o.graphSet[h],f=0;f<A.length;f++){var N=o.idToIndex[A[f]];o.indexToGraph[N]=h}for(var h=0;h<o.edgeSize;h++){var _=i[h],O={};O.id=_.data("id"),O.sourceId=_.data("source"),O.targetId=_.data("target");var P=nn(n.idealEdgeLength)?n.idealEdgeLength(_):n.idealEdgeLength,k=nn(n.edgeElasticity)?n.edgeElasticity(_):n.edgeElasticity,R=o.idToIndex[O.sourceId],I=o.idToIndex[O.targetId],M=o.indexToGraph[R],D=o.indexToGraph[I];if(M!=D){for(var B=K2e(O.sourceId,O.targetId,o),$=o.graphSet[B],F=0,v=o.layoutNodes[R];$.indexOf(v.id)===-1;)v=o.layoutNodes[o.idToIndex[v.parentId]],F++;for(v=o.layoutNodes[I];$.indexOf(v.id)===-1;)v=o.layoutNodes[o.idToIndex[v.parentId]],F++;P*=F*n.nestingFactor}O.idealLength=P,O.elasticity=k,o.layoutEdges.push(O)}return o},K2e=function(e,r,n){var i=hV(e,r,0,n);return 2>i.count?0:i.graph},hV=function(e,r,n,i){var a=i.graphSet[n];if(-1<a.indexOf(e)&&-1<a.indexOf(r))return{count:2,graph:n};for(var s=0,o=0;o<a.length;o++){var l=a[o],u=i.idToIndex[l],h=i.layoutNodes[u].children;if(h.length!==0){var d=i.indexToGraph[i.idToIndex[h[0]]],f=hV(e,r,d,i);if(f.count!==0)if(f.count===1){if(s++,s===2)break}else return f}}return{count:s,graph:n}},Z2e,Q2e=function(e,r){for(var n=e.clientWidth,i=e.clientHeight,a=0;a<e.nodeSize;a++){var s=e.layoutNodes[a];s.children.length===0&&!s.isLocked&&(s.positionX=Math.random()*n,s.positionY=Math.random()*i)}},dV=function(e,r,n){var i=e.boundingBox,a={x1:1/0,x2:-1/0,y1:1/0,y2:-1/0};return r.boundingBox&&(n.forEach(function(s){var o=e.layoutNodes[e.idToIndex[s.data("id")]];a.x1=Math.min(a.x1,o.positionX),a.x2=Math.max(a.x2,o.positionX),a.y1=Math.min(a.y1,o.positionY),a.y2=Math.max(a.y2,o.positionY)}),a.w=a.x2-a.x1,a.h=a.y2-a.y1),function(s,o){var l=e.layoutNodes[e.idToIndex[s.data("id")]];if(r.boundingBox){var u=a.w===0?.5:(l.positionX-a.x1)/a.w,h=a.h===0?.5:(l.positionY-a.y1)/a.h;return{x:i.x1+u*i.w,y:i.y1+h*i.h}}else return{x:l.positionX,y:l.positionY}}},J2e=function(e,r,n){var i=n.layout,a=n.eles.nodes(),s=dV(e,n,a);a.positions(s),e.ready!==!0&&(e.ready=!0,i.one("layoutready",n.ready),i.emit({type:"layoutready",layout:this}))},exe=function(e,r,n){txe(e,r),ixe(e),axe(e,r),sxe(e),oxe(e)},txe=function(e,r){for(var n=0;n<e.graphSet.length;n++)for(var i=e.graphSet[n],a=i.length,s=0;s<a;s++)for(var o=e.layoutNodes[e.idToIndex[i[s]]],l=s+1;l<a;l++){var u=e.layoutNodes[e.idToIndex[i[l]]];rxe(o,u,e,r)}},O_=function(e){return-1+2*e*Math.random()},rxe=function(e,r,n,i){var a=e.cmptId,s=r.cmptId;if(!(a!==s&&!n.isCompound)){var o=r.positionX-e.positionX,l=r.positionY-e.positionY,u=1;o===0&&l===0&&(o=O_(u),l=O_(u));var h=nxe(e,r,o,l);if(h>0)var d=i.nodeOverlap*h,f=Math.sqrt(o*o+l*l),p=d*o/f,g=d*l/f;else var m=zv(e,o,l),v=zv(r,-1*o,-1*l),y=v.x-m.x,b=v.y-m.y,w=y*y+b*b,f=Math.sqrt(w),d=(e.nodeRepulsion+r.nodeRepulsion)/w,p=d*y/f,g=d*b/f;e.isLocked||(e.offsetX-=p,e.offsetY-=g),r.isLocked||(r.offsetX+=p,r.offsetY+=g)}},nxe=function(e,r,n,i){if(n>0)var a=e.maxX-r.minX;else var a=r.maxX-e.minX;if(i>0)var s=e.maxY-r.minY;else var s=r.maxY-e.minY;return a>=0&&s>=0?Math.sqrt(a*a+s*s):0},zv=function(e,r,n){var i=e.positionX,a=e.positionY,s=e.height||1,o=e.width||1,l=n/r,u=s/o,h={};return r===0&&0<n||r===0&&0>n?(h.x=i,h.y=a+s/2,h):0<r&&-1*u<=l&&l<=u?(h.x=i+o/2,h.y=a+o*n/2/r,h):0>r&&-1*u<=l&&l<=u?(h.x=i-o/2,h.y=a-o*n/2/r,h):0<n&&(l<=-1*u||l>=u)?(h.x=i+s*r/2/n,h.y=a+s/2,h):(0>n&&(l<=-1*u||l>=u)&&(h.x=i-s*r/2/n,h.y=a-s/2),h)},ixe=function(e,r){for(var n=0;n<e.edgeSize;n++){var i=e.layoutEdges[n],a=e.idToIndex[i.sourceId],s=e.layoutNodes[a],o=e.idToIndex[i.targetId],l=e.layoutNodes[o],u=l.positionX-s.positionX,h=l.positionY-s.positionY;if(!(u===0&&h===0)){var d=zv(s,u,h),f=zv(l,-1*u,-1*h),p=f.x-d.x,g=f.y-d.y,m=Math.sqrt(p*p+g*g),v=Math.pow(i.idealLength-m,2)/i.elasticity;if(m!==0)var y=v*p/m,b=v*g/m;else var y=0,b=0;s.isLocked||(s.offsetX+=y,s.offsetY+=b),l.isLocked||(l.offsetX-=y,l.offsetY-=b)}}},axe=function(e,r){if(r.gravity!==0)for(var n=1,i=0;i<e.graphSet.length;i++){var a=e.graphSet[i],s=a.length;if(i===0)var o=e.clientHeight/2,l=e.clientWidth/2;else var u=e.layoutNodes[e.idToIndex[a[0]]],h=e.layoutNodes[e.idToIndex[u.parentId]],o=h.positionX,l=h.positionY;for(var d=0;d<s;d++){var f=e.layoutNodes[e.idToIndex[a[d]]];if(!f.isLocked){var p=o-f.positionX,g=l-f.positionY,m=Math.sqrt(p*p+g*g);if(m>n){var v=r.gravity*p/m,y=r.gravity*g/m;f.offsetX+=v,f.offsetY+=y}}}}},sxe=function(e,r){var n=[],i=0,a=-1;for(n.push.apply(n,e.graphSet[0]),a+=e.graphSet[0].length;i<=a;){var s=n[i++],o=e.idToIndex[s],l=e.layoutNodes[o],u=l.children;if(0<u.length&&!l.isLocked){for(var h=l.offsetX,d=l.offsetY,f=0;f<u.length;f++){var p=e.layoutNodes[e.idToIndex[u[f]]];p.offsetX+=h,p.offsetY+=d,n[++a]=u[f]}l.offsetX=0,l.offsetY=0}}},oxe=function(e,r){for(var n=0;n<e.nodeSize;n++){var i=e.layoutNodes[n];0<i.children.length&&(i.maxX=void 0,i.minX=void 0,i.maxY=void 0,i.minY=void 0)}for(var n=0;n<e.nodeSize;n++){var i=e.layoutNodes[n];if(!(0<i.children.length||i.isLocked)){var a=lxe(i.offsetX,i.offsetY,e.temperature);i.positionX+=a.x,i.positionY+=a.y,i.offsetX=0,i.offsetY=0,i.minX=i.positionX-i.width,i.maxX=i.positionX+i.width,i.minY=i.positionY-i.height,i.maxY=i.positionY+i.height,fV(i,e)}}for(var n=0;n<e.nodeSize;n++){var i=e.layoutNodes[n];0<i.children.length&&!i.isLocked&&(i.positionX=(i.maxX+i.minX)/2,i.positionY=(i.maxY+i.minY)/2,i.width=i.maxX-i.minX,i.height=i.maxY-i.minY)}},lxe=function(e,r,n){var i=Math.sqrt(e*e+r*r);if(i>n)var a={x:n*e/i,y:n*r/i};else var a={x:e,y:r};return a},fV=function(e,r){var n=e.parentId;if(n!=null){var i=r.layoutNodes[r.idToIndex[n]],a=!1;if((i.maxX==null||e.maxX+i.padRight>i.maxX)&&(i.maxX=e.maxX+i.padRight,a=!0),(i.minX==null||e.minX-i.padLeft<i.minX)&&(i.minX=e.minX-i.padLeft,a=!0),(i.maxY==null||e.maxY+i.padBottom>i.maxY)&&(i.maxY=e.maxY+i.padBottom,a=!0),(i.minY==null||e.minY-i.padTop<i.minY)&&(i.minY=e.minY-i.padTop,a=!0),a)return fV(i,r)}},P_=function(e,r){for(var n=e.layoutNodes,i=[],a=0;a<n.length;a++){var s=n[a],o=s.cmptId,l=i[o]=i[o]||[];l.push(s)}for(var u=0,a=0;a<i.length;a++){var h=i[a];if(h){h.x1=1/0,h.x2=-1/0,h.y1=1/0,h.y2=-1/0;for(var d=0;d<h.length;d++){var f=h[d];h.x1=Math.min(h.x1,f.positionX-f.width/2),h.x2=Math.max(h.x2,f.positionX+f.width/2),h.y1=Math.min(h.y1,f.positionY-f.height/2),h.y2=Math.max(h.y2,f.positionY+f.height/2)}h.w=h.x2-h.x1,h.h=h.y2-h.y1,u+=h.w*h.h}}i.sort(function(b,w){return w.w*w.h-b.w*b.h});for(var p=0,g=0,m=0,v=0,y=Math.sqrt(u)*e.clientWidth/e.clientHeight,a=0;a<i.length;a++){var h=i[a];if(h){for(var d=0;d<h.length;d++){var f=h[d];f.isLocked||(f.positionX+=p-h.x1,f.positionY+=g-h.y1)}p+=h.w+r.componentSpacing,m+=h.w+r.componentSpacing,v=Math.max(v,h.h),m>y&&(g+=v+r.componentSpacing,p=0,m=0,v=0)}}},cxe={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,avoidOverlapPadding:10,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,condense:!1,rows:void 0,cols:void 0,position:function(e){},sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}};function pV(t){this.options=Gt({},cxe,t)}pV.prototype.run=function(){var t=this.options,e=t,r=t.cy,n=e.eles,i=n.nodes().not(":parent");e.sort&&(i=i.sort(e.sort));var a=qi(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()});if(a.h===0||a.w===0)n.nodes().layoutPositions(this,e,function(W){return{x:a.x1,y:a.y1}});else{var s=i.size(),o=Math.sqrt(s*a.h/a.w),l=Math.round(o),u=Math.round(a.w/a.h*o),h=function(J){if(J==null)return Math.min(l,u);var q=Math.min(l,u);q==l?l=J:u=J},d=function(J){if(J==null)return Math.max(l,u);var q=Math.max(l,u);q==l?l=J:u=J},f=e.rows,p=e.cols!=null?e.cols:e.columns;if(f!=null&&p!=null)l=f,u=p;else if(f!=null&&p==null)l=f,u=Math.ceil(s/l);else if(f==null&&p!=null)u=p,l=Math.ceil(s/u);else if(u*l>s){var g=h(),m=d();(g-1)*m>=s?h(g-1):(m-1)*g>=s&&d(m-1)}else for(;u*l<s;){var v=h(),y=d();(y+1)*v>=s?d(y+1):h(v+1)}var b=a.w/u,w=a.h/l;if(e.condense&&(b=0,w=0),e.avoidOverlap)for(var T=0;T<i.length;T++){var E=i[T],L=E._private.position;(L.x==null||L.y==null)&&(L.x=0,L.y=0);var S=E.layoutDimensions(e),C=e.avoidOverlapPadding,A=S.w+C,N=S.h+C;b=Math.max(b,A),w=Math.max(w,N)}for(var _={},O=function(J,q){return!!_["c-"+J+"-"+q]},P=function(J,q){_["c-"+J+"-"+q]=!0},k=0,R=0,I=function(){R++,R>=u&&(R=0,k++)},M={},D=0;D<i.length;D++){var B=i[D],$=e.position(B);if($&&($.row!==void 0||$.col!==void 0)){var F={row:$.row,col:$.col};if(F.col===void 0)for(F.col=0;O(F.row,F.col);)F.col++;else if(F.row===void 0)for(F.row=0;O(F.row,F.col);)F.row++;M[B.id()]=F,P(F.row,F.col)}}var G=function(J,q){var ne,ae;if(J.locked()||J.isParent())return!1;var pe=M[J.id()];if(pe)ne=pe.col*b+b/2+a.x1,ae=pe.row*w+w/2+a.y1;else{for(;O(k,R);)I();ne=R*b+b/2+a.x1,ae=k*w+w/2+a.y1,P(k,R),I()}return{x:ne,y:ae}};i.layoutPositions(this,e,G)}return this};var uxe={ready:function(){},stop:function(){}};function ak(t){this.options=Gt({},uxe,t)}ak.prototype.run=function(){var t=this.options,e=t.eles,r=this;return t.cy,r.emit("layoutstart"),e.nodes().positions(function(){return{x:0,y:0}}),r.one("layoutready",t.ready),r.emit("layoutready"),r.one("layoutstop",t.stop),r.emit("layoutstop"),this};ak.prototype.stop=function(){return this};var hxe={positions:void 0,zoom:void 0,pan:void 0,fit:!0,padding:30,spacingFactor:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}};function gV(t){this.options=Gt({},hxe,t)}gV.prototype.run=function(){var t=this.options,e=t.eles,r=e.nodes(),n=nn(t.positions);function i(a){if(t.positions==null)return Mme(a.position());if(n)return t.positions(a);var s=t.positions[a._private.data.id];return s??null}return r.layoutPositions(this,t,function(a,s){var o=i(a);return a.locked()||o==null?!1:o}),this};var dxe={fit:!0,padding:30,boundingBox:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}};function mV(t){this.options=Gt({},dxe,t)}mV.prototype.run=function(){var t=this.options,e=t.cy,r=t.eles,n=qi(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:e.width(),h:e.height()}),i=function(s,o){return{x:n.x1+Math.round(Math.random()*n.w),y:n.y1+Math.round(Math.random()*n.h)}};return r.nodes().layoutPositions(this,t,i),this};var fxe=[{name:"breadthfirst",impl:lV},{name:"circle",impl:cV},{name:"concentric",impl:uV},{name:"cose",impl:G2},{name:"grid",impl:pV},{name:"null",impl:ak},{name:"preset",impl:gV},{name:"random",impl:mV}];function vV(t){this.options=t,this.notifications=0}var B_=function(){},F_=function(){throw new Error("A headless instance can not render images")};vV.prototype={recalculateRenderedStyle:B_,notify:function(){this.notifications++},init:B_,isHeadless:function(){return!0},png:F_,jpg:F_};var sk={};sk.arrowShapeWidth=.3;sk.registerArrowShapes=function(){var t=this.arrowShapes={},e=this,r=function(u,h,d,f,p,g,m){var v=p.x-d/2-m,y=p.x+d/2+m,b=p.y-d/2-m,w=p.y+d/2+m,T=v<=u&&u<=y&&b<=h&&h<=w;return T},n=function(u,h,d,f,p){var g=u*Math.cos(f)-h*Math.sin(f),m=u*Math.sin(f)+h*Math.cos(f),v=g*d,y=m*d,b=v+p.x,w=y+p.y;return{x:b,y:w}},i=function(u,h,d,f){for(var p=[],g=0;g<u.length;g+=2){var m=u[g],v=u[g+1];p.push(n(m,v,h,d,f))}return p},a=function(u){for(var h=[],d=0;d<u.length;d++){var f=u[d];h.push(f.x,f.y)}return h},s=function(u){return u.pstyle("width").pfValue*u.pstyle("arrow-scale").pfValue*2},o=function(u,h){Bt(h)&&(h=t[h]),t[u]=Gt({name:u,points:[-.15,-.3,.15,-.3,.15,.3,-.15,.3],collide:function(f,p,g,m,v,y){var b=a(i(this.points,g+2*y,m,v)),w=aa(f,p,b);return w},roughCollide:r,draw:function(f,p,g,m){var v=i(this.points,p,g,m);e.arrowShapeImpl("polygon")(f,v)},spacing:function(f){return 0},gap:s},h)};o("none",{collide:Iv,roughCollide:Iv,draw:HE,spacing:Q8,gap:Q8}),o("triangle",{points:[-.15,-.3,0,0,.15,-.3]}),o("arrow","triangle"),o("triangle-backcurve",{points:t.triangle.points,controlPoint:[0,-.15],roughCollide:r,draw:function(u,h,d,f,p){var g=i(this.points,h,d,f),m=this.controlPoint,v=n(m[0],m[1],h,d,f);e.arrowShapeImpl(this.name)(u,g,v)},gap:function(u){return s(u)*.8}}),o("triangle-tee",{points:[0,0,.15,-.3,-.15,-.3,0,0],pointsTee:[-.15,-.4,-.15,-.5,.15,-.5,.15,-.4],collide:function(u,h,d,f,p,g,m){var v=a(i(this.points,d+2*m,f,p)),y=a(i(this.pointsTee,d+2*m,f,p)),b=aa(u,h,v)||aa(u,h,y);return b},draw:function(u,h,d,f,p){var g=i(this.points,h,d,f),m=i(this.pointsTee,h,d,f);e.arrowShapeImpl(this.name)(u,g,m)}}),o("circle-triangle",{radius:.15,pointsTr:[0,-.15,.15,-.45,-.15,-.45,0,-.15],collide:function(u,h,d,f,p,g,m){var v=p,y=Math.pow(v.x-u,2)+Math.pow(v.y-h,2)<=Math.pow((d+2*m)*this.radius,2),b=a(i(this.points,d+2*m,f,p));return aa(u,h,b)||y},draw:function(u,h,d,f,p){var g=i(this.pointsTr,h,d,f);e.arrowShapeImpl(this.name)(u,g,f.x,f.y,this.radius*h)},spacing:function(u){return e.getArrowWidth(u.pstyle("width").pfValue,u.pstyle("arrow-scale").value)*this.radius}}),o("triangle-cross",{points:[0,0,.15,-.3,-.15,-.3,0,0],baseCrossLinePts:[-.15,-.4,-.15,-.4,.15,-.4,.15,-.4],crossLinePts:function(u,h){var d=this.baseCrossLinePts.slice(),f=h/u,p=3,g=5;return d[p]=d[p]-f,d[g]=d[g]-f,d},collide:function(u,h,d,f,p,g,m){var v=a(i(this.points,d+2*m,f,p)),y=a(i(this.crossLinePts(d,g),d+2*m,f,p)),b=aa(u,h,v)||aa(u,h,y);return b},draw:function(u,h,d,f,p){var g=i(this.points,h,d,f),m=i(this.crossLinePts(h,p),h,d,f);e.arrowShapeImpl(this.name)(u,g,m)}}),o("vee",{points:[-.15,-.3,0,0,.15,-.3,0,-.15],gap:function(u){return s(u)*.525}}),o("circle",{radius:.15,collide:function(u,h,d,f,p,g,m){var v=p,y=Math.pow(v.x-u,2)+Math.pow(v.y-h,2)<=Math.pow((d+2*m)*this.radius,2);return y},draw:function(u,h,d,f,p){e.arrowShapeImpl(this.name)(u,f.x,f.y,this.radius*h)},spacing:function(u){return e.getArrowWidth(u.pstyle("width").pfValue,u.pstyle("arrow-scale").value)*this.radius}}),o("tee",{points:[-.15,0,-.15,-.1,.15,-.1,.15,0],spacing:function(u){return 1},gap:function(u){return 1}}),o("square",{points:[-.15,0,.15,0,.15,-.3,-.15,-.3]}),o("diamond",{points:[-.15,-.15,0,-.3,.15,-.15,0,0],gap:function(u){return u.pstyle("width").pfValue*u.pstyle("arrow-scale").value}}),o("chevron",{points:[0,0,-.15,-.15,-.1,-.2,0,-.1,.1,-.2,.15,-.15],gap:function(u){return .95*u.pstyle("width").pfValue*u.pstyle("arrow-scale").value}})};var Ou={};Ou.projectIntoViewport=function(t,e){var r=this.cy,n=this.findContainerClientCoords(),i=n[0],a=n[1],s=n[4],o=r.pan(),l=r.zoom(),u=((t-i)/s-o.x)/l,h=((e-a)/s-o.y)/l;return[u,h]};Ou.findContainerClientCoords=function(){if(this.containerBB)return this.containerBB;var t=this.container,e=t.getBoundingClientRect(),r=this.cy.window().getComputedStyle(t),n=function(y){return parseFloat(r.getPropertyValue(y))},i={left:n("padding-left"),right:n("padding-right"),top:n("padding-top"),bottom:n("padding-bottom")},a={left:n("border-left-width"),right:n("border-right-width"),top:n("border-top-width"),bottom:n("border-bottom-width")},s=t.clientWidth,o=t.clientHeight,l=i.left+i.right,u=i.top+i.bottom,h=a.left+a.right,d=e.width/(s+h),f=s-l,p=o-u,g=e.left+i.left+a.left,m=e.top+i.top+a.top;return this.containerBB=[g,m,f,p,d]};Ou.invalidateContainerClientCoordsCache=function(){this.containerBB=null};Ou.findNearestElement=function(t,e,r,n){return this.findNearestElements(t,e,r,n)[0]};Ou.findNearestElements=function(t,e,r,n){var i=this,a=this,s=a.getCachedZSortedEles(),o=[],l=a.cy.zoom(),u=a.cy.hasCompoundNodes(),h=(n?24:8)/l,d=(n?8:2)/l,f=(n?8:2)/l,p=1/0,g,m;r&&(s=s.interactive);function v(S,C){if(S.isNode()){if(m)return;m=S,o.push(S)}if(S.isEdge()&&(C==null||C<p))if(g){if(g.pstyle("z-compound-depth").value===S.pstyle("z-compound-depth").value&&g.pstyle("z-compound-depth").value===S.pstyle("z-compound-depth").value){for(var A=0;A<o.length;A++)if(o[A].isEdge()){o[A]=S,g=S,p=C??p;break}}}else o.push(S),g=S,p=C??p}function y(S){var C=S.outerWidth()+2*d,A=S.outerHeight()+2*d,N=C/2,_=A/2,O=S.position(),P=S.pstyle("corner-radius").value==="auto"?"auto":S.pstyle("corner-radius").pfValue,k=S._private.rscratch;if(O.x-N<=t&&t<=O.x+N&&O.y-_<=e&&e<=O.y+_){var R=a.nodeShapes[i.getNodeShape(S)];if(R.checkPoint(t,e,0,C,A,O.x,O.y,P,k))return v(S,0),!0}}function b(S){var C=S._private,A=C.rscratch,N=S.pstyle("width").pfValue,_=S.pstyle("arrow-scale").value,O=N/2+h,P=O*O,k=O*2,D=C.source,B=C.target,R;if(A.edgeType==="segments"||A.edgeType==="straight"||A.edgeType==="haystack"){for(var I=A.allpts,M=0;M+3<I.length;M+=2)if(Yme(t,e,I[M],I[M+1],I[M+2],I[M+3],k)&&P>(R=Qme(t,e,I[M],I[M+1],I[M+2],I[M+3])))return v(S,R),!0}else if(A.edgeType==="bezier"||A.edgeType==="multibezier"||A.edgeType==="self"||A.edgeType==="compound"){for(var I=A.allpts,M=0;M+5<A.allpts.length;M+=4)if(Xme(t,e,I[M],I[M+1],I[M+2],I[M+3],I[M+4],I[M+5],k)&&P>(R=Zme(t,e,I[M],I[M+1],I[M+2],I[M+3],I[M+4],I[M+5])))return v(S,R),!0}for(var D=D||C.source,B=B||C.target,$=i.getArrowWidth(N,_),F=[{name:"source",x:A.arrowStartX,y:A.arrowStartY,angle:A.srcArrowAngle},{name:"target",x:A.arrowEndX,y:A.arrowEndY,angle:A.tgtArrowAngle},{name:"mid-source",x:A.midX,y:A.midY,angle:A.midsrcArrowAngle},{name:"mid-target",x:A.midX,y:A.midY,angle:A.midtgtArrowAngle}],M=0;M<F.length;M++){var G=F[M],W=a.arrowShapes[S.pstyle(G.name+"-arrow-shape").value],J=S.pstyle("width").pfValue;if(W.roughCollide(t,e,$,G.angle,{x:G.x,y:G.y},J,h)&&W.collide(t,e,$,G.angle,{x:G.x,y:G.y},J,h))return v(S),!0}u&&o.length>0&&(y(D),y(B))}function w(S,C,A){return ia(S,C,A)}function T(S,C){var A=S._private,N=f,_;C?_=C+"-":_="",S.boundingBox();var O=A.labelBounds[C||"main"],P=S.pstyle(_+"label").value,k=S.pstyle("text-events").strValue==="yes";if(!(!k||!P)){var R=w(A.rscratch,"labelX",C),I=w(A.rscratch,"labelY",C),M=w(A.rscratch,"labelAngle",C),D=S.pstyle(_+"text-margin-x").pfValue,B=S.pstyle(_+"text-margin-y").pfValue,$=O.x1-N-D,F=O.x2+N-D,G=O.y1-N-B,W=O.y2+N-B;if(M){var J=Math.cos(M),q=Math.sin(M),ne=function(ee,j){return ee=ee-R,j=j-I,{x:ee*J-j*q+R,y:ee*q+j*J+I}},ae=ne($,G),pe=ne($,W),K=ne(F,G),Z=ne(F,W),X=[ae.x+D,ae.y+B,K.x+D,K.y+B,Z.x+D,Z.y+B,pe.x+D,pe.y+B];if(aa(t,e,X))return v(S),!0}else if(El(O,t,e))return v(S),!0}}for(var E=s.length-1;E>=0;E--){var L=s[E];L.isNode()?y(L)||T(L):b(L)||T(L)||T(L,"source")||T(L,"target")}return o};Ou.getAllInBox=function(t,e,r,n){var i=this.getCachedZSortedEles().interactive,a=this.cy.zoom(),s=2/a,o=[],l=Math.min(t,r),u=Math.max(t,r),h=Math.min(e,n),d=Math.max(e,n);t=l,r=u,e=h,n=d;var f=qi({x1:t,y1:e,x2:r,y2:n}),p=[{x:f.x1,y:f.y1},{x:f.x2,y:f.y1},{x:f.x2,y:f.y2},{x:f.x1,y:f.y2}],g=[[p[0],p[1]],[p[1],p[2]],[p[2],p[3]],[p[3],p[0]]];function m(ee,j,fe){return ia(ee,j,fe)}function v(ee,j){var fe=ee._private,te=s,Ae="";ee.boundingBox();var H=fe.labelBounds.main;if(!H)return null;var Oe=m(fe.rscratch,"labelX",j),ue=m(fe.rscratch,"labelY",j),Ve=m(fe.rscratch,"labelAngle",j),Ge=ee.pstyle(Ae+"text-margin-x").pfValue,Ue=ee.pstyle(Ae+"text-margin-y").pfValue,ke=H.x1-te-Ge,Pe=H.x2+te-Ge,Se=H.y1-te-Ue,_e=H.y2+te-Ue;if(Ve){var ze=Math.cos(Ve),me=Math.sin(Ve),De=function(ce,z){return ce=ce-Oe,z=z-ue,{x:ce*ze-z*me+Oe,y:ce*me+z*ze+ue}};return[De(ke,Se),De(Pe,Se),De(Pe,_e),De(ke,_e)]}else return[{x:ke,y:Se},{x:Pe,y:Se},{x:Pe,y:_e},{x:ke,y:_e}]}function y(ee,j,fe,te){function Ae(H,Oe,ue){return(ue.y-H.y)*(Oe.x-H.x)>(Oe.y-H.y)*(ue.x-H.x)}return Ae(ee,fe,te)!==Ae(j,fe,te)&&Ae(ee,j,fe)!==Ae(ee,j,te)}for(var b=0;b<i.length;b++){var w=i[b];if(w.isNode()){var T=w,E=T.pstyle("text-events").strValue==="yes",L=T.pstyle("box-selection").strValue,S=T.pstyle("box-select-labels").strValue==="yes";if(L==="none")continue;var C=(L==="overlap"||S)&&E,A=T.boundingBox({includeNodes:!0,includeEdges:!1,includeLabels:C});if(L==="contain"){var N=!1;if(S&&E){var _=v(T);_&&Ub(_,p)&&(o.push(T),N=!0)}!N&&kz(f,A)&&o.push(T)}else if(L==="overlap"&&jE(f,A)){var O=T.boundingBox({includeNodes:!0,includeEdges:!0,includeLabels:!1,includeMainLabels:!1,includeSourceLabels:!1,includeTargetLabels:!1}),P=[{x:O.x1,y:O.y1},{x:O.x2,y:O.y1},{x:O.x2,y:O.y2},{x:O.x1,y:O.y2}];if(Ub(P,p))o.push(T);else{var k=v(T);k&&Ub(k,p)&&o.push(T)}}}else{var R=w,I=R._private,M=I.rscratch,D=R.pstyle("box-selection").strValue;if(D==="none")continue;if(D==="contain"){if(M.startX!=null&&M.startY!=null&&!El(f,M.startX,M.startY)||M.endX!=null&&M.endY!=null&&!El(f,M.endX,M.endY))continue;if(M.edgeType==="bezier"||M.edgeType==="multibezier"||M.edgeType==="self"||M.edgeType==="compound"||M.edgeType==="segments"||M.edgeType==="haystack"){for(var B=I.rstyle.bezierPts||I.rstyle.linePts||I.rstyle.haystackPts,$=!0,F=0;F<B.length;F++)if(!nA(f,B[F])){$=!1;break}$&&o.push(R)}else M.edgeType==="straight"&&o.push(R)}else if(D==="overlap"){var G=!1;if(M.startX!=null&&M.startY!=null&&M.endX!=null&&M.endY!=null&&(El(f,M.startX,M.startY)||El(f,M.endX,M.endY)))o.push(R),G=!0;else if(!G&&M.edgeType==="haystack"){for(var W=I.rstyle.haystackPts,J=0;J<W.length;J++)if(nA(f,W[J])){o.push(R),G=!0;break}}if(!G){var q=I.rstyle.bezierPts||I.rstyle.linePts||I.rstyle.haystackPts;if((!q||q.length<2)&&M.edgeType==="straight"&&M.startX!=null&&M.startY!=null&&M.endX!=null&&M.endY!=null&&(q=[{x:M.startX,y:M.startY},{x:M.endX,y:M.endY}]),!q||q.length<2)continue;for(var ne=0;ne<q.length-1;ne++){for(var ae=q[ne],pe=q[ne+1],K=0;K<g.length;K++){var Z=Tn(g[K],2),X=Z[0],Y=Z[1];if(y(ae,pe,X,Y)){o.push(R),G=!0;break}}if(G)break}}}}}return o};var Vv={};Vv.calculateArrowAngles=function(t){var e=t._private.rscratch,r=e.edgeType==="haystack",n=e.edgeType==="bezier",i=e.edgeType==="multibezier",a=e.edgeType==="segments",s=e.edgeType==="compound",o=e.edgeType==="self",l,u,h,d,f,p,y,b;if(r?(h=e.haystackPts[0],d=e.haystackPts[1],f=e.haystackPts[2],p=e.haystackPts[3]):(h=e.arrowStartX,d=e.arrowStartY,f=e.arrowEndX,p=e.arrowEndY),y=e.midX,b=e.midY,a)l=h-e.segpts[0],u=d-e.segpts[1];else if(i||s||o||n){var g=e.allpts,m=qn(g[0],g[2],g[4],.1),v=qn(g[1],g[3],g[5],.1);l=h-m,u=d-v}else l=h-y,u=d-b;e.srcArrowAngle=Kg(l,u);var y=e.midX,b=e.midY;if(r&&(y=(h+f)/2,b=(d+p)/2),l=f-h,u=p-d,a){var g=e.allpts;if(g.length/2%2===0){var w=g.length/2,T=w-2;l=g[w]-g[T],u=g[w+1]-g[T+1]}else if(e.isRound)l=e.midVector[1],u=-e.midVector[0];else{var w=g.length/2-1,T=w-2;l=g[w]-g[T],u=g[w+1]-g[T+1]}}else if(i||s||o){var g=e.allpts,E=e.ctrlpts,L,S,C,A;if(E.length/2%2===0){var N=g.length/2-1,_=N+2,O=_+2;L=qn(g[N],g[_],g[O],0),S=qn(g[N+1],g[_+1],g[O+1],0),C=qn(g[N],g[_],g[O],1e-4),A=qn(g[N+1],g[_+1],g[O+1],1e-4)}else{var _=g.length/2-1,N=_-2,O=_+2;L=qn(g[N],g[_],g[O],.4999),S=qn(g[N+1],g[_+1],g[O+1],.4999),C=qn(g[N],g[_],g[O],.5),A=qn(g[N+1],g[_+1],g[O+1],.5)}l=C-L,u=A-S}if(e.midtgtArrowAngle=Kg(l,u),e.midDispX=l,e.midDispY=u,l*=-1,u*=-1,a){var g=e.allpts;if(g.length/2%2!==0){if(!e.isRound){var w=g.length/2-1,P=w+2;l=-(g[P]-g[w]),u=-(g[P+1]-g[w+1])}}}if(e.midsrcArrowAngle=Kg(l,u),a)l=f-e.segpts[e.segpts.length-2],u=p-e.segpts[e.segpts.length-1];else if(i||s||o||n){var g=e.allpts,k=g.length,m=qn(g[k-6],g[k-4],g[k-2],.9),v=qn(g[k-5],g[k-3],g[k-1],.9);l=f-m,u=p-v}else l=f-y,u=p-b;e.tgtArrowAngle=Kg(l,u)};Vv.getArrowWidth=Vv.getArrowHeight=function(t,e){var r=this.arrowWidthCache=this.arrowWidthCache||{},n=r[t+", "+e];return n||(n=Math.max(Math.pow(t*13.37,.9),29)*e,r[t+", "+e]=n,n)};var pw,gw,Os={},$a={},$_,z_,Bc,om,vo,Ac,Mc,Ns,eh,i1,yV,xV,mw,vw,V_,G_=function(e,r,n){n.x=r.x-e.x,n.y=r.y-e.y,n.len=Math.sqrt(n.x*n.x+n.y*n.y),n.nx=n.x/n.len,n.ny=n.y/n.len,n.ang=Math.atan2(n.ny,n.nx)},pxe=function(e,r){r.x=e.x*-1,r.y=e.y*-1,r.nx=e.nx*-1,r.ny=e.ny*-1,r.ang=e.ang>0?-(Math.PI-e.ang):Math.PI+e.ang},gxe=function(e,r,n,i,a){if(e!==V_?G_(r,e,Os):pxe($a,Os),G_(r,n,$a),$_=Os.nx*$a.ny-Os.ny*$a.nx,z_=Os.nx*$a.nx-Os.ny*-$a.ny,vo=Math.asin(Math.max(-1,Math.min(1,$_))),Math.abs(vo)<1e-6){pw=r.x,gw=r.y,Mc=eh=0;return}Bc=1,om=!1,z_<0?vo<0?vo=Math.PI+vo:(vo=Math.PI-vo,Bc=-1,om=!0):vo>0&&(Bc=-1,om=!0),r.radius!==void 0?eh=r.radius:eh=i,Ac=vo/2,i1=Math.min(Os.len/2,$a.len/2),a?(Ns=Math.abs(Math.cos(Ac)*eh/Math.sin(Ac)),Ns>i1?(Ns=i1,Mc=Math.abs(Ns*Math.sin(Ac)/Math.cos(Ac))):Mc=eh):(Ns=Math.min(i1,eh),Mc=Math.abs(Ns*Math.sin(Ac)/Math.cos(Ac))),mw=r.x+$a.nx*Ns,vw=r.y+$a.ny*Ns,pw=mw-$a.ny*Mc*Bc,gw=vw+$a.nx*Mc*Bc,yV=r.x+Os.nx*Ns,xV=r.y+Os.ny*Ns,V_=r};function bV(t,e){e.radius===0?t.lineTo(e.cx,e.cy):t.arc(e.cx,e.cy,e.radius,e.startAngle,e.endAngle,e.counterClockwise)}function ok(t,e,r,n){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0;return n===0||e.radius===0?{cx:e.x,cy:e.y,radius:0,startX:e.x,startY:e.y,stopX:e.x,stopY:e.y,startAngle:void 0,endAngle:void 0,counterClockwise:void 0}:(gxe(t,e,r,n,i),{cx:pw,cy:gw,radius:Mc,startX:yV,startY:xV,stopX:mw,stopY:vw,startAngle:Os.ang+Math.PI/2*Bc,endAngle:$a.ang-Math.PI/2*Bc,counterClockwise:om})}var dp=.01,mxe=Math.sqrt(2*dp),Ri={};Ri.findMidptPtsEtc=function(t,e){var r=e.posPts,n=e.intersectionPts,i=e.vectorNormInverse,a,s=t.pstyle("source-endpoint"),o=t.pstyle("target-endpoint"),l=s.units!=null&&o.units!=null,u=function(E,L,S,C){var A=C-L,N=S-E,_=Math.sqrt(N*N+A*A);return{x:-A/_,y:N/_}},h=t.pstyle("edge-distances").value;switch(h){case"node-position":a=r;break;case"intersection":a=n;break;case"endpoints":{if(l){var d=this.manualEndptToPx(t.source()[0],s),f=Tn(d,2),p=f[0],g=f[1],m=this.manualEndptToPx(t.target()[0],o),v=Tn(m,2),y=v[0],b=v[1],w={x1:p,y1:g,x2:y,y2:b};i=u(p,g,y,b),a=w}else Nr("Edge ".concat(t.id()," has edge-distances:endpoints specified without manual endpoints specified via source-endpoint and target-endpoint.  Falling back on edge-distances:intersection (default).")),a=n;break}}return{midptPts:a,vectorNormInverse:i}};Ri.findHaystackPoints=function(t){for(var e=0;e<t.length;e++){var r=t[e],n=r._private,i=n.rscratch;if(!i.haystack){var a=Math.random()*2*Math.PI;i.source={x:Math.cos(a),y:Math.sin(a)},a=Math.random()*2*Math.PI,i.target={x:Math.cos(a),y:Math.sin(a)}}var s=n.source,o=n.target,l=s.position(),u=o.position(),h=s.width(),d=o.width(),f=s.height(),p=o.height(),g=r.pstyle("haystack-radius").value,m=g/2;i.haystackPts=i.allpts=[i.source.x*h*m+l.x,i.source.y*f*m+l.y,i.target.x*d*m+u.x,i.target.y*p*m+u.y],i.midX=(i.allpts[0]+i.allpts[2])/2,i.midY=(i.allpts[1]+i.allpts[3])/2,i.edgeType="haystack",i.haystack=!0,this.storeEdgeProjections(r),this.calculateArrowAngles(r),this.recalculateEdgeLabelProjections(r),this.calculateLabelAngles(r)}};Ri.findSegmentsPoints=function(t,e){var r=t._private.rscratch,n=t.pstyle("segment-weights"),i=t.pstyle("segment-distances"),a=t.pstyle("segment-radii"),s=t.pstyle("radius-type"),o=Math.min(n.pfValue.length,i.pfValue.length),l=a.pfValue[a.pfValue.length-1],u=s.pfValue[s.pfValue.length-1];r.edgeType="segments",r.segpts=[],r.radii=[],r.isArcRadius=[];for(var h=0;h<o;h++){var d=n.pfValue[h],f=i.pfValue[h],p=1-d,g=d,m=this.findMidptPtsEtc(t,e),v=m.midptPts,y=m.vectorNormInverse,b={x:v.x1*p+v.x2*g,y:v.y1*p+v.y2*g};r.segpts.push(b.x+y.x*f,b.y+y.y*f),r.radii.push(a.pfValue[h]!==void 0?a.pfValue[h]:l),r.isArcRadius.push((s.pfValue[h]!==void 0?s.pfValue[h]:u)==="arc-radius")}};Ri.findLoopPoints=function(t,e,r,n){var i=t._private.rscratch,a=e.dirCounts,s=e.srcPos,o=t.pstyle("control-point-distances"),l=o?o.pfValue[0]:void 0,u=t.pstyle("loop-direction").pfValue,h=t.pstyle("loop-sweep").pfValue,d=t.pstyle("control-point-step-size").pfValue;i.edgeType="self";var f=r,p=d;n&&(f=0,p=l);var g=u-Math.PI/2,m=g-h/2,v=g+h/2,y=u+"_"+h;f=a[y]===void 0?a[y]=0:++a[y],i.ctrlpts=[s.x+Math.cos(m)*1.4*p*(f/3+1),s.y+Math.sin(m)*1.4*p*(f/3+1),s.x+Math.cos(v)*1.4*p*(f/3+1),s.y+Math.sin(v)*1.4*p*(f/3+1)]};Ri.findCompoundLoopPoints=function(t,e,r,n){var i=t._private.rscratch;i.edgeType="compound";var a=e.srcPos,s=e.tgtPos,o=e.srcW,l=e.srcH,u=e.tgtW,h=e.tgtH,d=t.pstyle("control-point-step-size").pfValue,f=t.pstyle("control-point-distances"),p=f?f.pfValue[0]:void 0,g=r,m=d;n&&(g=0,m=p);var v=50,y={x:a.x-o/2,y:a.y-l/2},b={x:s.x-u/2,y:s.y-h/2},w={x:Math.min(y.x,b.x),y:Math.min(y.y,b.y)},T=.5,E=Math.max(T,Math.log(o*dp)),L=Math.max(T,Math.log(u*dp));i.ctrlpts=[w.x,w.y-(1+Math.pow(v,1.12)/100)*m*(g/3+1)*E,w.x-(1+Math.pow(v,1.12)/100)*m*(g/3+1)*L,w.y]};Ri.findStraightEdgePoints=function(t){t._private.rscratch.edgeType="straight"};Ri.findBezierPoints=function(t,e,r,n,i){var a=t._private.rscratch,s=t.pstyle("control-point-step-size").pfValue,o=t.pstyle("control-point-distances"),l=t.pstyle("control-point-weights"),u=o&&l?Math.min(o.value.length,l.value.length):1,h=o?o.pfValue[0]:void 0,d=l.value[0],f=n;a.edgeType=f?"multibezier":"bezier",a.ctrlpts=[];for(var p=0;p<u;p++){var g=(.5-e.eles.length/2+r)*s*(i?-1:1),m=void 0,v=XE(g);f&&(h=o?o.pfValue[p]:s,d=l.value[p]),n?m=h:m=h!==void 0?v*h:void 0;var y=m!==void 0?m:g,b=1-d,w=d,T=this.findMidptPtsEtc(t,e),E=T.midptPts,L=T.vectorNormInverse,S={x:E.x1*b+E.x2*w,y:E.y1*b+E.y2*w};a.ctrlpts.push(S.x+L.x*y,S.y+L.y*y)}};Ri.findTaxiPoints=function(t,e){var r=t._private.rscratch;r.edgeType="segments";var n="vertical",i="horizontal",a="leftward",s="rightward",o="downward",l="upward",u="auto",h=e.posPts,d=e.srcW,f=e.srcH,p=e.tgtW,g=e.tgtH,m=t.pstyle("edge-distances").value,v=m!=="node-position",y=t.pstyle("taxi-direction").value,b=y,w=t.pstyle("taxi-turn"),T=w.units==="%",E=w.pfValue,L=E<0,S=t.pstyle("taxi-turn-min-distance").pfValue,C=v?(d+p)/2:0,A=v?(f+g)/2:0,N=h.x2-h.x1,_=h.y2-h.y1,O=function(z,oe){return z>0?Math.max(z-oe,0):Math.min(z+oe,0)},P=O(N,C),k=O(_,A),R=!1;b===u?y=Math.abs(P)>Math.abs(k)?i:n:b===l||b===o?(y=n,R=!0):(b===a||b===s)&&(y=i,R=!0);var I=y===n,M=I?k:P,D=I?_:N,B=XE(D),$=!1;!(R&&(T||L))&&(b===o&&D<0||b===l&&D>0||b===a&&D>0||b===s&&D<0)&&(B*=-1,M=B*Math.abs(M),$=!0);var F;if(T){var G=E<0?1+E:E;F=G*M}else{var W=E<0?M:0;F=W+E*B}var J=function(z){return Math.abs(z)<S||Math.abs(z)>=Math.abs(M)},q=J(F),ne=J(Math.abs(M)-Math.abs(F)),ae=q||ne;if(ae&&!$)if(I){var pe=Math.abs(D)<=f/2,K=Math.abs(N)<=p/2;if(pe){var Z=(h.x1+h.x2)/2,X=h.y1,Y=h.y2;r.segpts=[Z,X,Z,Y]}else if(K){var ee=(h.y1+h.y2)/2,j=h.x1,fe=h.x2;r.segpts=[j,ee,fe,ee]}else r.segpts=[h.x1,h.y2]}else{var te=Math.abs(D)<=d/2,Ae=Math.abs(_)<=g/2;if(te){var H=(h.y1+h.y2)/2,Oe=h.x1,ue=h.x2;r.segpts=[Oe,H,ue,H]}else if(Ae){var Ve=(h.x1+h.x2)/2,Ge=h.y1,Ue=h.y2;r.segpts=[Ve,Ge,Ve,Ue]}else r.segpts=[h.x2,h.y1]}else if(I){var ke=h.y1+F+(v?f/2*B:0),Pe=h.x1,Se=h.x2;r.segpts=[Pe,ke,Se,ke]}else{var _e=h.x1+F+(v?d/2*B:0),ze=h.y1,me=h.y2;r.segpts=[_e,ze,_e,me]}if(r.isRound){var De=t.pstyle("taxi-radius").value,Q=t.pstyle("radius-type").value[0]==="arc-radius";r.radii=new Array(r.segpts.length/2).fill(De),r.isArcRadius=new Array(r.segpts.length/2).fill(Q)}};Ri.tryToCorrectInvalidPoints=function(t,e){var r=t._private.rscratch;if(r.edgeType==="bezier"){var n=e.srcPos,i=e.tgtPos,a=e.srcW,s=e.srcH,o=e.tgtW,l=e.tgtH,u=e.srcShape,h=e.tgtShape,d=e.srcCornerRadius,f=e.tgtCornerRadius,p=e.srcRs,g=e.tgtRs,m=!vt(r.startX)||!vt(r.startY),v=!vt(r.arrowStartX)||!vt(r.arrowStartY),y=!vt(r.endX)||!vt(r.endY),b=!vt(r.arrowEndX)||!vt(r.arrowEndY),w=3,T=this.getArrowWidth(t.pstyle("width").pfValue,t.pstyle("arrow-scale").value)*this.arrowShapeWidth,E=w*T,L=fu({x:r.ctrlpts[0],y:r.ctrlpts[1]},{x:r.startX,y:r.startY}),S=L<E,C=fu({x:r.ctrlpts[0],y:r.ctrlpts[1]},{x:r.endX,y:r.endY}),A=C<E,N=!1;if(m||v||S){N=!0;var _={x:r.ctrlpts[0]-n.x,y:r.ctrlpts[1]-n.y},O=Math.sqrt(_.x*_.x+_.y*_.y),P={x:_.x/O,y:_.y/O},k=Math.max(a,s),R={x:r.ctrlpts[0]+P.x*2*k,y:r.ctrlpts[1]+P.y*2*k},I=u.intersectLine(n.x,n.y,a,s,R.x,R.y,0,d,p);S?(r.ctrlpts[0]=r.ctrlpts[0]+P.x*(E-L),r.ctrlpts[1]=r.ctrlpts[1]+P.y*(E-L)):(r.ctrlpts[0]=I[0]+P.x*E,r.ctrlpts[1]=I[1]+P.y*E)}if(y||b||A){N=!0;var M={x:r.ctrlpts[0]-i.x,y:r.ctrlpts[1]-i.y},D=Math.sqrt(M.x*M.x+M.y*M.y),B={x:M.x/D,y:M.y/D},$=Math.max(a,s),F={x:r.ctrlpts[0]+B.x*2*$,y:r.ctrlpts[1]+B.y*2*$},G=h.intersectLine(i.x,i.y,o,l,F.x,F.y,0,f,g);A?(r.ctrlpts[0]=r.ctrlpts[0]+B.x*(E-C),r.ctrlpts[1]=r.ctrlpts[1]+B.y*(E-C)):(r.ctrlpts[0]=G[0]+B.x*E,r.ctrlpts[1]=G[1]+B.y*E)}N&&this.findEndpoints(t)}};Ri.storeAllpts=function(t){var e=t._private.rscratch;if(e.edgeType==="multibezier"||e.edgeType==="bezier"||e.edgeType==="self"||e.edgeType==="compound"){e.allpts=[],e.allpts.push(e.startX,e.startY);for(var r=0;r+1<e.ctrlpts.length;r+=2)e.allpts.push(e.ctrlpts[r],e.ctrlpts[r+1]),r+3<e.ctrlpts.length&&e.allpts.push((e.ctrlpts[r]+e.ctrlpts[r+2])/2,(e.ctrlpts[r+1]+e.ctrlpts[r+3])/2);e.allpts.push(e.endX,e.endY);var n,i;e.ctrlpts.length/2%2===0?(n=e.allpts.length/2-1,e.midX=e.allpts[n],e.midY=e.allpts[n+1]):(n=e.allpts.length/2-3,i=.5,e.midX=qn(e.allpts[n],e.allpts[n+2],e.allpts[n+4],i),e.midY=qn(e.allpts[n+1],e.allpts[n+3],e.allpts[n+5],i))}else if(e.edgeType==="straight")e.allpts=[e.startX,e.startY,e.endX,e.endY],e.midX=(e.startX+e.endX+e.arrowStartX+e.arrowEndX)/4,e.midY=(e.startY+e.endY+e.arrowStartY+e.arrowEndY)/4;else if(e.edgeType==="segments"){if(e.allpts=[],e.allpts.push(e.startX,e.startY),e.allpts.push.apply(e.allpts,e.segpts),e.allpts.push(e.endX,e.endY),e.isRound){e.roundCorners=[];for(var a=2;a+3<e.allpts.length;a+=2){var s=e.radii[a/2-1],o=e.isArcRadius[a/2-1];e.roundCorners.push(ok({x:e.allpts[a-2],y:e.allpts[a-1]},{x:e.allpts[a],y:e.allpts[a+1],radius:s},{x:e.allpts[a+2],y:e.allpts[a+3]},s,o))}}if(e.segpts.length%4===0){var l=e.segpts.length/2,u=l-2;e.midX=(e.segpts[u]+e.segpts[l])/2,e.midY=(e.segpts[u+1]+e.segpts[l+1])/2}else{var h=e.segpts.length/2-1;if(!e.isRound)e.midX=e.segpts[h],e.midY=e.segpts[h+1];else{var d={x:e.segpts[h],y:e.segpts[h+1]},f=e.roundCorners[h/2];if(f.radius===0){var p={x:e.segpts[h+2],y:e.segpts[h+3]};e.midX=d.x,e.midY=d.y,e.midVector=[d.y-p.y,p.x-d.x]}else{var g=[d.x-f.cx,d.y-f.cy],m=f.radius/Math.sqrt(Math.pow(g[0],2)+Math.pow(g[1],2));g=g.map(function(v){return v*m}),e.midX=f.cx+g[0],e.midY=f.cy+g[1],e.midVector=g}}}}};Ri.checkForInvalidEdgeWarning=function(t){var e=t[0]._private.rscratch;e.nodesOverlap||vt(e.startX)&&vt(e.startY)&&vt(e.endX)&&vt(e.endY)?e.loggedErr=!1:e.loggedErr||(e.loggedErr=!0,Nr("Edge `"+t.id()+"` has invalid endpoints and so it is impossible to draw.  Adjust your edge style (e.g. control points) accordingly or use an alternative edge type.  This is expected behaviour when the source node and the target node overlap."))};Ri.findEdgeControlPoints=function(t){var e=this;if(!(!t||t.length===0)){for(var r=this,n=r.cy,i=n.hasCompoundNodes(),a=new Mo,s=function(A,N){return[].concat(Nv(A),[N?1:0]).join("-")},o=[],l=[],u=0;u<t.length;u++){var h=t[u],d=h._private,f=h.pstyle("curve-style").value;if(!(h.removed()||!h.takesUpSpace())){if(f==="haystack"){l.push(h);continue}var p=f==="unbundled-bezier"||Tl(f,"segments")||f==="straight"||f==="straight-triangle"||Tl(f,"taxi"),g=f==="unbundled-bezier"||f==="bezier",m=d.source,v=d.target,y=m.poolIndex(),b=v.poolIndex(),w=[y,b].sort(),T=s(w,p),E=a.get(T);E==null&&(E={eles:[]},o.push({pairId:w,edgeIsUnbundled:p}),a.set(T,E)),E.eles.push(h),p&&(E.hasUnbundled=!0),g&&(E.hasBezier=!0)}}for(var L=function(){var A=o[S],N=A.pairId,_=A.edgeIsUnbundled,O=s(N,_),P=a.get(O),k;if(!P.hasUnbundled){var R=P.eles[0].parallelEdges().filter(function(Q){return Q.isBundledBezier()});qE(P.eles),R.forEach(function(Q){return P.eles.push(Q)}),P.eles.sort(function(Q,ce){return Q.poolIndex()-ce.poolIndex()})}var I=P.eles[0],M=I.source(),D=I.target();if(M.poolIndex()>D.poolIndex()){var B=M;M=D,D=B}var $=P.srcPos=M.position(),F=P.tgtPos=D.position(),G=P.srcW=M.outerWidth(),W=P.srcH=M.outerHeight(),J=P.tgtW=D.outerWidth(),q=P.tgtH=D.outerHeight(),ne=P.srcShape=r.nodeShapes[e.getNodeShape(M)],ae=P.tgtShape=r.nodeShapes[e.getNodeShape(D)],pe=P.srcCornerRadius=M.pstyle("corner-radius").value==="auto"?"auto":M.pstyle("corner-radius").pfValue,K=P.tgtCornerRadius=D.pstyle("corner-radius").value==="auto"?"auto":D.pstyle("corner-radius").pfValue,Z=P.tgtRs=D._private.rscratch,X=P.srcRs=M._private.rscratch;P.dirCounts={north:0,west:0,south:0,east:0,northwest:0,southwest:0,northeast:0,southeast:0};for(var Y=0;Y<P.eles.length;Y++){var ee=P.eles[Y],j=ee[0]._private.rscratch,fe=ee.pstyle("curve-style").value,te=fe==="unbundled-bezier"||Tl(fe,"segments")||Tl(fe,"taxi"),Ae=!M.same(ee.source());if(!P.calculatedIntersection&&M!==D&&(P.hasBezier||P.hasUnbundled)){P.calculatedIntersection=!0;var H=ne.intersectLine($.x,$.y,G,W,F.x,F.y,0,pe,X),Oe=P.srcIntn=H,ue=ae.intersectLine(F.x,F.y,J,q,$.x,$.y,0,K,Z),Ve=P.tgtIntn=ue,Ge=P.intersectionPts={x1:H[0],x2:ue[0],y1:H[1],y2:ue[1]},Ue=P.posPts={x1:$.x,x2:F.x,y1:$.y,y2:F.y},ke=ue[1]-H[1],Pe=ue[0]-H[0],Se=Math.sqrt(Pe*Pe+ke*ke);vt(Se)&&Se>=mxe||(Se=Math.sqrt(Math.max(Pe*Pe,dp)+Math.max(ke*ke,dp)));var _e=P.vector={x:Pe,y:ke},ze=P.vectorNorm={x:_e.x/Se,y:_e.y/Se},me={x:-ze.y,y:ze.x};P.nodesOverlap=!vt(Se)||ae.checkPoint(H[0],H[1],0,J,q,F.x,F.y,K,Z)||ne.checkPoint(ue[0],ue[1],0,G,W,$.x,$.y,pe,X),P.vectorNormInverse=me,k={nodesOverlap:P.nodesOverlap,dirCounts:P.dirCounts,calculatedIntersection:!0,hasBezier:P.hasBezier,hasUnbundled:P.hasUnbundled,eles:P.eles,srcPos:F,srcRs:Z,tgtPos:$,tgtRs:X,srcW:J,srcH:q,tgtW:G,tgtH:W,srcIntn:Ve,tgtIntn:Oe,srcShape:ae,tgtShape:ne,posPts:{x1:Ue.x2,y1:Ue.y2,x2:Ue.x1,y2:Ue.y1},intersectionPts:{x1:Ge.x2,y1:Ge.y2,x2:Ge.x1,y2:Ge.y1},vector:{x:-_e.x,y:-_e.y},vectorNorm:{x:-ze.x,y:-ze.y},vectorNormInverse:{x:-me.x,y:-me.y}}}var De=Ae?k:P;j.nodesOverlap=De.nodesOverlap,j.srcIntn=De.srcIntn,j.tgtIntn=De.tgtIntn,j.isRound=fe.startsWith("round"),i&&(M.isParent()||M.isChild()||D.isParent()||D.isChild())&&(M.parents().anySame(D)||D.parents().anySame(M)||M.same(D)&&M.isParent())?e.findCompoundLoopPoints(ee,De,Y,te):M===D?e.findLoopPoints(ee,De,Y,te):fe.endsWith("segments")?e.findSegmentsPoints(ee,De):fe.endsWith("taxi")?e.findTaxiPoints(ee,De):fe==="straight"||!te&&P.eles.length%2===1&&Y===Math.floor(P.eles.length/2)?e.findStraightEdgePoints(ee):e.findBezierPoints(ee,De,Y,te,Ae),e.findEndpoints(ee),e.tryToCorrectInvalidPoints(ee,De),e.checkForInvalidEdgeWarning(ee),e.storeAllpts(ee),e.storeEdgeProjections(ee),e.calculateArrowAngles(ee),e.recalculateEdgeLabelProjections(ee),e.calculateLabelAngles(ee)}},S=0;S<o.length;S++)L();this.findHaystackPoints(l)}};function wV(t){var e=[];if(t!=null){for(var r=0;r<t.length;r+=2){var n=t[r],i=t[r+1];e.push({x:n,y:i})}return e}}Ri.getSegmentPoints=function(t){var e=t[0]._private.rscratch;this.recalculateRenderedStyle(t);var r=e.edgeType;if(r==="segments")return wV(e.segpts)};Ri.getControlPoints=function(t){var e=t[0]._private.rscratch;this.recalculateRenderedStyle(t);var r=e.edgeType;if(r==="bezier"||r==="multibezier"||r==="self"||r==="compound")return wV(e.ctrlpts)};Ri.getEdgeMidpoint=function(t){var e=t[0]._private.rscratch;return this.recalculateRenderedStyle(t),{x:e.midX,y:e.midY}};var ig={};ig.manualEndptToPx=function(t,e){var r=this,n=t.position(),i=t.outerWidth(),a=t.outerHeight(),s=t._private.rscratch;if(e.value.length===2){var o=[e.pfValue[0],e.pfValue[1]];return e.units[0]==="%"&&(o[0]=o[0]*i),e.units[1]==="%"&&(o[1]=o[1]*a),o[0]+=n.x,o[1]+=n.y,o}else{var l=e.pfValue[0];l=-Math.PI/2+l;var u=2*Math.max(i,a),h=[n.x+Math.cos(l)*u,n.y+Math.sin(l)*u];return r.nodeShapes[this.getNodeShape(t)].intersectLine(n.x,n.y,i,a,h[0],h[1],0,t.pstyle("corner-radius").value==="auto"?"auto":t.pstyle("corner-radius").pfValue,s)}};ig.findEndpoints=function(t){var e,r,n,i,a=this,s,o=t.source()[0],l=t.target()[0],u=o.position(),h=l.position(),d=t.pstyle("target-arrow-shape").value,f=t.pstyle("source-arrow-shape").value,p=t.pstyle("target-distance-from-node").pfValue,g=t.pstyle("source-distance-from-node").pfValue,m=o._private.rscratch,v=l._private.rscratch,y=t.pstyle("curve-style").value,b=t._private.rscratch,w=b.edgeType,T=Tl(y,"taxi"),E=w==="self"||w==="compound",L=w==="bezier"||w==="multibezier"||E,S=w!=="bezier",C=w==="straight"||w==="segments",A=w==="segments",N=L||S||C,_=E||T,O=t.pstyle("source-endpoint"),P=_?"outside-to-node":O.value,k=o.pstyle("corner-radius").value==="auto"?"auto":o.pstyle("corner-radius").pfValue,R=t.pstyle("target-endpoint"),I=_?"outside-to-node":R.value,M=l.pstyle("corner-radius").value==="auto"?"auto":l.pstyle("corner-radius").pfValue;b.srcManEndpt=O,b.tgtManEndpt=R;var D,B,$,F,G=(e=(R==null||(r=R.pfValue)===null||r===void 0?void 0:r.length)===2?R.pfValue:null)!==null&&e!==void 0?e:[0,0],W=(n=(O==null||(i=O.pfValue)===null||i===void 0?void 0:i.length)===2?O.pfValue:null)!==null&&n!==void 0?n:[0,0];if(L){var J=[b.ctrlpts[0],b.ctrlpts[1]],q=S?[b.ctrlpts[b.ctrlpts.length-2],b.ctrlpts[b.ctrlpts.length-1]]:J;D=q,B=J}else if(C){var ne=A?b.segpts.slice(0,2):[h.x+G[0],h.y+G[1]],ae=A?b.segpts.slice(b.segpts.length-2):[u.x+W[0],u.y+W[1]];D=ae,B=ne}if(I==="inside-to-node")s=[h.x,h.y];else if(R.units)s=this.manualEndptToPx(l,R);else if(I==="outside-to-line")s=b.tgtIntn;else if(I==="outside-to-node"||I==="outside-to-node-or-label"?$=D:(I==="outside-to-line"||I==="outside-to-line-or-label")&&($=[u.x,u.y]),s=a.nodeShapes[this.getNodeShape(l)].intersectLine(h.x,h.y,l.outerWidth(),l.outerHeight(),$[0],$[1],0,M,v),I==="outside-to-node-or-label"||I==="outside-to-line-or-label"){var pe=l._private.rscratch,K=pe.labelWidth,Z=pe.labelHeight,X=pe.labelX,Y=pe.labelY,ee=K/2,j=Z/2,fe=l.pstyle("text-valign").value;fe==="top"?Y-=j:fe==="bottom"&&(Y+=j);var te=l.pstyle("text-halign").value;te==="left"?X-=ee:te==="right"&&(X+=ee);var Ae=op($[0],$[1],[X-ee,Y-j,X+ee,Y-j,X+ee,Y+j,X-ee,Y+j],h.x,h.y);if(Ae.length>0){var H=u,Oe=Dc(H,xh(s)),ue=Dc(H,xh(Ae)),Ve=Oe;if(ue<Oe&&(s=Ae,Ve=ue),Ae.length>2){var Ge=Dc(H,{x:Ae[2],y:Ae[3]});Ge<Ve&&(s=[Ae[2],Ae[3]])}}}var Ue=Zg(s,D,a.arrowShapes[d].spacing(t)+p),ke=Zg(s,D,a.arrowShapes[d].gap(t)+p);if(b.endX=ke[0],b.endY=ke[1],b.arrowEndX=Ue[0],b.arrowEndY=Ue[1],P==="inside-to-node")s=[u.x,u.y];else if(O.units)s=this.manualEndptToPx(o,O);else if(P==="outside-to-line")s=b.srcIntn;else if(P==="outside-to-node"||P==="outside-to-node-or-label"?F=B:(P==="outside-to-line"||P==="outside-to-line-or-label")&&(F=[h.x,h.y]),s=a.nodeShapes[this.getNodeShape(o)].intersectLine(u.x,u.y,o.outerWidth(),o.outerHeight(),F[0],F[1],0,k,m),P==="outside-to-node-or-label"||P==="outside-to-line-or-label"){var Pe=o._private.rscratch,Se=Pe.labelWidth,_e=Pe.labelHeight,ze=Pe.labelX,me=Pe.labelY,De=Se/2,Q=_e/2,ce=o.pstyle("text-valign").value;ce==="top"?me-=Q:ce==="bottom"&&(me+=Q);var z=o.pstyle("text-halign").value;z==="left"?ze-=De:z==="right"&&(ze+=De);var oe=op(F[0],F[1],[ze-De,me-Q,ze+De,me-Q,ze+De,me+Q,ze-De,me+Q],u.x,u.y);if(oe.length>0){var se=h,ge=Dc(se,xh(s)),he=Dc(se,xh(oe)),be=ge;if(he<ge&&(s=[oe[0],oe[1]],be=he),oe.length>2){var Ce=Dc(se,{x:oe[2],y:oe[3]});Ce<be&&(s=[oe[2],oe[3]])}}}var Te=Zg(s,B,a.arrowShapes[f].spacing(t)+g),Ne=Zg(s,B,a.arrowShapes[f].gap(t)+g);b.startX=Ne[0],b.startY=Ne[1],b.arrowStartX=Te[0],b.arrowStartY=Te[1],N&&(!vt(b.startX)||!vt(b.startY)||!vt(b.endX)||!vt(b.endY)?b.badLine=!0:b.badLine=!1)};ig.getSourceEndpoint=function(t){var e=t[0]._private.rscratch;switch(this.recalculateRenderedStyle(t),e.edgeType){case"haystack":return{x:e.haystackPts[0],y:e.haystackPts[1]};default:return{x:e.arrowStartX,y:e.arrowStartY}}};ig.getTargetEndpoint=function(t){var e=t[0]._private.rscratch;switch(this.recalculateRenderedStyle(t),e.edgeType){case"haystack":return{x:e.haystackPts[2],y:e.haystackPts[3]};default:return{x:e.arrowEndX,y:e.arrowEndY}}};var lk={};function vxe(t,e,r){for(var n=function(u,h,d,f){return qn(u,h,d,f)},i=e._private,a=i.rstyle.bezierPts,s=0;s<t.bezierProjPcts.length;s++){var o=t.bezierProjPcts[s];a.push({x:n(r[0],r[2],r[4],o),y:n(r[1],r[3],r[5],o)})}}lk.storeEdgeProjections=function(t){var e=t._private,r=e.rscratch,n=r.edgeType;if(e.rstyle.bezierPts=null,e.rstyle.linePts=null,e.rstyle.haystackPts=null,n==="multibezier"||n==="bezier"||n==="self"||n==="compound"){e.rstyle.bezierPts=[];for(var i=0;i+5<r.allpts.length;i+=4)vxe(this,t,r.allpts.slice(i,i+6))}else if(n==="segments")for(var a=e.rstyle.linePts=[],i=0;i+1<r.allpts.length;i+=2)a.push({x:r.allpts[i],y:r.allpts[i+1]});else if(n==="haystack"){var s=r.haystackPts;e.rstyle.haystackPts=[{x:s[0],y:s[1]},{x:s[2],y:s[3]}]}e.rstyle.arrowWidth=this.getArrowWidth(t.pstyle("width").pfValue,t.pstyle("arrow-scale").value)*this.arrowShapeWidth};lk.recalculateEdgeProjections=function(t){this.findEdgeControlPoints(t)};var lo={};lo.recalculateNodeLabelProjection=function(t){var e=t.pstyle("label").strValue;if(!Vl(e)){var r,n,i=t._private,a=t.width(),s=t.height(),o=t.padding(),l=t.position(),u=t.pstyle("text-halign").strValue,h=t.pstyle("text-valign").strValue,d=i.rscratch,f=i.rstyle;switch(u){case"left":r=l.x-a/2-o;break;case"right":r=l.x+a/2+o;break;default:r=l.x}switch(h){case"top":n=l.y-s/2-o;break;case"bottom":n=l.y+s/2+o;break;default:n=l.y}d.labelX=r,d.labelY=n,f.labelX=r,f.labelY=n,this.calculateLabelAngles(t),this.applyLabelDimensions(t)}};var TV=function(e,r){var n=Math.atan(r/e);return e===0&&n<0&&(n=n*-1),n},EV=function(e,r){var n=r.x-e.x,i=r.y-e.y;return TV(n,i)},yxe=function(e,r,n,i){var a=sp(0,i-.001,1),s=sp(0,i+.001,1),o=Dh(e,r,n,a),l=Dh(e,r,n,s);return EV(o,l)};lo.recalculateEdgeLabelProjections=function(t){var e,r=t._private,n=r.rscratch,i=this,a={mid:t.pstyle("label").strValue,source:t.pstyle("source-label").strValue,target:t.pstyle("target-label").strValue};if(a.mid||a.source||a.target){e={x:n.midX,y:n.midY};var s=function(d,f,p){Co(r.rscratch,d,f,p),Co(r.rstyle,d,f,p)};s("labelX",null,e.x),s("labelY",null,e.y);var o=TV(n.midDispX,n.midDispY);s("labelAutoAngle",null,o);var l=function(){if(l.cache)return l.cache;for(var d=[],f=0;f+5<n.allpts.length;f+=4){var p={x:n.allpts[f],y:n.allpts[f+1]},g={x:n.allpts[f+2],y:n.allpts[f+3]},m={x:n.allpts[f+4],y:n.allpts[f+5]};d.push({p0:p,p1:g,p2:m,startDist:0,length:0,segments:[]})}var v=r.rstyle.bezierPts,y=i.bezierProjPcts.length;function b(S,C,A,N,_){var O=fu(C,A),P=S.segments[S.segments.length-1],k={p0:C,p1:A,t0:N,t1:_,startDist:P?P.startDist+P.length:0,length:O};S.segments.push(k),S.length+=O}for(var w=0;w<d.length;w++){var T=d[w],E=d[w-1];E&&(T.startDist=E.startDist+E.length),b(T,T.p0,v[w*y],0,i.bezierProjPcts[0]);for(var L=0;L<y-1;L++)b(T,v[w*y+L],v[w*y+L+1],i.bezierProjPcts[L],i.bezierProjPcts[L+1]);b(T,v[w*y+y-1],T.p2,i.bezierProjPcts[y-1],1)}return l.cache=d},u=function(d){var f,p=d==="source";if(a[d]){var g=t.pstyle(d+"-text-offset").pfValue;switch(n.edgeType){case"self":case"compound":case"bezier":case"multibezier":{for(var m=l(),v,y=0,b=0,w=0;w<m.length;w++){for(var T=m[p?w:m.length-1-w],E=0;E<T.segments.length;E++){var L=T.segments[p?E:T.segments.length-1-E],S=w===m.length-1&&E===T.segments.length-1;if(y=b,b+=L.length,b>=g||S){v={cp:T,segment:L};break}}if(v)break}var C=v.cp,A=v.segment,N=(g-y)/A.length,_=A.t1-A.t0,O=p?A.t0+_*N:A.t1-_*N;O=sp(0,O,1),e=Dh(C.p0,C.p1,C.p2,O),f=yxe(C.p0,C.p1,C.p2,O);break}case"straight":case"segments":case"haystack":{for(var P=0,k,R,I,M,D=n.allpts.length,B=0;B+3<D&&(p?(I={x:n.allpts[B],y:n.allpts[B+1]},M={x:n.allpts[B+2],y:n.allpts[B+3]}):(I={x:n.allpts[D-2-B],y:n.allpts[D-1-B]},M={x:n.allpts[D-4-B],y:n.allpts[D-3-B]}),k=fu(I,M),R=P,P+=k,!(P>=g));B+=2);var $=g-R,F=$/k;F=sp(0,F,1),e=zme(I,M,F),f=EV(I,M);break}}s("labelX",d,e.x),s("labelY",d,e.y),s("labelAutoAngle",d,f)}};u("source"),u("target"),this.applyLabelDimensions(t)}};lo.applyLabelDimensions=function(t){this.applyPrefixedLabelDimensions(t),t.isEdge()&&(this.applyPrefixedLabelDimensions(t,"source"),this.applyPrefixedLabelDimensions(t,"target"))};lo.applyPrefixedLabelDimensions=function(t,e){var r=t._private,n=this.getLabelText(t,e),i=du(n,t._private.labelDimsKey);if(ia(r.rscratch,"prefixedLabelDimsKey",e)!==i){Co(r.rscratch,"prefixedLabelDimsKey",e,i);var a=this.calculateLabelDimensions(t,n),s=t.pstyle("line-height").pfValue,o=t.pstyle("text-wrap").strValue,l=ia(r.rscratch,"labelWrapCachedLines",e)||[],u=o!=="wrap"?1:Math.max(l.length,1),h=a.height/u,d=h*s,f=a.width,p=a.height+(u-1)*(s-1)*h;Co(r.rstyle,"labelWidth",e,f),Co(r.rscratch,"labelWidth",e,f),Co(r.rstyle,"labelHeight",e,p),Co(r.rscratch,"labelHeight",e,p),Co(r.rscratch,"labelLineHeight",e,d)}};lo.getLabelText=function(t,e){var r=t._private,n=e?e+"-":"",i=t.pstyle(n+"label").strValue,a=t.pstyle("text-transform").value,s=function(W,J){return J?(Co(r.rscratch,W,e,J),J):ia(r.rscratch,W,e)};if(!i)return"";a=="none"||(a=="uppercase"?i=i.toUpperCase():a=="lowercase"&&(i=i.toLowerCase()));var o=t.pstyle("text-wrap").value;if(o==="wrap"){var l=s("labelKey");if(l!=null&&s("labelWrapKey")===l)return s("labelWrapCachedText");for(var u="​",h=i.split(`
`),d=t.pstyle("text-max-width").pfValue,f=t.pstyle("text-overflow-wrap").value,p=f==="anywhere",g=[],m=/[\s\u200b]+|$/g,v=0;v<h.length;v++){var y=h[v],b=this.calculateLabelDimensions(t,y),w=b.width;if(p){var T=y.split("").join(u);y=T}if(w>d){var E=y.matchAll(m),L="",S=0,C=la(E),A;try{for(C.s();!(A=C.n()).done;){var N=A.value,_=N[0],O=y.substring(S,N.index);S=N.index+_.length;var P=L.length===0?O:L+O+_,k=this.calculateLabelDimensions(t,P),R=k.width;R<=d?L+=O+_:(L&&g.push(L),L=O+_)}}catch(G){C.e(G)}finally{C.f()}L.match(/^[\s\u200b]+$/)||g.push(L)}else g.push(y)}s("labelWrapCachedLines",g),i=s("labelWrapCachedText",g.join(`
`)),s("labelWrapKey",l)}else if(o==="ellipsis"){var I=t.pstyle("text-max-width").pfValue,M="",D="…",B=!1;if(this.calculateLabelDimensions(t,i).width<I)return i;for(var $=0;$<i.length;$++){var F=this.calculateLabelDimensions(t,M+i[$]+D).width;if(F>I)break;M+=i[$],$===i.length-1&&(B=!0)}return B||(M+=D),M}return i};lo.getLabelJustification=function(t){var e=t.pstyle("text-justification").strValue,r=t.pstyle("text-halign").strValue;if(e==="auto")if(t.isNode())switch(r){case"left":return"right";case"right":return"left";default:return"center"}else return"center";else return e};lo.calculateLabelDimensions=function(t,e){var r=this,n=r.cy.window(),i=n.document,a=0,s=t.pstyle("font-style").strValue,o=t.pstyle("font-size").pfValue,l=t.pstyle("font-family").strValue,u=t.pstyle("font-weight").strValue,h=this.labelCalcCanvas,d=this.labelCalcCanvasContext;if(!h){h=this.labelCalcCanvas=i.createElement("canvas"),d=this.labelCalcCanvasContext=h.getContext("2d");var f=h.style;f.position="absolute",f.left="-9999px",f.top="-9999px",f.zIndex="-1",f.visibility="hidden",f.pointerEvents="none"}d.font="".concat(s," ").concat(u," ").concat(o,"px ").concat(l);for(var p=0,g=0,m=e.split(`
`),v=0;v<m.length;v++){var y=m[v],b=d.measureText(y),w=Math.ceil(b.width),T=o;p=Math.max(w,p),g+=T}return p+=a,g+=a,{width:p,height:g}};lo.calculateLabelAngle=function(t,e){var r=t._private,n=r.rscratch,i=t.isEdge(),a=e?e+"-":"",s=t.pstyle(a+"text-rotation"),o=s.strValue;return o==="none"?0:i&&o==="autorotate"?n.labelAutoAngle:o==="autorotate"?0:s.pfValue};lo.calculateLabelAngles=function(t){var e=this,r=t.isEdge(),n=t._private,i=n.rscratch;i.labelAngle=e.calculateLabelAngle(t),r&&(i.sourceLabelAngle=e.calculateLabelAngle(t,"source"),i.targetLabelAngle=e.calculateLabelAngle(t,"target"))};var kV={},U_=28,W_=!1;kV.getNodeShape=function(t){var e=this,r=t.pstyle("shape").value;if(r==="cutrectangle"&&(t.width()<U_||t.height()<U_))return W_||(Nr("The `cutrectangle` node shape can not be used at small sizes so `rectangle` is used instead"),W_=!0),"rectangle";if(t.isParent())return r==="rectangle"||r==="roundrectangle"||r==="round-rectangle"||r==="cutrectangle"||r==="cut-rectangle"||r==="barrel"?r:"rectangle";if(r==="polygon"){var n=t.pstyle("shape-polygon-points").value;return e.nodeShapes.makePolygon(n).name}return r};var U2={};U2.registerCalculationListeners=function(){var t=this.cy,e=t.collection(),r=this,n=function(s){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(e.merge(s),o)for(var l=0;l<s.length;l++){var u=s[l],h=u._private,d=h.rstyle;d.clean=!1,d.cleanConnected=!1}};r.binder(t).on("bounds.* dirty.*",function(s){var o=s.target;n(o)}).on("style.* background.*",function(s){var o=s.target;n(o,!1)});var i=function(s){if(s){var o=r.onUpdateEleCalcsFns;e.cleanStyle();for(var l=0;l<e.length;l++){var u=e[l],h=u._private.rstyle;u.isNode()&&!h.cleanConnected&&(n(u.connectedEdges()),h.cleanConnected=!0)}if(o)for(var d=0;d<o.length;d++){var f=o[d];f(s,e)}r.recalculateRenderedStyle(e),e=t.collection()}};r.flushRenderedStyleQueue=function(){i(!0)},r.beforeRender(i,r.beforeRenderPriorities.eleCalcs)};U2.onUpdateEleCalcs=function(t){var e=this.onUpdateEleCalcsFns=this.onUpdateEleCalcsFns||[];e.push(t)};U2.recalculateRenderedStyle=function(t,e){var r=function(T){return T._private.rstyle.cleanConnected};if(t.length!==0){var n=[],i=[];if(!this.destroyed){e===void 0&&(e=!0);for(var a=0;a<t.length;a++){var s=t[a],o=s._private,l=o.rstyle;s.isEdge()&&(!r(s.source())||!r(s.target()))&&(l.clean=!1),s.isEdge()&&s.isBundledBezier()&&s.parallelEdges().some(function(w){return!w._private.rstyle.clean&&w.isBundledBezier()})&&(l.clean=!1),!(e&&l.clean||s.removed())&&s.pstyle("display").value!=="none"&&(o.group==="nodes"?i.push(s):n.push(s),l.clean=!0)}for(var u=0;u<i.length;u++){var h=i[u],d=h._private,f=d.rstyle,p=h.position();this.recalculateNodeLabelProjection(h),f.nodeX=p.x,f.nodeY=p.y,f.nodeW=h.pstyle("width").pfValue,f.nodeH=h.pstyle("height").pfValue}this.recalculateEdgeProjections(n);for(var g=0;g<n.length;g++){var m=n[g],v=m._private,y=v.rstyle,b=v.rscratch;y.srcX=b.arrowStartX,y.srcY=b.arrowStartY,y.tgtX=b.arrowEndX,y.tgtY=b.arrowEndY,y.midX=b.midX,y.midY=b.midY,y.labelAngle=b.labelAngle,y.sourceLabelAngle=b.sourceLabelAngle,y.targetLabelAngle=b.targetLabelAngle}}}};var W2={};W2.updateCachedGrabbedEles=function(){var t=this.cachedZSortedEles;if(t){t.drag=[],t.nondrag=[];for(var e=[],r=0;r<t.length;r++){var n=t[r],i=n._private.rscratch;n.grabbed()&&!n.isParent()?e.push(n):i.inDragLayer?t.drag.push(n):t.nondrag.push(n)}for(var r=0;r<e.length;r++){var n=e[r];t.drag.push(n)}}};W2.invalidateCachedZSortedEles=function(){this.cachedZSortedEles=null};W2.getCachedZSortedEles=function(t){if(t||!this.cachedZSortedEles){var e=this.cy.mutableElements().toArray();e.sort(aV),e.interactive=e.filter(function(r){return r.interactive()}),this.cachedZSortedEles=e,this.updateCachedGrabbedEles()}else e=this.cachedZSortedEles;return e};var SV={};[Ou,Vv,Ri,ig,lk,lo,kV,U2,W2].forEach(function(t){Gt(SV,t)});var CV={};CV.getCachedImage=function(t,e,r){var n=this,i=n.imageCache=n.imageCache||{},a=i[t];if(a)return a.image.complete||a.image.addEventListener("load",r),a.image;a=i[t]=i[t]||{};var s=a.image=new Image;s.addEventListener("load",r),s.addEventListener("error",function(){s.error=!0});var o="data:",l=t.substring(0,o.length).toLowerCase()===o;return l||(e=e==="null"?null:e,s.crossOrigin=e),s.src=t,s};var Id={};Id.registerBinding=function(t,e,r,n){var i=Array.prototype.slice.apply(arguments,[1]);if(Array.isArray(t)){for(var a=[],s=0;s<t.length;s++){var o=t[s];if(o!==void 0){var l=this.binder(o);a.push(l.on.apply(l,i))}}return a}var l=this.binder(t);return l.on.apply(l,i)};Id.binder=function(t){var e=this,r=e.cy.window(),n=t===r||t===r.document||t===r.document.body||R1e(t);if(e.supportsPassiveEvents==null){var i=!1;try{var a=Object.defineProperty({},"passive",{get:function(){return i=!0,!0}});r.addEventListener("test",null,a)}catch{}e.supportsPassiveEvents=i}var s=function(l,u,h){var d=Array.prototype.slice.call(arguments);return n&&e.supportsPassiveEvents&&(d[2]={capture:h??!1,passive:!1,once:!1}),e.bindings.push({target:t,args:d}),(t.addEventListener||t.on).apply(t,d),this};return{on:s,addEventListener:s,addListener:s,bind:s}};Id.nodeIsDraggable=function(t){return t&&t.isNode()&&!t.locked()&&t.grabbable()};Id.nodeIsGrabbable=function(t){return this.nodeIsDraggable(t)&&t.interactive()};Id.load=function(){var t=this,e=t.cy.window(),r=function(z){return z.selected()},n=function(z){var oe=z.getRootNode();if(oe&&oe.nodeType===11&&oe.host!==void 0)return oe},i=function(z,oe,se,ge){z==null&&(z=t.cy);for(var he=0;he<oe.length;he++){var be=oe[he];z.emit({originalEvent:se,type:be,position:ge})}},a=function(z){return z.shiftKey||z.metaKey||z.ctrlKey},s=function(z,oe){var se=!0;if(t.cy.hasCompoundNodes()&&z&&z.pannable())for(var ge=0;oe&&ge<oe.length;ge++){var z=oe[ge];if(z.isNode()&&z.isParent()&&!z.pannable()){se=!1;break}}else se=!0;return se},o=function(z){z[0]._private.grabbed=!0},l=function(z){z[0]._private.grabbed=!1},u=function(z){z[0]._private.rscratch.inDragLayer=!0},h=function(z){z[0]._private.rscratch.inDragLayer=!1},d=function(z){z[0]._private.rscratch.isGrabTarget=!0},f=function(z){z[0]._private.rscratch.isGrabTarget=!1},p=function(z,oe){var se=oe.addToList,ge=se.has(z);!ge&&z.grabbable()&&!z.locked()&&(se.merge(z),o(z))},g=function(z,oe){if(z.cy().hasCompoundNodes()&&!(oe.inDragLayer==null&&oe.addToList==null)){var se=z.descendants();oe.inDragLayer&&(se.forEach(u),se.connectedEdges().forEach(u)),oe.addToList&&p(se,oe)}},m=function(z,oe){oe=oe||{};var se=z.cy().hasCompoundNodes();oe.inDragLayer&&(z.forEach(u),z.neighborhood().stdFilter(function(ge){return!se||ge.isEdge()}).forEach(u)),oe.addToList&&z.forEach(function(ge){p(ge,oe)}),g(z,oe),b(z,{inDragLayer:oe.inDragLayer}),t.updateCachedGrabbedEles()},v=m,y=function(z){z&&(t.getCachedZSortedEles().forEach(function(oe){l(oe),h(oe),f(oe)}),t.updateCachedGrabbedEles())},b=function(z,oe){if(!(oe.inDragLayer==null&&oe.addToList==null)&&z.cy().hasCompoundNodes()){var se=z.ancestors().orphans();if(!se.same(z)){var ge=se.descendants().spawnSelf().merge(se).unmerge(z).unmerge(z.descendants()),he=ge.connectedEdges();oe.inDragLayer&&(he.forEach(u),ge.forEach(u)),oe.addToList&&ge.forEach(function(be){p(be,oe)})}}},w=function(){document.activeElement!=null&&document.activeElement.blur!=null&&document.activeElement.blur()},T=typeof MutationObserver<"u",E=typeof ResizeObserver<"u";T?(t.removeObserver=new MutationObserver(function(ce){for(var z=0;z<ce.length;z++){var oe=ce[z],se=oe.removedNodes;if(se)for(var ge=0;ge<se.length;ge++){var he=se[ge];if(he===t.container){t.destroy();break}}}}),t.container.parentNode&&t.removeObserver.observe(t.container.parentNode,{childList:!0})):t.registerBinding(t.container,"DOMNodeRemoved",function(ce){t.destroy()});var L=eg(function(){t.cy.resize()},100);T&&(t.styleObserver=new MutationObserver(L),t.styleObserver.observe(t.container,{attributes:!0})),t.registerBinding(e,"resize",L),E&&(t.resizeObserver=new ResizeObserver(L),t.resizeObserver.observe(t.container));var S=function(z,oe){for(;z!=null;)oe(z),z=z.parentNode},C=function(){t.invalidateContainerClientCoordsCache()};S(t.container,function(ce){t.registerBinding(ce,"transitionend",C),t.registerBinding(ce,"animationend",C),t.registerBinding(ce,"scroll",C)}),t.registerBinding(t.container,"contextmenu",function(ce){ce.preventDefault()});var A=function(){return t.selection[4]!==0},N=function(z){for(var oe=t.findContainerClientCoords(),se=oe[0],ge=oe[1],he=oe[2],be=oe[3],Ce=z.touches?z.touches:[z],Te=!1,Ne=0;Ne<Ce.length;Ne++){var Xe=Ce[Ne];if(se<=Xe.clientX&&Xe.clientX<=se+he&&ge<=Xe.clientY&&Xe.clientY<=ge+be){Te=!0;break}}if(!Te)return!1;for(var Ye=t.container,Ke=z.target,Ze=Ke.parentNode,Be=!1;Ze;){if(Ze===Ye){Be=!0;break}Ze=Ze.parentNode}return!!Be};t.registerBinding(t.container,"mousedown",function(z){if(N(z)&&!(t.hoverData.which===1&&z.which!==1)){z.preventDefault(),w(),t.hoverData.capture=!0,t.hoverData.which=z.which;var oe=t.cy,se=[z.clientX,z.clientY],ge=t.projectIntoViewport(se[0],se[1]),he=t.selection,be=t.findNearestElements(ge[0],ge[1],!0,!1),Ce=be[0],Te=t.dragData.possibleDragElements;t.hoverData.mdownPos=ge,t.hoverData.mdownGPos=se;var Ne=function(He){return{originalEvent:z,type:He,position:{x:ge[0],y:ge[1]}}},Xe=function(){t.hoverData.tapholdCancelled=!1,clearTimeout(t.hoverData.tapholdTimeout),t.hoverData.tapholdTimeout=setTimeout(function(){if(!t.hoverData.tapholdCancelled){var He=t.hoverData.down;He?He.emit(Ne("taphold")):oe.emit(Ne("taphold"))}},t.tapholdDuration)};if(z.which==3){t.hoverData.cxtStarted=!0;var Ye={originalEvent:z,type:"cxttapstart",position:{x:ge[0],y:ge[1]}};Ce?(Ce.activate(),Ce.emit(Ye),t.hoverData.down=Ce):oe.emit(Ye),t.hoverData.downTime=new Date().getTime(),t.hoverData.cxtDragged=!1}else if(z.which==1){Ce&&Ce.activate();{if(Ce!=null&&t.nodeIsGrabbable(Ce)){var Ke=function(He){He.emit(Ne("grab"))};if(d(Ce),!Ce.selected())Te=t.dragData.possibleDragElements=oe.collection(),v(Ce,{addToList:Te}),Ce.emit(Ne("grabon")).emit(Ne("grab"));else{Te=t.dragData.possibleDragElements=oe.collection();var Ze=oe.$(function(Be){return Be.isNode()&&Be.selected()&&t.nodeIsGrabbable(Be)});m(Ze,{addToList:Te}),Ce.emit(Ne("grabon")),Ze.forEach(Ke)}t.redrawHint("eles",!0),t.redrawHint("drag",!0)}t.hoverData.down=Ce,t.hoverData.downs=be,t.hoverData.downTime=new Date().getTime()}i(Ce,["mousedown","tapstart","vmousedown"],z,{x:ge[0],y:ge[1]}),Ce==null?(he[4]=1,t.data.bgActivePosistion={x:ge[0],y:ge[1]},t.redrawHint("select",!0),t.redraw()):Ce.pannable()&&(he[4]=1),Xe()}he[0]=he[2]=ge[0],he[1]=he[3]=ge[1]}},!1);var _=n(t.container);t.registerBinding([e,_],"mousemove",function(z){var oe=t.hoverData.capture;if(!(!oe&&!N(z))){var se=!1,ge=t.cy,he=ge.zoom(),be=[z.clientX,z.clientY],Ce=t.projectIntoViewport(be[0],be[1]),Te=t.hoverData.mdownPos,Ne=t.hoverData.mdownGPos,Xe=t.selection,Ye=null;!t.hoverData.draggingEles&&!t.hoverData.dragging&&!t.hoverData.selecting&&(Ye=t.findNearestElement(Ce[0],Ce[1],!0,!1));var Ke=t.hoverData.last,Ze=t.hoverData.down,Be=[Ce[0]-Xe[2],Ce[1]-Xe[3]],He=t.dragData.possibleDragElements,ht;if(Ne){var st=be[0]-Ne[0],We=st*st,kt=be[1]-Ne[1],qe=kt*kt,rt=We+qe;t.hoverData.isOverThresholdDrag=ht=rt>=t.desktopTapThreshold2}var ct=a(z);ht&&(t.hoverData.tapholdCancelled=!0);var ut=function(){var dt=t.hoverData.dragDelta=t.hoverData.dragDelta||[];dt.length===0?(dt.push(Be[0]),dt.push(Be[1])):(dt[0]+=Be[0],dt[1]+=Be[1])};se=!0,i(Ye,["mousemove","vmousemove","tapdrag"],z,{x:Ce[0],y:Ce[1]});var nt=function(dt){return{originalEvent:z,type:dt,position:{x:Ce[0],y:Ce[1]}}},bt=function(){t.data.bgActivePosistion=void 0,t.hoverData.selecting||ge.emit(nt("boxstart")),Xe[4]=1,t.hoverData.selecting=!0,t.redrawHint("select",!0),t.redraw()};if(t.hoverData.which===3){if(ht){var Zt=nt("cxtdrag");Ze?Ze.emit(Zt):ge.emit(Zt),t.hoverData.cxtDragged=!0,(!t.hoverData.cxtOver||Ye!==t.hoverData.cxtOver)&&(t.hoverData.cxtOver&&t.hoverData.cxtOver.emit(nt("cxtdragout")),t.hoverData.cxtOver=Ye,Ye&&Ye.emit(nt("cxtdragover")))}}else if(t.hoverData.dragging){if(se=!0,ge.panningEnabled()&&ge.userPanningEnabled()){var Ot;if(t.hoverData.justStartedPan){var tr=t.hoverData.mdownPos;Ot={x:(Ce[0]-tr[0])*he,y:(Ce[1]-tr[1])*he},t.hoverData.justStartedPan=!1}else Ot={x:Be[0]*he,y:Be[1]*he};ge.panBy(Ot),ge.emit(nt("dragpan")),t.hoverData.dragged=!0}Ce=t.projectIntoViewport(z.clientX,z.clientY)}else if(Xe[4]==1&&(Ze==null||Ze.pannable())){if(ht){if(!t.hoverData.dragging&&ge.boxSelectionEnabled()&&(ct||!ge.panningEnabled()||!ge.userPanningEnabled()))bt();else if(!t.hoverData.selecting&&ge.panningEnabled()&&ge.userPanningEnabled()){var xr=s(Ze,t.hoverData.downs);xr&&(t.hoverData.dragging=!0,t.hoverData.justStartedPan=!0,Xe[4]=0,t.data.bgActivePosistion=xh(Te),t.redrawHint("select",!0),t.redraw())}Ze&&Ze.pannable()&&Ze.active()&&Ze.unactivate()}}else{if(Ze&&Ze.pannable()&&Ze.active()&&Ze.unactivate(),(!Ze||!Ze.grabbed())&&Ye!=Ke&&(Ke&&i(Ke,["mouseout","tapdragout"],z,{x:Ce[0],y:Ce[1]}),Ye&&i(Ye,["mouseover","tapdragover"],z,{x:Ce[0],y:Ce[1]}),t.hoverData.last=Ye),Ze)if(ht){if(ge.boxSelectionEnabled()&&ct)Ze&&Ze.grabbed()&&(y(He),Ze.emit(nt("freeon")),He.emit(nt("free")),t.dragData.didDrag&&(Ze.emit(nt("dragfreeon")),He.emit(nt("dragfree")))),bt();else if(Ze&&Ze.grabbed()&&t.nodeIsDraggable(Ze)){var rr=!t.dragData.didDrag;rr&&t.redrawHint("eles",!0),t.dragData.didDrag=!0,t.hoverData.draggingEles||m(He,{inDragLayer:!0});var Wt={x:0,y:0};if(vt(Be[0])&&vt(Be[1])&&(Wt.x+=Be[0],Wt.y+=Be[1],rr)){var cr=t.hoverData.dragDelta;cr&&vt(cr[0])&&vt(cr[1])&&(Wt.x+=cr[0],Wt.y+=cr[1])}t.hoverData.draggingEles=!0,He.silentShift(Wt).emit(nt("position")).emit(nt("drag")),t.redrawHint("drag",!0),t.redraw()}}else ut();se=!0}if(Xe[2]=Ce[0],Xe[3]=Ce[1],se)return z.stopPropagation&&z.stopPropagation(),z.preventDefault&&z.preventDefault(),!1}},!1);var O,P,k;t.registerBinding(e,"mouseup",function(z){if(!(t.hoverData.which===1&&z.which!==1&&t.hoverData.capture)){var oe=t.hoverData.capture;if(oe){t.hoverData.capture=!1;var se=t.cy,ge=t.projectIntoViewport(z.clientX,z.clientY),he=t.selection,be=t.findNearestElement(ge[0],ge[1],!0,!1),Ce=t.dragData.possibleDragElements,Te=t.hoverData.down,Ne=a(z);t.data.bgActivePosistion&&(t.redrawHint("select",!0),t.redraw()),t.hoverData.tapholdCancelled=!0,t.data.bgActivePosistion=void 0,Te&&Te.unactivate();var Xe=function(st){return{originalEvent:z,type:st,position:{x:ge[0],y:ge[1]}}};if(t.hoverData.which===3){var Ye=Xe("cxttapend");if(Te?Te.emit(Ye):se.emit(Ye),!t.hoverData.cxtDragged){var Ke=Xe("cxttap");Te?Te.emit(Ke):se.emit(Ke)}t.hoverData.cxtDragged=!1,t.hoverData.which=null}else if(t.hoverData.which===1){if(i(be,["mouseup","tapend","vmouseup"],z,{x:ge[0],y:ge[1]}),!t.dragData.didDrag&&!t.hoverData.dragged&&!t.hoverData.selecting&&!t.hoverData.isOverThresholdDrag&&(i(Te,["click","tap","vclick"],z,{x:ge[0],y:ge[1]}),P=!1,z.timeStamp-k<=se.multiClickDebounceTime()?(O&&clearTimeout(O),P=!0,k=null,i(Te,["dblclick","dbltap","vdblclick"],z,{x:ge[0],y:ge[1]})):(O=setTimeout(function(){P||i(Te,["oneclick","onetap","voneclick"],z,{x:ge[0],y:ge[1]})},se.multiClickDebounceTime()),k=z.timeStamp)),Te==null&&!t.dragData.didDrag&&!t.hoverData.selecting&&!t.hoverData.dragged&&!a(z)&&(se.$(r).unselect(["tapunselect"]),Ce.length>0&&t.redrawHint("eles",!0),t.dragData.possibleDragElements=Ce=se.collection()),be==Te&&!t.dragData.didDrag&&!t.hoverData.selecting&&be!=null&&be._private.selectable&&(t.hoverData.dragging||(se.selectionType()==="additive"||Ne?be.selected()?be.unselect(["tapunselect"]):be.select(["tapselect"]):Ne||(se.$(r).unmerge(be).unselect(["tapunselect"]),be.select(["tapselect"]))),t.redrawHint("eles",!0)),t.hoverData.selecting){var Ze=se.collection(t.getAllInBox(he[0],he[1],he[2],he[3]));t.redrawHint("select",!0),Ze.length>0&&t.redrawHint("eles",!0),se.emit(Xe("boxend"));var Be=function(st){return st.selectable()&&!st.selected()};se.selectionType()==="additive"||Ne||se.$(r).unmerge(Ze).unselect(),Ze.emit(Xe("box")).stdFilter(Be).select().emit(Xe("boxselect")),t.redraw()}if(t.hoverData.dragging&&(t.hoverData.dragging=!1,t.redrawHint("select",!0),t.redrawHint("eles",!0),t.redraw()),!he[4]){t.redrawHint("drag",!0),t.redrawHint("eles",!0);var He=Te&&Te.grabbed();y(Ce),He&&(Te.emit(Xe("freeon")),Ce.emit(Xe("free")),t.dragData.didDrag&&(Te.emit(Xe("dragfreeon")),Ce.emit(Xe("dragfree"))))}}he[4]=0,t.hoverData.down=null,t.hoverData.cxtStarted=!1,t.hoverData.draggingEles=!1,t.hoverData.selecting=!1,t.hoverData.isOverThresholdDrag=!1,t.dragData.didDrag=!1,t.hoverData.dragged=!1,t.hoverData.dragDelta=[],t.hoverData.mdownPos=null,t.hoverData.mdownGPos=null,t.hoverData.which=null}}},!1);var R=[],I=4,M,D=1e5,B=function(z,oe){for(var se=0;se<z.length;se++)if(z[se]%oe!==0)return!1;return!0},$=function(z){for(var oe=Math.abs(z[0]),se=1;se<z.length;se++)if(Math.abs(z[se])!==oe)return!1;return!0},F=function(z){var oe=!1,se=z.deltaY;if(se==null&&(z.wheelDeltaY!=null?se=z.wheelDeltaY/4:z.wheelDelta!=null&&(se=z.wheelDelta/4)),se!==0){if(M==null)if(R.length>=I){var ge=R;if(M=B(ge,5),!M){var he=Math.abs(ge[0]);M=$(ge)&&he>5}if(M)for(var be=0;be<ge.length;be++)D=Math.min(Math.abs(ge[be]),D)}else R.push(se),oe=!0;else M&&(D=Math.min(Math.abs(se),D));if(!t.scrollingPage){var Ce=t.cy,Te=Ce.zoom(),Ne=Ce.pan(),Xe=t.projectIntoViewport(z.clientX,z.clientY),Ye=[Xe[0]*Te+Ne.x,Xe[1]*Te+Ne.y];if(t.hoverData.draggingEles||t.hoverData.dragging||t.hoverData.cxtStarted||A()){z.preventDefault();return}if(Ce.panningEnabled()&&Ce.userPanningEnabled()&&Ce.zoomingEnabled()&&Ce.userZoomingEnabled()){z.preventDefault(),t.data.wheelZooming=!0,clearTimeout(t.data.wheelTimeout),t.data.wheelTimeout=setTimeout(function(){t.data.wheelZooming=!1,t.redrawHint("eles",!0),t.redraw()},150);var Ke;oe&&Math.abs(se)>5&&(se=XE(se)*5),Ke=se/-250,M&&(Ke/=D,Ke*=3),Ke=Ke*t.wheelSensitivity;var Ze=z.deltaMode===1;Ze&&(Ke*=33);var Be=Ce.zoom()*Math.pow(10,Ke);z.type==="gesturechange"&&(Be=t.gestureStartZoom*z.scale),Ce.zoom({level:Be,renderedPosition:{x:Ye[0],y:Ye[1]}}),Ce.emit({type:z.type==="gesturechange"?"pinchzoom":"scrollzoom",originalEvent:z,position:{x:Xe[0],y:Xe[1]}})}}}};t.registerBinding(t.container,"wheel",F,!0),t.registerBinding(e,"scroll",function(z){t.scrollingPage=!0,clearTimeout(t.scrollingPageTimeout),t.scrollingPageTimeout=setTimeout(function(){t.scrollingPage=!1},250)},!0),t.registerBinding(t.container,"gesturestart",function(z){t.gestureStartZoom=t.cy.zoom(),t.hasTouchStarted||z.preventDefault()},!0),t.registerBinding(t.container,"gesturechange",function(ce){t.hasTouchStarted||F(ce)},!0),t.registerBinding(t.container,"mouseout",function(z){var oe=t.projectIntoViewport(z.clientX,z.clientY);t.cy.emit({originalEvent:z,type:"mouseout",position:{x:oe[0],y:oe[1]}})},!1),t.registerBinding(t.container,"mouseover",function(z){var oe=t.projectIntoViewport(z.clientX,z.clientY);t.cy.emit({originalEvent:z,type:"mouseover",position:{x:oe[0],y:oe[1]}})},!1);var G,W,J,q,ne,ae,pe,K,Z,X,Y,ee,j,fe=function(z,oe,se,ge){return Math.sqrt((se-z)*(se-z)+(ge-oe)*(ge-oe))},te=function(z,oe,se,ge){return(se-z)*(se-z)+(ge-oe)*(ge-oe)},Ae;t.registerBinding(t.container,"touchstart",Ae=function(z){if(t.hasTouchStarted=!0,!!N(z)){w(),t.touchData.capture=!0,t.data.bgActivePosistion=void 0;var oe=t.cy,se=t.touchData.now,ge=t.touchData.earlier;if(z.touches[0]){var he=t.projectIntoViewport(z.touches[0].clientX,z.touches[0].clientY);se[0]=he[0],se[1]=he[1]}if(z.touches[1]){var he=t.projectIntoViewport(z.touches[1].clientX,z.touches[1].clientY);se[2]=he[0],se[3]=he[1]}if(z.touches[2]){var he=t.projectIntoViewport(z.touches[2].clientX,z.touches[2].clientY);se[4]=he[0],se[5]=he[1]}var be=function(ct){return{originalEvent:z,type:ct,position:{x:se[0],y:se[1]}}};if(z.touches[1]){t.touchData.singleTouchMoved=!0,y(t.dragData.touchDragEles);var Ce=t.findContainerClientCoords();Z=Ce[0],X=Ce[1],Y=Ce[2],ee=Ce[3],G=z.touches[0].clientX-Z,W=z.touches[0].clientY-X,J=z.touches[1].clientX-Z,q=z.touches[1].clientY-X,j=0<=G&&G<=Y&&0<=J&&J<=Y&&0<=W&&W<=ee&&0<=q&&q<=ee;var Te=oe.pan(),Ne=oe.zoom();ne=fe(G,W,J,q),ae=te(G,W,J,q),pe=[(G+J)/2,(W+q)/2],K=[(pe[0]-Te.x)/Ne,(pe[1]-Te.y)/Ne];var Xe=200,Ye=Xe*Xe;if(ae<Ye&&!z.touches[2]){var Ke=t.findNearestElement(se[0],se[1],!0,!0),Ze=t.findNearestElement(se[2],se[3],!0,!0);Ke&&Ke.isNode()?(Ke.activate().emit(be("cxttapstart")),t.touchData.start=Ke):Ze&&Ze.isNode()?(Ze.activate().emit(be("cxttapstart")),t.touchData.start=Ze):oe.emit(be("cxttapstart")),t.touchData.start&&(t.touchData.start._private.grabbed=!1),t.touchData.cxt=!0,t.touchData.cxtDragged=!1,t.data.bgActivePosistion=void 0,t.redraw();return}}if(z.touches[2])oe.boxSelectionEnabled()&&z.preventDefault();else if(!z.touches[1]){if(z.touches[0]){var Be=t.findNearestElements(se[0],se[1],!0,!0),He=Be[0];if(He!=null&&(He.activate(),t.touchData.start=He,t.touchData.starts=Be,t.nodeIsGrabbable(He))){var ht=t.dragData.touchDragEles=oe.collection(),st=null;t.redrawHint("eles",!0),t.redrawHint("drag",!0),He.selected()?(st=oe.$(function(rt){return rt.selected()&&t.nodeIsGrabbable(rt)}),m(st,{addToList:ht})):v(He,{addToList:ht}),d(He),He.emit(be("grabon")),st?st.forEach(function(rt){rt.emit(be("grab"))}):He.emit(be("grab"))}i(He,["touchstart","tapstart","vmousedown"],z,{x:se[0],y:se[1]}),He==null&&(t.data.bgActivePosistion={x:he[0],y:he[1]},t.redrawHint("select",!0),t.redraw()),t.touchData.singleTouchMoved=!1,t.touchData.singleTouchStartTime=+new Date,clearTimeout(t.touchData.tapholdTimeout),t.touchData.tapholdTimeout=setTimeout(function(){t.touchData.singleTouchMoved===!1&&!t.pinching&&!t.touchData.selecting&&i(t.touchData.start,["taphold"],z,{x:se[0],y:se[1]})},t.tapholdDuration)}}if(z.touches.length>=1){for(var We=t.touchData.startPosition=[null,null,null,null,null,null],kt=0;kt<se.length;kt++)We[kt]=ge[kt]=se[kt];var qe=z.touches[0];t.touchData.startGPosition=[qe.clientX,qe.clientY]}}},!1);var H;t.registerBinding(e,"touchmove",H=function(z){var oe=t.touchData.capture;if(!(!oe&&!N(z))){var se=t.selection,ge=t.cy,he=t.touchData.now,be=t.touchData.earlier,Ce=ge.zoom();if(z.touches[0]){var Te=t.projectIntoViewport(z.touches[0].clientX,z.touches[0].clientY);he[0]=Te[0],he[1]=Te[1]}if(z.touches[1]){var Te=t.projectIntoViewport(z.touches[1].clientX,z.touches[1].clientY);he[2]=Te[0],he[3]=Te[1]}if(z.touches[2]){var Te=t.projectIntoViewport(z.touches[2].clientX,z.touches[2].clientY);he[4]=Te[0],he[5]=Te[1]}var Ne=function(bg){return{originalEvent:z,type:bg,position:{x:he[0],y:he[1]}}},Xe=t.touchData.startGPosition,Ye;if(oe&&z.touches[0]&&Xe){for(var Ke=[],Ze=0;Ze<he.length;Ze++)Ke[Ze]=he[Ze]-be[Ze];var Be=z.touches[0].clientX-Xe[0],He=Be*Be,ht=z.touches[0].clientY-Xe[1],st=ht*ht,We=He+st;Ye=We>=t.touchTapThreshold2}if(oe&&t.touchData.cxt){z.preventDefault();var kt=z.touches[0].clientX-Z,qe=z.touches[0].clientY-X,rt=z.touches[1].clientX-Z,ct=z.touches[1].clientY-X,ut=te(kt,qe,rt,ct),nt=ut/ae,bt=150,Zt=bt*bt,Ot=1.5,tr=Ot*Ot;if(nt>=tr||ut>=Zt){t.touchData.cxt=!1,t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var xr=Ne("cxttapend");t.touchData.start?(t.touchData.start.unactivate().emit(xr),t.touchData.start=null):ge.emit(xr)}}if(oe&&t.touchData.cxt){var xr=Ne("cxtdrag");t.data.bgActivePosistion=void 0,t.redrawHint("select",!0),t.touchData.start?t.touchData.start.emit(xr):ge.emit(xr),t.touchData.start&&(t.touchData.start._private.grabbed=!1),t.touchData.cxtDragged=!0;var rr=t.findNearestElement(he[0],he[1],!0,!0);(!t.touchData.cxtOver||rr!==t.touchData.cxtOver)&&(t.touchData.cxtOver&&t.touchData.cxtOver.emit(Ne("cxtdragout")),t.touchData.cxtOver=rr,rr&&rr.emit(Ne("cxtdragover")))}else if(oe&&z.touches[2]&&ge.boxSelectionEnabled())z.preventDefault(),t.data.bgActivePosistion=void 0,this.lastThreeTouch=+new Date,t.touchData.selecting||ge.emit(Ne("boxstart")),t.touchData.selecting=!0,t.touchData.didSelect=!0,se[4]=1,!se||se.length===0||se[0]===void 0?(se[0]=(he[0]+he[2]+he[4])/3,se[1]=(he[1]+he[3]+he[5])/3,se[2]=(he[0]+he[2]+he[4])/3+1,se[3]=(he[1]+he[3]+he[5])/3+1):(se[2]=(he[0]+he[2]+he[4])/3,se[3]=(he[1]+he[3]+he[5])/3),t.redrawHint("select",!0),t.redraw();else if(oe&&z.touches[1]&&!t.touchData.didSelect&&ge.zoomingEnabled()&&ge.panningEnabled()&&ge.userZoomingEnabled()&&ge.userPanningEnabled()){z.preventDefault(),t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var Wt=t.dragData.touchDragEles;if(Wt){t.redrawHint("drag",!0);for(var cr=0;cr<Wt.length;cr++){var an=Wt[cr]._private;an.grabbed=!1,an.rscratch.inDragLayer=!1}}var dt=t.touchData.start,kt=z.touches[0].clientX-Z,qe=z.touches[0].clientY-X,rt=z.touches[1].clientX-Z,ct=z.touches[1].clientY-X,Ee=fe(kt,qe,rt,ct),Je=Ee/ne;if(j){var wt=kt-G,or=qe-W,Ur=rt-J,ur=ct-q,Yr=(wt+Ur)/2,fi=(or+ur)/2,xn=ge.zoom(),bn=xn*Je,pt=ge.pan(),Tt=K[0]*xn+pt.x,lt=K[1]*xn+pt.y,je={x:-bn/xn*(Tt-pt.x-Yr)+Tt,y:-bn/xn*(lt-pt.y-fi)+lt};if(dt&&dt.active()){var Wt=t.dragData.touchDragEles;y(Wt),t.redrawHint("drag",!0),t.redrawHint("eles",!0),dt.unactivate().emit(Ne("freeon")),Wt.emit(Ne("free")),t.dragData.didDrag&&(dt.emit(Ne("dragfreeon")),Wt.emit(Ne("dragfree")))}ge.viewport({zoom:bn,pan:je,cancelOnFailedZoom:!0}),ge.emit(Ne("pinchzoom")),ne=Ee,G=kt,W=qe,J=rt,q=ct,t.pinching=!0}if(z.touches[0]){var Te=t.projectIntoViewport(z.touches[0].clientX,z.touches[0].clientY);he[0]=Te[0],he[1]=Te[1]}if(z.touches[1]){var Te=t.projectIntoViewport(z.touches[1].clientX,z.touches[1].clientY);he[2]=Te[0],he[3]=Te[1]}if(z.touches[2]){var Te=t.projectIntoViewport(z.touches[2].clientX,z.touches[2].clientY);he[4]=Te[0],he[5]=Te[1]}}else if(z.touches[0]&&!t.touchData.didSelect){var jt=t.touchData.start,de=t.touchData.last,rr;if(!t.hoverData.draggingEles&&!t.swipePanning&&(rr=t.findNearestElement(he[0],he[1],!0,!0)),oe&&jt!=null&&z.preventDefault(),oe&&jt!=null&&t.nodeIsDraggable(jt))if(Ye){var Wt=t.dragData.touchDragEles,ll=!t.dragData.didDrag;ll&&m(Wt,{inDragLayer:!0}),t.dragData.didDrag=!0;var ve={x:0,y:0};if(vt(Ke[0])&&vt(Ke[1])&&(ve.x+=Ke[0],ve.y+=Ke[1],ll)){t.redrawHint("eles",!0);var br=t.touchData.dragDelta;br&&vt(br[0])&&vt(br[1])&&(ve.x+=br[0],ve.y+=br[1])}t.hoverData.draggingEles=!0,Wt.silentShift(ve).emit(Ne("position")).emit(Ne("drag")),t.redrawHint("drag",!0),t.touchData.startPosition[0]==be[0]&&t.touchData.startPosition[1]==be[1]&&t.redrawHint("eles",!0),t.redraw()}else{var br=t.touchData.dragDelta=t.touchData.dragDelta||[];br.length===0?(br.push(Ke[0]),br.push(Ke[1])):(br[0]+=Ke[0],br[1]+=Ke[1])}if(i(jt||rr,["touchmove","tapdrag","vmousemove"],z,{x:he[0],y:he[1]}),(!jt||!jt.grabbed())&&rr!=de&&(de&&de.emit(Ne("tapdragout")),rr&&rr.emit(Ne("tapdragover"))),t.touchData.last=rr,oe)for(var cr=0;cr<he.length;cr++)he[cr]&&t.touchData.startPosition[cr]&&Ye&&(t.touchData.singleTouchMoved=!0);if(oe&&(jt==null||jt.pannable())&&ge.panningEnabled()&&ge.userPanningEnabled()){var xg=s(jt,t.touchData.starts);xg&&(z.preventDefault(),t.data.bgActivePosistion||(t.data.bgActivePosistion=xh(t.touchData.startPosition)),t.swipePanning?(ge.panBy({x:Ke[0]*Ce,y:Ke[1]*Ce}),ge.emit(Ne("dragpan"))):Ye&&(t.swipePanning=!0,ge.panBy({x:Be*Ce,y:ht*Ce}),ge.emit(Ne("dragpan")),jt&&(jt.unactivate(),t.redrawHint("select",!0),t.touchData.start=null)));var Te=t.projectIntoViewport(z.touches[0].clientX,z.touches[0].clientY);he[0]=Te[0],he[1]=Te[1]}}for(var Ze=0;Ze<he.length;Ze++)be[Ze]=he[Ze];oe&&z.touches.length>0&&!t.hoverData.draggingEles&&!t.swipePanning&&t.data.bgActivePosistion!=null&&(t.data.bgActivePosistion=void 0,t.redrawHint("select",!0),t.redraw())}},!1);var Oe;t.registerBinding(e,"touchcancel",Oe=function(z){var oe=t.touchData.start;t.touchData.capture=!1,oe&&oe.unactivate()});var ue,Ve,Ge,Ue;if(t.registerBinding(e,"touchend",ue=function(z){var oe=t.touchData.start,se=t.touchData.capture;if(se)z.touches.length===0&&(t.touchData.capture=!1),z.preventDefault();else return;var ge=t.selection;t.swipePanning=!1,t.hoverData.draggingEles=!1;var he=t.cy,be=he.zoom(),Ce=t.touchData.now,Te=t.touchData.earlier;if(z.touches[0]){var Ne=t.projectIntoViewport(z.touches[0].clientX,z.touches[0].clientY);Ce[0]=Ne[0],Ce[1]=Ne[1]}if(z.touches[1]){var Ne=t.projectIntoViewport(z.touches[1].clientX,z.touches[1].clientY);Ce[2]=Ne[0],Ce[3]=Ne[1]}if(z.touches[2]){var Ne=t.projectIntoViewport(z.touches[2].clientX,z.touches[2].clientY);Ce[4]=Ne[0],Ce[5]=Ne[1]}var Xe=function(Zt){return{originalEvent:z,type:Zt,position:{x:Ce[0],y:Ce[1]}}};oe&&oe.unactivate();var Ye;if(t.touchData.cxt){if(Ye=Xe("cxttapend"),oe?oe.emit(Ye):he.emit(Ye),!t.touchData.cxtDragged){var Ke=Xe("cxttap");oe?oe.emit(Ke):he.emit(Ke)}t.touchData.start&&(t.touchData.start._private.grabbed=!1),t.touchData.cxt=!1,t.touchData.start=null,t.redraw();return}if(!z.touches[2]&&he.boxSelectionEnabled()&&t.touchData.selecting){t.touchData.selecting=!1;var Ze=he.collection(t.getAllInBox(ge[0],ge[1],ge[2],ge[3]));ge[0]=void 0,ge[1]=void 0,ge[2]=void 0,ge[3]=void 0,ge[4]=0,t.redrawHint("select",!0),he.emit(Xe("boxend"));var Be=function(Zt){return Zt.selectable()&&!Zt.selected()};Ze.emit(Xe("box")).stdFilter(Be).select().emit(Xe("boxselect")),Ze.nonempty()&&t.redrawHint("eles",!0),t.redraw()}if(oe?.unactivate(),z.touches[2])t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);else if(!z.touches[1]){if(!z.touches[0]){if(!z.touches[0]){t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var He=t.dragData.touchDragEles;if(oe!=null){var ht=oe._private.grabbed;y(He),t.redrawHint("drag",!0),t.redrawHint("eles",!0),ht&&(oe.emit(Xe("freeon")),He.emit(Xe("free")),t.dragData.didDrag&&(oe.emit(Xe("dragfreeon")),He.emit(Xe("dragfree")))),i(oe,["touchend","tapend","vmouseup","tapdragout"],z,{x:Ce[0],y:Ce[1]}),oe.unactivate(),t.touchData.start=null}else{var st=t.findNearestElement(Ce[0],Ce[1],!0,!0);i(st,["touchend","tapend","vmouseup","tapdragout"],z,{x:Ce[0],y:Ce[1]})}var We=t.touchData.startPosition[0]-Ce[0],kt=We*We,qe=t.touchData.startPosition[1]-Ce[1],rt=qe*qe,ct=kt+rt,ut=ct*be*be;t.touchData.singleTouchMoved||(oe||he.$(":selected").unselect(["tapunselect"]),i(oe,["tap","vclick"],z,{x:Ce[0],y:Ce[1]}),Ve=!1,z.timeStamp-Ue<=he.multiClickDebounceTime()?(Ge&&clearTimeout(Ge),Ve=!0,Ue=null,i(oe,["dbltap","vdblclick"],z,{x:Ce[0],y:Ce[1]})):(Ge=setTimeout(function(){Ve||i(oe,["onetap","voneclick"],z,{x:Ce[0],y:Ce[1]})},he.multiClickDebounceTime()),Ue=z.timeStamp)),oe!=null&&!t.dragData.didDrag&&oe._private.selectable&&ut<t.touchTapThreshold2&&!t.pinching&&(he.selectionType()==="single"?(he.$(r).unmerge(oe).unselect(["tapunselect"]),oe.select(["tapselect"])):oe.selected()?oe.unselect(["tapunselect"]):oe.select(["tapselect"]),t.redrawHint("eles",!0)),t.touchData.singleTouchMoved=!0}}}for(var nt=0;nt<Ce.length;nt++)Te[nt]=Ce[nt];t.dragData.didDrag=!1,z.touches.length===0&&(t.touchData.dragDelta=[],t.touchData.startPosition=[null,null,null,null,null,null],t.touchData.startGPosition=null,t.touchData.didSelect=!1),z.touches.length<2&&(z.touches.length===1&&(t.touchData.startGPosition=[z.touches[0].clientX,z.touches[0].clientY]),t.pinching=!1,t.redrawHint("eles",!0),t.redraw())},!1),typeof TouchEvent>"u"){var ke=[],Pe=function(z){return{clientX:z.clientX,clientY:z.clientY,force:1,identifier:z.pointerId,pageX:z.pageX,pageY:z.pageY,radiusX:z.width/2,radiusY:z.height/2,screenX:z.screenX,screenY:z.screenY,target:z.target}},Se=function(z){return{event:z,touch:Pe(z)}},_e=function(z){ke.push(Se(z))},ze=function(z){for(var oe=0;oe<ke.length;oe++){var se=ke[oe];if(se.event.pointerId===z.pointerId){ke.splice(oe,1);return}}},me=function(z){var oe=ke.filter(function(se){return se.event.pointerId===z.pointerId})[0];oe.event=z,oe.touch=Pe(z)},De=function(z){z.touches=ke.map(function(oe){return oe.touch})},Q=function(z){return z.pointerType==="mouse"||z.pointerType===4};t.registerBinding(t.container,"pointerdown",function(ce){Q(ce)||(ce.preventDefault(),_e(ce),De(ce),Ae(ce))}),t.registerBinding(t.container,"pointerup",function(ce){Q(ce)||(ze(ce),De(ce),ue(ce))}),t.registerBinding(t.container,"pointercancel",function(ce){Q(ce)||(ze(ce),De(ce),Oe(ce))}),t.registerBinding(t.container,"pointermove",function(ce){Q(ce)||(ce.preventDefault(),me(ce),De(ce),H(ce))})}};var al={};al.generatePolygon=function(t,e){return this.nodeShapes[t]={renderer:this,name:t,points:e,draw:function(n,i,a,s,o,l){this.renderer.nodeShapeImpl("polygon",n,i,a,s,o,this.points)},intersectLine:function(n,i,a,s,o,l,u,h){return op(o,l,this.points,n,i,a/2,s/2,u)},checkPoint:function(n,i,a,s,o,l,u,h){return Qo(n,i,this.points,l,u,s,o,[0,-1],a)},hasMiterBounds:t!=="rectangle",miterBounds:function(n,i,a,s,o,l){return qme(this.points,n,i,a,s,o)}}};al.generateEllipse=function(){return this.nodeShapes.ellipse={renderer:this,name:"ellipse",draw:function(e,r,n,i,a,s){this.renderer.nodeShapeImpl(this.name,e,r,n,i,a)},intersectLine:function(e,r,n,i,a,s,o,l){return eve(a,s,e,r,n/2+o,i/2+o)},checkPoint:function(e,r,n,i,a,s,o,l){return Yc(e,r,i,a,s,o,n)}}};al.generateRoundPolygon=function(t,e){return this.nodeShapes[t]={renderer:this,name:t,points:e,getOrCreateCorners:function(n,i,a,s,o,l,u){if(l[u]!==void 0&&l[u+"-cx"]===n&&l[u+"-cy"]===i)return l[u];l[u]=new Array(e.length/2),l[u+"-cx"]=n,l[u+"-cy"]=i;var h=a/2,d=s/2;o=o==="auto"?Az(a,s):o;for(var f=new Array(e.length/2),p=0;p<e.length/2;p++)f[p]={x:n+h*e[p*2],y:i+d*e[p*2+1]};var g,m,v,y,b=f.length;for(m=f[b-1],g=0;g<b;g++)v=f[g%b],y=f[(g+1)%b],l[u][g]=ok(m,v,y,o),m=v,v=y;return l[u]},draw:function(n,i,a,s,o,l,u){this.renderer.nodeShapeImpl("round-polygon",n,i,a,s,o,this.points,this.getOrCreateCorners(i,a,s,o,l,u,"drawCorners"))},intersectLine:function(n,i,a,s,o,l,u,h,d){return rve(o,l,this.points,n,i,a,s,u,this.getOrCreateCorners(n,i,a,s,h,d,"corners"))},checkPoint:function(n,i,a,s,o,l,u,h,d){return Jme(n,i,this.points,l,u,s,o,this.getOrCreateCorners(l,u,s,o,h,d,"corners"))}}};al.generateRoundRectangle=function(){return this.nodeShapes["round-rectangle"]=this.nodeShapes.roundrectangle={renderer:this,name:"round-rectangle",points:Oi(4,0),draw:function(e,r,n,i,a,s){this.renderer.nodeShapeImpl(this.name,e,r,n,i,a,this.points,s)},intersectLine:function(e,r,n,i,a,s,o,l){return Sz(a,s,e,r,n,i,o,l)},checkPoint:function(e,r,n,i,a,s,o,l){var u=i/2,h=a/2;l=l==="auto"?Ul(i,a):l,l=Math.min(u,h,l);var d=l*2;return!!(Qo(e,r,this.points,s,o,i,a-d,[0,-1],n)||Qo(e,r,this.points,s,o,i-d,a,[0,-1],n)||Yc(e,r,d,d,s-u+l,o-h+l,n)||Yc(e,r,d,d,s+u-l,o-h+l,n)||Yc(e,r,d,d,s+u-l,o+h-l,n)||Yc(e,r,d,d,s-u+l,o+h-l,n))}}};al.generateCutRectangle=function(){return this.nodeShapes["cut-rectangle"]=this.nodeShapes.cutrectangle={renderer:this,name:"cut-rectangle",cornerLength:KE(),points:Oi(4,0),draw:function(e,r,n,i,a,s){this.renderer.nodeShapeImpl(this.name,e,r,n,i,a,null,s)},generateCutTrianglePts:function(e,r,n,i,a){var s=a==="auto"?this.cornerLength:a,o=r/2,l=e/2,u=n-l,h=n+l,d=i-o,f=i+o;return{topLeft:[u,d+s,u+s,d,u+s,d+s],topRight:[h-s,d,h,d+s,h-s,d+s],bottomRight:[h,f-s,h-s,f,h-s,f-s],bottomLeft:[u+s,f,u,f-s,u+s,f-s]}},intersectLine:function(e,r,n,i,a,s,o,l){var u=this.generateCutTrianglePts(n+2*o,i+2*o,e,r,l),h=[].concat.apply([],[u.topLeft.splice(0,4),u.topRight.splice(0,4),u.bottomRight.splice(0,4),u.bottomLeft.splice(0,4)]);return op(a,s,h,e,r)},checkPoint:function(e,r,n,i,a,s,o,l){var u=l==="auto"?this.cornerLength:l;if(Qo(e,r,this.points,s,o,i,a-2*u,[0,-1],n)||Qo(e,r,this.points,s,o,i-2*u,a,[0,-1],n))return!0;var h=this.generateCutTrianglePts(i,a,s,o);return aa(e,r,h.topLeft)||aa(e,r,h.topRight)||aa(e,r,h.bottomRight)||aa(e,r,h.bottomLeft)}}};al.generateBarrel=function(){return this.nodeShapes.barrel={renderer:this,name:"barrel",points:Oi(4,0),draw:function(e,r,n,i,a,s){this.renderer.nodeShapeImpl(this.name,e,r,n,i,a)},intersectLine:function(e,r,n,i,a,s,o,l){var u=.15,h=.5,d=.85,f=this.generateBarrelBezierPts(n+2*o,i+2*o,e,r),p=function(v){var y=Dh({x:v[0],y:v[1]},{x:v[2],y:v[3]},{x:v[4],y:v[5]},u),b=Dh({x:v[0],y:v[1]},{x:v[2],y:v[3]},{x:v[4],y:v[5]},h),w=Dh({x:v[0],y:v[1]},{x:v[2],y:v[3]},{x:v[4],y:v[5]},d);return[v[0],v[1],y.x,y.y,b.x,b.y,w.x,w.y,v[4],v[5]]},g=[].concat(p(f.topLeft),p(f.topRight),p(f.bottomRight),p(f.bottomLeft));return op(a,s,g,e,r)},generateBarrelBezierPts:function(e,r,n,i){var a=r/2,s=e/2,o=n-s,l=n+s,u=i-a,h=i+a,d=aw(e,r),f=d.heightOffset,p=d.widthOffset,g=d.ctrlPtOffsetPct*e,m={topLeft:[o,u+f,o+g,u,o+p,u],topRight:[l-p,u,l-g,u,l,u+f],bottomRight:[l,h-f,l-g,h,l-p,h],bottomLeft:[o+p,h,o+g,h,o,h-f]};return m.topLeft.isTop=!0,m.topRight.isTop=!0,m.bottomLeft.isBottom=!0,m.bottomRight.isBottom=!0,m},checkPoint:function(e,r,n,i,a,s,o,l){var u=aw(i,a),h=u.heightOffset,d=u.widthOffset;if(Qo(e,r,this.points,s,o,i,a-2*h,[0,-1],n)||Qo(e,r,this.points,s,o,i-2*d,a,[0,-1],n))return!0;for(var f=this.generateBarrelBezierPts(i,a,s,o),p=function(C,A,N){var _=N[4],O=N[2],P=N[0],k=N[5],R=N[1],I=Math.min(_,P),M=Math.max(_,P),D=Math.min(k,R),B=Math.max(k,R);if(I<=C&&C<=M&&D<=A&&A<=B){var $=nve(_,O,P),F=jme($[0],$[1],$[2],C),G=F.filter(function(W){return 0<=W&&W<=1});if(G.length>0)return G[0]}return null},g=Object.keys(f),m=0;m<g.length;m++){var v=g[m],y=f[v],b=p(e,r,y);if(b!=null){var w=y[5],T=y[3],E=y[1],L=qn(w,T,E,b);if(y.isTop&&L<=r||y.isBottom&&r<=L)return!0}}return!1}}};al.generateBottomRoundrectangle=function(){return this.nodeShapes["bottom-round-rectangle"]=this.nodeShapes.bottomroundrectangle={renderer:this,name:"bottom-round-rectangle",points:Oi(4,0),draw:function(e,r,n,i,a,s){this.renderer.nodeShapeImpl(this.name,e,r,n,i,a,this.points,s)},intersectLine:function(e,r,n,i,a,s,o,l){var u=e-(n/2+o),h=r-(i/2+o),d=h,f=e+(n/2+o),p=kl(a,s,e,r,u,h,f,d,!1);return p.length>0?p:Sz(a,s,e,r,n,i,o,l)},checkPoint:function(e,r,n,i,a,s,o,l){l=l==="auto"?Ul(i,a):l;var u=2*l;if(Qo(e,r,this.points,s,o,i,a-u,[0,-1],n)||Qo(e,r,this.points,s,o,i-u,a,[0,-1],n))return!0;var h=i/2+2*n,d=a/2+2*n,f=[s-h,o-d,s-h,o,s+h,o,s+h,o-d];return!!(aa(e,r,f)||Yc(e,r,u,u,s+i/2-l,o+a/2-l,n)||Yc(e,r,u,u,s-i/2+l,o+a/2-l,n))}}};al.registerNodeShapes=function(){var t=this.nodeShapes={},e=this;this.generateEllipse(),this.generatePolygon("triangle",Oi(3,0)),this.generateRoundPolygon("round-triangle",Oi(3,0)),this.generatePolygon("rectangle",Oi(4,0)),t.square=t.rectangle,this.generateRoundRectangle(),this.generateCutRectangle(),this.generateBarrel(),this.generateBottomRoundrectangle();{var r=[0,1,1,0,0,-1,-1,0];this.generatePolygon("diamond",r),this.generateRoundPolygon("round-diamond",r)}this.generatePolygon("pentagon",Oi(5,0)),this.generateRoundPolygon("round-pentagon",Oi(5,0)),this.generatePolygon("hexagon",Oi(6,0)),this.generateRoundPolygon("round-hexagon",Oi(6,0)),this.generatePolygon("heptagon",Oi(7,0)),this.generateRoundPolygon("round-heptagon",Oi(7,0)),this.generatePolygon("octagon",Oi(8,0)),this.generateRoundPolygon("round-octagon",Oi(8,0));var n=new Array(20);{var i=iw(5,0),a=iw(5,Math.PI/5),s=.5*(3-Math.sqrt(5));s*=1.57;for(var o=0;o<a.length/2;o++)a[o*2]*=s,a[o*2+1]*=s;for(var o=0;o<20/4;o++)n[o*4]=i[o*2],n[o*4+1]=i[o*2+1],n[o*4+2]=a[o*2],n[o*4+3]=a[o*2+1]}n=Cz(n),this.generatePolygon("star",n),this.generatePolygon("vee",[-1,-1,0,-.333,1,-1,0,1]),this.generatePolygon("rhomboid",[-1,-1,.333,-1,1,1,-.333,1]),this.generatePolygon("right-rhomboid",[-.333,-1,1,-1,.333,1,-1,1]),this.nodeShapes.concavehexagon=this.generatePolygon("concave-hexagon",[-1,-.95,-.75,0,-1,.95,1,.95,.75,0,1,-.95]);{var l=[-1,-1,.25,-1,1,0,.25,1,-1,1];this.generatePolygon("tag",l),this.generateRoundPolygon("round-tag",l)}t.makePolygon=function(u){var h=u.join("$"),d="polygon-"+h,f;return(f=this[d])?f:e.generatePolygon(d,u)}};var ag={};ag.timeToRender=function(){return this.redrawTotalTime/this.redrawCount};ag.redraw=function(t){t=t||wz();var e=this;e.averageRedrawTime===void 0&&(e.averageRedrawTime=0),e.lastRedrawTime===void 0&&(e.lastRedrawTime=0),e.lastDrawTime===void 0&&(e.lastDrawTime=0),e.requestedFrame=!0,e.renderOptions=t};ag.beforeRender=function(t,e){if(!this.destroyed){e==null&&Kr("Priority is not optional for beforeRender");var r=this.beforeRenderCallbacks;r.push({fn:t,priority:e}),r.sort(function(n,i){return i.priority-n.priority})}};var H_=function(e,r,n){for(var i=e.beforeRenderCallbacks,a=0;a<i.length;a++)i[a].fn(r,n)};ag.startRenderLoop=function(){var t=this,e=t.cy;if(!t.renderLoopStarted){t.renderLoopStarted=!0;var r=function(i){if(!t.destroyed){if(!e.batching())if(t.requestedFrame&&!t.skipFrame){H_(t,!0,i);var a=Zo();t.render(t.renderOptions);var s=t.lastDrawTime=Zo();t.averageRedrawTime===void 0&&(t.averageRedrawTime=s-a),t.redrawCount===void 0&&(t.redrawCount=0),t.redrawCount++,t.redrawTotalTime===void 0&&(t.redrawTotalTime=0);var o=s-a;t.redrawTotalTime+=o,t.lastRedrawTime=o,t.averageRedrawTime=t.averageRedrawTime/2+o/2,t.requestedFrame=!1}else H_(t,!1,i);t.skipFrame=!1,Mv(r)}};Mv(r)}};var xxe=function(e){this.init(e)},AV=xxe,Od=AV.prototype;Od.clientFunctions=["redrawHint","render","renderTo","matchCanvasSize","nodeShapeImpl","arrowShapeImpl"];Od.init=function(t){var e=this;e.options=t,e.cy=t.cy;var r=e.container=t.cy.container(),n=e.cy.window();if(n){var i=n.document,a=i.head,s="__________cytoscape_stylesheet",o="__________cytoscape_container",l=i.getElementById(s)!=null;if(r.className.indexOf(o)<0&&(r.className=(r.className||"")+" "+o),!l){var u=i.createElement("style");u.id=s,u.textContent="."+o+" { position: relative; }",a.insertBefore(u,a.children[0])}var h=n.getComputedStyle(r),d=h.getPropertyValue("position");d==="static"&&Nr("A Cytoscape container has style position:static and so can not use UI extensions properly")}e.selection=[void 0,void 0,void 0,void 0,0],e.bezierProjPcts=[.05,.225,.4,.5,.6,.775,.95],e.hoverData={down:null,last:null,downTime:null,triggerMode:null,dragging:!1,initialPan:[null,null],capture:!1},e.dragData={possibleDragElements:[]},e.touchData={start:null,capture:!1,startPosition:[null,null,null,null,null,null],singleTouchStartTime:null,singleTouchMoved:!0,now:[null,null,null,null,null,null],earlier:[null,null,null,null,null,null]},e.redraws=0,e.showFps=t.showFps,e.debug=t.debug,e.webgl=t.webgl,e.hideEdgesOnViewport=t.hideEdgesOnViewport,e.textureOnViewport=t.textureOnViewport,e.wheelSensitivity=t.wheelSensitivity,e.motionBlurEnabled=t.motionBlur,e.forcedPixelRatio=vt(t.pixelRatio)?t.pixelRatio:null,e.motionBlur=t.motionBlur,e.motionBlurOpacity=t.motionBlurOpacity,e.motionBlurTransparency=1-e.motionBlurOpacity,e.motionBlurPxRatio=1,e.mbPxRBlurry=1,e.minMbLowQualFrames=4,e.fullQualityMb=!1,e.clearedForMotionBlur=[],e.desktopTapThreshold=t.desktopTapThreshold,e.desktopTapThreshold2=t.desktopTapThreshold*t.desktopTapThreshold,e.touchTapThreshold=t.touchTapThreshold,e.touchTapThreshold2=t.touchTapThreshold*t.touchTapThreshold,e.tapholdDuration=500,e.bindings=[],e.beforeRenderCallbacks=[],e.beforeRenderPriorities={animations:400,eleCalcs:300,eleTxrDeq:200,lyrTxrDeq:150,lyrTxrSkip:100},e.registerNodeShapes(),e.registerArrowShapes(),e.registerCalculationListeners()};Od.notify=function(t,e){var r=this,n=r.cy;if(!this.destroyed){if(t==="init"){r.load();return}if(t==="destroy"){r.destroy();return}(t==="add"||t==="remove"||t==="move"&&n.hasCompoundNodes()||t==="load"||t==="zorder"||t==="mount")&&r.invalidateCachedZSortedEles(),t==="viewport"&&r.redrawHint("select",!0),t==="gc"&&r.redrawHint("gc",!0),(t==="load"||t==="resize"||t==="mount")&&(r.invalidateContainerClientCoordsCache(),r.matchCanvasSize(r.container)),r.redrawHint("eles",!0),r.redrawHint("drag",!0),this.startRenderLoop(),this.redraw()}};Od.destroy=function(){var t=this;t.destroyed=!0,t.cy.stopAnimationLoop();for(var e=0;e<t.bindings.length;e++){var r=t.bindings[e],n=r,i=n.target;(i.off||i.removeEventListener).apply(i,n.args)}if(t.bindings=[],t.beforeRenderCallbacks=[],t.onUpdateEleCalcsFns=[],t.removeObserver&&t.removeObserver.disconnect(),t.styleObserver&&t.styleObserver.disconnect(),t.resizeObserver&&t.resizeObserver.disconnect(),t.labelCalcDiv)try{document.body.removeChild(t.labelCalcDiv)}catch{}};Od.isHeadless=function(){return!1};[sk,SV,CV,Id,al,ag].forEach(function(t){Gt(Od,t)});var q4=1e3/60,_V={setupDequeueing:function(e){return function(){var n=this,i=this.renderer;if(!n.dequeueingSetup){n.dequeueingSetup=!0;var a=eg(function(){i.redrawHint("eles",!0),i.redrawHint("drag",!0),i.redraw()},e.deqRedrawThreshold),s=function(u,h){var d=Zo(),f=i.averageRedrawTime,p=i.lastRedrawTime,g=[],m=i.cy.extent(),v=i.getPixelRatio();for(u||i.flushRenderedStyleQueue();;){var y=Zo(),b=y-d,w=y-h;if(p<q4){var T=q4-(u?f:0);if(w>=e.deqFastCost*T)break}else if(u){if(b>=e.deqCost*p||b>=e.deqAvgCost*f)break}else if(w>=e.deqNoDrawCost*q4)break;var E=e.deq(n,v,m);if(E.length>0)for(var L=0;L<E.length;L++)g.push(E[L]);else break}g.length>0&&(e.onDeqd(n,g),!u&&e.shouldRedraw(n,g,v,m)&&a())},o=e.priority||HE;i.beforeRender(s,o(n))}}}},bxe=function(){function t(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Iv;ac(this,t),this.idsByKey=new Mo,this.keyForId=new Mo,this.cachesByLvl=new Mo,this.lvls=[],this.getKey=e,this.doesEleInvalidateKey=r}return sc(t,[{key:"getIdsFor",value:function(r){r==null&&Kr("Can not get id list for null key");var n=this.idsByKey,i=this.idsByKey.get(r);return i||(i=new Rd,n.set(r,i)),i}},{key:"addIdForKey",value:function(r,n){r!=null&&this.getIdsFor(r).add(n)}},{key:"deleteIdForKey",value:function(r,n){r!=null&&this.getIdsFor(r).delete(n)}},{key:"getNumberOfIdsForKey",value:function(r){return r==null?0:this.getIdsFor(r).size}},{key:"updateKeyMappingFor",value:function(r){var n=r.id(),i=this.keyForId.get(n),a=this.getKey(r);this.deleteIdForKey(i,n),this.addIdForKey(a,n),this.keyForId.set(n,a)}},{key:"deleteKeyMappingFor",value:function(r){var n=r.id(),i=this.keyForId.get(n);this.deleteIdForKey(i,n),this.keyForId.delete(n)}},{key:"keyHasChangedFor",value:function(r){var n=r.id(),i=this.keyForId.get(n),a=this.getKey(r);return i!==a}},{key:"isInvalid",value:function(r){return this.keyHasChangedFor(r)||this.doesEleInvalidateKey(r)}},{key:"getCachesAt",value:function(r){var n=this.cachesByLvl,i=this.lvls,a=n.get(r);return a||(a=new Mo,n.set(r,a),i.push(r)),a}},{key:"getCache",value:function(r,n){return this.getCachesAt(n).get(r)}},{key:"get",value:function(r,n){var i=this.getKey(r),a=this.getCache(i,n);return a!=null&&this.updateKeyMappingFor(r),a}},{key:"getForCachedKey",value:function(r,n){var i=this.keyForId.get(r.id()),a=this.getCache(i,n);return a}},{key:"hasCache",value:function(r,n){return this.getCachesAt(n).has(r)}},{key:"has",value:function(r,n){var i=this.getKey(r);return this.hasCache(i,n)}},{key:"setCache",value:function(r,n,i){i.key=r,this.getCachesAt(n).set(r,i)}},{key:"set",value:function(r,n,i){var a=this.getKey(r);this.setCache(a,n,i),this.updateKeyMappingFor(r)}},{key:"deleteCache",value:function(r,n){this.getCachesAt(n).delete(r)}},{key:"delete",value:function(r,n){var i=this.getKey(r);this.deleteCache(i,n)}},{key:"invalidateKey",value:function(r){var n=this;this.lvls.forEach(function(i){return n.deleteCache(r,i)})}},{key:"invalidate",value:function(r){var n=r.id(),i=this.keyForId.get(n);this.deleteKeyMappingFor(r);var a=this.doesEleInvalidateKey(r);return a&&this.invalidateKey(i),a||this.getNumberOfIdsForKey(i)===0}}])}(),q_=25,a1=50,lm=-4,yw=3,LV=7.99,wxe=8,Txe=1024,Exe=1024,kxe=1024,Sxe=.2,Cxe=.8,Axe=10,_xe=.15,Lxe=.1,Rxe=.9,Nxe=.9,Dxe=100,Mxe=1,wh={dequeue:"dequeue",downscale:"downscale",highQuality:"highQuality"},Ixe=hi({getKey:null,doesEleInvalidateKey:Iv,drawElement:null,getBoundingBox:null,getRotationPoint:null,getRotationOffset:null,isVisible:yz,allowEdgeTxrCaching:!0,allowParentTxrCaching:!0}),Lf=function(e,r){var n=this;n.renderer=e,n.onDequeues=[];var i=Ixe(r);Gt(n,i),n.lookup=new bxe(i.getKey,i.doesEleInvalidateKey),n.setupDequeueing()},Wn=Lf.prototype;Wn.reasons=wh;Wn.getTextureQueue=function(t){var e=this;return e.eleImgCaches=e.eleImgCaches||{},e.eleImgCaches[t]=e.eleImgCaches[t]||[]};Wn.getRetiredTextureQueue=function(t){var e=this,r=e.eleImgCaches.retired=e.eleImgCaches.retired||{},n=r[t]=r[t]||[];return n};Wn.getElementQueue=function(){var t=this,e=t.eleCacheQueue=t.eleCacheQueue||new tg(function(r,n){return n.reqs-r.reqs});return e};Wn.getElementKeyToQueue=function(){var t=this,e=t.eleKeyToCacheQueue=t.eleKeyToCacheQueue||{};return e};Wn.getElement=function(t,e,r,n,i){var a=this,s=this.renderer,o=s.cy.zoom(),l=this.lookup;if(!e||e.w===0||e.h===0||isNaN(e.w)||isNaN(e.h)||!t.visible()||t.removed()||!a.allowEdgeTxrCaching&&t.isEdge()||!a.allowParentTxrCaching&&t.isParent())return null;if(n==null&&(n=Math.ceil(YE(o*r))),n<lm)n=lm;else if(o>=LV||n>yw)return null;var u=Math.pow(2,n),h=e.h*u,d=e.w*u,f=s.eleTextBiggerThanMin(t,u);if(!this.isVisible(t,f))return null;var p=l.get(t,n);if(p&&p.invalidated&&(p.invalidated=!1,p.texture.invalidatedWidth-=p.width),p)return p;var g;if(h<=q_?g=q_:h<=a1?g=a1:g=Math.ceil(h/a1)*a1,h>kxe||d>Exe)return null;var m=a.getTextureQueue(g),v=m[m.length-2],y=function(){return a.recycleTexture(g,d)||a.addTexture(g,d)};v||(v=m[m.length-1]),v||(v=y()),v.width-v.usedWidth<d&&(v=y());for(var b=function(I){return I&&I.scaledLabelShown===f},w=i&&i===wh.dequeue,T=i&&i===wh.highQuality,E=i&&i===wh.downscale,L,S=n+1;S<=yw;S++){var C=l.get(t,S);if(C){L=C;break}}var A=L&&L.level===n+1?L:null,N=function(){v.context.drawImage(A.texture.canvas,A.x,0,A.width,A.height,v.usedWidth,0,d,h)};if(v.context.setTransform(1,0,0,1,0,0),v.context.clearRect(v.usedWidth,0,d,g),b(A))N();else if(b(L))if(T){for(var _=L.level;_>n;_--)A=a.getElement(t,e,r,_,wh.downscale);N()}else return a.queueElement(t,L.level-1),L;else{var O;if(!w&&!T&&!E)for(var P=n-1;P>=lm;P--){var k=l.get(t,P);if(k){O=k;break}}if(b(O))return a.queueElement(t,n),O;v.context.translate(v.usedWidth,0),v.context.scale(u,u),this.drawElement(v.context,t,e,f,!1),v.context.scale(1/u,1/u),v.context.translate(-v.usedWidth,0)}return p={x:v.usedWidth,texture:v,level:n,scale:u,width:d,height:h,scaledLabelShown:f},v.usedWidth+=Math.ceil(d+wxe),v.eleCaches.push(p),l.set(t,n,p),a.checkTextureFullness(v),p};Wn.invalidateElements=function(t){for(var e=0;e<t.length;e++)this.invalidateElement(t[e])};Wn.invalidateElement=function(t){var e=this,r=e.lookup,n=[],i=r.isInvalid(t);if(i){for(var a=lm;a<=yw;a++){var s=r.getForCachedKey(t,a);s&&n.push(s)}var o=r.invalidate(t);if(o)for(var l=0;l<n.length;l++){var u=n[l],h=u.texture;h.invalidatedWidth+=u.width,u.invalidated=!0,e.checkTextureUtility(h)}e.removeFromQueue(t)}};Wn.checkTextureUtility=function(t){t.invalidatedWidth>=Sxe*t.width&&this.retireTexture(t)};Wn.checkTextureFullness=function(t){var e=this,r=e.getTextureQueue(t.height);t.usedWidth/t.width>Cxe&&t.fullnessChecks>=Axe?Gl(r,t):t.fullnessChecks++};Wn.retireTexture=function(t){var e=this,r=t.height,n=e.getTextureQueue(r),i=this.lookup;Gl(n,t),t.retired=!0;for(var a=t.eleCaches,s=0;s<a.length;s++){var o=a[s];i.deleteCache(o.key,o.level)}qE(a);var l=e.getRetiredTextureQueue(r);l.push(t)};Wn.addTexture=function(t,e){var r=this,n=r.getTextureQueue(t),i={};return n.push(i),i.eleCaches=[],i.height=t,i.width=Math.max(Txe,e),i.usedWidth=0,i.invalidatedWidth=0,i.fullnessChecks=0,i.canvas=r.renderer.makeOffscreenCanvas(i.width,i.height),i.context=i.canvas.getContext("2d"),i};Wn.recycleTexture=function(t,e){for(var r=this,n=r.getTextureQueue(t),i=r.getRetiredTextureQueue(t),a=0;a<i.length;a++){var s=i[a];if(s.width>=e)return s.retired=!1,s.usedWidth=0,s.invalidatedWidth=0,s.fullnessChecks=0,qE(s.eleCaches),s.context.setTransform(1,0,0,1,0,0),s.context.clearRect(0,0,s.width,s.height),Gl(i,s),n.push(s),s}};Wn.queueElement=function(t,e){var r=this,n=r.getElementQueue(),i=r.getElementKeyToQueue(),a=this.getKey(t),s=i[a];if(s)s.level=Math.max(s.level,e),s.eles.merge(t),s.reqs++,n.updateItem(s);else{var o={eles:t.spawn().merge(t),level:e,reqs:1,key:a};n.push(o),i[a]=o}};Wn.dequeue=function(t){for(var e=this,r=e.getElementQueue(),n=e.getElementKeyToQueue(),i=[],a=e.lookup,s=0;s<Mxe&&r.size()>0;s++){var o=r.pop(),l=o.key,u=o.eles[0],h=a.hasCache(u,o.level);if(n[l]=null,h)continue;i.push(o);var d=e.getBoundingBox(u);e.getElement(u,d,t,o.level,wh.dequeue)}return i};Wn.removeFromQueue=function(t){var e=this,r=e.getElementQueue(),n=e.getElementKeyToQueue(),i=this.getKey(t),a=n[i];a!=null&&(a.eles.length===1?(a.reqs=WE,r.updateItem(a),r.pop(),n[i]=null):a.eles.unmerge(t))};Wn.onDequeue=function(t){this.onDequeues.push(t)};Wn.offDequeue=function(t){Gl(this.onDequeues,t)};Wn.setupDequeueing=_V.setupDequeueing({deqRedrawThreshold:Dxe,deqCost:_xe,deqAvgCost:Lxe,deqNoDrawCost:Rxe,deqFastCost:Nxe,deq:function(e,r,n){return e.dequeue(r,n)},onDeqd:function(e,r){for(var n=0;n<e.onDequeues.length;n++){var i=e.onDequeues[n];i(r)}},shouldRedraw:function(e,r,n,i){for(var a=0;a<r.length;a++)for(var s=r[a].eles,o=0;o<s.length;o++){var l=s[o].boundingBox();if(jE(l,i))return!0}return!1},priority:function(e){return e.renderer.beforeRenderPriorities.eleTxrDeq}});var Oxe=1,_0=-4,Gv=2,Pxe=3.99,Bxe=50,Fxe=50,$xe=.15,zxe=.1,Vxe=.9,Gxe=.9,Uxe=1,Y_=250,Wxe=4e3*4e3,X_=32767,Hxe=!0,RV=function(e){var r=this,n=r.renderer=e,i=n.cy;r.layersByLevel={},r.firstGet=!0,r.lastInvalidationTime=Zo()-2*Y_,r.skipping=!1,r.eleTxrDeqs=i.collection(),r.scheduleElementRefinement=eg(function(){r.refineElementTextures(r.eleTxrDeqs),r.eleTxrDeqs.unmerge(r.eleTxrDeqs)},Fxe),n.beforeRender(function(s,o){o-r.lastInvalidationTime<=Y_?r.skipping=!0:r.skipping=!1},n.beforeRenderPriorities.lyrTxrSkip);var a=function(o,l){return l.reqs-o.reqs};r.layersQueue=new tg(a),r.setupDequeueing()},di=RV.prototype,j_=0,qxe=Math.pow(2,53)-1;di.makeLayer=function(t,e){var r=Math.pow(2,e),n=Math.ceil(t.w*r),i=Math.ceil(t.h*r),a=this.renderer.makeOffscreenCanvas(n,i),s={id:j_=++j_%qxe,bb:t,level:e,width:n,height:i,canvas:a,context:a.getContext("2d"),eles:[],elesQueue:[],reqs:0},o=s.context,l=-s.bb.x1,u=-s.bb.y1;return o.scale(r,r),o.translate(l,u),s};di.getLayers=function(t,e,r){var n=this,i=n.renderer,a=i.cy,s=a.zoom(),o=n.firstGet;if(n.firstGet=!1,r==null){if(r=Math.ceil(YE(s*e)),r<_0)r=_0;else if(s>=Pxe||r>Gv)return null}n.validateLayersElesOrdering(r,t);var l=n.layersByLevel,u=Math.pow(2,r),h=l[r]=l[r]||[],d,f=n.levelIsComplete(r,t),p,g=function(){var N=function(R){if(n.validateLayersElesOrdering(R,t),n.levelIsComplete(R,t))return p=l[R],!0},_=function(R){if(!p)for(var I=r+R;_0<=I&&I<=Gv&&!N(I);I+=R);};_(1),_(-1);for(var O=h.length-1;O>=0;O--){var P=h[O];P.invalid&&Gl(h,P)}};if(!f)g();else return h;var m=function(){if(!d){d=qi();for(var N=0;N<t.length;N++)Ume(d,t[N].boundingBox())}return d},v=function(N){N=N||{};var _=N.after;m();var O=Math.ceil(d.w*u),P=Math.ceil(d.h*u);if(O>X_||P>X_)return null;var k=O*P;if(k>Wxe)return null;var R=n.makeLayer(d,r);if(_!=null){var I=h.indexOf(_)+1;h.splice(I,0,R)}else(N.insert===void 0||N.insert)&&h.unshift(R);return R};if(n.skipping&&!o)return null;for(var y=null,b=t.length/Oxe,w=!o,T=0;T<t.length;T++){var E=t[T],L=E._private.rscratch,S=L.imgLayerCaches=L.imgLayerCaches||{},C=S[r];if(C){y=C;continue}if((!y||y.eles.length>=b||!kz(y.bb,E.boundingBox()))&&(y=v({insert:!0,after:y}),!y))return null;p||w?n.queueLayer(y,E):n.drawEleInLayer(y,E,r,e),y.eles.push(E),S[r]=y}return p||(w?null:h)};di.getEleLevelForLayerLevel=function(t,e){return t};di.drawEleInLayer=function(t,e,r,n){var i=this,a=this.renderer,s=t.context,o=e.boundingBox();o.w===0||o.h===0||!e.visible()||(r=i.getEleLevelForLayerLevel(r,n),a.setImgSmoothing(s,!1),a.drawCachedElement(s,e,null,null,r,Hxe),a.setImgSmoothing(s,!0))};di.levelIsComplete=function(t,e){var r=this,n=r.layersByLevel[t];if(!n||n.length===0)return!1;for(var i=0,a=0;a<n.length;a++){var s=n[a];if(s.reqs>0||s.invalid)return!1;i+=s.eles.length}return i===e.length};di.validateLayersElesOrdering=function(t,e){var r=this.layersByLevel[t];if(r)for(var n=0;n<r.length;n++){for(var i=r[n],a=-1,s=0;s<e.length;s++)if(i.eles[0]===e[s]){a=s;break}if(a<0){this.invalidateLayer(i);continue}for(var o=a,s=0;s<i.eles.length;s++)if(i.eles[s]!==e[o+s]){this.invalidateLayer(i);break}}};di.updateElementsInLayers=function(t,e){for(var r=this,n=Kp(t[0]),i=0;i<t.length;i++)for(var a=n?null:t[i],s=n?t[i]:t[i].ele,o=s._private.rscratch,l=o.imgLayerCaches=o.imgLayerCaches||{},u=_0;u<=Gv;u++){var h=l[u];h&&(a&&r.getEleLevelForLayerLevel(h.level)!==a.level||e(h,s,a))}};di.haveLayers=function(){for(var t=this,e=!1,r=_0;r<=Gv;r++){var n=t.layersByLevel[r];if(n&&n.length>0){e=!0;break}}return e};di.invalidateElements=function(t){var e=this;t.length!==0&&(e.lastInvalidationTime=Zo(),!(t.length===0||!e.haveLayers())&&e.updateElementsInLayers(t,function(n,i,a){e.invalidateLayer(n)}))};di.invalidateLayer=function(t){if(this.lastInvalidationTime=Zo(),!t.invalid){var e=t.level,r=t.eles,n=this.layersByLevel[e];Gl(n,t),t.elesQueue=[],t.invalid=!0,t.replacement&&(t.replacement.invalid=!0);for(var i=0;i<r.length;i++){var a=r[i]._private.rscratch.imgLayerCaches;a&&(a[e]=null)}}};di.refineElementTextures=function(t){var e=this;e.updateElementsInLayers(t,function(n,i,a){var s=n.replacement;if(s||(s=n.replacement=e.makeLayer(n.bb,n.level),s.replaces=n,s.eles=n.eles),!s.reqs)for(var o=0;o<s.eles.length;o++)e.queueLayer(s,s.eles[o])})};di.enqueueElementRefinement=function(t){this.eleTxrDeqs.merge(t),this.scheduleElementRefinement()};di.queueLayer=function(t,e){var r=this,n=r.layersQueue,i=t.elesQueue,a=i.hasId=i.hasId||{};if(!t.replacement){if(e){if(a[e.id()])return;i.push(e),a[e.id()]=!0}t.reqs?(t.reqs++,n.updateItem(t)):(t.reqs=1,n.push(t))}};di.dequeue=function(t){for(var e=this,r=e.layersQueue,n=[],i=0;i<Uxe&&r.size()!==0;){var a=r.peek();if(a.replacement){r.pop();continue}if(a.replaces&&a!==a.replaces.replacement){r.pop();continue}if(a.invalid){r.pop();continue}var s=a.elesQueue.shift();s&&(e.drawEleInLayer(a,s,a.level,t),i++),n.length===0&&n.push(!0),a.elesQueue.length===0&&(r.pop(),a.reqs=0,a.replaces&&e.applyLayerReplacement(a),e.requestRedraw())}return n};di.applyLayerReplacement=function(t){var e=this,r=e.layersByLevel[t.level],n=t.replaces,i=r.indexOf(n);if(!(i<0||n.invalid)){r[i]=t;for(var a=0;a<t.eles.length;a++){var s=t.eles[a]._private,o=s.imgLayerCaches=s.imgLayerCaches||{};o&&(o[t.level]=t)}e.requestRedraw()}};di.requestRedraw=eg(function(){var t=this.renderer;t.redrawHint("eles",!0),t.redrawHint("drag",!0),t.redraw()},100);di.setupDequeueing=_V.setupDequeueing({deqRedrawThreshold:Bxe,deqCost:$xe,deqAvgCost:zxe,deqNoDrawCost:Vxe,deqFastCost:Gxe,deq:function(e,r){return e.dequeue(r)},onDeqd:HE,shouldRedraw:yz,priority:function(e){return e.renderer.beforeRenderPriorities.lyrTxrDeq}});var NV={},K_;function Yxe(t,e){for(var r=0;r<e.length;r++){var n=e[r];t.lineTo(n.x,n.y)}}function Xxe(t,e,r){for(var n,i=0;i<e.length;i++){var a=e[i];i===0&&(n=a),t.lineTo(a.x,a.y)}t.quadraticCurveTo(r.x,r.y,n.x,n.y)}function Z_(t,e,r){t.beginPath&&t.beginPath();for(var n=e,i=0;i<n.length;i++){var a=n[i];t.lineTo(a.x,a.y)}var s=r,o=r[0];t.moveTo(o.x,o.y);for(var i=1;i<s.length;i++){var a=s[i];t.lineTo(a.x,a.y)}t.closePath&&t.closePath()}function jxe(t,e,r,n,i){t.beginPath&&t.beginPath(),t.arc(r,n,i,0,Math.PI*2,!1);var a=e,s=a[0];t.moveTo(s.x,s.y);for(var o=0;o<a.length;o++){var l=a[o];t.lineTo(l.x,l.y)}t.closePath&&t.closePath()}function Kxe(t,e,r,n){t.arc(e,r,n,0,Math.PI*2,!1)}NV.arrowShapeImpl=function(t){return(K_||(K_={polygon:Yxe,"triangle-backcurve":Xxe,"triangle-tee":Z_,"circle-triangle":jxe,"triangle-cross":Z_,circle:Kxe}))[t]};var co={};co.drawElement=function(t,e,r,n,i,a){var s=this;e.isNode()?s.drawNode(t,e,r,n,i,a):s.drawEdge(t,e,r,n,i,a)};co.drawElementOverlay=function(t,e){var r=this;e.isNode()?r.drawNodeOverlay(t,e):r.drawEdgeOverlay(t,e)};co.drawElementUnderlay=function(t,e){var r=this;e.isNode()?r.drawNodeUnderlay(t,e):r.drawEdgeUnderlay(t,e)};co.drawCachedElementPortion=function(t,e,r,n,i,a,s,o){var l=this,u=r.getBoundingBox(e);if(!(u.w===0||u.h===0)){var h=r.getElement(e,u,n,i,a);if(h!=null){var d=o(l,e);if(d===0)return;var f=s(l,e),p=u.x1,g=u.y1,m=u.w,v=u.h,y,b,w,T,E;if(f!==0){var L=r.getRotationPoint(e);w=L.x,T=L.y,t.translate(w,T),t.rotate(f),E=l.getImgSmoothing(t),E||l.setImgSmoothing(t,!0);var S=r.getRotationOffset(e);y=S.x,b=S.y}else y=p,b=g;var C;d!==1&&(C=t.globalAlpha,t.globalAlpha=C*d),t.drawImage(h.texture.canvas,h.x,0,h.width,h.height,y,b,m,v),d!==1&&(t.globalAlpha=C),f!==0&&(t.rotate(-f),t.translate(-w,-T),E||l.setImgSmoothing(t,!1))}else r.drawElement(t,e)}};var Zxe=function(){return 0},Qxe=function(e,r){return e.getTextAngle(r,null)},Jxe=function(e,r){return e.getTextAngle(r,"source")},ebe=function(e,r){return e.getTextAngle(r,"target")},tbe=function(e,r){return r.effectiveOpacity()},Y4=function(e,r){return r.pstyle("text-opacity").pfValue*r.effectiveOpacity()};co.drawCachedElement=function(t,e,r,n,i,a){var s=this,o=s.data,l=o.eleTxrCache,u=o.lblTxrCache,h=o.slbTxrCache,d=o.tlbTxrCache,f=e.boundingBox(),p=a===!0?l.reasons.highQuality:null;if(!(f.w===0||f.h===0||!e.visible())&&(!n||jE(f,n))){var g=e.isEdge(),m=e.element()._private.rscratch.badLine;s.drawElementUnderlay(t,e),s.drawCachedElementPortion(t,e,l,r,i,p,Zxe,tbe),(!g||!m)&&s.drawCachedElementPortion(t,e,u,r,i,p,Qxe,Y4),g&&!m&&(s.drawCachedElementPortion(t,e,h,r,i,p,Jxe,Y4),s.drawCachedElementPortion(t,e,d,r,i,p,ebe,Y4)),s.drawElementOverlay(t,e)}};co.drawElements=function(t,e){for(var r=this,n=0;n<e.length;n++){var i=e[n];r.drawElement(t,i)}};co.drawCachedElements=function(t,e,r,n){for(var i=this,a=0;a<e.length;a++){var s=e[a];i.drawCachedElement(t,s,r,n)}};co.drawCachedNodes=function(t,e,r,n){for(var i=this,a=0;a<e.length;a++){var s=e[a];s.isNode()&&i.drawCachedElement(t,s,r,n)}};co.drawLayeredElements=function(t,e,r,n){var i=this,a=i.data.lyrTxrCache.getLayers(e,r);if(a)for(var s=0;s<a.length;s++){var o=a[s],l=o.bb;l.w===0||l.h===0||t.drawImage(o.canvas,l.x1,l.y1,l.w,l.h)}else i.drawCachedElements(t,e,r,n)};var sl={};sl.drawEdge=function(t,e,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,s=this,o=e._private.rscratch;if(!(a&&!e.visible())&&!(o.badLine||o.allpts==null||isNaN(o.allpts[0]))){var l;r&&(l=r,t.translate(-l.x1,-l.y1));var u=a?e.pstyle("opacity").value:1,h=a?e.pstyle("line-opacity").value:1,d=e.pstyle("curve-style").value,f=e.pstyle("line-style").value,p=e.pstyle("width").pfValue,g=e.pstyle("line-cap").value,m=e.pstyle("line-outline-width").value,v=e.pstyle("line-outline-color").value,y=u*h,b=u*h,w=function(){var R=arguments.length>0&&arguments[0]!==void 0?arguments[0]:y;d==="straight-triangle"?(s.eleStrokeStyle(t,e,R),s.drawEdgeTrianglePath(e,t,o.allpts)):(t.lineWidth=p,t.lineCap=g,s.eleStrokeStyle(t,e,R),s.drawEdgePath(e,t,o.allpts,f),t.lineCap="butt")},T=function(){var R=arguments.length>0&&arguments[0]!==void 0?arguments[0]:y;if(t.lineWidth=p+m,t.lineCap=g,m>0)s.colorStrokeStyle(t,v[0],v[1],v[2],R);else{t.lineCap="butt";return}d==="straight-triangle"?s.drawEdgeTrianglePath(e,t,o.allpts):(s.drawEdgePath(e,t,o.allpts,f),t.lineCap="butt")},E=function(){i&&s.drawEdgeOverlay(t,e)},L=function(){i&&s.drawEdgeUnderlay(t,e)},S=function(){var R=arguments.length>0&&arguments[0]!==void 0?arguments[0]:b;s.drawArrowheads(t,e,R)},C=function(){s.drawElementText(t,e,null,n)};t.lineJoin="round";var A=e.pstyle("ghost").value==="yes";if(A){var N=e.pstyle("ghost-offset-x").pfValue,_=e.pstyle("ghost-offset-y").pfValue,O=e.pstyle("ghost-opacity").value,P=y*O;t.translate(N,_),w(P),S(P),t.translate(-N,-_)}else T();L(),w(),S(),E(),C(),r&&t.translate(l.x1,l.y1)}};var DV=function(e){if(!["overlay","underlay"].includes(e))throw new Error("Invalid state");return function(r,n){if(n.visible()){var i=n.pstyle("".concat(e,"-opacity")).value;if(i!==0){var a=this,s=a.usePaths(),o=n._private.rscratch,l=n.pstyle("".concat(e,"-padding")).pfValue,u=2*l,h=n.pstyle("".concat(e,"-color")).value;r.lineWidth=u,o.edgeType==="self"&&!s?r.lineCap="butt":r.lineCap="round",a.colorStrokeStyle(r,h[0],h[1],h[2],i),a.drawEdgePath(n,r,o.allpts,"solid")}}}};sl.drawEdgeOverlay=DV("overlay");sl.drawEdgeUnderlay=DV("underlay");sl.drawEdgePath=function(t,e,r,n){var i=t._private.rscratch,a=e,s,o=!1,l=this.usePaths(),u=t.pstyle("line-dash-pattern").pfValue,h=t.pstyle("line-dash-offset").pfValue;if(l){var d=r.join("$"),f=i.pathCacheKey&&i.pathCacheKey===d;f?(s=e=i.pathCache,o=!0):(s=e=new Path2D,i.pathCacheKey=d,i.pathCache=s)}if(a.setLineDash)switch(n){case"dotted":a.setLineDash([1,1]);break;case"dashed":a.setLineDash(u),a.lineDashOffset=h;break;case"solid":a.setLineDash([]);break}if(!o&&!i.badLine)switch(e.beginPath&&e.beginPath(),e.moveTo(r[0],r[1]),i.edgeType){case"bezier":case"self":case"compound":case"multibezier":for(var p=2;p+3<r.length;p+=4)e.quadraticCurveTo(r[p],r[p+1],r[p+2],r[p+3]);break;case"straight":case"haystack":for(var g=2;g+1<r.length;g+=2)e.lineTo(r[g],r[g+1]);break;case"segments":if(i.isRound){var m=la(i.roundCorners),v;try{for(m.s();!(v=m.n()).done;){var y=v.value;bV(e,y)}}catch(w){m.e(w)}finally{m.f()}e.lineTo(r[r.length-2],r[r.length-1])}else for(var b=2;b+1<r.length;b+=2)e.lineTo(r[b],r[b+1]);break}e=a,l?e.stroke(s):e.stroke(),e.setLineDash&&e.setLineDash([])};sl.drawEdgeTrianglePath=function(t,e,r){e.fillStyle=e.strokeStyle;for(var n=t.pstyle("width").pfValue,i=0;i+1<r.length;i+=2){var a=[r[i+2]-r[i],r[i+3]-r[i+1]],s=Math.sqrt(a[0]*a[0]+a[1]*a[1]),o=[a[1]/s,-a[0]/s],l=[o[0]*n/2,o[1]*n/2];e.beginPath(),e.moveTo(r[i]-l[0],r[i+1]-l[1]),e.lineTo(r[i]+l[0],r[i+1]+l[1]),e.lineTo(r[i+2],r[i+3]),e.closePath(),e.fill()}};sl.drawArrowheads=function(t,e,r){var n=e._private.rscratch,i=n.edgeType==="haystack";i||this.drawArrowhead(t,e,"source",n.arrowStartX,n.arrowStartY,n.srcArrowAngle,r),this.drawArrowhead(t,e,"mid-target",n.midX,n.midY,n.midtgtArrowAngle,r),this.drawArrowhead(t,e,"mid-source",n.midX,n.midY,n.midsrcArrowAngle,r),i||this.drawArrowhead(t,e,"target",n.arrowEndX,n.arrowEndY,n.tgtArrowAngle,r)};sl.drawArrowhead=function(t,e,r,n,i,a,s){if(!(isNaN(n)||n==null||isNaN(i)||i==null||isNaN(a)||a==null)){var o=this,l=e.pstyle(r+"-arrow-shape").value;if(l!=="none"){var u=e.pstyle(r+"-arrow-fill").value==="hollow"?"both":"filled",h=e.pstyle(r+"-arrow-fill").value,d=e.pstyle("width").pfValue,f=e.pstyle(r+"-arrow-width"),p=f.value==="match-line"?d:f.pfValue;f.units==="%"&&(p*=d);var g=e.pstyle("opacity").value;s===void 0&&(s=g);var m=t.globalCompositeOperation;(s!==1||h==="hollow")&&(t.globalCompositeOperation="destination-out",o.colorFillStyle(t,255,255,255,1),o.colorStrokeStyle(t,255,255,255,1),o.drawArrowShape(e,t,u,d,l,p,n,i,a),t.globalCompositeOperation=m);var v=e.pstyle(r+"-arrow-color").value;o.colorFillStyle(t,v[0],v[1],v[2],s),o.colorStrokeStyle(t,v[0],v[1],v[2],s),o.drawArrowShape(e,t,h,d,l,p,n,i,a)}}};sl.drawArrowShape=function(t,e,r,n,i,a,s,o,l){var u=this,h=this.usePaths()&&i!=="triangle-cross",d=!1,f,p=e,g={x:s,y:o},m=t.pstyle("arrow-scale").value,v=this.getArrowWidth(n,m),y=u.arrowShapes[i];if(h){var b=u.arrowPathCache=u.arrowPathCache||[],w=du(i),T=b[w];T!=null?(f=e=T,d=!0):(f=e=new Path2D,b[w]=f)}d||(e.beginPath&&e.beginPath(),h?y.draw(e,1,0,{x:0,y:0},1):y.draw(e,v,l,g,n),e.closePath&&e.closePath()),e=p,h&&(e.translate(s,o),e.rotate(l),e.scale(v,v)),(r==="filled"||r==="both")&&(h?e.fill(f):e.fill()),(r==="hollow"||r==="both")&&(e.lineWidth=a/(h?v:1),e.lineJoin="miter",h?e.stroke(f):e.stroke()),h&&(e.scale(1/v,1/v),e.rotate(-l),e.translate(-s,-o))};var ck={};ck.safeDrawImage=function(t,e,r,n,i,a,s,o,l,u){if(!(i<=0||a<=0||l<=0||u<=0))try{t.drawImage(e,r,n,i,a,s,o,l,u)}catch(h){Nr(h)}};ck.drawInscribedImage=function(t,e,r,n,i){var a=this,s=r.position(),o=s.x,l=s.y,u=r.cy().style(),h=u.getIndexedStyle.bind(u),d=h(r,"background-fit","value",n),f=h(r,"background-repeat","value",n),p=r.width(),g=r.height(),m=r.padding()*2,v=p+(h(r,"background-width-relative-to","value",n)==="inner"?0:m),y=g+(h(r,"background-height-relative-to","value",n)==="inner"?0:m),b=r._private.rscratch,w=h(r,"background-clip","value",n),T=w==="node",E=h(r,"background-image-opacity","value",n)*i,L=h(r,"background-image-smoothing","value",n),S=r.pstyle("corner-radius").value;S!=="auto"&&(S=r.pstyle("corner-radius").pfValue);var C=e.width||e.cachedW,A=e.height||e.cachedH;(C==null||A==null)&&(document.body.appendChild(e),C=e.cachedW=e.width||e.offsetWidth,A=e.cachedH=e.height||e.offsetHeight,document.body.removeChild(e));var N=C,_=A;if(h(r,"background-width","value",n)!=="auto"&&(h(r,"background-width","units",n)==="%"?N=h(r,"background-width","pfValue",n)*v:N=h(r,"background-width","pfValue",n)),h(r,"background-height","value",n)!=="auto"&&(h(r,"background-height","units",n)==="%"?_=h(r,"background-height","pfValue",n)*y:_=h(r,"background-height","pfValue",n)),!(N===0||_===0)){if(d==="contain"){var O=Math.min(v/N,y/_);N*=O,_*=O}else if(d==="cover"){var O=Math.max(v/N,y/_);N*=O,_*=O}var P=o-v/2,k=h(r,"background-position-x","units",n),R=h(r,"background-position-x","pfValue",n);k==="%"?P+=(v-N)*R:P+=R;var I=h(r,"background-offset-x","units",n),M=h(r,"background-offset-x","pfValue",n);I==="%"?P+=(v-N)*M:P+=M;var D=l-y/2,B=h(r,"background-position-y","units",n),$=h(r,"background-position-y","pfValue",n);B==="%"?D+=(y-_)*$:D+=$;var F=h(r,"background-offset-y","units",n),G=h(r,"background-offset-y","pfValue",n);F==="%"?D+=(y-_)*G:D+=G,b.pathCache&&(P-=o,D-=l,o=0,l=0);var W=t.globalAlpha;t.globalAlpha=E;var J=a.getImgSmoothing(t),q=!1;if(L==="no"&&J?(a.setImgSmoothing(t,!1),q=!0):L==="yes"&&!J&&(a.setImgSmoothing(t,!0),q=!0),f==="no-repeat")T&&(t.save(),b.pathCache?t.clip(b.pathCache):(a.nodeShapes[a.getNodeShape(r)].draw(t,o,l,v,y,S,b),t.clip())),a.safeDrawImage(t,e,0,0,C,A,P,D,N,_),T&&t.restore();else{var ne=t.createPattern(e,f);t.fillStyle=ne,a.nodeShapes[a.getNodeShape(r)].draw(t,o,l,v,y,S,b),t.translate(P,D),t.fill(),t.translate(-P,-D)}t.globalAlpha=W,q&&a.setImgSmoothing(t,J)}};var Pu={};Pu.eleTextBiggerThanMin=function(t,e){if(!e){var r=t.cy().zoom(),n=this.getPixelRatio(),i=Math.ceil(YE(r*n));e=Math.pow(2,i)}var a=t.pstyle("font-size").pfValue*e,s=t.pstyle("min-zoomed-font-size").pfValue;return!(a<s)};Pu.drawElementText=function(t,e,r,n,i){var a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,s=this;if(n==null){if(a&&!s.eleTextBiggerThanMin(e))return}else if(n===!1)return;if(e.isNode()){var o=e.pstyle("label");if(!o||!o.value)return;var l=s.getLabelJustification(e);t.textAlign=l,t.textBaseline="bottom"}else{var u=e.element()._private.rscratch.badLine,h=e.pstyle("label"),d=e.pstyle("source-label"),f=e.pstyle("target-label");if(u||(!h||!h.value)&&(!d||!d.value)&&(!f||!f.value))return;t.textAlign="center",t.textBaseline="bottom"}var p=!r,g;r&&(g=r,t.translate(-g.x1,-g.y1)),i==null?(s.drawText(t,e,null,p,a),e.isEdge()&&(s.drawText(t,e,"source",p,a),s.drawText(t,e,"target",p,a))):s.drawText(t,e,i,p,a),r&&t.translate(g.x1,g.y1)};Pu.getFontCache=function(t){var e;this.fontCaches=this.fontCaches||[];for(var r=0;r<this.fontCaches.length;r++)if(e=this.fontCaches[r],e.context===t)return e;return e={context:t},this.fontCaches.push(e),e};Pu.setupTextStyle=function(t,e){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,n=e.pstyle("font-style").strValue,i=e.pstyle("font-size").pfValue+"px",a=e.pstyle("font-family").strValue,s=e.pstyle("font-weight").strValue,o=r?e.effectiveOpacity()*e.pstyle("text-opacity").value:1,l=e.pstyle("text-outline-opacity").value*o,u=e.pstyle("color").value,h=e.pstyle("text-outline-color").value;t.font=n+" "+s+" "+i+" "+a,t.lineJoin="round",this.colorFillStyle(t,u[0],u[1],u[2],o),this.colorStrokeStyle(t,h[0],h[1],h[2],l)};function rbe(t,e,r,n,i){var a=Math.min(n,i),s=a/2,o=e+n/2,l=r+i/2;t.beginPath(),t.arc(o,l,s,0,Math.PI*2),t.closePath()}function Q_(t,e,r,n,i){var a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:5,s=Math.min(a,n/2,i/2);t.beginPath(),t.moveTo(e+s,r),t.lineTo(e+n-s,r),t.quadraticCurveTo(e+n,r,e+n,r+s),t.lineTo(e+n,r+i-s),t.quadraticCurveTo(e+n,r+i,e+n-s,r+i),t.lineTo(e+s,r+i),t.quadraticCurveTo(e,r+i,e,r+i-s),t.lineTo(e,r+s),t.quadraticCurveTo(e,r,e+s,r),t.closePath()}Pu.getTextAngle=function(t,e){var r,n=t._private,i=n.rscratch,a=e?e+"-":"",s=t.pstyle(a+"text-rotation");if(s.strValue==="autorotate"){var o=ia(i,"labelAngle",e);r=t.isEdge()?o:0}else s.strValue==="none"?r=0:r=s.pfValue;return r};Pu.drawText=function(t,e,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,a=e._private,s=a.rscratch,o=i?e.effectiveOpacity():1;if(!(i&&(o===0||e.pstyle("text-opacity").value===0))){r==="main"&&(r=null);var l=ia(s,"labelX",r),u=ia(s,"labelY",r),h,d,f=this.getLabelText(e,r);if(f!=null&&f!==""&&!isNaN(l)&&!isNaN(u)){this.setupTextStyle(t,e,i);var p=r?r+"-":"",g=ia(s,"labelWidth",r),m=ia(s,"labelHeight",r),v=e.pstyle(p+"text-margin-x").pfValue,y=e.pstyle(p+"text-margin-y").pfValue,b=e.isEdge(),w=e.pstyle("text-halign").value,T=e.pstyle("text-valign").value;b&&(w="center",T="center"),l+=v,u+=y;var E;switch(n?E=this.getTextAngle(e,r):E=0,E!==0&&(h=l,d=u,t.translate(h,d),t.rotate(E),l=0,u=0),T){case"top":break;case"center":u+=m/2;break;case"bottom":u+=m;break}var L=e.pstyle("text-background-opacity").value,S=e.pstyle("text-border-opacity").value,C=e.pstyle("text-border-width").pfValue,A=e.pstyle("text-background-padding").pfValue,N=e.pstyle("text-background-shape").strValue,_=N==="round-rectangle"||N==="roundrectangle",O=N==="circle",P=2;if(L>0||C>0&&S>0){var k=t.fillStyle,R=t.strokeStyle,I=t.lineWidth,M=e.pstyle("text-background-color").value,D=e.pstyle("text-border-color").value,B=e.pstyle("text-border-style").value,$=L>0,F=C>0&&S>0,G=l-A;switch(w){case"left":G-=g;break;case"center":G-=g/2;break}var W=u-m-A,J=g+2*A,q=m+2*A;if($&&(t.fillStyle="rgba(".concat(M[0],",").concat(M[1],",").concat(M[2],",").concat(L*o,")")),F&&(t.strokeStyle="rgba(".concat(D[0],",").concat(D[1],",").concat(D[2],",").concat(S*o,")"),t.lineWidth=C,t.setLineDash))switch(B){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash([4,2]);break;case"double":t.lineWidth=C/4,t.setLineDash([]);break;case"solid":default:t.setLineDash([]);break}if(_?(t.beginPath(),Q_(t,G,W,J,q,P)):O?(t.beginPath(),rbe(t,G,W,J,q)):(t.beginPath(),t.rect(G,W,J,q)),$&&t.fill(),F&&t.stroke(),F&&B==="double"){var ne=C/2;t.beginPath(),_?Q_(t,G+ne,W+ne,J-2*ne,q-2*ne,P):t.rect(G+ne,W+ne,J-2*ne,q-2*ne),t.stroke()}t.fillStyle=k,t.strokeStyle=R,t.lineWidth=I,t.setLineDash&&t.setLineDash([])}var ae=2*e.pstyle("text-outline-width").pfValue;if(ae>0&&(t.lineWidth=ae),e.pstyle("text-wrap").value==="wrap"){var pe=ia(s,"labelWrapCachedLines",r),K=ia(s,"labelLineHeight",r),Z=g/2,X=this.getLabelJustification(e);switch(X==="auto"||(w==="left"?X==="left"?l+=-g:X==="center"&&(l+=-Z):w==="center"?X==="left"?l+=-Z:X==="right"&&(l+=Z):w==="right"&&(X==="center"?l+=Z:X==="right"&&(l+=g))),T){case"top":u-=(pe.length-1)*K;break;case"center":case"bottom":u-=(pe.length-1)*K;break}for(var Y=0;Y<pe.length;Y++)ae>0&&t.strokeText(pe[Y],l,u),t.fillText(pe[Y],l,u),u+=K}else ae>0&&t.strokeText(f,l,u),t.fillText(f,l,u);E!==0&&(t.rotate(-E),t.translate(-h,-d))}}};var lc={};lc.drawNode=function(t,e,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,s=this,o,l,u=e._private,h=u.rscratch,d=e.position();if(!(!vt(d.x)||!vt(d.y))&&!(a&&!e.visible())){var f=a?e.effectiveOpacity():1,p=s.usePaths(),g,m=!1,v=e.padding();o=e.width()+2*v,l=e.height()+2*v;var y;r&&(y=r,t.translate(-y.x1,-y.y1));for(var b=e.pstyle("background-image"),w=b.value,T=new Array(w.length),E=new Array(w.length),L=0,S=0;S<w.length;S++){var C=w[S],A=T[S]=C!=null&&C!=="none";if(A){var N=e.cy().style().getIndexedStyle(e,"background-image-crossorigin","value",S);L++,E[S]=s.getCachedImage(C,N,function(){u.backgroundTimestamp=Date.now(),e.emitAndNotify("background")})}}var _=e.pstyle("background-blacken").value,O=e.pstyle("border-width").pfValue,P=e.pstyle("background-opacity").value*f,k=e.pstyle("border-color").value,R=e.pstyle("border-style").value,I=e.pstyle("border-join").value,M=e.pstyle("border-cap").value,D=e.pstyle("border-position").value,B=e.pstyle("border-dash-pattern").pfValue,$=e.pstyle("border-dash-offset").pfValue,F=e.pstyle("border-opacity").value*f,G=e.pstyle("outline-width").pfValue,W=e.pstyle("outline-color").value,J=e.pstyle("outline-style").value,q=e.pstyle("outline-opacity").value*f,ne=e.pstyle("outline-offset").value,ae=e.pstyle("corner-radius").value;ae!=="auto"&&(ae=e.pstyle("corner-radius").pfValue);var pe=function(){var Q=arguments.length>0&&arguments[0]!==void 0?arguments[0]:P;s.eleFillStyle(t,e,Q)},K=function(){var Q=arguments.length>0&&arguments[0]!==void 0?arguments[0]:F;s.colorStrokeStyle(t,k[0],k[1],k[2],Q)},Z=function(){var Q=arguments.length>0&&arguments[0]!==void 0?arguments[0]:q;s.colorStrokeStyle(t,W[0],W[1],W[2],Q)},X=function(Q,ce,z,oe){var se=s.nodePathCache=s.nodePathCache||[],ge=vz(z==="polygon"?z+","+oe.join(","):z,""+ce,""+Q,""+ae),he=se[ge],be,Ce=!1;return he!=null?(be=he,Ce=!0,h.pathCache=be):(be=new Path2D,se[ge]=h.pathCache=be),{path:be,cacheHit:Ce}},Y=e.pstyle("shape").strValue,ee=e.pstyle("shape-polygon-points").pfValue;if(p){t.translate(d.x,d.y);var j=X(o,l,Y,ee);g=j.path,m=j.cacheHit}var fe=function(){if(!m){var Q=d;p&&(Q={x:0,y:0}),s.nodeShapes[s.getNodeShape(e)].draw(g||t,Q.x,Q.y,o,l,ae,h)}p?t.fill(g):t.fill()},te=function(){for(var Q=arguments.length>0&&arguments[0]!==void 0?arguments[0]:f,ce=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,z=u.backgrounding,oe=0,se=0;se<E.length;se++){var ge=e.cy().style().getIndexedStyle(e,"background-image-containment","value",se);if(ce&&ge==="over"||!ce&&ge==="inside"){oe++;continue}T[se]&&E[se].complete&&!E[se].error&&(oe++,s.drawInscribedImage(t,E[se],e,se,Q))}u.backgrounding=oe!==L,z!==u.backgrounding&&e.updateStyle(!1)},Ae=function(){var Q=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,ce=arguments.length>1&&arguments[1]!==void 0?arguments[1]:f;s.hasPie(e)&&(s.drawPie(t,e,ce),Q&&(p||s.nodeShapes[s.getNodeShape(e)].draw(t,d.x,d.y,o,l,ae,h)))},H=function(){var Q=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,ce=arguments.length>1&&arguments[1]!==void 0?arguments[1]:f;s.hasStripe(e)&&(t.save(),p?t.clip(h.pathCache):(s.nodeShapes[s.getNodeShape(e)].draw(t,d.x,d.y,o,l,ae,h),t.clip()),s.drawStripe(t,e,ce),t.restore(),Q&&(p||s.nodeShapes[s.getNodeShape(e)].draw(t,d.x,d.y,o,l,ae,h)))},Oe=function(){var Q=arguments.length>0&&arguments[0]!==void 0?arguments[0]:f,ce=(_>0?_:-_)*Q,z=_>0?0:255;_!==0&&(s.colorFillStyle(t,z,z,z,ce),p?t.fill(g):t.fill())},ue=function(){if(O>0){if(t.lineWidth=O,t.lineCap=M,t.lineJoin=I,t.setLineDash)switch(R){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash(B),t.lineDashOffset=$;break;case"solid":case"double":t.setLineDash([]);break}if(D!=="center"){if(t.save(),t.lineWidth*=2,D==="inside")p?t.clip(g):t.clip();else{var Q=new Path2D;Q.rect(-o/2-O,-l/2-O,o+2*O,l+2*O),Q.addPath(g),t.clip(Q,"evenodd")}p?t.stroke(g):t.stroke(),t.restore()}else p?t.stroke(g):t.stroke();if(R==="double"){t.lineWidth=O/3;var ce=t.globalCompositeOperation;t.globalCompositeOperation="destination-out",p?t.stroke(g):t.stroke(),t.globalCompositeOperation=ce}t.setLineDash&&t.setLineDash([])}},Ve=function(){if(G>0){if(t.lineWidth=G,t.lineCap="butt",t.setLineDash)switch(J){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash([4,2]);break;case"solid":case"double":t.setLineDash([]);break}var Q=d;p&&(Q={x:0,y:0});var ce=s.getNodeShape(e),z=O;D==="inside"&&(z=0),D==="outside"&&(z*=2);var oe=(o+z+(G+ne))/o,se=(l+z+(G+ne))/l,ge=o*oe,he=l*se,be=s.nodeShapes[ce].points,Ce;if(p){var Te=X(ge,he,ce,be);Ce=Te.path}if(ce==="ellipse")s.drawEllipsePath(Ce||t,Q.x,Q.y,ge,he);else if(["round-diamond","round-heptagon","round-hexagon","round-octagon","round-pentagon","round-polygon","round-triangle","round-tag"].includes(ce)){var Ne=0,Xe=0,Ye=0;ce==="round-diamond"?Ne=(z+ne+G)*1.4:ce==="round-heptagon"?(Ne=(z+ne+G)*1.075,Ye=-(z/2+ne+G)/35):ce==="round-hexagon"?Ne=(z+ne+G)*1.12:ce==="round-pentagon"?(Ne=(z+ne+G)*1.13,Ye=-(z/2+ne+G)/15):ce==="round-tag"?(Ne=(z+ne+G)*1.12,Xe=(z/2+G+ne)*.07):ce==="round-triangle"&&(Ne=(z+ne+G)*(Math.PI/2),Ye=-(z+ne/2+G)/Math.PI),Ne!==0&&(oe=(o+Ne)/o,ge=o*oe,["round-hexagon","round-tag"].includes(ce)||(se=(l+Ne)/l,he=l*se)),ae=ae==="auto"?Az(ge,he):ae;for(var Ke=ge/2,Ze=he/2,Be=ae+(z+G+ne)/2,He=new Array(be.length/2),ht=new Array(be.length/2),st=0;st<be.length/2;st++)He[st]={x:Q.x+Xe+Ke*be[st*2],y:Q.y+Ye+Ze*be[st*2+1]};var We,kt,qe,rt,ct=He.length;for(kt=He[ct-1],We=0;We<ct;We++)qe=He[We%ct],rt=He[(We+1)%ct],ht[We]=ok(kt,qe,rt,Be),kt=qe,qe=rt;s.drawRoundPolygonPath(Ce||t,Q.x+Xe,Q.y+Ye,o*oe,l*se,be,ht)}else if(["roundrectangle","round-rectangle"].includes(ce))ae=ae==="auto"?Ul(ge,he):ae,s.drawRoundRectanglePath(Ce||t,Q.x,Q.y,ge,he,ae+(z+G+ne)/2);else if(["cutrectangle","cut-rectangle"].includes(ce))ae=ae==="auto"?KE():ae,s.drawCutRectanglePath(Ce||t,Q.x,Q.y,ge,he,null,ae+(z+G+ne)/4);else if(["bottomroundrectangle","bottom-round-rectangle"].includes(ce))ae=ae==="auto"?Ul(ge,he):ae,s.drawBottomRoundRectanglePath(Ce||t,Q.x,Q.y,ge,he,ae+(z+G+ne)/2);else if(ce==="barrel")s.drawBarrelPath(Ce||t,Q.x,Q.y,ge,he);else if(ce.startsWith("polygon")||["rhomboid","right-rhomboid","round-tag","tag","vee"].includes(ce)){var ut=(z+G+ne)/o;be=Ov(Pv(be,ut)),s.drawPolygonPath(Ce||t,Q.x,Q.y,o,l,be)}else{var nt=(z+G+ne)/o;be=Ov(Pv(be,-nt)),s.drawPolygonPath(Ce||t,Q.x,Q.y,o,l,be)}if(p?t.stroke(Ce):t.stroke(),J==="double"){t.lineWidth=z/3;var bt=t.globalCompositeOperation;t.globalCompositeOperation="destination-out",p?t.stroke(Ce):t.stroke(),t.globalCompositeOperation=bt}t.setLineDash&&t.setLineDash([])}},Ge=function(){i&&s.drawNodeOverlay(t,e,d,o,l)},Ue=function(){i&&s.drawNodeUnderlay(t,e,d,o,l)},ke=function(){s.drawElementText(t,e,null,n)},Pe=e.pstyle("ghost").value==="yes";if(Pe){var Se=e.pstyle("ghost-offset-x").pfValue,_e=e.pstyle("ghost-offset-y").pfValue,ze=e.pstyle("ghost-opacity").value,me=ze*f;t.translate(Se,_e),Z(),Ve(),pe(ze*P),fe(),te(me,!0),K(ze*F),ue(),Ae(_!==0||O!==0),H(_!==0||O!==0),te(me,!1),Oe(me),t.translate(-Se,-_e)}p&&t.translate(-d.x,-d.y),Ue(),p&&t.translate(d.x,d.y),Z(),Ve(),pe(),fe(),te(f,!0),K(),ue(),Ae(_!==0||O!==0),H(_!==0||O!==0),te(f,!1),Oe(),p&&t.translate(-d.x,-d.y),ke(),Ge(),r&&t.translate(y.x1,y.y1)}};var MV=function(e){if(!["overlay","underlay"].includes(e))throw new Error("Invalid state");return function(r,n,i,a,s){var o=this;if(n.visible()){var l=n.pstyle("".concat(e,"-padding")).pfValue,u=n.pstyle("".concat(e,"-opacity")).value,h=n.pstyle("".concat(e,"-color")).value,d=n.pstyle("".concat(e,"-shape")).value,f=n.pstyle("".concat(e,"-corner-radius")).value;if(u>0){if(i=i||n.position(),a==null||s==null){var p=n.padding();a=n.width()+2*p,s=n.height()+2*p}o.colorFillStyle(r,h[0],h[1],h[2],u),o.nodeShapes[d].draw(r,i.x,i.y,a+l*2,s+l*2,f),r.fill()}}}};lc.drawNodeOverlay=MV("overlay");lc.drawNodeUnderlay=MV("underlay");lc.hasPie=function(t){return t=t[0],t._private.hasPie};lc.hasStripe=function(t){return t=t[0],t._private.hasStripe};lc.drawPie=function(t,e,r,n){e=e[0],n=n||e.position();var i=e.cy().style(),a=e.pstyle("pie-size"),s=e.pstyle("pie-hole"),o=e.pstyle("pie-start-angle").pfValue,l=n.x,u=n.y,h=e.width(),d=e.height(),f=Math.min(h,d)/2,p,g=0,m=this.usePaths();if(m&&(l=0,u=0),a.units==="%"?f=f*a.pfValue:a.pfValue!==void 0&&(f=a.pfValue/2),s.units==="%"?p=f*s.pfValue:s.pfValue!==void 0&&(p=s.pfValue/2),!(p>=f))for(var v=1;v<=i.pieBackgroundN;v++){var y=e.pstyle("pie-"+v+"-background-size").value,b=e.pstyle("pie-"+v+"-background-color").value,w=e.pstyle("pie-"+v+"-background-opacity").value*r,T=y/100;T+g>1&&(T=1-g);var E=1.5*Math.PI+2*Math.PI*g;E+=o;var L=2*Math.PI*T,S=E+L;y===0||g>=1||g+T>1||(p===0?(t.beginPath(),t.moveTo(l,u),t.arc(l,u,f,E,S),t.closePath()):(t.beginPath(),t.arc(l,u,f,E,S),t.arc(l,u,p,S,E,!0),t.closePath()),this.colorFillStyle(t,b[0],b[1],b[2],w),t.fill(),g+=T)}};lc.drawStripe=function(t,e,r,n){e=e[0],n=n||e.position();var i=e.cy().style(),a=n.x,s=n.y,o=e.width(),l=e.height(),u=0,h=this.usePaths();t.save();var d=e.pstyle("stripe-direction").value,f=e.pstyle("stripe-size");switch(d){case"vertical":break;case"righward":t.rotate(-Math.PI/2);break}var p=o,g=l;f.units==="%"?(p=p*f.pfValue,g=g*f.pfValue):f.pfValue!==void 0&&(p=f.pfValue,g=f.pfValue),h&&(a=0,s=0),s-=p/2,a-=g/2;for(var m=1;m<=i.stripeBackgroundN;m++){var v=e.pstyle("stripe-"+m+"-background-size").value,y=e.pstyle("stripe-"+m+"-background-color").value,b=e.pstyle("stripe-"+m+"-background-opacity").value*r,w=v/100;w+u>1&&(w=1-u),!(v===0||u>=1||u+w>1)&&(t.beginPath(),t.rect(a,s+g*u,p,g*w),t.closePath(),this.colorFillStyle(t,y[0],y[1],y[2],b),t.fill(),u+=w)}t.restore()};var Qi={},nbe=100;Qi.getPixelRatio=function(){var t=this.data.contexts[0];if(this.forcedPixelRatio!=null)return this.forcedPixelRatio;var e=this.cy.window(),r=t.backingStorePixelRatio||t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1;return(e.devicePixelRatio||1)/r};Qi.paintCache=function(t){for(var e=this.paintCaches=this.paintCaches||[],r=!0,n,i=0;i<e.length;i++)if(n=e[i],n.context===t){r=!1;break}return r&&(n={context:t},e.push(n)),n};Qi.createGradientStyleFor=function(t,e,r,n,i){var a,s=this.usePaths(),o=r.pstyle(e+"-gradient-stop-colors").value,l=r.pstyle(e+"-gradient-stop-positions").pfValue;if(n==="radial-gradient")if(r.isEdge()){var u=r.sourceEndpoint(),h=r.targetEndpoint(),d=r.midpoint(),f=fu(u,d),p=fu(h,d);a=t.createRadialGradient(d.x,d.y,0,d.x,d.y,Math.max(f,p))}else{var g=s?{x:0,y:0}:r.position(),m=r.paddedWidth(),v=r.paddedHeight();a=t.createRadialGradient(g.x,g.y,0,g.x,g.y,Math.max(m,v))}else if(r.isEdge()){var y=r.sourceEndpoint(),b=r.targetEndpoint();a=t.createLinearGradient(y.x,y.y,b.x,b.y)}else{var w=s?{x:0,y:0}:r.position(),T=r.paddedWidth(),E=r.paddedHeight(),L=T/2,S=E/2,C=r.pstyle("background-gradient-direction").value;switch(C){case"to-bottom":a=t.createLinearGradient(w.x,w.y-S,w.x,w.y+S);break;case"to-top":a=t.createLinearGradient(w.x,w.y+S,w.x,w.y-S);break;case"to-left":a=t.createLinearGradient(w.x+L,w.y,w.x-L,w.y);break;case"to-right":a=t.createLinearGradient(w.x-L,w.y,w.x+L,w.y);break;case"to-bottom-right":case"to-right-bottom":a=t.createLinearGradient(w.x-L,w.y-S,w.x+L,w.y+S);break;case"to-top-right":case"to-right-top":a=t.createLinearGradient(w.x-L,w.y+S,w.x+L,w.y-S);break;case"to-bottom-left":case"to-left-bottom":a=t.createLinearGradient(w.x+L,w.y-S,w.x-L,w.y+S);break;case"to-top-left":case"to-left-top":a=t.createLinearGradient(w.x+L,w.y+S,w.x-L,w.y-S);break}}if(!a)return null;for(var A=l.length===o.length,N=o.length,_=0;_<N;_++)a.addColorStop(A?l[_]:_/(N-1),"rgba("+o[_][0]+","+o[_][1]+","+o[_][2]+","+i+")");return a};Qi.gradientFillStyle=function(t,e,r,n){var i=this.createGradientStyleFor(t,"background",e,r,n);if(!i)return null;t.fillStyle=i};Qi.colorFillStyle=function(t,e,r,n,i){t.fillStyle="rgba("+e+","+r+","+n+","+i+")"};Qi.eleFillStyle=function(t,e,r){var n=e.pstyle("background-fill").value;if(n==="linear-gradient"||n==="radial-gradient")this.gradientFillStyle(t,e,n,r);else{var i=e.pstyle("background-color").value;this.colorFillStyle(t,i[0],i[1],i[2],r)}};Qi.gradientStrokeStyle=function(t,e,r,n){var i=this.createGradientStyleFor(t,"line",e,r,n);if(!i)return null;t.strokeStyle=i};Qi.colorStrokeStyle=function(t,e,r,n,i){t.strokeStyle="rgba("+e+","+r+","+n+","+i+")"};Qi.eleStrokeStyle=function(t,e,r){var n=e.pstyle("line-fill").value;if(n==="linear-gradient"||n==="radial-gradient")this.gradientStrokeStyle(t,e,n,r);else{var i=e.pstyle("line-color").value;this.colorStrokeStyle(t,i[0],i[1],i[2],r)}};Qi.matchCanvasSize=function(t){var e=this,r=e.data,n=e.findContainerClientCoords(),i=n[2],a=n[3],s=e.getPixelRatio(),o=e.motionBlurPxRatio;(t===e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_NODE]||t===e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_DRAG])&&(s=o);var l=i*s,u=a*s,h;if(!(l===e.canvasWidth&&u===e.canvasHeight)){e.fontCaches=null;var d=r.canvasContainer;d.style.width=i+"px",d.style.height=a+"px";for(var f=0;f<e.CANVAS_LAYERS;f++)h=r.canvases[f],h.width=l,h.height=u,h.style.width=i+"px",h.style.height=a+"px";for(var f=0;f<e.BUFFER_COUNT;f++)h=r.bufferCanvases[f],h.width=l,h.height=u,h.style.width=i+"px",h.style.height=a+"px";e.textureMult=1,s<=1&&(h=r.bufferCanvases[e.TEXTURE_BUFFER],e.textureMult=2,h.width=l*e.textureMult,h.height=u*e.textureMult),e.canvasWidth=l,e.canvasHeight=u,e.pixelRatio=s}};Qi.renderTo=function(t,e,r,n){this.render({forcedContext:t,forcedZoom:e,forcedPan:r,drawAllLayers:!0,forcedPxRatio:n})};Qi.clearCanvas=function(){var t=this,e=t.data;function r(n){n.clearRect(0,0,t.canvasWidth,t.canvasHeight)}r(e.contexts[t.NODE]),r(e.contexts[t.DRAG])};Qi.render=function(t){var e=this;t=t||wz();var r=e.cy,n=t.forcedContext,i=t.drawAllLayers,a=t.drawOnlyNodeLayer,s=t.forcedZoom,o=t.forcedPan,l=t.forcedPxRatio===void 0?this.getPixelRatio():t.forcedPxRatio,u=e.data,h=u.canvasNeedsRedraw,d=e.textureOnViewport&&!n&&(e.pinching||e.hoverData.dragging||e.swipePanning||e.data.wheelZooming),f=t.motionBlur!==void 0?t.motionBlur:e.motionBlur,p=e.motionBlurPxRatio,g=r.hasCompoundNodes(),m=e.hoverData.draggingEles,v=!!(e.hoverData.selecting||e.touchData.selecting);f=f&&!n&&e.motionBlurEnabled&&!v;var y=f;n||(e.prevPxRatio!==l&&(e.invalidateContainerClientCoordsCache(),e.matchCanvasSize(e.container),e.redrawHint("eles",!0),e.redrawHint("drag",!0)),e.prevPxRatio=l),!n&&e.motionBlurTimeout&&clearTimeout(e.motionBlurTimeout),f&&(e.mbFrames==null&&(e.mbFrames=0),e.mbFrames++,e.mbFrames<3&&(y=!1),e.mbFrames>e.minMbLowQualFrames&&(e.motionBlurPxRatio=e.mbPxRBlurry)),e.clearingMotionBlur&&(e.motionBlurPxRatio=1),e.textureDrawLastFrame&&!d&&(h[e.NODE]=!0,h[e.SELECT_BOX]=!0);var b=r.style(),w=r.zoom(),T=s!==void 0?s:w,E=r.pan(),L={x:E.x,y:E.y},S={zoom:w,pan:{x:E.x,y:E.y}},C=e.prevViewport,A=C===void 0||S.zoom!==C.zoom||S.pan.x!==C.pan.x||S.pan.y!==C.pan.y;!A&&!(m&&!g)&&(e.motionBlurPxRatio=1),o&&(L=o),T*=l,L.x*=l,L.y*=l;var N=e.getCachedZSortedEles();function _(K,Z,X,Y,ee){var j=K.globalCompositeOperation;K.globalCompositeOperation="destination-out",e.colorFillStyle(K,255,255,255,e.motionBlurTransparency),K.fillRect(Z,X,Y,ee),K.globalCompositeOperation=j}function O(K,Z){var X,Y,ee,j;!e.clearingMotionBlur&&(K===u.bufferContexts[e.MOTIONBLUR_BUFFER_NODE]||K===u.bufferContexts[e.MOTIONBLUR_BUFFER_DRAG])?(X={x:E.x*p,y:E.y*p},Y=w*p,ee=e.canvasWidth*p,j=e.canvasHeight*p):(X=L,Y=T,ee=e.canvasWidth,j=e.canvasHeight),K.setTransform(1,0,0,1,0,0),Z==="motionBlur"?_(K,0,0,ee,j):!n&&(Z===void 0||Z)&&K.clearRect(0,0,ee,j),i||(K.translate(X.x,X.y),K.scale(Y,Y)),o&&K.translate(o.x,o.y),s&&K.scale(s,s)}if(d||(e.textureDrawLastFrame=!1),d){if(e.textureDrawLastFrame=!0,!e.textureCache){e.textureCache={},e.textureCache.bb=r.mutableElements().boundingBox(),e.textureCache.texture=e.data.bufferCanvases[e.TEXTURE_BUFFER];var P=e.data.bufferContexts[e.TEXTURE_BUFFER];P.setTransform(1,0,0,1,0,0),P.clearRect(0,0,e.canvasWidth*e.textureMult,e.canvasHeight*e.textureMult),e.render({forcedContext:P,drawOnlyNodeLayer:!0,forcedPxRatio:l*e.textureMult});var S=e.textureCache.viewport={zoom:r.zoom(),pan:r.pan(),width:e.canvasWidth,height:e.canvasHeight};S.mpan={x:(0-S.pan.x)/S.zoom,y:(0-S.pan.y)/S.zoom}}h[e.DRAG]=!1,h[e.NODE]=!1;var k=u.contexts[e.NODE],R=e.textureCache.texture,S=e.textureCache.viewport;k.setTransform(1,0,0,1,0,0),f?_(k,0,0,S.width,S.height):k.clearRect(0,0,S.width,S.height);var I=b.core("outside-texture-bg-color").value,M=b.core("outside-texture-bg-opacity").value;e.colorFillStyle(k,I[0],I[1],I[2],M),k.fillRect(0,0,S.width,S.height);var w=r.zoom();O(k,!1),k.clearRect(S.mpan.x,S.mpan.y,S.width/S.zoom/l,S.height/S.zoom/l),k.drawImage(R,S.mpan.x,S.mpan.y,S.width/S.zoom/l,S.height/S.zoom/l)}else e.textureOnViewport&&!n&&(e.textureCache=null);var D=r.extent(),B=e.pinching||e.hoverData.dragging||e.swipePanning||e.data.wheelZooming||e.hoverData.draggingEles||e.cy.animated(),$=e.hideEdgesOnViewport&&B,F=[];if(F[e.NODE]=!h[e.NODE]&&f&&!e.clearedForMotionBlur[e.NODE]||e.clearingMotionBlur,F[e.NODE]&&(e.clearedForMotionBlur[e.NODE]=!0),F[e.DRAG]=!h[e.DRAG]&&f&&!e.clearedForMotionBlur[e.DRAG]||e.clearingMotionBlur,F[e.DRAG]&&(e.clearedForMotionBlur[e.DRAG]=!0),h[e.NODE]||i||a||F[e.NODE]){var G=f&&!F[e.NODE]&&p!==1,k=n||(G?e.data.bufferContexts[e.MOTIONBLUR_BUFFER_NODE]:u.contexts[e.NODE]),W=f&&!G?"motionBlur":void 0;O(k,W),$?e.drawCachedNodes(k,N.nondrag,l,D):e.drawLayeredElements(k,N.nondrag,l,D),e.debug&&e.drawDebugPoints(k,N.nondrag),!i&&!f&&(h[e.NODE]=!1)}if(!a&&(h[e.DRAG]||i||F[e.DRAG])){var G=f&&!F[e.DRAG]&&p!==1,k=n||(G?e.data.bufferContexts[e.MOTIONBLUR_BUFFER_DRAG]:u.contexts[e.DRAG]);O(k,f&&!G?"motionBlur":void 0),$?e.drawCachedNodes(k,N.drag,l,D):e.drawCachedElements(k,N.drag,l,D),e.debug&&e.drawDebugPoints(k,N.drag),!i&&!f&&(h[e.DRAG]=!1)}if(this.drawSelectionRectangle(t,O),f&&p!==1){var J=u.contexts[e.NODE],q=e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_NODE],ne=u.contexts[e.DRAG],ae=e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_DRAG],pe=function(Z,X,Y){Z.setTransform(1,0,0,1,0,0),Y||!y?Z.clearRect(0,0,e.canvasWidth,e.canvasHeight):_(Z,0,0,e.canvasWidth,e.canvasHeight);var ee=p;Z.drawImage(X,0,0,e.canvasWidth*ee,e.canvasHeight*ee,0,0,e.canvasWidth,e.canvasHeight)};(h[e.NODE]||F[e.NODE])&&(pe(J,q,F[e.NODE]),h[e.NODE]=!1),(h[e.DRAG]||F[e.DRAG])&&(pe(ne,ae,F[e.DRAG]),h[e.DRAG]=!1)}e.prevViewport=S,e.clearingMotionBlur&&(e.clearingMotionBlur=!1,e.motionBlurCleared=!0,e.motionBlur=!0),f&&(e.motionBlurTimeout=setTimeout(function(){e.motionBlurTimeout=null,e.clearedForMotionBlur[e.NODE]=!1,e.clearedForMotionBlur[e.DRAG]=!1,e.motionBlur=!1,e.clearingMotionBlur=!d,e.mbFrames=0,h[e.NODE]=!0,h[e.DRAG]=!0,e.redraw()},nbe)),n||r.emit("render")};var lf;Qi.drawSelectionRectangle=function(t,e){var r=this,n=r.cy,i=r.data,a=n.style(),s=t.drawOnlyNodeLayer,o=t.drawAllLayers,l=i.canvasNeedsRedraw,u=t.forcedContext;if(r.showFps||!s&&l[r.SELECT_BOX]&&!o){var h=u||i.contexts[r.SELECT_BOX];if(e(h),r.selection[4]==1&&(r.hoverData.selecting||r.touchData.selecting)){var d=r.cy.zoom(),f=a.core("selection-box-border-width").value/d;h.lineWidth=f,h.fillStyle="rgba("+a.core("selection-box-color").value[0]+","+a.core("selection-box-color").value[1]+","+a.core("selection-box-color").value[2]+","+a.core("selection-box-opacity").value+")",h.fillRect(r.selection[0],r.selection[1],r.selection[2]-r.selection[0],r.selection[3]-r.selection[1]),f>0&&(h.strokeStyle="rgba("+a.core("selection-box-border-color").value[0]+","+a.core("selection-box-border-color").value[1]+","+a.core("selection-box-border-color").value[2]+","+a.core("selection-box-opacity").value+")",h.strokeRect(r.selection[0],r.selection[1],r.selection[2]-r.selection[0],r.selection[3]-r.selection[1]))}if(i.bgActivePosistion&&!r.hoverData.selecting){var d=r.cy.zoom(),p=i.bgActivePosistion;h.fillStyle="rgba("+a.core("active-bg-color").value[0]+","+a.core("active-bg-color").value[1]+","+a.core("active-bg-color").value[2]+","+a.core("active-bg-opacity").value+")",h.beginPath(),h.arc(p.x,p.y,a.core("active-bg-size").pfValue/d,0,2*Math.PI),h.fill()}var g=r.lastRedrawTime;if(r.showFps&&g){g=Math.round(g);var m=Math.round(1e3/g),v="1 frame = "+g+" ms = "+m+" fps";if(h.setTransform(1,0,0,1,0,0),h.fillStyle="rgba(255, 0, 0, 0.75)",h.strokeStyle="rgba(255, 0, 0, 0.75)",h.font="30px Arial",!lf){var y=h.measureText(v);lf=y.actualBoundingBoxAscent}h.fillText(v,0,lf);var b=60;h.strokeRect(0,lf+10,250,20),h.fillRect(0,lf+10,250*Math.min(m/b,1),20)}o||(l[r.SELECT_BOX]=!1)}};function J_(t,e,r){var n=t.createShader(e);if(t.shaderSource(n,r),t.compileShader(n),!t.getShaderParameter(n,t.COMPILE_STATUS))throw new Error(t.getShaderInfoLog(n));return n}function ibe(t,e,r){var n=J_(t,t.VERTEX_SHADER,e),i=J_(t,t.FRAGMENT_SHADER,r),a=t.createProgram();if(t.attachShader(a,n),t.attachShader(a,i),t.linkProgram(a),!t.getProgramParameter(a,t.LINK_STATUS))throw new Error("Could not initialize shaders");return a}function abe(t,e,r){r===void 0&&(r=e);var n=t.makeOffscreenCanvas(e,r),i=n.context=n.getContext("2d");return n.clear=function(){return i.clearRect(0,0,n.width,n.height)},n.clear(),n}function uk(t){var e=t.pixelRatio,r=t.cy.zoom(),n=t.cy.pan();return{zoom:r*e,pan:{x:n.x*e,y:n.y*e}}}function sbe(t){var e=t.pixelRatio,r=t.cy.zoom();return r*e}function obe(t,e,r,n,i){var a=n*r+e.x,s=i*r+e.y;return s=Math.round(t.canvasHeight-s),[a,s]}function lbe(t){return t.pstyle("background-fill").value!=="solid"||t.pstyle("background-image").strValue!=="none"?!1:t.pstyle("border-width").value===0||t.pstyle("border-opacity").value===0?!0:t.pstyle("border-style").value==="solid"}function cbe(t,e){if(t.length!==e.length)return!1;for(var r=0;r<t.length;r++)if(t[r]!==e[r])return!1;return!0}function _c(t,e,r){var n=t[0]/255,i=t[1]/255,a=t[2]/255,s=e,o=r||new Array(4);return o[0]=n*s,o[1]=i*s,o[2]=a*s,o[3]=s,o}function th(t,e){var r=e||new Array(4);return r[0]=(t>>0&255)/255,r[1]=(t>>8&255)/255,r[2]=(t>>16&255)/255,r[3]=(t>>24&255)/255,r}function ube(t){return t[0]+(t[1]<<8)+(t[2]<<16)+(t[3]<<24)}function hbe(t,e){var r=t.createTexture();return r.buffer=function(n){t.bindTexture(t.TEXTURE_2D,r),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR_MIPMAP_NEAREST),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,n),t.generateMipmap(t.TEXTURE_2D),t.bindTexture(t.TEXTURE_2D,null)},r.deleteTexture=function(){t.deleteTexture(r)},r}function IV(t,e){switch(e){case"float":return[1,t.FLOAT,4];case"vec2":return[2,t.FLOAT,4];case"vec3":return[3,t.FLOAT,4];case"vec4":return[4,t.FLOAT,4];case"int":return[1,t.INT,4];case"ivec2":return[2,t.INT,4]}}function OV(t,e,r){switch(e){case t.FLOAT:return new Float32Array(r);case t.INT:return new Int32Array(r)}}function dbe(t,e,r,n,i,a){switch(e){case t.FLOAT:return new Float32Array(r.buffer,a*n,i);case t.INT:return new Int32Array(r.buffer,a*n,i)}}function fbe(t,e,r,n){var i=IV(t,e),a=Tn(i,2),s=a[0],o=a[1],l=OV(t,o,n),u=t.createBuffer();return t.bindBuffer(t.ARRAY_BUFFER,u),t.bufferData(t.ARRAY_BUFFER,l,t.STATIC_DRAW),o===t.FLOAT?t.vertexAttribPointer(r,s,o,!1,0,0):o===t.INT&&t.vertexAttribIPointer(r,s,o,0,0),t.enableVertexAttribArray(r),t.bindBuffer(t.ARRAY_BUFFER,null),u}function Ds(t,e,r,n){var i=IV(t,r),a=Tn(i,3),s=a[0],o=a[1],l=a[2],u=OV(t,o,e*s),h=s*l,d=t.createBuffer();t.bindBuffer(t.ARRAY_BUFFER,d),t.bufferData(t.ARRAY_BUFFER,e*h,t.DYNAMIC_DRAW),t.enableVertexAttribArray(n),o===t.FLOAT?t.vertexAttribPointer(n,s,o,!1,h,0):o===t.INT&&t.vertexAttribIPointer(n,s,o,h,0),t.vertexAttribDivisor(n,1),t.bindBuffer(t.ARRAY_BUFFER,null);for(var f=new Array(e),p=0;p<e;p++)f[p]=dbe(t,o,u,h,s,p);return d.dataArray=u,d.stride=h,d.size=s,d.getView=function(g){return f[g]},d.setPoint=function(g,m,v){var y=f[g];y[0]=m,y[1]=v},d.bufferSubData=function(g){t.bindBuffer(t.ARRAY_BUFFER,d),g?t.bufferSubData(t.ARRAY_BUFFER,0,u,0,g*s):t.bufferSubData(t.ARRAY_BUFFER,0,u)},d}function pbe(t,e,r){for(var n=9,i=new Float32Array(e*n),a=new Array(e),s=0;s<e;s++){var o=s*n*4;a[s]=new Float32Array(i.buffer,o,n)}var l=t.createBuffer();t.bindBuffer(t.ARRAY_BUFFER,l),t.bufferData(t.ARRAY_BUFFER,i.byteLength,t.DYNAMIC_DRAW);for(var u=0;u<3;u++){var h=r+u;t.enableVertexAttribArray(h),t.vertexAttribPointer(h,3,t.FLOAT,!1,3*12,u*12),t.vertexAttribDivisor(h,1)}return t.bindBuffer(t.ARRAY_BUFFER,null),l.getMatrixView=function(d){return a[d]},l.setData=function(d,f){a[f].set(d,0)},l.bufferSubData=function(){t.bindBuffer(t.ARRAY_BUFFER,l),t.bufferSubData(t.ARRAY_BUFFER,0,i)},l}function gbe(t){var e=t.createFramebuffer();t.bindFramebuffer(t.FRAMEBUFFER,e);var r=t.createTexture();return t.bindTexture(t.TEXTURE_2D,r),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,r,0),t.bindFramebuffer(t.FRAMEBUFFER,null),e.setFramebufferAttachmentSizes=function(n,i){t.bindTexture(t.TEXTURE_2D,r),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,n,i,0,t.RGBA,t.UNSIGNED_BYTE,null)},e}var e9=typeof Float32Array<"u"?Float32Array:Array;Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});function X4(){var t=new e9(9);return e9!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}function t9(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function mbe(t,e,r){var n=e[0],i=e[1],a=e[2],s=e[3],o=e[4],l=e[5],u=e[6],h=e[7],d=e[8],f=r[0],p=r[1],g=r[2],m=r[3],v=r[4],y=r[5],b=r[6],w=r[7],T=r[8];return t[0]=f*n+p*s+g*u,t[1]=f*i+p*o+g*h,t[2]=f*a+p*l+g*d,t[3]=m*n+v*s+y*u,t[4]=m*i+v*o+y*h,t[5]=m*a+v*l+y*d,t[6]=b*n+w*s+T*u,t[7]=b*i+w*o+T*h,t[8]=b*a+w*l+T*d,t}function cm(t,e,r){var n=e[0],i=e[1],a=e[2],s=e[3],o=e[4],l=e[5],u=e[6],h=e[7],d=e[8],f=r[0],p=r[1];return t[0]=n,t[1]=i,t[2]=a,t[3]=s,t[4]=o,t[5]=l,t[6]=f*n+p*s+u,t[7]=f*i+p*o+h,t[8]=f*a+p*l+d,t}function r9(t,e,r){var n=e[0],i=e[1],a=e[2],s=e[3],o=e[4],l=e[5],u=e[6],h=e[7],d=e[8],f=Math.sin(r),p=Math.cos(r);return t[0]=p*n+f*s,t[1]=p*i+f*o,t[2]=p*a+f*l,t[3]=p*s-f*n,t[4]=p*o-f*i,t[5]=p*l-f*a,t[6]=u,t[7]=h,t[8]=d,t}function xw(t,e,r){var n=r[0],i=r[1];return t[0]=n*e[0],t[1]=n*e[1],t[2]=n*e[2],t[3]=i*e[3],t[4]=i*e[4],t[5]=i*e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function vbe(t,e,r){return t[0]=2/e,t[1]=0,t[2]=0,t[3]=0,t[4]=-2/r,t[5]=0,t[6]=-1,t[7]=1,t[8]=1,t}var ybe=function(){function t(e,r,n,i){ac(this,t),this.debugID=Math.floor(Math.random()*1e4),this.r=e,this.texSize=r,this.texRows=n,this.texHeight=Math.floor(r/n),this.enableWrapping=!0,this.locked=!1,this.texture=null,this.needsBuffer=!0,this.freePointer={x:0,row:0},this.keyToLocation=new Map,this.canvas=i(e,r,r),this.scratch=i(e,r,this.texHeight,"scratch")}return sc(t,[{key:"lock",value:function(){this.locked=!0}},{key:"getKeys",value:function(){return new Set(this.keyToLocation.keys())}},{key:"getScale",value:function(r){var n=r.w,i=r.h,a=this.texHeight,s=this.texSize,o=a/i,l=n*o,u=i*o;return l>s&&(o=s/n,l=n*o,u=i*o),{scale:o,texW:l,texH:u}}},{key:"draw",value:function(r,n,i){var a=this;if(this.locked)throw new Error("can't draw, atlas is locked");var s=this.texSize,o=this.texRows,l=this.texHeight,u=this.getScale(n),h=u.scale,d=u.texW,f=u.texH,p=function(w,T){if(i&&T){var E=T.context,L=w.x,S=w.row,C=L,A=l*S;E.save(),E.translate(C,A),E.scale(h,h),i(E,n),E.restore()}},g=[null,null],m=function(){p(a.freePointer,a.canvas),g[0]={x:a.freePointer.x,y:a.freePointer.row*l,w:d,h:f},g[1]={x:a.freePointer.x+d,y:a.freePointer.row*l,w:0,h:f},a.freePointer.x+=d,a.freePointer.x==s&&(a.freePointer.x=0,a.freePointer.row++)},v=function(){var w=a.scratch,T=a.canvas;w.clear(),p({x:0,row:0},w);var E=s-a.freePointer.x,L=d-E,S=l;{var C=a.freePointer.x,A=a.freePointer.row*l,N=E;T.context.drawImage(w,0,0,N,S,C,A,N,S),g[0]={x:C,y:A,w:N,h:f}}{var _=E,O=(a.freePointer.row+1)*l,P=L;T&&T.context.drawImage(w,_,0,P,S,0,O,P,S),g[1]={x:0,y:O,w:P,h:f}}a.freePointer.x=L,a.freePointer.row++},y=function(){a.freePointer.x=0,a.freePointer.row++};if(this.freePointer.x+d<=s)m();else{if(this.freePointer.row>=o-1)return!1;this.freePointer.x===s?(y(),m()):this.enableWrapping?v():(y(),m())}return this.keyToLocation.set(r,g),this.needsBuffer=!0,g}},{key:"getOffsets",value:function(r){return this.keyToLocation.get(r)}},{key:"isEmpty",value:function(){return this.freePointer.x===0&&this.freePointer.row===0}},{key:"canFit",value:function(r){if(this.locked)return!1;var n=this.texSize,i=this.texRows,a=this.getScale(r),s=a.texW;return this.freePointer.x+s>n?this.freePointer.row<i-1:!0}},{key:"bufferIfNeeded",value:function(r){this.texture||(this.texture=hbe(r,this.debugID)),this.needsBuffer&&(this.texture.buffer(this.canvas),this.needsBuffer=!1,this.locked&&(this.canvas=null,this.scratch=null))}},{key:"dispose",value:function(){this.texture&&(this.texture.deleteTexture(),this.texture=null),this.canvas=null,this.scratch=null,this.locked=!0}}])}(),xbe=function(){function t(e,r,n,i){ac(this,t),this.r=e,this.texSize=r,this.texRows=n,this.createTextureCanvas=i,this.atlases=[],this.styleKeyToAtlas=new Map,this.markedKeys=new Set}return sc(t,[{key:"getKeys",value:function(){return new Set(this.styleKeyToAtlas.keys())}},{key:"_createAtlas",value:function(){var r=this.r,n=this.texSize,i=this.texRows,a=this.createTextureCanvas;return new ybe(r,n,i,a)}},{key:"_getScratchCanvas",value:function(){if(!this.scratch){var r=this.r,n=this.texSize,i=this.texRows,a=this.createTextureCanvas,s=Math.floor(n/i);this.scratch=a(r,n,s,"scratch")}return this.scratch}},{key:"draw",value:function(r,n,i){var a=this.styleKeyToAtlas.get(r);return a||(a=this.atlases[this.atlases.length-1],(!a||!a.canFit(n))&&(a&&a.lock(),a=this._createAtlas(),this.atlases.push(a)),a.draw(r,n,i),this.styleKeyToAtlas.set(r,a)),a}},{key:"getAtlas",value:function(r){return this.styleKeyToAtlas.get(r)}},{key:"hasAtlas",value:function(r){return this.styleKeyToAtlas.has(r)}},{key:"markKeyForGC",value:function(r){this.markedKeys.add(r)}},{key:"gc",value:function(){var r=this,n=this.markedKeys;if(n.size===0){console.log("nothing to garbage collect");return}var i=[],a=new Map,s=null,o=la(this.atlases),l;try{var u=function(){var d=l.value,f=d.getKeys(),p=bbe(n,f);if(p.size===0)return i.push(d),f.forEach(function(E){return a.set(E,d)}),1;s||(s=r._createAtlas(),i.push(s));var g=la(f),m;try{for(g.s();!(m=g.n()).done;){var v=m.value;if(!p.has(v)){var y=d.getOffsets(v),b=Tn(y,2),w=b[0],T=b[1];s.canFit({w:w.w+T.w,h:w.h})||(s.lock(),s=r._createAtlas(),i.push(s)),d.canvas&&(r._copyTextureToNewAtlas(v,d,s),a.set(v,s))}}}catch(E){g.e(E)}finally{g.f()}d.dispose()};for(o.s();!(l=o.n()).done;)u()}catch(h){o.e(h)}finally{o.f()}this.atlases=i,this.styleKeyToAtlas=a,this.markedKeys=new Set}},{key:"_copyTextureToNewAtlas",value:function(r,n,i){var a=n.getOffsets(r),s=Tn(a,2),o=s[0],l=s[1];if(l.w===0)i.draw(r,o,function(f){f.drawImage(n.canvas,o.x,o.y,o.w,o.h,0,0,o.w,o.h)});else{var u=this._getScratchCanvas();u.clear(),u.context.drawImage(n.canvas,o.x,o.y,o.w,o.h,0,0,o.w,o.h),u.context.drawImage(n.canvas,l.x,l.y,l.w,l.h,o.w,0,l.w,l.h);var h=o.w+l.w,d=o.h;i.draw(r,{w:h,h:d},function(f){f.drawImage(u,0,0,h,d,0,0,h,d)})}}},{key:"getCounts",value:function(){return{keyCount:this.styleKeyToAtlas.size,atlasCount:new Set(this.styleKeyToAtlas.values()).size}}}])}();function bbe(t,e){return t.intersection?t.intersection(e):new Set(Nv(t).filter(function(r){return e.has(r)}))}var wbe=function(){function t(e,r){ac(this,t),this.r=e,this.globalOptions=r,this.atlasSize=r.webglTexSize,this.maxAtlasesPerBatch=r.webglTexPerBatch,this.renderTypes=new Map,this.collections=new Map,this.typeAndIdToKey=new Map}return sc(t,[{key:"getAtlasSize",value:function(){return this.atlasSize}},{key:"addAtlasCollection",value:function(r,n){var i=this.globalOptions,a=i.webglTexSize,s=i.createTextureCanvas,o=n.texRows,l=this._cacheScratchCanvas(s),u=new xbe(this.r,a,o,l);this.collections.set(r,u)}},{key:"addRenderType",value:function(r,n){var i=n.collection;if(!this.collections.has(i))throw new Error("invalid atlas collection name '".concat(i,"'"));var a=this.collections.get(i),s=Gt({type:r,atlasCollection:a},n);this.renderTypes.set(r,s)}},{key:"getRenderTypeOpts",value:function(r){return this.renderTypes.get(r)}},{key:"getAtlasCollection",value:function(r){return this.collections.get(r)}},{key:"_cacheScratchCanvas",value:function(r){var n=-1,i=-1,a=null;return function(s,o,l,u){return u?((!a||o!=n||l!=i)&&(n=o,i=l,a=r(s,o,l)),a):r(s,o,l)}}},{key:"_key",value:function(r,n){return"".concat(r,"-").concat(n)}},{key:"invalidate",value:function(r){var n=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=i.forceRedraw,s=a===void 0?!1:a,o=i.filterEle,l=o===void 0?function(){return!0}:o,u=i.filterType,h=u===void 0?function(){return!0}:u,d=!1,f=!1,p=la(r),g;try{for(p.s();!(g=p.n()).done;){var m=g.value;if(l(m)){var v=la(this.renderTypes.values()),y;try{var b=function(){var T=y.value,E=T.type;if(h(E)){var L=n.collections.get(T.collection),S=T.getKey(m),C=Array.isArray(S)?S:[S];if(s)C.forEach(function(O){return L.markKeyForGC(O)}),f=!0;else{var A=T.getID?T.getID(m):m.id(),N=n._key(E,A),_=n.typeAndIdToKey.get(N);_!==void 0&&!cbe(C,_)&&(d=!0,n.typeAndIdToKey.delete(N),_.forEach(function(O){return L.markKeyForGC(O)}))}}};for(v.s();!(y=v.n()).done;)b()}catch(w){v.e(w)}finally{v.f()}}}}catch(w){p.e(w)}finally{p.f()}return f&&(this.gc(),d=!1),d}},{key:"gc",value:function(){var r=la(this.collections.values()),n;try{for(r.s();!(n=r.n()).done;){var i=n.value;i.gc()}}catch(a){r.e(a)}finally{r.f()}}},{key:"getOrCreateAtlas",value:function(r,n,i,a){var s=this.renderTypes.get(n),o=this.collections.get(s.collection),l=!1,u=o.draw(a,i,function(f){s.drawClipped?(f.save(),f.beginPath(),f.rect(0,0,i.w,i.h),f.clip(),s.drawElement(f,r,i,!0,!0),f.restore()):s.drawElement(f,r,i,!0,!0),l=!0});if(l){var h=s.getID?s.getID(r):r.id(),d=this._key(n,h);this.typeAndIdToKey.has(d)?this.typeAndIdToKey.get(d).push(a):this.typeAndIdToKey.set(d,[a])}return u}},{key:"getAtlasInfo",value:function(r,n){var i=this,a=this.renderTypes.get(n),s=a.getKey(r),o=Array.isArray(s)?s:[s];return o.map(function(l){var u=a.getBoundingBox(r,l),h=i.getOrCreateAtlas(r,n,u,l),d=h.getOffsets(l),f=Tn(d,2),p=f[0],g=f[1];return{atlas:h,tex:p,tex1:p,tex2:g,bb:u}})}},{key:"getDebugInfo",value:function(){var r=[],n=la(this.collections),i;try{for(n.s();!(i=n.n()).done;){var a=Tn(i.value,2),s=a[0],o=a[1],l=o.getCounts(),u=l.keyCount,h=l.atlasCount;r.push({type:s,keyCount:u,atlasCount:h})}}catch(d){n.e(d)}finally{n.f()}return r}}])}(),Tbe=function(){function t(e){ac(this,t),this.globalOptions=e,this.atlasSize=e.webglTexSize,this.maxAtlasesPerBatch=e.webglTexPerBatch,this.batchAtlases=[]}return sc(t,[{key:"getMaxAtlasesPerBatch",value:function(){return this.maxAtlasesPerBatch}},{key:"getAtlasSize",value:function(){return this.atlasSize}},{key:"getIndexArray",value:function(){return Array.from({length:this.maxAtlasesPerBatch},function(r,n){return n})}},{key:"startBatch",value:function(){this.batchAtlases=[]}},{key:"getAtlasCount",value:function(){return this.batchAtlases.length}},{key:"getAtlases",value:function(){return this.batchAtlases}},{key:"canAddToCurrentBatch",value:function(r){return this.batchAtlases.length===this.maxAtlasesPerBatch?this.batchAtlases.includes(r):!0}},{key:"getAtlasIndexForBatch",value:function(r){var n=this.batchAtlases.indexOf(r);if(n<0){if(this.batchAtlases.length===this.maxAtlasesPerBatch)throw new Error("cannot add more atlases to batch");this.batchAtlases.push(r),n=this.batchAtlases.length-1}return n}}])}(),Ebe=`
  float circleSD(vec2 p, float r) {
    return distance(vec2(0), p) - r; // signed distance
  }
`,kbe=`
  float rectangleSD(vec2 p, vec2 b) {
    vec2 d = abs(p)-b;
    return distance(vec2(0),max(d,0.0)) + min(max(d.x,d.y),0.0);
  }
`,Sbe=`
  float roundRectangleSD(vec2 p, vec2 b, vec4 cr) {
    cr.xy = (p.x > 0.0) ? cr.xy : cr.zw;
    cr.x  = (p.y > 0.0) ? cr.x  : cr.y;
    vec2 q = abs(p) - b + cr.x;
    return min(max(q.x, q.y), 0.0) + distance(vec2(0), max(q, 0.0)) - cr.x;
  }
`,Cbe=`
  float ellipseSD(vec2 p, vec2 ab) {
    p = abs( p ); // symmetry

    // find root with Newton solver
    vec2 q = ab*(p-ab);
    float w = (q.x<q.y)? 1.570796327 : 0.0;
    for( int i=0; i<5; i++ ) {
      vec2 cs = vec2(cos(w),sin(w));
      vec2 u = ab*vec2( cs.x,cs.y);
      vec2 v = ab*vec2(-cs.y,cs.x);
      w = w + dot(p-u,v)/(dot(p-u,u)+dot(v,v));
    }
    
    // compute final point and distance
    float d = length(p-ab*vec2(cos(w),sin(w)));
    
    // return signed distance
    return (dot(p/ab,p/ab)>1.0) ? d : -d;
  }
`,L0={SCREEN:{name:"screen",screen:!0},PICKING:{name:"picking",picking:!0}},Uv={IGNORE:1,USE_BB:2},j4=0,n9=1,i9=2,K4=3,rh=4,s1=5,cf=6,uf=7,Abe=function(){function t(e,r,n){ac(this,t),this.r=e,this.gl=r,this.maxInstances=n.webglBatchSize,this.atlasSize=n.webglTexSize,this.bgColor=n.bgColor,this.debug=n.webglDebug,this.batchDebugInfo=[],n.enableWrapping=!0,n.createTextureCanvas=abe,this.atlasManager=new wbe(e,n),this.batchManager=new Tbe(n),this.simpleShapeOptions=new Map,this.program=this._createShaderProgram(L0.SCREEN),this.pickingProgram=this._createShaderProgram(L0.PICKING),this.vao=this._createVAO()}return sc(t,[{key:"addAtlasCollection",value:function(r,n){this.atlasManager.addAtlasCollection(r,n)}},{key:"addTextureAtlasRenderType",value:function(r,n){this.atlasManager.addRenderType(r,n)}},{key:"addSimpleShapeRenderType",value:function(r,n){this.simpleShapeOptions.set(r,n)}},{key:"invalidate",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=n.type,a=this.atlasManager;return i?a.invalidate(r,{filterType:function(o){return o===i},forceRedraw:!0}):a.invalidate(r)}},{key:"gc",value:function(){this.atlasManager.gc()}},{key:"_createShaderProgram",value:function(r){var n=this.gl,i=`#version 300 es
      precision highp float;

      uniform mat3 uPanZoomMatrix;
      uniform int  uAtlasSize;
      
      // instanced
      in vec2 aPosition; // a vertex from the unit square
      
      in mat3 aTransform; // used to transform verticies, eg into a bounding box
      in int aVertType; // the type of thing we are rendering

      // the z-index that is output when using picking mode
      in vec4 aIndex;
      
      // For textures
      in int aAtlasId; // which shader unit/atlas to use
      in vec4 aTex; // x/y/w/h of texture in atlas

      // for edges
      in vec4 aPointAPointB;
      in vec4 aPointCPointD;
      in vec2 aLineWidth; // also used for node border width

      // simple shapes
      in vec4 aCornerRadius; // for round-rectangle [top-right, bottom-right, top-left, bottom-left]
      in vec4 aColor; // also used for edges
      in vec4 aBorderColor; // aLineWidth is used for border width

      // output values passed to the fragment shader
      out vec2 vTexCoord;
      out vec4 vColor;
      out vec2 vPosition;
      // flat values are not interpolated
      flat out int vAtlasId; 
      flat out int vVertType;
      flat out vec2 vTopRight;
      flat out vec2 vBotLeft;
      flat out vec4 vCornerRadius;
      flat out vec4 vBorderColor;
      flat out vec2 vBorderWidth;
      flat out vec4 vIndex;
      
      void main(void) {
        int vid = gl_VertexID;
        vec2 position = aPosition; // TODO make this a vec3, simplifies some code below

        if(aVertType == `.concat(j4,`) {
          float texX = aTex.x; // texture coordinates
          float texY = aTex.y;
          float texW = aTex.z;
          float texH = aTex.w;

          if(vid == 1 || vid == 2 || vid == 4) {
            texX += texW;
          }
          if(vid == 2 || vid == 4 || vid == 5) {
            texY += texH;
          }

          float d = float(uAtlasSize);
          vTexCoord = vec2(texX / d, texY / d); // tex coords must be between 0 and 1

          gl_Position = vec4(uPanZoomMatrix * aTransform * vec3(position, 1.0), 1.0);
        }
        else if(aVertType == `).concat(rh," || aVertType == ").concat(uf,` 
             || aVertType == `).concat(s1," || aVertType == ").concat(cf,`) { // simple shapes

          // the bounding box is needed by the fragment shader
          vBotLeft  = (aTransform * vec3(0, 0, 1)).xy; // flat
          vTopRight = (aTransform * vec3(1, 1, 1)).xy; // flat
          vPosition = (aTransform * vec3(position, 1)).xy; // will be interpolated

          // calculations are done in the fragment shader, just pass these along
          vColor = aColor;
          vCornerRadius = aCornerRadius;
          vBorderColor = aBorderColor;
          vBorderWidth = aLineWidth;

          gl_Position = vec4(uPanZoomMatrix * aTransform * vec3(position, 1.0), 1.0);
        }
        else if(aVertType == `).concat(n9,`) {
          vec2 source = aPointAPointB.xy;
          vec2 target = aPointAPointB.zw;

          // adjust the geometry so that the line is centered on the edge
          position.y = position.y - 0.5;

          // stretch the unit square into a long skinny rectangle
          vec2 xBasis = target - source;
          vec2 yBasis = normalize(vec2(-xBasis.y, xBasis.x));
          vec2 point = source + xBasis * position.x + yBasis * aLineWidth[0] * position.y;

          gl_Position = vec4(uPanZoomMatrix * vec3(point, 1.0), 1.0);
          vColor = aColor;
        } 
        else if(aVertType == `).concat(i9,`) {
          vec2 pointA = aPointAPointB.xy;
          vec2 pointB = aPointAPointB.zw;
          vec2 pointC = aPointCPointD.xy;
          vec2 pointD = aPointCPointD.zw;

          // adjust the geometry so that the line is centered on the edge
          position.y = position.y - 0.5;

          vec2 p0, p1, p2, pos;
          if(position.x == 0.0) { // The left side of the unit square
            p0 = pointA;
            p1 = pointB;
            p2 = pointC;
            pos = position;
          } else { // The right side of the unit square, use same approach but flip the geometry upside down
            p0 = pointD;
            p1 = pointC;
            p2 = pointB;
            pos = vec2(0.0, -position.y);
          }

          vec2 p01 = p1 - p0;
          vec2 p12 = p2 - p1;
          vec2 p21 = p1 - p2;

          // Find the normal vector.
          vec2 tangent = normalize(normalize(p12) + normalize(p01));
          vec2 normal = vec2(-tangent.y, tangent.x);

          // Find the vector perpendicular to p0 -> p1.
          vec2 p01Norm = normalize(vec2(-p01.y, p01.x));

          // Determine the bend direction.
          float sigma = sign(dot(p01 + p21, normal));
          float width = aLineWidth[0];

          if(sign(pos.y) == -sigma) {
            // This is an intersecting vertex. Adjust the position so that there's no overlap.
            vec2 point = 0.5 * width * normal * -sigma / dot(normal, p01Norm);
            gl_Position = vec4(uPanZoomMatrix * vec3(p1 + point, 1.0), 1.0);
          } else {
            // This is a non-intersecting vertex. Treat it like a mitre join.
            vec2 point = 0.5 * width * normal * sigma * dot(normal, p01Norm);
            gl_Position = vec4(uPanZoomMatrix * vec3(p1 + point, 1.0), 1.0);
          }

          vColor = aColor;
        } 
        else if(aVertType == `).concat(K4,` && vid < 3) {
          // massage the first triangle into an edge arrow
          if(vid == 0)
            position = vec2(-0.15, -0.3);
          if(vid == 1)
            position = vec2(  0.0,  0.0);
          if(vid == 2)
            position = vec2( 0.15, -0.3);

          gl_Position = vec4(uPanZoomMatrix * aTransform * vec3(position, 1.0), 1.0);
          vColor = aColor;
        }
        else {
          gl_Position = vec4(2.0, 0.0, 0.0, 1.0); // discard vertex by putting it outside webgl clip space
        }

        vAtlasId = aAtlasId;
        vVertType = aVertType;
        vIndex = aIndex;
      }
    `),a=this.batchManager.getIndexArray(),s=`#version 300 es
      precision highp float;

      // declare texture unit for each texture atlas in the batch
      `.concat(a.map(function(u){return"uniform sampler2D uTexture".concat(u,";")}).join(`
	`),`

      uniform vec4 uBGColor;
      uniform float uZoom;

      in vec2 vTexCoord;
      in vec4 vColor;
      in vec2 vPosition; // model coordinates

      flat in int vAtlasId;
      flat in vec4 vIndex;
      flat in int vVertType;
      flat in vec2 vTopRight;
      flat in vec2 vBotLeft;
      flat in vec4 vCornerRadius;
      flat in vec4 vBorderColor;
      flat in vec2 vBorderWidth;

      out vec4 outColor;

      `).concat(Ebe,`
      `).concat(kbe,`
      `).concat(Sbe,`
      `).concat(Cbe,`

      vec4 blend(vec4 top, vec4 bot) { // blend colors with premultiplied alpha
        return vec4( 
          top.rgb + (bot.rgb * (1.0 - top.a)),
          top.a   + (bot.a   * (1.0 - top.a)) 
        );
      }

      vec4 distInterp(vec4 cA, vec4 cB, float d) { // interpolate color using Signed Distance
        // scale to the zoom level so that borders don't look blurry when zoomed in
        // note 1.5 is an aribitrary value chosen because it looks good
        return mix(cA, cB, 1.0 - smoothstep(0.0, 1.5 / uZoom, abs(d))); 
      }

      void main(void) {
        if(vVertType == `).concat(j4,`) {
          // look up the texel from the texture unit
          `).concat(a.map(function(u){return"if(vAtlasId == ".concat(u,") outColor = texture(uTexture").concat(u,", vTexCoord);")}).join(`
	else `),`
        } 
        else if(vVertType == `).concat(K4,`) {
          // mimics how canvas renderer uses context.globalCompositeOperation = 'destination-out';
          outColor = blend(vColor, uBGColor);
          outColor.a = 1.0; // make opaque, masks out line under arrow
        }
        else if(vVertType == `).concat(rh,` && vBorderWidth == vec2(0.0)) { // simple rectangle with no border
          outColor = vColor; // unit square is already transformed to the rectangle, nothing else needs to be done
        }
        else if(vVertType == `).concat(rh," || vVertType == ").concat(uf,` 
          || vVertType == `).concat(s1," || vVertType == ").concat(cf,`) { // use SDF

          float outerBorder = vBorderWidth[0];
          float innerBorder = vBorderWidth[1];
          float borderPadding = outerBorder * 2.0;
          float w = vTopRight.x - vBotLeft.x - borderPadding;
          float h = vTopRight.y - vBotLeft.y - borderPadding;
          vec2 b = vec2(w/2.0, h/2.0); // half width, half height
          vec2 p = vPosition - vec2(vTopRight.x - b[0] - outerBorder, vTopRight.y - b[1] - outerBorder); // translate to center

          float d; // signed distance
          if(vVertType == `).concat(rh,`) {
            d = rectangleSD(p, b);
          } else if(vVertType == `).concat(uf,` && w == h) {
            d = circleSD(p, b.x); // faster than ellipse
          } else if(vVertType == `).concat(uf,`) {
            d = ellipseSD(p, b);
          } else {
            d = roundRectangleSD(p, b, vCornerRadius.wzyx);
          }

          // use the distance to interpolate a color to smooth the edges of the shape, doesn't need multisampling
          // we must smooth colors inwards, because we can't change pixels outside the shape's bounding box
          if(d > 0.0) {
            if(d > outerBorder) {
              discard;
            } else {
              outColor = distInterp(vBorderColor, vec4(0), d - outerBorder);
            }
          } else {
            if(d > innerBorder) {
              vec4 outerColor = outerBorder == 0.0 ? vec4(0) : vBorderColor;
              vec4 innerBorderColor = blend(vBorderColor, vColor);
              outColor = distInterp(innerBorderColor, outerColor, d);
            } 
            else {
              vec4 outerColor;
              if(innerBorder == 0.0 && outerBorder == 0.0) {
                outerColor = vec4(0);
              } else if(innerBorder == 0.0) {
                outerColor = vBorderColor;
              } else {
                outerColor = blend(vBorderColor, vColor);
              }
              outColor = distInterp(vColor, outerColor, d - innerBorder);
            }
          }
        }
        else {
          outColor = vColor;
        }

        `).concat(r.picking?`if(outColor.a == 0.0) discard;
             else outColor = vIndex;`:"",`
      }
    `),o=ibe(n,i,s);o.aPosition=n.getAttribLocation(o,"aPosition"),o.aIndex=n.getAttribLocation(o,"aIndex"),o.aVertType=n.getAttribLocation(o,"aVertType"),o.aTransform=n.getAttribLocation(o,"aTransform"),o.aAtlasId=n.getAttribLocation(o,"aAtlasId"),o.aTex=n.getAttribLocation(o,"aTex"),o.aPointAPointB=n.getAttribLocation(o,"aPointAPointB"),o.aPointCPointD=n.getAttribLocation(o,"aPointCPointD"),o.aLineWidth=n.getAttribLocation(o,"aLineWidth"),o.aColor=n.getAttribLocation(o,"aColor"),o.aCornerRadius=n.getAttribLocation(o,"aCornerRadius"),o.aBorderColor=n.getAttribLocation(o,"aBorderColor"),o.uPanZoomMatrix=n.getUniformLocation(o,"uPanZoomMatrix"),o.uAtlasSize=n.getUniformLocation(o,"uAtlasSize"),o.uBGColor=n.getUniformLocation(o,"uBGColor"),o.uZoom=n.getUniformLocation(o,"uZoom"),o.uTextures=[];for(var l=0;l<this.batchManager.getMaxAtlasesPerBatch();l++)o.uTextures.push(n.getUniformLocation(o,"uTexture".concat(l)));return o}},{key:"_createVAO",value:function(){var r=[0,0,1,0,1,1,0,0,1,1,0,1];this.vertexCount=r.length/2;var n=this.maxInstances,i=this.gl,a=this.program,s=i.createVertexArray();return i.bindVertexArray(s),fbe(i,"vec2",a.aPosition,r),this.transformBuffer=pbe(i,n,a.aTransform),this.indexBuffer=Ds(i,n,"vec4",a.aIndex),this.vertTypeBuffer=Ds(i,n,"int",a.aVertType),this.atlasIdBuffer=Ds(i,n,"int",a.aAtlasId),this.texBuffer=Ds(i,n,"vec4",a.aTex),this.pointAPointBBuffer=Ds(i,n,"vec4",a.aPointAPointB),this.pointCPointDBuffer=Ds(i,n,"vec4",a.aPointCPointD),this.lineWidthBuffer=Ds(i,n,"vec2",a.aLineWidth),this.colorBuffer=Ds(i,n,"vec4",a.aColor),this.cornerRadiusBuffer=Ds(i,n,"vec4",a.aCornerRadius),this.borderColorBuffer=Ds(i,n,"vec4",a.aBorderColor),i.bindVertexArray(null),s}},{key:"buffers",get:function(){var r=this;return this._buffers||(this._buffers=Object.keys(this).filter(function(n){return Tl(n,"Buffer")}).map(function(n){return r[n]})),this._buffers}},{key:"startFrame",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:L0.SCREEN;this.panZoomMatrix=r,this.renderTarget=n,this.batchDebugInfo=[],this.wrappedCount=0,this.simpleCount=0,this.startBatch()}},{key:"startBatch",value:function(){this.instanceCount=0,this.batchManager.startBatch()}},{key:"endFrame",value:function(){this.endBatch()}},{key:"_isVisible",value:function(r,n){return r.visible()?n&&n.isVisible?n.isVisible(r):!0:!1}},{key:"drawTexture",value:function(r,n,i){var a=this.atlasManager,s=this.batchManager,o=a.getRenderTypeOpts(i);if(this._isVisible(r,o)&&!(r.isEdge()&&!this._isValidEdge(r))){if(this.renderTarget.picking&&o.getTexPickingMode){var l=o.getTexPickingMode(r);if(l===Uv.IGNORE)return;if(l==Uv.USE_BB){this.drawPickingRectangle(r,n,i);return}}var u=a.getAtlasInfo(r,i),h=la(u),d;try{for(h.s();!(d=h.n()).done;){var f=d.value,p=f.atlas,g=f.tex1,m=f.tex2;s.canAddToCurrentBatch(p)||this.endBatch();for(var v=s.getAtlasIndexForBatch(p),y=0,b=[[g,!0],[m,!1]];y<b.length;y++){var w=Tn(b[y],2),T=w[0],E=w[1];if(T.w!=0){var L=this.instanceCount;this.vertTypeBuffer.getView(L)[0]=j4;var S=this.indexBuffer.getView(L);th(n,S);var C=this.atlasIdBuffer.getView(L);C[0]=v;var A=this.texBuffer.getView(L);A[0]=T.x,A[1]=T.y,A[2]=T.w,A[3]=T.h;var N=this.transformBuffer.getMatrixView(L);this.setTransformMatrix(r,N,o,f,E),this.instanceCount++,E||this.wrappedCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}}}catch(_){h.e(_)}finally{h.f()}}}},{key:"setTransformMatrix",value:function(r,n,i,a){var s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,o=0;if(i.shapeProps&&i.shapeProps.padding&&(o=r.pstyle(i.shapeProps.padding).pfValue),a){var l=a.bb,u=a.tex1,h=a.tex2,d=u.w/(u.w+h.w);s||(d=1-d);var f=this._getAdjustedBB(l,o,s,d);this._applyTransformMatrix(n,f,i,r)}else{var p=i.getBoundingBox(r),g=this._getAdjustedBB(p,o,!0,1);this._applyTransformMatrix(n,g,i,r)}}},{key:"_applyTransformMatrix",value:function(r,n,i,a){var s,o;t9(r);var l=i.getRotation?i.getRotation(a):0;if(l!==0){var u=i.getRotationPoint(a),h=u.x,d=u.y;cm(r,r,[h,d]),r9(r,r,l);var f=i.getRotationOffset(a);s=f.x+(n.xOffset||0),o=f.y+(n.yOffset||0)}else s=n.x1,o=n.y1;cm(r,r,[s,o]),xw(r,r,[n.w,n.h])}},{key:"_getAdjustedBB",value:function(r,n,i,a){var s=r.x1,o=r.y1,l=r.w,u=r.h,h=r.yOffset;n&&(s-=n,o-=n,l+=2*n,u+=2*n);var d=0,f=l*a;return i&&a<1?l=f:!i&&a<1&&(d=l-f,s+=d,l=f),{x1:s,y1:o,w:l,h:u,xOffset:d,yOffset:h}}},{key:"drawPickingRectangle",value:function(r,n,i){var a=this.atlasManager.getRenderTypeOpts(i),s=this.instanceCount;this.vertTypeBuffer.getView(s)[0]=rh;var o=this.indexBuffer.getView(s);th(n,o);var l=this.colorBuffer.getView(s);_c([0,0,0],1,l);var u=this.transformBuffer.getMatrixView(s);this.setTransformMatrix(r,u,a),this.simpleCount++,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}},{key:"drawNode",value:function(r,n,i){var a=this.simpleShapeOptions.get(i);if(this._isVisible(r,a)){var s=a.shapeProps,o=this._getVertTypeForShape(r,s.shape);if(o===void 0||a.isSimple&&!a.isSimple(r)){this.drawTexture(r,n,i);return}var l=this.instanceCount;if(this.vertTypeBuffer.getView(l)[0]=o,o===s1||o===cf){var u=a.getBoundingBox(r),h=this._getCornerRadius(r,s.radius,u),d=this.cornerRadiusBuffer.getView(l);d[0]=h,d[1]=h,d[2]=h,d[3]=h,o===cf&&(d[0]=0,d[2]=0)}var f=this.indexBuffer.getView(l);th(n,f);var p=r.pstyle(s.color).value,g=r.pstyle(s.opacity).value,m=this.colorBuffer.getView(l);_c(p,g,m);var v=this.lineWidthBuffer.getView(l);if(v[0]=0,v[1]=0,s.border){var y=r.pstyle("border-width").value;if(y>0){var b=r.pstyle("border-color").value,w=r.pstyle("border-opacity").value,T=this.borderColorBuffer.getView(l);_c(b,w,T);var E=r.pstyle("border-position").value;if(E==="inside")v[0]=0,v[1]=-y;else if(E==="outside")v[0]=y,v[1]=0;else{var L=y/2;v[0]=L,v[1]=-L}}}var S=this.transformBuffer.getMatrixView(l);this.setTransformMatrix(r,S,a),this.simpleCount++,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}},{key:"_getVertTypeForShape",value:function(r,n){var i=r.pstyle(n).value;switch(i){case"rectangle":return rh;case"ellipse":return uf;case"roundrectangle":case"round-rectangle":return s1;case"bottom-round-rectangle":return cf;default:return}}},{key:"_getCornerRadius",value:function(r,n,i){var a=i.w,s=i.h;if(r.pstyle(n).value==="auto")return Ul(a,s);var o=r.pstyle(n).pfValue,l=a/2,u=s/2;return Math.min(o,u,l)}},{key:"drawEdgeArrow",value:function(r,n,i){if(r.visible()){var a=r._private.rscratch,s,o,l;if(i==="source"?(s=a.arrowStartX,o=a.arrowStartY,l=a.srcArrowAngle):(s=a.arrowEndX,o=a.arrowEndY,l=a.tgtArrowAngle),!(isNaN(s)||s==null||isNaN(o)||o==null||isNaN(l)||l==null)){var u=r.pstyle(i+"-arrow-shape").value;if(u!=="none"){var h=r.pstyle(i+"-arrow-color").value,d=r.pstyle("opacity").value,f=r.pstyle("line-opacity").value,p=d*f,g=r.pstyle("width").pfValue,m=r.pstyle("arrow-scale").value,v=this.r.getArrowWidth(g,m),y=this.instanceCount,b=this.transformBuffer.getMatrixView(y);t9(b),cm(b,b,[s,o]),xw(b,b,[v,v]),r9(b,b,l),this.vertTypeBuffer.getView(y)[0]=K4;var w=this.indexBuffer.getView(y);th(n,w);var T=this.colorBuffer.getView(y);_c(h,p,T),this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}}}},{key:"drawEdgeLine",value:function(r,n){if(r.visible()){var i=this._getEdgePoints(r);if(i){var a=r.pstyle("opacity").value,s=r.pstyle("line-opacity").value,o=r.pstyle("width").pfValue,l=r.pstyle("line-color").value,u=a*s;if(i.length/2+this.instanceCount>this.maxInstances&&this.endBatch(),i.length==4){var h=this.instanceCount;this.vertTypeBuffer.getView(h)[0]=n9;var d=this.indexBuffer.getView(h);th(n,d);var f=this.colorBuffer.getView(h);_c(l,u,f);var p=this.lineWidthBuffer.getView(h);p[0]=o;var g=this.pointAPointBBuffer.getView(h);g[0]=i[0],g[1]=i[1],g[2]=i[2],g[3]=i[3],this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}else for(var m=0;m<i.length-2;m+=2){var v=this.instanceCount;this.vertTypeBuffer.getView(v)[0]=i9;var y=this.indexBuffer.getView(v);th(n,y);var b=this.colorBuffer.getView(v);_c(l,u,b);var w=this.lineWidthBuffer.getView(v);w[0]=o;var T=i[m-2],E=i[m-1],L=i[m],S=i[m+1],C=i[m+2],A=i[m+3],N=i[m+4],_=i[m+5];m==0&&(T=2*L-C+.001,E=2*S-A+.001),m==i.length-4&&(N=2*C-L+.001,_=2*A-S+.001);var O=this.pointAPointBBuffer.getView(v);O[0]=T,O[1]=E,O[2]=L,O[3]=S;var P=this.pointCPointDBuffer.getView(v);P[0]=C,P[1]=A,P[2]=N,P[3]=_,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}}}},{key:"_isValidEdge",value:function(r){var n=r._private.rscratch;return!(n.badLine||n.allpts==null||isNaN(n.allpts[0]))}},{key:"_getEdgePoints",value:function(r){var n=r._private.rscratch;if(this._isValidEdge(r)){var i=n.allpts;if(i.length==4)return i;var a=this._getNumSegments(r);return this._getCurveSegmentPoints(i,a)}}},{key:"_getNumSegments",value:function(r){var n=15;return Math.min(Math.max(n,5),this.maxInstances)}},{key:"_getCurveSegmentPoints",value:function(r,n){if(r.length==4)return r;for(var i=Array((n+1)*2),a=0;a<=n;a++)if(a==0)i[0]=r[0],i[1]=r[1];else if(a==n)i[a*2]=r[r.length-2],i[a*2+1]=r[r.length-1];else{var s=a/n;this._setCurvePoint(r,s,i,a*2)}return i}},{key:"_setCurvePoint",value:function(r,n,i,a){if(r.length<=2)i[a]=r[0],i[a+1]=r[1];else{for(var s=Array(r.length-2),o=0;o<s.length;o+=2){var l=(1-n)*r[o]+n*r[o+2],u=(1-n)*r[o+1]+n*r[o+3];s[o]=l,s[o+1]=u}return this._setCurvePoint(s,n,i,a)}}},{key:"endBatch",value:function(){var r=this.gl,n=this.vao,i=this.vertexCount,a=this.instanceCount;if(a!==0){var s=this.renderTarget.picking?this.pickingProgram:this.program;r.useProgram(s),r.bindVertexArray(n);var o=la(this.buffers),l;try{for(o.s();!(l=o.n()).done;){var u=l.value;u.bufferSubData(a)}}catch(g){o.e(g)}finally{o.f()}for(var h=this.batchManager.getAtlases(),d=0;d<h.length;d++)h[d].bufferIfNeeded(r);for(var f=0;f<h.length;f++)r.activeTexture(r.TEXTURE0+f),r.bindTexture(r.TEXTURE_2D,h[f].texture),r.uniform1i(s.uTextures[f],f);r.uniform1f(s.uZoom,sbe(this.r)),r.uniformMatrix3fv(s.uPanZoomMatrix,!1,this.panZoomMatrix),r.uniform1i(s.uAtlasSize,this.batchManager.getAtlasSize());var p=_c(this.bgColor,1);r.uniform4fv(s.uBGColor,p),r.drawArraysInstanced(r.TRIANGLES,0,i,a),r.bindVertexArray(null),r.bindTexture(r.TEXTURE_2D,null),this.debug&&this.batchDebugInfo.push({count:a,atlasCount:h.length}),this.startBatch()}}},{key:"getDebugInfo",value:function(){var r=this.atlasManager.getDebugInfo(),n=r.reduce(function(s,o){return s+o.atlasCount},0),i=this.batchDebugInfo,a=i.reduce(function(s,o){return s+o.count},0);return{atlasInfo:r,totalAtlases:n,wrappedCount:this.wrappedCount,simpleCount:this.simpleCount,batchCount:i.length,batchInfo:i,totalInstances:a}}}])}(),PV={};PV.initWebgl=function(t,e){var r=this,n=r.data.contexts[r.WEBGL];t.bgColor=_be(r),t.webglTexSize=Math.min(t.webglTexSize,n.getParameter(n.MAX_TEXTURE_SIZE)),t.webglTexRows=Math.min(t.webglTexRows,54),t.webglTexRowsNodes=Math.min(t.webglTexRowsNodes,54),t.webglBatchSize=Math.min(t.webglBatchSize,16384),t.webglTexPerBatch=Math.min(t.webglTexPerBatch,n.getParameter(n.MAX_TEXTURE_IMAGE_UNITS)),r.webglDebug=t.webglDebug,r.webglDebugShowAtlases=t.webglDebugShowAtlases,r.pickingFrameBuffer=gbe(n),r.pickingFrameBuffer.needsDraw=!0,r.drawing=new Abe(r,n,t);var i=function(d){return function(f){return r.getTextAngle(f,d)}},a=function(d){return function(f){var p=f.pstyle(d);return p&&p.value}},s=function(d){return function(f){return f.pstyle("".concat(d,"-opacity")).value>0}},o=function(d){var f=d.pstyle("text-events").strValue==="yes";return f?Uv.USE_BB:Uv.IGNORE},l=function(d){var f=d.position(),p=f.x,g=f.y,m=d.outerWidth(),v=d.outerHeight();return{w:m,h:v,x1:p-m/2,y1:g-v/2}};r.drawing.addAtlasCollection("node",{texRows:t.webglTexRowsNodes}),r.drawing.addAtlasCollection("label",{texRows:t.webglTexRows}),r.drawing.addTextureAtlasRenderType("node-body",{collection:"node",getKey:e.getStyleKey,getBoundingBox:e.getElementBox,drawElement:e.drawElement}),r.drawing.addSimpleShapeRenderType("node-body",{getBoundingBox:l,isSimple:lbe,shapeProps:{shape:"shape",color:"background-color",opacity:"background-opacity",radius:"corner-radius",border:!0}}),r.drawing.addSimpleShapeRenderType("node-overlay",{getBoundingBox:l,isVisible:s("overlay"),shapeProps:{shape:"overlay-shape",color:"overlay-color",opacity:"overlay-opacity",padding:"overlay-padding",radius:"overlay-corner-radius"}}),r.drawing.addSimpleShapeRenderType("node-underlay",{getBoundingBox:l,isVisible:s("underlay"),shapeProps:{shape:"underlay-shape",color:"underlay-color",opacity:"underlay-opacity",padding:"underlay-padding",radius:"underlay-corner-radius"}}),r.drawing.addTextureAtlasRenderType("label",{collection:"label",getTexPickingMode:o,getKey:Z4(e.getLabelKey,null),getBoundingBox:Q4(e.getLabelBox,null),drawClipped:!0,drawElement:e.drawLabel,getRotation:i(null),getRotationPoint:e.getLabelRotationPoint,getRotationOffset:e.getLabelRotationOffset,isVisible:a("label")}),r.drawing.addTextureAtlasRenderType("edge-source-label",{collection:"label",getTexPickingMode:o,getKey:Z4(e.getSourceLabelKey,"source"),getBoundingBox:Q4(e.getSourceLabelBox,"source"),drawClipped:!0,drawElement:e.drawSourceLabel,getRotation:i("source"),getRotationPoint:e.getSourceLabelRotationPoint,getRotationOffset:e.getSourceLabelRotationOffset,isVisible:a("source-label")}),r.drawing.addTextureAtlasRenderType("edge-target-label",{collection:"label",getTexPickingMode:o,getKey:Z4(e.getTargetLabelKey,"target"),getBoundingBox:Q4(e.getTargetLabelBox,"target"),drawClipped:!0,drawElement:e.drawTargetLabel,getRotation:i("target"),getRotationPoint:e.getTargetLabelRotationPoint,getRotationOffset:e.getTargetLabelRotationOffset,isVisible:a("target-label")});var u=eg(function(){console.log("garbage collect flag set"),r.data.gc=!0},1e4);r.onUpdateEleCalcs(function(h,d){var f=!1;d&&d.length>0&&(f|=r.drawing.invalidate(d)),f&&u()}),Lbe(r)};function _be(t){var e=t.cy.container(),r=e&&e.style&&e.style.backgroundColor||"white";return uz(r)}function BV(t,e){var r=t._private.rscratch;return ia(r,"labelWrapCachedLines",e)||[]}var Z4=function(e,r){return function(n){var i=e(n),a=BV(n,r);return a.length>1?a.map(function(s,o){return"".concat(i,"_").concat(o)}):i}},Q4=function(e,r){return function(n,i){var a=e(n);if(typeof i=="string"){var s=i.indexOf("_");if(s>0){var o=Number(i.substring(s+1)),l=BV(n,r),u=a.h/l.length,h=u*o,d=a.y1+h;return{x1:a.x1,w:a.w,y1:d,h:u,yOffset:h}}}return a}};function Lbe(t){{var e=t.render;t.render=function(a){a=a||{};var s=t.cy;t.webgl&&(s.zoom()>LV?(Rbe(t),e.call(t,a)):(Nbe(t),$V(t,a,L0.SCREEN)))}}{var r=t.matchCanvasSize;t.matchCanvasSize=function(a){r.call(t,a),t.pickingFrameBuffer.setFramebufferAttachmentSizes(t.canvasWidth,t.canvasHeight),t.pickingFrameBuffer.needsDraw=!0}}t.findNearestElements=function(a,s,o,l){return Bbe(t,a,s)};{var n=t.invalidateCachedZSortedEles;t.invalidateCachedZSortedEles=function(){n.call(t),t.pickingFrameBuffer.needsDraw=!0}}{var i=t.notify;t.notify=function(a,s){i.call(t,a,s),a==="viewport"||a==="bounds"?t.pickingFrameBuffer.needsDraw=!0:a==="background"&&t.drawing.invalidate(s,{type:"node-body"})}}}function Rbe(t){var e=t.data.contexts[t.WEBGL];e.clear(e.COLOR_BUFFER_BIT|e.DEPTH_BUFFER_BIT)}function Nbe(t){var e=function(n){n.save(),n.setTransform(1,0,0,1,0,0),n.clearRect(0,0,t.canvasWidth,t.canvasHeight),n.restore()};e(t.data.contexts[t.NODE]),e(t.data.contexts[t.DRAG])}function Dbe(t){var e=t.canvasWidth,r=t.canvasHeight,n=uk(t),i=n.pan,a=n.zoom,s=X4();cm(s,s,[i.x,i.y]),xw(s,s,[a,a]);var o=X4();vbe(o,e,r);var l=X4();return mbe(l,o,s),l}function FV(t,e){var r=t.canvasWidth,n=t.canvasHeight,i=uk(t),a=i.pan,s=i.zoom;e.setTransform(1,0,0,1,0,0),e.clearRect(0,0,r,n),e.translate(a.x,a.y),e.scale(s,s)}function Mbe(t,e){t.drawSelectionRectangle(e,function(r){return FV(t,r)})}function Ibe(t){var e=t.data.contexts[t.NODE];e.save(),FV(t,e),e.strokeStyle="rgba(0, 0, 0, 0.3)",e.beginPath(),e.moveTo(-1e3,0),e.lineTo(1e3,0),e.stroke(),e.beginPath(),e.moveTo(0,-1e3),e.lineTo(0,1e3),e.stroke(),e.restore()}function Obe(t){var e=function(i,a,s){for(var o=i.atlasManager.getAtlasCollection(a),l=t.data.contexts[t.NODE],u=o.atlases,h=0;h<u.length;h++){var d=u[h],f=d.canvas;if(f){var p=f.width,g=f.height,m=p*h,v=f.height*s,y=.4;l.save(),l.scale(y,y),l.drawImage(f,m,v),l.strokeStyle="black",l.rect(m,v,p,g),l.stroke(),l.restore()}}},r=0;e(t.drawing,"node",r++),e(t.drawing,"label",r++)}function Pbe(t,e,r,n,i){var a,s,o,l,u=uk(t),h=u.pan,d=u.zoom;{var f=obe(t,h,d,e,r),p=Tn(f,2),g=p[0],m=p[1],v=6;a=g-v/2,s=m-v/2,o=v,l=v}if(o===0||l===0)return[];var y=t.data.contexts[t.WEBGL];y.bindFramebuffer(y.FRAMEBUFFER,t.pickingFrameBuffer),t.pickingFrameBuffer.needsDraw&&(y.viewport(0,0,y.canvas.width,y.canvas.height),$V(t,null,L0.PICKING),t.pickingFrameBuffer.needsDraw=!1);var b=o*l,w=new Uint8Array(b*4);y.readPixels(a,s,o,l,y.RGBA,y.UNSIGNED_BYTE,w),y.bindFramebuffer(y.FRAMEBUFFER,null);for(var T=new Set,E=0;E<b;E++){var L=w.slice(E*4,E*4+4),S=ube(L)-1;S>=0&&T.add(S)}return T}function Bbe(t,e,r){var n=Pbe(t,e,r),i=t.getCachedZSortedEles(),a,s,o=la(n),l;try{for(o.s();!(l=o.n()).done;){var u=l.value,h=i[u];if(!a&&h.isNode()&&(a=h),!s&&h.isEdge()&&(s=h),a&&s)break}}catch(d){o.e(d)}finally{o.f()}return[a,s].filter(Boolean)}function J4(t,e,r){var n=t.drawing;e+=1,r.isNode()?(n.drawNode(r,e,"node-underlay"),n.drawNode(r,e,"node-body"),n.drawTexture(r,e,"label"),n.drawNode(r,e,"node-overlay")):(n.drawEdgeLine(r,e),n.drawEdgeArrow(r,e,"source"),n.drawEdgeArrow(r,e,"target"),n.drawTexture(r,e,"label"),n.drawTexture(r,e,"edge-source-label"),n.drawTexture(r,e,"edge-target-label"))}function $V(t,e,r){var n;t.webglDebug&&(n=performance.now());var i=t.drawing,a=0;if(r.screen&&t.data.canvasNeedsRedraw[t.SELECT_BOX]&&Mbe(t,e),t.data.canvasNeedsRedraw[t.NODE]||r.picking){var s=t.data.contexts[t.WEBGL];r.screen?(s.clearColor(0,0,0,0),s.enable(s.BLEND),s.blendFunc(s.ONE,s.ONE_MINUS_SRC_ALPHA)):s.disable(s.BLEND),s.clear(s.COLOR_BUFFER_BIT|s.DEPTH_BUFFER_BIT),s.viewport(0,0,s.canvas.width,s.canvas.height);var o=Dbe(t),l=t.getCachedZSortedEles();if(a=l.length,i.startFrame(o,r),r.screen){for(var u=0;u<l.nondrag.length;u++)J4(t,u,l.nondrag[u]);for(var h=0;h<l.drag.length;h++)J4(t,h,l.drag[h])}else if(r.picking)for(var d=0;d<l.length;d++)J4(t,d,l[d]);i.endFrame(),r.screen&&t.webglDebugShowAtlases&&(Ibe(t),Obe(t)),t.data.canvasNeedsRedraw[t.NODE]=!1,t.data.canvasNeedsRedraw[t.DRAG]=!1}if(t.webglDebug){var f=performance.now(),p=!1,g=Math.ceil(f-n),m=i.getDebugInfo(),v=["".concat(a," elements"),"".concat(m.totalInstances," instances"),"".concat(m.batchCount," batches"),"".concat(m.totalAtlases," atlases"),"".concat(m.wrappedCount," wrapped textures"),"".concat(m.simpleCount," simple shapes")].join(", ");if(p)console.log("WebGL (".concat(r.name,") - time ").concat(g,"ms, ").concat(v));else{console.log("WebGL (".concat(r.name,") - frame time ").concat(g,"ms")),console.log("Totals:"),console.log("  ".concat(v)),console.log("Texture Atlases Used:");var y=m.atlasInfo,b=la(y),w;try{for(b.s();!(w=b.n()).done;){var T=w.value;console.log("  ".concat(T.type,": ").concat(T.keyCount," keys, ").concat(T.atlasCount," atlases"))}}catch(E){b.e(E)}finally{b.f()}console.log("")}}t.data.gc&&(console.log("Garbage Collect!"),t.data.gc=!1,i.gc())}var cc={};cc.drawPolygonPath=function(t,e,r,n,i,a){var s=n/2,o=i/2;t.beginPath&&t.beginPath(),t.moveTo(e+s*a[0],r+o*a[1]);for(var l=1;l<a.length/2;l++)t.lineTo(e+s*a[l*2],r+o*a[l*2+1]);t.closePath()};cc.drawRoundPolygonPath=function(t,e,r,n,i,a,s){s.forEach(function(o){return bV(t,o)}),t.closePath()};cc.drawRoundRectanglePath=function(t,e,r,n,i,a){var s=n/2,o=i/2,l=a==="auto"?Ul(n,i):Math.min(a,o,s);t.beginPath&&t.beginPath(),t.moveTo(e,r-o),t.arcTo(e+s,r-o,e+s,r,l),t.arcTo(e+s,r+o,e,r+o,l),t.arcTo(e-s,r+o,e-s,r,l),t.arcTo(e-s,r-o,e,r-o,l),t.lineTo(e,r-o),t.closePath()};cc.drawBottomRoundRectanglePath=function(t,e,r,n,i,a){var s=n/2,o=i/2,l=a==="auto"?Ul(n,i):a;t.beginPath&&t.beginPath(),t.moveTo(e,r-o),t.lineTo(e+s,r-o),t.lineTo(e+s,r),t.arcTo(e+s,r+o,e,r+o,l),t.arcTo(e-s,r+o,e-s,r,l),t.lineTo(e-s,r-o),t.lineTo(e,r-o),t.closePath()};cc.drawCutRectanglePath=function(t,e,r,n,i,a,s){var o=n/2,l=i/2,u=s==="auto"?KE():s;t.beginPath&&t.beginPath(),t.moveTo(e-o+u,r-l),t.lineTo(e+o-u,r-l),t.lineTo(e+o,r-l+u),t.lineTo(e+o,r+l-u),t.lineTo(e+o-u,r+l),t.lineTo(e-o+u,r+l),t.lineTo(e-o,r+l-u),t.lineTo(e-o,r-l+u),t.closePath()};cc.drawBarrelPath=function(t,e,r,n,i){var a=n/2,s=i/2,o=e-a,l=e+a,u=r-s,h=r+s,d=aw(n,i),f=d.widthOffset,p=d.heightOffset,g=d.ctrlPtOffsetPct*f;t.beginPath&&t.beginPath(),t.moveTo(o,u+p),t.lineTo(o,h-p),t.quadraticCurveTo(o+g,h,o+f,h),t.lineTo(l-f,h),t.quadraticCurveTo(l-g,h,l,h-p),t.lineTo(l,u+p),t.quadraticCurveTo(l-g,u,l-f,u),t.lineTo(o+f,u),t.quadraticCurveTo(o+g,u,o,u+p),t.closePath()};var a9=Math.sin(0),s9=Math.cos(0),bw={},ww={},zV=Math.PI/40;for(var nh=0*Math.PI;nh<2*Math.PI;nh+=zV)bw[nh]=Math.sin(nh),ww[nh]=Math.cos(nh);cc.drawEllipsePath=function(t,e,r,n,i){if(t.beginPath&&t.beginPath(),t.ellipse)t.ellipse(e,r,n/2,i/2,0,0,2*Math.PI);else for(var a,s,o=n/2,l=i/2,u=0*Math.PI;u<2*Math.PI;u+=zV)a=e-o*bw[u]*a9+o*ww[u]*s9,s=r+l*ww[u]*a9+l*bw[u]*s9,u===0?t.moveTo(a,s):t.lineTo(a,s);t.closePath()};var sg={};sg.createBuffer=function(t,e){var r=document.createElement("canvas");return r.width=t,r.height=e,[r,r.getContext("2d")]};sg.bufferCanvasImage=function(t){var e=this.cy,r=e.mutableElements(),n=r.boundingBox(),i=this.findContainerClientCoords(),a=t.full?Math.ceil(n.w):i[2],s=t.full?Math.ceil(n.h):i[3],o=vt(t.maxWidth)||vt(t.maxHeight),l=this.getPixelRatio(),u=1;if(t.scale!==void 0)a*=t.scale,s*=t.scale,u=t.scale;else if(o){var h=1/0,d=1/0;vt(t.maxWidth)&&(h=u*t.maxWidth/a),vt(t.maxHeight)&&(d=u*t.maxHeight/s),u=Math.min(h,d),a*=u,s*=u}o||(a*=l,s*=l,u*=l);var f=document.createElement("canvas");f.width=a,f.height=s,f.style.width=a+"px",f.style.height=s+"px";var p=f.getContext("2d");if(a>0&&s>0){p.clearRect(0,0,a,s),p.globalCompositeOperation="source-over";var g=this.getCachedZSortedEles();if(t.full)p.translate(-n.x1*u,-n.y1*u),p.scale(u,u),this.drawElements(p,g),p.scale(1/u,1/u),p.translate(n.x1*u,n.y1*u);else{var m=e.pan(),v={x:m.x*u,y:m.y*u};u*=e.zoom(),p.translate(v.x,v.y),p.scale(u,u),this.drawElements(p,g),p.scale(1/u,1/u),p.translate(-v.x,-v.y)}t.bg&&(p.globalCompositeOperation="destination-over",p.fillStyle=t.bg,p.rect(0,0,a,s),p.fill())}return f};function Fbe(t,e){for(var r=atob(t),n=new ArrayBuffer(r.length),i=new Uint8Array(n),a=0;a<r.length;a++)i[a]=r.charCodeAt(a);return new Blob([n],{type:e})}function o9(t){var e=t.indexOf(",");return t.substr(e+1)}function VV(t,e,r){var n=function(){return e.toDataURL(r,t.quality)};switch(t.output){case"blob-promise":return new Nd(function(i,a){try{e.toBlob(function(s){s!=null?i(s):a(new Error("`canvas.toBlob()` sent a null value in its callback"))},r,t.quality)}catch(s){a(s)}});case"blob":return Fbe(o9(n()),r);case"base64":return o9(n());case"base64uri":default:return n()}}sg.png=function(t){return VV(t,this.bufferCanvasImage(t),"image/png")};sg.jpg=function(t){return VV(t,this.bufferCanvasImage(t),"image/jpeg")};var GV={};GV.nodeShapeImpl=function(t,e,r,n,i,a,s,o){switch(t){case"ellipse":return this.drawEllipsePath(e,r,n,i,a);case"polygon":return this.drawPolygonPath(e,r,n,i,a,s);case"round-polygon":return this.drawRoundPolygonPath(e,r,n,i,a,s,o);case"roundrectangle":case"round-rectangle":return this.drawRoundRectanglePath(e,r,n,i,a,o);case"cutrectangle":case"cut-rectangle":return this.drawCutRectanglePath(e,r,n,i,a,s,o);case"bottomroundrectangle":case"bottom-round-rectangle":return this.drawBottomRoundRectanglePath(e,r,n,i,a,o);case"barrel":return this.drawBarrelPath(e,r,n,i,a)}};var $be=UV,Jt=UV.prototype;Jt.CANVAS_LAYERS=3;Jt.SELECT_BOX=0;Jt.DRAG=1;Jt.NODE=2;Jt.WEBGL=3;Jt.CANVAS_TYPES=["2d","2d","2d","webgl2"];Jt.BUFFER_COUNT=3;Jt.TEXTURE_BUFFER=0;Jt.MOTIONBLUR_BUFFER_NODE=1;Jt.MOTIONBLUR_BUFFER_DRAG=2;function UV(t){var e=this,r=e.cy.window(),n=r.document;t.webgl&&(Jt.CANVAS_LAYERS=e.CANVAS_LAYERS=4,console.log("webgl rendering enabled")),e.data={canvases:new Array(Jt.CANVAS_LAYERS),contexts:new Array(Jt.CANVAS_LAYERS),canvasNeedsRedraw:new Array(Jt.CANVAS_LAYERS),bufferCanvases:new Array(Jt.BUFFER_COUNT),bufferContexts:new Array(Jt.CANVAS_LAYERS)};var i="-webkit-tap-highlight-color",a="rgba(0,0,0,0)";e.data.canvasContainer=n.createElement("div");var s=e.data.canvasContainer.style;e.data.canvasContainer.style[i]=a,s.position="relative",s.zIndex="0",s.overflow="hidden";var o=t.cy.container();o.appendChild(e.data.canvasContainer),o.style[i]=a;var l={"-webkit-user-select":"none","-moz-user-select":"-moz-none","user-select":"none","-webkit-tap-highlight-color":"rgba(0,0,0,0)","outline-style":"none"};M1e()&&(l["-ms-touch-action"]="none",l["touch-action"]="none");for(var u=0;u<Jt.CANVAS_LAYERS;u++){var h=e.data.canvases[u]=n.createElement("canvas"),d=Jt.CANVAS_TYPES[u];e.data.contexts[u]=h.getContext(d),e.data.contexts[u]||Kr("Could not create canvas of type "+d),Object.keys(l).forEach(function(K){h.style[K]=l[K]}),h.style.position="absolute",h.setAttribute("data-id","layer"+u),h.style.zIndex=String(Jt.CANVAS_LAYERS-u),e.data.canvasContainer.appendChild(h),e.data.canvasNeedsRedraw[u]=!1}e.data.topCanvas=e.data.canvases[0],e.data.canvases[Jt.NODE].setAttribute("data-id","layer"+Jt.NODE+"-node"),e.data.canvases[Jt.SELECT_BOX].setAttribute("data-id","layer"+Jt.SELECT_BOX+"-selectbox"),e.data.canvases[Jt.DRAG].setAttribute("data-id","layer"+Jt.DRAG+"-drag"),e.data.canvases[Jt.WEBGL]&&e.data.canvases[Jt.WEBGL].setAttribute("data-id","layer"+Jt.WEBGL+"-webgl");for(var u=0;u<Jt.BUFFER_COUNT;u++)e.data.bufferCanvases[u]=n.createElement("canvas"),e.data.bufferContexts[u]=e.data.bufferCanvases[u].getContext("2d"),e.data.bufferCanvases[u].style.position="absolute",e.data.bufferCanvases[u].setAttribute("data-id","buffer"+u),e.data.bufferCanvases[u].style.zIndex=String(-u-1),e.data.bufferCanvases[u].style.visibility="hidden";e.pathsEnabled=!0;var f=qi(),p=function(Z){return{x:(Z.x1+Z.x2)/2,y:(Z.y1+Z.y2)/2}},g=function(Z){return{x:-Z.w/2,y:-Z.h/2}},m=function(Z){var X=Z[0]._private,Y=X.oldBackgroundTimestamp===X.backgroundTimestamp;return!Y},v=function(Z){return Z[0]._private.nodeKey},y=function(Z){return Z[0]._private.labelStyleKey},b=function(Z){return Z[0]._private.sourceLabelStyleKey},w=function(Z){return Z[0]._private.targetLabelStyleKey},T=function(Z,X,Y,ee,j){return e.drawElement(Z,X,Y,!1,!1,j)},E=function(Z,X,Y,ee,j){return e.drawElementText(Z,X,Y,ee,"main",j)},L=function(Z,X,Y,ee,j){return e.drawElementText(Z,X,Y,ee,"source",j)},S=function(Z,X,Y,ee,j){return e.drawElementText(Z,X,Y,ee,"target",j)},C=function(Z){return Z.boundingBox(),Z[0]._private.bodyBounds},A=function(Z){return Z.boundingBox(),Z[0]._private.labelBounds.main||f},N=function(Z){return Z.boundingBox(),Z[0]._private.labelBounds.source||f},_=function(Z){return Z.boundingBox(),Z[0]._private.labelBounds.target||f},O=function(Z,X){return X},P=function(Z){return p(C(Z))},k=function(Z,X,Y){var ee=Z?Z+"-":"";return{x:X.x+Y.pstyle(ee+"text-margin-x").pfValue,y:X.y+Y.pstyle(ee+"text-margin-y").pfValue}},R=function(Z,X,Y){var ee=Z[0]._private.rscratch;return{x:ee[X],y:ee[Y]}},I=function(Z){return k("",R(Z,"labelX","labelY"),Z)},M=function(Z){return k("source",R(Z,"sourceLabelX","sourceLabelY"),Z)},D=function(Z){return k("target",R(Z,"targetLabelX","targetLabelY"),Z)},B=function(Z){return g(C(Z))},$=function(Z){return g(N(Z))},F=function(Z){return g(_(Z))},G=function(Z){var X=A(Z),Y=g(A(Z));if(Z.isNode()){switch(Z.pstyle("text-halign").value){case"left":Y.x=-X.w-(X.leftPad||0);break;case"right":Y.x=-(X.rightPad||0);break}switch(Z.pstyle("text-valign").value){case"top":Y.y=-X.h-(X.topPad||0);break;case"bottom":Y.y=-(X.botPad||0);break}}return Y},W=e.data.eleTxrCache=new Lf(e,{getKey:v,doesEleInvalidateKey:m,drawElement:T,getBoundingBox:C,getRotationPoint:P,getRotationOffset:B,allowEdgeTxrCaching:!1,allowParentTxrCaching:!1}),J=e.data.lblTxrCache=new Lf(e,{getKey:y,drawElement:E,getBoundingBox:A,getRotationPoint:I,getRotationOffset:G,isVisible:O}),q=e.data.slbTxrCache=new Lf(e,{getKey:b,drawElement:L,getBoundingBox:N,getRotationPoint:M,getRotationOffset:$,isVisible:O}),ne=e.data.tlbTxrCache=new Lf(e,{getKey:w,drawElement:S,getBoundingBox:_,getRotationPoint:D,getRotationOffset:F,isVisible:O}),ae=e.data.lyrTxrCache=new RV(e);e.onUpdateEleCalcs(function(Z,X){W.invalidateElements(X),J.invalidateElements(X),q.invalidateElements(X),ne.invalidateElements(X),ae.invalidateElements(X);for(var Y=0;Y<X.length;Y++){var ee=X[Y]._private;ee.oldBackgroundTimestamp=ee.backgroundTimestamp}});var pe=function(Z){for(var X=0;X<Z.length;X++)ae.enqueueElementRefinement(Z[X].ele)};W.onDequeue(pe),J.onDequeue(pe),q.onDequeue(pe),ne.onDequeue(pe),t.webgl&&e.initWebgl(t,{getStyleKey:v,getLabelKey:y,getSourceLabelKey:b,getTargetLabelKey:w,drawElement:T,drawLabel:E,drawSourceLabel:L,drawTargetLabel:S,getElementBox:C,getLabelBox:A,getSourceLabelBox:N,getTargetLabelBox:_,getElementRotationPoint:P,getElementRotationOffset:B,getLabelRotationPoint:I,getSourceLabelRotationPoint:M,getTargetLabelRotationPoint:D,getLabelRotationOffset:G,getSourceLabelRotationOffset:$,getTargetLabelRotationOffset:F})}Jt.redrawHint=function(t,e){var r=this;switch(t){case"eles":r.data.canvasNeedsRedraw[Jt.NODE]=e;break;case"drag":r.data.canvasNeedsRedraw[Jt.DRAG]=e;break;case"select":r.data.canvasNeedsRedraw[Jt.SELECT_BOX]=e;break;case"gc":r.data.gc=!0;break}};var zbe=typeof Path2D<"u";Jt.path2dEnabled=function(t){if(t===void 0)return this.pathsEnabled;this.pathsEnabled=!!t};Jt.usePaths=function(){return zbe&&this.pathsEnabled};Jt.setImgSmoothing=function(t,e){t.imageSmoothingEnabled!=null?t.imageSmoothingEnabled=e:(t.webkitImageSmoothingEnabled=e,t.mozImageSmoothingEnabled=e,t.msImageSmoothingEnabled=e)};Jt.getImgSmoothing=function(t){return t.imageSmoothingEnabled!=null?t.imageSmoothingEnabled:t.webkitImageSmoothingEnabled||t.mozImageSmoothingEnabled||t.msImageSmoothingEnabled};Jt.makeOffscreenCanvas=function(t,e){var r;if((typeof OffscreenCanvas>"u"?"undefined":$n(OffscreenCanvas))!=="undefined")r=new OffscreenCanvas(t,e);else{var n=this.cy.window(),i=n.document;r=i.createElement("canvas"),r.width=t,r.height=e}return r};[NV,co,sl,ck,Pu,lc,Qi,PV,cc,sg,GV].forEach(function(t){Gt(Jt,t)});var Vbe=[{name:"null",impl:vV},{name:"base",impl:AV},{name:"canvas",impl:$be}],Gbe=[{type:"layout",extensions:fxe},{type:"renderer",extensions:Vbe}],WV={},HV={};function qV(t,e,r){var n=r,i=function(C){Nr("Can not register `"+e+"` for `"+t+"` since `"+C+"` already exists in the prototype and can not be overridden")};if(t==="core"){if(hp.prototype[e])return i(e);hp.prototype[e]=r}else if(t==="collection"){if(ci.prototype[e])return i(e);ci.prototype[e]=r}else if(t==="layout"){for(var a=function(C){this.options=C,r.call(this,C),vr(this._private)||(this._private={}),this._private.cy=C.cy,this._private.listeners=[],this.createEmitter()},s=a.prototype=Object.create(r.prototype),o=[],l=0;l<o.length;l++){var u=o[l];s[u]=s[u]||function(){return this}}s.start&&!s.run?s.run=function(){return this.start(),this}:!s.start&&s.run&&(s.start=function(){return this.run(),this});var h=r.prototype.stop;s.stop=function(){var S=this.options;if(S&&S.animate){var C=this.animations;if(C)for(var A=0;A<C.length;A++)C[A].stop()}return h?h.call(this):this.emit("layoutstop"),this},s.destroy||(s.destroy=function(){return this}),s.cy=function(){return this._private.cy};var d=function(C){return C._private.cy},f={addEventFields:function(C,A){A.layout=C,A.cy=d(C),A.target=C},bubble:function(){return!0},parent:function(C){return d(C)}};Gt(s,{createEmitter:function(){return this._private.emitter=new B2(f,this),this},emitter:function(){return this._private.emitter},on:function(C,A){return this.emitter().on(C,A),this},one:function(C,A){return this.emitter().one(C,A),this},once:function(C,A){return this.emitter().one(C,A),this},removeListener:function(C,A){return this.emitter().removeListener(C,A),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},emit:function(C,A){return this.emitter().emit(C,A),this}}),_r.eventAliasesOn(s),n=a}else if(t==="renderer"&&e!=="null"&&e!=="base"){var p=YV("renderer","base"),g=p.prototype,m=r,v=r.prototype,y=function(){p.apply(this,arguments),m.apply(this,arguments)},b=y.prototype;for(var w in g){var T=g[w],E=v[w]!=null;if(E)return i(w);b[w]=T}for(var L in v)b[L]=v[L];g.clientFunctions.forEach(function(S){b[S]=b[S]||function(){Kr("Renderer does not implement `renderer."+S+"()` on its prototype")}}),n=y}else if(t==="__proto__"||t==="constructor"||t==="prototype")return Kr(t+" is an illegal type to be registered, possibly lead to prototype pollutions");return hz({map:WV,keys:[t,e],value:n})}function YV(t,e){return dz({map:WV,keys:[t,e]})}function Ube(t,e,r,n,i){return hz({map:HV,keys:[t,e,r,n],value:i})}function Wbe(t,e,r,n){return dz({map:HV,keys:[t,e,r,n]})}var Tw=function(){if(arguments.length===2)return YV.apply(null,arguments);if(arguments.length===3)return qV.apply(null,arguments);if(arguments.length===4)return Wbe.apply(null,arguments);if(arguments.length===5)return Ube.apply(null,arguments);Kr("Invalid extension access syntax")};hp.prototype.extension=Tw;Gbe.forEach(function(t){t.extensions.forEach(function(e){qV(t.type,e.name,e.impl)})});var Wv=function(){if(!(this instanceof Wv))return new Wv;this.length=0},mu=Wv.prototype;mu.instanceString=function(){return"stylesheet"};mu.selector=function(t){var e=this.length++;return this[e]={selector:t,properties:[]},this};mu.css=function(t,e){var r=this.length-1;if(Bt(t))this[r].properties.push({name:t,value:e});else if(vr(t))for(var n=t,i=Object.keys(n),a=0;a<i.length;a++){var s=i[a],o=n[s];if(o!=null){var l=jn.properties[s]||jn.properties[A2(s)];if(l!=null){var u=l.name,h=o;this[r].properties.push({name:u,value:h})}}}return this};mu.style=mu.css;mu.generateStyle=function(t){var e=new jn(t);return this.appendToStyle(e)};mu.appendToStyle=function(t){for(var e=0;e<this.length;e++){var r=this[e],n=r.selector,i=r.properties;t.selector(n);for(var a=0;a<i.length;a++){var s=i[a];t.css(s.name,s.value)}}return t};var Hbe="3.33.1",Js=function(e){if(e===void 0&&(e={}),vr(e))return new hp(e);if(Bt(e))return Tw.apply(Tw,arguments)};Js.use=function(t){var e=Array.prototype.slice.call(arguments,1);return e.unshift(Js),t.apply(null,e),this};Js.warnings=function(t){return xz(t)};Js.version=Hbe;Js.stylesheet=Js.Stylesheet=Wv;var XV={exports:{}},e3={exports:{}},t3={exports:{}},l9;function qbe(){return l9||(l9=1,function(t,e){(function(n,i){t.exports=i()})(to,function(){return function(r){var n={};function i(a){if(n[a])return n[a].exports;var s=n[a]={i:a,l:!1,exports:{}};return r[a].call(s.exports,s,s.exports,i),s.l=!0,s.exports}return i.m=r,i.c=n,i.i=function(a){return a},i.d=function(a,s,o){i.o(a,s)||Object.defineProperty(a,s,{configurable:!1,enumerable:!0,get:o})},i.n=function(a){var s=a&&a.__esModule?function(){return a.default}:function(){return a};return i.d(s,"a",s),s},i.o=function(a,s){return Object.prototype.hasOwnProperty.call(a,s)},i.p="",i(i.s=26)}([function(r,n,i){function a(){}a.QUALITY=1,a.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,a.DEFAULT_INCREMENTAL=!1,a.DEFAULT_ANIMATION_ON_LAYOUT=!0,a.DEFAULT_ANIMATION_DURING_LAYOUT=!1,a.DEFAULT_ANIMATION_PERIOD=50,a.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,a.DEFAULT_GRAPH_MARGIN=15,a.NODE_DIMENSIONS_INCLUDE_LABELS=!1,a.SIMPLE_NODE_SIZE=40,a.SIMPLE_NODE_HALF_SIZE=a.SIMPLE_NODE_SIZE/2,a.EMPTY_COMPOUND_NODE_SIZE=40,a.MIN_EDGE_LENGTH=1,a.WORLD_BOUNDARY=1e6,a.INITIAL_WORLD_BOUNDARY=a.WORLD_BOUNDARY/1e3,a.WORLD_CENTER_X=1200,a.WORLD_CENTER_Y=900,r.exports=a},function(r,n,i){var a=i(2),s=i(8),o=i(9);function l(h,d,f){a.call(this,f),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=f,this.bendpoints=[],this.source=h,this.target=d}l.prototype=Object.create(a.prototype);for(var u in a)l[u]=a[u];l.prototype.getSource=function(){return this.source},l.prototype.getTarget=function(){return this.target},l.prototype.isInterGraph=function(){return this.isInterGraph},l.prototype.getLength=function(){return this.length},l.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},l.prototype.getBendpoints=function(){return this.bendpoints},l.prototype.getLca=function(){return this.lca},l.prototype.getSourceInLca=function(){return this.sourceInLca},l.prototype.getTargetInLca=function(){return this.targetInLca},l.prototype.getOtherEnd=function(h){if(this.source===h)return this.target;if(this.target===h)return this.source;throw"Node is not incident with this edge"},l.prototype.getOtherEndInGraph=function(h,d){for(var f=this.getOtherEnd(h),p=d.getGraphManager().getRoot();;){if(f.getOwner()==d)return f;if(f.getOwner()==p)break;f=f.getOwner().getParent()}return null},l.prototype.updateLength=function(){var h=new Array(4);this.isOverlapingSourceAndTarget=s.getIntersection(this.target.getRect(),this.source.getRect(),h),this.isOverlapingSourceAndTarget||(this.lengthX=h[0]-h[2],this.lengthY=h[1]-h[3],Math.abs(this.lengthX)<1&&(this.lengthX=o.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=o.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},l.prototype.updateLengthSimple=function(){this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),Math.abs(this.lengthX)<1&&(this.lengthX=o.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=o.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},r.exports=l},function(r,n,i){function a(s){this.vGraphObject=s}r.exports=a},function(r,n,i){var a=i(2),s=i(10),o=i(13),l=i(0),u=i(16),h=i(4);function d(p,g,m,v){m==null&&v==null&&(v=g),a.call(this,v),p.graphManager!=null&&(p=p.graphManager),this.estimatedSize=s.MIN_VALUE,this.inclusionTreeDepth=s.MAX_VALUE,this.vGraphObject=v,this.edges=[],this.graphManager=p,m!=null&&g!=null?this.rect=new o(g.x,g.y,m.width,m.height):this.rect=new o}d.prototype=Object.create(a.prototype);for(var f in a)d[f]=a[f];d.prototype.getEdges=function(){return this.edges},d.prototype.getChild=function(){return this.child},d.prototype.getOwner=function(){return this.owner},d.prototype.getWidth=function(){return this.rect.width},d.prototype.setWidth=function(p){this.rect.width=p},d.prototype.getHeight=function(){return this.rect.height},d.prototype.setHeight=function(p){this.rect.height=p},d.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},d.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},d.prototype.getCenter=function(){return new h(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},d.prototype.getLocation=function(){return new h(this.rect.x,this.rect.y)},d.prototype.getRect=function(){return this.rect},d.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},d.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},d.prototype.setRect=function(p,g){this.rect.x=p.x,this.rect.y=p.y,this.rect.width=g.width,this.rect.height=g.height},d.prototype.setCenter=function(p,g){this.rect.x=p-this.rect.width/2,this.rect.y=g-this.rect.height/2},d.prototype.setLocation=function(p,g){this.rect.x=p,this.rect.y=g},d.prototype.moveBy=function(p,g){this.rect.x+=p,this.rect.y+=g},d.prototype.getEdgeListToNode=function(p){var g=[],m=this;return m.edges.forEach(function(v){if(v.target==p){if(v.source!=m)throw"Incorrect edge source!";g.push(v)}}),g},d.prototype.getEdgesBetween=function(p){var g=[],m=this;return m.edges.forEach(function(v){if(!(v.source==m||v.target==m))throw"Incorrect edge source and/or target";(v.target==p||v.source==p)&&g.push(v)}),g},d.prototype.getNeighborsList=function(){var p=new Set,g=this;return g.edges.forEach(function(m){if(m.source==g)p.add(m.target);else{if(m.target!=g)throw"Incorrect incidency!";p.add(m.source)}}),p},d.prototype.withChildren=function(){var p=new Set,g,m;if(p.add(this),this.child!=null)for(var v=this.child.getNodes(),y=0;y<v.length;y++)g=v[y],m=g.withChildren(),m.forEach(function(b){p.add(b)});return p},d.prototype.getNoOfChildren=function(){var p=0,g;if(this.child==null)p=1;else for(var m=this.child.getNodes(),v=0;v<m.length;v++)g=m[v],p+=g.getNoOfChildren();return p==0&&(p=1),p},d.prototype.getEstimatedSize=function(){if(this.estimatedSize==s.MIN_VALUE)throw"assert failed";return this.estimatedSize},d.prototype.calcEstimatedSize=function(){return this.child==null?this.estimatedSize=(this.rect.width+this.rect.height)/2:(this.estimatedSize=this.child.calcEstimatedSize(),this.rect.width=this.estimatedSize,this.rect.height=this.estimatedSize,this.estimatedSize)},d.prototype.scatter=function(){var p,g,m=-l.INITIAL_WORLD_BOUNDARY,v=l.INITIAL_WORLD_BOUNDARY;p=l.WORLD_CENTER_X+u.nextDouble()*(v-m)+m;var y=-l.INITIAL_WORLD_BOUNDARY,b=l.INITIAL_WORLD_BOUNDARY;g=l.WORLD_CENTER_Y+u.nextDouble()*(b-y)+y,this.rect.x=p,this.rect.y=g},d.prototype.updateBounds=function(){if(this.getChild()==null)throw"assert failed";if(this.getChild().getNodes().length!=0){var p=this.getChild();if(p.updateBounds(!0),this.rect.x=p.getLeft(),this.rect.y=p.getTop(),this.setWidth(p.getRight()-p.getLeft()),this.setHeight(p.getBottom()-p.getTop()),l.NODE_DIMENSIONS_INCLUDE_LABELS){var g=p.getRight()-p.getLeft(),m=p.getBottom()-p.getTop();this.labelWidth>g&&(this.rect.x-=(this.labelWidth-g)/2,this.setWidth(this.labelWidth)),this.labelHeight>m&&(this.labelPos=="center"?this.rect.y-=(this.labelHeight-m)/2:this.labelPos=="top"&&(this.rect.y-=this.labelHeight-m),this.setHeight(this.labelHeight))}}},d.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==s.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},d.prototype.transform=function(p){var g=this.rect.x;g>l.WORLD_BOUNDARY?g=l.WORLD_BOUNDARY:g<-l.WORLD_BOUNDARY&&(g=-l.WORLD_BOUNDARY);var m=this.rect.y;m>l.WORLD_BOUNDARY?m=l.WORLD_BOUNDARY:m<-l.WORLD_BOUNDARY&&(m=-l.WORLD_BOUNDARY);var v=new h(g,m),y=p.inverseTransformPoint(v);this.setLocation(y.x,y.y)},d.prototype.getLeft=function(){return this.rect.x},d.prototype.getRight=function(){return this.rect.x+this.rect.width},d.prototype.getTop=function(){return this.rect.y},d.prototype.getBottom=function(){return this.rect.y+this.rect.height},d.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},r.exports=d},function(r,n,i){function a(s,o){s==null&&o==null?(this.x=0,this.y=0):(this.x=s,this.y=o)}a.prototype.getX=function(){return this.x},a.prototype.getY=function(){return this.y},a.prototype.setX=function(s){this.x=s},a.prototype.setY=function(s){this.y=s},a.prototype.getDifference=function(s){return new DimensionD(this.x-s.x,this.y-s.y)},a.prototype.getCopy=function(){return new a(this.x,this.y)},a.prototype.translate=function(s){return this.x+=s.width,this.y+=s.height,this},r.exports=a},function(r,n,i){var a=i(2),s=i(10),o=i(0),l=i(6),u=i(3),h=i(1),d=i(13),f=i(12),p=i(11);function g(v,y,b){a.call(this,b),this.estimatedSize=s.MIN_VALUE,this.margin=o.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=v,y!=null&&y instanceof l?this.graphManager=y:y!=null&&y instanceof Layout&&(this.graphManager=y.graphManager)}g.prototype=Object.create(a.prototype);for(var m in a)g[m]=a[m];g.prototype.getNodes=function(){return this.nodes},g.prototype.getEdges=function(){return this.edges},g.prototype.getGraphManager=function(){return this.graphManager},g.prototype.getParent=function(){return this.parent},g.prototype.getLeft=function(){return this.left},g.prototype.getRight=function(){return this.right},g.prototype.getTop=function(){return this.top},g.prototype.getBottom=function(){return this.bottom},g.prototype.isConnected=function(){return this.isConnected},g.prototype.add=function(v,y,b){if(y==null&&b==null){var w=v;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(w)>-1)throw"Node already in graph!";return w.owner=this,this.getNodes().push(w),w}else{var T=v;if(!(this.getNodes().indexOf(y)>-1&&this.getNodes().indexOf(b)>-1))throw"Source or target not in graph!";if(!(y.owner==b.owner&&y.owner==this))throw"Both owners must be this graph!";return y.owner!=b.owner?null:(T.source=y,T.target=b,T.isInterGraph=!1,this.getEdges().push(T),y.edges.push(T),b!=y&&b.edges.push(T),T)}},g.prototype.remove=function(v){var y=v;if(v instanceof u){if(y==null)throw"Node is null!";if(!(y.owner!=null&&y.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";for(var b=y.edges.slice(),w,T=b.length,E=0;E<T;E++)w=b[E],w.isInterGraph?this.graphManager.remove(w):w.source.owner.remove(w);var L=this.nodes.indexOf(y);if(L==-1)throw"Node not in owner node list!";this.nodes.splice(L,1)}else if(v instanceof h){var w=v;if(w==null)throw"Edge is null!";if(!(w.source!=null&&w.target!=null))throw"Source and/or target is null!";if(!(w.source.owner!=null&&w.target.owner!=null&&w.source.owner==this&&w.target.owner==this))throw"Source and/or target owner is invalid!";var S=w.source.edges.indexOf(w),C=w.target.edges.indexOf(w);if(!(S>-1&&C>-1))throw"Source and/or target doesn't know this edge!";w.source.edges.splice(S,1),w.target!=w.source&&w.target.edges.splice(C,1);var L=w.source.owner.getEdges().indexOf(w);if(L==-1)throw"Not in owner's edge list!";w.source.owner.getEdges().splice(L,1)}},g.prototype.updateLeftTop=function(){for(var v=s.MAX_VALUE,y=s.MAX_VALUE,b,w,T,E=this.getNodes(),L=E.length,S=0;S<L;S++){var C=E[S];b=C.getTop(),w=C.getLeft(),v>b&&(v=b),y>w&&(y=w)}return v==s.MAX_VALUE?null:(E[0].getParent().paddingLeft!=null?T=E[0].getParent().paddingLeft:T=this.margin,this.left=y-T,this.top=v-T,new f(this.left,this.top))},g.prototype.updateBounds=function(v){for(var y=s.MAX_VALUE,b=-s.MAX_VALUE,w=s.MAX_VALUE,T=-s.MAX_VALUE,E,L,S,C,A,N=this.nodes,_=N.length,O=0;O<_;O++){var P=N[O];v&&P.child!=null&&P.updateBounds(),E=P.getLeft(),L=P.getRight(),S=P.getTop(),C=P.getBottom(),y>E&&(y=E),b<L&&(b=L),w>S&&(w=S),T<C&&(T=C)}var k=new d(y,w,b-y,T-w);y==s.MAX_VALUE&&(this.left=this.parent.getLeft(),this.right=this.parent.getRight(),this.top=this.parent.getTop(),this.bottom=this.parent.getBottom()),N[0].getParent().paddingLeft!=null?A=N[0].getParent().paddingLeft:A=this.margin,this.left=k.x-A,this.right=k.x+k.width+A,this.top=k.y-A,this.bottom=k.y+k.height+A},g.calculateBounds=function(v){for(var y=s.MAX_VALUE,b=-s.MAX_VALUE,w=s.MAX_VALUE,T=-s.MAX_VALUE,E,L,S,C,A=v.length,N=0;N<A;N++){var _=v[N];E=_.getLeft(),L=_.getRight(),S=_.getTop(),C=_.getBottom(),y>E&&(y=E),b<L&&(b=L),w>S&&(w=S),T<C&&(T=C)}var O=new d(y,w,b-y,T-w);return O},g.prototype.getInclusionTreeDepth=function(){return this==this.graphManager.getRoot()?1:this.parent.getInclusionTreeDepth()},g.prototype.getEstimatedSize=function(){if(this.estimatedSize==s.MIN_VALUE)throw"assert failed";return this.estimatedSize},g.prototype.calcEstimatedSize=function(){for(var v=0,y=this.nodes,b=y.length,w=0;w<b;w++){var T=y[w];v+=T.calcEstimatedSize()}return v==0?this.estimatedSize=o.EMPTY_COMPOUND_NODE_SIZE:this.estimatedSize=v/Math.sqrt(this.nodes.length),this.estimatedSize},g.prototype.updateConnected=function(){var v=this;if(this.nodes.length==0){this.isConnected=!0;return}var y=new p,b=new Set,w=this.nodes[0],T,E,L=w.withChildren();for(L.forEach(function(O){y.push(O),b.add(O)});y.length!==0;){w=y.shift(),T=w.getEdges();for(var S=T.length,C=0;C<S;C++){var A=T[C];if(E=A.getOtherEndInGraph(w,this),E!=null&&!b.has(E)){var N=E.withChildren();N.forEach(function(O){y.push(O),b.add(O)})}}}if(this.isConnected=!1,b.size>=this.nodes.length){var _=0;b.forEach(function(O){O.owner==v&&_++}),_==this.nodes.length&&(this.isConnected=!0)}},r.exports=g},function(r,n,i){var a,s=i(1);function o(l){a=i(5),this.layout=l,this.graphs=[],this.edges=[]}o.prototype.addRoot=function(){var l=this.layout.newGraph(),u=this.layout.newNode(null),h=this.add(l,u);return this.setRootGraph(h),this.rootGraph},o.prototype.add=function(l,u,h,d,f){if(h==null&&d==null&&f==null){if(l==null)throw"Graph is null!";if(u==null)throw"Parent node is null!";if(this.graphs.indexOf(l)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(l),l.parent!=null)throw"Already has a parent!";if(u.child!=null)throw"Already has a child!";return l.parent=u,u.child=l,l}else{f=h,d=u,h=l;var p=d.getOwner(),g=f.getOwner();if(!(p!=null&&p.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(g!=null&&g.getGraphManager()==this))throw"Target not in this graph mgr!";if(p==g)return h.isInterGraph=!1,p.add(h,d,f);if(h.isInterGraph=!0,h.source=d,h.target=f,this.edges.indexOf(h)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(h),!(h.source!=null&&h.target!=null))throw"Edge source and/or target is null!";if(!(h.source.edges.indexOf(h)==-1&&h.target.edges.indexOf(h)==-1))throw"Edge already in source and/or target incidency list!";return h.source.edges.push(h),h.target.edges.push(h),h}},o.prototype.remove=function(l){if(l instanceof a){var u=l;if(u.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(u==this.rootGraph||u.parent!=null&&u.parent.graphManager==this))throw"Invalid parent node!";var h=[];h=h.concat(u.getEdges());for(var d,f=h.length,p=0;p<f;p++)d=h[p],u.remove(d);var g=[];g=g.concat(u.getNodes());var m;f=g.length;for(var p=0;p<f;p++)m=g[p],u.remove(m);u==this.rootGraph&&this.setRootGraph(null);var v=this.graphs.indexOf(u);this.graphs.splice(v,1),u.parent=null}else if(l instanceof s){if(d=l,d==null)throw"Edge is null!";if(!d.isInterGraph)throw"Not an inter-graph edge!";if(!(d.source!=null&&d.target!=null))throw"Source and/or target is null!";if(!(d.source.edges.indexOf(d)!=-1&&d.target.edges.indexOf(d)!=-1))throw"Source and/or target doesn't know this edge!";var v=d.source.edges.indexOf(d);if(d.source.edges.splice(v,1),v=d.target.edges.indexOf(d),d.target.edges.splice(v,1),!(d.source.owner!=null&&d.source.owner.getGraphManager()!=null))throw"Edge owner graph or owner graph manager is null!";if(d.source.owner.getGraphManager().edges.indexOf(d)==-1)throw"Not in owner graph manager's edge list!";var v=d.source.owner.getGraphManager().edges.indexOf(d);d.source.owner.getGraphManager().edges.splice(v,1)}},o.prototype.updateBounds=function(){this.rootGraph.updateBounds(!0)},o.prototype.getGraphs=function(){return this.graphs},o.prototype.getAllNodes=function(){if(this.allNodes==null){for(var l=[],u=this.getGraphs(),h=u.length,d=0;d<h;d++)l=l.concat(u[d].getNodes());this.allNodes=l}return this.allNodes},o.prototype.resetAllNodes=function(){this.allNodes=null},o.prototype.resetAllEdges=function(){this.allEdges=null},o.prototype.resetAllNodesToApplyGravitation=function(){this.allNodesToApplyGravitation=null},o.prototype.getAllEdges=function(){if(this.allEdges==null){var l=[],u=this.getGraphs();u.length;for(var h=0;h<u.length;h++)l=l.concat(u[h].getEdges());l=l.concat(this.edges),this.allEdges=l}return this.allEdges},o.prototype.getAllNodesToApplyGravitation=function(){return this.allNodesToApplyGravitation},o.prototype.setAllNodesToApplyGravitation=function(l){if(this.allNodesToApplyGravitation!=null)throw"assert failed";this.allNodesToApplyGravitation=l},o.prototype.getRoot=function(){return this.rootGraph},o.prototype.setRootGraph=function(l){if(l.getGraphManager()!=this)throw"Root not in this graph mgr!";this.rootGraph=l,l.parent==null&&(l.parent=this.layout.newNode("Root node"))},o.prototype.getLayout=function(){return this.layout},o.prototype.isOneAncestorOfOther=function(l,u){if(!(l!=null&&u!=null))throw"assert failed";if(l==u)return!0;var h=l.getOwner(),d;do{if(d=h.getParent(),d==null)break;if(d==u)return!0;if(h=d.getOwner(),h==null)break}while(!0);h=u.getOwner();do{if(d=h.getParent(),d==null)break;if(d==l)return!0;if(h=d.getOwner(),h==null)break}while(!0);return!1},o.prototype.calcLowestCommonAncestors=function(){for(var l,u,h,d,f,p=this.getAllEdges(),g=p.length,m=0;m<g;m++){if(l=p[m],u=l.source,h=l.target,l.lca=null,l.sourceInLca=u,l.targetInLca=h,u==h){l.lca=u.getOwner();continue}for(d=u.getOwner();l.lca==null;){for(l.targetInLca=h,f=h.getOwner();l.lca==null;){if(f==d){l.lca=f;break}if(f==this.rootGraph)break;if(l.lca!=null)throw"assert failed";l.targetInLca=f.getParent(),f=l.targetInLca.getOwner()}if(d==this.rootGraph)break;l.lca==null&&(l.sourceInLca=d.getParent(),d=l.sourceInLca.getOwner())}if(l.lca==null)throw"assert failed"}},o.prototype.calcLowestCommonAncestor=function(l,u){if(l==u)return l.getOwner();var h=l.getOwner();do{if(h==null)break;var d=u.getOwner();do{if(d==null)break;if(d==h)return d;d=d.getParent().getOwner()}while(!0);h=h.getParent().getOwner()}while(!0);return h},o.prototype.calcInclusionTreeDepths=function(l,u){l==null&&u==null&&(l=this.rootGraph,u=1);for(var h,d=l.getNodes(),f=d.length,p=0;p<f;p++)h=d[p],h.inclusionTreeDepth=u,h.child!=null&&this.calcInclusionTreeDepths(h.child,u+1)},o.prototype.includesInvalidEdge=function(){for(var l,u=this.edges.length,h=0;h<u;h++)if(l=this.edges[h],this.isOneAncestorOfOther(l.source,l.target))return!0;return!1},r.exports=o},function(r,n,i){var a=i(0);function s(){}for(var o in a)s[o]=a[o];s.MAX_ITERATIONS=2500,s.DEFAULT_EDGE_LENGTH=50,s.DEFAULT_SPRING_STRENGTH=.45,s.DEFAULT_REPULSION_STRENGTH=4500,s.DEFAULT_GRAVITY_STRENGTH=.4,s.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,s.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,s.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,s.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,s.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,s.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,s.COOLING_ADAPTATION_FACTOR=.33,s.ADAPTATION_LOWER_NODE_LIMIT=1e3,s.ADAPTATION_UPPER_NODE_LIMIT=5e3,s.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,s.MAX_NODE_DISPLACEMENT=s.MAX_NODE_DISPLACEMENT_INCREMENTAL*3,s.MIN_REPULSION_DIST=s.DEFAULT_EDGE_LENGTH/10,s.CONVERGENCE_CHECK_PERIOD=100,s.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,s.MIN_EDGE_LENGTH=1,s.GRID_CALCULATION_CHECK_PERIOD=10,r.exports=s},function(r,n,i){var a=i(12);function s(){}s.calcSeparationAmount=function(o,l,u,h){if(!o.intersects(l))throw"assert failed";var d=new Array(2);this.decideDirectionsForOverlappingNodes(o,l,d),u[0]=Math.min(o.getRight(),l.getRight())-Math.max(o.x,l.x),u[1]=Math.min(o.getBottom(),l.getBottom())-Math.max(o.y,l.y),o.getX()<=l.getX()&&o.getRight()>=l.getRight()?u[0]+=Math.min(l.getX()-o.getX(),o.getRight()-l.getRight()):l.getX()<=o.getX()&&l.getRight()>=o.getRight()&&(u[0]+=Math.min(o.getX()-l.getX(),l.getRight()-o.getRight())),o.getY()<=l.getY()&&o.getBottom()>=l.getBottom()?u[1]+=Math.min(l.getY()-o.getY(),o.getBottom()-l.getBottom()):l.getY()<=o.getY()&&l.getBottom()>=o.getBottom()&&(u[1]+=Math.min(o.getY()-l.getY(),l.getBottom()-o.getBottom()));var f=Math.abs((l.getCenterY()-o.getCenterY())/(l.getCenterX()-o.getCenterX()));l.getCenterY()===o.getCenterY()&&l.getCenterX()===o.getCenterX()&&(f=1);var p=f*u[0],g=u[1]/f;u[0]<g?g=u[0]:p=u[1],u[0]=-1*d[0]*(g/2+h),u[1]=-1*d[1]*(p/2+h)},s.decideDirectionsForOverlappingNodes=function(o,l,u){o.getCenterX()<l.getCenterX()?u[0]=-1:u[0]=1,o.getCenterY()<l.getCenterY()?u[1]=-1:u[1]=1},s.getIntersection2=function(o,l,u){var h=o.getCenterX(),d=o.getCenterY(),f=l.getCenterX(),p=l.getCenterY();if(o.intersects(l))return u[0]=h,u[1]=d,u[2]=f,u[3]=p,!0;var g=o.getX(),m=o.getY(),v=o.getRight(),y=o.getX(),b=o.getBottom(),w=o.getRight(),T=o.getWidthHalf(),E=o.getHeightHalf(),L=l.getX(),S=l.getY(),C=l.getRight(),A=l.getX(),N=l.getBottom(),_=l.getRight(),O=l.getWidthHalf(),P=l.getHeightHalf(),k=!1,R=!1;if(h===f){if(d>p)return u[0]=h,u[1]=m,u[2]=f,u[3]=N,!1;if(d<p)return u[0]=h,u[1]=b,u[2]=f,u[3]=S,!1}else if(d===p){if(h>f)return u[0]=g,u[1]=d,u[2]=C,u[3]=p,!1;if(h<f)return u[0]=v,u[1]=d,u[2]=L,u[3]=p,!1}else{var I=o.height/o.width,M=l.height/l.width,D=(p-d)/(f-h),B=void 0,$=void 0,F=void 0,G=void 0,W=void 0,J=void 0;if(-I===D?h>f?(u[0]=y,u[1]=b,k=!0):(u[0]=v,u[1]=m,k=!0):I===D&&(h>f?(u[0]=g,u[1]=m,k=!0):(u[0]=w,u[1]=b,k=!0)),-M===D?f>h?(u[2]=A,u[3]=N,R=!0):(u[2]=C,u[3]=S,R=!0):M===D&&(f>h?(u[2]=L,u[3]=S,R=!0):(u[2]=_,u[3]=N,R=!0)),k&&R)return!1;if(h>f?d>p?(B=this.getCardinalDirection(I,D,4),$=this.getCardinalDirection(M,D,2)):(B=this.getCardinalDirection(-I,D,3),$=this.getCardinalDirection(-M,D,1)):d>p?(B=this.getCardinalDirection(-I,D,1),$=this.getCardinalDirection(-M,D,3)):(B=this.getCardinalDirection(I,D,2),$=this.getCardinalDirection(M,D,4)),!k)switch(B){case 1:G=m,F=h+-E/D,u[0]=F,u[1]=G;break;case 2:F=w,G=d+T*D,u[0]=F,u[1]=G;break;case 3:G=b,F=h+E/D,u[0]=F,u[1]=G;break;case 4:F=y,G=d+-T*D,u[0]=F,u[1]=G;break}if(!R)switch($){case 1:J=S,W=f+-P/D,u[2]=W,u[3]=J;break;case 2:W=_,J=p+O*D,u[2]=W,u[3]=J;break;case 3:J=N,W=f+P/D,u[2]=W,u[3]=J;break;case 4:W=A,J=p+-O*D,u[2]=W,u[3]=J;break}}return!1},s.getCardinalDirection=function(o,l,u){return o>l?u:1+u%4},s.getIntersection=function(o,l,u,h){if(h==null)return this.getIntersection2(o,l,u);var d=o.x,f=o.y,p=l.x,g=l.y,m=u.x,v=u.y,y=h.x,b=h.y,w=void 0,T=void 0,E=void 0,L=void 0,S=void 0,C=void 0,A=void 0,N=void 0,_=void 0;return E=g-f,S=d-p,A=p*f-d*g,L=b-v,C=m-y,N=y*v-m*b,_=E*C-L*S,_===0?null:(w=(S*N-C*A)/_,T=(L*A-E*N)/_,new a(w,T))},s.angleOfVector=function(o,l,u,h){var d=void 0;return o!==u?(d=Math.atan((h-l)/(u-o)),u<o?d+=Math.PI:h<l&&(d+=this.TWO_PI)):h<l?d=this.ONE_AND_HALF_PI:d=this.HALF_PI,d},s.doIntersect=function(o,l,u,h){var d=o.x,f=o.y,p=l.x,g=l.y,m=u.x,v=u.y,y=h.x,b=h.y,w=(p-d)*(b-v)-(y-m)*(g-f);if(w===0)return!1;var T=((b-v)*(y-d)+(m-y)*(b-f))/w,E=((f-g)*(y-d)+(p-d)*(b-f))/w;return 0<T&&T<1&&0<E&&E<1},s.HALF_PI=.5*Math.PI,s.ONE_AND_HALF_PI=1.5*Math.PI,s.TWO_PI=2*Math.PI,s.THREE_PI=3*Math.PI,r.exports=s},function(r,n,i){function a(){}a.sign=function(s){return s>0?1:s<0?-1:0},a.floor=function(s){return s<0?Math.ceil(s):Math.floor(s)},a.ceil=function(s){return s<0?Math.floor(s):Math.ceil(s)},r.exports=a},function(r,n,i){function a(){}a.MAX_VALUE=2147483647,a.MIN_VALUE=-2147483648,r.exports=a},function(r,n,i){var a=function(){function d(f,p){for(var g=0;g<p.length;g++){var m=p[g];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(f,m.key,m)}}return function(f,p,g){return p&&d(f.prototype,p),g&&d(f,g),f}}();function s(d,f){if(!(d instanceof f))throw new TypeError("Cannot call a class as a function")}var o=function(f){return{value:f,next:null,prev:null}},l=function(f,p,g,m){return f!==null?f.next=p:m.head=p,g!==null?g.prev=p:m.tail=p,p.prev=f,p.next=g,m.length++,p},u=function(f,p){var g=f.prev,m=f.next;return g!==null?g.next=m:p.head=m,m!==null?m.prev=g:p.tail=g,f.prev=f.next=null,p.length--,f},h=function(){function d(f){var p=this;s(this,d),this.length=0,this.head=null,this.tail=null,f?.forEach(function(g){return p.push(g)})}return a(d,[{key:"size",value:function(){return this.length}},{key:"insertBefore",value:function(p,g){return l(g.prev,o(p),g,this)}},{key:"insertAfter",value:function(p,g){return l(g,o(p),g.next,this)}},{key:"insertNodeBefore",value:function(p,g){return l(g.prev,p,g,this)}},{key:"insertNodeAfter",value:function(p,g){return l(g,p,g.next,this)}},{key:"push",value:function(p){return l(this.tail,o(p),null,this)}},{key:"unshift",value:function(p){return l(null,o(p),this.head,this)}},{key:"remove",value:function(p){return u(p,this)}},{key:"pop",value:function(){return u(this.tail,this).value}},{key:"popNode",value:function(){return u(this.tail,this)}},{key:"shift",value:function(){return u(this.head,this).value}},{key:"shiftNode",value:function(){return u(this.head,this)}},{key:"get_object_at",value:function(p){if(p<=this.length()){for(var g=1,m=this.head;g<p;)m=m.next,g++;return m.value}}},{key:"set_object_at",value:function(p,g){if(p<=this.length()){for(var m=1,v=this.head;m<p;)v=v.next,m++;v.value=g}}}]),d}();r.exports=h},function(r,n,i){function a(s,o,l){this.x=null,this.y=null,s==null&&o==null&&l==null?(this.x=0,this.y=0):typeof s=="number"&&typeof o=="number"&&l==null?(this.x=s,this.y=o):s.constructor.name=="Point"&&o==null&&l==null&&(l=s,this.x=l.x,this.y=l.y)}a.prototype.getX=function(){return this.x},a.prototype.getY=function(){return this.y},a.prototype.getLocation=function(){return new a(this.x,this.y)},a.prototype.setLocation=function(s,o,l){s.constructor.name=="Point"&&o==null&&l==null?(l=s,this.setLocation(l.x,l.y)):typeof s=="number"&&typeof o=="number"&&l==null&&(parseInt(s)==s&&parseInt(o)==o?this.move(s,o):(this.x=Math.floor(s+.5),this.y=Math.floor(o+.5)))},a.prototype.move=function(s,o){this.x=s,this.y=o},a.prototype.translate=function(s,o){this.x+=s,this.y+=o},a.prototype.equals=function(s){if(s.constructor.name=="Point"){var o=s;return this.x==o.x&&this.y==o.y}return this==s},a.prototype.toString=function(){return new a().constructor.name+"[x="+this.x+",y="+this.y+"]"},r.exports=a},function(r,n,i){function a(s,o,l,u){this.x=0,this.y=0,this.width=0,this.height=0,s!=null&&o!=null&&l!=null&&u!=null&&(this.x=s,this.y=o,this.width=l,this.height=u)}a.prototype.getX=function(){return this.x},a.prototype.setX=function(s){this.x=s},a.prototype.getY=function(){return this.y},a.prototype.setY=function(s){this.y=s},a.prototype.getWidth=function(){return this.width},a.prototype.setWidth=function(s){this.width=s},a.prototype.getHeight=function(){return this.height},a.prototype.setHeight=function(s){this.height=s},a.prototype.getRight=function(){return this.x+this.width},a.prototype.getBottom=function(){return this.y+this.height},a.prototype.intersects=function(s){return!(this.getRight()<s.x||this.getBottom()<s.y||s.getRight()<this.x||s.getBottom()<this.y)},a.prototype.getCenterX=function(){return this.x+this.width/2},a.prototype.getMinX=function(){return this.getX()},a.prototype.getMaxX=function(){return this.getX()+this.width},a.prototype.getCenterY=function(){return this.y+this.height/2},a.prototype.getMinY=function(){return this.getY()},a.prototype.getMaxY=function(){return this.getY()+this.height},a.prototype.getWidthHalf=function(){return this.width/2},a.prototype.getHeightHalf=function(){return this.height/2},r.exports=a},function(r,n,i){var a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(o){return typeof o}:function(o){return o&&typeof Symbol=="function"&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o};function s(){}s.lastID=0,s.createID=function(o){return s.isPrimitive(o)?o:(o.uniqueID!=null||(o.uniqueID=s.getString(),s.lastID++),o.uniqueID)},s.getString=function(o){return o==null&&(o=s.lastID),"Object#"+o},s.isPrimitive=function(o){var l=typeof o>"u"?"undefined":a(o);return o==null||l!="object"&&l!="function"},r.exports=s},function(r,n,i){function a(m){if(Array.isArray(m)){for(var v=0,y=Array(m.length);v<m.length;v++)y[v]=m[v];return y}else return Array.from(m)}var s=i(0),o=i(6),l=i(3),u=i(1),h=i(5),d=i(4),f=i(17),p=i(27);function g(m){p.call(this),this.layoutQuality=s.QUALITY,this.createBendsAsNeeded=s.DEFAULT_CREATE_BENDS_AS_NEEDED,this.incremental=s.DEFAULT_INCREMENTAL,this.animationOnLayout=s.DEFAULT_ANIMATION_ON_LAYOUT,this.animationDuringLayout=s.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=s.DEFAULT_ANIMATION_PERIOD,this.uniformLeafNodeSizes=s.DEFAULT_UNIFORM_LEAF_NODE_SIZES,this.edgeToDummyNodes=new Map,this.graphManager=new o(this),this.isLayoutFinished=!1,this.isSubLayout=!1,this.isRemoteUse=!1,m!=null&&(this.isRemoteUse=m)}g.RANDOM_SEED=1,g.prototype=Object.create(p.prototype),g.prototype.getGraphManager=function(){return this.graphManager},g.prototype.getAllNodes=function(){return this.graphManager.getAllNodes()},g.prototype.getAllEdges=function(){return this.graphManager.getAllEdges()},g.prototype.getAllNodesToApplyGravitation=function(){return this.graphManager.getAllNodesToApplyGravitation()},g.prototype.newGraphManager=function(){var m=new o(this);return this.graphManager=m,m},g.prototype.newGraph=function(m){return new h(null,this.graphManager,m)},g.prototype.newNode=function(m){return new l(this.graphManager,m)},g.prototype.newEdge=function(m){return new u(null,null,m)},g.prototype.checkLayoutSuccess=function(){return this.graphManager.getRoot()==null||this.graphManager.getRoot().getNodes().length==0||this.graphManager.includesInvalidEdge()},g.prototype.runLayout=function(){this.isLayoutFinished=!1,this.tilingPreLayout&&this.tilingPreLayout(),this.initParameters();var m;return this.checkLayoutSuccess()?m=!1:m=this.layout(),s.ANIMATE==="during"?!1:(m&&(this.isSubLayout||this.doPostLayout()),this.tilingPostLayout&&this.tilingPostLayout(),this.isLayoutFinished=!0,m)},g.prototype.doPostLayout=function(){this.incremental||this.transform(),this.update()},g.prototype.update2=function(){if(this.createBendsAsNeeded&&(this.createBendpointsFromDummyNodes(),this.graphManager.resetAllEdges()),!this.isRemoteUse){for(var m=this.graphManager.getAllEdges(),v=0;v<m.length;v++)m[v];for(var y=this.graphManager.getRoot().getNodes(),v=0;v<y.length;v++)y[v];this.update(this.graphManager.getRoot())}},g.prototype.update=function(m){if(m==null)this.update2();else if(m instanceof l){var v=m;if(v.getChild()!=null)for(var y=v.getChild().getNodes(),b=0;b<y.length;b++)update(y[b]);if(v.vGraphObject!=null){var w=v.vGraphObject;w.update(v)}}else if(m instanceof u){var T=m;if(T.vGraphObject!=null){var E=T.vGraphObject;E.update(T)}}else if(m instanceof h){var L=m;if(L.vGraphObject!=null){var S=L.vGraphObject;S.update(L)}}},g.prototype.initParameters=function(){this.isSubLayout||(this.layoutQuality=s.QUALITY,this.animationDuringLayout=s.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=s.DEFAULT_ANIMATION_PERIOD,this.animationOnLayout=s.DEFAULT_ANIMATION_ON_LAYOUT,this.incremental=s.DEFAULT_INCREMENTAL,this.createBendsAsNeeded=s.DEFAULT_CREATE_BENDS_AS_NEEDED,this.uniformLeafNodeSizes=s.DEFAULT_UNIFORM_LEAF_NODE_SIZES),this.animationDuringLayout&&(this.animationOnLayout=!1)},g.prototype.transform=function(m){if(m==null)this.transform(new d(0,0));else{var v=new f,y=this.graphManager.getRoot().updateLeftTop();if(y!=null){v.setWorldOrgX(m.x),v.setWorldOrgY(m.y),v.setDeviceOrgX(y.x),v.setDeviceOrgY(y.y);for(var b=this.getAllNodes(),w,T=0;T<b.length;T++)w=b[T],w.transform(v)}}},g.prototype.positionNodesRandomly=function(m){if(m==null)this.positionNodesRandomly(this.getGraphManager().getRoot()),this.getGraphManager().getRoot().updateBounds(!0);else for(var v,y,b=m.getNodes(),w=0;w<b.length;w++)v=b[w],y=v.getChild(),y==null||y.getNodes().length==0?v.scatter():(this.positionNodesRandomly(y),v.updateBounds())},g.prototype.getFlatForest=function(){for(var m=[],v=!0,y=this.graphManager.getRoot().getNodes(),b=!0,w=0;w<y.length;w++)y[w].getChild()!=null&&(b=!1);if(!b)return m;var T=new Set,E=[],L=new Map,S=[];for(S=S.concat(y);S.length>0&&v;){for(E.push(S[0]);E.length>0&&v;){var C=E[0];E.splice(0,1),T.add(C);for(var A=C.getEdges(),w=0;w<A.length;w++){var N=A[w].getOtherEnd(C);if(L.get(C)!=N)if(!T.has(N))E.push(N),L.set(N,C);else{v=!1;break}}}if(!v)m=[];else{var _=[].concat(a(T));m.push(_);for(var w=0;w<_.length;w++){var O=_[w],P=S.indexOf(O);P>-1&&S.splice(P,1)}T=new Set,L=new Map}}return m},g.prototype.createDummyNodesForBendpoints=function(m){for(var v=[],y=m.source,b=this.graphManager.calcLowestCommonAncestor(m.source,m.target),w=0;w<m.bendpoints.length;w++){var T=this.newNode(null);T.setRect(new Point(0,0),new Dimension(1,1)),b.add(T);var E=this.newEdge(null);this.graphManager.add(E,y,T),v.add(T),y=T}var E=this.newEdge(null);return this.graphManager.add(E,y,m.target),this.edgeToDummyNodes.set(m,v),m.isInterGraph()?this.graphManager.remove(m):b.remove(m),v},g.prototype.createBendpointsFromDummyNodes=function(){var m=[];m=m.concat(this.graphManager.getAllEdges()),m=[].concat(a(this.edgeToDummyNodes.keys())).concat(m);for(var v=0;v<m.length;v++){var y=m[v];if(y.bendpoints.length>0){for(var b=this.edgeToDummyNodes.get(y),w=0;w<b.length;w++){var T=b[w],E=new d(T.getCenterX(),T.getCenterY()),L=y.bendpoints.get(w);L.x=E.x,L.y=E.y,T.getOwner().remove(T)}this.graphManager.add(y,y.source,y.target)}}},g.transform=function(m,v,y,b){if(y!=null&&b!=null){var w=v;if(m<=50){var T=v/y;w-=(v-T)/50*(50-m)}else{var E=v*b;w+=(E-v)/50*(m-50)}return w}else{var L,S;return m<=50?(L=9*v/500,S=v/10):(L=9*v/50,S=-8*v),L*m+S}},g.findCenterOfTree=function(m){var v=[];v=v.concat(m);var y=[],b=new Map,w=!1,T=null;(v.length==1||v.length==2)&&(w=!0,T=v[0]);for(var E=0;E<v.length;E++){var L=v[E],S=L.getNeighborsList().size;b.set(L,L.getNeighborsList().size),S==1&&y.push(L)}var C=[];for(C=C.concat(y);!w;){var A=[];A=A.concat(C),C=[];for(var E=0;E<v.length;E++){var L=v[E],N=v.indexOf(L);N>=0&&v.splice(N,1);var _=L.getNeighborsList();_.forEach(function(k){if(y.indexOf(k)<0){var R=b.get(k),I=R-1;I==1&&C.push(k),b.set(k,I)}})}y=y.concat(C),(v.length==1||v.length==2)&&(w=!0,T=v[0])}return T},g.prototype.setGraphManager=function(m){this.graphManager=m},r.exports=g},function(r,n,i){function a(){}a.seed=1,a.x=0,a.nextDouble=function(){return a.x=Math.sin(a.seed++)*1e4,a.x-Math.floor(a.x)},r.exports=a},function(r,n,i){var a=i(4);function s(o,l){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}s.prototype.getWorldOrgX=function(){return this.lworldOrgX},s.prototype.setWorldOrgX=function(o){this.lworldOrgX=o},s.prototype.getWorldOrgY=function(){return this.lworldOrgY},s.prototype.setWorldOrgY=function(o){this.lworldOrgY=o},s.prototype.getWorldExtX=function(){return this.lworldExtX},s.prototype.setWorldExtX=function(o){this.lworldExtX=o},s.prototype.getWorldExtY=function(){return this.lworldExtY},s.prototype.setWorldExtY=function(o){this.lworldExtY=o},s.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},s.prototype.setDeviceOrgX=function(o){this.ldeviceOrgX=o},s.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},s.prototype.setDeviceOrgY=function(o){this.ldeviceOrgY=o},s.prototype.getDeviceExtX=function(){return this.ldeviceExtX},s.prototype.setDeviceExtX=function(o){this.ldeviceExtX=o},s.prototype.getDeviceExtY=function(){return this.ldeviceExtY},s.prototype.setDeviceExtY=function(o){this.ldeviceExtY=o},s.prototype.transformX=function(o){var l=0,u=this.lworldExtX;return u!=0&&(l=this.ldeviceOrgX+(o-this.lworldOrgX)*this.ldeviceExtX/u),l},s.prototype.transformY=function(o){var l=0,u=this.lworldExtY;return u!=0&&(l=this.ldeviceOrgY+(o-this.lworldOrgY)*this.ldeviceExtY/u),l},s.prototype.inverseTransformX=function(o){var l=0,u=this.ldeviceExtX;return u!=0&&(l=this.lworldOrgX+(o-this.ldeviceOrgX)*this.lworldExtX/u),l},s.prototype.inverseTransformY=function(o){var l=0,u=this.ldeviceExtY;return u!=0&&(l=this.lworldOrgY+(o-this.ldeviceOrgY)*this.lworldExtY/u),l},s.prototype.inverseTransformPoint=function(o){var l=new a(this.inverseTransformX(o.x),this.inverseTransformY(o.y));return l},r.exports=s},function(r,n,i){function a(p){if(Array.isArray(p)){for(var g=0,m=Array(p.length);g<p.length;g++)m[g]=p[g];return m}else return Array.from(p)}var s=i(15),o=i(7),l=i(0),u=i(8),h=i(9);function d(){s.call(this),this.useSmartIdealEdgeLengthCalculation=o.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.idealEdgeLength=o.DEFAULT_EDGE_LENGTH,this.springConstant=o.DEFAULT_SPRING_STRENGTH,this.repulsionConstant=o.DEFAULT_REPULSION_STRENGTH,this.gravityConstant=o.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=o.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=o.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=o.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.displacementThresholdPerNode=3*o.DEFAULT_EDGE_LENGTH/100,this.coolingFactor=o.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.initialCoolingFactor=o.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.totalDisplacement=0,this.oldTotalDisplacement=0,this.maxIterations=o.MAX_ITERATIONS}d.prototype=Object.create(s.prototype);for(var f in s)d[f]=s[f];d.prototype.initParameters=function(){s.prototype.initParameters.call(this,arguments),this.totalIterations=0,this.notAnimatedIterations=0,this.useFRGridVariant=o.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION,this.grid=[]},d.prototype.calcIdealEdgeLengths=function(){for(var p,g,m,v,y,b,w=this.getGraphManager().getAllEdges(),T=0;T<w.length;T++)p=w[T],p.idealLength=this.idealEdgeLength,p.isInterGraph&&(m=p.getSource(),v=p.getTarget(),y=p.getSourceInLca().getEstimatedSize(),b=p.getTargetInLca().getEstimatedSize(),this.useSmartIdealEdgeLengthCalculation&&(p.idealLength+=y+b-2*l.SIMPLE_NODE_SIZE),g=p.getLca().getInclusionTreeDepth(),p.idealLength+=o.DEFAULT_EDGE_LENGTH*o.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR*(m.getInclusionTreeDepth()+v.getInclusionTreeDepth()-2*g))},d.prototype.initSpringEmbedder=function(){var p=this.getAllNodes().length;this.incremental?(p>o.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*o.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(p-o.ADAPTATION_LOWER_NODE_LIMIT)/(o.ADAPTATION_UPPER_NODE_LIMIT-o.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-o.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=o.MAX_NODE_DISPLACEMENT_INCREMENTAL):(p>o.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(o.COOLING_ADAPTATION_FACTOR,1-(p-o.ADAPTATION_LOWER_NODE_LIMIT)/(o.ADAPTATION_UPPER_NODE_LIMIT-o.ADAPTATION_LOWER_NODE_LIMIT)*(1-o.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=o.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},d.prototype.calcSpringForces=function(){for(var p=this.getAllEdges(),g,m=0;m<p.length;m++)g=p[m],this.calcSpringForce(g,g.idealLength)},d.prototype.calcRepulsionForces=function(){var p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,m,v,y,b,w=this.getAllNodes(),T;if(this.useFRGridVariant)for(this.totalIterations%o.GRID_CALCULATION_CHECK_PERIOD==1&&p&&this.updateGrid(),T=new Set,m=0;m<w.length;m++)y=w[m],this.calculateRepulsionForceOfANode(y,T,p,g),T.add(y);else for(m=0;m<w.length;m++)for(y=w[m],v=m+1;v<w.length;v++)b=w[v],y.getOwner()==b.getOwner()&&this.calcRepulsionForce(y,b)},d.prototype.calcGravitationalForces=function(){for(var p,g=this.getAllNodesToApplyGravitation(),m=0;m<g.length;m++)p=g[m],this.calcGravitationalForce(p)},d.prototype.moveNodes=function(){for(var p=this.getAllNodes(),g,m=0;m<p.length;m++)g=p[m],g.move()},d.prototype.calcSpringForce=function(p,g){var m=p.getSource(),v=p.getTarget(),y,b,w,T;if(this.uniformLeafNodeSizes&&m.getChild()==null&&v.getChild()==null)p.updateLengthSimple();else if(p.updateLength(),p.isOverlapingSourceAndTarget)return;y=p.getLength(),y!=0&&(b=this.springConstant*(y-g),w=b*(p.lengthX/y),T=b*(p.lengthY/y),m.springForceX+=w,m.springForceY+=T,v.springForceX-=w,v.springForceY-=T)},d.prototype.calcRepulsionForce=function(p,g){var m=p.getRect(),v=g.getRect(),y=new Array(2),b=new Array(4),w,T,E,L,S,C,A;if(m.intersects(v)){u.calcSeparationAmount(m,v,y,o.DEFAULT_EDGE_LENGTH/2),C=2*y[0],A=2*y[1];var N=p.noOfChildren*g.noOfChildren/(p.noOfChildren+g.noOfChildren);p.repulsionForceX-=N*C,p.repulsionForceY-=N*A,g.repulsionForceX+=N*C,g.repulsionForceY+=N*A}else this.uniformLeafNodeSizes&&p.getChild()==null&&g.getChild()==null?(w=v.getCenterX()-m.getCenterX(),T=v.getCenterY()-m.getCenterY()):(u.getIntersection(m,v,b),w=b[2]-b[0],T=b[3]-b[1]),Math.abs(w)<o.MIN_REPULSION_DIST&&(w=h.sign(w)*o.MIN_REPULSION_DIST),Math.abs(T)<o.MIN_REPULSION_DIST&&(T=h.sign(T)*o.MIN_REPULSION_DIST),E=w*w+T*T,L=Math.sqrt(E),S=this.repulsionConstant*p.noOfChildren*g.noOfChildren/E,C=S*w/L,A=S*T/L,p.repulsionForceX-=C,p.repulsionForceY-=A,g.repulsionForceX+=C,g.repulsionForceY+=A},d.prototype.calcGravitationalForce=function(p){var g,m,v,y,b,w,T,E;g=p.getOwner(),m=(g.getRight()+g.getLeft())/2,v=(g.getTop()+g.getBottom())/2,y=p.getCenterX()-m,b=p.getCenterY()-v,w=Math.abs(y)+p.getWidth()/2,T=Math.abs(b)+p.getHeight()/2,p.getOwner()==this.graphManager.getRoot()?(E=g.getEstimatedSize()*this.gravityRangeFactor,(w>E||T>E)&&(p.gravitationForceX=-this.gravityConstant*y,p.gravitationForceY=-this.gravityConstant*b)):(E=g.getEstimatedSize()*this.compoundGravityRangeFactor,(w>E||T>E)&&(p.gravitationForceX=-this.gravityConstant*y*this.compoundGravityConstant,p.gravitationForceY=-this.gravityConstant*b*this.compoundGravityConstant))},d.prototype.isConverged=function(){var p,g=!1;return this.totalIterations>this.maxIterations/3&&(g=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),p=this.totalDisplacement<this.totalDisplacementThreshold,this.oldTotalDisplacement=this.totalDisplacement,p||g},d.prototype.animate=function(){this.animationDuringLayout&&!this.isSubLayout&&(this.notAnimatedIterations==this.animationPeriod?(this.update(),this.notAnimatedIterations=0):this.notAnimatedIterations++)},d.prototype.calcNoOfChildrenForAllNodes=function(){for(var p,g=this.graphManager.getAllNodes(),m=0;m<g.length;m++)p=g[m],p.noOfChildren=p.getNoOfChildren()},d.prototype.calcGrid=function(p){var g=0,m=0;g=parseInt(Math.ceil((p.getRight()-p.getLeft())/this.repulsionRange)),m=parseInt(Math.ceil((p.getBottom()-p.getTop())/this.repulsionRange));for(var v=new Array(g),y=0;y<g;y++)v[y]=new Array(m);for(var y=0;y<g;y++)for(var b=0;b<m;b++)v[y][b]=new Array;return v},d.prototype.addNodeToGrid=function(p,g,m){var v=0,y=0,b=0,w=0;v=parseInt(Math.floor((p.getRect().x-g)/this.repulsionRange)),y=parseInt(Math.floor((p.getRect().width+p.getRect().x-g)/this.repulsionRange)),b=parseInt(Math.floor((p.getRect().y-m)/this.repulsionRange)),w=parseInt(Math.floor((p.getRect().height+p.getRect().y-m)/this.repulsionRange));for(var T=v;T<=y;T++)for(var E=b;E<=w;E++)this.grid[T][E].push(p),p.setGridCoordinates(v,y,b,w)},d.prototype.updateGrid=function(){var p,g,m=this.getAllNodes();for(this.grid=this.calcGrid(this.graphManager.getRoot()),p=0;p<m.length;p++)g=m[p],this.addNodeToGrid(g,this.graphManager.getRoot().getLeft(),this.graphManager.getRoot().getTop())},d.prototype.calculateRepulsionForceOfANode=function(p,g,m,v){if(this.totalIterations%o.GRID_CALCULATION_CHECK_PERIOD==1&&m||v){var y=new Set;p.surrounding=new Array;for(var b,w=this.grid,T=p.startX-1;T<p.finishX+2;T++)for(var E=p.startY-1;E<p.finishY+2;E++)if(!(T<0||E<0||T>=w.length||E>=w[0].length)){for(var L=0;L<w[T][E].length;L++)if(b=w[T][E][L],!(p.getOwner()!=b.getOwner()||p==b)&&!g.has(b)&&!y.has(b)){var S=Math.abs(p.getCenterX()-b.getCenterX())-(p.getWidth()/2+b.getWidth()/2),C=Math.abs(p.getCenterY()-b.getCenterY())-(p.getHeight()/2+b.getHeight()/2);S<=this.repulsionRange&&C<=this.repulsionRange&&y.add(b)}}p.surrounding=[].concat(a(y))}for(T=0;T<p.surrounding.length;T++)this.calcRepulsionForce(p,p.surrounding[T])},d.prototype.calcRepulsionRange=function(){return 0},r.exports=d},function(r,n,i){var a=i(1),s=i(7);function o(u,h,d){a.call(this,u,h,d),this.idealLength=s.DEFAULT_EDGE_LENGTH}o.prototype=Object.create(a.prototype);for(var l in a)o[l]=a[l];r.exports=o},function(r,n,i){var a=i(3);function s(l,u,h,d){a.call(this,l,u,h,d),this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0,this.startX=0,this.finishX=0,this.startY=0,this.finishY=0,this.surrounding=[]}s.prototype=Object.create(a.prototype);for(var o in a)s[o]=a[o];s.prototype.setGridCoordinates=function(l,u,h,d){this.startX=l,this.finishX=u,this.startY=h,this.finishY=d},r.exports=s},function(r,n,i){function a(s,o){this.width=0,this.height=0,s!==null&&o!==null&&(this.height=o,this.width=s)}a.prototype.getWidth=function(){return this.width},a.prototype.setWidth=function(s){this.width=s},a.prototype.getHeight=function(){return this.height},a.prototype.setHeight=function(s){this.height=s},r.exports=a},function(r,n,i){var a=i(14);function s(){this.map={},this.keys=[]}s.prototype.put=function(o,l){var u=a.createID(o);this.contains(u)||(this.map[u]=l,this.keys.push(o))},s.prototype.contains=function(o){return a.createID(o),this.map[o]!=null},s.prototype.get=function(o){var l=a.createID(o);return this.map[l]},s.prototype.keySet=function(){return this.keys},r.exports=s},function(r,n,i){var a=i(14);function s(){this.set={}}s.prototype.add=function(o){var l=a.createID(o);this.contains(l)||(this.set[l]=o)},s.prototype.remove=function(o){delete this.set[a.createID(o)]},s.prototype.clear=function(){this.set={}},s.prototype.contains=function(o){return this.set[a.createID(o)]==o},s.prototype.isEmpty=function(){return this.size()===0},s.prototype.size=function(){return Object.keys(this.set).length},s.prototype.addAllTo=function(o){for(var l=Object.keys(this.set),u=l.length,h=0;h<u;h++)o.push(this.set[l[h]])},s.prototype.size=function(){return Object.keys(this.set).length},s.prototype.addAll=function(o){for(var l=o.length,u=0;u<l;u++){var h=o[u];this.add(h)}},r.exports=s},function(r,n,i){var a=function(){function u(h,d){for(var f=0;f<d.length;f++){var p=d[f];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(h,p.key,p)}}return function(h,d,f){return d&&u(h.prototype,d),f&&u(h,f),h}}();function s(u,h){if(!(u instanceof h))throw new TypeError("Cannot call a class as a function")}var o=i(11),l=function(){function u(h,d){s(this,u),(d!==null||d!==void 0)&&(this.compareFunction=this._defaultCompareFunction);var f=void 0;h instanceof o?f=h.size():f=h.length,this._quicksort(h,0,f-1)}return a(u,[{key:"_quicksort",value:function(d,f,p){if(f<p){var g=this._partition(d,f,p);this._quicksort(d,f,g),this._quicksort(d,g+1,p)}}},{key:"_partition",value:function(d,f,p){for(var g=this._get(d,f),m=f,v=p;;){for(;this.compareFunction(g,this._get(d,v));)v--;for(;this.compareFunction(this._get(d,m),g);)m++;if(m<v)this._swap(d,m,v),m++,v--;else return v}}},{key:"_get",value:function(d,f){return d instanceof o?d.get_object_at(f):d[f]}},{key:"_set",value:function(d,f,p){d instanceof o?d.set_object_at(f,p):d[f]=p}},{key:"_swap",value:function(d,f,p){var g=this._get(d,f);this._set(d,f,this._get(d,p)),this._set(d,p,g)}},{key:"_defaultCompareFunction",value:function(d,f){return f>d}}]),u}();r.exports=l},function(r,n,i){var a=function(){function l(u,h){for(var d=0;d<h.length;d++){var f=h[d];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(u,f.key,f)}}return function(u,h,d){return h&&l(u.prototype,h),d&&l(u,d),u}}();function s(l,u){if(!(l instanceof u))throw new TypeError("Cannot call a class as a function")}var o=function(){function l(u,h){var d=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,f=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,p=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;s(this,l),this.sequence1=u,this.sequence2=h,this.match_score=d,this.mismatch_penalty=f,this.gap_penalty=p,this.iMax=u.length+1,this.jMax=h.length+1,this.grid=new Array(this.iMax);for(var g=0;g<this.iMax;g++){this.grid[g]=new Array(this.jMax);for(var m=0;m<this.jMax;m++)this.grid[g][m]=0}this.tracebackGrid=new Array(this.iMax);for(var v=0;v<this.iMax;v++){this.tracebackGrid[v]=new Array(this.jMax);for(var y=0;y<this.jMax;y++)this.tracebackGrid[v][y]=[null,null,null]}this.alignments=[],this.score=-1,this.computeGrids()}return a(l,[{key:"getScore",value:function(){return this.score}},{key:"getAlignments",value:function(){return this.alignments}},{key:"computeGrids",value:function(){for(var h=1;h<this.jMax;h++)this.grid[0][h]=this.grid[0][h-1]+this.gap_penalty,this.tracebackGrid[0][h]=[!1,!1,!0];for(var d=1;d<this.iMax;d++)this.grid[d][0]=this.grid[d-1][0]+this.gap_penalty,this.tracebackGrid[d][0]=[!1,!0,!1];for(var f=1;f<this.iMax;f++)for(var p=1;p<this.jMax;p++){var g=void 0;this.sequence1[f-1]===this.sequence2[p-1]?g=this.grid[f-1][p-1]+this.match_score:g=this.grid[f-1][p-1]+this.mismatch_penalty;var m=this.grid[f-1][p]+this.gap_penalty,v=this.grid[f][p-1]+this.gap_penalty,y=[g,m,v],b=this.arrayAllMaxIndexes(y);this.grid[f][p]=y[b[0]],this.tracebackGrid[f][p]=[b.includes(0),b.includes(1),b.includes(2)]}this.score=this.grid[this.iMax-1][this.jMax-1]}},{key:"alignmentTraceback",value:function(){var h=[];for(h.push({pos:[this.sequence1.length,this.sequence2.length],seq1:"",seq2:""});h[0];){var d=h[0],f=this.tracebackGrid[d.pos[0]][d.pos[1]];f[0]&&h.push({pos:[d.pos[0]-1,d.pos[1]-1],seq1:this.sequence1[d.pos[0]-1]+d.seq1,seq2:this.sequence2[d.pos[1]-1]+d.seq2}),f[1]&&h.push({pos:[d.pos[0]-1,d.pos[1]],seq1:this.sequence1[d.pos[0]-1]+d.seq1,seq2:"-"+d.seq2}),f[2]&&h.push({pos:[d.pos[0],d.pos[1]-1],seq1:"-"+d.seq1,seq2:this.sequence2[d.pos[1]-1]+d.seq2}),d.pos[0]===0&&d.pos[1]===0&&this.alignments.push({sequence1:d.seq1,sequence2:d.seq2}),h.shift()}return this.alignments}},{key:"getAllIndexes",value:function(h,d){for(var f=[],p=-1;(p=h.indexOf(d,p+1))!==-1;)f.push(p);return f}},{key:"arrayAllMaxIndexes",value:function(h){return this.getAllIndexes(h,Math.max.apply(null,h))}}]),l}();r.exports=o},function(r,n,i){var a=function(){};a.FDLayout=i(18),a.FDLayoutConstants=i(7),a.FDLayoutEdge=i(19),a.FDLayoutNode=i(20),a.DimensionD=i(21),a.HashMap=i(22),a.HashSet=i(23),a.IGeometry=i(8),a.IMath=i(9),a.Integer=i(10),a.Point=i(12),a.PointD=i(4),a.RandomSeed=i(16),a.RectangleD=i(13),a.Transform=i(17),a.UniqueIDGeneretor=i(14),a.Quicksort=i(24),a.LinkedList=i(11),a.LGraphObject=i(2),a.LGraph=i(5),a.LEdge=i(1),a.LGraphManager=i(6),a.LNode=i(3),a.Layout=i(15),a.LayoutConstants=i(0),a.NeedlemanWunsch=i(25),r.exports=a},function(r,n,i){function a(){this.listeners=[]}var s=a.prototype;s.addListener=function(o,l){this.listeners.push({event:o,callback:l})},s.removeListener=function(o,l){for(var u=this.listeners.length;u>=0;u--){var h=this.listeners[u];h.event===o&&h.callback===l&&this.listeners.splice(u,1)}},s.emit=function(o,l){for(var u=0;u<this.listeners.length;u++){var h=this.listeners[u];o===h.event&&h.callback(l)}},r.exports=a}])})}(t3)),t3.exports}var c9;function Ybe(){return c9||(c9=1,function(t,e){(function(n,i){t.exports=i(qbe())})(to,function(r){return function(n){var i={};function a(s){if(i[s])return i[s].exports;var o=i[s]={i:s,l:!1,exports:{}};return n[s].call(o.exports,o,o.exports,a),o.l=!0,o.exports}return a.m=n,a.c=i,a.i=function(s){return s},a.d=function(s,o,l){a.o(s,o)||Object.defineProperty(s,o,{configurable:!1,enumerable:!0,get:l})},a.n=function(s){var o=s&&s.__esModule?function(){return s.default}:function(){return s};return a.d(o,"a",o),o},a.o=function(s,o){return Object.prototype.hasOwnProperty.call(s,o)},a.p="",a(a.s=7)}([function(n,i){n.exports=r},function(n,i,a){var s=a(0).FDLayoutConstants;function o(){}for(var l in s)o[l]=s[l];o.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,o.DEFAULT_RADIAL_SEPARATION=s.DEFAULT_EDGE_LENGTH,o.DEFAULT_COMPONENT_SEPERATION=60,o.TILE=!0,o.TILING_PADDING_VERTICAL=10,o.TILING_PADDING_HORIZONTAL=10,o.TREE_REDUCTION_ON_INCREMENTAL=!1,n.exports=o},function(n,i,a){var s=a(0).FDLayoutEdge;function o(u,h,d){s.call(this,u,h,d)}o.prototype=Object.create(s.prototype);for(var l in s)o[l]=s[l];n.exports=o},function(n,i,a){var s=a(0).LGraph;function o(u,h,d){s.call(this,u,h,d)}o.prototype=Object.create(s.prototype);for(var l in s)o[l]=s[l];n.exports=o},function(n,i,a){var s=a(0).LGraphManager;function o(u){s.call(this,u)}o.prototype=Object.create(s.prototype);for(var l in s)o[l]=s[l];n.exports=o},function(n,i,a){var s=a(0).FDLayoutNode,o=a(0).IMath;function l(h,d,f,p){s.call(this,h,d,f,p)}l.prototype=Object.create(s.prototype);for(var u in s)l[u]=s[u];l.prototype.move=function(){var h=this.graphManager.getLayout();this.displacementX=h.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY=h.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren,Math.abs(this.displacementX)>h.coolingFactor*h.maxNodeDisplacement&&(this.displacementX=h.coolingFactor*h.maxNodeDisplacement*o.sign(this.displacementX)),Math.abs(this.displacementY)>h.coolingFactor*h.maxNodeDisplacement&&(this.displacementY=h.coolingFactor*h.maxNodeDisplacement*o.sign(this.displacementY)),this.child==null?this.moveBy(this.displacementX,this.displacementY):this.child.getNodes().length==0?this.moveBy(this.displacementX,this.displacementY):this.propogateDisplacementToChildren(this.displacementX,this.displacementY),h.totalDisplacement+=Math.abs(this.displacementX)+Math.abs(this.displacementY),this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0},l.prototype.propogateDisplacementToChildren=function(h,d){for(var f=this.getChild().getNodes(),p,g=0;g<f.length;g++)p=f[g],p.getChild()==null?(p.moveBy(h,d),p.displacementX+=h,p.displacementY+=d):p.propogateDisplacementToChildren(h,d)},l.prototype.setPred1=function(h){this.pred1=h},l.prototype.getPred1=function(){return pred1},l.prototype.getPred2=function(){return pred2},l.prototype.setNext=function(h){this.next=h},l.prototype.getNext=function(){return next},l.prototype.setProcessed=function(h){this.processed=h},l.prototype.isProcessed=function(){return processed},n.exports=l},function(n,i,a){var s=a(0).FDLayout,o=a(4),l=a(3),u=a(5),h=a(2),d=a(1),f=a(0).FDLayoutConstants,p=a(0).LayoutConstants,g=a(0).Point,m=a(0).PointD,v=a(0).Layout,y=a(0).Integer,b=a(0).IGeometry,w=a(0).LGraph,T=a(0).Transform;function E(){s.call(this),this.toBeTiled={}}E.prototype=Object.create(s.prototype);for(var L in s)E[L]=s[L];E.prototype.newGraphManager=function(){var S=new o(this);return this.graphManager=S,S},E.prototype.newGraph=function(S){return new l(null,this.graphManager,S)},E.prototype.newNode=function(S){return new u(this.graphManager,S)},E.prototype.newEdge=function(S){return new h(null,null,S)},E.prototype.initParameters=function(){s.prototype.initParameters.call(this,arguments),this.isSubLayout||(d.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=d.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=d.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.springConstant=f.DEFAULT_SPRING_STRENGTH,this.repulsionConstant=f.DEFAULT_REPULSION_STRENGTH,this.gravityConstant=f.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=f.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=f.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=f.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1,this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/f.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=f.CONVERGENCE_CHECK_PERIOD/this.maxIterations,this.coolingAdjuster=1)},E.prototype.layout=function(){var S=p.DEFAULT_CREATE_BENDS_AS_NEEDED;return S&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},E.prototype.classicLayout=function(){if(this.nodesWithGravity=this.calculateNodesToApplyGravitationTo(),this.graphManager.setAllNodesToApplyGravitation(this.nodesWithGravity),this.calcNoOfChildrenForAllNodes(),this.graphManager.calcLowestCommonAncestors(),this.graphManager.calcInclusionTreeDepths(),this.graphManager.getRoot().calcEstimatedSize(),this.calcIdealEdgeLengths(),this.incremental){if(d.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var C=new Set(this.getAllNodes()),A=this.nodesWithGravity.filter(function(O){return C.has(O)});this.graphManager.setAllNodesToApplyGravitation(A)}}else{var S=this.getFlatForest();if(S.length>0)this.positionNodesRadially(S);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var C=new Set(this.getAllNodes()),A=this.nodesWithGravity.filter(function(N){return C.has(N)});this.graphManager.setAllNodesToApplyGravitation(A),this.positionNodesRandomly()}}return this.initSpringEmbedder(),this.runSpringEmbedder(),!0},E.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished)if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.totalIterations%f.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;this.coolingCycle++,this.layoutQuality==0?this.coolingAdjuster=this.coolingCycle:this.layoutQuality==1&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var S=new Set(this.getAllNodes()),C=this.nodesWithGravity.filter(function(_){return S.has(_)});this.graphManager.setAllNodesToApplyGravitation(C),this.graphManager.updateBounds(),this.updateGrid(),this.coolingFactor=f.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),this.coolingFactor=f.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var A=!this.isTreeGrowing&&!this.isGrowthFinished,N=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(A,N),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},E.prototype.getPositionsData=function(){for(var S=this.graphManager.getAllNodes(),C={},A=0;A<S.length;A++){var N=S[A].rect,_=S[A].id;C[_]={id:_,x:N.getCenterX(),y:N.getCenterY(),w:N.width,h:N.height}}return C},E.prototype.runSpringEmbedder=function(){this.initialAnimationPeriod=25,this.animationPeriod=this.initialAnimationPeriod;var S=!1;if(f.ANIMATE==="during")this.emit("layoutstarted");else{for(;!S;)S=this.tick();this.graphManager.updateBounds()}},E.prototype.calculateNodesToApplyGravitationTo=function(){var S=[],C,A=this.graphManager.getGraphs(),N=A.length,_;for(_=0;_<N;_++)C=A[_],C.updateConnected(),C.isConnected||(S=S.concat(C.getNodes()));return S},E.prototype.createBendpoints=function(){var S=[];S=S.concat(this.graphManager.getAllEdges());var C=new Set,A;for(A=0;A<S.length;A++){var N=S[A];if(!C.has(N)){var _=N.getSource(),O=N.getTarget();if(_==O)N.getBendpoints().push(new m),N.getBendpoints().push(new m),this.createDummyNodesForBendpoints(N),C.add(N);else{var P=[];if(P=P.concat(_.getEdgeListToNode(O)),P=P.concat(O.getEdgeListToNode(_)),!C.has(P[0])){if(P.length>1){var k;for(k=0;k<P.length;k++){var R=P[k];R.getBendpoints().push(new m),this.createDummyNodesForBendpoints(R)}}P.forEach(function(I){C.add(I)})}}}if(C.size==S.length)break}},E.prototype.positionNodesRadially=function(S){for(var C=new g(0,0),A=Math.ceil(Math.sqrt(S.length)),N=0,_=0,O=0,P=new m(0,0),k=0;k<S.length;k++){k%A==0&&(O=0,_=N,k!=0&&(_+=d.DEFAULT_COMPONENT_SEPERATION),N=0);var R=S[k],I=v.findCenterOfTree(R);C.x=O,C.y=_,P=E.radialLayout(R,I,C),P.y>N&&(N=Math.floor(P.y)),O=Math.floor(P.x+d.DEFAULT_COMPONENT_SEPERATION)}this.transform(new m(p.WORLD_CENTER_X-P.x/2,p.WORLD_CENTER_Y-P.y/2))},E.radialLayout=function(S,C,A){var N=Math.max(this.maxDiagonalInTree(S),d.DEFAULT_RADIAL_SEPARATION);E.branchRadialLayout(C,null,0,359,0,N);var _=w.calculateBounds(S),O=new T;O.setDeviceOrgX(_.getMinX()),O.setDeviceOrgY(_.getMinY()),O.setWorldOrgX(A.x),O.setWorldOrgY(A.y);for(var P=0;P<S.length;P++){var k=S[P];k.transform(O)}var R=new m(_.getMaxX(),_.getMaxY());return O.inverseTransformPoint(R)},E.branchRadialLayout=function(S,C,A,N,_,O){var P=(N-A+1)/2;P<0&&(P+=180);var k=(P+A)%360,R=k*b.TWO_PI/360,I=_*Math.cos(R),M=_*Math.sin(R);S.setCenter(I,M);var D=[];D=D.concat(S.getEdges());var B=D.length;C!=null&&B--;for(var $=0,F=D.length,G,W=S.getEdgesBetween(C);W.length>1;){var J=W[0];W.splice(0,1);var q=D.indexOf(J);q>=0&&D.splice(q,1),F--,B--}C!=null?G=(D.indexOf(W[0])+1)%F:G=0;for(var ne=Math.abs(N-A)/B,ae=G;$!=B;ae=++ae%F){var pe=D[ae].getOtherEnd(S);if(pe!=C){var K=(A+$*ne)%360,Z=(K+ne)%360;E.branchRadialLayout(pe,S,K,Z,_+O,O),$++}}},E.maxDiagonalInTree=function(S){for(var C=y.MIN_VALUE,A=0;A<S.length;A++){var N=S[A],_=N.getDiagonal();_>C&&(C=_)}return C},E.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},E.prototype.groupZeroDegreeMembers=function(){var S=this,C={};this.memberGroups={},this.idToDummyNode={};for(var A=[],N=this.graphManager.getAllNodes(),_=0;_<N.length;_++){var O=N[_],P=O.getParent();this.getNodeDegreeWithChildren(O)===0&&(P.id==null||!this.getToBeTiled(P))&&A.push(O)}for(var _=0;_<A.length;_++){var O=A[_],k=O.getParent().id;typeof C[k]>"u"&&(C[k]=[]),C[k]=C[k].concat(O)}Object.keys(C).forEach(function(R){if(C[R].length>1){var I="DummyCompound_"+R;S.memberGroups[I]=C[R];var M=C[R][0].getParent(),D=new u(S.graphManager);D.id=I,D.paddingLeft=M.paddingLeft||0,D.paddingRight=M.paddingRight||0,D.paddingBottom=M.paddingBottom||0,D.paddingTop=M.paddingTop||0,S.idToDummyNode[I]=D;var B=S.getGraphManager().add(S.newGraph(),D),$=M.getChild();$.add(D);for(var F=0;F<C[R].length;F++){var G=C[R][F];$.remove(G),B.add(G)}}})},E.prototype.clearCompounds=function(){var S={},C={};this.performDFSOnCompounds();for(var A=0;A<this.compoundOrder.length;A++)C[this.compoundOrder[A].id]=this.compoundOrder[A],S[this.compoundOrder[A].id]=[].concat(this.compoundOrder[A].getChild().getNodes()),this.graphManager.remove(this.compoundOrder[A].getChild()),this.compoundOrder[A].child=null;this.graphManager.resetAllNodes(),this.tileCompoundMembers(S,C)},E.prototype.clearZeroDegreeMembers=function(){var S=this,C=this.tiledZeroDegreePack=[];Object.keys(this.memberGroups).forEach(function(A){var N=S.idToDummyNode[A];C[A]=S.tileNodes(S.memberGroups[A],N.paddingLeft+N.paddingRight),N.rect.width=C[A].width,N.rect.height=C[A].height})},E.prototype.repopulateCompounds=function(){for(var S=this.compoundOrder.length-1;S>=0;S--){var C=this.compoundOrder[S],A=C.id,N=C.paddingLeft,_=C.paddingTop;this.adjustLocations(this.tiledMemberPack[A],C.rect.x,C.rect.y,N,_)}},E.prototype.repopulateZeroDegreeMembers=function(){var S=this,C=this.tiledZeroDegreePack;Object.keys(C).forEach(function(A){var N=S.idToDummyNode[A],_=N.paddingLeft,O=N.paddingTop;S.adjustLocations(C[A],N.rect.x,N.rect.y,_,O)})},E.prototype.getToBeTiled=function(S){var C=S.id;if(this.toBeTiled[C]!=null)return this.toBeTiled[C];var A=S.getChild();if(A==null)return this.toBeTiled[C]=!1,!1;for(var N=A.getNodes(),_=0;_<N.length;_++){var O=N[_];if(this.getNodeDegree(O)>0)return this.toBeTiled[C]=!1,!1;if(O.getChild()==null){this.toBeTiled[O.id]=!1;continue}if(!this.getToBeTiled(O))return this.toBeTiled[C]=!1,!1}return this.toBeTiled[C]=!0,!0},E.prototype.getNodeDegree=function(S){S.id;for(var C=S.getEdges(),A=0,N=0;N<C.length;N++){var _=C[N];_.getSource().id!==_.getTarget().id&&(A=A+1)}return A},E.prototype.getNodeDegreeWithChildren=function(S){var C=this.getNodeDegree(S);if(S.getChild()==null)return C;for(var A=S.getChild().getNodes(),N=0;N<A.length;N++){var _=A[N];C+=this.getNodeDegreeWithChildren(_)}return C},E.prototype.performDFSOnCompounds=function(){this.compoundOrder=[],this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes())},E.prototype.fillCompexOrderByDFS=function(S){for(var C=0;C<S.length;C++){var A=S[C];A.getChild()!=null&&this.fillCompexOrderByDFS(A.getChild().getNodes()),this.getToBeTiled(A)&&this.compoundOrder.push(A)}},E.prototype.adjustLocations=function(S,C,A,N,_){C+=N,A+=_;for(var O=C,P=0;P<S.rows.length;P++){var k=S.rows[P];C=O;for(var R=0,I=0;I<k.length;I++){var M=k[I];M.rect.x=C,M.rect.y=A,C+=M.rect.width+S.horizontalPadding,M.rect.height>R&&(R=M.rect.height)}A+=R+S.verticalPadding}},E.prototype.tileCompoundMembers=function(S,C){var A=this;this.tiledMemberPack=[],Object.keys(S).forEach(function(N){var _=C[N];A.tiledMemberPack[N]=A.tileNodes(S[N],_.paddingLeft+_.paddingRight),_.rect.width=A.tiledMemberPack[N].width,_.rect.height=A.tiledMemberPack[N].height})},E.prototype.tileNodes=function(S,C){var A=d.TILING_PADDING_VERTICAL,N=d.TILING_PADDING_HORIZONTAL,_={rows:[],rowWidth:[],rowHeight:[],width:0,height:C,verticalPadding:A,horizontalPadding:N};S.sort(function(k,R){return k.rect.width*k.rect.height>R.rect.width*R.rect.height?-1:k.rect.width*k.rect.height<R.rect.width*R.rect.height?1:0});for(var O=0;O<S.length;O++){var P=S[O];_.rows.length==0?this.insertNodeToRow(_,P,0,C):this.canAddHorizontal(_,P.rect.width,P.rect.height)?this.insertNodeToRow(_,P,this.getShortestRowIndex(_),C):this.insertNodeToRow(_,P,_.rows.length,C),this.shiftToLastRow(_)}return _},E.prototype.insertNodeToRow=function(S,C,A,N){var _=N;if(A==S.rows.length){var O=[];S.rows.push(O),S.rowWidth.push(_),S.rowHeight.push(0)}var P=S.rowWidth[A]+C.rect.width;S.rows[A].length>0&&(P+=S.horizontalPadding),S.rowWidth[A]=P,S.width<P&&(S.width=P);var k=C.rect.height;A>0&&(k+=S.verticalPadding);var R=0;k>S.rowHeight[A]&&(R=S.rowHeight[A],S.rowHeight[A]=k,R=S.rowHeight[A]-R),S.height+=R,S.rows[A].push(C)},E.prototype.getShortestRowIndex=function(S){for(var C=-1,A=Number.MAX_VALUE,N=0;N<S.rows.length;N++)S.rowWidth[N]<A&&(C=N,A=S.rowWidth[N]);return C},E.prototype.getLongestRowIndex=function(S){for(var C=-1,A=Number.MIN_VALUE,N=0;N<S.rows.length;N++)S.rowWidth[N]>A&&(C=N,A=S.rowWidth[N]);return C},E.prototype.canAddHorizontal=function(S,C,A){var N=this.getShortestRowIndex(S);if(N<0)return!0;var _=S.rowWidth[N];if(_+S.horizontalPadding+C<=S.width)return!0;var O=0;S.rowHeight[N]<A&&N>0&&(O=A+S.verticalPadding-S.rowHeight[N]);var P;S.width-_>=C+S.horizontalPadding?P=(S.height+O)/(_+C+S.horizontalPadding):P=(S.height+O)/S.width,O=A+S.verticalPadding;var k;return S.width<C?k=(S.height+O)/C:k=(S.height+O)/S.width,k<1&&(k=1/k),P<1&&(P=1/P),P<k},E.prototype.shiftToLastRow=function(S){var C=this.getLongestRowIndex(S),A=S.rowWidth.length-1,N=S.rows[C],_=N[N.length-1],O=_.width+S.horizontalPadding;if(S.width-S.rowWidth[A]>O&&C!=A){N.splice(-1,1),S.rows[A].push(_),S.rowWidth[C]=S.rowWidth[C]-O,S.rowWidth[A]=S.rowWidth[A]+O,S.width=S.rowWidth[instance.getLongestRowIndex(S)];for(var P=Number.MIN_VALUE,k=0;k<N.length;k++)N[k].height>P&&(P=N[k].height);C>0&&(P+=S.verticalPadding);var R=S.rowHeight[C]+S.rowHeight[A];S.rowHeight[C]=P,S.rowHeight[A]<_.height+S.verticalPadding&&(S.rowHeight[A]=_.height+S.verticalPadding);var I=S.rowHeight[C]+S.rowHeight[A];S.height+=I-R,this.shiftToLastRow(S)}},E.prototype.tilingPreLayout=function(){d.TILE&&(this.groupZeroDegreeMembers(),this.clearCompounds(),this.clearZeroDegreeMembers())},E.prototype.tilingPostLayout=function(){d.TILE&&(this.repopulateZeroDegreeMembers(),this.repopulateCompounds())},E.prototype.reduceTrees=function(){for(var S=[],C=!0,A;C;){var N=this.graphManager.getAllNodes(),_=[];C=!1;for(var O=0;O<N.length;O++)A=N[O],A.getEdges().length==1&&!A.getEdges()[0].isInterGraph&&A.getChild()==null&&(_.push([A,A.getEdges()[0],A.getOwner()]),C=!0);if(C==!0){for(var P=[],k=0;k<_.length;k++)_[k][0].getEdges().length==1&&(P.push(_[k]),_[k][0].getOwner().remove(_[k][0]));S.push(P),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()}}this.prunedNodesAll=S},E.prototype.growTree=function(S){for(var C=S.length,A=S[C-1],N,_=0;_<A.length;_++)N=A[_],this.findPlaceforPrunedNode(N),N[2].add(N[0]),N[2].add(N[1],N[1].source,N[1].target);S.splice(S.length-1,1),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()},E.prototype.findPlaceforPrunedNode=function(S){var C,A,N=S[0];N==S[1].source?A=S[1].target:A=S[1].source;var _=A.startX,O=A.finishX,P=A.startY,k=A.finishY,R=0,I=0,M=0,D=0,B=[R,M,I,D];if(P>0)for(var $=_;$<=O;$++)B[0]+=this.grid[$][P-1].length+this.grid[$][P].length-1;if(O<this.grid.length-1)for(var $=P;$<=k;$++)B[1]+=this.grid[O+1][$].length+this.grid[O][$].length-1;if(k<this.grid[0].length-1)for(var $=_;$<=O;$++)B[2]+=this.grid[$][k+1].length+this.grid[$][k].length-1;if(_>0)for(var $=P;$<=k;$++)B[3]+=this.grid[_-1][$].length+this.grid[_][$].length-1;for(var F=y.MAX_VALUE,G,W,J=0;J<B.length;J++)B[J]<F?(F=B[J],G=1,W=J):B[J]==F&&G++;if(G==3&&F==0)B[0]==0&&B[1]==0&&B[2]==0?C=1:B[0]==0&&B[1]==0&&B[3]==0?C=0:B[0]==0&&B[2]==0&&B[3]==0?C=3:B[1]==0&&B[2]==0&&B[3]==0&&(C=2);else if(G==2&&F==0){var q=Math.floor(Math.random()*2);B[0]==0&&B[1]==0?q==0?C=0:C=1:B[0]==0&&B[2]==0?q==0?C=0:C=2:B[0]==0&&B[3]==0?q==0?C=0:C=3:B[1]==0&&B[2]==0?q==0?C=1:C=2:B[1]==0&&B[3]==0?q==0?C=1:C=3:q==0?C=2:C=3}else if(G==4&&F==0){var q=Math.floor(Math.random()*4);C=q}else C=W;C==0?N.setCenter(A.getCenterX(),A.getCenterY()-A.getHeight()/2-f.DEFAULT_EDGE_LENGTH-N.getHeight()/2):C==1?N.setCenter(A.getCenterX()+A.getWidth()/2+f.DEFAULT_EDGE_LENGTH+N.getWidth()/2,A.getCenterY()):C==2?N.setCenter(A.getCenterX(),A.getCenterY()+A.getHeight()/2+f.DEFAULT_EDGE_LENGTH+N.getHeight()/2):N.setCenter(A.getCenterX()-A.getWidth()/2-f.DEFAULT_EDGE_LENGTH-N.getWidth()/2,A.getCenterY())},n.exports=E},function(n,i,a){var s={};s.layoutBase=a(0),s.CoSEConstants=a(1),s.CoSEEdge=a(2),s.CoSEGraph=a(3),s.CoSEGraphManager=a(4),s.CoSELayout=a(6),s.CoSENode=a(5),n.exports=s}])})}(e3)),e3.exports}(function(t,e){(function(n,i){t.exports=i(Ybe())})(to,function(r){return function(n){var i={};function a(s){if(i[s])return i[s].exports;var o=i[s]={i:s,l:!1,exports:{}};return n[s].call(o.exports,o,o.exports,a),o.l=!0,o.exports}return a.m=n,a.c=i,a.i=function(s){return s},a.d=function(s,o,l){a.o(s,o)||Object.defineProperty(s,o,{configurable:!1,enumerable:!0,get:l})},a.n=function(s){var o=s&&s.__esModule?function(){return s.default}:function(){return s};return a.d(o,"a",o),o},a.o=function(s,o){return Object.prototype.hasOwnProperty.call(s,o)},a.p="",a(a.s=1)}([function(n,i){n.exports=r},function(n,i,a){var s=a(0).layoutBase.LayoutConstants,o=a(0).layoutBase.FDLayoutConstants,l=a(0).CoSEConstants,u=a(0).CoSELayout,h=a(0).CoSENode,d=a(0).layoutBase.PointD,f=a(0).layoutBase.DimensionD,p={ready:function(){},stop:function(){},quality:"default",nodeDimensionsIncludeLabels:!1,refresh:30,fit:!0,padding:10,randomize:!0,nodeRepulsion:4500,idealEdgeLength:50,edgeElasticity:.45,nestingFactor:.1,gravity:.25,numIter:2500,tile:!0,animate:"end",animationDuration:500,tilingPaddingVertical:10,tilingPaddingHorizontal:10,gravityRangeCompound:1.5,gravityCompound:1,gravityRange:3.8,initialEnergyOnIncremental:.5};function g(b,w){var T={};for(var E in b)T[E]=b[E];for(var E in w)T[E]=w[E];return T}function m(b){this.options=g(p,b),v(this.options)}var v=function(w){w.nodeRepulsion!=null&&(l.DEFAULT_REPULSION_STRENGTH=o.DEFAULT_REPULSION_STRENGTH=w.nodeRepulsion),w.idealEdgeLength!=null&&(l.DEFAULT_EDGE_LENGTH=o.DEFAULT_EDGE_LENGTH=w.idealEdgeLength),w.edgeElasticity!=null&&(l.DEFAULT_SPRING_STRENGTH=o.DEFAULT_SPRING_STRENGTH=w.edgeElasticity),w.nestingFactor!=null&&(l.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=o.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=w.nestingFactor),w.gravity!=null&&(l.DEFAULT_GRAVITY_STRENGTH=o.DEFAULT_GRAVITY_STRENGTH=w.gravity),w.numIter!=null&&(l.MAX_ITERATIONS=o.MAX_ITERATIONS=w.numIter),w.gravityRange!=null&&(l.DEFAULT_GRAVITY_RANGE_FACTOR=o.DEFAULT_GRAVITY_RANGE_FACTOR=w.gravityRange),w.gravityCompound!=null&&(l.DEFAULT_COMPOUND_GRAVITY_STRENGTH=o.DEFAULT_COMPOUND_GRAVITY_STRENGTH=w.gravityCompound),w.gravityRangeCompound!=null&&(l.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=o.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=w.gravityRangeCompound),w.initialEnergyOnIncremental!=null&&(l.DEFAULT_COOLING_FACTOR_INCREMENTAL=o.DEFAULT_COOLING_FACTOR_INCREMENTAL=w.initialEnergyOnIncremental),w.quality=="draft"?s.QUALITY=0:w.quality=="proof"?s.QUALITY=2:s.QUALITY=1,l.NODE_DIMENSIONS_INCLUDE_LABELS=o.NODE_DIMENSIONS_INCLUDE_LABELS=s.NODE_DIMENSIONS_INCLUDE_LABELS=w.nodeDimensionsIncludeLabels,l.DEFAULT_INCREMENTAL=o.DEFAULT_INCREMENTAL=s.DEFAULT_INCREMENTAL=!w.randomize,l.ANIMATE=o.ANIMATE=s.ANIMATE=w.animate,l.TILE=w.tile,l.TILING_PADDING_VERTICAL=typeof w.tilingPaddingVertical=="function"?w.tilingPaddingVertical.call():w.tilingPaddingVertical,l.TILING_PADDING_HORIZONTAL=typeof w.tilingPaddingHorizontal=="function"?w.tilingPaddingHorizontal.call():w.tilingPaddingHorizontal};m.prototype.run=function(){var b,w,T=this.options;this.idToLNode={};var E=this.layout=new u,L=this;L.stopped=!1,this.cy=this.options.cy,this.cy.trigger({type:"layoutstart",layout:this});var S=E.newGraphManager();this.gm=S;var C=this.options.eles.nodes(),A=this.options.eles.edges();this.root=S.addRoot(),this.processChildrenList(this.root,this.getTopMostNodes(C),E);for(var N=0;N<A.length;N++){var _=A[N],O=this.idToLNode[_.data("source")],P=this.idToLNode[_.data("target")];if(O!==P&&O.getEdgesBetween(P).length==0){var k=S.add(E.newEdge(),O,P);k.id=_.id()}}var R=function(D,B){typeof D=="number"&&(D=B);var $=D.data("id"),F=L.idToLNode[$];return{x:F.getRect().getCenterX(),y:F.getRect().getCenterY()}},I=function M(){for(var D=function(){T.fit&&T.cy.fit(T.eles,T.padding),b||(b=!0,L.cy.one("layoutready",T.ready),L.cy.trigger({type:"layoutready",layout:L}))},B=L.options.refresh,$,F=0;F<B&&!$;F++)$=L.stopped||L.layout.tick();if($){E.checkLayoutSuccess()&&!E.isSubLayout&&E.doPostLayout(),E.tilingPostLayout&&E.tilingPostLayout(),E.isLayoutFinished=!0,L.options.eles.nodes().positions(R),D(),L.cy.one("layoutstop",L.options.stop),L.cy.trigger({type:"layoutstop",layout:L}),w&&cancelAnimationFrame(w),b=!1;return}var G=L.layout.getPositionsData();T.eles.nodes().positions(function(W,J){if(typeof W=="number"&&(W=J),!W.isParent()){for(var q=W.id(),ne=G[q],ae=W;ne==null&&(ne=G[ae.data("parent")]||G["DummyCompound_"+ae.data("parent")],G[q]=ne,ae=ae.parent()[0],ae!=null););return ne!=null?{x:ne.x,y:ne.y}:{x:W.position("x"),y:W.position("y")}}}),D(),w=requestAnimationFrame(M)};return E.addListener("layoutstarted",function(){L.options.animate==="during"&&(w=requestAnimationFrame(I))}),E.runLayout(),this.options.animate!=="during"&&(L.options.eles.nodes().not(":parent").layoutPositions(L,L.options,R),b=!1),this},m.prototype.getTopMostNodes=function(b){for(var w={},T=0;T<b.length;T++)w[b[T].id()]=!0;var E=b.filter(function(L,S){typeof L=="number"&&(L=S);for(var C=L.parent()[0];C!=null;){if(w[C.id()])return!1;C=C.parent()[0]}return!0});return E},m.prototype.processChildrenList=function(b,w,T){for(var E=w.length,L=0;L<E;L++){var S=w[L],C=S.children(),A,N=S.layoutDimensions({nodeDimensionsIncludeLabels:this.options.nodeDimensionsIncludeLabels});if(S.outerWidth()!=null&&S.outerHeight()!=null?A=b.add(new h(T.graphManager,new d(S.position("x")-N.w/2,S.position("y")-N.h/2),new f(parseFloat(N.w),parseFloat(N.h)))):A=b.add(new h(this.graphManager)),A.id=S.data("id"),A.paddingLeft=parseInt(S.css("padding")),A.paddingTop=parseInt(S.css("padding")),A.paddingRight=parseInt(S.css("padding")),A.paddingBottom=parseInt(S.css("padding")),this.options.nodeDimensionsIncludeLabels&&S.isParent()){var _=S.boundingBox({includeLabels:!0,includeNodes:!1}).w,O=S.boundingBox({includeLabels:!0,includeNodes:!1}).h,P=S.css("text-halign");A.labelWidth=_,A.labelHeight=O,A.labelPos=P}if(this.idToLNode[S.data("id")]=A,isNaN(A.rect.x)&&(A.rect.x=0),isNaN(A.rect.y)&&(A.rect.y=0),C!=null&&C.length>0){var k;k=T.getGraphManager().add(T.newGraph(),A),this.processChildrenList(k,C,T)}}},m.prototype.stop=function(){return this.stopped=!0,this};var y=function(w){w("layout","cose-bilkent",m)};typeof cytoscape<"u"&&y(cytoscape),n.exports=y}])})})(XV);var Xbe=XV.exports;const jbe=yd(Xbe);Js.use(jbe);function jV(t,e){t.forEach(r=>{const n={id:r.id,labelText:r.label,height:r.height,width:r.width,padding:r.padding??0};Object.keys(r).forEach(i=>{["id","label","height","width","padding","x","y"].includes(i)||(n[i]=r[i])}),e.add({group:"nodes",data:n,position:{x:r.x??0,y:r.y??0}})})}x(jV,"addNodes");function KV(t,e){t.forEach(r=>{const n={id:r.id,source:r.start,target:r.end};Object.keys(r).forEach(i=>{["id","start","end"].includes(i)||(n[i]=r[i])}),e.add({group:"edges",data:n})})}x(KV,"addEdges");function ZV(t){return new Promise(e=>{const r=Qe("body").append("div").attr("id","cy").attr("style","display:none"),n=Js({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"bezier"}}]});r.remove(),jV(t.nodes,n),KV(t.edges,n),n.nodes().forEach(function(a){a.layoutDimensions=()=>{const s=a.data();return{w:s.width,h:s.height}}});const i={name:"cose-bilkent",quality:"proof",styleEnabled:!1,animate:!1};n.layout(i).run(),n.ready(a=>{ie.info("Cytoscape ready",a),e(n)})})}x(ZV,"createCytoscapeInstance");function QV(t){return t.nodes().map(e=>{const r=e.data(),n=e.position(),i={id:r.id,x:n.x,y:n.y};return Object.keys(r).forEach(a=>{a!=="id"&&(i[a]=r[a])}),i})}x(QV,"extractPositionedNodes");function JV(t){return t.edges().map(e=>{const r=e.data(),n=e._private.rscratch,i={id:r.id,source:r.source,target:r.target,startX:n.startX,startY:n.startY,midX:n.midX,midY:n.midY,endX:n.endX,endY:n.endY};return Object.keys(r).forEach(a=>{["id","source","target"].includes(a)||(i[a]=r[a])}),i})}x(JV,"extractPositionedEdges");async function eG(t,e){ie.debug("Starting cose-bilkent layout algorithm");try{tG(t);const r=await ZV(t),n=QV(r),i=JV(r);return ie.debug(`Layout completed: ${n.length} nodes, ${i.length} edges`),{nodes:n,edges:i}}catch(r){throw ie.error("Error in cose-bilkent layout algorithm:",r),r}}x(eG,"executeCoseBilkentLayout");function tG(t){if(!t)throw new Error("Layout data is required");if(!t.config)throw new Error("Configuration is required in layout data");if(!t.rootNode)throw new Error("Root node is required");if(!t.nodes||!Array.isArray(t.nodes))throw new Error("No nodes found in layout data");if(!Array.isArray(t.edges))throw new Error("Edges array is required in layout data");return!0}x(tG,"validateLayoutData");var Kbe=x(async(t,e,{insertCluster:r,insertEdge:n,insertEdgeLabel:i,insertMarkers:a,insertNode:s,log:o,positionEdgeLabel:l},{algorithm:u})=>{const h={},d={},f=e.select("g");a(f,t.markers,t.type,t.diagramId);const p=f.insert("g").attr("class","subgraphs"),g=f.insert("g").attr("class","edgePaths"),m=f.insert("g").attr("class","edgeLabels"),v=f.insert("g").attr("class","nodes");o.debug("Inserting nodes into DOM for dimension calculation"),await Promise.all(t.nodes.map(async w=>{if(w.isGroup){const T={...w};d[w.id]=T,h[w.id]=T,await r(p,w)}else{const T={...w};h[w.id]=T;const E=await s(v,w,{config:t.config,dir:t.direction||"TB"}),L=E.node().getBBox();T.width=L.width,T.height=L.height,T.domId=E,o.debug(`Node ${w.id} dimensions: ${L.width}x${L.height}`)}})),o.debug("Running cose-bilkent layout algorithm");const y={...t,nodes:t.nodes.map(w=>{const T=h[w.id];return{...w,width:T.width,height:T.height}})},b=await eG(y,t.config);o.debug("Positioning nodes based on layout results"),b.nodes.forEach(w=>{const T=h[w.id];T?.domId&&(T.domId.attr("transform",`translate(${w.x}, ${w.y})`),T.x=w.x,T.y=w.y,o.debug(`Positioned node ${T.id} at center (${w.x}, ${w.y})`))}),b.edges.forEach(w=>{const T=t.edges.find(E=>E.id===w.id);T&&(T.points=[{x:w.startX,y:w.startY},{x:w.midX,y:w.midY},{x:w.endX,y:w.endY}])}),o.debug("Inserting and positioning edges"),await Promise.all(t.edges.map(async w=>{await i(m,w);const T=h[w.start??""],E=h[w.end??""];if(T&&E){const L=b.edges.find(S=>S.id===w.id);if(L){o.debug("APA01 positionedEdge",L);const S={...w},C=n(g,S,d,t.type,T,E,t.diagramId);l(S,C)}else{const S={...w,points:[{x:T.x||0,y:T.y||0},{x:E.x||0,y:E.y||0}]},C=n(g,S,d,t.type,T,E,t.diagramId);l(S,C)}}})),o.debug("Cose-bilkent rendering completed")},"render"),Zbe=Kbe;const Qbe=Object.freeze(Object.defineProperty({__proto__:null,render:Zbe},Symbol.toStringTag,{value:"Module"}));var H2=x((t,e)=>{const r=t.append("rect");if(r.attr("x",e.x),r.attr("y",e.y),r.attr("fill",e.fill),r.attr("stroke",e.stroke),r.attr("width",e.width),r.attr("height",e.height),e.name&&r.attr("name",e.name),e.rx&&r.attr("rx",e.rx),e.ry&&r.attr("ry",e.ry),e.attrs!==void 0)for(const n in e.attrs)r.attr(n,e.attrs[n]);return e.class&&r.attr("class",e.class),r},"drawRect"),rG=x((t,e)=>{const r={x:e.startx,y:e.starty,width:e.stopx-e.startx,height:e.stopy-e.starty,fill:e.fill,stroke:e.stroke,class:"rect"};H2(t,r).lower()},"drawBackgroundRect"),Jbe=x((t,e)=>{const r=e.text.replace(xd," "),n=t.append("text");n.attr("x",e.x),n.attr("y",e.y),n.attr("class","legend"),n.style("text-anchor",e.anchor),e.class&&n.attr("class",e.class);const i=n.append("tspan");return i.attr("x",e.x+e.textMargin*2),i.text(r),n},"drawText"),hk=x((t,e,r,n)=>{const i=t.append("image");i.attr("x",e),i.attr("y",r);const a=tc(n);i.attr("xlink:href",a)},"drawImage"),dk=x((t,e,r,n)=>{const i=t.append("use");i.attr("x",e),i.attr("y",r);const a=tc(n);i.attr("xlink:href",`#${a}`)},"drawEmbeddedImage"),Da=x(()=>({x:0,y:0,width:100,height:100,fill:"#EDF2AE",stroke:"#666",anchor:"start",rx:0,ry:0}),"getNoteRect"),fk=x(()=>({x:0,y:0,width:100,height:100,"text-anchor":"start",style:"#666",textMargin:0,rx:0,ry:0,tspan:!0}),"getTextObj"),Hv=function(){var t=x(function(Ue,ke,Pe,Se){for(Pe=Pe||{},Se=Ue.length;Se--;Pe[Ue[Se]]=ke);return Pe},"o"),e=[1,24],r=[1,25],n=[1,26],i=[1,27],a=[1,28],s=[1,63],o=[1,64],l=[1,65],u=[1,66],h=[1,67],d=[1,68],f=[1,69],p=[1,29],g=[1,30],m=[1,31],v=[1,32],y=[1,33],b=[1,34],w=[1,35],T=[1,36],E=[1,37],L=[1,38],S=[1,39],C=[1,40],A=[1,41],N=[1,42],_=[1,43],O=[1,44],P=[1,45],k=[1,46],R=[1,47],I=[1,48],M=[1,50],D=[1,51],B=[1,52],$=[1,53],F=[1,54],G=[1,55],W=[1,56],J=[1,57],q=[1,58],ne=[1,59],ae=[1,60],pe=[14,42],K=[14,34,36,37,38,39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],Z=[12,14,34,36,37,38,39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],X=[1,82],Y=[1,83],ee=[1,84],j=[1,85],fe=[12,14,42],te=[12,14,33,42],Ae=[12,14,33,42,76,77,79,80],H=[12,33],Oe=[34,36,37,38,39,40,41,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],ue={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mermaidDoc:4,direction:5,direction_tb:6,direction_bt:7,direction_rl:8,direction_lr:9,graphConfig:10,C4_CONTEXT:11,NEWLINE:12,statements:13,EOF:14,C4_CONTAINER:15,C4_COMPONENT:16,C4_DYNAMIC:17,C4_DEPLOYMENT:18,otherStatements:19,diagramStatements:20,otherStatement:21,title:22,accDescription:23,acc_title:24,acc_title_value:25,acc_descr:26,acc_descr_value:27,acc_descr_multiline_value:28,boundaryStatement:29,boundaryStartStatement:30,boundaryStopStatement:31,boundaryStart:32,LBRACE:33,ENTERPRISE_BOUNDARY:34,attributes:35,SYSTEM_BOUNDARY:36,BOUNDARY:37,CONTAINER_BOUNDARY:38,NODE:39,NODE_L:40,NODE_R:41,RBRACE:42,diagramStatement:43,PERSON:44,PERSON_EXT:45,SYSTEM:46,SYSTEM_DB:47,SYSTEM_QUEUE:48,SYSTEM_EXT:49,SYSTEM_EXT_DB:50,SYSTEM_EXT_QUEUE:51,CONTAINER:52,CONTAINER_DB:53,CONTAINER_QUEUE:54,CONTAINER_EXT:55,CONTAINER_EXT_DB:56,CONTAINER_EXT_QUEUE:57,COMPONENT:58,COMPONENT_DB:59,COMPONENT_QUEUE:60,COMPONENT_EXT:61,COMPONENT_EXT_DB:62,COMPONENT_EXT_QUEUE:63,REL:64,BIREL:65,REL_U:66,REL_D:67,REL_L:68,REL_R:69,REL_B:70,REL_INDEX:71,UPDATE_EL_STYLE:72,UPDATE_REL_STYLE:73,UPDATE_LAYOUT_CONFIG:74,attribute:75,STR:76,STR_KEY:77,STR_VALUE:78,ATTRIBUTE:79,ATTRIBUTE_EMPTY:80,$accept:0,$end:1},terminals_:{2:"error",6:"direction_tb",7:"direction_bt",8:"direction_rl",9:"direction_lr",11:"C4_CONTEXT",12:"NEWLINE",14:"EOF",15:"C4_CONTAINER",16:"C4_COMPONENT",17:"C4_DYNAMIC",18:"C4_DEPLOYMENT",22:"title",23:"accDescription",24:"acc_title",25:"acc_title_value",26:"acc_descr",27:"acc_descr_value",28:"acc_descr_multiline_value",33:"LBRACE",34:"ENTERPRISE_BOUNDARY",36:"SYSTEM_BOUNDARY",37:"BOUNDARY",38:"CONTAINER_BOUNDARY",39:"NODE",40:"NODE_L",41:"NODE_R",42:"RBRACE",44:"PERSON",45:"PERSON_EXT",46:"SYSTEM",47:"SYSTEM_DB",48:"SYSTEM_QUEUE",49:"SYSTEM_EXT",50:"SYSTEM_EXT_DB",51:"SYSTEM_EXT_QUEUE",52:"CONTAINER",53:"CONTAINER_DB",54:"CONTAINER_QUEUE",55:"CONTAINER_EXT",56:"CONTAINER_EXT_DB",57:"CONTAINER_EXT_QUEUE",58:"COMPONENT",59:"COMPONENT_DB",60:"COMPONENT_QUEUE",61:"COMPONENT_EXT",62:"COMPONENT_EXT_DB",63:"COMPONENT_EXT_QUEUE",64:"REL",65:"BIREL",66:"REL_U",67:"REL_D",68:"REL_L",69:"REL_R",70:"REL_B",71:"REL_INDEX",72:"UPDATE_EL_STYLE",73:"UPDATE_REL_STYLE",74:"UPDATE_LAYOUT_CONFIG",76:"STR",77:"STR_KEY",78:"STR_VALUE",79:"ATTRIBUTE",80:"ATTRIBUTE_EMPTY"},productions_:[0,[3,1],[3,1],[5,1],[5,1],[5,1],[5,1],[4,1],[10,4],[10,4],[10,4],[10,4],[10,4],[13,1],[13,1],[13,2],[19,1],[19,2],[19,3],[21,1],[21,1],[21,2],[21,2],[21,1],[29,3],[30,3],[30,3],[30,4],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[31,1],[20,1],[20,2],[20,3],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,1],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[35,1],[35,2],[75,1],[75,2],[75,1],[75,1]],performAction:x(function(ke,Pe,Se,_e,ze,me,De){var Q=me.length-1;switch(ze){case 3:_e.setDirection("TB");break;case 4:_e.setDirection("BT");break;case 5:_e.setDirection("RL");break;case 6:_e.setDirection("LR");break;case 8:case 9:case 10:case 11:case 12:_e.setC4Type(me[Q-3]);break;case 19:_e.setTitle(me[Q].substring(6)),this.$=me[Q].substring(6);break;case 20:_e.setAccDescription(me[Q].substring(15)),this.$=me[Q].substring(15);break;case 21:this.$=me[Q].trim(),_e.setTitle(this.$);break;case 22:case 23:this.$=me[Q].trim(),_e.setAccDescription(this.$);break;case 28:me[Q].splice(2,0,"ENTERPRISE"),_e.addPersonOrSystemBoundary(...me[Q]),this.$=me[Q];break;case 29:me[Q].splice(2,0,"SYSTEM"),_e.addPersonOrSystemBoundary(...me[Q]),this.$=me[Q];break;case 30:_e.addPersonOrSystemBoundary(...me[Q]),this.$=me[Q];break;case 31:me[Q].splice(2,0,"CONTAINER"),_e.addContainerBoundary(...me[Q]),this.$=me[Q];break;case 32:_e.addDeploymentNode("node",...me[Q]),this.$=me[Q];break;case 33:_e.addDeploymentNode("nodeL",...me[Q]),this.$=me[Q];break;case 34:_e.addDeploymentNode("nodeR",...me[Q]),this.$=me[Q];break;case 35:_e.popBoundaryParseStack();break;case 39:_e.addPersonOrSystem("person",...me[Q]),this.$=me[Q];break;case 40:_e.addPersonOrSystem("external_person",...me[Q]),this.$=me[Q];break;case 41:_e.addPersonOrSystem("system",...me[Q]),this.$=me[Q];break;case 42:_e.addPersonOrSystem("system_db",...me[Q]),this.$=me[Q];break;case 43:_e.addPersonOrSystem("system_queue",...me[Q]),this.$=me[Q];break;case 44:_e.addPersonOrSystem("external_system",...me[Q]),this.$=me[Q];break;case 45:_e.addPersonOrSystem("external_system_db",...me[Q]),this.$=me[Q];break;case 46:_e.addPersonOrSystem("external_system_queue",...me[Q]),this.$=me[Q];break;case 47:_e.addContainer("container",...me[Q]),this.$=me[Q];break;case 48:_e.addContainer("container_db",...me[Q]),this.$=me[Q];break;case 49:_e.addContainer("container_queue",...me[Q]),this.$=me[Q];break;case 50:_e.addContainer("external_container",...me[Q]),this.$=me[Q];break;case 51:_e.addContainer("external_container_db",...me[Q]),this.$=me[Q];break;case 52:_e.addContainer("external_container_queue",...me[Q]),this.$=me[Q];break;case 53:_e.addComponent("component",...me[Q]),this.$=me[Q];break;case 54:_e.addComponent("component_db",...me[Q]),this.$=me[Q];break;case 55:_e.addComponent("component_queue",...me[Q]),this.$=me[Q];break;case 56:_e.addComponent("external_component",...me[Q]),this.$=me[Q];break;case 57:_e.addComponent("external_component_db",...me[Q]),this.$=me[Q];break;case 58:_e.addComponent("external_component_queue",...me[Q]),this.$=me[Q];break;case 60:_e.addRel("rel",...me[Q]),this.$=me[Q];break;case 61:_e.addRel("birel",...me[Q]),this.$=me[Q];break;case 62:_e.addRel("rel_u",...me[Q]),this.$=me[Q];break;case 63:_e.addRel("rel_d",...me[Q]),this.$=me[Q];break;case 64:_e.addRel("rel_l",...me[Q]),this.$=me[Q];break;case 65:_e.addRel("rel_r",...me[Q]),this.$=me[Q];break;case 66:_e.addRel("rel_b",...me[Q]),this.$=me[Q];break;case 67:me[Q].splice(0,1),_e.addRel("rel",...me[Q]),this.$=me[Q];break;case 68:_e.updateElStyle("update_el_style",...me[Q]),this.$=me[Q];break;case 69:_e.updateRelStyle("update_rel_style",...me[Q]),this.$=me[Q];break;case 70:_e.updateLayoutConfig("update_layout_config",...me[Q]),this.$=me[Q];break;case 71:this.$=[me[Q]];break;case 72:me[Q].unshift(me[Q-1]),this.$=me[Q];break;case 73:case 75:this.$=me[Q].trim();break;case 74:let ce={};ce[me[Q-1].trim()]=me[Q].trim(),this.$=ce;break;case 76:this.$="";break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],7:[1,6],8:[1,7],9:[1,8],10:4,11:[1,9],15:[1,10],16:[1,11],17:[1,12],18:[1,13]},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,7]},{1:[2,3]},{1:[2,4]},{1:[2,5]},{1:[2,6]},{12:[1,14]},{12:[1,15]},{12:[1,16]},{12:[1,17]},{12:[1,18]},{13:19,19:20,20:21,21:22,22:e,23:r,24:n,26:i,28:a,29:49,30:61,32:62,34:s,36:o,37:l,38:u,39:h,40:d,41:f,43:23,44:p,45:g,46:m,47:v,48:y,49:b,50:w,51:T,52:E,53:L,54:S,55:C,56:A,57:N,58:_,59:O,60:P,61:k,62:R,63:I,64:M,65:D,66:B,67:$,68:F,69:G,70:W,71:J,72:q,73:ne,74:ae},{13:70,19:20,20:21,21:22,22:e,23:r,24:n,26:i,28:a,29:49,30:61,32:62,34:s,36:o,37:l,38:u,39:h,40:d,41:f,43:23,44:p,45:g,46:m,47:v,48:y,49:b,50:w,51:T,52:E,53:L,54:S,55:C,56:A,57:N,58:_,59:O,60:P,61:k,62:R,63:I,64:M,65:D,66:B,67:$,68:F,69:G,70:W,71:J,72:q,73:ne,74:ae},{13:71,19:20,20:21,21:22,22:e,23:r,24:n,26:i,28:a,29:49,30:61,32:62,34:s,36:o,37:l,38:u,39:h,40:d,41:f,43:23,44:p,45:g,46:m,47:v,48:y,49:b,50:w,51:T,52:E,53:L,54:S,55:C,56:A,57:N,58:_,59:O,60:P,61:k,62:R,63:I,64:M,65:D,66:B,67:$,68:F,69:G,70:W,71:J,72:q,73:ne,74:ae},{13:72,19:20,20:21,21:22,22:e,23:r,24:n,26:i,28:a,29:49,30:61,32:62,34:s,36:o,37:l,38:u,39:h,40:d,41:f,43:23,44:p,45:g,46:m,47:v,48:y,49:b,50:w,51:T,52:E,53:L,54:S,55:C,56:A,57:N,58:_,59:O,60:P,61:k,62:R,63:I,64:M,65:D,66:B,67:$,68:F,69:G,70:W,71:J,72:q,73:ne,74:ae},{13:73,19:20,20:21,21:22,22:e,23:r,24:n,26:i,28:a,29:49,30:61,32:62,34:s,36:o,37:l,38:u,39:h,40:d,41:f,43:23,44:p,45:g,46:m,47:v,48:y,49:b,50:w,51:T,52:E,53:L,54:S,55:C,56:A,57:N,58:_,59:O,60:P,61:k,62:R,63:I,64:M,65:D,66:B,67:$,68:F,69:G,70:W,71:J,72:q,73:ne,74:ae},{14:[1,74]},t(pe,[2,13],{43:23,29:49,30:61,32:62,20:75,34:s,36:o,37:l,38:u,39:h,40:d,41:f,44:p,45:g,46:m,47:v,48:y,49:b,50:w,51:T,52:E,53:L,54:S,55:C,56:A,57:N,58:_,59:O,60:P,61:k,62:R,63:I,64:M,65:D,66:B,67:$,68:F,69:G,70:W,71:J,72:q,73:ne,74:ae}),t(pe,[2,14]),t(K,[2,16],{12:[1,76]}),t(pe,[2,36],{12:[1,77]}),t(Z,[2,19]),t(Z,[2,20]),{25:[1,78]},{27:[1,79]},t(Z,[2,23]),{35:80,75:81,76:X,77:Y,79:ee,80:j},{35:86,75:81,76:X,77:Y,79:ee,80:j},{35:87,75:81,76:X,77:Y,79:ee,80:j},{35:88,75:81,76:X,77:Y,79:ee,80:j},{35:89,75:81,76:X,77:Y,79:ee,80:j},{35:90,75:81,76:X,77:Y,79:ee,80:j},{35:91,75:81,76:X,77:Y,79:ee,80:j},{35:92,75:81,76:X,77:Y,79:ee,80:j},{35:93,75:81,76:X,77:Y,79:ee,80:j},{35:94,75:81,76:X,77:Y,79:ee,80:j},{35:95,75:81,76:X,77:Y,79:ee,80:j},{35:96,75:81,76:X,77:Y,79:ee,80:j},{35:97,75:81,76:X,77:Y,79:ee,80:j},{35:98,75:81,76:X,77:Y,79:ee,80:j},{35:99,75:81,76:X,77:Y,79:ee,80:j},{35:100,75:81,76:X,77:Y,79:ee,80:j},{35:101,75:81,76:X,77:Y,79:ee,80:j},{35:102,75:81,76:X,77:Y,79:ee,80:j},{35:103,75:81,76:X,77:Y,79:ee,80:j},{35:104,75:81,76:X,77:Y,79:ee,80:j},t(fe,[2,59]),{35:105,75:81,76:X,77:Y,79:ee,80:j},{35:106,75:81,76:X,77:Y,79:ee,80:j},{35:107,75:81,76:X,77:Y,79:ee,80:j},{35:108,75:81,76:X,77:Y,79:ee,80:j},{35:109,75:81,76:X,77:Y,79:ee,80:j},{35:110,75:81,76:X,77:Y,79:ee,80:j},{35:111,75:81,76:X,77:Y,79:ee,80:j},{35:112,75:81,76:X,77:Y,79:ee,80:j},{35:113,75:81,76:X,77:Y,79:ee,80:j},{35:114,75:81,76:X,77:Y,79:ee,80:j},{35:115,75:81,76:X,77:Y,79:ee,80:j},{20:116,29:49,30:61,32:62,34:s,36:o,37:l,38:u,39:h,40:d,41:f,43:23,44:p,45:g,46:m,47:v,48:y,49:b,50:w,51:T,52:E,53:L,54:S,55:C,56:A,57:N,58:_,59:O,60:P,61:k,62:R,63:I,64:M,65:D,66:B,67:$,68:F,69:G,70:W,71:J,72:q,73:ne,74:ae},{12:[1,118],33:[1,117]},{35:119,75:81,76:X,77:Y,79:ee,80:j},{35:120,75:81,76:X,77:Y,79:ee,80:j},{35:121,75:81,76:X,77:Y,79:ee,80:j},{35:122,75:81,76:X,77:Y,79:ee,80:j},{35:123,75:81,76:X,77:Y,79:ee,80:j},{35:124,75:81,76:X,77:Y,79:ee,80:j},{35:125,75:81,76:X,77:Y,79:ee,80:j},{14:[1,126]},{14:[1,127]},{14:[1,128]},{14:[1,129]},{1:[2,8]},t(pe,[2,15]),t(K,[2,17],{21:22,19:130,22:e,23:r,24:n,26:i,28:a}),t(pe,[2,37],{19:20,20:21,21:22,43:23,29:49,30:61,32:62,13:131,22:e,23:r,24:n,26:i,28:a,34:s,36:o,37:l,38:u,39:h,40:d,41:f,44:p,45:g,46:m,47:v,48:y,49:b,50:w,51:T,52:E,53:L,54:S,55:C,56:A,57:N,58:_,59:O,60:P,61:k,62:R,63:I,64:M,65:D,66:B,67:$,68:F,69:G,70:W,71:J,72:q,73:ne,74:ae}),t(Z,[2,21]),t(Z,[2,22]),t(fe,[2,39]),t(te,[2,71],{75:81,35:132,76:X,77:Y,79:ee,80:j}),t(Ae,[2,73]),{78:[1,133]},t(Ae,[2,75]),t(Ae,[2,76]),t(fe,[2,40]),t(fe,[2,41]),t(fe,[2,42]),t(fe,[2,43]),t(fe,[2,44]),t(fe,[2,45]),t(fe,[2,46]),t(fe,[2,47]),t(fe,[2,48]),t(fe,[2,49]),t(fe,[2,50]),t(fe,[2,51]),t(fe,[2,52]),t(fe,[2,53]),t(fe,[2,54]),t(fe,[2,55]),t(fe,[2,56]),t(fe,[2,57]),t(fe,[2,58]),t(fe,[2,60]),t(fe,[2,61]),t(fe,[2,62]),t(fe,[2,63]),t(fe,[2,64]),t(fe,[2,65]),t(fe,[2,66]),t(fe,[2,67]),t(fe,[2,68]),t(fe,[2,69]),t(fe,[2,70]),{31:134,42:[1,135]},{12:[1,136]},{33:[1,137]},t(H,[2,28]),t(H,[2,29]),t(H,[2,30]),t(H,[2,31]),t(H,[2,32]),t(H,[2,33]),t(H,[2,34]),{1:[2,9]},{1:[2,10]},{1:[2,11]},{1:[2,12]},t(K,[2,18]),t(pe,[2,38]),t(te,[2,72]),t(Ae,[2,74]),t(fe,[2,24]),t(fe,[2,35]),t(Oe,[2,25]),t(Oe,[2,26],{12:[1,138]}),t(Oe,[2,27])],defaultActions:{2:[2,1],3:[2,2],4:[2,7],5:[2,3],6:[2,4],7:[2,5],8:[2,6],74:[2,8],126:[2,9],127:[2,10],128:[2,11],129:[2,12]},parseError:x(function(ke,Pe){if(Pe.recoverable)this.trace(ke);else{var Se=new Error(ke);throw Se.hash=Pe,Se}},"parseError"),parse:x(function(ke){var Pe=this,Se=[0],_e=[],ze=[null],me=[],De=this.table,Q="",ce=0,z=0,oe=2,se=1,ge=me.slice.call(arguments,1),he=Object.create(this.lexer),be={yy:{}};for(var Ce in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Ce)&&(be.yy[Ce]=this.yy[Ce]);he.setInput(ke,be.yy),be.yy.lexer=he,be.yy.parser=this,typeof he.yylloc>"u"&&(he.yylloc={});var Te=he.yylloc;me.push(Te);var Ne=he.options&&he.options.ranges;typeof be.yy.parseError=="function"?this.parseError=be.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Xe(ct){Se.length=Se.length-2*ct,ze.length=ze.length-ct,me.length=me.length-ct}x(Xe,"popStack");function Ye(){var ct;return ct=_e.pop()||he.lex()||se,typeof ct!="number"&&(ct instanceof Array&&(_e=ct,ct=_e.pop()),ct=Pe.symbols_[ct]||ct),ct}x(Ye,"lex");for(var Ke,Ze,Be,He,ht={},st,We,kt,qe;;){if(Ze=Se[Se.length-1],this.defaultActions[Ze]?Be=this.defaultActions[Ze]:((Ke===null||typeof Ke>"u")&&(Ke=Ye()),Be=De[Ze]&&De[Ze][Ke]),typeof Be>"u"||!Be.length||!Be[0]){var rt="";qe=[];for(st in De[Ze])this.terminals_[st]&&st>oe&&qe.push("'"+this.terminals_[st]+"'");he.showPosition?rt="Parse error on line "+(ce+1)+`:
`+he.showPosition()+`
Expecting `+qe.join(", ")+", got '"+(this.terminals_[Ke]||Ke)+"'":rt="Parse error on line "+(ce+1)+": Unexpected "+(Ke==se?"end of input":"'"+(this.terminals_[Ke]||Ke)+"'"),this.parseError(rt,{text:he.match,token:this.terminals_[Ke]||Ke,line:he.yylineno,loc:Te,expected:qe})}if(Be[0]instanceof Array&&Be.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Ze+", token: "+Ke);switch(Be[0]){case 1:Se.push(Ke),ze.push(he.yytext),me.push(he.yylloc),Se.push(Be[1]),Ke=null,z=he.yyleng,Q=he.yytext,ce=he.yylineno,Te=he.yylloc;break;case 2:if(We=this.productions_[Be[1]][1],ht.$=ze[ze.length-We],ht._$={first_line:me[me.length-(We||1)].first_line,last_line:me[me.length-1].last_line,first_column:me[me.length-(We||1)].first_column,last_column:me[me.length-1].last_column},Ne&&(ht._$.range=[me[me.length-(We||1)].range[0],me[me.length-1].range[1]]),He=this.performAction.apply(ht,[Q,z,ce,be.yy,Be[1],ze,me].concat(ge)),typeof He<"u")return He;We&&(Se=Se.slice(0,-1*We*2),ze=ze.slice(0,-1*We),me=me.slice(0,-1*We)),Se.push(this.productions_[Be[1]][0]),ze.push(ht.$),me.push(ht._$),kt=De[Se[Se.length-2]][Se[Se.length-1]],Se.push(kt);break;case 3:return!0}}return!0},"parse")},Ve=function(){var Ue={EOF:1,parseError:x(function(Pe,Se){if(this.yy.parser)this.yy.parser.parseError(Pe,Se);else throw new Error(Pe)},"parseError"),setInput:x(function(ke,Pe){return this.yy=Pe||this.yy||{},this._input=ke,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:x(function(){var ke=this._input[0];this.yytext+=ke,this.yyleng++,this.offset++,this.match+=ke,this.matched+=ke;var Pe=ke.match(/(?:\r\n?|\n).*/g);return Pe?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),ke},"input"),unput:x(function(ke){var Pe=ke.length,Se=ke.split(/(?:\r\n?|\n)/g);this._input=ke+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-Pe),this.offset-=Pe;var _e=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),Se.length-1&&(this.yylineno-=Se.length-1);var ze=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:Se?(Se.length===_e.length?this.yylloc.first_column:0)+_e[_e.length-Se.length].length-Se[0].length:this.yylloc.first_column-Pe},this.options.ranges&&(this.yylloc.range=[ze[0],ze[0]+this.yyleng-Pe]),this.yyleng=this.yytext.length,this},"unput"),more:x(function(){return this._more=!0,this},"more"),reject:x(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:x(function(ke){this.unput(this.match.slice(ke))},"less"),pastInput:x(function(){var ke=this.matched.substr(0,this.matched.length-this.match.length);return(ke.length>20?"...":"")+ke.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:x(function(){var ke=this.match;return ke.length<20&&(ke+=this._input.substr(0,20-ke.length)),(ke.substr(0,20)+(ke.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:x(function(){var ke=this.pastInput(),Pe=new Array(ke.length+1).join("-");return ke+this.upcomingInput()+`
`+Pe+"^"},"showPosition"),test_match:x(function(ke,Pe){var Se,_e,ze;if(this.options.backtrack_lexer&&(ze={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(ze.yylloc.range=this.yylloc.range.slice(0))),_e=ke[0].match(/(?:\r\n?|\n).*/g),_e&&(this.yylineno+=_e.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:_e?_e[_e.length-1].length-_e[_e.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+ke[0].length},this.yytext+=ke[0],this.match+=ke[0],this.matches=ke,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(ke[0].length),this.matched+=ke[0],Se=this.performAction.call(this,this.yy,this,Pe,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),Se)return Se;if(this._backtrack){for(var me in ze)this[me]=ze[me];return!1}return!1},"test_match"),next:x(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var ke,Pe,Se,_e;this._more||(this.yytext="",this.match="");for(var ze=this._currentRules(),me=0;me<ze.length;me++)if(Se=this._input.match(this.rules[ze[me]]),Se&&(!Pe||Se[0].length>Pe[0].length)){if(Pe=Se,_e=me,this.options.backtrack_lexer){if(ke=this.test_match(Se,ze[me]),ke!==!1)return ke;if(this._backtrack){Pe=!1;continue}else return!1}else if(!this.options.flex)break}return Pe?(ke=this.test_match(Pe,ze[_e]),ke!==!1?ke:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var Pe=this.next();return Pe||this.lex()},"lex"),begin:x(function(Pe){this.conditionStack.push(Pe)},"begin"),popState:x(function(){var Pe=this.conditionStack.length-1;return Pe>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(Pe){return Pe=this.conditionStack.length-1-Math.abs(Pe||0),Pe>=0?this.conditionStack[Pe]:"INITIAL"},"topState"),pushState:x(function(Pe){this.begin(Pe)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:x(function(Pe,Se,_e,ze){switch(_e){case 0:return 6;case 1:return 7;case 2:return 8;case 3:return 9;case 4:return 22;case 5:return 23;case 6:return this.begin("acc_title"),24;case 7:return this.popState(),"acc_title_value";case 8:return this.begin("acc_descr"),26;case 9:return this.popState(),"acc_descr_value";case 10:this.begin("acc_descr_multiline");break;case 11:this.popState();break;case 12:return"acc_descr_multiline_value";case 13:break;case 14:c;break;case 15:return 12;case 16:break;case 17:return 11;case 18:return 15;case 19:return 16;case 20:return 17;case 21:return 18;case 22:return this.begin("person_ext"),45;case 23:return this.begin("person"),44;case 24:return this.begin("system_ext_queue"),51;case 25:return this.begin("system_ext_db"),50;case 26:return this.begin("system_ext"),49;case 27:return this.begin("system_queue"),48;case 28:return this.begin("system_db"),47;case 29:return this.begin("system"),46;case 30:return this.begin("boundary"),37;case 31:return this.begin("enterprise_boundary"),34;case 32:return this.begin("system_boundary"),36;case 33:return this.begin("container_ext_queue"),57;case 34:return this.begin("container_ext_db"),56;case 35:return this.begin("container_ext"),55;case 36:return this.begin("container_queue"),54;case 37:return this.begin("container_db"),53;case 38:return this.begin("container"),52;case 39:return this.begin("container_boundary"),38;case 40:return this.begin("component_ext_queue"),63;case 41:return this.begin("component_ext_db"),62;case 42:return this.begin("component_ext"),61;case 43:return this.begin("component_queue"),60;case 44:return this.begin("component_db"),59;case 45:return this.begin("component"),58;case 46:return this.begin("node"),39;case 47:return this.begin("node"),39;case 48:return this.begin("node_l"),40;case 49:return this.begin("node_r"),41;case 50:return this.begin("rel"),64;case 51:return this.begin("birel"),65;case 52:return this.begin("rel_u"),66;case 53:return this.begin("rel_u"),66;case 54:return this.begin("rel_d"),67;case 55:return this.begin("rel_d"),67;case 56:return this.begin("rel_l"),68;case 57:return this.begin("rel_l"),68;case 58:return this.begin("rel_r"),69;case 59:return this.begin("rel_r"),69;case 60:return this.begin("rel_b"),70;case 61:return this.begin("rel_index"),71;case 62:return this.begin("update_el_style"),72;case 63:return this.begin("update_rel_style"),73;case 64:return this.begin("update_layout_config"),74;case 65:return"EOF_IN_STRUCT";case 66:return this.begin("attribute"),"ATTRIBUTE_EMPTY";case 67:this.begin("attribute");break;case 68:this.popState(),this.popState();break;case 69:return 80;case 70:break;case 71:return 80;case 72:this.begin("string");break;case 73:this.popState();break;case 74:return"STR";case 75:this.begin("string_kv");break;case 76:return this.begin("string_kv_key"),"STR_KEY";case 77:this.popState(),this.begin("string_kv_value");break;case 78:return"STR_VALUE";case 79:this.popState(),this.popState();break;case 80:return"STR";case 81:return"LBRACE";case 82:return"RBRACE";case 83:return"SPACE";case 84:return"EOL";case 85:return 14}},"anonymous"),rules:[/^(?:.*direction\s+TB[^\n]*)/,/^(?:.*direction\s+BT[^\n]*)/,/^(?:.*direction\s+RL[^\n]*)/,/^(?:.*direction\s+LR[^\n]*)/,/^(?:title\s[^#\n;]+)/,/^(?:accDescription\s[^#\n;]+)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:%%(?!\{)*[^\n]*(\r?\n?)+)/,/^(?:%%[^\n]*(\r?\n)*)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:C4Context\b)/,/^(?:C4Container\b)/,/^(?:C4Component\b)/,/^(?:C4Dynamic\b)/,/^(?:C4Deployment\b)/,/^(?:Person_Ext\b)/,/^(?:Person\b)/,/^(?:SystemQueue_Ext\b)/,/^(?:SystemDb_Ext\b)/,/^(?:System_Ext\b)/,/^(?:SystemQueue\b)/,/^(?:SystemDb\b)/,/^(?:System\b)/,/^(?:Boundary\b)/,/^(?:Enterprise_Boundary\b)/,/^(?:System_Boundary\b)/,/^(?:ContainerQueue_Ext\b)/,/^(?:ContainerDb_Ext\b)/,/^(?:Container_Ext\b)/,/^(?:ContainerQueue\b)/,/^(?:ContainerDb\b)/,/^(?:Container\b)/,/^(?:Container_Boundary\b)/,/^(?:ComponentQueue_Ext\b)/,/^(?:ComponentDb_Ext\b)/,/^(?:Component_Ext\b)/,/^(?:ComponentQueue\b)/,/^(?:ComponentDb\b)/,/^(?:Component\b)/,/^(?:Deployment_Node\b)/,/^(?:Node\b)/,/^(?:Node_L\b)/,/^(?:Node_R\b)/,/^(?:Rel\b)/,/^(?:BiRel\b)/,/^(?:Rel_Up\b)/,/^(?:Rel_U\b)/,/^(?:Rel_Down\b)/,/^(?:Rel_D\b)/,/^(?:Rel_Left\b)/,/^(?:Rel_L\b)/,/^(?:Rel_Right\b)/,/^(?:Rel_R\b)/,/^(?:Rel_Back\b)/,/^(?:RelIndex\b)/,/^(?:UpdateElementStyle\b)/,/^(?:UpdateRelStyle\b)/,/^(?:UpdateLayoutConfig\b)/,/^(?:$)/,/^(?:[(][ ]*[,])/,/^(?:[(])/,/^(?:[)])/,/^(?:,,)/,/^(?:,)/,/^(?:[ ]*["]["])/,/^(?:[ ]*["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:[ ]*[\$])/,/^(?:[^=]*)/,/^(?:[=][ ]*["])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:[^,]+)/,/^(?:\{)/,/^(?:\})/,/^(?:[\s]+)/,/^(?:[\n\r]+)/,/^(?:$)/],conditions:{acc_descr_multiline:{rules:[11,12],inclusive:!1},acc_descr:{rules:[9],inclusive:!1},acc_title:{rules:[7],inclusive:!1},string_kv_value:{rules:[78,79],inclusive:!1},string_kv_key:{rules:[77],inclusive:!1},string_kv:{rules:[76],inclusive:!1},string:{rules:[73,74],inclusive:!1},attribute:{rules:[68,69,70,71,72,75,80],inclusive:!1},update_layout_config:{rules:[65,66,67,68],inclusive:!1},update_rel_style:{rules:[65,66,67,68],inclusive:!1},update_el_style:{rules:[65,66,67,68],inclusive:!1},rel_b:{rules:[65,66,67,68],inclusive:!1},rel_r:{rules:[65,66,67,68],inclusive:!1},rel_l:{rules:[65,66,67,68],inclusive:!1},rel_d:{rules:[65,66,67,68],inclusive:!1},rel_u:{rules:[65,66,67,68],inclusive:!1},rel_bi:{rules:[],inclusive:!1},rel:{rules:[65,66,67,68],inclusive:!1},node_r:{rules:[65,66,67,68],inclusive:!1},node_l:{rules:[65,66,67,68],inclusive:!1},node:{rules:[65,66,67,68],inclusive:!1},index:{rules:[],inclusive:!1},rel_index:{rules:[65,66,67,68],inclusive:!1},component_ext_queue:{rules:[],inclusive:!1},component_ext_db:{rules:[65,66,67,68],inclusive:!1},component_ext:{rules:[65,66,67,68],inclusive:!1},component_queue:{rules:[65,66,67,68],inclusive:!1},component_db:{rules:[65,66,67,68],inclusive:!1},component:{rules:[65,66,67,68],inclusive:!1},container_boundary:{rules:[65,66,67,68],inclusive:!1},container_ext_queue:{rules:[65,66,67,68],inclusive:!1},container_ext_db:{rules:[65,66,67,68],inclusive:!1},container_ext:{rules:[65,66,67,68],inclusive:!1},container_queue:{rules:[65,66,67,68],inclusive:!1},container_db:{rules:[65,66,67,68],inclusive:!1},container:{rules:[65,66,67,68],inclusive:!1},birel:{rules:[65,66,67,68],inclusive:!1},system_boundary:{rules:[65,66,67,68],inclusive:!1},enterprise_boundary:{rules:[65,66,67,68],inclusive:!1},boundary:{rules:[65,66,67,68],inclusive:!1},system_ext_queue:{rules:[65,66,67,68],inclusive:!1},system_ext_db:{rules:[65,66,67,68],inclusive:!1},system_ext:{rules:[65,66,67,68],inclusive:!1},system_queue:{rules:[65,66,67,68],inclusive:!1},system_db:{rules:[65,66,67,68],inclusive:!1},system:{rules:[65,66,67,68],inclusive:!1},person_ext:{rules:[65,66,67,68],inclusive:!1},person:{rules:[65,66,67,68],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,8,10,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,81,82,83,84,85],inclusive:!0}}};return Ue}();ue.lexer=Ve;function Ge(){this.yy={}}return x(Ge,"Parser"),Ge.prototype=ue,ue.Parser=Ge,new Ge}();Hv.parser=Hv;var e4e=Hv,ks=[],Nl=[""],Gi="global",xs="",eo=[{alias:"global",label:{text:"global"},type:{text:"global"},tags:null,link:null,parentBoundary:""}],fp=[],pk="",gk=!1,qv=4,Yv=2,nG,t4e=x(function(){return nG},"getC4Type"),r4e=x(function(t){nG=fr(t,we())},"setC4Type"),n4e=x(function(t,e,r,n,i,a,s,o,l){if(t==null||e===void 0||e===null||r===void 0||r===null||n===void 0||n===null)return;let u={};const h=fp.find(d=>d.from===e&&d.to===r);if(h?u=h:fp.push(u),u.type=t,u.from=e,u.to=r,u.label={text:n},i==null)u.techn={text:""};else if(typeof i=="object"){let[d,f]=Object.entries(i)[0];u[d]={text:f}}else u.techn={text:i};if(a==null)u.descr={text:""};else if(typeof a=="object"){let[d,f]=Object.entries(a)[0];u[d]={text:f}}else u.descr={text:a};if(typeof s=="object"){let[d,f]=Object.entries(s)[0];u[d]=f}else u.sprite=s;if(typeof o=="object"){let[d,f]=Object.entries(o)[0];u[d]=f}else u.tags=o;if(typeof l=="object"){let[d,f]=Object.entries(l)[0];u[d]=f}else u.link=l;u.wrap=uc()},"addRel"),i4e=x(function(t,e,r,n,i,a,s){if(e===null||r===null)return;let o={};const l=ks.find(u=>u.alias===e);if(l&&e===l.alias?o=l:(o.alias=e,ks.push(o)),r==null?o.label={text:""}:o.label={text:r},n==null)o.descr={text:""};else if(typeof n=="object"){let[u,h]=Object.entries(n)[0];o[u]={text:h}}else o.descr={text:n};if(typeof i=="object"){let[u,h]=Object.entries(i)[0];o[u]=h}else o.sprite=i;if(typeof a=="object"){let[u,h]=Object.entries(a)[0];o[u]=h}else o.tags=a;if(typeof s=="object"){let[u,h]=Object.entries(s)[0];o[u]=h}else o.link=s;o.typeC4Shape={text:t},o.parentBoundary=Gi,o.wrap=uc()},"addPersonOrSystem"),a4e=x(function(t,e,r,n,i,a,s,o){if(e===null||r===null)return;let l={};const u=ks.find(h=>h.alias===e);if(u&&e===u.alias?l=u:(l.alias=e,ks.push(l)),r==null?l.label={text:""}:l.label={text:r},n==null)l.techn={text:""};else if(typeof n=="object"){let[h,d]=Object.entries(n)[0];l[h]={text:d}}else l.techn={text:n};if(i==null)l.descr={text:""};else if(typeof i=="object"){let[h,d]=Object.entries(i)[0];l[h]={text:d}}else l.descr={text:i};if(typeof a=="object"){let[h,d]=Object.entries(a)[0];l[h]=d}else l.sprite=a;if(typeof s=="object"){let[h,d]=Object.entries(s)[0];l[h]=d}else l.tags=s;if(typeof o=="object"){let[h,d]=Object.entries(o)[0];l[h]=d}else l.link=o;l.wrap=uc(),l.typeC4Shape={text:t},l.parentBoundary=Gi},"addContainer"),s4e=x(function(t,e,r,n,i,a,s,o){if(e===null||r===null)return;let l={};const u=ks.find(h=>h.alias===e);if(u&&e===u.alias?l=u:(l.alias=e,ks.push(l)),r==null?l.label={text:""}:l.label={text:r},n==null)l.techn={text:""};else if(typeof n=="object"){let[h,d]=Object.entries(n)[0];l[h]={text:d}}else l.techn={text:n};if(i==null)l.descr={text:""};else if(typeof i=="object"){let[h,d]=Object.entries(i)[0];l[h]={text:d}}else l.descr={text:i};if(typeof a=="object"){let[h,d]=Object.entries(a)[0];l[h]=d}else l.sprite=a;if(typeof s=="object"){let[h,d]=Object.entries(s)[0];l[h]=d}else l.tags=s;if(typeof o=="object"){let[h,d]=Object.entries(o)[0];l[h]=d}else l.link=o;l.wrap=uc(),l.typeC4Shape={text:t},l.parentBoundary=Gi},"addComponent"),o4e=x(function(t,e,r,n,i){if(t===null||e===null)return;let a={};const s=eo.find(o=>o.alias===t);if(s&&t===s.alias?a=s:(a.alias=t,eo.push(a)),e==null?a.label={text:""}:a.label={text:e},r==null)a.type={text:"system"};else if(typeof r=="object"){let[o,l]=Object.entries(r)[0];a[o]={text:l}}else a.type={text:r};if(typeof n=="object"){let[o,l]=Object.entries(n)[0];a[o]=l}else a.tags=n;if(typeof i=="object"){let[o,l]=Object.entries(i)[0];a[o]=l}else a.link=i;a.parentBoundary=Gi,a.wrap=uc(),xs=Gi,Gi=t,Nl.push(xs)},"addPersonOrSystemBoundary"),l4e=x(function(t,e,r,n,i){if(t===null||e===null)return;let a={};const s=eo.find(o=>o.alias===t);if(s&&t===s.alias?a=s:(a.alias=t,eo.push(a)),e==null?a.label={text:""}:a.label={text:e},r==null)a.type={text:"container"};else if(typeof r=="object"){let[o,l]=Object.entries(r)[0];a[o]={text:l}}else a.type={text:r};if(typeof n=="object"){let[o,l]=Object.entries(n)[0];a[o]=l}else a.tags=n;if(typeof i=="object"){let[o,l]=Object.entries(i)[0];a[o]=l}else a.link=i;a.parentBoundary=Gi,a.wrap=uc(),xs=Gi,Gi=t,Nl.push(xs)},"addContainerBoundary"),c4e=x(function(t,e,r,n,i,a,s,o){if(e===null||r===null)return;let l={};const u=eo.find(h=>h.alias===e);if(u&&e===u.alias?l=u:(l.alias=e,eo.push(l)),r==null?l.label={text:""}:l.label={text:r},n==null)l.type={text:"node"};else if(typeof n=="object"){let[h,d]=Object.entries(n)[0];l[h]={text:d}}else l.type={text:n};if(i==null)l.descr={text:""};else if(typeof i=="object"){let[h,d]=Object.entries(i)[0];l[h]={text:d}}else l.descr={text:i};if(typeof s=="object"){let[h,d]=Object.entries(s)[0];l[h]=d}else l.tags=s;if(typeof o=="object"){let[h,d]=Object.entries(o)[0];l[h]=d}else l.link=o;l.nodeType=t,l.parentBoundary=Gi,l.wrap=uc(),xs=Gi,Gi=e,Nl.push(xs)},"addDeploymentNode"),u4e=x(function(){Gi=xs,Nl.pop(),xs=Nl.pop(),Nl.push(xs)},"popBoundaryParseStack"),h4e=x(function(t,e,r,n,i,a,s,o,l,u,h){let d=ks.find(f=>f.alias===e);if(!(d===void 0&&(d=eo.find(f=>f.alias===e),d===void 0))){if(r!=null)if(typeof r=="object"){let[f,p]=Object.entries(r)[0];d[f]=p}else d.bgColor=r;if(n!=null)if(typeof n=="object"){let[f,p]=Object.entries(n)[0];d[f]=p}else d.fontColor=n;if(i!=null)if(typeof i=="object"){let[f,p]=Object.entries(i)[0];d[f]=p}else d.borderColor=i;if(a!=null)if(typeof a=="object"){let[f,p]=Object.entries(a)[0];d[f]=p}else d.shadowing=a;if(s!=null)if(typeof s=="object"){let[f,p]=Object.entries(s)[0];d[f]=p}else d.shape=s;if(o!=null)if(typeof o=="object"){let[f,p]=Object.entries(o)[0];d[f]=p}else d.sprite=o;if(l!=null)if(typeof l=="object"){let[f,p]=Object.entries(l)[0];d[f]=p}else d.techn=l;if(u!=null)if(typeof u=="object"){let[f,p]=Object.entries(u)[0];d[f]=p}else d.legendText=u;if(h!=null)if(typeof h=="object"){let[f,p]=Object.entries(h)[0];d[f]=p}else d.legendSprite=h}},"updateElStyle"),d4e=x(function(t,e,r,n,i,a,s){const o=fp.find(l=>l.from===e&&l.to===r);if(o!==void 0){if(n!=null)if(typeof n=="object"){let[l,u]=Object.entries(n)[0];o[l]=u}else o.textColor=n;if(i!=null)if(typeof i=="object"){let[l,u]=Object.entries(i)[0];o[l]=u}else o.lineColor=i;if(a!=null)if(typeof a=="object"){let[l,u]=Object.entries(a)[0];o[l]=parseInt(u)}else o.offsetX=parseInt(a);if(s!=null)if(typeof s=="object"){let[l,u]=Object.entries(s)[0];o[l]=parseInt(u)}else o.offsetY=parseInt(s)}},"updateRelStyle"),f4e=x(function(t,e,r){let n=qv,i=Yv;if(typeof e=="object"){const a=Object.values(e)[0];n=parseInt(a)}else n=parseInt(e);if(typeof r=="object"){const a=Object.values(r)[0];i=parseInt(a)}else i=parseInt(r);n>=1&&(qv=n),i>=1&&(Yv=i)},"updateLayoutConfig"),p4e=x(function(){return qv},"getC4ShapeInRow"),g4e=x(function(){return Yv},"getC4BoundaryInRow"),m4e=x(function(){return Gi},"getCurrentBoundaryParse"),v4e=x(function(){return xs},"getParentBoundaryParse"),iG=x(function(t){return t==null?ks:ks.filter(e=>e.parentBoundary===t)},"getC4ShapeArray"),y4e=x(function(t){return ks.find(e=>e.alias===t)},"getC4Shape"),x4e=x(function(t){return Object.keys(iG(t))},"getC4ShapeKeys"),aG=x(function(t){return t==null?eo:eo.filter(e=>e.parentBoundary===t)},"getBoundaries"),b4e=aG,w4e=x(function(){return fp},"getRels"),T4e=x(function(){return pk},"getTitle"),E4e=x(function(t){gk=t},"setWrap"),uc=x(function(){return gk},"autoWrap"),k4e=x(function(){ks=[],eo=[{alias:"global",label:{text:"global"},type:{text:"global"},tags:null,link:null,parentBoundary:""}],xs="",Gi="global",Nl=[""],fp=[],Nl=[""],pk="",gk=!1,qv=4,Yv=2},"clear"),S4e={SOLID:0,DOTTED:1,NOTE:2,SOLID_CROSS:3,DOTTED_CROSS:4,SOLID_OPEN:5,DOTTED_OPEN:6,LOOP_START:10,LOOP_END:11,ALT_START:12,ALT_ELSE:13,ALT_END:14,OPT_START:15,OPT_END:16,ACTIVE_START:17,ACTIVE_END:18,PAR_START:19,PAR_AND:20,PAR_END:21,RECT_START:22,RECT_END:23,SOLID_POINT:24,DOTTED_POINT:25},C4e={FILLED:0,OPEN:1},A4e={LEFTOF:0,RIGHTOF:1,OVER:2},_4e=x(function(t){pk=fr(t,we())},"setTitle"),Ew={addPersonOrSystem:i4e,addPersonOrSystemBoundary:o4e,addContainer:a4e,addContainerBoundary:l4e,addComponent:s4e,addDeploymentNode:c4e,popBoundaryParseStack:u4e,addRel:n4e,updateElStyle:h4e,updateRelStyle:d4e,updateLayoutConfig:f4e,autoWrap:uc,setWrap:E4e,getC4ShapeArray:iG,getC4Shape:y4e,getC4ShapeKeys:x4e,getBoundaries:aG,getBoundarys:b4e,getCurrentBoundaryParse:m4e,getParentBoundaryParse:v4e,getRels:w4e,getTitle:T4e,getC4Type:t4e,getC4ShapeInRow:p4e,getC4BoundaryInRow:g4e,setAccTitle:Sn,getAccTitle:zn,getAccDescription:Gn,setAccDescription:Vn,getConfig:x(()=>we().c4,"getConfig"),clear:k4e,LINETYPE:S4e,ARROWTYPE:C4e,PLACEMENT:A4e,setTitle:_4e,setC4Type:r4e},mk=x(function(t,e){return H2(t,e)},"drawRect"),sG=x(function(t,e,r,n,i,a){const s=t.append("image");s.attr("width",e),s.attr("height",r),s.attr("x",n),s.attr("y",i);let o=a.startsWith("data:image/png;base64")?a:tc(a);s.attr("xlink:href",o)},"drawImage"),L4e=x((t,e,r)=>{const n=t.append("g");let i=0;for(let a of e){let s=a.textColor?a.textColor:"#444444",o=a.lineColor?a.lineColor:"#444444",l=a.offsetX?parseInt(a.offsetX):0,u=a.offsetY?parseInt(a.offsetY):0,h="";if(i===0){let f=n.append("line");f.attr("x1",a.startPoint.x),f.attr("y1",a.startPoint.y),f.attr("x2",a.endPoint.x),f.attr("y2",a.endPoint.y),f.attr("stroke-width","1"),f.attr("stroke",o),f.style("fill","none"),a.type!=="rel_b"&&f.attr("marker-end","url("+h+"#arrowhead)"),(a.type==="birel"||a.type==="rel_b")&&f.attr("marker-start","url("+h+"#arrowend)"),i=-1}else{let f=n.append("path");f.attr("fill","none").attr("stroke-width","1").attr("stroke",o).attr("d","Mstartx,starty Qcontrolx,controly stopx,stopy ".replaceAll("startx",a.startPoint.x).replaceAll("starty",a.startPoint.y).replaceAll("controlx",a.startPoint.x+(a.endPoint.x-a.startPoint.x)/2-(a.endPoint.x-a.startPoint.x)/4).replaceAll("controly",a.startPoint.y+(a.endPoint.y-a.startPoint.y)/2).replaceAll("stopx",a.endPoint.x).replaceAll("stopy",a.endPoint.y)),a.type!=="rel_b"&&f.attr("marker-end","url("+h+"#arrowhead)"),(a.type==="birel"||a.type==="rel_b")&&f.attr("marker-start","url("+h+"#arrowend)")}let d=r.messageFont();Io(r)(a.label.text,n,Math.min(a.startPoint.x,a.endPoint.x)+Math.abs(a.endPoint.x-a.startPoint.x)/2+l,Math.min(a.startPoint.y,a.endPoint.y)+Math.abs(a.endPoint.y-a.startPoint.y)/2+u,a.label.width,a.label.height,{fill:s},d),a.techn&&a.techn.text!==""&&(d=r.messageFont(),Io(r)("["+a.techn.text+"]",n,Math.min(a.startPoint.x,a.endPoint.x)+Math.abs(a.endPoint.x-a.startPoint.x)/2+l,Math.min(a.startPoint.y,a.endPoint.y)+Math.abs(a.endPoint.y-a.startPoint.y)/2+r.messageFontSize+5+u,Math.max(a.label.width,a.techn.width),a.techn.height,{fill:s,"font-style":"italic"},d))}},"drawRels"),R4e=x(function(t,e,r){const n=t.append("g");let i=e.bgColor?e.bgColor:"none",a=e.borderColor?e.borderColor:"#444444",s=e.fontColor?e.fontColor:"black",o={"stroke-width":1,"stroke-dasharray":"7.0,7.0"};e.nodeType&&(o={"stroke-width":1});let l={x:e.x,y:e.y,fill:i,stroke:a,width:e.width,height:e.height,rx:2.5,ry:2.5,attrs:o};mk(n,l);let u=r.boundaryFont();u.fontWeight="bold",u.fontSize=u.fontSize+2,u.fontColor=s,Io(r)(e.label.text,n,e.x,e.y+e.label.Y,e.width,e.height,{fill:"#444444"},u),e.type&&e.type.text!==""&&(u=r.boundaryFont(),u.fontColor=s,Io(r)(e.type.text,n,e.x,e.y+e.type.Y,e.width,e.height,{fill:"#444444"},u)),e.descr&&e.descr.text!==""&&(u=r.boundaryFont(),u.fontSize=u.fontSize-2,u.fontColor=s,Io(r)(e.descr.text,n,e.x,e.y+e.descr.Y,e.width,e.height,{fill:"#444444"},u))},"drawBoundary"),N4e=x(function(t,e,r){let n=e.bgColor?e.bgColor:r[e.typeC4Shape.text+"_bg_color"],i=e.borderColor?e.borderColor:r[e.typeC4Shape.text+"_border_color"],a=e.fontColor?e.fontColor:"#FFFFFF",s="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAACD0lEQVR4Xu2YoU4EMRCGT+4j8Ai8AhaH4QHgAUjQuFMECUgMIUgwJAgMhgQsAYUiJCiQIBBY+EITsjfTdme6V24v4c8vyGbb+ZjOtN0bNcvjQXmkH83WvYBWto6PLm6v7p7uH1/w2fXD+PBycX1Pv2l3IdDm/vn7x+dXQiAubRzoURa7gRZWd0iGRIiJbOnhnfYBQZNJjNbuyY2eJG8fkDE3bbG4ep6MHUAsgYxmE3nVs6VsBWJSGccsOlFPmLIViMzLOB7pCVO2AtHJMohH7Fh6zqitQK7m0rJvAVYgGcEpe//PLdDz65sM4pF9N7ICcXDKIB5Nv6j7tD0NoSdM2QrU9Gg0ewE1LqBhHR3BBdvj2vapnidjHxD/q6vd7Pvhr31AwcY8eXMTXAKECZZJFXuEq27aLgQK5uLMohCenGGuGewOxSjBvYBqeG6B+Nqiblggdjnc+ZXDy+FNFpFzw76O3UBAROuXh6FoiAcf5g9eTvUgzy0nWg6I8cXHRUpg5bOVBCo+KDpFajOf23GgPme7RSQ+lacIENUgJ6gg1k6HjgOlqnLqip4tEuhv0hNEMXUD0clyXE3p6pZA0S2nnvTlXwLJEZWlb7cTQH1+USgTN4VhAenm/wea1OCAOmqo6fE1WCb9WSKBah+rbUWPWAmE2Rvk0ApiB45eOyNAzU8xcTvj8KvkKEoOaIYeHNA3ZuygAvFMUO0AAAAASUVORK5CYII=";switch(e.typeC4Shape.text){case"person":s="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAACD0lEQVR4Xu2YoU4EMRCGT+4j8Ai8AhaH4QHgAUjQuFMECUgMIUgwJAgMhgQsAYUiJCiQIBBY+EITsjfTdme6V24v4c8vyGbb+ZjOtN0bNcvjQXmkH83WvYBWto6PLm6v7p7uH1/w2fXD+PBycX1Pv2l3IdDm/vn7x+dXQiAubRzoURa7gRZWd0iGRIiJbOnhnfYBQZNJjNbuyY2eJG8fkDE3bbG4ep6MHUAsgYxmE3nVs6VsBWJSGccsOlFPmLIViMzLOB7pCVO2AtHJMohH7Fh6zqitQK7m0rJvAVYgGcEpe//PLdDz65sM4pF9N7ICcXDKIB5Nv6j7tD0NoSdM2QrU9Gg0ewE1LqBhHR3BBdvj2vapnidjHxD/q6vd7Pvhr31AwcY8eXMTXAKECZZJFXuEq27aLgQK5uLMohCenGGuGewOxSjBvYBqeG6B+Nqiblggdjnc+ZXDy+FNFpFzw76O3UBAROuXh6FoiAcf5g9eTvUgzy0nWg6I8cXHRUpg5bOVBCo+KDpFajOf23GgPme7RSQ+lacIENUgJ6gg1k6HjgOlqnLqip4tEuhv0hNEMXUD0clyXE3p6pZA0S2nnvTlXwLJEZWlb7cTQH1+USgTN4VhAenm/wea1OCAOmqo6fE1WCb9WSKBah+rbUWPWAmE2Rvk0ApiB45eOyNAzU8xcTvj8KvkKEoOaIYeHNA3ZuygAvFMUO0AAAAASUVORK5CYII=";break;case"external_person":s="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAAB6ElEQVR4Xu2YLY+EMBCG9+dWr0aj0Wg0Go1Go0+j8Xdv2uTCvv1gpt0ebHKPuhDaeW4605Z9mJvx4AdXUyTUdd08z+u6flmWZRnHsWkafk9DptAwDPu+f0eAYtu2PEaGWuj5fCIZrBAC2eLBAnRCsEkkxmeaJp7iDJ2QMDdHsLg8SxKFEJaAo8lAXnmuOFIhTMpxxKATebo4UiFknuNo4OniSIXQyRxEA3YsnjGCVEjVXD7yLUAqxBGUyPv/Y4W2beMgGuS7kVQIBycH0fD+oi5pezQETxdHKmQKGk1eQEYldK+jw5GxPfZ9z7Mk0Qnhf1W1m3w//EUn5BDmSZsbR44QQLBEqrBHqOrmSKaQAxdnLArCrxZcM7A7ZKs4ioRq8LFC+NpC3WCBJsvpVw5edm9iEXFuyNfxXAgSwfrFQ1c0iNda8AdejvUgnktOtJQQxmcfFzGglc5WVCj7oDgFqU18boeFSs52CUh8LE8BIVQDT1ABrB0HtgSEYlX5doJnCwv9TXocKCaKbnwhdDKPq4lf3SwU3HLq4V/+WYhHVMa/3b4IlfyikAduCkcBc7mQ3/z/Qq/cTuikhkzB12Ae/mcJC9U+Vo8Ej1gWAtgbeGgFsAMHr50BIWOLCbezvhpBFUdY6EJuJ/QDW0XoMX60zZ0AAAAASUVORK5CYII=";break}const o=t.append("g");o.attr("class","person-man");const l=Da();switch(e.typeC4Shape.text){case"person":case"external_person":case"system":case"external_system":case"container":case"external_container":case"component":case"external_component":l.x=e.x,l.y=e.y,l.fill=n,l.width=e.width,l.height=e.height,l.stroke=i,l.rx=2.5,l.ry=2.5,l.attrs={"stroke-width":.5},mk(o,l);break;case"system_db":case"external_system_db":case"container_db":case"external_container_db":case"component_db":case"external_component_db":o.append("path").attr("fill",n).attr("stroke-width","0.5").attr("stroke",i).attr("d","Mstartx,startyc0,-10 half,-10 half,-10c0,0 half,0 half,10l0,heightc0,10 -half,10 -half,10c0,0 -half,0 -half,-10l0,-height".replaceAll("startx",e.x).replaceAll("starty",e.y).replaceAll("half",e.width/2).replaceAll("height",e.height)),o.append("path").attr("fill","none").attr("stroke-width","0.5").attr("stroke",i).attr("d","Mstartx,startyc0,10 half,10 half,10c0,0 half,0 half,-10".replaceAll("startx",e.x).replaceAll("starty",e.y).replaceAll("half",e.width/2));break;case"system_queue":case"external_system_queue":case"container_queue":case"external_container_queue":case"component_queue":case"external_component_queue":o.append("path").attr("fill",n).attr("stroke-width","0.5").attr("stroke",i).attr("d","Mstartx,startylwidth,0c5,0 5,half 5,halfc0,0 0,half -5,halfl-width,0c-5,0 -5,-half -5,-halfc0,0 0,-half 5,-half".replaceAll("startx",e.x).replaceAll("starty",e.y).replaceAll("width",e.width).replaceAll("half",e.height/2)),o.append("path").attr("fill","none").attr("stroke-width","0.5").attr("stroke",i).attr("d","Mstartx,startyc-5,0 -5,half -5,halfc0,half 5,half 5,half".replaceAll("startx",e.x+e.width).replaceAll("starty",e.y).replaceAll("half",e.height/2));break}let u=z4e(r,e.typeC4Shape.text);switch(o.append("text").attr("fill",a).attr("font-family",u.fontFamily).attr("font-size",u.fontSize-2).attr("font-style","italic").attr("lengthAdjust","spacing").attr("textLength",e.typeC4Shape.width).attr("x",e.x+e.width/2-e.typeC4Shape.width/2).attr("y",e.y+e.typeC4Shape.Y).text("<<"+e.typeC4Shape.text+">>"),e.typeC4Shape.text){case"person":case"external_person":sG(o,48,48,e.x+e.width/2-24,e.y+e.image.Y,s);break}let h=r[e.typeC4Shape.text+"Font"]();return h.fontWeight="bold",h.fontSize=h.fontSize+2,h.fontColor=a,Io(r)(e.label.text,o,e.x,e.y+e.label.Y,e.width,e.height,{fill:a},h),h=r[e.typeC4Shape.text+"Font"](),h.fontColor=a,e.techn&&e.techn?.text!==""?Io(r)(e.techn.text,o,e.x,e.y+e.techn.Y,e.width,e.height,{fill:a,"font-style":"italic"},h):e.type&&e.type.text!==""&&Io(r)(e.type.text,o,e.x,e.y+e.type.Y,e.width,e.height,{fill:a,"font-style":"italic"},h),e.descr&&e.descr.text!==""&&(h=r.personFont(),h.fontColor=a,Io(r)(e.descr.text,o,e.x,e.y+e.descr.Y,e.width,e.height,{fill:a},h)),e.height},"drawC4Shape"),D4e=x(function(t){t.append("defs").append("symbol").attr("id","database").attr("fill-rule","evenodd").attr("clip-rule","evenodd").append("path").attr("transform","scale(.5)").attr("d","M12.258.001l.256.004.255.005.253.008.251.01.249.012.247.015.246.016.242.019.241.02.239.023.236.024.233.027.231.028.229.031.225.032.223.034.22.036.217.038.214.04.211.041.208.043.205.045.201.046.198.048.194.05.191.051.187.053.183.054.18.056.175.057.172.059.168.06.163.061.16.063.155.064.15.066.074.033.073.033.071.034.07.034.069.035.068.035.067.035.066.035.064.036.064.036.062.036.06.036.06.037.058.037.058.037.055.038.055.038.053.038.052.038.051.039.05.039.048.039.047.039.045.04.044.04.043.04.041.04.04.041.039.041.037.041.036.041.034.041.033.042.032.042.03.042.029.042.027.042.026.043.024.043.023.043.021.043.02.043.018.044.017.043.015.044.013.044.012.044.011.045.009.044.007.045.006.045.004.045.002.045.001.045v17l-.001.045-.002.045-.004.045-.006.045-.007.045-.009.044-.011.045-.012.044-.013.044-.015.044-.017.043-.018.044-.02.043-.021.043-.023.043-.024.043-.026.043-.027.042-.029.042-.03.042-.032.042-.033.042-.034.041-.036.041-.037.041-.039.041-.04.041-.041.04-.043.04-.044.04-.045.04-.047.039-.048.039-.05.039-.051.039-.052.038-.053.038-.055.038-.055.038-.058.037-.058.037-.06.037-.06.036-.062.036-.064.036-.064.036-.066.035-.067.035-.068.035-.069.035-.07.034-.071.034-.073.033-.074.033-.15.066-.155.064-.16.063-.163.061-.168.06-.172.059-.175.057-.18.056-.183.054-.187.053-.191.051-.194.05-.198.048-.201.046-.205.045-.208.043-.211.041-.214.04-.217.038-.22.036-.223.034-.225.032-.229.031-.231.028-.233.027-.236.024-.239.023-.241.02-.242.019-.246.016-.247.015-.249.012-.251.01-.253.008-.255.005-.256.004-.258.001-.258-.001-.256-.004-.255-.005-.253-.008-.251-.01-.249-.012-.247-.015-.245-.016-.243-.019-.241-.02-.238-.023-.236-.024-.234-.027-.231-.028-.228-.031-.226-.032-.223-.034-.22-.036-.217-.038-.214-.04-.211-.041-.208-.043-.204-.045-.201-.046-.198-.048-.195-.05-.19-.051-.187-.053-.184-.054-.179-.056-.176-.057-.172-.059-.167-.06-.164-.061-.159-.063-.155-.064-.151-.066-.074-.033-.072-.033-.072-.034-.07-.034-.069-.035-.068-.035-.067-.035-.066-.035-.064-.036-.063-.036-.062-.036-.061-.036-.06-.037-.058-.037-.057-.037-.056-.038-.055-.038-.053-.038-.052-.038-.051-.039-.049-.039-.049-.039-.046-.039-.046-.04-.044-.04-.043-.04-.041-.04-.04-.041-.039-.041-.037-.041-.036-.041-.034-.041-.033-.042-.032-.042-.03-.042-.029-.042-.027-.042-.026-.043-.024-.043-.023-.043-.021-.043-.02-.043-.018-.044-.017-.043-.015-.044-.013-.044-.012-.044-.011-.045-.009-.044-.007-.045-.006-.045-.004-.045-.002-.045-.001-.045v-17l.001-.045.002-.045.004-.045.006-.045.007-.045.009-.044.011-.045.012-.044.013-.044.015-.044.017-.043.018-.044.02-.043.021-.043.023-.043.024-.043.026-.043.027-.042.029-.042.03-.042.032-.042.033-.042.034-.041.036-.041.037-.041.039-.041.04-.041.041-.04.043-.04.044-.04.046-.04.046-.039.049-.039.049-.039.051-.039.052-.038.053-.038.055-.038.056-.038.057-.037.058-.037.06-.037.061-.036.062-.036.063-.036.064-.036.066-.035.067-.035.068-.035.069-.035.07-.034.072-.034.072-.033.074-.033.151-.066.155-.064.159-.063.164-.061.167-.06.172-.059.176-.057.179-.056.184-.054.187-.053.19-.051.195-.05.198-.048.201-.046.204-.045.208-.043.211-.041.214-.04.217-.038.22-.036.223-.034.226-.032.228-.031.231-.028.234-.027.236-.024.238-.023.241-.02.243-.019.245-.016.247-.015.249-.012.251-.01.253-.008.255-.005.256-.004.258-.001.258.001zm-9.258 20.499v.01l.001.021.003.021.004.022.005.021.006.022.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.023.018.024.019.024.021.024.022.025.023.024.024.025.052.049.056.05.061.051.066.051.07.051.075.051.079.052.084.052.088.052.092.052.097.052.102.051.105.052.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.048.144.049.147.047.152.047.155.047.16.045.163.045.167.043.171.043.176.041.178.041.183.039.187.039.19.037.194.035.197.035.202.033.204.031.209.03.212.029.216.027.219.025.222.024.226.021.23.02.233.018.236.016.24.015.243.012.246.01.249.008.253.005.256.004.259.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.021.224-.024.22-.026.216-.027.212-.028.21-.031.205-.031.202-.034.198-.034.194-.036.191-.037.187-.039.183-.04.179-.04.175-.042.172-.043.168-.044.163-.045.16-.046.155-.046.152-.047.148-.048.143-.049.139-.049.136-.05.131-.05.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.053.083-.051.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.05.023-.024.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.023.01-.022.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.127l-.077.055-.08.053-.083.054-.085.053-.087.052-.09.052-.093.051-.095.05-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.045-.118.044-.12.043-.122.042-.124.042-.126.041-.128.04-.13.04-.132.038-.134.038-.135.037-.138.037-.139.035-.142.035-.143.034-.144.033-.147.032-.148.031-.15.03-.151.03-.153.029-.154.027-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.01-.179.008-.179.008-.181.006-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.006-.179-.008-.179-.008-.178-.01-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.027-.153-.029-.151-.03-.15-.03-.148-.031-.146-.032-.145-.033-.143-.034-.141-.035-.14-.035-.137-.037-.136-.037-.134-.038-.132-.038-.13-.04-.128-.04-.126-.041-.124-.042-.122-.042-.12-.044-.117-.043-.116-.045-.113-.045-.112-.046-.109-.047-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.05-.093-.052-.09-.051-.087-.052-.085-.053-.083-.054-.08-.054-.077-.054v4.127zm0-5.654v.011l.001.021.003.021.004.021.005.022.006.022.007.022.009.022.01.022.011.023.012.023.013.023.015.024.016.023.017.024.018.024.019.024.021.024.022.024.023.025.024.024.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.052.11.051.114.051.119.052.123.05.127.051.131.05.135.049.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.044.171.042.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.022.23.02.233.018.236.016.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.012.241-.015.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.048.139-.05.136-.049.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.051.051-.049.023-.025.023-.024.021-.025.02-.024.019-.024.018-.024.017-.024.015-.023.014-.023.013-.024.012-.022.01-.023.01-.023.008-.022.006-.022.006-.022.004-.021.004-.022.001-.021.001-.021v-4.139l-.077.054-.08.054-.083.054-.085.052-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.044-.118.044-.12.044-.122.042-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.035-.143.033-.144.033-.147.033-.148.031-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.009-.179.009-.179.007-.181.007-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.007-.179-.007-.179-.009-.178-.009-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.031-.146-.033-.145-.033-.143-.033-.141-.035-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.04-.126-.041-.124-.042-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.051-.093-.051-.09-.051-.087-.053-.085-.052-.083-.054-.08-.054-.077-.054v4.139zm0-5.666v.011l.001.02.003.022.004.021.005.022.006.021.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.024.018.023.019.024.021.025.022.024.023.024.024.025.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.051.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.043.171.043.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.021.23.02.233.018.236.017.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.013.241-.014.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.049.139-.049.136-.049.131-.051.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.049.023-.025.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.022.01-.023.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.153l-.077.054-.08.054-.083.053-.085.053-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.048-.105.048-.106.048-.109.046-.111.046-.114.046-.115.044-.118.044-.12.043-.122.043-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.034-.143.034-.144.033-.147.032-.148.032-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.024-.161.024-.162.023-.163.023-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.01-.178.01-.179.009-.179.007-.181.006-.182.006-.182.004-.184.003-.184.001-.185.001-.185-.001-.184-.001-.184-.003-.182-.004-.182-.006-.181-.006-.179-.007-.179-.009-.178-.01-.176-.01-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.023-.162-.023-.161-.024-.159-.024-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.032-.146-.032-.145-.033-.143-.034-.141-.034-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.041-.126-.041-.124-.041-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.048-.105-.048-.102-.048-.1-.05-.097-.049-.095-.051-.093-.051-.09-.052-.087-.052-.085-.053-.083-.053-.08-.054-.077-.054v4.153zm8.74-8.179l-.257.004-.254.005-.25.008-.247.011-.244.012-.241.014-.237.016-.233.018-.231.021-.226.022-.224.023-.22.026-.216.027-.212.028-.21.031-.205.032-.202.033-.198.034-.194.036-.191.038-.187.038-.183.04-.179.041-.175.042-.172.043-.168.043-.163.045-.16.046-.155.046-.152.048-.148.048-.143.048-.139.049-.136.05-.131.05-.126.051-.123.051-.118.051-.114.052-.11.052-.106.052-.101.052-.096.052-.092.052-.088.052-.083.052-.079.052-.074.051-.07.052-.065.051-.06.05-.056.05-.051.05-.023.025-.023.024-.021.024-.02.025-.019.024-.018.024-.017.023-.015.024-.014.023-.013.023-.012.023-.01.023-.01.022-.008.022-.006.023-.006.021-.004.022-.004.021-.001.021-.001.021.001.021.001.021.004.021.004.022.006.021.006.023.008.022.01.022.01.023.012.023.013.023.014.023.015.024.017.023.018.024.019.024.02.025.021.024.023.024.023.025.051.05.056.05.06.05.065.051.07.052.074.051.079.052.083.052.088.052.092.052.096.052.101.052.106.052.11.052.114.052.118.051.123.051.126.051.131.05.136.05.139.049.143.048.148.048.152.048.155.046.16.046.163.045.168.043.172.043.175.042.179.041.183.04.187.038.191.038.194.036.198.034.202.033.205.032.21.031.212.028.216.027.22.026.224.023.226.022.231.021.233.018.237.016.241.014.244.012.247.011.25.008.254.005.257.004.26.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.022.224-.023.22-.026.216-.027.212-.028.21-.031.205-.032.202-.033.198-.034.194-.036.191-.038.187-.038.183-.04.179-.041.175-.042.172-.043.168-.043.163-.045.16-.046.155-.046.152-.048.148-.048.143-.048.139-.049.136-.05.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.05.051-.05.023-.025.023-.024.021-.024.02-.025.019-.024.018-.024.017-.023.015-.024.014-.023.013-.023.012-.023.01-.023.01-.022.008-.022.006-.023.006-.021.004-.022.004-.021.001-.021.001-.021-.001-.021-.001-.021-.004-.021-.004-.022-.006-.021-.006-.023-.008-.022-.01-.022-.01-.023-.012-.023-.013-.023-.014-.023-.015-.024-.017-.023-.018-.024-.019-.024-.02-.025-.021-.024-.023-.024-.023-.025-.051-.05-.056-.05-.06-.05-.065-.051-.07-.052-.074-.051-.079-.052-.083-.052-.088-.052-.092-.052-.096-.052-.101-.052-.106-.052-.11-.052-.114-.052-.118-.051-.123-.051-.126-.051-.131-.05-.136-.05-.139-.049-.143-.048-.148-.048-.152-.048-.155-.046-.16-.046-.163-.045-.168-.043-.172-.043-.175-.042-.179-.041-.183-.04-.187-.038-.191-.038-.194-.036-.198-.034-.202-.033-.205-.032-.21-.031-.212-.028-.216-.027-.22-.026-.224-.023-.226-.022-.231-.021-.233-.018-.237-.016-.241-.014-.244-.012-.247-.011-.25-.008-.254-.005-.257-.004-.26-.001-.26.001z")},"insertDatabaseIcon"),M4e=x(function(t){t.append("defs").append("symbol").attr("id","computer").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M2 2v13h20v-13h-20zm18 11h-16v-9h16v9zm-10.228 6l.466-1h3.524l.467 1h-4.457zm14.228 3h-24l2-6h2.104l-1.33 4h18.45l-1.297-4h2.073l2 6zm-5-10h-14v-7h14v7z")},"insertComputerIcon"),I4e=x(function(t){t.append("defs").append("symbol").attr("id","clock").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M12 2c5.514 0 10 4.486 10 10s-4.486 10-10 10-10-4.486-10-10 4.486-10 10-10zm0-2c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm5.848 12.459c.202.038.202.333.001.372-1.907.361-6.045 1.111-6.547 1.111-.719 0-1.301-.582-1.301-1.301 0-.512.77-5.447 1.125-7.445.034-.192.312-.181.343.014l.985 6.238 5.394 1.011z")},"insertClockIcon"),O4e=x(function(t){t.append("defs").append("marker").attr("id","arrowhead").attr("refX",9).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z")},"insertArrowHead"),P4e=x(function(t){t.append("defs").append("marker").attr("id","arrowend").attr("refX",1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 10 0 L 0 5 L 10 10 z")},"insertArrowEnd"),B4e=x(function(t){t.append("defs").append("marker").attr("id","filled-head").attr("refX",18).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")},"insertArrowFilledHead"),F4e=x(function(t){t.append("defs").append("marker").attr("id","sequencenumber").attr("refX",15).attr("refY",15).attr("markerWidth",60).attr("markerHeight",40).attr("orient","auto").append("circle").attr("cx",15).attr("cy",15).attr("r",6)},"insertDynamicNumber"),$4e=x(function(t){const r=t.append("defs").append("marker").attr("id","crosshead").attr("markerWidth",15).attr("markerHeight",8).attr("orient","auto").attr("refX",16).attr("refY",4);r.append("path").attr("fill","black").attr("stroke","#000000").style("stroke-dasharray","0, 0").attr("stroke-width","1px").attr("d","M 9,2 V 6 L16,4 Z"),r.append("path").attr("fill","none").attr("stroke","#000000").style("stroke-dasharray","0, 0").attr("stroke-width","1px").attr("d","M 0,1 L 6,7 M 6,1 L 0,7")},"insertArrowCrossHead"),z4e=x((t,e)=>({fontFamily:t[e+"FontFamily"],fontSize:t[e+"FontSize"],fontWeight:t[e+"FontWeight"]}),"getC4ShapeFont"),Io=function(){function t(i,a,s,o,l,u,h){const d=a.append("text").attr("x",s+l/2).attr("y",o+u/2+5).style("text-anchor","middle").text(i);n(d,h)}x(t,"byText");function e(i,a,s,o,l,u,h,d){const{fontSize:f,fontFamily:p,fontWeight:g}=d,m=i.split(at.lineBreakRegex);for(let v=0;v<m.length;v++){const y=v*f-f*(m.length-1)/2,b=a.append("text").attr("x",s+l/2).attr("y",o).style("text-anchor","middle").attr("dominant-baseline","middle").style("font-size",f).style("font-weight",g).style("font-family",p);b.append("tspan").attr("dy",y).text(m[v]).attr("alignment-baseline","mathematical"),n(b,h)}}x(e,"byTspan");function r(i,a,s,o,l,u,h,d){const f=a.append("switch"),g=f.append("foreignObject").attr("x",s).attr("y",o).attr("width",l).attr("height",u).append("xhtml:div").style("display","table").style("height","100%").style("width","100%");g.append("div").style("display","table-cell").style("text-align","center").style("vertical-align","middle").text(i),e(i,f,s,o,l,u,h,d),n(g,h)}x(r,"byFo");function n(i,a){for(const s in a)a.hasOwnProperty(s)&&i.attr(s,a[s])}return x(n,"_setTextAttrs"),function(i){return i.textPlacement==="fo"?r:i.textPlacement==="old"?t:e}}(),Fs={drawRect:mk,drawBoundary:R4e,drawC4Shape:N4e,drawRels:L4e,drawImage:sG,insertArrowHead:O4e,insertArrowEnd:P4e,insertArrowFilledHead:B4e,insertDynamicNumber:F4e,insertArrowCrossHead:$4e,insertDatabaseIcon:D4e,insertComputerIcon:M4e,insertClockIcon:I4e},Xv=0,jv=0,oG=4,kw=2;Hv.yy=Ew;var Mt={},lG=class{static{x(this,"Bounds")}constructor(t){this.name="",this.data={},this.data.startx=void 0,this.data.stopx=void 0,this.data.starty=void 0,this.data.stopy=void 0,this.data.widthLimit=void 0,this.nextData={},this.nextData.startx=void 0,this.nextData.stopx=void 0,this.nextData.starty=void 0,this.nextData.stopy=void 0,this.nextData.cnt=0,Sw(t.db.getConfig())}setData(t,e,r,n){this.nextData.startx=this.data.startx=t,this.nextData.stopx=this.data.stopx=e,this.nextData.starty=this.data.starty=r,this.nextData.stopy=this.data.stopy=n}updateVal(t,e,r,n){t[e]===void 0?t[e]=r:t[e]=n(r,t[e])}insert(t){this.nextData.cnt=this.nextData.cnt+1;let e=this.nextData.startx===this.nextData.stopx?this.nextData.stopx+t.margin:this.nextData.stopx+t.margin*2,r=e+t.width,n=this.nextData.starty+t.margin*2,i=n+t.height;(e>=this.data.widthLimit||r>=this.data.widthLimit||this.nextData.cnt>oG)&&(e=this.nextData.startx+t.margin+Mt.nextLinePaddingX,n=this.nextData.stopy+t.margin*2,this.nextData.stopx=r=e+t.width,this.nextData.starty=this.nextData.stopy,this.nextData.stopy=i=n+t.height,this.nextData.cnt=1),t.x=e,t.y=n,this.updateVal(this.data,"startx",e,Math.min),this.updateVal(this.data,"starty",n,Math.min),this.updateVal(this.data,"stopx",r,Math.max),this.updateVal(this.data,"stopy",i,Math.max),this.updateVal(this.nextData,"startx",e,Math.min),this.updateVal(this.nextData,"starty",n,Math.min),this.updateVal(this.nextData,"stopx",r,Math.max),this.updateVal(this.nextData,"stopy",i,Math.max)}init(t){this.name="",this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0,widthLimit:void 0},this.nextData={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0,cnt:0},Sw(t.db.getConfig())}bumpLastMargin(t){this.data.stopx+=t,this.data.stopy+=t}},Sw=x(function(t){mn(Mt,t),t.fontFamily&&(Mt.personFontFamily=Mt.systemFontFamily=Mt.messageFontFamily=t.fontFamily),t.fontSize&&(Mt.personFontSize=Mt.systemFontSize=Mt.messageFontSize=t.fontSize),t.fontWeight&&(Mt.personFontWeight=Mt.systemFontWeight=Mt.messageFontWeight=t.fontWeight)},"setConf"),hf=x((t,e)=>({fontFamily:t[e+"FontFamily"],fontSize:t[e+"FontSize"],fontWeight:t[e+"FontWeight"]}),"c4ShapeFont"),um=x(t=>({fontFamily:t.boundaryFontFamily,fontSize:t.boundaryFontSize,fontWeight:t.boundaryFontWeight}),"boundaryFont"),V4e=x(t=>({fontFamily:t.messageFontFamily,fontSize:t.messageFontSize,fontWeight:t.messageFontWeight}),"messageFont");function ja(t,e,r,n,i){if(!e[t].width)if(r)e[t].text=nO(e[t].text,i,n),e[t].textLines=e[t].text.split(at.lineBreakRegex).length,e[t].width=i,e[t].height=dv(e[t].text,n);else{let a=e[t].text.split(at.lineBreakRegex);e[t].textLines=a.length;let s=0;e[t].height=0,e[t].width=0;for(const o of a)e[t].width=Math.max(Vi(o,n),e[t].width),s=dv(o,n),e[t].height=e[t].height+s}}x(ja,"calcC4ShapeTextWH");var cG=x(function(t,e,r){e.x=r.data.startx,e.y=r.data.starty,e.width=r.data.stopx-r.data.startx,e.height=r.data.stopy-r.data.starty,e.label.y=Mt.c4ShapeMargin-35;let n=e.wrap&&Mt.wrap,i=um(Mt);i.fontSize=i.fontSize+2,i.fontWeight="bold";let a=Vi(e.label.text,i);ja("label",e,n,i,a),Fs.drawBoundary(t,e,Mt)},"drawBoundary"),uG=x(function(t,e,r,n){let i=0;for(const a of n){i=0;const s=r[a];let o=hf(Mt,s.typeC4Shape.text);switch(o.fontSize=o.fontSize-2,s.typeC4Shape.width=Vi("«"+s.typeC4Shape.text+"»",o),s.typeC4Shape.height=o.fontSize+2,s.typeC4Shape.Y=Mt.c4ShapePadding,i=s.typeC4Shape.Y+s.typeC4Shape.height-4,s.image={width:0,height:0,Y:0},s.typeC4Shape.text){case"person":case"external_person":s.image.width=48,s.image.height=48,s.image.Y=i,i=s.image.Y+s.image.height;break}s.sprite&&(s.image.width=48,s.image.height=48,s.image.Y=i,i=s.image.Y+s.image.height);let l=s.wrap&&Mt.wrap,u=Mt.width-Mt.c4ShapePadding*2,h=hf(Mt,s.typeC4Shape.text);if(h.fontSize=h.fontSize+2,h.fontWeight="bold",ja("label",s,l,h,u),s.label.Y=i+8,i=s.label.Y+s.label.height,s.type&&s.type.text!==""){s.type.text="["+s.type.text+"]";let p=hf(Mt,s.typeC4Shape.text);ja("type",s,l,p,u),s.type.Y=i+5,i=s.type.Y+s.type.height}else if(s.techn&&s.techn.text!==""){s.techn.text="["+s.techn.text+"]";let p=hf(Mt,s.techn.text);ja("techn",s,l,p,u),s.techn.Y=i+5,i=s.techn.Y+s.techn.height}let d=i,f=s.label.width;if(s.descr&&s.descr.text!==""){let p=hf(Mt,s.typeC4Shape.text);ja("descr",s,l,p,u),s.descr.Y=i+20,i=s.descr.Y+s.descr.height,f=Math.max(s.label.width,s.descr.width),d=i-s.descr.textLines*5}f=f+Mt.c4ShapePadding,s.width=Math.max(s.width||Mt.width,f,Mt.width),s.height=Math.max(s.height||Mt.height,d,Mt.height),s.margin=s.margin||Mt.c4ShapeMargin,t.insert(s),Fs.drawC4Shape(e,s,Mt)}t.bumpLastMargin(Mt.c4ShapeMargin)},"drawC4ShapeArray"),Fa=class{static{x(this,"Point")}constructor(e,r){this.x=e,this.y=r}},u9=x(function(t,e){let r=t.x,n=t.y,i=e.x,a=e.y,s=r+t.width/2,o=n+t.height/2,l=Math.abs(r-i),u=Math.abs(n-a),h=u/l,d=t.height/t.width,f=null;return n==a&&r<i?f=new Fa(r+t.width,o):n==a&&r>i?f=new Fa(r,o):r==i&&n<a?f=new Fa(s,n+t.height):r==i&&n>a&&(f=new Fa(s,n)),r>i&&n<a?d>=h?f=new Fa(r,o+h*t.width/2):f=new Fa(s-l/u*t.height/2,n+t.height):r<i&&n<a?d>=h?f=new Fa(r+t.width,o+h*t.width/2):f=new Fa(s+l/u*t.height/2,n+t.height):r<i&&n>a?d>=h?f=new Fa(r+t.width,o-h*t.width/2):f=new Fa(s+t.height/2*l/u,n):r>i&&n>a&&(d>=h?f=new Fa(r,o-t.width/2*h):f=new Fa(s-t.height/2*l/u,n)),f},"getIntersectPoint"),G4e=x(function(t,e){let r={x:0,y:0};r.x=e.x+e.width/2,r.y=e.y+e.height/2;let n=u9(t,r);r.x=t.x+t.width/2,r.y=t.y+t.height/2;let i=u9(e,r);return{startPoint:n,endPoint:i}},"getIntersectPoints"),U4e=x(function(t,e,r,n){let i=0;for(let a of e){i=i+1;let s=a.wrap&&Mt.wrap,o=V4e(Mt);n.db.getC4Type()==="C4Dynamic"&&(a.label.text=i+": "+a.label.text);let u=Vi(a.label.text,o);ja("label",a,s,o,u),a.techn&&a.techn.text!==""&&(u=Vi(a.techn.text,o),ja("techn",a,s,o,u)),a.descr&&a.descr.text!==""&&(u=Vi(a.descr.text,o),ja("descr",a,s,o,u));let h=r(a.from),d=r(a.to),f=G4e(h,d);a.startPoint=f.startPoint,a.endPoint=f.endPoint}Fs.drawRels(t,e,Mt)},"drawRels");function vk(t,e,r,n,i){let a=new lG(i);a.data.widthLimit=r.data.widthLimit/Math.min(kw,n.length);for(let[s,o]of n.entries()){let l=0;o.image={width:0,height:0,Y:0},o.sprite&&(o.image.width=48,o.image.height=48,o.image.Y=l,l=o.image.Y+o.image.height);let u=o.wrap&&Mt.wrap,h=um(Mt);if(h.fontSize=h.fontSize+2,h.fontWeight="bold",ja("label",o,u,h,a.data.widthLimit),o.label.Y=l+8,l=o.label.Y+o.label.height,o.type&&o.type.text!==""){o.type.text="["+o.type.text+"]";let g=um(Mt);ja("type",o,u,g,a.data.widthLimit),o.type.Y=l+5,l=o.type.Y+o.type.height}if(o.descr&&o.descr.text!==""){let g=um(Mt);g.fontSize=g.fontSize-2,ja("descr",o,u,g,a.data.widthLimit),o.descr.Y=l+20,l=o.descr.Y+o.descr.height}if(s==0||s%kw===0){let g=r.data.startx+Mt.diagramMarginX,m=r.data.stopy+Mt.diagramMarginY+l;a.setData(g,g,m,m)}else{let g=a.data.stopx!==a.data.startx?a.data.stopx+Mt.diagramMarginX:a.data.startx,m=a.data.starty;a.setData(g,g,m,m)}a.name=o.alias;let d=i.db.getC4ShapeArray(o.alias),f=i.db.getC4ShapeKeys(o.alias);f.length>0&&uG(a,t,d,f),e=o.alias;let p=i.db.getBoundaries(e);p.length>0&&vk(t,e,a,p,i),o.alias!=="global"&&cG(t,o,a),r.data.stopy=Math.max(a.data.stopy+Mt.c4ShapeMargin,r.data.stopy),r.data.stopx=Math.max(a.data.stopx+Mt.c4ShapeMargin,r.data.stopx),Xv=Math.max(Xv,r.data.stopx),jv=Math.max(jv,r.data.stopy)}}x(vk,"drawInsideBoundary");var W4e=x(function(t,e,r,n){Mt=we().c4;const i=we().securityLevel;let a;i==="sandbox"&&(a=Qe("#i"+e));const s=Qe(i==="sandbox"?a.nodes()[0].contentDocument.body:"body");let o=n.db;n.db.setWrap(Mt.wrap),oG=o.getC4ShapeInRow(),kw=o.getC4BoundaryInRow(),ie.debug(`C:${JSON.stringify(Mt,null,2)}`);const l=i==="sandbox"?s.select(`[id="${e}"]`):Qe(`[id="${e}"]`);Fs.insertComputerIcon(l),Fs.insertDatabaseIcon(l),Fs.insertClockIcon(l);let u=new lG(n);u.setData(Mt.diagramMarginX,Mt.diagramMarginX,Mt.diagramMarginY,Mt.diagramMarginY),u.data.widthLimit=screen.availWidth,Xv=Mt.diagramMarginX,jv=Mt.diagramMarginY;const h=n.db.getTitle();let d=n.db.getBoundaries("");vk(l,"",u,d,n),Fs.insertArrowHead(l),Fs.insertArrowEnd(l),Fs.insertArrowCrossHead(l),Fs.insertArrowFilledHead(l),U4e(l,n.db.getRels(),n.db.getC4Shape,n),u.data.stopx=Xv,u.data.stopy=jv;const f=u.data;let g=f.stopy-f.starty+2*Mt.diagramMarginY;const v=f.stopx-f.startx+2*Mt.diagramMarginX;h&&l.append("text").text(h).attr("x",(f.stopx-f.startx)/2-4*Mt.diagramMarginX).attr("y",f.starty+Mt.diagramMarginY),ji(l,g,v,Mt.useMaxWidth);const y=h?60:0;l.attr("viewBox",f.startx-Mt.diagramMarginX+" -"+(Mt.diagramMarginY+y)+" "+v+" "+(g+y)),ie.debug("models:",f)},"draw"),h9={drawPersonOrSystemArray:uG,drawBoundary:cG,setConf:Sw,draw:W4e},H4e=x(t=>`.person {
    stroke: ${t.personBorder};
    fill: ${t.personBkg};
  }
`,"getStyles"),q4e=H4e,Y4e={parser:e4e,db:Ew,renderer:h9,styles:q4e,init:x(({c4:t,wrap:e})=>{h9.setConf(t),Ew.setWrap(e)},"init")};const X4e=Object.freeze(Object.defineProperty({__proto__:null,diagram:Y4e},Symbol.toStringTag,{value:"Module"}));var og=x(()=>`
  /* Font Awesome icon styling - consolidated */
  .label-icon {
    display: inline-block;
    height: 1em;
    overflow: visible;
    vertical-align: -0.125em;
  }
  
  .node .label-icon path {
    fill: currentColor;
    stroke: revert;
    stroke-width: revert;
  }
`,"getIconStyles"),Pd=x((t,e)=>{let r;return e==="sandbox"&&(r=Qe("#i"+t)),Qe(e==="sandbox"?r.nodes()[0].contentDocument.body:"body").select(`[id="${t}"]`)},"getDiagramElement"),Bu=x((t,e,r,n)=>{t.attr("class",r);const{width:i,height:a,x:s,y:o}=j4e(t,e);ji(t,a,i,n);const l=K4e(s,o,i,a,e);t.attr("viewBox",l),ie.debug(`viewBox configured: ${l} with padding: ${e}`)},"setupViewPortForSVG"),j4e=x((t,e)=>{const r=t.node()?.getBBox()||{width:0,height:0,x:0,y:0};return{width:r.width+e*2,height:r.height+e*2,x:r.x,y:r.y}},"calculateDimensionsWithPadding"),K4e=x((t,e,r,n,i)=>`${t-i} ${e-i} ${r} ${n}`,"createViewBox"),Z4e="flowchart-",Q4e=class{constructor(){this.vertexCounter=0,this.config=we(),this.vertices=new Map,this.edges=[],this.classes=new Map,this.subGraphs=[],this.subGraphLookup=new Map,this.tooltips=new Map,this.subCount=0,this.firstGraphFlag=!0,this.secCount=-1,this.posCrossRef=[],this.funs=[],this.setAccTitle=Sn,this.setAccDescription=Vn,this.setDiagramTitle=Zn,this.getAccTitle=zn,this.getAccDescription=Gn,this.getDiagramTitle=_n,this.funs.push(this.setupToolTips.bind(this)),this.addVertex=this.addVertex.bind(this),this.firstGraph=this.firstGraph.bind(this),this.setDirection=this.setDirection.bind(this),this.addSubGraph=this.addSubGraph.bind(this),this.addLink=this.addLink.bind(this),this.setLink=this.setLink.bind(this),this.updateLink=this.updateLink.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.destructLink=this.destructLink.bind(this),this.setClickEvent=this.setClickEvent.bind(this),this.setTooltip=this.setTooltip.bind(this),this.updateLinkInterpolate=this.updateLinkInterpolate.bind(this),this.setClickFun=this.setClickFun.bind(this),this.bindFunctions=this.bindFunctions.bind(this),this.lex={firstGraph:this.firstGraph.bind(this)},this.clear(),this.setGen("gen-2")}static{x(this,"FlowDB")}sanitizeText(t){return at.sanitizeText(t,this.config)}lookUpDomId(t){for(const e of this.vertices.values())if(e.id===t)return e.domId;return t}addVertex(t,e,r,n,i,a,s={},o){if(!t||t.trim().length===0)return;let l;if(o!==void 0){let f;o.includes(`
`)?f=o+`
`:f=`{
`+o+`
}`,l=Ky(f,{schema:jy})}const u=this.edges.find(f=>f.id===t);if(u){const f=l;f?.animate!==void 0&&(u.animate=f.animate),f?.animation!==void 0&&(u.animation=f.animation),f?.curve!==void 0&&(u.interpolate=f.curve);return}let h,d=this.vertices.get(t);if(d===void 0&&(d={id:t,labelType:"text",domId:Z4e+t+"-"+this.vertexCounter,styles:[],classes:[]},this.vertices.set(t,d)),this.vertexCounter++,e!==void 0?(this.config=we(),h=this.sanitizeText(e.text.trim()),d.labelType=e.type,h.startsWith('"')&&h.endsWith('"')&&(h=h.substring(1,h.length-1)),d.text=h):d.text===void 0&&(d.text=t),r!==void 0&&(d.type=r),n?.forEach(f=>{d.styles.push(f)}),i?.forEach(f=>{d.classes.push(f)}),a!==void 0&&(d.dir=a),d.props===void 0?d.props=s:s!==void 0&&Object.assign(d.props,s),l!==void 0){if(l.shape){if(l.shape!==l.shape.toLowerCase()||l.shape.includes("_"))throw new Error(`No such shape: ${l.shape}. Shape names should be lowercase.`);if(!aB(l.shape))throw new Error(`No such shape: ${l.shape}.`);d.type=l?.shape}l?.label&&(d.text=l?.label),l?.icon&&(d.icon=l?.icon,!l.label?.trim()&&d.text===t&&(d.text="")),l?.form&&(d.form=l?.form),l?.pos&&(d.pos=l?.pos),l?.img&&(d.img=l?.img,!l.label?.trim()&&d.text===t&&(d.text="")),l?.constraint&&(d.constraint=l.constraint),l.w&&(d.assetWidth=Number(l.w)),l.h&&(d.assetHeight=Number(l.h))}}addSingleLink(t,e,r,n){const s={start:t,end:e,type:void 0,text:"",labelType:"text",classes:[],isUserDefinedId:!1,interpolate:this.edges.defaultInterpolate};ie.info("abc78 Got edge...",s);const o=r.text;if(o!==void 0&&(s.text=this.sanitizeText(o.text.trim()),s.text.startsWith('"')&&s.text.endsWith('"')&&(s.text=s.text.substring(1,s.text.length-1)),s.labelType=o.type),r!==void 0&&(s.type=r.type,s.stroke=r.stroke,s.length=r.length>10?10:r.length),n&&!this.edges.some(l=>l.id===n))s.id=n,s.isUserDefinedId=!0;else{const l=this.edges.filter(u=>u.start===s.start&&u.end===s.end);l.length===0?s.id=_h(s.start,s.end,{counter:0,prefix:"L"}):s.id=_h(s.start,s.end,{counter:l.length+1,prefix:"L"})}if(this.edges.length<(this.config.maxEdges??500))ie.info("Pushing edge..."),this.edges.push(s);else throw new Error(`Edge limit exceeded. ${this.edges.length} edges found, but the limit is ${this.config.maxEdges}.

Initialize mermaid with maxEdges set to a higher number to allow more edges.
You cannot set this config via configuration inside the diagram as it is a secure config.
You have to call mermaid.initialize.`)}isLinkData(t){return t!==null&&typeof t=="object"&&"id"in t&&typeof t.id=="string"}addLink(t,e,r){const n=this.isLinkData(r)?r.id.replace("@",""):void 0;ie.info("addLink",t,e,n);for(const i of t)for(const a of e){const s=i===t[t.length-1],o=a===e[0];s&&o?this.addSingleLink(i,a,r,n):this.addSingleLink(i,a,r,void 0)}}updateLinkInterpolate(t,e){t.forEach(r=>{r==="default"?this.edges.defaultInterpolate=e:this.edges[r].interpolate=e})}updateLink(t,e){t.forEach(r=>{if(typeof r=="number"&&r>=this.edges.length)throw new Error(`The index ${r} for linkStyle is out of bounds. Valid indices for linkStyle are between 0 and ${this.edges.length-1}. (Help: Ensure that the index is within the range of existing edges.)`);r==="default"?this.edges.defaultStyle=e:(this.edges[r].style=e,(this.edges[r]?.style?.length??0)>0&&!this.edges[r]?.style?.some(n=>n?.startsWith("fill"))&&this.edges[r]?.style?.push("fill:none"))})}addClass(t,e){const r=e.join().replace(/\\,/g,"§§§").replace(/,/g,";").replace(/§§§/g,",").split(";");t.split(",").forEach(n=>{let i=this.classes.get(n);i===void 0&&(i={id:n,styles:[],textStyles:[]},this.classes.set(n,i)),r?.forEach(a=>{if(/color/.exec(a)){const s=a.replace("fill","bgFill");i.textStyles.push(s)}i.styles.push(a)})})}setDirection(t){this.direction=t.trim(),/.*</.exec(this.direction)&&(this.direction="RL"),/.*\^/.exec(this.direction)&&(this.direction="BT"),/.*>/.exec(this.direction)&&(this.direction="LR"),/.*v/.exec(this.direction)&&(this.direction="TB"),this.direction==="TD"&&(this.direction="TB")}setClass(t,e){for(const r of t.split(",")){const n=this.vertices.get(r);n&&n.classes.push(e);const i=this.edges.find(s=>s.id===r);i&&i.classes.push(e);const a=this.subGraphLookup.get(r);a&&a.classes.push(e)}}setTooltip(t,e){if(e!==void 0){e=this.sanitizeText(e);for(const r of t.split(","))this.tooltips.set(this.version==="gen-1"?this.lookUpDomId(r):r,e)}}setClickFun(t,e,r){const n=this.lookUpDomId(t);if(we().securityLevel!=="loose"||e===void 0)return;let i=[];if(typeof r=="string"){i=r.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let s=0;s<i.length;s++){let o=i[s].trim();o.startsWith('"')&&o.endsWith('"')&&(o=o.substr(1,o.length-2)),i[s]=o}}i.length===0&&i.push(t);const a=this.vertices.get(t);a&&(a.haveCallback=!0,this.funs.push(()=>{const s=document.querySelector(`[id="${n}"]`);s!==null&&s.addEventListener("click",()=>{Kt.runFunc(e,...i)},!1)}))}setLink(t,e,r){t.split(",").forEach(n=>{const i=this.vertices.get(n);i!==void 0&&(i.link=Kt.formatUrl(e,this.config),i.linkTarget=r)}),this.setClass(t,"clickable")}getTooltip(t){return this.tooltips.get(t)}setClickEvent(t,e,r){t.split(",").forEach(n=>{this.setClickFun(n,e,r)}),this.setClass(t,"clickable")}bindFunctions(t){this.funs.forEach(e=>{e(t)})}getDirection(){return this.direction?.trim()}getVertices(){return this.vertices}getEdges(){return this.edges}getClasses(){return this.classes}setupToolTips(t){let e=Qe(".mermaidTooltip");(e._groups||e)[0][0]===null&&(e=Qe("body").append("div").attr("class","mermaidTooltip").style("opacity",0)),Qe(t).select("svg").selectAll("g.node").on("mouseover",i=>{const a=Qe(i.currentTarget);if(a.attr("title")===null)return;const o=i.currentTarget?.getBoundingClientRect();e.transition().duration(200).style("opacity",".9"),e.text(a.attr("title")).style("left",window.scrollX+o.left+(o.right-o.left)/2+"px").style("top",window.scrollY+o.bottom+"px"),e.html(e.html().replace(/&lt;br\/&gt;/g,"<br/>")),a.classed("hover",!0)}).on("mouseout",i=>{e.transition().duration(500).style("opacity",0),Qe(i.currentTarget).classed("hover",!1)})}clear(t="gen-2"){this.vertices=new Map,this.classes=new Map,this.edges=[],this.funs=[this.setupToolTips.bind(this)],this.subGraphs=[],this.subGraphLookup=new Map,this.subCount=0,this.tooltips=new Map,this.firstGraphFlag=!0,this.version=t,this.config=we(),An()}setGen(t){this.version=t||"gen-2"}defaultStyle(){return"fill:#ffa;stroke: #f66; stroke-width: 3px; stroke-dasharray: 5, 5;fill:#ffa;stroke: #666;"}addSubGraph(t,e,r){let n=t.text.trim(),i=r.text;t===r&&/\s/.exec(r.text)&&(n=void 0);const s=x(d=>{const f={boolean:{},number:{},string:{}},p=[];let g;return{nodeList:d.filter(function(v){const y=typeof v;return v.stmt&&v.stmt==="dir"?(g=v.value,!1):v.trim()===""?!1:y in f?f[y].hasOwnProperty(v)?!1:f[y][v]=!0:p.includes(v)?!1:p.push(v)}),dir:g}},"uniq")(e.flat()),o=s.nodeList;let l=s.dir;const u=we().flowchart??{};if(l=l??(u.inheritDir?this.getDirection()??we().direction??void 0:void 0),this.version==="gen-1")for(let d=0;d<o.length;d++)o[d]=this.lookUpDomId(o[d]);n=n??"subGraph"+this.subCount,i=i||"",i=this.sanitizeText(i),this.subCount=this.subCount+1;const h={id:n,nodes:o,title:i.trim(),classes:[],dir:l,labelType:r.type};return ie.info("Adding",h.id,h.nodes,h.dir),h.nodes=this.makeUniq(h,this.subGraphs).nodes,this.subGraphs.push(h),this.subGraphLookup.set(n,h),n}getPosForId(t){for(const[e,r]of this.subGraphs.entries())if(r.id===t)return e;return-1}indexNodes2(t,e){const r=this.subGraphs[e].nodes;if(this.secCount=this.secCount+1,this.secCount>2e3)return{result:!1,count:0};if(this.posCrossRef[this.secCount]=e,this.subGraphs[e].id===t)return{result:!0,count:0};let n=0,i=1;for(;n<r.length;){const a=this.getPosForId(r[n]);if(a>=0){const s=this.indexNodes2(t,a);if(s.result)return{result:!0,count:i+s.count};i=i+s.count}n=n+1}return{result:!1,count:i}}getDepthFirstPos(t){return this.posCrossRef[t]}indexNodes(){this.secCount=-1,this.subGraphs.length>0&&this.indexNodes2("none",this.subGraphs.length-1)}getSubGraphs(){return this.subGraphs}firstGraph(){return this.firstGraphFlag?(this.firstGraphFlag=!1,!0):!1}destructStartLink(t){let e=t.trim(),r="arrow_open";switch(e[0]){case"<":r="arrow_point",e=e.slice(1);break;case"x":r="arrow_cross",e=e.slice(1);break;case"o":r="arrow_circle",e=e.slice(1);break}let n="normal";return e.includes("=")&&(n="thick"),e.includes(".")&&(n="dotted"),{type:r,stroke:n}}countChar(t,e){const r=e.length;let n=0;for(let i=0;i<r;++i)e[i]===t&&++n;return n}destructEndLink(t){const e=t.trim();let r=e.slice(0,-1),n="arrow_open";switch(e.slice(-1)){case"x":n="arrow_cross",e.startsWith("x")&&(n="double_"+n,r=r.slice(1));break;case">":n="arrow_point",e.startsWith("<")&&(n="double_"+n,r=r.slice(1));break;case"o":n="arrow_circle",e.startsWith("o")&&(n="double_"+n,r=r.slice(1));break}let i="normal",a=r.length-1;r.startsWith("=")&&(i="thick"),r.startsWith("~")&&(i="invisible");const s=this.countChar(".",r);return s&&(i="dotted",a=s),{type:n,stroke:i,length:a}}destructLink(t,e){const r=this.destructEndLink(t);let n;if(e){if(n=this.destructStartLink(e),n.stroke!==r.stroke)return{type:"INVALID",stroke:"INVALID"};if(n.type==="arrow_open")n.type=r.type;else{if(n.type!==r.type)return{type:"INVALID",stroke:"INVALID"};n.type="double_"+n.type}return n.type==="double_arrow"&&(n.type="double_arrow_point"),n.length=r.length,n}return r}exists(t,e){for(const r of t)if(r.nodes.includes(e))return!0;return!1}makeUniq(t,e){const r=[];return t.nodes.forEach((n,i)=>{this.exists(e,n)||r.push(t.nodes[i])}),{nodes:r}}getTypeFromVertex(t){if(t.img)return"imageSquare";if(t.icon)return t.form==="circle"?"iconCircle":t.form==="square"?"iconSquare":t.form==="rounded"?"iconRounded":"icon";switch(t.type){case"square":case void 0:return"squareRect";case"round":return"roundedRect";case"ellipse":return"ellipse";default:return t.type}}findNode(t,e){return t.find(r=>r.id===e)}destructEdgeType(t){let e="none",r="arrow_point";switch(t){case"arrow_point":case"arrow_circle":case"arrow_cross":r=t;break;case"double_arrow_point":case"double_arrow_circle":case"double_arrow_cross":e=t.replace("double_",""),r=e;break}return{arrowTypeStart:e,arrowTypeEnd:r}}addNodeFromVertex(t,e,r,n,i,a){const s=r.get(t.id),o=n.get(t.id)??!1,l=this.findNode(e,t.id);if(l)l.cssStyles=t.styles,l.cssCompiledStyles=this.getCompiledStyles(t.classes),l.cssClasses=t.classes.join(" ");else{const u={id:t.id,label:t.text,labelStyle:"",parentId:s,padding:i.flowchart?.padding||8,cssStyles:t.styles,cssCompiledStyles:this.getCompiledStyles(["default","node",...t.classes]),cssClasses:"default "+t.classes.join(" "),dir:t.dir,domId:t.domId,look:a,link:t.link,linkTarget:t.linkTarget,tooltip:this.getTooltip(t.id),icon:t.icon,pos:t.pos,img:t.img,assetWidth:t.assetWidth,assetHeight:t.assetHeight,constraint:t.constraint};o?e.push({...u,isGroup:!0,shape:"rect"}):e.push({...u,isGroup:!1,shape:this.getTypeFromVertex(t)})}}getCompiledStyles(t){let e=[];for(const r of t){const n=this.classes.get(r);n?.styles&&(e=[...e,...n.styles??[]].map(i=>i.trim())),n?.textStyles&&(e=[...e,...n.textStyles??[]].map(i=>i.trim()))}return e}getData(){const t=we(),e=[],r=[],n=this.getSubGraphs(),i=new Map,a=new Map;for(let l=n.length-1;l>=0;l--){const u=n[l];u.nodes.length>0&&a.set(u.id,!0);for(const h of u.nodes)i.set(h,u.id)}for(let l=n.length-1;l>=0;l--){const u=n[l];e.push({id:u.id,label:u.title,labelStyle:"",parentId:i.get(u.id),padding:8,cssCompiledStyles:this.getCompiledStyles(u.classes),cssClasses:u.classes.join(" "),shape:"rect",dir:u.dir,isGroup:!0,look:t.look})}this.getVertices().forEach(l=>{this.addNodeFromVertex(l,e,i,a,t,t.look||"classic")});const o=this.getEdges();return o.forEach((l,u)=>{const{arrowTypeStart:h,arrowTypeEnd:d}=this.destructEdgeType(l.type),f=[...o.defaultStyle??[]];l.style&&f.push(...l.style);const p={id:_h(l.start,l.end,{counter:u,prefix:"L"},l.id),isUserDefinedId:l.isUserDefinedId,start:l.start,end:l.end,type:l.type??"normal",label:l.text,labelpos:"c",thickness:l.stroke,minlen:l.length,classes:l?.stroke==="invisible"?"":"edge-thickness-normal edge-pattern-solid flowchart-link",arrowTypeStart:l?.stroke==="invisible"||l?.type==="arrow_open"?"none":h,arrowTypeEnd:l?.stroke==="invisible"||l?.type==="arrow_open"?"none":d,arrowheadStyle:"fill: #333",cssCompiledStyles:this.getCompiledStyles(l.classes),labelStyle:f,style:f,pattern:l.stroke,look:t.look,animate:l.animate,animation:l.animation,curve:l.interpolate||this.edges.defaultInterpolate||t.flowchart?.curve};r.push(p)}),{nodes:e,edges:r,other:{},config:t}}defaultConfig(){return _N.flowchart}},J4e=x(function(t,e){return e.db.getClasses()},"getClasses"),e3e=x(async function(t,e,r,n){ie.info("REF0:"),ie.info("Drawing state diagram (v2)",e);const{securityLevel:i,flowchart:a,layout:s}=we();let o;i==="sandbox"&&(o=Qe("#i"+e));const l=i==="sandbox"?o.nodes()[0].contentDocument:document;ie.debug("Before getData: ");const u=n.db.getData();ie.debug("Data: ",u);const h=Pd(e,i),d=n.db.getDirection();u.type=n.type,u.layoutAlgorithm=Vp(s),u.layoutAlgorithm==="dagre"&&s==="elk"&&ie.warn("flowchart-elk was moved to an external package in Mermaid v11. Please refer [release notes](https://github.com/mermaid-js/mermaid/releases/tag/v11.0.0) for more details. This diagram will be rendered using `dagre` layout as a fallback."),u.direction=d,u.nodeSpacing=a?.nodeSpacing||50,u.rankSpacing=a?.rankSpacing||50,u.markers=["point","circle","cross"],u.diagramId=e,ie.debug("REF1:",u),await Sd(u,h);const f=u.config.flowchart?.diagramPadding??8;Kt.insertTitle(h,"flowchartTitleText",a?.titleTopMargin||0,n.db.getDiagramTitle()),Bu(h,f,"flowchart",a?.useMaxWidth||!1);for(const p of u.nodes){const g=Qe(`#${e} [id="${p.id}"]`);if(!g||!p.link)continue;const m=l.createElementNS("http://www.w3.org/2000/svg","a");m.setAttributeNS("http://www.w3.org/2000/svg","class",p.cssClasses),m.setAttributeNS("http://www.w3.org/2000/svg","rel","noopener"),i==="sandbox"?m.setAttributeNS("http://www.w3.org/2000/svg","target","_top"):p.linkTarget&&m.setAttributeNS("http://www.w3.org/2000/svg","target",p.linkTarget);const v=g.insert(function(){return m},":first-child"),y=g.select(".label-container");y&&v.append(function(){return y.node()});const b=g.select(".label");b&&v.append(function(){return b.node()})}},"draw"),t3e={getClasses:J4e,draw:e3e},Cw=function(){var t=x(function(bn,pt,Tt,lt){for(Tt=Tt||{},lt=bn.length;lt--;Tt[bn[lt]]=pt);return Tt},"o"),e=[1,4],r=[1,3],n=[1,5],i=[1,8,9,10,11,27,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124],a=[2,2],s=[1,13],o=[1,14],l=[1,15],u=[1,16],h=[1,23],d=[1,25],f=[1,26],p=[1,27],g=[1,49],m=[1,48],v=[1,29],y=[1,30],b=[1,31],w=[1,32],T=[1,33],E=[1,44],L=[1,46],S=[1,42],C=[1,47],A=[1,43],N=[1,50],_=[1,45],O=[1,51],P=[1,52],k=[1,34],R=[1,35],I=[1,36],M=[1,37],D=[1,57],B=[1,8,9,10,11,27,32,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124],$=[1,61],F=[1,60],G=[1,62],W=[8,9,11,75,77,78],J=[1,78],q=[1,91],ne=[1,96],ae=[1,95],pe=[1,92],K=[1,88],Z=[1,94],X=[1,90],Y=[1,97],ee=[1,93],j=[1,98],fe=[1,89],te=[8,9,10,11,40,75,77,78],Ae=[8,9,10,11,40,46,75,77,78],H=[8,9,10,11,29,40,44,46,48,50,52,54,56,58,60,63,65,67,68,70,75,77,78,89,102,105,106,109,111,114,115,116],Oe=[8,9,11,44,60,75,77,78,89,102,105,106,109,111,114,115,116],ue=[44,60,89,102,105,106,109,111,114,115,116],Ve=[1,121],Ge=[1,122],Ue=[1,124],ke=[1,123],Pe=[44,60,62,74,89,102,105,106,109,111,114,115,116],Se=[1,133],_e=[1,147],ze=[1,148],me=[1,149],De=[1,150],Q=[1,135],ce=[1,137],z=[1,141],oe=[1,142],se=[1,143],ge=[1,144],he=[1,145],be=[1,146],Ce=[1,151],Te=[1,152],Ne=[1,131],Xe=[1,132],Ye=[1,139],Ke=[1,134],Ze=[1,138],Be=[1,136],He=[8,9,10,11,27,32,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124],ht=[1,154],st=[1,156],We=[8,9,11],kt=[8,9,10,11,14,44,60,89,105,106,109,111,114,115,116],qe=[1,176],rt=[1,172],ct=[1,173],ut=[1,177],nt=[1,174],bt=[1,175],Zt=[77,116,119],Ot=[8,9,10,11,12,14,27,29,32,44,60,75,84,85,86,87,88,89,90,105,109,111,114,115,116],tr=[10,106],xr=[31,49,51,53,55,57,62,64,66,67,69,71,116,117,118],rr=[1,247],Wt=[1,245],cr=[1,249],an=[1,243],dt=[1,244],Ee=[1,246],Je=[1,248],wt=[1,250],or=[1,268],Ur=[8,9,11,106],ur=[8,9,10,11,60,84,105,106,109,110,111,112],Yr={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,start:3,graphConfig:4,document:5,line:6,statement:7,SEMI:8,NEWLINE:9,SPACE:10,EOF:11,GRAPH:12,NODIR:13,DIR:14,FirstStmtSeparator:15,ending:16,endToken:17,spaceList:18,spaceListNewline:19,vertexStatement:20,separator:21,styleStatement:22,linkStyleStatement:23,classDefStatement:24,classStatement:25,clickStatement:26,subgraph:27,textNoTags:28,SQS:29,text:30,SQE:31,end:32,direction:33,acc_title:34,acc_title_value:35,acc_descr:36,acc_descr_value:37,acc_descr_multiline_value:38,shapeData:39,SHAPE_DATA:40,link:41,node:42,styledVertex:43,AMP:44,vertex:45,STYLE_SEPARATOR:46,idString:47,DOUBLECIRCLESTART:48,DOUBLECIRCLEEND:49,PS:50,PE:51,"(-":52,"-)":53,STADIUMSTART:54,STADIUMEND:55,SUBROUTINESTART:56,SUBROUTINEEND:57,VERTEX_WITH_PROPS_START:58,"NODE_STRING[field]":59,COLON:60,"NODE_STRING[value]":61,PIPE:62,CYLINDERSTART:63,CYLINDEREND:64,DIAMOND_START:65,DIAMOND_STOP:66,TAGEND:67,TRAPSTART:68,TRAPEND:69,INVTRAPSTART:70,INVTRAPEND:71,linkStatement:72,arrowText:73,TESTSTR:74,START_LINK:75,edgeText:76,LINK:77,LINK_ID:78,edgeTextToken:79,STR:80,MD_STR:81,textToken:82,keywords:83,STYLE:84,LINKSTYLE:85,CLASSDEF:86,CLASS:87,CLICK:88,DOWN:89,UP:90,textNoTagsToken:91,stylesOpt:92,"idString[vertex]":93,"idString[class]":94,CALLBACKNAME:95,CALLBACKARGS:96,HREF:97,LINK_TARGET:98,"STR[link]":99,"STR[tooltip]":100,alphaNum:101,DEFAULT:102,numList:103,INTERPOLATE:104,NUM:105,COMMA:106,style:107,styleComponent:108,NODE_STRING:109,UNIT:110,BRKT:111,PCT:112,idStringToken:113,MINUS:114,MULT:115,UNICODE_TEXT:116,TEXT:117,TAGSTART:118,EDGE_TEXT:119,alphaNumToken:120,direction_tb:121,direction_bt:122,direction_rl:123,direction_lr:124,$accept:0,$end:1},terminals_:{2:"error",8:"SEMI",9:"NEWLINE",10:"SPACE",11:"EOF",12:"GRAPH",13:"NODIR",14:"DIR",27:"subgraph",29:"SQS",31:"SQE",32:"end",34:"acc_title",35:"acc_title_value",36:"acc_descr",37:"acc_descr_value",38:"acc_descr_multiline_value",40:"SHAPE_DATA",44:"AMP",46:"STYLE_SEPARATOR",48:"DOUBLECIRCLESTART",49:"DOUBLECIRCLEEND",50:"PS",51:"PE",52:"(-",53:"-)",54:"STADIUMSTART",55:"STADIUMEND",56:"SUBROUTINESTART",57:"SUBROUTINEEND",58:"VERTEX_WITH_PROPS_START",59:"NODE_STRING[field]",60:"COLON",61:"NODE_STRING[value]",62:"PIPE",63:"CYLINDERSTART",64:"CYLINDEREND",65:"DIAMOND_START",66:"DIAMOND_STOP",67:"TAGEND",68:"TRAPSTART",69:"TRAPEND",70:"INVTRAPSTART",71:"INVTRAPEND",74:"TESTSTR",75:"START_LINK",77:"LINK",78:"LINK_ID",80:"STR",81:"MD_STR",84:"STYLE",85:"LINKSTYLE",86:"CLASSDEF",87:"CLASS",88:"CLICK",89:"DOWN",90:"UP",93:"idString[vertex]",94:"idString[class]",95:"CALLBACKNAME",96:"CALLBACKARGS",97:"HREF",98:"LINK_TARGET",99:"STR[link]",100:"STR[tooltip]",102:"DEFAULT",104:"INTERPOLATE",105:"NUM",106:"COMMA",109:"NODE_STRING",110:"UNIT",111:"BRKT",112:"PCT",114:"MINUS",115:"MULT",116:"UNICODE_TEXT",117:"TEXT",118:"TAGSTART",119:"EDGE_TEXT",121:"direction_tb",122:"direction_bt",123:"direction_rl",124:"direction_lr"},productions_:[0,[3,2],[5,0],[5,2],[6,1],[6,1],[6,1],[6,1],[6,1],[4,2],[4,2],[4,2],[4,3],[16,2],[16,1],[17,1],[17,1],[17,1],[15,1],[15,1],[15,2],[19,2],[19,2],[19,1],[19,1],[18,2],[18,1],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,9],[7,6],[7,4],[7,1],[7,2],[7,2],[7,1],[21,1],[21,1],[21,1],[39,2],[39,1],[20,4],[20,3],[20,4],[20,2],[20,2],[20,1],[42,1],[42,6],[42,5],[43,1],[43,3],[45,4],[45,4],[45,6],[45,4],[45,4],[45,4],[45,8],[45,4],[45,4],[45,4],[45,6],[45,4],[45,4],[45,4],[45,4],[45,4],[45,1],[41,2],[41,3],[41,3],[41,1],[41,3],[41,4],[76,1],[76,2],[76,1],[76,1],[72,1],[72,2],[73,3],[30,1],[30,2],[30,1],[30,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[28,1],[28,2],[28,1],[28,1],[24,5],[25,5],[26,2],[26,4],[26,3],[26,5],[26,3],[26,5],[26,5],[26,7],[26,2],[26,4],[26,2],[26,4],[26,4],[26,6],[22,5],[23,5],[23,5],[23,9],[23,9],[23,7],[23,7],[103,1],[103,3],[92,1],[92,3],[107,1],[107,2],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[82,1],[82,1],[82,1],[82,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[79,1],[79,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[47,1],[47,2],[101,1],[101,2],[33,1],[33,1],[33,1],[33,1]],performAction:x(function(pt,Tt,lt,je,jt,de,ll){var ve=de.length-1;switch(jt){case 2:this.$=[];break;case 3:(!Array.isArray(de[ve])||de[ve].length>0)&&de[ve-1].push(de[ve]),this.$=de[ve-1];break;case 4:case 183:this.$=de[ve];break;case 11:je.setDirection("TB"),this.$="TB";break;case 12:je.setDirection(de[ve-1]),this.$=de[ve-1];break;case 27:this.$=de[ve-1].nodes;break;case 28:case 29:case 30:case 31:case 32:this.$=[];break;case 33:this.$=je.addSubGraph(de[ve-6],de[ve-1],de[ve-4]);break;case 34:this.$=je.addSubGraph(de[ve-3],de[ve-1],de[ve-3]);break;case 35:this.$=je.addSubGraph(void 0,de[ve-1],void 0);break;case 37:this.$=de[ve].trim(),je.setAccTitle(this.$);break;case 38:case 39:this.$=de[ve].trim(),je.setAccDescription(this.$);break;case 43:this.$=de[ve-1]+de[ve];break;case 44:this.$=de[ve];break;case 45:je.addVertex(de[ve-1][de[ve-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,de[ve]),je.addLink(de[ve-3].stmt,de[ve-1],de[ve-2]),this.$={stmt:de[ve-1],nodes:de[ve-1].concat(de[ve-3].nodes)};break;case 46:je.addLink(de[ve-2].stmt,de[ve],de[ve-1]),this.$={stmt:de[ve],nodes:de[ve].concat(de[ve-2].nodes)};break;case 47:je.addLink(de[ve-3].stmt,de[ve-1],de[ve-2]),this.$={stmt:de[ve-1],nodes:de[ve-1].concat(de[ve-3].nodes)};break;case 48:this.$={stmt:de[ve-1],nodes:de[ve-1]};break;case 49:je.addVertex(de[ve-1][de[ve-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,de[ve]),this.$={stmt:de[ve-1],nodes:de[ve-1],shapeData:de[ve]};break;case 50:this.$={stmt:de[ve],nodes:de[ve]};break;case 51:this.$=[de[ve]];break;case 52:je.addVertex(de[ve-5][de[ve-5].length-1],void 0,void 0,void 0,void 0,void 0,void 0,de[ve-4]),this.$=de[ve-5].concat(de[ve]);break;case 53:this.$=de[ve-4].concat(de[ve]);break;case 54:this.$=de[ve];break;case 55:this.$=de[ve-2],je.setClass(de[ve-2],de[ve]);break;case 56:this.$=de[ve-3],je.addVertex(de[ve-3],de[ve-1],"square");break;case 57:this.$=de[ve-3],je.addVertex(de[ve-3],de[ve-1],"doublecircle");break;case 58:this.$=de[ve-5],je.addVertex(de[ve-5],de[ve-2],"circle");break;case 59:this.$=de[ve-3],je.addVertex(de[ve-3],de[ve-1],"ellipse");break;case 60:this.$=de[ve-3],je.addVertex(de[ve-3],de[ve-1],"stadium");break;case 61:this.$=de[ve-3],je.addVertex(de[ve-3],de[ve-1],"subroutine");break;case 62:this.$=de[ve-7],je.addVertex(de[ve-7],de[ve-1],"rect",void 0,void 0,void 0,Object.fromEntries([[de[ve-5],de[ve-3]]]));break;case 63:this.$=de[ve-3],je.addVertex(de[ve-3],de[ve-1],"cylinder");break;case 64:this.$=de[ve-3],je.addVertex(de[ve-3],de[ve-1],"round");break;case 65:this.$=de[ve-3],je.addVertex(de[ve-3],de[ve-1],"diamond");break;case 66:this.$=de[ve-5],je.addVertex(de[ve-5],de[ve-2],"hexagon");break;case 67:this.$=de[ve-3],je.addVertex(de[ve-3],de[ve-1],"odd");break;case 68:this.$=de[ve-3],je.addVertex(de[ve-3],de[ve-1],"trapezoid");break;case 69:this.$=de[ve-3],je.addVertex(de[ve-3],de[ve-1],"inv_trapezoid");break;case 70:this.$=de[ve-3],je.addVertex(de[ve-3],de[ve-1],"lean_right");break;case 71:this.$=de[ve-3],je.addVertex(de[ve-3],de[ve-1],"lean_left");break;case 72:this.$=de[ve],je.addVertex(de[ve]);break;case 73:de[ve-1].text=de[ve],this.$=de[ve-1];break;case 74:case 75:de[ve-2].text=de[ve-1],this.$=de[ve-2];break;case 76:this.$=de[ve];break;case 77:var br=je.destructLink(de[ve],de[ve-2]);this.$={type:br.type,stroke:br.stroke,length:br.length,text:de[ve-1]};break;case 78:var br=je.destructLink(de[ve],de[ve-2]);this.$={type:br.type,stroke:br.stroke,length:br.length,text:de[ve-1],id:de[ve-3]};break;case 79:this.$={text:de[ve],type:"text"};break;case 80:this.$={text:de[ve-1].text+""+de[ve],type:de[ve-1].type};break;case 81:this.$={text:de[ve],type:"string"};break;case 82:this.$={text:de[ve],type:"markdown"};break;case 83:var br=je.destructLink(de[ve]);this.$={type:br.type,stroke:br.stroke,length:br.length};break;case 84:var br=je.destructLink(de[ve]);this.$={type:br.type,stroke:br.stroke,length:br.length,id:de[ve-1]};break;case 85:this.$=de[ve-1];break;case 86:this.$={text:de[ve],type:"text"};break;case 87:this.$={text:de[ve-1].text+""+de[ve],type:de[ve-1].type};break;case 88:this.$={text:de[ve],type:"string"};break;case 89:case 104:this.$={text:de[ve],type:"markdown"};break;case 101:this.$={text:de[ve],type:"text"};break;case 102:this.$={text:de[ve-1].text+""+de[ve],type:de[ve-1].type};break;case 103:this.$={text:de[ve],type:"text"};break;case 105:this.$=de[ve-4],je.addClass(de[ve-2],de[ve]);break;case 106:this.$=de[ve-4],je.setClass(de[ve-2],de[ve]);break;case 107:case 115:this.$=de[ve-1],je.setClickEvent(de[ve-1],de[ve]);break;case 108:case 116:this.$=de[ve-3],je.setClickEvent(de[ve-3],de[ve-2]),je.setTooltip(de[ve-3],de[ve]);break;case 109:this.$=de[ve-2],je.setClickEvent(de[ve-2],de[ve-1],de[ve]);break;case 110:this.$=de[ve-4],je.setClickEvent(de[ve-4],de[ve-3],de[ve-2]),je.setTooltip(de[ve-4],de[ve]);break;case 111:this.$=de[ve-2],je.setLink(de[ve-2],de[ve]);break;case 112:this.$=de[ve-4],je.setLink(de[ve-4],de[ve-2]),je.setTooltip(de[ve-4],de[ve]);break;case 113:this.$=de[ve-4],je.setLink(de[ve-4],de[ve-2],de[ve]);break;case 114:this.$=de[ve-6],je.setLink(de[ve-6],de[ve-4],de[ve]),je.setTooltip(de[ve-6],de[ve-2]);break;case 117:this.$=de[ve-1],je.setLink(de[ve-1],de[ve]);break;case 118:this.$=de[ve-3],je.setLink(de[ve-3],de[ve-2]),je.setTooltip(de[ve-3],de[ve]);break;case 119:this.$=de[ve-3],je.setLink(de[ve-3],de[ve-2],de[ve]);break;case 120:this.$=de[ve-5],je.setLink(de[ve-5],de[ve-4],de[ve]),je.setTooltip(de[ve-5],de[ve-2]);break;case 121:this.$=de[ve-4],je.addVertex(de[ve-2],void 0,void 0,de[ve]);break;case 122:this.$=de[ve-4],je.updateLink([de[ve-2]],de[ve]);break;case 123:this.$=de[ve-4],je.updateLink(de[ve-2],de[ve]);break;case 124:this.$=de[ve-8],je.updateLinkInterpolate([de[ve-6]],de[ve-2]),je.updateLink([de[ve-6]],de[ve]);break;case 125:this.$=de[ve-8],je.updateLinkInterpolate(de[ve-6],de[ve-2]),je.updateLink(de[ve-6],de[ve]);break;case 126:this.$=de[ve-6],je.updateLinkInterpolate([de[ve-4]],de[ve]);break;case 127:this.$=de[ve-6],je.updateLinkInterpolate(de[ve-4],de[ve]);break;case 128:case 130:this.$=[de[ve]];break;case 129:case 131:de[ve-2].push(de[ve]),this.$=de[ve-2];break;case 133:this.$=de[ve-1]+de[ve];break;case 181:this.$=de[ve];break;case 182:this.$=de[ve-1]+""+de[ve];break;case 184:this.$=de[ve-1]+""+de[ve];break;case 185:this.$={stmt:"dir",value:"TB"};break;case 186:this.$={stmt:"dir",value:"BT"};break;case 187:this.$={stmt:"dir",value:"RL"};break;case 188:this.$={stmt:"dir",value:"LR"};break}},"anonymous"),table:[{3:1,4:2,9:e,10:r,12:n},{1:[3]},t(i,a,{5:6}),{4:7,9:e,10:r,12:n},{4:8,9:e,10:r,12:n},{13:[1,9],14:[1,10]},{1:[2,1],6:11,7:12,8:s,9:o,10:l,11:u,20:17,22:18,23:19,24:20,25:21,26:22,27:h,33:24,34:d,36:f,38:p,42:28,43:38,44:g,45:39,47:40,60:m,84:v,85:y,86:b,87:w,88:T,89:E,102:L,105:S,106:C,109:A,111:N,113:41,114:_,115:O,116:P,121:k,122:R,123:I,124:M},t(i,[2,9]),t(i,[2,10]),t(i,[2,11]),{8:[1,54],9:[1,55],10:D,15:53,18:56},t(B,[2,3]),t(B,[2,4]),t(B,[2,5]),t(B,[2,6]),t(B,[2,7]),t(B,[2,8]),{8:$,9:F,11:G,21:58,41:59,72:63,75:[1,64],77:[1,66],78:[1,65]},{8:$,9:F,11:G,21:67},{8:$,9:F,11:G,21:68},{8:$,9:F,11:G,21:69},{8:$,9:F,11:G,21:70},{8:$,9:F,11:G,21:71},{8:$,9:F,10:[1,72],11:G,21:73},t(B,[2,36]),{35:[1,74]},{37:[1,75]},t(B,[2,39]),t(W,[2,50],{18:76,39:77,10:D,40:J}),{10:[1,79]},{10:[1,80]},{10:[1,81]},{10:[1,82]},{14:q,44:ne,60:ae,80:[1,86],89:pe,95:[1,83],97:[1,84],101:85,105:K,106:Z,109:X,111:Y,114:ee,115:j,116:fe,120:87},t(B,[2,185]),t(B,[2,186]),t(B,[2,187]),t(B,[2,188]),t(te,[2,51]),t(te,[2,54],{46:[1,99]}),t(Ae,[2,72],{113:112,29:[1,100],44:g,48:[1,101],50:[1,102],52:[1,103],54:[1,104],56:[1,105],58:[1,106],60:m,63:[1,107],65:[1,108],67:[1,109],68:[1,110],70:[1,111],89:E,102:L,105:S,106:C,109:A,111:N,114:_,115:O,116:P}),t(H,[2,181]),t(H,[2,142]),t(H,[2,143]),t(H,[2,144]),t(H,[2,145]),t(H,[2,146]),t(H,[2,147]),t(H,[2,148]),t(H,[2,149]),t(H,[2,150]),t(H,[2,151]),t(H,[2,152]),t(i,[2,12]),t(i,[2,18]),t(i,[2,19]),{9:[1,113]},t(Oe,[2,26],{18:114,10:D}),t(B,[2,27]),{42:115,43:38,44:g,45:39,47:40,60:m,89:E,102:L,105:S,106:C,109:A,111:N,113:41,114:_,115:O,116:P},t(B,[2,40]),t(B,[2,41]),t(B,[2,42]),t(ue,[2,76],{73:116,62:[1,118],74:[1,117]}),{76:119,79:120,80:Ve,81:Ge,116:Ue,119:ke},{75:[1,125],77:[1,126]},t(Pe,[2,83]),t(B,[2,28]),t(B,[2,29]),t(B,[2,30]),t(B,[2,31]),t(B,[2,32]),{10:Se,12:_e,14:ze,27:me,28:127,32:De,44:Q,60:ce,75:z,80:[1,129],81:[1,130],83:140,84:oe,85:se,86:ge,87:he,88:be,89:Ce,90:Te,91:128,105:Ne,109:Xe,111:Ye,114:Ke,115:Ze,116:Be},t(He,a,{5:153}),t(B,[2,37]),t(B,[2,38]),t(W,[2,48],{44:ht}),t(W,[2,49],{18:155,10:D,40:st}),t(te,[2,44]),{44:g,47:157,60:m,89:E,102:L,105:S,106:C,109:A,111:N,113:41,114:_,115:O,116:P},{102:[1,158],103:159,105:[1,160]},{44:g,47:161,60:m,89:E,102:L,105:S,106:C,109:A,111:N,113:41,114:_,115:O,116:P},{44:g,47:162,60:m,89:E,102:L,105:S,106:C,109:A,111:N,113:41,114:_,115:O,116:P},t(We,[2,107],{10:[1,163],96:[1,164]}),{80:[1,165]},t(We,[2,115],{120:167,10:[1,166],14:q,44:ne,60:ae,89:pe,105:K,106:Z,109:X,111:Y,114:ee,115:j,116:fe}),t(We,[2,117],{10:[1,168]}),t(kt,[2,183]),t(kt,[2,170]),t(kt,[2,171]),t(kt,[2,172]),t(kt,[2,173]),t(kt,[2,174]),t(kt,[2,175]),t(kt,[2,176]),t(kt,[2,177]),t(kt,[2,178]),t(kt,[2,179]),t(kt,[2,180]),{44:g,47:169,60:m,89:E,102:L,105:S,106:C,109:A,111:N,113:41,114:_,115:O,116:P},{30:170,67:qe,80:rt,81:ct,82:171,116:ut,117:nt,118:bt},{30:178,67:qe,80:rt,81:ct,82:171,116:ut,117:nt,118:bt},{30:180,50:[1,179],67:qe,80:rt,81:ct,82:171,116:ut,117:nt,118:bt},{30:181,67:qe,80:rt,81:ct,82:171,116:ut,117:nt,118:bt},{30:182,67:qe,80:rt,81:ct,82:171,116:ut,117:nt,118:bt},{30:183,67:qe,80:rt,81:ct,82:171,116:ut,117:nt,118:bt},{109:[1,184]},{30:185,67:qe,80:rt,81:ct,82:171,116:ut,117:nt,118:bt},{30:186,65:[1,187],67:qe,80:rt,81:ct,82:171,116:ut,117:nt,118:bt},{30:188,67:qe,80:rt,81:ct,82:171,116:ut,117:nt,118:bt},{30:189,67:qe,80:rt,81:ct,82:171,116:ut,117:nt,118:bt},{30:190,67:qe,80:rt,81:ct,82:171,116:ut,117:nt,118:bt},t(H,[2,182]),t(i,[2,20]),t(Oe,[2,25]),t(W,[2,46],{39:191,18:192,10:D,40:J}),t(ue,[2,73],{10:[1,193]}),{10:[1,194]},{30:195,67:qe,80:rt,81:ct,82:171,116:ut,117:nt,118:bt},{77:[1,196],79:197,116:Ue,119:ke},t(Zt,[2,79]),t(Zt,[2,81]),t(Zt,[2,82]),t(Zt,[2,168]),t(Zt,[2,169]),{76:198,79:120,80:Ve,81:Ge,116:Ue,119:ke},t(Pe,[2,84]),{8:$,9:F,10:Se,11:G,12:_e,14:ze,21:200,27:me,29:[1,199],32:De,44:Q,60:ce,75:z,83:140,84:oe,85:se,86:ge,87:he,88:be,89:Ce,90:Te,91:201,105:Ne,109:Xe,111:Ye,114:Ke,115:Ze,116:Be},t(Ot,[2,101]),t(Ot,[2,103]),t(Ot,[2,104]),t(Ot,[2,157]),t(Ot,[2,158]),t(Ot,[2,159]),t(Ot,[2,160]),t(Ot,[2,161]),t(Ot,[2,162]),t(Ot,[2,163]),t(Ot,[2,164]),t(Ot,[2,165]),t(Ot,[2,166]),t(Ot,[2,167]),t(Ot,[2,90]),t(Ot,[2,91]),t(Ot,[2,92]),t(Ot,[2,93]),t(Ot,[2,94]),t(Ot,[2,95]),t(Ot,[2,96]),t(Ot,[2,97]),t(Ot,[2,98]),t(Ot,[2,99]),t(Ot,[2,100]),{6:11,7:12,8:s,9:o,10:l,11:u,20:17,22:18,23:19,24:20,25:21,26:22,27:h,32:[1,202],33:24,34:d,36:f,38:p,42:28,43:38,44:g,45:39,47:40,60:m,84:v,85:y,86:b,87:w,88:T,89:E,102:L,105:S,106:C,109:A,111:N,113:41,114:_,115:O,116:P,121:k,122:R,123:I,124:M},{10:D,18:203},{44:[1,204]},t(te,[2,43]),{10:[1,205],44:g,60:m,89:E,102:L,105:S,106:C,109:A,111:N,113:112,114:_,115:O,116:P},{10:[1,206]},{10:[1,207],106:[1,208]},t(tr,[2,128]),{10:[1,209],44:g,60:m,89:E,102:L,105:S,106:C,109:A,111:N,113:112,114:_,115:O,116:P},{10:[1,210],44:g,60:m,89:E,102:L,105:S,106:C,109:A,111:N,113:112,114:_,115:O,116:P},{80:[1,211]},t(We,[2,109],{10:[1,212]}),t(We,[2,111],{10:[1,213]}),{80:[1,214]},t(kt,[2,184]),{80:[1,215],98:[1,216]},t(te,[2,55],{113:112,44:g,60:m,89:E,102:L,105:S,106:C,109:A,111:N,114:_,115:O,116:P}),{31:[1,217],67:qe,82:218,116:ut,117:nt,118:bt},t(xr,[2,86]),t(xr,[2,88]),t(xr,[2,89]),t(xr,[2,153]),t(xr,[2,154]),t(xr,[2,155]),t(xr,[2,156]),{49:[1,219],67:qe,82:218,116:ut,117:nt,118:bt},{30:220,67:qe,80:rt,81:ct,82:171,116:ut,117:nt,118:bt},{51:[1,221],67:qe,82:218,116:ut,117:nt,118:bt},{53:[1,222],67:qe,82:218,116:ut,117:nt,118:bt},{55:[1,223],67:qe,82:218,116:ut,117:nt,118:bt},{57:[1,224],67:qe,82:218,116:ut,117:nt,118:bt},{60:[1,225]},{64:[1,226],67:qe,82:218,116:ut,117:nt,118:bt},{66:[1,227],67:qe,82:218,116:ut,117:nt,118:bt},{30:228,67:qe,80:rt,81:ct,82:171,116:ut,117:nt,118:bt},{31:[1,229],67:qe,82:218,116:ut,117:nt,118:bt},{67:qe,69:[1,230],71:[1,231],82:218,116:ut,117:nt,118:bt},{67:qe,69:[1,233],71:[1,232],82:218,116:ut,117:nt,118:bt},t(W,[2,45],{18:155,10:D,40:st}),t(W,[2,47],{44:ht}),t(ue,[2,75]),t(ue,[2,74]),{62:[1,234],67:qe,82:218,116:ut,117:nt,118:bt},t(ue,[2,77]),t(Zt,[2,80]),{77:[1,235],79:197,116:Ue,119:ke},{30:236,67:qe,80:rt,81:ct,82:171,116:ut,117:nt,118:bt},t(He,a,{5:237}),t(Ot,[2,102]),t(B,[2,35]),{43:238,44:g,45:39,47:40,60:m,89:E,102:L,105:S,106:C,109:A,111:N,113:41,114:_,115:O,116:P},{10:D,18:239},{10:rr,60:Wt,84:cr,92:240,105:an,107:241,108:242,109:dt,110:Ee,111:Je,112:wt},{10:rr,60:Wt,84:cr,92:251,104:[1,252],105:an,107:241,108:242,109:dt,110:Ee,111:Je,112:wt},{10:rr,60:Wt,84:cr,92:253,104:[1,254],105:an,107:241,108:242,109:dt,110:Ee,111:Je,112:wt},{105:[1,255]},{10:rr,60:Wt,84:cr,92:256,105:an,107:241,108:242,109:dt,110:Ee,111:Je,112:wt},{44:g,47:257,60:m,89:E,102:L,105:S,106:C,109:A,111:N,113:41,114:_,115:O,116:P},t(We,[2,108]),{80:[1,258]},{80:[1,259],98:[1,260]},t(We,[2,116]),t(We,[2,118],{10:[1,261]}),t(We,[2,119]),t(Ae,[2,56]),t(xr,[2,87]),t(Ae,[2,57]),{51:[1,262],67:qe,82:218,116:ut,117:nt,118:bt},t(Ae,[2,64]),t(Ae,[2,59]),t(Ae,[2,60]),t(Ae,[2,61]),{109:[1,263]},t(Ae,[2,63]),t(Ae,[2,65]),{66:[1,264],67:qe,82:218,116:ut,117:nt,118:bt},t(Ae,[2,67]),t(Ae,[2,68]),t(Ae,[2,70]),t(Ae,[2,69]),t(Ae,[2,71]),t([10,44,60,89,102,105,106,109,111,114,115,116],[2,85]),t(ue,[2,78]),{31:[1,265],67:qe,82:218,116:ut,117:nt,118:bt},{6:11,7:12,8:s,9:o,10:l,11:u,20:17,22:18,23:19,24:20,25:21,26:22,27:h,32:[1,266],33:24,34:d,36:f,38:p,42:28,43:38,44:g,45:39,47:40,60:m,84:v,85:y,86:b,87:w,88:T,89:E,102:L,105:S,106:C,109:A,111:N,113:41,114:_,115:O,116:P,121:k,122:R,123:I,124:M},t(te,[2,53]),{43:267,44:g,45:39,47:40,60:m,89:E,102:L,105:S,106:C,109:A,111:N,113:41,114:_,115:O,116:P},t(We,[2,121],{106:or}),t(Ur,[2,130],{108:269,10:rr,60:Wt,84:cr,105:an,109:dt,110:Ee,111:Je,112:wt}),t(ur,[2,132]),t(ur,[2,134]),t(ur,[2,135]),t(ur,[2,136]),t(ur,[2,137]),t(ur,[2,138]),t(ur,[2,139]),t(ur,[2,140]),t(ur,[2,141]),t(We,[2,122],{106:or}),{10:[1,270]},t(We,[2,123],{106:or}),{10:[1,271]},t(tr,[2,129]),t(We,[2,105],{106:or}),t(We,[2,106],{113:112,44:g,60:m,89:E,102:L,105:S,106:C,109:A,111:N,114:_,115:O,116:P}),t(We,[2,110]),t(We,[2,112],{10:[1,272]}),t(We,[2,113]),{98:[1,273]},{51:[1,274]},{62:[1,275]},{66:[1,276]},{8:$,9:F,11:G,21:277},t(B,[2,34]),t(te,[2,52]),{10:rr,60:Wt,84:cr,105:an,107:278,108:242,109:dt,110:Ee,111:Je,112:wt},t(ur,[2,133]),{14:q,44:ne,60:ae,89:pe,101:279,105:K,106:Z,109:X,111:Y,114:ee,115:j,116:fe,120:87},{14:q,44:ne,60:ae,89:pe,101:280,105:K,106:Z,109:X,111:Y,114:ee,115:j,116:fe,120:87},{98:[1,281]},t(We,[2,120]),t(Ae,[2,58]),{30:282,67:qe,80:rt,81:ct,82:171,116:ut,117:nt,118:bt},t(Ae,[2,66]),t(He,a,{5:283}),t(Ur,[2,131],{108:269,10:rr,60:Wt,84:cr,105:an,109:dt,110:Ee,111:Je,112:wt}),t(We,[2,126],{120:167,10:[1,284],14:q,44:ne,60:ae,89:pe,105:K,106:Z,109:X,111:Y,114:ee,115:j,116:fe}),t(We,[2,127],{120:167,10:[1,285],14:q,44:ne,60:ae,89:pe,105:K,106:Z,109:X,111:Y,114:ee,115:j,116:fe}),t(We,[2,114]),{31:[1,286],67:qe,82:218,116:ut,117:nt,118:bt},{6:11,7:12,8:s,9:o,10:l,11:u,20:17,22:18,23:19,24:20,25:21,26:22,27:h,32:[1,287],33:24,34:d,36:f,38:p,42:28,43:38,44:g,45:39,47:40,60:m,84:v,85:y,86:b,87:w,88:T,89:E,102:L,105:S,106:C,109:A,111:N,113:41,114:_,115:O,116:P,121:k,122:R,123:I,124:M},{10:rr,60:Wt,84:cr,92:288,105:an,107:241,108:242,109:dt,110:Ee,111:Je,112:wt},{10:rr,60:Wt,84:cr,92:289,105:an,107:241,108:242,109:dt,110:Ee,111:Je,112:wt},t(Ae,[2,62]),t(B,[2,33]),t(We,[2,124],{106:or}),t(We,[2,125],{106:or})],defaultActions:{},parseError:x(function(pt,Tt){if(Tt.recoverable)this.trace(pt);else{var lt=new Error(pt);throw lt.hash=Tt,lt}},"parseError"),parse:x(function(pt){var Tt=this,lt=[0],je=[],jt=[null],de=[],ll=this.table,ve="",br=0,xg=0,kS=2,bg=1,jq=de.slice.call(arguments,1),Hn=Object.create(this.lexer),bc={yy:{}};for(var bx in this.yy)Object.prototype.hasOwnProperty.call(this.yy,bx)&&(bc.yy[bx]=this.yy[bx]);Hn.setInput(pt,bc.yy),bc.yy.lexer=Hn,bc.yy.parser=this,typeof Hn.yylloc>"u"&&(Hn.yylloc={});var wx=Hn.yylloc;de.push(wx);var Kq=Hn.options&&Hn.options.ranges;typeof bc.yy.parseError=="function"?this.parseError=bc.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Zq(xa){lt.length=lt.length-2*xa,jt.length=jt.length-xa,de.length=de.length-xa}x(Zq,"popStack");function SS(){var xa;return xa=je.pop()||Hn.lex()||bg,typeof xa!="number"&&(xa instanceof Array&&(je=xa,xa=je.pop()),xa=Tt.symbols_[xa]||xa),xa}x(SS,"lex");for(var Ji,wc,Pa,Tx,qu={},wg,fo,CS,Tg;;){if(wc=lt[lt.length-1],this.defaultActions[wc]?Pa=this.defaultActions[wc]:((Ji===null||typeof Ji>"u")&&(Ji=SS()),Pa=ll[wc]&&ll[wc][Ji]),typeof Pa>"u"||!Pa.length||!Pa[0]){var Ex="";Tg=[];for(wg in ll[wc])this.terminals_[wg]&&wg>kS&&Tg.push("'"+this.terminals_[wg]+"'");Hn.showPosition?Ex="Parse error on line "+(br+1)+`:
`+Hn.showPosition()+`
Expecting `+Tg.join(", ")+", got '"+(this.terminals_[Ji]||Ji)+"'":Ex="Parse error on line "+(br+1)+": Unexpected "+(Ji==bg?"end of input":"'"+(this.terminals_[Ji]||Ji)+"'"),this.parseError(Ex,{text:Hn.match,token:this.terminals_[Ji]||Ji,line:Hn.yylineno,loc:wx,expected:Tg})}if(Pa[0]instanceof Array&&Pa.length>1)throw new Error("Parse Error: multiple actions possible at state: "+wc+", token: "+Ji);switch(Pa[0]){case 1:lt.push(Ji),jt.push(Hn.yytext),de.push(Hn.yylloc),lt.push(Pa[1]),Ji=null,xg=Hn.yyleng,ve=Hn.yytext,br=Hn.yylineno,wx=Hn.yylloc;break;case 2:if(fo=this.productions_[Pa[1]][1],qu.$=jt[jt.length-fo],qu._$={first_line:de[de.length-(fo||1)].first_line,last_line:de[de.length-1].last_line,first_column:de[de.length-(fo||1)].first_column,last_column:de[de.length-1].last_column},Kq&&(qu._$.range=[de[de.length-(fo||1)].range[0],de[de.length-1].range[1]]),Tx=this.performAction.apply(qu,[ve,xg,br,bc.yy,Pa[1],jt,de].concat(jq)),typeof Tx<"u")return Tx;fo&&(lt=lt.slice(0,-1*fo*2),jt=jt.slice(0,-1*fo),de=de.slice(0,-1*fo)),lt.push(this.productions_[Pa[1]][0]),jt.push(qu.$),de.push(qu._$),CS=ll[lt[lt.length-2]][lt[lt.length-1]],lt.push(CS);break;case 3:return!0}}return!0},"parse")},fi=function(){var bn={EOF:1,parseError:x(function(Tt,lt){if(this.yy.parser)this.yy.parser.parseError(Tt,lt);else throw new Error(Tt)},"parseError"),setInput:x(function(pt,Tt){return this.yy=Tt||this.yy||{},this._input=pt,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:x(function(){var pt=this._input[0];this.yytext+=pt,this.yyleng++,this.offset++,this.match+=pt,this.matched+=pt;var Tt=pt.match(/(?:\r\n?|\n).*/g);return Tt?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),pt},"input"),unput:x(function(pt){var Tt=pt.length,lt=pt.split(/(?:\r\n?|\n)/g);this._input=pt+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-Tt),this.offset-=Tt;var je=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),lt.length-1&&(this.yylineno-=lt.length-1);var jt=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:lt?(lt.length===je.length?this.yylloc.first_column:0)+je[je.length-lt.length].length-lt[0].length:this.yylloc.first_column-Tt},this.options.ranges&&(this.yylloc.range=[jt[0],jt[0]+this.yyleng-Tt]),this.yyleng=this.yytext.length,this},"unput"),more:x(function(){return this._more=!0,this},"more"),reject:x(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:x(function(pt){this.unput(this.match.slice(pt))},"less"),pastInput:x(function(){var pt=this.matched.substr(0,this.matched.length-this.match.length);return(pt.length>20?"...":"")+pt.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:x(function(){var pt=this.match;return pt.length<20&&(pt+=this._input.substr(0,20-pt.length)),(pt.substr(0,20)+(pt.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:x(function(){var pt=this.pastInput(),Tt=new Array(pt.length+1).join("-");return pt+this.upcomingInput()+`
`+Tt+"^"},"showPosition"),test_match:x(function(pt,Tt){var lt,je,jt;if(this.options.backtrack_lexer&&(jt={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(jt.yylloc.range=this.yylloc.range.slice(0))),je=pt[0].match(/(?:\r\n?|\n).*/g),je&&(this.yylineno+=je.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:je?je[je.length-1].length-je[je.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+pt[0].length},this.yytext+=pt[0],this.match+=pt[0],this.matches=pt,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(pt[0].length),this.matched+=pt[0],lt=this.performAction.call(this,this.yy,this,Tt,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),lt)return lt;if(this._backtrack){for(var de in jt)this[de]=jt[de];return!1}return!1},"test_match"),next:x(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var pt,Tt,lt,je;this._more||(this.yytext="",this.match="");for(var jt=this._currentRules(),de=0;de<jt.length;de++)if(lt=this._input.match(this.rules[jt[de]]),lt&&(!Tt||lt[0].length>Tt[0].length)){if(Tt=lt,je=de,this.options.backtrack_lexer){if(pt=this.test_match(lt,jt[de]),pt!==!1)return pt;if(this._backtrack){Tt=!1;continue}else return!1}else if(!this.options.flex)break}return Tt?(pt=this.test_match(Tt,jt[je]),pt!==!1?pt:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var Tt=this.next();return Tt||this.lex()},"lex"),begin:x(function(Tt){this.conditionStack.push(Tt)},"begin"),popState:x(function(){var Tt=this.conditionStack.length-1;return Tt>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(Tt){return Tt=this.conditionStack.length-1-Math.abs(Tt||0),Tt>=0?this.conditionStack[Tt]:"INITIAL"},"topState"),pushState:x(function(Tt){this.begin(Tt)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:x(function(Tt,lt,je,jt){switch(je){case 0:return this.begin("acc_title"),34;case 1:return this.popState(),"acc_title_value";case 2:return this.begin("acc_descr"),36;case 3:return this.popState(),"acc_descr_value";case 4:this.begin("acc_descr_multiline");break;case 5:this.popState();break;case 6:return"acc_descr_multiline_value";case 7:return this.pushState("shapeData"),lt.yytext="",40;case 8:return this.pushState("shapeDataStr"),40;case 9:return this.popState(),40;case 10:const de=/\n\s*/g;return lt.yytext=lt.yytext.replace(de,"<br/>"),40;case 11:return 40;case 12:this.popState();break;case 13:this.begin("callbackname");break;case 14:this.popState();break;case 15:this.popState(),this.begin("callbackargs");break;case 16:return 95;case 17:this.popState();break;case 18:return 96;case 19:return"MD_STR";case 20:this.popState();break;case 21:this.begin("md_string");break;case 22:return"STR";case 23:this.popState();break;case 24:this.pushState("string");break;case 25:return 84;case 26:return 102;case 27:return 85;case 28:return 104;case 29:return 86;case 30:return 87;case 31:return 97;case 32:this.begin("click");break;case 33:this.popState();break;case 34:return 88;case 35:return Tt.lex.firstGraph()&&this.begin("dir"),12;case 36:return Tt.lex.firstGraph()&&this.begin("dir"),12;case 37:return Tt.lex.firstGraph()&&this.begin("dir"),12;case 38:return 27;case 39:return 32;case 40:return 98;case 41:return 98;case 42:return 98;case 43:return 98;case 44:return this.popState(),13;case 45:return this.popState(),14;case 46:return this.popState(),14;case 47:return this.popState(),14;case 48:return this.popState(),14;case 49:return this.popState(),14;case 50:return this.popState(),14;case 51:return this.popState(),14;case 52:return this.popState(),14;case 53:return this.popState(),14;case 54:return this.popState(),14;case 55:return 121;case 56:return 122;case 57:return 123;case 58:return 124;case 59:return 78;case 60:return 105;case 61:return 111;case 62:return 46;case 63:return 60;case 64:return 44;case 65:return 8;case 66:return 106;case 67:return 115;case 68:return this.popState(),77;case 69:return this.pushState("edgeText"),75;case 70:return 119;case 71:return this.popState(),77;case 72:return this.pushState("thickEdgeText"),75;case 73:return 119;case 74:return this.popState(),77;case 75:return this.pushState("dottedEdgeText"),75;case 76:return 119;case 77:return 77;case 78:return this.popState(),53;case 79:return"TEXT";case 80:return this.pushState("ellipseText"),52;case 81:return this.popState(),55;case 82:return this.pushState("text"),54;case 83:return this.popState(),57;case 84:return this.pushState("text"),56;case 85:return 58;case 86:return this.pushState("text"),67;case 87:return this.popState(),64;case 88:return this.pushState("text"),63;case 89:return this.popState(),49;case 90:return this.pushState("text"),48;case 91:return this.popState(),69;case 92:return this.popState(),71;case 93:return 117;case 94:return this.pushState("trapText"),68;case 95:return this.pushState("trapText"),70;case 96:return 118;case 97:return 67;case 98:return 90;case 99:return"SEP";case 100:return 89;case 101:return 115;case 102:return 111;case 103:return 44;case 104:return 109;case 105:return 114;case 106:return 116;case 107:return this.popState(),62;case 108:return this.pushState("text"),62;case 109:return this.popState(),51;case 110:return this.pushState("text"),50;case 111:return this.popState(),31;case 112:return this.pushState("text"),29;case 113:return this.popState(),66;case 114:return this.pushState("text"),65;case 115:return"TEXT";case 116:return"QUOTE";case 117:return 9;case 118:return 10;case 119:return 11}},"anonymous"),rules:[/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:@\{)/,/^(?:["])/,/^(?:["])/,/^(?:[^\"]+)/,/^(?:[^}^"]+)/,/^(?:\})/,/^(?:call[\s]+)/,/^(?:\([\s]*\))/,/^(?:\()/,/^(?:[^(]*)/,/^(?:\))/,/^(?:[^)]*)/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["][`])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:["])/,/^(?:style\b)/,/^(?:default\b)/,/^(?:linkStyle\b)/,/^(?:interpolate\b)/,/^(?:classDef\b)/,/^(?:class\b)/,/^(?:href[\s])/,/^(?:click[\s]+)/,/^(?:[\s\n])/,/^(?:[^\s\n]*)/,/^(?:flowchart-elk\b)/,/^(?:graph\b)/,/^(?:flowchart\b)/,/^(?:subgraph\b)/,/^(?:end\b\s*)/,/^(?:_self\b)/,/^(?:_blank\b)/,/^(?:_parent\b)/,/^(?:_top\b)/,/^(?:(\r?\n)*\s*\n)/,/^(?:\s*LR\b)/,/^(?:\s*RL\b)/,/^(?:\s*TB\b)/,/^(?:\s*BT\b)/,/^(?:\s*TD\b)/,/^(?:\s*BR\b)/,/^(?:\s*<)/,/^(?:\s*>)/,/^(?:\s*\^)/,/^(?:\s*v\b)/,/^(?:.*direction\s+TB[^\n]*)/,/^(?:.*direction\s+BT[^\n]*)/,/^(?:.*direction\s+RL[^\n]*)/,/^(?:.*direction\s+LR[^\n]*)/,/^(?:[^\s\"]+@(?=[^\{\"]))/,/^(?:[0-9]+)/,/^(?:#)/,/^(?::::)/,/^(?::)/,/^(?:&)/,/^(?:;)/,/^(?:,)/,/^(?:\*)/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?--\s*)/,/^(?:[^-]|-(?!-)+)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?==\s*)/,/^(?:[^=]|=(?!))/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?:\s*[xo<]?-\.\s*)/,/^(?:[^\.]|\.(?!))/,/^(?:\s*~~[\~]+\s*)/,/^(?:[-/\)][\)])/,/^(?:[^\(\)\[\]\{\}]|!\)+)/,/^(?:\(-)/,/^(?:\]\))/,/^(?:\(\[)/,/^(?:\]\])/,/^(?:\[\[)/,/^(?:\[\|)/,/^(?:>)/,/^(?:\)\])/,/^(?:\[\()/,/^(?:\)\)\))/,/^(?:\(\(\()/,/^(?:[\\(?=\])][\]])/,/^(?:\/(?=\])\])/,/^(?:\/(?!\])|\\(?!\])|[^\\\[\]\(\)\{\}\/]+)/,/^(?:\[\/)/,/^(?:\[\\)/,/^(?:<)/,/^(?:>)/,/^(?:\^)/,/^(?:\\\|)/,/^(?:v\b)/,/^(?:\*)/,/^(?:#)/,/^(?:&)/,/^(?:([A-Za-z0-9!"\#$%&'*+\.`?\\_\/]|-(?=[^\>\-\.])|(?!))+)/,/^(?:-)/,/^(?:[\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6]|[\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377]|[\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5]|[\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA]|[\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE]|[\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA]|[\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A]|[\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39]|[\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8]|[\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C]|[\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C]|[\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99]|[\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0]|[\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1]|[\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81]|[\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3]|[\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6]|[\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A]|[\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081]|[\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D]|[\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0]|[\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310]|[\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC]|[\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D]|[\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D]|[\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3]|[\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F]|[\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128]|[\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184]|[\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3]|[\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6]|[\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE]|[\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B]|[\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788]|[\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805]|[\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5]|[\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4]|[\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E]|[\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D]|[\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36]|[\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D]|[\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC]|[\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF]|[\uFFD2-\uFFD7\uFFDA-\uFFDC])/,/^(?:\|)/,/^(?:\|)/,/^(?:\))/,/^(?:\()/,/^(?:\])/,/^(?:\[)/,/^(?:(\}))/,/^(?:\{)/,/^(?:[^\[\]\(\)\{\}\|\"]+)/,/^(?:")/,/^(?:(\r?\n)+)/,/^(?:\s)/,/^(?:$)/],conditions:{shapeDataEndBracket:{rules:[21,24,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},shapeDataStr:{rules:[9,10,21,24,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},shapeData:{rules:[8,11,12,21,24,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},callbackargs:{rules:[17,18,21,24,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},callbackname:{rules:[14,15,16,21,24,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},href:{rules:[21,24,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},click:{rules:[21,24,33,34,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},dottedEdgeText:{rules:[21,24,74,76,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},thickEdgeText:{rules:[21,24,71,73,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},edgeText:{rules:[21,24,68,70,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},trapText:{rules:[21,24,77,80,82,84,88,90,91,92,93,94,95,108,110,112,114],inclusive:!1},ellipseText:{rules:[21,24,77,78,79,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},text:{rules:[21,24,77,80,81,82,83,84,87,88,89,90,94,95,107,108,109,110,111,112,113,114,115],inclusive:!1},vertex:{rules:[21,24,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},dir:{rules:[21,24,44,45,46,47,48,49,50,51,52,53,54,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},acc_descr_multiline:{rules:[5,6,21,24,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},acc_descr:{rules:[3,21,24,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},acc_title:{rules:[1,21,24,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},md_string:{rules:[19,20,21,24,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},string:{rules:[21,22,23,24,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},INITIAL:{rules:[0,2,4,7,13,21,24,25,26,27,28,29,30,31,32,35,36,37,38,39,40,41,42,43,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,71,72,74,75,77,80,82,84,85,86,88,90,94,95,96,97,98,99,100,101,102,103,104,105,106,108,110,112,114,116,117,118,119],inclusive:!0}}};return bn}();Yr.lexer=fi;function xn(){this.yy={}}return x(xn,"Parser"),xn.prototype=Yr,Yr.Parser=xn,new xn}();Cw.parser=Cw;var hG=Cw,dG=Object.assign({},hG);dG.parse=t=>{const e=t.replace(/}\s*\n/g,`}
`);return hG.parse(e)};var r3e=dG,n3e=x((t,e)=>{const r=XT,n=r(t,"r"),i=r(t,"g"),a=r(t,"b");return Al(n,i,a,e)},"fade"),i3e=x(t=>`.label {
    font-family: ${t.fontFamily};
    color: ${t.nodeTextColor||t.textColor};
  }
  .cluster-label text {
    fill: ${t.titleColor};
  }
  .cluster-label span {
    color: ${t.titleColor};
  }
  .cluster-label span p {
    background-color: transparent;
  }

  .label text,span {
    fill: ${t.nodeTextColor||t.textColor};
    color: ${t.nodeTextColor||t.textColor};
  }

  .node rect,
  .node circle,
  .node ellipse,
  .node polygon,
  .node path {
    fill: ${t.mainBkg};
    stroke: ${t.nodeBorder};
    stroke-width: 1px;
  }
  .rough-node .label text , .node .label text, .image-shape .label, .icon-shape .label {
    text-anchor: middle;
  }
  // .flowchart-label .text-outer-tspan {
  //   text-anchor: middle;
  // }
  // .flowchart-label .text-inner-tspan {
  //   text-anchor: start;
  // }

  .node .katex path {
    fill: #000;
    stroke: #000;
    stroke-width: 1px;
  }

  .rough-node .label,.node .label, .image-shape .label, .icon-shape .label {
    text-align: center;
  }
  .node.clickable {
    cursor: pointer;
  }


  .root .anchor path {
    fill: ${t.lineColor} !important;
    stroke-width: 0;
    stroke: ${t.lineColor};
  }

  .arrowheadPath {
    fill: ${t.arrowheadColor};
  }

  .edgePath .path {
    stroke: ${t.lineColor};
    stroke-width: 2.0px;
  }

  .flowchart-link {
    stroke: ${t.lineColor};
    fill: none;
  }

  .edgeLabel {
    background-color: ${t.edgeLabelBackground};
    p {
      background-color: ${t.edgeLabelBackground};
    }
    rect {
      opacity: 0.5;
      background-color: ${t.edgeLabelBackground};
      fill: ${t.edgeLabelBackground};
    }
    text-align: center;
  }

  /* For html labels only */
  .labelBkg {
    background-color: ${n3e(t.edgeLabelBackground,.5)};
    // background-color:
  }

  .cluster rect {
    fill: ${t.clusterBkg};
    stroke: ${t.clusterBorder};
    stroke-width: 1px;
  }

  .cluster text {
    fill: ${t.titleColor};
  }

  .cluster span {
    color: ${t.titleColor};
  }
  /* .cluster div {
    color: ${t.titleColor};
  } */

  div.mermaidTooltip {
    position: absolute;
    text-align: center;
    max-width: 200px;
    padding: 2px;
    font-family: ${t.fontFamily};
    font-size: 12px;
    background: ${t.tertiaryColor};
    border: 1px solid ${t.border2};
    border-radius: 2px;
    pointer-events: none;
    z-index: 100;
  }

  .flowchartTitleText {
    text-anchor: middle;
    font-size: 18px;
    fill: ${t.textColor};
  }

  rect.text {
    fill: none;
    stroke-width: 0;
  }

  .icon-shape, .image-shape {
    background-color: ${t.edgeLabelBackground};
    p {
      background-color: ${t.edgeLabelBackground};
      padding: 2px;
    }
    rect {
      opacity: 0.5;
      background-color: ${t.edgeLabelBackground};
      fill: ${t.edgeLabelBackground};
    }
    text-align: center;
  }
  ${og()}
`,"getStyles"),a3e=i3e,s3e={parser:r3e,get db(){return new Q4e},renderer:t3e,styles:a3e,init:x(t=>{t.flowchart||(t.flowchart={}),t.layout&&Y3({layout:t.layout}),t.flowchart.arrowMarkerAbsolute=t.arrowMarkerAbsolute,Y3({flowchart:{arrowMarkerAbsolute:t.arrowMarkerAbsolute}})},"init")};const yk=Object.freeze(Object.defineProperty({__proto__:null,diagram:s3e},Symbol.toStringTag,{value:"Module"}));var Aw=function(){var t=x(function(Y,ee,j,fe){for(j=j||{},fe=Y.length;fe--;j[Y[fe]]=ee);return j},"o"),e=[6,8,10,22,24,26,28,33,34,35,36,37,40,43,44,50],r=[1,10],n=[1,11],i=[1,12],a=[1,13],s=[1,20],o=[1,21],l=[1,22],u=[1,23],h=[1,24],d=[1,19],f=[1,25],p=[1,26],g=[1,18],m=[1,33],v=[1,34],y=[1,35],b=[1,36],w=[1,37],T=[6,8,10,13,15,17,20,21,22,24,26,28,33,34,35,36,37,40,43,44,50,63,64,65,66,67],E=[1,42],L=[1,43],S=[1,52],C=[40,50,68,69],A=[1,63],N=[1,61],_=[1,58],O=[1,62],P=[1,64],k=[6,8,10,13,17,22,24,26,28,33,34,35,36,37,40,41,42,43,44,48,49,50,63,64,65,66,67],R=[63,64,65,66,67],I=[1,81],M=[1,80],D=[1,78],B=[1,79],$=[6,10,42,47],F=[6,10,13,41,42,47,48,49],G=[1,89],W=[1,88],J=[1,87],q=[19,56],ne=[1,98],ae=[1,97],pe=[19,56,58,60],K={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ER_DIAGRAM:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,entityName:11,relSpec:12,COLON:13,role:14,STYLE_SEPARATOR:15,idList:16,BLOCK_START:17,attributes:18,BLOCK_STOP:19,SQS:20,SQE:21,title:22,title_value:23,acc_title:24,acc_title_value:25,acc_descr:26,acc_descr_value:27,acc_descr_multiline_value:28,direction:29,classDefStatement:30,classStatement:31,styleStatement:32,direction_tb:33,direction_bt:34,direction_rl:35,direction_lr:36,CLASSDEF:37,stylesOpt:38,separator:39,UNICODE_TEXT:40,STYLE_TEXT:41,COMMA:42,CLASS:43,STYLE:44,style:45,styleComponent:46,SEMI:47,NUM:48,BRKT:49,ENTITY_NAME:50,attribute:51,attributeType:52,attributeName:53,attributeKeyTypeList:54,attributeComment:55,ATTRIBUTE_WORD:56,attributeKeyType:57,",":58,ATTRIBUTE_KEY:59,COMMENT:60,cardinality:61,relType:62,ZERO_OR_ONE:63,ZERO_OR_MORE:64,ONE_OR_MORE:65,ONLY_ONE:66,MD_PARENT:67,NON_IDENTIFYING:68,IDENTIFYING:69,WORD:70,$accept:0,$end:1},terminals_:{2:"error",4:"ER_DIAGRAM",6:"EOF",8:"SPACE",10:"NEWLINE",13:"COLON",15:"STYLE_SEPARATOR",17:"BLOCK_START",19:"BLOCK_STOP",20:"SQS",21:"SQE",22:"title",23:"title_value",24:"acc_title",25:"acc_title_value",26:"acc_descr",27:"acc_descr_value",28:"acc_descr_multiline_value",33:"direction_tb",34:"direction_bt",35:"direction_rl",36:"direction_lr",37:"CLASSDEF",40:"UNICODE_TEXT",41:"STYLE_TEXT",42:"COMMA",43:"CLASS",44:"STYLE",47:"SEMI",48:"NUM",49:"BRKT",50:"ENTITY_NAME",56:"ATTRIBUTE_WORD",58:",",59:"ATTRIBUTE_KEY",60:"COMMENT",63:"ZERO_OR_ONE",64:"ZERO_OR_MORE",65:"ONE_OR_MORE",66:"ONLY_ONE",67:"MD_PARENT",68:"NON_IDENTIFYING",69:"IDENTIFYING",70:"WORD"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,5],[9,9],[9,7],[9,7],[9,4],[9,6],[9,3],[9,5],[9,1],[9,3],[9,7],[9,9],[9,6],[9,8],[9,4],[9,6],[9,2],[9,2],[9,2],[9,1],[9,1],[9,1],[9,1],[9,1],[29,1],[29,1],[29,1],[29,1],[30,4],[16,1],[16,1],[16,3],[16,3],[31,3],[32,4],[38,1],[38,3],[45,1],[45,2],[39,1],[39,1],[39,1],[46,1],[46,1],[46,1],[46,1],[11,1],[11,1],[18,1],[18,2],[51,2],[51,3],[51,3],[51,4],[52,1],[53,1],[54,1],[54,3],[57,1],[55,1],[12,3],[61,1],[61,1],[61,1],[61,1],[61,1],[62,1],[62,1],[14,1],[14,1],[14,1]],performAction:x(function(ee,j,fe,te,Ae,H,Oe){var ue=H.length-1;switch(Ae){case 1:break;case 2:this.$=[];break;case 3:H[ue-1].push(H[ue]),this.$=H[ue-1];break;case 4:case 5:this.$=H[ue];break;case 6:case 7:this.$=[];break;case 8:te.addEntity(H[ue-4]),te.addEntity(H[ue-2]),te.addRelationship(H[ue-4],H[ue],H[ue-2],H[ue-3]);break;case 9:te.addEntity(H[ue-8]),te.addEntity(H[ue-4]),te.addRelationship(H[ue-8],H[ue],H[ue-4],H[ue-5]),te.setClass([H[ue-8]],H[ue-6]),te.setClass([H[ue-4]],H[ue-2]);break;case 10:te.addEntity(H[ue-6]),te.addEntity(H[ue-2]),te.addRelationship(H[ue-6],H[ue],H[ue-2],H[ue-3]),te.setClass([H[ue-6]],H[ue-4]);break;case 11:te.addEntity(H[ue-6]),te.addEntity(H[ue-4]),te.addRelationship(H[ue-6],H[ue],H[ue-4],H[ue-5]),te.setClass([H[ue-4]],H[ue-2]);break;case 12:te.addEntity(H[ue-3]),te.addAttributes(H[ue-3],H[ue-1]);break;case 13:te.addEntity(H[ue-5]),te.addAttributes(H[ue-5],H[ue-1]),te.setClass([H[ue-5]],H[ue-3]);break;case 14:te.addEntity(H[ue-2]);break;case 15:te.addEntity(H[ue-4]),te.setClass([H[ue-4]],H[ue-2]);break;case 16:te.addEntity(H[ue]);break;case 17:te.addEntity(H[ue-2]),te.setClass([H[ue-2]],H[ue]);break;case 18:te.addEntity(H[ue-6],H[ue-4]),te.addAttributes(H[ue-6],H[ue-1]);break;case 19:te.addEntity(H[ue-8],H[ue-6]),te.addAttributes(H[ue-8],H[ue-1]),te.setClass([H[ue-8]],H[ue-3]);break;case 20:te.addEntity(H[ue-5],H[ue-3]);break;case 21:te.addEntity(H[ue-7],H[ue-5]),te.setClass([H[ue-7]],H[ue-2]);break;case 22:te.addEntity(H[ue-3],H[ue-1]);break;case 23:te.addEntity(H[ue-5],H[ue-3]),te.setClass([H[ue-5]],H[ue]);break;case 24:case 25:this.$=H[ue].trim(),te.setAccTitle(this.$);break;case 26:case 27:this.$=H[ue].trim(),te.setAccDescription(this.$);break;case 32:te.setDirection("TB");break;case 33:te.setDirection("BT");break;case 34:te.setDirection("RL");break;case 35:te.setDirection("LR");break;case 36:this.$=H[ue-3],te.addClass(H[ue-2],H[ue-1]);break;case 37:case 38:case 56:case 64:this.$=[H[ue]];break;case 39:case 40:this.$=H[ue-2].concat([H[ue]]);break;case 41:this.$=H[ue-2],te.setClass(H[ue-1],H[ue]);break;case 42:this.$=H[ue-3],te.addCssStyles(H[ue-2],H[ue-1]);break;case 43:this.$=[H[ue]];break;case 44:H[ue-2].push(H[ue]),this.$=H[ue-2];break;case 46:this.$=H[ue-1]+H[ue];break;case 54:case 76:case 77:this.$=H[ue].replace(/"/g,"");break;case 55:case 78:this.$=H[ue];break;case 57:H[ue].push(H[ue-1]),this.$=H[ue];break;case 58:this.$={type:H[ue-1],name:H[ue]};break;case 59:this.$={type:H[ue-2],name:H[ue-1],keys:H[ue]};break;case 60:this.$={type:H[ue-2],name:H[ue-1],comment:H[ue]};break;case 61:this.$={type:H[ue-3],name:H[ue-2],keys:H[ue-1],comment:H[ue]};break;case 62:case 63:case 66:this.$=H[ue];break;case 65:H[ue-2].push(H[ue]),this.$=H[ue-2];break;case 67:this.$=H[ue].replace(/"/g,"");break;case 68:this.$={cardA:H[ue],relType:H[ue-1],cardB:H[ue-2]};break;case 69:this.$=te.Cardinality.ZERO_OR_ONE;break;case 70:this.$=te.Cardinality.ZERO_OR_MORE;break;case 71:this.$=te.Cardinality.ONE_OR_MORE;break;case 72:this.$=te.Cardinality.ONLY_ONE;break;case 73:this.$=te.Cardinality.MD_PARENT;break;case 74:this.$=te.Identification.NON_IDENTIFYING;break;case 75:this.$=te.Identification.IDENTIFYING;break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:9,22:r,24:n,26:i,28:a,29:14,30:15,31:16,32:17,33:s,34:o,35:l,36:u,37:h,40:d,43:f,44:p,50:g},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:27,11:9,22:r,24:n,26:i,28:a,29:14,30:15,31:16,32:17,33:s,34:o,35:l,36:u,37:h,40:d,43:f,44:p,50:g},t(e,[2,5]),t(e,[2,6]),t(e,[2,16],{12:28,61:32,15:[1,29],17:[1,30],20:[1,31],63:m,64:v,65:y,66:b,67:w}),{23:[1,38]},{25:[1,39]},{27:[1,40]},t(e,[2,27]),t(e,[2,28]),t(e,[2,29]),t(e,[2,30]),t(e,[2,31]),t(T,[2,54]),t(T,[2,55]),t(e,[2,32]),t(e,[2,33]),t(e,[2,34]),t(e,[2,35]),{16:41,40:E,41:L},{16:44,40:E,41:L},{16:45,40:E,41:L},t(e,[2,4]),{11:46,40:d,50:g},{16:47,40:E,41:L},{18:48,19:[1,49],51:50,52:51,56:S},{11:53,40:d,50:g},{62:54,68:[1,55],69:[1,56]},t(C,[2,69]),t(C,[2,70]),t(C,[2,71]),t(C,[2,72]),t(C,[2,73]),t(e,[2,24]),t(e,[2,25]),t(e,[2,26]),{13:A,38:57,41:N,42:_,45:59,46:60,48:O,49:P},t(k,[2,37]),t(k,[2,38]),{16:65,40:E,41:L,42:_},{13:A,38:66,41:N,42:_,45:59,46:60,48:O,49:P},{13:[1,67],15:[1,68]},t(e,[2,17],{61:32,12:69,17:[1,70],42:_,63:m,64:v,65:y,66:b,67:w}),{19:[1,71]},t(e,[2,14]),{18:72,19:[2,56],51:50,52:51,56:S},{53:73,56:[1,74]},{56:[2,62]},{21:[1,75]},{61:76,63:m,64:v,65:y,66:b,67:w},t(R,[2,74]),t(R,[2,75]),{6:I,10:M,39:77,42:D,47:B},{40:[1,82],41:[1,83]},t($,[2,43],{46:84,13:A,41:N,48:O,49:P}),t(F,[2,45]),t(F,[2,50]),t(F,[2,51]),t(F,[2,52]),t(F,[2,53]),t(e,[2,41],{42:_}),{6:I,10:M,39:85,42:D,47:B},{14:86,40:G,50:W,70:J},{16:90,40:E,41:L},{11:91,40:d,50:g},{18:92,19:[1,93],51:50,52:51,56:S},t(e,[2,12]),{19:[2,57]},t(q,[2,58],{54:94,55:95,57:96,59:ne,60:ae}),t([19,56,59,60],[2,63]),t(e,[2,22],{15:[1,100],17:[1,99]}),t([40,50],[2,68]),t(e,[2,36]),{13:A,41:N,45:101,46:60,48:O,49:P},t(e,[2,47]),t(e,[2,48]),t(e,[2,49]),t(k,[2,39]),t(k,[2,40]),t(F,[2,46]),t(e,[2,42]),t(e,[2,8]),t(e,[2,76]),t(e,[2,77]),t(e,[2,78]),{13:[1,102],42:_},{13:[1,104],15:[1,103]},{19:[1,105]},t(e,[2,15]),t(q,[2,59],{55:106,58:[1,107],60:ae}),t(q,[2,60]),t(pe,[2,64]),t(q,[2,67]),t(pe,[2,66]),{18:108,19:[1,109],51:50,52:51,56:S},{16:110,40:E,41:L},t($,[2,44],{46:84,13:A,41:N,48:O,49:P}),{14:111,40:G,50:W,70:J},{16:112,40:E,41:L},{14:113,40:G,50:W,70:J},t(e,[2,13]),t(q,[2,61]),{57:114,59:ne},{19:[1,115]},t(e,[2,20]),t(e,[2,23],{17:[1,116],42:_}),t(e,[2,11]),{13:[1,117],42:_},t(e,[2,10]),t(pe,[2,65]),t(e,[2,18]),{18:118,19:[1,119],51:50,52:51,56:S},{14:120,40:G,50:W,70:J},{19:[1,121]},t(e,[2,21]),t(e,[2,9]),t(e,[2,19])],defaultActions:{52:[2,62],72:[2,57]},parseError:x(function(ee,j){if(j.recoverable)this.trace(ee);else{var fe=new Error(ee);throw fe.hash=j,fe}},"parseError"),parse:x(function(ee){var j=this,fe=[0],te=[],Ae=[null],H=[],Oe=this.table,ue="",Ve=0,Ge=0,Ue=2,ke=1,Pe=H.slice.call(arguments,1),Se=Object.create(this.lexer),_e={yy:{}};for(var ze in this.yy)Object.prototype.hasOwnProperty.call(this.yy,ze)&&(_e.yy[ze]=this.yy[ze]);Se.setInput(ee,_e.yy),_e.yy.lexer=Se,_e.yy.parser=this,typeof Se.yylloc>"u"&&(Se.yylloc={});var me=Se.yylloc;H.push(me);var De=Se.options&&Se.options.ranges;typeof _e.yy.parseError=="function"?this.parseError=_e.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Q(Ye){fe.length=fe.length-2*Ye,Ae.length=Ae.length-Ye,H.length=H.length-Ye}x(Q,"popStack");function ce(){var Ye;return Ye=te.pop()||Se.lex()||ke,typeof Ye!="number"&&(Ye instanceof Array&&(te=Ye,Ye=te.pop()),Ye=j.symbols_[Ye]||Ye),Ye}x(ce,"lex");for(var z,oe,se,ge,he={},be,Ce,Te,Ne;;){if(oe=fe[fe.length-1],this.defaultActions[oe]?se=this.defaultActions[oe]:((z===null||typeof z>"u")&&(z=ce()),se=Oe[oe]&&Oe[oe][z]),typeof se>"u"||!se.length||!se[0]){var Xe="";Ne=[];for(be in Oe[oe])this.terminals_[be]&&be>Ue&&Ne.push("'"+this.terminals_[be]+"'");Se.showPosition?Xe="Parse error on line "+(Ve+1)+`:
`+Se.showPosition()+`
Expecting `+Ne.join(", ")+", got '"+(this.terminals_[z]||z)+"'":Xe="Parse error on line "+(Ve+1)+": Unexpected "+(z==ke?"end of input":"'"+(this.terminals_[z]||z)+"'"),this.parseError(Xe,{text:Se.match,token:this.terminals_[z]||z,line:Se.yylineno,loc:me,expected:Ne})}if(se[0]instanceof Array&&se.length>1)throw new Error("Parse Error: multiple actions possible at state: "+oe+", token: "+z);switch(se[0]){case 1:fe.push(z),Ae.push(Se.yytext),H.push(Se.yylloc),fe.push(se[1]),z=null,Ge=Se.yyleng,ue=Se.yytext,Ve=Se.yylineno,me=Se.yylloc;break;case 2:if(Ce=this.productions_[se[1]][1],he.$=Ae[Ae.length-Ce],he._$={first_line:H[H.length-(Ce||1)].first_line,last_line:H[H.length-1].last_line,first_column:H[H.length-(Ce||1)].first_column,last_column:H[H.length-1].last_column},De&&(he._$.range=[H[H.length-(Ce||1)].range[0],H[H.length-1].range[1]]),ge=this.performAction.apply(he,[ue,Ge,Ve,_e.yy,se[1],Ae,H].concat(Pe)),typeof ge<"u")return ge;Ce&&(fe=fe.slice(0,-1*Ce*2),Ae=Ae.slice(0,-1*Ce),H=H.slice(0,-1*Ce)),fe.push(this.productions_[se[1]][0]),Ae.push(he.$),H.push(he._$),Te=Oe[fe[fe.length-2]][fe[fe.length-1]],fe.push(Te);break;case 3:return!0}}return!0},"parse")},Z=function(){var Y={EOF:1,parseError:x(function(j,fe){if(this.yy.parser)this.yy.parser.parseError(j,fe);else throw new Error(j)},"parseError"),setInput:x(function(ee,j){return this.yy=j||this.yy||{},this._input=ee,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:x(function(){var ee=this._input[0];this.yytext+=ee,this.yyleng++,this.offset++,this.match+=ee,this.matched+=ee;var j=ee.match(/(?:\r\n?|\n).*/g);return j?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),ee},"input"),unput:x(function(ee){var j=ee.length,fe=ee.split(/(?:\r\n?|\n)/g);this._input=ee+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-j),this.offset-=j;var te=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),fe.length-1&&(this.yylineno-=fe.length-1);var Ae=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:fe?(fe.length===te.length?this.yylloc.first_column:0)+te[te.length-fe.length].length-fe[0].length:this.yylloc.first_column-j},this.options.ranges&&(this.yylloc.range=[Ae[0],Ae[0]+this.yyleng-j]),this.yyleng=this.yytext.length,this},"unput"),more:x(function(){return this._more=!0,this},"more"),reject:x(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:x(function(ee){this.unput(this.match.slice(ee))},"less"),pastInput:x(function(){var ee=this.matched.substr(0,this.matched.length-this.match.length);return(ee.length>20?"...":"")+ee.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:x(function(){var ee=this.match;return ee.length<20&&(ee+=this._input.substr(0,20-ee.length)),(ee.substr(0,20)+(ee.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:x(function(){var ee=this.pastInput(),j=new Array(ee.length+1).join("-");return ee+this.upcomingInput()+`
`+j+"^"},"showPosition"),test_match:x(function(ee,j){var fe,te,Ae;if(this.options.backtrack_lexer&&(Ae={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(Ae.yylloc.range=this.yylloc.range.slice(0))),te=ee[0].match(/(?:\r\n?|\n).*/g),te&&(this.yylineno+=te.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:te?te[te.length-1].length-te[te.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+ee[0].length},this.yytext+=ee[0],this.match+=ee[0],this.matches=ee,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(ee[0].length),this.matched+=ee[0],fe=this.performAction.call(this,this.yy,this,j,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),fe)return fe;if(this._backtrack){for(var H in Ae)this[H]=Ae[H];return!1}return!1},"test_match"),next:x(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var ee,j,fe,te;this._more||(this.yytext="",this.match="");for(var Ae=this._currentRules(),H=0;H<Ae.length;H++)if(fe=this._input.match(this.rules[Ae[H]]),fe&&(!j||fe[0].length>j[0].length)){if(j=fe,te=H,this.options.backtrack_lexer){if(ee=this.test_match(fe,Ae[H]),ee!==!1)return ee;if(this._backtrack){j=!1;continue}else return!1}else if(!this.options.flex)break}return j?(ee=this.test_match(j,Ae[te]),ee!==!1?ee:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var j=this.next();return j||this.lex()},"lex"),begin:x(function(j){this.conditionStack.push(j)},"begin"),popState:x(function(){var j=this.conditionStack.length-1;return j>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(j){return j=this.conditionStack.length-1-Math.abs(j||0),j>=0?this.conditionStack[j]:"INITIAL"},"topState"),pushState:x(function(j){this.begin(j)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:x(function(j,fe,te,Ae){switch(te){case 0:return this.begin("acc_title"),24;case 1:return this.popState(),"acc_title_value";case 2:return this.begin("acc_descr"),26;case 3:return this.popState(),"acc_descr_value";case 4:this.begin("acc_descr_multiline");break;case 5:this.popState();break;case 6:return"acc_descr_multiline_value";case 7:return 33;case 8:return 34;case 9:return 35;case 10:return 36;case 11:return 10;case 12:break;case 13:return 8;case 14:return 50;case 15:return 70;case 16:return 4;case 17:return this.begin("block"),17;case 18:return 49;case 19:return 49;case 20:return 42;case 21:return 15;case 22:return 13;case 23:break;case 24:return 59;case 25:return 56;case 26:return 56;case 27:return 60;case 28:break;case 29:return this.popState(),19;case 30:return fe.yytext[0];case 31:return 20;case 32:return 21;case 33:return this.begin("style"),44;case 34:return this.popState(),10;case 35:break;case 36:return 13;case 37:return 42;case 38:return 49;case 39:return this.begin("style"),37;case 40:return 43;case 41:return 63;case 42:return 65;case 43:return 65;case 44:return 65;case 45:return 63;case 46:return 63;case 47:return 64;case 48:return 64;case 49:return 64;case 50:return 64;case 51:return 64;case 52:return 65;case 53:return 64;case 54:return 65;case 55:return 66;case 56:return 66;case 57:return 66;case 58:return 66;case 59:return 63;case 60:return 64;case 61:return 65;case 62:return 67;case 63:return 68;case 64:return 69;case 65:return 69;case 66:return 68;case 67:return 68;case 68:return 68;case 69:return 41;case 70:return 47;case 71:return 40;case 72:return 48;case 73:return fe.yytext[0];case 74:return 6}},"anonymous"),rules:[/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:[\s]+)/i,/^(?:"[^"%\r\n\v\b\\]+")/i,/^(?:"[^"]*")/i,/^(?:erDiagram\b)/i,/^(?:\{)/i,/^(?:#)/i,/^(?:#)/i,/^(?:,)/i,/^(?::::)/i,/^(?::)/i,/^(?:\s+)/i,/^(?:\b((?:PK)|(?:FK)|(?:UK))\b)/i,/^(?:([^\s]*)[~].*[~]([^\s]*))/i,/^(?:([\*A-Za-z_\u00C0-\uFFFF][A-Za-z0-9\-\_\[\]\(\)\u00C0-\uFFFF\*]*))/i,/^(?:"[^"]*")/i,/^(?:[\n]+)/i,/^(?:\})/i,/^(?:.)/i,/^(?:\[)/i,/^(?:\])/i,/^(?:style\b)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?::)/i,/^(?:,)/i,/^(?:#)/i,/^(?:classDef\b)/i,/^(?:class\b)/i,/^(?:one or zero\b)/i,/^(?:one or more\b)/i,/^(?:one or many\b)/i,/^(?:1\+)/i,/^(?:\|o\b)/i,/^(?:zero or one\b)/i,/^(?:zero or more\b)/i,/^(?:zero or many\b)/i,/^(?:0\+)/i,/^(?:\}o\b)/i,/^(?:many\(0\))/i,/^(?:many\(1\))/i,/^(?:many\b)/i,/^(?:\}\|)/i,/^(?:one\b)/i,/^(?:only one\b)/i,/^(?:1\b)/i,/^(?:\|\|)/i,/^(?:o\|)/i,/^(?:o\{)/i,/^(?:\|\{)/i,/^(?:\s*u\b)/i,/^(?:\.\.)/i,/^(?:--)/i,/^(?:to\b)/i,/^(?:optionally to\b)/i,/^(?:\.-)/i,/^(?:-\.)/i,/^(?:([^\x00-\x7F]|\w|-|\*)+)/i,/^(?:;)/i,/^(?:([^\x00-\x7F]|\w|-|\*)+)/i,/^(?:[0-9])/i,/^(?:.)/i,/^(?:$)/i],conditions:{style:{rules:[34,35,36,37,38,69,70],inclusive:!1},acc_descr_multiline:{rules:[5,6],inclusive:!1},acc_descr:{rules:[3],inclusive:!1},acc_title:{rules:[1],inclusive:!1},block:{rules:[23,24,25,26,27,28,29,30],inclusive:!1},INITIAL:{rules:[0,2,4,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,31,32,33,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,71,72,73,74],inclusive:!0}}};return Y}();K.lexer=Z;function X(){this.yy={}}return x(X,"Parser"),X.prototype=K,K.Parser=X,new X}();Aw.parser=Aw;var o3e=Aw,l3e=class{constructor(){this.entities=new Map,this.relationships=[],this.classes=new Map,this.direction="TB",this.Cardinality={ZERO_OR_ONE:"ZERO_OR_ONE",ZERO_OR_MORE:"ZERO_OR_MORE",ONE_OR_MORE:"ONE_OR_MORE",ONLY_ONE:"ONLY_ONE",MD_PARENT:"MD_PARENT"},this.Identification={NON_IDENTIFYING:"NON_IDENTIFYING",IDENTIFYING:"IDENTIFYING"},this.setAccTitle=Sn,this.getAccTitle=zn,this.setAccDescription=Vn,this.getAccDescription=Gn,this.setDiagramTitle=Zn,this.getDiagramTitle=_n,this.getConfig=x(()=>we().er,"getConfig"),this.clear(),this.addEntity=this.addEntity.bind(this),this.addAttributes=this.addAttributes.bind(this),this.addRelationship=this.addRelationship.bind(this),this.setDirection=this.setDirection.bind(this),this.addCssStyles=this.addCssStyles.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.setAccTitle=this.setAccTitle.bind(this),this.setAccDescription=this.setAccDescription.bind(this)}static{x(this,"ErDB")}addEntity(t,e=""){return this.entities.has(t)?!this.entities.get(t)?.alias&&e&&(this.entities.get(t).alias=e,ie.info(`Add alias '${e}' to entity '${t}'`)):(this.entities.set(t,{id:`entity-${t}-${this.entities.size}`,label:t,attributes:[],alias:e,shape:"erBox",look:we().look??"default",cssClasses:"default",cssStyles:[]}),ie.info("Added new entity :",t)),this.entities.get(t)}getEntity(t){return this.entities.get(t)}getEntities(){return this.entities}getClasses(){return this.classes}addAttributes(t,e){const r=this.addEntity(t);let n;for(n=e.length-1;n>=0;n--)e[n].keys||(e[n].keys=[]),e[n].comment||(e[n].comment=""),r.attributes.push(e[n]),ie.debug("Added attribute ",e[n].name)}addRelationship(t,e,r,n){const i=this.entities.get(t),a=this.entities.get(r);if(!i||!a)return;const s={entityA:i.id,roleA:e,entityB:a.id,relSpec:n};this.relationships.push(s),ie.debug("Added new relationship :",s)}getRelationships(){return this.relationships}getDirection(){return this.direction}setDirection(t){this.direction=t}getCompiledStyles(t){let e=[];for(const r of t){const n=this.classes.get(r);n?.styles&&(e=[...e,...n.styles??[]].map(i=>i.trim())),n?.textStyles&&(e=[...e,...n.textStyles??[]].map(i=>i.trim()))}return e}addCssStyles(t,e){for(const r of t){const n=this.entities.get(r);if(!e||!n)return;for(const i of e)n.cssStyles.push(i)}}addClass(t,e){t.forEach(r=>{let n=this.classes.get(r);n===void 0&&(n={id:r,styles:[],textStyles:[]},this.classes.set(r,n)),e&&e.forEach(function(i){if(/color/.exec(i)){const a=i.replace("fill","bgFill");n.textStyles.push(a)}n.styles.push(i)})})}setClass(t,e){for(const r of t){const n=this.entities.get(r);if(n)for(const i of e)n.cssClasses+=" "+i}}clear(){this.entities=new Map,this.classes=new Map,this.relationships=[],An()}getData(){const t=[],e=[],r=we();for(const i of this.entities.keys()){const a=this.entities.get(i);a&&(a.cssCompiledStyles=this.getCompiledStyles(a.cssClasses.split(" ")),t.push(a))}let n=0;for(const i of this.relationships){const a={id:_h(i.entityA,i.entityB,{prefix:"id",counter:n++}),type:"normal",curve:"basis",start:i.entityA,end:i.entityB,label:i.roleA,labelpos:"c",thickness:"normal",classes:"relationshipLine",arrowTypeStart:i.relSpec.cardB.toLowerCase(),arrowTypeEnd:i.relSpec.cardA.toLowerCase(),pattern:i.relSpec.relType=="IDENTIFYING"?"solid":"dashed",look:r.look};e.push(a)}return{nodes:t,edges:e,other:{},config:r,direction:"TB"}}},fG={};Dy(fG,{draw:()=>c3e});var c3e=x(async function(t,e,r,n){ie.info("REF0:"),ie.info("Drawing er diagram (unified)",e);const{securityLevel:i,er:a,layout:s}=we(),o=n.db.getData(),l=Pd(e,i);o.type=n.type,o.layoutAlgorithm=Vp(s),o.config.flowchart.nodeSpacing=a?.nodeSpacing||140,o.config.flowchart.rankSpacing=a?.rankSpacing||80,o.direction=n.db.getDirection(),o.markers=["only_one","zero_or_one","one_or_more","zero_or_more"],o.diagramId=e,await Sd(o,l),o.layoutAlgorithm==="elk"&&l.select(".edges").lower();const u=l.selectAll('[id*="-background"]');Array.from(u).length>0&&u.each(function(){const d=Qe(this),p=d.attr("id").replace("-background",""),g=l.select(`#${CSS.escape(p)}`);if(!g.empty()){const m=g.attr("transform");d.attr("transform",m)}});const h=8;Kt.insertTitle(l,"erDiagramTitleText",a?.titleTopMargin??25,n.db.getDiagramTitle()),Bu(l,h,"erDiagram",a?.useMaxWidth??!0)},"draw"),u3e=x((t,e)=>{const r=XT,n=r(t,"r"),i=r(t,"g"),a=r(t,"b");return Al(n,i,a,e)},"fade"),h3e=x(t=>`
  .entityBox {
    fill: ${t.mainBkg};
    stroke: ${t.nodeBorder};
  }

  .relationshipLabelBox {
    fill: ${t.tertiaryColor};
    opacity: 0.7;
    background-color: ${t.tertiaryColor};
      rect {
        opacity: 0.5;
      }
  }

  .labelBkg {
    background-color: ${u3e(t.tertiaryColor,.5)};
  }

  .edgeLabel .label {
    fill: ${t.nodeBorder};
    font-size: 14px;
  }

  .label {
    font-family: ${t.fontFamily};
    color: ${t.nodeTextColor||t.textColor};
  }

  .edge-pattern-dashed {
    stroke-dasharray: 8,8;
  }

  .node rect,
  .node circle,
  .node ellipse,
  .node polygon
  {
    fill: ${t.mainBkg};
    stroke: ${t.nodeBorder};
    stroke-width: 1px;
  }

  .relationshipLine {
    stroke: ${t.lineColor};
    stroke-width: 1;
    fill: none;
  }

  .marker {
    fill: none !important;
    stroke: ${t.lineColor} !important;
    stroke-width: 1;
  }
`,"getStyles"),d3e=h3e,f3e={parser:o3e,get db(){return new l3e},renderer:fG,styles:d3e};const p3e=Object.freeze(Object.defineProperty({__proto__:null,diagram:f3e},Symbol.toStringTag,{value:"Module"}));function Fu(t,e){t.accDescr&&e.setAccDescription?.(t.accDescr),t.accTitle&&e.setAccTitle?.(t.accTitle),t.title&&e.setDiagramTitle?.(t.title)}x(Fu,"populateCommonDb");var pG=class{constructor(t){this.init=t,this.records=this.init()}static{x(this,"ImperativeState")}reset(){this.records=this.init()}};function Ei(t){return typeof t=="object"&&t!==null&&typeof t.$type=="string"}function Hs(t){return typeof t=="object"&&t!==null&&typeof t.$refText=="string"}function g3e(t){return typeof t=="object"&&t!==null&&typeof t.name=="string"&&typeof t.type=="string"&&typeof t.path=="string"}function hm(t){return typeof t=="object"&&t!==null&&Ei(t.container)&&Hs(t.reference)&&typeof t.message=="string"}class gG{constructor(){this.subtypes={},this.allSubtypes={}}isInstance(e,r){return Ei(e)&&this.isSubtype(e.$type,r)}isSubtype(e,r){if(e===r)return!0;let n=this.subtypes[e];n||(n=this.subtypes[e]={});const i=n[r];if(i!==void 0)return i;{const a=this.computeIsSubtype(e,r);return n[r]=a,a}}getAllSubTypes(e){const r=this.allSubtypes[e];if(r)return r;{const n=this.getAllTypes(),i=[];for(const a of n)this.isSubtype(a,e)&&i.push(a);return this.allSubtypes[e]=i,i}}}function pp(t){return typeof t=="object"&&t!==null&&Array.isArray(t.content)}function mG(t){return typeof t=="object"&&t!==null&&typeof t.tokenType=="object"}function vG(t){return pp(t)&&typeof t.fullText=="string"}class ai{constructor(e,r){this.startFn=e,this.nextFn=r}iterator(){const e={state:this.startFn(),next:()=>this.nextFn(e.state),[Symbol.iterator]:()=>e};return e}[Symbol.iterator](){return this.iterator()}isEmpty(){return!!this.iterator().next().done}count(){const e=this.iterator();let r=0,n=e.next();for(;!n.done;)r++,n=e.next();return r}toArray(){const e=[],r=this.iterator();let n;do n=r.next(),n.value!==void 0&&e.push(n.value);while(!n.done);return e}toSet(){return new Set(this)}toMap(e,r){const n=this.map(i=>[e?e(i):i,r?r(i):i]);return new Map(n)}toString(){return this.join()}concat(e){return new ai(()=>({first:this.startFn(),firstDone:!1,iterator:e[Symbol.iterator]()}),r=>{let n;if(!r.firstDone){do if(n=this.nextFn(r.first),!n.done)return n;while(!n.done);r.firstDone=!0}do if(n=r.iterator.next(),!n.done)return n;while(!n.done);return wa})}join(e=","){const r=this.iterator();let n="",i,a=!1;do i=r.next(),i.done||(a&&(n+=e),n+=m3e(i.value)),a=!0;while(!i.done);return n}indexOf(e,r=0){const n=this.iterator();let i=0,a=n.next();for(;!a.done;){if(i>=r&&a.value===e)return i;a=n.next(),i++}return-1}every(e){const r=this.iterator();let n=r.next();for(;!n.done;){if(!e(n.value))return!1;n=r.next()}return!0}some(e){const r=this.iterator();let n=r.next();for(;!n.done;){if(e(n.value))return!0;n=r.next()}return!1}forEach(e){const r=this.iterator();let n=0,i=r.next();for(;!i.done;)e(i.value,n),i=r.next(),n++}map(e){return new ai(this.startFn,r=>{const{done:n,value:i}=this.nextFn(r);return n?wa:{done:!1,value:e(i)}})}filter(e){return new ai(this.startFn,r=>{let n;do if(n=this.nextFn(r),!n.done&&e(n.value))return n;while(!n.done);return wa})}nonNullable(){return this.filter(e=>e!=null)}reduce(e,r){const n=this.iterator();let i=r,a=n.next();for(;!a.done;)i===void 0?i=a.value:i=e(i,a.value),a=n.next();return i}reduceRight(e,r){return this.recursiveReduce(this.iterator(),e,r)}recursiveReduce(e,r,n){const i=e.next();if(i.done)return n;const a=this.recursiveReduce(e,r,n);return a===void 0?i.value:r(a,i.value)}find(e){const r=this.iterator();let n=r.next();for(;!n.done;){if(e(n.value))return n.value;n=r.next()}}findIndex(e){const r=this.iterator();let n=0,i=r.next();for(;!i.done;){if(e(i.value))return n;i=r.next(),n++}return-1}includes(e){const r=this.iterator();let n=r.next();for(;!n.done;){if(n.value===e)return!0;n=r.next()}return!1}flatMap(e){return new ai(()=>({this:this.startFn()}),r=>{do{if(r.iterator){const a=r.iterator.next();if(a.done)r.iterator=void 0;else return a}const{done:n,value:i}=this.nextFn(r.this);if(!n){const a=e(i);if(Kv(a))r.iterator=a[Symbol.iterator]();else return{done:!1,value:a}}}while(r.iterator);return wa})}flat(e){if(e===void 0&&(e=1),e<=0)return this;const r=e>1?this.flat(e-1):this;return new ai(()=>({this:r.startFn()}),n=>{do{if(n.iterator){const s=n.iterator.next();if(s.done)n.iterator=void 0;else return s}const{done:i,value:a}=r.nextFn(n.this);if(!i)if(Kv(a))n.iterator=a[Symbol.iterator]();else return{done:!1,value:a}}while(n.iterator);return wa})}head(){const r=this.iterator().next();if(!r.done)return r.value}tail(e=1){return new ai(()=>{const r=this.startFn();for(let n=0;n<e;n++)if(this.nextFn(r).done)return r;return r},this.nextFn)}limit(e){return new ai(()=>({size:0,state:this.startFn()}),r=>(r.size++,r.size>e?wa:this.nextFn(r.state)))}distinct(e){return new ai(()=>({set:new Set,internalState:this.startFn()}),r=>{let n;do if(n=this.nextFn(r.internalState),!n.done){const i=e?e(n.value):n.value;if(!r.set.has(i))return r.set.add(i),n}while(!n.done);return wa})}exclude(e,r){const n=new Set;for(const i of e){const a=r?r(i):i;n.add(a)}return this.filter(i=>{const a=r?r(i):i;return!n.has(a)})}}function m3e(t){return typeof t=="string"?t:typeof t>"u"?"undefined":typeof t.toString=="function"?t.toString():Object.prototype.toString.call(t)}function Kv(t){return!!t&&typeof t[Symbol.iterator]=="function"}const v3e=new ai(()=>{},()=>wa),wa=Object.freeze({done:!0,value:void 0});function si(...t){if(t.length===1){const e=t[0];if(e instanceof ai)return e;if(Kv(e))return new ai(()=>e[Symbol.iterator](),r=>r.next());if(typeof e.length=="number")return new ai(()=>({index:0}),r=>r.index<e.length?{done:!1,value:e[r.index++]}:wa)}return t.length>1?new ai(()=>({collIndex:0,arrIndex:0}),e=>{do{if(e.iterator){const r=e.iterator.next();if(!r.done)return r;e.iterator=void 0}if(e.array){if(e.arrIndex<e.array.length)return{done:!1,value:e.array[e.arrIndex++]};e.array=void 0,e.arrIndex=0}if(e.collIndex<t.length){const r=t[e.collIndex++];Kv(r)?e.iterator=r[Symbol.iterator]():r&&typeof r.length=="number"&&(e.array=r)}}while(e.iterator||e.array||e.collIndex<t.length);return wa}):v3e}class xk extends ai{constructor(e,r,n){super(()=>({iterators:n?.includeRoot?[[e][Symbol.iterator]()]:[r(e)[Symbol.iterator]()],pruned:!1}),i=>{for(i.pruned&&(i.iterators.pop(),i.pruned=!1);i.iterators.length>0;){const s=i.iterators[i.iterators.length-1].next();if(s.done)i.iterators.pop();else return i.iterators.push(r(s.value)[Symbol.iterator]()),s}return wa})}iterator(){const e={state:this.startFn(),next:()=>this.nextFn(e.state),prune:()=>{e.state.pruned=!0},[Symbol.iterator]:()=>e};return e}}var _w;(function(t){function e(a){return a.reduce((s,o)=>s+o,0)}t.sum=e;function r(a){return a.reduce((s,o)=>s*o,0)}t.product=r;function n(a){return a.reduce((s,o)=>Math.min(s,o))}t.min=n;function i(a){return a.reduce((s,o)=>Math.max(s,o))}t.max=i})(_w||(_w={}));function Lw(t){return new xk(t,e=>pp(e)?e.content:[],{includeRoot:!0})}function y3e(t,e){for(;t.container;)if(t=t.container,t===e)return!0;return!1}function Rw(t){return{start:{character:t.startColumn-1,line:t.startLine-1},end:{character:t.endColumn,line:t.endLine-1}}}function Zv(t){if(!t)return;const{offset:e,end:r,range:n}=t;return{range:n,offset:e,end:r,length:r-e}}var Ao;(function(t){t[t.Before=0]="Before",t[t.After=1]="After",t[t.OverlapFront=2]="OverlapFront",t[t.OverlapBack=3]="OverlapBack",t[t.Inside=4]="Inside",t[t.Outside=5]="Outside"})(Ao||(Ao={}));function x3e(t,e){if(t.end.line<e.start.line||t.end.line===e.start.line&&t.end.character<=e.start.character)return Ao.Before;if(t.start.line>e.end.line||t.start.line===e.end.line&&t.start.character>=e.end.character)return Ao.After;const r=t.start.line>e.start.line||t.start.line===e.start.line&&t.start.character>=e.start.character,n=t.end.line<e.end.line||t.end.line===e.end.line&&t.end.character<=e.end.character;return r&&n?Ao.Inside:r?Ao.OverlapBack:n?Ao.OverlapFront:Ao.Outside}function b3e(t,e){return x3e(t,e)>Ao.After}const w3e=/^[\w\p{L}]$/u;function T3e(t,e){if(t){const r=E3e(t,!0);if(r&&d9(r,e))return r;if(vG(t)){const n=t.content.findIndex(i=>!i.hidden);for(let i=n-1;i>=0;i--){const a=t.content[i];if(d9(a,e))return a}}}}function d9(t,e){return mG(t)&&e.includes(t.tokenType.name)}function E3e(t,e=!0){for(;t.container;){const r=t.container;let n=r.content.indexOf(t);for(;n>0;){n--;const i=r.content[n];if(e||!i.hidden)return i}t=r}}class yG extends Error{constructor(e,r){super(e?`${r} at ${e.range.start.line}:${e.range.start.character}`:r)}}function lg(t){throw new Error("Error! The input value was not handled.")}const o1="AbstractRule",l1="AbstractType",r3="Condition",f9="TypeDefinition",n3="ValueLiteral",Rf="AbstractElement";function k3e(t){return Dr.isInstance(t,Rf)}const c1="ArrayLiteral",u1="ArrayType",Nf="BooleanLiteral";function S3e(t){return Dr.isInstance(t,Nf)}const Df="Conjunction";function C3e(t){return Dr.isInstance(t,Df)}const Mf="Disjunction";function A3e(t){return Dr.isInstance(t,Mf)}const h1="Grammar",i3="GrammarImport",If="InferredType";function xG(t){return Dr.isInstance(t,If)}const Of="Interface";function bG(t){return Dr.isInstance(t,Of)}const a3="NamedArgument",Pf="Negation";function _3e(t){return Dr.isInstance(t,Pf)}const d1="NumberLiteral",f1="Parameter",Bf="ParameterReference";function L3e(t){return Dr.isInstance(t,Bf)}const Ff="ParserRule";function ns(t){return Dr.isInstance(t,Ff)}const p1="ReferenceType",dm="ReturnType";function R3e(t){return Dr.isInstance(t,dm)}const $f="SimpleType";function N3e(t){return Dr.isInstance(t,$f)}const g1="StringLiteral",hh="TerminalRule";function $u(t){return Dr.isInstance(t,hh)}const zf="Type";function wG(t){return Dr.isInstance(t,zf)}const s3="TypeAttribute",m1="UnionType",Vf="Action";function q2(t){return Dr.isInstance(t,Vf)}const Gf="Alternatives";function TG(t){return Dr.isInstance(t,Gf)}const Uf="Assignment";function vu(t){return Dr.isInstance(t,Uf)}const Wf="CharacterRange";function D3e(t){return Dr.isInstance(t,Wf)}const Hf="CrossReference";function bk(t){return Dr.isInstance(t,Hf)}const qf="EndOfFile";function M3e(t){return Dr.isInstance(t,qf)}const Yf="Group";function wk(t){return Dr.isInstance(t,Yf)}const Xf="Keyword";function yu(t){return Dr.isInstance(t,Xf)}const jf="NegatedToken";function I3e(t){return Dr.isInstance(t,jf)}const Kf="RegexToken";function O3e(t){return Dr.isInstance(t,Kf)}const Zf="RuleCall";function xu(t){return Dr.isInstance(t,Zf)}const Qf="TerminalAlternatives";function P3e(t){return Dr.isInstance(t,Qf)}const Jf="TerminalGroup";function B3e(t){return Dr.isInstance(t,Jf)}const e0="TerminalRuleCall";function F3e(t){return Dr.isInstance(t,e0)}const t0="UnorderedGroup";function EG(t){return Dr.isInstance(t,t0)}const r0="UntilToken";function $3e(t){return Dr.isInstance(t,r0)}const n0="Wildcard";function z3e(t){return Dr.isInstance(t,n0)}class kG extends gG{getAllTypes(){return[Rf,o1,l1,Vf,Gf,c1,u1,Uf,Nf,Wf,r3,Df,Hf,Mf,qf,h1,i3,Yf,If,Of,Xf,a3,jf,Pf,d1,f1,Bf,Ff,p1,Kf,dm,Zf,$f,g1,Qf,Jf,hh,e0,zf,s3,f9,m1,t0,r0,n3,n0]}computeIsSubtype(e,r){switch(e){case Vf:case Gf:case Uf:case Wf:case Hf:case qf:case Yf:case Xf:case jf:case Kf:case Zf:case Qf:case Jf:case e0:case t0:case r0:case n0:return this.isSubtype(Rf,r);case c1:case d1:case g1:return this.isSubtype(n3,r);case u1:case p1:case $f:case m1:return this.isSubtype(f9,r);case Nf:return this.isSubtype(r3,r)||this.isSubtype(n3,r);case Df:case Mf:case Pf:case Bf:return this.isSubtype(r3,r);case If:case Of:case zf:return this.isSubtype(l1,r);case Ff:return this.isSubtype(o1,r)||this.isSubtype(l1,r);case hh:return this.isSubtype(o1,r);default:return!1}}getReferenceType(e){const r=`${e.container.$type}:${e.property}`;switch(r){case"Action:type":case"CrossReference:type":case"Interface:superTypes":case"ParserRule:returnType":case"SimpleType:typeRef":return l1;case"Grammar:hiddenTokens":case"ParserRule:hiddenTokens":case"RuleCall:rule":return o1;case"Grammar:usedGrammars":return h1;case"NamedArgument:parameter":case"ParameterReference:parameter":return f1;case"TerminalRuleCall:rule":return hh;default:throw new Error(`${r} is not a valid reference id.`)}}getTypeMetaData(e){switch(e){case Rf:return{name:Rf,properties:[{name:"cardinality"},{name:"lookahead"}]};case c1:return{name:c1,properties:[{name:"elements",defaultValue:[]}]};case u1:return{name:u1,properties:[{name:"elementType"}]};case Nf:return{name:Nf,properties:[{name:"true",defaultValue:!1}]};case Df:return{name:Df,properties:[{name:"left"},{name:"right"}]};case Mf:return{name:Mf,properties:[{name:"left"},{name:"right"}]};case h1:return{name:h1,properties:[{name:"definesHiddenTokens",defaultValue:!1},{name:"hiddenTokens",defaultValue:[]},{name:"imports",defaultValue:[]},{name:"interfaces",defaultValue:[]},{name:"isDeclared",defaultValue:!1},{name:"name"},{name:"rules",defaultValue:[]},{name:"types",defaultValue:[]},{name:"usedGrammars",defaultValue:[]}]};case i3:return{name:i3,properties:[{name:"path"}]};case If:return{name:If,properties:[{name:"name"}]};case Of:return{name:Of,properties:[{name:"attributes",defaultValue:[]},{name:"name"},{name:"superTypes",defaultValue:[]}]};case a3:return{name:a3,properties:[{name:"calledByName",defaultValue:!1},{name:"parameter"},{name:"value"}]};case Pf:return{name:Pf,properties:[{name:"value"}]};case d1:return{name:d1,properties:[{name:"value"}]};case f1:return{name:f1,properties:[{name:"name"}]};case Bf:return{name:Bf,properties:[{name:"parameter"}]};case Ff:return{name:Ff,properties:[{name:"dataType"},{name:"definesHiddenTokens",defaultValue:!1},{name:"definition"},{name:"entry",defaultValue:!1},{name:"fragment",defaultValue:!1},{name:"hiddenTokens",defaultValue:[]},{name:"inferredType"},{name:"name"},{name:"parameters",defaultValue:[]},{name:"returnType"},{name:"wildcard",defaultValue:!1}]};case p1:return{name:p1,properties:[{name:"referenceType"}]};case dm:return{name:dm,properties:[{name:"name"}]};case $f:return{name:$f,properties:[{name:"primitiveType"},{name:"stringType"},{name:"typeRef"}]};case g1:return{name:g1,properties:[{name:"value"}]};case hh:return{name:hh,properties:[{name:"definition"},{name:"fragment",defaultValue:!1},{name:"hidden",defaultValue:!1},{name:"name"},{name:"type"}]};case zf:return{name:zf,properties:[{name:"name"},{name:"type"}]};case s3:return{name:s3,properties:[{name:"defaultValue"},{name:"isOptional",defaultValue:!1},{name:"name"},{name:"type"}]};case m1:return{name:m1,properties:[{name:"types",defaultValue:[]}]};case Vf:return{name:Vf,properties:[{name:"cardinality"},{name:"feature"},{name:"inferredType"},{name:"lookahead"},{name:"operator"},{name:"type"}]};case Gf:return{name:Gf,properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"lookahead"}]};case Uf:return{name:Uf,properties:[{name:"cardinality"},{name:"feature"},{name:"lookahead"},{name:"operator"},{name:"terminal"}]};case Wf:return{name:Wf,properties:[{name:"cardinality"},{name:"left"},{name:"lookahead"},{name:"right"}]};case Hf:return{name:Hf,properties:[{name:"cardinality"},{name:"deprecatedSyntax",defaultValue:!1},{name:"lookahead"},{name:"terminal"},{name:"type"}]};case qf:return{name:qf,properties:[{name:"cardinality"},{name:"lookahead"}]};case Yf:return{name:Yf,properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"guardCondition"},{name:"lookahead"}]};case Xf:return{name:Xf,properties:[{name:"cardinality"},{name:"lookahead"},{name:"value"}]};case jf:return{name:jf,properties:[{name:"cardinality"},{name:"lookahead"},{name:"terminal"}]};case Kf:return{name:Kf,properties:[{name:"cardinality"},{name:"lookahead"},{name:"regex"}]};case Zf:return{name:Zf,properties:[{name:"arguments",defaultValue:[]},{name:"cardinality"},{name:"lookahead"},{name:"rule"}]};case Qf:return{name:Qf,properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"lookahead"}]};case Jf:return{name:Jf,properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"lookahead"}]};case e0:return{name:e0,properties:[{name:"cardinality"},{name:"lookahead"},{name:"rule"}]};case t0:return{name:t0,properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"lookahead"}]};case r0:return{name:r0,properties:[{name:"cardinality"},{name:"lookahead"},{name:"terminal"}]};case n0:return{name:n0,properties:[{name:"cardinality"},{name:"lookahead"}]};default:return{name:e,properties:[]}}}}const Dr=new kG;function V3e(t){for(const[e,r]of Object.entries(t))e.startsWith("$")||(Array.isArray(r)?r.forEach((n,i)=>{Ei(n)&&(n.$container=t,n.$containerProperty=e,n.$containerIndex=i)}):Ei(r)&&(r.$container=t,r.$containerProperty=e))}function Y2(t,e){let r=t;for(;r;){if(e(r))return r;r=r.$container}}function Yl(t){const r=Nw(t).$document;if(!r)throw new Error("AST node has no document.");return r}function Nw(t){for(;t.$container;)t=t.$container;return t}function Tk(t,e){if(!t)throw new Error("Node must be an AstNode.");const r=e?.range;return new ai(()=>({keys:Object.keys(t),keyIndex:0,arrayIndex:0}),n=>{for(;n.keyIndex<n.keys.length;){const i=n.keys[n.keyIndex];if(!i.startsWith("$")){const a=t[i];if(Ei(a)){if(n.keyIndex++,p9(a,r))return{done:!1,value:a}}else if(Array.isArray(a)){for(;n.arrayIndex<a.length;){const s=n.arrayIndex++,o=a[s];if(Ei(o)&&p9(o,r))return{done:!1,value:o}}n.arrayIndex=0}}n.keyIndex++}return wa})}function cg(t,e){if(!t)throw new Error("Root node must be an AstNode.");return new xk(t,r=>Tk(r,e))}function Ph(t,e){if(!t)throw new Error("Root node must be an AstNode.");return new xk(t,r=>Tk(r,e),{includeRoot:!0})}function p9(t,e){var r;if(!e)return!0;const n=(r=t.$cstNode)===null||r===void 0?void 0:r.range;return n?b3e(n,e):!1}function SG(t){return new ai(()=>({keys:Object.keys(t),keyIndex:0,arrayIndex:0}),e=>{for(;e.keyIndex<e.keys.length;){const r=e.keys[e.keyIndex];if(!r.startsWith("$")){const n=t[r];if(Hs(n))return e.keyIndex++,{done:!1,value:{reference:n,container:t,property:r}};if(Array.isArray(n)){for(;e.arrayIndex<n.length;){const i=e.arrayIndex++,a=n[i];if(Hs(a))return{done:!1,value:{reference:a,container:t,property:r,index:i}}}e.arrayIndex=0}}e.keyIndex++}return wa})}function G3e(t,e){const r=t.getTypeMetaData(e.$type),n=e;for(const i of r.properties)i.defaultValue!==void 0&&n[i.name]===void 0&&(n[i.name]=CG(i.defaultValue))}function CG(t){return Array.isArray(t)?[...t.map(CG)]:t}function Yt(t){return t.charCodeAt(0)}function o3(t,e){Array.isArray(t)?t.forEach(function(r){e.push(r)}):e.push(t)}function df(t,e){if(t[e]===!0)throw"duplicate flag "+e;t[e],t[e]=!0}function ih(t){if(t===void 0)throw Error("Internal Error - Should never get here!");return!0}function U3e(){throw Error("Internal Error - Should never get here!")}function g9(t){return t.type==="Character"}const Qv=[];for(let t=Yt("0");t<=Yt("9");t++)Qv.push(t);const Jv=[Yt("_")].concat(Qv);for(let t=Yt("a");t<=Yt("z");t++)Jv.push(t);for(let t=Yt("A");t<=Yt("Z");t++)Jv.push(t);const m9=[Yt(" "),Yt("\f"),Yt(`
`),Yt("\r"),Yt("	"),Yt("\v"),Yt("	"),Yt(" "),Yt(" "),Yt(" "),Yt(" "),Yt(" "),Yt(" "),Yt(" "),Yt(" "),Yt(" "),Yt(" "),Yt(" "),Yt(" "),Yt(" "),Yt("\u2028"),Yt("\u2029"),Yt(" "),Yt(" "),Yt("　"),Yt("\uFEFF")],W3e=/[0-9a-fA-F]/,v1=/[0-9]/,H3e=/[1-9]/;class AG{constructor(){this.idx=0,this.input="",this.groupIdx=0}saveState(){return{idx:this.idx,input:this.input,groupIdx:this.groupIdx}}restoreState(e){this.idx=e.idx,this.input=e.input,this.groupIdx=e.groupIdx}pattern(e){this.idx=0,this.input=e,this.groupIdx=0,this.consumeChar("/");const r=this.disjunction();this.consumeChar("/");const n={type:"Flags",loc:{begin:this.idx,end:e.length},global:!1,ignoreCase:!1,multiLine:!1,unicode:!1,sticky:!1};for(;this.isRegExpFlag();)switch(this.popChar()){case"g":df(n,"global");break;case"i":df(n,"ignoreCase");break;case"m":df(n,"multiLine");break;case"u":df(n,"unicode");break;case"y":df(n,"sticky");break}if(this.idx!==this.input.length)throw Error("Redundant input: "+this.input.substring(this.idx));return{type:"Pattern",flags:n,value:r,loc:this.loc(0)}}disjunction(){const e=[],r=this.idx;for(e.push(this.alternative());this.peekChar()==="|";)this.consumeChar("|"),e.push(this.alternative());return{type:"Disjunction",value:e,loc:this.loc(r)}}alternative(){const e=[],r=this.idx;for(;this.isTerm();)e.push(this.term());return{type:"Alternative",value:e,loc:this.loc(r)}}term(){return this.isAssertion()?this.assertion():this.atom()}assertion(){const e=this.idx;switch(this.popChar()){case"^":return{type:"StartAnchor",loc:this.loc(e)};case"$":return{type:"EndAnchor",loc:this.loc(e)};case"\\":switch(this.popChar()){case"b":return{type:"WordBoundary",loc:this.loc(e)};case"B":return{type:"NonWordBoundary",loc:this.loc(e)}}throw Error("Invalid Assertion Escape");case"(":this.consumeChar("?");let r;switch(this.popChar()){case"=":r="Lookahead";break;case"!":r="NegativeLookahead";break}ih(r);const n=this.disjunction();return this.consumeChar(")"),{type:r,value:n,loc:this.loc(e)}}return U3e()}quantifier(e=!1){let r;const n=this.idx;switch(this.popChar()){case"*":r={atLeast:0,atMost:1/0};break;case"+":r={atLeast:1,atMost:1/0};break;case"?":r={atLeast:0,atMost:1};break;case"{":const i=this.integerIncludingZero();switch(this.popChar()){case"}":r={atLeast:i,atMost:i};break;case",":let a;this.isDigit()?(a=this.integerIncludingZero(),r={atLeast:i,atMost:a}):r={atLeast:i,atMost:1/0},this.consumeChar("}");break}if(e===!0&&r===void 0)return;ih(r);break}if(!(e===!0&&r===void 0)&&ih(r))return this.peekChar(0)==="?"?(this.consumeChar("?"),r.greedy=!1):r.greedy=!0,r.type="Quantifier",r.loc=this.loc(n),r}atom(){let e;const r=this.idx;switch(this.peekChar()){case".":e=this.dotAll();break;case"\\":e=this.atomEscape();break;case"[":e=this.characterClass();break;case"(":e=this.group();break}if(e===void 0&&this.isPatternCharacter()&&(e=this.patternCharacter()),ih(e))return e.loc=this.loc(r),this.isQuantifier()&&(e.quantifier=this.quantifier()),e}dotAll(){return this.consumeChar("."),{type:"Set",complement:!0,value:[Yt(`
`),Yt("\r"),Yt("\u2028"),Yt("\u2029")]}}atomEscape(){switch(this.consumeChar("\\"),this.peekChar()){case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return this.decimalEscapeAtom();case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}}decimalEscapeAtom(){return{type:"GroupBackReference",value:this.positiveInteger()}}characterClassEscape(){let e,r=!1;switch(this.popChar()){case"d":e=Qv;break;case"D":e=Qv,r=!0;break;case"s":e=m9;break;case"S":e=m9,r=!0;break;case"w":e=Jv;break;case"W":e=Jv,r=!0;break}if(ih(e))return{type:"Set",value:e,complement:r}}controlEscapeAtom(){let e;switch(this.popChar()){case"f":e=Yt("\f");break;case"n":e=Yt(`
`);break;case"r":e=Yt("\r");break;case"t":e=Yt("	");break;case"v":e=Yt("\v");break}if(ih(e))return{type:"Character",value:e}}controlLetterEscapeAtom(){this.consumeChar("c");const e=this.popChar();if(/[a-zA-Z]/.test(e)===!1)throw Error("Invalid ");return{type:"Character",value:e.toUpperCase().charCodeAt(0)-64}}nulCharacterAtom(){return this.consumeChar("0"),{type:"Character",value:Yt("\0")}}hexEscapeSequenceAtom(){return this.consumeChar("x"),this.parseHexDigits(2)}regExpUnicodeEscapeSequenceAtom(){return this.consumeChar("u"),this.parseHexDigits(4)}identityEscapeAtom(){const e=this.popChar();return{type:"Character",value:Yt(e)}}classPatternCharacterAtom(){switch(this.peekChar()){case`
`:case"\r":case"\u2028":case"\u2029":case"\\":case"]":throw Error("TBD");default:const e=this.popChar();return{type:"Character",value:Yt(e)}}}characterClass(){const e=[];let r=!1;for(this.consumeChar("["),this.peekChar(0)==="^"&&(this.consumeChar("^"),r=!0);this.isClassAtom();){const n=this.classAtom();if(n.type,g9(n)&&this.isRangeDash()){this.consumeChar("-");const i=this.classAtom();if(i.type,g9(i)){if(i.value<n.value)throw Error("Range out of order in character class");e.push({from:n.value,to:i.value})}else o3(n.value,e),e.push(Yt("-")),o3(i.value,e)}else o3(n.value,e)}return this.consumeChar("]"),{type:"Set",complement:r,value:e}}classAtom(){switch(this.peekChar()){case"]":case`
`:case"\r":case"\u2028":case"\u2029":throw Error("TBD");case"\\":return this.classEscape();default:return this.classPatternCharacterAtom()}}classEscape(){switch(this.consumeChar("\\"),this.peekChar()){case"b":return this.consumeChar("b"),{type:"Character",value:Yt("\b")};case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}}group(){let e=!0;switch(this.consumeChar("("),this.peekChar(0)){case"?":this.consumeChar("?"),this.consumeChar(":"),e=!1;break;default:this.groupIdx++;break}const r=this.disjunction();this.consumeChar(")");const n={type:"Group",capturing:e,value:r};return e&&(n.idx=this.groupIdx),n}positiveInteger(){let e=this.popChar();if(H3e.test(e)===!1)throw Error("Expecting a positive integer");for(;v1.test(this.peekChar(0));)e+=this.popChar();return parseInt(e,10)}integerIncludingZero(){let e=this.popChar();if(v1.test(e)===!1)throw Error("Expecting an integer");for(;v1.test(this.peekChar(0));)e+=this.popChar();return parseInt(e,10)}patternCharacter(){const e=this.popChar();switch(e){case`
`:case"\r":case"\u2028":case"\u2029":case"^":case"$":case"\\":case".":case"*":case"+":case"?":case"(":case")":case"[":case"|":throw Error("TBD");default:return{type:"Character",value:Yt(e)}}}isRegExpFlag(){switch(this.peekChar(0)){case"g":case"i":case"m":case"u":case"y":return!0;default:return!1}}isRangeDash(){return this.peekChar()==="-"&&this.isClassAtom(1)}isDigit(){return v1.test(this.peekChar(0))}isClassAtom(e=0){switch(this.peekChar(e)){case"]":case`
`:case"\r":case"\u2028":case"\u2029":return!1;default:return!0}}isTerm(){return this.isAtom()||this.isAssertion()}isAtom(){if(this.isPatternCharacter())return!0;switch(this.peekChar(0)){case".":case"\\":case"[":case"(":return!0;default:return!1}}isAssertion(){switch(this.peekChar(0)){case"^":case"$":return!0;case"\\":switch(this.peekChar(1)){case"b":case"B":return!0;default:return!1}case"(":return this.peekChar(1)==="?"&&(this.peekChar(2)==="="||this.peekChar(2)==="!");default:return!1}}isQuantifier(){const e=this.saveState();try{return this.quantifier(!0)!==void 0}catch{return!1}finally{this.restoreState(e)}}isPatternCharacter(){switch(this.peekChar()){case"^":case"$":case"\\":case".":case"*":case"+":case"?":case"(":case")":case"[":case"|":case"/":case`
`:case"\r":case"\u2028":case"\u2029":return!1;default:return!0}}parseHexDigits(e){let r="";for(let i=0;i<e;i++){const a=this.popChar();if(W3e.test(a)===!1)throw Error("Expecting a HexDecimal digits");r+=a}return{type:"Character",value:parseInt(r,16)}}peekChar(e=0){return this.input[this.idx+e]}popChar(){const e=this.peekChar(0);return this.consumeChar(void 0),e}consumeChar(e){if(e!==void 0&&this.input[this.idx]!==e)throw Error("Expected: '"+e+"' but found: '"+this.input[this.idx]+"' at offset: "+this.idx);if(this.idx>=this.input.length)throw Error("Unexpected end of input");this.idx++}loc(e){return{begin:e,end:this.idx}}}class X2{visitChildren(e){for(const r in e){const n=e[r];e.hasOwnProperty(r)&&(n.type!==void 0?this.visit(n):Array.isArray(n)&&n.forEach(i=>{this.visit(i)},this))}}visit(e){switch(e.type){case"Pattern":this.visitPattern(e);break;case"Flags":this.visitFlags(e);break;case"Disjunction":this.visitDisjunction(e);break;case"Alternative":this.visitAlternative(e);break;case"StartAnchor":this.visitStartAnchor(e);break;case"EndAnchor":this.visitEndAnchor(e);break;case"WordBoundary":this.visitWordBoundary(e);break;case"NonWordBoundary":this.visitNonWordBoundary(e);break;case"Lookahead":this.visitLookahead(e);break;case"NegativeLookahead":this.visitNegativeLookahead(e);break;case"Character":this.visitCharacter(e);break;case"Set":this.visitSet(e);break;case"Group":this.visitGroup(e);break;case"GroupBackReference":this.visitGroupBackReference(e);break;case"Quantifier":this.visitQuantifier(e);break}this.visitChildren(e)}visitPattern(e){}visitFlags(e){}visitDisjunction(e){}visitAlternative(e){}visitStartAnchor(e){}visitEndAnchor(e){}visitWordBoundary(e){}visitNonWordBoundary(e){}visitLookahead(e){}visitNegativeLookahead(e){}visitCharacter(e){}visitSet(e){}visitGroup(e){}visitGroupBackReference(e){}visitQuantifier(e){}}const q3e=/\r?\n/gm,Y3e=new AG;class X3e extends X2{constructor(){super(...arguments),this.isStarting=!0,this.endRegexpStack=[],this.multiline=!1}get endRegex(){return this.endRegexpStack.join("")}reset(e){this.multiline=!1,this.regex=e,this.startRegexp="",this.isStarting=!0,this.endRegexpStack=[]}visitGroup(e){e.quantifier&&(this.isStarting=!1,this.endRegexpStack=[])}visitCharacter(e){const r=String.fromCharCode(e.value);if(!this.multiline&&r===`
`&&(this.multiline=!0),e.quantifier)this.isStarting=!1,this.endRegexpStack=[];else{const n=j2(r);this.endRegexpStack.push(n),this.isStarting&&(this.startRegexp+=n)}}visitSet(e){if(!this.multiline){const r=this.regex.substring(e.loc.begin,e.loc.end),n=new RegExp(r);this.multiline=!!`
`.match(n)}if(e.quantifier)this.isStarting=!1,this.endRegexpStack=[];else{const r=this.regex.substring(e.loc.begin,e.loc.end);this.endRegexpStack.push(r),this.isStarting&&(this.startRegexp+=r)}}visitChildren(e){e.type==="Group"&&e.quantifier||super.visitChildren(e)}}const l3=new X3e;function j3e(t){try{return typeof t=="string"&&(t=new RegExp(t)),t=t.toString(),l3.reset(t),l3.visit(Y3e.pattern(t)),l3.multiline}catch{return!1}}const K3e=`\f
\r	\v              \u2028\u2029  　\uFEFF`.split("");function Dw(t){const e=typeof t=="string"?new RegExp(t):t;return K3e.some(r=>e.test(r))}function j2(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Z3e(t){return Array.prototype.map.call(t,e=>/\w/.test(e)?`[${e.toLowerCase()}${e.toUpperCase()}]`:j2(e)).join("")}function Q3e(t,e){const r=J3e(t),n=e.match(r);return!!n&&n[0].length>0}function J3e(t){typeof t=="string"&&(t=new RegExp(t));const e=t,r=t.source;let n=0;function i(){let a="",s;function o(u){a+=r.substr(n,u),n+=u}function l(u){a+="(?:"+r.substr(n,u)+"|$)",n+=u}for(;n<r.length;)switch(r[n]){case"\\":switch(r[n+1]){case"c":l(3);break;case"x":l(4);break;case"u":e.unicode?r[n+2]==="{"?l(r.indexOf("}",n)-n+1):l(6):l(2);break;case"p":case"P":e.unicode?l(r.indexOf("}",n)-n+1):l(2);break;case"k":l(r.indexOf(">",n)-n+1);break;default:l(2);break}break;case"[":s=/\[(?:\\.|.)*?\]/g,s.lastIndex=n,s=s.exec(r)||[],l(s[0].length);break;case"|":case"^":case"$":case"*":case"+":case"?":o(1);break;case"{":s=/\{\d+,?\d*\}/g,s.lastIndex=n,s=s.exec(r),s?o(s[0].length):l(1);break;case"(":if(r[n+1]==="?")switch(r[n+2]){case":":a+="(?:",n+=3,a+=i()+"|$)";break;case"=":a+="(?=",n+=3,a+=i()+")";break;case"!":s=n,n+=3,i(),a+=r.substr(s,n-s);break;case"<":switch(r[n+3]){case"=":case"!":s=n,n+=4,i(),a+=r.substr(s,n-s);break;default:o(r.indexOf(">",n)-n+1),a+=i()+"|$)";break}break}else o(1),a+=i()+"|$)";break;case")":return++n,a;default:l(1);break}return a}return new RegExp(i(),t.flags)}function e5e(t){return t.rules.find(e=>ns(e)&&e.entry)}function t5e(t){return t.rules.filter(e=>$u(e)&&e.hidden)}function _G(t,e){const r=new Set,n=e5e(t);if(!n)return new Set(t.rules);const i=[n].concat(t5e(t));for(const s of i)LG(s,r,e);const a=new Set;for(const s of t.rules)(r.has(s.name)||$u(s)&&s.hidden)&&a.add(s);return a}function LG(t,e,r){e.add(t.name),cg(t).forEach(n=>{if(xu(n)||r){const i=n.rule.ref;i&&!e.has(i.name)&&LG(i,e,r)}})}function r5e(t){if(t.terminal)return t.terminal;if(t.type.ref){const e=NG(t.type.ref);return e?.terminal}}function n5e(t){return t.hidden&&!Dw(Ck(t))}function i5e(t,e){return!t||!e?[]:Ek(t,e,t.astNode,!0)}function RG(t,e,r){if(!t||!e)return;const n=Ek(t,e,t.astNode,!0);if(n.length!==0)return r!==void 0?r=Math.max(0,Math.min(r,n.length-1)):r=0,n[r]}function Ek(t,e,r,n){if(!n){const i=Y2(t.grammarSource,vu);if(i&&i.feature===e)return[t]}return pp(t)&&t.astNode===r?t.content.flatMap(i=>Ek(i,e,r,!1)):[]}function a5e(t,e,r){if(!t)return;const n=s5e(t,e,t?.astNode);if(n.length!==0)return r!==void 0?r=Math.max(0,Math.min(r,n.length-1)):r=0,n[r]}function s5e(t,e,r){if(t.astNode!==r)return[];if(yu(t.grammarSource)&&t.grammarSource.value===e)return[t];const n=Lw(t).iterator();let i;const a=[];do if(i=n.next(),!i.done){const s=i.value;s.astNode===r?yu(s.grammarSource)&&s.grammarSource.value===e&&a.push(s):n.prune()}while(!i.done);return a}function o5e(t){var e;const r=t.astNode;for(;r===((e=t.container)===null||e===void 0?void 0:e.astNode);){const n=Y2(t.grammarSource,vu);if(n)return n;t=t.container}}function NG(t){let e=t;return xG(e)&&(q2(e.$container)?e=e.$container.$container:ns(e.$container)?e=e.$container:lg(e.$container)),DG(t,e,new Map)}function DG(t,e,r){var n;function i(a,s){let o;return Y2(a,vu)||(o=DG(s,s,r)),r.set(t,o),o}if(r.has(t))return r.get(t);r.set(t,void 0);for(const a of cg(e)){if(vu(a)&&a.feature.toLowerCase()==="name")return r.set(t,a),a;if(xu(a)&&ns(a.rule.ref))return i(a,a.rule.ref);if(N3e(a)&&(!((n=a.typeRef)===null||n===void 0)&&n.ref))return i(a,a.typeRef.ref)}}function MG(t){return IG(t,new Set)}function IG(t,e){if(e.has(t))return!0;e.add(t);for(const r of cg(t))if(xu(r)){if(!r.rule.ref||ns(r.rule.ref)&&!IG(r.rule.ref,e))return!1}else{if(vu(r))return!1;if(q2(r))return!1}return!!t.definition}function kk(t){if(t.inferredType)return t.inferredType.name;if(t.dataType)return t.dataType;if(t.returnType){const e=t.returnType.ref;if(e){if(ns(e))return e.name;if(bG(e)||wG(e))return e.name}}}function Sk(t){var e;if(ns(t))return MG(t)?t.name:(e=kk(t))!==null&&e!==void 0?e:t.name;if(bG(t)||wG(t)||R3e(t))return t.name;if(q2(t)){const r=l5e(t);if(r)return r}else if(xG(t))return t.name;throw new Error("Cannot get name of Unknown Type")}function l5e(t){var e;if(t.inferredType)return t.inferredType.name;if(!((e=t.type)===null||e===void 0)&&e.ref)return Sk(t.type.ref)}function c5e(t){var e,r,n;return $u(t)?(r=(e=t.type)===null||e===void 0?void 0:e.name)!==null&&r!==void 0?r:"string":(n=kk(t))!==null&&n!==void 0?n:t.name}function Ck(t){const e={s:!1,i:!1,u:!1},r=Bd(t.definition,e),n=Object.entries(e).filter(([,i])=>i).map(([i])=>i).join("");return new RegExp(r,n)}const Ak=/[\s\S]/.source;function Bd(t,e){if(P3e(t))return u5e(t);if(B3e(t))return h5e(t);if(D3e(t))return p5e(t);if(F3e(t)){const r=t.rule.ref;if(!r)throw new Error("Missing rule reference.");return zo(Bd(r.definition),{cardinality:t.cardinality,lookahead:t.lookahead})}else{if(I3e(t))return f5e(t);if($3e(t))return d5e(t);if(O3e(t)){const r=t.regex.lastIndexOf("/"),n=t.regex.substring(1,r),i=t.regex.substring(r+1);return e&&(e.i=i.includes("i"),e.s=i.includes("s"),e.u=i.includes("u")),zo(n,{cardinality:t.cardinality,lookahead:t.lookahead,wrap:!1})}else{if(z3e(t))return zo(Ak,{cardinality:t.cardinality,lookahead:t.lookahead});throw new Error(`Invalid terminal element: ${t?.$type}`)}}}function u5e(t){return zo(t.elements.map(e=>Bd(e)).join("|"),{cardinality:t.cardinality,lookahead:t.lookahead})}function h5e(t){return zo(t.elements.map(e=>Bd(e)).join(""),{cardinality:t.cardinality,lookahead:t.lookahead})}function d5e(t){return zo(`${Ak}*?${Bd(t.terminal)}`,{cardinality:t.cardinality,lookahead:t.lookahead})}function f5e(t){return zo(`(?!${Bd(t.terminal)})${Ak}*?`,{cardinality:t.cardinality,lookahead:t.lookahead})}function p5e(t){return t.right?zo(`[${c3(t.left)}-${c3(t.right)}]`,{cardinality:t.cardinality,lookahead:t.lookahead,wrap:!1}):zo(c3(t.left),{cardinality:t.cardinality,lookahead:t.lookahead,wrap:!1})}function c3(t){return j2(t.value)}function zo(t,e){var r;return(e.wrap!==!1||e.lookahead)&&(t=`(${(r=e.lookahead)!==null&&r!==void 0?r:""}${t})`),e.cardinality?`${t}${e.cardinality}`:t}function g5e(t){const e=[],r=t.Grammar;for(const n of r.rules)$u(n)&&n5e(n)&&j3e(Ck(n))&&e.push(n.name);return{multilineCommentRules:e,nameRegexp:w3e}}function Mw(t){console&&console.error&&console.error(`Error: ${t}`)}function OG(t){console&&console.warn&&console.warn(`Warning: ${t}`)}function PG(t){const e=new Date().getTime(),r=t();return{time:new Date().getTime()-e,value:r}}function BG(t){function e(){}e.prototype=t;const r=new e;function n(){return typeof r.bar}return n(),n(),t}function m5e(t){return v5e(t)?t.LABEL:t.name}function v5e(t){return da(t.LABEL)&&t.LABEL!==""}class uo{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){this._definition=e}accept(e){e.visit(this),Ie(this.definition,r=>{r.accept(e)})}}class Yi extends uo{constructor(e){super([]),this.idx=1,La(this,Cs(e,r=>r!==void 0))}set definition(e){}get definition(){return this.referencedRule!==void 0?this.referencedRule.definition:[]}accept(e){e.visit(this)}}class Fd extends uo{constructor(e){super(e.definition),this.orgText="",La(this,Cs(e,r=>r!==void 0))}}class fa extends uo{constructor(e){super(e.definition),this.ignoreAmbiguities=!1,La(this,Cs(e,r=>r!==void 0))}}let ui=class extends uo{constructor(e){super(e.definition),this.idx=1,La(this,Cs(e,r=>r!==void 0))}};class Ma extends uo{constructor(e){super(e.definition),this.idx=1,La(this,Cs(e,r=>r!==void 0))}}class Ia extends uo{constructor(e){super(e.definition),this.idx=1,La(this,Cs(e,r=>r!==void 0))}}class on extends uo{constructor(e){super(e.definition),this.idx=1,La(this,Cs(e,r=>r!==void 0))}}class va extends uo{constructor(e){super(e.definition),this.idx=1,La(this,Cs(e,r=>r!==void 0))}}class ya extends uo{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){super(e.definition),this.idx=1,this.ignoreAmbiguities=!1,this.hasPredicates=!1,La(this,Cs(e,r=>r!==void 0))}}class qr{constructor(e){this.idx=1,La(this,Cs(e,r=>r!==void 0))}accept(e){e.visit(this)}}function y5e(t){return ft(t,fm)}function fm(t){function e(r){return ft(r,fm)}if(t instanceof Yi){const r={type:"NonTerminal",name:t.nonTerminalName,idx:t.idx};return da(t.label)&&(r.label=t.label),r}else{if(t instanceof fa)return{type:"Alternative",definition:e(t.definition)};if(t instanceof ui)return{type:"Option",idx:t.idx,definition:e(t.definition)};if(t instanceof Ma)return{type:"RepetitionMandatory",idx:t.idx,definition:e(t.definition)};if(t instanceof Ia)return{type:"RepetitionMandatoryWithSeparator",idx:t.idx,separator:fm(new qr({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof va)return{type:"RepetitionWithSeparator",idx:t.idx,separator:fm(new qr({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof on)return{type:"Repetition",idx:t.idx,definition:e(t.definition)};if(t instanceof ya)return{type:"Alternation",idx:t.idx,definition:e(t.definition)};if(t instanceof qr){const r={type:"Terminal",name:t.terminalType.name,label:m5e(t.terminalType),idx:t.idx};da(t.label)&&(r.terminalLabel=t.label);const n=t.terminalType.PATTERN;return t.terminalType.PATTERN&&(r.pattern=Ko(n)?n.source:n),r}else{if(t instanceof Fd)return{type:"Rule",name:t.name,orgText:t.orgText,definition:e(t.definition)};throw Error("non exhaustive match")}}}class $d{visit(e){const r=e;switch(r.constructor){case Yi:return this.visitNonTerminal(r);case fa:return this.visitAlternative(r);case ui:return this.visitOption(r);case Ma:return this.visitRepetitionMandatory(r);case Ia:return this.visitRepetitionMandatoryWithSeparator(r);case va:return this.visitRepetitionWithSeparator(r);case on:return this.visitRepetition(r);case ya:return this.visitAlternation(r);case qr:return this.visitTerminal(r);case Fd:return this.visitRule(r);default:throw Error("non exhaustive match")}}visitNonTerminal(e){}visitAlternative(e){}visitOption(e){}visitRepetition(e){}visitRepetitionMandatory(e){}visitRepetitionMandatoryWithSeparator(e){}visitRepetitionWithSeparator(e){}visitAlternation(e){}visitTerminal(e){}visitRule(e){}}function x5e(t){return t instanceof fa||t instanceof ui||t instanceof on||t instanceof Ma||t instanceof Ia||t instanceof va||t instanceof qr||t instanceof Fd}function ey(t,e=[]){return t instanceof ui||t instanceof on||t instanceof va?!0:t instanceof ya?O$(t.definition,n=>ey(n,e)):t instanceof Yi&&Zi(e,t)?!1:t instanceof uo?(t instanceof Yi&&e.push(t),vs(t.definition,n=>ey(n,e))):!1}function b5e(t){return t instanceof ya}function zs(t){if(t instanceof Yi)return"SUBRULE";if(t instanceof ui)return"OPTION";if(t instanceof ya)return"OR";if(t instanceof Ma)return"AT_LEAST_ONE";if(t instanceof Ia)return"AT_LEAST_ONE_SEP";if(t instanceof va)return"MANY_SEP";if(t instanceof on)return"MANY";if(t instanceof qr)return"CONSUME";throw Error("non exhaustive match")}class K2{walk(e,r=[]){Ie(e.definition,(n,i)=>{const a=ni(e.definition,i+1);if(n instanceof Yi)this.walkProdRef(n,a,r);else if(n instanceof qr)this.walkTerminal(n,a,r);else if(n instanceof fa)this.walkFlat(n,a,r);else if(n instanceof ui)this.walkOption(n,a,r);else if(n instanceof Ma)this.walkAtLeastOne(n,a,r);else if(n instanceof Ia)this.walkAtLeastOneSep(n,a,r);else if(n instanceof va)this.walkManySep(n,a,r);else if(n instanceof on)this.walkMany(n,a,r);else if(n instanceof ya)this.walkOr(n,a,r);else throw Error("non exhaustive match")})}walkTerminal(e,r,n){}walkProdRef(e,r,n){}walkFlat(e,r,n){const i=r.concat(n);this.walk(e,i)}walkOption(e,r,n){const i=r.concat(n);this.walk(e,i)}walkAtLeastOne(e,r,n){const i=[new ui({definition:e.definition})].concat(r,n);this.walk(e,i)}walkAtLeastOneSep(e,r,n){const i=v9(e,r,n);this.walk(e,i)}walkMany(e,r,n){const i=[new ui({definition:e.definition})].concat(r,n);this.walk(e,i)}walkManySep(e,r,n){const i=v9(e,r,n);this.walk(e,i)}walkOr(e,r,n){const i=r.concat(n);Ie(e.definition,a=>{const s=new fa({definition:[a]});this.walk(s,i)})}}function v9(t,e,r){return[new ui({definition:[new qr({terminalType:t.separator})].concat(t.definition)})].concat(e,r)}function ug(t){if(t instanceof Yi)return ug(t.referencedRule);if(t instanceof qr)return E5e(t);if(x5e(t))return w5e(t);if(b5e(t))return T5e(t);throw Error("non exhaustive match")}function w5e(t){let e=[];const r=t.definition;let n=0,i=r.length>n,a,s=!0;for(;i&&s;)a=r[n],s=ey(a),e=e.concat(ug(a)),n=n+1,i=r.length>n;return OE(e)}function T5e(t){const e=ft(t.definition,r=>ug(r));return OE(Xn(e))}function E5e(t){return[t.terminalType]}const FG="_~IN~_";class k5e extends K2{constructor(e){super(),this.topProd=e,this.follows={}}startWalking(){return this.walk(this.topProd),this.follows}walkTerminal(e,r,n){}walkProdRef(e,r,n){const i=C5e(e.referencedRule,e.idx)+this.topProd.name,a=r.concat(n),s=new fa({definition:a}),o=ug(s);this.follows[i]=o}}function S5e(t){const e={};return Ie(t,r=>{const n=new k5e(r).startWalking();La(e,n)}),e}function C5e(t,e){return t.name+e+FG}let pm={};const A5e=new AG;function Z2(t){const e=t.toString();if(pm.hasOwnProperty(e))return pm[e];{const r=A5e.pattern(e);return pm[e]=r,r}}function _5e(){pm={}}const $G="Complement Sets are not supported for first char optimization",ty=`Unable to use "first char" lexer optimizations:
`;function L5e(t,e=!1){try{const r=Z2(t);return Iw(r.value,{},r.flags.ignoreCase)}catch(r){if(r.message===$G)e&&OG(`${ty}	Unable to optimize: < ${t.toString()} >
	Complement Sets cannot be automatically optimized.
	This will disable the lexer's first char optimizations.
	See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#COMPLEMENT for details.`);else{let n="";e&&(n=`
	This will disable the lexer's first char optimizations.
	See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details.`),Mw(`${ty}
	Failed parsing: < ${t.toString()} >
	Using the @chevrotain/regexp-to-ast library
	Please open an issue at: https://github.com/chevrotain/chevrotain/issues`+n)}}return[]}function Iw(t,e,r){switch(t.type){case"Disjunction":for(let i=0;i<t.value.length;i++)Iw(t.value[i],e,r);break;case"Alternative":const n=t.value;for(let i=0;i<n.length;i++){const a=n[i];switch(a.type){case"EndAnchor":case"GroupBackReference":case"Lookahead":case"NegativeLookahead":case"StartAnchor":case"WordBoundary":case"NonWordBoundary":continue}const s=a;switch(s.type){case"Character":y1(s.value,e,r);break;case"Set":if(s.complement===!0)throw Error($G);Ie(s.value,l=>{if(typeof l=="number")y1(l,e,r);else{const u=l;if(r===!0)for(let h=u.from;h<=u.to;h++)y1(h,e,r);else{for(let h=u.from;h<=u.to&&h<a0;h++)y1(h,e,r);if(u.to>=a0){const h=u.from>=a0?u.from:a0,d=u.to,f=Xl(h),p=Xl(d);for(let g=f;g<=p;g++)e[g]=g}}}});break;case"Group":Iw(s.value,e,r);break;default:throw Error("Non Exhaustive Match")}const o=s.quantifier!==void 0&&s.quantifier.atLeast===0;if(s.type==="Group"&&Ow(s)===!1||s.type!=="Group"&&o===!1)break}break;default:throw Error("non exhaustive match!")}return Pr(e)}function y1(t,e,r){const n=Xl(t);e[n]=n,r===!0&&R5e(t,e)}function R5e(t,e){const r=String.fromCharCode(t),n=r.toUpperCase();if(n!==r){const i=Xl(n.charCodeAt(0));e[i]=i}else{const i=r.toLowerCase();if(i!==r){const a=Xl(i.charCodeAt(0));e[a]=a}}}function y9(t,e){return jo(t.value,r=>{if(typeof r=="number")return Zi(e,r);{const n=r;return jo(e,i=>n.from<=i&&i<=n.to)!==void 0}})}function Ow(t){const e=t.quantifier;return e&&e.atLeast===0?!0:t.value?ar(t.value)?vs(t.value,Ow):Ow(t.value):!1}class N5e extends X2{constructor(e){super(),this.targetCharCodes=e,this.found=!1}visitChildren(e){if(this.found!==!0){switch(e.type){case"Lookahead":this.visitLookahead(e);return;case"NegativeLookahead":this.visitNegativeLookahead(e);return}super.visitChildren(e)}}visitCharacter(e){Zi(this.targetCharCodes,e.value)&&(this.found=!0)}visitSet(e){e.complement?y9(e,this.targetCharCodes)===void 0&&(this.found=!0):y9(e,this.targetCharCodes)!==void 0&&(this.found=!0)}}function _k(t,e){if(e instanceof RegExp){const r=Z2(e),n=new N5e(t);return n.visit(r),n.found}else return jo(e,r=>Zi(t,r.charCodeAt(0)))!==void 0}const bu="PATTERN",i0="defaultMode",x1="modes";let zG=typeof new RegExp("(?:)").sticky=="boolean";function D5e(t,e){e=T2(e,{useSticky:zG,debug:!1,safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r",`
`],tracer:(b,w)=>w()});const r=e.tracer;r("initCharCodeToOptimizedIndexMap",()=>{twe()});let n;r("Reject Lexer.NA",()=>{n=S2(t,b=>b[bu]===ca.NA)});let i=!1,a;r("Transform Patterns",()=>{i=!1,a=ft(n,b=>{const w=b[bu];if(Ko(w)){const T=w.source;return T.length===1&&T!=="^"&&T!=="$"&&T!=="."&&!w.ignoreCase?T:T.length===2&&T[0]==="\\"&&!Zi(["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"],T[1])?T[1]:e.useSticky?b9(w):x9(w)}else{if(Qa(w))return i=!0,{exec:w};if(typeof w=="object")return i=!0,w;if(typeof w=="string"){if(w.length===1)return w;{const T=w.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),E=new RegExp(T);return e.useSticky?b9(E):x9(E)}}else throw Error("non exhaustive match")}})});let s,o,l,u,h;r("misc mapping",()=>{s=ft(n,b=>b.tokenTypeIdx),o=ft(n,b=>{const w=b.GROUP;if(w!==ca.SKIPPED){if(da(w))return w;if(Rr(w))return!1;throw Error("non exhaustive match")}}),l=ft(n,b=>{const w=b.LONGER_ALT;if(w)return ar(w)?ft(w,E=>y8(n,E)):[y8(n,w)]}),u=ft(n,b=>b.PUSH_MODE),h=ft(n,b=>Ft(b,"POP_MODE"))});let d;r("Line Terminator Handling",()=>{const b=UG(e.lineTerminatorCharacters);d=ft(n,w=>!1),e.positionTracking!=="onlyOffset"&&(d=ft(n,w=>Ft(w,"LINE_BREAKS")?!!w.LINE_BREAKS:GG(w,b)===!1&&_k(b,w.PATTERN)))});let f,p,g,m;r("Misc Mapping #2",()=>{f=ft(n,VG),p=ft(a,Q5e),g=Cn(n,(b,w)=>{const T=w.GROUP;return da(T)&&T!==ca.SKIPPED&&(b[T]=[]),b},{}),m=ft(a,(b,w)=>({pattern:a[w],longerAlt:l[w],canLineTerminator:d[w],isCustom:f[w],short:p[w],group:o[w],push:u[w],pop:h[w],tokenTypeIdx:s[w],tokenType:n[w]}))});let v=!0,y=[];return e.safeMode||r("First Char Optimization",()=>{y=Cn(n,(b,w,T)=>{if(typeof w.PATTERN=="string"){const E=w.PATTERN.charCodeAt(0),L=Xl(E);u3(b,L,m[T])}else if(ar(w.START_CHARS_HINT)){let E;Ie(w.START_CHARS_HINT,L=>{const S=typeof L=="string"?L.charCodeAt(0):L,C=Xl(S);E!==C&&(E=C,u3(b,C,m[T]))})}else if(Ko(w.PATTERN))if(w.PATTERN.unicode)v=!1,e.ensureOptimizations&&Mw(`${ty}	Unable to analyze < ${w.PATTERN.toString()} > pattern.
	The regexp unicode flag is not currently supported by the regexp-to-ast library.
	This will disable the lexer's first char optimizations.
	For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE`);else{const E=L5e(w.PATTERN,e.ensureOptimizations);Sr(E)&&(v=!1),Ie(E,L=>{u3(b,L,m[T])})}else e.ensureOptimizations&&Mw(`${ty}	TokenType: <${w.name}> is using a custom token pattern without providing <start_chars_hint> parameter.
	This will disable the lexer's first char optimizations.
	For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE`),v=!1;return b},[])}),{emptyGroups:g,patternIdxToConfig:m,charCodeToPatternIdxToConfig:y,hasCustom:i,canBeOptimized:v}}function M5e(t,e){let r=[];const n=O5e(t);r=r.concat(n.errors);const i=P5e(n.valid),a=i.valid;return r=r.concat(i.errors),r=r.concat(I5e(a)),r=r.concat(W5e(a)),r=r.concat(H5e(a,e)),r=r.concat(q5e(a)),r}function I5e(t){let e=[];const r=cn(t,n=>Ko(n[bu]));return e=e.concat(F5e(r)),e=e.concat(V5e(r)),e=e.concat(G5e(r)),e=e.concat(U5e(r)),e=e.concat($5e(r)),e}function O5e(t){const e=cn(t,i=>!Ft(i,bu)),r=ft(e,i=>({message:"Token Type: ->"+i.name+"<- missing static 'PATTERN' property",type:ln.MISSING_PATTERN,tokenTypes:[i]})),n=E2(t,e);return{errors:r,valid:n}}function P5e(t){const e=cn(t,i=>{const a=i[bu];return!Ko(a)&&!Qa(a)&&!Ft(a,"exec")&&!da(a)}),r=ft(e,i=>({message:"Token Type: ->"+i.name+"<- static 'PATTERN' can only be a RegExp, a Function matching the {CustomPatternMatcherFunc} type or an Object matching the {ICustomPattern} interface.",type:ln.INVALID_PATTERN,tokenTypes:[i]})),n=E2(t,e);return{errors:r,valid:n}}const B5e=/[^\\][$]/;function F5e(t){class e extends X2{constructor(){super(...arguments),this.found=!1}visitEndAnchor(a){this.found=!0}}const r=cn(t,i=>{const a=i.PATTERN;try{const s=Z2(a),o=new e;return o.visit(s),o.found}catch{return B5e.test(a.source)}});return ft(r,i=>({message:`Unexpected RegExp Anchor Error:
	Token Type: ->`+i.name+`<- static 'PATTERN' cannot contain end of input anchor '$'
	See chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS	for details.`,type:ln.EOI_ANCHOR_FOUND,tokenTypes:[i]}))}function $5e(t){const e=cn(t,n=>n.PATTERN.test(""));return ft(e,n=>({message:"Token Type: ->"+n.name+"<- static 'PATTERN' must not match an empty string",type:ln.EMPTY_MATCH_PATTERN,tokenTypes:[n]}))}const z5e=/[^\\[][\^]|^\^/;function V5e(t){class e extends X2{constructor(){super(...arguments),this.found=!1}visitStartAnchor(a){this.found=!0}}const r=cn(t,i=>{const a=i.PATTERN;try{const s=Z2(a),o=new e;return o.visit(s),o.found}catch{return z5e.test(a.source)}});return ft(r,i=>({message:`Unexpected RegExp Anchor Error:
	Token Type: ->`+i.name+`<- static 'PATTERN' cannot contain start of input anchor '^'
	See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS	for details.`,type:ln.SOI_ANCHOR_FOUND,tokenTypes:[i]}))}function G5e(t){const e=cn(t,n=>{const i=n[bu];return i instanceof RegExp&&(i.multiline||i.global)});return ft(e,n=>({message:"Token Type: ->"+n.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:ln.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[n]}))}function U5e(t){const e=[];let r=ft(t,a=>Cn(t,(s,o)=>(a.PATTERN.source===o.PATTERN.source&&!Zi(e,o)&&o.PATTERN!==ca.NA&&(e.push(o),s.push(o)),s),[]));r=Yp(r);const n=cn(r,a=>a.length>1);return ft(n,a=>{const s=ft(a,l=>l.name);return{message:`The same RegExp pattern ->${Ts(a).PATTERN}<-has been used in all of the following Token Types: ${s.join(", ")} <-`,type:ln.DUPLICATE_PATTERNS_FOUND,tokenTypes:a}})}function W5e(t){const e=cn(t,n=>{if(!Ft(n,"GROUP"))return!1;const i=n.GROUP;return i!==ca.SKIPPED&&i!==ca.NA&&!da(i)});return ft(e,n=>({message:"Token Type: ->"+n.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:ln.INVALID_GROUP_TYPE_FOUND,tokenTypes:[n]}))}function H5e(t,e){const r=cn(t,i=>i.PUSH_MODE!==void 0&&!Zi(e,i.PUSH_MODE));return ft(r,i=>({message:`Token Type: ->${i.name}<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->${i.PUSH_MODE}<-which does not exist`,type:ln.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[i]}))}function q5e(t){const e=[],r=Cn(t,(n,i,a)=>{const s=i.PATTERN;return s===ca.NA||(da(s)?n.push({str:s,idx:a,tokenType:i}):Ko(s)&&X5e(s)&&n.push({str:s.source,idx:a,tokenType:i})),n},[]);return Ie(t,(n,i)=>{Ie(r,({str:a,idx:s,tokenType:o})=>{if(i<s&&Y5e(a,n.PATTERN)){const l=`Token: ->${o.name}<- can never be matched.
Because it appears AFTER the Token Type ->${n.name}<-in the lexer's definition.
See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;e.push({message:l,type:ln.UNREACHABLE_PATTERN,tokenTypes:[n,o]})}})}),e}function Y5e(t,e){if(Ko(e)){const r=e.exec(t);return r!==null&&r.index===0}else{if(Qa(e))return e(t,0,[],{});if(Ft(e,"exec"))return e.exec(t,0,[],{});if(typeof e=="string")return e===t;throw Error("non exhaustive match")}}function X5e(t){return jo([".","\\","[","]","|","^","$","(",")","?","*","+","{"],r=>t.source.indexOf(r)!==-1)===void 0}function x9(t){const e=t.ignoreCase?"i":"";return new RegExp(`^(?:${t.source})`,e)}function b9(t){const e=t.ignoreCase?"iy":"y";return new RegExp(`${t.source}`,e)}function j5e(t,e,r){const n=[];return Ft(t,i0)||n.push({message:"A MultiMode Lexer cannot be initialized without a <"+i0+`> property in its definition
`,type:ln.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),Ft(t,x1)||n.push({message:"A MultiMode Lexer cannot be initialized without a <"+x1+`> property in its definition
`,type:ln.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),Ft(t,x1)&&Ft(t,i0)&&!Ft(t.modes,t.defaultMode)&&n.push({message:`A MultiMode Lexer cannot be initialized with a ${i0}: <${t.defaultMode}>which does not exist
`,type:ln.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),Ft(t,x1)&&Ie(t.modes,(i,a)=>{Ie(i,(s,o)=>{if(Rr(s))n.push({message:`A Lexer cannot be initialized using an undefined Token Type. Mode:<${a}> at index: <${o}>
`,type:ln.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED});else if(Ft(s,"LONGER_ALT")){const l=ar(s.LONGER_ALT)?s.LONGER_ALT:[s.LONGER_ALT];Ie(l,u=>{!Rr(u)&&!Zi(i,u)&&n.push({message:`A MultiMode Lexer cannot be initialized with a longer_alt <${u.name}> on token <${s.name}> outside of mode <${a}>
`,type:ln.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE})})}})}),n}function K5e(t,e,r){const n=[];let i=!1;const a=Yp(Xn(Pr(t.modes))),s=S2(a,l=>l[bu]===ca.NA),o=UG(r);return e&&Ie(s,l=>{const u=GG(l,o);if(u!==!1){const d={message:ewe(l,u),type:u.issue,tokenType:l};n.push(d)}else Ft(l,"LINE_BREAKS")?l.LINE_BREAKS===!0&&(i=!0):_k(o,l.PATTERN)&&(i=!0)}),e&&!i&&n.push({message:`Warning: No LINE_BREAKS Found.
	This Lexer has been defined to track line and column information,
	But none of the Token Types can be identified as matching a line terminator.
	See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#LINE_BREAKS 
	for details.`,type:ln.NO_LINE_BREAKS_FLAGS}),n}function Z5e(t){const e={},r=In(t);return Ie(r,n=>{const i=t[n];if(ar(i))e[n]=[];else throw Error("non exhaustive match")}),e}function VG(t){const e=t.PATTERN;if(Ko(e))return!1;if(Qa(e))return!0;if(Ft(e,"exec"))return!0;if(da(e))return!1;throw Error("non exhaustive match")}function Q5e(t){return da(t)&&t.length===1?t.charCodeAt(0):!1}const J5e={test:function(t){const e=t.length;for(let r=this.lastIndex;r<e;r++){const n=t.charCodeAt(r);if(n===10)return this.lastIndex=r+1,!0;if(n===13)return t.charCodeAt(r+1)===10?this.lastIndex=r+2:this.lastIndex=r+1,!0}return!1},lastIndex:0};function GG(t,e){if(Ft(t,"LINE_BREAKS"))return!1;if(Ko(t.PATTERN)){try{_k(e,t.PATTERN)}catch(r){return{issue:ln.IDENTIFY_TERMINATOR,errMsg:r.message}}return!1}else{if(da(t.PATTERN))return!1;if(VG(t))return{issue:ln.CUSTOM_LINE_BREAK};throw Error("non exhaustive match")}}function ewe(t,e){if(e.issue===ln.IDENTIFY_TERMINATOR)return`Warning: unable to identify line terminator usage in pattern.
	The problem is in the <${t.name}> Token Type
	 Root cause: ${e.errMsg}.
	For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR`;if(e.issue===ln.CUSTOM_LINE_BREAK)return`Warning: A Custom Token Pattern should specify the <line_breaks> option.
	The problem is in the <${t.name}> Token Type
	For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK`;throw Error("non exhaustive match")}function UG(t){return ft(t,r=>da(r)?r.charCodeAt(0):r)}function u3(t,e,r){t[e]===void 0?t[e]=[r]:t[e].push(r)}const a0=256;let gm=[];function Xl(t){return t<a0?t:gm[t]}function twe(){if(Sr(gm)){gm=new Array(65536);for(let t=0;t<65536;t++)gm[t]=t>255?255+~~(t/255):t}}function hg(t,e){const r=t.tokenTypeIdx;return r===e.tokenTypeIdx?!0:e.isParent===!0&&e.categoryMatchesMap[r]===!0}function ry(t,e){return t.tokenTypeIdx===e.tokenTypeIdx}let w9=1;const WG={};function dg(t){const e=rwe(t);nwe(e),awe(e),iwe(e),Ie(e,r=>{r.isParent=r.categoryMatches.length>0})}function rwe(t){let e=Fn(t),r=t,n=!0;for(;n;){r=Yp(Xn(ft(r,a=>a.CATEGORIES)));const i=E2(r,e);e=e.concat(i),Sr(i)?n=!1:r=i}return e}function nwe(t){Ie(t,e=>{qG(e)||(WG[w9]=e,e.tokenTypeIdx=w9++),T9(e)&&!ar(e.CATEGORIES)&&(e.CATEGORIES=[e.CATEGORIES]),T9(e)||(e.CATEGORIES=[]),swe(e)||(e.categoryMatches=[]),owe(e)||(e.categoryMatchesMap={})})}function iwe(t){Ie(t,e=>{e.categoryMatches=[],Ie(e.categoryMatchesMap,(r,n)=>{e.categoryMatches.push(WG[n].tokenTypeIdx)})})}function awe(t){Ie(t,e=>{HG([],e)})}function HG(t,e){Ie(t,r=>{e.categoryMatchesMap[r.tokenTypeIdx]=!0}),Ie(e.CATEGORIES,r=>{const n=t.concat(e);Zi(n,r)||HG(n,r)})}function qG(t){return Ft(t,"tokenTypeIdx")}function T9(t){return Ft(t,"CATEGORIES")}function swe(t){return Ft(t,"categoryMatches")}function owe(t){return Ft(t,"categoryMatchesMap")}function lwe(t){return Ft(t,"tokenTypeIdx")}const Pw={buildUnableToPopLexerModeMessage(t){return`Unable to pop Lexer Mode after encountering Token ->${t.image}<- The Mode Stack is empty`},buildUnexpectedCharactersMessage(t,e,r,n,i){return`unexpected character: ->${t.charAt(e)}<- at offset: ${e}, skipped ${r} characters.`}};var ln;(function(t){t[t.MISSING_PATTERN=0]="MISSING_PATTERN",t[t.INVALID_PATTERN=1]="INVALID_PATTERN",t[t.EOI_ANCHOR_FOUND=2]="EOI_ANCHOR_FOUND",t[t.UNSUPPORTED_FLAGS_FOUND=3]="UNSUPPORTED_FLAGS_FOUND",t[t.DUPLICATE_PATTERNS_FOUND=4]="DUPLICATE_PATTERNS_FOUND",t[t.INVALID_GROUP_TYPE_FOUND=5]="INVALID_GROUP_TYPE_FOUND",t[t.PUSH_MODE_DOES_NOT_EXIST=6]="PUSH_MODE_DOES_NOT_EXIST",t[t.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE=7]="MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE",t[t.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY=8]="MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY",t[t.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST=9]="MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST",t[t.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED=10]="LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED",t[t.SOI_ANCHOR_FOUND=11]="SOI_ANCHOR_FOUND",t[t.EMPTY_MATCH_PATTERN=12]="EMPTY_MATCH_PATTERN",t[t.NO_LINE_BREAKS_FLAGS=13]="NO_LINE_BREAKS_FLAGS",t[t.UNREACHABLE_PATTERN=14]="UNREACHABLE_PATTERN",t[t.IDENTIFY_TERMINATOR=15]="IDENTIFY_TERMINATOR",t[t.CUSTOM_LINE_BREAK=16]="CUSTOM_LINE_BREAK",t[t.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE=17]="MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE"})(ln||(ln={}));const s0={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:[`
`,"\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:Pw,traceInitPerf:!1,skipValidations:!1,recoveryEnabled:!0};Object.freeze(s0);class ca{constructor(e,r=s0){if(this.lexerDefinition=e,this.lexerDefinitionErrors=[],this.lexerDefinitionWarning=[],this.patternIdxToConfig={},this.charCodeToPatternIdxToConfig={},this.modes=[],this.emptyGroups={},this.trackStartLines=!0,this.trackEndLines=!0,this.hasCustom=!1,this.canModeBeOptimized={},this.TRACE_INIT=(i,a)=>{if(this.traceInitPerf===!0){this.traceInitIndent++;const s=new Array(this.traceInitIndent+1).join("	");this.traceInitIndent<this.traceInitMaxIdent&&console.log(`${s}--> <${i}>`);const{time:o,value:l}=PG(a),u=o>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&u(`${s}<-- <${i}> time: ${o}ms`),this.traceInitIndent--,l}else return a()},typeof r=="boolean")throw Error(`The second argument to the Lexer constructor is now an ILexerConfig Object.
a boolean 2nd argument is no longer supported`);this.config=La({},s0,r);const n=this.config.traceInitPerf;n===!0?(this.traceInitMaxIdent=1/0,this.traceInitPerf=!0):typeof n=="number"&&(this.traceInitMaxIdent=n,this.traceInitPerf=!0),this.traceInitIndent=-1,this.TRACE_INIT("Lexer Constructor",()=>{let i,a=!0;this.TRACE_INIT("Lexer Config handling",()=>{if(this.config.lineTerminatorsPattern===s0.lineTerminatorsPattern)this.config.lineTerminatorsPattern=J5e;else if(this.config.lineTerminatorCharacters===s0.lineTerminatorCharacters)throw Error(`Error: Missing <lineTerminatorCharacters> property on the Lexer config.
	For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#MISSING_LINE_TERM_CHARS`);if(r.safeMode&&r.ensureOptimizations)throw Error('"safeMode" and "ensureOptimizations" flags are mutually exclusive.');this.trackStartLines=/full|onlyStart/i.test(this.config.positionTracking),this.trackEndLines=/full/i.test(this.config.positionTracking),ar(e)?i={modes:{defaultMode:Fn(e)},defaultMode:i0}:(a=!1,i=Fn(e))}),this.config.skipValidations===!1&&(this.TRACE_INIT("performRuntimeChecks",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(j5e(i,this.trackStartLines,this.config.lineTerminatorCharacters))}),this.TRACE_INIT("performWarningRuntimeChecks",()=>{this.lexerDefinitionWarning=this.lexerDefinitionWarning.concat(K5e(i,this.trackStartLines,this.config.lineTerminatorCharacters))})),i.modes=i.modes?i.modes:{},Ie(i.modes,(o,l)=>{i.modes[l]=S2(o,u=>Rr(u))});const s=In(i.modes);if(Ie(i.modes,(o,l)=>{this.TRACE_INIT(`Mode: <${l}> processing`,()=>{if(this.modes.push(l),this.config.skipValidations===!1&&this.TRACE_INIT("validatePatterns",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(M5e(o,s))}),Sr(this.lexerDefinitionErrors)){dg(o);let u;this.TRACE_INIT("analyzeTokenTypes",()=>{u=D5e(o,{lineTerminatorCharacters:this.config.lineTerminatorCharacters,positionTracking:r.positionTracking,ensureOptimizations:r.ensureOptimizations,safeMode:r.safeMode,tracer:this.TRACE_INIT})}),this.patternIdxToConfig[l]=u.patternIdxToConfig,this.charCodeToPatternIdxToConfig[l]=u.charCodeToPatternIdxToConfig,this.emptyGroups=La({},this.emptyGroups,u.emptyGroups),this.hasCustom=u.hasCustom||this.hasCustom,this.canModeBeOptimized[l]=u.canBeOptimized}})}),this.defaultMode=i.defaultMode,!Sr(this.lexerDefinitionErrors)&&!this.config.deferDefinitionErrorsHandling){const l=ft(this.lexerDefinitionErrors,u=>u.message).join(`-----------------------
`);throw new Error(`Errors detected in definition of Lexer:
`+l)}Ie(this.lexerDefinitionWarning,o=>{OG(o.message)}),this.TRACE_INIT("Choosing sub-methods implementations",()=>{if(zG?(this.chopInput=Wo,this.match=this.matchWithTest):(this.updateLastIndex=Rn,this.match=this.matchWithExec),a&&(this.handleModes=Rn),this.trackStartLines===!1&&(this.computeNewColumn=Wo),this.trackEndLines===!1&&(this.updateTokenEndLineColumnLocation=Rn),/full/i.test(this.config.positionTracking))this.createTokenInstance=this.createFullToken;else if(/onlyStart/i.test(this.config.positionTracking))this.createTokenInstance=this.createStartOnlyToken;else if(/onlyOffset/i.test(this.config.positionTracking))this.createTokenInstance=this.createOffsetOnlyToken;else throw Error(`Invalid <positionTracking> config option: "${this.config.positionTracking}"`);this.hasCustom?(this.addToken=this.addTokenUsingPush,this.handlePayload=this.handlePayloadWithCustom):(this.addToken=this.addTokenUsingMemberAccess,this.handlePayload=this.handlePayloadNoCustom)}),this.TRACE_INIT("Failed Optimization Warnings",()=>{const o=Cn(this.canModeBeOptimized,(l,u,h)=>(u===!1&&l.push(h),l),[]);if(r.ensureOptimizations&&!Sr(o))throw Error(`Lexer Modes: < ${o.join(", ")} > cannot be optimized.
	 Disable the "ensureOptimizations" lexer config flag to silently ignore this and run the lexer in an un-optimized mode.
	 Or inspect the console log for details on how to resolve these issues.`)}),this.TRACE_INIT("clearRegExpParserCache",()=>{_5e()}),this.TRACE_INIT("toFastProperties",()=>{BG(this)})})}tokenize(e,r=this.defaultMode){if(!Sr(this.lexerDefinitionErrors)){const i=ft(this.lexerDefinitionErrors,a=>a.message).join(`-----------------------
`);throw new Error(`Unable to Tokenize because Errors detected in definition of Lexer:
`+i)}return this.tokenizeInternal(e,r)}tokenizeInternal(e,r){let n,i,a,s,o,l,u,h,d,f,p,g,m,v,y;const b=e,w=b.length;let T=0,E=0;const L=this.hasCustom?0:Math.floor(e.length/10),S=new Array(L),C=[];let A=this.trackStartLines?1:void 0,N=this.trackStartLines?1:void 0;const _=Z5e(this.emptyGroups),O=this.trackStartLines,P=this.config.lineTerminatorsPattern;let k=0,R=[],I=[];const M=[],D=[];Object.freeze(D);let B;function $(){return R}function F(ne){const ae=Xl(ne),pe=I[ae];return pe===void 0?D:pe}const G=ne=>{if(M.length===1&&ne.tokenType.PUSH_MODE===void 0){const ae=this.config.errorMessageProvider.buildUnableToPopLexerModeMessage(ne);C.push({offset:ne.startOffset,line:ne.startLine,column:ne.startColumn,length:ne.image.length,message:ae})}else{M.pop();const ae=Zs(M);R=this.patternIdxToConfig[ae],I=this.charCodeToPatternIdxToConfig[ae],k=R.length;const pe=this.canModeBeOptimized[ae]&&this.config.safeMode===!1;I&&pe?B=F:B=$}};function W(ne){M.push(ne),I=this.charCodeToPatternIdxToConfig[ne],R=this.patternIdxToConfig[ne],k=R.length,k=R.length;const ae=this.canModeBeOptimized[ne]&&this.config.safeMode===!1;I&&ae?B=F:B=$}W.call(this,r);let J;const q=this.config.recoveryEnabled;for(;T<w;){l=null;const ne=b.charCodeAt(T),ae=B(ne),pe=ae.length;for(n=0;n<pe;n++){J=ae[n];const K=J.pattern;u=null;const Z=J.short;if(Z!==!1?ne===Z&&(l=K):J.isCustom===!0?(y=K.exec(b,T,S,_),y!==null?(l=y[0],y.payload!==void 0&&(u=y.payload)):l=null):(this.updateLastIndex(K,T),l=this.match(K,e,T)),l!==null){if(o=J.longerAlt,o!==void 0){const X=o.length;for(a=0;a<X;a++){const Y=R[o[a]],ee=Y.pattern;if(h=null,Y.isCustom===!0?(y=ee.exec(b,T,S,_),y!==null?(s=y[0],y.payload!==void 0&&(h=y.payload)):s=null):(this.updateLastIndex(ee,T),s=this.match(ee,e,T)),s&&s.length>l.length){l=s,u=h,J=Y;break}}}break}}if(l!==null){if(d=l.length,f=J.group,f!==void 0&&(p=J.tokenTypeIdx,g=this.createTokenInstance(l,T,p,J.tokenType,A,N,d),this.handlePayload(g,u),f===!1?E=this.addToken(S,E,g):_[f].push(g)),e=this.chopInput(e,d),T=T+d,N=this.computeNewColumn(N,d),O===!0&&J.canLineTerminator===!0){let K=0,Z,X;P.lastIndex=0;do Z=P.test(l),Z===!0&&(X=P.lastIndex-1,K++);while(Z===!0);K!==0&&(A=A+K,N=d-X,this.updateTokenEndLineColumnLocation(g,f,X,K,A,N,d))}this.handleModes(J,G,W,g)}else{const K=T,Z=A,X=N;let Y=q===!1;for(;Y===!1&&T<w;)for(e=this.chopInput(e,1),T++,i=0;i<k;i++){const ee=R[i],j=ee.pattern,fe=ee.short;if(fe!==!1?b.charCodeAt(T)===fe&&(Y=!0):ee.isCustom===!0?Y=j.exec(b,T,S,_)!==null:(this.updateLastIndex(j,T),Y=j.exec(e)!==null),Y===!0)break}if(m=T-K,N=this.computeNewColumn(N,m),v=this.config.errorMessageProvider.buildUnexpectedCharactersMessage(b,K,m,Z,X),C.push({offset:K,line:Z,column:X,length:m,message:v}),q===!1)break}}return this.hasCustom||(S.length=E),{tokens:S,groups:_,errors:C}}handleModes(e,r,n,i){if(e.pop===!0){const a=e.push;r(i),a!==void 0&&n.call(this,a)}else e.push!==void 0&&n.call(this,e.push)}chopInput(e,r){return e.substring(r)}updateLastIndex(e,r){e.lastIndex=r}updateTokenEndLineColumnLocation(e,r,n,i,a,s,o){let l,u;r!==void 0&&(l=n===o-1,u=l?-1:0,i===1&&l===!0||(e.endLine=a+u,e.endColumn=s-1+-u))}computeNewColumn(e,r){return e+r}createOffsetOnlyToken(e,r,n,i){return{image:e,startOffset:r,tokenTypeIdx:n,tokenType:i}}createStartOnlyToken(e,r,n,i,a,s){return{image:e,startOffset:r,startLine:a,startColumn:s,tokenTypeIdx:n,tokenType:i}}createFullToken(e,r,n,i,a,s,o){return{image:e,startOffset:r,endOffset:r+o-1,startLine:a,endLine:a,startColumn:s,endColumn:s+o-1,tokenTypeIdx:n,tokenType:i}}addTokenUsingPush(e,r,n){return e.push(n),r}addTokenUsingMemberAccess(e,r,n){return e[r]=n,r++,r}handlePayloadNoCustom(e,r){}handlePayloadWithCustom(e,r){r!==null&&(e.payload=r)}matchWithTest(e,r,n){return e.test(r)===!0?r.substring(n,e.lastIndex):null}matchWithExec(e,r){const n=e.exec(r);return n!==null?n[0]:null}}ca.SKIPPED="This marks a skipped Token pattern, this means each token identified by it willbe consumed and then thrown into oblivion, this can be used to for example to completely ignore whitespace.";ca.NA=/NOT_APPLICABLE/;function Bh(t){return YG(t)?t.LABEL:t.name}function YG(t){return da(t.LABEL)&&t.LABEL!==""}const cwe="parent",E9="categories",k9="label",S9="group",C9="push_mode",A9="pop_mode",_9="longer_alt",L9="line_breaks",R9="start_chars_hint";function XG(t){return uwe(t)}function uwe(t){const e=t.pattern,r={};if(r.name=t.name,Rr(e)||(r.PATTERN=e),Ft(t,cwe))throw`The parent property is no longer supported.
See: https://github.com/chevrotain/chevrotain/issues/564#issuecomment-349062346 for details.`;return Ft(t,E9)&&(r.CATEGORIES=t[E9]),dg([r]),Ft(t,k9)&&(r.LABEL=t[k9]),Ft(t,S9)&&(r.GROUP=t[S9]),Ft(t,A9)&&(r.POP_MODE=t[A9]),Ft(t,C9)&&(r.PUSH_MODE=t[C9]),Ft(t,_9)&&(r.LONGER_ALT=t[_9]),Ft(t,L9)&&(r.LINE_BREAKS=t[L9]),Ft(t,R9)&&(r.START_CHARS_HINT=t[R9]),r}const jl=XG({name:"EOF",pattern:ca.NA});dg([jl]);function Lk(t,e,r,n,i,a,s,o){return{image:e,startOffset:r,endOffset:n,startLine:i,endLine:a,startColumn:s,endColumn:o,tokenTypeIdx:t.tokenTypeIdx,tokenType:t}}function jG(t,e){return hg(t,e)}const Th={buildMismatchTokenMessage({expected:t,actual:e,previous:r,ruleName:n}){return`Expecting ${YG(t)?`--> ${Bh(t)} <--`:`token of type --> ${t.name} <--`} but found --> '${e.image}' <--`},buildNotAllInputParsedMessage({firstRedundant:t,ruleName:e}){return"Redundant input, expecting EOF but found: "+t.image},buildNoViableAltMessage({expectedPathsPerAlt:t,actual:e,previous:r,customUserDescription:n,ruleName:i}){const a="Expecting: ",o=`
but found: '`+Ts(e).image+"'";if(n)return a+n+o;{const l=Cn(t,(f,p)=>f.concat(p),[]),u=ft(l,f=>`[${ft(f,p=>Bh(p)).join(", ")}]`),d=`one of these possible Token sequences:
${ft(u,(f,p)=>`  ${p+1}. ${f}`).join(`
`)}`;return a+d+o}},buildEarlyExitMessage({expectedIterationPaths:t,actual:e,customUserDescription:r,ruleName:n}){const i="Expecting: ",s=`
but found: '`+Ts(e).image+"'";if(r)return i+r+s;{const l=`expecting at least one iteration which starts with one of these possible Token sequences::
  <${ft(t,u=>`[${ft(u,h=>Bh(h)).join(",")}]`).join(" ,")}>`;return i+l+s}}};Object.freeze(Th);const hwe={buildRuleNotFoundError(t,e){return"Invalid grammar, reference to a rule which is not defined: ->"+e.nonTerminalName+`<-
inside top level rule: ->`+t.name+"<-"}},Xc={buildDuplicateFoundError(t,e){function r(h){return h instanceof qr?h.terminalType.name:h instanceof Yi?h.nonTerminalName:""}const n=t.name,i=Ts(e),a=i.idx,s=zs(i),o=r(i),l=a>0;let u=`->${s}${l?a:""}<- ${o?`with argument: ->${o}<-`:""}
                  appears more than once (${e.length} times) in the top level rule: ->${n}<-.                  
                  For further details see: https://chevrotain.io/docs/FAQ.html#NUMERICAL_SUFFIXES 
                  `;return u=u.replace(/[ \t]+/g," "),u=u.replace(/\s\s+/g,`
`),u},buildNamespaceConflictError(t){return`Namespace conflict found in grammar.
The grammar has both a Terminal(Token) and a Non-Terminal(Rule) named: <${t.name}>.
To resolve this make sure each Terminal and Non-Terminal names are unique
This is easy to accomplish by using the convention that Terminal names start with an uppercase letter
and Non-Terminal names start with a lower case letter.`},buildAlternationPrefixAmbiguityError(t){const e=ft(t.prefixPath,i=>Bh(i)).join(", "),r=t.alternation.idx===0?"":t.alternation.idx;return`Ambiguous alternatives: <${t.ambiguityIndices.join(" ,")}> due to common lookahead prefix
in <OR${r}> inside <${t.topLevelRule.name}> Rule,
<${e}> may appears as a prefix path in all these alternatives.
See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#COMMON_PREFIX
For Further details.`},buildAlternationAmbiguityError(t){const e=ft(t.prefixPath,i=>Bh(i)).join(", "),r=t.alternation.idx===0?"":t.alternation.idx;let n=`Ambiguous Alternatives Detected: <${t.ambiguityIndices.join(" ,")}> in <OR${r}> inside <${t.topLevelRule.name}> Rule,
<${e}> may appears as a prefix path in all these alternatives.
`;return n=n+`See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES
For Further details.`,n},buildEmptyRepetitionError(t){let e=zs(t.repetition);return t.repetition.idx!==0&&(e+=t.repetition.idx),`The repetition <${e}> within Rule <${t.topLevelRule.name}> can never consume any tokens.
This could lead to an infinite loop.`},buildTokenNameError(t){return"deprecated"},buildEmptyAlternationError(t){return`Ambiguous empty alternative: <${t.emptyChoiceIdx+1}> in <OR${t.alternation.idx}> inside <${t.topLevelRule.name}> Rule.
Only the last alternative may be an empty alternative.`},buildTooManyAlternativesError(t){return`An Alternation cannot have more than 256 alternatives:
<OR${t.alternation.idx}> inside <${t.topLevelRule.name}> Rule.
 has ${t.alternation.definition.length+1} alternatives.`},buildLeftRecursionError(t){const e=t.topLevelRule.name,r=ft(t.leftRecursionPath,a=>a.name),n=`${e} --> ${r.concat([e]).join(" --> ")}`;return`Left Recursion found in grammar.
rule: <${e}> can be invoked from itself (directly or indirectly)
without consuming any Tokens. The grammar path that causes this is: 
 ${n}
 To fix this refactor your grammar to remove the left recursion.
see: https://en.wikipedia.org/wiki/LL_parser#Left_factoring.`},buildInvalidRuleNameError(t){return"deprecated"},buildDuplicateRuleNameError(t){let e;return t.topLevelRule instanceof Fd?e=t.topLevelRule.name:e=t.topLevelRule,`Duplicate definition, rule: ->${e}<- is already defined in the grammar: ->${t.grammarName}<-`}};function dwe(t,e){const r=new fwe(t,e);return r.resolveRefs(),r.errors}class fwe extends $d{constructor(e,r){super(),this.nameToTopRule=e,this.errMsgProvider=r,this.errors=[]}resolveRefs(){Ie(Pr(this.nameToTopRule),e=>{this.currTopLevel=e,e.accept(this)})}visitNonTerminal(e){const r=this.nameToTopRule[e.nonTerminalName];if(r)e.referencedRule=r;else{const n=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,e);this.errors.push({message:n,type:Xi.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:e.nonTerminalName})}}}class pwe extends K2{constructor(e,r){super(),this.topProd=e,this.path=r,this.possibleTokTypes=[],this.nextProductionName="",this.nextProductionOccurrence=0,this.found=!1,this.isAtEndOfPath=!1}startWalking(){if(this.found=!1,this.path.ruleStack[0]!==this.topProd.name)throw Error("The path does not start with the walker's top Rule!");return this.ruleStack=Fn(this.path.ruleStack).reverse(),this.occurrenceStack=Fn(this.path.occurrenceStack).reverse(),this.ruleStack.pop(),this.occurrenceStack.pop(),this.updateExpectedNext(),this.walk(this.topProd),this.possibleTokTypes}walk(e,r=[]){this.found||super.walk(e,r)}walkProdRef(e,r,n){if(e.referencedRule.name===this.nextProductionName&&e.idx===this.nextProductionOccurrence){const i=r.concat(n);this.updateExpectedNext(),this.walk(e.referencedRule,i)}}updateExpectedNext(){Sr(this.ruleStack)?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())}}class gwe extends pwe{constructor(e,r){super(e,r),this.path=r,this.nextTerminalName="",this.nextTerminalOccurrence=0,this.nextTerminalName=this.path.lastTok.name,this.nextTerminalOccurrence=this.path.lastTokOccurrence}walkTerminal(e,r,n){if(this.isAtEndOfPath&&e.terminalType.name===this.nextTerminalName&&e.idx===this.nextTerminalOccurrence&&!this.found){const i=r.concat(n),a=new fa({definition:i});this.possibleTokTypes=ug(a),this.found=!0}}}class Q2 extends K2{constructor(e,r){super(),this.topRule=e,this.occurrence=r,this.result={token:void 0,occurrence:void 0,isEndOfRule:void 0}}startWalking(){return this.walk(this.topRule),this.result}}class mwe extends Q2{walkMany(e,r,n){if(e.idx===this.occurrence){const i=Ts(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof qr&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkMany(e,r,n)}}class N9 extends Q2{walkManySep(e,r,n){if(e.idx===this.occurrence){const i=Ts(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof qr&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkManySep(e,r,n)}}class vwe extends Q2{walkAtLeastOne(e,r,n){if(e.idx===this.occurrence){const i=Ts(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof qr&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOne(e,r,n)}}class D9 extends Q2{walkAtLeastOneSep(e,r,n){if(e.idx===this.occurrence){const i=Ts(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof qr&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOneSep(e,r,n)}}function Bw(t,e,r=[]){r=Fn(r);let n=[],i=0;function a(o){return o.concat(ni(t,i+1))}function s(o){const l=Bw(a(o),e,r);return n.concat(l)}for(;r.length<e&&i<t.length;){const o=t[i];if(o instanceof fa)return s(o.definition);if(o instanceof Yi)return s(o.definition);if(o instanceof ui)n=s(o.definition);else if(o instanceof Ma){const l=o.definition.concat([new on({definition:o.definition})]);return s(l)}else if(o instanceof Ia){const l=[new fa({definition:o.definition}),new on({definition:[new qr({terminalType:o.separator})].concat(o.definition)})];return s(l)}else if(o instanceof va){const l=o.definition.concat([new on({definition:[new qr({terminalType:o.separator})].concat(o.definition)})]);n=s(l)}else if(o instanceof on){const l=o.definition.concat([new on({definition:o.definition})]);n=s(l)}else{if(o instanceof ya)return Ie(o.definition,l=>{Sr(l.definition)===!1&&(n=s(l.definition))}),n;if(o instanceof qr)r.push(o.terminalType);else throw Error("non exhaustive match")}i++}return n.push({partialPath:r,suffixDef:ni(t,i)}),n}function KG(t,e,r,n){const i="EXIT_NONE_TERMINAL",a=[i],s="EXIT_ALTERNATIVE";let o=!1;const l=e.length,u=l-n-1,h=[],d=[];for(d.push({idx:-1,def:t,ruleStack:[],occurrenceStack:[]});!Sr(d);){const f=d.pop();if(f===s){o&&Zs(d).idx<=u&&d.pop();continue}const p=f.def,g=f.idx,m=f.ruleStack,v=f.occurrenceStack;if(Sr(p))continue;const y=p[0];if(y===i){const b={idx:g,def:ni(p),ruleStack:ep(m),occurrenceStack:ep(v)};d.push(b)}else if(y instanceof qr)if(g<l-1){const b=g+1,w=e[b];if(r(w,y.terminalType)){const T={idx:b,def:ni(p),ruleStack:m,occurrenceStack:v};d.push(T)}}else if(g===l-1)h.push({nextTokenType:y.terminalType,nextTokenOccurrence:y.idx,ruleStack:m,occurrenceStack:v}),o=!0;else throw Error("non exhaustive match");else if(y instanceof Yi){const b=Fn(m);b.push(y.nonTerminalName);const w=Fn(v);w.push(y.idx);const T={idx:g,def:y.definition.concat(a,ni(p)),ruleStack:b,occurrenceStack:w};d.push(T)}else if(y instanceof ui){const b={idx:g,def:ni(p),ruleStack:m,occurrenceStack:v};d.push(b),d.push(s);const w={idx:g,def:y.definition.concat(ni(p)),ruleStack:m,occurrenceStack:v};d.push(w)}else if(y instanceof Ma){const b=new on({definition:y.definition,idx:y.idx}),w=y.definition.concat([b],ni(p)),T={idx:g,def:w,ruleStack:m,occurrenceStack:v};d.push(T)}else if(y instanceof Ia){const b=new qr({terminalType:y.separator}),w=new on({definition:[b].concat(y.definition),idx:y.idx}),T=y.definition.concat([w],ni(p)),E={idx:g,def:T,ruleStack:m,occurrenceStack:v};d.push(E)}else if(y instanceof va){const b={idx:g,def:ni(p),ruleStack:m,occurrenceStack:v};d.push(b),d.push(s);const w=new qr({terminalType:y.separator}),T=new on({definition:[w].concat(y.definition),idx:y.idx}),E=y.definition.concat([T],ni(p)),L={idx:g,def:E,ruleStack:m,occurrenceStack:v};d.push(L)}else if(y instanceof on){const b={idx:g,def:ni(p),ruleStack:m,occurrenceStack:v};d.push(b),d.push(s);const w=new on({definition:y.definition,idx:y.idx}),T=y.definition.concat([w],ni(p)),E={idx:g,def:T,ruleStack:m,occurrenceStack:v};d.push(E)}else if(y instanceof ya)for(let b=y.definition.length-1;b>=0;b--){const w=y.definition[b],T={idx:g,def:w.definition.concat(ni(p)),ruleStack:m,occurrenceStack:v};d.push(T),d.push(s)}else if(y instanceof fa)d.push({idx:g,def:y.definition.concat(ni(p)),ruleStack:m,occurrenceStack:v});else if(y instanceof Fd)d.push(ywe(y,g,m,v));else throw Error("non exhaustive match")}return h}function ywe(t,e,r,n){const i=Fn(r);i.push(t.name);const a=Fn(n);return a.push(1),{idx:e,def:t.definition,ruleStack:i,occurrenceStack:a}}var tn;(function(t){t[t.OPTION=0]="OPTION",t[t.REPETITION=1]="REPETITION",t[t.REPETITION_MANDATORY=2]="REPETITION_MANDATORY",t[t.REPETITION_MANDATORY_WITH_SEPARATOR=3]="REPETITION_MANDATORY_WITH_SEPARATOR",t[t.REPETITION_WITH_SEPARATOR=4]="REPETITION_WITH_SEPARATOR",t[t.ALTERNATION=5]="ALTERNATION"})(tn||(tn={}));function Rk(t){if(t instanceof ui||t==="Option")return tn.OPTION;if(t instanceof on||t==="Repetition")return tn.REPETITION;if(t instanceof Ma||t==="RepetitionMandatory")return tn.REPETITION_MANDATORY;if(t instanceof Ia||t==="RepetitionMandatoryWithSeparator")return tn.REPETITION_MANDATORY_WITH_SEPARATOR;if(t instanceof va||t==="RepetitionWithSeparator")return tn.REPETITION_WITH_SEPARATOR;if(t instanceof ya||t==="Alternation")return tn.ALTERNATION;throw Error("non exhaustive match")}function M9(t){const{occurrence:e,rule:r,prodType:n,maxLookahead:i}=t,a=Rk(n);return a===tn.ALTERNATION?J2(e,r,i):ex(e,r,a,i)}function xwe(t,e,r,n,i,a){const s=J2(t,e,r),o=JG(s)?ry:hg;return a(s,n,o,i)}function bwe(t,e,r,n,i,a){const s=ex(t,e,i,r),o=JG(s)?ry:hg;return a(s[0],o,n)}function wwe(t,e,r,n){const i=t.length,a=vs(t,s=>vs(s,o=>o.length===1));if(e)return function(s){const o=ft(s,l=>l.GATE);for(let l=0;l<i;l++){const u=t[l],h=u.length,d=o[l];if(!(d!==void 0&&d.call(this)===!1))e:for(let f=0;f<h;f++){const p=u[f],g=p.length;for(let m=0;m<g;m++){const v=this.LA(m+1);if(r(v,p[m])===!1)continue e}return l}}};if(a&&!n){const s=ft(t,l=>Xn(l)),o=Cn(s,(l,u,h)=>(Ie(u,d=>{Ft(l,d.tokenTypeIdx)||(l[d.tokenTypeIdx]=h),Ie(d.categoryMatches,f=>{Ft(l,f)||(l[f]=h)})}),l),{});return function(){const l=this.LA(1);return o[l.tokenTypeIdx]}}else return function(){for(let s=0;s<i;s++){const o=t[s],l=o.length;e:for(let u=0;u<l;u++){const h=o[u],d=h.length;for(let f=0;f<d;f++){const p=this.LA(f+1);if(r(p,h[f])===!1)continue e}return s}}}}function Twe(t,e,r){const n=vs(t,a=>a.length===1),i=t.length;if(n&&!r){const a=Xn(t);if(a.length===1&&Sr(a[0].categoryMatches)){const o=a[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===o}}else{const s=Cn(a,(o,l,u)=>(o[l.tokenTypeIdx]=!0,Ie(l.categoryMatches,h=>{o[h]=!0}),o),[]);return function(){const o=this.LA(1);return s[o.tokenTypeIdx]===!0}}}else return function(){e:for(let a=0;a<i;a++){const s=t[a],o=s.length;for(let l=0;l<o;l++){const u=this.LA(l+1);if(e(u,s[l])===!1)continue e}return!0}return!1}}class Ewe extends K2{constructor(e,r,n){super(),this.topProd=e,this.targetOccurrence=r,this.targetProdType=n}startWalking(){return this.walk(this.topProd),this.restDef}checkIsTarget(e,r,n,i){return e.idx===this.targetOccurrence&&this.targetProdType===r?(this.restDef=n.concat(i),!0):!1}walkOption(e,r,n){this.checkIsTarget(e,tn.OPTION,r,n)||super.walkOption(e,r,n)}walkAtLeastOne(e,r,n){this.checkIsTarget(e,tn.REPETITION_MANDATORY,r,n)||super.walkOption(e,r,n)}walkAtLeastOneSep(e,r,n){this.checkIsTarget(e,tn.REPETITION_MANDATORY_WITH_SEPARATOR,r,n)||super.walkOption(e,r,n)}walkMany(e,r,n){this.checkIsTarget(e,tn.REPETITION,r,n)||super.walkOption(e,r,n)}walkManySep(e,r,n){this.checkIsTarget(e,tn.REPETITION_WITH_SEPARATOR,r,n)||super.walkOption(e,r,n)}}class ZG extends $d{constructor(e,r,n){super(),this.targetOccurrence=e,this.targetProdType=r,this.targetRef=n,this.result=[]}checkIsTarget(e,r){e.idx===this.targetOccurrence&&this.targetProdType===r&&(this.targetRef===void 0||e===this.targetRef)&&(this.result=e.definition)}visitOption(e){this.checkIsTarget(e,tn.OPTION)}visitRepetition(e){this.checkIsTarget(e,tn.REPETITION)}visitRepetitionMandatory(e){this.checkIsTarget(e,tn.REPETITION_MANDATORY)}visitRepetitionMandatoryWithSeparator(e){this.checkIsTarget(e,tn.REPETITION_MANDATORY_WITH_SEPARATOR)}visitRepetitionWithSeparator(e){this.checkIsTarget(e,tn.REPETITION_WITH_SEPARATOR)}visitAlternation(e){this.checkIsTarget(e,tn.ALTERNATION)}}function I9(t){const e=new Array(t);for(let r=0;r<t;r++)e[r]=[];return e}function h3(t){let e=[""];for(let r=0;r<t.length;r++){const n=t[r],i=[];for(let a=0;a<e.length;a++){const s=e[a];i.push(s+"_"+n.tokenTypeIdx);for(let o=0;o<n.categoryMatches.length;o++){const l="_"+n.categoryMatches[o];i.push(s+l)}}e=i}return e}function kwe(t,e,r){for(let n=0;n<t.length;n++){if(n===r)continue;const i=t[n];for(let a=0;a<e.length;a++){const s=e[a];if(i[s]===!0)return!1}}return!0}function QG(t,e){const r=ft(t,s=>Bw([s],1)),n=I9(r.length),i=ft(r,s=>{const o={};return Ie(s,l=>{const u=h3(l.partialPath);Ie(u,h=>{o[h]=!0})}),o});let a=r;for(let s=1;s<=e;s++){const o=a;a=I9(o.length);for(let l=0;l<o.length;l++){const u=o[l];for(let h=0;h<u.length;h++){const d=u[h].partialPath,f=u[h].suffixDef,p=h3(d);if(kwe(i,p,l)||Sr(f)||d.length===e){const m=n[l];if(Fw(m,d)===!1){m.push(d);for(let v=0;v<p.length;v++){const y=p[v];i[l][y]=!0}}}else{const m=Bw(f,s+1,d);a[l]=a[l].concat(m),Ie(m,v=>{const y=h3(v.partialPath);Ie(y,b=>{i[l][b]=!0})})}}}}return n}function J2(t,e,r,n){const i=new ZG(t,tn.ALTERNATION,n);return e.accept(i),QG(i.result,r)}function ex(t,e,r,n){const i=new ZG(t,r);e.accept(i);const a=i.result,o=new Ewe(e,t,r).startWalking(),l=new fa({definition:a}),u=new fa({definition:o});return QG([l,u],n)}function Fw(t,e){e:for(let r=0;r<t.length;r++){const n=t[r];if(n.length===e.length){for(let i=0;i<n.length;i++){const a=e[i],s=n[i];if((a===s||s.categoryMatchesMap[a.tokenTypeIdx]!==void 0)===!1)continue e}return!0}}return!1}function Swe(t,e){return t.length<e.length&&vs(t,(r,n)=>{const i=e[n];return r===i||i.categoryMatchesMap[r.tokenTypeIdx]})}function JG(t){return vs(t,e=>vs(e,r=>vs(r,n=>Sr(n.categoryMatches))))}function Cwe(t){const e=t.lookaheadStrategy.validate({rules:t.rules,tokenTypes:t.tokenTypes,grammarName:t.grammarName});return ft(e,r=>Object.assign({type:Xi.CUSTOM_LOOKAHEAD_VALIDATION},r))}function Awe(t,e,r,n){const i=Ca(t,l=>_we(l,r)),a=zwe(t,e,r),s=Ca(t,l=>Pwe(l,r)),o=Ca(t,l=>Nwe(l,t,n,r));return i.concat(a,s,o)}function _we(t,e){const r=new Rwe;t.accept(r);const n=r.allProductions,i=z0e(n,Lwe),a=Cs(i,o=>o.length>1);return ft(Pr(a),o=>{const l=Ts(o),u=e.buildDuplicateFoundError(t,o),h=zs(l),d={message:u,type:Xi.DUPLICATE_PRODUCTIONS,ruleName:t.name,dslName:h,occurrence:l.idx},f=eU(l);return f&&(d.parameter=f),d})}function Lwe(t){return`${zs(t)}_#_${t.idx}_#_${eU(t)}`}function eU(t){return t instanceof qr?t.terminalType.name:t instanceof Yi?t.nonTerminalName:""}class Rwe extends $d{constructor(){super(...arguments),this.allProductions=[]}visitNonTerminal(e){this.allProductions.push(e)}visitOption(e){this.allProductions.push(e)}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}visitAlternation(e){this.allProductions.push(e)}visitTerminal(e){this.allProductions.push(e)}}function Nwe(t,e,r,n){const i=[];if(Cn(e,(s,o)=>o.name===t.name?s+1:s,0)>1){const s=n.buildDuplicateRuleNameError({topLevelRule:t,grammarName:r});i.push({message:s,type:Xi.DUPLICATE_RULE_NAME,ruleName:t.name})}return i}function Dwe(t,e,r){const n=[];let i;return Zi(e,t)||(i=`Invalid rule override, rule: ->${t}<- cannot be overridden in the grammar: ->${r}<-as it is not defined in any of the super grammars `,n.push({message:i,type:Xi.INVALID_RULE_OVERRIDE,ruleName:t})),n}function tU(t,e,r,n=[]){const i=[],a=mm(e.definition);if(Sr(a))return[];{const s=t.name;Zi(a,t)&&i.push({message:r.buildLeftRecursionError({topLevelRule:t,leftRecursionPath:n}),type:Xi.LEFT_RECURSION,ruleName:s});const l=E2(a,n.concat([t])),u=Ca(l,h=>{const d=Fn(n);return d.push(h),tU(t,h,r,d)});return i.concat(u)}}function mm(t){let e=[];if(Sr(t))return e;const r=Ts(t);if(r instanceof Yi)e.push(r.referencedRule);else if(r instanceof fa||r instanceof ui||r instanceof Ma||r instanceof Ia||r instanceof va||r instanceof on)e=e.concat(mm(r.definition));else if(r instanceof ya)e=Xn(ft(r.definition,a=>mm(a.definition)));else if(!(r instanceof qr))throw Error("non exhaustive match");const n=ey(r),i=t.length>1;if(n&&i){const a=ni(t);return e.concat(mm(a))}else return e}class Nk extends $d{constructor(){super(...arguments),this.alternations=[]}visitAlternation(e){this.alternations.push(e)}}function Mwe(t,e){const r=new Nk;t.accept(r);const n=r.alternations;return Ca(n,a=>{const s=ep(a.definition);return Ca(s,(o,l)=>{const u=KG([o],[],hg,1);return Sr(u)?[{message:e.buildEmptyAlternationError({topLevelRule:t,alternation:a,emptyChoiceIdx:l}),type:Xi.NONE_LAST_EMPTY_ALT,ruleName:t.name,occurrence:a.idx,alternative:l+1}]:[]})})}function Iwe(t,e,r){const n=new Nk;t.accept(n);let i=n.alternations;return i=S2(i,s=>s.ignoreAmbiguities===!0),Ca(i,s=>{const o=s.idx,l=s.maxLookahead||e,u=J2(o,t,l,s),h=Fwe(u,s,t,r),d=$we(u,s,t,r);return h.concat(d)})}class Owe extends $d{constructor(){super(...arguments),this.allProductions=[]}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}}function Pwe(t,e){const r=new Nk;t.accept(r);const n=r.alternations;return Ca(n,a=>a.definition.length>255?[{message:e.buildTooManyAlternativesError({topLevelRule:t,alternation:a}),type:Xi.TOO_MANY_ALTS,ruleName:t.name,occurrence:a.idx}]:[])}function Bwe(t,e,r){const n=[];return Ie(t,i=>{const a=new Owe;i.accept(a);const s=a.allProductions;Ie(s,o=>{const l=Rk(o),u=o.maxLookahead||e,h=o.idx,f=ex(h,i,l,u)[0];if(Sr(Xn(f))){const p=r.buildEmptyRepetitionError({topLevelRule:i,repetition:o});n.push({message:p,type:Xi.NO_NON_EMPTY_LOOKAHEAD,ruleName:i.name})}})}),n}function Fwe(t,e,r,n){const i=[],a=Cn(t,(o,l,u)=>(e.definition[u].ignoreAmbiguities===!0||Ie(l,h=>{const d=[u];Ie(t,(f,p)=>{u!==p&&Fw(f,h)&&e.definition[p].ignoreAmbiguities!==!0&&d.push(p)}),d.length>1&&!Fw(i,h)&&(i.push(h),o.push({alts:d,path:h}))}),o),[]);return ft(a,o=>{const l=ft(o.alts,h=>h+1);return{message:n.buildAlternationAmbiguityError({topLevelRule:r,alternation:e,ambiguityIndices:l,prefixPath:o.path}),type:Xi.AMBIGUOUS_ALTS,ruleName:r.name,occurrence:e.idx,alternatives:o.alts}})}function $we(t,e,r,n){const i=Cn(t,(s,o,l)=>{const u=ft(o,h=>({idx:l,path:h}));return s.concat(u)},[]);return Yp(Ca(i,s=>{if(e.definition[s.idx].ignoreAmbiguities===!0)return[];const l=s.idx,u=s.path,h=cn(i,f=>e.definition[f.idx].ignoreAmbiguities!==!0&&f.idx<l&&Swe(f.path,u));return ft(h,f=>{const p=[f.idx+1,l+1],g=e.idx===0?"":e.idx;return{message:n.buildAlternationPrefixAmbiguityError({topLevelRule:r,alternation:e,ambiguityIndices:p,prefixPath:f.path}),type:Xi.AMBIGUOUS_PREFIX_ALTS,ruleName:r.name,occurrence:g,alternatives:p}})}))}function zwe(t,e,r){const n=[],i=ft(e,a=>a.name);return Ie(t,a=>{const s=a.name;if(Zi(i,s)){const o=r.buildNamespaceConflictError(a);n.push({message:o,type:Xi.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:s})}}),n}function Vwe(t){const e=T2(t,{errMsgProvider:hwe}),r={};return Ie(t.rules,n=>{r[n.name]=n}),dwe(r,e.errMsgProvider)}function Gwe(t){return t=T2(t,{errMsgProvider:Xc}),Awe(t.rules,t.tokenTypes,t.errMsgProvider,t.grammarName)}const rU="MismatchedTokenException",nU="NoViableAltException",iU="EarlyExitException",aU="NotAllInputParsedException",sU=[rU,nU,iU,aU];Object.freeze(sU);function ny(t){return Zi(sU,t.name)}class tx extends Error{constructor(e,r){super(e),this.token=r,this.resyncedTokens=[],Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}class oU extends tx{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=rU}}class Uwe extends tx{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=nU}}class Wwe extends tx{constructor(e,r){super(e,r),this.name=aU}}class Hwe extends tx{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=iU}}const d3={},lU="InRuleRecoveryException";class qwe extends Error{constructor(e){super(e),this.name=lU}}class Ywe{initRecoverable(e){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=Ft(e,"recoveryEnabled")?e.recoveryEnabled:Jo.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=Xwe)}getTokenToInsert(e){const r=Lk(e,"",NaN,NaN,NaN,NaN,NaN,NaN);return r.isInsertedInRecovery=!0,r}canTokenTypeBeInsertedInRecovery(e){return!0}canTokenTypeBeDeletedInRecovery(e){return!0}tryInRepetitionRecovery(e,r,n,i){const a=this.findReSyncTokenType(),s=this.exportLexerState(),o=[];let l=!1;const u=this.LA(1);let h=this.LA(1);const d=()=>{const f=this.LA(0),p=this.errorMessageProvider.buildMismatchTokenMessage({expected:i,actual:u,previous:f,ruleName:this.getCurrRuleFullName()}),g=new oU(p,u,this.LA(0));g.resyncedTokens=ep(o),this.SAVE_ERROR(g)};for(;!l;)if(this.tokenMatcher(h,i)){d();return}else if(n.call(this)){d(),e.apply(this,r);return}else this.tokenMatcher(h,a)?l=!0:(h=this.SKIP_TOKEN(),this.addToResyncTokens(h,o));this.importLexerState(s)}shouldInRepetitionRecoveryBeTried(e,r,n){return!(n===!1||this.tokenMatcher(this.LA(1),e)||this.isBackTracking()||this.canPerformInRuleRecovery(e,this.getFollowsForInRuleRecovery(e,r)))}getFollowsForInRuleRecovery(e,r){const n=this.getCurrentGrammarPath(e,r);return this.getNextPossibleTokenTypes(n)}tryInRuleRecovery(e,r){if(this.canRecoverWithSingleTokenInsertion(e,r))return this.getTokenToInsert(e);if(this.canRecoverWithSingleTokenDeletion(e)){const n=this.SKIP_TOKEN();return this.consumeToken(),n}throw new qwe("sad sad panda")}canPerformInRuleRecovery(e,r){return this.canRecoverWithSingleTokenInsertion(e,r)||this.canRecoverWithSingleTokenDeletion(e)}canRecoverWithSingleTokenInsertion(e,r){if(!this.canTokenTypeBeInsertedInRecovery(e)||Sr(r))return!1;const n=this.LA(1);return jo(r,a=>this.tokenMatcher(n,a))!==void 0}canRecoverWithSingleTokenDeletion(e){return this.canTokenTypeBeDeletedInRecovery(e)?this.tokenMatcher(this.LA(2),e):!1}isInCurrentRuleReSyncSet(e){const r=this.getCurrFollowKey(),n=this.getFollowSetFromFollowKey(r);return Zi(n,e)}findReSyncTokenType(){const e=this.flattenFollowSet();let r=this.LA(1),n=2;for(;;){const i=jo(e,a=>jG(r,a));if(i!==void 0)return i;r=this.LA(n),n++}}getCurrFollowKey(){if(this.RULE_STACK.length===1)return d3;const e=this.getLastExplicitRuleShortName(),r=this.getLastExplicitRuleOccurrenceIndex(),n=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(e),idxInCallingRule:r,inRule:this.shortRuleNameToFullName(n)}}buildFullFollowKeyStack(){const e=this.RULE_STACK,r=this.RULE_OCCURRENCE_STACK;return ft(e,(n,i)=>i===0?d3:{ruleName:this.shortRuleNameToFullName(n),idxInCallingRule:r[i],inRule:this.shortRuleNameToFullName(e[i-1])})}flattenFollowSet(){const e=ft(this.buildFullFollowKeyStack(),r=>this.getFollowSetFromFollowKey(r));return Xn(e)}getFollowSetFromFollowKey(e){if(e===d3)return[jl];const r=e.ruleName+e.idxInCallingRule+FG+e.inRule;return this.resyncFollows[r]}addToResyncTokens(e,r){return this.tokenMatcher(e,jl)||r.push(e),r}reSyncTo(e){const r=[];let n=this.LA(1);for(;this.tokenMatcher(n,e)===!1;)n=this.SKIP_TOKEN(),this.addToResyncTokens(n,r);return ep(r)}attemptInRepetitionRecovery(e,r,n,i,a,s,o){}getCurrentGrammarPath(e,r){const n=this.getHumanReadableRuleStack(),i=Fn(this.RULE_OCCURRENCE_STACK);return{ruleStack:n,occurrenceStack:i,lastTok:e,lastTokOccurrence:r}}getHumanReadableRuleStack(){return ft(this.RULE_STACK,e=>this.shortRuleNameToFullName(e))}}function Xwe(t,e,r,n,i,a,s){const o=this.getKeyForAutomaticLookahead(n,i);let l=this.firstAfterRepMap[o];if(l===void 0){const f=this.getCurrRuleFullName(),p=this.getGAstProductions()[f];l=new a(p,i).startWalking(),this.firstAfterRepMap[o]=l}let u=l.token,h=l.occurrence;const d=l.isEndOfRule;this.RULE_STACK.length===1&&d&&u===void 0&&(u=jl,h=1),!(u===void 0||h===void 0)&&this.shouldInRepetitionRecoveryBeTried(u,h,s)&&this.tryInRepetitionRecovery(t,e,r,u)}const jwe=4,hc=8,cU=1<<hc,uU=2<<hc,$w=3<<hc,zw=4<<hc,Vw=5<<hc,vm=6<<hc;function f3(t,e,r){return r|e|t}class Dk{constructor(e){var r;this.maxLookahead=(r=e?.maxLookahead)!==null&&r!==void 0?r:Jo.maxLookahead}validate(e){const r=this.validateNoLeftRecursion(e.rules);if(Sr(r)){const n=this.validateEmptyOrAlternatives(e.rules),i=this.validateAmbiguousAlternationAlternatives(e.rules,this.maxLookahead),a=this.validateSomeNonEmptyLookaheadPath(e.rules,this.maxLookahead);return[...r,...n,...i,...a]}return r}validateNoLeftRecursion(e){return Ca(e,r=>tU(r,r,Xc))}validateEmptyOrAlternatives(e){return Ca(e,r=>Mwe(r,Xc))}validateAmbiguousAlternationAlternatives(e,r){return Ca(e,n=>Iwe(n,r,Xc))}validateSomeNonEmptyLookaheadPath(e,r){return Bwe(e,r,Xc)}buildLookaheadForAlternation(e){return xwe(e.prodOccurrence,e.rule,e.maxLookahead,e.hasPredicates,e.dynamicTokensEnabled,wwe)}buildLookaheadForOptional(e){return bwe(e.prodOccurrence,e.rule,e.maxLookahead,e.dynamicTokensEnabled,Rk(e.prodType),Twe)}}class Kwe{initLooksAhead(e){this.dynamicTokensEnabled=Ft(e,"dynamicTokensEnabled")?e.dynamicTokensEnabled:Jo.dynamicTokensEnabled,this.maxLookahead=Ft(e,"maxLookahead")?e.maxLookahead:Jo.maxLookahead,this.lookaheadStrategy=Ft(e,"lookaheadStrategy")?e.lookaheadStrategy:new Dk({maxLookahead:this.maxLookahead}),this.lookAheadFuncsCache=new Map}preComputeLookaheadFunctions(e){Ie(e,r=>{this.TRACE_INIT(`${r.name} Rule Lookahead`,()=>{const{alternation:n,repetition:i,option:a,repetitionMandatory:s,repetitionMandatoryWithSeparator:o,repetitionWithSeparator:l}=Qwe(r);Ie(n,u=>{const h=u.idx===0?"":u.idx;this.TRACE_INIT(`${zs(u)}${h}`,()=>{const d=this.lookaheadStrategy.buildLookaheadForAlternation({prodOccurrence:u.idx,rule:r,maxLookahead:u.maxLookahead||this.maxLookahead,hasPredicates:u.hasPredicates,dynamicTokensEnabled:this.dynamicTokensEnabled}),f=f3(this.fullRuleNameToShort[r.name],cU,u.idx);this.setLaFuncCache(f,d)})}),Ie(i,u=>{this.computeLookaheadFunc(r,u.idx,$w,"Repetition",u.maxLookahead,zs(u))}),Ie(a,u=>{this.computeLookaheadFunc(r,u.idx,uU,"Option",u.maxLookahead,zs(u))}),Ie(s,u=>{this.computeLookaheadFunc(r,u.idx,zw,"RepetitionMandatory",u.maxLookahead,zs(u))}),Ie(o,u=>{this.computeLookaheadFunc(r,u.idx,vm,"RepetitionMandatoryWithSeparator",u.maxLookahead,zs(u))}),Ie(l,u=>{this.computeLookaheadFunc(r,u.idx,Vw,"RepetitionWithSeparator",u.maxLookahead,zs(u))})})})}computeLookaheadFunc(e,r,n,i,a,s){this.TRACE_INIT(`${s}${r===0?"":r}`,()=>{const o=this.lookaheadStrategy.buildLookaheadForOptional({prodOccurrence:r,rule:e,maxLookahead:a||this.maxLookahead,dynamicTokensEnabled:this.dynamicTokensEnabled,prodType:i}),l=f3(this.fullRuleNameToShort[e.name],n,r);this.setLaFuncCache(l,o)})}getKeyForAutomaticLookahead(e,r){const n=this.getLastExplicitRuleShortName();return f3(n,e,r)}getLaFuncFromCache(e){return this.lookAheadFuncsCache.get(e)}setLaFuncCache(e,r){this.lookAheadFuncsCache.set(e,r)}}class Zwe extends $d{constructor(){super(...arguments),this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}reset(){this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}visitOption(e){this.dslMethods.option.push(e)}visitRepetitionWithSeparator(e){this.dslMethods.repetitionWithSeparator.push(e)}visitRepetitionMandatory(e){this.dslMethods.repetitionMandatory.push(e)}visitRepetitionMandatoryWithSeparator(e){this.dslMethods.repetitionMandatoryWithSeparator.push(e)}visitRepetition(e){this.dslMethods.repetition.push(e)}visitAlternation(e){this.dslMethods.alternation.push(e)}}const b1=new Zwe;function Qwe(t){b1.reset(),t.accept(b1);const e=b1.dslMethods;return b1.reset(),e}function O9(t,e){isNaN(t.startOffset)===!0?(t.startOffset=e.startOffset,t.endOffset=e.endOffset):t.endOffset<e.endOffset&&(t.endOffset=e.endOffset)}function P9(t,e){isNaN(t.startOffset)===!0?(t.startOffset=e.startOffset,t.startColumn=e.startColumn,t.startLine=e.startLine,t.endOffset=e.endOffset,t.endColumn=e.endColumn,t.endLine=e.endLine):t.endOffset<e.endOffset&&(t.endOffset=e.endOffset,t.endColumn=e.endColumn,t.endLine=e.endLine)}function Jwe(t,e,r){t.children[r]===void 0?t.children[r]=[e]:t.children[r].push(e)}function eTe(t,e,r){t.children[e]===void 0?t.children[e]=[r]:t.children[e].push(r)}const tTe="name";function hU(t,e){Object.defineProperty(t,tTe,{enumerable:!1,configurable:!0,writable:!1,value:e})}function rTe(t,e){const r=In(t),n=r.length;for(let i=0;i<n;i++){const a=r[i],s=t[a],o=s.length;for(let l=0;l<o;l++){const u=s[l];u.tokenTypeIdx===void 0&&this[u.name](u.children,e)}}}function nTe(t,e){const r=function(){};hU(r,t+"BaseSemantics");const n={visit:function(i,a){if(ar(i)&&(i=i[0]),!Rr(i))return this[i.name](i.children,a)},validateVisitor:function(){const i=aTe(this,e);if(!Sr(i)){const a=ft(i,s=>s.msg);throw Error(`Errors Detected in CST Visitor <${this.constructor.name}>:
	${a.join(`

`).replace(/\n/g,`
	`)}`)}}};return r.prototype=n,r.prototype.constructor=r,r._RULE_NAMES=e,r}function iTe(t,e,r){const n=function(){};hU(n,t+"BaseSemanticsWithDefaults");const i=Object.create(r.prototype);return Ie(e,a=>{i[a]=rTe}),n.prototype=i,n.prototype.constructor=n,n}var Gw;(function(t){t[t.REDUNDANT_METHOD=0]="REDUNDANT_METHOD",t[t.MISSING_METHOD=1]="MISSING_METHOD"})(Gw||(Gw={}));function aTe(t,e){return sTe(t,e)}function sTe(t,e){const r=cn(e,i=>Qa(t[i])===!1),n=ft(r,i=>({msg:`Missing visitor method: <${i}> on ${t.constructor.name} CST Visitor.`,type:Gw.MISSING_METHOD,methodName:i}));return Yp(n)}class oTe{initTreeBuilder(e){if(this.CST_STACK=[],this.outputCst=e.outputCst,this.nodeLocationTracking=Ft(e,"nodeLocationTracking")?e.nodeLocationTracking:Jo.nodeLocationTracking,!this.outputCst)this.cstInvocationStateUpdate=Rn,this.cstFinallyStateUpdate=Rn,this.cstPostTerminal=Rn,this.cstPostNonTerminal=Rn,this.cstPostRule=Rn;else if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=P9,this.setNodeLocationFromNode=P9,this.cstPostRule=Rn,this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=Rn,this.setNodeLocationFromNode=Rn,this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=O9,this.setNodeLocationFromNode=O9,this.cstPostRule=Rn,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=Rn,this.setNodeLocationFromNode=Rn,this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else if(/none/i.test(this.nodeLocationTracking))this.setNodeLocationFromToken=Rn,this.setNodeLocationFromNode=Rn,this.cstPostRule=Rn,this.setInitialNodeLocation=Rn;else throw Error(`Invalid <nodeLocationTracking> config option: "${e.nodeLocationTracking}"`)}setInitialNodeLocationOnlyOffsetRecovery(e){e.location={startOffset:NaN,endOffset:NaN}}setInitialNodeLocationOnlyOffsetRegular(e){e.location={startOffset:this.LA(1).startOffset,endOffset:NaN}}setInitialNodeLocationFullRecovery(e){e.location={startOffset:NaN,startLine:NaN,startColumn:NaN,endOffset:NaN,endLine:NaN,endColumn:NaN}}setInitialNodeLocationFullRegular(e){const r=this.LA(1);e.location={startOffset:r.startOffset,startLine:r.startLine,startColumn:r.startColumn,endOffset:NaN,endLine:NaN,endColumn:NaN}}cstInvocationStateUpdate(e){const r={name:e,children:Object.create(null)};this.setInitialNodeLocation(r),this.CST_STACK.push(r)}cstFinallyStateUpdate(){this.CST_STACK.pop()}cstPostRuleFull(e){const r=this.LA(0),n=e.location;n.startOffset<=r.startOffset?(n.endOffset=r.endOffset,n.endLine=r.endLine,n.endColumn=r.endColumn):(n.startOffset=NaN,n.startLine=NaN,n.startColumn=NaN)}cstPostRuleOnlyOffset(e){const r=this.LA(0),n=e.location;n.startOffset<=r.startOffset?n.endOffset=r.endOffset:n.startOffset=NaN}cstPostTerminal(e,r){const n=this.CST_STACK[this.CST_STACK.length-1];Jwe(n,r,e),this.setNodeLocationFromToken(n.location,r)}cstPostNonTerminal(e,r){const n=this.CST_STACK[this.CST_STACK.length-1];eTe(n,r,e),this.setNodeLocationFromNode(n.location,e.location)}getBaseCstVisitorConstructor(){if(Rr(this.baseCstVisitorConstructor)){const e=nTe(this.className,In(this.gastProductionsCache));return this.baseCstVisitorConstructor=e,e}return this.baseCstVisitorConstructor}getBaseCstVisitorConstructorWithDefaults(){if(Rr(this.baseCstVisitorWithDefaultsConstructor)){const e=iTe(this.className,In(this.gastProductionsCache),this.getBaseCstVisitorConstructor());return this.baseCstVisitorWithDefaultsConstructor=e,e}return this.baseCstVisitorWithDefaultsConstructor}getLastExplicitRuleShortName(){const e=this.RULE_STACK;return e[e.length-1]}getPreviousExplicitRuleShortName(){const e=this.RULE_STACK;return e[e.length-2]}getLastExplicitRuleOccurrenceIndex(){const e=this.RULE_OCCURRENCE_STACK;return e[e.length-1]}}class lTe{initLexerAdapter(){this.tokVector=[],this.tokVectorLength=0,this.currIdx=-1}set input(e){if(this.selfAnalysisDone!==!0)throw Error("Missing <performSelfAnalysis> invocation at the end of the Parser's constructor.");this.reset(),this.tokVector=e,this.tokVectorLength=e.length}get input(){return this.tokVector}SKIP_TOKEN(){return this.currIdx<=this.tokVector.length-2?(this.consumeToken(),this.LA(1)):ay}LA(e){const r=this.currIdx+e;return r<0||this.tokVectorLength<=r?ay:this.tokVector[r]}consumeToken(){this.currIdx++}exportLexerState(){return this.currIdx}importLexerState(e){this.currIdx=e}resetLexerState(){this.currIdx=-1}moveToTerminatedState(){this.currIdx=this.tokVector.length-1}getLexerPosition(){return this.exportLexerState()}}class cTe{ACTION(e){return e.call(this)}consume(e,r,n){return this.consumeInternal(r,e,n)}subrule(e,r,n){return this.subruleInternal(r,e,n)}option(e,r){return this.optionInternal(r,e)}or(e,r){return this.orInternal(r,e)}many(e,r){return this.manyInternal(e,r)}atLeastOne(e,r){return this.atLeastOneInternal(e,r)}CONSUME(e,r){return this.consumeInternal(e,0,r)}CONSUME1(e,r){return this.consumeInternal(e,1,r)}CONSUME2(e,r){return this.consumeInternal(e,2,r)}CONSUME3(e,r){return this.consumeInternal(e,3,r)}CONSUME4(e,r){return this.consumeInternal(e,4,r)}CONSUME5(e,r){return this.consumeInternal(e,5,r)}CONSUME6(e,r){return this.consumeInternal(e,6,r)}CONSUME7(e,r){return this.consumeInternal(e,7,r)}CONSUME8(e,r){return this.consumeInternal(e,8,r)}CONSUME9(e,r){return this.consumeInternal(e,9,r)}SUBRULE(e,r){return this.subruleInternal(e,0,r)}SUBRULE1(e,r){return this.subruleInternal(e,1,r)}SUBRULE2(e,r){return this.subruleInternal(e,2,r)}SUBRULE3(e,r){return this.subruleInternal(e,3,r)}SUBRULE4(e,r){return this.subruleInternal(e,4,r)}SUBRULE5(e,r){return this.subruleInternal(e,5,r)}SUBRULE6(e,r){return this.subruleInternal(e,6,r)}SUBRULE7(e,r){return this.subruleInternal(e,7,r)}SUBRULE8(e,r){return this.subruleInternal(e,8,r)}SUBRULE9(e,r){return this.subruleInternal(e,9,r)}OPTION(e){return this.optionInternal(e,0)}OPTION1(e){return this.optionInternal(e,1)}OPTION2(e){return this.optionInternal(e,2)}OPTION3(e){return this.optionInternal(e,3)}OPTION4(e){return this.optionInternal(e,4)}OPTION5(e){return this.optionInternal(e,5)}OPTION6(e){return this.optionInternal(e,6)}OPTION7(e){return this.optionInternal(e,7)}OPTION8(e){return this.optionInternal(e,8)}OPTION9(e){return this.optionInternal(e,9)}OR(e){return this.orInternal(e,0)}OR1(e){return this.orInternal(e,1)}OR2(e){return this.orInternal(e,2)}OR3(e){return this.orInternal(e,3)}OR4(e){return this.orInternal(e,4)}OR5(e){return this.orInternal(e,5)}OR6(e){return this.orInternal(e,6)}OR7(e){return this.orInternal(e,7)}OR8(e){return this.orInternal(e,8)}OR9(e){return this.orInternal(e,9)}MANY(e){this.manyInternal(0,e)}MANY1(e){this.manyInternal(1,e)}MANY2(e){this.manyInternal(2,e)}MANY3(e){this.manyInternal(3,e)}MANY4(e){this.manyInternal(4,e)}MANY5(e){this.manyInternal(5,e)}MANY6(e){this.manyInternal(6,e)}MANY7(e){this.manyInternal(7,e)}MANY8(e){this.manyInternal(8,e)}MANY9(e){this.manyInternal(9,e)}MANY_SEP(e){this.manySepFirstInternal(0,e)}MANY_SEP1(e){this.manySepFirstInternal(1,e)}MANY_SEP2(e){this.manySepFirstInternal(2,e)}MANY_SEP3(e){this.manySepFirstInternal(3,e)}MANY_SEP4(e){this.manySepFirstInternal(4,e)}MANY_SEP5(e){this.manySepFirstInternal(5,e)}MANY_SEP6(e){this.manySepFirstInternal(6,e)}MANY_SEP7(e){this.manySepFirstInternal(7,e)}MANY_SEP8(e){this.manySepFirstInternal(8,e)}MANY_SEP9(e){this.manySepFirstInternal(9,e)}AT_LEAST_ONE(e){this.atLeastOneInternal(0,e)}AT_LEAST_ONE1(e){return this.atLeastOneInternal(1,e)}AT_LEAST_ONE2(e){this.atLeastOneInternal(2,e)}AT_LEAST_ONE3(e){this.atLeastOneInternal(3,e)}AT_LEAST_ONE4(e){this.atLeastOneInternal(4,e)}AT_LEAST_ONE5(e){this.atLeastOneInternal(5,e)}AT_LEAST_ONE6(e){this.atLeastOneInternal(6,e)}AT_LEAST_ONE7(e){this.atLeastOneInternal(7,e)}AT_LEAST_ONE8(e){this.atLeastOneInternal(8,e)}AT_LEAST_ONE9(e){this.atLeastOneInternal(9,e)}AT_LEAST_ONE_SEP(e){this.atLeastOneSepFirstInternal(0,e)}AT_LEAST_ONE_SEP1(e){this.atLeastOneSepFirstInternal(1,e)}AT_LEAST_ONE_SEP2(e){this.atLeastOneSepFirstInternal(2,e)}AT_LEAST_ONE_SEP3(e){this.atLeastOneSepFirstInternal(3,e)}AT_LEAST_ONE_SEP4(e){this.atLeastOneSepFirstInternal(4,e)}AT_LEAST_ONE_SEP5(e){this.atLeastOneSepFirstInternal(5,e)}AT_LEAST_ONE_SEP6(e){this.atLeastOneSepFirstInternal(6,e)}AT_LEAST_ONE_SEP7(e){this.atLeastOneSepFirstInternal(7,e)}AT_LEAST_ONE_SEP8(e){this.atLeastOneSepFirstInternal(8,e)}AT_LEAST_ONE_SEP9(e){this.atLeastOneSepFirstInternal(9,e)}RULE(e,r,n=sy){if(Zi(this.definedRulesNames,e)){const s={message:Xc.buildDuplicateRuleNameError({topLevelRule:e,grammarName:this.className}),type:Xi.DUPLICATE_RULE_NAME,ruleName:e};this.definitionErrors.push(s)}this.definedRulesNames.push(e);const i=this.defineRule(e,r,n);return this[e]=i,i}OVERRIDE_RULE(e,r,n=sy){const i=Dwe(e,this.definedRulesNames,this.className);this.definitionErrors=this.definitionErrors.concat(i);const a=this.defineRule(e,r,n);return this[e]=a,a}BACKTRACK(e,r){return function(){this.isBackTrackingStack.push(1);const n=this.saveRecogState();try{return e.apply(this,r),!0}catch(i){if(ny(i))return!1;throw i}finally{this.reloadRecogState(n),this.isBackTrackingStack.pop()}}}getGAstProductions(){return this.gastProductionsCache}getSerializedGastProductions(){return y5e(Pr(this.gastProductionsCache))}}class uTe{initRecognizerEngine(e,r){if(this.className=this.constructor.name,this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=ry,this.subruleIdx=0,this.definedRulesNames=[],this.tokensMap={},this.isBackTrackingStack=[],this.RULE_STACK=[],this.RULE_OCCURRENCE_STACK=[],this.gastProductionsCache={},Ft(r,"serializedGrammar"))throw Error(`The Parser's configuration can no longer contain a <serializedGrammar> property.
	See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_6-0-0
	For Further details.`);if(ar(e)){if(Sr(e))throw Error(`A Token Vocabulary cannot be empty.
	Note that the first argument for the parser constructor
	is no longer a Token vector (since v4.0).`);if(typeof e[0].startOffset=="number")throw Error(`The Parser constructor no longer accepts a token vector as the first argument.
	See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_4-0-0
	For Further details.`)}if(ar(e))this.tokensMap=Cn(e,(a,s)=>(a[s.name]=s,a),{});else if(Ft(e,"modes")&&vs(Xn(Pr(e.modes)),lwe)){const a=Xn(Pr(e.modes)),s=OE(a);this.tokensMap=Cn(s,(o,l)=>(o[l.name]=l,o),{})}else if(ha(e))this.tokensMap=Fn(e);else throw new Error("<tokensDictionary> argument must be An Array of Token constructors, A dictionary of Token constructors or an IMultiModeLexerDefinition");this.tokensMap.EOF=jl;const n=Ft(e,"modes")?Xn(Pr(e.modes)):Pr(e),i=vs(n,a=>Sr(a.categoryMatches));this.tokenMatcher=i?ry:hg,dg(Pr(this.tokensMap))}defineRule(e,r,n){if(this.selfAnalysisDone)throw Error(`Grammar rule <${e}> may not be defined after the 'performSelfAnalysis' method has been called'
Make sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.`);const i=Ft(n,"resyncEnabled")?n.resyncEnabled:sy.resyncEnabled,a=Ft(n,"recoveryValueFunc")?n.recoveryValueFunc:sy.recoveryValueFunc,s=this.ruleShortNameIdx<<jwe+hc;this.ruleShortNameIdx++,this.shortRuleNameToFull[s]=e,this.fullRuleNameToShort[e]=s;let o;return this.outputCst===!0?o=function(...h){try{this.ruleInvocationStateUpdate(s,e,this.subruleIdx),r.apply(this,h);const d=this.CST_STACK[this.CST_STACK.length-1];return this.cstPostRule(d),d}catch(d){return this.invokeRuleCatch(d,i,a)}finally{this.ruleFinallyStateUpdate()}}:o=function(...h){try{return this.ruleInvocationStateUpdate(s,e,this.subruleIdx),r.apply(this,h)}catch(d){return this.invokeRuleCatch(d,i,a)}finally{this.ruleFinallyStateUpdate()}},Object.assign(o,{ruleName:e,originalGrammarAction:r})}invokeRuleCatch(e,r,n){const i=this.RULE_STACK.length===1,a=r&&!this.isBackTracking()&&this.recoveryEnabled;if(ny(e)){const s=e;if(a){const o=this.findReSyncTokenType();if(this.isInCurrentRuleReSyncSet(o))if(s.resyncedTokens=this.reSyncTo(o),this.outputCst){const l=this.CST_STACK[this.CST_STACK.length-1];return l.recoveredNode=!0,l}else return n(e);else{if(this.outputCst){const l=this.CST_STACK[this.CST_STACK.length-1];l.recoveredNode=!0,s.partialCstResult=l}throw s}}else{if(i)return this.moveToTerminatedState(),n(e);throw s}}else throw e}optionInternal(e,r){const n=this.getKeyForAutomaticLookahead(uU,r);return this.optionInternalLogic(e,r,n)}optionInternalLogic(e,r,n){let i=this.getLaFuncFromCache(n),a;if(typeof e!="function"){a=e.DEF;const s=e.GATE;if(s!==void 0){const o=i;i=()=>s.call(this)&&o.call(this)}}else a=e;if(i.call(this)===!0)return a.call(this)}atLeastOneInternal(e,r){const n=this.getKeyForAutomaticLookahead(zw,e);return this.atLeastOneInternalLogic(e,r,n)}atLeastOneInternalLogic(e,r,n){let i=this.getLaFuncFromCache(n),a;if(typeof r!="function"){a=r.DEF;const s=r.GATE;if(s!==void 0){const o=i;i=()=>s.call(this)&&o.call(this)}}else a=r;if(i.call(this)===!0){let s=this.doSingleRepetition(a);for(;i.call(this)===!0&&s===!0;)s=this.doSingleRepetition(a)}else throw this.raiseEarlyExitException(e,tn.REPETITION_MANDATORY,r.ERR_MSG);this.attemptInRepetitionRecovery(this.atLeastOneInternal,[e,r],i,zw,e,vwe)}atLeastOneSepFirstInternal(e,r){const n=this.getKeyForAutomaticLookahead(vm,e);this.atLeastOneSepFirstInternalLogic(e,r,n)}atLeastOneSepFirstInternalLogic(e,r,n){const i=r.DEF,a=r.SEP;if(this.getLaFuncFromCache(n).call(this)===!0){i.call(this);const o=()=>this.tokenMatcher(this.LA(1),a);for(;this.tokenMatcher(this.LA(1),a)===!0;)this.CONSUME(a),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,a,o,i,D9],o,vm,e,D9)}else throw this.raiseEarlyExitException(e,tn.REPETITION_MANDATORY_WITH_SEPARATOR,r.ERR_MSG)}manyInternal(e,r){const n=this.getKeyForAutomaticLookahead($w,e);return this.manyInternalLogic(e,r,n)}manyInternalLogic(e,r,n){let i=this.getLaFuncFromCache(n),a;if(typeof r!="function"){a=r.DEF;const o=r.GATE;if(o!==void 0){const l=i;i=()=>o.call(this)&&l.call(this)}}else a=r;let s=!0;for(;i.call(this)===!0&&s===!0;)s=this.doSingleRepetition(a);this.attemptInRepetitionRecovery(this.manyInternal,[e,r],i,$w,e,mwe,s)}manySepFirstInternal(e,r){const n=this.getKeyForAutomaticLookahead(Vw,e);this.manySepFirstInternalLogic(e,r,n)}manySepFirstInternalLogic(e,r,n){const i=r.DEF,a=r.SEP;if(this.getLaFuncFromCache(n).call(this)===!0){i.call(this);const o=()=>this.tokenMatcher(this.LA(1),a);for(;this.tokenMatcher(this.LA(1),a)===!0;)this.CONSUME(a),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,a,o,i,N9],o,Vw,e,N9)}}repetitionSepSecondInternal(e,r,n,i,a){for(;n();)this.CONSUME(r),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,r,n,i,a],n,vm,e,a)}doSingleRepetition(e){const r=this.getLexerPosition();return e.call(this),this.getLexerPosition()>r}orInternal(e,r){const n=this.getKeyForAutomaticLookahead(cU,r),i=ar(e)?e:e.DEF,s=this.getLaFuncFromCache(n).call(this,i);if(s!==void 0)return i[s].ALT.call(this);this.raiseNoAltException(r,e.ERR_MSG)}ruleFinallyStateUpdate(){if(this.RULE_STACK.pop(),this.RULE_OCCURRENCE_STACK.pop(),this.cstFinallyStateUpdate(),this.RULE_STACK.length===0&&this.isAtEndOfInput()===!1){const e=this.LA(1),r=this.errorMessageProvider.buildNotAllInputParsedMessage({firstRedundant:e,ruleName:this.getCurrRuleFullName()});this.SAVE_ERROR(new Wwe(r,e))}}subruleInternal(e,r,n){let i;try{const a=n!==void 0?n.ARGS:void 0;return this.subruleIdx=r,i=e.apply(this,a),this.cstPostNonTerminal(i,n!==void 0&&n.LABEL!==void 0?n.LABEL:e.ruleName),i}catch(a){throw this.subruleInternalError(a,n,e.ruleName)}}subruleInternalError(e,r,n){throw ny(e)&&e.partialCstResult!==void 0&&(this.cstPostNonTerminal(e.partialCstResult,r!==void 0&&r.LABEL!==void 0?r.LABEL:n),delete e.partialCstResult),e}consumeInternal(e,r,n){let i;try{const a=this.LA(1);this.tokenMatcher(a,e)===!0?(this.consumeToken(),i=a):this.consumeInternalError(e,a,n)}catch(a){i=this.consumeInternalRecovery(e,r,a)}return this.cstPostTerminal(n!==void 0&&n.LABEL!==void 0?n.LABEL:e.name,i),i}consumeInternalError(e,r,n){let i;const a=this.LA(0);throw n!==void 0&&n.ERR_MSG?i=n.ERR_MSG:i=this.errorMessageProvider.buildMismatchTokenMessage({expected:e,actual:r,previous:a,ruleName:this.getCurrRuleFullName()}),this.SAVE_ERROR(new oU(i,r,a))}consumeInternalRecovery(e,r,n){if(this.recoveryEnabled&&n.name==="MismatchedTokenException"&&!this.isBackTracking()){const i=this.getFollowsForInRuleRecovery(e,r);try{return this.tryInRuleRecovery(e,i)}catch(a){throw a.name===lU?n:a}}else throw n}saveRecogState(){const e=this.errors,r=Fn(this.RULE_STACK);return{errors:e,lexerState:this.exportLexerState(),RULE_STACK:r,CST_STACK:this.CST_STACK}}reloadRecogState(e){this.errors=e.errors,this.importLexerState(e.lexerState),this.RULE_STACK=e.RULE_STACK}ruleInvocationStateUpdate(e,r,n){this.RULE_OCCURRENCE_STACK.push(n),this.RULE_STACK.push(e),this.cstInvocationStateUpdate(r)}isBackTracking(){return this.isBackTrackingStack.length!==0}getCurrRuleFullName(){const e=this.getLastExplicitRuleShortName();return this.shortRuleNameToFull[e]}shortRuleNameToFullName(e){return this.shortRuleNameToFull[e]}isAtEndOfInput(){return this.tokenMatcher(this.LA(1),jl)}reset(){this.resetLexerState(),this.subruleIdx=0,this.isBackTrackingStack=[],this.errors=[],this.RULE_STACK=[],this.CST_STACK=[],this.RULE_OCCURRENCE_STACK=[]}}class hTe{initErrorHandler(e){this._errors=[],this.errorMessageProvider=Ft(e,"errorMessageProvider")?e.errorMessageProvider:Jo.errorMessageProvider}SAVE_ERROR(e){if(ny(e))return e.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:Fn(this.RULE_OCCURRENCE_STACK)},this._errors.push(e),e;throw Error("Trying to save an Error which is not a RecognitionException")}get errors(){return Fn(this._errors)}set errors(e){this._errors=e}raiseEarlyExitException(e,r,n){const i=this.getCurrRuleFullName(),a=this.getGAstProductions()[i],o=ex(e,a,r,this.maxLookahead)[0],l=[];for(let h=1;h<=this.maxLookahead;h++)l.push(this.LA(h));const u=this.errorMessageProvider.buildEarlyExitMessage({expectedIterationPaths:o,actual:l,previous:this.LA(0),customUserDescription:n,ruleName:i});throw this.SAVE_ERROR(new Hwe(u,this.LA(1),this.LA(0)))}raiseNoAltException(e,r){const n=this.getCurrRuleFullName(),i=this.getGAstProductions()[n],a=J2(e,i,this.maxLookahead),s=[];for(let u=1;u<=this.maxLookahead;u++)s.push(this.LA(u));const o=this.LA(0),l=this.errorMessageProvider.buildNoViableAltMessage({expectedPathsPerAlt:a,actual:s,previous:o,customUserDescription:r,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new Uwe(l,this.LA(1),o))}}class dTe{initContentAssist(){}computeContentAssist(e,r){const n=this.gastProductionsCache[e];if(Rr(n))throw Error(`Rule ->${e}<- does not exist in this grammar.`);return KG([n],r,this.tokenMatcher,this.maxLookahead)}getNextPossibleTokenTypes(e){const r=Ts(e.ruleStack),i=this.getGAstProductions()[r];return new gwe(i,e).startWalking()}}const rx={description:"This Object indicates the Parser is during Recording Phase"};Object.freeze(rx);const B9=!0,F9=Math.pow(2,hc)-1,dU=XG({name:"RECORDING_PHASE_TOKEN",pattern:ca.NA});dg([dU]);const fU=Lk(dU,`This IToken indicates the Parser is in Recording Phase
	See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,-1,-1,-1,-1,-1,-1);Object.freeze(fU);const fTe={name:`This CSTNode indicates the Parser is in Recording Phase
	See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,children:{}};class pTe{initGastRecorder(e){this.recordingProdStack=[],this.RECORDING_PHASE=!1}enableRecording(){this.RECORDING_PHASE=!0,this.TRACE_INIT("Enable Recording",()=>{for(let e=0;e<10;e++){const r=e>0?e:"";this[`CONSUME${r}`]=function(n,i){return this.consumeInternalRecord(n,e,i)},this[`SUBRULE${r}`]=function(n,i){return this.subruleInternalRecord(n,e,i)},this[`OPTION${r}`]=function(n){return this.optionInternalRecord(n,e)},this[`OR${r}`]=function(n){return this.orInternalRecord(n,e)},this[`MANY${r}`]=function(n){this.manyInternalRecord(e,n)},this[`MANY_SEP${r}`]=function(n){this.manySepFirstInternalRecord(e,n)},this[`AT_LEAST_ONE${r}`]=function(n){this.atLeastOneInternalRecord(e,n)},this[`AT_LEAST_ONE_SEP${r}`]=function(n){this.atLeastOneSepFirstInternalRecord(e,n)}}this.consume=function(e,r,n){return this.consumeInternalRecord(r,e,n)},this.subrule=function(e,r,n){return this.subruleInternalRecord(r,e,n)},this.option=function(e,r){return this.optionInternalRecord(r,e)},this.or=function(e,r){return this.orInternalRecord(r,e)},this.many=function(e,r){this.manyInternalRecord(e,r)},this.atLeastOne=function(e,r){this.atLeastOneInternalRecord(e,r)},this.ACTION=this.ACTION_RECORD,this.BACKTRACK=this.BACKTRACK_RECORD,this.LA=this.LA_RECORD})}disableRecording(){this.RECORDING_PHASE=!1,this.TRACE_INIT("Deleting Recording methods",()=>{const e=this;for(let r=0;r<10;r++){const n=r>0?r:"";delete e[`CONSUME${n}`],delete e[`SUBRULE${n}`],delete e[`OPTION${n}`],delete e[`OR${n}`],delete e[`MANY${n}`],delete e[`MANY_SEP${n}`],delete e[`AT_LEAST_ONE${n}`],delete e[`AT_LEAST_ONE_SEP${n}`]}delete e.consume,delete e.subrule,delete e.option,delete e.or,delete e.many,delete e.atLeastOne,delete e.ACTION,delete e.BACKTRACK,delete e.LA})}ACTION_RECORD(e){}BACKTRACK_RECORD(e,r){return()=>!0}LA_RECORD(e){return ay}topLevelRuleRecord(e,r){try{const n=new Fd({definition:[],name:e});return n.name=e,this.recordingProdStack.push(n),r.call(this),this.recordingProdStack.pop(),n}catch(n){if(n.KNOWN_RECORDER_ERROR!==!0)try{n.message=n.message+`
	 This error was thrown during the "grammar recording phase" For more info see:
	https://chevrotain.io/docs/guide/internals.html#grammar-recording`}catch{throw n}throw n}}optionInternalRecord(e,r){return ff.call(this,ui,e,r)}atLeastOneInternalRecord(e,r){ff.call(this,Ma,r,e)}atLeastOneSepFirstInternalRecord(e,r){ff.call(this,Ia,r,e,B9)}manyInternalRecord(e,r){ff.call(this,on,r,e)}manySepFirstInternalRecord(e,r){ff.call(this,va,r,e,B9)}orInternalRecord(e,r){return gTe.call(this,e,r)}subruleInternalRecord(e,r,n){if(iy(r),!e||Ft(e,"ruleName")===!1){const o=new Error(`<SUBRULE${$9(r)}> argument is invalid expecting a Parser method reference but got: <${JSON.stringify(e)}>
 inside top level rule: <${this.recordingProdStack[0].name}>`);throw o.KNOWN_RECORDER_ERROR=!0,o}const i=Zs(this.recordingProdStack),a=e.ruleName,s=new Yi({idx:r,nonTerminalName:a,label:n?.LABEL,referencedRule:void 0});return i.definition.push(s),this.outputCst?fTe:rx}consumeInternalRecord(e,r,n){if(iy(r),!qG(e)){const s=new Error(`<CONSUME${$9(r)}> argument is invalid expecting a TokenType reference but got: <${JSON.stringify(e)}>
 inside top level rule: <${this.recordingProdStack[0].name}>`);throw s.KNOWN_RECORDER_ERROR=!0,s}const i=Zs(this.recordingProdStack),a=new qr({idx:r,terminalType:e,label:n?.LABEL});return i.definition.push(a),fU}}function ff(t,e,r,n=!1){iy(r);const i=Zs(this.recordingProdStack),a=Qa(e)?e:e.DEF,s=new t({definition:[],idx:r});return n&&(s.separator=e.SEP),Ft(e,"MAX_LOOKAHEAD")&&(s.maxLookahead=e.MAX_LOOKAHEAD),this.recordingProdStack.push(s),a.call(this),i.definition.push(s),this.recordingProdStack.pop(),rx}function gTe(t,e){iy(e);const r=Zs(this.recordingProdStack),n=ar(t)===!1,i=n===!1?t:t.DEF,a=new ya({definition:[],idx:e,ignoreAmbiguities:n&&t.IGNORE_AMBIGUITIES===!0});Ft(t,"MAX_LOOKAHEAD")&&(a.maxLookahead=t.MAX_LOOKAHEAD);const s=O$(i,o=>Qa(o.GATE));return a.hasPredicates=s,r.definition.push(a),Ie(i,o=>{const l=new fa({definition:[]});a.definition.push(l),Ft(o,"IGNORE_AMBIGUITIES")?l.ignoreAmbiguities=o.IGNORE_AMBIGUITIES:Ft(o,"GATE")&&(l.ignoreAmbiguities=!0),this.recordingProdStack.push(l),o.ALT.call(this),this.recordingProdStack.pop()}),rx}function $9(t){return t===0?"":`${t}`}function iy(t){if(t<0||t>F9){const e=new Error(`Invalid DSL Method idx value: <${t}>
	Idx value must be a none negative value smaller than ${F9+1}`);throw e.KNOWN_RECORDER_ERROR=!0,e}}class mTe{initPerformanceTracer(e){if(Ft(e,"traceInitPerf")){const r=e.traceInitPerf,n=typeof r=="number";this.traceInitMaxIdent=n?r:1/0,this.traceInitPerf=n?r>0:r}else this.traceInitMaxIdent=0,this.traceInitPerf=Jo.traceInitPerf;this.traceInitIndent=-1}TRACE_INIT(e,r){if(this.traceInitPerf===!0){this.traceInitIndent++;const n=new Array(this.traceInitIndent+1).join("	");this.traceInitIndent<this.traceInitMaxIdent&&console.log(`${n}--> <${e}>`);const{time:i,value:a}=PG(r),s=i>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&s(`${n}<-- <${e}> time: ${i}ms`),this.traceInitIndent--,a}else return r()}}function vTe(t,e){e.forEach(r=>{const n=r.prototype;Object.getOwnPropertyNames(n).forEach(i=>{if(i==="constructor")return;const a=Object.getOwnPropertyDescriptor(n,i);a&&(a.get||a.set)?Object.defineProperty(t.prototype,i,a):t.prototype[i]=r.prototype[i]})})}const ay=Lk(jl,"",NaN,NaN,NaN,NaN,NaN,NaN);Object.freeze(ay);const Jo=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:Th,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!1}),sy=Object.freeze({recoveryValueFunc:()=>{},resyncEnabled:!0});var Xi;(function(t){t[t.INVALID_RULE_NAME=0]="INVALID_RULE_NAME",t[t.DUPLICATE_RULE_NAME=1]="DUPLICATE_RULE_NAME",t[t.INVALID_RULE_OVERRIDE=2]="INVALID_RULE_OVERRIDE",t[t.DUPLICATE_PRODUCTIONS=3]="DUPLICATE_PRODUCTIONS",t[t.UNRESOLVED_SUBRULE_REF=4]="UNRESOLVED_SUBRULE_REF",t[t.LEFT_RECURSION=5]="LEFT_RECURSION",t[t.NONE_LAST_EMPTY_ALT=6]="NONE_LAST_EMPTY_ALT",t[t.AMBIGUOUS_ALTS=7]="AMBIGUOUS_ALTS",t[t.CONFLICT_TOKENS_RULES_NAMESPACE=8]="CONFLICT_TOKENS_RULES_NAMESPACE",t[t.INVALID_TOKEN_NAME=9]="INVALID_TOKEN_NAME",t[t.NO_NON_EMPTY_LOOKAHEAD=10]="NO_NON_EMPTY_LOOKAHEAD",t[t.AMBIGUOUS_PREFIX_ALTS=11]="AMBIGUOUS_PREFIX_ALTS",t[t.TOO_MANY_ALTS=12]="TOO_MANY_ALTS",t[t.CUSTOM_LOOKAHEAD_VALIDATION=13]="CUSTOM_LOOKAHEAD_VALIDATION"})(Xi||(Xi={}));function z9(t=void 0){return function(){return t}}class fg{static performSelfAnalysis(e){throw Error("The **static** `performSelfAnalysis` method has been deprecated.	\nUse the **instance** method with the same name instead.")}performSelfAnalysis(){this.TRACE_INIT("performSelfAnalysis",()=>{let e;this.selfAnalysisDone=!0;const r=this.className;this.TRACE_INIT("toFastProps",()=>{BG(this)}),this.TRACE_INIT("Grammar Recording",()=>{try{this.enableRecording(),Ie(this.definedRulesNames,i=>{const s=this[i].originalGrammarAction;let o;this.TRACE_INIT(`${i} Rule`,()=>{o=this.topLevelRuleRecord(i,s)}),this.gastProductionsCache[i]=o})}finally{this.disableRecording()}});let n=[];if(this.TRACE_INIT("Grammar Resolving",()=>{n=Vwe({rules:Pr(this.gastProductionsCache)}),this.definitionErrors=this.definitionErrors.concat(n)}),this.TRACE_INIT("Grammar Validations",()=>{if(Sr(n)&&this.skipValidations===!1){const i=Gwe({rules:Pr(this.gastProductionsCache),tokenTypes:Pr(this.tokensMap),errMsgProvider:Xc,grammarName:r}),a=Cwe({lookaheadStrategy:this.lookaheadStrategy,rules:Pr(this.gastProductionsCache),tokenTypes:Pr(this.tokensMap),grammarName:r});this.definitionErrors=this.definitionErrors.concat(i,a)}}),Sr(this.definitionErrors)&&(this.recoveryEnabled&&this.TRACE_INIT("computeAllProdsFollows",()=>{const i=S5e(Pr(this.gastProductionsCache));this.resyncFollows=i}),this.TRACE_INIT("ComputeLookaheadFunctions",()=>{var i,a;(a=(i=this.lookaheadStrategy).initialize)===null||a===void 0||a.call(i,{rules:Pr(this.gastProductionsCache)}),this.preComputeLookaheadFunctions(Pr(this.gastProductionsCache))})),!fg.DEFER_DEFINITION_ERRORS_HANDLING&&!Sr(this.definitionErrors))throw e=ft(this.definitionErrors,i=>i.message),new Error(`Parser Definition Errors detected:
 ${e.join(`
-------------------------------
`)}`)})}constructor(e,r){this.definitionErrors=[],this.selfAnalysisDone=!1;const n=this;if(n.initErrorHandler(r),n.initLexerAdapter(),n.initLooksAhead(r),n.initRecognizerEngine(e,r),n.initRecoverable(r),n.initTreeBuilder(r),n.initContentAssist(),n.initGastRecorder(r),n.initPerformanceTracer(r),Ft(r,"ignoredIssues"))throw new Error(`The <ignoredIssues> IParserConfig property has been deprecated.
	Please use the <IGNORE_AMBIGUITIES> flag on the relevant DSL method instead.
	See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#IGNORING_AMBIGUITIES
	For further details.`);this.skipValidations=Ft(r,"skipValidations")?r.skipValidations:Jo.skipValidations}}fg.DEFER_DEFINITION_ERRORS_HANDLING=!1;vTe(fg,[Ywe,Kwe,oTe,lTe,uTe,cTe,hTe,dTe,pTe,mTe]);class yTe extends fg{constructor(e,r=Jo){const n=Fn(r);n.outputCst=!1,super(e,n)}}function ld(t,e,r){return`${t.name}_${e}_${r}`}const Kl=1,xTe=2,pU=4,gU=5,pg=7,bTe=8,wTe=9,TTe=10,ETe=11,mU=12;class Mk{constructor(e){this.target=e}isEpsilon(){return!1}}class Ik extends Mk{constructor(e,r){super(e),this.tokenType=r}}class vU extends Mk{constructor(e){super(e)}isEpsilon(){return!0}}class Ok extends Mk{constructor(e,r,n){super(e),this.rule=r,this.followState=n}isEpsilon(){return!0}}function kTe(t){const e={decisionMap:{},decisionStates:[],ruleToStartState:new Map,ruleToStopState:new Map,states:[]};STe(e,t);const r=t.length;for(let n=0;n<r;n++){const i=t[n],a=zu(e,i,i);a!==void 0&&PTe(e,i,a)}return e}function STe(t,e){const r=e.length;for(let n=0;n<r;n++){const i=e[n],a=Kn(t,i,void 0,{type:xTe}),s=Kn(t,i,void 0,{type:pg});a.stop=s,t.ruleToStartState.set(i,a),t.ruleToStopState.set(i,s)}}function yU(t,e,r){return r instanceof qr?Pk(t,e,r.terminalType,r):r instanceof Yi?OTe(t,e,r):r instanceof ya?RTe(t,e,r):r instanceof ui?NTe(t,e,r):r instanceof on?CTe(t,e,r):r instanceof va?ATe(t,e,r):r instanceof Ma?_Te(t,e,r):r instanceof Ia?LTe(t,e,r):zu(t,e,r)}function CTe(t,e,r){const n=Kn(t,e,r,{type:gU});dc(t,n);const i=zd(t,e,n,r,zu(t,e,r));return bU(t,e,r,i)}function ATe(t,e,r){const n=Kn(t,e,r,{type:gU});dc(t,n);const i=zd(t,e,n,r,zu(t,e,r)),a=Pk(t,e,r.separator,r);return bU(t,e,r,i,a)}function _Te(t,e,r){const n=Kn(t,e,r,{type:pU});dc(t,n);const i=zd(t,e,n,r,zu(t,e,r));return xU(t,e,r,i)}function LTe(t,e,r){const n=Kn(t,e,r,{type:pU});dc(t,n);const i=zd(t,e,n,r,zu(t,e,r)),a=Pk(t,e,r.separator,r);return xU(t,e,r,i,a)}function RTe(t,e,r){const n=Kn(t,e,r,{type:Kl});dc(t,n);const i=ft(r.definition,s=>yU(t,e,s));return zd(t,e,n,r,...i)}function NTe(t,e,r){const n=Kn(t,e,r,{type:Kl});dc(t,n);const i=zd(t,e,n,r,zu(t,e,r));return DTe(t,e,r,i)}function zu(t,e,r){const n=cn(ft(r.definition,i=>yU(t,e,i)),i=>i!==void 0);return n.length===1?n[0]:n.length===0?void 0:ITe(t,n)}function xU(t,e,r,n,i){const a=n.left,s=n.right,o=Kn(t,e,r,{type:ETe});dc(t,o);const l=Kn(t,e,r,{type:mU});return a.loopback=o,l.loopback=o,t.decisionMap[ld(e,i?"RepetitionMandatoryWithSeparator":"RepetitionMandatory",r.idx)]=o,En(s,o),i===void 0?(En(o,a),En(o,l)):(En(o,l),En(o,i.left),En(i.right,a)),{left:a,right:l}}function bU(t,e,r,n,i){const a=n.left,s=n.right,o=Kn(t,e,r,{type:TTe});dc(t,o);const l=Kn(t,e,r,{type:mU}),u=Kn(t,e,r,{type:wTe});return o.loopback=u,l.loopback=u,En(o,a),En(o,l),En(s,u),i!==void 0?(En(u,l),En(u,i.left),En(i.right,a)):En(u,o),t.decisionMap[ld(e,i?"RepetitionWithSeparator":"Repetition",r.idx)]=o,{left:o,right:l}}function DTe(t,e,r,n){const i=n.left,a=n.right;return En(i,a),t.decisionMap[ld(e,"Option",r.idx)]=i,n}function dc(t,e){return t.decisionStates.push(e),e.decision=t.decisionStates.length-1,e.decision}function zd(t,e,r,n,...i){const a=Kn(t,e,n,{type:bTe,start:r});r.end=a;for(const o of i)o!==void 0?(En(r,o.left),En(o.right,a)):En(r,a);const s={left:r,right:a};return t.decisionMap[ld(e,MTe(n),n.idx)]=r,s}function MTe(t){if(t instanceof ya)return"Alternation";if(t instanceof ui)return"Option";if(t instanceof on)return"Repetition";if(t instanceof va)return"RepetitionWithSeparator";if(t instanceof Ma)return"RepetitionMandatory";if(t instanceof Ia)return"RepetitionMandatoryWithSeparator";throw new Error("Invalid production type encountered")}function ITe(t,e){const r=e.length;for(let a=0;a<r-1;a++){const s=e[a];let o;s.left.transitions.length===1&&(o=s.left.transitions[0]);const l=o instanceof Ok,u=o,h=e[a+1].left;s.left.type===Kl&&s.right.type===Kl&&o!==void 0&&(l&&u.followState===s.right||o.target===s.right)?(l?u.followState=h:o.target=h,BTe(t,s.right)):En(s.right,h)}const n=e[0],i=e[r-1];return{left:n.left,right:i.right}}function Pk(t,e,r,n){const i=Kn(t,e,n,{type:Kl}),a=Kn(t,e,n,{type:Kl});return Bk(i,new Ik(a,r)),{left:i,right:a}}function OTe(t,e,r){const n=r.referencedRule,i=t.ruleToStartState.get(n),a=Kn(t,e,r,{type:Kl}),s=Kn(t,e,r,{type:Kl}),o=new Ok(i,n,s);return Bk(a,o),{left:a,right:s}}function PTe(t,e,r){const n=t.ruleToStartState.get(e);En(n,r.left);const i=t.ruleToStopState.get(e);return En(r.right,i),{left:n,right:i}}function En(t,e){const r=new vU(e);Bk(t,r)}function Kn(t,e,r,n){const i=Object.assign({atn:t,production:r,epsilonOnlyTransitions:!1,rule:e,transitions:[],nextTokenWithinRule:[],stateNumber:t.states.length},n);return t.states.push(i),i}function Bk(t,e){t.transitions.length===0&&(t.epsilonOnlyTransitions=e.isEpsilon()),t.transitions.push(e)}function BTe(t,e){t.states.splice(t.states.indexOf(e),1)}const oy={};class Uw{constructor(){this.map={},this.configs=[]}get size(){return this.configs.length}finalize(){this.map={}}add(e){const r=wU(e);r in this.map||(this.map[r]=this.configs.length,this.configs.push(e))}get elements(){return this.configs}get alts(){return ft(this.configs,e=>e.alt)}get key(){let e="";for(const r in this.map)e+=r+":";return e}}function wU(t,e=!0){return`${e?`a${t.alt}`:""}s${t.state.stateNumber}:${t.stack.map(r=>r.stateNumber.toString()).join("_")}`}function FTe(t,e){const r={};return n=>{const i=n.toString();let a=r[i];return a!==void 0||(a={atnStartState:t,decision:e,states:{}},r[i]=a),a}}class TU{constructor(){this.predicates=[]}is(e){return e>=this.predicates.length||this.predicates[e]}set(e,r){this.predicates[e]=r}toString(){let e="";const r=this.predicates.length;for(let n=0;n<r;n++)e+=this.predicates[n]===!0?"1":"0";return e}}const V9=new TU;class $Te extends Dk{constructor(e){var r;super(),this.logging=(r=e?.logging)!==null&&r!==void 0?r:n=>console.log(n)}initialize(e){this.atn=kTe(e.rules),this.dfas=zTe(this.atn)}validateAmbiguousAlternationAlternatives(){return[]}validateEmptyOrAlternatives(){return[]}buildLookaheadForAlternation(e){const{prodOccurrence:r,rule:n,hasPredicates:i,dynamicTokensEnabled:a}=e,s=this.dfas,o=this.logging,l=ld(n,"Alternation",r),h=this.atn.decisionMap[l].decision,d=ft(M9({maxLookahead:1,occurrence:r,prodType:"Alternation",rule:n}),f=>ft(f,p=>p[0]));if(G9(d,!1)&&!a){const f=Cn(d,(p,g,m)=>(Ie(g,v=>{v&&(p[v.tokenTypeIdx]=m,Ie(v.categoryMatches,y=>{p[y]=m}))}),p),{});return i?function(p){var g;const m=this.LA(1),v=f[m.tokenTypeIdx];if(p!==void 0&&v!==void 0){const y=(g=p[v])===null||g===void 0?void 0:g.GATE;if(y!==void 0&&y.call(this)===!1)return}return v}:function(){const p=this.LA(1);return f[p.tokenTypeIdx]}}else return i?function(f){const p=new TU,g=f===void 0?0:f.length;for(let v=0;v<g;v++){const y=f?.[v].GATE;p.set(v,y===void 0||y.call(this))}const m=p3.call(this,s,h,p,o);return typeof m=="number"?m:void 0}:function(){const f=p3.call(this,s,h,V9,o);return typeof f=="number"?f:void 0}}buildLookaheadForOptional(e){const{prodOccurrence:r,rule:n,prodType:i,dynamicTokensEnabled:a}=e,s=this.dfas,o=this.logging,l=ld(n,i,r),h=this.atn.decisionMap[l].decision,d=ft(M9({maxLookahead:1,occurrence:r,prodType:i,rule:n}),f=>ft(f,p=>p[0]));if(G9(d)&&d[0][0]&&!a){const f=d[0],p=Xn(f);if(p.length===1&&Sr(p[0].categoryMatches)){const m=p[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===m}}else{const g=Cn(p,(m,v)=>(v!==void 0&&(m[v.tokenTypeIdx]=!0,Ie(v.categoryMatches,y=>{m[y]=!0})),m),{});return function(){const m=this.LA(1);return g[m.tokenTypeIdx]===!0}}}return function(){const f=p3.call(this,s,h,V9,o);return typeof f=="object"?!1:f===0}}}function G9(t,e=!0){const r=new Set;for(const n of t){const i=new Set;for(const a of n){if(a===void 0){if(e)break;return!1}const s=[a.tokenTypeIdx].concat(a.categoryMatches);for(const o of s)if(r.has(o)){if(!i.has(o))return!1}else r.add(o),i.add(o)}}return!0}function zTe(t){const e=t.decisionStates.length,r=Array(e);for(let n=0;n<e;n++)r[n]=FTe(t.decisionStates[n],n);return r}function p3(t,e,r,n){const i=t[e](r);let a=i.start;if(a===void 0){const o=ZTe(i.atnStartState);a=kU(i,EU(o)),i.start=a}return VTe.apply(this,[i,a,r,n])}function VTe(t,e,r,n){let i=e,a=1;const s=[];let o=this.LA(a++);for(;;){let l=YTe(i,o);if(l===void 0&&(l=GTe.apply(this,[t,i,o,a,r,n])),l===oy)return qTe(s,i,o);if(l.isAcceptState===!0)return l.prediction;i=l,s.push(o),o=this.LA(a++)}}function GTe(t,e,r,n,i,a){const s=XTe(e.configs,r,i);if(s.size===0)return U9(t,e,r,oy),oy;let o=EU(s);const l=KTe(s,i);if(l!==void 0)o.isAcceptState=!0,o.prediction=l,o.configs.uniqueAlt=l;else if(t6e(s)){const u=nd(s.alts);o.isAcceptState=!0,o.prediction=u,o.configs.uniqueAlt=u,UTe.apply(this,[t,n,s.alts,a])}return o=U9(t,e,r,o),o}function UTe(t,e,r,n){const i=[];for(let u=1;u<=e;u++)i.push(this.LA(u).tokenType);const a=t.atnStartState,s=a.rule,o=a.production,l=WTe({topLevelRule:s,ambiguityIndices:r,production:o,prefixPath:i});n(l)}function WTe(t){const e=ft(t.prefixPath,i=>Bh(i)).join(", "),r=t.production.idx===0?"":t.production.idx;let n=`Ambiguous Alternatives Detected: <${t.ambiguityIndices.join(", ")}> in <${HTe(t.production)}${r}> inside <${t.topLevelRule.name}> Rule,
<${e}> may appears as a prefix path in all these alternatives.
`;return n=n+`See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES
For Further details.`,n}function HTe(t){if(t instanceof Yi)return"SUBRULE";if(t instanceof ui)return"OPTION";if(t instanceof ya)return"OR";if(t instanceof Ma)return"AT_LEAST_ONE";if(t instanceof Ia)return"AT_LEAST_ONE_SEP";if(t instanceof va)return"MANY_SEP";if(t instanceof on)return"MANY";if(t instanceof qr)return"CONSUME";throw Error("non exhaustive match")}function qTe(t,e,r){const n=Ca(e.configs.elements,a=>a.state.transitions),i=ppe(n.filter(a=>a instanceof Ik).map(a=>a.tokenType),a=>a.tokenTypeIdx);return{actualToken:r,possibleTokenTypes:i,tokenPath:t}}function YTe(t,e){return t.edges[e.tokenTypeIdx]}function XTe(t,e,r){const n=new Uw,i=[];for(const s of t.elements){if(r.is(s.alt)===!1)continue;if(s.state.type===pg){i.push(s);continue}const o=s.state.transitions.length;for(let l=0;l<o;l++){const u=s.state.transitions[l],h=jTe(u,e);h!==void 0&&n.add({state:h,alt:s.alt,stack:s.stack})}}let a;if(i.length===0&&n.size===1&&(a=n),a===void 0){a=new Uw;for(const s of n.elements)ly(s,a)}if(i.length>0&&!JTe(a))for(const s of i)a.add(s);return a}function jTe(t,e){if(t instanceof Ik&&jG(e,t.tokenType))return t.target}function KTe(t,e){let r;for(const n of t.elements)if(e.is(n.alt)===!0){if(r===void 0)r=n.alt;else if(r!==n.alt)return}return r}function EU(t){return{configs:t,edges:{},isAcceptState:!1,prediction:-1}}function U9(t,e,r,n){return n=kU(t,n),e.edges[r.tokenTypeIdx]=n,n}function kU(t,e){if(e===oy)return e;const r=e.configs.key,n=t.states[r];return n!==void 0?n:(e.configs.finalize(),t.states[r]=e,e)}function ZTe(t){const e=new Uw,r=t.transitions.length;for(let n=0;n<r;n++){const a={state:t.transitions[n].target,alt:n,stack:[]};ly(a,e)}return e}function ly(t,e){const r=t.state;if(r.type===pg){if(t.stack.length>0){const i=[...t.stack],s={state:i.pop(),alt:t.alt,stack:i};ly(s,e)}else e.add(t);return}r.epsilonOnlyTransitions||e.add(t);const n=r.transitions.length;for(let i=0;i<n;i++){const a=r.transitions[i],s=QTe(t,a);s!==void 0&&ly(s,e)}}function QTe(t,e){if(e instanceof vU)return{state:e.target,alt:t.alt,stack:t.stack};if(e instanceof Ok){const r=[...t.stack,e.followState];return{state:e.target,alt:t.alt,stack:r}}}function JTe(t){for(const e of t.elements)if(e.state.type===pg)return!0;return!1}function e6e(t){for(const e of t.elements)if(e.state.type!==pg)return!1;return!0}function t6e(t){if(e6e(t))return!0;const e=r6e(t.elements);return n6e(e)&&!i6e(e)}function r6e(t){const e=new Map;for(const r of t){const n=wU(r,!1);let i=e.get(n);i===void 0&&(i={},e.set(n,i)),i[r.alt]=!0}return e}function n6e(t){for(const e of Array.from(t.values()))if(Object.keys(e).length>1)return!0;return!1}function i6e(t){for(const e of Array.from(t.values()))if(Object.keys(e).length===1)return!0;return!1}var W9;(function(t){function e(r){return typeof r=="string"}t.is=e})(W9||(W9={}));var Ww;(function(t){function e(r){return typeof r=="string"}t.is=e})(Ww||(Ww={}));var H9;(function(t){t.MIN_VALUE=-2147483648,t.MAX_VALUE=2147483647;function e(r){return typeof r=="number"&&t.MIN_VALUE<=r&&r<=t.MAX_VALUE}t.is=e})(H9||(H9={}));var cy;(function(t){t.MIN_VALUE=0,t.MAX_VALUE=2147483647;function e(r){return typeof r=="number"&&t.MIN_VALUE<=r&&r<=t.MAX_VALUE}t.is=e})(cy||(cy={}));var Cr;(function(t){function e(n,i){return n===Number.MAX_VALUE&&(n=cy.MAX_VALUE),i===Number.MAX_VALUE&&(i=cy.MAX_VALUE),{line:n,character:i}}t.create=e;function r(n){let i=n;return $e.objectLiteral(i)&&$e.uinteger(i.line)&&$e.uinteger(i.character)}t.is=r})(Cr||(Cr={}));var pr;(function(t){function e(n,i,a,s){if($e.uinteger(n)&&$e.uinteger(i)&&$e.uinteger(a)&&$e.uinteger(s))return{start:Cr.create(n,i),end:Cr.create(a,s)};if(Cr.is(n)&&Cr.is(i))return{start:n,end:i};throw new Error(`Range#create called with invalid arguments[${n}, ${i}, ${a}, ${s}]`)}t.create=e;function r(n){let i=n;return $e.objectLiteral(i)&&Cr.is(i.start)&&Cr.is(i.end)}t.is=r})(pr||(pr={}));var uy;(function(t){function e(n,i){return{uri:n,range:i}}t.create=e;function r(n){let i=n;return $e.objectLiteral(i)&&pr.is(i.range)&&($e.string(i.uri)||$e.undefined(i.uri))}t.is=r})(uy||(uy={}));var q9;(function(t){function e(n,i,a,s){return{targetUri:n,targetRange:i,targetSelectionRange:a,originSelectionRange:s}}t.create=e;function r(n){let i=n;return $e.objectLiteral(i)&&pr.is(i.targetRange)&&$e.string(i.targetUri)&&pr.is(i.targetSelectionRange)&&(pr.is(i.originSelectionRange)||$e.undefined(i.originSelectionRange))}t.is=r})(q9||(q9={}));var Hw;(function(t){function e(n,i,a,s){return{red:n,green:i,blue:a,alpha:s}}t.create=e;function r(n){const i=n;return $e.objectLiteral(i)&&$e.numberRange(i.red,0,1)&&$e.numberRange(i.green,0,1)&&$e.numberRange(i.blue,0,1)&&$e.numberRange(i.alpha,0,1)}t.is=r})(Hw||(Hw={}));var Y9;(function(t){function e(n,i){return{range:n,color:i}}t.create=e;function r(n){const i=n;return $e.objectLiteral(i)&&pr.is(i.range)&&Hw.is(i.color)}t.is=r})(Y9||(Y9={}));var X9;(function(t){function e(n,i,a){return{label:n,textEdit:i,additionalTextEdits:a}}t.create=e;function r(n){const i=n;return $e.objectLiteral(i)&&$e.string(i.label)&&($e.undefined(i.textEdit)||ud.is(i))&&($e.undefined(i.additionalTextEdits)||$e.typedArray(i.additionalTextEdits,ud.is))}t.is=r})(X9||(X9={}));var j9;(function(t){t.Comment="comment",t.Imports="imports",t.Region="region"})(j9||(j9={}));var K9;(function(t){function e(n,i,a,s,o,l){const u={startLine:n,endLine:i};return $e.defined(a)&&(u.startCharacter=a),$e.defined(s)&&(u.endCharacter=s),$e.defined(o)&&(u.kind=o),$e.defined(l)&&(u.collapsedText=l),u}t.create=e;function r(n){const i=n;return $e.objectLiteral(i)&&$e.uinteger(i.startLine)&&$e.uinteger(i.startLine)&&($e.undefined(i.startCharacter)||$e.uinteger(i.startCharacter))&&($e.undefined(i.endCharacter)||$e.uinteger(i.endCharacter))&&($e.undefined(i.kind)||$e.string(i.kind))}t.is=r})(K9||(K9={}));var qw;(function(t){function e(n,i){return{location:n,message:i}}t.create=e;function r(n){let i=n;return $e.defined(i)&&uy.is(i.location)&&$e.string(i.message)}t.is=r})(qw||(qw={}));var Z9;(function(t){t.Error=1,t.Warning=2,t.Information=3,t.Hint=4})(Z9||(Z9={}));var Q9;(function(t){t.Unnecessary=1,t.Deprecated=2})(Q9||(Q9={}));var J9;(function(t){function e(r){const n=r;return $e.objectLiteral(n)&&$e.string(n.href)}t.is=e})(J9||(J9={}));var hy;(function(t){function e(n,i,a,s,o,l){let u={range:n,message:i};return $e.defined(a)&&(u.severity=a),$e.defined(s)&&(u.code=s),$e.defined(o)&&(u.source=o),$e.defined(l)&&(u.relatedInformation=l),u}t.create=e;function r(n){var i;let a=n;return $e.defined(a)&&pr.is(a.range)&&$e.string(a.message)&&($e.number(a.severity)||$e.undefined(a.severity))&&($e.integer(a.code)||$e.string(a.code)||$e.undefined(a.code))&&($e.undefined(a.codeDescription)||$e.string((i=a.codeDescription)===null||i===void 0?void 0:i.href))&&($e.string(a.source)||$e.undefined(a.source))&&($e.undefined(a.relatedInformation)||$e.typedArray(a.relatedInformation,qw.is))}t.is=r})(hy||(hy={}));var cd;(function(t){function e(n,i,...a){let s={title:n,command:i};return $e.defined(a)&&a.length>0&&(s.arguments=a),s}t.create=e;function r(n){let i=n;return $e.defined(i)&&$e.string(i.title)&&$e.string(i.command)}t.is=r})(cd||(cd={}));var ud;(function(t){function e(a,s){return{range:a,newText:s}}t.replace=e;function r(a,s){return{range:{start:a,end:a},newText:s}}t.insert=r;function n(a){return{range:a,newText:""}}t.del=n;function i(a){const s=a;return $e.objectLiteral(s)&&$e.string(s.newText)&&pr.is(s.range)}t.is=i})(ud||(ud={}));var Yw;(function(t){function e(n,i,a){const s={label:n};return i!==void 0&&(s.needsConfirmation=i),a!==void 0&&(s.description=a),s}t.create=e;function r(n){const i=n;return $e.objectLiteral(i)&&$e.string(i.label)&&($e.boolean(i.needsConfirmation)||i.needsConfirmation===void 0)&&($e.string(i.description)||i.description===void 0)}t.is=r})(Yw||(Yw={}));var hd;(function(t){function e(r){const n=r;return $e.string(n)}t.is=e})(hd||(hd={}));var eL;(function(t){function e(a,s,o){return{range:a,newText:s,annotationId:o}}t.replace=e;function r(a,s,o){return{range:{start:a,end:a},newText:s,annotationId:o}}t.insert=r;function n(a,s){return{range:a,newText:"",annotationId:s}}t.del=n;function i(a){const s=a;return ud.is(s)&&(Yw.is(s.annotationId)||hd.is(s.annotationId))}t.is=i})(eL||(eL={}));var Xw;(function(t){function e(n,i){return{textDocument:n,edits:i}}t.create=e;function r(n){let i=n;return $e.defined(i)&&Jw.is(i.textDocument)&&Array.isArray(i.edits)}t.is=r})(Xw||(Xw={}));var jw;(function(t){function e(n,i,a){let s={kind:"create",uri:n};return i!==void 0&&(i.overwrite!==void 0||i.ignoreIfExists!==void 0)&&(s.options=i),a!==void 0&&(s.annotationId=a),s}t.create=e;function r(n){let i=n;return i&&i.kind==="create"&&$e.string(i.uri)&&(i.options===void 0||(i.options.overwrite===void 0||$e.boolean(i.options.overwrite))&&(i.options.ignoreIfExists===void 0||$e.boolean(i.options.ignoreIfExists)))&&(i.annotationId===void 0||hd.is(i.annotationId))}t.is=r})(jw||(jw={}));var Kw;(function(t){function e(n,i,a,s){let o={kind:"rename",oldUri:n,newUri:i};return a!==void 0&&(a.overwrite!==void 0||a.ignoreIfExists!==void 0)&&(o.options=a),s!==void 0&&(o.annotationId=s),o}t.create=e;function r(n){let i=n;return i&&i.kind==="rename"&&$e.string(i.oldUri)&&$e.string(i.newUri)&&(i.options===void 0||(i.options.overwrite===void 0||$e.boolean(i.options.overwrite))&&(i.options.ignoreIfExists===void 0||$e.boolean(i.options.ignoreIfExists)))&&(i.annotationId===void 0||hd.is(i.annotationId))}t.is=r})(Kw||(Kw={}));var Zw;(function(t){function e(n,i,a){let s={kind:"delete",uri:n};return i!==void 0&&(i.recursive!==void 0||i.ignoreIfNotExists!==void 0)&&(s.options=i),a!==void 0&&(s.annotationId=a),s}t.create=e;function r(n){let i=n;return i&&i.kind==="delete"&&$e.string(i.uri)&&(i.options===void 0||(i.options.recursive===void 0||$e.boolean(i.options.recursive))&&(i.options.ignoreIfNotExists===void 0||$e.boolean(i.options.ignoreIfNotExists)))&&(i.annotationId===void 0||hd.is(i.annotationId))}t.is=r})(Zw||(Zw={}));var Qw;(function(t){function e(r){let n=r;return n&&(n.changes!==void 0||n.documentChanges!==void 0)&&(n.documentChanges===void 0||n.documentChanges.every(i=>$e.string(i.kind)?jw.is(i)||Kw.is(i)||Zw.is(i):Xw.is(i)))}t.is=e})(Qw||(Qw={}));var tL;(function(t){function e(n){return{uri:n}}t.create=e;function r(n){let i=n;return $e.defined(i)&&$e.string(i.uri)}t.is=r})(tL||(tL={}));var rL;(function(t){function e(n,i){return{uri:n,version:i}}t.create=e;function r(n){let i=n;return $e.defined(i)&&$e.string(i.uri)&&$e.integer(i.version)}t.is=r})(rL||(rL={}));var Jw;(function(t){function e(n,i){return{uri:n,version:i}}t.create=e;function r(n){let i=n;return $e.defined(i)&&$e.string(i.uri)&&(i.version===null||$e.integer(i.version))}t.is=r})(Jw||(Jw={}));var nL;(function(t){function e(n,i,a,s){return{uri:n,languageId:i,version:a,text:s}}t.create=e;function r(n){let i=n;return $e.defined(i)&&$e.string(i.uri)&&$e.string(i.languageId)&&$e.integer(i.version)&&$e.string(i.text)}t.is=r})(nL||(nL={}));var eT;(function(t){t.PlainText="plaintext",t.Markdown="markdown";function e(r){const n=r;return n===t.PlainText||n===t.Markdown}t.is=e})(eT||(eT={}));var gp;(function(t){function e(r){const n=r;return $e.objectLiteral(r)&&eT.is(n.kind)&&$e.string(n.value)}t.is=e})(gp||(gp={}));var iL;(function(t){t.Text=1,t.Method=2,t.Function=3,t.Constructor=4,t.Field=5,t.Variable=6,t.Class=7,t.Interface=8,t.Module=9,t.Property=10,t.Unit=11,t.Value=12,t.Enum=13,t.Keyword=14,t.Snippet=15,t.Color=16,t.File=17,t.Reference=18,t.Folder=19,t.EnumMember=20,t.Constant=21,t.Struct=22,t.Event=23,t.Operator=24,t.TypeParameter=25})(iL||(iL={}));var aL;(function(t){t.PlainText=1,t.Snippet=2})(aL||(aL={}));var sL;(function(t){t.Deprecated=1})(sL||(sL={}));var oL;(function(t){function e(n,i,a){return{newText:n,insert:i,replace:a}}t.create=e;function r(n){const i=n;return i&&$e.string(i.newText)&&pr.is(i.insert)&&pr.is(i.replace)}t.is=r})(oL||(oL={}));var lL;(function(t){t.asIs=1,t.adjustIndentation=2})(lL||(lL={}));var cL;(function(t){function e(r){const n=r;return n&&($e.string(n.detail)||n.detail===void 0)&&($e.string(n.description)||n.description===void 0)}t.is=e})(cL||(cL={}));var uL;(function(t){function e(r){return{label:r}}t.create=e})(uL||(uL={}));var hL;(function(t){function e(r,n){return{items:r||[],isIncomplete:!!n}}t.create=e})(hL||(hL={}));var dy;(function(t){function e(n){return n.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}t.fromPlainText=e;function r(n){const i=n;return $e.string(i)||$e.objectLiteral(i)&&$e.string(i.language)&&$e.string(i.value)}t.is=r})(dy||(dy={}));var dL;(function(t){function e(r){let n=r;return!!n&&$e.objectLiteral(n)&&(gp.is(n.contents)||dy.is(n.contents)||$e.typedArray(n.contents,dy.is))&&(r.range===void 0||pr.is(r.range))}t.is=e})(dL||(dL={}));var fL;(function(t){function e(r,n){return n?{label:r,documentation:n}:{label:r}}t.create=e})(fL||(fL={}));var pL;(function(t){function e(r,n,...i){let a={label:r};return $e.defined(n)&&(a.documentation=n),$e.defined(i)?a.parameters=i:a.parameters=[],a}t.create=e})(pL||(pL={}));var gL;(function(t){t.Text=1,t.Read=2,t.Write=3})(gL||(gL={}));var mL;(function(t){function e(r,n){let i={range:r};return $e.number(n)&&(i.kind=n),i}t.create=e})(mL||(mL={}));var vL;(function(t){t.File=1,t.Module=2,t.Namespace=3,t.Package=4,t.Class=5,t.Method=6,t.Property=7,t.Field=8,t.Constructor=9,t.Enum=10,t.Interface=11,t.Function=12,t.Variable=13,t.Constant=14,t.String=15,t.Number=16,t.Boolean=17,t.Array=18,t.Object=19,t.Key=20,t.Null=21,t.EnumMember=22,t.Struct=23,t.Event=24,t.Operator=25,t.TypeParameter=26})(vL||(vL={}));var yL;(function(t){t.Deprecated=1})(yL||(yL={}));var xL;(function(t){function e(r,n,i,a,s){let o={name:r,kind:n,location:{uri:a,range:i}};return s&&(o.containerName=s),o}t.create=e})(xL||(xL={}));var bL;(function(t){function e(r,n,i,a){return a!==void 0?{name:r,kind:n,location:{uri:i,range:a}}:{name:r,kind:n,location:{uri:i}}}t.create=e})(bL||(bL={}));var wL;(function(t){function e(n,i,a,s,o,l){let u={name:n,detail:i,kind:a,range:s,selectionRange:o};return l!==void 0&&(u.children=l),u}t.create=e;function r(n){let i=n;return i&&$e.string(i.name)&&$e.number(i.kind)&&pr.is(i.range)&&pr.is(i.selectionRange)&&(i.detail===void 0||$e.string(i.detail))&&(i.deprecated===void 0||$e.boolean(i.deprecated))&&(i.children===void 0||Array.isArray(i.children))&&(i.tags===void 0||Array.isArray(i.tags))}t.is=r})(wL||(wL={}));var TL;(function(t){t.Empty="",t.QuickFix="quickfix",t.Refactor="refactor",t.RefactorExtract="refactor.extract",t.RefactorInline="refactor.inline",t.RefactorRewrite="refactor.rewrite",t.Source="source",t.SourceOrganizeImports="source.organizeImports",t.SourceFixAll="source.fixAll"})(TL||(TL={}));var fy;(function(t){t.Invoked=1,t.Automatic=2})(fy||(fy={}));var EL;(function(t){function e(n,i,a){let s={diagnostics:n};return i!=null&&(s.only=i),a!=null&&(s.triggerKind=a),s}t.create=e;function r(n){let i=n;return $e.defined(i)&&$e.typedArray(i.diagnostics,hy.is)&&(i.only===void 0||$e.typedArray(i.only,$e.string))&&(i.triggerKind===void 0||i.triggerKind===fy.Invoked||i.triggerKind===fy.Automatic)}t.is=r})(EL||(EL={}));var kL;(function(t){function e(n,i,a){let s={title:n},o=!0;return typeof i=="string"?(o=!1,s.kind=i):cd.is(i)?s.command=i:s.edit=i,o&&a!==void 0&&(s.kind=a),s}t.create=e;function r(n){let i=n;return i&&$e.string(i.title)&&(i.diagnostics===void 0||$e.typedArray(i.diagnostics,hy.is))&&(i.kind===void 0||$e.string(i.kind))&&(i.edit!==void 0||i.command!==void 0)&&(i.command===void 0||cd.is(i.command))&&(i.isPreferred===void 0||$e.boolean(i.isPreferred))&&(i.edit===void 0||Qw.is(i.edit))}t.is=r})(kL||(kL={}));var SL;(function(t){function e(n,i){let a={range:n};return $e.defined(i)&&(a.data=i),a}t.create=e;function r(n){let i=n;return $e.defined(i)&&pr.is(i.range)&&($e.undefined(i.command)||cd.is(i.command))}t.is=r})(SL||(SL={}));var CL;(function(t){function e(n,i){return{tabSize:n,insertSpaces:i}}t.create=e;function r(n){let i=n;return $e.defined(i)&&$e.uinteger(i.tabSize)&&$e.boolean(i.insertSpaces)}t.is=r})(CL||(CL={}));var AL;(function(t){function e(n,i,a){return{range:n,target:i,data:a}}t.create=e;function r(n){let i=n;return $e.defined(i)&&pr.is(i.range)&&($e.undefined(i.target)||$e.string(i.target))}t.is=r})(AL||(AL={}));var _L;(function(t){function e(n,i){return{range:n,parent:i}}t.create=e;function r(n){let i=n;return $e.objectLiteral(i)&&pr.is(i.range)&&(i.parent===void 0||t.is(i.parent))}t.is=r})(_L||(_L={}));var LL;(function(t){t.namespace="namespace",t.type="type",t.class="class",t.enum="enum",t.interface="interface",t.struct="struct",t.typeParameter="typeParameter",t.parameter="parameter",t.variable="variable",t.property="property",t.enumMember="enumMember",t.event="event",t.function="function",t.method="method",t.macro="macro",t.keyword="keyword",t.modifier="modifier",t.comment="comment",t.string="string",t.number="number",t.regexp="regexp",t.operator="operator",t.decorator="decorator"})(LL||(LL={}));var RL;(function(t){t.declaration="declaration",t.definition="definition",t.readonly="readonly",t.static="static",t.deprecated="deprecated",t.abstract="abstract",t.async="async",t.modification="modification",t.documentation="documentation",t.defaultLibrary="defaultLibrary"})(RL||(RL={}));var NL;(function(t){function e(r){const n=r;return $e.objectLiteral(n)&&(n.resultId===void 0||typeof n.resultId=="string")&&Array.isArray(n.data)&&(n.data.length===0||typeof n.data[0]=="number")}t.is=e})(NL||(NL={}));var DL;(function(t){function e(n,i){return{range:n,text:i}}t.create=e;function r(n){const i=n;return i!=null&&pr.is(i.range)&&$e.string(i.text)}t.is=r})(DL||(DL={}));var ML;(function(t){function e(n,i,a){return{range:n,variableName:i,caseSensitiveLookup:a}}t.create=e;function r(n){const i=n;return i!=null&&pr.is(i.range)&&$e.boolean(i.caseSensitiveLookup)&&($e.string(i.variableName)||i.variableName===void 0)}t.is=r})(ML||(ML={}));var IL;(function(t){function e(n,i){return{range:n,expression:i}}t.create=e;function r(n){const i=n;return i!=null&&pr.is(i.range)&&($e.string(i.expression)||i.expression===void 0)}t.is=r})(IL||(IL={}));var OL;(function(t){function e(n,i){return{frameId:n,stoppedLocation:i}}t.create=e;function r(n){const i=n;return $e.defined(i)&&pr.is(n.stoppedLocation)}t.is=r})(OL||(OL={}));var tT;(function(t){t.Type=1,t.Parameter=2;function e(r){return r===1||r===2}t.is=e})(tT||(tT={}));var rT;(function(t){function e(n){return{value:n}}t.create=e;function r(n){const i=n;return $e.objectLiteral(i)&&(i.tooltip===void 0||$e.string(i.tooltip)||gp.is(i.tooltip))&&(i.location===void 0||uy.is(i.location))&&(i.command===void 0||cd.is(i.command))}t.is=r})(rT||(rT={}));var PL;(function(t){function e(n,i,a){const s={position:n,label:i};return a!==void 0&&(s.kind=a),s}t.create=e;function r(n){const i=n;return $e.objectLiteral(i)&&Cr.is(i.position)&&($e.string(i.label)||$e.typedArray(i.label,rT.is))&&(i.kind===void 0||tT.is(i.kind))&&i.textEdits===void 0||$e.typedArray(i.textEdits,ud.is)&&(i.tooltip===void 0||$e.string(i.tooltip)||gp.is(i.tooltip))&&(i.paddingLeft===void 0||$e.boolean(i.paddingLeft))&&(i.paddingRight===void 0||$e.boolean(i.paddingRight))}t.is=r})(PL||(PL={}));var BL;(function(t){function e(r){return{kind:"snippet",value:r}}t.createSnippet=e})(BL||(BL={}));var FL;(function(t){function e(r,n,i,a){return{insertText:r,filterText:n,range:i,command:a}}t.create=e})(FL||(FL={}));var $L;(function(t){function e(r){return{items:r}}t.create=e})($L||($L={}));var zL;(function(t){t.Invoked=0,t.Automatic=1})(zL||(zL={}));var VL;(function(t){function e(r,n){return{range:r,text:n}}t.create=e})(VL||(VL={}));var GL;(function(t){function e(r,n){return{triggerKind:r,selectedCompletionInfo:n}}t.create=e})(GL||(GL={}));var UL;(function(t){function e(r){const n=r;return $e.objectLiteral(n)&&Ww.is(n.uri)&&$e.string(n.name)}t.is=e})(UL||(UL={}));var WL;(function(t){function e(a,s,o,l){return new a6e(a,s,o,l)}t.create=e;function r(a){let s=a;return!!($e.defined(s)&&$e.string(s.uri)&&($e.undefined(s.languageId)||$e.string(s.languageId))&&$e.uinteger(s.lineCount)&&$e.func(s.getText)&&$e.func(s.positionAt)&&$e.func(s.offsetAt))}t.is=r;function n(a,s){let o=a.getText(),l=i(s,(h,d)=>{let f=h.range.start.line-d.range.start.line;return f===0?h.range.start.character-d.range.start.character:f}),u=o.length;for(let h=l.length-1;h>=0;h--){let d=l[h],f=a.offsetAt(d.range.start),p=a.offsetAt(d.range.end);if(p<=u)o=o.substring(0,f)+d.newText+o.substring(p,o.length);else throw new Error("Overlapping edit");u=f}return o}t.applyEdits=n;function i(a,s){if(a.length<=1)return a;const o=a.length/2|0,l=a.slice(0,o),u=a.slice(o);i(l,s),i(u,s);let h=0,d=0,f=0;for(;h<l.length&&d<u.length;)s(l[h],u[d])<=0?a[f++]=l[h++]:a[f++]=u[d++];for(;h<l.length;)a[f++]=l[h++];for(;d<u.length;)a[f++]=u[d++];return a}})(WL||(WL={}));let a6e=class{constructor(e,r,n,i){this._uri=e,this._languageId=r,this._version=n,this._content=i,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(e){if(e){let r=this.offsetAt(e.start),n=this.offsetAt(e.end);return this._content.substring(r,n)}return this._content}update(e,r){this._content=e.text,this._version=r,this._lineOffsets=void 0}getLineOffsets(){if(this._lineOffsets===void 0){let e=[],r=this._content,n=!0;for(let i=0;i<r.length;i++){n&&(e.push(i),n=!1);let a=r.charAt(i);n=a==="\r"||a===`
`,a==="\r"&&i+1<r.length&&r.charAt(i+1)===`
`&&i++}n&&r.length>0&&e.push(r.length),this._lineOffsets=e}return this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let r=this.getLineOffsets(),n=0,i=r.length;if(i===0)return Cr.create(0,e);for(;n<i;){let s=Math.floor((n+i)/2);r[s]>e?i=s:n=s+1}let a=n-1;return Cr.create(a,e-r[a])}offsetAt(e){let r=this.getLineOffsets();if(e.line>=r.length)return this._content.length;if(e.line<0)return 0;let n=r[e.line],i=e.line+1<r.length?r[e.line+1]:this._content.length;return Math.max(Math.min(n+e.character,i),n)}get lineCount(){return this.getLineOffsets().length}};var $e;(function(t){const e=Object.prototype.toString;function r(p){return typeof p<"u"}t.defined=r;function n(p){return typeof p>"u"}t.undefined=n;function i(p){return p===!0||p===!1}t.boolean=i;function a(p){return e.call(p)==="[object String]"}t.string=a;function s(p){return e.call(p)==="[object Number]"}t.number=s;function o(p,g,m){return e.call(p)==="[object Number]"&&g<=p&&p<=m}t.numberRange=o;function l(p){return e.call(p)==="[object Number]"&&-2147483648<=p&&p<=2147483647}t.integer=l;function u(p){return e.call(p)==="[object Number]"&&0<=p&&p<=2147483647}t.uinteger=u;function h(p){return e.call(p)==="[object Function]"}t.func=h;function d(p){return p!==null&&typeof p=="object"}t.objectLiteral=d;function f(p,g){return Array.isArray(p)&&p.every(g)}t.typedArray=f})($e||($e={}));class s6e{constructor(){this.nodeStack=[]}get current(){var e;return(e=this.nodeStack[this.nodeStack.length-1])!==null&&e!==void 0?e:this.rootNode}buildRootNode(e){return this.rootNode=new CU(e),this.rootNode.root=this.rootNode,this.nodeStack=[this.rootNode],this.rootNode}buildCompositeNode(e){const r=new Fk;return r.grammarSource=e,r.root=this.rootNode,this.current.content.push(r),this.nodeStack.push(r),r}buildLeafNode(e,r){const n=new nT(e.startOffset,e.image.length,Rw(e),e.tokenType,!r);return n.grammarSource=r,n.root=this.rootNode,this.current.content.push(n),n}removeNode(e){const r=e.container;if(r){const n=r.content.indexOf(e);n>=0&&r.content.splice(n,1)}}addHiddenNodes(e){const r=[];for(const a of e){const s=new nT(a.startOffset,a.image.length,Rw(a),a.tokenType,!0);s.root=this.rootNode,r.push(s)}let n=this.current,i=!1;if(n.content.length>0){n.content.push(...r);return}for(;n.container;){const a=n.container.content.indexOf(n);if(a>0){n.container.content.splice(a,0,...r),i=!0;break}n=n.container}i||this.rootNode.content.unshift(...r)}construct(e){const r=this.current;typeof e.$type=="string"&&(this.current.astNode=e),e.$cstNode=r;const n=this.nodeStack.pop();n?.content.length===0&&this.removeNode(n)}}class SU{get parent(){return this.container}get feature(){return this.grammarSource}get hidden(){return!1}get astNode(){var e,r;const n=typeof((e=this._astNode)===null||e===void 0?void 0:e.$type)=="string"?this._astNode:(r=this.container)===null||r===void 0?void 0:r.astNode;if(!n)throw new Error("This node has no associated AST element");return n}set astNode(e){this._astNode=e}get element(){return this.astNode}get text(){return this.root.fullText.substring(this.offset,this.end)}}class nT extends SU{get offset(){return this._offset}get length(){return this._length}get end(){return this._offset+this._length}get hidden(){return this._hidden}get tokenType(){return this._tokenType}get range(){return this._range}constructor(e,r,n,i,a=!1){super(),this._hidden=a,this._offset=e,this._tokenType=i,this._length=r,this._range=n}}class Fk extends SU{constructor(){super(...arguments),this.content=new $k(this)}get children(){return this.content}get offset(){var e,r;return(r=(e=this.firstNonHiddenNode)===null||e===void 0?void 0:e.offset)!==null&&r!==void 0?r:0}get length(){return this.end-this.offset}get end(){var e,r;return(r=(e=this.lastNonHiddenNode)===null||e===void 0?void 0:e.end)!==null&&r!==void 0?r:0}get range(){const e=this.firstNonHiddenNode,r=this.lastNonHiddenNode;if(e&&r){if(this._rangeCache===void 0){const{range:n}=e,{range:i}=r;this._rangeCache={start:n.start,end:i.end.line<n.start.line?n.start:i.end}}return this._rangeCache}else return{start:Cr.create(0,0),end:Cr.create(0,0)}}get firstNonHiddenNode(){for(const e of this.content)if(!e.hidden)return e;return this.content[0]}get lastNonHiddenNode(){for(let e=this.content.length-1;e>=0;e--){const r=this.content[e];if(!r.hidden)return r}return this.content[this.content.length-1]}}class $k extends Array{constructor(e){super(),this.parent=e,Object.setPrototypeOf(this,$k.prototype)}push(...e){return this.addParents(e),super.push(...e)}unshift(...e){return this.addParents(e),super.unshift(...e)}splice(e,r,...n){return this.addParents(n),super.splice(e,r,...n)}addParents(e){for(const r of e)r.container=this.parent}}class CU extends Fk{get text(){return this._text.substring(this.offset,this.end)}get fullText(){return this._text}constructor(e){super(),this._text="",this._text=e??""}}const iT=Symbol("Datatype");function g3(t){return t.$type===iT}const HL="​",AU=t=>t.endsWith(HL)?t:t+HL;class _U{constructor(e){this._unorderedGroups=new Map,this.allRules=new Map,this.lexer=e.parser.Lexer;const r=this.lexer.definition,n=e.LanguageMetaData.mode==="production";this.wrapper=new h6e(r,Object.assign(Object.assign({},e.parser.ParserConfig),{skipValidations:n,errorMessageProvider:e.parser.ParserErrorMessageProvider}))}alternatives(e,r){this.wrapper.wrapOr(e,r)}optional(e,r){this.wrapper.wrapOption(e,r)}many(e,r){this.wrapper.wrapMany(e,r)}atLeastOne(e,r){this.wrapper.wrapAtLeastOne(e,r)}getRule(e){return this.allRules.get(e)}isRecording(){return this.wrapper.IS_RECORDING}get unorderedGroups(){return this._unorderedGroups}getRuleStack(){return this.wrapper.RULE_STACK}finalize(){this.wrapper.wrapSelfAnalysis()}}class o6e extends _U{get current(){return this.stack[this.stack.length-1]}constructor(e){super(e),this.nodeBuilder=new s6e,this.stack=[],this.assignmentMap=new Map,this.linker=e.references.Linker,this.converter=e.parser.ValueConverter,this.astReflection=e.shared.AstReflection}rule(e,r){const n=this.computeRuleType(e),i=this.wrapper.DEFINE_RULE(AU(e.name),this.startImplementation(n,r).bind(this));return this.allRules.set(e.name,i),e.entry&&(this.mainRule=i),i}computeRuleType(e){if(!e.fragment){if(MG(e))return iT;{const r=kk(e);return r??e.name}}}parse(e,r={}){this.nodeBuilder.buildRootNode(e);const n=this.lexerResult=this.lexer.tokenize(e);this.wrapper.input=n.tokens;const i=r.rule?this.allRules.get(r.rule):this.mainRule;if(!i)throw new Error(r.rule?`No rule found with name '${r.rule}'`:"No main rule available.");const a=i.call(this.wrapper,{});return this.nodeBuilder.addHiddenNodes(n.hidden),this.unorderedGroups.clear(),this.lexerResult=void 0,{value:a,lexerErrors:n.errors,lexerReport:n.report,parserErrors:this.wrapper.errors}}startImplementation(e,r){return n=>{const i=!this.isRecording()&&e!==void 0;if(i){const s={$type:e};this.stack.push(s),e===iT&&(s.value="")}let a;try{a=r(n)}catch{a=void 0}return a===void 0&&i&&(a=this.construct()),a}}extractHiddenTokens(e){const r=this.lexerResult.hidden;if(!r.length)return[];const n=e.startOffset;for(let i=0;i<r.length;i++)if(r[i].startOffset>n)return r.splice(0,i);return r.splice(0,r.length)}consume(e,r,n){const i=this.wrapper.wrapConsume(e,r);if(!this.isRecording()&&this.isValidToken(i)){const a=this.extractHiddenTokens(i);this.nodeBuilder.addHiddenNodes(a);const s=this.nodeBuilder.buildLeafNode(i,n),{assignment:o,isCrossRef:l}=this.getAssignment(n),u=this.current;if(o){const h=yu(n)?i.image:this.converter.convert(i.image,s);this.assign(o.operator,o.feature,h,s,l)}else if(g3(u)){let h=i.image;yu(n)||(h=this.converter.convert(h,s).toString()),u.value+=h}}}isValidToken(e){return!e.isInsertedInRecovery&&!isNaN(e.startOffset)&&typeof e.endOffset=="number"&&!isNaN(e.endOffset)}subrule(e,r,n,i,a){let s;!this.isRecording()&&!n&&(s=this.nodeBuilder.buildCompositeNode(i));const o=this.wrapper.wrapSubrule(e,r,a);!this.isRecording()&&s&&s.length>0&&this.performSubruleAssignment(o,i,s)}performSubruleAssignment(e,r,n){const{assignment:i,isCrossRef:a}=this.getAssignment(r);if(i)this.assign(i.operator,i.feature,e,n,a);else if(!i){const s=this.current;if(g3(s))s.value+=e.toString();else if(typeof e=="object"&&e){const l=this.assignWithoutOverride(e,s);this.stack.pop(),this.stack.push(l)}}}action(e,r){if(!this.isRecording()){let n=this.current;if(r.feature&&r.operator){n=this.construct(),this.nodeBuilder.removeNode(n.$cstNode),this.nodeBuilder.buildCompositeNode(r).content.push(n.$cstNode);const a={$type:e};this.stack.push(a),this.assign(r.operator,r.feature,n,n.$cstNode,!1)}else n.$type=e}}construct(){if(this.isRecording())return;const e=this.current;return V3e(e),this.nodeBuilder.construct(e),this.stack.pop(),g3(e)?this.converter.convert(e.value,e.$cstNode):(G3e(this.astReflection,e),e)}getAssignment(e){if(!this.assignmentMap.has(e)){const r=Y2(e,vu);this.assignmentMap.set(e,{assignment:r,isCrossRef:r?bk(r.terminal):!1})}return this.assignmentMap.get(e)}assign(e,r,n,i,a){const s=this.current;let o;switch(a&&typeof n=="string"?o=this.linker.buildReference(s,r,i,n):o=n,e){case"=":{s[r]=o;break}case"?=":{s[r]=!0;break}case"+=":Array.isArray(s[r])||(s[r]=[]),s[r].push(o)}}assignWithoutOverride(e,r){for(const[i,a]of Object.entries(r)){const s=e[i];s===void 0?e[i]=a:Array.isArray(s)&&Array.isArray(a)&&(a.push(...s),e[i]=a)}const n=e.$cstNode;return n&&(n.astNode=void 0,e.$cstNode=void 0),e}get definitionErrors(){return this.wrapper.definitionErrors}}class l6e{buildMismatchTokenMessage(e){return Th.buildMismatchTokenMessage(e)}buildNotAllInputParsedMessage(e){return Th.buildNotAllInputParsedMessage(e)}buildNoViableAltMessage(e){return Th.buildNoViableAltMessage(e)}buildEarlyExitMessage(e){return Th.buildEarlyExitMessage(e)}}class LU extends l6e{buildMismatchTokenMessage({expected:e,actual:r}){return`Expecting ${e.LABEL?"`"+e.LABEL+"`":e.name.endsWith(":KW")?`keyword '${e.name.substring(0,e.name.length-3)}'`:`token of type '${e.name}'`} but found \`${r.image}\`.`}buildNotAllInputParsedMessage({firstRedundant:e}){return`Expecting end of file but found \`${e.image}\`.`}}class c6e extends _U{constructor(){super(...arguments),this.tokens=[],this.elementStack=[],this.lastElementStack=[],this.nextTokenIndex=0,this.stackSize=0}action(){}construct(){}parse(e){this.resetState();const r=this.lexer.tokenize(e,{mode:"partial"});return this.tokens=r.tokens,this.wrapper.input=[...this.tokens],this.mainRule.call(this.wrapper,{}),this.unorderedGroups.clear(),{tokens:this.tokens,elementStack:[...this.lastElementStack],tokenIndex:this.nextTokenIndex}}rule(e,r){const n=this.wrapper.DEFINE_RULE(AU(e.name),this.startImplementation(r).bind(this));return this.allRules.set(e.name,n),e.entry&&(this.mainRule=n),n}resetState(){this.elementStack=[],this.lastElementStack=[],this.nextTokenIndex=0,this.stackSize=0}startImplementation(e){return r=>{const n=this.keepStackSize();try{e(r)}finally{this.resetStackSize(n)}}}removeUnexpectedElements(){this.elementStack.splice(this.stackSize)}keepStackSize(){const e=this.elementStack.length;return this.stackSize=e,e}resetStackSize(e){this.removeUnexpectedElements(),this.stackSize=e}consume(e,r,n){this.wrapper.wrapConsume(e,r),this.isRecording()||(this.lastElementStack=[...this.elementStack,n],this.nextTokenIndex=this.currIdx+1)}subrule(e,r,n,i,a){this.before(i),this.wrapper.wrapSubrule(e,r,a),this.after(i)}before(e){this.isRecording()||this.elementStack.push(e)}after(e){if(!this.isRecording()){const r=this.elementStack.lastIndexOf(e);r>=0&&this.elementStack.splice(r)}}get currIdx(){return this.wrapper.currIdx}}const u6e={recoveryEnabled:!0,nodeLocationTracking:"full",skipValidations:!0,errorMessageProvider:new LU};class h6e extends yTe{constructor(e,r){const n=r&&"maxLookahead"in r;super(e,Object.assign(Object.assign(Object.assign({},u6e),{lookaheadStrategy:n?new Dk({maxLookahead:r.maxLookahead}):new $Te({logging:r.skipValidations?()=>{}:void 0})}),r))}get IS_RECORDING(){return this.RECORDING_PHASE}DEFINE_RULE(e,r){return this.RULE(e,r)}wrapSelfAnalysis(){this.performSelfAnalysis()}wrapConsume(e,r){return this.consume(e,r)}wrapSubrule(e,r,n){return this.subrule(e,r,{ARGS:[n]})}wrapOr(e,r){this.or(e,r)}wrapOption(e,r){this.option(e,r)}wrapMany(e,r){this.many(e,r)}wrapAtLeastOne(e,r){this.atLeastOne(e,r)}}function RU(t,e,r){return d6e({parser:e,tokens:r,ruleNames:new Map},t),e}function d6e(t,e){const r=_G(e,!1),n=si(e.rules).filter(ns).filter(i=>r.has(i));for(const i of n){const a=Object.assign(Object.assign({},t),{consume:1,optional:1,subrule:1,many:1,or:1});t.parser.rule(i,wu(a,i.definition))}}function wu(t,e,r=!1){let n;if(yu(e))n=x6e(t,e);else if(q2(e))n=f6e(t,e);else if(vu(e))n=wu(t,e.terminal);else if(bk(e))n=NU(t,e);else if(xu(e))n=p6e(t,e);else if(TG(e))n=m6e(t,e);else if(EG(e))n=v6e(t,e);else if(wk(e))n=y6e(t,e);else if(M3e(e)){const i=t.consume++;n=()=>t.parser.consume(i,jl,e)}else throw new yG(e.$cstNode,`Unexpected element type: ${e.$type}`);return DU(t,r?void 0:py(e),n,e.cardinality)}function f6e(t,e){const r=Sk(e);return()=>t.parser.action(r,e)}function p6e(t,e){const r=e.rule.ref;if(ns(r)){const n=t.subrule++,i=r.fragment,a=e.arguments.length>0?g6e(r,e.arguments):()=>({});return s=>t.parser.subrule(n,MU(t,r),i,e,a(s))}else if($u(r)){const n=t.consume++,i=aT(t,r.name);return()=>t.parser.consume(n,i,e)}else if(r)lg();else throw new yG(e.$cstNode,`Undefined rule: ${e.rule.$refText}`)}function g6e(t,e){const r=e.map(n=>Lo(n.value));return n=>{const i={};for(let a=0;a<r.length;a++){const s=t.parameters[a],o=r[a];i[s.name]=o(n)}return i}}function Lo(t){if(A3e(t)){const e=Lo(t.left),r=Lo(t.right);return n=>e(n)||r(n)}else if(C3e(t)){const e=Lo(t.left),r=Lo(t.right);return n=>e(n)&&r(n)}else if(_3e(t)){const e=Lo(t.value);return r=>!e(r)}else if(L3e(t)){const e=t.parameter.ref.name;return r=>r!==void 0&&r[e]===!0}else if(S3e(t)){const e=!!t.true;return()=>e}lg()}function m6e(t,e){if(e.elements.length===1)return wu(t,e.elements[0]);{const r=[];for(const i of e.elements){const a={ALT:wu(t,i,!0)},s=py(i);s&&(a.GATE=Lo(s)),r.push(a)}const n=t.or++;return i=>t.parser.alternatives(n,r.map(a=>{const s={ALT:()=>a.ALT(i)},o=a.GATE;return o&&(s.GATE=()=>o(i)),s}))}}function v6e(t,e){if(e.elements.length===1)return wu(t,e.elements[0]);const r=[];for(const o of e.elements){const l={ALT:wu(t,o,!0)},u=py(o);u&&(l.GATE=Lo(u)),r.push(l)}const n=t.or++,i=(o,l)=>{const u=l.getRuleStack().join("-");return`uGroup_${o}_${u}`},a=o=>t.parser.alternatives(n,r.map((l,u)=>{const h={ALT:()=>!0},d=t.parser;h.ALT=()=>{if(l.ALT(o),!d.isRecording()){const p=i(n,d);d.unorderedGroups.get(p)||d.unorderedGroups.set(p,[]);const g=d.unorderedGroups.get(p);typeof g?.[u]>"u"&&(g[u]=!0)}};const f=l.GATE;return f?h.GATE=()=>f(o):h.GATE=()=>{const p=d.unorderedGroups.get(i(n,d));return!p?.[u]},h})),s=DU(t,py(e),a,"*");return o=>{s(o),t.parser.isRecording()||t.parser.unorderedGroups.delete(i(n,t.parser))}}function y6e(t,e){const r=e.elements.map(n=>wu(t,n));return n=>r.forEach(i=>i(n))}function py(t){if(wk(t))return t.guardCondition}function NU(t,e,r=e.terminal){if(r)if(xu(r)&&ns(r.rule.ref)){const n=r.rule.ref,i=t.subrule++;return a=>t.parser.subrule(i,MU(t,n),!1,e,a)}else if(xu(r)&&$u(r.rule.ref)){const n=t.consume++,i=aT(t,r.rule.ref.name);return()=>t.parser.consume(n,i,e)}else if(yu(r)){const n=t.consume++,i=aT(t,r.value);return()=>t.parser.consume(n,i,e)}else throw new Error("Could not build cross reference parser");else{if(!e.type.ref)throw new Error("Could not resolve reference to type: "+e.type.$refText);const n=NG(e.type.ref),i=n?.terminal;if(!i)throw new Error("Could not find name assignment for type: "+Sk(e.type.ref));return NU(t,e,i)}}function x6e(t,e){const r=t.consume++,n=t.tokens[e.value];if(!n)throw new Error("Could not find token for keyword: "+e.value);return()=>t.parser.consume(r,n,e)}function DU(t,e,r,n){const i=e&&Lo(e);if(!n)if(i){const a=t.or++;return s=>t.parser.alternatives(a,[{ALT:()=>r(s),GATE:()=>i(s)},{ALT:z9(),GATE:()=>!i(s)}])}else return r;if(n==="*"){const a=t.many++;return s=>t.parser.many(a,{DEF:()=>r(s),GATE:i?()=>i(s):void 0})}else if(n==="+"){const a=t.many++;if(i){const s=t.or++;return o=>t.parser.alternatives(s,[{ALT:()=>t.parser.atLeastOne(a,{DEF:()=>r(o)}),GATE:()=>i(o)},{ALT:z9(),GATE:()=>!i(o)}])}else return s=>t.parser.atLeastOne(a,{DEF:()=>r(s)})}else if(n==="?"){const a=t.optional++;return s=>t.parser.optional(a,{DEF:()=>r(s),GATE:i?()=>i(s):void 0})}else lg()}function MU(t,e){const r=b6e(t,e),n=t.parser.getRule(r);if(!n)throw new Error(`Rule "${r}" not found."`);return n}function b6e(t,e){if(ns(e))return e.name;if(t.ruleNames.has(e))return t.ruleNames.get(e);{let r=e,n=r.$container,i=e.$type;for(;!ns(n);)(wk(n)||TG(n)||EG(n))&&(i=n.elements.indexOf(r).toString()+":"+i),r=n,n=n.$container;return i=n.name+":"+i,t.ruleNames.set(e,i),i}}function aT(t,e){const r=t.tokens[e];if(!r)throw new Error(`Token "${e}" not found."`);return r}function w6e(t){const e=t.Grammar,r=t.parser.Lexer,n=new c6e(t);return RU(e,n,r.definition),n.finalize(),n}function T6e(t){const e=E6e(t);return e.finalize(),e}function E6e(t){const e=t.Grammar,r=t.parser.Lexer,n=new o6e(t);return RU(e,n,r.definition)}class IU{constructor(){this.diagnostics=[]}buildTokens(e,r){const n=si(_G(e,!1)),i=this.buildTerminalTokens(n),a=this.buildKeywordTokens(n,i,r);return i.forEach(s=>{const o=s.PATTERN;typeof o=="object"&&o&&"test"in o&&Dw(o)?a.unshift(s):a.push(s)}),a}flushLexingReport(e){return{diagnostics:this.popDiagnostics()}}popDiagnostics(){const e=[...this.diagnostics];return this.diagnostics=[],e}buildTerminalTokens(e){return e.filter($u).filter(r=>!r.fragment).map(r=>this.buildTerminalToken(r)).toArray()}buildTerminalToken(e){const r=Ck(e),n=this.requiresCustomPattern(r)?this.regexPatternFunction(r):r,i={name:e.name,PATTERN:n};return typeof n=="function"&&(i.LINE_BREAKS=!0),e.hidden&&(i.GROUP=Dw(r)?ca.SKIPPED:"hidden"),i}requiresCustomPattern(e){return e.flags.includes("u")||e.flags.includes("s")?!0:!!(e.source.includes("?<=")||e.source.includes("?<!"))}regexPatternFunction(e){const r=new RegExp(e,e.flags+"y");return(n,i)=>(r.lastIndex=i,r.exec(n))}buildKeywordTokens(e,r,n){return e.filter(ns).flatMap(i=>cg(i).filter(yu)).distinct(i=>i.value).toArray().sort((i,a)=>a.value.length-i.value.length).map(i=>this.buildKeywordToken(i,r,!!n?.caseInsensitive))}buildKeywordToken(e,r,n){const i=this.buildKeywordPattern(e,n),a={name:e.value,PATTERN:i,LONGER_ALT:this.findLongerAlt(e,r)};return typeof i=="function"&&(a.LINE_BREAKS=!0),a}buildKeywordPattern(e,r){return r?new RegExp(Z3e(e.value)):e.value}findLongerAlt(e,r){return r.reduce((n,i)=>{const a=i?.PATTERN;return a?.source&&Q3e("^"+a.source+"$",e.value)&&n.push(i),n},[])}}class OU{convert(e,r){let n=r.grammarSource;if(bk(n)&&(n=r5e(n)),xu(n)){const i=n.rule.ref;if(!i)throw new Error("This cst node was not parsed by a rule.");return this.runConverter(i,e,r)}return e}runConverter(e,r,n){var i;switch(e.name.toUpperCase()){case"INT":return Eo.convertInt(r);case"STRING":return Eo.convertString(r);case"ID":return Eo.convertID(r)}switch((i=c5e(e))===null||i===void 0?void 0:i.toLowerCase()){case"number":return Eo.convertNumber(r);case"boolean":return Eo.convertBoolean(r);case"bigint":return Eo.convertBigint(r);case"date":return Eo.convertDate(r);default:return r}}}var Eo;(function(t){function e(u){let h="";for(let d=1;d<u.length-1;d++){const f=u.charAt(d);if(f==="\\"){const p=u.charAt(++d);h+=r(p)}else h+=f}return h}t.convertString=e;function r(u){switch(u){case"b":return"\b";case"f":return"\f";case"n":return`
`;case"r":return"\r";case"t":return"	";case"v":return"\v";case"0":return"\0";default:return u}}function n(u){return u.charAt(0)==="^"?u.substring(1):u}t.convertID=n;function i(u){return parseInt(u)}t.convertInt=i;function a(u){return BigInt(u)}t.convertBigint=a;function s(u){return new Date(u)}t.convertDate=s;function o(u){return Number(u)}t.convertNumber=o;function l(u){return u.toLowerCase()==="true"}t.convertBoolean=l})(Eo||(Eo={}));var mp={},nx={};Object.defineProperty(nx,"__esModule",{value:!0});let sT;function oT(){if(sT===void 0)throw new Error("No runtime abstraction layer installed");return sT}(function(t){function e(r){if(r===void 0)throw new Error("No runtime abstraction layer provided");sT=r}t.install=e})(oT||(oT={}));nx.default=oT;var bi={};Object.defineProperty(bi,"__esModule",{value:!0});bi.stringArray=bi.array=bi.func=bi.error=bi.number=bi.string=bi.boolean=void 0;function k6e(t){return t===!0||t===!1}bi.boolean=k6e;function PU(t){return typeof t=="string"||t instanceof String}bi.string=PU;function S6e(t){return typeof t=="number"||t instanceof Number}bi.number=S6e;function C6e(t){return t instanceof Error}bi.error=C6e;function A6e(t){return typeof t=="function"}bi.func=A6e;function BU(t){return Array.isArray(t)}bi.array=BU;function _6e(t){return BU(t)&&t.every(e=>PU(e))}bi.stringArray=_6e;var dd={};Object.defineProperty(dd,"__esModule",{value:!0});var FU=dd.Emitter=dd.Event=void 0;const L6e=nx;var qL;(function(t){const e={dispose(){}};t.None=function(){return e}})(qL||(dd.Event=qL={}));class R6e{add(e,r=null,n){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(e),this._contexts.push(r),Array.isArray(n)&&n.push({dispose:()=>this.remove(e,r)})}remove(e,r=null){if(!this._callbacks)return;let n=!1;for(let i=0,a=this._callbacks.length;i<a;i++)if(this._callbacks[i]===e)if(this._contexts[i]===r){this._callbacks.splice(i,1),this._contexts.splice(i,1);return}else n=!0;if(n)throw new Error("When adding a listener with a context, you should remove it with the same context")}invoke(...e){if(!this._callbacks)return[];const r=[],n=this._callbacks.slice(0),i=this._contexts.slice(0);for(let a=0,s=n.length;a<s;a++)try{r.push(n[a].apply(i[a],e))}catch(o){(0,L6e.default)().console.error(o)}return r}isEmpty(){return!this._callbacks||this._callbacks.length===0}dispose(){this._callbacks=void 0,this._contexts=void 0}}class ix{constructor(e){this._options=e}get event(){return this._event||(this._event=(e,r,n)=>{this._callbacks||(this._callbacks=new R6e),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(e,r);const i={dispose:()=>{this._callbacks&&(this._callbacks.remove(e,r),i.dispose=ix._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(n)&&n.push(i),i}),this._event}fire(e){this._callbacks&&this._callbacks.invoke.call(this._callbacks,e)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}}FU=dd.Emitter=ix;ix._noop=function(){};var rn;Object.defineProperty(mp,"__esModule",{value:!0});var zk=mp.CancellationTokenSource=rn=mp.CancellationToken=void 0;const N6e=nx,D6e=bi,lT=dd;var gy;(function(t){t.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:lT.Event.None}),t.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:lT.Event.None});function e(r){const n=r;return n&&(n===t.None||n===t.Cancelled||D6e.boolean(n.isCancellationRequested)&&!!n.onCancellationRequested)}t.is=e})(gy||(rn=mp.CancellationToken=gy={}));const M6e=Object.freeze(function(t,e){const r=(0,N6e.default)().timer.setTimeout(t.bind(e),0);return{dispose(){r.dispose()}}});class YL{constructor(){this._isCancelled=!1}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?M6e:(this._emitter||(this._emitter=new lT.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}}class I6e{get token(){return this._token||(this._token=new YL),this._token}cancel(){this._token?this._token.cancel():this._token=gy.Cancelled}dispose(){this._token?this._token instanceof YL&&this._token.dispose():this._token=gy.None}}zk=mp.CancellationTokenSource=I6e;function O6e(){return new Promise(t=>{typeof setImmediate>"u"?setTimeout(t,0):setImmediate(t)})}let ym=0,P6e=10;function B6e(){return ym=performance.now(),new zk}const my=Symbol("OperationCancelled");function ax(t){return t===my}async function ka(t){if(t===rn.None)return;const e=performance.now();if(e-ym>=P6e&&(ym=e,await O6e(),ym=performance.now()),t.isCancellationRequested)throw my}class Vk{constructor(){this.promise=new Promise((e,r)=>{this.resolve=n=>(e(n),this),this.reject=n=>(r(n),this)})}}class vp{constructor(e,r,n,i){this._uri=e,this._languageId=r,this._version=n,this._content=i,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(e){if(e){const r=this.offsetAt(e.start),n=this.offsetAt(e.end);return this._content.substring(r,n)}return this._content}update(e,r){for(const n of e)if(vp.isIncremental(n)){const i=zU(n.range),a=this.offsetAt(i.start),s=this.offsetAt(i.end);this._content=this._content.substring(0,a)+n.text+this._content.substring(s,this._content.length);const o=Math.max(i.start.line,0),l=Math.max(i.end.line,0);let u=this._lineOffsets;const h=XL(n.text,!1,a);if(l-o===h.length)for(let f=0,p=h.length;f<p;f++)u[f+o+1]=h[f];else h.length<1e4?u.splice(o+1,l-o,...h):this._lineOffsets=u=u.slice(0,o+1).concat(h,u.slice(l+1));const d=n.text.length-(s-a);if(d!==0)for(let f=o+1+h.length,p=u.length;f<p;f++)u[f]=u[f]+d}else if(vp.isFull(n))this._content=n.text,this._lineOffsets=void 0;else throw new Error("Unknown change event received");this._version=r}getLineOffsets(){return this._lineOffsets===void 0&&(this._lineOffsets=XL(this._content,!0)),this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);const r=this.getLineOffsets();let n=0,i=r.length;if(i===0)return{line:0,character:e};for(;n<i;){const s=Math.floor((n+i)/2);r[s]>e?i=s:n=s+1}const a=n-1;return e=this.ensureBeforeEOL(e,r[a]),{line:a,character:e-r[a]}}offsetAt(e){const r=this.getLineOffsets();if(e.line>=r.length)return this._content.length;if(e.line<0)return 0;const n=r[e.line];if(e.character<=0)return n;const i=e.line+1<r.length?r[e.line+1]:this._content.length,a=Math.min(n+e.character,i);return this.ensureBeforeEOL(a,n)}ensureBeforeEOL(e,r){for(;e>r&&$U(this._content.charCodeAt(e-1));)e--;return e}get lineCount(){return this.getLineOffsets().length}static isIncremental(e){const r=e;return r!=null&&typeof r.text=="string"&&r.range!==void 0&&(r.rangeLength===void 0||typeof r.rangeLength=="number")}static isFull(e){const r=e;return r!=null&&typeof r.text=="string"&&r.range===void 0&&r.rangeLength===void 0}}var cT;(function(t){function e(i,a,s,o){return new vp(i,a,s,o)}t.create=e;function r(i,a,s){if(i instanceof vp)return i.update(a,s),i;throw new Error("TextDocument.update: document must be created by TextDocument.create")}t.update=r;function n(i,a){const s=i.getText(),o=uT(a.map(F6e),(h,d)=>{const f=h.range.start.line-d.range.start.line;return f===0?h.range.start.character-d.range.start.character:f});let l=0;const u=[];for(const h of o){const d=i.offsetAt(h.range.start);if(d<l)throw new Error("Overlapping edit");d>l&&u.push(s.substring(l,d)),h.newText.length&&u.push(h.newText),l=i.offsetAt(h.range.end)}return u.push(s.substr(l)),u.join("")}t.applyEdits=n})(cT||(cT={}));function uT(t,e){if(t.length<=1)return t;const r=t.length/2|0,n=t.slice(0,r),i=t.slice(r);uT(n,e),uT(i,e);let a=0,s=0,o=0;for(;a<n.length&&s<i.length;)e(n[a],i[s])<=0?t[o++]=n[a++]:t[o++]=i[s++];for(;a<n.length;)t[o++]=n[a++];for(;s<i.length;)t[o++]=i[s++];return t}function XL(t,e,r=0){const n=e?[r]:[];for(let i=0;i<t.length;i++){const a=t.charCodeAt(i);$U(a)&&(a===13&&i+1<t.length&&t.charCodeAt(i+1)===10&&i++,n.push(r+i+1))}return n}function $U(t){return t===13||t===10}function zU(t){const e=t.start,r=t.end;return e.line>r.line||e.line===r.line&&e.character>r.character?{start:r,end:e}:t}function F6e(t){const e=zU(t.range);return e!==t.range?{newText:t.newText,range:e}:t}var VU;(()=>{var t={470:i=>{function a(l){if(typeof l!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(l))}function s(l,u){for(var h,d="",f=0,p=-1,g=0,m=0;m<=l.length;++m){if(m<l.length)h=l.charCodeAt(m);else{if(h===47)break;h=47}if(h===47){if(!(p===m-1||g===1))if(p!==m-1&&g===2){if(d.length<2||f!==2||d.charCodeAt(d.length-1)!==46||d.charCodeAt(d.length-2)!==46){if(d.length>2){var v=d.lastIndexOf("/");if(v!==d.length-1){v===-1?(d="",f=0):f=(d=d.slice(0,v)).length-1-d.lastIndexOf("/"),p=m,g=0;continue}}else if(d.length===2||d.length===1){d="",f=0,p=m,g=0;continue}}u&&(d.length>0?d+="/..":d="..",f=2)}else d.length>0?d+="/"+l.slice(p+1,m):d=l.slice(p+1,m),f=m-p-1;p=m,g=0}else h===46&&g!==-1?++g:g=-1}return d}var o={resolve:function(){for(var l,u="",h=!1,d=arguments.length-1;d>=-1&&!h;d--){var f;d>=0?f=arguments[d]:(l===void 0&&(l=process.cwd()),f=l),a(f),f.length!==0&&(u=f+"/"+u,h=f.charCodeAt(0)===47)}return u=s(u,!h),h?u.length>0?"/"+u:"/":u.length>0?u:"."},normalize:function(l){if(a(l),l.length===0)return".";var u=l.charCodeAt(0)===47,h=l.charCodeAt(l.length-1)===47;return(l=s(l,!u)).length!==0||u||(l="."),l.length>0&&h&&(l+="/"),u?"/"+l:l},isAbsolute:function(l){return a(l),l.length>0&&l.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var l,u=0;u<arguments.length;++u){var h=arguments[u];a(h),h.length>0&&(l===void 0?l=h:l+="/"+h)}return l===void 0?".":o.normalize(l)},relative:function(l,u){if(a(l),a(u),l===u||(l=o.resolve(l))===(u=o.resolve(u)))return"";for(var h=1;h<l.length&&l.charCodeAt(h)===47;++h);for(var d=l.length,f=d-h,p=1;p<u.length&&u.charCodeAt(p)===47;++p);for(var g=u.length-p,m=f<g?f:g,v=-1,y=0;y<=m;++y){if(y===m){if(g>m){if(u.charCodeAt(p+y)===47)return u.slice(p+y+1);if(y===0)return u.slice(p+y)}else f>m&&(l.charCodeAt(h+y)===47?v=y:y===0&&(v=0));break}var b=l.charCodeAt(h+y);if(b!==u.charCodeAt(p+y))break;b===47&&(v=y)}var w="";for(y=h+v+1;y<=d;++y)y!==d&&l.charCodeAt(y)!==47||(w.length===0?w+="..":w+="/..");return w.length>0?w+u.slice(p+v):(p+=v,u.charCodeAt(p)===47&&++p,u.slice(p))},_makeLong:function(l){return l},dirname:function(l){if(a(l),l.length===0)return".";for(var u=l.charCodeAt(0),h=u===47,d=-1,f=!0,p=l.length-1;p>=1;--p)if((u=l.charCodeAt(p))===47){if(!f){d=p;break}}else f=!1;return d===-1?h?"/":".":h&&d===1?"//":l.slice(0,d)},basename:function(l,u){if(u!==void 0&&typeof u!="string")throw new TypeError('"ext" argument must be a string');a(l);var h,d=0,f=-1,p=!0;if(u!==void 0&&u.length>0&&u.length<=l.length){if(u.length===l.length&&u===l)return"";var g=u.length-1,m=-1;for(h=l.length-1;h>=0;--h){var v=l.charCodeAt(h);if(v===47){if(!p){d=h+1;break}}else m===-1&&(p=!1,m=h+1),g>=0&&(v===u.charCodeAt(g)?--g==-1&&(f=h):(g=-1,f=m))}return d===f?f=m:f===-1&&(f=l.length),l.slice(d,f)}for(h=l.length-1;h>=0;--h)if(l.charCodeAt(h)===47){if(!p){d=h+1;break}}else f===-1&&(p=!1,f=h+1);return f===-1?"":l.slice(d,f)},extname:function(l){a(l);for(var u=-1,h=0,d=-1,f=!0,p=0,g=l.length-1;g>=0;--g){var m=l.charCodeAt(g);if(m!==47)d===-1&&(f=!1,d=g+1),m===46?u===-1?u=g:p!==1&&(p=1):u!==-1&&(p=-1);else if(!f){h=g+1;break}}return u===-1||d===-1||p===0||p===1&&u===d-1&&u===h+1?"":l.slice(u,d)},format:function(l){if(l===null||typeof l!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof l);return function(u,h){var d=h.dir||h.root,f=h.base||(h.name||"")+(h.ext||"");return d?d===h.root?d+f:d+"/"+f:f}(0,l)},parse:function(l){a(l);var u={root:"",dir:"",base:"",ext:"",name:""};if(l.length===0)return u;var h,d=l.charCodeAt(0),f=d===47;f?(u.root="/",h=1):h=0;for(var p=-1,g=0,m=-1,v=!0,y=l.length-1,b=0;y>=h;--y)if((d=l.charCodeAt(y))!==47)m===-1&&(v=!1,m=y+1),d===46?p===-1?p=y:b!==1&&(b=1):p!==-1&&(b=-1);else if(!v){g=y+1;break}return p===-1||m===-1||b===0||b===1&&p===m-1&&p===g+1?m!==-1&&(u.base=u.name=g===0&&f?l.slice(1,m):l.slice(g,m)):(g===0&&f?(u.name=l.slice(1,p),u.base=l.slice(1,m)):(u.name=l.slice(g,p),u.base=l.slice(g,m)),u.ext=l.slice(p,m)),g>0?u.dir=l.slice(0,g-1):f&&(u.dir="/"),u},sep:"/",delimiter:":",win32:null,posix:null};o.posix=o,i.exports=o}},e={};function r(i){var a=e[i];if(a!==void 0)return a.exports;var s=e[i]={exports:{}};return t[i](s,s.exports,r),s.exports}r.d=(i,a)=>{for(var s in a)r.o(a,s)&&!r.o(i,s)&&Object.defineProperty(i,s,{enumerable:!0,get:a[s]})},r.o=(i,a)=>Object.prototype.hasOwnProperty.call(i,a),r.r=i=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(i,"__esModule",{value:!0})};var n={};(()=>{let i;r.r(n),r.d(n,{URI:()=>f,Utils:()=>N}),typeof process=="object"?i=process.platform==="win32":typeof navigator=="object"&&(i=navigator.userAgent.indexOf("Windows")>=0);const a=/^\w[\w\d+.-]*$/,s=/^\//,o=/^\/\//;function l(_,O){if(!_.scheme&&O)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${_.authority}", path: "${_.path}", query: "${_.query}", fragment: "${_.fragment}"}`);if(_.scheme&&!a.test(_.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(_.path){if(_.authority){if(!s.test(_.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(o.test(_.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}const u="",h="/",d=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class f{static isUri(O){return O instanceof f||!!O&&typeof O.authority=="string"&&typeof O.fragment=="string"&&typeof O.path=="string"&&typeof O.query=="string"&&typeof O.scheme=="string"&&typeof O.fsPath=="string"&&typeof O.with=="function"&&typeof O.toString=="function"}scheme;authority;path;query;fragment;constructor(O,P,k,R,I,M=!1){typeof O=="object"?(this.scheme=O.scheme||u,this.authority=O.authority||u,this.path=O.path||u,this.query=O.query||u,this.fragment=O.fragment||u):(this.scheme=function(D,B){return D||B?D:"file"}(O,M),this.authority=P||u,this.path=function(D,B){switch(D){case"https":case"http":case"file":B?B[0]!==h&&(B=h+B):B=h}return B}(this.scheme,k||u),this.query=R||u,this.fragment=I||u,l(this,M))}get fsPath(){return b(this)}with(O){if(!O)return this;let{scheme:P,authority:k,path:R,query:I,fragment:M}=O;return P===void 0?P=this.scheme:P===null&&(P=u),k===void 0?k=this.authority:k===null&&(k=u),R===void 0?R=this.path:R===null&&(R=u),I===void 0?I=this.query:I===null&&(I=u),M===void 0?M=this.fragment:M===null&&(M=u),P===this.scheme&&k===this.authority&&R===this.path&&I===this.query&&M===this.fragment?this:new g(P,k,R,I,M)}static parse(O,P=!1){const k=d.exec(O);return k?new g(k[2]||u,L(k[4]||u),L(k[5]||u),L(k[7]||u),L(k[9]||u),P):new g(u,u,u,u,u)}static file(O){let P=u;if(i&&(O=O.replace(/\\/g,h)),O[0]===h&&O[1]===h){const k=O.indexOf(h,2);k===-1?(P=O.substring(2),O=h):(P=O.substring(2,k),O=O.substring(k)||h)}return new g("file",P,O,u,u)}static from(O){const P=new g(O.scheme,O.authority,O.path,O.query,O.fragment);return l(P,!0),P}toString(O=!1){return w(this,O)}toJSON(){return this}static revive(O){if(O){if(O instanceof f)return O;{const P=new g(O);return P._formatted=O.external,P._fsPath=O._sep===p?O.fsPath:null,P}}return O}}const p=i?1:void 0;class g extends f{_formatted=null;_fsPath=null;get fsPath(){return this._fsPath||(this._fsPath=b(this)),this._fsPath}toString(O=!1){return O?w(this,!0):(this._formatted||(this._formatted=w(this,!1)),this._formatted)}toJSON(){const O={$mid:1};return this._fsPath&&(O.fsPath=this._fsPath,O._sep=p),this._formatted&&(O.external=this._formatted),this.path&&(O.path=this.path),this.scheme&&(O.scheme=this.scheme),this.authority&&(O.authority=this.authority),this.query&&(O.query=this.query),this.fragment&&(O.fragment=this.fragment),O}}const m={58:"%3A",47:"%2F",63:"%3F",35:"%23",91:"%5B",93:"%5D",64:"%40",33:"%21",36:"%24",38:"%26",39:"%27",40:"%28",41:"%29",42:"%2A",43:"%2B",44:"%2C",59:"%3B",61:"%3D",32:"%20"};function v(_,O,P){let k,R=-1;for(let I=0;I<_.length;I++){const M=_.charCodeAt(I);if(M>=97&&M<=122||M>=65&&M<=90||M>=48&&M<=57||M===45||M===46||M===95||M===126||O&&M===47||P&&M===91||P&&M===93||P&&M===58)R!==-1&&(k+=encodeURIComponent(_.substring(R,I)),R=-1),k!==void 0&&(k+=_.charAt(I));else{k===void 0&&(k=_.substr(0,I));const D=m[M];D!==void 0?(R!==-1&&(k+=encodeURIComponent(_.substring(R,I)),R=-1),k+=D):R===-1&&(R=I)}}return R!==-1&&(k+=encodeURIComponent(_.substring(R))),k!==void 0?k:_}function y(_){let O;for(let P=0;P<_.length;P++){const k=_.charCodeAt(P);k===35||k===63?(O===void 0&&(O=_.substr(0,P)),O+=m[k]):O!==void 0&&(O+=_[P])}return O!==void 0?O:_}function b(_,O){let P;return P=_.authority&&_.path.length>1&&_.scheme==="file"?`//${_.authority}${_.path}`:_.path.charCodeAt(0)===47&&(_.path.charCodeAt(1)>=65&&_.path.charCodeAt(1)<=90||_.path.charCodeAt(1)>=97&&_.path.charCodeAt(1)<=122)&&_.path.charCodeAt(2)===58?_.path[1].toLowerCase()+_.path.substr(2):_.path,i&&(P=P.replace(/\//g,"\\")),P}function w(_,O){const P=O?y:v;let k="",{scheme:R,authority:I,path:M,query:D,fragment:B}=_;if(R&&(k+=R,k+=":"),(I||R==="file")&&(k+=h,k+=h),I){let $=I.indexOf("@");if($!==-1){const F=I.substr(0,$);I=I.substr($+1),$=F.lastIndexOf(":"),$===-1?k+=P(F,!1,!1):(k+=P(F.substr(0,$),!1,!1),k+=":",k+=P(F.substr($+1),!1,!0)),k+="@"}I=I.toLowerCase(),$=I.lastIndexOf(":"),$===-1?k+=P(I,!1,!0):(k+=P(I.substr(0,$),!1,!0),k+=I.substr($))}if(M){if(M.length>=3&&M.charCodeAt(0)===47&&M.charCodeAt(2)===58){const $=M.charCodeAt(1);$>=65&&$<=90&&(M=`/${String.fromCharCode($+32)}:${M.substr(3)}`)}else if(M.length>=2&&M.charCodeAt(1)===58){const $=M.charCodeAt(0);$>=65&&$<=90&&(M=`${String.fromCharCode($+32)}:${M.substr(2)}`)}k+=P(M,!0,!1)}return D&&(k+="?",k+=P(D,!1,!1)),B&&(k+="#",k+=O?B:v(B,!1,!1)),k}function T(_){try{return decodeURIComponent(_)}catch{return _.length>3?_.substr(0,3)+T(_.substr(3)):_}}const E=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function L(_){return _.match(E)?_.replace(E,O=>T(O)):_}var S=r(470);const C=S.posix||S,A="/";var N;(function(_){_.joinPath=function(O,...P){return O.with({path:C.join(O.path,...P)})},_.resolvePath=function(O,...P){let k=O.path,R=!1;k[0]!==A&&(k=A+k,R=!0);let I=C.resolve(k,...P);return R&&I[0]===A&&!O.authority&&(I=I.substring(1)),O.with({path:I})},_.dirname=function(O){if(O.path.length===0||O.path===A)return O;let P=C.dirname(O.path);return P.length===1&&P.charCodeAt(0)===46&&(P=""),O.with({path:P})},_.basename=function(O){return C.basename(O.path)},_.extname=function(O){return C.extname(O.path)}})(N||(N={}))})(),VU=n})();const{URI:Tu,Utils:pf}=VU;var Zl;(function(t){t.basename=pf.basename,t.dirname=pf.dirname,t.extname=pf.extname,t.joinPath=pf.joinPath,t.resolvePath=pf.resolvePath;function e(i,a){return i?.toString()===a?.toString()}t.equals=e;function r(i,a){const s=typeof i=="string"?i:i.path,o=typeof a=="string"?a:a.path,l=s.split("/").filter(p=>p.length>0),u=o.split("/").filter(p=>p.length>0);let h=0;for(;h<l.length&&l[h]===u[h];h++);const d="../".repeat(l.length-h),f=u.slice(h).join("/");return d+f}t.relative=r;function n(i){return Tu.parse(i.toString()).toString()}t.normalize=n})(Zl||(Zl={}));var jr;(function(t){t[t.Changed=0]="Changed",t[t.Parsed=1]="Parsed",t[t.IndexedContent=2]="IndexedContent",t[t.ComputedScopes=3]="ComputedScopes",t[t.Linked=4]="Linked",t[t.IndexedReferences=5]="IndexedReferences",t[t.Validated=6]="Validated"})(jr||(jr={}));class $6e{constructor(e){this.serviceRegistry=e.ServiceRegistry,this.textDocuments=e.workspace.TextDocuments,this.fileSystemProvider=e.workspace.FileSystemProvider}async fromUri(e,r=rn.None){const n=await this.fileSystemProvider.readFile(e);return this.createAsync(e,n,r)}fromTextDocument(e,r,n){return r=r??Tu.parse(e.uri),rn.is(n)?this.createAsync(r,e,n):this.create(r,e,n)}fromString(e,r,n){return rn.is(n)?this.createAsync(r,e,n):this.create(r,e,n)}fromModel(e,r){return this.create(r,{$model:e})}create(e,r,n){if(typeof r=="string"){const i=this.parse(e,r,n);return this.createLangiumDocument(i,e,void 0,r)}else if("$model"in r){const i={value:r.$model,parserErrors:[],lexerErrors:[]};return this.createLangiumDocument(i,e)}else{const i=this.parse(e,r.getText(),n);return this.createLangiumDocument(i,e,r)}}async createAsync(e,r,n){if(typeof r=="string"){const i=await this.parseAsync(e,r,n);return this.createLangiumDocument(i,e,void 0,r)}else{const i=await this.parseAsync(e,r.getText(),n);return this.createLangiumDocument(i,e,r)}}createLangiumDocument(e,r,n,i){let a;if(n)a={parseResult:e,uri:r,state:jr.Parsed,references:[],textDocument:n};else{const s=this.createTextDocumentGetter(r,i);a={parseResult:e,uri:r,state:jr.Parsed,references:[],get textDocument(){return s()}}}return e.value.$document=a,a}async update(e,r){var n,i;const a=(n=e.parseResult.value.$cstNode)===null||n===void 0?void 0:n.root.fullText,s=(i=this.textDocuments)===null||i===void 0?void 0:i.get(e.uri.toString()),o=s?s.getText():await this.fileSystemProvider.readFile(e.uri);if(s)Object.defineProperty(e,"textDocument",{value:s});else{const l=this.createTextDocumentGetter(e.uri,o);Object.defineProperty(e,"textDocument",{get:l})}return a!==o&&(e.parseResult=await this.parseAsync(e.uri,o,r),e.parseResult.value.$document=e),e.state=jr.Parsed,e}parse(e,r,n){return this.serviceRegistry.getServices(e).parser.LangiumParser.parse(r,n)}parseAsync(e,r,n){return this.serviceRegistry.getServices(e).parser.AsyncParser.parse(r,n)}createTextDocumentGetter(e,r){const n=this.serviceRegistry;let i;return()=>i??(i=cT.create(e.toString(),n.getServices(e).LanguageMetaData.languageId,0,r??""))}}class z6e{constructor(e){this.documentMap=new Map,this.langiumDocumentFactory=e.workspace.LangiumDocumentFactory,this.serviceRegistry=e.ServiceRegistry}get all(){return si(this.documentMap.values())}addDocument(e){const r=e.uri.toString();if(this.documentMap.has(r))throw new Error(`A document with the URI '${r}' is already present.`);this.documentMap.set(r,e)}getDocument(e){const r=e.toString();return this.documentMap.get(r)}async getOrCreateDocument(e,r){let n=this.getDocument(e);return n||(n=await this.langiumDocumentFactory.fromUri(e,r),this.addDocument(n),n)}createDocument(e,r,n){if(n)return this.langiumDocumentFactory.fromString(r,e,n).then(i=>(this.addDocument(i),i));{const i=this.langiumDocumentFactory.fromString(r,e);return this.addDocument(i),i}}hasDocument(e){return this.documentMap.has(e.toString())}invalidateDocument(e){const r=e.toString(),n=this.documentMap.get(r);return n&&(this.serviceRegistry.getServices(e).references.Linker.unlink(n),n.state=jr.Changed,n.precomputedScopes=void 0,n.diagnostics=void 0),n}deleteDocument(e){const r=e.toString(),n=this.documentMap.get(r);return n&&(n.state=jr.Changed,this.documentMap.delete(r)),n}}const m3=Symbol("ref_resolving");class V6e{constructor(e){this.reflection=e.shared.AstReflection,this.langiumDocuments=()=>e.shared.workspace.LangiumDocuments,this.scopeProvider=e.references.ScopeProvider,this.astNodeLocator=e.workspace.AstNodeLocator}async link(e,r=rn.None){for(const n of Ph(e.parseResult.value))await ka(r),SG(n).forEach(i=>this.doLink(i,e))}doLink(e,r){var n;const i=e.reference;if(i._ref===void 0){i._ref=m3;try{const a=this.getCandidate(e);if(hm(a))i._ref=a;else if(i._nodeDescription=a,this.langiumDocuments().hasDocument(a.documentUri)){const s=this.loadAstNode(a);i._ref=s??this.createLinkingError(e,a)}else i._ref=void 0}catch(a){console.error(`An error occurred while resolving reference to '${i.$refText}':`,a);const s=(n=a.message)!==null&&n!==void 0?n:String(a);i._ref=Object.assign(Object.assign({},e),{message:`An error occurred while resolving reference to '${i.$refText}': ${s}`})}r.references.push(i)}}unlink(e){for(const r of e.references)delete r._ref,delete r._nodeDescription;e.references=[]}getCandidate(e){const n=this.scopeProvider.getScope(e).getElement(e.reference.$refText);return n??this.createLinkingError(e)}buildReference(e,r,n,i){const a=this,s={$refNode:n,$refText:i,get ref(){var o;if(Ei(this._ref))return this._ref;if(g3e(this._nodeDescription)){const l=a.loadAstNode(this._nodeDescription);this._ref=l??a.createLinkingError({reference:s,container:e,property:r},this._nodeDescription)}else if(this._ref===void 0){this._ref=m3;const l=Nw(e).$document,u=a.getLinkedNode({reference:s,container:e,property:r});if(u.error&&l&&l.state<jr.ComputedScopes)return this._ref=void 0;this._ref=(o=u.node)!==null&&o!==void 0?o:u.error,this._nodeDescription=u.descr,l?.references.push(this)}else if(this._ref===m3)throw new Error(`Cyclic reference resolution detected: ${a.astNodeLocator.getAstNodePath(e)}/${r} (symbol '${i}')`);return Ei(this._ref)?this._ref:void 0},get $nodeDescription(){return this._nodeDescription},get error(){return hm(this._ref)?this._ref:void 0}};return s}getLinkedNode(e){var r;try{const n=this.getCandidate(e);if(hm(n))return{error:n};const i=this.loadAstNode(n);return i?{node:i,descr:n}:{descr:n,error:this.createLinkingError(e,n)}}catch(n){console.error(`An error occurred while resolving reference to '${e.reference.$refText}':`,n);const i=(r=n.message)!==null&&r!==void 0?r:String(n);return{error:Object.assign(Object.assign({},e),{message:`An error occurred while resolving reference to '${e.reference.$refText}': ${i}`})}}}loadAstNode(e){if(e.node)return e.node;const r=this.langiumDocuments().getDocument(e.documentUri);if(r)return this.astNodeLocator.getAstNode(r.parseResult.value,e.path)}createLinkingError(e,r){const n=Nw(e.container).$document;n&&n.state<jr.ComputedScopes&&console.warn(`Attempted reference resolution before document reached ComputedScopes state (${n.uri}).`);const i=this.reflection.getReferenceType(e);return Object.assign(Object.assign({},e),{message:`Could not resolve reference to ${i} named '${e.reference.$refText}'.`,targetDescription:r})}}function G6e(t){return typeof t.name=="string"}class U6e{getName(e){if(G6e(e))return e.name}getNameNode(e){return RG(e.$cstNode,"name")}}class W6e{constructor(e){this.nameProvider=e.references.NameProvider,this.index=e.shared.workspace.IndexManager,this.nodeLocator=e.workspace.AstNodeLocator}findDeclaration(e){if(e){const r=o5e(e),n=e.astNode;if(r&&n){const i=n[r.feature];if(Hs(i))return i.ref;if(Array.isArray(i)){for(const a of i)if(Hs(a)&&a.$refNode&&a.$refNode.offset<=e.offset&&a.$refNode.end>=e.end)return a.ref}}if(n){const i=this.nameProvider.getNameNode(n);if(i&&(i===e||y3e(e,i)))return n}}}findDeclarationNode(e){const r=this.findDeclaration(e);if(r?.$cstNode){const n=this.nameProvider.getNameNode(r);return n??r.$cstNode}}findReferences(e,r){const n=[];if(r.includeDeclaration){const a=this.getReferenceToSelf(e);a&&n.push(a)}let i=this.index.findAllReferences(e,this.nodeLocator.getAstNodePath(e));return r.documentUri&&(i=i.filter(a=>Zl.equals(a.sourceUri,r.documentUri))),n.push(...i),si(n)}getReferenceToSelf(e){const r=this.nameProvider.getNameNode(e);if(r){const n=Yl(e),i=this.nodeLocator.getAstNodePath(e);return{sourceUri:n.uri,sourcePath:i,targetUri:n.uri,targetPath:i,segment:Zv(r),local:!0}}}}class vy{constructor(e){if(this.map=new Map,e)for(const[r,n]of e)this.add(r,n)}get size(){return _w.sum(si(this.map.values()).map(e=>e.length))}clear(){this.map.clear()}delete(e,r){if(r===void 0)return this.map.delete(e);{const n=this.map.get(e);if(n){const i=n.indexOf(r);if(i>=0)return n.length===1?this.map.delete(e):n.splice(i,1),!0}return!1}}get(e){var r;return(r=this.map.get(e))!==null&&r!==void 0?r:[]}has(e,r){if(r===void 0)return this.map.has(e);{const n=this.map.get(e);return n?n.indexOf(r)>=0:!1}}add(e,r){return this.map.has(e)?this.map.get(e).push(r):this.map.set(e,[r]),this}addAll(e,r){return this.map.has(e)?this.map.get(e).push(...r):this.map.set(e,Array.from(r)),this}forEach(e){this.map.forEach((r,n)=>r.forEach(i=>e(i,n,this)))}[Symbol.iterator](){return this.entries().iterator()}entries(){return si(this.map.entries()).flatMap(([e,r])=>r.map(n=>[e,n]))}keys(){return si(this.map.keys())}values(){return si(this.map.values()).flat()}entriesGroupedByKey(){return si(this.map.entries())}}class jL{get size(){return this.map.size}constructor(e){if(this.map=new Map,this.inverse=new Map,e)for(const[r,n]of e)this.set(r,n)}clear(){this.map.clear(),this.inverse.clear()}set(e,r){return this.map.set(e,r),this.inverse.set(r,e),this}get(e){return this.map.get(e)}getKey(e){return this.inverse.get(e)}delete(e){const r=this.map.get(e);return r!==void 0?(this.map.delete(e),this.inverse.delete(r),!0):!1}}class H6e{constructor(e){this.nameProvider=e.references.NameProvider,this.descriptions=e.workspace.AstNodeDescriptionProvider}async computeExports(e,r=rn.None){return this.computeExportsForNode(e.parseResult.value,e,void 0,r)}async computeExportsForNode(e,r,n=Tk,i=rn.None){const a=[];this.exportNode(e,a,r);for(const s of n(e))await ka(i),this.exportNode(s,a,r);return a}exportNode(e,r,n){const i=this.nameProvider.getName(e);i&&r.push(this.descriptions.createDescription(e,i,n))}async computeLocalScopes(e,r=rn.None){const n=e.parseResult.value,i=new vy;for(const a of cg(n))await ka(r),this.processNode(a,e,i);return i}processNode(e,r,n){const i=e.$container;if(i){const a=this.nameProvider.getName(e);a&&n.add(i,this.descriptions.createDescription(e,a,r))}}}class KL{constructor(e,r,n){var i;this.elements=e,this.outerScope=r,this.caseInsensitive=(i=n?.caseInsensitive)!==null&&i!==void 0?i:!1}getAllElements(){return this.outerScope?this.elements.concat(this.outerScope.getAllElements()):this.elements}getElement(e){const r=this.caseInsensitive?this.elements.find(n=>n.name.toLowerCase()===e.toLowerCase()):this.elements.find(n=>n.name===e);if(r)return r;if(this.outerScope)return this.outerScope.getElement(e)}}class q6e{constructor(e,r,n){var i;this.elements=new Map,this.caseInsensitive=(i=n?.caseInsensitive)!==null&&i!==void 0?i:!1;for(const a of e){const s=this.caseInsensitive?a.name.toLowerCase():a.name;this.elements.set(s,a)}this.outerScope=r}getElement(e){const r=this.caseInsensitive?e.toLowerCase():e,n=this.elements.get(r);if(n)return n;if(this.outerScope)return this.outerScope.getElement(e)}getAllElements(){let e=si(this.elements.values());return this.outerScope&&(e=e.concat(this.outerScope.getAllElements())),e}}class GU{constructor(){this.toDispose=[],this.isDisposed=!1}onDispose(e){this.toDispose.push(e)}dispose(){this.throwIfDisposed(),this.clear(),this.isDisposed=!0,this.toDispose.forEach(e=>e.dispose())}throwIfDisposed(){if(this.isDisposed)throw new Error("This cache has already been disposed")}}class Y6e extends GU{constructor(){super(...arguments),this.cache=new Map}has(e){return this.throwIfDisposed(),this.cache.has(e)}set(e,r){this.throwIfDisposed(),this.cache.set(e,r)}get(e,r){if(this.throwIfDisposed(),this.cache.has(e))return this.cache.get(e);if(r){const n=r();return this.cache.set(e,n),n}else return}delete(e){return this.throwIfDisposed(),this.cache.delete(e)}clear(){this.throwIfDisposed(),this.cache.clear()}}class X6e extends GU{constructor(e){super(),this.cache=new Map,this.converter=e??(r=>r)}has(e,r){return this.throwIfDisposed(),this.cacheForContext(e).has(r)}set(e,r,n){this.throwIfDisposed(),this.cacheForContext(e).set(r,n)}get(e,r,n){this.throwIfDisposed();const i=this.cacheForContext(e);if(i.has(r))return i.get(r);if(n){const a=n();return i.set(r,a),a}else return}delete(e,r){return this.throwIfDisposed(),this.cacheForContext(e).delete(r)}clear(e){if(this.throwIfDisposed(),e){const r=this.converter(e);this.cache.delete(r)}else this.cache.clear()}cacheForContext(e){const r=this.converter(e);let n=this.cache.get(r);return n||(n=new Map,this.cache.set(r,n)),n}}class j6e extends Y6e{constructor(e,r){super(),r?(this.toDispose.push(e.workspace.DocumentBuilder.onBuildPhase(r,()=>{this.clear()})),this.toDispose.push(e.workspace.DocumentBuilder.onUpdate((n,i)=>{i.length>0&&this.clear()}))):this.toDispose.push(e.workspace.DocumentBuilder.onUpdate(()=>{this.clear()}))}}class K6e{constructor(e){this.reflection=e.shared.AstReflection,this.nameProvider=e.references.NameProvider,this.descriptions=e.workspace.AstNodeDescriptionProvider,this.indexManager=e.shared.workspace.IndexManager,this.globalScopeCache=new j6e(e.shared)}getScope(e){const r=[],n=this.reflection.getReferenceType(e),i=Yl(e.container).precomputedScopes;if(i){let s=e.container;do{const o=i.get(s);o.length>0&&r.push(si(o).filter(l=>this.reflection.isSubtype(l.type,n))),s=s.$container}while(s)}let a=this.getGlobalScope(n,e);for(let s=r.length-1;s>=0;s--)a=this.createScope(r[s],a);return a}createScope(e,r,n){return new KL(si(e),r,n)}createScopeForNodes(e,r,n){const i=si(e).map(a=>{const s=this.nameProvider.getName(a);if(s)return this.descriptions.createDescription(a,s)}).nonNullable();return new KL(i,r,n)}getGlobalScope(e,r){return this.globalScopeCache.get(e,()=>new q6e(this.indexManager.allElements(e)))}}function Z6e(t){return typeof t.$comment=="string"}function ZL(t){return typeof t=="object"&&!!t&&("$ref"in t||"$error"in t)}class Q6e{constructor(e){this.ignoreProperties=new Set(["$container","$containerProperty","$containerIndex","$document","$cstNode"]),this.langiumDocuments=e.shared.workspace.LangiumDocuments,this.astNodeLocator=e.workspace.AstNodeLocator,this.nameProvider=e.references.NameProvider,this.commentProvider=e.documentation.CommentProvider}serialize(e,r){const n=r??{},i=r?.replacer,a=(o,l)=>this.replacer(o,l,n),s=i?(o,l)=>i(o,l,a):a;try{return this.currentDocument=Yl(e),JSON.stringify(e,s,r?.space)}finally{this.currentDocument=void 0}}deserialize(e,r){const n=r??{},i=JSON.parse(e);return this.linkNode(i,i,n),i}replacer(e,r,{refText:n,sourceText:i,textRegions:a,comments:s,uriConverter:o}){var l,u,h,d;if(!this.ignoreProperties.has(e))if(Hs(r)){const f=r.ref,p=n?r.$refText:void 0;if(f){const g=Yl(f);let m="";this.currentDocument&&this.currentDocument!==g&&(o?m=o(g.uri,r):m=g.uri.toString());const v=this.astNodeLocator.getAstNodePath(f);return{$ref:`${m}#${v}`,$refText:p}}else return{$error:(u=(l=r.error)===null||l===void 0?void 0:l.message)!==null&&u!==void 0?u:"Could not resolve reference",$refText:p}}else if(Ei(r)){let f;if(a&&(f=this.addAstNodeRegionWithAssignmentsTo(Object.assign({},r)),(!e||r.$document)&&f?.$textRegion&&(f.$textRegion.documentURI=(h=this.currentDocument)===null||h===void 0?void 0:h.uri.toString())),i&&!e&&(f??(f=Object.assign({},r)),f.$sourceText=(d=r.$cstNode)===null||d===void 0?void 0:d.text),s){f??(f=Object.assign({},r));const p=this.commentProvider.getComment(r);p&&(f.$comment=p.replace(/\r/g,""))}return f??r}else return r}addAstNodeRegionWithAssignmentsTo(e){const r=n=>({offset:n.offset,end:n.end,length:n.length,range:n.range});if(e.$cstNode){const n=e.$textRegion=r(e.$cstNode),i=n.assignments={};return Object.keys(e).filter(a=>!a.startsWith("$")).forEach(a=>{const s=i5e(e.$cstNode,a).map(r);s.length!==0&&(i[a]=s)}),e}}linkNode(e,r,n,i,a,s){for(const[l,u]of Object.entries(e))if(Array.isArray(u))for(let h=0;h<u.length;h++){const d=u[h];ZL(d)?u[h]=this.reviveReference(e,l,r,d,n):Ei(d)&&this.linkNode(d,r,n,e,l,h)}else ZL(u)?e[l]=this.reviveReference(e,l,r,u,n):Ei(u)&&this.linkNode(u,r,n,e,l);const o=e;o.$container=i,o.$containerProperty=a,o.$containerIndex=s}reviveReference(e,r,n,i,a){let s=i.$refText,o=i.$error;if(i.$ref){const l=this.getRefNode(n,i.$ref,a.uriConverter);if(Ei(l))return s||(s=this.nameProvider.getName(l)),{$refText:s??"",ref:l};o=l}if(o){const l={$refText:s??""};return l.error={container:e,property:r,message:o,reference:l},l}else return}getRefNode(e,r,n){try{const i=r.indexOf("#");if(i===0){const l=this.astNodeLocator.getAstNode(e,r.substring(1));return l||"Could not resolve path: "+r}if(i<0){const l=n?n(r):Tu.parse(r),u=this.langiumDocuments.getDocument(l);return u?u.parseResult.value:"Could not find document for URI: "+r}const a=n?n(r.substring(0,i)):Tu.parse(r.substring(0,i)),s=this.langiumDocuments.getDocument(a);if(!s)return"Could not find document for URI: "+r;if(i===r.length-1)return s.parseResult.value;const o=this.astNodeLocator.getAstNode(s.parseResult.value,r.substring(i+1));return o||"Could not resolve URI: "+r}catch(i){return String(i)}}}class J6e{get map(){return this.fileExtensionMap}constructor(e){this.languageIdMap=new Map,this.fileExtensionMap=new Map,this.textDocuments=e?.workspace.TextDocuments}register(e){const r=e.LanguageMetaData;for(const n of r.fileExtensions)this.fileExtensionMap.has(n)&&console.warn(`The file extension ${n} is used by multiple languages. It is now assigned to '${r.languageId}'.`),this.fileExtensionMap.set(n,e);this.languageIdMap.set(r.languageId,e),this.languageIdMap.size===1?this.singleton=e:this.singleton=void 0}getServices(e){var r,n;if(this.singleton!==void 0)return this.singleton;if(this.languageIdMap.size===0)throw new Error("The service registry is empty. Use `register` to register the services of a language.");const i=(n=(r=this.textDocuments)===null||r===void 0?void 0:r.get(e))===null||n===void 0?void 0:n.languageId;if(i!==void 0){const o=this.languageIdMap.get(i);if(o)return o}const a=Zl.extname(e),s=this.fileExtensionMap.get(a);if(!s)throw i?new Error(`The service registry contains no services for the extension '${a}' for language '${i}'.`):new Error(`The service registry contains no services for the extension '${a}'.`);return s}hasServices(e){try{return this.getServices(e),!0}catch{return!1}}get all(){return Array.from(this.languageIdMap.values())}}function o0(t){return{code:t}}var yy;(function(t){t.all=["fast","slow","built-in"]})(yy||(yy={}));class eEe{constructor(e){this.entries=new vy,this.entriesBefore=[],this.entriesAfter=[],this.reflection=e.shared.AstReflection}register(e,r=this,n="fast"){if(n==="built-in")throw new Error("The 'built-in' category is reserved for lexer, parser, and linker errors.");for(const[i,a]of Object.entries(e)){const s=a;if(Array.isArray(s))for(const o of s){const l={check:this.wrapValidationException(o,r),category:n};this.addEntry(i,l)}else if(typeof s=="function"){const o={check:this.wrapValidationException(s,r),category:n};this.addEntry(i,o)}else lg()}}wrapValidationException(e,r){return async(n,i,a)=>{await this.handleException(()=>e.call(r,n,i,a),"An error occurred during validation",i,n)}}async handleException(e,r,n,i){try{await e()}catch(a){if(ax(a))throw a;console.error(`${r}:`,a),a instanceof Error&&a.stack&&console.error(a.stack);const s=a instanceof Error?a.message:String(a);n("error",`${r}: ${s}`,{node:i})}}addEntry(e,r){if(e==="AstNode"){this.entries.add("AstNode",r);return}for(const n of this.reflection.getAllSubTypes(e))this.entries.add(n,r)}getChecks(e,r){let n=si(this.entries.get(e)).concat(this.entries.get("AstNode"));return r&&(n=n.filter(i=>r.includes(i.category))),n.map(i=>i.check)}registerBeforeDocument(e,r=this){this.entriesBefore.push(this.wrapPreparationException(e,"An error occurred during set-up of the validation",r))}registerAfterDocument(e,r=this){this.entriesAfter.push(this.wrapPreparationException(e,"An error occurred during tear-down of the validation",r))}wrapPreparationException(e,r,n){return async(i,a,s,o)=>{await this.handleException(()=>e.call(n,i,a,s,o),r,a,i)}}get checksBefore(){return this.entriesBefore}get checksAfter(){return this.entriesAfter}}class tEe{constructor(e){this.validationRegistry=e.validation.ValidationRegistry,this.metadata=e.LanguageMetaData}async validateDocument(e,r={},n=rn.None){const i=e.parseResult,a=[];if(await ka(n),(!r.categories||r.categories.includes("built-in"))&&(this.processLexingErrors(i,a,r),r.stopAfterLexingErrors&&a.some(s=>{var o;return((o=s.data)===null||o===void 0?void 0:o.code)===fs.LexingError})||(this.processParsingErrors(i,a,r),r.stopAfterParsingErrors&&a.some(s=>{var o;return((o=s.data)===null||o===void 0?void 0:o.code)===fs.ParsingError}))||(this.processLinkingErrors(e,a,r),r.stopAfterLinkingErrors&&a.some(s=>{var o;return((o=s.data)===null||o===void 0?void 0:o.code)===fs.LinkingError}))))return a;try{a.push(...await this.validateAst(i.value,r,n))}catch(s){if(ax(s))throw s;console.error("An error occurred during validation:",s)}return await ka(n),a}processLexingErrors(e,r,n){var i,a,s;const o=[...e.lexerErrors,...(a=(i=e.lexerReport)===null||i===void 0?void 0:i.diagnostics)!==null&&a!==void 0?a:[]];for(const l of o){const u=(s=l.severity)!==null&&s!==void 0?s:"error",h={severity:v3(u),range:{start:{line:l.line-1,character:l.column-1},end:{line:l.line-1,character:l.column+l.length-1}},message:l.message,data:nEe(u),source:this.getSource()};r.push(h)}}processParsingErrors(e,r,n){for(const i of e.parserErrors){let a;if(isNaN(i.token.startOffset)){if("previousToken"in i){const s=i.previousToken;if(isNaN(s.startOffset)){const o={line:0,character:0};a={start:o,end:o}}else{const o={line:s.endLine-1,character:s.endColumn};a={start:o,end:o}}}}else a=Rw(i.token);if(a){const s={severity:v3("error"),range:a,message:i.message,data:o0(fs.ParsingError),source:this.getSource()};r.push(s)}}}processLinkingErrors(e,r,n){for(const i of e.references){const a=i.error;if(a){const s={node:a.container,property:a.property,index:a.index,data:{code:fs.LinkingError,containerType:a.container.$type,property:a.property,refText:a.reference.$refText}};r.push(this.toDiagnostic("error",a.message,s))}}}async validateAst(e,r,n=rn.None){const i=[],a=(s,o,l)=>{i.push(this.toDiagnostic(s,o,l))};return await this.validateAstBefore(e,r,a,n),await this.validateAstNodes(e,r,a,n),await this.validateAstAfter(e,r,a,n),i}async validateAstBefore(e,r,n,i=rn.None){var a;const s=this.validationRegistry.checksBefore;for(const o of s)await ka(i),await o(e,n,(a=r.categories)!==null&&a!==void 0?a:[],i)}async validateAstNodes(e,r,n,i=rn.None){await Promise.all(Ph(e).map(async a=>{await ka(i);const s=this.validationRegistry.getChecks(a.$type,r.categories);for(const o of s)await o(a,n,i)}))}async validateAstAfter(e,r,n,i=rn.None){var a;const s=this.validationRegistry.checksAfter;for(const o of s)await ka(i),await o(e,n,(a=r.categories)!==null&&a!==void 0?a:[],i)}toDiagnostic(e,r,n){return{message:r,range:rEe(n),severity:v3(e),code:n.code,codeDescription:n.codeDescription,tags:n.tags,relatedInformation:n.relatedInformation,data:n.data,source:this.getSource()}}getSource(){return this.metadata.languageId}}function rEe(t){if(t.range)return t.range;let e;return typeof t.property=="string"?e=RG(t.node.$cstNode,t.property,t.index):typeof t.keyword=="string"&&(e=a5e(t.node.$cstNode,t.keyword,t.index)),e??(e=t.node.$cstNode),e?e.range:{start:{line:0,character:0},end:{line:0,character:0}}}function v3(t){switch(t){case"error":return 1;case"warning":return 2;case"info":return 3;case"hint":return 4;default:throw new Error("Invalid diagnostic severity: "+t)}}function nEe(t){switch(t){case"error":return o0(fs.LexingError);case"warning":return o0(fs.LexingWarning);case"info":return o0(fs.LexingInfo);case"hint":return o0(fs.LexingHint);default:throw new Error("Invalid diagnostic severity: "+t)}}var fs;(function(t){t.LexingError="lexing-error",t.LexingWarning="lexing-warning",t.LexingInfo="lexing-info",t.LexingHint="lexing-hint",t.ParsingError="parsing-error",t.LinkingError="linking-error"})(fs||(fs={}));class iEe{constructor(e){this.astNodeLocator=e.workspace.AstNodeLocator,this.nameProvider=e.references.NameProvider}createDescription(e,r,n){const i=n??Yl(e);r??(r=this.nameProvider.getName(e));const a=this.astNodeLocator.getAstNodePath(e);if(!r)throw new Error(`Node at path ${a} has no name.`);let s;const o=()=>{var l;return s??(s=Zv((l=this.nameProvider.getNameNode(e))!==null&&l!==void 0?l:e.$cstNode))};return{node:e,name:r,get nameSegment(){return o()},selectionSegment:Zv(e.$cstNode),type:e.$type,documentUri:i.uri,path:a}}}class aEe{constructor(e){this.nodeLocator=e.workspace.AstNodeLocator}async createDescriptions(e,r=rn.None){const n=[],i=e.parseResult.value;for(const a of Ph(i))await ka(r),SG(a).filter(s=>!hm(s)).forEach(s=>{const o=this.createDescription(s);o&&n.push(o)});return n}createDescription(e){const r=e.reference.$nodeDescription,n=e.reference.$refNode;if(!r||!n)return;const i=Yl(e.container).uri;return{sourceUri:i,sourcePath:this.nodeLocator.getAstNodePath(e.container),targetUri:r.documentUri,targetPath:r.path,segment:Zv(n),local:Zl.equals(r.documentUri,i)}}}class sEe{constructor(){this.segmentSeparator="/",this.indexSeparator="@"}getAstNodePath(e){if(e.$container){const r=this.getAstNodePath(e.$container),n=this.getPathSegment(e);return r+this.segmentSeparator+n}return""}getPathSegment({$containerProperty:e,$containerIndex:r}){if(!e)throw new Error("Missing '$containerProperty' in AST node.");return r!==void 0?e+this.indexSeparator+r:e}getAstNode(e,r){return r.split(this.segmentSeparator).reduce((i,a)=>{if(!i||a.length===0)return i;const s=a.indexOf(this.indexSeparator);if(s>0){const o=a.substring(0,s),l=parseInt(a.substring(s+1)),u=i[o];return u?.[l]}return i[a]},e)}}class oEe{constructor(e){this._ready=new Vk,this.settings={},this.workspaceConfig=!1,this.onConfigurationSectionUpdateEmitter=new FU,this.serviceRegistry=e.ServiceRegistry}get ready(){return this._ready.promise}initialize(e){var r,n;this.workspaceConfig=(n=(r=e.capabilities.workspace)===null||r===void 0?void 0:r.configuration)!==null&&n!==void 0?n:!1}async initialized(e){if(this.workspaceConfig){if(e.register){const r=this.serviceRegistry.all;e.register({section:r.map(n=>this.toSectionName(n.LanguageMetaData.languageId))})}if(e.fetchConfiguration){const r=this.serviceRegistry.all.map(i=>({section:this.toSectionName(i.LanguageMetaData.languageId)})),n=await e.fetchConfiguration(r);r.forEach((i,a)=>{this.updateSectionConfiguration(i.section,n[a])})}}this._ready.resolve()}updateConfiguration(e){e.settings&&Object.keys(e.settings).forEach(r=>{const n=e.settings[r];this.updateSectionConfiguration(r,n),this.onConfigurationSectionUpdateEmitter.fire({section:r,configuration:n})})}updateSectionConfiguration(e,r){this.settings[e]=r}async getConfiguration(e,r){await this.ready;const n=this.toSectionName(e);if(this.settings[n])return this.settings[n][r]}toSectionName(e){return`${e}`}get onConfigurationSectionUpdate(){return this.onConfigurationSectionUpdateEmitter.event}}var R0;(function(t){function e(r){return{dispose:async()=>await r()}}t.create=e})(R0||(R0={}));class lEe{constructor(e){this.updateBuildOptions={validation:{categories:["built-in","fast"]}},this.updateListeners=[],this.buildPhaseListeners=new vy,this.documentPhaseListeners=new vy,this.buildState=new Map,this.documentBuildWaiters=new Map,this.currentState=jr.Changed,this.langiumDocuments=e.workspace.LangiumDocuments,this.langiumDocumentFactory=e.workspace.LangiumDocumentFactory,this.textDocuments=e.workspace.TextDocuments,this.indexManager=e.workspace.IndexManager,this.serviceRegistry=e.ServiceRegistry}async build(e,r={},n=rn.None){var i,a;for(const s of e){const o=s.uri.toString();if(s.state===jr.Validated){if(typeof r.validation=="boolean"&&r.validation)s.state=jr.IndexedReferences,s.diagnostics=void 0,this.buildState.delete(o);else if(typeof r.validation=="object"){const l=this.buildState.get(o),u=(i=l?.result)===null||i===void 0?void 0:i.validationChecks;if(u){const d=((a=r.validation.categories)!==null&&a!==void 0?a:yy.all).filter(f=>!u.includes(f));d.length>0&&(this.buildState.set(o,{completed:!1,options:{validation:Object.assign(Object.assign({},r.validation),{categories:d})},result:l.result}),s.state=jr.IndexedReferences)}}}else this.buildState.delete(o)}this.currentState=jr.Changed,await this.emitUpdate(e.map(s=>s.uri),[]),await this.buildDocuments(e,r,n)}async update(e,r,n=rn.None){this.currentState=jr.Changed;for(const s of r)this.langiumDocuments.deleteDocument(s),this.buildState.delete(s.toString()),this.indexManager.remove(s);for(const s of e){if(!this.langiumDocuments.invalidateDocument(s)){const l=this.langiumDocumentFactory.fromModel({$type:"INVALID"},s);l.state=jr.Changed,this.langiumDocuments.addDocument(l)}this.buildState.delete(s.toString())}const i=si(e).concat(r).map(s=>s.toString()).toSet();this.langiumDocuments.all.filter(s=>!i.has(s.uri.toString())&&this.shouldRelink(s,i)).forEach(s=>{this.serviceRegistry.getServices(s.uri).references.Linker.unlink(s),s.state=Math.min(s.state,jr.ComputedScopes),s.diagnostics=void 0}),await this.emitUpdate(e,r),await ka(n);const a=this.sortDocuments(this.langiumDocuments.all.filter(s=>{var o;return s.state<jr.Linked||!(!((o=this.buildState.get(s.uri.toString()))===null||o===void 0)&&o.completed)}).toArray());await this.buildDocuments(a,this.updateBuildOptions,n)}async emitUpdate(e,r){await Promise.all(this.updateListeners.map(n=>n(e,r)))}sortDocuments(e){let r=0,n=e.length-1;for(;r<n;){for(;r<e.length&&this.hasTextDocument(e[r]);)r++;for(;n>=0&&!this.hasTextDocument(e[n]);)n--;r<n&&([e[r],e[n]]=[e[n],e[r]])}return e}hasTextDocument(e){var r;return!!(!((r=this.textDocuments)===null||r===void 0)&&r.get(e.uri))}shouldRelink(e,r){return e.references.some(n=>n.error!==void 0)?!0:this.indexManager.isAffected(e,r)}onUpdate(e){return this.updateListeners.push(e),R0.create(()=>{const r=this.updateListeners.indexOf(e);r>=0&&this.updateListeners.splice(r,1)})}async buildDocuments(e,r,n){this.prepareBuild(e,r),await this.runCancelable(e,jr.Parsed,n,a=>this.langiumDocumentFactory.update(a,n)),await this.runCancelable(e,jr.IndexedContent,n,a=>this.indexManager.updateContent(a,n)),await this.runCancelable(e,jr.ComputedScopes,n,async a=>{const s=this.serviceRegistry.getServices(a.uri).references.ScopeComputation;a.precomputedScopes=await s.computeLocalScopes(a,n)}),await this.runCancelable(e,jr.Linked,n,a=>this.serviceRegistry.getServices(a.uri).references.Linker.link(a,n)),await this.runCancelable(e,jr.IndexedReferences,n,a=>this.indexManager.updateReferences(a,n));const i=e.filter(a=>this.shouldValidate(a));await this.runCancelable(i,jr.Validated,n,a=>this.validate(a,n));for(const a of e){const s=this.buildState.get(a.uri.toString());s&&(s.completed=!0)}}prepareBuild(e,r){for(const n of e){const i=n.uri.toString(),a=this.buildState.get(i);(!a||a.completed)&&this.buildState.set(i,{completed:!1,options:r,result:a?.result})}}async runCancelable(e,r,n,i){const a=e.filter(o=>o.state<r);for(const o of a)await ka(n),await i(o),o.state=r,await this.notifyDocumentPhase(o,r,n);const s=e.filter(o=>o.state===r);await this.notifyBuildPhase(s,r,n),this.currentState=r}onBuildPhase(e,r){return this.buildPhaseListeners.add(e,r),R0.create(()=>{this.buildPhaseListeners.delete(e,r)})}onDocumentPhase(e,r){return this.documentPhaseListeners.add(e,r),R0.create(()=>{this.documentPhaseListeners.delete(e,r)})}waitUntil(e,r,n){let i;if(r&&"path"in r?i=r:n=r,n??(n=rn.None),i){const a=this.langiumDocuments.getDocument(i);if(a&&a.state>e)return Promise.resolve(i)}return this.currentState>=e?Promise.resolve(void 0):n.isCancellationRequested?Promise.reject(my):new Promise((a,s)=>{const o=this.onBuildPhase(e,()=>{if(o.dispose(),l.dispose(),i){const u=this.langiumDocuments.getDocument(i);a(u?.uri)}else a(void 0)}),l=n.onCancellationRequested(()=>{o.dispose(),l.dispose(),s(my)})})}async notifyDocumentPhase(e,r,n){const a=this.documentPhaseListeners.get(r).slice();for(const s of a)try{await s(e,n)}catch(o){if(!ax(o))throw o}}async notifyBuildPhase(e,r,n){if(e.length===0)return;const a=this.buildPhaseListeners.get(r).slice();for(const s of a)await ka(n),await s(e,n)}shouldValidate(e){return!!this.getBuildOptions(e).validation}async validate(e,r){var n,i;const a=this.serviceRegistry.getServices(e.uri).validation.DocumentValidator,s=this.getBuildOptions(e).validation,o=typeof s=="object"?s:void 0,l=await a.validateDocument(e,o,r);e.diagnostics?e.diagnostics.push(...l):e.diagnostics=l;const u=this.buildState.get(e.uri.toString());if(u){(n=u.result)!==null&&n!==void 0||(u.result={});const h=(i=o?.categories)!==null&&i!==void 0?i:yy.all;u.result.validationChecks?u.result.validationChecks.push(...h):u.result.validationChecks=[...h]}}getBuildOptions(e){var r,n;return(n=(r=this.buildState.get(e.uri.toString()))===null||r===void 0?void 0:r.options)!==null&&n!==void 0?n:{}}}class cEe{constructor(e){this.symbolIndex=new Map,this.symbolByTypeIndex=new X6e,this.referenceIndex=new Map,this.documents=e.workspace.LangiumDocuments,this.serviceRegistry=e.ServiceRegistry,this.astReflection=e.AstReflection}findAllReferences(e,r){const n=Yl(e).uri,i=[];return this.referenceIndex.forEach(a=>{a.forEach(s=>{Zl.equals(s.targetUri,n)&&s.targetPath===r&&i.push(s)})}),si(i)}allElements(e,r){let n=si(this.symbolIndex.keys());return r&&(n=n.filter(i=>!r||r.has(i))),n.map(i=>this.getFileDescriptions(i,e)).flat()}getFileDescriptions(e,r){var n;return r?this.symbolByTypeIndex.get(e,r,()=>{var a;return((a=this.symbolIndex.get(e))!==null&&a!==void 0?a:[]).filter(o=>this.astReflection.isSubtype(o.type,r))}):(n=this.symbolIndex.get(e))!==null&&n!==void 0?n:[]}remove(e){const r=e.toString();this.symbolIndex.delete(r),this.symbolByTypeIndex.clear(r),this.referenceIndex.delete(r)}async updateContent(e,r=rn.None){const i=await this.serviceRegistry.getServices(e.uri).references.ScopeComputation.computeExports(e,r),a=e.uri.toString();this.symbolIndex.set(a,i),this.symbolByTypeIndex.clear(a)}async updateReferences(e,r=rn.None){const i=await this.serviceRegistry.getServices(e.uri).workspace.ReferenceDescriptionProvider.createDescriptions(e,r);this.referenceIndex.set(e.uri.toString(),i)}isAffected(e,r){const n=this.referenceIndex.get(e.uri.toString());return n?n.some(i=>!i.local&&r.has(i.targetUri.toString())):!1}}class uEe{constructor(e){this.initialBuildOptions={},this._ready=new Vk,this.serviceRegistry=e.ServiceRegistry,this.langiumDocuments=e.workspace.LangiumDocuments,this.documentBuilder=e.workspace.DocumentBuilder,this.fileSystemProvider=e.workspace.FileSystemProvider,this.mutex=e.workspace.WorkspaceLock}get ready(){return this._ready.promise}get workspaceFolders(){return this.folders}initialize(e){var r;this.folders=(r=e.workspaceFolders)!==null&&r!==void 0?r:void 0}initialized(e){return this.mutex.write(r=>{var n;return this.initializeWorkspace((n=this.folders)!==null&&n!==void 0?n:[],r)})}async initializeWorkspace(e,r=rn.None){const n=await this.performStartup(e);await ka(r),await this.documentBuilder.build(n,this.initialBuildOptions,r)}async performStartup(e){const r=this.serviceRegistry.all.flatMap(a=>a.LanguageMetaData.fileExtensions),n=[],i=a=>{n.push(a),this.langiumDocuments.hasDocument(a.uri)||this.langiumDocuments.addDocument(a)};return await this.loadAdditionalDocuments(e,i),await Promise.all(e.map(a=>[a,this.getRootFolder(a)]).map(async a=>this.traverseFolder(...a,r,i))),this._ready.resolve(),n}loadAdditionalDocuments(e,r){return Promise.resolve()}getRootFolder(e){return Tu.parse(e.uri)}async traverseFolder(e,r,n,i){const a=await this.fileSystemProvider.readDirectory(r);await Promise.all(a.map(async s=>{if(this.includeEntry(e,s,n)){if(s.isDirectory)await this.traverseFolder(e,s.uri,n,i);else if(s.isFile){const o=await this.langiumDocuments.getOrCreateDocument(s.uri);i(o)}}}))}includeEntry(e,r,n){const i=Zl.basename(r.uri);if(i.startsWith("."))return!1;if(r.isDirectory)return i!=="node_modules"&&i!=="out";if(r.isFile){const a=Zl.extname(r.uri);return n.includes(a)}return!1}}class hEe{buildUnexpectedCharactersMessage(e,r,n,i,a){return Pw.buildUnexpectedCharactersMessage(e,r,n,i,a)}buildUnableToPopLexerModeMessage(e){return Pw.buildUnableToPopLexerModeMessage(e)}}const dEe={mode:"full"};class fEe{constructor(e){this.errorMessageProvider=e.parser.LexerErrorMessageProvider,this.tokenBuilder=e.parser.TokenBuilder;const r=this.tokenBuilder.buildTokens(e.Grammar,{caseInsensitive:e.LanguageMetaData.caseInsensitive});this.tokenTypes=this.toTokenTypeDictionary(r);const n=QL(r)?Object.values(r):r,i=e.LanguageMetaData.mode==="production";this.chevrotainLexer=new ca(n,{positionTracking:"full",skipValidations:i,errorMessageProvider:this.errorMessageProvider})}get definition(){return this.tokenTypes}tokenize(e,r=dEe){var n,i,a;const s=this.chevrotainLexer.tokenize(e);return{tokens:s.tokens,errors:s.errors,hidden:(n=s.groups.hidden)!==null&&n!==void 0?n:[],report:(a=(i=this.tokenBuilder).flushLexingReport)===null||a===void 0?void 0:a.call(i,e)}}toTokenTypeDictionary(e){if(QL(e))return e;const r=UU(e)?Object.values(e.modes).flat():e,n={};return r.forEach(i=>n[i.name]=i),n}}function pEe(t){return Array.isArray(t)&&(t.length===0||"name"in t[0])}function UU(t){return t&&"modes"in t&&"defaultMode"in t}function QL(t){return!pEe(t)&&!UU(t)}function gEe(t,e,r){let n,i;typeof t=="string"?(i=e,n=r):(i=t.range.start,n=e),i||(i=Cr.create(0,0));const a=WU(t),s=Gk(n),o=yEe({lines:a,position:i,options:s});return EEe({index:0,tokens:o,position:i})}function mEe(t,e){const r=Gk(e),n=WU(t);if(n.length===0)return!1;const i=n[0],a=n[n.length-1],s=r.start,o=r.end;return!!s?.exec(i)&&!!o?.exec(a)}function WU(t){let e="";return typeof t=="string"?e=t:e=t.text,e.split(q3e)}const JL=/\s*(@([\p{L}][\p{L}\p{N}]*)?)/uy,vEe=/\{(@[\p{L}][\p{L}\p{N}]*)(\s*)([^\r\n}]+)?\}/gu;function yEe(t){var e,r,n;const i=[];let a=t.position.line,s=t.position.character;for(let o=0;o<t.lines.length;o++){const l=o===0,u=o===t.lines.length-1;let h=t.lines[o],d=0;if(l&&t.options.start){const p=(e=t.options.start)===null||e===void 0?void 0:e.exec(h);p&&(d=p.index+p[0].length)}else{const p=(r=t.options.line)===null||r===void 0?void 0:r.exec(h);p&&(d=p.index+p[0].length)}if(u){const p=(n=t.options.end)===null||n===void 0?void 0:n.exec(h);p&&(h=h.substring(0,p.index))}if(h=h.substring(0,TEe(h)),hT(h,d)>=h.length){if(i.length>0){const p=Cr.create(a,s);i.push({type:"break",content:"",range:pr.create(p,p)})}}else{JL.lastIndex=d;const p=JL.exec(h);if(p){const g=p[0],m=p[1],v=Cr.create(a,s+d),y=Cr.create(a,s+d+g.length);i.push({type:"tag",content:m,range:pr.create(v,y)}),d+=g.length,d=hT(h,d)}if(d<h.length){const g=h.substring(d),m=Array.from(g.matchAll(vEe));i.push(...xEe(m,g,a,s+d))}}a++,s=0}return i.length>0&&i[i.length-1].type==="break"?i.slice(0,-1):i}function xEe(t,e,r,n){const i=[];if(t.length===0){const a=Cr.create(r,n),s=Cr.create(r,n+e.length);i.push({type:"text",content:e,range:pr.create(a,s)})}else{let a=0;for(const o of t){const l=o.index,u=e.substring(a,l);u.length>0&&i.push({type:"text",content:e.substring(a,l),range:pr.create(Cr.create(r,a+n),Cr.create(r,l+n))});let h=u.length+1;const d=o[1];if(i.push({type:"inline-tag",content:d,range:pr.create(Cr.create(r,a+h+n),Cr.create(r,a+h+d.length+n))}),h+=d.length,o.length===4){h+=o[2].length;const f=o[3];i.push({type:"text",content:f,range:pr.create(Cr.create(r,a+h+n),Cr.create(r,a+h+f.length+n))})}else i.push({type:"text",content:"",range:pr.create(Cr.create(r,a+h+n),Cr.create(r,a+h+n))});a=l+o[0].length}const s=e.substring(a);s.length>0&&i.push({type:"text",content:s,range:pr.create(Cr.create(r,a+n),Cr.create(r,a+n+s.length))})}return i}const bEe=/\S/,wEe=/\s*$/;function hT(t,e){const r=t.substring(e).match(bEe);return r?e+r.index:t.length}function TEe(t){const e=t.match(wEe);if(e&&typeof e.index=="number")return e.index}function EEe(t){var e,r,n,i;const a=Cr.create(t.position.line,t.position.character);if(t.tokens.length===0)return new eR([],pr.create(a,a));const s=[];for(;t.index<t.tokens.length;){const u=kEe(t,s[s.length-1]);u&&s.push(u)}const o=(r=(e=s[0])===null||e===void 0?void 0:e.range.start)!==null&&r!==void 0?r:a,l=(i=(n=s[s.length-1])===null||n===void 0?void 0:n.range.end)!==null&&i!==void 0?i:a;return new eR(s,pr.create(o,l))}function kEe(t,e){const r=t.tokens[t.index];if(r.type==="tag")return qU(t,!1);if(r.type==="text"||r.type==="inline-tag")return HU(t);SEe(r,e),t.index++}function SEe(t,e){if(e){const r=new XU("",t.range);"inlines"in e?e.inlines.push(r):e.content.inlines.push(r)}}function HU(t){let e=t.tokens[t.index];const r=e;let n=e;const i=[];for(;e&&e.type!=="break"&&e.type!=="tag";)i.push(CEe(t)),n=e,e=t.tokens[t.index];return new dT(i,pr.create(r.range.start,n.range.end))}function CEe(t){return t.tokens[t.index].type==="inline-tag"?qU(t,!0):YU(t)}function qU(t,e){const r=t.tokens[t.index++],n=r.content.substring(1),i=t.tokens[t.index];if(i?.type==="text")if(e){const a=YU(t);return new x3(n,new dT([a],a.range),e,pr.create(r.range.start,a.range.end))}else{const a=HU(t);return new x3(n,a,e,pr.create(r.range.start,a.range.end))}else{const a=r.range;return new x3(n,new dT([],a),e,a)}}function YU(t){const e=t.tokens[t.index++];return new XU(e.content,e.range)}function Gk(t){if(!t)return Gk({start:"/**",end:"*/",line:"*"});const{start:e,end:r,line:n}=t;return{start:y3(e,!0),end:y3(r,!1),line:y3(n,!0)}}function y3(t,e){if(typeof t=="string"||typeof t=="object"){const r=typeof t=="string"?j2(t):t.source;return e?new RegExp(`^\\s*${r}`):new RegExp(`\\s*${r}\\s*$`)}else return t}class eR{constructor(e,r){this.elements=e,this.range=r}getTag(e){return this.getAllTags().find(r=>r.name===e)}getTags(e){return this.getAllTags().filter(r=>r.name===e)}getAllTags(){return this.elements.filter(e=>"name"in e)}toString(){let e="";for(const r of this.elements)if(e.length===0)e=r.toString();else{const n=r.toString();e+=tR(e)+n}return e.trim()}toMarkdown(e){let r="";for(const n of this.elements)if(r.length===0)r=n.toMarkdown(e);else{const i=n.toMarkdown(e);r+=tR(r)+i}return r.trim()}}class x3{constructor(e,r,n,i){this.name=e,this.content=r,this.inline=n,this.range=i}toString(){let e=`@${this.name}`;const r=this.content.toString();return this.content.inlines.length===1?e=`${e} ${r}`:this.content.inlines.length>1&&(e=`${e}
${r}`),this.inline?`{${e}}`:e}toMarkdown(e){var r,n;return(n=(r=e?.renderTag)===null||r===void 0?void 0:r.call(e,this))!==null&&n!==void 0?n:this.toMarkdownDefault(e)}toMarkdownDefault(e){const r=this.content.toMarkdown(e);if(this.inline){const a=AEe(this.name,r,e??{});if(typeof a=="string")return a}let n="";e?.tag==="italic"||e?.tag===void 0?n="*":e?.tag==="bold"?n="**":e?.tag==="bold-italic"&&(n="***");let i=`${n}@${this.name}${n}`;return this.content.inlines.length===1?i=`${i} — ${r}`:this.content.inlines.length>1&&(i=`${i}
${r}`),this.inline?`{${i}}`:i}}function AEe(t,e,r){var n,i;if(t==="linkplain"||t==="linkcode"||t==="link"){const a=e.indexOf(" ");let s=e;if(a>0){const l=hT(e,a);s=e.substring(l),e=e.substring(0,a)}return(t==="linkcode"||t==="link"&&r.link==="code")&&(s=`\`${s}\``),(i=(n=r.renderLink)===null||n===void 0?void 0:n.call(r,e,s))!==null&&i!==void 0?i:_Ee(e,s)}}function _Ee(t,e){try{return Tu.parse(t,!0),`[${e}](${t})`}catch{return t}}class dT{constructor(e,r){this.inlines=e,this.range=r}toString(){let e="";for(let r=0;r<this.inlines.length;r++){const n=this.inlines[r],i=this.inlines[r+1];e+=n.toString(),i&&i.range.start.line>n.range.start.line&&(e+=`
`)}return e}toMarkdown(e){let r="";for(let n=0;n<this.inlines.length;n++){const i=this.inlines[n],a=this.inlines[n+1];r+=i.toMarkdown(e),a&&a.range.start.line>i.range.start.line&&(r+=`
`)}return r}}class XU{constructor(e,r){this.text=e,this.range=r}toString(){return this.text}toMarkdown(){return this.text}}function tR(t){return t.endsWith(`
`)?`
`:`

`}class LEe{constructor(e){this.indexManager=e.shared.workspace.IndexManager,this.commentProvider=e.documentation.CommentProvider}getDocumentation(e){const r=this.commentProvider.getComment(e);if(r&&mEe(r))return gEe(r).toMarkdown({renderLink:(i,a)=>this.documentationLinkRenderer(e,i,a),renderTag:i=>this.documentationTagRenderer(e,i)})}documentationLinkRenderer(e,r,n){var i;const a=(i=this.findNameInPrecomputedScopes(e,r))!==null&&i!==void 0?i:this.findNameInGlobalScope(e,r);if(a&&a.nameSegment){const s=a.nameSegment.range.start.line+1,o=a.nameSegment.range.start.character+1,l=a.documentUri.with({fragment:`L${s},${o}`});return`[${n}](${l.toString()})`}else return}documentationTagRenderer(e,r){}findNameInPrecomputedScopes(e,r){const i=Yl(e).precomputedScopes;if(!i)return;let a=e;do{const o=i.get(a).find(l=>l.name===r);if(o)return o;a=a.$container}while(a)}findNameInGlobalScope(e,r){return this.indexManager.allElements().find(i=>i.name===r)}}class REe{constructor(e){this.grammarConfig=()=>e.parser.GrammarConfig}getComment(e){var r;return Z6e(e)?e.$comment:(r=T3e(e.$cstNode,this.grammarConfig().multilineCommentRules))===null||r===void 0?void 0:r.text}}class NEe{constructor(e){this.syncParser=e.parser.LangiumParser}parse(e,r){return Promise.resolve(this.syncParser.parse(e))}}class DEe{constructor(){this.previousTokenSource=new zk,this.writeQueue=[],this.readQueue=[],this.done=!0}write(e){this.cancelWrite();const r=B6e();return this.previousTokenSource=r,this.enqueue(this.writeQueue,e,r.token)}read(e){return this.enqueue(this.readQueue,e)}enqueue(e,r,n=rn.None){const i=new Vk,a={action:r,deferred:i,cancellationToken:n};return e.push(a),this.performNextOperation(),i.promise}async performNextOperation(){if(!this.done)return;const e=[];if(this.writeQueue.length>0)e.push(this.writeQueue.shift());else if(this.readQueue.length>0)e.push(...this.readQueue.splice(0,this.readQueue.length));else return;this.done=!1,await Promise.all(e.map(async({action:r,deferred:n,cancellationToken:i})=>{try{const a=await Promise.resolve().then(()=>r(i));n.resolve(a)}catch(a){ax(a)?n.resolve(void 0):n.reject(a)}})),this.done=!0,this.performNextOperation()}cancelWrite(){this.previousTokenSource.cancel()}}class MEe{constructor(e){this.grammarElementIdMap=new jL,this.tokenTypeIdMap=new jL,this.grammar=e.Grammar,this.lexer=e.parser.Lexer,this.linker=e.references.Linker}dehydrate(e){return{lexerErrors:e.lexerErrors,lexerReport:e.lexerReport?this.dehydrateLexerReport(e.lexerReport):void 0,parserErrors:e.parserErrors.map(r=>Object.assign(Object.assign({},r),{message:r.message})),value:this.dehydrateAstNode(e.value,this.createDehyrationContext(e.value))}}dehydrateLexerReport(e){return e}createDehyrationContext(e){const r=new Map,n=new Map;for(const i of Ph(e))r.set(i,{});if(e.$cstNode)for(const i of Lw(e.$cstNode))n.set(i,{});return{astNodes:r,cstNodes:n}}dehydrateAstNode(e,r){const n=r.astNodes.get(e);n.$type=e.$type,n.$containerIndex=e.$containerIndex,n.$containerProperty=e.$containerProperty,e.$cstNode!==void 0&&(n.$cstNode=this.dehydrateCstNode(e.$cstNode,r));for(const[i,a]of Object.entries(e))if(!i.startsWith("$"))if(Array.isArray(a)){const s=[];n[i]=s;for(const o of a)Ei(o)?s.push(this.dehydrateAstNode(o,r)):Hs(o)?s.push(this.dehydrateReference(o,r)):s.push(o)}else Ei(a)?n[i]=this.dehydrateAstNode(a,r):Hs(a)?n[i]=this.dehydrateReference(a,r):a!==void 0&&(n[i]=a);return n}dehydrateReference(e,r){const n={};return n.$refText=e.$refText,e.$refNode&&(n.$refNode=r.cstNodes.get(e.$refNode)),n}dehydrateCstNode(e,r){const n=r.cstNodes.get(e);return vG(e)?n.fullText=e.fullText:n.grammarSource=this.getGrammarElementId(e.grammarSource),n.hidden=e.hidden,n.astNode=r.astNodes.get(e.astNode),pp(e)?n.content=e.content.map(i=>this.dehydrateCstNode(i,r)):mG(e)&&(n.tokenType=e.tokenType.name,n.offset=e.offset,n.length=e.length,n.startLine=e.range.start.line,n.startColumn=e.range.start.character,n.endLine=e.range.end.line,n.endColumn=e.range.end.character),n}hydrate(e){const r=e.value,n=this.createHydrationContext(r);return"$cstNode"in r&&this.hydrateCstNode(r.$cstNode,n),{lexerErrors:e.lexerErrors,lexerReport:e.lexerReport,parserErrors:e.parserErrors,value:this.hydrateAstNode(r,n)}}createHydrationContext(e){const r=new Map,n=new Map;for(const a of Ph(e))r.set(a,{});let i;if(e.$cstNode)for(const a of Lw(e.$cstNode)){let s;"fullText"in a?(s=new CU(a.fullText),i=s):"content"in a?s=new Fk:"tokenType"in a&&(s=this.hydrateCstLeafNode(a)),s&&(n.set(a,s),s.root=i)}return{astNodes:r,cstNodes:n}}hydrateAstNode(e,r){const n=r.astNodes.get(e);n.$type=e.$type,n.$containerIndex=e.$containerIndex,n.$containerProperty=e.$containerProperty,e.$cstNode&&(n.$cstNode=r.cstNodes.get(e.$cstNode));for(const[i,a]of Object.entries(e))if(!i.startsWith("$"))if(Array.isArray(a)){const s=[];n[i]=s;for(const o of a)Ei(o)?s.push(this.setParent(this.hydrateAstNode(o,r),n)):Hs(o)?s.push(this.hydrateReference(o,n,i,r)):s.push(o)}else Ei(a)?n[i]=this.setParent(this.hydrateAstNode(a,r),n):Hs(a)?n[i]=this.hydrateReference(a,n,i,r):a!==void 0&&(n[i]=a);return n}setParent(e,r){return e.$container=r,e}hydrateReference(e,r,n,i){return this.linker.buildReference(r,n,i.cstNodes.get(e.$refNode),e.$refText)}hydrateCstNode(e,r,n=0){const i=r.cstNodes.get(e);if(typeof e.grammarSource=="number"&&(i.grammarSource=this.getGrammarElement(e.grammarSource)),i.astNode=r.astNodes.get(e.astNode),pp(i))for(const a of e.content){const s=this.hydrateCstNode(a,r,n++);i.content.push(s)}return i}hydrateCstLeafNode(e){const r=this.getTokenType(e.tokenType),n=e.offset,i=e.length,a=e.startLine,s=e.startColumn,o=e.endLine,l=e.endColumn,u=e.hidden;return new nT(n,i,{start:{line:a,character:s},end:{line:o,character:l}},r,u)}getTokenType(e){return this.lexer.definition[e]}getGrammarElementId(e){if(e)return this.grammarElementIdMap.size===0&&this.createGrammarElementIdMap(),this.grammarElementIdMap.get(e)}getGrammarElement(e){return this.grammarElementIdMap.size===0&&this.createGrammarElementIdMap(),this.grammarElementIdMap.getKey(e)}createGrammarElementIdMap(){let e=0;for(const r of Ph(this.grammar))k3e(r)&&this.grammarElementIdMap.set(r,e++)}}function fc(t){return{documentation:{CommentProvider:e=>new REe(e),DocumentationProvider:e=>new LEe(e)},parser:{AsyncParser:e=>new NEe(e),GrammarConfig:e=>g5e(e),LangiumParser:e=>T6e(e),CompletionParser:e=>w6e(e),ValueConverter:()=>new OU,TokenBuilder:()=>new IU,Lexer:e=>new fEe(e),ParserErrorMessageProvider:()=>new LU,LexerErrorMessageProvider:()=>new hEe},workspace:{AstNodeLocator:()=>new sEe,AstNodeDescriptionProvider:e=>new iEe(e),ReferenceDescriptionProvider:e=>new aEe(e)},references:{Linker:e=>new V6e(e),NameProvider:()=>new U6e,ScopeProvider:e=>new K6e(e),ScopeComputation:e=>new H6e(e),References:e=>new W6e(e)},serializer:{Hydrator:e=>new MEe(e),JsonSerializer:e=>new Q6e(e)},validation:{DocumentValidator:e=>new tEe(e),ValidationRegistry:e=>new eEe(e)},shared:()=>t.shared}}function pc(t){return{ServiceRegistry:e=>new J6e(e),workspace:{LangiumDocuments:e=>new z6e(e),LangiumDocumentFactory:e=>new $6e(e),DocumentBuilder:e=>new lEe(e),IndexManager:e=>new cEe(e),WorkspaceManager:e=>new uEe(e),FileSystemProvider:e=>t.fileSystemProvider(e),WorkspaceLock:()=>new DEe,ConfigurationProvider:e=>new oEe(e)}}}var rR;(function(t){t.merge=(e,r)=>xy(xy({},e),r)})(rR||(rR={}));function _i(t,e,r,n,i,a,s,o,l){const u=[t,e,r,n,i,a,s,o,l].reduce(xy,{});return jU(u)}const IEe=Symbol("isProxy");function jU(t,e){const r=new Proxy({},{deleteProperty:()=>!1,set:()=>{throw new Error("Cannot set property on injected service container")},get:(n,i)=>i===IEe?!0:iR(n,i,t,e||r),getOwnPropertyDescriptor:(n,i)=>(iR(n,i,t,e||r),Object.getOwnPropertyDescriptor(n,i)),has:(n,i)=>i in t,ownKeys:()=>[...Object.getOwnPropertyNames(t)]});return r}const nR=Symbol();function iR(t,e,r,n){if(e in t){if(t[e]instanceof Error)throw new Error("Construction failure. Please make sure that your dependencies are constructable.",{cause:t[e]});if(t[e]===nR)throw new Error('Cycle detected. Please make "'+String(e)+'" lazy. Visit https://langium.org/docs/reference/configuration-services/#resolving-cyclic-dependencies');return t[e]}else if(e in r){const i=r[e];t[e]=nR;try{t[e]=typeof i=="function"?i(n):jU(i,n)}catch(a){throw t[e]=a instanceof Error?a:void 0,a}return t[e]}else return}function xy(t,e){if(e){for(const[r,n]of Object.entries(e))if(n!==void 0){const i=t[r];i!==null&&n!==null&&typeof i=="object"&&typeof n=="object"?t[r]=xy(i,n):t[r]=n}}return t}class OEe{readFile(){throw new Error("No file system is available.")}async readDirectory(){return[]}}const gc={fileSystemProvider:()=>new OEe},PEe={Grammar:()=>{},LanguageMetaData:()=>({caseInsensitive:!1,fileExtensions:[".langium"],languageId:"langium"})},BEe={AstReflection:()=>new kG};function FEe(){const t=_i(pc(gc),BEe),e=_i(fc({shared:t}),PEe);return t.ServiceRegistry.register(e),e}function Vu(t){var e;const r=FEe(),n=r.serializer.JsonSerializer.deserialize(t);return r.shared.workspace.LangiumDocumentFactory.fromModel(n,Tu.parse(`memory://${(e=n.name)!==null&&e!==void 0?e:"grammar"}.langium`)),n}var $Ee=Object.defineProperty,mt=(t,e)=>$Ee(t,"name",{value:e,configurable:!0}),aR="Statement",xm="Architecture";function zEe(t){return As.isInstance(t,xm)}mt(zEe,"isArchitecture");var w1="Axis",l0="Branch";function VEe(t){return As.isInstance(t,l0)}mt(VEe,"isBranch");var T1="Checkout",E1="CherryPicking",b3="ClassDefStatement",c0="Commit";function GEe(t){return As.isInstance(t,c0)}mt(GEe,"isCommit");var w3="Curve",T3="Edge",E3="Entry",u0="GitGraph";function UEe(t){return As.isInstance(t,u0)}mt(UEe,"isGitGraph");var k3="Group",bm="Info";function WEe(t){return As.isInstance(t,bm)}mt(WEe,"isInfo");var k1="Item",S3="Junction",h0="Merge";function HEe(t){return As.isInstance(t,h0)}mt(HEe,"isMerge");var C3="Option",wm="Packet";function qEe(t){return As.isInstance(t,wm)}mt(qEe,"isPacket");var Tm="PacketBlock";function YEe(t){return As.isInstance(t,Tm)}mt(YEe,"isPacketBlock");var Em="Pie";function XEe(t){return As.isInstance(t,Em)}mt(XEe,"isPie");var km="PieSection";function jEe(t){return As.isInstance(t,km)}mt(jEe,"isPieSection");var A3="Radar",_3="Service",Sm="Treemap";function KEe(t){return As.isInstance(t,Sm)}mt(KEe,"isTreemap");var L3="TreemapRow",S1="Direction",C1="Leaf",A1="Section",KU=class extends gG{static{mt(this,"MermaidAstReflection")}getAllTypes(){return[xm,w1,l0,T1,E1,b3,c0,w3,S1,T3,E3,u0,k3,bm,k1,S3,C1,h0,C3,wm,Tm,Em,km,A3,A1,_3,aR,Sm,L3]}computeIsSubtype(t,e){switch(t){case l0:case T1:case E1:case c0:case h0:return this.isSubtype(aR,e);case S1:return this.isSubtype(u0,e);case C1:case A1:return this.isSubtype(k1,e);default:return!1}}getReferenceType(t){const e=`${t.container.$type}:${t.property}`;switch(e){case"Entry:axis":return w1;default:throw new Error(`${e} is not a valid reference id.`)}}getTypeMetaData(t){switch(t){case xm:return{name:xm,properties:[{name:"accDescr"},{name:"accTitle"},{name:"edges",defaultValue:[]},{name:"groups",defaultValue:[]},{name:"junctions",defaultValue:[]},{name:"services",defaultValue:[]},{name:"title"}]};case w1:return{name:w1,properties:[{name:"label"},{name:"name"}]};case l0:return{name:l0,properties:[{name:"name"},{name:"order"}]};case T1:return{name:T1,properties:[{name:"branch"}]};case E1:return{name:E1,properties:[{name:"id"},{name:"parent"},{name:"tags",defaultValue:[]}]};case b3:return{name:b3,properties:[{name:"className"},{name:"styleText"}]};case c0:return{name:c0,properties:[{name:"id"},{name:"message"},{name:"tags",defaultValue:[]},{name:"type"}]};case w3:return{name:w3,properties:[{name:"entries",defaultValue:[]},{name:"label"},{name:"name"}]};case T3:return{name:T3,properties:[{name:"lhsDir"},{name:"lhsGroup",defaultValue:!1},{name:"lhsId"},{name:"lhsInto",defaultValue:!1},{name:"rhsDir"},{name:"rhsGroup",defaultValue:!1},{name:"rhsId"},{name:"rhsInto",defaultValue:!1},{name:"title"}]};case E3:return{name:E3,properties:[{name:"axis"},{name:"value"}]};case u0:return{name:u0,properties:[{name:"accDescr"},{name:"accTitle"},{name:"statements",defaultValue:[]},{name:"title"}]};case k3:return{name:k3,properties:[{name:"icon"},{name:"id"},{name:"in"},{name:"title"}]};case bm:return{name:bm,properties:[{name:"accDescr"},{name:"accTitle"},{name:"title"}]};case k1:return{name:k1,properties:[{name:"classSelector"},{name:"name"}]};case S3:return{name:S3,properties:[{name:"id"},{name:"in"}]};case h0:return{name:h0,properties:[{name:"branch"},{name:"id"},{name:"tags",defaultValue:[]},{name:"type"}]};case C3:return{name:C3,properties:[{name:"name"},{name:"value",defaultValue:!1}]};case wm:return{name:wm,properties:[{name:"accDescr"},{name:"accTitle"},{name:"blocks",defaultValue:[]},{name:"title"}]};case Tm:return{name:Tm,properties:[{name:"bits"},{name:"end"},{name:"label"},{name:"start"}]};case Em:return{name:Em,properties:[{name:"accDescr"},{name:"accTitle"},{name:"sections",defaultValue:[]},{name:"showData",defaultValue:!1},{name:"title"}]};case km:return{name:km,properties:[{name:"label"},{name:"value"}]};case A3:return{name:A3,properties:[{name:"accDescr"},{name:"accTitle"},{name:"axes",defaultValue:[]},{name:"curves",defaultValue:[]},{name:"options",defaultValue:[]},{name:"title"}]};case _3:return{name:_3,properties:[{name:"icon"},{name:"iconText"},{name:"id"},{name:"in"},{name:"title"}]};case Sm:return{name:Sm,properties:[{name:"accDescr"},{name:"accTitle"},{name:"title"},{name:"TreemapRows",defaultValue:[]}]};case L3:return{name:L3,properties:[{name:"indent"},{name:"item"}]};case S1:return{name:S1,properties:[{name:"accDescr"},{name:"accTitle"},{name:"dir"},{name:"statements",defaultValue:[]},{name:"title"}]};case C1:return{name:C1,properties:[{name:"classSelector"},{name:"name"},{name:"value"}]};case A1:return{name:A1,properties:[{name:"classSelector"},{name:"name"}]};default:return{name:t,properties:[]}}}},As=new KU,sR,ZEe=mt(()=>sR??(sR=Vu(`{"$type":"Grammar","isDeclared":true,"name":"Info","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Info","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"info"},{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"Keyword","value":"showInfo"},{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[],"cardinality":"*"}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"?"}]},"definesHiddenTokens":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}],"cardinality":"+"},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"}},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"}}]},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@7"}},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@8"}}]},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/"},"fragment":false}],"definesHiddenTokens":false,"hiddenTokens":[],"interfaces":[],"types":[],"usedGrammars":[]}`)),"InfoGrammar"),oR,QEe=mt(()=>oR??(oR=Vu(`{"$type":"Grammar","isDeclared":true,"name":"Packet","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Packet","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"packet"},{"$type":"Keyword","value":"packet-beta"}]},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]},{"$type":"Assignment","feature":"blocks","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}],"cardinality":"*"}]},"definesHiddenTokens":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"PacketBlock","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Assignment","feature":"start","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"-"},{"$type":"Assignment","feature":"end","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}}],"cardinality":"?"}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"+"},{"$type":"Assignment","feature":"bits","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}}]}]},{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}],"cardinality":"+"},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"}},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"}}]},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@8"}},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@9"}}]},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/"},"fragment":false}],"definesHiddenTokens":false,"hiddenTokens":[],"interfaces":[],"types":[],"usedGrammars":[]}`)),"PacketGrammar"),lR,JEe=mt(()=>lR??(lR=Vu(`{"$type":"Grammar","isDeclared":true,"name":"Pie","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Pie","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"pie"},{"$type":"Assignment","feature":"showData","operator":"?=","terminal":{"$type":"Keyword","value":"showData"},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"Assignment","feature":"sections","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}],"cardinality":"*"}]},"definesHiddenTokens":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"PieSection","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"FLOAT_PIE","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/-?[0-9]+\\\\.[0-9]+(?!\\\\.)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT_PIE","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/-?(0|[1-9][0-9]*)(?!\\\\.)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER_PIE","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@2"}},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@3"}}]},"fragment":false,"hidden":false},{"$type":"ParserRule","fragment":true,"name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}],"cardinality":"+"},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"}},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"}}]},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@11"}},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@12"}}]},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/"},"fragment":false}],"definesHiddenTokens":false,"hiddenTokens":[],"interfaces":[],"types":[],"usedGrammars":[]}`)),"PieGrammar"),cR,eke=mt(()=>cR??(cR=Vu(`{"$type":"Grammar","isDeclared":true,"name":"Architecture","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Architecture","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"architecture-beta"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}],"cardinality":"*"}]},"definesHiddenTokens":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"Statement","definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"groups","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"services","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"junctions","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}},{"$type":"Assignment","feature":"edges","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"LeftPort","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"lhsDir","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"RightPort","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"rhsDir","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Keyword","value":":"}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"Arrow","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]},{"$type":"Assignment","feature":"lhsInto","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"--"},{"$type":"Group","elements":[{"$type":"Keyword","value":"-"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]}},{"$type":"Keyword","value":"-"}]}]},{"$type":"Assignment","feature":"rhsInto","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Group","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"group"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Assignment","feature":"icon","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@28"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]},"cardinality":"?"},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Service","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"service"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"iconText","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]}},{"$type":"Assignment","feature":"icon","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@28"},"arguments":[]}}],"cardinality":"?"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]},"cardinality":"?"},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Junction","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"junction"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Edge","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"lhsId","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Assignment","feature":"lhsGroup","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"Assignment","feature":"rhsId","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Assignment","feature":"rhsGroup","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"ARROW_DIRECTION","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"L"}},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"R"}}]},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"T"}}]},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"B"}}]},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARROW_GROUP","definition":{"$type":"RegexToken","regex":"/\\\\{group\\\\}/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARROW_INTO","definition":{"$type":"RegexToken","regex":"/<|>/"},"fragment":false,"hidden":false},{"$type":"ParserRule","fragment":true,"name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}],"cardinality":"+"},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"}},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"}}]},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@18"}},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@19"}}]},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/"},"fragment":false},{"$type":"TerminalRule","name":"ARCH_ICON","definition":{"$type":"RegexToken","regex":"/\\\\([\\\\w-:]+\\\\)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARCH_TITLE","definition":{"$type":"RegexToken","regex":"/\\\\[[\\\\w ]+\\\\]/"},"fragment":false,"hidden":false}],"definesHiddenTokens":false,"hiddenTokens":[],"interfaces":[],"types":[],"usedGrammars":[]}`)),"ArchitectureGrammar"),uR,tke=mt(()=>uR??(uR=Vu(`{"$type":"Grammar","isDeclared":true,"name":"GitGraph","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"GitGraph","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"gitGraph"},{"$type":"Group","elements":[{"$type":"Keyword","value":"gitGraph"},{"$type":"Keyword","value":":"}]},{"$type":"Keyword","value":"gitGraph:"},{"$type":"Group","elements":[{"$type":"Keyword","value":"gitGraph"},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]},{"$type":"Keyword","value":":"}]}]},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]},{"$type":"Assignment","feature":"statements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}}],"cardinality":"*"}]},"definesHiddenTokens":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Statement","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Direction","definition":{"$type":"Assignment","feature":"dir","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"LR"},{"$type":"Keyword","value":"TB"},{"$type":"Keyword","value":"BT"}]}},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Commit","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"commit"},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"id:"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"msg:","cardinality":"?"},{"$type":"Assignment","feature":"message","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"type:"},{"$type":"Assignment","feature":"type","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"NORMAL"},{"$type":"Keyword","value":"REVERSE"},{"$type":"Keyword","value":"HIGHLIGHT"}]}}]}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Branch","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"branch"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"order:"},{"$type":"Assignment","feature":"order","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Merge","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"merge"},{"$type":"Assignment","feature":"branch","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]}},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"id:"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"type:"},{"$type":"Assignment","feature":"type","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"NORMAL"},{"$type":"Keyword","value":"REVERSE"},{"$type":"Keyword","value":"HIGHLIGHT"}]}}]}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Checkout","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"checkout"},{"$type":"Keyword","value":"switch"}]},{"$type":"Assignment","feature":"branch","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"CherryPicking","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"cherry-pick"},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"id:"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"parent:"},{"$type":"Assignment","feature":"parent","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}],"cardinality":"+"},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"}},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"}}]},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@14"}},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@15"}}]},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/"},"fragment":false},{"$type":"TerminalRule","name":"REFERENCE","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\\\w([-\\\\./\\\\w]*[-\\\\w])?/"},"fragment":false,"hidden":false}],"definesHiddenTokens":false,"hiddenTokens":[],"interfaces":[],"types":[],"usedGrammars":[]}`)),"GitGraphGrammar"),hR,rke=mt(()=>hR??(hR=Vu(`{"$type":"Grammar","isDeclared":true,"name":"Radar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Radar","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"radar-beta"},{"$type":"Keyword","value":"radar-beta:"},{"$type":"Group","elements":[{"$type":"Keyword","value":"radar-beta"},{"$type":"Keyword","value":":"}]}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Keyword","value":"axis"},{"$type":"Assignment","feature":"axes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"axes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"curve"},{"$type":"Assignment","feature":"curves","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"curves","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}}],"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"options","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"options","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}}],"cardinality":"*"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}],"cardinality":"*"}]},"definesHiddenTokens":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"Label","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}},{"$type":"Keyword","value":"]"}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Axis","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[],"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Curve","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[],"cardinality":"?"},{"$type":"Keyword","value":"{"},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"Entries","definition":{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"}]}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DetailedEntry","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"axis","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@2"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},"deprecatedSyntax":false}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"NumberEntry","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Option","definition":{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"showLegend"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"ticks"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"max"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"min"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"graticule"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}}]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"GRATICULE","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"circle"}},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"polygon"}}]},"fragment":false,"hidden":false},{"$type":"ParserRule","fragment":true,"name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}],"cardinality":"+"},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"}},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"}}]},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@15"}},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@16"}}]},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/"},"fragment":false}],"interfaces":[{"$type":"Interface","name":"Entry","attributes":[{"$type":"TypeAttribute","name":"axis","isOptional":true,"type":{"$type":"ReferenceType","referenceType":{"$type":"SimpleType","typeRef":{"$ref":"#/rules@2"}}}},{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"number"},"isOptional":false}],"superTypes":[]}],"definesHiddenTokens":false,"hiddenTokens":[],"types":[],"usedGrammars":[]}`)),"RadarGrammar"),dR,nke=mt(()=>dR??(dR=Vu(`{"$type":"Grammar","isDeclared":true,"name":"Treemap","rules":[{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}}],"cardinality":"+"},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"}},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"}}]},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/"},"fragment":false,"hidden":false},{"$type":"ParserRule","entry":true,"name":"Treemap","returnType":{"$ref":"#/interfaces@4"},"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]},{"$type":"Assignment","feature":"TreemapRows","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}}],"cardinality":"*"}]},"definesHiddenTokens":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"TREEMAP_KEYWORD","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"treemap-beta"}},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"treemap"}}]},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"CLASS_DEF","definition":{"$type":"RegexToken","regex":"/classDef\\\\s+([a-zA-Z_][a-zA-Z0-9_]+)(?:\\\\s+([^;\\\\r\\\\n]*))?(?:;)?/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STYLE_SEPARATOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":":::"}},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"SEPARATOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":":"}},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"COMMA","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":","}},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WS","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ML_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\%\\\\%[^\\\\n]*/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"NL","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/"},"fragment":false},{"$type":"ParserRule","name":"TreemapRow","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"indent","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"item","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ClassDef","dataType":"string","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Item","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Section","returnType":{"$ref":"#/interfaces@1"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]},{"$type":"Assignment","feature":"classSelector","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}],"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Leaf","returnType":{"$ref":"#/interfaces@2"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[],"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[],"cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]},{"$type":"Assignment","feature":"classSelector","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}],"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"INDENTATION","definition":{"$type":"RegexToken","regex":"/[ \\\\t]{1,}/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID2","definition":{"$type":"RegexToken","regex":"/[a-zA-Z_][a-zA-Z0-9_]*/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER2","definition":{"$type":"RegexToken","regex":"/[0-9_\\\\.\\\\,]+/"},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"MyNumber","dataType":"number","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"STRING2","definition":{"$type":"RegexToken","regex":"/\\"[^\\"]*\\"|'[^']*'/"},"fragment":false,"hidden":false}],"interfaces":[{"$type":"Interface","name":"Item","attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"classSelector","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]},{"$type":"Interface","name":"Section","superTypes":[{"$ref":"#/interfaces@0"}],"attributes":[]},{"$type":"Interface","name":"Leaf","superTypes":[{"$ref":"#/interfaces@0"}],"attributes":[{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"number"},"isOptional":false}]},{"$type":"Interface","name":"ClassDefStatement","attributes":[{"$type":"TypeAttribute","name":"className","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"styleText","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"Treemap","attributes":[{"$type":"TypeAttribute","name":"TreemapRows","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/rules@14"}}},"isOptional":false},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"definesHiddenTokens":false,"hiddenTokens":[],"imports":[],"types":[],"usedGrammars":[],"$comment":"/**\\n * Treemap grammar for Langium\\n * Converted from mindmap grammar\\n *\\n * The ML_COMMENT and NL hidden terminals handle whitespace, comments, and newlines\\n * before the treemap keyword, allowing for empty lines and comments before the\\n * treemap declaration.\\n */"}`)),"TreemapGrammar"),ike={languageId:"info",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},ake={languageId:"packet",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},ske={languageId:"pie",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},oke={languageId:"architecture",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},lke={languageId:"gitGraph",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},cke={languageId:"radar",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},uke={languageId:"treemap",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Gu={AstReflection:mt(()=>new KU,"AstReflection")},hke={Grammar:mt(()=>ZEe(),"Grammar"),LanguageMetaData:mt(()=>ike,"LanguageMetaData"),parser:{}},dke={Grammar:mt(()=>QEe(),"Grammar"),LanguageMetaData:mt(()=>ake,"LanguageMetaData"),parser:{}},fke={Grammar:mt(()=>JEe(),"Grammar"),LanguageMetaData:mt(()=>ske,"LanguageMetaData"),parser:{}},pke={Grammar:mt(()=>eke(),"Grammar"),LanguageMetaData:mt(()=>oke,"LanguageMetaData"),parser:{}},gke={Grammar:mt(()=>tke(),"Grammar"),LanguageMetaData:mt(()=>lke,"LanguageMetaData"),parser:{}},mke={Grammar:mt(()=>rke(),"Grammar"),LanguageMetaData:mt(()=>cke,"LanguageMetaData"),parser:{}},vke={Grammar:mt(()=>nke(),"Grammar"),LanguageMetaData:mt(()=>uke,"LanguageMetaData"),parser:{}},yke=/accDescr(?:[\t ]*:([^\n\r]*)|\s*{([^}]*)})/,xke=/accTitle[\t ]*:([^\n\r]*)/,bke=/title([\t ][^\n\r]*|)/,wke={ACC_DESCR:yke,ACC_TITLE:xke,TITLE:bke},sx=class extends OU{static{mt(this,"AbstractMermaidValueConverter")}runConverter(t,e,r){let n=this.runCommonConverter(t,e,r);return n===void 0&&(n=this.runCustomConverter(t,e,r)),n===void 0?super.runConverter(t,e,r):n}runCommonConverter(t,e,r){const n=wke[t.name];if(n===void 0)return;const i=n.exec(e);if(i!==null){if(i[1]!==void 0)return i[1].trim().replace(/[\t ]{2,}/gm," ");if(i[2]!==void 0)return i[2].replace(/^\s*/gm,"").replace(/\s+$/gm,"").replace(/[\t ]{2,}/gm," ").replace(/[\n\r]{2,}/gm,`
`)}}},ox=class extends sx{static{mt(this,"CommonValueConverter")}runCustomConverter(t,e,r){}},mc=class extends IU{static{mt(this,"AbstractMermaidTokenBuilder")}constructor(t){super(),this.keywords=new Set(t)}buildKeywordTokens(t,e,r){const n=super.buildKeywordTokens(t,e,r);return n.forEach(i=>{this.keywords.has(i.name)&&i.PATTERN!==void 0&&(i.PATTERN=new RegExp(i.PATTERN.toString()+"(?:(?=%%)|(?!\\S))"))}),n}};(class extends mc{static{mt(this,"CommonTokenBuilder")}});var Tke=class extends mc{static{mt(this,"GitGraphTokenBuilder")}constructor(){super(["gitGraph"])}},ZU={parser:{TokenBuilder:mt(()=>new Tke,"TokenBuilder"),ValueConverter:mt(()=>new ox,"ValueConverter")}};function QU(t=gc){const e=_i(pc(t),Gu),r=_i(fc({shared:e}),gke,ZU);return e.ServiceRegistry.register(r),{shared:e,GitGraph:r}}mt(QU,"createGitGraphServices");var Eke=class extends mc{static{mt(this,"InfoTokenBuilder")}constructor(){super(["info","showInfo"])}},JU={parser:{TokenBuilder:mt(()=>new Eke,"TokenBuilder"),ValueConverter:mt(()=>new ox,"ValueConverter")}};function eW(t=gc){const e=_i(pc(t),Gu),r=_i(fc({shared:e}),hke,JU);return e.ServiceRegistry.register(r),{shared:e,Info:r}}mt(eW,"createInfoServices");var kke=class extends mc{static{mt(this,"PacketTokenBuilder")}constructor(){super(["packet"])}},tW={parser:{TokenBuilder:mt(()=>new kke,"TokenBuilder"),ValueConverter:mt(()=>new ox,"ValueConverter")}};function rW(t=gc){const e=_i(pc(t),Gu),r=_i(fc({shared:e}),dke,tW);return e.ServiceRegistry.register(r),{shared:e,Packet:r}}mt(rW,"createPacketServices");var Ske=class extends mc{static{mt(this,"PieTokenBuilder")}constructor(){super(["pie","showData"])}},Cke=class extends sx{static{mt(this,"PieValueConverter")}runCustomConverter(t,e,r){if(t.name==="PIE_SECTION_LABEL")return e.replace(/"/g,"").trim()}},nW={parser:{TokenBuilder:mt(()=>new Ske,"TokenBuilder"),ValueConverter:mt(()=>new Cke,"ValueConverter")}};function iW(t=gc){const e=_i(pc(t),Gu),r=_i(fc({shared:e}),fke,nW);return e.ServiceRegistry.register(r),{shared:e,Pie:r}}mt(iW,"createPieServices");var Ake=class extends mc{static{mt(this,"ArchitectureTokenBuilder")}constructor(){super(["architecture"])}},_ke=class extends sx{static{mt(this,"ArchitectureValueConverter")}runCustomConverter(t,e,r){if(t.name==="ARCH_ICON")return e.replace(/[()]/g,"").trim();if(t.name==="ARCH_TEXT_ICON")return e.replace(/["()]/g,"");if(t.name==="ARCH_TITLE")return e.replace(/[[\]]/g,"").trim()}},aW={parser:{TokenBuilder:mt(()=>new Ake,"TokenBuilder"),ValueConverter:mt(()=>new _ke,"ValueConverter")}};function sW(t=gc){const e=_i(pc(t),Gu),r=_i(fc({shared:e}),pke,aW);return e.ServiceRegistry.register(r),{shared:e,Architecture:r}}mt(sW,"createArchitectureServices");var Lke=class extends mc{static{mt(this,"RadarTokenBuilder")}constructor(){super(["radar-beta"])}},oW={parser:{TokenBuilder:mt(()=>new Lke,"TokenBuilder"),ValueConverter:mt(()=>new ox,"ValueConverter")}};function lW(t=gc){const e=_i(pc(t),Gu),r=_i(fc({shared:e}),mke,oW);return e.ServiceRegistry.register(r),{shared:e,Radar:r}}mt(lW,"createRadarServices");var Rke=class extends mc{static{mt(this,"TreemapTokenBuilder")}constructor(){super(["treemap"])}},Nke=/classDef\s+([A-Z_a-z]\w+)(?:\s+([^\n\r;]*))?;?/,Dke=class extends sx{static{mt(this,"TreemapValueConverter")}runCustomConverter(t,e,r){if(t.name==="NUMBER2")return parseFloat(e.replace(/,/g,""));if(t.name==="SEPARATOR")return e.substring(1,e.length-1);if(t.name==="STRING2")return e.substring(1,e.length-1);if(t.name==="INDENTATION")return e.length;if(t.name==="ClassDef"){if(typeof e!="string")return e;const n=Nke.exec(e);if(n)return{$type:"ClassDefStatement",className:n[1],styleText:n[2]||void 0}}}};function cW(t){const e=t.validation.TreemapValidator,r=t.validation.ValidationRegistry;if(r){const n={Treemap:e.checkSingleRoot.bind(e)};r.register(n,e)}}mt(cW,"registerValidationChecks");var Mke=class{static{mt(this,"TreemapValidator")}checkSingleRoot(t,e){let r;for(const n of t.TreemapRows)n.item&&(r===void 0&&n.indent===void 0?r=0:n.indent===void 0?e("error","Multiple root nodes are not allowed in a treemap.",{node:n,property:"item"}):r!==void 0&&r>=parseInt(n.indent,10)&&e("error","Multiple root nodes are not allowed in a treemap.",{node:n,property:"item"}))}},uW={parser:{TokenBuilder:mt(()=>new Rke,"TokenBuilder"),ValueConverter:mt(()=>new Dke,"ValueConverter")},validation:{TreemapValidator:mt(()=>new Mke,"TreemapValidator")}};function hW(t=gc){const e=_i(pc(t),Gu),r=_i(fc({shared:e}),vke,uW);return e.ServiceRegistry.register(r),cW(r),{shared:e,Treemap:r}}mt(hW,"createTreemapServices");var ko={},Ike={info:mt(async()=>{const{createInfoServices:t}=await ir(async()=>{const{createInfoServices:r}=await Promise.resolve().then(()=>cNe);return{createInfoServices:r}},void 0,import.meta.url),e=t().Info.parser.LangiumParser;ko.info=e},"info"),packet:mt(async()=>{const{createPacketServices:t}=await ir(async()=>{const{createPacketServices:r}=await Promise.resolve().then(()=>uNe);return{createPacketServices:r}},void 0,import.meta.url),e=t().Packet.parser.LangiumParser;ko.packet=e},"packet"),pie:mt(async()=>{const{createPieServices:t}=await ir(async()=>{const{createPieServices:r}=await Promise.resolve().then(()=>hNe);return{createPieServices:r}},void 0,import.meta.url),e=t().Pie.parser.LangiumParser;ko.pie=e},"pie"),architecture:mt(async()=>{const{createArchitectureServices:t}=await ir(async()=>{const{createArchitectureServices:r}=await Promise.resolve().then(()=>dNe);return{createArchitectureServices:r}},void 0,import.meta.url),e=t().Architecture.parser.LangiumParser;ko.architecture=e},"architecture"),gitGraph:mt(async()=>{const{createGitGraphServices:t}=await ir(async()=>{const{createGitGraphServices:r}=await Promise.resolve().then(()=>fNe);return{createGitGraphServices:r}},void 0,import.meta.url),e=t().GitGraph.parser.LangiumParser;ko.gitGraph=e},"gitGraph"),radar:mt(async()=>{const{createRadarServices:t}=await ir(async()=>{const{createRadarServices:r}=await Promise.resolve().then(()=>pNe);return{createRadarServices:r}},void 0,import.meta.url),e=t().Radar.parser.LangiumParser;ko.radar=e},"radar"),treemap:mt(async()=>{const{createTreemapServices:t}=await ir(async()=>{const{createTreemapServices:r}=await Promise.resolve().then(()=>gNe);return{createTreemapServices:r}},void 0,import.meta.url),e=t().Treemap.parser.LangiumParser;ko.treemap=e},"treemap")};async function vc(t,e){const r=Ike[t];if(!r)throw new Error(`Unknown diagram type: ${t}`);ko[t]||await r();const i=ko[t].parse(e);if(i.lexerErrors.length>0||i.parserErrors.length>0)throw new Oke(i);return i.value}mt(vc,"parse");var Oke=class extends Error{constructor(t){const e=t.lexerErrors.map(n=>n.message).join(`
`),r=t.parserErrors.map(n=>n.message).join(`
`);super(`Parsing failed: ${e} ${r}`),this.result=t}static{mt(this,"MermaidParseError")}},Mr={NORMAL:0,REVERSE:1,HIGHLIGHT:2,MERGE:3,CHERRY_PICK:4},Pke=hr.gitGraph,Uu=x(()=>Hi({...Pke,...gr().gitGraph}),"getConfig"),yt=new pG(()=>{const t=Uu(),e=t.mainBranchName,r=t.mainBranchOrder;return{mainBranchName:e,commits:new Map,head:null,branchConfig:new Map([[e,{name:e,order:r}]]),branches:new Map([[e,null]]),currBranch:e,direction:"LR",seq:0,options:{}}});function lx(){return rO({length:7})}x(lx,"getID");function dW(t,e){const r=Object.create(null);return t.reduce((n,i)=>{const a=e(i);return r[a]||(r[a]=!0,n.push(i)),n},[])}x(dW,"uniqBy");var Bke=x(function(t){yt.records.direction=t},"setDirection"),Fke=x(function(t){ie.debug("options str",t),t=t?.trim(),t=t||"{}";try{yt.records.options=JSON.parse(t)}catch(e){ie.error("error while parsing gitGraph options",e.message)}},"setOptions"),$ke=x(function(){return yt.records.options},"getOptions"),zke=x(function(t){let e=t.msg,r=t.id;const n=t.type;let i=t.tags;ie.info("commit",e,r,n,i),ie.debug("Entering commit:",e,r,n,i);const a=Uu();r=at.sanitizeText(r,a),e=at.sanitizeText(e,a),i=i?.map(o=>at.sanitizeText(o,a));const s={id:r||yt.records.seq+"-"+lx(),message:e,seq:yt.records.seq++,type:n??Mr.NORMAL,tags:i??[],parents:yt.records.head==null?[]:[yt.records.head.id],branch:yt.records.currBranch};yt.records.head=s,ie.info("main branch",a.mainBranchName),yt.records.commits.has(s.id)&&ie.warn(`Commit ID ${s.id} already exists`),yt.records.commits.set(s.id,s),yt.records.branches.set(yt.records.currBranch,s.id),ie.debug("in pushCommit "+s.id)},"commit"),Vke=x(function(t){let e=t.name;const r=t.order;if(e=at.sanitizeText(e,Uu()),yt.records.branches.has(e))throw new Error(`Trying to create an existing branch. (Help: Either use a new name if you want create a new branch or try using "checkout ${e}")`);yt.records.branches.set(e,yt.records.head!=null?yt.records.head.id:null),yt.records.branchConfig.set(e,{name:e,order:r}),fW(e),ie.debug("in createBranch")},"branch"),Gke=x(t=>{let e=t.branch,r=t.id;const n=t.type,i=t.tags,a=Uu();e=at.sanitizeText(e,a),r&&(r=at.sanitizeText(r,a));const s=yt.records.branches.get(yt.records.currBranch),o=yt.records.branches.get(e),l=s?yt.records.commits.get(s):void 0,u=o?yt.records.commits.get(o):void 0;if(l&&u&&l.branch===e)throw new Error(`Cannot merge branch '${e}' into itself.`);if(yt.records.currBranch===e){const f=new Error('Incorrect usage of "merge". Cannot merge a branch to itself');throw f.hash={text:`merge ${e}`,token:`merge ${e}`,expected:["branch abc"]},f}if(l===void 0||!l){const f=new Error(`Incorrect usage of "merge". Current branch (${yt.records.currBranch})has no commits`);throw f.hash={text:`merge ${e}`,token:`merge ${e}`,expected:["commit"]},f}if(!yt.records.branches.has(e)){const f=new Error('Incorrect usage of "merge". Branch to be merged ('+e+") does not exist");throw f.hash={text:`merge ${e}`,token:`merge ${e}`,expected:[`branch ${e}`]},f}if(u===void 0||!u){const f=new Error('Incorrect usage of "merge". Branch to be merged ('+e+") has no commits");throw f.hash={text:`merge ${e}`,token:`merge ${e}`,expected:['"commit"']},f}if(l===u){const f=new Error('Incorrect usage of "merge". Both branches have same head');throw f.hash={text:`merge ${e}`,token:`merge ${e}`,expected:["branch abc"]},f}if(r&&yt.records.commits.has(r)){const f=new Error('Incorrect usage of "merge". Commit with id:'+r+" already exists, use different custom id");throw f.hash={text:`merge ${e} ${r} ${n} ${i?.join(" ")}`,token:`merge ${e} ${r} ${n} ${i?.join(" ")}`,expected:[`merge ${e} ${r}_UNIQUE ${n} ${i?.join(" ")}`]},f}const h=o||"",d={id:r||`${yt.records.seq}-${lx()}`,message:`merged branch ${e} into ${yt.records.currBranch}`,seq:yt.records.seq++,parents:yt.records.head==null?[]:[yt.records.head.id,h],branch:yt.records.currBranch,type:Mr.MERGE,customType:n,customId:!!r,tags:i??[]};yt.records.head=d,yt.records.commits.set(d.id,d),yt.records.branches.set(yt.records.currBranch,d.id),ie.debug(yt.records.branches),ie.debug("in mergeBranch")},"merge"),Uke=x(function(t){let e=t.id,r=t.targetId,n=t.tags,i=t.parent;ie.debug("Entering cherryPick:",e,r,n);const a=Uu();if(e=at.sanitizeText(e,a),r=at.sanitizeText(r,a),n=n?.map(l=>at.sanitizeText(l,a)),i=at.sanitizeText(i,a),!e||!yt.records.commits.has(e)){const l=new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');throw l.hash={text:`cherryPick ${e} ${r}`,token:`cherryPick ${e} ${r}`,expected:["cherry-pick abc"]},l}const s=yt.records.commits.get(e);if(s===void 0||!s)throw new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');if(i&&!(Array.isArray(s.parents)&&s.parents.includes(i)))throw new Error("Invalid operation: The specified parent commit is not an immediate parent of the cherry-picked commit.");const o=s.branch;if(s.type===Mr.MERGE&&!i)throw new Error("Incorrect usage of cherry-pick: If the source commit is a merge commit, an immediate parent commit must be specified.");if(!r||!yt.records.commits.has(r)){if(o===yt.records.currBranch){const d=new Error('Incorrect usage of "cherryPick". Source commit is already on current branch');throw d.hash={text:`cherryPick ${e} ${r}`,token:`cherryPick ${e} ${r}`,expected:["cherry-pick abc"]},d}const l=yt.records.branches.get(yt.records.currBranch);if(l===void 0||!l){const d=new Error(`Incorrect usage of "cherry-pick". Current branch (${yt.records.currBranch})has no commits`);throw d.hash={text:`cherryPick ${e} ${r}`,token:`cherryPick ${e} ${r}`,expected:["cherry-pick abc"]},d}const u=yt.records.commits.get(l);if(u===void 0||!u){const d=new Error(`Incorrect usage of "cherry-pick". Current branch (${yt.records.currBranch})has no commits`);throw d.hash={text:`cherryPick ${e} ${r}`,token:`cherryPick ${e} ${r}`,expected:["cherry-pick abc"]},d}const h={id:yt.records.seq+"-"+lx(),message:`cherry-picked ${s?.message} into ${yt.records.currBranch}`,seq:yt.records.seq++,parents:yt.records.head==null?[]:[yt.records.head.id,s.id],branch:yt.records.currBranch,type:Mr.CHERRY_PICK,tags:n?n.filter(Boolean):[`cherry-pick:${s.id}${s.type===Mr.MERGE?`|parent:${i}`:""}`]};yt.records.head=h,yt.records.commits.set(h.id,h),yt.records.branches.set(yt.records.currBranch,h.id),ie.debug(yt.records.branches),ie.debug("in cherryPick")}},"cherryPick"),fW=x(function(t){if(t=at.sanitizeText(t,Uu()),yt.records.branches.has(t)){yt.records.currBranch=t;const e=yt.records.branches.get(yt.records.currBranch);e===void 0||!e?yt.records.head=null:yt.records.head=yt.records.commits.get(e)??null}else{const e=new Error(`Trying to checkout branch which is not yet created. (Help try using "branch ${t}")`);throw e.hash={text:`checkout ${t}`,token:`checkout ${t}`,expected:[`branch ${t}`]},e}},"checkout");function fT(t,e,r){const n=t.indexOf(e);n===-1?t.push(r):t.splice(n,1,r)}x(fT,"upsert");function Uk(t){const e=t.reduce((i,a)=>i.seq>a.seq?i:a,t[0]);let r="";t.forEach(function(i){i===e?r+="	*":r+="	|"});const n=[r,e.id,e.seq];for(const i in yt.records.branches)yt.records.branches.get(i)===e.id&&n.push(i);if(ie.debug(n.join(" ")),e.parents&&e.parents.length==2&&e.parents[0]&&e.parents[1]){const i=yt.records.commits.get(e.parents[0]);fT(t,e,i),e.parents[1]&&t.push(yt.records.commits.get(e.parents[1]))}else{if(e.parents.length==0)return;if(e.parents[0]){const i=yt.records.commits.get(e.parents[0]);fT(t,e,i)}}t=dW(t,i=>i.id),Uk(t)}x(Uk,"prettyPrintCommitHistory");var Wke=x(function(){ie.debug(yt.records.commits);const t=pW()[0];Uk([t])},"prettyPrint"),Hke=x(function(){yt.reset(),An()},"clear"),qke=x(function(){return[...yt.records.branchConfig.values()].map((e,r)=>e.order!==null&&e.order!==void 0?e:{...e,order:parseFloat(`0.${r}`)}).sort((e,r)=>(e.order??0)-(r.order??0)).map(({name:e})=>({name:e}))},"getBranchesAsObjArray"),Yke=x(function(){return yt.records.branches},"getBranches"),Xke=x(function(){return yt.records.commits},"getCommits"),pW=x(function(){const t=[...yt.records.commits.values()];return t.forEach(function(e){ie.debug(e.id)}),t.sort((e,r)=>e.seq-r.seq),t},"getCommitsArray"),jke=x(function(){return yt.records.currBranch},"getCurrentBranch"),Kke=x(function(){return yt.records.direction},"getDirection"),Zke=x(function(){return yt.records.head},"getHead"),gW={commitType:Mr,getConfig:Uu,setDirection:Bke,setOptions:Fke,getOptions:$ke,commit:zke,branch:Vke,merge:Gke,cherryPick:Uke,checkout:fW,prettyPrint:Wke,clear:Hke,getBranchesAsObjArray:qke,getBranches:Yke,getCommits:Xke,getCommitsArray:pW,getCurrentBranch:jke,getDirection:Kke,getHead:Zke,setAccTitle:Sn,getAccTitle:zn,getAccDescription:Gn,setAccDescription:Vn,setDiagramTitle:Zn,getDiagramTitle:_n},Qke=x((t,e)=>{Fu(t,e),t.dir&&e.setDirection(t.dir);for(const r of t.statements)Jke(r,e)},"populate"),Jke=x((t,e)=>{const n={Commit:x(i=>e.commit(eSe(i)),"Commit"),Branch:x(i=>e.branch(tSe(i)),"Branch"),Merge:x(i=>e.merge(rSe(i)),"Merge"),Checkout:x(i=>e.checkout(nSe(i)),"Checkout"),CherryPicking:x(i=>e.cherryPick(iSe(i)),"CherryPicking")}[t.$type];n?n(t):ie.error(`Unknown statement type: ${t.$type}`)},"parseStatement"),eSe=x(t=>({id:t.id,msg:t.message??"",type:t.type!==void 0?Mr[t.type]:Mr.NORMAL,tags:t.tags??void 0}),"parseCommit"),tSe=x(t=>({name:t.name,order:t.order??0}),"parseBranch"),rSe=x(t=>({branch:t.branch,id:t.id??"",type:t.type!==void 0?Mr[t.type]:void 0,tags:t.tags??void 0}),"parseMerge"),nSe=x(t=>t.branch,"parseCheckout"),iSe=x(t=>({id:t.id,targetId:"",tags:t.tags?.length===0?void 0:t.tags,parent:t.parent}),"parseCherryPicking"),aSe={parse:x(async t=>{const e=await vc("gitGraph",t);ie.debug(e),Qke(e,gW)},"parse")},sSe=we(),Wa=sSe?.gitGraph,Sl=10,Cl=40,Ps=4,_o=2,Fc=8,oa=new Map,ua=new Map,by=30,d0=new Map,wy=[],vl=0,dr="LR",oSe=x(()=>{oa.clear(),ua.clear(),d0.clear(),vl=0,wy=[],dr="LR"},"clear"),mW=x(t=>{const e=document.createElementNS("http://www.w3.org/2000/svg","text");return(typeof t=="string"?t.split(/\\n|\n|<br\s*\/?>/gi):t).forEach(n=>{const i=document.createElementNS("http://www.w3.org/2000/svg","tspan");i.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),i.setAttribute("dy","1em"),i.setAttribute("x","0"),i.setAttribute("class","row"),i.textContent=n.trim(),e.appendChild(i)}),e},"drawText"),vW=x(t=>{let e,r,n;return dr==="BT"?(r=x((i,a)=>i<=a,"comparisonFunc"),n=1/0):(r=x((i,a)=>i>=a,"comparisonFunc"),n=0),t.forEach(i=>{const a=dr==="TB"||dr=="BT"?ua.get(i)?.y:ua.get(i)?.x;a!==void 0&&r(a,n)&&(e=i,n=a)}),e},"findClosestParent"),lSe=x(t=>{let e="",r=1/0;return t.forEach(n=>{const i=ua.get(n).y;i<=r&&(e=n,r=i)}),e||void 0},"findClosestParentBT"),cSe=x((t,e,r)=>{let n=r,i=r;const a=[];t.forEach(s=>{const o=e.get(s);if(!o)throw new Error(`Commit not found for key ${s}`);o.parents.length?(n=hSe(o),i=Math.max(n,i)):a.push(o),dSe(o,n)}),n=i,a.forEach(s=>{fSe(s,n,r)}),t.forEach(s=>{const o=e.get(s);if(o?.parents.length){const l=lSe(o.parents);n=ua.get(l).y-Cl,n<=i&&(i=n);const u=oa.get(o.branch).pos,h=n-Sl;ua.set(o.id,{x:u,y:h})}})},"setParallelBTPos"),uSe=x(t=>{const e=vW(t.parents.filter(n=>n!==null));if(!e)throw new Error(`Closest parent not found for commit ${t.id}`);const r=ua.get(e)?.y;if(r===void 0)throw new Error(`Closest parent position not found for commit ${t.id}`);return r},"findClosestParentPos"),hSe=x(t=>uSe(t)+Cl,"calculateCommitPosition"),dSe=x((t,e)=>{const r=oa.get(t.branch);if(!r)throw new Error(`Branch not found for commit ${t.id}`);const n=r.pos,i=e+Sl;return ua.set(t.id,{x:n,y:i}),{x:n,y:i}},"setCommitPosition"),fSe=x((t,e,r)=>{const n=oa.get(t.branch);if(!n)throw new Error(`Branch not found for commit ${t.id}`);const i=e+r,a=n.pos;ua.set(t.id,{x:a,y:i})},"setRootPosition"),pSe=x((t,e,r,n,i,a)=>{if(a===Mr.HIGHLIGHT)t.append("rect").attr("x",r.x-10).attr("y",r.y-10).attr("width",20).attr("height",20).attr("class",`commit ${e.id} commit-highlight${i%Fc} ${n}-outer`),t.append("rect").attr("x",r.x-6).attr("y",r.y-6).attr("width",12).attr("height",12).attr("class",`commit ${e.id} commit${i%Fc} ${n}-inner`);else if(a===Mr.CHERRY_PICK)t.append("circle").attr("cx",r.x).attr("cy",r.y).attr("r",10).attr("class",`commit ${e.id} ${n}`),t.append("circle").attr("cx",r.x-3).attr("cy",r.y+2).attr("r",2.75).attr("fill","#fff").attr("class",`commit ${e.id} ${n}`),t.append("circle").attr("cx",r.x+3).attr("cy",r.y+2).attr("r",2.75).attr("fill","#fff").attr("class",`commit ${e.id} ${n}`),t.append("line").attr("x1",r.x+3).attr("y1",r.y+1).attr("x2",r.x).attr("y2",r.y-5).attr("stroke","#fff").attr("class",`commit ${e.id} ${n}`),t.append("line").attr("x1",r.x-3).attr("y1",r.y+1).attr("x2",r.x).attr("y2",r.y-5).attr("stroke","#fff").attr("class",`commit ${e.id} ${n}`);else{const s=t.append("circle");if(s.attr("cx",r.x),s.attr("cy",r.y),s.attr("r",e.type===Mr.MERGE?9:10),s.attr("class",`commit ${e.id} commit${i%Fc}`),a===Mr.MERGE){const o=t.append("circle");o.attr("cx",r.x),o.attr("cy",r.y),o.attr("r",6),o.attr("class",`commit ${n} ${e.id} commit${i%Fc}`)}a===Mr.REVERSE&&t.append("path").attr("d",`M ${r.x-5},${r.y-5}L${r.x+5},${r.y+5}M${r.x-5},${r.y+5}L${r.x+5},${r.y-5}`).attr("class",`commit ${n} ${e.id} commit${i%Fc}`)}},"drawCommitBullet"),gSe=x((t,e,r,n)=>{if(e.type!==Mr.CHERRY_PICK&&(e.customId&&e.type===Mr.MERGE||e.type!==Mr.MERGE)&&Wa?.showCommitLabel){const i=t.append("g"),a=i.insert("rect").attr("class","commit-label-bkg"),s=i.append("text").attr("x",n).attr("y",r.y+25).attr("class","commit-label").text(e.id),o=s.node()?.getBBox();if(o&&(a.attr("x",r.posWithOffset-o.width/2-_o).attr("y",r.y+13.5).attr("width",o.width+2*_o).attr("height",o.height+2*_o),dr==="TB"||dr==="BT"?(a.attr("x",r.x-(o.width+4*Ps+5)).attr("y",r.y-12),s.attr("x",r.x-(o.width+4*Ps)).attr("y",r.y+o.height-12)):s.attr("x",r.posWithOffset-o.width/2),Wa.rotateCommitLabel))if(dr==="TB"||dr==="BT")s.attr("transform","rotate(-45, "+r.x+", "+r.y+")"),a.attr("transform","rotate(-45, "+r.x+", "+r.y+")");else{const l=-7.5-(o.width+10)/25*9.5,u=10+o.width/25*8.5;i.attr("transform","translate("+l+", "+u+") rotate(-45, "+n+", "+r.y+")")}}},"drawCommitLabel"),mSe=x((t,e,r,n)=>{if(e.tags.length>0){let i=0,a=0,s=0;const o=[];for(const l of e.tags.reverse()){const u=t.insert("polygon"),h=t.append("circle"),d=t.append("text").attr("y",r.y-16-i).attr("class","tag-label").text(l),f=d.node()?.getBBox();if(!f)throw new Error("Tag bbox not found");a=Math.max(a,f.width),s=Math.max(s,f.height),d.attr("x",r.posWithOffset-f.width/2),o.push({tag:d,hole:h,rect:u,yOffset:i}),i+=20}for(const{tag:l,hole:u,rect:h,yOffset:d}of o){const f=s/2,p=r.y-19.2-d;if(h.attr("class","tag-label-bkg").attr("points",`
      ${n-a/2-Ps/2},${p+_o}  
      ${n-a/2-Ps/2},${p-_o}
      ${r.posWithOffset-a/2-Ps},${p-f-_o}
      ${r.posWithOffset+a/2+Ps},${p-f-_o}
      ${r.posWithOffset+a/2+Ps},${p+f+_o}
      ${r.posWithOffset-a/2-Ps},${p+f+_o}`),u.attr("cy",p).attr("cx",n-a/2+Ps/2).attr("r",1.5).attr("class","tag-hole"),dr==="TB"||dr==="BT"){const g=n+d;h.attr("class","tag-label-bkg").attr("points",`
        ${r.x},${g+2}
        ${r.x},${g-2}
        ${r.x+Sl},${g-f-2}
        ${r.x+Sl+a+4},${g-f-2}
        ${r.x+Sl+a+4},${g+f+2}
        ${r.x+Sl},${g+f+2}`).attr("transform","translate(12,12) rotate(45, "+r.x+","+n+")"),u.attr("cx",r.x+Ps/2).attr("cy",g).attr("transform","translate(12,12) rotate(45, "+r.x+","+n+")"),l.attr("x",r.x+5).attr("y",g+3).attr("transform","translate(14,14) rotate(45, "+r.x+","+n+")")}}}},"drawCommitTags"),vSe=x(t=>{switch(t.customType??t.type){case Mr.NORMAL:return"commit-normal";case Mr.REVERSE:return"commit-reverse";case Mr.HIGHLIGHT:return"commit-highlight";case Mr.MERGE:return"commit-merge";case Mr.CHERRY_PICK:return"commit-cherry-pick";default:return"commit-normal"}},"getCommitClassType"),ySe=x((t,e,r,n)=>{const i={x:0,y:0};if(t.parents.length>0){const a=vW(t.parents);if(a){const s=n.get(a)??i;return e==="TB"?s.y+Cl:e==="BT"?(n.get(t.id)??i).y-Cl:s.x+Cl}}else return e==="TB"?by:e==="BT"?(n.get(t.id)??i).y-Cl:0;return 0},"calculatePosition"),xSe=x((t,e,r)=>{const n=dr==="BT"&&r?e:e+Sl,i=dr==="TB"||dr==="BT"?n:oa.get(t.branch)?.pos,a=dr==="TB"||dr==="BT"?oa.get(t.branch)?.pos:n;if(a===void 0||i===void 0)throw new Error(`Position were undefined for commit ${t.id}`);return{x:a,y:i,posWithOffset:n}},"getCommitPosition"),fR=x((t,e,r)=>{if(!Wa)throw new Error("GitGraph config not found");const n=t.append("g").attr("class","commit-bullets"),i=t.append("g").attr("class","commit-labels");let a=dr==="TB"||dr==="BT"?by:0;const s=[...e.keys()],o=Wa?.parallelCommits??!1,l=x((h,d)=>{const f=e.get(h)?.seq,p=e.get(d)?.seq;return f!==void 0&&p!==void 0?f-p:0},"sortKeys");let u=s.sort(l);dr==="BT"&&(o&&cSe(u,e,a),u=u.reverse()),u.forEach(h=>{const d=e.get(h);if(!d)throw new Error(`Commit not found for key ${h}`);o&&(a=ySe(d,dr,a,ua));const f=xSe(d,a,o);if(r){const p=vSe(d),g=d.customType??d.type,m=oa.get(d.branch)?.index??0;pSe(n,d,f,p,m,g),gSe(i,d,f,a),mSe(i,d,f,a)}dr==="TB"||dr==="BT"?ua.set(d.id,{x:f.x,y:f.posWithOffset}):ua.set(d.id,{x:f.posWithOffset,y:f.y}),a=dr==="BT"&&o?a+Cl:a+Cl+Sl,a>vl&&(vl=a)})},"drawCommits"),bSe=x((t,e,r,n,i)=>{const s=(dr==="TB"||dr==="BT"?r.x<n.x:r.y<n.y)?e.branch:t.branch,o=x(u=>u.branch===s,"isOnBranchToGetCurve"),l=x(u=>u.seq>t.seq&&u.seq<e.seq,"isBetweenCommits");return[...i.values()].some(u=>l(u)&&o(u))},"shouldRerouteArrow"),f0=x((t,e,r=0)=>{const n=t+Math.abs(t-e)/2;if(r>5)return n;if(wy.every(s=>Math.abs(s-n)>=10))return wy.push(n),n;const a=Math.abs(t-e);return f0(t,e-a/5,r+1)},"findLane"),wSe=x((t,e,r,n)=>{const i=ua.get(e.id),a=ua.get(r.id);if(i===void 0||a===void 0)throw new Error(`Commit positions not found for commits ${e.id} and ${r.id}`);const s=bSe(e,r,i,a,n);let o="",l="",u=0,h=0,d=oa.get(r.branch)?.index;r.type===Mr.MERGE&&e.id!==r.parents[0]&&(d=oa.get(e.branch)?.index);let f;if(s){o="A 10 10, 0, 0, 0,",l="A 10 10, 0, 0, 1,",u=10,h=10;const p=i.y<a.y?f0(i.y,a.y):f0(a.y,i.y),g=i.x<a.x?f0(i.x,a.x):f0(a.x,i.x);dr==="TB"?i.x<a.x?f=`M ${i.x} ${i.y} L ${g-u} ${i.y} ${l} ${g} ${i.y+h} L ${g} ${a.y-u} ${o} ${g+h} ${a.y} L ${a.x} ${a.y}`:(d=oa.get(e.branch)?.index,f=`M ${i.x} ${i.y} L ${g+u} ${i.y} ${o} ${g} ${i.y+h} L ${g} ${a.y-u} ${l} ${g-h} ${a.y} L ${a.x} ${a.y}`):dr==="BT"?i.x<a.x?f=`M ${i.x} ${i.y} L ${g-u} ${i.y} ${o} ${g} ${i.y-h} L ${g} ${a.y+u} ${l} ${g+h} ${a.y} L ${a.x} ${a.y}`:(d=oa.get(e.branch)?.index,f=`M ${i.x} ${i.y} L ${g+u} ${i.y} ${l} ${g} ${i.y-h} L ${g} ${a.y+u} ${o} ${g-h} ${a.y} L ${a.x} ${a.y}`):i.y<a.y?f=`M ${i.x} ${i.y} L ${i.x} ${p-u} ${o} ${i.x+h} ${p} L ${a.x-u} ${p} ${l} ${a.x} ${p+h} L ${a.x} ${a.y}`:(d=oa.get(e.branch)?.index,f=`M ${i.x} ${i.y} L ${i.x} ${p+u} ${l} ${i.x+h} ${p} L ${a.x-u} ${p} ${o} ${a.x} ${p-h} L ${a.x} ${a.y}`)}else o="A 20 20, 0, 0, 0,",l="A 20 20, 0, 0, 1,",u=20,h=20,dr==="TB"?(i.x<a.x&&(r.type===Mr.MERGE&&e.id!==r.parents[0]?f=`M ${i.x} ${i.y} L ${i.x} ${a.y-u} ${o} ${i.x+h} ${a.y} L ${a.x} ${a.y}`:f=`M ${i.x} ${i.y} L ${a.x-u} ${i.y} ${l} ${a.x} ${i.y+h} L ${a.x} ${a.y}`),i.x>a.x&&(o="A 20 20, 0, 0, 0,",l="A 20 20, 0, 0, 1,",u=20,h=20,r.type===Mr.MERGE&&e.id!==r.parents[0]?f=`M ${i.x} ${i.y} L ${i.x} ${a.y-u} ${l} ${i.x-h} ${a.y} L ${a.x} ${a.y}`:f=`M ${i.x} ${i.y} L ${a.x+u} ${i.y} ${o} ${a.x} ${i.y+h} L ${a.x} ${a.y}`),i.x===a.x&&(f=`M ${i.x} ${i.y} L ${a.x} ${a.y}`)):dr==="BT"?(i.x<a.x&&(r.type===Mr.MERGE&&e.id!==r.parents[0]?f=`M ${i.x} ${i.y} L ${i.x} ${a.y+u} ${l} ${i.x+h} ${a.y} L ${a.x} ${a.y}`:f=`M ${i.x} ${i.y} L ${a.x-u} ${i.y} ${o} ${a.x} ${i.y-h} L ${a.x} ${a.y}`),i.x>a.x&&(o="A 20 20, 0, 0, 0,",l="A 20 20, 0, 0, 1,",u=20,h=20,r.type===Mr.MERGE&&e.id!==r.parents[0]?f=`M ${i.x} ${i.y} L ${i.x} ${a.y+u} ${o} ${i.x-h} ${a.y} L ${a.x} ${a.y}`:f=`M ${i.x} ${i.y} L ${a.x-u} ${i.y} ${o} ${a.x} ${i.y-h} L ${a.x} ${a.y}`),i.x===a.x&&(f=`M ${i.x} ${i.y} L ${a.x} ${a.y}`)):(i.y<a.y&&(r.type===Mr.MERGE&&e.id!==r.parents[0]?f=`M ${i.x} ${i.y} L ${a.x-u} ${i.y} ${l} ${a.x} ${i.y+h} L ${a.x} ${a.y}`:f=`M ${i.x} ${i.y} L ${i.x} ${a.y-u} ${o} ${i.x+h} ${a.y} L ${a.x} ${a.y}`),i.y>a.y&&(r.type===Mr.MERGE&&e.id!==r.parents[0]?f=`M ${i.x} ${i.y} L ${a.x-u} ${i.y} ${o} ${a.x} ${i.y-h} L ${a.x} ${a.y}`:f=`M ${i.x} ${i.y} L ${i.x} ${a.y+u} ${l} ${i.x+h} ${a.y} L ${a.x} ${a.y}`),i.y===a.y&&(f=`M ${i.x} ${i.y} L ${a.x} ${a.y}`));if(f===void 0)throw new Error("Line definition not found");t.append("path").attr("d",f).attr("class","arrow arrow"+d%Fc)},"drawArrow"),TSe=x((t,e)=>{const r=t.append("g").attr("class","commit-arrows");[...e.keys()].forEach(n=>{const i=e.get(n);i.parents&&i.parents.length>0&&i.parents.forEach(a=>{wSe(r,e.get(a),i,e)})})},"drawArrows"),ESe=x((t,e)=>{const r=t.append("g");e.forEach((n,i)=>{const a=i%Fc,s=oa.get(n.name)?.pos;if(s===void 0)throw new Error(`Position not found for branch ${n.name}`);const o=r.append("line");o.attr("x1",0),o.attr("y1",s),o.attr("x2",vl),o.attr("y2",s),o.attr("class","branch branch"+a),dr==="TB"?(o.attr("y1",by),o.attr("x1",s),o.attr("y2",vl),o.attr("x2",s)):dr==="BT"&&(o.attr("y1",vl),o.attr("x1",s),o.attr("y2",by),o.attr("x2",s)),wy.push(s);const l=n.name,u=mW(l),h=r.insert("rect"),f=r.insert("g").attr("class","branchLabel").insert("g").attr("class","label branch-label"+a);f.node().appendChild(u);const p=u.getBBox();h.attr("class","branchLabelBkg label"+a).attr("rx",4).attr("ry",4).attr("x",-p.width-4-(Wa?.rotateCommitLabel===!0?30:0)).attr("y",-p.height/2+8).attr("width",p.width+18).attr("height",p.height+4),f.attr("transform","translate("+(-p.width-14-(Wa?.rotateCommitLabel===!0?30:0))+", "+(s-p.height/2-1)+")"),dr==="TB"?(h.attr("x",s-p.width/2-10).attr("y",0),f.attr("transform","translate("+(s-p.width/2-5)+", 0)")):dr==="BT"?(h.attr("x",s-p.width/2-10).attr("y",vl),f.attr("transform","translate("+(s-p.width/2-5)+", "+vl+")")):h.attr("transform","translate(-19, "+(s-p.height/2)+")")})},"drawBranches"),kSe=x(function(t,e,r,n,i){return oa.set(t,{pos:e,index:r}),e+=50+(i?40:0)+(dr==="TB"||dr==="BT"?n.width/2:0),e},"setBranchPosition"),SSe=x(function(t,e,r,n){if(oSe(),ie.debug("in gitgraph renderer",t+`
`,"id:",e,r),!Wa)throw new Error("GitGraph config not found");const i=Wa.rotateCommitLabel??!1,a=n.db;d0=a.getCommits();const s=a.getBranchesAsObjArray();dr=a.getDirection();const o=Qe(`[id="${e}"]`);let l=0;s.forEach((u,h)=>{const d=mW(u.name),f=o.append("g"),p=f.insert("g").attr("class","branchLabel"),g=p.insert("g").attr("class","label branch-label");g.node()?.appendChild(d);const m=d.getBBox();l=kSe(u.name,l,h,m,i),g.remove(),p.remove(),f.remove()}),fR(o,d0,!1),Wa.showBranches&&ESe(o,s),TSe(o,d0),fR(o,d0,!0),Kt.insertTitle(o,"gitTitleText",Wa.titleTopMargin??0,a.getDiagramTitle()),LN(void 0,o,Wa.diagramPadding,Wa.useMaxWidth)},"draw"),CSe={draw:SSe},ASe=x(t=>`
  .commit-id,
  .commit-msg,
  .branch-label {
    fill: lightgrey;
    color: lightgrey;
    font-family: 'trebuchet ms', verdana, arial, sans-serif;
    font-family: var(--mermaid-font-family);
  }
  ${[0,1,2,3,4,5,6,7].map(e=>`
        .branch-label${e} { fill: ${t["gitBranchLabel"+e]}; }
        .commit${e} { stroke: ${t["git"+e]}; fill: ${t["git"+e]}; }
        .commit-highlight${e} { stroke: ${t["gitInv"+e]}; fill: ${t["gitInv"+e]}; }
        .label${e}  { fill: ${t["git"+e]}; }
        .arrow${e} { stroke: ${t["git"+e]}; }
        `).join(`
`)}

  .branch {
    stroke-width: 1;
    stroke: ${t.lineColor};
    stroke-dasharray: 2;
  }
  .commit-label { font-size: ${t.commitLabelFontSize}; fill: ${t.commitLabelColor};}
  .commit-label-bkg { font-size: ${t.commitLabelFontSize}; fill: ${t.commitLabelBackground}; opacity: 0.5; }
  .tag-label { font-size: ${t.tagLabelFontSize}; fill: ${t.tagLabelColor};}
  .tag-label-bkg { fill: ${t.tagLabelBackground}; stroke: ${t.tagLabelBorder}; }
  .tag-hole { fill: ${t.textColor}; }

  .commit-merge {
    stroke: ${t.primaryColor};
    fill: ${t.primaryColor};
  }
  .commit-reverse {
    stroke: ${t.primaryColor};
    fill: ${t.primaryColor};
    stroke-width: 3;
  }
  .commit-highlight-outer {
  }
  .commit-highlight-inner {
    stroke: ${t.primaryColor};
    fill: ${t.primaryColor};
  }

  .arrow { stroke-width: 8; stroke-linecap: round; fill: none}
  .gitTitleText {
    text-anchor: middle;
    font-size: 18px;
    fill: ${t.textColor};
  }
`,"getStyles"),_Se=ASe,LSe={parser:aSe,db:gW,renderer:CSe,styles:_Se};const RSe=Object.freeze(Object.defineProperty({__proto__:null,diagram:LSe},Symbol.toStringTag,{value:"Module"}));var yW={exports:{}};(function(t,e){(function(r,n){t.exports=n()})(to,function(){var r="day";return function(n,i,a){var s=function(u){return u.add(4-u.isoWeekday(),r)},o=i.prototype;o.isoWeekYear=function(){return s(this).year()},o.isoWeek=function(u){if(!this.$utils().u(u))return this.add(7*(u-this.isoWeek()),r);var h,d,f,p,g=s(this),m=(h=this.isoWeekYear(),d=this.$u,f=(d?a.utc:a)().year(h).startOf("year"),p=4-f.isoWeekday(),f.isoWeekday()>4&&(p+=7),f.add(p,r));return g.diff(m,"week")+1},o.isoWeekday=function(u){return this.$utils().u(u)?this.day()||7:this.day(this.day()%7?u:u-7)};var l=o.startOf;o.startOf=function(u,h){var d=this.$utils(),f=!!d.u(h)||h;return d.p(u)==="isoweek"?f?this.date(this.date()-(this.isoWeekday()-1)).startOf("day"):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf("day"):l.bind(this)(u,h)}}})})(yW);var NSe=yW.exports;const DSe=yd(NSe);var xW={exports:{}};(function(t,e){(function(r,n){t.exports=n()})(to,function(){var r={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},n=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,i=/\d/,a=/\d\d/,s=/\d\d?/,o=/\d*[^-_:/,()\s\d]+/,l={},u=function(v){return(v=+v)+(v>68?1900:2e3)},h=function(v){return function(y){this[v]=+y}},d=[/[+-]\d\d:?(\d\d)?|Z/,function(v){(this.zone||(this.zone={})).offset=function(y){if(!y||y==="Z")return 0;var b=y.match(/([+-]|\d\d)/g),w=60*b[1]+(+b[2]||0);return w===0?0:b[0]==="+"?-w:w}(v)}],f=function(v){var y=l[v];return y&&(y.indexOf?y:y.s.concat(y.f))},p=function(v,y){var b,w=l.meridiem;if(w){for(var T=1;T<=24;T+=1)if(v.indexOf(w(T,0,y))>-1){b=T>12;break}}else b=v===(y?"pm":"PM");return b},g={A:[o,function(v){this.afternoon=p(v,!1)}],a:[o,function(v){this.afternoon=p(v,!0)}],Q:[i,function(v){this.month=3*(v-1)+1}],S:[i,function(v){this.milliseconds=100*+v}],SS:[a,function(v){this.milliseconds=10*+v}],SSS:[/\d{3}/,function(v){this.milliseconds=+v}],s:[s,h("seconds")],ss:[s,h("seconds")],m:[s,h("minutes")],mm:[s,h("minutes")],H:[s,h("hours")],h:[s,h("hours")],HH:[s,h("hours")],hh:[s,h("hours")],D:[s,h("day")],DD:[a,h("day")],Do:[o,function(v){var y=l.ordinal,b=v.match(/\d+/);if(this.day=b[0],y)for(var w=1;w<=31;w+=1)y(w).replace(/\[|\]/g,"")===v&&(this.day=w)}],w:[s,h("week")],ww:[a,h("week")],M:[s,h("month")],MM:[a,h("month")],MMM:[o,function(v){var y=f("months"),b=(f("monthsShort")||y.map(function(w){return w.slice(0,3)})).indexOf(v)+1;if(b<1)throw new Error;this.month=b%12||b}],MMMM:[o,function(v){var y=f("months").indexOf(v)+1;if(y<1)throw new Error;this.month=y%12||y}],Y:[/[+-]?\d+/,h("year")],YY:[a,function(v){this.year=u(v)}],YYYY:[/\d{4}/,h("year")],Z:d,ZZ:d};function m(v){var y,b;y=v,b=l&&l.formats;for(var w=(v=y.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(N,_,O){var P=O&&O.toUpperCase();return _||b[O]||r[O]||b[P].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(k,R,I){return R||I.slice(1)})})).match(n),T=w.length,E=0;E<T;E+=1){var L=w[E],S=g[L],C=S&&S[0],A=S&&S[1];w[E]=A?{regex:C,parser:A}:L.replace(/^\[|\]$/g,"")}return function(N){for(var _={},O=0,P=0;O<T;O+=1){var k=w[O];if(typeof k=="string")P+=k.length;else{var R=k.regex,I=k.parser,M=N.slice(P),D=R.exec(M)[0];I.call(_,D),N=N.replace(D,"")}}return function(B){var $=B.afternoon;if($!==void 0){var F=B.hours;$?F<12&&(B.hours+=12):F===12&&(B.hours=0),delete B.afternoon}}(_),_}}return function(v,y,b){b.p.customParseFormat=!0,v&&v.parseTwoDigitYear&&(u=v.parseTwoDigitYear);var w=y.prototype,T=w.parse;w.parse=function(E){var L=E.date,S=E.utc,C=E.args;this.$u=S;var A=C[1];if(typeof A=="string"){var N=C[2]===!0,_=C[3]===!0,O=N||_,P=C[2];_&&(P=C[2]),l=this.$locale(),!N&&P&&(l=b.Ls[P]),this.$d=function(M,D,B,$){try{if(["x","X"].indexOf(D)>-1)return new Date((D==="X"?1e3:1)*M);var F=m(D)(M),G=F.year,W=F.month,J=F.day,q=F.hours,ne=F.minutes,ae=F.seconds,pe=F.milliseconds,K=F.zone,Z=F.week,X=new Date,Y=J||(G||W?1:X.getDate()),ee=G||X.getFullYear(),j=0;G&&!W||(j=W>0?W-1:X.getMonth());var fe,te=q||0,Ae=ne||0,H=ae||0,Oe=pe||0;return K?new Date(Date.UTC(ee,j,Y,te,Ae,H,Oe+60*K.offset*1e3)):B?new Date(Date.UTC(ee,j,Y,te,Ae,H,Oe)):(fe=new Date(ee,j,Y,te,Ae,H,Oe),Z&&(fe=$(fe).week(Z).toDate()),fe)}catch{return new Date("")}}(L,A,S,b),this.init(),P&&P!==!0&&(this.$L=this.locale(P).$L),O&&L!=this.format(A)&&(this.$d=new Date("")),l={}}else if(A instanceof Array)for(var k=A.length,R=1;R<=k;R+=1){C[1]=A[R-1];var I=b.apply(this,C);if(I.isValid()){this.$d=I.$d,this.$L=I.$L,this.init();break}R===k&&(this.$d=new Date(""))}else T.call(this,E)}}})})(xW);var MSe=xW.exports;const ISe=yd(MSe);var bW={exports:{}};(function(t,e){(function(r,n){t.exports=n()})(to,function(){return function(r,n){var i=n.prototype,a=i.format;i.format=function(s){var o=this,l=this.$locale();if(!this.isValid())return a.bind(this)(s);var u=this.$utils(),h=(s||"YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g,function(d){switch(d){case"Q":return Math.ceil((o.$M+1)/3);case"Do":return l.ordinal(o.$D);case"gggg":return o.weekYear();case"GGGG":return o.isoWeekYear();case"wo":return l.ordinal(o.week(),"W");case"w":case"ww":return u.s(o.week(),d==="w"?1:2,"0");case"W":case"WW":return u.s(o.isoWeek(),d==="W"?1:2,"0");case"k":case"kk":return u.s(String(o.$H===0?24:o.$H),d==="k"?1:2,"0");case"X":return Math.floor(o.$d.getTime()/1e3);case"x":return o.$d.getTime();case"z":return"["+o.offsetName()+"]";case"zzz":return"["+o.offsetName("long")+"]";default:return d}});return a.bind(this)(h)}}})})(bW);var OSe=bW.exports;const PSe=yd(OSe);var pT=function(){var t=x(function(P,k,R,I){for(R=R||{},I=P.length;I--;R[P[I]]=k);return R},"o"),e=[6,8,10,12,13,14,15,16,17,18,20,21,22,23,24,25,26,27,28,29,30,31,33,35,36,38,40],r=[1,26],n=[1,27],i=[1,28],a=[1,29],s=[1,30],o=[1,31],l=[1,32],u=[1,33],h=[1,34],d=[1,9],f=[1,10],p=[1,11],g=[1,12],m=[1,13],v=[1,14],y=[1,15],b=[1,16],w=[1,19],T=[1,20],E=[1,21],L=[1,22],S=[1,23],C=[1,25],A=[1,35],N={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,start:3,gantt:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NL:10,weekday:11,weekday_monday:12,weekday_tuesday:13,weekday_wednesday:14,weekday_thursday:15,weekday_friday:16,weekday_saturday:17,weekday_sunday:18,weekend:19,weekend_friday:20,weekend_saturday:21,dateFormat:22,inclusiveEndDates:23,topAxis:24,axisFormat:25,tickInterval:26,excludes:27,includes:28,todayMarker:29,title:30,acc_title:31,acc_title_value:32,acc_descr:33,acc_descr_value:34,acc_descr_multiline_value:35,section:36,clickStatement:37,taskTxt:38,taskData:39,click:40,callbackname:41,callbackargs:42,href:43,clickStatementDebug:44,$accept:0,$end:1},terminals_:{2:"error",4:"gantt",6:"EOF",8:"SPACE",10:"NL",12:"weekday_monday",13:"weekday_tuesday",14:"weekday_wednesday",15:"weekday_thursday",16:"weekday_friday",17:"weekday_saturday",18:"weekday_sunday",20:"weekend_friday",21:"weekend_saturday",22:"dateFormat",23:"inclusiveEndDates",24:"topAxis",25:"axisFormat",26:"tickInterval",27:"excludes",28:"includes",29:"todayMarker",30:"title",31:"acc_title",32:"acc_title_value",33:"acc_descr",34:"acc_descr_value",35:"acc_descr_multiline_value",36:"section",38:"taskTxt",39:"taskData",40:"click",41:"callbackname",42:"callbackargs",43:"href"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[11,1],[11,1],[11,1],[11,1],[11,1],[11,1],[11,1],[19,1],[19,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,1],[9,2],[37,2],[37,3],[37,3],[37,4],[37,3],[37,4],[37,2],[44,2],[44,3],[44,3],[44,4],[44,3],[44,4],[44,2]],performAction:x(function(k,R,I,M,D,B,$){var F=B.length-1;switch(D){case 1:return B[F-1];case 2:this.$=[];break;case 3:B[F-1].push(B[F]),this.$=B[F-1];break;case 4:case 5:this.$=B[F];break;case 6:case 7:this.$=[];break;case 8:M.setWeekday("monday");break;case 9:M.setWeekday("tuesday");break;case 10:M.setWeekday("wednesday");break;case 11:M.setWeekday("thursday");break;case 12:M.setWeekday("friday");break;case 13:M.setWeekday("saturday");break;case 14:M.setWeekday("sunday");break;case 15:M.setWeekend("friday");break;case 16:M.setWeekend("saturday");break;case 17:M.setDateFormat(B[F].substr(11)),this.$=B[F].substr(11);break;case 18:M.enableInclusiveEndDates(),this.$=B[F].substr(18);break;case 19:M.TopAxis(),this.$=B[F].substr(8);break;case 20:M.setAxisFormat(B[F].substr(11)),this.$=B[F].substr(11);break;case 21:M.setTickInterval(B[F].substr(13)),this.$=B[F].substr(13);break;case 22:M.setExcludes(B[F].substr(9)),this.$=B[F].substr(9);break;case 23:M.setIncludes(B[F].substr(9)),this.$=B[F].substr(9);break;case 24:M.setTodayMarker(B[F].substr(12)),this.$=B[F].substr(12);break;case 27:M.setDiagramTitle(B[F].substr(6)),this.$=B[F].substr(6);break;case 28:this.$=B[F].trim(),M.setAccTitle(this.$);break;case 29:case 30:this.$=B[F].trim(),M.setAccDescription(this.$);break;case 31:M.addSection(B[F].substr(8)),this.$=B[F].substr(8);break;case 33:M.addTask(B[F-1],B[F]),this.$="task";break;case 34:this.$=B[F-1],M.setClickEvent(B[F-1],B[F],null);break;case 35:this.$=B[F-2],M.setClickEvent(B[F-2],B[F-1],B[F]);break;case 36:this.$=B[F-2],M.setClickEvent(B[F-2],B[F-1],null),M.setLink(B[F-2],B[F]);break;case 37:this.$=B[F-3],M.setClickEvent(B[F-3],B[F-2],B[F-1]),M.setLink(B[F-3],B[F]);break;case 38:this.$=B[F-2],M.setClickEvent(B[F-2],B[F],null),M.setLink(B[F-2],B[F-1]);break;case 39:this.$=B[F-3],M.setClickEvent(B[F-3],B[F-1],B[F]),M.setLink(B[F-3],B[F-2]);break;case 40:this.$=B[F-1],M.setLink(B[F-1],B[F]);break;case 41:case 47:this.$=B[F-1]+" "+B[F];break;case 42:case 43:case 45:this.$=B[F-2]+" "+B[F-1]+" "+B[F];break;case 44:case 46:this.$=B[F-3]+" "+B[F-2]+" "+B[F-1]+" "+B[F];break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:17,12:r,13:n,14:i,15:a,16:s,17:o,18:l,19:18,20:u,21:h,22:d,23:f,24:p,25:g,26:m,27:v,28:y,29:b,30:w,31:T,33:E,35:L,36:S,37:24,38:C,40:A},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:36,11:17,12:r,13:n,14:i,15:a,16:s,17:o,18:l,19:18,20:u,21:h,22:d,23:f,24:p,25:g,26:m,27:v,28:y,29:b,30:w,31:T,33:E,35:L,36:S,37:24,38:C,40:A},t(e,[2,5]),t(e,[2,6]),t(e,[2,17]),t(e,[2,18]),t(e,[2,19]),t(e,[2,20]),t(e,[2,21]),t(e,[2,22]),t(e,[2,23]),t(e,[2,24]),t(e,[2,25]),t(e,[2,26]),t(e,[2,27]),{32:[1,37]},{34:[1,38]},t(e,[2,30]),t(e,[2,31]),t(e,[2,32]),{39:[1,39]},t(e,[2,8]),t(e,[2,9]),t(e,[2,10]),t(e,[2,11]),t(e,[2,12]),t(e,[2,13]),t(e,[2,14]),t(e,[2,15]),t(e,[2,16]),{41:[1,40],43:[1,41]},t(e,[2,4]),t(e,[2,28]),t(e,[2,29]),t(e,[2,33]),t(e,[2,34],{42:[1,42],43:[1,43]}),t(e,[2,40],{41:[1,44]}),t(e,[2,35],{43:[1,45]}),t(e,[2,36]),t(e,[2,38],{42:[1,46]}),t(e,[2,37]),t(e,[2,39])],defaultActions:{},parseError:x(function(k,R){if(R.recoverable)this.trace(k);else{var I=new Error(k);throw I.hash=R,I}},"parseError"),parse:x(function(k){var R=this,I=[0],M=[],D=[null],B=[],$=this.table,F="",G=0,W=0,J=2,q=1,ne=B.slice.call(arguments,1),ae=Object.create(this.lexer),pe={yy:{}};for(var K in this.yy)Object.prototype.hasOwnProperty.call(this.yy,K)&&(pe.yy[K]=this.yy[K]);ae.setInput(k,pe.yy),pe.yy.lexer=ae,pe.yy.parser=this,typeof ae.yylloc>"u"&&(ae.yylloc={});var Z=ae.yylloc;B.push(Z);var X=ae.options&&ae.options.ranges;typeof pe.yy.parseError=="function"?this.parseError=pe.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Y(ke){I.length=I.length-2*ke,D.length=D.length-ke,B.length=B.length-ke}x(Y,"popStack");function ee(){var ke;return ke=M.pop()||ae.lex()||q,typeof ke!="number"&&(ke instanceof Array&&(M=ke,ke=M.pop()),ke=R.symbols_[ke]||ke),ke}x(ee,"lex");for(var j,fe,te,Ae,H={},Oe,ue,Ve,Ge;;){if(fe=I[I.length-1],this.defaultActions[fe]?te=this.defaultActions[fe]:((j===null||typeof j>"u")&&(j=ee()),te=$[fe]&&$[fe][j]),typeof te>"u"||!te.length||!te[0]){var Ue="";Ge=[];for(Oe in $[fe])this.terminals_[Oe]&&Oe>J&&Ge.push("'"+this.terminals_[Oe]+"'");ae.showPosition?Ue="Parse error on line "+(G+1)+`:
`+ae.showPosition()+`
Expecting `+Ge.join(", ")+", got '"+(this.terminals_[j]||j)+"'":Ue="Parse error on line "+(G+1)+": Unexpected "+(j==q?"end of input":"'"+(this.terminals_[j]||j)+"'"),this.parseError(Ue,{text:ae.match,token:this.terminals_[j]||j,line:ae.yylineno,loc:Z,expected:Ge})}if(te[0]instanceof Array&&te.length>1)throw new Error("Parse Error: multiple actions possible at state: "+fe+", token: "+j);switch(te[0]){case 1:I.push(j),D.push(ae.yytext),B.push(ae.yylloc),I.push(te[1]),j=null,W=ae.yyleng,F=ae.yytext,G=ae.yylineno,Z=ae.yylloc;break;case 2:if(ue=this.productions_[te[1]][1],H.$=D[D.length-ue],H._$={first_line:B[B.length-(ue||1)].first_line,last_line:B[B.length-1].last_line,first_column:B[B.length-(ue||1)].first_column,last_column:B[B.length-1].last_column},X&&(H._$.range=[B[B.length-(ue||1)].range[0],B[B.length-1].range[1]]),Ae=this.performAction.apply(H,[F,W,G,pe.yy,te[1],D,B].concat(ne)),typeof Ae<"u")return Ae;ue&&(I=I.slice(0,-1*ue*2),D=D.slice(0,-1*ue),B=B.slice(0,-1*ue)),I.push(this.productions_[te[1]][0]),D.push(H.$),B.push(H._$),Ve=$[I[I.length-2]][I[I.length-1]],I.push(Ve);break;case 3:return!0}}return!0},"parse")},_=function(){var P={EOF:1,parseError:x(function(R,I){if(this.yy.parser)this.yy.parser.parseError(R,I);else throw new Error(R)},"parseError"),setInput:x(function(k,R){return this.yy=R||this.yy||{},this._input=k,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:x(function(){var k=this._input[0];this.yytext+=k,this.yyleng++,this.offset++,this.match+=k,this.matched+=k;var R=k.match(/(?:\r\n?|\n).*/g);return R?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),k},"input"),unput:x(function(k){var R=k.length,I=k.split(/(?:\r\n?|\n)/g);this._input=k+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-R),this.offset-=R;var M=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),I.length-1&&(this.yylineno-=I.length-1);var D=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:I?(I.length===M.length?this.yylloc.first_column:0)+M[M.length-I.length].length-I[0].length:this.yylloc.first_column-R},this.options.ranges&&(this.yylloc.range=[D[0],D[0]+this.yyleng-R]),this.yyleng=this.yytext.length,this},"unput"),more:x(function(){return this._more=!0,this},"more"),reject:x(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:x(function(k){this.unput(this.match.slice(k))},"less"),pastInput:x(function(){var k=this.matched.substr(0,this.matched.length-this.match.length);return(k.length>20?"...":"")+k.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:x(function(){var k=this.match;return k.length<20&&(k+=this._input.substr(0,20-k.length)),(k.substr(0,20)+(k.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:x(function(){var k=this.pastInput(),R=new Array(k.length+1).join("-");return k+this.upcomingInput()+`
`+R+"^"},"showPosition"),test_match:x(function(k,R){var I,M,D;if(this.options.backtrack_lexer&&(D={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(D.yylloc.range=this.yylloc.range.slice(0))),M=k[0].match(/(?:\r\n?|\n).*/g),M&&(this.yylineno+=M.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:M?M[M.length-1].length-M[M.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+k[0].length},this.yytext+=k[0],this.match+=k[0],this.matches=k,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(k[0].length),this.matched+=k[0],I=this.performAction.call(this,this.yy,this,R,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),I)return I;if(this._backtrack){for(var B in D)this[B]=D[B];return!1}return!1},"test_match"),next:x(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var k,R,I,M;this._more||(this.yytext="",this.match="");for(var D=this._currentRules(),B=0;B<D.length;B++)if(I=this._input.match(this.rules[D[B]]),I&&(!R||I[0].length>R[0].length)){if(R=I,M=B,this.options.backtrack_lexer){if(k=this.test_match(I,D[B]),k!==!1)return k;if(this._backtrack){R=!1;continue}else return!1}else if(!this.options.flex)break}return R?(k=this.test_match(R,D[M]),k!==!1?k:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var R=this.next();return R||this.lex()},"lex"),begin:x(function(R){this.conditionStack.push(R)},"begin"),popState:x(function(){var R=this.conditionStack.length-1;return R>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(R){return R=this.conditionStack.length-1-Math.abs(R||0),R>=0?this.conditionStack[R]:"INITIAL"},"topState"),pushState:x(function(R){this.begin(R)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:x(function(R,I,M,D){switch(M){case 0:return this.begin("open_directive"),"open_directive";case 1:return this.begin("acc_title"),31;case 2:return this.popState(),"acc_title_value";case 3:return this.begin("acc_descr"),33;case 4:return this.popState(),"acc_descr_value";case 5:this.begin("acc_descr_multiline");break;case 6:this.popState();break;case 7:return"acc_descr_multiline_value";case 8:break;case 9:break;case 10:break;case 11:return 10;case 12:break;case 13:break;case 14:this.begin("href");break;case 15:this.popState();break;case 16:return 43;case 17:this.begin("callbackname");break;case 18:this.popState();break;case 19:this.popState(),this.begin("callbackargs");break;case 20:return 41;case 21:this.popState();break;case 22:return 42;case 23:this.begin("click");break;case 24:this.popState();break;case 25:return 40;case 26:return 4;case 27:return 22;case 28:return 23;case 29:return 24;case 30:return 25;case 31:return 26;case 32:return 28;case 33:return 27;case 34:return 29;case 35:return 12;case 36:return 13;case 37:return 14;case 38:return 15;case 39:return 16;case 40:return 17;case 41:return 18;case 42:return 20;case 43:return 21;case 44:return"date";case 45:return 30;case 46:return"accDescription";case 47:return 36;case 48:return 38;case 49:return 39;case 50:return":";case 51:return 6;case 52:return"INVALID"}},"anonymous"),rules:[/^(?:%%\{)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:%%(?!\{)*[^\n]*)/i,/^(?:[^\}]%%*[^\n]*)/i,/^(?:%%*[^\n]*[\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:%[^\n]*)/i,/^(?:href[\s]+["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:call[\s]+)/i,/^(?:\([\s]*\))/i,/^(?:\()/i,/^(?:[^(]*)/i,/^(?:\))/i,/^(?:[^)]*)/i,/^(?:click[\s]+)/i,/^(?:[\s\n])/i,/^(?:[^\s\n]*)/i,/^(?:gantt\b)/i,/^(?:dateFormat\s[^#\n;]+)/i,/^(?:inclusiveEndDates\b)/i,/^(?:topAxis\b)/i,/^(?:axisFormat\s[^#\n;]+)/i,/^(?:tickInterval\s[^#\n;]+)/i,/^(?:includes\s[^#\n;]+)/i,/^(?:excludes\s[^#\n;]+)/i,/^(?:todayMarker\s[^\n;]+)/i,/^(?:weekday\s+monday\b)/i,/^(?:weekday\s+tuesday\b)/i,/^(?:weekday\s+wednesday\b)/i,/^(?:weekday\s+thursday\b)/i,/^(?:weekday\s+friday\b)/i,/^(?:weekday\s+saturday\b)/i,/^(?:weekday\s+sunday\b)/i,/^(?:weekend\s+friday\b)/i,/^(?:weekend\s+saturday\b)/i,/^(?:\d\d\d\d-\d\d-\d\d\b)/i,/^(?:title\s[^\n]+)/i,/^(?:accDescription\s[^#\n;]+)/i,/^(?:section\s[^\n]+)/i,/^(?:[^:\n]+)/i,/^(?::[^#\n;]+)/i,/^(?::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[6,7],inclusive:!1},acc_descr:{rules:[4],inclusive:!1},acc_title:{rules:[2],inclusive:!1},callbackargs:{rules:[21,22],inclusive:!1},callbackname:{rules:[18,19,20],inclusive:!1},href:{rules:[15,16],inclusive:!1},click:{rules:[24,25],inclusive:!1},INITIAL:{rules:[0,1,3,5,8,9,10,11,12,13,14,17,23,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52],inclusive:!0}}};return P}();N.lexer=_;function O(){this.yy={}}return x(O,"Parser"),O.prototype=N,N.Parser=O,new O}();pT.parser=pT;var BSe=pT;wi.extend(DSe);wi.extend(ISe);wi.extend(PSe);var pR={friday:5,saturday:6},qs="",Wk="",Hk=void 0,qk="",gg=[],mg=[],Yk=new Map,Xk=[],Ty=[],fd="",jk="",wW=["active","done","crit","milestone","vert"],Kk=[],vg=!1,Zk=!1,Qk="sunday",Ey="saturday",gT=0,FSe=x(function(){Xk=[],Ty=[],fd="",Kk=[],Cm=0,vT=void 0,Am=void 0,Nn=[],qs="",Wk="",jk="",Hk=void 0,qk="",gg=[],mg=[],vg=!1,Zk=!1,gT=0,Yk=new Map,An(),Qk="sunday",Ey="saturday"},"clear"),$Se=x(function(t){Wk=t},"setAxisFormat"),zSe=x(function(){return Wk},"getAxisFormat"),VSe=x(function(t){Hk=t},"setTickInterval"),GSe=x(function(){return Hk},"getTickInterval"),USe=x(function(t){qk=t},"setTodayMarker"),WSe=x(function(){return qk},"getTodayMarker"),HSe=x(function(t){qs=t},"setDateFormat"),qSe=x(function(){vg=!0},"enableInclusiveEndDates"),YSe=x(function(){return vg},"endDatesAreInclusive"),XSe=x(function(){Zk=!0},"enableTopAxis"),jSe=x(function(){return Zk},"topAxisEnabled"),KSe=x(function(t){jk=t},"setDisplayMode"),ZSe=x(function(){return jk},"getDisplayMode"),QSe=x(function(){return qs},"getDateFormat"),JSe=x(function(t){gg=t.toLowerCase().split(/[\s,]+/)},"setIncludes"),e7e=x(function(){return gg},"getIncludes"),t7e=x(function(t){mg=t.toLowerCase().split(/[\s,]+/)},"setExcludes"),r7e=x(function(){return mg},"getExcludes"),n7e=x(function(){return Yk},"getLinks"),i7e=x(function(t){fd=t,Xk.push(t)},"addSection"),a7e=x(function(){return Xk},"getSections"),s7e=x(function(){let t=gR();const e=10;let r=0;for(;!t&&r<e;)t=gR(),r++;return Ty=Nn,Ty},"getTasks"),TW=x(function(t,e,r,n){const i=t.format(e.trim()),a=t.format("YYYY-MM-DD");return n.includes(i)||n.includes(a)?!1:r.includes("weekends")&&(t.isoWeekday()===pR[Ey]||t.isoWeekday()===pR[Ey]+1)||r.includes(t.format("dddd").toLowerCase())?!0:r.includes(i)||r.includes(a)},"isInvalidDate"),o7e=x(function(t){Qk=t},"setWeekday"),l7e=x(function(){return Qk},"getWeekday"),c7e=x(function(t){Ey=t},"setWeekend"),EW=x(function(t,e,r,n){if(!r.length||t.manualEndTime)return;let i;t.startTime instanceof Date?i=wi(t.startTime):i=wi(t.startTime,e,!0),i=i.add(1,"d");let a;t.endTime instanceof Date?a=wi(t.endTime):a=wi(t.endTime,e,!0);const[s,o]=u7e(i,a,e,r,n);t.endTime=s.toDate(),t.renderEndTime=o},"checkTaskDates"),u7e=x(function(t,e,r,n,i){let a=!1,s=null;for(;t<=e;)a||(s=e.toDate()),a=TW(t,r,n,i),a&&(e=e.add(1,"d")),t=t.add(1,"d");return[e,s]},"fixTaskDates"),mT=x(function(t,e,r){if(r=r.trim(),(e.trim()==="x"||e.trim()==="X")&&/^\d+$/.test(r))return new Date(Number(r));const i=/^after\s+(?<ids>[\d\w- ]+)/.exec(r);if(i!==null){let s=null;for(const l of i.groups.ids.split(" ")){let u=Wu(l);u!==void 0&&(!s||u.endTime>s.endTime)&&(s=u)}if(s)return s.endTime;const o=new Date;return o.setHours(0,0,0,0),o}let a=wi(r,e.trim(),!0);if(a.isValid())return a.toDate();{ie.debug("Invalid date:"+r),ie.debug("With date format:"+e.trim());const s=new Date(r);if(s===void 0||isNaN(s.getTime())||s.getFullYear()<-1e4||s.getFullYear()>1e4)throw new Error("Invalid date:"+r);return s}},"getStartDate"),kW=x(function(t){const e=/^(\d+(?:\.\d+)?)([Mdhmswy]|ms)$/.exec(t.trim());return e!==null?[Number.parseFloat(e[1]),e[2]]:[NaN,"ms"]},"parseDuration"),SW=x(function(t,e,r,n=!1){r=r.trim();const a=/^until\s+(?<ids>[\d\w- ]+)/.exec(r);if(a!==null){let h=null;for(const f of a.groups.ids.split(" ")){let p=Wu(f);p!==void 0&&(!h||p.startTime<h.startTime)&&(h=p)}if(h)return h.startTime;const d=new Date;return d.setHours(0,0,0,0),d}let s=wi(r,e.trim(),!0);if(s.isValid())return n&&(s=s.add(1,"d")),s.toDate();let o=wi(t);const[l,u]=kW(r);if(!Number.isNaN(l)){const h=o.add(l,u);h.isValid()&&(o=h)}return o.toDate()},"getEndDate"),Cm=0,Fh=x(function(t){return t===void 0?(Cm=Cm+1,"task"+Cm):t},"parseId"),h7e=x(function(t,e){let r;e.substr(0,1)===":"?r=e.substr(1,e.length):r=e;const n=r.split(","),i={};Jk(n,i,wW);for(let s=0;s<n.length;s++)n[s]=n[s].trim();let a="";switch(n.length){case 1:i.id=Fh(),i.startTime=t.endTime,a=n[0];break;case 2:i.id=Fh(),i.startTime=mT(void 0,qs,n[0]),a=n[1];break;case 3:i.id=Fh(n[0]),i.startTime=mT(void 0,qs,n[1]),a=n[2];break}return a&&(i.endTime=SW(i.startTime,qs,a,vg),i.manualEndTime=wi(a,"YYYY-MM-DD",!0).isValid(),EW(i,qs,mg,gg)),i},"compileData"),d7e=x(function(t,e){let r;e.substr(0,1)===":"?r=e.substr(1,e.length):r=e;const n=r.split(","),i={};Jk(n,i,wW);for(let a=0;a<n.length;a++)n[a]=n[a].trim();switch(n.length){case 1:i.id=Fh(),i.startTime={type:"prevTaskEnd",id:t},i.endTime={data:n[0]};break;case 2:i.id=Fh(),i.startTime={type:"getStartDate",startData:n[0]},i.endTime={data:n[1]};break;case 3:i.id=Fh(n[0]),i.startTime={type:"getStartDate",startData:n[1]},i.endTime={data:n[2]};break}return i},"parseData"),vT,Am,Nn=[],CW={},f7e=x(function(t,e){const r={section:fd,type:fd,processed:!1,manualEndTime:!1,renderEndTime:null,raw:{data:e},task:t,classes:[]},n=d7e(Am,e);r.raw.startTime=n.startTime,r.raw.endTime=n.endTime,r.id=n.id,r.prevTaskId=Am,r.active=n.active,r.done=n.done,r.crit=n.crit,r.milestone=n.milestone,r.vert=n.vert,r.order=gT,gT++;const i=Nn.push(r);Am=r.id,CW[r.id]=i-1},"addTask"),Wu=x(function(t){const e=CW[t];return Nn[e]},"findTaskById"),p7e=x(function(t,e){const r={section:fd,type:fd,description:t,task:t,classes:[]},n=h7e(vT,e);r.startTime=n.startTime,r.endTime=n.endTime,r.id=n.id,r.active=n.active,r.done=n.done,r.crit=n.crit,r.milestone=n.milestone,r.vert=n.vert,vT=r,Ty.push(r)},"addTaskOrg"),gR=x(function(){const t=x(function(r){const n=Nn[r];let i="";switch(Nn[r].raw.startTime.type){case"prevTaskEnd":{const a=Wu(n.prevTaskId);n.startTime=a.endTime;break}case"getStartDate":i=mT(void 0,qs,Nn[r].raw.startTime.startData),i&&(Nn[r].startTime=i);break}return Nn[r].startTime&&(Nn[r].endTime=SW(Nn[r].startTime,qs,Nn[r].raw.endTime.data,vg),Nn[r].endTime&&(Nn[r].processed=!0,Nn[r].manualEndTime=wi(Nn[r].raw.endTime.data,"YYYY-MM-DD",!0).isValid(),EW(Nn[r],qs,mg,gg))),Nn[r].processed},"compileTask");let e=!0;for(const[r,n]of Nn.entries())t(r),e=e&&n.processed;return e},"compileTasks"),g7e=x(function(t,e){let r=e;we().securityLevel!=="loose"&&(r=tc(e)),t.split(",").forEach(function(n){Wu(n)!==void 0&&(_W(n,()=>{window.open(r,"_self")}),Yk.set(n,r))}),AW(t,"clickable")},"setLink"),AW=x(function(t,e){t.split(",").forEach(function(r){let n=Wu(r);n!==void 0&&n.classes.push(e)})},"setClass"),m7e=x(function(t,e,r){if(we().securityLevel!=="loose"||e===void 0)return;let n=[];if(typeof r=="string"){n=r.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let a=0;a<n.length;a++){let s=n[a].trim();s.startsWith('"')&&s.endsWith('"')&&(s=s.substr(1,s.length-2)),n[a]=s}}n.length===0&&n.push(t),Wu(t)!==void 0&&_W(t,()=>{Kt.runFunc(e,...n)})},"setClickFun"),_W=x(function(t,e){Kk.push(function(){const r=document.querySelector(`[id="${t}"]`);r!==null&&r.addEventListener("click",function(){e()})},function(){const r=document.querySelector(`[id="${t}-text"]`);r!==null&&r.addEventListener("click",function(){e()})})},"pushFun"),v7e=x(function(t,e,r){t.split(",").forEach(function(n){m7e(n,e,r)}),AW(t,"clickable")},"setClickEvent"),y7e=x(function(t){Kk.forEach(function(e){e(t)})},"bindFunctions"),x7e={getConfig:x(()=>we().gantt,"getConfig"),clear:FSe,setDateFormat:HSe,getDateFormat:QSe,enableInclusiveEndDates:qSe,endDatesAreInclusive:YSe,enableTopAxis:XSe,topAxisEnabled:jSe,setAxisFormat:$Se,getAxisFormat:zSe,setTickInterval:VSe,getTickInterval:GSe,setTodayMarker:USe,getTodayMarker:WSe,setAccTitle:Sn,getAccTitle:zn,setDiagramTitle:Zn,getDiagramTitle:_n,setDisplayMode:KSe,getDisplayMode:ZSe,setAccDescription:Vn,getAccDescription:Gn,addSection:i7e,getSections:a7e,getTasks:s7e,addTask:f7e,findTaskById:Wu,addTaskOrg:p7e,setIncludes:JSe,getIncludes:e7e,setExcludes:t7e,getExcludes:r7e,setClickEvent:v7e,setLink:g7e,getLinks:n7e,bindFunctions:y7e,parseDuration:kW,isInvalidDate:TW,setWeekday:o7e,getWeekday:l7e,setWeekend:c7e};function Jk(t,e,r){let n=!0;for(;n;)n=!1,r.forEach(function(i){const a="^\\s*"+i+"\\s*$",s=new RegExp(a);t[0].match(s)&&(e[i]=!0,t.shift(1),n=!0)})}x(Jk,"getTaskTags");var b7e=x(function(){ie.debug("Something is calling, setConf, remove the call")},"setConf"),mR={monday:F0,tuesday:gD,wednesday:mD,thursday:iu,friday:vD,saturday:yD,sunday:Np},w7e=x((t,e)=>{let r=[...t].map(()=>-1/0),n=[...t].sort((a,s)=>a.startTime-s.startTime||a.order-s.order),i=0;for(const a of n)for(let s=0;s<r.length;s++)if(a.startTime>=r[s]){r[s]=a.endTime,a.order=s+e,s>i&&(i=s);break}return i},"getMaxIntersections"),yo,T7e=x(function(t,e,r,n){const i=we().gantt,a=we().securityLevel;let s;a==="sandbox"&&(s=Qe("#i"+e));const o=Qe(a==="sandbox"?s.nodes()[0].contentDocument.body:"body"),l=a==="sandbox"?s.nodes()[0].contentDocument:document,u=l.getElementById(e);yo=u.parentElement.offsetWidth,yo===void 0&&(yo=1200),i.useWidth!==void 0&&(yo=i.useWidth);const h=n.db.getTasks();let d=[];for(const C of h)d.push(C.type);d=S(d);const f={};let p=2*i.topPadding;if(n.db.getDisplayMode()==="compact"||i.displayMode==="compact"){const C={};for(const N of h)C[N.section]===void 0?C[N.section]=[N]:C[N.section].push(N);let A=0;for(const N of Object.keys(C)){const _=w7e(C[N],A)+1;A+=_,p+=_*(i.barHeight+i.barGap),f[N]=_}}else{p+=h.length*(i.barHeight+i.barGap);for(const C of d)f[C]=h.filter(A=>A.type===C).length}u.setAttribute("viewBox","0 0 "+yo+" "+p);const g=o.select(`[id="${e}"]`),m=bee().domain([AX(h,function(C){return C.startTime}),CX(h,function(C){return C.endTime})]).rangeRound([0,yo-i.leftPadding-i.rightPadding]);function v(C,A){const N=C.startTime,_=A.startTime;let O=0;return N>_?O=1:N<_&&(O=-1),O}x(v,"taskCompare"),h.sort(v),y(h,yo,p),ji(g,p,yo,i.useMaxWidth),g.append("text").text(n.db.getDiagramTitle()).attr("x",yo/2).attr("y",i.titleTopMargin).attr("class","titleText");function y(C,A,N){const _=i.barHeight,O=_+i.barGap,P=i.topPadding,k=i.leftPadding,R=Hh().domain([0,d.length]).range(["#00B9FA","#F95002"]).interpolate(KK);w(O,P,k,A,N,C,n.db.getExcludes(),n.db.getIncludes()),T(k,P,A,N),b(C,O,P,k,_,R,A),E(O,P),L(k,P,A,N)}x(y,"makeGantt");function b(C,A,N,_,O,P,k){C.sort(($,F)=>$.vert===F.vert?0:$.vert?1:-1);const I=[...new Set(C.map($=>$.order))].map($=>C.find(F=>F.order===$));g.append("g").selectAll("rect").data(I).enter().append("rect").attr("x",0).attr("y",function($,F){return F=$.order,F*A+N-2}).attr("width",function(){return k-i.rightPadding/2}).attr("height",A).attr("class",function($){for(const[F,G]of d.entries())if($.type===G)return"section section"+F%i.numberSectionStyles;return"section section0"}).enter();const M=g.append("g").selectAll("rect").data(C).enter(),D=n.db.getLinks();if(M.append("rect").attr("id",function($){return $.id}).attr("rx",3).attr("ry",3).attr("x",function($){return $.milestone?m($.startTime)+_+.5*(m($.endTime)-m($.startTime))-.5*O:m($.startTime)+_}).attr("y",function($,F){return F=$.order,$.vert?i.gridLineStartPadding:F*A+N}).attr("width",function($){return $.milestone?O:$.vert?.08*O:m($.renderEndTime||$.endTime)-m($.startTime)}).attr("height",function($){return $.vert?h.length*(i.barHeight+i.barGap)+i.barHeight*2:O}).attr("transform-origin",function($,F){return F=$.order,(m($.startTime)+_+.5*(m($.endTime)-m($.startTime))).toString()+"px "+(F*A+N+.5*O).toString()+"px"}).attr("class",function($){const F="task";let G="";$.classes.length>0&&(G=$.classes.join(" "));let W=0;for(const[q,ne]of d.entries())$.type===ne&&(W=q%i.numberSectionStyles);let J="";return $.active?$.crit?J+=" activeCrit":J=" active":$.done?$.crit?J=" doneCrit":J=" done":$.crit&&(J+=" crit"),J.length===0&&(J=" task"),$.milestone&&(J=" milestone "+J),$.vert&&(J=" vert "+J),J+=W,J+=" "+G,F+J}),M.append("text").attr("id",function($){return $.id+"-text"}).text(function($){return $.task}).attr("font-size",i.fontSize).attr("x",function($){let F=m($.startTime),G=m($.renderEndTime||$.endTime);if($.milestone&&(F+=.5*(m($.endTime)-m($.startTime))-.5*O,G=F+O),$.vert)return m($.startTime)+_;const W=this.getBBox().width;return W>G-F?G+W+1.5*i.leftPadding>k?F+_-5:G+_+5:(G-F)/2+F+_}).attr("y",function($,F){return $.vert?i.gridLineStartPadding+h.length*(i.barHeight+i.barGap)+60:(F=$.order,F*A+i.barHeight/2+(i.fontSize/2-2)+N)}).attr("text-height",O).attr("class",function($){const F=m($.startTime);let G=m($.endTime);$.milestone&&(G=F+O);const W=this.getBBox().width;let J="";$.classes.length>0&&(J=$.classes.join(" "));let q=0;for(const[ae,pe]of d.entries())$.type===pe&&(q=ae%i.numberSectionStyles);let ne="";return $.active&&($.crit?ne="activeCritText"+q:ne="activeText"+q),$.done?$.crit?ne=ne+" doneCritText"+q:ne=ne+" doneText"+q:$.crit&&(ne=ne+" critText"+q),$.milestone&&(ne+=" milestoneText"),$.vert&&(ne+=" vertText"),W>G-F?G+W+1.5*i.leftPadding>k?J+" taskTextOutsideLeft taskTextOutside"+q+" "+ne:J+" taskTextOutsideRight taskTextOutside"+q+" "+ne+" width-"+W:J+" taskText taskText"+q+" "+ne+" width-"+W}),we().securityLevel==="sandbox"){let $;$=Qe("#i"+e);const F=$.nodes()[0].contentDocument;M.filter(function(G){return D.has(G.id)}).each(function(G){var W=F.querySelector("#"+G.id),J=F.querySelector("#"+G.id+"-text");const q=W.parentNode;var ne=F.createElement("a");ne.setAttribute("xlink:href",D.get(G.id)),ne.setAttribute("target","_top"),q.appendChild(ne),ne.appendChild(W),ne.appendChild(J)})}}x(b,"drawRects");function w(C,A,N,_,O,P,k,R){if(k.length===0&&R.length===0)return;let I,M;for(const{startTime:W,endTime:J}of P)(I===void 0||W<I)&&(I=W),(M===void 0||J>M)&&(M=J);if(!I||!M)return;if(wi(M).diff(wi(I),"year")>5){ie.warn("The difference between the min and max time is more than 5 years. This will cause performance issues. Skipping drawing exclude days.");return}const D=n.db.getDateFormat(),B=[];let $=null,F=wi(I);for(;F.valueOf()<=M;)n.db.isInvalidDate(F,D,k,R)?$?$.end=F:$={start:F,end:F}:$&&(B.push($),$=null),F=F.add(1,"d");g.append("g").selectAll("rect").data(B).enter().append("rect").attr("id",W=>"exclude-"+W.start.format("YYYY-MM-DD")).attr("x",W=>m(W.start.startOf("day"))+N).attr("y",i.gridLineStartPadding).attr("width",W=>m(W.end.endOf("day"))-m(W.start.startOf("day"))).attr("height",O-A-i.gridLineStartPadding).attr("transform-origin",function(W,J){return(m(W.start)+N+.5*(m(W.end)-m(W.start))).toString()+"px "+(J*C+.5*O).toString()+"px"}).attr("class","exclude-range")}x(w,"drawExcludeDays");function T(C,A,N,_){const O=n.db.getDateFormat(),P=n.db.getAxisFormat();let k;P?k=P:O==="D"?k="%d":k=i.axisFormat??"%Y-%m-%d";let R=PX(m).tickSize(-_+A+i.gridLineStartPadding).tickFormat(Km(k));const M=/^([1-9]\d*)(millisecond|second|minute|hour|day|week|month)$/.exec(n.db.getTickInterval()||i.tickInterval);if(M!==null){const D=M[1],B=M[2],$=n.db.getWeekday()||i.weekday;switch(B){case"millisecond":R.ticks(qh.every(D));break;case"second":R.ticks(xl.every(D));break;case"minute":R.ticks(P0.every(D));break;case"hour":R.ticks(B0.every(D));break;case"day":R.ticks(nu.every(D));break;case"week":R.ticks(mR[$].every(D));break;case"month":R.ticks($0.every(D));break}}if(g.append("g").attr("class","grid").attr("transform","translate("+C+", "+(_-50)+")").call(R).selectAll("text").style("text-anchor","middle").attr("fill","#000").attr("stroke","none").attr("font-size",10).attr("dy","1em"),n.db.topAxisEnabled()||i.topAxis){let D=OX(m).tickSize(-_+A+i.gridLineStartPadding).tickFormat(Km(k));if(M!==null){const B=M[1],$=M[2],F=n.db.getWeekday()||i.weekday;switch($){case"millisecond":D.ticks(qh.every(B));break;case"second":D.ticks(xl.every(B));break;case"minute":D.ticks(P0.every(B));break;case"hour":D.ticks(B0.every(B));break;case"day":D.ticks(nu.every(B));break;case"week":D.ticks(mR[F].every(B));break;case"month":D.ticks($0.every(B));break}}g.append("g").attr("class","grid").attr("transform","translate("+C+", "+A+")").call(D).selectAll("text").style("text-anchor","middle").attr("fill","#000").attr("stroke","none").attr("font-size",10)}}x(T,"makeGrid");function E(C,A){let N=0;const _=Object.keys(f).map(O=>[O,f[O]]);g.append("g").selectAll("text").data(_).enter().append(function(O){const P=O[0].split(at.lineBreakRegex),k=-(P.length-1)/2,R=l.createElementNS("http://www.w3.org/2000/svg","text");R.setAttribute("dy",k+"em");for(const[I,M]of P.entries()){const D=l.createElementNS("http://www.w3.org/2000/svg","tspan");D.setAttribute("alignment-baseline","central"),D.setAttribute("x","10"),I>0&&D.setAttribute("dy","1em"),D.textContent=M,R.appendChild(D)}return R}).attr("x",10).attr("y",function(O,P){if(P>0)for(let k=0;k<P;k++)return N+=_[P-1][1],O[1]*C/2+N*C+A;else return O[1]*C/2+A}).attr("font-size",i.sectionFontSize).attr("class",function(O){for(const[P,k]of d.entries())if(O[0]===k)return"sectionTitle sectionTitle"+P%i.numberSectionStyles;return"sectionTitle"})}x(E,"vertLabels");function L(C,A,N,_){const O=n.db.getTodayMarker();if(O==="off")return;const P=g.append("g").attr("class","today"),k=new Date,R=P.append("line");R.attr("x1",m(k)+C).attr("x2",m(k)+C).attr("y1",i.titleTopMargin).attr("y2",_-i.titleTopMargin).attr("class","today"),O!==""&&R.attr("style",O.replace(/,/g,";"))}x(L,"drawToday");function S(C){const A={},N=[];for(let _=0,O=C.length;_<O;++_)Object.prototype.hasOwnProperty.call(A,C[_])||(A[C[_]]=!0,N.push(C[_]));return N}x(S,"checkUnique")},"draw"),E7e={setConf:b7e,draw:T7e},k7e=x(t=>`
  .mermaid-main-font {
        font-family: ${t.fontFamily};
  }

  .exclude-range {
    fill: ${t.excludeBkgColor};
  }

  .section {
    stroke: none;
    opacity: 0.2;
  }

  .section0 {
    fill: ${t.sectionBkgColor};
  }

  .section2 {
    fill: ${t.sectionBkgColor2};
  }

  .section1,
  .section3 {
    fill: ${t.altSectionBkgColor};
    opacity: 0.2;
  }

  .sectionTitle0 {
    fill: ${t.titleColor};
  }

  .sectionTitle1 {
    fill: ${t.titleColor};
  }

  .sectionTitle2 {
    fill: ${t.titleColor};
  }

  .sectionTitle3 {
    fill: ${t.titleColor};
  }

  .sectionTitle {
    text-anchor: start;
    font-family: ${t.fontFamily};
  }


  /* Grid and axis */

  .grid .tick {
    stroke: ${t.gridColor};
    opacity: 0.8;
    shape-rendering: crispEdges;
  }

  .grid .tick text {
    font-family: ${t.fontFamily};
    fill: ${t.textColor};
  }

  .grid path {
    stroke-width: 0;
  }


  /* Today line */

  .today {
    fill: none;
    stroke: ${t.todayLineColor};
    stroke-width: 2px;
  }


  /* Task styling */

  /* Default task */

  .task {
    stroke-width: 2;
  }

  .taskText {
    text-anchor: middle;
    font-family: ${t.fontFamily};
  }

  .taskTextOutsideRight {
    fill: ${t.taskTextDarkColor};
    text-anchor: start;
    font-family: ${t.fontFamily};
  }

  .taskTextOutsideLeft {
    fill: ${t.taskTextDarkColor};
    text-anchor: end;
  }


  /* Special case clickable */

  .task.clickable {
    cursor: pointer;
  }

  .taskText.clickable {
    cursor: pointer;
    fill: ${t.taskTextClickableColor} !important;
    font-weight: bold;
  }

  .taskTextOutsideLeft.clickable {
    cursor: pointer;
    fill: ${t.taskTextClickableColor} !important;
    font-weight: bold;
  }

  .taskTextOutsideRight.clickable {
    cursor: pointer;
    fill: ${t.taskTextClickableColor} !important;
    font-weight: bold;
  }


  /* Specific task settings for the sections*/

  .taskText0,
  .taskText1,
  .taskText2,
  .taskText3 {
    fill: ${t.taskTextColor};
  }

  .task0,
  .task1,
  .task2,
  .task3 {
    fill: ${t.taskBkgColor};
    stroke: ${t.taskBorderColor};
  }

  .taskTextOutside0,
  .taskTextOutside2
  {
    fill: ${t.taskTextOutsideColor};
  }

  .taskTextOutside1,
  .taskTextOutside3 {
    fill: ${t.taskTextOutsideColor};
  }


  /* Active task */

  .active0,
  .active1,
  .active2,
  .active3 {
    fill: ${t.activeTaskBkgColor};
    stroke: ${t.activeTaskBorderColor};
  }

  .activeText0,
  .activeText1,
  .activeText2,
  .activeText3 {
    fill: ${t.taskTextDarkColor} !important;
  }


  /* Completed task */

  .done0,
  .done1,
  .done2,
  .done3 {
    stroke: ${t.doneTaskBorderColor};
    fill: ${t.doneTaskBkgColor};
    stroke-width: 2;
  }

  .doneText0,
  .doneText1,
  .doneText2,
  .doneText3 {
    fill: ${t.taskTextDarkColor} !important;
  }


  /* Tasks on the critical line */

  .crit0,
  .crit1,
  .crit2,
  .crit3 {
    stroke: ${t.critBorderColor};
    fill: ${t.critBkgColor};
    stroke-width: 2;
  }

  .activeCrit0,
  .activeCrit1,
  .activeCrit2,
  .activeCrit3 {
    stroke: ${t.critBorderColor};
    fill: ${t.activeTaskBkgColor};
    stroke-width: 2;
  }

  .doneCrit0,
  .doneCrit1,
  .doneCrit2,
  .doneCrit3 {
    stroke: ${t.critBorderColor};
    fill: ${t.doneTaskBkgColor};
    stroke-width: 2;
    cursor: pointer;
    shape-rendering: crispEdges;
  }

  .milestone {
    transform: rotate(45deg) scale(0.8,0.8);
  }

  .milestoneText {
    font-style: italic;
  }
  .doneCritText0,
  .doneCritText1,
  .doneCritText2,
  .doneCritText3 {
    fill: ${t.taskTextDarkColor} !important;
  }

  .vert {
    stroke: ${t.vertLineColor};
  }

  .vertText {
    font-size: 15px;
    text-anchor: middle;
    fill: ${t.vertLineColor} !important;
  }

  .activeCritText0,
  .activeCritText1,
  .activeCritText2,
  .activeCritText3 {
    fill: ${t.taskTextDarkColor} !important;
  }

  .titleText {
    text-anchor: middle;
    font-size: 18px;
    fill: ${t.titleColor||t.textColor};
    font-family: ${t.fontFamily};
  }
`,"getStyles"),S7e=k7e,C7e={parser:BSe,db:x7e,renderer:E7e,styles:S7e};const A7e=Object.freeze(Object.defineProperty({__proto__:null,diagram:C7e},Symbol.toStringTag,{value:"Module"}));var _7e={parse:x(async t=>{const e=await vc("info",t);ie.debug(e)},"parse")},L7e={version:$3.version+""},R7e=x(()=>L7e.version,"getVersion"),N7e={getVersion:R7e},D7e=x((t,e,r)=>{ie.debug(`rendering info diagram
`+t);const n=el(e);ji(n,100,400,!0),n.append("g").append("text").attr("x",100).attr("y",40).attr("class","version").attr("font-size",32).style("text-anchor","middle").text(`v${r}`)},"draw"),M7e={draw:D7e},I7e={parser:_7e,db:N7e,renderer:M7e};const O7e=Object.freeze(Object.defineProperty({__proto__:null,diagram:I7e},Symbol.toStringTag,{value:"Module"}));var P7e=hr.pie,eS={sections:new Map,showData:!1},ky=eS.sections,tS=eS.showData,B7e=structuredClone(P7e),F7e=x(()=>structuredClone(B7e),"getConfig"),$7e=x(()=>{ky=new Map,tS=eS.showData,An()},"clear"),z7e=x(({label:t,value:e})=>{if(e<0)throw new Error(`"${t}" has invalid value: ${e}. Negative values are not allowed in pie charts. All slice values must be >= 0.`);ky.has(t)||(ky.set(t,e),ie.debug(`added new section: ${t}, with value: ${e}`))},"addSection"),V7e=x(()=>ky,"getSections"),G7e=x(t=>{tS=t},"setShowData"),U7e=x(()=>tS,"getShowData"),LW={getConfig:F7e,clear:$7e,setDiagramTitle:Zn,getDiagramTitle:_n,setAccTitle:Sn,getAccTitle:zn,setAccDescription:Vn,getAccDescription:Gn,addSection:z7e,getSections:V7e,setShowData:G7e,getShowData:U7e},W7e=x((t,e)=>{Fu(t,e),e.setShowData(t.showData),t.sections.map(e.addSection)},"populateDb"),H7e={parse:x(async t=>{const e=await vc("pie",t);ie.debug(e),W7e(e,LW)},"parse")},q7e=x(t=>`
  .pieCircle{
    stroke: ${t.pieStrokeColor};
    stroke-width : ${t.pieStrokeWidth};
    opacity : ${t.pieOpacity};
  }
  .pieOuterCircle{
    stroke: ${t.pieOuterStrokeColor};
    stroke-width: ${t.pieOuterStrokeWidth};
    fill: none;
  }
  .pieTitleText {
    text-anchor: middle;
    font-size: ${t.pieTitleTextSize};
    fill: ${t.pieTitleTextColor};
    font-family: ${t.fontFamily};
  }
  .slice {
    font-family: ${t.fontFamily};
    fill: ${t.pieSectionTextColor};
    font-size:${t.pieSectionTextSize};
    // fill: white;
  }
  .legend text {
    fill: ${t.pieLegendTextColor};
    font-family: ${t.fontFamily};
    font-size: ${t.pieLegendTextSize};
  }
`,"getStyles"),Y7e=q7e,X7e=x(t=>{const e=[...t.values()].reduce((i,a)=>i+a,0),r=[...t.entries()].map(([i,a])=>({label:i,value:a})).filter(i=>i.value/e*100>=1).sort((i,a)=>a.value-i.value);return Oee().value(i=>i.value)(r)},"createPieArcs"),j7e=x((t,e,r,n)=>{ie.debug(`rendering pie chart
`+t);const i=n.db,a=we(),s=Hi(i.getConfig(),a.pie),o=40,l=18,u=4,h=450,d=h,f=el(e),p=f.append("g");p.attr("transform","translate("+d/2+","+h/2+")");const{themeVariables:g}=a;let[m]=Ru(g.pieOuterStrokeWidth);m??=2;const v=s.textPosition,y=Math.min(d,h)/2-o,b=Xh().innerRadius(0).outerRadius(y),w=Xh().innerRadius(y*v).outerRadius(y*v);p.append("circle").attr("cx",0).attr("cy",0).attr("r",y+m/2).attr("class","pieOuterCircle");const T=i.getSections(),E=X7e(T),L=[g.pie1,g.pie2,g.pie3,g.pie4,g.pie5,g.pie6,g.pie7,g.pie8,g.pie9,g.pie10,g.pie11,g.pie12];let S=0;T.forEach(k=>{S+=k});const C=E.filter(k=>(k.data.value/S*100).toFixed(0)!=="0"),A=Zc(L);p.selectAll("mySlices").data(C).enter().append("path").attr("d",b).attr("fill",k=>A(k.data.label)).attr("class","pieCircle"),p.selectAll("mySlices").data(C).enter().append("text").text(k=>(k.data.value/S*100).toFixed(0)+"%").attr("transform",k=>"translate("+w.centroid(k)+")").style("text-anchor","middle").attr("class","slice"),p.append("text").text(i.getDiagramTitle()).attr("x",0).attr("y",-400/2).attr("class","pieTitleText");const N=[...T.entries()].map(([k,R])=>({label:k,value:R})),_=p.selectAll(".legend").data(N).enter().append("g").attr("class","legend").attr("transform",(k,R)=>{const I=l+u,M=I*N.length/2,D=12*l,B=R*I-M;return"translate("+D+","+B+")"});_.append("rect").attr("width",l).attr("height",l).style("fill",k=>A(k.label)).style("stroke",k=>A(k.label)),_.append("text").attr("x",l+u).attr("y",l-u).text(k=>i.getShowData()?`${k.label} [${k.value}]`:k.label);const O=Math.max(..._.selectAll("text").nodes().map(k=>k?.getBoundingClientRect().width??0)),P=d+o+l+u+O;f.attr("viewBox",`0 0 ${P} ${h}`),ji(f,h,P,s.useMaxWidth)},"draw"),K7e={draw:j7e},Z7e={parser:H7e,db:LW,renderer:K7e,styles:Y7e};const Q7e=Object.freeze(Object.defineProperty({__proto__:null,diagram:Z7e},Symbol.toStringTag,{value:"Module"}));var yT=function(){var t=x(function(ce,z,oe,se){for(oe=oe||{},se=ce.length;se--;oe[ce[se]]=z);return oe},"o"),e=[1,3],r=[1,4],n=[1,5],i=[1,6],a=[1,7],s=[1,4,5,10,12,13,14,18,25,35,37,39,41,42,48,50,51,52,53,54,55,56,57,60,61,63,64,65,66,67],o=[1,4,5,10,12,13,14,18,25,28,35,37,39,41,42,48,50,51,52,53,54,55,56,57,60,61,63,64,65,66,67],l=[55,56,57],u=[2,36],h=[1,37],d=[1,36],f=[1,38],p=[1,35],g=[1,43],m=[1,41],v=[1,14],y=[1,23],b=[1,18],w=[1,19],T=[1,20],E=[1,21],L=[1,22],S=[1,24],C=[1,25],A=[1,26],N=[1,27],_=[1,28],O=[1,29],P=[1,32],k=[1,33],R=[1,34],I=[1,39],M=[1,40],D=[1,42],B=[1,44],$=[1,62],F=[1,61],G=[4,5,8,10,12,13,14,18,44,47,49,55,56,57,63,64,65,66,67],W=[1,65],J=[1,66],q=[1,67],ne=[1,68],ae=[1,69],pe=[1,70],K=[1,71],Z=[1,72],X=[1,73],Y=[1,74],ee=[1,75],j=[1,76],fe=[4,5,6,7,8,9,10,11,12,13,14,15,18],te=[1,90],Ae=[1,91],H=[1,92],Oe=[1,99],ue=[1,93],Ve=[1,96],Ge=[1,94],Ue=[1,95],ke=[1,97],Pe=[1,98],Se=[1,102],_e=[10,55,56,57],ze=[4,5,6,8,10,11,13,17,18,19,20,55,56,57],me={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,idStringToken:3,ALPHA:4,NUM:5,NODE_STRING:6,DOWN:7,MINUS:8,DEFAULT:9,COMMA:10,COLON:11,AMP:12,BRKT:13,MULT:14,UNICODE_TEXT:15,styleComponent:16,UNIT:17,SPACE:18,STYLE:19,PCT:20,idString:21,style:22,stylesOpt:23,classDefStatement:24,CLASSDEF:25,start:26,eol:27,QUADRANT:28,document:29,line:30,statement:31,axisDetails:32,quadrantDetails:33,points:34,title:35,title_value:36,acc_title:37,acc_title_value:38,acc_descr:39,acc_descr_value:40,acc_descr_multiline_value:41,section:42,text:43,point_start:44,point_x:45,point_y:46,class_name:47,"X-AXIS":48,"AXIS-TEXT-DELIMITER":49,"Y-AXIS":50,QUADRANT_1:51,QUADRANT_2:52,QUADRANT_3:53,QUADRANT_4:54,NEWLINE:55,SEMI:56,EOF:57,alphaNumToken:58,textNoTagsToken:59,STR:60,MD_STR:61,alphaNum:62,PUNCTUATION:63,PLUS:64,EQUALS:65,DOT:66,UNDERSCORE:67,$accept:0,$end:1},terminals_:{2:"error",4:"ALPHA",5:"NUM",6:"NODE_STRING",7:"DOWN",8:"MINUS",9:"DEFAULT",10:"COMMA",11:"COLON",12:"AMP",13:"BRKT",14:"MULT",15:"UNICODE_TEXT",17:"UNIT",18:"SPACE",19:"STYLE",20:"PCT",25:"CLASSDEF",28:"QUADRANT",35:"title",36:"title_value",37:"acc_title",38:"acc_title_value",39:"acc_descr",40:"acc_descr_value",41:"acc_descr_multiline_value",42:"section",44:"point_start",45:"point_x",46:"point_y",47:"class_name",48:"X-AXIS",49:"AXIS-TEXT-DELIMITER",50:"Y-AXIS",51:"QUADRANT_1",52:"QUADRANT_2",53:"QUADRANT_3",54:"QUADRANT_4",55:"NEWLINE",56:"SEMI",57:"EOF",60:"STR",61:"MD_STR",63:"PUNCTUATION",64:"PLUS",65:"EQUALS",66:"DOT",67:"UNDERSCORE"},productions_:[0,[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[21,1],[21,2],[22,1],[22,2],[23,1],[23,3],[24,5],[26,2],[26,2],[26,2],[29,0],[29,2],[30,2],[31,0],[31,1],[31,2],[31,1],[31,1],[31,1],[31,2],[31,2],[31,2],[31,1],[31,1],[34,4],[34,5],[34,5],[34,6],[32,4],[32,3],[32,2],[32,4],[32,3],[32,2],[33,2],[33,2],[33,2],[33,2],[27,1],[27,1],[27,1],[43,1],[43,2],[43,1],[43,1],[62,1],[62,2],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[59,1],[59,1],[59,1]],performAction:x(function(z,oe,se,ge,he,be,Ce){var Te=be.length-1;switch(he){case 23:this.$=be[Te];break;case 24:this.$=be[Te-1]+""+be[Te];break;case 26:this.$=be[Te-1]+be[Te];break;case 27:this.$=[be[Te].trim()];break;case 28:be[Te-2].push(be[Te].trim()),this.$=be[Te-2];break;case 29:this.$=be[Te-4],ge.addClass(be[Te-2],be[Te]);break;case 37:this.$=[];break;case 42:this.$=be[Te].trim(),ge.setDiagramTitle(this.$);break;case 43:this.$=be[Te].trim(),ge.setAccTitle(this.$);break;case 44:case 45:this.$=be[Te].trim(),ge.setAccDescription(this.$);break;case 46:ge.addSection(be[Te].substr(8)),this.$=be[Te].substr(8);break;case 47:ge.addPoint(be[Te-3],"",be[Te-1],be[Te],[]);break;case 48:ge.addPoint(be[Te-4],be[Te-3],be[Te-1],be[Te],[]);break;case 49:ge.addPoint(be[Te-4],"",be[Te-2],be[Te-1],be[Te]);break;case 50:ge.addPoint(be[Te-5],be[Te-4],be[Te-2],be[Te-1],be[Te]);break;case 51:ge.setXAxisLeftText(be[Te-2]),ge.setXAxisRightText(be[Te]);break;case 52:be[Te-1].text+=" ⟶ ",ge.setXAxisLeftText(be[Te-1]);break;case 53:ge.setXAxisLeftText(be[Te]);break;case 54:ge.setYAxisBottomText(be[Te-2]),ge.setYAxisTopText(be[Te]);break;case 55:be[Te-1].text+=" ⟶ ",ge.setYAxisBottomText(be[Te-1]);break;case 56:ge.setYAxisBottomText(be[Te]);break;case 57:ge.setQuadrant1Text(be[Te]);break;case 58:ge.setQuadrant2Text(be[Te]);break;case 59:ge.setQuadrant3Text(be[Te]);break;case 60:ge.setQuadrant4Text(be[Te]);break;case 64:this.$={text:be[Te],type:"text"};break;case 65:this.$={text:be[Te-1].text+""+be[Te],type:be[Te-1].type};break;case 66:this.$={text:be[Te],type:"text"};break;case 67:this.$={text:be[Te],type:"markdown"};break;case 68:this.$=be[Te];break;case 69:this.$=be[Te-1]+""+be[Te];break}},"anonymous"),table:[{18:e,26:1,27:2,28:r,55:n,56:i,57:a},{1:[3]},{18:e,26:8,27:2,28:r,55:n,56:i,57:a},{18:e,26:9,27:2,28:r,55:n,56:i,57:a},t(s,[2,33],{29:10}),t(o,[2,61]),t(o,[2,62]),t(o,[2,63]),{1:[2,30]},{1:[2,31]},t(l,u,{30:11,31:12,24:13,32:15,33:16,34:17,43:30,58:31,1:[2,32],4:h,5:d,10:f,12:p,13:g,14:m,18:v,25:y,35:b,37:w,39:T,41:E,42:L,48:S,50:C,51:A,52:N,53:_,54:O,60:P,61:k,63:R,64:I,65:M,66:D,67:B}),t(s,[2,34]),{27:45,55:n,56:i,57:a},t(l,[2,37]),t(l,u,{24:13,32:15,33:16,34:17,43:30,58:31,31:46,4:h,5:d,10:f,12:p,13:g,14:m,18:v,25:y,35:b,37:w,39:T,41:E,42:L,48:S,50:C,51:A,52:N,53:_,54:O,60:P,61:k,63:R,64:I,65:M,66:D,67:B}),t(l,[2,39]),t(l,[2,40]),t(l,[2,41]),{36:[1,47]},{38:[1,48]},{40:[1,49]},t(l,[2,45]),t(l,[2,46]),{18:[1,50]},{4:h,5:d,10:f,12:p,13:g,14:m,43:51,58:31,60:P,61:k,63:R,64:I,65:M,66:D,67:B},{4:h,5:d,10:f,12:p,13:g,14:m,43:52,58:31,60:P,61:k,63:R,64:I,65:M,66:D,67:B},{4:h,5:d,10:f,12:p,13:g,14:m,43:53,58:31,60:P,61:k,63:R,64:I,65:M,66:D,67:B},{4:h,5:d,10:f,12:p,13:g,14:m,43:54,58:31,60:P,61:k,63:R,64:I,65:M,66:D,67:B},{4:h,5:d,10:f,12:p,13:g,14:m,43:55,58:31,60:P,61:k,63:R,64:I,65:M,66:D,67:B},{4:h,5:d,10:f,12:p,13:g,14:m,43:56,58:31,60:P,61:k,63:R,64:I,65:M,66:D,67:B},{4:h,5:d,8:$,10:f,12:p,13:g,14:m,18:F,44:[1,57],47:[1,58],58:60,59:59,63:R,64:I,65:M,66:D,67:B},t(G,[2,64]),t(G,[2,66]),t(G,[2,67]),t(G,[2,70]),t(G,[2,71]),t(G,[2,72]),t(G,[2,73]),t(G,[2,74]),t(G,[2,75]),t(G,[2,76]),t(G,[2,77]),t(G,[2,78]),t(G,[2,79]),t(G,[2,80]),t(s,[2,35]),t(l,[2,38]),t(l,[2,42]),t(l,[2,43]),t(l,[2,44]),{3:64,4:W,5:J,6:q,7:ne,8:ae,9:pe,10:K,11:Z,12:X,13:Y,14:ee,15:j,21:63},t(l,[2,53],{59:59,58:60,4:h,5:d,8:$,10:f,12:p,13:g,14:m,18:F,49:[1,77],63:R,64:I,65:M,66:D,67:B}),t(l,[2,56],{59:59,58:60,4:h,5:d,8:$,10:f,12:p,13:g,14:m,18:F,49:[1,78],63:R,64:I,65:M,66:D,67:B}),t(l,[2,57],{59:59,58:60,4:h,5:d,8:$,10:f,12:p,13:g,14:m,18:F,63:R,64:I,65:M,66:D,67:B}),t(l,[2,58],{59:59,58:60,4:h,5:d,8:$,10:f,12:p,13:g,14:m,18:F,63:R,64:I,65:M,66:D,67:B}),t(l,[2,59],{59:59,58:60,4:h,5:d,8:$,10:f,12:p,13:g,14:m,18:F,63:R,64:I,65:M,66:D,67:B}),t(l,[2,60],{59:59,58:60,4:h,5:d,8:$,10:f,12:p,13:g,14:m,18:F,63:R,64:I,65:M,66:D,67:B}),{45:[1,79]},{44:[1,80]},t(G,[2,65]),t(G,[2,81]),t(G,[2,82]),t(G,[2,83]),{3:82,4:W,5:J,6:q,7:ne,8:ae,9:pe,10:K,11:Z,12:X,13:Y,14:ee,15:j,18:[1,81]},t(fe,[2,23]),t(fe,[2,1]),t(fe,[2,2]),t(fe,[2,3]),t(fe,[2,4]),t(fe,[2,5]),t(fe,[2,6]),t(fe,[2,7]),t(fe,[2,8]),t(fe,[2,9]),t(fe,[2,10]),t(fe,[2,11]),t(fe,[2,12]),t(l,[2,52],{58:31,43:83,4:h,5:d,10:f,12:p,13:g,14:m,60:P,61:k,63:R,64:I,65:M,66:D,67:B}),t(l,[2,55],{58:31,43:84,4:h,5:d,10:f,12:p,13:g,14:m,60:P,61:k,63:R,64:I,65:M,66:D,67:B}),{46:[1,85]},{45:[1,86]},{4:te,5:Ae,6:H,8:Oe,11:ue,13:Ve,16:89,17:Ge,18:Ue,19:ke,20:Pe,22:88,23:87},t(fe,[2,24]),t(l,[2,51],{59:59,58:60,4:h,5:d,8:$,10:f,12:p,13:g,14:m,18:F,63:R,64:I,65:M,66:D,67:B}),t(l,[2,54],{59:59,58:60,4:h,5:d,8:$,10:f,12:p,13:g,14:m,18:F,63:R,64:I,65:M,66:D,67:B}),t(l,[2,47],{22:88,16:89,23:100,4:te,5:Ae,6:H,8:Oe,11:ue,13:Ve,17:Ge,18:Ue,19:ke,20:Pe}),{46:[1,101]},t(l,[2,29],{10:Se}),t(_e,[2,27],{16:103,4:te,5:Ae,6:H,8:Oe,11:ue,13:Ve,17:Ge,18:Ue,19:ke,20:Pe}),t(ze,[2,25]),t(ze,[2,13]),t(ze,[2,14]),t(ze,[2,15]),t(ze,[2,16]),t(ze,[2,17]),t(ze,[2,18]),t(ze,[2,19]),t(ze,[2,20]),t(ze,[2,21]),t(ze,[2,22]),t(l,[2,49],{10:Se}),t(l,[2,48],{22:88,16:89,23:104,4:te,5:Ae,6:H,8:Oe,11:ue,13:Ve,17:Ge,18:Ue,19:ke,20:Pe}),{4:te,5:Ae,6:H,8:Oe,11:ue,13:Ve,16:89,17:Ge,18:Ue,19:ke,20:Pe,22:105},t(ze,[2,26]),t(l,[2,50],{10:Se}),t(_e,[2,28],{16:103,4:te,5:Ae,6:H,8:Oe,11:ue,13:Ve,17:Ge,18:Ue,19:ke,20:Pe})],defaultActions:{8:[2,30],9:[2,31]},parseError:x(function(z,oe){if(oe.recoverable)this.trace(z);else{var se=new Error(z);throw se.hash=oe,se}},"parseError"),parse:x(function(z){var oe=this,se=[0],ge=[],he=[null],be=[],Ce=this.table,Te="",Ne=0,Xe=0,Ye=2,Ke=1,Ze=be.slice.call(arguments,1),Be=Object.create(this.lexer),He={yy:{}};for(var ht in this.yy)Object.prototype.hasOwnProperty.call(this.yy,ht)&&(He.yy[ht]=this.yy[ht]);Be.setInput(z,He.yy),He.yy.lexer=Be,He.yy.parser=this,typeof Be.yylloc>"u"&&(Be.yylloc={});var st=Be.yylloc;be.push(st);var We=Be.options&&Be.options.ranges;typeof He.yy.parseError=="function"?this.parseError=He.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function kt(Wt){se.length=se.length-2*Wt,he.length=he.length-Wt,be.length=be.length-Wt}x(kt,"popStack");function qe(){var Wt;return Wt=ge.pop()||Be.lex()||Ke,typeof Wt!="number"&&(Wt instanceof Array&&(ge=Wt,Wt=ge.pop()),Wt=oe.symbols_[Wt]||Wt),Wt}x(qe,"lex");for(var rt,ct,ut,nt,bt={},Zt,Ot,tr,xr;;){if(ct=se[se.length-1],this.defaultActions[ct]?ut=this.defaultActions[ct]:((rt===null||typeof rt>"u")&&(rt=qe()),ut=Ce[ct]&&Ce[ct][rt]),typeof ut>"u"||!ut.length||!ut[0]){var rr="";xr=[];for(Zt in Ce[ct])this.terminals_[Zt]&&Zt>Ye&&xr.push("'"+this.terminals_[Zt]+"'");Be.showPosition?rr="Parse error on line "+(Ne+1)+`:
`+Be.showPosition()+`
Expecting `+xr.join(", ")+", got '"+(this.terminals_[rt]||rt)+"'":rr="Parse error on line "+(Ne+1)+": Unexpected "+(rt==Ke?"end of input":"'"+(this.terminals_[rt]||rt)+"'"),this.parseError(rr,{text:Be.match,token:this.terminals_[rt]||rt,line:Be.yylineno,loc:st,expected:xr})}if(ut[0]instanceof Array&&ut.length>1)throw new Error("Parse Error: multiple actions possible at state: "+ct+", token: "+rt);switch(ut[0]){case 1:se.push(rt),he.push(Be.yytext),be.push(Be.yylloc),se.push(ut[1]),rt=null,Xe=Be.yyleng,Te=Be.yytext,Ne=Be.yylineno,st=Be.yylloc;break;case 2:if(Ot=this.productions_[ut[1]][1],bt.$=he[he.length-Ot],bt._$={first_line:be[be.length-(Ot||1)].first_line,last_line:be[be.length-1].last_line,first_column:be[be.length-(Ot||1)].first_column,last_column:be[be.length-1].last_column},We&&(bt._$.range=[be[be.length-(Ot||1)].range[0],be[be.length-1].range[1]]),nt=this.performAction.apply(bt,[Te,Xe,Ne,He.yy,ut[1],he,be].concat(Ze)),typeof nt<"u")return nt;Ot&&(se=se.slice(0,-1*Ot*2),he=he.slice(0,-1*Ot),be=be.slice(0,-1*Ot)),se.push(this.productions_[ut[1]][0]),he.push(bt.$),be.push(bt._$),tr=Ce[se[se.length-2]][se[se.length-1]],se.push(tr);break;case 3:return!0}}return!0},"parse")},De=function(){var ce={EOF:1,parseError:x(function(oe,se){if(this.yy.parser)this.yy.parser.parseError(oe,se);else throw new Error(oe)},"parseError"),setInput:x(function(z,oe){return this.yy=oe||this.yy||{},this._input=z,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:x(function(){var z=this._input[0];this.yytext+=z,this.yyleng++,this.offset++,this.match+=z,this.matched+=z;var oe=z.match(/(?:\r\n?|\n).*/g);return oe?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),z},"input"),unput:x(function(z){var oe=z.length,se=z.split(/(?:\r\n?|\n)/g);this._input=z+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-oe),this.offset-=oe;var ge=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),se.length-1&&(this.yylineno-=se.length-1);var he=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:se?(se.length===ge.length?this.yylloc.first_column:0)+ge[ge.length-se.length].length-se[0].length:this.yylloc.first_column-oe},this.options.ranges&&(this.yylloc.range=[he[0],he[0]+this.yyleng-oe]),this.yyleng=this.yytext.length,this},"unput"),more:x(function(){return this._more=!0,this},"more"),reject:x(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:x(function(z){this.unput(this.match.slice(z))},"less"),pastInput:x(function(){var z=this.matched.substr(0,this.matched.length-this.match.length);return(z.length>20?"...":"")+z.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:x(function(){var z=this.match;return z.length<20&&(z+=this._input.substr(0,20-z.length)),(z.substr(0,20)+(z.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:x(function(){var z=this.pastInput(),oe=new Array(z.length+1).join("-");return z+this.upcomingInput()+`
`+oe+"^"},"showPosition"),test_match:x(function(z,oe){var se,ge,he;if(this.options.backtrack_lexer&&(he={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(he.yylloc.range=this.yylloc.range.slice(0))),ge=z[0].match(/(?:\r\n?|\n).*/g),ge&&(this.yylineno+=ge.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:ge?ge[ge.length-1].length-ge[ge.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+z[0].length},this.yytext+=z[0],this.match+=z[0],this.matches=z,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(z[0].length),this.matched+=z[0],se=this.performAction.call(this,this.yy,this,oe,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),se)return se;if(this._backtrack){for(var be in he)this[be]=he[be];return!1}return!1},"test_match"),next:x(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var z,oe,se,ge;this._more||(this.yytext="",this.match="");for(var he=this._currentRules(),be=0;be<he.length;be++)if(se=this._input.match(this.rules[he[be]]),se&&(!oe||se[0].length>oe[0].length)){if(oe=se,ge=be,this.options.backtrack_lexer){if(z=this.test_match(se,he[be]),z!==!1)return z;if(this._backtrack){oe=!1;continue}else return!1}else if(!this.options.flex)break}return oe?(z=this.test_match(oe,he[ge]),z!==!1?z:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var oe=this.next();return oe||this.lex()},"lex"),begin:x(function(oe){this.conditionStack.push(oe)},"begin"),popState:x(function(){var oe=this.conditionStack.length-1;return oe>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(oe){return oe=this.conditionStack.length-1-Math.abs(oe||0),oe>=0?this.conditionStack[oe]:"INITIAL"},"topState"),pushState:x(function(oe){this.begin(oe)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:x(function(oe,se,ge,he){switch(ge){case 0:break;case 1:break;case 2:return 55;case 3:break;case 4:return this.begin("title"),35;case 5:return this.popState(),"title_value";case 6:return this.begin("acc_title"),37;case 7:return this.popState(),"acc_title_value";case 8:return this.begin("acc_descr"),39;case 9:return this.popState(),"acc_descr_value";case 10:this.begin("acc_descr_multiline");break;case 11:this.popState();break;case 12:return"acc_descr_multiline_value";case 13:return 48;case 14:return 50;case 15:return 49;case 16:return 51;case 17:return 52;case 18:return 53;case 19:return 54;case 20:return 25;case 21:this.begin("md_string");break;case 22:return"MD_STR";case 23:this.popState();break;case 24:this.begin("string");break;case 25:this.popState();break;case 26:return"STR";case 27:this.begin("class_name");break;case 28:return this.popState(),47;case 29:return this.begin("point_start"),44;case 30:return this.begin("point_x"),45;case 31:this.popState();break;case 32:this.popState(),this.begin("point_y");break;case 33:return this.popState(),46;case 34:return 28;case 35:return 4;case 36:return 11;case 37:return 64;case 38:return 10;case 39:return 65;case 40:return 65;case 41:return 14;case 42:return 13;case 43:return 67;case 44:return 66;case 45:return 12;case 46:return 8;case 47:return 5;case 48:return 18;case 49:return 56;case 50:return 63;case 51:return 57}},"anonymous"),rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:title\b)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?: *x-axis *)/i,/^(?: *y-axis *)/i,/^(?: *--+> *)/i,/^(?: *quadrant-1 *)/i,/^(?: *quadrant-2 *)/i,/^(?: *quadrant-3 *)/i,/^(?: *quadrant-4 *)/i,/^(?:classDef\b)/i,/^(?:["][`])/i,/^(?:[^`"]+)/i,/^(?:[`]["])/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?::::)/i,/^(?:^\w+)/i,/^(?:\s*:\s*\[\s*)/i,/^(?:(1)|(0(.\d+)?))/i,/^(?:\s*\] *)/i,/^(?:\s*,\s*)/i,/^(?:(1)|(0(.\d+)?))/i,/^(?: *quadrantChart *)/i,/^(?:[A-Za-z]+)/i,/^(?::)/i,/^(?:\+)/i,/^(?:,)/i,/^(?:=)/i,/^(?:=)/i,/^(?:\*)/i,/^(?:#)/i,/^(?:[\_])/i,/^(?:\.)/i,/^(?:&)/i,/^(?:-)/i,/^(?:[0-9]+)/i,/^(?:\s)/i,/^(?:;)/i,/^(?:[!"#$%&'*+,-.`?\\_/])/i,/^(?:$)/i],conditions:{class_name:{rules:[28],inclusive:!1},point_y:{rules:[33],inclusive:!1},point_x:{rules:[32],inclusive:!1},point_start:{rules:[30,31],inclusive:!1},acc_descr_multiline:{rules:[11,12],inclusive:!1},acc_descr:{rules:[9],inclusive:!1},acc_title:{rules:[7],inclusive:!1},title:{rules:[5],inclusive:!1},md_string:{rules:[22,23],inclusive:!1},string:{rules:[25,26],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,6,8,10,13,14,15,16,17,18,19,20,21,24,27,29,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51],inclusive:!0}}};return ce}();me.lexer=De;function Q(){this.yy={}}return x(Q,"Parser"),Q.prototype=me,me.Parser=Q,new Q}();yT.parser=yT;var J7e=yT,Mi=Py(),eCe=class{constructor(){this.classes=new Map,this.config=this.getDefaultConfig(),this.themeConfig=this.getDefaultThemeConfig(),this.data=this.getDefaultData()}static{x(this,"QuadrantBuilder")}getDefaultData(){return{titleText:"",quadrant1Text:"",quadrant2Text:"",quadrant3Text:"",quadrant4Text:"",xAxisLeftText:"",xAxisRightText:"",yAxisBottomText:"",yAxisTopText:"",points:[]}}getDefaultConfig(){return{showXAxis:!0,showYAxis:!0,showTitle:!0,chartHeight:hr.quadrantChart?.chartWidth||500,chartWidth:hr.quadrantChart?.chartHeight||500,titlePadding:hr.quadrantChart?.titlePadding||10,titleFontSize:hr.quadrantChart?.titleFontSize||20,quadrantPadding:hr.quadrantChart?.quadrantPadding||5,xAxisLabelPadding:hr.quadrantChart?.xAxisLabelPadding||5,yAxisLabelPadding:hr.quadrantChart?.yAxisLabelPadding||5,xAxisLabelFontSize:hr.quadrantChart?.xAxisLabelFontSize||16,yAxisLabelFontSize:hr.quadrantChart?.yAxisLabelFontSize||16,quadrantLabelFontSize:hr.quadrantChart?.quadrantLabelFontSize||16,quadrantTextTopPadding:hr.quadrantChart?.quadrantTextTopPadding||5,pointTextPadding:hr.quadrantChart?.pointTextPadding||5,pointLabelFontSize:hr.quadrantChart?.pointLabelFontSize||12,pointRadius:hr.quadrantChart?.pointRadius||5,xAxisPosition:hr.quadrantChart?.xAxisPosition||"top",yAxisPosition:hr.quadrantChart?.yAxisPosition||"left",quadrantInternalBorderStrokeWidth:hr.quadrantChart?.quadrantInternalBorderStrokeWidth||1,quadrantExternalBorderStrokeWidth:hr.quadrantChart?.quadrantExternalBorderStrokeWidth||2}}getDefaultThemeConfig(){return{quadrant1Fill:Mi.quadrant1Fill,quadrant2Fill:Mi.quadrant2Fill,quadrant3Fill:Mi.quadrant3Fill,quadrant4Fill:Mi.quadrant4Fill,quadrant1TextFill:Mi.quadrant1TextFill,quadrant2TextFill:Mi.quadrant2TextFill,quadrant3TextFill:Mi.quadrant3TextFill,quadrant4TextFill:Mi.quadrant4TextFill,quadrantPointFill:Mi.quadrantPointFill,quadrantPointTextFill:Mi.quadrantPointTextFill,quadrantXAxisTextFill:Mi.quadrantXAxisTextFill,quadrantYAxisTextFill:Mi.quadrantYAxisTextFill,quadrantTitleFill:Mi.quadrantTitleFill,quadrantInternalBorderStrokeFill:Mi.quadrantInternalBorderStrokeFill,quadrantExternalBorderStrokeFill:Mi.quadrantExternalBorderStrokeFill}}clear(){this.config=this.getDefaultConfig(),this.themeConfig=this.getDefaultThemeConfig(),this.data=this.getDefaultData(),this.classes=new Map,ie.info("clear called")}setData(t){this.data={...this.data,...t}}addPoints(t){this.data.points=[...t,...this.data.points]}addClass(t,e){this.classes.set(t,e)}setConfig(t){ie.trace("setConfig called with: ",t),this.config={...this.config,...t}}setThemeConfig(t){ie.trace("setThemeConfig called with: ",t),this.themeConfig={...this.themeConfig,...t}}calculateSpace(t,e,r,n){const i=this.config.xAxisLabelPadding*2+this.config.xAxisLabelFontSize,a={top:t==="top"&&e?i:0,bottom:t==="bottom"&&e?i:0},s=this.config.yAxisLabelPadding*2+this.config.yAxisLabelFontSize,o={left:this.config.yAxisPosition==="left"&&r?s:0,right:this.config.yAxisPosition==="right"&&r?s:0},l=this.config.titleFontSize+this.config.titlePadding*2,u={top:n?l:0},h=this.config.quadrantPadding+o.left,d=this.config.quadrantPadding+a.top+u.top,f=this.config.chartWidth-this.config.quadrantPadding*2-o.left-o.right,p=this.config.chartHeight-this.config.quadrantPadding*2-a.top-a.bottom-u.top,g=f/2,m=p/2;return{xAxisSpace:a,yAxisSpace:o,titleSpace:u,quadrantSpace:{quadrantLeft:h,quadrantTop:d,quadrantWidth:f,quadrantHalfWidth:g,quadrantHeight:p,quadrantHalfHeight:m}}}getAxisLabels(t,e,r,n){const{quadrantSpace:i,titleSpace:a}=n,{quadrantHalfHeight:s,quadrantHeight:o,quadrantLeft:l,quadrantHalfWidth:u,quadrantTop:h,quadrantWidth:d}=i,f=!!this.data.xAxisRightText,p=!!this.data.yAxisTopText,g=[];return this.data.xAxisLeftText&&e&&g.push({text:this.data.xAxisLeftText,fill:this.themeConfig.quadrantXAxisTextFill,x:l+(f?u/2:0),y:t==="top"?this.config.xAxisLabelPadding+a.top:this.config.xAxisLabelPadding+h+o+this.config.quadrantPadding,fontSize:this.config.xAxisLabelFontSize,verticalPos:f?"center":"left",horizontalPos:"top",rotation:0}),this.data.xAxisRightText&&e&&g.push({text:this.data.xAxisRightText,fill:this.themeConfig.quadrantXAxisTextFill,x:l+u+(f?u/2:0),y:t==="top"?this.config.xAxisLabelPadding+a.top:this.config.xAxisLabelPadding+h+o+this.config.quadrantPadding,fontSize:this.config.xAxisLabelFontSize,verticalPos:f?"center":"left",horizontalPos:"top",rotation:0}),this.data.yAxisBottomText&&r&&g.push({text:this.data.yAxisBottomText,fill:this.themeConfig.quadrantYAxisTextFill,x:this.config.yAxisPosition==="left"?this.config.yAxisLabelPadding:this.config.yAxisLabelPadding+l+d+this.config.quadrantPadding,y:h+o-(p?s/2:0),fontSize:this.config.yAxisLabelFontSize,verticalPos:p?"center":"left",horizontalPos:"top",rotation:-90}),this.data.yAxisTopText&&r&&g.push({text:this.data.yAxisTopText,fill:this.themeConfig.quadrantYAxisTextFill,x:this.config.yAxisPosition==="left"?this.config.yAxisLabelPadding:this.config.yAxisLabelPadding+l+d+this.config.quadrantPadding,y:h+s-(p?s/2:0),fontSize:this.config.yAxisLabelFontSize,verticalPos:p?"center":"left",horizontalPos:"top",rotation:-90}),g}getQuadrants(t){const{quadrantSpace:e}=t,{quadrantHalfHeight:r,quadrantLeft:n,quadrantHalfWidth:i,quadrantTop:a}=e,s=[{text:{text:this.data.quadrant1Text,fill:this.themeConfig.quadrant1TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:"center",horizontalPos:"middle",rotation:0},x:n+i,y:a,width:i,height:r,fill:this.themeConfig.quadrant1Fill},{text:{text:this.data.quadrant2Text,fill:this.themeConfig.quadrant2TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:"center",horizontalPos:"middle",rotation:0},x:n,y:a,width:i,height:r,fill:this.themeConfig.quadrant2Fill},{text:{text:this.data.quadrant3Text,fill:this.themeConfig.quadrant3TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:"center",horizontalPos:"middle",rotation:0},x:n,y:a+r,width:i,height:r,fill:this.themeConfig.quadrant3Fill},{text:{text:this.data.quadrant4Text,fill:this.themeConfig.quadrant4TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:"center",horizontalPos:"middle",rotation:0},x:n+i,y:a+r,width:i,height:r,fill:this.themeConfig.quadrant4Fill}];for(const o of s)o.text.x=o.x+o.width/2,this.data.points.length===0?(o.text.y=o.y+o.height/2,o.text.horizontalPos="middle"):(o.text.y=o.y+this.config.quadrantTextTopPadding,o.text.horizontalPos="top");return s}getQuadrantPoints(t){const{quadrantSpace:e}=t,{quadrantHeight:r,quadrantLeft:n,quadrantTop:i,quadrantWidth:a}=e,s=Hh().domain([0,1]).range([n,a+n]),o=Hh().domain([0,1]).range([r+i,i]);return this.data.points.map(u=>{const h=this.classes.get(u.className);return h&&(u={...h,...u}),{x:s(u.x),y:o(u.y),fill:u.color??this.themeConfig.quadrantPointFill,radius:u.radius??this.config.pointRadius,text:{text:u.text,fill:this.themeConfig.quadrantPointTextFill,x:s(u.x),y:o(u.y)+this.config.pointTextPadding,verticalPos:"center",horizontalPos:"top",fontSize:this.config.pointLabelFontSize,rotation:0},strokeColor:u.strokeColor??this.themeConfig.quadrantPointFill,strokeWidth:u.strokeWidth??"0px"}})}getBorders(t){const e=this.config.quadrantExternalBorderStrokeWidth/2,{quadrantSpace:r}=t,{quadrantHalfHeight:n,quadrantHeight:i,quadrantLeft:a,quadrantHalfWidth:s,quadrantTop:o,quadrantWidth:l}=r;return[{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:a-e,y1:o,x2:a+l+e,y2:o},{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:a+l,y1:o+e,x2:a+l,y2:o+i-e},{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:a-e,y1:o+i,x2:a+l+e,y2:o+i},{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:a,y1:o+e,x2:a,y2:o+i-e},{strokeFill:this.themeConfig.quadrantInternalBorderStrokeFill,strokeWidth:this.config.quadrantInternalBorderStrokeWidth,x1:a+s,y1:o+e,x2:a+s,y2:o+i-e},{strokeFill:this.themeConfig.quadrantInternalBorderStrokeFill,strokeWidth:this.config.quadrantInternalBorderStrokeWidth,x1:a+e,y1:o+n,x2:a+l-e,y2:o+n}]}getTitle(t){if(t)return{text:this.data.titleText,fill:this.themeConfig.quadrantTitleFill,fontSize:this.config.titleFontSize,horizontalPos:"top",verticalPos:"center",rotation:0,y:this.config.titlePadding,x:this.config.chartWidth/2}}build(){const t=this.config.showXAxis&&!!(this.data.xAxisLeftText||this.data.xAxisRightText),e=this.config.showYAxis&&!!(this.data.yAxisTopText||this.data.yAxisBottomText),r=this.config.showTitle&&!!this.data.titleText,n=this.data.points.length>0?"bottom":this.config.xAxisPosition,i=this.calculateSpace(n,t,e,r);return{points:this.getQuadrantPoints(i),quadrants:this.getQuadrants(i),axisLabels:this.getAxisLabels(n,t,e,i),borderLines:this.getBorders(i),title:this.getTitle(r)}}},_1=class extends Error{static{x(this,"InvalidStyleError")}constructor(t,e,r){super(`value for ${t} ${e} is invalid, please use a valid ${r}`),this.name="InvalidStyleError"}};function xT(t){return!/^#?([\dA-Fa-f]{6}|[\dA-Fa-f]{3})$/.test(t)}x(xT,"validateHexCode");function RW(t){return!/^\d+$/.test(t)}x(RW,"validateNumber");function NW(t){return!/^\d+px$/.test(t)}x(NW,"validateSizeInPixels");var tCe=we();function ho(t){return fr(t.trim(),tCe)}x(ho,"textSanitizer");var oi=new eCe;function DW(t){oi.setData({quadrant1Text:ho(t.text)})}x(DW,"setQuadrant1Text");function MW(t){oi.setData({quadrant2Text:ho(t.text)})}x(MW,"setQuadrant2Text");function IW(t){oi.setData({quadrant3Text:ho(t.text)})}x(IW,"setQuadrant3Text");function OW(t){oi.setData({quadrant4Text:ho(t.text)})}x(OW,"setQuadrant4Text");function PW(t){oi.setData({xAxisLeftText:ho(t.text)})}x(PW,"setXAxisLeftText");function BW(t){oi.setData({xAxisRightText:ho(t.text)})}x(BW,"setXAxisRightText");function FW(t){oi.setData({yAxisTopText:ho(t.text)})}x(FW,"setYAxisTopText");function $W(t){oi.setData({yAxisBottomText:ho(t.text)})}x($W,"setYAxisBottomText");function cx(t){const e={};for(const r of t){const[n,i]=r.trim().split(/\s*:\s*/);if(n==="radius"){if(RW(i))throw new _1(n,i,"number");e.radius=parseInt(i)}else if(n==="color"){if(xT(i))throw new _1(n,i,"hex code");e.color=i}else if(n==="stroke-color"){if(xT(i))throw new _1(n,i,"hex code");e.strokeColor=i}else if(n==="stroke-width"){if(NW(i))throw new _1(n,i,"number of pixels (eg. 10px)");e.strokeWidth=i}else throw new Error(`style named ${n} is not supported.`)}return e}x(cx,"parseStyles");function zW(t,e,r,n,i){const a=cx(i);oi.addPoints([{x:r,y:n,text:ho(t.text),className:e,...a}])}x(zW,"addPoint");function VW(t,e){oi.addClass(t,cx(e))}x(VW,"addClass");function GW(t){oi.setConfig({chartWidth:t})}x(GW,"setWidth");function UW(t){oi.setConfig({chartHeight:t})}x(UW,"setHeight");function WW(){const t=we(),{themeVariables:e,quadrantChart:r}=t;return r&&oi.setConfig(r),oi.setThemeConfig({quadrant1Fill:e.quadrant1Fill,quadrant2Fill:e.quadrant2Fill,quadrant3Fill:e.quadrant3Fill,quadrant4Fill:e.quadrant4Fill,quadrant1TextFill:e.quadrant1TextFill,quadrant2TextFill:e.quadrant2TextFill,quadrant3TextFill:e.quadrant3TextFill,quadrant4TextFill:e.quadrant4TextFill,quadrantPointFill:e.quadrantPointFill,quadrantPointTextFill:e.quadrantPointTextFill,quadrantXAxisTextFill:e.quadrantXAxisTextFill,quadrantYAxisTextFill:e.quadrantYAxisTextFill,quadrantExternalBorderStrokeFill:e.quadrantExternalBorderStrokeFill,quadrantInternalBorderStrokeFill:e.quadrantInternalBorderStrokeFill,quadrantTitleFill:e.quadrantTitleFill}),oi.setData({titleText:_n()}),oi.build()}x(WW,"getQuadrantData");var rCe=x(function(){oi.clear(),An()},"clear"),nCe={setWidth:GW,setHeight:UW,setQuadrant1Text:DW,setQuadrant2Text:MW,setQuadrant3Text:IW,setQuadrant4Text:OW,setXAxisLeftText:PW,setXAxisRightText:BW,setYAxisTopText:FW,setYAxisBottomText:$W,parseStyles:cx,addPoint:zW,addClass:VW,getQuadrantData:WW,clear:rCe,setAccTitle:Sn,getAccTitle:zn,setDiagramTitle:Zn,getDiagramTitle:_n,getAccDescription:Gn,setAccDescription:Vn},iCe=x((t,e,r,n)=>{function i(C){return C==="top"?"hanging":"middle"}x(i,"getDominantBaseLine");function a(C){return C==="left"?"start":"middle"}x(a,"getTextAnchor");function s(C){return`translate(${C.x}, ${C.y}) rotate(${C.rotation||0})`}x(s,"getTransformation");const o=we();ie.debug(`Rendering quadrant chart
`+t);const l=o.securityLevel;let u;l==="sandbox"&&(u=Qe("#i"+e));const d=Qe(l==="sandbox"?u.nodes()[0].contentDocument.body:"body").select(`[id="${e}"]`),f=d.append("g").attr("class","main"),p=o.quadrantChart?.chartWidth??500,g=o.quadrantChart?.chartHeight??500;ji(d,g,p,o.quadrantChart?.useMaxWidth??!0),d.attr("viewBox","0 0 "+p+" "+g),n.db.setHeight(g),n.db.setWidth(p);const m=n.db.getQuadrantData(),v=f.append("g").attr("class","quadrants"),y=f.append("g").attr("class","border"),b=f.append("g").attr("class","data-points"),w=f.append("g").attr("class","labels"),T=f.append("g").attr("class","title");m.title&&T.append("text").attr("x",0).attr("y",0).attr("fill",m.title.fill).attr("font-size",m.title.fontSize).attr("dominant-baseline",i(m.title.horizontalPos)).attr("text-anchor",a(m.title.verticalPos)).attr("transform",s(m.title)).text(m.title.text),m.borderLines&&y.selectAll("line").data(m.borderLines).enter().append("line").attr("x1",C=>C.x1).attr("y1",C=>C.y1).attr("x2",C=>C.x2).attr("y2",C=>C.y2).style("stroke",C=>C.strokeFill).style("stroke-width",C=>C.strokeWidth);const E=v.selectAll("g.quadrant").data(m.quadrants).enter().append("g").attr("class","quadrant");E.append("rect").attr("x",C=>C.x).attr("y",C=>C.y).attr("width",C=>C.width).attr("height",C=>C.height).attr("fill",C=>C.fill),E.append("text").attr("x",0).attr("y",0).attr("fill",C=>C.text.fill).attr("font-size",C=>C.text.fontSize).attr("dominant-baseline",C=>i(C.text.horizontalPos)).attr("text-anchor",C=>a(C.text.verticalPos)).attr("transform",C=>s(C.text)).text(C=>C.text.text),w.selectAll("g.label").data(m.axisLabels).enter().append("g").attr("class","label").append("text").attr("x",0).attr("y",0).text(C=>C.text).attr("fill",C=>C.fill).attr("font-size",C=>C.fontSize).attr("dominant-baseline",C=>i(C.horizontalPos)).attr("text-anchor",C=>a(C.verticalPos)).attr("transform",C=>s(C));const S=b.selectAll("g.data-point").data(m.points).enter().append("g").attr("class","data-point");S.append("circle").attr("cx",C=>C.x).attr("cy",C=>C.y).attr("r",C=>C.radius).attr("fill",C=>C.fill).attr("stroke",C=>C.strokeColor).attr("stroke-width",C=>C.strokeWidth),S.append("text").attr("x",0).attr("y",0).text(C=>C.text.text).attr("fill",C=>C.text.fill).attr("font-size",C=>C.text.fontSize).attr("dominant-baseline",C=>i(C.text.horizontalPos)).attr("text-anchor",C=>a(C.text.verticalPos)).attr("transform",C=>s(C.text))},"draw"),aCe={draw:iCe},sCe={parser:J7e,db:nCe,renderer:aCe,styles:x(()=>"","styles")};const oCe=Object.freeze(Object.defineProperty({__proto__:null,diagram:sCe},Symbol.toStringTag,{value:"Module"}));var bT=function(){var t=x(function(R,I,M,D){for(M=M||{},D=R.length;D--;M[R[D]]=I);return M},"o"),e=[1,10,12,14,16,18,19,21,23],r=[2,6],n=[1,3],i=[1,5],a=[1,6],s=[1,7],o=[1,5,10,12,14,16,18,19,21,23,34,35,36],l=[1,25],u=[1,26],h=[1,28],d=[1,29],f=[1,30],p=[1,31],g=[1,32],m=[1,33],v=[1,34],y=[1,35],b=[1,36],w=[1,37],T=[1,43],E=[1,42],L=[1,47],S=[1,50],C=[1,10,12,14,16,18,19,21,23,34,35,36],A=[1,10,12,14,16,18,19,21,23,24,26,27,28,34,35,36],N=[1,10,12,14,16,18,19,21,23,24,26,27,28,34,35,36,41,42,43,44,45,46,47,48,49,50],_=[1,64],O={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,start:3,eol:4,XYCHART:5,chartConfig:6,document:7,CHART_ORIENTATION:8,statement:9,title:10,text:11,X_AXIS:12,parseXAxis:13,Y_AXIS:14,parseYAxis:15,LINE:16,plotData:17,BAR:18,acc_title:19,acc_title_value:20,acc_descr:21,acc_descr_value:22,acc_descr_multiline_value:23,SQUARE_BRACES_START:24,commaSeparatedNumbers:25,SQUARE_BRACES_END:26,NUMBER_WITH_DECIMAL:27,COMMA:28,xAxisData:29,bandData:30,ARROW_DELIMITER:31,commaSeparatedTexts:32,yAxisData:33,NEWLINE:34,SEMI:35,EOF:36,alphaNum:37,STR:38,MD_STR:39,alphaNumToken:40,AMP:41,NUM:42,ALPHA:43,PLUS:44,EQUALS:45,MULT:46,DOT:47,BRKT:48,MINUS:49,UNDERSCORE:50,$accept:0,$end:1},terminals_:{2:"error",5:"XYCHART",8:"CHART_ORIENTATION",10:"title",12:"X_AXIS",14:"Y_AXIS",16:"LINE",18:"BAR",19:"acc_title",20:"acc_title_value",21:"acc_descr",22:"acc_descr_value",23:"acc_descr_multiline_value",24:"SQUARE_BRACES_START",26:"SQUARE_BRACES_END",27:"NUMBER_WITH_DECIMAL",28:"COMMA",31:"ARROW_DELIMITER",34:"NEWLINE",35:"SEMI",36:"EOF",38:"STR",39:"MD_STR",41:"AMP",42:"NUM",43:"ALPHA",44:"PLUS",45:"EQUALS",46:"MULT",47:"DOT",48:"BRKT",49:"MINUS",50:"UNDERSCORE"},productions_:[0,[3,2],[3,3],[3,2],[3,1],[6,1],[7,0],[7,2],[9,2],[9,2],[9,2],[9,2],[9,2],[9,3],[9,2],[9,3],[9,2],[9,2],[9,1],[17,3],[25,3],[25,1],[13,1],[13,2],[13,1],[29,1],[29,3],[30,3],[32,3],[32,1],[15,1],[15,2],[15,1],[33,3],[4,1],[4,1],[4,1],[11,1],[11,1],[11,1],[37,1],[37,2],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1]],performAction:x(function(I,M,D,B,$,F,G){var W=F.length-1;switch($){case 5:B.setOrientation(F[W]);break;case 9:B.setDiagramTitle(F[W].text.trim());break;case 12:B.setLineData({text:"",type:"text"},F[W]);break;case 13:B.setLineData(F[W-1],F[W]);break;case 14:B.setBarData({text:"",type:"text"},F[W]);break;case 15:B.setBarData(F[W-1],F[W]);break;case 16:this.$=F[W].trim(),B.setAccTitle(this.$);break;case 17:case 18:this.$=F[W].trim(),B.setAccDescription(this.$);break;case 19:this.$=F[W-1];break;case 20:this.$=[Number(F[W-2]),...F[W]];break;case 21:this.$=[Number(F[W])];break;case 22:B.setXAxisTitle(F[W]);break;case 23:B.setXAxisTitle(F[W-1]);break;case 24:B.setXAxisTitle({type:"text",text:""});break;case 25:B.setXAxisBand(F[W]);break;case 26:B.setXAxisRangeData(Number(F[W-2]),Number(F[W]));break;case 27:this.$=F[W-1];break;case 28:this.$=[F[W-2],...F[W]];break;case 29:this.$=[F[W]];break;case 30:B.setYAxisTitle(F[W]);break;case 31:B.setYAxisTitle(F[W-1]);break;case 32:B.setYAxisTitle({type:"text",text:""});break;case 33:B.setYAxisRangeData(Number(F[W-2]),Number(F[W]));break;case 37:this.$={text:F[W],type:"text"};break;case 38:this.$={text:F[W],type:"text"};break;case 39:this.$={text:F[W],type:"markdown"};break;case 40:this.$=F[W];break;case 41:this.$=F[W-1]+""+F[W];break}},"anonymous"),table:[t(e,r,{3:1,4:2,7:4,5:n,34:i,35:a,36:s}),{1:[3]},t(e,r,{4:2,7:4,3:8,5:n,34:i,35:a,36:s}),t(e,r,{4:2,7:4,6:9,3:10,5:n,8:[1,11],34:i,35:a,36:s}),{1:[2,4],9:12,10:[1,13],12:[1,14],14:[1,15],16:[1,16],18:[1,17],19:[1,18],21:[1,19],23:[1,20]},t(o,[2,34]),t(o,[2,35]),t(o,[2,36]),{1:[2,1]},t(e,r,{4:2,7:4,3:21,5:n,34:i,35:a,36:s}),{1:[2,3]},t(o,[2,5]),t(e,[2,7],{4:22,34:i,35:a,36:s}),{11:23,37:24,38:l,39:u,40:27,41:h,42:d,43:f,44:p,45:g,46:m,47:v,48:y,49:b,50:w},{11:39,13:38,24:T,27:E,29:40,30:41,37:24,38:l,39:u,40:27,41:h,42:d,43:f,44:p,45:g,46:m,47:v,48:y,49:b,50:w},{11:45,15:44,27:L,33:46,37:24,38:l,39:u,40:27,41:h,42:d,43:f,44:p,45:g,46:m,47:v,48:y,49:b,50:w},{11:49,17:48,24:S,37:24,38:l,39:u,40:27,41:h,42:d,43:f,44:p,45:g,46:m,47:v,48:y,49:b,50:w},{11:52,17:51,24:S,37:24,38:l,39:u,40:27,41:h,42:d,43:f,44:p,45:g,46:m,47:v,48:y,49:b,50:w},{20:[1,53]},{22:[1,54]},t(C,[2,18]),{1:[2,2]},t(C,[2,8]),t(C,[2,9]),t(A,[2,37],{40:55,41:h,42:d,43:f,44:p,45:g,46:m,47:v,48:y,49:b,50:w}),t(A,[2,38]),t(A,[2,39]),t(N,[2,40]),t(N,[2,42]),t(N,[2,43]),t(N,[2,44]),t(N,[2,45]),t(N,[2,46]),t(N,[2,47]),t(N,[2,48]),t(N,[2,49]),t(N,[2,50]),t(N,[2,51]),t(C,[2,10]),t(C,[2,22],{30:41,29:56,24:T,27:E}),t(C,[2,24]),t(C,[2,25]),{31:[1,57]},{11:59,32:58,37:24,38:l,39:u,40:27,41:h,42:d,43:f,44:p,45:g,46:m,47:v,48:y,49:b,50:w},t(C,[2,11]),t(C,[2,30],{33:60,27:L}),t(C,[2,32]),{31:[1,61]},t(C,[2,12]),{17:62,24:S},{25:63,27:_},t(C,[2,14]),{17:65,24:S},t(C,[2,16]),t(C,[2,17]),t(N,[2,41]),t(C,[2,23]),{27:[1,66]},{26:[1,67]},{26:[2,29],28:[1,68]},t(C,[2,31]),{27:[1,69]},t(C,[2,13]),{26:[1,70]},{26:[2,21],28:[1,71]},t(C,[2,15]),t(C,[2,26]),t(C,[2,27]),{11:59,32:72,37:24,38:l,39:u,40:27,41:h,42:d,43:f,44:p,45:g,46:m,47:v,48:y,49:b,50:w},t(C,[2,33]),t(C,[2,19]),{25:73,27:_},{26:[2,28]},{26:[2,20]}],defaultActions:{8:[2,1],10:[2,3],21:[2,2],72:[2,28],73:[2,20]},parseError:x(function(I,M){if(M.recoverable)this.trace(I);else{var D=new Error(I);throw D.hash=M,D}},"parseError"),parse:x(function(I){var M=this,D=[0],B=[],$=[null],F=[],G=this.table,W="",J=0,q=0,ne=2,ae=1,pe=F.slice.call(arguments,1),K=Object.create(this.lexer),Z={yy:{}};for(var X in this.yy)Object.prototype.hasOwnProperty.call(this.yy,X)&&(Z.yy[X]=this.yy[X]);K.setInput(I,Z.yy),Z.yy.lexer=K,Z.yy.parser=this,typeof K.yylloc>"u"&&(K.yylloc={});var Y=K.yylloc;F.push(Y);var ee=K.options&&K.options.ranges;typeof Z.yy.parseError=="function"?this.parseError=Z.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function j(Se){D.length=D.length-2*Se,$.length=$.length-Se,F.length=F.length-Se}x(j,"popStack");function fe(){var Se;return Se=B.pop()||K.lex()||ae,typeof Se!="number"&&(Se instanceof Array&&(B=Se,Se=B.pop()),Se=M.symbols_[Se]||Se),Se}x(fe,"lex");for(var te,Ae,H,Oe,ue={},Ve,Ge,Ue,ke;;){if(Ae=D[D.length-1],this.defaultActions[Ae]?H=this.defaultActions[Ae]:((te===null||typeof te>"u")&&(te=fe()),H=G[Ae]&&G[Ae][te]),typeof H>"u"||!H.length||!H[0]){var Pe="";ke=[];for(Ve in G[Ae])this.terminals_[Ve]&&Ve>ne&&ke.push("'"+this.terminals_[Ve]+"'");K.showPosition?Pe="Parse error on line "+(J+1)+`:
`+K.showPosition()+`
Expecting `+ke.join(", ")+", got '"+(this.terminals_[te]||te)+"'":Pe="Parse error on line "+(J+1)+": Unexpected "+(te==ae?"end of input":"'"+(this.terminals_[te]||te)+"'"),this.parseError(Pe,{text:K.match,token:this.terminals_[te]||te,line:K.yylineno,loc:Y,expected:ke})}if(H[0]instanceof Array&&H.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Ae+", token: "+te);switch(H[0]){case 1:D.push(te),$.push(K.yytext),F.push(K.yylloc),D.push(H[1]),te=null,q=K.yyleng,W=K.yytext,J=K.yylineno,Y=K.yylloc;break;case 2:if(Ge=this.productions_[H[1]][1],ue.$=$[$.length-Ge],ue._$={first_line:F[F.length-(Ge||1)].first_line,last_line:F[F.length-1].last_line,first_column:F[F.length-(Ge||1)].first_column,last_column:F[F.length-1].last_column},ee&&(ue._$.range=[F[F.length-(Ge||1)].range[0],F[F.length-1].range[1]]),Oe=this.performAction.apply(ue,[W,q,J,Z.yy,H[1],$,F].concat(pe)),typeof Oe<"u")return Oe;Ge&&(D=D.slice(0,-1*Ge*2),$=$.slice(0,-1*Ge),F=F.slice(0,-1*Ge)),D.push(this.productions_[H[1]][0]),$.push(ue.$),F.push(ue._$),Ue=G[D[D.length-2]][D[D.length-1]],D.push(Ue);break;case 3:return!0}}return!0},"parse")},P=function(){var R={EOF:1,parseError:x(function(M,D){if(this.yy.parser)this.yy.parser.parseError(M,D);else throw new Error(M)},"parseError"),setInput:x(function(I,M){return this.yy=M||this.yy||{},this._input=I,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:x(function(){var I=this._input[0];this.yytext+=I,this.yyleng++,this.offset++,this.match+=I,this.matched+=I;var M=I.match(/(?:\r\n?|\n).*/g);return M?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),I},"input"),unput:x(function(I){var M=I.length,D=I.split(/(?:\r\n?|\n)/g);this._input=I+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-M),this.offset-=M;var B=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),D.length-1&&(this.yylineno-=D.length-1);var $=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:D?(D.length===B.length?this.yylloc.first_column:0)+B[B.length-D.length].length-D[0].length:this.yylloc.first_column-M},this.options.ranges&&(this.yylloc.range=[$[0],$[0]+this.yyleng-M]),this.yyleng=this.yytext.length,this},"unput"),more:x(function(){return this._more=!0,this},"more"),reject:x(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:x(function(I){this.unput(this.match.slice(I))},"less"),pastInput:x(function(){var I=this.matched.substr(0,this.matched.length-this.match.length);return(I.length>20?"...":"")+I.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:x(function(){var I=this.match;return I.length<20&&(I+=this._input.substr(0,20-I.length)),(I.substr(0,20)+(I.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:x(function(){var I=this.pastInput(),M=new Array(I.length+1).join("-");return I+this.upcomingInput()+`
`+M+"^"},"showPosition"),test_match:x(function(I,M){var D,B,$;if(this.options.backtrack_lexer&&($={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&($.yylloc.range=this.yylloc.range.slice(0))),B=I[0].match(/(?:\r\n?|\n).*/g),B&&(this.yylineno+=B.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:B?B[B.length-1].length-B[B.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+I[0].length},this.yytext+=I[0],this.match+=I[0],this.matches=I,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(I[0].length),this.matched+=I[0],D=this.performAction.call(this,this.yy,this,M,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),D)return D;if(this._backtrack){for(var F in $)this[F]=$[F];return!1}return!1},"test_match"),next:x(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var I,M,D,B;this._more||(this.yytext="",this.match="");for(var $=this._currentRules(),F=0;F<$.length;F++)if(D=this._input.match(this.rules[$[F]]),D&&(!M||D[0].length>M[0].length)){if(M=D,B=F,this.options.backtrack_lexer){if(I=this.test_match(D,$[F]),I!==!1)return I;if(this._backtrack){M=!1;continue}else return!1}else if(!this.options.flex)break}return M?(I=this.test_match(M,$[B]),I!==!1?I:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var M=this.next();return M||this.lex()},"lex"),begin:x(function(M){this.conditionStack.push(M)},"begin"),popState:x(function(){var M=this.conditionStack.length-1;return M>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(M){return M=this.conditionStack.length-1-Math.abs(M||0),M>=0?this.conditionStack[M]:"INITIAL"},"topState"),pushState:x(function(M){this.begin(M)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:x(function(M,D,B,$){switch(B){case 0:break;case 1:break;case 2:return this.popState(),34;case 3:return this.popState(),34;case 4:return 34;case 5:break;case 6:return 10;case 7:return this.pushState("acc_title"),19;case 8:return this.popState(),"acc_title_value";case 9:return this.pushState("acc_descr"),21;case 10:return this.popState(),"acc_descr_value";case 11:this.pushState("acc_descr_multiline");break;case 12:this.popState();break;case 13:return"acc_descr_multiline_value";case 14:return 5;case 15:return 5;case 16:return 8;case 17:return this.pushState("axis_data"),"X_AXIS";case 18:return this.pushState("axis_data"),"Y_AXIS";case 19:return this.pushState("axis_band_data"),24;case 20:return 31;case 21:return this.pushState("data"),16;case 22:return this.pushState("data"),18;case 23:return this.pushState("data_inner"),24;case 24:return 27;case 25:return this.popState(),26;case 26:this.popState();break;case 27:this.pushState("string");break;case 28:this.popState();break;case 29:return"STR";case 30:return 24;case 31:return 26;case 32:return 43;case 33:return"COLON";case 34:return 44;case 35:return 28;case 36:return 45;case 37:return 46;case 38:return 48;case 39:return 50;case 40:return 47;case 41:return 41;case 42:return 49;case 43:return 42;case 44:break;case 45:return 35;case 46:return 36}},"anonymous"),rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:(\r?\n))/i,/^(?:(\r?\n))/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:title\b)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:\{)/i,/^(?:[^\}]*)/i,/^(?:xychart-beta\b)/i,/^(?:xychart\b)/i,/^(?:(?:vertical|horizontal))/i,/^(?:x-axis\b)/i,/^(?:y-axis\b)/i,/^(?:\[)/i,/^(?:-->)/i,/^(?:line\b)/i,/^(?:bar\b)/i,/^(?:\[)/i,/^(?:[+-]?(?:\d+(?:\.\d+)?|\.\d+))/i,/^(?:\])/i,/^(?:(?:`\)                                    \{ this\.pushState\(md_string\); \}\n<md_string>\(\?:\(\?!`"\)\.\)\+                  \{ return MD_STR; \}\n<md_string>\(\?:`))/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:\[)/i,/^(?:\])/i,/^(?:[A-Za-z]+)/i,/^(?::)/i,/^(?:\+)/i,/^(?:,)/i,/^(?:=)/i,/^(?:\*)/i,/^(?:#)/i,/^(?:[\_])/i,/^(?:\.)/i,/^(?:&)/i,/^(?:-)/i,/^(?:[0-9]+)/i,/^(?:\s+)/i,/^(?:;)/i,/^(?:$)/i],conditions:{data_inner:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,24,25,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},data:{rules:[0,1,3,4,5,6,7,9,11,14,15,16,17,18,21,22,23,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},axis_band_data:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,25,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},axis_data:{rules:[0,1,2,4,5,6,7,9,11,14,15,16,17,18,19,20,21,22,24,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},acc_descr_multiline:{rules:[12,13],inclusive:!1},acc_descr:{rules:[10],inclusive:!1},acc_title:{rules:[8],inclusive:!1},title:{rules:[],inclusive:!1},md_string:{rules:[],inclusive:!1},string:{rules:[28,29],inclusive:!1},INITIAL:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0}}};return R}();O.lexer=P;function k(){this.yy={}}return x(k,"Parser"),k.prototype=O,O.Parser=k,new k}();bT.parser=bT;var lCe=bT;function wT(t){return t.type==="bar"}x(wT,"isBarPlot");function rS(t){return t.type==="band"}x(rS,"isBandAxisData");function $h(t){return t.type==="linear"}x($h,"isLinearAxisData");var HW=class{constructor(t){this.parentGroup=t}static{x(this,"TextDimensionCalculatorWithFont")}getMaxDimension(t,e){if(!this.parentGroup)return{width:t.reduce((i,a)=>Math.max(a.length,i),0)*e,height:e};const r={width:0,height:0},n=this.parentGroup.append("g").attr("visibility","hidden").attr("font-size",e);for(const i of t){const a=RO(n,1,i),s=a?a.width:i.length*e,o=a?a.height:e;r.width=Math.max(r.width,s),r.height=Math.max(r.height,o)}return n.remove(),r}},vR=.7,yR=.2,qW=class{constructor(t,e,r,n){this.axisConfig=t,this.title=e,this.textDimensionCalculator=r,this.axisThemeConfig=n,this.boundingRect={x:0,y:0,width:0,height:0},this.axisPosition="left",this.showTitle=!1,this.showLabel=!1,this.showTick=!1,this.showAxisLine=!1,this.outerPadding=0,this.titleTextHeight=0,this.labelTextHeight=0,this.range=[0,10],this.boundingRect={x:0,y:0,width:0,height:0},this.axisPosition="left"}static{x(this,"BaseAxis")}setRange(t){this.range=t,this.axisPosition==="left"||this.axisPosition==="right"?this.boundingRect.height=t[1]-t[0]:this.boundingRect.width=t[1]-t[0],this.recalculateScale()}getRange(){return[this.range[0]+this.outerPadding,this.range[1]-this.outerPadding]}setAxisPosition(t){this.axisPosition=t,this.setRange(this.range)}getTickDistance(){const t=this.getRange();return Math.abs(t[0]-t[1])/this.getTickValues().length}getAxisOuterPadding(){return this.outerPadding}getLabelDimension(){return this.textDimensionCalculator.getMaxDimension(this.getTickValues().map(t=>t.toString()),this.axisConfig.labelFontSize)}recalculateOuterPaddingToDrawBar(){vR*this.getTickDistance()>this.outerPadding*2&&(this.outerPadding=Math.floor(vR*this.getTickDistance()/2)),this.recalculateScale()}calculateSpaceIfDrawnHorizontally(t){let e=t.height;if(this.axisConfig.showAxisLine&&e>this.axisConfig.axisLineWidth&&(e-=this.axisConfig.axisLineWidth,this.showAxisLine=!0),this.axisConfig.showLabel){const r=this.getLabelDimension(),n=yR*t.width;this.outerPadding=Math.min(r.width/2,n);const i=r.height+this.axisConfig.labelPadding*2;this.labelTextHeight=r.height,i<=e&&(e-=i,this.showLabel=!0)}if(this.axisConfig.showTick&&e>=this.axisConfig.tickLength&&(this.showTick=!0,e-=this.axisConfig.tickLength),this.axisConfig.showTitle&&this.title){const r=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),n=r.height+this.axisConfig.titlePadding*2;this.titleTextHeight=r.height,n<=e&&(e-=n,this.showTitle=!0)}this.boundingRect.width=t.width,this.boundingRect.height=t.height-e}calculateSpaceIfDrawnVertical(t){let e=t.width;if(this.axisConfig.showAxisLine&&e>this.axisConfig.axisLineWidth&&(e-=this.axisConfig.axisLineWidth,this.showAxisLine=!0),this.axisConfig.showLabel){const r=this.getLabelDimension(),n=yR*t.height;this.outerPadding=Math.min(r.height/2,n);const i=r.width+this.axisConfig.labelPadding*2;i<=e&&(e-=i,this.showLabel=!0)}if(this.axisConfig.showTick&&e>=this.axisConfig.tickLength&&(this.showTick=!0,e-=this.axisConfig.tickLength),this.axisConfig.showTitle&&this.title){const r=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),n=r.height+this.axisConfig.titlePadding*2;this.titleTextHeight=r.height,n<=e&&(e-=n,this.showTitle=!0)}this.boundingRect.width=t.width-e,this.boundingRect.height=t.height}calculateSpace(t){return this.axisPosition==="left"||this.axisPosition==="right"?this.calculateSpaceIfDrawnVertical(t):this.calculateSpaceIfDrawnHorizontally(t),this.recalculateScale(),{width:this.boundingRect.width,height:this.boundingRect.height}}setBoundingBoxXY(t){this.boundingRect.x=t.x,this.boundingRect.y=t.y}getDrawableElementsForLeftAxis(){const t=[];if(this.showAxisLine){const e=this.boundingRect.x+this.boundingRect.width-this.axisConfig.axisLineWidth/2;t.push({type:"path",groupTexts:["left-axis","axisl-line"],data:[{path:`M ${e},${this.boundingRect.y} L ${e},${this.boundingRect.y+this.boundingRect.height} `,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&t.push({type:"text",groupTexts:["left-axis","label"],data:this.getTickValues().map(e=>({text:e.toString(),x:this.boundingRect.x+this.boundingRect.width-(this.showLabel?this.axisConfig.labelPadding:0)-(this.showTick?this.axisConfig.tickLength:0)-(this.showAxisLine?this.axisConfig.axisLineWidth:0),y:this.getScaleValue(e),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"middle",horizontalPos:"right"}))}),this.showTick){const e=this.boundingRect.x+this.boundingRect.width-(this.showAxisLine?this.axisConfig.axisLineWidth:0);t.push({type:"path",groupTexts:["left-axis","ticks"],data:this.getTickValues().map(r=>({path:`M ${e},${this.getScaleValue(r)} L ${e-this.axisConfig.tickLength},${this.getScaleValue(r)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&t.push({type:"text",groupTexts:["left-axis","title"],data:[{text:this.title,x:this.boundingRect.x+this.axisConfig.titlePadding,y:this.boundingRect.y+this.boundingRect.height/2,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:270,verticalPos:"top",horizontalPos:"center"}]}),t}getDrawableElementsForBottomAxis(){const t=[];if(this.showAxisLine){const e=this.boundingRect.y+this.axisConfig.axisLineWidth/2;t.push({type:"path",groupTexts:["bottom-axis","axis-line"],data:[{path:`M ${this.boundingRect.x},${e} L ${this.boundingRect.x+this.boundingRect.width},${e}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&t.push({type:"text",groupTexts:["bottom-axis","label"],data:this.getTickValues().map(e=>({text:e.toString(),x:this.getScaleValue(e),y:this.boundingRect.y+this.axisConfig.labelPadding+(this.showTick?this.axisConfig.tickLength:0)+(this.showAxisLine?this.axisConfig.axisLineWidth:0),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}))}),this.showTick){const e=this.boundingRect.y+(this.showAxisLine?this.axisConfig.axisLineWidth:0);t.push({type:"path",groupTexts:["bottom-axis","ticks"],data:this.getTickValues().map(r=>({path:`M ${this.getScaleValue(r)},${e} L ${this.getScaleValue(r)},${e+this.axisConfig.tickLength}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&t.push({type:"text",groupTexts:["bottom-axis","title"],data:[{text:this.title,x:this.range[0]+(this.range[1]-this.range[0])/2,y:this.boundingRect.y+this.boundingRect.height-this.axisConfig.titlePadding-this.titleTextHeight,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}]}),t}getDrawableElementsForTopAxis(){const t=[];if(this.showAxisLine){const e=this.boundingRect.y+this.boundingRect.height-this.axisConfig.axisLineWidth/2;t.push({type:"path",groupTexts:["top-axis","axis-line"],data:[{path:`M ${this.boundingRect.x},${e} L ${this.boundingRect.x+this.boundingRect.width},${e}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&t.push({type:"text",groupTexts:["top-axis","label"],data:this.getTickValues().map(e=>({text:e.toString(),x:this.getScaleValue(e),y:this.boundingRect.y+(this.showTitle?this.titleTextHeight+this.axisConfig.titlePadding*2:0)+this.axisConfig.labelPadding,fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}))}),this.showTick){const e=this.boundingRect.y;t.push({type:"path",groupTexts:["top-axis","ticks"],data:this.getTickValues().map(r=>({path:`M ${this.getScaleValue(r)},${e+this.boundingRect.height-(this.showAxisLine?this.axisConfig.axisLineWidth:0)} L ${this.getScaleValue(r)},${e+this.boundingRect.height-this.axisConfig.tickLength-(this.showAxisLine?this.axisConfig.axisLineWidth:0)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&t.push({type:"text",groupTexts:["top-axis","title"],data:[{text:this.title,x:this.boundingRect.x+this.boundingRect.width/2,y:this.boundingRect.y+this.axisConfig.titlePadding,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}]}),t}getDrawableElements(){if(this.axisPosition==="left")return this.getDrawableElementsForLeftAxis();if(this.axisPosition==="right")throw Error("Drawing of right axis is not implemented");return this.axisPosition==="bottom"?this.getDrawableElementsForBottomAxis():this.axisPosition==="top"?this.getDrawableElementsForTopAxis():[]}},cCe=class extends qW{static{x(this,"BandAxis")}constructor(t,e,r,n,i){super(t,n,i,e),this.categories=r,this.scale=l5().domain(this.categories).range(this.getRange())}setRange(t){super.setRange(t)}recalculateScale(){this.scale=l5().domain(this.categories).range(this.getRange()).paddingInner(1).paddingOuter(0).align(.5),ie.trace("BandAxis axis final categories, range: ",this.categories,this.getRange())}getTickValues(){return this.categories}getScaleValue(t){return this.scale(t)??this.getRange()[0]}},uCe=class extends qW{static{x(this,"LinearAxis")}constructor(t,e,r,n,i){super(t,n,i,e),this.domain=r,this.scale=Hh().domain(this.domain).range(this.getRange())}getTickValues(){return this.scale.ticks()}recalculateScale(){const t=[...this.domain];this.axisPosition==="left"&&t.reverse(),this.scale=Hh().domain(t).range(this.getRange())}getScaleValue(t){return this.scale(t)}};function TT(t,e,r,n){const i=new HW(n);return rS(t)?new cCe(e,r,t.categories,t.title,i):new uCe(e,r,[t.min,t.max],t.title,i)}x(TT,"getAxis");var hCe=class{constructor(t,e,r,n){this.textDimensionCalculator=t,this.chartConfig=e,this.chartData=r,this.chartThemeConfig=n,this.boundingRect={x:0,y:0,width:0,height:0},this.showChartTitle=!1}static{x(this,"ChartTitle")}setBoundingBoxXY(t){this.boundingRect.x=t.x,this.boundingRect.y=t.y}calculateSpace(t){const e=this.textDimensionCalculator.getMaxDimension([this.chartData.title],this.chartConfig.titleFontSize),r=Math.max(e.width,t.width),n=e.height+2*this.chartConfig.titlePadding;return e.width<=r&&e.height<=n&&this.chartConfig.showTitle&&this.chartData.title&&(this.boundingRect.width=r,this.boundingRect.height=n,this.showChartTitle=!0),{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){const t=[];return this.showChartTitle&&t.push({groupTexts:["chart-title"],type:"text",data:[{fontSize:this.chartConfig.titleFontSize,text:this.chartData.title,verticalPos:"middle",horizontalPos:"center",x:this.boundingRect.x+this.boundingRect.width/2,y:this.boundingRect.y+this.boundingRect.height/2,fill:this.chartThemeConfig.titleColor,rotation:0}]}),t}};function YW(t,e,r,n){const i=new HW(n);return new hCe(i,t,e,r)}x(YW,"getChartTitleComponent");var dCe=class{constructor(t,e,r,n,i){this.plotData=t,this.xAxis=e,this.yAxis=r,this.orientation=n,this.plotIndex=i}static{x(this,"LinePlot")}getDrawableElement(){const t=this.plotData.data.map(r=>[this.xAxis.getScaleValue(r[0]),this.yAxis.getScaleValue(r[1])]);let e;return this.orientation==="horizontal"?e=V0().y(r=>r[0]).x(r=>r[1])(t):e=V0().x(r=>r[0]).y(r=>r[1])(t),e?[{groupTexts:["plot",`line-plot-${this.plotIndex}`],type:"path",data:[{path:e,strokeFill:this.plotData.strokeFill,strokeWidth:this.plotData.strokeWidth}]}]:[]}},fCe=class{constructor(t,e,r,n,i,a){this.barData=t,this.boundingRect=e,this.xAxis=r,this.yAxis=n,this.orientation=i,this.plotIndex=a}static{x(this,"BarPlot")}getDrawableElement(){const t=this.barData.data.map(i=>[this.xAxis.getScaleValue(i[0]),this.yAxis.getScaleValue(i[1])]),r=Math.min(this.xAxis.getAxisOuterPadding()*2,this.xAxis.getTickDistance())*(1-.05),n=r/2;return this.orientation==="horizontal"?[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:t.map(i=>({x:this.boundingRect.x,y:i[0]-n,height:r,width:i[1]-this.boundingRect.x,fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}]:[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:t.map(i=>({x:i[0]-n,y:i[1],width:r,height:this.boundingRect.y+this.boundingRect.height-i[1],fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}]}},pCe=class{constructor(t,e,r){this.chartConfig=t,this.chartData=e,this.chartThemeConfig=r,this.boundingRect={x:0,y:0,width:0,height:0}}static{x(this,"BasePlot")}setAxes(t,e){this.xAxis=t,this.yAxis=e}setBoundingBoxXY(t){this.boundingRect.x=t.x,this.boundingRect.y=t.y}calculateSpace(t){return this.boundingRect.width=t.width,this.boundingRect.height=t.height,{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){if(!(this.xAxis&&this.yAxis))throw Error("Axes must be passed to render Plots");const t=[];for(const[e,r]of this.chartData.plots.entries())switch(r.type){case"line":{const n=new dCe(r,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,e);t.push(...n.getDrawableElement())}break;case"bar":{const n=new fCe(r,this.boundingRect,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,e);t.push(...n.getDrawableElement())}break}return t}};function XW(t,e,r){return new pCe(t,e,r)}x(XW,"getPlotComponent");var gCe=class{constructor(t,e,r,n){this.chartConfig=t,this.chartData=e,this.componentStore={title:YW(t,e,r,n),plot:XW(t,e,r),xAxis:TT(e.xAxis,t.xAxis,{titleColor:r.xAxisTitleColor,labelColor:r.xAxisLabelColor,tickColor:r.xAxisTickColor,axisLineColor:r.xAxisLineColor},n),yAxis:TT(e.yAxis,t.yAxis,{titleColor:r.yAxisTitleColor,labelColor:r.yAxisLabelColor,tickColor:r.yAxisTickColor,axisLineColor:r.yAxisLineColor},n)}}static{x(this,"Orchestrator")}calculateVerticalSpace(){let t=this.chartConfig.width,e=this.chartConfig.height,r=0,n=0,i=Math.floor(t*this.chartConfig.plotReservedSpacePercent/100),a=Math.floor(e*this.chartConfig.plotReservedSpacePercent/100),s=this.componentStore.plot.calculateSpace({width:i,height:a});t-=s.width,e-=s.height,s=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:e}),n=s.height,e-=s.height,this.componentStore.xAxis.setAxisPosition("bottom"),s=this.componentStore.xAxis.calculateSpace({width:t,height:e}),e-=s.height,this.componentStore.yAxis.setAxisPosition("left"),s=this.componentStore.yAxis.calculateSpace({width:t,height:e}),r=s.width,t-=s.width,t>0&&(i+=t,t=0),e>0&&(a+=e,e=0),this.componentStore.plot.calculateSpace({width:i,height:a}),this.componentStore.plot.setBoundingBoxXY({x:r,y:n}),this.componentStore.xAxis.setRange([r,r+i]),this.componentStore.xAxis.setBoundingBoxXY({x:r,y:n+a}),this.componentStore.yAxis.setRange([n,n+a]),this.componentStore.yAxis.setBoundingBoxXY({x:0,y:n}),this.chartData.plots.some(o=>wT(o))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateHorizontalSpace(){let t=this.chartConfig.width,e=this.chartConfig.height,r=0,n=0,i=0,a=Math.floor(t*this.chartConfig.plotReservedSpacePercent/100),s=Math.floor(e*this.chartConfig.plotReservedSpacePercent/100),o=this.componentStore.plot.calculateSpace({width:a,height:s});t-=o.width,e-=o.height,o=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:e}),r=o.height,e-=o.height,this.componentStore.xAxis.setAxisPosition("left"),o=this.componentStore.xAxis.calculateSpace({width:t,height:e}),t-=o.width,n=o.width,this.componentStore.yAxis.setAxisPosition("top"),o=this.componentStore.yAxis.calculateSpace({width:t,height:e}),e-=o.height,i=r+o.height,t>0&&(a+=t,t=0),e>0&&(s+=e,e=0),this.componentStore.plot.calculateSpace({width:a,height:s}),this.componentStore.plot.setBoundingBoxXY({x:n,y:i}),this.componentStore.yAxis.setRange([n,n+a]),this.componentStore.yAxis.setBoundingBoxXY({x:n,y:r}),this.componentStore.xAxis.setRange([i,i+s]),this.componentStore.xAxis.setBoundingBoxXY({x:0,y:i}),this.chartData.plots.some(l=>wT(l))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateSpace(){this.chartConfig.chartOrientation==="horizontal"?this.calculateHorizontalSpace():this.calculateVerticalSpace()}getDrawableElement(){this.calculateSpace();const t=[];this.componentStore.plot.setAxes(this.componentStore.xAxis,this.componentStore.yAxis);for(const e of Object.values(this.componentStore))t.push(...e.getDrawableElements());return t}},mCe=class{static{x(this,"XYChartBuilder")}static build(t,e,r,n){return new gCe(t,e,r,n).getDrawableElement()}},yp=0,jW,xp=aS(),bp=iS(),Ar=sS(),ET=bp.plotColorPalette.split(",").map(t=>t.trim()),ux=!1,nS=!1;function iS(){const t=Py(),e=gr();return Hi(t.xyChart,e.themeVariables.xyChart)}x(iS,"getChartDefaultThemeConfig");function aS(){const t=gr();return Hi(hr.xyChart,t.xyChart)}x(aS,"getChartDefaultConfig");function sS(){return{yAxis:{type:"linear",title:"",min:1/0,max:-1/0},xAxis:{type:"band",title:"",categories:[]},title:"",plots:[]}}x(sS,"getChartDefaultData");function hx(t){const e=gr();return fr(t.trim(),e)}x(hx,"textSanitizer");function KW(t){jW=t}x(KW,"setTmpSVGG");function ZW(t){t==="horizontal"?xp.chartOrientation="horizontal":xp.chartOrientation="vertical"}x(ZW,"setOrientation");function QW(t){Ar.xAxis.title=hx(t.text)}x(QW,"setXAxisTitle");function oS(t,e){Ar.xAxis={type:"linear",title:Ar.xAxis.title,min:t,max:e},ux=!0}x(oS,"setXAxisRangeData");function JW(t){Ar.xAxis={type:"band",title:Ar.xAxis.title,categories:t.map(e=>hx(e.text))},ux=!0}x(JW,"setXAxisBand");function eH(t){Ar.yAxis.title=hx(t.text)}x(eH,"setYAxisTitle");function tH(t,e){Ar.yAxis={type:"linear",title:Ar.yAxis.title,min:t,max:e},nS=!0}x(tH,"setYAxisRangeData");function rH(t){const e=Math.min(...t),r=Math.max(...t),n=$h(Ar.yAxis)?Ar.yAxis.min:1/0,i=$h(Ar.yAxis)?Ar.yAxis.max:-1/0;Ar.yAxis={type:"linear",title:Ar.yAxis.title,min:Math.min(n,e),max:Math.max(i,r)}}x(rH,"setYAxisRangeFromPlotData");function lS(t){let e=[];if(t.length===0)return e;if(!ux){const r=$h(Ar.xAxis)?Ar.xAxis.min:1/0,n=$h(Ar.xAxis)?Ar.xAxis.max:-1/0;oS(Math.min(r,1),Math.max(n,t.length))}if(nS||rH(t),rS(Ar.xAxis)&&(e=Ar.xAxis.categories.map((r,n)=>[r,t[n]])),$h(Ar.xAxis)){const r=Ar.xAxis.min,n=Ar.xAxis.max,i=(n-r)/(t.length-1),a=[];for(let s=r;s<=n;s+=i)a.push(`${s}`);e=a.map((s,o)=>[s,t[o]])}return e}x(lS,"transformDataWithoutCategory");function cS(t){return ET[t===0?0:t%ET.length]}x(cS,"getPlotColorFromPalette");function nH(t,e){const r=lS(e);Ar.plots.push({type:"line",strokeFill:cS(yp),strokeWidth:2,data:r}),yp++}x(nH,"setLineData");function iH(t,e){const r=lS(e);Ar.plots.push({type:"bar",fill:cS(yp),data:r}),yp++}x(iH,"setBarData");function aH(){if(Ar.plots.length===0)throw Error("No Plot to render, please provide a plot with some data");return Ar.title=_n(),mCe.build(xp,Ar,bp,jW)}x(aH,"getDrawableElem");function sH(){return bp}x(sH,"getChartThemeConfig");function oH(){return xp}x(oH,"getChartConfig");function lH(){return Ar}x(lH,"getXYChartData");var vCe=x(function(){An(),yp=0,xp=aS(),Ar=sS(),bp=iS(),ET=bp.plotColorPalette.split(",").map(t=>t.trim()),ux=!1,nS=!1},"clear"),yCe={getDrawableElem:aH,clear:vCe,setAccTitle:Sn,getAccTitle:zn,setDiagramTitle:Zn,getDiagramTitle:_n,getAccDescription:Gn,setAccDescription:Vn,setOrientation:ZW,setXAxisTitle:QW,setXAxisRangeData:oS,setXAxisBand:JW,setYAxisTitle:eH,setYAxisRangeData:tH,setLineData:nH,setBarData:iH,setTmpSVGG:KW,getChartThemeConfig:sH,getChartConfig:oH,getXYChartData:lH},xCe=x((t,e,r,n)=>{const i=n.db,a=i.getChartThemeConfig(),s=i.getChartConfig(),o=i.getXYChartData().plots[0].data.map(y=>y[1]);function l(y){return y==="top"?"text-before-edge":"middle"}x(l,"getDominantBaseLine");function u(y){return y==="left"?"start":y==="right"?"end":"middle"}x(u,"getTextAnchor");function h(y){return`translate(${y.x}, ${y.y}) rotate(${y.rotation||0})`}x(h,"getTextTransformation"),ie.debug(`Rendering xychart chart
`+t);const d=el(e),f=d.append("g").attr("class","main"),p=f.append("rect").attr("width",s.width).attr("height",s.height).attr("class","background");ji(d,s.height,s.width,!0),d.attr("viewBox",`0 0 ${s.width} ${s.height}`),p.attr("fill",a.backgroundColor),i.setTmpSVGG(d.append("g").attr("class","mermaid-tmp-group"));const g=i.getDrawableElem(),m={};function v(y){let b=f,w="";for(const[T]of y.entries()){let E=f;T>0&&m[w]&&(E=m[w]),w+=y[T],b=m[w],b||(b=m[w]=E.append("g").attr("class",y[T]))}return b}x(v,"getGroup");for(const y of g){if(y.data.length===0)continue;const b=v(y.groupTexts);switch(y.type){case"rect":if(b.selectAll("rect").data(y.data).enter().append("rect").attr("x",w=>w.x).attr("y",w=>w.y).attr("width",w=>w.width).attr("height",w=>w.height).attr("fill",w=>w.fill).attr("stroke",w=>w.strokeFill).attr("stroke-width",w=>w.strokeWidth),s.showDataLabel)if(s.chartOrientation==="horizontal"){let w=function(C,A){const{data:N,label:_}=C;return A*_.length*T<=N.width-10};x(w,"fitsHorizontally");const T=.7,E=y.data.map((C,A)=>({data:C,label:o[A].toString()})).filter(C=>C.data.width>0&&C.data.height>0),L=E.map(C=>{const{data:A}=C;let N=A.height*.7;for(;!w(C,N)&&N>0;)N-=1;return N}),S=Math.floor(Math.min(...L));b.selectAll("text").data(E).enter().append("text").attr("x",C=>C.data.x+C.data.width-10).attr("y",C=>C.data.y+C.data.height/2).attr("text-anchor","end").attr("dominant-baseline","middle").attr("fill","black").attr("font-size",`${S}px`).text(C=>C.label)}else{let w=function(C,A,N){const{data:_,label:O}=C,k=A*O.length*.7,R=_.x+_.width/2,I=R-k/2,M=R+k/2,D=I>=_.x&&M<=_.x+_.width,B=_.y+N+A<=_.y+_.height;return D&&B};x(w,"fitsInBar");const T=10,E=y.data.map((C,A)=>({data:C,label:o[A].toString()})).filter(C=>C.data.width>0&&C.data.height>0),L=E.map(C=>{const{data:A,label:N}=C;let _=A.width/(N.length*.7);for(;!w(C,_,T)&&_>0;)_-=1;return _}),S=Math.floor(Math.min(...L));b.selectAll("text").data(E).enter().append("text").attr("x",C=>C.data.x+C.data.width/2).attr("y",C=>C.data.y+T).attr("text-anchor","middle").attr("dominant-baseline","hanging").attr("fill","black").attr("font-size",`${S}px`).text(C=>C.label)}break;case"text":b.selectAll("text").data(y.data).enter().append("text").attr("x",0).attr("y",0).attr("fill",w=>w.fill).attr("font-size",w=>w.fontSize).attr("dominant-baseline",w=>l(w.verticalPos)).attr("text-anchor",w=>u(w.horizontalPos)).attr("transform",w=>h(w)).text(w=>w.text);break;case"path":b.selectAll("path").data(y.data).enter().append("path").attr("d",w=>w.path).attr("fill",w=>w.fill?w.fill:"none").attr("stroke",w=>w.strokeFill).attr("stroke-width",w=>w.strokeWidth);break}}},"draw"),bCe={draw:xCe},wCe={parser:lCe,db:yCe,renderer:bCe};const TCe=Object.freeze(Object.defineProperty({__proto__:null,diagram:wCe},Symbol.toStringTag,{value:"Module"}));var kT=function(){var t=x(function(me,De,Q,ce){for(Q=Q||{},ce=me.length;ce--;Q[me[ce]]=De);return Q},"o"),e=[1,3],r=[1,4],n=[1,5],i=[1,6],a=[5,6,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,77,89,90],s=[1,22],o=[2,7],l=[1,26],u=[1,27],h=[1,28],d=[1,29],f=[1,33],p=[1,34],g=[1,35],m=[1,36],v=[1,37],y=[1,38],b=[1,24],w=[1,31],T=[1,32],E=[1,30],L=[1,39],S=[1,40],C=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,77,89,90],A=[1,61],N=[89,90],_=[5,8,9,11,13,21,22,23,24,27,29,41,42,43,44,45,46,54,61,63,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],O=[27,29],P=[1,70],k=[1,71],R=[1,72],I=[1,73],M=[1,74],D=[1,75],B=[1,76],$=[1,83],F=[1,80],G=[1,84],W=[1,85],J=[1,86],q=[1,87],ne=[1,88],ae=[1,89],pe=[1,90],K=[1,91],Z=[1,92],X=[5,8,9,11,13,21,22,23,24,27,41,42,43,44,45,46,54,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],Y=[63,64],ee=[1,101],j=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,76,77,89,90],fe=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],te=[1,110],Ae=[1,106],H=[1,107],Oe=[1,108],ue=[1,109],Ve=[1,111],Ge=[1,116],Ue=[1,117],ke=[1,114],Pe=[1,115],Se={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,start:3,directive:4,NEWLINE:5,RD:6,diagram:7,EOF:8,acc_title:9,acc_title_value:10,acc_descr:11,acc_descr_value:12,acc_descr_multiline_value:13,requirementDef:14,elementDef:15,relationshipDef:16,direction:17,styleStatement:18,classDefStatement:19,classStatement:20,direction_tb:21,direction_bt:22,direction_rl:23,direction_lr:24,requirementType:25,requirementName:26,STRUCT_START:27,requirementBody:28,STYLE_SEPARATOR:29,idList:30,ID:31,COLONSEP:32,id:33,TEXT:34,text:35,RISK:36,riskLevel:37,VERIFYMTHD:38,verifyType:39,STRUCT_STOP:40,REQUIREMENT:41,FUNCTIONAL_REQUIREMENT:42,INTERFACE_REQUIREMENT:43,PERFORMANCE_REQUIREMENT:44,PHYSICAL_REQUIREMENT:45,DESIGN_CONSTRAINT:46,LOW_RISK:47,MED_RISK:48,HIGH_RISK:49,VERIFY_ANALYSIS:50,VERIFY_DEMONSTRATION:51,VERIFY_INSPECTION:52,VERIFY_TEST:53,ELEMENT:54,elementName:55,elementBody:56,TYPE:57,type:58,DOCREF:59,ref:60,END_ARROW_L:61,relationship:62,LINE:63,END_ARROW_R:64,CONTAINS:65,COPIES:66,DERIVES:67,SATISFIES:68,VERIFIES:69,REFINES:70,TRACES:71,CLASSDEF:72,stylesOpt:73,CLASS:74,ALPHA:75,COMMA:76,STYLE:77,style:78,styleComponent:79,NUM:80,COLON:81,UNIT:82,SPACE:83,BRKT:84,PCT:85,MINUS:86,LABEL:87,SEMICOLON:88,unqString:89,qString:90,$accept:0,$end:1},terminals_:{2:"error",5:"NEWLINE",6:"RD",8:"EOF",9:"acc_title",10:"acc_title_value",11:"acc_descr",12:"acc_descr_value",13:"acc_descr_multiline_value",21:"direction_tb",22:"direction_bt",23:"direction_rl",24:"direction_lr",27:"STRUCT_START",29:"STYLE_SEPARATOR",31:"ID",32:"COLONSEP",34:"TEXT",36:"RISK",38:"VERIFYMTHD",40:"STRUCT_STOP",41:"REQUIREMENT",42:"FUNCTIONAL_REQUIREMENT",43:"INTERFACE_REQUIREMENT",44:"PERFORMANCE_REQUIREMENT",45:"PHYSICAL_REQUIREMENT",46:"DESIGN_CONSTRAINT",47:"LOW_RISK",48:"MED_RISK",49:"HIGH_RISK",50:"VERIFY_ANALYSIS",51:"VERIFY_DEMONSTRATION",52:"VERIFY_INSPECTION",53:"VERIFY_TEST",54:"ELEMENT",57:"TYPE",59:"DOCREF",61:"END_ARROW_L",63:"LINE",64:"END_ARROW_R",65:"CONTAINS",66:"COPIES",67:"DERIVES",68:"SATISFIES",69:"VERIFIES",70:"REFINES",71:"TRACES",72:"CLASSDEF",74:"CLASS",75:"ALPHA",76:"COMMA",77:"STYLE",80:"NUM",81:"COLON",82:"UNIT",83:"SPACE",84:"BRKT",85:"PCT",86:"MINUS",87:"LABEL",88:"SEMICOLON",89:"unqString",90:"qString"},productions_:[0,[3,3],[3,2],[3,4],[4,2],[4,2],[4,1],[7,0],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[17,1],[17,1],[17,1],[17,1],[14,5],[14,7],[28,5],[28,5],[28,5],[28,5],[28,2],[28,1],[25,1],[25,1],[25,1],[25,1],[25,1],[25,1],[37,1],[37,1],[37,1],[39,1],[39,1],[39,1],[39,1],[15,5],[15,7],[56,5],[56,5],[56,2],[56,1],[16,5],[16,5],[62,1],[62,1],[62,1],[62,1],[62,1],[62,1],[62,1],[19,3],[20,3],[20,3],[30,1],[30,3],[30,1],[30,3],[18,3],[73,1],[73,3],[78,1],[78,2],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[26,1],[26,1],[33,1],[33,1],[35,1],[35,1],[55,1],[55,1],[58,1],[58,1],[60,1],[60,1]],performAction:x(function(De,Q,ce,z,oe,se,ge){var he=se.length-1;switch(oe){case 4:this.$=se[he].trim(),z.setAccTitle(this.$);break;case 5:case 6:this.$=se[he].trim(),z.setAccDescription(this.$);break;case 7:this.$=[];break;case 17:z.setDirection("TB");break;case 18:z.setDirection("BT");break;case 19:z.setDirection("RL");break;case 20:z.setDirection("LR");break;case 21:z.addRequirement(se[he-3],se[he-4]);break;case 22:z.addRequirement(se[he-5],se[he-6]),z.setClass([se[he-5]],se[he-3]);break;case 23:z.setNewReqId(se[he-2]);break;case 24:z.setNewReqText(se[he-2]);break;case 25:z.setNewReqRisk(se[he-2]);break;case 26:z.setNewReqVerifyMethod(se[he-2]);break;case 29:this.$=z.RequirementType.REQUIREMENT;break;case 30:this.$=z.RequirementType.FUNCTIONAL_REQUIREMENT;break;case 31:this.$=z.RequirementType.INTERFACE_REQUIREMENT;break;case 32:this.$=z.RequirementType.PERFORMANCE_REQUIREMENT;break;case 33:this.$=z.RequirementType.PHYSICAL_REQUIREMENT;break;case 34:this.$=z.RequirementType.DESIGN_CONSTRAINT;break;case 35:this.$=z.RiskLevel.LOW_RISK;break;case 36:this.$=z.RiskLevel.MED_RISK;break;case 37:this.$=z.RiskLevel.HIGH_RISK;break;case 38:this.$=z.VerifyType.VERIFY_ANALYSIS;break;case 39:this.$=z.VerifyType.VERIFY_DEMONSTRATION;break;case 40:this.$=z.VerifyType.VERIFY_INSPECTION;break;case 41:this.$=z.VerifyType.VERIFY_TEST;break;case 42:z.addElement(se[he-3]);break;case 43:z.addElement(se[he-5]),z.setClass([se[he-5]],se[he-3]);break;case 44:z.setNewElementType(se[he-2]);break;case 45:z.setNewElementDocRef(se[he-2]);break;case 48:z.addRelationship(se[he-2],se[he],se[he-4]);break;case 49:z.addRelationship(se[he-2],se[he-4],se[he]);break;case 50:this.$=z.Relationships.CONTAINS;break;case 51:this.$=z.Relationships.COPIES;break;case 52:this.$=z.Relationships.DERIVES;break;case 53:this.$=z.Relationships.SATISFIES;break;case 54:this.$=z.Relationships.VERIFIES;break;case 55:this.$=z.Relationships.REFINES;break;case 56:this.$=z.Relationships.TRACES;break;case 57:this.$=se[he-2],z.defineClass(se[he-1],se[he]);break;case 58:z.setClass(se[he-1],se[he]);break;case 59:z.setClass([se[he-2]],se[he]);break;case 60:case 62:this.$=[se[he]];break;case 61:case 63:this.$=se[he-2].concat([se[he]]);break;case 64:this.$=se[he-2],z.setCssStyle(se[he-1],se[he]);break;case 65:this.$=[se[he]];break;case 66:se[he-2].push(se[he]),this.$=se[he-2];break;case 68:this.$=se[he-1]+se[he];break}},"anonymous"),table:[{3:1,4:2,6:e,9:r,11:n,13:i},{1:[3]},{3:8,4:2,5:[1,7],6:e,9:r,11:n,13:i},{5:[1,9]},{10:[1,10]},{12:[1,11]},t(a,[2,6]),{3:12,4:2,6:e,9:r,11:n,13:i},{1:[2,2]},{4:17,5:s,7:13,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:v,46:y,54:b,72:w,74:T,77:E,89:L,90:S},t(a,[2,4]),t(a,[2,5]),{1:[2,1]},{8:[1,41]},{4:17,5:s,7:42,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:v,46:y,54:b,72:w,74:T,77:E,89:L,90:S},{4:17,5:s,7:43,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:v,46:y,54:b,72:w,74:T,77:E,89:L,90:S},{4:17,5:s,7:44,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:v,46:y,54:b,72:w,74:T,77:E,89:L,90:S},{4:17,5:s,7:45,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:v,46:y,54:b,72:w,74:T,77:E,89:L,90:S},{4:17,5:s,7:46,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:v,46:y,54:b,72:w,74:T,77:E,89:L,90:S},{4:17,5:s,7:47,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:v,46:y,54:b,72:w,74:T,77:E,89:L,90:S},{4:17,5:s,7:48,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:v,46:y,54:b,72:w,74:T,77:E,89:L,90:S},{4:17,5:s,7:49,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:v,46:y,54:b,72:w,74:T,77:E,89:L,90:S},{4:17,5:s,7:50,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:v,46:y,54:b,72:w,74:T,77:E,89:L,90:S},{26:51,89:[1,52],90:[1,53]},{55:54,89:[1,55],90:[1,56]},{29:[1,59],61:[1,57],63:[1,58]},t(C,[2,17]),t(C,[2,18]),t(C,[2,19]),t(C,[2,20]),{30:60,33:62,75:A,89:L,90:S},{30:63,33:62,75:A,89:L,90:S},{30:64,33:62,75:A,89:L,90:S},t(N,[2,29]),t(N,[2,30]),t(N,[2,31]),t(N,[2,32]),t(N,[2,33]),t(N,[2,34]),t(_,[2,81]),t(_,[2,82]),{1:[2,3]},{8:[2,8]},{8:[2,9]},{8:[2,10]},{8:[2,11]},{8:[2,12]},{8:[2,13]},{8:[2,14]},{8:[2,15]},{8:[2,16]},{27:[1,65],29:[1,66]},t(O,[2,79]),t(O,[2,80]),{27:[1,67],29:[1,68]},t(O,[2,85]),t(O,[2,86]),{62:69,65:P,66:k,67:R,68:I,69:M,70:D,71:B},{62:77,65:P,66:k,67:R,68:I,69:M,70:D,71:B},{30:78,33:62,75:A,89:L,90:S},{73:79,75:$,76:F,78:81,79:82,80:G,81:W,82:J,83:q,84:ne,85:ae,86:pe,87:K,88:Z},t(X,[2,60]),t(X,[2,62]),{73:93,75:$,76:F,78:81,79:82,80:G,81:W,82:J,83:q,84:ne,85:ae,86:pe,87:K,88:Z},{30:94,33:62,75:A,76:F,89:L,90:S},{5:[1,95]},{30:96,33:62,75:A,89:L,90:S},{5:[1,97]},{30:98,33:62,75:A,89:L,90:S},{63:[1,99]},t(Y,[2,50]),t(Y,[2,51]),t(Y,[2,52]),t(Y,[2,53]),t(Y,[2,54]),t(Y,[2,55]),t(Y,[2,56]),{64:[1,100]},t(C,[2,59],{76:F}),t(C,[2,64],{76:ee}),{33:103,75:[1,102],89:L,90:S},t(j,[2,65],{79:104,75:$,80:G,81:W,82:J,83:q,84:ne,85:ae,86:pe,87:K,88:Z}),t(fe,[2,67]),t(fe,[2,69]),t(fe,[2,70]),t(fe,[2,71]),t(fe,[2,72]),t(fe,[2,73]),t(fe,[2,74]),t(fe,[2,75]),t(fe,[2,76]),t(fe,[2,77]),t(fe,[2,78]),t(C,[2,57],{76:ee}),t(C,[2,58],{76:F}),{5:te,28:105,31:Ae,34:H,36:Oe,38:ue,40:Ve},{27:[1,112],76:F},{5:Ge,40:Ue,56:113,57:ke,59:Pe},{27:[1,118],76:F},{33:119,89:L,90:S},{33:120,89:L,90:S},{75:$,78:121,79:82,80:G,81:W,82:J,83:q,84:ne,85:ae,86:pe,87:K,88:Z},t(X,[2,61]),t(X,[2,63]),t(fe,[2,68]),t(C,[2,21]),{32:[1,122]},{32:[1,123]},{32:[1,124]},{32:[1,125]},{5:te,28:126,31:Ae,34:H,36:Oe,38:ue,40:Ve},t(C,[2,28]),{5:[1,127]},t(C,[2,42]),{32:[1,128]},{32:[1,129]},{5:Ge,40:Ue,56:130,57:ke,59:Pe},t(C,[2,47]),{5:[1,131]},t(C,[2,48]),t(C,[2,49]),t(j,[2,66],{79:104,75:$,80:G,81:W,82:J,83:q,84:ne,85:ae,86:pe,87:K,88:Z}),{33:132,89:L,90:S},{35:133,89:[1,134],90:[1,135]},{37:136,47:[1,137],48:[1,138],49:[1,139]},{39:140,50:[1,141],51:[1,142],52:[1,143],53:[1,144]},t(C,[2,27]),{5:te,28:145,31:Ae,34:H,36:Oe,38:ue,40:Ve},{58:146,89:[1,147],90:[1,148]},{60:149,89:[1,150],90:[1,151]},t(C,[2,46]),{5:Ge,40:Ue,56:152,57:ke,59:Pe},{5:[1,153]},{5:[1,154]},{5:[2,83]},{5:[2,84]},{5:[1,155]},{5:[2,35]},{5:[2,36]},{5:[2,37]},{5:[1,156]},{5:[2,38]},{5:[2,39]},{5:[2,40]},{5:[2,41]},t(C,[2,22]),{5:[1,157]},{5:[2,87]},{5:[2,88]},{5:[1,158]},{5:[2,89]},{5:[2,90]},t(C,[2,43]),{5:te,28:159,31:Ae,34:H,36:Oe,38:ue,40:Ve},{5:te,28:160,31:Ae,34:H,36:Oe,38:ue,40:Ve},{5:te,28:161,31:Ae,34:H,36:Oe,38:ue,40:Ve},{5:te,28:162,31:Ae,34:H,36:Oe,38:ue,40:Ve},{5:Ge,40:Ue,56:163,57:ke,59:Pe},{5:Ge,40:Ue,56:164,57:ke,59:Pe},t(C,[2,23]),t(C,[2,24]),t(C,[2,25]),t(C,[2,26]),t(C,[2,44]),t(C,[2,45])],defaultActions:{8:[2,2],12:[2,1],41:[2,3],42:[2,8],43:[2,9],44:[2,10],45:[2,11],46:[2,12],47:[2,13],48:[2,14],49:[2,15],50:[2,16],134:[2,83],135:[2,84],137:[2,35],138:[2,36],139:[2,37],141:[2,38],142:[2,39],143:[2,40],144:[2,41],147:[2,87],148:[2,88],150:[2,89],151:[2,90]},parseError:x(function(De,Q){if(Q.recoverable)this.trace(De);else{var ce=new Error(De);throw ce.hash=Q,ce}},"parseError"),parse:x(function(De){var Q=this,ce=[0],z=[],oe=[null],se=[],ge=this.table,he="",be=0,Ce=0,Te=2,Ne=1,Xe=se.slice.call(arguments,1),Ye=Object.create(this.lexer),Ke={yy:{}};for(var Ze in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Ze)&&(Ke.yy[Ze]=this.yy[Ze]);Ye.setInput(De,Ke.yy),Ke.yy.lexer=Ye,Ke.yy.parser=this,typeof Ye.yylloc>"u"&&(Ye.yylloc={});var Be=Ye.yylloc;se.push(Be);var He=Ye.options&&Ye.options.ranges;typeof Ke.yy.parseError=="function"?this.parseError=Ke.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ht(tr){ce.length=ce.length-2*tr,oe.length=oe.length-tr,se.length=se.length-tr}x(ht,"popStack");function st(){var tr;return tr=z.pop()||Ye.lex()||Ne,typeof tr!="number"&&(tr instanceof Array&&(z=tr,tr=z.pop()),tr=Q.symbols_[tr]||tr),tr}x(st,"lex");for(var We,kt,qe,rt,ct={},ut,nt,bt,Zt;;){if(kt=ce[ce.length-1],this.defaultActions[kt]?qe=this.defaultActions[kt]:((We===null||typeof We>"u")&&(We=st()),qe=ge[kt]&&ge[kt][We]),typeof qe>"u"||!qe.length||!qe[0]){var Ot="";Zt=[];for(ut in ge[kt])this.terminals_[ut]&&ut>Te&&Zt.push("'"+this.terminals_[ut]+"'");Ye.showPosition?Ot="Parse error on line "+(be+1)+`:
`+Ye.showPosition()+`
Expecting `+Zt.join(", ")+", got '"+(this.terminals_[We]||We)+"'":Ot="Parse error on line "+(be+1)+": Unexpected "+(We==Ne?"end of input":"'"+(this.terminals_[We]||We)+"'"),this.parseError(Ot,{text:Ye.match,token:this.terminals_[We]||We,line:Ye.yylineno,loc:Be,expected:Zt})}if(qe[0]instanceof Array&&qe.length>1)throw new Error("Parse Error: multiple actions possible at state: "+kt+", token: "+We);switch(qe[0]){case 1:ce.push(We),oe.push(Ye.yytext),se.push(Ye.yylloc),ce.push(qe[1]),We=null,Ce=Ye.yyleng,he=Ye.yytext,be=Ye.yylineno,Be=Ye.yylloc;break;case 2:if(nt=this.productions_[qe[1]][1],ct.$=oe[oe.length-nt],ct._$={first_line:se[se.length-(nt||1)].first_line,last_line:se[se.length-1].last_line,first_column:se[se.length-(nt||1)].first_column,last_column:se[se.length-1].last_column},He&&(ct._$.range=[se[se.length-(nt||1)].range[0],se[se.length-1].range[1]]),rt=this.performAction.apply(ct,[he,Ce,be,Ke.yy,qe[1],oe,se].concat(Xe)),typeof rt<"u")return rt;nt&&(ce=ce.slice(0,-1*nt*2),oe=oe.slice(0,-1*nt),se=se.slice(0,-1*nt)),ce.push(this.productions_[qe[1]][0]),oe.push(ct.$),se.push(ct._$),bt=ge[ce[ce.length-2]][ce[ce.length-1]],ce.push(bt);break;case 3:return!0}}return!0},"parse")},_e=function(){var me={EOF:1,parseError:x(function(Q,ce){if(this.yy.parser)this.yy.parser.parseError(Q,ce);else throw new Error(Q)},"parseError"),setInput:x(function(De,Q){return this.yy=Q||this.yy||{},this._input=De,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:x(function(){var De=this._input[0];this.yytext+=De,this.yyleng++,this.offset++,this.match+=De,this.matched+=De;var Q=De.match(/(?:\r\n?|\n).*/g);return Q?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),De},"input"),unput:x(function(De){var Q=De.length,ce=De.split(/(?:\r\n?|\n)/g);this._input=De+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-Q),this.offset-=Q;var z=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),ce.length-1&&(this.yylineno-=ce.length-1);var oe=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:ce?(ce.length===z.length?this.yylloc.first_column:0)+z[z.length-ce.length].length-ce[0].length:this.yylloc.first_column-Q},this.options.ranges&&(this.yylloc.range=[oe[0],oe[0]+this.yyleng-Q]),this.yyleng=this.yytext.length,this},"unput"),more:x(function(){return this._more=!0,this},"more"),reject:x(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:x(function(De){this.unput(this.match.slice(De))},"less"),pastInput:x(function(){var De=this.matched.substr(0,this.matched.length-this.match.length);return(De.length>20?"...":"")+De.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:x(function(){var De=this.match;return De.length<20&&(De+=this._input.substr(0,20-De.length)),(De.substr(0,20)+(De.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:x(function(){var De=this.pastInput(),Q=new Array(De.length+1).join("-");return De+this.upcomingInput()+`
`+Q+"^"},"showPosition"),test_match:x(function(De,Q){var ce,z,oe;if(this.options.backtrack_lexer&&(oe={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(oe.yylloc.range=this.yylloc.range.slice(0))),z=De[0].match(/(?:\r\n?|\n).*/g),z&&(this.yylineno+=z.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:z?z[z.length-1].length-z[z.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+De[0].length},this.yytext+=De[0],this.match+=De[0],this.matches=De,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(De[0].length),this.matched+=De[0],ce=this.performAction.call(this,this.yy,this,Q,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),ce)return ce;if(this._backtrack){for(var se in oe)this[se]=oe[se];return!1}return!1},"test_match"),next:x(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var De,Q,ce,z;this._more||(this.yytext="",this.match="");for(var oe=this._currentRules(),se=0;se<oe.length;se++)if(ce=this._input.match(this.rules[oe[se]]),ce&&(!Q||ce[0].length>Q[0].length)){if(Q=ce,z=se,this.options.backtrack_lexer){if(De=this.test_match(ce,oe[se]),De!==!1)return De;if(this._backtrack){Q=!1;continue}else return!1}else if(!this.options.flex)break}return Q?(De=this.test_match(Q,oe[z]),De!==!1?De:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var Q=this.next();return Q||this.lex()},"lex"),begin:x(function(Q){this.conditionStack.push(Q)},"begin"),popState:x(function(){var Q=this.conditionStack.length-1;return Q>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(Q){return Q=this.conditionStack.length-1-Math.abs(Q||0),Q>=0?this.conditionStack[Q]:"INITIAL"},"topState"),pushState:x(function(Q){this.begin(Q)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:x(function(Q,ce,z,oe){switch(z){case 0:return"title";case 1:return this.begin("acc_title"),9;case 2:return this.popState(),"acc_title_value";case 3:return this.begin("acc_descr"),11;case 4:return this.popState(),"acc_descr_value";case 5:this.begin("acc_descr_multiline");break;case 6:this.popState();break;case 7:return"acc_descr_multiline_value";case 8:return 21;case 9:return 22;case 10:return 23;case 11:return 24;case 12:return 5;case 13:break;case 14:break;case 15:break;case 16:return 8;case 17:return 6;case 18:return 27;case 19:return 40;case 20:return 29;case 21:return 32;case 22:return 31;case 23:return 34;case 24:return 36;case 25:return 38;case 26:return 41;case 27:return 42;case 28:return 43;case 29:return 44;case 30:return 45;case 31:return 46;case 32:return 47;case 33:return 48;case 34:return 49;case 35:return 50;case 36:return 51;case 37:return 52;case 38:return 53;case 39:return 54;case 40:return 65;case 41:return 66;case 42:return 67;case 43:return 68;case 44:return 69;case 45:return 70;case 46:return 71;case 47:return 57;case 48:return 59;case 49:return this.begin("style"),77;case 50:return 75;case 51:return 81;case 52:return 88;case 53:return"PERCENT";case 54:return 86;case 55:return 84;case 56:break;case 57:this.begin("string");break;case 58:this.popState();break;case 59:return this.begin("style"),72;case 60:return this.begin("style"),74;case 61:return 61;case 62:return 64;case 63:return 63;case 64:this.begin("string");break;case 65:this.popState();break;case 66:return"qString";case 67:return ce.yytext=ce.yytext.trim(),89;case 68:return 75;case 69:return 80;case 70:return 76}},"anonymous"),rules:[/^(?:title\s[^#\n;]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:(\r?\n)+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:%[^\n]*)/i,/^(?:$)/i,/^(?:requirementDiagram\b)/i,/^(?:\{)/i,/^(?:\})/i,/^(?::{3})/i,/^(?::)/i,/^(?:id\b)/i,/^(?:text\b)/i,/^(?:risk\b)/i,/^(?:verifyMethod\b)/i,/^(?:requirement\b)/i,/^(?:functionalRequirement\b)/i,/^(?:interfaceRequirement\b)/i,/^(?:performanceRequirement\b)/i,/^(?:physicalRequirement\b)/i,/^(?:designConstraint\b)/i,/^(?:low\b)/i,/^(?:medium\b)/i,/^(?:high\b)/i,/^(?:analysis\b)/i,/^(?:demonstration\b)/i,/^(?:inspection\b)/i,/^(?:test\b)/i,/^(?:element\b)/i,/^(?:contains\b)/i,/^(?:copies\b)/i,/^(?:derives\b)/i,/^(?:satisfies\b)/i,/^(?:verifies\b)/i,/^(?:refines\b)/i,/^(?:traces\b)/i,/^(?:type\b)/i,/^(?:docref\b)/i,/^(?:style\b)/i,/^(?:\w+)/i,/^(?::)/i,/^(?:;)/i,/^(?:%)/i,/^(?:-)/i,/^(?:#)/i,/^(?: )/i,/^(?:["])/i,/^(?:\n)/i,/^(?:classDef\b)/i,/^(?:class\b)/i,/^(?:<-)/i,/^(?:->)/i,/^(?:-)/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[\w][^:,\r\n\{\<\>\-\=]*)/i,/^(?:\w+)/i,/^(?:[0-9]+)/i,/^(?:,)/i],conditions:{acc_descr_multiline:{rules:[6,7,68,69,70],inclusive:!1},acc_descr:{rules:[4,68,69,70],inclusive:!1},acc_title:{rules:[2,68,69,70],inclusive:!1},style:{rules:[50,51,52,53,54,55,56,57,58,68,69,70],inclusive:!1},unqString:{rules:[68,69,70],inclusive:!1},token:{rules:[68,69,70],inclusive:!1},string:{rules:[65,66,68,69,70],inclusive:!1},INITIAL:{rules:[0,1,3,5,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,59,60,61,62,63,64,67,68,69,70],inclusive:!0}}};return me}();Se.lexer=_e;function ze(){this.yy={}}return x(ze,"Parser"),ze.prototype=Se,Se.Parser=ze,new ze}();kT.parser=kT;var ECe=kT,kCe=class{constructor(){this.relations=[],this.latestRequirement=this.getInitialRequirement(),this.requirements=new Map,this.latestElement=this.getInitialElement(),this.elements=new Map,this.classes=new Map,this.direction="TB",this.RequirementType={REQUIREMENT:"Requirement",FUNCTIONAL_REQUIREMENT:"Functional Requirement",INTERFACE_REQUIREMENT:"Interface Requirement",PERFORMANCE_REQUIREMENT:"Performance Requirement",PHYSICAL_REQUIREMENT:"Physical Requirement",DESIGN_CONSTRAINT:"Design Constraint"},this.RiskLevel={LOW_RISK:"Low",MED_RISK:"Medium",HIGH_RISK:"High"},this.VerifyType={VERIFY_ANALYSIS:"Analysis",VERIFY_DEMONSTRATION:"Demonstration",VERIFY_INSPECTION:"Inspection",VERIFY_TEST:"Test"},this.Relationships={CONTAINS:"contains",COPIES:"copies",DERIVES:"derives",SATISFIES:"satisfies",VERIFIES:"verifies",REFINES:"refines",TRACES:"traces"},this.setAccTitle=Sn,this.getAccTitle=zn,this.setAccDescription=Vn,this.getAccDescription=Gn,this.setDiagramTitle=Zn,this.getDiagramTitle=_n,this.getConfig=x(()=>we().requirement,"getConfig"),this.clear(),this.setDirection=this.setDirection.bind(this),this.addRequirement=this.addRequirement.bind(this),this.setNewReqId=this.setNewReqId.bind(this),this.setNewReqRisk=this.setNewReqRisk.bind(this),this.setNewReqText=this.setNewReqText.bind(this),this.setNewReqVerifyMethod=this.setNewReqVerifyMethod.bind(this),this.addElement=this.addElement.bind(this),this.setNewElementType=this.setNewElementType.bind(this),this.setNewElementDocRef=this.setNewElementDocRef.bind(this),this.addRelationship=this.addRelationship.bind(this),this.setCssStyle=this.setCssStyle.bind(this),this.setClass=this.setClass.bind(this),this.defineClass=this.defineClass.bind(this),this.setAccTitle=this.setAccTitle.bind(this),this.setAccDescription=this.setAccDescription.bind(this)}static{x(this,"RequirementDB")}getDirection(){return this.direction}setDirection(t){this.direction=t}resetLatestRequirement(){this.latestRequirement=this.getInitialRequirement()}resetLatestElement(){this.latestElement=this.getInitialElement()}getInitialRequirement(){return{requirementId:"",text:"",risk:"",verifyMethod:"",name:"",type:"",cssStyles:[],classes:["default"]}}getInitialElement(){return{name:"",type:"",docRef:"",cssStyles:[],classes:["default"]}}addRequirement(t,e){return this.requirements.has(t)||this.requirements.set(t,{name:t,type:e,requirementId:this.latestRequirement.requirementId,text:this.latestRequirement.text,risk:this.latestRequirement.risk,verifyMethod:this.latestRequirement.verifyMethod,cssStyles:[],classes:["default"]}),this.resetLatestRequirement(),this.requirements.get(t)}getRequirements(){return this.requirements}setNewReqId(t){this.latestRequirement!==void 0&&(this.latestRequirement.requirementId=t)}setNewReqText(t){this.latestRequirement!==void 0&&(this.latestRequirement.text=t)}setNewReqRisk(t){this.latestRequirement!==void 0&&(this.latestRequirement.risk=t)}setNewReqVerifyMethod(t){this.latestRequirement!==void 0&&(this.latestRequirement.verifyMethod=t)}addElement(t){return this.elements.has(t)||(this.elements.set(t,{name:t,type:this.latestElement.type,docRef:this.latestElement.docRef,cssStyles:[],classes:["default"]}),ie.info("Added new element: ",t)),this.resetLatestElement(),this.elements.get(t)}getElements(){return this.elements}setNewElementType(t){this.latestElement!==void 0&&(this.latestElement.type=t)}setNewElementDocRef(t){this.latestElement!==void 0&&(this.latestElement.docRef=t)}addRelationship(t,e,r){this.relations.push({type:t,src:e,dst:r})}getRelationships(){return this.relations}clear(){this.relations=[],this.resetLatestRequirement(),this.requirements=new Map,this.resetLatestElement(),this.elements=new Map,this.classes=new Map,An()}setCssStyle(t,e){for(const r of t){const n=this.requirements.get(r)??this.elements.get(r);if(!e||!n)return;for(const i of e)i.includes(",")?n.cssStyles.push(...i.split(",")):n.cssStyles.push(i)}}setClass(t,e){for(const r of t){const n=this.requirements.get(r)??this.elements.get(r);if(n)for(const i of e){n.classes.push(i);const a=this.classes.get(i)?.styles;a&&n.cssStyles.push(...a)}}}defineClass(t,e){for(const r of t){let n=this.classes.get(r);n===void 0&&(n={id:r,styles:[],textStyles:[]},this.classes.set(r,n)),e&&e.forEach(function(i){if(/color/.exec(i)){const a=i.replace("fill","bgFill");n.textStyles.push(a)}n.styles.push(i)}),this.requirements.forEach(i=>{i.classes.includes(r)&&i.cssStyles.push(...e.flatMap(a=>a.split(",")))}),this.elements.forEach(i=>{i.classes.includes(r)&&i.cssStyles.push(...e.flatMap(a=>a.split(",")))})}}getClasses(){return this.classes}getData(){const t=we(),e=[],r=[];for(const n of this.requirements.values()){const i=n;i.id=n.name,i.cssStyles=n.cssStyles,i.cssClasses=n.classes.join(" "),i.shape="requirementBox",i.look=t.look,e.push(i)}for(const n of this.elements.values()){const i=n;i.shape="requirementBox",i.look=t.look,i.id=n.name,i.cssStyles=n.cssStyles,i.cssClasses=n.classes.join(" "),e.push(i)}for(const n of this.relations){let i=0;const a=n.type===this.Relationships.CONTAINS,s={id:`${n.src}-${n.dst}-${i}`,start:this.requirements.get(n.src)?.name??this.elements.get(n.src)?.name,end:this.requirements.get(n.dst)?.name??this.elements.get(n.dst)?.name,label:`&lt;&lt;${n.type}&gt;&gt;`,classes:"relationshipLine",style:["fill:none",a?"":"stroke-dasharray: 10,7"],labelpos:"c",thickness:"normal",type:"normal",pattern:a?"normal":"dashed",arrowTypeStart:a?"requirement_contains":"",arrowTypeEnd:a?"":"requirement_arrow",look:t.look};r.push(s),i++}return{nodes:e,edges:r,other:{},config:t,direction:this.getDirection()}}},SCe=x(t=>`

  marker {
    fill: ${t.relationColor};
    stroke: ${t.relationColor};
  }

  marker.cross {
    stroke: ${t.lineColor};
  }

  svg {
    font-family: ${t.fontFamily};
    font-size: ${t.fontSize};
  }

  .reqBox {
    fill: ${t.requirementBackground};
    fill-opacity: 1.0;
    stroke: ${t.requirementBorderColor};
    stroke-width: ${t.requirementBorderSize};
  }
  
  .reqTitle, .reqLabel{
    fill:  ${t.requirementTextColor};
  }
  .reqLabelBox {
    fill: ${t.relationLabelBackground};
    fill-opacity: 1.0;
  }

  .req-title-line {
    stroke: ${t.requirementBorderColor};
    stroke-width: ${t.requirementBorderSize};
  }
  .relationshipLine {
    stroke: ${t.relationColor};
    stroke-width: 1;
  }
  .relationshipLabel {
    fill: ${t.relationLabelColor};
  }
  .divider {
    stroke: ${t.nodeBorder};
    stroke-width: 1;
  }
  .label {
    font-family: ${t.fontFamily};
    color: ${t.nodeTextColor||t.textColor};
  }
  .label text,span {
    fill: ${t.nodeTextColor||t.textColor};
    color: ${t.nodeTextColor||t.textColor};
  }
  .labelBkg {
    background-color: ${t.edgeLabelBackground};
  }

`,"getStyles"),CCe=SCe,cH={};Dy(cH,{draw:()=>ACe});var ACe=x(async function(t,e,r,n){ie.info("REF0:"),ie.info("Drawing requirement diagram (unified)",e);const{securityLevel:i,state:a,layout:s}=we(),o=n.db.getData(),l=Pd(e,i);o.type=n.type,o.layoutAlgorithm=Vp(s),o.nodeSpacing=a?.nodeSpacing??50,o.rankSpacing=a?.rankSpacing??50,o.markers=["requirement_contains","requirement_arrow"],o.diagramId=e,await Sd(o,l);const u=8;Kt.insertTitle(l,"requirementDiagramTitleText",a?.titleTopMargin??25,n.db.getDiagramTitle()),Bu(l,u,"requirementDiagram",a?.useMaxWidth??!0)},"draw"),_Ce={parser:ECe,get db(){return new kCe},renderer:cH,styles:CCe};const LCe=Object.freeze(Object.defineProperty({__proto__:null,diagram:_Ce},Symbol.toStringTag,{value:"Module"}));var ST=function(){var t=x(function(Z,X,Y,ee){for(Y=Y||{},ee=Z.length;ee--;Y[Z[ee]]=X);return Y},"o"),e=[1,2],r=[1,3],n=[1,4],i=[2,4],a=[1,9],s=[1,11],o=[1,13],l=[1,14],u=[1,16],h=[1,17],d=[1,18],f=[1,24],p=[1,25],g=[1,26],m=[1,27],v=[1,28],y=[1,29],b=[1,30],w=[1,31],T=[1,32],E=[1,33],L=[1,34],S=[1,35],C=[1,36],A=[1,37],N=[1,38],_=[1,39],O=[1,41],P=[1,42],k=[1,43],R=[1,44],I=[1,45],M=[1,46],D=[1,4,5,13,14,16,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,47,48,49,50,52,53,55,60,61,62,63,71],B=[2,71],$=[4,5,16,50,52,53],F=[4,5,13,14,16,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,50,52,53,55,60,61,62,63,71],G=[4,5,13,14,16,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,49,50,52,53,55,60,61,62,63,71],W=[4,5,13,14,16,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,48,50,52,53,55,60,61,62,63,71],J=[4,5,13,14,16,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,47,50,52,53,55,60,61,62,63,71],q=[69,70,71],ne=[1,127],ae={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SPACE:4,NEWLINE:5,SD:6,document:7,line:8,statement:9,box_section:10,box_line:11,participant_statement:12,create:13,box:14,restOfLine:15,end:16,signal:17,autonumber:18,NUM:19,off:20,activate:21,actor:22,deactivate:23,note_statement:24,links_statement:25,link_statement:26,properties_statement:27,details_statement:28,title:29,legacy_title:30,acc_title:31,acc_title_value:32,acc_descr:33,acc_descr_value:34,acc_descr_multiline_value:35,loop:36,rect:37,opt:38,alt:39,else_sections:40,par:41,par_sections:42,par_over:43,critical:44,option_sections:45,break:46,option:47,and:48,else:49,participant:50,AS:51,participant_actor:52,destroy:53,actor_with_config:54,note:55,placement:56,text2:57,over:58,actor_pair:59,links:60,link:61,properties:62,details:63,spaceList:64,",":65,left_of:66,right_of:67,signaltype:68,"+":69,"-":70,ACTOR:71,config_object:72,CONFIG_START:73,CONFIG_CONTENT:74,CONFIG_END:75,SOLID_OPEN_ARROW:76,DOTTED_OPEN_ARROW:77,SOLID_ARROW:78,BIDIRECTIONAL_SOLID_ARROW:79,DOTTED_ARROW:80,BIDIRECTIONAL_DOTTED_ARROW:81,SOLID_CROSS:82,DOTTED_CROSS:83,SOLID_POINT:84,DOTTED_POINT:85,TXT:86,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NEWLINE",6:"SD",13:"create",14:"box",15:"restOfLine",16:"end",18:"autonumber",19:"NUM",20:"off",21:"activate",23:"deactivate",29:"title",30:"legacy_title",31:"acc_title",32:"acc_title_value",33:"acc_descr",34:"acc_descr_value",35:"acc_descr_multiline_value",36:"loop",37:"rect",38:"opt",39:"alt",41:"par",43:"par_over",44:"critical",46:"break",47:"option",48:"and",49:"else",50:"participant",51:"AS",52:"participant_actor",53:"destroy",55:"note",58:"over",60:"links",61:"link",62:"properties",63:"details",65:",",66:"left_of",67:"right_of",69:"+",70:"-",71:"ACTOR",73:"CONFIG_START",74:"CONFIG_CONTENT",75:"CONFIG_END",76:"SOLID_OPEN_ARROW",77:"DOTTED_OPEN_ARROW",78:"SOLID_ARROW",79:"BIDIRECTIONAL_SOLID_ARROW",80:"DOTTED_ARROW",81:"BIDIRECTIONAL_DOTTED_ARROW",82:"SOLID_CROSS",83:"DOTTED_CROSS",84:"SOLID_POINT",85:"DOTTED_POINT",86:"TXT"},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[10,0],[10,2],[11,2],[11,1],[11,1],[9,1],[9,2],[9,4],[9,2],[9,4],[9,3],[9,3],[9,2],[9,3],[9,3],[9,2],[9,2],[9,2],[9,2],[9,2],[9,1],[9,1],[9,2],[9,2],[9,1],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[45,1],[45,4],[42,1],[42,4],[40,1],[40,4],[12,5],[12,3],[12,5],[12,3],[12,3],[12,3],[24,4],[24,4],[25,3],[26,3],[27,3],[28,3],[64,2],[64,1],[59,3],[59,1],[56,1],[56,1],[17,5],[17,5],[17,4],[54,2],[72,3],[22,1],[68,1],[68,1],[68,1],[68,1],[68,1],[68,1],[68,1],[68,1],[68,1],[68,1],[57,1]],performAction:x(function(X,Y,ee,j,fe,te,Ae){var H=te.length-1;switch(fe){case 3:return j.apply(te[H]),te[H];case 4:case 9:this.$=[];break;case 5:case 10:te[H-1].push(te[H]),this.$=te[H-1];break;case 6:case 7:case 11:case 12:this.$=te[H];break;case 8:case 13:this.$=[];break;case 15:te[H].type="createParticipant",this.$=te[H];break;case 16:te[H-1].unshift({type:"boxStart",boxData:j.parseBoxData(te[H-2])}),te[H-1].push({type:"boxEnd",boxText:te[H-2]}),this.$=te[H-1];break;case 18:this.$={type:"sequenceIndex",sequenceIndex:Number(te[H-2]),sequenceIndexStep:Number(te[H-1]),sequenceVisible:!0,signalType:j.LINETYPE.AUTONUMBER};break;case 19:this.$={type:"sequenceIndex",sequenceIndex:Number(te[H-1]),sequenceIndexStep:1,sequenceVisible:!0,signalType:j.LINETYPE.AUTONUMBER};break;case 20:this.$={type:"sequenceIndex",sequenceVisible:!1,signalType:j.LINETYPE.AUTONUMBER};break;case 21:this.$={type:"sequenceIndex",sequenceVisible:!0,signalType:j.LINETYPE.AUTONUMBER};break;case 22:this.$={type:"activeStart",signalType:j.LINETYPE.ACTIVE_START,actor:te[H-1].actor};break;case 23:this.$={type:"activeEnd",signalType:j.LINETYPE.ACTIVE_END,actor:te[H-1].actor};break;case 29:j.setDiagramTitle(te[H].substring(6)),this.$=te[H].substring(6);break;case 30:j.setDiagramTitle(te[H].substring(7)),this.$=te[H].substring(7);break;case 31:this.$=te[H].trim(),j.setAccTitle(this.$);break;case 32:case 33:this.$=te[H].trim(),j.setAccDescription(this.$);break;case 34:te[H-1].unshift({type:"loopStart",loopText:j.parseMessage(te[H-2]),signalType:j.LINETYPE.LOOP_START}),te[H-1].push({type:"loopEnd",loopText:te[H-2],signalType:j.LINETYPE.LOOP_END}),this.$=te[H-1];break;case 35:te[H-1].unshift({type:"rectStart",color:j.parseMessage(te[H-2]),signalType:j.LINETYPE.RECT_START}),te[H-1].push({type:"rectEnd",color:j.parseMessage(te[H-2]),signalType:j.LINETYPE.RECT_END}),this.$=te[H-1];break;case 36:te[H-1].unshift({type:"optStart",optText:j.parseMessage(te[H-2]),signalType:j.LINETYPE.OPT_START}),te[H-1].push({type:"optEnd",optText:j.parseMessage(te[H-2]),signalType:j.LINETYPE.OPT_END}),this.$=te[H-1];break;case 37:te[H-1].unshift({type:"altStart",altText:j.parseMessage(te[H-2]),signalType:j.LINETYPE.ALT_START}),te[H-1].push({type:"altEnd",signalType:j.LINETYPE.ALT_END}),this.$=te[H-1];break;case 38:te[H-1].unshift({type:"parStart",parText:j.parseMessage(te[H-2]),signalType:j.LINETYPE.PAR_START}),te[H-1].push({type:"parEnd",signalType:j.LINETYPE.PAR_END}),this.$=te[H-1];break;case 39:te[H-1].unshift({type:"parStart",parText:j.parseMessage(te[H-2]),signalType:j.LINETYPE.PAR_OVER_START}),te[H-1].push({type:"parEnd",signalType:j.LINETYPE.PAR_END}),this.$=te[H-1];break;case 40:te[H-1].unshift({type:"criticalStart",criticalText:j.parseMessage(te[H-2]),signalType:j.LINETYPE.CRITICAL_START}),te[H-1].push({type:"criticalEnd",signalType:j.LINETYPE.CRITICAL_END}),this.$=te[H-1];break;case 41:te[H-1].unshift({type:"breakStart",breakText:j.parseMessage(te[H-2]),signalType:j.LINETYPE.BREAK_START}),te[H-1].push({type:"breakEnd",optText:j.parseMessage(te[H-2]),signalType:j.LINETYPE.BREAK_END}),this.$=te[H-1];break;case 43:this.$=te[H-3].concat([{type:"option",optionText:j.parseMessage(te[H-1]),signalType:j.LINETYPE.CRITICAL_OPTION},te[H]]);break;case 45:this.$=te[H-3].concat([{type:"and",parText:j.parseMessage(te[H-1]),signalType:j.LINETYPE.PAR_AND},te[H]]);break;case 47:this.$=te[H-3].concat([{type:"else",altText:j.parseMessage(te[H-1]),signalType:j.LINETYPE.ALT_ELSE},te[H]]);break;case 48:te[H-3].draw="participant",te[H-3].type="addParticipant",te[H-3].description=j.parseMessage(te[H-1]),this.$=te[H-3];break;case 49:te[H-1].draw="participant",te[H-1].type="addParticipant",this.$=te[H-1];break;case 50:te[H-3].draw="actor",te[H-3].type="addParticipant",te[H-3].description=j.parseMessage(te[H-1]),this.$=te[H-3];break;case 51:te[H-1].draw="actor",te[H-1].type="addParticipant",this.$=te[H-1];break;case 52:te[H-1].type="destroyParticipant",this.$=te[H-1];break;case 53:te[H-1].draw="participant",te[H-1].type="addParticipant",this.$=te[H-1];break;case 54:this.$=[te[H-1],{type:"addNote",placement:te[H-2],actor:te[H-1].actor,text:te[H]}];break;case 55:te[H-2]=[].concat(te[H-1],te[H-1]).slice(0,2),te[H-2][0]=te[H-2][0].actor,te[H-2][1]=te[H-2][1].actor,this.$=[te[H-1],{type:"addNote",placement:j.PLACEMENT.OVER,actor:te[H-2].slice(0,2),text:te[H]}];break;case 56:this.$=[te[H-1],{type:"addLinks",actor:te[H-1].actor,text:te[H]}];break;case 57:this.$=[te[H-1],{type:"addALink",actor:te[H-1].actor,text:te[H]}];break;case 58:this.$=[te[H-1],{type:"addProperties",actor:te[H-1].actor,text:te[H]}];break;case 59:this.$=[te[H-1],{type:"addDetails",actor:te[H-1].actor,text:te[H]}];break;case 62:this.$=[te[H-2],te[H]];break;case 63:this.$=te[H];break;case 64:this.$=j.PLACEMENT.LEFTOF;break;case 65:this.$=j.PLACEMENT.RIGHTOF;break;case 66:this.$=[te[H-4],te[H-1],{type:"addMessage",from:te[H-4].actor,to:te[H-1].actor,signalType:te[H-3],msg:te[H],activate:!0},{type:"activeStart",signalType:j.LINETYPE.ACTIVE_START,actor:te[H-1].actor}];break;case 67:this.$=[te[H-4],te[H-1],{type:"addMessage",from:te[H-4].actor,to:te[H-1].actor,signalType:te[H-3],msg:te[H]},{type:"activeEnd",signalType:j.LINETYPE.ACTIVE_END,actor:te[H-4].actor}];break;case 68:this.$=[te[H-3],te[H-1],{type:"addMessage",from:te[H-3].actor,to:te[H-1].actor,signalType:te[H-2],msg:te[H]}];break;case 69:this.$={type:"addParticipant",actor:te[H-1],config:te[H]};break;case 70:this.$=te[H-1].trim();break;case 71:this.$={type:"addParticipant",actor:te[H]};break;case 72:this.$=j.LINETYPE.SOLID_OPEN;break;case 73:this.$=j.LINETYPE.DOTTED_OPEN;break;case 74:this.$=j.LINETYPE.SOLID;break;case 75:this.$=j.LINETYPE.BIDIRECTIONAL_SOLID;break;case 76:this.$=j.LINETYPE.DOTTED;break;case 77:this.$=j.LINETYPE.BIDIRECTIONAL_DOTTED;break;case 78:this.$=j.LINETYPE.SOLID_CROSS;break;case 79:this.$=j.LINETYPE.DOTTED_CROSS;break;case 80:this.$=j.LINETYPE.SOLID_POINT;break;case 81:this.$=j.LINETYPE.DOTTED_POINT;break;case 82:this.$=j.parseMessage(te[H].trim().substring(1));break}},"anonymous"),table:[{3:1,4:e,5:r,6:n},{1:[3]},{3:5,4:e,5:r,6:n},{3:6,4:e,5:r,6:n},t([1,4,5,13,14,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,50,52,53,55,60,61,62,63,71],i,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:a,5:s,8:8,9:10,12:12,13:o,14:l,17:15,18:u,21:h,22:40,23:d,24:19,25:20,26:21,27:22,28:23,29:f,30:p,31:g,33:m,35:v,36:y,37:b,38:w,39:T,41:E,43:L,44:S,46:C,50:A,52:N,53:_,55:O,60:P,61:k,62:R,63:I,71:M},t(D,[2,5]),{9:47,12:12,13:o,14:l,17:15,18:u,21:h,22:40,23:d,24:19,25:20,26:21,27:22,28:23,29:f,30:p,31:g,33:m,35:v,36:y,37:b,38:w,39:T,41:E,43:L,44:S,46:C,50:A,52:N,53:_,55:O,60:P,61:k,62:R,63:I,71:M},t(D,[2,7]),t(D,[2,8]),t(D,[2,14]),{12:48,50:A,52:N,53:_},{15:[1,49]},{5:[1,50]},{5:[1,53],19:[1,51],20:[1,52]},{22:54,71:M},{22:55,71:M},{5:[1,56]},{5:[1,57]},{5:[1,58]},{5:[1,59]},{5:[1,60]},t(D,[2,29]),t(D,[2,30]),{32:[1,61]},{34:[1,62]},t(D,[2,33]),{15:[1,63]},{15:[1,64]},{15:[1,65]},{15:[1,66]},{15:[1,67]},{15:[1,68]},{15:[1,69]},{15:[1,70]},{22:71,54:72,71:[1,73]},{22:74,71:M},{22:75,71:M},{68:76,76:[1,77],77:[1,78],78:[1,79],79:[1,80],80:[1,81],81:[1,82],82:[1,83],83:[1,84],84:[1,85],85:[1,86]},{56:87,58:[1,88],66:[1,89],67:[1,90]},{22:91,71:M},{22:92,71:M},{22:93,71:M},{22:94,71:M},t([5,51,65,76,77,78,79,80,81,82,83,84,85,86],B),t(D,[2,6]),t(D,[2,15]),t($,[2,9],{10:95}),t(D,[2,17]),{5:[1,97],19:[1,96]},{5:[1,98]},t(D,[2,21]),{5:[1,99]},{5:[1,100]},t(D,[2,24]),t(D,[2,25]),t(D,[2,26]),t(D,[2,27]),t(D,[2,28]),t(D,[2,31]),t(D,[2,32]),t(F,i,{7:101}),t(F,i,{7:102}),t(F,i,{7:103}),t(G,i,{40:104,7:105}),t(W,i,{42:106,7:107}),t(W,i,{7:107,42:108}),t(J,i,{45:109,7:110}),t(F,i,{7:111}),{5:[1,113],51:[1,112]},{5:[1,114]},t([5,51],B,{72:115,73:[1,116]}),{5:[1,118],51:[1,117]},{5:[1,119]},{22:122,69:[1,120],70:[1,121],71:M},t(q,[2,72]),t(q,[2,73]),t(q,[2,74]),t(q,[2,75]),t(q,[2,76]),t(q,[2,77]),t(q,[2,78]),t(q,[2,79]),t(q,[2,80]),t(q,[2,81]),{22:123,71:M},{22:125,59:124,71:M},{71:[2,64]},{71:[2,65]},{57:126,86:ne},{57:128,86:ne},{57:129,86:ne},{57:130,86:ne},{4:[1,133],5:[1,135],11:132,12:134,16:[1,131],50:A,52:N,53:_},{5:[1,136]},t(D,[2,19]),t(D,[2,20]),t(D,[2,22]),t(D,[2,23]),{4:a,5:s,8:8,9:10,12:12,13:o,14:l,16:[1,137],17:15,18:u,21:h,22:40,23:d,24:19,25:20,26:21,27:22,28:23,29:f,30:p,31:g,33:m,35:v,36:y,37:b,38:w,39:T,41:E,43:L,44:S,46:C,50:A,52:N,53:_,55:O,60:P,61:k,62:R,63:I,71:M},{4:a,5:s,8:8,9:10,12:12,13:o,14:l,16:[1,138],17:15,18:u,21:h,22:40,23:d,24:19,25:20,26:21,27:22,28:23,29:f,30:p,31:g,33:m,35:v,36:y,37:b,38:w,39:T,41:E,43:L,44:S,46:C,50:A,52:N,53:_,55:O,60:P,61:k,62:R,63:I,71:M},{4:a,5:s,8:8,9:10,12:12,13:o,14:l,16:[1,139],17:15,18:u,21:h,22:40,23:d,24:19,25:20,26:21,27:22,28:23,29:f,30:p,31:g,33:m,35:v,36:y,37:b,38:w,39:T,41:E,43:L,44:S,46:C,50:A,52:N,53:_,55:O,60:P,61:k,62:R,63:I,71:M},{16:[1,140]},{4:a,5:s,8:8,9:10,12:12,13:o,14:l,16:[2,46],17:15,18:u,21:h,22:40,23:d,24:19,25:20,26:21,27:22,28:23,29:f,30:p,31:g,33:m,35:v,36:y,37:b,38:w,39:T,41:E,43:L,44:S,46:C,49:[1,141],50:A,52:N,53:_,55:O,60:P,61:k,62:R,63:I,71:M},{16:[1,142]},{4:a,5:s,8:8,9:10,12:12,13:o,14:l,16:[2,44],17:15,18:u,21:h,22:40,23:d,24:19,25:20,26:21,27:22,28:23,29:f,30:p,31:g,33:m,35:v,36:y,37:b,38:w,39:T,41:E,43:L,44:S,46:C,48:[1,143],50:A,52:N,53:_,55:O,60:P,61:k,62:R,63:I,71:M},{16:[1,144]},{16:[1,145]},{4:a,5:s,8:8,9:10,12:12,13:o,14:l,16:[2,42],17:15,18:u,21:h,22:40,23:d,24:19,25:20,26:21,27:22,28:23,29:f,30:p,31:g,33:m,35:v,36:y,37:b,38:w,39:T,41:E,43:L,44:S,46:C,47:[1,146],50:A,52:N,53:_,55:O,60:P,61:k,62:R,63:I,71:M},{4:a,5:s,8:8,9:10,12:12,13:o,14:l,16:[1,147],17:15,18:u,21:h,22:40,23:d,24:19,25:20,26:21,27:22,28:23,29:f,30:p,31:g,33:m,35:v,36:y,37:b,38:w,39:T,41:E,43:L,44:S,46:C,50:A,52:N,53:_,55:O,60:P,61:k,62:R,63:I,71:M},{15:[1,148]},t(D,[2,49]),t(D,[2,53]),{5:[2,69]},{74:[1,149]},{15:[1,150]},t(D,[2,51]),t(D,[2,52]),{22:151,71:M},{22:152,71:M},{57:153,86:ne},{57:154,86:ne},{57:155,86:ne},{65:[1,156],86:[2,63]},{5:[2,56]},{5:[2,82]},{5:[2,57]},{5:[2,58]},{5:[2,59]},t(D,[2,16]),t($,[2,10]),{12:157,50:A,52:N,53:_},t($,[2,12]),t($,[2,13]),t(D,[2,18]),t(D,[2,34]),t(D,[2,35]),t(D,[2,36]),t(D,[2,37]),{15:[1,158]},t(D,[2,38]),{15:[1,159]},t(D,[2,39]),t(D,[2,40]),{15:[1,160]},t(D,[2,41]),{5:[1,161]},{75:[1,162]},{5:[1,163]},{57:164,86:ne},{57:165,86:ne},{5:[2,68]},{5:[2,54]},{5:[2,55]},{22:166,71:M},t($,[2,11]),t(G,i,{7:105,40:167}),t(W,i,{7:107,42:168}),t(J,i,{7:110,45:169}),t(D,[2,48]),{5:[2,70]},t(D,[2,50]),{5:[2,66]},{5:[2,67]},{86:[2,62]},{16:[2,47]},{16:[2,45]},{16:[2,43]}],defaultActions:{5:[2,1],6:[2,2],89:[2,64],90:[2,65],115:[2,69],126:[2,56],127:[2,82],128:[2,57],129:[2,58],130:[2,59],153:[2,68],154:[2,54],155:[2,55],162:[2,70],164:[2,66],165:[2,67],166:[2,62],167:[2,47],168:[2,45],169:[2,43]},parseError:x(function(X,Y){if(Y.recoverable)this.trace(X);else{var ee=new Error(X);throw ee.hash=Y,ee}},"parseError"),parse:x(function(X){var Y=this,ee=[0],j=[],fe=[null],te=[],Ae=this.table,H="",Oe=0,ue=0,Ve=2,Ge=1,Ue=te.slice.call(arguments,1),ke=Object.create(this.lexer),Pe={yy:{}};for(var Se in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Se)&&(Pe.yy[Se]=this.yy[Se]);ke.setInput(X,Pe.yy),Pe.yy.lexer=ke,Pe.yy.parser=this,typeof ke.yylloc>"u"&&(ke.yylloc={});var _e=ke.yylloc;te.push(_e);var ze=ke.options&&ke.options.ranges;typeof Pe.yy.parseError=="function"?this.parseError=Pe.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function me(Ne){ee.length=ee.length-2*Ne,fe.length=fe.length-Ne,te.length=te.length-Ne}x(me,"popStack");function De(){var Ne;return Ne=j.pop()||ke.lex()||Ge,typeof Ne!="number"&&(Ne instanceof Array&&(j=Ne,Ne=j.pop()),Ne=Y.symbols_[Ne]||Ne),Ne}x(De,"lex");for(var Q,ce,z,oe,se={},ge,he,be,Ce;;){if(ce=ee[ee.length-1],this.defaultActions[ce]?z=this.defaultActions[ce]:((Q===null||typeof Q>"u")&&(Q=De()),z=Ae[ce]&&Ae[ce][Q]),typeof z>"u"||!z.length||!z[0]){var Te="";Ce=[];for(ge in Ae[ce])this.terminals_[ge]&&ge>Ve&&Ce.push("'"+this.terminals_[ge]+"'");ke.showPosition?Te="Parse error on line "+(Oe+1)+`:
`+ke.showPosition()+`
Expecting `+Ce.join(", ")+", got '"+(this.terminals_[Q]||Q)+"'":Te="Parse error on line "+(Oe+1)+": Unexpected "+(Q==Ge?"end of input":"'"+(this.terminals_[Q]||Q)+"'"),this.parseError(Te,{text:ke.match,token:this.terminals_[Q]||Q,line:ke.yylineno,loc:_e,expected:Ce})}if(z[0]instanceof Array&&z.length>1)throw new Error("Parse Error: multiple actions possible at state: "+ce+", token: "+Q);switch(z[0]){case 1:ee.push(Q),fe.push(ke.yytext),te.push(ke.yylloc),ee.push(z[1]),Q=null,ue=ke.yyleng,H=ke.yytext,Oe=ke.yylineno,_e=ke.yylloc;break;case 2:if(he=this.productions_[z[1]][1],se.$=fe[fe.length-he],se._$={first_line:te[te.length-(he||1)].first_line,last_line:te[te.length-1].last_line,first_column:te[te.length-(he||1)].first_column,last_column:te[te.length-1].last_column},ze&&(se._$.range=[te[te.length-(he||1)].range[0],te[te.length-1].range[1]]),oe=this.performAction.apply(se,[H,ue,Oe,Pe.yy,z[1],fe,te].concat(Ue)),typeof oe<"u")return oe;he&&(ee=ee.slice(0,-1*he*2),fe=fe.slice(0,-1*he),te=te.slice(0,-1*he)),ee.push(this.productions_[z[1]][0]),fe.push(se.$),te.push(se._$),be=Ae[ee[ee.length-2]][ee[ee.length-1]],ee.push(be);break;case 3:return!0}}return!0},"parse")},pe=function(){var Z={EOF:1,parseError:x(function(Y,ee){if(this.yy.parser)this.yy.parser.parseError(Y,ee);else throw new Error(Y)},"parseError"),setInput:x(function(X,Y){return this.yy=Y||this.yy||{},this._input=X,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:x(function(){var X=this._input[0];this.yytext+=X,this.yyleng++,this.offset++,this.match+=X,this.matched+=X;var Y=X.match(/(?:\r\n?|\n).*/g);return Y?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),X},"input"),unput:x(function(X){var Y=X.length,ee=X.split(/(?:\r\n?|\n)/g);this._input=X+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-Y),this.offset-=Y;var j=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),ee.length-1&&(this.yylineno-=ee.length-1);var fe=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:ee?(ee.length===j.length?this.yylloc.first_column:0)+j[j.length-ee.length].length-ee[0].length:this.yylloc.first_column-Y},this.options.ranges&&(this.yylloc.range=[fe[0],fe[0]+this.yyleng-Y]),this.yyleng=this.yytext.length,this},"unput"),more:x(function(){return this._more=!0,this},"more"),reject:x(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:x(function(X){this.unput(this.match.slice(X))},"less"),pastInput:x(function(){var X=this.matched.substr(0,this.matched.length-this.match.length);return(X.length>20?"...":"")+X.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:x(function(){var X=this.match;return X.length<20&&(X+=this._input.substr(0,20-X.length)),(X.substr(0,20)+(X.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:x(function(){var X=this.pastInput(),Y=new Array(X.length+1).join("-");return X+this.upcomingInput()+`
`+Y+"^"},"showPosition"),test_match:x(function(X,Y){var ee,j,fe;if(this.options.backtrack_lexer&&(fe={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(fe.yylloc.range=this.yylloc.range.slice(0))),j=X[0].match(/(?:\r\n?|\n).*/g),j&&(this.yylineno+=j.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:j?j[j.length-1].length-j[j.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+X[0].length},this.yytext+=X[0],this.match+=X[0],this.matches=X,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(X[0].length),this.matched+=X[0],ee=this.performAction.call(this,this.yy,this,Y,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),ee)return ee;if(this._backtrack){for(var te in fe)this[te]=fe[te];return!1}return!1},"test_match"),next:x(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var X,Y,ee,j;this._more||(this.yytext="",this.match="");for(var fe=this._currentRules(),te=0;te<fe.length;te++)if(ee=this._input.match(this.rules[fe[te]]),ee&&(!Y||ee[0].length>Y[0].length)){if(Y=ee,j=te,this.options.backtrack_lexer){if(X=this.test_match(ee,fe[te]),X!==!1)return X;if(this._backtrack){Y=!1;continue}else return!1}else if(!this.options.flex)break}return Y?(X=this.test_match(Y,fe[j]),X!==!1?X:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var Y=this.next();return Y||this.lex()},"lex"),begin:x(function(Y){this.conditionStack.push(Y)},"begin"),popState:x(function(){var Y=this.conditionStack.length-1;return Y>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(Y){return Y=this.conditionStack.length-1-Math.abs(Y||0),Y>=0?this.conditionStack[Y]:"INITIAL"},"topState"),pushState:x(function(Y){this.begin(Y)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:x(function(Y,ee,j,fe){switch(j){case 0:return 5;case 1:break;case 2:break;case 3:break;case 4:break;case 5:break;case 6:return 19;case 7:return this.begin("CONFIG"),73;case 8:return 74;case 9:return this.popState(),this.popState(),75;case 10:return ee.yytext=ee.yytext.trim(),71;case 11:return ee.yytext=ee.yytext.trim(),this.begin("ALIAS"),71;case 12:return this.begin("LINE"),14;case 13:return this.begin("ID"),50;case 14:return this.begin("ID"),52;case 15:return 13;case 16:return this.begin("ID"),53;case 17:return ee.yytext=ee.yytext.trim(),this.begin("ALIAS"),71;case 18:return this.popState(),this.popState(),this.begin("LINE"),51;case 19:return this.popState(),this.popState(),5;case 20:return this.begin("LINE"),36;case 21:return this.begin("LINE"),37;case 22:return this.begin("LINE"),38;case 23:return this.begin("LINE"),39;case 24:return this.begin("LINE"),49;case 25:return this.begin("LINE"),41;case 26:return this.begin("LINE"),43;case 27:return this.begin("LINE"),48;case 28:return this.begin("LINE"),44;case 29:return this.begin("LINE"),47;case 30:return this.begin("LINE"),46;case 31:return this.popState(),15;case 32:return 16;case 33:return 66;case 34:return 67;case 35:return 60;case 36:return 61;case 37:return 62;case 38:return 63;case 39:return 58;case 40:return 55;case 41:return this.begin("ID"),21;case 42:return this.begin("ID"),23;case 43:return 29;case 44:return 30;case 45:return this.begin("acc_title"),31;case 46:return this.popState(),"acc_title_value";case 47:return this.begin("acc_descr"),33;case 48:return this.popState(),"acc_descr_value";case 49:this.begin("acc_descr_multiline");break;case 50:this.popState();break;case 51:return"acc_descr_multiline_value";case 52:return 6;case 53:return 18;case 54:return 20;case 55:return 65;case 56:return 5;case 57:return ee.yytext=ee.yytext.trim(),71;case 58:return 78;case 59:return 79;case 60:return 80;case 61:return 81;case 62:return 76;case 63:return 77;case 64:return 82;case 65:return 83;case 66:return 84;case 67:return 85;case 68:return 86;case 69:return 86;case 70:return 69;case 71:return 70;case 72:return 5;case 73:return"INVALID"}},"anonymous"),rules:[/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[0-9]+(?=[ \n]+))/i,/^(?:@\{)/i,/^(?:[^\}]+)/i,/^(?:\})/i,/^(?:[^\<->\->:\n,;@\s]+(?=@\{))/i,/^(?:[^\<->\->:\n,;@]+?([\-]*[^\<->\->:\n,;@]+?)*?(?=((?!\n)\s)+as(?!\n)\s|[#\n;]|$))/i,/^(?:box\b)/i,/^(?:participant\b)/i,/^(?:actor\b)/i,/^(?:create\b)/i,/^(?:destroy\b)/i,/^(?:[^<\->\->:\n,;]+?([\-]*[^<\->\->:\n,;]+?)*?(?=((?!\n)\s)+as(?!\n)\s|[#\n;]|$))/i,/^(?:as\b)/i,/^(?:(?:))/i,/^(?:loop\b)/i,/^(?:rect\b)/i,/^(?:opt\b)/i,/^(?:alt\b)/i,/^(?:else\b)/i,/^(?:par\b)/i,/^(?:par_over\b)/i,/^(?:and\b)/i,/^(?:critical\b)/i,/^(?:option\b)/i,/^(?:break\b)/i,/^(?:(?:[:]?(?:no)?wrap)?[^#\n;]*)/i,/^(?:end\b)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:links\b)/i,/^(?:link\b)/i,/^(?:properties\b)/i,/^(?:details\b)/i,/^(?:over\b)/i,/^(?:note\b)/i,/^(?:activate\b)/i,/^(?:deactivate\b)/i,/^(?:title\s[^#\n;]+)/i,/^(?:title:\s[^#\n;]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:sequenceDiagram\b)/i,/^(?:autonumber\b)/i,/^(?:off\b)/i,/^(?:,)/i,/^(?:;)/i,/^(?:[^+<\->\->:\n,;]+((?!(-x|--x|-\)|--\)))[\-]*[^\+<\->\->:\n,;]+)*)/i,/^(?:->>)/i,/^(?:<<->>)/i,/^(?:-->>)/i,/^(?:<<-->>)/i,/^(?:->)/i,/^(?:-->)/i,/^(?:-[x])/i,/^(?:--[x])/i,/^(?:-[\)])/i,/^(?:--[\)])/i,/^(?::(?:(?:no)?wrap)?[^#\n;]*)/i,/^(?::)/i,/^(?:\+)/i,/^(?:-)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[50,51],inclusive:!1},acc_descr:{rules:[48],inclusive:!1},acc_title:{rules:[46],inclusive:!1},ID:{rules:[2,3,7,10,11,17],inclusive:!1},ALIAS:{rules:[2,3,18,19],inclusive:!1},LINE:{rules:[2,3,31],inclusive:!1},CONFIG:{rules:[8,9],inclusive:!1},CONFIG_DATA:{rules:[],inclusive:!1},INITIAL:{rules:[0,1,3,4,5,6,12,13,14,15,16,20,21,22,23,24,25,26,27,28,29,30,32,33,34,35,36,37,38,39,40,41,42,43,44,45,47,49,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73],inclusive:!0}}};return Z}();ae.lexer=pe;function K(){this.yy={}}return x(K,"Parser"),K.prototype=ae,ae.Parser=K,new K}();ST.parser=ST;var RCe=ST,NCe={SOLID:0,DOTTED:1,NOTE:2,SOLID_CROSS:3,DOTTED_CROSS:4,SOLID_OPEN:5,DOTTED_OPEN:6,LOOP_START:10,LOOP_END:11,ALT_START:12,ALT_ELSE:13,ALT_END:14,OPT_START:15,OPT_END:16,ACTIVE_START:17,ACTIVE_END:18,PAR_START:19,PAR_AND:20,PAR_END:21,RECT_START:22,RECT_END:23,SOLID_POINT:24,DOTTED_POINT:25,AUTONUMBER:26,CRITICAL_START:27,CRITICAL_OPTION:28,CRITICAL_END:29,BREAK_START:30,BREAK_END:31,PAR_OVER_START:32,BIDIRECTIONAL_SOLID:33,BIDIRECTIONAL_DOTTED:34},DCe={FILLED:0,OPEN:1},MCe={LEFTOF:0,RIGHTOF:1,OVER:2},L1={ACTOR:"actor",CONTROL:"control",DATABASE:"database",ENTITY:"entity"},ICe=class{constructor(){this.state=new pG(()=>({prevActor:void 0,actors:new Map,createdActors:new Map,destroyedActors:new Map,boxes:[],messages:[],notes:[],sequenceNumbersEnabled:!1,wrapEnabled:void 0,currentBox:void 0,lastCreated:void 0,lastDestroyed:void 0})),this.setAccTitle=Sn,this.setAccDescription=Vn,this.setDiagramTitle=Zn,this.getAccTitle=zn,this.getAccDescription=Gn,this.getDiagramTitle=_n,this.apply=this.apply.bind(this),this.parseBoxData=this.parseBoxData.bind(this),this.parseMessage=this.parseMessage.bind(this),this.clear(),this.setWrap(we().wrap),this.LINETYPE=NCe,this.ARROWTYPE=DCe,this.PLACEMENT=MCe}static{x(this,"SequenceDB")}addBox(t){this.state.records.boxes.push({name:t.text,wrap:t.wrap??this.autoWrap(),fill:t.color,actorKeys:[]}),this.state.records.currentBox=this.state.records.boxes.slice(-1)[0]}addActor(t,e,r,n,i){let a=this.state.records.currentBox,s;if(i!==void 0){let l;i.includes(`
`)?l=i+`
`:l=`{
`+i+`
}`,s=Ky(l,{schema:jy})}n=s?.type??n;const o=this.state.records.actors.get(t);if(o){if(this.state.records.currentBox&&o.box&&this.state.records.currentBox!==o.box)throw new Error(`A same participant should only be defined in one Box: ${o.name} can't be in '${o.box.name}' and in '${this.state.records.currentBox.name}' at the same time.`);if(a=o.box?o.box:this.state.records.currentBox,o.box=a,o&&e===o.name&&r==null)return}if(r?.text==null&&(r={text:e,type:n}),(n==null||r.text==null)&&(r={text:e,type:n}),this.state.records.actors.set(t,{box:a,name:e,description:r.text,wrap:r.wrap??this.autoWrap(),prevActor:this.state.records.prevActor,links:{},properties:{},actorCnt:null,rectData:null,type:n??"participant"}),this.state.records.prevActor){const l=this.state.records.actors.get(this.state.records.prevActor);l&&(l.nextActor=t)}this.state.records.currentBox&&this.state.records.currentBox.actorKeys.push(t),this.state.records.prevActor=t}activationCount(t){let e,r=0;if(!t)return 0;for(e=0;e<this.state.records.messages.length;e++)this.state.records.messages[e].type===this.LINETYPE.ACTIVE_START&&this.state.records.messages[e].from===t&&r++,this.state.records.messages[e].type===this.LINETYPE.ACTIVE_END&&this.state.records.messages[e].from===t&&r--;return r}addMessage(t,e,r,n){this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:t,to:e,message:r.text,wrap:r.wrap??this.autoWrap(),answer:n})}addSignal(t,e,r,n,i=!1){if(n===this.LINETYPE.ACTIVE_END&&this.activationCount(t??"")<1){const s=new Error("Trying to inactivate an inactive participant ("+t+")");throw s.hash={text:"->>-",token:"->>-",line:"1",loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:["'ACTIVE_PARTICIPANT'"]},s}return this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:t,to:e,message:r?.text??"",wrap:r?.wrap??this.autoWrap(),type:n,activate:i}),!0}hasAtLeastOneBox(){return this.state.records.boxes.length>0}hasAtLeastOneBoxWithTitle(){return this.state.records.boxes.some(t=>t.name)}getMessages(){return this.state.records.messages}getBoxes(){return this.state.records.boxes}getActors(){return this.state.records.actors}getCreatedActors(){return this.state.records.createdActors}getDestroyedActors(){return this.state.records.destroyedActors}getActor(t){return this.state.records.actors.get(t)}getActorKeys(){return[...this.state.records.actors.keys()]}enableSequenceNumbers(){this.state.records.sequenceNumbersEnabled=!0}disableSequenceNumbers(){this.state.records.sequenceNumbersEnabled=!1}showSequenceNumbers(){return this.state.records.sequenceNumbersEnabled}setWrap(t){this.state.records.wrapEnabled=t}extractWrap(t){if(t===void 0)return{};t=t.trim();const e=/^:?wrap:/.exec(t)!==null?!0:/^:?nowrap:/.exec(t)!==null?!1:void 0;return{cleanedText:(e===void 0?t:t.replace(/^:?(?:no)?wrap:/,"")).trim(),wrap:e}}autoWrap(){return this.state.records.wrapEnabled!==void 0?this.state.records.wrapEnabled:we().sequence?.wrap??!1}clear(){this.state.reset(),An()}parseMessage(t){const e=t.trim(),{wrap:r,cleanedText:n}=this.extractWrap(e),i={text:n,wrap:r};return ie.debug(`parseMessage: ${JSON.stringify(i)}`),i}parseBoxData(t){const e=/^((?:rgba?|hsla?)\s*\(.*\)|\w*)(.*)$/.exec(t);let r=e?.[1]?e[1].trim():"transparent",n=e?.[2]?e[2].trim():void 0;if(window?.CSS)window.CSS.supports("color",r)||(r="transparent",n=t.trim());else{const s=new Option().style;s.color=r,s.color!==r&&(r="transparent",n=t.trim())}const{wrap:i,cleanedText:a}=this.extractWrap(n);return{text:a?fr(a,we()):void 0,color:r,wrap:i}}addNote(t,e,r){const n={actor:t,placement:e,message:r.text,wrap:r.wrap??this.autoWrap()},i=[].concat(t,t);this.state.records.notes.push(n),this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:i[0],to:i[1],message:r.text,wrap:r.wrap??this.autoWrap(),type:this.LINETYPE.NOTE,placement:e})}addLinks(t,e){const r=this.getActor(t);try{let n=fr(e.text,we());n=n.replace(/&equals;/g,"="),n=n.replace(/&amp;/g,"&");const i=JSON.parse(n);this.insertLinks(r,i)}catch(n){ie.error("error while parsing actor link text",n)}}addALink(t,e){const r=this.getActor(t);try{const n={};let i=fr(e.text,we());const a=i.indexOf("@");i=i.replace(/&equals;/g,"="),i=i.replace(/&amp;/g,"&");const s=i.slice(0,a-1).trim(),o=i.slice(a+1).trim();n[s]=o,this.insertLinks(r,n)}catch(n){ie.error("error while parsing actor link text",n)}}insertLinks(t,e){if(t.links==null)t.links=e;else for(const r in e)t.links[r]=e[r]}addProperties(t,e){const r=this.getActor(t);try{const n=fr(e.text,we()),i=JSON.parse(n);this.insertProperties(r,i)}catch(n){ie.error("error while parsing actor properties text",n)}}insertProperties(t,e){if(t.properties==null)t.properties=e;else for(const r in e)t.properties[r]=e[r]}boxEnd(){this.state.records.currentBox=void 0}addDetails(t,e){const r=this.getActor(t),n=document.getElementById(e.text);try{const i=n.innerHTML,a=JSON.parse(i);a.properties&&this.insertProperties(r,a.properties),a.links&&this.insertLinks(r,a.links)}catch(i){ie.error("error while parsing actor details text",i)}}getActorProperty(t,e){if(t?.properties!==void 0)return t.properties[e]}apply(t){if(Array.isArray(t))t.forEach(e=>{this.apply(e)});else switch(t.type){case"sequenceIndex":this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:void 0,to:void 0,message:{start:t.sequenceIndex,step:t.sequenceIndexStep,visible:t.sequenceVisible},wrap:!1,type:t.signalType});break;case"addParticipant":this.addActor(t.actor,t.actor,t.description,t.draw,t.config);break;case"createParticipant":if(this.state.records.actors.has(t.actor))throw new Error("It is not possible to have actors with the same id, even if one is destroyed before the next is created. Use 'AS' aliases to simulate the behavior");this.state.records.lastCreated=t.actor,this.addActor(t.actor,t.actor,t.description,t.draw,t.config),this.state.records.createdActors.set(t.actor,this.state.records.messages.length);break;case"destroyParticipant":this.state.records.lastDestroyed=t.actor,this.state.records.destroyedActors.set(t.actor,this.state.records.messages.length);break;case"activeStart":this.addSignal(t.actor,void 0,void 0,t.signalType);break;case"activeEnd":this.addSignal(t.actor,void 0,void 0,t.signalType);break;case"addNote":this.addNote(t.actor,t.placement,t.text);break;case"addLinks":this.addLinks(t.actor,t.text);break;case"addALink":this.addALink(t.actor,t.text);break;case"addProperties":this.addProperties(t.actor,t.text);break;case"addDetails":this.addDetails(t.actor,t.text);break;case"addMessage":if(this.state.records.lastCreated){if(t.to!==this.state.records.lastCreated)throw new Error("The created participant "+this.state.records.lastCreated.name+" does not have an associated creating message after its declaration. Please check the sequence diagram.");this.state.records.lastCreated=void 0}else if(this.state.records.lastDestroyed){if(t.to!==this.state.records.lastDestroyed&&t.from!==this.state.records.lastDestroyed)throw new Error("The destroyed participant "+this.state.records.lastDestroyed.name+" does not have an associated destroying message after its declaration. Please check the sequence diagram.");this.state.records.lastDestroyed=void 0}this.addSignal(t.from,t.to,t.msg,t.signalType,t.activate);break;case"boxStart":this.addBox(t.boxData);break;case"boxEnd":this.boxEnd();break;case"loopStart":this.addSignal(void 0,void 0,t.loopText,t.signalType);break;case"loopEnd":this.addSignal(void 0,void 0,void 0,t.signalType);break;case"rectStart":this.addSignal(void 0,void 0,t.color,t.signalType);break;case"rectEnd":this.addSignal(void 0,void 0,void 0,t.signalType);break;case"optStart":this.addSignal(void 0,void 0,t.optText,t.signalType);break;case"optEnd":this.addSignal(void 0,void 0,void 0,t.signalType);break;case"altStart":this.addSignal(void 0,void 0,t.altText,t.signalType);break;case"else":this.addSignal(void 0,void 0,t.altText,t.signalType);break;case"altEnd":this.addSignal(void 0,void 0,void 0,t.signalType);break;case"setAccTitle":Sn(t.text);break;case"parStart":this.addSignal(void 0,void 0,t.parText,t.signalType);break;case"and":this.addSignal(void 0,void 0,t.parText,t.signalType);break;case"parEnd":this.addSignal(void 0,void 0,void 0,t.signalType);break;case"criticalStart":this.addSignal(void 0,void 0,t.criticalText,t.signalType);break;case"option":this.addSignal(void 0,void 0,t.optionText,t.signalType);break;case"criticalEnd":this.addSignal(void 0,void 0,void 0,t.signalType);break;case"breakStart":this.addSignal(void 0,void 0,t.breakText,t.signalType);break;case"breakEnd":this.addSignal(void 0,void 0,void 0,t.signalType);break}}getConfig(){return we().sequence}},OCe=x(t=>`.actor {
    stroke: ${t.actorBorder};
    fill: ${t.actorBkg};
  }

  text.actor > tspan {
    fill: ${t.actorTextColor};
    stroke: none;
  }

  .actor-line {
    stroke: ${t.actorLineColor};
  }
  
  .innerArc {
    stroke-width: 1.5;
    stroke-dasharray: none;
  }

  .messageLine0 {
    stroke-width: 1.5;
    stroke-dasharray: none;
    stroke: ${t.signalColor};
  }

  .messageLine1 {
    stroke-width: 1.5;
    stroke-dasharray: 2, 2;
    stroke: ${t.signalColor};
  }

  #arrowhead path {
    fill: ${t.signalColor};
    stroke: ${t.signalColor};
  }

  .sequenceNumber {
    fill: ${t.sequenceNumberColor};
  }

  #sequencenumber {
    fill: ${t.signalColor};
  }

  #crosshead path {
    fill: ${t.signalColor};
    stroke: ${t.signalColor};
  }

  .messageText {
    fill: ${t.signalTextColor};
    stroke: none;
  }

  .labelBox {
    stroke: ${t.labelBoxBorderColor};
    fill: ${t.labelBoxBkgColor};
  }

  .labelText, .labelText > tspan {
    fill: ${t.labelTextColor};
    stroke: none;
  }

  .loopText, .loopText > tspan {
    fill: ${t.loopTextColor};
    stroke: none;
  }

  .loopLine {
    stroke-width: 2px;
    stroke-dasharray: 2, 2;
    stroke: ${t.labelBoxBorderColor};
    fill: ${t.labelBoxBorderColor};
  }

  .note {
    //stroke: #decc93;
    stroke: ${t.noteBorderColor};
    fill: ${t.noteBkgColor};
  }

  .noteText, .noteText > tspan {
    fill: ${t.noteTextColor};
    stroke: none;
  }

  .activation0 {
    fill: ${t.activationBkgColor};
    stroke: ${t.activationBorderColor};
  }

  .activation1 {
    fill: ${t.activationBkgColor};
    stroke: ${t.activationBorderColor};
  }

  .activation2 {
    fill: ${t.activationBkgColor};
    stroke: ${t.activationBorderColor};
  }

  .actorPopupMenu {
    position: absolute;
  }

  .actorPopupMenuPanel {
    position: absolute;
    fill: ${t.actorBkg};
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    filter: drop-shadow(3px 5px 2px rgb(0 0 0 / 0.4));
}
  .actor-man line {
    stroke: ${t.actorBorder};
    fill: ${t.actorBkg};
  }
  .actor-man circle, line {
    stroke: ${t.actorBorder};
    fill: ${t.actorBkg};
    stroke-width: 2px;
  }

`,"getStyles"),PCe=OCe,jc=18*2,yc="actor-top",xc="actor-bottom",dx="actor-box",Ql="actor-man",wp=x(function(t,e){return H2(t,e)},"drawRect"),BCe=x(function(t,e,r,n,i){if(e.links===void 0||e.links===null||Object.keys(e.links).length===0)return{height:0,width:0};const a=e.links,s=e.actorCnt,o=e.rectData;var l="none";i&&(l="block !important");const u=t.append("g");u.attr("id","actor"+s+"_popup"),u.attr("class","actorPopupMenu"),u.attr("display",l);var h="";o.class!==void 0&&(h=" "+o.class);let d=o.width>r?o.width:r;const f=u.append("rect");if(f.attr("class","actorPopupMenuPanel"+h),f.attr("x",o.x),f.attr("y",o.height),f.attr("fill",o.fill),f.attr("stroke",o.stroke),f.attr("width",d),f.attr("height",o.height),f.attr("rx",o.rx),f.attr("ry",o.ry),a!=null){var p=20;for(let v in a){var g=u.append("a"),m=tc(a[v]);g.attr("xlink:href",m),g.attr("target","_blank"),a8e(n)(v,g,o.x+10,o.height+p,d,20,{class:"actor"},n),p+=30}}return f.attr("height",p),{height:o.height+p,width:d}},"drawPopup"),fx=x(function(t){return"var pu = document.getElementById('"+t+"'); if (pu != null) { pu.style.display = pu.style.display == 'block' ? 'none' : 'block'; }"},"popupMenuToggle"),Sy=x(async function(t,e,r=null){let n=t.append("foreignObject");const i=await Ap(e.text,gr()),s=n.append("xhtml:div").attr("style","width: fit-content;").attr("xmlns","http://www.w3.org/1999/xhtml").html(i).node().getBoundingClientRect();if(n.attr("height",Math.round(s.height)).attr("width",Math.round(s.width)),e.class==="noteText"){const o=t.node().firstChild;o.setAttribute("height",s.height+2*e.textMargin);const l=o.getBBox();n.attr("x",Math.round(l.x+l.width/2-s.width/2)).attr("y",Math.round(l.y+l.height/2-s.height/2))}else if(r){let{startx:o,stopx:l,starty:u}=r;if(o>l){const h=o;o=l,l=h}n.attr("x",Math.round(o+Math.abs(o-l)/2-s.width/2)),e.class==="loopText"?n.attr("y",Math.round(u)):n.attr("y",Math.round(u-s.height))}return[n]},"drawKatex"),pd=x(function(t,e){let r=0,n=0;const i=e.text.split(at.lineBreakRegex),[a,s]=Ru(e.fontSize);let o=[],l=0,u=x(()=>e.y,"yfunc");if(e.valign!==void 0&&e.textMargin!==void 0&&e.textMargin>0)switch(e.valign){case"top":case"start":u=x(()=>Math.round(e.y+e.textMargin),"yfunc");break;case"middle":case"center":u=x(()=>Math.round(e.y+(r+n+e.textMargin)/2),"yfunc");break;case"bottom":case"end":u=x(()=>Math.round(e.y+(r+n+2*e.textMargin)-e.textMargin),"yfunc");break}if(e.anchor!==void 0&&e.textMargin!==void 0&&e.width!==void 0)switch(e.anchor){case"left":case"start":e.x=Math.round(e.x+e.textMargin),e.anchor="start",e.dominantBaseline="middle",e.alignmentBaseline="middle";break;case"middle":case"center":e.x=Math.round(e.x+e.width/2),e.anchor="middle",e.dominantBaseline="middle",e.alignmentBaseline="middle";break;case"right":case"end":e.x=Math.round(e.x+e.width-e.textMargin),e.anchor="end",e.dominantBaseline="middle",e.alignmentBaseline="middle";break}for(let[h,d]of i.entries()){e.textMargin!==void 0&&e.textMargin===0&&a!==void 0&&(l=h*a);const f=t.append("text");f.attr("x",e.x),f.attr("y",u()),e.anchor!==void 0&&f.attr("text-anchor",e.anchor).attr("dominant-baseline",e.dominantBaseline).attr("alignment-baseline",e.alignmentBaseline),e.fontFamily!==void 0&&f.style("font-family",e.fontFamily),s!==void 0&&f.style("font-size",s),e.fontWeight!==void 0&&f.style("font-weight",e.fontWeight),e.fill!==void 0&&f.attr("fill",e.fill),e.class!==void 0&&f.attr("class",e.class),e.dy!==void 0?f.attr("dy",e.dy):l!==0&&f.attr("dy",l);const p=d||XI;if(e.tspan){const g=f.append("tspan");g.attr("x",e.x),e.fill!==void 0&&g.attr("fill",e.fill),g.text(p)}else f.text(p);e.valign!==void 0&&e.textMargin!==void 0&&e.textMargin>0&&(n+=(f._groups||f)[0][0].getBBox().height,r=n),o.push(f)}return o},"drawText"),uH=x(function(t,e){function r(i,a,s,o,l){return i+","+a+" "+(i+s)+","+a+" "+(i+s)+","+(a+o-l)+" "+(i+s-l*1.2)+","+(a+o)+" "+i+","+(a+o)}x(r,"genPoints");const n=t.append("polygon");return n.attr("points",r(e.x,e.y,e.width,e.height,7)),n.attr("class","labelBox"),e.y=e.y+e.height/2,pd(t,e),n},"drawLabel"),lr=-1,hH=x((t,e,r,n)=>{t.select&&r.forEach(i=>{const a=e.get(i),s=t.select("#actor"+a.actorCnt);!n.mirrorActors&&a.stopy?s.attr("y2",a.stopy+a.height/2):n.mirrorActors&&s.attr("y2",a.stopy)})},"fixLifeLineHeights"),FCe=x(function(t,e,r,n){const i=n?e.stopy:e.starty,a=e.x+e.width/2,s=i+e.height,o=t.append("g").lower();var l=o;n||(lr++,Object.keys(e.links||{}).length&&!r.forceMenus&&l.attr("onclick",fx(`actor${lr}_popup`)).attr("cursor","pointer"),l.append("line").attr("id","actor"+lr).attr("x1",a).attr("y1",s).attr("x2",a).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name),l=o.append("g"),e.actorCnt=lr,e.links!=null&&l.attr("id","root-"+lr));const u=Da();var h="actor";e.properties?.class?h=e.properties.class:u.fill="#eaeaea",n?h+=` ${xc}`:h+=` ${yc}`,u.x=e.x,u.y=i,u.width=e.width,u.height=e.height,u.class=h,u.rx=3,u.ry=3,u.name=e.name;const d=wp(l,u);if(e.rectData=u,e.properties?.icon){const p=e.properties.icon.trim();p.charAt(0)==="@"?dk(l,u.x+u.width-20,u.y+10,p.substr(1)):hk(l,u.x+u.width-20,u.y+10,p)}ol(r,un(e.description))(e.description,l,u.x,u.y,u.width,u.height,{class:`actor ${dx}`},r);let f=e.height;if(d.node){const p=d.node().getBBox();e.height=p.height,f=p.height}return f},"drawActorTypeParticipant"),$Ce=x(function(t,e,r,n){const i=n?e.stopy:e.starty,a=e.x+e.width/2,s=i+e.height,o=t.append("g").lower();var l=o;n||(lr++,Object.keys(e.links||{}).length&&!r.forceMenus&&l.attr("onclick",fx(`actor${lr}_popup`)).attr("cursor","pointer"),l.append("line").attr("id","actor"+lr).attr("x1",a).attr("y1",s).attr("x2",a).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name),l=o.append("g"),e.actorCnt=lr,e.links!=null&&l.attr("id","root-"+lr));const u=Da();var h="actor";e.properties?.class?h=e.properties.class:u.fill="#eaeaea",n?h+=` ${xc}`:h+=` ${yc}`,u.x=e.x,u.y=i,u.width=e.width,u.height=e.height,u.class=h,u.name=e.name;const d=6,f={...u,x:u.x+-d,y:u.y+ +d,class:"actor"},p=wp(l,u);if(wp(l,f),e.rectData=u,e.properties?.icon){const m=e.properties.icon.trim();m.charAt(0)==="@"?dk(l,u.x+u.width-20,u.y+10,m.substr(1)):hk(l,u.x+u.width-20,u.y+10,m)}ol(r,un(e.description))(e.description,l,u.x-d,u.y+d,u.width,u.height,{class:`actor ${dx}`},r);let g=e.height;if(p.node){const m=p.node().getBBox();e.height=m.height,g=m.height}return g},"drawActorTypeCollections"),zCe=x(function(t,e,r,n){const i=n?e.stopy:e.starty,a=e.x+e.width/2,s=i+e.height,o=t.append("g").lower();let l=o;n||(lr++,Object.keys(e.links||{}).length&&!r.forceMenus&&l.attr("onclick",fx(`actor${lr}_popup`)).attr("cursor","pointer"),l.append("line").attr("id","actor"+lr).attr("x1",a).attr("y1",s).attr("x2",a).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name),l=o.append("g"),e.actorCnt=lr,e.links!=null&&l.attr("id","root-"+lr));const u=Da();let h="actor";e.properties?.class?h=e.properties.class:u.fill="#eaeaea",n?h+=` ${xc}`:h+=` ${yc}`,u.x=e.x,u.y=i,u.width=e.width,u.height=e.height,u.class=h,u.name=e.name;const d=u.height/2,f=d/(2.5+u.height/50),p=l.append("g"),g=l.append("g");if(p.append("path").attr("d",`M ${u.x},${u.y+d}
    a ${f},${d} 0 0 0 0,${u.height}
    h ${u.width-2*f}
    a ${f},${d} 0 0 0 0,-${u.height}
    Z
  `).attr("class",h),g.append("path").attr("d",`M ${u.x},${u.y+d}
      a ${f},${d} 0 0 0 0,${u.height}`).attr("stroke","#666").attr("stroke-width","1px").attr("class",h),p.attr("transform",`translate(${f}, ${-(u.height/2)})`),g.attr("transform",`translate(${u.width-f}, ${-u.height/2})`),e.rectData=u,e.properties?.icon){const y=e.properties.icon.trim(),b=u.x+u.width-20,w=u.y+10;y.charAt(0)==="@"?dk(l,b,w,y.substr(1)):hk(l,b,w,y)}ol(r,un(e.description))(e.description,l,u.x,u.y,u.width,u.height,{class:`actor ${dx}`},r);let m=e.height;const v=p.select("path:last-child");if(v.node()){const y=v.node().getBBox();e.height=y.height,m=y.height}return m},"drawActorTypeQueue"),VCe=x(function(t,e,r,n){const i=n?e.stopy:e.starty,a=e.x+e.width/2,s=i+75,o=t.append("g").lower();n||(lr++,o.append("line").attr("id","actor"+lr).attr("x1",a).attr("y1",s).attr("x2",a).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name),e.actorCnt=lr);const l=t.append("g");let u=Ql;n?u+=` ${xc}`:u+=` ${yc}`,l.attr("class",u),l.attr("name",e.name);const h=Da();h.x=e.x,h.y=i,h.fill="#eaeaea",h.width=e.width,h.height=e.height,h.class="actor";const d=e.x+e.width/2,f=i+30,p=18;l.append("defs").append("marker").attr("id","filled-head-control").attr("refX",11).attr("refY",5.8).attr("markerWidth",20).attr("markerHeight",28).attr("orient","172.5").append("path").attr("d","M 14.4 5.6 L 7.2 10.4 L 8.8 5.6 L 7.2 0.8 Z"),l.append("circle").attr("cx",d).attr("cy",f).attr("r",p).attr("fill","#eaeaf7").attr("stroke","#666").attr("stroke-width",1.2),l.append("line").attr("marker-end","url(#filled-head-control)").attr("transform",`translate(${d}, ${f-p})`);const g=l.node().getBBox();return e.height=g.height+2*(r?.sequence?.labelBoxHeight??0),ol(r,un(e.description))(e.description,l,h.x,h.y+p+(n?5:10),h.width,h.height,{class:`actor ${Ql}`},r),e.height},"drawActorTypeControl"),GCe=x(function(t,e,r,n){const i=n?e.stopy:e.starty,a=e.x+e.width/2,s=i+75,o=t.append("g").lower(),l=t.append("g");let u=Ql;n?u+=` ${xc}`:u+=` ${yc}`,l.attr("class",u),l.attr("name",e.name);const h=Da();h.x=e.x,h.y=i,h.fill="#eaeaea",h.width=e.width,h.height=e.height,h.class="actor";const d=e.x+e.width/2,f=i+(n?10:25),p=18;l.append("circle").attr("cx",d).attr("cy",f).attr("r",p).attr("width",e.width).attr("height",e.height),l.append("line").attr("x1",d-p).attr("x2",d+p).attr("y1",f+p).attr("y2",f+p).attr("stroke","#333").attr("stroke-width",2);const g=l.node().getBBox();return e.height=g.height+(r?.sequence?.labelBoxHeight??0),n||(lr++,o.append("line").attr("id","actor"+lr).attr("x1",a).attr("y1",s).attr("x2",a).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name),e.actorCnt=lr),ol(r,un(e.description))(e.description,l,h.x,h.y+(n?(f-i+p-5)/2:(f+p-i)/2),h.width,h.height,{class:`actor ${Ql}`},r),n?l.attr("transform",`translate(0, ${p/2})`):l.attr("transform",`translate(0, ${p/2})`),e.height},"drawActorTypeEntity"),UCe=x(function(t,e,r,n){const i=n?e.stopy:e.starty,a=e.x+e.width/2,s=i+e.height+2*r.boxTextMargin,o=t.append("g").lower();let l=o;n||(lr++,Object.keys(e.links||{}).length&&!r.forceMenus&&l.attr("onclick",fx(`actor${lr}_popup`)).attr("cursor","pointer"),l.append("line").attr("id","actor"+lr).attr("x1",a).attr("y1",s).attr("x2",a).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name),l=o.append("g"),e.actorCnt=lr,e.links!=null&&l.attr("id","root-"+lr));const u=Da();let h="actor";e.properties?.class?h=e.properties.class:u.fill="#eaeaea",n?h+=` ${xc}`:h+=` ${yc}`,u.x=e.x,u.y=i,u.width=e.width,u.height=e.height,u.class=h,u.name=e.name,u.x=e.x,u.y=i;const d=u.width/4,f=u.width/4,p=d/2,g=p/(2.5+d/50),m=l.append("g"),v=`
  M ${u.x},${u.y+g}
  a ${p},${g} 0 0 0 ${d},0
  a ${p},${g} 0 0 0 -${d},0
  l 0,${f-2*g}
  a ${p},${g} 0 0 0 ${d},0
  l 0,-${f-2*g}
`;m.append("path").attr("d",v).attr("fill","#eaeaea").attr("stroke","#000").attr("stroke-width",1).attr("class",h),n?m.attr("transform",`translate(${d*1.5}, ${u.height/4-2*g})`):m.attr("transform",`translate(${d*1.5}, ${(u.height+g)/4})`),e.rectData=u,ol(r,un(e.description))(e.description,l,u.x,u.y+(n?(u.height+f)/4:(u.height+g)/2),u.width,u.height,{class:`actor ${dx}`},r);const y=m.select("path:last-child");if(y.node()){const b=y.node().getBBox();e.height=b.height+(r.sequence.labelBoxHeight??0)}return e.height},"drawActorTypeDatabase"),WCe=x(function(t,e,r,n){const i=n?e.stopy:e.starty,a=e.x+e.width/2,s=i+80,o=30,l=t.append("g").lower();n||(lr++,l.append("line").attr("id","actor"+lr).attr("x1",a).attr("y1",s).attr("x2",a).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name),e.actorCnt=lr);const u=t.append("g");let h=Ql;n?h+=` ${xc}`:h+=` ${yc}`,u.attr("class",h),u.attr("name",e.name);const d=Da();d.x=e.x,d.y=i,d.fill="#eaeaea",d.width=e.width,d.height=e.height,d.class="actor",u.append("line").attr("id","actor-man-torso"+lr).attr("x1",e.x+e.width/2-o*2.5).attr("y1",i+10).attr("x2",e.x+e.width/2-15).attr("y2",i+10),u.append("line").attr("id","actor-man-arms"+lr).attr("x1",e.x+e.width/2-o*2.5).attr("y1",i+0).attr("x2",e.x+e.width/2-o*2.5).attr("y2",i+20),u.append("circle").attr("cx",e.x+e.width/2).attr("cy",i+10).attr("r",o);const f=u.node().getBBox();return e.height=f.height+(r.sequence.labelBoxHeight??0),ol(r,un(e.description))(e.description,u,d.x,d.y+(n?o/2-4:o/2+3),d.width,d.height,{class:`actor ${Ql}`},r),n?u.attr("transform",`translate(0,${o/2+7})`):u.attr("transform",`translate(0,${o/2+7})`),e.height},"drawActorTypeBoundary"),HCe=x(function(t,e,r,n){const i=n?e.stopy:e.starty,a=e.x+e.width/2,s=i+80,o=t.append("g").lower();n||(lr++,o.append("line").attr("id","actor"+lr).attr("x1",a).attr("y1",s).attr("x2",a).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name),e.actorCnt=lr);const l=t.append("g");let u=Ql;n?u+=` ${xc}`:u+=` ${yc}`,l.attr("class",u),l.attr("name",e.name);const h=Da();h.x=e.x,h.y=i,h.fill="#eaeaea",h.width=e.width,h.height=e.height,h.class="actor",h.rx=3,h.ry=3,l.append("line").attr("id","actor-man-torso"+lr).attr("x1",a).attr("y1",i+25).attr("x2",a).attr("y2",i+45),l.append("line").attr("id","actor-man-arms"+lr).attr("x1",a-jc/2).attr("y1",i+33).attr("x2",a+jc/2).attr("y2",i+33),l.append("line").attr("x1",a-jc/2).attr("y1",i+60).attr("x2",a).attr("y2",i+45),l.append("line").attr("x1",a).attr("y1",i+45).attr("x2",a+jc/2-2).attr("y2",i+60);const d=l.append("circle");d.attr("cx",e.x+e.width/2),d.attr("cy",i+10),d.attr("r",15),d.attr("width",e.width),d.attr("height",e.height);const f=l.node().getBBox();return e.height=f.height,ol(r,un(e.description))(e.description,l,h.x,h.y+35,h.width,h.height,{class:`actor ${Ql}`},r),e.height},"drawActorTypeActor"),qCe=x(async function(t,e,r,n){switch(e.type){case"actor":return await HCe(t,e,r,n);case"participant":return await FCe(t,e,r,n);case"boundary":return await WCe(t,e,r,n);case"control":return await VCe(t,e,r,n);case"entity":return await GCe(t,e,r,n);case"database":return await UCe(t,e,r,n);case"collections":return await $Ce(t,e,r,n);case"queue":return await zCe(t,e,r,n)}},"drawActor"),YCe=x(function(t,e,r){const i=t.append("g");dH(i,e),e.name&&ol(r)(e.name,i,e.x,e.y+r.boxTextMargin+(e.textMaxHeight||0)/2,e.width,0,{class:"text"},r),i.lower()},"drawBox"),XCe=x(function(t){return t.append("g")},"anchorElement"),jCe=x(function(t,e,r,n,i){const a=Da(),s=e.anchored;a.x=e.startx,a.y=e.starty,a.class="activation"+i%3,a.width=e.stopx-e.startx,a.height=r-e.starty,wp(s,a)},"drawActivation"),KCe=x(async function(t,e,r,n){const{boxMargin:i,boxTextMargin:a,labelBoxHeight:s,labelBoxWidth:o,messageFontFamily:l,messageFontSize:u,messageFontWeight:h}=n,d=t.append("g"),f=x(function(m,v,y,b){return d.append("line").attr("x1",m).attr("y1",v).attr("x2",y).attr("y2",b).attr("class","loopLine")},"drawLoopLine");f(e.startx,e.starty,e.stopx,e.starty),f(e.stopx,e.starty,e.stopx,e.stopy),f(e.startx,e.stopy,e.stopx,e.stopy),f(e.startx,e.starty,e.startx,e.stopy),e.sections!==void 0&&e.sections.forEach(function(m){f(e.startx,m.y,e.stopx,m.y).style("stroke-dasharray","3, 3")});let p=fk();p.text=r,p.x=e.startx,p.y=e.starty,p.fontFamily=l,p.fontSize=u,p.fontWeight=h,p.anchor="middle",p.valign="middle",p.tspan=!1,p.width=o||50,p.height=s||20,p.textMargin=a,p.class="labelText",uH(d,p),p=fH(),p.text=e.title,p.x=e.startx+o/2+(e.stopx-e.startx)/2,p.y=e.starty+i+a,p.anchor="middle",p.valign="middle",p.textMargin=a,p.class="loopText",p.fontFamily=l,p.fontSize=u,p.fontWeight=h,p.wrap=!0;let g=un(p.text)?await Sy(d,p,e):pd(d,p);if(e.sectionTitles!==void 0){for(const[m,v]of Object.entries(e.sectionTitles))if(v.message){p.text=v.message,p.x=e.startx+(e.stopx-e.startx)/2,p.y=e.sections[m].y+i+a,p.class="loopText",p.anchor="middle",p.valign="middle",p.tspan=!1,p.fontFamily=l,p.fontSize=u,p.fontWeight=h,p.wrap=e.wrap,un(p.text)?(e.starty=e.sections[m].y,await Sy(d,p,e)):pd(d,p);let y=Math.round(g.map(b=>(b._groups||b)[0][0].getBBox().height).reduce((b,w)=>b+w));e.sections[m].height+=y-(i+a)}}return e.height=Math.round(e.stopy-e.starty),d},"drawLoop"),dH=x(function(t,e){rG(t,e)},"drawBackgroundRect"),ZCe=x(function(t){t.append("defs").append("symbol").attr("id","database").attr("fill-rule","evenodd").attr("clip-rule","evenodd").append("path").attr("transform","scale(.5)").attr("d","M12.258.001l.256.004.255.005.253.008.251.01.249.012.247.015.246.016.242.019.241.02.239.023.236.024.233.027.231.028.229.031.225.032.223.034.22.036.217.038.214.04.211.041.208.043.205.045.201.046.198.048.194.05.191.051.187.053.183.054.18.056.175.057.172.059.168.06.163.061.16.063.155.064.15.066.074.033.073.033.071.034.07.034.069.035.068.035.067.035.066.035.064.036.064.036.062.036.06.036.06.037.058.037.058.037.055.038.055.038.053.038.052.038.051.039.05.039.048.039.047.039.045.04.044.04.043.04.041.04.04.041.039.041.037.041.036.041.034.041.033.042.032.042.03.042.029.042.027.042.026.043.024.043.023.043.021.043.02.043.018.044.017.043.015.044.013.044.012.044.011.045.009.044.007.045.006.045.004.045.002.045.001.045v17l-.001.045-.002.045-.004.045-.006.045-.007.045-.009.044-.011.045-.012.044-.013.044-.015.044-.017.043-.018.044-.02.043-.021.043-.023.043-.024.043-.026.043-.027.042-.029.042-.03.042-.032.042-.033.042-.034.041-.036.041-.037.041-.039.041-.04.041-.041.04-.043.04-.044.04-.045.04-.047.039-.048.039-.05.039-.051.039-.052.038-.053.038-.055.038-.055.038-.058.037-.058.037-.06.037-.06.036-.062.036-.064.036-.064.036-.066.035-.067.035-.068.035-.069.035-.07.034-.071.034-.073.033-.074.033-.15.066-.155.064-.16.063-.163.061-.168.06-.172.059-.175.057-.18.056-.183.054-.187.053-.191.051-.194.05-.198.048-.201.046-.205.045-.208.043-.211.041-.214.04-.217.038-.22.036-.223.034-.225.032-.229.031-.231.028-.233.027-.236.024-.239.023-.241.02-.242.019-.246.016-.247.015-.249.012-.251.01-.253.008-.255.005-.256.004-.258.001-.258-.001-.256-.004-.255-.005-.253-.008-.251-.01-.249-.012-.247-.015-.245-.016-.243-.019-.241-.02-.238-.023-.236-.024-.234-.027-.231-.028-.228-.031-.226-.032-.223-.034-.22-.036-.217-.038-.214-.04-.211-.041-.208-.043-.204-.045-.201-.046-.198-.048-.195-.05-.19-.051-.187-.053-.184-.054-.179-.056-.176-.057-.172-.059-.167-.06-.164-.061-.159-.063-.155-.064-.151-.066-.074-.033-.072-.033-.072-.034-.07-.034-.069-.035-.068-.035-.067-.035-.066-.035-.064-.036-.063-.036-.062-.036-.061-.036-.06-.037-.058-.037-.057-.037-.056-.038-.055-.038-.053-.038-.052-.038-.051-.039-.049-.039-.049-.039-.046-.039-.046-.04-.044-.04-.043-.04-.041-.04-.04-.041-.039-.041-.037-.041-.036-.041-.034-.041-.033-.042-.032-.042-.03-.042-.029-.042-.027-.042-.026-.043-.024-.043-.023-.043-.021-.043-.02-.043-.018-.044-.017-.043-.015-.044-.013-.044-.012-.044-.011-.045-.009-.044-.007-.045-.006-.045-.004-.045-.002-.045-.001-.045v-17l.001-.045.002-.045.004-.045.006-.045.007-.045.009-.044.011-.045.012-.044.013-.044.015-.044.017-.043.018-.044.02-.043.021-.043.023-.043.024-.043.026-.043.027-.042.029-.042.03-.042.032-.042.033-.042.034-.041.036-.041.037-.041.039-.041.04-.041.041-.04.043-.04.044-.04.046-.04.046-.039.049-.039.049-.039.051-.039.052-.038.053-.038.055-.038.056-.038.057-.037.058-.037.06-.037.061-.036.062-.036.063-.036.064-.036.066-.035.067-.035.068-.035.069-.035.07-.034.072-.034.072-.033.074-.033.151-.066.155-.064.159-.063.164-.061.167-.06.172-.059.176-.057.179-.056.184-.054.187-.053.19-.051.195-.05.198-.048.201-.046.204-.045.208-.043.211-.041.214-.04.217-.038.22-.036.223-.034.226-.032.228-.031.231-.028.234-.027.236-.024.238-.023.241-.02.243-.019.245-.016.247-.015.249-.012.251-.01.253-.008.255-.005.256-.004.258-.001.258.001zm-9.258 20.499v.01l.001.021.003.021.004.022.005.021.006.022.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.023.018.024.019.024.021.024.022.025.023.024.024.025.052.049.056.05.061.051.066.051.07.051.075.051.079.052.084.052.088.052.092.052.097.052.102.051.105.052.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.048.144.049.147.047.152.047.155.047.16.045.163.045.167.043.171.043.176.041.178.041.183.039.187.039.19.037.194.035.197.035.202.033.204.031.209.03.212.029.216.027.219.025.222.024.226.021.23.02.233.018.236.016.24.015.243.012.246.01.249.008.253.005.256.004.259.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.021.224-.024.22-.026.216-.027.212-.028.21-.031.205-.031.202-.034.198-.034.194-.036.191-.037.187-.039.183-.04.179-.04.175-.042.172-.043.168-.044.163-.045.16-.046.155-.046.152-.047.148-.048.143-.049.139-.049.136-.05.131-.05.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.053.083-.051.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.05.023-.024.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.023.01-.022.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.127l-.077.055-.08.053-.083.054-.085.053-.087.052-.09.052-.093.051-.095.05-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.045-.118.044-.12.043-.122.042-.124.042-.126.041-.128.04-.13.04-.132.038-.134.038-.135.037-.138.037-.139.035-.142.035-.143.034-.144.033-.147.032-.148.031-.15.03-.151.03-.153.029-.154.027-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.01-.179.008-.179.008-.181.006-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.006-.179-.008-.179-.008-.178-.01-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.027-.153-.029-.151-.03-.15-.03-.148-.031-.146-.032-.145-.033-.143-.034-.141-.035-.14-.035-.137-.037-.136-.037-.134-.038-.132-.038-.13-.04-.128-.04-.126-.041-.124-.042-.122-.042-.12-.044-.117-.043-.116-.045-.113-.045-.112-.046-.109-.047-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.05-.093-.052-.09-.051-.087-.052-.085-.053-.083-.054-.08-.054-.077-.054v4.127zm0-5.654v.011l.001.021.003.021.004.021.005.022.006.022.007.022.009.022.01.022.011.023.012.023.013.023.015.024.016.023.017.024.018.024.019.024.021.024.022.024.023.025.024.024.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.052.11.051.114.051.119.052.123.05.127.051.131.05.135.049.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.044.171.042.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.022.23.02.233.018.236.016.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.012.241-.015.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.048.139-.05.136-.049.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.051.051-.049.023-.025.023-.024.021-.025.02-.024.019-.024.018-.024.017-.024.015-.023.014-.023.013-.024.012-.022.01-.023.01-.023.008-.022.006-.022.006-.022.004-.021.004-.022.001-.021.001-.021v-4.139l-.077.054-.08.054-.083.054-.085.052-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.044-.118.044-.12.044-.122.042-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.035-.143.033-.144.033-.147.033-.148.031-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.009-.179.009-.179.007-.181.007-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.007-.179-.007-.179-.009-.178-.009-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.031-.146-.033-.145-.033-.143-.033-.141-.035-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.04-.126-.041-.124-.042-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.051-.093-.051-.09-.051-.087-.053-.085-.052-.083-.054-.08-.054-.077-.054v4.139zm0-5.666v.011l.001.02.003.022.004.021.005.022.006.021.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.024.018.023.019.024.021.025.022.024.023.024.024.025.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.051.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.043.171.043.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.021.23.02.233.018.236.017.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.013.241-.014.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.049.139-.049.136-.049.131-.051.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.049.023-.025.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.022.01-.023.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.153l-.077.054-.08.054-.083.053-.085.053-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.048-.105.048-.106.048-.109.046-.111.046-.114.046-.115.044-.118.044-.12.043-.122.043-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.034-.143.034-.144.033-.147.032-.148.032-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.024-.161.024-.162.023-.163.023-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.01-.178.01-.179.009-.179.007-.181.006-.182.006-.182.004-.184.003-.184.001-.185.001-.185-.001-.184-.001-.184-.003-.182-.004-.182-.006-.181-.006-.179-.007-.179-.009-.178-.01-.176-.01-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.023-.162-.023-.161-.024-.159-.024-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.032-.146-.032-.145-.033-.143-.034-.141-.034-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.041-.126-.041-.124-.041-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.048-.105-.048-.102-.048-.1-.05-.097-.049-.095-.051-.093-.051-.09-.052-.087-.052-.085-.053-.083-.053-.08-.054-.077-.054v4.153zm8.74-8.179l-.257.004-.254.005-.25.008-.247.011-.244.012-.241.014-.237.016-.233.018-.231.021-.226.022-.224.023-.22.026-.216.027-.212.028-.21.031-.205.032-.202.033-.198.034-.194.036-.191.038-.187.038-.183.04-.179.041-.175.042-.172.043-.168.043-.163.045-.16.046-.155.046-.152.048-.148.048-.143.048-.139.049-.136.05-.131.05-.126.051-.123.051-.118.051-.114.052-.11.052-.106.052-.101.052-.096.052-.092.052-.088.052-.083.052-.079.052-.074.051-.07.052-.065.051-.06.05-.056.05-.051.05-.023.025-.023.024-.021.024-.02.025-.019.024-.018.024-.017.023-.015.024-.014.023-.013.023-.012.023-.01.023-.01.022-.008.022-.006.023-.006.021-.004.022-.004.021-.001.021-.001.021.001.021.001.021.004.021.004.022.006.021.006.023.008.022.01.022.01.023.012.023.013.023.014.023.015.024.017.023.018.024.019.024.02.025.021.024.023.024.023.025.051.05.056.05.06.05.065.051.07.052.074.051.079.052.083.052.088.052.092.052.096.052.101.052.106.052.11.052.114.052.118.051.123.051.126.051.131.05.136.05.139.049.143.048.148.048.152.048.155.046.16.046.163.045.168.043.172.043.175.042.179.041.183.04.187.038.191.038.194.036.198.034.202.033.205.032.21.031.212.028.216.027.22.026.224.023.226.022.231.021.233.018.237.016.241.014.244.012.247.011.25.008.254.005.257.004.26.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.022.224-.023.22-.026.216-.027.212-.028.21-.031.205-.032.202-.033.198-.034.194-.036.191-.038.187-.038.183-.04.179-.041.175-.042.172-.043.168-.043.163-.045.16-.046.155-.046.152-.048.148-.048.143-.048.139-.049.136-.05.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.05.051-.05.023-.025.023-.024.021-.024.02-.025.019-.024.018-.024.017-.023.015-.024.014-.023.013-.023.012-.023.01-.023.01-.022.008-.022.006-.023.006-.021.004-.022.004-.021.001-.021.001-.021-.001-.021-.001-.021-.004-.021-.004-.022-.006-.021-.006-.023-.008-.022-.01-.022-.01-.023-.012-.023-.013-.023-.014-.023-.015-.024-.017-.023-.018-.024-.019-.024-.02-.025-.021-.024-.023-.024-.023-.025-.051-.05-.056-.05-.06-.05-.065-.051-.07-.052-.074-.051-.079-.052-.083-.052-.088-.052-.092-.052-.096-.052-.101-.052-.106-.052-.11-.052-.114-.052-.118-.051-.123-.051-.126-.051-.131-.05-.136-.05-.139-.049-.143-.048-.148-.048-.152-.048-.155-.046-.16-.046-.163-.045-.168-.043-.172-.043-.175-.042-.179-.041-.183-.04-.187-.038-.191-.038-.194-.036-.198-.034-.202-.033-.205-.032-.21-.031-.212-.028-.216-.027-.22-.026-.224-.023-.226-.022-.231-.021-.233-.018-.237-.016-.241-.014-.244-.012-.247-.011-.25-.008-.254-.005-.257-.004-.26-.001-.26.001z")},"insertDatabaseIcon"),QCe=x(function(t){t.append("defs").append("symbol").attr("id","computer").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M2 2v13h20v-13h-20zm18 11h-16v-9h16v9zm-10.228 6l.466-1h3.524l.467 1h-4.457zm14.228 3h-24l2-6h2.104l-1.33 4h18.45l-1.297-4h2.073l2 6zm-5-10h-14v-7h14v7z")},"insertComputerIcon"),JCe=x(function(t){t.append("defs").append("symbol").attr("id","clock").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M12 2c5.514 0 10 4.486 10 10s-4.486 10-10 10-10-4.486-10-10 4.486-10 10-10zm0-2c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm5.848 12.459c.202.038.202.333.001.372-1.907.361-6.045 1.111-6.547 1.111-.719 0-1.301-.582-1.301-1.301 0-.512.77-5.447 1.125-7.445.034-.192.312-.181.343.014l.985 6.238 5.394 1.011z")},"insertClockIcon"),e8e=x(function(t){t.append("defs").append("marker").attr("id","arrowhead").attr("refX",7.9).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto-start-reverse").append("path").attr("d","M -1 0 L 10 5 L 0 10 z")},"insertArrowHead"),t8e=x(function(t){t.append("defs").append("marker").attr("id","filled-head").attr("refX",15.5).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")},"insertArrowFilledHead"),r8e=x(function(t){t.append("defs").append("marker").attr("id","sequencenumber").attr("refX",15).attr("refY",15).attr("markerWidth",60).attr("markerHeight",40).attr("orient","auto").append("circle").attr("cx",15).attr("cy",15).attr("r",6)},"insertSequenceNumber"),n8e=x(function(t){t.append("defs").append("marker").attr("id","crosshead").attr("markerWidth",15).attr("markerHeight",8).attr("orient","auto").attr("refX",4).attr("refY",4.5).append("path").attr("fill","none").attr("stroke","#000000").style("stroke-dasharray","0, 0").attr("stroke-width","1pt").attr("d","M 1,2 L 6,7 M 6,2 L 1,7")},"insertArrowCrossHead"),fH=x(function(){return{x:0,y:0,fill:void 0,anchor:void 0,style:"#666",width:void 0,height:void 0,textMargin:0,rx:0,ry:0,tspan:!0,valign:void 0}},"getTextObj"),i8e=x(function(){return{x:0,y:0,fill:"#EDF2AE",stroke:"#666",width:100,anchor:"start",height:100,rx:0,ry:0}},"getNoteRect"),ol=function(){function t(a,s,o,l,u,h,d){const f=s.append("text").attr("x",o+u/2).attr("y",l+h/2+5).style("text-anchor","middle").text(a);i(f,d)}x(t,"byText");function e(a,s,o,l,u,h,d,f){const{actorFontSize:p,actorFontFamily:g,actorFontWeight:m}=f,[v,y]=Ru(p),b=a.split(at.lineBreakRegex);for(let w=0;w<b.length;w++){const T=w*v-v*(b.length-1)/2,E=s.append("text").attr("x",o+u/2).attr("y",l).style("text-anchor","middle").style("font-size",y).style("font-weight",m).style("font-family",g);E.append("tspan").attr("x",o+u/2).attr("dy",T).text(b[w]),E.attr("y",l+h/2).attr("dominant-baseline","central").attr("alignment-baseline","central"),i(E,d)}}x(e,"byTspan");function r(a,s,o,l,u,h,d,f){const p=s.append("switch"),m=p.append("foreignObject").attr("x",o).attr("y",l).attr("width",u).attr("height",h).append("xhtml:div").style("display","table").style("height","100%").style("width","100%");m.append("div").style("display","table-cell").style("text-align","center").style("vertical-align","middle").text(a),e(a,p,o,l,u,h,d,f),i(m,d)}x(r,"byFo");async function n(a,s,o,l,u,h,d,f){const p=await Cp(a,gr()),g=s.append("switch"),v=g.append("foreignObject").attr("x",o+u/2-p.width/2).attr("y",l+h/2-p.height/2).attr("width",p.width).attr("height",p.height).append("xhtml:div").style("height","100%").style("width","100%");v.append("div").style("text-align","center").style("vertical-align","middle").html(await Ap(a,gr())),e(a,g,o,l,u,h,d,f),i(v,d)}x(n,"byKatex");function i(a,s){for(const o in s)s.hasOwnProperty(o)&&a.attr(o,s[o])}return x(i,"_setTextAttrs"),function(a,s=!1){return s?n:a.textPlacement==="fo"?r:a.textPlacement==="old"?t:e}}(),a8e=function(){function t(i,a,s,o,l,u,h){const d=a.append("text").attr("x",s).attr("y",o).style("text-anchor","start").text(i);n(d,h)}x(t,"byText");function e(i,a,s,o,l,u,h,d){const{actorFontSize:f,actorFontFamily:p,actorFontWeight:g}=d,m=i.split(at.lineBreakRegex);for(let v=0;v<m.length;v++){const y=v*f-f*(m.length-1)/2,b=a.append("text").attr("x",s).attr("y",o).style("text-anchor","start").style("font-size",f).style("font-weight",g).style("font-family",p);b.append("tspan").attr("x",s).attr("dy",y).text(m[v]),b.attr("y",o+u/2).attr("dominant-baseline","central").attr("alignment-baseline","central"),n(b,h)}}x(e,"byTspan");function r(i,a,s,o,l,u,h,d){const f=a.append("switch"),g=f.append("foreignObject").attr("x",s).attr("y",o).attr("width",l).attr("height",u).append("xhtml:div").style("display","table").style("height","100%").style("width","100%");g.append("div").style("display","table-cell").style("text-align","center").style("vertical-align","middle").text(i),e(i,f,s,o,l,u,h,d),n(g,h)}x(r,"byFo");function n(i,a){for(const s in a)a.hasOwnProperty(s)&&i.attr(s,a[s])}return x(n,"_setTextAttrs"),function(i){return i.textPlacement==="fo"?r:i.textPlacement==="old"?t:e}}(),fn={drawRect:wp,drawText:pd,drawLabel:uH,drawActor:qCe,drawBox:YCe,drawPopup:BCe,anchorElement:XCe,drawActivation:jCe,drawLoop:KCe,drawBackgroundRect:dH,insertArrowHead:e8e,insertArrowFilledHead:t8e,insertSequenceNumber:r8e,insertArrowCrossHead:n8e,insertDatabaseIcon:ZCe,insertComputerIcon:QCe,insertClockIcon:JCe,getTextObj:fH,getNoteRect:i8e,fixLifeLineHeights:hH,sanitizeUrl:tc},Re={},et={data:{startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},verticalPos:0,sequenceItems:[],activations:[],models:{getHeight:x(function(){return Math.max.apply(null,this.actors.length===0?[0]:this.actors.map(t=>t.height||0))+(this.loops.length===0?0:this.loops.map(t=>t.height||0).reduce((t,e)=>t+e))+(this.messages.length===0?0:this.messages.map(t=>t.height||0).reduce((t,e)=>t+e))+(this.notes.length===0?0:this.notes.map(t=>t.height||0).reduce((t,e)=>t+e))},"getHeight"),clear:x(function(){this.actors=[],this.boxes=[],this.loops=[],this.messages=[],this.notes=[]},"clear"),addBox:x(function(t){this.boxes.push(t)},"addBox"),addActor:x(function(t){this.actors.push(t)},"addActor"),addLoop:x(function(t){this.loops.push(t)},"addLoop"),addMessage:x(function(t){this.messages.push(t)},"addMessage"),addNote:x(function(t){this.notes.push(t)},"addNote"),lastActor:x(function(){return this.actors[this.actors.length-1]},"lastActor"),lastLoop:x(function(){return this.loops[this.loops.length-1]},"lastLoop"),lastMessage:x(function(){return this.messages[this.messages.length-1]},"lastMessage"),lastNote:x(function(){return this.notes[this.notes.length-1]},"lastNote"),actors:[],boxes:[],loops:[],messages:[],notes:[]},init:x(function(){this.sequenceItems=[],this.activations=[],this.models.clear(),this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},this.verticalPos=0,mH(we())},"init"),updateVal:x(function(t,e,r,n){t[e]===void 0?t[e]=r:t[e]=n(r,t[e])},"updateVal"),updateBounds:x(function(t,e,r,n){const i=this;let a=0;function s(o){return x(function(u){a++;const h=i.sequenceItems.length-a+1;i.updateVal(u,"starty",e-h*Re.boxMargin,Math.min),i.updateVal(u,"stopy",n+h*Re.boxMargin,Math.max),i.updateVal(et.data,"startx",t-h*Re.boxMargin,Math.min),i.updateVal(et.data,"stopx",r+h*Re.boxMargin,Math.max),o!=="activation"&&(i.updateVal(u,"startx",t-h*Re.boxMargin,Math.min),i.updateVal(u,"stopx",r+h*Re.boxMargin,Math.max),i.updateVal(et.data,"starty",e-h*Re.boxMargin,Math.min),i.updateVal(et.data,"stopy",n+h*Re.boxMargin,Math.max))},"updateItemBounds")}x(s,"updateFn"),this.sequenceItems.forEach(s()),this.activations.forEach(s("activation"))},"updateBounds"),insert:x(function(t,e,r,n){const i=at.getMin(t,r),a=at.getMax(t,r),s=at.getMin(e,n),o=at.getMax(e,n);this.updateVal(et.data,"startx",i,Math.min),this.updateVal(et.data,"starty",s,Math.min),this.updateVal(et.data,"stopx",a,Math.max),this.updateVal(et.data,"stopy",o,Math.max),this.updateBounds(i,s,a,o)},"insert"),newActivation:x(function(t,e,r){const n=r.get(t.from),i=px(t.from).length||0,a=n.x+n.width/2+(i-1)*Re.activationWidth/2;this.activations.push({startx:a,starty:this.verticalPos+2,stopx:a+Re.activationWidth,stopy:void 0,actor:t.from,anchored:fn.anchorElement(e)})},"newActivation"),endActivation:x(function(t){const e=this.activations.map(function(r){return r.actor}).lastIndexOf(t.from);return this.activations.splice(e,1)[0]},"endActivation"),createLoop:x(function(t={message:void 0,wrap:!1,width:void 0},e){return{startx:void 0,starty:this.verticalPos,stopx:void 0,stopy:void 0,title:t.message,wrap:t.wrap,width:t.width,height:0,fill:e}},"createLoop"),newLoop:x(function(t={message:void 0,wrap:!1,width:void 0},e){this.sequenceItems.push(this.createLoop(t,e))},"newLoop"),endLoop:x(function(){return this.sequenceItems.pop()},"endLoop"),isLoopOverlap:x(function(){return this.sequenceItems.length?this.sequenceItems[this.sequenceItems.length-1].overlap:!1},"isLoopOverlap"),addSectionToLoop:x(function(t){const e=this.sequenceItems.pop();e.sections=e.sections||[],e.sectionTitles=e.sectionTitles||[],e.sections.push({y:et.getVerticalPos(),height:0}),e.sectionTitles.push(t),this.sequenceItems.push(e)},"addSectionToLoop"),saveVerticalPos:x(function(){this.isLoopOverlap()&&(this.savedVerticalPos=this.verticalPos)},"saveVerticalPos"),resetVerticalPos:x(function(){this.isLoopOverlap()&&(this.verticalPos=this.savedVerticalPos)},"resetVerticalPos"),bumpVerticalPos:x(function(t){this.verticalPos=this.verticalPos+t,this.data.stopy=at.getMax(this.data.stopy,this.verticalPos)},"bumpVerticalPos"),getVerticalPos:x(function(){return this.verticalPos},"getVerticalPos"),getBounds:x(function(){return{bounds:this.data,models:this.models}},"getBounds")},s8e=x(async function(t,e){et.bumpVerticalPos(Re.boxMargin),e.height=Re.boxMargin,e.starty=et.getVerticalPos();const r=Da();r.x=e.startx,r.y=e.starty,r.width=e.width||Re.width,r.class="note";const n=t.append("g"),i=fn.drawRect(n,r),a=fk();a.x=e.startx,a.y=e.starty,a.width=r.width,a.dy="1em",a.text=e.message,a.class="noteText",a.fontFamily=Re.noteFontFamily,a.fontSize=Re.noteFontSize,a.fontWeight=Re.noteFontWeight,a.anchor=Re.noteAlign,a.textMargin=Re.noteMargin,a.valign="center";const s=un(a.text)?await Sy(n,a):pd(n,a),o=Math.round(s.map(l=>(l._groups||l)[0][0].getBBox().height).reduce((l,u)=>l+u));i.attr("height",o+2*Re.noteMargin),e.height+=o+2*Re.noteMargin,et.bumpVerticalPos(o+2*Re.noteMargin),e.stopy=e.starty+o+2*Re.noteMargin,e.stopx=e.startx+r.width,et.insert(e.startx,e.starty,e.stopx,e.stopy),et.models.addNote(e)},"drawNote"),Eu=x(t=>({fontFamily:t.messageFontFamily,fontSize:t.messageFontSize,fontWeight:t.messageFontWeight}),"messageFont"),dh=x(t=>({fontFamily:t.noteFontFamily,fontSize:t.noteFontSize,fontWeight:t.noteFontWeight}),"noteFont"),CT=x(t=>({fontFamily:t.actorFontFamily,fontSize:t.actorFontSize,fontWeight:t.actorFontWeight}),"actorFont");async function pH(t,e){et.bumpVerticalPos(10);const{startx:r,stopx:n,message:i}=e,a=at.splitBreaks(i).length,s=un(i),o=s?await Cp(i,we()):Kt.calculateTextDimensions(i,Eu(Re));if(!s){const d=o.height/a;e.height+=d,et.bumpVerticalPos(d)}let l,u=o.height-10;const h=o.width;if(r===n){l=et.getVerticalPos()+u,Re.rightAngles||(u+=Re.boxMargin,l=et.getVerticalPos()+u),u+=30;const d=at.getMax(h/2,Re.width/2);et.insert(r-d,et.getVerticalPos()-10+u,n+d,et.getVerticalPos()+30+u)}else u+=Re.boxMargin,l=et.getVerticalPos()+u,et.insert(r,l-10,n,l);return et.bumpVerticalPos(u),e.height+=u,e.stopy=e.starty+e.height,et.insert(e.fromBounds,e.starty,e.toBounds,e.stopy),l}x(pH,"boundMessage");var o8e=x(async function(t,e,r,n){const{startx:i,stopx:a,starty:s,message:o,type:l,sequenceIndex:u,sequenceVisible:h}=e,d=Kt.calculateTextDimensions(o,Eu(Re)),f=fk();f.x=i,f.y=s+10,f.width=a-i,f.class="messageText",f.dy="1em",f.text=o,f.fontFamily=Re.messageFontFamily,f.fontSize=Re.messageFontSize,f.fontWeight=Re.messageFontWeight,f.anchor=Re.messageAlign,f.valign="center",f.textMargin=Re.wrapPadding,f.tspan=!1,un(f.text)?await Sy(t,f,{startx:i,stopx:a,starty:r}):pd(t,f);const p=d.width;let g;i===a?Re.rightAngles?g=t.append("path").attr("d",`M  ${i},${r} H ${i+at.getMax(Re.width/2,p/2)} V ${r+25} H ${i}`):g=t.append("path").attr("d","M "+i+","+r+" C "+(i+60)+","+(r-10)+" "+(i+60)+","+(r+30)+" "+i+","+(r+20)):(g=t.append("line"),g.attr("x1",i),g.attr("y1",r),g.attr("x2",a),g.attr("y2",r)),l===n.db.LINETYPE.DOTTED||l===n.db.LINETYPE.DOTTED_CROSS||l===n.db.LINETYPE.DOTTED_POINT||l===n.db.LINETYPE.DOTTED_OPEN||l===n.db.LINETYPE.BIDIRECTIONAL_DOTTED?(g.style("stroke-dasharray","3, 3"),g.attr("class","messageLine1")):g.attr("class","messageLine0");let m="";Re.arrowMarkerAbsolute&&(m=Fy(!0)),g.attr("stroke-width",2),g.attr("stroke","none"),g.style("fill","none"),(l===n.db.LINETYPE.SOLID||l===n.db.LINETYPE.DOTTED)&&g.attr("marker-end","url("+m+"#arrowhead)"),(l===n.db.LINETYPE.BIDIRECTIONAL_SOLID||l===n.db.LINETYPE.BIDIRECTIONAL_DOTTED)&&(g.attr("marker-start","url("+m+"#arrowhead)"),g.attr("marker-end","url("+m+"#arrowhead)")),(l===n.db.LINETYPE.SOLID_POINT||l===n.db.LINETYPE.DOTTED_POINT)&&g.attr("marker-end","url("+m+"#filled-head)"),(l===n.db.LINETYPE.SOLID_CROSS||l===n.db.LINETYPE.DOTTED_CROSS)&&g.attr("marker-end","url("+m+"#crosshead)"),(h||Re.showSequenceNumbers)&&((l===n.db.LINETYPE.BIDIRECTIONAL_SOLID||l===n.db.LINETYPE.BIDIRECTIONAL_DOTTED)&&(i<a?g.attr("x1",i+2*6):g.attr("x1",i+6)),t.append("line").attr("x1",i).attr("y1",r).attr("x2",i).attr("y2",r).attr("stroke-width",0).attr("marker-start","url("+m+"#sequencenumber)"),t.append("text").attr("x",i).attr("y",r+4).attr("font-family","sans-serif").attr("font-size","12px").attr("text-anchor","middle").attr("class","sequenceNumber").text(u))},"drawMessage"),l8e=x(function(t,e,r,n,i,a,s){let o=0,l=0,u,h=0;for(const d of n){const f=e.get(d),p=f.box;u&&u!=p&&(s||et.models.addBox(u),l+=Re.boxMargin+u.margin),p&&p!=u&&(s||(p.x=o+l,p.y=i),l+=p.margin),f.width=f.width||Re.width,f.height=at.getMax(f.height||Re.height,Re.height),f.margin=f.margin||Re.actorMargin,h=at.getMax(h,f.height),r.get(f.name)&&(l+=f.width/2),f.x=o+l,f.starty=et.getVerticalPos(),et.insert(f.x,i,f.x+f.width,f.height),o+=f.width+l,f.box&&(f.box.width=o+p.margin-f.box.x),l=f.margin,u=f.box,et.models.addActor(f)}u&&!s&&et.models.addBox(u),et.bumpVerticalPos(h)},"addActorRenderingData"),AT=x(async function(t,e,r,n){if(n){let i=0;et.bumpVerticalPos(Re.boxMargin*2);for(const a of r){const s=e.get(a);s.stopy||(s.stopy=et.getVerticalPos());const o=await fn.drawActor(t,s,Re,!0);i=at.getMax(i,o)}et.bumpVerticalPos(i+Re.boxMargin)}else for(const i of r){const a=e.get(i);await fn.drawActor(t,a,Re,!1)}},"drawActors"),gH=x(function(t,e,r,n){let i=0,a=0;for(const s of r){const o=e.get(s),l=u8e(o),u=fn.drawPopup(t,o,l,Re,Re.forceMenus,n);u.height>i&&(i=u.height),u.width+o.x>a&&(a=u.width+o.x)}return{maxHeight:i,maxWidth:a}},"drawActorsPopup"),mH=x(function(t){mn(Re,t),t.fontFamily&&(Re.actorFontFamily=Re.noteFontFamily=Re.messageFontFamily=t.fontFamily),t.fontSize&&(Re.actorFontSize=Re.noteFontSize=Re.messageFontSize=t.fontSize),t.fontWeight&&(Re.actorFontWeight=Re.noteFontWeight=Re.messageFontWeight=t.fontWeight)},"setConf"),px=x(function(t){return et.activations.filter(function(e){return e.actor===t})},"actorActivations"),xR=x(function(t,e){const r=e.get(t),n=px(t),i=n.reduce(function(s,o){return at.getMin(s,o.startx)},r.x+r.width/2-1),a=n.reduce(function(s,o){return at.getMax(s,o.stopx)},r.x+r.width/2+1);return[i,a]},"activationBounds");function is(t,e,r,n,i){et.bumpVerticalPos(r);let a=n;if(e.id&&e.message&&t[e.id]){const s=t[e.id].width,o=Eu(Re);e.message=Kt.wrapLabel(`[${e.message}]`,s-2*Re.wrapPadding,o),e.width=s,e.wrap=!0;const l=Kt.calculateTextDimensions(e.message,o),u=at.getMax(l.height,Re.labelBoxHeight);a=n+u,ie.debug(`${u} - ${e.message}`)}i(e),et.bumpVerticalPos(a)}x(is,"adjustLoopHeightForWrap");function vH(t,e,r,n,i,a,s){function o(h,d){h.x<i.get(t.from).x?(et.insert(e.stopx-d,e.starty,e.startx,e.stopy+h.height/2+Re.noteMargin),e.stopx=e.stopx+d):(et.insert(e.startx,e.starty,e.stopx+d,e.stopy+h.height/2+Re.noteMargin),e.stopx=e.stopx-d)}x(o,"receiverAdjustment");function l(h,d){h.x<i.get(t.to).x?(et.insert(e.startx-d,e.starty,e.stopx,e.stopy+h.height/2+Re.noteMargin),e.startx=e.startx+d):(et.insert(e.stopx,e.starty,e.startx+d,e.stopy+h.height/2+Re.noteMargin),e.startx=e.startx-d)}x(l,"senderAdjustment");const u=[L1.ACTOR,L1.CONTROL,L1.ENTITY,L1.DATABASE];if(a.get(t.to)==n){const h=i.get(t.to),d=u.includes(h.type)?jc/2+3:h.width/2+3;o(h,d),h.starty=r-h.height/2,et.bumpVerticalPos(h.height/2)}else if(s.get(t.from)==n){const h=i.get(t.from);if(Re.mirrorActors){const d=u.includes(h.type)?jc/2:h.width/2;l(h,d)}h.stopy=r-h.height/2,et.bumpVerticalPos(h.height/2)}else if(s.get(t.to)==n){const h=i.get(t.to);if(Re.mirrorActors){const d=u.includes(h.type)?jc/2+3:h.width/2+3;o(h,d)}h.stopy=r-h.height/2,et.bumpVerticalPos(h.height/2)}}x(vH,"adjustCreatedDestroyedData");var c8e=x(async function(t,e,r,n){const{securityLevel:i,sequence:a}=we();Re=a;let s;i==="sandbox"&&(s=Qe("#i"+e));const o=Qe(i==="sandbox"?s.nodes()[0].contentDocument.body:"body"),l=i==="sandbox"?s.nodes()[0].contentDocument:document;et.init(),ie.debug(n.db);const u=i==="sandbox"?o.select(`[id="${e}"]`):Qe(`[id="${e}"]`),h=n.db.getActors(),d=n.db.getCreatedActors(),f=n.db.getDestroyedActors(),p=n.db.getBoxes();let g=n.db.getActorKeys();const m=n.db.getMessages(),v=n.db.getDiagramTitle(),y=n.db.hasAtLeastOneBox(),b=n.db.hasAtLeastOneBoxWithTitle(),w=await yH(h,m,n);if(Re.height=await xH(h,w,p),fn.insertComputerIcon(u),fn.insertDatabaseIcon(u),fn.insertClockIcon(u),y&&(et.bumpVerticalPos(Re.boxMargin),b&&et.bumpVerticalPos(p[0].textMaxHeight)),Re.hideUnusedParticipants===!0){const D=new Set;m.forEach(B=>{D.add(B.from),D.add(B.to)}),g=g.filter(B=>D.has(B))}l8e(u,h,d,g,0,m,!1);const T=await f8e(m,h,w,n);fn.insertArrowHead(u),fn.insertArrowCrossHead(u),fn.insertArrowFilledHead(u),fn.insertSequenceNumber(u);function E(D,B){const $=et.endActivation(D);$.starty+18>B&&($.starty=B-6,B+=12),fn.drawActivation(u,$,B,Re,px(D.from).length),et.insert($.startx,B-10,$.stopx,B)}x(E,"activeEnd");let L=1,S=1;const C=[],A=[];let N=0;for(const D of m){let B,$,F;switch(D.type){case n.db.LINETYPE.NOTE:et.resetVerticalPos(),$=D.noteModel,await s8e(u,$);break;case n.db.LINETYPE.ACTIVE_START:et.newActivation(D,u,h);break;case n.db.LINETYPE.ACTIVE_END:E(D,et.getVerticalPos());break;case n.db.LINETYPE.LOOP_START:is(T,D,Re.boxMargin,Re.boxMargin+Re.boxTextMargin,G=>et.newLoop(G));break;case n.db.LINETYPE.LOOP_END:B=et.endLoop(),await fn.drawLoop(u,B,"loop",Re),et.bumpVerticalPos(B.stopy-et.getVerticalPos()),et.models.addLoop(B);break;case n.db.LINETYPE.RECT_START:is(T,D,Re.boxMargin,Re.boxMargin,G=>et.newLoop(void 0,G.message));break;case n.db.LINETYPE.RECT_END:B=et.endLoop(),A.push(B),et.models.addLoop(B),et.bumpVerticalPos(B.stopy-et.getVerticalPos());break;case n.db.LINETYPE.OPT_START:is(T,D,Re.boxMargin,Re.boxMargin+Re.boxTextMargin,G=>et.newLoop(G));break;case n.db.LINETYPE.OPT_END:B=et.endLoop(),await fn.drawLoop(u,B,"opt",Re),et.bumpVerticalPos(B.stopy-et.getVerticalPos()),et.models.addLoop(B);break;case n.db.LINETYPE.ALT_START:is(T,D,Re.boxMargin,Re.boxMargin+Re.boxTextMargin,G=>et.newLoop(G));break;case n.db.LINETYPE.ALT_ELSE:is(T,D,Re.boxMargin+Re.boxTextMargin,Re.boxMargin,G=>et.addSectionToLoop(G));break;case n.db.LINETYPE.ALT_END:B=et.endLoop(),await fn.drawLoop(u,B,"alt",Re),et.bumpVerticalPos(B.stopy-et.getVerticalPos()),et.models.addLoop(B);break;case n.db.LINETYPE.PAR_START:case n.db.LINETYPE.PAR_OVER_START:is(T,D,Re.boxMargin,Re.boxMargin+Re.boxTextMargin,G=>et.newLoop(G)),et.saveVerticalPos();break;case n.db.LINETYPE.PAR_AND:is(T,D,Re.boxMargin+Re.boxTextMargin,Re.boxMargin,G=>et.addSectionToLoop(G));break;case n.db.LINETYPE.PAR_END:B=et.endLoop(),await fn.drawLoop(u,B,"par",Re),et.bumpVerticalPos(B.stopy-et.getVerticalPos()),et.models.addLoop(B);break;case n.db.LINETYPE.AUTONUMBER:L=D.message.start||L,S=D.message.step||S,D.message.visible?n.db.enableSequenceNumbers():n.db.disableSequenceNumbers();break;case n.db.LINETYPE.CRITICAL_START:is(T,D,Re.boxMargin,Re.boxMargin+Re.boxTextMargin,G=>et.newLoop(G));break;case n.db.LINETYPE.CRITICAL_OPTION:is(T,D,Re.boxMargin+Re.boxTextMargin,Re.boxMargin,G=>et.addSectionToLoop(G));break;case n.db.LINETYPE.CRITICAL_END:B=et.endLoop(),await fn.drawLoop(u,B,"critical",Re),et.bumpVerticalPos(B.stopy-et.getVerticalPos()),et.models.addLoop(B);break;case n.db.LINETYPE.BREAK_START:is(T,D,Re.boxMargin,Re.boxMargin+Re.boxTextMargin,G=>et.newLoop(G));break;case n.db.LINETYPE.BREAK_END:B=et.endLoop(),await fn.drawLoop(u,B,"break",Re),et.bumpVerticalPos(B.stopy-et.getVerticalPos()),et.models.addLoop(B);break;default:try{F=D.msgModel,F.starty=et.getVerticalPos(),F.sequenceIndex=L,F.sequenceVisible=n.db.showSequenceNumbers();const G=await pH(u,F);vH(D,F,G,N,h,d,f),C.push({messageModel:F,lineStartY:G}),et.models.addMessage(F)}catch(G){ie.error("error while drawing message",G)}}[n.db.LINETYPE.SOLID_OPEN,n.db.LINETYPE.DOTTED_OPEN,n.db.LINETYPE.SOLID,n.db.LINETYPE.DOTTED,n.db.LINETYPE.SOLID_CROSS,n.db.LINETYPE.DOTTED_CROSS,n.db.LINETYPE.SOLID_POINT,n.db.LINETYPE.DOTTED_POINT,n.db.LINETYPE.BIDIRECTIONAL_SOLID,n.db.LINETYPE.BIDIRECTIONAL_DOTTED].includes(D.type)&&(L=L+S),N++}ie.debug("createdActors",d),ie.debug("destroyedActors",f),await AT(u,h,g,!1);for(const D of C)await o8e(u,D.messageModel,D.lineStartY,n);Re.mirrorActors&&await AT(u,h,g,!0),A.forEach(D=>fn.drawBackgroundRect(u,D)),hH(u,h,g,Re);for(const D of et.models.boxes){D.height=et.getVerticalPos()-D.y,et.insert(D.x,D.y,D.x+D.width,D.height);const B=Re.boxMargin*2;D.startx=D.x-B,D.starty=D.y-B*.25,D.stopx=D.startx+D.width+2*B,D.stopy=D.starty+D.height+B*.75,D.stroke="rgb(0,0,0, 0.5)",fn.drawBox(u,D,Re)}y&&et.bumpVerticalPos(Re.boxMargin);const _=gH(u,h,g,l),{bounds:O}=et.getBounds();O.startx===void 0&&(O.startx=0),O.starty===void 0&&(O.starty=0),O.stopx===void 0&&(O.stopx=0),O.stopy===void 0&&(O.stopy=0);let P=O.stopy-O.starty;P<_.maxHeight&&(P=_.maxHeight);let k=P+2*Re.diagramMarginY;Re.mirrorActors&&(k=k-Re.boxMargin+Re.bottomMarginAdj);let R=O.stopx-O.startx;R<_.maxWidth&&(R=_.maxWidth);const I=R+2*Re.diagramMarginX;v&&u.append("text").text(v).attr("x",(O.stopx-O.startx)/2-2*Re.diagramMarginX).attr("y",-25),ji(u,k,I,Re.useMaxWidth);const M=v?40:0;u.attr("viewBox",O.startx-Re.diagramMarginX+" -"+(Re.diagramMarginY+M)+" "+I+" "+(k+M)),ie.debug("models:",et.models)},"draw");async function yH(t,e,r){const n={};for(const i of e)if(t.get(i.to)&&t.get(i.from)){const a=t.get(i.to);if(i.placement===r.db.PLACEMENT.LEFTOF&&!a.prevActor||i.placement===r.db.PLACEMENT.RIGHTOF&&!a.nextActor)continue;const s=i.placement!==void 0,o=!s,l=s?dh(Re):Eu(Re),u=i.wrap?Kt.wrapLabel(i.message,Re.width-2*Re.wrapPadding,l):i.message,d=(un(u)?await Cp(i.message,we()):Kt.calculateTextDimensions(u,l)).width+2*Re.wrapPadding;o&&i.from===a.nextActor?n[i.to]=at.getMax(n[i.to]||0,d):o&&i.from===a.prevActor?n[i.from]=at.getMax(n[i.from]||0,d):o&&i.from===i.to?(n[i.from]=at.getMax(n[i.from]||0,d/2),n[i.to]=at.getMax(n[i.to]||0,d/2)):i.placement===r.db.PLACEMENT.RIGHTOF?n[i.from]=at.getMax(n[i.from]||0,d):i.placement===r.db.PLACEMENT.LEFTOF?n[a.prevActor]=at.getMax(n[a.prevActor]||0,d):i.placement===r.db.PLACEMENT.OVER&&(a.prevActor&&(n[a.prevActor]=at.getMax(n[a.prevActor]||0,d/2)),a.nextActor&&(n[i.from]=at.getMax(n[i.from]||0,d/2)))}return ie.debug("maxMessageWidthPerActor:",n),n}x(yH,"getMaxMessageWidthPerActor");var u8e=x(function(t){let e=0;const r=CT(Re);for(const n in t.links){const a=Kt.calculateTextDimensions(n,r).width+2*Re.wrapPadding+2*Re.boxMargin;e<a&&(e=a)}return e},"getRequiredPopupWidth");async function xH(t,e,r){let n=0;for(const a of t.keys()){const s=t.get(a);s.wrap&&(s.description=Kt.wrapLabel(s.description,Re.width-2*Re.wrapPadding,CT(Re)));const o=un(s.description)?await Cp(s.description,we()):Kt.calculateTextDimensions(s.description,CT(Re));s.width=s.wrap?Re.width:at.getMax(Re.width,o.width+2*Re.wrapPadding),s.height=s.wrap?at.getMax(o.height,Re.height):Re.height,n=at.getMax(n,s.height)}for(const a in e){const s=t.get(a);if(!s)continue;const o=t.get(s.nextActor);if(!o){const d=e[a]+Re.actorMargin-s.width/2;s.margin=at.getMax(d,Re.actorMargin);continue}const u=e[a]+Re.actorMargin-s.width/2-o.width/2;s.margin=at.getMax(u,Re.actorMargin)}let i=0;return r.forEach(a=>{const s=Eu(Re);let o=a.actorKeys.reduce((d,f)=>d+=t.get(f).width+(t.get(f).margin||0),0);const l=Re.boxMargin*8;o+=l,o-=2*Re.boxTextMargin,a.wrap&&(a.name=Kt.wrapLabel(a.name,o-2*Re.wrapPadding,s));const u=Kt.calculateTextDimensions(a.name,s);i=at.getMax(u.height,i);const h=at.getMax(o,u.width+2*Re.wrapPadding);if(a.margin=Re.boxTextMargin,o<h){const d=(h-o)/2;a.margin+=d}}),r.forEach(a=>a.textMaxHeight=i),at.getMax(n,Re.height)}x(xH,"calculateActorMargins");var h8e=x(async function(t,e,r){const n=e.get(t.from),i=e.get(t.to),a=n.x,s=i.x,o=t.wrap&&t.message;let l=un(t.message)?await Cp(t.message,we()):Kt.calculateTextDimensions(o?Kt.wrapLabel(t.message,Re.width,dh(Re)):t.message,dh(Re));const u={width:o?Re.width:at.getMax(Re.width,l.width+2*Re.noteMargin),height:0,startx:n.x,stopx:0,starty:0,stopy:0,message:t.message};return t.placement===r.db.PLACEMENT.RIGHTOF?(u.width=o?at.getMax(Re.width,l.width):at.getMax(n.width/2+i.width/2,l.width+2*Re.noteMargin),u.startx=a+(n.width+Re.actorMargin)/2):t.placement===r.db.PLACEMENT.LEFTOF?(u.width=o?at.getMax(Re.width,l.width+2*Re.noteMargin):at.getMax(n.width/2+i.width/2,l.width+2*Re.noteMargin),u.startx=a-u.width+(n.width-Re.actorMargin)/2):t.to===t.from?(l=Kt.calculateTextDimensions(o?Kt.wrapLabel(t.message,at.getMax(Re.width,n.width),dh(Re)):t.message,dh(Re)),u.width=o?at.getMax(Re.width,n.width):at.getMax(n.width,Re.width,l.width+2*Re.noteMargin),u.startx=a+(n.width-u.width)/2):(u.width=Math.abs(a+n.width/2-(s+i.width/2))+Re.actorMargin,u.startx=a<s?a+n.width/2-Re.actorMargin/2:s+i.width/2-Re.actorMargin/2),o&&(u.message=Kt.wrapLabel(t.message,u.width-2*Re.wrapPadding,dh(Re))),ie.debug(`NM:[${u.startx},${u.stopx},${u.starty},${u.stopy}:${u.width},${u.height}=${t.message}]`),u},"buildNoteModel"),d8e=x(function(t,e,r){if(![r.db.LINETYPE.SOLID_OPEN,r.db.LINETYPE.DOTTED_OPEN,r.db.LINETYPE.SOLID,r.db.LINETYPE.DOTTED,r.db.LINETYPE.SOLID_CROSS,r.db.LINETYPE.DOTTED_CROSS,r.db.LINETYPE.SOLID_POINT,r.db.LINETYPE.DOTTED_POINT,r.db.LINETYPE.BIDIRECTIONAL_SOLID,r.db.LINETYPE.BIDIRECTIONAL_DOTTED].includes(t.type))return{};const[n,i]=xR(t.from,e),[a,s]=xR(t.to,e),o=n<=a;let l=o?i:n,u=o?a:s;const h=Math.abs(a-s)>2,d=x(m=>o?-m:m,"adjustValue");t.from===t.to?u=l:(t.activate&&!h&&(u+=d(Re.activationWidth/2-1)),[r.db.LINETYPE.SOLID_OPEN,r.db.LINETYPE.DOTTED_OPEN].includes(t.type)||(u+=d(3)),[r.db.LINETYPE.BIDIRECTIONAL_SOLID,r.db.LINETYPE.BIDIRECTIONAL_DOTTED].includes(t.type)&&(l-=d(3)));const f=[n,i,a,s],p=Math.abs(l-u);t.wrap&&t.message&&(t.message=Kt.wrapLabel(t.message,at.getMax(p+2*Re.wrapPadding,Re.width),Eu(Re)));const g=Kt.calculateTextDimensions(t.message,Eu(Re));return{width:at.getMax(t.wrap?0:g.width+2*Re.wrapPadding,p+2*Re.wrapPadding,Re.width),height:0,startx:l,stopx:u,starty:0,stopy:0,message:t.message,type:t.type,wrap:t.wrap,fromBounds:Math.min.apply(null,f),toBounds:Math.max.apply(null,f)}},"buildMessageModel"),f8e=x(async function(t,e,r,n){const i={},a=[];let s,o,l;for(const u of t){switch(u.type){case n.db.LINETYPE.LOOP_START:case n.db.LINETYPE.ALT_START:case n.db.LINETYPE.OPT_START:case n.db.LINETYPE.PAR_START:case n.db.LINETYPE.PAR_OVER_START:case n.db.LINETYPE.CRITICAL_START:case n.db.LINETYPE.BREAK_START:a.push({id:u.id,msg:u.message,from:Number.MAX_SAFE_INTEGER,to:Number.MIN_SAFE_INTEGER,width:0});break;case n.db.LINETYPE.ALT_ELSE:case n.db.LINETYPE.PAR_AND:case n.db.LINETYPE.CRITICAL_OPTION:u.message&&(s=a.pop(),i[s.id]=s,i[u.id]=s,a.push(s));break;case n.db.LINETYPE.LOOP_END:case n.db.LINETYPE.ALT_END:case n.db.LINETYPE.OPT_END:case n.db.LINETYPE.PAR_END:case n.db.LINETYPE.CRITICAL_END:case n.db.LINETYPE.BREAK_END:s=a.pop(),i[s.id]=s;break;case n.db.LINETYPE.ACTIVE_START:{const d=e.get(u.from?u.from:u.to.actor),f=px(u.from?u.from:u.to.actor).length,p=d.x+d.width/2+(f-1)*Re.activationWidth/2,g={startx:p,stopx:p+Re.activationWidth,actor:u.from,enabled:!0};et.activations.push(g)}break;case n.db.LINETYPE.ACTIVE_END:{const d=et.activations.map(f=>f.actor).lastIndexOf(u.from);et.activations.splice(d,1).splice(0,1)}break}u.placement!==void 0?(o=await h8e(u,e,n),u.noteModel=o,a.forEach(d=>{s=d,s.from=at.getMin(s.from,o.startx),s.to=at.getMax(s.to,o.startx+o.width),s.width=at.getMax(s.width,Math.abs(s.from-s.to))-Re.labelBoxWidth})):(l=d8e(u,e,n),u.msgModel=l,l.startx&&l.stopx&&a.length>0&&a.forEach(d=>{if(s=d,l.startx===l.stopx){const f=e.get(u.from),p=e.get(u.to);s.from=at.getMin(f.x-l.width/2,f.x-f.width/2,s.from),s.to=at.getMax(p.x+l.width/2,p.x+f.width/2,s.to),s.width=at.getMax(s.width,Math.abs(s.to-s.from))-Re.labelBoxWidth}else s.from=at.getMin(l.startx,s.from),s.to=at.getMax(l.stopx,s.to),s.width=at.getMax(s.width,l.width)-Re.labelBoxWidth}))}return et.activations=[],ie.debug("Loop type widths:",i),i},"calculateLoopBounds"),p8e={bounds:et,drawActors:AT,drawActorsPopup:gH,setConf:mH,draw:c8e},g8e={parser:RCe,get db(){return new ICe},renderer:p8e,styles:PCe,init:x(t=>{t.sequence||(t.sequence={}),t.wrap&&(t.sequence.wrap=t.wrap,Y3({sequence:{wrap:t.wrap}}))},"init")};const m8e=Object.freeze(Object.defineProperty({__proto__:null,diagram:g8e},Symbol.toStringTag,{value:"Module"}));var _T=function(){var t=x(function(Pe,Se,_e,ze){for(_e=_e||{},ze=Pe.length;ze--;_e[Pe[ze]]=Se);return _e},"o"),e=[1,18],r=[1,19],n=[1,20],i=[1,41],a=[1,42],s=[1,26],o=[1,24],l=[1,25],u=[1,32],h=[1,33],d=[1,34],f=[1,45],p=[1,35],g=[1,36],m=[1,37],v=[1,38],y=[1,27],b=[1,28],w=[1,29],T=[1,30],E=[1,31],L=[1,44],S=[1,46],C=[1,43],A=[1,47],N=[1,9],_=[1,8,9],O=[1,58],P=[1,59],k=[1,60],R=[1,61],I=[1,62],M=[1,63],D=[1,64],B=[1,8,9,41],$=[1,76],F=[1,8,9,12,13,22,39,41,44,68,69,70,71,72,73,74,79,81],G=[1,8,9,12,13,18,20,22,39,41,44,50,60,68,69,70,71,72,73,74,79,81,86,100,102,103],W=[13,60,86,100,102,103],J=[13,60,73,74,86,100,102,103],q=[13,60,68,69,70,71,72,86,100,102,103],ne=[1,100],ae=[1,117],pe=[1,113],K=[1,109],Z=[1,115],X=[1,110],Y=[1,111],ee=[1,112],j=[1,114],fe=[1,116],te=[22,48,60,61,82,86,87,88,89,90],Ae=[1,8,9,39,41,44],H=[1,8,9,22],Oe=[1,145],ue=[1,8,9,61],Ve=[1,8,9,22,48,60,61,82,86,87,88,89,90],Ge={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mermaidDoc:4,statements:5,graphConfig:6,CLASS_DIAGRAM:7,NEWLINE:8,EOF:9,statement:10,classLabel:11,SQS:12,STR:13,SQE:14,namespaceName:15,alphaNumToken:16,classLiteralName:17,DOT:18,className:19,GENERICTYPE:20,relationStatement:21,LABEL:22,namespaceStatement:23,classStatement:24,memberStatement:25,annotationStatement:26,clickStatement:27,styleStatement:28,cssClassStatement:29,noteStatement:30,classDefStatement:31,direction:32,acc_title:33,acc_title_value:34,acc_descr:35,acc_descr_value:36,acc_descr_multiline_value:37,namespaceIdentifier:38,STRUCT_START:39,classStatements:40,STRUCT_STOP:41,NAMESPACE:42,classIdentifier:43,STYLE_SEPARATOR:44,members:45,CLASS:46,emptyBody:47,SPACE:48,ANNOTATION_START:49,ANNOTATION_END:50,MEMBER:51,SEPARATOR:52,relation:53,NOTE_FOR:54,noteText:55,NOTE:56,CLASSDEF:57,classList:58,stylesOpt:59,ALPHA:60,COMMA:61,direction_tb:62,direction_bt:63,direction_rl:64,direction_lr:65,relationType:66,lineType:67,AGGREGATION:68,EXTENSION:69,COMPOSITION:70,DEPENDENCY:71,LOLLIPOP:72,LINE:73,DOTTED_LINE:74,CALLBACK:75,LINK:76,LINK_TARGET:77,CLICK:78,CALLBACK_NAME:79,CALLBACK_ARGS:80,HREF:81,STYLE:82,CSSCLASS:83,style:84,styleComponent:85,NUM:86,COLON:87,UNIT:88,BRKT:89,PCT:90,commentToken:91,textToken:92,graphCodeTokens:93,textNoTagsToken:94,TAGSTART:95,TAGEND:96,"==":97,"--":98,DEFAULT:99,MINUS:100,keywords:101,UNICODE_TEXT:102,BQUOTE_STR:103,$accept:0,$end:1},terminals_:{2:"error",7:"CLASS_DIAGRAM",8:"NEWLINE",9:"EOF",12:"SQS",13:"STR",14:"SQE",18:"DOT",20:"GENERICTYPE",22:"LABEL",33:"acc_title",34:"acc_title_value",35:"acc_descr",36:"acc_descr_value",37:"acc_descr_multiline_value",39:"STRUCT_START",41:"STRUCT_STOP",42:"NAMESPACE",44:"STYLE_SEPARATOR",46:"CLASS",48:"SPACE",49:"ANNOTATION_START",50:"ANNOTATION_END",51:"MEMBER",52:"SEPARATOR",54:"NOTE_FOR",56:"NOTE",57:"CLASSDEF",60:"ALPHA",61:"COMMA",62:"direction_tb",63:"direction_bt",64:"direction_rl",65:"direction_lr",68:"AGGREGATION",69:"EXTENSION",70:"COMPOSITION",71:"DEPENDENCY",72:"LOLLIPOP",73:"LINE",74:"DOTTED_LINE",75:"CALLBACK",76:"LINK",77:"LINK_TARGET",78:"CLICK",79:"CALLBACK_NAME",80:"CALLBACK_ARGS",81:"HREF",82:"STYLE",83:"CSSCLASS",86:"NUM",87:"COLON",88:"UNIT",89:"BRKT",90:"PCT",93:"graphCodeTokens",95:"TAGSTART",96:"TAGEND",97:"==",98:"--",99:"DEFAULT",100:"MINUS",101:"keywords",102:"UNICODE_TEXT",103:"BQUOTE_STR"},productions_:[0,[3,1],[3,1],[4,1],[6,4],[5,1],[5,2],[5,3],[11,3],[15,1],[15,1],[15,3],[15,2],[19,1],[19,3],[19,1],[19,2],[19,2],[19,2],[10,1],[10,2],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,2],[10,2],[10,1],[23,4],[23,5],[38,2],[40,1],[40,2],[40,3],[24,1],[24,3],[24,4],[24,3],[24,6],[43,2],[43,3],[47,0],[47,2],[47,2],[26,4],[45,1],[45,2],[25,1],[25,2],[25,1],[25,1],[21,3],[21,4],[21,4],[21,5],[30,3],[30,2],[31,3],[58,1],[58,3],[32,1],[32,1],[32,1],[32,1],[53,3],[53,2],[53,2],[53,1],[66,1],[66,1],[66,1],[66,1],[66,1],[67,1],[67,1],[27,3],[27,4],[27,3],[27,4],[27,4],[27,5],[27,3],[27,4],[27,4],[27,5],[27,4],[27,5],[27,5],[27,6],[28,3],[29,3],[59,1],[59,3],[84,1],[84,2],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[91,1],[91,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[94,1],[94,1],[94,1],[94,1],[16,1],[16,1],[16,1],[16,1],[17,1],[55,1]],performAction:x(function(Se,_e,ze,me,De,Q,ce){var z=Q.length-1;switch(De){case 8:this.$=Q[z-1];break;case 9:case 10:case 13:case 15:this.$=Q[z];break;case 11:case 14:this.$=Q[z-2]+"."+Q[z];break;case 12:case 16:this.$=Q[z-1]+Q[z];break;case 17:case 18:this.$=Q[z-1]+"~"+Q[z]+"~";break;case 19:me.addRelation(Q[z]);break;case 20:Q[z-1].title=me.cleanupLabel(Q[z]),me.addRelation(Q[z-1]);break;case 31:this.$=Q[z].trim(),me.setAccTitle(this.$);break;case 32:case 33:this.$=Q[z].trim(),me.setAccDescription(this.$);break;case 34:me.addClassesToNamespace(Q[z-3],Q[z-1]);break;case 35:me.addClassesToNamespace(Q[z-4],Q[z-1]);break;case 36:this.$=Q[z],me.addNamespace(Q[z]);break;case 37:this.$=[Q[z]];break;case 38:this.$=[Q[z-1]];break;case 39:Q[z].unshift(Q[z-2]),this.$=Q[z];break;case 41:me.setCssClass(Q[z-2],Q[z]);break;case 42:me.addMembers(Q[z-3],Q[z-1]);break;case 44:me.setCssClass(Q[z-5],Q[z-3]),me.addMembers(Q[z-5],Q[z-1]);break;case 45:this.$=Q[z],me.addClass(Q[z]);break;case 46:this.$=Q[z-1],me.addClass(Q[z-1]),me.setClassLabel(Q[z-1],Q[z]);break;case 50:me.addAnnotation(Q[z],Q[z-2]);break;case 51:case 64:this.$=[Q[z]];break;case 52:Q[z].push(Q[z-1]),this.$=Q[z];break;case 53:break;case 54:me.addMember(Q[z-1],me.cleanupLabel(Q[z]));break;case 55:break;case 56:break;case 57:this.$={id1:Q[z-2],id2:Q[z],relation:Q[z-1],relationTitle1:"none",relationTitle2:"none"};break;case 58:this.$={id1:Q[z-3],id2:Q[z],relation:Q[z-1],relationTitle1:Q[z-2],relationTitle2:"none"};break;case 59:this.$={id1:Q[z-3],id2:Q[z],relation:Q[z-2],relationTitle1:"none",relationTitle2:Q[z-1]};break;case 60:this.$={id1:Q[z-4],id2:Q[z],relation:Q[z-2],relationTitle1:Q[z-3],relationTitle2:Q[z-1]};break;case 61:me.addNote(Q[z],Q[z-1]);break;case 62:me.addNote(Q[z]);break;case 63:this.$=Q[z-2],me.defineClass(Q[z-1],Q[z]);break;case 65:this.$=Q[z-2].concat([Q[z]]);break;case 66:me.setDirection("TB");break;case 67:me.setDirection("BT");break;case 68:me.setDirection("RL");break;case 69:me.setDirection("LR");break;case 70:this.$={type1:Q[z-2],type2:Q[z],lineType:Q[z-1]};break;case 71:this.$={type1:"none",type2:Q[z],lineType:Q[z-1]};break;case 72:this.$={type1:Q[z-1],type2:"none",lineType:Q[z]};break;case 73:this.$={type1:"none",type2:"none",lineType:Q[z]};break;case 74:this.$=me.relationType.AGGREGATION;break;case 75:this.$=me.relationType.EXTENSION;break;case 76:this.$=me.relationType.COMPOSITION;break;case 77:this.$=me.relationType.DEPENDENCY;break;case 78:this.$=me.relationType.LOLLIPOP;break;case 79:this.$=me.lineType.LINE;break;case 80:this.$=me.lineType.DOTTED_LINE;break;case 81:case 87:this.$=Q[z-2],me.setClickEvent(Q[z-1],Q[z]);break;case 82:case 88:this.$=Q[z-3],me.setClickEvent(Q[z-2],Q[z-1]),me.setTooltip(Q[z-2],Q[z]);break;case 83:this.$=Q[z-2],me.setLink(Q[z-1],Q[z]);break;case 84:this.$=Q[z-3],me.setLink(Q[z-2],Q[z-1],Q[z]);break;case 85:this.$=Q[z-3],me.setLink(Q[z-2],Q[z-1]),me.setTooltip(Q[z-2],Q[z]);break;case 86:this.$=Q[z-4],me.setLink(Q[z-3],Q[z-2],Q[z]),me.setTooltip(Q[z-3],Q[z-1]);break;case 89:this.$=Q[z-3],me.setClickEvent(Q[z-2],Q[z-1],Q[z]);break;case 90:this.$=Q[z-4],me.setClickEvent(Q[z-3],Q[z-2],Q[z-1]),me.setTooltip(Q[z-3],Q[z]);break;case 91:this.$=Q[z-3],me.setLink(Q[z-2],Q[z]);break;case 92:this.$=Q[z-4],me.setLink(Q[z-3],Q[z-1],Q[z]);break;case 93:this.$=Q[z-4],me.setLink(Q[z-3],Q[z-1]),me.setTooltip(Q[z-3],Q[z]);break;case 94:this.$=Q[z-5],me.setLink(Q[z-4],Q[z-2],Q[z]),me.setTooltip(Q[z-4],Q[z-1]);break;case 95:this.$=Q[z-2],me.setCssStyle(Q[z-1],Q[z]);break;case 96:me.setCssClass(Q[z-1],Q[z]);break;case 97:this.$=[Q[z]];break;case 98:Q[z-2].push(Q[z]),this.$=Q[z-2];break;case 100:this.$=Q[z-1]+Q[z];break}},"anonymous"),table:[{3:1,4:2,5:3,6:4,7:[1,6],10:5,16:39,17:40,19:21,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,33:e,35:r,37:n,38:22,42:i,43:23,46:a,49:s,51:o,52:l,54:u,56:h,57:d,60:f,62:p,63:g,64:m,65:v,75:y,76:b,78:w,82:T,83:E,86:L,100:S,102:C,103:A},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,3]},t(N,[2,5],{8:[1,48]}),{8:[1,49]},t(_,[2,19],{22:[1,50]}),t(_,[2,21]),t(_,[2,22]),t(_,[2,23]),t(_,[2,24]),t(_,[2,25]),t(_,[2,26]),t(_,[2,27]),t(_,[2,28]),t(_,[2,29]),t(_,[2,30]),{34:[1,51]},{36:[1,52]},t(_,[2,33]),t(_,[2,53],{53:53,66:56,67:57,13:[1,54],22:[1,55],68:O,69:P,70:k,71:R,72:I,73:M,74:D}),{39:[1,65]},t(B,[2,40],{39:[1,67],44:[1,66]}),t(_,[2,55]),t(_,[2,56]),{16:68,60:f,86:L,100:S,102:C},{16:39,17:40,19:69,60:f,86:L,100:S,102:C,103:A},{16:39,17:40,19:70,60:f,86:L,100:S,102:C,103:A},{16:39,17:40,19:71,60:f,86:L,100:S,102:C,103:A},{60:[1,72]},{13:[1,73]},{16:39,17:40,19:74,60:f,86:L,100:S,102:C,103:A},{13:$,55:75},{58:77,60:[1,78]},t(_,[2,66]),t(_,[2,67]),t(_,[2,68]),t(_,[2,69]),t(F,[2,13],{16:39,17:40,19:80,18:[1,79],20:[1,81],60:f,86:L,100:S,102:C,103:A}),t(F,[2,15],{20:[1,82]}),{15:83,16:84,17:85,60:f,86:L,100:S,102:C,103:A},{16:39,17:40,19:86,60:f,86:L,100:S,102:C,103:A},t(G,[2,123]),t(G,[2,124]),t(G,[2,125]),t(G,[2,126]),t([1,8,9,12,13,20,22,39,41,44,68,69,70,71,72,73,74,79,81],[2,127]),t(N,[2,6],{10:5,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,19:21,38:22,43:23,16:39,17:40,5:87,33:e,35:r,37:n,42:i,46:a,49:s,51:o,52:l,54:u,56:h,57:d,60:f,62:p,63:g,64:m,65:v,75:y,76:b,78:w,82:T,83:E,86:L,100:S,102:C,103:A}),{5:88,10:5,16:39,17:40,19:21,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,33:e,35:r,37:n,38:22,42:i,43:23,46:a,49:s,51:o,52:l,54:u,56:h,57:d,60:f,62:p,63:g,64:m,65:v,75:y,76:b,78:w,82:T,83:E,86:L,100:S,102:C,103:A},t(_,[2,20]),t(_,[2,31]),t(_,[2,32]),{13:[1,90],16:39,17:40,19:89,60:f,86:L,100:S,102:C,103:A},{53:91,66:56,67:57,68:O,69:P,70:k,71:R,72:I,73:M,74:D},t(_,[2,54]),{67:92,73:M,74:D},t(W,[2,73],{66:93,68:O,69:P,70:k,71:R,72:I}),t(J,[2,74]),t(J,[2,75]),t(J,[2,76]),t(J,[2,77]),t(J,[2,78]),t(q,[2,79]),t(q,[2,80]),{8:[1,95],24:96,40:94,43:23,46:a},{16:97,60:f,86:L,100:S,102:C},{41:[1,99],45:98,51:ne},{50:[1,101]},{13:[1,102]},{13:[1,103]},{79:[1,104],81:[1,105]},{22:ae,48:pe,59:106,60:K,82:Z,84:107,85:108,86:X,87:Y,88:ee,89:j,90:fe},{60:[1,118]},{13:$,55:119},t(_,[2,62]),t(_,[2,128]),{22:ae,48:pe,59:120,60:K,61:[1,121],82:Z,84:107,85:108,86:X,87:Y,88:ee,89:j,90:fe},t(te,[2,64]),{16:39,17:40,19:122,60:f,86:L,100:S,102:C,103:A},t(F,[2,16]),t(F,[2,17]),t(F,[2,18]),{39:[2,36]},{15:124,16:84,17:85,18:[1,123],39:[2,9],60:f,86:L,100:S,102:C,103:A},{39:[2,10]},t(Ae,[2,45],{11:125,12:[1,126]}),t(N,[2,7]),{9:[1,127]},t(H,[2,57]),{16:39,17:40,19:128,60:f,86:L,100:S,102:C,103:A},{13:[1,130],16:39,17:40,19:129,60:f,86:L,100:S,102:C,103:A},t(W,[2,72],{66:131,68:O,69:P,70:k,71:R,72:I}),t(W,[2,71]),{41:[1,132]},{24:96,40:133,43:23,46:a},{8:[1,134],41:[2,37]},t(B,[2,41],{39:[1,135]}),{41:[1,136]},t(B,[2,43]),{41:[2,51],45:137,51:ne},{16:39,17:40,19:138,60:f,86:L,100:S,102:C,103:A},t(_,[2,81],{13:[1,139]}),t(_,[2,83],{13:[1,141],77:[1,140]}),t(_,[2,87],{13:[1,142],80:[1,143]}),{13:[1,144]},t(_,[2,95],{61:Oe}),t(ue,[2,97],{85:146,22:ae,48:pe,60:K,82:Z,86:X,87:Y,88:ee,89:j,90:fe}),t(Ve,[2,99]),t(Ve,[2,101]),t(Ve,[2,102]),t(Ve,[2,103]),t(Ve,[2,104]),t(Ve,[2,105]),t(Ve,[2,106]),t(Ve,[2,107]),t(Ve,[2,108]),t(Ve,[2,109]),t(_,[2,96]),t(_,[2,61]),t(_,[2,63],{61:Oe}),{60:[1,147]},t(F,[2,14]),{15:148,16:84,17:85,60:f,86:L,100:S,102:C,103:A},{39:[2,12]},t(Ae,[2,46]),{13:[1,149]},{1:[2,4]},t(H,[2,59]),t(H,[2,58]),{16:39,17:40,19:150,60:f,86:L,100:S,102:C,103:A},t(W,[2,70]),t(_,[2,34]),{41:[1,151]},{24:96,40:152,41:[2,38],43:23,46:a},{45:153,51:ne},t(B,[2,42]),{41:[2,52]},t(_,[2,50]),t(_,[2,82]),t(_,[2,84]),t(_,[2,85],{77:[1,154]}),t(_,[2,88]),t(_,[2,89],{13:[1,155]}),t(_,[2,91],{13:[1,157],77:[1,156]}),{22:ae,48:pe,60:K,82:Z,84:158,85:108,86:X,87:Y,88:ee,89:j,90:fe},t(Ve,[2,100]),t(te,[2,65]),{39:[2,11]},{14:[1,159]},t(H,[2,60]),t(_,[2,35]),{41:[2,39]},{41:[1,160]},t(_,[2,86]),t(_,[2,90]),t(_,[2,92]),t(_,[2,93],{77:[1,161]}),t(ue,[2,98],{85:146,22:ae,48:pe,60:K,82:Z,86:X,87:Y,88:ee,89:j,90:fe}),t(Ae,[2,8]),t(B,[2,44]),t(_,[2,94])],defaultActions:{2:[2,1],3:[2,2],4:[2,3],83:[2,36],85:[2,10],124:[2,12],127:[2,4],137:[2,52],148:[2,11],152:[2,39]},parseError:x(function(Se,_e){if(_e.recoverable)this.trace(Se);else{var ze=new Error(Se);throw ze.hash=_e,ze}},"parseError"),parse:x(function(Se){var _e=this,ze=[0],me=[],De=[null],Q=[],ce=this.table,z="",oe=0,se=0,ge=2,he=1,be=Q.slice.call(arguments,1),Ce=Object.create(this.lexer),Te={yy:{}};for(var Ne in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Ne)&&(Te.yy[Ne]=this.yy[Ne]);Ce.setInput(Se,Te.yy),Te.yy.lexer=Ce,Te.yy.parser=this,typeof Ce.yylloc>"u"&&(Ce.yylloc={});var Xe=Ce.yylloc;Q.push(Xe);var Ye=Ce.options&&Ce.options.ranges;typeof Te.yy.parseError=="function"?this.parseError=Te.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Ke(nt){ze.length=ze.length-2*nt,De.length=De.length-nt,Q.length=Q.length-nt}x(Ke,"popStack");function Ze(){var nt;return nt=me.pop()||Ce.lex()||he,typeof nt!="number"&&(nt instanceof Array&&(me=nt,nt=me.pop()),nt=_e.symbols_[nt]||nt),nt}x(Ze,"lex");for(var Be,He,ht,st,We={},kt,qe,rt,ct;;){if(He=ze[ze.length-1],this.defaultActions[He]?ht=this.defaultActions[He]:((Be===null||typeof Be>"u")&&(Be=Ze()),ht=ce[He]&&ce[He][Be]),typeof ht>"u"||!ht.length||!ht[0]){var ut="";ct=[];for(kt in ce[He])this.terminals_[kt]&&kt>ge&&ct.push("'"+this.terminals_[kt]+"'");Ce.showPosition?ut="Parse error on line "+(oe+1)+`:
`+Ce.showPosition()+`
Expecting `+ct.join(", ")+", got '"+(this.terminals_[Be]||Be)+"'":ut="Parse error on line "+(oe+1)+": Unexpected "+(Be==he?"end of input":"'"+(this.terminals_[Be]||Be)+"'"),this.parseError(ut,{text:Ce.match,token:this.terminals_[Be]||Be,line:Ce.yylineno,loc:Xe,expected:ct})}if(ht[0]instanceof Array&&ht.length>1)throw new Error("Parse Error: multiple actions possible at state: "+He+", token: "+Be);switch(ht[0]){case 1:ze.push(Be),De.push(Ce.yytext),Q.push(Ce.yylloc),ze.push(ht[1]),Be=null,se=Ce.yyleng,z=Ce.yytext,oe=Ce.yylineno,Xe=Ce.yylloc;break;case 2:if(qe=this.productions_[ht[1]][1],We.$=De[De.length-qe],We._$={first_line:Q[Q.length-(qe||1)].first_line,last_line:Q[Q.length-1].last_line,first_column:Q[Q.length-(qe||1)].first_column,last_column:Q[Q.length-1].last_column},Ye&&(We._$.range=[Q[Q.length-(qe||1)].range[0],Q[Q.length-1].range[1]]),st=this.performAction.apply(We,[z,se,oe,Te.yy,ht[1],De,Q].concat(be)),typeof st<"u")return st;qe&&(ze=ze.slice(0,-1*qe*2),De=De.slice(0,-1*qe),Q=Q.slice(0,-1*qe)),ze.push(this.productions_[ht[1]][0]),De.push(We.$),Q.push(We._$),rt=ce[ze[ze.length-2]][ze[ze.length-1]],ze.push(rt);break;case 3:return!0}}return!0},"parse")},Ue=function(){var Pe={EOF:1,parseError:x(function(_e,ze){if(this.yy.parser)this.yy.parser.parseError(_e,ze);else throw new Error(_e)},"parseError"),setInput:x(function(Se,_e){return this.yy=_e||this.yy||{},this._input=Se,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:x(function(){var Se=this._input[0];this.yytext+=Se,this.yyleng++,this.offset++,this.match+=Se,this.matched+=Se;var _e=Se.match(/(?:\r\n?|\n).*/g);return _e?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),Se},"input"),unput:x(function(Se){var _e=Se.length,ze=Se.split(/(?:\r\n?|\n)/g);this._input=Se+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-_e),this.offset-=_e;var me=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),ze.length-1&&(this.yylineno-=ze.length-1);var De=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:ze?(ze.length===me.length?this.yylloc.first_column:0)+me[me.length-ze.length].length-ze[0].length:this.yylloc.first_column-_e},this.options.ranges&&(this.yylloc.range=[De[0],De[0]+this.yyleng-_e]),this.yyleng=this.yytext.length,this},"unput"),more:x(function(){return this._more=!0,this},"more"),reject:x(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:x(function(Se){this.unput(this.match.slice(Se))},"less"),pastInput:x(function(){var Se=this.matched.substr(0,this.matched.length-this.match.length);return(Se.length>20?"...":"")+Se.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:x(function(){var Se=this.match;return Se.length<20&&(Se+=this._input.substr(0,20-Se.length)),(Se.substr(0,20)+(Se.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:x(function(){var Se=this.pastInput(),_e=new Array(Se.length+1).join("-");return Se+this.upcomingInput()+`
`+_e+"^"},"showPosition"),test_match:x(function(Se,_e){var ze,me,De;if(this.options.backtrack_lexer&&(De={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(De.yylloc.range=this.yylloc.range.slice(0))),me=Se[0].match(/(?:\r\n?|\n).*/g),me&&(this.yylineno+=me.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:me?me[me.length-1].length-me[me.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+Se[0].length},this.yytext+=Se[0],this.match+=Se[0],this.matches=Se,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(Se[0].length),this.matched+=Se[0],ze=this.performAction.call(this,this.yy,this,_e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),ze)return ze;if(this._backtrack){for(var Q in De)this[Q]=De[Q];return!1}return!1},"test_match"),next:x(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var Se,_e,ze,me;this._more||(this.yytext="",this.match="");for(var De=this._currentRules(),Q=0;Q<De.length;Q++)if(ze=this._input.match(this.rules[De[Q]]),ze&&(!_e||ze[0].length>_e[0].length)){if(_e=ze,me=Q,this.options.backtrack_lexer){if(Se=this.test_match(ze,De[Q]),Se!==!1)return Se;if(this._backtrack){_e=!1;continue}else return!1}else if(!this.options.flex)break}return _e?(Se=this.test_match(_e,De[me]),Se!==!1?Se:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var _e=this.next();return _e||this.lex()},"lex"),begin:x(function(_e){this.conditionStack.push(_e)},"begin"),popState:x(function(){var _e=this.conditionStack.length-1;return _e>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(_e){return _e=this.conditionStack.length-1-Math.abs(_e||0),_e>=0?this.conditionStack[_e]:"INITIAL"},"topState"),pushState:x(function(_e){this.begin(_e)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:x(function(_e,ze,me,De){switch(me){case 0:return 62;case 1:return 63;case 2:return 64;case 3:return 65;case 4:break;case 5:break;case 6:return this.begin("acc_title"),33;case 7:return this.popState(),"acc_title_value";case 8:return this.begin("acc_descr"),35;case 9:return this.popState(),"acc_descr_value";case 10:this.begin("acc_descr_multiline");break;case 11:this.popState();break;case 12:return"acc_descr_multiline_value";case 13:return 8;case 14:break;case 15:return 7;case 16:return 7;case 17:return"EDGE_STATE";case 18:this.begin("callback_name");break;case 19:this.popState();break;case 20:this.popState(),this.begin("callback_args");break;case 21:return 79;case 22:this.popState();break;case 23:return 80;case 24:this.popState();break;case 25:return"STR";case 26:this.begin("string");break;case 27:return 82;case 28:return 57;case 29:return this.begin("namespace"),42;case 30:return this.popState(),8;case 31:break;case 32:return this.begin("namespace-body"),39;case 33:return this.popState(),41;case 34:return"EOF_IN_STRUCT";case 35:return 8;case 36:break;case 37:return"EDGE_STATE";case 38:return this.begin("class"),46;case 39:return this.popState(),8;case 40:break;case 41:return this.popState(),this.popState(),41;case 42:return this.begin("class-body"),39;case 43:return this.popState(),41;case 44:return"EOF_IN_STRUCT";case 45:return"EDGE_STATE";case 46:return"OPEN_IN_STRUCT";case 47:break;case 48:return"MEMBER";case 49:return 83;case 50:return 75;case 51:return 76;case 52:return 78;case 53:return 54;case 54:return 56;case 55:return 49;case 56:return 50;case 57:return 81;case 58:this.popState();break;case 59:return"GENERICTYPE";case 60:this.begin("generic");break;case 61:this.popState();break;case 62:return"BQUOTE_STR";case 63:this.begin("bqstring");break;case 64:return 77;case 65:return 77;case 66:return 77;case 67:return 77;case 68:return 69;case 69:return 69;case 70:return 71;case 71:return 71;case 72:return 70;case 73:return 68;case 74:return 72;case 75:return 73;case 76:return 74;case 77:return 22;case 78:return 44;case 79:return 100;case 80:return 18;case 81:return"PLUS";case 82:return 87;case 83:return 61;case 84:return 89;case 85:return 89;case 86:return 90;case 87:return"EQUALS";case 88:return"EQUALS";case 89:return 60;case 90:return 12;case 91:return 14;case 92:return"PUNCTUATION";case 93:return 86;case 94:return 102;case 95:return 48;case 96:return 48;case 97:return 9}},"anonymous"),rules:[/^(?:.*direction\s+TB[^\n]*)/,/^(?:.*direction\s+BT[^\n]*)/,/^(?:.*direction\s+RL[^\n]*)/,/^(?:.*direction\s+LR[^\n]*)/,/^(?:%%(?!\{)*[^\n]*(\r?\n?)+)/,/^(?:%%[^\n]*(\r?\n)*)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:classDiagram-v2\b)/,/^(?:classDiagram\b)/,/^(?:\[\*\])/,/^(?:call[\s]+)/,/^(?:\([\s]*\))/,/^(?:\()/,/^(?:[^(]*)/,/^(?:\))/,/^(?:[^)]*)/,/^(?:["])/,/^(?:[^"]*)/,/^(?:["])/,/^(?:style\b)/,/^(?:classDef\b)/,/^(?:namespace\b)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:[{])/,/^(?:[}])/,/^(?:$)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:\[\*\])/,/^(?:class\b)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:[}])/,/^(?:[{])/,/^(?:[}])/,/^(?:$)/,/^(?:\[\*\])/,/^(?:[{])/,/^(?:[\n])/,/^(?:[^{}\n]*)/,/^(?:cssClass\b)/,/^(?:callback\b)/,/^(?:link\b)/,/^(?:click\b)/,/^(?:note for\b)/,/^(?:note\b)/,/^(?:<<)/,/^(?:>>)/,/^(?:href\b)/,/^(?:[~])/,/^(?:[^~]*)/,/^(?:~)/,/^(?:[`])/,/^(?:[^`]+)/,/^(?:[`])/,/^(?:_self\b)/,/^(?:_blank\b)/,/^(?:_parent\b)/,/^(?:_top\b)/,/^(?:\s*<\|)/,/^(?:\s*\|>)/,/^(?:\s*>)/,/^(?:\s*<)/,/^(?:\s*\*)/,/^(?:\s*o\b)/,/^(?:\s*\(\))/,/^(?:--)/,/^(?:\.\.)/,/^(?::{1}[^:\n;]+)/,/^(?::{3})/,/^(?:-)/,/^(?:\.)/,/^(?:\+)/,/^(?::)/,/^(?:,)/,/^(?:#)/,/^(?:#)/,/^(?:%)/,/^(?:=)/,/^(?:=)/,/^(?:\w+)/,/^(?:\[)/,/^(?:\])/,/^(?:[!"#$%&'*+,-.`?\\/])/,/^(?:[0-9]+)/,/^(?:[\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6]|[\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377]|[\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5]|[\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA]|[\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE]|[\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA]|[\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A]|[\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39]|[\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8]|[\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C]|[\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C]|[\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99]|[\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0]|[\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1]|[\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81]|[\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3]|[\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6]|[\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A]|[\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081]|[\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D]|[\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0]|[\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310]|[\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC]|[\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D]|[\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D]|[\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3]|[\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F]|[\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128]|[\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184]|[\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3]|[\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6]|[\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE]|[\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B]|[\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788]|[\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805]|[\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5]|[\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4]|[\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E]|[\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D]|[\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36]|[\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D]|[\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC]|[\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF]|[\uFFD2-\uFFD7\uFFDA-\uFFDC])/,/^(?:\s)/,/^(?:\s)/,/^(?:$)/],conditions:{"namespace-body":{rules:[26,33,34,35,36,37,38,49,50,51,52,53,54,55,56,57,60,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,86,87,88,89,90,91,92,93,94,95,97],inclusive:!1},namespace:{rules:[26,29,30,31,32,49,50,51,52,53,54,55,56,57,60,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,86,87,88,89,90,91,92,93,94,95,97],inclusive:!1},"class-body":{rules:[26,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,60,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,86,87,88,89,90,91,92,93,94,95,97],inclusive:!1},class:{rules:[26,39,40,41,42,49,50,51,52,53,54,55,56,57,60,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,86,87,88,89,90,91,92,93,94,95,97],inclusive:!1},acc_descr_multiline:{rules:[11,12,26,49,50,51,52,53,54,55,56,57,60,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,86,87,88,89,90,91,92,93,94,95,97],inclusive:!1},acc_descr:{rules:[9,26,49,50,51,52,53,54,55,56,57,60,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,86,87,88,89,90,91,92,93,94,95,97],inclusive:!1},acc_title:{rules:[7,26,49,50,51,52,53,54,55,56,57,60,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,86,87,88,89,90,91,92,93,94,95,97],inclusive:!1},callback_args:{rules:[22,23,26,49,50,51,52,53,54,55,56,57,60,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,86,87,88,89,90,91,92,93,94,95,97],inclusive:!1},callback_name:{rules:[19,20,21,26,49,50,51,52,53,54,55,56,57,60,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,86,87,88,89,90,91,92,93,94,95,97],inclusive:!1},href:{rules:[26,49,50,51,52,53,54,55,56,57,60,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,86,87,88,89,90,91,92,93,94,95,97],inclusive:!1},struct:{rules:[26,49,50,51,52,53,54,55,56,57,60,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,86,87,88,89,90,91,92,93,94,95,97],inclusive:!1},generic:{rules:[26,49,50,51,52,53,54,55,56,57,58,59,60,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,86,87,88,89,90,91,92,93,94,95,97],inclusive:!1},bqstring:{rules:[26,49,50,51,52,53,54,55,56,57,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,86,87,88,89,90,91,92,93,94,95,97],inclusive:!1},string:{rules:[24,25,26,49,50,51,52,53,54,55,56,57,60,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,86,87,88,89,90,91,92,93,94,95,97],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,8,10,13,14,15,16,17,18,26,27,28,29,38,49,50,51,52,53,54,55,56,57,60,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97],inclusive:!0}}};return Pe}();Ge.lexer=Ue;function ke(){this.yy={}}return x(ke,"Parser"),ke.prototype=Ge,Ge.Parser=ke,new ke}();_T.parser=_T;var bH=_T,bR=["#","+","~","-",""],wR=class{static{x(this,"ClassMember")}constructor(t,e){this.memberType=e,this.visibility="",this.classifier="",this.text="";const r=fr(t,we());this.parseMember(r)}getDisplayDetails(){let t=this.visibility+pl(this.id);this.memberType==="method"&&(t+=`(${pl(this.parameters.trim())})`,this.returnType&&(t+=" : "+pl(this.returnType))),t=t.trim();const e=this.parseClassifier();return{displayText:t,cssStyle:e}}parseMember(t){let e="";if(this.memberType==="method"){const i=/([#+~-])?(.+)\((.*)\)([\s$*])?(.*)([$*])?/.exec(t);if(i){const a=i[1]?i[1].trim():"";if(bR.includes(a)&&(this.visibility=a),this.id=i[2],this.parameters=i[3]?i[3].trim():"",e=i[4]?i[4].trim():"",this.returnType=i[5]?i[5].trim():"",e===""){const s=this.returnType.substring(this.returnType.length-1);/[$*]/.exec(s)&&(e=s,this.returnType=this.returnType.substring(0,this.returnType.length-1))}}}else{const n=t.length,i=t.substring(0,1),a=t.substring(n-1);bR.includes(i)&&(this.visibility=i),/[$*]/.exec(a)&&(e=a),this.id=t.substring(this.visibility===""?0:1,e===""?n:n-1)}this.classifier=e,this.id=this.id.startsWith(" ")?" "+this.id.trim():this.id.trim();const r=`${this.visibility?"\\"+this.visibility:""}${pl(this.id)}${this.memberType==="method"?`(${pl(this.parameters)})${this.returnType?" : "+pl(this.returnType):""}`:""}`;this.text=r.replaceAll("<","&lt;").replaceAll(">","&gt;"),this.text.startsWith("\\&lt;")&&(this.text=this.text.replace("\\&lt;","~"))}parseClassifier(){switch(this.classifier){case"*":return"font-style:italic;";case"$":return"text-decoration:underline;";default:return""}}},R1="classId-",TR=0,Lc=x(t=>at.sanitizeText(t,we()),"sanitizeText"),wH=class{constructor(){this.relations=[],this.classes=new Map,this.styleClasses=new Map,this.notes=[],this.interfaces=[],this.namespaces=new Map,this.namespaceCounter=0,this.functions=[],this.lineType={LINE:0,DOTTED_LINE:1},this.relationType={AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3,LOLLIPOP:4},this.setupToolTips=x(t=>{let e=Qe(".mermaidTooltip");(e._groups||e)[0][0]===null&&(e=Qe("body").append("div").attr("class","mermaidTooltip").style("opacity",0)),Qe(t).select("svg").selectAll("g.node").on("mouseover",i=>{const a=Qe(i.currentTarget);if(a.attr("title")===null)return;const o=this.getBoundingClientRect();e.transition().duration(200).style("opacity",".9"),e.text(a.attr("title")).style("left",window.scrollX+o.left+(o.right-o.left)/2+"px").style("top",window.scrollY+o.top-14+document.body.scrollTop+"px"),e.html(e.html().replace(/&lt;br\/&gt;/g,"<br/>")),a.classed("hover",!0)}).on("mouseout",i=>{e.transition().duration(500).style("opacity",0),Qe(i.currentTarget).classed("hover",!1)})},"setupToolTips"),this.direction="TB",this.setAccTitle=Sn,this.getAccTitle=zn,this.setAccDescription=Vn,this.getAccDescription=Gn,this.setDiagramTitle=Zn,this.getDiagramTitle=_n,this.getConfig=x(()=>we().class,"getConfig"),this.functions.push(this.setupToolTips.bind(this)),this.clear(),this.addRelation=this.addRelation.bind(this),this.addClassesToNamespace=this.addClassesToNamespace.bind(this),this.addNamespace=this.addNamespace.bind(this),this.setCssClass=this.setCssClass.bind(this),this.addMembers=this.addMembers.bind(this),this.addClass=this.addClass.bind(this),this.setClassLabel=this.setClassLabel.bind(this),this.addAnnotation=this.addAnnotation.bind(this),this.addMember=this.addMember.bind(this),this.cleanupLabel=this.cleanupLabel.bind(this),this.addNote=this.addNote.bind(this),this.defineClass=this.defineClass.bind(this),this.setDirection=this.setDirection.bind(this),this.setLink=this.setLink.bind(this),this.bindFunctions=this.bindFunctions.bind(this),this.clear=this.clear.bind(this),this.setTooltip=this.setTooltip.bind(this),this.setClickEvent=this.setClickEvent.bind(this),this.setCssStyle=this.setCssStyle.bind(this)}static{x(this,"ClassDB")}splitClassNameAndType(t){const e=at.sanitizeText(t,we());let r="",n=e;if(e.indexOf("~")>0){const i=e.split("~");n=Lc(i[0]),r=Lc(i[1])}return{className:n,type:r}}setClassLabel(t,e){const r=at.sanitizeText(t,we());e&&(e=Lc(e));const{className:n}=this.splitClassNameAndType(r);this.classes.get(n).label=e,this.classes.get(n).text=`${e}${this.classes.get(n).type?`<${this.classes.get(n).type}>`:""}`}addClass(t){const e=at.sanitizeText(t,we()),{className:r,type:n}=this.splitClassNameAndType(e);if(this.classes.has(r))return;const i=at.sanitizeText(r,we());this.classes.set(i,{id:i,type:n,label:i,text:`${i}${n?`&lt;${n}&gt;`:""}`,shape:"classBox",cssClasses:"default",methods:[],members:[],annotations:[],styles:[],domId:R1+i+"-"+TR}),TR++}addInterface(t,e){const r={id:`interface${this.interfaces.length}`,label:t,classId:e};this.interfaces.push(r)}lookUpDomId(t){const e=at.sanitizeText(t,we());if(this.classes.has(e))return this.classes.get(e).domId;throw new Error("Class not found: "+e)}clear(){this.relations=[],this.classes=new Map,this.notes=[],this.interfaces=[],this.functions=[],this.functions.push(this.setupToolTips.bind(this)),this.namespaces=new Map,this.namespaceCounter=0,this.direction="TB",An()}getClass(t){return this.classes.get(t)}getClasses(){return this.classes}getRelations(){return this.relations}getNotes(){return this.notes}addRelation(t){ie.debug("Adding relation: "+JSON.stringify(t));const e=[this.relationType.LOLLIPOP,this.relationType.AGGREGATION,this.relationType.COMPOSITION,this.relationType.DEPENDENCY,this.relationType.EXTENSION];t.relation.type1===this.relationType.LOLLIPOP&&!e.includes(t.relation.type2)?(this.addClass(t.id2),this.addInterface(t.id1,t.id2),t.id1=`interface${this.interfaces.length-1}`):t.relation.type2===this.relationType.LOLLIPOP&&!e.includes(t.relation.type1)?(this.addClass(t.id1),this.addInterface(t.id2,t.id1),t.id2=`interface${this.interfaces.length-1}`):(this.addClass(t.id1),this.addClass(t.id2)),t.id1=this.splitClassNameAndType(t.id1).className,t.id2=this.splitClassNameAndType(t.id2).className,t.relationTitle1=at.sanitizeText(t.relationTitle1.trim(),we()),t.relationTitle2=at.sanitizeText(t.relationTitle2.trim(),we()),this.relations.push(t)}addAnnotation(t,e){const r=this.splitClassNameAndType(t).className;this.classes.get(r).annotations.push(e)}addMember(t,e){this.addClass(t);const r=this.splitClassNameAndType(t).className,n=this.classes.get(r);if(typeof e=="string"){const i=e.trim();i.startsWith("<<")&&i.endsWith(">>")?n.annotations.push(Lc(i.substring(2,i.length-2))):i.indexOf(")")>0?n.methods.push(new wR(i,"method")):i&&n.members.push(new wR(i,"attribute"))}}addMembers(t,e){Array.isArray(e)&&(e.reverse(),e.forEach(r=>this.addMember(t,r)))}addNote(t,e){const r={id:`note${this.notes.length}`,class:e,text:t};this.notes.push(r)}cleanupLabel(t){return t.startsWith(":")&&(t=t.substring(1)),Lc(t.trim())}setCssClass(t,e){t.split(",").forEach(r=>{let n=r;/\d/.exec(r[0])&&(n=R1+n);const i=this.classes.get(n);i&&(i.cssClasses+=" "+e)})}defineClass(t,e){for(const r of t){let n=this.styleClasses.get(r);n===void 0&&(n={id:r,styles:[],textStyles:[]},this.styleClasses.set(r,n)),e&&e.forEach(i=>{if(/color/.exec(i)){const a=i.replace("fill","bgFill");n.textStyles.push(a)}n.styles.push(i)}),this.classes.forEach(i=>{i.cssClasses.includes(r)&&i.styles.push(...e.flatMap(a=>a.split(",")))})}}setTooltip(t,e){t.split(",").forEach(r=>{e!==void 0&&(this.classes.get(r).tooltip=Lc(e))})}getTooltip(t,e){return e&&this.namespaces.has(e)?this.namespaces.get(e).classes.get(t).tooltip:this.classes.get(t).tooltip}setLink(t,e,r){const n=we();t.split(",").forEach(i=>{let a=i;/\d/.exec(i[0])&&(a=R1+a);const s=this.classes.get(a);s&&(s.link=Kt.formatUrl(e,n),n.securityLevel==="sandbox"?s.linkTarget="_top":typeof r=="string"?s.linkTarget=Lc(r):s.linkTarget="_blank")}),this.setCssClass(t,"clickable")}setClickEvent(t,e,r){t.split(",").forEach(n=>{this.setClickFunc(n,e,r),this.classes.get(n).haveCallback=!0}),this.setCssClass(t,"clickable")}setClickFunc(t,e,r){const n=at.sanitizeText(t,we());if(we().securityLevel!=="loose"||e===void 0)return;const a=n;if(this.classes.has(a)){const s=this.lookUpDomId(a);let o=[];if(typeof r=="string"){o=r.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let l=0;l<o.length;l++){let u=o[l].trim();u.startsWith('"')&&u.endsWith('"')&&(u=u.substr(1,u.length-2)),o[l]=u}}o.length===0&&o.push(s),this.functions.push(()=>{const l=document.querySelector(`[id="${s}"]`);l!==null&&l.addEventListener("click",()=>{Kt.runFunc(e,...o)},!1)})}}bindFunctions(t){this.functions.forEach(e=>{e(t)})}getDirection(){return this.direction}setDirection(t){this.direction=t}addNamespace(t){this.namespaces.has(t)||(this.namespaces.set(t,{id:t,classes:new Map,children:{},domId:R1+t+"-"+this.namespaceCounter}),this.namespaceCounter++)}getNamespace(t){return this.namespaces.get(t)}getNamespaces(){return this.namespaces}addClassesToNamespace(t,e){if(this.namespaces.has(t))for(const r of e){const{className:n}=this.splitClassNameAndType(r);this.classes.get(n).parent=t,this.namespaces.get(t).classes.set(n,this.classes.get(n))}}setCssStyle(t,e){const r=this.classes.get(t);if(!(!e||!r))for(const n of e)n.includes(",")?r.styles.push(...n.split(",")):r.styles.push(n)}getArrowMarker(t){let e;switch(t){case 0:e="aggregation";break;case 1:e="extension";break;case 2:e="composition";break;case 3:e="dependency";break;case 4:e="lollipop";break;default:e="none"}return e}getData(){const t=[],e=[],r=we();for(const i of this.namespaces.keys()){const a=this.namespaces.get(i);if(a){const s={id:a.id,label:a.id,isGroup:!0,padding:r.class.padding??16,shape:"rect",cssStyles:["fill: none","stroke: black"],look:r.look};t.push(s)}}for(const i of this.classes.keys()){const a=this.classes.get(i);if(a){const s=a;s.parentId=a.parent,s.look=r.look,t.push(s)}}let n=0;for(const i of this.notes){n++;const a={id:i.id,label:i.text,isGroup:!1,shape:"note",padding:r.class.padding??6,cssStyles:["text-align: left","white-space: nowrap",`fill: ${r.themeVariables.noteBkgColor}`,`stroke: ${r.themeVariables.noteBorderColor}`],look:r.look};t.push(a);const s=this.classes.get(i.class)?.id??"";if(s){const o={id:`edgeNote${n}`,start:i.id,end:s,type:"normal",thickness:"normal",classes:"relation",arrowTypeStart:"none",arrowTypeEnd:"none",arrowheadStyle:"",labelStyle:[""],style:["fill: none"],pattern:"dotted",look:r.look};e.push(o)}}for(const i of this.interfaces){const a={id:i.id,label:i.label,isGroup:!1,shape:"rect",cssStyles:["opacity: 0;"],look:r.look};t.push(a)}n=0;for(const i of this.relations){n++;const a={id:_h(i.id1,i.id2,{prefix:"id",counter:n}),start:i.id1,end:i.id2,type:"normal",label:i.title,labelpos:"c",thickness:"normal",classes:"relation",arrowTypeStart:this.getArrowMarker(i.relation.type1),arrowTypeEnd:this.getArrowMarker(i.relation.type2),startLabelRight:i.relationTitle1==="none"?"":i.relationTitle1,endLabelLeft:i.relationTitle2==="none"?"":i.relationTitle2,arrowheadStyle:"",labelStyle:["display: inline-block"],style:i.style||"",pattern:i.relation.lineType==1?"dashed":"solid",look:r.look};e.push(a)}return{nodes:t,edges:e,other:{},config:r,direction:this.getDirection()}}},v8e=x(t=>`g.classGroup text {
  fill: ${t.nodeBorder||t.classText};
  stroke: none;
  font-family: ${t.fontFamily};
  font-size: 10px;

  .title {
    font-weight: bolder;
  }

}

.nodeLabel, .edgeLabel {
  color: ${t.classText};
}
.edgeLabel .label rect {
  fill: ${t.mainBkg};
}
.label text {
  fill: ${t.classText};
}

.labelBkg {
  background: ${t.mainBkg};
}
.edgeLabel .label span {
  background: ${t.mainBkg};
}

.classTitle {
  font-weight: bolder;
}
.node rect,
  .node circle,
  .node ellipse,
  .node polygon,
  .node path {
    fill: ${t.mainBkg};
    stroke: ${t.nodeBorder};
    stroke-width: 1px;
  }


.divider {
  stroke: ${t.nodeBorder};
  stroke-width: 1;
}

g.clickable {
  cursor: pointer;
}

g.classGroup rect {
  fill: ${t.mainBkg};
  stroke: ${t.nodeBorder};
}

g.classGroup line {
  stroke: ${t.nodeBorder};
  stroke-width: 1;
}

.classLabel .box {
  stroke: none;
  stroke-width: 0;
  fill: ${t.mainBkg};
  opacity: 0.5;
}

.classLabel .label {
  fill: ${t.nodeBorder};
  font-size: 10px;
}

.relation {
  stroke: ${t.lineColor};
  stroke-width: 1;
  fill: none;
}

.dashed-line{
  stroke-dasharray: 3;
}

.dotted-line{
  stroke-dasharray: 1 2;
}

#compositionStart, .composition {
  fill: ${t.lineColor} !important;
  stroke: ${t.lineColor} !important;
  stroke-width: 1;
}

#compositionEnd, .composition {
  fill: ${t.lineColor} !important;
  stroke: ${t.lineColor} !important;
  stroke-width: 1;
}

#dependencyStart, .dependency {
  fill: ${t.lineColor} !important;
  stroke: ${t.lineColor} !important;
  stroke-width: 1;
}

#dependencyStart, .dependency {
  fill: ${t.lineColor} !important;
  stroke: ${t.lineColor} !important;
  stroke-width: 1;
}

#extensionStart, .extension {
  fill: transparent !important;
  stroke: ${t.lineColor} !important;
  stroke-width: 1;
}

#extensionEnd, .extension {
  fill: transparent !important;
  stroke: ${t.lineColor} !important;
  stroke-width: 1;
}

#aggregationStart, .aggregation {
  fill: transparent !important;
  stroke: ${t.lineColor} !important;
  stroke-width: 1;
}

#aggregationEnd, .aggregation {
  fill: transparent !important;
  stroke: ${t.lineColor} !important;
  stroke-width: 1;
}

#lollipopStart, .lollipop {
  fill: ${t.mainBkg} !important;
  stroke: ${t.lineColor} !important;
  stroke-width: 1;
}

#lollipopEnd, .lollipop {
  fill: ${t.mainBkg} !important;
  stroke: ${t.lineColor} !important;
  stroke-width: 1;
}

.edgeTerminals {
  font-size: 11px;
  line-height: initial;
}

.classTitleText {
  text-anchor: middle;
  font-size: 18px;
  fill: ${t.textColor};
}
  ${og()}
`,"getStyles"),TH=v8e,y8e=x((t,e="TB")=>{if(!t.doc)return e;let r=e;for(const n of t.doc)n.stmt==="dir"&&(r=n.value);return r},"getDir"),x8e=x(function(t,e){return e.db.getClasses()},"getClasses"),b8e=x(async function(t,e,r,n){ie.info("REF0:"),ie.info("Drawing class diagram (v3)",e);const{securityLevel:i,state:a,layout:s}=we(),o=n.db.getData(),l=Pd(e,i);o.type=n.type,o.layoutAlgorithm=Vp(s),o.nodeSpacing=a?.nodeSpacing||50,o.rankSpacing=a?.rankSpacing||50,o.markers=["aggregation","extension","composition","dependency","lollipop"],o.diagramId=e,await Sd(o,l);const u=8;Kt.insertTitle(l,"classDiagramTitleText",a?.titleTopMargin??25,n.db.getDiagramTitle()),Bu(l,u,"classDiagram",a?.useMaxWidth??!0)},"draw"),EH={getClasses:x8e,draw:b8e,getDir:y8e},w8e={parser:bH,get db(){return new wH},renderer:EH,styles:TH,init:x(t=>{t.class||(t.class={}),t.class.arrowMarkerAbsolute=t.arrowMarkerAbsolute},"init")};const T8e=Object.freeze(Object.defineProperty({__proto__:null,diagram:w8e},Symbol.toStringTag,{value:"Module"}));var E8e={parser:bH,get db(){return new wH},renderer:EH,styles:TH,init:x(t=>{t.class||(t.class={}),t.class.arrowMarkerAbsolute=t.arrowMarkerAbsolute},"init")};const k8e=Object.freeze(Object.defineProperty({__proto__:null,diagram:E8e},Symbol.toStringTag,{value:"Module"}));var LT=function(){var t=x(function(B,$,F,G){for(F=F||{},G=B.length;G--;F[B[G]]=$);return F},"o"),e=[1,2],r=[1,3],n=[1,4],i=[2,4],a=[1,9],s=[1,11],o=[1,16],l=[1,17],u=[1,18],h=[1,19],d=[1,33],f=[1,20],p=[1,21],g=[1,22],m=[1,23],v=[1,24],y=[1,26],b=[1,27],w=[1,28],T=[1,29],E=[1,30],L=[1,31],S=[1,32],C=[1,35],A=[1,36],N=[1,37],_=[1,38],O=[1,34],P=[1,4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],k=[1,4,5,14,15,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,39,40,41,45,48,51,52,53,54,57],R=[4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],I={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SPACE:4,NL:5,SD:6,document:7,line:8,statement:9,classDefStatement:10,styleStatement:11,cssClassStatement:12,idStatement:13,DESCR:14,"-->":15,HIDE_EMPTY:16,scale:17,WIDTH:18,COMPOSIT_STATE:19,STRUCT_START:20,STRUCT_STOP:21,STATE_DESCR:22,AS:23,ID:24,FORK:25,JOIN:26,CHOICE:27,CONCURRENT:28,note:29,notePosition:30,NOTE_TEXT:31,direction:32,acc_title:33,acc_title_value:34,acc_descr:35,acc_descr_value:36,acc_descr_multiline_value:37,CLICK:38,STRING:39,HREF:40,classDef:41,CLASSDEF_ID:42,CLASSDEF_STYLEOPTS:43,DEFAULT:44,style:45,STYLE_IDS:46,STYLEDEF_STYLEOPTS:47,class:48,CLASSENTITY_IDS:49,STYLECLASS:50,direction_tb:51,direction_bt:52,direction_rl:53,direction_lr:54,eol:55,";":56,EDGE_STATE:57,STYLE_SEPARATOR:58,left_of:59,right_of:60,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NL",6:"SD",14:"DESCR",15:"-->",16:"HIDE_EMPTY",17:"scale",18:"WIDTH",19:"COMPOSIT_STATE",20:"STRUCT_START",21:"STRUCT_STOP",22:"STATE_DESCR",23:"AS",24:"ID",25:"FORK",26:"JOIN",27:"CHOICE",28:"CONCURRENT",29:"note",31:"NOTE_TEXT",33:"acc_title",34:"acc_title_value",35:"acc_descr",36:"acc_descr_value",37:"acc_descr_multiline_value",38:"CLICK",39:"STRING",40:"HREF",41:"classDef",42:"CLASSDEF_ID",43:"CLASSDEF_STYLEOPTS",44:"DEFAULT",45:"style",46:"STYLE_IDS",47:"STYLEDEF_STYLEOPTS",48:"class",49:"CLASSENTITY_IDS",50:"STYLECLASS",51:"direction_tb",52:"direction_bt",53:"direction_rl",54:"direction_lr",56:";",57:"EDGE_STATE",58:"STYLE_SEPARATOR",59:"left_of",60:"right_of"},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,3],[9,4],[9,1],[9,2],[9,1],[9,4],[9,3],[9,6],[9,1],[9,1],[9,1],[9,1],[9,4],[9,4],[9,1],[9,2],[9,2],[9,1],[9,5],[9,5],[10,3],[10,3],[11,3],[12,3],[32,1],[32,1],[32,1],[32,1],[55,1],[55,1],[13,1],[13,1],[13,3],[13,3],[30,1],[30,1]],performAction:x(function($,F,G,W,J,q,ne){var ae=q.length-1;switch(J){case 3:return W.setRootDoc(q[ae]),q[ae];case 4:this.$=[];break;case 5:q[ae]!="nl"&&(q[ae-1].push(q[ae]),this.$=q[ae-1]);break;case 6:case 7:this.$=q[ae];break;case 8:this.$="nl";break;case 12:this.$=q[ae];break;case 13:const X=q[ae-1];X.description=W.trimColon(q[ae]),this.$=X;break;case 14:this.$={stmt:"relation",state1:q[ae-2],state2:q[ae]};break;case 15:const Y=W.trimColon(q[ae]);this.$={stmt:"relation",state1:q[ae-3],state2:q[ae-1],description:Y};break;case 19:this.$={stmt:"state",id:q[ae-3],type:"default",description:"",doc:q[ae-1]};break;case 20:var pe=q[ae],K=q[ae-2].trim();if(q[ae].match(":")){var Z=q[ae].split(":");pe=Z[0],K=[K,Z[1]]}this.$={stmt:"state",id:pe,type:"default",description:K};break;case 21:this.$={stmt:"state",id:q[ae-3],type:"default",description:q[ae-5],doc:q[ae-1]};break;case 22:this.$={stmt:"state",id:q[ae],type:"fork"};break;case 23:this.$={stmt:"state",id:q[ae],type:"join"};break;case 24:this.$={stmt:"state",id:q[ae],type:"choice"};break;case 25:this.$={stmt:"state",id:W.getDividerId(),type:"divider"};break;case 26:this.$={stmt:"state",id:q[ae-1].trim(),note:{position:q[ae-2].trim(),text:q[ae].trim()}};break;case 29:this.$=q[ae].trim(),W.setAccTitle(this.$);break;case 30:case 31:this.$=q[ae].trim(),W.setAccDescription(this.$);break;case 32:this.$={stmt:"click",id:q[ae-3],url:q[ae-2],tooltip:q[ae-1]};break;case 33:this.$={stmt:"click",id:q[ae-3],url:q[ae-1],tooltip:""};break;case 34:case 35:this.$={stmt:"classDef",id:q[ae-1].trim(),classes:q[ae].trim()};break;case 36:this.$={stmt:"style",id:q[ae-1].trim(),styleClass:q[ae].trim()};break;case 37:this.$={stmt:"applyClass",id:q[ae-1].trim(),styleClass:q[ae].trim()};break;case 38:W.setDirection("TB"),this.$={stmt:"dir",value:"TB"};break;case 39:W.setDirection("BT"),this.$={stmt:"dir",value:"BT"};break;case 40:W.setDirection("RL"),this.$={stmt:"dir",value:"RL"};break;case 41:W.setDirection("LR"),this.$={stmt:"dir",value:"LR"};break;case 44:case 45:this.$={stmt:"state",id:q[ae].trim(),type:"default",description:""};break;case 46:this.$={stmt:"state",id:q[ae-2].trim(),classes:[q[ae].trim()],type:"default",description:""};break;case 47:this.$={stmt:"state",id:q[ae-2].trim(),classes:[q[ae].trim()],type:"default",description:""};break}},"anonymous"),table:[{3:1,4:e,5:r,6:n},{1:[3]},{3:5,4:e,5:r,6:n},{3:6,4:e,5:r,6:n},t([1,4,5,16,17,19,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],i,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:a,5:s,8:8,9:10,10:12,11:13,12:14,13:15,16:o,17:l,19:u,22:h,24:d,25:f,26:p,27:g,28:m,29:v,32:25,33:y,35:b,37:w,38:T,41:E,45:L,48:S,51:C,52:A,53:N,54:_,57:O},t(P,[2,5]),{9:39,10:12,11:13,12:14,13:15,16:o,17:l,19:u,22:h,24:d,25:f,26:p,27:g,28:m,29:v,32:25,33:y,35:b,37:w,38:T,41:E,45:L,48:S,51:C,52:A,53:N,54:_,57:O},t(P,[2,7]),t(P,[2,8]),t(P,[2,9]),t(P,[2,10]),t(P,[2,11]),t(P,[2,12],{14:[1,40],15:[1,41]}),t(P,[2,16]),{18:[1,42]},t(P,[2,18],{20:[1,43]}),{23:[1,44]},t(P,[2,22]),t(P,[2,23]),t(P,[2,24]),t(P,[2,25]),{30:45,31:[1,46],59:[1,47],60:[1,48]},t(P,[2,28]),{34:[1,49]},{36:[1,50]},t(P,[2,31]),{13:51,24:d,57:O},{42:[1,52],44:[1,53]},{46:[1,54]},{49:[1,55]},t(k,[2,44],{58:[1,56]}),t(k,[2,45],{58:[1,57]}),t(P,[2,38]),t(P,[2,39]),t(P,[2,40]),t(P,[2,41]),t(P,[2,6]),t(P,[2,13]),{13:58,24:d,57:O},t(P,[2,17]),t(R,i,{7:59}),{24:[1,60]},{24:[1,61]},{23:[1,62]},{24:[2,48]},{24:[2,49]},t(P,[2,29]),t(P,[2,30]),{39:[1,63],40:[1,64]},{43:[1,65]},{43:[1,66]},{47:[1,67]},{50:[1,68]},{24:[1,69]},{24:[1,70]},t(P,[2,14],{14:[1,71]}),{4:a,5:s,8:8,9:10,10:12,11:13,12:14,13:15,16:o,17:l,19:u,21:[1,72],22:h,24:d,25:f,26:p,27:g,28:m,29:v,32:25,33:y,35:b,37:w,38:T,41:E,45:L,48:S,51:C,52:A,53:N,54:_,57:O},t(P,[2,20],{20:[1,73]}),{31:[1,74]},{24:[1,75]},{39:[1,76]},{39:[1,77]},t(P,[2,34]),t(P,[2,35]),t(P,[2,36]),t(P,[2,37]),t(k,[2,46]),t(k,[2,47]),t(P,[2,15]),t(P,[2,19]),t(R,i,{7:78}),t(P,[2,26]),t(P,[2,27]),{5:[1,79]},{5:[1,80]},{4:a,5:s,8:8,9:10,10:12,11:13,12:14,13:15,16:o,17:l,19:u,21:[1,81],22:h,24:d,25:f,26:p,27:g,28:m,29:v,32:25,33:y,35:b,37:w,38:T,41:E,45:L,48:S,51:C,52:A,53:N,54:_,57:O},t(P,[2,32]),t(P,[2,33]),t(P,[2,21])],defaultActions:{5:[2,1],6:[2,2],47:[2,48],48:[2,49]},parseError:x(function($,F){if(F.recoverable)this.trace($);else{var G=new Error($);throw G.hash=F,G}},"parseError"),parse:x(function($){var F=this,G=[0],W=[],J=[null],q=[],ne=this.table,ae="",pe=0,K=0,Z=2,X=1,Y=q.slice.call(arguments,1),ee=Object.create(this.lexer),j={yy:{}};for(var fe in this.yy)Object.prototype.hasOwnProperty.call(this.yy,fe)&&(j.yy[fe]=this.yy[fe]);ee.setInput($,j.yy),j.yy.lexer=ee,j.yy.parser=this,typeof ee.yylloc>"u"&&(ee.yylloc={});var te=ee.yylloc;q.push(te);var Ae=ee.options&&ee.options.ranges;typeof j.yy.parseError=="function"?this.parseError=j.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function H(De){G.length=G.length-2*De,J.length=J.length-De,q.length=q.length-De}x(H,"popStack");function Oe(){var De;return De=W.pop()||ee.lex()||X,typeof De!="number"&&(De instanceof Array&&(W=De,De=W.pop()),De=F.symbols_[De]||De),De}x(Oe,"lex");for(var ue,Ve,Ge,Ue,ke={},Pe,Se,_e,ze;;){if(Ve=G[G.length-1],this.defaultActions[Ve]?Ge=this.defaultActions[Ve]:((ue===null||typeof ue>"u")&&(ue=Oe()),Ge=ne[Ve]&&ne[Ve][ue]),typeof Ge>"u"||!Ge.length||!Ge[0]){var me="";ze=[];for(Pe in ne[Ve])this.terminals_[Pe]&&Pe>Z&&ze.push("'"+this.terminals_[Pe]+"'");ee.showPosition?me="Parse error on line "+(pe+1)+`:
`+ee.showPosition()+`
Expecting `+ze.join(", ")+", got '"+(this.terminals_[ue]||ue)+"'":me="Parse error on line "+(pe+1)+": Unexpected "+(ue==X?"end of input":"'"+(this.terminals_[ue]||ue)+"'"),this.parseError(me,{text:ee.match,token:this.terminals_[ue]||ue,line:ee.yylineno,loc:te,expected:ze})}if(Ge[0]instanceof Array&&Ge.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Ve+", token: "+ue);switch(Ge[0]){case 1:G.push(ue),J.push(ee.yytext),q.push(ee.yylloc),G.push(Ge[1]),ue=null,K=ee.yyleng,ae=ee.yytext,pe=ee.yylineno,te=ee.yylloc;break;case 2:if(Se=this.productions_[Ge[1]][1],ke.$=J[J.length-Se],ke._$={first_line:q[q.length-(Se||1)].first_line,last_line:q[q.length-1].last_line,first_column:q[q.length-(Se||1)].first_column,last_column:q[q.length-1].last_column},Ae&&(ke._$.range=[q[q.length-(Se||1)].range[0],q[q.length-1].range[1]]),Ue=this.performAction.apply(ke,[ae,K,pe,j.yy,Ge[1],J,q].concat(Y)),typeof Ue<"u")return Ue;Se&&(G=G.slice(0,-1*Se*2),J=J.slice(0,-1*Se),q=q.slice(0,-1*Se)),G.push(this.productions_[Ge[1]][0]),J.push(ke.$),q.push(ke._$),_e=ne[G[G.length-2]][G[G.length-1]],G.push(_e);break;case 3:return!0}}return!0},"parse")},M=function(){var B={EOF:1,parseError:x(function(F,G){if(this.yy.parser)this.yy.parser.parseError(F,G);else throw new Error(F)},"parseError"),setInput:x(function($,F){return this.yy=F||this.yy||{},this._input=$,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:x(function(){var $=this._input[0];this.yytext+=$,this.yyleng++,this.offset++,this.match+=$,this.matched+=$;var F=$.match(/(?:\r\n?|\n).*/g);return F?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),$},"input"),unput:x(function($){var F=$.length,G=$.split(/(?:\r\n?|\n)/g);this._input=$+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-F),this.offset-=F;var W=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),G.length-1&&(this.yylineno-=G.length-1);var J=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:G?(G.length===W.length?this.yylloc.first_column:0)+W[W.length-G.length].length-G[0].length:this.yylloc.first_column-F},this.options.ranges&&(this.yylloc.range=[J[0],J[0]+this.yyleng-F]),this.yyleng=this.yytext.length,this},"unput"),more:x(function(){return this._more=!0,this},"more"),reject:x(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:x(function($){this.unput(this.match.slice($))},"less"),pastInput:x(function(){var $=this.matched.substr(0,this.matched.length-this.match.length);return($.length>20?"...":"")+$.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:x(function(){var $=this.match;return $.length<20&&($+=this._input.substr(0,20-$.length)),($.substr(0,20)+($.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:x(function(){var $=this.pastInput(),F=new Array($.length+1).join("-");return $+this.upcomingInput()+`
`+F+"^"},"showPosition"),test_match:x(function($,F){var G,W,J;if(this.options.backtrack_lexer&&(J={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(J.yylloc.range=this.yylloc.range.slice(0))),W=$[0].match(/(?:\r\n?|\n).*/g),W&&(this.yylineno+=W.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:W?W[W.length-1].length-W[W.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+$[0].length},this.yytext+=$[0],this.match+=$[0],this.matches=$,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice($[0].length),this.matched+=$[0],G=this.performAction.call(this,this.yy,this,F,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),G)return G;if(this._backtrack){for(var q in J)this[q]=J[q];return!1}return!1},"test_match"),next:x(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var $,F,G,W;this._more||(this.yytext="",this.match="");for(var J=this._currentRules(),q=0;q<J.length;q++)if(G=this._input.match(this.rules[J[q]]),G&&(!F||G[0].length>F[0].length)){if(F=G,W=q,this.options.backtrack_lexer){if($=this.test_match(G,J[q]),$!==!1)return $;if(this._backtrack){F=!1;continue}else return!1}else if(!this.options.flex)break}return F?($=this.test_match(F,J[W]),$!==!1?$:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var F=this.next();return F||this.lex()},"lex"),begin:x(function(F){this.conditionStack.push(F)},"begin"),popState:x(function(){var F=this.conditionStack.length-1;return F>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(F){return F=this.conditionStack.length-1-Math.abs(F||0),F>=0?this.conditionStack[F]:"INITIAL"},"topState"),pushState:x(function(F){this.begin(F)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:x(function(F,G,W,J){switch(W){case 0:return 38;case 1:return 40;case 2:return 39;case 3:return 44;case 4:return 51;case 5:return 52;case 6:return 53;case 7:return 54;case 8:break;case 9:break;case 10:return 5;case 11:break;case 12:break;case 13:break;case 14:break;case 15:return this.pushState("SCALE"),17;case 16:return 18;case 17:this.popState();break;case 18:return this.begin("acc_title"),33;case 19:return this.popState(),"acc_title_value";case 20:return this.begin("acc_descr"),35;case 21:return this.popState(),"acc_descr_value";case 22:this.begin("acc_descr_multiline");break;case 23:this.popState();break;case 24:return"acc_descr_multiline_value";case 25:return this.pushState("CLASSDEF"),41;case 26:return this.popState(),this.pushState("CLASSDEFID"),"DEFAULT_CLASSDEF_ID";case 27:return this.popState(),this.pushState("CLASSDEFID"),42;case 28:return this.popState(),43;case 29:return this.pushState("CLASS"),48;case 30:return this.popState(),this.pushState("CLASS_STYLE"),49;case 31:return this.popState(),50;case 32:return this.pushState("STYLE"),45;case 33:return this.popState(),this.pushState("STYLEDEF_STYLES"),46;case 34:return this.popState(),47;case 35:return this.pushState("SCALE"),17;case 36:return 18;case 37:this.popState();break;case 38:this.pushState("STATE");break;case 39:return this.popState(),G.yytext=G.yytext.slice(0,-8).trim(),25;case 40:return this.popState(),G.yytext=G.yytext.slice(0,-8).trim(),26;case 41:return this.popState(),G.yytext=G.yytext.slice(0,-10).trim(),27;case 42:return this.popState(),G.yytext=G.yytext.slice(0,-8).trim(),25;case 43:return this.popState(),G.yytext=G.yytext.slice(0,-8).trim(),26;case 44:return this.popState(),G.yytext=G.yytext.slice(0,-10).trim(),27;case 45:return 51;case 46:return 52;case 47:return 53;case 48:return 54;case 49:this.pushState("STATE_STRING");break;case 50:return this.pushState("STATE_ID"),"AS";case 51:return this.popState(),"ID";case 52:this.popState();break;case 53:return"STATE_DESCR";case 54:return 19;case 55:this.popState();break;case 56:return this.popState(),this.pushState("struct"),20;case 57:break;case 58:return this.popState(),21;case 59:break;case 60:return this.begin("NOTE"),29;case 61:return this.popState(),this.pushState("NOTE_ID"),59;case 62:return this.popState(),this.pushState("NOTE_ID"),60;case 63:this.popState(),this.pushState("FLOATING_NOTE");break;case 64:return this.popState(),this.pushState("FLOATING_NOTE_ID"),"AS";case 65:break;case 66:return"NOTE_TEXT";case 67:return this.popState(),"ID";case 68:return this.popState(),this.pushState("NOTE_TEXT"),24;case 69:return this.popState(),G.yytext=G.yytext.substr(2).trim(),31;case 70:return this.popState(),G.yytext=G.yytext.slice(0,-8).trim(),31;case 71:return 6;case 72:return 6;case 73:return 16;case 74:return 57;case 75:return 24;case 76:return G.yytext=G.yytext.trim(),14;case 77:return 15;case 78:return 28;case 79:return 58;case 80:return 5;case 81:return"INVALID"}},"anonymous"),rules:[/^(?:click\b)/i,/^(?:href\b)/i,/^(?:"[^"]*")/i,/^(?:default\b)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:[\s]+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%[^\n]*)/i,/^(?:scale\s+)/i,/^(?:\d+)/i,/^(?:\s+width\b)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:classDef\s+)/i,/^(?:DEFAULT\s+)/i,/^(?:\w+\s+)/i,/^(?:[^\n]*)/i,/^(?:class\s+)/i,/^(?:(\w+)+((,\s*\w+)*))/i,/^(?:[^\n]*)/i,/^(?:style\s+)/i,/^(?:[\w,]+\s+)/i,/^(?:[^\n]*)/i,/^(?:scale\s+)/i,/^(?:\d+)/i,/^(?:\s+width\b)/i,/^(?:state\s+)/i,/^(?:.*<<fork>>)/i,/^(?:.*<<join>>)/i,/^(?:.*<<choice>>)/i,/^(?:.*\[\[fork\]\])/i,/^(?:.*\[\[join\]\])/i,/^(?:.*\[\[choice\]\])/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:["])/i,/^(?:\s*as\s+)/i,/^(?:[^\n\{]*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[^\n\s\{]+)/i,/^(?:\n)/i,/^(?:\{)/i,/^(?:%%(?!\{)[^\n]*)/i,/^(?:\})/i,/^(?:[\n])/i,/^(?:note\s+)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:")/i,/^(?:\s*as\s*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[^\n]*)/i,/^(?:\s*[^:\n\s\-]+)/i,/^(?:\s*:[^:\n;]+)/i,/^(?:[\s\S]*?end note\b)/i,/^(?:stateDiagram\s+)/i,/^(?:stateDiagram-v2\s+)/i,/^(?:hide empty description\b)/i,/^(?:\[\*\])/i,/^(?:[^:\n\s\-\{]+)/i,/^(?:\s*:[^:\n;]+)/i,/^(?:-->)/i,/^(?:--)/i,/^(?::::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{LINE:{rules:[12,13],inclusive:!1},struct:{rules:[12,13,25,29,32,38,45,46,47,48,57,58,59,60,74,75,76,77,78],inclusive:!1},FLOATING_NOTE_ID:{rules:[67],inclusive:!1},FLOATING_NOTE:{rules:[64,65,66],inclusive:!1},NOTE_TEXT:{rules:[69,70],inclusive:!1},NOTE_ID:{rules:[68],inclusive:!1},NOTE:{rules:[61,62,63],inclusive:!1},STYLEDEF_STYLEOPTS:{rules:[],inclusive:!1},STYLEDEF_STYLES:{rules:[34],inclusive:!1},STYLE_IDS:{rules:[],inclusive:!1},STYLE:{rules:[33],inclusive:!1},CLASS_STYLE:{rules:[31],inclusive:!1},CLASS:{rules:[30],inclusive:!1},CLASSDEFID:{rules:[28],inclusive:!1},CLASSDEF:{rules:[26,27],inclusive:!1},acc_descr_multiline:{rules:[23,24],inclusive:!1},acc_descr:{rules:[21],inclusive:!1},acc_title:{rules:[19],inclusive:!1},SCALE:{rules:[16,17,36,37],inclusive:!1},ALIAS:{rules:[],inclusive:!1},STATE_ID:{rules:[51],inclusive:!1},STATE_STRING:{rules:[52,53],inclusive:!1},FORK_STATE:{rules:[],inclusive:!1},STATE:{rules:[12,13,39,40,41,42,43,44,49,50,54,55,56],inclusive:!1},ID:{rules:[12,13],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,13,14,15,18,20,22,25,29,32,35,38,56,60,71,72,73,74,75,76,77,79,80,81],inclusive:!0}}};return B}();I.lexer=M;function D(){this.yy={}}return x(D,"Parser"),D.prototype=I,I.Parser=D,new D}();LT.parser=LT;var kH=LT,S8e="TB",SH="TB",ER="dir",fh="state",ah="root",RT="relation",C8e="classDef",A8e="style",_8e="applyClass",N0="default",CH="divider",AH="fill:none",_H="fill: #333",LH="c",RH="text",NH="normal",R3="rect",N3="rectWithTitle",L8e="stateStart",R8e="stateEnd",kR="divider",SR="roundedWithTitle",N8e="note",D8e="noteGroup",yg="statediagram",M8e="state",I8e=`${yg}-${M8e}`,DH="transition",O8e="note",P8e="note-edge",B8e=`${DH} ${P8e}`,F8e=`${yg}-${O8e}`,$8e="cluster",z8e=`${yg}-${$8e}`,V8e="cluster-alt",G8e=`${yg}-${V8e}`,MH="parent",IH="note",U8e="state",uS="----",W8e=`${uS}${IH}`,CR=`${uS}${MH}`,OH=x((t,e=SH)=>{if(!t.doc)return e;let r=e;for(const n of t.doc)n.stmt==="dir"&&(r=n.value);return r},"getDir"),H8e=x(function(t,e){return e.db.getClasses()},"getClasses"),q8e=x(async function(t,e,r,n){ie.info("REF0:"),ie.info("Drawing state diagram (v2)",e);const{securityLevel:i,state:a,layout:s}=we();n.db.extract(n.db.getRootDocV2());const o=n.db.getData(),l=Pd(e,i);o.type=n.type,o.layoutAlgorithm=s,o.nodeSpacing=a?.nodeSpacing||50,o.rankSpacing=a?.rankSpacing||50,o.markers=["barb"],o.diagramId=e,await Sd(o,l);const u=8;try{(typeof n.db.getLinks=="function"?n.db.getLinks():new Map).forEach((d,f)=>{const p=typeof f=="string"?f:typeof f?.id=="string"?f.id:"";if(!p){ie.warn("⚠️ Invalid or missing stateId from key:",JSON.stringify(f));return}const g=l.node()?.querySelectorAll("g");let m;if(g?.forEach(w=>{w.textContent?.trim()===p&&(m=w)}),!m){ie.warn("⚠️ Could not find node matching text:",p);return}const v=m.parentNode;if(!v){ie.warn("⚠️ Node has no parent, cannot wrap:",p);return}const y=document.createElementNS("http://www.w3.org/2000/svg","a"),b=d.url.replace(/^"+|"+$/g,"");if(y.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",b),y.setAttribute("target","_blank"),d.tooltip){const w=d.tooltip.replace(/^"+|"+$/g,"");y.setAttribute("title",w)}v.replaceChild(y,m),y.appendChild(m),ie.info("🔗 Wrapped node in <a> tag for:",p,d.url)})}catch(h){ie.error("❌ Error injecting clickable links:",h)}Kt.insertTitle(l,"statediagramTitleText",a?.titleTopMargin??25,n.db.getDiagramTitle()),Bu(l,u,yg,a?.useMaxWidth??!0)},"draw"),Y8e={getClasses:H8e,draw:q8e,getDir:OH},_m=new Map,yl=0;function Lm(t="",e=0,r="",n=uS){const i=r!==null&&r.length>0?`${n}${r}`:"";return`${U8e}-${t}${i}-${e}`}x(Lm,"stateDomId");var X8e=x((t,e,r,n,i,a,s,o)=>{ie.trace("items",e),e.forEach(l=>{switch(l.stmt){case fh:g0(t,l,r,n,i,a,s,o);break;case N0:g0(t,l,r,n,i,a,s,o);break;case RT:{g0(t,l.state1,r,n,i,a,s,o),g0(t,l.state2,r,n,i,a,s,o);const u={id:"edge"+yl,start:l.state1.id,end:l.state2.id,arrowhead:"normal",arrowTypeEnd:"arrow_barb",style:AH,labelStyle:"",label:at.sanitizeText(l.description??"",we()),arrowheadStyle:_H,labelpos:LH,labelType:RH,thickness:NH,classes:DH,look:s};i.push(u),yl++}break}})},"setupDoc"),AR=x((t,e=SH)=>{let r=e;if(t.doc)for(const n of t.doc)n.stmt==="dir"&&(r=n.value);return r},"getDir");function p0(t,e,r){if(!e.id||e.id==="</join></fork>"||e.id==="</choice>")return;e.cssClasses&&(Array.isArray(e.cssCompiledStyles)||(e.cssCompiledStyles=[]),e.cssClasses.split(" ").forEach(i=>{const a=r.get(i);a&&(e.cssCompiledStyles=[...e.cssCompiledStyles??[],...a.styles])}));const n=t.find(i=>i.id===e.id);n?Object.assign(n,e):t.push(e)}x(p0,"insertOrUpdateNode");function PH(t){return t?.classes?.join(" ")??""}x(PH,"getClassesFromDbInfo");function BH(t){return t?.styles??[]}x(BH,"getStylesFromDbInfo");var g0=x((t,e,r,n,i,a,s,o)=>{const l=e.id,u=r.get(l),h=PH(u),d=BH(u),f=we();if(ie.info("dataFetcher parsedItem",e,u,d),l!=="root"){let p=R3;e.start===!0?p=L8e:e.start===!1&&(p=R8e),e.type!==N0&&(p=e.type),_m.get(l)||_m.set(l,{id:l,shape:p,description:at.sanitizeText(l,f),cssClasses:`${h} ${I8e}`,cssStyles:d});const g=_m.get(l);e.description&&(Array.isArray(g.description)?(g.shape=N3,g.description.push(e.description)):g.description?.length&&g.description.length>0?(g.shape=N3,g.description===l?g.description=[e.description]:g.description=[g.description,e.description]):(g.shape=R3,g.description=e.description),g.description=at.sanitizeTextOrArray(g.description,f)),g.description?.length===1&&g.shape===N3&&(g.type==="group"?g.shape=SR:g.shape=R3),!g.type&&e.doc&&(ie.info("Setting cluster for XCX",l,AR(e)),g.type="group",g.isGroup=!0,g.dir=AR(e),g.shape=e.type===CH?kR:SR,g.cssClasses=`${g.cssClasses} ${z8e} ${a?G8e:""}`);const m={labelStyle:"",shape:g.shape,label:g.description,cssClasses:g.cssClasses,cssCompiledStyles:[],cssStyles:g.cssStyles,id:l,dir:g.dir,domId:Lm(l,yl),type:g.type,isGroup:g.type==="group",padding:8,rx:10,ry:10,look:s};if(m.shape===kR&&(m.label=""),t&&t.id!=="root"&&(ie.trace("Setting node ",l," to be child of its parent ",t.id),m.parentId=t.id),m.centerLabel=!0,e.note){const v={labelStyle:"",shape:N8e,label:e.note.text,cssClasses:F8e,cssStyles:[],cssCompiledStyles:[],id:l+W8e+"-"+yl,domId:Lm(l,yl,IH),type:g.type,isGroup:g.type==="group",padding:f.flowchart?.padding,look:s,position:e.note.position},y=l+CR,b={labelStyle:"",shape:D8e,label:e.note.text,cssClasses:g.cssClasses,cssStyles:[],id:l+CR,domId:Lm(l,yl,MH),type:"group",isGroup:!0,padding:16,look:s,position:e.note.position};yl++,b.id=y,v.parentId=y,p0(n,b,o),p0(n,v,o),p0(n,m,o);let w=l,T=v.id;e.note.position==="left of"&&(w=v.id,T=l),i.push({id:w+"-"+T,start:w,end:T,arrowhead:"none",arrowTypeEnd:"",style:AH,labelStyle:"",classes:B8e,arrowheadStyle:_H,labelpos:LH,labelType:RH,thickness:NH,look:s})}else p0(n,m,o)}e.doc&&(ie.trace("Adding nodes children "),X8e(e,e.doc,r,n,i,!a,s,o))},"dataFetcher"),j8e=x(()=>{_m.clear(),yl=0},"reset"),Ii={START_NODE:"[*]",START_TYPE:"start",END_NODE:"[*]",END_TYPE:"end",COLOR_KEYWORD:"color",FILL_KEYWORD:"fill",BG_FILL:"bgFill",STYLECLASS_SEP:","},_R=x(()=>new Map,"newClassesList"),LR=x(()=>({relations:[],states:new Map,documents:{}}),"newDoc"),N1=x(t=>JSON.parse(JSON.stringify(t)),"clone"),$c=class{constructor(t){this.version=t,this.nodes=[],this.edges=[],this.rootDoc=[],this.classes=_R(),this.documents={root:LR()},this.currentDocument=this.documents.root,this.startEndCount=0,this.dividerCnt=0,this.links=new Map,this.getAccTitle=zn,this.setAccTitle=Sn,this.getAccDescription=Gn,this.setAccDescription=Vn,this.setDiagramTitle=Zn,this.getDiagramTitle=_n,this.clear(),this.setRootDoc=this.setRootDoc.bind(this),this.getDividerId=this.getDividerId.bind(this),this.setDirection=this.setDirection.bind(this),this.trimColon=this.trimColon.bind(this)}static{x(this,"StateDB")}static{this.relationType={AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3}}extract(t){this.clear(!0);for(const n of Array.isArray(t)?t:t.doc)switch(n.stmt){case fh:this.addState(n.id.trim(),n.type,n.doc,n.description,n.note);break;case RT:this.addRelation(n.state1,n.state2,n.description);break;case C8e:this.addStyleClass(n.id.trim(),n.classes);break;case A8e:this.handleStyleDef(n);break;case _8e:this.setCssClass(n.id.trim(),n.styleClass);break;case"click":this.addLink(n.id,n.url,n.tooltip);break}const e=this.getStates(),r=we();j8e(),g0(void 0,this.getRootDocV2(),e,this.nodes,this.edges,!0,r.look,this.classes);for(const n of this.nodes)if(Array.isArray(n.label)){if(n.description=n.label.slice(1),n.isGroup&&n.description.length>0)throw new Error(`Group nodes can only have label. Remove the additional description for node [${n.id}]`);n.label=n.label[0]}}handleStyleDef(t){const e=t.id.trim().split(","),r=t.styleClass.split(",");for(const n of e){let i=this.getState(n);if(!i){const a=n.trim();this.addState(a),i=this.getState(a)}i&&(i.styles=r.map(a=>a.replace(/;/g,"")?.trim()))}}setRootDoc(t){ie.info("Setting root doc",t),this.rootDoc=t,this.version===1?this.extract(t):this.extract(this.getRootDocV2())}docTranslator(t,e,r){if(e.stmt===RT){this.docTranslator(t,e.state1,!0),this.docTranslator(t,e.state2,!1);return}if(e.stmt===fh&&(e.id===Ii.START_NODE?(e.id=t.id+(r?"_start":"_end"),e.start=r):e.id=e.id.trim()),e.stmt!==ah&&e.stmt!==fh||!e.doc)return;const n=[];let i=[];for(const a of e.doc)if(a.type===CH){const s=N1(a);s.doc=N1(i),n.push(s),i=[]}else i.push(a);if(n.length>0&&i.length>0){const a={stmt:fh,id:eO(),type:"divider",doc:N1(i)};n.push(N1(a)),e.doc=n}e.doc.forEach(a=>this.docTranslator(e,a,!0))}getRootDocV2(){return this.docTranslator({id:ah,stmt:ah},{id:ah,stmt:ah,doc:this.rootDoc},!0),{id:ah,doc:this.rootDoc}}addState(t,e=N0,r=void 0,n=void 0,i=void 0,a=void 0,s=void 0,o=void 0){const l=t?.trim();if(!this.currentDocument.states.has(l))ie.info("Adding state ",l,n),this.currentDocument.states.set(l,{stmt:fh,id:l,descriptions:[],type:e,doc:r,note:i,classes:[],styles:[],textStyles:[]});else{const u=this.currentDocument.states.get(l);if(!u)throw new Error(`State not found: ${l}`);u.doc||(u.doc=r),u.type||(u.type=e)}if(n&&(ie.info("Setting state description",l,n),(Array.isArray(n)?n:[n]).forEach(h=>this.addDescription(l,h.trim()))),i){const u=this.currentDocument.states.get(l);if(!u)throw new Error(`State not found: ${l}`);u.note=i,u.note.text=at.sanitizeText(u.note.text,we())}a&&(ie.info("Setting state classes",l,a),(Array.isArray(a)?a:[a]).forEach(h=>this.setCssClass(l,h.trim()))),s&&(ie.info("Setting state styles",l,s),(Array.isArray(s)?s:[s]).forEach(h=>this.setStyle(l,h.trim()))),o&&(ie.info("Setting state styles",l,s),(Array.isArray(o)?o:[o]).forEach(h=>this.setTextStyle(l,h.trim())))}clear(t){this.nodes=[],this.edges=[],this.documents={root:LR()},this.currentDocument=this.documents.root,this.startEndCount=0,this.classes=_R(),t||(this.links=new Map,An())}getState(t){return this.currentDocument.states.get(t)}getStates(){return this.currentDocument.states}logDocuments(){ie.info("Documents = ",this.documents)}getRelations(){return this.currentDocument.relations}addLink(t,e,r){this.links.set(t,{url:e,tooltip:r}),ie.warn("Adding link",t,e,r)}getLinks(){return this.links}startIdIfNeeded(t=""){return t===Ii.START_NODE?(this.startEndCount++,`${Ii.START_TYPE}${this.startEndCount}`):t}startTypeIfNeeded(t="",e=N0){return t===Ii.START_NODE?Ii.START_TYPE:e}endIdIfNeeded(t=""){return t===Ii.END_NODE?(this.startEndCount++,`${Ii.END_TYPE}${this.startEndCount}`):t}endTypeIfNeeded(t="",e=N0){return t===Ii.END_NODE?Ii.END_TYPE:e}addRelationObjs(t,e,r=""){const n=this.startIdIfNeeded(t.id.trim()),i=this.startTypeIfNeeded(t.id.trim(),t.type),a=this.startIdIfNeeded(e.id.trim()),s=this.startTypeIfNeeded(e.id.trim(),e.type);this.addState(n,i,t.doc,t.description,t.note,t.classes,t.styles,t.textStyles),this.addState(a,s,e.doc,e.description,e.note,e.classes,e.styles,e.textStyles),this.currentDocument.relations.push({id1:n,id2:a,relationTitle:at.sanitizeText(r,we())})}addRelation(t,e,r){if(typeof t=="object"&&typeof e=="object")this.addRelationObjs(t,e,r);else if(typeof t=="string"&&typeof e=="string"){const n=this.startIdIfNeeded(t.trim()),i=this.startTypeIfNeeded(t),a=this.endIdIfNeeded(e.trim()),s=this.endTypeIfNeeded(e);this.addState(n,i),this.addState(a,s),this.currentDocument.relations.push({id1:n,id2:a,relationTitle:r?at.sanitizeText(r,we()):void 0})}}addDescription(t,e){const r=this.currentDocument.states.get(t),n=e.startsWith(":")?e.replace(":","").trim():e;r?.descriptions?.push(at.sanitizeText(n,we()))}cleanupLabel(t){return t.startsWith(":")?t.slice(2).trim():t.trim()}getDividerId(){return this.dividerCnt++,`divider-id-${this.dividerCnt}`}addStyleClass(t,e=""){this.classes.has(t)||this.classes.set(t,{id:t,styles:[],textStyles:[]});const r=this.classes.get(t);e&&r&&e.split(Ii.STYLECLASS_SEP).forEach(n=>{const i=n.replace(/([^;]*);/,"$1").trim();if(RegExp(Ii.COLOR_KEYWORD).exec(n)){const s=i.replace(Ii.FILL_KEYWORD,Ii.BG_FILL).replace(Ii.COLOR_KEYWORD,Ii.FILL_KEYWORD);r.textStyles.push(s)}r.styles.push(i)})}getClasses(){return this.classes}setCssClass(t,e){t.split(",").forEach(r=>{let n=this.getState(r);if(!n){const i=r.trim();this.addState(i),n=this.getState(i)}n?.classes?.push(e)})}setStyle(t,e){this.getState(t)?.styles?.push(e)}setTextStyle(t,e){this.getState(t)?.textStyles?.push(e)}getDirectionStatement(){return this.rootDoc.find(t=>t.stmt===ER)}getDirection(){return this.getDirectionStatement()?.value??S8e}setDirection(t){const e=this.getDirectionStatement();e?e.value=t:this.rootDoc.unshift({stmt:ER,value:t})}trimColon(t){return t.startsWith(":")?t.slice(1).trim():t.trim()}getData(){const t=we();return{nodes:this.nodes,edges:this.edges,other:{},config:t,direction:OH(this.getRootDocV2())}}getConfig(){return we().state}},K8e=x(t=>`
defs #statediagram-barbEnd {
    fill: ${t.transitionColor};
    stroke: ${t.transitionColor};
  }
g.stateGroup text {
  fill: ${t.nodeBorder};
  stroke: none;
  font-size: 10px;
}
g.stateGroup text {
  fill: ${t.textColor};
  stroke: none;
  font-size: 10px;

}
g.stateGroup .state-title {
  font-weight: bolder;
  fill: ${t.stateLabelColor};
}

g.stateGroup rect {
  fill: ${t.mainBkg};
  stroke: ${t.nodeBorder};
}

g.stateGroup line {
  stroke: ${t.lineColor};
  stroke-width: 1;
}

.transition {
  stroke: ${t.transitionColor};
  stroke-width: 1;
  fill: none;
}

.stateGroup .composit {
  fill: ${t.background};
  border-bottom: 1px
}

.stateGroup .alt-composit {
  fill: #e0e0e0;
  border-bottom: 1px
}

.state-note {
  stroke: ${t.noteBorderColor};
  fill: ${t.noteBkgColor};

  text {
    fill: ${t.noteTextColor};
    stroke: none;
    font-size: 10px;
  }
}

.stateLabel .box {
  stroke: none;
  stroke-width: 0;
  fill: ${t.mainBkg};
  opacity: 0.5;
}

.edgeLabel .label rect {
  fill: ${t.labelBackgroundColor};
  opacity: 0.5;
}
.edgeLabel {
  background-color: ${t.edgeLabelBackground};
  p {
    background-color: ${t.edgeLabelBackground};
  }
  rect {
    opacity: 0.5;
    background-color: ${t.edgeLabelBackground};
    fill: ${t.edgeLabelBackground};
  }
  text-align: center;
}
.edgeLabel .label text {
  fill: ${t.transitionLabelColor||t.tertiaryTextColor};
}
.label div .edgeLabel {
  color: ${t.transitionLabelColor||t.tertiaryTextColor};
}

.stateLabel text {
  fill: ${t.stateLabelColor};
  font-size: 10px;
  font-weight: bold;
}

.node circle.state-start {
  fill: ${t.specialStateColor};
  stroke: ${t.specialStateColor};
}

.node .fork-join {
  fill: ${t.specialStateColor};
  stroke: ${t.specialStateColor};
}

.node circle.state-end {
  fill: ${t.innerEndBackground};
  stroke: ${t.background};
  stroke-width: 1.5
}
.end-state-inner {
  fill: ${t.compositeBackground||t.background};
  // stroke: ${t.background};
  stroke-width: 1.5
}

.node rect {
  fill: ${t.stateBkg||t.mainBkg};
  stroke: ${t.stateBorder||t.nodeBorder};
  stroke-width: 1px;
}
.node polygon {
  fill: ${t.mainBkg};
  stroke: ${t.stateBorder||t.nodeBorder};;
  stroke-width: 1px;
}
#statediagram-barbEnd {
  fill: ${t.lineColor};
}

.statediagram-cluster rect {
  fill: ${t.compositeTitleBackground};
  stroke: ${t.stateBorder||t.nodeBorder};
  stroke-width: 1px;
}

.cluster-label, .nodeLabel {
  color: ${t.stateLabelColor};
  // line-height: 1;
}

.statediagram-cluster rect.outer {
  rx: 5px;
  ry: 5px;
}
.statediagram-state .divider {
  stroke: ${t.stateBorder||t.nodeBorder};
}

.statediagram-state .title-state {
  rx: 5px;
  ry: 5px;
}
.statediagram-cluster.statediagram-cluster .inner {
  fill: ${t.compositeBackground||t.background};
}
.statediagram-cluster.statediagram-cluster-alt .inner {
  fill: ${t.altBackground?t.altBackground:"#efefef"};
}

.statediagram-cluster .inner {
  rx:0;
  ry:0;
}

.statediagram-state rect.basic {
  rx: 5px;
  ry: 5px;
}
.statediagram-state rect.divider {
  stroke-dasharray: 10,10;
  fill: ${t.altBackground?t.altBackground:"#efefef"};
}

.note-edge {
  stroke-dasharray: 5;
}

.statediagram-note rect {
  fill: ${t.noteBkgColor};
  stroke: ${t.noteBorderColor};
  stroke-width: 1px;
  rx: 0;
  ry: 0;
}
.statediagram-note rect {
  fill: ${t.noteBkgColor};
  stroke: ${t.noteBorderColor};
  stroke-width: 1px;
  rx: 0;
  ry: 0;
}

.statediagram-note text {
  fill: ${t.noteTextColor};
}

.statediagram-note .nodeLabel {
  color: ${t.noteTextColor};
}
.statediagram .edgeLabel {
  color: red; // ${t.noteTextColor};
}

#dependencyStart, #dependencyEnd {
  fill: ${t.lineColor};
  stroke: ${t.lineColor};
  stroke-width: 1;
}

.statediagramTitleText {
  text-anchor: middle;
  font-size: 18px;
  fill: ${t.textColor};
}
`,"getStyles"),FH=K8e,Z8e=x(t=>t.append("circle").attr("class","start-state").attr("r",we().state.sizeUnit).attr("cx",we().state.padding+we().state.sizeUnit).attr("cy",we().state.padding+we().state.sizeUnit),"drawStartState"),Q8e=x(t=>t.append("line").style("stroke","grey").style("stroke-dasharray","3").attr("x1",we().state.textHeight).attr("class","divider").attr("x2",we().state.textHeight*2).attr("y1",0).attr("y2",0),"drawDivider"),J8e=x((t,e)=>{const r=t.append("text").attr("x",2*we().state.padding).attr("y",we().state.textHeight+2*we().state.padding).attr("font-size",we().state.fontSize).attr("class","state-title").text(e.id),n=r.node().getBBox();return t.insert("rect",":first-child").attr("x",we().state.padding).attr("y",we().state.padding).attr("width",n.width+2*we().state.padding).attr("height",n.height+2*we().state.padding).attr("rx",we().state.radius),r},"drawSimpleState"),eAe=x((t,e)=>{const r=x(function(f,p,g){const m=f.append("tspan").attr("x",2*we().state.padding).text(p);g||m.attr("dy",we().state.textHeight)},"addTspan"),i=t.append("text").attr("x",2*we().state.padding).attr("y",we().state.textHeight+1.3*we().state.padding).attr("font-size",we().state.fontSize).attr("class","state-title").text(e.descriptions[0]).node().getBBox(),a=i.height,s=t.append("text").attr("x",we().state.padding).attr("y",a+we().state.padding*.4+we().state.dividerMargin+we().state.textHeight).attr("class","state-description");let o=!0,l=!0;e.descriptions.forEach(function(f){o||(r(s,f,l),l=!1),o=!1});const u=t.append("line").attr("x1",we().state.padding).attr("y1",we().state.padding+a+we().state.dividerMargin/2).attr("y2",we().state.padding+a+we().state.dividerMargin/2).attr("class","descr-divider"),h=s.node().getBBox(),d=Math.max(h.width,i.width);return u.attr("x2",d+3*we().state.padding),t.insert("rect",":first-child").attr("x",we().state.padding).attr("y",we().state.padding).attr("width",d+2*we().state.padding).attr("height",h.height+a+2*we().state.padding).attr("rx",we().state.radius),t},"drawDescrState"),tAe=x((t,e,r)=>{const n=we().state.padding,i=2*we().state.padding,a=t.node().getBBox(),s=a.width,o=a.x,l=t.append("text").attr("x",0).attr("y",we().state.titleShift).attr("font-size",we().state.fontSize).attr("class","state-title").text(e.id),h=l.node().getBBox().width+i;let d=Math.max(h,s);d===s&&(d=d+i);let f;const p=t.node().getBBox();e.doc,f=o-n,h>s&&(f=(s-d)/2+n),Math.abs(o-p.x)<n&&h>s&&(f=o-(h-s)/2);const g=1-we().state.textHeight;return t.insert("rect",":first-child").attr("x",f).attr("y",g).attr("class",r?"alt-composit":"composit").attr("width",d).attr("height",p.height+we().state.textHeight+we().state.titleShift+1).attr("rx","0"),l.attr("x",f+n),h<=s&&l.attr("x",o+(d-i)/2-h/2+n),t.insert("rect",":first-child").attr("x",f).attr("y",we().state.titleShift-we().state.textHeight-we().state.padding).attr("width",d).attr("height",we().state.textHeight*3).attr("rx",we().state.radius),t.insert("rect",":first-child").attr("x",f).attr("y",we().state.titleShift-we().state.textHeight-we().state.padding).attr("width",d).attr("height",p.height+3+2*we().state.textHeight).attr("rx",we().state.radius),t},"addTitleAndBox"),rAe=x(t=>(t.append("circle").attr("class","end-state-outer").attr("r",we().state.sizeUnit+we().state.miniPadding).attr("cx",we().state.padding+we().state.sizeUnit+we().state.miniPadding).attr("cy",we().state.padding+we().state.sizeUnit+we().state.miniPadding),t.append("circle").attr("class","end-state-inner").attr("r",we().state.sizeUnit).attr("cx",we().state.padding+we().state.sizeUnit+2).attr("cy",we().state.padding+we().state.sizeUnit+2)),"drawEndState"),nAe=x((t,e)=>{let r=we().state.forkWidth,n=we().state.forkHeight;if(e.parentId){let i=r;r=n,n=i}return t.append("rect").style("stroke","black").style("fill","black").attr("width",r).attr("height",n).attr("x",we().state.padding).attr("y",we().state.padding)},"drawForkJoinState"),iAe=x((t,e,r,n)=>{let i=0;const a=n.append("text");a.style("text-anchor","start"),a.attr("class","noteText");let s=t.replace(/\r\n/g,"<br/>");s=s.replace(/\n/g,"<br/>");const o=s.split(at.lineBreakRegex);let l=1.25*we().state.noteMargin;for(const u of o){const h=u.trim();if(h.length>0){const d=a.append("tspan");if(d.text(h),l===0){const f=d.node().getBBox();l+=f.height}i+=l,d.attr("x",e+we().state.noteMargin),d.attr("y",r+i+1.25*we().state.noteMargin)}}return{textWidth:a.node().getBBox().width,textHeight:i}},"_drawLongText"),aAe=x((t,e)=>{e.attr("class","state-note");const r=e.append("rect").attr("x",0).attr("y",we().state.padding),n=e.append("g"),{textWidth:i,textHeight:a}=iAe(t,0,0,n);return r.attr("height",a+2*we().state.noteMargin),r.attr("width",i+we().state.noteMargin*2),r},"drawNote"),RR=x(function(t,e){const r=e.id,n={id:r,label:e.id,width:0,height:0},i=t.append("g").attr("id",r).attr("class","stateGroup");e.type==="start"&&Z8e(i),e.type==="end"&&rAe(i),(e.type==="fork"||e.type==="join")&&nAe(i,e),e.type==="note"&&aAe(e.note.text,i),e.type==="divider"&&Q8e(i),e.type==="default"&&e.descriptions.length===0&&J8e(i,e),e.type==="default"&&e.descriptions.length>0&&eAe(i,e);const a=i.node().getBBox();return n.width=a.width+2*we().state.padding,n.height=a.height+2*we().state.padding,n},"drawState"),NR=0,sAe=x(function(t,e,r){const n=x(function(l){switch(l){case $c.relationType.AGGREGATION:return"aggregation";case $c.relationType.EXTENSION:return"extension";case $c.relationType.COMPOSITION:return"composition";case $c.relationType.DEPENDENCY:return"dependency"}},"getRelationType");e.points=e.points.filter(l=>!Number.isNaN(l.y));const i=e.points,a=V0().x(function(l){return l.x}).y(function(l){return l.y}).curve(Ah),s=t.append("path").attr("d",a(i)).attr("id","edge"+NR).attr("class","transition");let o="";if(we().state.arrowMarkerAbsolute&&(o=Fy(!0)),s.attr("marker-end","url("+o+"#"+n($c.relationType.DEPENDENCY)+"End)"),r.title!==void 0){const l=t.append("g").attr("class","stateLabel"),{x:u,y:h}=Kt.calcLabelPosition(e.points),d=at.getRows(r.title);let f=0;const p=[];let g=0,m=0;for(let b=0;b<=d.length;b++){const w=l.append("text").attr("text-anchor","middle").text(d[b]).attr("x",u).attr("y",h+f),T=w.node().getBBox();g=Math.max(g,T.width),m=Math.min(m,T.x),ie.info(T.x,u,h+f),f===0&&(f=w.node().getBBox().height,ie.info("Title height",f,h)),p.push(w)}let v=f*d.length;if(d.length>1){const b=(d.length-1)*f*.5;p.forEach((w,T)=>w.attr("y",h+T*f-b)),v=f*d.length}const y=l.node().getBBox();l.insert("rect",":first-child").attr("class","box").attr("x",u-g/2-we().state.padding/2).attr("y",h-v/2-we().state.padding/2-3.5).attr("width",g+we().state.padding).attr("height",v+we().state.padding),ie.info(y)}NR++},"drawEdge"),Ta,D3={},oAe=x(function(){},"setConf"),lAe=x(function(t){t.append("defs").append("marker").attr("id","dependencyEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"insertMarkers"),cAe=x(function(t,e,r,n){Ta=we().state;const i=we().securityLevel;let a;i==="sandbox"&&(a=Qe("#i"+e));const s=Qe(i==="sandbox"?a.nodes()[0].contentDocument.body:"body"),o=i==="sandbox"?a.nodes()[0].contentDocument:document;ie.debug("Rendering diagram "+t);const l=s.select(`[id='${e}']`);lAe(l);const u=n.db.getRootDoc();$H(u,l,void 0,!1,s,o,n);const h=Ta.padding,d=l.node().getBBox(),f=d.width+h*2,p=d.height+h*2,g=f*1.75;ji(l,p,g,Ta.useMaxWidth),l.attr("viewBox",`${d.x-Ta.padding}  ${d.y-Ta.padding} `+f+" "+p)},"draw"),uAe=x(t=>t?t.length*Ta.fontSizeFactor:1,"getLabelWidth"),$H=x((t,e,r,n,i,a,s)=>{const o=new ma({compound:!0,multigraph:!0});let l,u=!0;for(l=0;l<t.length;l++)if(t[l].stmt==="relation"){u=!1;break}r?o.setGraph({rankdir:"LR",multigraph:!0,compound:!0,ranker:"tight-tree",ranksep:u?1:Ta.edgeLengthFactor,nodeSep:u?1:50,isMultiGraph:!0}):o.setGraph({rankdir:"TB",multigraph:!0,compound:!0,ranksep:u?1:Ta.edgeLengthFactor,nodeSep:u?1:50,ranker:"tight-tree",isMultiGraph:!0}),o.setDefaultEdgeLabel(function(){return{}});const h=s.db.getStates(),d=s.db.getRelations(),f=Object.keys(h);for(const y of f){const b=h[y];r&&(b.parentId=r);let w;if(b.doc){let T=e.append("g").attr("id",b.id).attr("class","stateGroup");w=$H(b.doc,T,b.id,!n,i,a,s);{T=tAe(T,b,n);let E=T.node().getBBox();w.width=E.width,w.height=E.height+Ta.padding/2,D3[b.id]={y:Ta.compositTitleSize}}}else w=RR(e,b,o);if(b.note){const T={descriptions:[],id:b.id+"-note",note:b.note,type:"note"},E=RR(e,T,o);b.note.position==="left of"?(o.setNode(w.id+"-note",E),o.setNode(w.id,w)):(o.setNode(w.id,w),o.setNode(w.id+"-note",E)),o.setParent(w.id,w.id+"-group"),o.setParent(w.id+"-note",w.id+"-group")}else o.setNode(w.id,w)}ie.debug("Count=",o.nodeCount(),o);let p=0;d.forEach(function(y){p++,ie.debug("Setting edge",y),o.setEdge(y.id1,y.id2,{relation:y,width:uAe(y.title),height:Ta.labelHeight*at.getRows(y.title).length,labelpos:"c"},"id"+p)}),K$(o),ie.debug("Graph after layout",o.nodes());const g=e.node();o.nodes().forEach(function(y){y!==void 0&&o.node(y)!==void 0?(ie.warn("Node "+y+": "+JSON.stringify(o.node(y))),i.select("#"+g.id+" #"+y).attr("transform","translate("+(o.node(y).x-o.node(y).width/2)+","+(o.node(y).y+(D3[y]?D3[y].y:0)-o.node(y).height/2)+" )"),i.select("#"+g.id+" #"+y).attr("data-x-shift",o.node(y).x-o.node(y).width/2),a.querySelectorAll("#"+g.id+" #"+y+" .divider").forEach(w=>{const T=w.parentElement;let E=0,L=0;T&&(T.parentElement&&(E=T.parentElement.getBBox().width),L=parseInt(T.getAttribute("data-x-shift"),10),Number.isNaN(L)&&(L=0)),w.setAttribute("x1",0-L+8),w.setAttribute("x2",E-L-8)})):ie.debug("No Node "+y+": "+JSON.stringify(o.node(y)))});let m=g.getBBox();o.edges().forEach(function(y){y!==void 0&&o.edge(y)!==void 0&&(ie.debug("Edge "+y.v+" -> "+y.w+": "+JSON.stringify(o.edge(y))),sAe(e,o.edge(y),o.edge(y).relation))}),m=g.getBBox();const v={id:r||"root",label:r||"root",width:0,height:0};return v.width=m.width+2*Ta.padding,v.height=m.height+2*Ta.padding,ie.debug("Doc rendered",v,o),v},"renderDoc"),hAe={setConf:oAe,draw:cAe},dAe={parser:kH,get db(){return new $c(1)},renderer:hAe,styles:FH,init:x(t=>{t.state||(t.state={}),t.state.arrowMarkerAbsolute=t.arrowMarkerAbsolute},"init")};const fAe=Object.freeze(Object.defineProperty({__proto__:null,diagram:dAe},Symbol.toStringTag,{value:"Module"}));var pAe={parser:kH,get db(){return new $c(2)},renderer:Y8e,styles:FH,init:x(t=>{t.state||(t.state={}),t.state.arrowMarkerAbsolute=t.arrowMarkerAbsolute},"init")};const gAe=Object.freeze(Object.defineProperty({__proto__:null,diagram:pAe},Symbol.toStringTag,{value:"Module"}));var NT=function(){var t=x(function(d,f,p,g){for(p=p||{},g=d.length;g--;p[d[g]]=f);return p},"o"),e=[6,8,10,11,12,14,16,17,18],r=[1,9],n=[1,10],i=[1,11],a=[1,12],s=[1,13],o=[1,14],l={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,start:3,journey:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,title:11,acc_title:12,acc_title_value:13,acc_descr:14,acc_descr_value:15,acc_descr_multiline_value:16,section:17,taskName:18,taskData:19,$accept:0,$end:1},terminals_:{2:"error",4:"journey",6:"EOF",8:"SPACE",10:"NEWLINE",11:"title",12:"acc_title",13:"acc_title_value",14:"acc_descr",15:"acc_descr_value",16:"acc_descr_multiline_value",17:"section",18:"taskName",19:"taskData"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,2]],performAction:x(function(f,p,g,m,v,y,b){var w=y.length-1;switch(v){case 1:return y[w-1];case 2:this.$=[];break;case 3:y[w-1].push(y[w]),this.$=y[w-1];break;case 4:case 5:this.$=y[w];break;case 6:case 7:this.$=[];break;case 8:m.setDiagramTitle(y[w].substr(6)),this.$=y[w].substr(6);break;case 9:this.$=y[w].trim(),m.setAccTitle(this.$);break;case 10:case 11:this.$=y[w].trim(),m.setAccDescription(this.$);break;case 12:m.addSection(y[w].substr(8)),this.$=y[w].substr(8);break;case 13:m.addTask(y[w-1],y[w]),this.$="task";break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:r,12:n,14:i,16:a,17:s,18:o},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:15,11:r,12:n,14:i,16:a,17:s,18:o},t(e,[2,5]),t(e,[2,6]),t(e,[2,8]),{13:[1,16]},{15:[1,17]},t(e,[2,11]),t(e,[2,12]),{19:[1,18]},t(e,[2,4]),t(e,[2,9]),t(e,[2,10]),t(e,[2,13])],defaultActions:{},parseError:x(function(f,p){if(p.recoverable)this.trace(f);else{var g=new Error(f);throw g.hash=p,g}},"parseError"),parse:x(function(f){var p=this,g=[0],m=[],v=[null],y=[],b=this.table,w="",T=0,E=0,L=2,S=1,C=y.slice.call(arguments,1),A=Object.create(this.lexer),N={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(N.yy[_]=this.yy[_]);A.setInput(f,N.yy),N.yy.lexer=A,N.yy.parser=this,typeof A.yylloc>"u"&&(A.yylloc={});var O=A.yylloc;y.push(O);var P=A.options&&A.options.ranges;typeof N.yy.parseError=="function"?this.parseError=N.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function k(ne){g.length=g.length-2*ne,v.length=v.length-ne,y.length=y.length-ne}x(k,"popStack");function R(){var ne;return ne=m.pop()||A.lex()||S,typeof ne!="number"&&(ne instanceof Array&&(m=ne,ne=m.pop()),ne=p.symbols_[ne]||ne),ne}x(R,"lex");for(var I,M,D,B,$={},F,G,W,J;;){if(M=g[g.length-1],this.defaultActions[M]?D=this.defaultActions[M]:((I===null||typeof I>"u")&&(I=R()),D=b[M]&&b[M][I]),typeof D>"u"||!D.length||!D[0]){var q="";J=[];for(F in b[M])this.terminals_[F]&&F>L&&J.push("'"+this.terminals_[F]+"'");A.showPosition?q="Parse error on line "+(T+1)+`:
`+A.showPosition()+`
Expecting `+J.join(", ")+", got '"+(this.terminals_[I]||I)+"'":q="Parse error on line "+(T+1)+": Unexpected "+(I==S?"end of input":"'"+(this.terminals_[I]||I)+"'"),this.parseError(q,{text:A.match,token:this.terminals_[I]||I,line:A.yylineno,loc:O,expected:J})}if(D[0]instanceof Array&&D.length>1)throw new Error("Parse Error: multiple actions possible at state: "+M+", token: "+I);switch(D[0]){case 1:g.push(I),v.push(A.yytext),y.push(A.yylloc),g.push(D[1]),I=null,E=A.yyleng,w=A.yytext,T=A.yylineno,O=A.yylloc;break;case 2:if(G=this.productions_[D[1]][1],$.$=v[v.length-G],$._$={first_line:y[y.length-(G||1)].first_line,last_line:y[y.length-1].last_line,first_column:y[y.length-(G||1)].first_column,last_column:y[y.length-1].last_column},P&&($._$.range=[y[y.length-(G||1)].range[0],y[y.length-1].range[1]]),B=this.performAction.apply($,[w,E,T,N.yy,D[1],v,y].concat(C)),typeof B<"u")return B;G&&(g=g.slice(0,-1*G*2),v=v.slice(0,-1*G),y=y.slice(0,-1*G)),g.push(this.productions_[D[1]][0]),v.push($.$),y.push($._$),W=b[g[g.length-2]][g[g.length-1]],g.push(W);break;case 3:return!0}}return!0},"parse")},u=function(){var d={EOF:1,parseError:x(function(p,g){if(this.yy.parser)this.yy.parser.parseError(p,g);else throw new Error(p)},"parseError"),setInput:x(function(f,p){return this.yy=p||this.yy||{},this._input=f,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:x(function(){var f=this._input[0];this.yytext+=f,this.yyleng++,this.offset++,this.match+=f,this.matched+=f;var p=f.match(/(?:\r\n?|\n).*/g);return p?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),f},"input"),unput:x(function(f){var p=f.length,g=f.split(/(?:\r\n?|\n)/g);this._input=f+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-p),this.offset-=p;var m=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),g.length-1&&(this.yylineno-=g.length-1);var v=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:g?(g.length===m.length?this.yylloc.first_column:0)+m[m.length-g.length].length-g[0].length:this.yylloc.first_column-p},this.options.ranges&&(this.yylloc.range=[v[0],v[0]+this.yyleng-p]),this.yyleng=this.yytext.length,this},"unput"),more:x(function(){return this._more=!0,this},"more"),reject:x(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:x(function(f){this.unput(this.match.slice(f))},"less"),pastInput:x(function(){var f=this.matched.substr(0,this.matched.length-this.match.length);return(f.length>20?"...":"")+f.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:x(function(){var f=this.match;return f.length<20&&(f+=this._input.substr(0,20-f.length)),(f.substr(0,20)+(f.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:x(function(){var f=this.pastInput(),p=new Array(f.length+1).join("-");return f+this.upcomingInput()+`
`+p+"^"},"showPosition"),test_match:x(function(f,p){var g,m,v;if(this.options.backtrack_lexer&&(v={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(v.yylloc.range=this.yylloc.range.slice(0))),m=f[0].match(/(?:\r\n?|\n).*/g),m&&(this.yylineno+=m.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:m?m[m.length-1].length-m[m.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+f[0].length},this.yytext+=f[0],this.match+=f[0],this.matches=f,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(f[0].length),this.matched+=f[0],g=this.performAction.call(this,this.yy,this,p,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),g)return g;if(this._backtrack){for(var y in v)this[y]=v[y];return!1}return!1},"test_match"),next:x(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var f,p,g,m;this._more||(this.yytext="",this.match="");for(var v=this._currentRules(),y=0;y<v.length;y++)if(g=this._input.match(this.rules[v[y]]),g&&(!p||g[0].length>p[0].length)){if(p=g,m=y,this.options.backtrack_lexer){if(f=this.test_match(g,v[y]),f!==!1)return f;if(this._backtrack){p=!1;continue}else return!1}else if(!this.options.flex)break}return p?(f=this.test_match(p,v[m]),f!==!1?f:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var p=this.next();return p||this.lex()},"lex"),begin:x(function(p){this.conditionStack.push(p)},"begin"),popState:x(function(){var p=this.conditionStack.length-1;return p>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(p){return p=this.conditionStack.length-1-Math.abs(p||0),p>=0?this.conditionStack[p]:"INITIAL"},"topState"),pushState:x(function(p){this.begin(p)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:x(function(p,g,m,v){switch(m){case 0:break;case 1:break;case 2:return 10;case 3:break;case 4:break;case 5:return 4;case 6:return 11;case 7:return this.begin("acc_title"),12;case 8:return this.popState(),"acc_title_value";case 9:return this.begin("acc_descr"),14;case 10:return this.popState(),"acc_descr_value";case 11:this.begin("acc_descr_multiline");break;case 12:this.popState();break;case 13:return"acc_descr_multiline_value";case 14:return 17;case 15:return 18;case 16:return 19;case 17:return":";case 18:return 6;case 19:return"INVALID"}},"anonymous"),rules:[/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:journey\b)/i,/^(?:title\s[^#\n;]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:section\s[^#:\n;]+)/i,/^(?:[^#:\n;]+)/i,/^(?::[^#\n;]+)/i,/^(?::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[12,13],inclusive:!1},acc_descr:{rules:[10],inclusive:!1},acc_title:{rules:[8],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,9,11,14,15,16,17,18,19],inclusive:!0}}};return d}();l.lexer=u;function h(){this.yy={}}return x(h,"Parser"),h.prototype=l,l.Parser=h,new h}();NT.parser=NT;var mAe=NT,gd="",hS=[],Tp=[],Ep=[],vAe=x(function(){hS.length=0,Tp.length=0,gd="",Ep.length=0,An()},"clear"),yAe=x(function(t){gd=t,hS.push(t)},"addSection"),xAe=x(function(){return hS},"getSections"),bAe=x(function(){let t=DR();const e=100;let r=0;for(;!t&&r<e;)t=DR(),r++;return Tp.push(...Ep),Tp},"getTasks"),wAe=x(function(){const t=[];return Tp.forEach(r=>{r.people&&t.push(...r.people)}),[...new Set(t)].sort()},"updateActors"),TAe=x(function(t,e){const r=e.substr(1).split(":");let n=0,i=[];r.length===1?(n=Number(r[0]),i=[]):(n=Number(r[0]),i=r[1].split(","));const a=i.map(o=>o.trim()),s={section:gd,type:gd,people:a,task:t,score:n};Ep.push(s)},"addTask"),EAe=x(function(t){const e={section:gd,type:gd,description:t,task:t,classes:[]};Tp.push(e)},"addTaskOrg"),DR=x(function(){const t=x(function(r){return Ep[r].processed},"compileTask");let e=!0;for(const[r,n]of Ep.entries())t(r),e=e&&n.processed;return e},"compileTasks"),kAe=x(function(){return wAe()},"getActors"),MR={getConfig:x(()=>we().journey,"getConfig"),clear:vAe,setDiagramTitle:Zn,getDiagramTitle:_n,setAccTitle:Sn,getAccTitle:zn,setAccDescription:Vn,getAccDescription:Gn,addSection:yAe,getSections:xAe,getTasks:bAe,addTask:TAe,addTaskOrg:EAe,getActors:kAe},SAe=x(t=>`.label {
    font-family: ${t.fontFamily};
    color: ${t.textColor};
  }
  .mouth {
    stroke: #666;
  }

  line {
    stroke: ${t.textColor}
  }

  .legend {
    fill: ${t.textColor};
    font-family: ${t.fontFamily};
  }

  .label text {
    fill: #333;
  }
  .label {
    color: ${t.textColor}
  }

  .face {
    ${t.faceColor?`fill: ${t.faceColor}`:"fill: #FFF8DC"};
    stroke: #999;
  }

  .node rect,
  .node circle,
  .node ellipse,
  .node polygon,
  .node path {
    fill: ${t.mainBkg};
    stroke: ${t.nodeBorder};
    stroke-width: 1px;
  }

  .node .label {
    text-align: center;
  }
  .node.clickable {
    cursor: pointer;
  }

  .arrowheadPath {
    fill: ${t.arrowheadColor};
  }

  .edgePath .path {
    stroke: ${t.lineColor};
    stroke-width: 1.5px;
  }

  .flowchart-link {
    stroke: ${t.lineColor};
    fill: none;
  }

  .edgeLabel {
    background-color: ${t.edgeLabelBackground};
    rect {
      opacity: 0.5;
    }
    text-align: center;
  }

  .cluster rect {
  }

  .cluster text {
    fill: ${t.titleColor};
  }

  div.mermaidTooltip {
    position: absolute;
    text-align: center;
    max-width: 200px;
    padding: 2px;
    font-family: ${t.fontFamily};
    font-size: 12px;
    background: ${t.tertiaryColor};
    border: 1px solid ${t.border2};
    border-radius: 2px;
    pointer-events: none;
    z-index: 100;
  }

  .task-type-0, .section-type-0  {
    ${t.fillType0?`fill: ${t.fillType0}`:""};
  }
  .task-type-1, .section-type-1  {
    ${t.fillType0?`fill: ${t.fillType1}`:""};
  }
  .task-type-2, .section-type-2  {
    ${t.fillType0?`fill: ${t.fillType2}`:""};
  }
  .task-type-3, .section-type-3  {
    ${t.fillType0?`fill: ${t.fillType3}`:""};
  }
  .task-type-4, .section-type-4  {
    ${t.fillType0?`fill: ${t.fillType4}`:""};
  }
  .task-type-5, .section-type-5  {
    ${t.fillType0?`fill: ${t.fillType5}`:""};
  }
  .task-type-6, .section-type-6  {
    ${t.fillType0?`fill: ${t.fillType6}`:""};
  }
  .task-type-7, .section-type-7  {
    ${t.fillType0?`fill: ${t.fillType7}`:""};
  }

  .actor-0 {
    ${t.actor0?`fill: ${t.actor0}`:""};
  }
  .actor-1 {
    ${t.actor1?`fill: ${t.actor1}`:""};
  }
  .actor-2 {
    ${t.actor2?`fill: ${t.actor2}`:""};
  }
  .actor-3 {
    ${t.actor3?`fill: ${t.actor3}`:""};
  }
  .actor-4 {
    ${t.actor4?`fill: ${t.actor4}`:""};
  }
  .actor-5 {
    ${t.actor5?`fill: ${t.actor5}`:""};
  }
  ${og()}
`,"getStyles"),CAe=SAe,dS=x(function(t,e){return H2(t,e)},"drawRect"),AAe=x(function(t,e){const n=t.append("circle").attr("cx",e.cx).attr("cy",e.cy).attr("class","face").attr("r",15).attr("stroke-width",2).attr("overflow","visible"),i=t.append("g");i.append("circle").attr("cx",e.cx-15/3).attr("cy",e.cy-15/3).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),i.append("circle").attr("cx",e.cx+15/3).attr("cy",e.cy-15/3).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666");function a(l){const u=Xh().startAngle(Math.PI/2).endAngle(3*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);l.append("path").attr("class","mouth").attr("d",u).attr("transform","translate("+e.cx+","+(e.cy+2)+")")}x(a,"smile");function s(l){const u=Xh().startAngle(3*Math.PI/2).endAngle(5*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);l.append("path").attr("class","mouth").attr("d",u).attr("transform","translate("+e.cx+","+(e.cy+7)+")")}x(s,"sad");function o(l){l.append("line").attr("class","mouth").attr("stroke",2).attr("x1",e.cx-5).attr("y1",e.cy+7).attr("x2",e.cx+5).attr("y2",e.cy+7).attr("class","mouth").attr("stroke-width","1px").attr("stroke","#666")}return x(o,"ambivalent"),e.score>3?a(i):e.score<3?s(i):o(i),n},"drawFace"),zH=x(function(t,e){const r=t.append("circle");return r.attr("cx",e.cx),r.attr("cy",e.cy),r.attr("class","actor-"+e.pos),r.attr("fill",e.fill),r.attr("stroke",e.stroke),r.attr("r",e.r),r.class!==void 0&&r.attr("class",r.class),e.title!==void 0&&r.append("title").text(e.title),r},"drawCircle"),VH=x(function(t,e){return Jbe(t,e)},"drawText"),_Ae=x(function(t,e){function r(i,a,s,o,l){return i+","+a+" "+(i+s)+","+a+" "+(i+s)+","+(a+o-l)+" "+(i+s-l*1.2)+","+(a+o)+" "+i+","+(a+o)}x(r,"genPoints");const n=t.append("polygon");n.attr("points",r(e.x,e.y,50,20,7)),n.attr("class","labelBox"),e.y=e.y+e.labelMargin,e.x=e.x+.5*e.labelMargin,VH(t,e)},"drawLabel"),LAe=x(function(t,e,r){const n=t.append("g"),i=Da();i.x=e.x,i.y=e.y,i.fill=e.fill,i.width=r.width*e.taskCount+r.diagramMarginX*(e.taskCount-1),i.height=r.height,i.class="journey-section section-type-"+e.num,i.rx=3,i.ry=3,dS(n,i),GH(r)(e.text,n,i.x,i.y,i.width,i.height,{class:"journey-section section-type-"+e.num},r,e.colour)},"drawSection"),IR=-1,RAe=x(function(t,e,r){const n=e.x+r.width/2,i=t.append("g");IR++;const a=300+5*30;i.append("line").attr("id","task"+IR).attr("x1",n).attr("y1",e.y).attr("x2",n).attr("y2",a).attr("class","task-line").attr("stroke-width","1px").attr("stroke-dasharray","4 2").attr("stroke","#666"),AAe(i,{cx:n,cy:300+(5-e.score)*30,score:e.score});const s=Da();s.x=e.x,s.y=e.y,s.fill=e.fill,s.width=r.width,s.height=r.height,s.class="task task-type-"+e.num,s.rx=3,s.ry=3,dS(i,s);let o=e.x+14;e.people.forEach(l=>{const u=e.actors[l].color,h={cx:o,cy:e.y,r:7,fill:u,stroke:"#000",title:l,pos:e.actors[l].position};zH(i,h),o+=10}),GH(r)(e.task,i,s.x,s.y,s.width,s.height,{class:"task"},r,e.colour)},"drawTask"),NAe=x(function(t,e){rG(t,e)},"drawBackgroundRect"),GH=function(){function t(i,a,s,o,l,u,h,d){const f=a.append("text").attr("x",s+l/2).attr("y",o+u/2+5).style("font-color",d).style("text-anchor","middle").text(i);n(f,h)}x(t,"byText");function e(i,a,s,o,l,u,h,d,f){const{taskFontSize:p,taskFontFamily:g}=d,m=i.split(/<br\s*\/?>/gi);for(let v=0;v<m.length;v++){const y=v*p-p*(m.length-1)/2,b=a.append("text").attr("x",s+l/2).attr("y",o).attr("fill",f).style("text-anchor","middle").style("font-size",p).style("font-family",g);b.append("tspan").attr("x",s+l/2).attr("dy",y).text(m[v]),b.attr("y",o+u/2).attr("dominant-baseline","central").attr("alignment-baseline","central"),n(b,h)}}x(e,"byTspan");function r(i,a,s,o,l,u,h,d){const f=a.append("switch"),g=f.append("foreignObject").attr("x",s).attr("y",o).attr("width",l).attr("height",u).attr("position","fixed").append("xhtml:div").style("display","table").style("height","100%").style("width","100%");g.append("div").attr("class","label").style("display","table-cell").style("text-align","center").style("vertical-align","middle").text(i),e(i,f,s,o,l,u,h,d),n(g,h)}x(r,"byFo");function n(i,a){for(const s in a)s in a&&i.attr(s,a[s])}return x(n,"_setTextAttrs"),function(i){return i.textPlacement==="fo"?r:i.textPlacement==="old"?t:e}}(),DAe=x(function(t){t.append("defs").append("marker").attr("id","arrowhead").attr("refX",5).attr("refY",2).attr("markerWidth",6).attr("markerHeight",4).attr("orient","auto").append("path").attr("d","M 0,0 V 4 L6,2 Z")},"initGraphics"),kp={drawRect:dS,drawCircle:zH,drawSection:LAe,drawText:VH,drawLabel:_Ae,drawTask:RAe,drawBackgroundRect:NAe,initGraphics:DAe},MAe=x(function(t){Object.keys(t).forEach(function(r){ss[r]=t[r]})},"setConf"),Oo={},Rm=0;function UH(t){const e=we().journey,r=e.maxLabelWidth;Rm=0;let n=60;Object.keys(Oo).forEach(i=>{const a=Oo[i].color,s={cx:20,cy:n,r:7,fill:a,stroke:"#000",pos:Oo[i].position};kp.drawCircle(t,s);let o=t.append("text").attr("visibility","hidden").text(i);const l=o.node().getBoundingClientRect().width;o.remove();let u=[];if(l<=r)u=[i];else{const h=i.split(" ");let d="";o=t.append("text").attr("visibility","hidden"),h.forEach(f=>{const p=d?`${d} ${f}`:f;if(o.text(p),o.node().getBoundingClientRect().width>r){if(d&&u.push(d),d=f,o.text(f),o.node().getBoundingClientRect().width>r){let m="";for(const v of f)m+=v,o.text(m+"-"),o.node().getBoundingClientRect().width>r&&(u.push(m.slice(0,-1)+"-"),m=v);d=m}}else d=p}),d&&u.push(d),o.remove()}u.forEach((h,d)=>{const f={x:40,y:n+7+d*20,fill:"#666",text:h,textMargin:e.boxTextMargin??5},g=kp.drawText(t,f).node().getBoundingClientRect().width;g>Rm&&g>e.leftMargin-g&&(Rm=g)}),n+=Math.max(20,u.length*20)})}x(UH,"drawActorLegend");var ss=we().journey,ml=0,IAe=x(function(t,e,r,n){const i=we(),a=i.journey.titleColor,s=i.journey.titleFontSize,o=i.journey.titleFontFamily,l=i.securityLevel;let u;l==="sandbox"&&(u=Qe("#i"+e));const h=Qe(l==="sandbox"?u.nodes()[0].contentDocument.body:"body");za.init();const d=h.select("#"+e);kp.initGraphics(d);const f=n.db.getTasks(),p=n.db.getDiagramTitle(),g=n.db.getActors();for(const T in Oo)delete Oo[T];let m=0;g.forEach(T=>{Oo[T]={color:ss.actorColours[m%ss.actorColours.length],position:m},m++}),UH(d),ml=ss.leftMargin+Rm,za.insert(0,0,ml,Object.keys(Oo).length*50),OAe(d,f,0);const v=za.getBounds();p&&d.append("text").text(p).attr("x",ml).attr("font-size",s).attr("font-weight","bold").attr("y",25).attr("fill",a).attr("font-family",o);const y=v.stopy-v.starty+2*ss.diagramMarginY,b=ml+v.stopx+2*ss.diagramMarginX;ji(d,y,b,ss.useMaxWidth),d.append("line").attr("x1",ml).attr("y1",ss.height*4).attr("x2",b-ml-4).attr("y2",ss.height*4).attr("stroke-width",4).attr("stroke","black").attr("marker-end","url(#arrowhead)");const w=p?70:0;d.attr("viewBox",`${v.startx} -25 ${b} ${y+w}`),d.attr("preserveAspectRatio","xMinYMin meet"),d.attr("height",y+w+25)},"draw"),za={data:{startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},verticalPos:0,sequenceItems:[],init:x(function(){this.sequenceItems=[],this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},this.verticalPos=0},"init"),updateVal:x(function(t,e,r,n){t[e]===void 0?t[e]=r:t[e]=n(r,t[e])},"updateVal"),updateBounds:x(function(t,e,r,n){const i=we().journey,a=this;let s=0;function o(l){return x(function(h){s++;const d=a.sequenceItems.length-s+1;a.updateVal(h,"starty",e-d*i.boxMargin,Math.min),a.updateVal(h,"stopy",n+d*i.boxMargin,Math.max),a.updateVal(za.data,"startx",t-d*i.boxMargin,Math.min),a.updateVal(za.data,"stopx",r+d*i.boxMargin,Math.max),l!=="activation"&&(a.updateVal(h,"startx",t-d*i.boxMargin,Math.min),a.updateVal(h,"stopx",r+d*i.boxMargin,Math.max),a.updateVal(za.data,"starty",e-d*i.boxMargin,Math.min),a.updateVal(za.data,"stopy",n+d*i.boxMargin,Math.max))},"updateItemBounds")}x(o,"updateFn"),this.sequenceItems.forEach(o())},"updateBounds"),insert:x(function(t,e,r,n){const i=Math.min(t,r),a=Math.max(t,r),s=Math.min(e,n),o=Math.max(e,n);this.updateVal(za.data,"startx",i,Math.min),this.updateVal(za.data,"starty",s,Math.min),this.updateVal(za.data,"stopx",a,Math.max),this.updateVal(za.data,"stopy",o,Math.max),this.updateBounds(i,s,a,o)},"insert"),bumpVerticalPos:x(function(t){this.verticalPos=this.verticalPos+t,this.data.stopy=this.verticalPos},"bumpVerticalPos"),getVerticalPos:x(function(){return this.verticalPos},"getVerticalPos"),getBounds:x(function(){return this.data},"getBounds")},M3=ss.sectionFills,OR=ss.sectionColours,OAe=x(function(t,e,r){const n=we().journey;let i="";const a=n.height*2+n.diagramMarginY,s=r+a;let o=0,l="#CCC",u="black",h=0;for(const[d,f]of e.entries()){if(i!==f.section){l=M3[o%M3.length],h=o%M3.length,u=OR[o%OR.length];let g=0;const m=f.section;for(let y=d;y<e.length&&e[y].section==m;y++)g=g+1;const v={x:d*n.taskMargin+d*n.width+ml,y:50,text:f.section,fill:l,num:h,colour:u,taskCount:g};kp.drawSection(t,v,n),i=f.section,o++}const p=f.people.reduce((g,m)=>(Oo[m]&&(g[m]=Oo[m]),g),{});f.x=d*n.taskMargin+d*n.width+ml,f.y=s,f.width=n.diagramMarginX,f.height=n.diagramMarginY,f.colour=u,f.fill=l,f.num=h,f.actors=p,kp.drawTask(t,f,n),za.insert(f.x,f.y,f.x+f.width+n.taskMargin,300+5*30)}},"drawTasks"),PR={setConf:MAe,draw:IAe},PAe={parser:mAe,db:MR,renderer:PR,styles:CAe,init:x(t=>{PR.setConf(t.journey),MR.clear()},"init")};const BAe=Object.freeze(Object.defineProperty({__proto__:null,diagram:PAe},Symbol.toStringTag,{value:"Module"}));var DT=function(){var t=x(function(f,p,g,m){for(g=g||{},m=f.length;m--;g[f[m]]=p);return g},"o"),e=[6,8,10,11,12,14,16,17,20,21],r=[1,9],n=[1,10],i=[1,11],a=[1,12],s=[1,13],o=[1,16],l=[1,17],u={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,start:3,timeline:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,title:11,acc_title:12,acc_title_value:13,acc_descr:14,acc_descr_value:15,acc_descr_multiline_value:16,section:17,period_statement:18,event_statement:19,period:20,event:21,$accept:0,$end:1},terminals_:{2:"error",4:"timeline",6:"EOF",8:"SPACE",10:"NEWLINE",11:"title",12:"acc_title",13:"acc_title_value",14:"acc_descr",15:"acc_descr_value",16:"acc_descr_multiline_value",17:"section",20:"period",21:"event"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,1],[9,1],[18,1],[19,1]],performAction:x(function(p,g,m,v,y,b,w){var T=b.length-1;switch(y){case 1:return b[T-1];case 2:this.$=[];break;case 3:b[T-1].push(b[T]),this.$=b[T-1];break;case 4:case 5:this.$=b[T];break;case 6:case 7:this.$=[];break;case 8:v.getCommonDb().setDiagramTitle(b[T].substr(6)),this.$=b[T].substr(6);break;case 9:this.$=b[T].trim(),v.getCommonDb().setAccTitle(this.$);break;case 10:case 11:this.$=b[T].trim(),v.getCommonDb().setAccDescription(this.$);break;case 12:v.addSection(b[T].substr(8)),this.$=b[T].substr(8);break;case 15:v.addTask(b[T],0,""),this.$=b[T];break;case 16:v.addEvent(b[T].substr(2)),this.$=b[T];break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:r,12:n,14:i,16:a,17:s,18:14,19:15,20:o,21:l},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:18,11:r,12:n,14:i,16:a,17:s,18:14,19:15,20:o,21:l},t(e,[2,5]),t(e,[2,6]),t(e,[2,8]),{13:[1,19]},{15:[1,20]},t(e,[2,11]),t(e,[2,12]),t(e,[2,13]),t(e,[2,14]),t(e,[2,15]),t(e,[2,16]),t(e,[2,4]),t(e,[2,9]),t(e,[2,10])],defaultActions:{},parseError:x(function(p,g){if(g.recoverable)this.trace(p);else{var m=new Error(p);throw m.hash=g,m}},"parseError"),parse:x(function(p){var g=this,m=[0],v=[],y=[null],b=[],w=this.table,T="",E=0,L=0,S=2,C=1,A=b.slice.call(arguments,1),N=Object.create(this.lexer),_={yy:{}};for(var O in this.yy)Object.prototype.hasOwnProperty.call(this.yy,O)&&(_.yy[O]=this.yy[O]);N.setInput(p,_.yy),_.yy.lexer=N,_.yy.parser=this,typeof N.yylloc>"u"&&(N.yylloc={});var P=N.yylloc;b.push(P);var k=N.options&&N.options.ranges;typeof _.yy.parseError=="function"?this.parseError=_.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function R(ae){m.length=m.length-2*ae,y.length=y.length-ae,b.length=b.length-ae}x(R,"popStack");function I(){var ae;return ae=v.pop()||N.lex()||C,typeof ae!="number"&&(ae instanceof Array&&(v=ae,ae=v.pop()),ae=g.symbols_[ae]||ae),ae}x(I,"lex");for(var M,D,B,$,F={},G,W,J,q;;){if(D=m[m.length-1],this.defaultActions[D]?B=this.defaultActions[D]:((M===null||typeof M>"u")&&(M=I()),B=w[D]&&w[D][M]),typeof B>"u"||!B.length||!B[0]){var ne="";q=[];for(G in w[D])this.terminals_[G]&&G>S&&q.push("'"+this.terminals_[G]+"'");N.showPosition?ne="Parse error on line "+(E+1)+`:
`+N.showPosition()+`
Expecting `+q.join(", ")+", got '"+(this.terminals_[M]||M)+"'":ne="Parse error on line "+(E+1)+": Unexpected "+(M==C?"end of input":"'"+(this.terminals_[M]||M)+"'"),this.parseError(ne,{text:N.match,token:this.terminals_[M]||M,line:N.yylineno,loc:P,expected:q})}if(B[0]instanceof Array&&B.length>1)throw new Error("Parse Error: multiple actions possible at state: "+D+", token: "+M);switch(B[0]){case 1:m.push(M),y.push(N.yytext),b.push(N.yylloc),m.push(B[1]),M=null,L=N.yyleng,T=N.yytext,E=N.yylineno,P=N.yylloc;break;case 2:if(W=this.productions_[B[1]][1],F.$=y[y.length-W],F._$={first_line:b[b.length-(W||1)].first_line,last_line:b[b.length-1].last_line,first_column:b[b.length-(W||1)].first_column,last_column:b[b.length-1].last_column},k&&(F._$.range=[b[b.length-(W||1)].range[0],b[b.length-1].range[1]]),$=this.performAction.apply(F,[T,L,E,_.yy,B[1],y,b].concat(A)),typeof $<"u")return $;W&&(m=m.slice(0,-1*W*2),y=y.slice(0,-1*W),b=b.slice(0,-1*W)),m.push(this.productions_[B[1]][0]),y.push(F.$),b.push(F._$),J=w[m[m.length-2]][m[m.length-1]],m.push(J);break;case 3:return!0}}return!0},"parse")},h=function(){var f={EOF:1,parseError:x(function(g,m){if(this.yy.parser)this.yy.parser.parseError(g,m);else throw new Error(g)},"parseError"),setInput:x(function(p,g){return this.yy=g||this.yy||{},this._input=p,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:x(function(){var p=this._input[0];this.yytext+=p,this.yyleng++,this.offset++,this.match+=p,this.matched+=p;var g=p.match(/(?:\r\n?|\n).*/g);return g?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),p},"input"),unput:x(function(p){var g=p.length,m=p.split(/(?:\r\n?|\n)/g);this._input=p+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-g),this.offset-=g;var v=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),m.length-1&&(this.yylineno-=m.length-1);var y=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:m?(m.length===v.length?this.yylloc.first_column:0)+v[v.length-m.length].length-m[0].length:this.yylloc.first_column-g},this.options.ranges&&(this.yylloc.range=[y[0],y[0]+this.yyleng-g]),this.yyleng=this.yytext.length,this},"unput"),more:x(function(){return this._more=!0,this},"more"),reject:x(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:x(function(p){this.unput(this.match.slice(p))},"less"),pastInput:x(function(){var p=this.matched.substr(0,this.matched.length-this.match.length);return(p.length>20?"...":"")+p.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:x(function(){var p=this.match;return p.length<20&&(p+=this._input.substr(0,20-p.length)),(p.substr(0,20)+(p.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:x(function(){var p=this.pastInput(),g=new Array(p.length+1).join("-");return p+this.upcomingInput()+`
`+g+"^"},"showPosition"),test_match:x(function(p,g){var m,v,y;if(this.options.backtrack_lexer&&(y={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(y.yylloc.range=this.yylloc.range.slice(0))),v=p[0].match(/(?:\r\n?|\n).*/g),v&&(this.yylineno+=v.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:v?v[v.length-1].length-v[v.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+p[0].length},this.yytext+=p[0],this.match+=p[0],this.matches=p,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(p[0].length),this.matched+=p[0],m=this.performAction.call(this,this.yy,this,g,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),m)return m;if(this._backtrack){for(var b in y)this[b]=y[b];return!1}return!1},"test_match"),next:x(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var p,g,m,v;this._more||(this.yytext="",this.match="");for(var y=this._currentRules(),b=0;b<y.length;b++)if(m=this._input.match(this.rules[y[b]]),m&&(!g||m[0].length>g[0].length)){if(g=m,v=b,this.options.backtrack_lexer){if(p=this.test_match(m,y[b]),p!==!1)return p;if(this._backtrack){g=!1;continue}else return!1}else if(!this.options.flex)break}return g?(p=this.test_match(g,y[v]),p!==!1?p:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var g=this.next();return g||this.lex()},"lex"),begin:x(function(g){this.conditionStack.push(g)},"begin"),popState:x(function(){var g=this.conditionStack.length-1;return g>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(g){return g=this.conditionStack.length-1-Math.abs(g||0),g>=0?this.conditionStack[g]:"INITIAL"},"topState"),pushState:x(function(g){this.begin(g)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:x(function(g,m,v,y){switch(v){case 0:break;case 1:break;case 2:return 10;case 3:break;case 4:break;case 5:return 4;case 6:return 11;case 7:return this.begin("acc_title"),12;case 8:return this.popState(),"acc_title_value";case 9:return this.begin("acc_descr"),14;case 10:return this.popState(),"acc_descr_value";case 11:this.begin("acc_descr_multiline");break;case 12:this.popState();break;case 13:return"acc_descr_multiline_value";case 14:return 17;case 15:return 21;case 16:return 20;case 17:return 6;case 18:return"INVALID"}},"anonymous"),rules:[/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:timeline\b)/i,/^(?:title\s[^\n]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:section\s[^:\n]+)/i,/^(?::\s(?:[^:\n]|:(?!\s))+)/i,/^(?:[^#:\n]+)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[12,13],inclusive:!1},acc_descr:{rules:[10],inclusive:!1},acc_title:{rules:[8],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,9,11,14,15,16,17,18],inclusive:!0}}};return f}();u.lexer=h;function d(){this.yy={}}return x(d,"Parser"),d.prototype=u,u.Parser=d,new d}();DT.parser=DT;var FAe=DT,WH={};Dy(WH,{addEvent:()=>QH,addSection:()=>XH,addTask:()=>ZH,addTaskOrg:()=>JH,clear:()=>YH,default:()=>$Ae,getCommonDb:()=>qH,getSections:()=>jH,getTasks:()=>KH});var md="",HH=0,fS=[],Cy=[],vd=[],qH=x(()=>KT,"getCommonDb"),YH=x(function(){fS.length=0,Cy.length=0,md="",vd.length=0,An()},"clear"),XH=x(function(t){md=t,fS.push(t)},"addSection"),jH=x(function(){return fS},"getSections"),KH=x(function(){let t=BR();const e=100;let r=0;for(;!t&&r<e;)t=BR(),r++;return Cy.push(...vd),Cy},"getTasks"),ZH=x(function(t,e,r){const n={id:HH++,section:md,type:md,task:t,score:e||0,events:r?[r]:[]};vd.push(n)},"addTask"),QH=x(function(t){vd.find(r=>r.id===HH-1).events.push(t)},"addEvent"),JH=x(function(t){const e={section:md,type:md,description:t,task:t,classes:[]};Cy.push(e)},"addTaskOrg"),BR=x(function(){const t=x(function(r){return vd[r].processed},"compileTask");let e=!0;for(const[r,n]of vd.entries())t(r),e=e&&n.processed;return e},"compileTasks"),$Ae={clear:YH,getCommonDb:qH,addSection:XH,getSections:jH,getTasks:KH,addTask:ZH,addTaskOrg:JH,addEvent:QH},zAe=12,gx=x(function(t,e){const r=t.append("rect");return r.attr("x",e.x),r.attr("y",e.y),r.attr("fill",e.fill),r.attr("stroke",e.stroke),r.attr("width",e.width),r.attr("height",e.height),r.attr("rx",e.rx),r.attr("ry",e.ry),e.class!==void 0&&r.attr("class",e.class),r},"drawRect"),VAe=x(function(t,e){const n=t.append("circle").attr("cx",e.cx).attr("cy",e.cy).attr("class","face").attr("r",15).attr("stroke-width",2).attr("overflow","visible"),i=t.append("g");i.append("circle").attr("cx",e.cx-15/3).attr("cy",e.cy-15/3).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),i.append("circle").attr("cx",e.cx+15/3).attr("cy",e.cy-15/3).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666");function a(l){const u=Xh().startAngle(Math.PI/2).endAngle(3*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);l.append("path").attr("class","mouth").attr("d",u).attr("transform","translate("+e.cx+","+(e.cy+2)+")")}x(a,"smile");function s(l){const u=Xh().startAngle(3*Math.PI/2).endAngle(5*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);l.append("path").attr("class","mouth").attr("d",u).attr("transform","translate("+e.cx+","+(e.cy+7)+")")}x(s,"sad");function o(l){l.append("line").attr("class","mouth").attr("stroke",2).attr("x1",e.cx-5).attr("y1",e.cy+7).attr("x2",e.cx+5).attr("y2",e.cy+7).attr("class","mouth").attr("stroke-width","1px").attr("stroke","#666")}return x(o,"ambivalent"),e.score>3?a(i):e.score<3?s(i):o(i),n},"drawFace"),GAe=x(function(t,e){const r=t.append("circle");return r.attr("cx",e.cx),r.attr("cy",e.cy),r.attr("class","actor-"+e.pos),r.attr("fill",e.fill),r.attr("stroke",e.stroke),r.attr("r",e.r),r.class!==void 0&&r.attr("class",r.class),e.title!==void 0&&r.append("title").text(e.title),r},"drawCircle"),eq=x(function(t,e){const r=e.text.replace(/<br\s*\/?>/gi," "),n=t.append("text");n.attr("x",e.x),n.attr("y",e.y),n.attr("class","legend"),n.style("text-anchor",e.anchor),e.class!==void 0&&n.attr("class",e.class);const i=n.append("tspan");return i.attr("x",e.x+e.textMargin*2),i.text(r),n},"drawText"),UAe=x(function(t,e){function r(i,a,s,o,l){return i+","+a+" "+(i+s)+","+a+" "+(i+s)+","+(a+o-l)+" "+(i+s-l*1.2)+","+(a+o)+" "+i+","+(a+o)}x(r,"genPoints");const n=t.append("polygon");n.attr("points",r(e.x,e.y,50,20,7)),n.attr("class","labelBox"),e.y=e.y+e.labelMargin,e.x=e.x+.5*e.labelMargin,eq(t,e)},"drawLabel"),WAe=x(function(t,e,r){const n=t.append("g"),i=pS();i.x=e.x,i.y=e.y,i.fill=e.fill,i.width=r.width,i.height=r.height,i.class="journey-section section-type-"+e.num,i.rx=3,i.ry=3,gx(n,i),tq(r)(e.text,n,i.x,i.y,i.width,i.height,{class:"journey-section section-type-"+e.num},r,e.colour)},"drawSection"),FR=-1,HAe=x(function(t,e,r){const n=e.x+r.width/2,i=t.append("g");FR++;const a=300+5*30;i.append("line").attr("id","task"+FR).attr("x1",n).attr("y1",e.y).attr("x2",n).attr("y2",a).attr("class","task-line").attr("stroke-width","1px").attr("stroke-dasharray","4 2").attr("stroke","#666"),VAe(i,{cx:n,cy:300+(5-e.score)*30,score:e.score});const s=pS();s.x=e.x,s.y=e.y,s.fill=e.fill,s.width=r.width,s.height=r.height,s.class="task task-type-"+e.num,s.rx=3,s.ry=3,gx(i,s),tq(r)(e.task,i,s.x,s.y,s.width,s.height,{class:"task"},r,e.colour)},"drawTask"),qAe=x(function(t,e){gx(t,{x:e.startx,y:e.starty,width:e.stopx-e.startx,height:e.stopy-e.starty,fill:e.fill,class:"rect"}).lower()},"drawBackgroundRect"),YAe=x(function(){return{x:0,y:0,fill:void 0,"text-anchor":"start",width:100,height:100,textMargin:0,rx:0,ry:0}},"getTextObj"),pS=x(function(){return{x:0,y:0,width:100,anchor:"start",height:100,rx:0,ry:0}},"getNoteRect"),tq=function(){function t(i,a,s,o,l,u,h,d){const f=a.append("text").attr("x",s+l/2).attr("y",o+u/2+5).style("font-color",d).style("text-anchor","middle").text(i);n(f,h)}x(t,"byText");function e(i,a,s,o,l,u,h,d,f){const{taskFontSize:p,taskFontFamily:g}=d,m=i.split(/<br\s*\/?>/gi);for(let v=0;v<m.length;v++){const y=v*p-p*(m.length-1)/2,b=a.append("text").attr("x",s+l/2).attr("y",o).attr("fill",f).style("text-anchor","middle").style("font-size",p).style("font-family",g);b.append("tspan").attr("x",s+l/2).attr("dy",y).text(m[v]),b.attr("y",o+u/2).attr("dominant-baseline","central").attr("alignment-baseline","central"),n(b,h)}}x(e,"byTspan");function r(i,a,s,o,l,u,h,d){const f=a.append("switch"),g=f.append("foreignObject").attr("x",s).attr("y",o).attr("width",l).attr("height",u).attr("position","fixed").append("xhtml:div").style("display","table").style("height","100%").style("width","100%");g.append("div").attr("class","label").style("display","table-cell").style("text-align","center").style("vertical-align","middle").text(i),e(i,f,s,o,l,u,h,d),n(g,h)}x(r,"byFo");function n(i,a){for(const s in a)s in a&&i.attr(s,a[s])}return x(n,"_setTextAttrs"),function(i){return i.textPlacement==="fo"?r:i.textPlacement==="old"?t:e}}(),XAe=x(function(t){t.append("defs").append("marker").attr("id","arrowhead").attr("refX",5).attr("refY",2).attr("markerWidth",6).attr("markerHeight",4).attr("orient","auto").append("path").attr("d","M 0,0 V 4 L6,2 Z")},"initGraphics");function gS(t,e){t.each(function(){var r=Qe(this),n=r.text().split(/(\s+|<br>)/).reverse(),i,a=[],s=1.1,o=r.attr("y"),l=parseFloat(r.attr("dy")),u=r.text(null).append("tspan").attr("x",0).attr("y",o).attr("dy",l+"em");for(let h=0;h<n.length;h++)i=n[n.length-1-h],a.push(i),u.text(a.join(" ").trim()),(u.node().getComputedTextLength()>e||i==="<br>")&&(a.pop(),u.text(a.join(" ").trim()),i==="<br>"?a=[""]:a=[i],u=r.append("tspan").attr("x",0).attr("y",o).attr("dy",s+"em").text(i))})}x(gS,"wrap");var jAe=x(function(t,e,r,n){const i=r%zAe-1,a=t.append("g");e.section=i,a.attr("class",(e.class?e.class+" ":"")+"timeline-node "+("section-"+i));const s=a.append("g"),o=a.append("g"),u=o.append("text").text(e.descr).attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle").call(gS,e.width).node().getBBox(),h=n.fontSize?.replace?n.fontSize.replace("px",""):n.fontSize;return e.height=u.height+h*1.1*.5+e.padding,e.height=Math.max(e.height,e.maxHeight),e.width=e.width+2*e.padding,o.attr("transform","translate("+e.width/2+", "+e.padding/2+")"),ZAe(s,e,i,n),e},"drawNode"),KAe=x(function(t,e,r){const n=t.append("g"),a=n.append("text").text(e.descr).attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle").call(gS,e.width).node().getBBox(),s=r.fontSize?.replace?r.fontSize.replace("px",""):r.fontSize;return n.remove(),a.height+s*1.1*.5+e.padding},"getVirtualNodeHeight"),ZAe=x(function(t,e,r){t.append("path").attr("id","node-"+e.id).attr("class","node-bkg node-"+e.type).attr("d",`M0 ${e.height-5} v${-e.height+2*5} q0,-5 5,-5 h${e.width-2*5} q5,0 5,5 v${e.height-5} H0 Z`),t.append("line").attr("class","node-line-"+r).attr("x1",0).attr("y1",e.height).attr("x2",e.width).attr("y2",e.height)},"defaultBkg"),zc={drawRect:gx,drawCircle:GAe,drawSection:WAe,drawText:eq,drawLabel:UAe,drawTask:HAe,drawBackgroundRect:qAe,getTextObj:YAe,getNoteRect:pS,initGraphics:XAe,drawNode:jAe,getVirtualNodeHeight:KAe},QAe=x(function(t,e,r,n){const i=we(),a=i.timeline?.leftMargin??50;ie.debug("timeline",n.db);const s=i.securityLevel;let o;s==="sandbox"&&(o=Qe("#i"+e));const u=Qe(s==="sandbox"?o.nodes()[0].contentDocument.body:"body").select("#"+e);u.append("g");const h=n.db.getTasks(),d=n.db.getCommonDb().getDiagramTitle();ie.debug("task",h),zc.initGraphics(u);const f=n.db.getSections();ie.debug("sections",f);let p=0,g=0,m=0,v=0,y=50+a,b=50;v=50;let w=0,T=!0;f.forEach(function(A){const N={number:w,descr:A,section:w,width:150,padding:20,maxHeight:p},_=zc.getVirtualNodeHeight(u,N,i);ie.debug("sectionHeight before draw",_),p=Math.max(p,_+20)});let E=0,L=0;ie.debug("tasks.length",h.length);for(const[A,N]of h.entries()){const _={number:A,descr:N,section:N.section,width:150,padding:20,maxHeight:g},O=zc.getVirtualNodeHeight(u,_,i);ie.debug("taskHeight before draw",O),g=Math.max(g,O+20),E=Math.max(E,N.events.length);let P=0;for(const k of N.events){const R={descr:k,section:N.section,number:N.section,width:150,padding:20,maxHeight:50};P+=zc.getVirtualNodeHeight(u,R,i)}N.events.length>0&&(P+=(N.events.length-1)*10),L=Math.max(L,P)}ie.debug("maxSectionHeight before draw",p),ie.debug("maxTaskHeight before draw",g),f&&f.length>0?f.forEach(A=>{const N=h.filter(k=>k.section===A),_={number:w,descr:A,section:w,width:200*Math.max(N.length,1)-50,padding:20,maxHeight:p};ie.debug("sectionNode",_);const O=u.append("g"),P=zc.drawNode(O,_,w,i);ie.debug("sectionNode output",P),O.attr("transform",`translate(${y}, ${v})`),b+=p+50,N.length>0&&$R(u,N,w,y,b,g,i,E,L,p,!1),y+=200*Math.max(N.length,1),b=v,w++}):(T=!1,$R(u,h,w,y,b,g,i,E,L,p,!0));const S=u.node().getBBox();ie.debug("bounds",S),d&&u.append("text").text(d).attr("x",S.width/2-a).attr("font-size","4ex").attr("font-weight","bold").attr("y",20),m=T?p+g+150:g+100,u.append("g").attr("class","lineWrapper").append("line").attr("x1",a).attr("y1",m).attr("x2",S.width+3*a).attr("y2",m).attr("stroke-width",4).attr("stroke","black").attr("marker-end","url(#arrowhead)"),_p(void 0,u,i.timeline?.padding??50,i.timeline?.useMaxWidth??!1)},"draw"),$R=x(function(t,e,r,n,i,a,s,o,l,u,h){for(const d of e){const f={descr:d.task,section:r,number:r,width:150,padding:20,maxHeight:a};ie.debug("taskNode",f);const p=t.append("g").attr("class","taskWrapper"),m=zc.drawNode(p,f,r,s).height;if(ie.debug("taskHeight after draw",m),p.attr("transform",`translate(${n}, ${i})`),a=Math.max(a,m),d.events){const v=t.append("g").attr("class","lineWrapper");let y=a;i+=100,y=y+JAe(t,d.events,r,n,i,s),i-=100,v.append("line").attr("x1",n+190/2).attr("y1",i+a).attr("x2",n+190/2).attr("y2",i+a+100+l+100).attr("stroke-width",2).attr("stroke","black").attr("marker-end","url(#arrowhead)").attr("stroke-dasharray","5,5")}n=n+200,h&&!s.timeline?.disableMulticolor&&r++}i=i-10},"drawTasks"),JAe=x(function(t,e,r,n,i,a){let s=0;const o=i;i=i+100;for(const l of e){const u={descr:l,section:r,number:r,width:150,padding:20,maxHeight:50};ie.debug("eventNode",u);const h=t.append("g").attr("class","eventWrapper"),f=zc.drawNode(h,u,r,a).height;s=s+f,h.attr("transform",`translate(${n}, ${i})`),i=i+10+f}return i=o,s},"drawEvents"),e_e={setConf:x(()=>{},"setConf"),draw:QAe},t_e=x(t=>{let e="";for(let r=0;r<t.THEME_COLOR_LIMIT;r++)t["lineColor"+r]=t["lineColor"+r]||t["cScaleInv"+r],ec(t["lineColor"+r])?t["lineColor"+r]=_t(t["lineColor"+r],20):t["lineColor"+r]=It(t["lineColor"+r],20);for(let r=0;r<t.THEME_COLOR_LIMIT;r++){const n=""+(17-3*r);e+=`
    .section-${r-1} rect, .section-${r-1} path, .section-${r-1} circle, .section-${r-1} path  {
      fill: ${t["cScale"+r]};
    }
    .section-${r-1} text {
     fill: ${t["cScaleLabel"+r]};
    }
    .node-icon-${r-1} {
      font-size: 40px;
      color: ${t["cScaleLabel"+r]};
    }
    .section-edge-${r-1}{
      stroke: ${t["cScale"+r]};
    }
    .edge-depth-${r-1}{
      stroke-width: ${n};
    }
    .section-${r-1} line {
      stroke: ${t["cScaleInv"+r]} ;
      stroke-width: 3;
    }

    .lineWrapper line{
      stroke: ${t["cScaleLabel"+r]} ;
    }

    .disabled, .disabled circle, .disabled text {
      fill: lightgray;
    }
    .disabled text {
      fill: #efefef;
    }
    `}return e},"genSections"),r_e=x(t=>`
  .edge {
    stroke-width: 3;
  }
  ${t_e(t)}
  .section-root rect, .section-root path, .section-root circle  {
    fill: ${t.git0};
  }
  .section-root text {
    fill: ${t.gitBranchLabel0};
  }
  .icon-container {
    height:100%;
    display: flex;
    justify-content: center;
    align-items: center;
  }
  .edge {
    fill: none;
  }
  .eventWrapper  {
   filter: brightness(120%);
  }
`,"getStyles"),n_e=r_e,i_e={db:WH,renderer:e_e,parser:FAe,styles:n_e};const a_e=Object.freeze(Object.defineProperty({__proto__:null,diagram:i_e},Symbol.toStringTag,{value:"Module"})),ri=[];for(let t=0;t<256;++t)ri.push((t+256).toString(16).slice(1));function s_e(t,e=0){return(ri[t[e+0]]+ri[t[e+1]]+ri[t[e+2]]+ri[t[e+3]]+"-"+ri[t[e+4]]+ri[t[e+5]]+"-"+ri[t[e+6]]+ri[t[e+7]]+"-"+ri[t[e+8]]+ri[t[e+9]]+"-"+ri[t[e+10]]+ri[t[e+11]]+ri[t[e+12]]+ri[t[e+13]]+ri[t[e+14]]+ri[t[e+15]]).toLowerCase()}let I3;const o_e=new Uint8Array(16);function l_e(){if(!I3){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");I3=crypto.getRandomValues.bind(crypto)}return I3(o_e)}const c_e=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),zR={randomUUID:c_e};function u_e(t,e,r){if(zR.randomUUID&&!t)return zR.randomUUID();t=t||{};const n=t.random??t.rng?.()??l_e();if(n.length<16)throw new Error("Random bytes length must be >= 16");return n[6]=n[6]&15|64,n[8]=n[8]&63|128,s_e(n)}var MT=function(){var t=x(function(T,E,L,S){for(L=L||{},S=T.length;S--;L[T[S]]=E);return L},"o"),e=[1,4],r=[1,13],n=[1,12],i=[1,15],a=[1,16],s=[1,20],o=[1,19],l=[6,7,8],u=[1,26],h=[1,24],d=[1,25],f=[6,7,11],p=[1,6,13,15,16,19,22],g=[1,33],m=[1,34],v=[1,6,7,11,13,15,16,19,22],y={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,MINDMAP:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,ICON:15,CLASS:16,nodeWithId:17,nodeWithoutId:18,NODE_DSTART:19,NODE_DESCR:20,NODE_DEND:21,NODE_ID:22,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"MINDMAP",11:"EOF",13:"SPACELIST",15:"ICON",16:"CLASS",19:"NODE_DSTART",20:"NODE_DESCR",21:"NODE_DEND",22:"NODE_ID"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[18,3],[17,1],[17,4]],performAction:x(function(E,L,S,C,A,N,_){var O=N.length-1;switch(A){case 6:case 7:return C;case 8:C.getLogger().trace("Stop NL ");break;case 9:C.getLogger().trace("Stop EOF ");break;case 11:C.getLogger().trace("Stop NL2 ");break;case 12:C.getLogger().trace("Stop EOF2 ");break;case 15:C.getLogger().info("Node: ",N[O].id),C.addNode(N[O-1].length,N[O].id,N[O].descr,N[O].type);break;case 16:C.getLogger().trace("Icon: ",N[O]),C.decorateNode({icon:N[O]});break;case 17:case 21:C.decorateNode({class:N[O]});break;case 18:C.getLogger().trace("SPACELIST");break;case 19:C.getLogger().trace("Node: ",N[O].id),C.addNode(0,N[O].id,N[O].descr,N[O].type);break;case 20:C.decorateNode({icon:N[O]});break;case 25:C.getLogger().trace("node found ..",N[O-2]),this.$={id:N[O-1],descr:N[O-1],type:C.getType(N[O-2],N[O])};break;case 26:this.$={id:N[O],descr:N[O],type:C.nodeType.DEFAULT};break;case 27:C.getLogger().trace("node found ..",N[O-3]),this.$={id:N[O-3],descr:N[O-1],type:C.getType(N[O-2],N[O])};break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:e},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:e},{6:r,7:[1,10],9:9,12:11,13:n,14:14,15:i,16:a,17:17,18:18,19:s,22:o},t(l,[2,3]),{1:[2,2]},t(l,[2,4]),t(l,[2,5]),{1:[2,6],6:r,12:21,13:n,14:14,15:i,16:a,17:17,18:18,19:s,22:o},{6:r,9:22,12:11,13:n,14:14,15:i,16:a,17:17,18:18,19:s,22:o},{6:u,7:h,10:23,11:d},t(f,[2,22],{17:17,18:18,14:27,15:[1,28],16:[1,29],19:s,22:o}),t(f,[2,18]),t(f,[2,19]),t(f,[2,20]),t(f,[2,21]),t(f,[2,23]),t(f,[2,24]),t(f,[2,26],{19:[1,30]}),{20:[1,31]},{6:u,7:h,10:32,11:d},{1:[2,7],6:r,12:21,13:n,14:14,15:i,16:a,17:17,18:18,19:s,22:o},t(p,[2,14],{7:g,11:m}),t(v,[2,8]),t(v,[2,9]),t(v,[2,10]),t(f,[2,15]),t(f,[2,16]),t(f,[2,17]),{20:[1,35]},{21:[1,36]},t(p,[2,13],{7:g,11:m}),t(v,[2,11]),t(v,[2,12]),{21:[1,37]},t(f,[2,25]),t(f,[2,27])],defaultActions:{2:[2,1],6:[2,2]},parseError:x(function(E,L){if(L.recoverable)this.trace(E);else{var S=new Error(E);throw S.hash=L,S}},"parseError"),parse:x(function(E){var L=this,S=[0],C=[],A=[null],N=[],_=this.table,O="",P=0,k=0,R=2,I=1,M=N.slice.call(arguments,1),D=Object.create(this.lexer),B={yy:{}};for(var $ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,$)&&(B.yy[$]=this.yy[$]);D.setInput(E,B.yy),B.yy.lexer=D,B.yy.parser=this,typeof D.yylloc>"u"&&(D.yylloc={});var F=D.yylloc;N.push(F);var G=D.options&&D.options.ranges;typeof B.yy.parseError=="function"?this.parseError=B.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function W(fe){S.length=S.length-2*fe,A.length=A.length-fe,N.length=N.length-fe}x(W,"popStack");function J(){var fe;return fe=C.pop()||D.lex()||I,typeof fe!="number"&&(fe instanceof Array&&(C=fe,fe=C.pop()),fe=L.symbols_[fe]||fe),fe}x(J,"lex");for(var q,ne,ae,pe,K={},Z,X,Y,ee;;){if(ne=S[S.length-1],this.defaultActions[ne]?ae=this.defaultActions[ne]:((q===null||typeof q>"u")&&(q=J()),ae=_[ne]&&_[ne][q]),typeof ae>"u"||!ae.length||!ae[0]){var j="";ee=[];for(Z in _[ne])this.terminals_[Z]&&Z>R&&ee.push("'"+this.terminals_[Z]+"'");D.showPosition?j="Parse error on line "+(P+1)+`:
`+D.showPosition()+`
Expecting `+ee.join(", ")+", got '"+(this.terminals_[q]||q)+"'":j="Parse error on line "+(P+1)+": Unexpected "+(q==I?"end of input":"'"+(this.terminals_[q]||q)+"'"),this.parseError(j,{text:D.match,token:this.terminals_[q]||q,line:D.yylineno,loc:F,expected:ee})}if(ae[0]instanceof Array&&ae.length>1)throw new Error("Parse Error: multiple actions possible at state: "+ne+", token: "+q);switch(ae[0]){case 1:S.push(q),A.push(D.yytext),N.push(D.yylloc),S.push(ae[1]),q=null,k=D.yyleng,O=D.yytext,P=D.yylineno,F=D.yylloc;break;case 2:if(X=this.productions_[ae[1]][1],K.$=A[A.length-X],K._$={first_line:N[N.length-(X||1)].first_line,last_line:N[N.length-1].last_line,first_column:N[N.length-(X||1)].first_column,last_column:N[N.length-1].last_column},G&&(K._$.range=[N[N.length-(X||1)].range[0],N[N.length-1].range[1]]),pe=this.performAction.apply(K,[O,k,P,B.yy,ae[1],A,N].concat(M)),typeof pe<"u")return pe;X&&(S=S.slice(0,-1*X*2),A=A.slice(0,-1*X),N=N.slice(0,-1*X)),S.push(this.productions_[ae[1]][0]),A.push(K.$),N.push(K._$),Y=_[S[S.length-2]][S[S.length-1]],S.push(Y);break;case 3:return!0}}return!0},"parse")},b=function(){var T={EOF:1,parseError:x(function(L,S){if(this.yy.parser)this.yy.parser.parseError(L,S);else throw new Error(L)},"parseError"),setInput:x(function(E,L){return this.yy=L||this.yy||{},this._input=E,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:x(function(){var E=this._input[0];this.yytext+=E,this.yyleng++,this.offset++,this.match+=E,this.matched+=E;var L=E.match(/(?:\r\n?|\n).*/g);return L?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),E},"input"),unput:x(function(E){var L=E.length,S=E.split(/(?:\r\n?|\n)/g);this._input=E+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-L),this.offset-=L;var C=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),S.length-1&&(this.yylineno-=S.length-1);var A=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:S?(S.length===C.length?this.yylloc.first_column:0)+C[C.length-S.length].length-S[0].length:this.yylloc.first_column-L},this.options.ranges&&(this.yylloc.range=[A[0],A[0]+this.yyleng-L]),this.yyleng=this.yytext.length,this},"unput"),more:x(function(){return this._more=!0,this},"more"),reject:x(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:x(function(E){this.unput(this.match.slice(E))},"less"),pastInput:x(function(){var E=this.matched.substr(0,this.matched.length-this.match.length);return(E.length>20?"...":"")+E.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:x(function(){var E=this.match;return E.length<20&&(E+=this._input.substr(0,20-E.length)),(E.substr(0,20)+(E.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:x(function(){var E=this.pastInput(),L=new Array(E.length+1).join("-");return E+this.upcomingInput()+`
`+L+"^"},"showPosition"),test_match:x(function(E,L){var S,C,A;if(this.options.backtrack_lexer&&(A={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(A.yylloc.range=this.yylloc.range.slice(0))),C=E[0].match(/(?:\r\n?|\n).*/g),C&&(this.yylineno+=C.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:C?C[C.length-1].length-C[C.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+E[0].length},this.yytext+=E[0],this.match+=E[0],this.matches=E,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(E[0].length),this.matched+=E[0],S=this.performAction.call(this,this.yy,this,L,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),S)return S;if(this._backtrack){for(var N in A)this[N]=A[N];return!1}return!1},"test_match"),next:x(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var E,L,S,C;this._more||(this.yytext="",this.match="");for(var A=this._currentRules(),N=0;N<A.length;N++)if(S=this._input.match(this.rules[A[N]]),S&&(!L||S[0].length>L[0].length)){if(L=S,C=N,this.options.backtrack_lexer){if(E=this.test_match(S,A[N]),E!==!1)return E;if(this._backtrack){L=!1;continue}else return!1}else if(!this.options.flex)break}return L?(E=this.test_match(L,A[C]),E!==!1?E:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var L=this.next();return L||this.lex()},"lex"),begin:x(function(L){this.conditionStack.push(L)},"begin"),popState:x(function(){var L=this.conditionStack.length-1;return L>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(L){return L=this.conditionStack.length-1-Math.abs(L||0),L>=0?this.conditionStack[L]:"INITIAL"},"topState"),pushState:x(function(L){this.begin(L)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:x(function(L,S,C,A){switch(C){case 0:return L.getLogger().trace("Found comment",S.yytext),6;case 1:return 8;case 2:this.begin("CLASS");break;case 3:return this.popState(),16;case 4:this.popState();break;case 5:L.getLogger().trace("Begin icon"),this.begin("ICON");break;case 6:return L.getLogger().trace("SPACELINE"),6;case 7:return 7;case 8:return 15;case 9:L.getLogger().trace("end icon"),this.popState();break;case 10:return L.getLogger().trace("Exploding node"),this.begin("NODE"),19;case 11:return L.getLogger().trace("Cloud"),this.begin("NODE"),19;case 12:return L.getLogger().trace("Explosion Bang"),this.begin("NODE"),19;case 13:return L.getLogger().trace("Cloud Bang"),this.begin("NODE"),19;case 14:return this.begin("NODE"),19;case 15:return this.begin("NODE"),19;case 16:return this.begin("NODE"),19;case 17:return this.begin("NODE"),19;case 18:return 13;case 19:return 22;case 20:return 11;case 21:this.begin("NSTR2");break;case 22:return"NODE_DESCR";case 23:this.popState();break;case 24:L.getLogger().trace("Starting NSTR"),this.begin("NSTR");break;case 25:return L.getLogger().trace("description:",S.yytext),"NODE_DESCR";case 26:this.popState();break;case 27:return this.popState(),L.getLogger().trace("node end ))"),"NODE_DEND";case 28:return this.popState(),L.getLogger().trace("node end )"),"NODE_DEND";case 29:return this.popState(),L.getLogger().trace("node end ...",S.yytext),"NODE_DEND";case 30:return this.popState(),L.getLogger().trace("node end (("),"NODE_DEND";case 31:return this.popState(),L.getLogger().trace("node end (-"),"NODE_DEND";case 32:return this.popState(),L.getLogger().trace("node end (-"),"NODE_DEND";case 33:return this.popState(),L.getLogger().trace("node end (("),"NODE_DEND";case 34:return this.popState(),L.getLogger().trace("node end (("),"NODE_DEND";case 35:return L.getLogger().trace("Long description:",S.yytext),20;case 36:return L.getLogger().trace("Long description:",S.yytext),20}},"anonymous"),rules:[/^(?:\s*%%.*)/i,/^(?:mindmap\b)/i,/^(?::::)/i,/^(?:.+)/i,/^(?:\n)/i,/^(?:::icon\()/i,/^(?:[\s]+[\n])/i,/^(?:[\n]+)/i,/^(?:[^\)]+)/i,/^(?:\))/i,/^(?:-\))/i,/^(?:\(-)/i,/^(?:\)\))/i,/^(?:\))/i,/^(?:\(\()/i,/^(?:\{\{)/i,/^(?:\()/i,/^(?:\[)/i,/^(?:[\s]+)/i,/^(?:[^\(\[\n\)\{\}]+)/i,/^(?:$)/i,/^(?:["][`])/i,/^(?:[^`"]+)/i,/^(?:[`]["])/i,/^(?:["])/i,/^(?:[^"]+)/i,/^(?:["])/i,/^(?:[\)]\))/i,/^(?:[\)])/i,/^(?:[\]])/i,/^(?:\}\})/i,/^(?:\(-)/i,/^(?:-\))/i,/^(?:\(\()/i,/^(?:\()/i,/^(?:[^\)\]\(\}]+)/i,/^(?:.+(?!\(\())/i],conditions:{CLASS:{rules:[3,4],inclusive:!1},ICON:{rules:[8,9],inclusive:!1},NSTR2:{rules:[22,23],inclusive:!1},NSTR:{rules:[25,26],inclusive:!1},NODE:{rules:[21,24,27,28,29,30,31,32,33,34,35,36],inclusive:!1},INITIAL:{rules:[0,1,2,5,6,7,10,11,12,13,14,15,16,17,18,19,20],inclusive:!0}}};return T}();y.lexer=b;function w(){this.yy={}}return x(w,"Parser"),w.prototype=y,y.Parser=w,new w}();MT.parser=MT;var h_e=MT,xo={DEFAULT:0,NO_BORDER:0,ROUNDED_RECT:1,RECT:2,CIRCLE:3,CLOUD:4,BANG:5,HEXAGON:6},d_e=class{constructor(){this.nodes=[],this.count=0,this.elements={},this.getLogger=this.getLogger.bind(this),this.nodeType=xo,this.clear(),this.getType=this.getType.bind(this),this.getElementById=this.getElementById.bind(this),this.getParent=this.getParent.bind(this),this.getMindmap=this.getMindmap.bind(this),this.addNode=this.addNode.bind(this),this.decorateNode=this.decorateNode.bind(this)}static{x(this,"MindmapDB")}clear(){this.nodes=[],this.count=0,this.elements={},this.baseLevel=void 0}getParent(t){for(let e=this.nodes.length-1;e>=0;e--)if(this.nodes[e].level<t)return this.nodes[e];return null}getMindmap(){return this.nodes.length>0?this.nodes[0]:null}addNode(t,e,r,n){ie.info("addNode",t,e,r,n);let i=!1;this.nodes.length===0?(this.baseLevel=t,t=0,i=!0):this.baseLevel!==void 0&&(t=t-this.baseLevel,i=!1);const a=we();let s=a.mindmap?.padding??hr.mindmap.padding;switch(n){case this.nodeType.ROUNDED_RECT:case this.nodeType.RECT:case this.nodeType.HEXAGON:s*=2;break}const o={id:this.count++,nodeId:fr(e,a),level:t,descr:fr(r,a),type:n,children:[],width:a.mindmap?.maxNodeWidth??hr.mindmap.maxNodeWidth,padding:s,isRoot:i},l=this.getParent(t);if(l)l.children.push(o),this.nodes.push(o);else if(i)this.nodes.push(o);else throw new Error(`There can be only one root. No parent could be found for ("${o.descr}")`)}getType(t,e){switch(ie.debug("In get type",t,e),t){case"[":return this.nodeType.RECT;case"(":return e===")"?this.nodeType.ROUNDED_RECT:this.nodeType.CLOUD;case"((":return this.nodeType.CIRCLE;case")":return this.nodeType.CLOUD;case"))":return this.nodeType.BANG;case"{{":return this.nodeType.HEXAGON;default:return this.nodeType.DEFAULT}}setElementForId(t,e){this.elements[t]=e}getElementById(t){return this.elements[t]}decorateNode(t){if(!t)return;const e=we(),r=this.nodes[this.nodes.length-1];t.icon&&(r.icon=fr(t.icon,e)),t.class&&(r.class=fr(t.class,e))}type2Str(t){switch(t){case this.nodeType.DEFAULT:return"no-border";case this.nodeType.RECT:return"rect";case this.nodeType.ROUNDED_RECT:return"rounded-rect";case this.nodeType.CIRCLE:return"circle";case this.nodeType.CLOUD:return"cloud";case this.nodeType.BANG:return"bang";case this.nodeType.HEXAGON:return"hexgon";default:return"no-border"}}assignSections(t,e){if(t.level===0?t.section=void 0:t.section=e,t.children)for(const[r,n]of t.children.entries()){const i=t.level===0?r:e;this.assignSections(n,i)}}flattenNodes(t,e){const r=["mindmap-node"];t.isRoot===!0?r.push("section-root","section--1"):t.section!==void 0&&r.push(`section-${t.section}`),t.class&&r.push(t.class);const n=r.join(" "),i=x(s=>{switch(s){case xo.CIRCLE:return"mindmapCircle";case xo.RECT:return"rect";case xo.ROUNDED_RECT:return"rounded";case xo.CLOUD:return"cloud";case xo.BANG:return"bang";case xo.HEXAGON:return"hexagon";case xo.DEFAULT:return"defaultMindmapNode";case xo.NO_BORDER:default:return"rect"}},"getShapeFromType"),a={id:t.id.toString(),domId:"node_"+t.id.toString(),label:t.descr,isGroup:!1,shape:i(t.type),width:t.width,height:t.height??0,padding:t.padding,cssClasses:n,cssStyles:[],look:"default",icon:t.icon,x:t.x,y:t.y,level:t.level,nodeId:t.nodeId,type:t.type,section:t.section};if(e.push(a),t.children)for(const s of t.children)this.flattenNodes(s,e)}generateEdges(t,e){if(t.children)for(const r of t.children){let n="edge";r.section!==void 0&&(n+=` section-edge-${r.section}`);const i=t.level+1;n+=` edge-depth-${i}`;const a={id:`edge_${t.id}_${r.id}`,start:t.id.toString(),end:r.id.toString(),type:"normal",curve:"basis",thickness:"normal",look:"default",classes:n,depth:t.level,section:r.section};e.push(a),this.generateEdges(r,e)}}getData(){const t=this.getMindmap(),e=we(),n=XY().layout!==void 0,i=e;if(n||(i.layout="cose-bilkent"),!t)return{nodes:[],edges:[],config:i};ie.debug("getData: mindmapRoot",t,e),this.assignSections(t);const a=[],s=[];this.flattenNodes(t,a),this.generateEdges(t,s),ie.debug(`getData: processed ${a.length} nodes and ${s.length} edges`);const o=new Map;for(const l of a)o.set(l.id,{shape:l.shape,width:l.width,height:l.height,padding:l.padding});return{nodes:a,edges:s,config:i,rootNode:t,markers:["point"],direction:"TB",nodeSpacing:50,rankSpacing:50,shapes:Object.fromEntries(o),type:"mindmap",diagramId:"mindmap-"+u_e()}}getLogger(){return ie}},f_e=x(async(t,e,r,n)=>{ie.debug(`Rendering mindmap diagram
`+t);const i=n.db,a=i.getData(),s=Pd(e,a.config.securityLevel);a.type=n.type,a.layoutAlgorithm=Vp(a.config.layout,{fallback:"cose-bilkent"}),a.diagramId=e,i.getMindmap()&&(a.nodes.forEach(l=>{l.shape==="rounded"?(l.radius=15,l.taper=15,l.stroke="none",l.width=0,l.padding=15):l.shape==="circle"?l.padding=10:l.shape==="rect"&&(l.width=0,l.padding=10)}),await Sd(a,s),Bu(s,a.config.mindmap?.padding??hr.mindmap.padding,"mindmapDiagram",a.config.mindmap?.useMaxWidth??hr.mindmap.useMaxWidth))},"draw"),p_e={draw:f_e},g_e=x(t=>{let e="";for(let r=0;r<t.THEME_COLOR_LIMIT;r++)t["lineColor"+r]=t["lineColor"+r]||t["cScaleInv"+r],ec(t["lineColor"+r])?t["lineColor"+r]=_t(t["lineColor"+r],20):t["lineColor"+r]=It(t["lineColor"+r],20);for(let r=0;r<t.THEME_COLOR_LIMIT;r++){const n=""+(17-3*r);e+=`
    .section-${r-1} rect, .section-${r-1} path, .section-${r-1} circle, .section-${r-1} polygon, .section-${r-1} path  {
      fill: ${t["cScale"+r]};
    }
    .section-${r-1} text {
     fill: ${t["cScaleLabel"+r]};
    }
    .node-icon-${r-1} {
      font-size: 40px;
      color: ${t["cScaleLabel"+r]};
    }
    .section-edge-${r-1}{
      stroke: ${t["cScale"+r]};
    }
    .edge-depth-${r-1}{
      stroke-width: ${n};
    }
    .section-${r-1} line {
      stroke: ${t["cScaleInv"+r]} ;
      stroke-width: 3;
    }

    .disabled, .disabled circle, .disabled text {
      fill: lightgray;
    }
    .disabled text {
      fill: #efefef;
    }
    `}return e},"genSections"),m_e=x(t=>`
  .edge {
    stroke-width: 3;
  }
  ${g_e(t)}
  .section-root rect, .section-root path, .section-root circle, .section-root polygon  {
    fill: ${t.git0};
  }
  .section-root text {
    fill: ${t.gitBranchLabel0};
  }
  .section-root span {
    color: ${t.gitBranchLabel0};
  }
  .section-2 span {
    color: ${t.gitBranchLabel0};
  }
  .icon-container {
    height:100%;
    display: flex;
    justify-content: center;
    align-items: center;
  }
  .edge {
    fill: none;
  }
  .mindmap-node-label {
    dy: 1em;
    alignment-baseline: middle;
    text-anchor: middle;
    dominant-baseline: middle;
    text-align: center;
  }
`,"getStyles"),v_e=m_e,y_e={get db(){return new d_e},renderer:p_e,parser:h_e,styles:v_e};const x_e=Object.freeze(Object.defineProperty({__proto__:null,diagram:y_e},Symbol.toStringTag,{value:"Module"}));var IT=function(){var t=x(function(S,C,A,N){for(A=A||{},N=S.length;N--;A[S[N]]=C);return A},"o"),e=[1,4],r=[1,13],n=[1,12],i=[1,15],a=[1,16],s=[1,20],o=[1,19],l=[6,7,8],u=[1,26],h=[1,24],d=[1,25],f=[6,7,11],p=[1,31],g=[6,7,11,24],m=[1,6,13,16,17,20,23],v=[1,35],y=[1,36],b=[1,6,7,11,13,16,17,20,23],w=[1,38],T={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,KANBAN:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,shapeData:15,ICON:16,CLASS:17,nodeWithId:18,nodeWithoutId:19,NODE_DSTART:20,NODE_DESCR:21,NODE_DEND:22,NODE_ID:23,SHAPE_DATA:24,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"KANBAN",11:"EOF",13:"SPACELIST",16:"ICON",17:"CLASS",20:"NODE_DSTART",21:"NODE_DESCR",22:"NODE_DEND",23:"NODE_ID",24:"SHAPE_DATA"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,3],[12,2],[12,2],[12,2],[12,1],[12,2],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[19,3],[18,1],[18,4],[15,2],[15,1]],performAction:x(function(C,A,N,_,O,P,k){var R=P.length-1;switch(O){case 6:case 7:return _;case 8:_.getLogger().trace("Stop NL ");break;case 9:_.getLogger().trace("Stop EOF ");break;case 11:_.getLogger().trace("Stop NL2 ");break;case 12:_.getLogger().trace("Stop EOF2 ");break;case 15:_.getLogger().info("Node: ",P[R-1].id),_.addNode(P[R-2].length,P[R-1].id,P[R-1].descr,P[R-1].type,P[R]);break;case 16:_.getLogger().info("Node: ",P[R].id),_.addNode(P[R-1].length,P[R].id,P[R].descr,P[R].type);break;case 17:_.getLogger().trace("Icon: ",P[R]),_.decorateNode({icon:P[R]});break;case 18:case 23:_.decorateNode({class:P[R]});break;case 19:_.getLogger().trace("SPACELIST");break;case 20:_.getLogger().trace("Node: ",P[R-1].id),_.addNode(0,P[R-1].id,P[R-1].descr,P[R-1].type,P[R]);break;case 21:_.getLogger().trace("Node: ",P[R].id),_.addNode(0,P[R].id,P[R].descr,P[R].type);break;case 22:_.decorateNode({icon:P[R]});break;case 27:_.getLogger().trace("node found ..",P[R-2]),this.$={id:P[R-1],descr:P[R-1],type:_.getType(P[R-2],P[R])};break;case 28:this.$={id:P[R],descr:P[R],type:0};break;case 29:_.getLogger().trace("node found ..",P[R-3]),this.$={id:P[R-3],descr:P[R-1],type:_.getType(P[R-2],P[R])};break;case 30:this.$=P[R-1]+P[R];break;case 31:this.$=P[R];break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:e},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:e},{6:r,7:[1,10],9:9,12:11,13:n,14:14,16:i,17:a,18:17,19:18,20:s,23:o},t(l,[2,3]),{1:[2,2]},t(l,[2,4]),t(l,[2,5]),{1:[2,6],6:r,12:21,13:n,14:14,16:i,17:a,18:17,19:18,20:s,23:o},{6:r,9:22,12:11,13:n,14:14,16:i,17:a,18:17,19:18,20:s,23:o},{6:u,7:h,10:23,11:d},t(f,[2,24],{18:17,19:18,14:27,16:[1,28],17:[1,29],20:s,23:o}),t(f,[2,19]),t(f,[2,21],{15:30,24:p}),t(f,[2,22]),t(f,[2,23]),t(g,[2,25]),t(g,[2,26]),t(g,[2,28],{20:[1,32]}),{21:[1,33]},{6:u,7:h,10:34,11:d},{1:[2,7],6:r,12:21,13:n,14:14,16:i,17:a,18:17,19:18,20:s,23:o},t(m,[2,14],{7:v,11:y}),t(b,[2,8]),t(b,[2,9]),t(b,[2,10]),t(f,[2,16],{15:37,24:p}),t(f,[2,17]),t(f,[2,18]),t(f,[2,20],{24:w}),t(g,[2,31]),{21:[1,39]},{22:[1,40]},t(m,[2,13],{7:v,11:y}),t(b,[2,11]),t(b,[2,12]),t(f,[2,15],{24:w}),t(g,[2,30]),{22:[1,41]},t(g,[2,27]),t(g,[2,29])],defaultActions:{2:[2,1],6:[2,2]},parseError:x(function(C,A){if(A.recoverable)this.trace(C);else{var N=new Error(C);throw N.hash=A,N}},"parseError"),parse:x(function(C){var A=this,N=[0],_=[],O=[null],P=[],k=this.table,R="",I=0,M=0,D=2,B=1,$=P.slice.call(arguments,1),F=Object.create(this.lexer),G={yy:{}};for(var W in this.yy)Object.prototype.hasOwnProperty.call(this.yy,W)&&(G.yy[W]=this.yy[W]);F.setInput(C,G.yy),G.yy.lexer=F,G.yy.parser=this,typeof F.yylloc>"u"&&(F.yylloc={});var J=F.yylloc;P.push(J);var q=F.options&&F.options.ranges;typeof G.yy.parseError=="function"?this.parseError=G.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ne(H){N.length=N.length-2*H,O.length=O.length-H,P.length=P.length-H}x(ne,"popStack");function ae(){var H;return H=_.pop()||F.lex()||B,typeof H!="number"&&(H instanceof Array&&(_=H,H=_.pop()),H=A.symbols_[H]||H),H}x(ae,"lex");for(var pe,K,Z,X,Y={},ee,j,fe,te;;){if(K=N[N.length-1],this.defaultActions[K]?Z=this.defaultActions[K]:((pe===null||typeof pe>"u")&&(pe=ae()),Z=k[K]&&k[K][pe]),typeof Z>"u"||!Z.length||!Z[0]){var Ae="";te=[];for(ee in k[K])this.terminals_[ee]&&ee>D&&te.push("'"+this.terminals_[ee]+"'");F.showPosition?Ae="Parse error on line "+(I+1)+`:
`+F.showPosition()+`
Expecting `+te.join(", ")+", got '"+(this.terminals_[pe]||pe)+"'":Ae="Parse error on line "+(I+1)+": Unexpected "+(pe==B?"end of input":"'"+(this.terminals_[pe]||pe)+"'"),this.parseError(Ae,{text:F.match,token:this.terminals_[pe]||pe,line:F.yylineno,loc:J,expected:te})}if(Z[0]instanceof Array&&Z.length>1)throw new Error("Parse Error: multiple actions possible at state: "+K+", token: "+pe);switch(Z[0]){case 1:N.push(pe),O.push(F.yytext),P.push(F.yylloc),N.push(Z[1]),pe=null,M=F.yyleng,R=F.yytext,I=F.yylineno,J=F.yylloc;break;case 2:if(j=this.productions_[Z[1]][1],Y.$=O[O.length-j],Y._$={first_line:P[P.length-(j||1)].first_line,last_line:P[P.length-1].last_line,first_column:P[P.length-(j||1)].first_column,last_column:P[P.length-1].last_column},q&&(Y._$.range=[P[P.length-(j||1)].range[0],P[P.length-1].range[1]]),X=this.performAction.apply(Y,[R,M,I,G.yy,Z[1],O,P].concat($)),typeof X<"u")return X;j&&(N=N.slice(0,-1*j*2),O=O.slice(0,-1*j),P=P.slice(0,-1*j)),N.push(this.productions_[Z[1]][0]),O.push(Y.$),P.push(Y._$),fe=k[N[N.length-2]][N[N.length-1]],N.push(fe);break;case 3:return!0}}return!0},"parse")},E=function(){var S={EOF:1,parseError:x(function(A,N){if(this.yy.parser)this.yy.parser.parseError(A,N);else throw new Error(A)},"parseError"),setInput:x(function(C,A){return this.yy=A||this.yy||{},this._input=C,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:x(function(){var C=this._input[0];this.yytext+=C,this.yyleng++,this.offset++,this.match+=C,this.matched+=C;var A=C.match(/(?:\r\n?|\n).*/g);return A?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),C},"input"),unput:x(function(C){var A=C.length,N=C.split(/(?:\r\n?|\n)/g);this._input=C+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-A),this.offset-=A;var _=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),N.length-1&&(this.yylineno-=N.length-1);var O=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:N?(N.length===_.length?this.yylloc.first_column:0)+_[_.length-N.length].length-N[0].length:this.yylloc.first_column-A},this.options.ranges&&(this.yylloc.range=[O[0],O[0]+this.yyleng-A]),this.yyleng=this.yytext.length,this},"unput"),more:x(function(){return this._more=!0,this},"more"),reject:x(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:x(function(C){this.unput(this.match.slice(C))},"less"),pastInput:x(function(){var C=this.matched.substr(0,this.matched.length-this.match.length);return(C.length>20?"...":"")+C.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:x(function(){var C=this.match;return C.length<20&&(C+=this._input.substr(0,20-C.length)),(C.substr(0,20)+(C.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:x(function(){var C=this.pastInput(),A=new Array(C.length+1).join("-");return C+this.upcomingInput()+`
`+A+"^"},"showPosition"),test_match:x(function(C,A){var N,_,O;if(this.options.backtrack_lexer&&(O={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(O.yylloc.range=this.yylloc.range.slice(0))),_=C[0].match(/(?:\r\n?|\n).*/g),_&&(this.yylineno+=_.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:_?_[_.length-1].length-_[_.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+C[0].length},this.yytext+=C[0],this.match+=C[0],this.matches=C,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(C[0].length),this.matched+=C[0],N=this.performAction.call(this,this.yy,this,A,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),N)return N;if(this._backtrack){for(var P in O)this[P]=O[P];return!1}return!1},"test_match"),next:x(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var C,A,N,_;this._more||(this.yytext="",this.match="");for(var O=this._currentRules(),P=0;P<O.length;P++)if(N=this._input.match(this.rules[O[P]]),N&&(!A||N[0].length>A[0].length)){if(A=N,_=P,this.options.backtrack_lexer){if(C=this.test_match(N,O[P]),C!==!1)return C;if(this._backtrack){A=!1;continue}else return!1}else if(!this.options.flex)break}return A?(C=this.test_match(A,O[_]),C!==!1?C:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var A=this.next();return A||this.lex()},"lex"),begin:x(function(A){this.conditionStack.push(A)},"begin"),popState:x(function(){var A=this.conditionStack.length-1;return A>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(A){return A=this.conditionStack.length-1-Math.abs(A||0),A>=0?this.conditionStack[A]:"INITIAL"},"topState"),pushState:x(function(A){this.begin(A)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:x(function(A,N,_,O){switch(_){case 0:return this.pushState("shapeData"),N.yytext="",24;case 1:return this.pushState("shapeDataStr"),24;case 2:return this.popState(),24;case 3:const P=/\n\s*/g;return N.yytext=N.yytext.replace(P,"<br/>"),24;case 4:return 24;case 5:this.popState();break;case 6:return A.getLogger().trace("Found comment",N.yytext),6;case 7:return 8;case 8:this.begin("CLASS");break;case 9:return this.popState(),17;case 10:this.popState();break;case 11:A.getLogger().trace("Begin icon"),this.begin("ICON");break;case 12:return A.getLogger().trace("SPACELINE"),6;case 13:return 7;case 14:return 16;case 15:A.getLogger().trace("end icon"),this.popState();break;case 16:return A.getLogger().trace("Exploding node"),this.begin("NODE"),20;case 17:return A.getLogger().trace("Cloud"),this.begin("NODE"),20;case 18:return A.getLogger().trace("Explosion Bang"),this.begin("NODE"),20;case 19:return A.getLogger().trace("Cloud Bang"),this.begin("NODE"),20;case 20:return this.begin("NODE"),20;case 21:return this.begin("NODE"),20;case 22:return this.begin("NODE"),20;case 23:return this.begin("NODE"),20;case 24:return 13;case 25:return 23;case 26:return 11;case 27:this.begin("NSTR2");break;case 28:return"NODE_DESCR";case 29:this.popState();break;case 30:A.getLogger().trace("Starting NSTR"),this.begin("NSTR");break;case 31:return A.getLogger().trace("description:",N.yytext),"NODE_DESCR";case 32:this.popState();break;case 33:return this.popState(),A.getLogger().trace("node end ))"),"NODE_DEND";case 34:return this.popState(),A.getLogger().trace("node end )"),"NODE_DEND";case 35:return this.popState(),A.getLogger().trace("node end ...",N.yytext),"NODE_DEND";case 36:return this.popState(),A.getLogger().trace("node end (("),"NODE_DEND";case 37:return this.popState(),A.getLogger().trace("node end (-"),"NODE_DEND";case 38:return this.popState(),A.getLogger().trace("node end (-"),"NODE_DEND";case 39:return this.popState(),A.getLogger().trace("node end (("),"NODE_DEND";case 40:return this.popState(),A.getLogger().trace("node end (("),"NODE_DEND";case 41:return A.getLogger().trace("Long description:",N.yytext),21;case 42:return A.getLogger().trace("Long description:",N.yytext),21}},"anonymous"),rules:[/^(?:@\{)/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^\"]+)/i,/^(?:[^}^"]+)/i,/^(?:\})/i,/^(?:\s*%%.*)/i,/^(?:kanban\b)/i,/^(?::::)/i,/^(?:.+)/i,/^(?:\n)/i,/^(?:::icon\()/i,/^(?:[\s]+[\n])/i,/^(?:[\n]+)/i,/^(?:[^\)]+)/i,/^(?:\))/i,/^(?:-\))/i,/^(?:\(-)/i,/^(?:\)\))/i,/^(?:\))/i,/^(?:\(\()/i,/^(?:\{\{)/i,/^(?:\()/i,/^(?:\[)/i,/^(?:[\s]+)/i,/^(?:[^\(\[\n\)\{\}@]+)/i,/^(?:$)/i,/^(?:["][`])/i,/^(?:[^`"]+)/i,/^(?:[`]["])/i,/^(?:["])/i,/^(?:[^"]+)/i,/^(?:["])/i,/^(?:[\)]\))/i,/^(?:[\)])/i,/^(?:[\]])/i,/^(?:\}\})/i,/^(?:\(-)/i,/^(?:-\))/i,/^(?:\(\()/i,/^(?:\()/i,/^(?:[^\)\]\(\}]+)/i,/^(?:.+(?!\(\())/i],conditions:{shapeDataEndBracket:{rules:[],inclusive:!1},shapeDataStr:{rules:[2,3],inclusive:!1},shapeData:{rules:[1,4,5],inclusive:!1},CLASS:{rules:[9,10],inclusive:!1},ICON:{rules:[14,15],inclusive:!1},NSTR2:{rules:[28,29],inclusive:!1},NSTR:{rules:[31,32],inclusive:!1},NODE:{rules:[27,30,33,34,35,36,37,38,39,40,41,42],inclusive:!1},INITIAL:{rules:[0,6,7,8,11,12,13,16,17,18,19,20,21,22,23,24,25,26],inclusive:!0}}};return S}();T.lexer=E;function L(){this.yy={}}return x(L,"Parser"),L.prototype=T,T.Parser=L,new L}();IT.parser=IT;var b_e=IT,Va=[],mS=[],OT=0,vS={},w_e=x(()=>{Va=[],mS=[],OT=0,vS={}},"clear"),T_e=x(t=>{if(Va.length===0)return null;const e=Va[0].level;let r=null;for(let n=Va.length-1;n>=0;n--)if(Va[n].level===e&&!r&&(r=Va[n]),Va[n].level<e)throw new Error('Items without section detected, found section ("'+Va[n].label+'")');return t===r?.level?null:r},"getSection"),rq=x(function(){return mS},"getSections"),E_e=x(function(){const t=[],e=[],r=rq(),n=we();for(const i of r){const a={id:i.id,label:fr(i.label??"",n),isGroup:!0,ticket:i.ticket,shape:"kanbanSection",level:i.level,look:n.look};e.push(a);const s=Va.filter(o=>o.parentId===i.id);for(const o of s){const l={id:o.id,parentId:i.id,label:fr(o.label??"",n),isGroup:!1,ticket:o?.ticket,priority:o?.priority,assigned:o?.assigned,icon:o?.icon,shape:"kanbanItem",level:o.level,rx:5,ry:5,cssStyles:["text-align: left"]};e.push(l)}}return{nodes:e,edges:t,other:{},config:we()}},"getData"),k_e=x((t,e,r,n,i)=>{const a=we();let s=a.mindmap?.padding??hr.mindmap.padding;switch(n){case Mn.ROUNDED_RECT:case Mn.RECT:case Mn.HEXAGON:s*=2}const o={id:fr(e,a)||"kbn"+OT++,level:t,label:fr(r,a),width:a.mindmap?.maxNodeWidth??hr.mindmap.maxNodeWidth,padding:s,isGroup:!1};if(i!==void 0){let u;i.includes(`
`)?u=i+`
`:u=`{
`+i+`
}`;const h=Ky(u,{schema:jy});if(h.shape&&(h.shape!==h.shape.toLowerCase()||h.shape.includes("_")))throw new Error(`No such shape: ${h.shape}. Shape names should be lowercase.`);h?.shape&&h.shape==="kanbanItem"&&(o.shape=h?.shape),h?.label&&(o.label=h?.label),h?.icon&&(o.icon=h?.icon.toString()),h?.assigned&&(o.assigned=h?.assigned.toString()),h?.ticket&&(o.ticket=h?.ticket.toString()),h?.priority&&(o.priority=h?.priority)}const l=T_e(t);l?o.parentId=l.id||"kbn"+OT++:mS.push(o),Va.push(o)},"addNode"),Mn={DEFAULT:0,NO_BORDER:0,ROUNDED_RECT:1,RECT:2,CIRCLE:3,CLOUD:4,BANG:5,HEXAGON:6},S_e=x((t,e)=>{switch(ie.debug("In get type",t,e),t){case"[":return Mn.RECT;case"(":return e===")"?Mn.ROUNDED_RECT:Mn.CLOUD;case"((":return Mn.CIRCLE;case")":return Mn.CLOUD;case"))":return Mn.BANG;case"{{":return Mn.HEXAGON;default:return Mn.DEFAULT}},"getType"),C_e=x((t,e)=>{vS[t]=e},"setElementForId"),A_e=x(t=>{if(!t)return;const e=we(),r=Va[Va.length-1];t.icon&&(r.icon=fr(t.icon,e)),t.class&&(r.cssClasses=fr(t.class,e))},"decorateNode"),__e=x(t=>{switch(t){case Mn.DEFAULT:return"no-border";case Mn.RECT:return"rect";case Mn.ROUNDED_RECT:return"rounded-rect";case Mn.CIRCLE:return"circle";case Mn.CLOUD:return"cloud";case Mn.BANG:return"bang";case Mn.HEXAGON:return"hexgon";default:return"no-border"}},"type2Str"),L_e=x(()=>ie,"getLogger"),R_e=x(t=>vS[t],"getElementById"),N_e={clear:w_e,addNode:k_e,getSections:rq,getData:E_e,nodeType:Mn,getType:S_e,setElementForId:C_e,decorateNode:A_e,type2Str:__e,getLogger:L_e,getElementById:R_e},D_e=N_e,M_e=x(async(t,e,r,n)=>{ie.debug(`Rendering kanban diagram
`+t);const a=n.db.getData(),s=we();s.htmlLabels=!1;const o=el(e),l=o.append("g");l.attr("class","sections");const u=o.append("g");u.attr("class","items");const h=a.nodes.filter(v=>v.isGroup);let d=0;const f=10,p=[];let g=25;for(const v of h){const y=s?.kanban?.sectionWidth||200;d=d+1,v.x=y*d+(d-1)*f/2,v.width=y,v.y=0,v.height=y*3,v.rx=5,v.ry=5,v.cssClasses=v.cssClasses+" section-"+d;const b=await j6(l,v);g=Math.max(g,b?.labelBBox?.height),p.push(b)}let m=0;for(const v of h){const y=p[m];m=m+1;const b=s?.kanban?.sectionWidth||200,w=-b*3/2+g;let T=w;const E=a.nodes.filter(C=>C.parentId===v.id);for(const C of E){if(C.isGroup)throw new Error("Groups within groups are not allowed in Kanban diagrams");C.x=v.x,C.width=b-1.5*f;const N=(await l2(u,C,{config:s})).node().getBBox();C.y=T+N.height/2,await B5(C),T=C.y+N.height/2+f/2}const L=y.cluster.select("rect"),S=Math.max(T-w+3*f,50)+(g-25);L.attr("height",S)}_p(void 0,o,s.mindmap?.padding??hr.kanban.padding,s.mindmap?.useMaxWidth??hr.kanban.useMaxWidth)},"draw"),I_e={draw:M_e},O_e=x(t=>{let e="";for(let n=0;n<t.THEME_COLOR_LIMIT;n++)t["lineColor"+n]=t["lineColor"+n]||t["cScaleInv"+n],ec(t["lineColor"+n])?t["lineColor"+n]=_t(t["lineColor"+n],20):t["lineColor"+n]=It(t["lineColor"+n],20);const r=x((n,i)=>t.darkMode?It(n,i):_t(n,i),"adjuster");for(let n=0;n<t.THEME_COLOR_LIMIT;n++){const i=""+(17-3*n);e+=`
    .section-${n-1} rect, .section-${n-1} path, .section-${n-1} circle, .section-${n-1} polygon, .section-${n-1} path  {
      fill: ${r(t["cScale"+n],10)};
      stroke: ${r(t["cScale"+n],10)};

    }
    .section-${n-1} text {
     fill: ${t["cScaleLabel"+n]};
    }
    .node-icon-${n-1} {
      font-size: 40px;
      color: ${t["cScaleLabel"+n]};
    }
    .section-edge-${n-1}{
      stroke: ${t["cScale"+n]};
    }
    .edge-depth-${n-1}{
      stroke-width: ${i};
    }
    .section-${n-1} line {
      stroke: ${t["cScaleInv"+n]} ;
      stroke-width: 3;
    }

    .disabled, .disabled circle, .disabled text {
      fill: lightgray;
    }
    .disabled text {
      fill: #efefef;
    }

  .node rect,
  .node circle,
  .node ellipse,
  .node polygon,
  .node path {
    fill: ${t.background};
    stroke: ${t.nodeBorder};
    stroke-width: 1px;
  }

  .kanban-ticket-link {
    fill: ${t.background};
    stroke: ${t.nodeBorder};
    text-decoration: underline;
  }
    `}return e},"genSections"),P_e=x(t=>`
  .edge {
    stroke-width: 3;
  }
  ${O_e(t)}
  .section-root rect, .section-root path, .section-root circle, .section-root polygon  {
    fill: ${t.git0};
  }
  .section-root text {
    fill: ${t.gitBranchLabel0};
  }
  .icon-container {
    height:100%;
    display: flex;
    justify-content: center;
    align-items: center;
  }
  .edge {
    fill: none;
  }
  .cluster-label, .label {
    color: ${t.textColor};
    fill: ${t.textColor};
    }
  .kanban-label {
    dy: 1em;
    alignment-baseline: middle;
    text-anchor: middle;
    dominant-baseline: middle;
    text-align: center;
  }
    ${og()}
`,"getStyles"),B_e=P_e,F_e={db:D_e,renderer:I_e,parser:b_e,styles:B_e};const $_e=Object.freeze(Object.defineProperty({__proto__:null,diagram:F_e},Symbol.toStringTag,{value:"Module"}));function VR(t,e){let r;if(e===void 0)for(const n of t)n!=null&&(r<n||r===void 0&&n>=n)&&(r=n);else{let n=-1;for(let i of t)(i=e(i,++n,t))!=null&&(r<i||r===void 0&&i>=i)&&(r=i)}return r}function nq(t,e){let r;if(e===void 0)for(const n of t)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);else{let n=-1;for(let i of t)(i=e(i,++n,t))!=null&&(r>i||r===void 0&&i>=i)&&(r=i)}return r}function O3(t,e){let r=0;if(e===void 0)for(let n of t)(n=+n)&&(r+=n);else{let n=-1;for(let i of t)(i=+e(i,++n,t))&&(r+=i)}return r}function z_e(t){return t.target.depth}function V_e(t){return t.depth}function G_e(t,e){return e-1-t.height}function iq(t,e){return t.sourceLinks.length?t.depth:e-1}function U_e(t){return t.targetLinks.length?t.depth:t.sourceLinks.length?nq(t.sourceLinks,z_e)-1:0}function D1(t){return function(){return t}}function GR(t,e){return Ay(t.source,e.source)||t.index-e.index}function UR(t,e){return Ay(t.target,e.target)||t.index-e.index}function Ay(t,e){return t.y0-e.y0}function P3(t){return t.value}function W_e(t){return t.index}function H_e(t){return t.nodes}function q_e(t){return t.links}function WR(t,e){const r=t.get(e);if(!r)throw new Error("missing: "+e);return r}function HR({nodes:t}){for(const e of t){let r=e.y0,n=r;for(const i of e.sourceLinks)i.y0=r+i.width/2,r+=i.width;for(const i of e.targetLinks)i.y1=n+i.width/2,n+=i.width}}function Y_e(){let t=0,e=0,r=1,n=1,i=24,a=8,s,o=W_e,l=iq,u,h,d=H_e,f=q_e,p=6;function g(){const R={nodes:d.apply(null,arguments),links:f.apply(null,arguments)};return m(R),v(R),y(R),b(R),E(R),HR(R),R}g.update=function(R){return HR(R),R},g.nodeId=function(R){return arguments.length?(o=typeof R=="function"?R:D1(R),g):o},g.nodeAlign=function(R){return arguments.length?(l=typeof R=="function"?R:D1(R),g):l},g.nodeSort=function(R){return arguments.length?(u=R,g):u},g.nodeWidth=function(R){return arguments.length?(i=+R,g):i},g.nodePadding=function(R){return arguments.length?(a=s=+R,g):a},g.nodes=function(R){return arguments.length?(d=typeof R=="function"?R:D1(R),g):d},g.links=function(R){return arguments.length?(f=typeof R=="function"?R:D1(R),g):f},g.linkSort=function(R){return arguments.length?(h=R,g):h},g.size=function(R){return arguments.length?(t=e=0,r=+R[0],n=+R[1],g):[r-t,n-e]},g.extent=function(R){return arguments.length?(t=+R[0][0],r=+R[1][0],e=+R[0][1],n=+R[1][1],g):[[t,e],[r,n]]},g.iterations=function(R){return arguments.length?(p=+R,g):p};function m({nodes:R,links:I}){for(const[D,B]of R.entries())B.index=D,B.sourceLinks=[],B.targetLinks=[];const M=new Map(R.map((D,B)=>[o(D,B,R),D]));for(const[D,B]of I.entries()){B.index=D;let{source:$,target:F}=B;typeof $!="object"&&($=B.source=WR(M,$)),typeof F!="object"&&(F=B.target=WR(M,F)),$.sourceLinks.push(B),F.targetLinks.push(B)}if(h!=null)for(const{sourceLinks:D,targetLinks:B}of R)D.sort(h),B.sort(h)}function v({nodes:R}){for(const I of R)I.value=I.fixedValue===void 0?Math.max(O3(I.sourceLinks,P3),O3(I.targetLinks,P3)):I.fixedValue}function y({nodes:R}){const I=R.length;let M=new Set(R),D=new Set,B=0;for(;M.size;){for(const $ of M){$.depth=B;for(const{target:F}of $.sourceLinks)D.add(F)}if(++B>I)throw new Error("circular link");M=D,D=new Set}}function b({nodes:R}){const I=R.length;let M=new Set(R),D=new Set,B=0;for(;M.size;){for(const $ of M){$.height=B;for(const{source:F}of $.targetLinks)D.add(F)}if(++B>I)throw new Error("circular link");M=D,D=new Set}}function w({nodes:R}){const I=VR(R,B=>B.depth)+1,M=(r-t-i)/(I-1),D=new Array(I);for(const B of R){const $=Math.max(0,Math.min(I-1,Math.floor(l.call(null,B,I))));B.layer=$,B.x0=t+$*M,B.x1=B.x0+i,D[$]?D[$].push(B):D[$]=[B]}if(u)for(const B of D)B.sort(u);return D}function T(R){const I=nq(R,M=>(n-e-(M.length-1)*s)/O3(M,P3));for(const M of R){let D=e;for(const B of M){B.y0=D,B.y1=D+B.value*I,D=B.y1+s;for(const $ of B.sourceLinks)$.width=$.value*I}D=(n-D+s)/(M.length+1);for(let B=0;B<M.length;++B){const $=M[B];$.y0+=D*(B+1),$.y1+=D*(B+1)}O(M)}}function E(R){const I=w(R);s=Math.min(a,(n-e)/(VR(I,M=>M.length)-1)),T(I);for(let M=0;M<p;++M){const D=Math.pow(.99,M),B=Math.max(1-D,(M+1)/p);S(I,D,B),L(I,D,B)}}function L(R,I,M){for(let D=1,B=R.length;D<B;++D){const $=R[D];for(const F of $){let G=0,W=0;for(const{source:q,value:ne}of F.targetLinks){let ae=ne*(F.layer-q.layer);G+=P(q,F)*ae,W+=ae}if(!(W>0))continue;let J=(G/W-F.y0)*I;F.y0+=J,F.y1+=J,_(F)}u===void 0&&$.sort(Ay),C($,M)}}function S(R,I,M){for(let D=R.length,B=D-2;B>=0;--B){const $=R[B];for(const F of $){let G=0,W=0;for(const{target:q,value:ne}of F.sourceLinks){let ae=ne*(q.layer-F.layer);G+=k(F,q)*ae,W+=ae}if(!(W>0))continue;let J=(G/W-F.y0)*I;F.y0+=J,F.y1+=J,_(F)}u===void 0&&$.sort(Ay),C($,M)}}function C(R,I){const M=R.length>>1,D=R[M];N(R,D.y0-s,M-1,I),A(R,D.y1+s,M+1,I),N(R,n,R.length-1,I),A(R,e,0,I)}function A(R,I,M,D){for(;M<R.length;++M){const B=R[M],$=(I-B.y0)*D;$>1e-6&&(B.y0+=$,B.y1+=$),I=B.y1+s}}function N(R,I,M,D){for(;M>=0;--M){const B=R[M],$=(B.y1-I)*D;$>1e-6&&(B.y0-=$,B.y1-=$),I=B.y0-s}}function _({sourceLinks:R,targetLinks:I}){if(h===void 0){for(const{source:{sourceLinks:M}}of I)M.sort(UR);for(const{target:{targetLinks:M}}of R)M.sort(GR)}}function O(R){if(h===void 0)for(const{sourceLinks:I,targetLinks:M}of R)I.sort(UR),M.sort(GR)}function P(R,I){let M=R.y0-(R.sourceLinks.length-1)*s/2;for(const{target:D,width:B}of R.sourceLinks){if(D===I)break;M+=B+s}for(const{source:D,width:B}of I.targetLinks){if(D===R)break;M-=B}return M}function k(R,I){let M=I.y0-(I.targetLinks.length-1)*s/2;for(const{source:D,width:B}of I.targetLinks){if(D===R)break;M+=B+s}for(const{target:D,width:B}of R.sourceLinks){if(D===I)break;M-=B}return M}return g}var PT=Math.PI,BT=2*PT,Ic=1e-6,X_e=BT-Ic;function FT(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function aq(){return new FT}FT.prototype=aq.prototype={constructor:FT,moveTo:function(t,e){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)},closePath:function(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(t,e){this._+="L"+(this._x1=+t)+","+(this._y1=+e)},quadraticCurveTo:function(t,e,r,n){this._+="Q"+ +t+","+ +e+","+(this._x1=+r)+","+(this._y1=+n)},bezierCurveTo:function(t,e,r,n,i,a){this._+="C"+ +t+","+ +e+","+ +r+","+ +n+","+(this._x1=+i)+","+(this._y1=+a)},arcTo:function(t,e,r,n,i){t=+t,e=+e,r=+r,n=+n,i=+i;var a=this._x1,s=this._y1,o=r-t,l=n-e,u=a-t,h=s-e,d=u*u+h*h;if(i<0)throw new Error("negative radius: "+i);if(this._x1===null)this._+="M"+(this._x1=t)+","+(this._y1=e);else if(d>Ic)if(!(Math.abs(h*o-l*u)>Ic)||!i)this._+="L"+(this._x1=t)+","+(this._y1=e);else{var f=r-a,p=n-s,g=o*o+l*l,m=f*f+p*p,v=Math.sqrt(g),y=Math.sqrt(d),b=i*Math.tan((PT-Math.acos((g+d-m)/(2*v*y)))/2),w=b/y,T=b/v;Math.abs(w-1)>Ic&&(this._+="L"+(t+w*u)+","+(e+w*h)),this._+="A"+i+","+i+",0,0,"+ +(h*f>u*p)+","+(this._x1=t+T*o)+","+(this._y1=e+T*l)}},arc:function(t,e,r,n,i,a){t=+t,e=+e,r=+r,a=!!a;var s=r*Math.cos(n),o=r*Math.sin(n),l=t+s,u=e+o,h=1^a,d=a?n-i:i-n;if(r<0)throw new Error("negative radius: "+r);this._x1===null?this._+="M"+l+","+u:(Math.abs(this._x1-l)>Ic||Math.abs(this._y1-u)>Ic)&&(this._+="L"+l+","+u),r&&(d<0&&(d=d%BT+BT),d>X_e?this._+="A"+r+","+r+",0,1,"+h+","+(t-s)+","+(e-o)+"A"+r+","+r+",0,1,"+h+","+(this._x1=l)+","+(this._y1=u):d>Ic&&(this._+="A"+r+","+r+",0,"+ +(d>=PT)+","+h+","+(this._x1=t+r*Math.cos(i))+","+(this._y1=e+r*Math.sin(i))))},rect:function(t,e,r,n){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)+"h"+ +r+"v"+ +n+"h"+-r+"Z"},toString:function(){return this._}};function qR(t){return function(){return t}}function j_e(t){return t[0]}function K_e(t){return t[1]}var Z_e=Array.prototype.slice;function Q_e(t){return t.source}function J_e(t){return t.target}function e9e(t){var e=Q_e,r=J_e,n=j_e,i=K_e,a=null;function s(){var o,l=Z_e.call(arguments),u=e.apply(this,l),h=r.apply(this,l);if(a||(a=o=aq()),t(a,+n.apply(this,(l[0]=u,l)),+i.apply(this,l),+n.apply(this,(l[0]=h,l)),+i.apply(this,l)),o)return a=null,o+""||null}return s.source=function(o){return arguments.length?(e=o,s):e},s.target=function(o){return arguments.length?(r=o,s):r},s.x=function(o){return arguments.length?(n=typeof o=="function"?o:qR(+o),s):n},s.y=function(o){return arguments.length?(i=typeof o=="function"?o:qR(+o),s):i},s.context=function(o){return arguments.length?(a=o??null,s):a},s}function t9e(t,e,r,n,i){t.moveTo(e,r),t.bezierCurveTo(e=(e+n)/2,r,e,i,n,i)}function r9e(){return e9e(t9e)}function n9e(t){return[t.source.x1,t.y0]}function i9e(t){return[t.target.x0,t.y1]}function a9e(){return r9e().source(n9e).target(i9e)}var $T=function(){var t=x(function(o,l,u,h){for(u=u||{},h=o.length;h--;u[o[h]]=l);return u},"o"),e=[1,9],r=[1,10],n=[1,5,10,12],i={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SANKEY:4,NEWLINE:5,csv:6,opt_eof:7,record:8,csv_tail:9,EOF:10,"field[source]":11,COMMA:12,"field[target]":13,"field[value]":14,field:15,escaped:16,non_escaped:17,DQUOTE:18,ESCAPED_TEXT:19,NON_ESCAPED_TEXT:20,$accept:0,$end:1},terminals_:{2:"error",4:"SANKEY",5:"NEWLINE",10:"EOF",11:"field[source]",12:"COMMA",13:"field[target]",14:"field[value]",18:"DQUOTE",19:"ESCAPED_TEXT",20:"NON_ESCAPED_TEXT"},productions_:[0,[3,4],[6,2],[9,2],[9,0],[7,1],[7,0],[8,5],[15,1],[15,1],[16,3],[17,1]],performAction:x(function(l,u,h,d,f,p,g){var m=p.length-1;switch(f){case 7:const v=d.findOrCreateNode(p[m-4].trim().replaceAll('""','"')),y=d.findOrCreateNode(p[m-2].trim().replaceAll('""','"')),b=parseFloat(p[m].trim());d.addLink(v,y,b);break;case 8:case 9:case 11:this.$=p[m];break;case 10:this.$=p[m-1];break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},{5:[1,3]},{6:4,8:5,15:6,16:7,17:8,18:e,20:r},{1:[2,6],7:11,10:[1,12]},t(r,[2,4],{9:13,5:[1,14]}),{12:[1,15]},t(n,[2,8]),t(n,[2,9]),{19:[1,16]},t(n,[2,11]),{1:[2,1]},{1:[2,5]},t(r,[2,2]),{6:17,8:5,15:6,16:7,17:8,18:e,20:r},{15:18,16:7,17:8,18:e,20:r},{18:[1,19]},t(r,[2,3]),{12:[1,20]},t(n,[2,10]),{15:21,16:7,17:8,18:e,20:r},t([1,5,10],[2,7])],defaultActions:{11:[2,1],12:[2,5]},parseError:x(function(l,u){if(u.recoverable)this.trace(l);else{var h=new Error(l);throw h.hash=u,h}},"parseError"),parse:x(function(l){var u=this,h=[0],d=[],f=[null],p=[],g=this.table,m="",v=0,y=0,b=2,w=1,T=p.slice.call(arguments,1),E=Object.create(this.lexer),L={yy:{}};for(var S in this.yy)Object.prototype.hasOwnProperty.call(this.yy,S)&&(L.yy[S]=this.yy[S]);E.setInput(l,L.yy),L.yy.lexer=E,L.yy.parser=this,typeof E.yylloc>"u"&&(E.yylloc={});var C=E.yylloc;p.push(C);var A=E.options&&E.options.ranges;typeof L.yy.parseError=="function"?this.parseError=L.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function N(G){h.length=h.length-2*G,f.length=f.length-G,p.length=p.length-G}x(N,"popStack");function _(){var G;return G=d.pop()||E.lex()||w,typeof G!="number"&&(G instanceof Array&&(d=G,G=d.pop()),G=u.symbols_[G]||G),G}x(_,"lex");for(var O,P,k,R,I={},M,D,B,$;;){if(P=h[h.length-1],this.defaultActions[P]?k=this.defaultActions[P]:((O===null||typeof O>"u")&&(O=_()),k=g[P]&&g[P][O]),typeof k>"u"||!k.length||!k[0]){var F="";$=[];for(M in g[P])this.terminals_[M]&&M>b&&$.push("'"+this.terminals_[M]+"'");E.showPosition?F="Parse error on line "+(v+1)+`:
`+E.showPosition()+`
Expecting `+$.join(", ")+", got '"+(this.terminals_[O]||O)+"'":F="Parse error on line "+(v+1)+": Unexpected "+(O==w?"end of input":"'"+(this.terminals_[O]||O)+"'"),this.parseError(F,{text:E.match,token:this.terminals_[O]||O,line:E.yylineno,loc:C,expected:$})}if(k[0]instanceof Array&&k.length>1)throw new Error("Parse Error: multiple actions possible at state: "+P+", token: "+O);switch(k[0]){case 1:h.push(O),f.push(E.yytext),p.push(E.yylloc),h.push(k[1]),O=null,y=E.yyleng,m=E.yytext,v=E.yylineno,C=E.yylloc;break;case 2:if(D=this.productions_[k[1]][1],I.$=f[f.length-D],I._$={first_line:p[p.length-(D||1)].first_line,last_line:p[p.length-1].last_line,first_column:p[p.length-(D||1)].first_column,last_column:p[p.length-1].last_column},A&&(I._$.range=[p[p.length-(D||1)].range[0],p[p.length-1].range[1]]),R=this.performAction.apply(I,[m,y,v,L.yy,k[1],f,p].concat(T)),typeof R<"u")return R;D&&(h=h.slice(0,-1*D*2),f=f.slice(0,-1*D),p=p.slice(0,-1*D)),h.push(this.productions_[k[1]][0]),f.push(I.$),p.push(I._$),B=g[h[h.length-2]][h[h.length-1]],h.push(B);break;case 3:return!0}}return!0},"parse")},a=function(){var o={EOF:1,parseError:x(function(u,h){if(this.yy.parser)this.yy.parser.parseError(u,h);else throw new Error(u)},"parseError"),setInput:x(function(l,u){return this.yy=u||this.yy||{},this._input=l,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:x(function(){var l=this._input[0];this.yytext+=l,this.yyleng++,this.offset++,this.match+=l,this.matched+=l;var u=l.match(/(?:\r\n?|\n).*/g);return u?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),l},"input"),unput:x(function(l){var u=l.length,h=l.split(/(?:\r\n?|\n)/g);this._input=l+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-u),this.offset-=u;var d=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),h.length-1&&(this.yylineno-=h.length-1);var f=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:h?(h.length===d.length?this.yylloc.first_column:0)+d[d.length-h.length].length-h[0].length:this.yylloc.first_column-u},this.options.ranges&&(this.yylloc.range=[f[0],f[0]+this.yyleng-u]),this.yyleng=this.yytext.length,this},"unput"),more:x(function(){return this._more=!0,this},"more"),reject:x(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:x(function(l){this.unput(this.match.slice(l))},"less"),pastInput:x(function(){var l=this.matched.substr(0,this.matched.length-this.match.length);return(l.length>20?"...":"")+l.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:x(function(){var l=this.match;return l.length<20&&(l+=this._input.substr(0,20-l.length)),(l.substr(0,20)+(l.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:x(function(){var l=this.pastInput(),u=new Array(l.length+1).join("-");return l+this.upcomingInput()+`
`+u+"^"},"showPosition"),test_match:x(function(l,u){var h,d,f;if(this.options.backtrack_lexer&&(f={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(f.yylloc.range=this.yylloc.range.slice(0))),d=l[0].match(/(?:\r\n?|\n).*/g),d&&(this.yylineno+=d.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:d?d[d.length-1].length-d[d.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+l[0].length},this.yytext+=l[0],this.match+=l[0],this.matches=l,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(l[0].length),this.matched+=l[0],h=this.performAction.call(this,this.yy,this,u,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),h)return h;if(this._backtrack){for(var p in f)this[p]=f[p];return!1}return!1},"test_match"),next:x(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var l,u,h,d;this._more||(this.yytext="",this.match="");for(var f=this._currentRules(),p=0;p<f.length;p++)if(h=this._input.match(this.rules[f[p]]),h&&(!u||h[0].length>u[0].length)){if(u=h,d=p,this.options.backtrack_lexer){if(l=this.test_match(h,f[p]),l!==!1)return l;if(this._backtrack){u=!1;continue}else return!1}else if(!this.options.flex)break}return u?(l=this.test_match(u,f[d]),l!==!1?l:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var u=this.next();return u||this.lex()},"lex"),begin:x(function(u){this.conditionStack.push(u)},"begin"),popState:x(function(){var u=this.conditionStack.length-1;return u>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(u){return u=this.conditionStack.length-1-Math.abs(u||0),u>=0?this.conditionStack[u]:"INITIAL"},"topState"),pushState:x(function(u){this.begin(u)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:x(function(u,h,d,f){switch(d){case 0:return this.pushState("csv"),4;case 1:return this.pushState("csv"),4;case 2:return 10;case 3:return 5;case 4:return 12;case 5:return this.pushState("escaped_text"),18;case 6:return 20;case 7:return this.popState("escaped_text"),18;case 8:return 19}},"anonymous"),rules:[/^(?:sankey-beta\b)/i,/^(?:sankey\b)/i,/^(?:$)/i,/^(?:((\u000D\u000A)|(\u000A)))/i,/^(?:(\u002C))/i,/^(?:(\u0022))/i,/^(?:([\u0020-\u0021\u0023-\u002B\u002D-\u007E])*)/i,/^(?:(\u0022)(?!(\u0022)))/i,/^(?:(([\u0020-\u0021\u0023-\u002B\u002D-\u007E])|(\u002C)|(\u000D)|(\u000A)|(\u0022)(\u0022))*)/i],conditions:{csv:{rules:[2,3,4,5,6,7,8],inclusive:!1},escaped_text:{rules:[7,8],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8],inclusive:!0}}};return o}();i.lexer=a;function s(){this.yy={}}return x(s,"Parser"),s.prototype=i,i.Parser=s,new s}();$T.parser=$T;var _y=$T,mx=[],vx=[],Ly=new Map,s9e=x(()=>{mx=[],vx=[],Ly=new Map,An()},"clear"),o9e=class{constructor(t,e,r=0){this.source=t,this.target=e,this.value=r}static{x(this,"SankeyLink")}},l9e=x((t,e,r)=>{mx.push(new o9e(t,e,r))},"addLink"),c9e=class{constructor(t){this.ID=t}static{x(this,"SankeyNode")}},u9e=x(t=>{t=at.sanitizeText(t,we());let e=Ly.get(t);return e===void 0&&(e=new c9e(t),Ly.set(t,e),vx.push(e)),e},"findOrCreateNode"),h9e=x(()=>vx,"getNodes"),d9e=x(()=>mx,"getLinks"),f9e=x(()=>({nodes:vx.map(t=>({id:t.ID})),links:mx.map(t=>({source:t.source.ID,target:t.target.ID,value:t.value}))}),"getGraph"),p9e={nodesMap:Ly,getConfig:x(()=>we().sankey,"getConfig"),getNodes:h9e,getLinks:d9e,getGraph:f9e,addLink:l9e,findOrCreateNode:u9e,getAccTitle:zn,setAccTitle:Sn,getAccDescription:Gn,setAccDescription:Vn,getDiagramTitle:_n,setDiagramTitle:Zn,clear:s9e},YR=class zT{static{x(this,"Uid")}static{this.count=0}static next(e){return new zT(e+ ++zT.count)}constructor(e){this.id=e,this.href=`#${e}`}toString(){return"url("+this.href+")"}},g9e={left:V_e,right:G_e,center:U_e,justify:iq},m9e=x(function(t,e,r,n){const{securityLevel:i,sankey:a}=we(),s=_N.sankey;let o;i==="sandbox"&&(o=Qe("#i"+e));const l=Qe(i==="sandbox"?o.nodes()[0].contentDocument.body:"body"),u=i==="sandbox"?l.select(`[id="${e}"]`):Qe(`[id="${e}"]`),h=a?.width??s.width,d=a?.height??s.width,f=a?.useMaxWidth??s.useMaxWidth,p=a?.nodeAlignment??s.nodeAlignment,g=a?.prefix??s.prefix,m=a?.suffix??s.suffix,v=a?.showValues??s.showValues,y=n.db.getGraph(),b=g9e[p];Y_e().nodeId(N=>N.id).nodeWidth(10).nodePadding(10+(v?15:0)).nodeAlign(b).extent([[0,0],[h,d]])(y);const E=Zc(Tee);u.append("g").attr("class","nodes").selectAll(".node").data(y.nodes).join("g").attr("class","node").attr("id",N=>(N.uid=YR.next("node-")).id).attr("transform",function(N){return"translate("+N.x0+","+N.y0+")"}).attr("x",N=>N.x0).attr("y",N=>N.y0).append("rect").attr("height",N=>N.y1-N.y0).attr("width",N=>N.x1-N.x0).attr("fill",N=>E(N.id));const L=x(({id:N,value:_})=>v?`${N}
${g}${Math.round(_*100)/100}${m}`:N,"getText");u.append("g").attr("class","node-labels").attr("font-size",14).selectAll("text").data(y.nodes).join("text").attr("x",N=>N.x0<h/2?N.x1+6:N.x0-6).attr("y",N=>(N.y1+N.y0)/2).attr("dy",`${v?"0":"0.35"}em`).attr("text-anchor",N=>N.x0<h/2?"start":"end").text(L);const S=u.append("g").attr("class","links").attr("fill","none").attr("stroke-opacity",.5).selectAll(".link").data(y.links).join("g").attr("class","link").style("mix-blend-mode","multiply"),C=a?.linkColor??"gradient";if(C==="gradient"){const N=S.append("linearGradient").attr("id",_=>(_.uid=YR.next("linearGradient-")).id).attr("gradientUnits","userSpaceOnUse").attr("x1",_=>_.source.x1).attr("x2",_=>_.target.x0);N.append("stop").attr("offset","0%").attr("stop-color",_=>E(_.source.id)),N.append("stop").attr("offset","100%").attr("stop-color",_=>E(_.target.id))}let A;switch(C){case"gradient":A=x(N=>N.uid,"coloring");break;case"source":A=x(N=>E(N.source.id),"coloring");break;case"target":A=x(N=>E(N.target.id),"coloring");break;default:A=C}S.append("path").attr("d",a9e()).attr("stroke",A).attr("stroke-width",N=>Math.max(1,N.width)),_p(void 0,u,0,f)},"draw"),v9e={draw:m9e},y9e=x(t=>t.replaceAll(/^[^\S\n\r]+|[^\S\n\r]+$/g,"").replaceAll(/([\n\r])+/g,`
`).trim(),"prepareTextForParsing"),x9e=x(t=>`.label {
      font-family: ${t.fontFamily};
    }`,"getStyles"),b9e=x9e,w9e=_y.parse.bind(_y);_y.parse=t=>w9e(y9e(t));var T9e={styles:b9e,parser:_y,db:p9e,renderer:v9e};const E9e=Object.freeze(Object.defineProperty({__proto__:null,diagram:T9e},Symbol.toStringTag,{value:"Module"}));var k9e=hr.packet,sq=class{constructor(){this.packet=[],this.setAccTitle=Sn,this.getAccTitle=zn,this.setDiagramTitle=Zn,this.getDiagramTitle=_n,this.getAccDescription=Gn,this.setAccDescription=Vn}static{x(this,"PacketDB")}getConfig(){const t=Hi({...k9e,...gr().packet});return t.showBits&&(t.paddingY+=10),t}getPacket(){return this.packet}pushWord(t){t.length>0&&this.packet.push(t)}clear(){An(),this.packet=[]}},S9e=1e4,C9e=x((t,e)=>{Fu(t,e);let r=-1,n=[],i=1;const{bitsPerRow:a}=e.getConfig();for(let{start:s,end:o,bits:l,label:u}of t.blocks){if(s!==void 0&&o!==void 0&&o<s)throw new Error(`Packet block ${s} - ${o} is invalid. End must be greater than start.`);if(s??=r+1,s!==r+1)throw new Error(`Packet block ${s} - ${o??s} is not contiguous. It should start from ${r+1}.`);if(l===0)throw new Error(`Packet block ${s} is invalid. Cannot have a zero bit field.`);for(o??=s+(l??1)-1,l??=o-s+1,r=o,ie.debug(`Packet block ${s} - ${r} with label ${u}`);n.length<=a+1&&e.getPacket().length<S9e;){const[h,d]=A9e({start:s,end:o,bits:l,label:u},i,a);if(n.push(h),h.end+1===i*a&&(e.pushWord(n),n=[],i++),!d)break;({start:s,end:o,bits:l,label:u}=d)}}e.pushWord(n)},"populate"),A9e=x((t,e,r)=>{if(t.start===void 0)throw new Error("start should have been set during first phase");if(t.end===void 0)throw new Error("end should have been set during first phase");if(t.start>t.end)throw new Error(`Block start ${t.start} is greater than block end ${t.end}.`);if(t.end+1<=e*r)return[t,void 0];const n=e*r-1,i=e*r;return[{start:t.start,end:n,label:t.label,bits:n-t.start},{start:i,end:t.end,label:t.label,bits:t.end-i}]},"getNextFittingBlock"),oq={parser:{yy:void 0},parse:x(async t=>{const e=await vc("packet",t),r=oq.parser?.yy;if(!(r instanceof sq))throw new Error("parser.parser?.yy was not a PacketDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");ie.debug(e),C9e(e,r)},"parse")},_9e=x((t,e,r,n)=>{const i=n.db,a=i.getConfig(),{rowHeight:s,paddingY:o,bitWidth:l,bitsPerRow:u}=a,h=i.getPacket(),d=i.getDiagramTitle(),f=s+o,p=f*(h.length+1)-(d?0:s),g=l*u+2,m=el(e);m.attr("viewbox",`0 0 ${g} ${p}`),ji(m,p,g,a.useMaxWidth);for(const[v,y]of h.entries())L9e(m,y,v,a);m.append("text").text(d).attr("x",g/2).attr("y",p-f/2).attr("dominant-baseline","middle").attr("text-anchor","middle").attr("class","packetTitle")},"draw"),L9e=x((t,e,r,{rowHeight:n,paddingX:i,paddingY:a,bitWidth:s,bitsPerRow:o,showBits:l})=>{const u=t.append("g"),h=r*(n+a)+a;for(const d of e){const f=d.start%o*s+1,p=(d.end-d.start+1)*s-i;if(u.append("rect").attr("x",f).attr("y",h).attr("width",p).attr("height",n).attr("class","packetBlock"),u.append("text").attr("x",f+p/2).attr("y",h+n/2).attr("class","packetLabel").attr("dominant-baseline","middle").attr("text-anchor","middle").text(d.label),!l)continue;const g=d.end===d.start,m=h-2;u.append("text").attr("x",f+(g?p/2:0)).attr("y",m).attr("class","packetByte start").attr("dominant-baseline","auto").attr("text-anchor",g?"middle":"start").text(d.start),g||u.append("text").attr("x",f+p).attr("y",m).attr("class","packetByte end").attr("dominant-baseline","auto").attr("text-anchor","end").text(d.end)}},"drawWord"),R9e={draw:_9e},N9e={byteFontSize:"10px",startByteColor:"black",endByteColor:"black",labelColor:"black",labelFontSize:"12px",titleColor:"black",titleFontSize:"14px",blockStrokeColor:"black",blockStrokeWidth:"1",blockFillColor:"#efefef"},D9e=x(({packet:t}={})=>{const e=Hi(N9e,t);return`
	.packetByte {
		font-size: ${e.byteFontSize};
	}
	.packetByte.start {
		fill: ${e.startByteColor};
	}
	.packetByte.end {
		fill: ${e.endByteColor};
	}
	.packetLabel {
		fill: ${e.labelColor};
		font-size: ${e.labelFontSize};
	}
	.packetTitle {
		fill: ${e.titleColor};
		font-size: ${e.titleFontSize};
	}
	.packetBlock {
		stroke: ${e.blockStrokeColor};
		stroke-width: ${e.blockStrokeWidth};
		fill: ${e.blockFillColor};
	}
	`},"styles"),M9e={parser:oq,get db(){return new sq},renderer:R9e,styles:D9e};const I9e=Object.freeze(Object.defineProperty({__proto__:null,diagram:M9e},Symbol.toStringTag,{value:"Module"}));var ph={showLegend:!0,ticks:5,max:null,min:0,graticule:"circle"},lq={axes:[],curves:[],options:ph},Hu=structuredClone(lq),O9e=hr.radar,P9e=x(()=>Hi({...O9e,...gr().radar}),"getConfig"),cq=x(()=>Hu.axes,"getAxes"),B9e=x(()=>Hu.curves,"getCurves"),F9e=x(()=>Hu.options,"getOptions"),$9e=x(t=>{Hu.axes=t.map(e=>({name:e.name,label:e.label??e.name}))},"setAxes"),z9e=x(t=>{Hu.curves=t.map(e=>({name:e.name,label:e.label??e.name,entries:V9e(e.entries)}))},"setCurves"),V9e=x(t=>{if(t[0].axis==null)return t.map(r=>r.value);const e=cq();if(e.length===0)throw new Error("Axes must be populated before curves for reference entries");return e.map(r=>{const n=t.find(i=>i.axis?.$refText===r.name);if(n===void 0)throw new Error("Missing entry for axis "+r.label);return n.value})},"computeCurveEntries"),G9e=x(t=>{const e=t.reduce((r,n)=>(r[n.name]=n,r),{});Hu.options={showLegend:e.showLegend?.value??ph.showLegend,ticks:e.ticks?.value??ph.ticks,max:e.max?.value??ph.max,min:e.min?.value??ph.min,graticule:e.graticule?.value??ph.graticule}},"setOptions"),U9e=x(()=>{An(),Hu=structuredClone(lq)},"clear"),m0={getAxes:cq,getCurves:B9e,getOptions:F9e,setAxes:$9e,setCurves:z9e,setOptions:G9e,getConfig:P9e,clear:U9e,setAccTitle:Sn,getAccTitle:zn,setDiagramTitle:Zn,getDiagramTitle:_n,getAccDescription:Gn,setAccDescription:Vn},W9e=x(t=>{Fu(t,m0);const{axes:e,curves:r,options:n}=t;m0.setAxes(e),m0.setCurves(r),m0.setOptions(n)},"populate"),H9e={parse:x(async t=>{const e=await vc("radar",t);ie.debug(e),W9e(e)},"parse")},q9e=x((t,e,r,n)=>{const i=n.db,a=i.getAxes(),s=i.getCurves(),o=i.getOptions(),l=i.getConfig(),u=i.getDiagramTitle(),h=el(e),d=Y9e(h,l),f=o.max??Math.max(...s.map(m=>Math.max(...m.entries))),p=o.min,g=Math.min(l.width,l.height)/2;X9e(d,a,g,o.ticks,o.graticule),j9e(d,a,g,l),uq(d,a,s,p,f,o.graticule,l),fq(d,s,o.showLegend,l),d.append("text").attr("class","radarTitle").text(u).attr("x",0).attr("y",-l.height/2-l.marginTop)},"draw"),Y9e=x((t,e)=>{const r=e.width+e.marginLeft+e.marginRight,n=e.height+e.marginTop+e.marginBottom,i={x:e.marginLeft+e.width/2,y:e.marginTop+e.height/2};return t.attr("viewbox",`0 0 ${r} ${n}`).attr("width",r).attr("height",n),t.append("g").attr("transform",`translate(${i.x}, ${i.y})`)},"drawFrame"),X9e=x((t,e,r,n,i)=>{if(i==="circle")for(let a=0;a<n;a++){const s=r*(a+1)/n;t.append("circle").attr("r",s).attr("class","radarGraticule")}else if(i==="polygon"){const a=e.length;for(let s=0;s<n;s++){const o=r*(s+1)/n,l=e.map((u,h)=>{const d=2*h*Math.PI/a-Math.PI/2,f=o*Math.cos(d),p=o*Math.sin(d);return`${f},${p}`}).join(" ");t.append("polygon").attr("points",l).attr("class","radarGraticule")}}},"drawGraticule"),j9e=x((t,e,r,n)=>{const i=e.length;for(let a=0;a<i;a++){const s=e[a].label,o=2*a*Math.PI/i-Math.PI/2;t.append("line").attr("x1",0).attr("y1",0).attr("x2",r*n.axisScaleFactor*Math.cos(o)).attr("y2",r*n.axisScaleFactor*Math.sin(o)).attr("class","radarAxisLine"),t.append("text").text(s).attr("x",r*n.axisLabelFactor*Math.cos(o)).attr("y",r*n.axisLabelFactor*Math.sin(o)).attr("class","radarAxisLabel")}},"drawAxes");function uq(t,e,r,n,i,a,s){const o=e.length,l=Math.min(s.width,s.height)/2;r.forEach((u,h)=>{if(u.entries.length!==o)return;const d=u.entries.map((f,p)=>{const g=2*Math.PI*p/o-Math.PI/2,m=hq(f,n,i,l),v=m*Math.cos(g),y=m*Math.sin(g);return{x:v,y}});a==="circle"?t.append("path").attr("d",dq(d,s.curveTension)).attr("class",`radarCurve-${h}`):a==="polygon"&&t.append("polygon").attr("points",d.map(f=>`${f.x},${f.y}`).join(" ")).attr("class",`radarCurve-${h}`)})}x(uq,"drawCurves");function hq(t,e,r,n){const i=Math.min(Math.max(t,e),r);return n*(i-e)/(r-e)}x(hq,"relativeRadius");function dq(t,e){const r=t.length;let n=`M${t[0].x},${t[0].y}`;for(let i=0;i<r;i++){const a=t[(i-1+r)%r],s=t[i],o=t[(i+1)%r],l=t[(i+2)%r],u={x:s.x+(o.x-a.x)*e,y:s.y+(o.y-a.y)*e},h={x:o.x-(l.x-s.x)*e,y:o.y-(l.y-s.y)*e};n+=` C${u.x},${u.y} ${h.x},${h.y} ${o.x},${o.y}`}return`${n} Z`}x(dq,"closedRoundCurve");function fq(t,e,r,n){if(!r)return;const i=(n.width/2+n.marginRight)*3/4,a=-(n.height/2+n.marginTop)*3/4,s=20;e.forEach((o,l)=>{const u=t.append("g").attr("transform",`translate(${i}, ${a+l*s})`);u.append("rect").attr("width",12).attr("height",12).attr("class",`radarLegendBox-${l}`),u.append("text").attr("x",16).attr("y",0).attr("class","radarLegendText").text(o.label)})}x(fq,"drawLegend");var K9e={draw:q9e},Z9e=x((t,e)=>{let r="";for(let n=0;n<t.THEME_COLOR_LIMIT;n++){const i=t[`cScale${n}`];r+=`
		.radarCurve-${n} {
			color: ${i};
			fill: ${i};
			fill-opacity: ${e.curveOpacity};
			stroke: ${i};
			stroke-width: ${e.curveStrokeWidth};
		}
		.radarLegendBox-${n} {
			fill: ${i};
			fill-opacity: ${e.curveOpacity};
			stroke: ${i};
		}
		`}return r},"genIndexStyles"),Q9e=x(t=>{const e=Py(),r=gr(),n=Hi(e,r.themeVariables),i=Hi(n.radar,t);return{themeVariables:n,radarOptions:i}},"buildRadarStyleOptions"),J9e=x(({radar:t}={})=>{const{themeVariables:e,radarOptions:r}=Q9e(t);return`
	.radarTitle {
		font-size: ${e.fontSize};
		color: ${e.titleColor};
		dominant-baseline: hanging;
		text-anchor: middle;
	}
	.radarAxisLine {
		stroke: ${r.axisColor};
		stroke-width: ${r.axisStrokeWidth};
	}
	.radarAxisLabel {
		dominant-baseline: middle;
		text-anchor: middle;
		font-size: ${r.axisLabelFontSize}px;
		color: ${r.axisColor};
	}
	.radarGraticule {
		fill: ${r.graticuleColor};
		fill-opacity: ${r.graticuleOpacity};
		stroke: ${r.graticuleColor};
		stroke-width: ${r.graticuleStrokeWidth};
	}
	.radarLegendText {
		text-anchor: start;
		font-size: ${r.legendFontSize}px;
		dominant-baseline: hanging;
	}
	${Z9e(e,r)}
	`},"styles"),eLe={parser:H9e,db:m0,renderer:K9e,styles:J9e};const tLe=Object.freeze(Object.defineProperty({__proto__:null,diagram:eLe},Symbol.toStringTag,{value:"Module"}));var VT=function(){var t=x(function(w,T,E,L){for(E=E||{},L=w.length;L--;E[w[L]]=T);return E},"o"),e=[1,15],r=[1,7],n=[1,13],i=[1,14],a=[1,19],s=[1,16],o=[1,17],l=[1,18],u=[8,30],h=[8,10,21,28,29,30,31,39,43,46],d=[1,23],f=[1,24],p=[8,10,15,16,21,28,29,30,31,39,43,46],g=[8,10,15,16,21,27,28,29,30,31,39,43,46],m=[1,49],v={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,spaceLines:3,SPACELINE:4,NL:5,separator:6,SPACE:7,EOF:8,start:9,BLOCK_DIAGRAM_KEY:10,document:11,stop:12,statement:13,link:14,LINK:15,START_LINK:16,LINK_LABEL:17,STR:18,nodeStatement:19,columnsStatement:20,SPACE_BLOCK:21,blockStatement:22,classDefStatement:23,cssClassStatement:24,styleStatement:25,node:26,SIZE:27,COLUMNS:28,"id-block":29,end:30,NODE_ID:31,nodeShapeNLabel:32,dirList:33,DIR:34,NODE_DSTART:35,NODE_DEND:36,BLOCK_ARROW_START:37,BLOCK_ARROW_END:38,classDef:39,CLASSDEF_ID:40,CLASSDEF_STYLEOPTS:41,DEFAULT:42,class:43,CLASSENTITY_IDS:44,STYLECLASS:45,style:46,STYLE_ENTITY_IDS:47,STYLE_DEFINITION_DATA:48,$accept:0,$end:1},terminals_:{2:"error",4:"SPACELINE",5:"NL",7:"SPACE",8:"EOF",10:"BLOCK_DIAGRAM_KEY",15:"LINK",16:"START_LINK",17:"LINK_LABEL",18:"STR",21:"SPACE_BLOCK",27:"SIZE",28:"COLUMNS",29:"id-block",30:"end",31:"NODE_ID",34:"DIR",35:"NODE_DSTART",36:"NODE_DEND",37:"BLOCK_ARROW_START",38:"BLOCK_ARROW_END",39:"classDef",40:"CLASSDEF_ID",41:"CLASSDEF_STYLEOPTS",42:"DEFAULT",43:"class",44:"CLASSENTITY_IDS",45:"STYLECLASS",46:"style",47:"STYLE_ENTITY_IDS",48:"STYLE_DEFINITION_DATA"},productions_:[0,[3,1],[3,2],[3,2],[6,1],[6,1],[6,1],[9,3],[12,1],[12,1],[12,2],[12,2],[11,1],[11,2],[14,1],[14,4],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[19,3],[19,2],[19,1],[20,1],[22,4],[22,3],[26,1],[26,2],[33,1],[33,2],[32,3],[32,4],[23,3],[23,3],[24,3],[25,3]],performAction:x(function(T,E,L,S,C,A,N){var _=A.length-1;switch(C){case 4:S.getLogger().debug("Rule: separator (NL) ");break;case 5:S.getLogger().debug("Rule: separator (Space) ");break;case 6:S.getLogger().debug("Rule: separator (EOF) ");break;case 7:S.getLogger().debug("Rule: hierarchy: ",A[_-1]),S.setHierarchy(A[_-1]);break;case 8:S.getLogger().debug("Stop NL ");break;case 9:S.getLogger().debug("Stop EOF ");break;case 10:S.getLogger().debug("Stop NL2 ");break;case 11:S.getLogger().debug("Stop EOF2 ");break;case 12:S.getLogger().debug("Rule: statement: ",A[_]),typeof A[_].length=="number"?this.$=A[_]:this.$=[A[_]];break;case 13:S.getLogger().debug("Rule: statement #2: ",A[_-1]),this.$=[A[_-1]].concat(A[_]);break;case 14:S.getLogger().debug("Rule: link: ",A[_],T),this.$={edgeTypeStr:A[_],label:""};break;case 15:S.getLogger().debug("Rule: LABEL link: ",A[_-3],A[_-1],A[_]),this.$={edgeTypeStr:A[_],label:A[_-1]};break;case 18:const O=parseInt(A[_]),P=S.generateId();this.$={id:P,type:"space",label:"",width:O,children:[]};break;case 23:S.getLogger().debug("Rule: (nodeStatement link node) ",A[_-2],A[_-1],A[_]," typestr: ",A[_-1].edgeTypeStr);const k=S.edgeStrToEdgeData(A[_-1].edgeTypeStr);this.$=[{id:A[_-2].id,label:A[_-2].label,type:A[_-2].type,directions:A[_-2].directions},{id:A[_-2].id+"-"+A[_].id,start:A[_-2].id,end:A[_].id,label:A[_-1].label,type:"edge",directions:A[_].directions,arrowTypeEnd:k,arrowTypeStart:"arrow_open"},{id:A[_].id,label:A[_].label,type:S.typeStr2Type(A[_].typeStr),directions:A[_].directions}];break;case 24:S.getLogger().debug("Rule: nodeStatement (abc88 node size) ",A[_-1],A[_]),this.$={id:A[_-1].id,label:A[_-1].label,type:S.typeStr2Type(A[_-1].typeStr),directions:A[_-1].directions,widthInColumns:parseInt(A[_],10)};break;case 25:S.getLogger().debug("Rule: nodeStatement (node) ",A[_]),this.$={id:A[_].id,label:A[_].label,type:S.typeStr2Type(A[_].typeStr),directions:A[_].directions,widthInColumns:1};break;case 26:S.getLogger().debug("APA123",this?this:"na"),S.getLogger().debug("COLUMNS: ",A[_]),this.$={type:"column-setting",columns:A[_]==="auto"?-1:parseInt(A[_])};break;case 27:S.getLogger().debug("Rule: id-block statement : ",A[_-2],A[_-1]),S.generateId(),this.$={...A[_-2],type:"composite",children:A[_-1]};break;case 28:S.getLogger().debug("Rule: blockStatement : ",A[_-2],A[_-1],A[_]);const R=S.generateId();this.$={id:R,type:"composite",label:"",children:A[_-1]};break;case 29:S.getLogger().debug("Rule: node (NODE_ID separator): ",A[_]),this.$={id:A[_]};break;case 30:S.getLogger().debug("Rule: node (NODE_ID nodeShapeNLabel separator): ",A[_-1],A[_]),this.$={id:A[_-1],label:A[_].label,typeStr:A[_].typeStr,directions:A[_].directions};break;case 31:S.getLogger().debug("Rule: dirList: ",A[_]),this.$=[A[_]];break;case 32:S.getLogger().debug("Rule: dirList: ",A[_-1],A[_]),this.$=[A[_-1]].concat(A[_]);break;case 33:S.getLogger().debug("Rule: nodeShapeNLabel: ",A[_-2],A[_-1],A[_]),this.$={typeStr:A[_-2]+A[_],label:A[_-1]};break;case 34:S.getLogger().debug("Rule: BLOCK_ARROW nodeShapeNLabel: ",A[_-3],A[_-2]," #3:",A[_-1],A[_]),this.$={typeStr:A[_-3]+A[_],label:A[_-2],directions:A[_-1]};break;case 35:case 36:this.$={type:"classDef",id:A[_-1].trim(),css:A[_].trim()};break;case 37:this.$={type:"applyClass",id:A[_-1].trim(),styleClass:A[_].trim()};break;case 38:this.$={type:"applyStyles",id:A[_-1].trim(),stylesStr:A[_].trim()};break}},"anonymous"),table:[{9:1,10:[1,2]},{1:[3]},{10:e,11:3,13:4,19:5,20:6,21:r,22:8,23:9,24:10,25:11,26:12,28:n,29:i,31:a,39:s,43:o,46:l},{8:[1,20]},t(u,[2,12],{13:4,19:5,20:6,22:8,23:9,24:10,25:11,26:12,11:21,10:e,21:r,28:n,29:i,31:a,39:s,43:o,46:l}),t(h,[2,16],{14:22,15:d,16:f}),t(h,[2,17]),t(h,[2,18]),t(h,[2,19]),t(h,[2,20]),t(h,[2,21]),t(h,[2,22]),t(p,[2,25],{27:[1,25]}),t(h,[2,26]),{19:26,26:12,31:a},{10:e,11:27,13:4,19:5,20:6,21:r,22:8,23:9,24:10,25:11,26:12,28:n,29:i,31:a,39:s,43:o,46:l},{40:[1,28],42:[1,29]},{44:[1,30]},{47:[1,31]},t(g,[2,29],{32:32,35:[1,33],37:[1,34]}),{1:[2,7]},t(u,[2,13]),{26:35,31:a},{31:[2,14]},{17:[1,36]},t(p,[2,24]),{10:e,11:37,13:4,14:22,15:d,16:f,19:5,20:6,21:r,22:8,23:9,24:10,25:11,26:12,28:n,29:i,31:a,39:s,43:o,46:l},{30:[1,38]},{41:[1,39]},{41:[1,40]},{45:[1,41]},{48:[1,42]},t(g,[2,30]),{18:[1,43]},{18:[1,44]},t(p,[2,23]),{18:[1,45]},{30:[1,46]},t(h,[2,28]),t(h,[2,35]),t(h,[2,36]),t(h,[2,37]),t(h,[2,38]),{36:[1,47]},{33:48,34:m},{15:[1,50]},t(h,[2,27]),t(g,[2,33]),{38:[1,51]},{33:52,34:m,38:[2,31]},{31:[2,15]},t(g,[2,34]),{38:[2,32]}],defaultActions:{20:[2,7],23:[2,14],50:[2,15],52:[2,32]},parseError:x(function(T,E){if(E.recoverable)this.trace(T);else{var L=new Error(T);throw L.hash=E,L}},"parseError"),parse:x(function(T){var E=this,L=[0],S=[],C=[null],A=[],N=this.table,_="",O=0,P=0,k=2,R=1,I=A.slice.call(arguments,1),M=Object.create(this.lexer),D={yy:{}};for(var B in this.yy)Object.prototype.hasOwnProperty.call(this.yy,B)&&(D.yy[B]=this.yy[B]);M.setInput(T,D.yy),D.yy.lexer=M,D.yy.parser=this,typeof M.yylloc>"u"&&(M.yylloc={});var $=M.yylloc;A.push($);var F=M.options&&M.options.ranges;typeof D.yy.parseError=="function"?this.parseError=D.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function G(j){L.length=L.length-2*j,C.length=C.length-j,A.length=A.length-j}x(G,"popStack");function W(){var j;return j=S.pop()||M.lex()||R,typeof j!="number"&&(j instanceof Array&&(S=j,j=S.pop()),j=E.symbols_[j]||j),j}x(W,"lex");for(var J,q,ne,ae,pe={},K,Z,X,Y;;){if(q=L[L.length-1],this.defaultActions[q]?ne=this.defaultActions[q]:((J===null||typeof J>"u")&&(J=W()),ne=N[q]&&N[q][J]),typeof ne>"u"||!ne.length||!ne[0]){var ee="";Y=[];for(K in N[q])this.terminals_[K]&&K>k&&Y.push("'"+this.terminals_[K]+"'");M.showPosition?ee="Parse error on line "+(O+1)+`:
`+M.showPosition()+`
Expecting `+Y.join(", ")+", got '"+(this.terminals_[J]||J)+"'":ee="Parse error on line "+(O+1)+": Unexpected "+(J==R?"end of input":"'"+(this.terminals_[J]||J)+"'"),this.parseError(ee,{text:M.match,token:this.terminals_[J]||J,line:M.yylineno,loc:$,expected:Y})}if(ne[0]instanceof Array&&ne.length>1)throw new Error("Parse Error: multiple actions possible at state: "+q+", token: "+J);switch(ne[0]){case 1:L.push(J),C.push(M.yytext),A.push(M.yylloc),L.push(ne[1]),J=null,P=M.yyleng,_=M.yytext,O=M.yylineno,$=M.yylloc;break;case 2:if(Z=this.productions_[ne[1]][1],pe.$=C[C.length-Z],pe._$={first_line:A[A.length-(Z||1)].first_line,last_line:A[A.length-1].last_line,first_column:A[A.length-(Z||1)].first_column,last_column:A[A.length-1].last_column},F&&(pe._$.range=[A[A.length-(Z||1)].range[0],A[A.length-1].range[1]]),ae=this.performAction.apply(pe,[_,P,O,D.yy,ne[1],C,A].concat(I)),typeof ae<"u")return ae;Z&&(L=L.slice(0,-1*Z*2),C=C.slice(0,-1*Z),A=A.slice(0,-1*Z)),L.push(this.productions_[ne[1]][0]),C.push(pe.$),A.push(pe._$),X=N[L[L.length-2]][L[L.length-1]],L.push(X);break;case 3:return!0}}return!0},"parse")},y=function(){var w={EOF:1,parseError:x(function(E,L){if(this.yy.parser)this.yy.parser.parseError(E,L);else throw new Error(E)},"parseError"),setInput:x(function(T,E){return this.yy=E||this.yy||{},this._input=T,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:x(function(){var T=this._input[0];this.yytext+=T,this.yyleng++,this.offset++,this.match+=T,this.matched+=T;var E=T.match(/(?:\r\n?|\n).*/g);return E?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),T},"input"),unput:x(function(T){var E=T.length,L=T.split(/(?:\r\n?|\n)/g);this._input=T+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-E),this.offset-=E;var S=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),L.length-1&&(this.yylineno-=L.length-1);var C=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:L?(L.length===S.length?this.yylloc.first_column:0)+S[S.length-L.length].length-L[0].length:this.yylloc.first_column-E},this.options.ranges&&(this.yylloc.range=[C[0],C[0]+this.yyleng-E]),this.yyleng=this.yytext.length,this},"unput"),more:x(function(){return this._more=!0,this},"more"),reject:x(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:x(function(T){this.unput(this.match.slice(T))},"less"),pastInput:x(function(){var T=this.matched.substr(0,this.matched.length-this.match.length);return(T.length>20?"...":"")+T.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:x(function(){var T=this.match;return T.length<20&&(T+=this._input.substr(0,20-T.length)),(T.substr(0,20)+(T.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:x(function(){var T=this.pastInput(),E=new Array(T.length+1).join("-");return T+this.upcomingInput()+`
`+E+"^"},"showPosition"),test_match:x(function(T,E){var L,S,C;if(this.options.backtrack_lexer&&(C={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(C.yylloc.range=this.yylloc.range.slice(0))),S=T[0].match(/(?:\r\n?|\n).*/g),S&&(this.yylineno+=S.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:S?S[S.length-1].length-S[S.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+T[0].length},this.yytext+=T[0],this.match+=T[0],this.matches=T,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(T[0].length),this.matched+=T[0],L=this.performAction.call(this,this.yy,this,E,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),L)return L;if(this._backtrack){for(var A in C)this[A]=C[A];return!1}return!1},"test_match"),next:x(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var T,E,L,S;this._more||(this.yytext="",this.match="");for(var C=this._currentRules(),A=0;A<C.length;A++)if(L=this._input.match(this.rules[C[A]]),L&&(!E||L[0].length>E[0].length)){if(E=L,S=A,this.options.backtrack_lexer){if(T=this.test_match(L,C[A]),T!==!1)return T;if(this._backtrack){E=!1;continue}else return!1}else if(!this.options.flex)break}return E?(T=this.test_match(E,C[S]),T!==!1?T:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var E=this.next();return E||this.lex()},"lex"),begin:x(function(E){this.conditionStack.push(E)},"begin"),popState:x(function(){var E=this.conditionStack.length-1;return E>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(E){return E=this.conditionStack.length-1-Math.abs(E||0),E>=0?this.conditionStack[E]:"INITIAL"},"topState"),pushState:x(function(E){this.begin(E)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:x(function(E,L,S,C){switch(S){case 0:return E.getLogger().debug("Found block-beta"),10;case 1:return E.getLogger().debug("Found id-block"),29;case 2:return E.getLogger().debug("Found block"),10;case 3:E.getLogger().debug(".",L.yytext);break;case 4:E.getLogger().debug("_",L.yytext);break;case 5:return 5;case 6:return L.yytext=-1,28;case 7:return L.yytext=L.yytext.replace(/columns\s+/,""),E.getLogger().debug("COLUMNS (LEX)",L.yytext),28;case 8:this.pushState("md_string");break;case 9:return"MD_STR";case 10:this.popState();break;case 11:this.pushState("string");break;case 12:E.getLogger().debug("LEX: POPPING STR:",L.yytext),this.popState();break;case 13:return E.getLogger().debug("LEX: STR end:",L.yytext),"STR";case 14:return L.yytext=L.yytext.replace(/space\:/,""),E.getLogger().debug("SPACE NUM (LEX)",L.yytext),21;case 15:return L.yytext="1",E.getLogger().debug("COLUMNS (LEX)",L.yytext),21;case 16:return 42;case 17:return"LINKSTYLE";case 18:return"INTERPOLATE";case 19:return this.pushState("CLASSDEF"),39;case 20:return this.popState(),this.pushState("CLASSDEFID"),"DEFAULT_CLASSDEF_ID";case 21:return this.popState(),this.pushState("CLASSDEFID"),40;case 22:return this.popState(),41;case 23:return this.pushState("CLASS"),43;case 24:return this.popState(),this.pushState("CLASS_STYLE"),44;case 25:return this.popState(),45;case 26:return this.pushState("STYLE_STMNT"),46;case 27:return this.popState(),this.pushState("STYLE_DEFINITION"),47;case 28:return this.popState(),48;case 29:return this.pushState("acc_title"),"acc_title";case 30:return this.popState(),"acc_title_value";case 31:return this.pushState("acc_descr"),"acc_descr";case 32:return this.popState(),"acc_descr_value";case 33:this.pushState("acc_descr_multiline");break;case 34:this.popState();break;case 35:return"acc_descr_multiline_value";case 36:return 30;case 37:return this.popState(),E.getLogger().debug("Lex: (("),"NODE_DEND";case 38:return this.popState(),E.getLogger().debug("Lex: (("),"NODE_DEND";case 39:return this.popState(),E.getLogger().debug("Lex: ))"),"NODE_DEND";case 40:return this.popState(),E.getLogger().debug("Lex: (("),"NODE_DEND";case 41:return this.popState(),E.getLogger().debug("Lex: (("),"NODE_DEND";case 42:return this.popState(),E.getLogger().debug("Lex: (-"),"NODE_DEND";case 43:return this.popState(),E.getLogger().debug("Lex: -)"),"NODE_DEND";case 44:return this.popState(),E.getLogger().debug("Lex: (("),"NODE_DEND";case 45:return this.popState(),E.getLogger().debug("Lex: ]]"),"NODE_DEND";case 46:return this.popState(),E.getLogger().debug("Lex: ("),"NODE_DEND";case 47:return this.popState(),E.getLogger().debug("Lex: ])"),"NODE_DEND";case 48:return this.popState(),E.getLogger().debug("Lex: /]"),"NODE_DEND";case 49:return this.popState(),E.getLogger().debug("Lex: /]"),"NODE_DEND";case 50:return this.popState(),E.getLogger().debug("Lex: )]"),"NODE_DEND";case 51:return this.popState(),E.getLogger().debug("Lex: )"),"NODE_DEND";case 52:return this.popState(),E.getLogger().debug("Lex: ]>"),"NODE_DEND";case 53:return this.popState(),E.getLogger().debug("Lex: ]"),"NODE_DEND";case 54:return E.getLogger().debug("Lexa: -)"),this.pushState("NODE"),35;case 55:return E.getLogger().debug("Lexa: (-"),this.pushState("NODE"),35;case 56:return E.getLogger().debug("Lexa: ))"),this.pushState("NODE"),35;case 57:return E.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 58:return E.getLogger().debug("Lex: ((("),this.pushState("NODE"),35;case 59:return E.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 60:return E.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 61:return E.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 62:return E.getLogger().debug("Lexc: >"),this.pushState("NODE"),35;case 63:return E.getLogger().debug("Lexa: (["),this.pushState("NODE"),35;case 64:return E.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 65:return this.pushState("NODE"),35;case 66:return this.pushState("NODE"),35;case 67:return this.pushState("NODE"),35;case 68:return this.pushState("NODE"),35;case 69:return this.pushState("NODE"),35;case 70:return this.pushState("NODE"),35;case 71:return this.pushState("NODE"),35;case 72:return E.getLogger().debug("Lexa: ["),this.pushState("NODE"),35;case 73:return this.pushState("BLOCK_ARROW"),E.getLogger().debug("LEX ARR START"),37;case 74:return E.getLogger().debug("Lex: NODE_ID",L.yytext),31;case 75:return E.getLogger().debug("Lex: EOF",L.yytext),8;case 76:this.pushState("md_string");break;case 77:this.pushState("md_string");break;case 78:return"NODE_DESCR";case 79:this.popState();break;case 80:E.getLogger().debug("Lex: Starting string"),this.pushState("string");break;case 81:E.getLogger().debug("LEX ARR: Starting string"),this.pushState("string");break;case 82:return E.getLogger().debug("LEX: NODE_DESCR:",L.yytext),"NODE_DESCR";case 83:E.getLogger().debug("LEX POPPING"),this.popState();break;case 84:E.getLogger().debug("Lex: =>BAE"),this.pushState("ARROW_DIR");break;case 85:return L.yytext=L.yytext.replace(/^,\s*/,""),E.getLogger().debug("Lex (right): dir:",L.yytext),"DIR";case 86:return L.yytext=L.yytext.replace(/^,\s*/,""),E.getLogger().debug("Lex (left):",L.yytext),"DIR";case 87:return L.yytext=L.yytext.replace(/^,\s*/,""),E.getLogger().debug("Lex (x):",L.yytext),"DIR";case 88:return L.yytext=L.yytext.replace(/^,\s*/,""),E.getLogger().debug("Lex (y):",L.yytext),"DIR";case 89:return L.yytext=L.yytext.replace(/^,\s*/,""),E.getLogger().debug("Lex (up):",L.yytext),"DIR";case 90:return L.yytext=L.yytext.replace(/^,\s*/,""),E.getLogger().debug("Lex (down):",L.yytext),"DIR";case 91:return L.yytext="]>",E.getLogger().debug("Lex (ARROW_DIR end):",L.yytext),this.popState(),this.popState(),"BLOCK_ARROW_END";case 92:return E.getLogger().debug("Lex: LINK","#"+L.yytext+"#"),15;case 93:return E.getLogger().debug("Lex: LINK",L.yytext),15;case 94:return E.getLogger().debug("Lex: LINK",L.yytext),15;case 95:return E.getLogger().debug("Lex: LINK",L.yytext),15;case 96:return E.getLogger().debug("Lex: START_LINK",L.yytext),this.pushState("LLABEL"),16;case 97:return E.getLogger().debug("Lex: START_LINK",L.yytext),this.pushState("LLABEL"),16;case 98:return E.getLogger().debug("Lex: START_LINK",L.yytext),this.pushState("LLABEL"),16;case 99:this.pushState("md_string");break;case 100:return E.getLogger().debug("Lex: Starting string"),this.pushState("string"),"LINK_LABEL";case 101:return this.popState(),E.getLogger().debug("Lex: LINK","#"+L.yytext+"#"),15;case 102:return this.popState(),E.getLogger().debug("Lex: LINK",L.yytext),15;case 103:return this.popState(),E.getLogger().debug("Lex: LINK",L.yytext),15;case 104:return E.getLogger().debug("Lex: COLON",L.yytext),L.yytext=L.yytext.slice(1),27}},"anonymous"),rules:[/^(?:block-beta\b)/,/^(?:block:)/,/^(?:block\b)/,/^(?:[\s]+)/,/^(?:[\n]+)/,/^(?:((\u000D\u000A)|(\u000A)))/,/^(?:columns\s+auto\b)/,/^(?:columns\s+[\d]+)/,/^(?:["][`])/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:space[:]\d+)/,/^(?:space\b)/,/^(?:default\b)/,/^(?:linkStyle\b)/,/^(?:interpolate\b)/,/^(?:classDef\s+)/,/^(?:DEFAULT\s+)/,/^(?:\w+\s+)/,/^(?:[^\n]*)/,/^(?:class\s+)/,/^(?:(\w+)+((,\s*\w+)*))/,/^(?:[^\n]*)/,/^(?:style\s+)/,/^(?:(\w+)+((,\s*\w+)*))/,/^(?:[^\n]*)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:end\b\s*)/,/^(?:\(\(\()/,/^(?:\)\)\))/,/^(?:[\)]\))/,/^(?:\}\})/,/^(?:\})/,/^(?:\(-)/,/^(?:-\))/,/^(?:\(\()/,/^(?:\]\])/,/^(?:\()/,/^(?:\]\))/,/^(?:\\\])/,/^(?:\/\])/,/^(?:\)\])/,/^(?:[\)])/,/^(?:\]>)/,/^(?:[\]])/,/^(?:-\))/,/^(?:\(-)/,/^(?:\)\))/,/^(?:\))/,/^(?:\(\(\()/,/^(?:\(\()/,/^(?:\{\{)/,/^(?:\{)/,/^(?:>)/,/^(?:\(\[)/,/^(?:\()/,/^(?:\[\[)/,/^(?:\[\|)/,/^(?:\[\()/,/^(?:\)\)\))/,/^(?:\[\\)/,/^(?:\[\/)/,/^(?:\[\\)/,/^(?:\[)/,/^(?:<\[)/,/^(?:[^\(\[\n\-\)\{\}\s\<\>:]+)/,/^(?:$)/,/^(?:["][`])/,/^(?:["][`])/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["])/,/^(?:["])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:\]>\s*\()/,/^(?:,?\s*right\s*)/,/^(?:,?\s*left\s*)/,/^(?:,?\s*x\s*)/,/^(?:,?\s*y\s*)/,/^(?:,?\s*up\s*)/,/^(?:,?\s*down\s*)/,/^(?:\)\s*)/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?:\s*~~[\~]+\s*)/,/^(?:\s*[xo<]?--\s*)/,/^(?:\s*[xo<]?==\s*)/,/^(?:\s*[xo<]?-\.\s*)/,/^(?:["][`])/,/^(?:["])/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?::\d+)/],conditions:{STYLE_DEFINITION:{rules:[28],inclusive:!1},STYLE_STMNT:{rules:[27],inclusive:!1},CLASSDEFID:{rules:[22],inclusive:!1},CLASSDEF:{rules:[20,21],inclusive:!1},CLASS_STYLE:{rules:[25],inclusive:!1},CLASS:{rules:[24],inclusive:!1},LLABEL:{rules:[99,100,101,102,103],inclusive:!1},ARROW_DIR:{rules:[85,86,87,88,89,90,91],inclusive:!1},BLOCK_ARROW:{rules:[76,81,84],inclusive:!1},NODE:{rules:[37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,77,80],inclusive:!1},md_string:{rules:[9,10,78,79],inclusive:!1},space:{rules:[],inclusive:!1},string:{rules:[12,13,82,83],inclusive:!1},acc_descr_multiline:{rules:[34,35],inclusive:!1},acc_descr:{rules:[32],inclusive:!1},acc_title:{rules:[30],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,11,14,15,16,17,18,19,23,26,29,31,33,36,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,92,93,94,95,96,97,98,104],inclusive:!0}}};return w}();v.lexer=y;function b(){this.yy={}}return x(b,"Parser"),b.prototype=v,v.Parser=b,new b}();VT.parser=VT;var rLe=VT,bs=new Map,yS=[],GT=new Map,XR="color",jR="fill",nLe="bgFill",pq=",",iLe=we(),Ry=new Map,aLe=x(t=>at.sanitizeText(t,iLe),"sanitizeText"),sLe=x(function(t,e=""){let r=Ry.get(t);r||(r={id:t,styles:[],textStyles:[]},Ry.set(t,r)),e?.split(pq).forEach(n=>{const i=n.replace(/([^;]*);/,"$1").trim();if(RegExp(XR).exec(n)){const s=i.replace(jR,nLe).replace(XR,jR);r.textStyles.push(s)}r.styles.push(i)})},"addStyleClass"),oLe=x(function(t,e=""){const r=bs.get(t);e!=null&&(r.styles=e.split(pq))},"addStyle2Node"),lLe=x(function(t,e){t.split(",").forEach(function(r){let n=bs.get(r);if(n===void 0){const i=r.trim();n={id:i,type:"na",children:[]},bs.set(i,n)}n.classes||(n.classes=[]),n.classes.push(e)})},"setCssClass"),gq=x((t,e)=>{const r=t.flat(),n=[],a=r.find(s=>s?.type==="column-setting")?.columns??-1;for(const s of r){if(typeof a=="number"&&a>0&&s.type!=="column-setting"&&typeof s.widthInColumns=="number"&&s.widthInColumns>a&&ie.warn(`Block ${s.id} width ${s.widthInColumns} exceeds configured column width ${a}`),s.label&&(s.label=aLe(s.label)),s.type==="classDef"){sLe(s.id,s.css);continue}if(s.type==="applyClass"){lLe(s.id,s?.styleClass??"");continue}if(s.type==="applyStyles"){s?.stylesStr&&oLe(s.id,s?.stylesStr);continue}if(s.type==="column-setting")e.columns=s.columns??-1;else if(s.type==="edge"){const o=(GT.get(s.id)??0)+1;GT.set(s.id,o),s.id=o+"-"+s.id,yS.push(s)}else{s.label||(s.type==="composite"?s.label="":s.label=s.id);const o=bs.get(s.id);if(o===void 0?bs.set(s.id,s):(s.type!=="na"&&(o.type=s.type),s.label!==s.id&&(o.label=s.label)),s.children&&gq(s.children,s),s.type==="space"){const l=s.width??1;for(let u=0;u<l;u++){const h=Fn(s);h.id=h.id+"-"+u,bs.set(h.id,h),n.push(h)}}else o===void 0&&n.push(s)}}e.children=n},"populateBlockDatabase"),xS=[],D0={id:"root",type:"composite",children:[],columns:-1},cLe=x(()=>{ie.debug("Clear called"),An(),D0={id:"root",type:"composite",children:[],columns:-1},bs=new Map([["root",D0]]),xS=[],Ry=new Map,yS=[],GT=new Map},"clear");function mq(t){switch(ie.debug("typeStr2Type",t),t){case"[]":return"square";case"()":return ie.debug("we have a round"),"round";case"(())":return"circle";case">]":return"rect_left_inv_arrow";case"{}":return"diamond";case"{{}}":return"hexagon";case"([])":return"stadium";case"[[]]":return"subroutine";case"[()]":return"cylinder";case"((()))":return"doublecircle";case"[//]":return"lean_right";case"[\\\\]":return"lean_left";case"[/\\]":return"trapezoid";case"[\\/]":return"inv_trapezoid";case"<[]>":return"block_arrow";default:return"na"}}x(mq,"typeStr2Type");function vq(t){switch(ie.debug("typeStr2Type",t),t){case"==":return"thick";default:return"normal"}}x(vq,"edgeTypeStr2Type");function yq(t){switch(t.replace(/^[\s-]+|[\s-]+$/g,"")){case"x":return"arrow_cross";case"o":return"arrow_circle";case">":return"arrow_point";default:return""}}x(yq,"edgeStrToEdgeData");var KR=0,uLe=x(()=>(KR++,"id-"+Math.random().toString(36).substr(2,12)+"-"+KR),"generateId"),hLe=x(t=>{D0.children=t,gq(t,D0),xS=D0.children},"setHierarchy"),dLe=x(t=>{const e=bs.get(t);return e?e.columns?e.columns:e.children?e.children.length:-1:-1},"getColumns"),fLe=x(()=>[...bs.values()],"getBlocksFlat"),pLe=x(()=>xS||[],"getBlocks"),gLe=x(()=>yS,"getEdges"),mLe=x(t=>bs.get(t),"getBlock"),vLe=x(t=>{bs.set(t.id,t)},"setBlock"),yLe=x(()=>ie,"getLogger"),xLe=x(function(){return Ry},"getClasses"),bLe={getConfig:x(()=>gr().block,"getConfig"),typeStr2Type:mq,edgeTypeStr2Type:vq,edgeStrToEdgeData:yq,getLogger:yLe,getBlocksFlat:fLe,getBlocks:pLe,getEdges:gLe,setHierarchy:hLe,getBlock:mLe,setBlock:vLe,getColumns:dLe,getClasses:xLe,clear:cLe,generateId:uLe},wLe=bLe,M1=x((t,e)=>{const r=XT,n=r(t,"r"),i=r(t,"g"),a=r(t,"b");return Al(n,i,a,e)},"fade"),TLe=x(t=>`.label {
    font-family: ${t.fontFamily};
    color: ${t.nodeTextColor||t.textColor};
  }
  .cluster-label text {
    fill: ${t.titleColor};
  }
  .cluster-label span,p {
    color: ${t.titleColor};
  }



  .label text,span,p {
    fill: ${t.nodeTextColor||t.textColor};
    color: ${t.nodeTextColor||t.textColor};
  }

  .node rect,
  .node circle,
  .node ellipse,
  .node polygon,
  .node path {
    fill: ${t.mainBkg};
    stroke: ${t.nodeBorder};
    stroke-width: 1px;
  }
  .flowchart-label text {
    text-anchor: middle;
  }
  // .flowchart-label .text-outer-tspan {
  //   text-anchor: middle;
  // }
  // .flowchart-label .text-inner-tspan {
  //   text-anchor: start;
  // }

  .node .label {
    text-align: center;
  }
  .node.clickable {
    cursor: pointer;
  }

  .arrowheadPath {
    fill: ${t.arrowheadColor};
  }

  .edgePath .path {
    stroke: ${t.lineColor};
    stroke-width: 2.0px;
  }

  .flowchart-link {
    stroke: ${t.lineColor};
    fill: none;
  }

  .edgeLabel {
    background-color: ${t.edgeLabelBackground};
    rect {
      opacity: 0.5;
      background-color: ${t.edgeLabelBackground};
      fill: ${t.edgeLabelBackground};
    }
    text-align: center;
  }

  /* For html labels only */
  .labelBkg {
    background-color: ${M1(t.edgeLabelBackground,.5)};
    // background-color:
  }

  .node .cluster {
    // fill: ${M1(t.mainBkg,.5)};
    fill: ${M1(t.clusterBkg,.5)};
    stroke: ${M1(t.clusterBorder,.2)};
    box-shadow: rgba(50, 50, 93, 0.25) 0px 13px 27px -5px, rgba(0, 0, 0, 0.3) 0px 8px 16px -8px;
    stroke-width: 1px;
  }

  .cluster text {
    fill: ${t.titleColor};
  }

  .cluster span,p {
    color: ${t.titleColor};
  }
  /* .cluster div {
    color: ${t.titleColor};
  } */

  div.mermaidTooltip {
    position: absolute;
    text-align: center;
    max-width: 200px;
    padding: 2px;
    font-family: ${t.fontFamily};
    font-size: 12px;
    background: ${t.tertiaryColor};
    border: 1px solid ${t.border2};
    border-radius: 2px;
    pointer-events: none;
    z-index: 100;
  }

  .flowchartTitleText {
    text-anchor: middle;
    font-size: 18px;
    fill: ${t.textColor};
  }
  ${og()}
`,"getStyles"),ELe=TLe,kLe=x((t,e,r,n)=>{e.forEach(i=>{ILe[i](t,r,n)})},"insertMarkers"),SLe=x((t,e,r)=>{ie.trace("Making markers for ",r),t.append("defs").append("marker").attr("id",r+"_"+e+"-extensionStart").attr("class","marker extension "+e).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"),t.append("defs").append("marker").attr("id",r+"_"+e+"-extensionEnd").attr("class","marker extension "+e).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"),CLe=x((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-compositionStart").attr("class","marker composition "+e).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"),t.append("defs").append("marker").attr("id",r+"_"+e+"-compositionEnd").attr("class","marker composition "+e).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"),ALe=x((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-aggregationStart").attr("class","marker aggregation "+e).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"),t.append("defs").append("marker").attr("id",r+"_"+e+"-aggregationEnd").attr("class","marker aggregation "+e).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"),_Le=x((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-dependencyStart").attr("class","marker dependency "+e).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"),t.append("defs").append("marker").attr("id",r+"_"+e+"-dependencyEnd").attr("class","marker dependency "+e).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"),LLe=x((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-lollipopStart").attr("class","marker lollipop "+e).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),t.append("defs").append("marker").attr("id",r+"_"+e+"-lollipopEnd").attr("class","marker lollipop "+e).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6)},"lollipop"),RLe=x((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-pointEnd").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",6).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).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"),t.append("marker").attr("id",r+"_"+e+"-pointStart").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",4.5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).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"),NLe=x((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-circleEnd").attr("class","marker "+e).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"),t.append("marker").attr("id",r+"_"+e+"-circleStart").attr("class","marker "+e).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"),DLe=x((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-crossEnd").attr("class","marker cross "+e).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"),t.append("marker").attr("id",r+"_"+e+"-crossStart").attr("class","marker cross "+e).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"),MLe=x((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","strokeWidth").attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"barb"),ILe={extension:SLe,composition:CLe,aggregation:ALe,dependency:_Le,lollipop:LLe,point:RLe,circle:NLe,cross:DLe,barb:MLe},OLe=kLe,pn=we()?.block?.padding??8;function xq(t,e){if(t===0||!Number.isInteger(t))throw new Error("Columns must be an integer !== 0.");if(e<0||!Number.isInteger(e))throw new Error("Position must be a non-negative integer."+e);if(t<0)return{px:e,py:0};if(t===1)return{px:0,py:e};const r=e%t,n=Math.floor(e/t);return{px:r,py:n}}x(xq,"calculateBlockPosition");var PLe=x(t=>{let e=0,r=0;for(const n of t.children){const{width:i,height:a,x:s,y:o}=n.size??{width:0,height:0,x:0,y:0};ie.debug("getMaxChildSize abc95 child:",n.id,"width:",i,"height:",a,"x:",s,"y:",o,n.type),n.type!=="space"&&(i>e&&(e=i/(t.widthInColumns??1)),a>r&&(r=a))}return{width:e,height:r}},"getMaxChildSize");function Ny(t,e,r=0,n=0){ie.debug("setBlockSizes abc95 (start)",t.id,t?.size?.x,"block width =",t?.size,"siblingWidth",r),t?.size?.width||(t.size={width:r,height:n,x:0,y:0});let i=0,a=0;if(t.children?.length>0){for(const p of t.children)Ny(p,e);const s=PLe(t);i=s.width,a=s.height,ie.debug("setBlockSizes abc95 maxWidth of",t.id,":s children is ",i,a);for(const p of t.children)p.size&&(ie.debug(`abc95 Setting size of children of ${t.id} id=${p.id} ${i} ${a} ${JSON.stringify(p.size)}`),p.size.width=i*(p.widthInColumns??1)+pn*((p.widthInColumns??1)-1),p.size.height=a,p.size.x=0,p.size.y=0,ie.debug(`abc95 updating size of ${t.id} children child:${p.id} maxWidth:${i} maxHeight:${a}`));for(const p of t.children)Ny(p,e,i,a);const o=t.columns??-1;let l=0;for(const p of t.children)l+=p.widthInColumns??1;let u=t.children.length;o>0&&o<l&&(u=o);const h=Math.ceil(l/u);let d=u*(i+pn)+pn,f=h*(a+pn)+pn;if(d<r){ie.debug(`Detected to small sibling: abc95 ${t.id} siblingWidth ${r} siblingHeight ${n} width ${d}`),d=r,f=n;const p=(r-u*pn-pn)/u,g=(n-h*pn-pn)/h;ie.debug("Size indata abc88",t.id,"childWidth",p,"maxWidth",i),ie.debug("Size indata abc88",t.id,"childHeight",g,"maxHeight",a),ie.debug("Size indata abc88 xSize",u,"padding",pn);for(const m of t.children)m.size&&(m.size.width=p,m.size.height=g,m.size.x=0,m.size.y=0)}if(ie.debug(`abc95 (finale calc) ${t.id} xSize ${u} ySize ${h} columns ${o}${t.children.length} width=${Math.max(d,t.size?.width||0)}`),d<(t?.size?.width||0)){d=t?.size?.width||0;const p=o>0?Math.min(t.children.length,o):t.children.length;if(p>0){const g=(d-p*pn-pn)/p;ie.debug("abc95 (growing to fit) width",t.id,d,t.size?.width,g);for(const m of t.children)m.size&&(m.size.width=g)}}t.size={width:d,height:f,x:0,y:0}}ie.debug("setBlockSizes abc94 (done)",t.id,t?.size?.x,t?.size?.width,t?.size?.y,t?.size?.height)}x(Ny,"setBlockSizes");function bS(t,e){ie.debug(`abc85 layout blocks (=>layoutBlocks) ${t.id} x: ${t?.size?.x} y: ${t?.size?.y} width: ${t?.size?.width}`);const r=t.columns??-1;if(ie.debug("layoutBlocks columns abc95",t.id,"=>",r,t),t.children&&t.children.length>0){const n=t?.children[0]?.size?.width??0,i=t.children.length*n+(t.children.length-1)*pn;ie.debug("widthOfChildren 88",i,"posX");let a=0;ie.debug("abc91 block?.size?.x",t.id,t?.size?.x);let s=t?.size?.x?t?.size?.x+(-t?.size?.width/2||0):-pn,o=0;for(const l of t.children){const u=t;if(!l.size)continue;const{width:h,height:d}=l.size,{px:f,py:p}=xq(r,a);if(p!=o&&(o=p,s=t?.size?.x?t?.size?.x+(-t?.size?.width/2||0):-pn,ie.debug("New row in layout for block",t.id," and child ",l.id,o)),ie.debug(`abc89 layout blocks (child) id: ${l.id} Pos: ${a} (px, py) ${f},${p} (${u?.size?.x},${u?.size?.y}) parent: ${u.id} width: ${h}${pn}`),u.size){const m=h/2;l.size.x=s+pn+m,ie.debug(`abc91 layout blocks (calc) px, pyid:${l.id} startingPos=X${s} new startingPosX${l.size.x} ${m} padding=${pn} width=${h} halfWidth=${m} => x:${l.size.x} y:${l.size.y} ${l.widthInColumns} (width * (child?.w || 1)) / 2 ${h*(l?.widthInColumns??1)/2}`),s=l.size.x+m,l.size.y=u.size.y-u.size.height/2+p*(d+pn)+d/2+pn,ie.debug(`abc88 layout blocks (calc) px, pyid:${l.id}startingPosX${s}${pn}${m}=>x:${l.size.x}y:${l.size.y}${l.widthInColumns}(width * (child?.w || 1)) / 2${h*(l?.widthInColumns??1)/2}`)}l.children&&bS(l);let g=l?.widthInColumns??1;r>0&&(g=Math.min(g,r-a%r)),a+=g,ie.debug("abc88 columnsPos",l,a)}}ie.debug(`layout blocks (<==layoutBlocks) ${t.id} x: ${t?.size?.x} y: ${t?.size?.y} width: ${t?.size?.width}`)}x(bS,"layoutBlocks");function wS(t,{minX:e,minY:r,maxX:n,maxY:i}={minX:0,minY:0,maxX:0,maxY:0}){if(t.size&&t.id!=="root"){const{x:a,y:s,width:o,height:l}=t.size;a-o/2<e&&(e=a-o/2),s-l/2<r&&(r=s-l/2),a+o/2>n&&(n=a+o/2),s+l/2>i&&(i=s+l/2)}if(t.children)for(const a of t.children)({minX:e,minY:r,maxX:n,maxY:i}=wS(a,{minX:e,minY:r,maxX:n,maxY:i}));return{minX:e,minY:r,maxX:n,maxY:i}}x(wS,"findBounds");function bq(t){const e=t.getBlock("root");if(!e)return;Ny(e,t,0,0),bS(e),ie.debug("getBlocks",JSON.stringify(e,null,2));const{minX:r,minY:n,maxX:i,maxY:a}=wS(e),s=a-n,o=i-r;return{x:r,y:n,width:o,height:s}}x(bq,"layout");function UT(t,e){e&&t.attr("style",e)}x(UT,"applyStyle");function wq(t,e){const r=Qe(document.createElementNS("http://www.w3.org/2000/svg","foreignObject")),n=r.append("xhtml:div"),i=t.label,a=t.isNode?"nodeLabel":"edgeLabel",s=n.append("span");return s.html(fr(i,e)),UT(s,t.labelStyle),s.attr("class",a),UT(n,t.labelStyle),n.style("display","inline-block"),n.style("white-space","nowrap"),n.attr("xmlns","http://www.w3.org/1999/xhtml"),r.node()}x(wq,"addHtmlLabel");var BLe=x(async(t,e,r,n)=>{let i=t||"";typeof i=="object"&&(i=i[0]);const a=we();if(Ir(a.flowchart.htmlLabels)){i=i.replace(/\\n|\n/g,"<br />"),ie.debug("vertexText"+i);const s=await q6(Ks(i)),o={isNode:n,label:s,labelStyle:e.replace("fill:","color:")};return wq(o,a)}else{const s=document.createElementNS("http://www.w3.org/2000/svg","text");s.setAttribute("style",e.replace("color:","fill:"));let o=[];typeof i=="string"?o=i.split(/\\n|\n|<br\s*\/?>/gi):Array.isArray(i)?o=i:o=[];for(const l of o){const u=document.createElementNS("http://www.w3.org/2000/svg","tspan");u.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),u.setAttribute("dy","1em"),u.setAttribute("x","0"),r?u.setAttribute("class","title-row"):u.setAttribute("class","row"),u.textContent=l.trim(),s.appendChild(u)}return s}},"createLabel"),Ha=BLe,FLe=x((t,e,r,n,i)=>{e.arrowTypeStart&&ZR(t,"start",e.arrowTypeStart,r,n,i),e.arrowTypeEnd&&ZR(t,"end",e.arrowTypeEnd,r,n,i)},"addEdgeMarkers"),$Le={arrow_cross:"cross",arrow_point:"point",arrow_barb:"barb",arrow_circle:"circle",aggregation:"aggregation",extension:"extension",composition:"composition",dependency:"dependency",lollipop:"lollipop"},ZR=x((t,e,r,n,i,a)=>{const s=$Le[r];if(!s){ie.warn(`Unknown arrow type: ${r}`);return}const o=e==="start"?"Start":"End";t.attr(`marker-${e}`,`url(${n}#${i}_${a}-${s}${o})`)},"addEdgeMarker"),WT={},xi={},zLe=x(async(t,e)=>{const r=we(),n=Ir(r.flowchart.htmlLabels),i=e.labelType==="markdown"?Ra(t,e.label,{style:e.labelStyle,useHtmlLabels:n,addSvgBackground:!0},r):await Ha(e.label,e.labelStyle),a=t.insert("g").attr("class","edgeLabel"),s=a.insert("g").attr("class","label");s.node().appendChild(i);let o=i.getBBox();if(n){const u=i.children[0],h=Qe(i);o=u.getBoundingClientRect(),h.attr("width",o.width),h.attr("height",o.height)}s.attr("transform","translate("+-o.width/2+", "+-o.height/2+")"),WT[e.id]=a,e.width=o.width,e.height=o.height;let l;if(e.startLabelLeft){const u=await Ha(e.startLabelLeft,e.labelStyle),h=t.insert("g").attr("class","edgeTerminals"),d=h.insert("g").attr("class","inner");l=d.node().appendChild(u);const f=u.getBBox();d.attr("transform","translate("+-f.width/2+", "+-f.height/2+")"),xi[e.id]||(xi[e.id]={}),xi[e.id].startLeft=h,v0(l,e.startLabelLeft)}if(e.startLabelRight){const u=await Ha(e.startLabelRight,e.labelStyle),h=t.insert("g").attr("class","edgeTerminals"),d=h.insert("g").attr("class","inner");l=h.node().appendChild(u),d.node().appendChild(u);const f=u.getBBox();d.attr("transform","translate("+-f.width/2+", "+-f.height/2+")"),xi[e.id]||(xi[e.id]={}),xi[e.id].startRight=h,v0(l,e.startLabelRight)}if(e.endLabelLeft){const u=await Ha(e.endLabelLeft,e.labelStyle),h=t.insert("g").attr("class","edgeTerminals"),d=h.insert("g").attr("class","inner");l=d.node().appendChild(u);const f=u.getBBox();d.attr("transform","translate("+-f.width/2+", "+-f.height/2+")"),h.node().appendChild(u),xi[e.id]||(xi[e.id]={}),xi[e.id].endLeft=h,v0(l,e.endLabelLeft)}if(e.endLabelRight){const u=await Ha(e.endLabelRight,e.labelStyle),h=t.insert("g").attr("class","edgeTerminals"),d=h.insert("g").attr("class","inner");l=d.node().appendChild(u);const f=u.getBBox();d.attr("transform","translate("+-f.width/2+", "+-f.height/2+")"),h.node().appendChild(u),xi[e.id]||(xi[e.id]={}),xi[e.id].endRight=h,v0(l,e.endLabelRight)}return i},"insertEdgeLabel");function v0(t,e){we().flowchart.htmlLabels&&t&&(t.style.width=e.length*9+"px",t.style.height="12px")}x(v0,"setTerminalWidth");var VLe=x((t,e)=>{ie.debug("Moving label abc88 ",t.id,t.label,WT[t.id],e);let r=e.updatedPath?e.updatedPath:e.originalPath;const n=we(),{subGraphTitleTotalMargin:i}=Mp(n);if(t.label){const a=WT[t.id];let s=t.x,o=t.y;if(r){const l=Kt.calcLabelPosition(r);ie.debug("Moving label "+t.label+" from (",s,",",o,") to (",l.x,",",l.y,") abc88"),e.updatedPath&&(s=l.x,o=l.y)}a.attr("transform",`translate(${s}, ${o+i/2})`)}if(t.startLabelLeft){const a=xi[t.id].startLeft;let s=t.x,o=t.y;if(r){const l=Kt.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_left",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}if(t.startLabelRight){const a=xi[t.id].startRight;let s=t.x,o=t.y;if(r){const l=Kt.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_right",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}if(t.endLabelLeft){const a=xi[t.id].endLeft;let s=t.x,o=t.y;if(r){const l=Kt.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_left",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}if(t.endLabelRight){const a=xi[t.id].endRight;let s=t.x,o=t.y;if(r){const l=Kt.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_right",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}},"positionEdgeLabel"),GLe=x((t,e)=>{const r=t.x,n=t.y,i=Math.abs(e.x-r),a=Math.abs(e.y-n),s=t.width/2,o=t.height/2;return i>=s||a>=o},"outsideNode"),ULe=x((t,e,r)=>{ie.debug(`intersection calc abc89:
  outsidePoint: ${JSON.stringify(e)}
  insidePoint : ${JSON.stringify(r)}
  node        : x:${t.x} y:${t.y} w:${t.width} h:${t.height}`);const n=t.x,i=t.y,a=Math.abs(n-r.x),s=t.width/2;let o=r.x<e.x?s-a:s+a;const l=t.height/2,u=Math.abs(e.y-r.y),h=Math.abs(e.x-r.x);if(Math.abs(i-e.y)*s>Math.abs(n-e.x)*l){let d=r.y<e.y?e.y-l-i:i-l-e.y;o=h*d/u;const f={x:r.x<e.x?r.x+o:r.x-h+o,y:r.y<e.y?r.y+u-d:r.y-u+d};return o===0&&(f.x=e.x,f.y=e.y),h===0&&(f.x=e.x),u===0&&(f.y=e.y),ie.debug(`abc89 topp/bott calc, Q ${u}, q ${d}, R ${h}, r ${o}`,f),f}else{r.x<e.x?o=e.x-s-n:o=n-s-e.x;let d=u*o/h,f=r.x<e.x?r.x+h-o:r.x-h+o,p=r.y<e.y?r.y+d:r.y-d;return ie.debug(`sides calc abc89, Q ${u}, q ${d}, R ${h}, r ${o}`,{_x:f,_y:p}),o===0&&(f=e.x,p=e.y),h===0&&(f=e.x),u===0&&(p=e.y),{x:f,y:p}}},"intersection"),QR=x((t,e)=>{ie.debug("abc88 cutPathAtIntersect",t,e);let r=[],n=t[0],i=!1;return t.forEach(a=>{if(!GLe(e,a)&&!i){const s=ULe(e,n,a);let o=!1;r.forEach(l=>{o=o||l.x===s.x&&l.y===s.y}),r.some(l=>l.x===s.x&&l.y===s.y)||r.push(s),i=!0}else n=a,i||r.push(a)}),r},"cutPathAtIntersect"),WLe=x(function(t,e,r,n,i,a,s){let o=r.points;ie.debug("abc88 InsertEdge: edge=",r,"e=",e);let l=!1;const u=a.node(e.v);var h=a.node(e.w);h?.intersect&&u?.intersect&&(o=o.slice(1,r.points.length-1),o.unshift(u.intersect(o[0])),o.push(h.intersect(o[o.length-1]))),r.toCluster&&(ie.debug("to cluster abc88",n[r.toCluster]),o=QR(r.points,n[r.toCluster].node),l=!0),r.fromCluster&&(ie.debug("from cluster abc88",n[r.fromCluster]),o=QR(o.reverse(),n[r.fromCluster].node).reverse(),l=!0);const d=o.filter(T=>!Number.isNaN(T.y));let f=Ah;r.curve&&(i==="graph"||i==="flowchart")&&(f=r.curve);const{x:p,y:g}=RI(r),m=V0().x(p).y(g).curve(f);let v;switch(r.thickness){case"normal":v="edge-thickness-normal";break;case"thick":v="edge-thickness-thick";break;case"invisible":v="edge-thickness-thick";break;default:v=""}switch(r.pattern){case"solid":v+=" edge-pattern-solid";break;case"dotted":v+=" edge-pattern-dotted";break;case"dashed":v+=" edge-pattern-dashed";break}const y=t.append("path").attr("d",m(d)).attr("id",r.id).attr("class"," "+v+(r.classes?" "+r.classes:"")).attr("style",r.style);let b="";(we().flowchart.arrowMarkerAbsolute||we().state.arrowMarkerAbsolute)&&(b=Fy(!0)),FLe(y,r,b,s,i);let w={};return l&&(w.updatedPath=o),w.originalPath=r.points,w},"insertEdge"),HLe=x(t=>{const e=new Set;for(const r of t)switch(r){case"x":e.add("right"),e.add("left");break;case"y":e.add("up"),e.add("down");break;default:e.add(r);break}return e},"expandAndDeduplicateDirections"),qLe=x((t,e,r)=>{const n=HLe(t),i=2,a=e.height+2*r.padding,s=a/i,o=e.width+2*s+r.padding,l=r.padding/2;return n.has("right")&&n.has("left")&&n.has("up")&&n.has("down")?[{x:0,y:0},{x:s,y:0},{x:o/2,y:2*l},{x:o-s,y:0},{x:o,y:0},{x:o,y:-a/3},{x:o+2*l,y:-a/2},{x:o,y:-2*a/3},{x:o,y:-a},{x:o-s,y:-a},{x:o/2,y:-a-2*l},{x:s,y:-a},{x:0,y:-a},{x:0,y:-2*a/3},{x:-2*l,y:-a/2},{x:0,y:-a/3}]:n.has("right")&&n.has("left")&&n.has("up")?[{x:s,y:0},{x:o-s,y:0},{x:o,y:-a/2},{x:o-s,y:-a},{x:s,y:-a},{x:0,y:-a/2}]:n.has("right")&&n.has("left")&&n.has("down")?[{x:0,y:0},{x:s,y:-a},{x:o-s,y:-a},{x:o,y:0}]:n.has("right")&&n.has("up")&&n.has("down")?[{x:0,y:0},{x:o,y:-s},{x:o,y:-a+s},{x:0,y:-a}]:n.has("left")&&n.has("up")&&n.has("down")?[{x:o,y:0},{x:0,y:-s},{x:0,y:-a+s},{x:o,y:-a}]:n.has("right")&&n.has("left")?[{x:s,y:0},{x:s,y:-l},{x:o-s,y:-l},{x:o-s,y:0},{x:o,y:-a/2},{x:o-s,y:-a},{x:o-s,y:-a+l},{x:s,y:-a+l},{x:s,y:-a},{x:0,y:-a/2}]:n.has("up")&&n.has("down")?[{x:o/2,y:0},{x:0,y:-l},{x:s,y:-l},{x:s,y:-a+l},{x:0,y:-a+l},{x:o/2,y:-a},{x:o,y:-a+l},{x:o-s,y:-a+l},{x:o-s,y:-l},{x:o,y:-l}]:n.has("right")&&n.has("up")?[{x:0,y:0},{x:o,y:-s},{x:0,y:-a}]:n.has("right")&&n.has("down")?[{x:0,y:0},{x:o,y:0},{x:0,y:-a}]:n.has("left")&&n.has("up")?[{x:o,y:0},{x:0,y:-s},{x:o,y:-a}]:n.has("left")&&n.has("down")?[{x:o,y:0},{x:0,y:0},{x:o,y:-a}]:n.has("right")?[{x:s,y:-l},{x:s,y:-l},{x:o-s,y:-l},{x:o-s,y:0},{x:o,y:-a/2},{x:o-s,y:-a},{x:o-s,y:-a+l},{x:s,y:-a+l},{x:s,y:-a+l}]:n.has("left")?[{x:s,y:0},{x:s,y:-l},{x:o-s,y:-l},{x:o-s,y:-a+l},{x:s,y:-a+l},{x:s,y:-a},{x:0,y:-a/2}]:n.has("up")?[{x:s,y:-l},{x:s,y:-a+l},{x:0,y:-a+l},{x:o/2,y:-a},{x:o,y:-a+l},{x:o-s,y:-a+l},{x:o-s,y:-l}]:n.has("down")?[{x:o/2,y:0},{x:0,y:-l},{x:s,y:-l},{x:s,y:-a+l},{x:o-s,y:-a+l},{x:o-s,y:-l},{x:o,y:-l}]:[{x:0,y:0}]},"getArrowPoints");function Tq(t,e){return t.intersect(e)}x(Tq,"intersectNode");var YLe=Tq;function Eq(t,e,r,n){var i=t.x,a=t.y,s=i-n.x,o=a-n.y,l=Math.sqrt(e*e*o*o+r*r*s*s),u=Math.abs(e*r*s/l);n.x<i&&(u=-u);var h=Math.abs(e*r*o/l);return n.y<a&&(h=-h),{x:i+u,y:a+h}}x(Eq,"intersectEllipse");var kq=Eq;function Sq(t,e,r){return kq(t,e,e,r)}x(Sq,"intersectCircle");var XLe=Sq;function Cq(t,e,r,n){var i,a,s,o,l,u,h,d,f,p,g,m,v,y,b;if(i=e.y-t.y,s=t.x-e.x,l=e.x*t.y-t.x*e.y,f=i*r.x+s*r.y+l,p=i*n.x+s*n.y+l,!(f!==0&&p!==0&&HT(f,p))&&(a=n.y-r.y,o=r.x-n.x,u=n.x*r.y-r.x*n.y,h=a*t.x+o*t.y+u,d=a*e.x+o*e.y+u,!(h!==0&&d!==0&&HT(h,d))&&(g=i*o-a*s,g!==0)))return m=Math.abs(g/2),v=s*u-o*l,y=v<0?(v-m)/g:(v+m)/g,v=a*l-i*u,b=v<0?(v-m)/g:(v+m)/g,{x:y,y:b}}x(Cq,"intersectLine");function HT(t,e){return t*e>0}x(HT,"sameSign");var jLe=Cq,KLe=Aq;function Aq(t,e,r){var n=t.x,i=t.y,a=[],s=Number.POSITIVE_INFINITY,o=Number.POSITIVE_INFINITY;typeof e.forEach=="function"?e.forEach(function(g){s=Math.min(s,g.x),o=Math.min(o,g.y)}):(s=Math.min(s,e.x),o=Math.min(o,e.y));for(var l=n-t.width/2-s,u=i-t.height/2-o,h=0;h<e.length;h++){var d=e[h],f=e[h<e.length-1?h+1:0],p=jLe(t,r,{x:l+d.x,y:u+d.y},{x:l+f.x,y:u+f.y});p&&a.push(p)}return a.length?(a.length>1&&a.sort(function(g,m){var v=g.x-r.x,y=g.y-r.y,b=Math.sqrt(v*v+y*y),w=m.x-r.x,T=m.y-r.y,E=Math.sqrt(w*w+T*T);return b<E?-1:b===E?0:1}),a[0]):t}x(Aq,"intersectPolygon");var ZLe=x((t,e)=>{var r=t.x,n=t.y,i=e.x-r,a=e.y-n,s=t.width/2,o=t.height/2,l,u;return Math.abs(a)*s>Math.abs(i)*o?(a<0&&(o=-o),l=a===0?0:o*i/a,u=o):(i<0&&(s=-s),l=s,u=i===0?0:s*a/i),{x:r+l,y:n+u}},"intersectRect"),QLe=ZLe,Qr={node:YLe,circle:XLe,ellipse:kq,polygon:KLe,rect:QLe},ei=x(async(t,e,r,n)=>{const i=we();let a;const s=e.useHtmlLabels||Ir(i.flowchart.htmlLabels);r?a=r:a="node default";const o=t.insert("g").attr("class",a).attr("id",e.domId||e.id),l=o.insert("g").attr("class","label").attr("style",e.labelStyle);let u;e.labelText===void 0?u="":u=typeof e.labelText=="string"?e.labelText:e.labelText[0];const h=l.node();let d;e.labelType==="markdown"?d=Ra(l,fr(Ks(u),i),{useHtmlLabels:s,width:e.width||i.flowchart.wrappingWidth,classes:"markdown-node-label"},i):d=h.appendChild(await Ha(fr(Ks(u),i),e.labelStyle,!1,n));let f=d.getBBox();const p=e.padding/2;if(Ir(i.flowchart.htmlLabels)){const g=d.children[0],m=Qe(d),v=g.getElementsByTagName("img");if(v){const y=u.replace(/<img[^>]*>/g,"").trim()==="";await Promise.all([...v].map(b=>new Promise(w=>{function T(){if(b.style.display="flex",b.style.flexDirection="column",y){const E=i.fontSize?i.fontSize:window.getComputedStyle(document.body).fontSize,S=parseInt(E,10)*5+"px";b.style.minWidth=S,b.style.maxWidth=S}else b.style.width="100%";w(b)}x(T,"setupImage"),setTimeout(()=>{b.complete&&T()}),b.addEventListener("error",T),b.addEventListener("load",T)})))}f=g.getBoundingClientRect(),m.attr("width",f.width),m.attr("height",f.height)}return s?l.attr("transform","translate("+-f.width/2+", "+-f.height/2+")"):l.attr("transform","translate(0, "+-f.height/2+")"),e.centerLabel&&l.attr("transform","translate("+-f.width/2+", "+-f.height/2+")"),l.insert("rect",":first-child"),{shapeSvg:o,bbox:f,halfPadding:p,label:l}},"labelHelper"),dn=x((t,e)=>{const r=e.node().getBBox();t.width=r.width,t.height=r.height},"updateNodeBounds");function _s(t,e,r,n){return t.insert("polygon",":first-child").attr("points",n.map(function(i){return i.x+","+i.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-e/2+","+r/2+")")}x(_s,"insertPolygonShape");var JLe=x(async(t,e)=>{e.useHtmlLabels||we().flowchart.htmlLabels||(e.centerLabel=!0);const{shapeSvg:n,bbox:i,halfPadding:a}=await ei(t,e,"node "+e.classes,!0);ie.info("Classes = ",e.classes);const s=n.insert("rect",":first-child");return s.attr("rx",e.rx).attr("ry",e.ry).attr("x",-i.width/2-a).attr("y",-i.height/2-a).attr("width",i.width+e.padding).attr("height",i.height+e.padding),dn(e,s),e.intersect=function(o){return Qr.rect(e,o)},n},"note"),eRe=JLe,JR=x(t=>t?" "+t:"","formatClass"),Oa=x((t,e)=>`${e||"node default"}${JR(t.classes)} ${JR(t.class)}`,"getClassesFromNode"),eN=x(async(t,e)=>{const{shapeSvg:r,bbox:n}=await ei(t,e,Oa(e,void 0),!0),i=n.width+e.padding,a=n.height+e.padding,s=i+a,o=[{x:s/2,y:0},{x:s,y:-s/2},{x:s/2,y:-s},{x:0,y:-s/2}];ie.info("Question main (Circle)");const l=_s(r,s,s,o);return l.attr("style",e.style),dn(e,l),e.intersect=function(u){return ie.warn("Intersect called"),Qr.polygon(e,o,u)},r},"question"),tRe=x((t,e)=>{const r=t.insert("g").attr("class","node default").attr("id",e.domId||e.id),n=28,i=[{x:0,y:n/2},{x:n/2,y:0},{x:0,y:-n/2},{x:-n/2,y:0}];return r.insert("polygon",":first-child").attr("points",i.map(function(s){return s.x+","+s.y}).join(" ")).attr("class","state-start").attr("r",7).attr("width",28).attr("height",28),e.width=28,e.height=28,e.intersect=function(s){return Qr.circle(e,14,s)},r},"choice"),rRe=x(async(t,e)=>{const{shapeSvg:r,bbox:n}=await ei(t,e,Oa(e,void 0),!0),i=4,a=n.height+e.padding,s=a/i,o=n.width+2*s+e.padding,l=[{x:s,y:0},{x:o-s,y:0},{x:o,y:-a/2},{x:o-s,y:-a},{x:s,y:-a},{x:0,y:-a/2}],u=_s(r,o,a,l);return u.attr("style",e.style),dn(e,u),e.intersect=function(h){return Qr.polygon(e,l,h)},r},"hexagon"),nRe=x(async(t,e)=>{const{shapeSvg:r,bbox:n}=await ei(t,e,void 0,!0),i=2,a=n.height+2*e.padding,s=a/i,o=n.width+2*s+e.padding,l=qLe(e.directions,n,e),u=_s(r,o,a,l);return u.attr("style",e.style),dn(e,u),e.intersect=function(h){return Qr.polygon(e,l,h)},r},"block_arrow"),iRe=x(async(t,e)=>{const{shapeSvg:r,bbox:n}=await ei(t,e,Oa(e,void 0),!0),i=n.width+e.padding,a=n.height+e.padding,s=[{x:-a/2,y:0},{x:i,y:0},{x:i,y:-a},{x:-a/2,y:-a},{x:0,y:-a/2}];return _s(r,i,a,s).attr("style",e.style),e.width=i+a,e.height=a,e.intersect=function(l){return Qr.polygon(e,s,l)},r},"rect_left_inv_arrow"),aRe=x(async(t,e)=>{const{shapeSvg:r,bbox:n}=await ei(t,e,Oa(e),!0),i=n.width+e.padding,a=n.height+e.padding,s=[{x:-2*a/6,y:0},{x:i-a/6,y:0},{x:i+2*a/6,y:-a},{x:a/6,y:-a}],o=_s(r,i,a,s);return o.attr("style",e.style),dn(e,o),e.intersect=function(l){return Qr.polygon(e,s,l)},r},"lean_right"),sRe=x(async(t,e)=>{const{shapeSvg:r,bbox:n}=await ei(t,e,Oa(e,void 0),!0),i=n.width+e.padding,a=n.height+e.padding,s=[{x:2*a/6,y:0},{x:i+a/6,y:0},{x:i-2*a/6,y:-a},{x:-a/6,y:-a}],o=_s(r,i,a,s);return o.attr("style",e.style),dn(e,o),e.intersect=function(l){return Qr.polygon(e,s,l)},r},"lean_left"),oRe=x(async(t,e)=>{const{shapeSvg:r,bbox:n}=await ei(t,e,Oa(e,void 0),!0),i=n.width+e.padding,a=n.height+e.padding,s=[{x:-2*a/6,y:0},{x:i+2*a/6,y:0},{x:i-a/6,y:-a},{x:a/6,y:-a}],o=_s(r,i,a,s);return o.attr("style",e.style),dn(e,o),e.intersect=function(l){return Qr.polygon(e,s,l)},r},"trapezoid"),lRe=x(async(t,e)=>{const{shapeSvg:r,bbox:n}=await ei(t,e,Oa(e,void 0),!0),i=n.width+e.padding,a=n.height+e.padding,s=[{x:a/6,y:0},{x:i-a/6,y:0},{x:i+2*a/6,y:-a},{x:-2*a/6,y:-a}],o=_s(r,i,a,s);return o.attr("style",e.style),dn(e,o),e.intersect=function(l){return Qr.polygon(e,s,l)},r},"inv_trapezoid"),cRe=x(async(t,e)=>{const{shapeSvg:r,bbox:n}=await ei(t,e,Oa(e,void 0),!0),i=n.width+e.padding,a=n.height+e.padding,s=[{x:0,y:0},{x:i+a/2,y:0},{x:i,y:-a/2},{x:i+a/2,y:-a},{x:0,y:-a}],o=_s(r,i,a,s);return o.attr("style",e.style),dn(e,o),e.intersect=function(l){return Qr.polygon(e,s,l)},r},"rect_right_inv_arrow"),uRe=x(async(t,e)=>{const{shapeSvg:r,bbox:n}=await ei(t,e,Oa(e,void 0),!0),i=n.width+e.padding,a=i/2,s=a/(2.5+i/50),o=n.height+s+e.padding,l="M 0,"+s+" a "+a+","+s+" 0,0,0 "+i+" 0 a "+a+","+s+" 0,0,0 "+-i+" 0 l 0,"+o+" a "+a+","+s+" 0,0,0 "+i+" 0 l 0,"+-o,u=r.attr("label-offset-y",s).insert("path",":first-child").attr("style",e.style).attr("d",l).attr("transform","translate("+-i/2+","+-(o/2+s)+")");return dn(e,u),e.intersect=function(h){const d=Qr.rect(e,h),f=d.x-e.x;if(a!=0&&(Math.abs(f)<e.width/2||Math.abs(f)==e.width/2&&Math.abs(d.y-e.y)>e.height/2-s)){let p=s*s*(1-f*f/(a*a));p!=0&&(p=Math.sqrt(p)),p=s-p,h.y-e.y>0&&(p=-p),d.y+=p}return d},r},"cylinder"),hRe=x(async(t,e)=>{const{shapeSvg:r,bbox:n,halfPadding:i}=await ei(t,e,"node "+e.classes+" "+e.class,!0),a=r.insert("rect",":first-child"),s=e.positioned?e.width:n.width+e.padding,o=e.positioned?e.height:n.height+e.padding,l=e.positioned?-s/2:-n.width/2-i,u=e.positioned?-o/2:-n.height/2-i;if(a.attr("class","basic label-container").attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("x",l).attr("y",u).attr("width",s).attr("height",o),e.props){const h=new Set(Object.keys(e.props));e.props.borders&&(yx(a,e.props.borders,s,o),h.delete("borders")),h.forEach(d=>{ie.warn(`Unknown node property ${d}`)})}return dn(e,a),e.intersect=function(h){return Qr.rect(e,h)},r},"rect"),dRe=x(async(t,e)=>{const{shapeSvg:r,bbox:n,halfPadding:i}=await ei(t,e,"node "+e.classes,!0),a=r.insert("rect",":first-child"),s=e.positioned?e.width:n.width+e.padding,o=e.positioned?e.height:n.height+e.padding,l=e.positioned?-s/2:-n.width/2-i,u=e.positioned?-o/2:-n.height/2-i;if(a.attr("class","basic cluster composite label-container").attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("x",l).attr("y",u).attr("width",s).attr("height",o),e.props){const h=new Set(Object.keys(e.props));e.props.borders&&(yx(a,e.props.borders,s,o),h.delete("borders")),h.forEach(d=>{ie.warn(`Unknown node property ${d}`)})}return dn(e,a),e.intersect=function(h){return Qr.rect(e,h)},r},"composite"),fRe=x(async(t,e)=>{const{shapeSvg:r}=await ei(t,e,"label",!0);ie.trace("Classes = ",e.class);const n=r.insert("rect",":first-child"),i=0,a=0;if(n.attr("width",i).attr("height",a),r.attr("class","label edgeLabel"),e.props){const s=new Set(Object.keys(e.props));e.props.borders&&(yx(n,e.props.borders,i,a),s.delete("borders")),s.forEach(o=>{ie.warn(`Unknown node property ${o}`)})}return dn(e,n),e.intersect=function(s){return Qr.rect(e,s)},r},"labelRect");function yx(t,e,r,n){const i=[],a=x(o=>{i.push(o,0)},"addBorder"),s=x(o=>{i.push(0,o)},"skipBorder");e.includes("t")?(ie.debug("add top border"),a(r)):s(r),e.includes("r")?(ie.debug("add right border"),a(n)):s(n),e.includes("b")?(ie.debug("add bottom border"),a(r)):s(r),e.includes("l")?(ie.debug("add left border"),a(n)):s(n),t.attr("stroke-dasharray",i.join(" "))}x(yx,"applyNodePropertyBorders");var pRe=x(async(t,e)=>{let r;e.classes?r="node "+e.classes:r="node default";const n=t.insert("g").attr("class",r).attr("id",e.domId||e.id),i=n.insert("rect",":first-child"),a=n.insert("line"),s=n.insert("g").attr("class","label"),o=e.labelText.flat?e.labelText.flat():e.labelText;let l="";typeof o=="object"?l=o[0]:l=o,ie.info("Label text abc79",l,o,typeof o=="object");const u=s.node().appendChild(await Ha(l,e.labelStyle,!0,!0));let h={width:0,height:0};if(Ir(we().flowchart.htmlLabels)){const m=u.children[0],v=Qe(u);h=m.getBoundingClientRect(),v.attr("width",h.width),v.attr("height",h.height)}ie.info("Text 2",o);const d=o.slice(1,o.length);let f=u.getBBox();const p=s.node().appendChild(await Ha(d.join?d.join("<br/>"):d,e.labelStyle,!0,!0));if(Ir(we().flowchart.htmlLabels)){const m=p.children[0],v=Qe(p);h=m.getBoundingClientRect(),v.attr("width",h.width),v.attr("height",h.height)}const g=e.padding/2;return Qe(p).attr("transform","translate( "+(h.width>f.width?0:(f.width-h.width)/2)+", "+(f.height+g+5)+")"),Qe(u).attr("transform","translate( "+(h.width<f.width?0:-(f.width-h.width)/2)+", 0)"),h=s.node().getBBox(),s.attr("transform","translate("+-h.width/2+", "+(-h.height/2-g+3)+")"),i.attr("class","outer title-state").attr("x",-h.width/2-g).attr("y",-h.height/2-g).attr("width",h.width+e.padding).attr("height",h.height+e.padding),a.attr("class","divider").attr("x1",-h.width/2-g).attr("x2",h.width/2+g).attr("y1",-h.height/2-g+f.height+g).attr("y2",-h.height/2-g+f.height+g),dn(e,i),e.intersect=function(m){return Qr.rect(e,m)},n},"rectWithTitle"),gRe=x(async(t,e)=>{const{shapeSvg:r,bbox:n}=await ei(t,e,Oa(e,void 0),!0),i=n.height+e.padding,a=n.width+i/4+e.padding,s=r.insert("rect",":first-child").attr("style",e.style).attr("rx",i/2).attr("ry",i/2).attr("x",-a/2).attr("y",-i/2).attr("width",a).attr("height",i);return dn(e,s),e.intersect=function(o){return Qr.rect(e,o)},r},"stadium"),mRe=x(async(t,e)=>{const{shapeSvg:r,bbox:n,halfPadding:i}=await ei(t,e,Oa(e,void 0),!0),a=r.insert("circle",":first-child");return a.attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("r",n.width/2+i).attr("width",n.width+e.padding).attr("height",n.height+e.padding),ie.info("Circle main"),dn(e,a),e.intersect=function(s){return ie.info("Circle intersect",e,n.width/2+i,s),Qr.circle(e,n.width/2+i,s)},r},"circle"),vRe=x(async(t,e)=>{const{shapeSvg:r,bbox:n,halfPadding:i}=await ei(t,e,Oa(e,void 0),!0),a=5,s=r.insert("g",":first-child"),o=s.insert("circle"),l=s.insert("circle");return s.attr("class",e.class),o.attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("r",n.width/2+i+a).attr("width",n.width+e.padding+a*2).attr("height",n.height+e.padding+a*2),l.attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("r",n.width/2+i).attr("width",n.width+e.padding).attr("height",n.height+e.padding),ie.info("DoubleCircle main"),dn(e,o),e.intersect=function(u){return ie.info("DoubleCircle intersect",e,n.width/2+i+a,u),Qr.circle(e,n.width/2+i+a,u)},r},"doublecircle"),yRe=x(async(t,e)=>{const{shapeSvg:r,bbox:n}=await ei(t,e,Oa(e,void 0),!0),i=n.width+e.padding,a=n.height+e.padding,s=[{x:0,y:0},{x:i,y:0},{x:i,y:-a},{x:0,y:-a},{x:0,y:0},{x:-8,y:0},{x:i+8,y:0},{x:i+8,y:-a},{x:-8,y:-a},{x:-8,y:0}],o=_s(r,i,a,s);return o.attr("style",e.style),dn(e,o),e.intersect=function(l){return Qr.polygon(e,s,l)},r},"subroutine"),xRe=x((t,e)=>{const r=t.insert("g").attr("class","node default").attr("id",e.domId||e.id),n=r.insert("circle",":first-child");return n.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),dn(e,n),e.intersect=function(i){return Qr.circle(e,7,i)},r},"start"),tN=x((t,e,r)=>{const n=t.insert("g").attr("class","node default").attr("id",e.domId||e.id);let i=70,a=10;r==="LR"&&(i=10,a=70);const s=n.append("rect").attr("x",-1*i/2).attr("y",-1*a/2).attr("width",i).attr("height",a).attr("class","fork-join");return dn(e,s),e.height=e.height+e.padding/2,e.width=e.width+e.padding/2,e.intersect=function(o){return Qr.rect(e,o)},n},"forkJoin"),bRe=x((t,e)=>{const r=t.insert("g").attr("class","node default").attr("id",e.domId||e.id),n=r.insert("circle",":first-child"),i=r.insert("circle",":first-child");return i.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),n.attr("class","state-end").attr("r",5).attr("width",10).attr("height",10),dn(e,i),e.intersect=function(a){return Qr.circle(e,7,a)},r},"end"),wRe=x(async(t,e)=>{const r=e.padding/2,n=4,i=8;let a;e.classes?a="node "+e.classes:a="node default";const s=t.insert("g").attr("class",a).attr("id",e.domId||e.id),o=s.insert("rect",":first-child"),l=s.insert("line"),u=s.insert("line");let h=0,d=n;const f=s.insert("g").attr("class","label");let p=0;const g=e.classData.annotations?.[0],m=e.classData.annotations[0]?"«"+e.classData.annotations[0]+"»":"",v=f.node().appendChild(await Ha(m,e.labelStyle,!0,!0));let y=v.getBBox();if(Ir(we().flowchart.htmlLabels)){const C=v.children[0],A=Qe(v);y=C.getBoundingClientRect(),A.attr("width",y.width),A.attr("height",y.height)}e.classData.annotations[0]&&(d+=y.height+n,h+=y.width);let b=e.classData.label;e.classData.type!==void 0&&e.classData.type!==""&&(we().flowchart.htmlLabels?b+="&lt;"+e.classData.type+"&gt;":b+="<"+e.classData.type+">");const w=f.node().appendChild(await Ha(b,e.labelStyle,!0,!0));Qe(w).attr("class","classTitle");let T=w.getBBox();if(Ir(we().flowchart.htmlLabels)){const C=w.children[0],A=Qe(w);T=C.getBoundingClientRect(),A.attr("width",T.width),A.attr("height",T.height)}d+=T.height+n,T.width>h&&(h=T.width);const E=[];e.classData.members.forEach(async C=>{const A=C.getDisplayDetails();let N=A.displayText;we().flowchart.htmlLabels&&(N=N.replace(/</g,"&lt;").replace(/>/g,"&gt;"));const _=f.node().appendChild(await Ha(N,A.cssStyle?A.cssStyle:e.labelStyle,!0,!0));let O=_.getBBox();if(Ir(we().flowchart.htmlLabels)){const P=_.children[0],k=Qe(_);O=P.getBoundingClientRect(),k.attr("width",O.width),k.attr("height",O.height)}O.width>h&&(h=O.width),d+=O.height+n,E.push(_)}),d+=i;const L=[];if(e.classData.methods.forEach(async C=>{const A=C.getDisplayDetails();let N=A.displayText;we().flowchart.htmlLabels&&(N=N.replace(/</g,"&lt;").replace(/>/g,"&gt;"));const _=f.node().appendChild(await Ha(N,A.cssStyle?A.cssStyle:e.labelStyle,!0,!0));let O=_.getBBox();if(Ir(we().flowchart.htmlLabels)){const P=_.children[0],k=Qe(_);O=P.getBoundingClientRect(),k.attr("width",O.width),k.attr("height",O.height)}O.width>h&&(h=O.width),d+=O.height+n,L.push(_)}),d+=i,g){let C=(h-y.width)/2;Qe(v).attr("transform","translate( "+(-1*h/2+C)+", "+-1*d/2+")"),p=y.height+n}let S=(h-T.width)/2;return Qe(w).attr("transform","translate( "+(-1*h/2+S)+", "+(-1*d/2+p)+")"),p+=T.height+n,l.attr("class","divider").attr("x1",-h/2-r).attr("x2",h/2+r).attr("y1",-d/2-r+i+p).attr("y2",-d/2-r+i+p),p+=i,E.forEach(C=>{Qe(C).attr("transform","translate( "+-h/2+", "+(-1*d/2+p+i/2)+")");const A=C?.getBBox();p+=(A?.height??0)+n}),p+=i,u.attr("class","divider").attr("x1",-h/2-r).attr("x2",h/2+r).attr("y1",-d/2-r+i+p).attr("y2",-d/2-r+i+p),p+=i,L.forEach(C=>{Qe(C).attr("transform","translate( "+-h/2+", "+(-1*d/2+p)+")");const A=C?.getBBox();p+=(A?.height??0)+n}),o.attr("style",e.style).attr("class","outer title-state").attr("x",-h/2-r).attr("y",-(d/2)-r).attr("width",h+e.padding).attr("height",d+e.padding),dn(e,o),e.intersect=function(C){return Qr.rect(e,C)},s},"class_box"),rN={rhombus:eN,composite:dRe,question:eN,rect:hRe,labelRect:fRe,rectWithTitle:pRe,choice:tRe,circle:mRe,doublecircle:vRe,stadium:gRe,hexagon:rRe,block_arrow:nRe,rect_left_inv_arrow:iRe,lean_right:aRe,lean_left:sRe,trapezoid:oRe,inv_trapezoid:lRe,rect_right_inv_arrow:cRe,cylinder:uRe,start:xRe,end:bRe,note:eRe,subroutine:yRe,fork:tN,join:tN,class_box:wRe},Nm={},_q=x(async(t,e,r)=>{let n,i;if(e.link){let a;we().securityLevel==="sandbox"?a="_top":e.linkTarget&&(a=e.linkTarget||"_blank"),n=t.insert("svg:a").attr("xlink:href",e.link).attr("target",a),i=await rN[e.shape](n,e,r)}else i=await rN[e.shape](t,e,r),n=i;return e.tooltip&&i.attr("title",e.tooltip),e.class&&i.attr("class","node default "+e.class),Nm[e.id]=n,e.haveCallback&&Nm[e.id].attr("class",Nm[e.id].attr("class")+" clickable"),n},"insertNode"),TRe=x(t=>{const e=Nm[t.id];ie.trace("Transforming node",t.diff,t,"translate("+(t.x-t.width/2-5)+", "+t.width/2+")");const r=8,n=t.diff||0;return t.clusterNode?e.attr("transform","translate("+(t.x+n-t.width/2)+", "+(t.y-t.height/2-r)+")"):e.attr("transform","translate("+t.x+", "+t.y+")"),n},"positionNode");function TS(t,e,r=!1){const n=t;let i="default";(n?.classes?.length||0)>0&&(i=(n?.classes??[]).join(" ")),i=i+" flowchart-label";let a=0,s="",o;switch(n.type){case"round":a=5,s="rect";break;case"composite":a=0,s="composite",o=0;break;case"square":s="rect";break;case"diamond":s="question";break;case"hexagon":s="hexagon";break;case"block_arrow":s="block_arrow";break;case"odd":s="rect_left_inv_arrow";break;case"lean_right":s="lean_right";break;case"lean_left":s="lean_left";break;case"trapezoid":s="trapezoid";break;case"inv_trapezoid":s="inv_trapezoid";break;case"rect_left_inv_arrow":s="rect_left_inv_arrow";break;case"circle":s="circle";break;case"ellipse":s="ellipse";break;case"stadium":s="stadium";break;case"subroutine":s="subroutine";break;case"cylinder":s="cylinder";break;case"group":s="rect";break;case"doublecircle":s="doublecircle";break;default:s="rect"}const l=M6(n?.styles??[]),u=n.label,h=n.size??{width:0,height:0,x:0,y:0};return{labelStyle:l.labelStyle,shape:s,labelText:u,rx:a,ry:a,class:i,style:l.style,id:n.id,directions:n.directions,width:h.width,height:h.height,x:h.x,y:h.y,positioned:r,intersect:void 0,type:n.type,padding:o??gr()?.block?.padding??0}}x(TS,"getNodeFromBlock");async function Lq(t,e,r){const n=TS(e,r,!1);if(n.type==="group")return;const i=gr(),a=await _q(t,n,{config:i}),s=a.node().getBBox(),o=r.getBlock(n.id);o.size={width:s.width,height:s.height,x:0,y:0,node:a},r.setBlock(o),a.remove()}x(Lq,"calculateBlockSize");async function Rq(t,e,r){const n=TS(e,r,!0);if(r.getBlock(n.id).type!=="space"){const a=gr();await _q(t,n,{config:a}),e.intersect=n?.intersect,TRe(n)}}x(Rq,"insertBlockPositioned");async function xx(t,e,r,n){for(const i of e)await n(t,i,r),i.children&&await xx(t,i.children,r,n)}x(xx,"performOperations");async function Nq(t,e,r){await xx(t,e,r,Lq)}x(Nq,"calculateBlockSizes");async function Dq(t,e,r){await xx(t,e,r,Rq)}x(Dq,"insertBlocks");async function Mq(t,e,r,n,i){const a=new ma({multigraph:!0,compound:!0});a.setGraph({rankdir:"TB",nodesep:10,ranksep:10,marginx:8,marginy:8});for(const s of r)s.size&&a.setNode(s.id,{width:s.size.width,height:s.size.height,intersect:s.intersect});for(const s of e)if(s.start&&s.end){const o=n.getBlock(s.start),l=n.getBlock(s.end);if(o?.size&&l?.size){const u=o.size,h=l.size,d=[{x:u.x,y:u.y},{x:u.x+(h.x-u.x)/2,y:u.y+(h.y-u.y)/2},{x:h.x,y:h.y}];WLe(t,{v:s.start,w:s.end,name:s.id},{...s,arrowTypeEnd:s.arrowTypeEnd,arrowTypeStart:s.arrowTypeStart,points:d,classes:"edge-thickness-normal edge-pattern-solid flowchart-link LS-a1 LE-b1"},void 0,"block",a,i),s.label&&(await zLe(t,{...s,label:s.label,labelStyle:"stroke: #333; stroke-width: 1.5px;fill:none;",arrowTypeEnd:s.arrowTypeEnd,arrowTypeStart:s.arrowTypeStart,points:d,classes:"edge-thickness-normal edge-pattern-solid flowchart-link LS-a1 LE-b1"}),VLe({...s,x:d[1].x,y:d[1].y},{originalPath:d}))}}}x(Mq,"insertEdges");var ERe=x(function(t,e){return e.db.getClasses()},"getClasses"),kRe=x(async function(t,e,r,n){const{securityLevel:i,block:a}=gr(),s=n.db;let o;i==="sandbox"&&(o=Qe("#i"+e));const l=Qe(i==="sandbox"?o.nodes()[0].contentDocument.body:"body"),u=i==="sandbox"?l.select(`[id="${e}"]`):Qe(`[id="${e}"]`);OLe(u,["point","circle","cross"],n.type,e);const d=s.getBlocks(),f=s.getBlocksFlat(),p=s.getEdges(),g=u.insert("g").attr("class","block");await Nq(g,d,s);const m=bq(s);if(await Dq(g,d,s),await Mq(g,p,f,s,e),m){const v=m,y=Math.max(1,Math.round(.125*(v.width/v.height))),b=v.height+y+10,w=v.width+10,{useMaxWidth:T}=a;ji(u,b,w,!!T),ie.debug("Here Bounds",m,v),u.attr("viewBox",`${v.x-5} ${v.y-5} ${v.width+10} ${v.height+10}`)}},"draw"),SRe={draw:kRe,getClasses:ERe},CRe={parser:rLe,db:wLe,renderer:SRe,styles:ELe};const ARe=Object.freeze(Object.defineProperty({__proto__:null,diagram:CRe},Symbol.toStringTag,{value:"Module"}));var Iq={exports:{}},B3={exports:{}},F3={exports:{}},nN;function _Re(){return nN||(nN=1,function(t,e){(function(n,i){t.exports=i()})(to,function(){return function(r){var n={};function i(a){if(n[a])return n[a].exports;var s=n[a]={i:a,l:!1,exports:{}};return r[a].call(s.exports,s,s.exports,i),s.l=!0,s.exports}return i.m=r,i.c=n,i.i=function(a){return a},i.d=function(a,s,o){i.o(a,s)||Object.defineProperty(a,s,{configurable:!1,enumerable:!0,get:o})},i.n=function(a){var s=a&&a.__esModule?function(){return a.default}:function(){return a};return i.d(s,"a",s),s},i.o=function(a,s){return Object.prototype.hasOwnProperty.call(a,s)},i.p="",i(i.s=28)}([function(r,n,i){function a(){}a.QUALITY=1,a.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,a.DEFAULT_INCREMENTAL=!1,a.DEFAULT_ANIMATION_ON_LAYOUT=!0,a.DEFAULT_ANIMATION_DURING_LAYOUT=!1,a.DEFAULT_ANIMATION_PERIOD=50,a.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,a.DEFAULT_GRAPH_MARGIN=15,a.NODE_DIMENSIONS_INCLUDE_LABELS=!1,a.SIMPLE_NODE_SIZE=40,a.SIMPLE_NODE_HALF_SIZE=a.SIMPLE_NODE_SIZE/2,a.EMPTY_COMPOUND_NODE_SIZE=40,a.MIN_EDGE_LENGTH=1,a.WORLD_BOUNDARY=1e6,a.INITIAL_WORLD_BOUNDARY=a.WORLD_BOUNDARY/1e3,a.WORLD_CENTER_X=1200,a.WORLD_CENTER_Y=900,r.exports=a},function(r,n,i){var a=i(2),s=i(8),o=i(9);function l(h,d,f){a.call(this,f),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=f,this.bendpoints=[],this.source=h,this.target=d}l.prototype=Object.create(a.prototype);for(var u in a)l[u]=a[u];l.prototype.getSource=function(){return this.source},l.prototype.getTarget=function(){return this.target},l.prototype.isInterGraph=function(){return this.isInterGraph},l.prototype.getLength=function(){return this.length},l.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},l.prototype.getBendpoints=function(){return this.bendpoints},l.prototype.getLca=function(){return this.lca},l.prototype.getSourceInLca=function(){return this.sourceInLca},l.prototype.getTargetInLca=function(){return this.targetInLca},l.prototype.getOtherEnd=function(h){if(this.source===h)return this.target;if(this.target===h)return this.source;throw"Node is not incident with this edge"},l.prototype.getOtherEndInGraph=function(h,d){for(var f=this.getOtherEnd(h),p=d.getGraphManager().getRoot();;){if(f.getOwner()==d)return f;if(f.getOwner()==p)break;f=f.getOwner().getParent()}return null},l.prototype.updateLength=function(){var h=new Array(4);this.isOverlapingSourceAndTarget=s.getIntersection(this.target.getRect(),this.source.getRect(),h),this.isOverlapingSourceAndTarget||(this.lengthX=h[0]-h[2],this.lengthY=h[1]-h[3],Math.abs(this.lengthX)<1&&(this.lengthX=o.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=o.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},l.prototype.updateLengthSimple=function(){this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),Math.abs(this.lengthX)<1&&(this.lengthX=o.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=o.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},r.exports=l},function(r,n,i){function a(s){this.vGraphObject=s}r.exports=a},function(r,n,i){var a=i(2),s=i(10),o=i(13),l=i(0),u=i(16),h=i(5);function d(p,g,m,v){m==null&&v==null&&(v=g),a.call(this,v),p.graphManager!=null&&(p=p.graphManager),this.estimatedSize=s.MIN_VALUE,this.inclusionTreeDepth=s.MAX_VALUE,this.vGraphObject=v,this.edges=[],this.graphManager=p,m!=null&&g!=null?this.rect=new o(g.x,g.y,m.width,m.height):this.rect=new o}d.prototype=Object.create(a.prototype);for(var f in a)d[f]=a[f];d.prototype.getEdges=function(){return this.edges},d.prototype.getChild=function(){return this.child},d.prototype.getOwner=function(){return this.owner},d.prototype.getWidth=function(){return this.rect.width},d.prototype.setWidth=function(p){this.rect.width=p},d.prototype.getHeight=function(){return this.rect.height},d.prototype.setHeight=function(p){this.rect.height=p},d.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},d.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},d.prototype.getCenter=function(){return new h(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},d.prototype.getLocation=function(){return new h(this.rect.x,this.rect.y)},d.prototype.getRect=function(){return this.rect},d.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},d.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},d.prototype.setRect=function(p,g){this.rect.x=p.x,this.rect.y=p.y,this.rect.width=g.width,this.rect.height=g.height},d.prototype.setCenter=function(p,g){this.rect.x=p-this.rect.width/2,this.rect.y=g-this.rect.height/2},d.prototype.setLocation=function(p,g){this.rect.x=p,this.rect.y=g},d.prototype.moveBy=function(p,g){this.rect.x+=p,this.rect.y+=g},d.prototype.getEdgeListToNode=function(p){var g=[],m=this;return m.edges.forEach(function(v){if(v.target==p){if(v.source!=m)throw"Incorrect edge source!";g.push(v)}}),g},d.prototype.getEdgesBetween=function(p){var g=[],m=this;return m.edges.forEach(function(v){if(!(v.source==m||v.target==m))throw"Incorrect edge source and/or target";(v.target==p||v.source==p)&&g.push(v)}),g},d.prototype.getNeighborsList=function(){var p=new Set,g=this;return g.edges.forEach(function(m){if(m.source==g)p.add(m.target);else{if(m.target!=g)throw"Incorrect incidency!";p.add(m.source)}}),p},d.prototype.withChildren=function(){var p=new Set,g,m;if(p.add(this),this.child!=null)for(var v=this.child.getNodes(),y=0;y<v.length;y++)g=v[y],m=g.withChildren(),m.forEach(function(b){p.add(b)});return p},d.prototype.getNoOfChildren=function(){var p=0,g;if(this.child==null)p=1;else for(var m=this.child.getNodes(),v=0;v<m.length;v++)g=m[v],p+=g.getNoOfChildren();return p==0&&(p=1),p},d.prototype.getEstimatedSize=function(){if(this.estimatedSize==s.MIN_VALUE)throw"assert failed";return this.estimatedSize},d.prototype.calcEstimatedSize=function(){return this.child==null?this.estimatedSize=(this.rect.width+this.rect.height)/2:(this.estimatedSize=this.child.calcEstimatedSize(),this.rect.width=this.estimatedSize,this.rect.height=this.estimatedSize,this.estimatedSize)},d.prototype.scatter=function(){var p,g,m=-l.INITIAL_WORLD_BOUNDARY,v=l.INITIAL_WORLD_BOUNDARY;p=l.WORLD_CENTER_X+u.nextDouble()*(v-m)+m;var y=-l.INITIAL_WORLD_BOUNDARY,b=l.INITIAL_WORLD_BOUNDARY;g=l.WORLD_CENTER_Y+u.nextDouble()*(b-y)+y,this.rect.x=p,this.rect.y=g},d.prototype.updateBounds=function(){if(this.getChild()==null)throw"assert failed";if(this.getChild().getNodes().length!=0){var p=this.getChild();if(p.updateBounds(!0),this.rect.x=p.getLeft(),this.rect.y=p.getTop(),this.setWidth(p.getRight()-p.getLeft()),this.setHeight(p.getBottom()-p.getTop()),l.NODE_DIMENSIONS_INCLUDE_LABELS){var g=p.getRight()-p.getLeft(),m=p.getBottom()-p.getTop();this.labelWidth&&(this.labelPosHorizontal=="left"?(this.rect.x-=this.labelWidth,this.setWidth(g+this.labelWidth)):this.labelPosHorizontal=="center"&&this.labelWidth>g?(this.rect.x-=(this.labelWidth-g)/2,this.setWidth(this.labelWidth)):this.labelPosHorizontal=="right"&&this.setWidth(g+this.labelWidth)),this.labelHeight&&(this.labelPosVertical=="top"?(this.rect.y-=this.labelHeight,this.setHeight(m+this.labelHeight)):this.labelPosVertical=="center"&&this.labelHeight>m?(this.rect.y-=(this.labelHeight-m)/2,this.setHeight(this.labelHeight)):this.labelPosVertical=="bottom"&&this.setHeight(m+this.labelHeight))}}},d.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==s.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},d.prototype.transform=function(p){var g=this.rect.x;g>l.WORLD_BOUNDARY?g=l.WORLD_BOUNDARY:g<-l.WORLD_BOUNDARY&&(g=-l.WORLD_BOUNDARY);var m=this.rect.y;m>l.WORLD_BOUNDARY?m=l.WORLD_BOUNDARY:m<-l.WORLD_BOUNDARY&&(m=-l.WORLD_BOUNDARY);var v=new h(g,m),y=p.inverseTransformPoint(v);this.setLocation(y.x,y.y)},d.prototype.getLeft=function(){return this.rect.x},d.prototype.getRight=function(){return this.rect.x+this.rect.width},d.prototype.getTop=function(){return this.rect.y},d.prototype.getBottom=function(){return this.rect.y+this.rect.height},d.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},r.exports=d},function(r,n,i){var a=i(0);function s(){}for(var o in a)s[o]=a[o];s.MAX_ITERATIONS=2500,s.DEFAULT_EDGE_LENGTH=50,s.DEFAULT_SPRING_STRENGTH=.45,s.DEFAULT_REPULSION_STRENGTH=4500,s.DEFAULT_GRAVITY_STRENGTH=.4,s.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,s.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,s.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,s.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,s.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,s.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,s.COOLING_ADAPTATION_FACTOR=.33,s.ADAPTATION_LOWER_NODE_LIMIT=1e3,s.ADAPTATION_UPPER_NODE_LIMIT=5e3,s.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,s.MAX_NODE_DISPLACEMENT=s.MAX_NODE_DISPLACEMENT_INCREMENTAL*3,s.MIN_REPULSION_DIST=s.DEFAULT_EDGE_LENGTH/10,s.CONVERGENCE_CHECK_PERIOD=100,s.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,s.MIN_EDGE_LENGTH=1,s.GRID_CALCULATION_CHECK_PERIOD=10,r.exports=s},function(r,n,i){function a(s,o){s==null&&o==null?(this.x=0,this.y=0):(this.x=s,this.y=o)}a.prototype.getX=function(){return this.x},a.prototype.getY=function(){return this.y},a.prototype.setX=function(s){this.x=s},a.prototype.setY=function(s){this.y=s},a.prototype.getDifference=function(s){return new DimensionD(this.x-s.x,this.y-s.y)},a.prototype.getCopy=function(){return new a(this.x,this.y)},a.prototype.translate=function(s){return this.x+=s.width,this.y+=s.height,this},r.exports=a},function(r,n,i){var a=i(2),s=i(10),o=i(0),l=i(7),u=i(3),h=i(1),d=i(13),f=i(12),p=i(11);function g(v,y,b){a.call(this,b),this.estimatedSize=s.MIN_VALUE,this.margin=o.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=v,y!=null&&y instanceof l?this.graphManager=y:y!=null&&y instanceof Layout&&(this.graphManager=y.graphManager)}g.prototype=Object.create(a.prototype);for(var m in a)g[m]=a[m];g.prototype.getNodes=function(){return this.nodes},g.prototype.getEdges=function(){return this.edges},g.prototype.getGraphManager=function(){return this.graphManager},g.prototype.getParent=function(){return this.parent},g.prototype.getLeft=function(){return this.left},g.prototype.getRight=function(){return this.right},g.prototype.getTop=function(){return this.top},g.prototype.getBottom=function(){return this.bottom},g.prototype.isConnected=function(){return this.isConnected},g.prototype.add=function(v,y,b){if(y==null&&b==null){var w=v;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(w)>-1)throw"Node already in graph!";return w.owner=this,this.getNodes().push(w),w}else{var T=v;if(!(this.getNodes().indexOf(y)>-1&&this.getNodes().indexOf(b)>-1))throw"Source or target not in graph!";if(!(y.owner==b.owner&&y.owner==this))throw"Both owners must be this graph!";return y.owner!=b.owner?null:(T.source=y,T.target=b,T.isInterGraph=!1,this.getEdges().push(T),y.edges.push(T),b!=y&&b.edges.push(T),T)}},g.prototype.remove=function(v){var y=v;if(v instanceof u){if(y==null)throw"Node is null!";if(!(y.owner!=null&&y.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";for(var b=y.edges.slice(),w,T=b.length,E=0;E<T;E++)w=b[E],w.isInterGraph?this.graphManager.remove(w):w.source.owner.remove(w);var L=this.nodes.indexOf(y);if(L==-1)throw"Node not in owner node list!";this.nodes.splice(L,1)}else if(v instanceof h){var w=v;if(w==null)throw"Edge is null!";if(!(w.source!=null&&w.target!=null))throw"Source and/or target is null!";if(!(w.source.owner!=null&&w.target.owner!=null&&w.source.owner==this&&w.target.owner==this))throw"Source and/or target owner is invalid!";var S=w.source.edges.indexOf(w),C=w.target.edges.indexOf(w);if(!(S>-1&&C>-1))throw"Source and/or target doesn't know this edge!";w.source.edges.splice(S,1),w.target!=w.source&&w.target.edges.splice(C,1);var L=w.source.owner.getEdges().indexOf(w);if(L==-1)throw"Not in owner's edge list!";w.source.owner.getEdges().splice(L,1)}},g.prototype.updateLeftTop=function(){for(var v=s.MAX_VALUE,y=s.MAX_VALUE,b,w,T,E=this.getNodes(),L=E.length,S=0;S<L;S++){var C=E[S];b=C.getTop(),w=C.getLeft(),v>b&&(v=b),y>w&&(y=w)}return v==s.MAX_VALUE?null:(E[0].getParent().paddingLeft!=null?T=E[0].getParent().paddingLeft:T=this.margin,this.left=y-T,this.top=v-T,new f(this.left,this.top))},g.prototype.updateBounds=function(v){for(var y=s.MAX_VALUE,b=-s.MAX_VALUE,w=s.MAX_VALUE,T=-s.MAX_VALUE,E,L,S,C,A,N=this.nodes,_=N.length,O=0;O<_;O++){var P=N[O];v&&P.child!=null&&P.updateBounds(),E=P.getLeft(),L=P.getRight(),S=P.getTop(),C=P.getBottom(),y>E&&(y=E),b<L&&(b=L),w>S&&(w=S),T<C&&(T=C)}var k=new d(y,w,b-y,T-w);y==s.MAX_VALUE&&(this.left=this.parent.getLeft(),this.right=this.parent.getRight(),this.top=this.parent.getTop(),this.bottom=this.parent.getBottom()),N[0].getParent().paddingLeft!=null?A=N[0].getParent().paddingLeft:A=this.margin,this.left=k.x-A,this.right=k.x+k.width+A,this.top=k.y-A,this.bottom=k.y+k.height+A},g.calculateBounds=function(v){for(var y=s.MAX_VALUE,b=-s.MAX_VALUE,w=s.MAX_VALUE,T=-s.MAX_VALUE,E,L,S,C,A=v.length,N=0;N<A;N++){var _=v[N];E=_.getLeft(),L=_.getRight(),S=_.getTop(),C=_.getBottom(),y>E&&(y=E),b<L&&(b=L),w>S&&(w=S),T<C&&(T=C)}var O=new d(y,w,b-y,T-w);return O},g.prototype.getInclusionTreeDepth=function(){return this==this.graphManager.getRoot()?1:this.parent.getInclusionTreeDepth()},g.prototype.getEstimatedSize=function(){if(this.estimatedSize==s.MIN_VALUE)throw"assert failed";return this.estimatedSize},g.prototype.calcEstimatedSize=function(){for(var v=0,y=this.nodes,b=y.length,w=0;w<b;w++){var T=y[w];v+=T.calcEstimatedSize()}return v==0?this.estimatedSize=o.EMPTY_COMPOUND_NODE_SIZE:this.estimatedSize=v/Math.sqrt(this.nodes.length),this.estimatedSize},g.prototype.updateConnected=function(){var v=this;if(this.nodes.length==0){this.isConnected=!0;return}var y=new p,b=new Set,w=this.nodes[0],T,E,L=w.withChildren();for(L.forEach(function(O){y.push(O),b.add(O)});y.length!==0;){w=y.shift(),T=w.getEdges();for(var S=T.length,C=0;C<S;C++){var A=T[C];if(E=A.getOtherEndInGraph(w,this),E!=null&&!b.has(E)){var N=E.withChildren();N.forEach(function(O){y.push(O),b.add(O)})}}}if(this.isConnected=!1,b.size>=this.nodes.length){var _=0;b.forEach(function(O){O.owner==v&&_++}),_==this.nodes.length&&(this.isConnected=!0)}},r.exports=g},function(r,n,i){var a,s=i(1);function o(l){a=i(6),this.layout=l,this.graphs=[],this.edges=[]}o.prototype.addRoot=function(){var l=this.layout.newGraph(),u=this.layout.newNode(null),h=this.add(l,u);return this.setRootGraph(h),this.rootGraph},o.prototype.add=function(l,u,h,d,f){if(h==null&&d==null&&f==null){if(l==null)throw"Graph is null!";if(u==null)throw"Parent node is null!";if(this.graphs.indexOf(l)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(l),l.parent!=null)throw"Already has a parent!";if(u.child!=null)throw"Already has a child!";return l.parent=u,u.child=l,l}else{f=h,d=u,h=l;var p=d.getOwner(),g=f.getOwner();if(!(p!=null&&p.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(g!=null&&g.getGraphManager()==this))throw"Target not in this graph mgr!";if(p==g)return h.isInterGraph=!1,p.add(h,d,f);if(h.isInterGraph=!0,h.source=d,h.target=f,this.edges.indexOf(h)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(h),!(h.source!=null&&h.target!=null))throw"Edge source and/or target is null!";if(!(h.source.edges.indexOf(h)==-1&&h.target.edges.indexOf(h)==-1))throw"Edge already in source and/or target incidency list!";return h.source.edges.push(h),h.target.edges.push(h),h}},o.prototype.remove=function(l){if(l instanceof a){var u=l;if(u.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(u==this.rootGraph||u.parent!=null&&u.parent.graphManager==this))throw"Invalid parent node!";var h=[];h=h.concat(u.getEdges());for(var d,f=h.length,p=0;p<f;p++)d=h[p],u.remove(d);var g=[];g=g.concat(u.getNodes());var m;f=g.length;for(var p=0;p<f;p++)m=g[p],u.remove(m);u==this.rootGraph&&this.setRootGraph(null);var v=this.graphs.indexOf(u);this.graphs.splice(v,1),u.parent=null}else if(l instanceof s){if(d=l,d==null)throw"Edge is null!";if(!d.isInterGraph)throw"Not an inter-graph edge!";if(!(d.source!=null&&d.target!=null))throw"Source and/or target is null!";if(!(d.source.edges.indexOf(d)!=-1&&d.target.edges.indexOf(d)!=-1))throw"Source and/or target doesn't know this edge!";var v=d.source.edges.indexOf(d);if(d.source.edges.splice(v,1),v=d.target.edges.indexOf(d),d.target.edges.splice(v,1),!(d.source.owner!=null&&d.source.owner.getGraphManager()!=null))throw"Edge owner graph or owner graph manager is null!";if(d.source.owner.getGraphManager().edges.indexOf(d)==-1)throw"Not in owner graph manager's edge list!";var v=d.source.owner.getGraphManager().edges.indexOf(d);d.source.owner.getGraphManager().edges.splice(v,1)}},o.prototype.updateBounds=function(){this.rootGraph.updateBounds(!0)},o.prototype.getGraphs=function(){return this.graphs},o.prototype.getAllNodes=function(){if(this.allNodes==null){for(var l=[],u=this.getGraphs(),h=u.length,d=0;d<h;d++)l=l.concat(u[d].getNodes());this.allNodes=l}return this.allNodes},o.prototype.resetAllNodes=function(){this.allNodes=null},o.prototype.resetAllEdges=function(){this.allEdges=null},o.prototype.resetAllNodesToApplyGravitation=function(){this.allNodesToApplyGravitation=null},o.prototype.getAllEdges=function(){if(this.allEdges==null){var l=[],u=this.getGraphs();u.length;for(var h=0;h<u.length;h++)l=l.concat(u[h].getEdges());l=l.concat(this.edges),this.allEdges=l}return this.allEdges},o.prototype.getAllNodesToApplyGravitation=function(){return this.allNodesToApplyGravitation},o.prototype.setAllNodesToApplyGravitation=function(l){if(this.allNodesToApplyGravitation!=null)throw"assert failed";this.allNodesToApplyGravitation=l},o.prototype.getRoot=function(){return this.rootGraph},o.prototype.setRootGraph=function(l){if(l.getGraphManager()!=this)throw"Root not in this graph mgr!";this.rootGraph=l,l.parent==null&&(l.parent=this.layout.newNode("Root node"))},o.prototype.getLayout=function(){return this.layout},o.prototype.isOneAncestorOfOther=function(l,u){if(!(l!=null&&u!=null))throw"assert failed";if(l==u)return!0;var h=l.getOwner(),d;do{if(d=h.getParent(),d==null)break;if(d==u)return!0;if(h=d.getOwner(),h==null)break}while(!0);h=u.getOwner();do{if(d=h.getParent(),d==null)break;if(d==l)return!0;if(h=d.getOwner(),h==null)break}while(!0);return!1},o.prototype.calcLowestCommonAncestors=function(){for(var l,u,h,d,f,p=this.getAllEdges(),g=p.length,m=0;m<g;m++){if(l=p[m],u=l.source,h=l.target,l.lca=null,l.sourceInLca=u,l.targetInLca=h,u==h){l.lca=u.getOwner();continue}for(d=u.getOwner();l.lca==null;){for(l.targetInLca=h,f=h.getOwner();l.lca==null;){if(f==d){l.lca=f;break}if(f==this.rootGraph)break;if(l.lca!=null)throw"assert failed";l.targetInLca=f.getParent(),f=l.targetInLca.getOwner()}if(d==this.rootGraph)break;l.lca==null&&(l.sourceInLca=d.getParent(),d=l.sourceInLca.getOwner())}if(l.lca==null)throw"assert failed"}},o.prototype.calcLowestCommonAncestor=function(l,u){if(l==u)return l.getOwner();var h=l.getOwner();do{if(h==null)break;var d=u.getOwner();do{if(d==null)break;if(d==h)return d;d=d.getParent().getOwner()}while(!0);h=h.getParent().getOwner()}while(!0);return h},o.prototype.calcInclusionTreeDepths=function(l,u){l==null&&u==null&&(l=this.rootGraph,u=1);for(var h,d=l.getNodes(),f=d.length,p=0;p<f;p++)h=d[p],h.inclusionTreeDepth=u,h.child!=null&&this.calcInclusionTreeDepths(h.child,u+1)},o.prototype.includesInvalidEdge=function(){for(var l,u=[],h=this.edges.length,d=0;d<h;d++)l=this.edges[d],this.isOneAncestorOfOther(l.source,l.target)&&u.push(l);for(var d=0;d<u.length;d++)this.remove(u[d]);return!1},r.exports=o},function(r,n,i){var a=i(12);function s(){}s.calcSeparationAmount=function(o,l,u,h){if(!o.intersects(l))throw"assert failed";var d=new Array(2);this.decideDirectionsForOverlappingNodes(o,l,d),u[0]=Math.min(o.getRight(),l.getRight())-Math.max(o.x,l.x),u[1]=Math.min(o.getBottom(),l.getBottom())-Math.max(o.y,l.y),o.getX()<=l.getX()&&o.getRight()>=l.getRight()?u[0]+=Math.min(l.getX()-o.getX(),o.getRight()-l.getRight()):l.getX()<=o.getX()&&l.getRight()>=o.getRight()&&(u[0]+=Math.min(o.getX()-l.getX(),l.getRight()-o.getRight())),o.getY()<=l.getY()&&o.getBottom()>=l.getBottom()?u[1]+=Math.min(l.getY()-o.getY(),o.getBottom()-l.getBottom()):l.getY()<=o.getY()&&l.getBottom()>=o.getBottom()&&(u[1]+=Math.min(o.getY()-l.getY(),l.getBottom()-o.getBottom()));var f=Math.abs((l.getCenterY()-o.getCenterY())/(l.getCenterX()-o.getCenterX()));l.getCenterY()===o.getCenterY()&&l.getCenterX()===o.getCenterX()&&(f=1);var p=f*u[0],g=u[1]/f;u[0]<g?g=u[0]:p=u[1],u[0]=-1*d[0]*(g/2+h),u[1]=-1*d[1]*(p/2+h)},s.decideDirectionsForOverlappingNodes=function(o,l,u){o.getCenterX()<l.getCenterX()?u[0]=-1:u[0]=1,o.getCenterY()<l.getCenterY()?u[1]=-1:u[1]=1},s.getIntersection2=function(o,l,u){var h=o.getCenterX(),d=o.getCenterY(),f=l.getCenterX(),p=l.getCenterY();if(o.intersects(l))return u[0]=h,u[1]=d,u[2]=f,u[3]=p,!0;var g=o.getX(),m=o.getY(),v=o.getRight(),y=o.getX(),b=o.getBottom(),w=o.getRight(),T=o.getWidthHalf(),E=o.getHeightHalf(),L=l.getX(),S=l.getY(),C=l.getRight(),A=l.getX(),N=l.getBottom(),_=l.getRight(),O=l.getWidthHalf(),P=l.getHeightHalf(),k=!1,R=!1;if(h===f){if(d>p)return u[0]=h,u[1]=m,u[2]=f,u[3]=N,!1;if(d<p)return u[0]=h,u[1]=b,u[2]=f,u[3]=S,!1}else if(d===p){if(h>f)return u[0]=g,u[1]=d,u[2]=C,u[3]=p,!1;if(h<f)return u[0]=v,u[1]=d,u[2]=L,u[3]=p,!1}else{var I=o.height/o.width,M=l.height/l.width,D=(p-d)/(f-h),B=void 0,$=void 0,F=void 0,G=void 0,W=void 0,J=void 0;if(-I===D?h>f?(u[0]=y,u[1]=b,k=!0):(u[0]=v,u[1]=m,k=!0):I===D&&(h>f?(u[0]=g,u[1]=m,k=!0):(u[0]=w,u[1]=b,k=!0)),-M===D?f>h?(u[2]=A,u[3]=N,R=!0):(u[2]=C,u[3]=S,R=!0):M===D&&(f>h?(u[2]=L,u[3]=S,R=!0):(u[2]=_,u[3]=N,R=!0)),k&&R)return!1;if(h>f?d>p?(B=this.getCardinalDirection(I,D,4),$=this.getCardinalDirection(M,D,2)):(B=this.getCardinalDirection(-I,D,3),$=this.getCardinalDirection(-M,D,1)):d>p?(B=this.getCardinalDirection(-I,D,1),$=this.getCardinalDirection(-M,D,3)):(B=this.getCardinalDirection(I,D,2),$=this.getCardinalDirection(M,D,4)),!k)switch(B){case 1:G=m,F=h+-E/D,u[0]=F,u[1]=G;break;case 2:F=w,G=d+T*D,u[0]=F,u[1]=G;break;case 3:G=b,F=h+E/D,u[0]=F,u[1]=G;break;case 4:F=y,G=d+-T*D,u[0]=F,u[1]=G;break}if(!R)switch($){case 1:J=S,W=f+-P/D,u[2]=W,u[3]=J;break;case 2:W=_,J=p+O*D,u[2]=W,u[3]=J;break;case 3:J=N,W=f+P/D,u[2]=W,u[3]=J;break;case 4:W=A,J=p+-O*D,u[2]=W,u[3]=J;break}}return!1},s.getCardinalDirection=function(o,l,u){return o>l?u:1+u%4},s.getIntersection=function(o,l,u,h){if(h==null)return this.getIntersection2(o,l,u);var d=o.x,f=o.y,p=l.x,g=l.y,m=u.x,v=u.y,y=h.x,b=h.y,w=void 0,T=void 0,E=void 0,L=void 0,S=void 0,C=void 0,A=void 0,N=void 0,_=void 0;return E=g-f,S=d-p,A=p*f-d*g,L=b-v,C=m-y,N=y*v-m*b,_=E*C-L*S,_===0?null:(w=(S*N-C*A)/_,T=(L*A-E*N)/_,new a(w,T))},s.angleOfVector=function(o,l,u,h){var d=void 0;return o!==u?(d=Math.atan((h-l)/(u-o)),u<o?d+=Math.PI:h<l&&(d+=this.TWO_PI)):h<l?d=this.ONE_AND_HALF_PI:d=this.HALF_PI,d},s.doIntersect=function(o,l,u,h){var d=o.x,f=o.y,p=l.x,g=l.y,m=u.x,v=u.y,y=h.x,b=h.y,w=(p-d)*(b-v)-(y-m)*(g-f);if(w===0)return!1;var T=((b-v)*(y-d)+(m-y)*(b-f))/w,E=((f-g)*(y-d)+(p-d)*(b-f))/w;return 0<T&&T<1&&0<E&&E<1},s.findCircleLineIntersections=function(o,l,u,h,d,f,p){var g=(u-o)*(u-o)+(h-l)*(h-l),m=2*((o-d)*(u-o)+(l-f)*(h-l)),v=(o-d)*(o-d)+(l-f)*(l-f)-p*p,y=m*m-4*g*v;if(y>=0){var b=(-m+Math.sqrt(m*m-4*g*v))/(2*g),w=(-m-Math.sqrt(m*m-4*g*v))/(2*g),T=null;return b>=0&&b<=1?[b]:w>=0&&w<=1?[w]:T}else return null},s.HALF_PI=.5*Math.PI,s.ONE_AND_HALF_PI=1.5*Math.PI,s.TWO_PI=2*Math.PI,s.THREE_PI=3*Math.PI,r.exports=s},function(r,n,i){function a(){}a.sign=function(s){return s>0?1:s<0?-1:0},a.floor=function(s){return s<0?Math.ceil(s):Math.floor(s)},a.ceil=function(s){return s<0?Math.floor(s):Math.ceil(s)},r.exports=a},function(r,n,i){function a(){}a.MAX_VALUE=2147483647,a.MIN_VALUE=-2147483648,r.exports=a},function(r,n,i){var a=function(){function d(f,p){for(var g=0;g<p.length;g++){var m=p[g];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(f,m.key,m)}}return function(f,p,g){return p&&d(f.prototype,p),g&&d(f,g),f}}();function s(d,f){if(!(d instanceof f))throw new TypeError("Cannot call a class as a function")}var o=function(f){return{value:f,next:null,prev:null}},l=function(f,p,g,m){return f!==null?f.next=p:m.head=p,g!==null?g.prev=p:m.tail=p,p.prev=f,p.next=g,m.length++,p},u=function(f,p){var g=f.prev,m=f.next;return g!==null?g.next=m:p.head=m,m!==null?m.prev=g:p.tail=g,f.prev=f.next=null,p.length--,f},h=function(){function d(f){var p=this;s(this,d),this.length=0,this.head=null,this.tail=null,f?.forEach(function(g){return p.push(g)})}return a(d,[{key:"size",value:function(){return this.length}},{key:"insertBefore",value:function(p,g){return l(g.prev,o(p),g,this)}},{key:"insertAfter",value:function(p,g){return l(g,o(p),g.next,this)}},{key:"insertNodeBefore",value:function(p,g){return l(g.prev,p,g,this)}},{key:"insertNodeAfter",value:function(p,g){return l(g,p,g.next,this)}},{key:"push",value:function(p){return l(this.tail,o(p),null,this)}},{key:"unshift",value:function(p){return l(null,o(p),this.head,this)}},{key:"remove",value:function(p){return u(p,this)}},{key:"pop",value:function(){return u(this.tail,this).value}},{key:"popNode",value:function(){return u(this.tail,this)}},{key:"shift",value:function(){return u(this.head,this).value}},{key:"shiftNode",value:function(){return u(this.head,this)}},{key:"get_object_at",value:function(p){if(p<=this.length()){for(var g=1,m=this.head;g<p;)m=m.next,g++;return m.value}}},{key:"set_object_at",value:function(p,g){if(p<=this.length()){for(var m=1,v=this.head;m<p;)v=v.next,m++;v.value=g}}}]),d}();r.exports=h},function(r,n,i){function a(s,o,l){this.x=null,this.y=null,s==null&&o==null&&l==null?(this.x=0,this.y=0):typeof s=="number"&&typeof o=="number"&&l==null?(this.x=s,this.y=o):s.constructor.name=="Point"&&o==null&&l==null&&(l=s,this.x=l.x,this.y=l.y)}a.prototype.getX=function(){return this.x},a.prototype.getY=function(){return this.y},a.prototype.getLocation=function(){return new a(this.x,this.y)},a.prototype.setLocation=function(s,o,l){s.constructor.name=="Point"&&o==null&&l==null?(l=s,this.setLocation(l.x,l.y)):typeof s=="number"&&typeof o=="number"&&l==null&&(parseInt(s)==s&&parseInt(o)==o?this.move(s,o):(this.x=Math.floor(s+.5),this.y=Math.floor(o+.5)))},a.prototype.move=function(s,o){this.x=s,this.y=o},a.prototype.translate=function(s,o){this.x+=s,this.y+=o},a.prototype.equals=function(s){if(s.constructor.name=="Point"){var o=s;return this.x==o.x&&this.y==o.y}return this==s},a.prototype.toString=function(){return new a().constructor.name+"[x="+this.x+",y="+this.y+"]"},r.exports=a},function(r,n,i){function a(s,o,l,u){this.x=0,this.y=0,this.width=0,this.height=0,s!=null&&o!=null&&l!=null&&u!=null&&(this.x=s,this.y=o,this.width=l,this.height=u)}a.prototype.getX=function(){return this.x},a.prototype.setX=function(s){this.x=s},a.prototype.getY=function(){return this.y},a.prototype.setY=function(s){this.y=s},a.prototype.getWidth=function(){return this.width},a.prototype.setWidth=function(s){this.width=s},a.prototype.getHeight=function(){return this.height},a.prototype.setHeight=function(s){this.height=s},a.prototype.getRight=function(){return this.x+this.width},a.prototype.getBottom=function(){return this.y+this.height},a.prototype.intersects=function(s){return!(this.getRight()<s.x||this.getBottom()<s.y||s.getRight()<this.x||s.getBottom()<this.y)},a.prototype.getCenterX=function(){return this.x+this.width/2},a.prototype.getMinX=function(){return this.getX()},a.prototype.getMaxX=function(){return this.getX()+this.width},a.prototype.getCenterY=function(){return this.y+this.height/2},a.prototype.getMinY=function(){return this.getY()},a.prototype.getMaxY=function(){return this.getY()+this.height},a.prototype.getWidthHalf=function(){return this.width/2},a.prototype.getHeightHalf=function(){return this.height/2},r.exports=a},function(r,n,i){var a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(o){return typeof o}:function(o){return o&&typeof Symbol=="function"&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o};function s(){}s.lastID=0,s.createID=function(o){return s.isPrimitive(o)?o:(o.uniqueID!=null||(o.uniqueID=s.getString(),s.lastID++),o.uniqueID)},s.getString=function(o){return o==null&&(o=s.lastID),"Object#"+o},s.isPrimitive=function(o){var l=typeof o>"u"?"undefined":a(o);return o==null||l!="object"&&l!="function"},r.exports=s},function(r,n,i){function a(m){if(Array.isArray(m)){for(var v=0,y=Array(m.length);v<m.length;v++)y[v]=m[v];return y}else return Array.from(m)}var s=i(0),o=i(7),l=i(3),u=i(1),h=i(6),d=i(5),f=i(17),p=i(29);function g(m){p.call(this),this.layoutQuality=s.QUALITY,this.createBendsAsNeeded=s.DEFAULT_CREATE_BENDS_AS_NEEDED,this.incremental=s.DEFAULT_INCREMENTAL,this.animationOnLayout=s.DEFAULT_ANIMATION_ON_LAYOUT,this.animationDuringLayout=s.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=s.DEFAULT_ANIMATION_PERIOD,this.uniformLeafNodeSizes=s.DEFAULT_UNIFORM_LEAF_NODE_SIZES,this.edgeToDummyNodes=new Map,this.graphManager=new o(this),this.isLayoutFinished=!1,this.isSubLayout=!1,this.isRemoteUse=!1,m!=null&&(this.isRemoteUse=m)}g.RANDOM_SEED=1,g.prototype=Object.create(p.prototype),g.prototype.getGraphManager=function(){return this.graphManager},g.prototype.getAllNodes=function(){return this.graphManager.getAllNodes()},g.prototype.getAllEdges=function(){return this.graphManager.getAllEdges()},g.prototype.getAllNodesToApplyGravitation=function(){return this.graphManager.getAllNodesToApplyGravitation()},g.prototype.newGraphManager=function(){var m=new o(this);return this.graphManager=m,m},g.prototype.newGraph=function(m){return new h(null,this.graphManager,m)},g.prototype.newNode=function(m){return new l(this.graphManager,m)},g.prototype.newEdge=function(m){return new u(null,null,m)},g.prototype.checkLayoutSuccess=function(){return this.graphManager.getRoot()==null||this.graphManager.getRoot().getNodes().length==0||this.graphManager.includesInvalidEdge()},g.prototype.runLayout=function(){this.isLayoutFinished=!1,this.tilingPreLayout&&this.tilingPreLayout(),this.initParameters();var m;return this.checkLayoutSuccess()?m=!1:m=this.layout(),s.ANIMATE==="during"?!1:(m&&(this.isSubLayout||this.doPostLayout()),this.tilingPostLayout&&this.tilingPostLayout(),this.isLayoutFinished=!0,m)},g.prototype.doPostLayout=function(){this.incremental||this.transform(),this.update()},g.prototype.update2=function(){if(this.createBendsAsNeeded&&(this.createBendpointsFromDummyNodes(),this.graphManager.resetAllEdges()),!this.isRemoteUse){for(var m=this.graphManager.getAllEdges(),v=0;v<m.length;v++)m[v];for(var y=this.graphManager.getRoot().getNodes(),v=0;v<y.length;v++)y[v];this.update(this.graphManager.getRoot())}},g.prototype.update=function(m){if(m==null)this.update2();else if(m instanceof l){var v=m;if(v.getChild()!=null)for(var y=v.getChild().getNodes(),b=0;b<y.length;b++)update(y[b]);if(v.vGraphObject!=null){var w=v.vGraphObject;w.update(v)}}else if(m instanceof u){var T=m;if(T.vGraphObject!=null){var E=T.vGraphObject;E.update(T)}}else if(m instanceof h){var L=m;if(L.vGraphObject!=null){var S=L.vGraphObject;S.update(L)}}},g.prototype.initParameters=function(){this.isSubLayout||(this.layoutQuality=s.QUALITY,this.animationDuringLayout=s.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=s.DEFAULT_ANIMATION_PERIOD,this.animationOnLayout=s.DEFAULT_ANIMATION_ON_LAYOUT,this.incremental=s.DEFAULT_INCREMENTAL,this.createBendsAsNeeded=s.DEFAULT_CREATE_BENDS_AS_NEEDED,this.uniformLeafNodeSizes=s.DEFAULT_UNIFORM_LEAF_NODE_SIZES),this.animationDuringLayout&&(this.animationOnLayout=!1)},g.prototype.transform=function(m){if(m==null)this.transform(new d(0,0));else{var v=new f,y=this.graphManager.getRoot().updateLeftTop();if(y!=null){v.setWorldOrgX(m.x),v.setWorldOrgY(m.y),v.setDeviceOrgX(y.x),v.setDeviceOrgY(y.y);for(var b=this.getAllNodes(),w,T=0;T<b.length;T++)w=b[T],w.transform(v)}}},g.prototype.positionNodesRandomly=function(m){if(m==null)this.positionNodesRandomly(this.getGraphManager().getRoot()),this.getGraphManager().getRoot().updateBounds(!0);else for(var v,y,b=m.getNodes(),w=0;w<b.length;w++)v=b[w],y=v.getChild(),y==null||y.getNodes().length==0?v.scatter():(this.positionNodesRandomly(y),v.updateBounds())},g.prototype.getFlatForest=function(){for(var m=[],v=!0,y=this.graphManager.getRoot().getNodes(),b=!0,w=0;w<y.length;w++)y[w].getChild()!=null&&(b=!1);if(!b)return m;var T=new Set,E=[],L=new Map,S=[];for(S=S.concat(y);S.length>0&&v;){for(E.push(S[0]);E.length>0&&v;){var C=E[0];E.splice(0,1),T.add(C);for(var A=C.getEdges(),w=0;w<A.length;w++){var N=A[w].getOtherEnd(C);if(L.get(C)!=N)if(!T.has(N))E.push(N),L.set(N,C);else{v=!1;break}}}if(!v)m=[];else{var _=[].concat(a(T));m.push(_);for(var w=0;w<_.length;w++){var O=_[w],P=S.indexOf(O);P>-1&&S.splice(P,1)}T=new Set,L=new Map}}return m},g.prototype.createDummyNodesForBendpoints=function(m){for(var v=[],y=m.source,b=this.graphManager.calcLowestCommonAncestor(m.source,m.target),w=0;w<m.bendpoints.length;w++){var T=this.newNode(null);T.setRect(new Point(0,0),new Dimension(1,1)),b.add(T);var E=this.newEdge(null);this.graphManager.add(E,y,T),v.add(T),y=T}var E=this.newEdge(null);return this.graphManager.add(E,y,m.target),this.edgeToDummyNodes.set(m,v),m.isInterGraph()?this.graphManager.remove(m):b.remove(m),v},g.prototype.createBendpointsFromDummyNodes=function(){var m=[];m=m.concat(this.graphManager.getAllEdges()),m=[].concat(a(this.edgeToDummyNodes.keys())).concat(m);for(var v=0;v<m.length;v++){var y=m[v];if(y.bendpoints.length>0){for(var b=this.edgeToDummyNodes.get(y),w=0;w<b.length;w++){var T=b[w],E=new d(T.getCenterX(),T.getCenterY()),L=y.bendpoints.get(w);L.x=E.x,L.y=E.y,T.getOwner().remove(T)}this.graphManager.add(y,y.source,y.target)}}},g.transform=function(m,v,y,b){if(y!=null&&b!=null){var w=v;if(m<=50){var T=v/y;w-=(v-T)/50*(50-m)}else{var E=v*b;w+=(E-v)/50*(m-50)}return w}else{var L,S;return m<=50?(L=9*v/500,S=v/10):(L=9*v/50,S=-8*v),L*m+S}},g.findCenterOfTree=function(m){var v=[];v=v.concat(m);var y=[],b=new Map,w=!1,T=null;(v.length==1||v.length==2)&&(w=!0,T=v[0]);for(var E=0;E<v.length;E++){var L=v[E],S=L.getNeighborsList().size;b.set(L,L.getNeighborsList().size),S==1&&y.push(L)}var C=[];for(C=C.concat(y);!w;){var A=[];A=A.concat(C),C=[];for(var E=0;E<v.length;E++){var L=v[E],N=v.indexOf(L);N>=0&&v.splice(N,1);var _=L.getNeighborsList();_.forEach(function(k){if(y.indexOf(k)<0){var R=b.get(k),I=R-1;I==1&&C.push(k),b.set(k,I)}})}y=y.concat(C),(v.length==1||v.length==2)&&(w=!0,T=v[0])}return T},g.prototype.setGraphManager=function(m){this.graphManager=m},r.exports=g},function(r,n,i){function a(){}a.seed=1,a.x=0,a.nextDouble=function(){return a.x=Math.sin(a.seed++)*1e4,a.x-Math.floor(a.x)},r.exports=a},function(r,n,i){var a=i(5);function s(o,l){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}s.prototype.getWorldOrgX=function(){return this.lworldOrgX},s.prototype.setWorldOrgX=function(o){this.lworldOrgX=o},s.prototype.getWorldOrgY=function(){return this.lworldOrgY},s.prototype.setWorldOrgY=function(o){this.lworldOrgY=o},s.prototype.getWorldExtX=function(){return this.lworldExtX},s.prototype.setWorldExtX=function(o){this.lworldExtX=o},s.prototype.getWorldExtY=function(){return this.lworldExtY},s.prototype.setWorldExtY=function(o){this.lworldExtY=o},s.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},s.prototype.setDeviceOrgX=function(o){this.ldeviceOrgX=o},s.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},s.prototype.setDeviceOrgY=function(o){this.ldeviceOrgY=o},s.prototype.getDeviceExtX=function(){return this.ldeviceExtX},s.prototype.setDeviceExtX=function(o){this.ldeviceExtX=o},s.prototype.getDeviceExtY=function(){return this.ldeviceExtY},s.prototype.setDeviceExtY=function(o){this.ldeviceExtY=o},s.prototype.transformX=function(o){var l=0,u=this.lworldExtX;return u!=0&&(l=this.ldeviceOrgX+(o-this.lworldOrgX)*this.ldeviceExtX/u),l},s.prototype.transformY=function(o){var l=0,u=this.lworldExtY;return u!=0&&(l=this.ldeviceOrgY+(o-this.lworldOrgY)*this.ldeviceExtY/u),l},s.prototype.inverseTransformX=function(o){var l=0,u=this.ldeviceExtX;return u!=0&&(l=this.lworldOrgX+(o-this.ldeviceOrgX)*this.lworldExtX/u),l},s.prototype.inverseTransformY=function(o){var l=0,u=this.ldeviceExtY;return u!=0&&(l=this.lworldOrgY+(o-this.ldeviceOrgY)*this.lworldExtY/u),l},s.prototype.inverseTransformPoint=function(o){var l=new a(this.inverseTransformX(o.x),this.inverseTransformY(o.y));return l},r.exports=s},function(r,n,i){function a(p){if(Array.isArray(p)){for(var g=0,m=Array(p.length);g<p.length;g++)m[g]=p[g];return m}else return Array.from(p)}var s=i(15),o=i(4),l=i(0),u=i(8),h=i(9);function d(){s.call(this),this.useSmartIdealEdgeLengthCalculation=o.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=o.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=o.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=o.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=o.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.displacementThresholdPerNode=3*o.DEFAULT_EDGE_LENGTH/100,this.coolingFactor=o.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.initialCoolingFactor=o.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.totalDisplacement=0,this.oldTotalDisplacement=0,this.maxIterations=o.MAX_ITERATIONS}d.prototype=Object.create(s.prototype);for(var f in s)d[f]=s[f];d.prototype.initParameters=function(){s.prototype.initParameters.call(this,arguments),this.totalIterations=0,this.notAnimatedIterations=0,this.useFRGridVariant=o.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION,this.grid=[]},d.prototype.calcIdealEdgeLengths=function(){for(var p,g,m,v,y,b,w,T=this.getGraphManager().getAllEdges(),E=0;E<T.length;E++)p=T[E],g=p.idealLength,p.isInterGraph&&(v=p.getSource(),y=p.getTarget(),b=p.getSourceInLca().getEstimatedSize(),w=p.getTargetInLca().getEstimatedSize(),this.useSmartIdealEdgeLengthCalculation&&(p.idealLength+=b+w-2*l.SIMPLE_NODE_SIZE),m=p.getLca().getInclusionTreeDepth(),p.idealLength+=g*o.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR*(v.getInclusionTreeDepth()+y.getInclusionTreeDepth()-2*m))},d.prototype.initSpringEmbedder=function(){var p=this.getAllNodes().length;this.incremental?(p>o.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*o.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(p-o.ADAPTATION_LOWER_NODE_LIMIT)/(o.ADAPTATION_UPPER_NODE_LIMIT-o.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-o.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=o.MAX_NODE_DISPLACEMENT_INCREMENTAL):(p>o.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(o.COOLING_ADAPTATION_FACTOR,1-(p-o.ADAPTATION_LOWER_NODE_LIMIT)/(o.ADAPTATION_UPPER_NODE_LIMIT-o.ADAPTATION_LOWER_NODE_LIMIT)*(1-o.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=o.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.displacementThresholdPerNode=3*o.DEFAULT_EDGE_LENGTH/100,this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},d.prototype.calcSpringForces=function(){for(var p=this.getAllEdges(),g,m=0;m<p.length;m++)g=p[m],this.calcSpringForce(g,g.idealLength)},d.prototype.calcRepulsionForces=function(){var p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,m,v,y,b,w=this.getAllNodes(),T;if(this.useFRGridVariant)for(this.totalIterations%o.GRID_CALCULATION_CHECK_PERIOD==1&&p&&this.updateGrid(),T=new Set,m=0;m<w.length;m++)y=w[m],this.calculateRepulsionForceOfANode(y,T,p,g),T.add(y);else for(m=0;m<w.length;m++)for(y=w[m],v=m+1;v<w.length;v++)b=w[v],y.getOwner()==b.getOwner()&&this.calcRepulsionForce(y,b)},d.prototype.calcGravitationalForces=function(){for(var p,g=this.getAllNodesToApplyGravitation(),m=0;m<g.length;m++)p=g[m],this.calcGravitationalForce(p)},d.prototype.moveNodes=function(){for(var p=this.getAllNodes(),g,m=0;m<p.length;m++)g=p[m],g.move()},d.prototype.calcSpringForce=function(p,g){var m=p.getSource(),v=p.getTarget(),y,b,w,T;if(this.uniformLeafNodeSizes&&m.getChild()==null&&v.getChild()==null)p.updateLengthSimple();else if(p.updateLength(),p.isOverlapingSourceAndTarget)return;y=p.getLength(),y!=0&&(b=p.edgeElasticity*(y-g),w=b*(p.lengthX/y),T=b*(p.lengthY/y),m.springForceX+=w,m.springForceY+=T,v.springForceX-=w,v.springForceY-=T)},d.prototype.calcRepulsionForce=function(p,g){var m=p.getRect(),v=g.getRect(),y=new Array(2),b=new Array(4),w,T,E,L,S,C,A;if(m.intersects(v)){u.calcSeparationAmount(m,v,y,o.DEFAULT_EDGE_LENGTH/2),C=2*y[0],A=2*y[1];var N=p.noOfChildren*g.noOfChildren/(p.noOfChildren+g.noOfChildren);p.repulsionForceX-=N*C,p.repulsionForceY-=N*A,g.repulsionForceX+=N*C,g.repulsionForceY+=N*A}else this.uniformLeafNodeSizes&&p.getChild()==null&&g.getChild()==null?(w=v.getCenterX()-m.getCenterX(),T=v.getCenterY()-m.getCenterY()):(u.getIntersection(m,v,b),w=b[2]-b[0],T=b[3]-b[1]),Math.abs(w)<o.MIN_REPULSION_DIST&&(w=h.sign(w)*o.MIN_REPULSION_DIST),Math.abs(T)<o.MIN_REPULSION_DIST&&(T=h.sign(T)*o.MIN_REPULSION_DIST),E=w*w+T*T,L=Math.sqrt(E),S=(p.nodeRepulsion/2+g.nodeRepulsion/2)*p.noOfChildren*g.noOfChildren/E,C=S*w/L,A=S*T/L,p.repulsionForceX-=C,p.repulsionForceY-=A,g.repulsionForceX+=C,g.repulsionForceY+=A},d.prototype.calcGravitationalForce=function(p){var g,m,v,y,b,w,T,E;g=p.getOwner(),m=(g.getRight()+g.getLeft())/2,v=(g.getTop()+g.getBottom())/2,y=p.getCenterX()-m,b=p.getCenterY()-v,w=Math.abs(y)+p.getWidth()/2,T=Math.abs(b)+p.getHeight()/2,p.getOwner()==this.graphManager.getRoot()?(E=g.getEstimatedSize()*this.gravityRangeFactor,(w>E||T>E)&&(p.gravitationForceX=-this.gravityConstant*y,p.gravitationForceY=-this.gravityConstant*b)):(E=g.getEstimatedSize()*this.compoundGravityRangeFactor,(w>E||T>E)&&(p.gravitationForceX=-this.gravityConstant*y*this.compoundGravityConstant,p.gravitationForceY=-this.gravityConstant*b*this.compoundGravityConstant))},d.prototype.isConverged=function(){var p,g=!1;return this.totalIterations>this.maxIterations/3&&(g=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),p=this.totalDisplacement<this.totalDisplacementThreshold,this.oldTotalDisplacement=this.totalDisplacement,p||g},d.prototype.animate=function(){this.animationDuringLayout&&!this.isSubLayout&&(this.notAnimatedIterations==this.animationPeriod?(this.update(),this.notAnimatedIterations=0):this.notAnimatedIterations++)},d.prototype.calcNoOfChildrenForAllNodes=function(){for(var p,g=this.graphManager.getAllNodes(),m=0;m<g.length;m++)p=g[m],p.noOfChildren=p.getNoOfChildren()},d.prototype.calcGrid=function(p){var g=0,m=0;g=parseInt(Math.ceil((p.getRight()-p.getLeft())/this.repulsionRange)),m=parseInt(Math.ceil((p.getBottom()-p.getTop())/this.repulsionRange));for(var v=new Array(g),y=0;y<g;y++)v[y]=new Array(m);for(var y=0;y<g;y++)for(var b=0;b<m;b++)v[y][b]=new Array;return v},d.prototype.addNodeToGrid=function(p,g,m){var v=0,y=0,b=0,w=0;v=parseInt(Math.floor((p.getRect().x-g)/this.repulsionRange)),y=parseInt(Math.floor((p.getRect().width+p.getRect().x-g)/this.repulsionRange)),b=parseInt(Math.floor((p.getRect().y-m)/this.repulsionRange)),w=parseInt(Math.floor((p.getRect().height+p.getRect().y-m)/this.repulsionRange));for(var T=v;T<=y;T++)for(var E=b;E<=w;E++)this.grid[T][E].push(p),p.setGridCoordinates(v,y,b,w)},d.prototype.updateGrid=function(){var p,g,m=this.getAllNodes();for(this.grid=this.calcGrid(this.graphManager.getRoot()),p=0;p<m.length;p++)g=m[p],this.addNodeToGrid(g,this.graphManager.getRoot().getLeft(),this.graphManager.getRoot().getTop())},d.prototype.calculateRepulsionForceOfANode=function(p,g,m,v){if(this.totalIterations%o.GRID_CALCULATION_CHECK_PERIOD==1&&m||v){var y=new Set;p.surrounding=new Array;for(var b,w=this.grid,T=p.startX-1;T<p.finishX+2;T++)for(var E=p.startY-1;E<p.finishY+2;E++)if(!(T<0||E<0||T>=w.length||E>=w[0].length)){for(var L=0;L<w[T][E].length;L++)if(b=w[T][E][L],!(p.getOwner()!=b.getOwner()||p==b)&&!g.has(b)&&!y.has(b)){var S=Math.abs(p.getCenterX()-b.getCenterX())-(p.getWidth()/2+b.getWidth()/2),C=Math.abs(p.getCenterY()-b.getCenterY())-(p.getHeight()/2+b.getHeight()/2);S<=this.repulsionRange&&C<=this.repulsionRange&&y.add(b)}}p.surrounding=[].concat(a(y))}for(T=0;T<p.surrounding.length;T++)this.calcRepulsionForce(p,p.surrounding[T])},d.prototype.calcRepulsionRange=function(){return 0},r.exports=d},function(r,n,i){var a=i(1),s=i(4);function o(u,h,d){a.call(this,u,h,d),this.idealLength=s.DEFAULT_EDGE_LENGTH,this.edgeElasticity=s.DEFAULT_SPRING_STRENGTH}o.prototype=Object.create(a.prototype);for(var l in a)o[l]=a[l];r.exports=o},function(r,n,i){var a=i(3),s=i(4);function o(u,h,d,f){a.call(this,u,h,d,f),this.nodeRepulsion=s.DEFAULT_REPULSION_STRENGTH,this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0,this.startX=0,this.finishX=0,this.startY=0,this.finishY=0,this.surrounding=[]}o.prototype=Object.create(a.prototype);for(var l in a)o[l]=a[l];o.prototype.setGridCoordinates=function(u,h,d,f){this.startX=u,this.finishX=h,this.startY=d,this.finishY=f},r.exports=o},function(r,n,i){function a(s,o){this.width=0,this.height=0,s!==null&&o!==null&&(this.height=o,this.width=s)}a.prototype.getWidth=function(){return this.width},a.prototype.setWidth=function(s){this.width=s},a.prototype.getHeight=function(){return this.height},a.prototype.setHeight=function(s){this.height=s},r.exports=a},function(r,n,i){var a=i(14);function s(){this.map={},this.keys=[]}s.prototype.put=function(o,l){var u=a.createID(o);this.contains(u)||(this.map[u]=l,this.keys.push(o))},s.prototype.contains=function(o){return a.createID(o),this.map[o]!=null},s.prototype.get=function(o){var l=a.createID(o);return this.map[l]},s.prototype.keySet=function(){return this.keys},r.exports=s},function(r,n,i){var a=i(14);function s(){this.set={}}s.prototype.add=function(o){var l=a.createID(o);this.contains(l)||(this.set[l]=o)},s.prototype.remove=function(o){delete this.set[a.createID(o)]},s.prototype.clear=function(){this.set={}},s.prototype.contains=function(o){return this.set[a.createID(o)]==o},s.prototype.isEmpty=function(){return this.size()===0},s.prototype.size=function(){return Object.keys(this.set).length},s.prototype.addAllTo=function(o){for(var l=Object.keys(this.set),u=l.length,h=0;h<u;h++)o.push(this.set[l[h]])},s.prototype.size=function(){return Object.keys(this.set).length},s.prototype.addAll=function(o){for(var l=o.length,u=0;u<l;u++){var h=o[u];this.add(h)}},r.exports=s},function(r,n,i){function a(){}a.multMat=function(s,o){for(var l=[],u=0;u<s.length;u++){l[u]=[];for(var h=0;h<o[0].length;h++){l[u][h]=0;for(var d=0;d<s[0].length;d++)l[u][h]+=s[u][d]*o[d][h]}}return l},a.transpose=function(s){for(var o=[],l=0;l<s[0].length;l++){o[l]=[];for(var u=0;u<s.length;u++)o[l][u]=s[u][l]}return o},a.multCons=function(s,o){for(var l=[],u=0;u<s.length;u++)l[u]=s[u]*o;return l},a.minusOp=function(s,o){for(var l=[],u=0;u<s.length;u++)l[u]=s[u]-o[u];return l},a.dotProduct=function(s,o){for(var l=0,u=0;u<s.length;u++)l+=s[u]*o[u];return l},a.mag=function(s){return Math.sqrt(this.dotProduct(s,s))},a.normalize=function(s){for(var o=[],l=this.mag(s),u=0;u<s.length;u++)o[u]=s[u]/l;return o},a.multGamma=function(s){for(var o=[],l=0,u=0;u<s.length;u++)l+=s[u];l*=-1/s.length;for(var h=0;h<s.length;h++)o[h]=l+s[h];return o},a.multL=function(s,o,l){for(var u=[],h=[],d=[],f=0;f<o[0].length;f++){for(var p=0,g=0;g<o.length;g++)p+=-.5*o[g][f]*s[g];h[f]=p}for(var m=0;m<l.length;m++){for(var v=0,y=0;y<l.length;y++)v+=l[m][y]*h[y];d[m]=v}for(var b=0;b<o.length;b++){for(var w=0,T=0;T<o[0].length;T++)w+=o[b][T]*d[T];u[b]=w}return u},r.exports=a},function(r,n,i){var a=function(){function u(h,d){for(var f=0;f<d.length;f++){var p=d[f];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(h,p.key,p)}}return function(h,d,f){return d&&u(h.prototype,d),f&&u(h,f),h}}();function s(u,h){if(!(u instanceof h))throw new TypeError("Cannot call a class as a function")}var o=i(11),l=function(){function u(h,d){s(this,u),(d!==null||d!==void 0)&&(this.compareFunction=this._defaultCompareFunction);var f=void 0;h instanceof o?f=h.size():f=h.length,this._quicksort(h,0,f-1)}return a(u,[{key:"_quicksort",value:function(d,f,p){if(f<p){var g=this._partition(d,f,p);this._quicksort(d,f,g),this._quicksort(d,g+1,p)}}},{key:"_partition",value:function(d,f,p){for(var g=this._get(d,f),m=f,v=p;;){for(;this.compareFunction(g,this._get(d,v));)v--;for(;this.compareFunction(this._get(d,m),g);)m++;if(m<v)this._swap(d,m,v),m++,v--;else return v}}},{key:"_get",value:function(d,f){return d instanceof o?d.get_object_at(f):d[f]}},{key:"_set",value:function(d,f,p){d instanceof o?d.set_object_at(f,p):d[f]=p}},{key:"_swap",value:function(d,f,p){var g=this._get(d,f);this._set(d,f,this._get(d,p)),this._set(d,p,g)}},{key:"_defaultCompareFunction",value:function(d,f){return f>d}}]),u}();r.exports=l},function(r,n,i){function a(){}a.svd=function(s){this.U=null,this.V=null,this.s=null,this.m=0,this.n=0,this.m=s.length,this.n=s[0].length;var o=Math.min(this.m,this.n);this.s=function(qe){for(var rt=[];qe-- >0;)rt.push(0);return rt}(Math.min(this.m+1,this.n)),this.U=function(qe){var rt=function ct(ut){if(ut.length==0)return 0;for(var nt=[],bt=0;bt<ut[0];bt++)nt.push(ct(ut.slice(1)));return nt};return rt(qe)}([this.m,o]),this.V=function(qe){var rt=function ct(ut){if(ut.length==0)return 0;for(var nt=[],bt=0;bt<ut[0];bt++)nt.push(ct(ut.slice(1)));return nt};return rt(qe)}([this.n,this.n]);for(var l=function(qe){for(var rt=[];qe-- >0;)rt.push(0);return rt}(this.n),u=function(qe){for(var rt=[];qe-- >0;)rt.push(0);return rt}(this.m),h=!0,d=Math.min(this.m-1,this.n),f=Math.max(0,Math.min(this.n-2,this.m)),p=0;p<Math.max(d,f);p++){if(p<d){this.s[p]=0;for(var g=p;g<this.m;g++)this.s[p]=a.hypot(this.s[p],s[g][p]);if(this.s[p]!==0){s[p][p]<0&&(this.s[p]=-this.s[p]);for(var m=p;m<this.m;m++)s[m][p]/=this.s[p];s[p][p]+=1}this.s[p]=-this.s[p]}for(var v=p+1;v<this.n;v++){if(function(qe,rt){return qe&&rt}(p<d,this.s[p]!==0)){for(var y=0,b=p;b<this.m;b++)y+=s[b][p]*s[b][v];y=-y/s[p][p];for(var w=p;w<this.m;w++)s[w][v]+=y*s[w][p]}l[v]=s[p][v]}if(function(qe,rt){return rt}(h,p<d))for(var T=p;T<this.m;T++)this.U[T][p]=s[T][p];if(p<f){l[p]=0;for(var E=p+1;E<this.n;E++)l[p]=a.hypot(l[p],l[E]);if(l[p]!==0){l[p+1]<0&&(l[p]=-l[p]);for(var L=p+1;L<this.n;L++)l[L]/=l[p];l[p+1]+=1}if(l[p]=-l[p],function(qe,rt){return qe&&rt}(p+1<this.m,l[p]!==0)){for(var S=p+1;S<this.m;S++)u[S]=0;for(var C=p+1;C<this.n;C++)for(var A=p+1;A<this.m;A++)u[A]+=l[C]*s[A][C];for(var N=p+1;N<this.n;N++)for(var _=-l[N]/l[p+1],O=p+1;O<this.m;O++)s[O][N]+=_*u[O]}for(var P=p+1;P<this.n;P++)this.V[P][p]=l[P]}}var k=Math.min(this.n,this.m+1);d<this.n&&(this.s[d]=s[d][d]),this.m<k&&(this.s[k-1]=0),f+1<k&&(l[f]=s[f][k-1]),l[k-1]=0;{for(var R=d;R<o;R++){for(var I=0;I<this.m;I++)this.U[I][R]=0;this.U[R][R]=1}for(var M=d-1;M>=0;M--)if(this.s[M]!==0){for(var D=M+1;D<o;D++){for(var B=0,$=M;$<this.m;$++)B+=this.U[$][M]*this.U[$][D];B=-B/this.U[M][M];for(var F=M;F<this.m;F++)this.U[F][D]+=B*this.U[F][M]}for(var G=M;G<this.m;G++)this.U[G][M]=-this.U[G][M];this.U[M][M]=1+this.U[M][M];for(var W=0;W<M-1;W++)this.U[W][M]=0}else{for(var J=0;J<this.m;J++)this.U[J][M]=0;this.U[M][M]=1}}for(var q=this.n-1;q>=0;q--){if(function(qe,rt){return qe&&rt}(q<f,l[q]!==0))for(var ne=q+1;ne<o;ne++){for(var ae=0,pe=q+1;pe<this.n;pe++)ae+=this.V[pe][q]*this.V[pe][ne];ae=-ae/this.V[q+1][q];for(var K=q+1;K<this.n;K++)this.V[K][ne]+=ae*this.V[K][q]}for(var Z=0;Z<this.n;Z++)this.V[Z][q]=0;this.V[q][q]=1}for(var X=k-1,Y=Math.pow(2,-52),ee=Math.pow(2,-966);k>0;){var j=void 0,fe=void 0;for(j=k-2;j>=-1&&j!==-1;j--)if(Math.abs(l[j])<=ee+Y*(Math.abs(this.s[j])+Math.abs(this.s[j+1]))){l[j]=0;break}if(j===k-2)fe=4;else{var te=void 0;for(te=k-1;te>=j&&te!==j;te--){var Ae=(te!==k?Math.abs(l[te]):0)+(te!==j+1?Math.abs(l[te-1]):0);if(Math.abs(this.s[te])<=ee+Y*Ae){this.s[te]=0;break}}te===j?fe=3:te===k-1?fe=1:(fe=2,j=te)}switch(j++,fe){case 1:{var H=l[k-2];l[k-2]=0;for(var Oe=k-2;Oe>=j;Oe--){var ue=a.hypot(this.s[Oe],H),Ve=this.s[Oe]/ue,Ge=H/ue;this.s[Oe]=ue,Oe!==j&&(H=-Ge*l[Oe-1],l[Oe-1]=Ve*l[Oe-1]);for(var Ue=0;Ue<this.n;Ue++)ue=Ve*this.V[Ue][Oe]+Ge*this.V[Ue][k-1],this.V[Ue][k-1]=-Ge*this.V[Ue][Oe]+Ve*this.V[Ue][k-1],this.V[Ue][Oe]=ue}}break;case 2:{var ke=l[j-1];l[j-1]=0;for(var Pe=j;Pe<k;Pe++){var Se=a.hypot(this.s[Pe],ke),_e=this.s[Pe]/Se,ze=ke/Se;this.s[Pe]=Se,ke=-ze*l[Pe],l[Pe]=_e*l[Pe];for(var me=0;me<this.m;me++)Se=_e*this.U[me][Pe]+ze*this.U[me][j-1],this.U[me][j-1]=-ze*this.U[me][Pe]+_e*this.U[me][j-1],this.U[me][Pe]=Se}}break;case 3:{var De=Math.max(Math.max(Math.max(Math.max(Math.abs(this.s[k-1]),Math.abs(this.s[k-2])),Math.abs(l[k-2])),Math.abs(this.s[j])),Math.abs(l[j])),Q=this.s[k-1]/De,ce=this.s[k-2]/De,z=l[k-2]/De,oe=this.s[j]/De,se=l[j]/De,ge=((ce+Q)*(ce-Q)+z*z)/2,he=Q*z*(Q*z),be=0;(function(qe,rt){return qe||rt})(ge!==0,he!==0)&&(be=Math.sqrt(ge*ge+he),ge<0&&(be=-be),be=he/(ge+be));for(var Ce=(oe+Q)*(oe-Q)+be,Te=oe*se,Ne=j;Ne<k-1;Ne++){var Xe=a.hypot(Ce,Te),Ye=Ce/Xe,Ke=Te/Xe;Ne!==j&&(l[Ne-1]=Xe),Ce=Ye*this.s[Ne]+Ke*l[Ne],l[Ne]=Ye*l[Ne]-Ke*this.s[Ne],Te=Ke*this.s[Ne+1],this.s[Ne+1]=Ye*this.s[Ne+1];for(var Ze=0;Ze<this.n;Ze++)Xe=Ye*this.V[Ze][Ne]+Ke*this.V[Ze][Ne+1],this.V[Ze][Ne+1]=-Ke*this.V[Ze][Ne]+Ye*this.V[Ze][Ne+1],this.V[Ze][Ne]=Xe;if(Xe=a.hypot(Ce,Te),Ye=Ce/Xe,Ke=Te/Xe,this.s[Ne]=Xe,Ce=Ye*l[Ne]+Ke*this.s[Ne+1],this.s[Ne+1]=-Ke*l[Ne]+Ye*this.s[Ne+1],Te=Ke*l[Ne+1],l[Ne+1]=Ye*l[Ne+1],Ne<this.m-1)for(var Be=0;Be<this.m;Be++)Xe=Ye*this.U[Be][Ne]+Ke*this.U[Be][Ne+1],this.U[Be][Ne+1]=-Ke*this.U[Be][Ne]+Ye*this.U[Be][Ne+1],this.U[Be][Ne]=Xe}l[k-2]=Ce}break;case 4:{if(this.s[j]<=0){this.s[j]=this.s[j]<0?-this.s[j]:0;for(var He=0;He<=X;He++)this.V[He][j]=-this.V[He][j]}for(;j<X&&!(this.s[j]>=this.s[j+1]);){var ht=this.s[j];if(this.s[j]=this.s[j+1],this.s[j+1]=ht,j<this.n-1)for(var st=0;st<this.n;st++)ht=this.V[st][j+1],this.V[st][j+1]=this.V[st][j],this.V[st][j]=ht;if(j<this.m-1)for(var We=0;We<this.m;We++)ht=this.U[We][j+1],this.U[We][j+1]=this.U[We][j],this.U[We][j]=ht;j++}k--}break}}var kt={U:this.U,V:this.V,S:this.s};return kt},a.hypot=function(s,o){var l=void 0;return Math.abs(s)>Math.abs(o)?(l=o/s,l=Math.abs(s)*Math.sqrt(1+l*l)):o!=0?(l=s/o,l=Math.abs(o)*Math.sqrt(1+l*l)):l=0,l},r.exports=a},function(r,n,i){var a=function(){function l(u,h){for(var d=0;d<h.length;d++){var f=h[d];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(u,f.key,f)}}return function(u,h,d){return h&&l(u.prototype,h),d&&l(u,d),u}}();function s(l,u){if(!(l instanceof u))throw new TypeError("Cannot call a class as a function")}var o=function(){function l(u,h){var d=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,f=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,p=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;s(this,l),this.sequence1=u,this.sequence2=h,this.match_score=d,this.mismatch_penalty=f,this.gap_penalty=p,this.iMax=u.length+1,this.jMax=h.length+1,this.grid=new Array(this.iMax);for(var g=0;g<this.iMax;g++){this.grid[g]=new Array(this.jMax);for(var m=0;m<this.jMax;m++)this.grid[g][m]=0}this.tracebackGrid=new Array(this.iMax);for(var v=0;v<this.iMax;v++){this.tracebackGrid[v]=new Array(this.jMax);for(var y=0;y<this.jMax;y++)this.tracebackGrid[v][y]=[null,null,null]}this.alignments=[],this.score=-1,this.computeGrids()}return a(l,[{key:"getScore",value:function(){return this.score}},{key:"getAlignments",value:function(){return this.alignments}},{key:"computeGrids",value:function(){for(var h=1;h<this.jMax;h++)this.grid[0][h]=this.grid[0][h-1]+this.gap_penalty,this.tracebackGrid[0][h]=[!1,!1,!0];for(var d=1;d<this.iMax;d++)this.grid[d][0]=this.grid[d-1][0]+this.gap_penalty,this.tracebackGrid[d][0]=[!1,!0,!1];for(var f=1;f<this.iMax;f++)for(var p=1;p<this.jMax;p++){var g=void 0;this.sequence1[f-1]===this.sequence2[p-1]?g=this.grid[f-1][p-1]+this.match_score:g=this.grid[f-1][p-1]+this.mismatch_penalty;var m=this.grid[f-1][p]+this.gap_penalty,v=this.grid[f][p-1]+this.gap_penalty,y=[g,m,v],b=this.arrayAllMaxIndexes(y);this.grid[f][p]=y[b[0]],this.tracebackGrid[f][p]=[b.includes(0),b.includes(1),b.includes(2)]}this.score=this.grid[this.iMax-1][this.jMax-1]}},{key:"alignmentTraceback",value:function(){var h=[];for(h.push({pos:[this.sequence1.length,this.sequence2.length],seq1:"",seq2:""});h[0];){var d=h[0],f=this.tracebackGrid[d.pos[0]][d.pos[1]];f[0]&&h.push({pos:[d.pos[0]-1,d.pos[1]-1],seq1:this.sequence1[d.pos[0]-1]+d.seq1,seq2:this.sequence2[d.pos[1]-1]+d.seq2}),f[1]&&h.push({pos:[d.pos[0]-1,d.pos[1]],seq1:this.sequence1[d.pos[0]-1]+d.seq1,seq2:"-"+d.seq2}),f[2]&&h.push({pos:[d.pos[0],d.pos[1]-1],seq1:"-"+d.seq1,seq2:this.sequence2[d.pos[1]-1]+d.seq2}),d.pos[0]===0&&d.pos[1]===0&&this.alignments.push({sequence1:d.seq1,sequence2:d.seq2}),h.shift()}return this.alignments}},{key:"getAllIndexes",value:function(h,d){for(var f=[],p=-1;(p=h.indexOf(d,p+1))!==-1;)f.push(p);return f}},{key:"arrayAllMaxIndexes",value:function(h){return this.getAllIndexes(h,Math.max.apply(null,h))}}]),l}();r.exports=o},function(r,n,i){var a=function(){};a.FDLayout=i(18),a.FDLayoutConstants=i(4),a.FDLayoutEdge=i(19),a.FDLayoutNode=i(20),a.DimensionD=i(21),a.HashMap=i(22),a.HashSet=i(23),a.IGeometry=i(8),a.IMath=i(9),a.Integer=i(10),a.Point=i(12),a.PointD=i(5),a.RandomSeed=i(16),a.RectangleD=i(13),a.Transform=i(17),a.UniqueIDGeneretor=i(14),a.Quicksort=i(25),a.LinkedList=i(11),a.LGraphObject=i(2),a.LGraph=i(6),a.LEdge=i(1),a.LGraphManager=i(7),a.LNode=i(3),a.Layout=i(15),a.LayoutConstants=i(0),a.NeedlemanWunsch=i(27),a.Matrix=i(24),a.SVD=i(26),r.exports=a},function(r,n,i){function a(){this.listeners=[]}var s=a.prototype;s.addListener=function(o,l){this.listeners.push({event:o,callback:l})},s.removeListener=function(o,l){for(var u=this.listeners.length;u>=0;u--){var h=this.listeners[u];h.event===o&&h.callback===l&&this.listeners.splice(u,1)}},s.emit=function(o,l){for(var u=0;u<this.listeners.length;u++){var h=this.listeners[u];o===h.event&&h.callback(l)}},r.exports=a}])})}(F3)),F3.exports}var iN;function LRe(){return iN||(iN=1,function(t,e){(function(n,i){t.exports=i(_Re())})(to,function(r){return(()=>{var n={45:(o,l,u)=>{var h={};h.layoutBase=u(551),h.CoSEConstants=u(806),h.CoSEEdge=u(767),h.CoSEGraph=u(880),h.CoSEGraphManager=u(578),h.CoSELayout=u(765),h.CoSENode=u(991),h.ConstraintHandler=u(902),o.exports=h},806:(o,l,u)=>{var h=u(551).FDLayoutConstants;function d(){}for(var f in h)d[f]=h[f];d.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,d.DEFAULT_RADIAL_SEPARATION=h.DEFAULT_EDGE_LENGTH,d.DEFAULT_COMPONENT_SEPERATION=60,d.TILE=!0,d.TILING_PADDING_VERTICAL=10,d.TILING_PADDING_HORIZONTAL=10,d.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,d.ENFORCE_CONSTRAINTS=!0,d.APPLY_LAYOUT=!0,d.RELAX_MOVEMENT_ON_CONSTRAINTS=!0,d.TREE_REDUCTION_ON_INCREMENTAL=!0,d.PURE_INCREMENTAL=d.DEFAULT_INCREMENTAL,o.exports=d},767:(o,l,u)=>{var h=u(551).FDLayoutEdge;function d(p,g,m){h.call(this,p,g,m)}d.prototype=Object.create(h.prototype);for(var f in h)d[f]=h[f];o.exports=d},880:(o,l,u)=>{var h=u(551).LGraph;function d(p,g,m){h.call(this,p,g,m)}d.prototype=Object.create(h.prototype);for(var f in h)d[f]=h[f];o.exports=d},578:(o,l,u)=>{var h=u(551).LGraphManager;function d(p){h.call(this,p)}d.prototype=Object.create(h.prototype);for(var f in h)d[f]=h[f];o.exports=d},765:(o,l,u)=>{var h=u(551).FDLayout,d=u(578),f=u(880),p=u(991),g=u(767),m=u(806),v=u(902),y=u(551).FDLayoutConstants,b=u(551).LayoutConstants,w=u(551).Point,T=u(551).PointD,E=u(551).DimensionD,L=u(551).Layout,S=u(551).Integer,C=u(551).IGeometry,A=u(551).LGraph,N=u(551).Transform,_=u(551).LinkedList;function O(){h.call(this),this.toBeTiled={},this.constraints={}}O.prototype=Object.create(h.prototype);for(var P in h)O[P]=h[P];O.prototype.newGraphManager=function(){var k=new d(this);return this.graphManager=k,k},O.prototype.newGraph=function(k){return new f(null,this.graphManager,k)},O.prototype.newNode=function(k){return new p(this.graphManager,k)},O.prototype.newEdge=function(k){return new g(null,null,k)},O.prototype.initParameters=function(){h.prototype.initParameters.call(this,arguments),this.isSubLayout||(m.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=m.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=m.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=y.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=y.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=y.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=y.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1)},O.prototype.initSpringEmbedder=function(){h.prototype.initSpringEmbedder.call(this),this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/y.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=.04,this.coolingAdjuster=1},O.prototype.layout=function(){var k=b.DEFAULT_CREATE_BENDS_AS_NEEDED;return k&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},O.prototype.classicLayout=function(){if(this.nodesWithGravity=this.calculateNodesToApplyGravitationTo(),this.graphManager.setAllNodesToApplyGravitation(this.nodesWithGravity),this.calcNoOfChildrenForAllNodes(),this.graphManager.calcLowestCommonAncestors(),this.graphManager.calcInclusionTreeDepths(),this.graphManager.getRoot().calcEstimatedSize(),this.calcIdealEdgeLengths(),this.incremental){if(m.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var R=new Set(this.getAllNodes()),I=this.nodesWithGravity.filter(function(B){return R.has(B)});this.graphManager.setAllNodesToApplyGravitation(I)}}else{var k=this.getFlatForest();if(k.length>0)this.positionNodesRadially(k);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var R=new Set(this.getAllNodes()),I=this.nodesWithGravity.filter(function(M){return R.has(M)});this.graphManager.setAllNodesToApplyGravitation(I),this.positionNodesRandomly()}}return Object.keys(this.constraints).length>0&&(v.handleConstraints(this),this.initConstraintVariables()),this.initSpringEmbedder(),m.APPLY_LAYOUT&&this.runSpringEmbedder(),!0},O.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished)if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.totalIterations%y.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;this.coolingCycle++,this.layoutQuality==0?this.coolingAdjuster=this.coolingCycle:this.layoutQuality==1&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var k=new Set(this.getAllNodes()),R=this.nodesWithGravity.filter(function(D){return k.has(D)});this.graphManager.setAllNodesToApplyGravitation(R),this.graphManager.updateBounds(),this.updateGrid(),m.PURE_INCREMENTAL?this.coolingFactor=y.DEFAULT_COOLING_FACTOR_INCREMENTAL/2:this.coolingFactor=y.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),m.PURE_INCREMENTAL?this.coolingFactor=y.DEFAULT_COOLING_FACTOR_INCREMENTAL/2*((100-this.afterGrowthIterations)/100):this.coolingFactor=y.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var I=!this.isTreeGrowing&&!this.isGrowthFinished,M=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(I,M),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},O.prototype.getPositionsData=function(){for(var k=this.graphManager.getAllNodes(),R={},I=0;I<k.length;I++){var M=k[I].rect,D=k[I].id;R[D]={id:D,x:M.getCenterX(),y:M.getCenterY(),w:M.width,h:M.height}}return R},O.prototype.runSpringEmbedder=function(){this.initialAnimationPeriod=25,this.animationPeriod=this.initialAnimationPeriod;var k=!1;if(y.ANIMATE==="during")this.emit("layoutstarted");else{for(;!k;)k=this.tick();this.graphManager.updateBounds()}},O.prototype.moveNodes=function(){for(var k=this.getAllNodes(),R,I=0;I<k.length;I++)R=k[I],R.calculateDisplacement();Object.keys(this.constraints).length>0&&this.updateDisplacements();for(var I=0;I<k.length;I++)R=k[I],R.move()},O.prototype.initConstraintVariables=function(){var k=this;this.idToNodeMap=new Map,this.fixedNodeSet=new Set;for(var R=this.graphManager.getAllNodes(),I=0;I<R.length;I++){var M=R[I];this.idToNodeMap.set(M.id,M)}var D=function K(Z){for(var X=Z.getChild().getNodes(),Y,ee=0,j=0;j<X.length;j++)Y=X[j],Y.getChild()==null?k.fixedNodeSet.has(Y.id)&&(ee+=100):ee+=K(Y);return ee};if(this.constraints.fixedNodeConstraint){this.constraints.fixedNodeConstraint.forEach(function(X){k.fixedNodeSet.add(X.nodeId)});for(var R=this.graphManager.getAllNodes(),M,I=0;I<R.length;I++)if(M=R[I],M.getChild()!=null){var B=D(M);B>0&&(M.fixedNodeWeight=B)}}if(this.constraints.relativePlacementConstraint){var $=new Map,F=new Map;if(this.dummyToNodeForVerticalAlignment=new Map,this.dummyToNodeForHorizontalAlignment=new Map,this.fixedNodesOnHorizontal=new Set,this.fixedNodesOnVertical=new Set,this.fixedNodeSet.forEach(function(K){k.fixedNodesOnHorizontal.add(K),k.fixedNodesOnVertical.add(K)}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var G=this.constraints.alignmentConstraint.vertical,I=0;I<G.length;I++)this.dummyToNodeForVerticalAlignment.set("dummy"+I,[]),G[I].forEach(function(Z){$.set(Z,"dummy"+I),k.dummyToNodeForVerticalAlignment.get("dummy"+I).push(Z),k.fixedNodeSet.has(Z)&&k.fixedNodesOnHorizontal.add("dummy"+I)});if(this.constraints.alignmentConstraint.horizontal)for(var W=this.constraints.alignmentConstraint.horizontal,I=0;I<W.length;I++)this.dummyToNodeForHorizontalAlignment.set("dummy"+I,[]),W[I].forEach(function(Z){F.set(Z,"dummy"+I),k.dummyToNodeForHorizontalAlignment.get("dummy"+I).push(Z),k.fixedNodeSet.has(Z)&&k.fixedNodesOnVertical.add("dummy"+I)})}if(m.RELAX_MOVEMENT_ON_CONSTRAINTS)this.shuffle=function(K){var Z,X,Y;for(Y=K.length-1;Y>=2*K.length/3;Y--)Z=Math.floor(Math.random()*(Y+1)),X=K[Y],K[Y]=K[Z],K[Z]=X;return K},this.nodesInRelativeHorizontal=[],this.nodesInRelativeVertical=[],this.nodeToRelativeConstraintMapHorizontal=new Map,this.nodeToRelativeConstraintMapVertical=new Map,this.nodeToTempPositionMapHorizontal=new Map,this.nodeToTempPositionMapVertical=new Map,this.constraints.relativePlacementConstraint.forEach(function(K){if(K.left){var Z=$.has(K.left)?$.get(K.left):K.left,X=$.has(K.right)?$.get(K.right):K.right;k.nodesInRelativeHorizontal.includes(Z)||(k.nodesInRelativeHorizontal.push(Z),k.nodeToRelativeConstraintMapHorizontal.set(Z,[]),k.dummyToNodeForVerticalAlignment.has(Z)?k.nodeToTempPositionMapHorizontal.set(Z,k.idToNodeMap.get(k.dummyToNodeForVerticalAlignment.get(Z)[0]).getCenterX()):k.nodeToTempPositionMapHorizontal.set(Z,k.idToNodeMap.get(Z).getCenterX())),k.nodesInRelativeHorizontal.includes(X)||(k.nodesInRelativeHorizontal.push(X),k.nodeToRelativeConstraintMapHorizontal.set(X,[]),k.dummyToNodeForVerticalAlignment.has(X)?k.nodeToTempPositionMapHorizontal.set(X,k.idToNodeMap.get(k.dummyToNodeForVerticalAlignment.get(X)[0]).getCenterX()):k.nodeToTempPositionMapHorizontal.set(X,k.idToNodeMap.get(X).getCenterX())),k.nodeToRelativeConstraintMapHorizontal.get(Z).push({right:X,gap:K.gap}),k.nodeToRelativeConstraintMapHorizontal.get(X).push({left:Z,gap:K.gap})}else{var Y=F.has(K.top)?F.get(K.top):K.top,ee=F.has(K.bottom)?F.get(K.bottom):K.bottom;k.nodesInRelativeVertical.includes(Y)||(k.nodesInRelativeVertical.push(Y),k.nodeToRelativeConstraintMapVertical.set(Y,[]),k.dummyToNodeForHorizontalAlignment.has(Y)?k.nodeToTempPositionMapVertical.set(Y,k.idToNodeMap.get(k.dummyToNodeForHorizontalAlignment.get(Y)[0]).getCenterY()):k.nodeToTempPositionMapVertical.set(Y,k.idToNodeMap.get(Y).getCenterY())),k.nodesInRelativeVertical.includes(ee)||(k.nodesInRelativeVertical.push(ee),k.nodeToRelativeConstraintMapVertical.set(ee,[]),k.dummyToNodeForHorizontalAlignment.has(ee)?k.nodeToTempPositionMapVertical.set(ee,k.idToNodeMap.get(k.dummyToNodeForHorizontalAlignment.get(ee)[0]).getCenterY()):k.nodeToTempPositionMapVertical.set(ee,k.idToNodeMap.get(ee).getCenterY())),k.nodeToRelativeConstraintMapVertical.get(Y).push({bottom:ee,gap:K.gap}),k.nodeToRelativeConstraintMapVertical.get(ee).push({top:Y,gap:K.gap})}});else{var J=new Map,q=new Map;this.constraints.relativePlacementConstraint.forEach(function(K){if(K.left){var Z=$.has(K.left)?$.get(K.left):K.left,X=$.has(K.right)?$.get(K.right):K.right;J.has(Z)?J.get(Z).push(X):J.set(Z,[X]),J.has(X)?J.get(X).push(Z):J.set(X,[Z])}else{var Y=F.has(K.top)?F.get(K.top):K.top,ee=F.has(K.bottom)?F.get(K.bottom):K.bottom;q.has(Y)?q.get(Y).push(ee):q.set(Y,[ee]),q.has(ee)?q.get(ee).push(Y):q.set(ee,[Y])}});var ne=function(Z,X){var Y=[],ee=[],j=new _,fe=new Set,te=0;return Z.forEach(function(Ae,H){if(!fe.has(H)){Y[te]=[],ee[te]=!1;var Oe=H;for(j.push(Oe),fe.add(Oe),Y[te].push(Oe);j.length!=0;){Oe=j.shift(),X.has(Oe)&&(ee[te]=!0);var ue=Z.get(Oe);ue.forEach(function(Ve){fe.has(Ve)||(j.push(Ve),fe.add(Ve),Y[te].push(Ve))})}te++}}),{components:Y,isFixed:ee}},ae=ne(J,k.fixedNodesOnHorizontal);this.componentsOnHorizontal=ae.components,this.fixedComponentsOnHorizontal=ae.isFixed;var pe=ne(q,k.fixedNodesOnVertical);this.componentsOnVertical=pe.components,this.fixedComponentsOnVertical=pe.isFixed}}},O.prototype.updateDisplacements=function(){var k=this;if(this.constraints.fixedNodeConstraint&&this.constraints.fixedNodeConstraint.forEach(function(pe){var K=k.idToNodeMap.get(pe.nodeId);K.displacementX=0,K.displacementY=0}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var R=this.constraints.alignmentConstraint.vertical,I=0;I<R.length;I++){for(var M=0,D=0;D<R[I].length;D++){if(this.fixedNodeSet.has(R[I][D])){M=0;break}M+=this.idToNodeMap.get(R[I][D]).displacementX}for(var B=M/R[I].length,D=0;D<R[I].length;D++)this.idToNodeMap.get(R[I][D]).displacementX=B}if(this.constraints.alignmentConstraint.horizontal)for(var $=this.constraints.alignmentConstraint.horizontal,I=0;I<$.length;I++){for(var F=0,D=0;D<$[I].length;D++){if(this.fixedNodeSet.has($[I][D])){F=0;break}F+=this.idToNodeMap.get($[I][D]).displacementY}for(var G=F/$[I].length,D=0;D<$[I].length;D++)this.idToNodeMap.get($[I][D]).displacementY=G}}if(this.constraints.relativePlacementConstraint)if(m.RELAX_MOVEMENT_ON_CONSTRAINTS)this.totalIterations%10==0&&(this.shuffle(this.nodesInRelativeHorizontal),this.shuffle(this.nodesInRelativeVertical)),this.nodesInRelativeHorizontal.forEach(function(pe){if(!k.fixedNodesOnHorizontal.has(pe)){var K=0;k.dummyToNodeForVerticalAlignment.has(pe)?K=k.idToNodeMap.get(k.dummyToNodeForVerticalAlignment.get(pe)[0]).displacementX:K=k.idToNodeMap.get(pe).displacementX,k.nodeToRelativeConstraintMapHorizontal.get(pe).forEach(function(Z){if(Z.right){var X=k.nodeToTempPositionMapHorizontal.get(Z.right)-k.nodeToTempPositionMapHorizontal.get(pe)-K;X<Z.gap&&(K-=Z.gap-X)}else{var X=k.nodeToTempPositionMapHorizontal.get(pe)-k.nodeToTempPositionMapHorizontal.get(Z.left)+K;X<Z.gap&&(K+=Z.gap-X)}}),k.nodeToTempPositionMapHorizontal.set(pe,k.nodeToTempPositionMapHorizontal.get(pe)+K),k.dummyToNodeForVerticalAlignment.has(pe)?k.dummyToNodeForVerticalAlignment.get(pe).forEach(function(Z){k.idToNodeMap.get(Z).displacementX=K}):k.idToNodeMap.get(pe).displacementX=K}}),this.nodesInRelativeVertical.forEach(function(pe){if(!k.fixedNodesOnHorizontal.has(pe)){var K=0;k.dummyToNodeForHorizontalAlignment.has(pe)?K=k.idToNodeMap.get(k.dummyToNodeForHorizontalAlignment.get(pe)[0]).displacementY:K=k.idToNodeMap.get(pe).displacementY,k.nodeToRelativeConstraintMapVertical.get(pe).forEach(function(Z){if(Z.bottom){var X=k.nodeToTempPositionMapVertical.get(Z.bottom)-k.nodeToTempPositionMapVertical.get(pe)-K;X<Z.gap&&(K-=Z.gap-X)}else{var X=k.nodeToTempPositionMapVertical.get(pe)-k.nodeToTempPositionMapVertical.get(Z.top)+K;X<Z.gap&&(K+=Z.gap-X)}}),k.nodeToTempPositionMapVertical.set(pe,k.nodeToTempPositionMapVertical.get(pe)+K),k.dummyToNodeForHorizontalAlignment.has(pe)?k.dummyToNodeForHorizontalAlignment.get(pe).forEach(function(Z){k.idToNodeMap.get(Z).displacementY=K}):k.idToNodeMap.get(pe).displacementY=K}});else{for(var I=0;I<this.componentsOnHorizontal.length;I++){var W=this.componentsOnHorizontal[I];if(this.fixedComponentsOnHorizontal[I])for(var D=0;D<W.length;D++)this.dummyToNodeForVerticalAlignment.has(W[D])?this.dummyToNodeForVerticalAlignment.get(W[D]).forEach(function(Z){k.idToNodeMap.get(Z).displacementX=0}):this.idToNodeMap.get(W[D]).displacementX=0;else{for(var J=0,q=0,D=0;D<W.length;D++)if(this.dummyToNodeForVerticalAlignment.has(W[D])){var ne=this.dummyToNodeForVerticalAlignment.get(W[D]);J+=ne.length*this.idToNodeMap.get(ne[0]).displacementX,q+=ne.length}else J+=this.idToNodeMap.get(W[D]).displacementX,q++;for(var ae=J/q,D=0;D<W.length;D++)this.dummyToNodeForVerticalAlignment.has(W[D])?this.dummyToNodeForVerticalAlignment.get(W[D]).forEach(function(Z){k.idToNodeMap.get(Z).displacementX=ae}):this.idToNodeMap.get(W[D]).displacementX=ae}}for(var I=0;I<this.componentsOnVertical.length;I++){var W=this.componentsOnVertical[I];if(this.fixedComponentsOnVertical[I])for(var D=0;D<W.length;D++)this.dummyToNodeForHorizontalAlignment.has(W[D])?this.dummyToNodeForHorizontalAlignment.get(W[D]).forEach(function(X){k.idToNodeMap.get(X).displacementY=0}):this.idToNodeMap.get(W[D]).displacementY=0;else{for(var J=0,q=0,D=0;D<W.length;D++)if(this.dummyToNodeForHorizontalAlignment.has(W[D])){var ne=this.dummyToNodeForHorizontalAlignment.get(W[D]);J+=ne.length*this.idToNodeMap.get(ne[0]).displacementY,q+=ne.length}else J+=this.idToNodeMap.get(W[D]).displacementY,q++;for(var ae=J/q,D=0;D<W.length;D++)this.dummyToNodeForHorizontalAlignment.has(W[D])?this.dummyToNodeForHorizontalAlignment.get(W[D]).forEach(function(j){k.idToNodeMap.get(j).displacementY=ae}):this.idToNodeMap.get(W[D]).displacementY=ae}}}},O.prototype.calculateNodesToApplyGravitationTo=function(){var k=[],R,I=this.graphManager.getGraphs(),M=I.length,D;for(D=0;D<M;D++)R=I[D],R.updateConnected(),R.isConnected||(k=k.concat(R.getNodes()));return k},O.prototype.createBendpoints=function(){var k=[];k=k.concat(this.graphManager.getAllEdges());var R=new Set,I;for(I=0;I<k.length;I++){var M=k[I];if(!R.has(M)){var D=M.getSource(),B=M.getTarget();if(D==B)M.getBendpoints().push(new T),M.getBendpoints().push(new T),this.createDummyNodesForBendpoints(M),R.add(M);else{var $=[];if($=$.concat(D.getEdgeListToNode(B)),$=$.concat(B.getEdgeListToNode(D)),!R.has($[0])){if($.length>1){var F;for(F=0;F<$.length;F++){var G=$[F];G.getBendpoints().push(new T),this.createDummyNodesForBendpoints(G)}}$.forEach(function(W){R.add(W)})}}}if(R.size==k.length)break}},O.prototype.positionNodesRadially=function(k){for(var R=new w(0,0),I=Math.ceil(Math.sqrt(k.length)),M=0,D=0,B=0,$=new T(0,0),F=0;F<k.length;F++){F%I==0&&(B=0,D=M,F!=0&&(D+=m.DEFAULT_COMPONENT_SEPERATION),M=0);var G=k[F],W=L.findCenterOfTree(G);R.x=B,R.y=D,$=O.radialLayout(G,W,R),$.y>M&&(M=Math.floor($.y)),B=Math.floor($.x+m.DEFAULT_COMPONENT_SEPERATION)}this.transform(new T(b.WORLD_CENTER_X-$.x/2,b.WORLD_CENTER_Y-$.y/2))},O.radialLayout=function(k,R,I){var M=Math.max(this.maxDiagonalInTree(k),m.DEFAULT_RADIAL_SEPARATION);O.branchRadialLayout(R,null,0,359,0,M);var D=A.calculateBounds(k),B=new N;B.setDeviceOrgX(D.getMinX()),B.setDeviceOrgY(D.getMinY()),B.setWorldOrgX(I.x),B.setWorldOrgY(I.y);for(var $=0;$<k.length;$++){var F=k[$];F.transform(B)}var G=new T(D.getMaxX(),D.getMaxY());return B.inverseTransformPoint(G)},O.branchRadialLayout=function(k,R,I,M,D,B){var $=(M-I+1)/2;$<0&&($+=180);var F=($+I)%360,G=F*C.TWO_PI/360,W=D*Math.cos(G),J=D*Math.sin(G);k.setCenter(W,J);var q=[];q=q.concat(k.getEdges());var ne=q.length;R!=null&&ne--;for(var ae=0,pe=q.length,K,Z=k.getEdgesBetween(R);Z.length>1;){var X=Z[0];Z.splice(0,1);var Y=q.indexOf(X);Y>=0&&q.splice(Y,1),pe--,ne--}R!=null?K=(q.indexOf(Z[0])+1)%pe:K=0;for(var ee=Math.abs(M-I)/ne,j=K;ae!=ne;j=++j%pe){var fe=q[j].getOtherEnd(k);if(fe!=R){var te=(I+ae*ee)%360,Ae=(te+ee)%360;O.branchRadialLayout(fe,k,te,Ae,D+B,B),ae++}}},O.maxDiagonalInTree=function(k){for(var R=S.MIN_VALUE,I=0;I<k.length;I++){var M=k[I],D=M.getDiagonal();D>R&&(R=D)}return R},O.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},O.prototype.groupZeroDegreeMembers=function(){var k=this,R={};this.memberGroups={},this.idToDummyNode={};for(var I=[],M=this.graphManager.getAllNodes(),D=0;D<M.length;D++){var B=M[D],$=B.getParent();this.getNodeDegreeWithChildren(B)===0&&($.id==null||!this.getToBeTiled($))&&I.push(B)}for(var D=0;D<I.length;D++){var B=I[D],F=B.getParent().id;typeof R[F]>"u"&&(R[F]=[]),R[F]=R[F].concat(B)}Object.keys(R).forEach(function(G){if(R[G].length>1){var W="DummyCompound_"+G;k.memberGroups[W]=R[G];var J=R[G][0].getParent(),q=new p(k.graphManager);q.id=W,q.paddingLeft=J.paddingLeft||0,q.paddingRight=J.paddingRight||0,q.paddingBottom=J.paddingBottom||0,q.paddingTop=J.paddingTop||0,k.idToDummyNode[W]=q;var ne=k.getGraphManager().add(k.newGraph(),q),ae=J.getChild();ae.add(q);for(var pe=0;pe<R[G].length;pe++){var K=R[G][pe];ae.remove(K),ne.add(K)}}})},O.prototype.clearCompounds=function(){var k={},R={};this.performDFSOnCompounds();for(var I=0;I<this.compoundOrder.length;I++)R[this.compoundOrder[I].id]=this.compoundOrder[I],k[this.compoundOrder[I].id]=[].concat(this.compoundOrder[I].getChild().getNodes()),this.graphManager.remove(this.compoundOrder[I].getChild()),this.compoundOrder[I].child=null;this.graphManager.resetAllNodes(),this.tileCompoundMembers(k,R)},O.prototype.clearZeroDegreeMembers=function(){var k=this,R=this.tiledZeroDegreePack=[];Object.keys(this.memberGroups).forEach(function(I){var M=k.idToDummyNode[I];if(R[I]=k.tileNodes(k.memberGroups[I],M.paddingLeft+M.paddingRight),M.rect.width=R[I].width,M.rect.height=R[I].height,M.setCenter(R[I].centerX,R[I].centerY),M.labelMarginLeft=0,M.labelMarginTop=0,m.NODE_DIMENSIONS_INCLUDE_LABELS){var D=M.rect.width,B=M.rect.height;M.labelWidth&&(M.labelPosHorizontal=="left"?(M.rect.x-=M.labelWidth,M.setWidth(D+M.labelWidth),M.labelMarginLeft=M.labelWidth):M.labelPosHorizontal=="center"&&M.labelWidth>D?(M.rect.x-=(M.labelWidth-D)/2,M.setWidth(M.labelWidth),M.labelMarginLeft=(M.labelWidth-D)/2):M.labelPosHorizontal=="right"&&M.setWidth(D+M.labelWidth)),M.labelHeight&&(M.labelPosVertical=="top"?(M.rect.y-=M.labelHeight,M.setHeight(B+M.labelHeight),M.labelMarginTop=M.labelHeight):M.labelPosVertical=="center"&&M.labelHeight>B?(M.rect.y-=(M.labelHeight-B)/2,M.setHeight(M.labelHeight),M.labelMarginTop=(M.labelHeight-B)/2):M.labelPosVertical=="bottom"&&M.setHeight(B+M.labelHeight))}})},O.prototype.repopulateCompounds=function(){for(var k=this.compoundOrder.length-1;k>=0;k--){var R=this.compoundOrder[k],I=R.id,M=R.paddingLeft,D=R.paddingTop,B=R.labelMarginLeft,$=R.labelMarginTop;this.adjustLocations(this.tiledMemberPack[I],R.rect.x,R.rect.y,M,D,B,$)}},O.prototype.repopulateZeroDegreeMembers=function(){var k=this,R=this.tiledZeroDegreePack;Object.keys(R).forEach(function(I){var M=k.idToDummyNode[I],D=M.paddingLeft,B=M.paddingTop,$=M.labelMarginLeft,F=M.labelMarginTop;k.adjustLocations(R[I],M.rect.x,M.rect.y,D,B,$,F)})},O.prototype.getToBeTiled=function(k){var R=k.id;if(this.toBeTiled[R]!=null)return this.toBeTiled[R];var I=k.getChild();if(I==null)return this.toBeTiled[R]=!1,!1;for(var M=I.getNodes(),D=0;D<M.length;D++){var B=M[D];if(this.getNodeDegree(B)>0)return this.toBeTiled[R]=!1,!1;if(B.getChild()==null){this.toBeTiled[B.id]=!1;continue}if(!this.getToBeTiled(B))return this.toBeTiled[R]=!1,!1}return this.toBeTiled[R]=!0,!0},O.prototype.getNodeDegree=function(k){k.id;for(var R=k.getEdges(),I=0,M=0;M<R.length;M++){var D=R[M];D.getSource().id!==D.getTarget().id&&(I=I+1)}return I},O.prototype.getNodeDegreeWithChildren=function(k){var R=this.getNodeDegree(k);if(k.getChild()==null)return R;for(var I=k.getChild().getNodes(),M=0;M<I.length;M++){var D=I[M];R+=this.getNodeDegreeWithChildren(D)}return R},O.prototype.performDFSOnCompounds=function(){this.compoundOrder=[],this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes())},O.prototype.fillCompexOrderByDFS=function(k){for(var R=0;R<k.length;R++){var I=k[R];I.getChild()!=null&&this.fillCompexOrderByDFS(I.getChild().getNodes()),this.getToBeTiled(I)&&this.compoundOrder.push(I)}},O.prototype.adjustLocations=function(k,R,I,M,D,B,$){R+=M+B,I+=D+$;for(var F=R,G=0;G<k.rows.length;G++){var W=k.rows[G];R=F;for(var J=0,q=0;q<W.length;q++){var ne=W[q];ne.rect.x=R,ne.rect.y=I,R+=ne.rect.width+k.horizontalPadding,ne.rect.height>J&&(J=ne.rect.height)}I+=J+k.verticalPadding}},O.prototype.tileCompoundMembers=function(k,R){var I=this;this.tiledMemberPack=[],Object.keys(k).forEach(function(M){var D=R[M];if(I.tiledMemberPack[M]=I.tileNodes(k[M],D.paddingLeft+D.paddingRight),D.rect.width=I.tiledMemberPack[M].width,D.rect.height=I.tiledMemberPack[M].height,D.setCenter(I.tiledMemberPack[M].centerX,I.tiledMemberPack[M].centerY),D.labelMarginLeft=0,D.labelMarginTop=0,m.NODE_DIMENSIONS_INCLUDE_LABELS){var B=D.rect.width,$=D.rect.height;D.labelWidth&&(D.labelPosHorizontal=="left"?(D.rect.x-=D.labelWidth,D.setWidth(B+D.labelWidth),D.labelMarginLeft=D.labelWidth):D.labelPosHorizontal=="center"&&D.labelWidth>B?(D.rect.x-=(D.labelWidth-B)/2,D.setWidth(D.labelWidth),D.labelMarginLeft=(D.labelWidth-B)/2):D.labelPosHorizontal=="right"&&D.setWidth(B+D.labelWidth)),D.labelHeight&&(D.labelPosVertical=="top"?(D.rect.y-=D.labelHeight,D.setHeight($+D.labelHeight),D.labelMarginTop=D.labelHeight):D.labelPosVertical=="center"&&D.labelHeight>$?(D.rect.y-=(D.labelHeight-$)/2,D.setHeight(D.labelHeight),D.labelMarginTop=(D.labelHeight-$)/2):D.labelPosVertical=="bottom"&&D.setHeight($+D.labelHeight))}})},O.prototype.tileNodes=function(k,R){var I=this.tileNodesByFavoringDim(k,R,!0),M=this.tileNodesByFavoringDim(k,R,!1),D=this.getOrgRatio(I),B=this.getOrgRatio(M),$;return B<D?$=M:$=I,$},O.prototype.getOrgRatio=function(k){var R=k.width,I=k.height,M=R/I;return M<1&&(M=1/M),M},O.prototype.calcIdealRowWidth=function(k,R){var I=m.TILING_PADDING_VERTICAL,M=m.TILING_PADDING_HORIZONTAL,D=k.length,B=0,$=0,F=0;k.forEach(function(pe){B+=pe.getWidth(),$+=pe.getHeight(),pe.getWidth()>F&&(F=pe.getWidth())});var G=B/D,W=$/D,J=Math.pow(I-M,2)+4*(G+M)*(W+I)*D,q=(M-I+Math.sqrt(J))/(2*(G+M)),ne;R?(ne=Math.ceil(q),ne==q&&ne++):ne=Math.floor(q);var ae=ne*(G+M)-M;return F>ae&&(ae=F),ae+=M*2,ae},O.prototype.tileNodesByFavoringDim=function(k,R,I){var M=m.TILING_PADDING_VERTICAL,D=m.TILING_PADDING_HORIZONTAL,B=m.TILING_COMPARE_BY,$={rows:[],rowWidth:[],rowHeight:[],width:0,height:R,verticalPadding:M,horizontalPadding:D,centerX:0,centerY:0};B&&($.idealRowWidth=this.calcIdealRowWidth(k,I));var F=function(K){return K.rect.width*K.rect.height},G=function(K,Z){return F(Z)-F(K)};k.sort(function(pe,K){var Z=G;return $.idealRowWidth?(Z=B,Z(pe.id,K.id)):Z(pe,K)});for(var W=0,J=0,q=0;q<k.length;q++){var ne=k[q];W+=ne.getCenterX(),J+=ne.getCenterY()}$.centerX=W/k.length,$.centerY=J/k.length;for(var q=0;q<k.length;q++){var ne=k[q];if($.rows.length==0)this.insertNodeToRow($,ne,0,R);else if(this.canAddHorizontal($,ne.rect.width,ne.rect.height)){var ae=$.rows.length-1;$.idealRowWidth||(ae=this.getShortestRowIndex($)),this.insertNodeToRow($,ne,ae,R)}else this.insertNodeToRow($,ne,$.rows.length,R);this.shiftToLastRow($)}return $},O.prototype.insertNodeToRow=function(k,R,I,M){var D=M;if(I==k.rows.length){var B=[];k.rows.push(B),k.rowWidth.push(D),k.rowHeight.push(0)}var $=k.rowWidth[I]+R.rect.width;k.rows[I].length>0&&($+=k.horizontalPadding),k.rowWidth[I]=$,k.width<$&&(k.width=$);var F=R.rect.height;I>0&&(F+=k.verticalPadding);var G=0;F>k.rowHeight[I]&&(G=k.rowHeight[I],k.rowHeight[I]=F,G=k.rowHeight[I]-G),k.height+=G,k.rows[I].push(R)},O.prototype.getShortestRowIndex=function(k){for(var R=-1,I=Number.MAX_VALUE,M=0;M<k.rows.length;M++)k.rowWidth[M]<I&&(R=M,I=k.rowWidth[M]);return R},O.prototype.getLongestRowIndex=function(k){for(var R=-1,I=Number.MIN_VALUE,M=0;M<k.rows.length;M++)k.rowWidth[M]>I&&(R=M,I=k.rowWidth[M]);return R},O.prototype.canAddHorizontal=function(k,R,I){if(k.idealRowWidth){var M=k.rows.length-1,D=k.rowWidth[M];return D+R+k.horizontalPadding<=k.idealRowWidth}var B=this.getShortestRowIndex(k);if(B<0)return!0;var $=k.rowWidth[B];if($+k.horizontalPadding+R<=k.width)return!0;var F=0;k.rowHeight[B]<I&&B>0&&(F=I+k.verticalPadding-k.rowHeight[B]);var G;k.width-$>=R+k.horizontalPadding?G=(k.height+F)/($+R+k.horizontalPadding):G=(k.height+F)/k.width,F=I+k.verticalPadding;var W;return k.width<R?W=(k.height+F)/R:W=(k.height+F)/k.width,W<1&&(W=1/W),G<1&&(G=1/G),G<W},O.prototype.shiftToLastRow=function(k){var R=this.getLongestRowIndex(k),I=k.rowWidth.length-1,M=k.rows[R],D=M[M.length-1],B=D.width+k.horizontalPadding;if(k.width-k.rowWidth[I]>B&&R!=I){M.splice(-1,1),k.rows[I].push(D),k.rowWidth[R]=k.rowWidth[R]-B,k.rowWidth[I]=k.rowWidth[I]+B,k.width=k.rowWidth[instance.getLongestRowIndex(k)];for(var $=Number.MIN_VALUE,F=0;F<M.length;F++)M[F].height>$&&($=M[F].height);R>0&&($+=k.verticalPadding);var G=k.rowHeight[R]+k.rowHeight[I];k.rowHeight[R]=$,k.rowHeight[I]<D.height+k.verticalPadding&&(k.rowHeight[I]=D.height+k.verticalPadding);var W=k.rowHeight[R]+k.rowHeight[I];k.height+=W-G,this.shiftToLastRow(k)}},O.prototype.tilingPreLayout=function(){m.TILE&&(this.groupZeroDegreeMembers(),this.clearCompounds(),this.clearZeroDegreeMembers())},O.prototype.tilingPostLayout=function(){m.TILE&&(this.repopulateZeroDegreeMembers(),this.repopulateCompounds())},O.prototype.reduceTrees=function(){for(var k=[],R=!0,I;R;){var M=this.graphManager.getAllNodes(),D=[];R=!1;for(var B=0;B<M.length;B++)if(I=M[B],I.getEdges().length==1&&!I.getEdges()[0].isInterGraph&&I.getChild()==null){if(m.PURE_INCREMENTAL){var $=I.getEdges()[0].getOtherEnd(I),F=new E(I.getCenterX()-$.getCenterX(),I.getCenterY()-$.getCenterY());D.push([I,I.getEdges()[0],I.getOwner(),F])}else D.push([I,I.getEdges()[0],I.getOwner()]);R=!0}if(R==!0){for(var G=[],W=0;W<D.length;W++)D[W][0].getEdges().length==1&&(G.push(D[W]),D[W][0].getOwner().remove(D[W][0]));k.push(G),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()}}this.prunedNodesAll=k},O.prototype.growTree=function(k){for(var R=k.length,I=k[R-1],M,D=0;D<I.length;D++)M=I[D],this.findPlaceforPrunedNode(M),M[2].add(M[0]),M[2].add(M[1],M[1].source,M[1].target);k.splice(k.length-1,1),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()},O.prototype.findPlaceforPrunedNode=function(k){var R,I,M=k[0];if(M==k[1].source?I=k[1].target:I=k[1].source,m.PURE_INCREMENTAL)M.setCenter(I.getCenterX()+k[3].getWidth(),I.getCenterY()+k[3].getHeight());else{var D=I.startX,B=I.finishX,$=I.startY,F=I.finishY,G=0,W=0,J=0,q=0,ne=[G,J,W,q];if($>0)for(var ae=D;ae<=B;ae++)ne[0]+=this.grid[ae][$-1].length+this.grid[ae][$].length-1;if(B<this.grid.length-1)for(var ae=$;ae<=F;ae++)ne[1]+=this.grid[B+1][ae].length+this.grid[B][ae].length-1;if(F<this.grid[0].length-1)for(var ae=D;ae<=B;ae++)ne[2]+=this.grid[ae][F+1].length+this.grid[ae][F].length-1;if(D>0)for(var ae=$;ae<=F;ae++)ne[3]+=this.grid[D-1][ae].length+this.grid[D][ae].length-1;for(var pe=S.MAX_VALUE,K,Z,X=0;X<ne.length;X++)ne[X]<pe?(pe=ne[X],K=1,Z=X):ne[X]==pe&&K++;if(K==3&&pe==0)ne[0]==0&&ne[1]==0&&ne[2]==0?R=1:ne[0]==0&&ne[1]==0&&ne[3]==0?R=0:ne[0]==0&&ne[2]==0&&ne[3]==0?R=3:ne[1]==0&&ne[2]==0&&ne[3]==0&&(R=2);else if(K==2&&pe==0){var Y=Math.floor(Math.random()*2);ne[0]==0&&ne[1]==0?Y==0?R=0:R=1:ne[0]==0&&ne[2]==0?Y==0?R=0:R=2:ne[0]==0&&ne[3]==0?Y==0?R=0:R=3:ne[1]==0&&ne[2]==0?Y==0?R=1:R=2:ne[1]==0&&ne[3]==0?Y==0?R=1:R=3:Y==0?R=2:R=3}else if(K==4&&pe==0){var Y=Math.floor(Math.random()*4);R=Y}else R=Z;R==0?M.setCenter(I.getCenterX(),I.getCenterY()-I.getHeight()/2-y.DEFAULT_EDGE_LENGTH-M.getHeight()/2):R==1?M.setCenter(I.getCenterX()+I.getWidth()/2+y.DEFAULT_EDGE_LENGTH+M.getWidth()/2,I.getCenterY()):R==2?M.setCenter(I.getCenterX(),I.getCenterY()+I.getHeight()/2+y.DEFAULT_EDGE_LENGTH+M.getHeight()/2):M.setCenter(I.getCenterX()-I.getWidth()/2-y.DEFAULT_EDGE_LENGTH-M.getWidth()/2,I.getCenterY())}},o.exports=O},991:(o,l,u)=>{var h=u(551).FDLayoutNode,d=u(551).IMath;function f(g,m,v,y){h.call(this,g,m,v,y)}f.prototype=Object.create(h.prototype);for(var p in h)f[p]=h[p];f.prototype.calculateDisplacement=function(){var g=this.graphManager.getLayout();this.getChild()!=null&&this.fixedNodeWeight?(this.displacementX+=g.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.fixedNodeWeight,this.displacementY+=g.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.fixedNodeWeight):(this.displacementX+=g.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY+=g.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren),Math.abs(this.displacementX)>g.coolingFactor*g.maxNodeDisplacement&&(this.displacementX=g.coolingFactor*g.maxNodeDisplacement*d.sign(this.displacementX)),Math.abs(this.displacementY)>g.coolingFactor*g.maxNodeDisplacement&&(this.displacementY=g.coolingFactor*g.maxNodeDisplacement*d.sign(this.displacementY)),this.child&&this.child.getNodes().length>0&&this.propogateDisplacementToChildren(this.displacementX,this.displacementY)},f.prototype.propogateDisplacementToChildren=function(g,m){for(var v=this.getChild().getNodes(),y,b=0;b<v.length;b++)y=v[b],y.getChild()==null?(y.displacementX+=g,y.displacementY+=m):y.propogateDisplacementToChildren(g,m)},f.prototype.move=function(){var g=this.graphManager.getLayout();(this.child==null||this.child.getNodes().length==0)&&(this.moveBy(this.displacementX,this.displacementY),g.totalDisplacement+=Math.abs(this.displacementX)+Math.abs(this.displacementY)),this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0},f.prototype.setPred1=function(g){this.pred1=g},f.prototype.getPred1=function(){return pred1},f.prototype.getPred2=function(){return pred2},f.prototype.setNext=function(g){this.next=g},f.prototype.getNext=function(){return next},f.prototype.setProcessed=function(g){this.processed=g},f.prototype.isProcessed=function(){return processed},o.exports=f},902:(o,l,u)=>{function h(v){if(Array.isArray(v)){for(var y=0,b=Array(v.length);y<v.length;y++)b[y]=v[y];return b}else return Array.from(v)}var d=u(806),f=u(551).LinkedList,p=u(551).Matrix,g=u(551).SVD;function m(){}m.handleConstraints=function(v){var y={};y.fixedNodeConstraint=v.constraints.fixedNodeConstraint,y.alignmentConstraint=v.constraints.alignmentConstraint,y.relativePlacementConstraint=v.constraints.relativePlacementConstraint;for(var b=new Map,w=new Map,T=[],E=[],L=v.getAllNodes(),S=0,C=0;C<L.length;C++){var A=L[C];A.getChild()==null&&(w.set(A.id,S++),T.push(A.getCenterX()),E.push(A.getCenterY()),b.set(A.id,A))}y.relativePlacementConstraint&&y.relativePlacementConstraint.forEach(function(ce){!ce.gap&&ce.gap!=0&&(ce.left?ce.gap=d.DEFAULT_EDGE_LENGTH+b.get(ce.left).getWidth()/2+b.get(ce.right).getWidth()/2:ce.gap=d.DEFAULT_EDGE_LENGTH+b.get(ce.top).getHeight()/2+b.get(ce.bottom).getHeight()/2)});var N=function(z,oe){return{x:z.x-oe.x,y:z.y-oe.y}},_=function(z){var oe=0,se=0;return z.forEach(function(ge){oe+=T[w.get(ge)],se+=E[w.get(ge)]}),{x:oe/z.size,y:se/z.size}},O=function(z,oe,se,ge,he){function be(Be,He){var ht=new Set(Be),st=!0,We=!1,kt=void 0;try{for(var qe=He[Symbol.iterator](),rt;!(st=(rt=qe.next()).done);st=!0){var ct=rt.value;ht.add(ct)}}catch(ut){We=!0,kt=ut}finally{try{!st&&qe.return&&qe.return()}finally{if(We)throw kt}}return ht}var Ce=new Map;z.forEach(function(Be,He){Ce.set(He,0)}),z.forEach(function(Be,He){Be.forEach(function(ht){Ce.set(ht.id,Ce.get(ht.id)+1)})});var Te=new Map,Ne=new Map,Xe=new f;Ce.forEach(function(Be,He){Be==0?(Xe.push(He),se||(oe=="horizontal"?Te.set(He,w.has(He)?T[w.get(He)]:ge.get(He)):Te.set(He,w.has(He)?E[w.get(He)]:ge.get(He)))):Te.set(He,Number.NEGATIVE_INFINITY),se&&Ne.set(He,new Set([He]))}),se&&he.forEach(function(Be){var He=[];if(Be.forEach(function(We){se.has(We)&&He.push(We)}),He.length>0){var ht=0;He.forEach(function(We){oe=="horizontal"?(Te.set(We,w.has(We)?T[w.get(We)]:ge.get(We)),ht+=Te.get(We)):(Te.set(We,w.has(We)?E[w.get(We)]:ge.get(We)),ht+=Te.get(We))}),ht=ht/He.length,Be.forEach(function(We){se.has(We)||Te.set(We,ht)})}else{var st=0;Be.forEach(function(We){oe=="horizontal"?st+=w.has(We)?T[w.get(We)]:ge.get(We):st+=w.has(We)?E[w.get(We)]:ge.get(We)}),st=st/Be.length,Be.forEach(function(We){Te.set(We,st)})}});for(var Ye=function(){var He=Xe.shift(),ht=z.get(He);ht.forEach(function(st){if(Te.get(st.id)<Te.get(He)+st.gap)if(se&&se.has(st.id)){var We=void 0;if(oe=="horizontal"?We=w.has(st.id)?T[w.get(st.id)]:ge.get(st.id):We=w.has(st.id)?E[w.get(st.id)]:ge.get(st.id),Te.set(st.id,We),We<Te.get(He)+st.gap){var kt=Te.get(He)+st.gap-We;Ne.get(He).forEach(function(qe){Te.set(qe,Te.get(qe)-kt)})}}else Te.set(st.id,Te.get(He)+st.gap);Ce.set(st.id,Ce.get(st.id)-1),Ce.get(st.id)==0&&Xe.push(st.id),se&&Ne.set(st.id,be(Ne.get(He),Ne.get(st.id)))})};Xe.length!=0;)Ye();if(se){var Ke=new Set;z.forEach(function(Be,He){Be.length==0&&Ke.add(He)});var Ze=[];Ne.forEach(function(Be,He){if(Ke.has(He)){var ht=!1,st=!0,We=!1,kt=void 0;try{for(var qe=Be[Symbol.iterator](),rt;!(st=(rt=qe.next()).done);st=!0){var ct=rt.value;se.has(ct)&&(ht=!0)}}catch(bt){We=!0,kt=bt}finally{try{!st&&qe.return&&qe.return()}finally{if(We)throw kt}}if(!ht){var ut=!1,nt=void 0;Ze.forEach(function(bt,Zt){bt.has([].concat(h(Be))[0])&&(ut=!0,nt=Zt)}),ut?Be.forEach(function(bt){Ze[nt].add(bt)}):Ze.push(new Set(Be))}}}),Ze.forEach(function(Be,He){var ht=Number.POSITIVE_INFINITY,st=Number.POSITIVE_INFINITY,We=Number.NEGATIVE_INFINITY,kt=Number.NEGATIVE_INFINITY,qe=!0,rt=!1,ct=void 0;try{for(var ut=Be[Symbol.iterator](),nt;!(qe=(nt=ut.next()).done);qe=!0){var bt=nt.value,Zt=void 0;oe=="horizontal"?Zt=w.has(bt)?T[w.get(bt)]:ge.get(bt):Zt=w.has(bt)?E[w.get(bt)]:ge.get(bt);var Ot=Te.get(bt);Zt<ht&&(ht=Zt),Zt>We&&(We=Zt),Ot<st&&(st=Ot),Ot>kt&&(kt=Ot)}}catch(Ee){rt=!0,ct=Ee}finally{try{!qe&&ut.return&&ut.return()}finally{if(rt)throw ct}}var tr=(ht+We)/2-(st+kt)/2,xr=!0,rr=!1,Wt=void 0;try{for(var cr=Be[Symbol.iterator](),an;!(xr=(an=cr.next()).done);xr=!0){var dt=an.value;Te.set(dt,Te.get(dt)+tr)}}catch(Ee){rr=!0,Wt=Ee}finally{try{!xr&&cr.return&&cr.return()}finally{if(rr)throw Wt}}})}return Te},P=function(z){var oe=0,se=0,ge=0,he=0;if(z.forEach(function(Ne){Ne.left?T[w.get(Ne.left)]-T[w.get(Ne.right)]>=0?oe++:se++:E[w.get(Ne.top)]-E[w.get(Ne.bottom)]>=0?ge++:he++}),oe>se&&ge>he)for(var be=0;be<w.size;be++)T[be]=-1*T[be],E[be]=-1*E[be];else if(oe>se)for(var Ce=0;Ce<w.size;Ce++)T[Ce]=-1*T[Ce];else if(ge>he)for(var Te=0;Te<w.size;Te++)E[Te]=-1*E[Te]},k=function(z){var oe=[],se=new f,ge=new Set,he=0;return z.forEach(function(be,Ce){if(!ge.has(Ce)){oe[he]=[];var Te=Ce;for(se.push(Te),ge.add(Te),oe[he].push(Te);se.length!=0;){Te=se.shift();var Ne=z.get(Te);Ne.forEach(function(Xe){ge.has(Xe.id)||(se.push(Xe.id),ge.add(Xe.id),oe[he].push(Xe.id))})}he++}}),oe},R=function(z){var oe=new Map;return z.forEach(function(se,ge){oe.set(ge,[])}),z.forEach(function(se,ge){se.forEach(function(he){oe.get(ge).push(he),oe.get(he.id).push({id:ge,gap:he.gap,direction:he.direction})})}),oe},I=function(z){var oe=new Map;return z.forEach(function(se,ge){oe.set(ge,[])}),z.forEach(function(se,ge){se.forEach(function(he){oe.get(he.id).push({id:ge,gap:he.gap,direction:he.direction})})}),oe},M=[],D=[],B=!1,$=!1,F=new Set,G=new Map,W=new Map,J=[];if(y.fixedNodeConstraint&&y.fixedNodeConstraint.forEach(function(ce){F.add(ce.nodeId)}),y.relativePlacementConstraint&&(y.relativePlacementConstraint.forEach(function(ce){ce.left?(G.has(ce.left)?G.get(ce.left).push({id:ce.right,gap:ce.gap,direction:"horizontal"}):G.set(ce.left,[{id:ce.right,gap:ce.gap,direction:"horizontal"}]),G.has(ce.right)||G.set(ce.right,[])):(G.has(ce.top)?G.get(ce.top).push({id:ce.bottom,gap:ce.gap,direction:"vertical"}):G.set(ce.top,[{id:ce.bottom,gap:ce.gap,direction:"vertical"}]),G.has(ce.bottom)||G.set(ce.bottom,[]))}),W=R(G),J=k(W)),d.TRANSFORM_ON_CONSTRAINT_HANDLING){if(y.fixedNodeConstraint&&y.fixedNodeConstraint.length>1)y.fixedNodeConstraint.forEach(function(ce,z){M[z]=[ce.position.x,ce.position.y],D[z]=[T[w.get(ce.nodeId)],E[w.get(ce.nodeId)]]}),B=!0;else if(y.alignmentConstraint)(function(){var ce=0;if(y.alignmentConstraint.vertical){for(var z=y.alignmentConstraint.vertical,oe=function(Te){var Ne=new Set;z[Te].forEach(function(Ke){Ne.add(Ke)});var Xe=new Set([].concat(h(Ne)).filter(function(Ke){return F.has(Ke)})),Ye=void 0;Xe.size>0?Ye=T[w.get(Xe.values().next().value)]:Ye=_(Ne).x,z[Te].forEach(function(Ke){M[ce]=[Ye,E[w.get(Ke)]],D[ce]=[T[w.get(Ke)],E[w.get(Ke)]],ce++})},se=0;se<z.length;se++)oe(se);B=!0}if(y.alignmentConstraint.horizontal){for(var ge=y.alignmentConstraint.horizontal,he=function(Te){var Ne=new Set;ge[Te].forEach(function(Ke){Ne.add(Ke)});var Xe=new Set([].concat(h(Ne)).filter(function(Ke){return F.has(Ke)})),Ye=void 0;Xe.size>0?Ye=T[w.get(Xe.values().next().value)]:Ye=_(Ne).y,ge[Te].forEach(function(Ke){M[ce]=[T[w.get(Ke)],Ye],D[ce]=[T[w.get(Ke)],E[w.get(Ke)]],ce++})},be=0;be<ge.length;be++)he(be);B=!0}y.relativePlacementConstraint&&($=!0)})();else if(y.relativePlacementConstraint){for(var q=0,ne=0,ae=0;ae<J.length;ae++)J[ae].length>q&&(q=J[ae].length,ne=ae);if(q<W.size/2)P(y.relativePlacementConstraint),B=!1,$=!1;else{var pe=new Map,K=new Map,Z=[];J[ne].forEach(function(ce){G.get(ce).forEach(function(z){z.direction=="horizontal"?(pe.has(ce)?pe.get(ce).push(z):pe.set(ce,[z]),pe.has(z.id)||pe.set(z.id,[]),Z.push({left:ce,right:z.id})):(K.has(ce)?K.get(ce).push(z):K.set(ce,[z]),K.has(z.id)||K.set(z.id,[]),Z.push({top:ce,bottom:z.id}))})}),P(Z),$=!1;var X=O(pe,"horizontal"),Y=O(K,"vertical");J[ne].forEach(function(ce,z){D[z]=[T[w.get(ce)],E[w.get(ce)]],M[z]=[],X.has(ce)?M[z][0]=X.get(ce):M[z][0]=T[w.get(ce)],Y.has(ce)?M[z][1]=Y.get(ce):M[z][1]=E[w.get(ce)]}),B=!0}}if(B){for(var ee=void 0,j=p.transpose(M),fe=p.transpose(D),te=0;te<j.length;te++)j[te]=p.multGamma(j[te]),fe[te]=p.multGamma(fe[te]);var Ae=p.multMat(j,p.transpose(fe)),H=g.svd(Ae);ee=p.multMat(H.V,p.transpose(H.U));for(var Oe=0;Oe<w.size;Oe++){var ue=[T[Oe],E[Oe]],Ve=[ee[0][0],ee[1][0]],Ge=[ee[0][1],ee[1][1]];T[Oe]=p.dotProduct(ue,Ve),E[Oe]=p.dotProduct(ue,Ge)}$&&P(y.relativePlacementConstraint)}}if(d.ENFORCE_CONSTRAINTS){if(y.fixedNodeConstraint&&y.fixedNodeConstraint.length>0){var Ue={x:0,y:0};y.fixedNodeConstraint.forEach(function(ce,z){var oe={x:T[w.get(ce.nodeId)],y:E[w.get(ce.nodeId)]},se=ce.position,ge=N(se,oe);Ue.x+=ge.x,Ue.y+=ge.y}),Ue.x/=y.fixedNodeConstraint.length,Ue.y/=y.fixedNodeConstraint.length,T.forEach(function(ce,z){T[z]+=Ue.x}),E.forEach(function(ce,z){E[z]+=Ue.y}),y.fixedNodeConstraint.forEach(function(ce){T[w.get(ce.nodeId)]=ce.position.x,E[w.get(ce.nodeId)]=ce.position.y})}if(y.alignmentConstraint){if(y.alignmentConstraint.vertical)for(var ke=y.alignmentConstraint.vertical,Pe=function(z){var oe=new Set;ke[z].forEach(function(he){oe.add(he)});var se=new Set([].concat(h(oe)).filter(function(he){return F.has(he)})),ge=void 0;se.size>0?ge=T[w.get(se.values().next().value)]:ge=_(oe).x,oe.forEach(function(he){F.has(he)||(T[w.get(he)]=ge)})},Se=0;Se<ke.length;Se++)Pe(Se);if(y.alignmentConstraint.horizontal)for(var _e=y.alignmentConstraint.horizontal,ze=function(z){var oe=new Set;_e[z].forEach(function(he){oe.add(he)});var se=new Set([].concat(h(oe)).filter(function(he){return F.has(he)})),ge=void 0;se.size>0?ge=E[w.get(se.values().next().value)]:ge=_(oe).y,oe.forEach(function(he){F.has(he)||(E[w.get(he)]=ge)})},me=0;me<_e.length;me++)ze(me)}y.relativePlacementConstraint&&function(){var ce=new Map,z=new Map,oe=new Map,se=new Map,ge=new Map,he=new Map,be=new Set,Ce=new Set;if(F.forEach(function(Tt){be.add(Tt),Ce.add(Tt)}),y.alignmentConstraint){if(y.alignmentConstraint.vertical)for(var Te=y.alignmentConstraint.vertical,Ne=function(lt){oe.set("dummy"+lt,[]),Te[lt].forEach(function(je){ce.set(je,"dummy"+lt),oe.get("dummy"+lt).push(je),F.has(je)&&be.add("dummy"+lt)}),ge.set("dummy"+lt,T[w.get(Te[lt][0])])},Xe=0;Xe<Te.length;Xe++)Ne(Xe);if(y.alignmentConstraint.horizontal)for(var Ye=y.alignmentConstraint.horizontal,Ke=function(lt){se.set("dummy"+lt,[]),Ye[lt].forEach(function(je){z.set(je,"dummy"+lt),se.get("dummy"+lt).push(je),F.has(je)&&Ce.add("dummy"+lt)}),he.set("dummy"+lt,E[w.get(Ye[lt][0])])},Ze=0;Ze<Ye.length;Ze++)Ke(Ze)}var Be=new Map,He=new Map,ht=function(lt){G.get(lt).forEach(function(je){var jt=void 0,de=void 0;je.direction=="horizontal"?(jt=ce.get(lt)?ce.get(lt):lt,ce.get(je.id)?de={id:ce.get(je.id),gap:je.gap,direction:je.direction}:de=je,Be.has(jt)?Be.get(jt).push(de):Be.set(jt,[de]),Be.has(de.id)||Be.set(de.id,[])):(jt=z.get(lt)?z.get(lt):lt,z.get(je.id)?de={id:z.get(je.id),gap:je.gap,direction:je.direction}:de=je,He.has(jt)?He.get(jt).push(de):He.set(jt,[de]),He.has(de.id)||He.set(de.id,[]))})},st=!0,We=!1,kt=void 0;try{for(var qe=G.keys()[Symbol.iterator](),rt;!(st=(rt=qe.next()).done);st=!0){var ct=rt.value;ht(ct)}}catch(Tt){We=!0,kt=Tt}finally{try{!st&&qe.return&&qe.return()}finally{if(We)throw kt}}var ut=R(Be),nt=R(He),bt=k(ut),Zt=k(nt),Ot=I(Be),tr=I(He),xr=[],rr=[];bt.forEach(function(Tt,lt){xr[lt]=[],Tt.forEach(function(je){Ot.get(je).length==0&&xr[lt].push(je)})}),Zt.forEach(function(Tt,lt){rr[lt]=[],Tt.forEach(function(je){tr.get(je).length==0&&rr[lt].push(je)})});var Wt=O(Be,"horizontal",be,ge,xr),cr=O(He,"vertical",Ce,he,rr),an=function(lt){oe.get(lt)?oe.get(lt).forEach(function(je){T[w.get(je)]=Wt.get(lt)}):T[w.get(lt)]=Wt.get(lt)},dt=!0,Ee=!1,Je=void 0;try{for(var wt=Wt.keys()[Symbol.iterator](),or;!(dt=(or=wt.next()).done);dt=!0){var Ur=or.value;an(Ur)}}catch(Tt){Ee=!0,Je=Tt}finally{try{!dt&&wt.return&&wt.return()}finally{if(Ee)throw Je}}var ur=function(lt){se.get(lt)?se.get(lt).forEach(function(je){E[w.get(je)]=cr.get(lt)}):E[w.get(lt)]=cr.get(lt)},Yr=!0,fi=!1,xn=void 0;try{for(var bn=cr.keys()[Symbol.iterator](),pt;!(Yr=(pt=bn.next()).done);Yr=!0){var Ur=pt.value;ur(Ur)}}catch(Tt){fi=!0,xn=Tt}finally{try{!Yr&&bn.return&&bn.return()}finally{if(fi)throw xn}}}()}for(var De=0;De<L.length;De++){var Q=L[De];Q.getChild()==null&&Q.setCenter(T[w.get(Q.id)],E[w.get(Q.id)])}},o.exports=m},551:o=>{o.exports=r}},i={};function a(o){var l=i[o];if(l!==void 0)return l.exports;var u=i[o]={exports:{}};return n[o](u,u.exports,a),u.exports}var s=a(45);return s})()})}(B3)),B3.exports}(function(t,e){(function(n,i){t.exports=i(LRe())})(to,function(r){return(()=>{var n={658:o=>{o.exports=Object.assign!=null?Object.assign.bind(Object):function(l){for(var u=arguments.length,h=Array(u>1?u-1:0),d=1;d<u;d++)h[d-1]=arguments[d];return h.forEach(function(f){Object.keys(f).forEach(function(p){return l[p]=f[p]})}),l}},548:(o,l,u)=>{var h=function(){function p(g,m){var v=[],y=!0,b=!1,w=void 0;try{for(var T=g[Symbol.iterator](),E;!(y=(E=T.next()).done)&&(v.push(E.value),!(m&&v.length===m));y=!0);}catch(L){b=!0,w=L}finally{try{!y&&T.return&&T.return()}finally{if(b)throw w}}return v}return function(g,m){if(Array.isArray(g))return g;if(Symbol.iterator in Object(g))return p(g,m);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),d=u(140).layoutBase.LinkedList,f={};f.getTopMostNodes=function(p){for(var g={},m=0;m<p.length;m++)g[p[m].id()]=!0;var v=p.filter(function(y,b){typeof y=="number"&&(y=b);for(var w=y.parent()[0];w!=null;){if(g[w.id()])return!1;w=w.parent()[0]}return!0});return v},f.connectComponents=function(p,g,m,v){var y=new d,b=new Set,w=[],T=void 0,E=void 0,L=void 0,S=!1,C=1,A=[],N=[],_=function(){var P=p.collection();N.push(P);var k=m[0],R=p.collection();R.merge(k).merge(k.descendants().intersection(g)),w.push(k),R.forEach(function(D){y.push(D),b.add(D),P.merge(D)});for(var I=function(){k=y.shift();var B=p.collection();k.neighborhood().nodes().forEach(function(W){g.intersection(k.edgesWith(W)).length>0&&B.merge(W)});for(var $=0;$<B.length;$++){var F=B[$];if(T=m.intersection(F.union(F.ancestors())),T!=null&&!b.has(T[0])){var G=T.union(T.descendants());G.forEach(function(W){y.push(W),b.add(W),P.merge(W),m.has(W)&&w.push(W)})}}};y.length!=0;)I();if(P.forEach(function(D){g.intersection(D.connectedEdges()).forEach(function(B){P.has(B.source())&&P.has(B.target())&&P.merge(B)})}),w.length==m.length&&(S=!0),!S||S&&C>1){E=w[0],L=E.connectedEdges().length,w.forEach(function(D){D.connectedEdges().length<L&&(L=D.connectedEdges().length,E=D)}),A.push(E.id());var M=p.collection();M.merge(w[0]),w.forEach(function(D){M.merge(D)}),w=[],m=m.difference(M),C++}};do _();while(!S);return v&&A.length>0&&v.set("dummy"+(v.size+1),A),N},f.relocateComponent=function(p,g,m){if(!m.fixedNodeConstraint){var v=Number.POSITIVE_INFINITY,y=Number.NEGATIVE_INFINITY,b=Number.POSITIVE_INFINITY,w=Number.NEGATIVE_INFINITY;if(m.quality=="draft"){var T=!0,E=!1,L=void 0;try{for(var S=g.nodeIndexes[Symbol.iterator](),C;!(T=(C=S.next()).done);T=!0){var A=C.value,N=h(A,2),_=N[0],O=N[1],P=m.cy.getElementById(_);if(P){var k=P.boundingBox(),R=g.xCoords[O]-k.w/2,I=g.xCoords[O]+k.w/2,M=g.yCoords[O]-k.h/2,D=g.yCoords[O]+k.h/2;R<v&&(v=R),I>y&&(y=I),M<b&&(b=M),D>w&&(w=D)}}}catch(W){E=!0,L=W}finally{try{!T&&S.return&&S.return()}finally{if(E)throw L}}var B=p.x-(y+v)/2,$=p.y-(w+b)/2;g.xCoords=g.xCoords.map(function(W){return W+B}),g.yCoords=g.yCoords.map(function(W){return W+$})}else{Object.keys(g).forEach(function(W){var J=g[W],q=J.getRect().x,ne=J.getRect().x+J.getRect().width,ae=J.getRect().y,pe=J.getRect().y+J.getRect().height;q<v&&(v=q),ne>y&&(y=ne),ae<b&&(b=ae),pe>w&&(w=pe)});var F=p.x-(y+v)/2,G=p.y-(w+b)/2;Object.keys(g).forEach(function(W){var J=g[W];J.setCenter(J.getCenterX()+F,J.getCenterY()+G)})}}},f.calcBoundingBox=function(p,g,m,v){for(var y=Number.MAX_SAFE_INTEGER,b=Number.MIN_SAFE_INTEGER,w=Number.MAX_SAFE_INTEGER,T=Number.MIN_SAFE_INTEGER,E=void 0,L=void 0,S=void 0,C=void 0,A=p.descendants().not(":parent"),N=A.length,_=0;_<N;_++){var O=A[_];E=g[v.get(O.id())]-O.width()/2,L=g[v.get(O.id())]+O.width()/2,S=m[v.get(O.id())]-O.height()/2,C=m[v.get(O.id())]+O.height()/2,y>E&&(y=E),b<L&&(b=L),w>S&&(w=S),T<C&&(T=C)}var P={};return P.topLeftX=y,P.topLeftY=w,P.width=b-y,P.height=T-w,P},f.calcParentsWithoutChildren=function(p,g){var m=p.collection();return g.nodes(":parent").forEach(function(v){var y=!1;v.children().forEach(function(b){b.css("display")!="none"&&(y=!0)}),y||m.merge(v)}),m},o.exports=f},816:(o,l,u)=>{var h=u(548),d=u(140).CoSELayout,f=u(140).CoSENode,p=u(140).layoutBase.PointD,g=u(140).layoutBase.DimensionD,m=u(140).layoutBase.LayoutConstants,v=u(140).layoutBase.FDLayoutConstants,y=u(140).CoSEConstants,b=function(T,E){var L=T.cy,S=T.eles,C=S.nodes(),A=S.edges(),N=void 0,_=void 0,O=void 0,P={};T.randomize&&(N=E.nodeIndexes,_=E.xCoords,O=E.yCoords);var k=function(W){return typeof W=="function"},R=function(W,J){return k(W)?W(J):W},I=h.calcParentsWithoutChildren(L,S),M=function G(W,J,q,ne){for(var ae=J.length,pe=0;pe<ae;pe++){var K=J[pe],Z=null;K.intersection(I).length==0&&(Z=K.children());var X=void 0,Y=K.layoutDimensions({nodeDimensionsIncludeLabels:ne.nodeDimensionsIncludeLabels});if(K.outerWidth()!=null&&K.outerHeight()!=null)if(ne.randomize)if(!K.isParent())X=W.add(new f(q.graphManager,new p(_[N.get(K.id())]-Y.w/2,O[N.get(K.id())]-Y.h/2),new g(parseFloat(Y.w),parseFloat(Y.h))));else{var ee=h.calcBoundingBox(K,_,O,N);K.intersection(I).length==0?X=W.add(new f(q.graphManager,new p(ee.topLeftX,ee.topLeftY),new g(ee.width,ee.height))):X=W.add(new f(q.graphManager,new p(ee.topLeftX,ee.topLeftY),new g(parseFloat(Y.w),parseFloat(Y.h))))}else X=W.add(new f(q.graphManager,new p(K.position("x")-Y.w/2,K.position("y")-Y.h/2),new g(parseFloat(Y.w),parseFloat(Y.h))));else X=W.add(new f(this.graphManager));if(X.id=K.data("id"),X.nodeRepulsion=R(ne.nodeRepulsion,K),X.paddingLeft=parseInt(K.css("padding")),X.paddingTop=parseInt(K.css("padding")),X.paddingRight=parseInt(K.css("padding")),X.paddingBottom=parseInt(K.css("padding")),ne.nodeDimensionsIncludeLabels&&(X.labelWidth=K.boundingBox({includeLabels:!0,includeNodes:!1,includeOverlays:!1}).w,X.labelHeight=K.boundingBox({includeLabels:!0,includeNodes:!1,includeOverlays:!1}).h,X.labelPosVertical=K.css("text-valign"),X.labelPosHorizontal=K.css("text-halign")),P[K.data("id")]=X,isNaN(X.rect.x)&&(X.rect.x=0),isNaN(X.rect.y)&&(X.rect.y=0),Z!=null&&Z.length>0){var j=void 0;j=q.getGraphManager().add(q.newGraph(),X),G(j,Z,q,ne)}}},D=function(W,J,q){for(var ne=0,ae=0,pe=0;pe<q.length;pe++){var K=q[pe],Z=P[K.data("source")],X=P[K.data("target")];if(Z&&X&&Z!==X&&Z.getEdgesBetween(X).length==0){var Y=J.add(W.newEdge(),Z,X);Y.id=K.id(),Y.idealLength=R(T.idealEdgeLength,K),Y.edgeElasticity=R(T.edgeElasticity,K),ne+=Y.idealLength,ae++}}T.idealEdgeLength!=null&&(ae>0?y.DEFAULT_EDGE_LENGTH=v.DEFAULT_EDGE_LENGTH=ne/ae:k(T.idealEdgeLength)?y.DEFAULT_EDGE_LENGTH=v.DEFAULT_EDGE_LENGTH=50:y.DEFAULT_EDGE_LENGTH=v.DEFAULT_EDGE_LENGTH=T.idealEdgeLength,y.MIN_REPULSION_DIST=v.MIN_REPULSION_DIST=v.DEFAULT_EDGE_LENGTH/10,y.DEFAULT_RADIAL_SEPARATION=v.DEFAULT_EDGE_LENGTH)},B=function(W,J){J.fixedNodeConstraint&&(W.constraints.fixedNodeConstraint=J.fixedNodeConstraint),J.alignmentConstraint&&(W.constraints.alignmentConstraint=J.alignmentConstraint),J.relativePlacementConstraint&&(W.constraints.relativePlacementConstraint=J.relativePlacementConstraint)};T.nestingFactor!=null&&(y.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=v.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=T.nestingFactor),T.gravity!=null&&(y.DEFAULT_GRAVITY_STRENGTH=v.DEFAULT_GRAVITY_STRENGTH=T.gravity),T.numIter!=null&&(y.MAX_ITERATIONS=v.MAX_ITERATIONS=T.numIter),T.gravityRange!=null&&(y.DEFAULT_GRAVITY_RANGE_FACTOR=v.DEFAULT_GRAVITY_RANGE_FACTOR=T.gravityRange),T.gravityCompound!=null&&(y.DEFAULT_COMPOUND_GRAVITY_STRENGTH=v.DEFAULT_COMPOUND_GRAVITY_STRENGTH=T.gravityCompound),T.gravityRangeCompound!=null&&(y.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=v.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=T.gravityRangeCompound),T.initialEnergyOnIncremental!=null&&(y.DEFAULT_COOLING_FACTOR_INCREMENTAL=v.DEFAULT_COOLING_FACTOR_INCREMENTAL=T.initialEnergyOnIncremental),T.tilingCompareBy!=null&&(y.TILING_COMPARE_BY=T.tilingCompareBy),T.quality=="proof"?m.QUALITY=2:m.QUALITY=0,y.NODE_DIMENSIONS_INCLUDE_LABELS=v.NODE_DIMENSIONS_INCLUDE_LABELS=m.NODE_DIMENSIONS_INCLUDE_LABELS=T.nodeDimensionsIncludeLabels,y.DEFAULT_INCREMENTAL=v.DEFAULT_INCREMENTAL=m.DEFAULT_INCREMENTAL=!T.randomize,y.ANIMATE=v.ANIMATE=m.ANIMATE=T.animate,y.TILE=T.tile,y.TILING_PADDING_VERTICAL=typeof T.tilingPaddingVertical=="function"?T.tilingPaddingVertical.call():T.tilingPaddingVertical,y.TILING_PADDING_HORIZONTAL=typeof T.tilingPaddingHorizontal=="function"?T.tilingPaddingHorizontal.call():T.tilingPaddingHorizontal,y.DEFAULT_INCREMENTAL=v.DEFAULT_INCREMENTAL=m.DEFAULT_INCREMENTAL=!0,y.PURE_INCREMENTAL=!T.randomize,m.DEFAULT_UNIFORM_LEAF_NODE_SIZES=T.uniformNodeDimensions,T.step=="transformed"&&(y.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,y.ENFORCE_CONSTRAINTS=!1,y.APPLY_LAYOUT=!1),T.step=="enforced"&&(y.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,y.ENFORCE_CONSTRAINTS=!0,y.APPLY_LAYOUT=!1),T.step=="cose"&&(y.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,y.ENFORCE_CONSTRAINTS=!1,y.APPLY_LAYOUT=!0),T.step=="all"&&(T.randomize?y.TRANSFORM_ON_CONSTRAINT_HANDLING=!0:y.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,y.ENFORCE_CONSTRAINTS=!0,y.APPLY_LAYOUT=!0),T.fixedNodeConstraint||T.alignmentConstraint||T.relativePlacementConstraint?y.TREE_REDUCTION_ON_INCREMENTAL=!1:y.TREE_REDUCTION_ON_INCREMENTAL=!0;var $=new d,F=$.newGraphManager();return M(F.addRoot(),h.getTopMostNodes(C),$,T),D($,F,A),B($,T),$.runLayout(),P};o.exports={coseLayout:b}},212:(o,l,u)=>{var h=function(){function T(E,L){for(var S=0;S<L.length;S++){var C=L[S];C.enumerable=C.enumerable||!1,C.configurable=!0,"value"in C&&(C.writable=!0),Object.defineProperty(E,C.key,C)}}return function(E,L,S){return L&&T(E.prototype,L),S&&T(E,S),E}}();function d(T,E){if(!(T instanceof E))throw new TypeError("Cannot call a class as a function")}var f=u(658),p=u(548),g=u(657),m=g.spectralLayout,v=u(816),y=v.coseLayout,b=Object.freeze({quality:"default",randomize:!0,animate:!0,animationDuration:1e3,animationEasing:void 0,fit:!0,padding:30,nodeDimensionsIncludeLabels:!1,uniformNodeDimensions:!1,packComponents:!0,step:"all",samplingType:!0,sampleSize:25,nodeSeparation:75,piTol:1e-7,nodeRepulsion:function(E){return 4500},idealEdgeLength:function(E){return 50},edgeElasticity:function(E){return .45},nestingFactor:.1,gravity:.25,numIter:2500,tile:!0,tilingCompareBy:void 0,tilingPaddingVertical:10,tilingPaddingHorizontal:10,gravityRangeCompound:1.5,gravityCompound:1,gravityRange:3.8,initialEnergyOnIncremental:.3,fixedNodeConstraint:void 0,alignmentConstraint:void 0,relativePlacementConstraint:void 0,ready:function(){},stop:function(){}}),w=function(){function T(E){d(this,T),this.options=f({},b,E)}return h(T,[{key:"run",value:function(){var L=this,S=this.options,C=S.cy,A=S.eles,N=[],_=[],O=void 0,P=[];S.fixedNodeConstraint&&(!Array.isArray(S.fixedNodeConstraint)||S.fixedNodeConstraint.length==0)&&(S.fixedNodeConstraint=void 0),S.alignmentConstraint&&(S.alignmentConstraint.vertical&&(!Array.isArray(S.alignmentConstraint.vertical)||S.alignmentConstraint.vertical.length==0)&&(S.alignmentConstraint.vertical=void 0),S.alignmentConstraint.horizontal&&(!Array.isArray(S.alignmentConstraint.horizontal)||S.alignmentConstraint.horizontal.length==0)&&(S.alignmentConstraint.horizontal=void 0)),S.relativePlacementConstraint&&(!Array.isArray(S.relativePlacementConstraint)||S.relativePlacementConstraint.length==0)&&(S.relativePlacementConstraint=void 0);var k=S.fixedNodeConstraint||S.alignmentConstraint||S.relativePlacementConstraint;k&&(S.tile=!1,S.packComponents=!1);var R=void 0,I=!1;if(C.layoutUtilities&&S.packComponents&&(R=C.layoutUtilities("get"),R||(R=C.layoutUtilities()),I=!0),A.nodes().length>0)if(I){var B=p.getTopMostNodes(S.eles.nodes());if(O=p.connectComponents(C,S.eles,B),O.forEach(function(Ae){var H=Ae.boundingBox();P.push({x:H.x1+H.w/2,y:H.y1+H.h/2})}),S.randomize&&O.forEach(function(Ae){S.eles=Ae,N.push(m(S))}),S.quality=="default"||S.quality=="proof"){var $=C.collection();if(S.tile){var F=new Map,G=[],W=[],J=0,q={nodeIndexes:F,xCoords:G,yCoords:W},ne=[];if(O.forEach(function(Ae,H){Ae.edges().length==0&&(Ae.nodes().forEach(function(Oe,ue){$.merge(Ae.nodes()[ue]),Oe.isParent()||(q.nodeIndexes.set(Ae.nodes()[ue].id(),J++),q.xCoords.push(Ae.nodes()[0].position().x),q.yCoords.push(Ae.nodes()[0].position().y))}),ne.push(H))}),$.length>1){var ae=$.boundingBox();P.push({x:ae.x1+ae.w/2,y:ae.y1+ae.h/2}),O.push($),N.push(q);for(var pe=ne.length-1;pe>=0;pe--)O.splice(ne[pe],1),N.splice(ne[pe],1),P.splice(ne[pe],1)}}O.forEach(function(Ae,H){S.eles=Ae,_.push(y(S,N[H])),p.relocateComponent(P[H],_[H],S)})}else O.forEach(function(Ae,H){p.relocateComponent(P[H],N[H],S)});var K=new Set;if(O.length>1){var Z=[],X=A.filter(function(Ae){return Ae.css("display")=="none"});O.forEach(function(Ae,H){var Oe=void 0;if(S.quality=="draft"&&(Oe=N[H].nodeIndexes),Ae.nodes().not(X).length>0){var ue={};ue.edges=[],ue.nodes=[];var Ve=void 0;Ae.nodes().not(X).forEach(function(Ge){if(S.quality=="draft")if(!Ge.isParent())Ve=Oe.get(Ge.id()),ue.nodes.push({x:N[H].xCoords[Ve]-Ge.boundingbox().w/2,y:N[H].yCoords[Ve]-Ge.boundingbox().h/2,width:Ge.boundingbox().w,height:Ge.boundingbox().h});else{var Ue=p.calcBoundingBox(Ge,N[H].xCoords,N[H].yCoords,Oe);ue.nodes.push({x:Ue.topLeftX,y:Ue.topLeftY,width:Ue.width,height:Ue.height})}else _[H][Ge.id()]&&ue.nodes.push({x:_[H][Ge.id()].getLeft(),y:_[H][Ge.id()].getTop(),width:_[H][Ge.id()].getWidth(),height:_[H][Ge.id()].getHeight()})}),Ae.edges().forEach(function(Ge){var Ue=Ge.source(),ke=Ge.target();if(Ue.css("display")!="none"&&ke.css("display")!="none")if(S.quality=="draft"){var Pe=Oe.get(Ue.id()),Se=Oe.get(ke.id()),_e=[],ze=[];if(Ue.isParent()){var me=p.calcBoundingBox(Ue,N[H].xCoords,N[H].yCoords,Oe);_e.push(me.topLeftX+me.width/2),_e.push(me.topLeftY+me.height/2)}else _e.push(N[H].xCoords[Pe]),_e.push(N[H].yCoords[Pe]);if(ke.isParent()){var De=p.calcBoundingBox(ke,N[H].xCoords,N[H].yCoords,Oe);ze.push(De.topLeftX+De.width/2),ze.push(De.topLeftY+De.height/2)}else ze.push(N[H].xCoords[Se]),ze.push(N[H].yCoords[Se]);ue.edges.push({startX:_e[0],startY:_e[1],endX:ze[0],endY:ze[1]})}else _[H][Ue.id()]&&_[H][ke.id()]&&ue.edges.push({startX:_[H][Ue.id()].getCenterX(),startY:_[H][Ue.id()].getCenterY(),endX:_[H][ke.id()].getCenterX(),endY:_[H][ke.id()].getCenterY()})}),ue.nodes.length>0&&(Z.push(ue),K.add(H))}});var Y=R.packComponents(Z,S.randomize).shifts;if(S.quality=="draft")N.forEach(function(Ae,H){var Oe=Ae.xCoords.map(function(Ve){return Ve+Y[H].dx}),ue=Ae.yCoords.map(function(Ve){return Ve+Y[H].dy});Ae.xCoords=Oe,Ae.yCoords=ue});else{var ee=0;K.forEach(function(Ae){Object.keys(_[Ae]).forEach(function(H){var Oe=_[Ae][H];Oe.setCenter(Oe.getCenterX()+Y[ee].dx,Oe.getCenterY()+Y[ee].dy)}),ee++})}}}else{var M=S.eles.boundingBox();if(P.push({x:M.x1+M.w/2,y:M.y1+M.h/2}),S.randomize){var D=m(S);N.push(D)}S.quality=="default"||S.quality=="proof"?(_.push(y(S,N[0])),p.relocateComponent(P[0],_[0],S)):p.relocateComponent(P[0],N[0],S)}var j=function(H,Oe){if(S.quality=="default"||S.quality=="proof"){typeof H=="number"&&(H=Oe);var ue=void 0,Ve=void 0,Ge=H.data("id");return _.forEach(function(ke){Ge in ke&&(ue={x:ke[Ge].getRect().getCenterX(),y:ke[Ge].getRect().getCenterY()},Ve=ke[Ge])}),S.nodeDimensionsIncludeLabels&&(Ve.labelWidth&&(Ve.labelPosHorizontal=="left"?ue.x+=Ve.labelWidth/2:Ve.labelPosHorizontal=="right"&&(ue.x-=Ve.labelWidth/2)),Ve.labelHeight&&(Ve.labelPosVertical=="top"?ue.y+=Ve.labelHeight/2:Ve.labelPosVertical=="bottom"&&(ue.y-=Ve.labelHeight/2))),ue==null&&(ue={x:H.position("x"),y:H.position("y")}),{x:ue.x,y:ue.y}}else{var Ue=void 0;return N.forEach(function(ke){var Pe=ke.nodeIndexes.get(H.id());Pe!=null&&(Ue={x:ke.xCoords[Pe],y:ke.yCoords[Pe]})}),Ue==null&&(Ue={x:H.position("x"),y:H.position("y")}),{x:Ue.x,y:Ue.y}}};if(S.quality=="default"||S.quality=="proof"||S.randomize){var fe=p.calcParentsWithoutChildren(C,A),te=A.filter(function(Ae){return Ae.css("display")=="none"});S.eles=A.not(te),A.nodes().not(":parent").not(te).layoutPositions(L,S,j),fe.length>0&&fe.forEach(function(Ae){Ae.position(j(Ae))})}else console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'.")}}]),T}();o.exports=w},657:(o,l,u)=>{var h=u(548),d=u(140).layoutBase.Matrix,f=u(140).layoutBase.SVD,p=function(m){var v=m.cy,y=m.eles,b=y.nodes(),w=y.nodes(":parent"),T=new Map,E=new Map,L=new Map,S=[],C=[],A=[],N=[],_=[],O=[],P=[],k=[],R=void 0,I=1e8,M=1e-9,D=m.piTol,B=m.samplingType,$=m.nodeSeparation,F=void 0,G=function(){for(var z=0,oe=0,se=!1;oe<F;){z=Math.floor(Math.random()*R),se=!1;for(var ge=0;ge<oe;ge++)if(N[ge]==z){se=!0;break}if(!se)N[oe]=z,oe++;else continue}},W=function(z,oe,se){for(var ge=[],he=0,be=0,Ce=0,Te=void 0,Ne=[],Xe=0,Ye=1,Ke=0;Ke<R;Ke++)Ne[Ke]=I;for(ge[be]=z,Ne[z]=0;be>=he;){Ce=ge[he++];for(var Ze=S[Ce],Be=0;Be<Ze.length;Be++)Te=E.get(Ze[Be]),Ne[Te]==I&&(Ne[Te]=Ne[Ce]+1,ge[++be]=Te);O[Ce][oe]=Ne[Ce]*$}if(se){for(var He=0;He<R;He++)O[He][oe]<_[He]&&(_[He]=O[He][oe]);for(var ht=0;ht<R;ht++)_[ht]>Xe&&(Xe=_[ht],Ye=ht)}return Ye},J=function(z){var oe=void 0;if(z){oe=Math.floor(Math.random()*R);for(var ge=0;ge<R;ge++)_[ge]=I;for(var he=0;he<F;he++)N[he]=oe,oe=W(oe,he,z)}else{G();for(var se=0;se<F;se++)W(N[se],se,z)}for(var be=0;be<R;be++)for(var Ce=0;Ce<F;Ce++)O[be][Ce]*=O[be][Ce];for(var Te=0;Te<F;Te++)P[Te]=[];for(var Ne=0;Ne<F;Ne++)for(var Xe=0;Xe<F;Xe++)P[Ne][Xe]=O[N[Xe]][Ne]},q=function(){for(var z=f.svd(P),oe=z.S,se=z.U,ge=z.V,he=oe[0]*oe[0]*oe[0],be=[],Ce=0;Ce<F;Ce++){be[Ce]=[];for(var Te=0;Te<F;Te++)be[Ce][Te]=0,Ce==Te&&(be[Ce][Te]=oe[Ce]/(oe[Ce]*oe[Ce]+he/(oe[Ce]*oe[Ce])))}k=d.multMat(d.multMat(ge,be),d.transpose(se))},ne=function(){for(var z=void 0,oe=void 0,se=[],ge=[],he=[],be=[],Ce=0;Ce<R;Ce++)se[Ce]=Math.random(),ge[Ce]=Math.random();se=d.normalize(se),ge=d.normalize(ge);for(var Te=M,Ne=M,Xe=void 0;;){for(var Ye=0;Ye<R;Ye++)he[Ye]=se[Ye];if(se=d.multGamma(d.multL(d.multGamma(he),O,k)),z=d.dotProduct(he,se),se=d.normalize(se),Te=d.dotProduct(he,se),Xe=Math.abs(Te/Ne),Xe<=1+D&&Xe>=1)break;Ne=Te}for(var Ke=0;Ke<R;Ke++)he[Ke]=se[Ke];for(Ne=M;;){for(var Ze=0;Ze<R;Ze++)be[Ze]=ge[Ze];if(be=d.minusOp(be,d.multCons(he,d.dotProduct(he,be))),ge=d.multGamma(d.multL(d.multGamma(be),O,k)),oe=d.dotProduct(be,ge),ge=d.normalize(ge),Te=d.dotProduct(be,ge),Xe=Math.abs(Te/Ne),Xe<=1+D&&Xe>=1)break;Ne=Te}for(var Be=0;Be<R;Be++)be[Be]=ge[Be];C=d.multCons(he,Math.sqrt(Math.abs(z))),A=d.multCons(be,Math.sqrt(Math.abs(oe)))};h.connectComponents(v,y,h.getTopMostNodes(b),T),w.forEach(function(ce){h.connectComponents(v,y,h.getTopMostNodes(ce.descendants().intersection(y)),T)});for(var ae=0,pe=0;pe<b.length;pe++)b[pe].isParent()||E.set(b[pe].id(),ae++);var K=!0,Z=!1,X=void 0;try{for(var Y=T.keys()[Symbol.iterator](),ee;!(K=(ee=Y.next()).done);K=!0){var j=ee.value;E.set(j,ae++)}}catch(ce){Z=!0,X=ce}finally{try{!K&&Y.return&&Y.return()}finally{if(Z)throw X}}for(var fe=0;fe<E.size;fe++)S[fe]=[];w.forEach(function(ce){for(var z=ce.children().intersection(y);z.nodes(":childless").length==0;)z=z.nodes()[0].children().intersection(y);var oe=0,se=z.nodes(":childless")[0].connectedEdges().length;z.nodes(":childless").forEach(function(ge,he){ge.connectedEdges().length<se&&(se=ge.connectedEdges().length,oe=he)}),L.set(ce.id(),z.nodes(":childless")[oe].id())}),b.forEach(function(ce){var z=void 0;ce.isParent()?z=E.get(L.get(ce.id())):z=E.get(ce.id()),ce.neighborhood().nodes().forEach(function(oe){y.intersection(ce.edgesWith(oe)).length>0&&(oe.isParent()?S[z].push(L.get(oe.id())):S[z].push(oe.id()))})});var te=function(z){var oe=E.get(z),se=void 0;T.get(z).forEach(function(ge){v.getElementById(ge).isParent()?se=L.get(ge):se=ge,S[oe].push(se),S[E.get(se)].push(z)})},Ae=!0,H=!1,Oe=void 0;try{for(var ue=T.keys()[Symbol.iterator](),Ve;!(Ae=(Ve=ue.next()).done);Ae=!0){var Ge=Ve.value;te(Ge)}}catch(ce){H=!0,Oe=ce}finally{try{!Ae&&ue.return&&ue.return()}finally{if(H)throw Oe}}R=E.size;var Ue=void 0;if(R>2){F=R<m.sampleSize?R:m.sampleSize;for(var ke=0;ke<R;ke++)O[ke]=[];for(var Pe=0;Pe<F;Pe++)k[Pe]=[];return m.quality=="draft"||m.step=="all"?(J(B),q(),ne(),Ue={nodeIndexes:E,xCoords:C,yCoords:A}):(E.forEach(function(ce,z){C.push(v.getElementById(z).position("x")),A.push(v.getElementById(z).position("y"))}),Ue={nodeIndexes:E,xCoords:C,yCoords:A}),Ue}else{var Se=E.keys(),_e=v.getElementById(Se.next().value),ze=_e.position(),me=_e.outerWidth();if(C.push(ze.x),A.push(ze.y),R==2){var De=v.getElementById(Se.next().value),Q=De.outerWidth();C.push(ze.x+me/2+Q/2+m.idealEdgeLength),A.push(ze.y)}return Ue={nodeIndexes:E,xCoords:C,yCoords:A},Ue}};o.exports={spectralLayout:p}},579:(o,l,u)=>{var h=u(212),d=function(p){p&&p("layout","fcose",h)};typeof cytoscape<"u"&&d(cytoscape),o.exports=d},140:o=>{o.exports=r}},i={};function a(o){var l=i[o];if(l!==void 0)return l.exports;var u=i[o]={exports:{}};return n[o](u,u.exports,a),u.exports}var s=a(579);return s})()})})(Iq);var RRe=Iq.exports;const NRe=yd(RRe);var aN={L:"left",R:"right",T:"top",B:"bottom"},sN={L:x(t=>`${t},${t/2} 0,${t} 0,0`,"L"),R:x(t=>`0,${t/2} ${t},0 ${t},${t}`,"R"),T:x(t=>`0,0 ${t},0 ${t/2},${t}`,"T"),B:x(t=>`${t/2},0 ${t},${t} 0,${t}`,"B")},I1={L:x((t,e)=>t-e+2,"L"),R:x((t,e)=>t-2,"R"),T:x((t,e)=>t-e+2,"T"),B:x((t,e)=>t-2,"B")},DRe=x(function(t){return Pi(t)?t==="L"?"R":"L":t==="T"?"B":"T"},"getOppositeArchitectureDirection"),oN=x(function(t){const e=t;return e==="L"||e==="R"||e==="T"||e==="B"},"isArchitectureDirection"),Pi=x(function(t){const e=t;return e==="L"||e==="R"},"isArchitectureDirectionX"),Jl=x(function(t){const e=t;return e==="T"||e==="B"},"isArchitectureDirectionY"),ES=x(function(t,e){const r=Pi(t)&&Jl(e),n=Jl(t)&&Pi(e);return r||n},"isArchitectureDirectionXY"),MRe=x(function(t){const e=t[0],r=t[1],n=Pi(e)&&Jl(r),i=Jl(e)&&Pi(r);return n||i},"isArchitecturePairXY"),IRe=x(function(t){return t!=="LL"&&t!=="RR"&&t!=="TT"&&t!=="BB"},"isValidArchitectureDirectionPair"),qT=x(function(t,e){const r=`${t}${e}`;return IRe(r)?r:void 0},"getArchitectureDirectionPair"),ORe=x(function([t,e],r){const n=r[0],i=r[1];return Pi(n)?Jl(i)?[t+(n==="L"?-1:1),e+(i==="T"?1:-1)]:[t+(n==="L"?-1:1),e]:Pi(i)?[t+(i==="L"?1:-1),e+(n==="T"?1:-1)]:[t,e+(n==="T"?1:-1)]},"shiftPositionByArchitectureDirectionPair"),PRe=x(function(t){return t==="LT"||t==="TL"?[1,1]:t==="BL"||t==="LB"?[1,-1]:t==="BR"||t==="RB"?[-1,-1]:[-1,1]},"getArchitectureDirectionXYFactors"),BRe=x(function(t,e){return ES(t,e)?"bend":Pi(t)?"horizontal":"vertical"},"getArchitectureDirectionAlignment"),FRe=x(function(t){return t.type==="service"},"isArchitectureService"),$Re=x(function(t){return t.type==="junction"},"isArchitectureJunction"),Oq=x(t=>t.data(),"edgeData"),Eh=x(t=>t.data(),"nodeData"),zRe=hr.architecture,Pq=class{constructor(){this.nodes={},this.groups={},this.edges=[],this.registeredIds={},this.elements={},this.setAccTitle=Sn,this.getAccTitle=zn,this.setDiagramTitle=Zn,this.getDiagramTitle=_n,this.getAccDescription=Gn,this.setAccDescription=Vn,this.clear()}static{x(this,"ArchitectureDB")}clear(){this.nodes={},this.groups={},this.edges=[],this.registeredIds={},this.dataStructures=void 0,this.elements={},An()}addService({id:t,icon:e,in:r,title:n,iconText:i}){if(this.registeredIds[t]!==void 0)throw new Error(`The service id [${t}] is already in use by another ${this.registeredIds[t]}`);if(r!==void 0){if(t===r)throw new Error(`The service [${t}] cannot be placed within itself`);if(this.registeredIds[r]===void 0)throw new Error(`The service [${t}]'s parent does not exist. Please make sure the parent is created before this service`);if(this.registeredIds[r]==="node")throw new Error(`The service [${t}]'s parent is not a group`)}this.registeredIds[t]="node",this.nodes[t]={id:t,type:"service",icon:e,iconText:i,title:n,edges:[],in:r}}getServices(){return Object.values(this.nodes).filter(FRe)}addJunction({id:t,in:e}){this.registeredIds[t]="node",this.nodes[t]={id:t,type:"junction",edges:[],in:e}}getJunctions(){return Object.values(this.nodes).filter($Re)}getNodes(){return Object.values(this.nodes)}getNode(t){return this.nodes[t]??null}addGroup({id:t,icon:e,in:r,title:n}){if(this.registeredIds?.[t]!==void 0)throw new Error(`The group id [${t}] is already in use by another ${this.registeredIds[t]}`);if(r!==void 0){if(t===r)throw new Error(`The group [${t}] cannot be placed within itself`);if(this.registeredIds?.[r]===void 0)throw new Error(`The group [${t}]'s parent does not exist. Please make sure the parent is created before this group`);if(this.registeredIds?.[r]==="node")throw new Error(`The group [${t}]'s parent is not a group`)}this.registeredIds[t]="group",this.groups[t]={id:t,icon:e,title:n,in:r}}getGroups(){return Object.values(this.groups)}addEdge({lhsId:t,rhsId:e,lhsDir:r,rhsDir:n,lhsInto:i,rhsInto:a,lhsGroup:s,rhsGroup:o,title:l}){if(!oN(r))throw new Error(`Invalid direction given for left hand side of edge ${t}--${e}. Expected (L,R,T,B) got ${String(r)}`);if(!oN(n))throw new Error(`Invalid direction given for right hand side of edge ${t}--${e}. Expected (L,R,T,B) got ${String(n)}`);if(this.nodes[t]===void 0&&this.groups[t]===void 0)throw new Error(`The left-hand id [${t}] does not yet exist. Please create the service/group before declaring an edge to it.`);if(this.nodes[e]===void 0&&this.groups[e]===void 0)throw new Error(`The right-hand id [${e}] does not yet exist. Please create the service/group before declaring an edge to it.`);const u=this.nodes[t].in,h=this.nodes[e].in;if(s&&u&&h&&u==h)throw new Error(`The left-hand id [${t}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);if(o&&u&&h&&u==h)throw new Error(`The right-hand id [${e}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);const d={lhsId:t,lhsDir:r,lhsInto:i,lhsGroup:s,rhsId:e,rhsDir:n,rhsInto:a,rhsGroup:o,title:l};this.edges.push(d),this.nodes[t]&&this.nodes[e]&&(this.nodes[t].edges.push(this.edges[this.edges.length-1]),this.nodes[e].edges.push(this.edges[this.edges.length-1]))}getEdges(){return this.edges}getDataStructures(){if(this.dataStructures===void 0){const t={},e=Object.entries(this.nodes).reduce((o,[l,u])=>(o[l]=u.edges.reduce((h,d)=>{const f=this.getNode(d.lhsId)?.in,p=this.getNode(d.rhsId)?.in;if(f&&p&&f!==p){const g=BRe(d.lhsDir,d.rhsDir);g!=="bend"&&(t[f]??={},t[f][p]=g,t[p]??={},t[p][f]=g)}if(d.lhsId===l){const g=qT(d.lhsDir,d.rhsDir);g&&(h[g]=d.rhsId)}else{const g=qT(d.rhsDir,d.lhsDir);g&&(h[g]=d.lhsId)}return h},{}),o),{}),r=Object.keys(e)[0],n={[r]:1},i=Object.keys(e).reduce((o,l)=>l===r?o:{...o,[l]:1},{}),a=x(o=>{const l={[o]:[0,0]},u=[o];for(;u.length>0;){const h=u.shift();if(h){n[h]=1,delete i[h];const d=e[h],[f,p]=l[h];Object.entries(d).forEach(([g,m])=>{n[m]||(l[m]=ORe([f,p],g),u.push(m))})}}return l},"BFS"),s=[a(r)];for(;Object.keys(i).length>0;)s.push(a(Object.keys(i)[0]));this.dataStructures={adjList:e,spatialMaps:s,groupAlignments:t}}return this.dataStructures}setElementForId(t,e){this.elements[t]=e}getElementById(t){return this.elements[t]}getConfig(){return Hi({...zRe,...gr().architecture})}getConfigField(t){return this.getConfig()[t]}},VRe=x((t,e)=>{Fu(t,e),t.groups.map(r=>e.addGroup(r)),t.services.map(r=>e.addService({...r,type:"service"})),t.junctions.map(r=>e.addJunction({...r,type:"junction"})),t.edges.map(r=>e.addEdge(r))},"populateDb"),Bq={parser:{yy:void 0},parse:x(async t=>{const e=await vc("architecture",t);ie.debug(e);const r=Bq.parser?.yy;if(!(r instanceof Pq))throw new Error("parser.parser?.yy was not a ArchitectureDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");VRe(e,r)},"parse")},GRe=x(t=>`
  .edge {
    stroke-width: ${t.archEdgeWidth};
    stroke: ${t.archEdgeColor};
    fill: none;
  }

  .arrow {
    fill: ${t.archEdgeArrowColor};
  }

  .node-bkg {
    fill: none;
    stroke: ${t.archGroupBorderColor};
    stroke-width: ${t.archGroupBorderWidth};
    stroke-dasharray: 8;
  }
  .node-icon-text {
    display: flex; 
    align-items: center;
  }
  
  .node-icon-text > div {
    color: #fff;
    margin: 1px;
    height: fit-content;
    text-align: center;
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
  }
`,"getStyles"),URe=GRe,sh=x(t=>`<g><rect width="80" height="80" style="fill: #087ebf; stroke-width: 0px;"/>${t}</g>`,"wrapIcon"),Sp={prefix:"mermaid-architecture",height:80,width:80,icons:{database:{body:sh('<path id="b" data-name="4" d="m20,57.86c0,3.94,8.95,7.14,20,7.14s20-3.2,20-7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path id="c" data-name="3" d="m20,45.95c0,3.94,8.95,7.14,20,7.14s20-3.2,20-7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path id="d" data-name="2" d="m20,34.05c0,3.94,8.95,7.14,20,7.14s20-3.2,20-7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse id="e" data-name="1" cx="40" cy="22.14" rx="20" ry="7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="20" y1="57.86" x2="20" y2="22.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="60" y1="57.86" x2="60" y2="22.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/>')},server:{body:sh('<rect x="17.5" y="17.5" width="45" height="45" rx="2" ry="2" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="17.5" y1="32.5" x2="62.5" y2="32.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="17.5" y1="47.5" x2="62.5" y2="47.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><g><path d="m56.25,25c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: #fff; stroke-width: 0px;"/><path d="m56.25,25c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10;"/></g><g><path d="m56.25,40c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: #fff; stroke-width: 0px;"/><path d="m56.25,40c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10;"/></g><g><path d="m56.25,55c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: #fff; stroke-width: 0px;"/><path d="m56.25,55c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10;"/></g><g><circle cx="32.5" cy="25" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="27.5" cy="25" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="22.5" cy="25" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/></g><g><circle cx="32.5" cy="40" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="27.5" cy="40" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="22.5" cy="40" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/></g><g><circle cx="32.5" cy="55" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="27.5" cy="55" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="22.5" cy="55" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/></g>')},disk:{body:sh('<rect x="20" y="15" width="40" height="50" rx="1" ry="1" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="24" cy="19.17" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="56" cy="19.17" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="24" cy="60.83" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="56" cy="60.83" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="40" cy="33.75" rx="14" ry="14.58" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="40" cy="33.75" rx="4" ry="4.17" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path d="m37.51,42.52l-4.83,13.22c-.26.71-1.1,1.02-1.76.64l-4.18-2.42c-.66-.38-.81-1.26-.33-1.84l9.01-10.8c.88-1.05,2.56-.08,2.09,1.2Z" style="fill: #fff; stroke-width: 0px;"/>')},internet:{body:sh('<circle cx="40" cy="40" r="22.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="40" y1="17.5" x2="40" y2="62.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="17.5" y1="40" x2="62.5" y2="40" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path d="m39.99,17.51c-15.28,11.1-15.28,33.88,0,44.98" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path d="m40.01,17.51c15.28,11.1,15.28,33.88,0,44.98" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="19.75" y1="30.1" x2="60.25" y2="30.1" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="19.75" y1="49.9" x2="60.25" y2="49.9" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/>')},cloud:{body:sh('<path d="m65,47.5c0,2.76-2.24,5-5,5H20c-2.76,0-5-2.24-5-5,0-1.87,1.03-3.51,2.56-4.36-.04-.21-.06-.42-.06-.64,0-2.6,2.48-4.74,5.65-4.97,1.65-4.51,6.34-7.76,11.85-7.76.86,0,1.69.08,2.5.23,2.09-1.57,4.69-2.5,7.5-2.5,6.1,0,11.19,4.38,12.28,10.17,2.14.56,3.72,2.51,3.72,4.83,0,.03,0,.07-.01.1,2.29.46,4.01,2.48,4.01,4.9Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/>')},unknown:yO,blank:{body:sh("")}}},WRe=x(async function(t,e,r){const n=r.getConfigField("padding"),i=r.getConfigField("iconSize"),a=i/2,s=i/6,o=s/2;await Promise.all(e.edges().map(async l=>{const{source:u,sourceDir:h,sourceArrow:d,sourceGroup:f,target:p,targetDir:g,targetArrow:m,targetGroup:v,label:y}=Oq(l);let{x:b,y:w}=l[0].sourceEndpoint();const{x:T,y:E}=l[0].midpoint();let{x:L,y:S}=l[0].targetEndpoint();const C=n+4;if(f&&(Pi(h)?b+=h==="L"?-C:C:w+=h==="T"?-C:C+18),v&&(Pi(g)?L+=g==="L"?-C:C:S+=g==="T"?-C:C+18),!f&&r.getNode(u)?.type==="junction"&&(Pi(h)?b+=h==="L"?a:-a:w+=h==="T"?a:-a),!v&&r.getNode(p)?.type==="junction"&&(Pi(g)?L+=g==="L"?a:-a:S+=g==="T"?a:-a),l[0]._private.rscratch){const A=t.insert("g");if(A.insert("path").attr("d",`M ${b},${w} L ${T},${E} L${L},${S} `).attr("class","edge").attr("id",_h(u,p,{prefix:"L"})),d){const N=Pi(h)?I1[h](b,s):b-o,_=Jl(h)?I1[h](w,s):w-o;A.insert("polygon").attr("points",sN[h](s)).attr("transform",`translate(${N},${_})`).attr("class","arrow")}if(m){const N=Pi(g)?I1[g](L,s):L-o,_=Jl(g)?I1[g](S,s):S-o;A.insert("polygon").attr("points",sN[g](s)).attr("transform",`translate(${N},${_})`).attr("class","arrow")}if(y){const N=ES(h,g)?"XY":Pi(h)?"X":"Y";let _=0;N==="X"?_=Math.abs(b-L):N==="Y"?_=Math.abs(w-S)/1.5:_=Math.abs(b-L)/2;const O=A.append("g");if(await Ra(O,y,{useHtmlLabels:!1,width:_,classes:"architecture-service-label"},we()),O.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),N==="X")O.attr("transform","translate("+T+", "+E+")");else if(N==="Y")O.attr("transform","translate("+T+", "+E+") rotate(-90)");else if(N==="XY"){const P=qT(h,g);if(P&&MRe(P)){const k=O.node().getBoundingClientRect(),[R,I]=PRe(P);O.attr("dominant-baseline","auto").attr("transform",`rotate(${-1*R*I*45})`);const M=O.node().getBoundingClientRect();O.attr("transform",`
                translate(${T}, ${E-k.height/2})
                translate(${R*M.width/2}, ${I*M.height/2})
                rotate(${-1*R*I*45}, 0, ${k.height/2})
              `)}}}}}))},"drawEdges"),HRe=x(async function(t,e,r){const i=r.getConfigField("padding")*.75,a=r.getConfigField("fontSize"),o=r.getConfigField("iconSize")/2;await Promise.all(e.nodes().map(async l=>{const u=Eh(l);if(u.type==="group"){const{h,w:d,x1:f,y1:p}=l.boundingBox(),g=t.append("rect");g.attr("id",`group-${u.id}`).attr("x",f+o).attr("y",p+o).attr("width",d).attr("height",h).attr("class","node-bkg");const m=t.append("g");let v=f,y=p;if(u.icon){const b=m.append("g");b.html(`<g>${await Ol(u.icon,{height:i,width:i,fallbackPrefix:Sp.prefix})}</g>`),b.attr("transform","translate("+(v+o+1)+", "+(y+o+1)+")"),v+=i,y+=a/2-1-2}if(u.label){const b=m.append("g");await Ra(b,u.label,{useHtmlLabels:!1,width:d,classes:"architecture-service-label"},we()),b.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","start").attr("text-anchor","start"),b.attr("transform","translate("+(v+o+4)+", "+(y+o+2)+")")}r.setElementForId(u.id,g)}}))},"drawGroups"),qRe=x(async function(t,e,r){const n=we();for(const i of r){const a=e.append("g"),s=t.getConfigField("iconSize");if(i.title){const h=a.append("g");await Ra(h,i.title,{useHtmlLabels:!1,width:s*1.5,classes:"architecture-service-label"},n),h.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),h.attr("transform","translate("+s/2+", "+s+")")}const o=a.append("g");if(i.icon)o.html(`<g>${await Ol(i.icon,{height:s,width:s,fallbackPrefix:Sp.prefix})}</g>`);else if(i.iconText){o.html(`<g>${await Ol("blank",{height:s,width:s,fallbackPrefix:Sp.prefix})}</g>`);const f=o.append("g").append("foreignObject").attr("width",s).attr("height",s).append("div").attr("class","node-icon-text").attr("style",`height: ${s}px;`).append("div").html(fr(i.iconText,n)),p=parseInt(window.getComputedStyle(f.node(),null).getPropertyValue("font-size").replace(/\D/g,""))??16;f.attr("style",`-webkit-line-clamp: ${Math.floor((s-2)/p)};`)}else o.append("path").attr("class","node-bkg").attr("id","node-"+i.id).attr("d",`M0 ${s} v${-s} q0,-5 5,-5 h${s} q5,0 5,5 v${s} H0 Z`);a.attr("id",`service-${i.id}`).attr("class","architecture-service");const{width:l,height:u}=a.node().getBBox();i.width=l,i.height=u,t.setElementForId(i.id,a)}return 0},"drawServices"),YRe=x(function(t,e,r){r.forEach(n=>{const i=e.append("g"),a=t.getConfigField("iconSize");i.append("g").append("rect").attr("id","node-"+n.id).attr("fill-opacity","0").attr("width",a).attr("height",a),i.attr("class","architecture-junction");const{width:o,height:l}=i._groups[0][0].getBBox();i.width=o,i.height=l,t.setElementForId(n.id,i)})},"drawJunctions");bO([{name:Sp.prefix,icons:Sp}]);Js.use(NRe);function Fq(t,e,r){t.forEach(n=>{e.add({group:"nodes",data:{type:"service",id:n.id,icon:n.icon,label:n.title,parent:n.in,width:r.getConfigField("iconSize"),height:r.getConfigField("iconSize")},classes:"node-service"})})}x(Fq,"addServices");function $q(t,e,r){t.forEach(n=>{e.add({group:"nodes",data:{type:"junction",id:n.id,parent:n.in,width:r.getConfigField("iconSize"),height:r.getConfigField("iconSize")},classes:"node-junction"})})}x($q,"addJunctions");function zq(t,e){e.nodes().map(r=>{const n=Eh(r);if(n.type==="group")return;n.x=r.position().x,n.y=r.position().y,t.getElementById(n.id).attr("transform","translate("+(n.x||0)+","+(n.y||0)+")")})}x(zq,"positionNodes");function Vq(t,e){t.forEach(r=>{e.add({group:"nodes",data:{type:"group",id:r.id,icon:r.icon,label:r.title,parent:r.in},classes:"node-group"})})}x(Vq,"addGroups");function Gq(t,e){t.forEach(r=>{const{lhsId:n,rhsId:i,lhsInto:a,lhsGroup:s,rhsInto:o,lhsDir:l,rhsDir:u,rhsGroup:h,title:d}=r,f=ES(r.lhsDir,r.rhsDir)?"segments":"straight",p={id:`${n}-${i}`,label:d,source:n,sourceDir:l,sourceArrow:a,sourceGroup:s,sourceEndpoint:l==="L"?"0 50%":l==="R"?"100% 50%":l==="T"?"50% 0":"50% 100%",target:i,targetDir:u,targetArrow:o,targetGroup:h,targetEndpoint:u==="L"?"0 50%":u==="R"?"100% 50%":u==="T"?"50% 0":"50% 100%"};e.add({group:"edges",data:p,classes:f})})}x(Gq,"addEdges");function Uq(t,e,r){const n=x((o,l)=>Object.entries(o).reduce((u,[h,d])=>{let f=0;const p=Object.entries(d);if(p.length===1)return u[h]=p[0][1],u;for(let g=0;g<p.length-1;g++)for(let m=g+1;m<p.length;m++){const[v,y]=p[g],[b,w]=p[m];if(r[v]?.[b]===l)u[h]??=[],u[h]=[...u[h],...y,...w];else if(v==="default"||b==="default")u[h]??=[],u[h]=[...u[h],...y,...w];else{const E=`${h}-${f++}`;u[E]=y;const L=`${h}-${f++}`;u[L]=w}}return u},{}),"flattenAlignments"),i=e.map(o=>{const l={},u={};return Object.entries(o).forEach(([h,[d,f]])=>{const p=t.getNode(h)?.in??"default";l[f]??={},l[f][p]??=[],l[f][p].push(h),u[d]??={},u[d][p]??=[],u[d][p].push(h)}),{horiz:Object.values(n(l,"horizontal")).filter(h=>h.length>1),vert:Object.values(n(u,"vertical")).filter(h=>h.length>1)}}),[a,s]=i.reduce(([o,l],{horiz:u,vert:h})=>[[...o,...u],[...l,...h]],[[],[]]);return{horizontal:a,vertical:s}}x(Uq,"getAlignments");function Wq(t,e){const r=[],n=x(a=>`${a[0]},${a[1]}`,"posToStr"),i=x(a=>a.split(",").map(s=>parseInt(s)),"strToPos");return t.forEach(a=>{const s=Object.fromEntries(Object.entries(a).map(([h,d])=>[n(d),h])),o=[n([0,0])],l={},u={L:[-1,0],R:[1,0],T:[0,1],B:[0,-1]};for(;o.length>0;){const h=o.shift();if(h){l[h]=1;const d=s[h];if(d){const f=i(h);Object.entries(u).forEach(([p,g])=>{const m=n([f[0]+g[0],f[1]+g[1]]),v=s[m];v&&!l[m]&&(o.push(m),r.push({[aN[p]]:v,[aN[DRe(p)]]:d,gap:1.5*e.getConfigField("iconSize")}))})}}}}),r}x(Wq,"getRelativeConstraints");function Hq(t,e,r,n,i,{spatialMaps:a,groupAlignments:s}){return new Promise(o=>{const l=Qe("body").append("div").attr("id","cy").attr("style","display:none"),u=Js({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"straight",label:"data(label)","source-endpoint":"data(sourceEndpoint)","target-endpoint":"data(targetEndpoint)"}},{selector:"edge.segments",style:{"curve-style":"segments","segment-weights":"0","segment-distances":[.5],"edge-distances":"endpoints","source-endpoint":"data(sourceEndpoint)","target-endpoint":"data(targetEndpoint)"}},{selector:"node",style:{"compound-sizing-wrt-labels":"include"}},{selector:"node[label]",style:{"text-valign":"bottom","text-halign":"center","font-size":`${i.getConfigField("fontSize")}px`}},{selector:".node-service",style:{label:"data(label)",width:"data(width)",height:"data(height)"}},{selector:".node-junction",style:{width:"data(width)",height:"data(height)"}},{selector:".node-group",style:{padding:`${i.getConfigField("padding")}px`}}],layout:{name:"grid",boundingBox:{x1:0,x2:100,y1:0,y2:100}}});l.remove(),Vq(r,u),Fq(t,u,i),$q(e,u,i),Gq(n,u);const h=Uq(i,a,s),d=Wq(a,i),f=u.layout({name:"fcose",quality:"proof",styleEnabled:!1,animate:!1,nodeDimensionsIncludeLabels:!1,idealEdgeLength(p){const[g,m]=p.connectedNodes(),{parent:v}=Eh(g),{parent:y}=Eh(m);return v===y?1.5*i.getConfigField("iconSize"):.5*i.getConfigField("iconSize")},edgeElasticity(p){const[g,m]=p.connectedNodes(),{parent:v}=Eh(g),{parent:y}=Eh(m);return v===y?.45:.001},alignmentConstraint:h,relativePlacementConstraint:d});f.one("layoutstop",()=>{function p(g,m,v,y){let b,w;const{x:T,y:E}=g,{x:L,y:S}=m;w=(y-E+(T-v)*(E-S)/(T-L))/Math.sqrt(1+Math.pow((E-S)/(T-L),2)),b=Math.sqrt(Math.pow(y-E,2)+Math.pow(v-T,2)-Math.pow(w,2));const C=Math.sqrt(Math.pow(L-T,2)+Math.pow(S-E,2));b=b/C;let A=(L-T)*(y-E)-(S-E)*(v-T);switch(!0){case A>=0:A=1;break;case A<0:A=-1;break}let N=(L-T)*(v-T)+(S-E)*(y-E);switch(!0){case N>=0:N=1;break;case N<0:N=-1;break}return w=Math.abs(w)*A,b=b*N,{distances:w,weights:b}}x(p,"getSegmentWeights"),u.startBatch();for(const g of Object.values(u.edges()))if(g.data?.()){const{x:m,y:v}=g.source().position(),{x:y,y:b}=g.target().position();if(m!==y&&v!==b){const w=g.sourceEndpoint(),T=g.targetEndpoint(),{sourceDir:E}=Oq(g),[L,S]=Jl(E)?[w.x,T.y]:[T.x,w.y],{weights:C,distances:A}=p(w,T,L,S);g.style("segment-distances",A),g.style("segment-weights",C)}}u.endBatch(),f.run()}),f.run(),u.ready(p=>{ie.info("Ready",p),o(u)})})}x(Hq,"layoutArchitecture");var XRe=x(async(t,e,r,n)=>{const i=n.db,a=i.getServices(),s=i.getJunctions(),o=i.getGroups(),l=i.getEdges(),u=i.getDataStructures(),h=el(e),d=h.append("g");d.attr("class","architecture-edges");const f=h.append("g");f.attr("class","architecture-services");const p=h.append("g");p.attr("class","architecture-groups"),await qRe(i,f,a),YRe(i,f,s);const g=await Hq(a,s,o,l,i,u);await WRe(d,g,i),await HRe(p,g,i),zq(i,g),_p(void 0,h,i.getConfigField("padding"),i.getConfigField("useMaxWidth"))},"draw"),jRe={draw:XRe},KRe={parser:Bq,get db(){return new Pq},renderer:jRe,styles:URe};const ZRe=Object.freeze(Object.defineProperty({__proto__:null,diagram:KRe},Symbol.toStringTag,{value:"Module"}));var qq=class{constructor(){this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.setAccTitle=Sn,this.getAccTitle=zn,this.setDiagramTitle=Zn,this.getDiagramTitle=_n,this.getAccDescription=Gn,this.setAccDescription=Vn}static{x(this,"TreeMapDB")}getNodes(){return this.nodes}getConfig(){const t=hr,e=gr();return Hi({...t.treemap,...e.treemap??{}})}addNode(t,e){this.nodes.push(t),this.levels.set(t,e),e===0&&(this.outerNodes.push(t),this.root??=t)}getRoot(){return{name:"",children:this.outerNodes}}addClass(t,e){const r=this.classes.get(t)??{id:t,styles:[],textStyles:[]},n=e.replace(/\\,/g,"§§§").replace(/,/g,";").replace(/§§§/g,",").split(";");n&&n.forEach(i=>{k6(i)&&(r?.textStyles?r.textStyles.push(i):r.textStyles=[i]),r?.styles?r.styles.push(i):r.styles=[i]}),this.classes.set(t,r)}getClasses(){return this.classes}getStylesForClass(t){return this.classes.get(t)?.styles??[]}clear(){An(),this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.root=void 0}};function Yq(t){if(!t.length)return[];const e=[],r=[];return t.forEach(n=>{const i={name:n.name,children:n.type==="Leaf"?void 0:[]};for(i.classSelector=n?.classSelector,n?.cssCompiledStyles&&(i.cssCompiledStyles=[n.cssCompiledStyles]),n.type==="Leaf"&&n.value!==void 0&&(i.value=n.value);r.length>0&&r[r.length-1].level>=n.level;)r.pop();if(r.length===0)e.push(i);else{const a=r[r.length-1].node;a.children?a.children.push(i):a.children=[i]}n.type!=="Leaf"&&r.push({node:i,level:n.level})}),e}x(Yq,"buildHierarchy");var QRe=x((t,e)=>{Fu(t,e);const r=[];for(const a of t.TreemapRows??[])a.$type==="ClassDefStatement"&&e.addClass(a.className??"",a.styleText??"");for(const a of t.TreemapRows??[]){const s=a.item;if(!s)continue;const o=a.indent?parseInt(a.indent):0,l=JRe(s),u=s.classSelector?e.getStylesForClass(s.classSelector):[],h=u.length>0?u.join(";"):void 0,d={level:o,name:l,type:s.$type,value:s.value,classSelector:s.classSelector,cssCompiledStyles:h};r.push(d)}const n=Yq(r),i=x((a,s)=>{for(const o of a)e.addNode(o,s),o.children&&o.children.length>0&&i(o.children,s+1)},"addNodesRecursively");i(n,0)},"populate"),JRe=x(t=>t.name?String(t.name):"","getItemName"),Xq={parser:{yy:void 0},parse:x(async t=>{try{const r=await vc("treemap",t);ie.debug("Treemap AST:",r);const n=Xq.parser?.yy;if(!(n instanceof qq))throw new Error("parser.parser?.yy was not a TreemapDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");QRe(r,n)}catch(e){throw ie.error("Error parsing treemap:",e),e}},"parse")},eNe=10,oh=10,gf=25,tNe=x((t,e,r,n)=>{const i=n.db,a=i.getConfig(),s=a.padding??eNe,o=i.getDiagramTitle(),l=i.getRoot(),{themeVariables:u}=gr();if(!l)return;const h=o?30:0,d=el(e),f=a.nodeWidth?a.nodeWidth*oh:960,p=a.nodeHeight?a.nodeHeight*oh:500,g=f,m=p+h;d.attr("viewBox",`0 0 ${g} ${m}`),ji(d,m,g,a.useMaxWidth);let v;try{const k=a.valueFormat||",";if(k==="$0,0")v=x(R=>"$"+Oc(",")(R),"valueFormat");else if(k.startsWith("$")&&k.includes(",")){const R=/\.\d+/.exec(k),I=R?R[0]:"";v=x(M=>"$"+Oc(","+I)(M),"valueFormat")}else if(k.startsWith("$")){const R=k.substring(1);v=x(I=>"$"+Oc(R||"")(I),"valueFormat")}else v=Oc(k)}catch(k){ie.error("Error creating format function:",k),v=Oc(",")}const y=Zc().range(["transparent",u.cScale0,u.cScale1,u.cScale2,u.cScale3,u.cScale4,u.cScale5,u.cScale6,u.cScale7,u.cScale8,u.cScale9,u.cScale10,u.cScale11]),b=Zc().range(["transparent",u.cScalePeer0,u.cScalePeer1,u.cScalePeer2,u.cScalePeer3,u.cScalePeer4,u.cScalePeer5,u.cScalePeer6,u.cScalePeer7,u.cScalePeer8,u.cScalePeer9,u.cScalePeer10,u.cScalePeer11]),w=Zc().range([u.cScaleLabel0,u.cScaleLabel1,u.cScaleLabel2,u.cScaleLabel3,u.cScaleLabel4,u.cScaleLabel5,u.cScaleLabel6,u.cScaleLabel7,u.cScaleLabel8,u.cScaleLabel9,u.cScaleLabel10,u.cScaleLabel11]);o&&d.append("text").attr("x",g/2).attr("y",h/2).attr("class","treemapTitle").attr("text-anchor","middle").attr("dominant-baseline","middle").text(o);const T=d.append("g").attr("transform",`translate(0, ${h})`).attr("class","treemapContainer"),E=u6(l).sum(k=>k.value??0).sort((k,R)=>(R.value??0)-(k.value??0)),S=KQ().size([f,p]).paddingTop(k=>k.children&&k.children.length>0?gf+oh:0).paddingInner(s).paddingLeft(k=>k.children&&k.children.length>0?oh:0).paddingRight(k=>k.children&&k.children.length>0?oh:0).paddingBottom(k=>k.children&&k.children.length>0?oh:0).round(!0)(E),C=S.descendants().filter(k=>k.children&&k.children.length>0),A=T.selectAll(".treemapSection").data(C).enter().append("g").attr("class","treemapSection").attr("transform",k=>`translate(${k.x0},${k.y0})`);A.append("rect").attr("width",k=>k.x1-k.x0).attr("height",gf).attr("class","treemapSectionHeader").attr("fill","none").attr("fill-opacity",.6).attr("stroke-width",.6).attr("style",k=>k.depth===0?"display: none;":""),A.append("clipPath").attr("id",(k,R)=>`clip-section-${e}-${R}`).append("rect").attr("width",k=>Math.max(0,k.x1-k.x0-12)).attr("height",gf),A.append("rect").attr("width",k=>k.x1-k.x0).attr("height",k=>k.y1-k.y0).attr("class",(k,R)=>`treemapSection section${R}`).attr("fill",k=>y(k.data.name)).attr("fill-opacity",.6).attr("stroke",k=>b(k.data.name)).attr("stroke-width",2).attr("stroke-opacity",.4).attr("style",k=>{if(k.depth===0)return"display: none;";const R=Ct({cssCompiledStyles:k.data.cssCompiledStyles});return R.nodeStyles+";"+R.borderStyles.join(";")}),A.append("text").attr("class","treemapSectionLabel").attr("x",6).attr("y",gf/2).attr("dominant-baseline","middle").text(k=>k.depth===0?"":k.data.name).attr("font-weight","bold").attr("style",k=>{if(k.depth===0)return"display: none;";const R="dominant-baseline: middle; font-size: 12px; fill:"+w(k.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",I=Ct({cssCompiledStyles:k.data.cssCompiledStyles});return R+I.labelStyles.replace("color:","fill:")}).each(function(k){if(k.depth===0)return;const R=Qe(this),I=k.data.name;R.text(I);const M=k.x1-k.x0,D=6;let B;a.showValues!==!1&&k.value?B=M-10-30-10-D:B=M-D-6;const F=Math.max(15,B),G=R.node();if(G.getComputedTextLength()>F){const J="...";let q=I;for(;q.length>0;){if(q=I.substring(0,q.length-1),q.length===0){R.text(J),G.getComputedTextLength()>F&&R.text("");break}if(R.text(q+J),G.getComputedTextLength()<=F)break}}}),a.showValues!==!1&&A.append("text").attr("class","treemapSectionValue").attr("x",k=>k.x1-k.x0-10).attr("y",gf/2).attr("text-anchor","end").attr("dominant-baseline","middle").text(k=>k.value?v(k.value):"").attr("font-style","italic").attr("style",k=>{if(k.depth===0)return"display: none;";const R="text-anchor: end; dominant-baseline: middle; font-size: 10px; fill:"+w(k.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",I=Ct({cssCompiledStyles:k.data.cssCompiledStyles});return R+I.labelStyles.replace("color:","fill:")});const N=S.leaves(),_=T.selectAll(".treemapLeafGroup").data(N).enter().append("g").attr("class",(k,R)=>`treemapNode treemapLeafGroup leaf${R}${k.data.classSelector?` ${k.data.classSelector}`:""}x`).attr("transform",k=>`translate(${k.x0},${k.y0})`);_.append("rect").attr("width",k=>k.x1-k.x0).attr("height",k=>k.y1-k.y0).attr("class","treemapLeaf").attr("fill",k=>k.parent?y(k.parent.data.name):y(k.data.name)).attr("style",k=>Ct({cssCompiledStyles:k.data.cssCompiledStyles}).nodeStyles).attr("fill-opacity",.3).attr("stroke",k=>k.parent?y(k.parent.data.name):y(k.data.name)).attr("stroke-width",3),_.append("clipPath").attr("id",(k,R)=>`clip-${e}-${R}`).append("rect").attr("width",k=>Math.max(0,k.x1-k.x0-4)).attr("height",k=>Math.max(0,k.y1-k.y0-4)),_.append("text").attr("class","treemapLabel").attr("x",k=>(k.x1-k.x0)/2).attr("y",k=>(k.y1-k.y0)/2).attr("style",k=>{const R="text-anchor: middle; dominant-baseline: middle; font-size: 38px;fill:"+w(k.data.name)+";",I=Ct({cssCompiledStyles:k.data.cssCompiledStyles});return R+I.labelStyles.replace("color:","fill:")}).attr("clip-path",(k,R)=>`url(#clip-${e}-${R})`).text(k=>k.data.name).each(function(k){const R=Qe(this),I=k.x1-k.x0,M=k.y1-k.y0,D=R.node(),B=4,$=I-2*B,F=M-2*B;if($<10||F<10){R.style("display","none");return}let G=parseInt(R.style("font-size"),10);const W=8,J=28,q=.6,ne=6,ae=2;for(;D.getComputedTextLength()>$&&G>W;)G--,R.style("font-size",`${G}px`);let pe=Math.max(ne,Math.min(J,Math.round(G*q))),K=G+ae+pe;for(;K>F&&G>W&&(G--,pe=Math.max(ne,Math.min(J,Math.round(G*q))),!(pe<ne&&G===W));)R.style("font-size",`${G}px`),K=G+ae+pe;R.style("font-size",`${G}px`),(D.getComputedTextLength()>$||G<W||F<G)&&R.style("display","none")}),a.showValues!==!1&&_.append("text").attr("class","treemapValue").attr("x",R=>(R.x1-R.x0)/2).attr("y",function(R){return(R.y1-R.y0)/2}).attr("style",R=>{const I="text-anchor: middle; dominant-baseline: hanging; font-size: 28px;fill:"+w(R.data.name)+";",M=Ct({cssCompiledStyles:R.data.cssCompiledStyles});return I+M.labelStyles.replace("color:","fill:")}).attr("clip-path",(R,I)=>`url(#clip-${e}-${I})`).text(R=>R.value?v(R.value):"").each(function(R){const I=Qe(this),M=this.parentNode;if(!M){I.style("display","none");return}const D=Qe(M).select(".treemapLabel");if(D.empty()||D.style("display")==="none"){I.style("display","none");return}const B=parseFloat(D.style("font-size")),$=28,F=.6,G=6,W=2,J=Math.max(G,Math.min($,Math.round(B*F)));I.style("font-size",`${J}px`);const ne=(R.y1-R.y0)/2+B/2+W;I.attr("y",ne);const ae=R.x1-R.x0,Z=R.y1-R.y0-4,X=ae-2*4;I.node().getComputedTextLength()>X||ne+J>Z||J<G?I.style("display","none"):I.style("display",null)});const P=a.diagramPadding??8;Bu(d,P,"flowchart",a?.useMaxWidth||!1)},"draw"),rNe=x(function(t,e){return e.db.getClasses()},"getClasses"),nNe={draw:tNe,getClasses:rNe},iNe={sectionStrokeColor:"black",sectionStrokeWidth:"1",sectionFillColor:"#efefef",leafStrokeColor:"black",leafStrokeWidth:"1",leafFillColor:"#efefef",labelColor:"black",labelFontSize:"12px",valueFontSize:"10px",valueColor:"black",titleColor:"black",titleFontSize:"14px"},aNe=x(({treemap:t}={})=>{const e=Hi(iNe,t);return`
  .treemapNode.section {
    stroke: ${e.sectionStrokeColor};
    stroke-width: ${e.sectionStrokeWidth};
    fill: ${e.sectionFillColor};
  }
  .treemapNode.leaf {
    stroke: ${e.leafStrokeColor};
    stroke-width: ${e.leafStrokeWidth};
    fill: ${e.leafFillColor};
  }
  .treemapLabel {
    fill: ${e.labelColor};
    font-size: ${e.labelFontSize};
  }
  .treemapValue {
    fill: ${e.valueColor};
    font-size: ${e.valueFontSize};
  }
  .treemapTitle {
    fill: ${e.titleColor};
    font-size: ${e.titleFontSize};
  }
  `},"getStyles"),sNe=aNe,oNe={parser:Xq,get db(){return new qq},renderer:nNe,styles:sNe};const lNe=Object.freeze(Object.defineProperty({__proto__:null,diagram:oNe},Symbol.toStringTag,{value:"Module"})),cNe=Object.freeze(Object.defineProperty({__proto__:null,InfoModule:JU,createInfoServices:eW},Symbol.toStringTag,{value:"Module"})),uNe=Object.freeze(Object.defineProperty({__proto__:null,PacketModule:tW,createPacketServices:rW},Symbol.toStringTag,{value:"Module"})),hNe=Object.freeze(Object.defineProperty({__proto__:null,PieModule:nW,createPieServices:iW},Symbol.toStringTag,{value:"Module"})),dNe=Object.freeze(Object.defineProperty({__proto__:null,ArchitectureModule:aW,createArchitectureServices:sW},Symbol.toStringTag,{value:"Module"})),fNe=Object.freeze(Object.defineProperty({__proto__:null,GitGraphModule:ZU,createGitGraphServices:QU},Symbol.toStringTag,{value:"Module"})),pNe=Object.freeze(Object.defineProperty({__proto__:null,RadarModule:oW,createRadarServices:lW},Symbol.toStringTag,{value:"Module"})),gNe=Object.freeze(Object.defineProperty({__proto__:null,TreemapModule:uW,createTreemapServices:hW},Symbol.toStringTag,{value:"Module"}));</script>
</head>
<body>
  <div id="container">
    <pre id="mermaid-source" class="mermaid"></pre>
  </div>
</body>
</html>
