Files
StudyDiary/.obsidian/plugins/slides-extended/plugin/mermaid/mermaid.esm.js
CrazyJasonwell fb40c9b109 add all
2025-10-25 20:35:10 +08:00

48 lines
2.4 MiB
Executable File
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
var t=Object.create,e=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,s=(t,n)=>e(t,"name",{value:n,configurable:!0}),o=(t,e)=>function(){return e||(0,t[r(t)[0]])((e={exports:{}}).exports,e),e.exports},l=(t,n)=>{for(var r in n)e(t,r,{get:n[r],enumerable:!0})},h=(t,i,s,o)=>{if(i&&"object"==typeof i||"function"==typeof i)for(let l of r(i))a.call(t,l)||l===s||e(t,l,{get:()=>i[l],enumerable:!(o=n(i,l))||o.enumerable});return t},u=(t,e,n)=>(h(t,e,"default"),n&&h(n,e,"default")),d=(n,r,a)=>(a=null!=n?t(i(n)):{},h(!r&&n&&n.__esModule?a:e(a,"default",{value:n,enumerable:!0}),n)),p=o({"../../node_modules/.pnpm/dayjs@1.11.13/node_modules/dayjs/dayjs.min.js"(t,e){!function(n,r){"object"==typeof t&&void 0!==e?e.exports=r():"function"==typeof define&&define.amd?define(r):(n="undefined"!=typeof globalThis?globalThis:n||self).dayjs=r()}(t,(function(){var t=6e4,e=36e5,n="millisecond",r="second",i="minute",a="hour",o="day",l="week",c="month",h="quarter",u="year",d="date",p="Invalid Date",g=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,f=/\[([^\]]+)]|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,m={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:s((function(t){var e=["th","st","nd","rd"],n=t%100;return"["+t+(e[(n-20)%10]||e[n]||e[0])+"]"}),"ordinal")},y=s((function(t,e,n){var r=String(t);return!r||r.length>=e?t:""+Array(e+1-r.length).join(n)+t}),"m"),v={s:y,z:s((function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return(e<=0?"+":"-")+y(r,2,"0")+":"+y(i,2,"0")}),"z"),m:s((function t(e,n){if(e.date()<n.date())return-t(n,e);var r=12*(n.year()-e.year())+(n.month()-e.month()),i=e.clone().add(r,c),a=n-i<0,s=e.clone().add(r+(a?-1:1),c);return+(-(r+(n-i)/(a?i-s:s-i))||0)}),"t"),a:s((function(t){return t<0?Math.ceil(t)||0:Math.floor(t)}),"a"),p:s((function(t){return{M:c,y:u,w:l,d:o,D:d,h:a,m:i,s:r,ms:n,Q:h}[t]||String(t||"").toLowerCase().replace(/s$/,"")}),"p"),u:s((function(t){return void 0===t}),"u")},x="en",b={};b[x]=m;var w="$isDayjsObject",k=s((function(t){return t instanceof C||!(!t||!t[w])}),"S"),T=s((function t(e,n,r){var i;if(!e)return x;if("string"==typeof e){var a=e.toLowerCase();b[a]&&(i=a),n&&(b[a]=n,i=a);var s=e.split("-");if(!i&&s.length>1)return t(s[0])}else{var o=e.name;b[o]=e,i=o}return!r&&i&&(x=i),i||!r&&x}),"t"),_=s((function(t,e){if(k(t))return t.clone();var n="object"==typeof e?e:{};return n.date=t,n.args=arguments,new C(n)}),"O"),E=v;E.l=T,E.i=k,E.w=function(t,e){return _(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var C=function(){function m(t){this.$L=T(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[w]=!0}s(m,"M");var y=m.prototype;return y.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(E.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var r=e.match(g);if(r){var i=r[2]-1||0,a=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,a)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,a)}}return new Date(e)}(t),this.init()},y.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},y.$utils=function(){return E},y.isValid=function(){return!(this.$d.toString()===p)},y.isSame=function(t,e){var n=_(t);return this.startOf(e)<=n&&n<=this.endOf(e)},y.isAfter=function(t,e){return _(t)<this.startOf(e)},y.isBefore=function(t,e){return this.endOf(e)<_(t)},y.$g=function(t,e,n){return E.u(t)?this[e]:this.set(n,t)},y.unix=function(){return Math.floor(this.valueOf()/1e3)},y.valueOf=function(){return this.$d.getTime()},y.startOf=function(t,e){var n=this,h=!!E.u(e)||e,p=E.p(t),g=s((function(t,e){var r=E.w(n.$u?Date.UTC(n.$y,e,t):new Date(n.$y,e,t),n);return h?r:r.endOf(o)}),"l"),f=s((function(t,e){return E.w(n.toDate()[t].apply(n.toDate("s"),(h?[0,0,0,0]:[23,59,59,999]).slice(e)),n)}),"$"),m=this.$W,y=this.$M,v=this.$D,x="set"+(this.$u?"UTC":"");switch(p){case u:return h?g(1,0):g(31,11);case c:return h?g(1,y):g(0,y+1);case l:var b=this.$locale().weekStart||0,w=(m<b?m+7:m)-b;return g(h?v-w:v+(6-w),y);case o:case d:return f(x+"Hours",0);case a:return f(x+"Minutes",1);case i:return f(x+"Seconds",2);case r:return f(x+"Milliseconds",3);default:return this.clone()}},y.endOf=function(t){return this.startOf(t,!1)},y.$set=function(t,e){var s,l=E.p(t),h="set"+(this.$u?"UTC":""),p=(s={},s[o]=h+"Date",s[d]=h+"Date",s[c]=h+"Month",s[u]=h+"FullYear",s[a]=h+"Hours",s[i]=h+"Minutes",s[r]=h+"Seconds",s[n]=h+"Milliseconds",s)[l],g=l===o?this.$D+(e-this.$W):e;if(l===c||l===u){var f=this.clone().set(d,1);f.$d[p](g),f.init(),this.$d=f.set(d,Math.min(this.$D,f.daysInMonth())).$d}else p&&this.$d[p](g);return this.init(),this},y.set=function(t,e){return this.clone().$set(t,e)},y.get=function(t){return this[E.p(t)]()},y.add=function(n,h){var d,p=this;n=Number(n);var g=E.p(h),f=s((function(t){var e=_(p);return E.w(e.date(e.date()+Math.round(t*n)),p)}),"y");if(g===c)return this.set(c,this.$M+n);if(g===u)return this.set(u,this.$y+n);if(g===o)return f(1);if(g===l)return f(7);var m=(d={},d[i]=t,d[a]=e,d[r]=1e3,d)[g]||1,y=this.$d.getTime()+n*m;return E.w(y,this)},y.subtract=function(t,e){return this.add(-1*t,e)},y.format=function(t){var e=this,n=this.$locale();if(!this.isValid())return n.invalidDate||p;var r=t||"YYYY-MM-DDTHH:mm:ssZ",i=E.z(this),a=this.$H,o=this.$m,l=this.$M,c=n.weekdays,h=n.months,u=n.meridiem,d=s((function(t,n,i,a){return t&&(t[n]||t(e,r))||i[n].slice(0,a)}),"h"),g=s((function(t){return E.s(a%12||12,t,"0")}),"d"),m=u||function(t,e,n){var r=t<12?"AM":"PM";return n?r.toLowerCase():r};return r.replace(f,(function(t,r){return r||function(t){switch(t){case"YY":return String(e.$y).slice(-2);case"YYYY":return E.s(e.$y,4,"0");case"M":return l+1;case"MM":return E.s(l+1,2,"0");case"MMM":return d(n.monthsShort,l,h,3);case"MMMM":return d(h,l);case"D":return e.$D;case"DD":return E.s(e.$D,2,"0");case"d":return String(e.$W);case"dd":return d(n.weekdaysMin,e.$W,c,2);case"ddd":return d(n.weekdaysShort,e.$W,c,3);case"dddd":return c[e.$W];case"H":return String(a);case"HH":return E.s(a,2,"0");case"h":return g(1);case"hh":return g(2);case"a":return m(a,o,!0);case"A":return m(a,o,!1);case"m":return String(o);case"mm":return E.s(o,2,"0");case"s":return String(e.$s);case"ss":return E.s(e.$s,2,"0");case"SSS":return E.s(e.$ms,3,"0");case"Z":return i}return null}(t)||i.replace(":","")}))},y.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},y.diff=function(n,d,p){var g,f=this,m=E.p(d),y=_(n),v=(y.utcOffset()-this.utcOffset())*t,x=this-y,b=s((function(){return E.m(f,y)}),"D");switch(m){case u:g=b()/12;break;case c:g=b();break;case h:g=b()/3;break;case l:g=(x-v)/6048e5;break;case o:g=(x-v)/864e5;break;case a:g=x/e;break;case i:g=x/t;break;case r:g=x/1e3;break;default:g=x}return p?g:E.a(g)},y.daysInMonth=function(){return this.endOf(c).$D},y.$locale=function(){return b[this.$L]},y.locale=function(t,e){if(!t)return this.$L;var n=this.clone(),r=T(t,e,!0);return r&&(n.$L=r),n},y.clone=function(){return E.w(this.$d,this)},y.toDate=function(){return new Date(this.valueOf())},y.toJSON=function(){return this.isValid()?this.toISOString():null},y.toISOString=function(){return this.$d.toISOString()},y.toString=function(){return this.$d.toUTCString()},m}(),S=C.prototype;return _.prototype=S,[["$ms",n],["$s",r],["$m",i],["$H",a],["$W",o],["$M",c],["$y",u],["$D",d]].forEach((function(t){S[t[1]]=function(e){return this.$g(e,t[0],t[1])}})),_.extend=function(t,e){return t.$i||(t(e,C,_),t.$i=!0),_},_.locale=T,_.isDayjs=k,_.unix=function(t){return _(1e3*t)},_.en=b[x],_.Ls=b,_.p={},_}))}}),g=d(p(),1),f={trace:0,debug:1,info:2,warn:3,error:4,fatal:5},m={trace:s(((...t)=>{}),"trace"),debug:s(((...t)=>{}),"debug"),info:s(((...t)=>{}),"info"),warn:s(((...t)=>{}),"warn"),error:s(((...t)=>{}),"error"),fatal:s(((...t)=>{}),"fatal")},y=s((function(t="fatal"){let e=f.fatal;"string"==typeof t?t.toLowerCase()in f&&(e=f[t]):"number"==typeof t&&(e=t),m.trace=()=>{},m.debug=()=>{},m.info=()=>{},m.warn=()=>{},m.error=()=>{},m.fatal=()=>{},e<=f.fatal&&(m.fatal=console.error?console.error.bind(console,v("FATAL"),"color: orange"):console.log.bind(console,"",v("FATAL"))),e<=f.error&&(m.error=console.error?console.error.bind(console,v("ERROR"),"color: orange"):console.log.bind(console,"",v("ERROR"))),e<=f.warn&&(m.warn=console.warn?console.warn.bind(console,v("WARN"),"color: orange"):console.log.bind(console,"",v("WARN"))),e<=f.info&&(m.info=console.info?console.info.bind(console,v("INFO"),"color: lightblue"):console.log.bind(console,"",v("INFO"))),e<=f.debug&&(m.debug=console.debug?console.debug.bind(console,v("DEBUG"),"color: lightgreen"):console.log.bind(console,"",v("DEBUG"))),e<=f.trace&&(m.trace=console.debug?console.debug.bind(console,v("TRACE"),"color: lightgreen"):console.log.bind(console,"",v("TRACE")))}),"setLogLevel"),v=s((t=>`%c${(0,g.default)().format("ss.SSS")} : ${t} : `),"format"),x=/^-{3}\s*[\n\r](.*?)[\n\r]-{3}\s*[\n\r]+/s,b=/%{2}{\s*(?:(\w+)\s*:|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,w=/\s*%%.*\n/gm,k=class extends Error{static{s(this,"UnknownDiagramError")}constructor(t){super(t),this.name="UnknownDiagramError"}},T={},_=s((function(t,e){t=t.replace(x,"").replace(b,"").replace(w,"\n");for(const[n,{detector:r}]of Object.entries(T)){if(r(t,e))return n}throw new k(`No diagram type detected matching given configuration for text: ${t}`)}),"detectType"),E=s(((...t)=>{for(const{id:e,detector:n,loader:r}of t)C(e,n,r)}),"registerLazyLoadedDiagrams"),C=s(((t,e,n)=>{T[t]&&m.warn(`Detector with key ${t} already exists. Overwriting.`),T[t]={detector:e,loader:n},m.debug(`Detector with key ${t} added${n?" with loader":""}`)}),"addDetector"),S=s((t=>T[t].loader),"getDiagramLoader"),A=s(((t,e,{depth:n=2,clobber:r=!1}={})=>{const i={depth:n,clobber:r};return Array.isArray(e)&&!Array.isArray(t)?(e.forEach((e=>A(t,e,i))),t):Array.isArray(e)&&Array.isArray(t)?(e.forEach((e=>{t.includes(e)||t.push(e)})),t):void 0===t||n<=0?null!=t&&"object"==typeof t&&"object"==typeof e?Object.assign(t,e):e:(void 0!==e&&"object"==typeof t&&"object"==typeof e&&Object.keys(e).forEach((i=>{"object"!=typeof e[i]||void 0!==t[i]&&"object"!=typeof t[i]?(r||"object"!=typeof t[i]&&"object"!=typeof e[i])&&(t[i]=e[i]):(void 0===t[i]&&(t[i]=Array.isArray(e[i])?[]:{}),t[i]=A(t[i],e[i],{depth:n-1,clobber:r}))})),t)}),"assignWithDepth"),L=A,N={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:s((t=>t>=255?255:t<0?0:t),"r"),g:s((t=>t>=255?255:t<0?0:t),"g"),b:s((t=>t>=255?255:t<0?0:t),"b"),h:s((t=>t%360),"h"),s:s((t=>t>=100?100:t<0?0:t),"s"),l:s((t=>t>=100?100:t<0?0:t),"l"),a:s((t=>t>=1?1:t<0?0:t),"a")},toLinear:s((t=>{const e=t/255;return t>.03928?Math.pow((e+.055)/1.055,2.4):e/12.92}),"toLinear"),hue2rgb:s(((t,e,n)=>(n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t)),"hue2rgb"),hsl2rgb:s((({h:t,s:e,l:n},r)=>{if(!e)return 2.55*n;t/=360,e/=100;const i=(n/=100)<.5?n*(1+e):n+e-n*e,a=2*n-i;switch(r){case"r":return 255*N.hue2rgb(a,i,t+1/3);case"g":return 255*N.hue2rgb(a,i,t);case"b":return 255*N.hue2rgb(a,i,t-1/3)}}),"hsl2rgb"),rgb2hsl:s((({r:t,g:e,b:n},r)=>{t/=255,e/=255,n/=255;const i=Math.max(t,e,n),a=Math.min(t,e,n),s=(i+a)/2;if("l"===r)return 100*s;if(i===a)return 0;const o=i-a;if("s"===r)return 100*(s>.5?o/(2-i-a):o/(i+a));switch(i){case t:return 60*((e-n)/o+(e<n?6:0));case e:return 60*((n-t)/o+2);case n:return 60*((t-e)/o+4);default:return-1}}),"rgb2hsl")},I={channel:N,lang:{clamp:s(((t,e,n)=>e>n?Math.min(e,Math.max(n,t)):Math.min(n,Math.max(e,t))),"clamp"),round:s((t=>Math.round(1e10*t)/1e10),"round")},unit:{dec2hex:s((t=>{const e=Math.round(t).toString(16);return e.length>1?e:`0${e}`}),"dec2hex")}},M={};for(let t=0;t<=255;t++)M[t]=I.unit.dec2hex(t);var R,D=0,O=1,P=2,B=class{static{s(this,"Type")}constructor(){this.type=D}get(){return this.type}set(t){if(this.type&&this.type!==t)throw new Error("Cannot change both RGB and HSL channels at the same time");this.type=t}reset(){this.type=D}is(t){return this.type===t}},$=class{static{s(this,"Channels")}constructor(t,e){this.color=e,this.changed=!1,this.data=t,this.type=new B}set(t,e){return this.color=e,this.changed=!1,this.data=t,this.type.type=D,this}_ensureHSL(){const t=this.data,{h:e,s:n,l:r}=t;void 0===e&&(t.h=I.channel.rgb2hsl(t,"h")),void 0===n&&(t.s=I.channel.rgb2hsl(t,"s")),void 0===r&&(t.l=I.channel.rgb2hsl(t,"l"))}_ensureRGB(){const t=this.data,{r:e,g:n,b:r}=t;void 0===e&&(t.r=I.channel.hsl2rgb(t,"r")),void 0===n&&(t.g=I.channel.hsl2rgb(t,"g")),void 0===r&&(t.b=I.channel.hsl2rgb(t,"b"))}get r(){const t=this.data,e=t.r;return this.type.is(P)||void 0===e?(this._ensureHSL(),I.channel.hsl2rgb(t,"r")):e}get g(){const t=this.data,e=t.g;return this.type.is(P)||void 0===e?(this._ensureHSL(),I.channel.hsl2rgb(t,"g")):e}get b(){const t=this.data,e=t.b;return this.type.is(P)||void 0===e?(this._ensureHSL(),I.channel.hsl2rgb(t,"b")):e}get h(){const t=this.data,e=t.h;return this.type.is(O)||void 0===e?(this._ensureRGB(),I.channel.rgb2hsl(t,"h")):e}get s(){const t=this.data,e=t.s;return this.type.is(O)||void 0===e?(this._ensureRGB(),I.channel.rgb2hsl(t,"s")):e}get l(){const t=this.data,e=t.l;return this.type.is(O)||void 0===e?(this._ensureRGB(),I.channel.rgb2hsl(t,"l")):e}get a(){return this.data.a}set r(t){this.type.set(O),this.changed=!0,this.data.r=t}set g(t){this.type.set(O),this.changed=!0,this.data.g=t}set b(t){this.type.set(O),this.changed=!0,this.data.b=t}set h(t){this.type.set(P),this.changed=!0,this.data.h=t}set s(t){this.type.set(P),this.changed=!0,this.data.s=t}set l(t){this.type.set(P),this.changed=!0,this.data.l=t}set a(t){this.changed=!0,this.data.a=t}},F=new $({r:0,g:0,b:0,a:0},"transparent"),z={re:/^#((?:[a-f0-9]{2}){2,4}|[a-f0-9]{3})$/i,parse:s((t=>{if(35!==t.charCodeAt(0))return;const e=t.match(z.re);if(!e)return;const n=e[1],r=parseInt(n,16),i=n.length,a=i%4==0,s=i>4,o=s?1:17,l=s?8:4,c=a?0:-1,h=s?255:15;return F.set({r:(r>>l*(c+3)&h)*o,g:(r>>l*(c+2)&h)*o,b:(r>>l*(c+1)&h)*o,a:a?(r&h)*o/255:1},t)}),"parse"),stringify:s((t=>{const{r:e,g:n,b:r,a:i}=t;return i<1?`#${M[Math.round(e)]}${M[Math.round(n)]}${M[Math.round(r)]}${M[Math.round(255*i)]}`:`#${M[Math.round(e)]}${M[Math.round(n)]}${M[Math.round(r)]}`}),"stringify")},U=z,G={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:s((t=>{const e=t.match(G.hueRe);if(e){const[,t,n]=e;switch(n){case"grad":return I.channel.clamp.h(.9*parseFloat(t));case"rad":return I.channel.clamp.h(180*parseFloat(t)/Math.PI);case"turn":return I.channel.clamp.h(360*parseFloat(t))}}return I.channel.clamp.h(parseFloat(t))}),"_hue2deg"),parse:s((t=>{const e=t.charCodeAt(0);if(104!==e&&72!==e)return;const n=t.match(G.re);if(!n)return;const[,r,i,a,s,o]=n;return F.set({h:G._hue2deg(r),s:I.channel.clamp.s(parseFloat(i)),l:I.channel.clamp.l(parseFloat(a)),a:s?I.channel.clamp.a(o?parseFloat(s)/100:parseFloat(s)):1},t)}),"parse"),stringify:s((t=>{const{h:e,s:n,l:r,a:i}=t;return i<1?`hsla(${I.lang.round(e)}, ${I.lang.round(n)}%, ${I.lang.round(r)}%, ${i})`:`hsl(${I.lang.round(e)}, ${I.lang.round(n)}%, ${I.lang.round(r)}%)`}),"stringify")},q=G,j={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:s((t=>{t=t.toLowerCase();const e=j.colors[t];if(e)return U.parse(e)}),"parse"),stringify:s((t=>{const e=U.stringify(t);for(const t in j.colors)if(j.colors[t]===e)return t}),"stringify")},Y=j,W={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:s((t=>{const e=t.charCodeAt(0);if(114!==e&&82!==e)return;const n=t.match(W.re);if(!n)return;const[,r,i,a,s,o,l,c,h]=n;return F.set({r:I.channel.clamp.r(i?2.55*parseFloat(r):parseFloat(r)),g:I.channel.clamp.g(s?2.55*parseFloat(a):parseFloat(a)),b:I.channel.clamp.b(l?2.55*parseFloat(o):parseFloat(o)),a:c?I.channel.clamp.a(h?parseFloat(c)/100:parseFloat(c)):1},t)}),"parse"),stringify:s((t=>{const{r:e,g:n,b:r,a:i}=t;return i<1?`rgba(${I.lang.round(e)}, ${I.lang.round(n)}, ${I.lang.round(r)}, ${I.lang.round(i)})`:`rgb(${I.lang.round(e)}, ${I.lang.round(n)}, ${I.lang.round(r)})`}),"stringify")},H=W,V={format:{keyword:Y,hex:U,rgb:H,rgba:H,hsl:q,hsla:q},parse:s((t=>{if("string"!=typeof t)return t;const e=U.parse(t)||H.parse(t)||q.parse(t)||Y.parse(t);if(e)return e;throw new Error(`Unsupported color format: "${t}"`)}),"parse"),stringify:s((t=>!t.changed&&t.color?t.color:t.type.is(P)||void 0===t.data.r?q.stringify(t):t.a<1||!Number.isInteger(t.r)||!Number.isInteger(t.g)||!Number.isInteger(t.b)?H.stringify(t):U.stringify(t)),"stringify")},X=s(((t,e)=>{const n=V.parse(t);for(const t in e)n[t]=I.channel.clamp[t](e[t]);return V.stringify(n)}),"change"),K=X,Z=s(((t,e,n=0,r=1)=>{if("number"!=typeof t)return K(t,{a:e});const i=F.set({r:I.channel.clamp.r(t),g:I.channel.clamp.g(e),b:I.channel.clamp.b(n),a:I.channel.clamp.a(r)});return V.stringify(i)}),"rgba"),Q=Z,J=s(((t,e)=>I.lang.round(V.parse(t)[e])),"channel"),tt=s((t=>{const{r:e,g:n,b:r}=V.parse(t),i=.2126*I.channel.toLinear(e)+.7152*I.channel.toLinear(n)+.0722*I.channel.toLinear(r);return I.lang.round(i)}),"luminance"),et=tt,nt=s((t=>et(t)>=.5),"isLight"),rt=s((t=>!nt(t)),"isDark"),it=s(((t,e,n)=>{const r=V.parse(t),i=r[e],a=I.channel.clamp[e](i+n);return i!==a&&(r[e]=a),V.stringify(r)}),"adjustChannel"),at=s(((t,e)=>it(t,"l",e)),"lighten"),st=s(((t,e)=>it(t,"l",-e)),"darken"),ot=s(((t,e)=>{const n=V.parse(t),r={};for(const t in e)e[t]&&(r[t]=n[t]+e[t]);return K(t,r)}),"adjust"),lt=ot,ct=s(((t,e,n=50)=>{const{r:r,g:i,b:a,a:s}=V.parse(t),{r:o,g:l,b:c,a:h}=V.parse(e),u=n/100,d=2*u-1,p=s-h,g=((d*p==-1?d:(d+p)/(1+d*p))+1)/2,f=1-g;return Q(r*g+o*f,i*g+l*f,a*g+c*f,s*u+h*(1-u))}),"mix"),ht=s(((t,e=100)=>{const n=V.parse(t);return n.r=255-n.r,n.g=255-n.g,n.b=255-n.b,ct(n,t,e)}),"invert"),ut=s(((t,e)=>lt(t,e?{s:-40,l:10}:{s:-40,l:-10})),"mkBorder"),dt=class{static{s(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||lt(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||lt(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||ut(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||ut(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||ut(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||ut(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||ht(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||ht(this.tertiaryColor),this.lineColor=this.lineColor||ht(this.background),this.arrowheadColor=this.arrowheadColor||ht(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?st(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||st(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||ht(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||at(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.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.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||lt(this.primaryColor,{h:30}),this.cScale4=this.cScale4||lt(this.primaryColor,{h:60}),this.cScale5=this.cScale5||lt(this.primaryColor,{h:90}),this.cScale6=this.cScale6||lt(this.primaryColor,{h:120}),this.cScale7=this.cScale7||lt(this.primaryColor,{h:150}),this.cScale8=this.cScale8||lt(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||lt(this.primaryColor,{h:270}),this.cScale10=this.cScale10||lt(this.primaryColor,{h:300}),this.cScale11=this.cScale11||lt(this.primaryColor,{h:330}),this.darkMode)for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScale"+t]=st(this["cScale"+t],75);else for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScale"+t]=st(this["cScale"+t],25);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleInv"+t]=this["cScaleInv"+t]||ht(this["cScale"+t]);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this.darkMode?this["cScalePeer"+t]=this["cScalePeer"+t]||at(this["cScale"+t],10):this["cScalePeer"+t]=this["cScalePeer"+t]||st(this["cScale"+t],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleLabel"+t]=this["cScaleLabel"+t]||this.scaleLabelColor;const t=this.darkMode?-4:-1;for(let e=0;e<5;e++)this["surface"+e]=this["surface"+e]||lt(this.mainBkg,{h:180,s:-15,l:t*(5+3*e)}),this["surfacePeer"+e]=this["surfacePeer"+e]||lt(this.mainBkg,{h:180,s:-15,l:t*(8+3*e)});this.classText=this.classText||this.textColor,this.fillType0=this.fillType0||this.primaryColor,this.fillType1=this.fillType1||this.secondaryColor,this.fillType2=this.fillType2||lt(this.primaryColor,{h:64}),this.fillType3=this.fillType3||lt(this.secondaryColor,{h:64}),this.fillType4=this.fillType4||lt(this.primaryColor,{h:-64}),this.fillType5=this.fillType5||lt(this.secondaryColor,{h:-64}),this.fillType6=this.fillType6||lt(this.primaryColor,{h:128}),this.fillType7=this.fillType7||lt(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||lt(this.primaryColor,{l:-10}),this.pie5=this.pie5||lt(this.secondaryColor,{l:-10}),this.pie6=this.pie6||lt(this.tertiaryColor,{l:-10}),this.pie7=this.pie7||lt(this.primaryColor,{h:60,l:-10}),this.pie8=this.pie8||lt(this.primaryColor,{h:-60,l:-10}),this.pie9=this.pie9||lt(this.primaryColor,{h:120,l:0}),this.pie10=this.pie10||lt(this.primaryColor,{h:60,l:-20}),this.pie11=this.pie11||lt(this.primaryColor,{h:-60,l:-20}),this.pie12=this.pie12||lt(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.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||lt(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||lt(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||lt(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||lt(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||lt(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||lt(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||rt(this.quadrant1Fill)?at(this.quadrant1Fill):st(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?st(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||lt(this.primaryColor,{h:-30}),this.git4=this.git4||lt(this.primaryColor,{h:-60}),this.git5=this.git5||lt(this.primaryColor,{h:-90}),this.git6=this.git6||lt(this.primaryColor,{h:60}),this.git7=this.git7||lt(this.primaryColor,{h:120}),this.darkMode?(this.git0=at(this.git0,25),this.git1=at(this.git1,25),this.git2=at(this.git2,25),this.git3=at(this.git3,25),this.git4=at(this.git4,25),this.git5=at(this.git5,25),this.git6=at(this.git6,25),this.git7=at(this.git7,25)):(this.git0=st(this.git0,25),this.git1=st(this.git1,25),this.git2=st(this.git2,25),this.git3=st(this.git3,25),this.git4=st(this.git4,25),this.git5=st(this.git5,25),this.git6=st(this.git6,25),this.git7=st(this.git7,25)),this.gitInv0=this.gitInv0||ht(this.git0),this.gitInv1=this.gitInv1||ht(this.git1),this.gitInv2=this.gitInv2||ht(this.git2),this.gitInv3=this.gitInv3||ht(this.git3),this.gitInv4=this.gitInv4||ht(this.git4),this.gitInv5=this.gitInv5||ht(this.git5),this.gitInv6=this.gitInv6||ht(this.git6),this.gitInv7=this.gitInv7||ht(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||"#ffffff",this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||"#f2f2f2"}calculate(t){if("object"!=typeof t)return void this.updateColors();const e=Object.keys(t);e.forEach((e=>{this[e]=t[e]})),this.updateColors(),e.forEach((e=>{this[e]=t[e]}))}},pt=s((t=>{const e=new dt;return e.calculate(t),e}),"getThemeVariables"),gt=class{static{s(this,"Theme")}constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=at(this.primaryColor,16),this.tertiaryColor=lt(this.primaryColor,{h:-160}),this.primaryBorderColor=ht(this.background),this.secondaryBorderColor=ut(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=ut(this.tertiaryColor,this.darkMode),this.primaryTextColor=ht(this.primaryColor),this.secondaryTextColor=ht(this.secondaryColor),this.tertiaryTextColor=ht(this.tertiaryColor),this.lineColor=ht(this.background),this.textColor=ht(this.background),this.mainBkg="#1f2020",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=at(ht("#323D47"),10),this.lineColor="calculated",this.border1="#ccc",this.border2=Q(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=st("#EAE8D9",30),this.altSectionBkgColor="calculated",this.sectionBkgColor2="#EAE8D9",this.excludeBkgColor=st(this.sectionBkgColor,10),this.taskBorderColor=Q(255,255,255,70),this.taskBkgColor="calculated",this.taskTextColor="calculated",this.taskTextLightColor="calculated",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor=Q(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.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="calculated",this.errorBkgColor="#a44141",this.errorTextColor="#ddd"}updateColors(){this.secondBkg=at(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=at(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=at(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=lt(this.primaryColor,{h:64}),this.fillType3=lt(this.secondaryColor,{h:64}),this.fillType4=lt(this.primaryColor,{h:-64}),this.fillType5=lt(this.secondaryColor,{h:-64}),this.fillType6=lt(this.primaryColor,{h:128}),this.fillType7=lt(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||lt(this.primaryColor,{h:30}),this.cScale4=this.cScale4||lt(this.primaryColor,{h:60}),this.cScale5=this.cScale5||lt(this.primaryColor,{h:90}),this.cScale6=this.cScale6||lt(this.primaryColor,{h:120}),this.cScale7=this.cScale7||lt(this.primaryColor,{h:150}),this.cScale8=this.cScale8||lt(this.primaryColor,{h:210}),this.cScale9=this.cScale9||lt(this.primaryColor,{h:270}),this.cScale10=this.cScale10||lt(this.primaryColor,{h:300}),this.cScale11=this.cScale11||lt(this.primaryColor,{h:330});for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleInv"+t]=this["cScaleInv"+t]||ht(this["cScale"+t]);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScalePeer"+t]=this["cScalePeer"+t]||at(this["cScale"+t],10);for(let t=0;t<5;t++)this["surface"+t]=this["surface"+t]||lt(this.mainBkg,{h:30,s:-30,l:-(4*t-10)}),this["surfacePeer"+t]=this["surfacePeer"+t]||lt(this.mainBkg,{h:30,s:-30,l:-(4*t-7)});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||lt(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||lt(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||lt(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||lt(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||lt(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||lt(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||rt(this.quadrant1Fill)?at(this.quadrant1Fill):st(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.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?st(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=at(this.secondaryColor,20),this.git1=at(this.pie2||this.secondaryColor,20),this.git2=at(this.pie3||this.tertiaryColor,20),this.git3=at(this.pie4||lt(this.primaryColor,{h:-30}),20),this.git4=at(this.pie5||lt(this.primaryColor,{h:-60}),20),this.git5=at(this.pie6||lt(this.primaryColor,{h:-90}),10),this.git6=at(this.pie7||lt(this.primaryColor,{h:60}),10),this.git7=at(this.pie8||lt(this.primaryColor,{h:120}),20),this.gitInv0=this.gitInv0||ht(this.git0),this.gitInv1=this.gitInv1||ht(this.git1),this.gitInv2=this.gitInv2||ht(this.git2),this.gitInv3=this.gitInv3||ht(this.git3),this.gitInv4=this.gitInv4||ht(this.git4),this.gitInv5=this.gitInv5||ht(this.git5),this.gitInv6=this.gitInv6||ht(this.git6),this.gitInv7=this.gitInv7||ht(this.git7),this.gitBranchLabel0=this.gitBranchLabel0||ht(this.labelTextColor),this.gitBranchLabel1=this.gitBranchLabel1||this.labelTextColor,this.gitBranchLabel2=this.gitBranchLabel2||this.labelTextColor,this.gitBranchLabel3=this.gitBranchLabel3||ht(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||at(this.background,12),this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||at(this.background,2),this.nodeBorder=this.nodeBorder||"#999"}calculate(t){if("object"!=typeof t)return void this.updateColors();const e=Object.keys(t);e.forEach((e=>{this[e]=t[e]})),this.updateColors(),e.forEach((e=>{this[e]=t[e]}))}},ft=s((t=>{const e=new gt;return e.calculate(t),e}),"getThemeVariables"),mt=class{static{s(this,"Theme")}constructor(){this.background="#f4f4f4",this.primaryColor="#ECECFF",this.secondaryColor=lt(this.primaryColor,{h:120}),this.secondaryColor="#ffffde",this.tertiaryColor=lt(this.primaryColor,{h:-160}),this.primaryBorderColor=ut(this.primaryColor,this.darkMode),this.secondaryBorderColor=ut(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=ut(this.tertiaryColor,this.darkMode),this.primaryTextColor=ht(this.primaryColor),this.secondaryTextColor=ht(this.secondaryColor),this.tertiaryTextColor=ht(this.tertiaryColor),this.lineColor=ht(this.background),this.textColor=ht(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.sectionBkgColor=Q(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.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",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||lt(this.primaryColor,{h:30}),this.cScale4=this.cScale4||lt(this.primaryColor,{h:60}),this.cScale5=this.cScale5||lt(this.primaryColor,{h:90}),this.cScale6=this.cScale6||lt(this.primaryColor,{h:120}),this.cScale7=this.cScale7||lt(this.primaryColor,{h:150}),this.cScale8=this.cScale8||lt(this.primaryColor,{h:210}),this.cScale9=this.cScale9||lt(this.primaryColor,{h:270}),this.cScale10=this.cScale10||lt(this.primaryColor,{h:300}),this.cScale11=this.cScale11||lt(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||st(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||st(this.tertiaryColor,40);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScale"+t]=st(this["cScale"+t],10),this["cScalePeer"+t]=this["cScalePeer"+t]||st(this["cScale"+t],25);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleInv"+t]=this["cScaleInv"+t]||lt(this["cScale"+t],{h:180});for(let t=0;t<5;t++)this["surface"+t]=this["surface"+t]||lt(this.mainBkg,{h:30,l:-(5+5*t)}),this["surfacePeer"+t]=this["surfacePeer"+t]||lt(this.mainBkg,{h:30,l:-(7+5*t)});if(this.scaleLabelColor="calculated"!==this.scaleLabelColor&&this.scaleLabelColor?this.scaleLabelColor:this.labelTextColor,"calculated"!==this.labelTextColor){this.cScaleLabel0=this.cScaleLabel0||ht(this.labelTextColor),this.cScaleLabel3=this.cScaleLabel3||ht(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=at(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.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=lt(this.primaryColor,{h:64}),this.fillType3=lt(this.secondaryColor,{h:64}),this.fillType4=lt(this.primaryColor,{h:-64}),this.fillType5=lt(this.secondaryColor,{h:-64}),this.fillType6=lt(this.primaryColor,{h:128}),this.fillType7=lt(this.secondaryColor,{h:128}),this.pie1=this.pie1||this.primaryColor,this.pie2=this.pie2||this.secondaryColor,this.pie3=this.pie3||lt(this.tertiaryColor,{l:-40}),this.pie4=this.pie4||lt(this.primaryColor,{l:-10}),this.pie5=this.pie5||lt(this.secondaryColor,{l:-30}),this.pie6=this.pie6||lt(this.tertiaryColor,{l:-20}),this.pie7=this.pie7||lt(this.primaryColor,{h:60,l:-20}),this.pie8=this.pie8||lt(this.primaryColor,{h:-60,l:-40}),this.pie9=this.pie9||lt(this.primaryColor,{h:120,l:-40}),this.pie10=this.pie10||lt(this.primaryColor,{h:60,l:-40}),this.pie11=this.pie11||lt(this.primaryColor,{h:-90,l:-40}),this.pie12=this.pie12||lt(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||lt(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||lt(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||lt(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||lt(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||lt(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||lt(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||rt(this.quadrant1Fill)?at(this.quadrant1Fill):st(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||"#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||lt(this.primaryColor,{h:-30}),this.git4=this.git4||lt(this.primaryColor,{h:-60}),this.git5=this.git5||lt(this.primaryColor,{h:-90}),this.git6=this.git6||lt(this.primaryColor,{h:60}),this.git7=this.git7||lt(this.primaryColor,{h:120}),this.darkMode?(this.git0=at(this.git0,25),this.git1=at(this.git1,25),this.git2=at(this.git2,25),this.git3=at(this.git3,25),this.git4=at(this.git4,25),this.git5=at(this.git5,25),this.git6=at(this.git6,25),this.git7=at(this.git7,25)):(this.git0=st(this.git0,25),this.git1=st(this.git1,25),this.git2=st(this.git2,25),this.git3=st(this.git3,25),this.git4=st(this.git4,25),this.git5=st(this.git5,25),this.git6=st(this.git6,25),this.git7=st(this.git7,25)),this.gitInv0=this.gitInv0||st(ht(this.git0),25),this.gitInv1=this.gitInv1||ht(this.git1),this.gitInv2=this.gitInv2||ht(this.git2),this.gitInv3=this.gitInv3||ht(this.git3),this.gitInv4=this.gitInv4||ht(this.git4),this.gitInv5=this.gitInv5||ht(this.git5),this.gitInv6=this.gitInv6||ht(this.git6),this.gitInv7=this.gitInv7||ht(this.git7),this.gitBranchLabel0=this.gitBranchLabel0||ht(this.labelTextColor),this.gitBranchLabel1=this.gitBranchLabel1||this.labelTextColor,this.gitBranchLabel2=this.gitBranchLabel2||this.labelTextColor,this.gitBranchLabel3=this.gitBranchLabel3||ht(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||"#ffffff",this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||"#f2f2f2"}calculate(t){if("object"!=typeof t)return void this.updateColors();const e=Object.keys(t);e.forEach((e=>{this[e]=t[e]})),this.updateColors(),e.forEach((e=>{this[e]=t[e]}))}},yt=s((t=>{const e=new mt;return e.calculate(t),e}),"getThemeVariables"),vt=class{static{s(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=at("#cde498",10),this.primaryBorderColor=ut(this.primaryColor,this.darkMode),this.secondaryBorderColor=ut(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=ut(this.tertiaryColor,this.darkMode),this.primaryTextColor=ht(this.primaryColor),this.secondaryTextColor=ht(this.secondaryColor),this.tertiaryTextColor=ht(this.primaryColor),this.lineColor=ht(this.background),this.textColor=ht(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.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=st(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||lt(this.primaryColor,{h:30}),this.cScale4=this.cScale4||lt(this.primaryColor,{h:60}),this.cScale5=this.cScale5||lt(this.primaryColor,{h:90}),this.cScale6=this.cScale6||lt(this.primaryColor,{h:120}),this.cScale7=this.cScale7||lt(this.primaryColor,{h:150}),this.cScale8=this.cScale8||lt(this.primaryColor,{h:210}),this.cScale9=this.cScale9||lt(this.primaryColor,{h:270}),this.cScale10=this.cScale10||lt(this.primaryColor,{h:300}),this.cScale11=this.cScale11||lt(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||st(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||st(this.tertiaryColor,40);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScale"+t]=st(this["cScale"+t],10),this["cScalePeer"+t]=this["cScalePeer"+t]||st(this["cScale"+t],25);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleInv"+t]=this["cScaleInv"+t]||lt(this["cScale"+t],{h:180});this.scaleLabelColor="calculated"!==this.scaleLabelColor&&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]||lt(this.mainBkg,{h:30,s:-30,l:-(5+5*t)}),this["surfacePeer"+t]=this["surfacePeer"+t]||lt(this.mainBkg,{h:30,s:-30,l:-(8+5*t)});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.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=lt(this.primaryColor,{h:64}),this.fillType3=lt(this.secondaryColor,{h:64}),this.fillType4=lt(this.primaryColor,{h:-64}),this.fillType5=lt(this.secondaryColor,{h:-64}),this.fillType6=lt(this.primaryColor,{h:128}),this.fillType7=lt(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||lt(this.primaryColor,{l:-30}),this.pie5=this.pie5||lt(this.secondaryColor,{l:-30}),this.pie6=this.pie6||lt(this.tertiaryColor,{h:40,l:-40}),this.pie7=this.pie7||lt(this.primaryColor,{h:60,l:-10}),this.pie8=this.pie8||lt(this.primaryColor,{h:-60,l:-10}),this.pie9=this.pie9||lt(this.primaryColor,{h:120,l:0}),this.pie10=this.pie10||lt(this.primaryColor,{h:60,l:-50}),this.pie11=this.pie11||lt(this.primaryColor,{h:-60,l:-50}),this.pie12=this.pie12||lt(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||lt(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||lt(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||lt(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||lt(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||lt(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||lt(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||rt(this.quadrant1Fill)?at(this.quadrant1Fill):st(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.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||lt(this.primaryColor,{h:-30}),this.git4=this.git4||lt(this.primaryColor,{h:-60}),this.git5=this.git5||lt(this.primaryColor,{h:-90}),this.git6=this.git6||lt(this.primaryColor,{h:60}),this.git7=this.git7||lt(this.primaryColor,{h:120}),this.darkMode?(this.git0=at(this.git0,25),this.git1=at(this.git1,25),this.git2=at(this.git2,25),this.git3=at(this.git3,25),this.git4=at(this.git4,25),this.git5=at(this.git5,25),this.git6=at(this.git6,25),this.git7=at(this.git7,25)):(this.git0=st(this.git0,25),this.git1=st(this.git1,25),this.git2=st(this.git2,25),this.git3=st(this.git3,25),this.git4=st(this.git4,25),this.git5=st(this.git5,25),this.git6=st(this.git6,25),this.git7=st(this.git7,25)),this.gitInv0=this.gitInv0||ht(this.git0),this.gitInv1=this.gitInv1||ht(this.git1),this.gitInv2=this.gitInv2||ht(this.git2),this.gitInv3=this.gitInv3||ht(this.git3),this.gitInv4=this.gitInv4||ht(this.git4),this.gitInv5=this.gitInv5||ht(this.git5),this.gitInv6=this.gitInv6||ht(this.git6),this.gitInv7=this.gitInv7||ht(this.git7),this.gitBranchLabel0=this.gitBranchLabel0||ht(this.labelTextColor),this.gitBranchLabel1=this.gitBranchLabel1||this.labelTextColor,this.gitBranchLabel2=this.gitBranchLabel2||this.labelTextColor,this.gitBranchLabel3=this.gitBranchLabel3||ht(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||"#ffffff",this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||"#f2f2f2"}calculate(t){if("object"!=typeof t)return void this.updateColors();const e=Object.keys(t);e.forEach((e=>{this[e]=t[e]})),this.updateColors(),e.forEach((e=>{this[e]=t[e]}))}},xt=s((t=>{const e=new vt;return e.calculate(t),e}),"getThemeVariables"),bt=class{static{s(this,"Theme")}constructor(){this.primaryColor="#eee",this.contrast="#707070",this.secondaryColor=at(this.contrast,55),this.background="#ffffff",this.tertiaryColor=lt(this.primaryColor,{h:-160}),this.primaryBorderColor=ut(this.primaryColor,this.darkMode),this.secondaryBorderColor=ut(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=ut(this.tertiaryColor,this.darkMode),this.primaryTextColor=ht(this.primaryColor),this.secondaryTextColor=ht(this.secondaryColor),this.tertiaryTextColor=ht(this.tertiaryColor),this.lineColor=ht(this.background),this.textColor=ht(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.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.secondBkg=at(this.contrast,55),this.border2=this.contrast,this.actorBorder=at(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]||ht(this["cScale"+t]);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this.darkMode?this["cScalePeer"+t]=this["cScalePeer"+t]||at(this["cScale"+t],10):this["cScalePeer"+t]=this["cScalePeer"+t]||st(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]||lt(this.mainBkg,{l:-(5+5*t)}),this["surfacePeer"+t]=this["surfacePeer"+t]||lt(this.mainBkg,{l:-(8+5*t)});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=at(this.contrast,30),this.sectionBkgColor2=at(this.contrast,30),this.taskBorderColor=st(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=at(this.border1,30),this.doneTaskBkgColor=this.done,this.doneTaskBorderColor=this.lineColor,this.critBkgColor=this.critical,this.critBorderColor=st(this.critBkgColor,10),this.todayLineColor=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=lt(this.primaryColor,{h:64}),this.fillType3=lt(this.secondaryColor,{h:64}),this.fillType4=lt(this.primaryColor,{h:-64}),this.fillType5=lt(this.secondaryColor,{h:-64}),this.fillType6=lt(this.primaryColor,{h:128}),this.fillType7=lt(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||lt(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||lt(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||lt(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||lt(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||lt(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||lt(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||rt(this.quadrant1Fill)?at(this.quadrant1Fill):st(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.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=st(this.pie1,25)||this.primaryColor,this.git1=this.pie2||this.secondaryColor,this.git2=this.pie3||this.tertiaryColor,this.git3=this.pie4||lt(this.primaryColor,{h:-30}),this.git4=this.pie5||lt(this.primaryColor,{h:-60}),this.git5=this.pie6||lt(this.primaryColor,{h:-90}),this.git6=this.pie7||lt(this.primaryColor,{h:60}),this.git7=this.pie8||lt(this.primaryColor,{h:120}),this.gitInv0=this.gitInv0||ht(this.git0),this.gitInv1=this.gitInv1||ht(this.git1),this.gitInv2=this.gitInv2||ht(this.git2),this.gitInv3=this.gitInv3||ht(this.git3),this.gitInv4=this.gitInv4||ht(this.git4),this.gitInv5=this.gitInv5||ht(this.git5),this.gitInv6=this.gitInv6||ht(this.git6),this.gitInv7=this.gitInv7||ht(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||"#ffffff",this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||"#f2f2f2"}calculate(t){if("object"!=typeof t)return void this.updateColors();const e=Object.keys(t);e.forEach((e=>{this[e]=t[e]})),this.updateColors(),e.forEach((e=>{this[e]=t[e]}))}},wt={base:{getThemeVariables:pt},dark:{getThemeVariables:ft},default:{getThemeVariables:yt},forest:{getThemeVariables:xt},neutral:{getThemeVariables:s((t=>{const e=new bt;return e.calculate(t),e}),"getThemeVariables")}},kt={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},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,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"]},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,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,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},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},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},Tt={...kt,deterministicIDSeed:void 0,elk:{mergeEdges:!1,nodePlacementStrategy:"BRANDES_KOEPF"},themeCSS:void 0,themeVariables:wt.default.getThemeVariables(),sequence:{...kt.sequence,messageFont:s((function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}}),"messageFont"),noteFont:s((function(){return{fontFamily:this.noteFontFamily,fontSize:this.noteFontSize,fontWeight:this.noteFontWeight}}),"noteFont"),actorFont:s((function(){return{fontFamily:this.actorFontFamily,fontSize:this.actorFontSize,fontWeight:this.actorFontWeight}}),"actorFont")},class:{hideEmptyMembersBox:!1},gantt:{...kt.gantt,tickInterval:void 0,useWidth:void 0},c4:{...kt.c4,useWidth:void 0,personFont:s((function(){return{fontFamily:this.personFontFamily,fontSize:this.personFontSize,fontWeight:this.personFontWeight}}),"personFont"),external_personFont:s((function(){return{fontFamily:this.external_personFontFamily,fontSize:this.external_personFontSize,fontWeight:this.external_personFontWeight}}),"external_personFont"),systemFont:s((function(){return{fontFamily:this.systemFontFamily,fontSize:this.systemFontSize,fontWeight:this.systemFontWeight}}),"systemFont"),external_systemFont:s((function(){return{fontFamily:this.external_systemFontFamily,fontSize:this.external_systemFontSize,fontWeight:this.external_systemFontWeight}}),"external_systemFont"),system_dbFont:s((function(){return{fontFamily:this.system_dbFontFamily,fontSize:this.system_dbFontSize,fontWeight:this.system_dbFontWeight}}),"system_dbFont"),external_system_dbFont:s((function(){return{fontFamily:this.external_system_dbFontFamily,fontSize:this.external_system_dbFontSize,fontWeight:this.external_system_dbFontWeight}}),"external_system_dbFont"),system_queueFont:s((function(){return{fontFamily:this.system_queueFontFamily,fontSize:this.system_queueFontSize,fontWeight:this.system_queueFontWeight}}),"system_queueFont"),external_system_queueFont:s((function(){return{fontFamily:this.external_system_queueFontFamily,fontSize:this.external_system_queueFontSize,fontWeight:this.external_system_queueFontWeight}}),"external_system_queueFont"),containerFont:s((function(){return{fontFamily:this.containerFontFamily,fontSize:this.containerFontSize,fontWeight:this.containerFontWeight}}),"containerFont"),external_containerFont:s((function(){return{fontFamily:this.external_containerFontFamily,fontSize:this.external_containerFontSize,fontWeight:this.external_containerFontWeight}}),"external_containerFont"),container_dbFont:s((function(){return{fontFamily:this.container_dbFontFamily,fontSize:this.container_dbFontSize,fontWeight:this.container_dbFontWeight}}),"container_dbFont"),external_container_dbFont:s((function(){return{fontFamily:this.external_container_dbFontFamily,fontSize:this.external_container_dbFontSize,fontWeight:this.external_container_dbFontWeight}}),"external_container_dbFont"),container_queueFont:s((function(){return{fontFamily:this.container_queueFontFamily,fontSize:this.container_queueFontSize,fontWeight:this.container_queueFontWeight}}),"container_queueFont"),external_container_queueFont:s((function(){return{fontFamily:this.external_container_queueFontFamily,fontSize:this.external_container_queueFontSize,fontWeight:this.external_container_queueFontWeight}}),"external_container_queueFont"),componentFont:s((function(){return{fontFamily:this.componentFontFamily,fontSize:this.componentFontSize,fontWeight:this.componentFontWeight}}),"componentFont"),external_componentFont:s((function(){return{fontFamily:this.external_componentFontFamily,fontSize:this.external_componentFontSize,fontWeight:this.external_componentFontWeight}}),"external_componentFont"),component_dbFont:s((function(){return{fontFamily:this.component_dbFontFamily,fontSize:this.component_dbFontSize,fontWeight:this.component_dbFontWeight}}),"component_dbFont"),external_component_dbFont:s((function(){return{fontFamily:this.external_component_dbFontFamily,fontSize:this.external_component_dbFontSize,fontWeight:this.external_component_dbFontWeight}}),"external_component_dbFont"),component_queueFont:s((function(){return{fontFamily:this.component_queueFontFamily,fontSize:this.component_queueFontSize,fontWeight:this.component_queueFontWeight}}),"component_queueFont"),external_component_queueFont:s((function(){return{fontFamily:this.external_component_queueFontFamily,fontSize:this.external_component_queueFontSize,fontWeight:this.external_component_queueFontWeight}}),"external_component_queueFont"),boundaryFont:s((function(){return{fontFamily:this.boundaryFontFamily,fontSize:this.boundaryFontSize,fontWeight:this.boundaryFontWeight}}),"boundaryFont"),messageFont:s((function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}}),"messageFont")},pie:{...kt.pie,useWidth:984},xyChart:{...kt.xyChart,useWidth:void 0},requirement:{...kt.requirement,useWidth:void 0},packet:{...kt.packet}},_t=s(((t,e="")=>Object.keys(t).reduce(((n,r)=>Array.isArray(t[r])?n:"object"==typeof t[r]&&null!==t[r]?[...n,e+r,..._t(t[r],"")]:[...n,e+r]),[])),"keyify"),Et=new Set(_t(Tt,"")),Ct=Tt,St=s((t=>{if(m.debug("sanitizeDirective called with",t),"object"==typeof t&&null!=t)if(Array.isArray(t))t.forEach((t=>St(t)));else{for(const e of Object.keys(t)){if(m.debug("Checking key",e),e.startsWith("__")||e.includes("proto")||e.includes("constr")||!Et.has(e)||null==t[e]){m.debug("sanitize deleting key: ",e),delete t[e];continue}if("object"==typeof t[e]){m.debug("sanitizing object",e),St(t[e]);continue}const n=["themeCSS","fontFamily","altFontFamily"];for(const r of n)e.includes(r)&&(m.debug("sanitizing css option",e),t[e]=At(t[e]))}if(t.themeVariables)for(const e of Object.keys(t.themeVariables)){const n=t.themeVariables[e];n?.match&&!n.match(/^[\d "#%(),.;A-Za-z]+$/)&&(t.themeVariables[e]="")}m.debug("After sanitization",t)}}),"sanitizeDirective"),At=s((t=>{let e=0,n=0;for(const r of t){if(e<n)return"{ /* ERROR: Unbalanced CSS */ }";"{"===r?e++:"}"===r&&n++}return e!==n?"{ /* ERROR: Unbalanced CSS */ }":t}),"sanitizeCss"),Lt=Object.freeze(Ct),Nt=L({},Lt),It=[],Mt=L({},Lt),Rt=s(((t,e)=>{let n=L({},t),r={};for(const t of e)zt(t),r=L(r,t);if(n=L(n,r),r.theme&&r.theme in wt){const t=L({},R),e=L(t.themeVariables||{},r.themeVariables);n.theme&&n.theme in wt&&(n.themeVariables=wt[n.theme].getThemeVariables(e))}return Wt(Mt=n),Mt}),"updateCurrentConfig"),Dt=s((t=>(Nt=L({},Lt),Nt=L(Nt,t),t.theme&&wt[t.theme]&&(Nt.themeVariables=wt[t.theme].getThemeVariables(t.themeVariables)),Rt(Nt,It),Nt)),"setSiteConfig"),Ot=s((t=>{R=L({},t)}),"saveConfigFromInitialize"),Pt=s((t=>(Nt=L(Nt,t),Rt(Nt,It),Nt)),"updateSiteConfig"),Bt=s((()=>L({},Nt)),"getSiteConfig"),$t=s((t=>(Wt(t),L(Mt,t),Ft())),"setConfig"),Ft=s((()=>L({},Mt)),"getConfig"),zt=s((t=>{t&&(["secure",...Nt.secure??[]].forEach((e=>{Object.hasOwn(t,e)&&(m.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=>{"string"==typeof t[e]&&(t[e].includes("<")||t[e].includes(">")||t[e].includes("url(data:"))&&delete t[e],"object"==typeof t[e]&&zt(t[e])})))}),"sanitize"),Ut=s((t=>{St(t),t.fontFamily&&!t.themeVariables?.fontFamily&&(t.themeVariables={...t.themeVariables,fontFamily:t.fontFamily}),It.push(t),Rt(Nt,It)}),"addDirective"),Gt=s(((t=Nt)=>{Rt(t,It=[])}),"reset"),qt={LAZY_LOAD_DEPRECATED:"The configuration options lazyLoadedDiagrams and loadExternalDiagramsAtStartup are deprecated. Please use registerExternalDiagrams instead."},jt={},Yt=s((t=>{jt[t]||(m.warn(qt[t]),jt[t]=!0)}),"issueWarning"),Wt=s((t=>{t&&(t.lazyLoadedDiagrams||t.loadExternalDiagramsAtStartup)&&Yt("LAZY_LOAD_DEPRECATED")}),"checkConfig"),{entries:Ht,setPrototypeOf:Vt,isFrozen:Xt,getPrototypeOf:Kt,getOwnPropertyDescriptor:Zt}=Object,{freeze:Qt,seal:Jt,create:te}=Object,{apply:ee,construct:ne}="undefined"!=typeof Reflect&&Reflect;Qt||(Qt=s((function(t){return t}),"freeze")),Jt||(Jt=s((function(t){return t}),"seal")),ee||(ee=s((function(t,e,n){return t.apply(e,n)}),"apply")),ne||(ne=s((function(t,e){return new t(...e)}),"construct"));var re=fe(Array.prototype.forEach),ie=fe(Array.prototype.pop),ae=fe(Array.prototype.push),se=fe(String.prototype.toLowerCase),oe=fe(String.prototype.toString),le=fe(String.prototype.match),ce=fe(String.prototype.replace),he=fe(String.prototype.indexOf),ue=fe(String.prototype.trim),de=fe(Object.prototype.hasOwnProperty),pe=fe(RegExp.prototype.test),ge=me(TypeError);function fe(t){return function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return ee(t,e,r)}}function me(t){return function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return ne(t,n)}}function ye(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:se;Vt&&Vt(t,null);let r=e.length;for(;r--;){let i=e[r];if("string"==typeof i){const t=n(i);t!==i&&(Xt(e)||(e[r]=t),i=t)}t[i]=!0}return t}function ve(t){for(let e=0;e<t.length;e++){de(t,e)||(t[e]=null)}return t}function xe(t){const e=te(null);for(const[n,r]of Ht(t)){de(t,n)&&(Array.isArray(r)?e[n]=ve(r):r&&"object"==typeof r&&r.constructor===Object?e[n]=xe(r):e[n]=r)}return e}function be(t,e){for(;null!==t;){const n=Zt(t,e);if(n){if(n.get)return fe(n.get);if("function"==typeof n.value)return fe(n.value)}t=Kt(t)}function n(){return null}return s(n,"fallbackValue"),n}s(fe,"unapply"),s(me,"unconstruct"),s(ye,"addToSet"),s(ve,"cleanArray"),s(xe,"clone"),s(be,"lookupGetter");var we=Qt(["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","section","select","shadow","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"]),ke=Qt(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Te=Qt(["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"]),_e=Qt(["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"]),Ee=Qt(["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"]),Ce=Qt(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Se=Qt(["#text"]),Ae=Qt(["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","face","for","headers","height","hidden","high","href","hreflang","id","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","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),Le=Qt(["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","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"]),Ne=Qt(["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"]),Ie=Qt(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Me=Jt(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Re=Jt(/<%[\w\W]*|[\w\W]*%>/gm),De=Jt(/\${[\w\W]*}/gm),Oe=Jt(/^data-[\-\w.\u00B7-\uFFFF]/),Pe=Jt(/^aria-[\-\w]+$/),Be=Jt(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),$e=Jt(/^(?:\w+script|data):/i),Fe=Jt(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),ze=Jt(/^html$/i),Ue=Jt(/^[a-z][.\w]*(-[.\w]+)+$/i),Ge=Object.freeze({__proto__:null,ARIA_ATTR:Pe,ATTR_WHITESPACE:Fe,CUSTOM_ELEMENT:Ue,DATA_ATTR:Oe,DOCTYPE_NAME:ze,ERB_EXPR:Re,IS_ALLOWED_URI:Be,IS_SCRIPT_OR_DATA:$e,MUSTACHE_EXPR:Me,TMPLIT_EXPR:De}),qe=1,je=3,Ye=7,We=8,He=9,Ve=s((function(){return"undefined"==typeof window?null:window}),"getGlobal"),Xe=s((function(t,e){if("object"!=typeof t||"function"!=typeof t.createPolicy)return null;let n=null;const r="data-tt-policy-suffix";e&&e.hasAttribute(r)&&(n=e.getAttribute(r));const i="dompurify"+(n?"#"+n:"");try{return t.createPolicy(i,{createHTML:t=>t,createScriptURL:t=>t})}catch(t){return console.warn("TrustedTypes policy "+i+" could not be created."),null}}),"_createTrustedTypesPolicy");function Ke(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Ve();const e=s((t=>Ke(t)),"DOMPurify");if(e.version="3.2.1",e.removed=[],!t||!t.document||t.document.nodeType!==He)return e.isSupported=!1,e;let{document:n}=t;const r=n,i=r.currentScript,{DocumentFragment:a,HTMLTemplateElement:o,Node:l,Element:c,NodeFilter:h,NamedNodeMap:u=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:d,DOMParser:p,trustedTypes:g}=t,f=c.prototype,m=be(f,"cloneNode"),y=be(f,"remove"),v=be(f,"nextSibling"),x=be(f,"childNodes"),b=be(f,"parentNode");if("function"==typeof o){const t=n.createElement("template");t.content&&t.content.ownerDocument&&(n=t.content.ownerDocument)}let w,k="";const{implementation:T,createNodeIterator:_,createDocumentFragment:E,getElementsByTagName:C}=n,{importNode:S}=r;let A={};e.isSupported="function"==typeof Ht&&"function"==typeof b&&T&&void 0!==T.createHTMLDocument;const{MUSTACHE_EXPR:L,ERB_EXPR:N,TMPLIT_EXPR:I,DATA_ATTR:M,ARIA_ATTR:R,IS_SCRIPT_OR_DATA:D,ATTR_WHITESPACE:O,CUSTOM_ELEMENT:P}=Ge;let{IS_ALLOWED_URI:B}=Ge,$=null;const F=ye({},[...we,...ke,...Te,...Ee,...Se]);let z=null;const U=ye({},[...Ae,...Le,...Ne,...Ie]);let G=Object.seal(te(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}})),q=null,j=null,Y=!0,W=!0,H=!1,V=!0,X=!1,K=!0,Z=!1,Q=!1,J=!1,tt=!1,et=!1,nt=!1,rt=!0,it=!1;const at="user-content-";let st=!0,ot=!1,lt={},ct=null;const ht=ye({},["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 ut=null;const dt=ye({},["audio","video","img","source","image","track"]);let pt=null;const gt=ye({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),ft="http://www.w3.org/1998/Math/MathML",mt="http://www.w3.org/2000/svg",yt="http://www.w3.org/1999/xhtml";let vt=yt,xt=!1,bt=null;const wt=ye({},[ft,mt,yt],oe);let kt=ye({},["mi","mo","mn","ms","mtext"]),Tt=ye({},["annotation-xml"]);const _t=ye({},["title","style","font","a","script"]);let Et=null;const Ct=["application/xhtml+xml","text/html"],St="text/html";let At=null,Lt=null;const Nt=n.createElement("form"),It=s((function(t){return t instanceof RegExp||t instanceof Function}),"isRegexOrFunction"),Mt=s((function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!Lt||Lt!==t){if(t&&"object"==typeof t||(t={}),t=xe(t),Et=-1===Ct.indexOf(t.PARSER_MEDIA_TYPE)?St:t.PARSER_MEDIA_TYPE,At="application/xhtml+xml"===Et?oe:se,$=de(t,"ALLOWED_TAGS")?ye({},t.ALLOWED_TAGS,At):F,z=de(t,"ALLOWED_ATTR")?ye({},t.ALLOWED_ATTR,At):U,bt=de(t,"ALLOWED_NAMESPACES")?ye({},t.ALLOWED_NAMESPACES,oe):wt,pt=de(t,"ADD_URI_SAFE_ATTR")?ye(xe(gt),t.ADD_URI_SAFE_ATTR,At):gt,ut=de(t,"ADD_DATA_URI_TAGS")?ye(xe(dt),t.ADD_DATA_URI_TAGS,At):dt,ct=de(t,"FORBID_CONTENTS")?ye({},t.FORBID_CONTENTS,At):ht,q=de(t,"FORBID_TAGS")?ye({},t.FORBID_TAGS,At):{},j=de(t,"FORBID_ATTR")?ye({},t.FORBID_ATTR,At):{},lt=!!de(t,"USE_PROFILES")&&t.USE_PROFILES,Y=!1!==t.ALLOW_ARIA_ATTR,W=!1!==t.ALLOW_DATA_ATTR,H=t.ALLOW_UNKNOWN_PROTOCOLS||!1,V=!1!==t.ALLOW_SELF_CLOSE_IN_ATTR,X=t.SAFE_FOR_TEMPLATES||!1,K=!1!==t.SAFE_FOR_XML,Z=t.WHOLE_DOCUMENT||!1,tt=t.RETURN_DOM||!1,et=t.RETURN_DOM_FRAGMENT||!1,nt=t.RETURN_TRUSTED_TYPE||!1,J=t.FORCE_BODY||!1,rt=!1!==t.SANITIZE_DOM,it=t.SANITIZE_NAMED_PROPS||!1,st=!1!==t.KEEP_CONTENT,ot=t.IN_PLACE||!1,B=t.ALLOWED_URI_REGEXP||Be,vt=t.NAMESPACE||yt,kt=t.MATHML_TEXT_INTEGRATION_POINTS||kt,Tt=t.HTML_INTEGRATION_POINTS||Tt,G=t.CUSTOM_ELEMENT_HANDLING||{},t.CUSTOM_ELEMENT_HANDLING&&It(t.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(G.tagNameCheck=t.CUSTOM_ELEMENT_HANDLING.tagNameCheck),t.CUSTOM_ELEMENT_HANDLING&&It(t.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(G.attributeNameCheck=t.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),t.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof t.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(G.allowCustomizedBuiltInElements=t.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),X&&(W=!1),et&&(tt=!0),lt&&($=ye({},Se),z=[],!0===lt.html&&(ye($,we),ye(z,Ae)),!0===lt.svg&&(ye($,ke),ye(z,Le),ye(z,Ie)),!0===lt.svgFilters&&(ye($,Te),ye(z,Le),ye(z,Ie)),!0===lt.mathMl&&(ye($,Ee),ye(z,Ne),ye(z,Ie))),t.ADD_TAGS&&($===F&&($=xe($)),ye($,t.ADD_TAGS,At)),t.ADD_ATTR&&(z===U&&(z=xe(z)),ye(z,t.ADD_ATTR,At)),t.ADD_URI_SAFE_ATTR&&ye(pt,t.ADD_URI_SAFE_ATTR,At),t.FORBID_CONTENTS&&(ct===ht&&(ct=xe(ct)),ye(ct,t.FORBID_CONTENTS,At)),st&&($["#text"]=!0),Z&&ye($,["html","head","body"]),$.table&&(ye($,["tbody"]),delete q.tbody),t.TRUSTED_TYPES_POLICY){if("function"!=typeof t.TRUSTED_TYPES_POLICY.createHTML)throw ge('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof t.TRUSTED_TYPES_POLICY.createScriptURL)throw ge('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');w=t.TRUSTED_TYPES_POLICY,k=w.createHTML("")}else void 0===w&&(w=Xe(g,i)),null!==w&&"string"==typeof k&&(k=w.createHTML(""));Qt&&Qt(t),Lt=t}}),"_parseConfig"),Rt=ye({},[...ke,...Te,..._e]),Dt=ye({},[...Ee,...Ce]),Ot=s((function(t){let e=b(t);e&&e.tagName||(e={namespaceURI:vt,tagName:"template"});const n=se(t.tagName),r=se(e.tagName);return!!bt[t.namespaceURI]&&(t.namespaceURI===mt?e.namespaceURI===yt?"svg"===n:e.namespaceURI===ft?"svg"===n&&("annotation-xml"===r||kt[r]):Boolean(Rt[n]):t.namespaceURI===ft?e.namespaceURI===yt?"math"===n:e.namespaceURI===mt?"math"===n&&Tt[r]:Boolean(Dt[n]):t.namespaceURI===yt?!(e.namespaceURI===mt&&!Tt[r])&&(!(e.namespaceURI===ft&&!kt[r])&&(!Dt[n]&&(_t[n]||!Rt[n]))):!("application/xhtml+xml"!==Et||!bt[t.namespaceURI]))}),"_checkValidNamespace"),Pt=s((function(t){ae(e.removed,{element:t});try{b(t).removeChild(t)}catch(e){y(t)}}),"_forceRemove"),Bt=s((function(t,n){try{ae(e.removed,{attribute:n.getAttributeNode(t),from:n})}catch(t){ae(e.removed,{attribute:null,from:n})}if(n.removeAttribute(t),"is"===t&&!z[t])if(tt||et)try{Pt(n)}catch(t){}else try{n.setAttribute(t,"")}catch(t){}}),"_removeAttribute"),$t=s((function(t){let e=null,r=null;if(J)t="<remove></remove>"+t;else{const e=le(t,/^[\r\n\t ]+/);r=e&&e[0]}"application/xhtml+xml"===Et&&vt===yt&&(t='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+t+"</body></html>");const i=w?w.createHTML(t):t;if(vt===yt)try{e=(new p).parseFromString(i,Et)}catch(t){}if(!e||!e.documentElement){e=T.createDocument(vt,"template",null);try{e.documentElement.innerHTML=xt?k:i}catch(t){}}const a=e.body||e.documentElement;return t&&r&&a.insertBefore(n.createTextNode(r),a.childNodes[0]||null),vt===yt?C.call(e,Z?"html":"body")[0]:Z?e.documentElement:a}),"_initDocument"),Ft=s((function(t){return _.call(t.ownerDocument||t,t,h.SHOW_ELEMENT|h.SHOW_COMMENT|h.SHOW_TEXT|h.SHOW_PROCESSING_INSTRUCTION|h.SHOW_CDATA_SECTION,null)}),"_createNodeIterator"),zt=s((function(t){return t instanceof d&&("string"!=typeof t.nodeName||"string"!=typeof t.textContent||"function"!=typeof t.removeChild||!(t.attributes instanceof u)||"function"!=typeof t.removeAttribute||"function"!=typeof t.setAttribute||"string"!=typeof t.namespaceURI||"function"!=typeof t.insertBefore||"function"!=typeof t.hasChildNodes)}),"_isClobbered"),Ut=s((function(t){return"function"==typeof l&&t instanceof l}),"_isNode");function Gt(t,n,r){A[t]&&re(A[t],(t=>{t.call(e,n,r,Lt)}))}s(Gt,"_executeHook");const qt=s((function(t){let n=null;if(Gt("beforeSanitizeElements",t,null),zt(t))return Pt(t),!0;const r=At(t.nodeName);if(Gt("uponSanitizeElement",t,{tagName:r,allowedTags:$}),t.hasChildNodes()&&!Ut(t.firstElementChild)&&pe(/<[/\w]/g,t.innerHTML)&&pe(/<[/\w]/g,t.textContent))return Pt(t),!0;if(t.nodeType===Ye)return Pt(t),!0;if(K&&t.nodeType===We&&pe(/<[/\w]/g,t.data))return Pt(t),!0;if(!$[r]||q[r]){if(!q[r]&&Yt(r)){if(G.tagNameCheck instanceof RegExp&&pe(G.tagNameCheck,r))return!1;if(G.tagNameCheck instanceof Function&&G.tagNameCheck(r))return!1}if(st&&!ct[r]){const e=b(t)||t.parentNode,n=x(t)||t.childNodes;if(n&&e){for(let r=n.length-1;r>=0;--r){const i=m(n[r],!0);i.__removalCount=(t.__removalCount||0)+1,e.insertBefore(i,v(t))}}}return Pt(t),!0}return t instanceof c&&!Ot(t)?(Pt(t),!0):"noscript"!==r&&"noembed"!==r&&"noframes"!==r||!pe(/<\/no(script|embed|frames)/i,t.innerHTML)?(X&&t.nodeType===je&&(n=t.textContent,re([L,N,I],(t=>{n=ce(n,t," ")})),t.textContent!==n&&(ae(e.removed,{element:t.cloneNode()}),t.textContent=n)),Gt("afterSanitizeElements",t,null),!1):(Pt(t),!0)}),"_sanitizeElements"),jt=s((function(t,e,r){if(rt&&("id"===e||"name"===e)&&(r in n||r in Nt))return!1;if(W&&!j[e]&&pe(M,e));else if(Y&&pe(R,e));else if(!z[e]||j[e]){if(!(Yt(t)&&(G.tagNameCheck instanceof RegExp&&pe(G.tagNameCheck,t)||G.tagNameCheck instanceof Function&&G.tagNameCheck(t))&&(G.attributeNameCheck instanceof RegExp&&pe(G.attributeNameCheck,e)||G.attributeNameCheck instanceof Function&&G.attributeNameCheck(e))||"is"===e&&G.allowCustomizedBuiltInElements&&(G.tagNameCheck instanceof RegExp&&pe(G.tagNameCheck,r)||G.tagNameCheck instanceof Function&&G.tagNameCheck(r))))return!1}else if(pt[e]);else if(pe(B,ce(r,O,"")));else if("src"!==e&&"xlink:href"!==e&&"href"!==e||"script"===t||0!==he(r,"data:")||!ut[t]){if(H&&!pe(D,ce(r,O,"")));else if(r)return!1}else;return!0}),"_isValidAttribute"),Yt=s((function(t){return"annotation-xml"!==t&&le(t,P)}),"_isBasicCustomElement"),Wt=s((function(t){Gt("beforeSanitizeAttributes",t,null);const{attributes:n}=t;if(!n)return;const r={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:z,forceKeepAttr:void 0};let i=n.length;for(;i--;){const a=n[i],{name:s,namespaceURI:o,value:l}=a,c=At(s);let h="value"===s?l:ue(l);if(r.attrName=c,r.attrValue=h,r.keepAttr=!0,r.forceKeepAttr=void 0,Gt("uponSanitizeAttribute",t,r),h=r.attrValue,!it||"id"!==c&&"name"!==c||(Bt(s,t),h=at+h),K&&pe(/((--!?|])>)|<\/(style|title)/i,h)){Bt(s,t);continue}if(r.forceKeepAttr)continue;if(Bt(s,t),!r.keepAttr)continue;if(!V&&pe(/\/>/i,h)){Bt(s,t);continue}X&&re([L,N,I],(t=>{h=ce(h,t," ")}));const u=At(t.nodeName);if(jt(u,c,h)){if(w&&"object"==typeof g&&"function"==typeof g.getAttributeType)if(o);else switch(g.getAttributeType(u,c)){case"TrustedHTML":h=w.createHTML(h);break;case"TrustedScriptURL":h=w.createScriptURL(h)}try{o?t.setAttributeNS(o,s,h):t.setAttribute(s,h),zt(t)?Pt(t):ie(e.removed)}catch(t){}}}Gt("afterSanitizeAttributes",t,null)}),"_sanitizeAttributes"),Vt=s((function t(e){let n=null;const r=Ft(e);for(Gt("beforeSanitizeShadowDOM",e,null);n=r.nextNode();)Gt("uponSanitizeShadowNode",n,null),qt(n)||(n.content instanceof a&&t(n.content),Wt(n));Gt("afterSanitizeShadowDOM",e,null)}),"_sanitizeShadowDOM");return e.sanitize=function(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=null,s=null,o=null,c=null;if(xt=!t,xt&&(t="\x3c!--\x3e"),"string"!=typeof t&&!Ut(t)){if("function"!=typeof t.toString)throw ge("toString is not a function");if("string"!=typeof(t=t.toString()))throw ge("dirty is not a string, aborting")}if(!e.isSupported)return t;if(Q||Mt(n),e.removed=[],"string"==typeof t&&(ot=!1),ot){if(t.nodeName){const e=At(t.nodeName);if(!$[e]||q[e])throw ge("root node is forbidden and cannot be sanitized in-place")}}else if(t instanceof l)i=$t("\x3c!----\x3e"),s=i.ownerDocument.importNode(t,!0),s.nodeType===qe&&"BODY"===s.nodeName||"HTML"===s.nodeName?i=s:i.appendChild(s);else{if(!tt&&!X&&!Z&&-1===t.indexOf("<"))return w&&nt?w.createHTML(t):t;if(i=$t(t),!i)return tt?null:nt?k:""}i&&J&&Pt(i.firstChild);const h=Ft(ot?t:i);for(;o=h.nextNode();)qt(o)||(o.content instanceof a&&Vt(o.content),Wt(o));if(ot)return t;if(tt){if(et)for(c=E.call(i.ownerDocument);i.firstChild;)c.appendChild(i.firstChild);else c=i;return(z.shadowroot||z.shadowrootmode)&&(c=S.call(r,c,!0)),c}let u=Z?i.outerHTML:i.innerHTML;return Z&&$["!doctype"]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&pe(ze,i.ownerDocument.doctype.name)&&(u="<!DOCTYPE "+i.ownerDocument.doctype.name+">\n"+u),X&&re([L,N,I],(t=>{u=ce(u,t," ")})),w&&nt?w.createHTML(u):u},e.setConfig=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Mt(t),Q=!0},e.clearConfig=function(){Lt=null,Q=!1},e.isValidAttribute=function(t,e,n){Lt||Mt({});const r=At(t),i=At(e);return jt(r,i,n)},e.addHook=function(t,e){"function"==typeof e&&(A[t]=A[t]||[],ae(A[t],e))},e.removeHook=function(t){if(A[t])return ie(A[t])},e.removeHooks=function(t){A[t]&&(A[t]=[])},e.removeAllHooks=function(){A={}},e}s(Ke,"createDOMPurify");var Ze=Ke(),Qe=/<br\s*\/?>/gi,Je=s((t=>{if(!t)return[""];return hn(t).replace(/\\n/g,"#br#").split("#br#")}),"getRows"),tn=(()=>{let t=!1;return()=>{t||(en(),t=!0)}})();function en(){const t="data-temp-href-target";Ze.addHook("beforeSanitizeAttributes",(e=>{e instanceof Element&&"A"===e.tagName&&e.hasAttribute("target")&&e.setAttribute(t,e.getAttribute("target")??"")})),Ze.addHook("afterSanitizeAttributes",(e=>{e instanceof Element&&"A"===e.tagName&&e.hasAttribute(t)&&(e.setAttribute("target",e.getAttribute(t)??""),e.removeAttribute(t),"_blank"===e.getAttribute("target")&&e.setAttribute("rel","noopener"))}))}s(en,"setupDompurifyHooks");var nn=s((t=>{tn();return Ze.sanitize(t)}),"removeScript"),rn=s(((t,e)=>{if(!1!==e.flowchart?.htmlLabels){const n=e.securityLevel;"antiscript"===n||"strict"===n?t=nn(t):"loose"!==n&&(t=(t=(t=hn(t)).replace(/</g,"&lt;").replace(/>/g,"&gt;")).replace(/=/g,"&equals;"),t=cn(t))}return t}),"sanitizeMore"),an=s(((t,e)=>t?t=e.dompurifyConfig?Ze.sanitize(rn(t,e),e.dompurifyConfig).toString():Ze.sanitize(rn(t,e),{FORBID_TAGS:["style"]}).toString():t),"sanitizeText"),sn=s(((t,e)=>"string"==typeof t?an(t,e):t.flat().map((t=>an(t,e)))),"sanitizeTextOrArray"),on=s((t=>Qe.test(t)),"hasBreaks"),ln=s((t=>t.split(Qe)),"splitBreaks"),cn=s((t=>t.replace(/#br#/g,"<br/>")),"placeholderToBreak"),hn=s((t=>t.replace(Qe,"#br#")),"breakToPlaceholder"),un=s((t=>{let e="";return t&&(e=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,e=e.replaceAll(/\(/g,"\\("),e=e.replaceAll(/\)/g,"\\)")),e}),"getUrl"),dn=s((t=>!1!==t&&!["false","null","0"].includes(String(t).trim().toLowerCase())),"evaluate"),pn=s((function(...t){const e=t.filter((t=>!isNaN(t)));return Math.max(...e)}),"getMax"),gn=s((function(...t){const e=t.filter((t=>!isNaN(t)));return Math.min(...e)}),"getMin"),fn=s((function(t){const e=t.split(/(,)/),n=[];for(let t=0;t<e.length;t++){let r=e[t];if(","===r&&t>0&&t+1<e.length){const i=e[t-1],a=e[t+1];yn(i,a)&&(r=i+","+a,t++,n.pop())}n.push(vn(r))}return n.join("")}),"parseGenericTypes"),mn=s(((t,e)=>Math.max(0,t.split(e).length-1)),"countOccurrence"),yn=s(((t,e)=>{const n=mn(t,"~"),r=mn(e,"~");return 1===n&&1===r}),"shouldCombineSets"),vn=s((t=>{const e=mn(t,"~");let n=!1;if(e<=1)return t;e%2!=0&&t.startsWith("~")&&(t=t.substring(1),n=!0);const r=[...t];let i=r.indexOf("~"),a=r.lastIndexOf("~");for(;-1!==i&&-1!==a&&i!==a;)r[i]="<",r[a]=">",i=r.indexOf("~"),a=r.lastIndexOf("~");return n&&r.unshift("~"),r.join("")}),"processSet"),xn=s((()=>void 0!==window.MathMLElement),"isMathMLSupported"),bn=/\$\$(.*)\$\$/g,wn=s((t=>(t.match(bn)?.length??0)>0),"hasKatex"),kn=s((async(t,e)=>{t=await Tn(t,e);const n=document.createElement("div");n.innerHTML=t,n.id="katex-temp",n.style.visibility="hidden",n.style.position="absolute",n.style.top="0";document.querySelector("body")?.insertAdjacentElement("beforeend",n);const r={width:n.clientWidth,height:n.clientHeight};return n.remove(),r}),"calculateMathMLDimensions"),Tn=s((async(t,e)=>{if(!wn(t))return t;if(!(xn()||e.legacyMathML||e.forceLegacyMathML))return t.replace(bn,"MathML is unsupported in this environment.");const{default:n}=await Promise.resolve().then((function(){return TP})),r=e.forceLegacyMathML||!xn()&&e.legacyMathML?"htmlAndMathml":"mathml";return t.split(Qe).map((t=>wn(t)?`<div style="display: flex; align-items: center; justify-content: center; white-space: nowrap;">${t}</div>`:`<div>${t}</div>`)).join("").replace(bn,((t,e)=>n.renderToString(e,{throwOnError:!0,displayMode:!0,output:r}).replace(/\n/g," ").replace(/<annotation.*<\/annotation>/g,"")))}),"renderKatex"),_n={getRows:Je,sanitizeText:an,sanitizeTextOrArray:sn,hasBreaks:on,splitBreaks:ln,lineBreakRegex:Qe,removeScript:nn,getUrl:un,evaluate:dn,getMax:pn,getMin:gn},En=s((function(t,e){for(let n of e)t.attr(n[0],n[1])}),"d3Attrs"),Cn=s((function(t,e,n){let r=new Map;return n?(r.set("width","100%"),r.set("style",`max-width: ${e}px;`)):(r.set("height",t),r.set("width",e)),r}),"calculateSvgSizeAttrs"),Sn=s((function(t,e,n,r){const i=Cn(e,n,r);En(t,i)}),"configureSvgSize"),An=s((function(t,e,n,r){const i=e.node().getBBox(),a=i.width,s=i.height;m.info(`SVG bounds: ${a}x${s}`,i);let o=0,l=0;m.info(`Graph bounds: ${o}x${l}`,t),o=a+2*n,l=s+2*n,m.info(`Calculated bounds: ${o}x${l}`),Sn(e,l,o,r);const c=`${i.x-n} ${i.y-n} ${i.width+2*n} ${i.height+2*n}`;e.attr("viewBox",c)}),"setupGraphViewbox"),Ln={},Nn=s(((t,e,n)=>{let r="";return t in Ln&&Ln[t]?r=Ln[t](n):m.warn(`No theme found for ${t}`),` & {\n font-family: ${n.fontFamily};\n font-size: ${n.fontSize};\n fill: ${n.textColor}\n }\n\n /* Classes common for multiple diagrams */\n\n & .error-icon {\n fill: ${n.errorBkgColor};\n }\n & .error-text {\n fill: ${n.errorTextColor};\n stroke: ${n.errorTextColor};\n }\n\n & .edge-thickness-normal {\n stroke-width: 1px;\n }\n & .edge-thickness-thick {\n stroke-width: 3.5px\n }\n & .edge-pattern-solid {\n stroke-dasharray: 0;\n }\n & .edge-thickness-invisible {\n stroke-width: 0;\n fill: none;\n }\n & .edge-pattern-dashed{\n stroke-dasharray: 3;\n }\n .edge-pattern-dotted {\n stroke-dasharray: 2;\n }\n\n & .marker {\n fill: ${n.lineColor};\n stroke: ${n.lineColor};\n }\n & .marker.cross {\n stroke: ${n.lineColor};\n }\n\n & svg {\n font-family: ${n.fontFamily};\n font-size: ${n.fontSize};\n }\n & p {\n margin: 0\n }\n\n ${r}\n\n ${e}\n`}),"getStyles"),In=s(((t,e)=>{void 0!==e&&(Ln[t]=e)}),"addStylesForDiagram"),Mn=Nn,Rn={};l(Rn,{clear:()=>$n,getAccDescription:()=>Gn,getAccTitle:()=>zn,getDiagramTitle:()=>jn,setAccDescription:()=>Un,setAccTitle:()=>Fn,setDiagramTitle:()=>qn});var Dn="",On="",Pn="",Bn=s((t=>an(t,Ft())),"sanitizeText"),$n=s((()=>{Dn="",Pn="",On=""}),"clear"),Fn=s((t=>{Dn=Bn(t).replace(/^\s+/g,"")}),"setAccTitle"),zn=s((()=>Dn),"getAccTitle"),Un=s((t=>{Pn=Bn(t).replace(/\n\s+/g,"\n")}),"setAccDescription"),Gn=s((()=>Pn),"getAccDescription"),qn=s((t=>{On=Bn(t)}),"setDiagramTitle"),jn=s((()=>On),"getDiagramTitle"),Yn=m,Wn=y,Hn=Ft,Vn=$t,Xn=Lt,Kn=s((t=>an(t,Hn())),"sanitizeText"),Zn=An,Qn=s((()=>Rn),"getCommonDb"),Jn={},tr=s(((t,e,n)=>{Jn[t]&&Yn.warn(`Diagram with id ${t} already registered. Overwriting.`),Jn[t]=e,n&&C(t,n),In(t,e.styles),e.injectUtils?.(Yn,Wn,Hn,Kn,Zn,Qn(),(()=>{}))}),"registerDiagram"),er=s((t=>{if(t in Jn)return Jn[t];throw new nr(t)}),"getDiagram"),nr=class extends Error{static{s(this,"DiagramNotFoundError")}constructor(t){super(`Diagram ${t} not found.`)}};function rr(t,e){let n;if(void 0===e)for(const e of t)null!=e&&(n<e||void 0===n&&e>=e)&&(n=e);else{let r=-1;for(let i of t)null!=(i=e(i,++r,t))&&(n<i||void 0===n&&i>=i)&&(n=i)}return n}function ir(t,e){let n;if(void 0===e)for(const e of t)null!=e&&(n>e||void 0===n&&e>=e)&&(n=e);else{let r=-1;for(let i of t)null!=(i=e(i,++r,t))&&(n>i||void 0===n&&i>=i)&&(n=i)}return n}function ar(t,e){return null==t||null==e?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function sr(t,e){return null==t||null==e?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function or(t){let e,n,r;function i(t,r,i=0,a=t.length){if(i<a){if(0!==e(r,r))return a;do{const e=i+a>>>1;n(t[e],r)<0?i=e+1:a=e}while(i<a)}return i}function a(t,r,i=0,a=t.length){if(i<a){if(0!==e(r,r))return a;do{const e=i+a>>>1;n(t[e],r)<=0?i=e+1:a=e}while(i<a)}return i}function o(t,e,n=0,a=t.length){const s=i(t,e,n,a-1);return s>n&&r(t[s-1],e)>-r(t[s],e)?s-1:s}return 2!==t.length?(e=ar,n=s(((e,n)=>ar(t(e),n)),"compare2"),r=s(((e,n)=>t(e)-n),"delta")):(e=t===ar||t===sr?t:lr,n=t,r=t),s(i,"left"),s(a,"right"),s(o,"center"),{left:i,center:o,right:a}}function lr(){return 0}function cr(t){return null===t?NaN:+t}s(rr,"max"),s(ir,"min"),s(ar,"ascending"),s(sr,"descending"),s(or,"bisector"),s(lr,"zero"),s(cr,"number");var hr=or(ar),ur=hr.right;hr.left,or(cr).center;var dr=ur,pr=class extends Map{static{s(this,"InternMap")}constructor(t,e=yr){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:e}}),null!=t)for(const[e,n]of t)this.set(e,n)}get(t){return super.get(gr(this,t))}has(t){return super.has(gr(this,t))}set(t,e){return super.set(fr(this,t),e)}delete(t){return super.delete(mr(this,t))}};function gr({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):n}function fr({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):(t.set(r,n),n)}function mr({_intern:t,_key:e},n){const r=e(n);return t.has(r)&&(n=t.get(r),t.delete(r)),n}function yr(t){return null!==t&&"object"==typeof t?t.valueOf():t}s(gr,"intern_get"),s(fr,"intern_set"),s(mr,"intern_delete"),s(yr,"keyof");var vr=Math.sqrt(50),xr=Math.sqrt(10),br=Math.sqrt(2);function wr(t,e,n){const r=(e-t)/Math.max(0,n),i=Math.floor(Math.log10(r)),a=r/Math.pow(10,i),s=a>=vr?10:a>=xr?5:a>=br?2:1;let o,l,c;return i<0?(c=Math.pow(10,-i)/s,o=Math.round(t*c),l=Math.round(e*c),o/c<t&&++o,l/c>e&&--l,c=-c):(c=Math.pow(10,i)*s,o=Math.round(t/c),l=Math.round(e/c),o*c<t&&++o,l*c>e&&--l),l<o&&.5<=n&&n<2?wr(t,e,2*n):[o,l,c]}function kr(t,e,n){if(!((n=+n)>0))return[];if((t=+t)===(e=+e))return[t];const r=e<t,[i,a,s]=r?wr(e,t,n):wr(t,e,n);if(!(a>=i))return[];const o=a-i+1,l=new Array(o);if(r)if(s<0)for(let t=0;t<o;++t)l[t]=(a-t)/-s;else for(let t=0;t<o;++t)l[t]=(a-t)*s;else if(s<0)for(let t=0;t<o;++t)l[t]=(i+t)/-s;else for(let t=0;t<o;++t)l[t]=(i+t)*s;return l}function Tr(t,e,n){return wr(t=+t,e=+e,n=+n)[2]}function _r(t,e,n){n=+n;const r=(e=+e)<(t=+t),i=r?Tr(e,t,n):Tr(t,e,n);return(r?-1:1)*(i<0?1/-i:i)}function Er(t,e,n){t=+t,e=+e,n=(i=arguments.length)<2?(e=t,t=0,1):i<3?1:+n;for(var r=-1,i=0|Math.max(0,Math.ceil((e-t)/n)),a=new Array(i);++r<i;)a[r]=t+r*n;return a}function Cr(t){return t}s(wr,"tickSpec"),s(kr,"ticks"),s(Tr,"tickIncrement"),s(_r,"tickStep"),s(Er,"range"),s(Cr,"default");function Sr(t){return"translate("+t+",0)"}function Ar(t){return"translate(0,"+t+")"}function Lr(t){return e=>+t(e)}function Nr(t,e){return e=Math.max(0,t.bandwidth()-2*e)/2,t.round()&&(e=Math.round(e)),n=>+t(n)+e}function Ir(){return!this.__axis}function Mr(t,e){var n=[],r=null,i=null,a=6,o=6,l=3,c="undefined"!=typeof window&&window.devicePixelRatio>1?0:.5,h=1===t||4===t?-1:1,u=4===t||2===t?"x":"y",d=1===t||3===t?Sr:Ar;function p(s){var p=null==r?e.ticks?e.ticks.apply(e,n):e.domain():r,g=null==i?e.tickFormat?e.tickFormat.apply(e,n):Cr:i,f=Math.max(a,0)+l,m=e.range(),y=+m[0]+c,v=+m[m.length-1]+c,x=(e.bandwidth?Nr:Lr)(e.copy(),c),b=s.selection?s.selection():s,w=b.selectAll(".domain").data([null]),k=b.selectAll(".tick").data(p,e).order(),T=k.exit(),_=k.enter().append("g").attr("class","tick"),E=k.select("line"),C=k.select("text");w=w.merge(w.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),k=k.merge(_),E=E.merge(_.append("line").attr("stroke","currentColor").attr(u+"2",h*a)),C=C.merge(_.append("text").attr("fill","currentColor").attr(u,h*f).attr("dy",1===t?"0em":3===t?"0.71em":"0.32em")),s!==b&&(w=w.transition(s),k=k.transition(s),E=E.transition(s),C=C.transition(s),T=T.transition(s).attr("opacity",1e-6).attr("transform",(function(t){return isFinite(t=x(t))?d(t+c):this.getAttribute("transform")})),_.attr("opacity",1e-6).attr("transform",(function(t){var e=this.parentNode.__axis;return d((e&&isFinite(e=e(t))?e:x(t))+c)}))),T.remove(),w.attr("d",4===t||2===t?o?"M"+h*o+","+y+"H"+c+"V"+v+"H"+h*o:"M"+c+","+y+"V"+v:o?"M"+y+","+h*o+"V"+c+"H"+v+"V"+h*o:"M"+y+","+c+"H"+v),k.attr("opacity",1).attr("transform",(function(t){return d(x(t)+c)})),E.attr(u+"2",h*a),C.attr(u,h*f).text(g),b.filter(Ir).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",2===t?"start":4===t?"end":"middle"),b.each((function(){this.__axis=x}))}return s(p,"axis"),p.scale=function(t){return arguments.length?(e=t,p):e},p.ticks=function(){return n=Array.from(arguments),p},p.tickArguments=function(t){return arguments.length?(n=null==t?[]:Array.from(t),p):n.slice()},p.tickValues=function(t){return arguments.length?(r=null==t?null:Array.from(t),p):r&&r.slice()},p.tickFormat=function(t){return arguments.length?(i=t,p):i},p.tickSize=function(t){return arguments.length?(a=o=+t,p):a},p.tickSizeInner=function(t){return arguments.length?(a=+t,p):a},p.tickSizeOuter=function(t){return arguments.length?(o=+t,p):o},p.tickPadding=function(t){return arguments.length?(l=+t,p):l},p.offset=function(t){return arguments.length?(c=+t,p):c},p}function Rr(t){return Mr(1,t)}function Dr(t){return Mr(3,t)}function Or(){}function Pr(t){return null==t?Or:function(){return this.querySelector(t)}}function Br(t){"function"!=typeof t&&(t=Pr(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var a,s,o=e[i],l=o.length,c=r[i]=new Array(l),h=0;h<l;++h)(a=o[h])&&(s=t.call(a,a.__data__,h,o))&&("__data__"in a&&(s.__data__=a.__data__),c[h]=s);return new Ia(r,this._parents)}function $r(t){return null==t?[]:Array.isArray(t)?t:Array.from(t)}function Fr(){return[]}function zr(t){return null==t?Fr:function(){return this.querySelectorAll(t)}}function Ur(t){return function(){return $r(t.apply(this,arguments))}}function Gr(t){t="function"==typeof t?Ur(t):zr(t);for(var e=this._groups,n=e.length,r=[],i=[],a=0;a<n;++a)for(var s,o=e[a],l=o.length,c=0;c<l;++c)(s=o[c])&&(r.push(t.call(s,s.__data__,c,o)),i.push(s));return new Ia(r,i)}function qr(t){return function(){return this.matches(t)}}function jr(t){return function(e){return e.matches(t)}}s(Sr,"translateX"),s(Ar,"translateY"),s(Lr,"number"),s(Nr,"center"),s(Ir,"entering"),s(Mr,"axis"),s(Rr,"axisTop"),s(Dr,"axisBottom"),s(Or,"none"),s(Pr,"default"),s(Br,"default"),s($r,"array"),s(Fr,"empty"),s(zr,"default"),s(Ur,"arrayAll"),s(Gr,"default"),s(qr,"default"),s(jr,"childMatcher");var Yr=Array.prototype.find;function Wr(t){return function(){return Yr.call(this.children,t)}}function Hr(){return this.firstElementChild}function Vr(t){return this.select(null==t?Hr:Wr("function"==typeof t?t:jr(t)))}s(Wr,"childFind"),s(Hr,"childFirst"),s(Vr,"default");var Xr=Array.prototype.filter;function Kr(){return Array.from(this.children)}function Zr(t){return function(){return Xr.call(this.children,t)}}function Qr(t){return this.selectAll(null==t?Kr:Zr("function"==typeof t?t:jr(t)))}function Jr(t){"function"!=typeof t&&(t=qr(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var a,s=e[i],o=s.length,l=r[i]=[],c=0;c<o;++c)(a=s[c])&&t.call(a,a.__data__,c,s)&&l.push(a);return new Ia(r,this._parents)}function ti(t){return new Array(t.length)}function ei(){return new Ia(this._enter||this._groups.map(ti),this._parents)}function ni(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}function ri(t){return function(){return t}}function ii(t,e,n,r,i,a){for(var s,o=0,l=e.length,c=a.length;o<c;++o)(s=e[o])?(s.__data__=a[o],r[o]=s):n[o]=new ni(t,a[o]);for(;o<l;++o)(s=e[o])&&(i[o]=s)}function ai(t,e,n,r,i,a,s){var o,l,c,h=new Map,u=e.length,d=a.length,p=new Array(u);for(o=0;o<u;++o)(l=e[o])&&(p[o]=c=s.call(l,l.__data__,o,e)+"",h.has(c)?i[o]=l:h.set(c,l));for(o=0;o<d;++o)c=s.call(t,a[o],o,a)+"",(l=h.get(c))?(r[o]=l,l.__data__=a[o],h.delete(c)):n[o]=new ni(t,a[o]);for(o=0;o<u;++o)(l=e[o])&&h.get(p[o])===l&&(i[o]=l)}function si(t){return t.__data__}function oi(t,e){if(!arguments.length)return Array.from(this,si);var n=e?ai:ii,r=this._parents,i=this._groups;"function"!=typeof t&&(t=ri(t));for(var a=i.length,s=new Array(a),o=new Array(a),l=new Array(a),c=0;c<a;++c){var h=r[c],u=i[c],d=u.length,p=li(t.call(h,h&&h.__data__,c,r)),g=p.length,f=o[c]=new Array(g),m=s[c]=new Array(g),y=l[c]=new Array(d);n(h,u,f,m,y,p,e);for(var v,x,b=0,w=0;b<g;++b)if(v=f[b]){for(b>=w&&(w=b+1);!(x=m[w])&&++w<g;);v._next=x||null}}return(s=new Ia(s,r))._enter=o,s._exit=l,s}function li(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}function ci(){return new Ia(this._exit||this._groups.map(ti),this._parents)}function hi(t,e,n){var r=this.enter(),i=this,a=this.exit();return"function"==typeof t?(r=t(r))&&(r=r.selection()):r=r.append(t+""),null!=e&&(i=e(i))&&(i=i.selection()),null==n?a.remove():n(a),r&&i?r.merge(i).order():i}function ui(t){for(var e=t.selection?t.selection():t,n=this._groups,r=e._groups,i=n.length,a=r.length,s=Math.min(i,a),o=new Array(i),l=0;l<s;++l)for(var c,h=n[l],u=r[l],d=h.length,p=o[l]=new Array(d),g=0;g<d;++g)(c=h[g]||u[g])&&(p[g]=c);for(;l<i;++l)o[l]=n[l];return new Ia(o,this._parents)}function di(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var r,i=t[e],a=i.length-1,s=i[a];--a>=0;)(r=i[a])&&(s&&4^r.compareDocumentPosition(s)&&s.parentNode.insertBefore(r,s),s=r);return this}function pi(t){function e(e,n){return e&&n?t(e.__data__,n.__data__):!e-!n}t||(t=gi),s(e,"compareNode");for(var n=this._groups,r=n.length,i=new Array(r),a=0;a<r;++a){for(var o,l=n[a],c=l.length,h=i[a]=new Array(c),u=0;u<c;++u)(o=l[u])&&(h[u]=o);h.sort(e)}return new Ia(i,this._parents).order()}function gi(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function fi(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function mi(){return Array.from(this)}function yi(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],i=0,a=r.length;i<a;++i){var s=r[i];if(s)return s}return null}function vi(){let t=0;for(const e of this)++t;return t}function xi(){return!this.node()}function bi(t){for(var e=this._groups,n=0,r=e.length;n<r;++n)for(var i,a=e[n],s=0,o=a.length;s<o;++s)(i=a[s])&&t.call(i,i.__data__,s,a);return this}s(Kr,"children"),s(Zr,"childrenFilter"),s(Qr,"default"),s(Jr,"default"),s(ti,"default"),s(ei,"default"),s(ni,"EnterNode"),ni.prototype={constructor:ni,appendChild:s((function(t){return this._parent.insertBefore(t,this._next)}),"appendChild"),insertBefore:s((function(t,e){return this._parent.insertBefore(t,e)}),"insertBefore"),querySelector:s((function(t){return this._parent.querySelector(t)}),"querySelector"),querySelectorAll:s((function(t){return this._parent.querySelectorAll(t)}),"querySelectorAll")},s(ri,"default"),s(ii,"bindIndex"),s(ai,"bindKey"),s(si,"datum"),s(oi,"default"),s(li,"arraylike"),s(ci,"default"),s(hi,"default"),s(ui,"default"),s(di,"default"),s(pi,"default"),s(gi,"ascending"),s(fi,"default"),s(mi,"default"),s(yi,"default"),s(vi,"default"),s(xi,"default"),s(bi,"default");var wi="http://www.w3.org/1999/xhtml",ki={svg:"http://www.w3.org/2000/svg",xhtml:wi,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Ti(t){var e=t+="",n=e.indexOf(":");return n>=0&&"xmlns"!==(e=t.slice(0,n))&&(t=t.slice(n+1)),ki.hasOwnProperty(e)?{space:ki[e],local:t}:t}function _i(t){return function(){this.removeAttribute(t)}}function Ei(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Ci(t,e){return function(){this.setAttribute(t,e)}}function Si(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function Ai(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttribute(t):this.setAttribute(t,n)}}function Li(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}function Ni(t,e){var n=Ti(t);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((null==e?n.local?Ei:_i:"function"==typeof e?n.local?Li:Ai:n.local?Si:Ci)(n,e))}function Ii(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function Mi(t){return function(){this.style.removeProperty(t)}}function Ri(t,e,n){return function(){this.style.setProperty(t,e,n)}}function Di(t,e,n){return function(){var r=e.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,n)}}function Oi(t,e,n){return arguments.length>1?this.each((null==e?Mi:"function"==typeof e?Di:Ri)(t,e,null==n?"":n)):Pi(this.node(),t)}function Pi(t,e){return t.style.getPropertyValue(e)||Ii(t).getComputedStyle(t,null).getPropertyValue(e)}function Bi(t){return function(){delete this[t]}}function $i(t,e){return function(){this[t]=e}}function Fi(t,e){return function(){var n=e.apply(this,arguments);null==n?delete this[t]:this[t]=n}}function zi(t,e){return arguments.length>1?this.each((null==e?Bi:"function"==typeof e?Fi:$i)(t,e)):this.node()[t]}function Ui(t){return t.trim().split(/^|\s+/)}function Gi(t){return t.classList||new qi(t)}function qi(t){this._node=t,this._names=Ui(t.getAttribute("class")||"")}function ji(t,e){for(var n=Gi(t),r=-1,i=e.length;++r<i;)n.add(e[r])}function Yi(t,e){for(var n=Gi(t),r=-1,i=e.length;++r<i;)n.remove(e[r])}function Wi(t){return function(){ji(this,t)}}function Hi(t){return function(){Yi(this,t)}}function Vi(t,e){return function(){(e.apply(this,arguments)?ji:Yi)(this,t)}}function Xi(t,e){var n=Ui(t+"");if(arguments.length<2){for(var r=Gi(this.node()),i=-1,a=n.length;++i<a;)if(!r.contains(n[i]))return!1;return!0}return this.each(("function"==typeof e?Vi:e?Wi:Hi)(n,e))}function Ki(){this.textContent=""}function Zi(t){return function(){this.textContent=t}}function Qi(t){return function(){var e=t.apply(this,arguments);this.textContent=null==e?"":e}}function Ji(t){return arguments.length?this.each(null==t?Ki:("function"==typeof t?Qi:Zi)(t)):this.node().textContent}function ta(){this.innerHTML=""}function ea(t){return function(){this.innerHTML=t}}function na(t){return function(){var e=t.apply(this,arguments);this.innerHTML=null==e?"":e}}function ra(t){return arguments.length?this.each(null==t?ta:("function"==typeof t?na:ea)(t)):this.node().innerHTML}function ia(){this.nextSibling&&this.parentNode.appendChild(this)}function aa(){return this.each(ia)}function sa(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function oa(){return this.each(sa)}function la(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===wi&&e.documentElement.namespaceURI===wi?e.createElement(t):e.createElementNS(n,t)}}function ca(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function ha(t){var e=Ti(t);return(e.local?ca:la)(e)}function ua(t){var e="function"==typeof t?t:ha(t);return this.select((function(){return this.appendChild(e.apply(this,arguments))}))}function da(){return null}function pa(t,e){var n="function"==typeof t?t:ha(t),r=null==e?da:"function"==typeof e?e:Pr(e);return this.select((function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)}))}function ga(){var t=this.parentNode;t&&t.removeChild(this)}function fa(){return this.each(ga)}function ma(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function ya(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function va(t){return this.select(t?ya:ma)}function xa(t){return arguments.length?this.property("__data__",t):this.node().__data__}function ba(t){return function(e){t.call(this,e,this.__data__)}}function wa(t){return t.trim().split(/^|\s+/).map((function(t){var e="",n=t.indexOf(".");return n>=0&&(e=t.slice(n+1),t=t.slice(0,n)),{type:t,name:e}}))}function ka(t){return function(){var e=this.__on;if(e){for(var n,r=0,i=-1,a=e.length;r<a;++r)n=e[r],t.type&&n.type!==t.type||n.name!==t.name?e[++i]=n:this.removeEventListener(n.type,n.listener,n.options);++i?e.length=i:delete this.__on}}}function Ta(t,e,n){return function(){var r,i=this.__on,a=ba(e);if(i)for(var s=0,o=i.length;s<o;++s)if((r=i[s]).type===t.type&&r.name===t.name)return this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=a,r.options=n),void(r.value=e);this.addEventListener(t.type,a,n),r={type:t.type,name:t.name,value:e,listener:a,options:n},i?i.push(r):this.__on=[r]}}function _a(t,e,n){var r,i,a=wa(t+""),s=a.length;if(!(arguments.length<2)){for(o=e?Ta:ka,r=0;r<s;++r)this.each(o(a[r],e,n));return this}var o=this.node().__on;if(o)for(var l,c=0,h=o.length;c<h;++c)for(r=0,l=o[c];r<s;++r)if((i=a[r]).type===l.type&&i.name===l.name)return l.value}function Ea(t,e,n){var r=Ii(t),i=r.CustomEvent;"function"==typeof i?i=new i(e,n):(i=r.document.createEvent("Event"),n?(i.initEvent(e,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(e,!1,!1)),t.dispatchEvent(i)}function Ca(t,e){return function(){return Ea(this,t,e)}}function Sa(t,e){return function(){return Ea(this,t,e.apply(this,arguments))}}function Aa(t,e){return this.each(("function"==typeof e?Sa:Ca)(t,e))}function*La(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r,i=t[e],a=0,s=i.length;a<s;++a)(r=i[a])&&(yield r)}s(Ti,"default"),s(_i,"attrRemove"),s(Ei,"attrRemoveNS"),s(Ci,"attrConstant"),s(Si,"attrConstantNS"),s(Ai,"attrFunction"),s(Li,"attrFunctionNS"),s(Ni,"default"),s(Ii,"default"),s(Mi,"styleRemove"),s(Ri,"styleConstant"),s(Di,"styleFunction"),s(Oi,"default"),s(Pi,"styleValue"),s(Bi,"propertyRemove"),s($i,"propertyConstant"),s(Fi,"propertyFunction"),s(zi,"default"),s(Ui,"classArray"),s(Gi,"classList"),s(qi,"ClassList"),qi.prototype={add:s((function(t){this._names.indexOf(t)<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))}),"add"),remove:s((function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))}),"remove"),contains:s((function(t){return this._names.indexOf(t)>=0}),"contains")},s(ji,"classedAdd"),s(Yi,"classedRemove"),s(Wi,"classedTrue"),s(Hi,"classedFalse"),s(Vi,"classedFunction"),s(Xi,"default"),s(Ki,"textRemove"),s(Zi,"textConstant"),s(Qi,"textFunction"),s(Ji,"default"),s(ta,"htmlRemove"),s(ea,"htmlConstant"),s(na,"htmlFunction"),s(ra,"default"),s(ia,"raise"),s(aa,"default"),s(sa,"lower"),s(oa,"default"),s(la,"creatorInherit"),s(ca,"creatorFixed"),s(ha,"default"),s(ua,"default"),s(da,"constantNull"),s(pa,"default"),s(ga,"remove"),s(fa,"default"),s(ma,"selection_cloneShallow"),s(ya,"selection_cloneDeep"),s(va,"default"),s(xa,"default"),s(ba,"contextListener"),s(wa,"parseTypenames"),s(ka,"onRemove"),s(Ta,"onAdd"),s(_a,"default"),s(Ea,"dispatchEvent"),s(Ca,"dispatchConstant"),s(Sa,"dispatchFunction"),s(Aa,"default"),s(La,"default");var Na=[null];function Ia(t,e){this._groups=t,this._parents=e}function Ma(){return new Ia([[document.documentElement]],Na)}function Ra(){return this}s(Ia,"Selection"),s(Ma,"selection"),s(Ra,"selection_selection"),Ia.prototype=Ma.prototype={constructor:Ia,select:Br,selectAll:Gr,selectChild:Vr,selectChildren:Qr,filter:Jr,data:oi,enter:ei,exit:ci,join:hi,merge:ui,selection:Ra,order:di,sort:pi,call:fi,nodes:mi,node:yi,size:vi,empty:xi,each:bi,attr:Ni,style:Oi,property:zi,classed:Xi,text:Ji,html:ra,raise:aa,lower:oa,append:ua,insert:pa,remove:fa,clone:va,datum:xa,on:_a,dispatch:Aa,[Symbol.iterator]:La};var Da=Ma;function Oa(t){return"string"==typeof t?new Ia([[document.querySelector(t)]],[document.documentElement]):new Ia([[t]],Na)}function Pa(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function Ba(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function $a(){}s(Oa,"default"),s(Pa,"default"),s(Ba,"extend"),s($a,"Color");var Fa=1/.7,za="\\s*([+-]?\\d+)\\s*",Ua="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Ga="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",qa=/^#([0-9a-f]{3,8})$/,ja=new RegExp(`^rgb\\(${za},${za},${za}\\)$`),Ya=new RegExp(`^rgb\\(${Ga},${Ga},${Ga}\\)$`),Wa=new RegExp(`^rgba\\(${za},${za},${za},${Ua}\\)$`),Ha=new RegExp(`^rgba\\(${Ga},${Ga},${Ga},${Ua}\\)$`),Va=new RegExp(`^hsl\\(${Ua},${Ga},${Ga}\\)$`),Xa=new RegExp(`^hsla\\(${Ua},${Ga},${Ga},${Ua}\\)$`),Ka={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};function Za(){return this.rgb().formatHex()}function Qa(){return this.rgb().formatHex8()}function Ja(){return gs(this).formatHsl()}function ts(){return this.rgb().formatRgb()}function es(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=qa.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?ns(e):3===n?new ss(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?rs(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?rs(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=ja.exec(t))?new ss(e[1],e[2],e[3],1):(e=Ya.exec(t))?new ss(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=Wa.exec(t))?rs(e[1],e[2],e[3],e[4]):(e=Ha.exec(t))?rs(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=Va.exec(t))?ps(e[1],e[2]/100,e[3]/100,1):(e=Xa.exec(t))?ps(e[1],e[2]/100,e[3]/100,e[4]):Ka.hasOwnProperty(t)?ns(Ka[t]):"transparent"===t?new ss(NaN,NaN,NaN,0):null}function ns(t){return new ss(t>>16&255,t>>8&255,255&t,1)}function rs(t,e,n,r){return r<=0&&(t=e=n=NaN),new ss(t,e,n,r)}function is(t){return t instanceof $a||(t=es(t)),t?new ss((t=t.rgb()).r,t.g,t.b,t.opacity):new ss}function as(t,e,n,r){return 1===arguments.length?is(t):new ss(t,e,n,null==r?1:r)}function ss(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function os(){return`#${ds(this.r)}${ds(this.g)}${ds(this.b)}`}function ls(){return`#${ds(this.r)}${ds(this.g)}${ds(this.b)}${ds(255*(isNaN(this.opacity)?1:this.opacity))}`}function cs(){const t=hs(this.opacity);return`${1===t?"rgb(":"rgba("}${us(this.r)}, ${us(this.g)}, ${us(this.b)}${1===t?")":`, ${t})`}`}function hs(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function us(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function ds(t){return((t=us(t))<16?"0":"")+t.toString(16)}function ps(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new ms(t,e,n,r)}function gs(t){if(t instanceof ms)return new ms(t.h,t.s,t.l,t.opacity);if(t instanceof $a||(t=es(t)),!t)return new ms;if(t instanceof ms)return t;var e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),a=Math.max(e,n,r),s=NaN,o=a-i,l=(a+i)/2;return o?(s=e===a?(n-r)/o+6*(n<r):n===a?(r-e)/o+2:(e-n)/o+4,o/=l<.5?a+i:2-a-i,s*=60):o=l>0&&l<1?0:s,new ms(s,o,l,t.opacity)}function fs(t,e,n,r){return 1===arguments.length?gs(t):new ms(t,e,n,null==r?1:r)}function ms(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function ys(t){return(t=(t||0)%360)<0?t+360:t}function vs(t){return Math.max(0,Math.min(1,t||0))}function xs(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}Pa($a,es,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:Za,formatHex:Za,formatHex8:Qa,formatHsl:Ja,formatRgb:ts,toString:ts}),s(Za,"color_formatHex"),s(Qa,"color_formatHex8"),s(Ja,"color_formatHsl"),s(ts,"color_formatRgb"),s(es,"color"),s(ns,"rgbn"),s(rs,"rgba"),s(is,"rgbConvert"),s(as,"rgb"),s(ss,"Rgb"),Pa(ss,as,Ba($a,{brighter(t){return t=null==t?Fa:Math.pow(Fa,t),new ss(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?.7:Math.pow(.7,t),new ss(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new ss(us(this.r),us(this.g),us(this.b),hs(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:os,formatHex:os,formatHex8:ls,formatRgb:cs,toString:cs})),s(os,"rgb_formatHex"),s(ls,"rgb_formatHex8"),s(cs,"rgb_formatRgb"),s(hs,"clampa"),s(us,"clampi"),s(ds,"hex"),s(ps,"hsla"),s(gs,"hslConvert"),s(fs,"hsl"),s(ms,"Hsl"),Pa(ms,fs,Ba($a,{brighter(t){return t=null==t?Fa:Math.pow(Fa,t),new ms(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?.7:Math.pow(.7,t),new ms(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new ss(xs(t>=240?t-240:t+120,i,r),xs(t,i,r),xs(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new ms(ys(this.h),vs(this.s),vs(this.l),hs(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=hs(this.opacity);return`${1===t?"hsl(":"hsla("}${ys(this.h)}, ${100*vs(this.s)}%, ${100*vs(this.l)}%${1===t?")":`, ${t})`}`}})),s(ys,"clamph"),s(vs,"clampt"),s(xs,"hsl2rgb");var bs=Math.PI/180,ws=180/Math.PI,ks=4/29,Ts=6/29,_s=3*Ts*Ts;function Es(t){if(t instanceof Ss)return new Ss(t.l,t.a,t.b,t.opacity);if(t instanceof Ds)return Os(t);t instanceof ss||(t=is(t));var e,n,r=Is(t.r),i=Is(t.g),a=Is(t.b),s=As((.2225045*r+.7168786*i+.0606169*a)/1);return r===i&&i===a?e=n=s:(e=As((.4360747*r+.3850649*i+.1430804*a)/.96422),n=As((.0139322*r+.0971045*i+.7141733*a)/.82521)),new Ss(116*s-16,500*(e-s),200*(s-n),t.opacity)}function Cs(t,e,n,r){return 1===arguments.length?Es(t):new Ss(t,e,n,null==r?1:r)}function Ss(t,e,n,r){this.l=+t,this.a=+e,this.b=+n,this.opacity=+r}function As(t){return t>.008856451679035631?Math.pow(t,1/3):t/_s+ks}function Ls(t){return t>Ts?t*t*t:_s*(t-ks)}function Ns(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function Is(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Ms(t){if(t instanceof Ds)return new Ds(t.h,t.c,t.l,t.opacity);if(t instanceof Ss||(t=Es(t)),0===t.a&&0===t.b)return new Ds(NaN,0<t.l&&t.l<100?0:NaN,t.l,t.opacity);var e=Math.atan2(t.b,t.a)*ws;return new Ds(e<0?e+360:e,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}function Rs(t,e,n,r){return 1===arguments.length?Ms(t):new Ds(t,e,n,null==r?1:r)}function Ds(t,e,n,r){this.h=+t,this.c=+e,this.l=+n,this.opacity=+r}function Os(t){if(isNaN(t.h))return new Ss(t.l,0,0,t.opacity);var e=t.h*bs;return new Ss(t.l,Math.cos(e)*t.c,Math.sin(e)*t.c,t.opacity)}s(Es,"labConvert"),s(Cs,"lab"),s(Ss,"Lab"),Pa(Ss,Cs,Ba($a,{brighter(t){return new Ss(this.l+18*(null==t?1:t),this.a,this.b,this.opacity)},darker(t){return new Ss(this.l-18*(null==t?1:t),this.a,this.b,this.opacity)},rgb(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,n=isNaN(this.b)?t:t-this.b/200;return new ss(Ns(3.1338561*(e=.96422*Ls(e))-1.6168667*(t=1*Ls(t))-.4906146*(n=.82521*Ls(n))),Ns(-.9787684*e+1.9161415*t+.033454*n),Ns(.0719453*e-.2289914*t+1.4052427*n),this.opacity)}})),s(As,"xyz2lab"),s(Ls,"lab2xyz"),s(Ns,"lrgb2rgb"),s(Is,"rgb2lrgb"),s(Ms,"hclConvert"),s(Rs,"hcl"),s(Ds,"Hcl"),s(Os,"hcl2lab"),Pa(Ds,Rs,Ba($a,{brighter(t){return new Ds(this.h,this.c,this.l+18*(null==t?1:t),this.opacity)},darker(t){return new Ds(this.h,this.c,this.l-18*(null==t?1:t),this.opacity)},rgb(){return Os(this).rgb()}}));var Ps=s((t=>()=>t),"default");function Bs(t,e){return function(n){return t+n*e}}function $s(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}function Fs(t,e){var n=e-t;return n?Bs(t,n>180||n<-180?n-360*Math.round(n/360):n):Ps(isNaN(t)?e:t)}function zs(t){return 1==(t=+t)?Us:function(e,n){return n-e?$s(e,n,t):Ps(isNaN(e)?n:e)}}function Us(t,e){var n=e-t;return n?Bs(t,n):Ps(isNaN(t)?e:t)}function Gs(t){return function(e,n){var r=t((e=Rs(e)).h,(n=Rs(n)).h),i=Us(e.c,n.c),a=Us(e.l,n.l),s=Us(e.opacity,n.opacity);return function(t){return e.h=r(t),e.c=i(t),e.l=a(t),e.opacity=s(t),e+""}}}s(Bs,"linear"),s($s,"exponential"),s(Fs,"hue"),s(zs,"gamma"),s(Us,"nogamma"),s(Gs,"hcl");var qs=Gs(Fs);function js(t,e,n,r,i){var a=t*t,s=a*t;return((1-3*t+3*a-s)*e+(4-6*a+3*s)*n+(1+3*t+3*a-3*s)*r+s*i)/6}s(js,"basis"),s((function(t){var e=t.length-1;return function(n){var r=n<=0?n=0:n>=1?(n=1,e-1):Math.floor(n*e),i=t[r],a=t[r+1],s=r>0?t[r-1]:2*i-a,o=r<e-1?t[r+2]:2*a-i;return js((n-r/e)*e,s,i,a,o)}}),"default"),s((function(t){var e=t.length;return function(n){var r=Math.floor(((n%=1)<0?++n:n)*e),i=t[(r+e-1)%e],a=t[r%e],s=t[(r+1)%e],o=t[(r+2)%e];return js((n-r/e)*e,i,a,s,o)}}),"default");var Ys=s((function t(e){var n=zs(e);function r(t,e){var r=n((t=as(t)).r,(e=as(e)).r),i=n(t.g,e.g),a=n(t.b,e.b),s=Us(t.opacity,e.opacity);return function(e){return t.r=r(e),t.g=i(e),t.b=a(e),t.opacity=s(e),t+""}}return s(r,"rgb"),r.gamma=t,r}),"rgbGamma")(1);function Ws(t,e){e||(e=[]);var n,r=t?Math.min(e.length,t.length):0,i=e.slice();return function(a){for(n=0;n<r;++n)i[n]=t[n]*(1-a)+e[n]*a;return i}}function Hs(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function Vs(t,e){var n,r=e?e.length:0,i=t?Math.min(r,t.length):0,a=new Array(i),s=new Array(r);for(n=0;n<i;++n)a[n]=ro(t[n],e[n]);for(;n<r;++n)s[n]=e[n];return function(t){for(n=0;n<i;++n)s[n]=a[n](t);return s}}function Xs(t,e){var n=new Date;return t=+t,e=+e,function(r){return n.setTime(t*(1-r)+e*r),n}}function Ks(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}function Zs(t,e){var n,r={},i={};for(n in null!==t&&"object"==typeof t||(t={}),null!==e&&"object"==typeof e||(e={}),e)n in t?r[n]=ro(t[n],e[n]):i[n]=e[n];return function(t){for(n in r)i[n]=r[n](t);return i}}s((function(t){return function(e){var n,r,i=e.length,a=new Array(i),s=new Array(i),o=new Array(i);for(n=0;n<i;++n)r=as(e[n]),a[n]=r.r||0,s[n]=r.g||0,o[n]=r.b||0;return a=t(a),s=t(s),o=t(o),r.opacity=1,function(t){return r.r=a(t),r.g=s(t),r.b=o(t),r+""}}}),"rgbSpline"),s(Ws,"default"),s(Hs,"isNumberArray"),s(Vs,"genericArray"),s(Xs,"default"),s(Ks,"default"),s(Zs,"default");var Qs=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Js=new RegExp(Qs.source,"g");function to(t){return function(){return t}}function eo(t){return function(e){return t(e)+""}}function no(t,e){var n,r,i,a=Qs.lastIndex=Js.lastIndex=0,s=-1,o=[],l=[];for(t+="",e+="";(n=Qs.exec(t))&&(r=Js.exec(e));)(i=r.index)>a&&(i=e.slice(a,i),o[s]?o[s]+=i:o[++s]=i),(n=n[0])===(r=r[0])?o[s]?o[s]+=r:o[++s]=r:(o[++s]=null,l.push({i:s,x:Ks(n,r)})),a=Js.lastIndex;return a<e.length&&(i=e.slice(a),o[s]?o[s]+=i:o[++s]=i),o.length<2?l[0]?eo(l[0].x):to(e):(e=l.length,function(t){for(var n,r=0;r<e;++r)o[(n=l[r]).i]=n.x(t);return o.join("")})}function ro(t,e){var n,r=typeof e;return null==e||"boolean"===r?Ps(e):("number"===r?Ks:"string"===r?(n=es(e))?(e=n,Ys):no:e instanceof es?Ys:e instanceof Date?Xs:Hs(e)?Ws:Array.isArray(e)?Vs:"function"!=typeof e.valueOf&&"function"!=typeof e.toString||isNaN(e)?Zs:Ks)(t,e)}function io(t,e){return t=+t,e=+e,function(n){return Math.round(t*(1-n)+e*n)}}s(to,"zero"),s(eo,"one"),s(no,"default"),s(ro,"default"),s(io,"default");var ao,so=180/Math.PI,oo={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function lo(t,e,n,r,i,a){var s,o,l;return(s=Math.sqrt(t*t+e*e))&&(t/=s,e/=s),(l=t*n+e*r)&&(n-=t*l,r-=e*l),(o=Math.sqrt(n*n+r*r))&&(n/=o,r/=o,l/=o),t*r<e*n&&(t=-t,e=-e,l=-l,s=-s),{translateX:i,translateY:a,rotate:Math.atan2(e,t)*so,skewX:Math.atan(l)*so,scaleX:s,scaleY:o}}function co(t){const e=new("function"==typeof DOMMatrix?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?oo:lo(e.a,e.b,e.c,e.d,e.e,e.f)}function ho(t){return null==t?oo:(ao||(ao=document.createElementNS("http://www.w3.org/2000/svg","g")),ao.setAttribute("transform",t),(t=ao.transform.baseVal.consolidate())?lo((t=t.matrix).a,t.b,t.c,t.d,t.e,t.f):oo)}function uo(t,e,n,r){function i(t){return t.length?t.pop()+" ":""}function a(t,r,i,a,s,o){if(t!==i||r!==a){var l=s.push("translate(",null,e,null,n);o.push({i:l-4,x:Ks(t,i)},{i:l-2,x:Ks(r,a)})}else(i||a)&&s.push("translate("+i+e+a+n)}function o(t,e,n,a){t!==e?(t-e>180?e+=360:e-t>180&&(t+=360),a.push({i:n.push(i(n)+"rotate(",null,r)-2,x:Ks(t,e)})):e&&n.push(i(n)+"rotate("+e+r)}function l(t,e,n,a){t!==e?a.push({i:n.push(i(n)+"skewX(",null,r)-2,x:Ks(t,e)}):e&&n.push(i(n)+"skewX("+e+r)}function c(t,e,n,r,a,s){if(t!==n||e!==r){var o=a.push(i(a)+"scale(",null,",",null,")");s.push({i:o-4,x:Ks(t,n)},{i:o-2,x:Ks(e,r)})}else 1===n&&1===r||a.push(i(a)+"scale("+n+","+r+")")}return s(i,"pop"),s(a,"translate"),s(o,"rotate"),s(l,"skewX"),s(c,"scale"),function(e,n){var r=[],i=[];return e=t(e),n=t(n),a(e.translateX,e.translateY,n.translateX,n.translateY,r,i),o(e.rotate,n.rotate,r,i),l(e.skewX,n.skewX,r,i),c(e.scaleX,e.scaleY,n.scaleX,n.scaleY,r,i),e=n=null,function(t){for(var e,n=-1,a=i.length;++n<a;)r[(e=i[n]).i]=e.x(t);return r.join("")}}}s(lo,"default"),s(co,"parseCss"),s(ho,"parseSvg"),s(uo,"interpolateTransform");var po=uo(co,"px, ","px)","deg)"),go=uo(ho,", ",")",")");function fo(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t)}return this}s(fo,"initRange");var mo=Symbol("implicit");function yo(){var t=new pr,e=[],n=[],r=mo;function i(i){let a=t.get(i);if(void 0===a){if(r!==mo)return r;t.set(i,a=e.push(i)-1)}return n[a%n.length]}return s(i,"scale"),i.domain=function(n){if(!arguments.length)return e.slice();e=[],t=new pr;for(const r of n)t.has(r)||t.set(r,e.push(r)-1);return i},i.range=function(t){return arguments.length?(n=Array.from(t),i):n.slice()},i.unknown=function(t){return arguments.length?(r=t,i):r},i.copy=function(){return yo(e,n).unknown(r)},fo.apply(i,arguments),i}function vo(t){return function(){return t}}function xo(t){return+t}s(yo,"ordinal"),s(vo,"constants"),s(xo,"number");var bo=[0,1];function wo(t){return t}function ko(t,e){return(e-=t=+t)?function(n){return(n-t)/e}:vo(isNaN(e)?NaN:.5)}function To(t,e){var n;return t>e&&(n=t,t=e,e=n),function(n){return Math.max(t,Math.min(e,n))}}function _o(t,e,n){var r=t[0],i=t[1],a=e[0],s=e[1];return i<r?(r=ko(i,r),a=n(s,a)):(r=ko(r,i),a=n(a,s)),function(t){return a(r(t))}}function Eo(t,e,n){var r=Math.min(t.length,e.length)-1,i=new Array(r),a=new Array(r),s=-1;for(t[r]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++s<r;)i[s]=ko(t[s],t[s+1]),a[s]=n(e[s],e[s+1]);return function(e){var n=dr(t,e,1,r)-1;return a[n](i[n](e))}}function Co(t,e){return e.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown())}function So(){var t,e,n,r,i,a,o=bo,l=bo,c=ro,h=wo;function u(){var t=Math.min(o.length,l.length);return h!==wo&&(h=To(o[0],o[t-1])),r=t>2?Eo:_o,i=a=null,d}function d(e){return null==e||isNaN(e=+e)?n:(i||(i=r(o.map(t),l,c)))(t(h(e)))}return s(u,"rescale"),s(d,"scale"),d.invert=function(n){return h(e((a||(a=r(l,o.map(t),Ks)))(n)))},d.domain=function(t){return arguments.length?(o=Array.from(t,xo),u()):o.slice()},d.range=function(t){return arguments.length?(l=Array.from(t),u()):l.slice()},d.rangeRound=function(t){return l=Array.from(t),c=io,u()},d.clamp=function(t){return arguments.length?(h=!!t||wo,u()):h!==wo},d.interpolate=function(t){return arguments.length?(c=t,u()):c},d.unknown=function(t){return arguments.length?(n=t,d):n},function(n,r){return t=n,e=r,u()}}function Ao(){return So()(wo,wo)}function Lo(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function No(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var n,r=t.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+t.slice(n+1)]}function Io(t){return(t=No(Math.abs(t)))?t[1]:NaN}function Mo(t,e){return function(n,r){for(var i=n.length,a=[],s=0,o=t[0],l=0;i>0&&o>0&&(l+o+1>r&&(o=Math.max(1,r-l)),a.push(n.substring(i-=o,i+o)),!((l+=o+1)>r));)o=t[s=(s+1)%t.length];return a.reverse().join(e)}}function Ro(t){return function(e){return e.replace(/[0-9]/g,(function(e){return t[+e]}))}}s(wo,"identity"),s(ko,"normalize"),s(To,"clamper"),s(_o,"bimap"),s(Eo,"polymap"),s(Co,"copy"),s(So,"transformer"),s(Ao,"continuous"),s(Lo,"default"),s(No,"formatDecimalParts"),s(Io,"default"),s(Mo,"default"),s(Ro,"default");var Do,Oo=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Po(t){if(!(e=Oo.exec(t)))throw new Error("invalid format: "+t);var e;return new Bo({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]})}function Bo(t){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}function $o(t){t:for(var e,n=t.length,r=1,i=-1;r<n;++r)switch(t[r]){case".":i=e=r;break;case"0":0===i&&(i=r),e=r;break;default:if(!+t[r])break t;i>0&&(i=0)}return i>0?t.slice(0,i)+t.slice(e+1):t}function Fo(t,e){var n=No(t,e);if(!n)return t+"";var r=n[0],i=n[1],a=i-(Do=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,s=r.length;return a===s?r:a>s?r+new Array(a-s+1).join("0"):a>0?r.slice(0,a)+"."+r.slice(a):"0."+new Array(1-a).join("0")+No(t,Math.max(0,e+a-1))[0]}function zo(t,e){var n=No(t,e);if(!n)return t+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}s(Po,"formatSpecifier"),Po.prototype=Bo.prototype,s(Bo,"FormatSpecifier"),Bo.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type},s($o,"default"),s(Fo,"default"),s(zo,"default");var Uo={"%":s(((t,e)=>(100*t).toFixed(e)),"%"),b:s((t=>Math.round(t).toString(2)),"b"),c:s((t=>t+""),"c"),d:Lo,e:s(((t,e)=>t.toExponential(e)),"e"),f:s(((t,e)=>t.toFixed(e)),"f"),g:s(((t,e)=>t.toPrecision(e)),"g"),o:s((t=>Math.round(t).toString(8)),"o"),p:s(((t,e)=>zo(100*t,e)),"p"),r:zo,s:Fo,X:s((t=>Math.round(t).toString(16).toUpperCase()),"X"),x:s((t=>Math.round(t).toString(16)),"x")};function Go(t){return t}s(Go,"default");var qo,jo,Yo,Wo=Array.prototype.map,Ho=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Vo(t){var e=void 0===t.grouping||void 0===t.thousands?Go:Mo(Wo.call(t.grouping,Number),t.thousands+""),n=void 0===t.currency?"":t.currency[0]+"",r=void 0===t.currency?"":t.currency[1]+"",i=void 0===t.decimal?".":t.decimal+"",a=void 0===t.numerals?Go:Ro(Wo.call(t.numerals,String)),o=void 0===t.percent?"%":t.percent+"",l=void 0===t.minus?"−":t.minus+"",c=void 0===t.nan?"NaN":t.nan+"";function h(t){var h=(t=Po(t)).fill,u=t.align,d=t.sign,p=t.symbol,g=t.zero,f=t.width,m=t.comma,y=t.precision,v=t.trim,x=t.type;"n"===x?(m=!0,x="g"):Uo[x]||(void 0===y&&(y=12),v=!0,x="g"),(g||"0"===h&&"="===u)&&(g=!0,h="0",u="=");var b="$"===p?n:"#"===p&&/[boxX]/.test(x)?"0"+x.toLowerCase():"",w="$"===p?r:/[%p]/.test(x)?o:"",k=Uo[x],T=/[defgprs%]/.test(x);function _(t){var n,r,s,o=b,p=w;if("c"===x)p=k(t)+p,t="";else{var _=(t=+t)<0||1/t<0;if(t=isNaN(t)?c:k(Math.abs(t),y),v&&(t=$o(t)),_&&0==+t&&"+"!==d&&(_=!1),o=(_?"("===d?d:l:"-"===d||"("===d?"":d)+o,p=("s"===x?Ho[8+Do/3]:"")+p+(_&&"("===d?")":""),T)for(n=-1,r=t.length;++n<r;)if(48>(s=t.charCodeAt(n))||s>57){p=(46===s?i+t.slice(n+1):t.slice(n))+p,t=t.slice(0,n);break}}m&&!g&&(t=e(t,1/0));var E=o.length+t.length+p.length,C=E<f?new Array(f-E+1).join(h):"";switch(m&&g&&(t=e(C+t,C.length?f-p.length:1/0),C=""),u){case"<":t=o+t+p+C;break;case"=":t=o+C+t+p;break;case"^":t=C.slice(0,E=C.length>>1)+o+t+p+C.slice(E);break;default:t=C+o+t+p}return a(t)}return y=void 0===y?6:/[gprs]/.test(x)?Math.max(1,Math.min(21,y)):Math.max(0,Math.min(20,y)),s(_,"format"),_.toString=function(){return t+""},_}function u(t,e){var n=h(((t=Po(t)).type="f",t)),r=3*Math.max(-8,Math.min(8,Math.floor(Io(e)/3))),i=Math.pow(10,-r),a=Ho[8+r/3];return function(t){return n(i*t)+a}}return s(h,"newFormat"),s(u,"formatPrefix"),{format:h,formatPrefix:u}}function Xo(t){return qo=Vo(t),jo=qo.format,Yo=qo.formatPrefix,qo}function Ko(t){return Math.max(0,-Io(Math.abs(t)))}function Zo(t,e){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(Io(e)/3)))-Io(Math.abs(t)))}function Qo(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,Io(e)-Io(t))+1}function Jo(t,e,n,r){var i,a=_r(t,e,n);switch((r=Po(null==r?",f":r)).type){case"s":var s=Math.max(Math.abs(t),Math.abs(e));return null!=r.precision||isNaN(i=Zo(a,s))||(r.precision=i),Yo(r,s);case"":case"e":case"g":case"p":case"r":null!=r.precision||isNaN(i=Qo(a,Math.max(Math.abs(t),Math.abs(e))))||(r.precision=i-("e"===r.type));break;case"f":case"%":null!=r.precision||isNaN(i=Ko(a))||(r.precision=i-2*("%"===r.type))}return jo(r)}function tl(t){var e=t.domain;return t.ticks=function(t){var n=e();return kr(n[0],n[n.length-1],null==t?10:t)},t.tickFormat=function(t,n){var r=e();return Jo(r[0],r[r.length-1],null==t?10:t,n)},t.nice=function(n){null==n&&(n=10);var r,i,a=e(),s=0,o=a.length-1,l=a[s],c=a[o],h=10;for(c<l&&(i=l,l=c,c=i,i=s,s=o,o=i);h-- >0;){if((i=Tr(l,c,n))===r)return a[s]=l,a[o]=c,e(a);if(i>0)l=Math.floor(l/i)*i,c=Math.ceil(c/i)*i;else{if(!(i<0))break;l=Math.ceil(l*i)/i,c=Math.floor(c*i)/i}r=i}return t},t}function el(){var t=Ao();return t.copy=function(){return Co(t,el())},fo.apply(t,arguments),tl(t)}s(Vo,"default"),Xo({thousands:",",grouping:[3],currency:["$",""]}),s(Xo,"defaultLocale"),s(Ko,"default"),s(Zo,"default"),s(Qo,"default"),s(Jo,"tickFormat"),s(tl,"linearish"),s(el,"linear");var nl=new Date,rl=new Date;function il(t,e,n,r){function i(e){return t(e=0===arguments.length?new Date:new Date(+e)),e}return s(i,"interval"),i.floor=e=>(t(e=new Date(+e)),e),i.ceil=n=>(t(n=new Date(n-1)),e(n,1),t(n),n),i.round=t=>{const e=i(t),n=i.ceil(t);return t-e<n-t?e:n},i.offset=(t,n)=>(e(t=new Date(+t),null==n?1:Math.floor(n)),t),i.range=(n,r,a)=>{const s=[];if(n=i.ceil(n),a=null==a?1:Math.floor(a),!(n<r&&a>0))return s;let o;do{s.push(o=new Date(+n)),e(n,a),t(n)}while(o<n&&n<r);return s},i.filter=n=>il((e=>{if(e>=e)for(;t(e),!n(e);)e.setTime(e-1)}),((t,r)=>{if(t>=t)if(r<0)for(;++r<=0;)for(;e(t,-1),!n(t););else for(;--r>=0;)for(;e(t,1),!n(t););})),n&&(i.count=(e,r)=>(nl.setTime(+e),rl.setTime(+r),t(nl),t(rl),Math.floor(n(nl,rl))),i.every=t=>(t=Math.floor(t),isFinite(t)&&t>0?t>1?i.filter(r?e=>r(e)%t==0:e=>i.count(0,e)%t==0):i:null)),i}s(il,"timeInterval");var al=il((()=>{}),((t,e)=>{t.setTime(+t+e)}),((t,e)=>e-t));al.every=t=>(t=Math.floor(t),isFinite(t)&&t>0?t>1?il((e=>{e.setTime(Math.floor(e/t)*t)}),((e,n)=>{e.setTime(+e+n*t)}),((e,n)=>(n-e)/t)):al:null),al.range;var sl=il((t=>{t.setTime(t-t.getMilliseconds())}),((t,e)=>{t.setTime(+t+1e3*e)}),((t,e)=>(e-t)/1e3),(t=>t.getUTCSeconds()));sl.range;var ol=il((t=>{t.setTime(t-t.getMilliseconds()-1e3*t.getSeconds())}),((t,e)=>{t.setTime(+t+6e4*e)}),((t,e)=>(e-t)/6e4),(t=>t.getMinutes()));ol.range;var ll=il((t=>{t.setUTCSeconds(0,0)}),((t,e)=>{t.setTime(+t+6e4*e)}),((t,e)=>(e-t)/6e4),(t=>t.getUTCMinutes()));ll.range;var cl=il((t=>{t.setTime(t-t.getMilliseconds()-1e3*t.getSeconds()-6e4*t.getMinutes())}),((t,e)=>{t.setTime(+t+36e5*e)}),((t,e)=>(e-t)/36e5),(t=>t.getHours()));cl.range;var hl=il((t=>{t.setUTCMinutes(0,0,0)}),((t,e)=>{t.setTime(+t+36e5*e)}),((t,e)=>(e-t)/36e5),(t=>t.getUTCHours()));hl.range;var ul=il((t=>t.setHours(0,0,0,0)),((t,e)=>t.setDate(t.getDate()+e)),((t,e)=>(e-t-6e4*(e.getTimezoneOffset()-t.getTimezoneOffset()))/864e5),(t=>t.getDate()-1));ul.range;var dl=il((t=>{t.setUTCHours(0,0,0,0)}),((t,e)=>{t.setUTCDate(t.getUTCDate()+e)}),((t,e)=>(e-t)/864e5),(t=>t.getUTCDate()-1));dl.range;var pl=il((t=>{t.setUTCHours(0,0,0,0)}),((t,e)=>{t.setUTCDate(t.getUTCDate()+e)}),((t,e)=>(e-t)/864e5),(t=>Math.floor(t/864e5)));function gl(t){return il((e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)}),((t,e)=>{t.setDate(t.getDate()+7*e)}),((t,e)=>(e-t-6e4*(e.getTimezoneOffset()-t.getTimezoneOffset()))/6048e5))}pl.range,s(gl,"timeWeekday");var fl=gl(0),ml=gl(1),yl=gl(2),vl=gl(3),xl=gl(4),bl=gl(5),wl=gl(6);function kl(t){return il((e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)}),((t,e)=>{t.setUTCDate(t.getUTCDate()+7*e)}),((t,e)=>(e-t)/6048e5))}fl.range,ml.range,yl.range,vl.range,xl.range,bl.range,wl.range,s(kl,"utcWeekday");var Tl=kl(0),_l=kl(1),El=kl(2),Cl=kl(3),Sl=kl(4),Al=kl(5),Ll=kl(6);Tl.range,_l.range,El.range,Cl.range,Sl.range,Al.range,Ll.range;var Nl=il((t=>{t.setDate(1),t.setHours(0,0,0,0)}),((t,e)=>{t.setMonth(t.getMonth()+e)}),((t,e)=>e.getMonth()-t.getMonth()+12*(e.getFullYear()-t.getFullYear())),(t=>t.getMonth()));Nl.range;var Il=il((t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)}),((t,e)=>{t.setUTCMonth(t.getUTCMonth()+e)}),((t,e)=>e.getUTCMonth()-t.getUTCMonth()+12*(e.getUTCFullYear()-t.getUTCFullYear())),(t=>t.getUTCMonth()));Il.range;var Ml=il((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()));Ml.every=t=>isFinite(t=Math.floor(t))&&t>0?il((e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)}),((e,n)=>{e.setFullYear(e.getFullYear()+n*t)})):null,Ml.range;var Rl=il((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()));function Dl(t,e,n,r,i,a){const o=[[sl,1,1e3],[sl,5,5e3],[sl,15,15e3],[sl,30,3e4],[a,1,6e4],[a,5,3e5],[a,15,9e5],[a,30,18e5],[i,1,36e5],[i,3,108e5],[i,6,216e5],[i,12,432e5],[r,1,864e5],[r,2,1728e5],[n,1,6048e5],[e,1,2592e6],[e,3,7776e6],[t,1,31536e6]];function l(t,e,n){const r=e<t;r&&([t,e]=[e,t]);const i=n&&"function"==typeof n.range?n:c(t,e,n),a=i?i.range(t,+e+1):[];return r?a.reverse():a}function c(e,n,r){const i=Math.abs(n-e)/r,a=or((([,,t])=>t)).right(o,i);if(a===o.length)return t.every(_r(e/31536e6,n/31536e6,r));if(0===a)return al.every(Math.max(_r(e,n,r),1));const[s,l]=o[i/o[a-1][2]<o[a][2]/i?a-1:a];return s.every(l)}return s(l,"ticks"),s(c,"tickInterval"),[l,c]}Rl.every=t=>isFinite(t=Math.floor(t))&&t>0?il((e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),((e,n)=>{e.setUTCFullYear(e.getUTCFullYear()+n*t)})):null,Rl.range,s(Dl,"ticker"),Dl(Rl,Il,Tl,pl,hl,ll);var[Ol,Pl]=Dl(Ml,Nl,fl,ul,cl,ol);function Bl(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 $l(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 Fl(t,e,n){return{y:t,m:e,d:n,H:0,M:0,S:0,L:0}}function zl(t){var e=t.dateTime,n=t.date,r=t.time,i=t.periods,a=t.days,o=t.shortDays,l=t.months,c=t.shortMonths,h=Xl(i),u=Kl(i),d=Xl(a),p=Kl(a),g=Xl(o),f=Kl(o),m=Xl(l),y=Kl(l),v=Xl(c),x=Kl(c),b={a:D,A:O,b:P,B:B,c:null,d:yc,e:yc,f:kc,g:Rc,G:Oc,H:vc,I:xc,j:bc,L:wc,m:Tc,M:_c,p:$,q:F,Q:ih,s:ah,S:Ec,u:Cc,U:Sc,V:Lc,w:Nc,W:Ic,x:null,X:null,y:Mc,Y:Dc,Z:Pc,"%":rh},w={a:z,A:U,b:G,B:q,c:null,d:Bc,e:Bc,f:Gc,g:Jc,G:eh,H:$c,I:Fc,j:zc,L:Uc,m:qc,M:jc,p:j,q:Y,Q:ih,s:ah,S:Yc,u:Wc,U:Hc,V:Xc,w:Kc,W:Zc,x:null,X:null,y:Qc,Y:th,Z:nh,"%":rh},k={a:S,A:A,b:L,B:N,c:I,d:oc,e:oc,f:pc,g:rc,G:nc,H:cc,I:cc,j:lc,L:dc,m:sc,M:hc,p:C,q:ac,Q:fc,s:mc,S:uc,u:Ql,U:Jl,V:tc,w:Zl,W:ec,x:M,X:R,y:rc,Y:nc,Z:ic,"%":gc};function T(t,e){return function(n){var r,i,a,s=[],o=-1,l=0,c=t.length;for(n instanceof Date||(n=new Date(+n));++o<c;)37===t.charCodeAt(o)&&(s.push(t.slice(l,o)),null!=(i=ql[r=t.charAt(++o)])?r=t.charAt(++o):i="e"===r?" ":"0",(a=e[r])&&(r=a(n,i)),s.push(r),l=o+1);return s.push(t.slice(l,o)),s.join("")}}function _(t,e){return function(n){var r,i,a=Fl(1900,void 0,1);if(E(a,t,n+="",0)!=n.length)return null;if("Q"in a)return new Date(a.Q);if("s"in a)return new Date(1e3*a.s+("L"in a?a.L:0));if(e&&!("Z"in a)&&(a.Z=0),"p"in a&&(a.H=a.H%12+12*a.p),void 0===a.m&&(a.m="q"in a?a.q:0),"V"in a){if(a.V<1||a.V>53)return null;"w"in a||(a.w=1),"Z"in a?(i=(r=$l(Fl(a.y,0,1))).getUTCDay(),r=i>4||0===i?_l.ceil(r):_l(r),r=dl.offset(r,7*(a.V-1)),a.y=r.getUTCFullYear(),a.m=r.getUTCMonth(),a.d=r.getUTCDate()+(a.w+6)%7):(i=(r=Bl(Fl(a.y,0,1))).getDay(),r=i>4||0===i?ml.ceil(r):ml(r),r=ul.offset(r,7*(a.V-1)),a.y=r.getFullYear(),a.m=r.getMonth(),a.d=r.getDate()+(a.w+6)%7)}else("W"in a||"U"in a)&&("w"in a||(a.w="u"in a?a.u%7:"W"in a?1:0),i="Z"in a?$l(Fl(a.y,0,1)).getUTCDay():Bl(Fl(a.y,0,1)).getDay(),a.m=0,a.d="W"in a?(a.w+6)%7+7*a.W-(i+5)%7:a.w+7*a.U-(i+6)%7);return"Z"in a?(a.H+=a.Z/100|0,a.M+=a.Z%100,$l(a)):Bl(a)}}function E(t,e,n,r){for(var i,a,s=0,o=e.length,l=n.length;s<o;){if(r>=l)return-1;if(37===(i=e.charCodeAt(s++))){if(i=e.charAt(s++),!(a=k[i in ql?e.charAt(s++):i])||(r=a(t,n,r))<0)return-1}else if(i!=n.charCodeAt(r++))return-1}return r}function C(t,e,n){var r=h.exec(e.slice(n));return r?(t.p=u.get(r[0].toLowerCase()),n+r[0].length):-1}function S(t,e,n){var r=g.exec(e.slice(n));return r?(t.w=f.get(r[0].toLowerCase()),n+r[0].length):-1}function A(t,e,n){var r=d.exec(e.slice(n));return r?(t.w=p.get(r[0].toLowerCase()),n+r[0].length):-1}function L(t,e,n){var r=v.exec(e.slice(n));return r?(t.m=x.get(r[0].toLowerCase()),n+r[0].length):-1}function N(t,e,n){var r=m.exec(e.slice(n));return r?(t.m=y.get(r[0].toLowerCase()),n+r[0].length):-1}function I(t,n,r){return E(t,e,n,r)}function M(t,e,r){return E(t,n,e,r)}function R(t,e,n){return E(t,r,e,n)}function D(t){return o[t.getDay()]}function O(t){return a[t.getDay()]}function P(t){return c[t.getMonth()]}function B(t){return l[t.getMonth()]}function $(t){return i[+(t.getHours()>=12)]}function F(t){return 1+~~(t.getMonth()/3)}function z(t){return o[t.getUTCDay()]}function U(t){return a[t.getUTCDay()]}function G(t){return c[t.getUTCMonth()]}function q(t){return l[t.getUTCMonth()]}function j(t){return i[+(t.getUTCHours()>=12)]}function Y(t){return 1+~~(t.getUTCMonth()/3)}return b.x=T(n,b),b.X=T(r,b),b.c=T(e,b),w.x=T(n,w),w.X=T(r,w),w.c=T(e,w),s(T,"newFormat"),s(_,"newParse"),s(E,"parseSpecifier"),s(C,"parsePeriod"),s(S,"parseShortWeekday"),s(A,"parseWeekday"),s(L,"parseShortMonth"),s(N,"parseMonth"),s(I,"parseLocaleDateTime"),s(M,"parseLocaleDate"),s(R,"parseLocaleTime"),s(D,"formatShortWeekday"),s(O,"formatWeekday"),s(P,"formatShortMonth"),s(B,"formatMonth"),s($,"formatPeriod"),s(F,"formatQuarter"),s(z,"formatUTCShortWeekday"),s(U,"formatUTCWeekday"),s(G,"formatUTCShortMonth"),s(q,"formatUTCMonth"),s(j,"formatUTCPeriod"),s(Y,"formatUTCQuarter"),{format:s((function(t){var e=T(t+="",b);return e.toString=function(){return t},e}),"format"),parse:s((function(t){var e=_(t+="",!1);return e.toString=function(){return t},e}),"parse"),utcFormat:s((function(t){var e=T(t+="",w);return e.toString=function(){return t},e}),"utcFormat"),utcParse:s((function(t){var e=_(t+="",!0);return e.toString=function(){return t},e}),"utcParse")}}s(Bl,"localDate"),s($l,"utcDate"),s(Fl,"newDate"),s(zl,"formatLocale");var Ul,Gl,ql={"-":"",_:" ",0:"0"},jl=/^\s*\d+/,Yl=/^%/,Wl=/[\\^$*+?|[\]().{}]/g;function Hl(t,e,n){var r=t<0?"-":"",i=(r?-t:t)+"",a=i.length;return r+(a<n?new Array(n-a+1).join(e)+i:i)}function Vl(t){return t.replace(Wl,"\\$&")}function Xl(t){return new RegExp("^(?:"+t.map(Vl).join("|")+")","i")}function Kl(t){return new Map(t.map(((t,e)=>[t.toLowerCase(),e])))}function Zl(t,e,n){var r=jl.exec(e.slice(n,n+1));return r?(t.w=+r[0],n+r[0].length):-1}function Ql(t,e,n){var r=jl.exec(e.slice(n,n+1));return r?(t.u=+r[0],n+r[0].length):-1}function Jl(t,e,n){var r=jl.exec(e.slice(n,n+2));return r?(t.U=+r[0],n+r[0].length):-1}function tc(t,e,n){var r=jl.exec(e.slice(n,n+2));return r?(t.V=+r[0],n+r[0].length):-1}function ec(t,e,n){var r=jl.exec(e.slice(n,n+2));return r?(t.W=+r[0],n+r[0].length):-1}function nc(t,e,n){var r=jl.exec(e.slice(n,n+4));return r?(t.y=+r[0],n+r[0].length):-1}function rc(t,e,n){var r=jl.exec(e.slice(n,n+2));return r?(t.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function ic(t,e,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function ac(t,e,n){var r=jl.exec(e.slice(n,n+1));return r?(t.q=3*r[0]-3,n+r[0].length):-1}function sc(t,e,n){var r=jl.exec(e.slice(n,n+2));return r?(t.m=r[0]-1,n+r[0].length):-1}function oc(t,e,n){var r=jl.exec(e.slice(n,n+2));return r?(t.d=+r[0],n+r[0].length):-1}function lc(t,e,n){var r=jl.exec(e.slice(n,n+3));return r?(t.m=0,t.d=+r[0],n+r[0].length):-1}function cc(t,e,n){var r=jl.exec(e.slice(n,n+2));return r?(t.H=+r[0],n+r[0].length):-1}function hc(t,e,n){var r=jl.exec(e.slice(n,n+2));return r?(t.M=+r[0],n+r[0].length):-1}function uc(t,e,n){var r=jl.exec(e.slice(n,n+2));return r?(t.S=+r[0],n+r[0].length):-1}function dc(t,e,n){var r=jl.exec(e.slice(n,n+3));return r?(t.L=+r[0],n+r[0].length):-1}function pc(t,e,n){var r=jl.exec(e.slice(n,n+6));return r?(t.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function gc(t,e,n){var r=Yl.exec(e.slice(n,n+1));return r?n+r[0].length:-1}function fc(t,e,n){var r=jl.exec(e.slice(n));return r?(t.Q=+r[0],n+r[0].length):-1}function mc(t,e,n){var r=jl.exec(e.slice(n));return r?(t.s=+r[0],n+r[0].length):-1}function yc(t,e){return Hl(t.getDate(),e,2)}function vc(t,e){return Hl(t.getHours(),e,2)}function xc(t,e){return Hl(t.getHours()%12||12,e,2)}function bc(t,e){return Hl(1+ul.count(Ml(t),t),e,3)}function wc(t,e){return Hl(t.getMilliseconds(),e,3)}function kc(t,e){return wc(t,e)+"000"}function Tc(t,e){return Hl(t.getMonth()+1,e,2)}function _c(t,e){return Hl(t.getMinutes(),e,2)}function Ec(t,e){return Hl(t.getSeconds(),e,2)}function Cc(t){var e=t.getDay();return 0===e?7:e}function Sc(t,e){return Hl(fl.count(Ml(t)-1,t),e,2)}function Ac(t){var e=t.getDay();return e>=4||0===e?xl(t):xl.ceil(t)}function Lc(t,e){return t=Ac(t),Hl(xl.count(Ml(t),t)+(4===Ml(t).getDay()),e,2)}function Nc(t){return t.getDay()}function Ic(t,e){return Hl(ml.count(Ml(t)-1,t),e,2)}function Mc(t,e){return Hl(t.getFullYear()%100,e,2)}function Rc(t,e){return Hl((t=Ac(t)).getFullYear()%100,e,2)}function Dc(t,e){return Hl(t.getFullYear()%1e4,e,4)}function Oc(t,e){var n=t.getDay();return Hl((t=n>=4||0===n?xl(t):xl.ceil(t)).getFullYear()%1e4,e,4)}function Pc(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+Hl(e/60|0,"0",2)+Hl(e%60,"0",2)}function Bc(t,e){return Hl(t.getUTCDate(),e,2)}function $c(t,e){return Hl(t.getUTCHours(),e,2)}function Fc(t,e){return Hl(t.getUTCHours()%12||12,e,2)}function zc(t,e){return Hl(1+dl.count(Rl(t),t),e,3)}function Uc(t,e){return Hl(t.getUTCMilliseconds(),e,3)}function Gc(t,e){return Uc(t,e)+"000"}function qc(t,e){return Hl(t.getUTCMonth()+1,e,2)}function jc(t,e){return Hl(t.getUTCMinutes(),e,2)}function Yc(t,e){return Hl(t.getUTCSeconds(),e,2)}function Wc(t){var e=t.getUTCDay();return 0===e?7:e}function Hc(t,e){return Hl(Tl.count(Rl(t)-1,t),e,2)}function Vc(t){var e=t.getUTCDay();return e>=4||0===e?Sl(t):Sl.ceil(t)}function Xc(t,e){return t=Vc(t),Hl(Sl.count(Rl(t),t)+(4===Rl(t).getUTCDay()),e,2)}function Kc(t){return t.getUTCDay()}function Zc(t,e){return Hl(_l.count(Rl(t)-1,t),e,2)}function Qc(t,e){return Hl(t.getUTCFullYear()%100,e,2)}function Jc(t,e){return Hl((t=Vc(t)).getUTCFullYear()%100,e,2)}function th(t,e){return Hl(t.getUTCFullYear()%1e4,e,4)}function eh(t,e){var n=t.getUTCDay();return Hl((t=n>=4||0===n?Sl(t):Sl.ceil(t)).getUTCFullYear()%1e4,e,4)}function nh(){return"+0000"}function rh(){return"%"}function ih(t){return+t}function ah(t){return Math.floor(+t/1e3)}function sh(t){return Ul=zl(t),Gl=Ul.format,Ul.parse,Ul.utcFormat,Ul.utcParse,Ul}function oh(t,e){var n,r=0,i=(t=t.slice()).length-1,a=t[r],s=t[i];return s<a&&(n=r,r=i,i=n,n=a,a=s,s=n),t[r]=e.floor(a),t[i]=e.ceil(s),t}function lh(t){return new Date(t)}function ch(t){return t instanceof Date?+t:+new Date(+t)}function hh(t,e,n,r,i,a,o,l,c,h){var u=Ao(),d=u.invert,p=u.domain,g=h(".%L"),f=h(":%S"),m=h("%I:%M"),y=h("%I %p"),v=h("%a %d"),x=h("%b %d"),b=h("%B"),w=h("%Y");function k(t){return(c(t)<t?g:l(t)<t?f:o(t)<t?m:a(t)<t?y:r(t)<t?i(t)<t?v:x:n(t)<t?b:w)(t)}return s(k,"tickFormat"),u.invert=function(t){return new Date(d(t))},u.domain=function(t){return arguments.length?p(Array.from(t,ch)):p().map(lh)},u.ticks=function(e){var n=p();return t(n[0],n[n.length-1],null==e?10:e)},u.tickFormat=function(t,e){return null==e?k:h(e)},u.nice=function(t){var n=p();return t&&"function"==typeof t.range||(t=e(n[0],n[n.length-1],null==t?10:t)),t?p(oh(n,t)):u},u.copy=function(){return Co(u,hh(t,e,n,r,i,a,o,l,c,h))},u}function uh(){return fo.apply(hh(Ol,Pl,Ml,Nl,fl,ul,cl,ol,sl,Gl).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function dh(){var t,e,n=yo().unknown(void 0),r=n.domain,i=n.range,a=0,o=1,l=!1,c=0,h=0,u=.5;function d(){var n=r().length,s=o<a,d=s?o:a,p=s?a:o;t=(p-d)/Math.max(1,n-c+2*h),l&&(t=Math.floor(t)),d+=(p-d-t*(n-c))*u,e=t*(1-c),l&&(d=Math.round(d),e=Math.round(e));var g=Er(n).map((function(e){return d+t*e}));return i(s?g.reverse():g)}return delete n.unknown,s(d,"rescale"),n.domain=function(t){return arguments.length?(r(t),d()):r()},n.range=function(t){return arguments.length?([a,o]=t,a=+a,o=+o,d()):[a,o]},n.rangeRound=function(t){return[a,o]=t,a=+a,o=+o,l=!0,d()},n.bandwidth=function(){return e},n.step=function(){return t},n.round=function(t){return arguments.length?(l=!!t,d()):l},n.padding=function(t){return arguments.length?(c=Math.min(1,h=+t),d()):c},n.paddingInner=function(t){return arguments.length?(c=Math.min(1,t),d()):c},n.paddingOuter=function(t){return arguments.length?(h=+t,d()):h},n.align=function(t){return arguments.length?(u=Math.max(0,Math.min(1,t)),d()):u},n.copy=function(){return dh(r(),[a,o]).round(l).paddingInner(c).paddingOuter(h).align(u)},fo.apply(d(),arguments)}function ph(t){for(var e=t.length/6|0,n=new Array(e),r=0;r<e;)n[r]="#"+t.slice(6*r,6*++r);return n}s(Hl,"pad"),s(Vl,"requote"),s(Xl,"formatRe"),s(Kl,"formatLookup"),s(Zl,"parseWeekdayNumberSunday"),s(Ql,"parseWeekdayNumberMonday"),s(Jl,"parseWeekNumberSunday"),s(tc,"parseWeekNumberISO"),s(ec,"parseWeekNumberMonday"),s(nc,"parseFullYear"),s(rc,"parseYear"),s(ic,"parseZone"),s(ac,"parseQuarter"),s(sc,"parseMonthNumber"),s(oc,"parseDayOfMonth"),s(lc,"parseDayOfYear"),s(cc,"parseHour24"),s(hc,"parseMinutes"),s(uc,"parseSeconds"),s(dc,"parseMilliseconds"),s(pc,"parseMicroseconds"),s(gc,"parseLiteralPercent"),s(fc,"parseUnixTimestamp"),s(mc,"parseUnixTimestampSeconds"),s(yc,"formatDayOfMonth"),s(vc,"formatHour24"),s(xc,"formatHour12"),s(bc,"formatDayOfYear"),s(wc,"formatMilliseconds"),s(kc,"formatMicroseconds"),s(Tc,"formatMonthNumber"),s(_c,"formatMinutes"),s(Ec,"formatSeconds"),s(Cc,"formatWeekdayNumberMonday"),s(Sc,"formatWeekNumberSunday"),s(Ac,"dISO"),s(Lc,"formatWeekNumberISO"),s(Nc,"formatWeekdayNumberSunday"),s(Ic,"formatWeekNumberMonday"),s(Mc,"formatYear"),s(Rc,"formatYearISO"),s(Dc,"formatFullYear"),s(Oc,"formatFullYearISO"),s(Pc,"formatZone"),s(Bc,"formatUTCDayOfMonth"),s($c,"formatUTCHour24"),s(Fc,"formatUTCHour12"),s(zc,"formatUTCDayOfYear"),s(Uc,"formatUTCMilliseconds"),s(Gc,"formatUTCMicroseconds"),s(qc,"formatUTCMonthNumber"),s(jc,"formatUTCMinutes"),s(Yc,"formatUTCSeconds"),s(Wc,"formatUTCWeekdayNumberMonday"),s(Hc,"formatUTCWeekNumberSunday"),s(Vc,"UTCdISO"),s(Xc,"formatUTCWeekNumberISO"),s(Kc,"formatUTCWeekdayNumberSunday"),s(Zc,"formatUTCWeekNumberMonday"),s(Qc,"formatUTCYear"),s(Jc,"formatUTCYearISO"),s(th,"formatUTCFullYear"),s(eh,"formatUTCFullYearISO"),s(nh,"formatUTCZone"),s(rh,"formatLiteralPercent"),s(ih,"formatUnixTimestamp"),s(ah,"formatUnixTimestampSeconds"),sh({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"]}),s(sh,"defaultLocale"),s(oh,"nice"),s(lh,"date"),s(ch,"number"),s(hh,"calendar"),s(uh,"time"),s(dh,"band"),s(ph,"default");var gh=ph("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab");function fh(t){return s((function(){return t}),"constant")}s(fh,"default");var mh=Math.abs,yh=Math.atan2,vh=Math.cos,xh=Math.max,bh=Math.min,wh=Math.sin,kh=Math.sqrt,Th=Math.PI,_h=Th/2,Eh=2*Th;function Ch(t){return t>1?0:t<-1?Th:Math.acos(t)}function Sh(t){return t>=1?_h:t<=-1?-_h:Math.asin(t)}s(Ch,"acos"),s(Sh,"asin");var Ah=Math.PI,Lh=2*Ah,Nh=Lh-1e-6;function Ih(t){this._+=t[0];for(let e=1,n=t.length;e<n;++e)this._+=arguments[e]+t[e]}function Mh(t){let e=Math.floor(t);if(!(e>=0))throw new Error(`invalid digits: ${t}`);if(e>15)return Ih;const n=10**e;return function(t){this._+=t[0];for(let e=1,r=t.length;e<r;++e)this._+=Math.round(arguments[e]*n)/n+t[e]}}s(Ih,"append"),s(Mh,"appendRound");var Rh=class{static{s(this,"Path")}constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=null==t?Ih:Mh(t)}moveTo(t,e){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}`}closePath(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,e){this._append`L${this._x1=+t},${this._y1=+e}`}quadraticCurveTo(t,e,n,r){this._append`Q${+t},${+e},${this._x1=+n},${this._y1=+r}`}bezierCurveTo(t,e,n,r,i,a){this._append`C${+t},${+e},${+n},${+r},${this._x1=+i},${this._y1=+a}`}arcTo(t,e,n,r,i){if(t=+t,e=+e,n=+n,r=+r,(i=+i)<0)throw new Error(`negative radius: ${i}`);let a=this._x1,s=this._y1,o=n-t,l=r-e,c=a-t,h=s-e,u=c*c+h*h;if(null===this._x1)this._append`M${this._x1=t},${this._y1=e}`;else if(u>1e-6)if(Math.abs(h*o-l*c)>1e-6&&i){let d=n-a,p=r-s,g=o*o+l*l,f=d*d+p*p,m=Math.sqrt(g),y=Math.sqrt(u),v=i*Math.tan((Ah-Math.acos((g+u-f)/(2*m*y)))/2),x=v/y,b=v/m;Math.abs(x-1)>1e-6&&this._append`L${t+x*c},${e+x*h}`,this._append`A${i},${i},0,0,${+(h*d>c*p)},${this._x1=t+b*o},${this._y1=e+b*l}`}else this._append`L${this._x1=t},${this._y1=e}`;else;}arc(t,e,n,r,i,a){if(t=+t,e=+e,a=!!a,(n=+n)<0)throw new Error(`negative radius: ${n}`);let s=n*Math.cos(r),o=n*Math.sin(r),l=t+s,c=e+o,h=1^a,u=a?r-i:i-r;null===this._x1?this._append`M${l},${c}`:(Math.abs(this._x1-l)>1e-6||Math.abs(this._y1-c)>1e-6)&&this._append`L${l},${c}`,n&&(u<0&&(u=u%Lh+Lh),u>Nh?this._append`A${n},${n},0,1,${h},${t-s},${e-o}A${n},${n},0,1,${h},${this._x1=l},${this._y1=c}`:u>1e-6&&this._append`A${n},${n},0,${+(u>=Ah)},${h},${this._x1=t+n*Math.cos(i)},${this._y1=e+n*Math.sin(i)}`)}rect(t,e,n,r){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}h${n=+n}v${+r}h${-n}Z`}toString(){return this._}};function Dh(){return new Rh}function Oh(t){let e=3;return t.digits=function(n){if(!arguments.length)return e;if(null==n)e=null;else{const t=Math.floor(n);if(!(t>=0))throw new RangeError(`invalid digits: ${n}`);e=t}return t},()=>new Rh(e)}function Ph(t){return t.innerRadius}function Bh(t){return t.outerRadius}function $h(t){return t.startAngle}function Fh(t){return t.endAngle}function zh(t){return t&&t.padAngle}function Uh(t,e,n,r,i,a,s,o){var l=n-t,c=r-e,h=s-i,u=o-a,d=u*l-h*c;if(!(d*d<1e-12))return[t+(d=(h*(e-a)-u*(t-i))/d)*l,e+d*c]}function Gh(t,e,n,r,i,a,s){var o=t-n,l=e-r,c=(s?a:-a)/kh(o*o+l*l),h=c*l,u=-c*o,d=t+h,p=e+u,g=n+h,f=r+u,m=(d+g)/2,y=(p+f)/2,v=g-d,x=f-p,b=v*v+x*x,w=i-a,k=d*f-g*p,T=(x<0?-1:1)*kh(xh(0,w*w*b-k*k)),_=(k*x-v*T)/b,E=(-k*v-x*T)/b,C=(k*x+v*T)/b,S=(-k*v+x*T)/b,A=_-m,L=E-y,N=C-m,I=S-y;return A*A+L*L>N*N+I*I&&(_=C,E=S),{cx:_,cy:E,x01:-h,y01:-u,x11:_*(i/w-1),y11:E*(i/w-1)}}function qh(){var t=Ph,e=Bh,n=fh(0),r=null,i=$h,a=Fh,o=zh,l=null,c=Oh(h);function h(){var s,h,u=+t.apply(this,arguments),d=+e.apply(this,arguments),p=i.apply(this,arguments)-_h,g=a.apply(this,arguments)-_h,f=mh(g-p),m=g>p;if(l||(l=s=c()),d<u&&(h=d,d=u,u=h),d>1e-12)if(f>Eh-1e-12)l.moveTo(d*vh(p),d*wh(p)),l.arc(0,0,d,p,g,!m),u>1e-12&&(l.moveTo(u*vh(g),u*wh(g)),l.arc(0,0,u,g,p,m));else{var y,v,x=p,b=g,w=p,k=g,T=f,_=f,E=o.apply(this,arguments)/2,C=E>1e-12&&(r?+r.apply(this,arguments):kh(u*u+d*d)),S=bh(mh(d-u)/2,+n.apply(this,arguments)),A=S,L=S;if(C>1e-12){var N=Sh(C/u*wh(E)),I=Sh(C/d*wh(E));(T-=2*N)>1e-12?(w+=N*=m?1:-1,k-=N):(T=0,w=k=(p+g)/2),(_-=2*I)>1e-12?(x+=I*=m?1:-1,b-=I):(_=0,x=b=(p+g)/2)}var M=d*vh(x),R=d*wh(x),D=u*vh(k),O=u*wh(k);if(S>1e-12){var P,B=d*vh(b),$=d*wh(b),F=u*vh(w),z=u*wh(w);if(f<Th)if(P=Uh(M,R,F,z,B,$,D,O)){var U=M-P[0],G=R-P[1],q=B-P[0],j=$-P[1],Y=1/wh(Ch((U*q+G*j)/(kh(U*U+G*G)*kh(q*q+j*j)))/2),W=kh(P[0]*P[0]+P[1]*P[1]);A=bh(S,(u-W)/(Y-1)),L=bh(S,(d-W)/(Y+1))}else A=L=0}_>1e-12?L>1e-12?(y=Gh(F,z,M,R,d,L,m),v=Gh(B,$,D,O,d,L,m),l.moveTo(y.cx+y.x01,y.cy+y.y01),L<S?l.arc(y.cx,y.cy,L,yh(y.y01,y.x01),yh(v.y01,v.x01),!m):(l.arc(y.cx,y.cy,L,yh(y.y01,y.x01),yh(y.y11,y.x11),!m),l.arc(0,0,d,yh(y.cy+y.y11,y.cx+y.x11),yh(v.cy+v.y11,v.cx+v.x11),!m),l.arc(v.cx,v.cy,L,yh(v.y11,v.x11),yh(v.y01,v.x01),!m))):(l.moveTo(M,R),l.arc(0,0,d,x,b,!m)):l.moveTo(M,R),u>1e-12&&T>1e-12?A>1e-12?(y=Gh(D,O,B,$,u,-A,m),v=Gh(M,R,F,z,u,-A,m),l.lineTo(y.cx+y.x01,y.cy+y.y01),A<S?l.arc(y.cx,y.cy,A,yh(y.y01,y.x01),yh(v.y01,v.x01),!m):(l.arc(y.cx,y.cy,A,yh(y.y01,y.x01),yh(y.y11,y.x11),!m),l.arc(0,0,u,yh(y.cy+y.y11,y.cx+y.x11),yh(v.cy+v.y11,v.cx+v.x11),m),l.arc(v.cx,v.cy,A,yh(v.y11,v.x11),yh(v.y01,v.x01),!m))):l.arc(0,0,u,k,w,m):l.lineTo(D,O)}else l.moveTo(0,0);if(l.closePath(),s)return l=null,s+""||null}return s(h,"arc"),h.centroid=function(){var n=(+t.apply(this,arguments)+ +e.apply(this,arguments))/2,r=(+i.apply(this,arguments)+ +a.apply(this,arguments))/2-Th/2;return[vh(r)*n,wh(r)*n]},h.innerRadius=function(e){return arguments.length?(t="function"==typeof e?e:fh(+e),h):t},h.outerRadius=function(t){return arguments.length?(e="function"==typeof t?t:fh(+t),h):e},h.cornerRadius=function(t){return arguments.length?(n="function"==typeof t?t:fh(+t),h):n},h.padRadius=function(t){return arguments.length?(r=null==t?null:"function"==typeof t?t:fh(+t),h):r},h.startAngle=function(t){return arguments.length?(i="function"==typeof t?t:fh(+t),h):i},h.endAngle=function(t){return arguments.length?(a="function"==typeof t?t:fh(+t),h):a},h.padAngle=function(t){return arguments.length?(o="function"==typeof t?t:fh(+t),h):o},h.context=function(t){return arguments.length?(l=null==t?null:t,h):l},h}function jh(t){this._context=t}function Yh(t){return new jh(t)}function Wh(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}function Hh(t){return t[0]}function Vh(t){return t[1]}function Xh(t,e){var n=fh(!0),r=null,i=Yh,a=null,o=Oh(l);function l(s){var l,c,h,u=(s=Wh(s)).length,d=!1;for(null==r&&(a=i(h=o())),l=0;l<=u;++l)!(l<u&&n(c=s[l],l,s))===d&&((d=!d)?a.lineStart():a.lineEnd()),d&&a.point(+t(c,l,s),+e(c,l,s));if(h)return a=null,h+""||null}return t="function"==typeof t?t:void 0===t?Hh:fh(t),e="function"==typeof e?e:void 0===e?Vh:fh(e),s(l,"line"),l.x=function(e){return arguments.length?(t="function"==typeof e?e:fh(+e),l):t},l.y=function(t){return arguments.length?(e="function"==typeof t?t:fh(+t),l):e},l.defined=function(t){return arguments.length?(n="function"==typeof t?t:fh(!!t),l):n},l.curve=function(t){return arguments.length?(i=t,null!=r&&(a=i(r)),l):i},l.context=function(t){return arguments.length?(null==t?r=a=null:a=i(r=t),l):r},l}function Kh(t,e){return e<t?-1:e>t?1:e>=t?0:NaN}function Zh(t){return t}function Qh(){var t=Zh,e=Kh,n=null,r=fh(0),i=fh(Eh),a=fh(0);function o(s){var o,l,c,h,u,d=(s=Wh(s)).length,p=0,g=new Array(d),f=new Array(d),m=+r.apply(this,arguments),y=Math.min(Eh,Math.max(-Eh,i.apply(this,arguments)-m)),v=Math.min(Math.abs(y)/d,a.apply(this,arguments)),x=v*(y<0?-1:1);for(o=0;o<d;++o)(u=f[g[o]=o]=+t(s[o],o,s))>0&&(p+=u);for(null!=e?g.sort((function(t,n){return e(f[t],f[n])})):null!=n&&g.sort((function(t,e){return n(s[t],s[e])})),o=0,c=p?(y-d*x)/p:0;o<d;++o,m=h)l=g[o],h=m+((u=f[l])>0?u*c:0)+x,f[l]={data:s[l],index:o,value:u,startAngle:m,endAngle:h,padAngle:v};return f}return s(o,"pie"),o.value=function(e){return arguments.length?(t="function"==typeof e?e:fh(+e),o):t},o.sortValues=function(t){return arguments.length?(e=t,n=null,o):e},o.sort=function(t){return arguments.length?(n=t,e=null,o):n},o.startAngle=function(t){return arguments.length?(r="function"==typeof t?t:fh(+t),o):r},o.endAngle=function(t){return arguments.length?(i="function"==typeof t?t:fh(+t),o):i},o.padAngle=function(t){return arguments.length?(a="function"==typeof t?t:fh(+t),o):a},o}s(Dh,"path"),Dh.prototype=Rh.prototype,s(Oh,"withPath"),s(Ph,"arcInnerRadius"),s(Bh,"arcOuterRadius"),s($h,"arcStartAngle"),s(Fh,"arcEndAngle"),s(zh,"arcPadAngle"),s(Uh,"intersect"),s(Gh,"cornerTangents"),s(qh,"default"),s(jh,"Linear"),jh.prototype={areaStart:s((function(){this._line=0}),"areaStart"),areaEnd:s((function(){this._line=NaN}),"areaEnd"),lineStart:s((function(){this._point=0}),"lineStart"),lineEnd:s((function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line}),"lineEnd"),point:s((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)}}),"point")},s(Yh,"default"),s(Wh,"default"),s(Hh,"x"),s(Vh,"y"),s(Xh,"default"),s(Kh,"default"),s(Zh,"default"),s(Qh,"default");var Jh=class{static{s(this,"Bump")}constructor(t,e){this._context=t,this._x=e}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line}point(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._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,e,t,e):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+e)/2,t,this._y0,t,e)}this._x0=t,this._y0=e}};function tu(t){return new Jh(t,!0)}function eu(t){return new Jh(t,!1)}function nu(t,e,n){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+n)/6)}function ru(t){this._context=t}function iu(t){return new ru(t)}function au(){}function su(t){this._context=t}function ou(t){return new su(t)}function lu(t){this._context=t}function cu(t){return new lu(t)}function hu(t,e){this._basis=new ru(t),this._beta=e}s(tu,"bumpX"),s(eu,"bumpY"),s(nu,"point"),s(ru,"Basis"),ru.prototype={areaStart:s((function(){this._line=0}),"areaStart"),areaEnd:s((function(){this._line=NaN}),"areaEnd"),lineStart:s((function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0}),"lineStart"),lineEnd:s((function(){switch(this._point){case 3:nu(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line}),"lineEnd"),point:s((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:nu(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}),"point")},s(iu,"default"),s(au,"default"),s(su,"BasisClosed"),su.prototype={areaStart:au,areaEnd:au,lineStart:s((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}),"lineStart"),lineEnd:s((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)}}),"lineEnd"),point:s((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:nu(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}),"point")},s(ou,"default"),s(lu,"BasisOpen"),lu.prototype={areaStart:s((function(){this._line=0}),"areaStart"),areaEnd:s((function(){this._line=NaN}),"areaEnd"),lineStart:s((function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0}),"lineStart"),lineEnd:s((function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line}),"lineEnd"),point:s((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 n=(this._x0+4*this._x1+t)/6,r=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:nu(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}),"point")},s(cu,"default"),s(hu,"Bundle"),hu.prototype={lineStart:s((function(){this._x=[],this._y=[],this._basis.lineStart()}),"lineStart"),lineEnd:s((function(){var t=this._x,e=this._y,n=t.length-1;if(n>0)for(var r,i=t[0],a=e[0],s=t[n]-i,o=e[n]-a,l=-1;++l<=n;)r=l/n,this._basis.point(this._beta*t[l]+(1-this._beta)*(i+r*s),this._beta*e[l]+(1-this._beta)*(a+r*o));this._x=this._y=null,this._basis.lineEnd()}),"lineEnd"),point:s((function(t,e){this._x.push(+t),this._y.push(+e)}),"point")};var uu=s((function t(e){function n(t){return 1===e?new ru(t):new hu(t,e)}return s(n,"bundle"),n.beta=function(e){return t(+e)},n}),"custom")(.85);function du(t,e,n){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-n),t._x2,t._y2)}function pu(t,e){this._context=t,this._k=(1-e)/6}s(du,"point"),s(pu,"Cardinal"),pu.prototype={areaStart:s((function(){this._line=0}),"areaStart"),areaEnd:s((function(){this._line=NaN}),"areaEnd"),lineStart:s((function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0}),"lineStart"),lineEnd:s((function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:du(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line}),"lineEnd"),point:s((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:du(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}),"point")};var gu=s((function t(e){function n(t){return new pu(t,e)}return s(n,"cardinal"),n.tension=function(e){return t(+e)},n}),"custom")(0);function fu(t,e){this._context=t,this._k=(1-e)/6}s(fu,"CardinalClosed"),fu.prototype={areaStart:au,areaEnd:au,lineStart:s((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}),"lineStart"),lineEnd:s((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)}}),"lineEnd"),point:s((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:du(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}),"point")};var mu=s((function t(e){function n(t){return new fu(t,e)}return s(n,"cardinal"),n.tension=function(e){return t(+e)},n}),"custom")(0);function yu(t,e){this._context=t,this._k=(1-e)/6}s(yu,"CardinalOpen"),yu.prototype={areaStart:s((function(){this._line=0}),"areaStart"),areaEnd:s((function(){this._line=NaN}),"areaEnd"),lineStart:s((function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0}),"lineStart"),lineEnd:s((function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line}),"lineEnd"),point:s((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:du(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}),"point")};var vu=s((function t(e){function n(t){return new yu(t,e)}return s(n,"cardinal"),n.tension=function(e){return t(+e)},n}),"custom")(0);function xu(t,e,n){var r=t._x1,i=t._y1,a=t._x2,s=t._y2;if(t._l01_a>1e-12){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);r=(r*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>1e-12){var c=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*c+t._x1*t._l23_2a-e*t._l12_2a)/h,s=(s*c+t._y1*t._l23_2a-n*t._l12_2a)/h}t._context.bezierCurveTo(r,i,a,s,t._x2,t._y2)}function bu(t,e){this._context=t,this._alpha=e}s(xu,"point"),s(bu,"CatmullRom"),bu.prototype={areaStart:s((function(){this._line=0}),"areaStart"),areaEnd:s((function(){this._line=NaN}),"areaEnd"),lineStart:s((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}),"lineStart"),lineEnd:s((function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line}),"lineEnd"),point:s((function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,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:xu(this,t,e)}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}),"point")};var wu=s((function t(e){function n(t){return e?new bu(t,e):new pu(t,0)}return s(n,"catmullRom"),n.alpha=function(e){return t(+e)},n}),"custom")(.5);function ku(t,e){this._context=t,this._alpha=e}s(ku,"CatmullRomClosed"),ku.prototype={areaStart:au,areaEnd:au,lineStart:s((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}),"lineStart"),lineEnd:s((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)}}),"lineEnd"),point:s((function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,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:xu(this,t,e)}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}),"point")};var Tu=s((function t(e){function n(t){return e?new ku(t,e):new fu(t,0)}return s(n,"catmullRom"),n.alpha=function(e){return t(+e)},n}),"custom")(.5);function _u(t,e){this._context=t,this._alpha=e}s(_u,"CatmullRomOpen"),_u.prototype={areaStart:s((function(){this._line=0}),"areaStart"),areaEnd:s((function(){this._line=NaN}),"areaEnd"),lineStart:s((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}),"lineStart"),lineEnd:s((function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line}),"lineEnd"),point:s((function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:xu(this,t,e)}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}),"point")};var Eu=s((function t(e){function n(t){return e?new _u(t,e):new yu(t,0)}return s(n,"catmullRom"),n.alpha=function(e){return t(+e)},n}),"custom")(.5);function Cu(t){this._context=t}function Su(t){return new Cu(t)}function Au(t){return t<0?-1:1}function Lu(t,e,n){var r=t._x1-t._x0,i=e-t._x1,a=(t._y1-t._y0)/(r||i<0&&-0),s=(n-t._y1)/(i||r<0&&-0),o=(a*i+s*r)/(r+i);return(Au(a)+Au(s))*Math.min(Math.abs(a),Math.abs(s),.5*Math.abs(o))||0}function Nu(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function Iu(t,e,n){var r=t._x0,i=t._y0,a=t._x1,s=t._y1,o=(a-r)/3;t._context.bezierCurveTo(r+o,i+o*e,a-o,s-o*n,a,s)}function Mu(t){this._context=t}function Ru(t){this._context=new Du(t)}function Du(t){this._context=t}function Ou(t){return new Mu(t)}function Pu(t){return new Ru(t)}function Bu(t){this._context=t}function $u(t){var e,n,r=t.length-1,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 Fu(t){return new Bu(t)}function zu(t,e){this._context=t,this._t=e}function Uu(t){return new zu(t,.5)}function Gu(t){return new zu(t,0)}function qu(t){return new zu(t,1)}s(Cu,"LinearClosed"),Cu.prototype={areaStart:au,areaEnd:au,lineStart:s((function(){this._point=0}),"lineStart"),lineEnd:s((function(){this._point&&this._context.closePath()}),"lineEnd"),point:s((function(t,e){t=+t,e=+e,this._point?this._context.lineTo(t,e):(this._point=1,this._context.moveTo(t,e))}),"point")},s(Su,"default"),s(Au,"sign"),s(Lu,"slope3"),s(Nu,"slope2"),s(Iu,"point"),s(Mu,"MonotoneX"),Mu.prototype={areaStart:s((function(){this._line=0}),"areaStart"),areaEnd:s((function(){this._line=NaN}),"areaEnd"),lineStart:s((function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0}),"lineStart"),lineEnd:s((function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:Iu(this,this._t0,Nu(this,this._t0))}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line}),"lineEnd"),point:s((function(t,e){var n=NaN;if(e=+e,(t=+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,Iu(this,Nu(this,n=Lu(this,t,e)),n);break;default:Iu(this,this._t0,n=Lu(this,t,e))}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=n}}),"point")},s(Ru,"MonotoneY"),(Ru.prototype=Object.create(Mu.prototype)).point=function(t,e){Mu.prototype.point.call(this,e,t)},s(Du,"ReflectContext"),Du.prototype={moveTo:s((function(t,e){this._context.moveTo(e,t)}),"moveTo"),closePath:s((function(){this._context.closePath()}),"closePath"),lineTo:s((function(t,e){this._context.lineTo(e,t)}),"lineTo"),bezierCurveTo:s((function(t,e,n,r,i,a){this._context.bezierCurveTo(e,t,r,n,a,i)}),"bezierCurveTo")},s(Ou,"monotoneX"),s(Pu,"monotoneY"),s(Bu,"Natural"),Bu.prototype={areaStart:s((function(){this._line=0}),"areaStart"),areaEnd:s((function(){this._line=NaN}),"areaEnd"),lineStart:s((function(){this._x=[],this._y=[]}),"lineStart"),lineEnd:s((function(){var t=this._x,e=this._y,n=t.length;if(n)if(this._line?this._context.lineTo(t[0],e[0]):this._context.moveTo(t[0],e[0]),2===n)this._context.lineTo(t[1],e[1]);else for(var r=$u(t),i=$u(e),a=0,s=1;s<n;++a,++s)this._context.bezierCurveTo(r[0][a],i[0][a],r[1][a],i[1][a],t[s],e[s]);(this._line||0!==this._line&&1===n)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null}),"lineEnd"),point:s((function(t,e){this._x.push(+t),this._y.push(+e)}),"point")},s($u,"controlPoints"),s(Fu,"default"),s(zu,"Step"),zu.prototype={areaStart:s((function(){this._line=0}),"areaStart"),areaEnd:s((function(){this._line=NaN}),"areaEnd"),lineStart:s((function(){this._x=this._y=NaN,this._point=0}),"lineStart"),lineEnd:s((function(){0<this._t&&this._t<1&&2===this._point&&this._context.lineTo(this._x,this._y),(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)}),"lineEnd"),point:s((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 n=this._x*(1-this._t)+t*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,e)}}this._x=t,this._y=e}),"point")},s(Uu,"default"),s(Gu,"stepBefore"),s(qu,"stepAfter");var ju={value:s((()=>{}),"value")};function Yu(){for(var t,e=0,n=arguments.length,r={};e<n;++e){if(!(t=arguments[e]+"")||t in r||/[\s.]/.test(t))throw new Error("illegal type: "+t);r[t]=[]}return new Wu(r)}function Wu(t){this._=t}function Hu(t,e){return t.trim().split(/^|\s+/).map((function(t){var n="",r=t.indexOf(".");if(r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),t&&!e.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:n}}))}function Vu(t,e){for(var n,r=0,i=t.length;r<i;++r)if((n=t[r]).name===e)return n.value}function Xu(t,e,n){for(var r=0,i=t.length;r<i;++r)if(t[r].name===e){t[r]=ju,t=t.slice(0,r).concat(t.slice(r+1));break}return null!=n&&t.push({name:e,value:n}),t}s(Yu,"dispatch"),s(Wu,"Dispatch"),s(Hu,"parseTypenames"),Wu.prototype=Yu.prototype={constructor:Wu,on:s((function(t,e){var n,r=this._,i=Hu(t+"",r),a=-1,s=i.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++a<s;)if(n=(t=i[a]).type)r[n]=Xu(r[n],t.name,e);else if(null==e)for(n in r)r[n]=Xu(r[n],t.name,null);return this}for(;++a<s;)if((n=(t=i[a]).type)&&(n=Vu(r[n],t.name)))return n}),"on"),copy:s((function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new Wu(t)}),"copy"),call:s((function(t,e){if((n=arguments.length-2)>0)for(var n,r,i=new Array(n),a=0;a<n;++a)i[a]=arguments[a+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(a=0,n=(r=this._[t]).length;a<n;++a)r[a].value.apply(e,i)}),"call"),apply:s((function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],i=0,a=r.length;i<a;++i)r[i].value.apply(e,n)}),"apply")},s(Vu,"get"),s(Xu,"set");var Ku,Zu,Qu=Yu,Ju=0,td=0,ed=0,nd=0,rd=0,id=0,ad="object"==typeof performance&&performance.now?performance:Date,sd="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function od(){return rd||(sd(ld),rd=ad.now()+id)}function ld(){rd=0}function cd(){this._call=this._time=this._next=null}function hd(t,e,n){var r=new cd;return r.restart(t,e,n),r}function ud(){od(),++Ju;for(var t,e=Ku;e;)(t=rd-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Ju}function dd(){rd=(nd=ad.now())+id,Ju=td=0;try{ud()}finally{Ju=0,gd(),rd=0}}function pd(){var t=ad.now(),e=t-nd;e>1e3&&(id-=e,nd=t)}function gd(){for(var t,e,n=Ku,r=1/0;n;)n._call?(r>n._time&&(r=n._time),t=n,n=n._next):(e=n._next,n._next=null,n=t?t._next=e:Ku=e);Zu=t,fd(r)}function fd(t){Ju||(td&&(td=clearTimeout(td)),t-rd>24?(t<1/0&&(td=setTimeout(dd,t-ad.now()-id)),ed&&(ed=clearInterval(ed))):(ed||(nd=ad.now(),ed=setInterval(pd,1e3)),Ju=1,sd(dd)))}function md(t,e,n){var r=new cd;return e=null==e?0:+e,r.restart((n=>{r.stop(),t(n+e)}),e,n),r}s(od,"now"),s(ld,"clearNow"),s(cd,"Timer"),cd.prototype=hd.prototype={constructor:cd,restart:s((function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?od():+n)+(null==e?0:+e),this._next||Zu===this||(Zu?Zu._next=this:Ku=this,Zu=this),this._call=t,this._time=n,fd()}),"restart"),stop:s((function(){this._call&&(this._call=null,this._time=1/0,fd())}),"stop")},s(hd,"timer"),s(ud,"timerFlush"),s(dd,"wake"),s(pd,"poke"),s(gd,"nap"),s(fd,"sleep"),s(md,"default");var yd=Qu("start","end","cancel","interrupt"),vd=[];function xd(t,e,n,r,i,a){var s=t.__transition;if(s){if(n in s)return}else t.__transition={};Td(t,n,{name:e,index:r,group:i,on:yd,tween:vd,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:0})}function bd(t,e){var n=kd(t,e);if(n.state>0)throw new Error("too late; already scheduled");return n}function wd(t,e){var n=kd(t,e);if(n.state>3)throw new Error("too late; already running");return n}function kd(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function Td(t,e,n){var r,i=t.__transition;function a(t){n.state=1,n.timer.restart(o,n.delay,n.time),n.delay<=t&&o(t-n.delay)}function o(a){var s,h,u,d;if(1!==n.state)return c();for(s in i)if((d=i[s]).name===n.name){if(3===d.state)return md(o);4===d.state?(d.state=6,d.timer.stop(),d.on.call("interrupt",t,t.__data__,d.index,d.group),delete i[s]):+s<e&&(d.state=6,d.timer.stop(),d.on.call("cancel",t,t.__data__,d.index,d.group),delete i[s])}if(md((function(){3===n.state&&(n.state=4,n.timer.restart(l,n.delay,n.time),l(a))})),n.state=2,n.on.call("start",t,t.__data__,n.index,n.group),2===n.state){for(n.state=3,r=new Array(u=n.tween.length),s=0,h=-1;s<u;++s)(d=n.tween[s].value.call(t,t.__data__,n.index,n.group))&&(r[++h]=d);r.length=h+1}}function l(e){for(var i=e<n.duration?n.ease.call(null,e/n.duration):(n.timer.restart(c),n.state=5,1),a=-1,s=r.length;++a<s;)r[a].call(t,i);5===n.state&&(n.on.call("end",t,t.__data__,n.index,n.group),c())}function c(){for(var r in n.state=6,n.timer.stop(),delete i[e],i)return;delete t.__transition}i[e]=n,n.timer=hd(a,0,n.time),s(a,"schedule"),s(o,"start"),s(l,"tick"),s(c,"stop")}function _d(t,e){var n,r,i,a=t.__transition,s=!0;if(a){for(i in e=null==e?null:e+"",a)(n=a[i]).name===e?(r=n.state>2&&n.state<5,n.state=6,n.timer.stop(),n.on.call(r?"interrupt":"cancel",t,t.__data__,n.index,n.group),delete a[i]):s=!1;s&&delete t.__transition}}function Ed(t){return this.each((function(){_d(this,t)}))}function Cd(t,e){var n,r;return function(){var i=wd(this,t),a=i.tween;if(a!==n)for(var s=0,o=(r=n=a).length;s<o;++s)if(r[s].name===e){(r=r.slice()).splice(s,1);break}i.tween=r}}function Sd(t,e,n){var r,i;if("function"!=typeof n)throw new Error;return function(){var a=wd(this,t),s=a.tween;if(s!==r){i=(r=s).slice();for(var o={name:e,value:n},l=0,c=i.length;l<c;++l)if(i[l].name===e){i[l]=o;break}l===c&&i.push(o)}a.tween=i}}function Ad(t,e){var n=this._id;if(t+="",arguments.length<2){for(var r,i=kd(this.node(),n).tween,a=0,s=i.length;a<s;++a)if((r=i[a]).name===t)return r.value;return null}return this.each((null==e?Cd:Sd)(n,t,e))}function Ld(t,e,n){var r=t._id;return t.each((function(){var t=wd(this,r);(t.value||(t.value={}))[e]=n.apply(this,arguments)})),function(t){return kd(t,r).value[e]}}function Nd(t,e){var n;return("number"==typeof e?Ks:e instanceof es?Ys:(n=es(e))?(e=n,Ys):no)(t,e)}function Id(t){return function(){this.removeAttribute(t)}}function Md(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Rd(t,e,n){var r,i,a=n+"";return function(){var s=this.getAttribute(t);return s===a?null:s===r?i:i=e(r=s,n)}}function Dd(t,e,n){var r,i,a=n+"";return function(){var s=this.getAttributeNS(t.space,t.local);return s===a?null:s===r?i:i=e(r=s,n)}}function Od(t,e,n){var r,i,a;return function(){var s,o,l=n(this);if(null!=l)return(s=this.getAttribute(t))===(o=l+"")?null:s===r&&o===i?a:(i=o,a=e(r=s,l));this.removeAttribute(t)}}function Pd(t,e,n){var r,i,a;return function(){var s,o,l=n(this);if(null!=l)return(s=this.getAttributeNS(t.space,t.local))===(o=l+"")?null:s===r&&o===i?a:(i=o,a=e(r=s,l));this.removeAttributeNS(t.space,t.local)}}function Bd(t,e){var n=Ti(t),r="transform"===n?go:Nd;return this.attrTween(t,"function"==typeof e?(n.local?Pd:Od)(n,r,Ld(this,"attr."+t,e)):null==e?(n.local?Md:Id)(n):(n.local?Dd:Rd)(n,r,e))}function $d(t,e){return function(n){this.setAttribute(t,e.call(this,n))}}function Fd(t,e){return function(n){this.setAttributeNS(t.space,t.local,e.call(this,n))}}function zd(t,e){var n,r;function i(){var i=e.apply(this,arguments);return i!==r&&(n=(r=i)&&Fd(t,i)),n}return s(i,"tween"),i._value=e,i}function Ud(t,e){var n,r;function i(){var i=e.apply(this,arguments);return i!==r&&(n=(r=i)&&$d(t,i)),n}return s(i,"tween"),i._value=e,i}function Gd(t,e){var n="attr."+t;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(null==e)return this.tween(n,null);if("function"!=typeof e)throw new Error;var r=Ti(t);return this.tween(n,(r.local?zd:Ud)(r,e))}function qd(t,e){return function(){bd(this,t).delay=+e.apply(this,arguments)}}function jd(t,e){return e=+e,function(){bd(this,t).delay=e}}function Yd(t){var e=this._id;return arguments.length?this.each(("function"==typeof t?qd:jd)(e,t)):kd(this.node(),e).delay}function Wd(t,e){return function(){wd(this,t).duration=+e.apply(this,arguments)}}function Hd(t,e){return e=+e,function(){wd(this,t).duration=e}}function Vd(t){var e=this._id;return arguments.length?this.each(("function"==typeof t?Wd:Hd)(e,t)):kd(this.node(),e).duration}function Xd(t,e){if("function"!=typeof e)throw new Error;return function(){wd(this,t).ease=e}}function Kd(t){var e=this._id;return arguments.length?this.each(Xd(e,t)):kd(this.node(),e).ease}function Zd(t,e){return function(){var n=e.apply(this,arguments);if("function"!=typeof n)throw new Error;wd(this,t).ease=n}}function Qd(t){if("function"!=typeof t)throw new Error;return this.each(Zd(this._id,t))}function Jd(t){"function"!=typeof t&&(t=qr(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var a,s=e[i],o=s.length,l=r[i]=[],c=0;c<o;++c)(a=s[c])&&t.call(a,a.__data__,c,s)&&l.push(a);return new Ap(r,this._parents,this._name,this._id)}function tp(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,n=t._groups,r=e.length,i=n.length,a=Math.min(r,i),s=new Array(r),o=0;o<a;++o)for(var l,c=e[o],h=n[o],u=c.length,d=s[o]=new Array(u),p=0;p<u;++p)(l=c[p]||h[p])&&(d[p]=l);for(;o<r;++o)s[o]=e[o];return new Ap(s,this._parents,this._name,this._id)}function ep(t){return(t+"").trim().split(/^|\s+/).every((function(t){var e=t.indexOf(".");return e>=0&&(t=t.slice(0,e)),!t||"start"===t}))}function np(t,e,n){var r,i,a=ep(e)?bd:wd;return function(){var s=a(this,t),o=s.on;o!==r&&(i=(r=o).copy()).on(e,n),s.on=i}}function rp(t,e){var n=this._id;return arguments.length<2?kd(this.node(),n).on.on(t):this.each(np(n,t,e))}function ip(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}function ap(){return this.on("end.remove",ip(this._id))}function sp(t){var e=this._name,n=this._id;"function"!=typeof t&&(t=Pr(t));for(var r=this._groups,i=r.length,a=new Array(i),s=0;s<i;++s)for(var o,l,c=r[s],h=c.length,u=a[s]=new Array(h),d=0;d<h;++d)(o=c[d])&&(l=t.call(o,o.__data__,d,c))&&("__data__"in o&&(l.__data__=o.__data__),u[d]=l,xd(u[d],e,n,d,u,kd(o,n)));return new Ap(a,this._parents,e,n)}function op(t){var e=this._name,n=this._id;"function"!=typeof t&&(t=zr(t));for(var r=this._groups,i=r.length,a=[],s=[],o=0;o<i;++o)for(var l,c=r[o],h=c.length,u=0;u<h;++u)if(l=c[u]){for(var d,p=t.call(l,l.__data__,u,c),g=kd(l,n),f=0,m=p.length;f<m;++f)(d=p[f])&&xd(d,e,n,f,p,g);a.push(p),s.push(l)}return new Ap(a,s,e,n)}s(xd,"default"),s(bd,"init"),s(wd,"set"),s(kd,"get"),s(Td,"create"),s(_d,"default"),s(Ed,"default"),s(Cd,"tweenRemove"),s(Sd,"tweenFunction"),s(Ad,"default"),s(Ld,"tweenValue"),s(Nd,"default"),s(Id,"attrRemove"),s(Md,"attrRemoveNS"),s(Rd,"attrConstant"),s(Dd,"attrConstantNS"),s(Od,"attrFunction"),s(Pd,"attrFunctionNS"),s(Bd,"default"),s($d,"attrInterpolate"),s(Fd,"attrInterpolateNS"),s(zd,"attrTweenNS"),s(Ud,"attrTween"),s(Gd,"default"),s(qd,"delayFunction"),s(jd,"delayConstant"),s(Yd,"default"),s(Wd,"durationFunction"),s(Hd,"durationConstant"),s(Vd,"default"),s(Xd,"easeConstant"),s(Kd,"default"),s(Zd,"easeVarying"),s(Qd,"default"),s(Jd,"default"),s(tp,"default"),s(ep,"start"),s(np,"onFunction"),s(rp,"default"),s(ip,"removeFunction"),s(ap,"default"),s(sp,"default"),s(op,"default");var lp=Da.prototype.constructor;function cp(){return new lp(this._groups,this._parents)}function hp(t,e){var n,r,i;return function(){var a=Pi(this,t),s=(this.style.removeProperty(t),Pi(this,t));return a===s?null:a===n&&s===r?i:i=e(n=a,r=s)}}function up(t){return function(){this.style.removeProperty(t)}}function dp(t,e,n){var r,i,a=n+"";return function(){var s=Pi(this,t);return s===a?null:s===r?i:i=e(r=s,n)}}function pp(t,e,n){var r,i,a;return function(){var s=Pi(this,t),o=n(this),l=o+"";return null==o&&(this.style.removeProperty(t),l=o=Pi(this,t)),s===l?null:s===r&&l===i?a:(i=l,a=e(r=s,o))}}function gp(t,e){var n,r,i,a,s="style."+e,o="end."+s;return function(){var l=wd(this,t),c=l.on,h=null==l.value[s]?a||(a=up(e)):void 0;c===n&&i===h||(r=(n=c).copy()).on(o,i=h),l.on=r}}function fp(t,e,n){var r="transform"==(t+="")?po:Nd;return null==e?this.styleTween(t,hp(t,r)).on("end.style."+t,up(t)):"function"==typeof e?this.styleTween(t,pp(t,r,Ld(this,"style."+t,e))).each(gp(this._id,t)):this.styleTween(t,dp(t,r,e),n).on("end.style."+t,null)}function mp(t,e,n){return function(r){this.style.setProperty(t,e.call(this,r),n)}}function yp(t,e,n){var r,i;function a(){var a=e.apply(this,arguments);return a!==i&&(r=(i=a)&&mp(t,a,n)),r}return s(a,"tween"),a._value=e,a}function vp(t,e,n){var r="style."+(t+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(null==e)return this.tween(r,null);if("function"!=typeof e)throw new Error;return this.tween(r,yp(t,e,null==n?"":n))}function xp(t){return function(){this.textContent=t}}function bp(t){return function(){var e=t(this);this.textContent=null==e?"":e}}function wp(t){return this.tween("text","function"==typeof t?bp(Ld(this,"text",t)):xp(null==t?"":t+""))}function kp(t){return function(e){this.textContent=t.call(this,e)}}function Tp(t){var e,n;function r(){var r=t.apply(this,arguments);return r!==n&&(e=(n=r)&&kp(r)),e}return s(r,"tween"),r._value=t,r}function _p(t){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(null==t)return this.tween(e,null);if("function"!=typeof t)throw new Error;return this.tween(e,Tp(t))}function Ep(){for(var t=this._name,e=this._id,n=Np(),r=this._groups,i=r.length,a=0;a<i;++a)for(var s,o=r[a],l=o.length,c=0;c<l;++c)if(s=o[c]){var h=kd(s,e);xd(s,t,n,c,o,{time:h.time+h.delay+h.duration,delay:0,duration:h.duration,ease:h.ease})}return new Ap(r,this._parents,t,n)}function Cp(){var t,e,n=this,r=n._id,i=n.size();return new Promise((function(a,o){var l={value:o},c={value:s((function(){0==--i&&a()}),"value")};n.each((function(){var n=wd(this,r),i=n.on;i!==t&&((e=(t=i).copy())._.cancel.push(l),e._.interrupt.push(l),e._.end.push(c)),n.on=e})),0===i&&a()}))}s(cp,"default"),s(hp,"styleNull"),s(up,"styleRemove"),s(dp,"styleConstant"),s(pp,"styleFunction"),s(gp,"styleMaybeRemove"),s(fp,"default"),s(mp,"styleInterpolate"),s(yp,"styleTween"),s(vp,"default"),s(xp,"textConstant"),s(bp,"textFunction"),s(wp,"default"),s(kp,"textInterpolate"),s(Tp,"textTween"),s(_p,"default"),s(Ep,"default"),s(Cp,"default");var Sp=0;function Ap(t,e,n,r){this._groups=t,this._parents=e,this._name=n,this._id=r}function Lp(t){return Da().transition(t)}function Np(){return++Sp}s(Ap,"Transition"),s(Lp,"transition"),s(Np,"newId");var Ip=Da.prototype;function Mp(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}Ap.prototype=Lp.prototype={constructor:Ap,select:sp,selectAll:op,selectChild:Ip.selectChild,selectChildren:Ip.selectChildren,filter:Jd,merge:tp,selection:cp,transition:Ep,call:Ip.call,nodes:Ip.nodes,node:Ip.node,size:Ip.size,empty:Ip.empty,each:Ip.each,on:rp,attr:Bd,attrTween:Gd,style:fp,styleTween:vp,text:wp,textTween:_p,remove:ap,tween:Ad,delay:Yd,duration:Vd,ease:Kd,easeVarying:Qd,end:Cp,[Symbol.iterator]:Ip[Symbol.iterator]},s(Mp,"cubicInOut");var Rp={time:null,delay:0,duration:250,ease:Mp};function Dp(t,e){for(var n;!(n=t.__transition)||!(n=n[e]);)if(!(t=t.parentNode))throw new Error(`transition ${e} not found`);return n}function Op(t){var e,n;t instanceof Ap?(e=t._id,t=t._name):(e=Np(),(n=Rp).time=od(),t=null==t?null:t+"");for(var r=this._groups,i=r.length,a=0;a<i;++a)for(var s,o=r[a],l=o.length,c=0;c<l;++c)(s=o[c])&&xd(s,t,e,c,o,n||Dp(s,e));return new Ap(r,this._parents,t,e)}function Pp(t){return[+t[0],+t[1]]}function Bp(t,e,n){this.k=t,this.x=e,this.y=n}s(Dp,"inherit"),s(Op,"default"),Da.prototype.interrupt=Ed,Da.prototype.transition=Op,s(Pp,"number1"),s((function(t){return[Pp(t[0]),Pp(t[1])]}),"number2"),s((function(t){return{type:t}}),"type"),s(Bp,"Transform"),Bp.prototype={constructor:Bp,scale:s((function(t){return 1===t?this:new Bp(this.k*t,this.x,this.y)}),"scale"),translate:s((function(t,e){return 0===t&0===e?this:new Bp(this.k,this.x+this.k*t,this.y+this.k*e)}),"translate"),apply:s((function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]}),"apply"),applyX:s((function(t){return t*this.k+this.x}),"applyX"),applyY:s((function(t){return t*this.k+this.y}),"applyY"),invert:s((function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]}),"invert"),invertX:s((function(t){return(t-this.x)/this.k}),"invertX"),invertY:s((function(t){return(t-this.y)/this.k}),"invertY"),rescaleX:s((function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))}),"rescaleX"),rescaleY:s((function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))}),"rescaleY"),toString:s((function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}),"toString")};var $p=new Bp(1,0,0);function Fp(t){for(;!t.__zoom;)if(!(t=t.parentNode))return $p;return t.__zoom}Fp.prototype=Bp.prototype,s(Fp,"transform");
/*! Bundled license information:
dompurify/dist/purify.es.mjs:
(*! @license DOMPurify 3.2.1 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.1/LICENSE *)
*/
var zp=s((t=>{const{securityLevel:e}=Hn();let n=Oa("body");if("sandbox"===e){const e=Oa(`#i${t}`);n=Oa((e.node()?.contentDocument??document).body)}return n.select(`#${t}`)}),"selectSvgElement");function Up(t){return null==t}function Gp(t){return"object"==typeof t&&null!==t}function qp(t){return Array.isArray(t)?t:Up(t)?[]:[t]}function jp(t,e){var n,r,i,a;if(e)for(n=0,r=(a=Object.keys(e)).length;n<r;n+=1)t[i=a[n]]=e[i];return t}function Yp(t,e){var n,r="";for(n=0;n<e;n+=1)r+=t;return r}function Wp(t){return 0===t&&Number.NEGATIVE_INFINITY===1/t}s(Up,"isNothing"),s(Gp,"isObject"),s(qp,"toArray"),s(jp,"extend"),s(Yp,"repeat"),s(Wp,"isNegativeZero");var Hp={isNothing:Up,isObject:Gp,toArray:qp,repeat:Yp,isNegativeZero:Wp,extend:jp};function Vp(t,e){var n="",r=t.reason||"(unknown reason)";return t.mark?(t.mark.name&&(n+='in "'+t.mark.name+'" '),n+="("+(t.mark.line+1)+":"+(t.mark.column+1)+")",!e&&t.mark.snippet&&(n+="\n\n"+t.mark.snippet),r+" "+n):r}function Xp(t,e){Error.call(this),this.name="YAMLException",this.reason=t,this.mark=e,this.message=Vp(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack||""}s(Vp,"formatError"),s(Xp,"YAMLException$1"),Xp.prototype=Object.create(Error.prototype),Xp.prototype.constructor=Xp,Xp.prototype.toString=s((function(t){return this.name+": "+Vp(this,t)}),"toString");var Kp=Xp;function Zp(t,e,n,r,i){var a="",s="",o=Math.floor(i/2)-1;return r-e>o&&(e=r-o+(a=" ... ").length),n-r>o&&(n=r+o-(s=" ...").length),{str:a+t.slice(e,n).replace(/\t/g,"→")+s,pos:r-e+a.length}}function Qp(t,e){return Hp.repeat(" ",e-t.length)+t}function Jp(t,e){if(e=Object.create(e||null),!t.buffer)return null;e.maxLength||(e.maxLength=79),"number"!=typeof e.indent&&(e.indent=1),"number"!=typeof e.linesBefore&&(e.linesBefore=3),"number"!=typeof e.linesAfter&&(e.linesAfter=2);for(var n,r=/\r?\n|\r|\0/g,i=[0],a=[],s=-1;n=r.exec(t.buffer);)a.push(n.index),i.push(n.index+n[0].length),t.position<=n.index&&s<0&&(s=i.length-2);s<0&&(s=i.length-1);var o,l,c="",h=Math.min(t.line+e.linesAfter,a.length).toString().length,u=e.maxLength-(e.indent+h+3);for(o=1;o<=e.linesBefore&&!(s-o<0);o++)l=Zp(t.buffer,i[s-o],a[s-o],t.position-(i[s]-i[s-o]),u),c=Hp.repeat(" ",e.indent)+Qp((t.line-o+1).toString(),h)+" | "+l.str+"\n"+c;for(l=Zp(t.buffer,i[s],a[s],t.position,u),c+=Hp.repeat(" ",e.indent)+Qp((t.line+1).toString(),h)+" | "+l.str+"\n",c+=Hp.repeat("-",e.indent+h+3+l.pos)+"^\n",o=1;o<=e.linesAfter&&!(s+o>=a.length);o++)l=Zp(t.buffer,i[s+o],a[s+o],t.position-(i[s]-i[s+o]),u),c+=Hp.repeat(" ",e.indent)+Qp((t.line+o+1).toString(),h)+" | "+l.str+"\n";return c.replace(/\n$/,"")}s(Zp,"getLine"),s(Qp,"padStart"),s(Jp,"makeSnippet");var tg=Jp,eg=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],ng=["scalar","sequence","mapping"];function rg(t){var e={};return null!==t&&Object.keys(t).forEach((function(n){t[n].forEach((function(t){e[String(t)]=n}))})),e}function ig(t,e){if(e=e||{},Object.keys(e).forEach((function(e){if(-1===eg.indexOf(e))throw new Kp('Unknown option "'+e+'" 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(t){return t},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=rg(e.styleAliases||null),-1===ng.indexOf(this.kind))throw new Kp('Unknown kind "'+this.kind+'" is specified for "'+t+'" YAML type.')}s(rg,"compileStyleAliases"),s(ig,"Type$1");var ag=ig;function sg(t,e){var n=[];return t[e].forEach((function(t){var e=n.length;n.forEach((function(n,r){n.tag===t.tag&&n.kind===t.kind&&n.multi===t.multi&&(e=r)})),n[e]=t})),n}function og(){var t,e,n={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}};function r(t){t.multi?(n.multi[t.kind].push(t),n.multi.fallback.push(t)):n[t.kind][t.tag]=n.fallback[t.tag]=t}for(s(r,"collectType"),t=0,e=arguments.length;t<e;t+=1)arguments[t].forEach(r);return n}function lg(t){return this.extend(t)}s(sg,"compileList"),s(og,"compileMap"),s(lg,"Schema$1"),lg.prototype.extend=s((function(t){var e=[],n=[];if(t instanceof ag)n.push(t);else if(Array.isArray(t))n=n.concat(t);else{if(!t||!Array.isArray(t.implicit)&&!Array.isArray(t.explicit))throw new Kp("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");t.implicit&&(e=e.concat(t.implicit)),t.explicit&&(n=n.concat(t.explicit))}e.forEach((function(t){if(!(t instanceof ag))throw new Kp("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(t.loadKind&&"scalar"!==t.loadKind)throw new Kp("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(t.multi)throw new Kp("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")})),n.forEach((function(t){if(!(t instanceof ag))throw new Kp("Specified list of YAML types (or a single Type object) contains a non-Type object.")}));var r=Object.create(lg.prototype);return r.implicit=(this.implicit||[]).concat(e),r.explicit=(this.explicit||[]).concat(n),r.compiledImplicit=sg(r,"implicit"),r.compiledExplicit=sg(r,"explicit"),r.compiledTypeMap=og(r.compiledImplicit,r.compiledExplicit),r}),"extend");var cg=lg,hg=new ag("tag:yaml.org,2002:str",{kind:"scalar",construct:s((function(t){return null!==t?t:""}),"construct")}),ug=new ag("tag:yaml.org,2002:seq",{kind:"sequence",construct:s((function(t){return null!==t?t:[]}),"construct")}),dg=new ag("tag:yaml.org,2002:map",{kind:"mapping",construct:s((function(t){return null!==t?t:{}}),"construct")}),pg=new cg({explicit:[hg,ug,dg]});function gg(t){if(null===t)return!0;var e=t.length;return 1===e&&"~"===t||4===e&&("null"===t||"Null"===t||"NULL"===t)}function fg(){return null}function mg(t){return null===t}s(gg,"resolveYamlNull"),s(fg,"constructYamlNull"),s(mg,"isNull");var yg=new ag("tag:yaml.org,2002:null",{kind:"scalar",resolve:gg,construct:fg,predicate:mg,represent:{canonical:s((function(){return"~"}),"canonical"),lowercase:s((function(){return"null"}),"lowercase"),uppercase:s((function(){return"NULL"}),"uppercase"),camelcase:s((function(){return"Null"}),"camelcase"),empty:s((function(){return""}),"empty")},defaultStyle:"lowercase"});function vg(t){if(null===t)return!1;var e=t.length;return 4===e&&("true"===t||"True"===t||"TRUE"===t)||5===e&&("false"===t||"False"===t||"FALSE"===t)}function xg(t){return"true"===t||"True"===t||"TRUE"===t}function bg(t){return"[object Boolean]"===Object.prototype.toString.call(t)}s(vg,"resolveYamlBoolean"),s(xg,"constructYamlBoolean"),s(bg,"isBoolean");var wg=new ag("tag:yaml.org,2002:bool",{kind:"scalar",resolve:vg,construct:xg,predicate:bg,represent:{lowercase:s((function(t){return t?"true":"false"}),"lowercase"),uppercase:s((function(t){return t?"TRUE":"FALSE"}),"uppercase"),camelcase:s((function(t){return t?"True":"False"}),"camelcase")},defaultStyle:"lowercase"});function kg(t){return 48<=t&&t<=57||65<=t&&t<=70||97<=t&&t<=102}function Tg(t){return 48<=t&&t<=55}function _g(t){return 48<=t&&t<=57}function Eg(t){if(null===t)return!1;var e,n=t.length,r=0,i=!1;if(!n)return!1;if("-"!==(e=t[r])&&"+"!==e||(e=t[++r]),"0"===e){if(r+1===n)return!0;if("b"===(e=t[++r])){for(r++;r<n;r++)if("_"!==(e=t[r])){if("0"!==e&&"1"!==e)return!1;i=!0}return i&&"_"!==e}if("x"===e){for(r++;r<n;r++)if("_"!==(e=t[r])){if(!kg(t.charCodeAt(r)))return!1;i=!0}return i&&"_"!==e}if("o"===e){for(r++;r<n;r++)if("_"!==(e=t[r])){if(!Tg(t.charCodeAt(r)))return!1;i=!0}return i&&"_"!==e}}if("_"===e)return!1;for(;r<n;r++)if("_"!==(e=t[r])){if(!_g(t.charCodeAt(r)))return!1;i=!0}return!(!i||"_"===e)}function Cg(t){var e,n=t,r=1;if(-1!==n.indexOf("_")&&(n=n.replace(/_/g,"")),"-"!==(e=n[0])&&"+"!==e||("-"===e&&(r=-1),e=(n=n.slice(1))[0]),"0"===n)return 0;if("0"===e){if("b"===n[1])return r*parseInt(n.slice(2),2);if("x"===n[1])return r*parseInt(n.slice(2),16);if("o"===n[1])return r*parseInt(n.slice(2),8)}return r*parseInt(n,10)}function Sg(t){return"[object Number]"===Object.prototype.toString.call(t)&&t%1==0&&!Hp.isNegativeZero(t)}s(kg,"isHexCode"),s(Tg,"isOctCode"),s(_g,"isDecCode"),s(Eg,"resolveYamlInteger"),s(Cg,"constructYamlInteger"),s(Sg,"isInteger");var Ag=new ag("tag:yaml.org,2002:int",{kind:"scalar",resolve:Eg,construct:Cg,predicate:Sg,represent:{binary:s((function(t){return t>=0?"0b"+t.toString(2):"-0b"+t.toString(2).slice(1)}),"binary"),octal:s((function(t){return t>=0?"0o"+t.toString(8):"-0o"+t.toString(8).slice(1)}),"octal"),decimal:s((function(t){return t.toString(10)}),"decimal"),hexadecimal:s((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"]}}),Lg=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function Ng(t){return null!==t&&!(!Lg.test(t)||"_"===t[t.length-1])}function Ig(t){var e,n;return n="-"===(e=t.replace(/_/g,"").toLowerCase())[0]?-1:1,"+-".indexOf(e[0])>=0&&(e=e.slice(1)),".inf"===e?1===n?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:".nan"===e?NaN:n*parseFloat(e,10)}s(Ng,"resolveYamlFloat"),s(Ig,"constructYamlFloat");var Mg=/^[-+]?[0-9]+e/;function Rg(t,e){var n;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(Hp.isNegativeZero(t))return"-0.0";return n=t.toString(10),Mg.test(n)?n.replace("e",".e"):n}function Dg(t){return"[object Number]"===Object.prototype.toString.call(t)&&(t%1!=0||Hp.isNegativeZero(t))}s(Rg,"representYamlFloat"),s(Dg,"isFloat");var Og=new ag("tag:yaml.org,2002:float",{kind:"scalar",resolve:Ng,construct:Ig,predicate:Dg,represent:Rg,defaultStyle:"lowercase"}),Pg=pg.extend({implicit:[yg,wg,Ag,Og]}),Bg=Pg,$g=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),Fg=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 zg(t){return null!==t&&(null!==$g.exec(t)||null!==Fg.exec(t))}function Ug(t){var e,n,r,i,a,s,o,l,c=0,h=null;if(null===(e=$g.exec(t))&&(e=Fg.exec(t)),null===e)throw new Error("Date resolve error");if(n=+e[1],r=+e[2]-1,i=+e[3],!e[4])return new Date(Date.UTC(n,r,i));if(a=+e[4],s=+e[5],o=+e[6],e[7]){for(c=e[7].slice(0,3);c.length<3;)c+="0";c=+c}return e[9]&&(h=6e4*(60*+e[10]+ +(e[11]||0)),"-"===e[9]&&(h=-h)),l=new Date(Date.UTC(n,r,i,a,s,o,c)),h&&l.setTime(l.getTime()-h),l}function Gg(t){return t.toISOString()}s(zg,"resolveYamlTimestamp"),s(Ug,"constructYamlTimestamp"),s(Gg,"representYamlTimestamp");var qg=new ag("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:zg,construct:Ug,instanceOf:Date,represent:Gg});function jg(t){return"<<"===t||null===t}s(jg,"resolveYamlMerge");var Yg=new ag("tag:yaml.org,2002:merge",{kind:"scalar",resolve:jg}),Wg="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r";function Hg(t){if(null===t)return!1;var e,n,r=0,i=t.length,a=Wg;for(n=0;n<i;n++)if(!((e=a.indexOf(t.charAt(n)))>64)){if(e<0)return!1;r+=6}return r%8==0}function Vg(t){var e,n,r=t.replace(/[\r\n=]/g,""),i=r.length,a=Wg,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(255&s)),s=s<<6|a.indexOf(r.charAt(e));return 0===(n=i%4*6)?(o.push(s>>16&255),o.push(s>>8&255),o.push(255&s)):18===n?(o.push(s>>10&255),o.push(s>>2&255)):12===n&&o.push(s>>4&255),new Uint8Array(o)}function Xg(t){var e,n,r="",i=0,a=t.length,s=Wg;for(e=0;e<a;e++)e%3==0&&e&&(r+=s[i>>18&63],r+=s[i>>12&63],r+=s[i>>6&63],r+=s[63&i]),i=(i<<8)+t[e];return 0===(n=a%3)?(r+=s[i>>18&63],r+=s[i>>12&63],r+=s[i>>6&63],r+=s[63&i]):2===n?(r+=s[i>>10&63],r+=s[i>>4&63],r+=s[i<<2&63],r+=s[64]):1===n&&(r+=s[i>>2&63],r+=s[i<<4&63],r+=s[64],r+=s[64]),r}function Kg(t){return"[object Uint8Array]"===Object.prototype.toString.call(t)}s(Hg,"resolveYamlBinary"),s(Vg,"constructYamlBinary"),s(Xg,"representYamlBinary"),s(Kg,"isBinary");var Zg=new ag("tag:yaml.org,2002:binary",{kind:"scalar",resolve:Hg,construct:Vg,predicate:Kg,represent:Xg}),Qg=Object.prototype.hasOwnProperty,Jg=Object.prototype.toString;function tf(t){if(null===t)return!0;var e,n,r,i,a,s=[],o=t;for(e=0,n=o.length;e<n;e+=1){if(r=o[e],a=!1,"[object Object]"!==Jg.call(r))return!1;for(i in r)if(Qg.call(r,i)){if(a)return!1;a=!0}if(!a)return!1;if(-1!==s.indexOf(i))return!1;s.push(i)}return!0}function ef(t){return null!==t?t:[]}s(tf,"resolveYamlOmap"),s(ef,"constructYamlOmap");var nf=new ag("tag:yaml.org,2002:omap",{kind:"sequence",resolve:tf,construct:ef}),rf=Object.prototype.toString;function af(t){if(null===t)return!0;var e,n,r,i,a,s=t;for(a=new Array(s.length),e=0,n=s.length;e<n;e+=1){if(r=s[e],"[object Object]"!==rf.call(r))return!1;if(1!==(i=Object.keys(r)).length)return!1;a[e]=[i[0],r[i[0]]]}return!0}function sf(t){if(null===t)return[];var e,n,r,i,a,s=t;for(a=new Array(s.length),e=0,n=s.length;e<n;e+=1)r=s[e],i=Object.keys(r),a[e]=[i[0],r[i[0]]];return a}s(af,"resolveYamlPairs"),s(sf,"constructYamlPairs");var of=new ag("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:af,construct:sf}),lf=Object.prototype.hasOwnProperty;function cf(t){if(null===t)return!0;var e,n=t;for(e in n)if(lf.call(n,e)&&null!==n[e])return!1;return!0}function hf(t){return null!==t?t:{}}s(cf,"resolveYamlSet"),s(hf,"constructYamlSet");var uf=new ag("tag:yaml.org,2002:set",{kind:"mapping",resolve:cf,construct:hf}),df=Bg.extend({implicit:[qg,Yg],explicit:[Zg,nf,of,uf]}),pf=Object.prototype.hasOwnProperty,gf=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,ff=/[\x85\u2028\u2029]/,mf=/[,\[\]\{\}]/,yf=/^(?:!|!!|![a-z\-]+!)$/i,vf=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function xf(t){return Object.prototype.toString.call(t)}function bf(t){return 10===t||13===t}function wf(t){return 9===t||32===t}function kf(t){return 9===t||32===t||10===t||13===t}function Tf(t){return 44===t||91===t||93===t||123===t||125===t}function _f(t){var e;return 48<=t&&t<=57?t-48:97<=(e=32|t)&&e<=102?e-97+10:-1}function Ef(t){return 120===t?2:117===t?4:85===t?8:0}function Cf(t){return 48<=t&&t<=57?t-48:-1}function Sf(t){return 48===t?"\0":97===t?"":98===t?"\b":116===t||9===t?"\t":110===t?"\n":118===t?"\v":102===t?"\f":114===t?"\r":101===t?"":32===t?" ":34===t?'"':47===t?"/":92===t?"\\":78===t?"…":95===t?" ":76===t?"\u2028":80===t?"\u2029":""}function Af(t){return t<=65535?String.fromCharCode(t):String.fromCharCode(55296+(t-65536>>10),56320+(t-65536&1023))}s(xf,"_class"),s(bf,"is_EOL"),s(wf,"is_WHITE_SPACE"),s(kf,"is_WS_OR_EOL"),s(Tf,"is_FLOW_INDICATOR"),s(_f,"fromHexCode"),s(Ef,"escapedHexLen"),s(Cf,"fromDecimalCode"),s(Sf,"simpleEscapeSequence"),s(Af,"charFromCodepoint");var Lf,Nf=new Array(256),If=new Array(256);for(Lf=0;Lf<256;Lf++)Nf[Lf]=Sf(Lf)?1:0,If[Lf]=Sf(Lf);function Mf(t,e){this.input=t,this.filename=e.filename||null,this.schema=e.schema||df,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=[]}function Rf(t,e){var n={name:t.filename,buffer:t.input.slice(0,-1),position:t.position,line:t.line,column:t.position-t.lineStart};return n.snippet=tg(n),new Kp(e,n)}function Df(t,e){throw Rf(t,e)}function Of(t,e){t.onWarning&&t.onWarning.call(null,Rf(t,e))}s(Mf,"State$1"),s(Rf,"generateError"),s(Df,"throwError"),s(Of,"throwWarning");var Pf={YAML:s((function(t,e,n){var r,i,a;null!==t.version&&Df(t,"duplication of %YAML directive"),1!==n.length&&Df(t,"YAML directive accepts exactly one argument"),null===(r=/^([0-9]+)\.([0-9]+)$/.exec(n[0]))&&Df(t,"ill-formed argument of the YAML directive"),i=parseInt(r[1],10),a=parseInt(r[2],10),1!==i&&Df(t,"unacceptable YAML version of the document"),t.version=n[0],t.checkLineBreaks=a<2,1!==a&&2!==a&&Of(t,"unsupported YAML version of the document")}),"handleYamlDirective"),TAG:s((function(t,e,n){var r,i;2!==n.length&&Df(t,"TAG directive accepts exactly two arguments"),r=n[0],i=n[1],yf.test(r)||Df(t,"ill-formed tag handle (first argument) of the TAG directive"),pf.call(t.tagMap,r)&&Df(t,'there is a previously declared suffix for "'+r+'" tag handle'),vf.test(i)||Df(t,"ill-formed tag prefix (second argument) of the TAG directive");try{i=decodeURIComponent(i)}catch(e){Df(t,"tag prefix is malformed: "+i)}t.tagMap[r]=i}),"handleTagDirective")};function Bf(t,e,n,r){var i,a,s,o;if(e<n){if(o=t.input.slice(e,n),r)for(i=0,a=o.length;i<a;i+=1)9===(s=o.charCodeAt(i))||32<=s&&s<=1114111||Df(t,"expected valid JSON character");else gf.test(o)&&Df(t,"the stream contains non-printable characters");t.result+=o}}function $f(t,e,n,r){var i,a,s,o;for(Hp.isObject(n)||Df(t,"cannot merge mappings; the provided source object is unacceptable"),s=0,o=(i=Object.keys(n)).length;s<o;s+=1)a=i[s],pf.call(e,a)||(e[a]=n[a],r[a]=!0)}function Ff(t,e,n,r,i,a,s,o,l){var c,h;if(Array.isArray(i))for(c=0,h=(i=Array.prototype.slice.call(i)).length;c<h;c+=1)Array.isArray(i[c])&&Df(t,"nested arrays are not supported inside keys"),"object"==typeof i&&"[object Object]"===xf(i[c])&&(i[c]="[object Object]");if("object"==typeof i&&"[object Object]"===xf(i)&&(i="[object Object]"),i=String(i),null===e&&(e={}),"tag:yaml.org,2002:merge"===r)if(Array.isArray(a))for(c=0,h=a.length;c<h;c+=1)$f(t,e,a[c],n);else $f(t,e,a,n);else t.json||pf.call(n,i)||!pf.call(e,i)||(t.line=s||t.line,t.lineStart=o||t.lineStart,t.position=l||t.position,Df(t,"duplicated mapping key")),"__proto__"===i?Object.defineProperty(e,i,{configurable:!0,enumerable:!0,writable:!0,value:a}):e[i]=a,delete n[i];return e}function zf(t){var e;10===(e=t.input.charCodeAt(t.position))?t.position++:13===e?(t.position++,10===t.input.charCodeAt(t.position)&&t.position++):Df(t,"a line break is expected"),t.line+=1,t.lineStart=t.position,t.firstTabInLine=-1}function Uf(t,e,n){for(var r=0,i=t.input.charCodeAt(t.position);0!==i;){for(;wf(i);)9===i&&-1===t.firstTabInLine&&(t.firstTabInLine=t.position),i=t.input.charCodeAt(++t.position);if(e&&35===i)do{i=t.input.charCodeAt(++t.position)}while(10!==i&&13!==i&&0!==i);if(!bf(i))break;for(zf(t),i=t.input.charCodeAt(t.position),r++,t.lineIndent=0;32===i;)t.lineIndent++,i=t.input.charCodeAt(++t.position)}return-1!==n&&0!==r&&t.lineIndent<n&&Of(t,"deficient indentation"),r}function Gf(t){var e,n=t.position;return!(45!==(e=t.input.charCodeAt(n))&&46!==e||e!==t.input.charCodeAt(n+1)||e!==t.input.charCodeAt(n+2)||(n+=3,0!==(e=t.input.charCodeAt(n))&&!kf(e)))}function qf(t,e){1===e?t.result+=" ":e>1&&(t.result+=Hp.repeat("\n",e-1))}function jf(t,e,n){var r,i,a,s,o,l,c,h,u=t.kind,d=t.result;if(kf(h=t.input.charCodeAt(t.position))||Tf(h)||35===h||38===h||42===h||33===h||124===h||62===h||39===h||34===h||37===h||64===h||96===h)return!1;if((63===h||45===h)&&(kf(r=t.input.charCodeAt(t.position+1))||n&&Tf(r)))return!1;for(t.kind="scalar",t.result="",i=a=t.position,s=!1;0!==h;){if(58===h){if(kf(r=t.input.charCodeAt(t.position+1))||n&&Tf(r))break}else if(35===h){if(kf(t.input.charCodeAt(t.position-1)))break}else{if(t.position===t.lineStart&&Gf(t)||n&&Tf(h))break;if(bf(h)){if(o=t.line,l=t.lineStart,c=t.lineIndent,Uf(t,!1,-1),t.lineIndent>=e){s=!0,h=t.input.charCodeAt(t.position);continue}t.position=a,t.line=o,t.lineStart=l,t.lineIndent=c;break}}s&&(Bf(t,i,a,!1),qf(t,t.line-o),i=a=t.position,s=!1),wf(h)||(a=t.position+1),h=t.input.charCodeAt(++t.position)}return Bf(t,i,a,!1),!!t.result||(t.kind=u,t.result=d,!1)}function Yf(t,e){var n,r,i;if(39!==(n=t.input.charCodeAt(t.position)))return!1;for(t.kind="scalar",t.result="",t.position++,r=i=t.position;0!==(n=t.input.charCodeAt(t.position));)if(39===n){if(Bf(t,r,t.position,!0),39!==(n=t.input.charCodeAt(++t.position)))return!0;r=t.position,t.position++,i=t.position}else bf(n)?(Bf(t,r,i,!0),qf(t,Uf(t,!1,e)),r=i=t.position):t.position===t.lineStart&&Gf(t)?Df(t,"unexpected end of the document within a single quoted scalar"):(t.position++,i=t.position);Df(t,"unexpected end of the stream within a single quoted scalar")}function Wf(t,e){var n,r,i,a,s,o;if(34!==(o=t.input.charCodeAt(t.position)))return!1;for(t.kind="scalar",t.result="",t.position++,n=r=t.position;0!==(o=t.input.charCodeAt(t.position));){if(34===o)return Bf(t,n,t.position,!0),t.position++,!0;if(92===o){if(Bf(t,n,t.position,!0),bf(o=t.input.charCodeAt(++t.position)))Uf(t,!1,e);else if(o<256&&Nf[o])t.result+=If[o],t.position++;else if((s=Ef(o))>0){for(i=s,a=0;i>0;i--)(s=_f(o=t.input.charCodeAt(++t.position)))>=0?a=(a<<4)+s:Df(t,"expected hexadecimal character");t.result+=Af(a),t.position++}else Df(t,"unknown escape sequence");n=r=t.position}else bf(o)?(Bf(t,n,r,!0),qf(t,Uf(t,!1,e)),n=r=t.position):t.position===t.lineStart&&Gf(t)?Df(t,"unexpected end of the document within a double quoted scalar"):(t.position++,r=t.position)}Df(t,"unexpected end of the stream within a double quoted scalar")}function Hf(t,e){var n,r,i,a,s,o,l,c,h,u,d,p,g=!0,f=t.tag,m=t.anchor,y=Object.create(null);if(91===(p=t.input.charCodeAt(t.position)))s=93,c=!1,a=[];else{if(123!==p)return!1;s=125,c=!0,a={}}for(null!==t.anchor&&(t.anchorMap[t.anchor]=a),p=t.input.charCodeAt(++t.position);0!==p;){if(Uf(t,!0,e),(p=t.input.charCodeAt(t.position))===s)return t.position++,t.tag=f,t.anchor=m,t.kind=c?"mapping":"sequence",t.result=a,!0;g?44===p&&Df(t,"expected the node content, but found ','"):Df(t,"missed comma between flow collection entries"),d=null,o=l=!1,63===p&&kf(t.input.charCodeAt(t.position+1))&&(o=l=!0,t.position++,Uf(t,!0,e)),n=t.line,r=t.lineStart,i=t.position,tm(t,e,1,!1,!0),u=t.tag,h=t.result,Uf(t,!0,e),p=t.input.charCodeAt(t.position),!l&&t.line!==n||58!==p||(o=!0,p=t.input.charCodeAt(++t.position),Uf(t,!0,e),tm(t,e,1,!1,!0),d=t.result),c?Ff(t,a,y,u,h,d,n,r,i):o?a.push(Ff(t,null,y,u,h,d,n,r,i)):a.push(h),Uf(t,!0,e),44===(p=t.input.charCodeAt(t.position))?(g=!0,p=t.input.charCodeAt(++t.position)):g=!1}Df(t,"unexpected end of the stream within a flow collection")}function Vf(t,e){var n,r,i,a,s=1,o=!1,l=!1,c=e,h=0,u=!1;if(124===(a=t.input.charCodeAt(t.position)))r=!1;else{if(62!==a)return!1;r=!0}for(t.kind="scalar",t.result="";0!==a;)if(43===(a=t.input.charCodeAt(++t.position))||45===a)1===s?s=43===a?3:2:Df(t,"repeat of a chomping mode identifier");else{if(!((i=Cf(a))>=0))break;0===i?Df(t,"bad explicit indentation width of a block scalar; it cannot be less than one"):l?Df(t,"repeat of an indentation width identifier"):(c=e+i-1,l=!0)}if(wf(a)){do{a=t.input.charCodeAt(++t.position)}while(wf(a));if(35===a)do{a=t.input.charCodeAt(++t.position)}while(!bf(a)&&0!==a)}for(;0!==a;){for(zf(t),t.lineIndent=0,a=t.input.charCodeAt(t.position);(!l||t.lineIndent<c)&&32===a;)t.lineIndent++,a=t.input.charCodeAt(++t.position);if(!l&&t.lineIndent>c&&(c=t.lineIndent),bf(a))h++;else{if(t.lineIndent<c){3===s?t.result+=Hp.repeat("\n",o?1+h:h):1===s&&o&&(t.result+="\n");break}for(r?wf(a)?(u=!0,t.result+=Hp.repeat("\n",o?1+h:h)):u?(u=!1,t.result+=Hp.repeat("\n",h+1)):0===h?o&&(t.result+=" "):t.result+=Hp.repeat("\n",h):t.result+=Hp.repeat("\n",o?1+h:h),o=!0,l=!0,h=0,n=t.position;!bf(a)&&0!==a;)a=t.input.charCodeAt(++t.position);Bf(t,n,t.position,!1)}}return!0}function Xf(t,e){var n,r,i=t.tag,a=t.anchor,s=[],o=!1;if(-1!==t.firstTabInLine)return!1;for(null!==t.anchor&&(t.anchorMap[t.anchor]=s),r=t.input.charCodeAt(t.position);0!==r&&(-1!==t.firstTabInLine&&(t.position=t.firstTabInLine,Df(t,"tab characters must not be used in indentation")),45===r)&&kf(t.input.charCodeAt(t.position+1));)if(o=!0,t.position++,Uf(t,!0,-1)&&t.lineIndent<=e)s.push(null),r=t.input.charCodeAt(t.position);else if(n=t.line,tm(t,e,3,!1,!0),s.push(t.result),Uf(t,!0,-1),r=t.input.charCodeAt(t.position),(t.line===n||t.lineIndent>e)&&0!==r)Df(t,"bad indentation of a sequence entry");else if(t.lineIndent<e)break;return!!o&&(t.tag=i,t.anchor=a,t.kind="sequence",t.result=s,!0)}function Kf(t,e,n){var r,i,a,s,o,l,c,h=t.tag,u=t.anchor,d={},p=Object.create(null),g=null,f=null,m=null,y=!1,v=!1;if(-1!==t.firstTabInLine)return!1;for(null!==t.anchor&&(t.anchorMap[t.anchor]=d),c=t.input.charCodeAt(t.position);0!==c;){if(y||-1===t.firstTabInLine||(t.position=t.firstTabInLine,Df(t,"tab characters must not be used in indentation")),r=t.input.charCodeAt(t.position+1),a=t.line,63!==c&&58!==c||!kf(r)){if(s=t.line,o=t.lineStart,l=t.position,!tm(t,n,2,!1,!0))break;if(t.line===a){for(c=t.input.charCodeAt(t.position);wf(c);)c=t.input.charCodeAt(++t.position);if(58===c)kf(c=t.input.charCodeAt(++t.position))||Df(t,"a whitespace character is expected after the key-value separator within a block mapping"),y&&(Ff(t,d,p,g,f,null,s,o,l),g=f=m=null),v=!0,y=!1,i=!1,g=t.tag,f=t.result;else{if(!v)return t.tag=h,t.anchor=u,!0;Df(t,"can not read an implicit mapping pair; a colon is missed")}}else{if(!v)return t.tag=h,t.anchor=u,!0;Df(t,"can not read a block mapping entry; a multiline key may not be an implicit key")}}else 63===c?(y&&(Ff(t,d,p,g,f,null,s,o,l),g=f=m=null),v=!0,y=!0,i=!0):y?(y=!1,i=!0):Df(t,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),t.position+=1,c=r;if((t.line===a||t.lineIndent>e)&&(y&&(s=t.line,o=t.lineStart,l=t.position),tm(t,e,4,!0,i)&&(y?f=t.result:m=t.result),y||(Ff(t,d,p,g,f,m,s,o,l),g=f=m=null),Uf(t,!0,-1),c=t.input.charCodeAt(t.position)),(t.line===a||t.lineIndent>e)&&0!==c)Df(t,"bad indentation of a mapping entry");else if(t.lineIndent<e)break}return y&&Ff(t,d,p,g,f,null,s,o,l),v&&(t.tag=h,t.anchor=u,t.kind="mapping",t.result=d),v}function Zf(t){var e,n,r,i,a=!1,s=!1;if(33!==(i=t.input.charCodeAt(t.position)))return!1;if(null!==t.tag&&Df(t,"duplication of a tag property"),60===(i=t.input.charCodeAt(++t.position))?(a=!0,i=t.input.charCodeAt(++t.position)):33===i?(s=!0,n="!!",i=t.input.charCodeAt(++t.position)):n="!",e=t.position,a){do{i=t.input.charCodeAt(++t.position)}while(0!==i&&62!==i);t.position<t.length?(r=t.input.slice(e,t.position),i=t.input.charCodeAt(++t.position)):Df(t,"unexpected end of the stream within a verbatim tag")}else{for(;0!==i&&!kf(i);)33===i&&(s?Df(t,"tag suffix cannot contain exclamation marks"):(n=t.input.slice(e-1,t.position+1),yf.test(n)||Df(t,"named tag handle cannot contain such characters"),s=!0,e=t.position+1)),i=t.input.charCodeAt(++t.position);r=t.input.slice(e,t.position),mf.test(r)&&Df(t,"tag suffix cannot contain flow indicator characters")}r&&!vf.test(r)&&Df(t,"tag name cannot contain such characters: "+r);try{r=decodeURIComponent(r)}catch(e){Df(t,"tag name is malformed: "+r)}return a?t.tag=r:pf.call(t.tagMap,n)?t.tag=t.tagMap[n]+r:"!"===n?t.tag="!"+r:"!!"===n?t.tag="tag:yaml.org,2002:"+r:Df(t,'undeclared tag handle "'+n+'"'),!0}function Qf(t){var e,n;if(38!==(n=t.input.charCodeAt(t.position)))return!1;for(null!==t.anchor&&Df(t,"duplication of an anchor property"),n=t.input.charCodeAt(++t.position),e=t.position;0!==n&&!kf(n)&&!Tf(n);)n=t.input.charCodeAt(++t.position);return t.position===e&&Df(t,"name of an anchor node must contain at least one character"),t.anchor=t.input.slice(e,t.position),!0}function Jf(t){var e,n,r;if(42!==(r=t.input.charCodeAt(t.position)))return!1;for(r=t.input.charCodeAt(++t.position),e=t.position;0!==r&&!kf(r)&&!Tf(r);)r=t.input.charCodeAt(++t.position);return t.position===e&&Df(t,"name of an alias node must contain at least one character"),n=t.input.slice(e,t.position),pf.call(t.anchorMap,n)||Df(t,'unidentified alias "'+n+'"'),t.result=t.anchorMap[n],Uf(t,!0,-1),!0}function tm(t,e,n,r,i){var a,s,o,l,c,h,u,d,p,g=1,f=!1,m=!1;if(null!==t.listener&&t.listener("open",t),t.tag=null,t.anchor=null,t.kind=null,t.result=null,a=s=o=4===n||3===n,r&&Uf(t,!0,-1)&&(f=!0,t.lineIndent>e?g=1:t.lineIndent===e?g=0:t.lineIndent<e&&(g=-1)),1===g)for(;Zf(t)||Qf(t);)Uf(t,!0,-1)?(f=!0,o=a,t.lineIndent>e?g=1:t.lineIndent===e?g=0:t.lineIndent<e&&(g=-1)):o=!1;if(o&&(o=f||i),1!==g&&4!==n||(d=1===n||2===n?e:e+1,p=t.position-t.lineStart,1===g?o&&(Xf(t,p)||Kf(t,p,d))||Hf(t,d)?m=!0:(s&&Vf(t,d)||Yf(t,d)||Wf(t,d)?m=!0:Jf(t)?(m=!0,null===t.tag&&null===t.anchor||Df(t,"alias node should not have any properties")):jf(t,d,1===n)&&(m=!0,null===t.tag&&(t.tag="?")),null!==t.anchor&&(t.anchorMap[t.anchor]=t.result)):0===g&&(m=o&&Xf(t,p))),null===t.tag)null!==t.anchor&&(t.anchorMap[t.anchor]=t.result);else if("?"===t.tag){for(null!==t.result&&"scalar"!==t.kind&&Df(t,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+t.kind+'"'),l=0,c=t.implicitTypes.length;l<c;l+=1)if((u=t.implicitTypes[l]).resolve(t.result)){t.result=u.construct(t.result),t.tag=u.tag,null!==t.anchor&&(t.anchorMap[t.anchor]=t.result);break}}else if("!"!==t.tag){if(pf.call(t.typeMap[t.kind||"fallback"],t.tag))u=t.typeMap[t.kind||"fallback"][t.tag];else for(u=null,l=0,c=(h=t.typeMap.multi[t.kind||"fallback"]).length;l<c;l+=1)if(t.tag.slice(0,h[l].tag.length)===h[l].tag){u=h[l];break}u||Df(t,"unknown tag !<"+t.tag+">"),null!==t.result&&u.kind!==t.kind&&Df(t,"unacceptable node kind for !<"+t.tag+'> tag; it should be "'+u.kind+'", not "'+t.kind+'"'),u.resolve(t.result,t.tag)?(t.result=u.construct(t.result,t.tag),null!==t.anchor&&(t.anchorMap[t.anchor]=t.result)):Df(t,"cannot resolve a node with !<"+t.tag+"> explicit tag")}return null!==t.listener&&t.listener("close",t),null!==t.tag||null!==t.anchor||m}function em(t){var e,n,r,i,a=t.position,s=!1;for(t.version=null,t.checkLineBreaks=t.legacy,t.tagMap=Object.create(null),t.anchorMap=Object.create(null);0!==(i=t.input.charCodeAt(t.position))&&(Uf(t,!0,-1),i=t.input.charCodeAt(t.position),!(t.lineIndent>0||37!==i));){for(s=!0,i=t.input.charCodeAt(++t.position),e=t.position;0!==i&&!kf(i);)i=t.input.charCodeAt(++t.position);for(r=[],(n=t.input.slice(e,t.position)).length<1&&Df(t,"directive name must not be less than one character in length");0!==i;){for(;wf(i);)i=t.input.charCodeAt(++t.position);if(35===i){do{i=t.input.charCodeAt(++t.position)}while(0!==i&&!bf(i));break}if(bf(i))break;for(e=t.position;0!==i&&!kf(i);)i=t.input.charCodeAt(++t.position);r.push(t.input.slice(e,t.position))}0!==i&&zf(t),pf.call(Pf,n)?Pf[n](t,n,r):Of(t,'unknown document directive "'+n+'"')}Uf(t,!0,-1),0===t.lineIndent&&45===t.input.charCodeAt(t.position)&&45===t.input.charCodeAt(t.position+1)&&45===t.input.charCodeAt(t.position+2)?(t.position+=3,Uf(t,!0,-1)):s&&Df(t,"directives end mark is expected"),tm(t,t.lineIndent-1,4,!1,!0),Uf(t,!0,-1),t.checkLineBreaks&&ff.test(t.input.slice(a,t.position))&&Of(t,"non-ASCII line breaks are interpreted as content"),t.documents.push(t.result),t.position===t.lineStart&&Gf(t)?46===t.input.charCodeAt(t.position)&&(t.position+=3,Uf(t,!0,-1)):t.position<t.length-1&&Df(t,"end of the stream or a document separator is expected")}function nm(t,e){e=e||{},0!==(t=String(t)).length&&(10!==t.charCodeAt(t.length-1)&&13!==t.charCodeAt(t.length-1)&&(t+="\n"),65279===t.charCodeAt(0)&&(t=t.slice(1)));var n=new Mf(t,e),r=t.indexOf("\0");for(-1!==r&&(n.position=r,Df(n,"null byte is not allowed in input")),n.input+="\0";32===n.input.charCodeAt(n.position);)n.lineIndent+=1,n.position+=1;for(;n.position<n.length-1;)em(n);return n.documents}function rm(t,e,n){null!==e&&"object"==typeof e&&void 0===n&&(n=e,e=null);var r=nm(t,n);if("function"!=typeof e)return r;for(var i=0,a=r.length;i<a;i+=1)e(r[i])}function im(t,e){var n=nm(t,e);if(0!==n.length){if(1===n.length)return n[0];throw new Kp("expected a single document in the stream, but found more")}}s(Bf,"captureSegment"),s($f,"mergeMappings"),s(Ff,"storeMappingPair"),s(zf,"readLineBreak"),s(Uf,"skipSeparationSpace"),s(Gf,"testDocumentSeparator"),s(qf,"writeFoldedLines"),s(jf,"readPlainScalar"),s(Yf,"readSingleQuotedScalar"),s(Wf,"readDoubleQuotedScalar"),s(Hf,"readFlowCollection"),s(Vf,"readBlockScalar"),s(Xf,"readBlockSequence"),s(Kf,"readBlockMapping"),s(Zf,"readTagProperty"),s(Qf,"readAnchorProperty"),s(Jf,"readAlias"),s(tm,"composeNode"),s(em,"readDocument"),s(nm,"loadDocuments"),s(rm,"loadAll$1"),s(im,"load$1");var am={loadAll:rm,load:im},sm=Object.prototype.toString,om=Object.prototype.hasOwnProperty,lm={0:"\\0",7:"\\a",8:"\\b",9:"\\t",10:"\\n",11:"\\v",12:"\\f",13:"\\r",27:"\\e",34:'\\"',92:"\\\\",133:"\\N",160:"\\_",8232:"\\L",8233:"\\P"},cm=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],hm=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function um(t,e){var n,r,i,a,s,o,l;if(null===e)return{};for(n={},i=0,a=(r=Object.keys(e)).length;i<a;i+=1)s=r[i],o=String(e[s]),"!!"===s.slice(0,2)&&(s="tag:yaml.org,2002:"+s.slice(2)),(l=t.compiledTypeMap.fallback[s])&&om.call(l.styleAliases,o)&&(o=l.styleAliases[o]),n[s]=o;return n}function dm(t){var e,n,r;if(e=t.toString(16).toUpperCase(),t<=255)n="x",r=2;else if(t<=65535)n="u",r=4;else{if(!(t<=4294967295))throw new Kp("code point within a string may not be greater than 0xFFFFFFFF");n="U",r=8}return"\\"+n+Hp.repeat("0",r-e.length)+e}s(um,"compileStyleMap"),s(dm,"encodeHex");function pm(t){this.schema=t.schema||df,this.indent=Math.max(1,t.indent||2),this.noArrayIndent=t.noArrayIndent||!1,this.skipInvalid=t.skipInvalid||!1,this.flowLevel=Hp.isNothing(t.flowLevel)?-1:t.flowLevel,this.styleMap=um(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?2:1,this.forceQuotes=t.forceQuotes||!1,this.replacer="function"==typeof t.replacer?t.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function gm(t,e){for(var n,r=Hp.repeat(" ",e),i=0,a=-1,s="",o=t.length;i<o;)-1===(a=t.indexOf("\n",i))?(n=t.slice(i),i=o):(n=t.slice(i,a+1),i=a+1),n.length&&"\n"!==n&&(s+=r),s+=n;return s}function fm(t,e){return"\n"+Hp.repeat(" ",t.indent*e)}function mm(t,e){var n,r;for(n=0,r=t.implicitTypes.length;n<r;n+=1)if(t.implicitTypes[n].resolve(e))return!0;return!1}function ym(t){return 32===t||9===t}function vm(t){return 32<=t&&t<=126||161<=t&&t<=55295&&8232!==t&&8233!==t||57344<=t&&t<=65533&&65279!==t||65536<=t&&t<=1114111}function xm(t){return vm(t)&&65279!==t&&13!==t&&10!==t}function bm(t,e,n){var r=xm(t),i=r&&!ym(t);return(n?r:r&&44!==t&&91!==t&&93!==t&&123!==t&&125!==t)&&35!==t&&!(58===e&&!i)||xm(e)&&!ym(e)&&35===t||58===e&&i}function wm(t){return vm(t)&&65279!==t&&!ym(t)&&45!==t&&63!==t&&58!==t&&44!==t&&91!==t&&93!==t&&123!==t&&125!==t&&35!==t&&38!==t&&42!==t&&33!==t&&124!==t&&61!==t&&62!==t&&39!==t&&34!==t&&37!==t&&64!==t&&96!==t}function km(t){return!ym(t)&&58!==t}function Tm(t,e){var n,r=t.charCodeAt(e);return r>=55296&&r<=56319&&e+1<t.length&&(n=t.charCodeAt(e+1))>=56320&&n<=57343?1024*(r-55296)+n-56320+65536:r}function _m(t){return/^\n* /.test(t)}s(pm,"State"),s(gm,"indentString"),s(fm,"generateNextLine"),s(mm,"testImplicitResolving"),s(ym,"isWhitespace"),s(vm,"isPrintable"),s(xm,"isNsCharOrWhitespace"),s(bm,"isPlainSafe"),s(wm,"isPlainSafeFirst"),s(km,"isPlainSafeLast"),s(Tm,"codePointAt"),s(_m,"needIndentIndicator");function Em(t,e,n,r,i,a,s,o){var l,c=0,h=null,u=!1,d=!1,p=-1!==r,g=-1,f=wm(Tm(t,0))&&km(Tm(t,t.length-1));if(e||s)for(l=0;l<t.length;c>=65536?l+=2:l++){if(!vm(c=Tm(t,l)))return 5;f=f&&bm(c,h,o),h=c}else{for(l=0;l<t.length;c>=65536?l+=2:l++){if(10===(c=Tm(t,l)))u=!0,p&&(d=d||l-g-1>r&&" "!==t[g+1],g=l);else if(!vm(c))return 5;f=f&&bm(c,h,o),h=c}d=d||p&&l-g-1>r&&" "!==t[g+1]}return u||d?n>9&&_m(t)?5:s?2===a?5:2:d?4:3:!f||s||i(t)?2===a?5:2:1}function Cm(t,e,n,r,i){t.dump=function(){if(0===e.length)return 2===t.quotingType?'""':"''";if(!t.noCompatMode&&(-1!==cm.indexOf(e)||hm.test(e)))return 2===t.quotingType?'"'+e+'"':"'"+e+"'";var a=t.indent*Math.max(1,n),o=-1===t.lineWidth?-1:Math.max(Math.min(t.lineWidth,40),t.lineWidth-a),l=r||t.flowLevel>-1&&n>=t.flowLevel;function c(e){return mm(t,e)}switch(s(c,"testAmbiguity"),Em(e,l,t.indent,o,c,t.quotingType,t.forceQuotes&&!r,i)){case 1:return e;case 2:return"'"+e.replace(/'/g,"''")+"'";case 3:return"|"+Sm(e,t.indent)+Am(gm(e,a));case 4:return">"+Sm(e,t.indent)+Am(gm(Lm(e,o),a));case 5:return'"'+Im(e)+'"';default:throw new Kp("impossible error: invalid scalar style")}}()}function Sm(t,e){var n=_m(t)?String(e):"",r="\n"===t[t.length-1];return n+(r&&("\n"===t[t.length-2]||"\n"===t)?"+":r?"":"-")+"\n"}function Am(t){return"\n"===t[t.length-1]?t.slice(0,-1):t}function Lm(t,e){for(var n,r,i,a=/(\n+)([^\n]*)/g,s=(n=-1!==(n=t.indexOf("\n"))?n:t.length,a.lastIndex=n,Nm(t.slice(0,n),e)),o="\n"===t[0]||" "===t[0];i=a.exec(t);){var l=i[1],c=i[2];r=" "===c[0],s+=l+(o||r||""===c?"":"\n")+Nm(c,e),o=r}return s}function Nm(t,e){if(""===t||" "===t[0])return t;for(var n,r,i=/ [^ ]/g,a=0,s=0,o=0,l="";n=i.exec(t);)(o=n.index)-a>e&&(r=s>a?s:o,l+="\n"+t.slice(a,r),a=r+1),s=o;return l+="\n",t.length-a>e&&s>a?l+=t.slice(a,s)+"\n"+t.slice(s+1):l+=t.slice(a),l.slice(1)}function Im(t){for(var e,n="",r=0,i=0;i<t.length;r>=65536?i+=2:i++)r=Tm(t,i),!(e=lm[r])&&vm(r)?(n+=t[i],r>=65536&&(n+=t[i+1])):n+=e||dm(r);return n}function Mm(t,e,n){var r,i,a,s="",o=t.tag;for(r=0,i=n.length;r<i;r+=1)a=n[r],t.replacer&&(a=t.replacer.call(n,String(r),a)),(Bm(t,e,a,!1,!1)||void 0===a&&Bm(t,e,null,!1,!1))&&(""!==s&&(s+=","+(t.condenseFlow?"":" ")),s+=t.dump);t.tag=o,t.dump="["+s+"]"}function Rm(t,e,n,r){var i,a,s,o="",l=t.tag;for(i=0,a=n.length;i<a;i+=1)s=n[i],t.replacer&&(s=t.replacer.call(n,String(i),s)),(Bm(t,e+1,s,!0,!0,!1,!0)||void 0===s&&Bm(t,e+1,null,!0,!0,!1,!0))&&(r&&""===o||(o+=fm(t,e)),t.dump&&10===t.dump.charCodeAt(0)?o+="-":o+="- ",o+=t.dump);t.tag=l,t.dump=o||"[]"}function Dm(t,e,n){var r,i,a,s,o,l="",c=t.tag,h=Object.keys(n);for(r=0,i=h.length;r<i;r+=1)o="",""!==l&&(o+=", "),t.condenseFlow&&(o+='"'),s=n[a=h[r]],t.replacer&&(s=t.replacer.call(n,a,s)),Bm(t,e,a,!1,!1)&&(t.dump.length>1024&&(o+="? "),o+=t.dump+(t.condenseFlow?'"':"")+":"+(t.condenseFlow?"":" "),Bm(t,e,s,!1,!1)&&(l+=o+=t.dump));t.tag=c,t.dump="{"+l+"}"}function Om(t,e,n,r){var i,a,s,o,l,c,h="",u=t.tag,d=Object.keys(n);if(!0===t.sortKeys)d.sort();else if("function"==typeof t.sortKeys)d.sort(t.sortKeys);else if(t.sortKeys)throw new Kp("sortKeys must be a boolean or a function");for(i=0,a=d.length;i<a;i+=1)c="",r&&""===h||(c+=fm(t,e)),o=n[s=d[i]],t.replacer&&(o=t.replacer.call(n,s,o)),Bm(t,e+1,s,!0,!0,!0)&&((l=null!==t.tag&&"?"!==t.tag||t.dump&&t.dump.length>1024)&&(t.dump&&10===t.dump.charCodeAt(0)?c+="?":c+="? "),c+=t.dump,l&&(c+=fm(t,e)),Bm(t,e+1,o,!0,l)&&(t.dump&&10===t.dump.charCodeAt(0)?c+=":":c+=": ",h+=c+=t.dump));t.tag=u,t.dump=h||"{}"}function Pm(t,e,n){var r,i,a,s,o,l;for(a=0,s=(i=n?t.explicitTypes:t.implicitTypes).length;a<s;a+=1)if(((o=i[a]).instanceOf||o.predicate)&&(!o.instanceOf||"object"==typeof e&&e instanceof o.instanceOf)&&(!o.predicate||o.predicate(e))){if(n?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,"[object Function]"===sm.call(o.represent))r=o.represent(e,l);else{if(!om.call(o.represent,l))throw new Kp("!<"+o.tag+'> tag resolver accepts not "'+l+'" style');r=o.represent[l](e,l)}t.dump=r}return!0}return!1}function Bm(t,e,n,r,i,a,s){t.tag=null,t.dump=n,Pm(t,n,!1)||Pm(t,n,!0);var o,l=sm.call(t.dump),c=r;r&&(r=t.flowLevel<0||t.flowLevel>e);var h,u,d="[object Object]"===l||"[object Array]"===l;if(d&&(u=-1!==(h=t.duplicates.indexOf(n))),(null!==t.tag&&"?"!==t.tag||u||2!==t.indent&&e>0)&&(i=!1),u&&t.usedDuplicates[h])t.dump="*ref_"+h;else{if(d&&u&&!t.usedDuplicates[h]&&(t.usedDuplicates[h]=!0),"[object Object]"===l)r&&0!==Object.keys(t.dump).length?(Om(t,e,t.dump,i),u&&(t.dump="&ref_"+h+t.dump)):(Dm(t,e,t.dump),u&&(t.dump="&ref_"+h+" "+t.dump));else if("[object Array]"===l)r&&0!==t.dump.length?(t.noArrayIndent&&!s&&e>0?Rm(t,e-1,t.dump,i):Rm(t,e,t.dump,i),u&&(t.dump="&ref_"+h+t.dump)):(Mm(t,e,t.dump),u&&(t.dump="&ref_"+h+" "+t.dump));else{if("[object String]"!==l){if("[object Undefined]"===l)return!1;if(t.skipInvalid)return!1;throw new Kp("unacceptable kind of an object to dump "+l)}"?"!==t.tag&&Cm(t,t.dump,e,a,c)}null!==t.tag&&"?"!==t.tag&&(o=encodeURI("!"===t.tag[0]?t.tag.slice(1):t.tag).replace(/!/g,"%21"),o="!"===t.tag[0]?"!"+o:"tag:yaml.org,2002:"===o.slice(0,18)?"!!"+o.slice(18):"!<"+o+">",t.dump=o+" "+t.dump)}return!0}function $m(t,e){var n,r,i=[],a=[];for(Fm(t,i,a),n=0,r=a.length;n<r;n+=1)e.duplicates.push(i[a[n]]);e.usedDuplicates=new Array(r)}function Fm(t,e,n){var r,i,a;if(null!==t&&"object"==typeof t)if(-1!==(i=e.indexOf(t)))-1===n.indexOf(i)&&n.push(i);else if(e.push(t),Array.isArray(t))for(i=0,a=t.length;i<a;i+=1)Fm(t[i],e,n);else for(i=0,a=(r=Object.keys(t)).length;i<a;i+=1)Fm(t[r[i]],e,n)}s(Em,"chooseScalarStyle"),s(Cm,"writeScalar"),s(Sm,"blockHeader"),s(Am,"dropEndingNewline"),s(Lm,"foldString"),s(Nm,"foldLine"),s(Im,"escapeString"),s(Mm,"writeFlowSequence"),s(Rm,"writeBlockSequence"),s(Dm,"writeFlowMapping"),s(Om,"writeBlockMapping"),s(Pm,"detectType"),s(Bm,"writeNode"),s($m,"getDuplicateReferences"),s(Fm,"inspectNode"),s((function(t,e){var n=new pm(e=e||{});n.noRefs||$m(t,n);var r=t;return n.replacer&&(r=n.replacer.call({"":r},"",r)),Bm(n,0,r,!0,!0)?n.dump+"\n":""}),"dump$1"),s((function(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.")}}),"renamed");var zm=Pg,Um=am.load,Gm=s((({flowchart:t})=>{const e=t?.subGraphTitleMargin?.top??0,n=t?.subGraphTitleMargin?.bottom??0;return{subGraphTitleTopMargin:e,subGraphTitleBottomMargin:n,subGraphTitleTotalMargin:e+n}}),"getSubGraphTitleMargins"),qm=o({"../../node_modules/.pnpm/ms@2.1.3/node_modules/ms/index.js"(t,e){var n=1e3,r=60*n,i=60*r,a=24*i;function o(t){if(!((t=String(t)).length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(e){var s=parseFloat(e[1]);switch((e[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*s;case"weeks":case"week":case"w":return 6048e5*s;case"days":case"day":case"d":return s*a;case"hours":case"hour":case"hrs":case"hr":case"h":return s*i;case"minutes":case"minute":case"mins":case"min":case"m":return s*r;case"seconds":case"second":case"secs":case"sec":case"s":return s*n;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return s;default:return}}}}function l(t){var e=Math.abs(t);return e>=a?Math.round(t/a)+"d":e>=i?Math.round(t/i)+"h":e>=r?Math.round(t/r)+"m":e>=n?Math.round(t/n)+"s":t+"ms"}function c(t){var e=Math.abs(t);return e>=a?h(t,e,a,"day"):e>=i?h(t,e,i,"hour"):e>=r?h(t,e,r,"minute"):e>=n?h(t,e,n,"second"):t+" ms"}function h(t,e,n,r){var i=e>=1.5*n;return Math.round(t/n)+" "+r+(i?"s":"")}e.exports=function(t,e){e=e||{};var n=typeof t;if("string"===n&&t.length>0)return o(t);if("number"===n&&isFinite(t))return e.long?c(t):l(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))},s(o,"parse"),s(l,"fmtShort"),s(c,"fmtLong"),s(h,"plural")}}),jm=o({"../../node_modules/.pnpm/debug@4.3.7_supports-color@8.1.1/node_modules/debug/src/common.js"(t,e){function n(t){function e(t){let e=0;for(let n=0;n<t.length;n++)e=(e<<5)-e+t.charCodeAt(n),e|=0;return n.colors[Math.abs(e)%n.colors.length]}function n(t){let e,i,a,o=null;function l(...t){if(!l.enabled)return;const r=l,i=Number(new Date),a=i-(e||i);r.diff=a,r.prev=e,r.curr=i,e=i,t[0]=n.coerce(t[0]),"string"!=typeof t[0]&&t.unshift("%O");let s=0;t[0]=t[0].replace(/%([a-zA-Z%])/g,((e,i)=>{if("%%"===e)return"%";s++;const a=n.formatters[i];if("function"==typeof a){const n=t[s];e=a.call(r,n),t.splice(s,1),s--}return e})),n.formatArgs.call(r,t);(r.log||n.log).apply(r,t)}return s(l,"debug"),l.namespace=t,l.useColors=n.useColors(),l.color=n.selectColor(t),l.extend=r,l.destroy=n.destroy,Object.defineProperty(l,"enabled",{enumerable:!0,configurable:!1,get:s((()=>null!==o?o:(i!==n.namespaces&&(i=n.namespaces,a=n.enabled(t)),a)),"get"),set:s((t=>{o=t}),"set")}),"function"==typeof n.init&&n.init(l),l}function r(t,e){const r=n(this.namespace+(void 0===e?":":e)+t);return r.log=this.log,r}function i(t){let e;n.save(t),n.namespaces=t,n.names=[],n.skips=[];const r=("string"==typeof t?t:"").split(/[\s,]+/),i=r.length;for(e=0;e<i;e++)r[e]&&("-"===(t=r[e].replace(/\*/g,".*?"))[0]?n.skips.push(new RegExp("^"+t.slice(1)+"$")):n.names.push(new RegExp("^"+t+"$")))}function a(){const t=[...n.names.map(l),...n.skips.map(l).map((t=>"-"+t))].join(",");return n.enable(""),t}function o(t){if("*"===t[t.length-1])return!0;let e,r;for(e=0,r=n.skips.length;e<r;e++)if(n.skips[e].test(t))return!1;for(e=0,r=n.names.length;e<r;e++)if(n.names[e].test(t))return!0;return!1}function l(t){return t.toString().substring(2,t.toString().length-2).replace(/\.\*\?$/,"*")}function c(t){return t instanceof Error?t.stack||t.message:t}function h(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return n.debug=n,n.default=n,n.coerce=c,n.disable=a,n.enable=i,n.enabled=o,n.humanize=qm(),n.destroy=h,Object.keys(t).forEach((e=>{n[e]=t[e]})),n.names=[],n.skips=[],n.formatters={},s(e,"selectColor"),n.selectColor=e,s(n,"createDebug"),s(r,"extend"),s(i,"enable"),s(a,"disable"),s(o,"enabled"),s(l,"toNamespace"),s(c,"coerce"),s(h,"destroy"),n.enable(n.load()),n}s(n,"setup"),e.exports=n}}),Ym=o({"../../node_modules/.pnpm/debug@4.3.7_supports-color@8.1.1/node_modules/debug/src/browser.js"(t,e){function n(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let t;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&(t=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(t[1],10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function r(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;t.splice(1,0,n,"color: inherit");let r=0,i=0;t[0].replace(/%[a-zA-Z%]/g,(t=>{"%%"!==t&&(r++,"%c"===t&&(i=r))})),t.splice(i,0,n)}function i(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(t){}}function a(){let e;try{e=t.storage.getItem("debug")}catch(t){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e}function o(){try{return localStorage}catch(t){}}t.formatArgs=r,t.save=i,t.load=a,t.useColors=n,t.storage=o(),t.destroy=(()=>{let t=!1;return()=>{t||(t=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],s(n,"useColors"),s(r,"formatArgs"),t.log=console.debug||console.log||(()=>{}),s(i,"save"),s(a,"load"),s(o,"localstorage"),e.exports=jm()(t);var{formatters:l}=e.exports;l.j=function(t){try{return JSON.stringify(t)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}}}),Wm=Object.freeze({left:0,top:0,width:16,height:16}),Hm=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),Vm=Object.freeze({...Wm,...Hm}),Xm=Object.freeze({...Vm,body:"",hidden:!1}),Km=Object.freeze({width:null,height:null}),Zm=Object.freeze({...Km,...Hm}),Qm=/^[a-z0-9]+(-[a-z0-9]+)*$/,Jm=s(((t,e,n,r="")=>{const i=t.split(":");if("@"===t.slice(0,1)){if(i.length<2||i.length>3)return null;r=i.shift().slice(1)}if(i.length>3||!i.length)return null;if(i.length>1){const t=i.pop(),n=i.pop(),a={provider:i.length>0?i[0]:r,prefix:n,name:t};return e&&!ty(a)?null:a}const a=i[0],s=a.split("-");if(s.length>1){const t={provider:r,prefix:s.shift(),name:s.join("-")};return e&&!ty(t)?null:t}if(n&&""===r){const t={provider:r,prefix:"",name:a};return e&&!ty(t,n)?null:t}return null}),"stringToIcon"),ty=s(((t,e)=>!!t&&!(""!==t.provider&&!t.provider.match(Qm)||!(e&&""===t.prefix||t.prefix.match(Qm))||!t.name.match(Qm))),"validateIconName");function ey(t,e){const n={};!t.hFlip!=!e.hFlip&&(n.hFlip=!0),!t.vFlip!=!e.vFlip&&(n.vFlip=!0);const r=((t.rotate||0)+(e.rotate||0))%4;return r&&(n.rotate=r),n}function ny(t,e){const n=ey(t,e);for(const r in Xm)r in Hm?r in t&&!(r in n)&&(n[r]=Hm[r]):r in e?n[r]=e[r]:r in t&&(n[r]=t[r]);return n}function ry(t,e){const n=t.icons,r=t.aliases||Object.create(null),i=Object.create(null);function a(t){if(n[t])return i[t]=[];if(!(t in i)){i[t]=null;const e=r[t]&&r[t].parent,n=e&&a(e);n&&(i[t]=[e].concat(n))}return i[t]}return s(a,"resolve"),(e||Object.keys(n).concat(Object.keys(r))).forEach(a),i}function iy(t,e,n){const r=t.icons,i=t.aliases||Object.create(null);let a={};function o(t){a=ny(r[t]||i[t],a)}return s(o,"parse"),o(e),n.forEach(o),ny(t,a)}function ay(t,e){if(t.icons[e])return iy(t,e,[]);const n=ry(t,[e])[e];return n?iy(t,e,n):null}s(ey,"mergeIconTransformations"),s(ny,"mergeIconData"),s(ry,"getIconsTree"),s(iy,"internalGetIconData"),s(ay,"getIconData");var sy=/(-?[0-9.]*[0-9]+[0-9.]*)/g,oy=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function ly(t,e,n){if(1===e)return t;if(n=n||100,"number"==typeof t)return Math.ceil(t*e*n)/n;if("string"!=typeof t)return t;const r=t.split(sy);if(null===r||!r.length)return t;const i=[];let a=r.shift(),s=oy.test(a);for(;;){if(s){const t=parseFloat(a);isNaN(t)?i.push(a):i.push(Math.ceil(t*e*n)/n)}else i.push(a);if(a=r.shift(),void 0===a)return i.join("");s=!s}}function cy(t,e="defs"){let n="";const r=t.indexOf("<"+e);for(;r>=0;){const i=t.indexOf(">",r),a=t.indexOf("</"+e);if(-1===i||-1===a)break;const s=t.indexOf(">",a);if(-1===s)break;n+=t.slice(i+1,a).trim(),t=t.slice(0,r).trim()+t.slice(s+1)}return{defs:n,content:t}}function hy(t,e){return t?"<defs>"+t+"</defs>"+e:e}function uy(t,e,n){const r=cy(t);return hy(r.defs,e+r.content+n)}s(ly,"calculateSize"),s(cy,"splitSVGDefs"),s(hy,"mergeDefsAndContent"),s(uy,"wrapSVGContent");var dy=s((t=>"unset"===t||"undefined"===t||"none"===t),"isUnsetKeyword");function py(t,e){const n={...Vm,...t},r={...Zm,...e},i={left:n.left,top:n.top,width:n.width,height:n.height};let a=n.body;[n,r].forEach((t=>{const e=[],n=t.hFlip,r=t.vFlip;let s,o=t.rotate;switch(n?r?o+=2:(e.push("translate("+(i.width+i.left).toString()+" "+(0-i.top).toString()+")"),e.push("scale(-1 1)"),i.top=i.left=0):r&&(e.push("translate("+(0-i.left).toString()+" "+(i.height+i.top).toString()+")"),e.push("scale(1 -1)"),i.top=i.left=0),o<0&&(o-=4*Math.floor(o/4)),o%=4,o){case 1:s=i.height/2+i.top,e.unshift("rotate(90 "+s.toString()+" "+s.toString()+")");break;case 2:e.unshift("rotate(180 "+(i.width/2+i.left).toString()+" "+(i.height/2+i.top).toString()+")");break;case 3:s=i.width/2+i.left,e.unshift("rotate(-90 "+s.toString()+" "+s.toString()+")")}o%2==1&&(i.left!==i.top&&(s=i.left,i.left=i.top,i.top=s),i.width!==i.height&&(s=i.width,i.width=i.height,i.height=s)),e.length&&(a=uy(a,'<g transform="'+e.join(" ")+'">',"</g>"))}));const o=r.width,l=r.height,c=i.width,h=i.height;let u,d;null===o?(d=null===l?"1em":"auto"===l?h:l,u=ly(d,c/h)):(u="auto"===o?c:o,d=null===l?ly(u,h/c):"auto"===l?h:l);const p={},g=s(((t,e)=>{dy(e)||(p[t]=e.toString())}),"setAttr");g("width",u),g("height",d);const f=[i.left,i.top,c,h];return p.viewBox=f.join(" "),{attributes:p,viewBox:f,body:a}}s(py,"iconToSVG");var gy=/\sid="(\S+)"/g,fy="IconifyId"+Date.now().toString(16)+(16777216*Math.random()|0).toString(16),my=0;function yy(t,e=fy){const n=[];let r;for(;r=gy.exec(t);)n.push(r[1]);if(!n.length)return t;const i="suffix"+(16777216*Math.random()|Date.now()).toString(16);return n.forEach((n=>{const r="function"==typeof e?e(n):e+(my++).toString(),a=n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");t=t.replace(new RegExp('([#;"])('+a+')([")]|\\.[a-z])',"g"),"$1"+r+i+"$3")})),t=t.replace(new RegExp(i,"g"),"")}function vy(t,e){let n=-1===t.indexOf("xlink:")?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const t in e)n+=" "+t+'="'+e[t]+'"';return'<svg xmlns="http://www.w3.org/2000/svg"'+n+">"+t+"</svg>"}s(yy,"replaceIDs"),s(vy,"iconToHTML"),d(Ym(),1);var xy={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},by=new Map,wy=new Map,ky=s((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(m.debug("Registering icon pack:",e.name),"loader"in e)wy.set(e.name,e.loader);else{if(!("icons"in e))throw m.error("Invalid icon loader:",e),new Error('Invalid icon loader. Must have either "icons" or "loader" property.');by.set(e.name,e.icons)}}}),"registerIconPacks"),Ty=s((async(t,e)=>{const n=Jm(t,!0,void 0!==e);if(!n)throw new Error(`Invalid icon name: ${t}`);const r=n.prefix||e;if(!r)throw new Error(`Icon name must contain a prefix: ${t}`);let i=by.get(r);if(!i){const t=wy.get(r);if(!t)throw new Error(`Icon set not found: ${n.prefix}`);try{i={...await t(),prefix:r},by.set(r,i)}catch(t){throw m.error(t),new Error(`Failed to load icon set: ${n.prefix}`)}}const a=ay(i,n.name);if(!a)throw new Error(`Icon not found: ${t}`);return a}),"getRegisteredIconData"),_y=s((async(t,e)=>{let n;try{n=await Ty(t,e?.fallbackPrefix)}catch(t){m.error(t),n=xy}const r=py(n,e);return vy(yy(r.body),r.attributes)}),"getIconSVG"),Ey=o({"../../node_modules/.pnpm/@braintree+sanitize-url@7.1.0/node_modules/@braintree/sanitize-url/dist/constants.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.BLANK_URL=t.relativeFirstCharacters=t.whitespaceEscapeCharsRegex=t.urlSchemeRegex=t.ctrlCharactersRegex=t.htmlCtrlEntityRegex=t.htmlEntitiesRegex=t.invalidProtocolRegex=void 0,t.invalidProtocolRegex=/^([^\w]*)(javascript|data|vbscript)/im,t.htmlEntitiesRegex=/&#(\w+)(^\w|;)?/g,t.htmlCtrlEntityRegex=/&(newline|tab);/gi,t.ctrlCharactersRegex=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim,t.urlSchemeRegex=/^.+(:|&colon;)/gim,t.whitespaceEscapeCharsRegex=/(\\|%5[cC])((%(6[eE]|72|74))|[nrt])/g,t.relativeFirstCharacters=[".","/"],t.BLANK_URL="about:blank"}}),Cy=o({"../../node_modules/.pnpm/@braintree+sanitize-url@7.1.0/node_modules/@braintree/sanitize-url/dist/index.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.sanitizeUrl=void 0;var e=Ey();function n(t){return e.relativeFirstCharacters.indexOf(t[0])>-1}function r(t){return t.replace(e.ctrlCharactersRegex,"").replace(e.htmlEntitiesRegex,(function(t,e){return String.fromCharCode(e)}))}function i(t){return URL.canParse(t)}function a(t){try{return decodeURIComponent(t)}catch(e){return t}}function o(t){if(!t)return e.BLANK_URL;var s,o=a(t.trim());do{s=(o=a(o=r(o).replace(e.htmlCtrlEntityRegex,"").replace(e.ctrlCharactersRegex,"").replace(e.whitespaceEscapeCharsRegex,"").trim())).match(e.ctrlCharactersRegex)||o.match(e.htmlEntitiesRegex)||o.match(e.htmlCtrlEntityRegex)||o.match(e.whitespaceEscapeCharsRegex)}while(s&&s.length>0);var l=o;if(!l)return e.BLANK_URL;if(n(l))return l;var c=l.trimStart(),h=c.match(e.urlSchemeRegex);if(!h)return l;var u=h[0].toLowerCase().trim();if(e.invalidProtocolRegex.test(u))return e.BLANK_URL;var d=c.replace(/\\/g,"/");if("mailto:"===u||u.includes("://"))return d;if("http:"===u||"https:"===u){if(!i(d))return e.BLANK_URL;var p=new URL(d);return p.protocol=p.protocol.toLowerCase(),p.hostname=p.hostname.toLowerCase(),p.toString()}return d}s(n,"isRelativeUrlWithoutProtocol"),s(r,"decodeHtmlCharacters"),s(i,"isValidUrl"),s(a,"decodeURI"),s(o,"sanitizeUrl"),t.sanitizeUrl=o}}),Sy="object"==typeof global&&global&&global.Object===Object&&global,Ay="object"==typeof self&&self&&self.Object===Object&&self,Ly=Sy||Ay||Function("return this")(),Ny=Ly.Symbol,Iy=Object.prototype,My=Iy.hasOwnProperty,Ry=Iy.toString,Dy=Ny?Ny.toStringTag:void 0;function Oy(t){var e=My.call(t,Dy),n=t[Dy];try{t[Dy]=void 0;var r=!0}catch(t){}var i=Ry.call(t);return r&&(e?t[Dy]=n:delete t[Dy]),i}s(Oy,"getRawTag");var Py=Oy,By=Object.prototype.toString;function $y(t){return By.call(t)}s($y,"objectToString");var Fy=$y,zy=Ny?Ny.toStringTag:void 0;function Uy(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":zy&&zy in Object(t)?Py(t):Fy(t)}s(Uy,"baseGetTag");var Gy=Uy;function qy(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}s(qy,"isObject");var jy=qy;function Yy(t){if(!jy(t))return!1;var e=Gy(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}s(Yy,"isFunction");var Wy,Hy=Yy,Vy=Ly["__core-js_shared__"],Xy=(Wy=/[^.]+$/.exec(Vy&&Vy.keys&&Vy.keys.IE_PROTO||""))?"Symbol(src)_1."+Wy:"";function Ky(t){return!!Xy&&Xy in t}s(Ky,"isMasked");var Zy=Ky,Qy=Function.prototype.toString;function Jy(t){if(null!=t){try{return Qy.call(t)}catch(t){}try{return t+""}catch(t){}}return""}s(Jy,"toSource");var tv=Jy,ev=/^\[object .+?Constructor\]$/,nv=Function.prototype,rv=Object.prototype,iv=nv.toString,av=rv.hasOwnProperty,sv=RegExp("^"+iv.call(av).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function ov(t){return!(!jy(t)||Zy(t))&&(Hy(t)?sv:ev).test(tv(t))}s(ov,"baseIsNative");var lv=ov;function cv(t,e){return null==t?void 0:t[e]}s(cv,"getValue");var hv=cv;function uv(t,e){var n=hv(t,e);return lv(n)?n:void 0}s(uv,"getNative");var dv=uv,pv=dv(Object,"create");function gv(){this.__data__=pv?pv(null):{},this.size=0}s(gv,"hashClear");var fv=gv;function mv(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}s(mv,"hashDelete");var yv=mv,vv=Object.prototype.hasOwnProperty;function xv(t){var e=this.__data__;if(pv){var n=e[t];return"__lodash_hash_undefined__"===n?void 0:n}return vv.call(e,t)?e[t]:void 0}s(xv,"hashGet");var bv=xv,wv=Object.prototype.hasOwnProperty;function kv(t){var e=this.__data__;return pv?void 0!==e[t]:wv.call(e,t)}s(kv,"hashHas");var Tv=kv;function _v(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=pv&&void 0===e?"__lodash_hash_undefined__":e,this}s(_v,"hashSet");var Ev=_v;function Cv(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}s(Cv,"Hash"),Cv.prototype.clear=fv,Cv.prototype.delete=yv,Cv.prototype.get=bv,Cv.prototype.has=Tv,Cv.prototype.set=Ev;var Sv=Cv;function Av(){this.__data__=[],this.size=0}s(Av,"listCacheClear");var Lv=Av;function Nv(t,e){return t===e||t!=t&&e!=e}s(Nv,"eq");var Iv=Nv;function Mv(t,e){for(var n=t.length;n--;)if(Iv(t[n][0],e))return n;return-1}s(Mv,"assocIndexOf");var Rv=Mv,Dv=Array.prototype.splice;function Ov(t){var e=this.__data__,n=Rv(e,t);return!(n<0)&&(n==e.length-1?e.pop():Dv.call(e,n,1),--this.size,!0)}s(Ov,"listCacheDelete");var Pv=Ov;function Bv(t){var e=this.__data__,n=Rv(e,t);return n<0?void 0:e[n][1]}s(Bv,"listCacheGet");var $v=Bv;function Fv(t){return Rv(this.__data__,t)>-1}s(Fv,"listCacheHas");var zv=Fv;function Uv(t,e){var n=this.__data__,r=Rv(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}s(Uv,"listCacheSet");var Gv=Uv;function qv(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}s(qv,"ListCache"),qv.prototype.clear=Lv,qv.prototype.delete=Pv,qv.prototype.get=$v,qv.prototype.has=zv,qv.prototype.set=Gv;var jv=qv,Yv=dv(Ly,"Map");function Wv(){this.size=0,this.__data__={hash:new Sv,map:new(Yv||jv),string:new Sv}}s(Wv,"mapCacheClear");var Hv=Wv;function Vv(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}s(Vv,"isKeyable");var Xv=Vv;function Kv(t,e){var n=t.__data__;return Xv(e)?n["string"==typeof e?"string":"hash"]:n.map}s(Kv,"getMapData");var Zv=Kv;function Qv(t){var e=Zv(this,t).delete(t);return this.size-=e?1:0,e}s(Qv,"mapCacheDelete");var Jv=Qv;function tx(t){return Zv(this,t).get(t)}s(tx,"mapCacheGet");var ex=tx;function nx(t){return Zv(this,t).has(t)}s(nx,"mapCacheHas");var rx=nx;function ix(t,e){var n=Zv(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this}s(ix,"mapCacheSet");var ax=ix;function sx(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}s(sx,"MapCache"),sx.prototype.clear=Hv,sx.prototype.delete=Jv,sx.prototype.get=ex,sx.prototype.has=rx,sx.prototype.set=ax;var ox=sx;function lx(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");var n=s((function(){var r=arguments,i=e?e.apply(this,r):r[0],a=n.cache;if(a.has(i))return a.get(i);var s=t.apply(this,r);return n.cache=a.set(i,s)||a,s}),"memoized");return n.cache=new(lx.Cache||ox),n}s(lx,"memoize"),lx.Cache=ox;var cx=lx;function hx(t){return function(){return t}}s(hx,"constant");var ux=hx;function dx(){this.__data__=new jv,this.size=0}s(dx,"stackClear");var px=dx;function gx(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}s(gx,"stackDelete");var fx=gx;function mx(t){return this.__data__.get(t)}s(mx,"stackGet");var yx=mx;function vx(t){return this.__data__.has(t)}s(vx,"stackHas");var xx=vx;function bx(t,e){var n=this.__data__;if(n instanceof jv){var r=n.__data__;if(!Yv||r.length<199)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new ox(r)}return n.set(t,e),this.size=n.size,this}s(bx,"stackSet");var wx=bx;function kx(t){var e=this.__data__=new jv(t);this.size=e.size}s(kx,"Stack"),kx.prototype.clear=px,kx.prototype.delete=fx,kx.prototype.get=yx,kx.prototype.has=xx,kx.prototype.set=wx;var Tx=kx,_x=function(){try{var t=dv(Object,"defineProperty");return t({},"",{}),t}catch(t){}}();function Ex(t,e,n){"__proto__"==e&&_x?_x(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}s(Ex,"baseAssignValue");var Cx=Ex;function Sx(t,e,n){(void 0!==n&&!Iv(t[e],n)||void 0===n&&!(e in t))&&Cx(t,e,n)}s(Sx,"assignMergeValue");var Ax=Sx;function Lx(t){return function(e,n,r){for(var i=-1,a=Object(e),s=r(e),o=s.length;o--;){var l=s[t?o:++i];if(!1===n(a[l],l,a))break}return e}}s(Lx,"createBaseFor");var Nx=Lx(),Ix="object"==typeof exports&&exports&&!exports.nodeType&&exports,Mx=Ix&&"object"==typeof module&&module&&!module.nodeType&&module,Rx=Mx&&Mx.exports===Ix?Ly.Buffer:void 0,Dx=Rx?Rx.allocUnsafe:void 0;function Ox(t,e){if(e)return t.slice();var n=t.length,r=Dx?Dx(n):new t.constructor(n);return t.copy(r),r}s(Ox,"cloneBuffer");var Px=Ox,Bx=Ly.Uint8Array;function $x(t){var e=new t.constructor(t.byteLength);return new Bx(e).set(new Bx(t)),e}s($x,"cloneArrayBuffer");var Fx=$x;function zx(t,e){var n=e?Fx(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}s(zx,"cloneTypedArray");var Ux=zx;function Gx(t,e){var n=-1,r=t.length;for(e||(e=Array(r));++n<r;)e[n]=t[n];return e}s(Gx,"copyArray");var qx=Gx,jx=Object.create,Yx=function(){function t(){}return s(t,"object"),function(e){if(!jy(e))return{};if(jx)return jx(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}(),Wx=Yx;function Hx(t,e){return function(n){return t(e(n))}}s(Hx,"overArg");var Vx=Hx,Xx=Vx(Object.getPrototypeOf,Object),Kx=Object.prototype;function Zx(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||Kx)}s(Zx,"isPrototype");var Qx=Zx;function Jx(t){return"function"!=typeof t.constructor||Qx(t)?{}:Wx(Xx(t))}s(Jx,"initCloneObject");var tb=Jx;function eb(t){return null!=t&&"object"==typeof t}s(eb,"isObjectLike");var nb=eb;function rb(t){return nb(t)&&"[object Arguments]"==Gy(t)}s(rb,"baseIsArguments");var ib=rb,ab=Object.prototype,sb=ab.hasOwnProperty,ob=ab.propertyIsEnumerable,lb=ib(function(){return arguments}())?ib:function(t){return nb(t)&&sb.call(t,"callee")&&!ob.call(t,"callee")},cb=lb,hb=Array.isArray;function ub(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}s(ub,"isLength");var db=ub;function pb(t){return null!=t&&db(t.length)&&!Hy(t)}s(pb,"isArrayLike");var gb=pb;function fb(t){return nb(t)&&gb(t)}s(fb,"isArrayLikeObject");var mb=fb;function yb(){return!1}s(yb,"stubFalse");var vb=yb,xb="object"==typeof exports&&exports&&!exports.nodeType&&exports,bb=xb&&"object"==typeof module&&module&&!module.nodeType&&module,wb=bb&&bb.exports===xb?Ly.Buffer:void 0,kb=(wb?wb.isBuffer:void 0)||vb,Tb=Function.prototype,_b=Object.prototype,Eb=Tb.toString,Cb=_b.hasOwnProperty,Sb=Eb.call(Object);function Ab(t){if(!nb(t)||"[object Object]"!=Gy(t))return!1;var e=Xx(t);if(null===e)return!0;var n=Cb.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&Eb.call(n)==Sb}s(Ab,"isPlainObject");var Lb=Ab,Nb={};function Ib(t){return nb(t)&&db(t.length)&&!!Nb[Gy(t)]}Nb["[object Float32Array]"]=Nb["[object Float64Array]"]=Nb["[object Int8Array]"]=Nb["[object Int16Array]"]=Nb["[object Int32Array]"]=Nb["[object Uint8Array]"]=Nb["[object Uint8ClampedArray]"]=Nb["[object Uint16Array]"]=Nb["[object Uint32Array]"]=!0,Nb["[object Arguments]"]=Nb["[object Array]"]=Nb["[object ArrayBuffer]"]=Nb["[object Boolean]"]=Nb["[object DataView]"]=Nb["[object Date]"]=Nb["[object Error]"]=Nb["[object Function]"]=Nb["[object Map]"]=Nb["[object Number]"]=Nb["[object Object]"]=Nb["[object RegExp]"]=Nb["[object Set]"]=Nb["[object String]"]=Nb["[object WeakMap]"]=!1,s(Ib,"baseIsTypedArray");var Mb=Ib;function Rb(t){return function(e){return t(e)}}s(Rb,"baseUnary");var Db=Rb,Ob="object"==typeof exports&&exports&&!exports.nodeType&&exports,Pb=Ob&&"object"==typeof module&&module&&!module.nodeType&&module,Bb=Pb&&Pb.exports===Ob&&Sy.process,$b=function(){try{var t=Pb&&Pb.require&&Pb.require("util").types;return t||Bb&&Bb.binding&&Bb.binding("util")}catch(t){}}(),Fb=$b&&$b.isTypedArray,zb=Fb?Db(Fb):Mb;function Ub(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}s(Ub,"safeGet");var Gb=Ub,qb=Object.prototype.hasOwnProperty;function jb(t,e,n){var r=t[e];qb.call(t,e)&&Iv(r,n)&&(void 0!==n||e in t)||Cx(t,e,n)}s(jb,"assignValue");var Yb=jb;function Wb(t,e,n,r){var i=!n;n||(n={});for(var a=-1,s=e.length;++a<s;){var o=e[a],l=r?r(n[o],t[o],o,n,t):void 0;void 0===l&&(l=t[o]),i?Cx(n,o,l):Yb(n,o,l)}return n}s(Wb,"copyObject");var Hb=Wb;function Vb(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}s(Vb,"baseTimes");var Xb=Vb,Kb=/^(?:0|[1-9]\d*)$/;function Zb(t,e){var n=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==n||"symbol"!=n&&Kb.test(t))&&t>-1&&t%1==0&&t<e}s(Zb,"isIndex");var Qb=Zb,Jb=Object.prototype.hasOwnProperty;function tw(t,e){var n=hb(t),r=!n&&cb(t),i=!n&&!r&&kb(t),a=!n&&!r&&!i&&zb(t),s=n||r||i||a,o=s?Xb(t.length,String):[],l=o.length;for(var c in t)!e&&!Jb.call(t,c)||s&&("length"==c||i&&("offset"==c||"parent"==c)||a&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||Qb(c,l))||o.push(c);return o}s(tw,"arrayLikeKeys");var ew=tw;function nw(t){var e=[];if(null!=t)for(var n in Object(t))e.push(n);return e}s(nw,"nativeKeysIn");var rw=nw,iw=Object.prototype.hasOwnProperty;function aw(t){if(!jy(t))return rw(t);var e=Qx(t),n=[];for(var r in t)("constructor"!=r||!e&&iw.call(t,r))&&n.push(r);return n}s(aw,"baseKeysIn");var sw=aw;function ow(t){return gb(t)?ew(t,!0):sw(t)}s(ow,"keysIn");var lw=ow;function cw(t){return Hb(t,lw(t))}s(cw,"toPlainObject");var hw=cw;function uw(t,e,n,r,i,a,s){var o=Gb(t,n),l=Gb(e,n),c=s.get(l);if(c)Ax(t,n,c);else{var h=a?a(o,l,n+"",t,e,s):void 0,u=void 0===h;if(u){var d=hb(l),p=!d&&kb(l),g=!d&&!p&&zb(l);h=l,d||p||g?hb(o)?h=o:mb(o)?h=qx(o):p?(u=!1,h=Px(l,!0)):g?(u=!1,h=Ux(l,!0)):h=[]:Lb(l)||cb(l)?(h=o,cb(o)?h=hw(o):jy(o)&&!Hy(o)||(h=tb(l))):u=!1}u&&(s.set(l,h),i(h,l,r,a,s),s.delete(l)),Ax(t,n,h)}}s(uw,"baseMergeDeep");var dw=uw;function pw(t,e,n,r,i){t!==e&&Nx(e,(function(a,s){if(i||(i=new Tx),jy(a))dw(t,e,s,n,pw,r,i);else{var o=r?r(Gb(t,s),a,s+"",t,e,i):void 0;void 0===o&&(o=a),Ax(t,s,o)}}),lw)}s(pw,"baseMerge");var gw=pw;function fw(t){return t}s(fw,"identity");var mw=fw;function yw(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}s(yw,"apply");var vw=yw,xw=Math.max;function bw(t,e,n){return e=xw(void 0===e?t.length-1:e,0),function(){for(var r=arguments,i=-1,a=xw(r.length-e,0),s=Array(a);++i<a;)s[i]=r[e+i];i=-1;for(var o=Array(e+1);++i<e;)o[i]=r[i];return o[e]=n(s),vw(t,this,o)}}s(bw,"overRest");var ww=bw,kw=_x?function(t,e){return _x(t,"toString",{configurable:!0,enumerable:!1,value:ux(e),writable:!0})}:mw,Tw=kw,_w=Date.now;function Ew(t){var e=0,n=0;return function(){var r=_w(),i=16-(r-n);if(n=r,i>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}s(Ew,"shortOut");var Cw=Ew(Tw);function Sw(t,e){return Cw(ww(t,e,mw),t+"")}s(Sw,"baseRest");var Aw=Sw;function Lw(t,e,n){if(!jy(n))return!1;var r=typeof e;return!!("number"==r?gb(n)&&Qb(e,n.length):"string"==r&&e in n)&&Iv(n[e],t)}s(Lw,"isIterateeCall");var Nw=Lw;function Iw(t){return Aw((function(e,n){var r=-1,i=n.length,a=i>1?n[i-1]:void 0,s=i>2?n[2]:void 0;for(a=t.length>3&&"function"==typeof a?(i--,a):void 0,s&&Nw(n[0],n[1],s)&&(a=i<3?void 0:a,i=1),e=Object(e);++r<i;){var o=n[r];o&&t(e,o,r,a)}return e}))}s(Iw,"createAssigner");var Mw=Iw,Rw=Mw((function(t,e,n){gw(t,e,n)})),Dw=Rw,Ow=d(Cy(),1),Pw={curveBasis:iu,curveBasisClosed:ou,curveBasisOpen:cu,curveBumpX:tu,curveBumpY:eu,curveBundle:uu,curveCardinalClosed:mu,curveCardinalOpen:vu,curveCardinal:gu,curveCatmullRomClosed:Tu,curveCatmullRomOpen:Eu,curveCatmullRom:wu,curveLinear:Yh,curveLinearClosed:Su,curveMonotoneX:Ou,curveMonotoneY:Pu,curveNatural:Fu,curveStep:Uu,curveStepAfter:qu,curveStepBefore:Gu},Bw=/\s*(?:(\w+)(?=:):|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,$w=s((function(t,e){const n=Fw(t,/(?:init\b)|(?:initialize\b)/);let r={};if(Array.isArray(n)){const t=n.map((t=>t.args));St(t),r=L(r,[...t])}else r=n.args;if(!r)return;let i=_(t,e);const a="config";return void 0!==r[a]&&("flowchart-v2"===i&&(i="flowchart"),r[i]=r[a],delete r[a]),r}),"detectInit"),Fw=s((function(t,e=null){try{const n=new RegExp(`[%]{2}(?![{]${Bw.source})(?=[}][%]{2}).*\n`,"ig");let r;t=t.trim().replace(n,"").replace(/'/gm,'"'),m.debug(`Detecting diagram directive${null!==e?" type:"+e:""} based on the text:${t}`);const i=[];for(;null!==(r=b.exec(t));)if(r.index===b.lastIndex&&b.lastIndex++,r&&!e||e&&r[1]?.match(e)||e&&r[2]?.match(e)){const t=r[1]?r[1]:r[2],e=r[3]?r[3].trim():r[4]?JSON.parse(r[4].trim()):null;i.push({type:t,args:e})}return 0===i.length?{type:t,args:null}:1===i.length?i[0]:i}catch(n){return m.error(`ERROR: ${n.message} - Unable to parse directive type: '${e}' based on the text: '${t}'`),{type:void 0,args:null}}}),"detectDirective"),zw=s((function(t){return t.replace(b,"")}),"removeDirectives"),Uw=s((function(t,e){for(const[n,r]of e.entries())if(r.match(t))return n;return-1}),"isSubstringInArray");function Gw(t,e){if(!t)return e;const n=`curve${t.charAt(0).toUpperCase()+t.slice(1)}`;return Pw[n]??e}function qw(t,e){const n=t.trim();if(n)return"loose"!==e.securityLevel?(0,Ow.sanitizeUrl)(n):n}s(Gw,"interpolateToCurve"),s(qw,"formatUrl");var jw=s(((t,...e)=>{const n=t.split("."),r=n.length-1,i=n[r];let a=window;for(let e=0;e<r;e++)if(a=a[n[e]],!a)return void m.error(`Function name: ${t} not found in window`);a[i](...e)}),"runFunc");function Yw(t,e){return t&&e?Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2)):0}function Ww(t){let e,n=0;t.forEach((t=>{n+=Yw(t,e),e=t}));return Xw(t,n/2)}function Hw(t){return 1===t.length?t[0]:Ww(t)}s(Yw,"distance"),s(Ww,"traverseEdge"),s(Hw,"calcLabelPosition");var Vw=s(((t,e=2)=>{const n=Math.pow(10,e);return Math.round(t*n)/n}),"roundNumber"),Xw=s(((t,e)=>{let n,r=e;for(const e of t){if(n){const t=Yw(e,n);if(t<r)r-=t;else{const i=r/t;if(i<=0)return n;if(i>=1)return{x:e.x,y:e.y};if(i>0&&i<1)return{x:Vw((1-i)*n.x+i*e.x,5),y:Vw((1-i)*n.y+i*e.y,5)}}}n=e}throw new Error("Could not find a suitable point for the given distance")}),"calculatePoint"),Kw=s(((t,e,n)=>{m.info(`our points ${JSON.stringify(e)}`),e[0]!==n&&(e=e.reverse());const r=Xw(e,25),i=t?10:5,a=Math.atan2(e[0].y-r.y,e[0].x-r.x),s={x:0,y:0};return s.x=Math.sin(a)*i+(e[0].x+r.x)/2,s.y=-Math.cos(a)*i+(e[0].y+r.y)/2,s}),"calcCardinalityPosition");function Zw(t,e,n){const r=structuredClone(n);m.info("our points",r),"start_left"!==e&&"start_right"!==e&&r.reverse();const i=Xw(r,25+t),a=10+.5*t,s=Math.atan2(r[0].y-i.y,r[0].x-i.x),o={x:0,y:0};return"start_left"===e?(o.x=Math.sin(s+Math.PI)*a+(r[0].x+i.x)/2,o.y=-Math.cos(s+Math.PI)*a+(r[0].y+i.y)/2):"end_right"===e?(o.x=Math.sin(s-Math.PI)*a+(r[0].x+i.x)/2-5,o.y=-Math.cos(s-Math.PI)*a+(r[0].y+i.y)/2-5):"end_left"===e?(o.x=Math.sin(s)*a+(r[0].x+i.x)/2-5,o.y=-Math.cos(s)*a+(r[0].y+i.y)/2-5):(o.x=Math.sin(s)*a+(r[0].x+i.x)/2,o.y=-Math.cos(s)*a+(r[0].y+i.y)/2),o}function Qw(t){let e="",n="";for(const r of t)void 0!==r&&(r.startsWith("color:")||r.startsWith("text-align:")?n=n+r+";":e=e+r+";");return{style:e,labelStyle:n}}s(Zw,"calcTerminalLabelPosition"),s(Qw,"getStylesFromArray");var Jw=0,tk=s((()=>(Jw++,"id-"+Math.random().toString(36).substr(2,12)+"-"+Jw)),"generateId");function ek(t){let e="";const n="0123456789abcdef",r=n.length;for(let i=0;i<t;i++)e+=n.charAt(Math.floor(Math.random()*r));return e}s(ek,"makeRandomHex");var nk=s((t=>ek(t.length)),"random"),rk=s((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"),ik=s((function(t,e){const n=e.text.replace(_n.lineBreakRegex," "),[,r]=fk(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",r),i.style("font-weight",e.fontWeight),i.attr("fill",e.fill),void 0!==e.class&&i.attr("class",e.class);const a=i.append("tspan");return a.attr("x",e.x+2*e.textMargin),a.attr("fill",e.fill),a.text(n),i}),"drawSimpleText"),ak=cx(((t,e,n)=>{if(!t)return t;if(n=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",joinWith:"<br/>"},n),_n.lineBreakRegex.test(t))return t;const r=t.split(" ").filter(Boolean),i=[];let a="";return r.forEach(((t,s)=>{const o=lk(`${t} `,n),l=lk(a,n);if(o>e){const{hyphenatedStrings:r,remainingWord:s}=sk(t,e,"-",n);i.push(a,...r),a=s}else l+o>=e?(i.push(a),a=t):a=[a,t].filter(Boolean).join(" ");s+1===r.length&&i.push(a)})),i.filter((t=>""!==t)).join(n.joinWith)}),((t,e,n)=>`${t}${e}${n.fontSize}${n.fontWeight}${n.fontFamily}${n.joinWith}`)),sk=cx(((t,e,n="-",r)=>{r=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",margin:0},r);const i=[...t],a=[];let s="";return i.forEach(((t,o)=>{const l=`${s}${t}`;if(lk(l,r)>=e){const t=o+1,e=i.length===t,r=`${l}${n}`;a.push(e?l:r),s=""}else s=l})),{hyphenatedStrings:a,remainingWord:s}}),((t,e,n="-",r)=>`${t}${e}${n}${r.fontSize}${r.fontWeight}${r.fontFamily}`));function ok(t,e){return hk(t,e).height}function lk(t,e){return hk(t,e).width}s(ok,"calculateTextHeight"),s(lk,"calculateTextWidth");var ck,hk=cx(((t,e)=>{const{fontSize:n=12,fontFamily:r="Arial",fontWeight:i=400}=e;if(!t)return{width:0,height:0};const[,a]=fk(n),s=["sans-serif",r],o=t.split(_n.lineBreakRegex),l=[],c=Oa("body");if(!c.remove)return{width:0,height:0,lineHeight:0};const h=c.append("svg");for(const t of s){let e=0;const n={width:0,height:0,lineHeight:0};for(const r of o){const s=rk();s.text=r||"​";const o=ik(h,s).style("font-size",a).style("font-weight",i).style("font-family",t),l=(o._groups||o)[0][0].getBBox();if(0===l.width&&0===l.height)throw new Error("svg element not in render tree");n.width=Math.round(Math.max(n.width,l.width)),e=Math.round(l.height),n.height+=e,n.lineHeight=Math.round(Math.max(n.lineHeight,e))}l.push(n)}h.remove();return l[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]}),((t,e)=>`${t}${e.fontSize}${e.fontWeight}${e.fontFamily}`)),uk=class{constructor(t=!1,e){this.count=0,this.count=e?e.length:0,this.next=t?()=>this.count++:()=>Date.now()}static{s(this,"InitIDGenerator")}},dk=s((function(t){return ck=ck||document.createElement("div"),t=escape(t).replace(/%26/g,"&").replace(/%23/g,"#").replace(/%3B/g,";"),ck.innerHTML=t,unescape(ck.textContent)}),"entityDecode");function pk(t){return"str"in t}s(pk,"isDetailedError");var gk=s(((t,e,n,r)=>{if(!r)return;const i=t.node()?.getBBox();i&&t.append("text").text(r).attr("text-anchor","middle").attr("x",i.x+i.width/2).attr("y",-n).attr("class",e)}),"insertTitle"),fk=s((t=>{if("number"==typeof t)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 mk(t,e){return Dw({},t,e)}s(mk,"cleanAndMerge");var yk={assignWithDepth:L,wrapLabel:ak,calculateTextHeight:ok,calculateTextWidth:lk,calculateTextDimensions:hk,cleanAndMerge:mk,detectInit:$w,detectDirective:Fw,isSubstringInArray:Uw,interpolateToCurve:Gw,calcLabelPosition:Hw,calcCardinalityPosition:Kw,calcTerminalLabelPosition:Zw,formatUrl:qw,getStylesFromArray:Qw,generateId:tk,random:nk,runFunc:jw,entityDecode:dk,insertTitle:gk,parseFontSize:fk,InitIDGenerator:uk},vk=s((function(t){let e=t;return e=e.replace(/style.*:\S*#.*;/g,(function(t){return t.substring(0,t.length-1)})),e=e.replace(/classDef.*:\S*#.*;/g,(function(t){return t.substring(0,t.length-1)})),e=e.replace(/#\w+;/g,(function(t){const e=t.substring(1,t.length-1);return/^\+?\d+$/.test(e)?"fl°°"+e+"¶ß":"fl°"+e+"¶ß"})),e}),"encodeEntities"),xk=s((function(t){return t.replace(/fl°°/g,"&#").replace(/fl°/g,"&").replace(/¶ß/g,";")}),"decodeEntities"),bk=s(((t,e,{counter:n=0,prefix:r,suffix:i})=>`${r?`${r}_`:""}${t}_${e}_${n}${i?`_${i}`:""}`),"getEdgeId");function wk(t){return t??null}function kk(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var r=Array.from("string"==typeof t?[t]:t);r[r.length-1]=r[r.length-1].replace(/\r?\n([\t ]*)$/,"");var i=r.reduce((function(t,e){var n=e.match(/\n([\t ]+|(?!\s).)/g);return n?t.concat(n.map((function(t){var e,n;return null!==(n=null===(e=t.match(/[\t ]/g))||void 0===e?void 0:e.length)&&void 0!==n?n:0}))):t}),[]);if(i.length){var a=new RegExp("\n[\t ]{"+Math.min.apply(Math,i)+"}","g");r=r.map((function(t){return t.replace(a,"\n")}))}r[0]=r[0].replace(/^\r?\n/,"");var s=r[0];return e.forEach((function(t,e){var n=s.match(/(?:^|\n)( *)$/),i=n?n[1]:"",a=t;"string"==typeof t&&t.includes("\n")&&(a=String(t).split("\n").map((function(t,e){return 0===e?t:""+i+t})).join("\n")),s+=a+r[e+1]})),s}function Tk(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}s(wk,"handleUndefinedAttr"),s(kk,"dedent"),s(Tk,"_getDefaults");var _k={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null};function Ek(t){_k=t}s(Ek,"changeDefaults");var Ck=/[&<>"']/,Sk=new RegExp(Ck.source,"g"),Ak=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,Lk=new RegExp(Ak.source,"g"),Nk={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Ik=s((t=>Nk[t]),"getEscapeReplacement");function Mk(t,e){if(e){if(Ck.test(t))return t.replace(Sk,Ik)}else if(Ak.test(t))return t.replace(Lk,Ik);return t}s(Mk,"escape$1");var Rk=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function Dk(t){return t.replace(Rk,((t,e)=>"colon"===(e=e.toLowerCase())?":":"#"===e.charAt(0)?"x"===e.charAt(1)?String.fromCharCode(parseInt(e.substring(2),16)):String.fromCharCode(+e.substring(1)):""))}s(Dk,"unescape");var Ok=/(^|[^\[])\^/g;function Pk(t,e){let n="string"==typeof t?t:t.source;e=e||"";const r={replace:s(((t,e)=>{let i="string"==typeof e?e:e.source;return i=i.replace(Ok,"$1"),n=n.replace(t,i),r}),"replace"),getRegex:s((()=>new RegExp(n,e)),"getRegex")};return r}function Bk(t){try{t=encodeURI(t).replace(/%25/g,"%")}catch{return null}return t}s(Pk,"edit"),s(Bk,"cleanUrl");var $k={exec:s((()=>null),"exec")};function Fk(t,e){const n=t.replace(/\|/g,((t,e,n)=>{let r=!1,i=e;for(;--i>=0&&"\\"===n[i];)r=!r;return r?"|":" |"})),r=n.split(/ \|/);let i=0;if(r[0].trim()||r.shift(),r.length>0&&!r[r.length-1].trim()&&r.pop(),e)if(r.length>e)r.splice(e);else for(;r.length<e;)r.push("");for(;i<r.length;i++)r[i]=r[i].trim().replace(/\\\|/g,"|");return r}function zk(t,e,n){const r=t.length;if(0===r)return"";let i=0;for(;i<r;){const a=t.charAt(r-i-1);if(a!==e||n){if(a===e||!n)break;i++}else i++}return t.slice(0,r-i)}function Uk(t,e){if(-1===t.indexOf(e[1]))return-1;let n=0;for(let r=0;r<t.length;r++)if("\\"===t[r])r++;else if(t[r]===e[0])n++;else if(t[r]===e[1]&&(n--,n<0))return r;return-1}function Gk(t,e,n,r){const i=e.href,a=e.title?Mk(e.title):null,s=t[1].replace(/\\([\[\]])/g,"$1");if("!"!==t[0].charAt(0)){r.state.inLink=!0;const t={type:"link",raw:n,href:i,title:a,text:s,tokens:r.inlineTokens(s)};return r.state.inLink=!1,t}return{type:"image",raw:n,href:i,title:a,text:Mk(s)}}function qk(t,e){const n=t.match(/^(\s+)(?:```)/);if(null===n)return e;const r=n[1];return e.split("\n").map((t=>{const e=t.match(/^\s+/);if(null===e)return t;const[n]=e;return n.length>=r.length?t.slice(r.length):t})).join("\n")}s(Fk,"splitCells"),s(zk,"rtrim"),s(Uk,"findClosingBracket"),s(Gk,"outputLink"),s(qk,"indentCodeCompensation");var jk=class{static{s(this,"_Tokenizer")}options;rules;lexer;constructor(t){this.options=t||_k}space(t){const e=this.rules.block.newline.exec(t);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(t){const e=this.rules.block.code.exec(t);if(e){const t=e[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?t:zk(t,"\n")}}}fences(t){const e=this.rules.block.fences.exec(t);if(e){const t=e[0],n=qk(t,e[3]||"");return{type:"code",raw:t,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:n}}}heading(t){const e=this.rules.block.heading.exec(t);if(e){let t=e[2].trim();if(/#$/.test(t)){const e=zk(t,"#");this.options.pedantic?t=e.trim():e&&!/ $/.test(e)||(t=e.trim())}return{type:"heading",raw:e[0],depth:e[1].length,text:t,tokens:this.lexer.inline(t)}}}hr(t){const e=this.rules.block.hr.exec(t);if(e)return{type:"hr",raw:zk(e[0],"\n")}}blockquote(t){const e=this.rules.block.blockquote.exec(t);if(e){let t=zk(e[0],"\n").split("\n"),n="",r="";const i=[];for(;t.length>0;){let e=!1;const a=[];let s;for(s=0;s<t.length;s++)if(/^ {0,3}>/.test(t[s]))a.push(t[s]),e=!0;else{if(e)break;a.push(t[s])}t=t.slice(s);const o=a.join("\n"),l=o.replace(/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,"\n $1").replace(/^ {0,3}>[ \t]?/gm,"");n=n?`${n}\n${o}`:o,r=r?`${r}\n${l}`:l;const c=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(l,i,!0),this.lexer.state.top=c,0===t.length)break;const h=i[i.length-1];if("code"===h?.type)break;if("blockquote"===h?.type){const e=h,a=e.raw+"\n"+t.join("\n"),s=this.blockquote(a);i[i.length-1]=s,n=n.substring(0,n.length-e.raw.length)+s.raw,r=r.substring(0,r.length-e.text.length)+s.text;break}if("list"!==h?.type);else{const e=h,a=e.raw+"\n"+t.join("\n"),s=this.list(a);i[i.length-1]=s,n=n.substring(0,n.length-h.raw.length)+s.raw,r=r.substring(0,r.length-e.raw.length)+s.raw,t=a.substring(i[i.length-1].raw.length).split("\n")}}return{type:"blockquote",raw:n,tokens:i,text:r}}}list(t){let e=this.rules.block.list.exec(t);if(e){let n=e[1].trim();const r=n.length>1,i={type:"list",raw:"",ordered:r,start:r?+n.slice(0,-1):"",loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:"[*+-]");const a=new RegExp(`^( {0,3}${n})((?:[\t ][^\\n]*)?(?:\\n|$))`);let s=!1;for(;t;){let n=!1,r="",o="";if(!(e=a.exec(t)))break;if(this.rules.block.hr.test(t))break;r=e[0],t=t.substring(r.length);let l=e[2].split("\n",1)[0].replace(/^\t+/,(t=>" ".repeat(3*t.length))),c=t.split("\n",1)[0],h=!l.trim(),u=0;if(this.options.pedantic?(u=2,o=l.trimStart()):h?u=e[1].length+1:(u=e[2].search(/[^ ]/),u=u>4?1:u,o=l.slice(u),u+=e[1].length),h&&/^ *$/.test(c)&&(r+=c+"\n",t=t.substring(c.length+1),n=!0),!n){const e=new RegExp(`^ {0,${Math.min(3,u-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))`),n=new RegExp(`^ {0,${Math.min(3,u-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),i=new RegExp(`^ {0,${Math.min(3,u-1)}}(?:\`\`\`|~~~)`),a=new RegExp(`^ {0,${Math.min(3,u-1)}}#`);for(;t;){const s=t.split("\n",1)[0];if(c=s,this.options.pedantic&&(c=c.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),i.test(c))break;if(a.test(c))break;if(e.test(c))break;if(n.test(t))break;if(c.search(/[^ ]/)>=u||!c.trim())o+="\n"+c.slice(u);else{if(h)break;if(l.search(/[^ ]/)>=4)break;if(i.test(l))break;if(a.test(l))break;if(n.test(l))break;o+="\n"+c}h||c.trim()||(h=!0),r+=s+"\n",t=t.substring(s.length+1),l=c.slice(u)}}i.loose||(s?i.loose=!0:/\n *\n *$/.test(r)&&(s=!0));let d,p=null;this.options.gfm&&(p=/^\[[ xX]\] /.exec(o),p&&(d="[ ] "!==p[0],o=o.replace(/^\[[ xX]\] +/,""))),i.items.push({type:"list_item",raw:r,task:!!p,checked:d,loose:!1,text:o,tokens:[]}),i.raw+=r}i.items[i.items.length-1].raw=i.items[i.items.length-1].raw.trimEnd(),i.items[i.items.length-1].text=i.items[i.items.length-1].text.trimEnd(),i.raw=i.raw.trimEnd();for(let t=0;t<i.items.length;t++)if(this.lexer.state.top=!1,i.items[t].tokens=this.lexer.blockTokens(i.items[t].text,[]),!i.loose){const e=i.items[t].tokens.filter((t=>"space"===t.type)),n=e.length>0&&e.some((t=>/\n.*\n/.test(t.raw)));i.loose=n}if(i.loose)for(let t=0;t<i.items.length;t++)i.items[t].loose=!0;return i}}html(t){const e=this.rules.block.html.exec(t);if(e){return{type:"html",block:!0,raw:e[0],pre:"pre"===e[1]||"script"===e[1]||"style"===e[1],text:e[0]}}}def(t){const e=this.rules.block.def.exec(t);if(e){const t=e[1].toLowerCase().replace(/\s+/g," "),n=e[2]?e[2].replace(/^<(.*)>$/,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",r=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:t,raw:e[0],href:n,title:r}}}table(t){const e=this.rules.block.table.exec(t);if(!e)return;if(!/[:|]/.test(e[2]))return;const n=Fk(e[1]),r=e[2].replace(/^\||\| *$/g,"").split("|"),i=e[3]&&e[3].trim()?e[3].replace(/\n[ \t]*$/,"").split("\n"):[],a={type:"table",raw:e[0],header:[],align:[],rows:[]};if(n.length===r.length){for(const t of r)/^ *-+: *$/.test(t)?a.align.push("right"):/^ *:-+: *$/.test(t)?a.align.push("center"):/^ *:-+ *$/.test(t)?a.align.push("left"):a.align.push(null);for(let t=0;t<n.length;t++)a.header.push({text:n[t],tokens:this.lexer.inline(n[t]),header:!0,align:a.align[t]});for(const t of i)a.rows.push(Fk(t,a.header.length).map(((t,e)=>({text:t,tokens:this.lexer.inline(t),header:!1,align:a.align[e]}))));return a}}lheading(t){const e=this.rules.block.lheading.exec(t);if(e)return{type:"heading",raw:e[0],depth:"="===e[2].charAt(0)?1:2,text:e[1],tokens:this.lexer.inline(e[1])}}paragraph(t){const e=this.rules.block.paragraph.exec(t);if(e){const t="\n"===e[1].charAt(e[1].length-1)?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:t,tokens:this.lexer.inline(t)}}}text(t){const e=this.rules.block.text.exec(t);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(t){const e=this.rules.inline.escape.exec(t);if(e)return{type:"escape",raw:e[0],text:Mk(e[1])}}tag(t){const e=this.rules.inline.tag.exec(t);if(e)return!this.lexer.state.inLink&&/^<a /i.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(t){const e=this.rules.inline.link.exec(t);if(e){const t=e[2].trim();if(!this.options.pedantic&&/^</.test(t)){if(!/>$/.test(t))return;const e=zk(t.slice(0,-1),"\\");if((t.length-e.length)%2==0)return}else{const t=Uk(e[2],"()");if(t>-1){const n=(0===e[0].indexOf("!")?5:4)+e[1].length+t;e[2]=e[2].substring(0,t),e[0]=e[0].substring(0,n).trim(),e[3]=""}}let n=e[2],r="";if(this.options.pedantic){const t=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(n);t&&(n=t[1],r=t[3])}else r=e[3]?e[3].slice(1,-1):"";return n=n.trim(),/^</.test(n)&&(n=this.options.pedantic&&!/>$/.test(t)?n.slice(1):n.slice(1,-1)),Gk(e,{href:n?n.replace(this.rules.inline.anyPunctuation,"$1"):n,title:r?r.replace(this.rules.inline.anyPunctuation,"$1"):r},e[0],this.lexer)}}reflink(t,e){let n;if((n=this.rules.inline.reflink.exec(t))||(n=this.rules.inline.nolink.exec(t))){const t=e[(n[2]||n[1]).replace(/\s+/g," ").toLowerCase()];if(!t){const t=n[0].charAt(0);return{type:"text",raw:t,text:t}}return Gk(n,t,n[0],this.lexer)}}emStrong(t,e,n=""){let r=this.rules.inline.emStrongLDelim.exec(t);if(!r)return;if(r[3]&&n.match(/[\p{L}\p{N}]/u))return;if(!(r[1]||r[2]||"")||!n||this.rules.inline.punctuation.exec(n)){const n=[...r[0]].length-1;let i,a,s=n,o=0;const l="*"===r[0][0]?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(l.lastIndex=0,e=e.slice(-1*t.length+n);null!=(r=l.exec(e));){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i)continue;if(a=[...i].length,r[3]||r[4]){s+=a;continue}if((r[5]||r[6])&&n%3&&!((n+a)%3)){o+=a;continue}if(s-=a,s>0)continue;a=Math.min(a,a+s+o);const e=[...r[0]][0].length,l=t.slice(0,n+r.index+e+a);if(Math.min(n,a)%2){const t=l.slice(1,-1);return{type:"em",raw:l,text:t,tokens:this.lexer.inlineTokens(t)}}const c=l.slice(2,-2);return{type:"strong",raw:l,text:c,tokens:this.lexer.inlineTokens(c)}}}}codespan(t){const e=this.rules.inline.code.exec(t);if(e){let t=e[2].replace(/\n/g," ");const n=/[^ ]/.test(t),r=/^ /.test(t)&&/ $/.test(t);return n&&r&&(t=t.substring(1,t.length-1)),t=Mk(t,!0),{type:"codespan",raw:e[0],text:t}}}br(t){const e=this.rules.inline.br.exec(t);if(e)return{type:"br",raw:e[0]}}del(t){const e=this.rules.inline.del.exec(t);if(e)return{type:"del",raw:e[0],text:e[2],tokens:this.lexer.inlineTokens(e[2])}}autolink(t){const e=this.rules.inline.autolink.exec(t);if(e){let t,n;return"@"===e[2]?(t=Mk(e[1]),n="mailto:"+t):(t=Mk(e[1]),n=t),{type:"link",raw:e[0],text:t,href:n,tokens:[{type:"text",raw:t,text:t}]}}}url(t){let e;if(e=this.rules.inline.url.exec(t)){let t,n;if("@"===e[2])t=Mk(e[0]),n="mailto:"+t;else{let r;do{r=e[0],e[0]=this.rules.inline._backpedal.exec(e[0])?.[0]??""}while(r!==e[0]);t=Mk(e[0]),n="www."===e[1]?"http://"+e[0]:e[0]}return{type:"link",raw:e[0],text:t,href:n,tokens:[{type:"text",raw:t,text:t}]}}}inlineText(t){const e=this.rules.inline.text.exec(t);if(e){let t;return t=this.lexer.state.inRawBlock?e[0]:Mk(e[0]),{type:"text",raw:e[0],text:t}}}},Yk=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Wk=/(?:[*+-]|\d{1,9}[.)])/,Hk=Pk(/^(?!bull |blockCode|fences|blockquote|heading|html)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g,Wk).replace(/blockCode/g,/ {4}/).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/).getRegex(),Vk=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Xk=/(?!\s*\])(?:\\.|[^\[\]\\])+/,Kk=Pk(/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/).replace("label",Xk).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Zk=Pk(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Wk).getRegex(),Qk="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",Jk=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,tT=Pk("^ {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",Jk).replace("tag",Qk).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),eT=Pk(Vk).replace("hr",Yk).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",Qk).getRegex(),nT={blockquote:Pk(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",eT).getRegex(),code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,def:Kk,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,hr:Yk,html:tT,lheading:Hk,list:Zk,newline:/^(?: *(?:\n|$))+/,paragraph:eT,table:$k,text:/^[^\n]+/},rT=Pk("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Yk).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\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",Qk).getRegex(),iT={...nT,table:rT,paragraph:Pk(Vk).replace("hr",Yk).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",rT).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",Qk).getRegex()},aT={...nT,html:Pk("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",Jk).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:$k,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Pk(Vk).replace("hr",Yk).replace("heading"," *#{1,6} *[^\n]").replace("lheading",Hk).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},sT=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,oT=/^( {2,}|\\)\n(?!\s*$)/,lT=Pk(/^((?![*_])[\spunctuation])/,"u").replace(/punctuation/g,"\\p{P}\\p{S}").getRegex(),cT=Pk(/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,"u").replace(/punct/g,"\\p{P}\\p{S}").getRegex(),hT=Pk("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)[punct](\\*+)(?=[\\s]|$)|[^punct\\s](\\*+)(?!\\*)(?=[punct\\s]|$)|(?!\\*)[punct\\s](\\*+)(?=[^punct\\s])|[\\s](\\*+)(?!\\*)(?=[punct])|(?!\\*)[punct](\\*+)(?!\\*)(?=[punct])|[^punct\\s](\\*+)(?=[^punct\\s])","gu").replace(/punct/g,"\\p{P}\\p{S}").getRegex(),uT=Pk("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\\s]|$)|[^punct\\s](_+)(?!_)(?=[punct\\s]|$)|(?!_)[punct\\s](_+)(?=[^punct\\s])|[\\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])","gu").replace(/punct/g,"\\p{P}\\p{S}").getRegex(),dT=Pk(/\\([punct])/,"gu").replace(/punct/g,"\\p{P}\\p{S}").getRegex(),pT=Pk(/^<(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(),gT=Pk(Jk).replace("(?:--\x3e|$)","--\x3e").getRegex(),fT=Pk("^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",gT).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),mT=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,yT=Pk(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label",mT).replace("href",/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),vT=Pk(/^!?\[(label)\]\[(ref)\]/).replace("label",mT).replace("ref",Xk).getRegex(),xT=Pk(/^!?\[(ref)\](?:\[\])?/).replace("ref",Xk).getRegex(),bT={_backpedal:$k,anyPunctuation:dT,autolink:pT,blockSkip:/\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g,br:oT,code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,del:$k,emStrongLDelim:cT,emStrongRDelimAst:hT,emStrongRDelimUnd:uT,escape:sT,link:yT,nolink:xT,punctuation:lT,reflink:vT,reflinkSearch:Pk("reflink|nolink(?!\\()","g").replace("reflink",vT).replace("nolink",xT).getRegex(),tag:fT,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,url:$k},wT={...bT,link:Pk(/^!?\[(label)\]\((.*?)\)/).replace("label",mT).getRegex(),reflink:Pk(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",mT).getRegex()},kT={...bT,escape:Pk(sT).replace("])","~|])").getRegex(),url:Pk(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").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~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},TT={...kT,br:Pk(oT).replace("{2,}","*").getRegex(),text:Pk(kT.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},_T={normal:nT,gfm:iT,pedantic:aT},ET={normal:bT,gfm:kT,breaks:TT,pedantic:wT},CT=class t{static{s(this,"_Lexer")}tokens;options;state;tokenizer;inlineQueue;constructor(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||_k,this.options.tokenizer=this.options.tokenizer||new jk,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const e={block:_T.normal,inline:ET.normal};this.options.pedantic?(e.block=_T.pedantic,e.inline=ET.pedantic):this.options.gfm&&(e.block=_T.gfm,this.options.breaks?e.inline=ET.breaks:e.inline=ET.gfm),this.tokenizer.rules=e}static get rules(){return{block:_T,inline:ET}}static lex(e,n){return new t(n).lex(e)}static lexInline(e,n){return new t(n).inlineTokens(e)}lex(t){t=t.replace(/\r\n|\r/g,"\n"),this.blockTokens(t,this.tokens);for(let t=0;t<this.inlineQueue.length;t++){const e=this.inlineQueue[t];this.inlineTokens(e.src,e.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(t,e=[],n=!1){let r,i,a;for(t=this.options.pedantic?t.replace(/\t/g," ").replace(/^ +$/gm,""):t.replace(/^( *)(\t+)/gm,((t,e,n)=>e+" ".repeat(n.length)));t;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some((n=>!!(r=n.call({lexer:this},t,e))&&(t=t.substring(r.raw.length),e.push(r),!0)))))if(r=this.tokenizer.space(t))t=t.substring(r.raw.length),1===r.raw.length&&e.length>0?e[e.length-1].raw+="\n":e.push(r);else if(r=this.tokenizer.code(t))t=t.substring(r.raw.length),i=e[e.length-1],!i||"paragraph"!==i.type&&"text"!==i.type?e.push(r):(i.raw+="\n"+r.raw,i.text+="\n"+r.text,this.inlineQueue[this.inlineQueue.length-1].src=i.text);else if(r=this.tokenizer.fences(t))t=t.substring(r.raw.length),e.push(r);else if(r=this.tokenizer.heading(t))t=t.substring(r.raw.length),e.push(r);else if(r=this.tokenizer.hr(t))t=t.substring(r.raw.length),e.push(r);else if(r=this.tokenizer.blockquote(t))t=t.substring(r.raw.length),e.push(r);else if(r=this.tokenizer.list(t))t=t.substring(r.raw.length),e.push(r);else if(r=this.tokenizer.html(t))t=t.substring(r.raw.length),e.push(r);else if(r=this.tokenizer.def(t))t=t.substring(r.raw.length),i=e[e.length-1],!i||"paragraph"!==i.type&&"text"!==i.type?this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title}):(i.raw+="\n"+r.raw,i.text+="\n"+r.raw,this.inlineQueue[this.inlineQueue.length-1].src=i.text);else if(r=this.tokenizer.table(t))t=t.substring(r.raw.length),e.push(r);else if(r=this.tokenizer.lheading(t))t=t.substring(r.raw.length),e.push(r);else{if(a=t,this.options.extensions&&this.options.extensions.startBlock){let e=1/0;const n=t.slice(1);let r;this.options.extensions.startBlock.forEach((t=>{r=t.call({lexer:this},n),"number"==typeof r&&r>=0&&(e=Math.min(e,r))})),e<1/0&&e>=0&&(a=t.substring(0,e+1))}if(this.state.top&&(r=this.tokenizer.paragraph(a)))i=e[e.length-1],n&&"paragraph"===i?.type?(i.raw+="\n"+r.raw,i.text+="\n"+r.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=i.text):e.push(r),n=a.length!==t.length,t=t.substring(r.raw.length);else if(r=this.tokenizer.text(t))t=t.substring(r.raw.length),i=e[e.length-1],i&&"text"===i.type?(i.raw+="\n"+r.raw,i.text+="\n"+r.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=i.text):e.push(r);else if(t){const e="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(e);break}throw new Error(e)}}return this.state.top=!0,e}inline(t,e=[]){return this.inlineQueue.push({src:t,tokens:e}),e}inlineTokens(t,e=[]){let n,r,i,a,s,o,l=t;if(this.tokens.links){const t=Object.keys(this.tokens.links);if(t.length>0)for(;null!=(a=this.tokenizer.rules.inline.reflinkSearch.exec(l));)t.includes(a[0].slice(a[0].lastIndexOf("[")+1,-1))&&(l=l.slice(0,a.index)+"["+"a".repeat(a[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(a=this.tokenizer.rules.inline.blockSkip.exec(l));)l=l.slice(0,a.index)+"["+"a".repeat(a[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(a=this.tokenizer.rules.inline.anyPunctuation.exec(l));)l=l.slice(0,a.index)+"++"+l.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;t;)if(s||(o=""),s=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some((r=>!!(n=r.call({lexer:this},t,e))&&(t=t.substring(n.raw.length),e.push(n),!0)))))if(n=this.tokenizer.escape(t))t=t.substring(n.raw.length),e.push(n);else if(n=this.tokenizer.tag(t))t=t.substring(n.raw.length),r=e[e.length-1],r&&"text"===n.type&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):e.push(n);else if(n=this.tokenizer.link(t))t=t.substring(n.raw.length),e.push(n);else if(n=this.tokenizer.reflink(t,this.tokens.links))t=t.substring(n.raw.length),r=e[e.length-1],r&&"text"===n.type&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):e.push(n);else if(n=this.tokenizer.emStrong(t,l,o))t=t.substring(n.raw.length),e.push(n);else if(n=this.tokenizer.codespan(t))t=t.substring(n.raw.length),e.push(n);else if(n=this.tokenizer.br(t))t=t.substring(n.raw.length),e.push(n);else if(n=this.tokenizer.del(t))t=t.substring(n.raw.length),e.push(n);else if(n=this.tokenizer.autolink(t))t=t.substring(n.raw.length),e.push(n);else if(this.state.inLink||!(n=this.tokenizer.url(t))){if(i=t,this.options.extensions&&this.options.extensions.startInline){let e=1/0;const n=t.slice(1);let r;this.options.extensions.startInline.forEach((t=>{r=t.call({lexer:this},n),"number"==typeof r&&r>=0&&(e=Math.min(e,r))})),e<1/0&&e>=0&&(i=t.substring(0,e+1))}if(n=this.tokenizer.inlineText(i))t=t.substring(n.raw.length),"_"!==n.raw.slice(-1)&&(o=n.raw.slice(-1)),s=!0,r=e[e.length-1],r&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):e.push(n);else if(t){const e="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(e);break}throw new Error(e)}}else t=t.substring(n.raw.length),e.push(n);return e}},ST=class{static{s(this,"_Renderer")}options;parser;constructor(t){this.options=t||_k}space(t){return""}code({text:t,lang:e,escaped:n}){const r=(e||"").match(/^\S*/)?.[0],i=t.replace(/\n$/,"")+"\n";return r?'<pre><code class="language-'+Mk(r)+'">'+(n?i:Mk(i,!0))+"</code></pre>\n":"<pre><code>"+(n?i:Mk(i,!0))+"</code></pre>\n"}blockquote({tokens:t}){return`<blockquote>\n${this.parser.parse(t)}</blockquote>\n`}html({text:t}){return t}heading({tokens:t,depth:e}){return`<h${e}>${this.parser.parseInline(t)}</h${e}>\n`}hr(t){return"<hr>\n"}list(t){const e=t.ordered,n=t.start;let r="";for(let e=0;e<t.items.length;e++){const n=t.items[e];r+=this.listitem(n)}const i=e?"ol":"ul";return"<"+i+(e&&1!==n?' start="'+n+'"':"")+">\n"+r+"</"+i+">\n"}listitem(t){let e="";if(t.task){const n=this.checkbox({checked:!!t.checked});t.loose?t.tokens.length>0&&"paragraph"===t.tokens[0].type?(t.tokens[0].text=n+" "+t.tokens[0].text,t.tokens[0].tokens&&t.tokens[0].tokens.length>0&&"text"===t.tokens[0].tokens[0].type&&(t.tokens[0].tokens[0].text=n+" "+t.tokens[0].tokens[0].text)):t.tokens.unshift({type:"text",raw:n+" ",text:n+" "}):e+=n+" "}return e+=this.parser.parse(t.tokens,!!t.loose),`<li>${e}</li>\n`}checkbox({checked:t}){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:t}){return`<p>${this.parser.parseInline(t)}</p>\n`}table(t){let e="",n="";for(let e=0;e<t.header.length;e++)n+=this.tablecell(t.header[e]);e+=this.tablerow({text:n});let r="";for(let e=0;e<t.rows.length;e++){const i=t.rows[e];n="";for(let t=0;t<i.length;t++)n+=this.tablecell(i[t]);r+=this.tablerow({text:n})}return r&&(r=`<tbody>${r}</tbody>`),"<table>\n<thead>\n"+e+"</thead>\n"+r+"</table>\n"}tablerow({text:t}){return`<tr>\n${t}</tr>\n`}tablecell(t){const e=this.parser.parseInline(t.tokens),n=t.header?"th":"td";return(t.align?`<${n} align="${t.align}">`:`<${n}>`)+e+`</${n}>\n`}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${t}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:e,tokens:n}){const r=this.parser.parseInline(n),i=Bk(t);if(null===i)return r;let a='<a href="'+(t=i)+'"';return e&&(a+=' title="'+e+'"'),a+=">"+r+"</a>",a}image({href:t,title:e,text:n}){const r=Bk(t);if(null===r)return n;let i=`<img src="${t=r}" alt="${n}"`;return e&&(i+=` title="${e}"`),i+=">",i}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):t.text}},AT=class{static{s(this,"_TextRenderer")}strong({text:t}){return t}em({text:t}){return t}codespan({text:t}){return t}del({text:t}){return t}html({text:t}){return t}text({text:t}){return t}link({text:t}){return""+t}image({text:t}){return""+t}br(){return""}},LT=class t{static{s(this,"_Parser")}options;renderer;textRenderer;constructor(t){this.options=t||_k,this.options.renderer=this.options.renderer||new ST,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new AT}static parse(e,n){return new t(n).parse(e)}static parseInline(e,n){return new t(n).parseInline(e)}parse(t,e=!0){let n="";for(let r=0;r<t.length;r++){const i=t[r];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[i.type]){const t=i,e=this.options.extensions.renderers[t.type].call({parser:this},t);if(!1!==e||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(t.type)){n+=e||"";continue}}const a=i;switch(a.type){case"space":n+=this.renderer.space(a);continue;case"hr":n+=this.renderer.hr(a);continue;case"heading":n+=this.renderer.heading(a);continue;case"code":n+=this.renderer.code(a);continue;case"table":n+=this.renderer.table(a);continue;case"blockquote":n+=this.renderer.blockquote(a);continue;case"list":n+=this.renderer.list(a);continue;case"html":n+=this.renderer.html(a);continue;case"paragraph":n+=this.renderer.paragraph(a);continue;case"text":{let i=a,s=this.renderer.text(i);for(;r+1<t.length&&"text"===t[r+1].type;)i=t[++r],s+="\n"+this.renderer.text(i);n+=e?this.renderer.paragraph({type:"paragraph",raw:s,text:s,tokens:[{type:"text",raw:s,text:s}]}):s;continue}default:{const t='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(t),"";throw new Error(t)}}}return n}parseInline(t,e){e=e||this.renderer;let n="";for(let r=0;r<t.length;r++){const i=t[r];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[i.type]){const t=this.options.extensions.renderers[i.type].call({parser:this},i);if(!1!==t||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(i.type)){n+=t||"";continue}}const a=i;switch(a.type){case"escape":case"text":n+=e.text(a);break;case"html":n+=e.html(a);break;case"link":n+=e.link(a);break;case"image":n+=e.image(a);break;case"strong":n+=e.strong(a);break;case"em":n+=e.em(a);break;case"codespan":n+=e.codespan(a);break;case"br":n+=e.br(a);break;case"del":n+=e.del(a);break;default:{const t='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(t),"";throw new Error(t)}}}return n}},NT=class{static{s(this,"_Hooks")}options;constructor(t){this.options=t||_k}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}},IT=class{static{s(this,"Marked")}defaults={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null};options=this.setOptions;parse=this.#t(CT.lex,LT.parse);parseInline=this.#t(CT.lexInline,LT.parseInline);Parser=LT;Renderer=ST;TextRenderer=AT;Lexer=CT;Tokenizer=jk;Hooks=NT;constructor(...t){this.use(...t)}walkTokens(t,e){let n=[];for(const r of t)switch(n=n.concat(e.call(this,r)),r.type){case"table":{const t=r;for(const r of t.header)n=n.concat(this.walkTokens(r.tokens,e));for(const r of t.rows)for(const t of r)n=n.concat(this.walkTokens(t.tokens,e));break}case"list":{const t=r;n=n.concat(this.walkTokens(t.items,e));break}default:{const t=r;this.defaults.extensions?.childTokens?.[t.type]?this.defaults.extensions.childTokens[t.type].forEach((r=>{const i=t[r].flat(1/0);n=n.concat(this.walkTokens(i,e))})):t.tokens&&(n=n.concat(this.walkTokens(t.tokens,e)))}}return n}use(...t){const e=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach((t=>{const n={...t};if(n.async=this.defaults.async||n.async||!1,t.extensions&&(t.extensions.forEach((t=>{if(!t.name)throw new Error("extension name required");if("renderer"in t){const n=e.renderers[t.name];e.renderers[t.name]=n?function(...e){let r=t.renderer.apply(this,e);return!1===r&&(r=n.apply(this,e)),r}:t.renderer}if("tokenizer"in t){if(!t.level||"block"!==t.level&&"inline"!==t.level)throw new Error("extension level must be 'block' or 'inline'");const n=e[t.level];n?n.unshift(t.tokenizer):e[t.level]=[t.tokenizer],t.start&&("block"===t.level?e.startBlock?e.startBlock.push(t.start):e.startBlock=[t.start]:"inline"===t.level&&(e.startInline?e.startInline.push(t.start):e.startInline=[t.start]))}"childTokens"in t&&t.childTokens&&(e.childTokens[t.name]=t.childTokens)})),n.extensions=e),t.renderer){const e=this.defaults.renderer||new ST(this.defaults);for(const n in t.renderer){if(!(n in e))throw new Error(`renderer '${n}' does not exist`);if(["options","parser"].includes(n))continue;const r=n;let i=t.renderer[r];t.useNewRenderer||(i=this.#e(i,r,e));const a=e[r];e[r]=(...t)=>{let n=i.apply(e,t);return!1===n&&(n=a.apply(e,t)),n||""}}n.renderer=e}if(t.tokenizer){const e=this.defaults.tokenizer||new jk(this.defaults);for(const n in t.tokenizer){if(!(n in e))throw new Error(`tokenizer '${n}' does not exist`);if(["options","rules","lexer"].includes(n))continue;const r=n,i=t.tokenizer[r],a=e[r];e[r]=(...t)=>{let n=i.apply(e,t);return!1===n&&(n=a.apply(e,t)),n}}n.tokenizer=e}if(t.hooks){const e=this.defaults.hooks||new NT;for(const n in t.hooks){if(!(n in e))throw new Error(`hook '${n}' does not exist`);if("options"===n)continue;const r=n,i=t.hooks[r],a=e[r];NT.passThroughHooks.has(n)?e[r]=t=>{if(this.defaults.async)return Promise.resolve(i.call(e,t)).then((t=>a.call(e,t)));const n=i.call(e,t);return a.call(e,n)}:e[r]=(...t)=>{let n=i.apply(e,t);return!1===n&&(n=a.apply(e,t)),n}}n.hooks=e}if(t.walkTokens){const e=this.defaults.walkTokens,r=t.walkTokens;n.walkTokens=function(t){let n=[];return n.push(r.call(this,t)),e&&(n=n.concat(e.call(this,t))),n}}this.defaults={...this.defaults,...n}})),this}#e(t,e,n){switch(e){case"heading":return function(r){return r.type&&r.type===e?t.call(this,n.parser.parseInline(r.tokens),r.depth,Dk(n.parser.parseInline(r.tokens,n.parser.textRenderer))):t.apply(this,arguments)};case"code":return function(n){return n.type&&n.type===e?t.call(this,n.text,n.lang,!!n.escaped):t.apply(this,arguments)};case"table":return function(n){if(!n.type||n.type!==e)return t.apply(this,arguments);let r="",i="";for(let t=0;t<n.header.length;t++)i+=this.tablecell({text:n.header[t].text,tokens:n.header[t].tokens,header:!0,align:n.align[t]});r+=this.tablerow({text:i});let a="";for(let t=0;t<n.rows.length;t++){const e=n.rows[t];i="";for(let t=0;t<e.length;t++)i+=this.tablecell({text:e[t].text,tokens:e[t].tokens,header:!1,align:n.align[t]});a+=this.tablerow({text:i})}return t.call(this,r,a)};case"blockquote":return function(n){if(!n.type||n.type!==e)return t.apply(this,arguments);const r=this.parser.parse(n.tokens);return t.call(this,r)};case"list":return function(n){if(!n.type||n.type!==e)return t.apply(this,arguments);const r=n.ordered,i=n.start,a=n.loose;let s="";for(let t=0;t<n.items.length;t++){const e=n.items[t],r=e.checked,i=e.task;let o="";if(e.task){const t=this.checkbox({checked:!!r});a?e.tokens.length>0&&"paragraph"===e.tokens[0].type?(e.tokens[0].text=t+" "+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&"text"===e.tokens[0].tokens[0].type&&(e.tokens[0].tokens[0].text=t+" "+e.tokens[0].tokens[0].text)):e.tokens.unshift({type:"text",text:t+" "}):o+=t+" "}o+=this.parser.parse(e.tokens,a),s+=this.listitem({type:"list_item",raw:o,text:o,task:i,checked:!!r,loose:a,tokens:e.tokens})}return t.call(this,s,r,i)};case"html":return function(n){return n.type&&n.type===e?t.call(this,n.text,n.block):t.apply(this,arguments)};case"paragraph":case"strong":case"em":case"del":return function(n){return n.type&&n.type===e?t.call(this,this.parser.parseInline(n.tokens)):t.apply(this,arguments)};case"escape":case"codespan":case"text":return function(n){return n.type&&n.type===e?t.call(this,n.text):t.apply(this,arguments)};case"link":return function(n){return n.type&&n.type===e?t.call(this,n.href,n.title,this.parser.parseInline(n.tokens)):t.apply(this,arguments)};case"image":return function(n){return n.type&&n.type===e?t.call(this,n.href,n.title,n.text):t.apply(this,arguments)}}return t}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,e){return CT.lex(t,e??this.defaults)}parser(t,e){return LT.parse(t,e??this.defaults)}#t(t,e){return(n,r)=>{const i={...r},a={...this.defaults,...i};!0===this.defaults.async&&!1===i.async&&(a.silent||console.warn("marked(): The async option was set to true by an extension. The async: false option sent to parse will be ignored."),a.async=!0);const s=this.#n(!!a.silent,!!a.async);if(null==n)return s(new Error("marked(): input parameter is undefined or null"));if("string"!=typeof n)return s(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));if(a.hooks&&(a.hooks.options=a),a.async)return Promise.resolve(a.hooks?a.hooks.preprocess(n):n).then((e=>t(e,a))).then((t=>a.hooks?a.hooks.processAllTokens(t):t)).then((t=>a.walkTokens?Promise.all(this.walkTokens(t,a.walkTokens)).then((()=>t)):t)).then((t=>e(t,a))).then((t=>a.hooks?a.hooks.postprocess(t):t)).catch(s);try{a.hooks&&(n=a.hooks.preprocess(n));let r=t(n,a);a.hooks&&(r=a.hooks.processAllTokens(r)),a.walkTokens&&this.walkTokens(r,a.walkTokens);let i=e(r,a);return a.hooks&&(i=a.hooks.postprocess(i)),i}catch(t){return s(t)}}}#n(t,e){return n=>{if(n.message+="\nPlease report this to https://github.com/markedjs/marked.",t){const t="<p>An error occurred:</p><pre>"+Mk(n.message+"",!0)+"</pre>";return e?Promise.resolve(t):t}if(e)return Promise.reject(n);throw n}}},MT=new IT;function RT(t,e){return MT.parse(t,e)}function DT(t,{markdownAutoWrap:e}){const n=kk(t.replace(/<br\/>/g,"\n").replace(/\n{2,}/g,"\n"));return!1===e?n.replace(/ /g,"&nbsp;"):n}function OT(t,e={}){const n=DT(t,e),r=RT.lexer(n),i=[[]];let a=0;function o(t,e="normal"){if("text"===t.type){t.text.split("\n").forEach(((t,n)=>{0!==n&&(a++,i.push([])),t.split(" ").forEach((t=>{(t=t.replace(/&#39;/g,"'"))&&i[a].push({content:t,type:e})}))}))}else"strong"===t.type||"em"===t.type?t.tokens.forEach((e=>{o(e,t.type)})):"html"===t.type&&i[a].push({content:t.text,type:"normal"})}return s(o,"processNode"),r.forEach((t=>{"paragraph"===t.type?t.tokens?.forEach((t=>{o(t)})):"html"===t.type&&i[a].push({content:t.text,type:"normal"})})),i}function PT(t,{markdownAutoWrap:e}={}){const n=RT.lexer(t);function r(t){return"text"===t.type?!1===e?t.text.replace(/\n */g,"<br/>").replace(/ /g,"&nbsp;"):t.text.replace(/\n */g,"<br/>"):"strong"===t.type?`<strong>${t.tokens?.map(r).join("")}</strong>`:"em"===t.type?`<em>${t.tokens?.map(r).join("")}</em>`:"paragraph"===t.type?`<p>${t.tokens?.map(r).join("")}</p>`:"space"===t.type?"":"html"===t.type?`${t.text}`:"escape"===t.type?t.text:`Unsupported markdown: ${t.type}`}return s(r,"output"),n.map(r).join("")}function BT(t){return Intl.Segmenter?[...(new Intl.Segmenter).segment(t)].map((t=>t.segment)):[...t]}function $T(t,e){return FT(t,[],BT(e.content),e.type)}function FT(t,e,n,r){if(0===n.length)return[{content:e.join(""),type:r},{content:"",type:r}];const[i,...a]=n,s=[...e,i];return t([{content:s.join(""),type:r}])?FT(t,s,a,r):(0===e.length&&i&&(e.push(i),n.shift()),[{content:e.join(""),type:r},{content:n.join(""),type:r}])}function zT(t,e){if(t.some((({content:t})=>t.includes("\n"))))throw new Error("splitLineToFitWidth does not support newlines in the line");return UT(t,e)}function UT(t,e,n=[],r=[]){if(0===t.length)return r.length>0&&n.push(r),n.length>0?n:[];let i="";" "===t[0].content&&(i=" ",t.shift());const a=t.shift()??{content:" ",type:"normal"},s=[...r];if(""!==i&&s.push({content:i,type:"normal"}),s.push(a),e(s))return UT(t,e,n,s);if(r.length>0)n.push(r),t.unshift(a);else if(a.content){const[r,i]=$T(e,a);n.push([r]),i.content&&t.unshift(i)}return UT(t,e,n)}function GT(t,e){e&&t.attr("style",e)}async function qT(t,e,n,r,i=!1){const a=t.append("foreignObject");a.attr("width",10*n+"px"),a.attr("height",10*n+"px");const s=a.append("xhtml:div");let o=e.label;e.label&&wn(e.label)&&(o=await Tn(e.label.replace(_n.lineBreakRegex,"\n"),Hn()));const l=e.isNode?"nodeLabel":"edgeLabel",c=s.append("span");c.html(o),GT(c,e.labelStyle),c.attr("class",`${l} ${r}`),GT(s,e.labelStyle),s.style("display","table-cell"),s.style("white-space","nowrap"),s.style("line-height","1.5"),s.style("max-width",n+"px"),s.style("text-align","center"),s.attr("xmlns","http://www.w3.org/1999/xhtml"),i&&s.attr("class","labelBkg");let h=s.node().getBoundingClientRect();return h.width===n&&(s.style("display","table"),s.style("white-space","break-spaces"),s.style("width",n+"px"),h=s.node().getBoundingClientRect()),a.node()}function jT(t,e,n){return t.append("tspan").attr("class","text-outer-tspan").attr("x",0).attr("y",e*n-.1+"em").attr("dy",n+"em")}function YT(t,e,n){const r=t.append("text"),i=jT(r,1,e);VT(i,n);const a=i.node().getComputedTextLength();return r.remove(),a}function WT(t,e,n){const r=t.append("text"),i=jT(r,1,e);VT(i,[{content:n,type:"normal"}]);const a=i.node()?.getBoundingClientRect();return a&&r.remove(),a}function HT(t,e,n,r=!1){const i=e.append("g"),a=i.insert("rect").attr("class","background").attr("style","stroke: none"),o=i.append("text").attr("y","-10.1");let l=0;for(const e of n){const n=s((e=>YT(i,1.1,e)<=t),"checkWidth"),r=n(e)?[e]:zT(e,n);for(const t of r){VT(jT(o,l,1.1),t),l++}}if(r){const t=o.node().getBBox(),e=2;return a.attr("x",t.x-e).attr("y",t.y-e).attr("width",t.width+2*e).attr("height",t.height+2*e),i.node()}return o.node()}function VT(t,e){t.text(""),e.forEach(((e,n)=>{const r=t.append("tspan").attr("font-style","em"===e.type?"italic":"normal").attr("class","text-inner-tspan").attr("font-weight","strong"===e.type?"bold":"normal");0===n?r.text(e.content):r.text(" "+e.content)}))}function XT(t){return t.replace(/fa[bklrs]?:fa-[\w-]+/g,(t=>`<i class='${t.replace(":"," ")}'></i>`))}s(RT,"marked"),RT.options=RT.setOptions=function(t){return MT.setOptions(t),RT.defaults=MT.defaults,Ek(RT.defaults),RT},RT.getDefaults=Tk,RT.defaults=_k,RT.use=function(...t){return MT.use(...t),RT.defaults=MT.defaults,Ek(RT.defaults),RT},RT.walkTokens=function(t,e){return MT.walkTokens(t,e)},RT.parseInline=MT.parseInline,RT.Parser=LT,RT.parser=LT.parse,RT.Renderer=ST,RT.TextRenderer=AT,RT.Lexer=CT,RT.lexer=CT.lex,RT.Tokenizer=jk,RT.Hooks=NT,RT.parse=RT,RT.options,RT.setOptions,RT.use,RT.walkTokens,RT.parseInline,LT.parse,CT.lex,s(DT,"preprocessMarkdown"),s(OT,"markdownToLines"),s(PT,"markdownToHTML"),s(BT,"splitTextToChars"),s($T,"splitWordToFitWidth"),s(FT,"splitWordToFitWidthRecursion"),s(zT,"splitLineToFitWidth"),s(UT,"splitLineToFitWidthRecursion"),s(GT,"applyStyle"),s(qT,"addHtmlSpan"),s(jT,"createTspan"),s(YT,"computeWidthOfText"),s(WT,"computeDimensionOfText"),s(HT,"createFormattedText"),s(VT,"updateTextContentAndStyles"),s(XT,"replaceIconSubstring");var KT=s((async(t,e="",{style:n="",isTitle:r=!1,classes:i="",useHtmlLabels:a=!0,isNode:s=!0,width:o=200,addSvgBackground:l=!1}={},c)=>{if(m.debug("XYZ createText",e,n,r,i,a,s,"addSvgBackground: ",l),a){const r=PT(e,c),a=XT(xk(r)),h=e.replace(/\\\\/g,"\\"),u={isNode:s,label:wn(e)?h:a,labelStyle:n.replace("fill:","color:")};return await qT(t,u,o,i,l)}{const r=HT(o,t,OT(e.replace(/<br\s*\/?>/g,"<br/>").replace("<br>","<br/>"),c),!!e&&l);if(s){/stroke:/.exec(n)&&(n=n.replace("stroke:","lineColor:"));const t=n.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");Oa(r).attr("style",t)}else{const t=n.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/background:/g,"fill:");Oa(r).select("rect").attr("style",t.replace(/background:/g,"fill:"));const e=n.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");Oa(r).select("text").attr("style",e)}return r}}),"createText"),ZT=s((async(t,e,n)=>{let r;const i=e.useHtmlLabels||dn(Hn()?.htmlLabels);r=n||"node default";const a=t.insert("g").attr("class",r).attr("id",e.domId||e.id),o=a.insert("g").attr("class","label").attr("style",wk(e.labelStyle));let l;l=void 0===e.label?"":"string"==typeof e.label?e.label:e.label[0];const c=await KT(o,an(xk(l),Hn()),{useHtmlLabels:i,width:e.width||Hn().flowchart?.wrappingWidth,cssClasses:"markdown-node-label",style:e.labelStyle,addSvgBackground:!!e.icon||!!e.img});let h=c.getBBox();const u=(e?.padding??0)/2;if(i){const t=c.children[0],e=Oa(c),n=t.getElementsByTagName("img");if(n){const t=""===l.replace(/<img[^>]*>/g,"").trim();await Promise.all([...n].map((e=>new Promise((n=>{function r(){if(e.style.display="flex",e.style.flexDirection="column",t){const t=Hn().fontSize?Hn().fontSize:window.getComputedStyle(document.body).fontSize,n=5,[r=Ct.fontSize]=fk(t),i=r*n+"px";e.style.minWidth=i,e.style.maxWidth=i}else e.style.width="100%";n(e)}s(r,"setupImage"),setTimeout((()=>{e.complete&&r()})),e.addEventListener("error",r),e.addEventListener("load",r)})))))}h=t.getBoundingClientRect(),e.attr("width",h.width),e.attr("height",h.height)}return i?o.attr("transform","translate("+-h.width/2+", "+-h.height/2+")"):o.attr("transform","translate(0, "+-h.height/2+")"),e.centerLabel&&o.attr("transform","translate("+-h.width/2+", "+-h.height/2+")"),o.insert("rect",":first-child"),{shapeSvg:a,bbox:h,halfPadding:u,label:o}}),"labelHelper"),QT=s((async(t,e,n)=>{const r=n.useHtmlLabels||dn(Hn()?.flowchart?.htmlLabels),i=t.insert("g").attr("class","label").attr("style",n.labelStyle||""),a=await KT(i,an(xk(e),Hn()),{useHtmlLabels:r,width:n.width||Hn()?.flowchart?.wrappingWidth,style:n.labelStyle,addSvgBackground:!!n.icon||!!n.img});let s=a.getBBox();const o=n.padding/2;if(dn(Hn()?.flowchart?.htmlLabels)){const t=a.children[0],e=Oa(a);s=t.getBoundingClientRect(),e.attr("width",s.width),e.attr("height",s.height)}return r?i.attr("transform","translate("+-s.width/2+", "+-s.height/2+")"):i.attr("transform","translate(0, "+-s.height/2+")"),n.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"),JT=s(((t,e)=>{const n=e.node().getBBox();t.width=n.width,t.height=n.height}),"updateNodeBounds"),t_=s(((t,e)=>("handDrawn"===t.look?"rough-node":"node")+" "+t.cssClasses+" "+(e||"")),"getNodeClasses");function e_(t){const e=t.map(((t,e)=>`${0===e?"M":"L"}${t.x},${t.y}`));return e.push("Z"),e.join(" ")}function n_(t,e,n,r,i,a){const s=[],o=n-t,l=r-e,c=o/a,h=2*Math.PI/c,u=e+l/2;for(let e=0;e<=50;e++){const n=t+e/50*o,r=u+i*Math.sin(h*(n-t));s.push({x:n,y:r})}return s}function r_(t,e,n,r,i,a){const s=[],o=i*Math.PI/180,l=(a*Math.PI/180-o)/(r-1);for(let i=0;i<r;i++){const r=o+i*l,a=t+n*Math.cos(r),c=e+n*Math.sin(r);s.push({x:-a,y:-c})}return s}function i_(t,e,n){if(t&&t.length){const[r,i]=e,a=Math.PI/180*n,s=Math.cos(a),o=Math.sin(a);for(const e of t){const[t,n]=e;e[0]=(t-r)*s-(n-i)*o+r,e[1]=(t-r)*o+(n-i)*s+i}}}function a_(t,e){return t[0]===e[0]&&t[1]===e[1]}function s_(t,e,n,r=1){const i=n,a=Math.max(e,.1),s=t[0]&&t[0][0]&&"number"==typeof t[0][0]?[t]:t,o=[0,0];if(i)for(const t of s)i_(t,o,i);const l=function(t,e,n){const r=[];for(const e of t){const t=[...e];a_(t[0],t[t.length-1])||t.push([t[0][0],t[0][1]]),t.length>2&&r.push(t)}const i=[];e=Math.max(e,.1);const a=[];for(const t of r)for(let e=0;e<t.length-1;e++){const n=t[e],r=t[e+1];if(n[1]!==r[1]){const t=Math.min(n[1],r[1]);a.push({ymin:t,ymax:Math.max(n[1],r[1]),x:t===n[1]?n[0]:r[0],islope:(r[0]-n[0])/(r[1]-n[1])})}}if(a.sort(((t,e)=>t.ymin<e.ymin?-1:t.ymin>e.ymin?1:t.x<e.x?-1:t.x>e.x?1:t.ymax===e.ymax?0:(t.ymax-e.ymax)/Math.abs(t.ymax-e.ymax))),!a.length)return i;let s=[],o=a[0].ymin,l=0;for(;s.length||a.length;){if(a.length){let t=-1;for(let e=0;e<a.length&&!(a[e].ymin>o);e++)t=e;a.splice(0,t+1).forEach((t=>{s.push({s:o,edge:t})}))}if(s=s.filter((t=>!(t.edge.ymax<=o))),s.sort(((t,e)=>t.edge.x===e.edge.x?0:(t.edge.x-e.edge.x)/Math.abs(t.edge.x-e.edge.x))),(1!==n||l%e==0)&&s.length>1)for(let t=0;t<s.length;t+=2){const e=t+1;if(e>=s.length)break;const n=s[t].edge,r=s[e].edge;i.push([[Math.round(n.x),o],[Math.round(r.x),o]])}o+=n,s.forEach((t=>{t.edge.x=t.edge.x+n*t.edge.islope})),l++}return i}(s,a,r);if(i){for(const t of s)i_(t,o,-i);!function(t,e,n){const r=[];t.forEach((t=>r.push(...t))),i_(r,e,n)}(l,o,-i)}return l}function o_(t,e){var n;const r=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&&((null===(n=e.randomizer)||void 0===n?void 0:n.next())||Math.random())>.7&&(a=i),s_(t,i,r,a||1)}s(e_,"createPathFromPoints"),s(n_,"generateFullSineWavePoints"),s(r_,"generateCirclePoints"),s(i_,"t"),s(a_,"e"),s(s_,"s"),s(o_,"n");var l_=class{static{s(this,"o")}constructor(t){this.helper=t}fillPolygons(t,e){return this._fillPolygons(t,e)}_fillPolygons(t,e){const n=o_(t,e);return{type:"fillSketch",ops:this.renderLines(n,e)}}renderLines(t,e){const n=[];for(const r of t)n.push(...this.helper.doubleLineOps(r[0][0],r[0][1],r[1][0],r[1][1],e));return n}};function c_(t){const e=t[0],n=t[1];return Math.sqrt(Math.pow(e[0]-n[0],2)+Math.pow(e[1]-n[1],2))}s(c_,"a");var h_=class extends l_{static{s(this,"h")}fillPolygons(t,e){let n=e.hachureGap;n<0&&(n=4*e.strokeWidth),n=Math.max(n,.1);const r=o_(t,Object.assign({},e,{hachureGap:n})),i=Math.PI/180*e.hachureAngle,a=[],s=.5*n*Math.cos(i),o=.5*n*Math.sin(i);for(const[t,e]of r)c_([t,e])&&a.push([[t[0]-s,t[1]+o],[...e]],[[t[0]+s,t[1]-o],[...e]]);return{type:"fillSketch",ops:this.renderLines(a,e)}}},u_=class extends l_{static{s(this,"r")}fillPolygons(t,e){const n=this._fillPolygons(t,e),r=Object.assign({},e,{hachureAngle:e.hachureAngle+90}),i=this._fillPolygons(t,r);return n.ops=n.ops.concat(i.ops),n}},d_=class{static{s(this,"i")}constructor(t){this.helper=t}fillPolygons(t,e){const n=o_(t,e=Object.assign({},e,{hachureAngle:0}));return this.dotsOnLines(n,e)}dotsOnLines(t,e){const n=[];let r=e.hachureGap;r<0&&(r=4*e.strokeWidth),r=Math.max(r,.1);let i=e.fillWeight;i<0&&(i=e.strokeWidth/2);const a=r/4;for(const s of t){const t=c_(s),o=t/r,l=Math.ceil(o)-1,c=t-l*r,h=(s[0][0]+s[1][0])/2-r/4,u=Math.min(s[0][1],s[1][1]);for(let t=0;t<l;t++){const s=u+c+t*r,o=h-a+2*Math.random()*a,l=s-a+2*Math.random()*a,d=this.helper.ellipse(o,l,i,i,e);n.push(...d.ops)}}return{type:"fillSketch",ops:n}}},p_=class{static{s(this,"c")}constructor(t){this.helper=t}fillPolygons(t,e){const n=o_(t,e);return{type:"fillSketch",ops:this.dashedLine(n,e)}}dashedLine(t,e){const n=e.dashOffset<0?e.hachureGap<0?4*e.strokeWidth:e.hachureGap:e.dashOffset,r=e.dashGap<0?e.hachureGap<0?4*e.strokeWidth:e.hachureGap:e.dashGap,i=[];return t.forEach((t=>{const a=c_(t),s=Math.floor(a/(n+r)),o=(a+r-s*(n+r))/2;let l=t[0],c=t[1];l[0]>c[0]&&(l=t[1],c=t[0]);const h=Math.atan((c[1]-l[1])/(c[0]-l[0]));for(let t=0;t<s;t++){const a=t*(n+r),s=a+n,c=[l[0]+a*Math.cos(h)+o*Math.cos(h),l[1]+a*Math.sin(h)+o*Math.sin(h)],u=[l[0]+s*Math.cos(h)+o*Math.cos(h),l[1]+s*Math.sin(h)+o*Math.sin(h)];i.push(...this.helper.doubleLineOps(c[0],c[1],u[0],u[1],e))}})),i}},g_=class{static{s(this,"l")}constructor(t){this.helper=t}fillPolygons(t,e){const n=e.hachureGap<0?4*e.strokeWidth:e.hachureGap,r=e.zigzagOffset<0?n:e.zigzagOffset,i=o_(t,e=Object.assign({},e,{hachureGap:n+r}));return{type:"fillSketch",ops:this.zigzagLines(i,r,e)}}zigzagLines(t,e,n){const r=[];return t.forEach((t=>{const i=c_(t),a=Math.round(i/(2*e));let s=t[0],o=t[1];s[0]>o[0]&&(s=t[1],o=t[0]);const l=Math.atan((o[1]-s[1])/(o[0]-s[0]));for(let t=0;t<a;t++){const i=2*t*e,a=2*(t+1)*e,o=Math.sqrt(2*Math.pow(e,2)),c=[s[0]+i*Math.cos(l),s[1]+i*Math.sin(l)],h=[s[0]+a*Math.cos(l),s[1]+a*Math.sin(l)],u=[c[0]+o*Math.cos(l+Math.PI/4),c[1]+o*Math.sin(l+Math.PI/4)];r.push(...this.helper.doubleLineOps(c[0],c[1],u[0],u[1],n),...this.helper.doubleLineOps(u[0],u[1],h[0],h[1],n))}})),r}},f_={},m_=class{static{s(this,"p")}constructor(t){this.seed=t}next(){return this.seed?(2**31-1&(this.seed=Math.imul(48271,this.seed)))/2**31:Math.random()}},y_={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 v_(t,e){return t.type===e}function x_(t){const e=[],n=function(t){const e=new Array;for(;""!==t;)if(t.match(/^([ \t\r\n,]+)/))t=t.substr(RegExp.$1.length);else if(t.match(/^([aAcChHlLmMqQsStTvVzZ])/))e[e.length]={type:0,text:RegExp.$1},t=t.substr(RegExp.$1.length);else{if(!t.match(/^(([-+]?[0-9]+(\.[0-9]*)?|[-+]?\.[0-9]+)([eE][-+]?[0-9]+)?)/))return[];e[e.length]={type:1,text:`${parseFloat(RegExp.$1)}`},t=t.substr(RegExp.$1.length)}return e[e.length]={type:2,text:""},e}(t);let r="BOD",i=0,a=n[i];for(;!v_(a,2);){let s=0;const o=[];if("BOD"===r){if("M"!==a.text&&"m"!==a.text)return x_("M0,0"+t);i++,s=y_[a.text],r=a.text}else v_(a,1)?s=y_[r]:(i++,s=y_[a.text],r=a.text);if(!(i+s<n.length))throw new Error("Path data ended short");for(let t=i;t<i+s;t++){const e=n[t];if(!v_(e,1))throw new Error("Param not a number: "+r+","+e.text);o[o.length]=+e.text}if("number"!=typeof y_[r])throw new Error("Bad segment: "+r);{const t={key:r,data:o};e.push(t),i+=s,a=n[i],"M"===r&&(r="L"),"m"===r&&(r="l")}}return e}function b_(t){let e=0,n=0,r=0,i=0;const a=[];for(const{key:s,data:o}of t)switch(s){case"M":a.push({key:"M",data:[...o]}),[e,n]=o,[r,i]=o;break;case"m":e+=o[0],n+=o[1],a.push({key:"M",data:[e,n]}),r=e,i=n;break;case"L":a.push({key:"L",data:[...o]}),[e,n]=o;break;case"l":e+=o[0],n+=o[1],a.push({key:"L",data:[e,n]});break;case"C":a.push({key:"C",data:[...o]}),e=o[4],n=o[5];break;case"c":{const t=o.map(((t,r)=>r%2?t+n:t+e));a.push({key:"C",data:t}),e=t[4],n=t[5];break}case"Q":a.push({key:"Q",data:[...o]}),e=o[2],n=o[3];break;case"q":{const t=o.map(((t,r)=>r%2?t+n:t+e));a.push({key:"Q",data:t}),e=t[2],n=t[3];break}case"A":a.push({key:"A",data:[...o]}),e=o[5],n=o[6];break;case"a":e+=o[5],n+=o[6],a.push({key:"A",data:[o[0],o[1],o[2],o[3],o[4],e,n]});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]}),n=o[0];break;case"v":n+=o[0],a.push({key:"V",data:[n]});break;case"S":a.push({key:"S",data:[...o]}),e=o[2],n=o[3];break;case"s":{const t=o.map(((t,r)=>r%2?t+n:t+e));a.push({key:"S",data:t}),e=t[2],n=t[3];break}case"T":a.push({key:"T",data:[...o]}),e=o[0],n=o[1];break;case"t":e+=o[0],n+=o[1],a.push({key:"T",data:[e,n]});break;case"Z":case"z":a.push({key:"Z",data:[]}),e=r,n=i}return a}function w_(t){const e=[];let n="",r=0,i=0,a=0,s=0,o=0,l=0;for(const{key:c,data:h}of t){switch(c){case"M":e.push({key:"M",data:[...h]}),[r,i]=h,[a,s]=h;break;case"C":e.push({key:"C",data:[...h]}),r=h[4],i=h[5],o=h[2],l=h[3];break;case"L":e.push({key:"L",data:[...h]}),[r,i]=h;break;case"H":r=h[0],e.push({key:"L",data:[r,i]});break;case"V":i=h[0],e.push({key:"L",data:[r,i]});break;case"S":{let t=0,a=0;"C"===n||"S"===n?(t=r+(r-o),a=i+(i-l)):(t=r,a=i),e.push({key:"C",data:[t,a,...h]}),o=h[0],l=h[1],r=h[2],i=h[3];break}case"T":{const[t,a]=h;let s=0,c=0;"Q"===n||"T"===n?(s=r+(r-o),c=i+(i-l)):(s=r,c=i);const u=r+2*(s-r)/3,d=i+2*(c-i)/3,p=t+2*(s-t)/3,g=a+2*(c-a)/3;e.push({key:"C",data:[u,d,p,g,t,a]}),o=s,l=c,r=t,i=a;break}case"Q":{const[t,n,a,s]=h,c=r+2*(t-r)/3,u=i+2*(n-i)/3,d=a+2*(t-a)/3,p=s+2*(n-s)/3;e.push({key:"C",data:[c,u,d,p,a,s]}),o=t,l=n,r=a,i=s;break}case"A":{const t=Math.abs(h[0]),n=Math.abs(h[1]),a=h[2],s=h[3],o=h[4],l=h[5],c=h[6];0===t||0===n?(e.push({key:"C",data:[r,i,l,c,l,c]}),r=l,i=c):r===l&&i===c||(T_(r,i,l,c,t,n,a,s,o).forEach((function(t){e.push({key:"C",data:t})})),r=l,i=c);break}case"Z":e.push({key:"Z",data:[]}),r=a,i=s}n=c}return e}function k_(t,e,n){return[t*Math.cos(n)-e*Math.sin(n),t*Math.sin(n)+e*Math.cos(n)]}function T_(t,e,n,r,i,a,s,o,l,c){const h=(u=s,Math.PI*u/180);var u;let d=[],p=0,g=0,f=0,m=0;if(c)[p,g,f,m]=c;else{[t,e]=k_(t,e,-h),[n,r]=k_(n,r,-h);const s=(t-n)/2,c=(e-r)/2;let u=s*s/(i*i)+c*c/(a*a);u>1&&(u=Math.sqrt(u),i*=u,a*=u);const d=i*i,y=a*a,v=d*y-d*c*c-y*s*s,x=d*c*c+y*s*s,b=(o===l?-1:1)*Math.sqrt(Math.abs(v/x));f=b*i*c/a+(t+n)/2,m=b*-a*s/i+(e+r)/2,p=Math.asin(parseFloat(((e-m)/a).toFixed(9))),g=Math.asin(parseFloat(((r-m)/a).toFixed(9))),t<f&&(p=Math.PI-p),n<f&&(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 t=g,e=n,o=r;g=l&&g>p?p+120*Math.PI/180*1:p+120*Math.PI/180*-1,d=T_(n=f+i*Math.cos(g),r=m+a*Math.sin(g),e,o,i,a,s,0,l,[g,t,f,m])}y=g-p;const v=Math.cos(p),x=Math.sin(p),b=Math.cos(g),w=Math.sin(g),k=Math.tan(y/4),T=4/3*i*k,_=4/3*a*k,E=[t,e],C=[t+T*x,e-_*v],S=[n+T*w,r-_*b],A=[n,r];if(C[0]=2*E[0]-C[0],C[1]=2*E[1]-C[1],c)return[C,S,A].concat(d);{d=[C,S,A].concat(d);const t=[];for(let e=0;e<d.length;e+=3){const n=k_(d[e][0],d[e][1],h),r=k_(d[e+1][0],d[e+1][1],h),i=k_(d[e+2][0],d[e+2][1],h);t.push([n[0],n[1],r[0],r[1],i[0],i[1]])}return t}}s(v_,"k"),s(x_,"b"),s(b_,"y"),s(w_,"m"),s(k_,"w"),s(T_,"x");var __={randOffset:s((function(t,e){return $_(t,e)}),"randOffset"),randOffsetWithRange:s((function(t,e,n){return B_(t,e,n)}),"randOffsetWithRange"),ellipse:s((function(t,e,n,r,i){return N_(t,e,i,L_(n,r,i)).opset}),"ellipse"),doubleLineOps:s((function(t,e,n,r,i){return F_(t,e,n,r,i,!0)}),"doubleLineOps")};function E_(t,e,n,r,i){return{type:"path",ops:F_(t,e,n,r,i)}}function C_(t,e,n){const r=(t||[]).length;if(r>2){const i=[];for(let e=0;e<r-1;e++)i.push(...F_(t[e][0],t[e][1],t[e+1][0],t[e+1][1],n));return e&&i.push(...F_(t[r-1][0],t[r-1][1],t[0][0],t[0][1],n)),{type:"path",ops:i}}return 2===r?E_(t[0][0],t[0][1],t[1][0],t[1][1],n):{type:"path",ops:[]}}function S_(t,e,n,r,i){return function(t,e){return C_(t,!0,e)}([[t,e],[t+n,e],[t+n,e+r],[t,e+r]],i)}function A_(t,e){if(t.length){const n="number"==typeof t[0][0]?[t]:t,r=U_(n[0],1*(1+.2*e.roughness),e),i=e.disableMultiStroke?[]:U_(n[0],1.5*(1+.22*e.roughness),O_(e));for(let t=1;t<n.length;t++){const a=n[t];if(a.length){const t=U_(a,1*(1+.2*e.roughness),e),n=e.disableMultiStroke?[]:U_(a,1.5*(1+.22*e.roughness),O_(e));for(const e of t)"move"!==e.op&&r.push(e);for(const t of n)"move"!==t.op&&i.push(t)}}return{type:"path",ops:r.concat(i)}}return{type:"path",ops:[]}}function L_(t,e,n){const r=Math.sqrt(2*Math.PI*Math.sqrt((Math.pow(t/2,2)+Math.pow(e/2,2))/2)),i=Math.ceil(Math.max(n.curveStepCount,n.curveStepCount/Math.sqrt(200)*r)),a=2*Math.PI/i;let s=Math.abs(t/2),o=Math.abs(e/2);const l=1-n.curveFitting;return s+=$_(s*l,n),o+=$_(o*l,n),{increment:a,rx:s,ry:o}}function N_(t,e,n,r){const[i,a]=q_(r.increment,t,e,r.rx,r.ry,1,r.increment*B_(.1,B_(.4,1,n),n),n);let s=G_(i,null,n);if(!n.disableMultiStroke&&0!==n.roughness){const[i]=q_(r.increment,t,e,r.rx,r.ry,1.5,0,n),a=G_(i,null,n);s=s.concat(a)}return{estimatedPoints:a,opset:{type:"path",ops:s}}}function I_(t,e,n,r,i,a,s,o,l){const c=t,h=e;let u=Math.abs(n/2),d=Math.abs(r/2);u+=$_(.01*u,l),d+=$_(.01*d,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 f=2*Math.PI/l.curveStepCount,m=Math.min(f/2,(g-p)/2),y=j_(m,c,h,u,d,p,g,1,l);if(!l.disableMultiStroke){const t=j_(m,c,h,u,d,p,g,1.5,l);y.push(...t)}return s&&(o?y.push(...F_(c,h,c+u*Math.cos(p),h+d*Math.sin(p),l),...F_(c,h,c+u*Math.cos(g),h+d*Math.sin(g),l)):y.push({op:"lineTo",data:[c,h]},{op:"lineTo",data:[c+u*Math.cos(p),h+d*Math.sin(p)]})),{type:"path",ops:y}}function M_(t,e){const n=w_(b_(x_(t))),r=[];let i=[0,0],a=[0,0];for(const{key:t,data:s}of n)switch(t){case"M":a=[s[0],s[1]],i=[s[0],s[1]];break;case"L":r.push(...F_(a[0],a[1],s[0],s[1],e)),a=[s[0],s[1]];break;case"C":{const[t,n,i,o,l,c]=s;r.push(...Y_(t,n,i,o,l,c,a,e)),a=[l,c];break}case"Z":r.push(...F_(a[0],a[1],i[0],i[1],e)),a=[i[0],i[1]]}return{type:"path",ops:r}}function R_(t,e){const n=[];for(const r of t)if(r.length){const t=e.maxRandomnessOffset||0,i=r.length;if(i>2){n.push({op:"move",data:[r[0][0]+$_(t,e),r[0][1]+$_(t,e)]});for(let a=1;a<i;a++)n.push({op:"lineTo",data:[r[a][0]+$_(t,e),r[a][1]+$_(t,e)]})}}return{type:"fillPath",ops:n}}function D_(t,e){return function(t,e){let n=t.fillStyle||"hachure";if(!f_[n])switch(n){case"zigzag":f_[n]||(f_[n]=new h_(e));break;case"cross-hatch":f_[n]||(f_[n]=new u_(e));break;case"dots":f_[n]||(f_[n]=new d_(e));break;case"dashed":f_[n]||(f_[n]=new p_(e));break;case"zigzag-line":f_[n]||(f_[n]=new g_(e));break;default:n="hachure",f_[n]||(f_[n]=new l_(e))}return f_[n]}(e,__).fillPolygons(t,e)}function O_(t){const e=Object.assign({},t);return e.randomizer=void 0,t.seed&&(e.seed=t.seed+1),e}function P_(t){return t.randomizer||(t.randomizer=new m_(t.seed||0)),t.randomizer.next()}function B_(t,e,n,r=1){return n.roughness*r*(P_(n)*(e-t)+t)}function $_(t,e,n=1){return B_(-t,t,e,n)}function F_(t,e,n,r,i,a=!1){const s=a?i.disableMultiStrokeFill:i.disableMultiStroke,o=z_(t,e,n,r,i,!0,!1);if(s)return o;const l=z_(t,e,n,r,i,!0,!0);return o.concat(l)}function z_(t,e,n,r,i,a,o){const l=Math.pow(t-n,2)+Math.pow(e-r,2),c=Math.sqrt(l);let h=1;h=c<200?1:c>500?.4:-.0016668*c+1.233334;let u=i.maxRandomnessOffset||0;u*u*100>l&&(u=c/10);const d=u/2,p=.2+.2*P_(i);let g=i.bowing*i.maxRandomnessOffset*(r-e)/200,f=i.bowing*i.maxRandomnessOffset*(t-n)/200;g=$_(g,i,h),f=$_(f,i,h);const m=[],y=s((()=>$_(d,i,h)),"M"),v=s((()=>$_(u,i,h)),"k"),x=i.preserveVertices;return a&&(o?m.push({op:"move",data:[t+(x?0:y()),e+(x?0:y())]}):m.push({op:"move",data:[t+(x?0:$_(u,i,h)),e+(x?0:$_(u,i,h))]})),o?m.push({op:"bcurveTo",data:[g+t+(n-t)*p+y(),f+e+(r-e)*p+y(),g+t+2*(n-t)*p+y(),f+e+2*(r-e)*p+y(),n+(x?0:y()),r+(x?0:y())]}):m.push({op:"bcurveTo",data:[g+t+(n-t)*p+v(),f+e+(r-e)*p+v(),g+t+2*(n-t)*p+v(),f+e+2*(r-e)*p+v(),n+(x?0:v()),r+(x?0:v())]}),m}function U_(t,e,n){if(!t.length)return[];const r=[];r.push([t[0][0]+$_(e,n),t[0][1]+$_(e,n)]),r.push([t[0][0]+$_(e,n),t[0][1]+$_(e,n)]);for(let i=1;i<t.length;i++)r.push([t[i][0]+$_(e,n),t[i][1]+$_(e,n)]),i===t.length-1&&r.push([t[i][0]+$_(e,n),t[i][1]+$_(e,n)]);return G_(r,null,n)}function G_(t,e,n){const r=t.length,i=[];if(r>3){const a=[],s=1-n.curveTightness;i.push({op:"move",data:[t[1][0],t[1][1]]});for(let e=1;e+2<r;e++){const n=t[e];a[0]=[n[0],n[1]],a[1]=[n[0]+(s*t[e+1][0]-s*t[e-1][0])/6,n[1]+(s*t[e+1][1]-s*t[e-1][1])/6],a[2]=[t[e+1][0]+(s*t[e][0]-s*t[e+2][0])/6,t[e+1][1]+(s*t[e][1]-s*t[e+2][1])/6],a[3]=[t[e+1][0],t[e+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]]})}if(e&&2===e.length){const t=n.maxRandomnessOffset;i.push({op:"lineTo",data:[e[0]+$_(t,n),e[1]+$_(t,n)]})}}else 3===r?(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]]})):2===r&&i.push(...z_(t[0][0],t[0][1],t[1][0],t[1][1],n,!0,!0));return i}function q_(t,e,n,r,i,a,s,o){const l=[],c=[];if(0===o.roughness){t/=4,c.push([e+r*Math.cos(-t),n+i*Math.sin(-t)]);for(let a=0;a<=2*Math.PI;a+=t){const t=[e+r*Math.cos(a),n+i*Math.sin(a)];l.push(t),c.push(t)}c.push([e+r*Math.cos(0),n+i*Math.sin(0)]),c.push([e+r*Math.cos(t),n+i*Math.sin(t)])}else{const h=$_(.5,o)-Math.PI/2;c.push([$_(a,o)+e+.9*r*Math.cos(h-t),$_(a,o)+n+.9*i*Math.sin(h-t)]);const u=2*Math.PI+h-.01;for(let s=h;s<u;s+=t){const t=[$_(a,o)+e+r*Math.cos(s),$_(a,o)+n+i*Math.sin(s)];l.push(t),c.push(t)}c.push([$_(a,o)+e+r*Math.cos(h+2*Math.PI+.5*s),$_(a,o)+n+i*Math.sin(h+2*Math.PI+.5*s)]),c.push([$_(a,o)+e+.98*r*Math.cos(h+s),$_(a,o)+n+.98*i*Math.sin(h+s)]),c.push([$_(a,o)+e+.9*r*Math.cos(h+.5*s),$_(a,o)+n+.9*i*Math.sin(h+.5*s)])}return[c,l]}function j_(t,e,n,r,i,a,s,o,l){const c=a+$_(.1,l),h=[];h.push([$_(o,l)+e+.9*r*Math.cos(c-t),$_(o,l)+n+.9*i*Math.sin(c-t)]);for(let a=c;a<=s;a+=t)h.push([$_(o,l)+e+r*Math.cos(a),$_(o,l)+n+i*Math.sin(a)]);return h.push([e+r*Math.cos(s),n+i*Math.sin(s)]),h.push([e+r*Math.cos(s),n+i*Math.sin(s)]),G_(h,null,l)}function Y_(t,e,n,r,i,a,s,o){const l=[],c=[o.maxRandomnessOffset||1,(o.maxRandomnessOffset||1)+.3];let h=[0,0];const u=o.disableMultiStroke?1:2,d=o.preserveVertices;for(let p=0;p<u;p++)0===p?l.push({op:"move",data:[s[0],s[1]]}):l.push({op:"move",data:[s[0]+(d?0:$_(c[0],o)),s[1]+(d?0:$_(c[0],o))]}),h=d?[i,a]:[i+$_(c[p],o),a+$_(c[p],o)],l.push({op:"bcurveTo",data:[t+$_(c[p],o),e+$_(c[p],o),n+$_(c[p],o),r+$_(c[p],o),h[0],h[1]]});return l}function W_(t){return[...t]}function H_(t,e=0){const n=t.length;if(n<3)throw new Error("A curve must have at least three points.");const r=[];if(3===n)r.push(W_(t[0]),W_(t[1]),W_(t[2]),W_(t[2]));else{const n=[];n.push(t[0],t[0]);for(let e=1;e<t.length;e++)n.push(t[e]),e===t.length-1&&n.push(t[e]);const i=[],a=1-e;r.push(W_(n[0]));for(let t=1;t+2<n.length;t++){const e=n[t];i[0]=[e[0],e[1]],i[1]=[e[0]+(a*n[t+1][0]-a*n[t-1][0])/6,e[1]+(a*n[t+1][1]-a*n[t-1][1])/6],i[2]=[n[t+1][0]+(a*n[t][0]-a*n[t+2][0])/6,n[t+1][1]+(a*n[t][1]-a*n[t+2][1])/6],i[3]=[n[t+1][0],n[t+1][1]],r.push(i[1],i[2],i[3])}}return r}function V_(t,e){return Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2)}function X_(t,e,n){const r=V_(e,n);if(0===r)return V_(t,e);let i=((t[0]-e[0])*(n[0]-e[0])+(t[1]-e[1])*(n[1]-e[1]))/r;return i=Math.max(0,Math.min(1,i)),V_(t,K_(e,n,i))}function K_(t,e,n){return[t[0]+(e[0]-t[0])*n,t[1]+(e[1]-t[1])*n]}function Z_(t,e,n,r){const i=r||[];if(function(t,e){const n=t[e+0],r=t[e+1],i=t[e+2],a=t[e+3];let s=3*r[0]-2*n[0]-a[0];s*=s;let o=3*r[1]-2*n[1]-a[1];o*=o;let l=3*i[0]-2*a[0]-n[0];l*=l;let c=3*i[1]-2*a[1]-n[1];return c*=c,s<l&&(s=l),o<c&&(o=c),s+o}(t,e)<n){const n=t[e+0];i.length?(a=i[i.length-1],s=n,Math.sqrt(V_(a,s))>1&&i.push(n)):i.push(n),i.push(t[e+3])}else{const r=.5,a=t[e+0],s=t[e+1],o=t[e+2],l=t[e+3],c=K_(a,s,r),h=K_(s,o,r),u=K_(o,l,r),d=K_(c,h,r),p=K_(h,u,r),g=K_(d,p,r);Z_([a,c,d,g],0,n,i),Z_([g,p,u,l],0,n,i)}var a,s;return i}function Q_(t,e){return J_(t,0,t.length,e)}function J_(t,e,n,r,i){const a=i||[],s=t[e],o=t[n-1];let l=0,c=1;for(let r=e+1;r<n-1;++r){const e=X_(t[r],s,o);e>l&&(l=e,c=r)}return Math.sqrt(l)>r?(J_(t,e,c+1,r,a),J_(t,c,n,r,a)):(a.length||a.push(s),a.push(o)),a}function tE(t,e=.15,n){const r=[],i=(t.length-1)/3;for(let n=0;n<i;n++)Z_(t,3*n,e,r);return n&&n>0?J_(r,0,r.length,n):r}s(E_,"v"),s(C_,"S"),s(S_,"O"),s(A_,"L"),s(L_,"T"),s(N_,"D"),s(I_,"A"),s(M_,"_"),s(R_,"I"),s(D_,"C"),s(O_,"z"),s(P_,"W"),s(B_,"E"),s($_,"G"),s(F_,"$"),s(z_,"R"),s(U_,"j"),s(G_,"q"),s(q_,"F"),s(j_,"V"),s(Y_,"Z"),s(W_,"Q"),s(H_,"H"),s(V_,"N"),s(X_,"B"),s(K_,"J"),s(Z_,"K"),s(Q_,"U"),s(J_,"X"),s(tE,"Y");var eE="none",nE=class{static{s(this,"et")}constructor(t){this.defaultOptions={maxRandomnessOffset:2,roughness:1,bowing:1,stroke:"#000",strokeWidth:1,curveTightness:0,curveFitting:.95,curveStepCount:9,fillStyle:"hachure",fillWeight:-1,hachureAngle:-41,hachureGap:-1,dashOffset:-1,dashGap:-1,zigzagOffset:-1,seed:0,disableMultiStroke:!1,disableMultiStrokeFill:!1,preserveVertices:!1,fillShapeRoughnessGain:.8},this.config=t||{},this.config.options&&(this.defaultOptions=this._o(this.config.options))}static newSeed(){return Math.floor(Math.random()*2**31)}_o(t){return t?Object.assign({},this.defaultOptions,t):this.defaultOptions}_d(t,e,n){return{shape:t,sets:e||[],options:n||this.defaultOptions}}line(t,e,n,r,i){const a=this._o(i);return this._d("line",[E_(t,e,n,r,a)],a)}rectangle(t,e,n,r,i){const a=this._o(i),s=[],o=S_(t,e,n,r,a);if(a.fill){const i=[[t,e],[t+n,e],[t+n,e+r],[t,e+r]];"solid"===a.fillStyle?s.push(R_([i],a)):s.push(D_([i],a))}return a.stroke!==eE&&s.push(o),this._d("rectangle",s,a)}ellipse(t,e,n,r,i){const a=this._o(i),s=[],o=L_(n,r,a),l=N_(t,e,a,o);if(a.fill)if("solid"===a.fillStyle){const n=N_(t,e,a,o).opset;n.type="fillPath",s.push(n)}else s.push(D_([l.estimatedPoints],a));return a.stroke!==eE&&s.push(l.opset),this._d("ellipse",s,a)}circle(t,e,n,r){const i=this.ellipse(t,e,n,n,r);return i.shape="circle",i}linearPath(t,e){const n=this._o(e);return this._d("linearPath",[C_(t,!1,n)],n)}arc(t,e,n,r,i,a,s=!1,o){const l=this._o(o),c=[],h=I_(t,e,n,r,i,a,s,!0,l);if(s&&l.fill)if("solid"===l.fillStyle){const s=Object.assign({},l);s.disableMultiStroke=!0;const o=I_(t,e,n,r,i,a,!0,!1,s);o.type="fillPath",c.push(o)}else c.push(function(t,e,n,r,i,a,s){const o=t,l=e;let c=Math.abs(n/2),h=Math.abs(r/2);c+=$_(.01*c,s),h+=$_(.01*h,s);let u=i,d=a;for(;u<0;)u+=2*Math.PI,d+=2*Math.PI;d-u>2*Math.PI&&(u=0,d=2*Math.PI);const p=(d-u)/s.curveStepCount,g=[];for(let t=u;t<=d;t+=p)g.push([o+c*Math.cos(t),l+h*Math.sin(t)]);return g.push([o+c*Math.cos(d),l+h*Math.sin(d)]),g.push([o,l]),D_([g],s)}(t,e,n,r,i,a,l));return l.stroke!==eE&&c.push(h),this._d("arc",c,l)}curve(t,e){const n=this._o(e),r=[],i=A_(t,n);if(n.fill&&n.fill!==eE)if("solid"===n.fillStyle){const e=A_(t,Object.assign(Object.assign({},n),{disableMultiStroke:!0,roughness:n.roughness?n.roughness+n.fillShapeRoughnessGain:0}));r.push({type:"fillPath",ops:this._mergedShape(e.ops)})}else{const e=[],i=t;if(i.length){const t="number"==typeof i[0][0]?[i]:i;for(const r of t)r.length<3?e.push(...r):3===r.length?e.push(...tE(H_([r[0],r[0],r[1],r[2]]),10,(1+n.roughness)/2)):e.push(...tE(H_(r),10,(1+n.roughness)/2))}e.length&&r.push(D_([e],n))}return n.stroke!==eE&&r.push(i),this._d("curve",r,n)}polygon(t,e){const n=this._o(e),r=[],i=C_(t,!0,n);return n.fill&&("solid"===n.fillStyle?r.push(R_([t],n)):r.push(D_([t],n))),n.stroke!==eE&&r.push(i),this._d("polygon",r,n)}path(t,e){const n=this._o(e),r=[];if(!t)return this._d("path",r,n);t=(t||"").replace(/\n/g," ").replace(/(-\s)/g,"-").replace("/(ss)/g"," ");const i=n.fill&&"transparent"!==n.fill&&n.fill!==eE,a=n.stroke!==eE,o=!!(n.simplification&&n.simplification<1),l=function(t,e,n){const r=w_(b_(x_(t))),i=[];let a=[],o=[0,0],l=[];const c=s((()=>{l.length>=4&&a.push(...tE(l,1)),l=[]}),"i"),h=s((()=>{c(),a.length&&(i.push(a),a=[])}),"c");for(const{key:t,data:e}of r)switch(t){case"M":h(),o=[e[0],e[1]],a.push(o);break;case"L":c(),a.push([e[0],e[1]]);break;case"C":if(!l.length){const t=a.length?a[a.length-1]:o;l.push([t[0],t[1]])}l.push([e[0],e[1]]),l.push([e[2],e[3]]),l.push([e[4],e[5]]);break;case"Z":c(),a.push([o[0],o[1]])}if(h(),!n)return i;const u=[];for(const t of i){const e=Q_(t,n);e.length&&u.push(e)}return u}(t,0,o?4-4*(n.simplification||1):(1+n.roughness)/2),c=M_(t,n);if(i)if("solid"===n.fillStyle)if(1===l.length){const e=M_(t,Object.assign(Object.assign({},n),{disableMultiStroke:!0,roughness:n.roughness?n.roughness+n.fillShapeRoughnessGain:0}));r.push({type:"fillPath",ops:this._mergedShape(e.ops)})}else r.push(R_(l,n));else r.push(D_(l,n));return a&&(o?l.forEach((t=>{r.push(C_(t,!1,n))})):r.push(c)),this._d("path",r,n)}opsToPath(t,e){let n="";for(const r of t.ops){const t="number"==typeof e&&e>=0?r.data.map((t=>+t.toFixed(e))):r.data;switch(r.op){case"move":n+=`M${t[0]} ${t[1]} `;break;case"bcurveTo":n+=`C${t[0]} ${t[1]}, ${t[2]} ${t[3]}, ${t[4]} ${t[5]} `;break;case"lineTo":n+=`L${t[0]} ${t[1]} `}}return n.trim()}toPaths(t){const e=t.sets||[],n=t.options||this.defaultOptions,r=[];for(const t of e){let e=null;switch(t.type){case"path":e={d:this.opsToPath(t),stroke:n.stroke,strokeWidth:n.strokeWidth,fill:eE};break;case"fillPath":e={d:this.opsToPath(t),stroke:eE,strokeWidth:0,fill:n.fill||eE};break;case"fillSketch":e=this.fillSketch(t,n)}e&&r.push(e)}return r}fillSketch(t,e){let n=e.fillWeight;return n<0&&(n=e.strokeWidth/2),{d:this.opsToPath(t),stroke:e.fill||eE,strokeWidth:n,fill:eE}}_mergedShape(t){return t.filter(((t,e)=>0===e||"move"!==t.op))}},rE=class{static{s(this,"st")}constructor(t,e){this.canvas=t,this.ctx=this.canvas.getContext("2d"),this.gen=new nE(e)}draw(t){const e=t.sets||[],n=t.options||this.getDefaultOptions(),r=this.ctx,i=t.options.fixedDecimalPlaceDigits;for(const a of e)switch(a.type){case"path":r.save(),r.strokeStyle="none"===n.stroke?"transparent":n.stroke,r.lineWidth=n.strokeWidth,n.strokeLineDash&&r.setLineDash(n.strokeLineDash),n.strokeLineDashOffset&&(r.lineDashOffset=n.strokeLineDashOffset),this._drawToContext(r,a,i),r.restore();break;case"fillPath":{r.save(),r.fillStyle=n.fill||"";const e="curve"===t.shape||"polygon"===t.shape||"path"===t.shape?"evenodd":"nonzero";this._drawToContext(r,a,i,e),r.restore();break}case"fillSketch":this.fillSketch(r,a,n)}}fillSketch(t,e,n){let r=n.fillWeight;r<0&&(r=n.strokeWidth/2),t.save(),n.fillLineDash&&t.setLineDash(n.fillLineDash),n.fillLineDashOffset&&(t.lineDashOffset=n.fillLineDashOffset),t.strokeStyle=n.fill||"",t.lineWidth=r,this._drawToContext(t,e,n.fixedDecimalPlaceDigits),t.restore()}_drawToContext(t,e,n,r="nonzero"){t.beginPath();for(const r of e.ops){const e="number"==typeof n&&n>=0?r.data.map((t=>+t.toFixed(n))):r.data;switch(r.op){case"move":t.moveTo(e[0],e[1]);break;case"bcurveTo":t.bezierCurveTo(e[0],e[1],e[2],e[3],e[4],e[5]);break;case"lineTo":t.lineTo(e[0],e[1])}}"fillPath"===e.type?t.fill(r):t.stroke()}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}line(t,e,n,r,i){const a=this.gen.line(t,e,n,r,i);return this.draw(a),a}rectangle(t,e,n,r,i){const a=this.gen.rectangle(t,e,n,r,i);return this.draw(a),a}ellipse(t,e,n,r,i){const a=this.gen.ellipse(t,e,n,r,i);return this.draw(a),a}circle(t,e,n,r){const i=this.gen.circle(t,e,n,r);return this.draw(i),i}linearPath(t,e){const n=this.gen.linearPath(t,e);return this.draw(n),n}polygon(t,e){const n=this.gen.polygon(t,e);return this.draw(n),n}arc(t,e,n,r,i,a,s=!1,o){const l=this.gen.arc(t,e,n,r,i,a,s,o);return this.draw(l),l}curve(t,e){const n=this.gen.curve(t,e);return this.draw(n),n}path(t,e){const n=this.gen.path(t,e);return this.draw(n),n}},iE="http://www.w3.org/2000/svg",aE=class{static{s(this,"ot")}constructor(t,e){this.svg=t,this.gen=new nE(e)}draw(t){const e=t.sets||[],n=t.options||this.getDefaultOptions(),r=this.svg.ownerDocument||window.document,i=r.createElementNS(iE,"g"),a=t.options.fixedDecimalPlaceDigits;for(const s of e){let e=null;switch(s.type){case"path":e=r.createElementNS(iE,"path"),e.setAttribute("d",this.opsToPath(s,a)),e.setAttribute("stroke",n.stroke),e.setAttribute("stroke-width",n.strokeWidth+""),e.setAttribute("fill","none"),n.strokeLineDash&&e.setAttribute("stroke-dasharray",n.strokeLineDash.join(" ").trim()),n.strokeLineDashOffset&&e.setAttribute("stroke-dashoffset",`${n.strokeLineDashOffset}`);break;case"fillPath":e=r.createElementNS(iE,"path"),e.setAttribute("d",this.opsToPath(s,a)),e.setAttribute("stroke","none"),e.setAttribute("stroke-width","0"),e.setAttribute("fill",n.fill||""),"curve"!==t.shape&&"polygon"!==t.shape||e.setAttribute("fill-rule","evenodd");break;case"fillSketch":e=this.fillSketch(r,s,n)}e&&i.appendChild(e)}return i}fillSketch(t,e,n){let r=n.fillWeight;r<0&&(r=n.strokeWidth/2);const i=t.createElementNS(iE,"path");return i.setAttribute("d",this.opsToPath(e,n.fixedDecimalPlaceDigits)),i.setAttribute("stroke",n.fill||""),i.setAttribute("stroke-width",r+""),i.setAttribute("fill","none"),n.fillLineDash&&i.setAttribute("stroke-dasharray",n.fillLineDash.join(" ").trim()),n.fillLineDashOffset&&i.setAttribute("stroke-dashoffset",`${n.fillLineDashOffset}`),i}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}opsToPath(t,e){return this.gen.opsToPath(t,e)}line(t,e,n,r,i){const a=this.gen.line(t,e,n,r,i);return this.draw(a)}rectangle(t,e,n,r,i){const a=this.gen.rectangle(t,e,n,r,i);return this.draw(a)}ellipse(t,e,n,r,i){const a=this.gen.ellipse(t,e,n,r,i);return this.draw(a)}circle(t,e,n,r){const i=this.gen.circle(t,e,n,r);return this.draw(i)}linearPath(t,e){const n=this.gen.linearPath(t,e);return this.draw(n)}polygon(t,e){const n=this.gen.polygon(t,e);return this.draw(n)}arc(t,e,n,r,i,a,s=!1,o){const l=this.gen.arc(t,e,n,r,i,a,s,o);return this.draw(l)}curve(t,e){const n=this.gen.curve(t,e);return this.draw(n)}path(t,e){const n=this.gen.path(t,e);return this.draw(n)}},sE={canvas:s(((t,e)=>new rE(t,e)),"canvas"),svg:s(((t,e)=>new aE(t,e)),"svg"),generator:s((t=>new nE(t)),"generator"),newSeed:s((()=>nE.newSeed()),"newSeed")},oE=s(((t,e)=>{var n,r,i=t.x,a=t.y,s=e.x-i,o=e.y-a,l=t.width/2,c=t.height/2;return Math.abs(o)*l>Math.abs(s)*c?(o<0&&(c=-c),n=0===o?0:c*s/o,r=c):(s<0&&(l=-l),n=l,r=0===s?0:l*o/s),{x:i+n,y:a+r}}),"intersectRect"),lE=oE;function cE(t,e){e&&t.attr("style",e)}async function hE(t){const e=Oa(document.createElementNS("http://www.w3.org/2000/svg","foreignObject")),n=e.append("xhtml:div");let r=t.label;t.label&&wn(t.label)&&(r=await Tn(t.label.replace(_n.lineBreakRegex,"\n"),Hn()));const i=t.isNode?"nodeLabel":"edgeLabel";return n.html('<span class="'+i+'" '+(t.labelStyle?'style="'+t.labelStyle+'"':"")+">"+r+"</span>"),cE(n,t.labelStyle),n.style("display","inline-block"),n.style("padding-right","1px"),n.style("white-space","nowrap"),n.attr("xmlns","http://www.w3.org/1999/xhtml"),e.node()}s(cE,"applyStyle"),s(hE,"addHtmlLabel");var uE=s((async(t,e,n,r)=>{let i=t||"";if("object"==typeof i&&(i=i[0]),dn(Hn().flowchart.htmlLabels)){i=i.replace(/\\n|\n/g,"<br />"),m.info("vertexText"+i);const t={isNode:r,label:xk(i).replace(/fa[blrs]?:fa-[\w-]+/g,(t=>`<i class='${t.replace(":"," ")}'></i>`)),labelStyle:e?e.replace("fill:","color:"):e};return await hE(t)}{const t=document.createElementNS("http://www.w3.org/2000/svg","text");t.setAttribute("style",e.replace("color:","fill:"));let r=[];r="string"==typeof i?i.split(/\\n|\n|<br\s*\/?>/gi):Array.isArray(i)?i:[];for(const e of r){const r=document.createElementNS("http://www.w3.org/2000/svg","tspan");r.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),r.setAttribute("dy","1em"),r.setAttribute("x","0"),n?r.setAttribute("class","title-row"):r.setAttribute("class","row"),r.textContent=e.trim(),t.appendChild(r)}return t}}),"createLabel"),dE=uE,pE=s(((t,e,n,r,i)=>["M",t+i,e,"H",t+n-i,"A",i,i,0,0,1,t+n,e+i,"V",e+r-i,"A",i,i,0,0,1,t+n-i,e+r,"H",t+i,"A",i,i,0,0,1,t,e+r-i,"V",e+i,"A",i,i,0,0,1,t+i,e,"Z"].join(" ")),"createRoundedRectPathD"),gE=s((t=>{const{handDrawnSeed:e}=Hn();return{fill:t,hachureAngle:120,hachureGap:4,fillWeight:2,roughness:.7,stroke:t,seed:e}}),"solidStateFill"),fE=s((t=>{const e=mE([...t.cssCompiledStyles||[],...t.cssStyles||[]]);return{stylesMap:e,stylesArray:[...e]}}),"compileStyles"),mE=s((t=>{const e=new Map;return t.forEach((t=>{const[n,r]=t.split(":");e.set(n.trim(),r?.trim())})),e}),"styles2Map"),yE=s((t=>{const{stylesArray:e}=fE(t),n=[],r=[],i=[],a=[];return e.forEach((t=>{const e=t[0];"color"===e||"font-size"===e||"font-family"===e||"font-weight"===e||"font-style"===e||"text-decoration"===e||"text-align"===e||"text-transform"===e||"line-height"===e||"letter-spacing"===e||"word-spacing"===e||"text-shadow"===e||"text-overflow"===e||"white-space"===e||"word-wrap"===e||"word-break"===e||"overflow-wrap"===e||"hyphens"===e?n.push(t.join(":")+" !important"):(r.push(t.join(":")+" !important"),e.includes("stroke")&&i.push(t.join(":")+" !important"),"fill"===e&&a.push(t.join(":")+" !important"))})),{labelStyles:n.join(";"),nodeStyles:r.join(";"),stylesArray:e,borderStyles:i,backgroundStyles:a}}),"styles2String"),vE=s(((t,e)=>{const{themeVariables:n,handDrawnSeed:r}=Hn(),{nodeBorder:i,mainBkg:a}=n,{stylesMap:s}=fE(t);return Object.assign({roughness:.7,fill:s.get("fill")||a,fillStyle:"hachure",fillWeight:4,hachureGap:5.2,stroke:s.get("stroke")||i,seed:r,strokeWidth:s.get("stroke-width")?.replace("px","")||1.3,fillLineDash:[0,0]},e)}),"userNodeOverrides"),xE=s((async(t,e)=>{m.info("Creating subgraph rect for ",e.id,e);const n=Hn(),{themeVariables:r,handDrawnSeed:i}=n,{clusterBkg:a,clusterBorder:s}=r,{labelStyles:o,nodeStyles:l,borderStyles:c,backgroundStyles:h}=yE(e),u=t.insert("g").attr("class","cluster "+e.cssClasses).attr("id",e.id).attr("data-look",e.look),d=dn(n.flowchart.htmlLabels),p=u.insert("g").attr("class","cluster-label "),g=await KT(p,e.label,{style:e.labelStyle,useHtmlLabels:d,isNode:!0});let f=g.getBBox();if(dn(n.flowchart.htmlLabels)){const t=g.children[0],e=Oa(g);f=t.getBoundingClientRect(),e.attr("width",f.width),e.attr("height",f.height)}const y=e.width<=f.width+e.padding?f.width+e.padding:e.width;e.width<=f.width+e.padding?e.diff=(y-e.width)/2-e.padding:e.diff=-e.padding;const v=e.height,x=e.x-y/2,b=e.y-v/2;let w;if(m.trace("Data ",e,JSON.stringify(e)),"handDrawn"===e.look){const t=sE.svg(u),n=vE(e,{roughness:.7,fill:a,stroke:s,fillWeight:3,seed:i}),r=t.path(pE(x,b,y,v,0),n);w=u.insert((()=>(m.debug("Rough node insert CXC",r),r)),":first-child"),w.select("path:nth-child(2)").attr("style",c.join(";")),w.select("path").attr("style",h.join(";").replace("fill","stroke"))}else w=u.insert("rect",":first-child"),w.attr("style",l).attr("rx",e.rx).attr("ry",e.ry).attr("x",x).attr("y",b).attr("width",y).attr("height",v);const{subGraphTitleTopMargin:k}=Gm(n);if(p.attr("transform",`translate(${e.x-f.width/2}, ${e.y-e.height/2+k})`),o){const t=p.select("span");t&&t.attr("style",o)}const T=w.node().getBBox();return e.offsetX=0,e.width=T.width,e.height=T.height,e.offsetY=f.height-e.padding/2,e.intersect=function(t){return lE(e,t)},{cluster:u,labelBBox:f}}),"rect"),bE=s(((t,e)=>{const n=t.insert("g").attr("class","note-cluster").attr("id",e.id),r=n.insert("rect",":first-child"),i=0*e.padding,a=i/2;r.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=r.node().getBBox();return e.width=s.width,e.height=s.height,e.intersect=function(t){return lE(e,t)},{cluster:n,labelBBox:{width:0,height:0}}}),"noteGroup"),wE=s((async(t,e)=>{const n=Hn(),{themeVariables:r,handDrawnSeed:i}=n,{altBackground:a,compositeBackground:s,compositeTitleBackground:o,nodeBorder:l}=r,c=t.insert("g").attr("class",e.cssClasses).attr("id",e.id).attr("data-id",e.id).attr("data-look",e.look),h=c.insert("g",":first-child"),u=c.insert("g").attr("class","cluster-label");let d=c.append("rect");const p=u.node().appendChild(await dE(e.label,e.labelStyle,void 0,!0));let g=p.getBBox();if(dn(n.flowchart.htmlLabels)){const t=p.children[0],e=Oa(p);g=t.getBoundingClientRect(),e.attr("width",g.width),e.attr("height",g.height)}const f=0*e.padding,m=f/2,y=(e.width<=g.width+e.padding?g.width+e.padding:e.width)+f;e.width<=g.width+e.padding?e.diff=(y-e.width)/2-e.padding:e.diff=-e.padding;const v=e.height+f,x=e.height+f-g.height-6,b=e.x-y/2,w=e.y-v/2;e.width=y;const k=e.y-e.height/2-m+g.height+2;let T;if("handDrawn"===e.look){const t=e.cssClasses.includes("statediagram-cluster-alt"),n=sE.svg(c),r=e.rx||e.ry?n.path(pE(b,w,y,v,10),{roughness:.7,fill:o,fillStyle:"solid",stroke:l,seed:i}):n.rectangle(b,w,y,v,{seed:i});T=c.insert((()=>r),":first-child");const h=n.rectangle(b,k,y,x,{fill:t?a:s,fillStyle:t?"hachure":"solid",stroke:l,seed:i});T=c.insert((()=>r),":first-child"),d=c.insert((()=>h))}else{T=h.insert("rect",":first-child");const t="outer";T.attr("class",t).attr("x",b).attr("y",w).attr("width",y).attr("height",v).attr("data-look",e.look),d.attr("class","inner").attr("x",b).attr("y",k).attr("width",y).attr("height",x)}u.attr("transform",`translate(${e.x-g.width/2}, ${w+1-(dn(n.flowchart.htmlLabels)?0:3)})`);const _=T.node().getBBox();return e.height=_.height,e.offsetX=0,e.offsetY=g.height-e.padding/2,e.labelBBox=g,e.intersect=function(t){return lE(e,t)},{cluster:c,labelBBox:g}}),"roundedWithTitle"),kE=s((async(t,e)=>{m.info("Creating subgraph rect for ",e.id,e);const n=Hn(),{themeVariables:r,handDrawnSeed:i}=n,{clusterBkg:a,clusterBorder:s}=r,{labelStyles:o,nodeStyles:l,borderStyles:c,backgroundStyles:h}=yE(e),u=t.insert("g").attr("class","cluster "+e.cssClasses).attr("id",e.id).attr("data-look",e.look),d=dn(n.flowchart.htmlLabels),p=u.insert("g").attr("class","cluster-label "),g=await KT(p,e.label,{style:e.labelStyle,useHtmlLabels:d,isNode:!0,width:e.width});let f=g.getBBox();if(dn(n.flowchart.htmlLabels)){const t=g.children[0],e=Oa(g);f=t.getBoundingClientRect(),e.attr("width",f.width),e.attr("height",f.height)}const y=e.width<=f.width+e.padding?f.width+e.padding:e.width;e.width<=f.width+e.padding?e.diff=(y-e.width)/2-e.padding:e.diff=-e.padding;const v=e.height,x=e.x-y/2,b=e.y-v/2;let w;if(m.trace("Data ",e,JSON.stringify(e)),"handDrawn"===e.look){const t=sE.svg(u),n=vE(e,{roughness:.7,fill:a,stroke:s,fillWeight:4,seed:i}),r=t.path(pE(x,b,y,v,e.rx),n);w=u.insert((()=>(m.debug("Rough node insert CXC",r),r)),":first-child"),w.select("path:nth-child(2)").attr("style",c.join(";")),w.select("path").attr("style",h.join(";").replace("fill","stroke"))}else w=u.insert("rect",":first-child"),w.attr("style",l).attr("rx",e.rx).attr("ry",e.ry).attr("x",x).attr("y",b).attr("width",y).attr("height",v);const{subGraphTitleTopMargin:k}=Gm(n);if(p.attr("transform",`translate(${e.x-f.width/2}, ${e.y-e.height/2+k})`),o){const t=p.select("span");t&&t.attr("style",o)}const T=w.node().getBBox();return e.offsetX=0,e.width=T.width,e.height=T.height,e.offsetY=f.height-e.padding/2,e.intersect=function(t){return lE(e,t)},{cluster:u,labelBBox:f}}),"kanbanSection"),TE=s(((t,e)=>{const n=Hn(),{themeVariables:r,handDrawnSeed:i}=n,{nodeBorder:a}=r,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,c=e.width+l;e.diff=-e.padding;const h=e.height+l,u=e.x-c/2,d=e.y-h/2;let p;if(e.width=c,"handDrawn"===e.look){const t=sE.svg(s).rectangle(u,d,c,h,{fill:"lightgrey",roughness:.5,strokeLineDash:[5],stroke:a,seed:i});p=s.insert((()=>t),":first-child")}else{p=o.insert("rect",":first-child");const t="divider";p.attr("class",t).attr("x",u).attr("y",d).attr("width",c).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(t){return lE(e,t)},{cluster:s,labelBBox:{}}}),"divider"),_E={rect:xE,squareRect:xE,roundedWithTitle:wE,noteGroup:bE,divider:TE,kanbanSection:kE},EE=new Map,CE=s((async(t,e)=>{const n=e.shape||"rect",r=await _E[n](t,e);return EE.set(e.id,r),r}),"insertCluster"),SE=s((()=>{EE=new Map}),"clear");function AE(t,e){return t.intersect(e)}s(AE,"intersectNode");var LE=AE;function NE(t,e,n,r){var i=t.x,a=t.y,s=i-r.x,o=a-r.y,l=Math.sqrt(e*e*o*o+n*n*s*s),c=Math.abs(e*n*s/l);r.x<i&&(c=-c);var h=Math.abs(e*n*o/l);return r.y<a&&(h=-h),{x:i+c,y:a+h}}s(NE,"intersectEllipse");var IE=NE;function ME(t,e,n){return IE(t,e,e,n)}s(ME,"intersectCircle");var RE=ME;function DE(t,e,n,r){var i,a,s,o,l,c,h,u,d,p,g,f,m;if(i=e.y-t.y,s=t.x-e.x,l=e.x*t.y-t.x*e.y,d=i*n.x+s*n.y+l,p=i*r.x+s*r.y+l,!(0!==d&&0!==p&&OE(d,p)||(a=r.y-n.y,o=n.x-r.x,c=r.x*n.y-n.x*r.y,h=a*t.x+o*t.y+c,u=a*e.x+o*e.y+c,0!==h&&0!==u&&OE(h,u)||0==(g=i*o-a*s))))return f=Math.abs(g/2),{x:(m=s*c-o*l)<0?(m-f)/g:(m+f)/g,y:(m=a*l-i*c)<0?(m-f)/g:(m+f)/g}}function OE(t,e){return t*e>0}s(DE,"intersectLine"),s(OE,"sameSign");var PE=DE;function BE(t,e,n){let r=t.x,i=t.y,a=[],s=Number.POSITIVE_INFINITY,o=Number.POSITIVE_INFINITY;"function"==typeof e.forEach?e.forEach((function(t){s=Math.min(s,t.x),o=Math.min(o,t.y)})):(s=Math.min(s,e.x),o=Math.min(o,e.y));let l=r-t.width/2-s,c=i-t.height/2-o;for(let r=0;r<e.length;r++){let i=e[r],s=e[r<e.length-1?r+1:0],o=PE(t,n,{x:l+i.x,y:c+i.y},{x:l+s.x,y:c+s.y});o&&a.push(o)}return a.length?(a.length>1&&a.sort((function(t,e){let r=t.x-n.x,i=t.y-n.y,a=Math.sqrt(r*r+i*i),s=e.x-n.x,o=e.y-n.y,l=Math.sqrt(s*s+o*o);return a<l?-1:a===l?0:1})),a[0]):t}s(BE,"intersectPolygon");var $E={node:LE,circle:RE,ellipse:IE,polygon:BE,rect:lE};function FE(t,e){const{labelStyles:n}=yE(e);e.labelStyle=n;const r=t_(e);let i=r;r||(i="anchor");const a=t.insert("g").attr("class",i).attr("id",e.domId||e.id),{cssStyles:s}=e,o=sE.svg(a),l=vE(e,{fill:"black",stroke:"none",fillStyle:"solid"});"handDrawn"!==e.look&&(l.roughness=0);const c=o.circle(0,0,2,l),h=a.insert((()=>c),":first-child");return h.attr("class","anchor").attr("style",wk(s)),JT(e,h),e.intersect=function(t){return m.info("Circle intersect",e,1,t),$E.circle(e,1,t)},a}function zE(t,e,n,r,i,a,s){const o=(t+n)/2,l=(e+r)/2,c=Math.atan2(r-e,n-t),h=(n-t)/2/i,u=(r-e)/2/a,d=Math.sqrt(h**2+u**2);if(d>1)throw new Error("The given radii are too small to create an arc between the points.");const p=Math.sqrt(1-d**2),g=o+p*a*Math.sin(c)*(s?-1:1),f=l-p*i*Math.cos(c)*(s?-1:1),m=Math.atan2((e-f)/a,(t-g)/i);let y=Math.atan2((r-f)/a,(n-g)/i)-m;s&&y<0&&(y+=2*Math.PI),!s&&y>0&&(y-=2*Math.PI);const v=[];for(let t=0;t<20;t++){const e=m+t/19*y,n=g+i*Math.cos(e),r=f+a*Math.sin(e);v.push({x:n,y:r})}return v}async function UE(t,e){const{labelStyles:n,nodeStyles:r}=yE(e);e.labelStyle=n;const{shapeSvg:i,bbox:a}=await ZT(t,e,t_(e)),s=a.width+e.padding+20,o=a.height+e.padding,l=o/2,c=l/(2.5+o/50),{cssStyles:h}=e,u=[{x:s/2,y:-o/2},{x:-s/2,y:-o/2},...zE(-s/2,-o/2,-s/2,o/2,c,l,!1),{x:s/2,y:o/2},...zE(s/2,o/2,s/2,-o/2,c,l,!0)],d=sE.svg(i),p=vE(e,{});"handDrawn"!==e.look&&(p.roughness=0,p.fillStyle="solid");const g=e_(u),f=d.path(g,p),m=i.insert((()=>f),":first-child");return m.attr("class","basic label-container"),h&&"handDrawn"!==e.look&&m.selectAll("path").attr("style",h),r&&"handDrawn"!==e.look&&m.selectAll("path").attr("style",r),m.attr("transform",`translate(${c/2}, 0)`),JT(e,m),e.intersect=function(t){return $E.polygon(e,u,t)},i}function GE(t,e,n,r){return t.insert("polygon",":first-child").attr("points",r.map((function(t){return t.x+","+t.y})).join(" ")).attr("class","label-container").attr("transform","translate("+-e/2+","+n/2+")")}async function qE(t,e){const{labelStyles:n,nodeStyles:r}=yE(e);e.labelStyle=n;const{shapeSvg:i,bbox:a}=await ZT(t,e,t_(e)),s=a.height+e.padding,o=a.width+e.padding+12,l=-s,c=[{x:12,y:l},{x:o,y:l},{x:o,y:0},{x:0,y:0},{x:0,y:l+12},{x:12,y:l}];let h;const{cssStyles:u}=e;if("handDrawn"===e.look){const t=sE.svg(i),n=vE(e,{}),r=e_(c),a=t.path(r,n);h=i.insert((()=>a),":first-child").attr("transform",`translate(${-o/2}, ${s/2})`),u&&h.attr("style",u)}else h=GE(i,o,s,c);return r&&h.attr("style",r),JT(e,h),e.intersect=function(t){return $E.polygon(e,c,t)},i}function jE(t,e){const{nodeStyles:n}=yE(e);e.label="";const r=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=sE.svg(r),l=vE(e,{});"handDrawn"!==e.look&&(l.roughness=0,l.fillStyle="solid");const c=e_(s),h=o.path(c,l),u=r.insert((()=>h),":first-child");return i&&"handDrawn"!==e.look&&u.selectAll("path").attr("style",i),n&&"handDrawn"!==e.look&&u.selectAll("path").attr("style",n),e.width=28,e.height=28,e.intersect=function(t){return $E.polygon(e,s,t)},r}async function YE(t,e){const{labelStyles:n,nodeStyles:r}=yE(e);e.labelStyle=n;const{shapeSvg:i,bbox:a,halfPadding:s}=await ZT(t,e,t_(e)),o=a.width/2+s;let l;const{cssStyles:c}=e;if("handDrawn"===e.look){const t=sE.svg(i),n=vE(e,{}),r=t.circle(0,0,2*o,n);l=i.insert((()=>r),":first-child"),l.attr("class","basic label-container").attr("style",wk(c))}else l=i.insert("circle",":first-child").attr("class","basic label-container").attr("style",r).attr("r",o).attr("cx",0).attr("cy",0);return JT(e,l),e.intersect=function(t){return m.info("Circle intersect",e,o,t),$E.circle(e,o,t)},i}function WE(t){const e=Math.cos(Math.PI/4),n=Math.sin(Math.PI/4),r=2*t;return`M ${-r/2*e},${r/2*n} L ${r/2*e},${-r/2*n}\n M ${r/2*e},${r/2*n} L ${-r/2*e},${-r/2*n}`}function HE(t,e){const{labelStyles:n,nodeStyles:r}=yE(e);e.labelStyle=n,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=sE.svg(i),l=vE(e,{});"handDrawn"!==e.look&&(l.roughness=0,l.fillStyle="solid");const c=o.circle(0,0,2*a,l),h=WE(a),u=o.path(h,l),d=i.insert((()=>c),":first-child");return d.insert((()=>u)),s&&"handDrawn"!==e.look&&d.selectAll("path").attr("style",s),r&&"handDrawn"!==e.look&&d.selectAll("path").attr("style",r),JT(e,d),e.intersect=function(t){m.info("crossedCircle intersect",e,{radius:a,point:t});return $E.circle(e,a,t)},i}function VE(t,e,n,r=100,i=0,a=180){const s=[],o=i*Math.PI/180,l=(a*Math.PI/180-o)/(r-1);for(let i=0;i<r;i++){const r=o+i*l,a=t+n*Math.cos(r),c=e+n*Math.sin(r);s.push({x:-a,y:-c})}return s}async function XE(t,e){const{labelStyles:n,nodeStyles:r}=yE(e);e.labelStyle=n;const{shapeSvg:i,bbox:a,label:s}=await ZT(t,e,t_(e)),o=a.width+(e.padding??0),l=a.height+(e.padding??0),c=Math.max(5,.1*l),{cssStyles:h}=e,u=[...VE(o/2,-l/2,c,30,-90,0),{x:-o/2-c,y:c},...VE(o/2+2*c,-c,c,20,-180,-270),...VE(o/2+2*c,c,c,20,-90,-180),{x:-o/2-c,y:-l/2},...VE(o/2,l/2,c,20,0,90)],d=[{x:o/2,y:-l/2-c},{x:-o/2,y:-l/2-c},...VE(o/2,-l/2,c,20,-90,0),{x:-o/2-c,y:-c},...VE(o/2+.1*o,-c,c,20,-180,-270),...VE(o/2+.1*o,c,c,20,-90,-180),{x:-o/2-c,y:l/2},...VE(o/2,l/2,c,20,0,90),{x:-o/2,y:l/2+c},{x:o/2,y:l/2+c}],p=sE.svg(i),g=vE(e,{fill:"none"});"handDrawn"!==e.look&&(g.roughness=0,g.fillStyle="solid");const f=e_(u).replace("Z",""),m=p.path(f,g),y=e_(d),v=p.path(y,{...g}),x=i.insert("g",":first-child");return x.insert((()=>v),":first-child").attr("stroke-opacity",0),x.insert((()=>m),":first-child"),x.attr("class","text"),h&&"handDrawn"!==e.look&&x.selectAll("path").attr("style",h),r&&"handDrawn"!==e.look&&x.selectAll("path").attr("style",r),x.attr("transform",`translate(${c}, 0)`),s.attr("transform",`translate(${-o/2+c-(a.x-(a.left??0))},${-l/2+(e.padding??0)/2-(a.y-(a.top??0))})`),JT(e,x),e.intersect=function(t){return $E.polygon(e,d,t)},i}function KE(t,e,n,r=100,i=0,a=180){const s=[],o=i*Math.PI/180,l=(a*Math.PI/180-o)/(r-1);for(let i=0;i<r;i++){const r=o+i*l,a=t+n*Math.cos(r),c=e+n*Math.sin(r);s.push({x:a,y:c})}return s}async function ZE(t,e){const{labelStyles:n,nodeStyles:r}=yE(e);e.labelStyle=n;const{shapeSvg:i,bbox:a,label:s}=await ZT(t,e,t_(e)),o=a.width+(e.padding??0),l=a.height+(e.padding??0),c=Math.max(5,.1*l),{cssStyles:h}=e,u=[...KE(o/2,-l/2,c,20,-90,0),{x:o/2+c,y:-c},...KE(o/2+2*c,-c,c,20,-180,-270),...KE(o/2+2*c,c,c,20,-90,-180),{x:o/2+c,y:l/2},...KE(o/2,l/2,c,20,0,90)],d=[{x:-o/2,y:-l/2-c},{x:o/2,y:-l/2-c},...KE(o/2,-l/2,c,20,-90,0),{x:o/2+c,y:-c},...KE(o/2+2*c,-c,c,20,-180,-270),...KE(o/2+2*c,c,c,20,-90,-180),{x:o/2+c,y:l/2},...KE(o/2,l/2,c,20,0,90),{x:o/2,y:l/2+c},{x:-o/2,y:l/2+c}],p=sE.svg(i),g=vE(e,{fill:"none"});"handDrawn"!==e.look&&(g.roughness=0,g.fillStyle="solid");const f=e_(u).replace("Z",""),m=p.path(f,g),y=e_(d),v=p.path(y,{...g}),x=i.insert("g",":first-child");return x.insert((()=>v),":first-child").attr("stroke-opacity",0),x.insert((()=>m),":first-child"),x.attr("class","text"),h&&"handDrawn"!==e.look&&x.selectAll("path").attr("style",h),r&&"handDrawn"!==e.look&&x.selectAll("path").attr("style",r),x.attr("transform",`translate(${-c}, 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))})`),JT(e,x),e.intersect=function(t){return $E.polygon(e,d,t)},i}function QE(t,e,n,r=100,i=0,a=180){const s=[],o=i*Math.PI/180,l=(a*Math.PI/180-o)/(r-1);for(let i=0;i<r;i++){const r=o+i*l,a=t+n*Math.cos(r),c=e+n*Math.sin(r);s.push({x:-a,y:-c})}return s}async function JE(t,e){const{labelStyles:n,nodeStyles:r}=yE(e);e.labelStyle=n;const{shapeSvg:i,bbox:a,label:s}=await ZT(t,e,t_(e)),o=a.width+(e.padding??0),l=a.height+(e.padding??0),c=Math.max(5,.1*l),{cssStyles:h}=e,u=[...QE(o/2,-l/2,c,30,-90,0),{x:-o/2-c,y:c},...QE(o/2+2*c,-c,c,20,-180,-270),...QE(o/2+2*c,c,c,20,-90,-180),{x:-o/2-c,y:-l/2},...QE(o/2,l/2,c,20,0,90)],d=[...QE(-o/2+c+c/2,-l/2,c,20,-90,-180),{x:o/2-c/2,y:c},...QE(-o/2-c/2,-c,c,20,0,90),...QE(-o/2-c/2,c,c,20,-90,0),{x:o/2-c/2,y:-c},...QE(-o/2+c+c/2,l/2,c,30,-180,-270)],p=[{x:o/2,y:-l/2-c},{x:-o/2,y:-l/2-c},...QE(o/2,-l/2,c,20,-90,0),{x:-o/2-c,y:-c},...QE(o/2+2*c,-c,c,20,-180,-270),...QE(o/2+2*c,c,c,20,-90,-180),{x:-o/2-c,y:l/2},...QE(o/2,l/2,c,20,0,90),{x:-o/2,y:l/2+c},{x:o/2-c-c/2,y:l/2+c},...QE(-o/2+c+c/2,-l/2,c,20,-90,-180),{x:o/2-c/2,y:c},...QE(-o/2-c/2,-c,c,20,0,90),...QE(-o/2-c/2,c,c,20,-90,0),{x:o/2-c/2,y:-c},...QE(-o/2+c+c/2,l/2,c,30,-180,-270)],g=sE.svg(i),f=vE(e,{fill:"none"});"handDrawn"!==e.look&&(f.roughness=0,f.fillStyle="solid");const m=e_(u).replace("Z",""),y=g.path(m,f),v=e_(d).replace("Z",""),x=g.path(v,f),b=e_(p),w=g.path(b,{...f}),k=i.insert("g",":first-child");return k.insert((()=>w),":first-child").attr("stroke-opacity",0),k.insert((()=>y),":first-child"),k.insert((()=>x),":first-child"),k.attr("class","text"),h&&"handDrawn"!==e.look&&k.selectAll("path").attr("style",h),r&&"handDrawn"!==e.look&&k.selectAll("path").attr("style",r),k.attr("transform",`translate(${c-c/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))})`),JT(e,k),e.intersect=function(t){return $E.polygon(e,p,t)},i}async function tC(t,e){const{labelStyles:n,nodeStyles:r}=yE(e);e.labelStyle=n;const{shapeSvg:i,bbox:a}=await ZT(t,e,t_(e)),s=Math.max(80,1.25*(a.width+2*(e.padding??0)),e?.width??0),o=Math.max(20,a.height+2*(e.padding??0),e?.height??0),l=o/2,{cssStyles:c}=e,h=sE.svg(i),u=vE(e,{});"handDrawn"!==e.look&&(u.roughness=0,u.fillStyle="solid");const d=s-l,p=o/4,g=[{x:d,y:0},{x:p,y:0},{x:0,y:o/2},{x:p,y:o},{x:d,y:o},...r_(-d,-o/2,l,50,270,90)],f=e_(g),m=h.path(f,u),y=i.insert((()=>m),":first-child");return y.attr("class","basic label-container"),c&&"handDrawn"!==e.look&&y.selectChildren("path").attr("style",c),r&&"handDrawn"!==e.look&&y.selectChildren("path").attr("style",r),y.attr("transform",`translate(${-s/2}, ${-o/2})`),JT(e,y),e.intersect=function(t){return $E.polygon(e,g,t)},i}s(FE,"anchor"),s(zE,"generateArcPoints"),s(UE,"bowTieRect"),s(GE,"insertPolygonShape"),s(qE,"card"),s(jE,"choice"),s(YE,"circle"),s(WE,"createLine"),s(HE,"crossedCircle"),s(VE,"generateCirclePoints"),s(XE,"curlyBraceLeft"),s(KE,"generateCirclePoints"),s(ZE,"curlyBraceRight"),s(QE,"generateCirclePoints"),s(JE,"curlyBraces"),s(tC,"curvedTrapezoid");var eC=s(((t,e,n,r,i,a)=>[`M${t},${e+a}`,`a${i},${a} 0,0,0 ${n},0`,`a${i},${a} 0,0,0 ${-n},0`,`l0,${r}`,`a${i},${a} 0,0,0 ${n},0`,"l0,"+-r].join(" ")),"createCylinderPathD"),nC=s(((t,e,n,r,i,a)=>[`M${t},${e+a}`,`M${t+n},${e+a}`,`a${i},${a} 0,0,0 ${-n},0`,`l0,${r}`,`a${i},${a} 0,0,0 ${n},0`,"l0,"+-r].join(" ")),"createOuterCylinderPathD"),rC=s(((t,e,n,r,i,a)=>[`M${t-n/2},${-r/2}`,`a${i},${a} 0,0,0 ${n},0`].join(" ")),"createInnerCylinderPathD");async function iC(t,e){const{labelStyles:n,nodeStyles:r}=yE(e);e.labelStyle=n;const{shapeSvg:i,bbox:a,label:s}=await ZT(t,e,t_(e)),o=Math.max(a.width+e.padding,e.width??0),l=o/2,c=l/(2.5+o/50),h=Math.max(a.height+c+e.padding,e.height??0);let u;const{cssStyles:d}=e;if("handDrawn"===e.look){const t=sE.svg(i),n=nC(0,0,o,h,l,c),r=rC(0,c,o,h,l,c),a=t.path(n,vE(e,{})),s=t.path(r,vE(e,{fill:"none"}));u=i.insert((()=>s),":first-child"),u=i.insert((()=>a),":first-child"),u.attr("class","basic label-container"),d&&u.attr("style",d)}else{const t=eC(0,0,o,h,l,c);u=i.insert("path",":first-child").attr("d",t).attr("class","basic label-container").attr("style",wk(d)).attr("style",r)}return u.attr("label-offset-y",c),u.attr("transform",`translate(${-o/2}, ${-(h/2+c)})`),JT(e,u),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(t){const n=$E.rect(e,t),r=n.x-(e.x??0);if(0!=l&&(Math.abs(r)<(e.width??0)/2||Math.abs(r)==(e.width??0)/2&&Math.abs(n.y-(e.y??0))>(e.height??0)/2-c)){let i=c*c*(1-r*r/(l*l));i>0&&(i=Math.sqrt(i)),i=c-i,t.y-(e.y??0)>0&&(i=-i),n.y+=i}return n},i}async function aC(t,e){const{labelStyles:n,nodeStyles:r}=yE(e);e.labelStyle=n;const{shapeSvg:i,bbox:a,label:s}=await ZT(t,e,t_(e)),o=a.width+e.padding,l=a.height+e.padding,c=.2*l,h=-o/2,u=-l/2-c/2,{cssStyles:d}=e,p=sE.svg(i),g=vE(e,{});"handDrawn"!==e.look&&(g.roughness=0,g.fillStyle="solid");const f=[{x:h,y:u+c},{x:-h,y:u+c},{x:-h,y:-u},{x:h,y:-u},{x:h,y:u},{x:-h,y:u},{x:-h,y:u+c}],m=p.polygon(f.map((t=>[t.x,t.y])),g),y=i.insert((()=>m),":first-child");return y.attr("class","basic label-container"),d&&"handDrawn"!==e.look&&y.selectAll("path").attr("style",d),r&&"handDrawn"!==e.look&&y.selectAll("path").attr("style",r),s.attr("transform",`translate(${h+(e.padding??0)/2-(a.x-(a.left??0))}, ${u+c+(e.padding??0)/2-(a.y-(a.top??0))})`),JT(e,y),e.intersect=function(t){return $E.rect(e,t)},i}async function sC(t,e){const{labelStyles:n,nodeStyles:r}=yE(e);e.labelStyle=n;const{shapeSvg:i,bbox:a,halfPadding:s}=await ZT(t,e,t_(e)),o=a.width/2+s+5,l=a.width/2+s;let c;const{cssStyles:h}=e;if("handDrawn"===e.look){const t=sE.svg(i),n=vE(e,{roughness:.2,strokeWidth:2.5}),r=vE(e,{roughness:.2,strokeWidth:1.5}),a=t.circle(0,0,2*o,n),s=t.circle(0,0,2*l,r);c=i.insert("g",":first-child"),c.attr("class",wk(e.cssClasses)).attr("style",wk(h)),c.node()?.appendChild(a),c.node()?.appendChild(s)}else{c=i.insert("g",":first-child");const t=c.insert("circle",":first-child"),e=c.insert("circle");c.attr("class","basic label-container").attr("style",r),t.attr("class","outer-circle").attr("style",r).attr("r",o).attr("cx",0).attr("cy",0),e.attr("class","inner-circle").attr("style",r).attr("r",l).attr("cx",0).attr("cy",0)}return JT(e,c),e.intersect=function(t){return m.info("DoubleCircle intersect",e,o,t),$E.circle(e,o,t)},i}function oC(t,e,{config:{themeVariables:n}}){const{labelStyles:r,nodeStyles:i}=yE(e);e.label="",e.labelStyle=r;const a=t.insert("g").attr("class",t_(e)).attr("id",e.domId??e.id),{cssStyles:s}=e,o=sE.svg(a),{nodeBorder:l}=n,c=vE(e,{fillStyle:"solid"});"handDrawn"!==e.look&&(c.roughness=0);const h=o.circle(0,0,14,c),u=a.insert((()=>h),":first-child");return u.selectAll("path").attr("style",`fill: ${l} !important;`),s&&s.length>0&&"handDrawn"!==e.look&&u.selectAll("path").attr("style",s),i&&"handDrawn"!==e.look&&u.selectAll("path").attr("style",i),JT(e,u),e.intersect=function(t){m.info("filledCircle intersect",e,{radius:7,point:t});return $E.circle(e,7,t)},a}async function lC(t,e){const{labelStyles:n,nodeStyles:r}=yE(e);e.labelStyle=n;const{shapeSvg:i,bbox:a,label:s}=await ZT(t,e,t_(e)),o=a.width+(e.padding??0),l=o+a.height,c=o+a.height,h=[{x:0,y:-l},{x:c,y:-l},{x:c/2,y:0}],{cssStyles:u}=e,d=sE.svg(i),p=vE(e,{});"handDrawn"!==e.look&&(p.roughness=0,p.fillStyle="solid");const g=e_(h),f=d.path(g,p),y=i.insert((()=>f),":first-child").attr("transform",`translate(${-l/2}, ${l/2})`);return u&&"handDrawn"!==e.look&&y.selectChildren("path").attr("style",u),r&&"handDrawn"!==e.look&&y.selectChildren("path").attr("style",r),e.width=o,e.height=l,JT(e,y),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(t){return m.info("Triangle intersect",e,h,t),$E.polygon(e,h,t)},i}function cC(t,e,{dir:n,config:{state:r,themeVariables:i}}){const{nodeStyles:a}=yE(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),c=Math.max(10,e?.height??0);"LR"===n&&(l=Math.max(10,e?.width??0),c=Math.max(70,e?.height??0));const h=-1*l/2,u=-1*c/2,d=sE.svg(s),p=vE(e,{stroke:i.lineColor,fill:i.lineColor});"handDrawn"!==e.look&&(p.roughness=0,p.fillStyle="solid");const g=d.rectangle(h,u,l,c,p),f=s.insert((()=>g),":first-child");o&&"handDrawn"!==e.look&&f.selectAll("path").attr("style",o),a&&"handDrawn"!==e.look&&f.selectAll("path").attr("style",a),JT(e,f);const m=r?.padding??0;return e.width&&e.height&&(e.width+=m/2||0,e.height+=m/2||0),e.intersect=function(t){return $E.rect(e,t)},s}async function hC(t,e){const{labelStyles:n,nodeStyles:r}=yE(e);e.labelStyle=n;const{shapeSvg:i,bbox:a}=await ZT(t,e,t_(e)),s=Math.max(80,a.width+2*(e.padding??0),e?.width??0),o=Math.max(50,a.height+2*(e.padding??0),e?.height??0),l=o/2,{cssStyles:c}=e,h=sE.svg(i),u=vE(e,{});"handDrawn"!==e.look&&(u.roughness=0,u.fillStyle="solid");const d=[{x:-s/2,y:-o/2},{x:s/2-l,y:-o/2},...r_(-s/2+l,0,l,50,90,270),{x:s/2-l,y:o/2},{x:-s/2,y:o/2}],p=e_(d),g=h.path(p,u),f=i.insert((()=>g),":first-child");return f.attr("class","basic label-container"),c&&"handDrawn"!==e.look&&f.selectChildren("path").attr("style",c),r&&"handDrawn"!==e.look&&f.selectChildren("path").attr("style",r),JT(e,f),e.intersect=function(t){m.info("Pill intersect",e,{radius:l,point:t});return $E.polygon(e,d,t)},i}s(iC,"cylinder"),s(aC,"dividedRectangle"),s(sC,"doublecircle"),s(oC,"filledCircle"),s(lC,"flippedTriangle"),s(cC,"forkJoin"),s(hC,"halfRoundedRectangle");var uC=s(((t,e,n,r,i)=>[`M${t+i},${e}`,`L${t+n-i},${e}`,`L${t+n},${e-r/2}`,`L${t+n-i},${e-r}`,`L${t+i},${e-r}`,`L${t},${e-r/2}`,"Z"].join(" ")),"createHexagonPathD");async function dC(t,e){const{labelStyles:n,nodeStyles:r}=yE(e);e.labelStyle=n;const{shapeSvg:i,bbox:a}=await ZT(t,e,t_(e)),s=a.height+e.padding,o=s/4,l=a.width+2*o+e.padding,c=[{x:o,y:0},{x:l-o,y:0},{x:l,y:-s/2},{x:l-o,y:-s},{x:o,y:-s},{x:0,y:-s/2}];let h;const{cssStyles:u}=e;if("handDrawn"===e.look){const t=sE.svg(i),n=vE(e,{}),r=uC(0,0,l,s,o),a=t.path(r,n);h=i.insert((()=>a),":first-child").attr("transform",`translate(${-l/2}, ${s/2})`),u&&h.attr("style",u)}else h=GE(i,l,s,c);return r&&h.attr("style",r),e.width=l,e.height=s,JT(e,h),e.intersect=function(t){return $E.polygon(e,c,t)},i}async function pC(t,e){const{labelStyles:n,nodeStyles:r}=yE(e);e.label="",e.labelStyle=n;const{shapeSvg:i}=await ZT(t,e,t_(e)),a=Math.max(30,e?.width??0),s=Math.max(30,e?.height??0),{cssStyles:o}=e,l=sE.svg(i),c=vE(e,{});"handDrawn"!==e.look&&(c.roughness=0,c.fillStyle="solid");const h=[{x:0,y:0},{x:a,y:0},{x:0,y:s},{x:a,y:s}],u=e_(h),d=l.path(u,c),p=i.insert((()=>d),":first-child");return p.attr("class","basic label-container"),o&&"handDrawn"!==e.look&&p.selectChildren("path").attr("style",o),r&&"handDrawn"!==e.look&&p.selectChildren("path").attr("style",r),p.attr("transform",`translate(${-a/2}, ${-s/2})`),JT(e,p),e.intersect=function(t){m.info("Pill intersect",e,{points:h});return $E.polygon(e,h,t)},i}async function gC(t,e,{config:{themeVariables:n,flowchart:r}}){const{labelStyles:i}=yE(e);e.labelStyle=i;const a=e.assetHeight??48,s=e.assetWidth??48,o=Math.max(a,s),l=r?.wrappingWidth;e.width=Math.max(o,l??0);const{shapeSvg:c,bbox:h,label:u}=await ZT(t,e,"icon-shape default"),d="t"===e.pos,p=o,g=o,{nodeBorder:f}=n,{stylesMap:y}=fE(e),v=-g/2,x=-p/2,b=e.label?8:0,w=sE.svg(c),k=vE(e,{stroke:"none",fill:"none"});"handDrawn"!==e.look&&(k.roughness=0,k.fillStyle="solid");const T=w.rectangle(v,x,g,p,k),_=Math.max(g,h.width),E=p+h.height+b,C=w.rectangle(-_/2,-E/2,_,E,{...k,fill:"transparent",stroke:"none"}),S=c.insert((()=>T),":first-child"),A=c.insert((()=>C));if(e.icon){const t=c.append("g");t.html(`<g>${await _y(e.icon,{height:o,width:o,fallbackPrefix:""})}</g>`);const n=t.node().getBBox(),r=n.width,i=n.height,a=n.x,s=n.y;t.attr("transform",`translate(${-r/2-a},${d?h.height/2+b/2-i/2-s:-h.height/2-b/2-i/2-s})`),t.attr("style",`color: ${y.get("stroke")??f};`)}return u.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${d?-E/2:E/2-h.height})`),S.attr("transform",`translate(0,${d?h.height/2+b/2:-h.height/2-b/2})`),JT(e,A),e.intersect=function(t){if(m.info("iconSquare intersect",e,t),!e.label)return $E.rect(e,t);const n=e.x??0,r=e.y??0,i=e.height??0;let a=[];a=d?[{x:n-h.width/2,y:r-i/2},{x:n+h.width/2,y:r-i/2},{x:n+h.width/2,y:r-i/2+h.height+b},{x:n+g/2,y:r-i/2+h.height+b},{x:n+g/2,y:r+i/2},{x:n-g/2,y:r+i/2},{x:n-g/2,y:r-i/2+h.height+b},{x:n-h.width/2,y:r-i/2+h.height+b}]:[{x:n-g/2,y:r-i/2},{x:n+g/2,y:r-i/2},{x:n+g/2,y:r-i/2+p},{x:n+h.width/2,y:r-i/2+p},{x:n+h.width/2/2,y:r+i/2},{x:n-h.width/2,y:r+i/2},{x:n-h.width/2,y:r-i/2+p},{x:n-g/2,y:r-i/2+p}];return $E.polygon(e,a,t)},c}async function fC(t,e,{config:{themeVariables:n,flowchart:r}}){const{labelStyles:i}=yE(e);e.labelStyle=i;const a=e.assetHeight??48,s=e.assetWidth??48,o=Math.max(a,s),l=r?.wrappingWidth;e.width=Math.max(o,l??0);const{shapeSvg:c,bbox:h,label:u}=await ZT(t,e,"icon-shape default"),d=e.label?8:0,p="t"===e.pos,{nodeBorder:g,mainBkg:f}=n,{stylesMap:y}=fE(e),v=sE.svg(c),x=vE(e,{});"handDrawn"!==e.look&&(x.roughness=0,x.fillStyle="solid");const b=y.get("fill");x.stroke=b??f;const w=c.append("g");e.icon&&w.html(`<g>${await _y(e.icon,{height:o,width:o,fallbackPrefix:""})}</g>`);const k=w.node().getBBox(),T=k.width,_=k.height,E=k.x,C=k.y,S=Math.max(T,_)*Math.SQRT2+40,A=v.circle(0,0,S,x),L=Math.max(S,h.width),N=S+h.height+d,I=v.rectangle(-L/2,-N/2,L,N,{...x,fill:"transparent",stroke:"none"}),M=c.insert((()=>A),":first-child"),R=c.insert((()=>I));return w.attr("transform",`translate(${-T/2-E},${p?h.height/2+d/2-_/2-C:-h.height/2-d/2-_/2-C})`),w.attr("style",`color: ${y.get("stroke")??g};`),u.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${p?-N/2:N/2-h.height})`),M.attr("transform",`translate(0,${p?h.height/2+d/2:-h.height/2-d/2})`),JT(e,R),e.intersect=function(t){m.info("iconSquare intersect",e,t);return $E.rect(e,t)},c}async function mC(t,e,{config:{themeVariables:n,flowchart:r}}){const{labelStyles:i}=yE(e);e.labelStyle=i;const a=e.assetHeight??48,s=e.assetWidth??48,o=Math.max(a,s),l=r?.wrappingWidth;e.width=Math.max(o,l??0);const{shapeSvg:c,bbox:h,halfPadding:u,label:d}=await ZT(t,e,"icon-shape default"),p="t"===e.pos,g=o+2*u,f=o+2*u,{nodeBorder:y,mainBkg:v}=n,{stylesMap:x}=fE(e),b=-f/2,w=-g/2,k=e.label?8:0,T=sE.svg(c),_=vE(e,{});"handDrawn"!==e.look&&(_.roughness=0,_.fillStyle="solid");const E=x.get("fill");_.stroke=E??v;const C=T.path(pE(b,w,f,g,5),_),S=Math.max(f,h.width),A=g+h.height+k,L=T.rectangle(-S/2,-A/2,S,A,{..._,fill:"transparent",stroke:"none"}),N=c.insert((()=>C),":first-child").attr("class","icon-shape2"),I=c.insert((()=>L));if(e.icon){const t=c.append("g");t.html(`<g>${await _y(e.icon,{height:o,width:o,fallbackPrefix:""})}</g>`);const n=t.node().getBBox(),r=n.width,i=n.height,a=n.x,s=n.y;t.attr("transform",`translate(${-r/2-a},${p?h.height/2+k/2-i/2-s:-h.height/2-k/2-i/2-s})`),t.attr("style",`color: ${x.get("stroke")??y};`)}return d.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${p?-A/2:A/2-h.height})`),N.attr("transform",`translate(0,${p?h.height/2+k/2:-h.height/2-k/2})`),JT(e,I),e.intersect=function(t){if(m.info("iconSquare intersect",e,t),!e.label)return $E.rect(e,t);const n=e.x??0,r=e.y??0,i=e.height??0;let a=[];a=p?[{x:n-h.width/2,y:r-i/2},{x:n+h.width/2,y:r-i/2},{x:n+h.width/2,y:r-i/2+h.height+k},{x:n+f/2,y:r-i/2+h.height+k},{x:n+f/2,y:r+i/2},{x:n-f/2,y:r+i/2},{x:n-f/2,y:r-i/2+h.height+k},{x:n-h.width/2,y:r-i/2+h.height+k}]:[{x:n-f/2,y:r-i/2},{x:n+f/2,y:r-i/2},{x:n+f/2,y:r-i/2+g},{x:n+h.width/2,y:r-i/2+g},{x:n+h.width/2/2,y:r+i/2},{x:n-h.width/2,y:r+i/2},{x:n-h.width/2,y:r-i/2+g},{x:n-f/2,y:r-i/2+g}];return $E.polygon(e,a,t)},c}async function yC(t,e,{config:{themeVariables:n,flowchart:r}}){const{labelStyles:i}=yE(e);e.labelStyle=i;const a=e.assetHeight??48,s=e.assetWidth??48,o=Math.max(a,s),l=r?.wrappingWidth;e.width=Math.max(o,l??0);const{shapeSvg:c,bbox:h,halfPadding:u,label:d}=await ZT(t,e,"icon-shape default"),p="t"===e.pos,g=o+2*u,f=o+2*u,{nodeBorder:y,mainBkg:v}=n,{stylesMap:x}=fE(e),b=-f/2,w=-g/2,k=e.label?8:0,T=sE.svg(c),_=vE(e,{});"handDrawn"!==e.look&&(_.roughness=0,_.fillStyle="solid");const E=x.get("fill");_.stroke=E??v;const C=T.path(pE(b,w,f,g,.1),_),S=Math.max(f,h.width),A=g+h.height+k,L=T.rectangle(-S/2,-A/2,S,A,{..._,fill:"transparent",stroke:"none"}),N=c.insert((()=>C),":first-child"),I=c.insert((()=>L));if(e.icon){const t=c.append("g");t.html(`<g>${await _y(e.icon,{height:o,width:o,fallbackPrefix:""})}</g>`);const n=t.node().getBBox(),r=n.width,i=n.height,a=n.x,s=n.y;t.attr("transform",`translate(${-r/2-a},${p?h.height/2+k/2-i/2-s:-h.height/2-k/2-i/2-s})`),t.attr("style",`color: ${x.get("stroke")??y};`)}return d.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${p?-A/2:A/2-h.height})`),N.attr("transform",`translate(0,${p?h.height/2+k/2:-h.height/2-k/2})`),JT(e,I),e.intersect=function(t){if(m.info("iconSquare intersect",e,t),!e.label)return $E.rect(e,t);const n=e.x??0,r=e.y??0,i=e.height??0;let a=[];a=p?[{x:n-h.width/2,y:r-i/2},{x:n+h.width/2,y:r-i/2},{x:n+h.width/2,y:r-i/2+h.height+k},{x:n+f/2,y:r-i/2+h.height+k},{x:n+f/2,y:r+i/2},{x:n-f/2,y:r+i/2},{x:n-f/2,y:r-i/2+h.height+k},{x:n-h.width/2,y:r-i/2+h.height+k}]:[{x:n-f/2,y:r-i/2},{x:n+f/2,y:r-i/2},{x:n+f/2,y:r-i/2+g},{x:n+h.width/2,y:r-i/2+g},{x:n+h.width/2/2,y:r+i/2},{x:n-h.width/2,y:r+i/2},{x:n-h.width/2,y:r-i/2+g},{x:n-f/2,y:r-i/2+g}];return $E.polygon(e,a,t)},c}async function vC(t,e,{config:{flowchart:n}}){const r=new Image;r.src=e?.img??"",await r.decode();const i=Number(r.naturalWidth.toString().replace("px","")),a=Number(r.naturalHeight.toString().replace("px",""));e.imageAspectRatio=i/a;const{labelStyles:s}=yE(e);e.labelStyle=s;const o=n?.wrappingWidth;e.defaultWidth=n?.wrappingWidth;const l=Math.max(e.label?o??0:0,e?.assetWidth??i),c="on"===e.constraint&&e?.assetHeight?e.assetHeight*e.imageAspectRatio:l,h="on"===e.constraint?c/e.imageAspectRatio:e?.assetHeight??a;e.width=Math.max(c,o??0);const{shapeSvg:u,bbox:d,label:p}=await ZT(t,e,"image-shape default"),g="t"===e.pos,f=-c/2,y=-h/2,v=e.label?8:0,x=sE.svg(u),b=vE(e,{});"handDrawn"!==e.look&&(b.roughness=0,b.fillStyle="solid");const w=x.rectangle(f,y,c,h,b),k=Math.max(c,d.width),T=h+d.height+v,_=x.rectangle(-k/2,-T/2,k,T,{...b,fill:"none",stroke:"none"}),E=u.insert((()=>w),":first-child"),C=u.insert((()=>_));if(e.img){const t=u.append("image");t.attr("href",e.img),t.attr("width",c),t.attr("height",h),t.attr("preserveAspectRatio","none"),t.attr("transform",`translate(${-c/2},${g?T/2-h:-T/2})`)}return p.attr("transform",`translate(${-d.width/2-(d.x-(d.left??0))},${g?-h/2-d.height/2-v/2:h/2-d.height/2+v/2})`),E.attr("transform",`translate(0,${g?d.height/2+v/2:-d.height/2-v/2})`),JT(e,C),e.intersect=function(t){if(m.info("iconSquare intersect",e,t),!e.label)return $E.rect(e,t);const n=e.x??0,r=e.y??0,i=e.height??0;let a=[];a=g?[{x:n-d.width/2,y:r-i/2},{x:n+d.width/2,y:r-i/2},{x:n+d.width/2,y:r-i/2+d.height+v},{x:n+c/2,y:r-i/2+d.height+v},{x:n+c/2,y:r+i/2},{x:n-c/2,y:r+i/2},{x:n-c/2,y:r-i/2+d.height+v},{x:n-d.width/2,y:r-i/2+d.height+v}]:[{x:n-c/2,y:r-i/2},{x:n+c/2,y:r-i/2},{x:n+c/2,y:r-i/2+h},{x:n+d.width/2,y:r-i/2+h},{x:n+d.width/2/2,y:r+i/2},{x:n-d.width/2,y:r+i/2},{x:n-d.width/2,y:r-i/2+h},{x:n-c/2,y:r-i/2+h}];return $E.polygon(e,a,t)},u}async function xC(t,e){const{labelStyles:n,nodeStyles:r}=yE(e);e.labelStyle=n;const{shapeSvg:i,bbox:a}=await ZT(t,e,t_(e)),s=Math.max(a.width+2*(e.padding??0),e?.width??0),o=Math.max(a.height+2*(e.padding??0),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 c;const{cssStyles:h}=e;if("handDrawn"===e.look){const t=sE.svg(i),n=vE(e,{}),r=e_(l),a=t.path(r,n);c=i.insert((()=>a),":first-child").attr("transform",`translate(${-s/2}, ${o/2})`),h&&c.attr("style",h)}else c=GE(i,s,o,l);return r&&c.attr("style",r),e.width=s,e.height=o,JT(e,c),e.intersect=function(t){return $E.polygon(e,l,t)},i}async function bC(t,e,n){const{labelStyles:r,nodeStyles:i}=yE(e);e.labelStyle=r;const{shapeSvg:a,bbox:s}=await ZT(t,e,t_(e)),o=Math.max(s.width+2*n.labelPaddingX,e?.width||0),l=Math.max(s.height+2*n.labelPaddingY,e?.height||0),c=-o/2,h=-l/2;let u,{rx:d,ry:p}=e;const{cssStyles:g}=e;if(n?.rx&&n.ry&&(d=n.rx,p=n.ry),"handDrawn"===e.look){const t=sE.svg(a),n=vE(e,{}),r=d||p?t.path(pE(c,h,o,l,d||0),n):t.rectangle(c,h,o,l,n);u=a.insert((()=>r),":first-child"),u.attr("class","basic label-container").attr("style",wk(g))}else u=a.insert("rect",":first-child"),u.attr("class","basic label-container").attr("style",i).attr("rx",wk(d)).attr("ry",wk(p)).attr("x",c).attr("y",h).attr("width",o).attr("height",l);return JT(e,u),e.intersect=function(t){return $E.rect(e,t)},a}async function wC(t,e){const{shapeSvg:n,bbox:r,label:i}=await ZT(t,e,"label"),a=n.insert("rect",":first-child");return a.attr("width",.1).attr("height",.1),n.attr("class","label edgeLabel"),i.attr("transform",`translate(${-r.width/2-(r.x-(r.left??0))}, ${-r.height/2-(r.y-(r.top??0))})`),JT(e,a),e.intersect=function(t){return $E.rect(e,t)},n}async function kC(t,e){const{labelStyles:n,nodeStyles:r}=yE(e);e.labelStyle=n;const{shapeSvg:i,bbox:a}=await ZT(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 c;const{cssStyles:h}=e;if("handDrawn"===e.look){const t=sE.svg(i),n=vE(e,{}),r=e_(l),a=t.path(r,n);c=i.insert((()=>a),":first-child").attr("transform",`translate(${-s/2}, ${o/2})`),h&&c.attr("style",h)}else c=GE(i,s,o,l);return r&&c.attr("style",r),e.width=s,e.height=o,JT(e,c),e.intersect=function(t){return $E.polygon(e,l,t)},i}async function TC(t,e){const{labelStyles:n,nodeStyles:r}=yE(e);e.labelStyle=n;const{shapeSvg:i,bbox:a}=await ZT(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 c;const{cssStyles:h}=e;if("handDrawn"===e.look){const t=sE.svg(i),n=vE(e,{}),r=e_(l),a=t.path(r,n);c=i.insert((()=>a),":first-child").attr("transform",`translate(${-s/2}, ${o/2})`),h&&c.attr("style",h)}else c=GE(i,s,o,l);return r&&c.attr("style",r),e.width=s,e.height=o,JT(e,c),e.intersect=function(t){return $E.polygon(e,l,t)},i}function _C(t,e){const{labelStyles:n,nodeStyles:r}=yE(e);e.label="",e.labelStyle=n;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=[{x:s,y:0},{x:0,y:o+3.5},{x:s-14,y:o+3.5},{x:0,y:2*o},{x:s,y:o-3.5},{x:14,y:o-3.5}],c=sE.svg(i),h=vE(e,{});"handDrawn"!==e.look&&(h.roughness=0,h.fillStyle="solid");const u=e_(l),d=c.path(u,h),p=i.insert((()=>d),":first-child");return a&&"handDrawn"!==e.look&&p.selectAll("path").attr("style",a),r&&"handDrawn"!==e.look&&p.selectAll("path").attr("style",r),p.attr("transform",`translate(-${s/2},${-o})`),JT(e,p),e.intersect=function(t){m.info("lightningBolt intersect",e,t);return $E.polygon(e,l,t)},i}s(dC,"hexagon"),s(pC,"hourglass"),s(gC,"icon"),s(fC,"iconCircle"),s(mC,"iconRounded"),s(yC,"iconSquare"),s(vC,"imageSquare"),s(xC,"inv_trapezoid"),s(bC,"drawRect"),s(wC,"labelRect"),s(kC,"lean_left"),s(TC,"lean_right"),s(_C,"lightningBolt");var EC=s(((t,e,n,r,i,a,s)=>[`M${t},${e+a}`,`a${i},${a} 0,0,0 ${n},0`,`a${i},${a} 0,0,0 ${-n},0`,`l0,${r}`,`a${i},${a} 0,0,0 ${n},0`,"l0,"+-r,`M${t},${e+a+s}`,`a${i},${a} 0,0,0 ${n},0`].join(" ")),"createCylinderPathD"),CC=s(((t,e,n,r,i,a,s)=>[`M${t},${e+a}`,`M${t+n},${e+a}`,`a${i},${a} 0,0,0 ${-n},0`,`l0,${r}`,`a${i},${a} 0,0,0 ${n},0`,"l0,"+-r,`M${t},${e+a+s}`,`a${i},${a} 0,0,0 ${n},0`].join(" ")),"createOuterCylinderPathD"),SC=s(((t,e,n,r,i,a)=>[`M${t-n/2},${-r/2}`,`a${i},${a} 0,0,0 ${n},0`].join(" ")),"createInnerCylinderPathD");async function AC(t,e){const{labelStyles:n,nodeStyles:r}=yE(e);e.labelStyle=n;const{shapeSvg:i,bbox:a,label:s}=await ZT(t,e,t_(e)),o=Math.max(a.width+(e.padding??0),e.width??0),l=o/2,c=l/(2.5+o/50),h=Math.max(a.height+c+(e.padding??0),e.height??0),u=.1*h;let d;const{cssStyles:p}=e;if("handDrawn"===e.look){const t=sE.svg(i),n=CC(0,0,o,h,l,c,u),r=SC(0,c,o,h,l,c),a=vE(e,{}),s=t.path(n,a),g=t.path(r,a);i.insert((()=>g),":first-child").attr("class","line"),d=i.insert((()=>s),":first-child"),d.attr("class","basic label-container"),p&&d.attr("style",p)}else{const t=EC(0,0,o,h,l,c,u);d=i.insert("path",":first-child").attr("d",t).attr("class","basic label-container").attr("style",wk(p)).attr("style",r)}return d.attr("label-offset-y",c),d.attr("transform",`translate(${-o/2}, ${-(h/2+c)})`),JT(e,d),s.attr("transform",`translate(${-a.width/2-(a.x-(a.left??0))}, ${-a.height/2+c-(a.y-(a.top??0))})`),e.intersect=function(t){const n=$E.rect(e,t),r=n.x-(e.x??0);if(0!=l&&(Math.abs(r)<(e.width??0)/2||Math.abs(r)==(e.width??0)/2&&Math.abs(n.y-(e.y??0))>(e.height??0)/2-c)){let i=c*c*(1-r*r/(l*l));i>0&&(i=Math.sqrt(i)),i=c-i,t.y-(e.y??0)>0&&(i=-i),n.y+=i}return n},i}async function LC(t,e){const{labelStyles:n,nodeStyles:r}=yE(e);e.labelStyle=n;const{shapeSvg:i,bbox:a,label:s}=await ZT(t,e,t_(e)),o=Math.max(a.width+2*(e.padding??0),e?.width??0),l=Math.max(a.height+2*(e.padding??0),e?.height??0),c=l/4,h=l+c,{cssStyles:u}=e,d=sE.svg(i),p=vE(e,{});"handDrawn"!==e.look&&(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},...n_(-o/2-o/2*.1,h/2,o/2+o/2*.1,h/2,c,.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}],f=d.polygon(g.map((t=>[t.x,t.y])),p),m=i.insert((()=>f),":first-child");return m.attr("class","basic label-container"),u&&"handDrawn"!==e.look&&m.selectAll("path").attr("style",u),r&&"handDrawn"!==e.look&&m.selectAll("path").attr("style",r),m.attr("transform",`translate(0,${-c/2})`),s.attr("transform",`translate(${-o/2+(e.padding??0)+o/2*.1/2-(a.x-(a.left??0))},${-l/2+(e.padding??0)-c/2-(a.y-(a.top??0))})`),JT(e,m),e.intersect=function(t){return $E.polygon(e,g,t)},i}async function NC(t,e){const{labelStyles:n,nodeStyles:r}=yE(e);e.labelStyle=n;const{shapeSvg:i,bbox:a,label:s}=await ZT(t,e,t_(e)),o=Math.max(a.width+2*(e.padding??0),e?.width??0),l=Math.max(a.height+2*(e.padding??0),e?.height??0),c=-o/2,h=-l/2,{cssStyles:u}=e,d=sE.svg(i),p=vE(e,{}),g=[{x:c-5,y:h+5},{x:c-5,y:h+l+5},{x:c+o-5,y:h+l+5},{x:c+o-5,y:h+l},{x:c+o,y:h+l},{x:c+o,y:h+l-5},{x:c+o+5,y:h+l-5},{x:c+o+5,y:h-5},{x:c+5,y:h-5},{x:c+5,y:h},{x:c,y:h},{x:c,y:h+5}],f=[{x:c,y:h+5},{x:c+o-5,y:h+5},{x:c+o-5,y:h+l},{x:c+o,y:h+l},{x:c+o,y:h},{x:c,y:h}];"handDrawn"!==e.look&&(p.roughness=0,p.fillStyle="solid");const m=e_(g),y=d.path(m,p),v=e_(f),x=d.path(v,{...p,fill:"none"}),b=i.insert((()=>x),":first-child");return b.insert((()=>y),":first-child"),b.attr("class","basic label-container"),u&&"handDrawn"!==e.look&&b.selectAll("path").attr("style",u),r&&"handDrawn"!==e.look&&b.selectAll("path").attr("style",r),s.attr("transform",`translate(${-a.width/2-5-(a.x-(a.left??0))}, ${-a.height/2+5-(a.y-(a.top??0))})`),JT(e,b),e.intersect=function(t){return $E.polygon(e,g,t)},i}async function IC(t,e){const{labelStyles:n,nodeStyles:r}=yE(e);e.labelStyle=n;const{shapeSvg:i,bbox:a,label:s}=await ZT(t,e,t_(e)),o=Math.max(a.width+2*(e.padding??0),e?.width??0),l=Math.max(a.height+2*(e.padding??0),e?.height??0),c=l/4,h=l+c,u=-o/2,d=-h/2,{cssStyles:p}=e,g=n_(u-5,d+h+5,u+o-5,d+h+5,c,.8),f=g?.[g.length-1],m=[{x:u-5,y:d+5},{x:u-5,y:d+h+5},...g,{x:u+o-5,y:f.y-5},{x:u+o,y:f.y-5},{x:u+o,y:f.y-10},{x:u+o+5,y:f.y-10},{x:u+o+5,y:d-5},{x:u+5,y:d-5},{x:u+5,y:d},{x:u,y:d},{x:u,y:d+5}],y=[{x:u,y:d+5},{x:u+o-5,y:d+5},{x:u+o-5,y:f.y-5},{x:u+o,y:f.y-5},{x:u+o,y:d},{x:u,y:d}],v=sE.svg(i),x=vE(e,{});"handDrawn"!==e.look&&(x.roughness=0,x.fillStyle="solid");const b=e_(m),w=v.path(b,x),k=e_(y),T=v.path(k,x),_=i.insert((()=>w),":first-child");return _.insert((()=>T)),_.attr("class","basic label-container"),p&&"handDrawn"!==e.look&&_.selectAll("path").attr("style",p),r&&"handDrawn"!==e.look&&_.selectAll("path").attr("style",r),_.attr("transform",`translate(0,${-c/2})`),s.attr("transform",`translate(${-a.width/2-5-(a.x-(a.left??0))}, ${-a.height/2+5-c/2-(a.y-(a.top??0))})`),JT(e,_),e.intersect=function(t){return $E.polygon(e,m,t)},i}async function MC(t,e,{config:{themeVariables:n}}){const{labelStyles:r,nodeStyles:i}=yE(e);e.labelStyle=r;e.useHtmlLabels||!1!==Ft().flowchart?.htmlLabels||(e.centerLabel=!0);const{shapeSvg:a,bbox:s}=await ZT(t,e,t_(e)),o=Math.max(s.width+2*(e.padding??0),e?.width??0),l=Math.max(s.height+2*(e.padding??0),e?.height??0),c=-o/2,h=-l/2,{cssStyles:u}=e,d=sE.svg(a),p=vE(e,{fill:n.noteBkgColor,stroke:n.noteBorderColor});"handDrawn"!==e.look&&(p.roughness=0,p.fillStyle="solid");const g=d.rectangle(c,h,o,l,p),f=a.insert((()=>g),":first-child");return f.attr("class","basic label-container"),u&&"handDrawn"!==e.look&&f.selectAll("path").attr("style",u),i&&"handDrawn"!==e.look&&f.selectAll("path").attr("style",i),JT(e,f),e.intersect=function(t){return $E.rect(e,t)},a}s(AC,"linedCylinder"),s(LC,"linedWaveEdgedRect"),s(NC,"multiRect"),s(IC,"multiWaveEdgedRectangle"),s(MC,"note");var RC=s(((t,e,n)=>[`M${t+n/2},${e}`,`L${t+n},${e-n/2}`,`L${t+n/2},${e-n}`,`L${t},${e-n/2}`,"Z"].join(" ")),"createDecisionBoxPathD");async function DC(t,e){const{labelStyles:n,nodeStyles:r}=yE(e);e.labelStyle=n;const{shapeSvg:i,bbox:a}=await ZT(t,e,t_(e)),s=a.width+e.padding+(a.height+e.padding),o=[{x:s/2,y:0},{x:s,y:-s/2},{x:s/2,y:-s},{x:0,y:-s/2}];let l;const{cssStyles:c}=e;if("handDrawn"===e.look){const t=sE.svg(i),n=vE(e,{}),r=RC(0,0,s),a=t.path(r,n);l=i.insert((()=>a),":first-child").attr("transform",`translate(${-s/2}, ${s/2})`),c&&l.attr("style",c)}else l=GE(i,s,s,o);return r&&l.attr("style",r),JT(e,l),e.intersect=function(t){return m.debug("APA12 Intersect called SPLIT\npoint:",t,"\nnode:\n",e,"\nres:",$E.polygon(e,o,t)),$E.polygon(e,o,t)},i}async function OC(t,e){const{labelStyles:n,nodeStyles:r}=yE(e);e.labelStyle=n;const{shapeSvg:i,bbox:a,label:s}=await ZT(t,e,t_(e)),o=-Math.max(a.width+(e.padding??0),e?.width??0)/2,l=-Math.max(a.height+(e.padding??0),e?.height??0)/2,c=l/2,h=[{x:o+c,y:l},{x:o,y:0},{x:o+c,y:-l},{x:-o,y:-l},{x:-o,y:l}],{cssStyles:u}=e,d=sE.svg(i),p=vE(e,{});"handDrawn"!==e.look&&(p.roughness=0,p.fillStyle="solid");const g=e_(h),f=d.path(g,p),m=i.insert((()=>f),":first-child");return m.attr("class","basic label-container"),u&&"handDrawn"!==e.look&&m.selectAll("path").attr("style",u),r&&"handDrawn"!==e.look&&m.selectAll("path").attr("style",r),m.attr("transform",`translate(${-c/2},0)`),s.attr("transform",`translate(${-c/2-a.width/2-(a.x-(a.left??0))}, ${-a.height/2-(a.y-(a.top??0))})`),JT(e,m),e.intersect=function(t){return $E.polygon(e,h,t)},i}async function PC(t,e){const{labelStyles:n,nodeStyles:r}=yE(e);let i;e.labelStyle=n,i=e.cssClasses?"node "+e.cssClasses:"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",r),l=e.description,c=e.label,h=o.node().appendChild(await dE(c,e.labelStyle,!0,!0));let u={width:0,height:0};if(dn(Hn()?.flowchart?.htmlLabels)){const t=h.children[0],e=Oa(h);u=t.getBoundingClientRect(),e.attr("width",u.width),e.attr("height",u.height)}m.info("Text 2",l);const d=l||[],p=h.getBBox(),g=o.node().appendChild(await dE(d.join?d.join("<br/>"):d,e.labelStyle,!0,!0)),f=g.children[0],y=Oa(g);u=f.getBoundingClientRect(),y.attr("width",u.width),y.attr("height",u.height);const v=(e.padding||0)/2;Oa(g).attr("transform","translate( "+(u.width>p.width?0:(p.width-u.width)/2)+", "+(p.height+v+5)+")"),Oa(h).attr("transform","translate( "+(u.width<p.width?0:-(p.width-u.width)/2)+", 0)"),u=o.node().getBBox(),o.attr("transform","translate("+-u.width/2+", "+(-u.height/2-v+3)+")");const x=u.width+(e.padding||0),b=u.height+(e.padding||0),w=-u.width/2-v,k=-u.height/2-v;let T,_;if("handDrawn"===e.look){const t=sE.svg(a),n=vE(e,{}),r=t.path(pE(w,k,x,b,e.rx||0),n),i=t.line(-u.width/2-v,-u.height/2-v+p.height+v,u.width/2+v,-u.height/2-v+p.height+v,n);_=a.insert((()=>(m.debug("Rough node insert CXC",r),i)),":first-child"),T=a.insert((()=>(m.debug("Rough node insert CXC",r),r)),":first-child")}else T=s.insert("rect",":first-child"),_=s.insert("line"),T.attr("class","outer title-state").attr("style",r).attr("x",-u.width/2-v).attr("y",-u.height/2-v).attr("width",u.width+(e.padding||0)).attr("height",u.height+(e.padding||0)),_.attr("class","divider").attr("x1",-u.width/2-v).attr("x2",u.width/2+v).attr("y1",-u.height/2-v+p.height+v).attr("y2",-u.height/2-v+p.height+v);return JT(e,T),e.intersect=function(t){return $E.rect(e,t)},a}async function BC(t,e){return bC(t,e,{rx:5,ry:5,classes:"",labelPaddingX:1*(e?.padding||0),labelPaddingY:1*(e?.padding||0)})}async function $C(t,e){const{labelStyles:n,nodeStyles:r}=yE(e);e.labelStyle=n;const{shapeSvg:i,bbox:a,label:s}=await ZT(t,e,t_(e)),o=e?.padding??0,l=Math.max(a.width+2*(e.padding??0),e?.width??0),c=Math.max(a.height+2*(e.padding??0),e?.height??0),h=-a.width/2-o,u=-a.height/2-o,{cssStyles:d}=e,p=sE.svg(i),g=vE(e,{});"handDrawn"!==e.look&&(g.roughness=0,g.fillStyle="solid");const f=[{x:h,y:u},{x:h+l+8,y:u},{x:h+l+8,y:u+c},{x:h-8,y:u+c},{x:h-8,y:u},{x:h,y:u},{x:h,y:u+c}],m=p.polygon(f.map((t=>[t.x,t.y])),g),y=i.insert((()=>m),":first-child");return y.attr("class","basic label-container").attr("style",wk(d)),r&&"handDrawn"!==e.look&&y.selectAll("path").attr("style",r),d&&"handDrawn"!==e.look&&y.selectAll("path").attr("style",r),s.attr("transform",`translate(${-l/2+4+(e.padding??0)-(a.x-(a.left??0))},${-c/2+(e.padding??0)-(a.y-(a.top??0))})`),JT(e,y),e.intersect=function(t){return $E.rect(e,t)},i}async function FC(t,e){const{labelStyles:n,nodeStyles:r}=yE(e);e.labelStyle=n;const{shapeSvg:i,bbox:a,label:s}=await ZT(t,e,t_(e)),o=Math.max(a.width+2*(e.padding??0),e?.width??0),l=Math.max(a.height+2*(e.padding??0),e?.height??0),c=-o/2,h=-l/2,{cssStyles:u}=e,d=sE.svg(i),p=vE(e,{});"handDrawn"!==e.look&&(p.roughness=0,p.fillStyle="solid");const g=[{x:c,y:h},{x:c,y:h+l},{x:c+o,y:h+l},{x:c+o,y:h-l/2}],f=e_(g),m=d.path(f,p),y=i.insert((()=>m),":first-child");return y.attr("class","basic label-container"),u&&"handDrawn"!==e.look&&y.selectChildren("path").attr("style",u),r&&"handDrawn"!==e.look&&y.selectChildren("path").attr("style",r),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))})`),JT(e,y),e.intersect=function(t){return $E.polygon(e,g,t)},i}async function zC(t,e){return bC(t,e,{rx:0,ry:0,classes:"",labelPaddingX:2*(e?.padding||0),labelPaddingY:1*(e?.padding||0)})}async function UC(t,e){const{labelStyles:n,nodeStyles:r}=yE(e);e.labelStyle=n;const{shapeSvg:i,bbox:a}=await ZT(t,e,t_(e)),s=a.height+e.padding,o=a.width+s/4+e.padding;let l;const{cssStyles:c}=e;if("handDrawn"===e.look){const t=sE.svg(i),n=vE(e,{}),r=pE(-o/2,-s/2,o,s,s/2),a=t.path(r,n);l=i.insert((()=>a),":first-child"),l.attr("class","basic label-container").attr("style",wk(c))}else l=i.insert("rect",":first-child"),l.attr("class","basic label-container").attr("style",r).attr("rx",s/2).attr("ry",s/2).attr("x",-o/2).attr("y",-s/2).attr("width",o).attr("height",s);return JT(e,l),e.intersect=function(t){return $E.rect(e,t)},i}async function GC(t,e){return bC(t,e,{rx:5,ry:5,classes:"flowchart-node"})}function qC(t,e,{config:{themeVariables:n}}){const{labelStyles:r,nodeStyles:i}=yE(e);e.labelStyle=r;const{cssStyles:a}=e,{lineColor:s,stateBorder:o,nodeBorder:l}=n,c=t.insert("g").attr("class","node default").attr("id",e.domId||e.id),h=sE.svg(c),u=vE(e,{});"handDrawn"!==e.look&&(u.roughness=0,u.fillStyle="solid");const d=h.circle(0,0,14,{...u,stroke:s,strokeWidth:2}),p=o??l,g=h.circle(0,0,5,{...u,fill:p,stroke:p,strokeWidth:2,fillStyle:"solid"}),f=c.insert((()=>d),":first-child");return f.insert((()=>g)),a&&f.selectAll("path").attr("style",a),i&&f.selectAll("path").attr("style",i),JT(e,f),e.intersect=function(t){return $E.circle(e,7,t)},c}function jC(t,e,{config:{themeVariables:n}}){const{lineColor:r}=n,i=t.insert("g").attr("class","node default").attr("id",e.domId||e.id);let a;if("handDrawn"===e.look){const t=sE.svg(i).circle(0,0,14,gE(r));a=i.insert((()=>t)),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 JT(e,a),e.intersect=function(t){return $E.circle(e,7,t)},i}async function YC(t,e){const{labelStyles:n,nodeStyles:r}=yE(e);e.labelStyle=n;const{shapeSvg:i,bbox:a}=await ZT(t,e,t_(e)),s=(e?.padding||0)/2,o=a.width+e.padding,l=a.height+e.padding,c=-a.width/2-s,h=-a.height/2-s,u=[{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("handDrawn"===e.look){const t=sE.svg(i),n=vE(e,{}),r=t.rectangle(c-8,h,o+16,l,n),a=t.line(c,h,c,h+l,n),s=t.line(c+o,h,c+o,h+l,n);i.insert((()=>a),":first-child"),i.insert((()=>s),":first-child");const u=i.insert((()=>r),":first-child"),{cssStyles:d}=e;u.attr("class","basic label-container").attr("style",wk(d)),JT(e,u)}else{const t=GE(i,o,l,u);r&&t.attr("style",r),JT(e,t)}return e.intersect=function(t){return $E.polygon(e,u,t)},i}async function WC(t,e){const{labelStyles:n,nodeStyles:r}=yE(e);e.labelStyle=n;const{shapeSvg:i,bbox:a}=await ZT(t,e,t_(e)),s=Math.max(a.width+2*(e.padding??0),e?.width??0),o=Math.max(a.height+2*(e.padding??0),e?.height??0),l=-s/2,c=-o/2,h=.2*o,u=.2*o,{cssStyles:d}=e,p=sE.svg(i),g=vE(e,{}),f=[{x:l-h/2,y:c},{x:l+s+h/2,y:c},{x:l+s+h/2,y:c+o},{x:l-h/2,y:c+o}],m=[{x:l+s-h/2,y:c+o},{x:l+s+h/2,y:c+o},{x:l+s+h/2,y:c+o-u}];"handDrawn"!==e.look&&(g.roughness=0,g.fillStyle="solid");const y=e_(f),v=p.path(y,g),x=e_(m),b=p.path(x,{...g,fillStyle:"solid"}),w=i.insert((()=>b),":first-child");return w.insert((()=>v),":first-child"),w.attr("class","basic label-container"),d&&"handDrawn"!==e.look&&w.selectAll("path").attr("style",d),r&&"handDrawn"!==e.look&&w.selectAll("path").attr("style",r),JT(e,w),e.intersect=function(t){return $E.polygon(e,f,t)},i}async function HC(t,e){const{labelStyles:n,nodeStyles:r}=yE(e);e.labelStyle=n;const{shapeSvg:i,bbox:a,label:s}=await ZT(t,e,t_(e)),o=Math.max(a.width+2*(e.padding??0),e?.width??0),l=Math.max(a.height+2*(e.padding??0),e?.height??0),c=l/4,h=.2*o,u=.2*l,d=l+c,{cssStyles:p}=e,g=sE.svg(i),f=vE(e,{});"handDrawn"!==e.look&&(f.roughness=0,f.fillStyle="solid");const m=[{x:-o/2-o/2*.1,y:d/2},...n_(-o/2-o/2*.1,d/2,o/2+o/2*.1,d/2,c,.8),{x:o/2+o/2*.1,y:-d/2},{x:-o/2-o/2*.1,y:-d/2}],y=-o/2+o/2*.1,v=-d/2-.4*u,x=[{x:y+o-h,y:1.4*(v+l)},{x:y+o,y:v+l-u},{x:y+o,y:.9*(v+l)},...n_(y+o,1.3*(v+l),y+o-h,1.5*(v+l),.03*-l,.5)],b=e_(m),w=g.path(b,f),k=e_(x),T=g.path(k,{...f,fillStyle:"solid"}),_=i.insert((()=>T),":first-child");return _.insert((()=>w),":first-child"),_.attr("class","basic label-container"),p&&"handDrawn"!==e.look&&_.selectAll("path").attr("style",p),r&&"handDrawn"!==e.look&&_.selectAll("path").attr("style",r),_.attr("transform",`translate(0,${-c/2})`),s.attr("transform",`translate(${-o/2+(e.padding??0)-(a.x-(a.left??0))},${-l/2+(e.padding??0)-c/2-(a.y-(a.top??0))})`),JT(e,_),e.intersect=function(t){return $E.polygon(e,m,t)},i}async function VC(t,e){const{labelStyles:n,nodeStyles:r}=yE(e);e.labelStyle=n;const{shapeSvg:i,bbox:a}=await ZT(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,c=-o/2,h=i.insert("rect",":first-child");return h.attr("class","text").attr("style",r).attr("rx",0).attr("ry",0).attr("x",l).attr("y",c).attr("width",s).attr("height",o),JT(e,h),e.intersect=function(t){return $E.rect(e,t)},i}s(DC,"question"),s(OC,"rect_left_inv_arrow"),s(PC,"rectWithTitle"),s(BC,"roundedRect"),s($C,"shadedProcess"),s(FC,"slopedRect"),s(zC,"squareRect"),s(UC,"stadium"),s(GC,"state"),s(qC,"stateEnd"),s(jC,"stateStart"),s(YC,"subroutine"),s(WC,"taggedRect"),s(HC,"taggedWaveEdgedRectangle"),s(VC,"text");var XC=s(((t,e,n,r,i,a)=>`M${t},${e}\n a${i},${a} 0,0,1 0,${-r}\n l${n},0\n a${i},${a} 0,0,1 0,${r}\n M${n},${-r}\n a${i},${a} 0,0,0 0,${r}\n l${-n},0`),"createCylinderPathD"),KC=s(((t,e,n,r,i,a)=>[`M${t},${e}`,`M${t+n},${e}`,`a${i},${a} 0,0,0 0,${-r}`,`l${-n},0`,`a${i},${a} 0,0,0 0,${r}`,`l${n},0`].join(" ")),"createOuterCylinderPathD"),ZC=s(((t,e,n,r,i,a)=>[`M${t+n/2},${-r/2}`,`a${i},${a} 0,0,0 0,${r}`].join(" ")),"createInnerCylinderPathD");async function QC(t,e){const{labelStyles:n,nodeStyles:r}=yE(e);e.labelStyle=n;const{shapeSvg:i,bbox:a,label:s,halfPadding:o}=await ZT(t,e,t_(e)),l="neo"===e.look?2*o:o,c=a.height+l,h=c/2,u=h/(2.5+c/50),d=a.width+u+l,{cssStyles:p}=e;let g;if("handDrawn"===e.look){const t=sE.svg(i),n=KC(0,0,d,c,u,h),r=ZC(0,0,d,c,u,h),a=t.path(n,vE(e,{})),s=t.path(r,vE(e,{fill:"none"}));g=i.insert((()=>s),":first-child"),g=i.insert((()=>a),":first-child"),g.attr("class","basic label-container"),p&&g.attr("style",p)}else{const t=XC(0,0,d,c,u,h);g=i.insert("path",":first-child").attr("d",t).attr("class","basic label-container").attr("style",wk(p)).attr("style",r),g.attr("class","basic label-container"),p&&g.selectAll("path").attr("style",p),r&&g.selectAll("path").attr("style",r)}return g.attr("label-offset-x",u),g.attr("transform",`translate(${-d/2}, ${c/2} )`),s.attr("transform",`translate(${-a.width/2-u-(a.x-(a.left??0))}, ${-a.height/2-(a.y-(a.top??0))})`),JT(e,g),e.intersect=function(t){const n=$E.rect(e,t),r=n.y-(e.y??0);if(0!=h&&(Math.abs(r)<(e.height??0)/2||Math.abs(r)==(e.height??0)/2&&Math.abs(n.x-(e.x??0))>(e.width??0)/2-u)){let i=u*u*(1-r*r/(h*h));0!=i&&(i=Math.sqrt(Math.abs(i))),i=u-i,t.x-(e.x??0)>0&&(i=-i),n.x+=i}return n},i}async function JC(t,e){const{labelStyles:n,nodeStyles:r}=yE(e);e.labelStyle=n;const{shapeSvg:i,bbox:a}=await ZT(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 c;const{cssStyles:h}=e;if("handDrawn"===e.look){const t=sE.svg(i),n=vE(e,{}),r=e_(l),a=t.path(r,n);c=i.insert((()=>a),":first-child").attr("transform",`translate(${-s/2}, ${o/2})`),h&&c.attr("style",h)}else c=GE(i,s,o,l);return r&&c.attr("style",r),e.width=s,e.height=o,JT(e,c),e.intersect=function(t){return $E.polygon(e,l,t)},i}async function tS(t,e){const{labelStyles:n,nodeStyles:r}=yE(e);e.labelStyle=n;const{shapeSvg:i,bbox:a}=await ZT(t,e,t_(e)),s=Math.max(60,a.width+2*(e.padding??0),e?.width??0),o=Math.max(20,a.height+2*(e.padding??0),e?.height??0),{cssStyles:l}=e,c=sE.svg(i),h=vE(e,{});"handDrawn"!==e.look&&(h.roughness=0,h.fillStyle="solid");const u=[{x:-s/2*.8,y:-o/2},{x:s/2*.8,y:-o/2},{x:s/2,y:-o/2*.6},{x:s/2,y:o/2},{x:-s/2,y:o/2},{x:-s/2,y:-o/2*.6}],d=e_(u),p=c.path(d,h),g=i.insert((()=>p),":first-child");return g.attr("class","basic label-container"),l&&"handDrawn"!==e.look&&g.selectChildren("path").attr("style",l),r&&"handDrawn"!==e.look&&g.selectChildren("path").attr("style",r),JT(e,g),e.intersect=function(t){return $E.polygon(e,u,t)},i}async function eS(t,e){const{labelStyles:n,nodeStyles:r}=yE(e);e.labelStyle=n;const{shapeSvg:i,bbox:a,label:s}=await ZT(t,e,t_(e)),o=dn(Hn().flowchart?.htmlLabels),l=a.width+(e.padding??0),c=l+a.height,h=l+a.height,u=[{x:0,y:0},{x:h,y:0},{x:h/2,y:-c}],{cssStyles:d}=e,p=sE.svg(i),g=vE(e,{});"handDrawn"!==e.look&&(g.roughness=0,g.fillStyle="solid");const f=e_(u),y=p.path(f,g),v=i.insert((()=>y),":first-child").attr("transform",`translate(${-c/2}, ${c/2})`);return d&&"handDrawn"!==e.look&&v.selectChildren("path").attr("style",d),r&&"handDrawn"!==e.look&&v.selectChildren("path").attr("style",r),e.width=l,e.height=c,JT(e,v),s.attr("transform",`translate(${-a.width/2-(a.x-(a.left??0))}, ${c/2-(a.height+(e.padding??0)/(o?2:1)-(a.y-(a.top??0)))})`),e.intersect=function(t){return m.info("Triangle intersect",e,u,t),$E.polygon(e,u,t)},i}async function nS(t,e){const{labelStyles:n,nodeStyles:r}=yE(e);e.labelStyle=n;const{shapeSvg:i,bbox:a,label:s}=await ZT(t,e,t_(e)),o=Math.max(a.width+2*(e.padding??0),e?.width??0),l=Math.max(a.height+2*(e.padding??0),e?.height??0),c=l/8,h=l+c,{cssStyles:u}=e,d=70-o,p=d>0?d/2:0,g=sE.svg(i),f=vE(e,{});"handDrawn"!==e.look&&(f.roughness=0,f.fillStyle="solid");const m=[{x:-o/2-p,y:h/2},...n_(-o/2-p,h/2,o/2+p,h/2,c,.8),{x:o/2+p,y:-h/2},{x:-o/2-p,y:-h/2}],y=e_(m),v=g.path(y,f),x=i.insert((()=>v),":first-child");return x.attr("class","basic label-container"),u&&"handDrawn"!==e.look&&x.selectAll("path").attr("style",u),r&&"handDrawn"!==e.look&&x.selectAll("path").attr("style",r),x.attr("transform",`translate(0,${-c/2})`),s.attr("transform",`translate(${-o/2+(e.padding??0)-(a.x-(a.left??0))},${-l/2+(e.padding??0)-c-(a.y-(a.top??0))})`),JT(e,x),e.intersect=function(t){return $E.polygon(e,m,t)},i}async function rS(t,e){const{labelStyles:n,nodeStyles:r}=yE(e);e.labelStyle=n;const{shapeSvg:i,bbox:a}=await ZT(t,e,t_(e)),s=Math.max(a.width+2*(e.padding??0),e?.width??0),o=Math.max(a.height+2*(e.padding??0),e?.height??0),l=s/o;let c=s,h=o;c>h*l?h=c/l:c=h*l,c=Math.max(c,100),h=Math.max(h,50);const u=Math.min(.2*h,h/4),d=h+2*u,{cssStyles:p}=e,g=sE.svg(i),f=vE(e,{});"handDrawn"!==e.look&&(f.roughness=0,f.fillStyle="solid");const m=[{x:-c/2,y:d/2},...n_(-c/2,d/2,c/2,d/2,u,1),{x:c/2,y:-d/2},...n_(c/2,-d/2,-c/2,-d/2,u,-1)],y=e_(m),v=g.path(y,f),x=i.insert((()=>v),":first-child");return x.attr("class","basic label-container"),p&&"handDrawn"!==e.look&&x.selectAll("path").attr("style",p),r&&"handDrawn"!==e.look&&x.selectAll("path").attr("style",r),JT(e,x),e.intersect=function(t){return $E.polygon(e,m,t)},i}async function iS(t,e){const{labelStyles:n,nodeStyles:r}=yE(e);e.labelStyle=n;const{shapeSvg:i,bbox:a,label:s}=await ZT(t,e,t_(e)),o=Math.max(a.width+2*(e.padding??0),e?.width??0),l=Math.max(a.height+2*(e.padding??0),e?.height??0),c=-o/2,h=-l/2,{cssStyles:u}=e,d=sE.svg(i),p=vE(e,{}),g=[{x:c-5,y:h-5},{x:c-5,y:h+l},{x:c+o,y:h+l},{x:c+o,y:h-5}],f=`M${c-5},${h-5} L${c+o},${h-5} L${c+o},${h+l} L${c-5},${h+l} L${c-5},${h-5}\n M${c-5},${h} L${c+o},${h}\n M${c},${h-5} L${c},${h+l}`;"handDrawn"!==e.look&&(p.roughness=0,p.fillStyle="solid");const m=d.path(f,p),y=i.insert((()=>m),":first-child");return y.attr("transform","translate(2.5, 2.5)"),y.attr("class","basic label-container"),u&&"handDrawn"!==e.look&&y.selectAll("path").attr("style",u),r&&"handDrawn"!==e.look&&y.selectAll("path").attr("style",r),s.attr("transform",`translate(${-a.width/2+2.5-(a.x-(a.left??0))}, ${-a.height/2+2.5-(a.y-(a.top??0))})`),JT(e,y),e.intersect=function(t){return $E.polygon(e,g,t)},i}async function aS(t,e,n,r,i=n.class.padding??12){const a=r?0:3,s=t.insert("g").attr("class",t_(e)).attr("id",e.domId||e.id);let o=null,l=null,c=null,h=null,u=0,d=0,p=0;if(o=s.insert("g").attr("class","annotation-group text"),e.annotations.length>0){const t=e.annotations[0];await sS(o,{text:`«${t}»`},0);u=o.node().getBBox().height}l=s.insert("g").attr("class","label-group text"),await sS(l,e,0,["font-weight: bolder"]);const g=l.node().getBBox();d=g.height,c=s.insert("g").attr("class","members-group text");let f=0;for(const t of e.members){f+=await sS(c,t,f,[t.parseClassifier()])+a}p=c.node().getBBox().height,p<=0&&(p=i/2),h=s.insert("g").attr("class","methods-group text");let m=0;for(const t of e.methods){m+=await sS(h,t,m,[t.parseClassifier()])+a}let y=s.node().getBBox();if(null!==o){const t=o.node().getBBox();o.attr("transform",`translate(${-t.width/2})`)}return l.attr("transform",`translate(${-g.width/2}, ${u})`),y=s.node().getBBox(),c.attr("transform",`translate(0, ${u+d+2*i})`),y=s.node().getBBox(),h.attr("transform",`translate(0, ${u+d+(p?p+4*i:2*i)})`),y=s.node().getBBox(),{shapeSvg:s,bbox:y}}async function sS(t,e,n,r=[]){const i=t.insert("g").attr("class","label").attr("style",r.join("; ")),a=Ft();let o="useHtmlLabels"in e?e.useHtmlLabels:dn(a.htmlLabels)??!0,l="";l="text"in e?e.text:e.label,!o&&l.startsWith("\\")&&(l=l.substring(1)),wn(l)&&(o=!0);const c=await KT(i,Kn(xk(l)),{width:lk(l,a)+50,classes:"markdown-node-label",useHtmlLabels:o},a);let h,u=1;if(o){const t=c.children[0],e=Oa(c);u=t.innerHTML.split("<br>").length,t.innerHTML.includes("</math>")&&(u+=t.innerHTML.split("<mrow>").length-1);const n=t.getElementsByTagName("img");if(n){const t=""===l.replace(/<img[^>]*>/g,"").trim();await Promise.all([...n].map((e=>new Promise((n=>{function r(){if(e.style.display="flex",e.style.flexDirection="column",t){const t=a.fontSize?.toString()??window.getComputedStyle(document.body).fontSize,n=5,r=parseInt(t,10)*n+"px";e.style.minWidth=r,e.style.maxWidth=r}else e.style.width="100%";n(e)}s(r,"setupImage"),setTimeout((()=>{e.complete&&r()})),e.addEventListener("error",r),e.addEventListener("load",r)})))))}h=t.getBoundingClientRect(),e.attr("width",h.width),e.attr("height",h.height)}else{r.includes("font-weight: bolder")&&Oa(c).selectAll("tspan").attr("font-weight",""),u=c.children.length;const t=c.children[0];if(""===c.textContent||c.textContent.includes("&gt")){t.textContent=l[0]+l.substring(1).replaceAll("&gt;",">").replaceAll("&lt;","<").trim();" "===l[1]&&(t.textContent=t.textContent[0]+" "+t.textContent.substring(1))}"undefined"===t.textContent&&(t.textContent=""),h=c.getBBox()}return i.attr("transform","translate(0,"+(-h.height/(2*u)+n)+")"),h.height}async function oS(t,e){const n=Hn(),r=n.class.padding??12,i=r,a=e.useHtmlLabels??dn(n.htmlLabels)??!0,s=e;s.annotations=s.annotations??[],s.members=s.members??[],s.methods=s.methods??[];const{shapeSvg:o,bbox:l}=await aS(t,e,n,a,i),{labelStyles:c,nodeStyles:h}=yE(e);e.labelStyle=c,e.cssStyles=s.styles||"";const u=s.styles?.join(";")||h||"";e.cssStyles||(e.cssStyles=u.replaceAll("!important","").split(";"));const d=0===s.members.length&&0===s.methods.length&&!n.class?.hideEmptyMembersBox,p=sE.svg(o),g=vE(e,{});"handDrawn"!==e.look&&(g.roughness=0,g.fillStyle="solid");const f=l.width;let m=l.height;0===s.members.length&&0===s.methods.length?m+=i:s.members.length>0&&0===s.methods.length&&(m+=2*i);const y=-f/2,v=-m/2,x=p.rectangle(y-r,v-r-(d?r:0===s.members.length&&0===s.methods.length?-r/2:0),f+2*r,m+2*r+(d?2*r:0===s.members.length&&0===s.methods.length?-r:0),g),b=o.insert((()=>x),":first-child");b.attr("class","basic label-container");const w=b.node().getBBox();o.selectAll(".text").each(((t,e,n)=>{const i=Oa(n[e]),l=i.attr("transform");let c=0;if(l){const t=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(l);t&&(c=parseFloat(t[2]))}let h=c+v+r-(d?r:0===s.members.length&&0===s.methods.length?-r/2:0);a||(h-=4);let u=y;(i.attr("class").includes("label-group")||i.attr("class").includes("annotation-group"))&&(u=-i.node()?.getBBox().width/2||0,o.selectAll("text").each((function(t,e,n){"middle"===window.getComputedStyle(n[e]).textAnchor&&(u=0)}))),i.attr("transform",`translate(${u}, ${h})`)}));const k=o.select(".annotation-group").node().getBBox().height-(d?r/2:0)||0,T=o.select(".label-group").node().getBBox().height-(d?r/2:0)||0,_=o.select(".members-group").node().getBBox().height-(d?r/2:0)||0;if(s.members.length>0||s.methods.length>0||d){const t=p.line(w.x,k+T+v+r,w.x+w.width,k+T+v+r,g);o.insert((()=>t)).attr("class","divider").attr("style",u)}if(d||s.members.length>0||s.methods.length>0){const t=p.line(w.x,k+T+_+v+2*i+r,w.x+w.width,k+T+_+v+r+2*i,g);o.insert((()=>t)).attr("class","divider").attr("style",u)}if("handDrawn"!==s.look&&o.selectAll("path").attr("style",u),b.select(":nth-child(2)").attr("style",u),o.selectAll(".divider").select("path").attr("style",u),e.labelStyle?o.selectAll("span").attr("style",e.labelStyle):o.selectAll("span").attr("style",u),!a){const t=RegExp(/color\s*:\s*([^;]*)/),e=t.exec(u);if(e){const t=e[0].replace("color","fill");o.selectAll("tspan").attr("style",t)}else if(c){const e=t.exec(c);if(e){const t=e[0].replace("color","fill");o.selectAll("tspan").attr("style",t)}}}return JT(e,b),e.intersect=function(t){return $E.rect(e,t)},o}s(QC,"tiltedCylinder"),s(JC,"trapezoid"),s(tS,"trapezoidalPentagon"),s(eS,"triangle"),s(nS,"waveEdgedRectangle"),s(rS,"waveRectangle"),s(iS,"windowPane"),s(aS,"textHelper"),s(sS,"addText"),s(oS,"classBox");var lS=s((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 cS(t,e,{config:n}){const{labelStyles:r,nodeStyles:i}=yE(e);e.labelStyle=r||"";const a=e.width;e.width=(e.width??200)-10;const{shapeSvg:s,bbox:o,label:l}=await ZT(t,e,t_(e)),c=e.padding||10;let h,u="";"ticket"in e&&e.ticket&&n?.kanban?.ticketBaseUrl&&(u=n?.kanban?.ticketBaseUrl.replace("#TICKET#",e.ticket),h=s.insert("svg:a",":first-child").attr("class","kanban-ticket-link").attr("xlink:href",u).attr("target","_blank"));const d={useHtmlLabels:e.useHtmlLabels,labelStyle:e.labelStyle||"",width:e.width,img:e.img,padding:e.padding||8,centerLabel:!1};let p,g;({label:p,bbox:g}=h?await QT(h,"ticket"in e&&e.ticket||"",d):await QT(s,"ticket"in e&&e.ticket||"",d));const{label:f,bbox:m}=await QT(s,"assigned"in e&&e.assigned||"",d);e.width=a;const y=e?.width||0,v=Math.max(g.height,m.height)/2,x=Math.max(o.height+20,e?.height||0)+v,b=-y/2,w=-x/2;let k;l.attr("transform","translate("+(c-y/2)+", "+(-v-o.height/2)+")"),p.attr("transform","translate("+(c-y/2)+", "+(-v+o.height/2)+")"),f.attr("transform","translate("+(c+y/2-m.width-20)+", "+(-v+o.height/2)+")");const{rx:T,ry:_}=e,{cssStyles:E}=e;if("handDrawn"===e.look){const t=sE.svg(s),n=vE(e,{}),r=T||_?t.path(pE(b,w,y,x,T||0),n):t.rectangle(b,w,y,x,n);k=s.insert((()=>r),":first-child"),k.attr("class","basic label-container").attr("style",E||null)}else{k=s.insert("rect",":first-child"),k.attr("class","basic label-container __APA__").attr("style",i).attr("rx",T??5).attr("ry",_??5).attr("x",b).attr("y",w).attr("width",y).attr("height",x);const t="priority"in e&&e.priority;if(t){const e=s.append("line"),n=b+2,r=w+Math.floor((T??0)/2),i=w+x-Math.floor((T??0)/2);e.attr("x1",n).attr("y1",r).attr("x2",n).attr("y2",i).attr("stroke-width","4").attr("stroke",lS(t))}}return JT(e,k),e.height=x,e.intersect=function(t){return $E.rect(e,t)},s}s(cS,"kanbanItem");var hS=[{semanticName:"Process",name:"Rectangle",shortName:"rect",description:"Standard process shape",aliases:["proc","process","rectangle"],internalAliases:["squareRect"],handler:zC},{semanticName:"Event",name:"Rounded Rectangle",shortName:"rounded",description:"Represents an event",aliases:["event"],internalAliases:["roundedRect"],handler:BC},{semanticName:"Terminal Point",name:"Stadium",shortName:"stadium",description:"Terminal point",aliases:["terminal","pill"],handler:UC},{semanticName:"Subprocess",name:"Framed Rectangle",shortName:"fr-rect",description:"Subprocess",aliases:["subprocess","subproc","framed-rectangle","subroutine"],handler:YC},{semanticName:"Database",name:"Cylinder",shortName:"cyl",description:"Database storage",aliases:["db","database","cylinder"],handler:iC},{semanticName:"Start",name:"Circle",shortName:"circle",description:"Starting point",aliases:["circ"],handler:YE},{semanticName:"Decision",name:"Diamond",shortName:"diam",description:"Decision-making step",aliases:["decision","diamond","question"],handler:DC},{semanticName:"Prepare Conditional",name:"Hexagon",shortName:"hex",description:"Preparation or condition step",aliases:["hexagon","prepare"],handler:dC},{semanticName:"Data Input/Output",name:"Lean Right",shortName:"lean-r",description:"Represents input or output",aliases:["lean-right","in-out"],internalAliases:["lean_right"],handler:TC},{semanticName:"Data Input/Output",name:"Lean Left",shortName:"lean-l",description:"Represents output or input",aliases:["lean-left","out-in"],internalAliases:["lean_left"],handler:kC},{semanticName:"Priority Action",name:"Trapezoid Base Bottom",shortName:"trap-b",description:"Priority action",aliases:["priority","trapezoid-bottom","trapezoid"],handler:JC},{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:xC},{semanticName:"Stop",name:"Double Circle",shortName:"dbl-circ",description:"Represents a stop point",aliases:["double-circle"],internalAliases:["doublecircle"],handler:sC},{semanticName:"Text Block",name:"Text Block",shortName:"text",description:"Text block",handler:VC},{semanticName:"Card",name:"Notched Rectangle",shortName:"notch-rect",description:"Represents a card",aliases:["card","notched-rectangle"],handler:qE},{semanticName:"Lined/Shaded Process",name:"Lined Rectangle",shortName:"lin-rect",description:"Lined process shape",aliases:["lined-rectangle","lined-process","lin-proc","shaded-process"],handler:$C},{semanticName:"Start",name:"Small Circle",shortName:"sm-circ",description:"Small starting point",aliases:["start","small-circle"],internalAliases:["stateStart"],handler:jC},{semanticName:"Stop",name:"Framed Circle",shortName:"fr-circ",description:"Stop point",aliases:["stop","framed-circle"],internalAliases:["stateEnd"],handler:qC},{semanticName:"Fork/Join",name:"Filled Rectangle",shortName:"fork",description:"Fork or join in process flow",aliases:["join"],internalAliases:["forkJoin"],handler:cC},{semanticName:"Collate",name:"Hourglass",shortName:"hourglass",description:"Represents a collate operation",aliases:["hourglass","collate"],handler:pC},{semanticName:"Comment",name:"Curly Brace",shortName:"brace",description:"Adds a comment",aliases:["comment","brace-l"],handler:XE},{semanticName:"Comment Right",name:"Curly Brace",shortName:"brace-r",description:"Adds a comment",handler:ZE},{semanticName:"Comment with braces on both sides",name:"Curly Braces",shortName:"braces",description:"Adds a comment",handler:JE},{semanticName:"Com Link",name:"Lightning Bolt",shortName:"bolt",description:"Communication link",aliases:["com-link","lightning-bolt"],handler:_C},{semanticName:"Document",name:"Document",shortName:"doc",description:"Represents a document",aliases:["doc","document"],handler:nS},{semanticName:"Delay",name:"Half-Rounded Rectangle",shortName:"delay",description:"Represents a delay",aliases:["half-rounded-rectangle"],handler:hC},{semanticName:"Direct Access Storage",name:"Horizontal Cylinder",shortName:"h-cyl",description:"Direct access storage",aliases:["das","horizontal-cylinder"],handler:QC},{semanticName:"Disk Storage",name:"Lined Cylinder",shortName:"lin-cyl",description:"Disk storage",aliases:["disk","lined-cylinder"],handler:AC},{semanticName:"Display",name:"Curved Trapezoid",shortName:"curv-trap",description:"Represents a display",aliases:["curved-trapezoid","display"],handler:tC},{semanticName:"Divided Process",name:"Divided Rectangle",shortName:"div-rect",description:"Divided process shape",aliases:["div-proc","divided-rectangle","divided-process"],handler:aC},{semanticName:"Extract",name:"Triangle",shortName:"tri",description:"Extraction process",aliases:["extract","triangle"],handler:eS},{semanticName:"Internal Storage",name:"Window Pane",shortName:"win-pane",description:"Internal storage",aliases:["internal-storage","window-pane"],handler:iS},{semanticName:"Junction",name:"Filled Circle",shortName:"f-circ",description:"Junction point",aliases:["junction","filled-circle"],handler:oC},{semanticName:"Loop Limit",name:"Trapezoidal Pentagon",shortName:"notch-pent",description:"Loop limit step",aliases:["loop-limit","notched-pentagon"],handler:tS},{semanticName:"Manual File",name:"Flipped Triangle",shortName:"flip-tri",description:"Manual file operation",aliases:["manual-file","flipped-triangle"],handler:lC},{semanticName:"Manual Input",name:"Sloped Rectangle",shortName:"sl-rect",description:"Manual input step",aliases:["manual-input","sloped-rectangle"],handler:FC},{semanticName:"Multi-Document",name:"Stacked Document",shortName:"docs",description:"Multiple documents",aliases:["documents","st-doc","stacked-document"],handler:IC},{semanticName:"Multi-Process",name:"Stacked Rectangle",shortName:"st-rect",description:"Multiple processes",aliases:["procs","processes","stacked-rectangle"],handler:NC},{semanticName:"Stored Data",name:"Bow Tie Rectangle",shortName:"bow-rect",description:"Stored data",aliases:["stored-data","bow-tie-rectangle"],handler:UE},{semanticName:"Summary",name:"Crossed Circle",shortName:"cross-circ",description:"Summary",aliases:["summary","crossed-circle"],handler:HE},{semanticName:"Tagged Document",name:"Tagged Document",shortName:"tag-doc",description:"Tagged document",aliases:["tag-doc","tagged-document"],handler:HC},{semanticName:"Tagged Process",name:"Tagged Rectangle",shortName:"tag-rect",description:"Tagged process",aliases:["tagged-rectangle","tag-proc","tagged-process"],handler:WC},{semanticName:"Paper Tape",name:"Flag",shortName:"flag",description:"Paper tape",aliases:["paper-tape"],handler:rS},{semanticName:"Odd",name:"Odd",shortName:"odd",description:"Odd shape",internalAliases:["rect_left_inv_arrow"],handler:OC},{semanticName:"Lined Document",name:"Lined Document",shortName:"lin-doc",description:"Lined document",aliases:["lined-document"],handler:LC}],uS=s((()=>{const t={state:GC,choice:jE,note:MC,rectWithTitle:PC,labelRect:wC,iconSquare:yC,iconCircle:fC,icon:gC,iconRounded:mC,imageSquare:vC,anchor:FE,kanbanItem:cS,classBox:oS},e=[...Object.entries(t),...hS.flatMap((t=>[t.shortName,..."aliases"in t?t.aliases:[],..."internalAliases"in t?t.internalAliases:[]].map((e=>[e,t.handler]))))];return Object.fromEntries(e)}),"generateShapeMap"),dS=uS();function pS(t){return t in dS}s(pS,"isValidShape");var gS=new Map;async function fS(t,e,n){let r,i;"rect"===e.shape&&(e.rx&&e.ry?e.shape="roundedRect":e.shape="squareRect");const a=e.shape?dS[e.shape]:void 0;if(!a)throw new Error(`No such shape: ${e.shape}. Please check your syntax.`);if(e.link){let s;"sandbox"===n.config.securityLevel?s="_top":e.linkTarget&&(s=e.linkTarget||"_blank"),r=t.insert("svg:a").attr("xlink:href",e.link).attr("target",s??null),i=await a(r,e,n)}else i=await a(t,e,n),r=i;return e.tooltip&&i.attr("title",e.tooltip),gS.set(e.id,r),e.haveCallback&&r.attr("class",r.attr("class")+" clickable"),r}s(fS,"insertNode");var mS=s(((t,e)=>{gS.set(e.id,t)}),"setNodeElem"),yS=s((()=>{gS.clear()}),"clear"),vS=s((t=>{const e=gS.get(t.id);m.trace("Transforming node",t.diff,t,"translate("+(t.x-t.width/2-5)+", "+t.width/2+")");const n=t.diff||0;return t.clusterNode?e.attr("transform","translate("+(t.x+n-t.width/2)+", "+(t.y-t.height/2-8)+")"):e.attr("transform","translate("+t.x+", "+t.y+")"),n}),"positionNode"),xS={aggregation:18,extension:18,composition:18,dependency:6,lollipop:13.5,arrow_point:4};function bS(t,e){if(void 0===t||void 0===e)return{angle:0,deltaX:0,deltaY:0};t=wS(t),e=wS(e);const[n,r]=[t.x,t.y],[i,a]=[e.x,e.y],s=i-n,o=a-r;return{angle:Math.atan(o/s),deltaX:s,deltaY:o}}s(bS,"calculateDeltaAndAngle");var wS=s((t=>Array.isArray(t)?{x:t[0],y:t[1]}:t),"pointTransformer"),kS=s((t=>({x:s((function(e,n,r){let i=0;const a=wS(r[0]).x<wS(r[r.length-1]).x?"left":"right";if(0===n&&Object.hasOwn(xS,t.arrowTypeStart)){const{angle:e,deltaX:n}=bS(r[0],r[1]);i=xS[t.arrowTypeStart]*Math.cos(e)*(n>=0?1:-1)}else if(n===r.length-1&&Object.hasOwn(xS,t.arrowTypeEnd)){const{angle:e,deltaX:n}=bS(r[r.length-1],r[r.length-2]);i=xS[t.arrowTypeEnd]*Math.cos(e)*(n>=0?1:-1)}const s=Math.abs(wS(e).x-wS(r[r.length-1]).x),o=Math.abs(wS(e).y-wS(r[r.length-1]).y),l=Math.abs(wS(e).x-wS(r[0]).x),c=Math.abs(wS(e).y-wS(r[0]).y),h=xS[t.arrowTypeStart],u=xS[t.arrowTypeEnd];if(s<u&&s>0&&o<u){let t=u+1-s;t*="right"===a?-1:1,i-=t}if(l<h&&l>0&&c<h){let t=h+1-l;t*="right"===a?-1:1,i+=t}return wS(e).x+i}),"x"),y:s((function(e,n,r){let i=0;const a=wS(r[0]).y<wS(r[r.length-1]).y?"down":"up";if(0===n&&Object.hasOwn(xS,t.arrowTypeStart)){const{angle:e,deltaY:n}=bS(r[0],r[1]);i=xS[t.arrowTypeStart]*Math.abs(Math.sin(e))*(n>=0?1:-1)}else if(n===r.length-1&&Object.hasOwn(xS,t.arrowTypeEnd)){const{angle:e,deltaY:n}=bS(r[r.length-1],r[r.length-2]);i=xS[t.arrowTypeEnd]*Math.abs(Math.sin(e))*(n>=0?1:-1)}const s=Math.abs(wS(e).y-wS(r[r.length-1]).y),o=Math.abs(wS(e).x-wS(r[r.length-1]).x),l=Math.abs(wS(e).y-wS(r[0]).y),c=Math.abs(wS(e).x-wS(r[0]).x),h=xS[t.arrowTypeStart],u=xS[t.arrowTypeEnd];if(s<u&&s>0&&o<u){let t=u+1-s;t*="up"===a?-1:1,i-=t}if(l<h&&l>0&&c<h){let t=h+1-l;t*="up"===a?-1:1,i+=t}return wS(e).y+i}),"y")})),"getLineFunctionsWithOffset"),TS=s(((t,e,n,r,i)=>{e.arrowTypeStart&&ES(t,"start",e.arrowTypeStart,n,r,i),e.arrowTypeEnd&&ES(t,"end",e.arrowTypeEnd,n,r,i)}),"addEdgeMarkers"),_S={arrow_cross:"cross",arrow_point:"point",arrow_barb:"barb",arrow_circle:"circle",aggregation:"aggregation",extension:"extension",composition:"composition",dependency:"dependency",lollipop:"lollipop"},ES=s(((t,e,n,r,i,a)=>{const s=_S[n];if(!s)return void m.warn(`Unknown arrow type: ${n}`);const o="start"===e?"Start":"End";t.attr(`marker-${e}`,`url(${r}#${i}_${a}-${s}${o})`)}),"addEdgeMarker"),CS=new Map,SS=new Map,AS=s((()=>{CS.clear(),SS.clear()}),"clear"),LS=s((t=>t?t.reduce(((t,e)=>t+";"+e),""):""),"getLabelStyles"),NS=s((async(t,e)=>{let n=dn(Hn().flowchart.htmlLabels);const r=await KT(t,e.label,{style:LS(e.labelStyle),useHtmlLabels:n,addSvgBackground:!0,isNode:!1});m.info("abc82",e,e.labelType);const i=t.insert("g").attr("class","edgeLabel"),a=i.insert("g").attr("class","label");a.node().appendChild(r);let s,o=r.getBBox();if(n){const t=r.children[0],e=Oa(r);o=t.getBoundingClientRect(),e.attr("width",o.width),e.attr("height",o.height)}if(a.attr("transform","translate("+-o.width/2+", "+-o.height/2+")"),CS.set(e.id,i),e.width=o.width,e.height=o.height,e.startLabelLeft){const n=await dE(e.startLabelLeft,LS(e.labelStyle)),r=t.insert("g").attr("class","edgeTerminals"),i=r.insert("g").attr("class","inner");s=i.node().appendChild(n);const a=n.getBBox();i.attr("transform","translate("+-a.width/2+", "+-a.height/2+")"),SS.get(e.id)||SS.set(e.id,{}),SS.get(e.id).startLeft=r,IS(s,e.startLabelLeft)}if(e.startLabelRight){const n=await dE(e.startLabelRight,LS(e.labelStyle)),r=t.insert("g").attr("class","edgeTerminals"),i=r.insert("g").attr("class","inner");s=r.node().appendChild(n),i.node().appendChild(n);const a=n.getBBox();i.attr("transform","translate("+-a.width/2+", "+-a.height/2+")"),SS.get(e.id)||SS.set(e.id,{}),SS.get(e.id).startRight=r,IS(s,e.startLabelRight)}if(e.endLabelLeft){const n=await dE(e.endLabelLeft,LS(e.labelStyle)),r=t.insert("g").attr("class","edgeTerminals"),i=r.insert("g").attr("class","inner");s=i.node().appendChild(n);const a=n.getBBox();i.attr("transform","translate("+-a.width/2+", "+-a.height/2+")"),r.node().appendChild(n),SS.get(e.id)||SS.set(e.id,{}),SS.get(e.id).endLeft=r,IS(s,e.endLabelLeft)}if(e.endLabelRight){const n=await dE(e.endLabelRight,LS(e.labelStyle)),r=t.insert("g").attr("class","edgeTerminals"),i=r.insert("g").attr("class","inner");s=i.node().appendChild(n);const a=n.getBBox();i.attr("transform","translate("+-a.width/2+", "+-a.height/2+")"),r.node().appendChild(n),SS.get(e.id)||SS.set(e.id,{}),SS.get(e.id).endRight=r,IS(s,e.endLabelRight)}return r}),"insertEdgeLabel");function IS(t,e){Hn().flowchart.htmlLabels&&t&&(t.style.width=9*e.length+"px",t.style.height="12px")}s(IS,"setTerminalWidth");var MS=s(((t,e)=>{m.debug("Moving label abc88 ",t.id,t.label,CS.get(t.id),e);let n=e.updatedPath?e.updatedPath:e.originalPath;const r=Hn(),{subGraphTitleTotalMargin:i}=Gm(r);if(t.label){const r=CS.get(t.id);let a=t.x,s=t.y;if(n){const r=yk.calcLabelPosition(n);m.debug("Moving label "+t.label+" from (",a,",",s,") to (",r.x,",",r.y,") abc88"),e.updatedPath&&(a=r.x,s=r.y)}r.attr("transform",`translate(${a}, ${s+i/2})`)}if(t.startLabelLeft){const e=SS.get(t.id).startLeft;let r=t.x,i=t.y;if(n){const e=yk.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_left",n);r=e.x,i=e.y}e.attr("transform",`translate(${r}, ${i})`)}if(t.startLabelRight){const e=SS.get(t.id).startRight;let r=t.x,i=t.y;if(n){const e=yk.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_right",n);r=e.x,i=e.y}e.attr("transform",`translate(${r}, ${i})`)}if(t.endLabelLeft){const e=SS.get(t.id).endLeft;let r=t.x,i=t.y;if(n){const e=yk.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_left",n);r=e.x,i=e.y}e.attr("transform",`translate(${r}, ${i})`)}if(t.endLabelRight){const e=SS.get(t.id).endRight;let r=t.x,i=t.y;if(n){const e=yk.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_right",n);r=e.x,i=e.y}e.attr("transform",`translate(${r}, ${i})`)}}),"positionEdgeLabel"),RS=s(((t,e)=>{const n=t.x,r=t.y,i=Math.abs(e.x-n),a=Math.abs(e.y-r),s=t.width/2,o=t.height/2;return i>=s||a>=o}),"outsideNode"),DS=s(((t,e,n)=>{m.debug(`intersection calc abc89:\n outsidePoint: ${JSON.stringify(e)}\n insidePoint : ${JSON.stringify(n)}\n node : x:${t.x} y:${t.y} w:${t.width} h:${t.height}`);const r=t.x,i=t.y,a=Math.abs(r-n.x),s=t.width/2;let o=n.x<e.x?s-a:s+a;const l=t.height/2,c=Math.abs(e.y-n.y),h=Math.abs(e.x-n.x);if(Math.abs(i-e.y)*s>Math.abs(r-e.x)*l){let t=n.y<e.y?e.y-l-i:i-l-e.y;o=h*t/c;const r={x:n.x<e.x?n.x+o:n.x-h+o,y:n.y<e.y?n.y+c-t:n.y-c+t};return 0===o&&(r.x=e.x,r.y=e.y),0===h&&(r.x=e.x),0===c&&(r.y=e.y),m.debug(`abc89 top/bottom calc, Q ${c}, q ${t}, R ${h}, r ${o}`,r),r}{o=n.x<e.x?e.x-s-r:r-s-e.x;let t=c*o/h,i=n.x<e.x?n.x+h-o:n.x-h+o,a=n.y<e.y?n.y+t:n.y-t;return m.debug(`sides calc abc89, Q ${c}, q ${t}, R ${h}, r ${o}`,{_x:i,_y:a}),0===o&&(i=e.x,a=e.y),0===h&&(i=e.x),0===c&&(a=e.y),{x:i,y:a}}}),"intersection"),OS=s(((t,e)=>{m.warn("abc88 cutPathAtIntersect",t,e);let n=[],r=t[0],i=!1;return t.forEach((t=>{if(m.info("abc88 checking point",t,e),RS(e,t)||i)m.warn("abc88 outside",t,r),r=t,i||n.push(t);else{const a=DS(e,r,t);m.debug("abc88 inside",t,r,a),m.debug("abc88 intersection",a,e);let s=!1;n.forEach((t=>{s=s||t.x===a.x&&t.y===a.y})),n.some((t=>t.x===a.x&&t.y===a.y))?m.warn("abc88 no intersect",a,n):n.push(a),i=!0}})),m.debug("returning points",n),n}),"cutPathAtIntersect");function PS(t){const e=[],n=[];for(let r=1;r<t.length-1;r++){const i=t[r-1],a=t[r],s=t[r+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),n.push(r))}return{cornerPoints:e,cornerPointPositions:n}}s(PS,"extractCornerPoints");var BS=s((function(t,e,n){const r=e.x-t.x,i=e.y-t.y,a=n/Math.sqrt(r*r+i*i);return{x:e.x-a*r,y:e.y-a*i}}),"findAdjacentPoint"),$S=s((function(t){const{cornerPointPositions:e}=PS(t),n=[];for(let r=0;r<t.length;r++)if(e.includes(r)){const e=t[r-1],i=t[r+1],a=t[r],s=BS(e,a,5),o=BS(i,a,5),l=o.x-s.x,c=o.y-s.y;n.push(s);const h=2*Math.sqrt(2);let u={x:a.x,y:a.y};if(Math.abs(i.x-e.x)>10&&Math.abs(i.y-e.y)>=10){m.debug("Corner point fixing",Math.abs(i.x-e.x),Math.abs(i.y-e.y));const t=5;u=a.x===s.x?{x:l<0?s.x-t+h:s.x+t-h,y:c<0?s.y-h:s.y+h}:{x:l<0?s.x-h:s.x+h,y:c<0?s.y-t+h:s.y+t-h}}else m.debug("Corner point skipping fixing",Math.abs(i.x-e.x),Math.abs(i.y-e.y));n.push(u,o)}else n.push(t[r]);return n}),"fixCorners"),FS=s((function(t,e,n,r,i,a,s){const{handDrawnSeed:o}=Hn();let l=e.points,c=!1;const h=i;var u=a;u.intersect&&h.intersect&&(l=l.slice(1,e.points.length-1),l.unshift(h.intersect(l[0])),m.debug("Last point APA12",e.start,"--\x3e",e.end,l[l.length-1],u,u.intersect(l[l.length-1])),l.push(u.intersect(l[l.length-1]))),e.toCluster&&(m.info("to cluster abc88",n.get(e.toCluster)),l=OS(e.points,n.get(e.toCluster).node),c=!0),e.fromCluster&&(m.debug("from cluster abc88",n.get(e.fromCluster),JSON.stringify(l,null,2)),l=OS(l.reverse(),n.get(e.fromCluster).node).reverse(),c=!0);let d=l.filter((t=>!Number.isNaN(t.y)));d=$S(d);let p=iu;e.curve&&(p=e.curve);const{x:g,y:f}=kS(e),y=Xh().x(g).y(f).curve(p);let v,x;switch(e.thickness){case"normal":default:v="edge-thickness-normal";break;case"thick":v="edge-thickness-thick";break;case"invisible":v="edge-thickness-invisible"}switch(e.pattern){case"solid":default:v+=" edge-pattern-solid";break;case"dotted":v+=" edge-pattern-dotted";break;case"dashed":v+=" edge-pattern-dashed"}let b=y(d);const w=Array.isArray(e.style)?e.style:[e.style];if("handDrawn"===e.look){const n=sE.svg(t);Object.assign([],d);v+=" transition",x=Oa(n.path(b,{roughness:.3,seed:o})).select("path").attr("id",e.id).attr("class"," "+v+(e.classes?" "+e.classes:"")).attr("style",w?w.reduce(((t,e)=>t+";"+e),""):"");let r=x.attr("d");x.attr("d",r),t.node().appendChild(x.node())}else x=t.append("path").attr("d",b).attr("id",e.id).attr("class"," "+v+(e.classes?" "+e.classes:"")).attr("style",w?w.reduce(((t,e)=>t+";"+e),""):"");let k="";(Hn().flowchart.arrowMarkerAbsolute||Hn().state.arrowMarkerAbsolute)&&(k=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,k=k.replace(/\(/g,"\\(").replace(/\)/g,"\\)")),m.info("arrowTypeStart",e.arrowTypeStart),m.info("arrowTypeEnd",e.arrowTypeEnd),TS(x,e,k,s,r);let T={};return c&&(T.updatedPath=l),T.originalPath=e.points,T}),"insertEdge"),zS=s(((t,e,n,r)=>{e.forEach((e=>{KS[e](t,n,r)}))}),"insertMarkers"),US=s(((t,e,n)=>{m.trace("Making markers for ",n),t.append("defs").append("marker").attr("id",n+"_"+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",n+"_"+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"),GS=s(((t,e,n)=>{t.append("defs").append("marker").attr("id",n+"_"+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",n+"_"+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"),qS=s(((t,e,n)=>{t.append("defs").append("marker").attr("id",n+"_"+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",n+"_"+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"),jS=s(((t,e,n)=>{t.append("defs").append("marker").attr("id",n+"_"+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",n+"_"+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"),YS=s(((t,e,n)=>{t.append("defs").append("marker").attr("id",n+"_"+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",n+"_"+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"),WS=s(((t,e,n)=>{t.append("marker").attr("id",n+"_"+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",n+"_"+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"),HS=s(((t,e,n)=>{t.append("marker").attr("id",n+"_"+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",n+"_"+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"),VS=s(((t,e,n)=>{t.append("marker").attr("id",n+"_"+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",n+"_"+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"),XS=s(((t,e,n)=>{t.append("defs").append("marker").attr("id",n+"_"+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"),KS={extension:US,composition:GS,aggregation:qS,dependency:jS,lollipop:YS,point:WS,circle:HS,cross:VS,barb:XS},ZS=zS,QS={common:_n,getConfig:Ft,insertCluster:CE,insertEdge:FS,insertEdgeLabel:NS,insertMarkers:ZS,insertNode:fS,interpolateToCurve:Gw,labelHelper:ZT,log:m,positionEdgeLabel:MS},JS={},tA=s((t=>{for(const e of t)JS[e.name]=e}),"registerLayoutLoaders");s((()=>{tA([{name:"dagre",loader:s((async()=>await Promise.resolve().then((function(){return eW}))),"loader")}])}),"registerDefaultLayoutLoaders")();var eA=s((async(t,e)=>{if(!(t.layoutAlgorithm in JS))throw new Error(`Unknown layout algorithm: ${t.layoutAlgorithm}`);const n=JS[t.layoutAlgorithm];return(await n.loader()).render(t,e,QS,{algorithm:n.algorithm})}),"render"),nA=s(((t="",{fallback:e="dagre"}={})=>{if(t in JS)return t;if(e in JS)return m.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"),rA=Vx(Object.keys,Object),iA=Object.prototype.hasOwnProperty;function aA(t){if(!Qx(t))return rA(t);var e=[];for(var n in Object(t))iA.call(t,n)&&"constructor"!=n&&e.push(n);return e}s(aA,"baseKeys");var sA=aA,oA=dv(Ly,"DataView"),lA=dv(Ly,"Promise"),cA=dv(Ly,"Set"),hA=dv(Ly,"WeakMap"),uA=tv(oA),dA=tv(Yv),pA=tv(lA),gA=tv(cA),fA=tv(hA),mA=Gy;(oA&&"[object DataView]"!=mA(new oA(new ArrayBuffer(1)))||Yv&&"[object Map]"!=mA(new Yv)||lA&&"[object Promise]"!=mA(lA.resolve())||cA&&"[object Set]"!=mA(new cA)||hA&&"[object WeakMap]"!=mA(new hA))&&(mA=s((function(t){var e=Gy(t),n="[object Object]"==e?t.constructor:void 0,r=n?tv(n):"";if(r)switch(r){case uA:return"[object DataView]";case dA:return"[object Map]";case pA:return"[object Promise]";case gA:return"[object Set]";case fA:return"[object WeakMap]"}return e}),"getTag"));var yA=mA,vA=Object.prototype.hasOwnProperty;function xA(t){if(null==t)return!0;if(gb(t)&&(hb(t)||"string"==typeof t||"function"==typeof t.splice||kb(t)||zb(t)||cb(t)))return!t.length;var e=yA(t);if("[object Map]"==e||"[object Set]"==e)return!t.size;if(Qx(t))return!sA(t).length;for(var n in t)if(vA.call(t,n))return!1;return!0}s(xA,"isEmpty");var bA=xA,wA={id:"c4",detector:s((t=>/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(t)),"detector"),loader:s((async()=>{const{diagram:t}=await Promise.resolve().then((function(){return $H}));return{id:"c4",diagram:t}}),"loader")},kA=s(((t,e)=>"dagre-wrapper"!==e?.flowchart?.defaultRenderer&&"elk"!==e?.flowchart?.defaultRenderer&&/^\s*graph/.test(t)),"detector"),TA={id:"flowchart",detector:kA,loader:s((async()=>{const{diagram:t}=await Promise.resolve().then((function(){return tX}));return{id:"flowchart",diagram:t}}),"loader")},_A="flowchart-v2",EA=s(((t,e)=>"dagre-d3"!==e?.flowchart?.defaultRenderer&&("elk"===e?.flowchart?.defaultRenderer&&(e.layout="elk"),!(!/^\s*graph/.test(t)||"dagre-wrapper"!==e?.flowchart?.defaultRenderer)||/^\s*flowchart/.test(t))),"detector"),CA={id:_A,detector:EA,loader:s((async()=>{const{diagram:t}=await Promise.resolve().then((function(){return tX}));return{id:_A,diagram:t}}),"loader")},SA={id:"er",detector:s((t=>/^\s*erDiagram/.test(t)),"detector"),loader:s((async()=>{const{diagram:t}=await Promise.resolve().then((function(){return GX}));return{id:"er",diagram:t}}),"loader")},AA={id:"gitGraph",detector:s((t=>/^\s*gitGraph/.test(t)),"detector"),loader:s((async()=>{const{diagram:t}=await Promise.resolve().then((function(){return ant}));return{id:"gitGraph",diagram:t}}),"loader")},LA={id:"gantt",detector:s((t=>/^\s*gantt/.test(t)),"detector"),loader:s((async()=>{const{diagram:t}=await Promise.resolve().then((function(){return zrt}));return{id:"gantt",diagram:t}}),"loader")},NA={id:"info",detector:s((t=>/^\s*info/.test(t)),"detector"),loader:s((async()=>{const{diagram:t}=await Promise.resolve().then((function(){return Wrt}));return{id:"info",diagram:t}}),"loader")},IA={id:"pie",detector:s((t=>/^\s*pie/.test(t)),"detector"),loader:s((async()=>{const{diagram:t}=await Promise.resolve().then((function(){return lit}));return{id:"pie",diagram:t}}),"loader")},MA="quadrantChart",RA={id:MA,detector:s((t=>/^\s*quadrantChart/.test(t)),"detector"),loader:s((async()=>{const{diagram:t}=await Promise.resolve().then((function(){return Bit}));return{id:MA,diagram:t}}),"loader")},DA={id:"xychart",detector:s((t=>/^\s*xychart-beta/.test(t)),"detector"),loader:s((async()=>{const{diagram:t}=await Promise.resolve().then((function(){return Rat}));return{id:"xychart",diagram:t}}),"loader")},OA={id:"requirement",detector:s((t=>/^\s*requirement(Diagram)?/.test(t)),"detector"),loader:s((async()=>{const{diagram:t}=await Promise.resolve().then((function(){return vst}));return{id:"requirement",diagram:t}}),"loader")},PA={id:"sequence",detector:s((t=>/^\s*sequenceDiagram/.test(t)),"detector"),loader:s((async()=>{const{diagram:t}=await Promise.resolve().then((function(){return rlt}));return{id:"sequence",diagram:t}}),"loader")},BA=s(((t,e)=>"dagre-wrapper"!==e?.class?.defaultRenderer&&/^\s*classDiagram/.test(t)),"detector"),$A={id:"class",detector:BA,loader:s((async()=>{const{diagram:t}=await Promise.resolve().then((function(){return oct}));return{id:"class",diagram:t}}),"loader")},FA=s(((t,e)=>!(!/^\s*classDiagram/.test(t)||"dagre-wrapper"!==e?.class?.defaultRenderer)||/^\s*classDiagram-v2/.test(t)),"detector"),zA={id:"classDiagram",detector:FA,loader:s((async()=>{const{diagram:t}=await Promise.resolve().then((function(){return cct}));return{id:"classDiagram",diagram:t}}),"loader")},UA=s(((t,e)=>"dagre-wrapper"!==e?.state?.defaultRenderer&&/^\s*stateDiagram/.test(t)),"detector"),GA={id:"state",detector:UA,loader:s((async()=>{const{diagram:t}=await Promise.resolve().then((function(){return Uht}));return{id:"state",diagram:t}}),"loader")},qA=s(((t,e)=>!!/^\s*stateDiagram-v2/.test(t)||!(!/^\s*stateDiagram/.test(t)||"dagre-wrapper"!==e?.state?.defaultRenderer)),"detector"),jA={id:"stateDiagram",detector:qA,loader:s((async()=>{const{diagram:t}=await Promise.resolve().then((function(){return qht}));return{id:"stateDiagram",diagram:t}}),"loader")},YA={id:"journey",detector:s((t=>/^\s*journey/.test(t)),"detector"),loader:s((async()=>{const{diagram:t}=await Promise.resolve().then((function(){return Nut}));return{id:"journey",diagram:t}}),"loader")},WA=s(((t,e,n)=>{m.debug("rendering svg for syntax error\n");const r=zp(e),i=r.append("g");r.attr("viewBox","0 0 2412 512"),Sn(r,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 ${n}`)}),"draw"),HA={draw:WA},VA=HA,XA={db:{},renderer:HA,parser:{parse:s((()=>{}),"parse")}},KA="flowchart-elk",ZA=s(((t,e={})=>!!(/^\s*flowchart-elk/.test(t)||/^\s*flowchart|graph/.test(t)&&"elk"===e?.flowchart?.defaultRenderer)&&(e.layout="elk",!0)),"detector"),QA={id:KA,detector:ZA,loader:s((async()=>{const{diagram:t}=await Promise.resolve().then((function(){return tX}));return{id:KA,diagram:t}}),"loader")},JA={id:"timeline",detector:s((t=>/^\s*timeline/.test(t)),"detector"),loader:s((async()=>{const{diagram:t}=await Promise.resolve().then((function(){return xdt}));return{id:"timeline",diagram:t}}),"loader")},tL={id:"mindmap",detector:s((t=>/^\s*mindmap/.test(t)),"detector"),loader:s((async()=>{const{diagram:t}=await Promise.resolve().then((function(){return XCt}));return{id:"mindmap",diagram:t}}),"loader")},eL={id:"kanban",detector:s((t=>/^\s*kanban/.test(t)),"detector"),loader:s((async()=>{const{diagram:t}=await Promise.resolve().then((function(){return xSt}));return{id:"kanban",diagram:t}}),"loader")},nL={id:"sankey",detector:s((t=>/^\s*sankey-beta/.test(t)),"detector"),loader:s((async()=>{const{diagram:t}=await Promise.resolve().then((function(){return _At}));return{id:"sankey",diagram:t}}),"loader")},rL={id:"packet",detector:s((t=>/^\s*packet-beta/.test(t)),"detector"),loader:s((async()=>{const{diagram:t}=await Promise.resolve().then((function(){return zAt}));return{id:"packet",diagram:t}}),"loader")},iL={id:"block",detector:s((t=>/^\s*block-beta/.test(t)),"detector"),loader:s((async()=>{const{diagram:t}=await Promise.resolve().then((function(){return aIt}));return{id:"block",diagram:t}}),"loader")},aL={id:"architecture",detector:s((t=>/^\s*architecture/.test(t)),"detector"),loader:s((async()=>{const{diagram:t}=await Promise.resolve().then((function(){return hMt}));return{id:"architecture",diagram:t}}),"loader")},sL=!1,oL=s((()=>{sL||(sL=!0,tr("error",XA,(t=>"error"===t.toLowerCase().trim())),tr("---",{db:{clear:s((()=>{}),"clear")},styles:{},renderer:{draw:s((()=>{}),"draw")},parser:{parse:s((()=>{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:s((()=>null),"init")},(t=>t.toLowerCase().trimStart().startsWith("---"))),E(wA,eL,zA,$A,SA,LA,NA,IA,OA,PA,QA,CA,TA,tL,JA,AA,jA,GA,YA,RA,nL,rL,DA,iL,aL))}),"addDiagrams"),lL=s((async()=>{m.debug("Loading registered diagrams");const t=(await Promise.allSettled(Object.entries(T).map((async([t,{detector:e,loader:n}])=>{if(n)try{er(t)}catch{try{const{diagram:t,id:r}=await n();tr(r,t,e)}catch(e){throw m.error(`Failed to load external diagram with key ${t}. Removing from detectors.`),delete T[t],e}}})))).filter((t=>"rejected"===t.status));if(t.length>0){m.error(`Failed to load ${t.length} external diagrams`);for(const e of t)m.error(e);throw new Error(`Failed to load ${t.length} external diagrams`)}}),"loadRegisteredDiagrams"),cL=Math.abs,hL=String.fromCharCode;function uL(t){return t.trim()}function dL(t,e,n){return t.replace(e,n)}function pL(t,e,n){return t.indexOf(e,n)}function gL(t,e){return 0|t.charCodeAt(e)}function fL(t,e,n){return t.slice(e,n)}function mL(t){return t.length}function yL(t){return t.length}function vL(t,e){return e.push(t),t}s(uL,"trim"),s(dL,"replace"),s(pL,"indexof"),s(gL,"charat"),s(fL,"substr"),s(mL,"strlen"),s(yL,"sizeof"),s(vL,"append");var xL=1,bL=1,wL=0,kL=0,TL=0,_L="";function EL(t,e,n,r,i,a,s,o){return{value:t,root:e,parent:n,type:r,props:i,children:a,line:xL,column:bL,length:s,return:"",siblings:o}}function CL(){return TL}function SL(){return TL=kL>0?gL(_L,--kL):0,bL--,10===TL&&(bL=1,xL--),TL}function AL(){return TL=kL<wL?gL(_L,kL++):0,bL++,10===TL&&(bL=1,xL++),TL}function LL(){return gL(_L,kL)}function NL(){return kL}function IL(t,e){return fL(_L,t,e)}function ML(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 RL(t){return xL=bL=1,wL=mL(_L=t),kL=0,[]}function DL(t){return _L="",t}function OL(t){return uL(IL(kL-1,$L(91===t?t+2:40===t?t+1:t)))}function PL(t){for(;(TL=LL())&&TL<33;)AL();return ML(t)>2||ML(TL)>3?"":" "}function BL(t,e){for(;--e&&AL()&&!(TL<48||TL>102||TL>57&&TL<65||TL>70&&TL<97););return IL(t,NL()+(e<6&&32==LL()&&32==AL()))}function $L(t){for(;AL();)switch(TL){case t:return kL;case 34:case 39:34!==t&&39!==t&&$L(TL);break;case 40:41===t&&$L(t);break;case 92:AL()}return kL}function FL(t,e){for(;AL()&&t+TL!==57&&(t+TL!==84||47!==LL()););return"/*"+IL(e,kL-1)+"*"+hL(47===t?t:AL())}function zL(t){for(;!ML(LL());)AL();return IL(t,kL)}function UL(t){return DL(GL("",null,null,null,[""],t=RL(t),0,[0],t))}function GL(t,e,n,r,i,a,s,o,l){for(var c=0,h=0,u=s,d=0,p=0,g=0,f=1,m=1,y=1,v=0,x="",b=i,w=a,k=r,T=x;m;)switch(g=v,v=AL()){case 40:if(108!=g&&58==gL(T,u-1)){-1!=pL(T+=dL(OL(v),"&","&\f"),"&\f",cL(c?o[c-1]:0))&&(y=-1);break}case 34:case 39:case 91:T+=OL(v);break;case 9:case 10:case 13:case 32:T+=PL(g);break;case 92:T+=BL(NL()-1,7);continue;case 47:switch(LL()){case 42:case 47:vL(jL(FL(AL(),NL()),e,n,l),l),5!=ML(g||1)&&5!=ML(LL()||1)||!mL(T)||" "===fL(T,-1,void 0)||(T+=" ");break;default:T+="/"}break;case 123*f:o[c++]=mL(T)*y;case 125*f:case 59:case 0:switch(v){case 0:case 125:m=0;case 59+h:-1==y&&(T=dL(T,/\f/g,"")),p>0&&(mL(T)-u||0===f&&47===g)&&vL(p>32?YL(T+";",r,n,u-1,l):YL(dL(T," ","")+";",r,n,u-2,l),l);break;case 59:T+=";";default:if(vL(k=qL(T,e,n,c,h,i,o,x,b=[],w=[],u,a),a),123===v)if(0===h)GL(T,e,k,k,b,a,u,o,w);else switch(99===d&&110===gL(T,3)?100:d){case 100:case 108:case 109:case 115:GL(t,k,k,r&&vL(qL(t,k,k,0,0,i,o,x,i,b=[],u,w),w),i,w,u,o,r?b:w);break;default:GL(T,k,k,k,[""],w,0,o,w)}}c=h=p=0,f=y=1,x=T="",u=s;break;case 58:u=1+mL(T),p=g;default:if(f<1)if(123==v)--f;else if(125==v&&0==f++&&125==SL())continue;switch(T+=hL(v),v*f){case 38:y=h>0?1:(T+="\f",-1);break;case 44:o[c++]=(mL(T)-1)*y,y=1;break;case 64:45===LL()&&(T+=OL(AL())),d=LL(),h=u=mL(x=T+=zL(NL())),v++;break;case 45:45===g&&2==mL(T)&&(f=0)}}return a}function qL(t,e,n,r,i,a,s,o,l,c,h,u){for(var d=i-1,p=0===i?a:[""],g=yL(p),f=0,m=0,y=0;f<r;++f)for(var v=0,x=fL(t,d+1,d=cL(m=s[f])),b=t;v<g;++v)(b=uL(m>0?p[v]+" "+x:dL(x,/&\f/g,p[v])))&&(l[y++]=b);return EL(t,e,n,0===i?"rule":o,l,c,h,u)}function jL(t,e,n,r){return EL(t,e,n,"comm",hL(CL()),fL(t,2,-2),0,r)}function YL(t,e,n,r,i){return EL(t,e,n,"decl",fL(t,0,r),fL(t,r+1,-1),r,i)}function WL(t,e){for(var n="",r=0;r<t.length;r++)n+=e(t[r],r,t,e)||"";return n}function HL(t,e,n,r){switch(t.type){case"@layer":if(t.children.length)break;case"@import":case"decl":return t.return=t.return||t.value;case"comm":return"";case"@keyframes":return t.return=t.value+"{"+WL(t.children,r)+"}";case"rule":if(!mL(t.value=t.props.join(",")))return""}return mL(n=WL(t.children,r))?t.return=t.value+"{"+n+"}":""}s(EL,"node"),s(CL,"char"),s(SL,"prev"),s(AL,"next"),s(LL,"peek"),s(NL,"caret"),s(IL,"slice"),s(ML,"token"),s(RL,"alloc"),s(DL,"dealloc"),s(OL,"delimit"),s(PL,"whitespace"),s(BL,"escaping"),s($L,"delimiter"),s(FL,"commenter"),s(zL,"identifier"),s(UL,"compile"),s(GL,"parse"),s(qL,"ruleset"),s(jL,"comment"),s(YL,"declaration"),s(WL,"serialize"),s(HL,"stringify");function VL(t,e){t.attr("role","graphics-document document"),""!==e&&t.attr("aria-roledescription",e)}function XL(t,e,n,r){if(void 0!==t.insert){if(n){const e=`chart-desc-${r}`;t.attr("aria-describedby",e),t.insert("desc",":first-child").attr("id",e).text(n)}if(e){const n=`chart-title-${r}`;t.attr("aria-labelledby",n),t.insert("title",":first-child").attr("id",n).text(e)}}}s(VL,"setA11yDiagramInfo"),s(XL,"addSVGa11yTitleDescription");var KL=class t{constructor(t,e,n,r,i){this.type=t,this.text=e,this.db=n,this.parser=r,this.renderer=i}static{s(this,"Diagram")}static async fromText(e,n={}){const r=Ft(),i=_(e,r);e=vk(e)+"\n";try{er(i)}catch{const t=S(i);if(!t)throw new k(`Diagram ${i} not found.`);const{id:e,diagram:n}=await t();tr(e,n)}const{db:a,parser:s,renderer:o,init:l}=er(i);return s.parser&&(s.parser.yy=a),a.clear?.(),l?.(r),n.title&&a.setDiagramTitle?.(n.title),await s.parse(e),new t(i,e,a,s,o)}async render(t,e){await this.renderer.draw(this.text,t,e,this)}getParser(){return this.parser}getType(){return this.type}},ZL=[],QL=s((()=>{ZL.forEach((t=>{t()})),ZL=[]}),"attachFunctions"),JL=s((t=>t.replace(/^\s*%%(?!{)[^\n]+\n?/gm,"").trimStart()),"cleanupComments");function tN(t){const e=t.match(x);if(!e)return{text:t,metadata:{}};let n=Um(e[1],{schema:zm})??{};n="object"!=typeof n||Array.isArray(n)?{}:n;const r={};return n.displayMode&&(r.displayMode=n.displayMode.toString()),n.title&&(r.title=n.title.toString()),n.config&&(r.config=n.config),{text:t.slice(e[0].length),metadata:r}}s(tN,"extractFrontMatter");var eN=s((t=>t.replace(/\r\n?/g,"\n").replace(/<(\w+)([^>]*)>/g,((t,e,n)=>"<"+e+n.replace(/="([^"]*)"/g,"='$1'")+">"))),"cleanupText"),nN=s((t=>{const{text:e,metadata:n}=tN(t),{displayMode:r,title:i,config:a={}}=n;return r&&(a.gantt||(a.gantt={}),a.gantt.displayMode=r),{title:i,config:a,text:e}}),"processFrontmatter"),rN=s((t=>{const e=yk.detectInit(t)??{},n=yk.detectDirective(t,"wrap");return Array.isArray(n)?e.wrap=n.some((({type:t})=>"wrap"===t)):"wrap"===n?.type&&(e.wrap=!0),{text:zw(t),directive:e}}),"processDirectives");function iN(t){const e=eN(t),n=nN(e),r=rN(n.text),i=mk(n.config,r.directive);return{code:t=JL(r.text),title:n.title,config:i}}function aN(t){const e=(new TextEncoder).encode(t),n=Array.from(e,(t=>String.fromCodePoint(t))).join("");return btoa(n)}s(iN,"preprocessDiagram"),s(aN,"toBase64");var sN=["foreignobject"],oN=["dominant-baseline"];function lN(t){const e=iN(t);return Gt(),Ut(e.config??{}),e}async function cN(t,e){oL();try{const{code:e,config:n}=lN(t);return{diagramType:(await bN(e)).type,config:n}}catch(t){if(e?.suppressErrors)return!1;throw t}}s(lN,"processAndSetConfigs"),s(cN,"parse");var hN=s(((t,e,n=[])=>`\n.${t} ${e} { ${n.join(" !important; ")} !important; }`),"cssImportantStyles"),uN=s(((t,e=new Map)=>{let n="";if(void 0!==t.themeCSS&&(n+=`\n${t.themeCSS}`),void 0!==t.fontFamily&&(n+=`\n:root { --mermaid-font-family: ${t.fontFamily}}`),void 0!==t.altFontFamily&&(n+=`\n:root { --mermaid-alt-font-family: ${t.altFontFamily}}`),e instanceof Map){const r=["> *","span"],i=["rect","polygon","ellipse","circle","path"],a=t.htmlLabels??t.flowchart?.htmlLabels?r:i;e.forEach((t=>{bA(t.styles)||a.forEach((e=>{n+=hN(t.id,e,t.styles)})),bA(t.textStyles)||(n+=hN(t.id,"tspan",(t?.textStyles||[]).map((t=>t.replace("color","fill")))))}))}return n}),"createCssStyles"),dN=s(((t,e,n,r)=>{const i=uN(t,n);return WL(UL(`${r}{${Mn(e,i,t.themeVariables)}}`),HL)}),"createUserStyles"),pN=s(((t="",e,n)=>{let r=t;return n||e||(r=r.replace(/marker-end="url\([\d+./:=?A-Za-z-]*?#/g,'marker-end="url(#')),r=xk(r),r=r.replace(/<br>/g,"<br/>"),r}),"cleanUpSvgCode"),gN=s(((t="",e)=>`<iframe style="width:100%;height:${e?.viewBox?.baseVal?.height?e.viewBox.baseVal.height+"px":"100%"};border:0;margin:0;" src="data:text/html;charset=UTF-8;base64,${aN(`<body style="margin:0">${t}</body>`)}" sandbox="allow-top-navigation-by-user-activation allow-popups">\n The "iframe" tag is not supported by your browser.\n</iframe>`),"putIntoIFrame"),fN=s(((t,e,n,r,i)=>{const a=t.append("div");a.attr("id",n),r&&a.attr("style",r);const s=a.append("svg").attr("id",e).attr("width","100%").attr("xmlns","http://www.w3.org/2000/svg");return i&&s.attr("xmlns:xlink",i),s.append("g"),t}),"appendDivSvgG");function mN(t,e){return t.append("iframe").attr("id",e).attr("style","width: 100%; height: 100%;").attr("sandbox","")}s(mN,"sandboxedIframe");var yN=s(((t,e,n,r)=>{t.getElementById(e)?.remove(),t.getElementById(n)?.remove(),t.getElementById(r)?.remove()}),"removeExistingElements"),vN=s((async function(t,e,n){oL();const r=lN(e);e=r.code;const i=Ft();m.debug(i),e.length>(i?.maxTextSize??5e4)&&(e="graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa");const a="#"+t,o="i"+t,l="#"+o,c="d"+t,h="#"+c,u=s((()=>{const t=Oa(p?l:h).node();t&&"remove"in t&&t.remove()}),"removeTempElements");let d=Oa("body");const p="sandbox"===i.securityLevel,g="loose"===i.securityLevel,f=i.fontFamily;if(void 0!==n){if(n&&(n.innerHTML=""),p){const t=mN(Oa(n),o);d=Oa(t.nodes()[0].contentDocument.body),d.node().style.margin=0}else d=Oa(n);fN(d,t,c,`font-family: ${f}`,"http://www.w3.org/1999/xlink")}else{if(yN(document,t,c,o),p){const t=mN(Oa("body"),o);d=Oa(t.nodes()[0].contentDocument.body),d.node().style.margin=0}else d=Oa("body");fN(d,t,c)}let y,v;try{y=await KL.fromText(e,{title:r.title})}catch(t){if(i.suppressErrorRendering)throw u(),t;y=await KL.fromText("error"),v=t}const x=d.select(h).node(),b=y.type,w=x.firstChild,k=w.firstChild,T=y.renderer.getClasses?.(e,y),_=dN(i,b,T,a),E=document.createElement("style");E.innerHTML=_,w.insertBefore(E,k);try{await y.renderer.draw(e,t,"11.4.1",y)}catch(n){throw i.suppressErrorRendering?u():VA.draw(e,t,"11.4.1"),n}const C=d.select(`${h} svg`),S=y.db.getAccTitle?.(),A=y.db.getAccDescription?.();wN(b,C,S,A),d.select(`[id="${t}"]`).selectAll("foreignobject > *").attr("xmlns","http://www.w3.org/1999/xhtml");let L=d.select(h).node().innerHTML;if(m.debug("config.arrowMarkerAbsolute",i.arrowMarkerAbsolute),L=pN(L,p,dn(i.arrowMarkerAbsolute)),p){const t=d.select(h+" svg").node();L=gN(L,t)}else g||(L=Ze.sanitize(L,{ADD_TAGS:sN,ADD_ATTR:oN,HTML_INTEGRATION_POINTS:{foreignobject:!0}}));if(QL(),v)throw v;return u(),{diagramType:b,svg:L,bindFunctions:y.db.bindFunctions}}),"render");function xN(t={}){const e=L({},t);e?.fontFamily&&!e.themeVariables?.fontFamily&&(e.themeVariables||(e.themeVariables={}),e.themeVariables.fontFamily=e.fontFamily),Ot(e),e?.theme&&e.theme in wt?e.themeVariables=wt[e.theme].getThemeVariables(e.themeVariables):e&&(e.themeVariables=wt.default.getThemeVariables(e.themeVariables));const n="object"==typeof e?Dt(e):Bt();y(n.logLevel),oL()}s(xN,"initialize");var bN=s(((t,e={})=>{const{code:n}=iN(t);return KL.fromText(n,e)}),"getDiagramFromText");function wN(t,e,n,r){VL(e,t),XL(e,n,r,e.attr("id"))}s(wN,"addA11yInfo");var kN=Object.freeze({render:vN,parse:cN,getDiagramFromText:bN,initialize:xN,getConfig:Ft,setConfig:$t,getSiteConfig:Bt,updateSiteConfig:Pt,reset:s((()=>{Gt()}),"reset"),globalReset:s((()=>{Gt(Lt)}),"globalReset"),defaultConfig:Lt});y(Ft().logLevel),Gt(Ft());var TN=s(((t,e,n)=>{m.warn(t),pk(t)?(n&&n(t.str,t.hash),e.push({...t,message:t.str,error:t})):(n&&n(t),t instanceof Error&&e.push({str:t.message,message:t.message,hash:t.name,error:t}))}),"handleError"),_N=s((async function(t={querySelector:".mermaid"}){try{await EN(t)}catch(e){if(pk(e)&&m.error(e.str),PN.parseError&&PN.parseError(e),!t.suppressErrors)throw m.error("Use the suppressErrors option to suppress these errors"),e}}),"run"),EN=s((async function({postRenderCallback:t,querySelector:e,nodes:n}={querySelector:".mermaid"}){const r=kN.getConfig();let i;if(m.debug((t?"":"No ")+"Callback function found"),n)i=n;else{if(!e)throw new Error("Nodes and querySelector are both undefined");i=document.querySelectorAll(e)}m.debug(`Found ${i.length} diagrams`),void 0!==r?.startOnLoad&&(m.debug("Start On Load: "+r?.startOnLoad),kN.updateSiteConfig({startOnLoad:r?.startOnLoad}));const a=new yk.InitIDGenerator(r.deterministicIds,r.deterministicIDSeed);let s;const o=[];for(const e of Array.from(i)){if(m.info("Rendering diagram: "+e.id),e.getAttribute("data-processed"))continue;e.setAttribute("data-processed","true");const n=`mermaid-${a.next()}`;s=e.innerHTML,s=kk(yk.entityDecode(s)).trim().replace(/<br\s*\/?>/gi,"<br/>");const r=yk.detectInit(s);r&&m.debug("Detected early reinit: ",r);try{const{svg:r,bindFunctions:i}=await ON(n,s,e);e.innerHTML=r,t&&await t(n),i&&i(e)}catch(t){TN(t,o,PN.parseError)}}if(o.length>0)throw o[0]}),"runThrowsErrors"),CN=s((function(t){kN.initialize(t)}),"initialize"),SN=s((async function(t,e,n){m.warn("mermaid.init is deprecated. Please use run instead."),t&&CN(t);const r={postRenderCallback:n,querySelector:".mermaid"};"string"==typeof e?r.querySelector=e:e&&(e instanceof HTMLElement?r.nodes=[e]:r.nodes=e),await _N(r)}),"init"),AN=s((async(t,{lazyLoad:e=!0}={})=>{oL(),E(...t),!1===e&&await lL()}),"registerExternalDiagrams"),LN=s((function(){if(PN.startOnLoad){const{startOnLoad:t}=kN.getConfig();t&&PN.run().catch((t=>m.error("Mermaid failed to initialize",t)))}}),"contentLoaded");"undefined"!=typeof document&&window.addEventListener("load",LN,!1);var NN=s((function(t){PN.parseError=t}),"setParseErrorHandler"),IN=[],MN=!1,RN=s((async()=>{if(!MN){for(MN=!0;IN.length>0;){const t=IN.shift();if(t)try{await t()}catch(t){m.error("Error executing queue",t)}}MN=!1}}),"executeQueue"),DN=s((async(t,e)=>new Promise(((n,r)=>{const i=s((()=>new Promise(((i,a)=>{kN.parse(t,e).then((t=>{i(t),n(t)}),(t=>{m.error("Error parsing",t),PN.parseError?.(t),a(t),r(t)}))}))),"performCall");IN.push(i),RN().catch(r)}))),"parse"),ON=s(((t,e,n)=>new Promise(((r,i)=>{const a=s((()=>new Promise(((a,s)=>{kN.render(t,e,n).then((t=>{a(t),r(t)}),(t=>{m.error("Error parsing",t),PN.parseError?.(t),s(t),i(t)}))}))),"performCall");IN.push(a),RN().catch(i)}))),"render"),PN={startOnLoad:!0,mermaidAPI:kN,parse:DN,render:ON,init:SN,run:_N,registerExternalDiagrams:AN,registerLayoutLoaders:tA,initialize:CN,parseError:void 0,contentLoaded:LN,setParseErrorHandler:NN,detectType:_,registerIconPacks:ky},BN=PN;function $N(t){let{beforeRender:e,afterRender:n}=t;return function(t){
/*! Check if previously processed */
/*!
* Wait for document loaded before starting the execution
*/
/*!
* reveal.js Mermaid plugin
*/
return async function(t){let{el:e,beforeRender:n,afterRender:r}=t;if(!1===await(null==n?void 0:n(e)))return;const i=e.textContent.trim();try{const{svg:t}=await BN.render(`mermaid-${Math.random().toString(36).substring(2)}`,i);e.innerHTML=t,await(null==r?void 0:r(e))}catch(t){let n="";null!=t&&t.str&&(n=t.str),null!=t&&t.message&&(n=t.message),console.error(n,{error:t,graphDefinition:i,el:e}),e.innerHTML=n}}({el:t,beforeRender:e,afterRender:n})}}const FN={id:"mermaid",init:function(t){const{...e}=t.getConfig().mermaid||{},{...n}=t.getConfig().mermaidPlugin||{},r=$N({beforeRender:n.beforeRender,afterRender:n.afterRender});BN.initialize({startOnLoad:!1,...e});const i=t.getRevealElement().querySelectorAll(".mermaid");Array.from(i).forEach((function(t){r(t)}))}};var zN=()=>FN,UN=class t{static{s(this,"SourceLocation")}constructor(t,e,n){this.lexer=void 0,this.start=void 0,this.end=void 0,this.lexer=t,this.start=e,this.end=n}static range(e,n){return n?e&&e.loc&&n.loc&&e.loc.lexer===n.loc.lexer?new t(e.loc.lexer,e.loc.start,n.loc.end):null:e&&e.loc}},GN=class t{static{s(this,"Token")}constructor(t,e){this.text=void 0,this.loc=void 0,this.noexpand=void 0,this.treatAsRelax=void 0,this.text=t,this.loc=e}range(e,n){return new t(n,UN.range(this,e))}},qN=class t{static{s(this,"ParseError")}constructor(e,n){this.name=void 0,this.position=void 0,this.length=void 0,this.rawMessage=void 0;var r,i,a="KaTeX parse error: "+e,s=n&&n.loc;if(s&&s.start<=s.end){var o=s.lexer.input;r=s.start,i=s.end,r===o.length?a+=" at end of input: ":a+=" at position "+(r+1)+": ";var l=o.slice(r,i).replace(/[^]/g,"$&̲");a+=(r>15?"…"+o.slice(r-15,r):o.slice(0,r))+l+(i+15<o.length?o.slice(i,i+15)+"…":o.slice(i))}var c=new Error(a);return c.name="ParseError",c.__proto__=t.prototype,c.position=r,null!=r&&null!=i&&(c.length=i-r),c.rawMessage=e,c}};qN.prototype.__proto__=Error.prototype;var jN=s((function(t,e){return-1!==t.indexOf(e)}),"contains"),YN=s((function(t,e){return void 0===t?e:t}),"deflt"),WN=/([A-Z])/g,HN=s((function(t){return t.replace(WN,"-$1").toLowerCase()}),"hyphenate"),VN={"&":"&amp;",">":"&gt;","<":"&lt;",'"':"&quot;","'":"&#x27;"},XN=/[&><"']/g;function KN(t){return String(t).replace(XN,(t=>VN[t]))}s(KN,"escape");var ZN=s((function t(e){return"ordgroup"===e.type||"color"===e.type?1===e.body.length?t(e.body[0]):e:"font"===e.type?t(e.body):e}),"getBaseElem"),QN=s((function(t){var e=ZN(t);return"mathord"===e.type||"textord"===e.type||"atom"===e.type}),"isCharacterBox"),JN=s((function(t){if(!t)throw new Error("Expected non-null, but got "+String(t));return t}),"assert"),tI={contains:jN,deflt:YN,escape:KN,hyphenate:HN,getBaseElem:ZN,isCharacterBox:QN,protocolFromUrl:s((function(t){var e=/^[\x00-\x20]*([^\\/#?]*?)(:|&#0*58|&#x0*3a|&colon)/i.exec(t);return e?":"!==e[2]?null:/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(e[1])?e[1].toLowerCase():null:"_relative"}),"protocolFromUrl")},eI={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:s((t=>"#"+t),"cliProcessor")},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:s(((t,e)=>(e.push(t),e)),"cliProcessor")},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:s((t=>Math.max(0,t)),"processor"),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:s((t=>Math.max(0,t)),"processor"),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:s((t=>Math.max(0,t)),"processor"),cli:"-e, --max-expand <n>",cliProcessor:s((t=>"Infinity"===t?1/0:parseInt(t)),"cliProcessor")},globalGroup:{type:"boolean",cli:!1}};function nI(t){if(t.default)return t.default;var e=t.type,n=Array.isArray(e)?e[0]:e;if("string"!=typeof n)return n.enum[0];switch(n){case"boolean":return!1;case"string":return"";case"number":return 0;case"object":return{}}}s(nI,"getDefaultValue");var rI=class{static{s(this,"Settings")}constructor(t){for(var e in 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,t=t||{},eI)if(eI.hasOwnProperty(e)){var n=eI[e];this[e]=void 0!==t[e]?n.processor?n.processor(t[e]):t[e]:nI(n)}}reportNonstrict(t,e,n){var r=this.strict;if("function"==typeof r&&(r=r(t,e,n)),r&&"ignore"!==r){if(!0===r||"error"===r)throw new qN("LaTeX-incompatible input and strict mode is set to 'error': "+e+" ["+t+"]",n);"warn"===r?"undefined"!=typeof console&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+e+" ["+t+"]"):"undefined"!=typeof console&&console.warn("LaTeX-incompatible input and strict mode is set to unrecognized '"+r+"': "+e+" ["+t+"]")}}useStrictBehavior(t,e,n){var r=this.strict;if("function"==typeof r)try{r=r(t,e,n)}catch(t){r="error"}return!(!r||"ignore"===r)&&(!0===r||"error"===r||("warn"===r?("undefined"!=typeof console&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+e+" ["+t+"]"),!1):("undefined"!=typeof console&&console.warn("LaTeX-incompatible input and strict mode is set to unrecognized '"+r+"': "+e+" ["+t+"]"),!1)))}isTrusted(t){if(t.url&&!t.protocol){var e=tI.protocolFromUrl(t.url);if(null==e)return!1;t.protocol=e}var n="function"==typeof this.trust?this.trust(t):this.trust;return Boolean(n)}},iI=class{static{s(this,"Style")}constructor(t,e,n){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=t,this.size=e,this.cramped=n}sup(){return aI[sI[this.id]]}sub(){return aI[oI[this.id]]}fracNum(){return aI[lI[this.id]]}fracDen(){return aI[cI[this.id]]}cramp(){return aI[hI[this.id]]}text(){return aI[uI[this.id]]}isTight(){return this.size>=2}},aI=[new iI(0,0,!1),new iI(1,0,!0),new iI(2,1,!1),new iI(3,1,!0),new iI(4,2,!1),new iI(5,2,!0),new iI(6,3,!1),new iI(7,3,!0)],sI=[4,5,4,5,6,7,6,7],oI=[5,5,5,5,7,7,7,7],lI=[2,3,4,5,6,7,6,7],cI=[3,3,5,5,7,7,7,7],hI=[1,1,3,3,5,5,7,7],uI=[0,1,2,3,2,3,2,3],dI={DISPLAY:aI[0],TEXT:aI[2],SCRIPT:aI[4],SCRIPTSCRIPT:aI[6]},pI=[{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 gI(t){for(var e=0;e<pI.length;e++)for(var n=pI[e],r=0;r<n.blocks.length;r++){var i=n.blocks[r];if(t>=i[0]&&t<=i[1])return n.name}return null}s(gI,"scriptFromCodepoint");var fI=[];function mI(t){for(var e=0;e<fI.length;e+=2)if(t>=fI[e]&&t<=fI[e+1])return!0;return!1}pI.forEach((t=>t.blocks.forEach((t=>fI.push(...t))))),s(mI,"supportedCodepoint");var yI=s((function(t,e){return"M95,"+(622+t+e)+"\nc-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14\nc0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54\nc44.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\ns173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429\nc69,-144,104.5,-217.7,106.5,-221\nl"+t/2.075+" -"+t+"\nc5.3,-9.3,12,-14,20,-14\nH400000v"+(40+t)+"H845.2724\ns-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7\nc-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z\nM"+(834+t)+" "+e+"h400000v"+(40+t)+"h-400000z"}),"sqrtMain"),vI=s((function(t,e){return"M263,"+(601+t+e)+"c0.7,0,18,39.7,52,119\nc34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120\nc340,-704.7,510.7,-1060.3,512,-1067\nl"+t/2.084+" -"+t+"\nc4.7,-7.3,11,-11,19,-11\nH40000v"+(40+t)+"H1012.3\ns-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5,232\nc-22.3,46.7,-33.8,70.3,-34.5,71c-4.7,4.7,-12.3,7,-23,7s-12,-1,-12,-1\ns-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26\nc-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z\nM"+(1001+t)+" "+e+"h400000v"+(40+t)+"h-400000z"}),"sqrtSize1"),xI=s((function(t,e){return"M983 "+(10+t+e)+"\nl"+t/3.13+" -"+t+"\nc4,-6.7,10,-10,18,-10 H400000v"+(40+t)+"\nH1013.1s-83.4,268,-264.1,840c-180.7,572,-277,876.3,-289,913c-4.7,4.7,-12.7,7,-24,7\ns-12,0,-12,0c-1.3,-3.3,-3.7,-11.7,-7,-25c-35.3,-125.3,-106.7,-373.3,-214,-744\nc-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30\nc26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722\nc56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5\nc53.7,-170.3,84.5,-266.8,92.5,-289.5z\nM"+(1001+t)+" "+e+"h400000v"+(40+t)+"h-400000z"}),"sqrtSize2"),bI=s((function(t,e){return"M424,"+(2398+t+e)+"\nc-1.3,-0.7,-38.5,-172,-111.5,-514c-73,-342,-109.8,-513.3,-110.5,-514\nc0,-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\ns-5,7,-5,7c-4,-3.3,-8.3,-7.7,-13,-13s-13,-13,-13,-13s76,-122,76,-122s77,-121,77,-121\ns209,968,209,968c0,-2,84.7,-361.7,254,-1079c169.3,-717.3,254.7,-1077.7,256,-1081\nl"+t/4.223+" -"+t+"c4,-6.7,10,-10,18,-10 H400000\nv"+(40+t)+"H1014.6\ns-87.3,378.7,-272.6,1166c-185.3,787.3,-279.3,1182.3,-282,1185\nc-2,6,-10,9,-24,9\nc-8,0,-12,-0.7,-12,-2z M"+(1001+t)+" "+e+"\nh400000v"+(40+t)+"h-400000z"}),"sqrtSize3"),wI=s((function(t,e){return"M473,"+(2713+t+e)+"\nc339.3,-1799.3,509.3,-2700,510,-2702 l"+t/5.298+" -"+t+"\nc3.3,-7.3,9.3,-11,18,-11 H400000v"+(40+t)+"H1017.7\ns-90.5,478,-276.2,1466c-185.7,988,-279.5,1483,-281.5,1485c-2,6,-10,9,-24,9\nc-8,0,-12,-0.7,-12,-2c0,-1.3,-5.3,-32,-16,-92c-50.7,-293.3,-119.7,-693.3,-207,-1200\nc0,-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\ns76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104,\n606zM"+(1001+t)+" "+e+"h400000v"+(40+t)+"H1017.7z"}),"sqrtSize4"),kI=s((function(t){return"M400000 "+t+" H0 L"+t/2+" 0 l65 45 L145 "+(t-80)+" H400000z"}),"phasePath"),TI=s((function(t,e,n){return"M702 "+(t+e)+"H400000"+(40+t)+"\nH742v"+(n-54-e-t)+"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\nh-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170\nc-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667\n219 661 l218 661zM702 "+e+"H400000v"+(40+t)+"H742z"}),"sqrtTall"),_I=s((function(t,e,n){e*=1e3;var r="";switch(t){case"sqrtMain":r=yI(e,80);break;case"sqrtSize1":r=vI(e,80);break;case"sqrtSize2":r=xI(e,80);break;case"sqrtSize3":r=bI(e,80);break;case"sqrtSize4":r=wI(e,80);break;case"sqrtTall":r=TI(e,80,n)}return r}),"sqrtPath"),EI=s((function(t,e){switch(t){case"⎜":return"M291 0 H417 V"+e+" H291z M291 0 H417 V"+e+" H291z";case"∣":return"M145 0 H188 V"+e+" H145z M145 0 H188 V"+e+" H145z";case"∥":return"M145 0 H188 V"+e+" H145z M145 0 H188 V"+e+" H145zM367 0 H410 V"+e+" H367z M367 0 H410 V"+e+" H367z";case"⎟":return"M457 0 H583 V"+e+" H457z M457 0 H583 V"+e+" H457z";case"⎢":return"M319 0 H403 V"+e+" H319z M319 0 H403 V"+e+" H319z";case"⎥":return"M263 0 H347 V"+e+" H263z M263 0 H347 V"+e+" H263z";case"⎪":return"M384 0 H504 V"+e+" H384z M384 0 H504 V"+e+" H384z";case"⏐":return"M312 0 H355 V"+e+" H312z M312 0 H355 V"+e+" H312z";case"‖":return"M257 0 H300 V"+e+" H257z M257 0 H300 V"+e+" H257zM478 0 H521 V"+e+" H478z M478 0 H521 V"+e+" H478z";default:return""}}),"innerPath"),CI={doubleleftarrow:"M262 157\nl10-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\n 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\n 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\nc2 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\n 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\n-86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.7\n-2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z\nm8 0v40h399730v-40zm0 194v40h399730v-40z",doublerightarrow:"M399738 392l\n-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\n 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\n-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\n-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\n-13h-6c-12 .7-18 4-18 10 0 2 1.7 7 5 15 23.3 46 52 87 86 123l10 10H0v40h399782\nc-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\n-107 64l-10 8H0v40zM0 157v40h399730v-40zm0 194v40h399730v-40z",leftarrow:"M400000 241H110l3-3c68.7-52.7 113.7-120\n 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\n-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\nc-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\n 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\n 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\n l-3-3h399890zM100 241v40h399900v-40z",leftbrace:"M6 548l-6-6v-35l6-11c56-104 135.3-181.3 238-232 57.3-28.7 117\n-45 179-50h399577v120H403c-43.3 7-81 15-113 26-100.7 33-179.7 91-237 174-2.7\n 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\n 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\n 0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7\n-331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z",leftgroup:"M400000 80\nH435C64 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\n 435 0h399565z",leftgroupunder:"M400000 262\nH435C64 262 168.3 112.6 21 82c-5.9-1.2-18 0-18 0-2 0-3 1-3 3v38c76 158 257 219\n 435 219h399565z",leftharpoon:"M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3\n-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\n-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\n-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\n 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\n-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\n-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40zM0 435v40h400000v-40z\nm0 0v40h400000v-40z",leftharpoondown:"M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 2 11s5.333\n 5.333 12 10c90.667 54 156 130 196 228 3.333 10.667 6.333 16.333 9 17 2 .667 5\n 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\n-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\n 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\n-2 18-6 2-2.7 1-9.7-3-21-32-87.3-82.7-157.7-152-211l-3-3h399907v-40H7zm93 0\nv40h399900v-40zM0 241v40h399900v-40zm0 0v40h399900v-40z",lefthook:"M400000 281 H103s-33-11.2-61-33.5S0 197.3 0 164s14.2-61.2 42.5\n-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\n-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\n 71.5 23h399859zM103 281v-40h399897v40z",leftlinesegment:"M40 281 V428 H0 V94 H40 V241 H400000 v40z\nM40 281 V428 H0 V94 H40 V241 H400000 v40z",leftmapsto:"M40 281 V448H0V74H40V241H400000v40z\nM40 281 V448H0V74H40V241H400000v40z",leftToFrom:"M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23\n-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69-70-101l-7-8h399905v-40H95l7-8\nc28.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\n 68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z",longequal:"M0 50 h400000 v40H0z m0 194h40000v40H0z\nM0 50 h400000 v40H0z m0 194h40000v40H0z",midbrace:"M200428 334\nc-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\n-53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7\n 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\n 12 44.7 59.3 101.3 106.3 170 141s145.3 54.3 229 60h199572v120z",midbraceunder:"M199572 214\nc100.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\n 53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3\n 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\n-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\n-320.3 177.6S193.1 320.6 193.1 249.8c0-71.4 46.9-178.2 319.5-178.2z\nm368.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\n60.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\n-451.1 228.8-386.3 0-452.7-137.5-452.7-228.8 0-92.4 66.4-230 452.7-230z\nm502.4 230c0-111.2-82.4-277.2-502.4-277.2s-504 166-504 277.2\nc0 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\n-480.5 177.6S202.1 320.6 202.1 249.8c0-71.4 70.5-178.2 479.3-178.2z\nm525.8 178.2c0-86.4-86.8-215.4-525.7-215.4-437.9 0-524.7 129-524.7 215.4 0\n85.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\n-707.8 275.8-606 0-710.2-165.8-710.2-275.8C311 218.8 415.2 53 1021.2 53z\nm770.4 277.1c0-131.2-126.4-327.6-770.5-327.6S248.4 198.9 248.4 330.1\nc0 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\n-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\n 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\n 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\n-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\n-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\n 151.7 139 205zm0 0v40h399900v-40z",rightbrace:"M400000 542l\n-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\ns-117.2-55.8-184.5-66.5c-.7 0-2-.3-4-1-18.7-2.7-76-4.3-172-5H0V214h399571l6 1\nc124.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\n 28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237\n-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\n 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\n 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\n-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\n-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\n 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\n-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\n 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\nm0 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\n 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\n-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\n-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\n 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\n 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\n-64.7 57-92 95-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 435v40h399900v-40z\nm0-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\n 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\n-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\n 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\nM399960 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\n 1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32\n-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\n-167z M100 147v40h399900v-40zM0 341v40h399900v-40z",twoheadleftarrow:"M0 167c68 40\n 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\n-70-101l-7-8h125l9 7c50.7 39.3 85 86 103 140h46c0-4.7-6.3-18.7-19-42-18-35.3\n-40-67.3-66-96l-9-9h399716v-40H284l9-9c26-28.7 48-60.7 66-96 12.7-23.333 19\n-37.333 19-42h-46c-18 54-52.3 100.7-103 140l-9 7H95l7-8c28.7-32 52-65.7 70-101\n 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\nc-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\n 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\n 18 35.3 40 67.3 66 96l9 9H0v40h399716l-9 9c-26 28.7-48 60.7-66 96-12.7 23.333\n-19 37.333-19 42h46c18-54 52.3-100.7 103-140l9-7h125l-7 8c-28.7 32-52 65.7-70\n 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\n-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\n 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\n 4.35-2 7.613-5 9.788l-19 13.05c-92 63.077-116.937 75.308-183 76.128\n-68.267.847-113-73.952-191-73.952z",tilde2:"M344 55.266c-142 0-300.638 81.316-311.5 86.418\n-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\n 31.9 283 0 358 0c148 0 188 122 331 122s314-97 326-97c4 0 8 2 10 7l7 21.114\nc1 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\n 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\n-11-10.37L.15 138c-1-7 3-12 10-13l19.2-6.4C378.4 40.7 634.3 0 804.3 0c337 0\n 411.8 157 746.8 157 328 0 754-112 773-112 5 0 10 3 11 9l1 14.075c1 8.066-.697\n 16.595-6.697 17.492l-21.052 7.31c-367.9 98.146-609.15 122.696-778.15 122.696\n -338 0-409-156.573-744-156.573z",tilde4:"M786 58C457 58 32 177.487 13 177.487c-6 0-10-3.345\n-11-10.035L.15 143c-1-7 3-12 10-13l22-6.7C381.2 35 637.15 0 807.15 0c337 0 409\n 177 744 177 328 0 754-127 773-127 5 0 10 3 11 9l1 14.794c1 7.805-3 13.38-9\n 14.495l-20.7 5.574c-366.85 99.79-607.3 139.372-776.3 139.372-338 0-409\n -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\n3.333 2.667 6.667 9 10 19 6.667 24.667 20.333 43.667 41 57 7.333 4.667 11\n10.667 11 18 0 6-1 10-3 12s-6.667 5-14 9c-28.667 14.667-53.667 35.667-75 63\n-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\n-7 1c-4.667 0-9.167-1.833-13.5-5.5S337 184 337 178c0-12.667 15.667-32.333 47-59\nH213l-171-1c-8.667-6-13-12.333-13-19 0-4.667 4.333-11.333 13-20h359\nc-16-25.333-24-45-24-59z",widehat1:"M529 0h5l519 115c5 1 9 5 9 10 0 1-1 2-1 3l-4 22\nc-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\n-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\n-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\n-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,\n-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,\n-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,\n-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,\n-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\nc4 -14.7 6 -23 6 -25c0 -7.3 -7 -11 -21 -11c-8 0 -13.2 0.8 -15.5 2.5\nc-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\ns-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\n121.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\ns2.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\nc0 -2 -2 -10.3 -6 -25c-20 -79.3 -65 -146.7 -135 -202l-3 -3h399890z\nM100 620v40h399900v-40z M0 241v40h399900v-40zM0 241v40h399900v-40z",rightarrowabovebar:"M0 241v40h399891c-47.3 35.3-84 78-110 128-16.7 32\n-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\n13.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\n-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\n-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\n-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\n151.7 139 205zm96 379h399894v40H0zm0 0h399904v40H0z",baraboveshortleftharpoon:"M507,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11\nc1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17\nc2,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\nc-32,-87.3,-82.7,-157.7,-152,-211c0,0,-3,-3,-3,-3l399351,0l0,-40\nc-398570,0,-399437,0,-399437,0z M593 435 v40 H399500 v-40z\nM0 281 v-40 H399908 v40z M0 281 v-40 H399908 v40z",rightharpoonaboveshortbar:"M0,241 l0,40c399126,0,399993,0,399993,0\nc4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,\n-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\nc-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\nM0 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\nc1.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,\n1c0,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,\n-152,-211c0,0,-3,-3,-3,-3l399907,0l0,-40c-399126,0,-399993,0,-399993,0z\nM93 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\nc4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,\n-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\nc-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\nM500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z"},SI=s((function(t,e){switch(t){case"lbrack":return"M403 1759 V84 H666 V0 H319 V1759 v"+e+" v1759 h347 v-84\nH403z M403 1759 V0 H319 V1759 v"+e+" v1759 h84z";case"rbrack":return"M347 1759 V0 H0 V84 H263 V1759 v"+e+" v1759 H0 v84 H347z\nM347 1759 V0 H263 V1759 v"+e+" v1759 h84z";case"vert":return"M145 15 v585 v"+e+" v585 c2.667,10,9.667,15,21,15\nc10,0,16.667,-5,20,-15 v-585 v"+-e+" v-585 c-2.667,-10,-9.667,-15,-21,-15\nc-10,0,-16.667,5,-20,15z M188 15 H145 v585 v"+e+" v585 h43z";case"doublevert":return"M145 15 v585 v"+e+" v585 c2.667,10,9.667,15,21,15\nc10,0,16.667,-5,20,-15 v-585 v"+-e+" v-585 c-2.667,-10,-9.667,-15,-21,-15\nc-10,0,-16.667,5,-20,15z M188 15 H145 v585 v"+e+" v585 h43z\nM367 15 v585 v"+e+" v585 c2.667,10,9.667,15,21,15\nc10,0,16.667,-5,20,-15 v-585 v"+-e+" v-585 c-2.667,-10,-9.667,-15,-21,-15\nc-10,0,-16.667,5,-20,15z M410 15 H367 v585 v"+e+" v585 h43z";case"lfloor":return"M319 602 V0 H403 V602 v"+e+" v1715 h263 v84 H319z\nMM319 602 V0 H403 V602 v"+e+" v1715 H319z";case"rfloor":return"M319 602 V0 H403 V602 v"+e+" v1799 H0 v-84 H319z\nMM319 602 V0 H403 V602 v"+e+" v1715 H319z";case"lceil":return"M403 1759 V84 H666 V0 H319 V1759 v"+e+" v602 h84z\nM403 1759 V0 H319 V1759 v"+e+" v602 h84z";case"rceil":return"M347 1759 V0 H0 V84 H263 V1759 v"+e+" v602 h84z\nM347 1759 V0 h-84 V1759 v"+e+" 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\nc-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,\n-36,557 l0,"+(e+84)+"c0.2,6,0,26,0,60c2,159.3,10,310.7,24,454c53.3,528,210,\n949.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\nc0,-2.7,-3.3,-8.7,-10,-18c-135.3,-192.7,-235.5,-414.3,-300.5,-665c-65,-250.7,-102.5,\n-544.7,-112.5,-882c-2,-104,-3,-167,-3,-189\nl0,-"+(e+92)+"c0,-162.7,5.7,-314,17,-454c20.7,-272,63.7,-513,129,-723c65.3,\n-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,\n63,95c96.7,156.7,172.8,332.5,228.5,527.5c55.7,195,92.8,416.5,111.5,664.5\nc11.3,139.3,17,290.7,17,454c0,28,1.7,43,3.3,45l0,"+(e+9)+"\nc-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\nc-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\nc0,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\nc242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558\nl0,-"+(e+144)+"c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7,\n-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.")}}),"tallDelim"),AI=class{static{s(this,"DocumentFragment")}constructor(t){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=t,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(t){return tI.contains(this.classes,t)}toNode(){for(var t=document.createDocumentFragment(),e=0;e<this.children.length;e++)t.appendChild(this.children[e].toNode());return t}toMarkup(){for(var t="",e=0;e<this.children.length;e++)t+=this.children[e].toMarkup();return t}toText(){var t=s((t=>t.toText()),"toText");return this.children.map(t).join("")}},LI={"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]}},NI={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]},II={"Å":"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 MI(t,e){LI[t]=e}function RI(t,e,n){if(!LI[e])throw new Error("Font metrics not found for font: "+e+".");var r=t.charCodeAt(0),i=LI[e][r];if(!i&&t[0]in II&&(r=II[t[0]].charCodeAt(0),i=LI[e][r]),i||"text"!==n||mI(r)&&(i=LI[e][77]),i)return{depth:i[0],height:i[1],italic:i[2],skew:i[3],width:i[4]}}s(MI,"setFontMetrics"),s(RI,"getCharacterMetrics");var DI={};function OI(t){var e;if(!DI[e=t>=5?0:t>=3?1:2]){var n=DI[e]={cssEmPerMu:NI.quad[e]/18};for(var r in NI)NI.hasOwnProperty(r)&&(n[r]=NI[r][e])}return DI[e]}s(OI,"getGlobalMetrics");var PI=[[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]],BI=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],$I=s((function(t,e){return e.size<2?t:PI[t-1][e.size-1]}),"sizeAtStyle"),FI=class t{static{s(this,"Options")}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||t.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=BI[this.size-1],this.maxSize=e.maxSize,this.minRuleThickness=e.minRuleThickness,this._fontMetrics=void 0}extend(e){var n={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 r in e)e.hasOwnProperty(r)&&(n[r]=e[r]);return new t(n)}havingStyle(t){return this.style===t?this:this.extend({style:t,size:$I(this.textSize,t)})}havingCrampedStyle(){return this.havingStyle(this.style.cramp())}havingSize(t){return this.size===t&&this.textSize===t?this:this.extend({style:this.style.text(),size:t,textSize:t,sizeMultiplier:BI[t-1]})}havingBaseStyle(e){e=e||this.style.text();var n=$I(t.BASESIZE,e);return this.size===n&&this.textSize===t.BASESIZE&&this.style===e?this:this.extend({style:e,size:n})}havingBaseSizing(){var t;switch(this.style.id){case 4:case 5:t=3;break;case 6:case 7:t=1;break;default:t=6}return this.extend({style:this.style.text(),size:t})}withColor(t){return this.extend({color:t})}withPhantom(){return this.extend({phantom:!0})}withFont(t){return this.extend({font:t})}withTextFontFamily(t){return this.extend({fontFamily:t,font:""})}withTextFontWeight(t){return this.extend({fontWeight:t,font:""})}withTextFontShape(t){return this.extend({fontShape:t,font:""})}sizingClasses(t){return t.size!==this.size?["sizing","reset-size"+t.size,"size"+this.size]:[]}baseSizingClasses(){return this.size!==t.BASESIZE?["sizing","reset-size"+this.size,"size"+t.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=OI(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}};FI.BASESIZE=6;var zI={pt:1,mm:7227/2540,cm:7227/254,in:72.27,bp:1.00375,pc:12,dd:1238/1157,cc:14856/1157,nd:685/642,nc:1370/107,sp:1/65536,px:1.00375},UI={ex:!0,em:!0,mu:!0},GI=s((function(t){return"string"!=typeof t&&(t=t.unit),t in zI||t in UI||"ex"===t}),"validUnit"),qI=s((function(t,e){var n;if(t.unit in zI)n=zI[t.unit]/e.fontMetrics().ptPerEm/e.sizeMultiplier;else if("mu"===t.unit)n=e.fontMetrics().cssEmPerMu;else{var r;if(r=e.style.isTight()?e.havingStyle(e.style.text()):e,"ex"===t.unit)n=r.fontMetrics().xHeight;else{if("em"!==t.unit)throw new qN("Invalid unit: '"+t.unit+"'");n=r.fontMetrics().quad}r!==e&&(n*=r.sizeMultiplier/e.sizeMultiplier)}return Math.min(t.number*n,e.maxSize)}),"calculateSize"),jI=s((function(t){return+t.toFixed(4)+"em"}),"makeEm"),YI=s((function(t){return t.filter((t=>t)).join(" ")}),"createClass"),WI=s((function(t,e,n){if(this.classes=t||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=n||{},e){e.style.isTight()&&this.classes.push("mtight");var r=e.getColor();r&&(this.style.color=r)}}),"initNode"),HI=s((function(t){var e=document.createElement(t);for(var n in e.className=YI(this.classes),this.style)this.style.hasOwnProperty(n)&&(e.style[n]=this.style[n]);for(var r in this.attributes)this.attributes.hasOwnProperty(r)&&e.setAttribute(r,this.attributes[r]);for(var i=0;i<this.children.length;i++)e.appendChild(this.children[i].toNode());return e}),"toNode"),VI=s((function(t){var e="<"+t;this.classes.length&&(e+=' class="'+tI.escape(YI(this.classes))+'"');var n="";for(var r in this.style)this.style.hasOwnProperty(r)&&(n+=tI.hyphenate(r)+":"+this.style[r]+";");for(var i in n&&(e+=' style="'+tI.escape(n)+'"'),this.attributes)this.attributes.hasOwnProperty(i)&&(e+=" "+i+'="'+tI.escape(this.attributes[i])+'"');e+=">";for(var a=0;a<this.children.length;a++)e+=this.children[a].toMarkup();return e+="</"+t+">"}),"toMarkup"),XI=class{static{s(this,"Span")}constructor(t,e,n,r){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,WI.call(this,t,n,r),this.children=e||[]}setAttribute(t,e){this.attributes[t]=e}hasClass(t){return tI.contains(this.classes,t)}toNode(){return HI.call(this,"span")}toMarkup(){return VI.call(this,"span")}},KI=class{static{s(this,"Anchor")}constructor(t,e,n,r){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,WI.call(this,e,r),this.children=n||[],this.setAttribute("href",t)}setAttribute(t,e){this.attributes[t]=e}hasClass(t){return tI.contains(this.classes,t)}toNode(){return HI.call(this,"a")}toMarkup(){return VI.call(this,"a")}},ZI=class{static{s(this,"Img")}constructor(t,e,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=e,this.src=t,this.classes=["mord"],this.style=n}hasClass(t){return tI.contains(this.classes,t)}toNode(){var t=document.createElement("img");for(var e in t.src=this.src,t.alt=this.alt,t.className="mord",this.style)this.style.hasOwnProperty(e)&&(t.style[e]=this.style[e]);return t}toMarkup(){var t='<img src="'+tI.escape(this.src)+'" alt="'+tI.escape(this.alt)+'"',e="";for(var n in this.style)this.style.hasOwnProperty(n)&&(e+=tI.hyphenate(n)+":"+this.style[n]+";");return e&&(t+=' style="'+tI.escape(e)+'"'),t+="'/>"}},QI={"î":"ı̂","ï":"ı̈","í":"ı́","ì":"ı̀"},JI=class{static{s(this,"SymbolNode")}constructor(t,e,n,r,i,a,s,o){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=t,this.height=e||0,this.depth=n||0,this.italic=r||0,this.skew=i||0,this.width=a||0,this.classes=s||[],this.style=o||{},this.maxFontSize=0;var l=gI(this.text.charCodeAt(0));l&&this.classes.push(l+"_fallback"),/[îïíì]/.test(this.text)&&(this.text=QI[this.text])}hasClass(t){return tI.contains(this.classes,t)}toNode(){var t=document.createTextNode(this.text),e=null;for(var n in this.italic>0&&((e=document.createElement("span")).style.marginRight=jI(this.italic)),this.classes.length>0&&((e=e||document.createElement("span")).className=YI(this.classes)),this.style)this.style.hasOwnProperty(n)&&((e=e||document.createElement("span")).style[n]=this.style[n]);return e?(e.appendChild(t),e):t}toMarkup(){var t=!1,e="<span";this.classes.length&&(t=!0,e+=' class="',e+=tI.escape(YI(this.classes)),e+='"');var n="";for(var r in this.italic>0&&(n+="margin-right:"+this.italic+"em;"),this.style)this.style.hasOwnProperty(r)&&(n+=tI.hyphenate(r)+":"+this.style[r]+";");n&&(t=!0,e+=' style="'+tI.escape(n)+'"');var i=tI.escape(this.text);return t?(e+=">",e+=i,e+="</span>"):i}},tM=class{static{s(this,"SvgNode")}constructor(t,e){this.children=void 0,this.attributes=void 0,this.children=t||[],this.attributes=e||{}}toNode(){var t=document.createElementNS("http://www.w3.org/2000/svg","svg");for(var e in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,e)&&t.setAttribute(e,this.attributes[e]);for(var n=0;n<this.children.length;n++)t.appendChild(this.children[n].toNode());return t}toMarkup(){var t='<svg xmlns="http://www.w3.org/2000/svg"';for(var e in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,e)&&(t+=" "+e+'="'+tI.escape(this.attributes[e])+'"');t+=">";for(var n=0;n<this.children.length;n++)t+=this.children[n].toMarkup();return t+="</svg>"}},eM=class{static{s(this,"PathNode")}constructor(t,e){this.pathName=void 0,this.alternate=void 0,this.pathName=t,this.alternate=e}toNode(){var t=document.createElementNS("http://www.w3.org/2000/svg","path");return this.alternate?t.setAttribute("d",this.alternate):t.setAttribute("d",CI[this.pathName]),t}toMarkup(){return this.alternate?'<path d="'+tI.escape(this.alternate)+'"/>':'<path d="'+tI.escape(CI[this.pathName])+'"/>'}},nM=class{static{s(this,"LineNode")}constructor(t){this.attributes=void 0,this.attributes=t||{}}toNode(){var t=document.createElementNS("http://www.w3.org/2000/svg","line");for(var e in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,e)&&t.setAttribute(e,this.attributes[e]);return t}toMarkup(){var t="<line";for(var e in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,e)&&(t+=" "+e+'="'+tI.escape(this.attributes[e])+'"');return t+="/>"}};function rM(t){if(t instanceof JI)return t;throw new Error("Expected symbolNode but got "+String(t)+".")}function iM(t){if(t instanceof XI)return t;throw new Error("Expected span<HtmlDomNode> but got "+String(t)+".")}s(rM,"assertSymbolDomNode"),s(iM,"assertSpan");var aM={bin:1,close:1,inner:1,open:1,punct:1,rel:1},sM={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1},oM={math:{},text:{}};function lM(t,e,n,r,i,a){oM[t][i]={font:e,group:n,replace:r},a&&r&&(oM[t][r]=oM[t][i])}s(lM,"defineSymbol");var cM="math",hM="text",uM="main",dM="ams",pM="accent-token",gM="bin",fM="close",mM="mathord",yM="op-token",vM="open",xM="rel",bM="textord";lM(cM,uM,xM,"≡","\\equiv",!0),lM(cM,uM,xM,"≺","\\prec",!0),lM(cM,uM,xM,"≻","\\succ",!0),lM(cM,uM,xM,"∼","\\sim",!0),lM(cM,uM,xM,"⊥","\\perp"),lM(cM,uM,xM,"⪯","\\preceq",!0),lM(cM,uM,xM,"⪰","\\succeq",!0),lM(cM,uM,xM,"≃","\\simeq",!0),lM(cM,uM,xM,"∣","\\mid",!0),lM(cM,uM,xM,"≪","\\ll",!0),lM(cM,uM,xM,"≫","\\gg",!0),lM(cM,uM,xM,"≍","\\asymp",!0),lM(cM,uM,xM,"∥","\\parallel"),lM(cM,uM,xM,"⋈","\\bowtie",!0),lM(cM,uM,xM,"⌣","\\smile",!0),lM(cM,uM,xM,"⊑","\\sqsubseteq",!0),lM(cM,uM,xM,"⊒","\\sqsupseteq",!0),lM(cM,uM,xM,"≐","\\doteq",!0),lM(cM,uM,xM,"⌢","\\frown",!0),lM(cM,uM,xM,"∋","\\ni",!0),lM(cM,uM,xM,"∝","\\propto",!0),lM(cM,uM,xM,"⊢","\\vdash",!0),lM(cM,uM,xM,"⊣","\\dashv",!0),lM(cM,uM,xM,"∋","\\owns"),lM(cM,uM,"punct",".","\\ldotp"),lM(cM,uM,"punct","⋅","\\cdotp"),lM(cM,uM,bM,"#","\\#"),lM(hM,uM,bM,"#","\\#"),lM(cM,uM,bM,"&","\\&"),lM(hM,uM,bM,"&","\\&"),lM(cM,uM,bM,"ℵ","\\aleph",!0),lM(cM,uM,bM,"∀","\\forall",!0),lM(cM,uM,bM,"ℏ","\\hbar",!0),lM(cM,uM,bM,"∃","\\exists",!0),lM(cM,uM,bM,"∇","\\nabla",!0),lM(cM,uM,bM,"♭","\\flat",!0),lM(cM,uM,bM,"ℓ","\\ell",!0),lM(cM,uM,bM,"♮","\\natural",!0),lM(cM,uM,bM,"♣","\\clubsuit",!0),lM(cM,uM,bM,"℘","\\wp",!0),lM(cM,uM,bM,"♯","\\sharp",!0),lM(cM,uM,bM,"♢","\\diamondsuit",!0),lM(cM,uM,bM,"ℜ","\\Re",!0),lM(cM,uM,bM,"♡","\\heartsuit",!0),lM(cM,uM,bM,"ℑ","\\Im",!0),lM(cM,uM,bM,"♠","\\spadesuit",!0),lM(cM,uM,bM,"§","\\S",!0),lM(hM,uM,bM,"§","\\S"),lM(cM,uM,bM,"¶","\\P",!0),lM(hM,uM,bM,"¶","\\P"),lM(cM,uM,bM,"†","\\dag"),lM(hM,uM,bM,"†","\\dag"),lM(hM,uM,bM,"†","\\textdagger"),lM(cM,uM,bM,"‡","\\ddag"),lM(hM,uM,bM,"‡","\\ddag"),lM(hM,uM,bM,"‡","\\textdaggerdbl"),lM(cM,uM,fM,"⎱","\\rmoustache",!0),lM(cM,uM,vM,"⎰","\\lmoustache",!0),lM(cM,uM,fM,"⟯","\\rgroup",!0),lM(cM,uM,vM,"⟮","\\lgroup",!0),lM(cM,uM,gM,"∓","\\mp",!0),lM(cM,uM,gM,"⊖","\\ominus",!0),lM(cM,uM,gM,"⊎","\\uplus",!0),lM(cM,uM,gM,"⊓","\\sqcap",!0),lM(cM,uM,gM,"∗","\\ast"),lM(cM,uM,gM,"⊔","\\sqcup",!0),lM(cM,uM,gM,"◯","\\bigcirc",!0),lM(cM,uM,gM,"∙","\\bullet",!0),lM(cM,uM,gM,"‡","\\ddagger"),lM(cM,uM,gM,"≀","\\wr",!0),lM(cM,uM,gM,"⨿","\\amalg"),lM(cM,uM,gM,"&","\\And"),lM(cM,uM,xM,"⟵","\\longleftarrow",!0),lM(cM,uM,xM,"⇐","\\Leftarrow",!0),lM(cM,uM,xM,"⟸","\\Longleftarrow",!0),lM(cM,uM,xM,"⟶","\\longrightarrow",!0),lM(cM,uM,xM,"⇒","\\Rightarrow",!0),lM(cM,uM,xM,"⟹","\\Longrightarrow",!0),lM(cM,uM,xM,"↔","\\leftrightarrow",!0),lM(cM,uM,xM,"⟷","\\longleftrightarrow",!0),lM(cM,uM,xM,"⇔","\\Leftrightarrow",!0),lM(cM,uM,xM,"⟺","\\Longleftrightarrow",!0),lM(cM,uM,xM,"↦","\\mapsto",!0),lM(cM,uM,xM,"⟼","\\longmapsto",!0),lM(cM,uM,xM,"↗","\\nearrow",!0),lM(cM,uM,xM,"↩","\\hookleftarrow",!0),lM(cM,uM,xM,"↪","\\hookrightarrow",!0),lM(cM,uM,xM,"↘","\\searrow",!0),lM(cM,uM,xM,"↼","\\leftharpoonup",!0),lM(cM,uM,xM,"⇀","\\rightharpoonup",!0),lM(cM,uM,xM,"↙","\\swarrow",!0),lM(cM,uM,xM,"↽","\\leftharpoondown",!0),lM(cM,uM,xM,"⇁","\\rightharpoondown",!0),lM(cM,uM,xM,"↖","\\nwarrow",!0),lM(cM,uM,xM,"⇌","\\rightleftharpoons",!0),lM(cM,dM,xM,"≮","\\nless",!0),lM(cM,dM,xM,"","\\@nleqslant"),lM(cM,dM,xM,"","\\@nleqq"),lM(cM,dM,xM,"⪇","\\lneq",!0),lM(cM,dM,xM,"≨","\\lneqq",!0),lM(cM,dM,xM,"","\\@lvertneqq"),lM(cM,dM,xM,"⋦","\\lnsim",!0),lM(cM,dM,xM,"⪉","\\lnapprox",!0),lM(cM,dM,xM,"⊀","\\nprec",!0),lM(cM,dM,xM,"⋠","\\npreceq",!0),lM(cM,dM,xM,"⋨","\\precnsim",!0),lM(cM,dM,xM,"⪹","\\precnapprox",!0),lM(cM,dM,xM,"≁","\\nsim",!0),lM(cM,dM,xM,"","\\@nshortmid"),lM(cM,dM,xM,"∤","\\nmid",!0),lM(cM,dM,xM,"⊬","\\nvdash",!0),lM(cM,dM,xM,"⊭","\\nvDash",!0),lM(cM,dM,xM,"⋪","\\ntriangleleft"),lM(cM,dM,xM,"⋬","\\ntrianglelefteq",!0),lM(cM,dM,xM,"⊊","\\subsetneq",!0),lM(cM,dM,xM,"","\\@varsubsetneq"),lM(cM,dM,xM,"⫋","\\subsetneqq",!0),lM(cM,dM,xM,"","\\@varsubsetneqq"),lM(cM,dM,xM,"≯","\\ngtr",!0),lM(cM,dM,xM,"","\\@ngeqslant"),lM(cM,dM,xM,"","\\@ngeqq"),lM(cM,dM,xM,"⪈","\\gneq",!0),lM(cM,dM,xM,"≩","\\gneqq",!0),lM(cM,dM,xM,"","\\@gvertneqq"),lM(cM,dM,xM,"⋧","\\gnsim",!0),lM(cM,dM,xM,"⪊","\\gnapprox",!0),lM(cM,dM,xM,"⊁","\\nsucc",!0),lM(cM,dM,xM,"⋡","\\nsucceq",!0),lM(cM,dM,xM,"⋩","\\succnsim",!0),lM(cM,dM,xM,"⪺","\\succnapprox",!0),lM(cM,dM,xM,"≆","\\ncong",!0),lM(cM,dM,xM,"","\\@nshortparallel"),lM(cM,dM,xM,"∦","\\nparallel",!0),lM(cM,dM,xM,"⊯","\\nVDash",!0),lM(cM,dM,xM,"⋫","\\ntriangleright"),lM(cM,dM,xM,"⋭","\\ntrianglerighteq",!0),lM(cM,dM,xM,"","\\@nsupseteqq"),lM(cM,dM,xM,"⊋","\\supsetneq",!0),lM(cM,dM,xM,"","\\@varsupsetneq"),lM(cM,dM,xM,"⫌","\\supsetneqq",!0),lM(cM,dM,xM,"","\\@varsupsetneqq"),lM(cM,dM,xM,"⊮","\\nVdash",!0),lM(cM,dM,xM,"⪵","\\precneqq",!0),lM(cM,dM,xM,"⪶","\\succneqq",!0),lM(cM,dM,xM,"","\\@nsubseteqq"),lM(cM,dM,gM,"⊴","\\unlhd"),lM(cM,dM,gM,"⊵","\\unrhd"),lM(cM,dM,xM,"↚","\\nleftarrow",!0),lM(cM,dM,xM,"↛","\\nrightarrow",!0),lM(cM,dM,xM,"⇍","\\nLeftarrow",!0),lM(cM,dM,xM,"⇏","\\nRightarrow",!0),lM(cM,dM,xM,"↮","\\nleftrightarrow",!0),lM(cM,dM,xM,"⇎","\\nLeftrightarrow",!0),lM(cM,dM,xM,"△","\\vartriangle"),lM(cM,dM,bM,"ℏ","\\hslash"),lM(cM,dM,bM,"▽","\\triangledown"),lM(cM,dM,bM,"◊","\\lozenge"),lM(cM,dM,bM,"Ⓢ","\\circledS"),lM(cM,dM,bM,"®","\\circledR"),lM(hM,dM,bM,"®","\\circledR"),lM(cM,dM,bM,"∡","\\measuredangle",!0),lM(cM,dM,bM,"∄","\\nexists"),lM(cM,dM,bM,"℧","\\mho"),lM(cM,dM,bM,"Ⅎ","\\Finv",!0),lM(cM,dM,bM,"⅁","\\Game",!0),lM(cM,dM,bM,"‵","\\backprime"),lM(cM,dM,bM,"▲","\\blacktriangle"),lM(cM,dM,bM,"▼","\\blacktriangledown"),lM(cM,dM,bM,"■","\\blacksquare"),lM(cM,dM,bM,"⧫","\\blacklozenge"),lM(cM,dM,bM,"★","\\bigstar"),lM(cM,dM,bM,"∢","\\sphericalangle",!0),lM(cM,dM,bM,"∁","\\complement",!0),lM(cM,dM,bM,"ð","\\eth",!0),lM(hM,uM,bM,"ð","ð"),lM(cM,dM,bM,"╱","\\diagup"),lM(cM,dM,bM,"╲","\\diagdown"),lM(cM,dM,bM,"□","\\square"),lM(cM,dM,bM,"□","\\Box"),lM(cM,dM,bM,"◊","\\Diamond"),lM(cM,dM,bM,"¥","\\yen",!0),lM(hM,dM,bM,"¥","\\yen",!0),lM(cM,dM,bM,"✓","\\checkmark",!0),lM(hM,dM,bM,"✓","\\checkmark"),lM(cM,dM,bM,"ℶ","\\beth",!0),lM(cM,dM,bM,"ℸ","\\daleth",!0),lM(cM,dM,bM,"ℷ","\\gimel",!0),lM(cM,dM,bM,"ϝ","\\digamma",!0),lM(cM,dM,bM,"ϰ","\\varkappa"),lM(cM,dM,vM,"┌","\\@ulcorner",!0),lM(cM,dM,fM,"┐","\\@urcorner",!0),lM(cM,dM,vM,"└","\\@llcorner",!0),lM(cM,dM,fM,"┘","\\@lrcorner",!0),lM(cM,dM,xM,"≦","\\leqq",!0),lM(cM,dM,xM,"⩽","\\leqslant",!0),lM(cM,dM,xM,"⪕","\\eqslantless",!0),lM(cM,dM,xM,"≲","\\lesssim",!0),lM(cM,dM,xM,"⪅","\\lessapprox",!0),lM(cM,dM,xM,"≊","\\approxeq",!0),lM(cM,dM,gM,"⋖","\\lessdot"),lM(cM,dM,xM,"⋘","\\lll",!0),lM(cM,dM,xM,"≶","\\lessgtr",!0),lM(cM,dM,xM,"⋚","\\lesseqgtr",!0),lM(cM,dM,xM,"⪋","\\lesseqqgtr",!0),lM(cM,dM,xM,"≑","\\doteqdot"),lM(cM,dM,xM,"≓","\\risingdotseq",!0),lM(cM,dM,xM,"≒","\\fallingdotseq",!0),lM(cM,dM,xM,"∽","\\backsim",!0),lM(cM,dM,xM,"⋍","\\backsimeq",!0),lM(cM,dM,xM,"⫅","\\subseteqq",!0),lM(cM,dM,xM,"⋐","\\Subset",!0),lM(cM,dM,xM,"⊏","\\sqsubset",!0),lM(cM,dM,xM,"≼","\\preccurlyeq",!0),lM(cM,dM,xM,"⋞","\\curlyeqprec",!0),lM(cM,dM,xM,"≾","\\precsim",!0),lM(cM,dM,xM,"⪷","\\precapprox",!0),lM(cM,dM,xM,"⊲","\\vartriangleleft"),lM(cM,dM,xM,"⊴","\\trianglelefteq"),lM(cM,dM,xM,"⊨","\\vDash",!0),lM(cM,dM,xM,"⊪","\\Vvdash",!0),lM(cM,dM,xM,"⌣","\\smallsmile"),lM(cM,dM,xM,"⌢","\\smallfrown"),lM(cM,dM,xM,"≏","\\bumpeq",!0),lM(cM,dM,xM,"≎","\\Bumpeq",!0),lM(cM,dM,xM,"≧","\\geqq",!0),lM(cM,dM,xM,"⩾","\\geqslant",!0),lM(cM,dM,xM,"⪖","\\eqslantgtr",!0),lM(cM,dM,xM,"≳","\\gtrsim",!0),lM(cM,dM,xM,"⪆","\\gtrapprox",!0),lM(cM,dM,gM,"⋗","\\gtrdot"),lM(cM,dM,xM,"⋙","\\ggg",!0),lM(cM,dM,xM,"≷","\\gtrless",!0),lM(cM,dM,xM,"⋛","\\gtreqless",!0),lM(cM,dM,xM,"⪌","\\gtreqqless",!0),lM(cM,dM,xM,"≖","\\eqcirc",!0),lM(cM,dM,xM,"≗","\\circeq",!0),lM(cM,dM,xM,"≜","\\triangleq",!0),lM(cM,dM,xM,"∼","\\thicksim"),lM(cM,dM,xM,"≈","\\thickapprox"),lM(cM,dM,xM,"⫆","\\supseteqq",!0),lM(cM,dM,xM,"⋑","\\Supset",!0),lM(cM,dM,xM,"⊐","\\sqsupset",!0),lM(cM,dM,xM,"≽","\\succcurlyeq",!0),lM(cM,dM,xM,"⋟","\\curlyeqsucc",!0),lM(cM,dM,xM,"≿","\\succsim",!0),lM(cM,dM,xM,"⪸","\\succapprox",!0),lM(cM,dM,xM,"⊳","\\vartriangleright"),lM(cM,dM,xM,"⊵","\\trianglerighteq"),lM(cM,dM,xM,"⊩","\\Vdash",!0),lM(cM,dM,xM,"∣","\\shortmid"),lM(cM,dM,xM,"∥","\\shortparallel"),lM(cM,dM,xM,"≬","\\between",!0),lM(cM,dM,xM,"⋔","\\pitchfork",!0),lM(cM,dM,xM,"∝","\\varpropto"),lM(cM,dM,xM,"◀","\\blacktriangleleft"),lM(cM,dM,xM,"∴","\\therefore",!0),lM(cM,dM,xM,"∍","\\backepsilon"),lM(cM,dM,xM,"▶","\\blacktriangleright"),lM(cM,dM,xM,"∵","\\because",!0),lM(cM,dM,xM,"⋘","\\llless"),lM(cM,dM,xM,"⋙","\\gggtr"),lM(cM,dM,gM,"⊲","\\lhd"),lM(cM,dM,gM,"⊳","\\rhd"),lM(cM,dM,xM,"≂","\\eqsim",!0),lM(cM,uM,xM,"⋈","\\Join"),lM(cM,dM,xM,"≑","\\Doteq",!0),lM(cM,dM,gM,"∔","\\dotplus",!0),lM(cM,dM,gM,"∖","\\smallsetminus"),lM(cM,dM,gM,"⋒","\\Cap",!0),lM(cM,dM,gM,"⋓","\\Cup",!0),lM(cM,dM,gM,"⩞","\\doublebarwedge",!0),lM(cM,dM,gM,"⊟","\\boxminus",!0),lM(cM,dM,gM,"⊞","\\boxplus",!0),lM(cM,dM,gM,"⋇","\\divideontimes",!0),lM(cM,dM,gM,"⋉","\\ltimes",!0),lM(cM,dM,gM,"⋊","\\rtimes",!0),lM(cM,dM,gM,"⋋","\\leftthreetimes",!0),lM(cM,dM,gM,"⋌","\\rightthreetimes",!0),lM(cM,dM,gM,"⋏","\\curlywedge",!0),lM(cM,dM,gM,"⋎","\\curlyvee",!0),lM(cM,dM,gM,"⊝","\\circleddash",!0),lM(cM,dM,gM,"⊛","\\circledast",!0),lM(cM,dM,gM,"⋅","\\centerdot"),lM(cM,dM,gM,"⊺","\\intercal",!0),lM(cM,dM,gM,"⋒","\\doublecap"),lM(cM,dM,gM,"⋓","\\doublecup"),lM(cM,dM,gM,"⊠","\\boxtimes",!0),lM(cM,dM,xM,"⇢","\\dashrightarrow",!0),lM(cM,dM,xM,"⇠","\\dashleftarrow",!0),lM(cM,dM,xM,"⇇","\\leftleftarrows",!0),lM(cM,dM,xM,"⇆","\\leftrightarrows",!0),lM(cM,dM,xM,"⇚","\\Lleftarrow",!0),lM(cM,dM,xM,"↞","\\twoheadleftarrow",!0),lM(cM,dM,xM,"↢","\\leftarrowtail",!0),lM(cM,dM,xM,"↫","\\looparrowleft",!0),lM(cM,dM,xM,"⇋","\\leftrightharpoons",!0),lM(cM,dM,xM,"↶","\\curvearrowleft",!0),lM(cM,dM,xM,"↺","\\circlearrowleft",!0),lM(cM,dM,xM,"↰","\\Lsh",!0),lM(cM,dM,xM,"⇈","\\upuparrows",!0),lM(cM,dM,xM,"↿","\\upharpoonleft",!0),lM(cM,dM,xM,"⇃","\\downharpoonleft",!0),lM(cM,uM,xM,"⊶","\\origof",!0),lM(cM,uM,xM,"⊷","\\imageof",!0),lM(cM,dM,xM,"⊸","\\multimap",!0),lM(cM,dM,xM,"↭","\\leftrightsquigarrow",!0),lM(cM,dM,xM,"⇉","\\rightrightarrows",!0),lM(cM,dM,xM,"⇄","\\rightleftarrows",!0),lM(cM,dM,xM,"↠","\\twoheadrightarrow",!0),lM(cM,dM,xM,"↣","\\rightarrowtail",!0),lM(cM,dM,xM,"↬","\\looparrowright",!0),lM(cM,dM,xM,"↷","\\curvearrowright",!0),lM(cM,dM,xM,"↻","\\circlearrowright",!0),lM(cM,dM,xM,"↱","\\Rsh",!0),lM(cM,dM,xM,"⇊","\\downdownarrows",!0),lM(cM,dM,xM,"↾","\\upharpoonright",!0),lM(cM,dM,xM,"⇂","\\downharpoonright",!0),lM(cM,dM,xM,"⇝","\\rightsquigarrow",!0),lM(cM,dM,xM,"⇝","\\leadsto"),lM(cM,dM,xM,"⇛","\\Rrightarrow",!0),lM(cM,dM,xM,"↾","\\restriction"),lM(cM,uM,bM,"‘","`"),lM(cM,uM,bM,"$","\\$"),lM(hM,uM,bM,"$","\\$"),lM(hM,uM,bM,"$","\\textdollar"),lM(cM,uM,bM,"%","\\%"),lM(hM,uM,bM,"%","\\%"),lM(cM,uM,bM,"_","\\_"),lM(hM,uM,bM,"_","\\_"),lM(hM,uM,bM,"_","\\textunderscore"),lM(cM,uM,bM,"∠","\\angle",!0),lM(cM,uM,bM,"∞","\\infty",!0),lM(cM,uM,bM,"′","\\prime"),lM(cM,uM,bM,"△","\\triangle"),lM(cM,uM,bM,"Γ","\\Gamma",!0),lM(cM,uM,bM,"Δ","\\Delta",!0),lM(cM,uM,bM,"Θ","\\Theta",!0),lM(cM,uM,bM,"Λ","\\Lambda",!0),lM(cM,uM,bM,"Ξ","\\Xi",!0),lM(cM,uM,bM,"Π","\\Pi",!0),lM(cM,uM,bM,"Σ","\\Sigma",!0),lM(cM,uM,bM,"Υ","\\Upsilon",!0),lM(cM,uM,bM,"Φ","\\Phi",!0),lM(cM,uM,bM,"Ψ","\\Psi",!0),lM(cM,uM,bM,"Ω","\\Omega",!0),lM(cM,uM,bM,"A","Α"),lM(cM,uM,bM,"B","Β"),lM(cM,uM,bM,"E","Ε"),lM(cM,uM,bM,"Z","Ζ"),lM(cM,uM,bM,"H","Η"),lM(cM,uM,bM,"I","Ι"),lM(cM,uM,bM,"K","Κ"),lM(cM,uM,bM,"M","Μ"),lM(cM,uM,bM,"N","Ν"),lM(cM,uM,bM,"O","Ο"),lM(cM,uM,bM,"P","Ρ"),lM(cM,uM,bM,"T","Τ"),lM(cM,uM,bM,"X","Χ"),lM(cM,uM,bM,"¬","\\neg",!0),lM(cM,uM,bM,"¬","\\lnot"),lM(cM,uM,bM,"⊤","\\top"),lM(cM,uM,bM,"⊥","\\bot"),lM(cM,uM,bM,"∅","\\emptyset"),lM(cM,dM,bM,"∅","\\varnothing"),lM(cM,uM,mM,"α","\\alpha",!0),lM(cM,uM,mM,"β","\\beta",!0),lM(cM,uM,mM,"γ","\\gamma",!0),lM(cM,uM,mM,"δ","\\delta",!0),lM(cM,uM,mM,"ϵ","\\epsilon",!0),lM(cM,uM,mM,"ζ","\\zeta",!0),lM(cM,uM,mM,"η","\\eta",!0),lM(cM,uM,mM,"θ","\\theta",!0),lM(cM,uM,mM,"ι","\\iota",!0),lM(cM,uM,mM,"κ","\\kappa",!0),lM(cM,uM,mM,"λ","\\lambda",!0),lM(cM,uM,mM,"μ","\\mu",!0),lM(cM,uM,mM,"ν","\\nu",!0),lM(cM,uM,mM,"ξ","\\xi",!0),lM(cM,uM,mM,"ο","\\omicron",!0),lM(cM,uM,mM,"π","\\pi",!0),lM(cM,uM,mM,"ρ","\\rho",!0),lM(cM,uM,mM,"σ","\\sigma",!0),lM(cM,uM,mM,"τ","\\tau",!0),lM(cM,uM,mM,"υ","\\upsilon",!0),lM(cM,uM,mM,"ϕ","\\phi",!0),lM(cM,uM,mM,"χ","\\chi",!0),lM(cM,uM,mM,"ψ","\\psi",!0),lM(cM,uM,mM,"ω","\\omega",!0),lM(cM,uM,mM,"ε","\\varepsilon",!0),lM(cM,uM,mM,"ϑ","\\vartheta",!0),lM(cM,uM,mM,"ϖ","\\varpi",!0),lM(cM,uM,mM,"ϱ","\\varrho",!0),lM(cM,uM,mM,"ς","\\varsigma",!0),lM(cM,uM,mM,"φ","\\varphi",!0),lM(cM,uM,gM,"∗","*",!0),lM(cM,uM,gM,"+","+"),lM(cM,uM,gM,"−","-",!0),lM(cM,uM,gM,"⋅","\\cdot",!0),lM(cM,uM,gM,"∘","\\circ",!0),lM(cM,uM,gM,"÷","\\div",!0),lM(cM,uM,gM,"±","\\pm",!0),lM(cM,uM,gM,"×","\\times",!0),lM(cM,uM,gM,"∩","\\cap",!0),lM(cM,uM,gM,"∪","\\cup",!0),lM(cM,uM,gM,"∖","\\setminus",!0),lM(cM,uM,gM,"∧","\\land"),lM(cM,uM,gM,"∨","\\lor"),lM(cM,uM,gM,"∧","\\wedge",!0),lM(cM,uM,gM,"∨","\\vee",!0),lM(cM,uM,bM,"√","\\surd"),lM(cM,uM,vM,"⟨","\\langle",!0),lM(cM,uM,vM,"∣","\\lvert"),lM(cM,uM,vM,"∥","\\lVert"),lM(cM,uM,fM,"?","?"),lM(cM,uM,fM,"!","!"),lM(cM,uM,fM,"⟩","\\rangle",!0),lM(cM,uM,fM,"∣","\\rvert"),lM(cM,uM,fM,"∥","\\rVert"),lM(cM,uM,xM,"=","="),lM(cM,uM,xM,":",":"),lM(cM,uM,xM,"≈","\\approx",!0),lM(cM,uM,xM,"≅","\\cong",!0),lM(cM,uM,xM,"≥","\\ge"),lM(cM,uM,xM,"≥","\\geq",!0),lM(cM,uM,xM,"←","\\gets"),lM(cM,uM,xM,">","\\gt",!0),lM(cM,uM,xM,"∈","\\in",!0),lM(cM,uM,xM,"","\\@not"),lM(cM,uM,xM,"⊂","\\subset",!0),lM(cM,uM,xM,"⊃","\\supset",!0),lM(cM,uM,xM,"⊆","\\subseteq",!0),lM(cM,uM,xM,"⊇","\\supseteq",!0),lM(cM,dM,xM,"⊈","\\nsubseteq",!0),lM(cM,dM,xM,"⊉","\\nsupseteq",!0),lM(cM,uM,xM,"⊨","\\models"),lM(cM,uM,xM,"←","\\leftarrow",!0),lM(cM,uM,xM,"≤","\\le"),lM(cM,uM,xM,"≤","\\leq",!0),lM(cM,uM,xM,"<","\\lt",!0),lM(cM,uM,xM,"→","\\rightarrow",!0),lM(cM,uM,xM,"→","\\to"),lM(cM,dM,xM,"≱","\\ngeq",!0),lM(cM,dM,xM,"≰","\\nleq",!0),lM(cM,uM,"spacing"," ","\\ "),lM(cM,uM,"spacing"," ","\\space"),lM(cM,uM,"spacing"," ","\\nobreakspace"),lM(hM,uM,"spacing"," ","\\ "),lM(hM,uM,"spacing"," "," "),lM(hM,uM,"spacing"," ","\\space"),lM(hM,uM,"spacing"," ","\\nobreakspace"),lM(cM,uM,"spacing",null,"\\nobreak"),lM(cM,uM,"spacing",null,"\\allowbreak"),lM(cM,uM,"punct",",",","),lM(cM,uM,"punct",";",";"),lM(cM,dM,gM,"⊼","\\barwedge",!0),lM(cM,dM,gM,"⊻","\\veebar",!0),lM(cM,uM,gM,"⊙","\\odot",!0),lM(cM,uM,gM,"⊕","\\oplus",!0),lM(cM,uM,gM,"⊗","\\otimes",!0),lM(cM,uM,bM,"∂","\\partial",!0),lM(cM,uM,gM,"⊘","\\oslash",!0),lM(cM,dM,gM,"⊚","\\circledcirc",!0),lM(cM,dM,gM,"⊡","\\boxdot",!0),lM(cM,uM,gM,"△","\\bigtriangleup"),lM(cM,uM,gM,"▽","\\bigtriangledown"),lM(cM,uM,gM,"†","\\dagger"),lM(cM,uM,gM,"⋄","\\diamond"),lM(cM,uM,gM,"⋆","\\star"),lM(cM,uM,gM,"◃","\\triangleleft"),lM(cM,uM,gM,"▹","\\triangleright"),lM(cM,uM,vM,"{","\\{"),lM(hM,uM,bM,"{","\\{"),lM(hM,uM,bM,"{","\\textbraceleft"),lM(cM,uM,fM,"}","\\}"),lM(hM,uM,bM,"}","\\}"),lM(hM,uM,bM,"}","\\textbraceright"),lM(cM,uM,vM,"{","\\lbrace"),lM(cM,uM,fM,"}","\\rbrace"),lM(cM,uM,vM,"[","\\lbrack",!0),lM(hM,uM,bM,"[","\\lbrack",!0),lM(cM,uM,fM,"]","\\rbrack",!0),lM(hM,uM,bM,"]","\\rbrack",!0),lM(cM,uM,vM,"(","\\lparen",!0),lM(cM,uM,fM,")","\\rparen",!0),lM(hM,uM,bM,"<","\\textless",!0),lM(hM,uM,bM,">","\\textgreater",!0),lM(cM,uM,vM,"⌊","\\lfloor",!0),lM(cM,uM,fM,"⌋","\\rfloor",!0),lM(cM,uM,vM,"⌈","\\lceil",!0),lM(cM,uM,fM,"⌉","\\rceil",!0),lM(cM,uM,bM,"\\","\\backslash"),lM(cM,uM,bM,"∣","|"),lM(cM,uM,bM,"∣","\\vert"),lM(hM,uM,bM,"|","\\textbar",!0),lM(cM,uM,bM,"∥","\\|"),lM(cM,uM,bM,"∥","\\Vert"),lM(hM,uM,bM,"∥","\\textbardbl"),lM(hM,uM,bM,"~","\\textasciitilde"),lM(hM,uM,bM,"\\","\\textbackslash"),lM(hM,uM,bM,"^","\\textasciicircum"),lM(cM,uM,xM,"↑","\\uparrow",!0),lM(cM,uM,xM,"⇑","\\Uparrow",!0),lM(cM,uM,xM,"↓","\\downarrow",!0),lM(cM,uM,xM,"⇓","\\Downarrow",!0),lM(cM,uM,xM,"↕","\\updownarrow",!0),lM(cM,uM,xM,"⇕","\\Updownarrow",!0),lM(cM,uM,yM,"∐","\\coprod"),lM(cM,uM,yM,"⋁","\\bigvee"),lM(cM,uM,yM,"⋀","\\bigwedge"),lM(cM,uM,yM,"⨄","\\biguplus"),lM(cM,uM,yM,"⋂","\\bigcap"),lM(cM,uM,yM,"⋃","\\bigcup"),lM(cM,uM,yM,"∫","\\int"),lM(cM,uM,yM,"∫","\\intop"),lM(cM,uM,yM,"∬","\\iint"),lM(cM,uM,yM,"∭","\\iiint"),lM(cM,uM,yM,"∏","\\prod"),lM(cM,uM,yM,"∑","\\sum"),lM(cM,uM,yM,"⨂","\\bigotimes"),lM(cM,uM,yM,"⨁","\\bigoplus"),lM(cM,uM,yM,"⨀","\\bigodot"),lM(cM,uM,yM,"∮","\\oint"),lM(cM,uM,yM,"∯","\\oiint"),lM(cM,uM,yM,"∰","\\oiiint"),lM(cM,uM,yM,"⨆","\\bigsqcup"),lM(cM,uM,yM,"∫","\\smallint"),lM(hM,uM,"inner","…","\\textellipsis"),lM(cM,uM,"inner","…","\\mathellipsis"),lM(hM,uM,"inner","…","\\ldots",!0),lM(cM,uM,"inner","…","\\ldots",!0),lM(cM,uM,"inner","⋯","\\@cdots",!0),lM(cM,uM,"inner","⋱","\\ddots",!0),lM(cM,uM,bM,"⋮","\\varvdots"),lM(cM,uM,pM,"ˊ","\\acute"),lM(cM,uM,pM,"ˋ","\\grave"),lM(cM,uM,pM,"¨","\\ddot"),lM(cM,uM,pM,"~","\\tilde"),lM(cM,uM,pM,"ˉ","\\bar"),lM(cM,uM,pM,"˘","\\breve"),lM(cM,uM,pM,"ˇ","\\check"),lM(cM,uM,pM,"^","\\hat"),lM(cM,uM,pM,"⃗","\\vec"),lM(cM,uM,pM,"˙","\\dot"),lM(cM,uM,pM,"˚","\\mathring"),lM(cM,uM,mM,"","\\@imath"),lM(cM,uM,mM,"","\\@jmath"),lM(cM,uM,bM,"ı","ı"),lM(cM,uM,bM,"ȷ","ȷ"),lM(hM,uM,bM,"ı","\\i",!0),lM(hM,uM,bM,"ȷ","\\j",!0),lM(hM,uM,bM,"ß","\\ss",!0),lM(hM,uM,bM,"æ","\\ae",!0),lM(hM,uM,bM,"œ","\\oe",!0),lM(hM,uM,bM,"ø","\\o",!0),lM(hM,uM,bM,"Æ","\\AE",!0),lM(hM,uM,bM,"Œ","\\OE",!0),lM(hM,uM,bM,"Ø","\\O",!0),lM(hM,uM,pM,"ˊ","\\'"),lM(hM,uM,pM,"ˋ","\\`"),lM(hM,uM,pM,"ˆ","\\^"),lM(hM,uM,pM,"˜","\\~"),lM(hM,uM,pM,"ˉ","\\="),lM(hM,uM,pM,"˘","\\u"),lM(hM,uM,pM,"˙","\\."),lM(hM,uM,pM,"¸","\\c"),lM(hM,uM,pM,"˚","\\r"),lM(hM,uM,pM,"ˇ","\\v"),lM(hM,uM,pM,"¨",'\\"'),lM(hM,uM,pM,"˝","\\H"),lM(hM,uM,pM,"◯","\\textcircled");var wM={"--":!0,"---":!0,"``":!0,"''":!0};lM(hM,uM,bM,"–","--",!0),lM(hM,uM,bM,"–","\\textendash"),lM(hM,uM,bM,"—","---",!0),lM(hM,uM,bM,"—","\\textemdash"),lM(hM,uM,bM,"‘","`",!0),lM(hM,uM,bM,"‘","\\textquoteleft"),lM(hM,uM,bM,"’","'",!0),lM(hM,uM,bM,"’","\\textquoteright"),lM(hM,uM,bM,"“","``",!0),lM(hM,uM,bM,"“","\\textquotedblleft"),lM(hM,uM,bM,"”","''",!0),lM(hM,uM,bM,"”","\\textquotedblright"),lM(cM,uM,bM,"°","\\degree",!0),lM(hM,uM,bM,"°","\\degree"),lM(hM,uM,bM,"°","\\textdegree",!0),lM(cM,uM,bM,"£","\\pounds"),lM(cM,uM,bM,"£","\\mathsterling",!0),lM(hM,uM,bM,"£","\\pounds"),lM(hM,uM,bM,"£","\\textsterling",!0),lM(cM,dM,bM,"✠","\\maltese"),lM(hM,dM,bM,"✠","\\maltese");var kM,TM;for(TM=0;TM<'0123456789/@."'.length;TM++)lM(cM,uM,bM,kM='0123456789/@."'.charAt(TM),kM);var _M,EM;for(EM=0;EM<'0123456789!@*()-=+";:?/.,'.length;EM++)lM(hM,uM,bM,_M='0123456789!@*()-=+";:?/.,'.charAt(EM),_M);var CM,SM,AM="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";for(SM=0;SM<AM.length;SM++)lM(cM,uM,mM,CM=AM.charAt(SM),CM),lM(hM,uM,bM,CM,CM);lM(cM,dM,bM,"C","ℂ"),lM(hM,dM,bM,"C","ℂ"),lM(cM,dM,bM,"H","ℍ"),lM(hM,dM,bM,"H","ℍ"),lM(cM,dM,bM,"N","ℕ"),lM(hM,dM,bM,"N","ℕ"),lM(cM,dM,bM,"P","ℙ"),lM(hM,dM,bM,"P","ℙ"),lM(cM,dM,bM,"Q","ℚ"),lM(hM,dM,bM,"Q","ℚ"),lM(cM,dM,bM,"R","ℝ"),lM(hM,dM,bM,"R","ℝ"),lM(cM,dM,bM,"Z","ℤ"),lM(hM,dM,bM,"Z","ℤ"),lM(cM,uM,mM,"h","ℎ"),lM(hM,uM,mM,"h","ℎ");var LM,NM,IM,MM,RM="";for(NM=0;NM<AM.length;NM++)lM(cM,uM,mM,LM=AM.charAt(NM),RM=String.fromCharCode(55349,56320+NM)),lM(hM,uM,bM,LM,RM),lM(cM,uM,mM,LM,RM=String.fromCharCode(55349,56372+NM)),lM(hM,uM,bM,LM,RM),lM(cM,uM,mM,LM,RM=String.fromCharCode(55349,56424+NM)),lM(hM,uM,bM,LM,RM),lM(cM,uM,mM,LM,RM=String.fromCharCode(55349,56580+NM)),lM(hM,uM,bM,LM,RM),lM(cM,uM,mM,LM,RM=String.fromCharCode(55349,56684+NM)),lM(hM,uM,bM,LM,RM),lM(cM,uM,mM,LM,RM=String.fromCharCode(55349,56736+NM)),lM(hM,uM,bM,LM,RM),lM(cM,uM,mM,LM,RM=String.fromCharCode(55349,56788+NM)),lM(hM,uM,bM,LM,RM),lM(cM,uM,mM,LM,RM=String.fromCharCode(55349,56840+NM)),lM(hM,uM,bM,LM,RM),lM(cM,uM,mM,LM,RM=String.fromCharCode(55349,56944+NM)),lM(hM,uM,bM,LM,RM),NM<26&&(lM(cM,uM,mM,LM,RM=String.fromCharCode(55349,56632+NM)),lM(hM,uM,bM,LM,RM),lM(cM,uM,mM,LM,RM=String.fromCharCode(55349,56476+NM)),lM(hM,uM,bM,LM,RM));for(lM(cM,uM,mM,"k",RM=String.fromCharCode(55349,56668)),lM(hM,uM,bM,"k",RM),MM=0;MM<10;MM++)lM(cM,uM,mM,IM=MM.toString(),RM=String.fromCharCode(55349,57294+MM)),lM(hM,uM,bM,IM,RM),lM(cM,uM,mM,IM,RM=String.fromCharCode(55349,57314+MM)),lM(hM,uM,bM,IM,RM),lM(cM,uM,mM,IM,RM=String.fromCharCode(55349,57324+MM)),lM(hM,uM,bM,IM,RM),lM(cM,uM,mM,IM,RM=String.fromCharCode(55349,57334+MM)),lM(hM,uM,bM,IM,RM);var DM,OM;for(OM=0;OM<"ÐÞþ".length;OM++)lM(cM,uM,mM,DM="ÐÞþ".charAt(OM),DM),lM(hM,uM,bM,DM,DM);var PM=[["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"]],BM=[["mathbf","textbf","Main-Bold"],["","",""],["mathsf","textsf","SansSerif-Regular"],["mathboldsf","textboldsf","SansSerif-Bold"],["mathtt","texttt","Typewriter-Regular"]],$M=s((function(t,e){var n=1024*(t.charCodeAt(0)-55296)+(t.charCodeAt(1)-56320)+65536,r="math"===e?0:1;if(119808<=n&&n<120484){var i=Math.floor((n-119808)/26);return[PM[i][2],PM[i][r]]}if(120782<=n&&n<=120831){var a=Math.floor((n-120782)/10);return[BM[a][2],BM[a][r]]}if(120485===n||120486===n)return[PM[0][2],PM[0][r]];if(120486<n&&n<120782)return["",""];throw new qN("Unsupported character: "+t)}),"wideCharacterFont"),FM=s((function(t,e,n){return oM[n][t]&&oM[n][t].replace&&(t=oM[n][t].replace),{value:t,metrics:RI(t,e,n)}}),"lookupSymbol"),zM=s((function(t,e,n,r,i){var a,s=FM(t,e,n),o=s.metrics;if(t=s.value,o){var l=o.italic;("text"===n||r&&"mathit"===r.font)&&(l=0),a=new JI(t,o.height,o.depth,l,o.skew,o.width,i)}else"undefined"!=typeof console&&console.warn("No character metrics for '"+t+"' in style '"+e+"' and mode '"+n+"'"),a=new JI(t,0,0,0,0,0,i);if(r){a.maxFontSize=r.sizeMultiplier,r.style.isTight()&&a.classes.push("mtight");var c=r.getColor();c&&(a.style.color=c)}return a}),"makeSymbol"),UM=s((function(t,e,n,r){return void 0===r&&(r=[]),"boldsymbol"===n.font&&FM(t,"Main-Bold",e).metrics?zM(t,"Main-Bold",e,n,r.concat(["mathbf"])):"\\"===t||"main"===oM[e][t].font?zM(t,"Main-Regular",e,n,r):zM(t,"AMS-Regular",e,n,r.concat(["amsrm"]))}),"mathsym"),GM=s((function(t,e,n,r,i){return"textord"!==i&&FM(t,"Math-BoldItalic",e).metrics?{fontName:"Math-BoldItalic",fontClass:"boldsymbol"}:{fontName:"Main-Bold",fontClass:"mathbf"}}),"boldsymbol"),qM=s((function(t,e,n){var r=t.mode,i=t.text,a=["mord"],s="math"===r||"text"===r&&e.font,o=s?e.font:e.fontFamily,l="",c="";if(55349===i.charCodeAt(0)&&([l,c]=$M(i,r)),l.length>0)return zM(i,l,r,e,a.concat(c));if(o){var h,u;if("boldsymbol"===o){var d=GM(i,r,e,a,n);h=d.fontName,u=[d.fontClass]}else s?(h=rR[o].fontName,u=[o]):(h=nR(o,e.fontWeight,e.fontShape),u=[o,e.fontWeight,e.fontShape]);if(FM(i,h,r).metrics)return zM(i,h,r,e,a.concat(u));if(wM.hasOwnProperty(i)&&"Typewriter"===h.slice(0,10)){for(var p=[],g=0;g<i.length;g++)p.push(zM(i[g],h,r,e,a.concat(u)));return ZM(p)}}if("mathord"===n)return zM(i,"Math-Italic",r,e,a.concat(["mathnormal"]));if("textord"===n){var f=oM[r][i]&&oM[r][i].font;if("ams"===f){var m=nR("amsrm",e.fontWeight,e.fontShape);return zM(i,m,r,e,a.concat("amsrm",e.fontWeight,e.fontShape))}if("main"!==f&&f){var y=nR(f,e.fontWeight,e.fontShape);return zM(i,y,r,e,a.concat(y,e.fontWeight,e.fontShape))}var v=nR("textrm",e.fontWeight,e.fontShape);return zM(i,v,r,e,a.concat(e.fontWeight,e.fontShape))}throw new Error("unexpected type: "+n+" in makeOrd")}),"makeOrd"),jM=s(((t,e)=>{if(YI(t.classes)!==YI(e.classes)||t.skew!==e.skew||t.maxFontSize!==e.maxFontSize)return!1;if(1===t.classes.length){var n=t.classes[0];if("mbin"===n||"mord"===n)return!1}for(var r in t.style)if(t.style.hasOwnProperty(r)&&t.style[r]!==e.style[r])return!1;for(var i in e.style)if(e.style.hasOwnProperty(i)&&t.style[i]!==e.style[i])return!1;return!0}),"canCombine"),YM=s((t=>{for(var e=0;e<t.length-1;e++){var n=t[e],r=t[e+1];n instanceof JI&&r instanceof JI&&jM(n,r)&&(n.text+=r.text,n.height=Math.max(n.height,r.height),n.depth=Math.max(n.depth,r.depth),n.italic=r.italic,t.splice(e+1,1),e--)}return t}),"tryCombineChars"),WM=s((function(t){for(var e=0,n=0,r=0,i=0;i<t.children.length;i++){var a=t.children[i];a.height>e&&(e=a.height),a.depth>n&&(n=a.depth),a.maxFontSize>r&&(r=a.maxFontSize)}t.height=e,t.depth=n,t.maxFontSize=r}),"sizeElementFromChildren"),HM=s((function(t,e,n,r){var i=new XI(t,e,n,r);return WM(i),i}),"makeSpan"),VM=s(((t,e,n,r)=>new XI(t,e,n,r)),"makeSvgSpan"),XM=s((function(t,e,n){var r=HM([t],[],e);return r.height=Math.max(n||e.fontMetrics().defaultRuleThickness,e.minRuleThickness),r.style.borderBottomWidth=jI(r.height),r.maxFontSize=1,r}),"makeLineSpan"),KM=s((function(t,e,n,r){var i=new KI(t,e,n,r);return WM(i),i}),"makeAnchor"),ZM=s((function(t){var e=new AI(t);return WM(e),e}),"makeFragment"),QM=s((function(t,e){return t instanceof AI?HM([],[t],e):t}),"wrapFragment"),JM=s((function(t){if("individualShift"===t.positionType){for(var e=t.children,n=[e[0]],r=-e[0].shift-e[0].elem.depth,i=r,a=1;a<e.length;a++){var s=-e[a].shift-i-e[a].elem.depth,o=s-(e[a-1].elem.height+e[a-1].elem.depth);i+=s,n.push({type:"kern",size:o}),n.push(e[a])}return{children:n,depth:r}}var l;if("top"===t.positionType){for(var c=t.positionData,h=0;h<t.children.length;h++){var u=t.children[h];c-="kern"===u.type?u.size:u.elem.height+u.elem.depth}l=c}else if("bottom"===t.positionType)l=-t.positionData;else{var d=t.children[0];if("elem"!==d.type)throw new Error('First child must have type "elem".');if("shift"===t.positionType)l=-d.elem.depth-t.positionData;else{if("firstBaseline"!==t.positionType)throw new Error("Invalid positionType "+t.positionType+".");l=-d.elem.depth}}return{children:t.children,depth:l}}),"getVListChildrenAndDepth"),tR=s((function(t,e){for(var{children:n,depth:r}=JM(t),i=0,a=0;a<n.length;a++){var s=n[a];if("elem"===s.type){var o=s.elem;i=Math.max(i,o.maxFontSize,o.height)}}i+=2;var l=HM(["pstrut"],[]);l.style.height=jI(i);for(var c=[],h=r,u=r,d=r,p=0;p<n.length;p++){var g=n[p];if("kern"===g.type)d+=g.size;else{var f=g.elem,m=g.wrapperClasses||[],y=g.wrapperStyle||{},v=HM(m,[l,f],void 0,y);v.style.top=jI(-i-d-f.depth),g.marginLeft&&(v.style.marginLeft=g.marginLeft),g.marginRight&&(v.style.marginRight=g.marginRight),c.push(v),d+=f.height+f.depth}h=Math.min(h,d),u=Math.max(u,d)}var x,b=HM(["vlist"],c);if(b.style.height=jI(u),h<0){var w=HM([],[]),k=HM(["vlist"],[w]);k.style.height=jI(-h);var T=HM(["vlist-s"],[new JI("​")]);x=[HM(["vlist-r"],[b,T]),HM(["vlist-r"],[k])]}else x=[HM(["vlist-r"],[b])];var _=HM(["vlist-t"],x);return 2===x.length&&_.classes.push("vlist-t2"),_.height=u,_.depth=-h,_}),"makeVList"),eR=s(((t,e)=>{var n=HM(["mspace"],[],e),r=qI(t,e);return n.style.marginRight=jI(r),n}),"makeGlue"),nR=s((function(t,e,n){var r="";switch(t){case"amsrm":r="AMS";break;case"textrm":r="Main";break;case"textsf":r="SansSerif";break;case"texttt":r="Typewriter";break;default:r=t}return r+"-"+("textbf"===e&&"textit"===n?"BoldItalic":"textbf"===e?"Bold":"textit"===e?"Italic":"Regular")}),"retrieveTextFontName"),rR={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"},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"}},iR={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},aR=s((function(t,e){var[n,r,i]=iR[t],a=new eM(n),s=new tM([a],{width:jI(r),height:jI(i),style:"width:"+jI(r),viewBox:"0 0 "+1e3*r+" "+1e3*i,preserveAspectRatio:"xMinYMin"}),o=VM(["overlay"],[s],e);return o.height=i,o.style.height=jI(i),o.style.width=jI(r),o}),"staticSvg"),sR={fontMap:rR,makeSymbol:zM,mathsym:UM,makeSpan:HM,makeSvgSpan:VM,makeLineSpan:XM,makeAnchor:KM,makeFragment:ZM,wrapFragment:QM,makeVList:tR,makeOrd:qM,makeGlue:eR,staticSvg:aR,svgData:iR,tryCombineChars:YM},oR={number:3,unit:"mu"},lR={number:4,unit:"mu"},cR={number:5,unit:"mu"},hR={mord:{mop:oR,mbin:lR,mrel:cR,minner:oR},mop:{mord:oR,mop:oR,mrel:cR,minner:oR},mbin:{mord:lR,mop:lR,mopen:lR,minner:lR},mrel:{mord:cR,mop:cR,mopen:cR,minner:cR},mopen:{},mclose:{mop:oR,mbin:lR,mrel:cR,minner:oR},mpunct:{mord:oR,mop:oR,mrel:cR,mopen:oR,mclose:oR,mpunct:oR,minner:oR},minner:{mord:oR,mop:oR,mbin:lR,mrel:cR,mopen:oR,mpunct:oR,minner:oR}},uR={mord:{mop:oR},mop:{mord:oR,mop:oR},mbin:{},mrel:{},mopen:{},mclose:{mop:oR},mpunct:{},minner:{mop:oR}},dR={},pR={},gR={};function fR(t){for(var{type:e,names:n,props:r,handler:i,htmlBuilder:a,mathmlBuilder:s}=t,o={type:e,numArgs:r.numArgs,argTypes:r.argTypes,allowedInArgument:!!r.allowedInArgument,allowedInText:!!r.allowedInText,allowedInMath:void 0===r.allowedInMath||r.allowedInMath,numOptionalArgs:r.numOptionalArgs||0,infix:!!r.infix,primitive:!!r.primitive,handler:i},l=0;l<n.length;++l)dR[n[l]]=o;e&&(a&&(pR[e]=a),s&&(gR[e]=s))}function mR(t){var{type:e,htmlBuilder:n,mathmlBuilder:r}=t;fR({type:e,names:[],props:{numArgs:0},handler(){throw new Error("Should never be called.")},htmlBuilder:n,mathmlBuilder:r})}s(fR,"defineFunction"),s(mR,"defineFunctionBuilders");var yR=s((function(t){return"ordgroup"===t.type&&1===t.body.length?t.body[0]:t}),"normalizeArgument"),vR=s((function(t){return"ordgroup"===t.type?t.body:[t]}),"ordargument"),xR=sR.makeSpan,bR=["leftmost","mbin","mopen","mrel","mop","mpunct"],wR=["rightmost","mrel","mclose","mpunct"],kR={display:dI.DISPLAY,text:dI.TEXT,script:dI.SCRIPT,scriptscript:dI.SCRIPTSCRIPT},TR={mord:"mord",mop:"mop",mbin:"mbin",mrel:"mrel",mopen:"mopen",mclose:"mclose",mpunct:"mpunct",minner:"minner"},_R=s((function(t,e,n,r){void 0===r&&(r=[null,null]);for(var i=[],a=0;a<t.length;a++){var s=NR(t[a],e);if(s instanceof AI){var o=s.children;i.push(...o)}else i.push(s)}if(sR.tryCombineChars(i),!n)return i;var l=e;if(1===t.length){var c=t[0];"sizing"===c.type?l=e.havingSize(c.size):"styling"===c.type&&(l=e.havingStyle(kR[c.style]))}var h=xR([r[0]||"leftmost"],[],e),u=xR([r[1]||"rightmost"],[],e),d="root"===n;return ER(i,((t,e)=>{var n=e.classes[0],r=t.classes[0];"mbin"===n&&tI.contains(wR,r)?e.classes[0]="mord":"mbin"===r&&tI.contains(bR,n)&&(t.classes[0]="mord")}),{node:h},u,d),ER(i,((t,e)=>{var n=AR(e),r=AR(t),i=n&&r?t.hasClass("mtight")?uR[n][r]:hR[n][r]:null;if(i)return sR.makeGlue(i,l)}),{node:h},u,d),i}),"buildExpression"),ER=s((function t(e,n,r,i,a){i&&e.push(i);for(var s=0;s<e.length;s++){var o=e[s],l=CR(o);if(l)t(l.children,n,r,null,a);else{var c=!o.hasClass("mspace");if(c){var h=n(o,r.node);h&&(r.insertAfter?r.insertAfter(h):(e.unshift(h),s++))}c?r.node=o:a&&o.hasClass("newline")&&(r.node=xR(["leftmost"])),r.insertAfter=(t=>n=>{e.splice(t+1,0,n),s++})(s)}}i&&e.pop()}),"traverseNonSpaceNodes"),CR=s((function(t){return t instanceof AI||t instanceof KI||t instanceof XI&&t.hasClass("enclosing")?t:null}),"checkPartialGroup"),SR=s((function t(e,n){var r=CR(e);if(r){var i=r.children;if(i.length){if("right"===n)return t(i[i.length-1],"right");if("left"===n)return t(i[0],"left")}}return e}),"getOutermostNode"),AR=s((function(t,e){return t?(e&&(t=SR(t,e)),TR[t.classes[0]]||null):null}),"getTypeOfDomTree"),LR=s((function(t,e){var n=["nulldelimiter"].concat(t.baseSizingClasses());return xR(e.concat(n))}),"makeNullDelimiter"),NR=s((function(t,e,n){if(!t)return xR();if(pR[t.type]){var r=pR[t.type](t,e);if(n&&e.size!==n.size){r=xR(e.sizingClasses(n),[r],e);var i=e.sizeMultiplier/n.sizeMultiplier;r.height*=i,r.depth*=i}return r}throw new qN("Got group of unknown type: '"+t.type+"'")}),"buildGroup");function IR(t,e){var n=xR(["base"],t,e),r=xR(["strut"]);return r.style.height=jI(n.height+n.depth),n.depth&&(r.style.verticalAlign=jI(-n.depth)),n.children.unshift(r),n}function MR(t,e){var n=null;1===t.length&&"tag"===t[0].type&&(n=t[0].tag,t=t[0].body);var r,i=_R(t,e,"root");2===i.length&&i[1].hasClass("tag")&&(r=i.pop());for(var a,s=[],o=[],l=0;l<i.length;l++)if(o.push(i[l]),i[l].hasClass("mbin")||i[l].hasClass("mrel")||i[l].hasClass("allowbreak")){for(var c=!1;l<i.length-1&&i[l+1].hasClass("mspace")&&!i[l+1].hasClass("newline");)l++,o.push(i[l]),i[l].hasClass("nobreak")&&(c=!0);c||(s.push(IR(o,e)),o=[])}else i[l].hasClass("newline")&&(o.pop(),o.length>0&&(s.push(IR(o,e)),o=[]),s.push(i[l]));o.length>0&&s.push(IR(o,e)),n?((a=IR(_R(n,e,!0))).classes=["tag"],s.push(a)):r&&s.push(r);var h=xR(["katex-html"],s);if(h.setAttribute("aria-hidden","true"),a){var u=a.children[0];u.style.height=jI(h.height+h.depth),h.depth&&(u.style.verticalAlign=jI(-h.depth))}return h}function RR(t){return new AI(t)}s(IR,"buildHTMLUnbreakable"),s(MR,"buildHTML"),s(RR,"newDocumentFragment");var DR=class{static{s(this,"MathNode")}constructor(t,e,n){this.type=void 0,this.attributes=void 0,this.children=void 0,this.classes=void 0,this.type=t,this.attributes={},this.children=e||[],this.classes=n||[]}setAttribute(t,e){this.attributes[t]=e}getAttribute(t){return this.attributes[t]}toNode(){var t=document.createElementNS("http://www.w3.org/1998/Math/MathML",this.type);for(var e in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,e)&&t.setAttribute(e,this.attributes[e]);this.classes.length>0&&(t.className=YI(this.classes));for(var n=0;n<this.children.length;n++)t.appendChild(this.children[n].toNode());return t}toMarkup(){var t="<"+this.type;for(var e in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,e)&&(t+=" "+e+'="',t+=tI.escape(this.attributes[e]),t+='"');this.classes.length>0&&(t+=' class ="'+tI.escape(YI(this.classes))+'"'),t+=">";for(var n=0;n<this.children.length;n++)t+=this.children[n].toMarkup();return t+="</"+this.type+">"}toText(){return this.children.map((t=>t.toText())).join("")}},OR=class{static{s(this,"TextNode")}constructor(t){this.text=void 0,this.text=t}toNode(){return document.createTextNode(this.text)}toMarkup(){return tI.escape(this.toText())}toText(){return this.text}},PR=class{static{s(this,"SpaceNode")}constructor(t){this.width=void 0,this.character=void 0,this.width=t,this.character=t>=.05555&&t<=.05556?" ":t>=.1666&&t<=.1667?" ":t>=.2222&&t<=.2223?" ":t>=.2777&&t<=.2778?"  ":t>=-.05556&&t<=-.05555?" ⁣":t>=-.1667&&t<=-.1666?" ⁣":t>=-.2223&&t<=-.2222?" ⁣":t>=-.2778&&t<=-.2777?" ⁣":null}toNode(){if(this.character)return document.createTextNode(this.character);var t=document.createElementNS("http://www.w3.org/1998/Math/MathML","mspace");return t.setAttribute("width",jI(this.width)),t}toMarkup(){return this.character?"<mtext>"+this.character+"</mtext>":'<mspace width="'+jI(this.width)+'"/>'}toText(){return this.character?this.character:" "}},BR={MathNode:DR,TextNode:OR,SpaceNode:PR,newDocumentFragment:RR},$R=s((function(t,e,n){return!oM[e][t]||!oM[e][t].replace||55349===t.charCodeAt(0)||wM.hasOwnProperty(t)&&n&&(n.fontFamily&&"tt"===n.fontFamily.slice(4,6)||n.font&&"tt"===n.font.slice(4,6))||(t=oM[e][t].replace),new BR.TextNode(t)}),"makeText"),FR=s((function(t){return 1===t.length?t[0]:new BR.MathNode("mrow",t)}),"makeRow"),zR=s((function(t,e){if("texttt"===e.fontFamily)return"monospace";if("textsf"===e.fontFamily)return"textit"===e.fontShape&&"textbf"===e.fontWeight?"sans-serif-bold-italic":"textit"===e.fontShape?"sans-serif-italic":"textbf"===e.fontWeight?"bold-sans-serif":"sans-serif";if("textit"===e.fontShape&&"textbf"===e.fontWeight)return"bold-italic";if("textit"===e.fontShape)return"italic";if("textbf"===e.fontWeight)return"bold";var n=e.font;if(!n||"mathnormal"===n)return null;var r=t.mode;if("mathit"===n)return"italic";if("boldsymbol"===n)return"textord"===t.type?"bold":"bold-italic";if("mathbf"===n)return"bold";if("mathbb"===n)return"double-struck";if("mathfrak"===n)return"fraktur";if("mathscr"===n||"mathcal"===n)return"script";if("mathsf"===n)return"sans-serif";if("mathtt"===n)return"monospace";var i=t.text;return tI.contains(["\\imath","\\jmath"],i)?null:(oM[r][i]&&oM[r][i].replace&&(i=oM[r][i].replace),RI(i,sR.fontMap[n].fontName,r)?sR.fontMap[n].variant:null)}),"getVariant"),UR=s((function(t,e,n){if(1===t.length){var r=qR(t[0],e);return n&&r instanceof DR&&"mo"===r.type&&(r.setAttribute("lspace","0em"),r.setAttribute("rspace","0em")),[r]}for(var i,a=[],s=0;s<t.length;s++){var o=qR(t[s],e);if(o instanceof DR&&i instanceof DR){if("mtext"===o.type&&"mtext"===i.type&&o.getAttribute("mathvariant")===i.getAttribute("mathvariant")){i.children.push(...o.children);continue}if("mn"===o.type&&"mn"===i.type){i.children.push(...o.children);continue}if("mi"===o.type&&1===o.children.length&&"mn"===i.type){var l=o.children[0];if(l instanceof OR&&"."===l.text){i.children.push(...o.children);continue}}else if("mi"===i.type&&1===i.children.length){var c=i.children[0];if(c instanceof OR&&"̸"===c.text&&("mo"===o.type||"mi"===o.type||"mn"===o.type)){var h=o.children[0];h instanceof OR&&h.text.length>0&&(h.text=h.text.slice(0,1)+"̸"+h.text.slice(1),a.pop())}}}a.push(o),i=o}return a}),"buildExpression"),GR=s((function(t,e,n){return FR(UR(t,e,n))}),"buildExpressionRow"),qR=s((function(t,e){if(!t)return new BR.MathNode("mrow");if(gR[t.type])return gR[t.type](t,e);throw new qN("Got group of unknown type: '"+t.type+"'")}),"buildGroup");function jR(t,e,n,r,i){var a,s=UR(t,n);a=1===s.length&&s[0]instanceof DR&&tI.contains(["mrow","mtable"],s[0].type)?s[0]:new BR.MathNode("mrow",s);var o=new BR.MathNode("annotation",[new BR.TextNode(e)]);o.setAttribute("encoding","application/x-tex");var l=new BR.MathNode("semantics",[a,o]),c=new BR.MathNode("math",[l]);c.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),r&&c.setAttribute("display","block");var h=i?"katex":"katex-mathml";return sR.makeSpan([h],[c])}s(jR,"buildMathML");var YR=s((function(t){return new FI({style:t.displayMode?dI.DISPLAY:dI.TEXT,maxSize:t.maxSize,minRuleThickness:t.minRuleThickness})}),"optionsFromSettings"),WR=s((function(t,e){if(e.displayMode){var n=["katex-display"];e.leqno&&n.push("leqno"),e.fleqn&&n.push("fleqn"),t=sR.makeSpan(n,[t])}return t}),"displayWrap"),HR=s((function(t,e,n){var r,i=YR(n);if("mathml"===n.output)return jR(t,e,i,n.displayMode,!0);if("html"===n.output){var a=MR(t,i);r=sR.makeSpan(["katex"],[a])}else{var s=jR(t,e,i,n.displayMode,!1),o=MR(t,i);r=sR.makeSpan(["katex"],[s,o])}return WR(r,n)}),"buildTree"),VR=s((function(t,e,n){var r=MR(t,YR(n)),i=sR.makeSpan(["katex"],[r]);return WR(i,n)}),"buildHTMLTree"),XR={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":"="},KR=s((function(t){var e=new BR.MathNode("mo",[new BR.TextNode(XR[t.replace(/^\\/,"")])]);return e.setAttribute("stretchy","true"),e}),"mathMLnode"),ZR={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]},QR=s((function(t){return"ordgroup"===t.type?t.body.length:1}),"groupLength"),JR=s((function(t,e){function n(){var n=4e5,r=t.label.slice(1);if(tI.contains(["widehat","widecheck","widetilde","utilde"],r)){var i,a,s,o=QR(t.base);if(o>5)"widehat"===r||"widecheck"===r?(i=420,n=2364,s=.42,a=r+"4"):(i=312,n=2340,s=.34,a="tilde4");else{var l=[1,1,2,2,3,3][o];"widehat"===r||"widecheck"===r?(n=[0,1062,2364,2364,2364][l],i=[0,239,300,360,420][l],s=[0,.24,.3,.3,.36,.42][l],a=r+l):(n=[0,600,1033,2339,2340][l],i=[0,260,286,306,312][l],s=[0,.26,.286,.3,.306,.34][l],a="tilde"+l)}var c=new eM(a),h=new tM([c],{width:"100%",height:jI(s),viewBox:"0 0 "+n+" "+i,preserveAspectRatio:"none"});return{span:sR.makeSvgSpan([],[h],e),minWidth:0,height:s}}var u,d,p=[],g=ZR[r],[f,m,y]=g,v=y/1e3,x=f.length;if(1===x)u=["hide-tail"],d=[g[3]];else if(2===x)u=["halfarrow-left","halfarrow-right"],d=["xMinYMin","xMaxYMin"];else{if(3!==x)throw new Error("Correct katexImagesData or update code here to support\n "+x+" children.");u=["brace-left","brace-center","brace-right"],d=["xMinYMin","xMidYMin","xMaxYMin"]}for(var b=0;b<x;b++){var w=new eM(f[b]),k=new tM([w],{width:"400em",height:jI(v),viewBox:"0 0 "+n+" "+y,preserveAspectRatio:d[b]+" slice"}),T=sR.makeSvgSpan([u[b]],[k],e);if(1===x)return{span:T,minWidth:m,height:v};T.style.height=jI(v),p.push(T)}return{span:sR.makeSpan(["stretchy"],p,e),minWidth:m,height:v}}s(n,"buildSvgSpan_");var{span:r,minWidth:i,height:a}=n();return r.height=a,r.style.height=jI(a),i>0&&(r.style.minWidth=jI(i)),r}),"svgSpan"),tD=s((function(t,e,n,r,i){var a,s=t.height+t.depth+n+r;if(/fbox|color|angl/.test(e)){if(a=sR.makeSpan(["stretchy",e],[],i),"fbox"===e){var o=i.color&&i.getColor();o&&(a.style.borderColor=o)}}else{var l=[];/^[bx]cancel$/.test(e)&&l.push(new nM({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(e)&&l.push(new nM({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var c=new tM(l,{width:"100%",height:jI(s)});a=sR.makeSvgSpan([],[c],i)}return a.height=s,a.style.height=jI(s),a}),"encloseSpan"),eD={encloseSpan:tD,mathMLnode:KR,svgSpan:JR};function nD(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 rD(t){var e=iD(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 iD(t){return t&&("atom"===t.type||sM.hasOwnProperty(t.type))?t:null}s(nD,"assertNodeType"),s(rD,"assertSymbolNodeType"),s(iD,"checkSymbolNodeType");var aD=s(((t,e)=>{var n,r,i;t&&"supsub"===t.type?(n=(r=nD(t.base,"accent")).base,t.base=n,i=iM(NR(t,e)),t.base=r):n=(r=nD(t,"accent")).base;var a=NR(n,e.havingCrampedStyle()),s=0;if(r.isShifty&&tI.isCharacterBox(n)){var o=tI.getBaseElem(n);s=rM(NR(o,e.havingCrampedStyle())).skew}var l,c="\\c"===r.label,h=c?a.height+a.depth:Math.min(a.height,e.fontMetrics().xHeight);if(r.isStretchy)l=eD.svgSpan(r,e),l=sR.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"elem",elem:l,wrapperClasses:["svg-align"],wrapperStyle:s>0?{width:"calc(100% - "+jI(2*s)+")",marginLeft:jI(2*s)}:void 0}]},e);else{var u,d;"\\vec"===r.label?(u=sR.staticSvg("vec",e),d=sR.svgData.vec[1]):((u=rM(u=sR.makeOrd({mode:r.mode,text:r.label},e,"textord"))).italic=0,d=u.width,c&&(h+=u.depth)),l=sR.makeSpan(["accent-body"],[u]);var p="\\textcircled"===r.label;p&&(l.classes.push("accent-full"),h=a.height);var g=s;p||(g-=d/2),l.style.left=jI(g),"\\textcircled"===r.label&&(l.style.top=".2em"),l=sR.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"kern",size:-h},{type:"elem",elem:l}]},e)}var f=sR.makeSpan(["mord","accent"],[l],e);return i?(i.children[0]=f,i.height=Math.max(f.height,i.height),i.classes[0]="mord",i):f}),"htmlBuilder$a"),sD=s(((t,e)=>{var n=t.isStretchy?eD.mathMLnode(t.label):new BR.MathNode("mo",[$R(t.label,t.mode)]),r=new BR.MathNode("mover",[qR(t.base,e),n]);return r.setAttribute("accent","true"),r}),"mathmlBuilder$9"),oD=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map((t=>"\\"+t)).join("|"));fR({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:s(((t,e)=>{var n=yR(e[0]),r=!oD.test(t.funcName),i=!r||"\\widehat"===t.funcName||"\\widetilde"===t.funcName||"\\widecheck"===t.funcName;return{type:"accent",mode:t.parser.mode,label:t.funcName,isStretchy:r,isShifty:i,base:n}}),"handler"),htmlBuilder:aD,mathmlBuilder:sD}),fR({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"]},handler:s(((t,e)=>{var n=e[0],r=t.parser.mode;return"math"===r&&(t.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+t.funcName+" works only in text mode"),r="text"),{type:"accent",mode:r,label:t.funcName,isStretchy:!1,isShifty:!0,base:n}}),"handler"),htmlBuilder:aD,mathmlBuilder:sD}),fR({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:s(((t,e)=>{var{parser:n,funcName:r}=t,i=e[0];return{type:"accentUnder",mode:n.mode,label:r,base:i}}),"handler"),htmlBuilder:s(((t,e)=>{var n=NR(t.base,e),r=eD.svgSpan(t,e),i="\\utilde"===t.label?.12:0,a=sR.makeVList({positionType:"top",positionData:n.height,children:[{type:"elem",elem:r,wrapperClasses:["svg-align"]},{type:"kern",size:i},{type:"elem",elem:n}]},e);return sR.makeSpan(["mord","accentunder"],[a],e)}),"htmlBuilder"),mathmlBuilder:s(((t,e)=>{var n=eD.mathMLnode(t.label),r=new BR.MathNode("munder",[qR(t.base,e),n]);return r.setAttribute("accentunder","true"),r}),"mathmlBuilder")});var lD=s((t=>{var e=new BR.MathNode("mpadded",t?[t]:[]);return e.setAttribute("width","+0.6em"),e.setAttribute("lspace","0.3em"),e}),"paddedNode");fR({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,n){var{parser:r,funcName:i}=t;return{type:"xArrow",mode:r.mode,label:i,body:e[0],below:n[0]}},htmlBuilder(t,e){var n,r=e.style,i=e.havingStyle(r.sup()),a=sR.wrapFragment(NR(t.body,i,e),e),s="\\x"===t.label.slice(0,2)?"x":"cd";a.classes.push(s+"-arrow-pad"),t.below&&(i=e.havingStyle(r.sub()),(n=sR.wrapFragment(NR(t.below,i,e),e)).classes.push(s+"-arrow-pad"));var o,l=eD.svgSpan(t,e),c=-e.fontMetrics().axisHeight+.5*l.height,h=-e.fontMetrics().axisHeight-.5*l.height-.111;if((a.depth>.25||"\\xleftequilibrium"===t.label)&&(h-=a.depth),n){var u=-e.fontMetrics().axisHeight+n.height+.5*l.height+.111;o=sR.makeVList({positionType:"individualShift",children:[{type:"elem",elem:a,shift:h},{type:"elem",elem:l,shift:c},{type:"elem",elem:n,shift:u}]},e)}else o=sR.makeVList({positionType:"individualShift",children:[{type:"elem",elem:a,shift:h},{type:"elem",elem:l,shift:c}]},e);return o.children[0].children[0].children[1].classes.push("svg-align"),sR.makeSpan(["mrel","x-arrow"],[o],e)},mathmlBuilder(t,e){var n,r=eD.mathMLnode(t.label);if(r.setAttribute("minsize","x"===t.label.charAt(0)?"1.75em":"3.0em"),t.body){var i=lD(qR(t.body,e));if(t.below){var a=lD(qR(t.below,e));n=new BR.MathNode("munderover",[r,a,i])}else n=new BR.MathNode("mover",[r,i])}else if(t.below){var s=lD(qR(t.below,e));n=new BR.MathNode("munder",[r,s])}else n=lD(),n=new BR.MathNode("mover",[r,n]);return n}});var cD=sR.makeSpan;function hD(t,e){var n=_R(t.body,e,!0);return cD([t.mclass],n,e)}function uD(t,e){var n,r=UR(t.body,e);return"minner"===t.mclass?n=new BR.MathNode("mpadded",r):"mord"===t.mclass?t.isCharacterBox?(n=r[0]).type="mi":n=new BR.MathNode("mi",r):(t.isCharacterBox?(n=r[0]).type="mo":n=new BR.MathNode("mo",r),"mbin"===t.mclass?(n.attributes.lspace="0.22em",n.attributes.rspace="0.22em"):"mpunct"===t.mclass?(n.attributes.lspace="0em",n.attributes.rspace="0.17em"):"mopen"===t.mclass||"mclose"===t.mclass?(n.attributes.lspace="0em",n.attributes.rspace="0em"):"minner"===t.mclass&&(n.attributes.lspace="0.0556em",n.attributes.width="+0.1111em")),n}s(hD,"htmlBuilder$9"),s(uD,"mathmlBuilder$8"),fR({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],props:{numArgs:1,primitive:!0},handler(t,e){var{parser:n,funcName:r}=t,i=e[0];return{type:"mclass",mode:n.mode,mclass:"m"+r.slice(5),body:vR(i),isCharacterBox:tI.isCharacterBox(i)}},htmlBuilder:hD,mathmlBuilder:uD});var dD=s((t=>{var e="ordgroup"===t.type&&t.body.length?t.body[0]:t;return"atom"!==e.type||"bin"!==e.family&&"rel"!==e.family?"mord":"m"+e.family}),"binrelClass");fR({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler(t,e){var{parser:n}=t;return{type:"mclass",mode:n.mode,mclass:dD(e[0]),body:vR(e[1]),isCharacterBox:tI.isCharacterBox(e[1])}}}),fR({type:"mclass",names:["\\stackrel","\\overset","\\underset"],props:{numArgs:2},handler(t,e){var n,{parser:r,funcName:i}=t,a=e[1],s=e[0];n="\\stackrel"!==i?dD(a):"mrel";var o={type:"op",mode:a.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:"\\stackrel"!==i,body:vR(a)},l={type:"supsub",mode:s.mode,base:o,sup:"\\underset"===i?null:s,sub:"\\underset"===i?s:null};return{type:"mclass",mode:r.mode,mclass:n,body:[l],isCharacterBox:tI.isCharacterBox(l)}},htmlBuilder:hD,mathmlBuilder:uD}),fR({type:"pmb",names:["\\pmb"],props:{numArgs:1,allowedInText:!0},handler(t,e){var{parser:n}=t;return{type:"pmb",mode:n.mode,mclass:dD(e[0]),body:vR(e[0])}},htmlBuilder(t,e){var n=_R(t.body,e,!0),r=sR.makeSpan([t.mclass],n,e);return r.style.textShadow="0.02em 0.01em 0.04px",r},mathmlBuilder(t,e){var n=UR(t.body,e),r=new BR.MathNode("mstyle",n);return r.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),r}});var pD={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},gD=s((()=>({type:"styling",body:[],mode:"math",style:"display"})),"newCell"),fD=s((t=>"textord"===t.type&&"@"===t.text),"isStartOfArrow"),mD=s(((t,e)=>("mathord"===t.type||"atom"===t.type)&&t.text===e),"isLabelEnd");function yD(t,e,n){var r=pD[t];switch(r){case"\\\\cdrightarrow":case"\\\\cdleftarrow":return n.callFunction(r,[e[0]],[e[1]]);case"\\uparrow":case"\\downarrow":var i={type:"atom",text:r,mode:"math",family:"rel"},a={type:"ordgroup",mode:"math",body:[n.callFunction("\\\\cdleft",[e[0]],[]),n.callFunction("\\Big",[i],[]),n.callFunction("\\\\cdright",[e[1]],[])]};return n.callFunction("\\\\cdparent",[a],[]);case"\\\\cdlongequal":return n.callFunction("\\\\cdlongequal",[],[]);case"\\Vert":return n.callFunction("\\Big",[{type:"textord",text:"\\Vert",mode:"math"}],[]);default:return{type:"textord",text:" ",mode:"math"}}}function vD(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 n=t.fetch().text;if("&"!==n&&"\\\\"!==n){if("\\end"===n){0===e[e.length-1].length&&e.pop();break}throw new qN("Expected \\\\ or \\cr or \\end",t.nextToken)}t.consume()}for(var r=[],i=[r],a=0;a<e.length;a++){for(var s=e[a],o=gD(),l=0;l<s.length;l++)if(fD(s[l])){r.push(o);var c=rD(s[l+=1]).text,h=new Array(2);if(h[0]={type:"ordgroup",mode:"math",body:[]},h[1]={type:"ordgroup",mode:"math",body:[]},"=|.".indexOf(c)>-1);else{if(!("<>AV".indexOf(c)>-1))throw new qN('Expected one of "<>AV=|." after @',s[l]);for(var u=0;u<2;u++){for(var d=!0,p=l+1;p<s.length;p++){if(mD(s[p],c)){d=!1,l=p;break}if(fD(s[p]))throw new qN("Missing a "+c+" character to complete a CD arrow.",s[p]);h[u].body.push(s[p])}if(d)throw new qN("Missing a "+c+" character to complete a CD arrow.",s[l])}}var g={type:"styling",body:[yD(c,h,t)],mode:"math",style:"display"};r.push(g),o=gD()}else o.body.push(s[l]);a%2==0?r.push(o):r.shift(),r=[],i.push(r)}return t.gullet.endGroup(),t.gullet.endGroup(),{type:"array",mode:"math",body:i,arraystretch:1,addJot:!0,rowGaps:[null],cols:new Array(i[0].length).fill({type:"align",align:"c",pregap:.25,postgap:.25}),colSeparationType:"CD",hLinesBeforeRow:new Array(i.length+1).fill([])}}s(yD,"cdArrow"),s(vD,"parseCD"),fR({type:"cdlabel",names:["\\\\cdleft","\\\\cdright"],props:{numArgs:1},handler(t,e){var{parser:n,funcName:r}=t;return{type:"cdlabel",mode:n.mode,side:r.slice(4),label:e[0]}},htmlBuilder(t,e){var n=e.havingStyle(e.style.sup()),r=sR.wrapFragment(NR(t.label,n,e),e);return r.classes.push("cd-label-"+t.side),r.style.bottom=jI(.8-r.depth),r.height=0,r.depth=0,r},mathmlBuilder(t,e){var n=new BR.MathNode("mrow",[qR(t.label,e)]);return(n=new BR.MathNode("mpadded",[n])).setAttribute("width","0"),"left"===t.side&&n.setAttribute("lspace","-1width"),n.setAttribute("voffset","0.7em"),(n=new BR.MathNode("mstyle",[n])).setAttribute("displaystyle","false"),n.setAttribute("scriptlevel","1"),n}}),fR({type:"cdlabelparent",names:["\\\\cdparent"],props:{numArgs:1},handler(t,e){var{parser:n}=t;return{type:"cdlabelparent",mode:n.mode,fragment:e[0]}},htmlBuilder(t,e){var n=sR.wrapFragment(NR(t.fragment,e),e);return n.classes.push("cd-vert-arrow"),n},mathmlBuilder:(t,e)=>new BR.MathNode("mrow",[qR(t.fragment,e)])}),fR({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler(t,e){for(var{parser:n}=t,r=nD(e[0],"ordgroup").body,i="",a=0;a<r.length;a++){i+=nD(r[a],"textord").text}var s,o=parseInt(i);if(isNaN(o))throw new qN("\\@char has non-numeric argument "+i);if(o<0||o>=1114111)throw new qN("\\@char with invalid code point "+i);return o<=65535?s=String.fromCharCode(o):(o-=65536,s=String.fromCharCode(55296+(o>>10),56320+(1023&o))),{type:"textord",mode:n.mode,text:s}}});var xD=s(((t,e)=>{var n=_R(t.body,e.withColor(t.color),!1);return sR.makeFragment(n)}),"htmlBuilder$8"),bD=s(((t,e)=>{var n=UR(t.body,e.withColor(t.color)),r=new BR.MathNode("mstyle",n);return r.setAttribute("mathcolor",t.color),r}),"mathmlBuilder$7");fR({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,argTypes:["color","original"]},handler(t,e){var{parser:n}=t,r=nD(e[0],"color-token").color,i=e[1];return{type:"color",mode:n.mode,color:r,body:vR(i)}},htmlBuilder:xD,mathmlBuilder:bD}),fR({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,argTypes:["color"]},handler(t,e){var{parser:n,breakOnTokenText:r}=t,i=nD(e[0],"color-token").color;n.gullet.macros.set("\\current@color",i);var a=n.parseExpression(!0,r);return{type:"color",mode:n.mode,color:i,body:a}},htmlBuilder:xD,mathmlBuilder:bD}),fR({type:"cr",names:["\\\\"],props:{numArgs:0,numOptionalArgs:0,allowedInText:!0},handler(t,e,n){var{parser:r}=t,i="["===r.gullet.future().text?r.parseSizeGroup(!0):null,a=!r.settings.displayMode||!r.settings.useStrictBehavior("newLineInDisplayMode","In LaTeX, \\\\ or \\newline does nothing in display mode");return{type:"cr",mode:r.mode,newLine:a,size:i&&nD(i,"size").value}},htmlBuilder(t,e){var n=sR.makeSpan(["mspace"],[],e);return t.newLine&&(n.classes.push("newline"),t.size&&(n.style.marginTop=jI(qI(t.size,e)))),n},mathmlBuilder(t,e){var n=new BR.MathNode("mspace");return t.newLine&&(n.setAttribute("linebreak","newline"),t.size&&n.setAttribute("height",jI(qI(t.size,e)))),n}});var wD={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},kD=s((t=>{var e=t.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(e))throw new qN("Expected a control sequence",t);return e}),"checkControlSequence"),TD=s((t=>{var e=t.gullet.popToken();return"="===e.text&&" "===(e=t.gullet.popToken()).text&&(e=t.gullet.popToken()),e}),"getRHS"),_D=s(((t,e,n,r)=>{var i=t.gullet.macros.get(n.text);null==i&&(n.noexpand=!0,i={tokens:[n],numArgs:0,unexpandable:!t.gullet.isExpandable(n.text)}),t.gullet.macros.set(e,i,r)}),"letCommand");fR({type:"internal",names:["\\global","\\long","\\\\globallong"],props:{numArgs:0,allowedInText:!0},handler(t){var{parser:e,funcName:n}=t;e.consumeSpaces();var r=e.fetch();if(wD[r.text])return"\\global"!==n&&"\\\\globallong"!==n||(r.text=wD[r.text]),nD(e.parseFunction(),"internal");throw new qN("Invalid token after macro prefix",r)}}),fR({type:"internal",names:["\\def","\\gdef","\\edef","\\xdef"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t){var{parser:e,funcName:n}=t,r=e.gullet.popToken(),i=r.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(i))throw new qN("Expected a control sequence",r);for(var a,s=0,o=[[]];"{"!==e.gullet.future().text;)if("#"===(r=e.gullet.popToken()).text){if("{"===e.gullet.future().text){a=e.gullet.future(),o[s].push("{");break}if(r=e.gullet.popToken(),!/^[1-9]$/.test(r.text))throw new qN('Invalid argument number "'+r.text+'"');if(parseInt(r.text)!==s+1)throw new qN('Argument number "'+r.text+'" out of order');s++,o.push([])}else{if("EOF"===r.text)throw new qN("Expected a macro definition");o[s].push(r.text)}var{tokens:l}=e.gullet.consumeArg();return a&&l.unshift(a),"\\edef"!==n&&"\\xdef"!==n||(l=e.gullet.expandTokens(l)).reverse(),e.gullet.macros.set(i,{tokens:l,numArgs:s,delimiters:o},n===wD[n]),{type:"internal",mode:e.mode}}}),fR({type:"internal",names:["\\let","\\\\globallet"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t){var{parser:e,funcName:n}=t,r=kD(e.gullet.popToken());e.gullet.consumeSpaces();var i=TD(e);return _D(e,r,i,"\\\\globallet"===n),{type:"internal",mode:e.mode}}}),fR({type:"internal",names:["\\futurelet","\\\\globalfuture"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t){var{parser:e,funcName:n}=t,r=kD(e.gullet.popToken()),i=e.gullet.popToken(),a=e.gullet.popToken();return _D(e,r,a,"\\\\globalfuture"===n),e.gullet.pushToken(a),e.gullet.pushToken(i),{type:"internal",mode:e.mode}}});var ED=s((function(t,e,n){var r=RI(oM.math[t]&&oM.math[t].replace||t,e,n);if(!r)throw new Error("Unsupported symbol "+t+" and font size "+e+".");return r}),"getMetrics"),CD=s((function(t,e,n,r){var i=n.havingBaseStyle(e),a=sR.makeSpan(r.concat(i.sizingClasses(n)),[t],n),s=i.sizeMultiplier/n.sizeMultiplier;return a.height*=s,a.depth*=s,a.maxFontSize=i.sizeMultiplier,a}),"styleWrap"),SD=s((function(t,e,n){var r=e.havingBaseStyle(n),i=(1-e.sizeMultiplier/r.sizeMultiplier)*e.fontMetrics().axisHeight;t.classes.push("delimcenter"),t.style.top=jI(i),t.height-=i,t.depth+=i}),"centerSpan"),AD=s((function(t,e,n,r,i,a){var s=sR.makeSymbol(t,"Main-Regular",i,r),o=CD(s,e,r,a);return n&&SD(o,r,e),o}),"makeSmallDelim"),LD=s((function(t,e,n,r){return sR.makeSymbol(t,"Size"+e+"-Regular",n,r)}),"mathrmSize"),ND=s((function(t,e,n,r,i,a){var s=LD(t,e,i,r),o=CD(sR.makeSpan(["delimsizing","size"+e],[s],r),dI.TEXT,r,a);return n&&SD(o,r,dI.TEXT),o}),"makeLargeDelim"),ID=s((function(t,e,n){var r;return r="Size1-Regular"===e?"delim-size1":"delim-size4",{type:"elem",elem:sR.makeSpan(["delimsizinginner",r],[sR.makeSpan([],[sR.makeSymbol(t,e,n)])])}}),"makeGlyphSpan"),MD=s((function(t,e,n){var r=LI["Size4-Regular"][t.charCodeAt(0)]?LI["Size4-Regular"][t.charCodeAt(0)][4]:LI["Size1-Regular"][t.charCodeAt(0)][4],i=new eM("inner",EI(t,Math.round(1e3*e))),a=new tM([i],{width:jI(r),height:jI(e),style:"width:"+jI(r),viewBox:"0 0 "+1e3*r+" "+Math.round(1e3*e),preserveAspectRatio:"xMinYMin"}),s=sR.makeSvgSpan([],[a],n);return s.height=e,s.style.height=jI(e),s.style.width=jI(r),{type:"elem",elem:s}}),"makeInner"),RD={type:"kern",size:-.008},DD=["|","\\lvert","\\rvert","\\vert"],OD=["\\|","\\lVert","\\rVert","\\Vert"],PD=s((function(t,e,n,r,i,a){var s,o,l,c,h="",u=0;s=l=c=t,o=null;var d="Size1-Regular";"\\uparrow"===t?l=c="⏐":"\\Uparrow"===t?l=c="‖":"\\downarrow"===t?s=l="⏐":"\\Downarrow"===t?s=l="‖":"\\updownarrow"===t?(s="\\uparrow",l="⏐",c="\\downarrow"):"\\Updownarrow"===t?(s="\\Uparrow",l="‖",c="\\Downarrow"):tI.contains(DD,t)?(l="∣",h="vert",u=333):tI.contains(OD,t)?(l="∥",h="doublevert",u=556):"["===t||"\\lbrack"===t?(s="⎡",l="⎢",c="⎣",d="Size4-Regular",h="lbrack",u=667):"]"===t||"\\rbrack"===t?(s="⎤",l="⎥",c="⎦",d="Size4-Regular",h="rbrack",u=667):"\\lfloor"===t||"⌊"===t?(l=s="⎢",c="⎣",d="Size4-Regular",h="lfloor",u=667):"\\lceil"===t||"⌈"===t?(s="⎡",l=c="⎢",d="Size4-Regular",h="lceil",u=667):"\\rfloor"===t||"⌋"===t?(l=s="⎥",c="⎦",d="Size4-Regular",h="rfloor",u=667):"\\rceil"===t||"⌉"===t?(s="⎤",l=c="⎥",d="Size4-Regular",h="rceil",u=667):"("===t||"\\lparen"===t?(s="⎛",l="⎜",c="⎝",d="Size4-Regular",h="lparen",u=875):")"===t||"\\rparen"===t?(s="⎞",l="⎟",c="⎠",d="Size4-Regular",h="rparen",u=875):"\\{"===t||"\\lbrace"===t?(s="⎧",o="⎨",c="⎩",l="⎪",d="Size4-Regular"):"\\}"===t||"\\rbrace"===t?(s="⎫",o="⎬",c="⎭",l="⎪",d="Size4-Regular"):"\\lgroup"===t||"⟮"===t?(s="⎧",c="⎩",l="⎪",d="Size4-Regular"):"\\rgroup"===t||"⟯"===t?(s="⎫",c="⎭",l="⎪",d="Size4-Regular"):"\\lmoustache"===t||"⎰"===t?(s="⎧",c="⎭",l="⎪",d="Size4-Regular"):"\\rmoustache"!==t&&"⎱"!==t||(s="⎫",c="⎩",l="⎪",d="Size4-Regular");var p=ED(s,d,i),g=p.height+p.depth,f=ED(l,d,i),m=f.height+f.depth,y=ED(c,d,i),v=y.height+y.depth,x=0,b=1;if(null!==o){var w=ED(o,d,i);x=w.height+w.depth,b=2}var k=g+v+x,T=k+Math.max(0,Math.ceil((e-k)/(b*m)))*b*m,_=r.fontMetrics().axisHeight;n&&(_*=r.sizeMultiplier);var E=T/2-_,C=[];if(h.length>0){var S=T-g-v,A=Math.round(1e3*T),L=SI(h,Math.round(1e3*S)),N=new eM(h,L),I=(u/1e3).toFixed(3)+"em",M=(A/1e3).toFixed(3)+"em",R=new tM([N],{width:I,height:M,viewBox:"0 0 "+u+" "+A}),D=sR.makeSvgSpan([],[R],r);D.height=A/1e3,D.style.width=I,D.style.height=M,C.push({type:"elem",elem:D})}else{if(C.push(ID(c,d,i)),C.push(RD),null===o){var O=T-g-v+.016;C.push(MD(l,O,r))}else{var P=(T-g-v-x)/2+.016;C.push(MD(l,P,r)),C.push(RD),C.push(ID(o,d,i)),C.push(RD),C.push(MD(l,P,r))}C.push(RD),C.push(ID(s,d,i))}var B=r.havingBaseStyle(dI.TEXT),$=sR.makeVList({positionType:"bottom",positionData:E,children:C},B);return CD(sR.makeSpan(["delimsizing","mult"],[$],B),dI.TEXT,r,a)}),"makeStackedDelim"),BD=s((function(t,e,n,r,i){var a=_I(t,r,n),s=new eM(t,a),o=new tM([s],{width:"400em",height:jI(e),viewBox:"0 0 400000 "+n,preserveAspectRatio:"xMinYMin slice"});return sR.makeSvgSpan(["hide-tail"],[o],i)}),"sqrtSvg"),$D=s((function(t,e){var n,r,i=e.havingBaseSizing(),a=VD("\\surd",t*i.sizeMultiplier,WD,i),s=i.sizeMultiplier,o=Math.max(0,e.minRuleThickness-e.fontMetrics().sqrtRuleThickness),l=0,c=0,h=0;return"small"===a.type?(t<1?s=1:t<1.4&&(s=.7),c=(1+o)/s,(n=BD("sqrtMain",l=(1+o+.08)/s,h=1e3+1e3*o+80,o,e)).style.minWidth="0.853em",r=.833/s):"large"===a.type?(h=1080*GD[a.size],c=(GD[a.size]+o)/s,l=(GD[a.size]+o+.08)/s,(n=BD("sqrtSize"+a.size,l,h,o,e)).style.minWidth="1.02em",r=1/s):(l=t+o+.08,c=t+o,h=Math.floor(1e3*t+o)+80,(n=BD("sqrtTall",l,h,o,e)).style.minWidth="0.742em",r=1.056),n.height=c,n.style.height=jI(l),{span:n,advanceWidth:r,ruleWidth:(e.fontMetrics().sqrtRuleThickness+o)*s}}),"makeSqrtImage"),FD=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","\\surd"],zD=["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱"],UD=["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"],GD=[0,1.2,1.8,2.4,3],qD=s((function(t,e,n,r,i){if("<"===t||"\\lt"===t||"⟨"===t?t="\\langle":">"!==t&&"\\gt"!==t&&"⟩"!==t||(t="\\rangle"),tI.contains(FD,t)||tI.contains(UD,t))return ND(t,e,!1,n,r,i);if(tI.contains(zD,t))return PD(t,GD[e],!1,n,r,i);throw new qN("Illegal delimiter: '"+t+"'")}),"makeSizedDelim"),jD=[{type:"small",style:dI.SCRIPTSCRIPT},{type:"small",style:dI.SCRIPT},{type:"small",style:dI.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],YD=[{type:"small",style:dI.SCRIPTSCRIPT},{type:"small",style:dI.SCRIPT},{type:"small",style:dI.TEXT},{type:"stack"}],WD=[{type:"small",style:dI.SCRIPTSCRIPT},{type:"small",style:dI.SCRIPT},{type:"small",style:dI.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],HD=s((function(t){if("small"===t.type)return"Main-Regular";if("large"===t.type)return"Size"+t.size+"-Regular";if("stack"===t.type)return"Size4-Regular";throw new Error("Add support for delim type '"+t.type+"' here.")}),"delimTypeToFont"),VD=s((function(t,e,n,r){for(var i=Math.min(2,3-r.style.size);i<n.length&&"stack"!==n[i].type;i++){var a=ED(t,HD(n[i]),"math"),s=a.height+a.depth;if("small"===n[i].type&&(s*=r.havingBaseStyle(n[i].style).sizeMultiplier),s>e)return n[i]}return n[n.length-1]}),"traverseSequence"),XD=s((function(t,e,n,r,i,a){var s;"<"===t||"\\lt"===t||"⟨"===t?t="\\langle":">"!==t&&"\\gt"!==t&&"⟩"!==t||(t="\\rangle"),s=tI.contains(UD,t)?jD:tI.contains(FD,t)?WD:YD;var o=VD(t,e,s,r);return"small"===o.type?AD(t,o.style,n,r,i,a):"large"===o.type?ND(t,o.size,n,r,i,a):PD(t,e,n,r,i,a)}),"makeCustomSizedDelim"),KD=s((function(t,e,n,r,i,a){var s=r.fontMetrics().axisHeight*r.sizeMultiplier,o=5/r.fontMetrics().ptPerEm,l=Math.max(e-s,n+s),c=Math.max(l/500*901,2*l-o);return XD(t,c,!0,r,i,a)}),"makeLeftRightDelim"),ZD={sqrtImage:$D,sizedDelim:qD,sizeToMaxHeight:GD,customSizedDelim:XD,leftRightDelim:KD},QD={"\\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}},JD=["(","\\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 tO(t,e){var n=iD(t);if(n&&tI.contains(JD,n.text))return n;throw new qN(n?"Invalid delimiter '"+n.text+"' after '"+e.funcName+"'":"Invalid delimiter type '"+t.type+"'",t)}function eO(t){if(!t.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}s(tO,"checkDelimiter"),fR({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:s(((t,e)=>{var n=tO(e[0],t);return{type:"delimsizing",mode:t.parser.mode,size:QD[t.funcName].size,mclass:QD[t.funcName].mclass,delim:n.text}}),"handler"),htmlBuilder:s(((t,e)=>"."===t.delim?sR.makeSpan([t.mclass]):ZD.sizedDelim(t.delim,t.size,e,t.mode,[t.mclass])),"htmlBuilder"),mathmlBuilder:s((t=>{var e=[];"."!==t.delim&&e.push($R(t.delim,t.mode));var n=new BR.MathNode("mo",e);"mopen"===t.mclass||"mclose"===t.mclass?n.setAttribute("fence","true"):n.setAttribute("fence","false"),n.setAttribute("stretchy","true");var r=jI(ZD.sizeToMaxHeight[t.size]);return n.setAttribute("minsize",r),n.setAttribute("maxsize",r),n}),"mathmlBuilder")}),s(eO,"assertParsed"),fR({type:"leftright-right",names:["\\right"],props:{numArgs:1,primitive:!0},handler:s(((t,e)=>{var n=t.parser.gullet.macros.get("\\current@color");if(n&&"string"!=typeof n)throw new qN("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:t.parser.mode,delim:tO(e[0],t).text,color:n}}),"handler")}),fR({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:s(((t,e)=>{var n=tO(e[0],t),r=t.parser;++r.leftrightDepth;var i=r.parseExpression(!1);--r.leftrightDepth,r.expect("\\right",!1);var a=nD(r.parseFunction(),"leftright-right");return{type:"leftright",mode:r.mode,body:i,left:n.text,right:a.delim,rightColor:a.color}}),"handler"),htmlBuilder:s(((t,e)=>{eO(t);for(var n,r,i=_R(t.body,e,!0,["mopen","mclose"]),a=0,s=0,o=!1,l=0;l<i.length;l++)i[l].isMiddle?o=!0:(a=Math.max(i[l].height,a),s=Math.max(i[l].depth,s));if(a*=e.sizeMultiplier,s*=e.sizeMultiplier,n="."===t.left?LR(e,["mopen"]):ZD.leftRightDelim(t.left,a,s,e,t.mode,["mopen"]),i.unshift(n),o)for(var c=1;c<i.length;c++){var h=i[c].isMiddle;h&&(i[c]=ZD.leftRightDelim(h.delim,a,s,h.options,t.mode,[]))}if("."===t.right)r=LR(e,["mclose"]);else{var u=t.rightColor?e.withColor(t.rightColor):e;r=ZD.leftRightDelim(t.right,a,s,u,t.mode,["mclose"])}return i.push(r),sR.makeSpan(["minner"],i,e)}),"htmlBuilder"),mathmlBuilder:s(((t,e)=>{eO(t);var n=UR(t.body,e);if("."!==t.left){var r=new BR.MathNode("mo",[$R(t.left,t.mode)]);r.setAttribute("fence","true"),n.unshift(r)}if("."!==t.right){var i=new BR.MathNode("mo",[$R(t.right,t.mode)]);i.setAttribute("fence","true"),t.rightColor&&i.setAttribute("mathcolor",t.rightColor),n.push(i)}return FR(n)}),"mathmlBuilder")}),fR({type:"middle",names:["\\middle"],props:{numArgs:1,primitive:!0},handler:s(((t,e)=>{var n=tO(e[0],t);if(!t.parser.leftrightDepth)throw new qN("\\middle without preceding \\left",n);return{type:"middle",mode:t.parser.mode,delim:n.text}}),"handler"),htmlBuilder:s(((t,e)=>{var n;if("."===t.delim)n=LR(e,[]);else{n=ZD.sizedDelim(t.delim,1,e,t.mode,[]);var r={delim:t.delim,options:e};n.isMiddle=r}return n}),"htmlBuilder"),mathmlBuilder:s(((t,e)=>{var n="\\vert"===t.delim||"|"===t.delim?$R("|","text"):$R(t.delim,t.mode),r=new BR.MathNode("mo",[n]);return r.setAttribute("fence","true"),r.setAttribute("lspace","0.05em"),r.setAttribute("rspace","0.05em"),r}),"mathmlBuilder")});var nO=s(((t,e)=>{var n,r,i=sR.wrapFragment(NR(t.body,e),e),a=t.label.slice(1),s=e.sizeMultiplier,o=0,l=tI.isCharacterBox(t.body);if("sout"===a)(n=sR.makeSpan(["stretchy","sout"])).height=e.fontMetrics().defaultRuleThickness/s,o=-.5*e.fontMetrics().xHeight;else if("phase"===a){var c=qI({number:.6,unit:"pt"},e),h=qI({number:.35,unit:"ex"},e);s/=e.havingBaseSizing().sizeMultiplier;var u=i.height+i.depth+c+h;i.style.paddingLeft=jI(u/2+c);var d=Math.floor(1e3*u*s),p=kI(d),g=new tM([new eM("phase",p)],{width:"400em",height:jI(d/1e3),viewBox:"0 0 400000 "+d,preserveAspectRatio:"xMinYMin slice"});(n=sR.makeSvgSpan(["hide-tail"],[g],e)).style.height=jI(u),o=i.depth+c+h}else{/cancel/.test(a)?l||i.classes.push("cancel-pad"):"angl"===a?i.classes.push("anglpad"):i.classes.push("boxpad");var f=0,m=0,y=0;/box/.test(a)?(y=Math.max(e.fontMetrics().fboxrule,e.minRuleThickness),m=f=e.fontMetrics().fboxsep+("colorbox"===a?0:y)):"angl"===a?(f=4*(y=Math.max(e.fontMetrics().defaultRuleThickness,e.minRuleThickness)),m=Math.max(0,.25-i.depth)):m=f=l?.2:0,n=eD.encloseSpan(i,a,f,m,e),/fbox|boxed|fcolorbox/.test(a)?(n.style.borderStyle="solid",n.style.borderWidth=jI(y)):"angl"===a&&.049!==y&&(n.style.borderTopWidth=jI(y),n.style.borderRightWidth=jI(y)),o=i.depth+m,t.backgroundColor&&(n.style.backgroundColor=t.backgroundColor,t.borderColor&&(n.style.borderColor=t.borderColor))}if(t.backgroundColor)r=sR.makeVList({positionType:"individualShift",children:[{type:"elem",elem:n,shift:o},{type:"elem",elem:i,shift:0}]},e);else{var v=/cancel|phase/.test(a)?["svg-align"]:[];r=sR.makeVList({positionType:"individualShift",children:[{type:"elem",elem:i,shift:0},{type:"elem",elem:n,shift:o,wrapperClasses:v}]},e)}return/cancel/.test(a)&&(r.height=i.height,r.depth=i.depth),/cancel/.test(a)&&!l?sR.makeSpan(["mord","cancel-lap"],[r],e):sR.makeSpan(["mord"],[r],e)}),"htmlBuilder$7"),rO=s(((t,e)=>{var n=0,r=new BR.MathNode(t.label.indexOf("colorbox")>-1?"mpadded":"menclose",[qR(t.body,e)]);switch(t.label){case"\\cancel":r.setAttribute("notation","updiagonalstrike");break;case"\\bcancel":r.setAttribute("notation","downdiagonalstrike");break;case"\\phase":r.setAttribute("notation","phasorangle");break;case"\\sout":r.setAttribute("notation","horizontalstrike");break;case"\\fbox":r.setAttribute("notation","box");break;case"\\angl":r.setAttribute("notation","actuarial");break;case"\\fcolorbox":case"\\colorbox":if(n=e.fontMetrics().fboxsep*e.fontMetrics().ptPerEm,r.setAttribute("width","+"+2*n+"pt"),r.setAttribute("height","+"+2*n+"pt"),r.setAttribute("lspace",n+"pt"),r.setAttribute("voffset",n+"pt"),"\\fcolorbox"===t.label){var i=Math.max(e.fontMetrics().fboxrule,e.minRuleThickness);r.setAttribute("style","border: "+i+"em solid "+String(t.borderColor))}break;case"\\xcancel":r.setAttribute("notation","updiagonalstrike downdiagonalstrike")}return t.backgroundColor&&r.setAttribute("mathbackground",t.backgroundColor),r}),"mathmlBuilder$6");fR({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,argTypes:["color","text"]},handler(t,e,n){var{parser:r,funcName:i}=t,a=nD(e[0],"color-token").color,s=e[1];return{type:"enclose",mode:r.mode,label:i,backgroundColor:a,body:s}},htmlBuilder:nO,mathmlBuilder:rO}),fR({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,argTypes:["color","color","text"]},handler(t,e,n){var{parser:r,funcName:i}=t,a=nD(e[0],"color-token").color,s=nD(e[1],"color-token").color,o=e[2];return{type:"enclose",mode:r.mode,label:i,backgroundColor:s,borderColor:a,body:o}},htmlBuilder:nO,mathmlBuilder:rO}),fR({type:"enclose",names:["\\fbox"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!0},handler(t,e){var{parser:n}=t;return{type:"enclose",mode:n.mode,label:"\\fbox",body:e[0]}}}),fR({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\sout","\\phase"],props:{numArgs:1},handler(t,e){var{parser:n,funcName:r}=t,i=e[0];return{type:"enclose",mode:n.mode,label:r,body:i}},htmlBuilder:nO,mathmlBuilder:rO}),fR({type:"enclose",names:["\\angl"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!1},handler(t,e){var{parser:n}=t;return{type:"enclose",mode:n.mode,label:"\\angl",body:e[0]}}});var iO={};function aO(t){for(var{type:e,names:n,props:r,handler:i,htmlBuilder:a,mathmlBuilder:s}=t,o={type:e,numArgs:r.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:i},l=0;l<n.length;++l)iO[n[l]]=o;a&&(pR[e]=a),s&&(gR[e]=s)}s(aO,"defineEnvironment");var sO={};function oO(t,e){sO[t]=e}function lO(t){var e=[];t.consumeSpaces();var n=t.fetch().text;for("\\relax"===n&&(t.consume(),t.consumeSpaces(),n=t.fetch().text);"\\hline"===n||"\\hdashline"===n;)t.consume(),e.push("\\hdashline"===n),t.consumeSpaces(),n=t.fetch().text;return e}s(oO,"defineMacro"),s(lO,"getHLines");var cO=s((t=>{if(!t.parser.settings.displayMode)throw new qN("{"+t.envName+"} can be used only in display mode.")}),"validateAmsEnvironmentContext");function hO(t){if(-1===t.indexOf("ed"))return-1===t.indexOf("*")}function uO(t,e,n){var{hskipBeforeAndAfter:r,addJot:i,cols:a,arraystretch:o,colSeparationType:l,autoTag:c,singleRow:h,emptySingleRow:u,maxNumCols:d,leqno:p}=e;if(t.gullet.beginGroup(),h||t.gullet.macros.set("\\cr","\\\\\\relax"),!o){var g=t.gullet.expandMacroAsText("\\arraystretch");if(null==g)o=1;else if(!(o=parseFloat(g))||o<0)throw new qN("Invalid \\arraystretch: "+g)}t.gullet.beginGroup();var f=[],m=[f],y=[],v=[],x=null!=c?[]:void 0;function b(){c&&t.gullet.macros.set("\\@eqnsw","1",!0)}function w(){x&&(t.gullet.macros.get("\\df@tag")?(x.push(t.subparse([new GN("\\df@tag")])),t.gullet.macros.set("\\df@tag",void 0,!0)):x.push(Boolean(c)&&"1"===t.gullet.macros.get("\\@eqnsw")))}for(s(b,"beginRow"),s(w,"endRow"),b(),v.push(lO(t));;){var k=t.parseExpression(!1,h?"\\end":"\\\\");t.gullet.endGroup(),t.gullet.beginGroup(),k={type:"ordgroup",mode:t.mode,body:k},n&&(k={type:"styling",mode:t.mode,style:n,body:[k]}),f.push(k);var T=t.fetch().text;if("&"===T){if(d&&f.length===d){if(h||l)throw new qN("Too many tab characters: &",t.nextToken);t.settings.reportNonstrict("textEnv","Too few columns specified in the {array} column argument.")}t.consume()}else{if("\\end"===T){w(),1===f.length&&"styling"===k.type&&0===k.body[0].body.length&&(m.length>1||!u)&&m.pop(),v.length<m.length+1&&v.push([]);break}if("\\\\"!==T)throw new qN("Expected & or \\\\ or \\cr or \\end",t.nextToken);t.consume();var _=void 0;" "!==t.gullet.future().text&&(_=t.parseSizeGroup(!0)),y.push(_?_.value:null),w(),v.push(lO(t)),f=[],m.push(f),b()}}return t.gullet.endGroup(),t.gullet.endGroup(),{type:"array",mode:t.mode,addJot:i,arraystretch:o,body:m,cols:a,rowGaps:y,hskipBeforeAndAfter:r,hLinesBeforeRow:v,colSeparationType:l,tags:x,leqno:p}}function dO(t){return"d"===t.slice(0,1)?"display":"text"}s(hO,"getAutoTag"),s(uO,"parseArray"),s(dO,"dCellStyle");var pO=s((function(t,e){var n,r,i=t.body.length,a=t.hLinesBeforeRow,o=0,l=new Array(i),c=[],h=Math.max(e.fontMetrics().arrayRuleWidth,e.minRuleThickness),u=1/e.fontMetrics().ptPerEm,d=5*u;t.colSeparationType&&"small"===t.colSeparationType&&(d=e.havingStyle(dI.SCRIPT).sizeMultiplier/e.sizeMultiplier*.2778);var p="CD"===t.colSeparationType?qI({number:3,unit:"ex"},e):12*u,g=3*u,f=t.arraystretch*p,m=.7*f,y=.3*f,v=0;function x(t){for(var e=0;e<t.length;++e)e>0&&(v+=.25),c.push({pos:v,isDashed:t[e]})}for(s(x,"setHLinePos"),x(a[0]),n=0;n<t.body.length;++n){var b=t.body[n],w=m,k=y;o<b.length&&(o=b.length);var T=new Array(b.length);for(r=0;r<b.length;++r){var _=NR(b[r],e);k<_.depth&&(k=_.depth),w<_.height&&(w=_.height),T[r]=_}var E=t.rowGaps[n],C=0;E&&(C=qI(E,e))>0&&(k<(C+=y)&&(k=C),C=0),t.addJot&&(k+=g),T.height=w,T.depth=k,v+=w,T.pos=v,v+=k+C,l[n]=T,x(a[n+1])}var S,A,L=v/2+e.fontMetrics().axisHeight,N=t.cols||[],I=[],M=[];if(t.tags&&t.tags.some((t=>t)))for(n=0;n<i;++n){var R=l[n],D=R.pos-L,O=t.tags[n],P=void 0;(P=!0===O?sR.makeSpan(["eqn-num"],[],e):!1===O?sR.makeSpan([],[],e):sR.makeSpan([],_R(O,e,!0),e)).depth=R.depth,P.height=R.height,M.push({type:"elem",elem:P,shift:D})}for(r=0,A=0;r<o||A<N.length;++r,++A){for(var B=N[A]||{},$=!0;"separator"===B.type;){if($||((S=sR.makeSpan(["arraycolsep"],[])).style.width=jI(e.fontMetrics().doubleRuleSep),I.push(S)),"|"!==B.separator&&":"!==B.separator)throw new qN("Invalid separator type: "+B.separator);var F="|"===B.separator?"solid":"dashed",z=sR.makeSpan(["vertical-separator"],[],e);z.style.height=jI(v),z.style.borderRightWidth=jI(h),z.style.borderRightStyle=F,z.style.margin="0 "+jI(-h/2);var U=v-L;U&&(z.style.verticalAlign=jI(-U)),I.push(z),B=N[++A]||{},$=!1}if(!(r>=o)){var G=void 0;(r>0||t.hskipBeforeAndAfter)&&0!==(G=tI.deflt(B.pregap,d))&&((S=sR.makeSpan(["arraycolsep"],[])).style.width=jI(G),I.push(S));var q=[];for(n=0;n<i;++n){var j=l[n],Y=j[r];if(Y){var W=j.pos-L;Y.depth=j.depth,Y.height=j.height,q.push({type:"elem",elem:Y,shift:W})}}q=sR.makeVList({positionType:"individualShift",children:q},e),q=sR.makeSpan(["col-align-"+(B.align||"c")],[q]),I.push(q),(r<o-1||t.hskipBeforeAndAfter)&&0!==(G=tI.deflt(B.postgap,d))&&((S=sR.makeSpan(["arraycolsep"],[])).style.width=jI(G),I.push(S))}}if(l=sR.makeSpan(["mtable"],I),c.length>0){for(var H=sR.makeLineSpan("hline",e,h),V=sR.makeLineSpan("hdashline",e,h),X=[{type:"elem",elem:l,shift:0}];c.length>0;){var K=c.pop(),Z=K.pos-L;K.isDashed?X.push({type:"elem",elem:V,shift:Z}):X.push({type:"elem",elem:H,shift:Z})}l=sR.makeVList({positionType:"individualShift",children:X},e)}if(0===M.length)return sR.makeSpan(["mord"],[l],e);var Q=sR.makeVList({positionType:"individualShift",children:M},e);return Q=sR.makeSpan(["tag"],[Q],e),sR.makeFragment([l,Q])}),"htmlBuilder"),gO={c:"center ",l:"left ",r:"right "},fO=s((function(t,e){for(var n=[],r=new BR.MathNode("mtd",[],["mtr-glue"]),i=new BR.MathNode("mtd",[],["mml-eqn-num"]),a=0;a<t.body.length;a++){for(var s=t.body[a],o=[],l=0;l<s.length;l++)o.push(new BR.MathNode("mtd",[qR(s[l],e)]));t.tags&&t.tags[a]&&(o.unshift(r),o.push(r),t.leqno?o.unshift(i):o.push(i)),n.push(new BR.MathNode("mtr",o))}var c=new BR.MathNode("mtable",n),h=.5===t.arraystretch?.1:.16+t.arraystretch-1+(t.addJot?.09:0);c.setAttribute("rowspacing",jI(h));var u="",d="";if(t.cols&&t.cols.length>0){var p=t.cols,g="",f=!1,m=0,y=p.length;"separator"===p[0].type&&(u+="top ",m=1),"separator"===p[p.length-1].type&&(u+="bottom ",y-=1);for(var v=m;v<y;v++)"align"===p[v].type?(d+=gO[p[v].align],f&&(g+="none "),f=!0):"separator"===p[v].type&&f&&(g+="|"===p[v].separator?"solid ":"dashed ",f=!1);c.setAttribute("columnalign",d.trim()),/[sd]/.test(g)&&c.setAttribute("columnlines",g.trim())}if("align"===t.colSeparationType){for(var x=t.cols||[],b="",w=1;w<x.length;w++)b+=w%2?"0em ":"1em ";c.setAttribute("columnspacing",b.trim())}else"alignat"===t.colSeparationType||"gather"===t.colSeparationType?c.setAttribute("columnspacing","0em"):"small"===t.colSeparationType?c.setAttribute("columnspacing","0.2778em"):"CD"===t.colSeparationType?c.setAttribute("columnspacing","0.5em"):c.setAttribute("columnspacing","1em");var k="",T=t.hLinesBeforeRow;u+=T[0].length>0?"left ":"",u+=T[T.length-1].length>0?"right ":"";for(var _=1;_<T.length-1;_++)k+=0===T[_].length?"none ":T[_][0]?"dashed ":"solid ";return/[sd]/.test(k)&&c.setAttribute("rowlines",k.trim()),""!==u&&(c=new BR.MathNode("menclose",[c])).setAttribute("notation",u.trim()),t.arraystretch&&t.arraystretch<1&&(c=new BR.MathNode("mstyle",[c])).setAttribute("scriptlevel","1"),c}),"mathmlBuilder"),mO=s((function(t,e){-1===t.envName.indexOf("ed")&&cO(t);var n,r=[],i=t.envName.indexOf("at")>-1?"alignat":"align",a="split"===t.envName,s=uO(t.parser,{cols:r,addJot:!0,autoTag:a?void 0:hO(t.envName),emptySingleRow:!0,colSeparationType:i,maxNumCols:a?2:void 0,leqno:t.parser.settings.leqno},"display"),o=0,l={type:"ordgroup",mode:t.mode,body:[]};if(e[0]&&"ordgroup"===e[0].type){for(var c="",h=0;h<e[0].body.length;h++){c+=nD(e[0].body[h],"textord").text}n=Number(c),o=2*n}var u=!o;s.body.forEach((function(t){for(var e=1;e<t.length;e+=2){var r=nD(t[e],"styling");nD(r.body[0],"ordgroup").body.unshift(l)}if(u)o<t.length&&(o=t.length);else{var i=t.length/2;if(n<i)throw new qN("Too many math in a row: expected "+n+", but got "+i,t[0])}}));for(var d=0;d<o;++d){var p="r",g=0;d%2==1?p="l":d>0&&u&&(g=1),r[d]={type:"align",align:p,pregap:g,postgap:0}}return s.colSeparationType=u?"align":"alignat",s}),"alignedHandler");aO({type:"array",names:["array","darray"],props:{numArgs:1},handler(t,e){var n=(iD(e[0])?[e[0]]:nD(e[0],"ordgroup").body).map((function(t){var e=rD(t).text;if(-1!=="lcr".indexOf(e))return{type:"align",align:e};if("|"===e)return{type:"separator",separator:"|"};if(":"===e)return{type:"separator",separator:":"};throw new qN("Unknown column alignment: "+e,t)})),r={cols:n,hskipBeforeAndAfter:!0,maxNumCols:n.length};return uO(t.parser,r,dO(t.envName))},htmlBuilder:pO,mathmlBuilder:fO}),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("*","")],n="c",r={hskipBeforeAndAfter:!1,cols:[{type:"align",align:n}]};if("*"===t.envName.charAt(t.envName.length-1)){var i=t.parser;if(i.consumeSpaces(),"["===i.fetch().text){if(i.consume(),i.consumeSpaces(),n=i.fetch().text,-1==="lcr".indexOf(n))throw new qN("Expected l or c or r",i.nextToken);i.consume(),i.consumeSpaces(),i.expect("]"),i.consume(),r.cols=[{type:"align",align:n}]}}var a=uO(t.parser,r,dO(t.envName)),s=Math.max(0,...a.body.map((t=>t.length)));return a.cols=new Array(s).fill({type:"align",align:n}),e?{type:"leftright",mode:t.mode,body:[a],left:e[0],right:e[1],rightColor:void 0}:a},htmlBuilder:pO,mathmlBuilder:fO}),aO({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(t){var e=uO(t.parser,{arraystretch:.5},"script");return e.colSeparationType="small",e},htmlBuilder:pO,mathmlBuilder:fO}),aO({type:"array",names:["subarray"],props:{numArgs:1},handler(t,e){var n=(iD(e[0])?[e[0]]:nD(e[0],"ordgroup").body).map((function(t){var e=rD(t).text;if(-1!=="lc".indexOf(e))return{type:"align",align:e};throw new qN("Unknown column alignment: "+e,t)}));if(n.length>1)throw new qN("{subarray} can contain only one column");var r={cols:n,hskipBeforeAndAfter:!1,arraystretch:.5};if((r=uO(t.parser,r,"script")).body.length>0&&r.body[0].length>1)throw new qN("{subarray} can contain only one column");return r},htmlBuilder:pO,mathmlBuilder:fO}),aO({type:"array",names:["cases","dcases","rcases","drcases"],props:{numArgs:0},handler(t){var e=uO(t.parser,{arraystretch:1.2,cols:[{type:"align",align:"l",pregap:0,postgap:1},{type:"align",align:"l",pregap:0,postgap:0}]},dO(t.envName));return{type:"leftright",mode:t.mode,body:[e],left:t.envName.indexOf("r")>-1?".":"\\{",right:t.envName.indexOf("r")>-1?"\\}":".",rightColor:void 0}},htmlBuilder:pO,mathmlBuilder:fO}),aO({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:mO,htmlBuilder:pO,mathmlBuilder:fO}),aO({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(t){tI.contains(["gather","gather*"],t.envName)&&cO(t);var e={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:hO(t.envName),emptySingleRow:!0,leqno:t.parser.settings.leqno};return uO(t.parser,e,"display")},htmlBuilder:pO,mathmlBuilder:fO}),aO({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:mO,htmlBuilder:pO,mathmlBuilder:fO}),aO({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(t){cO(t);var e={autoTag:hO(t.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:t.parser.settings.leqno};return uO(t.parser,e,"display")},htmlBuilder:pO,mathmlBuilder:fO}),aO({type:"array",names:["CD"],props:{numArgs:0},handler:t=>(cO(t),vD(t.parser)),htmlBuilder:pO,mathmlBuilder:fO}),oO("\\nonumber","\\gdef\\@eqnsw{0}"),oO("\\notag","\\nonumber"),fR({type:"text",names:["\\hline","\\hdashline"],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler(t,e){throw new qN(t.funcName+" valid only within array environment")}});var yO=iO;fR({type:"environment",names:["\\begin","\\end"],props:{numArgs:1,argTypes:["text"]},handler(t,e){var{parser:n,funcName:r}=t,i=e[0];if("ordgroup"!==i.type)throw new qN("Invalid environment name",i);for(var a="",s=0;s<i.body.length;++s)a+=nD(i.body[s],"textord").text;if("\\begin"===r){if(!yO.hasOwnProperty(a))throw new qN("No such environment: "+a,i);var o=yO[a],{args:l,optArgs:c}=n.parseArguments("\\begin{"+a+"}",o),h={mode:n.mode,envName:a,parser:n},u=o.handler(h,l,c);n.expect("\\end",!1);var d=n.nextToken,p=nD(n.parseFunction(),"environment");if(p.name!==a)throw new qN("Mismatch: \\begin{"+a+"} matched by \\end{"+p.name+"}",d);return u}return{type:"environment",mode:n.mode,name:a,nameGroup:i}}});var vO=s(((t,e)=>{var n=t.font,r=e.withFont(n);return NR(t.body,r)}),"htmlBuilder$5"),xO=s(((t,e)=>{var n=t.font,r=e.withFont(n);return qR(t.body,r)}),"mathmlBuilder$4"),bO={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak","\\bm":"\\boldsymbol"};fR({type:"font",names:["\\mathrm","\\mathit","\\mathbf","\\mathnormal","\\mathbb","\\mathcal","\\mathfrak","\\mathscr","\\mathsf","\\mathtt","\\Bbb","\\bold","\\frak"],props:{numArgs:1,allowedInArgument:!0},handler:s(((t,e)=>{var{parser:n,funcName:r}=t,i=yR(e[0]),a=r;return a in bO&&(a=bO[a]),{type:"font",mode:n.mode,font:a.slice(1),body:i}}),"handler"),htmlBuilder:vO,mathmlBuilder:xO}),fR({type:"mclass",names:["\\boldsymbol","\\bm"],props:{numArgs:1},handler:s(((t,e)=>{var{parser:n}=t,r=e[0],i=tI.isCharacterBox(r);return{type:"mclass",mode:n.mode,mclass:dD(r),body:[{type:"font",mode:n.mode,font:"boldsymbol",body:r}],isCharacterBox:i}}),"handler")}),fR({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it","\\cal"],props:{numArgs:0,allowedInText:!0},handler:s(((t,e)=>{var{parser:n,funcName:r,breakOnTokenText:i}=t,{mode:a}=n,s=n.parseExpression(!0,i);return{type:"font",mode:a,font:"math"+r.slice(1),body:{type:"ordgroup",mode:n.mode,body:s}}}),"handler"),htmlBuilder:vO,mathmlBuilder:xO});var wO=s(((t,e)=>{var n=e;return"display"===t?n=n.id>=dI.SCRIPT.id?n.text():dI.DISPLAY:"text"===t&&n.size===dI.DISPLAY.size?n=dI.TEXT:"script"===t?n=dI.SCRIPT:"scriptscript"===t&&(n=dI.SCRIPTSCRIPT),n}),"adjustStyle"),kO=s(((t,e)=>{var n,r=wO(t.size,e.style),i=r.fracNum(),a=r.fracDen();n=e.havingStyle(i);var s=NR(t.numer,n,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}n=e.havingStyle(a);var c,h,u,d,p,g,f,m,y,v,x=NR(t.denom,n,e);if(t.hasBarLine?(t.barSize?(h=qI(t.barSize,e),c=sR.makeLineSpan("frac-line",e,h)):c=sR.makeLineSpan("frac-line",e),h=c.height,u=c.height):(c=null,h=0,u=e.fontMetrics().defaultRuleThickness),r.size===dI.DISPLAY.size||"display"===t.size?(d=e.fontMetrics().num1,p=h>0?3*u:7*u,g=e.fontMetrics().denom1):(h>0?(d=e.fontMetrics().num2,p=u):(d=e.fontMetrics().num3,p=3*u),g=e.fontMetrics().denom2),c){var b=e.fontMetrics().axisHeight;d-s.depth-(b+.5*h)<p&&(d+=p-(d-s.depth-(b+.5*h))),b-.5*h-(x.height-g)<p&&(g+=p-(b-.5*h-(x.height-g)));var w=-(b-.5*h);f=sR.makeVList({positionType:"individualShift",children:[{type:"elem",elem:x,shift:g},{type:"elem",elem:c,shift:w},{type:"elem",elem:s,shift:-d}]},e)}else{var k=d-s.depth-(x.height-g);k<p&&(d+=.5*(p-k),g+=.5*(p-k)),f=sR.makeVList({positionType:"individualShift",children:[{type:"elem",elem:x,shift:g},{type:"elem",elem:s,shift:-d}]},e)}return n=e.havingStyle(r),f.height*=n.sizeMultiplier/e.sizeMultiplier,f.depth*=n.sizeMultiplier/e.sizeMultiplier,m=r.size===dI.DISPLAY.size?e.fontMetrics().delim1:r.size===dI.SCRIPTSCRIPT.size?e.havingStyle(dI.SCRIPT).fontMetrics().delim2:e.fontMetrics().delim2,y=null==t.leftDelim?LR(e,["mopen"]):ZD.customSizedDelim(t.leftDelim,m,!0,e.havingStyle(r),t.mode,["mopen"]),v=t.continued?sR.makeSpan([]):null==t.rightDelim?LR(e,["mclose"]):ZD.customSizedDelim(t.rightDelim,m,!0,e.havingStyle(r),t.mode,["mclose"]),sR.makeSpan(["mord"].concat(n.sizingClasses(e)),[y,sR.makeSpan(["mfrac"],[f]),v],e)}),"htmlBuilder$4"),TO=s(((t,e)=>{var n=new BR.MathNode("mfrac",[qR(t.numer,e),qR(t.denom,e)]);if(t.hasBarLine){if(t.barSize){var r=qI(t.barSize,e);n.setAttribute("linethickness",jI(r))}}else n.setAttribute("linethickness","0px");var i=wO(t.size,e.style);if(i.size!==e.style.size){n=new BR.MathNode("mstyle",[n]);var a=i.size===dI.DISPLAY.size?"true":"false";n.setAttribute("displaystyle",a),n.setAttribute("scriptlevel","0")}if(null!=t.leftDelim||null!=t.rightDelim){var s=[];if(null!=t.leftDelim){var o=new BR.MathNode("mo",[new BR.TextNode(t.leftDelim.replace("\\",""))]);o.setAttribute("fence","true"),s.push(o)}if(s.push(n),null!=t.rightDelim){var l=new BR.MathNode("mo",[new BR.TextNode(t.rightDelim.replace("\\",""))]);l.setAttribute("fence","true"),s.push(l)}return FR(s)}return n}),"mathmlBuilder$3");fR({type:"genfrac",names:["\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac","\\\\bracefrac","\\\\brackfrac"],props:{numArgs:2,allowedInArgument:!0},handler:s(((t,e)=>{var n,{parser:r,funcName:i}=t,a=e[0],s=e[1],o=null,l=null,c="auto";switch(i){case"\\dfrac":case"\\frac":case"\\tfrac":n=!0;break;case"\\\\atopfrac":n=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":n=!1,o="(",l=")";break;case"\\\\bracefrac":n=!1,o="\\{",l="\\}";break;case"\\\\brackfrac":n=!1,o="[",l="]";break;default:throw new Error("Unrecognized genfrac command")}switch(i){case"\\dfrac":case"\\dbinom":c="display";break;case"\\tfrac":case"\\tbinom":c="text"}return{type:"genfrac",mode:r.mode,continued:!1,numer:a,denom:s,hasBarLine:n,leftDelim:o,rightDelim:l,size:c,barSize:null}}),"handler"),htmlBuilder:kO,mathmlBuilder:TO}),fR({type:"genfrac",names:["\\cfrac"],props:{numArgs:2},handler:s(((t,e)=>{var{parser:n,funcName:r}=t,i=e[0],a=e[1];return{type:"genfrac",mode:n.mode,continued:!0,numer:i,denom:a,hasBarLine:!0,leftDelim:null,rightDelim:null,size:"display",barSize:null}}),"handler")}),fR({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],props:{numArgs:0,infix:!0},handler(t){var e,{parser:n,funcName:r,token:i}=t;switch(r){case"\\over":e="\\frac";break;case"\\choose":e="\\binom";break;case"\\atop":e="\\\\atopfrac";break;case"\\brace":e="\\\\bracefrac";break;case"\\brack":e="\\\\brackfrac";break;default:throw new Error("Unrecognized infix genfrac command")}return{type:"infix",mode:n.mode,replaceWith:e,token:i}}});var _O=["display","text","script","scriptscript"],EO=s((function(t){var e=null;return t.length>0&&(e="."===(e=t)?null:e),e}),"delimFromValue");fR({type:"genfrac",names:["\\genfrac"],props:{numArgs:6,allowedInArgument:!0,argTypes:["math","math","size","text","math","math"]},handler(t,e){var n,{parser:r}=t,i=e[4],a=e[5],s=yR(e[0]),o="atom"===s.type&&"open"===s.family?EO(s.text):null,l=yR(e[1]),c="atom"===l.type&&"close"===l.family?EO(l.text):null,h=nD(e[2],"size"),u=null;n=!!h.isBlank||(u=h.value).number>0;var d="auto",p=e[3];if("ordgroup"===p.type){if(p.body.length>0){var g=nD(p.body[0],"textord");d=_O[Number(g.text)]}}else p=nD(p,"textord"),d=_O[Number(p.text)];return{type:"genfrac",mode:r.mode,numer:i,denom:a,continued:!1,hasBarLine:n,barSize:u,leftDelim:o,rightDelim:c,size:d}},htmlBuilder:kO,mathmlBuilder:TO}),fR({type:"infix",names:["\\above"],props:{numArgs:1,argTypes:["size"],infix:!0},handler(t,e){var{parser:n,funcName:r,token:i}=t;return{type:"infix",mode:n.mode,replaceWith:"\\\\abovefrac",size:nD(e[0],"size").value,token:i}}}),fR({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:s(((t,e)=>{var{parser:n,funcName:r}=t,i=e[0],a=JN(nD(e[1],"infix").size),s=e[2],o=a.number>0;return{type:"genfrac",mode:n.mode,numer:i,denom:s,continued:!1,hasBarLine:o,barSize:a,leftDelim:null,rightDelim:null,size:"auto"}}),"handler"),htmlBuilder:kO,mathmlBuilder:TO});var CO=s(((t,e)=>{var n,r,i=e.style;"supsub"===t.type?(n=t.sup?NR(t.sup,e.havingStyle(i.sup()),e):NR(t.sub,e.havingStyle(i.sub()),e),r=nD(t.base,"horizBrace")):r=nD(t,"horizBrace");var a,s=NR(r.base,e.havingBaseStyle(dI.DISPLAY)),o=eD.svgSpan(r,e);if(r.isOver?(a=sR.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:s},{type:"kern",size:.1},{type:"elem",elem:o}]},e)).children[0].children[0].children[1].classes.push("svg-align"):(a=sR.makeVList({positionType:"bottom",positionData:s.depth+.1+o.height,children:[{type:"elem",elem:o},{type:"kern",size:.1},{type:"elem",elem:s}]},e)).children[0].children[0].children[0].classes.push("svg-align"),n){var l=sR.makeSpan(["mord",r.isOver?"mover":"munder"],[a],e);a=r.isOver?sR.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:l},{type:"kern",size:.2},{type:"elem",elem:n}]},e):sR.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 sR.makeSpan(["mord",r.isOver?"mover":"munder"],[a],e)}),"htmlBuilder$3");fR({type:"horizBrace",names:["\\overbrace","\\underbrace"],props:{numArgs:1},handler(t,e){var{parser:n,funcName:r}=t;return{type:"horizBrace",mode:n.mode,label:r,isOver:/^\\over/.test(r),base:e[0]}},htmlBuilder:CO,mathmlBuilder:s(((t,e)=>{var n=eD.mathMLnode(t.label);return new BR.MathNode(t.isOver?"mover":"munder",[qR(t.base,e),n])}),"mathmlBuilder$2")}),fR({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:s(((t,e)=>{var{parser:n}=t,r=e[1],i=nD(e[0],"url").url;return n.settings.isTrusted({command:"\\href",url:i})?{type:"href",mode:n.mode,href:i,body:vR(r)}:n.formatUnsupportedCmd("\\href")}),"handler"),htmlBuilder:s(((t,e)=>{var n=_R(t.body,e,!1);return sR.makeAnchor(t.href,[],n,e)}),"htmlBuilder"),mathmlBuilder:s(((t,e)=>{var n=GR(t.body,e);return n instanceof DR||(n=new DR("mrow",[n])),n.setAttribute("href",t.href),n}),"mathmlBuilder")}),fR({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:s(((t,e)=>{var{parser:n}=t,r=nD(e[0],"url").url;if(!n.settings.isTrusted({command:"\\url",url:r}))return n.formatUnsupportedCmd("\\url");for(var i=[],a=0;a<r.length;a++){var s=r[a];"~"===s&&(s="\\textasciitilde"),i.push({type:"textord",mode:"text",text:s})}var o={type:"text",mode:n.mode,font:"\\texttt",body:i};return{type:"href",mode:n.mode,href:r,body:vR(o)}}),"handler")}),fR({type:"hbox",names:["\\hbox"],props:{numArgs:1,argTypes:["text"],allowedInText:!0,primitive:!0},handler(t,e){var{parser:n}=t;return{type:"hbox",mode:n.mode,body:vR(e[0])}},htmlBuilder(t,e){var n=_R(t.body,e,!1);return sR.makeFragment(n)},mathmlBuilder:(t,e)=>new BR.MathNode("mrow",UR(t.body,e))}),fR({type:"html",names:["\\htmlClass","\\htmlId","\\htmlStyle","\\htmlData"],props:{numArgs:2,argTypes:["raw","original"],allowedInText:!0},handler:s(((t,e)=>{var n,{parser:r,funcName:i,token:a}=t,s=nD(e[0],"raw").string,o=e[1];r.settings.strict&&r.settings.reportNonstrict("htmlExtension","HTML extension is disabled on strict mode");var l={};switch(i){case"\\htmlClass":l.class=s,n={command:"\\htmlClass",class:s};break;case"\\htmlId":l.id=s,n={command:"\\htmlId",id:s};break;case"\\htmlStyle":l.style=s,n={command:"\\htmlStyle",style:s};break;case"\\htmlData":for(var c=s.split(","),h=0;h<c.length;h++){var u=c[h].split("=");if(2!==u.length)throw new qN("Error parsing key-value for \\htmlData");l["data-"+u[0].trim()]=u[1].trim()}n={command:"\\htmlData",attributes:l};break;default:throw new Error("Unrecognized html command")}return r.settings.isTrusted(n)?{type:"html",mode:r.mode,attributes:l,body:vR(o)}:r.formatUnsupportedCmd(i)}),"handler"),htmlBuilder:s(((t,e)=>{var n=_R(t.body,e,!1),r=["enclosing"];t.attributes.class&&r.push(...t.attributes.class.trim().split(/\s+/));var i=sR.makeSpan(r,n,e);for(var a in t.attributes)"class"!==a&&t.attributes.hasOwnProperty(a)&&i.setAttribute(a,t.attributes[a]);return i}),"htmlBuilder"),mathmlBuilder:s(((t,e)=>GR(t.body,e)),"mathmlBuilder")}),fR({type:"htmlmathml",names:["\\html@mathml"],props:{numArgs:2,allowedInText:!0},handler:s(((t,e)=>{var{parser:n}=t;return{type:"htmlmathml",mode:n.mode,html:vR(e[0]),mathml:vR(e[1])}}),"handler"),htmlBuilder:s(((t,e)=>{var n=_R(t.html,e,!1);return sR.makeFragment(n)}),"htmlBuilder"),mathmlBuilder:s(((t,e)=>GR(t.mathml,e)),"mathmlBuilder")});var SO=s((function(t){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(t))return{number:+t,unit:"bp"};var e=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(t);if(!e)throw new qN("Invalid size: '"+t+"' in \\includegraphics");var n={number:+(e[1]+e[2]),unit:e[3]};if(!GI(n))throw new qN("Invalid unit: '"+n.unit+"' in \\includegraphics.");return n}),"sizeData");fR({type:"includegraphics",names:["\\includegraphics"],props:{numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1},handler:s(((t,e,n)=>{var{parser:r}=t,i={number:0,unit:"em"},a={number:.9,unit:"em"},s={number:0,unit:"em"},o="";if(n[0])for(var l=nD(n[0],"raw").string.split(","),c=0;c<l.length;c++){var h=l[c].split("=");if(2===h.length){var u=h[1].trim();switch(h[0].trim()){case"alt":o=u;break;case"width":i=SO(u);break;case"height":a=SO(u);break;case"totalheight":s=SO(u);break;default:throw new qN("Invalid key: '"+h[0]+"' in \\includegraphics.")}}}var d=nD(e[0],"url").url;return""===o&&(o=(o=(o=d).replace(/^.*[\\/]/,"")).substring(0,o.lastIndexOf("."))),r.settings.isTrusted({command:"\\includegraphics",url:d})?{type:"includegraphics",mode:r.mode,alt:o,width:i,height:a,totalheight:s,src:d}:r.formatUnsupportedCmd("\\includegraphics")}),"handler"),htmlBuilder:s(((t,e)=>{var n=qI(t.height,e),r=0;t.totalheight.number>0&&(r=qI(t.totalheight,e)-n);var i=0;t.width.number>0&&(i=qI(t.width,e));var a={height:jI(n+r)};i>0&&(a.width=jI(i)),r>0&&(a.verticalAlign=jI(-r));var s=new ZI(t.src,t.alt,a);return s.height=n,s.depth=r,s}),"htmlBuilder"),mathmlBuilder:s(((t,e)=>{var n=new BR.MathNode("mglyph",[]);n.setAttribute("alt",t.alt);var r=qI(t.height,e),i=0;if(t.totalheight.number>0&&(i=qI(t.totalheight,e)-r,n.setAttribute("valign",jI(-i))),n.setAttribute("height",jI(r+i)),t.width.number>0){var a=qI(t.width,e);n.setAttribute("width",jI(a))}return n.setAttribute("src",t.src),n}),"mathmlBuilder")}),fR({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],props:{numArgs:1,argTypes:["size"],primitive:!0,allowedInText:!0},handler(t,e){var{parser:n,funcName:r}=t,i=nD(e[0],"size");if(n.settings.strict){var a="m"===r[1],s="mu"===i.value.unit;a?(s||n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" supports only mu units, not "+i.value.unit+" units"),"math"!==n.mode&&n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" works only in math mode")):s&&n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" doesn't support mu units")}return{type:"kern",mode:n.mode,dimension:i.value}},htmlBuilder:(t,e)=>sR.makeGlue(t.dimension,e),mathmlBuilder(t,e){var n=qI(t.dimension,e);return new BR.SpaceNode(n)}}),fR({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],props:{numArgs:1,allowedInText:!0},handler:s(((t,e)=>{var{parser:n,funcName:r}=t,i=e[0];return{type:"lap",mode:n.mode,alignment:r.slice(5),body:i}}),"handler"),htmlBuilder:s(((t,e)=>{var n;"clap"===t.alignment?(n=sR.makeSpan([],[NR(t.body,e)]),n=sR.makeSpan(["inner"],[n],e)):n=sR.makeSpan(["inner"],[NR(t.body,e)]);var r=sR.makeSpan(["fix"],[]),i=sR.makeSpan([t.alignment],[n,r],e),a=sR.makeSpan(["strut"]);return a.style.height=jI(i.height+i.depth),i.depth&&(a.style.verticalAlign=jI(-i.depth)),i.children.unshift(a),i=sR.makeSpan(["thinbox"],[i],e),sR.makeSpan(["mord","vbox"],[i],e)}),"htmlBuilder"),mathmlBuilder:s(((t,e)=>{var n=new BR.MathNode("mpadded",[qR(t.body,e)]);if("rlap"!==t.alignment){var r="llap"===t.alignment?"-1":"-0.5";n.setAttribute("lspace",r+"width")}return n.setAttribute("width","0px"),n}),"mathmlBuilder")}),fR({type:"styling",names:["\\(","$"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(t,e){var{funcName:n,parser:r}=t,i=r.mode;r.switchMode("math");var a="\\("===n?"\\)":"$",s=r.parseExpression(!1,a);return r.expect(a),r.switchMode(i),{type:"styling",mode:r.mode,style:"text",body:s}}}),fR({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(t,e){throw new qN("Mismatched "+t.funcName)}});var AO=s(((t,e)=>{switch(e.style.size){case dI.DISPLAY.size:return t.display;case dI.TEXT.size:return t.text;case dI.SCRIPT.size:return t.script;case dI.SCRIPTSCRIPT.size:return t.scriptscript;default:return t.text}}),"chooseMathStyle");fR({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4,primitive:!0},handler:s(((t,e)=>{var{parser:n}=t;return{type:"mathchoice",mode:n.mode,display:vR(e[0]),text:vR(e[1]),script:vR(e[2]),scriptscript:vR(e[3])}}),"handler"),htmlBuilder:s(((t,e)=>{var n=AO(t,e),r=_R(n,e,!1);return sR.makeFragment(r)}),"htmlBuilder"),mathmlBuilder:s(((t,e)=>{var n=AO(t,e);return GR(n,e)}),"mathmlBuilder")});var LO=s(((t,e,n,r,i,a,s)=>{t=sR.makeSpan([],[t]);var o,l,c,h=n&&tI.isCharacterBox(n);if(e){var u=NR(e,r.havingStyle(i.sup()),r);l={elem:u,kern:Math.max(r.fontMetrics().bigOpSpacing1,r.fontMetrics().bigOpSpacing3-u.depth)}}if(n){var d=NR(n,r.havingStyle(i.sub()),r);o={elem:d,kern:Math.max(r.fontMetrics().bigOpSpacing2,r.fontMetrics().bigOpSpacing4-d.height)}}if(l&&o){var p=r.fontMetrics().bigOpSpacing5+o.elem.height+o.elem.depth+o.kern+t.depth+s;c=sR.makeVList({positionType:"bottom",positionData:p,children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:o.elem,marginLeft:jI(-a)},{type:"kern",size:o.kern},{type:"elem",elem:t},{type:"kern",size:l.kern},{type:"elem",elem:l.elem,marginLeft:jI(a)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]},r)}else if(o){var g=t.height-s;c=sR.makeVList({positionType:"top",positionData:g,children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:o.elem,marginLeft:jI(-a)},{type:"kern",size:o.kern},{type:"elem",elem:t}]},r)}else{if(!l)return t;var f=t.depth+s;c=sR.makeVList({positionType:"bottom",positionData:f,children:[{type:"elem",elem:t},{type:"kern",size:l.kern},{type:"elem",elem:l.elem,marginLeft:jI(a)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]},r)}var m=[c];if(o&&0!==a&&!h){var y=sR.makeSpan(["mspace"],[],r);y.style.marginRight=jI(a),m.unshift(y)}return sR.makeSpan(["mop","op-limits"],m,r)}),"assembleSupSub"),NO=["\\smallint"],IO=s(((t,e)=>{var n,r,i,a=!1;"supsub"===t.type?(n=t.sup,r=t.sub,i=nD(t.base,"op"),a=!0):i=nD(t,"op");var s,o=e.style,l=!1;if(o.size===dI.DISPLAY.size&&i.symbol&&!tI.contains(NO,i.name)&&(l=!0),i.symbol){var c=l?"Size2-Regular":"Size1-Regular",h="";if("\\oiint"!==i.name&&"\\oiiint"!==i.name||(h=i.name.slice(1),i.name="oiint"===h?"\\iint":"\\iiint"),s=sR.makeSymbol(i.name,c,"math",e,["mop","op-symbol",l?"large-op":"small-op"]),h.length>0){var u=s.italic,d=sR.staticSvg(h+"Size"+(l?"2":"1"),e);s=sR.makeVList({positionType:"individualShift",children:[{type:"elem",elem:s,shift:0},{type:"elem",elem:d,shift:l?.08:0}]},e),i.name="\\"+h,s.classes.unshift("mop"),s.italic=u}}else if(i.body){var p=_R(i.body,e,!0);1===p.length&&p[0]instanceof JI?(s=p[0]).classes[0]="mop":s=sR.makeSpan(["mop"],p,e)}else{for(var g=[],f=1;f<i.name.length;f++)g.push(sR.mathsym(i.name[f],i.mode,e));s=sR.makeSpan(["mop"],g,e)}var m=0,y=0;return(s instanceof JI||"\\oiint"===i.name||"\\oiiint"===i.name)&&!i.suppressBaseShift&&(m=(s.height-s.depth)/2-e.fontMetrics().axisHeight,y=s.italic),a?LO(s,n,r,e,o,y,m):(m&&(s.style.position="relative",s.style.top=jI(m)),s)}),"htmlBuilder$2"),MO=s(((t,e)=>{var n;if(t.symbol)n=new DR("mo",[$R(t.name,t.mode)]),tI.contains(NO,t.name)&&n.setAttribute("largeop","false");else if(t.body)n=new DR("mo",UR(t.body,e));else{n=new DR("mi",[new OR(t.name.slice(1))]);var r=new DR("mo",[$R("⁡","text")]);n=t.parentIsSupSub?new DR("mrow",[n,r]):RR([n,r])}return n}),"mathmlBuilder$1"),RO={"∏":"\\prod","∐":"\\coprod","∑":"\\sum","⋀":"\\bigwedge","⋁":"\\bigvee","⋂":"\\bigcap","⋃":"\\bigcup","⨀":"\\bigodot","⨁":"\\bigoplus","⨂":"\\bigotimes","⨄":"\\biguplus","⨆":"\\bigsqcup"};fR({type:"op",names:["\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigcap","\\bigcup","\\intop","\\prod","\\sum","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","∏","∐","∑","⋀","⋁","⋂","⋃","⨀","⨁","⨂","⨄","⨆"],props:{numArgs:0},handler:s(((t,e)=>{var{parser:n,funcName:r}=t,i=r;return 1===i.length&&(i=RO[i]),{type:"op",mode:n.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:i}}),"handler"),htmlBuilder:IO,mathmlBuilder:MO}),fR({type:"op",names:["\\mathop"],props:{numArgs:1,primitive:!0},handler:s(((t,e)=>{var{parser:n}=t,r=e[0];return{type:"op",mode:n.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:vR(r)}}),"handler"),htmlBuilder:IO,mathmlBuilder:MO});var DO={"∫":"\\int","∬":"\\iint","∭":"\\iiint","∮":"\\oint","∯":"\\oiint","∰":"\\oiiint"};fR({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:n}=t;return{type:"op",mode:e.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:n}},htmlBuilder:IO,mathmlBuilder:MO}),fR({type:"op",names:["\\det","\\gcd","\\inf","\\lim","\\max","\\min","\\Pr","\\sup"],props:{numArgs:0},handler(t){var{parser:e,funcName:n}=t;return{type:"op",mode:e.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:n}},htmlBuilder:IO,mathmlBuilder:MO}),fR({type:"op",names:["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","∫","∬","∭","∮","∯","∰"],props:{numArgs:0},handler(t){var{parser:e,funcName:n}=t,r=n;return 1===r.length&&(r=DO[r]),{type:"op",mode:e.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:r}},htmlBuilder:IO,mathmlBuilder:MO});var OO=s(((t,e)=>{var n,r,i,a,s=!1;if("supsub"===t.type?(n=t.sup,r=t.sub,i=nD(t.base,"operatorname"),s=!0):i=nD(t,"operatorname"),i.body.length>0){for(var o=i.body.map((t=>{var e=t.text;return"string"==typeof e?{type:"textord",mode:t.mode,text:e}:t})),l=_R(o,e.withFont("mathrm"),!0),c=0;c<l.length;c++){var h=l[c];h instanceof JI&&(h.text=h.text.replace(/\u2212/,"-").replace(/\u2217/,"*"))}a=sR.makeSpan(["mop"],l,e)}else a=sR.makeSpan(["mop"],[],e);return s?LO(a,n,r,e,e.style,0,0):a}),"htmlBuilder$1"),PO=s(((t,e)=>{for(var n=UR(t.body,e.withFont("mathrm")),r=!0,i=0;i<n.length;i++){var a=n[i];if(a instanceof BR.SpaceNode);else if(a instanceof BR.MathNode)switch(a.type){case"mi":case"mn":case"ms":case"mspace":case"mtext":break;case"mo":var s=a.children[0];1===a.children.length&&s instanceof BR.TextNode?s.text=s.text.replace(/\u2212/,"-").replace(/\u2217/,"*"):r=!1;break;default:r=!1}else r=!1}if(r){var o=n.map((t=>t.toText())).join("");n=[new BR.TextNode(o)]}var l=new BR.MathNode("mi",n);l.setAttribute("mathvariant","normal");var c=new BR.MathNode("mo",[$R("⁡","text")]);return t.parentIsSupSub?new BR.MathNode("mrow",[l,c]):BR.newDocumentFragment([l,c])}),"mathmlBuilder");function BO(t,e,n){for(var r=_R(t,e,!1),i=e.sizeMultiplier/n.sizeMultiplier,a=0;a<r.length;a++){var s=r[a].classes.indexOf("sizing");s<0?Array.prototype.push.apply(r[a].classes,e.sizingClasses(n)):r[a].classes[s+1]==="reset-size"+e.size&&(r[a].classes[s+1]="reset-size"+n.size),r[a].height*=i,r[a].depth*=i}return sR.makeFragment(r)}fR({type:"operatorname",names:["\\operatorname@","\\operatornamewithlimits"],props:{numArgs:1},handler:s(((t,e)=>{var{parser:n,funcName:r}=t,i=e[0];return{type:"operatorname",mode:n.mode,body:vR(i),alwaysHandleSupSub:"\\operatornamewithlimits"===r,limits:!1,parentIsSupSub:!1}}),"handler"),htmlBuilder:OO,mathmlBuilder:PO}),oO("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@"),mR({type:"ordgroup",htmlBuilder:(t,e)=>t.semisimple?sR.makeFragment(_R(t.body,e,!1)):sR.makeSpan(["mord"],_R(t.body,e,!0),e),mathmlBuilder:(t,e)=>GR(t.body,e,!0)}),fR({type:"overline",names:["\\overline"],props:{numArgs:1},handler(t,e){var{parser:n}=t,r=e[0];return{type:"overline",mode:n.mode,body:r}},htmlBuilder(t,e){var n=NR(t.body,e.havingCrampedStyle()),r=sR.makeLineSpan("overline-line",e),i=e.fontMetrics().defaultRuleThickness,a=sR.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:n},{type:"kern",size:3*i},{type:"elem",elem:r},{type:"kern",size:i}]},e);return sR.makeSpan(["mord","overline"],[a],e)},mathmlBuilder(t,e){var n=new BR.MathNode("mo",[new BR.TextNode("‾")]);n.setAttribute("stretchy","true");var r=new BR.MathNode("mover",[qR(t.body,e),n]);return r.setAttribute("accent","true"),r}}),fR({type:"phantom",names:["\\phantom"],props:{numArgs:1,allowedInText:!0},handler:s(((t,e)=>{var{parser:n}=t,r=e[0];return{type:"phantom",mode:n.mode,body:vR(r)}}),"handler"),htmlBuilder:s(((t,e)=>{var n=_R(t.body,e.withPhantom(),!1);return sR.makeFragment(n)}),"htmlBuilder"),mathmlBuilder:s(((t,e)=>{var n=UR(t.body,e);return new BR.MathNode("mphantom",n)}),"mathmlBuilder")}),fR({type:"hphantom",names:["\\hphantom"],props:{numArgs:1,allowedInText:!0},handler:s(((t,e)=>{var{parser:n}=t,r=e[0];return{type:"hphantom",mode:n.mode,body:r}}),"handler"),htmlBuilder:s(((t,e)=>{var n=sR.makeSpan([],[NR(t.body,e.withPhantom())]);if(n.height=0,n.depth=0,n.children)for(var r=0;r<n.children.length;r++)n.children[r].height=0,n.children[r].depth=0;return n=sR.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:n}]},e),sR.makeSpan(["mord"],[n],e)}),"htmlBuilder"),mathmlBuilder:s(((t,e)=>{var n=UR(vR(t.body),e),r=new BR.MathNode("mphantom",n),i=new BR.MathNode("mpadded",[r]);return i.setAttribute("height","0px"),i.setAttribute("depth","0px"),i}),"mathmlBuilder")}),fR({type:"vphantom",names:["\\vphantom"],props:{numArgs:1,allowedInText:!0},handler:s(((t,e)=>{var{parser:n}=t,r=e[0];return{type:"vphantom",mode:n.mode,body:r}}),"handler"),htmlBuilder:s(((t,e)=>{var n=sR.makeSpan(["inner"],[NR(t.body,e.withPhantom())]),r=sR.makeSpan(["fix"],[]);return sR.makeSpan(["mord","rlap"],[n,r],e)}),"htmlBuilder"),mathmlBuilder:s(((t,e)=>{var n=UR(vR(t.body),e),r=new BR.MathNode("mphantom",n),i=new BR.MathNode("mpadded",[r]);return i.setAttribute("width","0px"),i}),"mathmlBuilder")}),fR({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler(t,e){var{parser:n}=t,r=nD(e[0],"size").value,i=e[1];return{type:"raisebox",mode:n.mode,dy:r,body:i}},htmlBuilder(t,e){var n=NR(t.body,e),r=qI(t.dy,e);return sR.makeVList({positionType:"shift",positionData:-r,children:[{type:"elem",elem:n}]},e)},mathmlBuilder(t,e){var n=new BR.MathNode("mpadded",[qR(t.body,e)]),r=t.dy.number+t.dy.unit;return n.setAttribute("voffset",r),n}}),fR({type:"internal",names:["\\relax"],props:{numArgs:0,allowedInText:!0},handler(t){var{parser:e}=t;return{type:"internal",mode:e.mode}}}),fR({type:"rule",names:["\\rule"],props:{numArgs:2,numOptionalArgs:1,argTypes:["size","size","size"]},handler(t,e,n){var{parser:r}=t,i=n[0],a=nD(e[0],"size"),s=nD(e[1],"size");return{type:"rule",mode:r.mode,shift:i&&nD(i,"size").value,width:a.value,height:s.value}},htmlBuilder(t,e){var n=sR.makeSpan(["mord","rule"],[],e),r=qI(t.width,e),i=qI(t.height,e),a=t.shift?qI(t.shift,e):0;return n.style.borderRightWidth=jI(r),n.style.borderTopWidth=jI(i),n.style.bottom=jI(a),n.width=r,n.height=i+a,n.depth=-a,n.maxFontSize=1.125*i*e.sizeMultiplier,n},mathmlBuilder(t,e){var n=qI(t.width,e),r=qI(t.height,e),i=t.shift?qI(t.shift,e):0,a=e.color&&e.getColor()||"black",s=new BR.MathNode("mspace");s.setAttribute("mathbackground",a),s.setAttribute("width",jI(n)),s.setAttribute("height",jI(r));var o=new BR.MathNode("mpadded",[s]);return i>=0?o.setAttribute("height",jI(i)):(o.setAttribute("height",jI(i)),o.setAttribute("depth",jI(-i))),o.setAttribute("voffset",jI(i)),o}}),s(BO,"sizingGroup");var $O=["\\tiny","\\sixptsize","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"],FO=s(((t,e)=>{var n=e.havingSize(t.size);return BO(t.body,n,e)}),"htmlBuilder");fR({type:"sizing",names:$O,props:{numArgs:0,allowedInText:!0},handler:s(((t,e)=>{var{breakOnTokenText:n,funcName:r,parser:i}=t,a=i.parseExpression(!1,n);return{type:"sizing",mode:i.mode,size:$O.indexOf(r)+1,body:a}}),"handler"),htmlBuilder:FO,mathmlBuilder:s(((t,e)=>{var n=e.havingSize(t.size),r=UR(t.body,n),i=new BR.MathNode("mstyle",r);return i.setAttribute("mathsize",jI(n.sizeMultiplier)),i}),"mathmlBuilder")}),fR({type:"smash",names:["\\smash"],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:s(((t,e,n)=>{var{parser:r}=t,i=!1,a=!1,s=n[0]&&nD(n[0],"ordgroup");if(s)for(var o="",l=0;l<s.body.length;++l){if("t"===(o=s.body[l].text))i=!0;else{if("b"!==o){i=!1,a=!1;break}a=!0}}else i=!0,a=!0;var c=e[0];return{type:"smash",mode:r.mode,body:c,smashHeight:i,smashDepth:a}}),"handler"),htmlBuilder:s(((t,e)=>{var n=sR.makeSpan([],[NR(t.body,e)]);if(!t.smashHeight&&!t.smashDepth)return n;if(t.smashHeight&&(n.height=0,n.children))for(var r=0;r<n.children.length;r++)n.children[r].height=0;if(t.smashDepth&&(n.depth=0,n.children))for(var i=0;i<n.children.length;i++)n.children[i].depth=0;var a=sR.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:n}]},e);return sR.makeSpan(["mord"],[a],e)}),"htmlBuilder"),mathmlBuilder:s(((t,e)=>{var n=new BR.MathNode("mpadded",[qR(t.body,e)]);return t.smashHeight&&n.setAttribute("height","0px"),t.smashDepth&&n.setAttribute("depth","0px"),n}),"mathmlBuilder")}),fR({type:"sqrt",names:["\\sqrt"],props:{numArgs:1,numOptionalArgs:1},handler(t,e,n){var{parser:r}=t,i=n[0],a=e[0];return{type:"sqrt",mode:r.mode,body:a,index:i}},htmlBuilder(t,e){var n=NR(t.body,e.havingCrampedStyle());0===n.height&&(n.height=e.fontMetrics().xHeight),n=sR.wrapFragment(n,e);var r=e.fontMetrics().defaultRuleThickness,i=r;e.style.id<dI.TEXT.id&&(i=e.fontMetrics().xHeight);var a=r+i/4,s=n.height+n.depth+a+r,{span:o,ruleWidth:l,advanceWidth:c}=ZD.sqrtImage(s,e),h=o.height-l;h>n.height+n.depth+a&&(a=(a+h-n.height-n.depth)/2);var u=o.height-n.height-a-l;n.style.paddingLeft=jI(c);var d=sR.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:n,wrapperClasses:["svg-align"]},{type:"kern",size:-(n.height+u)},{type:"elem",elem:o},{type:"kern",size:l}]},e);if(t.index){var p=e.havingStyle(dI.SCRIPTSCRIPT),g=NR(t.index,p,e),f=.6*(d.height-d.depth),m=sR.makeVList({positionType:"shift",positionData:-f,children:[{type:"elem",elem:g}]},e),y=sR.makeSpan(["root"],[m]);return sR.makeSpan(["mord","sqrt"],[y,d],e)}return sR.makeSpan(["mord","sqrt"],[d],e)},mathmlBuilder(t,e){var{body:n,index:r}=t;return r?new BR.MathNode("mroot",[qR(n,e),qR(r,e)]):new BR.MathNode("msqrt",[qR(n,e)])}});var zO={display:dI.DISPLAY,text:dI.TEXT,script:dI.SCRIPT,scriptscript:dI.SCRIPTSCRIPT};fR({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t,e){var{breakOnTokenText:n,funcName:r,parser:i}=t,a=i.parseExpression(!0,n),s=r.slice(1,r.length-5);return{type:"styling",mode:i.mode,style:s,body:a}},htmlBuilder(t,e){var n=zO[t.style],r=e.havingStyle(n).withFont("");return BO(t.body,r,e)},mathmlBuilder(t,e){var n=zO[t.style],r=e.havingStyle(n),i=UR(t.body,r),a=new BR.MathNode("mstyle",i),s={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]}[t.style];return a.setAttribute("scriptlevel",s[0]),a.setAttribute("displaystyle",s[1]),a}});var UO=s((function(t,e){var n=t.base;return n?"op"===n.type?n.limits&&(e.style.size===dI.DISPLAY.size||n.alwaysHandleSupSub)?IO:null:"operatorname"===n.type?n.alwaysHandleSupSub&&(e.style.size===dI.DISPLAY.size||n.limits)?OO:null:"accent"===n.type?tI.isCharacterBox(n.base)?aD:null:"horizBrace"===n.type&&!t.sub===n.isOver?CO:null:null}),"htmlBuilderDelegate");mR({type:"supsub",htmlBuilder(t,e){var n=UO(t,e);if(n)return n(t,e);var r,i,a,{base:s,sup:o,sub:l}=t,c=NR(s,e),h=e.fontMetrics(),u=0,d=0,p=s&&tI.isCharacterBox(s);if(o){var g=e.havingStyle(e.style.sup());r=NR(o,g,e),p||(u=c.height-g.fontMetrics().supDrop*g.sizeMultiplier/e.sizeMultiplier)}if(l){var f=e.havingStyle(e.style.sub());i=NR(l,f,e),p||(d=c.depth+f.fontMetrics().subDrop*f.sizeMultiplier/e.sizeMultiplier)}a=e.style===dI.DISPLAY?h.sup1:e.style.cramped?h.sup3:h.sup2;var m,y=e.sizeMultiplier,v=jI(.5/h.ptPerEm/y),x=null;if(i){var b=t.base&&"op"===t.base.type&&t.base.name&&("\\oiint"===t.base.name||"\\oiiint"===t.base.name);(c instanceof JI||b)&&(x=jI(-c.italic))}if(r&&i){u=Math.max(u,a,r.depth+.25*h.xHeight),d=Math.max(d,h.sub2);var w=4*h.defaultRuleThickness;if(u-r.depth-(i.height-d)<w){d=w-(u-r.depth)+i.height;var k=.8*h.xHeight-(u-r.depth);k>0&&(u+=k,d-=k)}var T=[{type:"elem",elem:i,shift:d,marginRight:v,marginLeft:x},{type:"elem",elem:r,shift:-u,marginRight:v}];m=sR.makeVList({positionType:"individualShift",children:T},e)}else if(i){d=Math.max(d,h.sub1,i.height-.8*h.xHeight);var _=[{type:"elem",elem:i,marginLeft:x,marginRight:v}];m=sR.makeVList({positionType:"shift",positionData:d,children:_},e)}else{if(!r)throw new Error("supsub must have either sup or sub.");u=Math.max(u,a,r.depth+.25*h.xHeight),m=sR.makeVList({positionType:"shift",positionData:-u,children:[{type:"elem",elem:r,marginRight:v}]},e)}var E=AR(c,"right")||"mord";return sR.makeSpan([E],[c,sR.makeSpan(["msupsub"],[m])],e)},mathmlBuilder(t,e){var n,r=!1;t.base&&"horizBrace"===t.base.type&&!!t.sup===t.base.isOver&&(r=!0,n=t.base.isOver),!t.base||"op"!==t.base.type&&"operatorname"!==t.base.type||(t.base.parentIsSupSub=!0);var i,a=[qR(t.base,e)];if(t.sub&&a.push(qR(t.sub,e)),t.sup&&a.push(qR(t.sup,e)),r)i=n?"mover":"munder";else if(t.sub)if(t.sup){var s=t.base;i=s&&"op"===s.type&&s.limits&&e.style===dI.DISPLAY||s&&"operatorname"===s.type&&s.alwaysHandleSupSub&&(e.style===dI.DISPLAY||s.limits)?"munderover":"msubsup"}else{var o=t.base;i=o&&"op"===o.type&&o.limits&&(e.style===dI.DISPLAY||o.alwaysHandleSupSub)||o&&"operatorname"===o.type&&o.alwaysHandleSupSub&&(o.limits||e.style===dI.DISPLAY)?"munder":"msub"}else{var l=t.base;i=l&&"op"===l.type&&l.limits&&(e.style===dI.DISPLAY||l.alwaysHandleSupSub)||l&&"operatorname"===l.type&&l.alwaysHandleSupSub&&(l.limits||e.style===dI.DISPLAY)?"mover":"msup"}return new BR.MathNode(i,a)}}),mR({type:"atom",htmlBuilder:(t,e)=>sR.mathsym(t.text,t.mode,e,["m"+t.family]),mathmlBuilder(t,e){var n=new BR.MathNode("mo",[$R(t.text,t.mode)]);if("bin"===t.family){var r=zR(t,e);"bold-italic"===r&&n.setAttribute("mathvariant",r)}else"punct"===t.family?n.setAttribute("separator","true"):"open"!==t.family&&"close"!==t.family||n.setAttribute("stretchy","false");return n}});var GO={mi:"italic",mn:"normal",mtext:"normal"};mR({type:"mathord",htmlBuilder:(t,e)=>sR.makeOrd(t,e,"mathord"),mathmlBuilder(t,e){var n=new BR.MathNode("mi",[$R(t.text,t.mode,e)]),r=zR(t,e)||"italic";return r!==GO[n.type]&&n.setAttribute("mathvariant",r),n}}),mR({type:"textord",htmlBuilder:(t,e)=>sR.makeOrd(t,e,"textord"),mathmlBuilder(t,e){var n,r=$R(t.text,t.mode,e),i=zR(t,e)||"normal";return n="text"===t.mode?new BR.MathNode("mtext",[r]):/[0-9]/.test(t.text)?new BR.MathNode("mn",[r]):"\\prime"===t.text?new BR.MathNode("mo",[r]):new BR.MathNode("mi",[r]),i!==GO[n.type]&&n.setAttribute("mathvariant",i),n}});var qO={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},jO={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};mR({type:"spacing",htmlBuilder(t,e){if(jO.hasOwnProperty(t.text)){var n=jO[t.text].className||"";if("text"===t.mode){var r=sR.makeOrd(t,e,"textord");return r.classes.push(n),r}return sR.makeSpan(["mspace",n],[sR.mathsym(t.text,t.mode,e)],e)}if(qO.hasOwnProperty(t.text))return sR.makeSpan(["mspace",qO[t.text]],[],e);throw new qN('Unknown type of space "'+t.text+'"')},mathmlBuilder(t,e){if(!jO.hasOwnProperty(t.text)){if(qO.hasOwnProperty(t.text))return new BR.MathNode("mspace");throw new qN('Unknown type of space "'+t.text+'"')}return new BR.MathNode("mtext",[new BR.TextNode(" ")])}});var YO=s((()=>{var t=new BR.MathNode("mtd",[]);return t.setAttribute("width","50%"),t}),"pad");mR({type:"tag",mathmlBuilder(t,e){var n=new BR.MathNode("mtable",[new BR.MathNode("mtr",[YO(),new BR.MathNode("mtd",[GR(t.body,e)]),YO(),new BR.MathNode("mtd",[GR(t.tag,e)])])]);return n.setAttribute("width","100%"),n}});var WO={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},HO={"\\textbf":"textbf","\\textmd":"textmd"},VO={"\\textit":"textit","\\textup":"textup"},XO=s(((t,e)=>{var n=t.font;return n?WO[n]?e.withTextFontFamily(WO[n]):HO[n]?e.withTextFontWeight(HO[n]):"\\emph"===n?"textit"===e.fontShape?e.withTextFontShape("textup"):e.withTextFontShape("textit"):e.withTextFontShape(VO[n]):e}),"optionsWithFont");fR({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:n,funcName:r}=t,i=e[0];return{type:"text",mode:n.mode,body:vR(i),font:r}},htmlBuilder(t,e){var n=XO(t,e),r=_R(t.body,n,!0);return sR.makeSpan(["mord","text"],r,n)},mathmlBuilder(t,e){var n=XO(t,e);return GR(t.body,n)}}),fR({type:"underline",names:["\\underline"],props:{numArgs:1,allowedInText:!0},handler(t,e){var{parser:n}=t;return{type:"underline",mode:n.mode,body:e[0]}},htmlBuilder(t,e){var n=NR(t.body,e),r=sR.makeLineSpan("underline-line",e),i=e.fontMetrics().defaultRuleThickness,a=sR.makeVList({positionType:"top",positionData:n.height,children:[{type:"kern",size:i},{type:"elem",elem:r},{type:"kern",size:3*i},{type:"elem",elem:n}]},e);return sR.makeSpan(["mord","underline"],[a],e)},mathmlBuilder(t,e){var n=new BR.MathNode("mo",[new BR.TextNode("‾")]);n.setAttribute("stretchy","true");var r=new BR.MathNode("munder",[qR(t.body,e),n]);return r.setAttribute("accentunder","true"),r}}),fR({type:"vcenter",names:["\\vcenter"],props:{numArgs:1,argTypes:["original"],allowedInText:!1},handler(t,e){var{parser:n}=t;return{type:"vcenter",mode:n.mode,body:e[0]}},htmlBuilder(t,e){var n=NR(t.body,e),r=e.fontMetrics().axisHeight,i=.5*(n.height-r-(n.depth+r));return sR.makeVList({positionType:"shift",positionData:i,children:[{type:"elem",elem:n}]},e)},mathmlBuilder:(t,e)=>new BR.MathNode("mpadded",[qR(t.body,e)],["vcenter"])}),fR({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler(t,e,n){throw new qN("\\verb ended by end of line instead of matching delimiter")},htmlBuilder(t,e){for(var n=KO(t),r=[],i=e.havingStyle(e.style.text()),a=0;a<n.length;a++){var s=n[a];"~"===s&&(s="\\textasciitilde"),r.push(sR.makeSymbol(s,"Typewriter-Regular",t.mode,i,["mord","texttt"]))}return sR.makeSpan(["mord","text"].concat(i.sizingClasses(e)),sR.tryCombineChars(r),i)},mathmlBuilder(t,e){var n=new BR.TextNode(KO(t)),r=new BR.MathNode("mtext",[n]);return r.setAttribute("mathvariant","monospace"),r}});var KO=s((t=>t.body.replace(/ /g,t.star?"␣":" ")),"makeVerb"),ZO=dR,QO=new RegExp("[̀-ͯ]+$"),JO=class{static{s(this,"Lexer")}constructor(t,e){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=t,this.settings=e,this.tokenRegex=new RegExp("([ \r\n\t]+)|\\\\(\n|[ \r\t]+\n?)[ \r\t]*|([!-\\[\\]-‧‪-퟿豈-￿][̀-ͯ]*|[\ud800-\udbff][\udc00-\udfff][̀-ͯ]*|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5|(\\\\[a-zA-Z@]+)[ \r\n\t]*|\\\\[^\ud800-\udfff])","g"),this.catcodes={"%":14,"~":13}}setCatcode(t,e){this.catcodes[t]=e}lex(){var t=this.input,e=this.tokenRegex.lastIndex;if(e===t.length)return new GN("EOF",new UN(this,e,e));var n=this.tokenRegex.exec(t);if(null===n||n.index!==e)throw new qN("Unexpected character: '"+t[e]+"'",new GN(t[e],new UN(this,e,e+1)));var r=n[6]||n[3]||(n[2]?"\\ ":" ");if(14===this.catcodes[r]){var i=t.indexOf("\n",this.tokenRegex.lastIndex);return-1===i?(this.tokenRegex.lastIndex=t.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=i+1,this.lex()}return new GN(r,new UN(this,e,this.tokenRegex.lastIndex))}},tP=class{static{s(this,"Namespace")}constructor(t,e){void 0===t&&(t={}),void 0===e&&(e={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=e,this.builtins=t,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(0===this.undefStack.length)throw new qN("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");var t=this.undefStack.pop();for(var e in t)t.hasOwnProperty(e)&&(null==t[e]?delete this.current[e]:this.current[e]=t[e])}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(t){return this.current.hasOwnProperty(t)||this.builtins.hasOwnProperty(t)}get(t){return this.current.hasOwnProperty(t)?this.current[t]:this.builtins[t]}set(t,e,n){if(void 0===n&&(n=!1),n){for(var r=0;r<this.undefStack.length;r++)delete this.undefStack[r][t];this.undefStack.length>0&&(this.undefStack[this.undefStack.length-1][t]=e)}else{var i=this.undefStack[this.undefStack.length-1];i&&!i.hasOwnProperty(t)&&(i[t]=this.current[t])}null==e?delete this.current[t]:this.current[t]=e}},eP=sO;oO("\\noexpand",(function(t){var e=t.popToken();return t.isExpandable(e.text)&&(e.noexpand=!0,e.treatAsRelax=!0),{tokens:[e],numArgs:0}})),oO("\\expandafter",(function(t){var e=t.popToken();return t.expandOnce(!0),{tokens:[e],numArgs:0}})),oO("\\@firstoftwo",(function(t){return{tokens:t.consumeArgs(2)[0],numArgs:0}})),oO("\\@secondoftwo",(function(t){return{tokens:t.consumeArgs(2)[1],numArgs:0}})),oO("\\@ifnextchar",(function(t){var e=t.consumeArgs(3);t.consumeSpaces();var n=t.future();return 1===e[0].length&&e[0][0].text===n.text?{tokens:e[1],numArgs:0}:{tokens:e[2],numArgs:0}})),oO("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}"),oO("\\TextOrMath",(function(t){var e=t.consumeArgs(2);return"text"===t.mode?{tokens:e[0],numArgs:0}:{tokens:e[1],numArgs:0}}));var nP={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};oO("\\char",(function(t){var e,n=t.popToken(),r="";if("'"===n.text)e=8,n=t.popToken();else if('"'===n.text)e=16,n=t.popToken();else if("`"===n.text)if("\\"===(n=t.popToken()).text[0])r=n.text.charCodeAt(1);else{if("EOF"===n.text)throw new qN("\\char` missing argument");r=n.text.charCodeAt(0)}else e=10;if(e){if(null==(r=nP[n.text])||r>=e)throw new qN("Invalid base-"+e+" digit "+n.text);for(var i;null!=(i=nP[t.future().text])&&i<e;)r*=e,r+=i,t.popToken()}return"\\@char{"+r+"}"}));var rP=s(((t,e,n)=>{var r=t.consumeArg().tokens;if(1!==r.length)throw new qN("\\newcommand's first argument must be a macro name");var i=r[0].text,a=t.isDefined(i);if(a&&!e)throw new qN("\\newcommand{"+i+"} attempting to redefine "+i+"; use \\renewcommand");if(!a&&!n)throw new qN("\\renewcommand{"+i+"} when command "+i+" does not yet exist; use \\newcommand");var s=0;if(1===(r=t.consumeArg().tokens).length&&"["===r[0].text){for(var o="",l=t.expandNextToken();"]"!==l.text&&"EOF"!==l.text;)o+=l.text,l=t.expandNextToken();if(!o.match(/^\s*[0-9]+\s*$/))throw new qN("Invalid number of arguments: "+o);s=parseInt(o),r=t.consumeArg().tokens}return t.macros.set(i,{tokens:r,numArgs:s}),""}),"newcommand");oO("\\newcommand",(t=>rP(t,!1,!0))),oO("\\renewcommand",(t=>rP(t,!0,!1))),oO("\\providecommand",(t=>rP(t,!0,!0))),oO("\\message",(t=>{var e=t.consumeArgs(1)[0];return console.log(e.reverse().map((t=>t.text)).join("")),""})),oO("\\errmessage",(t=>{var e=t.consumeArgs(1)[0];return console.error(e.reverse().map((t=>t.text)).join("")),""})),oO("\\show",(t=>{var e=t.popToken(),n=e.text;return console.log(e,t.macros.get(n),ZO[n],oM.math[n],oM.text[n]),""})),oO("\\bgroup","{"),oO("\\egroup","}"),oO("~","\\nobreakspace"),oO("\\lq","`"),oO("\\rq","'"),oO("\\aa","\\r a"),oO("\\AA","\\r A"),oO("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}"),oO("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}"),oO("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}"),oO("ℬ","\\mathscr{B}"),oO("ℰ","\\mathscr{E}"),oO("ℱ","\\mathscr{F}"),oO("ℋ","\\mathscr{H}"),oO("ℐ","\\mathscr{I}"),oO("ℒ","\\mathscr{L}"),oO("ℳ","\\mathscr{M}"),oO("ℛ","\\mathscr{R}"),oO("ℭ","\\mathfrak{C}"),oO("ℌ","\\mathfrak{H}"),oO("ℨ","\\mathfrak{Z}"),oO("\\Bbbk","\\Bbb{k}"),oO("·","\\cdotp"),oO("\\llap","\\mathllap{\\textrm{#1}}"),oO("\\rlap","\\mathrlap{\\textrm{#1}}"),oO("\\clap","\\mathclap{\\textrm{#1}}"),oO("\\mathstrut","\\vphantom{(}"),oO("\\underbar","\\underline{\\text{#1}}"),oO("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}}{\\char"338}'),oO("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}"),oO("\\ne","\\neq"),oO("≠","\\neq"),oO("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}"),oO("∉","\\notin"),oO("≘","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}"),oO("≙","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}"),oO("≚","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}"),oO("≛","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}"),oO("≝","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}"),oO("≞","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}"),oO("≟","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}"),oO("⟂","\\perp"),oO("‼","\\mathclose{!\\mkern-0.8mu!}"),oO("∌","\\notni"),oO("⌜","\\ulcorner"),oO("⌝","\\urcorner"),oO("⌞","\\llcorner"),oO("⌟","\\lrcorner"),oO("©","\\copyright"),oO("®","\\textregistered"),oO("️","\\textregistered"),oO("\\ulcorner",'\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}'),oO("\\urcorner",'\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}'),oO("\\llcorner",'\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}'),oO("\\lrcorner",'\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}'),oO("\\vdots","\\mathord{\\varvdots\\rule{0pt}{15pt}}"),oO("⋮","\\vdots"),oO("\\varGamma","\\mathit{\\Gamma}"),oO("\\varDelta","\\mathit{\\Delta}"),oO("\\varTheta","\\mathit{\\Theta}"),oO("\\varLambda","\\mathit{\\Lambda}"),oO("\\varXi","\\mathit{\\Xi}"),oO("\\varPi","\\mathit{\\Pi}"),oO("\\varSigma","\\mathit{\\Sigma}"),oO("\\varUpsilon","\\mathit{\\Upsilon}"),oO("\\varPhi","\\mathit{\\Phi}"),oO("\\varPsi","\\mathit{\\Psi}"),oO("\\varOmega","\\mathit{\\Omega}"),oO("\\substack","\\begin{subarray}{c}#1\\end{subarray}"),oO("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax"),oO("\\boxed","\\fbox{$\\displaystyle{#1}$}"),oO("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;"),oO("\\implies","\\DOTSB\\;\\Longrightarrow\\;"),oO("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;");var iP={",":"\\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"};oO("\\dots",(function(t){var e="\\dotso",n=t.expandAfterFuture().text;return n in iP?e=iP[n]:("\\not"===n.slice(0,4)||n in oM.math&&tI.contains(["bin","rel"],oM.math[n].group))&&(e="\\dotsb"),e}));var aP={")":!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};oO("\\dotso",(function(t){return t.future().text in aP?"\\ldots\\,":"\\ldots"})),oO("\\dotsc",(function(t){var e=t.future().text;return e in aP&&","!==e?"\\ldots\\,":"\\ldots"})),oO("\\cdots",(function(t){return t.future().text in aP?"\\@cdots\\,":"\\@cdots"})),oO("\\dotsb","\\cdots"),oO("\\dotsm","\\cdots"),oO("\\dotsi","\\!\\cdots"),oO("\\dotsx","\\ldots\\,"),oO("\\DOTSI","\\relax"),oO("\\DOTSB","\\relax"),oO("\\DOTSX","\\relax"),oO("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax"),oO("\\,","\\tmspace+{3mu}{.1667em}"),oO("\\thinspace","\\,"),oO("\\>","\\mskip{4mu}"),oO("\\:","\\tmspace+{4mu}{.2222em}"),oO("\\medspace","\\:"),oO("\\;","\\tmspace+{5mu}{.2777em}"),oO("\\thickspace","\\;"),oO("\\!","\\tmspace-{3mu}{.1667em}"),oO("\\negthinspace","\\!"),oO("\\negmedspace","\\tmspace-{4mu}{.2222em}"),oO("\\negthickspace","\\tmspace-{5mu}{.277em}"),oO("\\enspace","\\kern.5em "),oO("\\enskip","\\hskip.5em\\relax"),oO("\\quad","\\hskip1em\\relax"),oO("\\qquad","\\hskip2em\\relax"),oO("\\tag","\\@ifstar\\tag@literal\\tag@paren"),oO("\\tag@paren","\\tag@literal{({#1})}"),oO("\\tag@literal",(t=>{if(t.macros.get("\\df@tag"))throw new qN("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"})),oO("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}"),oO("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)"),oO("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}"),oO("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1"),oO("\\newline","\\\\\\relax"),oO("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");var sP=jI(LI["Main-Regular"]["T".charCodeAt(0)][1]-.7*LI["Main-Regular"]["A".charCodeAt(0)][1]);oO("\\LaTeX","\\textrm{\\html@mathml{L\\kern-.36em\\raisebox{"+sP+"}{\\scriptstyle A}\\kern-.15em\\TeX}{LaTeX}}"),oO("\\KaTeX","\\textrm{\\html@mathml{K\\kern-.17em\\raisebox{"+sP+"}{\\scriptstyle A}\\kern-.15em\\TeX}{KaTeX}}"),oO("\\hspace","\\@ifstar\\@hspacer\\@hspace"),oO("\\@hspace","\\hskip #1\\relax"),oO("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax"),oO("\\ordinarycolon",":"),oO("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}"),oO("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}'),oO("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}'),oO("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}'),oO("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}'),oO("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}'),oO("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}'),oO("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}'),oO("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}'),oO("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}'),oO("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}'),oO("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}'),oO("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}'),oO("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}'),oO("∷","\\dblcolon"),oO("∹","\\eqcolon"),oO("≔","\\coloneqq"),oO("≕","\\eqqcolon"),oO("⩴","\\Coloneqq"),oO("\\ratio","\\vcentcolon"),oO("\\coloncolon","\\dblcolon"),oO("\\colonequals","\\coloneqq"),oO("\\coloncolonequals","\\Coloneqq"),oO("\\equalscolon","\\eqqcolon"),oO("\\equalscoloncolon","\\Eqqcolon"),oO("\\colonminus","\\coloneq"),oO("\\coloncolonminus","\\Coloneq"),oO("\\minuscolon","\\eqcolon"),oO("\\minuscoloncolon","\\Eqcolon"),oO("\\coloncolonapprox","\\Colonapprox"),oO("\\coloncolonsim","\\Colonsim"),oO("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}"),oO("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}"),oO("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}"),oO("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}"),oO("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}"),oO("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}"),oO("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}"),oO("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}"),oO("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}"),oO("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}"),oO("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}"),oO("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}"),oO("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}"),oO("\\gvertneqq","\\html@mathml{\\@gvertneqq}{≩}"),oO("\\lvertneqq","\\html@mathml{\\@lvertneqq}{≨}"),oO("\\ngeqq","\\html@mathml{\\@ngeqq}{≱}"),oO("\\ngeqslant","\\html@mathml{\\@ngeqslant}{≱}"),oO("\\nleqq","\\html@mathml{\\@nleqq}{≰}"),oO("\\nleqslant","\\html@mathml{\\@nleqslant}{≰}"),oO("\\nshortmid","\\html@mathml{\\@nshortmid}{∤}"),oO("\\nshortparallel","\\html@mathml{\\@nshortparallel}{∦}"),oO("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{⊈}"),oO("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{⊉}"),oO("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{⊊}"),oO("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{⫋}"),oO("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{⊋}"),oO("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{⫌}"),oO("\\imath","\\html@mathml{\\@imath}{ı}"),oO("\\jmath","\\html@mathml{\\@jmath}{ȷ}"),oO("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}"),oO("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}"),oO("⟦","\\llbracket"),oO("⟧","\\rrbracket"),oO("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}"),oO("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}"),oO("⦃","\\lBrace"),oO("⦄","\\rBrace"),oO("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}"),oO("⦵","\\minuso"),oO("\\darr","\\downarrow"),oO("\\dArr","\\Downarrow"),oO("\\Darr","\\Downarrow"),oO("\\lang","\\langle"),oO("\\rang","\\rangle"),oO("\\uarr","\\uparrow"),oO("\\uArr","\\Uparrow"),oO("\\Uarr","\\Uparrow"),oO("\\N","\\mathbb{N}"),oO("\\R","\\mathbb{R}"),oO("\\Z","\\mathbb{Z}"),oO("\\alef","\\aleph"),oO("\\alefsym","\\aleph"),oO("\\Alpha","\\mathrm{A}"),oO("\\Beta","\\mathrm{B}"),oO("\\bull","\\bullet"),oO("\\Chi","\\mathrm{X}"),oO("\\clubs","\\clubsuit"),oO("\\cnums","\\mathbb{C}"),oO("\\Complex","\\mathbb{C}"),oO("\\Dagger","\\ddagger"),oO("\\diamonds","\\diamondsuit"),oO("\\empty","\\emptyset"),oO("\\Epsilon","\\mathrm{E}"),oO("\\Eta","\\mathrm{H}"),oO("\\exist","\\exists"),oO("\\harr","\\leftrightarrow"),oO("\\hArr","\\Leftrightarrow"),oO("\\Harr","\\Leftrightarrow"),oO("\\hearts","\\heartsuit"),oO("\\image","\\Im"),oO("\\infin","\\infty"),oO("\\Iota","\\mathrm{I}"),oO("\\isin","\\in"),oO("\\Kappa","\\mathrm{K}"),oO("\\larr","\\leftarrow"),oO("\\lArr","\\Leftarrow"),oO("\\Larr","\\Leftarrow"),oO("\\lrarr","\\leftrightarrow"),oO("\\lrArr","\\Leftrightarrow"),oO("\\Lrarr","\\Leftrightarrow"),oO("\\Mu","\\mathrm{M}"),oO("\\natnums","\\mathbb{N}"),oO("\\Nu","\\mathrm{N}"),oO("\\Omicron","\\mathrm{O}"),oO("\\plusmn","\\pm"),oO("\\rarr","\\rightarrow"),oO("\\rArr","\\Rightarrow"),oO("\\Rarr","\\Rightarrow"),oO("\\real","\\Re"),oO("\\reals","\\mathbb{R}"),oO("\\Reals","\\mathbb{R}"),oO("\\Rho","\\mathrm{P}"),oO("\\sdot","\\cdot"),oO("\\sect","\\S"),oO("\\spades","\\spadesuit"),oO("\\sub","\\subset"),oO("\\sube","\\subseteq"),oO("\\supe","\\supseteq"),oO("\\Tau","\\mathrm{T}"),oO("\\thetasym","\\vartheta"),oO("\\weierp","\\wp"),oO("\\Zeta","\\mathrm{Z}"),oO("\\argmin","\\DOTSB\\operatorname*{arg\\,min}"),oO("\\argmax","\\DOTSB\\operatorname*{arg\\,max}"),oO("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits"),oO("\\bra","\\mathinner{\\langle{#1}|}"),oO("\\ket","\\mathinner{|{#1}\\rangle}"),oO("\\braket","\\mathinner{\\langle{#1}\\rangle}"),oO("\\Bra","\\left\\langle#1\\right|"),oO("\\Ket","\\left|#1\\right\\rangle");var oP=s((t=>e=>{var n=e.consumeArg().tokens,r=e.consumeArg().tokens,i=e.consumeArg().tokens,a=e.consumeArg().tokens,o=e.macros.get("|"),l=e.macros.get("\\|");e.macros.beginGroup();var c=s((e=>n=>{t&&(n.macros.set("|",o),i.length&&n.macros.set("\\|",l));var a=e;!e&&i.length&&("|"===n.future().text&&(n.popToken(),a=!0));return{tokens:a?i:r,numArgs:0}}),"midMacro");e.macros.set("|",c(!1)),i.length&&e.macros.set("\\|",c(!0));var h=e.consumeArg().tokens,u=e.expandTokens([...a,...h,...n]);return e.macros.endGroup(),{tokens:u.reverse(),numArgs:0}}),"braketHelper");oO("\\bra@ket",oP(!1)),oO("\\bra@set",oP(!0)),oO("\\Braket","\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}"),oO("\\Set","\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}"),oO("\\set","\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}"),oO("\\angln","{\\angl n}"),oO("\\blue","\\textcolor{##6495ed}{#1}"),oO("\\orange","\\textcolor{##ffa500}{#1}"),oO("\\pink","\\textcolor{##ff00af}{#1}"),oO("\\red","\\textcolor{##df0030}{#1}"),oO("\\green","\\textcolor{##28ae7b}{#1}"),oO("\\gray","\\textcolor{gray}{#1}"),oO("\\purple","\\textcolor{##9d38bd}{#1}"),oO("\\blueA","\\textcolor{##ccfaff}{#1}"),oO("\\blueB","\\textcolor{##80f6ff}{#1}"),oO("\\blueC","\\textcolor{##63d9ea}{#1}"),oO("\\blueD","\\textcolor{##11accd}{#1}"),oO("\\blueE","\\textcolor{##0c7f99}{#1}"),oO("\\tealA","\\textcolor{##94fff5}{#1}"),oO("\\tealB","\\textcolor{##26edd5}{#1}"),oO("\\tealC","\\textcolor{##01d1c1}{#1}"),oO("\\tealD","\\textcolor{##01a995}{#1}"),oO("\\tealE","\\textcolor{##208170}{#1}"),oO("\\greenA","\\textcolor{##b6ffb0}{#1}"),oO("\\greenB","\\textcolor{##8af281}{#1}"),oO("\\greenC","\\textcolor{##74cf70}{#1}"),oO("\\greenD","\\textcolor{##1fab54}{#1}"),oO("\\greenE","\\textcolor{##0d923f}{#1}"),oO("\\goldA","\\textcolor{##ffd0a9}{#1}"),oO("\\goldB","\\textcolor{##ffbb71}{#1}"),oO("\\goldC","\\textcolor{##ff9c39}{#1}"),oO("\\goldD","\\textcolor{##e07d10}{#1}"),oO("\\goldE","\\textcolor{##a75a05}{#1}"),oO("\\redA","\\textcolor{##fca9a9}{#1}"),oO("\\redB","\\textcolor{##ff8482}{#1}"),oO("\\redC","\\textcolor{##f9685d}{#1}"),oO("\\redD","\\textcolor{##e84d39}{#1}"),oO("\\redE","\\textcolor{##bc2612}{#1}"),oO("\\maroonA","\\textcolor{##ffbde0}{#1}"),oO("\\maroonB","\\textcolor{##ff92c6}{#1}"),oO("\\maroonC","\\textcolor{##ed5fa6}{#1}"),oO("\\maroonD","\\textcolor{##ca337c}{#1}"),oO("\\maroonE","\\textcolor{##9e034e}{#1}"),oO("\\purpleA","\\textcolor{##ddd7ff}{#1}"),oO("\\purpleB","\\textcolor{##c6b9fc}{#1}"),oO("\\purpleC","\\textcolor{##aa87ff}{#1}"),oO("\\purpleD","\\textcolor{##7854ab}{#1}"),oO("\\purpleE","\\textcolor{##543b78}{#1}"),oO("\\mintA","\\textcolor{##f5f9e8}{#1}"),oO("\\mintB","\\textcolor{##edf2df}{#1}"),oO("\\mintC","\\textcolor{##e0e5cc}{#1}"),oO("\\grayA","\\textcolor{##f6f7f7}{#1}"),oO("\\grayB","\\textcolor{##f0f1f2}{#1}"),oO("\\grayC","\\textcolor{##e3e5e6}{#1}"),oO("\\grayD","\\textcolor{##d6d8da}{#1}"),oO("\\grayE","\\textcolor{##babec2}{#1}"),oO("\\grayF","\\textcolor{##888d93}{#1}"),oO("\\grayG","\\textcolor{##626569}{#1}"),oO("\\grayH","\\textcolor{##3b3e40}{#1}"),oO("\\grayI","\\textcolor{##21242c}{#1}"),oO("\\kaBlue","\\textcolor{##314453}{#1}"),oO("\\kaGreen","\\textcolor{##71B307}{#1}");var lP={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0},cP=class{static{s(this,"MacroExpander")}constructor(t,e,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=e,this.expansionCount=0,this.feed(t),this.macros=new tP(eP,e.macros),this.mode=n,this.stack=[]}feed(t){this.lexer=new JO(t,this.settings)}switchMode(t){this.mode=t}beginGroup(){this.macros.beginGroup()}endGroup(){this.macros.endGroup()}endGroups(){this.macros.endGroups()}future(){return 0===this.stack.length&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]}popToken(){return this.future(),this.stack.pop()}pushToken(t){this.stack.push(t)}pushTokens(t){this.stack.push(...t)}scanArgument(t){var e,n,r;if(t){if(this.consumeSpaces(),"["!==this.future().text)return null;e=this.popToken(),({tokens:r,end:n}=this.consumeArg(["]"]))}else({tokens:r,start:e,end:n}=this.consumeArg());return this.pushToken(new GN("EOF",n.loc)),this.pushTokens(r),e.range(n,"")}consumeSpaces(){for(;;){if(" "!==this.future().text)break;this.stack.pop()}}consumeArg(t){var e=[],n=t&&t.length>0;n||this.consumeSpaces();var r,i=this.future(),a=0,s=0;do{if(r=this.popToken(),e.push(r),"{"===r.text)++a;else if("}"===r.text){if(-1===--a)throw new qN("Extra }",r)}else if("EOF"===r.text)throw new qN("Unexpected end of input in a macro argument, expected '"+(t&&n?t[s]:"}")+"'",r);if(t&&n)if((0===a||1===a&&"{"===t[s])&&r.text===t[s]){if(++s===t.length){e.splice(-s,s);break}}else s=0}while(0!==a||n);return"{"===i.text&&"}"===e[e.length-1].text&&(e.pop(),e.shift()),e.reverse(),{tokens:e,start:i,end:r}}consumeArgs(t,e){if(e){if(e.length!==t+1)throw new qN("The length of delimiters doesn't match the number of args!");for(var n=e[0],r=0;r<n.length;r++){var i=this.popToken();if(n[r]!==i.text)throw new qN("Use of the macro doesn't match its definition",i)}}for(var a=[],s=0;s<t;s++)a.push(this.consumeArg(e&&e[s+1]).tokens);return a}countExpansion(t){if(this.expansionCount+=t,this.expansionCount>this.settings.maxExpand)throw new qN("Too many expansions: infinite loop or need to increase maxExpand setting")}expandOnce(t){var e=this.popToken(),n=e.text,r=e.noexpand?null:this._getExpansion(n);if(null==r||t&&r.unexpandable){if(t&&null==r&&"\\"===n[0]&&!this.isDefined(n))throw new qN("Undefined control sequence: "+n);return this.pushToken(e),!1}this.countExpansion(1);var i=r.tokens,a=this.consumeArgs(r.numArgs,r.delimiters);if(r.numArgs)for(var s=(i=i.slice()).length-1;s>=0;--s){var o=i[s];if("#"===o.text){if(0===s)throw new qN("Incomplete placeholder at end of macro body",o);if("#"===(o=i[--s]).text)i.splice(s+1,1);else{if(!/^[1-9]$/.test(o.text))throw new qN("Not a valid argument number",o);i.splice(s,2,...a[+o.text-1])}}}return this.pushTokens(i),i.length}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;)if(!1===this.expandOnce()){var t=this.stack.pop();return t.treatAsRelax&&(t.text="\\relax"),t}throw new Error}expandMacro(t){return this.macros.has(t)?this.expandTokens([new GN(t)]):void 0}expandTokens(t){var e=[],n=this.stack.length;for(this.pushTokens(t);this.stack.length>n;)if(!1===this.expandOnce(!0)){var r=this.stack.pop();r.treatAsRelax&&(r.noexpand=!1,r.treatAsRelax=!1),e.push(r)}return this.countExpansion(e.length),e}expandMacroAsText(t){var e=this.expandMacro(t);return e?e.map((t=>t.text)).join(""):e}_getExpansion(t){var e=this.macros.get(t);if(null==e)return e;if(1===t.length){var n=this.lexer.catcodes[t];if(null!=n&&13!==n)return}var r="function"==typeof e?e(this):e;if("string"==typeof r){var i=0;if(-1!==r.indexOf("#"))for(var a=r.replace(/##/g,"");-1!==a.indexOf("#"+(i+1));)++i;for(var s=new JO(r,this.settings),o=[],l=s.lex();"EOF"!==l.text;)o.push(l),l=s.lex();return o.reverse(),{tokens:o,numArgs:i}}return r}isDefined(t){return this.macros.has(t)||ZO.hasOwnProperty(t)||oM.math.hasOwnProperty(t)||oM.text.hasOwnProperty(t)||lP.hasOwnProperty(t)}isExpandable(t){var e=this.macros.get(t);return null!=e?"string"==typeof e||"function"==typeof e||!e.unexpandable:ZO.hasOwnProperty(t)&&!ZO[t].primitive}},hP=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,uP=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","ᵝ":"β","ᵞ":"γ","ᵟ":"δ","ᵠ":"ϕ","ᵡ":"χ","ᶿ":"θ"}),dP={"́":{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"}},pP={"á":"á","à":"à","ä":"ä","ǟ":"ǟ","ã":"ã","ā":"ā","ă":"ă","ắ":"ắ","ằ":"ằ","ẵ":"ẵ","ǎ":"ǎ","â":"â","ấ":"ấ","ầ":"ầ","ẫ":"ẫ","ȧ":"ȧ","ǡ":"ǡ","å":"å","ǻ":"ǻ","ḃ":"ḃ","ć":"ć","ḉ":"ḉ","č":"č","ĉ":"ĉ","ċ":"ċ","ç":"ç","ď":"ď","ḋ":"ḋ","ḑ":"ḑ","é":"é","è":"è","ë":"ë","ẽ":"ẽ","ē":"ē","ḗ":"ḗ","ḕ":"ḕ","ĕ":"ĕ","ḝ":"ḝ","ě":"ě","ê":"ê","ế":"ế","ề":"ề","ễ":"ễ","ė":"ė","ȩ":"ȩ","ḟ":"ḟ","ǵ":"ǵ","ḡ":"ḡ","ğ":"ğ","ǧ":"ǧ","ĝ":"ĝ","ġ":"ġ","ģ":"ģ","ḧ":"ḧ","ȟ":"ȟ","ĥ":"ĥ","ḣ":"ḣ","ḩ":"ḩ","í":"í","ì":"ì","ï":"ï","ḯ":"ḯ","ĩ":"ĩ","ī":"ī","ĭ":"ĭ","ǐ":"ǐ","î":"î","ǰ":"ǰ","ĵ":"ĵ","ḱ":"ḱ","ǩ":"ǩ","ķ":"ķ","ĺ":"ĺ","ľ":"ľ","ļ":"ļ","ḿ":"ḿ","ṁ":"ṁ","ń":"ń","ǹ":"ǹ","ñ":"ñ","ň":"ň","ṅ":"ṅ","ņ":"ņ","ó":"ó","ò":"ò","ö":"ö","ȫ":"ȫ","õ":"õ","ṍ":"ṍ","ṏ":"ṏ","ȭ":"ȭ","ō":"ō","ṓ":"ṓ","ṑ":"ṑ","ŏ":"ŏ","ǒ":"ǒ","ô":"ô","ố":"ố","ồ":"ồ","ỗ":"ỗ","ȯ":"ȯ","ȱ":"ȱ","ő":"ő","ṕ":"ṕ","ṗ":"ṗ","ŕ":"ŕ","ř":"ř","ṙ":"ṙ","ŗ":"ŗ","ś":"ś","ṥ":"ṥ","š":"š","ṧ":"ṧ","ŝ":"ŝ","ṡ":"ṡ","ş":"ş","ẗ":"ẗ","ť":"ť","ṫ":"ṫ","ţ":"ţ","ú":"ú","ù":"ù","ü":"ü","ǘ":"ǘ","ǜ":"ǜ","ǖ":"ǖ","ǚ":"ǚ","ũ":"ũ","ṹ":"ṹ","ū":"ū","ṻ":"ṻ","ŭ":"ŭ","ǔ":"ǔ","û":"û","ů":"ů","ű":"ű","ṽ":"ṽ","ẃ":"ẃ","ẁ":"ẁ","ẅ":"ẅ","ŵ":"ŵ","ẇ":"ẇ","ẘ":"ẘ","ẍ":"ẍ","ẋ":"ẋ","ý":"ý","ỳ":"ỳ","ÿ":"ÿ","ỹ":"ỹ","ȳ":"ȳ","ŷ":"ŷ","ẏ":"ẏ","ẙ":"ẙ","ź":"ź","ž":"ž","ẑ":"ẑ","ż":"ż","Á":"Á","À":"À","Ä":"Ä","Ǟ":"Ǟ","Ã":"Ã","Ā":"Ā","Ă":"Ă","Ắ":"Ắ","Ằ":"Ằ","Ẵ":"Ẵ","Ǎ":"Ǎ","Â":"Â","Ấ":"Ấ","Ầ":"Ầ","Ẫ":"Ẫ","Ȧ":"Ȧ","Ǡ":"Ǡ","Å":"Å","Ǻ":"Ǻ","Ḃ":"Ḃ","Ć":"Ć","Ḉ":"Ḉ","Č":"Č","Ĉ":"Ĉ","Ċ":"Ċ","Ç":"Ç","Ď":"Ď","Ḋ":"Ḋ","Ḑ":"Ḑ","É":"É","È":"È","Ë":"Ë","Ẽ":"Ẽ","Ē":"Ē","Ḗ":"Ḗ","Ḕ":"Ḕ","Ĕ":"Ĕ","Ḝ":"Ḝ","Ě":"Ě","Ê":"Ê","Ế":"Ế","Ề":"Ề","Ễ":"Ễ","Ė":"Ė","Ȩ":"Ȩ","Ḟ":"Ḟ","Ǵ":"Ǵ","Ḡ":"Ḡ","Ğ":"Ğ","Ǧ":"Ǧ","Ĝ":"Ĝ","Ġ":"Ġ","Ģ":"Ģ","Ḧ":"Ḧ","Ȟ":"Ȟ","Ĥ":"Ĥ","Ḣ":"Ḣ","Ḩ":"Ḩ","Í":"Í","Ì":"Ì","Ï":"Ï","Ḯ":"Ḯ","Ĩ":"Ĩ","Ī":"Ī","Ĭ":"Ĭ","Ǐ":"Ǐ","Î":"Î","İ":"İ","Ĵ":"Ĵ","Ḱ":"Ḱ","Ǩ":"Ǩ","Ķ":"Ķ","Ĺ":"Ĺ","Ľ":"Ľ","Ļ":"Ļ","Ḿ":"Ḿ","Ṁ":"Ṁ","Ń":"Ń","Ǹ":"Ǹ","Ñ":"Ñ","Ň":"Ň","Ṅ":"Ṅ","Ņ":"Ņ","Ó":"Ó","Ò":"Ò","Ö":"Ö","Ȫ":"Ȫ","Õ":"Õ","Ṍ":"Ṍ","Ṏ":"Ṏ","Ȭ":"Ȭ","Ō":"Ō","Ṓ":"Ṓ","Ṑ":"Ṑ","Ŏ":"Ŏ","Ǒ":"Ǒ","Ô":"Ô","Ố":"Ố","Ồ":"Ồ","Ỗ":"Ỗ","Ȯ":"Ȯ","Ȱ":"Ȱ","Ő":"Ő","Ṕ":"Ṕ","Ṗ":"Ṗ","Ŕ":"Ŕ","Ř":"Ř","Ṙ":"Ṙ","Ŗ":"Ŗ","Ś":"Ś","Ṥ":"Ṥ","Š":"Š","Ṧ":"Ṧ","Ŝ":"Ŝ","Ṡ":"Ṡ","Ş":"Ş","Ť":"Ť","Ṫ":"Ṫ","Ţ":"Ţ","Ú":"Ú","Ù":"Ù","Ü":"Ü","Ǘ":"Ǘ","Ǜ":"Ǜ","Ǖ":"Ǖ","Ǚ":"Ǚ","Ũ":"Ũ","Ṹ":"Ṹ","Ū":"Ū","Ṻ":"Ṻ","Ŭ":"Ŭ","Ǔ":"Ǔ","Û":"Û","Ů":"Ů","Ű":"Ű","Ṽ":"Ṽ","Ẃ":"Ẃ","Ẁ":"Ẁ","Ẅ":"Ẅ","Ŵ":"Ŵ","Ẇ":"Ẇ","Ẍ":"Ẍ","Ẋ":"Ẋ","Ý":"Ý","Ỳ":"Ỳ","Ÿ":"Ÿ","Ỹ":"Ỹ","Ȳ":"Ȳ","Ŷ":"Ŷ","Ẏ":"Ẏ","Ź":"Ź","Ž":"Ž","Ẑ":"Ẑ","Ż":"Ż","ά":"ά","ὰ":"ὰ","ᾱ":"ᾱ","ᾰ":"ᾰ","έ":"έ","ὲ":"ὲ","ή":"ή","ὴ":"ὴ","ί":"ί","ὶ":"ὶ","ϊ":"ϊ","ΐ":"ΐ","ῒ":"ῒ","ῑ":"ῑ","ῐ":"ῐ","ό":"ό","ὸ":"ὸ","ύ":"ύ","ὺ":"ὺ","ϋ":"ϋ","ΰ":"ΰ","ῢ":"ῢ","ῡ":"ῡ","ῠ":"ῠ","ώ":"ώ","ὼ":"ὼ","Ύ":"Ύ","Ὺ":"Ὺ","Ϋ":"Ϋ","Ῡ":"Ῡ","Ῠ":"Ῠ","Ώ":"Ώ","Ὼ":"Ὼ"},gP=class t{static{s(this,"Parser")}constructor(t,e){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 cP(t,e,this.mode),this.settings=e,this.leftrightDepth=0}expect(t,e){if(void 0===e&&(e=!0),this.fetch().text!==t)throw new qN("Expected '"+t+"', got '"+this.fetch().text+"'",this.fetch());e&&this.consume()}consume(){this.nextToken=null}fetch(){return null==this.nextToken&&(this.nextToken=this.gullet.expandNextToken()),this.nextToken}switchMode(t){this.mode=t,this.gullet.switchMode(t)}parse(){this.settings.globalGroup||this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set("\\color","\\textcolor");try{var t=this.parseExpression(!1);return this.expect("EOF"),this.settings.globalGroup||this.gullet.endGroup(),t}finally{this.gullet.endGroups()}}subparse(t){var e=this.nextToken;this.consume(),this.gullet.pushToken(new GN("}")),this.gullet.pushTokens(t);var n=this.parseExpression(!1);return this.expect("}"),this.nextToken=e,n}parseExpression(e,n){for(var r=[];;){"math"===this.mode&&this.consumeSpaces();var i=this.fetch();if(-1!==t.endOfExpression.indexOf(i.text))break;if(n&&i.text===n)break;if(e&&ZO[i.text]&&ZO[i.text].infix)break;var a=this.parseAtom(n);if(!a)break;"internal"!==a.type&&r.push(a)}return"text"===this.mode&&this.formLigatures(r),this.handleInfixNodes(r)}handleInfixNodes(t){for(var e,n=-1,r=0;r<t.length;r++)if("infix"===t[r].type){if(-1!==n)throw new qN("only one infix operator per group",t[r].token);n=r,e=t[r].replaceWith}if(-1!==n&&e){var i,a,s=t.slice(0,n),o=t.slice(n+1);return i=1===s.length&&"ordgroup"===s[0].type?s[0]:{type:"ordgroup",mode:this.mode,body:s},a=1===o.length&&"ordgroup"===o[0].type?o[0]:{type:"ordgroup",mode:this.mode,body:o},["\\\\abovefrac"===e?this.callFunction(e,[i,t[n],a],[]):this.callFunction(e,[i,a],[])]}return t}handleSupSubscript(t){var e=this.fetch(),n=e.text;this.consume(),this.consumeSpaces();var r=this.parseGroup(t);if(!r)throw new qN("Expected group after '"+n+"'",e);return r}formatUnsupportedCmd(t){for(var e=[],n=0;n<t.length;n++)e.push({type:"textord",mode:"text",text:t[n]});var r={type:"text",mode:this.mode,body:e};return{type:"color",mode:this.mode,color:this.settings.errorColor,body:[r]}}parseAtom(t){var e,n,r=this.parseGroup("atom",t);if("text"===this.mode)return r;for(;;){this.consumeSpaces();var i=this.fetch();if("\\limits"===i.text||"\\nolimits"===i.text){if(r&&"op"===r.type){var a="\\limits"===i.text;r.limits=a,r.alwaysHandleSupSub=!0}else{if(!r||"operatorname"!==r.type)throw new qN("Limit controls must follow a math operator",i);r.alwaysHandleSupSub&&(r.limits="\\limits"===i.text)}this.consume()}else if("^"===i.text){if(e)throw new qN("Double superscript",i);e=this.handleSupSubscript("superscript")}else if("_"===i.text){if(n)throw new qN("Double subscript",i);n=this.handleSupSubscript("subscript")}else if("'"===i.text){if(e)throw new qN("Double superscript",i);var s={type:"textord",mode:this.mode,text:"\\prime"},o=[s];for(this.consume();"'"===this.fetch().text;)o.push(s),this.consume();"^"===this.fetch().text&&o.push(this.handleSupSubscript("superscript")),e={type:"ordgroup",mode:this.mode,body:o}}else{if(!uP[i.text])break;var l=hP.test(i.text),c=[];for(c.push(new GN(uP[i.text])),this.consume();;){var h=this.fetch().text;if(!uP[h])break;if(hP.test(h)!==l)break;c.unshift(new GN(uP[h])),this.consume()}var u=this.subparse(c);l?n={type:"ordgroup",mode:"math",body:u}:e={type:"ordgroup",mode:"math",body:u}}}return e||n?{type:"supsub",mode:this.mode,base:r,sup:e,sub:n}:r}parseFunction(t,e){var n=this.fetch(),r=n.text,i=ZO[r];if(!i)return null;if(this.consume(),e&&"atom"!==e&&!i.allowedInArgument)throw new qN("Got function '"+r+"' with no arguments"+(e?" as "+e:""),n);if("text"===this.mode&&!i.allowedInText)throw new qN("Can't use function '"+r+"' in text mode",n);if("math"===this.mode&&!1===i.allowedInMath)throw new qN("Can't use function '"+r+"' in math mode",n);var{args:a,optArgs:s}=this.parseArguments(r,i);return this.callFunction(r,a,s,n,t)}callFunction(t,e,n,r,i){var a={funcName:t,parser:this,token:r,breakOnTokenText:i},s=ZO[t];if(s&&s.handler)return s.handler(a,e,n);throw new qN("No function handler for "+t)}parseArguments(t,e){var n=e.numArgs+e.numOptionalArgs;if(0===n)return{args:[],optArgs:[]};for(var r=[],i=[],a=0;a<n;a++){var s=e.argTypes&&e.argTypes[a],o=a<e.numOptionalArgs;(e.primitive&&null==s||"sqrt"===e.type&&1===a&&null==i[0])&&(s="primitive");var l=this.parseGroupOfType("argument to '"+t+"'",s,o);if(o)i.push(l);else{if(null==l)throw new qN("Null argument, please report this as a bug");r.push(l)}}return{args:r,optArgs:i}}parseGroupOfType(t,e,n){switch(e){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,e);case"hbox":var r=this.parseArgumentGroup(n,"text");return null!=r?{type:"styling",mode:r.mode,body:[r],style:"text"}:null;case"raw":var i=this.parseStringGroup("raw",n);return null!=i?{type:"raw",mode:"text",string:i.text}:null;case"primitive":if(n)throw new qN("A primitive argument cannot be optional");var a=this.parseGroup(t);if(null==a)throw new qN("Expected group as "+t,this.fetch());return a;case"original":case null:case void 0:return this.parseArgumentGroup(n);default:throw new qN("Unknown group type as "+t,this.fetch())}}consumeSpaces(){for(;" "===this.fetch().text;)this.consume()}parseStringGroup(t,e){var n=this.gullet.scanArgument(e);if(null==n)return null;for(var r,i="";"EOF"!==(r=this.fetch()).text;)i+=r.text,this.consume();return this.consume(),n.text=i,n}parseRegexGroup(t,e){for(var n,r=this.fetch(),i=r,a="";"EOF"!==(n=this.fetch()).text&&t.test(a+n.text);)a+=(i=n).text,this.consume();if(""===a)throw new qN("Invalid "+e+": '"+r.text+"'",r);return r.range(i,a)}parseColorGroup(t){var e=this.parseStringGroup("color",t);if(null==e)return null;var n=/^(#[a-f0-9]{3}|#?[a-f0-9]{6}|[a-z]+)$/i.exec(e.text);if(!n)throw new qN("Invalid color: '"+e.text+"'",e);var r=n[0];return/^[0-9a-f]{6}$/i.test(r)&&(r="#"+r),{type:"color-token",mode:this.mode,color:r}}parseSizeGroup(t){var e,n=!1;if(this.gullet.consumeSpaces(),!(e=t||"{"===this.gullet.future().text?this.parseStringGroup("size",t):this.parseRegexGroup(/^[-+]? *(?:$|\d+|\d+\.\d*|\.\d*) *[a-z]{0,2} *$/,"size")))return null;t||0!==e.text.length||(e.text="0pt",n=!0);var r=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(e.text);if(!r)throw new qN("Invalid size: '"+e.text+"'",e);var i={number:+(r[1]+r[2]),unit:r[3]};if(!GI(i))throw new qN("Invalid unit: '"+i.unit+"'",e);return{type:"size",mode:this.mode,value:i,isBlank:n}}parseUrlGroup(t){this.gullet.lexer.setCatcode("%",13),this.gullet.lexer.setCatcode("~",12);var e=this.parseStringGroup("url",t);if(this.gullet.lexer.setCatcode("%",14),this.gullet.lexer.setCatcode("~",13),null==e)return null;var n=e.text.replace(/\\([#$%&~_^{}])/g,"$1");return{type:"url",mode:this.mode,url:n}}parseArgumentGroup(t,e){var n=this.gullet.scanArgument(t);if(null==n)return null;var r=this.mode;e&&this.switchMode(e),this.gullet.beginGroup();var i=this.parseExpression(!1,"EOF");this.expect("EOF"),this.gullet.endGroup();var a={type:"ordgroup",mode:this.mode,loc:n.loc,body:i};return e&&this.switchMode(r),a}parseGroup(t,e){var n,r=this.fetch(),i=r.text;if("{"===i||"\\begingroup"===i){this.consume();var a="{"===i?"}":"\\endgroup";this.gullet.beginGroup();var s=this.parseExpression(!1,a),o=this.fetch();this.expect(a),this.gullet.endGroup(),n={type:"ordgroup",mode:this.mode,loc:UN.range(r,o),body:s,semisimple:"\\begingroup"===i||void 0}}else if(null==(n=this.parseFunction(e,t)||this.parseSymbol())&&"\\"===i[0]&&!lP.hasOwnProperty(i)){if(this.settings.throwOnError)throw new qN("Undefined control sequence: "+i,r);n=this.formatUnsupportedCmd(i),this.consume()}return n}formLigatures(t){for(var e=t.length-1,n=0;n<e;++n){var r=t[n],i=r.text;"-"===i&&"-"===t[n+1].text&&(n+1<e&&"-"===t[n+2].text?(t.splice(n,3,{type:"textord",mode:"text",loc:UN.range(r,t[n+2]),text:"---"}),e-=2):(t.splice(n,2,{type:"textord",mode:"text",loc:UN.range(r,t[n+1]),text:"--"}),e-=1)),"'"!==i&&"`"!==i||t[n+1].text!==i||(t.splice(n,2,{type:"textord",mode:"text",loc:UN.range(r,t[n+1]),text:i+i}),e-=1)}}parseSymbol(){var t=this.fetch(),e=t.text;if(/^\\verb[^a-zA-Z]/.test(e)){this.consume();var n=e.slice(5),r="*"===n.charAt(0);if(r&&(n=n.slice(1)),n.length<2||n.charAt(0)!==n.slice(-1))throw new qN("\\verb assertion failed --\n please report what input caused this bug");return{type:"verb",mode:"text",body:n=n.slice(1,-1),star:r}}pP.hasOwnProperty(e[0])&&!oM[this.mode][e[0]]&&(this.settings.strict&&"math"===this.mode&&this.settings.reportNonstrict("unicodeTextInMathMode",'Accented Unicode text character "'+e[0]+'" used in math mode',t),e=pP[e[0]]+e.slice(1));var i,a=QO.exec(e);if(a&&("i"===(e=e.substring(0,a.index))?e="ı":"j"===e&&(e="ȷ")),oM[this.mode][e]){this.settings.strict&&"math"===this.mode&&"ÐÞþ".indexOf(e)>=0&&this.settings.reportNonstrict("unicodeTextInMathMode",'Latin-1/Unicode text character "'+e[0]+'" used in math mode',t);var s,o=oM[this.mode][e].group,l=UN.range(t);if(aM.hasOwnProperty(o)){var c=o;s={type:"atom",mode:this.mode,family:c,loc:l,text:e}}else s={type:o,mode:this.mode,loc:l,text:e};i=s}else{if(!(e.charCodeAt(0)>=128))return null;this.settings.strict&&(mI(e.charCodeAt(0))?"math"===this.mode&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+e[0]+'" used in math mode',t):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+e[0]+'" ('+e.charCodeAt(0)+")",t)),i={type:"textord",mode:"text",loc:UN.range(t),text:e}}if(this.consume(),a)for(var h=0;h<a[0].length;h++){var u=a[0][h];if(!dP[u])throw new qN("Unknown accent ' "+u+"'",t);var d=dP[u][this.mode]||dP[u].text;if(!d)throw new qN("Accent "+u+" unsupported in "+this.mode+" mode",t);i={type:"accent",mode:this.mode,loc:UN.range(t),label:d,isStretchy:!1,isShifty:!0,base:i}}return i}};gP.endOfExpression=["}","\\endgroup","\\end","\\right","&"];var fP=s((function(t,e){if(!("string"==typeof t||t instanceof String))throw new TypeError("KaTeX can only parse string typed expression");var n=new gP(t,e);delete n.gullet.macros.current["\\df@tag"];var r=n.parse();if(delete n.gullet.macros.current["\\current@color"],delete n.gullet.macros.current["\\color"],n.gullet.macros.get("\\df@tag")){if(!e.displayMode)throw new qN("\\tag works only in display equations");r=[{type:"tag",mode:"text",body:r,tag:n.subparse([new GN("\\df@tag")])}]}return r}),"parseTree"),mP=s((function(t,e,n){e.textContent="";var r=bP(t,n).toNode();e.appendChild(r)}),"render");"undefined"!=typeof document&&"CSS1Compat"!==document.compatMode&&("undefined"!=typeof console&&console.warn("Warning: KaTeX doesn't work in quirks mode. Make sure your website has a suitable doctype."),mP=s((function(){throw new qN("KaTeX doesn't work in quirks mode.")}),"render"));var yP=s((function(t,e){return bP(t,e).toMarkup()}),"renderToString"),vP=s((function(t,e){var n=new rI(e);return fP(t,n)}),"generateParseTree"),xP=s((function(t,e,n){if(n.throwOnError||!(t instanceof qN))throw t;var r=sR.makeSpan(["katex-error"],[new JI(e)]);return r.setAttribute("title",t.toString()),r.setAttribute("style","color:"+n.errorColor),r}),"renderError"),bP=s((function(t,e){var n=new rI(e);try{var r=fP(t,n);return HR(r,t,n)}catch(e){return xP(e,t,n)}}),"renderToDomTree"),wP=s((function(t,e){var n=new rI(e);try{var r=fP(t,n);return VR(r,t,n)}catch(e){return xP(e,t,n)}}),"renderToHTMLTree"),kP={version:"0.16.11",render:mP,renderToString:yP,ParseError:qN,SETTINGS_SCHEMA:eI,__parse:vP,__renderToDomTree:bP,__renderToHTMLTree:wP,__setFontMetrics:MI,__defineSymbol:lM,__defineFunction:fR,__defineMacro:oO,__domTree:{Span:XI,Anchor:KI,SymbolNode:JI,SvgNode:tM,PathNode:eM,LineNode:nM}},TP=Object.freeze({__proto__:null,default:kP});function _P(t){return gb(t)?ew(t):sA(t)}s(_P,"keys");var EP=_P;function CP(t,e){for(var n=-1,r=null==t?0:t.length;++n<r&&!1!==e(t[n],n,t););return t}s(CP,"arrayEach");var SP=CP;function AP(t,e){return t&&Hb(e,EP(e),t)}s(AP,"baseAssign");var LP=AP;function NP(t,e){return t&&Hb(e,lw(e),t)}s(NP,"baseAssignIn");var IP=NP;function MP(t,e){for(var n=-1,r=null==t?0:t.length,i=0,a=[];++n<r;){var s=t[n];e(s,n,t)&&(a[i++]=s)}return a}s(MP,"arrayFilter");var RP=MP;function DP(){return[]}s(DP,"stubArray");var OP=DP,PP=Object.prototype.propertyIsEnumerable,BP=Object.getOwnPropertySymbols,$P=BP?function(t){return null==t?[]:(t=Object(t),RP(BP(t),(function(e){return PP.call(t,e)})))}:OP,FP=$P;function zP(t,e){return Hb(t,FP(t),e)}s(zP,"copySymbols");var UP=zP;function GP(t,e){for(var n=-1,r=e.length,i=t.length;++n<r;)t[i+n]=e[n];return t}s(GP,"arrayPush");var qP=GP,jP=Object.getOwnPropertySymbols?function(t){for(var e=[];t;)qP(e,FP(t)),t=Xx(t);return e}:OP,YP=jP;function WP(t,e){return Hb(t,YP(t),e)}s(WP,"copySymbolsIn");var HP=WP;function VP(t,e,n){var r=e(t);return hb(t)?r:qP(r,n(t))}s(VP,"baseGetAllKeys");var XP=VP;function KP(t){return XP(t,EP,FP)}s(KP,"getAllKeys");var ZP=KP;function QP(t){return XP(t,lw,YP)}s(QP,"getAllKeysIn");var JP=QP,tB=Object.prototype.hasOwnProperty;function eB(t){var e=t.length,n=new t.constructor(e);return e&&"string"==typeof t[0]&&tB.call(t,"index")&&(n.index=t.index,n.input=t.input),n}s(eB,"initCloneArray");var nB=eB;function rB(t,e){var n=e?Fx(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}s(rB,"cloneDataView");var iB=rB,aB=/\w*$/;function sB(t){var e=new t.constructor(t.source,aB.exec(t));return e.lastIndex=t.lastIndex,e}s(sB,"cloneRegExp");var oB=sB,lB=Ny?Ny.prototype:void 0,cB=lB?lB.valueOf:void 0;function hB(t){return cB?Object(cB.call(t)):{}}s(hB,"cloneSymbol");var uB=hB;function dB(t,e,n){var r=t.constructor;switch(e){case"[object ArrayBuffer]":return Fx(t);case"[object Boolean]":case"[object Date]":return new r(+t);case"[object DataView]":return iB(t,n);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return Ux(t,n);case"[object Map]":case"[object Set]":return new r;case"[object Number]":case"[object String]":return new r(t);case"[object RegExp]":return oB(t);case"[object Symbol]":return uB(t)}}s(dB,"initCloneByTag");var pB=dB;function gB(t){return nb(t)&&"[object Map]"==yA(t)}s(gB,"baseIsMap");var fB=gB,mB=$b&&$b.isMap,yB=mB?Db(mB):fB;function vB(t){return nb(t)&&"[object Set]"==yA(t)}s(vB,"baseIsSet");var xB=vB,bB=$b&&$b.isSet,wB=bB?Db(bB):xB,kB={};function TB(t,e,n,r,i,a){var s,o=1&e,l=2&e,c=4&e;if(n&&(s=i?n(t,r,i,a):n(t)),void 0!==s)return s;if(!jy(t))return t;var h=hb(t);if(h){if(s=nB(t),!o)return qx(t,s)}else{var u=yA(t),d="[object Function]"==u||"[object GeneratorFunction]"==u;if(kb(t))return Px(t,o);if("[object Object]"==u||"[object Arguments]"==u||d&&!i){if(s=l||d?{}:tb(t),!o)return l?HP(t,IP(s,t)):UP(t,LP(s,t))}else{if(!kB[u])return i?t:{};s=pB(t,u,o)}}a||(a=new Tx);var p=a.get(t);if(p)return p;a.set(t,s),wB(t)?t.forEach((function(r){s.add(TB(r,e,n,r,t,a))})):yB(t)&&t.forEach((function(r,i){s.set(i,TB(r,e,n,i,t,a))}));var g=h?void 0:(c?l?JP:ZP:l?lw:EP)(t);return SP(g||t,(function(r,i){g&&(r=t[i=r]),Yb(s,i,TB(r,e,n,i,t,a))})),s}kB["[object Arguments]"]=kB["[object Array]"]=kB["[object ArrayBuffer]"]=kB["[object DataView]"]=kB["[object Boolean]"]=kB["[object Date]"]=kB["[object Float32Array]"]=kB["[object Float64Array]"]=kB["[object Int8Array]"]=kB["[object Int16Array]"]=kB["[object Int32Array]"]=kB["[object Map]"]=kB["[object Number]"]=kB["[object Object]"]=kB["[object RegExp]"]=kB["[object Set]"]=kB["[object String]"]=kB["[object Symbol]"]=kB["[object Uint8Array]"]=kB["[object Uint8ClampedArray]"]=kB["[object Uint16Array]"]=kB["[object Uint32Array]"]=!0,kB["[object Error]"]=kB["[object Function]"]=kB["[object WeakMap]"]=!1,s(TB,"baseClone");var _B=TB;function EB(t){return _B(t,4)}s(EB,"clone");var CB=EB,SB=Object.prototype,AB=SB.hasOwnProperty,LB=Aw((function(t,e){t=Object(t);var n=-1,r=e.length,i=r>2?e[2]:void 0;for(i&&Nw(e[0],e[1],i)&&(r=1);++n<r;)for(var a=e[n],s=lw(a),o=-1,l=s.length;++o<l;){var c=s[o],h=t[c];(void 0===h||Iv(h,SB[c])&&!AB.call(t,c))&&(t[c]=a[c])}return t})),NB=LB;function IB(t){var e=null==t?0:t.length;return e?t[e-1]:void 0}s(IB,"last");var MB=IB;function RB(t,e){return t&&Nx(t,e,EP)}s(RB,"baseForOwn");var DB=RB;function OB(t,e){return function(n,r){if(null==n)return n;if(!gb(n))return t(n,r);for(var i=n.length,a=e?i:-1,s=Object(n);(e?a--:++a<i)&&!1!==r(s[a],a,s););return n}}s(OB,"createBaseEach");var PB=OB(DB);function BB(t){return"function"==typeof t?t:mw}s(BB,"castFunction");var $B=BB;function FB(t,e){return(hb(t)?SP:PB)(t,$B(e))}s(FB,"forEach");var zB=FB;function UB(t,e){var n=[];return PB(t,(function(t,r,i){e(t,r,i)&&n.push(t)})),n}s(UB,"baseFilter");var GB=UB;function qB(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this}s(qB,"setCacheAdd");var jB=qB;function YB(t){return this.__data__.has(t)}s(YB,"setCacheHas");var WB=YB;function HB(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new ox;++e<n;)this.add(t[e])}s(HB,"SetCache"),HB.prototype.add=HB.prototype.push=jB,HB.prototype.has=WB;var VB=HB;function XB(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}s(XB,"arraySome");var KB=XB;function ZB(t,e){return t.has(e)}s(ZB,"cacheHas");var QB=ZB;function JB(t,e,n,r,i,a){var s=1&n,o=t.length,l=e.length;if(o!=l&&!(s&&l>o))return!1;var c=a.get(t),h=a.get(e);if(c&&h)return c==e&&h==t;var u=-1,d=!0,p=2&n?new VB:void 0;for(a.set(t,e),a.set(e,t);++u<o;){var g=t[u],f=e[u];if(r)var m=s?r(f,g,u,e,t,a):r(g,f,u,t,e,a);if(void 0!==m){if(m)continue;d=!1;break}if(p){if(!KB(e,(function(t,e){if(!QB(p,e)&&(g===t||i(g,t,n,r,a)))return p.push(e)}))){d=!1;break}}else if(g!==f&&!i(g,f,n,r,a)){d=!1;break}}return a.delete(t),a.delete(e),d}s(JB,"equalArrays");var t$=JB;function e$(t){var e=-1,n=Array(t.size);return t.forEach((function(t,r){n[++e]=[r,t]})),n}s(e$,"mapToArray");var n$=e$;function r$(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=t})),n}s(r$,"setToArray");var i$=r$,a$=Ny?Ny.prototype:void 0,s$=a$?a$.valueOf:void 0;function o$(t,e,n,r,i,a,s){switch(n){case"[object DataView]":if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case"[object ArrayBuffer]":return!(t.byteLength!=e.byteLength||!a(new Bx(t),new Bx(e)));case"[object Boolean]":case"[object Date]":case"[object Number]":return Iv(+t,+e);case"[object Error]":return t.name==e.name&&t.message==e.message;case"[object RegExp]":case"[object String]":return t==e+"";case"[object Map]":var o=n$;case"[object Set]":var l=1&r;if(o||(o=i$),t.size!=e.size&&!l)return!1;var c=s.get(t);if(c)return c==e;r|=2,s.set(t,e);var h=t$(o(t),o(e),r,i,a,s);return s.delete(t),h;case"[object Symbol]":if(s$)return s$.call(t)==s$.call(e)}return!1}s(o$,"equalByTag");var l$=o$,c$=Object.prototype.hasOwnProperty;function h$(t,e,n,r,i,a){var s=1&n,o=ZP(t),l=o.length;if(l!=ZP(e).length&&!s)return!1;for(var c=l;c--;){var h=o[c];if(!(s?h in e:c$.call(e,h)))return!1}var u=a.get(t),d=a.get(e);if(u&&d)return u==e&&d==t;var p=!0;a.set(t,e),a.set(e,t);for(var g=s;++c<l;){var f=t[h=o[c]],m=e[h];if(r)var y=s?r(m,f,h,e,t,a):r(f,m,h,t,e,a);if(!(void 0===y?f===m||i(f,m,n,r,a):y)){p=!1;break}g||(g="constructor"==h)}if(p&&!g){var v=t.constructor,x=e.constructor;v==x||!("constructor"in t)||!("constructor"in e)||"function"==typeof v&&v instanceof v&&"function"==typeof x&&x instanceof x||(p=!1)}return a.delete(t),a.delete(e),p}s(h$,"equalObjects");var u$=h$,d$=Object.prototype.hasOwnProperty;function p$(t,e,n,r,i,a){var s=hb(t),o=hb(e),l=s?"[object Array]":yA(t),c=o?"[object Array]":yA(e),h="[object Object]"==(l="[object Arguments]"==l?"[object Object]":l),u="[object Object]"==(c="[object Arguments]"==c?"[object Object]":c),d=l==c;if(d&&kb(t)){if(!kb(e))return!1;s=!0,h=!1}if(d&&!h)return a||(a=new Tx),s||zb(t)?t$(t,e,n,r,i,a):l$(t,e,l,n,r,i,a);if(!(1&n)){var p=h&&d$.call(t,"__wrapped__"),g=u&&d$.call(e,"__wrapped__");if(p||g){var f=p?t.value():t,m=g?e.value():e;return a||(a=new Tx),i(f,m,n,r,a)}}return!!d&&(a||(a=new Tx),u$(t,e,n,r,i,a))}s(p$,"baseIsEqualDeep");var g$=p$;function f$(t,e,n,r,i){return t===e||(null==t||null==e||!nb(t)&&!nb(e)?t!=t&&e!=e:g$(t,e,n,r,f$,i))}s(f$,"baseIsEqual");var m$=f$;function y$(t,e,n,r){var i=n.length,a=i,s=!r;if(null==t)return!a;for(t=Object(t);i--;){var o=n[i];if(s&&o[2]?o[1]!==t[o[0]]:!(o[0]in t))return!1}for(;++i<a;){var l=(o=n[i])[0],c=t[l],h=o[1];if(s&&o[2]){if(void 0===c&&!(l in t))return!1}else{var u=new Tx;if(r)var d=r(c,h,l,t,e,u);if(!(void 0===d?m$(h,c,3,r,u):d))return!1}}return!0}s(y$,"baseIsMatch");var v$=y$;function x$(t){return t==t&&!jy(t)}s(x$,"isStrictComparable");var b$=x$;function w$(t){for(var e=EP(t),n=e.length;n--;){var r=e[n],i=t[r];e[n]=[r,i,b$(i)]}return e}s(w$,"getMatchData");var k$=w$;function T$(t,e){return function(n){return null!=n&&(n[t]===e&&(void 0!==e||t in Object(n)))}}s(T$,"matchesStrictComparable");var _$=T$;function E$(t){var e=k$(t);return 1==e.length&&e[0][2]?_$(e[0][0],e[0][1]):function(n){return n===t||v$(n,t,e)}}s(E$,"baseMatches");var C$=E$;function S$(t){return"symbol"==typeof t||nb(t)&&"[object Symbol]"==Gy(t)}s(S$,"isSymbol");var A$=S$,L$=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,N$=/^\w*$/;function I$(t,e){if(hb(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!A$(t))||(N$.test(t)||!L$.test(t)||null!=e&&t in Object(e))}s(I$,"isKey");var M$=I$;function R$(t){var e=cx(t,(function(t){return 500===n.size&&n.clear(),t})),n=e.cache;return e}s(R$,"memoizeCapped");var D$=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,O$=/\\(\\)?/g,P$=R$((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(D$,(function(t,n,r,i){e.push(r?i.replace(O$,"$1"):n||t)})),e})),B$=P$;function $$(t,e){for(var n=-1,r=null==t?0:t.length,i=Array(r);++n<r;)i[n]=e(t[n],n,t);return i}s($$,"arrayMap");var F$=$$,z$=Ny?Ny.prototype:void 0,U$=z$?z$.toString:void 0;function G$(t){if("string"==typeof t)return t;if(hb(t))return F$(t,G$)+"";if(A$(t))return U$?U$.call(t):"";var e=t+"";return"0"==e&&1/t==-Infinity?"-0":e}s(G$,"baseToString");var q$=G$;function j$(t){return null==t?"":q$(t)}s(j$,"toString");var Y$=j$;function W$(t,e){return hb(t)?t:M$(t,e)?[t]:B$(Y$(t))}s(W$,"castPath");var H$=W$;function V$(t){if("string"==typeof t||A$(t))return t;var e=t+"";return"0"==e&&1/t==-Infinity?"-0":e}s(V$,"toKey");var X$=V$;function K$(t,e){for(var n=0,r=(e=H$(e,t)).length;null!=t&&n<r;)t=t[X$(e[n++])];return n&&n==r?t:void 0}s(K$,"baseGet");var Z$=K$;function Q$(t,e,n){var r=null==t?void 0:Z$(t,e);return void 0===r?n:r}s(Q$,"get");var J$=Q$;function tF(t,e){return null!=t&&e in Object(t)}s(tF,"baseHasIn");var eF=tF;function nF(t,e,n){for(var r=-1,i=(e=H$(e,t)).length,a=!1;++r<i;){var s=X$(e[r]);if(!(a=null!=t&&n(t,s)))break;t=t[s]}return a||++r!=i?a:!!(i=null==t?0:t.length)&&db(i)&&Qb(s,i)&&(hb(t)||cb(t))}s(nF,"hasPath");var rF=nF;function iF(t,e){return null!=t&&rF(t,e,eF)}s(iF,"hasIn");var aF=iF;function sF(t,e){return M$(t)&&b$(e)?_$(X$(t),e):function(n){var r=J$(n,t);return void 0===r&&r===e?aF(n,t):m$(e,r,3)}}s(sF,"baseMatchesProperty");var oF=sF;function lF(t){return function(e){return null==e?void 0:e[t]}}s(lF,"baseProperty");var cF=lF;function hF(t){return function(e){return Z$(e,t)}}s(hF,"basePropertyDeep");var uF=hF;function dF(t){return M$(t)?cF(X$(t)):uF(t)}s(dF,"property");var pF=dF;function gF(t){return"function"==typeof t?t:null==t?mw:"object"==typeof t?hb(t)?oF(t[0],t[1]):C$(t):pF(t)}s(gF,"baseIteratee");var fF=gF;function mF(t,e){return(hb(t)?RP:GB)(t,fF(e))}s(mF,"filter");var yF=mF;function vF(t,e){var n=-1,r=gb(t)?Array(t.length):[];return PB(t,(function(t,i,a){r[++n]=e(t,i,a)})),r}s(vF,"baseMap");var xF=vF;function bF(t,e){return(hb(t)?F$:xF)(t,fF(e))}s(bF,"map");var wF=bF;function kF(t,e){return F$(e,(function(e){return t[e]}))}s(kF,"baseValues");var TF=kF;function _F(t){return null==t?[]:TF(t,EP(t))}s(_F,"values");var EF=_F;function CF(t){return void 0===t}s(CF,"isUndefined");var SF=CF;function AF(t,e){var n={};return e=fF(e),DB(t,(function(t,r,i){Cx(n,r,e(t,r,i))})),n}s(AF,"mapValues");var LF=AF;function NF(t,e,n){for(var r=-1,i=t.length;++r<i;){var a=t[r],s=e(a);if(null!=s&&(void 0===o?s==s&&!A$(s):n(s,o)))var o=s,l=a}return l}s(NF,"baseExtremum");var IF=NF;function MF(t,e){return t>e}s(MF,"baseGt");var RF=MF;function DF(t){return t&&t.length?IF(t,mw,RF):void 0}s(DF,"max");var OF=DF;function PF(t,e,n,r){if(!jy(t))return t;for(var i=-1,a=(e=H$(e,t)).length,s=a-1,o=t;null!=o&&++i<a;){var l=X$(e[i]),c=n;if("__proto__"===l||"constructor"===l||"prototype"===l)return t;if(i!=s){var h=o[l];void 0===(c=r?r(h,l,o):void 0)&&(c=jy(h)?h:Qb(e[i+1])?[]:{})}Yb(o,l,c),o=o[l]}return t}s(PF,"baseSet");var BF=PF;function $F(t,e,n){for(var r=-1,i=e.length,a={};++r<i;){var s=e[r],o=Z$(t,s);n(o,s)&&BF(a,H$(s,t),o)}return a}s($F,"basePickBy");var FF=$F;function zF(t,e){return FF(t,e,(function(e,n){return aF(t,n)}))}s(zF,"basePick");var UF=zF,GF=Ny?Ny.isConcatSpreadable:void 0;function qF(t){return hb(t)||cb(t)||!!(GF&&t&&t[GF])}s(qF,"isFlattenable");var jF=qF;function YF(t,e,n,r,i){var a=-1,s=t.length;for(n||(n=jF),i||(i=[]);++a<s;){var o=t[a];e>0&&n(o)?e>1?YF(o,e-1,n,r,i):qP(i,o):r||(i[i.length]=o)}return i}s(YF,"baseFlatten");var WF=YF;function HF(t){return(null==t?0:t.length)?WF(t,1):[]}s(HF,"flatten");var VF=HF;function XF(t){return Cw(ww(t,void 0,VF),t+"")}s(XF,"flatRest");var KF=XF((function(t,e){return null==t?{}:UF(t,e)})),ZF=KF;function QF(t,e,n,r){var i=-1,a=null==t?0:t.length;for(r&&a&&(n=t[++i]);++i<a;)n=e(n,t[i],i,t);return n}s(QF,"arrayReduce");var JF=QF;function tz(t,e,n,r,i){return i(t,(function(t,i,a){n=r?(r=!1,t):e(n,t,i,a)})),n}s(tz,"baseReduce");var ez=tz;function nz(t,e,n){var r=hb(t)?JF:ez,i=arguments.length<3;return r(t,fF(e),n,i,PB)}s(nz,"reduce");var rz=nz;function iz(t,e,n,r){for(var i=t.length,a=n+(r?1:-1);r?a--:++a<i;)if(e(t[a],a,t))return a;return-1}s(iz,"baseFindIndex");var az=iz;function sz(t){return t!=t}s(sz,"baseIsNaN");var oz=sz;function lz(t,e,n){for(var r=n-1,i=t.length;++r<i;)if(t[r]===e)return r;return-1}s(lz,"strictIndexOf");var cz=lz;function hz(t,e,n){return e==e?cz(t,e,n):az(t,oz,n)}s(hz,"baseIndexOf");var uz=hz;function dz(t,e){return!!(null==t?0:t.length)&&uz(t,e,0)>-1}s(dz,"arrayIncludes");var pz=dz;function gz(t,e,n){for(var r=-1,i=null==t?0:t.length;++r<i;)if(n(e,t[r]))return!0;return!1}s(gz,"arrayIncludesWith");var fz=gz;function mz(){}s(mz,"noop");var yz=mz,vz=cA&&1/i$(new cA([,-0]))[1]==1/0?function(t){return new cA(t)}:yz;function xz(t,e,n){var r=-1,i=pz,a=t.length,s=!0,o=[],l=o;if(n)s=!1,i=fz;else if(a>=200){var c=e?null:vz(t);if(c)return i$(c);s=!1,i=QB,l=new VB}else l=e?[]:o;t:for(;++r<a;){var h=t[r],u=e?e(h):h;if(h=n||0!==h?h:0,s&&u==u){for(var d=l.length;d--;)if(l[d]===u)continue t;e&&l.push(u),o.push(h)}else i(l,u,n)||(l!==o&&l.push(u),o.push(h))}return o}s(xz,"baseUniq");var bz=xz,wz=Aw((function(t){return bz(WF(t,1,mb,!0))})),kz=/\s/;function Tz(t){for(var e=t.length;e--&&kz.test(t.charAt(e)););return e}s(Tz,"trimmedEndIndex");var _z=Tz,Ez=/^\s+/;function Cz(t){return t?t.slice(0,_z(t)+1).replace(Ez,""):t}s(Cz,"baseTrim");var Sz=Cz,Az=/^[-+]0x[0-9a-f]+$/i,Lz=/^0b[01]+$/i,Nz=/^0o[0-7]+$/i,Iz=parseInt;function Mz(t){if("number"==typeof t)return t;if(A$(t))return NaN;if(jy(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=jy(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=Sz(t);var n=Lz.test(t);return n||Nz.test(t)?Iz(t.slice(2),n?2:8):Az.test(t)?NaN:+t}s(Mz,"toNumber");var Rz=Mz;function Dz(t){return t?Infinity===(t=Rz(t))||-Infinity===t?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}s(Dz,"toFinite");var Oz=Dz;function Pz(t){var e=Oz(t),n=e%1;return e==e?n?e-n:e:0}s(Pz,"toInteger");var Bz=Pz,$z=Object.prototype.hasOwnProperty,Fz=Mw((function(t,e){if(Qx(e)||gb(e))Hb(e,EP(e),t);else for(var n in e)$z.call(e,n)&&Yb(t,n,e[n])})),zz=Fz;function Uz(t,e,n){var r=-1,i=t.length;e<0&&(e=-e>i?0:i+e),(n=n>i?i:n)<0&&(n+=i),i=e>n?0:n-e>>>0,e>>>=0;for(var a=Array(i);++r<i;)a[r]=t[r+e];return a}s(Uz,"baseSlice");var Gz=Uz,qz=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");function jz(t){return qz.test(t)}s(jz,"hasUnicode");var Yz=jz;function Wz(t){return _B(t,5)}s(Wz,"cloneDeep");var Hz=Wz;function Vz(t){for(var e=-1,n=null==t?0:t.length,r=0,i=[];++e<n;){var a=t[e];a&&(i[r++]=a)}return i}s(Vz,"compact");var Xz=Vz;function Kz(t,e,n,r){for(var i=-1,a=null==t?0:t.length;++i<a;){var s=t[i];e(r,s,n(s),t)}return r}s(Kz,"arrayAggregator");var Zz=Kz;function Qz(t,e,n,r){return PB(t,(function(t,i,a){e(r,t,n(t),a)})),r}s(Qz,"baseAggregator");var Jz=Qz;function tU(t,e){return function(n,r){var i=hb(n)?Zz:Jz,a=e?e():{};return i(n,t,fF(r),a)}}s(tU,"createAggregator");var eU=tU,nU=s((function(){return Ly.Date.now()}),"now");function rU(t,e,n,r){var i=-1,a=pz,s=!0,o=t.length,l=[],c=e.length;if(!o)return l;n&&(e=F$(e,Db(n))),r?(a=fz,s=!1):e.length>=200&&(a=QB,s=!1,e=new VB(e));t:for(;++i<o;){var h=t[i],u=null==n?h:n(h);if(h=r||0!==h?h:0,s&&u==u){for(var d=c;d--;)if(e[d]===u)continue t;l.push(h)}else a(e,u,r)||l.push(h)}return l}s(rU,"baseDifference");var iU=rU,aU=Aw((function(t,e){return mb(t)?iU(t,WF(e,1,mb,!0)):[]})),sU=aU;function oU(t,e,n){var r=null==t?0:t.length;return r?(e=n||void 0===e?1:Bz(e),Gz(t,e<0?0:e,r)):[]}s(oU,"drop");var lU=oU;function cU(t,e,n){var r=null==t?0:t.length;return r?(e=n||void 0===e?1:Bz(e),Gz(t,0,(e=r-e)<0?0:e)):[]}s(cU,"dropRight");var hU=cU;function uU(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(!e(t[n],n,t))return!1;return!0}s(uU,"arrayEvery");var dU=uU;function pU(t,e){var n=!0;return PB(t,(function(t,r,i){return n=!!e(t,r,i)})),n}s(pU,"baseEvery");var gU=pU;function fU(t,e,n){var r=hb(t)?dU:gU;return n&&Nw(t,e,n)&&(e=void 0),r(t,fF(e))}s(fU,"every");var mU=fU;function yU(t){return function(e,n,r){var i=Object(e);if(!gb(e)){var a=fF(n);e=EP(e),n=s((function(t){return a(i[t],t,i)}),"predicate")}var o=t(e,n,r);return o>-1?i[a?e[o]:o]:void 0}}s(yU,"createFind");var vU=yU,xU=Math.max;function bU(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=null==n?0:Bz(n);return i<0&&(i=xU(r+i,0)),az(t,fF(e),i)}s(bU,"findIndex");var wU=vU(bU);function kU(t){return t&&t.length?t[0]:void 0}s(kU,"head");var TU=kU;function _U(t,e){return WF(wF(t,e),1)}s(_U,"flatMap");var EU=_U;function CU(t,e){return null==t?t:Nx(t,$B(e),lw)}s(CU,"forIn");var SU=CU;function AU(t,e){return t&&DB(t,$B(e))}s(AU,"forOwn");var LU=AU,NU=Object.prototype.hasOwnProperty,IU=eU((function(t,e,n){NU.call(t,n)?t[n].push(e):Cx(t,n,[e])})),MU=IU,RU=Object.prototype.hasOwnProperty;function DU(t,e){return null!=t&&RU.call(t,e)}s(DU,"baseHas");var OU=DU;function PU(t,e){return null!=t&&rF(t,e,OU)}s(PU,"has");var BU=PU;function $U(t){return"string"==typeof t||!hb(t)&&nb(t)&&"[object String]"==Gy(t)}s($U,"isString");var FU=$U,zU=Math.max;function UU(t,e,n,r){t=gb(t)?t:EF(t),n=n&&!r?Bz(n):0;var i=t.length;return n<0&&(n=zU(i+n,0)),FU(t)?n<=i&&t.indexOf(e,n)>-1:!!i&&uz(t,e,n)>-1}s(UU,"includes");var GU=UU,qU=Math.max;function jU(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=null==n?0:Bz(n);return i<0&&(i=qU(r+i,0)),uz(t,e,i)}s(jU,"indexOf");var YU=jU;function WU(t){return nb(t)&&"[object RegExp]"==Gy(t)}s(WU,"baseIsRegExp");var HU=WU,VU=$b&&$b.isRegExp,XU=VU?Db(VU):HU;function KU(t,e){return t<e}s(KU,"baseLt");var ZU=KU;function QU(t){return t&&t.length?IF(t,mw,ZU):void 0}s(QU,"min");var JU=QU;function tG(t,e){return t&&t.length?IF(t,fF(e),ZU):void 0}s(tG,"minBy");var eG=tG;function nG(t){if("function"!=typeof t)throw new TypeError("Expected a function");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)}}s(nG,"negate");var rG=nG;function iG(t,e){if(null==t)return{};var n=F$(JP(t),(function(t){return[t]}));return e=fF(e),FF(t,n,(function(t,n){return e(t,n[0])}))}s(iG,"pickBy");var aG=iG;function sG(t,e){var n=t.length;for(t.sort(e);n--;)t[n]=t[n].value;return t}s(sG,"baseSortBy");var oG=sG;function lG(t,e){if(t!==e){var n=void 0!==t,r=null===t,i=t==t,a=A$(t),s=void 0!==e,o=null===e,l=e==e,c=A$(e);if(!o&&!c&&!a&&t>e||a&&s&&l&&!o&&!c||r&&s&&l||!n&&l||!i)return 1;if(!r&&!a&&!c&&t<e||c&&n&&i&&!r&&!a||o&&n&&i||!s&&i||!l)return-1}return 0}s(lG,"compareAscending");var cG=lG;function hG(t,e,n){for(var r=-1,i=t.criteria,a=e.criteria,s=i.length,o=n.length;++r<s;){var l=cG(i[r],a[r]);if(l)return r>=o?l:l*("desc"==n[r]?-1:1)}return t.index-e.index}s(hG,"compareMultiple");var uG=hG;function dG(t,e,n){e=e.length?F$(e,(function(t){return hb(t)?function(e){return Z$(e,1===t.length?t[0]:t)}:t})):[mw];var r=-1;e=F$(e,Db(fF));var i=xF(t,(function(t,n,i){return{criteria:F$(e,(function(e){return e(t)})),index:++r,value:t}}));return oG(i,(function(t,e){return uG(t,e,n)}))}s(dG,"baseOrderBy");var pG=dG,gG=cF("length"),fG="[\\ud800-\\udfff]",mG="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",yG="\\ud83c[\\udffb-\\udfff]",vG="[^\\ud800-\\udfff]",xG="(?:\\ud83c[\\udde6-\\uddff]){2}",bG="[\\ud800-\\udbff][\\udc00-\\udfff]",wG="(?:"+mG+"|"+yG+")"+"?",kG="[\\ufe0e\\ufe0f]?"+wG+("(?:\\u200d(?:"+[vG,xG,bG].join("|")+")[\\ufe0e\\ufe0f]?"+wG+")*"),TG="(?:"+[vG+mG+"?",mG,xG,bG,fG].join("|")+")",_G=RegExp(yG+"(?="+yG+")|"+TG+kG,"g");function EG(t){for(var e=_G.lastIndex=0;_G.test(t);)++e;return e}s(EG,"unicodeSize");var CG=EG;function SG(t){return Yz(t)?CG(t):gG(t)}s(SG,"stringSize");var AG=SG,LG=Math.ceil,NG=Math.max;function IG(t,e,n,r){for(var i=-1,a=NG(LG((e-t)/(n||1)),0),s=Array(a);a--;)s[r?a:++i]=t,t+=n;return s}s(IG,"baseRange");var MG=IG;function RG(t){return function(e,n,r){return r&&"number"!=typeof r&&Nw(e,n,r)&&(n=r=void 0),e=Oz(e),void 0===n?(n=e,e=0):n=Oz(n),r=void 0===r?e<n?1:-1:Oz(r),MG(e,n,r,t)}}s(RG,"createRange");var DG=RG();function OG(t,e){return(hb(t)?RP:GB)(t,rG(fF(e)))}s(OG,"reject");var PG=OG;function BG(t){if(null==t)return 0;if(gb(t))return FU(t)?AG(t):t.length;var e=yA(t);return"[object Map]"==e||"[object Set]"==e?t.size:sA(t).length}s(BG,"size");var $G=BG;function FG(t,e){var n;return PB(t,(function(t,r,i){return!(n=e(t,r,i))})),!!n}s(FG,"baseSome");var zG=FG;function UG(t,e,n){var r=hb(t)?KB:zG;return n&&Nw(t,e,n)&&(e=void 0),r(t,fF(e))}s(UG,"some");var GG=UG,qG=Aw((function(t,e){if(null==t)return[];var n=e.length;return n>1&&Nw(t,e[0],e[1])?e=[]:n>2&&Nw(e[0],e[1],e[2])&&(e=[e[0]]),pG(t,WF(e,1),[])})),jG=qG;function YG(t){return t&&t.length?bz(t):[]}s(YG,"uniq");var WG=YG;function HG(t,e){return t&&t.length?bz(t,fF(e)):[]}s(HG,"uniqBy");var VG=HG,XG=0;function KG(t){var e=++XG;return Y$(t)+e}s(KG,"uniqueId");var ZG=KG;function QG(t,e,n){for(var r=-1,i=t.length,a=e.length,s={};++r<i;){var o=r<a?e[r]:void 0;n(s,t[r],o)}return s}s(QG,"baseZipObject");var JG=QG;function tq(t,e){return JG(t||[],e||[],Yb)}s(tq,"zipObject");var eq=tq,nq=class{static{s(this,"Graph")}constructor(t={}){this._isDirected=!Object.prototype.hasOwnProperty.call(t,"directed")||t.directed,this._isMultigraph=!!Object.prototype.hasOwnProperty.call(t,"multigraph")&&t.multigraph,this._isCompound=!!Object.prototype.hasOwnProperty.call(t,"compound")&&t.compound,this._label=void 0,this._defaultNodeLabelFn=ux(void 0),this._defaultEdgeLabelFn=ux(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children["\0"]={}),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(t){return this._label=t,this}graph(){return this._label}setDefaultNodeLabel(t){return Hy(t)||(t=ux(t)),this._defaultNodeLabelFn=t,this}nodeCount(){return this._nodeCount}nodes(){return EP(this._nodes)}sources(){var t=this;return yF(this.nodes(),(function(e){return bA(t._in[e])}))}sinks(){var t=this;return yF(this.nodes(),(function(e){return bA(t._out[e])}))}setNodes(t,e){var n=arguments,r=this;return zB(t,(function(t){n.length>1?r.setNode(t,e):r.setNode(t)})),this}setNode(t,e){return Object.prototype.hasOwnProperty.call(this._nodes,t)?(arguments.length>1&&(this._nodes[t]=e),this):(this._nodes[t]=arguments.length>1?e:this._defaultNodeLabelFn(t),this._isCompound&&(this._parent[t]="\0",this._children[t]={},this._children["\0"][t]=!0),this._in[t]={},this._preds[t]={},this._out[t]={},this._sucs[t]={},++this._nodeCount,this)}node(t){return this._nodes[t]}hasNode(t){return Object.prototype.hasOwnProperty.call(this._nodes,t)}removeNode(t){if(Object.prototype.hasOwnProperty.call(this._nodes,t)){var e=s((t=>this.removeEdge(this._edgeObjs[t])),"removeEdge");delete this._nodes[t],this._isCompound&&(this._removeFromParentsChildList(t),delete this._parent[t],zB(this.children(t),(t=>{this.setParent(t)})),delete this._children[t]),zB(EP(this._in[t]),e),delete this._in[t],delete this._preds[t],zB(EP(this._out[t]),e),delete this._out[t],delete this._sucs[t],--this._nodeCount}return this}setParent(t,e){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(SF(e))e="\0";else{for(var n=e+="";!SF(n);n=this.parent(n))if(n===t)throw new Error("Setting "+e+" as parent of "+t+" would create a cycle");this.setNode(e)}return this.setNode(t),this._removeFromParentsChildList(t),this._parent[t]=e,this._children[e][t]=!0,this}_removeFromParentsChildList(t){delete this._children[this._parent[t]][t]}parent(t){if(this._isCompound){var e=this._parent[t];if("\0"!==e)return e}}children(t){if(SF(t)&&(t="\0"),this._isCompound){var e=this._children[t];if(e)return EP(e)}else{if("\0"===t)return this.nodes();if(this.hasNode(t))return[]}}predecessors(t){var e=this._preds[t];if(e)return EP(e)}successors(t){var e=this._sucs[t];if(e)return EP(e)}neighbors(t){var e=this.predecessors(t);if(e)return wz(e,this.successors(t))}isLeaf(t){return 0===(this.isDirected()?this.successors(t):this.neighbors(t)).length}filterNodes(t){var e=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});e.setGraph(this.graph());var n=this;zB(this._nodes,(function(n,r){t(r)&&e.setNode(r,n)})),zB(this._edgeObjs,(function(t){e.hasNode(t.v)&&e.hasNode(t.w)&&e.setEdge(t,n.edge(t))}));var r={};function i(t){var a=n.parent(t);return void 0===a||e.hasNode(a)?(r[t]=a,a):a in r?r[a]:i(a)}return s(i,"findParent"),this._isCompound&&zB(e.nodes(),(function(t){e.setParent(t,i(t))})),e}setDefaultEdgeLabel(t){return Hy(t)||(t=ux(t)),this._defaultEdgeLabelFn=t,this}edgeCount(){return this._edgeCount}edges(){return EF(this._edgeObjs)}setPath(t,e){var n=this,r=arguments;return rz(t,(function(t,i){return r.length>1?n.setEdge(t,i,e):n.setEdge(t,i),i})),this}setEdge(){var t,e,n,r,i=!1,a=arguments[0];"object"==typeof a&&null!==a&&"v"in a?(t=a.v,e=a.w,n=a.name,2===arguments.length&&(r=arguments[1],i=!0)):(t=a,e=arguments[1],n=arguments[3],arguments.length>2&&(r=arguments[2],i=!0)),t=""+t,e=""+e,SF(n)||(n=""+n);var s=aq(this._isDirected,t,e,n);if(Object.prototype.hasOwnProperty.call(this._edgeLabels,s))return i&&(this._edgeLabels[s]=r),this;if(!SF(n)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(t),this.setNode(e),this._edgeLabels[s]=i?r:this._defaultEdgeLabelFn(t,e,n);var o=sq(this._isDirected,t,e,n);return t=o.v,e=o.w,Object.freeze(o),this._edgeObjs[s]=o,rq(this._preds[e],t),rq(this._sucs[t],e),this._in[e][s]=o,this._out[t][s]=o,this._edgeCount++,this}edge(t,e,n){var r=1===arguments.length?oq(this._isDirected,arguments[0]):aq(this._isDirected,t,e,n);return this._edgeLabels[r]}hasEdge(t,e,n){var r=1===arguments.length?oq(this._isDirected,arguments[0]):aq(this._isDirected,t,e,n);return Object.prototype.hasOwnProperty.call(this._edgeLabels,r)}removeEdge(t,e,n){var r=1===arguments.length?oq(this._isDirected,arguments[0]):aq(this._isDirected,t,e,n),i=this._edgeObjs[r];return i&&(t=i.v,e=i.w,delete this._edgeLabels[r],delete this._edgeObjs[r],iq(this._preds[e],t),iq(this._sucs[t],e),delete this._in[e][r],delete this._out[t][r],this._edgeCount--),this}inEdges(t,e){var n=this._in[t];if(n){var r=EF(n);return e?yF(r,(function(t){return t.v===e})):r}}outEdges(t,e){var n=this._out[t];if(n){var r=EF(n);return e?yF(r,(function(t){return t.w===e})):r}}nodeEdges(t,e){var n=this.inEdges(t,e);if(n)return n.concat(this.outEdges(t,e))}};
/*! Bundled license information:
lodash-es/lodash.js:
(**
* @license
* Lodash (Custom Build) <https://lodash.com/>
* Build: `lodash modularize exports="es" -o ./`
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
* Released under MIT license <https://lodash.com/license>
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
*)
*/function rq(t,e){t[e]?t[e]++:t[e]=1}function iq(t,e){--t[e]||delete t[e]}function aq(t,e,n,r){var i=""+e,a=""+n;if(!t&&i>a){var s=i;i=a,a=s}return i+""+a+""+(SF(r)?"\0":r)}function sq(t,e,n,r){var i=""+e,a=""+n;if(!t&&i>a){var s=i;i=a,a=s}var o={v:i,w:a};return r&&(o.name=r),o}function oq(t,e){return aq(t,e.v,e.w,e.name)}function lq(t,e,n,r){var i;do{i=ZG(r)}while(t.hasNode(i));return n.dummy=e,t.setNode(i,n),i}function cq(t){var e=(new nq).setGraph(t.graph());return zB(t.nodes(),(function(n){e.setNode(n,t.node(n))})),zB(t.edges(),(function(n){var r=e.edge(n.v,n.w)||{weight:0,minlen:1},i=t.edge(n);e.setEdge(n.v,n.w,{weight:r.weight+i.weight,minlen:Math.max(r.minlen,i.minlen)})})),e}function hq(t){var e=new nq({multigraph:t.isMultigraph()}).setGraph(t.graph());return zB(t.nodes(),(function(n){t.children(n).length||e.setNode(n,t.node(n))})),zB(t.edges(),(function(n){e.setEdge(n,t.edge(n))})),e}function uq(t,e){var n,r,i=t.x,a=t.y,s=e.x-i,o=e.y-a,l=t.width/2,c=t.height/2;if(!s&&!o)throw new Error("Not possible to find intersection inside of the rectangle");return Math.abs(o)*l>Math.abs(s)*c?(o<0&&(c=-c),n=c*s/o,r=c):(s<0&&(l=-l),n=l,r=l*o/s),{x:i+n,y:a+r}}function dq(t){var e=wF(DG(mq(t)+1),(function(){return[]}));return zB(t.nodes(),(function(n){var r=t.node(n),i=r.rank;SF(i)||(e[i][r.order]=n)})),e}function pq(t){var e=JU(wF(t.nodes(),(function(e){return t.node(e).rank})));zB(t.nodes(),(function(n){var r=t.node(n);BU(r,"rank")&&(r.rank-=e)}))}function gq(t){var e=JU(wF(t.nodes(),(function(e){return t.node(e).rank}))),n=[];zB(t.nodes(),(function(r){var i=t.node(r).rank-e;n[i]||(n[i]=[]),n[i].push(r)}));var r=0,i=t.graph().nodeRankFactor;zB(n,(function(e,n){SF(e)&&n%i!=0?--r:r&&zB(e,(function(e){t.node(e).rank+=r}))}))}function fq(t,e,n,r){var i={width:0,height:0};return arguments.length>=4&&(i.rank=n,i.order=r),lq(t,"border",i,e)}function mq(t){return OF(wF(t.nodes(),(function(e){var n=t.node(e).rank;if(!SF(n))return n})))}function yq(t,e){var n={lhs:[],rhs:[]};return zB(t,(function(t){e(t)?n.lhs.push(t):n.rhs.push(t)})),n}function vq(t,e){var n=nU();try{return e()}finally{console.log(t+" time: "+(nU()-n)+"ms")}}function xq(t,e){return e()}function bq(t){function e(n){var r=t.children(n),i=t.node(n);if(r.length&&zB(r,e),Object.prototype.hasOwnProperty.call(i,"minRank")){i.borderLeft=[],i.borderRight=[];for(var a=i.minRank,s=i.maxRank+1;a<s;++a)wq(t,"borderLeft","_bl",n,i,a),wq(t,"borderRight","_br",n,i,a)}}s(e,"dfs"),zB(t.children(),e)}function wq(t,e,n,r,i,a){var s={width:0,height:0,rank:a,borderType:e},o=i[e][a-1],l=lq(t,"border",s,n);i[e][a]=l,t.setParent(l,r),o&&t.setEdge(o,l,{weight:1})}function kq(t){var e=t.graph().rankdir.toLowerCase();"lr"!==e&&"rl"!==e||_q(t)}function Tq(t){var e=t.graph().rankdir.toLowerCase();"bt"!==e&&"rl"!==e||Cq(t),"lr"!==e&&"rl"!==e||(Aq(t),_q(t))}function _q(t){zB(t.nodes(),(function(e){Eq(t.node(e))})),zB(t.edges(),(function(e){Eq(t.edge(e))}))}function Eq(t){var e=t.width;t.width=t.height,t.height=e}function Cq(t){zB(t.nodes(),(function(e){Sq(t.node(e))})),zB(t.edges(),(function(e){var n=t.edge(e);zB(n.points,Sq),Object.prototype.hasOwnProperty.call(n,"y")&&Sq(n)}))}function Sq(t){t.y=-t.y}function Aq(t){zB(t.nodes(),(function(e){Lq(t.node(e))})),zB(t.edges(),(function(e){var n=t.edge(e);zB(n.points,Lq),Object.prototype.hasOwnProperty.call(n,"x")&&Lq(n)}))}function Lq(t){var e=t.x;t.x=t.y,t.y=e}nq.prototype._nodeCount=0,nq.prototype._edgeCount=0,s(rq,"incrementOrInitEntry"),s(iq,"decrementOrRemoveEntry"),s(aq,"edgeArgsToId"),s(sq,"edgeArgsToObj"),s(oq,"edgeObjToId"),s(lq,"addDummyNode"),s(cq,"simplify"),s(hq,"asNonCompoundGraph"),s(uq,"intersectRect"),s(dq,"buildLayerMatrix"),s(pq,"normalizeRanks"),s(gq,"removeEmptyRanks"),s(fq,"addBorderNode"),s(mq,"maxRank"),s(yq,"partition"),s(vq,"time"),s(xq,"notime"),s(bq,"addBorderSegments"),s(wq,"addBorderNode"),s(kq,"adjust"),s(Tq,"undo"),s(_q,"swapWidthHeight"),s(Eq,"swapWidthHeightOne"),s(Cq,"reverseY"),s(Sq,"reverseYOne"),s(Aq,"swapXY"),s(Lq,"swapXYOne");var Nq=class{static{s(this,"List")}constructor(){var t={};t._next=t._prev=t,this._sentinel=t}dequeue(){var t=this._sentinel,e=t._prev;if(e!==t)return Iq(e),e}enqueue(t){var e=this._sentinel;t._prev&&t._next&&Iq(t),t._next=e._next,e._next._prev=t,e._next=t,t._prev=e}toString(){for(var t=[],e=this._sentinel,n=e._prev;n!==e;)t.push(JSON.stringify(n,Mq)),n=n._prev;return"["+t.join(", ")+"]"}};function Iq(t){t._prev._next=t._next,t._next._prev=t._prev,delete t._next,delete t._prev}function Mq(t,e){if("_next"!==t&&"_prev"!==t)return e}s(Iq,"unlink"),s(Mq,"filterOutLinks");var Rq=ux(1);function Dq(t,e){if(t.nodeCount()<=1)return[];var n=Bq(t,e||Rq),r=Oq(n.graph,n.buckets,n.zeroIdx);return VF(wF(r,(function(e){return t.outEdges(e.v,e.w)})))}function Oq(t,e,n){for(var r,i=[],a=e[e.length-1],s=e[0];t.nodeCount();){for(;r=s.dequeue();)Pq(t,e,n,r);for(;r=a.dequeue();)Pq(t,e,n,r);if(t.nodeCount())for(var o=e.length-2;o>0;--o)if(r=e[o].dequeue()){i=i.concat(Pq(t,e,n,r,!0));break}}return i}function Pq(t,e,n,r,i){var a=i?[]:void 0;return zB(t.inEdges(r.v),(function(r){var s=t.edge(r),o=t.node(r.v);i&&a.push({v:r.v,w:r.w}),o.out-=s,$q(e,n,o)})),zB(t.outEdges(r.v),(function(r){var i=t.edge(r),a=r.w,s=t.node(a);s.in-=i,$q(e,n,s)})),t.removeNode(r.v),a}function Bq(t,e){var n=new nq,r=0,i=0;zB(t.nodes(),(function(t){n.setNode(t,{v:t,in:0,out:0})})),zB(t.edges(),(function(t){var a=n.edge(t.v,t.w)||0,s=e(t),o=a+s;n.setEdge(t.v,t.w,o),i=Math.max(i,n.node(t.v).out+=s),r=Math.max(r,n.node(t.w).in+=s)}));var a=DG(i+r+3).map((function(){return new Nq})),s=r+1;return zB(n.nodes(),(function(t){$q(a,s,n.node(t))})),{graph:n,buckets:a,zeroIdx:s}}function $q(t,e,n){n.out?n.in?t[n.out-n.in+e].enqueue(n):t[t.length-1].enqueue(n):t[0].enqueue(n)}function Fq(t){var e="greedy"===t.graph().acyclicer?Dq(t,n(t)):zq(t);function n(t){return function(e){return t.edge(e).weight}}zB(e,(function(e){var n=t.edge(e);t.removeEdge(e),n.forwardName=e.name,n.reversed=!0,t.setEdge(e.w,e.v,n,ZG("rev"))})),s(n,"weightFn")}function zq(t){var e=[],n={},r={};function i(a){Object.prototype.hasOwnProperty.call(r,a)||(r[a]=!0,n[a]=!0,zB(t.outEdges(a),(function(t){Object.prototype.hasOwnProperty.call(n,t.w)?e.push(t):i(t.w)})),delete n[a])}return s(i,"dfs"),zB(t.nodes(),i),e}function Uq(t){zB(t.edges(),(function(e){var n=t.edge(e);if(n.reversed){t.removeEdge(e);var r=n.forwardName;delete n.reversed,delete n.forwardName,t.setEdge(e.w,e.v,n,r)}}))}function Gq(t){t.graph().dummyChains=[],zB(t.edges(),(function(e){qq(t,e)}))}function qq(t,e){var n=e.v,r=t.node(n).rank,i=e.w,a=t.node(i).rank,s=e.name,o=t.edge(e),l=o.labelRank;if(a!==r+1){t.removeEdge(e);var c,h,u=void 0;for(h=0,++r;r<a;++h,++r)o.points=[],c=lq(t,"edge",u={width:0,height:0,edgeLabel:o,edgeObj:e,rank:r},"_d"),r===l&&(u.width=o.width,u.height=o.height,u.dummy="edge-label",u.labelpos=o.labelpos),t.setEdge(n,c,{weight:o.weight},s),0===h&&t.graph().dummyChains.push(c),n=c;t.setEdge(n,i,{weight:o.weight},s)}}function jq(t){zB(t.graph().dummyChains,(function(e){var n,r=t.node(e),i=r.edgeLabel;for(t.setEdge(r.edgeObj,i);r.dummy;)n=t.successors(e)[0],t.removeNode(e),i.points.push({x:r.x,y:r.y}),"edge-label"===r.dummy&&(i.x=r.x,i.y=r.y,i.width=r.width,i.height=r.height),e=n,r=t.node(e)}))}function Yq(t){var e={};function n(r){var i=t.node(r);if(Object.prototype.hasOwnProperty.call(e,r))return i.rank;e[r]=!0;var a=JU(wF(t.outEdges(r),(function(e){return n(e.w)-t.edge(e).minlen})));return a!==Number.POSITIVE_INFINITY&&null!=a||(a=0),i.rank=a}s(n,"dfs"),zB(t.sources(),n)}function Wq(t,e){return t.node(e.w).rank-t.node(e.v).rank-t.edge(e).minlen}function Hq(t){var e,n,r=new nq({directed:!1}),i=t.nodes()[0],a=t.nodeCount();for(r.setNode(i,{});Vq(r,t)<a;)e=Xq(r,t),n=r.hasNode(e.v)?Wq(t,e):-Wq(t,e),Kq(r,t,n);return r}function Vq(t,e){function n(r){zB(e.nodeEdges(r),(function(i){var a=i.v,s=r===a?i.w:a;t.hasNode(s)||Wq(e,i)||(t.setNode(s,{}),t.setEdge(r,s,{}),n(s))}))}return s(n,"dfs"),zB(t.nodes(),n),t.nodeCount()}function Xq(t,e){return eG(e.edges(),(function(n){if(t.hasNode(n.v)!==t.hasNode(n.w))return Wq(e,n)}))}function Kq(t,e,n){zB(t.nodes(),(function(t){e.node(t).rank+=n}))}function Zq(t){var e={},n={},r=[];function i(a){if(Object.prototype.hasOwnProperty.call(n,a))throw new Qq;Object.prototype.hasOwnProperty.call(e,a)||(n[a]=!0,e[a]=!0,zB(t.predecessors(a),i),delete n[a],r.push(a))}if(s(i,"visit"),zB(t.sinks(),i),$G(e)!==t.nodeCount())throw new Qq;return r}function Qq(){}function Jq(t,e,n){hb(e)||(e=[e]);var r=(t.isDirected()?t.successors:t.neighbors).bind(t),i=[],a={};return zB(e,(function(e){if(!t.hasNode(e))throw new Error("Graph does not have node: "+e);tj(t,e,"post"===n,a,r,i)})),i}function tj(t,e,n,r,i,a){Object.prototype.hasOwnProperty.call(r,e)||(r[e]=!0,n||a.push(e),zB(i(e),(function(e){tj(t,e,n,r,i,a)})),n&&a.push(e))}function ej(t,e){return Jq(t,e,"post")}function nj(t,e){return Jq(t,e,"pre")}function rj(t){Yq(t=cq(t));var e,n=Hq(t);for(oj(n),ij(n,t);e=cj(n);)uj(n,t,e,hj(n,t,e))}function ij(t,e){var n=ej(t,t.nodes());n=n.slice(0,n.length-1),zB(n,(function(n){aj(t,e,n)}))}function aj(t,e,n){var r=t.node(n).parent;t.edge(n,r).cutvalue=sj(t,e,n)}function sj(t,e,n){var r=t.node(n).parent,i=!0,a=e.edge(n,r),s=0;return a||(i=!1,a=e.edge(r,n)),s=a.weight,zB(e.nodeEdges(n),(function(a){var o=a.v===n,l=o?a.w:a.v;if(l!==r){var c=o===i,h=e.edge(a).weight;if(s+=c?h:-h,pj(t,n,l)){var u=t.edge(n,l).cutvalue;s+=c?-u:u}}})),s}function oj(t,e){arguments.length<2&&(e=t.nodes()[0]),lj(t,{},1,e)}function lj(t,e,n,r,i){var a=n,s=t.node(r);return e[r]=!0,zB(t.neighbors(r),(function(i){Object.prototype.hasOwnProperty.call(e,i)||(n=lj(t,e,n,i,r))})),s.low=a,s.lim=n++,i?s.parent=i:delete s.parent,n}function cj(t){return wU(t.edges(),(function(e){return t.edge(e).cutvalue<0}))}function hj(t,e,n){var r=n.v,i=n.w;e.hasEdge(r,i)||(r=n.w,i=n.v);var a=t.node(r),s=t.node(i),o=a,l=!1;a.lim>s.lim&&(o=s,l=!0);var c=yF(e.edges(),(function(e){return l===gj(t,t.node(e.v),o)&&l!==gj(t,t.node(e.w),o)}));return eG(c,(function(t){return Wq(e,t)}))}function uj(t,e,n,r){var i=n.v,a=n.w;t.removeEdge(i,a),t.setEdge(r.v,r.w,{}),oj(t),ij(t,e),dj(t,e)}function dj(t,e){var n=wU(t.nodes(),(function(t){return!e.node(t).parent})),r=nj(t,n);r=r.slice(1),zB(r,(function(n){var r=t.node(n).parent,i=e.edge(n,r),a=!1;i||(i=e.edge(r,n),a=!0),e.node(n).rank=e.node(r).rank+(a?i.minlen:-i.minlen)}))}function pj(t,e,n){return t.hasEdge(e,n)}function gj(t,e,n){return n.low<=e.lim&&e.lim<=n.lim}function fj(t){switch(t.graph().ranker){case"network-simplex":default:vj(t);break;case"tight-tree":yj(t);break;case"longest-path":mj(t)}}s(Dq,"greedyFAS"),s(Oq,"doGreedyFAS"),s(Pq,"removeNode"),s(Bq,"buildState"),s($q,"assignBucket"),s(Fq,"run"),s(zq,"dfsFAS"),s(Uq,"undo"),s(Gq,"run"),s(qq,"normalizeEdge"),s(jq,"undo"),s(Yq,"longestPath"),s(Wq,"slack"),s(Hq,"feasibleTree"),s(Vq,"tightTree"),s(Xq,"findMinSlackEdge"),s(Kq,"shiftRanks"),Zq.CycleException=Qq,s(Zq,"topsort"),s(Qq,"CycleException"),Qq.prototype=new Error,s(Jq,"dfs"),s(tj,"doDfs"),s(ej,"postorder"),s(nj,"preorder"),rj.initLowLimValues=oj,rj.initCutValues=ij,rj.calcCutValue=sj,rj.leaveEdge=cj,rj.enterEdge=hj,rj.exchangeEdges=uj,s(rj,"networkSimplex"),s(ij,"initCutValues"),s(aj,"assignCutValue"),s(sj,"calcCutValue"),s(oj,"initLowLimValues"),s(lj,"dfsAssignLowLim"),s(cj,"leaveEdge"),s(hj,"enterEdge"),s(uj,"exchangeEdges"),s(dj,"updateRanks"),s(pj,"isTreeEdge"),s(gj,"isDescendant"),s(fj,"rank");var mj=Yq;function yj(t){Yq(t),Hq(t)}function vj(t){rj(t)}function xj(t){var e=lq(t,"root",{},"_root"),n=wj(t),r=OF(EF(n))-1,i=2*r+1;t.graph().nestingRoot=e,zB(t.edges(),(function(e){t.edge(e).minlen*=i}));var a=kj(t)+1;zB(t.children(),(function(s){bj(t,e,i,a,r,n,s)})),t.graph().nodeRankFactor=i}function bj(t,e,n,r,i,a,s){var o=t.children(s);if(o.length){var l=fq(t,"_bt"),c=fq(t,"_bb"),h=t.node(s);t.setParent(l,s),h.borderTop=l,t.setParent(c,s),h.borderBottom=c,zB(o,(function(o){bj(t,e,n,r,i,a,o);var h=t.node(o),u=h.borderTop?h.borderTop:o,d=h.borderBottom?h.borderBottom:o,p=h.borderTop?r:2*r,g=u!==d?1:i-a[s]+1;t.setEdge(l,u,{weight:p,minlen:g,nestingEdge:!0}),t.setEdge(d,c,{weight:p,minlen:g,nestingEdge:!0})})),t.parent(s)||t.setEdge(e,l,{weight:0,minlen:i+a[s]})}else s!==e&&t.setEdge(e,s,{weight:0,minlen:n})}function wj(t){var e={};function n(r,i){var a=t.children(r);a&&a.length&&zB(a,(function(t){n(t,i+1)})),e[r]=i}return s(n,"dfs"),zB(t.children(),(function(t){n(t,1)})),e}function kj(t){return rz(t.edges(),(function(e,n){return e+t.edge(n).weight}),0)}function Tj(t){var e=t.graph();t.removeNode(e.nestingRoot),delete e.nestingRoot,zB(t.edges(),(function(e){t.edge(e).nestingEdge&&t.removeEdge(e)}))}function _j(t,e,n){var r,i={};zB(n,(function(n){for(var a,s,o=t.parent(n);o;){if((a=t.parent(o))?(s=i[a],i[a]=o):(s=r,r=o),s&&s!==o)return void e.setEdge(s,o);o=a}}))}function Ej(t,e,n){var r=Cj(t),i=new nq({compound:!0}).setGraph({root:r}).setDefaultNodeLabel((function(e){return t.node(e)}));return zB(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||r),zB(t[n](a),(function(e){var n=e.v===a?e.w:e.v,r=i.edge(n,a),s=SF(r)?0:r.weight;i.setEdge(n,a,{weight:t.edge(e).weight+s})})),Object.prototype.hasOwnProperty.call(s,"minRank")&&i.setNode(a,{borderLeft:s.borderLeft[e],borderRight:s.borderRight[e]}))})),i}function Cj(t){for(var e;t.hasNode(e=ZG("_root")););return e}function Sj(t,e){for(var n=0,r=1;r<e.length;++r)n+=Aj(t,e[r-1],e[r]);return n}function Aj(t,e,n){for(var r=eq(n,wF(n,(function(t,e){return e}))),i=VF(wF(e,(function(e){return jG(wF(t.outEdges(e),(function(e){return{pos:r[e.w],weight:t.edge(e).weight}})),"pos")}))),a=1;a<n.length;)a<<=1;var s=2*a-1;a-=1;var o=wF(new Array(s),(function(){return 0})),l=0;return zB(i.forEach((function(t){var e=t.pos+a;o[e]+=t.weight;for(var n=0;e>0;)e%2&&(n+=o[e+1]),o[e=e-1>>1]+=t.weight;l+=t.weight*n}))),l}function Lj(t){var e={},n=yF(t.nodes(),(function(e){return!t.children(e).length})),r=OF(wF(n,(function(e){return t.node(e).rank}))),i=wF(DG(r+1),(function(){return[]}));function a(n){if(!BU(e,n)){e[n]=!0;var r=t.node(n);i[r.rank].push(n),zB(t.successors(n),a)}}s(a,"dfs");var o=jG(n,(function(e){return t.node(e).rank}));return zB(o,a),i}function Nj(t,e){return wF(e,(function(e){var n=t.inEdges(e);if(n.length){var r=rz(n,(function(e,n){var r=t.edge(n),i=t.node(n.v);return{sum:e.sum+r.weight*i.order,weight:e.weight+r.weight}}),{sum:0,weight:0});return{v:e,barycenter:r.sum/r.weight,weight:r.weight}}return{v:e}}))}function Ij(t,e){var n={};return zB(t,(function(t,e){var r=n[t.v]={indegree:0,in:[],out:[],vs:[t.v],i:e};SF(t.barycenter)||(r.barycenter=t.barycenter,r.weight=t.weight)})),zB(e.edges(),(function(t){var e=n[t.v],r=n[t.w];SF(e)||SF(r)||(r.indegree++,e.out.push(n[t.w]))})),Mj(yF(n,(function(t){return!t.indegree})))}function Mj(t){var e=[];function n(t){return function(e){e.merged||(SF(e.barycenter)||SF(t.barycenter)||e.barycenter>=t.barycenter)&&Rj(t,e)}}function r(e){return function(n){n.in.push(e),0==--n.indegree&&t.push(n)}}for(s(n,"handleIn"),s(r,"handleOut");t.length;){var i=t.pop();e.push(i),zB(i.in.reverse(),n(i)),zB(i.out,r(i))}return wF(yF(e,(function(t){return!t.merged})),(function(t){return ZF(t,["vs","i","barycenter","weight"])}))}function Rj(t,e){var n=0,r=0;t.weight&&(n+=t.barycenter*t.weight,r+=t.weight),e.weight&&(n+=e.barycenter*e.weight,r+=e.weight),t.vs=e.vs.concat(t.vs),t.barycenter=n/r,t.weight=r,t.i=Math.min(e.i,t.i),e.merged=!0}function Dj(t,e){var n=yq(t,(function(t){return Object.prototype.hasOwnProperty.call(t,"barycenter")})),r=n.lhs,i=jG(n.rhs,(function(t){return-t.i})),a=[],s=0,o=0,l=0;r.sort(Pj(!!e)),l=Oj(a,i,l),zB(r,(function(t){l+=t.vs.length,a.push(t.vs),s+=t.barycenter*t.weight,o+=t.weight,l=Oj(a,i,l)}));var c={vs:VF(a)};return o&&(c.barycenter=s/o,c.weight=o),c}function Oj(t,e,n){for(var r;e.length&&(r=MB(e)).i<=n;)e.pop(),t.push(r.vs),n++;return n}function Pj(t){return function(e,n){return e.barycenter<n.barycenter?-1:e.barycenter>n.barycenter?1:t?n.i-e.i:e.i-n.i}}function Bj(t,e,n,r){var i=t.children(e),a=t.node(e),s=a?a.borderLeft:void 0,o=a?a.borderRight:void 0,l={};s&&(i=yF(i,(function(t){return t!==s&&t!==o})));var c=Nj(t,i);zB(c,(function(e){if(t.children(e.v).length){var i=Bj(t,e.v,n,r);l[e.v]=i,Object.prototype.hasOwnProperty.call(i,"barycenter")&&Fj(e,i)}}));var h=Ij(c,n);$j(h,l);var u=Dj(h,r);if(s&&(u.vs=VF([s,u.vs,o]),t.predecessors(s).length)){var d=t.node(t.predecessors(s)[0]),p=t.node(t.predecessors(o)[0]);Object.prototype.hasOwnProperty.call(u,"barycenter")||(u.barycenter=0,u.weight=0),u.barycenter=(u.barycenter*u.weight+d.order+p.order)/(u.weight+2),u.weight+=2}return u}function $j(t,e){zB(t,(function(t){t.vs=VF(t.vs.map((function(t){return e[t]?e[t].vs:t})))}))}function Fj(t,e){SF(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 zj(t){var e=mq(t),n=Uj(t,DG(1,e+1),"inEdges"),r=Uj(t,DG(e-1,-1,-1),"outEdges"),i=Lj(t);qj(t,i);for(var a,s=Number.POSITIVE_INFINITY,o=0,l=0;l<4;++o,++l){Gj(o%2?n:r,o%4>=2);var c=Sj(t,i=dq(t));c<s&&(l=0,a=Hz(i),s=c)}qj(t,a)}function Uj(t,e,n){return wF(e,(function(e){return Ej(t,e,n)}))}function Gj(t,e){var n=new nq;zB(t,(function(t){var r=t.graph().root,i=Bj(t,r,n,e);zB(i.vs,(function(e,n){t.node(e).order=n})),_j(t,n,i.vs)}))}function qj(t,e){zB(e,(function(e){zB(e,(function(e,n){t.node(e).order=n}))}))}function jj(t){var e=Wj(t);zB(t.graph().dummyChains,(function(n){for(var r=t.node(n),i=r.edgeObj,a=Yj(t,e,i.v,i.w),s=a.path,o=a.lca,l=0,c=s[l],h=!0;n!==i.w;){if(r=t.node(n),h){for(;(c=s[l])!==o&&t.node(c).maxRank<r.rank;)l++;c===o&&(h=!1)}if(!h){for(;l<s.length-1&&t.node(c=s[l+1]).minRank<=r.rank;)l++;c=s[l]}t.setParent(n,c),n=t.successors(n)[0]}}))}function Yj(t,e,n,r){var i,a,s=[],o=[],l=Math.min(e[n].low,e[r].low),c=Math.max(e[n].lim,e[r].lim);i=n;do{i=t.parent(i),s.push(i)}while(i&&(e[i].low>l||c>e[i].lim));for(a=i,i=r;(i=t.parent(i))!==a;)o.push(i);return{path:s.concat(o.reverse()),lca:a}}function Wj(t){var e={},n=0;function r(i){var a=n;zB(t.children(i),r),e[i]={low:a,lim:n++}}return s(r,"dfs"),zB(t.children(),r),e}function Hj(t,e){var n={};function r(e,r){var i=0,a=0,s=e.length,o=MB(r);return zB(r,(function(e,l){var c=Xj(t,e),h=c?t.node(c).order:s;(c||e===o)&&(zB(r.slice(a,l+1),(function(e){zB(t.predecessors(e),(function(r){var a=t.node(r),s=a.order;!(s<i||h<s)||a.dummy&&t.node(e).dummy||Kj(n,r,e)}))})),a=l+1,i=h)})),r}return s(r,"visitLayer"),rz(e,r),n}function Vj(t,e){var n={};function r(e,r,i,a,s){var o;zB(DG(r,i),(function(r){o=e[r],t.node(o).dummy&&zB(t.predecessors(o),(function(e){var r=t.node(e);r.dummy&&(r.order<a||r.order>s)&&Kj(n,e,o)}))}))}function i(e,n){var i,a=-1,s=0;return zB(n,(function(o,l){if("border"===t.node(o).dummy){var c=t.predecessors(o);c.length&&(i=t.node(c[0]).order,r(n,s,l,a,i),s=l,a=i)}r(n,s,n.length,i,e.length)})),n}return s(r,"scan"),s(i,"visitLayer"),rz(e,i),n}function Xj(t,e){if(t.node(e).dummy)return wU(t.predecessors(e),(function(e){return t.node(e).dummy}))}function Kj(t,e,n){if(e>n){var r=e;e=n,n=r}var i=t[e];i||(t[e]=i={}),i[n]=!0}function Zj(t,e,n){if(e>n){var r=e;e=n,n=r}return!!t[e]&&Object.prototype.hasOwnProperty.call(t[e],n)}function Qj(t,e,n,r){var i={},a={},s={};return zB(e,(function(t){zB(t,(function(t,e){i[t]=t,a[t]=t,s[t]=e}))})),zB(e,(function(t){var e=-1;zB(t,(function(t){var o=r(t);if(o.length)for(var l=((o=jG(o,(function(t){return s[t]}))).length-1)/2,c=Math.floor(l),h=Math.ceil(l);c<=h;++c){var u=o[c];a[t]===t&&e<s[u]&&!Zj(n,t,u)&&(a[u]=t,a[t]=i[t]=i[u],e=s[u])}}))})),{root:i,align:a}}function Jj(t,e,n,r,i){var a={},o=tY(t,e,n,i),l=i?"borderLeft":"borderRight";function c(t,e){for(var n=o.nodes(),r=n.pop(),i={};r;)i[r]?t(r):(i[r]=!0,n.push(r),n=n.concat(e(r))),r=n.pop()}function h(t){a[t]=o.inEdges(t).reduce((function(t,e){return Math.max(t,a[e.v]+o.edge(e))}),0)}function u(e){var n=o.outEdges(e).reduce((function(t,e){return Math.min(t,a[e.w]-o.edge(e))}),Number.POSITIVE_INFINITY),r=t.node(e);n!==Number.POSITIVE_INFINITY&&r.borderType!==l&&(a[e]=Math.max(a[e],n))}return s(c,"iterate"),s(h,"pass1"),s(u,"pass2"),c(h,o.predecessors.bind(o)),c(u,o.successors.bind(o)),zB(r,(function(t){a[t]=a[n[t]]})),a}function tY(t,e,n,r){var i=new nq,a=t.graph(),s=aY(a.nodesep,a.edgesep,r);return zB(e,(function(e){var r;zB(e,(function(e){var a=n[e];if(i.setNode(a),r){var o=n[r],l=i.edge(o,a);i.setEdge(o,a,Math.max(s(t,e,r),l||0))}r=e}))})),i}function eY(t,e){return eG(EF(e),(function(e){var n=Number.NEGATIVE_INFINITY,r=Number.POSITIVE_INFINITY;return SU(e,(function(e,i){var a=sY(t,i)/2;n=Math.max(e+a,n),r=Math.min(e-a,r)})),n-r}))}function nY(t,e){var n=EF(e),r=JU(n),i=OF(n);zB(["u","d"],(function(n){zB(["l","r"],(function(a){var s,o=n+a,l=t[o];if(l!==e){var c=EF(l);(s="l"===a?r-JU(c):i-OF(c))&&(t[o]=LF(l,(function(t){return t+s})))}}))}))}function rY(t,e){return LF(t.ul,(function(n,r){if(e)return t[e.toLowerCase()][r];var i=jG(wF(t,r));return(i[1]+i[2])/2}))}function iY(t){var e,n=dq(t),r=Dw(Hj(t,n),Vj(t,n)),i={};zB(["u","d"],(function(a){e="u"===a?n:EF(n).reverse(),zB(["l","r"],(function(n){"r"===n&&(e=wF(e,(function(t){return EF(t).reverse()})));var s=("u"===a?t.predecessors:t.successors).bind(t),o=Qj(0,e,r,s),l=Jj(t,e,o.root,o.align,"r"===n);"r"===n&&(l=LF(l,(function(t){return-t}))),i[a+n]=l}))}));var a=eY(t,i);return nY(i,a),rY(i,t.graph().align)}function aY(t,e,n){return function(r,i,a){var s,o=r.node(i),l=r.node(a),c=0;if(c+=o.width/2,Object.prototype.hasOwnProperty.call(o,"labelpos"))switch(o.labelpos.toLowerCase()){case"l":s=-o.width/2;break;case"r":s=o.width/2}if(s&&(c+=n?s:-s),s=0,c+=(o.dummy?e:t)/2,c+=(l.dummy?e:t)/2,c+=l.width/2,Object.prototype.hasOwnProperty.call(l,"labelpos"))switch(l.labelpos.toLowerCase()){case"l":s=l.width/2;break;case"r":s=-l.width/2}return s&&(c+=n?s:-s),s=0,c}}function sY(t,e){return t.node(e).width}function oY(t){lY(t=hq(t)),LU(iY(t),(function(e,n){t.node(n).x=e}))}function lY(t){var e=dq(t),n=t.graph().ranksep,r=0;zB(e,(function(e){var i=OF(wF(e,(function(e){return t.node(e).height})));zB(e,(function(e){t.node(e).y=r+i/2})),r+=i+n}))}function cY(t,e){var n=e&&e.debugTiming?vq:xq;n("layout",(()=>{var e=n(" buildLayoutGraph",(()=>bY(t)));n(" runLayout",(()=>hY(e,n))),n(" updateInputGraph",(()=>uY(t,e)))}))}function hY(t,e){e(" makeSpaceForEdgeLabels",(()=>wY(t))),e(" removeSelfEdges",(()=>NY(t))),e(" acyclic",(()=>Fq(t))),e(" nestingGraph.run",(()=>xj(t))),e(" rank",(()=>fj(hq(t)))),e(" injectEdgeLabelProxies",(()=>kY(t))),e(" removeEmptyRanks",(()=>gq(t))),e(" nestingGraph.cleanup",(()=>Tj(t))),e(" normalizeRanks",(()=>pq(t))),e(" assignRankMinMax",(()=>TY(t))),e(" removeEdgeLabelProxies",(()=>_Y(t))),e(" normalize.run",(()=>Gq(t))),e(" parentDummyChains",(()=>jj(t))),e(" addBorderSegments",(()=>bq(t))),e(" order",(()=>zj(t))),e(" insertSelfEdges",(()=>IY(t))),e(" adjustCoordinateSystem",(()=>kq(t))),e(" position",(()=>oY(t))),e(" positionSelfEdges",(()=>MY(t))),e(" removeBorderNodes",(()=>LY(t))),e(" normalize.undo",(()=>jq(t))),e(" fixupEdgeLabelCoords",(()=>SY(t))),e(" undoCoordinateSystem",(()=>Tq(t))),e(" translateGraph",(()=>EY(t))),e(" assignNodeIntersects",(()=>CY(t))),e(" reversePoints",(()=>AY(t))),e(" acyclic.undo",(()=>Uq(t)))}function uY(t,e){zB(t.nodes(),(function(n){var r=t.node(n),i=e.node(n);r&&(r.x=i.x,r.y=i.y,e.children(n).length&&(r.width=i.width,r.height=i.height))})),zB(t.edges(),(function(n){var r=t.edge(n),i=e.edge(n);r.points=i.points,Object.prototype.hasOwnProperty.call(i,"x")&&(r.x=i.x,r.y=i.y)})),t.graph().width=e.graph().width,t.graph().height=e.graph().height}s(yj,"tightTreeRanker"),s(vj,"networkSimplexRanker"),s(xj,"run"),s(bj,"dfs"),s(wj,"treeDepths"),s(kj,"sumWeights"),s(Tj,"cleanup"),s(_j,"addSubgraphConstraints"),s(Ej,"buildLayerGraph"),s(Cj,"createRootNode"),s(Sj,"crossCount"),s(Aj,"twoLayerCrossCount"),s(Lj,"initOrder"),s(Nj,"barycenter"),s(Ij,"resolveConflicts"),s(Mj,"doResolveConflicts"),s(Rj,"mergeEntries"),s(Dj,"sort"),s(Oj,"consumeUnsortable"),s(Pj,"compareWithBias"),s(Bj,"sortSubgraph"),s($j,"expandSubgraphs"),s(Fj,"mergeBarycenters"),s(zj,"order"),s(Uj,"buildLayerGraphs"),s(Gj,"sweepLayerGraphs"),s(qj,"assignOrder"),s(jj,"parentDummyChains"),s(Yj,"findPath"),s(Wj,"postorder"),s(Hj,"findType1Conflicts"),s(Vj,"findType2Conflicts"),s(Xj,"findOtherInnerSegmentNode"),s(Kj,"addConflict"),s(Zj,"hasConflict"),s(Qj,"verticalAlignment"),s(Jj,"horizontalCompaction"),s(tY,"buildBlockGraph"),s(eY,"findSmallestWidthAlignment"),s(nY,"alignCoordinates"),s(rY,"balance"),s(iY,"positionX"),s(aY,"sep"),s(sY,"width"),s(oY,"position"),s(lY,"positionY"),s(cY,"layout"),s(hY,"runLayout"),s(uY,"updateInputGraph");var dY=["nodesep","edgesep","ranksep","marginx","marginy"],pY={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},gY=["acyclicer","ranker","rankdir","align"],fY=["width","height"],mY={width:0,height:0},yY=["minlen","weight","width","height","labeloffset"],vY={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},xY=["labelpos"];function bY(t){var e=new nq({multigraph:!0,compound:!0}),n=DY(t.graph());return e.setGraph(Dw({},pY,RY(n,dY),ZF(n,gY))),zB(t.nodes(),(function(n){var r=DY(t.node(n));e.setNode(n,NB(RY(r,fY),mY)),e.setParent(n,t.parent(n))})),zB(t.edges(),(function(n){var r=DY(t.edge(n));e.setEdge(n,Dw({},vY,RY(r,yY),ZF(r,xY)))})),e}function wY(t){var e=t.graph();e.ranksep/=2,zB(t.edges(),(function(n){var r=t.edge(n);r.minlen*=2,"c"!==r.labelpos.toLowerCase()&&("TB"===e.rankdir||"BT"===e.rankdir?r.width+=r.labeloffset:r.height+=r.labeloffset)}))}function kY(t){zB(t.edges(),(function(e){var n=t.edge(e);if(n.width&&n.height){var r=t.node(e.v),i={rank:(t.node(e.w).rank-r.rank)/2+r.rank,e:e};lq(t,"edge-proxy",i,"_ep")}}))}function TY(t){var e=0;zB(t.nodes(),(function(n){var r=t.node(n);r.borderTop&&(r.minRank=t.node(r.borderTop).rank,r.maxRank=t.node(r.borderBottom).rank,e=OF(e,r.maxRank))})),t.graph().maxRank=e}function _Y(t){zB(t.nodes(),(function(e){var n=t.node(e);"edge-proxy"===n.dummy&&(t.edge(n.e).labelRank=n.rank,t.removeNode(e))}))}function EY(t){var e=Number.POSITIVE_INFINITY,n=0,r=Number.POSITIVE_INFINITY,i=0,a=t.graph(),o=a.marginx||0,l=a.marginy||0;function c(t){var a=t.x,s=t.y,o=t.width,l=t.height;e=Math.min(e,a-o/2),n=Math.max(n,a+o/2),r=Math.min(r,s-l/2),i=Math.max(i,s+l/2)}s(c,"getExtremes"),zB(t.nodes(),(function(e){c(t.node(e))})),zB(t.edges(),(function(e){var n=t.edge(e);Object.prototype.hasOwnProperty.call(n,"x")&&c(n)})),e-=o,r-=l,zB(t.nodes(),(function(n){var i=t.node(n);i.x-=e,i.y-=r})),zB(t.edges(),(function(n){var i=t.edge(n);zB(i.points,(function(t){t.x-=e,t.y-=r})),Object.prototype.hasOwnProperty.call(i,"x")&&(i.x-=e),Object.prototype.hasOwnProperty.call(i,"y")&&(i.y-=r)})),a.width=n-e+o,a.height=i-r+l}function CY(t){zB(t.edges(),(function(e){var n,r,i=t.edge(e),a=t.node(e.v),s=t.node(e.w);i.points?(n=i.points[0],r=i.points[i.points.length-1]):(i.points=[],n=s,r=a),i.points.unshift(uq(a,n)),i.points.push(uq(s,r))}))}function SY(t){zB(t.edges(),(function(e){var n=t.edge(e);if(Object.prototype.hasOwnProperty.call(n,"x"))switch("l"!==n.labelpos&&"r"!==n.labelpos||(n.width-=n.labeloffset),n.labelpos){case"l":n.x-=n.width/2+n.labeloffset;break;case"r":n.x+=n.width/2+n.labeloffset}}))}function AY(t){zB(t.edges(),(function(e){var n=t.edge(e);n.reversed&&n.points.reverse()}))}function LY(t){zB(t.nodes(),(function(e){if(t.children(e).length){var n=t.node(e),r=t.node(n.borderTop),i=t.node(n.borderBottom),a=t.node(MB(n.borderLeft)),s=t.node(MB(n.borderRight));n.width=Math.abs(s.x-a.x),n.height=Math.abs(i.y-r.y),n.x=a.x+n.width/2,n.y=r.y+n.height/2}})),zB(t.nodes(),(function(e){"border"===t.node(e).dummy&&t.removeNode(e)}))}function NY(t){zB(t.edges(),(function(e){if(e.v===e.w){var n=t.node(e.v);n.selfEdges||(n.selfEdges=[]),n.selfEdges.push({e:e,label:t.edge(e)}),t.removeEdge(e)}}))}function IY(t){var e=dq(t);zB(e,(function(e){var n=0;zB(e,(function(e,r){var i=t.node(e);i.order=r+n,zB(i.selfEdges,(function(e){lq(t,"selfedge",{width:e.label.width,height:e.label.height,rank:i.rank,order:r+ ++n,e:e.e,label:e.label},"_se")})),delete i.selfEdges}))}))}function MY(t){zB(t.nodes(),(function(e){var n=t.node(e);if("selfedge"===n.dummy){var r=t.node(n.e.v),i=r.x+r.width/2,a=r.y,s=n.x-i,o=r.height/2;t.setEdge(n.e,n.label),t.removeNode(e),n.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}],n.label.x=n.x,n.label.y=n.y}}))}function RY(t,e){return LF(ZF(t,e),Number)}function DY(t){var e={};return zB(t,(function(t,n){e[n.toLowerCase()]=t})),e}function OY(t){var e={options:{directed:t.isDirected(),multigraph:t.isMultigraph(),compound:t.isCompound()},nodes:PY(t),edges:BY(t)};return SF(t.graph())||(e.value=CB(t.graph())),e}function PY(t){return wF(t.nodes(),(function(e){var n=t.node(e),r=t.parent(e),i={v:e};return SF(n)||(i.value=n),SF(r)||(i.parent=r),i}))}function BY(t){return wF(t.edges(),(function(e){var n=t.edge(e),r={v:e.v,w:e.w};return SF(e.name)||(r.name=e.name),SF(n)||(r.value=n),r}))}s(bY,"buildLayoutGraph"),s(wY,"makeSpaceForEdgeLabels"),s(kY,"injectEdgeLabelProxies"),s(TY,"assignRankMinMax"),s(_Y,"removeEdgeLabelProxies"),s(EY,"translateGraph"),s(CY,"assignNodeIntersects"),s(SY,"fixupEdgeLabelCoords"),s(AY,"reversePointsForReversedEdges"),s(LY,"removeBorderNodes"),s(NY,"removeSelfEdges"),s(IY,"insertSelfEdges"),s(MY,"positionSelfEdges"),s(RY,"selectNumberAttrs"),s(DY,"canonicalize"),s(OY,"write"),s(PY,"writeNodes"),s(BY,"writeEdges");var $Y=new Map,FY=new Map,zY=new Map,UY=s((()=>{FY.clear(),zY.clear(),$Y.clear()}),"clear"),GY=s(((t,e)=>{const n=FY.get(e)||[];return m.trace("In isDescendant",e," ",t," = ",n.includes(t)),n.includes(t)}),"isDescendant"),qY=s(((t,e)=>{const n=FY.get(e)||[];return m.info("Descendants of ",e," is ",n),m.info("Edge is ",t),t.v!==e&&t.w!==e&&(n?n.includes(t.v)||GY(t.v,e)||GY(t.w,e)||n.includes(t.w):(m.debug("Tilt, ",e,",not in descendants"),!1))}),"edgeInCluster"),jY=s(((t,e,n,r)=>{m.warn("Copying children of ",t,"root",r,"data",e.node(t),r);const i=e.children(t)||[];t!==r&&i.push(t),m.warn("Copying (nodes) clusterId",t,"nodes",i),i.forEach((i=>{if(e.children(i).length>0)jY(i,e,n,r);else{const a=e.node(i);m.info("cp ",i," to ",r," with parent ",t),n.setNode(i,a),r!==e.parent(i)&&(m.warn("Setting parent",i,e.parent(i)),n.setParent(i,e.parent(i))),t!==r&&i!==t?(m.debug("Setting parent",i,t),n.setParent(i,t)):(m.info("In copy ",t,"root",r,"data",e.node(t),r),m.debug("Not Setting parent for node=",i,"cluster!==rootId",t!==r,"node!==clusterId",i!==t));const s=e.edges(i);m.debug("Copying Edges",s),s.forEach((i=>{m.info("Edge",i);const a=e.edge(i.v,i.w,i.name);m.info("Edge data",a,r);try{qY(i,r)?(m.info("Copying as ",i.v,i.w,a,i.name),n.setEdge(i.v,i.w,a,i.name),m.info("newGraph edges ",n.edges(),n.edge(n.edges()[0]))):m.info("Skipping copy of edge ",i.v,"--\x3e",i.w," rootId: ",r," clusterId:",t)}catch(t){m.error(t)}}))}m.debug("Removing node",i),e.removeNode(i)}))}),"copy"),YY=s(((t,e)=>{const n=e.children(t);let r=[...n];for(const i of n)zY.set(i,t),r=[...r,...YY(i,e)];return r}),"extractDescendants"),WY=s(((t,e,n)=>{const r=t.edges().filter((t=>t.v===e||t.w===e)),i=t.edges().filter((t=>t.v===n||t.w===n)),a=r.map((t=>({v:t.v===e?n:t.v,w:t.w===e?e:t.w}))),s=i.map((t=>({v:t.v,w:t.w})));return a.filter((t=>s.some((e=>t.v===e.v&&t.w===e.w))))}),"findCommonEdges"),HY=s(((t,e,n)=>{const r=e.children(t);if(m.trace("Searching children of id ",t,r),r.length<1)return t;let i;for(const t of r){const r=HY(t,e,n),a=WY(e,n,r);if(r){if(!(a.length>0))return r;i=r}}return i}),"findNonClusterChild"),VY=s((t=>$Y.has(t)&&$Y.get(t).externalConnections&&$Y.has(t)?$Y.get(t).id:t),"getAnchorId"),XY=s(((t,e)=>{if(!t||e>10)m.debug("Opting out, no graph ");else{m.debug("Opting in, graph "),t.nodes().forEach((function(e){t.children(e).length>0&&(m.warn("Cluster identified",e," Replacement id in edges: ",HY(e,t,e)),FY.set(e,YY(e,t)),$Y.set(e,{id:HY(e,t,e),clusterData:t.node(e)}))})),t.nodes().forEach((function(e){const n=t.children(e),r=t.edges();n.length>0?(m.debug("Cluster identified",e,FY),r.forEach((t=>{GY(t.v,e)^GY(t.w,e)&&(m.warn("Edge: ",t," leaves cluster ",e),m.warn("Descendants of XXX ",e,": ",FY.get(e)),$Y.get(e).externalConnections=!0)}))):m.debug("Not a cluster ",e,FY)}));for(let e of $Y.keys()){const n=$Y.get(e).id,r=t.parent(n);r!==e&&$Y.has(r)&&!$Y.get(r).externalConnections&&($Y.get(e).id=r)}t.edges().forEach((function(e){const n=t.edge(e);m.warn("Edge "+e.v+" -> "+e.w+": "+JSON.stringify(e)),m.warn("Edge "+e.v+" -> "+e.w+": "+JSON.stringify(t.edge(e)));let r=e.v,i=e.w;if(m.warn("Fix XXX",$Y,"ids:",e.v,e.w,"Translating: ",$Y.get(e.v)," --- ",$Y.get(e.w)),$Y.get(e.v)||$Y.get(e.w)){if(m.warn("Fixing and trying - removing XXX",e.v,e.w,e.name),r=VY(e.v),i=VY(e.w),t.removeEdge(e.v,e.w,e.name),r!==e.v){const i=t.parent(r);$Y.get(i).externalConnections=!0,n.fromCluster=e.v}if(i!==e.w){const r=t.parent(i);$Y.get(r).externalConnections=!0,n.toCluster=e.w}m.warn("Fix Replacing with XXX",r,i,e.name),t.setEdge(r,i,n,e.name)}})),m.warn("Adjusted Graph",OY(t)),KY(t,0),m.trace($Y)}}),"adjustClustersAndEdges"),KY=s(((t,e)=>{if(m.warn("extractor - ",e,OY(t),t.children("D")),e>10)return void m.error("Bailing out");let n=t.nodes(),r=!1;for(const e of n){const n=t.children(e);r=r||n.length>0}if(r){m.debug("Nodes = ",n,e);for(const r of n)if(m.debug("Extracting node",r,$Y,$Y.has(r)&&!$Y.get(r).externalConnections,!t.parent(r),t.node(r),t.children("D")," Depth ",e),$Y.has(r))if(!$Y.get(r).externalConnections&&t.children(r)&&t.children(r).length>0){m.warn("Cluster without external connections, without a parent and with children",r,e);let n="TB"===t.graph().rankdir?"LR":"TB";$Y.get(r)?.clusterData?.dir&&(n=$Y.get(r).clusterData.dir,m.warn("Fixing dir",$Y.get(r).clusterData.dir,n));const i=new nq({multigraph:!0,compound:!0}).setGraph({rankdir:n,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel((function(){return{}}));m.warn("Old graph before copy",OY(t)),jY(r,t,i,r),t.setNode(r,{clusterNode:!0,id:r,clusterData:$Y.get(r).clusterData,label:$Y.get(r).label,graph:i}),m.warn("New graph after copy node: (",r,")",OY(i)),m.debug("Old graph after copy",OY(t))}else m.warn("Cluster ** ",r," **not meeting the criteria !externalConnections:",!$Y.get(r).externalConnections," no parent: ",!t.parent(r)," children ",t.children(r)&&t.children(r).length>0,t.children("D"),e),m.debug($Y);else m.debug("Not a cluster",r,e);n=t.nodes(),m.warn("New list of nodes",n);for(const r of n){const n=t.node(r);m.warn(" Now next level",r,n),n?.clusterNode&&KY(n.graph,e+1)}}else m.debug("Done, no node has children",t.nodes())}),"extractor"),ZY=s(((t,e)=>{if(0===e.length)return[];let n=Object.assign([],e);return e.forEach((e=>{const r=t.children(e),i=ZY(t,r);n=[...n,...i]})),n}),"sorter"),QY=s((t=>ZY(t,t.children())),"sortNodesByHierarchy"),JY=s((async(t,e,n,r,i,a)=>{m.warn("Graph in recursive render:XAX",OY(e),i);const o=e.graph().rankdir;m.trace("Dir in recursive render - dir:",o);const l=t.insert("g").attr("class","root");e.nodes()?m.info("Recursive render XXX",e.nodes()):m.info("No nodes found for",e),e.edges().length>0&&m.info("Recursive edges",e.edge(e.edges()[0]));const c=l.insert("g").attr("class","clusters"),h=l.insert("g").attr("class","edgePaths"),u=l.insert("g").attr("class","edgeLabels"),d=l.insert("g").attr("class","nodes");await Promise.all(e.nodes().map((async function(t){const s=e.node(t);if(void 0!==i){const n=JSON.parse(JSON.stringify(i.clusterData));m.trace("Setting data for parent cluster XXX\n Node.id = ",t,"\n data=",n.height,"\nParent cluster",i.height),e.setNode(i.id,n),e.parent(t)||(m.trace("Setting parent",t,i.id),e.setParent(t,i.id,n))}if(m.info("(Insert) Node XXX"+t+": "+JSON.stringify(e.node(t))),s?.clusterNode){m.info("Cluster identified XBX",t,s.width,e.node(t));const{ranksep:i,nodesep:o}=e.graph();s.graph.setGraph({...s.graph.graph(),ranksep:i+25,nodesep:o});const l=await JY(d,s.graph,n,r,e.node(t),a),c=l.elem;JT(s,c),s.diff=l.diff||0,m.info("New compound node after recursive render XAX",t,"width",s.width,"height",s.height),mS(c,s)}else e.children(t).length>0?(m.trace("Cluster - the non recursive path XBX",t,s.id,s,s.width,"Graph:",e),m.trace(HY(s.id,e)),$Y.set(s.id,{id:HY(s.id,e),node:s})):(m.trace("Node - the non recursive path XAX",t,d,e.node(t),o),await fS(d,e.node(t),{config:a,dir:o}))})));const p=s((async()=>{const t=e.edges().map((async function(t){const n=e.edge(t.v,t.w,t.name);m.info("Edge "+t.v+" -> "+t.w+": "+JSON.stringify(t)),m.info("Edge "+t.v+" -> "+t.w+": ",t," ",JSON.stringify(e.edge(t))),m.info("Fix",$Y,"ids:",t.v,t.w,"Translating: ",$Y.get(t.v),$Y.get(t.w)),await NS(u,n)}));await Promise.all(t)}),"processEdges");await p(),m.info("Graph before layout:",JSON.stringify(OY(e))),m.info("############################################# XXX"),m.info("### Layout ### XXX"),m.info("############################################# XXX"),cY(e),m.info("Graph after layout:",JSON.stringify(OY(e)));let g=0,{subGraphTitleTotalMargin:f}=Gm(a);return await Promise.all(QY(e).map((async function(t){const n=e.node(t);if(m.info("Position XBX => "+t+": ("+n.x,","+n.y,") width: ",n.width," height: ",n.height),n?.clusterNode)n.y+=f,m.info("A tainted cluster node XBX1",t,n.id,n.width,n.height,n.x,n.y,e.parent(t)),$Y.get(n.id).node=n,vS(n);else if(e.children(t).length>0){m.info("A pure cluster node XBX1",t,n.id,n.x,n.y,n.width,n.height,e.parent(t)),n.height+=f,e.node(n.parentId);const r=n?.padding/2||0,i=n?.labelBBox?.height||0,a=i-r||0;m.debug("OffsetY",a,"labelHeight",i,"halfPadding",r),await CE(c,n),$Y.get(n.id).node=n}else{const t=e.node(n.parentId);n.y+=f/2,m.info("A regular node XBX1 - using the padding",n.id,"parent",n.parentId,n.width,n.height,n.x,n.y,"offsetY",n.offsetY,"parent",t,t?.offsetY,n),vS(n)}}))),e.edges().forEach((function(t){const i=e.edge(t);m.info("Edge "+t.v+" -> "+t.w+": "+JSON.stringify(i),i),i.points.forEach((t=>t.y+=f/2));const a=e.node(t.v);var s=e.node(t.w);const o=FS(h,i,$Y,n,a,s,r);MS(i,o)})),e.nodes().forEach((function(t){const n=e.node(t);m.info(t,n.type,n.diff),n.isGroup&&(g=n.diff)})),m.warn("Returning from recursive render XAX",l,g),{elem:l,diff:g}}),"recursiveRender"),tW=s((async(t,e)=>{const n=new nq({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{}})),r=e.select("g");ZS(r,t.markers,t.type,t.diagramId),yS(),AS(),SE(),UY(),t.nodes.forEach((t=>{n.setNode(t.id,{...t}),t.parentId&&n.setParent(t.id,t.parentId)})),m.debug("Edges:",t.edges),t.edges.forEach((t=>{if(t.start===t.end){const e=t.start,r=e+"---"+e+"---1",i=e+"---"+e+"---2",a=n.node(e);n.setNode(r,{domId:r,id:r,parentId:a.parentId,labelStyle:"",label:"",padding:0,shape:"labelRect",style:"",width:10,height:10}),n.setParent(r,a.parentId),n.setNode(i,{domId:i,id:i,parentId:a.parentId,labelStyle:"",padding:0,shape:"labelRect",label:"",style:"",width:10,height:10}),n.setParent(i,a.parentId);const s=structuredClone(t),o=structuredClone(t),l=structuredClone(t);s.label="",s.arrowTypeEnd="none",s.id=e+"-cyclic-special-1",o.arrowTypeEnd="none",o.id=e+"-cyclic-special-mid",l.label="",a.isGroup&&(s.fromCluster=e,l.toCluster=e),l.id=e+"-cyclic-special-2",n.setEdge(e,r,s,e+"-cyclic-special-0"),n.setEdge(r,i,o,e+"-cyclic-special-1"),n.setEdge(i,e,l,e+"-cyc<lic-special-2")}else n.setEdge(t.start,t.end,{...t},t.id)})),m.warn("Graph at first:",JSON.stringify(OY(n))),XY(n),m.warn("Graph after XAX:",JSON.stringify(OY(n)));const i=Hn();await JY(r,n,t.type,t.diagramId,void 0,i)}),"render"),eW=Object.freeze({__proto__:null,render:tW}),nW=d(Cy(),1),rW=s(((t,e)=>{const n=t.append("rect");if(n.attr("x",e.x),n.attr("y",e.y),n.attr("fill",e.fill),n.attr("stroke",e.stroke),n.attr("width",e.width),n.attr("height",e.height),e.name&&n.attr("name",e.name),e.rx&&n.attr("rx",e.rx),e.ry&&n.attr("ry",e.ry),void 0!==e.attrs)for(const t in e.attrs)n.attr(t,e.attrs[t]);return e.class&&n.attr("class",e.class),n}),"drawRect"),iW=s(((t,e)=>{const n={x:e.startx,y:e.starty,width:e.stopx-e.startx,height:e.stopy-e.starty,fill:e.fill,stroke:e.stroke,class:"rect"};rW(t,n).lower()}),"drawBackgroundRect"),aW=s(((t,e)=>{const n=e.text.replace(Qe," "),r=t.append("text");r.attr("x",e.x),r.attr("y",e.y),r.attr("class","legend"),r.style("text-anchor",e.anchor),e.class&&r.attr("class",e.class);const i=r.append("tspan");return i.attr("x",e.x+2*e.textMargin),i.text(n),r}),"drawText"),sW=s(((t,e,n,r)=>{const i=t.append("image");i.attr("x",e),i.attr("y",n);const a=(0,nW.sanitizeUrl)(r);i.attr("xlink:href",a)}),"drawImage"),oW=s(((t,e,n,r)=>{const i=t.append("use");i.attr("x",e),i.attr("y",n);const a=(0,nW.sanitizeUrl)(r);i.attr("xlink:href",`#${a}`)}),"drawEmbeddedImage"),lW=s((()=>({x:0,y:0,width:100,height:100,fill:"#EDF2AE",stroke:"#666",anchor:"start",rx:0,ry:0})),"getNoteRect"),cW=s((()=>({x:0,y:0,width:100,height:100,"text-anchor":"start",style:"#666",textMargin:0,rx:0,ry:0,tspan:!0})),"getTextObj"),hW=function(){var t=s((function(t,e,n,r){for(n=n||{},r=t.length;r--;n[t[r]]=e);return n}),"o"),e=[1,24],n=[1,25],r=[1,26],i=[1,27],a=[1,28],o=[1,63],l=[1,64],h=[1,65],u=[1,66],d=[1,67],p=[1,68],g=[1,69],f=[1,29],m=[1,30],y=[1,31],v=[1,32],x=[1,33],b=[1,34],w=[1,35],k=[1,36],T=[1,37],_=[1,38],E=[1,39],C=[1,40],S=[1,41],A=[1,42],L=[1,43],N=[1,44],I=[1,45],M=[1,46],R=[1,47],D=[1,48],O=[1,50],P=[1,51],B=[1,52],$=[1,53],F=[1,54],z=[1,55],U=[1,56],G=[1,57],q=[1,58],j=[1,59],Y=[1,60],W=[14,42],H=[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],V=[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],K=[1,83],Z=[1,84],Q=[1,85],J=[12,14,42],tt=[12,14,33,42],et=[12,14,33,42,76,77,79,80],nt=[12,33],rt=[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],it={trace:s((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:s((function(t,e,n,r,i,a,s){var o=a.length-1;switch(i){case 3:r.setDirection("TB");break;case 4:r.setDirection("BT");break;case 5:r.setDirection("RL");break;case 6:r.setDirection("LR");break;case 8:case 9:case 10:case 11:case 12:r.setC4Type(a[o-3]);break;case 19:r.setTitle(a[o].substring(6)),this.$=a[o].substring(6);break;case 20:r.setAccDescription(a[o].substring(15)),this.$=a[o].substring(15);break;case 21:this.$=a[o].trim(),r.setTitle(this.$);break;case 22:case 23:this.$=a[o].trim(),r.setAccDescription(this.$);break;case 28:a[o].splice(2,0,"ENTERPRISE"),r.addPersonOrSystemBoundary(...a[o]),this.$=a[o];break;case 29:a[o].splice(2,0,"SYSTEM"),r.addPersonOrSystemBoundary(...a[o]),this.$=a[o];break;case 30:r.addPersonOrSystemBoundary(...a[o]),this.$=a[o];break;case 31:a[o].splice(2,0,"CONTAINER"),r.addContainerBoundary(...a[o]),this.$=a[o];break;case 32:r.addDeploymentNode("node",...a[o]),this.$=a[o];break;case 33:r.addDeploymentNode("nodeL",...a[o]),this.$=a[o];break;case 34:r.addDeploymentNode("nodeR",...a[o]),this.$=a[o];break;case 35:r.popBoundaryParseStack();break;case 39:r.addPersonOrSystem("person",...a[o]),this.$=a[o];break;case 40:r.addPersonOrSystem("external_person",...a[o]),this.$=a[o];break;case 41:r.addPersonOrSystem("system",...a[o]),this.$=a[o];break;case 42:r.addPersonOrSystem("system_db",...a[o]),this.$=a[o];break;case 43:r.addPersonOrSystem("system_queue",...a[o]),this.$=a[o];break;case 44:r.addPersonOrSystem("external_system",...a[o]),this.$=a[o];break;case 45:r.addPersonOrSystem("external_system_db",...a[o]),this.$=a[o];break;case 46:r.addPersonOrSystem("external_system_queue",...a[o]),this.$=a[o];break;case 47:r.addContainer("container",...a[o]),this.$=a[o];break;case 48:r.addContainer("container_db",...a[o]),this.$=a[o];break;case 49:r.addContainer("container_queue",...a[o]),this.$=a[o];break;case 50:r.addContainer("external_container",...a[o]),this.$=a[o];break;case 51:r.addContainer("external_container_db",...a[o]),this.$=a[o];break;case 52:r.addContainer("external_container_queue",...a[o]),this.$=a[o];break;case 53:r.addComponent("component",...a[o]),this.$=a[o];break;case 54:r.addComponent("component_db",...a[o]),this.$=a[o];break;case 55:r.addComponent("component_queue",...a[o]),this.$=a[o];break;case 56:r.addComponent("external_component",...a[o]),this.$=a[o];break;case 57:r.addComponent("external_component_db",...a[o]),this.$=a[o];break;case 58:r.addComponent("external_component_queue",...a[o]),this.$=a[o];break;case 60:r.addRel("rel",...a[o]),this.$=a[o];break;case 61:r.addRel("birel",...a[o]),this.$=a[o];break;case 62:r.addRel("rel_u",...a[o]),this.$=a[o];break;case 63:r.addRel("rel_d",...a[o]),this.$=a[o];break;case 64:r.addRel("rel_l",...a[o]),this.$=a[o];break;case 65:r.addRel("rel_r",...a[o]),this.$=a[o];break;case 66:r.addRel("rel_b",...a[o]),this.$=a[o];break;case 67:a[o].splice(0,1),r.addRel("rel",...a[o]),this.$=a[o];break;case 68:r.updateElStyle("update_el_style",...a[o]),this.$=a[o];break;case 69:r.updateRelStyle("update_rel_style",...a[o]),this.$=a[o];break;case 70:r.updateLayoutConfig("update_layout_config",...a[o]),this.$=a[o];break;case 71:this.$=[a[o]];break;case 72:a[o].unshift(a[o-1]),this.$=a[o];break;case 73:case 75:this.$=a[o].trim();break;case 74:let t={};t[a[o-1].trim()]=a[o].trim(),this.$=t;break;case 76:this.$=""}}),"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:n,24:r,26:i,28:a,29:49,30:61,32:62,34:o,36:l,37:h,38:u,39:d,40:p,41:g,43:23,44:f,45:m,46:y,47:v,48:x,49:b,50:w,51:k,52:T,53:_,54:E,55:C,56:S,57:A,58:L,59:N,60:I,61:M,62:R,63:D,64:O,65:P,66:B,67:$,68:F,69:z,70:U,71:G,72:q,73:j,74:Y},{13:70,19:20,20:21,21:22,22:e,23:n,24:r,26:i,28:a,29:49,30:61,32:62,34:o,36:l,37:h,38:u,39:d,40:p,41:g,43:23,44:f,45:m,46:y,47:v,48:x,49:b,50:w,51:k,52:T,53:_,54:E,55:C,56:S,57:A,58:L,59:N,60:I,61:M,62:R,63:D,64:O,65:P,66:B,67:$,68:F,69:z,70:U,71:G,72:q,73:j,74:Y},{13:71,19:20,20:21,21:22,22:e,23:n,24:r,26:i,28:a,29:49,30:61,32:62,34:o,36:l,37:h,38:u,39:d,40:p,41:g,43:23,44:f,45:m,46:y,47:v,48:x,49:b,50:w,51:k,52:T,53:_,54:E,55:C,56:S,57:A,58:L,59:N,60:I,61:M,62:R,63:D,64:O,65:P,66:B,67:$,68:F,69:z,70:U,71:G,72:q,73:j,74:Y},{13:72,19:20,20:21,21:22,22:e,23:n,24:r,26:i,28:a,29:49,30:61,32:62,34:o,36:l,37:h,38:u,39:d,40:p,41:g,43:23,44:f,45:m,46:y,47:v,48:x,49:b,50:w,51:k,52:T,53:_,54:E,55:C,56:S,57:A,58:L,59:N,60:I,61:M,62:R,63:D,64:O,65:P,66:B,67:$,68:F,69:z,70:U,71:G,72:q,73:j,74:Y},{13:73,19:20,20:21,21:22,22:e,23:n,24:r,26:i,28:a,29:49,30:61,32:62,34:o,36:l,37:h,38:u,39:d,40:p,41:g,43:23,44:f,45:m,46:y,47:v,48:x,49:b,50:w,51:k,52:T,53:_,54:E,55:C,56:S,57:A,58:L,59:N,60:I,61:M,62:R,63:D,64:O,65:P,66:B,67:$,68:F,69:z,70:U,71:G,72:q,73:j,74:Y},{14:[1,74]},t(W,[2,13],{43:23,29:49,30:61,32:62,20:75,34:o,36:l,37:h,38:u,39:d,40:p,41:g,44:f,45:m,46:y,47:v,48:x,49:b,50:w,51:k,52:T,53:_,54:E,55:C,56:S,57:A,58:L,59:N,60:I,61:M,62:R,63:D,64:O,65:P,66:B,67:$,68:F,69:z,70:U,71:G,72:q,73:j,74:Y}),t(W,[2,14]),t(H,[2,16],{12:[1,76]}),t(W,[2,36],{12:[1,77]}),t(V,[2,19]),t(V,[2,20]),{25:[1,78]},{27:[1,79]},t(V,[2,23]),{35:80,75:81,76:X,77:K,79:Z,80:Q},{35:86,75:81,76:X,77:K,79:Z,80:Q},{35:87,75:81,76:X,77:K,79:Z,80:Q},{35:88,75:81,76:X,77:K,79:Z,80:Q},{35:89,75:81,76:X,77:K,79:Z,80:Q},{35:90,75:81,76:X,77:K,79:Z,80:Q},{35:91,75:81,76:X,77:K,79:Z,80:Q},{35:92,75:81,76:X,77:K,79:Z,80:Q},{35:93,75:81,76:X,77:K,79:Z,80:Q},{35:94,75:81,76:X,77:K,79:Z,80:Q},{35:95,75:81,76:X,77:K,79:Z,80:Q},{35:96,75:81,76:X,77:K,79:Z,80:Q},{35:97,75:81,76:X,77:K,79:Z,80:Q},{35:98,75:81,76:X,77:K,79:Z,80:Q},{35:99,75:81,76:X,77:K,79:Z,80:Q},{35:100,75:81,76:X,77:K,79:Z,80:Q},{35:101,75:81,76:X,77:K,79:Z,80:Q},{35:102,75:81,76:X,77:K,79:Z,80:Q},{35:103,75:81,76:X,77:K,79:Z,80:Q},{35:104,75:81,76:X,77:K,79:Z,80:Q},t(J,[2,59]),{35:105,75:81,76:X,77:K,79:Z,80:Q},{35:106,75:81,76:X,77:K,79:Z,80:Q},{35:107,75:81,76:X,77:K,79:Z,80:Q},{35:108,75:81,76:X,77:K,79:Z,80:Q},{35:109,75:81,76:X,77:K,79:Z,80:Q},{35:110,75:81,76:X,77:K,79:Z,80:Q},{35:111,75:81,76:X,77:K,79:Z,80:Q},{35:112,75:81,76:X,77:K,79:Z,80:Q},{35:113,75:81,76:X,77:K,79:Z,80:Q},{35:114,75:81,76:X,77:K,79:Z,80:Q},{35:115,75:81,76:X,77:K,79:Z,80:Q},{20:116,29:49,30:61,32:62,34:o,36:l,37:h,38:u,39:d,40:p,41:g,43:23,44:f,45:m,46:y,47:v,48:x,49:b,50:w,51:k,52:T,53:_,54:E,55:C,56:S,57:A,58:L,59:N,60:I,61:M,62:R,63:D,64:O,65:P,66:B,67:$,68:F,69:z,70:U,71:G,72:q,73:j,74:Y},{12:[1,118],33:[1,117]},{35:119,75:81,76:X,77:K,79:Z,80:Q},{35:120,75:81,76:X,77:K,79:Z,80:Q},{35:121,75:81,76:X,77:K,79:Z,80:Q},{35:122,75:81,76:X,77:K,79:Z,80:Q},{35:123,75:81,76:X,77:K,79:Z,80:Q},{35:124,75:81,76:X,77:K,79:Z,80:Q},{35:125,75:81,76:X,77:K,79:Z,80:Q},{14:[1,126]},{14:[1,127]},{14:[1,128]},{14:[1,129]},{1:[2,8]},t(W,[2,15]),t(H,[2,17],{21:22,19:130,22:e,23:n,24:r,26:i,28:a}),t(W,[2,37],{19:20,20:21,21:22,43:23,29:49,30:61,32:62,13:131,22:e,23:n,24:r,26:i,28:a,34:o,36:l,37:h,38:u,39:d,40:p,41:g,44:f,45:m,46:y,47:v,48:x,49:b,50:w,51:k,52:T,53:_,54:E,55:C,56:S,57:A,58:L,59:N,60:I,61:M,62:R,63:D,64:O,65:P,66:B,67:$,68:F,69:z,70:U,71:G,72:q,73:j,74:Y}),t(V,[2,21]),t(V,[2,22]),t(J,[2,39]),t(tt,[2,71],{75:81,35:132,76:X,77:K,79:Z,80:Q}),t(et,[2,73]),{78:[1,133]},t(et,[2,75]),t(et,[2,76]),t(J,[2,40]),t(J,[2,41]),t(J,[2,42]),t(J,[2,43]),t(J,[2,44]),t(J,[2,45]),t(J,[2,46]),t(J,[2,47]),t(J,[2,48]),t(J,[2,49]),t(J,[2,50]),t(J,[2,51]),t(J,[2,52]),t(J,[2,53]),t(J,[2,54]),t(J,[2,55]),t(J,[2,56]),t(J,[2,57]),t(J,[2,58]),t(J,[2,60]),t(J,[2,61]),t(J,[2,62]),t(J,[2,63]),t(J,[2,64]),t(J,[2,65]),t(J,[2,66]),t(J,[2,67]),t(J,[2,68]),t(J,[2,69]),t(J,[2,70]),{31:134,42:[1,135]},{12:[1,136]},{33:[1,137]},t(nt,[2,28]),t(nt,[2,29]),t(nt,[2,30]),t(nt,[2,31]),t(nt,[2,32]),t(nt,[2,33]),t(nt,[2,34]),{1:[2,9]},{1:[2,10]},{1:[2,11]},{1:[2,12]},t(H,[2,18]),t(W,[2,38]),t(tt,[2,72]),t(et,[2,74]),t(J,[2,24]),t(J,[2,35]),t(rt,[2,25]),t(rt,[2,26],{12:[1,138]}),t(rt,[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:s((function(t,e){if(!e.recoverable){var n=new Error(t);throw n.hash=e,n}this.trace(t)}),"parseError"),parse:s((function(t){var e=this,n=[0],r=[],i=[null],a=[],o=this.table,l="",c=0,h=0,u=2,d=1,p=a.slice.call(arguments,1),g=Object.create(this.lexer),f={yy:{}};for(var m in this.yy)Object.prototype.hasOwnProperty.call(this.yy,m)&&(f.yy[m]=this.yy[m]);g.setInput(t,f.yy),f.yy.lexer=g,f.yy.parser=this,void 0===g.yylloc&&(g.yylloc={});var y=g.yylloc;a.push(y);var v=g.options&&g.options.ranges;function x(t){n.length=n.length-2*t,i.length=i.length-t,a.length=a.length-t}function b(){var t;return"number"!=typeof(t=r.pop()||g.lex()||d)&&(t instanceof Array&&(t=(r=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof f.yy.parseError?this.parseError=f.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,s(x,"popStack"),s(b,"lex");for(var w,k,T,_,E,C,S,A,L={};;){if(k=n[n.length-1],this.defaultActions[k]?T=this.defaultActions[k]:(null==w&&(w=b()),T=o[k]&&o[k][w]),void 0===T||!T.length||!T[0]){var N="";for(E in A=[],o[k])this.terminals_[E]&&E>u&&A.push("'"+this.terminals_[E]+"'");N=g.showPosition?"Parse error on line "+(c+1)+":\n"+g.showPosition()+"\nExpecting "+A.join(", ")+", got '"+(this.terminals_[w]||w)+"'":"Parse error on line "+(c+1)+": Unexpected "+(w==d?"end of input":"'"+(this.terminals_[w]||w)+"'"),this.parseError(N,{text:g.match,token:this.terminals_[w]||w,line:g.yylineno,loc:y,expected:A})}if(T[0]instanceof Array&&T.length>1)throw new Error("Parse Error: multiple actions possible at state: "+k+", token: "+w);switch(T[0]){case 1:n.push(w),i.push(g.yytext),a.push(g.yylloc),n.push(T[1]),w=null,h=g.yyleng,l=g.yytext,c=g.yylineno,y=g.yylloc;break;case 2:if(C=this.productions_[T[1]][1],L.$=i[i.length-C],L._$={first_line:a[a.length-(C||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(C||1)].first_column,last_column:a[a.length-1].last_column},v&&(L._$.range=[a[a.length-(C||1)].range[0],a[a.length-1].range[1]]),void 0!==(_=this.performAction.apply(L,[l,h,c,f.yy,T[1],i,a].concat(p))))return _;C&&(n=n.slice(0,-1*C*2),i=i.slice(0,-1*C),a=a.slice(0,-1*C)),n.push(this.productions_[T[1]][0]),i.push(L.$),a.push(L._$),S=o[n[n.length-2]][n[n.length-1]],n.push(S);break;case 3:return!0}}return!0}),"parse")},at=function(){var t={EOF:1,parseError:s((function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)}),"parseError"),setInput:s((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:s((function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(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:s((function(t){var e=t.length,n=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 r=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 i=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===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this}),"unput"),more:s((function(){return this._more=!0,this}),"more"),reject:s((function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):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).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}),"reject"),less:s((function(t){this.unput(this.match.slice(t))}),"less"),pastInput:s((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:s((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:s((function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"}),"showPosition"),test_match:s((function(t,e){var n,r,i;if(this.options.backtrack_lexer&&(i={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&&(i.yylloc.range=this.yylloc.range.slice(0))),(r=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.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],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1}),"test_match"),next:s((function(){if(this.done)return this.EOF;var t,e,n,r;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;a<i.length;a++)if((n=this._input.match(this.rules[i[a]]))&&(!e||n[0].length>e[0].length)){if(e=n,r=a,this.options.backtrack_lexer){if(!1!==(t=this.test_match(n,i[a])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,i[r]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}),"next"),lex:s((function(){var t=this.next();return t||this.lex()}),"lex"),begin:s((function(t){this.conditionStack.push(t)}),"begin"),popState:s((function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]}),"popState"),_currentRules:s((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:s((function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"}),"topState"),pushState:s((function(t){this.begin(t)}),"pushState"),stateStackSize:s((function(){return this.conditionStack.length}),"stateStackSize"),options:{},performAction:s((function(t,e,n,r){switch(n){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:case 73:this.popState();break;case 12:return"acc_descr_multiline_value";case 13:case 16:case 70:break;case 14:c;break;case 15:return 12;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: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:case 53:return this.begin("rel_u"),66;case 54:case 55:return this.begin("rel_d"),67;case 56:case 57:return this.begin("rel_l"),68;case 58: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:case 79:this.popState(),this.popState();break;case 69:case 71:return 80;case 72:this.begin("string");break;case 74:case 80: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 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 t}();function st(){this.yy={}}return it.lexer=at,s(st,"Parser"),st.prototype=it,it.Parser=st,new st}();hW.parser=hW;var uW,dW=hW,pW=[],gW=[""],fW="global",mW="",yW=[{alias:"global",label:{text:"global"},type:{text:"global"},tags:null,link:null,parentBoundary:""}],vW=[],xW="",bW=!1,wW=4,kW=2,TW=s((function(){return uW}),"getC4Type"),_W=s((function(t){let e=an(t,Hn());uW=e}),"setC4Type"),EW=s((function(t,e,n,r,i,a,s,o,l){if(null==t||null==e||null==n||null==r)return;let c={};const h=vW.find((t=>t.from===e&&t.to===n));if(h?c=h:vW.push(c),c.type=t,c.from=e,c.to=n,c.label={text:r},null==i)c.techn={text:""};else if("object"==typeof i){let[t,e]=Object.entries(i)[0];c[t]={text:e}}else c.techn={text:i};if(null==a)c.descr={text:""};else if("object"==typeof a){let[t,e]=Object.entries(a)[0];c[t]={text:e}}else c.descr={text:a};if("object"==typeof s){let[t,e]=Object.entries(s)[0];c[t]=e}else c.sprite=s;if("object"==typeof o){let[t,e]=Object.entries(o)[0];c[t]=e}else c.tags=o;if("object"==typeof l){let[t,e]=Object.entries(l)[0];c[t]=e}else c.link=l;c.wrap=VW()}),"addRel"),CW=s((function(t,e,n,r,i,a,s){if(null===e||null===n)return;let o={};const l=pW.find((t=>t.alias===e));if(l&&e===l.alias?o=l:(o.alias=e,pW.push(o)),o.label=null==n?{text:""}:{text:n},null==r)o.descr={text:""};else if("object"==typeof r){let[t,e]=Object.entries(r)[0];o[t]={text:e}}else o.descr={text:r};if("object"==typeof i){let[t,e]=Object.entries(i)[0];o[t]=e}else o.sprite=i;if("object"==typeof a){let[t,e]=Object.entries(a)[0];o[t]=e}else o.tags=a;if("object"==typeof s){let[t,e]=Object.entries(s)[0];o[t]=e}else o.link=s;o.typeC4Shape={text:t},o.parentBoundary=fW,o.wrap=VW()}),"addPersonOrSystem"),SW=s((function(t,e,n,r,i,a,s,o){if(null===e||null===n)return;let l={};const c=pW.find((t=>t.alias===e));if(c&&e===c.alias?l=c:(l.alias=e,pW.push(l)),l.label=null==n?{text:""}:{text:n},null==r)l.techn={text:""};else if("object"==typeof r){let[t,e]=Object.entries(r)[0];l[t]={text:e}}else l.techn={text:r};if(null==i)l.descr={text:""};else if("object"==typeof i){let[t,e]=Object.entries(i)[0];l[t]={text:e}}else l.descr={text:i};if("object"==typeof a){let[t,e]=Object.entries(a)[0];l[t]=e}else l.sprite=a;if("object"==typeof s){let[t,e]=Object.entries(s)[0];l[t]=e}else l.tags=s;if("object"==typeof o){let[t,e]=Object.entries(o)[0];l[t]=e}else l.link=o;l.wrap=VW(),l.typeC4Shape={text:t},l.parentBoundary=fW}),"addContainer"),AW=s((function(t,e,n,r,i,a,s,o){if(null===e||null===n)return;let l={};const c=pW.find((t=>t.alias===e));if(c&&e===c.alias?l=c:(l.alias=e,pW.push(l)),l.label=null==n?{text:""}:{text:n},null==r)l.techn={text:""};else if("object"==typeof r){let[t,e]=Object.entries(r)[0];l[t]={text:e}}else l.techn={text:r};if(null==i)l.descr={text:""};else if("object"==typeof i){let[t,e]=Object.entries(i)[0];l[t]={text:e}}else l.descr={text:i};if("object"==typeof a){let[t,e]=Object.entries(a)[0];l[t]=e}else l.sprite=a;if("object"==typeof s){let[t,e]=Object.entries(s)[0];l[t]=e}else l.tags=s;if("object"==typeof o){let[t,e]=Object.entries(o)[0];l[t]=e}else l.link=o;l.wrap=VW(),l.typeC4Shape={text:t},l.parentBoundary=fW}),"addComponent"),LW=s((function(t,e,n,r,i){if(null===t||null===e)return;let a={};const s=yW.find((e=>e.alias===t));if(s&&t===s.alias?a=s:(a.alias=t,yW.push(a)),a.label=null==e?{text:""}:{text:e},null==n)a.type={text:"system"};else if("object"==typeof n){let[t,e]=Object.entries(n)[0];a[t]={text:e}}else a.type={text:n};if("object"==typeof r){let[t,e]=Object.entries(r)[0];a[t]=e}else a.tags=r;if("object"==typeof i){let[t,e]=Object.entries(i)[0];a[t]=e}else a.link=i;a.parentBoundary=fW,a.wrap=VW(),mW=fW,fW=t,gW.push(mW)}),"addPersonOrSystemBoundary"),NW=s((function(t,e,n,r,i){if(null===t||null===e)return;let a={};const s=yW.find((e=>e.alias===t));if(s&&t===s.alias?a=s:(a.alias=t,yW.push(a)),a.label=null==e?{text:""}:{text:e},null==n)a.type={text:"container"};else if("object"==typeof n){let[t,e]=Object.entries(n)[0];a[t]={text:e}}else a.type={text:n};if("object"==typeof r){let[t,e]=Object.entries(r)[0];a[t]=e}else a.tags=r;if("object"==typeof i){let[t,e]=Object.entries(i)[0];a[t]=e}else a.link=i;a.parentBoundary=fW,a.wrap=VW(),mW=fW,fW=t,gW.push(mW)}),"addContainerBoundary"),IW=s((function(t,e,n,r,i,a,s,o){if(null===e||null===n)return;let l={};const c=yW.find((t=>t.alias===e));if(c&&e===c.alias?l=c:(l.alias=e,yW.push(l)),l.label=null==n?{text:""}:{text:n},null==r)l.type={text:"node"};else if("object"==typeof r){let[t,e]=Object.entries(r)[0];l[t]={text:e}}else l.type={text:r};if(null==i)l.descr={text:""};else if("object"==typeof i){let[t,e]=Object.entries(i)[0];l[t]={text:e}}else l.descr={text:i};if("object"==typeof s){let[t,e]=Object.entries(s)[0];l[t]=e}else l.tags=s;if("object"==typeof o){let[t,e]=Object.entries(o)[0];l[t]=e}else l.link=o;l.nodeType=t,l.parentBoundary=fW,l.wrap=VW(),mW=fW,fW=e,gW.push(mW)}),"addDeploymentNode"),MW=s((function(){fW=mW,gW.pop(),mW=gW.pop(),gW.push(mW)}),"popBoundaryParseStack"),RW=s((function(t,e,n,r,i,a,s,o,l,c,h){let u=pW.find((t=>t.alias===e));if(void 0!==u||(u=yW.find((t=>t.alias===e)),void 0!==u)){if(null!=n)if("object"==typeof n){let[t,e]=Object.entries(n)[0];u[t]=e}else u.bgColor=n;if(null!=r)if("object"==typeof r){let[t,e]=Object.entries(r)[0];u[t]=e}else u.fontColor=r;if(null!=i)if("object"==typeof i){let[t,e]=Object.entries(i)[0];u[t]=e}else u.borderColor=i;if(null!=a)if("object"==typeof a){let[t,e]=Object.entries(a)[0];u[t]=e}else u.shadowing=a;if(null!=s)if("object"==typeof s){let[t,e]=Object.entries(s)[0];u[t]=e}else u.shape=s;if(null!=o)if("object"==typeof o){let[t,e]=Object.entries(o)[0];u[t]=e}else u.sprite=o;if(null!=l)if("object"==typeof l){let[t,e]=Object.entries(l)[0];u[t]=e}else u.techn=l;if(null!=c)if("object"==typeof c){let[t,e]=Object.entries(c)[0];u[t]=e}else u.legendText=c;if(null!=h)if("object"==typeof h){let[t,e]=Object.entries(h)[0];u[t]=e}else u.legendSprite=h}}),"updateElStyle"),DW=s((function(t,e,n,r,i,a,s){const o=vW.find((t=>t.from===e&&t.to===n));if(void 0!==o){if(null!=r)if("object"==typeof r){let[t,e]=Object.entries(r)[0];o[t]=e}else o.textColor=r;if(null!=i)if("object"==typeof i){let[t,e]=Object.entries(i)[0];o[t]=e}else o.lineColor=i;if(null!=a)if("object"==typeof a){let[t,e]=Object.entries(a)[0];o[t]=parseInt(e)}else o.offsetX=parseInt(a);if(null!=s)if("object"==typeof s){let[t,e]=Object.entries(s)[0];o[t]=parseInt(e)}else o.offsetY=parseInt(s)}}),"updateRelStyle"),OW=s((function(t,e,n){let r=wW,i=kW;if("object"==typeof e){const t=Object.values(e)[0];r=parseInt(t)}else r=parseInt(e);if("object"==typeof n){const t=Object.values(n)[0];i=parseInt(t)}else i=parseInt(n);r>=1&&(wW=r),i>=1&&(kW=i)}),"updateLayoutConfig"),PW=s((function(){return wW}),"getC4ShapeInRow"),BW=s((function(){return kW}),"getC4BoundaryInRow"),$W=s((function(){return fW}),"getCurrentBoundaryParse"),FW=s((function(){return mW}),"getParentBoundaryParse"),zW=s((function(t){return null==t?pW:pW.filter((e=>e.parentBoundary===t))}),"getC4ShapeArray"),UW=s((function(t){return pW.find((e=>e.alias===t))}),"getC4Shape"),GW=s((function(t){return Object.keys(zW(t))}),"getC4ShapeKeys"),qW=s((function(t){return null==t?yW:yW.filter((e=>e.parentBoundary===t))}),"getBoundaries"),jW=qW,YW=s((function(){return vW}),"getRels"),WW=s((function(){return xW}),"getTitle"),HW=s((function(t){bW=t}),"setWrap"),VW=s((function(){return bW}),"autoWrap"),XW=s((function(){pW=[],yW=[{alias:"global",label:{text:"global"},type:{text:"global"},tags:null,link:null,parentBoundary:""}],mW="",fW="global",gW=[""],vW=[],gW=[""],xW="",bW=!1,wW=4,kW=2}),"clear"),KW=s((function(t){let e=an(t,Hn());xW=e}),"setTitle"),ZW={addPersonOrSystem:CW,addPersonOrSystemBoundary:LW,addContainer:SW,addContainerBoundary:NW,addComponent:AW,addDeploymentNode:IW,popBoundaryParseStack:MW,addRel:EW,updateElStyle:RW,updateRelStyle:DW,updateLayoutConfig:OW,autoWrap:VW,setWrap:HW,getC4ShapeArray:zW,getC4Shape:UW,getC4ShapeKeys:GW,getBoundaries:qW,getBoundarys:jW,getCurrentBoundaryParse:$W,getParentBoundaryParse:FW,getRels:YW,getTitle:WW,getC4Type:TW,getC4ShapeInRow:PW,getC4BoundaryInRow:BW,setAccTitle:Fn,getAccTitle:zn,getAccDescription:Gn,setAccDescription:Un,getConfig:s((()=>Hn().c4),"getConfig"),clear:XW,LINETYPE:{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},ARROWTYPE:{FILLED:0,OPEN:1},PLACEMENT:{LEFTOF:0,RIGHTOF:1,OVER:2},setTitle:KW,setC4Type:_W},QW=d(Cy(),1),JW=s((function(t,e){return rW(t,e)}),"drawRect"),tH=s((function(t,e,n,r,i,a){const s=t.append("image");s.attr("width",e),s.attr("height",n),s.attr("x",r),s.attr("y",i);let o=a.startsWith("data:image/png;base64")?a:(0,QW.sanitizeUrl)(a);s.attr("xlink:href",o)}),"drawImage"),eH=s(((t,e,n)=>{const r=t.append("g");let i=0;for(let t of e){let e=t.textColor?t.textColor:"#444444",a=t.lineColor?t.lineColor:"#444444",s=t.offsetX?parseInt(t.offsetX):0,o=t.offsetY?parseInt(t.offsetY):0,l="";if(0===i){let e=r.append("line");e.attr("x1",t.startPoint.x),e.attr("y1",t.startPoint.y),e.attr("x2",t.endPoint.x),e.attr("y2",t.endPoint.y),e.attr("stroke-width","1"),e.attr("stroke",a),e.style("fill","none"),"rel_b"!==t.type&&e.attr("marker-end","url("+l+"#arrowhead)"),"birel"!==t.type&&"rel_b"!==t.type||e.attr("marker-start","url("+l+"#arrowend)"),i=-1}else{let e=r.append("path");e.attr("fill","none").attr("stroke-width","1").attr("stroke",a).attr("d","Mstartx,starty Qcontrolx,controly stopx,stopy ".replaceAll("startx",t.startPoint.x).replaceAll("starty",t.startPoint.y).replaceAll("controlx",t.startPoint.x+(t.endPoint.x-t.startPoint.x)/2-(t.endPoint.x-t.startPoint.x)/4).replaceAll("controly",t.startPoint.y+(t.endPoint.y-t.startPoint.y)/2).replaceAll("stopx",t.endPoint.x).replaceAll("stopy",t.endPoint.y)),"rel_b"!==t.type&&e.attr("marker-end","url("+l+"#arrowhead)"),"birel"!==t.type&&"rel_b"!==t.type||e.attr("marker-start","url("+l+"#arrowend)")}let c=n.messageFont();pH(n)(t.label.text,r,Math.min(t.startPoint.x,t.endPoint.x)+Math.abs(t.endPoint.x-t.startPoint.x)/2+s,Math.min(t.startPoint.y,t.endPoint.y)+Math.abs(t.endPoint.y-t.startPoint.y)/2+o,t.label.width,t.label.height,{fill:e},c),t.techn&&""!==t.techn.text&&(c=n.messageFont(),pH(n)("["+t.techn.text+"]",r,Math.min(t.startPoint.x,t.endPoint.x)+Math.abs(t.endPoint.x-t.startPoint.x)/2+s,Math.min(t.startPoint.y,t.endPoint.y)+Math.abs(t.endPoint.y-t.startPoint.y)/2+n.messageFontSize+5+o,Math.max(t.label.width,t.techn.width),t.techn.height,{fill:e,"font-style":"italic"},c))}}),"drawRels"),nH=s((function(t,e,n){const r=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};JW(r,l);let c=n.boundaryFont();c.fontWeight="bold",c.fontSize=c.fontSize+2,c.fontColor=s,pH(n)(e.label.text,r,e.x,e.y+e.label.Y,e.width,e.height,{fill:"#444444"},c),e.type&&""!==e.type.text&&(c=n.boundaryFont(),c.fontColor=s,pH(n)(e.type.text,r,e.x,e.y+e.type.Y,e.width,e.height,{fill:"#444444"},c)),e.descr&&""!==e.descr.text&&(c=n.boundaryFont(),c.fontSize=c.fontSize-2,c.fontColor=s,pH(n)(e.descr.text,r,e.x,e.y+e.descr.Y,e.width,e.height,{fill:"#444444"},c))}),"drawBoundary"),rH=s((function(t,e,n){let r=e.bgColor?e.bgColor:n[e.typeC4Shape.text+"_bg_color"],i=e.borderColor?e.borderColor:n[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="}const o=t.append("g");o.attr("class","person-man");const l=lW();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=r,l.width=e.width,l.height=e.height,l.stroke=i,l.rx=2.5,l.ry=2.5,l.attrs={"stroke-width":.5},JW(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",r).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",r).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))}let c=dH(n,e.typeC4Shape.text);switch(o.append("text").attr("fill",a).attr("font-family",c.fontFamily).attr("font-size",c.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":tH(o,48,48,e.x+e.width/2-24,e.y+e.image.Y,s)}let h=n[e.typeC4Shape.text+"Font"]();return h.fontWeight="bold",h.fontSize=h.fontSize+2,h.fontColor=a,pH(n)(e.label.text,o,e.x,e.y+e.label.Y,e.width,e.height,{fill:a},h),h=n[e.typeC4Shape.text+"Font"](),h.fontColor=a,e.techn&&""!==e.techn?.text?pH(n)(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&&pH(n)(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=n.personFont(),h.fontColor=a,pH(n)(e.descr.text,o,e.x,e.y+e.descr.Y,e.width,e.height,{fill:a},h)),e.height}),"drawC4Shape"),iH=s((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"),aH=s((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"),sH=s((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"),oH=s((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"),lH=s((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"),cH=s((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"),hH=s((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"),uH=s((function(t){const e=t.append("defs").append("marker").attr("id","crosshead").attr("markerWidth",15).attr("markerHeight",8).attr("orient","auto").attr("refX",16).attr("refY",4);e.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"),e.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"),dH=s(((t,e)=>({fontFamily:t[e+"FontFamily"],fontSize:t[e+"FontSize"],fontWeight:t[e+"FontWeight"]})),"getC4ShapeFont"),pH=function(){function t(t,e,n,i,a,s,o){r(e.append("text").attr("x",n+a/2).attr("y",i+s/2+5).style("text-anchor","middle").text(t),o)}function e(t,e,n,i,a,s,o,l){const{fontSize:c,fontFamily:h,fontWeight:u}=l,d=t.split(_n.lineBreakRegex);for(let t=0;t<d.length;t++){const s=t*c-c*(d.length-1)/2,l=e.append("text").attr("x",n+a/2).attr("y",i).style("text-anchor","middle").attr("dominant-baseline","middle").style("font-size",c).style("font-weight",u).style("font-family",h);l.append("tspan").attr("dy",s).text(d[t]).attr("alignment-baseline","mathematical"),r(l,o)}}function n(t,n,i,a,s,o,l,c){const h=n.append("switch"),u=h.append("foreignObject").attr("x",i).attr("y",a).attr("width",s).attr("height",o).append("xhtml:div").style("display","table").style("height","100%").style("width","100%");u.append("div").style("display","table-cell").style("text-align","center").style("vertical-align","middle").text(t),e(t,h,i,a,s,0,l,c),r(u,l)}function r(t,e){for(const n in e)e.hasOwnProperty(n)&&t.attr(n,e[n])}return s(t,"byText"),s(e,"byTspan"),s(n,"byFo"),s(r,"_setTextAttrs"),function(r){return"fo"===r.textPlacement?n:"old"===r.textPlacement?t:e}}(),gH={drawRect:JW,drawBoundary:nH,drawC4Shape:rH,drawRels:eH,drawImage:tH,insertArrowHead:oH,insertArrowEnd:lH,insertArrowFilledHead:cH,insertDynamicNumber:hH,insertArrowCrossHead:uH,insertDatabaseIcon:iH,insertComputerIcon:aH,insertClockIcon:sH},fH=0,mH=0,yH=4,vH=2;hW.yy=ZW;var xH={},bH=class{static{s(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,wH(t.db.getConfig())}setData(t,e,n,r){this.nextData.startx=this.data.startx=t,this.nextData.stopx=this.data.stopx=e,this.nextData.starty=this.data.starty=n,this.nextData.stopy=this.data.stopy=r}updateVal(t,e,n,r){void 0===t[e]?t[e]=n:t[e]=r(n,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+2*t.margin,n=e+t.width,r=this.nextData.starty+2*t.margin,i=r+t.height;(e>=this.data.widthLimit||n>=this.data.widthLimit||this.nextData.cnt>yH)&&(e=this.nextData.startx+t.margin+xH.nextLinePaddingX,r=this.nextData.stopy+2*t.margin,this.nextData.stopx=n=e+t.width,this.nextData.starty=this.nextData.stopy,this.nextData.stopy=i=r+t.height,this.nextData.cnt=1),t.x=e,t.y=r,this.updateVal(this.data,"startx",e,Math.min),this.updateVal(this.data,"starty",r,Math.min),this.updateVal(this.data,"stopx",n,Math.max),this.updateVal(this.data,"stopy",i,Math.max),this.updateVal(this.nextData,"startx",e,Math.min),this.updateVal(this.nextData,"starty",r,Math.min),this.updateVal(this.nextData,"stopx",n,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},wH(t.db.getConfig())}bumpLastMargin(t){this.data.stopx+=t,this.data.stopy+=t}},wH=s((function(t){L(xH,t),t.fontFamily&&(xH.personFontFamily=xH.systemFontFamily=xH.messageFontFamily=t.fontFamily),t.fontSize&&(xH.personFontSize=xH.systemFontSize=xH.messageFontSize=t.fontSize),t.fontWeight&&(xH.personFontWeight=xH.systemFontWeight=xH.messageFontWeight=t.fontWeight)}),"setConf"),kH=s(((t,e)=>({fontFamily:t[e+"FontFamily"],fontSize:t[e+"FontSize"],fontWeight:t[e+"FontWeight"]})),"c4ShapeFont"),TH=s((t=>({fontFamily:t.boundaryFontFamily,fontSize:t.boundaryFontSize,fontWeight:t.boundaryFontWeight})),"boundaryFont"),_H=s((t=>({fontFamily:t.messageFontFamily,fontSize:t.messageFontSize,fontWeight:t.messageFontWeight})),"messageFont");function EH(t,e,n,r,i){if(!e[t].width)if(n)e[t].text=ak(e[t].text,i,r),e[t].textLines=e[t].text.split(_n.lineBreakRegex).length,e[t].width=i,e[t].height=ok(e[t].text,r);else{let n=e[t].text.split(_n.lineBreakRegex);e[t].textLines=n.length;let i=0;e[t].height=0,e[t].width=0;for(const a of n)e[t].width=Math.max(lk(a,r),e[t].width),i=ok(a,r),e[t].height=e[t].height+i}}s(EH,"calcC4ShapeTextWH");var CH=s((function(t,e,n){e.x=n.data.startx,e.y=n.data.starty,e.width=n.data.stopx-n.data.startx,e.height=n.data.stopy-n.data.starty,e.label.y=xH.c4ShapeMargin-35;let r=e.wrap&&xH.wrap,i=TH(xH);i.fontSize=i.fontSize+2,i.fontWeight="bold",EH("label",e,r,i,lk(e.label.text,i)),gH.drawBoundary(t,e,xH)}),"drawBoundary"),SH=s((function(t,e,n,r){let i=0;for(const a of r){i=0;const r=n[a];let s=kH(xH,r.typeC4Shape.text);switch(s.fontSize=s.fontSize-2,r.typeC4Shape.width=lk("«"+r.typeC4Shape.text+"»",s),r.typeC4Shape.height=s.fontSize+2,r.typeC4Shape.Y=xH.c4ShapePadding,i=r.typeC4Shape.Y+r.typeC4Shape.height-4,r.image={width:0,height:0,Y:0},r.typeC4Shape.text){case"person":case"external_person":r.image.width=48,r.image.height=48,r.image.Y=i,i=r.image.Y+r.image.height}r.sprite&&(r.image.width=48,r.image.height=48,r.image.Y=i,i=r.image.Y+r.image.height);let o=r.wrap&&xH.wrap,l=xH.width-2*xH.c4ShapePadding,c=kH(xH,r.typeC4Shape.text);if(c.fontSize=c.fontSize+2,c.fontWeight="bold",EH("label",r,o,c,l),r.label.Y=i+8,i=r.label.Y+r.label.height,r.type&&""!==r.type.text){r.type.text="["+r.type.text+"]",EH("type",r,o,kH(xH,r.typeC4Shape.text),l),r.type.Y=i+5,i=r.type.Y+r.type.height}else if(r.techn&&""!==r.techn.text){r.techn.text="["+r.techn.text+"]",EH("techn",r,o,kH(xH,r.techn.text),l),r.techn.Y=i+5,i=r.techn.Y+r.techn.height}let h=i,u=r.label.width;if(r.descr&&""!==r.descr.text){EH("descr",r,o,kH(xH,r.typeC4Shape.text),l),r.descr.Y=i+20,i=r.descr.Y+r.descr.height,u=Math.max(r.label.width,r.descr.width),h=i-5*r.descr.textLines}u+=xH.c4ShapePadding,r.width=Math.max(r.width||xH.width,u,xH.width),r.height=Math.max(r.height||xH.height,h,xH.height),r.margin=r.margin||xH.c4ShapeMargin,t.insert(r),gH.drawC4Shape(e,r,xH)}t.bumpLastMargin(xH.c4ShapeMargin)}),"drawC4ShapeArray"),AH=class{static{s(this,"Point")}constructor(t,e){this.x=t,this.y=e}},LH=s((function(t,e){let n=t.x,r=t.y,i=e.x,a=e.y,s=n+t.width/2,o=r+t.height/2,l=Math.abs(n-i),c=Math.abs(r-a),h=c/l,u=t.height/t.width,d=null;return r==a&&n<i?d=new AH(n+t.width,o):r==a&&n>i?d=new AH(n,o):n==i&&r<a?d=new AH(s,r+t.height):n==i&&r>a&&(d=new AH(s,r)),n>i&&r<a?d=u>=h?new AH(n,o+h*t.width/2):new AH(s-l/c*t.height/2,r+t.height):n<i&&r<a?d=u>=h?new AH(n+t.width,o+h*t.width/2):new AH(s+l/c*t.height/2,r+t.height):n<i&&r>a?d=u>=h?new AH(n+t.width,o-h*t.width/2):new AH(s+t.height/2*l/c,r):n>i&&r>a&&(d=u>=h?new AH(n,o-t.width/2*h):new AH(s-t.height/2*l/c,r)),d}),"getIntersectPoint"),NH=s((function(t,e){let n={x:0,y:0};n.x=e.x+e.width/2,n.y=e.y+e.height/2;let r=LH(t,n);return n.x=t.x+t.width/2,n.y=t.y+t.height/2,{startPoint:r,endPoint:LH(e,n)}}),"getIntersectPoints"),IH=s((function(t,e,n,r){let i=0;for(let t of e){i+=1;let e=t.wrap&&xH.wrap,a=_H(xH);"C4Dynamic"===r.db.getC4Type()&&(t.label.text=i+": "+t.label.text);let s=lk(t.label.text,a);EH("label",t,e,a,s),t.techn&&""!==t.techn.text&&(s=lk(t.techn.text,a),EH("techn",t,e,a,s)),t.descr&&""!==t.descr.text&&(s=lk(t.descr.text,a),EH("descr",t,e,a,s));let o=n(t.from),l=n(t.to),c=NH(o,l);t.startPoint=c.startPoint,t.endPoint=c.endPoint}gH.drawRels(t,e,xH)}),"drawRels");function MH(t,e,n,r,i){let a=new bH(i);a.data.widthLimit=n.data.widthLimit/Math.min(vH,r.length);for(let[s,o]of r.entries()){let r=0;o.image={width:0,height:0,Y:0},o.sprite&&(o.image.width=48,o.image.height=48,o.image.Y=r,r=o.image.Y+o.image.height);let l=o.wrap&&xH.wrap,c=TH(xH);if(c.fontSize=c.fontSize+2,c.fontWeight="bold",EH("label",o,l,c,a.data.widthLimit),o.label.Y=r+8,r=o.label.Y+o.label.height,o.type&&""!==o.type.text){o.type.text="["+o.type.text+"]",EH("type",o,l,TH(xH),a.data.widthLimit),o.type.Y=r+5,r=o.type.Y+o.type.height}if(o.descr&&""!==o.descr.text){let t=TH(xH);t.fontSize=t.fontSize-2,EH("descr",o,l,t,a.data.widthLimit),o.descr.Y=r+20,r=o.descr.Y+o.descr.height}if(0==s||s%vH==0){let t=n.data.startx+xH.diagramMarginX,e=n.data.stopy+xH.diagramMarginY+r;a.setData(t,t,e,e)}else{let t=a.data.stopx!==a.data.startx?a.data.stopx+xH.diagramMarginX:a.data.startx,e=a.data.starty;a.setData(t,t,e,e)}a.name=o.alias;let h=i.db.getC4ShapeArray(o.alias),u=i.db.getC4ShapeKeys(o.alias);u.length>0&&SH(a,t,h,u),e=o.alias;let d=i.db.getBoundarys(e);d.length>0&&MH(t,e,a,d,i),"global"!==o.alias&&CH(t,o,a),n.data.stopy=Math.max(a.data.stopy+xH.c4ShapeMargin,n.data.stopy),n.data.stopx=Math.max(a.data.stopx+xH.c4ShapeMargin,n.data.stopx),fH=Math.max(fH,n.data.stopx),mH=Math.max(mH,n.data.stopy)}}s(MH,"drawInsideBoundary");var RH,DH,OH=s((function(t,e,n,r){xH=Hn().c4;const i=Hn().securityLevel;let a;"sandbox"===i&&(a=Oa("#i"+e));const s=Oa("sandbox"===i?a.nodes()[0].contentDocument.body:"body");let o=r.db;r.db.setWrap(xH.wrap),yH=o.getC4ShapeInRow(),vH=o.getC4BoundaryInRow(),m.debug(`C:${JSON.stringify(xH,null,2)}`);const l="sandbox"===i?s.select(`[id="${e}"]`):Oa(`[id="${e}"]`);gH.insertComputerIcon(l),gH.insertDatabaseIcon(l),gH.insertClockIcon(l);let c=new bH(r);c.setData(xH.diagramMarginX,xH.diagramMarginX,xH.diagramMarginY,xH.diagramMarginY),c.data.widthLimit=screen.availWidth,fH=xH.diagramMarginX,mH=xH.diagramMarginY;const h=r.db.getTitle();MH(l,"",c,r.db.getBoundarys(""),r),gH.insertArrowHead(l),gH.insertArrowEnd(l),gH.insertArrowCrossHead(l),gH.insertArrowFilledHead(l),IH(l,r.db.getRels(),r.db.getC4Shape,r),c.data.stopx=fH,c.data.stopy=mH;const u=c.data;let d=u.stopy-u.starty+2*xH.diagramMarginY;const p=u.stopx-u.startx+2*xH.diagramMarginX;h&&l.append("text").text(h).attr("x",(u.stopx-u.startx)/2-4*xH.diagramMarginX).attr("y",u.starty+xH.diagramMarginY),Sn(l,d,p,xH.useMaxWidth);const g=h?60:0;l.attr("viewBox",u.startx-xH.diagramMarginX+" -"+(xH.diagramMarginY+g)+" "+p+" "+(d+g)),m.debug("models:",u)}),"draw"),PH={drawPersonOrSystemArray:SH,drawBoundary:CH,setConf:wH,draw:OH},BH={parser:dW,db:ZW,renderer:PH,styles:s((t=>`.person {\n stroke: ${t.personBorder};\n fill: ${t.personBkg};\n }\n`),"getStyles"),init:s((({c4:t,wrap:e})=>{PH.setConf(t),ZW.setWrap(e)}),"init")},$H=Object.freeze({__proto__:null,diagram:BH}),FH=s(((t,e)=>{let n;"sandbox"===e&&(n=Oa("#i"+t));return Oa("sandbox"===e?n.nodes()[0].contentDocument.body:"body").select(`[id="${t}"]`)}),"getDiagramElement"),zH=s(((t,e,n,r)=>{t.attr("class",n);const{width:i,height:a,x:s,y:o}=UH(t,e);Sn(t,a,i,r);const l=GH(s,o,i,a,e);t.attr("viewBox",l),m.debug(`viewBox configured: ${l} with padding: ${e}`)}),"setupViewPortForSVG"),UH=s(((t,e)=>{const n=t.node()?.getBBox()||{width:0,height:0,x:0,y:0};return{width:n.width+2*e,height:n.height+2*e,x:n.x,y:n.y}}),"calculateDimensionsWithPadding"),GH=s(((t,e,n,r,i)=>`${t-i} ${e-i} ${n} ${r}`),"createViewBox"),qH=0,jH=Hn(),YH=new Map,WH=[],HH=new Map,VH=[],XH=new Map,KH=new Map,ZH=0,QH=!0,JH=[],tV=s((t=>_n.sanitizeText(t,jH)),"sanitizeText"),eV=s((function(t){for(const e of YH.values())if(e.id===t)return e.domId;return t}),"lookUpDomId"),nV=s((function(t,e,n,r,i,a,s={},o){if(!t||0===t.trim().length)return;let l,c=YH.get(t);if(void 0===c&&(c={id:t,labelType:"text",domId:"flowchart-"+t+"-"+qH,styles:[],classes:[]},YH.set(t,c)),qH++,void 0!==e?(jH=Hn(),l=tV(e.text.trim()),c.labelType=e.type,l.startsWith('"')&&l.endsWith('"')&&(l=l.substring(1,l.length-1)),c.text=l):void 0===c.text&&(c.text=t),void 0!==n&&(c.type=n),null!=r&&r.forEach((function(t){c.styles.push(t)})),null!=i&&i.forEach((function(t){c.classes.push(t)})),void 0!==a&&(c.dir=a),void 0===c.props?c.props=s:void 0!==s&&Object.assign(c.props,s),void 0!==o){let e;e=o.includes("\n")?o+"\n":"{\n"+o+"\n}";const n=Um(e,{schema:zm});if(n.shape){if(n.shape!==n.shape.toLowerCase()||n.shape.includes("_"))throw new Error(`No such shape: ${n.shape}. Shape names should be lowercase.`);if(!pS(n.shape))throw new Error(`No such shape: ${n.shape}.`);c.type=n?.shape}n?.label&&(c.text=n?.label),n?.icon&&(c.icon=n?.icon,n.label?.trim()||c.text!==t||(c.text="")),n?.form&&(c.form=n?.form),n?.pos&&(c.pos=n?.pos),n?.img&&(c.img=n?.img,n.label?.trim()||c.text!==t||(c.text="")),n?.constraint&&(c.constraint=n.constraint),n.w&&(c.assetWidth=Number(n.w)),n.h&&(c.assetHeight=Number(n.h))}}),"addVertex"),rV=s((function(t,e,n){const r={start:t,end:e,type:void 0,text:"",labelType:"text"};m.info("abc78 Got edge...",r);const i=n.text;if(void 0!==i&&(r.text=tV(i.text.trim()),r.text.startsWith('"')&&r.text.endsWith('"')&&(r.text=r.text.substring(1,r.text.length-1)),r.labelType=i.type),void 0!==n&&(r.type=n.type,r.stroke=n.stroke,r.length=n.length>10?10:n.length),!(WH.length<(jH.maxEdges??500)))throw new Error(`Edge limit exceeded. ${WH.length} edges found, but the limit is ${jH.maxEdges}.\n\nInitialize mermaid with maxEdges set to a higher number to allow more edges.\nYou cannot set this config via configuration inside the diagram as it is a secure config.\nYou have to call mermaid.initialize.`);m.info("Pushing edge..."),WH.push(r)}),"addSingleLink"),iV=s((function(t,e,n){m.info("addLink",t,e,n);for(const r of t)for(const t of e)rV(r,t,n)}),"addLink"),aV=s((function(t,e){t.forEach((function(t){"default"===t?WH.defaultInterpolate=e:WH[t].interpolate=e}))}),"updateLinkInterpolate"),sV=s((function(t,e){t.forEach((function(t){if("number"==typeof t&&t>=WH.length)throw new Error(`The index ${t} for linkStyle is out of bounds. Valid indices for linkStyle are between 0 and ${WH.length-1}. (Help: Ensure that the index is within the range of existing edges.)`);"default"===t?WH.defaultStyle=e:(WH[t].style=e,(WH[t]?.style?.length??0)>0&&!WH[t]?.style?.some((t=>t?.startsWith("fill")))&&WH[t]?.style?.push("fill:none"))}))}),"updateLink"),oV=s((function(t,e){t.split(",").forEach((function(t){let n=HH.get(t);void 0===n&&(n={id:t,styles:[],textStyles:[]},HH.set(t,n)),null!=e&&e.forEach((function(t){if(/color/.exec(t)){const e=t.replace("fill","bgFill");n.textStyles.push(e)}n.styles.push(t)}))}))}),"addClass"),lV=s((function(t){/.*</.exec(RH=t)&&(RH="RL"),/.*\^/.exec(RH)&&(RH="BT"),/.*>/.exec(RH)&&(RH="LR"),/.*v/.exec(RH)&&(RH="TB"),"TD"===RH&&(RH="TB")}),"setDirection"),cV=s((function(t,e){for(const n of t.split(",")){const t=YH.get(n);t&&t.classes.push(e);const r=XH.get(n);r&&r.classes.push(e)}}),"setClass"),hV=s((function(t,e){if(void 0!==e){e=tV(e);for(const n of t.split(","))KH.set("gen-1"===DH?eV(n):n,e)}}),"setTooltip"),uV=s((function(t,e,n){const r=eV(t);if("loose"!==Hn().securityLevel)return;if(void 0===e)return;let i=[];if("string"==typeof n){i=n.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let t=0;t<i.length;t++){let e=i[t].trim();e.startsWith('"')&&e.endsWith('"')&&(e=e.substr(1,e.length-2)),i[t]=e}}0===i.length&&i.push(t);const a=YH.get(t);a&&(a.haveCallback=!0,JH.push((function(){const t=document.querySelector(`[id="${r}"]`);null!==t&&t.addEventListener("click",(function(){yk.runFunc(e,...i)}),!1)})))}),"setClickFun"),dV=s((function(t,e,n){t.split(",").forEach((function(t){const r=YH.get(t);void 0!==r&&(r.link=yk.formatUrl(e,jH),r.linkTarget=n)})),cV(t,"clickable")}),"setLink"),pV=s((function(t){return KH.get(t)}),"getTooltip"),gV=s((function(t,e,n){t.split(",").forEach((function(t){uV(t,e,n)})),cV(t,"clickable")}),"setClickEvent"),fV=s((function(t){JH.forEach((function(e){e(t)}))}),"bindFunctions"),mV=s((function(){return RH.trim()}),"getDirection"),yV=s((function(){return YH}),"getVertices"),vV=s((function(){return WH}),"getEdges"),xV=s((function(){return HH}),"getClasses"),bV=s((function(t){let e=Oa(".mermaidTooltip");null===(e._groups||e)[0][0]&&(e=Oa("body").append("div").attr("class","mermaidTooltip").style("opacity",0));Oa(t).select("svg").selectAll("g.node").on("mouseover",(function(){const t=Oa(this);if(null===t.attr("title"))return;const n=this?.getBoundingClientRect();e.transition().duration(200).style("opacity",".9"),e.text(t.attr("title")).style("left",window.scrollX+n.left+(n.right-n.left)/2+"px").style("top",window.scrollY+n.bottom+"px"),e.html(e.html().replace(/&lt;br\/&gt;/g,"<br/>")),t.classed("hover",!0)})).on("mouseout",(function(){e.transition().duration(500).style("opacity",0);Oa(this).classed("hover",!1)}))}),"setupToolTips");JH.push(bV);var wV=s((function(t="gen-1"){YH=new Map,HH=new Map,WH=[],JH=[bV],VH=[],XH=new Map,ZH=0,KH=new Map,QH=!0,DH=t,jH=Hn(),$n()}),"clear"),kV=s((t=>{DH=t||"gen-2"}),"setGen"),TV=s((function(){return"fill:#ffa;stroke: #f66; stroke-width: 3px; stroke-dasharray: 5, 5;fill:#ffa;stroke: #666;"}),"defaultStyle"),_V=s((function(t,e,n){let r=t.text.trim(),i=n.text;function a(t){const e={boolean:{},number:{},string:{}},n=[];let r;const i=t.filter((function(t){const i=typeof t;return t.stmt&&"dir"===t.stmt?(r=t.value,!1):""!==t.trim()&&(i in e?!e[i].hasOwnProperty(t)&&(e[i][t]=!0):!n.includes(t)&&n.push(t))}));return{nodeList:i,dir:r}}t===n&&/\s/.exec(n.text)&&(r=void 0),s(a,"uniq");const{nodeList:o,dir:l}=a(e.flat());if("gen-1"===DH)for(let t=0;t<o.length;t++)o[t]=eV(o[t]);r=r??"subGraph"+ZH,i=i||"",i=tV(i),ZH+=1;const c={id:r,nodes:o,title:i.trim(),classes:[],dir:l,labelType:n.type};return m.info("Adding",c.id,c.nodes,c.dir),c.nodes=$V(c,VH).nodes,VH.push(c),XH.set(r,c),r}),"addSubGraph"),EV=s((function(t){for(const[e,n]of VH.entries())if(n.id===t)return e;return-1}),"getPosForId"),CV=-1,SV=[],AV=s((function(t,e){const n=VH[e].nodes;if((CV+=1)>2e3)return{result:!1,count:0};if(SV[CV]=e,VH[e].id===t)return{result:!0,count:0};let r=0,i=1;for(;r<n.length;){const e=EV(n[r]);if(e>=0){const n=AV(t,e);if(n.result)return{result:!0,count:i+n.count};i+=n.count}r+=1}return{result:!1,count:i}}),"indexNodes2"),LV=s((function(t){return SV[t]}),"getDepthFirstPos"),NV=s((function(){CV=-1,VH.length>0&&AV("none",VH.length-1)}),"indexNodes"),IV=s((function(){return VH}),"getSubGraphs"),MV=s((()=>!!QH&&(QH=!1,!0)),"firstGraph"),RV=s((t=>{let e=t.trim(),n="arrow_open";switch(e[0]){case"<":n="arrow_point",e=e.slice(1);break;case"x":n="arrow_cross",e=e.slice(1);break;case"o":n="arrow_circle",e=e.slice(1)}let r="normal";return e.includes("=")&&(r="thick"),e.includes(".")&&(r="dotted"),{type:n,stroke:r}}),"destructStartLink"),DV=s(((t,e)=>{const n=e.length;let r=0;for(let i=0;i<n;++i)e[i]===t&&++r;return r}),"countChar"),OV=s((t=>{const e=t.trim();let n=e.slice(0,-1),r="arrow_open";switch(e.slice(-1)){case"x":r="arrow_cross",e.startsWith("x")&&(r="double_"+r,n=n.slice(1));break;case">":r="arrow_point",e.startsWith("<")&&(r="double_"+r,n=n.slice(1));break;case"o":r="arrow_circle",e.startsWith("o")&&(r="double_"+r,n=n.slice(1))}let i="normal",a=n.length-1;n.startsWith("=")&&(i="thick"),n.startsWith("~")&&(i="invisible");const s=DV(".",n);return s&&(i="dotted",a=s),{type:r,stroke:i,length:a}}),"destructEndLink"),PV=s(((t,e)=>{const n=OV(t);let r;if(e){if(r=RV(e),r.stroke!==n.stroke)return{type:"INVALID",stroke:"INVALID"};if("arrow_open"===r.type)r.type=n.type;else{if(r.type!==n.type)return{type:"INVALID",stroke:"INVALID"};r.type="double_"+r.type}return"double_arrow"===r.type&&(r.type="double_arrow_point"),r.length=n.length,r}return n}),"destructLink"),BV=s(((t,e)=>{for(const n of t)if(n.nodes.includes(e))return!0;return!1}),"exists"),$V=s(((t,e)=>{const n=[];return t.nodes.forEach(((r,i)=>{BV(e,r)||n.push(t.nodes[i])})),{nodes:n}}),"makeUniq"),FV={firstGraph:MV},zV=s((t=>{if(t.img)return"imageSquare";if(t.icon)return"circle"===t.form?"iconCircle":"square"===t.form?"iconSquare":"rounded"===t.form?"iconRounded":"icon";switch(t.type){case"square":case void 0:return"squareRect";case"round":return"roundedRect";case"ellipse":return"ellipse";default:return t.type}}),"getTypeFromVertex"),UV=s(((t,e)=>t.find((t=>t.id===e))),"findNode"),GV=s((t=>{let e="none",n="arrow_point";switch(t){case"arrow_point":case"arrow_circle":case"arrow_cross":n=t;break;case"double_arrow_point":case"double_arrow_circle":case"double_arrow_cross":e=t.replace("double_",""),n=e}return{arrowTypeStart:e,arrowTypeEnd:n}}),"destructEdgeType"),qV=s(((t,e,n,r,i,a)=>{const s=n.get(t.id),o=r.get(t.id)??!1,l=UV(e,t.id);if(l)l.cssStyles=t.styles,l.cssCompiledStyles=jV(t.classes),l.cssClasses=t.classes.join(" ");else{const n={id:t.id,label:t.text,labelStyle:"",parentId:s,padding:i.flowchart?.padding||8,cssStyles:t.styles,cssCompiledStyles:jV(["default","node",...t.classes]),cssClasses:"default "+t.classes.join(" "),dir:t.dir,domId:t.domId,look:a,link:t.link,linkTarget:t.linkTarget,tooltip:pV(t.id),icon:t.icon,pos:t.pos,img:t.img,assetWidth:t.assetWidth,assetHeight:t.assetHeight,constraint:t.constraint};o?e.push({...n,isGroup:!0,shape:"rect"}):e.push({...n,isGroup:!1,shape:zV(t)})}}),"addNodeFromVertex");function jV(t){let e=[];for(const n of t){const t=HH.get(n);t?.styles&&(e=[...e,...t.styles??[]].map((t=>t.trim()))),t?.textStyles&&(e=[...e,...t.textStyles??[]].map((t=>t.trim())))}return e}s(jV,"getCompiledStyles");var YV=s((()=>{const t=Hn(),e=[],n=[],r=IV(),i=new Map,a=new Map;for(let t=r.length-1;t>=0;t--){const e=r[t];e.nodes.length>0&&a.set(e.id,!0);for(const t of e.nodes)i.set(t,e.id)}for(let n=r.length-1;n>=0;n--){const a=r[n];e.push({id:a.id,label:a.title,labelStyle:"",parentId:i.get(a.id),padding:8,cssCompiledStyles:jV(a.classes),cssClasses:a.classes.join(" "),shape:"rect",dir:a.dir,isGroup:!0,look:t.look})}yV().forEach((n=>{qV(n,e,i,a,t,t.look||"classic")}));const s=vV();return s.forEach(((e,r)=>{const{arrowTypeStart:i,arrowTypeEnd:a}=GV(e.type),o=[...s.defaultStyle??[]];e.style&&o.push(...e.style);const l={id:bk(e.start,e.end,{counter:r,prefix:"L"}),start:e.start,end:e.end,type:e.type??"normal",label:e.text,labelpos:"c",thickness:e.stroke,minlen:e.length,classes:"invisible"===e?.stroke?"":"edge-thickness-normal edge-pattern-solid flowchart-link",arrowTypeStart:"invisible"===e?.stroke?"none":i,arrowTypeEnd:"invisible"===e?.stroke?"none":a,arrowheadStyle:"fill: #333",labelStyle:o,style:o,pattern:e.stroke,look:t.look};n.push(l)})),{nodes:e,edges:n,other:{},config:t}}),"getData"),WV={defaultConfig:s((()=>Xn.flowchart),"defaultConfig"),setAccTitle:Fn,getAccTitle:zn,getAccDescription:Gn,getData:YV,setAccDescription:Un,addVertex:nV,lookUpDomId:eV,addLink:iV,updateLinkInterpolate:aV,updateLink:sV,addClass:oV,setDirection:lV,setClass:cV,setTooltip:hV,getTooltip:pV,setClickEvent:gV,setLink:dV,bindFunctions:fV,getDirection:mV,getVertices:yV,getEdges:vV,getClasses:xV,clear:wV,setGen:kV,defaultStyle:TV,addSubGraph:_V,getDepthFirstPos:LV,indexNodes:NV,getSubGraphs:IV,destructLink:PV,lex:FV,exists:BV,makeUniq:$V,setDiagramTitle:qn,getDiagramTitle:jn},HV=s((function(t,e){return e.db.getClasses()}),"getClasses"),VV=s((async function(t,e,n,r){m.info("REF0:"),m.info("Drawing state diagram (v2)",e);const{securityLevel:i,flowchart:a,layout:s}=Hn();let o;"sandbox"===i&&(o=Oa("#i"+e));const l="sandbox"===i?o.nodes()[0].contentDocument:document;m.debug("Before getData: ");const c=r.db.getData();m.debug("Data: ",c);const h=FH(e,i),u=mV();c.type=r.type,c.layoutAlgorithm=nA(s),"dagre"===c.layoutAlgorithm&&"elk"===s&&m.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."),c.direction=u,c.nodeSpacing=a?.nodeSpacing||50,c.rankSpacing=a?.rankSpacing||50,c.markers=["point","circle","cross"],c.diagramId=e,m.debug("REF1:",c),await eA(c,h);const d=c.config.flowchart?.diagramPadding??8;yk.insertTitle(h,"flowchartTitleText",a?.titleTopMargin||0,r.db.getDiagramTitle()),zH(h,d,"flowchart",a?.useMaxWidth||!1);for(const t of c.nodes){const n=Oa(`#${e} [id="${t.id}"]`);if(!n||!t.link)continue;const r=l.createElementNS("http://www.w3.org/2000/svg","a");r.setAttributeNS("http://www.w3.org/2000/svg","class",t.cssClasses),r.setAttributeNS("http://www.w3.org/2000/svg","rel","noopener"),"sandbox"===i?r.setAttributeNS("http://www.w3.org/2000/svg","target","_top"):t.linkTarget&&r.setAttributeNS("http://www.w3.org/2000/svg","target",t.linkTarget);const a=n.insert((function(){return r}),":first-child"),s=n.select(".label-container");s&&a.append((function(){return s.node()}));const o=n.select(".label");o&&a.append((function(){return o.node()}))}}),"draw"),XV={getClasses:HV,draw:VV},KV=function(){var t=s((function(t,e,n,r){for(n=n||{},r=t.length;r--;n[t[r]]=e);return n}),"o"),e=[1,4],n=[1,3],r=[1,5],i=[1,8,9,10,11,27,34,36,38,44,60,83,84,85,86,87,88,101,104,105,108,110,113,114,115,120,121,122,123],a=[2,2],o=[1,13],l=[1,14],c=[1,15],h=[1,16],u=[1,23],d=[1,25],p=[1,26],g=[1,27],f=[1,49],m=[1,48],y=[1,29],v=[1,30],x=[1,31],b=[1,32],w=[1,33],k=[1,44],T=[1,46],_=[1,42],E=[1,47],C=[1,43],S=[1,50],A=[1,45],L=[1,51],N=[1,52],I=[1,34],M=[1,35],R=[1,36],D=[1,37],O=[1,57],P=[1,8,9,10,11,27,32,34,36,38,44,60,83,84,85,86,87,88,101,104,105,108,110,113,114,115,120,121,122,123],B=[1,61],$=[1,60],F=[1,62],z=[8,9,11,75,77],U=[1,77],G=[1,90],q=[1,95],j=[1,94],Y=[1,91],W=[1,87],H=[1,93],V=[1,89],X=[1,96],K=[1,92],Z=[1,97],Q=[1,88],J=[8,9,10,11,40,75,77],tt=[8,9,10,11,40,46,75,77],et=[8,9,10,11,29,40,44,46,48,50,52,54,56,58,60,63,65,67,68,70,75,77,88,101,104,105,108,110,113,114,115],nt=[8,9,11,44,60,75,77,88,101,104,105,108,110,113,114,115],rt=[44,60,88,101,104,105,108,110,113,114,115],it=[1,123],at=[1,122],st=[1,130],ot=[1,144],lt=[1,145],ct=[1,146],ht=[1,147],ut=[1,132],dt=[1,134],pt=[1,138],gt=[1,139],ft=[1,140],mt=[1,141],yt=[1,142],vt=[1,143],xt=[1,148],bt=[1,149],wt=[1,128],kt=[1,129],Tt=[1,136],_t=[1,131],Et=[1,135],Ct=[1,133],St=[8,9,10,11,27,32,34,36,38,44,60,83,84,85,86,87,88,101,104,105,108,110,113,114,115,120,121,122,123],At=[1,151],Lt=[1,153],Nt=[8,9,11],It=[8,9,10,11,14,44,60,88,104,105,108,110,113,114,115],Mt=[1,173],Rt=[1,169],Dt=[1,170],Ot=[1,174],Pt=[1,171],Bt=[1,172],$t=[77,115,118],Ft=[8,9,10,11,12,14,27,29,32,44,60,75,83,84,85,86,87,88,89,104,108,110,113,114,115],zt=[10,105],Ut=[31,49,51,53,55,57,62,64,66,67,69,71,115,116,117],Gt=[1,242],qt=[1,240],jt=[1,244],Yt=[1,238],Wt=[1,239],Ht=[1,241],Vt=[1,243],Xt=[1,245],Kt=[1,263],Zt=[8,9,11,105],Qt=[8,9,10,11,60,83,104,105,108,109,110,111],Jt={trace:s((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,edgeTextToken:78,STR:79,MD_STR:80,textToken:81,keywords:82,STYLE:83,LINKSTYLE:84,CLASSDEF:85,CLASS:86,CLICK:87,DOWN:88,UP:89,textNoTagsToken:90,stylesOpt:91,"idString[vertex]":92,"idString[class]":93,CALLBACKNAME:94,CALLBACKARGS:95,HREF:96,LINK_TARGET:97,"STR[link]":98,"STR[tooltip]":99,alphaNum:100,DEFAULT:101,numList:102,INTERPOLATE:103,NUM:104,COMMA:105,style:106,styleComponent:107,NODE_STRING:108,UNIT:109,BRKT:110,PCT:111,idStringToken:112,MINUS:113,MULT:114,UNICODE_TEXT:115,TEXT:116,TAGSTART:117,EDGE_TEXT:118,alphaNumToken:119,direction_tb:120,direction_bt:121,direction_rl:122,direction_lr:123,$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",79:"STR",80:"MD_STR",83:"STYLE",84:"LINKSTYLE",85:"CLASSDEF",86:"CLASS",87:"CLICK",88:"DOWN",89:"UP",92:"idString[vertex]",93:"idString[class]",94:"CALLBACKNAME",95:"CALLBACKARGS",96:"HREF",97:"LINK_TARGET",98:"STR[link]",99:"STR[tooltip]",101:"DEFAULT",103:"INTERPOLATE",104:"NUM",105:"COMMA",108:"NODE_STRING",109:"UNIT",110:"BRKT",111:"PCT",113:"MINUS",114:"MULT",115:"UNICODE_TEXT",116:"TEXT",117:"TAGSTART",118:"EDGE_TEXT",120:"direction_tb",121:"direction_bt",122:"direction_rl",123:"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],[76,1],[76,2],[76,1],[76,1],[72,1],[73,3],[30,1],[30,2],[30,1],[30,1],[82,1],[82,1],[82,1],[82,1],[82,1],[82,1],[82,1],[82,1],[82,1],[82,1],[82,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],[102,1],[102,3],[91,1],[91,3],[106,1],[106,2],[107,1],[107,1],[107,1],[107,1],[107,1],[107,1],[107,1],[107,1],[112,1],[112,1],[112,1],[112,1],[112,1],[112,1],[112,1],[112,1],[112,1],[112,1],[112,1],[81,1],[81,1],[81,1],[81,1],[90,1],[90,1],[90,1],[90,1],[90,1],[90,1],[90,1],[90,1],[90,1],[90,1],[90,1],[78,1],[78,1],[119,1],[119,1],[119,1],[119,1],[119,1],[119,1],[119,1],[119,1],[119,1],[119,1],[119,1],[47,1],[47,2],[100,1],[100,2],[33,1],[33,1],[33,1],[33,1]],performAction:s((function(t,e,n,r,i,a,s){var o=a.length-1;switch(i){case 2:case 28:case 29:case 30:case 31:case 32:this.$=[];break;case 3:(!Array.isArray(a[o])||a[o].length>0)&&a[o-1].push(a[o]),this.$=a[o-1];break;case 4:case 181:case 44:case 54:case 76:case 179:this.$=a[o];break;case 11:r.setDirection("TB"),this.$="TB";break;case 12:r.setDirection(a[o-1]),this.$=a[o-1];break;case 27:this.$=a[o-1].nodes;break;case 33:this.$=r.addSubGraph(a[o-6],a[o-1],a[o-4]);break;case 34:this.$=r.addSubGraph(a[o-3],a[o-1],a[o-3]);break;case 35:this.$=r.addSubGraph(void 0,a[o-1],void 0);break;case 37:this.$=a[o].trim(),r.setAccTitle(this.$);break;case 38:case 39:this.$=a[o].trim(),r.setAccDescription(this.$);break;case 43:case 131:this.$=a[o-1]+a[o];break;case 45:r.addVertex(a[o-1][0],void 0,void 0,void 0,void 0,void 0,void 0,a[o]),r.addLink(a[o-3].stmt,a[o-1],a[o-2]),this.$={stmt:a[o-1],nodes:a[o-1].concat(a[o-3].nodes)};break;case 46:r.addLink(a[o-2].stmt,a[o],a[o-1]),this.$={stmt:a[o],nodes:a[o].concat(a[o-2].nodes)};break;case 47:r.addLink(a[o-3].stmt,a[o-1],a[o-2]),this.$={stmt:a[o-1],nodes:a[o-1].concat(a[o-3].nodes)};break;case 48:this.$={stmt:a[o-1],nodes:a[o-1]};break;case 49:r.addVertex(a[o-1][0],void 0,void 0,void 0,void 0,void 0,void 0,a[o]),this.$={stmt:a[o-1],nodes:a[o-1],shapeData:a[o]};break;case 50:this.$={stmt:a[o],nodes:a[o]};break;case 51:case 126:case 128:this.$=[a[o]];break;case 52:r.addVertex(a[o-5][0],void 0,void 0,void 0,void 0,void 0,void 0,a[o-4]),this.$=a[o-5].concat(a[o]);break;case 53:this.$=a[o-4].concat(a[o]);break;case 55:this.$=a[o-2],r.setClass(a[o-2],a[o]);break;case 56:this.$=a[o-3],r.addVertex(a[o-3],a[o-1],"square");break;case 57:this.$=a[o-3],r.addVertex(a[o-3],a[o-1],"doublecircle");break;case 58:this.$=a[o-5],r.addVertex(a[o-5],a[o-2],"circle");break;case 59:this.$=a[o-3],r.addVertex(a[o-3],a[o-1],"ellipse");break;case 60:this.$=a[o-3],r.addVertex(a[o-3],a[o-1],"stadium");break;case 61:this.$=a[o-3],r.addVertex(a[o-3],a[o-1],"subroutine");break;case 62:this.$=a[o-7],r.addVertex(a[o-7],a[o-1],"rect",void 0,void 0,void 0,Object.fromEntries([[a[o-5],a[o-3]]]));break;case 63:this.$=a[o-3],r.addVertex(a[o-3],a[o-1],"cylinder");break;case 64:this.$=a[o-3],r.addVertex(a[o-3],a[o-1],"round");break;case 65:this.$=a[o-3],r.addVertex(a[o-3],a[o-1],"diamond");break;case 66:this.$=a[o-5],r.addVertex(a[o-5],a[o-2],"hexagon");break;case 67:this.$=a[o-3],r.addVertex(a[o-3],a[o-1],"odd");break;case 68:this.$=a[o-3],r.addVertex(a[o-3],a[o-1],"trapezoid");break;case 69:this.$=a[o-3],r.addVertex(a[o-3],a[o-1],"inv_trapezoid");break;case 70:this.$=a[o-3],r.addVertex(a[o-3],a[o-1],"lean_right");break;case 71:this.$=a[o-3],r.addVertex(a[o-3],a[o-1],"lean_left");break;case 72:this.$=a[o],r.addVertex(a[o]);break;case 73:a[o-1].text=a[o],this.$=a[o-1];break;case 74:case 75:a[o-2].text=a[o-1],this.$=a[o-2];break;case 77:var l=r.destructLink(a[o],a[o-2]);this.$={type:l.type,stroke:l.stroke,length:l.length,text:a[o-1]};break;case 78:case 84:case 99:case 101:this.$={text:a[o],type:"text"};break;case 79:case 85:case 100:this.$={text:a[o-1].text+""+a[o],type:a[o-1].type};break;case 80:case 86:this.$={text:a[o],type:"string"};break;case 81:case 87:case 102:this.$={text:a[o],type:"markdown"};break;case 82:l=r.destructLink(a[o]);this.$={type:l.type,stroke:l.stroke,length:l.length};break;case 83:this.$=a[o-1];break;case 103:this.$=a[o-4],r.addClass(a[o-2],a[o]);break;case 104:this.$=a[o-4],r.setClass(a[o-2],a[o]);break;case 105:case 113:this.$=a[o-1],r.setClickEvent(a[o-1],a[o]);break;case 106:case 114:this.$=a[o-3],r.setClickEvent(a[o-3],a[o-2]),r.setTooltip(a[o-3],a[o]);break;case 107:this.$=a[o-2],r.setClickEvent(a[o-2],a[o-1],a[o]);break;case 108:this.$=a[o-4],r.setClickEvent(a[o-4],a[o-3],a[o-2]),r.setTooltip(a[o-4],a[o]);break;case 109:this.$=a[o-2],r.setLink(a[o-2],a[o]);break;case 110:this.$=a[o-4],r.setLink(a[o-4],a[o-2]),r.setTooltip(a[o-4],a[o]);break;case 111:this.$=a[o-4],r.setLink(a[o-4],a[o-2],a[o]);break;case 112:this.$=a[o-6],r.setLink(a[o-6],a[o-4],a[o]),r.setTooltip(a[o-6],a[o-2]);break;case 115:this.$=a[o-1],r.setLink(a[o-1],a[o]);break;case 116:this.$=a[o-3],r.setLink(a[o-3],a[o-2]),r.setTooltip(a[o-3],a[o]);break;case 117:this.$=a[o-3],r.setLink(a[o-3],a[o-2],a[o]);break;case 118:this.$=a[o-5],r.setLink(a[o-5],a[o-4],a[o]),r.setTooltip(a[o-5],a[o-2]);break;case 119:this.$=a[o-4],r.addVertex(a[o-2],void 0,void 0,a[o]);break;case 120:this.$=a[o-4],r.updateLink([a[o-2]],a[o]);break;case 121:this.$=a[o-4],r.updateLink(a[o-2],a[o]);break;case 122:this.$=a[o-8],r.updateLinkInterpolate([a[o-6]],a[o-2]),r.updateLink([a[o-6]],a[o]);break;case 123:this.$=a[o-8],r.updateLinkInterpolate(a[o-6],a[o-2]),r.updateLink(a[o-6],a[o]);break;case 124:this.$=a[o-6],r.updateLinkInterpolate([a[o-4]],a[o]);break;case 125:this.$=a[o-6],r.updateLinkInterpolate(a[o-4],a[o]);break;case 127:case 129:a[o-2].push(a[o]),this.$=a[o-2];break;case 180:case 182:this.$=a[o-1]+""+a[o];break;case 183:this.$={stmt:"dir",value:"TB"};break;case 184:this.$={stmt:"dir",value:"BT"};break;case 185:this.$={stmt:"dir",value:"RL"};break;case 186:this.$={stmt:"dir",value:"LR"}}}),"anonymous"),table:[{3:1,4:2,9:e,10:n,12:r},{1:[3]},t(i,a,{5:6}),{4:7,9:e,10:n,12:r},{4:8,9:e,10:n,12:r},{13:[1,9],14:[1,10]},{1:[2,1],6:11,7:12,8:o,9:l,10:c,11:h,20:17,22:18,23:19,24:20,25:21,26:22,27:u,33:24,34:d,36:p,38:g,42:28,43:38,44:f,45:39,47:40,60:m,83:y,84:v,85:x,86:b,87:w,88:k,101:T,104:_,105:E,108:C,110:S,112:41,113:A,114:L,115:N,120:I,121:M,122:R,123:D},t(i,[2,9]),t(i,[2,10]),t(i,[2,11]),{8:[1,54],9:[1,55],10:O,15:53,18:56},t(P,[2,3]),t(P,[2,4]),t(P,[2,5]),t(P,[2,6]),t(P,[2,7]),t(P,[2,8]),{8:B,9:$,11:F,21:58,41:59,72:63,75:[1,64],77:[1,65]},{8:B,9:$,11:F,21:66},{8:B,9:$,11:F,21:67},{8:B,9:$,11:F,21:68},{8:B,9:$,11:F,21:69},{8:B,9:$,11:F,21:70},{8:B,9:$,10:[1,71],11:F,21:72},t(P,[2,36]),{35:[1,73]},{37:[1,74]},t(P,[2,39]),t(z,[2,50],{18:75,39:76,10:O,40:U}),{10:[1,78]},{10:[1,79]},{10:[1,80]},{10:[1,81]},{14:G,44:q,60:j,79:[1,85],88:Y,94:[1,82],96:[1,83],100:84,104:W,105:H,108:V,110:X,113:K,114:Z,115:Q,119:86},t(P,[2,183]),t(P,[2,184]),t(P,[2,185]),t(P,[2,186]),t(J,[2,51]),t(J,[2,54],{46:[1,98]}),t(tt,[2,72],{112:111,29:[1,99],44:f,48:[1,100],50:[1,101],52:[1,102],54:[1,103],56:[1,104],58:[1,105],60:m,63:[1,106],65:[1,107],67:[1,108],68:[1,109],70:[1,110],88:k,101:T,104:_,105:E,108:C,110:S,113:A,114:L,115:N}),t(et,[2,179]),t(et,[2,140]),t(et,[2,141]),t(et,[2,142]),t(et,[2,143]),t(et,[2,144]),t(et,[2,145]),t(et,[2,146]),t(et,[2,147]),t(et,[2,148]),t(et,[2,149]),t(et,[2,150]),t(i,[2,12]),t(i,[2,18]),t(i,[2,19]),{9:[1,112]},t(nt,[2,26],{18:113,10:O}),t(P,[2,27]),{42:114,43:38,44:f,45:39,47:40,60:m,88:k,101:T,104:_,105:E,108:C,110:S,112:41,113:A,114:L,115:N},t(P,[2,40]),t(P,[2,41]),t(P,[2,42]),t(rt,[2,76],{73:115,62:[1,117],74:[1,116]}),{76:118,78:119,79:[1,120],80:[1,121],115:it,118:at},t([44,60,62,74,88,101,104,105,108,110,113,114,115],[2,82]),t(P,[2,28]),t(P,[2,29]),t(P,[2,30]),t(P,[2,31]),t(P,[2,32]),{10:st,12:ot,14:lt,27:ct,28:124,32:ht,44:ut,60:dt,75:pt,79:[1,126],80:[1,127],82:137,83:gt,84:ft,85:mt,86:yt,87:vt,88:xt,89:bt,90:125,104:wt,108:kt,110:Tt,113:_t,114:Et,115:Ct},t(St,a,{5:150}),t(P,[2,37]),t(P,[2,38]),t(z,[2,48],{44:At}),t(z,[2,49],{18:152,10:O,40:Lt}),t(J,[2,44]),{44:f,47:154,60:m,88:k,101:T,104:_,105:E,108:C,110:S,112:41,113:A,114:L,115:N},{101:[1,155],102:156,104:[1,157]},{44:f,47:158,60:m,88:k,101:T,104:_,105:E,108:C,110:S,112:41,113:A,114:L,115:N},{44:f,47:159,60:m,88:k,101:T,104:_,105:E,108:C,110:S,112:41,113:A,114:L,115:N},t(Nt,[2,105],{10:[1,160],95:[1,161]}),{79:[1,162]},t(Nt,[2,113],{119:164,10:[1,163],14:G,44:q,60:j,88:Y,104:W,105:H,108:V,110:X,113:K,114:Z,115:Q}),t(Nt,[2,115],{10:[1,165]}),t(It,[2,181]),t(It,[2,168]),t(It,[2,169]),t(It,[2,170]),t(It,[2,171]),t(It,[2,172]),t(It,[2,173]),t(It,[2,174]),t(It,[2,175]),t(It,[2,176]),t(It,[2,177]),t(It,[2,178]),{44:f,47:166,60:m,88:k,101:T,104:_,105:E,108:C,110:S,112:41,113:A,114:L,115:N},{30:167,67:Mt,79:Rt,80:Dt,81:168,115:Ot,116:Pt,117:Bt},{30:175,67:Mt,79:Rt,80:Dt,81:168,115:Ot,116:Pt,117:Bt},{30:177,50:[1,176],67:Mt,79:Rt,80:Dt,81:168,115:Ot,116:Pt,117:Bt},{30:178,67:Mt,79:Rt,80:Dt,81:168,115:Ot,116:Pt,117:Bt},{30:179,67:Mt,79:Rt,80:Dt,81:168,115:Ot,116:Pt,117:Bt},{30:180,67:Mt,79:Rt,80:Dt,81:168,115:Ot,116:Pt,117:Bt},{108:[1,181]},{30:182,67:Mt,79:Rt,80:Dt,81:168,115:Ot,116:Pt,117:Bt},{30:183,65:[1,184],67:Mt,79:Rt,80:Dt,81:168,115:Ot,116:Pt,117:Bt},{30:185,67:Mt,79:Rt,80:Dt,81:168,115:Ot,116:Pt,117:Bt},{30:186,67:Mt,79:Rt,80:Dt,81:168,115:Ot,116:Pt,117:Bt},{30:187,67:Mt,79:Rt,80:Dt,81:168,115:Ot,116:Pt,117:Bt},t(et,[2,180]),t(i,[2,20]),t(nt,[2,25]),t(z,[2,46],{39:188,18:189,10:O,40:U}),t(rt,[2,73],{10:[1,190]}),{10:[1,191]},{30:192,67:Mt,79:Rt,80:Dt,81:168,115:Ot,116:Pt,117:Bt},{77:[1,193],78:194,115:it,118:at},t($t,[2,78]),t($t,[2,80]),t($t,[2,81]),t($t,[2,166]),t($t,[2,167]),{8:B,9:$,10:st,11:F,12:ot,14:lt,21:196,27:ct,29:[1,195],32:ht,44:ut,60:dt,75:pt,82:137,83:gt,84:ft,85:mt,86:yt,87:vt,88:xt,89:bt,90:197,104:wt,108:kt,110:Tt,113:_t,114:Et,115:Ct},t(Ft,[2,99]),t(Ft,[2,101]),t(Ft,[2,102]),t(Ft,[2,155]),t(Ft,[2,156]),t(Ft,[2,157]),t(Ft,[2,158]),t(Ft,[2,159]),t(Ft,[2,160]),t(Ft,[2,161]),t(Ft,[2,162]),t(Ft,[2,163]),t(Ft,[2,164]),t(Ft,[2,165]),t(Ft,[2,88]),t(Ft,[2,89]),t(Ft,[2,90]),t(Ft,[2,91]),t(Ft,[2,92]),t(Ft,[2,93]),t(Ft,[2,94]),t(Ft,[2,95]),t(Ft,[2,96]),t(Ft,[2,97]),t(Ft,[2,98]),{6:11,7:12,8:o,9:l,10:c,11:h,20:17,22:18,23:19,24:20,25:21,26:22,27:u,32:[1,198],33:24,34:d,36:p,38:g,42:28,43:38,44:f,45:39,47:40,60:m,83:y,84:v,85:x,86:b,87:w,88:k,101:T,104:_,105:E,108:C,110:S,112:41,113:A,114:L,115:N,120:I,121:M,122:R,123:D},{10:O,18:199},{44:[1,200]},t(J,[2,43]),{10:[1,201],44:f,60:m,88:k,101:T,104:_,105:E,108:C,110:S,112:111,113:A,114:L,115:N},{10:[1,202]},{10:[1,203],105:[1,204]},t(zt,[2,126]),{10:[1,205],44:f,60:m,88:k,101:T,104:_,105:E,108:C,110:S,112:111,113:A,114:L,115:N},{10:[1,206],44:f,60:m,88:k,101:T,104:_,105:E,108:C,110:S,112:111,113:A,114:L,115:N},{79:[1,207]},t(Nt,[2,107],{10:[1,208]}),t(Nt,[2,109],{10:[1,209]}),{79:[1,210]},t(It,[2,182]),{79:[1,211],97:[1,212]},t(J,[2,55],{112:111,44:f,60:m,88:k,101:T,104:_,105:E,108:C,110:S,113:A,114:L,115:N}),{31:[1,213],67:Mt,81:214,115:Ot,116:Pt,117:Bt},t(Ut,[2,84]),t(Ut,[2,86]),t(Ut,[2,87]),t(Ut,[2,151]),t(Ut,[2,152]),t(Ut,[2,153]),t(Ut,[2,154]),{49:[1,215],67:Mt,81:214,115:Ot,116:Pt,117:Bt},{30:216,67:Mt,79:Rt,80:Dt,81:168,115:Ot,116:Pt,117:Bt},{51:[1,217],67:Mt,81:214,115:Ot,116:Pt,117:Bt},{53:[1,218],67:Mt,81:214,115:Ot,116:Pt,117:Bt},{55:[1,219],67:Mt,81:214,115:Ot,116:Pt,117:Bt},{57:[1,220],67:Mt,81:214,115:Ot,116:Pt,117:Bt},{60:[1,221]},{64:[1,222],67:Mt,81:214,115:Ot,116:Pt,117:Bt},{66:[1,223],67:Mt,81:214,115:Ot,116:Pt,117:Bt},{30:224,67:Mt,79:Rt,80:Dt,81:168,115:Ot,116:Pt,117:Bt},{31:[1,225],67:Mt,81:214,115:Ot,116:Pt,117:Bt},{67:Mt,69:[1,226],71:[1,227],81:214,115:Ot,116:Pt,117:Bt},{67:Mt,69:[1,229],71:[1,228],81:214,115:Ot,116:Pt,117:Bt},t(z,[2,45],{18:152,10:O,40:Lt}),t(z,[2,47],{44:At}),t(rt,[2,75]),t(rt,[2,74]),{62:[1,230],67:Mt,81:214,115:Ot,116:Pt,117:Bt},t(rt,[2,77]),t($t,[2,79]),{30:231,67:Mt,79:Rt,80:Dt,81:168,115:Ot,116:Pt,117:Bt},t(St,a,{5:232}),t(Ft,[2,100]),t(P,[2,35]),{43:233,44:f,45:39,47:40,60:m,88:k,101:T,104:_,105:E,108:C,110:S,112:41,113:A,114:L,115:N},{10:O,18:234},{10:Gt,60:qt,83:jt,91:235,104:Yt,106:236,107:237,108:Wt,109:Ht,110:Vt,111:Xt},{10:Gt,60:qt,83:jt,91:246,103:[1,247],104:Yt,106:236,107:237,108:Wt,109:Ht,110:Vt,111:Xt},{10:Gt,60:qt,83:jt,91:248,103:[1,249],104:Yt,106:236,107:237,108:Wt,109:Ht,110:Vt,111:Xt},{104:[1,250]},{10:Gt,60:qt,83:jt,91:251,104:Yt,106:236,107:237,108:Wt,109:Ht,110:Vt,111:Xt},{44:f,47:252,60:m,88:k,101:T,104:_,105:E,108:C,110:S,112:41,113:A,114:L,115:N},t(Nt,[2,106]),{79:[1,253]},{79:[1,254],97:[1,255]},t(Nt,[2,114]),t(Nt,[2,116],{10:[1,256]}),t(Nt,[2,117]),t(tt,[2,56]),t(Ut,[2,85]),t(tt,[2,57]),{51:[1,257],67:Mt,81:214,115:Ot,116:Pt,117:Bt},t(tt,[2,64]),t(tt,[2,59]),t(tt,[2,60]),t(tt,[2,61]),{108:[1,258]},t(tt,[2,63]),t(tt,[2,65]),{66:[1,259],67:Mt,81:214,115:Ot,116:Pt,117:Bt},t(tt,[2,67]),t(tt,[2,68]),t(tt,[2,70]),t(tt,[2,69]),t(tt,[2,71]),t([10,44,60,88,101,104,105,108,110,113,114,115],[2,83]),{31:[1,260],67:Mt,81:214,115:Ot,116:Pt,117:Bt},{6:11,7:12,8:o,9:l,10:c,11:h,20:17,22:18,23:19,24:20,25:21,26:22,27:u,32:[1,261],33:24,34:d,36:p,38:g,42:28,43:38,44:f,45:39,47:40,60:m,83:y,84:v,85:x,86:b,87:w,88:k,101:T,104:_,105:E,108:C,110:S,112:41,113:A,114:L,115:N,120:I,121:M,122:R,123:D},t(J,[2,53]),{43:262,44:f,45:39,47:40,60:m,88:k,101:T,104:_,105:E,108:C,110:S,112:41,113:A,114:L,115:N},t(Nt,[2,119],{105:Kt}),t(Zt,[2,128],{107:264,10:Gt,60:qt,83:jt,104:Yt,108:Wt,109:Ht,110:Vt,111:Xt}),t(Qt,[2,130]),t(Qt,[2,132]),t(Qt,[2,133]),t(Qt,[2,134]),t(Qt,[2,135]),t(Qt,[2,136]),t(Qt,[2,137]),t(Qt,[2,138]),t(Qt,[2,139]),t(Nt,[2,120],{105:Kt}),{10:[1,265]},t(Nt,[2,121],{105:Kt}),{10:[1,266]},t(zt,[2,127]),t(Nt,[2,103],{105:Kt}),t(Nt,[2,104],{112:111,44:f,60:m,88:k,101:T,104:_,105:E,108:C,110:S,113:A,114:L,115:N}),t(Nt,[2,108]),t(Nt,[2,110],{10:[1,267]}),t(Nt,[2,111]),{97:[1,268]},{51:[1,269]},{62:[1,270]},{66:[1,271]},{8:B,9:$,11:F,21:272},t(P,[2,34]),t(J,[2,52]),{10:Gt,60:qt,83:jt,104:Yt,106:273,107:237,108:Wt,109:Ht,110:Vt,111:Xt},t(Qt,[2,131]),{14:G,44:q,60:j,88:Y,100:274,104:W,105:H,108:V,110:X,113:K,114:Z,115:Q,119:86},{14:G,44:q,60:j,88:Y,100:275,104:W,105:H,108:V,110:X,113:K,114:Z,115:Q,119:86},{97:[1,276]},t(Nt,[2,118]),t(tt,[2,58]),{30:277,67:Mt,79:Rt,80:Dt,81:168,115:Ot,116:Pt,117:Bt},t(tt,[2,66]),t(St,a,{5:278}),t(Zt,[2,129],{107:264,10:Gt,60:qt,83:jt,104:Yt,108:Wt,109:Ht,110:Vt,111:Xt}),t(Nt,[2,124],{119:164,10:[1,279],14:G,44:q,60:j,88:Y,104:W,105:H,108:V,110:X,113:K,114:Z,115:Q}),t(Nt,[2,125],{119:164,10:[1,280],14:G,44:q,60:j,88:Y,104:W,105:H,108:V,110:X,113:K,114:Z,115:Q}),t(Nt,[2,112]),{31:[1,281],67:Mt,81:214,115:Ot,116:Pt,117:Bt},{6:11,7:12,8:o,9:l,10:c,11:h,20:17,22:18,23:19,24:20,25:21,26:22,27:u,32:[1,282],33:24,34:d,36:p,38:g,42:28,43:38,44:f,45:39,47:40,60:m,83:y,84:v,85:x,86:b,87:w,88:k,101:T,104:_,105:E,108:C,110:S,112:41,113:A,114:L,115:N,120:I,121:M,122:R,123:D},{10:Gt,60:qt,83:jt,91:283,104:Yt,106:236,107:237,108:Wt,109:Ht,110:Vt,111:Xt},{10:Gt,60:qt,83:jt,91:284,104:Yt,106:236,107:237,108:Wt,109:Ht,110:Vt,111:Xt},t(tt,[2,62]),t(P,[2,33]),t(Nt,[2,122],{105:Kt}),t(Nt,[2,123],{105:Kt})],defaultActions:{},parseError:s((function(t,e){if(!e.recoverable){var n=new Error(t);throw n.hash=e,n}this.trace(t)}),"parseError"),parse:s((function(t){var e=this,n=[0],r=[],i=[null],a=[],o=this.table,l="",c=0,h=0,u=2,d=1,p=a.slice.call(arguments,1),g=Object.create(this.lexer),f={yy:{}};for(var m in this.yy)Object.prototype.hasOwnProperty.call(this.yy,m)&&(f.yy[m]=this.yy[m]);g.setInput(t,f.yy),f.yy.lexer=g,f.yy.parser=this,void 0===g.yylloc&&(g.yylloc={});var y=g.yylloc;a.push(y);var v=g.options&&g.options.ranges;function x(t){n.length=n.length-2*t,i.length=i.length-t,a.length=a.length-t}function b(){var t;return"number"!=typeof(t=r.pop()||g.lex()||d)&&(t instanceof Array&&(t=(r=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof f.yy.parseError?this.parseError=f.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,s(x,"popStack"),s(b,"lex");for(var w,k,T,_,E,C,S,A,L={};;){if(k=n[n.length-1],this.defaultActions[k]?T=this.defaultActions[k]:(null==w&&(w=b()),T=o[k]&&o[k][w]),void 0===T||!T.length||!T[0]){var N="";for(E in A=[],o[k])this.terminals_[E]&&E>u&&A.push("'"+this.terminals_[E]+"'");N=g.showPosition?"Parse error on line "+(c+1)+":\n"+g.showPosition()+"\nExpecting "+A.join(", ")+", got '"+(this.terminals_[w]||w)+"'":"Parse error on line "+(c+1)+": Unexpected "+(w==d?"end of input":"'"+(this.terminals_[w]||w)+"'"),this.parseError(N,{text:g.match,token:this.terminals_[w]||w,line:g.yylineno,loc:y,expected:A})}if(T[0]instanceof Array&&T.length>1)throw new Error("Parse Error: multiple actions possible at state: "+k+", token: "+w);switch(T[0]){case 1:n.push(w),i.push(g.yytext),a.push(g.yylloc),n.push(T[1]),w=null,h=g.yyleng,l=g.yytext,c=g.yylineno,y=g.yylloc;break;case 2:if(C=this.productions_[T[1]][1],L.$=i[i.length-C],L._$={first_line:a[a.length-(C||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(C||1)].first_column,last_column:a[a.length-1].last_column},v&&(L._$.range=[a[a.length-(C||1)].range[0],a[a.length-1].range[1]]),void 0!==(_=this.performAction.apply(L,[l,h,c,f.yy,T[1],i,a].concat(p))))return _;C&&(n=n.slice(0,-1*C*2),i=i.slice(0,-1*C),a=a.slice(0,-1*C)),n.push(this.productions_[T[1]][0]),i.push(L.$),a.push(L._$),S=o[n[n.length-2]][n[n.length-1]],n.push(S);break;case 3:return!0}}return!0}),"parse")},te=function(){var t={EOF:1,parseError:s((function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)}),"parseError"),setInput:s((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:s((function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(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:s((function(t){var e=t.length,n=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 r=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 i=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===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this}),"unput"),more:s((function(){return this._more=!0,this}),"more"),reject:s((function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):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).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}),"reject"),less:s((function(t){this.unput(this.match.slice(t))}),"less"),pastInput:s((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:s((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:s((function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"}),"showPosition"),test_match:s((function(t,e){var n,r,i;if(this.options.backtrack_lexer&&(i={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&&(i.yylloc.range=this.yylloc.range.slice(0))),(r=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.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],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1}),"test_match"),next:s((function(){if(this.done)return this.EOF;var t,e,n,r;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;a<i.length;a++)if((n=this._input.match(this.rules[i[a]]))&&(!e||n[0].length>e[0].length)){if(e=n,r=a,this.options.backtrack_lexer){if(!1!==(t=this.test_match(n,i[a])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,i[r]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}),"next"),lex:s((function(){var t=this.next();return t||this.lex()}),"lex"),begin:s((function(t){this.conditionStack.push(t)}),"begin"),popState:s((function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]}),"popState"),_currentRules:s((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:s((function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"}),"topState"),pushState:s((function(t){this.begin(t)}),"pushState"),stateStackSize:s((function(){return this.conditionStack.length}),"stateStackSize"),options:{},performAction:s((function(t,e,n,r){switch(n){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:case 12:case 14:case 17:case 20:case 23:case 33:this.popState();break;case 6:return"acc_descr_multiline_value";case 7:return this.pushState("shapeData"),e.yytext="",40;case 8:return this.pushState("shapeDataStr"),40;case 9:return this.popState(),40;case 10:const n=/\n\s*/g;return e.yytext=e.yytext.replace(n,"<br/>"),40;case 11:return 40;case 13:this.begin("callbackname");break;case 15:this.popState(),this.begin("callbackargs");break;case 16:return 94;case 18:return 95;case 19:return"MD_STR";case 21:this.begin("md_string");break;case 22:return"STR";case 24:this.pushState("string");break;case 25:return 83;case 26:return 101;case 27:return 84;case 28:return 103;case 29:return 85;case 30:return 86;case 31:return 96;case 32:this.begin("click");break;case 34:return 87;case 35:case 36:case 37:return t.lex.firstGraph()&&this.begin("dir"),12;case 38:return 27;case 39:return 32;case 40:case 41:case 42:case 43:return 97;case 44:return this.popState(),13;case 45:case 46:case 47:case 48:case 49:case 50:case 51:case 52:case 53:case 54:return this.popState(),14;case 55:return 120;case 56:return 121;case 57:return 122;case 58:return 123;case 59:return 104;case 60:case 101:return 110;case 61:return 46;case 62:return 60;case 63:case 102:return 44;case 64:return 8;case 65:return 105;case 66:case 100:return 114;case 67:case 70:case 73:return this.popState(),77;case 68:return this.pushState("edgeText"),75;case 69:case 72:case 75:return 118;case 71:return this.pushState("thickEdgeText"),75;case 74:return this.pushState("dottedEdgeText"),75;case 76:return 77;case 77:return this.popState(),53;case 78:case 114:return"TEXT";case 79:return this.pushState("ellipseText"),52;case 80:return this.popState(),55;case 81:return this.pushState("text"),54;case 82:return this.popState(),57;case 83:return this.pushState("text"),56;case 84:return 58;case 85:return this.pushState("text"),67;case 86:return this.popState(),64;case 87:return this.pushState("text"),63;case 88:return this.popState(),49;case 89:return this.pushState("text"),48;case 90:return this.popState(),69;case 91:return this.popState(),71;case 92:return 116;case 93:return this.pushState("trapText"),68;case 94:return this.pushState("trapText"),70;case 95:return 117;case 96:return 67;case 97:return 89;case 98:return"SEP";case 99:return 88;case 103:return 108;case 104:return 113;case 105:return 115;case 106:return this.popState(),62;case 107:return this.pushState("text"),62;case 108:return this.popState(),51;case 109:return this.pushState("text"),50;case 110:return this.popState(),31;case 111:return this.pushState("text"),29;case 112:return this.popState(),66;case 113:return this.pushState("text"),65;case 115:return"QUOTE";case 116:return 9;case 117:return 10;case 118: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]*)/,/^(?:[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,76,79,81,83,87,89,93,94,107,109,111,113],inclusive:!1},shapeDataStr:{rules:[9,10,21,24,76,79,81,83,87,89,93,94,107,109,111,113],inclusive:!1},shapeData:{rules:[8,11,12,21,24,76,79,81,83,87,89,93,94,107,109,111,113],inclusive:!1},callbackargs:{rules:[17,18,21,24,76,79,81,83,87,89,93,94,107,109,111,113],inclusive:!1},callbackname:{rules:[14,15,16,21,24,76,79,81,83,87,89,93,94,107,109,111,113],inclusive:!1},href:{rules:[21,24,76,79,81,83,87,89,93,94,107,109,111,113],inclusive:!1},click:{rules:[21,24,33,34,76,79,81,83,87,89,93,94,107,109,111,113],inclusive:!1},dottedEdgeText:{rules:[21,24,73,75,76,79,81,83,87,89,93,94,107,109,111,113],inclusive:!1},thickEdgeText:{rules:[21,24,70,72,76,79,81,83,87,89,93,94,107,109,111,113],inclusive:!1},edgeText:{rules:[21,24,67,69,76,79,81,83,87,89,93,94,107,109,111,113],inclusive:!1},trapText:{rules:[21,24,76,79,81,83,87,89,90,91,92,93,94,107,109,111,113],inclusive:!1},ellipseText:{rules:[21,24,76,77,78,79,81,83,87,89,93,94,107,109,111,113],inclusive:!1},text:{rules:[21,24,76,79,80,81,82,83,86,87,88,89,93,94,106,107,108,109,110,111,112,113,114],inclusive:!1},vertex:{rules:[21,24,76,79,81,83,87,89,93,94,107,109,111,113],inclusive:!1},dir:{rules:[21,24,44,45,46,47,48,49,50,51,52,53,54,76,79,81,83,87,89,93,94,107,109,111,113],inclusive:!1},acc_descr_multiline:{rules:[5,6,21,24,76,79,81,83,87,89,93,94,107,109,111,113],inclusive:!1},acc_descr:{rules:[3,21,24,76,79,81,83,87,89,93,94,107,109,111,113],inclusive:!1},acc_title:{rules:[1,21,24,76,79,81,83,87,89,93,94,107,109,111,113],inclusive:!1},md_string:{rules:[19,20,21,24,76,79,81,83,87,89,93,94,107,109,111,113],inclusive:!1},string:{rules:[21,22,23,24,76,79,81,83,87,89,93,94,107,109,111,113],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,70,71,73,74,76,79,81,83,84,85,87,89,93,94,95,96,97,98,99,100,101,102,103,104,105,107,109,111,113,115,116,117,118],inclusive:!0}}};return t}();function ee(){this.yy={}}return Jt.lexer=te,s(ee,"Parser"),ee.prototype=Jt,Jt.Parser=ee,new ee}();KV.parser=KV;var ZV=KV,QV=s(((t,e)=>{const n=J,r=n(t,"r"),i=n(t,"g"),a=n(t,"b");return Q(r,i,a,e)}),"fade"),JV={parser:ZV,db:WV,renderer:XV,styles:s((t=>`.label {\n font-family: ${t.fontFamily};\n color: ${t.nodeTextColor||t.textColor};\n }\n .cluster-label text {\n fill: ${t.titleColor};\n }\n .cluster-label span {\n color: ${t.titleColor};\n }\n .cluster-label span p {\n background-color: transparent;\n }\n\n .label text,span {\n fill: ${t.nodeTextColor||t.textColor};\n color: ${t.nodeTextColor||t.textColor};\n }\n\n .node rect,\n .node circle,\n .node ellipse,\n .node polygon,\n .node path {\n fill: ${t.mainBkg};\n stroke: ${t.nodeBorder};\n stroke-width: 1px;\n }\n .rough-node .label text , .node .label text, .image-shape .label, .icon-shape .label {\n text-anchor: middle;\n }\n // .flowchart-label .text-outer-tspan {\n // text-anchor: middle;\n // }\n // .flowchart-label .text-inner-tspan {\n // text-anchor: start;\n // }\n\n .node .katex path {\n fill: #000;\n stroke: #000;\n stroke-width: 1px;\n }\n\n .rough-node .label,.node .label, .image-shape .label, .icon-shape .label {\n text-align: center;\n }\n .node.clickable {\n cursor: pointer;\n }\n\n\n .root .anchor path {\n fill: ${t.lineColor} !important;\n stroke-width: 0;\n stroke: ${t.lineColor};\n }\n\n .arrowheadPath {\n fill: ${t.arrowheadColor};\n }\n\n .edgePath .path {\n stroke: ${t.lineColor};\n stroke-width: 2.0px;\n }\n\n .flowchart-link {\n stroke: ${t.lineColor};\n fill: none;\n }\n\n .edgeLabel {\n background-color: ${t.edgeLabelBackground};\n p {\n background-color: ${t.edgeLabelBackground};\n }\n rect {\n opacity: 0.5;\n background-color: ${t.edgeLabelBackground};\n fill: ${t.edgeLabelBackground};\n }\n text-align: center;\n }\n\n /* For html labels only */\n .labelBkg {\n background-color: ${QV(t.edgeLabelBackground,.5)};\n // background-color:\n }\n\n .cluster rect {\n fill: ${t.clusterBkg};\n stroke: ${t.clusterBorder};\n stroke-width: 1px;\n }\n\n .cluster text {\n fill: ${t.titleColor};\n }\n\n .cluster span {\n color: ${t.titleColor};\n }\n /* .cluster div {\n color: ${t.titleColor};\n } */\n\n div.mermaidTooltip {\n position: absolute;\n text-align: center;\n max-width: 200px;\n padding: 2px;\n font-family: ${t.fontFamily};\n font-size: 12px;\n background: ${t.tertiaryColor};\n border: 1px solid ${t.border2};\n border-radius: 2px;\n pointer-events: none;\n z-index: 100;\n }\n\n .flowchartTitleText {\n text-anchor: middle;\n font-size: 18px;\n fill: ${t.textColor};\n }\n\n rect.text {\n fill: none;\n stroke-width: 0;\n }\n\n .icon-shape, .image-shape {\n background-color: ${t.edgeLabelBackground};\n p {\n background-color: ${t.edgeLabelBackground};\n padding: 2px;\n }\n rect {\n opacity: 0.5;\n background-color: ${t.edgeLabelBackground};\n fill: ${t.edgeLabelBackground};\n }\n text-align: center;\n }\n`),"getStyles"),init:s((t=>{t.flowchart||(t.flowchart={}),t.layout&&Vn({layout:t.layout}),t.flowchart.arrowMarkerAbsolute=t.arrowMarkerAbsolute,Vn({flowchart:{arrowMarkerAbsolute:t.arrowMarkerAbsolute}}),WV.clear(),WV.setGen("gen-2")}),"init")},tX=Object.freeze({__proto__:null,diagram:JV}),eX=function(){var t=s((function(t,e,n,r){for(n=n||{},r=t.length;r--;n[t[r]]=e);return n}),"o"),e=[6,8,10,20,22,24,26,27,28],n=[1,10],r=[1,11],i=[1,12],a=[1,13],o=[1,14],l=[1,15],c=[1,21],h=[1,22],u=[1,23],d=[1,24],p=[1,25],g=[6,8,10,13,15,18,19,20,22,24,26,27,28,41,42,43,44,45],f=[1,34],m=[27,28,46,47],y=[41,42,43,44,45],v=[17,34],x=[1,54],b=[1,53],w=[17,34,36,38],k={trace:s((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,":":13,role:14,BLOCK_START:15,attributes:16,BLOCK_STOP:17,SQS:18,SQE:19,title:20,title_value:21,acc_title:22,acc_title_value:23,acc_descr:24,acc_descr_value:25,acc_descr_multiline_value:26,ALPHANUM:27,ENTITY_NAME:28,attribute:29,attributeType:30,attributeName:31,attributeKeyTypeList:32,attributeComment:33,ATTRIBUTE_WORD:34,attributeKeyType:35,COMMA:36,ATTRIBUTE_KEY:37,COMMENT:38,cardinality:39,relType:40,ZERO_OR_ONE:41,ZERO_OR_MORE:42,ONE_OR_MORE:43,ONLY_ONE:44,MD_PARENT:45,NON_IDENTIFYING:46,IDENTIFYING:47,WORD:48,$accept:0,$end:1},terminals_:{2:"error",4:"ER_DIAGRAM",6:"EOF",8:"SPACE",10:"NEWLINE",13:":",15:"BLOCK_START",17:"BLOCK_STOP",18:"SQS",19:"SQE",20:"title",21:"title_value",22:"acc_title",23:"acc_title_value",24:"acc_descr",25:"acc_descr_value",26:"acc_descr_multiline_value",27:"ALPHANUM",28:"ENTITY_NAME",34:"ATTRIBUTE_WORD",36:"COMMA",37:"ATTRIBUTE_KEY",38:"COMMENT",41:"ZERO_OR_ONE",42:"ZERO_OR_MORE",43:"ONE_OR_MORE",44:"ONLY_ONE",45:"MD_PARENT",46:"NON_IDENTIFYING",47:"IDENTIFYING",48:"WORD"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,5],[9,4],[9,3],[9,1],[9,7],[9,6],[9,4],[9,2],[9,2],[9,2],[9,1],[11,1],[11,1],[16,1],[16,2],[29,2],[29,3],[29,3],[29,4],[30,1],[31,1],[32,1],[32,3],[35,1],[33,1],[12,3],[39,1],[39,1],[39,1],[39,1],[39,1],[40,1],[40,1],[14,1],[14,1],[14,1]],performAction:s((function(t,e,n,r,i,a,s){var o=a.length-1;switch(i){case 1:break;case 2:case 6:case 7:this.$=[];break;case 3:a[o-1].push(a[o]),this.$=a[o-1];break;case 4:case 5:case 19:case 43:case 27:case 28:case 31:this.$=a[o];break;case 8:r.addEntity(a[o-4]),r.addEntity(a[o-2]),r.addRelationship(a[o-4],a[o],a[o-2],a[o-3]);break;case 9:r.addEntity(a[o-3]),r.addAttributes(a[o-3],a[o-1]);break;case 10:r.addEntity(a[o-2]);break;case 11:r.addEntity(a[o]);break;case 12:r.addEntity(a[o-6],a[o-4]),r.addAttributes(a[o-6],a[o-1]);break;case 13:r.addEntity(a[o-5],a[o-3]);break;case 14:r.addEntity(a[o-3],a[o-1]);break;case 15:case 16:this.$=a[o].trim(),r.setAccTitle(this.$);break;case 17:case 18:this.$=a[o].trim(),r.setAccDescription(this.$);break;case 20:case 41:case 42:case 32:this.$=a[o].replace(/"/g,"");break;case 21:case 29:this.$=[a[o]];break;case 22:a[o].push(a[o-1]),this.$=a[o];break;case 23:this.$={attributeType:a[o-1],attributeName:a[o]};break;case 24:this.$={attributeType:a[o-2],attributeName:a[o-1],attributeKeyTypeList:a[o]};break;case 25:this.$={attributeType:a[o-2],attributeName:a[o-1],attributeComment:a[o]};break;case 26:this.$={attributeType:a[o-3],attributeName:a[o-2],attributeKeyTypeList:a[o-1],attributeComment:a[o]};break;case 30:a[o-2].push(a[o]),this.$=a[o-2];break;case 33:this.$={cardA:a[o],relType:a[o-1],cardB:a[o-2]};break;case 34:this.$=r.Cardinality.ZERO_OR_ONE;break;case 35:this.$=r.Cardinality.ZERO_OR_MORE;break;case 36:this.$=r.Cardinality.ONE_OR_MORE;break;case 37:this.$=r.Cardinality.ONLY_ONE;break;case 38:this.$=r.Cardinality.MD_PARENT;break;case 39:this.$=r.Identification.NON_IDENTIFYING;break;case 40:this.$=r.Identification.IDENTIFYING}}),"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,20:n,22:r,24:i,26:a,27:o,28:l},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:16,11:9,20:n,22:r,24:i,26:a,27:o,28:l},t(e,[2,5]),t(e,[2,6]),t(e,[2,11],{12:17,39:20,15:[1,18],18:[1,19],41:c,42:h,43:u,44:d,45:p}),{21:[1,26]},{23:[1,27]},{25:[1,28]},t(e,[2,18]),t(g,[2,19]),t(g,[2,20]),t(e,[2,4]),{11:29,27:o,28:l},{16:30,17:[1,31],29:32,30:33,34:f},{11:35,27:o,28:l},{40:36,46:[1,37],47:[1,38]},t(m,[2,34]),t(m,[2,35]),t(m,[2,36]),t(m,[2,37]),t(m,[2,38]),t(e,[2,15]),t(e,[2,16]),t(e,[2,17]),{13:[1,39]},{17:[1,40]},t(e,[2,10]),{16:41,17:[2,21],29:32,30:33,34:f},{31:42,34:[1,43]},{34:[2,27]},{19:[1,44]},{39:45,41:c,42:h,43:u,44:d,45:p},t(y,[2,39]),t(y,[2,40]),{14:46,27:[1,49],28:[1,48],48:[1,47]},t(e,[2,9]),{17:[2,22]},t(v,[2,23],{32:50,33:51,35:52,37:x,38:b}),t([17,34,37,38],[2,28]),t(e,[2,14],{15:[1,55]}),t([27,28],[2,33]),t(e,[2,8]),t(e,[2,41]),t(e,[2,42]),t(e,[2,43]),t(v,[2,24],{33:56,36:[1,57],38:b}),t(v,[2,25]),t(w,[2,29]),t(v,[2,32]),t(w,[2,31]),{16:58,17:[1,59],29:32,30:33,34:f},t(v,[2,26]),{35:60,37:x},{17:[1,61]},t(e,[2,13]),t(w,[2,30]),t(e,[2,12])],defaultActions:{34:[2,27],41:[2,22]},parseError:s((function(t,e){if(!e.recoverable){var n=new Error(t);throw n.hash=e,n}this.trace(t)}),"parseError"),parse:s((function(t){var e=this,n=[0],r=[],i=[null],a=[],o=this.table,l="",c=0,h=0,u=2,d=1,p=a.slice.call(arguments,1),g=Object.create(this.lexer),f={yy:{}};for(var m in this.yy)Object.prototype.hasOwnProperty.call(this.yy,m)&&(f.yy[m]=this.yy[m]);g.setInput(t,f.yy),f.yy.lexer=g,f.yy.parser=this,void 0===g.yylloc&&(g.yylloc={});var y=g.yylloc;a.push(y);var v=g.options&&g.options.ranges;function x(t){n.length=n.length-2*t,i.length=i.length-t,a.length=a.length-t}function b(){var t;return"number"!=typeof(t=r.pop()||g.lex()||d)&&(t instanceof Array&&(t=(r=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof f.yy.parseError?this.parseError=f.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,s(x,"popStack"),s(b,"lex");for(var w,k,T,_,E,C,S,A,L={};;){if(k=n[n.length-1],this.defaultActions[k]?T=this.defaultActions[k]:(null==w&&(w=b()),T=o[k]&&o[k][w]),void 0===T||!T.length||!T[0]){var N="";for(E in A=[],o[k])this.terminals_[E]&&E>u&&A.push("'"+this.terminals_[E]+"'");N=g.showPosition?"Parse error on line "+(c+1)+":\n"+g.showPosition()+"\nExpecting "+A.join(", ")+", got '"+(this.terminals_[w]||w)+"'":"Parse error on line "+(c+1)+": Unexpected "+(w==d?"end of input":"'"+(this.terminals_[w]||w)+"'"),this.parseError(N,{text:g.match,token:this.terminals_[w]||w,line:g.yylineno,loc:y,expected:A})}if(T[0]instanceof Array&&T.length>1)throw new Error("Parse Error: multiple actions possible at state: "+k+", token: "+w);switch(T[0]){case 1:n.push(w),i.push(g.yytext),a.push(g.yylloc),n.push(T[1]),w=null,h=g.yyleng,l=g.yytext,c=g.yylineno,y=g.yylloc;break;case 2:if(C=this.productions_[T[1]][1],L.$=i[i.length-C],L._$={first_line:a[a.length-(C||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(C||1)].first_column,last_column:a[a.length-1].last_column},v&&(L._$.range=[a[a.length-(C||1)].range[0],a[a.length-1].range[1]]),void 0!==(_=this.performAction.apply(L,[l,h,c,f.yy,T[1],i,a].concat(p))))return _;C&&(n=n.slice(0,-1*C*2),i=i.slice(0,-1*C),a=a.slice(0,-1*C)),n.push(this.productions_[T[1]][0]),i.push(L.$),a.push(L._$),S=o[n[n.length-2]][n[n.length-1]],n.push(S);break;case 3:return!0}}return!0}),"parse")},T=function(){var t={EOF:1,parseError:s((function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)}),"parseError"),setInput:s((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:s((function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(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:s((function(t){var e=t.length,n=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 r=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 i=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===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this}),"unput"),more:s((function(){return this._more=!0,this}),"more"),reject:s((function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):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).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}),"reject"),less:s((function(t){this.unput(this.match.slice(t))}),"less"),pastInput:s((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:s((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:s((function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"}),"showPosition"),test_match:s((function(t,e){var n,r,i;if(this.options.backtrack_lexer&&(i={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&&(i.yylloc.range=this.yylloc.range.slice(0))),(r=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.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],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1}),"test_match"),next:s((function(){if(this.done)return this.EOF;var t,e,n,r;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;a<i.length;a++)if((n=this._input.match(this.rules[i[a]]))&&(!e||n[0].length>e[0].length)){if(e=n,r=a,this.options.backtrack_lexer){if(!1!==(t=this.test_match(n,i[a])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,i[r]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}),"next"),lex:s((function(){var t=this.next();return t||this.lex()}),"lex"),begin:s((function(t){this.conditionStack.push(t)}),"begin"),popState:s((function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]}),"popState"),_currentRules:s((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:s((function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"}),"topState"),pushState:s((function(t){this.begin(t)}),"pushState"),stateStackSize:s((function(){return this.conditionStack.length}),"stateStackSize"),options:{"case-insensitive":!0},performAction:s((function(t,e,n,r){switch(n){case 0:return this.begin("acc_title"),22;case 1:return this.popState(),"acc_title_value";case 2:return this.begin("acc_descr"),24;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 10;case 8:case 15:case 20:break;case 9:return 8;case 10:return 28;case 11:return 48;case 12:return 4;case 13:return this.begin("block"),15;case 14:return 36;case 16:return 37;case 17:case 18:return 34;case 19:return 38;case 21:return this.popState(),17;case 22:case 54:return e.yytext[0];case 23:return 18;case 24:return 19;case 25:case 29:case 30:case 43:return 41;case 26:case 27:case 28:case 36:case 38:case 45:return 43;case 31:case 32:case 33:case 34:case 35:case 37:case 44:return 42;case 39:case 40:case 41:case 42:return 44;case 46:return 45;case 47:case 50:case 51:case 52:return 46;case 48:case 49:return 47;case 53:return 27;case 55:return 6}}),"anonymous"),rules:[/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:[\s]+)/i,/^(?:"[^"%\r\n\v\b\\]+")/i,/^(?:"[^"]*")/i,/^(?:erDiagram\b)/i,/^(?:\{)/i,/^(?:,)/i,/^(?:\s+)/i,/^(?:\b((?:PK)|(?:FK)|(?:UK))\b)/i,/^(?:(.*?)[~](.*?)*[~])/i,/^(?:[\*A-Za-z_][A-Za-z0-9\-_\[\]\(\)]*)/i,/^(?:"[^"]*")/i,/^(?:[\n]+)/i,/^(?:\})/i,/^(?:.)/i,/^(?:\[)/i,/^(?:\])/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,/^(?:[A-Za-z_][A-Za-z0-9\-_]*)/i,/^(?:.)/i,/^(?:$)/i],conditions:{acc_descr_multiline:{rules:[5,6],inclusive:!1},acc_descr:{rules:[3],inclusive:!1},acc_title:{rules:[1],inclusive:!1},block:{rules:[14,15,16,17,18,19,20,21,22],inclusive:!1},INITIAL:{rules:[0,2,4,7,8,9,10,11,12,13,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],inclusive:!0}}};return t}();function _(){this.yy={}}return k.lexer=T,s(_,"Parser"),_.prototype=k,k.Parser=_,new _}();eX.parser=eX;var nX=eX,rX=new Map,iX=[],aX=s((function(t,e){return rX.has(t)?!rX.get(t).alias&&e&&(rX.get(t).alias=e,m.info(`Add alias '${e}' to entity '${t}'`)):(rX.set(t,{attributes:[],alias:e}),m.info("Added new entity :",t)),rX.get(t)}),"addEntity"),sX=s((()=>rX),"getEntities"),oX=s((function(t,e){let n,r=aX(t);for(n=e.length-1;n>=0;n--)r.attributes.push(e[n]),m.debug("Added attribute ",e[n].attributeName)}),"addAttributes"),lX=s((function(t,e,n,r){let i={entityA:t,roleA:e,entityB:n,relSpec:r};iX.push(i),m.debug("Added new relationship :",i)}),"addRelationship"),cX=s((()=>iX),"getRelationships"),hX=s((function(){rX=new Map,iX=[],$n()}),"clear"),uX={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"},Identification:{NON_IDENTIFYING:"NON_IDENTIFYING",IDENTIFYING:"IDENTIFYING"},getConfig:s((()=>Hn().er),"getConfig"),addEntity:aX,addAttributes:oX,getEntities:sX,addRelationship:lX,getRelationships:cX,clear:hX,setAccTitle:Fn,getAccTitle:zn,setAccDescription:Un,getAccDescription:Gn,setDiagramTitle:qn,getDiagramTitle:jn},dX={ONLY_ONE_START:"ONLY_ONE_START",ONLY_ONE_END:"ONLY_ONE_END",ZERO_OR_ONE_START:"ZERO_OR_ONE_START",ZERO_OR_ONE_END:"ZERO_OR_ONE_END",ONE_OR_MORE_START:"ONE_OR_MORE_START",ONE_OR_MORE_END:"ONE_OR_MORE_END",ZERO_OR_MORE_START:"ZERO_OR_MORE_START",ZERO_OR_MORE_END:"ZERO_OR_MORE_END",MD_PARENT_END:"MD_PARENT_END",MD_PARENT_START:"MD_PARENT_START"},pX={ERMarkers:dX,insertMarkers:s((function(t,e){let n;t.append("defs").append("marker").attr("id",dX.MD_PARENT_START).attr("refX",0).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",dX.MD_PARENT_END).attr("refX",19).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"),t.append("defs").append("marker").attr("id",dX.ONLY_ONE_START).attr("refX",0).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").append("path").attr("stroke",e.stroke).attr("fill","none").attr("d","M9,0 L9,18 M15,0 L15,18"),t.append("defs").append("marker").attr("id",dX.ONLY_ONE_END).attr("refX",18).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").append("path").attr("stroke",e.stroke).attr("fill","none").attr("d","M3,0 L3,18 M9,0 L9,18"),n=t.append("defs").append("marker").attr("id",dX.ZERO_OR_ONE_START).attr("refX",0).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto"),n.append("circle").attr("stroke",e.stroke).attr("fill","white").attr("cx",21).attr("cy",9).attr("r",6),n.append("path").attr("stroke",e.stroke).attr("fill","none").attr("d","M9,0 L9,18"),n=t.append("defs").append("marker").attr("id",dX.ZERO_OR_ONE_END).attr("refX",30).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto"),n.append("circle").attr("stroke",e.stroke).attr("fill","white").attr("cx",9).attr("cy",9).attr("r",6),n.append("path").attr("stroke",e.stroke).attr("fill","none").attr("d","M21,0 L21,18"),t.append("defs").append("marker").attr("id",dX.ONE_OR_MORE_START).attr("refX",18).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").append("path").attr("stroke",e.stroke).attr("fill","none").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",dX.ONE_OR_MORE_END).attr("refX",27).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").append("path").attr("stroke",e.stroke).attr("fill","none").attr("d","M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18"),n=t.append("defs").append("marker").attr("id",dX.ZERO_OR_MORE_START).attr("refX",18).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto"),n.append("circle").attr("stroke",e.stroke).attr("fill","white").attr("cx",48).attr("cy",18).attr("r",6),n.append("path").attr("stroke",e.stroke).attr("fill","none").attr("d","M0,18 Q18,0 36,18 Q18,36 0,18"),n=t.append("defs").append("marker").attr("id",dX.ZERO_OR_MORE_END).attr("refX",39).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto"),n.append("circle").attr("stroke",e.stroke).attr("fill","white").attr("cx",9).attr("cy",18).attr("r",6),n.append("path").attr("stroke",e.stroke).attr("fill","none").attr("d","M21,18 Q39,0 57,18 Q39,36 21,18")}),"insertMarkers")},gX=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function fX(t){return"string"==typeof t&&gX.test(t)}s(fX,"validate");var mX=fX,yX=[];for(let t=0;t<256;++t)yX.push((t+256).toString(16).slice(1));function vX(t,e=0){return yX[t[e+0]]+yX[t[e+1]]+yX[t[e+2]]+yX[t[e+3]]+"-"+yX[t[e+4]]+yX[t[e+5]]+"-"+yX[t[e+6]]+yX[t[e+7]]+"-"+yX[t[e+8]]+yX[t[e+9]]+"-"+yX[t[e+10]]+yX[t[e+11]]+yX[t[e+12]]+yX[t[e+13]]+yX[t[e+14]]+yX[t[e+15]]}function xX(t){if(!mX(t))throw TypeError("Invalid UUID");let e;const n=new Uint8Array(16);return n[0]=(e=parseInt(t.slice(0,8),16))>>>24,n[1]=e>>>16&255,n[2]=e>>>8&255,n[3]=255&e,n[4]=(e=parseInt(t.slice(9,13),16))>>>8,n[5]=255&e,n[6]=(e=parseInt(t.slice(14,18),16))>>>8,n[7]=255&e,n[8]=(e=parseInt(t.slice(19,23),16))>>>8,n[9]=255&e,n[10]=(e=parseInt(t.slice(24,36),16))/1099511627776&255,n[11]=e/4294967296&255,n[12]=e>>>24&255,n[13]=e>>>16&255,n[14]=e>>>8&255,n[15]=255&e,n}s(vX,"unsafeStringify"),s(xX,"parse");var bX=xX;function wX(t){t=unescape(encodeURIComponent(t));const e=[];for(let n=0;n<t.length;++n)e.push(t.charCodeAt(n));return e}s(wX,"stringToBytes");function kX(t,e,n){function r(t,r,i,a){var s;if("string"==typeof t&&(t=wX(t)),"string"==typeof r&&(r=bX(r)),16!==(null===(s=r)||void 0===s?void 0:s.length))throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let o=new Uint8Array(16+t.length);if(o.set(r),o.set(t,r.length),o=n(o),o[6]=15&o[6]|e,o[8]=63&o[8]|128,i){a=a||0;for(let t=0;t<16;++t)i[a+t]=o[t];return i}return vX(o)}s(r,"generateUUID");try{r.name=t}catch(t){}return r.DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8",r.URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8",r}function TX(t,e,n,r){switch(t){case 0:return e&n^~e&r;case 1:case 3:return e^n^r;case 2:return e&n^e&r^n&r}}function _X(t,e){return t<<e|t>>>32-e}function EX(t){const e=[1518500249,1859775393,2400959708,3395469782],n=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"==typeof t){const e=unescape(encodeURIComponent(t));t=[];for(let n=0;n<e.length;++n)t.push(e.charCodeAt(n))}else Array.isArray(t)||(t=Array.prototype.slice.call(t));t.push(128);const r=t.length/4+2,i=Math.ceil(r/16),a=new Array(i);for(let e=0;e<i;++e){const n=new Uint32Array(16);for(let r=0;r<16;++r)n[r]=t[64*e+4*r]<<24|t[64*e+4*r+1]<<16|t[64*e+4*r+2]<<8|t[64*e+4*r+3];a[e]=n}a[i-1][14]=8*(t.length-1)/Math.pow(2,32),a[i-1][14]=Math.floor(a[i-1][14]),a[i-1][15]=8*(t.length-1)&4294967295;for(let t=0;t<i;++t){const r=new Uint32Array(80);for(let e=0;e<16;++e)r[e]=a[t][e];for(let t=16;t<80;++t)r[t]=_X(r[t-3]^r[t-8]^r[t-14]^r[t-16],1);let i=n[0],s=n[1],o=n[2],l=n[3],c=n[4];for(let t=0;t<80;++t){const n=Math.floor(t/20),a=_X(i,5)+TX(n,s,o,l)+c+e[n]+r[t]>>>0;c=l,l=o,o=_X(s,30)>>>0,s=i,i=a}n[0]=n[0]+i>>>0,n[1]=n[1]+s>>>0,n[2]=n[2]+o>>>0,n[3]=n[3]+l>>>0,n[4]=n[4]+c>>>0}return[n[0]>>24&255,n[0]>>16&255,n[0]>>8&255,255&n[0],n[1]>>24&255,n[1]>>16&255,n[1]>>8&255,255&n[1],n[2]>>24&255,n[2]>>16&255,n[2]>>8&255,255&n[2],n[3]>>24&255,n[3]>>16&255,n[3]>>8&255,255&n[3],n[4]>>24&255,n[4]>>16&255,n[4]>>8&255,255&n[4]]}s(kX,"v35"),s(TX,"f"),s(_X,"ROTL"),s(EX,"sha1");var CX=kX("v5",80,EX),SX=/[^\dA-Za-z](\W)*/g,AX={},LX=new Map,NX=s((function(t){const e=Object.keys(t);for(const n of e)AX[n]=t[n]}),"setConf"),IX=s(((t,e,n)=>{const r=AX.entityPadding/3,i=AX.entityPadding/3,a=.85*AX.fontSize,s=e.node().getBBox(),o=[];let l=!1,c=!1,h=0,u=0,d=0,p=0,g=s.height+2*r,f=1;n.forEach((t=>{void 0!==t.attributeKeyTypeList&&t.attributeKeyTypeList.length>0&&(l=!0),void 0!==t.attributeComment&&(c=!0)})),n.forEach((n=>{const i=`${e.node().id}-attr-${f}`;let s=0;const m=fn(n.attributeType),y=t.append("text").classed("er entityLabel",!0).attr("id",`${i}-type`).attr("x",0).attr("y",0).style("dominant-baseline","middle").style("text-anchor","left").style("font-family",Hn().fontFamily).style("font-size",a+"px").text(m),v=t.append("text").classed("er entityLabel",!0).attr("id",`${i}-name`).attr("x",0).attr("y",0).style("dominant-baseline","middle").style("text-anchor","left").style("font-family",Hn().fontFamily).style("font-size",a+"px").text(n.attributeName),x={};x.tn=y,x.nn=v;const b=y.node().getBBox(),w=v.node().getBBox();if(h=Math.max(h,b.width),u=Math.max(u,w.width),s=Math.max(b.height,w.height),l){const e=void 0!==n.attributeKeyTypeList?n.attributeKeyTypeList.join(","):"",r=t.append("text").classed("er entityLabel",!0).attr("id",`${i}-key`).attr("x",0).attr("y",0).style("dominant-baseline","middle").style("text-anchor","left").style("font-family",Hn().fontFamily).style("font-size",a+"px").text(e);x.kn=r;const o=r.node().getBBox();d=Math.max(d,o.width),s=Math.max(s,o.height)}if(c){const e=t.append("text").classed("er entityLabel",!0).attr("id",`${i}-comment`).attr("x",0).attr("y",0).style("dominant-baseline","middle").style("text-anchor","left").style("font-family",Hn().fontFamily).style("font-size",a+"px").text(n.attributeComment||"");x.cn=e;const r=e.node().getBBox();p=Math.max(p,r.width),s=Math.max(s,r.height)}x.height=s,o.push(x),g+=s+2*r,f+=1}));let m=4;l&&(m+=2),c&&(m+=2);const y=h+u+d+p,v={width:Math.max(AX.minEntityWidth,Math.max(s.width+2*AX.entityPadding,y+i*m)),height:n.length>0?g:Math.max(AX.minEntityHeight,s.height+2*AX.entityPadding)};if(n.length>0){const n=Math.max(0,(v.width-y-i*m)/(m/2));e.attr("transform","translate("+v.width/2+","+(r+s.height/2)+")");let a=s.height+2*r,g="attributeBoxOdd";o.forEach((e=>{const s=a+r+e.height/2;e.tn.attr("transform","translate("+i+","+s+")");const o=t.insert("rect","#"+e.tn.node().id).classed(`er ${g}`,!0).attr("x",0).attr("y",a).attr("width",h+2*i+n).attr("height",e.height+2*r),f=parseFloat(o.attr("x"))+parseFloat(o.attr("width"));e.nn.attr("transform","translate("+(f+i)+","+s+")");const m=t.insert("rect","#"+e.nn.node().id).classed(`er ${g}`,!0).attr("x",f).attr("y",a).attr("width",u+2*i+n).attr("height",e.height+2*r);let y=parseFloat(m.attr("x"))+parseFloat(m.attr("width"));if(l){e.kn.attr("transform","translate("+(y+i)+","+s+")");const o=t.insert("rect","#"+e.kn.node().id).classed(`er ${g}`,!0).attr("x",y).attr("y",a).attr("width",d+2*i+n).attr("height",e.height+2*r);y=parseFloat(o.attr("x"))+parseFloat(o.attr("width"))}c&&(e.cn.attr("transform","translate("+(y+i)+","+s+")"),t.insert("rect","#"+e.cn.node().id).classed(`er ${g}`,"true").attr("x",y).attr("y",a).attr("width",p+2*i+n).attr("height",e.height+2*r)),a+=e.height+2*r,g="attributeBoxOdd"===g?"attributeBoxEven":"attributeBoxOdd"}))}else v.height=Math.max(AX.minEntityHeight,g),e.attr("transform","translate("+v.width/2+","+v.height/2+")");return v}),"drawAttributes"),MX=s((function(t,e,n){let r;return[...e.keys()].forEach((function(i){const a=FX(i,"entity");LX.set(i,a);const s=t.append("g").attr("id",a);r=void 0===r?a:r;const o="text-"+a,l=s.append("text").classed("er entityLabel",!0).attr("id",o).attr("x",0).attr("y",0).style("dominant-baseline","middle").style("text-anchor","middle").style("font-family",Hn().fontFamily).style("font-size",AX.fontSize+"px").text(e.get(i).alias??i),{width:c,height:h}=IX(s,l,e.get(i).attributes),u=s.insert("rect","#"+o).classed("er entityBox",!0).attr("x",0).attr("y",0).attr("width",c).attr("height",h).node().getBBox();n.setNode(a,{width:u.width,height:u.height,shape:"rect",id:a})})),r}),"drawEntities"),RX=s((function(t,e){e.nodes().forEach((function(n){void 0!==n&&void 0!==e.node(n)&&t.select("#"+n).attr("transform","translate("+(e.node(n).x-e.node(n).width/2)+","+(e.node(n).y-e.node(n).height/2)+" )")}))}),"adjustEntities"),DX=s((function(t){return(t.entityA+t.roleA+t.entityB).replace(/\s/g,"")}),"getEdgeName"),OX=s((function(t,e){return t.forEach((function(t){e.setEdge(LX.get(t.entityA),LX.get(t.entityB),{relationship:t},DX(t))})),t}),"addRelationships"),PX=0,BX=s((function(t,e,n,r,i){PX++;const a=n.edge(LX.get(e.entityA),LX.get(e.entityB),DX(e)),s=Xh().x((function(t){return t.x})).y((function(t){return t.y})).curve(iu),o=t.insert("path","#"+r).classed("er relationshipLine",!0).attr("d",s(a.points)).style("stroke",AX.stroke).style("fill","none");e.relSpec.relType===i.db.Identification.NON_IDENTIFYING&&o.attr("stroke-dasharray","8,8");let l="";switch(AX.arrowMarkerAbsolute&&(l=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,l=l.replace(/\(/g,"\\("),l=l.replace(/\)/g,"\\)")),e.relSpec.cardA){case i.db.Cardinality.ZERO_OR_ONE:o.attr("marker-end","url("+l+"#"+pX.ERMarkers.ZERO_OR_ONE_END+")");break;case i.db.Cardinality.ZERO_OR_MORE:o.attr("marker-end","url("+l+"#"+pX.ERMarkers.ZERO_OR_MORE_END+")");break;case i.db.Cardinality.ONE_OR_MORE:o.attr("marker-end","url("+l+"#"+pX.ERMarkers.ONE_OR_MORE_END+")");break;case i.db.Cardinality.ONLY_ONE:o.attr("marker-end","url("+l+"#"+pX.ERMarkers.ONLY_ONE_END+")");break;case i.db.Cardinality.MD_PARENT:o.attr("marker-end","url("+l+"#"+pX.ERMarkers.MD_PARENT_END+")")}switch(e.relSpec.cardB){case i.db.Cardinality.ZERO_OR_ONE:o.attr("marker-start","url("+l+"#"+pX.ERMarkers.ZERO_OR_ONE_START+")");break;case i.db.Cardinality.ZERO_OR_MORE:o.attr("marker-start","url("+l+"#"+pX.ERMarkers.ZERO_OR_MORE_START+")");break;case i.db.Cardinality.ONE_OR_MORE:o.attr("marker-start","url("+l+"#"+pX.ERMarkers.ONE_OR_MORE_START+")");break;case i.db.Cardinality.ONLY_ONE:o.attr("marker-start","url("+l+"#"+pX.ERMarkers.ONLY_ONE_START+")");break;case i.db.Cardinality.MD_PARENT:o.attr("marker-start","url("+l+"#"+pX.ERMarkers.MD_PARENT_START+")")}const c=o.node().getTotalLength(),h=o.node().getPointAtLength(.5*c),u="rel"+PX,d=e.roleA.split(/<br ?\/>/g),p=t.append("text").classed("er relationshipLabel",!0).attr("id",u).attr("x",h.x).attr("y",h.y).style("text-anchor","middle").style("dominant-baseline","middle").style("font-family",Hn().fontFamily).style("font-size",AX.fontSize+"px");if(1==d.length)p.text(e.roleA);else{const t=.5*-(d.length-1);d.forEach(((e,n)=>{p.append("tspan").attr("x",h.x).attr("dy",`${0===n?t:1}em`).text(e)}))}const g=p.node().getBBox();t.insert("rect","#"+u).classed("er relationshipLabelBox",!0).attr("x",h.x-g.width/2).attr("y",h.y-g.height/2).attr("width",g.width).attr("height",g.height)}),"drawRelationshipFromLayout"),$X=s((function(t,e,n,r){AX=Hn().er,m.info("Drawing ER diagram");const i=Hn().securityLevel;let a;"sandbox"===i&&(a=Oa("#i"+e));const s=Oa("sandbox"===i?a.nodes()[0].contentDocument.body:"body").select(`[id='${e}']`);let o;pX.insertMarkers(s,AX),o=new nq({multigraph:!0,directed:!0,compound:!1}).setGraph({rankdir:AX.layoutDirection,marginx:20,marginy:20,nodesep:100,edgesep:100,ranksep:100}).setDefaultEdgeLabel((function(){return{}}));const l=MX(s,r.db.getEntities(),o),c=OX(r.db.getRelationships(),o);cY(o),RX(s,o),c.forEach((function(t){BX(s,t,o,l,r)}));const h=AX.diagramPadding;yk.insertTitle(s,"entityTitleText",AX.titleTopMargin,r.db.getDiagramTitle());const u=s.node().getBBox(),d=u.width+2*h,p=u.height+2*h;Sn(s,p,d,AX.useMaxWidth),s.attr("viewBox",`${u.x-h} ${u.y-h} ${d} ${p}`)}),"draw");function FX(t="",e=""){const n=t.replace(SX,"");return`${zX(e)}${zX(n)}${CX(t,"28e9f9db-3c8d-5aa5-9faf-44286ae5937c")}`}function zX(t=""){return t.length>0?`${t}-`:""}s(FX,"generateId"),s(zX,"strWithHyphen");var UX={parser:nX,db:uX,renderer:{setConf:NX,draw:$X},styles:s((t=>`\n .entityBox {\n fill: ${t.mainBkg};\n stroke: ${t.nodeBorder};\n }\n\n .attributeBoxOdd {\n fill: ${t.attributeBackgroundColorOdd};\n stroke: ${t.nodeBorder};\n }\n\n .attributeBoxEven {\n fill: ${t.attributeBackgroundColorEven};\n stroke: ${t.nodeBorder};\n }\n\n .relationshipLabelBox {\n fill: ${t.tertiaryColor};\n opacity: 0.7;\n background-color: ${t.tertiaryColor};\n rect {\n opacity: 0.5;\n }\n }\n\n .relationshipLine {\n stroke: ${t.lineColor};\n }\n\n .entityTitleText {\n text-anchor: middle;\n font-size: 18px;\n fill: ${t.textColor};\n } \n #MD_PARENT_START {\n fill: #f5f5f5 !important;\n stroke: ${t.lineColor} !important;\n stroke-width: 1;\n }\n #MD_PARENT_END {\n fill: #f5f5f5 !important;\n stroke: ${t.lineColor} !important;\n stroke-width: 1;\n }\n \n`),"getStyles")},GX=Object.freeze({__proto__:null,diagram:UX}),qX=class{constructor(t){this.init=t,this.records=this.init()}static{s(this,"ImperativeState")}reset(){this.records=this.init()}};function jX(t,e){t.accDescr&&e.setAccDescription?.(t.accDescr),t.accTitle&&e.setAccTitle?.(t.accTitle),t.title&&e.setDiagramTitle?.(t.title)}s(jX,"populateCommonDb");var YX=o({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/ral.js"(t){var e;function n(){if(void 0===e)throw new Error("No runtime abstraction layer installed");return e}Object.defineProperty(t,"__esModule",{value:!0}),s(n,"RAL"),function(t){function n(t){if(void 0===t)throw new Error("No runtime abstraction layer provided");e=t}s(n,"install"),t.install=n}(n||(n={})),t.default=n}}),WX=o({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/is.js"(t){function e(t){return!0===t||!1===t}function n(t){return"string"==typeof t||t instanceof String}function r(t){return"number"==typeof t||t instanceof Number}function i(t){return t instanceof Error}function a(t){return"function"==typeof t}function o(t){return Array.isArray(t)}function l(t){return o(t)&&t.every((t=>n(t)))}Object.defineProperty(t,"__esModule",{value:!0}),t.stringArray=t.array=t.func=t.error=t.number=t.string=t.boolean=void 0,s(e,"boolean"),t.boolean=e,s(n,"string"),t.string=n,s(r,"number"),t.number=r,s(i,"error"),t.error=i,s(a,"func"),t.func=a,s(o,"array"),t.array=o,s(l,"stringArray"),t.stringArray=l}}),HX=o({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/events.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Emitter=t.Event=void 0;var e,n=YX();!function(t){const e={dispose(){}};t.None=function(){return e}}(e||(t.Event=e={}));var r=class{static{s(this,"CallbackList")}add(t,e=null,n){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(t),this._contexts.push(e),Array.isArray(n)&&n.push({dispose:s((()=>this.remove(t,e)),"dispose")})}remove(t,e=null){if(!this._callbacks)return;let n=!1;for(let r=0,i=this._callbacks.length;r<i;r++)if(this._callbacks[r]===t){if(this._contexts[r]===e)return this._callbacks.splice(r,1),void this._contexts.splice(r,1);n=!0}if(n)throw new Error("When adding a listener with a context, you should remove it with the same context")}invoke(...t){if(!this._callbacks)return[];const e=[],r=this._callbacks.slice(0),i=this._contexts.slice(0);for(let a=0,s=r.length;a<s;a++)try{e.push(r[a].apply(i[a],t))}catch(t){(0,n.default)().console.error(t)}return e}isEmpty(){return!this._callbacks||0===this._callbacks.length}dispose(){this._callbacks=void 0,this._contexts=void 0}},i=class t{static{s(this,"Emitter")}constructor(t){this._options=t}get event(){return this._event||(this._event=(e,n,i)=>{this._callbacks||(this._callbacks=new r),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(e,n);const a={dispose:s((()=>{this._callbacks&&(this._callbacks.remove(e,n),a.dispose=t._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}),"dispose")};return Array.isArray(i)&&i.push(a),a}),this._event}fire(t){this._callbacks&&this._callbacks.invoke.call(this._callbacks,t)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}};t.Emitter=i,i._noop=function(){}}}),VX=o({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/cancellation.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.CancellationTokenSource=t.CancellationToken=void 0;var e,n=YX(),r=WX(),i=HX();!function(t){function e(e){const n=e;return n&&(n===t.None||n===t.Cancelled||r.boolean(n.isCancellationRequested)&&!!n.onCancellationRequested)}t.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:i.Event.None}),t.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:i.Event.None}),s(e,"is"),t.is=e}(e||(t.CancellationToken=e={}));var a=Object.freeze((function(t,e){const r=(0,n.default)().timer.setTimeout(t.bind(e),0);return{dispose(){r.dispose()}}})),o=class{static{s(this,"MutableToken")}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?a:(this._emitter||(this._emitter=new i.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}},l=class{static{s(this,"CancellationTokenSource")}get token(){return this._token||(this._token=new o),this._token}cancel(){this._token?this._token.cancel():this._token=e.Cancelled}dispose(){this._token?this._token instanceof o&&this._token.dispose():this._token=e.None}};t.CancellationTokenSource=l}}),XX={};l(XX,{AbstractAstReflection:()=>eK,AbstractCstNode:()=>H6,AbstractLangiumParser:()=>e7,AbstractParserErrorMessageProvider:()=>r7,AbstractThreadedAsyncParser:()=>b9,AstUtils:()=>AQ,BiMap:()=>o8,Cancellation:()=>I7,CompositeCstNodeImpl:()=>X6,ContextCache:()=>g8,CstNodeBuilder:()=>W6,CstUtils:()=>KX,DONE_RESULT:()=>cK,DatatypeSymbol:()=>Q6,DefaultAstNodeDescriptionProvider:()=>I8,DefaultAstNodeLocator:()=>R8,DefaultAsyncParser:()=>x9,DefaultCommentProvider:()=>m9,DefaultConfigurationProvider:()=>D8,DefaultDocumentBuilder:()=>O8,DefaultDocumentValidator:()=>S8,DefaultHydrator:()=>T9,DefaultIndexManager:()=>P8,DefaultJsonSerializer:()=>w8,DefaultLangiumDocumentFactory:()=>t8,DefaultLangiumDocuments:()=>e8,DefaultLexer:()=>$8,DefaultLinker:()=>n8,DefaultNameProvider:()=>i8,DefaultReferenceDescriptionProvider:()=>M8,DefaultReferences:()=>a8,DefaultScopeComputation:()=>l8,DefaultScopeProvider:()=>y8,DefaultServiceRegistry:()=>k8,DefaultTokenBuilder:()=>L7,DefaultValueConverter:()=>N7,DefaultWorkspaceLock:()=>k9,DefaultWorkspaceManager:()=>B8,Deferred:()=>G7,Disposable:()=>N8,DisposableCache:()=>d8,DocumentCache:()=>f8,DocumentState:()=>K7,DocumentValidator:()=>_8,EMPTY_SCOPE:()=>u8,EMPTY_STREAM:()=>lK,EmptyFileSystem:()=>O9,EmptyFileSystemProvider:()=>D9,ErrorWithLocation:()=>PK,GrammarAST:()=>$K,GrammarUtils:()=>OK,JSDocDocumentationProvider:()=>f9,LangiumCompletionParser:()=>a7,LangiumParser:()=>n7,LangiumParserErrorMessageProvider:()=>i7,LeafCstNodeImpl:()=>V6,MapScope:()=>h8,Module:()=>v9,MultiMap:()=>s8,OperationCancelled:()=>B7,ParserWorker:()=>w9,Reduction:()=>uK,RegExpUtils:()=>qQ,RootCstNodeImpl:()=>Z6,SimpleCache:()=>p8,StreamImpl:()=>aK,StreamScope:()=>c8,TextDocument:()=>z7,TreeStreamImpl:()=>gK,URI:()=>Q7,UriUtils:()=>X7,ValidationCategory:()=>b8,ValidationRegistry:()=>C8,ValueConverter:()=>A7,WorkspaceCache:()=>m8,assertUnreachable:()=>BK,createCompletionParser:()=>E7,createDefaultCoreModule:()=>_9,createDefaultSharedCoreModule:()=>E9,createGrammarConfig:()=>QJ,createLangiumParser:()=>C7,delayNextTick:()=>M7,diagnosticData:()=>T8,eagerLoad:()=>A9,getDiagnosticRange:()=>A8,inject:()=>C9,interruptAndCheck:()=>F7,isAstNode:()=>ZX,isAstNodeDescription:()=>JX,isAstNodeWithComment:()=>v8,isCompositeCstNode:()=>nK,isIMultiModeLexerDefinition:()=>z8,isJSDoc:()=>q8,isLeafCstNode:()=>rK,isLinkingError:()=>tK,isNamed:()=>r8,isOperationCancelled:()=>$7,isReference:()=>QX,isRootCstNode:()=>iK,isTokenTypeArray:()=>F8,isTokenTypeDictionary:()=>U8,loadGrammarFromJson:()=>F9,parseJSDoc:()=>G8,prepareLangiumParser:()=>S7,setInterruptionPeriod:()=>P7,startCancelableOperation:()=>O7,stream:()=>hK,toDiagnosticSeverity:()=>L8});var KX={};function ZX(t){return"object"==typeof t&&null!==t&&"string"==typeof t.$type}function QX(t){return"object"==typeof t&&null!==t&&"string"==typeof t.$refText}function JX(t){return"object"==typeof t&&null!==t&&"string"==typeof t.name&&"string"==typeof t.type&&"string"==typeof t.path}function tK(t){return"object"==typeof t&&null!==t&&ZX(t.container)&&QX(t.reference)&&"string"==typeof t.message}l(KX,{DefaultNameRegexp:()=>kK,RangeComparison:()=>dK,compareRange:()=>bK,findCommentNode:()=>_K,findDeclarationNodeAtOffset:()=>TK,findLeafNodeAtOffset:()=>CK,findLeafNodeBeforeOffset:()=>SK,flattenCst:()=>mK,getInteriorNodes:()=>MK,getNextNode:()=>NK,getPreviousNode:()=>LK,getStartlineNode:()=>IK,inRange:()=>wK,isChildNode:()=>yK,isCommentNode:()=>EK,streamCst:()=>fK,toDocumentSegment:()=>xK,tokenToRange:()=>vK}),s(ZX,"isAstNode"),s(QX,"isReference"),s(JX,"isAstNodeDescription"),s(tK,"isLinkingError");var eK=class{static{s(this,"AbstractAstReflection")}constructor(){this.subtypes={},this.allSubtypes={}}isInstance(t,e){return ZX(t)&&this.isSubtype(t.$type,e)}isSubtype(t,e){if(t===e)return!0;let n=this.subtypes[t];n||(n=this.subtypes[t]={});const r=n[e];if(void 0!==r)return r;{const r=this.computeIsSubtype(t,e);return n[e]=r,r}}getAllSubTypes(t){const e=this.allSubtypes[t];if(e)return e;{const e=this.getAllTypes(),n=[];for(const r of e)this.isSubtype(r,t)&&n.push(r);return this.allSubtypes[t]=n,n}}};function nK(t){return"object"==typeof t&&null!==t&&Array.isArray(t.content)}function rK(t){return"object"==typeof t&&null!==t&&"object"==typeof t.tokenType}function iK(t){return nK(t)&&"string"==typeof t.fullText}s(nK,"isCompositeCstNode"),s(rK,"isLeafCstNode"),s(iK,"isRootCstNode");var aK=class t{static{s(this,"StreamImpl")}constructor(t,e){this.startFn=t,this.nextFn=e}iterator(){const t={state:this.startFn(),next:s((()=>this.nextFn(t.state)),"next"),[Symbol.iterator]:()=>t};return t}[Symbol.iterator](){return this.iterator()}isEmpty(){const t=this.iterator();return Boolean(t.next().done)}count(){const t=this.iterator();let e=0,n=t.next();for(;!n.done;)e++,n=t.next();return e}toArray(){const t=[],e=this.iterator();let n;do{n=e.next(),void 0!==n.value&&t.push(n.value)}while(!n.done);return t}toSet(){return new Set(this)}toMap(t,e){const n=this.map((n=>[t?t(n):n,e?e(n):n]));return new Map(n)}toString(){return this.join()}concat(e){const n=e[Symbol.iterator]();return new t((()=>({first:this.startFn(),firstDone:!1})),(t=>{let e;if(!t.firstDone){do{if(e=this.nextFn(t.first),!e.done)return e}while(!e.done);t.firstDone=!0}do{if(e=n.next(),!e.done)return e}while(!e.done);return cK}))}join(t=","){const e=this.iterator();let n,r="",i=!1;do{n=e.next(),n.done||(i&&(r+=t),r+=sK(n.value)),i=!0}while(!n.done);return r}indexOf(t,e=0){const n=this.iterator();let r=0,i=n.next();for(;!i.done;){if(r>=e&&i.value===t)return r;i=n.next(),r++}return-1}every(t){const e=this.iterator();let n=e.next();for(;!n.done;){if(!t(n.value))return!1;n=e.next()}return!0}some(t){const e=this.iterator();let n=e.next();for(;!n.done;){if(t(n.value))return!0;n=e.next()}return!1}forEach(t){const e=this.iterator();let n=0,r=e.next();for(;!r.done;)t(r.value,n),r=e.next(),n++}map(e){return new t(this.startFn,(t=>{const{done:n,value:r}=this.nextFn(t);return n?cK:{done:!1,value:e(r)}}))}filter(e){return new t(this.startFn,(t=>{let n;do{if(n=this.nextFn(t),!n.done&&e(n.value))return n}while(!n.done);return cK}))}nonNullable(){return this.filter((t=>null!=t))}reduce(t,e){const n=this.iterator();let r=e,i=n.next();for(;!i.done;)r=void 0===r?i.value:t(r,i.value),i=n.next();return r}reduceRight(t,e){return this.recursiveReduce(this.iterator(),t,e)}recursiveReduce(t,e,n){const r=t.next();if(r.done)return n;const i=this.recursiveReduce(t,e,n);return void 0===i?r.value:e(i,r.value)}find(t){const e=this.iterator();let n=e.next();for(;!n.done;){if(t(n.value))return n.value;n=e.next()}}findIndex(t){const e=this.iterator();let n=0,r=e.next();for(;!r.done;){if(t(r.value))return n;r=e.next(),n++}return-1}includes(t){const e=this.iterator();let n=e.next();for(;!n.done;){if(n.value===t)return!0;n=e.next()}return!1}flatMap(e){return new t((()=>({this:this.startFn()})),(t=>{do{if(t.iterator){const e=t.iterator.next();if(!e.done)return e;t.iterator=void 0}const{done:n,value:r}=this.nextFn(t.this);if(!n){const n=e(r);if(!oK(n))return{done:!1,value:n};t.iterator=n[Symbol.iterator]()}}while(t.iterator);return cK}))}flat(e){if(void 0===e&&(e=1),e<=0)return this;const n=e>1?this.flat(e-1):this;return new t((()=>({this:n.startFn()})),(t=>{do{if(t.iterator){const e=t.iterator.next();if(!e.done)return e;t.iterator=void 0}const{done:e,value:r}=n.nextFn(t.this);if(!e){if(!oK(r))return{done:!1,value:r};t.iterator=r[Symbol.iterator]()}}while(t.iterator);return cK}))}head(){const t=this.iterator().next();if(!t.done)return t.value}tail(e=1){return new t((()=>{const t=this.startFn();for(let n=0;n<e;n++){if(this.nextFn(t).done)return t}return t}),this.nextFn)}limit(e){return new t((()=>({size:0,state:this.startFn()})),(t=>(t.size++,t.size>e?cK:this.nextFn(t.state))))}distinct(t){const e=new Set;return this.filter((n=>{const r=t?t(n):n;return!e.has(r)&&(e.add(r),!0)}))}exclude(t,e){const n=new Set;for(const r of t){const t=e?e(r):r;n.add(t)}return this.filter((t=>{const r=e?e(t):t;return!n.has(r)}))}};function sK(t){return"string"==typeof t?t:void 0===t?"undefined":"function"==typeof t.toString?t.toString():Object.prototype.toString.call(t)}function oK(t){return!!t&&"function"==typeof t[Symbol.iterator]}s(sK,"toString"),s(oK,"isIterable");var lK=new aK((()=>{}),(()=>cK)),cK=Object.freeze({done:!0,value:void 0});function hK(...t){if(1===t.length){const e=t[0];if(e instanceof aK)return e;if(oK(e))return new aK((()=>e[Symbol.iterator]()),(t=>t.next()));if("number"==typeof e.length)return new aK((()=>({index:0})),(t=>t.index<e.length?{done:!1,value:e[t.index++]}:cK))}return t.length>1?new aK((()=>({collIndex:0,arrIndex:0})),(e=>{do{if(e.iterator){const t=e.iterator.next();if(!t.done)return t;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 n=t[e.collIndex++];oK(n)?e.iterator=n[Symbol.iterator]():n&&"number"==typeof n.length&&(e.array=n)}}while(e.iterator||e.array||e.collIndex<t.length);return cK})):lK}s(hK,"stream");var uK,dK,pK,gK=class extends aK{static{s(this,"TreeStreamImpl")}constructor(t,e,n){super((()=>({iterators:(null==n?void 0:n.includeRoot)?[[t][Symbol.iterator]()]:[e(t)[Symbol.iterator]()],pruned:!1})),(t=>{for(t.pruned&&(t.iterators.pop(),t.pruned=!1);t.iterators.length>0;){const n=t.iterators[t.iterators.length-1].next();if(!n.done)return t.iterators.push(e(n.value)[Symbol.iterator]()),n;t.iterators.pop()}return cK}))}iterator(){const t={state:this.startFn(),next:s((()=>this.nextFn(t.state)),"next"),prune:s((()=>{t.state.pruned=!0}),"prune"),[Symbol.iterator]:()=>t};return t}};function fK(t){return new gK(t,(t=>nK(t)?t.content:[]),{includeRoot:!0})}function mK(t){return fK(t).filter(rK)}function yK(t,e){for(;t.container;)if((t=t.container)===e)return!0;return!1}function vK(t){return{start:{character:t.startColumn-1,line:t.startLine-1},end:{character:t.endColumn,line:t.endLine-1}}}function xK(t){if(!t)return;const{offset:e,end:n,range:r}=t;return{range:r,offset:e,end:n,length:n-e}}function bK(t,e){if(t.end.line<e.start.line||t.end.line===e.start.line&&t.end.character<t.start.character)return dK.Before;if(t.start.line>e.end.line||t.start.line===e.end.line&&t.start.character>e.end.character)return dK.After;const n=t.start.line>e.start.line||t.start.line===e.start.line&&t.start.character>=e.start.character,r=t.end.line<e.end.line||t.end.line===e.end.line&&t.end.character<=e.end.character;return n&&r?dK.Inside:n?dK.OverlapBack:dK.OverlapFront}function wK(t,e){return bK(t,e)>dK.After}!function(t){function e(t){return t.reduce(((t,e)=>t+e),0)}function n(t){return t.reduce(((t,e)=>t*e),0)}function r(t){return t.reduce(((t,e)=>Math.min(t,e)))}function i(t){return t.reduce(((t,e)=>Math.max(t,e)))}s(e,"sum"),t.sum=e,s(n,"product"),t.product=n,s(r,"min"),t.min=r,s(i,"max"),t.max=i}(uK||(uK={})),s(fK,"streamCst"),s(mK,"flattenCst"),s(yK,"isChildNode"),s(vK,"tokenToRange"),s(xK,"toDocumentSegment"),(pK=dK||(dK={}))[pK.Before=0]="Before",pK[pK.After=1]="After",pK[pK.OverlapFront=2]="OverlapFront",pK[pK.OverlapBack=3]="OverlapBack",pK[pK.Inside=4]="Inside",s(bK,"compareRange"),s(wK,"inRange");var kK=/^[\w\p{L}]$/u;function TK(t,e,n=kK){if(t){if(e>0){const r=e-t.offset,i=t.text.charAt(r);n.test(i)||e--}return CK(t,e)}}function _K(t,e){if(t){const n=LK(t,!0);if(n&&EK(n,e))return n;if(iK(t)){const n=t.content.findIndex((t=>!t.hidden));for(let r=n-1;r>=0;r--){const n=t.content[r];if(EK(n,e))return n}}}}function EK(t,e){return rK(t)&&e.includes(t.tokenType.name)}function CK(t,e){if(rK(t))return t;if(nK(t)){const n=AK(t,e,!1);if(n)return CK(n,e)}}function SK(t,e){if(rK(t))return t;if(nK(t)){const n=AK(t,e,!0);if(n)return SK(n,e)}}function AK(t,e,n){let r,i=0,a=t.content.length-1;for(;i<=a;){const s=Math.floor((i+a)/2),o=t.content[s];if(o.offset<=e&&o.end>e)return o;o.end<=e?(r=n?o:void 0,i=s+1):a=s-1}return r}function LK(t,e=!0){for(;t.container;){const n=t.container;let r=n.content.indexOf(t);for(;r>0;){r--;const t=n.content[r];if(e||!t.hidden)return t}t=n}}function NK(t,e=!0){for(;t.container;){const n=t.container;let r=n.content.indexOf(t);const i=n.content.length-1;for(;r<i;){r++;const t=n.content[r];if(e||!t.hidden)return t}t=n}}function IK(t){if(0===t.range.start.character)return t;const e=t.range.start.line;let n,r=t;for(;t.container;){const i=t.container,a=null!=n?n:i.content.indexOf(t);if(0===a?(t=i,n=void 0):(n=a-1,t=i.content[n]),t.range.start.line!==e)break;r=t}return r}function MK(t,e){const n=RK(t,e);return n?n.parent.content.slice(n.a+1,n.b):[]}function RK(t,e){const n=DK(t),r=DK(e);let i;for(let t=0;t<n.length&&t<r.length;t++){const e=n[t],a=r[t];if(e.parent!==a.parent)break;i={parent:e.parent,a:e.index,b:a.index}}return i}function DK(t){const e=[];for(;t.container;){const n=t.container,r=n.content.indexOf(t);e.push({parent:n,index:r}),t=n}return e.reverse()}s(TK,"findDeclarationNodeAtOffset"),s(_K,"findCommentNode"),s(EK,"isCommentNode"),s(CK,"findLeafNodeAtOffset"),s(SK,"findLeafNodeBeforeOffset"),s(AK,"binarySearch"),s(LK,"getPreviousNode"),s(NK,"getNextNode"),s(IK,"getStartlineNode"),s(MK,"getInteriorNodes"),s(RK,"getCommonParent"),s(DK,"getParentChain");var OK={};l(OK,{findAssignment:()=>SJ,findNameAssignment:()=>AJ,findNodeForKeyword:()=>EJ,findNodeForProperty:()=>kJ,findNodesForKeyword:()=>_J,findNodesForKeywordInternal:()=>CJ,findNodesForProperty:()=>wJ,getActionAtElement:()=>NJ,getActionType:()=>zJ,getAllReachableRules:()=>yJ,getCrossReferenceTerminal:()=>xJ,getEntryRule:()=>fJ,getExplicitRuleType:()=>$J,getHiddenRules:()=>mJ,getRuleType:()=>UJ,getTypeName:()=>FJ,isArrayCardinality:()=>MJ,isArrayOperator:()=>RJ,isCommentTerminal:()=>bJ,isDataType:()=>PJ,isDataTypeRule:()=>DJ,isOptionalCardinality:()=>IJ,terminalRegex:()=>GJ});var PK=class extends Error{static{s(this,"ErrorWithLocation")}constructor(t,e){super(t?`${e} at ${t.range.start.line}:${t.range.start.character}`:e)}};function BK(t){throw new Error("Error! The input value was not handled.")}s(BK,"assertUnreachable");var $K={};l($K,{AbstractElement:()=>QK,AbstractRule:()=>zK,AbstractType:()=>GK,Action:()=>WZ,Alternatives:()=>VZ,ArrayLiteral:()=>tZ,ArrayType:()=>nZ,Assignment:()=>KZ,BooleanLiteral:()=>iZ,CharacterRange:()=>QZ,Condition:()=>jK,Conjunction:()=>sZ,CrossReference:()=>tQ,Disjunction:()=>lZ,EndOfFile:()=>nQ,Grammar:()=>hZ,GrammarImport:()=>dZ,Group:()=>iQ,InferredType:()=>gZ,Interface:()=>mZ,Keyword:()=>sQ,LangiumGrammarAstReflection:()=>CQ,LangiumGrammarTerminals:()=>FK,NamedArgument:()=>vZ,NegatedToken:()=>lQ,Negation:()=>bZ,NumberLiteral:()=>kZ,Parameter:()=>_Z,ParameterReference:()=>CZ,ParserRule:()=>AZ,ReferenceType:()=>NZ,RegexToken:()=>hQ,ReturnType:()=>MZ,RuleCall:()=>dQ,SimpleType:()=>DZ,StringLiteral:()=>PZ,TerminalAlternatives:()=>gQ,TerminalGroup:()=>mQ,TerminalRule:()=>$Z,TerminalRuleCall:()=>vQ,Type:()=>zZ,TypeAttribute:()=>GZ,TypeDefinition:()=>VK,UnionType:()=>jZ,UnorderedGroup:()=>bQ,UntilToken:()=>kQ,ValueLiteral:()=>KK,Wildcard:()=>_Q,isAbstractElement:()=>JK,isAbstractRule:()=>UK,isAbstractType:()=>qK,isAction:()=>HZ,isAlternatives:()=>XZ,isArrayLiteral:()=>eZ,isArrayType:()=>rZ,isAssignment:()=>ZZ,isBooleanLiteral:()=>aZ,isCharacterRange:()=>JZ,isCondition:()=>YK,isConjunction:()=>oZ,isCrossReference:()=>eQ,isDisjunction:()=>cZ,isEndOfFile:()=>rQ,isFeatureName:()=>WK,isGrammar:()=>uZ,isGrammarImport:()=>pZ,isGroup:()=>aQ,isInferredType:()=>fZ,isInterface:()=>yZ,isKeyword:()=>oQ,isNamedArgument:()=>xZ,isNegatedToken:()=>cQ,isNegation:()=>wZ,isNumberLiteral:()=>TZ,isParameter:()=>EZ,isParameterReference:()=>SZ,isParserRule:()=>LZ,isPrimitiveType:()=>HK,isReferenceType:()=>IZ,isRegexToken:()=>uQ,isReturnType:()=>RZ,isRuleCall:()=>pQ,isSimpleType:()=>OZ,isStringLiteral:()=>BZ,isTerminalAlternatives:()=>fQ,isTerminalGroup:()=>yQ,isTerminalRule:()=>FZ,isTerminalRuleCall:()=>xQ,isType:()=>UZ,isTypeAttribute:()=>qZ,isTypeDefinition:()=>XK,isUnionType:()=>YZ,isUnorderedGroup:()=>wQ,isUntilToken:()=>TQ,isValueLiteral:()=>ZK,isWildcard:()=>EQ,reflection:()=>SQ});var FK={ID:/\^?[_a-zA-Z][\w_]*/,STRING:/"(\\.|[^"\\])*"|'(\\.|[^'\\])*'/,NUMBER:/NaN|-?((\d*\.\d+|\d+)([Ee][+-]?\d+)?|Infinity)/,RegexLiteral:/\/(?![*+?])(?:[^\r\n\[/\\]|\\.|\[(?:[^\r\n\]\\]|\\.)*\])+\/[a-z]*/,WS:/\s+/,ML_COMMENT:/\/\*[\s\S]*?\*\//,SL_COMMENT:/\/\/[^\n\r]*/},zK="AbstractRule";function UK(t){return SQ.isInstance(t,zK)}s(UK,"isAbstractRule");var GK="AbstractType";function qK(t){return SQ.isInstance(t,GK)}s(qK,"isAbstractType");var jK="Condition";function YK(t){return SQ.isInstance(t,jK)}function WK(t){return HK(t)||"current"===t||"entry"===t||"extends"===t||"false"===t||"fragment"===t||"grammar"===t||"hidden"===t||"import"===t||"interface"===t||"returns"===t||"terminal"===t||"true"===t||"type"===t||"infer"===t||"infers"===t||"with"===t||"string"==typeof t&&/\^?[_a-zA-Z][\w_]*/.test(t)}function HK(t){return"string"===t||"number"===t||"boolean"===t||"Date"===t||"bigint"===t}s(YK,"isCondition"),s(WK,"isFeatureName"),s(HK,"isPrimitiveType");var VK="TypeDefinition";function XK(t){return SQ.isInstance(t,VK)}s(XK,"isTypeDefinition");var KK="ValueLiteral";function ZK(t){return SQ.isInstance(t,KK)}s(ZK,"isValueLiteral");var QK="AbstractElement";function JK(t){return SQ.isInstance(t,QK)}s(JK,"isAbstractElement");var tZ="ArrayLiteral";function eZ(t){return SQ.isInstance(t,tZ)}s(eZ,"isArrayLiteral");var nZ="ArrayType";function rZ(t){return SQ.isInstance(t,nZ)}s(rZ,"isArrayType");var iZ="BooleanLiteral";function aZ(t){return SQ.isInstance(t,iZ)}s(aZ,"isBooleanLiteral");var sZ="Conjunction";function oZ(t){return SQ.isInstance(t,sZ)}s(oZ,"isConjunction");var lZ="Disjunction";function cZ(t){return SQ.isInstance(t,lZ)}s(cZ,"isDisjunction");var hZ="Grammar";function uZ(t){return SQ.isInstance(t,hZ)}s(uZ,"isGrammar");var dZ="GrammarImport";function pZ(t){return SQ.isInstance(t,dZ)}s(pZ,"isGrammarImport");var gZ="InferredType";function fZ(t){return SQ.isInstance(t,gZ)}s(fZ,"isInferredType");var mZ="Interface";function yZ(t){return SQ.isInstance(t,mZ)}s(yZ,"isInterface");var vZ="NamedArgument";function xZ(t){return SQ.isInstance(t,vZ)}s(xZ,"isNamedArgument");var bZ="Negation";function wZ(t){return SQ.isInstance(t,bZ)}s(wZ,"isNegation");var kZ="NumberLiteral";function TZ(t){return SQ.isInstance(t,kZ)}s(TZ,"isNumberLiteral");var _Z="Parameter";function EZ(t){return SQ.isInstance(t,_Z)}s(EZ,"isParameter");var CZ="ParameterReference";function SZ(t){return SQ.isInstance(t,CZ)}s(SZ,"isParameterReference");var AZ="ParserRule";function LZ(t){return SQ.isInstance(t,AZ)}s(LZ,"isParserRule");var NZ="ReferenceType";function IZ(t){return SQ.isInstance(t,NZ)}s(IZ,"isReferenceType");var MZ="ReturnType";function RZ(t){return SQ.isInstance(t,MZ)}s(RZ,"isReturnType");var DZ="SimpleType";function OZ(t){return SQ.isInstance(t,DZ)}s(OZ,"isSimpleType");var PZ="StringLiteral";function BZ(t){return SQ.isInstance(t,PZ)}s(BZ,"isStringLiteral");var $Z="TerminalRule";function FZ(t){return SQ.isInstance(t,$Z)}s(FZ,"isTerminalRule");var zZ="Type";function UZ(t){return SQ.isInstance(t,zZ)}s(UZ,"isType");var GZ="TypeAttribute";function qZ(t){return SQ.isInstance(t,GZ)}s(qZ,"isTypeAttribute");var jZ="UnionType";function YZ(t){return SQ.isInstance(t,jZ)}s(YZ,"isUnionType");var WZ="Action";function HZ(t){return SQ.isInstance(t,WZ)}s(HZ,"isAction");var VZ="Alternatives";function XZ(t){return SQ.isInstance(t,VZ)}s(XZ,"isAlternatives");var KZ="Assignment";function ZZ(t){return SQ.isInstance(t,KZ)}s(ZZ,"isAssignment");var QZ="CharacterRange";function JZ(t){return SQ.isInstance(t,QZ)}s(JZ,"isCharacterRange");var tQ="CrossReference";function eQ(t){return SQ.isInstance(t,tQ)}s(eQ,"isCrossReference");var nQ="EndOfFile";function rQ(t){return SQ.isInstance(t,nQ)}s(rQ,"isEndOfFile");var iQ="Group";function aQ(t){return SQ.isInstance(t,iQ)}s(aQ,"isGroup");var sQ="Keyword";function oQ(t){return SQ.isInstance(t,sQ)}s(oQ,"isKeyword");var lQ="NegatedToken";function cQ(t){return SQ.isInstance(t,lQ)}s(cQ,"isNegatedToken");var hQ="RegexToken";function uQ(t){return SQ.isInstance(t,hQ)}s(uQ,"isRegexToken");var dQ="RuleCall";function pQ(t){return SQ.isInstance(t,dQ)}s(pQ,"isRuleCall");var gQ="TerminalAlternatives";function fQ(t){return SQ.isInstance(t,gQ)}s(fQ,"isTerminalAlternatives");var mQ="TerminalGroup";function yQ(t){return SQ.isInstance(t,mQ)}s(yQ,"isTerminalGroup");var vQ="TerminalRuleCall";function xQ(t){return SQ.isInstance(t,vQ)}s(xQ,"isTerminalRuleCall");var bQ="UnorderedGroup";function wQ(t){return SQ.isInstance(t,bQ)}s(wQ,"isUnorderedGroup");var kQ="UntilToken";function TQ(t){return SQ.isInstance(t,kQ)}s(TQ,"isUntilToken");var _Q="Wildcard";function EQ(t){return SQ.isInstance(t,_Q)}s(EQ,"isWildcard");var CQ=class extends eK{static{s(this,"LangiumGrammarAstReflection")}getAllTypes(){return["AbstractElement","AbstractRule","AbstractType","Action","Alternatives","ArrayLiteral","ArrayType","Assignment","BooleanLiteral","CharacterRange","Condition","Conjunction","CrossReference","Disjunction","EndOfFile","Grammar","GrammarImport","Group","InferredType","Interface","Keyword","NamedArgument","NegatedToken","Negation","NumberLiteral","Parameter","ParameterReference","ParserRule","ReferenceType","RegexToken","ReturnType","RuleCall","SimpleType","StringLiteral","TerminalAlternatives","TerminalGroup","TerminalRule","TerminalRuleCall","Type","TypeAttribute","TypeDefinition","UnionType","UnorderedGroup","UntilToken","ValueLiteral","Wildcard"]}computeIsSubtype(t,e){switch(t){case WZ:case VZ:case KZ:case QZ:case tQ:case nQ:case iQ:case sQ:case lQ:case hQ:case dQ:case gQ:case mQ:case vQ:case bQ:case kQ:case _Q:return this.isSubtype(QK,e);case tZ:case kZ:case PZ:return this.isSubtype(KK,e);case nZ:case NZ:case DZ:case jZ:return this.isSubtype(VK,e);case iZ:return this.isSubtype(jK,e)||this.isSubtype(KK,e);case sZ:case lZ:case bZ:case CZ:return this.isSubtype(jK,e);case gZ:case mZ:case zZ:return this.isSubtype(GK,e);case AZ:return this.isSubtype(zK,e)||this.isSubtype(GK,e);case $Z:return this.isSubtype(zK,e);default:return!1}}getReferenceType(t){const e=`${t.container.$type}:${t.property}`;switch(e){case"Action:type":case"CrossReference:type":case"Interface:superTypes":case"ParserRule:returnType":case"SimpleType:typeRef":return GK;case"Grammar:hiddenTokens":case"ParserRule:hiddenTokens":case"RuleCall:rule":return zK;case"Grammar:usedGrammars":return hZ;case"NamedArgument:parameter":case"ParameterReference:parameter":return _Z;case"TerminalRuleCall:rule":return $Z;default:throw new Error(`${e} is not a valid reference id.`)}}getTypeMetaData(t){switch(t){case"AbstractElement":return{name:"AbstractElement",properties:[{name:"cardinality"},{name:"lookahead"}]};case"ArrayLiteral":return{name:"ArrayLiteral",properties:[{name:"elements",defaultValue:[]}]};case"ArrayType":return{name:"ArrayType",properties:[{name:"elementType"}]};case"BooleanLiteral":return{name:"BooleanLiteral",properties:[{name:"true",defaultValue:!1}]};case"Conjunction":return{name:"Conjunction",properties:[{name:"left"},{name:"right"}]};case"Disjunction":return{name:"Disjunction",properties:[{name:"left"},{name:"right"}]};case"Grammar":return{name:"Grammar",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"GrammarImport":return{name:"GrammarImport",properties:[{name:"path"}]};case"InferredType":return{name:"InferredType",properties:[{name:"name"}]};case"Interface":return{name:"Interface",properties:[{name:"attributes",defaultValue:[]},{name:"name"},{name:"superTypes",defaultValue:[]}]};case"NamedArgument":return{name:"NamedArgument",properties:[{name:"calledByName",defaultValue:!1},{name:"parameter"},{name:"value"}]};case"Negation":return{name:"Negation",properties:[{name:"value"}]};case"NumberLiteral":return{name:"NumberLiteral",properties:[{name:"value"}]};case"Parameter":return{name:"Parameter",properties:[{name:"name"}]};case"ParameterReference":return{name:"ParameterReference",properties:[{name:"parameter"}]};case"ParserRule":return{name:"ParserRule",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"ReferenceType":return{name:"ReferenceType",properties:[{name:"referenceType"}]};case"ReturnType":return{name:"ReturnType",properties:[{name:"name"}]};case"SimpleType":return{name:"SimpleType",properties:[{name:"primitiveType"},{name:"stringType"},{name:"typeRef"}]};case"StringLiteral":return{name:"StringLiteral",properties:[{name:"value"}]};case"TerminalRule":return{name:"TerminalRule",properties:[{name:"definition"},{name:"fragment",defaultValue:!1},{name:"hidden",defaultValue:!1},{name:"name"},{name:"type"}]};case"Type":return{name:"Type",properties:[{name:"name"},{name:"type"}]};case"TypeAttribute":return{name:"TypeAttribute",properties:[{name:"defaultValue"},{name:"isOptional",defaultValue:!1},{name:"name"},{name:"type"}]};case"UnionType":return{name:"UnionType",properties:[{name:"types",defaultValue:[]}]};case"Action":return{name:"Action",properties:[{name:"cardinality"},{name:"feature"},{name:"inferredType"},{name:"lookahead"},{name:"operator"},{name:"type"}]};case"Alternatives":return{name:"Alternatives",properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"lookahead"}]};case"Assignment":return{name:"Assignment",properties:[{name:"cardinality"},{name:"feature"},{name:"lookahead"},{name:"operator"},{name:"terminal"}]};case"CharacterRange":return{name:"CharacterRange",properties:[{name:"cardinality"},{name:"left"},{name:"lookahead"},{name:"right"}]};case"CrossReference":return{name:"CrossReference",properties:[{name:"cardinality"},{name:"deprecatedSyntax",defaultValue:!1},{name:"lookahead"},{name:"terminal"},{name:"type"}]};case"EndOfFile":return{name:"EndOfFile",properties:[{name:"cardinality"},{name:"lookahead"}]};case"Group":return{name:"Group",properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"guardCondition"},{name:"lookahead"}]};case"Keyword":return{name:"Keyword",properties:[{name:"cardinality"},{name:"lookahead"},{name:"value"}]};case"NegatedToken":return{name:"NegatedToken",properties:[{name:"cardinality"},{name:"lookahead"},{name:"terminal"}]};case"RegexToken":return{name:"RegexToken",properties:[{name:"cardinality"},{name:"lookahead"},{name:"regex"}]};case"RuleCall":return{name:"RuleCall",properties:[{name:"arguments",defaultValue:[]},{name:"cardinality"},{name:"lookahead"},{name:"rule"}]};case"TerminalAlternatives":return{name:"TerminalAlternatives",properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"lookahead"}]};case"TerminalGroup":return{name:"TerminalGroup",properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"lookahead"}]};case"TerminalRuleCall":return{name:"TerminalRuleCall",properties:[{name:"cardinality"},{name:"lookahead"},{name:"rule"}]};case"UnorderedGroup":return{name:"UnorderedGroup",properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"lookahead"}]};case"UntilToken":return{name:"UntilToken",properties:[{name:"cardinality"},{name:"lookahead"},{name:"terminal"}]};case"Wildcard":return{name:"Wildcard",properties:[{name:"cardinality"},{name:"lookahead"}]};default:return{name:t,properties:[]}}}},SQ=new CQ,AQ={};function LQ(t){for(const[e,n]of Object.entries(t))e.startsWith("$")||(Array.isArray(n)?n.forEach(((n,r)=>{ZX(n)&&(n.$container=t,n.$containerProperty=e,n.$containerIndex=r)})):ZX(n)&&(n.$container=t,n.$containerProperty=e))}function NQ(t,e){let n=t;for(;n;){if(e(n))return n;n=n.$container}}function IQ(t,e){let n=t;for(;n;){if(e(n))return!0;n=n.$container}return!1}function MQ(t){const e=RQ(t).$document;if(!e)throw new Error("AST node has no document.");return e}function RQ(t){for(;t.$container;)t=t.$container;return t}function DQ(t,e){if(!t)throw new Error("Node must be an AstNode.");const n=null==e?void 0:e.range;return new aK((()=>({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 i=t[r];if(ZX(i)){if(e.keyIndex++,BQ(i,n))return{done:!1,value:i}}else if(Array.isArray(i)){for(;e.arrayIndex<i.length;){const t=i[e.arrayIndex++];if(ZX(t)&&BQ(t,n))return{done:!1,value:t}}e.arrayIndex=0}}e.keyIndex++}return cK}))}function OQ(t,e){if(!t)throw new Error("Root node must be an AstNode.");return new gK(t,(t=>DQ(t,e)))}function PQ(t,e){if(!t)throw new Error("Root node must be an AstNode.");return(null==e?void 0:e.range)&&!BQ(t,e.range)?new gK(t,(()=>[])):new gK(t,(t=>DQ(t,e)),{includeRoot:!0})}function BQ(t,e){var n;if(!e)return!0;const r=null===(n=t.$cstNode)||void 0===n?void 0:n.range;return!!r&&wK(r,e)}function $Q(t){return new aK((()=>({keys:Object.keys(t),keyIndex:0,arrayIndex:0})),(e=>{for(;e.keyIndex<e.keys.length;){const n=e.keys[e.keyIndex];if(!n.startsWith("$")){const r=t[n];if(QX(r))return e.keyIndex++,{done:!1,value:{reference:r,container:t,property:n}};if(Array.isArray(r)){for(;e.arrayIndex<r.length;){const i=e.arrayIndex++,a=r[i];if(QX(a))return{done:!1,value:{reference:a,container:t,property:n,index:i}}}e.arrayIndex=0}}e.keyIndex++}return cK}))}function FQ(t,e=MQ(t).parseResult.value){const n=[];return PQ(e).forEach((e=>{$Q(e).forEach((e=>{e.reference.ref===t&&n.push(e.reference)}))})),hK(n)}function zQ(t,e){const n=t.getTypeMetaData(e.$type),r=e;for(const t of n.properties)void 0!==t.defaultValue&&void 0===r[t.name]&&(r[t.name]=UQ(t.defaultValue))}function UQ(t){return Array.isArray(t)?[...t.map(UQ)]:t}function GQ(t,e){const n={$type:t.$type};for(const[r,i]of Object.entries(t))if(!r.startsWith("$"))if(ZX(i))n[r]=GQ(i,e);else if(QX(i))n[r]=e(n,r,i.$refNode,i.$refText);else if(Array.isArray(i)){const t=[];for(const a of i)ZX(a)?t.push(GQ(a,e)):QX(a)?t.push(e(n,r,a.$refNode,a.$refText)):t.push(a);n[r]=t}else n[r]=i;return LQ(n),n}l(AQ,{assignMandatoryProperties:()=>zQ,copyAstNode:()=>GQ,findLocalReferences:()=>FQ,findRootNode:()=>RQ,getContainerOfType:()=>NQ,getDocument:()=>MQ,hasContainerOfType:()=>IQ,linkContentToContainer:()=>LQ,streamAllContents:()=>OQ,streamAst:()=>PQ,streamContents:()=>DQ,streamReferences:()=>$Q}),s(LQ,"linkContentToContainer"),s(NQ,"getContainerOfType"),s(IQ,"hasContainerOfType"),s(MQ,"getDocument"),s(RQ,"findRootNode"),s(DQ,"streamContents"),s(OQ,"streamAllContents"),s(PQ,"streamAst"),s(BQ,"isAstNodeInRange"),s($Q,"streamReferences"),s(FQ,"findLocalReferences"),s(zQ,"assignMandatoryProperties"),s(UQ,"copyDefaultValue"),s(GQ,"copyAstNode");var qQ={};function jQ(t){return t.charCodeAt(0)}function YQ(t,e){Array.isArray(t)?t.forEach((function(t){e.push(t)})):e.push(t)}function WQ(t,e){if(!0===t[e])throw"duplicate flag "+e;t[e],t[e]=!0}function HQ(t){if(void 0===t)throw Error("Internal Error - Should never get here!");return!0}function VQ(){throw Error("Internal Error - Should never get here!")}function XQ(t){return"Character"===t.type}l(qQ,{NEWLINE_REGEXP:()=>iJ,escapeRegExp:()=>uJ,getCaseInsensitivePattern:()=>dJ,getTerminalParts:()=>lJ,isMultilineComment:()=>cJ,isWhitespace:()=>hJ,partialMatches:()=>pJ,partialRegExp:()=>gJ}),s(jQ,"cc"),s(YQ,"insertToSet"),s(WQ,"addFlag"),s(HQ,"ASSERT_EXISTS"),s(VQ,"ASSERT_NEVER_REACH_HERE"),s(XQ,"isCharacter");var KQ=[];for(let t=jQ("0");t<=jQ("9");t++)KQ.push(t);var ZQ=[jQ("_")].concat(KQ);for(let t=jQ("a");t<=jQ("z");t++)ZQ.push(t);for(let t=jQ("A");t<=jQ("Z");t++)ZQ.push(t);var QQ=[jQ(" "),jQ("\f"),jQ("\n"),jQ("\r"),jQ("\t"),jQ("\v"),jQ("\t"),jQ(" "),jQ(" "),jQ(" "),jQ(" "),jQ(" "),jQ(" "),jQ(" "),jQ(" "),jQ(" "),jQ(" "),jQ(" "),jQ(" "),jQ(" "),jQ("\u2028"),jQ("\u2029"),jQ(" "),jQ(" "),jQ(" "),jQ("\ufeff")],JQ=/[0-9a-fA-F]/,tJ=/[0-9]/,eJ=/[1-9]/,nJ=class{static{s(this,"RegExpParser")}constructor(){this.idx=0,this.input="",this.groupIdx=0}saveState(){return{idx:this.idx,input:this.input,groupIdx:this.groupIdx}}restoreState(t){this.idx=t.idx,this.input=t.input,this.groupIdx=t.groupIdx}pattern(t){this.idx=0,this.input=t,this.groupIdx=0,this.consumeChar("/");const e=this.disjunction();this.consumeChar("/");const n={type:"Flags",loc:{begin:this.idx,end:t.length},global:!1,ignoreCase:!1,multiLine:!1,unicode:!1,sticky:!1};for(;this.isRegExpFlag();)switch(this.popChar()){case"g":WQ(n,"global");break;case"i":WQ(n,"ignoreCase");break;case"m":WQ(n,"multiLine");break;case"u":WQ(n,"unicode");break;case"y":WQ(n,"sticky")}if(this.idx!==this.input.length)throw Error("Redundant input: "+this.input.substring(this.idx));return{type:"Pattern",flags:n,value:e,loc:this.loc(0)}}disjunction(){const t=[],e=this.idx;for(t.push(this.alternative());"|"===this.peekChar();)this.consumeChar("|"),t.push(this.alternative());return{type:"Disjunction",value:t,loc:this.loc(e)}}alternative(){const t=[],e=this.idx;for(;this.isTerm();)t.push(this.term());return{type:"Alternative",value:t,loc:this.loc(e)}}term(){return this.isAssertion()?this.assertion():this.atom()}assertion(){const t=this.idx;switch(this.popChar()){case"^":return{type:"StartAnchor",loc:this.loc(t)};case"$":return{type:"EndAnchor",loc:this.loc(t)};case"\\":switch(this.popChar()){case"b":return{type:"WordBoundary",loc:this.loc(t)};case"B":return{type:"NonWordBoundary",loc:this.loc(t)}}throw Error("Invalid Assertion Escape");case"(":let e;switch(this.consumeChar("?"),this.popChar()){case"=":e="Lookahead";break;case"!":e="NegativeLookahead"}HQ(e);const n=this.disjunction();return this.consumeChar(")"),{type:e,value:n,loc:this.loc(t)}}return VQ()}quantifier(t=!1){let e;const n=this.idx;switch(this.popChar()){case"*":e={atLeast:0,atMost:1/0};break;case"+":e={atLeast:1,atMost:1/0};break;case"?":e={atLeast:0,atMost:1};break;case"{":const n=this.integerIncludingZero();switch(this.popChar()){case"}":e={atLeast:n,atMost:n};break;case",":let t;this.isDigit()?(t=this.integerIncludingZero(),e={atLeast:n,atMost:t}):e={atLeast:n,atMost:1/0},this.consumeChar("}")}if(!0===t&&void 0===e)return;HQ(e)}if(!0!==t||void 0!==e)return HQ(e)?("?"===this.peekChar(0)?(this.consumeChar("?"),e.greedy=!1):e.greedy=!0,e.type="Quantifier",e.loc=this.loc(n),e):void 0}atom(){let t;const e=this.idx;switch(this.peekChar()){case".":t=this.dotAll();break;case"\\":t=this.atomEscape();break;case"[":t=this.characterClass();break;case"(":t=this.group()}if(void 0===t&&this.isPatternCharacter()&&(t=this.patternCharacter()),HQ(t))return t.loc=this.loc(e),this.isQuantifier()&&(t.quantifier=this.quantifier()),t}dotAll(){return this.consumeChar("."),{type:"Set",complement:!0,value:[jQ("\n"),jQ("\r"),jQ("\u2028"),jQ("\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 t,e=!1;switch(this.popChar()){case"d":t=KQ;break;case"D":t=KQ,e=!0;break;case"s":t=QQ;break;case"S":t=QQ,e=!0;break;case"w":t=ZQ;break;case"W":t=ZQ,e=!0}if(HQ(t))return{type:"Set",value:t,complement:e}}controlEscapeAtom(){let t;switch(this.popChar()){case"f":t=jQ("\f");break;case"n":t=jQ("\n");break;case"r":t=jQ("\r");break;case"t":t=jQ("\t");break;case"v":t=jQ("\v")}if(HQ(t))return{type:"Character",value:t}}controlLetterEscapeAtom(){this.consumeChar("c");const t=this.popChar();if(!1===/[a-zA-Z]/.test(t))throw Error("Invalid ");return{type:"Character",value:t.toUpperCase().charCodeAt(0)-64}}nulCharacterAtom(){return this.consumeChar("0"),{type:"Character",value:jQ("\0")}}hexEscapeSequenceAtom(){return this.consumeChar("x"),this.parseHexDigits(2)}regExpUnicodeEscapeSequenceAtom(){return this.consumeChar("u"),this.parseHexDigits(4)}identityEscapeAtom(){return{type:"Character",value:jQ(this.popChar())}}classPatternCharacterAtom(){switch(this.peekChar()){case"\n":case"\r":case"\u2028":case"\u2029":case"\\":case"]":throw Error("TBD");default:return{type:"Character",value:jQ(this.popChar())}}}characterClass(){const t=[];let e=!1;for(this.consumeChar("["),"^"===this.peekChar(0)&&(this.consumeChar("^"),e=!0);this.isClassAtom();){const e=this.classAtom();if(e.type,XQ(e)&&this.isRangeDash()){this.consumeChar("-");const n=this.classAtom();if(n.type,XQ(n)){if(n.value<e.value)throw Error("Range out of order in character class");t.push({from:e.value,to:n.value})}else YQ(e.value,t),t.push(jQ("-")),YQ(n.value,t)}else YQ(e.value,t)}return this.consumeChar("]"),{type:"Set",complement:e,value:t}}classAtom(){switch(this.peekChar()){case"]":case"\n":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:jQ("\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 t=!0;if(this.consumeChar("("),"?"===this.peekChar(0))this.consumeChar("?"),this.consumeChar(":"),t=!1;else this.groupIdx++;const e=this.disjunction();this.consumeChar(")");const n={type:"Group",capturing:t,value:e};return t&&(n.idx=this.groupIdx),n}positiveInteger(){let t=this.popChar();if(!1===eJ.test(t))throw Error("Expecting a positive integer");for(;tJ.test(this.peekChar(0));)t+=this.popChar();return parseInt(t,10)}integerIncludingZero(){let t=this.popChar();if(!1===tJ.test(t))throw Error("Expecting an integer");for(;tJ.test(this.peekChar(0));)t+=this.popChar();return parseInt(t,10)}patternCharacter(){const t=this.popChar();switch(t){case"\n":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:jQ(t)}}}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 tJ.test(this.peekChar(0))}isClassAtom(t=0){switch(this.peekChar(t)){case"]":case"\n":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 t=this.saveState();try{return void 0!==this.quantifier(!0)}catch(t){return!1}finally{this.restoreState(t)}}isPatternCharacter(){switch(this.peekChar()){case"^":case"$":case"\\":case".":case"*":case"+":case"?":case"(":case")":case"[":case"|":case"/":case"\n":case"\r":case"\u2028":case"\u2029":return!1;default:return!0}}parseHexDigits(t){let e="";for(let n=0;n<t;n++){const t=this.popChar();if(!1===JQ.test(t))throw Error("Expecting a HexDecimal digits");e+=t}return{type:"Character",value:parseInt(e,16)}}peekChar(t=0){return this.input[this.idx+t]}popChar(){const t=this.peekChar(0);return this.consumeChar(void 0),t}consumeChar(t){if(void 0!==t&&this.input[this.idx]!==t)throw Error("Expected: '"+t+"' 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(t){return{begin:t,end:this.idx}}},rJ=class{static{s(this,"BaseRegExpVisitor")}visitChildren(t){for(const e in t){const n=t[e];t.hasOwnProperty(e)&&(void 0!==n.type?this.visit(n):Array.isArray(n)&&n.forEach((t=>{this.visit(t)}),this))}}visit(t){switch(t.type){case"Pattern":this.visitPattern(t);break;case"Flags":this.visitFlags(t);break;case"Disjunction":this.visitDisjunction(t);break;case"Alternative":this.visitAlternative(t);break;case"StartAnchor":this.visitStartAnchor(t);break;case"EndAnchor":this.visitEndAnchor(t);break;case"WordBoundary":this.visitWordBoundary(t);break;case"NonWordBoundary":this.visitNonWordBoundary(t);break;case"Lookahead":this.visitLookahead(t);break;case"NegativeLookahead":this.visitNegativeLookahead(t);break;case"Character":this.visitCharacter(t);break;case"Set":this.visitSet(t);break;case"Group":this.visitGroup(t);break;case"GroupBackReference":this.visitGroupBackReference(t);break;case"Quantifier":this.visitQuantifier(t)}this.visitChildren(t)}visitPattern(t){}visitFlags(t){}visitDisjunction(t){}visitAlternative(t){}visitStartAnchor(t){}visitEndAnchor(t){}visitWordBoundary(t){}visitNonWordBoundary(t){}visitLookahead(t){}visitNegativeLookahead(t){}visitCharacter(t){}visitSet(t){}visitGroup(t){}visitGroupBackReference(t){}visitQuantifier(t){}},iJ=/\r?\n/gm,aJ=new nJ,sJ=class extends rJ{static{s(this,"TerminalRegExpVisitor")}constructor(){super(...arguments),this.isStarting=!0,this.endRegexpStack=[],this.multiline=!1}get endRegex(){return this.endRegexpStack.join("")}reset(t){this.multiline=!1,this.regex=t,this.startRegexp="",this.isStarting=!0,this.endRegexpStack=[]}visitGroup(t){t.quantifier&&(this.isStarting=!1,this.endRegexpStack=[])}visitCharacter(t){const e=String.fromCharCode(t.value);if(this.multiline||"\n"!==e||(this.multiline=!0),t.quantifier)this.isStarting=!1,this.endRegexpStack=[];else{const t=uJ(e);this.endRegexpStack.push(t),this.isStarting&&(this.startRegexp+=t)}}visitSet(t){if(!this.multiline){const e=this.regex.substring(t.loc.begin,t.loc.end),n=new RegExp(e);this.multiline=Boolean("\n".match(n))}if(t.quantifier)this.isStarting=!1,this.endRegexpStack=[];else{const e=this.regex.substring(t.loc.begin,t.loc.end);this.endRegexpStack.push(e),this.isStarting&&(this.startRegexp+=e)}}visitChildren(t){if("Group"===t.type){if(t.quantifier)return}super.visitChildren(t)}},oJ=new sJ;function lJ(t){try{"string"!=typeof t&&(t=t.source),t=`/${t}/`;const e=aJ.pattern(t),n=[];for(const r of e.value.value)oJ.reset(t),oJ.visit(r),n.push({start:oJ.startRegexp,end:oJ.endRegex});return n}catch(t){return[]}}function cJ(t){try{return"string"==typeof t&&(t=new RegExp(t)),t=t.toString(),oJ.reset(t),oJ.visit(aJ.pattern(t)),oJ.multiline}catch(t){return!1}}function hJ(t){return("string"==typeof t?new RegExp(t):t).test(" ")}function uJ(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function dJ(t){return Array.prototype.map.call(t,(t=>/\w/.test(t)?`[${t.toLowerCase()}${t.toUpperCase()}]`:uJ(t))).join("")}function pJ(t,e){const n=gJ(t),r=e.match(n);return!!r&&r[0].length>0}function gJ(t){"string"==typeof t&&(t=new RegExp(t));const e=t,n=t.source;let r=0;function i(){let t,a="";function o(t){a+=n.substr(r,t),r+=t}function l(t){a+="(?:"+n.substr(r,t)+"|$)",r+=t}for(s(o,"appendRaw"),s(l,"appendOptional");r<n.length;)switch(n[r]){case"\\":switch(n[r+1]){case"c":l(3);break;case"x":l(4);break;case"u":e.unicode?"{"===n[r+2]?l(n.indexOf("}",r)-r+1):l(6):l(2);break;case"p":case"P":e.unicode?l(n.indexOf("}",r)-r+1):l(2);break;case"k":l(n.indexOf(">",r)-r+1);break;default:l(2)}break;case"[":t=/\[(?:\\.|.)*?\]/g,t.lastIndex=r,t=t.exec(n)||[],l(t[0].length);break;case"|":case"^":case"$":case"*":case"+":case"?":o(1);break;case"{":t=/\{\d+,?\d*\}/g,t.lastIndex=r,t=t.exec(n),t?o(t[0].length):l(1);break;case"(":if("?"===n[r+1])switch(n[r+2]){case":":a+="(?:",r+=3,a+=i()+"|$)";break;case"=":a+="(?=",r+=3,a+=i()+")";break;case"!":t=r,r+=3,i(),a+=n.substr(t,r-t);break;case"<":switch(n[r+3]){case"=":case"!":t=r,r+=4,i(),a+=n.substr(t,r-t);break;default:o(n.indexOf(">",r)-r+1),a+=i()+"|$)"}}else o(1),a+=i()+"|$)";break;case")":return++r,a;default:l(1)}return a}return s(i,"process"),new RegExp(i(),t.flags)}function fJ(t){return t.rules.find((t=>LZ(t)&&t.entry))}function mJ(t){return t.rules.filter((t=>FZ(t)&&t.hidden))}function yJ(t,e){const n=new Set,r=fJ(t);if(!r)return new Set(t.rules);const i=[r].concat(mJ(t));for(const t of i)vJ(t,n,e);const a=new Set;for(const e of t.rules)(n.has(e.name)||FZ(e)&&e.hidden)&&a.add(e);return a}function vJ(t,e,n){e.add(t.name),OQ(t).forEach((t=>{if(pQ(t)||n&&xQ(t)){const r=t.rule.ref;r&&!e.has(r.name)&&vJ(r,e,n)}}))}function xJ(t){if(t.terminal)return t.terminal;if(t.type.ref){const e=AJ(t.type.ref);return null==e?void 0:e.terminal}}function bJ(t){return t.hidden&&!GJ(t).test(" ")}function wJ(t,e){return t&&e?TJ(t,e,t.astNode,!0):[]}function kJ(t,e,n){if(!t||!e)return;const r=TJ(t,e,t.astNode,!0);return 0!==r.length?r[n=void 0!==n?Math.max(0,Math.min(n,r.length-1)):0]:void 0}function TJ(t,e,n,r){if(!r){const n=NQ(t.grammarSource,ZZ);if(n&&n.feature===e)return[t]}return nK(t)&&t.astNode===n?t.content.flatMap((t=>TJ(t,e,n,!1))):[]}function _J(t,e){return t?CJ(t,e,null==t?void 0:t.astNode):[]}function EJ(t,e,n){if(!t)return;const r=CJ(t,e,null==t?void 0:t.astNode);return 0!==r.length?r[n=void 0!==n?Math.max(0,Math.min(n,r.length-1)):0]:void 0}function CJ(t,e,n){if(t.astNode!==n)return[];if(oQ(t.grammarSource)&&t.grammarSource.value===e)return[t];const r=fK(t).iterator();let i;const a=[];do{if(i=r.next(),!i.done){const t=i.value;t.astNode===n?oQ(t.grammarSource)&&t.grammarSource.value===e&&a.push(t):r.prune()}}while(!i.done);return a}function SJ(t){var e;const n=t.astNode;for(;n===(null===(e=t.container)||void 0===e?void 0:e.astNode);){const e=NQ(t.grammarSource,ZZ);if(e)return e;t=t.container}}function AJ(t){let e=t;return fZ(e)&&(HZ(e.$container)?e=e.$container.$container:LZ(e.$container)?e=e.$container:BK(e.$container)),LJ(t,e,new Map)}function LJ(t,e,n){var r;function i(e,r){let i;return NQ(e,ZZ)||(i=LJ(r,r,n)),n.set(t,i),i}if(s(i,"go"),n.has(t))return n.get(t);n.set(t,void 0);for(const a of OQ(e)){if(ZZ(a)&&"name"===a.feature.toLowerCase())return n.set(t,a),a;if(pQ(a)&&LZ(a.rule.ref))return i(a,a.rule.ref);if(OZ(a)&&(null===(r=a.typeRef)||void 0===r?void 0:r.ref))return i(a,a.typeRef.ref)}}function NJ(t){const e=t.$container;if(aQ(e)){const n=e.elements;for(let e=n.indexOf(t)-1;e>=0;e--){const t=n[e];if(HZ(t))return t;{const t=OQ(n[e]).find(HZ);if(t)return t}}}return JK(e)?NJ(e):void 0}function IJ(t,e){return"?"===t||"*"===t||aQ(e)&&Boolean(e.guardCondition)}function MJ(t){return"*"===t||"+"===t}function RJ(t){return"+="===t}function DJ(t){return OJ(t,new Set)}function OJ(t,e){if(e.has(t))return!0;e.add(t);for(const n of OQ(t))if(pQ(n)){if(!n.rule.ref)return!1;if(LZ(n.rule.ref)&&!OJ(n.rule.ref,e))return!1}else{if(ZZ(n))return!1;if(HZ(n))return!1}return Boolean(t.definition)}function PJ(t){return BJ(t.type,new Set)}function BJ(t,e){if(e.has(t))return!0;if(e.add(t),rZ(t))return!1;if(IZ(t))return!1;if(YZ(t))return t.types.every((t=>BJ(t,e)));if(OZ(t)){if(void 0!==t.primitiveType)return!0;if(void 0!==t.stringType)return!0;if(void 0!==t.typeRef){const n=t.typeRef.ref;return!!UZ(n)&&BJ(n.type,e)}return!1}return!1}function $J(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(LZ(e))return e.name;if(yZ(e)||UZ(e))return e.name}}}function FJ(t){var e;if(LZ(t))return DJ(t)?t.name:null!==(e=$J(t))&&void 0!==e?e:t.name;if(yZ(t)||UZ(t)||RZ(t))return t.name;if(HZ(t)){const e=zJ(t);if(e)return e}else if(fZ(t))return t.name;throw new Error("Cannot get name of Unknown Type")}function zJ(t){var e;return t.inferredType?t.inferredType.name:(null===(e=t.type)||void 0===e?void 0:e.ref)?FJ(t.type.ref):void 0}function UJ(t){var e,n,r;return FZ(t)?null!==(n=null===(e=t.type)||void 0===e?void 0:e.name)&&void 0!==n?n:"string":DJ(t)?t.name:null!==(r=$J(t))&&void 0!==r?r:t.name}function GJ(t){const e={s:!1,i:!1,u:!1},n=jJ(t.definition,e),r=Object.entries(e).filter((([,t])=>t)).map((([t])=>t)).join("");return new RegExp(n,r)}s(lJ,"getTerminalParts"),s(cJ,"isMultilineComment"),s(hJ,"isWhitespace"),s(uJ,"escapeRegExp"),s(dJ,"getCaseInsensitivePattern"),s(pJ,"partialMatches"),s(gJ,"partialRegExp"),s(fJ,"getEntryRule"),s(mJ,"getHiddenRules"),s(yJ,"getAllReachableRules"),s(vJ,"ruleDfs"),s(xJ,"getCrossReferenceTerminal"),s(bJ,"isCommentTerminal"),s(wJ,"findNodesForProperty"),s(kJ,"findNodeForProperty"),s(TJ,"findNodesForPropertyInternal"),s(_J,"findNodesForKeyword"),s(EJ,"findNodeForKeyword"),s(CJ,"findNodesForKeywordInternal"),s(SJ,"findAssignment"),s(AJ,"findNameAssignment"),s(LJ,"findNameAssignmentInternal"),s(NJ,"getActionAtElement"),s(IJ,"isOptionalCardinality"),s(MJ,"isArrayCardinality"),s(RJ,"isArrayOperator"),s(DJ,"isDataTypeRule"),s(OJ,"isDataTypeRuleInternal"),s(PJ,"isDataType"),s(BJ,"isDataTypeInternal"),s($J,"getExplicitRuleType"),s(FJ,"getTypeName"),s(zJ,"getActionType"),s(UJ,"getRuleType"),s(GJ,"terminalRegex");var qJ=/[\s\S]/.source;function jJ(t,e){if(fQ(t))return YJ(t);if(yQ(t))return WJ(t);if(JZ(t))return XJ(t);if(xQ(t)){const e=t.rule.ref;if(!e)throw new Error("Missing rule reference.");return ZJ(jJ(e.definition),{cardinality:t.cardinality,lookahead:t.lookahead})}if(cQ(t))return VJ(t);if(TQ(t))return HJ(t);if(uQ(t)){const n=t.regex.lastIndexOf("/"),r=t.regex.substring(1,n),i=t.regex.substring(n+1);return e&&(e.i=i.includes("i"),e.s=i.includes("s"),e.u=i.includes("u")),ZJ(r,{cardinality:t.cardinality,lookahead:t.lookahead,wrap:!1})}if(EQ(t))return ZJ(qJ,{cardinality:t.cardinality,lookahead:t.lookahead});throw new Error(`Invalid terminal element: ${null==t?void 0:t.$type}`)}function YJ(t){return ZJ(t.elements.map((t=>jJ(t))).join("|"),{cardinality:t.cardinality,lookahead:t.lookahead})}function WJ(t){return ZJ(t.elements.map((t=>jJ(t))).join(""),{cardinality:t.cardinality,lookahead:t.lookahead})}function HJ(t){return ZJ(`${qJ}*?${jJ(t.terminal)}`,{cardinality:t.cardinality,lookahead:t.lookahead})}function VJ(t){return ZJ(`(?!${jJ(t.terminal)})${qJ}*?`,{cardinality:t.cardinality,lookahead:t.lookahead})}function XJ(t){return t.right?ZJ(`[${KJ(t.left)}-${KJ(t.right)}]`,{cardinality:t.cardinality,lookahead:t.lookahead,wrap:!1}):ZJ(KJ(t.left),{cardinality:t.cardinality,lookahead:t.lookahead,wrap:!1})}function KJ(t){return uJ(t.value)}function ZJ(t,e){var n;return(!1!==e.wrap||e.lookahead)&&(t=`(${null!==(n=e.lookahead)&&void 0!==n?n:""}${t})`),e.cardinality?`${t}${e.cardinality}`:t}function QJ(t){const e=[],n=t.Grammar;for(const t of n.rules)FZ(t)&&bJ(t)&&cJ(GJ(t))&&e.push(t.name);return{multilineCommentRules:e,nameRegexp:kK}}function JJ(t){console&&console.error&&console.error(`Error: ${t}`)}function t0(t){console&&console.warn&&console.warn(`Warning: ${t}`)}function e0(t){const e=(new Date).getTime(),n=t();return{time:(new Date).getTime()-e,value:n}}function n0(t){function e(){}s(e,"FakeConstructor"),e.prototype=t;const n=new e;function r(){return typeof n.bar}return s(r,"fakeAccess"),r(),r(),t}function r0(t){return i0(t)?t.LABEL:t.name}function i0(t){return FU(t.LABEL)&&""!==t.LABEL}s(jJ,"abstractElementToRegex"),s(YJ,"terminalAlternativesToRegex"),s(WJ,"terminalGroupToRegex"),s(HJ,"untilTokenToRegex"),s(VJ,"negateTokenToRegex"),s(XJ,"characterRangeToRegex"),s(KJ,"keywordToRegex"),s(ZJ,"withCardinality"),s(QJ,"createGrammarConfig"),s(JJ,"PRINT_ERROR"),s(t0,"PRINT_WARNING"),s(e0,"timer"),s(n0,"toFastProperties"),s(r0,"tokenLabel"),s(i0,"hasTokenLabel");var a0=class{static{s(this,"AbstractProduction")}get definition(){return this._definition}set definition(t){this._definition=t}constructor(t){this._definition=t}accept(t){t.visit(this),zB(this.definition,(e=>{e.accept(t)}))}},s0=class extends a0{static{s(this,"NonTerminal")}constructor(t){super([]),this.idx=1,zz(this,aG(t,(t=>void 0!==t)))}set definition(t){}get definition(){return void 0!==this.referencedRule?this.referencedRule.definition:[]}accept(t){t.visit(this)}},o0=class extends a0{static{s(this,"Rule")}constructor(t){super(t.definition),this.orgText="",zz(this,aG(t,(t=>void 0!==t)))}},l0=class extends a0{static{s(this,"Alternative")}constructor(t){super(t.definition),this.ignoreAmbiguities=!1,zz(this,aG(t,(t=>void 0!==t)))}},c0=class extends a0{static{s(this,"Option")}constructor(t){super(t.definition),this.idx=1,zz(this,aG(t,(t=>void 0!==t)))}},h0=class extends a0{static{s(this,"RepetitionMandatory")}constructor(t){super(t.definition),this.idx=1,zz(this,aG(t,(t=>void 0!==t)))}},u0=class extends a0{static{s(this,"RepetitionMandatoryWithSeparator")}constructor(t){super(t.definition),this.idx=1,zz(this,aG(t,(t=>void 0!==t)))}},d0=class extends a0{static{s(this,"Repetition")}constructor(t){super(t.definition),this.idx=1,zz(this,aG(t,(t=>void 0!==t)))}},p0=class extends a0{static{s(this,"RepetitionWithSeparator")}constructor(t){super(t.definition),this.idx=1,zz(this,aG(t,(t=>void 0!==t)))}},g0=class extends a0{static{s(this,"Alternation")}get definition(){return this._definition}set definition(t){this._definition=t}constructor(t){super(t.definition),this.idx=1,this.ignoreAmbiguities=!1,this.hasPredicates=!1,zz(this,aG(t,(t=>void 0!==t)))}},f0=class{static{s(this,"Terminal")}constructor(t){this.idx=1,zz(this,aG(t,(t=>void 0!==t)))}accept(t){t.visit(this)}};function m0(t){return wF(t,y0)}function y0(t){function e(t){return wF(t,y0)}if(s(e,"convertDefinition"),t instanceof s0){const e={type:"NonTerminal",name:t.nonTerminalName,idx:t.idx};return FU(t.label)&&(e.label=t.label),e}if(t instanceof l0)return{type:"Alternative",definition:e(t.definition)};if(t instanceof c0)return{type:"Option",idx:t.idx,definition:e(t.definition)};if(t instanceof h0)return{type:"RepetitionMandatory",idx:t.idx,definition:e(t.definition)};if(t instanceof u0)return{type:"RepetitionMandatoryWithSeparator",idx:t.idx,separator:y0(new f0({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof p0)return{type:"RepetitionWithSeparator",idx:t.idx,separator:y0(new f0({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof d0)return{type:"Repetition",idx:t.idx,definition:e(t.definition)};if(t instanceof g0)return{type:"Alternation",idx:t.idx,definition:e(t.definition)};if(t instanceof f0){const e={type:"Terminal",name:t.terminalType.name,label:r0(t.terminalType),idx:t.idx};FU(t.label)&&(e.terminalLabel=t.label);const n=t.terminalType.PATTERN;return t.terminalType.PATTERN&&(e.pattern=XU(n)?n.source:n),e}if(t instanceof o0)return{type:"Rule",name:t.name,orgText:t.orgText,definition:e(t.definition)};throw Error("non exhaustive match")}s(m0,"serializeGrammar"),s(y0,"serializeProduction");var v0=class{static{s(this,"GAstVisitor")}visit(t){const e=t;switch(e.constructor){case s0:return this.visitNonTerminal(e);case l0:return this.visitAlternative(e);case c0:return this.visitOption(e);case h0:return this.visitRepetitionMandatory(e);case u0:return this.visitRepetitionMandatoryWithSeparator(e);case p0:return this.visitRepetitionWithSeparator(e);case d0:return this.visitRepetition(e);case g0:return this.visitAlternation(e);case f0:return this.visitTerminal(e);case o0:return this.visitRule(e);default:throw Error("non exhaustive match")}}visitNonTerminal(t){}visitAlternative(t){}visitOption(t){}visitRepetition(t){}visitRepetitionMandatory(t){}visitRepetitionMandatoryWithSeparator(t){}visitRepetitionWithSeparator(t){}visitAlternation(t){}visitTerminal(t){}visitRule(t){}};function x0(t){return t instanceof l0||t instanceof c0||t instanceof d0||t instanceof h0||t instanceof u0||t instanceof p0||t instanceof f0||t instanceof o0}function b0(t,e=[]){return!!(t instanceof c0||t instanceof d0||t instanceof p0)||(t instanceof g0?GG(t.definition,(t=>b0(t,e))):!(t instanceof s0&&GU(e,t))&&(t instanceof a0&&(t instanceof s0&&e.push(t),mU(t.definition,(t=>b0(t,e))))))}function w0(t){return t instanceof g0}function k0(t){if(t instanceof s0)return"SUBRULE";if(t instanceof c0)return"OPTION";if(t instanceof g0)return"OR";if(t instanceof h0)return"AT_LEAST_ONE";if(t instanceof u0)return"AT_LEAST_ONE_SEP";if(t instanceof p0)return"MANY_SEP";if(t instanceof d0)return"MANY";if(t instanceof f0)return"CONSUME";throw Error("non exhaustive match")}s(x0,"isSequenceProd"),s(b0,"isOptionalProd"),s(w0,"isBranchingProd"),s(k0,"getProductionDslName");var T0=class{static{s(this,"RestWalker")}walk(t,e=[]){zB(t.definition,((n,r)=>{const i=lU(t.definition,r+1);if(n instanceof s0)this.walkProdRef(n,i,e);else if(n instanceof f0)this.walkTerminal(n,i,e);else if(n instanceof l0)this.walkFlat(n,i,e);else if(n instanceof c0)this.walkOption(n,i,e);else if(n instanceof h0)this.walkAtLeastOne(n,i,e);else if(n instanceof u0)this.walkAtLeastOneSep(n,i,e);else if(n instanceof p0)this.walkManySep(n,i,e);else if(n instanceof d0)this.walkMany(n,i,e);else{if(!(n instanceof g0))throw Error("non exhaustive match");this.walkOr(n,i,e)}}))}walkTerminal(t,e,n){}walkProdRef(t,e,n){}walkFlat(t,e,n){const r=e.concat(n);this.walk(t,r)}walkOption(t,e,n){const r=e.concat(n);this.walk(t,r)}walkAtLeastOne(t,e,n){const r=[new c0({definition:t.definition})].concat(e,n);this.walk(t,r)}walkAtLeastOneSep(t,e,n){const r=_0(t,e,n);this.walk(t,r)}walkMany(t,e,n){const r=[new c0({definition:t.definition})].concat(e,n);this.walk(t,r)}walkManySep(t,e,n){const r=_0(t,e,n);this.walk(t,r)}walkOr(t,e,n){const r=e.concat(n);zB(t.definition,(t=>{const e=new l0({definition:[t]});this.walk(e,r)}))}};function _0(t,e,n){return[new c0({definition:[new f0({terminalType:t.separator})].concat(t.definition)})].concat(e,n)}function E0(t){if(t instanceof s0)return E0(t.referencedRule);if(t instanceof f0)return A0(t);if(x0(t))return C0(t);if(w0(t))return S0(t);throw Error("non exhaustive match")}function C0(t){let e=[];const n=t.definition;let r,i=0,a=n.length>i,s=!0;for(;a&&s;)r=n[i],s=b0(r),e=e.concat(E0(r)),i+=1,a=n.length>i;return WG(e)}function S0(t){const e=wF(t.definition,(t=>E0(t)));return WG(VF(e))}function A0(t){return[t.terminalType]}s(_0,"restForRepetitionWithSeparator"),s(E0,"first"),s(C0,"firstForSequence"),s(S0,"firstForBranching"),s(A0,"firstForTerminal");var L0=class extends T0{static{s(this,"ResyncFollowsWalker")}constructor(t){super(),this.topProd=t,this.follows={}}startWalking(){return this.walk(this.topProd),this.follows}walkTerminal(t,e,n){}walkProdRef(t,e,n){const r=I0(t.referencedRule,t.idx)+this.topProd.name,i=e.concat(n),a=E0(new l0({definition:i}));this.follows[r]=a}};function N0(t){const e={};return zB(t,(t=>{const n=new L0(t).startWalking();zz(e,n)})),e}function I0(t,e){return t.name+e+"_~IN~_"}s(N0,"computeAllProdsFollows"),s(I0,"buildBetweenProdsFollowPrefix");var M0={},R0=new nJ;function D0(t){const e=t.toString();if(M0.hasOwnProperty(e))return M0[e];{const t=R0.pattern(e);return M0[e]=t,t}}function O0(){M0={}}s(D0,"getRegExpAst"),s(O0,"clearRegExpParserCache");var P0='Unable to use "first char" lexer optimizations:\n';function B0(t,e=!1){try{const e=D0(t);return $0(e.value,{},e.flags.ignoreCase)}catch(n){if("Complement Sets are not supported for first char optimization"===n.message)e&&t0(`${P0}\tUnable to optimize: < ${t.toString()} >\n\tComplement Sets cannot be automatically optimized.\n\tThis will disable the lexer's first char optimizations.\n\tSee: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#COMPLEMENT for details.`);else{let n="";e&&(n="\n\tThis will disable the lexer's first char optimizations.\n\tSee: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details."),JJ(`${P0}\n\tFailed parsing: < ${t.toString()} >\n\tUsing the @chevrotain/regexp-to-ast library\n\tPlease open an issue at: https://github.com/chevrotain/chevrotain/issues`+n)}}return[]}function $0(t,e,n){switch(t.type){case"Disjunction":for(let r=0;r<t.value.length;r++)$0(t.value[r],e,n);break;case"Alternative":const r=t.value;for(let t=0;t<r.length;t++){const i=r[t];switch(i.type){case"EndAnchor":case"GroupBackReference":case"Lookahead":case"NegativeLookahead":case"StartAnchor":case"WordBoundary":case"NonWordBoundary":continue}const a=i;switch(a.type){case"Character":F0(a.value,e,n);break;case"Set":if(!0===a.complement)throw Error("Complement Sets are not supported for first char optimization");zB(a.value,(t=>{if("number"==typeof t)F0(t,e,n);else{const r=t;if(!0===n)for(let t=r.from;t<=r.to;t++)F0(t,e,n);else{for(let t=r.from;t<=r.to&&t<w1;t++)F0(t,e,n);if(r.to>=w1){const t=r.from>=w1?r.from:w1,n=r.to,i=T1(t),a=T1(n);for(let t=i;t<=a;t++)e[t]=t}}}}));break;case"Group":$0(a.value,e,n);break;default:throw Error("Non Exhaustive Match")}const s=void 0!==a.quantifier&&0===a.quantifier.atLeast;if("Group"===a.type&&!1===G0(a)||"Group"!==a.type&&!1===s)break}break;default:throw Error("non exhaustive match!")}return EF(e)}function F0(t,e,n){const r=T1(t);e[r]=r,!0===n&&z0(t,e)}function z0(t,e){const n=String.fromCharCode(t),r=n.toUpperCase();if(r!==n){const t=T1(r.charCodeAt(0));e[t]=t}else{const t=n.toLowerCase();if(t!==n){const n=T1(t.charCodeAt(0));e[n]=n}}}function U0(t,e){return wU(t.value,(t=>{if("number"==typeof t)return GU(e,t);{const n=t;return void 0!==wU(e,(t=>n.from<=t&&t<=n.to))}}))}function G0(t){const e=t.quantifier;return!(!e||0!==e.atLeast)||!!t.value&&(hb(t.value)?mU(t.value,G0):G0(t.value))}s(B0,"getOptimizedStartCodesIndices"),s($0,"firstCharOptimizedIndices"),s(F0,"addOptimizedIdxToResult"),s(z0,"handleIgnoreCase"),s(U0,"findCode"),s(G0,"isWholeOptional");var q0=class extends rJ{static{s(this,"CharCodeFinder")}constructor(t){super(),this.targetCharCodes=t,this.found=!1}visitChildren(t){if(!0!==this.found){switch(t.type){case"Lookahead":return void this.visitLookahead(t);case"NegativeLookahead":return void this.visitNegativeLookahead(t)}super.visitChildren(t)}}visitCharacter(t){GU(this.targetCharCodes,t.value)&&(this.found=!0)}visitSet(t){t.complement?void 0===U0(t,this.targetCharCodes)&&(this.found=!0):void 0!==U0(t,this.targetCharCodes)&&(this.found=!0)}};function j0(t,e){if(e instanceof RegExp){const n=D0(e),r=new q0(t);return r.visit(n),r.found}return void 0!==wU(e,(e=>GU(t,e.charCodeAt(0))))}s(j0,"canMatchCharCode");var Y0="boolean"==typeof new RegExp("(?:)").sticky;function W0(t,e){const n=(e=NB(e,{useSticky:Y0,debug:!1,safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r","\n"],tracer:s(((t,e)=>e()),"tracer")})).tracer;let r;n("initCharCodeToOptimizedIndexMap",(()=>{_1()})),n("Reject Lexer.NA",(()=>{r=PG(t,(t=>t.PATTERN===j1.NA))}));let i,a,o,l,c,h,u,d,p,g,f,m=!1;n("Transform Patterns",(()=>{m=!1,i=wF(r,(t=>{const n=t.PATTERN;if(XU(n)){const t=n.source;return 1!==t.length||"^"===t||"$"===t||"."===t||n.ignoreCase?2!==t.length||"\\"!==t[0]||GU(["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"],t[1])?e.useSticky?h1(n):c1(n):t[1]:t}if(Hy(n))return m=!0,{exec:n};if("object"==typeof n)return m=!0,n;if("string"==typeof n){if(1===n.length)return n;{const t=n.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),r=new RegExp(t);return e.useSticky?h1(r):c1(r)}}throw Error("non exhaustive match")}))})),n("misc mapping",(()=>{a=wF(r,(t=>t.tokenTypeIdx)),o=wF(r,(t=>{const e=t.GROUP;if(e!==j1.SKIPPED){if(FU(e))return e;if(SF(e))return!1;throw Error("non exhaustive match")}})),l=wF(r,(t=>{const e=t.LONGER_ALT;if(e){const t=hb(e)?wF(e,(t=>YU(r,t))):[YU(r,e)];return t}})),c=wF(r,(t=>t.PUSH_MODE)),h=wF(r,(t=>BU(t,"POP_MODE")))})),n("Line Terminator Handling",(()=>{const t=x1(e.lineTerminatorCharacters);u=wF(r,(t=>!1)),"onlyOffset"!==e.positionTracking&&(u=wF(r,(e=>BU(e,"LINE_BREAKS")?!!e.LINE_BREAKS:!1===y1(e,t)&&j0(t,e.PATTERN))))})),n("Misc Mapping #2",(()=>{d=wF(r,g1),p=wF(i,f1),g=rz(r,((t,e)=>{const n=e.GROUP;return FU(n)&&n!==j1.SKIPPED&&(t[n]=[]),t}),{}),f=wF(i,((t,e)=>({pattern:i[e],longerAlt:l[e],canLineTerminator:u[e],isCustom:d[e],short:p[e],group:o[e],push:c[e],pop:h[e],tokenTypeIdx:a[e],tokenType:r[e]})))}));let y=!0,v=[];return e.safeMode||n("First Char Optimization",(()=>{v=rz(r,((t,n,r)=>{if("string"==typeof n.PATTERN){const e=T1(n.PATTERN.charCodeAt(0));b1(t,e,f[r])}else if(hb(n.START_CHARS_HINT)){let e;zB(n.START_CHARS_HINT,(n=>{const i=T1("string"==typeof n?n.charCodeAt(0):n);e!==i&&(e=i,b1(t,i,f[r]))}))}else if(XU(n.PATTERN))if(n.PATTERN.unicode)y=!1,e.ensureOptimizations&&JJ(`${P0}\tUnable to analyze < ${n.PATTERN.toString()} > pattern.\n\tThe regexp unicode flag is not currently supported by the regexp-to-ast library.\n\tThis will disable the lexer's first char optimizations.\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE`);else{const i=B0(n.PATTERN,e.ensureOptimizations);bA(i)&&(y=!1),zB(i,(e=>{b1(t,e,f[r])}))}else e.ensureOptimizations&&JJ(`${P0}\tTokenType: <${n.name}> is using a custom token pattern without providing <start_chars_hint> parameter.\n\tThis will disable the lexer's first char optimizations.\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE`),y=!1;return t}),[])})),{emptyGroups:g,patternIdxToConfig:f,charCodeToPatternIdxToConfig:v,hasCustom:m,canBeOptimized:y}}function H0(t,e){let n=[];const r=X0(t);n=n.concat(r.errors);const i=K0(r.valid),a=i.valid;return n=n.concat(i.errors),n=n.concat(V0(a)),n=n.concat(i1(a)),n=n.concat(a1(a,e)),n=n.concat(s1(a)),n}function V0(t){let e=[];const n=yF(t,(t=>XU(t.PATTERN)));return e=e.concat(Q0(n)),e=e.concat(e1(n)),e=e.concat(n1(n)),e=e.concat(r1(n)),e=e.concat(J0(n)),e}function X0(t){const e=yF(t,(t=>!BU(t,"PATTERN")));return{errors:wF(e,(t=>({message:"Token Type: ->"+t.name+"<- missing static 'PATTERN' property",type:z1.MISSING_PATTERN,tokenTypes:[t]}))),valid:sU(t,e)}}function K0(t){const e=yF(t,(t=>{const e=t.PATTERN;return!(XU(e)||Hy(e)||BU(e,"exec")||FU(e))}));return{errors:wF(e,(t=>({message:"Token Type: ->"+t.name+"<- static 'PATTERN' can only be a RegExp, a Function matching the {CustomPatternMatcherFunc} type or an Object matching the {ICustomPattern} interface.",type:z1.INVALID_PATTERN,tokenTypes:[t]}))),valid:sU(t,e)}}s(W0,"analyzeTokenTypes"),s(H0,"validatePatterns"),s(V0,"validateRegExpPattern"),s(X0,"findMissingPatterns"),s(K0,"findInvalidPatterns");var Z0=/[^\\][$]/;function Q0(t){class e extends rJ{static{s(this,"EndAnchorFinder")}constructor(){super(...arguments),this.found=!1}visitEndAnchor(t){this.found=!0}}const n=yF(t,(t=>{const n=t.PATTERN;try{const t=D0(n),r=new e;return r.visit(t),r.found}catch(t){return Z0.test(n.source)}}));return wF(n,(t=>({message:"Unexpected RegExp Anchor Error:\n\tToken Type: ->"+t.name+"<- static 'PATTERN' cannot contain end of input anchor '$'\n\tSee chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS\tfor details.",type:z1.EOI_ANCHOR_FOUND,tokenTypes:[t]})))}function J0(t){const e=yF(t,(t=>t.PATTERN.test("")));return wF(e,(t=>({message:"Token Type: ->"+t.name+"<- static 'PATTERN' must not match an empty string",type:z1.EMPTY_MATCH_PATTERN,tokenTypes:[t]})))}s(Q0,"findEndOfInputAnchor"),s(J0,"findEmptyMatchRegExps");var t1=/[^\\[][\^]|^\^/;function e1(t){class e extends rJ{static{s(this,"StartAnchorFinder")}constructor(){super(...arguments),this.found=!1}visitStartAnchor(t){this.found=!0}}const n=yF(t,(t=>{const n=t.PATTERN;try{const t=D0(n),r=new e;return r.visit(t),r.found}catch(t){return t1.test(n.source)}}));return wF(n,(t=>({message:"Unexpected RegExp Anchor Error:\n\tToken Type: ->"+t.name+"<- static 'PATTERN' cannot contain start of input anchor '^'\n\tSee https://chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS\tfor details.",type:z1.SOI_ANCHOR_FOUND,tokenTypes:[t]})))}function n1(t){const e=yF(t,(t=>{const e=t.PATTERN;return e instanceof RegExp&&(e.multiline||e.global)}));return wF(e,(t=>({message:"Token Type: ->"+t.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:z1.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[t]})))}function r1(t){const e=[];let n=wF(t,(n=>rz(t,((t,r)=>(n.PATTERN.source!==r.PATTERN.source||GU(e,r)||r.PATTERN===j1.NA||(e.push(r),t.push(r)),t)),[])));n=Xz(n);const r=yF(n,(t=>t.length>1));return wF(r,(t=>{const e=wF(t,(t=>t.name));return{message:`The same RegExp pattern ->${TU(t).PATTERN}<-has been used in all of the following Token Types: ${e.join(", ")} <-`,type:z1.DUPLICATE_PATTERNS_FOUND,tokenTypes:t}}))}function i1(t){const e=yF(t,(t=>{if(!BU(t,"GROUP"))return!1;const e=t.GROUP;return e!==j1.SKIPPED&&e!==j1.NA&&!FU(e)}));return wF(e,(t=>({message:"Token Type: ->"+t.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:z1.INVALID_GROUP_TYPE_FOUND,tokenTypes:[t]})))}function a1(t,e){const n=yF(t,(t=>void 0!==t.PUSH_MODE&&!GU(e,t.PUSH_MODE)));return wF(n,(t=>({message:`Token Type: ->${t.name}<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->${t.PUSH_MODE}<-which does not exist`,type:z1.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[t]})))}function s1(t){const e=[],n=rz(t,((t,e,n)=>{const r=e.PATTERN;return r===j1.NA||(FU(r)?t.push({str:r,idx:n,tokenType:e}):XU(r)&&l1(r)&&t.push({str:r.source,idx:n,tokenType:e})),t}),[]);return zB(t,((t,r)=>{zB(n,(({str:n,idx:i,tokenType:a})=>{if(r<i&&o1(n,t.PATTERN)){const n=`Token: ->${a.name}<- can never be matched.\nBecause it appears AFTER the Token Type ->${t.name}<-in the lexer's definition.\nSee https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;e.push({message:n,type:z1.UNREACHABLE_PATTERN,tokenTypes:[t,a]})}}))})),e}function o1(t,e){if(XU(e)){const n=e.exec(t);return null!==n&&0===n.index}if(Hy(e))return e(t,0,[],{});if(BU(e,"exec"))return e.exec(t,0,[],{});if("string"==typeof e)return e===t;throw Error("non exhaustive match")}function l1(t){return void 0===wU([".","\\","[","]","|","^","$","(",")","?","*","+","{"],(e=>-1!==t.source.indexOf(e)))}function c1(t){const e=t.ignoreCase?"i":"";return new RegExp(`^(?:${t.source})`,e)}function h1(t){const e=t.ignoreCase?"iy":"y";return new RegExp(`${t.source}`,e)}function u1(t,e,n){const r=[];return BU(t,"defaultMode")||r.push({message:"A MultiMode Lexer cannot be initialized without a <defaultMode> property in its definition\n",type:z1.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),BU(t,"modes")||r.push({message:"A MultiMode Lexer cannot be initialized without a <modes> property in its definition\n",type:z1.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),BU(t,"modes")&&BU(t,"defaultMode")&&!BU(t.modes,t.defaultMode)&&r.push({message:`A MultiMode Lexer cannot be initialized with a defaultMode: <${t.defaultMode}>which does not exist\n`,type:z1.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),BU(t,"modes")&&zB(t.modes,((t,e)=>{zB(t,((n,i)=>{if(SF(n))r.push({message:`A Lexer cannot be initialized using an undefined Token Type. Mode:<${e}> at index: <${i}>\n`,type:z1.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED});else if(BU(n,"LONGER_ALT")){const i=hb(n.LONGER_ALT)?n.LONGER_ALT:[n.LONGER_ALT];zB(i,(i=>{SF(i)||GU(t,i)||r.push({message:`A MultiMode Lexer cannot be initialized with a longer_alt <${i.name}> on token <${n.name}> outside of mode <${e}>\n`,type:z1.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE})}))}}))})),r}function d1(t,e,n){const r=[];let i=!1;const a=Xz(VF(EF(t.modes))),s=PG(a,(t=>t.PATTERN===j1.NA)),o=x1(n);return e&&zB(s,(t=>{const e=y1(t,o);if(!1!==e){const n={message:v1(t,e),type:e.issue,tokenType:t};r.push(n)}else BU(t,"LINE_BREAKS")?!0===t.LINE_BREAKS&&(i=!0):j0(o,t.PATTERN)&&(i=!0)})),e&&!i&&r.push({message:"Warning: No LINE_BREAKS Found.\n\tThis Lexer has been defined to track line and column information,\n\tBut none of the Token Types can be identified as matching a line terminator.\n\tSee https://chevrotain.io/docs/guide/resolving_lexer_errors.html#LINE_BREAKS \n\tfor details.",type:z1.NO_LINE_BREAKS_FLAGS}),r}function p1(t){const e={},n=EP(t);return zB(n,(n=>{const r=t[n];if(!hb(r))throw Error("non exhaustive match");e[n]=[]})),e}function g1(t){const e=t.PATTERN;if(XU(e))return!1;if(Hy(e))return!0;if(BU(e,"exec"))return!0;if(FU(e))return!1;throw Error("non exhaustive match")}function f1(t){return!(!FU(t)||1!==t.length)&&t.charCodeAt(0)}s(e1,"findStartOfInputAnchor"),s(n1,"findUnsupportedFlags"),s(r1,"findDuplicatePatterns"),s(i1,"findInvalidGroupType"),s(a1,"findModesThatDoNotExist"),s(s1,"findUnreachablePatterns"),s(o1,"testTokenType"),s(l1,"noMetaChar"),s(c1,"addStartOfInput"),s(h1,"addStickyFlag"),s(u1,"performRuntimeChecks"),s(d1,"performWarningRuntimeChecks"),s(p1,"cloneEmptyGroups"),s(g1,"isCustomPattern"),s(f1,"isShortPattern");var m1={test:s((function(t){const e=t.length;for(let n=this.lastIndex;n<e;n++){const e=t.charCodeAt(n);if(10===e)return this.lastIndex=n+1,!0;if(13===e)return 10===t.charCodeAt(n+1)?this.lastIndex=n+2:this.lastIndex=n+1,!0}return!1}),"test"),lastIndex:0};function y1(t,e){if(BU(t,"LINE_BREAKS"))return!1;if(XU(t.PATTERN)){try{j0(e,t.PATTERN)}catch(t){return{issue:z1.IDENTIFY_TERMINATOR,errMsg:t.message}}return!1}if(FU(t.PATTERN))return!1;if(g1(t))return{issue:z1.CUSTOM_LINE_BREAK};throw Error("non exhaustive match")}function v1(t,e){if(e.issue===z1.IDENTIFY_TERMINATOR)return`Warning: unable to identify line terminator usage in pattern.\n\tThe problem is in the <${t.name}> Token Type\n\t Root cause: ${e.errMsg}.\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR`;if(e.issue===z1.CUSTOM_LINE_BREAK)return`Warning: A Custom Token Pattern should specify the <line_breaks> option.\n\tThe problem is in the <${t.name}> Token Type\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK`;throw Error("non exhaustive match")}function x1(t){return wF(t,(t=>FU(t)?t.charCodeAt(0):t))}function b1(t,e,n){void 0===t[e]?t[e]=[n]:t[e].push(n)}s(y1,"checkLineBreaksIssues"),s(v1,"buildLineBreakIssueMessage"),s(x1,"getCharCodes"),s(b1,"addToMapOfArrays");var w1=256,k1=[];function T1(t){return t<w1?t:k1[t]}function _1(){if(bA(k1)){k1=new Array(65536);for(let t=0;t<65536;t++)k1[t]=t>255?255+~~(t/255):t}}function E1(t,e){const n=t.tokenTypeIdx;return n===e.tokenTypeIdx||!0===e.isParent&&!0===e.categoryMatchesMap[n]}function C1(t,e){return t.tokenTypeIdx===e.tokenTypeIdx}s(T1,"charCodeToOptimizedIndex"),s(_1,"initCharCodeToOptimizedIndexMap"),s(E1,"tokenStructuredMatcher"),s(C1,"tokenStructuredMatcherNoCategories");var S1=1,A1={};function L1(t){const e=N1(t);I1(e),R1(e),M1(e),zB(e,(t=>{t.isParent=t.categoryMatches.length>0}))}function N1(t){let e=CB(t),n=t,r=!0;for(;r;){n=Xz(VF(wF(n,(t=>t.CATEGORIES))));const t=sU(n,e);e=e.concat(t),bA(t)?r=!1:n=t}return e}function I1(t){zB(t,(t=>{O1(t)||(A1[S1]=t,t.tokenTypeIdx=S1++),P1(t)&&!hb(t.CATEGORIES)&&(t.CATEGORIES=[t.CATEGORIES]),P1(t)||(t.CATEGORIES=[]),B1(t)||(t.categoryMatches=[]),$1(t)||(t.categoryMatchesMap={})}))}function M1(t){zB(t,(t=>{t.categoryMatches=[],zB(t.categoryMatchesMap,((e,n)=>{t.categoryMatches.push(A1[n].tokenTypeIdx)}))}))}function R1(t){zB(t,(t=>{D1([],t)}))}function D1(t,e){zB(t,(t=>{e.categoryMatchesMap[t.tokenTypeIdx]=!0})),zB(e.CATEGORIES,(n=>{const r=t.concat(e);GU(r,n)||D1(r,n)}))}function O1(t){return BU(t,"tokenTypeIdx")}function P1(t){return BU(t,"CATEGORIES")}function B1(t){return BU(t,"categoryMatches")}function $1(t){return BU(t,"categoryMatchesMap")}function F1(t){return BU(t,"tokenTypeIdx")}s(L1,"augmentTokenTypes"),s(N1,"expandCategories"),s(I1,"assignTokenDefaultProps"),s(M1,"assignCategoriesTokensProp"),s(R1,"assignCategoriesMapProp"),s(D1,"singleAssignCategoriesToksMap"),s(O1,"hasShortKeyProperty"),s(P1,"hasCategoriesProperty"),s(B1,"hasExtendingTokensTypesProperty"),s($1,"hasExtendingTokensTypesMapProperty"),s(F1,"isTokenType");var z1,U1,G1={buildUnableToPopLexerModeMessage:t=>`Unable to pop Lexer Mode after encountering Token ->${t.image}<- The Mode Stack is empty`,buildUnexpectedCharactersMessage:(t,e,n,r,i)=>`unexpected character: ->${t.charAt(e)}<- at offset: ${e}, skipped ${n} characters.`};(U1=z1||(z1={}))[U1.MISSING_PATTERN=0]="MISSING_PATTERN",U1[U1.INVALID_PATTERN=1]="INVALID_PATTERN",U1[U1.EOI_ANCHOR_FOUND=2]="EOI_ANCHOR_FOUND",U1[U1.UNSUPPORTED_FLAGS_FOUND=3]="UNSUPPORTED_FLAGS_FOUND",U1[U1.DUPLICATE_PATTERNS_FOUND=4]="DUPLICATE_PATTERNS_FOUND",U1[U1.INVALID_GROUP_TYPE_FOUND=5]="INVALID_GROUP_TYPE_FOUND",U1[U1.PUSH_MODE_DOES_NOT_EXIST=6]="PUSH_MODE_DOES_NOT_EXIST",U1[U1.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE=7]="MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE",U1[U1.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY=8]="MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY",U1[U1.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST=9]="MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST",U1[U1.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED=10]="LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED",U1[U1.SOI_ANCHOR_FOUND=11]="SOI_ANCHOR_FOUND",U1[U1.EMPTY_MATCH_PATTERN=12]="EMPTY_MATCH_PATTERN",U1[U1.NO_LINE_BREAKS_FLAGS=13]="NO_LINE_BREAKS_FLAGS",U1[U1.UNREACHABLE_PATTERN=14]="UNREACHABLE_PATTERN",U1[U1.IDENTIFY_TERMINATOR=15]="IDENTIFY_TERMINATOR",U1[U1.CUSTOM_LINE_BREAK=16]="CUSTOM_LINE_BREAK",U1[U1.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE=17]="MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE";var q1={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:["\n","\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:G1,traceInitPerf:!1,skipValidations:!1,recoveryEnabled:!0};Object.freeze(q1);var j1=class{static{s(this,"Lexer")}constructor(t,e=q1){if(this.lexerDefinition=t,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=(t,e)=>{if(!0===this.traceInitPerf){this.traceInitIndent++;const n=new Array(this.traceInitIndent+1).join("\t");this.traceInitIndent<this.traceInitMaxIdent&&console.log(`${n}--\x3e <${t}>`);const{time:r,value:i}=e0(e),a=r>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&a(`${n}<-- <${t}> time: ${r}ms`),this.traceInitIndent--,i}return e()},"boolean"==typeof e)throw Error("The second argument to the Lexer constructor is now an ILexerConfig Object.\na boolean 2nd argument is no longer supported");this.config=zz({},q1,e);const n=this.config.traceInitPerf;!0===n?(this.traceInitMaxIdent=1/0,this.traceInitPerf=!0):"number"==typeof n&&(this.traceInitMaxIdent=n,this.traceInitPerf=!0),this.traceInitIndent=-1,this.TRACE_INIT("Lexer Constructor",(()=>{let n,r=!0;this.TRACE_INIT("Lexer Config handling",(()=>{if(this.config.lineTerminatorsPattern===q1.lineTerminatorsPattern)this.config.lineTerminatorsPattern=m1;else if(this.config.lineTerminatorCharacters===q1.lineTerminatorCharacters)throw Error("Error: Missing <lineTerminatorCharacters> property on the Lexer config.\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#MISSING_LINE_TERM_CHARS");if(e.safeMode&&e.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),hb(t)?n={modes:{defaultMode:CB(t)},defaultMode:"defaultMode"}:(r=!1,n=CB(t))})),!1===this.config.skipValidations&&(this.TRACE_INIT("performRuntimeChecks",(()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(u1(n,this.trackStartLines,this.config.lineTerminatorCharacters))})),this.TRACE_INIT("performWarningRuntimeChecks",(()=>{this.lexerDefinitionWarning=this.lexerDefinitionWarning.concat(d1(n,this.trackStartLines,this.config.lineTerminatorCharacters))}))),n.modes=n.modes?n.modes:{},zB(n.modes,((t,e)=>{n.modes[e]=PG(t,(t=>SF(t)))}));const i=EP(n.modes);if(zB(n.modes,((t,n)=>{this.TRACE_INIT(`Mode: <${n}> processing`,(()=>{if(this.modes.push(n),!1===this.config.skipValidations&&this.TRACE_INIT("validatePatterns",(()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(H0(t,i))})),bA(this.lexerDefinitionErrors)){let r;L1(t),this.TRACE_INIT("analyzeTokenTypes",(()=>{r=W0(t,{lineTerminatorCharacters:this.config.lineTerminatorCharacters,positionTracking:e.positionTracking,ensureOptimizations:e.ensureOptimizations,safeMode:e.safeMode,tracer:this.TRACE_INIT})})),this.patternIdxToConfig[n]=r.patternIdxToConfig,this.charCodeToPatternIdxToConfig[n]=r.charCodeToPatternIdxToConfig,this.emptyGroups=zz({},this.emptyGroups,r.emptyGroups),this.hasCustom=r.hasCustom||this.hasCustom,this.canModeBeOptimized[n]=r.canBeOptimized}}))})),this.defaultMode=n.defaultMode,!bA(this.lexerDefinitionErrors)&&!this.config.deferDefinitionErrorsHandling){const t=wF(this.lexerDefinitionErrors,(t=>t.message)),e=t.join("-----------------------\n");throw new Error("Errors detected in definition of Lexer:\n"+e)}zB(this.lexerDefinitionWarning,(t=>{t0(t.message)})),this.TRACE_INIT("Choosing sub-methods implementations",(()=>{if(Y0?(this.chopInput=mw,this.match=this.matchWithTest):(this.updateLastIndex=yz,this.match=this.matchWithExec),r&&(this.handleModes=yz),!1===this.trackStartLines&&(this.computeNewColumn=mw),!1===this.trackEndLines&&(this.updateTokenEndLineColumnLocation=yz),/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))throw Error(`Invalid <positionTracking> config option: "${this.config.positionTracking}"`);this.createTokenInstance=this.createOffsetOnlyToken}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 t=rz(this.canModeBeOptimized,((t,e,n)=>(!1===e&&t.push(n),t)),[]);if(e.ensureOptimizations&&!bA(t))throw Error(`Lexer Modes: < ${t.join(", ")} > cannot be optimized.\n\t Disable the "ensureOptimizations" lexer config flag to silently ignore this and run the lexer in an un-optimized mode.\n\t Or inspect the console log for details on how to resolve these issues.`)})),this.TRACE_INIT("clearRegExpParserCache",(()=>{O0()})),this.TRACE_INIT("toFastProperties",(()=>{n0(this)}))}))}tokenize(t,e=this.defaultMode){if(!bA(this.lexerDefinitionErrors)){const t=wF(this.lexerDefinitionErrors,(t=>t.message)),e=t.join("-----------------------\n");throw new Error("Unable to Tokenize because Errors detected in definition of Lexer:\n"+e)}return this.tokenizeInternal(t,e)}tokenizeInternal(t,e){let n,r,i,a,o,l,c,h,u,d,p,g,f,m,y;const v=t,x=v.length;let b=0,w=0;const k=this.hasCustom?0:Math.floor(t.length/10),T=new Array(k),_=[];let E=this.trackStartLines?1:void 0,C=this.trackStartLines?1:void 0;const S=p1(this.emptyGroups),A=this.trackStartLines,L=this.config.lineTerminatorsPattern;let N=0,I=[],M=[];const R=[],D=[];let O;function P(){return I}function B(t){const e=T1(t),n=M[e];return void 0===n?D:n}Object.freeze(D),s(P,"getPossiblePatternsSlow"),s(B,"getPossiblePatternsOptimized");const $=s((t=>{if(1===R.length&&void 0===t.tokenType.PUSH_MODE){const e=this.config.errorMessageProvider.buildUnableToPopLexerModeMessage(t);_.push({offset:t.startOffset,line:t.startLine,column:t.startColumn,length:t.image.length,message:e})}else{R.pop();const t=MB(R);I=this.patternIdxToConfig[t],M=this.charCodeToPatternIdxToConfig[t],N=I.length;const e=this.canModeBeOptimized[t]&&!1===this.config.safeMode;O=M&&e?B:P}}),"pop_mode");function F(t){R.push(t),M=this.charCodeToPatternIdxToConfig[t],I=this.patternIdxToConfig[t],N=I.length,N=I.length;const e=this.canModeBeOptimized[t]&&!1===this.config.safeMode;O=M&&e?B:P}let z;s(F,"push_mode"),F.call(this,e);const U=this.config.recoveryEnabled;for(;b<x;){l=null;const e=v.charCodeAt(b),s=O(e),k=s.length;for(n=0;n<k;n++){z=s[n];const r=z.pattern;c=null;const u=z.short;if(!1!==u?e===u&&(l=r):!0===z.isCustom?(y=r.exec(v,b,T,S),null!==y?(l=y[0],void 0!==y.payload&&(c=y.payload)):l=null):(this.updateLastIndex(r,b),l=this.match(r,t,b)),null!==l){if(o=z.longerAlt,void 0!==o){const e=o.length;for(i=0;i<e;i++){const e=I[o[i]],n=e.pattern;if(h=null,!0===e.isCustom?(y=n.exec(v,b,T,S),null!==y?(a=y[0],void 0!==y.payload&&(h=y.payload)):a=null):(this.updateLastIndex(n,b),a=this.match(n,t,b)),a&&a.length>l.length){l=a,c=h,z=e;break}}}break}}if(null!==l){if(u=l.length,d=z.group,void 0!==d&&(p=z.tokenTypeIdx,g=this.createTokenInstance(l,b,p,z.tokenType,E,C,u),this.handlePayload(g,c),!1===d?w=this.addToken(T,w,g):S[d].push(g)),t=this.chopInput(t,u),b+=u,C=this.computeNewColumn(C,u),!0===A&&!0===z.canLineTerminator){let t,e,n=0;L.lastIndex=0;do{t=L.test(l),!0===t&&(e=L.lastIndex-1,n++)}while(!0===t);0!==n&&(E+=n,C=u-e,this.updateTokenEndLineColumnLocation(g,d,e,n,E,C,u))}this.handleModes(z,$,F,g)}else{const e=b,n=E,i=C;let a=!1===U;for(;!1===a&&b<x;)for(t=this.chopInput(t,1),b++,r=0;r<N;r++){const e=I[r],n=e.pattern,i=e.short;if(!1!==i?v.charCodeAt(b)===i&&(a=!0):!0===e.isCustom?a=null!==n.exec(v,b,T,S):(this.updateLastIndex(n,b),a=null!==n.exec(t)),!0===a)break}if(f=b-e,C=this.computeNewColumn(C,f),m=this.config.errorMessageProvider.buildUnexpectedCharactersMessage(v,e,f,n,i),_.push({offset:e,line:n,column:i,length:f,message:m}),!1===U)break}}return this.hasCustom||(T.length=w),{tokens:T,groups:S,errors:_}}handleModes(t,e,n,r){if(!0===t.pop){const i=t.push;e(r),void 0!==i&&n.call(this,i)}else void 0!==t.push&&n.call(this,t.push)}chopInput(t,e){return t.substring(e)}updateLastIndex(t,e){t.lastIndex=e}updateTokenEndLineColumnLocation(t,e,n,r,i,a,s){let o,l;void 0!==e&&(o=n===s-1,l=o?-1:0,1===r&&!0===o||(t.endLine=i+l,t.endColumn=a-1-l))}computeNewColumn(t,e){return t+e}createOffsetOnlyToken(t,e,n,r){return{image:t,startOffset:e,tokenTypeIdx:n,tokenType:r}}createStartOnlyToken(t,e,n,r,i,a){return{image:t,startOffset:e,startLine:i,startColumn:a,tokenTypeIdx:n,tokenType:r}}createFullToken(t,e,n,r,i,a,s){return{image:t,startOffset:e,endOffset:e+s-1,startLine:i,endLine:i,startColumn:a,endColumn:a+s-1,tokenTypeIdx:n,tokenType:r}}addTokenUsingPush(t,e,n){return t.push(n),e}addTokenUsingMemberAccess(t,e,n){return t[e]=n,++e}handlePayloadNoCustom(t,e){}handlePayloadWithCustom(t,e){null!==e&&(t.payload=e)}matchWithTest(t,e,n){return!0===t.test(e)?e.substring(n,t.lastIndex):null}matchWithExec(t,e){const n=t.exec(e);return null!==n?n[0]:null}};function Y1(t){return W1(t)?t.LABEL:t.name}function W1(t){return FU(t.LABEL)&&""!==t.LABEL}j1.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.",j1.NA=/NOT_APPLICABLE/,s(Y1,"tokenLabel"),s(W1,"hasTokenLabel");function H1(t){return V1(t)}function V1(t){const e=t.pattern,n={};if(n.name=t.name,SF(e)||(n.PATTERN=e),BU(t,"parent"))throw"The parent property is no longer supported.\nSee: https://github.com/chevrotain/chevrotain/issues/564#issuecomment-349062346 for details.";return BU(t,"categories")&&(n.CATEGORIES=t.categories),L1([n]),BU(t,"label")&&(n.LABEL=t.label),BU(t,"group")&&(n.GROUP=t.group),BU(t,"pop_mode")&&(n.POP_MODE=t.pop_mode),BU(t,"push_mode")&&(n.PUSH_MODE=t.push_mode),BU(t,"longer_alt")&&(n.LONGER_ALT=t.longer_alt),BU(t,"line_breaks")&&(n.LINE_BREAKS=t.line_breaks),BU(t,"start_chars_hint")&&(n.START_CHARS_HINT=t.start_chars_hint),n}s(H1,"createToken"),s(V1,"createTokenInternal");var X1=H1({name:"EOF",pattern:j1.NA});function K1(t,e,n,r,i,a,s,o){return{image:e,startOffset:n,endOffset:r,startLine:i,endLine:a,startColumn:s,endColumn:o,tokenTypeIdx:t.tokenTypeIdx,tokenType:t}}function Z1(t,e){return E1(t,e)}L1([X1]),s(K1,"createTokenInstance"),s(Z1,"tokenMatcher");var Q1={buildMismatchTokenMessage:({expected:t,actual:e,previous:n,ruleName:r})=>`Expecting ${W1(t)?`--\x3e ${Y1(t)} <--`:`token of type --\x3e ${t.name} <--`} but found --\x3e '${e.image}' <--`,buildNotAllInputParsedMessage:({firstRedundant:t,ruleName:e})=>"Redundant input, expecting EOF but found: "+t.image,buildNoViableAltMessage({expectedPathsPerAlt:t,actual:e,previous:n,customUserDescription:r,ruleName:i}){const a="Expecting: ",s="\nbut found: '"+TU(e).image+"'";if(r)return a+r+s;{const e=rz(t,((t,e)=>t.concat(e)),[]),n=wF(e,(t=>`[${wF(t,(t=>Y1(t))).join(", ")}]`));return a+`one of these possible Token sequences:\n${wF(n,((t,e)=>` ${e+1}. ${t}`)).join("\n")}`+s}},buildEarlyExitMessage({expectedIterationPaths:t,actual:e,customUserDescription:n,ruleName:r}){const i="Expecting: ",a="\nbut found: '"+TU(e).image+"'";if(n)return i+n+a;return i+`expecting at least one iteration which starts with one of these possible Token sequences::\n <${wF(t,(t=>`[${wF(t,(t=>Y1(t))).join(",")}]`)).join(" ,")}>`+a}};Object.freeze(Q1);var J1={buildRuleNotFoundError:(t,e)=>"Invalid grammar, reference to a rule which is not defined: ->"+e.nonTerminalName+"<-\ninside top level rule: ->"+t.name+"<-"},t2={buildDuplicateFoundError(t,e){function n(t){return t instanceof f0?t.terminalType.name:t instanceof s0?t.nonTerminalName:""}s(n,"getExtraProductionArgument");const r=t.name,i=TU(e),a=i.idx,o=k0(i),l=n(i);let c=`->${o}${a>0?a:""}<- ${l?`with argument: ->${l}<-`:""}\n appears more than once (${e.length} times) in the top level rule: ->${r}<-. \n For further details see: https://chevrotain.io/docs/FAQ.html#NUMERICAL_SUFFIXES \n `;return c=c.replace(/[ \t]+/g," "),c=c.replace(/\s\s+/g,"\n"),c},buildNamespaceConflictError:t=>`Namespace conflict found in grammar.\nThe grammar has both a Terminal(Token) and a Non-Terminal(Rule) named: <${t.name}>.\nTo resolve this make sure each Terminal and Non-Terminal names are unique\nThis is easy to accomplish by using the convention that Terminal names start with an uppercase letter\nand Non-Terminal names start with a lower case letter.`,buildAlternationPrefixAmbiguityError(t){const e=wF(t.prefixPath,(t=>Y1(t))).join(", "),n=0===t.alternation.idx?"":t.alternation.idx;return`Ambiguous alternatives: <${t.ambiguityIndices.join(" ,")}> due to common lookahead prefix\nin <OR${n}> inside <${t.topLevelRule.name}> Rule,\n<${e}> may appears as a prefix path in all these alternatives.\nSee: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#COMMON_PREFIX\nFor Further details.`},buildAlternationAmbiguityError(t){const e=wF(t.prefixPath,(t=>Y1(t))).join(", "),n=0===t.alternation.idx?"":t.alternation.idx;let r=`Ambiguous Alternatives Detected: <${t.ambiguityIndices.join(" ,")}> in <OR${n}> inside <${t.topLevelRule.name}> Rule,\n<${e}> may appears as a prefix path in all these alternatives.\n`;return r+="See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES\nFor Further details.",r},buildEmptyRepetitionError(t){let e=k0(t.repetition);0!==t.repetition.idx&&(e+=t.repetition.idx);return`The repetition <${e}> within Rule <${t.topLevelRule.name}> can never consume any tokens.\nThis could lead to an infinite loop.`},buildTokenNameError:t=>"deprecated",buildEmptyAlternationError:t=>`Ambiguous empty alternative: <${t.emptyChoiceIdx+1}> in <OR${t.alternation.idx}> inside <${t.topLevelRule.name}> Rule.\nOnly the last alternative may be an empty alternative.`,buildTooManyAlternativesError:t=>`An Alternation cannot have more than 256 alternatives:\n<OR${t.alternation.idx}> inside <${t.topLevelRule.name}> Rule.\n has ${t.alternation.definition.length+1} alternatives.`,buildLeftRecursionError(t){const e=t.topLevelRule.name;return`Left Recursion found in grammar.\nrule: <${e}> can be invoked from itself (directly or indirectly)\nwithout consuming any Tokens. The grammar path that causes this is: \n ${`${e} --\x3e ${wF(t.leftRecursionPath,(t=>t.name)).concat([e]).join(" --\x3e ")}`}\n To fix this refactor your grammar to remove the left recursion.\nsee: https://en.wikipedia.org/wiki/LL_parser#Left_factoring.`},buildInvalidRuleNameError:t=>"deprecated",buildDuplicateRuleNameError(t){let e;e=t.topLevelRule instanceof o0?t.topLevelRule.name:t.topLevelRule;return`Duplicate definition, rule: ->${e}<- is already defined in the grammar: ->${t.grammarName}<-`}};function e2(t,e){const n=new i2(t,e);return n.resolveRefs(),n.errors}s(e2,"resolveGrammar");var n2,r2,i2=class extends v0{static{s(this,"GastRefResolverVisitor")}constructor(t,e){super(),this.nameToTopRule=t,this.errMsgProvider=e,this.errors=[]}resolveRefs(){zB(EF(this.nameToTopRule),(t=>{this.currTopLevel=t,t.accept(this)}))}visitNonTerminal(t){const e=this.nameToTopRule[t.nonTerminalName];if(e)t.referencedRule=e;else{const e=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,t);this.errors.push({message:e,type:W4.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:t.nonTerminalName})}}},a2=class extends T0{static{s(this,"AbstractNextPossibleTokensWalker")}constructor(t,e){super(),this.topProd=t,this.path=e,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=CB(this.path.ruleStack).reverse(),this.occurrenceStack=CB(this.path.occurrenceStack).reverse(),this.ruleStack.pop(),this.occurrenceStack.pop(),this.updateExpectedNext(),this.walk(this.topProd),this.possibleTokTypes}walk(t,e=[]){this.found||super.walk(t,e)}walkProdRef(t,e,n){if(t.referencedRule.name===this.nextProductionName&&t.idx===this.nextProductionOccurrence){const r=e.concat(n);this.updateExpectedNext(),this.walk(t.referencedRule,r)}}updateExpectedNext(){bA(this.ruleStack)?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())}},s2=class extends a2{static{s(this,"NextAfterTokenWalker")}constructor(t,e){super(t,e),this.path=e,this.nextTerminalName="",this.nextTerminalOccurrence=0,this.nextTerminalName=this.path.lastTok.name,this.nextTerminalOccurrence=this.path.lastTokOccurrence}walkTerminal(t,e,n){if(this.isAtEndOfPath&&t.terminalType.name===this.nextTerminalName&&t.idx===this.nextTerminalOccurrence&&!this.found){const t=e.concat(n),r=new l0({definition:t});this.possibleTokTypes=E0(r),this.found=!0}}},o2=class extends T0{static{s(this,"AbstractNextTerminalAfterProductionWalker")}constructor(t,e){super(),this.topRule=t,this.occurrence=e,this.result={token:void 0,occurrence:void 0,isEndOfRule:void 0}}startWalking(){return this.walk(this.topRule),this.result}},l2=class extends o2{static{s(this,"NextTerminalAfterManyWalker")}walkMany(t,e,n){if(t.idx===this.occurrence){const t=TU(e.concat(n));this.result.isEndOfRule=void 0===t,t instanceof f0&&(this.result.token=t.terminalType,this.result.occurrence=t.idx)}else super.walkMany(t,e,n)}},c2=class extends o2{static{s(this,"NextTerminalAfterManySepWalker")}walkManySep(t,e,n){if(t.idx===this.occurrence){const t=TU(e.concat(n));this.result.isEndOfRule=void 0===t,t instanceof f0&&(this.result.token=t.terminalType,this.result.occurrence=t.idx)}else super.walkManySep(t,e,n)}},h2=class extends o2{static{s(this,"NextTerminalAfterAtLeastOneWalker")}walkAtLeastOne(t,e,n){if(t.idx===this.occurrence){const t=TU(e.concat(n));this.result.isEndOfRule=void 0===t,t instanceof f0&&(this.result.token=t.terminalType,this.result.occurrence=t.idx)}else super.walkAtLeastOne(t,e,n)}},u2=class extends o2{static{s(this,"NextTerminalAfterAtLeastOneSepWalker")}walkAtLeastOneSep(t,e,n){if(t.idx===this.occurrence){const t=TU(e.concat(n));this.result.isEndOfRule=void 0===t,t instanceof f0&&(this.result.token=t.terminalType,this.result.occurrence=t.idx)}else super.walkAtLeastOneSep(t,e,n)}};function d2(t,e,n=[]){n=CB(n);let r=[],i=0;function a(e){return e.concat(lU(t,i+1))}function o(t){const i=d2(a(t),e,n);return r.concat(i)}for(s(a,"remainingPathWith"),s(o,"getAlternativesForProd");n.length<e&&i<t.length;){const e=t[i];if(e instanceof l0)return o(e.definition);if(e instanceof s0)return o(e.definition);if(e instanceof c0)r=o(e.definition);else{if(e instanceof h0){return o(e.definition.concat([new d0({definition:e.definition})]))}if(e instanceof u0){return o([new l0({definition:e.definition}),new d0({definition:[new f0({terminalType:e.separator})].concat(e.definition)})])}if(e instanceof p0){const t=e.definition.concat([new d0({definition:[new f0({terminalType:e.separator})].concat(e.definition)})]);r=o(t)}else if(e instanceof d0){const t=e.definition.concat([new d0({definition:e.definition})]);r=o(t)}else{if(e instanceof g0)return zB(e.definition,(t=>{!1===bA(t.definition)&&(r=o(t.definition))})),r;if(!(e instanceof f0))throw Error("non exhaustive match");n.push(e.terminalType)}}i++}return r.push({partialPath:n,suffixDef:lU(t,i)}),r}function p2(t,e,n,r){const i="EXIT_NONE_TERMINAL",a=[i],s="EXIT_ALTERNATIVE";let o=!1;const l=e.length,c=l-r-1,h=[],u=[];for(u.push({idx:-1,def:t,ruleStack:[],occurrenceStack:[]});!bA(u);){const t=u.pop();if(t===s){o&&MB(u).idx<=c&&u.pop();continue}const r=t.def,d=t.idx,p=t.ruleStack,g=t.occurrenceStack;if(bA(r))continue;const f=r[0];if(f===i){const t={idx:d,def:lU(r),ruleStack:hU(p),occurrenceStack:hU(g)};u.push(t)}else if(f instanceof f0)if(d<l-1){const t=d+1;if(n(e[t],f.terminalType)){const e={idx:t,def:lU(r),ruleStack:p,occurrenceStack:g};u.push(e)}}else{if(d!==l-1)throw Error("non exhaustive match");h.push({nextTokenType:f.terminalType,nextTokenOccurrence:f.idx,ruleStack:p,occurrenceStack:g}),o=!0}else if(f instanceof s0){const t=CB(p);t.push(f.nonTerminalName);const e=CB(g);e.push(f.idx);const n={idx:d,def:f.definition.concat(a,lU(r)),ruleStack:t,occurrenceStack:e};u.push(n)}else if(f instanceof c0){const t={idx:d,def:lU(r),ruleStack:p,occurrenceStack:g};u.push(t),u.push(s);const e={idx:d,def:f.definition.concat(lU(r)),ruleStack:p,occurrenceStack:g};u.push(e)}else if(f instanceof h0){const t=new d0({definition:f.definition,idx:f.idx}),e={idx:d,def:f.definition.concat([t],lU(r)),ruleStack:p,occurrenceStack:g};u.push(e)}else if(f instanceof u0){const t=new f0({terminalType:f.separator}),e=new d0({definition:[t].concat(f.definition),idx:f.idx}),n={idx:d,def:f.definition.concat([e],lU(r)),ruleStack:p,occurrenceStack:g};u.push(n)}else if(f instanceof p0){const t={idx:d,def:lU(r),ruleStack:p,occurrenceStack:g};u.push(t),u.push(s);const e=new f0({terminalType:f.separator}),n=new d0({definition:[e].concat(f.definition),idx:f.idx}),i={idx:d,def:f.definition.concat([n],lU(r)),ruleStack:p,occurrenceStack:g};u.push(i)}else if(f instanceof d0){const t={idx:d,def:lU(r),ruleStack:p,occurrenceStack:g};u.push(t),u.push(s);const e=new d0({definition:f.definition,idx:f.idx}),n={idx:d,def:f.definition.concat([e],lU(r)),ruleStack:p,occurrenceStack:g};u.push(n)}else if(f instanceof g0)for(let t=f.definition.length-1;t>=0;t--){const e={idx:d,def:f.definition[t].definition.concat(lU(r)),ruleStack:p,occurrenceStack:g};u.push(e),u.push(s)}else if(f instanceof l0)u.push({idx:d,def:f.definition.concat(lU(r)),ruleStack:p,occurrenceStack:g});else{if(!(f instanceof o0))throw Error("non exhaustive match");u.push(g2(f,d,p,g))}}return h}function g2(t,e,n,r){const i=CB(n);i.push(t.name);const a=CB(r);return a.push(1),{idx:e,def:t.definition,ruleStack:i,occurrenceStack:a}}function f2(t){if(t instanceof c0||"Option"===t)return n2.OPTION;if(t instanceof d0||"Repetition"===t)return n2.REPETITION;if(t instanceof h0||"RepetitionMandatory"===t)return n2.REPETITION_MANDATORY;if(t instanceof u0||"RepetitionMandatoryWithSeparator"===t)return n2.REPETITION_MANDATORY_WITH_SEPARATOR;if(t instanceof p0||"RepetitionWithSeparator"===t)return n2.REPETITION_WITH_SEPARATOR;if(t instanceof g0||"Alternation"===t)return n2.ALTERNATION;throw Error("non exhaustive match")}function m2(t){const{occurrence:e,rule:n,prodType:r,maxLookahead:i}=t,a=f2(r);return a===n2.ALTERNATION?S2(e,n,i):A2(e,n,a,i)}function y2(t,e,n,r,i,a){const s=S2(t,e,n);return a(s,r,I2(s)?C1:E1,i)}function v2(t,e,n,r,i,a){const s=A2(t,e,i,n),o=I2(s)?C1:E1;return a(s[0],o,r)}function x2(t,e,n,r){const i=t.length,a=mU(t,(t=>mU(t,(t=>1===t.length))));if(e)return function(e){const r=wF(e,(t=>t.GATE));for(let e=0;e<i;e++){const i=t[e],a=i.length,s=r[e];if(void 0===s||!1!==s.call(this))t:for(let t=0;t<a;t++){const r=i[t],a=r.length;for(let t=0;t<a;t++){const e=this.LA(t+1);if(!1===n(e,r[t]))continue t}return e}}};if(a&&!r){const e=wF(t,(t=>VF(t))),n=rz(e,((t,e,n)=>(zB(e,(e=>{BU(t,e.tokenTypeIdx)||(t[e.tokenTypeIdx]=n),zB(e.categoryMatches,(e=>{BU(t,e)||(t[e]=n)}))})),t)),{});return function(){const t=this.LA(1);return n[t.tokenTypeIdx]}}return function(){for(let e=0;e<i;e++){const r=t[e],i=r.length;t:for(let t=0;t<i;t++){const i=r[t],a=i.length;for(let t=0;t<a;t++){const e=this.LA(t+1);if(!1===n(e,i[t]))continue t}return e}}}}function b2(t,e,n){const r=mU(t,(t=>1===t.length)),i=t.length;if(r&&!n){const e=VF(t);if(1===e.length&&bA(e[0].categoryMatches)){const t=e[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===t}}{const t=rz(e,((t,e,n)=>(t[e.tokenTypeIdx]=!0,zB(e.categoryMatches,(e=>{t[e]=!0})),t)),[]);return function(){const e=this.LA(1);return!0===t[e.tokenTypeIdx]}}}return function(){t:for(let n=0;n<i;n++){const r=t[n],i=r.length;for(let t=0;t<i;t++){const n=this.LA(t+1);if(!1===e(n,r[t]))continue t}return!0}return!1}}s(d2,"possiblePathsFrom"),s(p2,"nextPossibleTokensAfter"),s(g2,"expandTopLevelRule"),(r2=n2||(n2={}))[r2.OPTION=0]="OPTION",r2[r2.REPETITION=1]="REPETITION",r2[r2.REPETITION_MANDATORY=2]="REPETITION_MANDATORY",r2[r2.REPETITION_MANDATORY_WITH_SEPARATOR=3]="REPETITION_MANDATORY_WITH_SEPARATOR",r2[r2.REPETITION_WITH_SEPARATOR=4]="REPETITION_WITH_SEPARATOR",r2[r2.ALTERNATION=5]="ALTERNATION",s(f2,"getProdType"),s(m2,"getLookaheadPaths"),s(y2,"buildLookaheadFuncForOr"),s(v2,"buildLookaheadFuncForOptionalProd"),s(x2,"buildAlternativesLookAheadFunc"),s(b2,"buildSingleAlternativeLookaheadFunction");var w2=class extends T0{static{s(this,"RestDefinitionFinderWalker")}constructor(t,e,n){super(),this.topProd=t,this.targetOccurrence=e,this.targetProdType=n}startWalking(){return this.walk(this.topProd),this.restDef}checkIsTarget(t,e,n,r){return t.idx===this.targetOccurrence&&this.targetProdType===e&&(this.restDef=n.concat(r),!0)}walkOption(t,e,n){this.checkIsTarget(t,n2.OPTION,e,n)||super.walkOption(t,e,n)}walkAtLeastOne(t,e,n){this.checkIsTarget(t,n2.REPETITION_MANDATORY,e,n)||super.walkOption(t,e,n)}walkAtLeastOneSep(t,e,n){this.checkIsTarget(t,n2.REPETITION_MANDATORY_WITH_SEPARATOR,e,n)||super.walkOption(t,e,n)}walkMany(t,e,n){this.checkIsTarget(t,n2.REPETITION,e,n)||super.walkOption(t,e,n)}walkManySep(t,e,n){this.checkIsTarget(t,n2.REPETITION_WITH_SEPARATOR,e,n)||super.walkOption(t,e,n)}},k2=class extends v0{static{s(this,"InsideDefinitionFinderVisitor")}constructor(t,e,n){super(),this.targetOccurrence=t,this.targetProdType=e,this.targetRef=n,this.result=[]}checkIsTarget(t,e){t.idx!==this.targetOccurrence||this.targetProdType!==e||void 0!==this.targetRef&&t!==this.targetRef||(this.result=t.definition)}visitOption(t){this.checkIsTarget(t,n2.OPTION)}visitRepetition(t){this.checkIsTarget(t,n2.REPETITION)}visitRepetitionMandatory(t){this.checkIsTarget(t,n2.REPETITION_MANDATORY)}visitRepetitionMandatoryWithSeparator(t){this.checkIsTarget(t,n2.REPETITION_MANDATORY_WITH_SEPARATOR)}visitRepetitionWithSeparator(t){this.checkIsTarget(t,n2.REPETITION_WITH_SEPARATOR)}visitAlternation(t){this.checkIsTarget(t,n2.ALTERNATION)}};function T2(t){const e=new Array(t);for(let n=0;n<t;n++)e[n]=[];return e}function _2(t){let e=[""];for(let n=0;n<t.length;n++){const r=t[n],i=[];for(let t=0;t<e.length;t++){const n=e[t];i.push(n+"_"+r.tokenTypeIdx);for(let t=0;t<r.categoryMatches.length;t++){const e="_"+r.categoryMatches[t];i.push(n+e)}}e=i}return e}function E2(t,e,n){for(let r=0;r<t.length;r++){if(r===n)continue;const i=t[r];for(let t=0;t<e.length;t++){if(!0===i[e[t]])return!1}}return!0}function C2(t,e){const n=wF(t,(t=>d2([t],1))),r=T2(n.length),i=wF(n,(t=>{const e={};return zB(t,(t=>{const n=_2(t.partialPath);zB(n,(t=>{e[t]=!0}))})),e}));let a=n;for(let t=1;t<=e;t++){const n=a;a=T2(n.length);for(let s=0;s<n.length;s++){const o=n[s];for(let n=0;n<o.length;n++){const l=o[n].partialPath,c=o[n].suffixDef,h=_2(l);if(E2(i,h,s)||bA(c)||l.length===e){const t=r[s];if(!1===L2(t,l)){t.push(l);for(let t=0;t<h.length;t++){const e=h[t];i[s][e]=!0}}}else{const e=d2(c,t+1,l);a[s]=a[s].concat(e),zB(e,(t=>{const e=_2(t.partialPath);zB(e,(t=>{i[s][t]=!0}))}))}}}}return r}function S2(t,e,n,r){const i=new k2(t,n2.ALTERNATION,r);return e.accept(i),C2(i.result,n)}function A2(t,e,n,r){const i=new k2(t,n);e.accept(i);const a=i.result,s=new w2(e,t,n).startWalking();return C2([new l0({definition:a}),new l0({definition:s})],r)}function L2(t,e){t:for(let n=0;n<t.length;n++){const r=t[n];if(r.length===e.length){for(let t=0;t<r.length;t++){const n=e[t],i=r[t];if(!1===(n===i||void 0!==i.categoryMatchesMap[n.tokenTypeIdx]))continue t}return!0}}return!1}function N2(t,e){return t.length<e.length&&mU(t,((t,n)=>{const r=e[n];return t===r||r.categoryMatchesMap[t.tokenTypeIdx]}))}function I2(t){return mU(t,(t=>mU(t,(t=>mU(t,(t=>bA(t.categoryMatches)))))))}function M2(t){const e=t.lookaheadStrategy.validate({rules:t.rules,tokenTypes:t.tokenTypes,grammarName:t.grammarName});return wF(e,(t=>Object.assign({type:W4.CUSTOM_LOOKAHEAD_VALIDATION},t)))}function R2(t,e,n,r){const i=EU(t,(t=>D2(t,n))),a=K2(t,e,n),s=EU(t,(t=>W2(t,n))),o=EU(t,(e=>$2(e,t,r,n)));return i.concat(a,s,o)}function D2(t,e){const n=new B2;t.accept(n);const r=n.allProductions,i=MU(r,O2),a=aG(i,(t=>t.length>1));return wF(EF(a),(n=>{const r=TU(n),i=e.buildDuplicateFoundError(t,n),a=k0(r),s={message:i,type:W4.DUPLICATE_PRODUCTIONS,ruleName:t.name,dslName:a,occurrence:r.idx},o=P2(r);return o&&(s.parameter=o),s}))}function O2(t){return`${k0(t)}_#_${t.idx}_#_${P2(t)}`}function P2(t){return t instanceof f0?t.terminalType.name:t instanceof s0?t.nonTerminalName:""}s(T2,"initializeArrayOfArrays"),s(_2,"pathToHashKeys"),s(E2,"isUniquePrefixHash"),s(C2,"lookAheadSequenceFromAlternatives"),s(S2,"getLookaheadPathsForOr"),s(A2,"getLookaheadPathsForOptionalProd"),s(L2,"containsPath"),s(N2,"isStrictPrefixOfPath"),s(I2,"areTokenCategoriesNotUsed"),s(M2,"validateLookahead"),s(R2,"validateGrammar"),s(D2,"validateDuplicateProductions"),s(O2,"identifyProductionForDuplicates"),s(P2,"getExtraProductionArgument");var B2=class extends v0{static{s(this,"OccurrenceValidationCollector")}constructor(){super(...arguments),this.allProductions=[]}visitNonTerminal(t){this.allProductions.push(t)}visitOption(t){this.allProductions.push(t)}visitRepetitionWithSeparator(t){this.allProductions.push(t)}visitRepetitionMandatory(t){this.allProductions.push(t)}visitRepetitionMandatoryWithSeparator(t){this.allProductions.push(t)}visitRepetition(t){this.allProductions.push(t)}visitAlternation(t){this.allProductions.push(t)}visitTerminal(t){this.allProductions.push(t)}};function $2(t,e,n,r){const i=[];if(rz(e,((e,n)=>n.name===t.name?e+1:e),0)>1){const e=r.buildDuplicateRuleNameError({topLevelRule:t,grammarName:n});i.push({message:e,type:W4.DUPLICATE_RULE_NAME,ruleName:t.name})}return i}function F2(t,e,n){const r=[];let i;return GU(e,t)||(i=`Invalid rule override, rule: ->${t}<- cannot be overridden in the grammar: ->${n}<-as it is not defined in any of the super grammars `,r.push({message:i,type:W4.INVALID_RULE_OVERRIDE,ruleName:t})),r}function z2(t,e,n,r=[]){const i=[],a=U2(e.definition);if(bA(a))return[];{const e=t.name;GU(a,t)&&i.push({message:n.buildLeftRecursionError({topLevelRule:t,leftRecursionPath:r}),type:W4.LEFT_RECURSION,ruleName:e});const s=sU(a,r.concat([t])),o=EU(s,(e=>{const i=CB(r);return i.push(e),z2(t,e,n,i)}));return i.concat(o)}}function U2(t){let e=[];if(bA(t))return e;const n=TU(t);if(n instanceof s0)e.push(n.referencedRule);else if(n instanceof l0||n instanceof c0||n instanceof h0||n instanceof u0||n instanceof p0||n instanceof d0)e=e.concat(U2(n.definition));else if(n instanceof g0)e=VF(wF(n.definition,(t=>U2(t.definition))));else if(!(n instanceof f0))throw Error("non exhaustive match");const r=b0(n),i=t.length>1;if(r&&i){const n=lU(t);return e.concat(U2(n))}return e}s($2,"validateRuleDoesNotAlreadyExist"),s(F2,"validateRuleIsOverridden"),s(z2,"validateNoLeftRecursion"),s(U2,"getFirstNoneTerminal");var G2=class extends v0{static{s(this,"OrCollector")}constructor(){super(...arguments),this.alternations=[]}visitAlternation(t){this.alternations.push(t)}};function q2(t,e){const n=new G2;t.accept(n);const r=n.alternations;return EU(r,(n=>{const r=hU(n.definition);return EU(r,((r,i)=>{const a=p2([r],[],E1,1);return bA(a)?[{message:e.buildEmptyAlternationError({topLevelRule:t,alternation:n,emptyChoiceIdx:i}),type:W4.NONE_LAST_EMPTY_ALT,ruleName:t.name,occurrence:n.idx,alternative:i+1}]:[]}))}))}function j2(t,e,n){const r=new G2;t.accept(r);let i=r.alternations;i=PG(i,(t=>!0===t.ignoreAmbiguities));return EU(i,(r=>{const i=r.idx,a=r.maxLookahead||e,s=S2(i,t,a,r),o=V2(s,r,t,n),l=X2(s,r,t,n);return o.concat(l)}))}s(q2,"validateEmptyOrAlternative"),s(j2,"validateAmbiguousAlternationAlternatives");var Y2=class extends v0{static{s(this,"RepetitionCollector")}constructor(){super(...arguments),this.allProductions=[]}visitRepetitionWithSeparator(t){this.allProductions.push(t)}visitRepetitionMandatory(t){this.allProductions.push(t)}visitRepetitionMandatoryWithSeparator(t){this.allProductions.push(t)}visitRepetition(t){this.allProductions.push(t)}};function W2(t,e){const n=new G2;t.accept(n);const r=n.alternations;return EU(r,(n=>n.definition.length>255?[{message:e.buildTooManyAlternativesError({topLevelRule:t,alternation:n}),type:W4.TOO_MANY_ALTS,ruleName:t.name,occurrence:n.idx}]:[]))}function H2(t,e,n){const r=[];return zB(t,(t=>{const i=new Y2;t.accept(i);const a=i.allProductions;zB(a,(i=>{const a=f2(i),s=i.maxLookahead||e,o=A2(i.idx,t,a,s)[0];if(bA(VF(o))){const e=n.buildEmptyRepetitionError({topLevelRule:t,repetition:i});r.push({message:e,type:W4.NO_NON_EMPTY_LOOKAHEAD,ruleName:t.name})}}))})),r}function V2(t,e,n,r){const i=[],a=rz(t,((n,r,a)=>(!0===e.definition[a].ignoreAmbiguities||zB(r,(r=>{const s=[a];zB(t,((t,n)=>{a!==n&&L2(t,r)&&!0!==e.definition[n].ignoreAmbiguities&&s.push(n)})),s.length>1&&!L2(i,r)&&(i.push(r),n.push({alts:s,path:r}))})),n)),[]);return wF(a,(t=>{const i=wF(t.alts,(t=>t+1));return{message:r.buildAlternationAmbiguityError({topLevelRule:n,alternation:e,ambiguityIndices:i,prefixPath:t.path}),type:W4.AMBIGUOUS_ALTS,ruleName:n.name,occurrence:e.idx,alternatives:t.alts}}))}function X2(t,e,n,r){const i=rz(t,((t,e,n)=>{const r=wF(e,(t=>({idx:n,path:t})));return t.concat(r)}),[]);return Xz(EU(i,(t=>{if(!0===e.definition[t.idx].ignoreAmbiguities)return[];const a=t.idx,s=t.path,o=yF(i,(t=>!0!==e.definition[t.idx].ignoreAmbiguities&&t.idx<a&&N2(t.path,s)));return wF(o,(t=>{const i=[t.idx+1,a+1],s=0===e.idx?"":e.idx;return{message:r.buildAlternationPrefixAmbiguityError({topLevelRule:n,alternation:e,ambiguityIndices:i,prefixPath:t.path}),type:W4.AMBIGUOUS_PREFIX_ALTS,ruleName:n.name,occurrence:s,alternatives:i}}))})))}function K2(t,e,n){const r=[],i=wF(e,(t=>t.name));return zB(t,(t=>{const e=t.name;if(GU(i,e)){const i=n.buildNamespaceConflictError(t);r.push({message:i,type:W4.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:e})}})),r}function Z2(t){const e=NB(t,{errMsgProvider:J1}),n={};return zB(t.rules,(t=>{n[t.name]=t})),e2(n,e.errMsgProvider)}function Q2(t){return R2((t=NB(t,{errMsgProvider:t2})).rules,t.tokenTypes,t.errMsgProvider,t.grammarName)}s(W2,"validateTooManyAlts"),s(H2,"validateSomeNonEmptyLookaheadPath"),s(V2,"checkAlternativesAmbiguities"),s(X2,"checkPrefixAlternativesAmbiguities"),s(K2,"checkTerminalAndNoneTerminalsNameSpace"),s(Z2,"resolveGrammar"),s(Q2,"validateGrammar");var J2=["MismatchedTokenException","NoViableAltException","EarlyExitException","NotAllInputParsedException"];function t4(t){return GU(J2,t.name)}Object.freeze(J2),s(t4,"isRecognitionException");var e4=class extends Error{static{s(this,"RecognitionException")}constructor(t,e){super(t),this.token=e,this.resyncedTokens=[],Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}},n4=class extends e4{static{s(this,"MismatchedTokenException")}constructor(t,e,n){super(t,e),this.previousToken=n,this.name="MismatchedTokenException"}},r4=class extends e4{static{s(this,"NoViableAltException")}constructor(t,e,n){super(t,e),this.previousToken=n,this.name="NoViableAltException"}},i4=class extends e4{static{s(this,"NotAllInputParsedException")}constructor(t,e){super(t,e),this.name="NotAllInputParsedException"}},a4=class extends e4{static{s(this,"EarlyExitException")}constructor(t,e,n){super(t,e),this.previousToken=n,this.name="EarlyExitException"}},s4={},o4=class extends Error{static{s(this,"InRuleRecoveryException")}constructor(t){super(t),this.name="InRuleRecoveryException"}},l4=class{static{s(this,"Recoverable")}initRecoverable(t){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=BU(t,"recoveryEnabled")?t.recoveryEnabled:V4.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=c4)}getTokenToInsert(t){const e=K1(t,"",NaN,NaN,NaN,NaN,NaN,NaN);return e.isInsertedInRecovery=!0,e}canTokenTypeBeInsertedInRecovery(t){return!0}canTokenTypeBeDeletedInRecovery(t){return!0}tryInRepetitionRecovery(t,e,n,r){const i=this.findReSyncTokenType(),a=this.exportLexerState(),o=[];let l=!1;const c=this.LA(1);let h=this.LA(1);const u=s((()=>{const t=this.LA(0),e=this.errorMessageProvider.buildMismatchTokenMessage({expected:r,actual:c,previous:t,ruleName:this.getCurrRuleFullName()}),n=new n4(e,c,this.LA(0));n.resyncedTokens=hU(o),this.SAVE_ERROR(n)}),"generateErrorMessage");for(;!l;){if(this.tokenMatcher(h,r))return void u();if(n.call(this))return u(),void t.apply(this,e);this.tokenMatcher(h,i)?l=!0:(h=this.SKIP_TOKEN(),this.addToResyncTokens(h,o))}this.importLexerState(a)}shouldInRepetitionRecoveryBeTried(t,e,n){return!1!==n&&(!this.tokenMatcher(this.LA(1),t)&&(!this.isBackTracking()&&!this.canPerformInRuleRecovery(t,this.getFollowsForInRuleRecovery(t,e))))}getFollowsForInRuleRecovery(t,e){const n=this.getCurrentGrammarPath(t,e);return this.getNextPossibleTokenTypes(n)}tryInRuleRecovery(t,e){if(this.canRecoverWithSingleTokenInsertion(t,e)){return this.getTokenToInsert(t)}if(this.canRecoverWithSingleTokenDeletion(t)){const t=this.SKIP_TOKEN();return this.consumeToken(),t}throw new o4("sad sad panda")}canPerformInRuleRecovery(t,e){return this.canRecoverWithSingleTokenInsertion(t,e)||this.canRecoverWithSingleTokenDeletion(t)}canRecoverWithSingleTokenInsertion(t,e){if(!this.canTokenTypeBeInsertedInRecovery(t))return!1;if(bA(e))return!1;const n=this.LA(1);return void 0!==wU(e,(t=>this.tokenMatcher(n,t)))}canRecoverWithSingleTokenDeletion(t){if(!this.canTokenTypeBeDeletedInRecovery(t))return!1;return this.tokenMatcher(this.LA(2),t)}isInCurrentRuleReSyncSet(t){const e=this.getCurrFollowKey(),n=this.getFollowSetFromFollowKey(e);return GU(n,t)}findReSyncTokenType(){const t=this.flattenFollowSet();let e=this.LA(1),n=2;for(;;){const r=wU(t,(t=>Z1(e,t)));if(void 0!==r)return r;e=this.LA(n),n++}}getCurrFollowKey(){if(1===this.RULE_STACK.length)return s4;const t=this.getLastExplicitRuleShortName(),e=this.getLastExplicitRuleOccurrenceIndex(),n=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(t),idxInCallingRule:e,inRule:this.shortRuleNameToFullName(n)}}buildFullFollowKeyStack(){const t=this.RULE_STACK,e=this.RULE_OCCURRENCE_STACK;return wF(t,((n,r)=>0===r?s4:{ruleName:this.shortRuleNameToFullName(n),idxInCallingRule:e[r],inRule:this.shortRuleNameToFullName(t[r-1])}))}flattenFollowSet(){const t=wF(this.buildFullFollowKeyStack(),(t=>this.getFollowSetFromFollowKey(t)));return VF(t)}getFollowSetFromFollowKey(t){if(t===s4)return[X1];const e=t.ruleName+t.idxInCallingRule+"_~IN~_"+t.inRule;return this.resyncFollows[e]}addToResyncTokens(t,e){return this.tokenMatcher(t,X1)||e.push(t),e}reSyncTo(t){const e=[];let n=this.LA(1);for(;!1===this.tokenMatcher(n,t);)n=this.SKIP_TOKEN(),this.addToResyncTokens(n,e);return hU(e)}attemptInRepetitionRecovery(t,e,n,r,i,a,s){}getCurrentGrammarPath(t,e){return{ruleStack:this.getHumanReadableRuleStack(),occurrenceStack:CB(this.RULE_OCCURRENCE_STACK),lastTok:t,lastTokOccurrence:e}}getHumanReadableRuleStack(){return wF(this.RULE_STACK,(t=>this.shortRuleNameToFullName(t)))}};function c4(t,e,n,r,i,a,s){const o=this.getKeyForAutomaticLookahead(r,i);let l=this.firstAfterRepMap[o];if(void 0===l){const t=this.getCurrRuleFullName();l=new a(this.getGAstProductions()[t],i).startWalking(),this.firstAfterRepMap[o]=l}let c=l.token,h=l.occurrence;const u=l.isEndOfRule;1===this.RULE_STACK.length&&u&&void 0===c&&(c=X1,h=1),void 0!==c&&void 0!==h&&this.shouldInRepetitionRecoveryBeTried(c,h,s)&&this.tryInRepetitionRecovery(t,e,n,c)}s(c4,"attemptInRepetitionRecovery");function h4(t,e,n){return n|e|t}s(h4,"getKeyForAutomaticLookahead");var u4=class{static{s(this,"LLkLookaheadStrategy")}constructor(t){var e;this.maxLookahead=null!==(e=null==t?void 0:t.maxLookahead)&&void 0!==e?e:V4.maxLookahead}validate(t){const e=this.validateNoLeftRecursion(t.rules);if(bA(e)){const n=this.validateEmptyOrAlternatives(t.rules),r=this.validateAmbiguousAlternationAlternatives(t.rules,this.maxLookahead),i=this.validateSomeNonEmptyLookaheadPath(t.rules,this.maxLookahead);return[...e,...n,...r,...i]}return e}validateNoLeftRecursion(t){return EU(t,(t=>z2(t,t,t2)))}validateEmptyOrAlternatives(t){return EU(t,(t=>q2(t,t2)))}validateAmbiguousAlternationAlternatives(t,e){return EU(t,(t=>j2(t,e,t2)))}validateSomeNonEmptyLookaheadPath(t,e){return H2(t,e,t2)}buildLookaheadForAlternation(t){return y2(t.prodOccurrence,t.rule,t.maxLookahead,t.hasPredicates,t.dynamicTokensEnabled,x2)}buildLookaheadForOptional(t){return v2(t.prodOccurrence,t.rule,t.maxLookahead,t.dynamicTokensEnabled,f2(t.prodType),b2)}},d4=class{static{s(this,"LooksAhead")}initLooksAhead(t){this.dynamicTokensEnabled=BU(t,"dynamicTokensEnabled")?t.dynamicTokensEnabled:V4.dynamicTokensEnabled,this.maxLookahead=BU(t,"maxLookahead")?t.maxLookahead:V4.maxLookahead,this.lookaheadStrategy=BU(t,"lookaheadStrategy")?t.lookaheadStrategy:new u4({maxLookahead:this.maxLookahead}),this.lookAheadFuncsCache=new Map}preComputeLookaheadFunctions(t){zB(t,(t=>{this.TRACE_INIT(`${t.name} Rule Lookahead`,(()=>{const{alternation:e,repetition:n,option:r,repetitionMandatory:i,repetitionMandatoryWithSeparator:a,repetitionWithSeparator:s}=g4(t);zB(e,(e=>{const n=0===e.idx?"":e.idx;this.TRACE_INIT(`${k0(e)}${n}`,(()=>{const n=this.lookaheadStrategy.buildLookaheadForAlternation({prodOccurrence:e.idx,rule:t,maxLookahead:e.maxLookahead||this.maxLookahead,hasPredicates:e.hasPredicates,dynamicTokensEnabled:this.dynamicTokensEnabled}),r=h4(this.fullRuleNameToShort[t.name],256,e.idx);this.setLaFuncCache(r,n)}))})),zB(n,(e=>{this.computeLookaheadFunc(t,e.idx,768,"Repetition",e.maxLookahead,k0(e))})),zB(r,(e=>{this.computeLookaheadFunc(t,e.idx,512,"Option",e.maxLookahead,k0(e))})),zB(i,(e=>{this.computeLookaheadFunc(t,e.idx,1024,"RepetitionMandatory",e.maxLookahead,k0(e))})),zB(a,(e=>{this.computeLookaheadFunc(t,e.idx,1536,"RepetitionMandatoryWithSeparator",e.maxLookahead,k0(e))})),zB(s,(e=>{this.computeLookaheadFunc(t,e.idx,1280,"RepetitionWithSeparator",e.maxLookahead,k0(e))}))}))}))}computeLookaheadFunc(t,e,n,r,i,a){this.TRACE_INIT(`${a}${0===e?"":e}`,(()=>{const a=this.lookaheadStrategy.buildLookaheadForOptional({prodOccurrence:e,rule:t,maxLookahead:i||this.maxLookahead,dynamicTokensEnabled:this.dynamicTokensEnabled,prodType:r}),s=h4(this.fullRuleNameToShort[t.name],n,e);this.setLaFuncCache(s,a)}))}getKeyForAutomaticLookahead(t,e){return h4(this.getLastExplicitRuleShortName(),t,e)}getLaFuncFromCache(t){return this.lookAheadFuncsCache.get(t)}setLaFuncCache(t,e){this.lookAheadFuncsCache.set(t,e)}},p4=new class extends v0{static{s(this,"DslMethodsCollectorVisitor")}constructor(){super(...arguments),this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}reset(){this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}visitOption(t){this.dslMethods.option.push(t)}visitRepetitionWithSeparator(t){this.dslMethods.repetitionWithSeparator.push(t)}visitRepetitionMandatory(t){this.dslMethods.repetitionMandatory.push(t)}visitRepetitionMandatoryWithSeparator(t){this.dslMethods.repetitionMandatoryWithSeparator.push(t)}visitRepetition(t){this.dslMethods.repetition.push(t)}visitAlternation(t){this.dslMethods.alternation.push(t)}};function g4(t){p4.reset(),t.accept(p4);const e=p4.dslMethods;return p4.reset(),e}function f4(t,e){!0===isNaN(t.startOffset)?(t.startOffset=e.startOffset,t.endOffset=e.endOffset):t.endOffset<e.endOffset==!0&&(t.endOffset=e.endOffset)}function m4(t,e){!0===isNaN(t.startOffset)?(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==!0&&(t.endOffset=e.endOffset,t.endColumn=e.endColumn,t.endLine=e.endLine)}function y4(t,e,n){void 0===t.children[n]?t.children[n]=[e]:t.children[n].push(e)}function v4(t,e,n){void 0===t.children[e]?t.children[e]=[n]:t.children[e].push(n)}s(g4,"collectMethods"),s(f4,"setNodeLocationOnlyOffset"),s(m4,"setNodeLocationFull"),s(y4,"addTerminalToCst"),s(v4,"addNoneTerminalToCst");var x4,b4;function w4(t,e){Object.defineProperty(t,"name",{enumerable:!1,configurable:!0,writable:!1,value:e})}function k4(t,e){const n=EP(t),r=n.length;for(let i=0;i<r;i++){const r=t[n[i]],a=r.length;for(let t=0;t<a;t++){const n=r[t];void 0===n.tokenTypeIdx&&this[n.name](n.children,e)}}}function T4(t,e){const n=s((function(){}),"derivedConstructor");w4(n,t+"BaseSemantics");const r={visit:s((function(t,e){if(hb(t)&&(t=t[0]),!SF(t))return this[t.name](t.children,e)}),"visit"),validateVisitor:s((function(){const t=E4(this,e);if(!bA(t)){const e=wF(t,(t=>t.msg));throw Error(`Errors Detected in CST Visitor <${this.constructor.name}>:\n\t${e.join("\n\n").replace(/\n/g,"\n\t")}`)}}),"validateVisitor")};return n.prototype=r,n.prototype.constructor=n,n._RULE_NAMES=e,n}function _4(t,e,n){const r=s((function(){}),"derivedConstructor");w4(r,t+"BaseSemanticsWithDefaults");const i=Object.create(n.prototype);return zB(e,(t=>{i[t]=k4})),r.prototype=i,r.prototype.constructor=r,r}function E4(t,e){return C4(t,e)}function C4(t,e){const n=yF(e,(e=>!1===Hy(t[e]))),r=wF(n,(e=>({msg:`Missing visitor method: <${e}> on ${t.constructor.name} CST Visitor.`,type:x4.MISSING_METHOD,methodName:e})));return Xz(r)}s(w4,"defineNameProp"),s(k4,"defaultVisit"),s(T4,"createBaseSemanticVisitorConstructor"),s(_4,"createBaseVisitorConstructorWithDefaults"),(b4=x4||(x4={}))[b4.REDUNDANT_METHOD=0]="REDUNDANT_METHOD",b4[b4.MISSING_METHOD=1]="MISSING_METHOD",s(E4,"validateVisitor"),s(C4,"validateMissingCstMethods");var S4=class{static{s(this,"TreeBuilder")}initTreeBuilder(t){if(this.CST_STACK=[],this.outputCst=t.outputCst,this.nodeLocationTracking=BU(t,"nodeLocationTracking")?t.nodeLocationTracking:V4.nodeLocationTracking,this.outputCst)if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=m4,this.setNodeLocationFromNode=m4,this.cstPostRule=yz,this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=yz,this.setNodeLocationFromNode=yz,this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=f4,this.setNodeLocationFromNode=f4,this.cstPostRule=yz,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=yz,this.setNodeLocationFromNode=yz,this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else{if(!/none/i.test(this.nodeLocationTracking))throw Error(`Invalid <nodeLocationTracking> config option: "${t.nodeLocationTracking}"`);this.setNodeLocationFromToken=yz,this.setNodeLocationFromNode=yz,this.cstPostRule=yz,this.setInitialNodeLocation=yz}else this.cstInvocationStateUpdate=yz,this.cstFinallyStateUpdate=yz,this.cstPostTerminal=yz,this.cstPostNonTerminal=yz,this.cstPostRule=yz}setInitialNodeLocationOnlyOffsetRecovery(t){t.location={startOffset:NaN,endOffset:NaN}}setInitialNodeLocationOnlyOffsetRegular(t){t.location={startOffset:this.LA(1).startOffset,endOffset:NaN}}setInitialNodeLocationFullRecovery(t){t.location={startOffset:NaN,startLine:NaN,startColumn:NaN,endOffset:NaN,endLine:NaN,endColumn:NaN}}setInitialNodeLocationFullRegular(t){const e=this.LA(1);t.location={startOffset:e.startOffset,startLine:e.startLine,startColumn:e.startColumn,endOffset:NaN,endLine:NaN,endColumn:NaN}}cstInvocationStateUpdate(t){const e={name:t,children:Object.create(null)};this.setInitialNodeLocation(e),this.CST_STACK.push(e)}cstFinallyStateUpdate(){this.CST_STACK.pop()}cstPostRuleFull(t){const e=this.LA(0),n=t.location;n.startOffset<=e.startOffset==!0?(n.endOffset=e.endOffset,n.endLine=e.endLine,n.endColumn=e.endColumn):(n.startOffset=NaN,n.startLine=NaN,n.startColumn=NaN)}cstPostRuleOnlyOffset(t){const e=this.LA(0),n=t.location;n.startOffset<=e.startOffset==!0?n.endOffset=e.endOffset:n.startOffset=NaN}cstPostTerminal(t,e){const n=this.CST_STACK[this.CST_STACK.length-1];y4(n,e,t),this.setNodeLocationFromToken(n.location,e)}cstPostNonTerminal(t,e){const n=this.CST_STACK[this.CST_STACK.length-1];v4(n,e,t),this.setNodeLocationFromNode(n.location,t.location)}getBaseCstVisitorConstructor(){if(SF(this.baseCstVisitorConstructor)){const t=T4(this.className,EP(this.gastProductionsCache));return this.baseCstVisitorConstructor=t,t}return this.baseCstVisitorConstructor}getBaseCstVisitorConstructorWithDefaults(){if(SF(this.baseCstVisitorWithDefaultsConstructor)){const t=_4(this.className,EP(this.gastProductionsCache),this.getBaseCstVisitorConstructor());return this.baseCstVisitorWithDefaultsConstructor=t,t}return this.baseCstVisitorWithDefaultsConstructor}getLastExplicitRuleShortName(){const t=this.RULE_STACK;return t[t.length-1]}getPreviousExplicitRuleShortName(){const t=this.RULE_STACK;return t[t.length-2]}getLastExplicitRuleOccurrenceIndex(){const t=this.RULE_OCCURRENCE_STACK;return t[t.length-1]}},A4=class{static{s(this,"LexerAdapter")}initLexerAdapter(){this.tokVector=[],this.tokVectorLength=0,this.currIdx=-1}set input(t){if(!0!==this.selfAnalysisDone)throw Error("Missing <performSelfAnalysis> invocation at the end of the Parser's constructor.");this.reset(),this.tokVector=t,this.tokVectorLength=t.length}get input(){return this.tokVector}SKIP_TOKEN(){return this.currIdx<=this.tokVector.length-2?(this.consumeToken(),this.LA(1)):Y4}LA(t){const e=this.currIdx+t;return e<0||this.tokVectorLength<=e?Y4:this.tokVector[e]}consumeToken(){this.currIdx++}exportLexerState(){return this.currIdx}importLexerState(t){this.currIdx=t}resetLexerState(){this.currIdx=-1}moveToTerminatedState(){this.currIdx=this.tokVector.length-1}getLexerPosition(){return this.exportLexerState()}},L4=class{static{s(this,"RecognizerApi")}ACTION(t){return t.call(this)}consume(t,e,n){return this.consumeInternal(e,t,n)}subrule(t,e,n){return this.subruleInternal(e,t,n)}option(t,e){return this.optionInternal(e,t)}or(t,e){return this.orInternal(e,t)}many(t,e){return this.manyInternal(t,e)}atLeastOne(t,e){return this.atLeastOneInternal(t,e)}CONSUME(t,e){return this.consumeInternal(t,0,e)}CONSUME1(t,e){return this.consumeInternal(t,1,e)}CONSUME2(t,e){return this.consumeInternal(t,2,e)}CONSUME3(t,e){return this.consumeInternal(t,3,e)}CONSUME4(t,e){return this.consumeInternal(t,4,e)}CONSUME5(t,e){return this.consumeInternal(t,5,e)}CONSUME6(t,e){return this.consumeInternal(t,6,e)}CONSUME7(t,e){return this.consumeInternal(t,7,e)}CONSUME8(t,e){return this.consumeInternal(t,8,e)}CONSUME9(t,e){return this.consumeInternal(t,9,e)}SUBRULE(t,e){return this.subruleInternal(t,0,e)}SUBRULE1(t,e){return this.subruleInternal(t,1,e)}SUBRULE2(t,e){return this.subruleInternal(t,2,e)}SUBRULE3(t,e){return this.subruleInternal(t,3,e)}SUBRULE4(t,e){return this.subruleInternal(t,4,e)}SUBRULE5(t,e){return this.subruleInternal(t,5,e)}SUBRULE6(t,e){return this.subruleInternal(t,6,e)}SUBRULE7(t,e){return this.subruleInternal(t,7,e)}SUBRULE8(t,e){return this.subruleInternal(t,8,e)}SUBRULE9(t,e){return this.subruleInternal(t,9,e)}OPTION(t){return this.optionInternal(t,0)}OPTION1(t){return this.optionInternal(t,1)}OPTION2(t){return this.optionInternal(t,2)}OPTION3(t){return this.optionInternal(t,3)}OPTION4(t){return this.optionInternal(t,4)}OPTION5(t){return this.optionInternal(t,5)}OPTION6(t){return this.optionInternal(t,6)}OPTION7(t){return this.optionInternal(t,7)}OPTION8(t){return this.optionInternal(t,8)}OPTION9(t){return this.optionInternal(t,9)}OR(t){return this.orInternal(t,0)}OR1(t){return this.orInternal(t,1)}OR2(t){return this.orInternal(t,2)}OR3(t){return this.orInternal(t,3)}OR4(t){return this.orInternal(t,4)}OR5(t){return this.orInternal(t,5)}OR6(t){return this.orInternal(t,6)}OR7(t){return this.orInternal(t,7)}OR8(t){return this.orInternal(t,8)}OR9(t){return this.orInternal(t,9)}MANY(t){this.manyInternal(0,t)}MANY1(t){this.manyInternal(1,t)}MANY2(t){this.manyInternal(2,t)}MANY3(t){this.manyInternal(3,t)}MANY4(t){this.manyInternal(4,t)}MANY5(t){this.manyInternal(5,t)}MANY6(t){this.manyInternal(6,t)}MANY7(t){this.manyInternal(7,t)}MANY8(t){this.manyInternal(8,t)}MANY9(t){this.manyInternal(9,t)}MANY_SEP(t){this.manySepFirstInternal(0,t)}MANY_SEP1(t){this.manySepFirstInternal(1,t)}MANY_SEP2(t){this.manySepFirstInternal(2,t)}MANY_SEP3(t){this.manySepFirstInternal(3,t)}MANY_SEP4(t){this.manySepFirstInternal(4,t)}MANY_SEP5(t){this.manySepFirstInternal(5,t)}MANY_SEP6(t){this.manySepFirstInternal(6,t)}MANY_SEP7(t){this.manySepFirstInternal(7,t)}MANY_SEP8(t){this.manySepFirstInternal(8,t)}MANY_SEP9(t){this.manySepFirstInternal(9,t)}AT_LEAST_ONE(t){this.atLeastOneInternal(0,t)}AT_LEAST_ONE1(t){return this.atLeastOneInternal(1,t)}AT_LEAST_ONE2(t){this.atLeastOneInternal(2,t)}AT_LEAST_ONE3(t){this.atLeastOneInternal(3,t)}AT_LEAST_ONE4(t){this.atLeastOneInternal(4,t)}AT_LEAST_ONE5(t){this.atLeastOneInternal(5,t)}AT_LEAST_ONE6(t){this.atLeastOneInternal(6,t)}AT_LEAST_ONE7(t){this.atLeastOneInternal(7,t)}AT_LEAST_ONE8(t){this.atLeastOneInternal(8,t)}AT_LEAST_ONE9(t){this.atLeastOneInternal(9,t)}AT_LEAST_ONE_SEP(t){this.atLeastOneSepFirstInternal(0,t)}AT_LEAST_ONE_SEP1(t){this.atLeastOneSepFirstInternal(1,t)}AT_LEAST_ONE_SEP2(t){this.atLeastOneSepFirstInternal(2,t)}AT_LEAST_ONE_SEP3(t){this.atLeastOneSepFirstInternal(3,t)}AT_LEAST_ONE_SEP4(t){this.atLeastOneSepFirstInternal(4,t)}AT_LEAST_ONE_SEP5(t){this.atLeastOneSepFirstInternal(5,t)}AT_LEAST_ONE_SEP6(t){this.atLeastOneSepFirstInternal(6,t)}AT_LEAST_ONE_SEP7(t){this.atLeastOneSepFirstInternal(7,t)}AT_LEAST_ONE_SEP8(t){this.atLeastOneSepFirstInternal(8,t)}AT_LEAST_ONE_SEP9(t){this.atLeastOneSepFirstInternal(9,t)}RULE(t,e,n=X4){if(GU(this.definedRulesNames,t)){const e={message:t2.buildDuplicateRuleNameError({topLevelRule:t,grammarName:this.className}),type:W4.DUPLICATE_RULE_NAME,ruleName:t};this.definitionErrors.push(e)}this.definedRulesNames.push(t);const r=this.defineRule(t,e,n);return this[t]=r,r}OVERRIDE_RULE(t,e,n=X4){const r=F2(t,this.definedRulesNames,this.className);this.definitionErrors=this.definitionErrors.concat(r);const i=this.defineRule(t,e,n);return this[t]=i,i}BACKTRACK(t,e){return function(){this.isBackTrackingStack.push(1);const n=this.saveRecogState();try{return t.apply(this,e),!0}catch(t){if(t4(t))return!1;throw t}finally{this.reloadRecogState(n),this.isBackTrackingStack.pop()}}}getGAstProductions(){return this.gastProductionsCache}getSerializedGastProductions(){return m0(EF(this.gastProductionsCache))}},N4=class{static{s(this,"RecognizerEngine")}initRecognizerEngine(t,e){if(this.className=this.constructor.name,this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=C1,this.subruleIdx=0,this.definedRulesNames=[],this.tokensMap={},this.isBackTrackingStack=[],this.RULE_STACK=[],this.RULE_OCCURRENCE_STACK=[],this.gastProductionsCache={},BU(e,"serializedGrammar"))throw Error("The Parser's configuration can no longer contain a <serializedGrammar> property.\n\tSee: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_6-0-0\n\tFor Further details.");if(hb(t)){if(bA(t))throw Error("A Token Vocabulary cannot be empty.\n\tNote that the first argument for the parser constructor\n\tis no longer a Token vector (since v4.0).");if("number"==typeof t[0].startOffset)throw Error("The Parser constructor no longer accepts a token vector as the first argument.\n\tSee: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_4-0-0\n\tFor Further details.")}if(hb(t))this.tokensMap=rz(t,((t,e)=>(t[e.name]=e,t)),{});else if(BU(t,"modes")&&mU(VF(EF(t.modes)),F1)){const e=VF(EF(t.modes)),n=WG(e);this.tokensMap=rz(n,((t,e)=>(t[e.name]=e,t)),{})}else{if(!jy(t))throw new Error("<tokensDictionary> argument must be An Array of Token constructors, A dictionary of Token constructors or an IMultiModeLexerDefinition");this.tokensMap=CB(t)}this.tokensMap.EOF=X1;const n=BU(t,"modes")?VF(EF(t.modes)):EF(t),r=mU(n,(t=>bA(t.categoryMatches)));this.tokenMatcher=r?C1:E1,L1(EF(this.tokensMap))}defineRule(t,e,n){if(this.selfAnalysisDone)throw Error(`Grammar rule <${t}> may not be defined after the 'performSelfAnalysis' method has been called'\nMake sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.`);const r=BU(n,"resyncEnabled")?n.resyncEnabled:X4.resyncEnabled,i=BU(n,"recoveryValueFunc")?n.recoveryValueFunc:X4.recoveryValueFunc,a=this.ruleShortNameIdx<<12;let o;this.ruleShortNameIdx++,this.shortRuleNameToFull[a]=t,this.fullRuleNameToShort[t]=a,o=!0===this.outputCst?s((function(...n){try{this.ruleInvocationStateUpdate(a,t,this.subruleIdx),e.apply(this,n);const r=this.CST_STACK[this.CST_STACK.length-1];return this.cstPostRule(r),r}catch(t){return this.invokeRuleCatch(t,r,i)}finally{this.ruleFinallyStateUpdate()}}),"invokeRuleWithTry"):s((function(...n){try{return this.ruleInvocationStateUpdate(a,t,this.subruleIdx),e.apply(this,n)}catch(t){return this.invokeRuleCatch(t,r,i)}finally{this.ruleFinallyStateUpdate()}}),"invokeRuleWithTryCst");return Object.assign(o,{ruleName:t,originalGrammarAction:e})}invokeRuleCatch(t,e,n){const r=1===this.RULE_STACK.length,i=e&&!this.isBackTracking()&&this.recoveryEnabled;if(t4(t)){const e=t;if(i){const r=this.findReSyncTokenType();if(this.isInCurrentRuleReSyncSet(r)){if(e.resyncedTokens=this.reSyncTo(r),this.outputCst){const t=this.CST_STACK[this.CST_STACK.length-1];return t.recoveredNode=!0,t}return n(t)}if(this.outputCst){const t=this.CST_STACK[this.CST_STACK.length-1];t.recoveredNode=!0,e.partialCstResult=t}throw e}if(r)return this.moveToTerminatedState(),n(t);throw e}throw t}optionInternal(t,e){const n=this.getKeyForAutomaticLookahead(512,e);return this.optionInternalLogic(t,e,n)}optionInternalLogic(t,e,n){let r,i=this.getLaFuncFromCache(n);if("function"!=typeof t){r=t.DEF;const e=t.GATE;if(void 0!==e){const t=i;i=s((()=>e.call(this)&&t.call(this)),"lookAheadFunc")}}else r=t;if(!0===i.call(this))return r.call(this)}atLeastOneInternal(t,e){const n=this.getKeyForAutomaticLookahead(1024,t);return this.atLeastOneInternalLogic(t,e,n)}atLeastOneInternalLogic(t,e,n){let r,i=this.getLaFuncFromCache(n);if("function"!=typeof e){r=e.DEF;const t=e.GATE;if(void 0!==t){const e=i;i=s((()=>t.call(this)&&e.call(this)),"lookAheadFunc")}}else r=e;if(!0!==i.call(this))throw this.raiseEarlyExitException(t,n2.REPETITION_MANDATORY,e.ERR_MSG);{let t=this.doSingleRepetition(r);for(;!0===i.call(this)&&!0===t;)t=this.doSingleRepetition(r)}this.attemptInRepetitionRecovery(this.atLeastOneInternal,[t,e],i,1024,t,h2)}atLeastOneSepFirstInternal(t,e){const n=this.getKeyForAutomaticLookahead(1536,t);this.atLeastOneSepFirstInternalLogic(t,e,n)}atLeastOneSepFirstInternalLogic(t,e,n){const r=e.DEF,i=e.SEP;if(!0!==this.getLaFuncFromCache(n).call(this))throw this.raiseEarlyExitException(t,n2.REPETITION_MANDATORY_WITH_SEPARATOR,e.ERR_MSG);{r.call(this);const e=s((()=>this.tokenMatcher(this.LA(1),i)),"separatorLookAheadFunc");for(;!0===this.tokenMatcher(this.LA(1),i);)this.CONSUME(i),r.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[t,i,e,r,u2],e,1536,t,u2)}}manyInternal(t,e){const n=this.getKeyForAutomaticLookahead(768,t);return this.manyInternalLogic(t,e,n)}manyInternalLogic(t,e,n){let r,i=this.getLaFuncFromCache(n);if("function"!=typeof e){r=e.DEF;const t=e.GATE;if(void 0!==t){const e=i;i=s((()=>t.call(this)&&e.call(this)),"lookaheadFunction")}}else r=e;let a=!0;for(;!0===i.call(this)&&!0===a;)a=this.doSingleRepetition(r);this.attemptInRepetitionRecovery(this.manyInternal,[t,e],i,768,t,l2,a)}manySepFirstInternal(t,e){const n=this.getKeyForAutomaticLookahead(1280,t);this.manySepFirstInternalLogic(t,e,n)}manySepFirstInternalLogic(t,e,n){const r=e.DEF,i=e.SEP;if(!0===this.getLaFuncFromCache(n).call(this)){r.call(this);const e=s((()=>this.tokenMatcher(this.LA(1),i)),"separatorLookAheadFunc");for(;!0===this.tokenMatcher(this.LA(1),i);)this.CONSUME(i),r.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[t,i,e,r,c2],e,1280,t,c2)}}repetitionSepSecondInternal(t,e,n,r,i){for(;n();)this.CONSUME(e),r.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[t,e,n,r,i],n,1536,t,i)}doSingleRepetition(t){const e=this.getLexerPosition();t.call(this);return this.getLexerPosition()>e}orInternal(t,e){const n=this.getKeyForAutomaticLookahead(256,e),r=hb(t)?t:t.DEF,i=this.getLaFuncFromCache(n).call(this,r);if(void 0!==i){return r[i].ALT.call(this)}this.raiseNoAltException(e,t.ERR_MSG)}ruleFinallyStateUpdate(){if(this.RULE_STACK.pop(),this.RULE_OCCURRENCE_STACK.pop(),this.cstFinallyStateUpdate(),0===this.RULE_STACK.length&&!1===this.isAtEndOfInput()){const t=this.LA(1),e=this.errorMessageProvider.buildNotAllInputParsedMessage({firstRedundant:t,ruleName:this.getCurrRuleFullName()});this.SAVE_ERROR(new i4(e,t))}}subruleInternal(t,e,n){let r;try{const i=void 0!==n?n.ARGS:void 0;return this.subruleIdx=e,r=t.apply(this,i),this.cstPostNonTerminal(r,void 0!==n&&void 0!==n.LABEL?n.LABEL:t.ruleName),r}catch(e){throw this.subruleInternalError(e,n,t.ruleName)}}subruleInternalError(t,e,n){throw t4(t)&&void 0!==t.partialCstResult&&(this.cstPostNonTerminal(t.partialCstResult,void 0!==e&&void 0!==e.LABEL?e.LABEL:n),delete t.partialCstResult),t}consumeInternal(t,e,n){let r;try{const e=this.LA(1);!0===this.tokenMatcher(e,t)?(this.consumeToken(),r=e):this.consumeInternalError(t,e,n)}catch(n){r=this.consumeInternalRecovery(t,e,n)}return this.cstPostTerminal(void 0!==n&&void 0!==n.LABEL?n.LABEL:t.name,r),r}consumeInternalError(t,e,n){let r;const i=this.LA(0);throw r=void 0!==n&&n.ERR_MSG?n.ERR_MSG:this.errorMessageProvider.buildMismatchTokenMessage({expected:t,actual:e,previous:i,ruleName:this.getCurrRuleFullName()}),this.SAVE_ERROR(new n4(r,e,i))}consumeInternalRecovery(t,e,n){if(!this.recoveryEnabled||"MismatchedTokenException"!==n.name||this.isBackTracking())throw n;{const r=this.getFollowsForInRuleRecovery(t,e);try{return this.tryInRuleRecovery(t,r)}catch(t){throw"InRuleRecoveryException"===t.name?n:t}}}saveRecogState(){const t=this.errors,e=CB(this.RULE_STACK);return{errors:t,lexerState:this.exportLexerState(),RULE_STACK:e,CST_STACK:this.CST_STACK}}reloadRecogState(t){this.errors=t.errors,this.importLexerState(t.lexerState),this.RULE_STACK=t.RULE_STACK}ruleInvocationStateUpdate(t,e,n){this.RULE_OCCURRENCE_STACK.push(n),this.RULE_STACK.push(t),this.cstInvocationStateUpdate(e)}isBackTracking(){return 0!==this.isBackTrackingStack.length}getCurrRuleFullName(){const t=this.getLastExplicitRuleShortName();return this.shortRuleNameToFull[t]}shortRuleNameToFullName(t){return this.shortRuleNameToFull[t]}isAtEndOfInput(){return this.tokenMatcher(this.LA(1),X1)}reset(){this.resetLexerState(),this.subruleIdx=0,this.isBackTrackingStack=[],this.errors=[],this.RULE_STACK=[],this.CST_STACK=[],this.RULE_OCCURRENCE_STACK=[]}},I4=class{static{s(this,"ErrorHandler")}initErrorHandler(t){this._errors=[],this.errorMessageProvider=BU(t,"errorMessageProvider")?t.errorMessageProvider:V4.errorMessageProvider}SAVE_ERROR(t){if(t4(t))return t.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:CB(this.RULE_OCCURRENCE_STACK)},this._errors.push(t),t;throw Error("Trying to save an Error which is not a RecognitionException")}get errors(){return CB(this._errors)}set errors(t){this._errors=t}raiseEarlyExitException(t,e,n){const r=this.getCurrRuleFullName(),i=A2(t,this.getGAstProductions()[r],e,this.maxLookahead)[0],a=[];for(let t=1;t<=this.maxLookahead;t++)a.push(this.LA(t));const s=this.errorMessageProvider.buildEarlyExitMessage({expectedIterationPaths:i,actual:a,previous:this.LA(0),customUserDescription:n,ruleName:r});throw this.SAVE_ERROR(new a4(s,this.LA(1),this.LA(0)))}raiseNoAltException(t,e){const n=this.getCurrRuleFullName(),r=S2(t,this.getGAstProductions()[n],this.maxLookahead),i=[];for(let t=1;t<=this.maxLookahead;t++)i.push(this.LA(t));const a=this.LA(0),s=this.errorMessageProvider.buildNoViableAltMessage({expectedPathsPerAlt:r,actual:i,previous:a,customUserDescription:e,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new r4(s,this.LA(1),a))}},M4=class{static{s(this,"ContentAssist")}initContentAssist(){}computeContentAssist(t,e){const n=this.gastProductionsCache[t];if(SF(n))throw Error(`Rule ->${t}<- does not exist in this grammar.`);return p2([n],e,this.tokenMatcher,this.maxLookahead)}getNextPossibleTokenTypes(t){const e=TU(t.ruleStack),n=this.getGAstProductions()[e];return new s2(n,t).startWalking()}},R4={description:"This Object indicates the Parser is during Recording Phase"};Object.freeze(R4);var D4=Math.pow(2,8)-1,O4=H1({name:"RECORDING_PHASE_TOKEN",pattern:j1.NA});L1([O4]);var P4=K1(O4,"This IToken indicates the Parser is in Recording Phase\n\tSee: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details",-1,-1,-1,-1,-1,-1);Object.freeze(P4);var B4={name:"This CSTNode indicates the Parser is in Recording Phase\n\tSee: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details",children:{}},$4=class{static{s(this,"GastRecorder")}initGastRecorder(t){this.recordingProdStack=[],this.RECORDING_PHASE=!1}enableRecording(){this.RECORDING_PHASE=!0,this.TRACE_INIT("Enable Recording",(()=>{for(let t=0;t<10;t++){const e=t>0?t:"";this[`CONSUME${e}`]=function(e,n){return this.consumeInternalRecord(e,t,n)},this[`SUBRULE${e}`]=function(e,n){return this.subruleInternalRecord(e,t,n)},this[`OPTION${e}`]=function(e){return this.optionInternalRecord(e,t)},this[`OR${e}`]=function(e){return this.orInternalRecord(e,t)},this[`MANY${e}`]=function(e){this.manyInternalRecord(t,e)},this[`MANY_SEP${e}`]=function(e){this.manySepFirstInternalRecord(t,e)},this[`AT_LEAST_ONE${e}`]=function(e){this.atLeastOneInternalRecord(t,e)},this[`AT_LEAST_ONE_SEP${e}`]=function(e){this.atLeastOneSepFirstInternalRecord(t,e)}}this.consume=function(t,e,n){return this.consumeInternalRecord(e,t,n)},this.subrule=function(t,e,n){return this.subruleInternalRecord(e,t,n)},this.option=function(t,e){return this.optionInternalRecord(e,t)},this.or=function(t,e){return this.orInternalRecord(e,t)},this.many=function(t,e){this.manyInternalRecord(t,e)},this.atLeastOne=function(t,e){this.atLeastOneInternalRecord(t,e)},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 t=this;for(let e=0;e<10;e++){const n=e>0?e:"";delete t[`CONSUME${n}`],delete t[`SUBRULE${n}`],delete t[`OPTION${n}`],delete t[`OR${n}`],delete t[`MANY${n}`],delete t[`MANY_SEP${n}`],delete t[`AT_LEAST_ONE${n}`],delete t[`AT_LEAST_ONE_SEP${n}`]}delete t.consume,delete t.subrule,delete t.option,delete t.or,delete t.many,delete t.atLeastOne,delete t.ACTION,delete t.BACKTRACK,delete t.LA}))}ACTION_RECORD(t){}BACKTRACK_RECORD(t,e){return()=>!0}LA_RECORD(t){return Y4}topLevelRuleRecord(t,e){try{const n=new o0({definition:[],name:t});return n.name=t,this.recordingProdStack.push(n),e.call(this),this.recordingProdStack.pop(),n}catch(t){if(!0!==t.KNOWN_RECORDER_ERROR)try{t.message=t.message+'\n\t This error was thrown during the "grammar recording phase" For more info see:\n\thttps://chevrotain.io/docs/guide/internals.html#grammar-recording'}catch(e){throw t}throw t}}optionInternalRecord(t,e){return F4.call(this,c0,t,e)}atLeastOneInternalRecord(t,e){F4.call(this,h0,e,t)}atLeastOneSepFirstInternalRecord(t,e){F4.call(this,u0,e,t,true)}manyInternalRecord(t,e){F4.call(this,d0,e,t)}manySepFirstInternalRecord(t,e){F4.call(this,p0,e,t,true)}orInternalRecord(t,e){return z4.call(this,t,e)}subruleInternalRecord(t,e,n){if(G4(e),!t||!1===BU(t,"ruleName")){const n=new Error(`<SUBRULE${U4(e)}> argument is invalid expecting a Parser method reference but got: <${JSON.stringify(t)}>\n inside top level rule: <${this.recordingProdStack[0].name}>`);throw n.KNOWN_RECORDER_ERROR=!0,n}const r=MB(this.recordingProdStack),i=t.ruleName,a=new s0({idx:e,nonTerminalName:i,label:null==n?void 0:n.LABEL,referencedRule:void 0});return r.definition.push(a),this.outputCst?B4:R4}consumeInternalRecord(t,e,n){if(G4(e),!O1(t)){const n=new Error(`<CONSUME${U4(e)}> argument is invalid expecting a TokenType reference but got: <${JSON.stringify(t)}>\n inside top level rule: <${this.recordingProdStack[0].name}>`);throw n.KNOWN_RECORDER_ERROR=!0,n}const r=MB(this.recordingProdStack),i=new f0({idx:e,terminalType:t,label:null==n?void 0:n.LABEL});return r.definition.push(i),P4}};function F4(t,e,n,r=!1){G4(n);const i=MB(this.recordingProdStack),a=Hy(e)?e:e.DEF,s=new t({definition:[],idx:n});return r&&(s.separator=e.SEP),BU(e,"MAX_LOOKAHEAD")&&(s.maxLookahead=e.MAX_LOOKAHEAD),this.recordingProdStack.push(s),a.call(this),i.definition.push(s),this.recordingProdStack.pop(),R4}function z4(t,e){G4(e);const n=MB(this.recordingProdStack),r=!1===hb(t),i=!1===r?t:t.DEF,a=new g0({definition:[],idx:e,ignoreAmbiguities:r&&!0===t.IGNORE_AMBIGUITIES});BU(t,"MAX_LOOKAHEAD")&&(a.maxLookahead=t.MAX_LOOKAHEAD);const s=GG(i,(t=>Hy(t.GATE)));return a.hasPredicates=s,n.definition.push(a),zB(i,(t=>{const e=new l0({definition:[]});a.definition.push(e),BU(t,"IGNORE_AMBIGUITIES")?e.ignoreAmbiguities=t.IGNORE_AMBIGUITIES:BU(t,"GATE")&&(e.ignoreAmbiguities=!0),this.recordingProdStack.push(e),t.ALT.call(this),this.recordingProdStack.pop()})),R4}function U4(t){return 0===t?"":`${t}`}function G4(t){if(t<0||t>D4){const e=new Error(`Invalid DSL Method idx value: <${t}>\n\tIdx value must be a none negative value smaller than ${D4+1}`);throw e.KNOWN_RECORDER_ERROR=!0,e}}s(F4,"recordProd"),s(z4,"recordOrProd"),s(U4,"getIdxSuffix"),s(G4,"assertMethodIdxIsValid");var q4=class{static{s(this,"PerformanceTracer")}initPerformanceTracer(t){if(BU(t,"traceInitPerf")){const e=t.traceInitPerf,n="number"==typeof e;this.traceInitMaxIdent=n?e:1/0,this.traceInitPerf=n?e>0:e}else this.traceInitMaxIdent=0,this.traceInitPerf=V4.traceInitPerf;this.traceInitIndent=-1}TRACE_INIT(t,e){if(!0===this.traceInitPerf){this.traceInitIndent++;const n=new Array(this.traceInitIndent+1).join("\t");this.traceInitIndent<this.traceInitMaxIdent&&console.log(`${n}--\x3e <${t}>`);const{time:r,value:i}=e0(e),a=r>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&a(`${n}<-- <${t}> time: ${r}ms`),this.traceInitIndent--,i}return e()}};function j4(t,e){e.forEach((e=>{const n=e.prototype;Object.getOwnPropertyNames(n).forEach((r=>{if("constructor"===r)return;const i=Object.getOwnPropertyDescriptor(n,r);i&&(i.get||i.set)?Object.defineProperty(t.prototype,r,i):t.prototype[r]=e.prototype[r]}))}))}s(j4,"applyMixins");var Y4=K1(X1,"",NaN,NaN,NaN,NaN,NaN,NaN);Object.freeze(Y4);var W4,H4,V4=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:Q1,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!1}),X4=Object.freeze({recoveryValueFunc:s((()=>{}),"recoveryValueFunc"),resyncEnabled:!0});function K4(t){return function(){return t}}(H4=W4||(W4={}))[H4.INVALID_RULE_NAME=0]="INVALID_RULE_NAME",H4[H4.DUPLICATE_RULE_NAME=1]="DUPLICATE_RULE_NAME",H4[H4.INVALID_RULE_OVERRIDE=2]="INVALID_RULE_OVERRIDE",H4[H4.DUPLICATE_PRODUCTIONS=3]="DUPLICATE_PRODUCTIONS",H4[H4.UNRESOLVED_SUBRULE_REF=4]="UNRESOLVED_SUBRULE_REF",H4[H4.LEFT_RECURSION=5]="LEFT_RECURSION",H4[H4.NONE_LAST_EMPTY_ALT=6]="NONE_LAST_EMPTY_ALT",H4[H4.AMBIGUOUS_ALTS=7]="AMBIGUOUS_ALTS",H4[H4.CONFLICT_TOKENS_RULES_NAMESPACE=8]="CONFLICT_TOKENS_RULES_NAMESPACE",H4[H4.INVALID_TOKEN_NAME=9]="INVALID_TOKEN_NAME",H4[H4.NO_NON_EMPTY_LOOKAHEAD=10]="NO_NON_EMPTY_LOOKAHEAD",H4[H4.AMBIGUOUS_PREFIX_ALTS=11]="AMBIGUOUS_PREFIX_ALTS",H4[H4.TOO_MANY_ALTS=12]="TOO_MANY_ALTS",H4[H4.CUSTOM_LOOKAHEAD_VALIDATION=13]="CUSTOM_LOOKAHEAD_VALIDATION",s(K4,"EMPTY_ALT");var Z4=class t{static{s(this,"Parser")}static performSelfAnalysis(t){throw Error("The **static** `performSelfAnalysis` method has been deprecated.\t\nUse the **instance** method with the same name instead.")}performSelfAnalysis(){this.TRACE_INIT("performSelfAnalysis",(()=>{let e;this.selfAnalysisDone=!0;const n=this.className;this.TRACE_INIT("toFastProps",(()=>{n0(this)})),this.TRACE_INIT("Grammar Recording",(()=>{try{this.enableRecording(),zB(this.definedRulesNames,(t=>{const e=this[t].originalGrammarAction;let n;this.TRACE_INIT(`${t} Rule`,(()=>{n=this.topLevelRuleRecord(t,e)})),this.gastProductionsCache[t]=n}))}finally{this.disableRecording()}}));let r=[];if(this.TRACE_INIT("Grammar Resolving",(()=>{r=Z2({rules:EF(this.gastProductionsCache)}),this.definitionErrors=this.definitionErrors.concat(r)})),this.TRACE_INIT("Grammar Validations",(()=>{if(bA(r)&&!1===this.skipValidations){const t=Q2({rules:EF(this.gastProductionsCache),tokenTypes:EF(this.tokensMap),errMsgProvider:t2,grammarName:n}),e=M2({lookaheadStrategy:this.lookaheadStrategy,rules:EF(this.gastProductionsCache),tokenTypes:EF(this.tokensMap),grammarName:n});this.definitionErrors=this.definitionErrors.concat(t,e)}})),bA(this.definitionErrors)&&(this.recoveryEnabled&&this.TRACE_INIT("computeAllProdsFollows",(()=>{const t=N0(EF(this.gastProductionsCache));this.resyncFollows=t})),this.TRACE_INIT("ComputeLookaheadFunctions",(()=>{var t,e;null===(e=(t=this.lookaheadStrategy).initialize)||void 0===e||e.call(t,{rules:EF(this.gastProductionsCache)}),this.preComputeLookaheadFunctions(EF(this.gastProductionsCache))}))),!t.DEFER_DEFINITION_ERRORS_HANDLING&&!bA(this.definitionErrors))throw e=wF(this.definitionErrors,(t=>t.message)),new Error(`Parser Definition Errors detected:\n ${e.join("\n-------------------------------\n")}`)}))}constructor(t,e){this.definitionErrors=[],this.selfAnalysisDone=!1;const n=this;if(n.initErrorHandler(e),n.initLexerAdapter(),n.initLooksAhead(e),n.initRecognizerEngine(t,e),n.initRecoverable(e),n.initTreeBuilder(e),n.initContentAssist(),n.initGastRecorder(e),n.initPerformanceTracer(e),BU(e,"ignoredIssues"))throw new Error("The <ignoredIssues> IParserConfig property has been deprecated.\n\tPlease use the <IGNORE_AMBIGUITIES> flag on the relevant DSL method instead.\n\tSee: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#IGNORING_AMBIGUITIES\n\tFor further details.");this.skipValidations=BU(e,"skipValidations")?e.skipValidations:V4.skipValidations}};Z4.DEFER_DEFINITION_ERRORS_HANDLING=!1,j4(Z4,[l4,d4,S4,A4,N4,L4,I4,M4,$4,q4]);var Q4=class extends Z4{static{s(this,"EmbeddedActionsParser")}constructor(t,e=V4){const n=CB(e);n.outputCst=!1,super(t,n)}};function J4(t,e,n){return`${t.name}_${e}_${n}`}s(J4,"buildATNKey");var t3=class{static{s(this,"AbstractTransition")}constructor(t){this.target=t}isEpsilon(){return!1}},e3=class extends t3{static{s(this,"AtomTransition")}constructor(t,e){super(t),this.tokenType=e}},n3=class extends t3{static{s(this,"EpsilonTransition")}constructor(t){super(t)}isEpsilon(){return!0}},r3=class extends t3{static{s(this,"RuleTransition")}constructor(t,e,n){super(t),this.rule=e,this.followState=n}isEpsilon(){return!0}};function i3(t){const e={decisionMap:{},decisionStates:[],ruleToStartState:new Map,ruleToStopState:new Map,states:[]};a3(e,t);const n=t.length;for(let r=0;r<n;r++){const n=t[r],i=p3(e,n,n);void 0!==i&&T3(e,n,i)}return e}function a3(t,e){const n=e.length;for(let r=0;r<n;r++){const n=e[r],i=E3(t,n,void 0,{type:2}),a=E3(t,n,void 0,{type:7});i.stop=a,t.ruleToStartState.set(n,i),t.ruleToStopState.set(n,a)}}function s3(t,e,n){return n instanceof f0?w3(t,e,n.terminalType,n):n instanceof s0?k3(t,e,n):n instanceof g0?u3(t,e,n):n instanceof c0?d3(t,e,n):n instanceof d0?o3(t,e,n):n instanceof p0?l3(t,e,n):n instanceof h0?c3(t,e,n):n instanceof u0?h3(t,e,n):p3(t,e,n)}function o3(t,e,n){const r=E3(t,e,n,{type:5});y3(t,r);return f3(t,e,n,v3(t,e,r,n,p3(t,e,n)))}function l3(t,e,n){const r=E3(t,e,n,{type:5});y3(t,r);return f3(t,e,n,v3(t,e,r,n,p3(t,e,n)),w3(t,e,n.separator,n))}function c3(t,e,n){const r=E3(t,e,n,{type:4});y3(t,r);return g3(t,e,n,v3(t,e,r,n,p3(t,e,n)))}function h3(t,e,n){const r=E3(t,e,n,{type:4});y3(t,r);return g3(t,e,n,v3(t,e,r,n,p3(t,e,n)),w3(t,e,n.separator,n))}function u3(t,e,n){const r=E3(t,e,n,{type:1});y3(t,r);const i=wF(n.definition,(n=>s3(t,e,n)));return v3(t,e,r,n,...i)}function d3(t,e,n){const r=E3(t,e,n,{type:1});y3(t,r);return m3(t,e,n,v3(t,e,r,n,p3(t,e,n)))}function p3(t,e,n){const r=yF(wF(n.definition,(n=>s3(t,e,n))),(t=>void 0!==t));return 1===r.length?r[0]:0===r.length?void 0:b3(t,r)}function g3(t,e,n,r,i){const a=r.left,s=r.right,o=E3(t,e,n,{type:11});y3(t,o);const l=E3(t,e,n,{type:12});return a.loopback=o,l.loopback=o,t.decisionMap[J4(e,i?"RepetitionMandatoryWithSeparator":"RepetitionMandatory",n.idx)]=o,_3(s,o),void 0===i?(_3(o,a),_3(o,l)):(_3(o,l),_3(o,i.left),_3(i.right,a)),{left:a,right:l}}function f3(t,e,n,r,i){const a=r.left,s=r.right,o=E3(t,e,n,{type:10});y3(t,o);const l=E3(t,e,n,{type:12}),c=E3(t,e,n,{type:9});return o.loopback=c,l.loopback=c,_3(o,a),_3(o,l),_3(s,c),void 0!==i?(_3(c,l),_3(c,i.left),_3(i.right,a)):_3(c,o),t.decisionMap[J4(e,i?"RepetitionWithSeparator":"Repetition",n.idx)]=o,{left:o,right:l}}function m3(t,e,n,r){const i=r.left;return _3(i,r.right),t.decisionMap[J4(e,"Option",n.idx)]=i,r}function y3(t,e){return t.decisionStates.push(e),e.decision=t.decisionStates.length-1,e.decision}function v3(t,e,n,r,...i){const a=E3(t,e,r,{type:8,start:n});n.end=a;for(const t of i)void 0!==t?(_3(n,t.left),_3(t.right,a)):_3(n,a);const s={left:n,right:a};return t.decisionMap[J4(e,x3(r),r.idx)]=n,s}function x3(t){if(t instanceof g0)return"Alternation";if(t instanceof c0)return"Option";if(t instanceof d0)return"Repetition";if(t instanceof p0)return"RepetitionWithSeparator";if(t instanceof h0)return"RepetitionMandatory";if(t instanceof u0)return"RepetitionMandatoryWithSeparator";throw new Error("Invalid production type encountered")}function b3(t,e){const n=e.length;for(let r=0;r<n-1;r++){const n=e[r];let i;1===n.left.transitions.length&&(i=n.left.transitions[0]);const a=i instanceof r3,s=i,o=e[r+1].left;1===n.left.type&&1===n.right.type&&void 0!==i&&(a&&s.followState===n.right||i.target===n.right)?(a?s.followState=o:i.target=o,S3(t,n.right)):_3(n.right,o)}const r=e[0],i=e[n-1];return{left:r.left,right:i.right}}function w3(t,e,n,r){const i=E3(t,e,r,{type:1}),a=E3(t,e,r,{type:1});return C3(i,new e3(a,n)),{left:i,right:a}}function k3(t,e,n){const r=n.referencedRule,i=t.ruleToStartState.get(r),a=E3(t,e,n,{type:1}),s=E3(t,e,n,{type:1});return C3(a,new r3(i,r,s)),{left:a,right:s}}function T3(t,e,n){const r=t.ruleToStartState.get(e);_3(r,n.left);const i=t.ruleToStopState.get(e);_3(n.right,i);return{left:r,right:i}}function _3(t,e){C3(t,new n3(e))}function E3(t,e,n,r){const i=Object.assign({atn:t,production:n,epsilonOnlyTransitions:!1,rule:e,transitions:[],nextTokenWithinRule:[],stateNumber:t.states.length},r);return t.states.push(i),i}function C3(t,e){0===t.transitions.length&&(t.epsilonOnlyTransitions=e.isEpsilon()),t.transitions.push(e)}function S3(t,e){t.states.splice(t.states.indexOf(e),1)}s(i3,"createATN"),s(a3,"createRuleStartAndStopATNStates"),s(s3,"atom"),s(o3,"repetition"),s(l3,"repetitionSep"),s(c3,"repetitionMandatory"),s(h3,"repetitionMandatorySep"),s(u3,"alternation"),s(d3,"option"),s(p3,"block"),s(g3,"plus"),s(f3,"star"),s(m3,"optional"),s(y3,"defineDecisionState"),s(v3,"makeAlts"),s(x3,"getProdType"),s(b3,"makeBlock"),s(w3,"tokenRef"),s(k3,"ruleRef"),s(T3,"buildRuleHandle"),s(_3,"epsilon"),s(E3,"newState"),s(C3,"addTransition"),s(S3,"removeState");var A3={},L3=class{static{s(this,"ATNConfigSet")}constructor(){this.map={},this.configs=[]}get size(){return this.configs.length}finalize(){this.map={}}add(t){const e=N3(t);e in this.map||(this.map[e]=this.configs.length,this.configs.push(t))}get elements(){return this.configs}get alts(){return wF(this.configs,(t=>t.alt))}get key(){let t="";for(const e in this.map)t+=e+":";return t}};function N3(t,e=!0){return`${e?`a${t.alt}`:""}s${t.state.stateNumber}:${t.stack.map((t=>t.stateNumber.toString())).join("_")}`}function I3(t,e){const n={};return r=>{const i=r.toString();let a=n[i];return void 0!==a||(a={atnStartState:t,decision:e,states:{}},n[i]=a),a}}s(N3,"getATNConfigKey"),s(I3,"createDFACache");var M3,R3,D3,O3,P3,B3,$3,F3,z3,U3,G3,q3,j3,Y3,W3,H3,V3,X3,K3,Z3,Q3,J3,t5,e5,n5,r5,i5,a5,s5,o5,l5,c5,h5,u5,d5,p5,g5,f5,m5,y5,v5,x5,b5,w5,k5,T5,_5,E5,C5,S5,A5,L5,N5,I5,M5,R5,D5,O5,P5,B5,$5,F5,z5,U5,G5,q5,j5,Y5,W5,H5,V5,X5,K5,Z5,Q5,J5,t6,e6,n6,r6,i6,a6,s6,o6,l6,c6,h6,u6,d6,p6,g6,f6,m6=class{static{s(this,"PredicateSet")}constructor(){this.predicates=[]}is(t){return t>=this.predicates.length||this.predicates[t]}set(t,e){this.predicates[t]=e}toString(){let t="";const e=this.predicates.length;for(let n=0;n<e;n++)t+=!0===this.predicates[n]?"1":"0";return t}},y6=new m6,v6=class extends u4{static{s(this,"LLStarLookaheadStrategy")}constructor(t){var e;super(),this.logging=null!==(e=null==t?void 0:t.logging)&&void 0!==e?e:t=>console.log(t)}initialize(t){this.atn=i3(t.rules),this.dfas=b6(this.atn)}validateAmbiguousAlternationAlternatives(){return[]}validateEmptyOrAlternatives(){return[]}buildLookaheadForAlternation(t){const{prodOccurrence:e,rule:n,hasPredicates:r,dynamicTokensEnabled:i}=t,a=this.dfas,s=this.logging,o=J4(n,"Alternation",e),l=this.atn.decisionMap[o].decision,c=wF(m2({maxLookahead:1,occurrence:e,prodType:"Alternation",rule:n}),(t=>wF(t,(t=>t[0]))));if(x6(c,!1)&&!i){const t=rz(c,((t,e,n)=>(zB(e,(e=>{e&&(t[e.tokenTypeIdx]=n,zB(e.categoryMatches,(e=>{t[e]=n})))})),t)),{});return r?function(e){var n;const r=this.LA(1),i=t[r.tokenTypeIdx];if(void 0!==e&&void 0!==i){const t=null===(n=e[i])||void 0===n?void 0:n.GATE;if(void 0!==t&&!1===t.call(this))return}return i}:function(){const e=this.LA(1);return t[e.tokenTypeIdx]}}return r?function(t){const e=new m6,n=void 0===t?0:t.length;for(let r=0;r<n;r++){const n=null==t?void 0:t[r].GATE;e.set(r,void 0===n||n.call(this))}const r=w6.call(this,a,l,e,s);return"number"==typeof r?r:void 0}:function(){const t=w6.call(this,a,l,y6,s);return"number"==typeof t?t:void 0}}buildLookaheadForOptional(t){const{prodOccurrence:e,rule:n,prodType:r,dynamicTokensEnabled:i}=t,a=this.dfas,s=this.logging,o=J4(n,r,e),l=this.atn.decisionMap[o].decision,c=wF(m2({maxLookahead:1,occurrence:e,prodType:r,rule:n}),(t=>wF(t,(t=>t[0]))));if(x6(c)&&c[0][0]&&!i){const t=c[0],e=VF(t);if(1===e.length&&bA(e[0].categoryMatches)){const t=e[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===t}}{const t=rz(e,((t,e)=>(void 0!==e&&(t[e.tokenTypeIdx]=!0,zB(e.categoryMatches,(e=>{t[e]=!0}))),t)),{});return function(){const e=this.LA(1);return!0===t[e.tokenTypeIdx]}}}return function(){const t=w6.call(this,a,l,y6,s);return"object"!=typeof t&&0===t}}};function x6(t,e=!0){const n=new Set;for(const r of t){const t=new Set;for(const i of r){if(void 0===i){if(e)break;return!1}const r=[i.tokenTypeIdx].concat(i.categoryMatches);for(const e of r)if(n.has(e)){if(!t.has(e))return!1}else n.add(e),t.add(e)}}return!0}function b6(t){const e=t.decisionStates.length,n=Array(e);for(let r=0;r<e;r++)n[r]=I3(t.decisionStates[r],r);return n}function w6(t,e,n,r){const i=t[e](n);let a=i.start;if(void 0===a){a=D6(i,M6(O6(i.atnStartState))),i.start=a}return k6.apply(this,[i,a,n,r])}function k6(t,e,n,r){let i=e,a=1;const s=[];let o=this.LA(a++);for(;;){let e=A6(i,o);if(void 0===e&&(e=T6.apply(this,[t,i,o,a,n,r])),e===A3)return S6(s,i,o);if(!0===e.isAcceptState)return e.prediction;i=e,s.push(o),o=this.LA(a++)}}function T6(t,e,n,r,i,a){const s=L6(e.configs,n,i);if(0===s.size)return R6(t,e,n,A3),A3;let o=M6(s);const l=I6(s,i);if(void 0!==l)o.isAcceptState=!0,o.prediction=l,o.configs.uniqueAlt=l;else if(z6(s)){const e=JU(s.alts);o.isAcceptState=!0,o.prediction=e,o.configs.uniqueAlt=e,_6.apply(this,[t,r,s.alts,a])}return o=R6(t,e,n,o),o}function _6(t,e,n,r){const i=[];for(let t=1;t<=e;t++)i.push(this.LA(t).tokenType);const a=t.atnStartState;r(E6({topLevelRule:a.rule,ambiguityIndices:n,production:a.production,prefixPath:i}))}function E6(t){const e=wF(t.prefixPath,(t=>Y1(t))).join(", "),n=0===t.production.idx?"":t.production.idx;let r=`Ambiguous Alternatives Detected: <${t.ambiguityIndices.join(", ")}> in <${C6(t.production)}${n}> inside <${t.topLevelRule.name}> Rule,\n<${e}> may appears as a prefix path in all these alternatives.\n`;return r+="See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES\nFor Further details.",r}function C6(t){if(t instanceof s0)return"SUBRULE";if(t instanceof c0)return"OPTION";if(t instanceof g0)return"OR";if(t instanceof h0)return"AT_LEAST_ONE";if(t instanceof u0)return"AT_LEAST_ONE_SEP";if(t instanceof p0)return"MANY_SEP";if(t instanceof d0)return"MANY";if(t instanceof f0)return"CONSUME";throw Error("non exhaustive match")}function S6(t,e,n){const r=EU(e.configs.elements,(t=>t.state.transitions)),i=VG(r.filter((t=>t instanceof e3)).map((t=>t.tokenType)),(t=>t.tokenTypeIdx));return{actualToken:n,possibleTokenTypes:i,tokenPath:t}}function A6(t,e){return t.edges[e.tokenTypeIdx]}function L6(t,e,n){const r=new L3,i=[];for(const a of t.elements){if(!1===n.is(a.alt))continue;if(7===a.state.type){i.push(a);continue}const t=a.state.transitions.length;for(let n=0;n<t;n++){const t=N6(a.state.transitions[n],e);void 0!==t&&r.add({state:t,alt:a.alt,stack:a.stack})}}let a;if(0===i.length&&1===r.size&&(a=r),void 0===a){a=new L3;for(const t of r.elements)P6(t,a)}if(i.length>0&&!$6(a))for(const t of i)a.add(t);return a}function N6(t,e){if(t instanceof e3&&Z1(e,t.tokenType))return t.target}function I6(t,e){let n;for(const r of t.elements)if(!0===e.is(r.alt))if(void 0===n)n=r.alt;else if(n!==r.alt)return;return n}function M6(t){return{configs:t,edges:{},isAcceptState:!1,prediction:-1}}function R6(t,e,n,r){return r=D6(t,r),e.edges[n.tokenTypeIdx]=r,r}function D6(t,e){if(e===A3)return e;const n=e.configs.key,r=t.states[n];return void 0!==r?r:(e.configs.finalize(),t.states[n]=e,e)}function O6(t){const e=new L3,n=t.transitions.length;for(let r=0;r<n;r++){P6({state:t.transitions[r].target,alt:r,stack:[]},e)}return e}function P6(t,e){const n=t.state;if(7===n.type){if(t.stack.length>0){const n=[...t.stack];P6({state:n.pop(),alt:t.alt,stack:n},e)}else e.add(t);return}n.epsilonOnlyTransitions||e.add(t);const r=n.transitions.length;for(let i=0;i<r;i++){const r=B6(t,n.transitions[i]);void 0!==r&&P6(r,e)}}function B6(t,e){if(e instanceof n3)return{state:e.target,alt:t.alt,stack:t.stack};if(e instanceof r3){const n=[...t.stack,e.followState];return{state:e.target,alt:t.alt,stack:n}}}function $6(t){for(const e of t.elements)if(7===e.state.type)return!0;return!1}function F6(t){for(const e of t.elements)if(7!==e.state.type)return!1;return!0}function z6(t){if(F6(t))return!0;const e=U6(t.elements);return G6(e)&&!q6(e)}function U6(t){const e=new Map;for(const n of t){const t=N3(n,!1);let r=e.get(t);void 0===r&&(r={},e.set(t,r)),r[n.alt]=!0}return e}function G6(t){for(const e of Array.from(t.values()))if(Object.keys(e).length>1)return!0;return!1}function q6(t){for(const e of Array.from(t.values()))if(1===Object.keys(e).length)return!0;return!1}s(x6,"isLL1Sequence"),s(b6,"initATNSimulator"),s(w6,"adaptivePredict"),s(k6,"performLookahead"),s(T6,"computeLookaheadTarget"),s(_6,"reportLookaheadAmbiguity"),s(E6,"buildAmbiguityError"),s(C6,"getProductionDslName"),s(S6,"buildAdaptivePredictError"),s(A6,"getExistingTargetState"),s(L6,"computeReachSet"),s(N6,"getReachableTarget"),s(I6,"getUniqueAlt"),s(M6,"newDFAState"),s(R6,"addDFAEdge"),s(D6,"addDFAState"),s(O6,"computeStartState"),s(P6,"closure"),s(B6,"getEpsilonTarget"),s($6,"hasConfigInRuleStopState"),s(F6,"allConfigsInRuleStopStates"),s(z6,"hasConflictTerminatingPrediction"),s(U6,"getConflictingAltSets"),s(G6,"hasConflictingAltSet"),s(q6,"hasStateAssociatedWithOneAlt"),function(t){function e(t){return"string"==typeof t}s(e,"is"),t.is=e}(M3||(M3={})),function(t){function e(t){return"string"==typeof t}s(e,"is"),t.is=e}(R3||(R3={})),function(t){function e(e){return"number"==typeof e&&t.MIN_VALUE<=e&&e<=t.MAX_VALUE}t.MIN_VALUE=-2147483648,t.MAX_VALUE=2147483647,s(e,"is"),t.is=e}(D3||(D3={})),function(t){function e(e){return"number"==typeof e&&t.MIN_VALUE<=e&&e<=t.MAX_VALUE}t.MIN_VALUE=0,t.MAX_VALUE=2147483647,s(e,"is"),t.is=e}(O3||(O3={})),function(t){function e(t,e){return t===Number.MAX_VALUE&&(t=O3.MAX_VALUE),e===Number.MAX_VALUE&&(e=O3.MAX_VALUE),{line:t,character:e}}function n(t){let e=t;return j6.objectLiteral(e)&&j6.uinteger(e.line)&&j6.uinteger(e.character)}s(e,"create"),t.create=e,s(n,"is"),t.is=n}(P3||(P3={})),function(t){function e(t,e,n,r){if(j6.uinteger(t)&&j6.uinteger(e)&&j6.uinteger(n)&&j6.uinteger(r))return{start:P3.create(t,e),end:P3.create(n,r)};if(P3.is(t)&&P3.is(e))return{start:t,end:e};throw new Error(`Range#create called with invalid arguments[${t}, ${e}, ${n}, ${r}]`)}function n(t){let e=t;return j6.objectLiteral(e)&&P3.is(e.start)&&P3.is(e.end)}s(e,"create"),t.create=e,s(n,"is"),t.is=n}(B3||(B3={})),function(t){function e(t,e){return{uri:t,range:e}}function n(t){let e=t;return j6.objectLiteral(e)&&B3.is(e.range)&&(j6.string(e.uri)||j6.undefined(e.uri))}s(e,"create"),t.create=e,s(n,"is"),t.is=n}($3||($3={})),function(t){function e(t,e,n,r){return{targetUri:t,targetRange:e,targetSelectionRange:n,originSelectionRange:r}}function n(t){let e=t;return j6.objectLiteral(e)&&B3.is(e.targetRange)&&j6.string(e.targetUri)&&B3.is(e.targetSelectionRange)&&(B3.is(e.originSelectionRange)||j6.undefined(e.originSelectionRange))}s(e,"create"),t.create=e,s(n,"is"),t.is=n}(F3||(F3={})),function(t){function e(t,e,n,r){return{red:t,green:e,blue:n,alpha:r}}function n(t){const e=t;return j6.objectLiteral(e)&&j6.numberRange(e.red,0,1)&&j6.numberRange(e.green,0,1)&&j6.numberRange(e.blue,0,1)&&j6.numberRange(e.alpha,0,1)}s(e,"create"),t.create=e,s(n,"is"),t.is=n}(z3||(z3={})),function(t){function e(t,e){return{range:t,color:e}}function n(t){const e=t;return j6.objectLiteral(e)&&B3.is(e.range)&&z3.is(e.color)}s(e,"create"),t.create=e,s(n,"is"),t.is=n}(U3||(U3={})),function(t){function e(t,e,n){return{label:t,textEdit:e,additionalTextEdits:n}}function n(t){const e=t;return j6.objectLiteral(e)&&j6.string(e.label)&&(j6.undefined(e.textEdit)||t5.is(e))&&(j6.undefined(e.additionalTextEdits)||j6.typedArray(e.additionalTextEdits,t5.is))}s(e,"create"),t.create=e,s(n,"is"),t.is=n}(G3||(G3={})),(j3=q3||(q3={})).Comment="comment",j3.Imports="imports",j3.Region="region",function(t){function e(t,e,n,r,i,a){const s={startLine:t,endLine:e};return j6.defined(n)&&(s.startCharacter=n),j6.defined(r)&&(s.endCharacter=r),j6.defined(i)&&(s.kind=i),j6.defined(a)&&(s.collapsedText=a),s}function n(t){const e=t;return j6.objectLiteral(e)&&j6.uinteger(e.startLine)&&j6.uinteger(e.startLine)&&(j6.undefined(e.startCharacter)||j6.uinteger(e.startCharacter))&&(j6.undefined(e.endCharacter)||j6.uinteger(e.endCharacter))&&(j6.undefined(e.kind)||j6.string(e.kind))}s(e,"create"),t.create=e,s(n,"is"),t.is=n}(Y3||(Y3={})),function(t){function e(t,e){return{location:t,message:e}}function n(t){let e=t;return j6.defined(e)&&$3.is(e.location)&&j6.string(e.message)}s(e,"create"),t.create=e,s(n,"is"),t.is=n}(W3||(W3={})),(V3=H3||(H3={})).Error=1,V3.Warning=2,V3.Information=3,V3.Hint=4,(K3=X3||(X3={})).Unnecessary=1,K3.Deprecated=2,function(t){function e(t){const e=t;return j6.objectLiteral(e)&&j6.string(e.href)}s(e,"is"),t.is=e}(Z3||(Z3={})),function(t){function e(t,e,n,r,i,a){let s={range:t,message:e};return j6.defined(n)&&(s.severity=n),j6.defined(r)&&(s.code=r),j6.defined(i)&&(s.source=i),j6.defined(a)&&(s.relatedInformation=a),s}function n(t){var e;let n=t;return j6.defined(n)&&B3.is(n.range)&&j6.string(n.message)&&(j6.number(n.severity)||j6.undefined(n.severity))&&(j6.integer(n.code)||j6.string(n.code)||j6.undefined(n.code))&&(j6.undefined(n.codeDescription)||j6.string(null===(e=n.codeDescription)||void 0===e?void 0:e.href))&&(j6.string(n.source)||j6.undefined(n.source))&&(j6.undefined(n.relatedInformation)||j6.typedArray(n.relatedInformation,W3.is))}s(e,"create"),t.create=e,s(n,"is"),t.is=n}(Q3||(Q3={})),function(t){function e(t,e,...n){let r={title:t,command:e};return j6.defined(n)&&n.length>0&&(r.arguments=n),r}function n(t){let e=t;return j6.defined(e)&&j6.string(e.title)&&j6.string(e.command)}s(e,"create"),t.create=e,s(n,"is"),t.is=n}(J3||(J3={})),function(t){function e(t,e){return{range:t,newText:e}}function n(t,e){return{range:{start:t,end:t},newText:e}}function r(t){return{range:t,newText:""}}function i(t){const e=t;return j6.objectLiteral(e)&&j6.string(e.newText)&&B3.is(e.range)}s(e,"replace"),t.replace=e,s(n,"insert"),t.insert=n,s(r,"del"),t.del=r,s(i,"is"),t.is=i}(t5||(t5={})),function(t){function e(t,e,n){const r={label:t};return void 0!==e&&(r.needsConfirmation=e),void 0!==n&&(r.description=n),r}function n(t){const e=t;return j6.objectLiteral(e)&&j6.string(e.label)&&(j6.boolean(e.needsConfirmation)||void 0===e.needsConfirmation)&&(j6.string(e.description)||void 0===e.description)}s(e,"create"),t.create=e,s(n,"is"),t.is=n}(e5||(e5={})),function(t){function e(t){const e=t;return j6.string(e)}s(e,"is"),t.is=e}(n5||(n5={})),function(t){function e(t,e,n){return{range:t,newText:e,annotationId:n}}function n(t,e,n){return{range:{start:t,end:t},newText:e,annotationId:n}}function r(t,e){return{range:t,newText:"",annotationId:e}}function i(t){const e=t;return t5.is(e)&&(e5.is(e.annotationId)||n5.is(e.annotationId))}s(e,"replace"),t.replace=e,s(n,"insert"),t.insert=n,s(r,"del"),t.del=r,s(i,"is"),t.is=i}(r5||(r5={})),function(t){function e(t,e){return{textDocument:t,edits:e}}function n(t){let e=t;return j6.defined(e)&&u5.is(e.textDocument)&&Array.isArray(e.edits)}s(e,"create"),t.create=e,s(n,"is"),t.is=n}(i5||(i5={})),function(t){function e(t,e,n){let r={kind:"create",uri:t};return void 0===e||void 0===e.overwrite&&void 0===e.ignoreIfExists||(r.options=e),void 0!==n&&(r.annotationId=n),r}function n(t){let e=t;return e&&"create"===e.kind&&j6.string(e.uri)&&(void 0===e.options||(void 0===e.options.overwrite||j6.boolean(e.options.overwrite))&&(void 0===e.options.ignoreIfExists||j6.boolean(e.options.ignoreIfExists)))&&(void 0===e.annotationId||n5.is(e.annotationId))}s(e,"create"),t.create=e,s(n,"is"),t.is=n}(a5||(a5={})),function(t){function e(t,e,n,r){let i={kind:"rename",oldUri:t,newUri:e};return void 0===n||void 0===n.overwrite&&void 0===n.ignoreIfExists||(i.options=n),void 0!==r&&(i.annotationId=r),i}function n(t){let e=t;return e&&"rename"===e.kind&&j6.string(e.oldUri)&&j6.string(e.newUri)&&(void 0===e.options||(void 0===e.options.overwrite||j6.boolean(e.options.overwrite))&&(void 0===e.options.ignoreIfExists||j6.boolean(e.options.ignoreIfExists)))&&(void 0===e.annotationId||n5.is(e.annotationId))}s(e,"create"),t.create=e,s(n,"is"),t.is=n}(s5||(s5={})),function(t){function e(t,e,n){let r={kind:"delete",uri:t};return void 0===e||void 0===e.recursive&&void 0===e.ignoreIfNotExists||(r.options=e),void 0!==n&&(r.annotationId=n),r}function n(t){let e=t;return e&&"delete"===e.kind&&j6.string(e.uri)&&(void 0===e.options||(void 0===e.options.recursive||j6.boolean(e.options.recursive))&&(void 0===e.options.ignoreIfNotExists||j6.boolean(e.options.ignoreIfNotExists)))&&(void 0===e.annotationId||n5.is(e.annotationId))}s(e,"create"),t.create=e,s(n,"is"),t.is=n}(o5||(o5={})),function(t){function e(t){let e=t;return e&&(void 0!==e.changes||void 0!==e.documentChanges)&&(void 0===e.documentChanges||e.documentChanges.every((t=>j6.string(t.kind)?a5.is(t)||s5.is(t)||o5.is(t):i5.is(t))))}s(e,"is"),t.is=e}(l5||(l5={})),function(t){function e(t){return{uri:t}}function n(t){let e=t;return j6.defined(e)&&j6.string(e.uri)}s(e,"create"),t.create=e,s(n,"is"),t.is=n}(c5||(c5={})),function(t){function e(t,e){return{uri:t,version:e}}function n(t){let e=t;return j6.defined(e)&&j6.string(e.uri)&&j6.integer(e.version)}s(e,"create"),t.create=e,s(n,"is"),t.is=n}(h5||(h5={})),function(t){function e(t,e){return{uri:t,version:e}}function n(t){let e=t;return j6.defined(e)&&j6.string(e.uri)&&(null===e.version||j6.integer(e.version))}s(e,"create"),t.create=e,s(n,"is"),t.is=n}(u5||(u5={})),function(t){function e(t,e,n,r){return{uri:t,languageId:e,version:n,text:r}}function n(t){let e=t;return j6.defined(e)&&j6.string(e.uri)&&j6.string(e.languageId)&&j6.integer(e.version)&&j6.string(e.text)}s(e,"create"),t.create=e,s(n,"is"),t.is=n}(d5||(d5={})),function(t){function e(e){const n=e;return n===t.PlainText||n===t.Markdown}t.PlainText="plaintext",t.Markdown="markdown",s(e,"is"),t.is=e}(p5||(p5={})),function(t){function e(t){const e=t;return j6.objectLiteral(t)&&p5.is(e.kind)&&j6.string(e.value)}s(e,"is"),t.is=e}(g5||(g5={})),(m5=f5||(f5={})).Text=1,m5.Method=2,m5.Function=3,m5.Constructor=4,m5.Field=5,m5.Variable=6,m5.Class=7,m5.Interface=8,m5.Module=9,m5.Property=10,m5.Unit=11,m5.Value=12,m5.Enum=13,m5.Keyword=14,m5.Snippet=15,m5.Color=16,m5.File=17,m5.Reference=18,m5.Folder=19,m5.EnumMember=20,m5.Constant=21,m5.Struct=22,m5.Event=23,m5.Operator=24,m5.TypeParameter=25,(v5=y5||(y5={})).PlainText=1,v5.Snippet=2,(x5||(x5={})).Deprecated=1,function(t){function e(t,e,n){return{newText:t,insert:e,replace:n}}function n(t){const e=t;return e&&j6.string(e.newText)&&B3.is(e.insert)&&B3.is(e.replace)}s(e,"create"),t.create=e,s(n,"is"),t.is=n}(b5||(b5={})),(k5=w5||(w5={})).asIs=1,k5.adjustIndentation=2,function(t){function e(t){const e=t;return e&&(j6.string(e.detail)||void 0===e.detail)&&(j6.string(e.description)||void 0===e.description)}s(e,"is"),t.is=e}(T5||(T5={})),function(t){function e(t){return{label:t}}s(e,"create"),t.create=e}(_5||(_5={})),function(t){function e(t,e){return{items:t||[],isIncomplete:!!e}}s(e,"create"),t.create=e}(E5||(E5={})),function(t){function e(t){return t.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}function n(t){const e=t;return j6.string(e)||j6.objectLiteral(e)&&j6.string(e.language)&&j6.string(e.value)}s(e,"fromPlainText"),t.fromPlainText=e,s(n,"is"),t.is=n}(C5||(C5={})),function(t){function e(t){let e=t;return!!e&&j6.objectLiteral(e)&&(g5.is(e.contents)||C5.is(e.contents)||j6.typedArray(e.contents,C5.is))&&(void 0===t.range||B3.is(t.range))}s(e,"is"),t.is=e}(S5||(S5={})),function(t){function e(t,e){return e?{label:t,documentation:e}:{label:t}}s(e,"create"),t.create=e}(A5||(A5={})),function(t){function e(t,e,...n){let r={label:t};return j6.defined(e)&&(r.documentation=e),j6.defined(n)?r.parameters=n:r.parameters=[],r}s(e,"create"),t.create=e}(L5||(L5={})),(I5=N5||(N5={})).Text=1,I5.Read=2,I5.Write=3,function(t){function e(t,e){let n={range:t};return j6.number(e)&&(n.kind=e),n}s(e,"create"),t.create=e}(M5||(M5={})),(D5=R5||(R5={})).File=1,D5.Module=2,D5.Namespace=3,D5.Package=4,D5.Class=5,D5.Method=6,D5.Property=7,D5.Field=8,D5.Constructor=9,D5.Enum=10,D5.Interface=11,D5.Function=12,D5.Variable=13,D5.Constant=14,D5.String=15,D5.Number=16,D5.Boolean=17,D5.Array=18,D5.Object=19,D5.Key=20,D5.Null=21,D5.EnumMember=22,D5.Struct=23,D5.Event=24,D5.Operator=25,D5.TypeParameter=26,(O5||(O5={})).Deprecated=1,function(t){function e(t,e,n,r,i){let a={name:t,kind:e,location:{uri:r,range:n}};return i&&(a.containerName=i),a}s(e,"create"),t.create=e}(P5||(P5={})),function(t){function e(t,e,n,r){return void 0!==r?{name:t,kind:e,location:{uri:n,range:r}}:{name:t,kind:e,location:{uri:n}}}s(e,"create"),t.create=e}(B5||(B5={})),function(t){function e(t,e,n,r,i,a){let s={name:t,detail:e,kind:n,range:r,selectionRange:i};return void 0!==a&&(s.children=a),s}function n(t){let e=t;return e&&j6.string(e.name)&&j6.number(e.kind)&&B3.is(e.range)&&B3.is(e.selectionRange)&&(void 0===e.detail||j6.string(e.detail))&&(void 0===e.deprecated||j6.boolean(e.deprecated))&&(void 0===e.children||Array.isArray(e.children))&&(void 0===e.tags||Array.isArray(e.tags))}s(e,"create"),t.create=e,s(n,"is"),t.is=n}($5||($5={})),(z5=F5||(F5={})).Empty="",z5.QuickFix="quickfix",z5.Refactor="refactor",z5.RefactorExtract="refactor.extract",z5.RefactorInline="refactor.inline",z5.RefactorRewrite="refactor.rewrite",z5.Source="source",z5.SourceOrganizeImports="source.organizeImports",z5.SourceFixAll="source.fixAll",(G5=U5||(U5={})).Invoked=1,G5.Automatic=2,function(t){function e(t,e,n){let r={diagnostics:t};return null!=e&&(r.only=e),null!=n&&(r.triggerKind=n),r}function n(t){let e=t;return j6.defined(e)&&j6.typedArray(e.diagnostics,Q3.is)&&(void 0===e.only||j6.typedArray(e.only,j6.string))&&(void 0===e.triggerKind||e.triggerKind===U5.Invoked||e.triggerKind===U5.Automatic)}s(e,"create"),t.create=e,s(n,"is"),t.is=n}(q5||(q5={})),function(t){function e(t,e,n){let r={title:t},i=!0;return"string"==typeof e?(i=!1,r.kind=e):J3.is(e)?r.command=e:r.edit=e,i&&void 0!==n&&(r.kind=n),r}function n(t){let e=t;return e&&j6.string(e.title)&&(void 0===e.diagnostics||j6.typedArray(e.diagnostics,Q3.is))&&(void 0===e.kind||j6.string(e.kind))&&(void 0!==e.edit||void 0!==e.command)&&(void 0===e.command||J3.is(e.command))&&(void 0===e.isPreferred||j6.boolean(e.isPreferred))&&(void 0===e.edit||l5.is(e.edit))}s(e,"create"),t.create=e,s(n,"is"),t.is=n}(j5||(j5={})),function(t){function e(t,e){let n={range:t};return j6.defined(e)&&(n.data=e),n}function n(t){let e=t;return j6.defined(e)&&B3.is(e.range)&&(j6.undefined(e.command)||J3.is(e.command))}s(e,"create"),t.create=e,s(n,"is"),t.is=n}(Y5||(Y5={})),function(t){function e(t,e){return{tabSize:t,insertSpaces:e}}function n(t){let e=t;return j6.defined(e)&&j6.uinteger(e.tabSize)&&j6.boolean(e.insertSpaces)}s(e,"create"),t.create=e,s(n,"is"),t.is=n}(W5||(W5={})),function(t){function e(t,e,n){return{range:t,target:e,data:n}}function n(t){let e=t;return j6.defined(e)&&B3.is(e.range)&&(j6.undefined(e.target)||j6.string(e.target))}s(e,"create"),t.create=e,s(n,"is"),t.is=n}(H5||(H5={})),function(t){function e(t,e){return{range:t,parent:e}}function n(e){let n=e;return j6.objectLiteral(n)&&B3.is(n.range)&&(void 0===n.parent||t.is(n.parent))}s(e,"create"),t.create=e,s(n,"is"),t.is=n}(V5||(V5={})),(K5=X5||(X5={})).namespace="namespace",K5.type="type",K5.class="class",K5.enum="enum",K5.interface="interface",K5.struct="struct",K5.typeParameter="typeParameter",K5.parameter="parameter",K5.variable="variable",K5.property="property",K5.enumMember="enumMember",K5.event="event",K5.function="function",K5.method="method",K5.macro="macro",K5.keyword="keyword",K5.modifier="modifier",K5.comment="comment",K5.string="string",K5.number="number",K5.regexp="regexp",K5.operator="operator",K5.decorator="decorator",(Q5=Z5||(Z5={})).declaration="declaration",Q5.definition="definition",Q5.readonly="readonly",Q5.static="static",Q5.deprecated="deprecated",Q5.abstract="abstract",Q5.async="async",Q5.modification="modification",Q5.documentation="documentation",Q5.defaultLibrary="defaultLibrary",function(t){function e(t){const e=t;return j6.objectLiteral(e)&&(void 0===e.resultId||"string"==typeof e.resultId)&&Array.isArray(e.data)&&(0===e.data.length||"number"==typeof e.data[0])}s(e,"is"),t.is=e}(J5||(J5={})),function(t){function e(t,e){return{range:t,text:e}}function n(t){const e=t;return null!=e&&B3.is(e.range)&&j6.string(e.text)}s(e,"create"),t.create=e,s(n,"is"),t.is=n}(t6||(t6={})),function(t){function e(t,e,n){return{range:t,variableName:e,caseSensitiveLookup:n}}function n(t){const e=t;return null!=e&&B3.is(e.range)&&j6.boolean(e.caseSensitiveLookup)&&(j6.string(e.variableName)||void 0===e.variableName)}s(e,"create"),t.create=e,s(n,"is"),t.is=n}(e6||(e6={})),function(t){function e(t,e){return{range:t,expression:e}}function n(t){const e=t;return null!=e&&B3.is(e.range)&&(j6.string(e.expression)||void 0===e.expression)}s(e,"create"),t.create=e,s(n,"is"),t.is=n}(n6||(n6={})),function(t){function e(t,e){return{frameId:t,stoppedLocation:e}}function n(t){const e=t;return j6.defined(e)&&B3.is(t.stoppedLocation)}s(e,"create"),t.create=e,s(n,"is"),t.is=n}(r6||(r6={})),function(t){function e(t){return 1===t||2===t}t.Type=1,t.Parameter=2,s(e,"is"),t.is=e}(i6||(i6={})),function(t){function e(t){return{value:t}}function n(t){const e=t;return j6.objectLiteral(e)&&(void 0===e.tooltip||j6.string(e.tooltip)||g5.is(e.tooltip))&&(void 0===e.location||$3.is(e.location))&&(void 0===e.command||J3.is(e.command))}s(e,"create"),t.create=e,s(n,"is"),t.is=n}(a6||(a6={})),function(t){function e(t,e,n){const r={position:t,label:e};return void 0!==n&&(r.kind=n),r}function n(t){const e=t;return j6.objectLiteral(e)&&P3.is(e.position)&&(j6.string(e.label)||j6.typedArray(e.label,a6.is))&&(void 0===e.kind||i6.is(e.kind))&&void 0===e.textEdits||j6.typedArray(e.textEdits,t5.is)&&(void 0===e.tooltip||j6.string(e.tooltip)||g5.is(e.tooltip))&&(void 0===e.paddingLeft||j6.boolean(e.paddingLeft))&&(void 0===e.paddingRight||j6.boolean(e.paddingRight))}s(e,"create"),t.create=e,s(n,"is"),t.is=n}(s6||(s6={})),function(t){function e(t){return{kind:"snippet",value:t}}s(e,"createSnippet"),t.createSnippet=e}(o6||(o6={})),function(t){function e(t,e,n,r){return{insertText:t,filterText:e,range:n,command:r}}s(e,"create"),t.create=e}(l6||(l6={})),function(t){function e(t){return{items:t}}s(e,"create"),t.create=e}(c6||(c6={})),(u6=h6||(h6={})).Invoked=0,u6.Automatic=1,function(t){function e(t,e){return{range:t,text:e}}s(e,"create"),t.create=e}(d6||(d6={})),function(t){function e(t,e){return{triggerKind:t,selectedCompletionInfo:e}}s(e,"create"),t.create=e}(p6||(p6={})),function(t){function e(t){const e=t;return j6.objectLiteral(e)&&R3.is(e.uri)&&j6.string(e.name)}s(e,"is"),t.is=e}(g6||(g6={})),function(t){function e(t,e,n,r){return new Y6(t,e,n,r)}function n(t){let e=t;return!!(j6.defined(e)&&j6.string(e.uri)&&(j6.undefined(e.languageId)||j6.string(e.languageId))&&j6.uinteger(e.lineCount)&&j6.func(e.getText)&&j6.func(e.positionAt)&&j6.func(e.offsetAt))}function r(t,e){let n=t.getText(),r=i(e,((t,e)=>{let n=t.range.start.line-e.range.start.line;return 0===n?t.range.start.character-e.range.start.character:n})),a=n.length;for(let e=r.length-1;e>=0;e--){let i=r[e],s=t.offsetAt(i.range.start),o=t.offsetAt(i.range.end);if(!(o<=a))throw new Error("Overlapping edit");n=n.substring(0,s)+i.newText+n.substring(o,n.length),a=s}return n}function i(t,e){if(t.length<=1)return t;const n=t.length/2|0,r=t.slice(0,n),a=t.slice(n);i(r,e),i(a,e);let s=0,o=0,l=0;for(;s<r.length&&o<a.length;){let n=e(r[s],a[o]);t[l++]=n<=0?r[s++]:a[o++]}for(;s<r.length;)t[l++]=r[s++];for(;o<a.length;)t[l++]=a[o++];return t}s(e,"create"),t.create=e,s(n,"is"),t.is=n,s(r,"applyEdits"),t.applyEdits=r,s(i,"mergeSort")}(f6||(f6={}));var j6,Y6=class{static{s(this,"FullTextDocument")}constructor(t,e,n,r){this._uri=t,this._languageId=e,this._version=n,this._content=r,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(t){if(t){let e=this.offsetAt(t.start),n=this.offsetAt(t.end);return this._content.substring(e,n)}return this._content}update(t,e){this._content=t.text,this._version=e,this._lineOffsets=void 0}getLineOffsets(){if(void 0===this._lineOffsets){let t=[],e=this._content,n=!0;for(let r=0;r<e.length;r++){n&&(t.push(r),n=!1);let i=e.charAt(r);n="\r"===i||"\n"===i,"\r"===i&&r+1<e.length&&"\n"===e.charAt(r+1)&&r++}n&&e.length>0&&t.push(e.length),this._lineOffsets=t}return this._lineOffsets}positionAt(t){t=Math.max(Math.min(t,this._content.length),0);let e=this.getLineOffsets(),n=0,r=e.length;if(0===r)return P3.create(0,t);for(;n<r;){let i=Math.floor((n+r)/2);e[i]>t?r=i:n=i+1}let i=n-1;return P3.create(i,t-e[i])}offsetAt(t){let e=this.getLineOffsets();if(t.line>=e.length)return this._content.length;if(t.line<0)return 0;let n=e[t.line],r=t.line+1<e.length?e[t.line+1]:this._content.length;return Math.max(Math.min(n+t.character,r),n)}get lineCount(){return this.getLineOffsets().length}};!function(t){const e=Object.prototype.toString;function n(t){return void 0!==t}function r(t){return void 0===t}function i(t){return!0===t||!1===t}function a(t){return"[object String]"===e.call(t)}function o(t){return"[object Number]"===e.call(t)}function l(t,n,r){return"[object Number]"===e.call(t)&&n<=t&&t<=r}function c(t){return"[object Number]"===e.call(t)&&-2147483648<=t&&t<=2147483647}function h(t){return"[object Number]"===e.call(t)&&0<=t&&t<=2147483647}function u(t){return"[object Function]"===e.call(t)}function d(t){return null!==t&&"object"==typeof t}function p(t,e){return Array.isArray(t)&&t.every(e)}s(n,"defined"),t.defined=n,s(r,"undefined"),t.undefined=r,s(i,"boolean"),t.boolean=i,s(a,"string"),t.string=a,s(o,"number"),t.number=o,s(l,"numberRange"),t.numberRange=l,s(c,"integer"),t.integer=c,s(h,"uinteger"),t.uinteger=h,s(u,"func"),t.func=u,s(d,"objectLiteral"),t.objectLiteral=d,s(p,"typedArray"),t.typedArray=p}(j6||(j6={}));var W6=class{static{s(this,"CstNodeBuilder")}constructor(){this.nodeStack=[]}get current(){return this.nodeStack[this.nodeStack.length-1]}buildRootNode(t){return this.rootNode=new Z6(t),this.rootNode.root=this.rootNode,this.nodeStack=[this.rootNode],this.rootNode}buildCompositeNode(t){const e=new X6;return e.grammarSource=t,e.root=this.rootNode,this.current.content.push(e),this.nodeStack.push(e),e}buildLeafNode(t,e){const n=new V6(t.startOffset,t.image.length,vK(t),t.tokenType,!1);return n.grammarSource=e,n.root=this.rootNode,this.current.content.push(n),n}removeNode(t){const e=t.container;if(e){const n=e.content.indexOf(t);n>=0&&e.content.splice(n,1)}}construct(t){const e=this.current;"string"==typeof t.$type&&(this.current.astNode=t),t.$cstNode=e;const n=this.nodeStack.pop();0===(null==n?void 0:n.content.length)&&this.removeNode(n)}addHiddenTokens(t){for(const e of t){const t=new V6(e.startOffset,e.image.length,vK(e),e.tokenType,!0);t.root=this.rootNode,this.addHiddenToken(this.rootNode,t)}}addHiddenToken(t,e){const{offset:n,end:r}=e;for(let i=0;i<t.content.length;i++){const a=t.content[i],{offset:s,end:o}=a;if(nK(a)&&n>s&&r<o)return void this.addHiddenToken(a,e);if(r<=s)return void t.content.splice(i,0,e)}t.content.push(e)}},H6=class{static{s(this,"AbstractCstNode")}get parent(){return this.container}get feature(){return this.grammarSource}get hidden(){return!1}get astNode(){var t,e;const n="string"==typeof(null===(t=this._astNode)||void 0===t?void 0:t.$type)?this._astNode:null===(e=this.container)||void 0===e?void 0:e.astNode;if(!n)throw new Error("This node has no associated AST element");return n}set astNode(t){this._astNode=t}get element(){return this.astNode}get text(){return this.root.fullText.substring(this.offset,this.end)}},V6=class extends H6{static{s(this,"LeafCstNodeImpl")}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(t,e,n,r,i=!1){super(),this._hidden=i,this._offset=t,this._tokenType=r,this._length=e,this._range=n}},X6=class extends H6{static{s(this,"CompositeCstNodeImpl")}constructor(){super(...arguments),this.content=new K6(this)}get children(){return this.content}get offset(){var t,e;return null!==(e=null===(t=this.firstNonHiddenNode)||void 0===t?void 0:t.offset)&&void 0!==e?e:0}get length(){return this.end-this.offset}get end(){var t,e;return null!==(e=null===(t=this.lastNonHiddenNode)||void 0===t?void 0:t.end)&&void 0!==e?e:0}get range(){const t=this.firstNonHiddenNode,e=this.lastNonHiddenNode;if(t&&e){if(void 0===this._rangeCache){const{range:n}=t,{range:r}=e;this._rangeCache={start:n.start,end:r.end.line<n.start.line?n.start:r.end}}return this._rangeCache}return{start:P3.create(0,0),end:P3.create(0,0)}}get firstNonHiddenNode(){for(const t of this.content)if(!t.hidden)return t;return this.content[0]}get lastNonHiddenNode(){for(let t=this.content.length-1;t>=0;t--){const e=this.content[t];if(!e.hidden)return e}return this.content[this.content.length-1]}},K6=class t extends Array{static{s(this,"CstNodeContainer")}constructor(e){super(),this.parent=e,Object.setPrototypeOf(this,t.prototype)}push(...t){return this.addParents(t),super.push(...t)}unshift(...t){return this.addParents(t),super.unshift(...t)}splice(t,e,...n){return this.addParents(n),super.splice(t,e,...n)}addParents(t){for(const e of t)e.container=this.parent}},Z6=class extends X6{static{s(this,"RootCstNodeImpl")}get text(){return this._text.substring(this.offset,this.end)}get fullText(){return this._text}constructor(t){super(),this._text="",this._text=null!=t?t:""}},Q6=Symbol("Datatype");function J6(t){return t.$type===Q6}s(J6,"isDataTypeNode");var t7=s((t=>t.endsWith("​")?t:t+"​"),"withRuleSuffix"),e7=class{static{s(this,"AbstractLangiumParser")}constructor(t){this._unorderedGroups=new Map,this.lexer=t.parser.Lexer;const e=this.lexer.definition;this.wrapper=new o7(e,Object.assign(Object.assign({},t.parser.ParserConfig),{errorMessageProvider:t.parser.ParserErrorMessageProvider}))}alternatives(t,e){this.wrapper.wrapOr(t,e)}optional(t,e){this.wrapper.wrapOption(t,e)}many(t,e){this.wrapper.wrapMany(t,e)}atLeastOne(t,e){this.wrapper.wrapAtLeastOne(t,e)}isRecording(){return this.wrapper.IS_RECORDING}get unorderedGroups(){return this._unorderedGroups}getRuleStack(){return this.wrapper.RULE_STACK}finalize(){this.wrapper.wrapSelfAnalysis()}},n7=class extends e7{static{s(this,"LangiumParser")}get current(){return this.stack[this.stack.length-1]}constructor(t){super(t),this.nodeBuilder=new W6,this.stack=[],this.assignmentMap=new Map,this.linker=t.references.Linker,this.converter=t.parser.ValueConverter,this.astReflection=t.shared.AstReflection}rule(t,e){const n=t.fragment?void 0:DJ(t)?Q6:FJ(t),r=this.wrapper.DEFINE_RULE(t7(t.name),this.startImplementation(n,e).bind(this));return t.entry&&(this.mainRule=r),r}parse(t){this.nodeBuilder.buildRootNode(t);const e=this.lexer.tokenize(t);this.wrapper.input=e.tokens;const n=this.mainRule.call(this.wrapper,{});return this.nodeBuilder.addHiddenTokens(e.hidden),this.unorderedGroups.clear(),{value:n,lexerErrors:e.errors,parserErrors:this.wrapper.errors}}startImplementation(t,e){return n=>{if(!this.isRecording()){const e={$type:t};this.stack.push(e),t===Q6&&(e.value="")}let r;try{r=e(n)}catch(t){r=void 0}return this.isRecording()||void 0!==r||(r=this.construct()),r}}consume(t,e,n){const r=this.wrapper.wrapConsume(t,e);if(!this.isRecording()&&this.isValidToken(r)){const t=this.nodeBuilder.buildLeafNode(r,n),{assignment:e,isCrossRef:i}=this.getAssignment(n),a=this.current;if(e){const a=oQ(n)?r.image:this.converter.convert(r.image,t);this.assign(e.operator,e.feature,a,t,i)}else if(J6(a)){let e=r.image;oQ(n)||(e=this.converter.convert(e,t).toString()),a.value+=e}}}isValidToken(t){return!t.isInsertedInRecovery&&!isNaN(t.startOffset)&&"number"==typeof t.endOffset&&!isNaN(t.endOffset)}subrule(t,e,n,r){let i;this.isRecording()||(i=this.nodeBuilder.buildCompositeNode(n));const a=this.wrapper.wrapSubrule(t,e,r);!this.isRecording()&&i&&i.length>0&&this.performSubruleAssignment(a,n,i)}performSubruleAssignment(t,e,n){const{assignment:r,isCrossRef:i}=this.getAssignment(e);if(r)this.assign(r.operator,r.feature,t,n,i);else if(!r){const e=this.current;if(J6(e))e.value+=t.toString();else if("object"==typeof t&&t){const n=t.$type,r=this.assignWithoutOverride(t,e);n&&(r.$type=n);const i=r;this.stack.pop(),this.stack.push(i)}}}action(t,e){if(!this.isRecording()){let n=this.current;if(!n.$cstNode&&e.feature&&e.operator){n=this.construct(!1);const t=n.$cstNode.feature;this.nodeBuilder.buildCompositeNode(t)}const r={$type:t};this.stack.pop(),this.stack.push(r),e.feature&&e.operator&&this.assign(e.operator,e.feature,n,n.$cstNode,!1)}}construct(t=!0){if(this.isRecording())return;const e=this.current;return LQ(e),this.nodeBuilder.construct(e),t&&this.stack.pop(),J6(e)?this.converter.convert(e.value,e.$cstNode):(zQ(this.astReflection,e),e)}getAssignment(t){if(!this.assignmentMap.has(t)){const e=NQ(t,ZZ);this.assignmentMap.set(t,{assignment:e,isCrossRef:!!e&&eQ(e.terminal)})}return this.assignmentMap.get(t)}assign(t,e,n,r,i){const a=this.current;let s;switch(s=i&&"string"==typeof n?this.linker.buildReference(a,e,r,n):n,t){case"=":a[e]=s;break;case"?=":a[e]=!0;break;case"+=":Array.isArray(a[e])||(a[e]=[]),a[e].push(s)}}assignWithoutOverride(t,e){for(const[n,r]of Object.entries(e)){const e=t[n];void 0===e?t[n]=r:Array.isArray(e)&&Array.isArray(r)&&(r.push(...e),t[n]=r)}return t}get definitionErrors(){return this.wrapper.definitionErrors}},r7=class{static{s(this,"AbstractParserErrorMessageProvider")}buildMismatchTokenMessage(t){return Q1.buildMismatchTokenMessage(t)}buildNotAllInputParsedMessage(t){return Q1.buildNotAllInputParsedMessage(t)}buildNoViableAltMessage(t){return Q1.buildNoViableAltMessage(t)}buildEarlyExitMessage(t){return Q1.buildEarlyExitMessage(t)}},i7=class extends r7{static{s(this,"LangiumParserErrorMessageProvider")}buildMismatchTokenMessage({expected:t,actual:e}){return`Expecting ${t.LABEL?"`"+t.LABEL+"`":t.name.endsWith(":KW")?`keyword '${t.name.substring(0,t.name.length-3)}'`:`token of type '${t.name}'`} but found \`${e.image}\`.`}buildNotAllInputParsedMessage({firstRedundant:t}){return`Expecting end of file but found \`${t.image}\`.`}},a7=class extends e7{static{s(this,"LangiumCompletionParser")}constructor(){super(...arguments),this.tokens=[],this.elementStack=[],this.lastElementStack=[],this.nextTokenIndex=0,this.stackSize=0}action(){}construct(){}parse(t){this.resetState();const e=this.lexer.tokenize(t);return this.tokens=e.tokens,this.wrapper.input=[...this.tokens],this.mainRule.call(this.wrapper,{}),this.unorderedGroups.clear(),{tokens:this.tokens,elementStack:[...this.lastElementStack],tokenIndex:this.nextTokenIndex}}rule(t,e){const n=this.wrapper.DEFINE_RULE(t7(t.name),this.startImplementation(e).bind(this));return t.entry&&(this.mainRule=n),n}resetState(){this.elementStack=[],this.lastElementStack=[],this.nextTokenIndex=0,this.stackSize=0}startImplementation(t){return e=>{const n=this.keepStackSize();try{t(e)}finally{this.resetStackSize(n)}}}removeUnexpectedElements(){this.elementStack.splice(this.stackSize)}keepStackSize(){const t=this.elementStack.length;return this.stackSize=t,t}resetStackSize(t){this.removeUnexpectedElements(),this.stackSize=t}consume(t,e,n){this.wrapper.wrapConsume(t,e),this.isRecording()||(this.lastElementStack=[...this.elementStack,n],this.nextTokenIndex=this.currIdx+1)}subrule(t,e,n,r){this.before(n),this.wrapper.wrapSubrule(t,e,r),this.after(n)}before(t){this.isRecording()||this.elementStack.push(t)}after(t){if(!this.isRecording()){const e=this.elementStack.lastIndexOf(t);e>=0&&this.elementStack.splice(e)}}get currIdx(){return this.wrapper.currIdx}},s7={recoveryEnabled:!0,nodeLocationTracking:"full",skipValidations:!0,errorMessageProvider:new i7},o7=class extends Q4{static{s(this,"ChevrotainWrapper")}constructor(t,e){const n=e&&"maxLookahead"in e;super(t,Object.assign(Object.assign(Object.assign({},s7),{lookaheadStrategy:n?new u4({maxLookahead:e.maxLookahead}):new v6}),e))}get IS_RECORDING(){return this.RECORDING_PHASE}DEFINE_RULE(t,e){return this.RULE(t,e)}wrapSelfAnalysis(){this.performSelfAnalysis()}wrapConsume(t,e){return this.consume(t,e)}wrapSubrule(t,e,n){return this.subrule(t,e,{ARGS:[n]})}wrapOr(t,e){this.or(t,e)}wrapOption(t,e){this.option(t,e)}wrapMany(t,e){this.many(t,e)}wrapAtLeastOne(t,e){this.atLeastOne(t,e)}};function l7(t,e,n){return c7({parser:e,tokens:n,rules:new Map,ruleNames:new Map},t),e}function c7(t,e){const n=yJ(e,!1),r=hK(e.rules).filter(LZ).filter((t=>n.has(t)));for(const e of r){const n=Object.assign(Object.assign({},t),{consume:1,optional:1,subrule:1,many:1,or:1});n.rules.set(e.name,t.parser.rule(e,h7(n,e.definition)))}}function h7(t,e,n=!1){let r;if(oQ(e))r=b7(t,e);else if(HZ(e))r=u7(t,e);else if(ZZ(e))r=h7(t,e.terminal);else if(eQ(e))r=x7(t,e);else if(pQ(e))r=d7(t,e);else if(XZ(e))r=f7(t,e);else if(wQ(e))r=m7(t,e);else if(aQ(e))r=y7(t,e);else{if(!rQ(e))throw new PK(e.$cstNode,`Unexpected element type: ${e.$type}`);{const n=t.consume++;r=s((()=>t.parser.consume(n,X1,e)),"method")}}return w7(t,n?void 0:v7(e),r,e.cardinality)}function u7(t,e){const n=FJ(e);return()=>t.parser.action(n,e)}function d7(t,e){const n=e.rule.ref;if(LZ(n)){const r=t.subrule++,i=e.arguments.length>0?p7(n,e.arguments):()=>({});return a=>t.parser.subrule(r,k7(t,n),e,i(a))}if(FZ(n)){const r=t.consume++,i=_7(t,n.name);return()=>t.parser.consume(r,i,e)}if(!n)throw new PK(e.$cstNode,`Undefined rule type: ${e.$type}`);BK()}function p7(t,e){const n=e.map((t=>g7(t.value)));return e=>{const r={};for(let i=0;i<n.length;i++){const a=t.parameters[i],s=n[i];r[a.name]=s(e)}return r}}function g7(t){if(cZ(t)){const e=g7(t.left),n=g7(t.right);return t=>e(t)||n(t)}if(oZ(t)){const e=g7(t.left),n=g7(t.right);return t=>e(t)&&n(t)}if(wZ(t)){const e=g7(t.value);return t=>!e(t)}if(SZ(t)){const e=t.parameter.ref.name;return t=>void 0!==t&&!0===t[e]}if(aZ(t)){const e=Boolean(t.true);return()=>e}BK()}function f7(t,e){if(1===e.elements.length)return h7(t,e.elements[0]);{const n=[];for(const r of e.elements){const e={ALT:h7(t,r,!0)},i=v7(r);i&&(e.GATE=g7(i)),n.push(e)}const r=t.or++;return e=>t.parser.alternatives(r,n.map((t=>{const n={ALT:s((()=>t.ALT(e)),"ALT")},r=t.GATE;return r&&(n.GATE=()=>r(e)),n})))}}function m7(t,e){if(1===e.elements.length)return h7(t,e.elements[0]);const n=[];for(const r of e.elements){const e={ALT:h7(t,r,!0)},i=v7(r);i&&(e.GATE=g7(i)),n.push(e)}const r=t.or++,i=s(((t,e)=>`uGroup_${t}_${e.getRuleStack().join("-")}`),"idFunc"),a=s((e=>t.parser.alternatives(r,n.map(((n,a)=>{const o={ALT:s((()=>!0),"ALT")},l=t.parser;o.ALT=()=>{if(n.ALT(e),!l.isRecording()){const t=i(r,l);l.unorderedGroups.get(t)||l.unorderedGroups.set(t,[]);const e=l.unorderedGroups.get(t);void 0===(null==e?void 0:e[a])&&(e[a]=!0)}};const c=n.GATE;return o.GATE=c?()=>c(e):()=>{const t=l.unorderedGroups.get(i(r,l));return!(null==t?void 0:t[a])},o})))),"alternatives"),o=w7(t,v7(e),a,"*");return e=>{o(e),t.parser.isRecording()||t.parser.unorderedGroups.delete(i(r,t.parser))}}function y7(t,e){const n=e.elements.map((e=>h7(t,e)));return t=>n.forEach((e=>e(t)))}function v7(t){if(aQ(t))return t.guardCondition}function x7(t,e,n=e.terminal){if(n){if(pQ(n)&&LZ(n.rule.ref)){const r=t.subrule++;return i=>t.parser.subrule(r,k7(t,n.rule.ref),e,i)}if(pQ(n)&&FZ(n.rule.ref)){const r=t.consume++,i=_7(t,n.rule.ref.name);return()=>t.parser.consume(r,i,e)}if(oQ(n)){const r=t.consume++,i=_7(t,n.value);return()=>t.parser.consume(r,i,e)}throw new Error("Could not build cross reference parser")}{if(!e.type.ref)throw new Error("Could not resolve reference to type: "+e.type.$refText);const n=AJ(e.type.ref),r=null==n?void 0:n.terminal;if(!r)throw new Error("Could not find name assignment for type: "+FJ(e.type.ref));return x7(t,e,r)}}function b7(t,e){const n=t.consume++,r=t.tokens[e.value];if(!r)throw new Error("Could not find token for keyword: "+e.value);return()=>t.parser.consume(n,r,e)}function w7(t,e,n,r){const i=e&&g7(e);if(!r){if(i){const e=t.or++;return r=>t.parser.alternatives(e,[{ALT:s((()=>n(r)),"ALT"),GATE:s((()=>i(r)),"GATE")},{ALT:K4(),GATE:s((()=>!i(r)),"GATE")}])}return n}if("*"===r){const e=t.many++;return r=>t.parser.many(e,{DEF:s((()=>n(r)),"DEF"),GATE:i?()=>i(r):void 0})}if("+"===r){const e=t.many++;if(i){const r=t.or++;return a=>t.parser.alternatives(r,[{ALT:s((()=>t.parser.atLeastOne(e,{DEF:s((()=>n(a)),"DEF")})),"ALT"),GATE:s((()=>i(a)),"GATE")},{ALT:K4(),GATE:s((()=>!i(a)),"GATE")}])}return r=>t.parser.atLeastOne(e,{DEF:s((()=>n(r)),"DEF")})}if("?"===r){const e=t.optional++;return r=>t.parser.optional(e,{DEF:s((()=>n(r)),"DEF"),GATE:i?()=>i(r):void 0})}BK()}function k7(t,e){const n=T7(t,e),r=t.rules.get(n);if(!r)throw new Error(`Rule "${n}" not found."`);return r}function T7(t,e){if(LZ(e))return e.name;if(t.ruleNames.has(e))return t.ruleNames.get(e);{let n=e,r=n.$container,i=e.$type;for(;!LZ(r);){if(aQ(r)||XZ(r)||wQ(r)){i=r.elements.indexOf(n).toString()+":"+i}n=r,r=r.$container}return i=r.name+":"+i,t.ruleNames.set(e,i),i}}function _7(t,e){const n=t.tokens[e];if(!n)throw new Error(`Token "${e}" not found."`);return n}function E7(t){const e=t.Grammar,n=t.parser.Lexer,r=new a7(t);return l7(e,r,n.definition),r.finalize(),r}function C7(t){const e=S7(t);return e.finalize(),e}function S7(t){const e=t.Grammar,n=t.parser.Lexer;return l7(e,new n7(t),n.definition)}s(l7,"createParser"),s(c7,"buildRules"),s(h7,"buildElement"),s(u7,"buildAction"),s(d7,"buildRuleCall"),s(p7,"buildRuleCallPredicate"),s(g7,"buildPredicate"),s(f7,"buildAlternatives"),s(m7,"buildUnorderedGroup"),s(y7,"buildGroup"),s(v7,"getGuardCondition"),s(x7,"buildCrossReference"),s(b7,"buildKeyword"),s(w7,"wrap"),s(k7,"getRule"),s(T7,"getRuleName"),s(_7,"getToken"),s(E7,"createCompletionParser"),s(C7,"createLangiumParser"),s(S7,"prepareLangiumParser");var A7,L7=class{static{s(this,"DefaultTokenBuilder")}buildTokens(t,e){const n=hK(yJ(t,!1)),r=this.buildTerminalTokens(n),i=this.buildKeywordTokens(n,r,e);return r.forEach((t=>{const e=t.PATTERN;"object"==typeof e&&e&&"test"in e&&hJ(e)?i.unshift(t):i.push(t)})),i}buildTerminalTokens(t){return t.filter(FZ).filter((t=>!t.fragment)).map((t=>this.buildTerminalToken(t))).toArray()}buildTerminalToken(t){const e=GJ(t),n=this.requiresCustomPattern(e)?this.regexPatternFunction(e):e,r={name:t.name,PATTERN:n,LINE_BREAKS:!0};return t.hidden&&(r.GROUP=hJ(e)?j1.SKIPPED:"hidden"),r}requiresCustomPattern(t){return!!t.flags.includes("u")||!(!t.source.includes("?<=")&&!t.source.includes("?<!"))}regexPatternFunction(t){const e=new RegExp(t,t.flags+"y");return(t,n)=>{e.lastIndex=n;return e.exec(t)}}buildKeywordTokens(t,e,n){return t.filter(LZ).flatMap((t=>OQ(t).filter(oQ))).distinct((t=>t.value)).toArray().sort(((t,e)=>e.value.length-t.value.length)).map((t=>this.buildKeywordToken(t,e,Boolean(null==n?void 0:n.caseInsensitive))))}buildKeywordToken(t,e,n){return{name:t.value,PATTERN:this.buildKeywordPattern(t,n),LONGER_ALT:this.findLongerAlt(t,e)}}buildKeywordPattern(t,e){return e?new RegExp(dJ(t.value)):t.value}findLongerAlt(t,e){return e.reduce(((e,n)=>{const r=null==n?void 0:n.PATTERN;return(null==r?void 0:r.source)&&pJ("^"+r.source+"$",t.value)&&e.push(n),e}),[])}},N7=class{static{s(this,"DefaultValueConverter")}convert(t,e){let n=e.grammarSource;if(eQ(n)&&(n=xJ(n)),pQ(n)){const r=n.rule.ref;if(!r)throw new Error("This cst node was not parsed by a rule.");return this.runConverter(r,t,e)}return t}runConverter(t,e,n){var r;switch(t.name.toUpperCase()){case"INT":return A7.convertInt(e);case"STRING":return A7.convertString(e);case"ID":return A7.convertID(e)}switch(null===(r=UJ(t))||void 0===r?void 0:r.toLowerCase()){case"number":return A7.convertNumber(e);case"boolean":return A7.convertBoolean(e);case"bigint":return A7.convertBigint(e);case"date":return A7.convertDate(e);default:return e}}};!function(t){function e(t){let e="";for(let r=1;r<t.length-1;r++){const i=t.charAt(r);if("\\"===i){e+=n(t.charAt(++r))}else e+=i}return e}function n(t){switch(t){case"b":return"\b";case"f":return"\f";case"n":return"\n";case"r":return"\r";case"t":return"\t";case"v":return"\v";case"0":return"\0";default:return t}}function r(t){return"^"===t.charAt(0)?t.substring(1):t}function i(t){return parseInt(t)}function a(t){return BigInt(t)}function o(t){return new Date(t)}function l(t){return Number(t)}function c(t){return"true"===t.toLowerCase()}s(e,"convertString"),t.convertString=e,s(n,"convertEscapeCharacter"),s(r,"convertID"),t.convertID=r,s(i,"convertInt"),t.convertInt=i,s(a,"convertBigint"),t.convertBigint=a,s(o,"convertDate"),t.convertDate=o,s(l,"convertNumber"),t.convertNumber=l,s(c,"convertBoolean"),t.convertBoolean=c}(A7||(A7={}));var I7={};function M7(){return new Promise((t=>{"undefined"==typeof setImmediate?setTimeout(t,0):setImmediate(t)}))}u(I7,d(VX(),1)),s(M7,"delayNextTick");var R7=0,D7=10;function O7(){return R7=Date.now(),new I7.CancellationTokenSource}function P7(t){D7=t}s(O7,"startCancelableOperation"),s(P7,"setInterruptionPeriod");var B7=Symbol("OperationCancelled");function $7(t){return t===B7}async function F7(t){if(t===I7.CancellationToken.None)return;const e=Date.now();if(e-R7>=D7&&(R7=e,await M7()),t.isCancellationRequested)throw B7}s($7,"isOperationCancelled"),s(F7,"interruptAndCheck");var z7,U7,G7=class{static{s(this,"Deferred")}constructor(){this.promise=new Promise(((t,e)=>{this.resolve=e=>(t(e),this),this.reject=t=>(e(t),this)}))}},q7=class t{static{s(this,"FullTextDocument")}constructor(t,e,n,r){this._uri=t,this._languageId=e,this._version=n,this._content=r,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(t){if(t){const e=this.offsetAt(t.start),n=this.offsetAt(t.end);return this._content.substring(e,n)}return this._content}update(e,n){for(const n of e)if(t.isIncremental(n)){const t=H7(n.range),e=this.offsetAt(t.start),r=this.offsetAt(t.end);this._content=this._content.substring(0,e)+n.text+this._content.substring(r,this._content.length);const i=Math.max(t.start.line,0),a=Math.max(t.end.line,0);let s=this._lineOffsets;const o=Y7(n.text,!1,e);if(a-i===o.length)for(let t=0,e=o.length;t<e;t++)s[t+i+1]=o[t];else o.length<1e4?s.splice(i+1,a-i,...o):this._lineOffsets=s=s.slice(0,i+1).concat(o,s.slice(a+1));const l=n.text.length-(r-e);if(0!==l)for(let t=i+1+o.length,e=s.length;t<e;t++)s[t]=s[t]+l}else{if(!t.isFull(n))throw new Error("Unknown change event received");this._content=n.text,this._lineOffsets=void 0}this._version=n}getLineOffsets(){return void 0===this._lineOffsets&&(this._lineOffsets=Y7(this._content,!0)),this._lineOffsets}positionAt(t){t=Math.max(Math.min(t,this._content.length),0);const e=this.getLineOffsets();let n=0,r=e.length;if(0===r)return{line:0,character:t};for(;n<r;){const i=Math.floor((n+r)/2);e[i]>t?r=i:n=i+1}const i=n-1;return{line:i,character:(t=this.ensureBeforeEOL(t,e[i]))-e[i]}}offsetAt(t){const e=this.getLineOffsets();if(t.line>=e.length)return this._content.length;if(t.line<0)return 0;const n=e[t.line];if(t.character<=0)return n;const r=t.line+1<e.length?e[t.line+1]:this._content.length,i=Math.min(n+t.character,r);return this.ensureBeforeEOL(i,n)}ensureBeforeEOL(t,e){for(;t>e&&W7(this._content.charCodeAt(t-1));)t--;return t}get lineCount(){return this.getLineOffsets().length}static isIncremental(t){const e=t;return null!=e&&"string"==typeof e.text&&void 0!==e.range&&(void 0===e.rangeLength||"number"==typeof e.rangeLength)}static isFull(t){const e=t;return null!=e&&"string"==typeof e.text&&void 0===e.range&&void 0===e.rangeLength}};function j7(t,e){if(t.length<=1)return t;const n=t.length/2|0,r=t.slice(0,n),i=t.slice(n);j7(r,e),j7(i,e);let a=0,s=0,o=0;for(;a<r.length&&s<i.length;){const n=e(r[a],i[s]);t[o++]=n<=0?r[a++]:i[s++]}for(;a<r.length;)t[o++]=r[a++];for(;s<i.length;)t[o++]=i[s++];return t}function Y7(t,e,n=0){const r=e?[n]:[];for(let e=0;e<t.length;e++){const i=t.charCodeAt(e);W7(i)&&(13===i&&e+1<t.length&&10===t.charCodeAt(e+1)&&e++,r.push(n+e+1))}return r}function W7(t){return 13===t||10===t}function H7(t){const e=t.start,n=t.end;return e.line>n.line||e.line===n.line&&e.character>n.character?{start:n,end:e}:t}function V7(t){const e=H7(t.range);return e!==t.range?{newText:t.newText,range:e}:t}!function(t){function e(t,e,n,r){return new q7(t,e,n,r)}function n(t,e,n){if(t instanceof q7)return t.update(e,n),t;throw new Error("TextDocument.update: document must be created by TextDocument.create")}function r(t,e){const n=t.getText(),r=j7(e.map(V7),((t,e)=>{const n=t.range.start.line-e.range.start.line;return 0===n?t.range.start.character-e.range.start.character:n}));let i=0;const a=[];for(const e of r){const r=t.offsetAt(e.range.start);if(r<i)throw new Error("Overlapping edit");r>i&&a.push(n.substring(i,r)),e.newText.length&&a.push(e.newText),i=t.offsetAt(e.range.end)}return a.push(n.substr(i)),a.join("")}s(e,"create"),t.create=e,s(n,"update"),t.update=n,s(r,"applyEdits"),t.applyEdits=r}(z7||(z7={})),s(j7,"mergeSort"),s(Y7,"computeLineOffsets"),s(W7,"isEOL"),s(H7,"getWellformedRange"),s(V7,"getWellformedEdit"),(()=>{var t={470:t=>{function e(t){if("string"!=typeof t)throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}function n(t,e){for(var n,r="",i=0,a=-1,s=0,o=0;o<=t.length;++o){if(o<t.length)n=t.charCodeAt(o);else{if(47===n)break;n=47}if(47===n){if(a===o-1||1===s);else if(a!==o-1&&2===s){if(r.length<2||2!==i||46!==r.charCodeAt(r.length-1)||46!==r.charCodeAt(r.length-2))if(r.length>2){var l=r.lastIndexOf("/");if(l!==r.length-1){-1===l?(r="",i=0):i=(r=r.slice(0,l)).length-1-r.lastIndexOf("/"),a=o,s=0;continue}}else if(2===r.length||1===r.length){r="",i=0,a=o,s=0;continue}e&&(r.length>0?r+="/..":r="..",i=2)}else r.length>0?r+="/"+t.slice(a+1,o):r=t.slice(a+1,o),i=o-a-1;a=o,s=0}else 46===n&&-1!==s?++s:s=-1}return r}s(e,"e"),s(n,"r");var r={resolve:s((function(){for(var t,r="",i=!1,a=arguments.length-1;a>=-1&&!i;a--){var s;a>=0?s=arguments[a]:(void 0===t&&(t=process.cwd()),s=t),e(s),0!==s.length&&(r=s+"/"+r,i=47===s.charCodeAt(0))}return r=n(r,!i),i?r.length>0?"/"+r:"/":r.length>0?r:"."}),"resolve"),normalize:s((function(t){if(e(t),0===t.length)return".";var r=47===t.charCodeAt(0),i=47===t.charCodeAt(t.length-1);return 0!==(t=n(t,!r)).length||r||(t="."),t.length>0&&i&&(t+="/"),r?"/"+t:t}),"normalize"),isAbsolute:s((function(t){return e(t),t.length>0&&47===t.charCodeAt(0)}),"isAbsolute"),join:s((function(){if(0===arguments.length)return".";for(var t,n=0;n<arguments.length;++n){var i=arguments[n];e(i),i.length>0&&(void 0===t?t=i:t+="/"+i)}return void 0===t?".":r.normalize(t)}),"join"),relative:s((function(t,n){if(e(t),e(n),t===n)return"";if((t=r.resolve(t))===(n=r.resolve(n)))return"";for(var i=1;i<t.length&&47===t.charCodeAt(i);++i);for(var a=t.length,s=a-i,o=1;o<n.length&&47===n.charCodeAt(o);++o);for(var l=n.length-o,c=s<l?s:l,h=-1,u=0;u<=c;++u){if(u===c){if(l>c){if(47===n.charCodeAt(o+u))return n.slice(o+u+1);if(0===u)return n.slice(o+u)}else s>c&&(47===t.charCodeAt(i+u)?h=u:0===u&&(h=0));break}var d=t.charCodeAt(i+u);if(d!==n.charCodeAt(o+u))break;47===d&&(h=u)}var p="";for(u=i+h+1;u<=a;++u)u!==a&&47!==t.charCodeAt(u)||(0===p.length?p+="..":p+="/..");return p.length>0?p+n.slice(o+h):(o+=h,47===n.charCodeAt(o)&&++o,n.slice(o))}),"relative"),_makeLong:s((function(t){return t}),"_makeLong"),dirname:s((function(t){if(e(t),0===t.length)return".";for(var n=t.charCodeAt(0),r=47===n,i=-1,a=!0,s=t.length-1;s>=1;--s)if(47===(n=t.charCodeAt(s))){if(!a){i=s;break}}else a=!1;return-1===i?r?"/":".":r&&1===i?"//":t.slice(0,i)}),"dirname"),basename:s((function(t,n){if(void 0!==n&&"string"!=typeof n)throw new TypeError('"ext" argument must be a string');e(t);var r,i=0,a=-1,s=!0;if(void 0!==n&&n.length>0&&n.length<=t.length){if(n.length===t.length&&n===t)return"";var o=n.length-1,l=-1;for(r=t.length-1;r>=0;--r){var c=t.charCodeAt(r);if(47===c){if(!s){i=r+1;break}}else-1===l&&(s=!1,l=r+1),o>=0&&(c===n.charCodeAt(o)?-1==--o&&(a=r):(o=-1,a=l))}return i===a?a=l:-1===a&&(a=t.length),t.slice(i,a)}for(r=t.length-1;r>=0;--r)if(47===t.charCodeAt(r)){if(!s){i=r+1;break}}else-1===a&&(s=!1,a=r+1);return-1===a?"":t.slice(i,a)}),"basename"),extname:s((function(t){e(t);for(var n=-1,r=0,i=-1,a=!0,s=0,o=t.length-1;o>=0;--o){var l=t.charCodeAt(o);if(47!==l)-1===i&&(a=!1,i=o+1),46===l?-1===n?n=o:1!==s&&(s=1):-1!==n&&(s=-1);else if(!a){r=o+1;break}}return-1===n||-1===i||0===s||1===s&&n===i-1&&n===r+1?"":t.slice(n,i)}),"extname"),format:s((function(t){if(null===t||"object"!=typeof t)throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof t);return n=(e=t).dir||e.root,r=e.base||(e.name||"")+(e.ext||""),n?n===e.root?n+r:n+"/"+r:r;var e,n,r}),"format"),parse:s((function(t){e(t);var n={root:"",dir:"",base:"",ext:"",name:""};if(0===t.length)return n;var r,i=t.charCodeAt(0),a=47===i;a?(n.root="/",r=1):r=0;for(var s=-1,o=0,l=-1,c=!0,h=t.length-1,u=0;h>=r;--h)if(47!==(i=t.charCodeAt(h)))-1===l&&(c=!1,l=h+1),46===i?-1===s?s=h:1!==u&&(u=1):-1!==s&&(u=-1);else if(!c){o=h+1;break}return-1===s||-1===l||0===u||1===u&&s===l-1&&s===o+1?-1!==l&&(n.base=n.name=0===o&&a?t.slice(1,l):t.slice(o,l)):(0===o&&a?(n.name=t.slice(1,s),n.base=t.slice(1,l)):(n.name=t.slice(o,s),n.base=t.slice(o,l)),n.ext=t.slice(s,l)),o>0?n.dir=t.slice(0,o-1):a&&(n.dir="/"),n}),"parse"),sep:"/",delimiter:":",win32:null,posix:null};r.posix=r,t.exports=r}},e={};function n(r){var i=e[r];if(void 0!==i)return i.exports;var a=e[r]={exports:{}};return t[r](a,a.exports,n),a.exports}s(n,"r"),n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var r={};(()=>{let t;if(n.r(r),n.d(r,{URI:s((()=>u),"URI"),Utils:s((()=>E),"Utils")}),"object"==typeof process)t="win32"===process.platform;else if("object"==typeof navigator){let e=navigator.userAgent;t=e.indexOf("Windows")>=0}const e=/^\w[\w\d+.-]*$/,i=/^\//,a=/^\/\//;function o(t,n){if(!t.scheme&&n)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${t.authority}", path: "${t.path}", query: "${t.query}", fragment: "${t.fragment}"}`);if(t.scheme&&!e.test(t.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(t.path)if(t.authority){if(!i.test(t.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(a.test(t.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}s(o,"s");const l="",c="/",h=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class u{static{s(this,"f")}static isUri(t){return t instanceof u||!!t&&"string"==typeof t.authority&&"string"==typeof t.fragment&&"string"==typeof t.path&&"string"==typeof t.query&&"string"==typeof t.scheme&&"string"==typeof t.fsPath&&"function"==typeof t.with&&"function"==typeof t.toString}scheme;authority;path;query;fragment;constructor(t,e,n,r,i,a=!1){"object"==typeof t?(this.scheme=t.scheme||l,this.authority=t.authority||l,this.path=t.path||l,this.query=t.query||l,this.fragment=t.fragment||l):(this.scheme=function(t,e){return t||e?t:"file"}(t,a),this.authority=e||l,this.path=function(t,e){switch(t){case"https":case"http":case"file":e?e[0]!==c&&(e=c+e):e=c}return e}(this.scheme,n||l),this.query=r||l,this.fragment=i||l,o(this,a))}get fsPath(){return y(this,!1)}with(t){if(!t)return this;let{scheme:e,authority:n,path:r,query:i,fragment:a}=t;return void 0===e?e=this.scheme:null===e&&(e=l),void 0===n?n=this.authority:null===n&&(n=l),void 0===r?r=this.path:null===r&&(r=l),void 0===i?i=this.query:null===i&&(i=l),void 0===a?a=this.fragment:null===a&&(a=l),e===this.scheme&&n===this.authority&&r===this.path&&i===this.query&&a===this.fragment?this:new p(e,n,r,i,a)}static parse(t,e=!1){const n=h.exec(t);return n?new p(n[2]||l,w(n[4]||l),w(n[5]||l),w(n[7]||l),w(n[9]||l),e):new p(l,l,l,l,l)}static file(e){let n=l;if(t&&(e=e.replace(/\\/g,c)),e[0]===c&&e[1]===c){const t=e.indexOf(c,2);-1===t?(n=e.substring(2),e=c):(n=e.substring(2,t),e=e.substring(t)||c)}return new p("file",n,e,l,l)}static from(t){const e=new p(t.scheme,t.authority,t.path,t.query,t.fragment);return o(e,!0),e}toString(t=!1){return v(this,t)}toJSON(){return this}static revive(t){if(t){if(t instanceof u)return t;{const e=new p(t);return e._formatted=t.external,e._fsPath=t._sep===d?t.fsPath:null,e}}return t}}const d=t?1:void 0;class p extends u{static{s(this,"l")}_formatted=null;_fsPath=null;get fsPath(){return this._fsPath||(this._fsPath=y(this,!1)),this._fsPath}toString(t=!1){return t?v(this,!0):(this._formatted||(this._formatted=v(this,!1)),this._formatted)}toJSON(){const t={$mid:1};return this._fsPath&&(t.fsPath=this._fsPath,t._sep=d),this._formatted&&(t.external=this._formatted),this.path&&(t.path=this.path),this.scheme&&(t.scheme=this.scheme),this.authority&&(t.authority=this.authority),this.query&&(t.query=this.query),this.fragment&&(t.fragment=this.fragment),t}}const g={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 f(t,e,n){let r,i=-1;for(let a=0;a<t.length;a++){const s=t.charCodeAt(a);if(s>=97&&s<=122||s>=65&&s<=90||s>=48&&s<=57||45===s||46===s||95===s||126===s||e&&47===s||n&&91===s||n&&93===s||n&&58===s)-1!==i&&(r+=encodeURIComponent(t.substring(i,a)),i=-1),void 0!==r&&(r+=t.charAt(a));else{void 0===r&&(r=t.substr(0,a));const e=g[s];void 0!==e?(-1!==i&&(r+=encodeURIComponent(t.substring(i,a)),i=-1),r+=e):-1===i&&(i=a)}}return-1!==i&&(r+=encodeURIComponent(t.substring(i))),void 0!==r?r:t}function m(t){let e;for(let n=0;n<t.length;n++){const r=t.charCodeAt(n);35===r||63===r?(void 0===e&&(e=t.substr(0,n)),e+=g[r]):void 0!==e&&(e+=t[n])}return void 0!==e?e:t}function y(e,n){let r;return r=e.authority&&e.path.length>1&&"file"===e.scheme?`//${e.authority}${e.path}`:47===e.path.charCodeAt(0)&&(e.path.charCodeAt(1)>=65&&e.path.charCodeAt(1)<=90||e.path.charCodeAt(1)>=97&&e.path.charCodeAt(1)<=122)&&58===e.path.charCodeAt(2)?n?e.path.substr(1):e.path[1].toLowerCase()+e.path.substr(2):e.path,t&&(r=r.replace(/\//g,"\\")),r}function v(t,e){const n=e?m:f;let r="",{scheme:i,authority:a,path:s,query:o,fragment:l}=t;if(i&&(r+=i,r+=":"),(a||"file"===i)&&(r+=c,r+=c),a){let t=a.indexOf("@");if(-1!==t){const e=a.substr(0,t);a=a.substr(t+1),t=e.lastIndexOf(":"),-1===t?r+=n(e,!1,!1):(r+=n(e.substr(0,t),!1,!1),r+=":",r+=n(e.substr(t+1),!1,!0)),r+="@"}a=a.toLowerCase(),t=a.lastIndexOf(":"),-1===t?r+=n(a,!1,!0):(r+=n(a.substr(0,t),!1,!0),r+=a.substr(t))}if(s){if(s.length>=3&&47===s.charCodeAt(0)&&58===s.charCodeAt(2)){const t=s.charCodeAt(1);t>=65&&t<=90&&(s=`/${String.fromCharCode(t+32)}:${s.substr(3)}`)}else if(s.length>=2&&58===s.charCodeAt(1)){const t=s.charCodeAt(0);t>=65&&t<=90&&(s=`${String.fromCharCode(t+32)}:${s.substr(2)}`)}r+=n(s,!0,!1)}return o&&(r+="?",r+=n(o,!1,!1)),l&&(r+="#",r+=e?l:f(l,!1,!1)),r}function x(t){try{return decodeURIComponent(t)}catch{return t.length>3?t.substr(0,3)+x(t.substr(3)):t}}s(f,"d"),s(m,"p"),s(y,"m"),s(v,"y"),s(x,"v");const b=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function w(t){return t.match(b)?t.replace(b,(t=>x(t))):t}s(w,"C");var k=n(470);const T=k.posix||k,_="/";var E;!function(t){t.joinPath=function(t,...e){return t.with({path:T.join(t.path,...e)})},t.resolvePath=function(t,...e){let n=t.path,r=!1;n[0]!==_&&(n=_+n,r=!0);let i=T.resolve(n,...e);return r&&i[0]===_&&!t.authority&&(i=i.substring(1)),t.with({path:i})},t.dirname=function(t){if(0===t.path.length||t.path===_)return t;let e=T.dirname(t.path);return 1===e.length&&46===e.charCodeAt(0)&&(e=""),t.with({path:e})},t.basename=function(t){return T.basename(t.path)},t.extname=function(t){return T.extname(t.path)}}(E||(E={}))})(),U7=r})();var X7,K7,Z7,{URI:Q7,Utils:J7}=U7;!function(t){function e(t,e){return(null==t?void 0:t.toString())===(null==e?void 0:e.toString())}function n(t,e){const n="string"==typeof t?t:t.path,r="string"==typeof e?e:e.path,i=n.split("/").filter((t=>t.length>0)),a=r.split("/").filter((t=>t.length>0));let s=0;for(;s<i.length&&i[s]===a[s];s++);return"../".repeat(i.length-s)+a.slice(s).join("/")}t.basename=J7.basename,t.dirname=J7.dirname,t.extname=J7.extname,t.joinPath=J7.joinPath,t.resolvePath=J7.resolvePath,s(e,"equals"),t.equals=e,s(n,"relative"),t.relative=n}(X7||(X7={})),(Z7=K7||(K7={}))[Z7.Changed=0]="Changed",Z7[Z7.Parsed=1]="Parsed",Z7[Z7.IndexedContent=2]="IndexedContent",Z7[Z7.ComputedScopes=3]="ComputedScopes",Z7[Z7.Linked=4]="Linked",Z7[Z7.IndexedReferences=5]="IndexedReferences",Z7[Z7.Validated=6]="Validated";var t8=class{static{s(this,"DefaultLangiumDocumentFactory")}constructor(t){this.serviceRegistry=t.ServiceRegistry,this.textDocuments=t.workspace.TextDocuments,this.fileSystemProvider=t.workspace.FileSystemProvider}async fromUri(t,e=I7.CancellationToken.None){const n=await this.fileSystemProvider.readFile(t);return this.createAsync(t,n,e)}fromTextDocument(t,e,n){return e=null!=e?e:Q7.parse(t.uri),n?this.createAsync(e,t,n):this.create(e,t)}fromString(t,e,n){return n?this.createAsync(e,t,n):this.create(e,t)}fromModel(t,e){return this.create(e,{$model:t})}create(t,e){if("string"==typeof e){const n=this.parse(t,e);return this.createLangiumDocument(n,t,void 0,e)}if("$model"in e){const n={value:e.$model,parserErrors:[],lexerErrors:[]};return this.createLangiumDocument(n,t)}{const n=this.parse(t,e.getText());return this.createLangiumDocument(n,t,e)}}async createAsync(t,e,n){if("string"==typeof e){const r=await this.parseAsync(t,e,n);return this.createLangiumDocument(r,t,void 0,e)}{const r=await this.parseAsync(t,e.getText(),n);return this.createLangiumDocument(r,t,e)}}createLangiumDocument(t,e,n,r){let i;if(n)i={parseResult:t,uri:e,state:K7.Parsed,references:[],textDocument:n};else{const n=this.createTextDocumentGetter(e,r);i={parseResult:t,uri:e,state:K7.Parsed,references:[],get textDocument(){return n()}}}return t.value.$document=i,i}async update(t,e){var n,r;const i=null===(n=t.parseResult.value.$cstNode)||void 0===n?void 0:n.root.fullText,a=null===(r=this.textDocuments)||void 0===r?void 0:r.get(t.uri.toString()),s=a?a.getText():await this.fileSystemProvider.readFile(t.uri);if(a)Object.defineProperty(t,"textDocument",{value:a});else{const e=this.createTextDocumentGetter(t.uri,s);Object.defineProperty(t,"textDocument",{get:e})}return i!==s&&(t.parseResult=await this.parseAsync(t.uri,s,e),t.parseResult.value.$document=t),t.state=K7.Parsed,t}parse(t,e){return this.serviceRegistry.getServices(t).parser.LangiumParser.parse(e)}parseAsync(t,e,n){return this.serviceRegistry.getServices(t).parser.AsyncParser.parse(e,n)}createTextDocumentGetter(t,e){const n=this.serviceRegistry;let r;return()=>null!=r?r:r=z7.create(t.toString(),n.getServices(t).LanguageMetaData.languageId,0,null!=e?e:"")}},e8=class{static{s(this,"DefaultLangiumDocuments")}constructor(t){this.documentMap=new Map,this.langiumDocumentFactory=t.workspace.LangiumDocumentFactory}get all(){return hK(this.documentMap.values())}addDocument(t){const e=t.uri.toString();if(this.documentMap.has(e))throw new Error(`A document with the URI '${e}' is already present.`);this.documentMap.set(e,t)}getDocument(t){const e=t.toString();return this.documentMap.get(e)}async getOrCreateDocument(t,e){let n=this.getDocument(t);return n||(n=await this.langiumDocumentFactory.fromUri(t,e),this.addDocument(n),n)}createDocument(t,e,n){if(n)return this.langiumDocumentFactory.fromString(e,t,n).then((t=>(this.addDocument(t),t)));{const n=this.langiumDocumentFactory.fromString(e,t);return this.addDocument(n),n}}hasDocument(t){return this.documentMap.has(t.toString())}invalidateDocument(t){const e=t.toString(),n=this.documentMap.get(e);return n&&(n.state=K7.Changed,n.precomputedScopes=void 0,n.references=[],n.diagnostics=void 0),n}deleteDocument(t){const e=t.toString(),n=this.documentMap.get(e);return n&&(n.state=K7.Changed,this.documentMap.delete(e)),n}},n8=class{static{s(this,"DefaultLinker")}constructor(t){this.reflection=t.shared.AstReflection,this.langiumDocuments=()=>t.shared.workspace.LangiumDocuments,this.scopeProvider=t.references.ScopeProvider,this.astNodeLocator=t.workspace.AstNodeLocator}async link(t,e=I7.CancellationToken.None){for(const n of PQ(t.parseResult.value))await F7(e),$Q(n).forEach((e=>this.doLink(e,t)))}doLink(t,e){const n=t.reference;if(void 0===n._ref)try{const e=this.getCandidate(t);if(tK(e))n._ref=e;else if(n._nodeDescription=e,this.langiumDocuments().hasDocument(e.documentUri)){const r=this.loadAstNode(e);n._ref=null!=r?r:this.createLinkingError(t,e)}}catch(e){n._ref=Object.assign(Object.assign({},t),{message:`An error occurred while resolving reference to '${n.$refText}': ${e}`})}e.references.push(n)}unlink(t){for(const e of t.references)delete e._ref,delete e._nodeDescription;t.references=[]}getCandidate(t){const e=this.scopeProvider.getScope(t).getElement(t.reference.$refText);return null!=e?e:this.createLinkingError(t)}buildReference(t,e,n,r){const i=this,a={$refNode:n,$refText:r,get ref(){var n;if(ZX(this._ref))return this._ref;if(JX(this._nodeDescription)){const n=i.loadAstNode(this._nodeDescription);this._ref=null!=n?n:i.createLinkingError({reference:a,container:t,property:e},this._nodeDescription)}else if(void 0===this._ref){const r=i.getLinkedNode({reference:a,container:t,property:e});if(r.error&&MQ(t).state<K7.ComputedScopes)return;this._ref=null!==(n=r.node)&&void 0!==n?n:r.error,this._nodeDescription=r.descr}return ZX(this._ref)?this._ref:void 0},get $nodeDescription(){return this._nodeDescription},get error(){return tK(this._ref)?this._ref:void 0}};return a}getLinkedNode(t){try{const e=this.getCandidate(t);if(tK(e))return{error:e};const n=this.loadAstNode(e);return n?{node:n,descr:e}:{descr:e,error:this.createLinkingError(t,e)}}catch(e){return{error:Object.assign(Object.assign({},t),{message:`An error occurred while resolving reference to '${t.reference.$refText}': ${e}`})}}}loadAstNode(t){if(t.node)return t.node;const e=this.langiumDocuments().getDocument(t.documentUri);return e?this.astNodeLocator.getAstNode(e.parseResult.value,t.path):void 0}createLinkingError(t,e){const n=MQ(t.container);n.state<K7.ComputedScopes&&console.warn(`Attempted reference resolution before document reached ComputedScopes state (${n.uri}).`);const r=this.reflection.getReferenceType(t);return Object.assign(Object.assign({},t),{message:`Could not resolve reference to ${r} named '${t.reference.$refText}'.`,targetDescription:e})}};function r8(t){return"string"==typeof t.name}s(r8,"isNamed");var i8=class{static{s(this,"DefaultNameProvider")}getName(t){if(r8(t))return t.name}getNameNode(t){return kJ(t.$cstNode,"name")}},a8=class{static{s(this,"DefaultReferences")}constructor(t){this.nameProvider=t.references.NameProvider,this.index=t.shared.workspace.IndexManager,this.nodeLocator=t.workspace.AstNodeLocator}findDeclaration(t){if(t){const e=SJ(t),n=t.astNode;if(e&&n){const r=n[e.feature];if(QX(r))return r.ref;if(Array.isArray(r))for(const e of r)if(QX(e)&&e.$refNode&&e.$refNode.offset<=t.offset&&e.$refNode.end>=t.end)return e.ref}if(n){const e=this.nameProvider.getNameNode(n);if(e&&(e===t||yK(t,e)))return n}}}findDeclarationNode(t){const e=this.findDeclaration(t);if(null==e?void 0:e.$cstNode){const t=this.nameProvider.getNameNode(e);return null!=t?t:e.$cstNode}}findReferences(t,e){const n=[];if(e.includeDeclaration){const e=this.getReferenceToSelf(t);e&&n.push(e)}let r=this.index.findAllReferences(t,this.nodeLocator.getAstNodePath(t));return e.documentUri&&(r=r.filter((t=>X7.equals(t.sourceUri,e.documentUri)))),n.push(...r),hK(n)}getReferenceToSelf(t){const e=this.nameProvider.getNameNode(t);if(e){const n=MQ(t),r=this.nodeLocator.getAstNodePath(t);return{sourceUri:n.uri,sourcePath:r,targetUri:n.uri,targetPath:r,segment:xK(e),local:!0}}}},s8=class{static{s(this,"MultiMap")}constructor(t){if(this.map=new Map,t)for(const[e,n]of t)this.add(e,n)}get size(){return uK.sum(hK(this.map.values()).map((t=>t.length)))}clear(){this.map.clear()}delete(t,e){if(void 0===e)return this.map.delete(t);{const n=this.map.get(t);if(n){const r=n.indexOf(e);if(r>=0)return 1===n.length?this.map.delete(t):n.splice(r,1),!0}return!1}}get(t){var e;return null!==(e=this.map.get(t))&&void 0!==e?e:[]}has(t,e){if(void 0===e)return this.map.has(t);{const n=this.map.get(t);return!!n&&n.indexOf(e)>=0}}add(t,e){return this.map.has(t)?this.map.get(t).push(e):this.map.set(t,[e]),this}addAll(t,e){return this.map.has(t)?this.map.get(t).push(...e):this.map.set(t,Array.from(e)),this}forEach(t){this.map.forEach(((e,n)=>e.forEach((e=>t(e,n,this)))))}[Symbol.iterator](){return this.entries().iterator()}entries(){return hK(this.map.entries()).flatMap((([t,e])=>e.map((e=>[t,e]))))}keys(){return hK(this.map.keys())}values(){return hK(this.map.values()).flat()}entriesGroupedByKey(){return hK(this.map.entries())}},o8=class{static{s(this,"BiMap")}get size(){return this.map.size}constructor(t){if(this.map=new Map,this.inverse=new Map,t)for(const[e,n]of t)this.set(e,n)}clear(){this.map.clear(),this.inverse.clear()}set(t,e){return this.map.set(t,e),this.inverse.set(e,t),this}get(t){return this.map.get(t)}getKey(t){return this.inverse.get(t)}delete(t){const e=this.map.get(t);return void 0!==e&&(this.map.delete(t),this.inverse.delete(e),!0)}},l8=class{static{s(this,"DefaultScopeComputation")}constructor(t){this.nameProvider=t.references.NameProvider,this.descriptions=t.workspace.AstNodeDescriptionProvider}async computeExports(t,e=I7.CancellationToken.None){return this.computeExportsForNode(t.parseResult.value,t,void 0,e)}async computeExportsForNode(t,e,n=DQ,r=I7.CancellationToken.None){const i=[];this.exportNode(t,i,e);for(const a of n(t))await F7(r),this.exportNode(a,i,e);return i}exportNode(t,e,n){const r=this.nameProvider.getName(t);r&&e.push(this.descriptions.createDescription(t,r,n))}async computeLocalScopes(t,e=I7.CancellationToken.None){const n=t.parseResult.value,r=new s8;for(const i of OQ(n))await F7(e),this.processNode(i,t,r);return r}processNode(t,e,n){const r=t.$container;if(r){const i=this.nameProvider.getName(t);i&&n.add(r,this.descriptions.createDescription(t,i,e))}}},c8=class{static{s(this,"StreamScope")}constructor(t,e,n){var r;this.elements=t,this.outerScope=e,this.caseInsensitive=null!==(r=null==n?void 0:n.caseInsensitive)&&void 0!==r&&r}getAllElements(){return this.outerScope?this.elements.concat(this.outerScope.getAllElements()):this.elements}getElement(t){const e=this.caseInsensitive?this.elements.find((e=>e.name.toLowerCase()===t.toLowerCase())):this.elements.find((e=>e.name===t));return e||(this.outerScope?this.outerScope.getElement(t):void 0)}},h8=class{static{s(this,"MapScope")}constructor(t,e,n){var r;this.elements=new Map,this.caseInsensitive=null!==(r=null==n?void 0:n.caseInsensitive)&&void 0!==r&&r;for(const e of t){const t=this.caseInsensitive?e.name.toLowerCase():e.name;this.elements.set(t,e)}this.outerScope=e}getElement(t){const e=this.caseInsensitive?t.toLowerCase():t,n=this.elements.get(e);return n||(this.outerScope?this.outerScope.getElement(t):void 0)}getAllElements(){let t=hK(this.elements.values());return this.outerScope&&(t=t.concat(this.outerScope.getAllElements())),t}},u8={getElement(){},getAllElements:()=>lK},d8=class{static{s(this,"DisposableCache")}constructor(){this.toDispose=[],this.isDisposed=!1}onDispose(t){this.toDispose.push(t)}dispose(){this.throwIfDisposed(),this.clear(),this.isDisposed=!0,this.toDispose.forEach((t=>t.dispose()))}throwIfDisposed(){if(this.isDisposed)throw new Error("This cache has already been disposed")}},p8=class extends d8{static{s(this,"SimpleCache")}constructor(){super(...arguments),this.cache=new Map}has(t){return this.throwIfDisposed(),this.cache.has(t)}set(t,e){this.throwIfDisposed(),this.cache.set(t,e)}get(t,e){if(this.throwIfDisposed(),this.cache.has(t))return this.cache.get(t);if(e){const n=e();return this.cache.set(t,n),n}}delete(t){return this.throwIfDisposed(),this.cache.delete(t)}clear(){this.throwIfDisposed(),this.cache.clear()}},g8=class extends d8{static{s(this,"ContextCache")}constructor(t){super(),this.cache=new Map,this.converter=null!=t?t:t=>t}has(t,e){return this.throwIfDisposed(),this.cacheForContext(t).has(e)}set(t,e,n){this.throwIfDisposed(),this.cacheForContext(t).set(e,n)}get(t,e,n){this.throwIfDisposed();const r=this.cacheForContext(t);if(r.has(e))return r.get(e);if(n){const t=n();return r.set(e,t),t}}delete(t,e){return this.throwIfDisposed(),this.cacheForContext(t).delete(e)}clear(t){if(this.throwIfDisposed(),t){const e=this.converter(t);this.cache.delete(e)}else this.cache.clear()}cacheForContext(t){const e=this.converter(t);let n=this.cache.get(e);return n||(n=new Map,this.cache.set(e,n)),n}},f8=class extends g8{static{s(this,"DocumentCache")}constructor(t){super((t=>t.toString())),this.onDispose(t.workspace.DocumentBuilder.onUpdate(((t,e)=>{const n=t.concat(e);for(const t of n)this.clear(t)})))}},m8=class extends p8{static{s(this,"WorkspaceCache")}constructor(t){super(),this.onDispose(t.workspace.DocumentBuilder.onUpdate((()=>{this.clear()})))}},y8=class{static{s(this,"DefaultScopeProvider")}constructor(t){this.reflection=t.shared.AstReflection,this.nameProvider=t.references.NameProvider,this.descriptions=t.workspace.AstNodeDescriptionProvider,this.indexManager=t.shared.workspace.IndexManager,this.globalScopeCache=new m8(t.shared)}getScope(t){const e=[],n=this.reflection.getReferenceType(t),r=MQ(t.container).precomputedScopes;if(r){let i=t.container;do{const t=r.get(i);t.length>0&&e.push(hK(t).filter((t=>this.reflection.isSubtype(t.type,n)))),i=i.$container}while(i)}let i=this.getGlobalScope(n,t);for(let t=e.length-1;t>=0;t--)i=this.createScope(e[t],i);return i}createScope(t,e,n){return new c8(hK(t),e,n)}createScopeForNodes(t,e,n){const r=hK(t).map((t=>{const e=this.nameProvider.getName(t);if(e)return this.descriptions.createDescription(t,e)})).nonNullable();return new c8(r,e,n)}getGlobalScope(t,e){return this.globalScopeCache.get(t,(()=>new h8(this.indexManager.allElements(t))))}};function v8(t){return"string"==typeof t.$comment}function x8(t){return"object"==typeof t&&!!t&&("$ref"in t||"$error"in t)}s(v8,"isAstNodeWithComment"),s(x8,"isIntermediateReference");var b8,w8=class{static{s(this,"DefaultJsonSerializer")}constructor(t){this.ignoreProperties=new Set(["$container","$containerProperty","$containerIndex","$document","$cstNode"]),this.langiumDocuments=t.shared.workspace.LangiumDocuments,this.astNodeLocator=t.workspace.AstNodeLocator,this.nameProvider=t.references.NameProvider,this.commentProvider=t.documentation.CommentProvider}serialize(t,e={}){const n=null==e?void 0:e.replacer,r=s(((t,n)=>this.replacer(t,n,e)),"defaultReplacer"),i=n?(t,e)=>n(t,e,r):r;try{return this.currentDocument=MQ(t),JSON.stringify(t,i,null==e?void 0:e.space)}finally{this.currentDocument=void 0}}deserialize(t,e={}){const n=JSON.parse(t);return this.linkNode(n,n,e),n}replacer(t,e,{refText:n,sourceText:r,textRegions:i,comments:a,uriConverter:s}){var o,l,c,h;if(!this.ignoreProperties.has(t)){if(QX(e)){const t=e.ref,r=n?e.$refText:void 0;if(t){const n=MQ(t);let i="";this.currentDocument&&this.currentDocument!==n&&(i=s?s(n.uri,e):n.uri.toString());return{$ref:`${i}#${this.astNodeLocator.getAstNodePath(t)}`,$refText:r}}return{$error:null!==(l=null===(o=e.error)||void 0===o?void 0:o.message)&&void 0!==l?l:"Could not resolve reference",$refText:r}}if(ZX(e)){let n;if(i&&(n=this.addAstNodeRegionWithAssignmentsTo(Object.assign({},e)),t&&!e.$document||!(null==n?void 0:n.$textRegion)||(n.$textRegion.documentURI=null===(c=this.currentDocument)||void 0===c?void 0:c.uri.toString())),r&&!t&&(null!=n||(n=Object.assign({},e)),n.$sourceText=null===(h=e.$cstNode)||void 0===h?void 0:h.text),a){null!=n||(n=Object.assign({},e));const t=this.commentProvider.getComment(e);t&&(n.$comment=t.replace(/\r/g,""))}return null!=n?n:e}return e}}addAstNodeRegionWithAssignmentsTo(t){const e=s((t=>({offset:t.offset,end:t.end,length:t.length,range:t.range})),"createDocumentSegment");if(t.$cstNode){const n=(t.$textRegion=e(t.$cstNode)).assignments={};return Object.keys(t).filter((t=>!t.startsWith("$"))).forEach((r=>{const i=wJ(t.$cstNode,r).map(e);0!==i.length&&(n[r]=i)})),t}}linkNode(t,e,n,r,i,a){for(const[r,i]of Object.entries(t))if(Array.isArray(i))for(let a=0;a<i.length;a++){const s=i[a];x8(s)?i[a]=this.reviveReference(t,r,e,s,n):ZX(s)&&this.linkNode(s,e,n,t,r,a)}else x8(i)?t[r]=this.reviveReference(t,r,e,i,n):ZX(i)&&this.linkNode(i,e,n,t,r);const s=t;s.$container=r,s.$containerProperty=i,s.$containerIndex=a}reviveReference(t,e,n,r,i){let a=r.$refText,s=r.$error;if(r.$ref){const t=this.getRefNode(n,r.$ref,i.uriConverter);if(ZX(t))return a||(a=this.nameProvider.getName(t)),{$refText:null!=a?a:"",ref:t};s=t}if(s){const n={$refText:null!=a?a:""};return n.error={container:t,property:e,message:s,reference:n},n}}getRefNode(t,e,n){try{const r=e.indexOf("#");if(0===r){const n=this.astNodeLocator.getAstNode(t,e.substring(1));return n||"Could not resolve path: "+e}if(r<0){const t=n?n(e):Q7.parse(e),r=this.langiumDocuments.getDocument(t);return r?r.parseResult.value:"Could not find document for URI: "+e}const i=n?n(e.substring(0,r)):Q7.parse(e.substring(0,r)),a=this.langiumDocuments.getDocument(i);if(!a)return"Could not find document for URI: "+e;if(r===e.length-1)return a.parseResult.value;const s=this.astNodeLocator.getAstNode(a.parseResult.value,e.substring(r+1));return s||"Could not resolve URI: "+e}catch(t){return String(t)}}},k8=class{static{s(this,"DefaultServiceRegistry")}register(t){if(this.singleton||this.map){if(!this.map&&(this.map={},this.singleton)){for(const t of this.singleton.LanguageMetaData.fileExtensions)this.map[t]=this.singleton;this.singleton=void 0}for(const e of t.LanguageMetaData.fileExtensions)void 0!==this.map[e]&&this.map[e]!==t&&console.warn(`The file extension ${e} is used by multiple languages. It is now assigned to '${t.LanguageMetaData.languageId}'.`),this.map[e]=t}else this.singleton=t}getServices(t){if(void 0!==this.singleton)return this.singleton;if(void 0===this.map)throw new Error("The service registry is empty. Use `register` to register the services of a language.");const e=X7.extname(t),n=this.map[e];if(!n)throw new Error(`The service registry contains no services for the extension '${e}'.`);return n}get all(){return void 0!==this.singleton?[this.singleton]:void 0!==this.map?Object.values(this.map):[]}};function T8(t){return{code:t}}s(T8,"diagnosticData"),(b8||(b8={})).all=["fast","slow","built-in"];var _8,E8,C8=class{static{s(this,"ValidationRegistry")}constructor(t){this.entries=new s8,this.reflection=t.shared.AstReflection}register(t,e=this,n="fast"){if("built-in"===n)throw new Error("The 'built-in' category is reserved for lexer, parser, and linker errors.");for(const[r,i]of Object.entries(t)){const t=i;if(Array.isArray(t))for(const i of t){const t={check:this.wrapValidationException(i,e),category:n};this.addEntry(r,t)}else if("function"==typeof t){const i={check:this.wrapValidationException(t,e),category:n};this.addEntry(r,i)}}}wrapValidationException(t,e){return async(n,r,i)=>{try{await t.call(e,n,r,i)}catch(t){if($7(t))throw t;console.error("An error occurred during validation:",t);const e=t instanceof Error?t.message:String(t);t instanceof Error&&t.stack&&console.error(t.stack),r("error","An error occurred during validation: "+e,{node:n})}}}addEntry(t,e){if("AstNode"!==t)for(const n of this.reflection.getAllSubTypes(t))this.entries.add(n,e);else this.entries.add("AstNode",e)}getChecks(t,e){let n=hK(this.entries.get(t)).concat(this.entries.get("AstNode"));return e&&(n=n.filter((t=>e.includes(t.category)))),n.map((t=>t.check))}},S8=class{static{s(this,"DefaultDocumentValidator")}constructor(t){this.validationRegistry=t.validation.ValidationRegistry,this.metadata=t.LanguageMetaData}async validateDocument(t,e={},n=I7.CancellationToken.None){const r=t.parseResult,i=[];if(await F7(n),!e.categories||e.categories.includes("built-in")){if(this.processLexingErrors(r,i,e),e.stopAfterLexingErrors&&i.some((t=>{var e;return(null===(e=t.data)||void 0===e?void 0:e.code)===_8.LexingError})))return i;if(this.processParsingErrors(r,i,e),e.stopAfterParsingErrors&&i.some((t=>{var e;return(null===(e=t.data)||void 0===e?void 0:e.code)===_8.ParsingError})))return i;if(this.processLinkingErrors(t,i,e),e.stopAfterLinkingErrors&&i.some((t=>{var e;return(null===(e=t.data)||void 0===e?void 0:e.code)===_8.LinkingError})))return i}try{i.push(...await this.validateAst(r.value,e,n))}catch(t){if($7(t))throw t;console.error("An error occurred during validation:",t)}return await F7(n),i}processLexingErrors(t,e,n){for(const n of t.lexerErrors){const t={severity:L8("error"),range:{start:{line:n.line-1,character:n.column-1},end:{line:n.line-1,character:n.column+n.length-1}},message:n.message,data:T8(_8.LexingError),source:this.getSource()};e.push(t)}}processParsingErrors(t,e,n){for(const n of t.parserErrors){let t;if(isNaN(n.token.startOffset)){if("previousToken"in n){const e=n.previousToken;if(isNaN(e.startOffset)){const e={line:0,character:0};t={start:e,end:e}}else{const n={line:e.endLine-1,character:e.endColumn};t={start:n,end:n}}}}else t=vK(n.token);if(t){const r={severity:L8("error"),range:t,message:n.message,data:T8(_8.ParsingError),source:this.getSource()};e.push(r)}}}processLinkingErrors(t,e,n){for(const n of t.references){const t=n.error;if(t){const n={node:t.container,property:t.property,index:t.index,data:{code:_8.LinkingError,containerType:t.container.$type,property:t.property,refText:t.reference.$refText}};e.push(this.toDiagnostic("error",t.message,n))}}}async validateAst(t,e,n=I7.CancellationToken.None){const r=[],i=s(((t,e,n)=>{r.push(this.toDiagnostic(t,e,n))}),"acceptor");return await Promise.all(PQ(t).map((async t=>{await F7(n);const r=this.validationRegistry.getChecks(t.$type,e.categories);for(const e of r)await e(t,i,n)}))),r}toDiagnostic(t,e,n){return{message:e,range:A8(n),severity:L8(t),code:n.code,codeDescription:n.codeDescription,tags:n.tags,relatedInformation:n.relatedInformation,data:n.data,source:this.getSource()}}getSource(){return this.metadata.languageId}};function A8(t){if(t.range)return t.range;let e;return"string"==typeof t.property?e=kJ(t.node.$cstNode,t.property,t.index):"string"==typeof t.keyword&&(e=EJ(t.node.$cstNode,t.keyword,t.index)),null!=e||(e=t.node.$cstNode),e?e.range:{start:{line:0,character:0},end:{line:0,character:0}}}function L8(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)}}s(A8,"getDiagnosticRange"),s(L8,"toDiagnosticSeverity"),(E8=_8||(_8={})).LexingError="lexing-error",E8.ParsingError="parsing-error",E8.LinkingError="linking-error";var N8,I8=class{static{s(this,"DefaultAstNodeDescriptionProvider")}constructor(t){this.astNodeLocator=t.workspace.AstNodeLocator,this.nameProvider=t.references.NameProvider}createDescription(t,e,n=MQ(t)){null!=e||(e=this.nameProvider.getName(t));const r=this.astNodeLocator.getAstNodePath(t);if(!e)throw new Error(`Node at path ${r} has no name.`);let i;const a=s((()=>{var e;return null!=i?i:i=xK(null!==(e=this.nameProvider.getNameNode(t))&&void 0!==e?e:t.$cstNode)}),"nameSegmentGetter");return{node:t,name:e,get nameSegment(){return a()},selectionSegment:xK(t.$cstNode),type:t.$type,documentUri:n.uri,path:r}}},M8=class{static{s(this,"DefaultReferenceDescriptionProvider")}constructor(t){this.nodeLocator=t.workspace.AstNodeLocator}async createDescriptions(t,e=I7.CancellationToken.None){const n=[],r=t.parseResult.value;for(const t of PQ(r))await F7(e),$Q(t).filter((t=>!tK(t))).forEach((t=>{const e=this.createDescription(t);e&&n.push(e)}));return n}createDescription(t){const e=t.reference.$nodeDescription,n=t.reference.$refNode;if(!e||!n)return;const r=MQ(t.container).uri;return{sourceUri:r,sourcePath:this.nodeLocator.getAstNodePath(t.container),targetUri:e.documentUri,targetPath:e.path,segment:xK(n),local:X7.equals(e.documentUri,r)}}},R8=class{static{s(this,"DefaultAstNodeLocator")}constructor(){this.segmentSeparator="/",this.indexSeparator="@"}getAstNodePath(t){if(t.$container){const e=this.getAstNodePath(t.$container),n=this.getPathSegment(t);return e+this.segmentSeparator+n}return""}getPathSegment({$containerProperty:t,$containerIndex:e}){if(!t)throw new Error("Missing '$containerProperty' in AST node.");return void 0!==e?t+this.indexSeparator+e:t}getAstNode(t,e){return e.split(this.segmentSeparator).reduce(((t,e)=>{if(!t||0===e.length)return t;const n=e.indexOf(this.indexSeparator);if(n>0){const r=e.substring(0,n),i=parseInt(e.substring(n+1)),a=t[r];return null==a?void 0:a[i]}return t[e]}),t)}},D8=class{static{s(this,"DefaultConfigurationProvider")}constructor(t){this._ready=new G7,this.settings={},this.workspaceConfig=!1,this.serviceRegistry=t.ServiceRegistry}get ready(){return this._ready.promise}initialize(t){var e,n;this.workspaceConfig=null!==(n=null===(e=t.capabilities.workspace)||void 0===e?void 0:e.configuration)&&void 0!==n&&n}async initialized(t){if(this.workspaceConfig){if(t.register){const e=this.serviceRegistry.all;t.register({section:e.map((t=>this.toSectionName(t.LanguageMetaData.languageId)))})}if(t.fetchConfiguration){const e=this.serviceRegistry.all.map((t=>({section:this.toSectionName(t.LanguageMetaData.languageId)}))),n=await t.fetchConfiguration(e);e.forEach(((t,e)=>{this.updateSectionConfiguration(t.section,n[e])}))}}this._ready.resolve()}updateConfiguration(t){t.settings&&Object.keys(t.settings).forEach((e=>{this.updateSectionConfiguration(e,t.settings[e])}))}updateSectionConfiguration(t,e){this.settings[t]=e}async getConfiguration(t,e){await this.ready;const n=this.toSectionName(t);if(this.settings[n])return this.settings[n][e]}toSectionName(t){return`${t}`}};!function(t){function e(t){return{dispose:s((async()=>await t()),"dispose")}}s(e,"create"),t.create=e}(N8||(N8={}));var O8=class{static{s(this,"DefaultDocumentBuilder")}constructor(t){this.updateBuildOptions={validation:{categories:["built-in","fast"]}},this.updateListeners=[],this.buildPhaseListeners=new s8,this.buildState=new Map,this.documentBuildWaiters=new Map,this.currentState=K7.Changed,this.langiumDocuments=t.workspace.LangiumDocuments,this.langiumDocumentFactory=t.workspace.LangiumDocumentFactory,this.indexManager=t.workspace.IndexManager,this.serviceRegistry=t.ServiceRegistry}async build(t,e={},n=I7.CancellationToken.None){var r,i;for(const n of t){const t=n.uri.toString();if(n.state===K7.Validated){if("boolean"==typeof e.validation&&e.validation)n.state=K7.IndexedReferences,n.diagnostics=void 0,this.buildState.delete(t);else if("object"==typeof e.validation){const a=this.buildState.get(t),s=null===(r=null==a?void 0:a.result)||void 0===r?void 0:r.validationChecks;if(s){const r=(null!==(i=e.validation.categories)&&void 0!==i?i:b8.all).filter((t=>!s.includes(t)));r.length>0&&(this.buildState.set(t,{completed:!1,options:{validation:Object.assign(Object.assign({},e.validation),{categories:r})},result:a.result}),n.state=K7.IndexedReferences)}}}else this.buildState.delete(t)}this.currentState=K7.Changed,await this.emitUpdate(t.map((t=>t.uri)),[]),await this.buildDocuments(t,e,n)}async update(t,e,n=I7.CancellationToken.None){this.currentState=K7.Changed;for(const t of e)this.langiumDocuments.deleteDocument(t),this.buildState.delete(t.toString()),this.indexManager.remove(t);for(const e of t){if(!this.langiumDocuments.invalidateDocument(e)){const t=this.langiumDocumentFactory.fromModel({$type:"INVALID"},e);t.state=K7.Changed,this.langiumDocuments.addDocument(t)}this.buildState.delete(e.toString())}const r=hK(t).concat(e).map((t=>t.toString())).toSet();this.langiumDocuments.all.filter((t=>!r.has(t.uri.toString())&&this.shouldRelink(t,r))).forEach((t=>{this.serviceRegistry.getServices(t.uri).references.Linker.unlink(t),t.state=Math.min(t.state,K7.ComputedScopes),t.diagnostics=void 0})),await this.emitUpdate(t,e),await F7(n);const i=this.langiumDocuments.all.filter((t=>{var e;return t.state<K7.Linked||!(null===(e=this.buildState.get(t.uri.toString()))||void 0===e?void 0:e.completed)})).toArray();await this.buildDocuments(i,this.updateBuildOptions,n)}async emitUpdate(t,e){await Promise.all(this.updateListeners.map((n=>n(t,e))))}shouldRelink(t,e){return!!t.references.some((t=>void 0!==t.error))||this.indexManager.isAffected(t,e)}onUpdate(t){return this.updateListeners.push(t),N8.create((()=>{const e=this.updateListeners.indexOf(t);e>=0&&this.updateListeners.splice(e,1)}))}async buildDocuments(t,e,n){this.prepareBuild(t,e),await this.runCancelable(t,K7.Parsed,n,(t=>this.langiumDocumentFactory.update(t,n))),await this.runCancelable(t,K7.IndexedContent,n,(t=>this.indexManager.updateContent(t,n))),await this.runCancelable(t,K7.ComputedScopes,n,(async t=>{const e=this.serviceRegistry.getServices(t.uri).references.ScopeComputation;t.precomputedScopes=await e.computeLocalScopes(t,n)})),await this.runCancelable(t,K7.Linked,n,(t=>this.serviceRegistry.getServices(t.uri).references.Linker.link(t,n))),await this.runCancelable(t,K7.IndexedReferences,n,(t=>this.indexManager.updateReferences(t,n)));const r=t.filter((t=>this.shouldValidate(t)));await this.runCancelable(r,K7.Validated,n,(t=>this.validate(t,n)));for(const e of t){const t=this.buildState.get(e.uri.toString());t&&(t.completed=!0)}}prepareBuild(t,e){for(const n of t){const t=n.uri.toString(),r=this.buildState.get(t);r&&!r.completed||this.buildState.set(t,{completed:!1,options:e,result:null==r?void 0:r.result})}}async runCancelable(t,e,n,r){const i=t.filter((t=>t.state<e));for(const t of i)await F7(n),await r(t),t.state=e;await this.notifyBuildPhase(i,e,n),this.currentState=e}onBuildPhase(t,e){return this.buildPhaseListeners.add(t,e),N8.create((()=>{this.buildPhaseListeners.delete(t,e)}))}waitUntil(t,e,n){let r;if(e&&"path"in e?r=e:n=e,null!=n||(n=I7.CancellationToken.None),r){const e=this.langiumDocuments.getDocument(r);if(e&&e.state>t)return Promise.resolve(r)}return this.currentState>=t?Promise.resolve(void 0):n.isCancellationRequested?Promise.reject(B7):new Promise(((e,i)=>{const a=this.onBuildPhase(t,(()=>{if(a.dispose(),s.dispose(),r){const t=this.langiumDocuments.getDocument(r);e(null==t?void 0:t.uri)}else e(void 0)})),s=n.onCancellationRequested((()=>{a.dispose(),s.dispose(),i(B7)}))}))}async notifyBuildPhase(t,e,n){if(0===t.length)return;const r=this.buildPhaseListeners.get(e);for(const e of r)await F7(n),await e(t,n)}shouldValidate(t){return Boolean(this.getBuildOptions(t).validation)}async validate(t,e){var n,r;const i=this.serviceRegistry.getServices(t.uri).validation.DocumentValidator,a=this.getBuildOptions(t).validation,s="object"==typeof a?a:void 0,o=await i.validateDocument(t,s,e);t.diagnostics?t.diagnostics.push(...o):t.diagnostics=o;const l=this.buildState.get(t.uri.toString());if(l){null!==(n=l.result)&&void 0!==n||(l.result={});const t=null!==(r=null==s?void 0:s.categories)&&void 0!==r?r:b8.all;l.result.validationChecks?l.result.validationChecks.push(...t):l.result.validationChecks=[...t]}}getBuildOptions(t){var e,n;return null!==(n=null===(e=this.buildState.get(t.uri.toString()))||void 0===e?void 0:e.options)&&void 0!==n?n:{}}},P8=class{static{s(this,"DefaultIndexManager")}constructor(t){this.symbolIndex=new Map,this.symbolByTypeIndex=new g8,this.referenceIndex=new Map,this.documents=t.workspace.LangiumDocuments,this.serviceRegistry=t.ServiceRegistry,this.astReflection=t.AstReflection}findAllReferences(t,e){const n=MQ(t).uri,r=[];return this.referenceIndex.forEach((t=>{t.forEach((t=>{X7.equals(t.targetUri,n)&&t.targetPath===e&&r.push(t)}))})),hK(r)}allElements(t,e){let n=hK(this.symbolIndex.keys());return e&&(n=n.filter((t=>!e||e.has(t)))),n.map((e=>this.getFileDescriptions(e,t))).flat()}getFileDescriptions(t,e){var n;if(!e)return null!==(n=this.symbolIndex.get(t))&&void 0!==n?n:[];const r=this.symbolByTypeIndex.get(t,e,(()=>{var n;return(null!==(n=this.symbolIndex.get(t))&&void 0!==n?n:[]).filter((t=>this.astReflection.isSubtype(t.type,e)))}));return r}remove(t){const e=t.toString();this.symbolIndex.delete(e),this.symbolByTypeIndex.clear(e),this.referenceIndex.delete(e)}async updateContent(t,e=I7.CancellationToken.None){const n=this.serviceRegistry.getServices(t.uri),r=await n.references.ScopeComputation.computeExports(t,e),i=t.uri.toString();this.symbolIndex.set(i,r),this.symbolByTypeIndex.clear(i)}async updateReferences(t,e=I7.CancellationToken.None){const n=this.serviceRegistry.getServices(t.uri),r=await n.workspace.ReferenceDescriptionProvider.createDescriptions(t,e);this.referenceIndex.set(t.uri.toString(),r)}isAffected(t,e){const n=this.referenceIndex.get(t.uri.toString());return!!n&&n.some((t=>!t.local&&e.has(t.targetUri.toString())))}},B8=class{static{s(this,"DefaultWorkspaceManager")}constructor(t){this.initialBuildOptions={},this._ready=new G7,this.serviceRegistry=t.ServiceRegistry,this.langiumDocuments=t.workspace.LangiumDocuments,this.documentBuilder=t.workspace.DocumentBuilder,this.fileSystemProvider=t.workspace.FileSystemProvider,this.mutex=t.workspace.WorkspaceLock}get ready(){return this._ready.promise}initialize(t){var e;this.folders=null!==(e=t.workspaceFolders)&&void 0!==e?e:void 0}initialized(t){return this.mutex.write((t=>{var e;return this.initializeWorkspace(null!==(e=this.folders)&&void 0!==e?e:[],t)}))}async initializeWorkspace(t,e=I7.CancellationToken.None){const n=await this.performStartup(t);await F7(e),await this.documentBuilder.build(n,this.initialBuildOptions,e)}async performStartup(t){const e=this.serviceRegistry.all.flatMap((t=>t.LanguageMetaData.fileExtensions)),n=[],r=s((t=>{n.push(t),this.langiumDocuments.hasDocument(t.uri)||this.langiumDocuments.addDocument(t)}),"collector");return await this.loadAdditionalDocuments(t,r),await Promise.all(t.map((t=>[t,this.getRootFolder(t)])).map((async t=>this.traverseFolder(...t,e,r)))),this._ready.resolve(),n}loadAdditionalDocuments(t,e){return Promise.resolve()}getRootFolder(t){return Q7.parse(t.uri)}async traverseFolder(t,e,n,r){const i=await this.fileSystemProvider.readDirectory(e);await Promise.all(i.map((async e=>{if(this.includeEntry(t,e,n))if(e.isDirectory)await this.traverseFolder(t,e.uri,n,r);else if(e.isFile){const t=await this.langiumDocuments.getOrCreateDocument(e.uri);r(t)}})))}includeEntry(t,e,n){const r=X7.basename(e.uri);if(r.startsWith("."))return!1;if(e.isDirectory)return"node_modules"!==r&&"out"!==r;if(e.isFile){const t=X7.extname(e.uri);return n.includes(t)}return!1}},$8=class{static{s(this,"DefaultLexer")}constructor(t){const e=t.parser.TokenBuilder.buildTokens(t.Grammar,{caseInsensitive:t.LanguageMetaData.caseInsensitive});this.tokenTypes=this.toTokenTypeDictionary(e);const n=U8(e)?Object.values(e):e;this.chevrotainLexer=new j1(n,{positionTracking:"full"})}get definition(){return this.tokenTypes}tokenize(t){var e;const n=this.chevrotainLexer.tokenize(t);return{tokens:n.tokens,errors:n.errors,hidden:null!==(e=n.groups.hidden)&&void 0!==e?e:[]}}toTokenTypeDictionary(t){if(U8(t))return t;const e=z8(t)?Object.values(t.modes).flat():t,n={};return e.forEach((t=>n[t.name]=t)),n}};function F8(t){return Array.isArray(t)&&(0===t.length||"name"in t[0])}function z8(t){return t&&"modes"in t&&"defaultMode"in t}function U8(t){return!F8(t)&&!z8(t)}function G8(t,e,n){let r,i;"string"==typeof t?(i=e,r=n):(i=t.range.start,r=e),i||(i=P3.create(0,0));return J8({index:0,tokens:H8({lines:j8(t),position:i,options:s9(r)}),position:i})}function q8(t,e){const n=s9(e),r=j8(t);if(0===r.length)return!1;const i=r[0],a=r[r.length-1],s=n.start,o=n.end;return Boolean(null==s?void 0:s.exec(i))&&Boolean(null==o?void 0:o.exec(a))}function j8(t){let e="";e="string"==typeof t?t:t.text;return e.split(iJ)}s(F8,"isTokenTypeArray"),s(z8,"isIMultiModeLexerDefinition"),s(U8,"isTokenTypeDictionary"),s(G8,"parseJSDoc"),s(q8,"isJSDoc"),s(j8,"getLines");var Y8=/\s*(@([\p{L}][\p{L}\p{N}]*)?)/uy,W8=/\{(@[\p{L}][\p{L}\p{N}]*)(\s*)([^\r\n}]+)?\}/gu;function H8(t){var e,n,r;const i=[];let a=t.position.line,s=t.position.character;for(let o=0;o<t.lines.length;o++){const l=0===o,c=o===t.lines.length-1;let h=t.lines[o],u=0;if(l&&t.options.start){const n=null===(e=t.options.start)||void 0===e?void 0:e.exec(h);n&&(u=n.index+n[0].length)}else{const e=null===(n=t.options.line)||void 0===n?void 0:n.exec(h);e&&(u=e.index+e[0].length)}if(c){const e=null===(r=t.options.end)||void 0===r?void 0:r.exec(h);e&&(h=h.substring(0,e.index))}h=h.substring(0,Q8(h));if(Z8(h,u)>=h.length){if(i.length>0){const t=P3.create(a,s);i.push({type:"break",content:"",range:B3.create(t,t)})}}else{Y8.lastIndex=u;const t=Y8.exec(h);if(t){const e=t[0],n=t[1],r=P3.create(a,s+u),o=P3.create(a,s+u+e.length);i.push({type:"tag",content:n,range:B3.create(r,o)}),u+=e.length,u=Z8(h,u)}if(u<h.length){const t=h.substring(u),e=Array.from(t.matchAll(W8));i.push(...V8(e,t,a,s+u))}}a++,s=0}return i.length>0&&"break"===i[i.length-1].type?i.slice(0,-1):i}function V8(t,e,n,r){const i=[];if(0===t.length){const t=P3.create(n,r),a=P3.create(n,r+e.length);i.push({type:"text",content:e,range:B3.create(t,a)})}else{let a=0;for(const s of t){const t=s.index,o=e.substring(a,t);o.length>0&&i.push({type:"text",content:e.substring(a,t),range:B3.create(P3.create(n,a+r),P3.create(n,t+r))});let l=o.length+1;const c=s[1];if(i.push({type:"inline-tag",content:c,range:B3.create(P3.create(n,a+l+r),P3.create(n,a+l+c.length+r))}),l+=c.length,4===s.length){l+=s[2].length;const t=s[3];i.push({type:"text",content:t,range:B3.create(P3.create(n,a+l+r),P3.create(n,a+l+t.length+r))})}else i.push({type:"text",content:"",range:B3.create(P3.create(n,a+l+r),P3.create(n,a+l+r))});a=t+s[0].length}const s=e.substring(a);s.length>0&&i.push({type:"text",content:s,range:B3.create(P3.create(n,a+r),P3.create(n,a+r+s.length))})}return i}s(H8,"tokenize"),s(V8,"buildInlineTokens");var X8=/\S/,K8=/\s*$/;function Z8(t,e){const n=t.substring(e).match(X8);return n?e+n.index:t.length}function Q8(t){const e=t.match(K8);if(e&&"number"==typeof e.index)return e.index}function J8(t){var e,n,r,i;const a=P3.create(t.position.line,t.position.character);if(0===t.tokens.length)return new l9([],B3.create(a,a));const s=[];for(;t.index<t.tokens.length;){const e=t9(t,s[s.length-1]);e&&s.push(e)}const o=null!==(n=null===(e=s[0])||void 0===e?void 0:e.range.start)&&void 0!==n?n:a,l=null!==(i=null===(r=s[s.length-1])||void 0===r?void 0:r.range.end)&&void 0!==i?i:a;return new l9(s,B3.create(o,l))}function t9(t,e){const n=t.tokens[t.index];return"tag"===n.type?i9(t,!1):"text"===n.type||"inline-tag"===n.type?n9(t):(e9(n,e),void t.index++)}function e9(t,e){if(e){const n=new p9("",t.range);"inlines"in e?e.inlines.push(n):e.content.inlines.push(n)}}function n9(t){let e=t.tokens[t.index];const n=e;let r=e;const i=[];for(;e&&"break"!==e.type&&"tag"!==e.type;)i.push(r9(t)),r=e,e=t.tokens[t.index];return new d9(i,B3.create(n.range.start,r.range.end))}function r9(t){return"inline-tag"===t.tokens[t.index].type?i9(t,!0):a9(t)}function i9(t,e){const n=t.tokens[t.index++],r=n.content.substring(1),i=t.tokens[t.index];if("text"===(null==i?void 0:i.type)){if(e){const i=a9(t);return new c9(r,new d9([i],i.range),e,B3.create(n.range.start,i.range.end))}{const i=n9(t);return new c9(r,i,e,B3.create(n.range.start,i.range.end))}}{const t=n.range;return new c9(r,new d9([],t),e,t)}}function a9(t){const e=t.tokens[t.index++];return new p9(e.content,e.range)}function s9(t){if(!t)return s9({start:"/**",end:"*/",line:"*"});const{start:e,end:n,line:r}=t;return{start:o9(e,!0),end:o9(n,!1),line:o9(r,!0)}}function o9(t,e){if("string"==typeof t||"object"==typeof t){const n="string"==typeof t?uJ(t):t.source;return e?new RegExp(`^\\s*${n}`):new RegExp(`\\s*${n}\\s*$`)}return t}s(Z8,"skipWhitespace"),s(Q8,"lastCharacter"),s(J8,"parseJSDocComment"),s(t9,"parseJSDocElement"),s(e9,"appendEmptyLine"),s(n9,"parseJSDocText"),s(r9,"parseJSDocInline"),s(i9,"parseJSDocTag"),s(a9,"parseJSDocLine"),s(s9,"normalizeOptions"),s(o9,"normalizeOption");var l9=class{static{s(this,"JSDocCommentImpl")}constructor(t,e){this.elements=t,this.range=e}getTag(t){return this.getAllTags().find((e=>e.name===t))}getTags(t){return this.getAllTags().filter((e=>e.name===t))}getAllTags(){return this.elements.filter((t=>"name"in t))}toString(){let t="";for(const e of this.elements)if(0===t.length)t=e.toString();else{const n=e.toString();t+=g9(t)+n}return t.trim()}toMarkdown(t){let e="";for(const n of this.elements)if(0===e.length)e=n.toMarkdown(t);else{const r=n.toMarkdown(t);e+=g9(e)+r}return e.trim()}},c9=class{static{s(this,"JSDocTagImpl")}constructor(t,e,n,r){this.name=t,this.content=e,this.inline=n,this.range=r}toString(){let t=`@${this.name}`;const e=this.content.toString();return 1===this.content.inlines.length?t=`${t} ${e}`:this.content.inlines.length>1&&(t=`${t}\n${e}`),this.inline?`{${t}}`:t}toMarkdown(t){var e,n;return null!==(n=null===(e=null==t?void 0:t.renderTag)||void 0===e?void 0:e.call(t,this))&&void 0!==n?n:this.toMarkdownDefault(t)}toMarkdownDefault(t){const e=this.content.toMarkdown(t);if(this.inline){const n=h9(this.name,e,null!=t?t:{});if("string"==typeof n)return n}let n="";"italic"===(null==t?void 0:t.tag)||void 0===(null==t?void 0:t.tag)?n="*":"bold"===(null==t?void 0:t.tag)?n="**":"bold-italic"===(null==t?void 0:t.tag)&&(n="***");let r=`${n}@${this.name}${n}`;return 1===this.content.inlines.length?r=`${r} — ${e}`:this.content.inlines.length>1&&(r=`${r}\n${e}`),this.inline?`{${r}}`:r}};function h9(t,e,n){var r,i;if("linkplain"===t||"linkcode"===t||"link"===t){const a=e.indexOf(" ");let s=e;if(a>0){const t=Z8(e,a);s=e.substring(t),e=e.substring(0,a)}("linkcode"===t||"link"===t&&"code"===n.link)&&(s=`\`${s}\``);return null!==(i=null===(r=n.renderLink)||void 0===r?void 0:r.call(n,e,s))&&void 0!==i?i:u9(e,s)}}function u9(t,e){try{return Q7.parse(t,!0),`[${e}](${t})`}catch(e){return t}}s(h9,"renderInlineTag"),s(u9,"renderLinkDefault");var d9=class{static{s(this,"JSDocTextImpl")}constructor(t,e){this.inlines=t,this.range=e}toString(){let t="";for(let e=0;e<this.inlines.length;e++){const n=this.inlines[e],r=this.inlines[e+1];t+=n.toString(),r&&r.range.start.line>n.range.start.line&&(t+="\n")}return t}toMarkdown(t){let e="";for(let n=0;n<this.inlines.length;n++){const r=this.inlines[n],i=this.inlines[n+1];e+=r.toMarkdown(t),i&&i.range.start.line>r.range.start.line&&(e+="\n")}return e}},p9=class{static{s(this,"JSDocLineImpl")}constructor(t,e){this.text=t,this.range=e}toString(){return this.text}toMarkdown(){return this.text}};function g9(t){return t.endsWith("\n")?"\n":"\n\n"}s(g9,"fillNewlines");var f9=class{static{s(this,"JSDocDocumentationProvider")}constructor(t){this.indexManager=t.shared.workspace.IndexManager,this.commentProvider=t.documentation.CommentProvider}getDocumentation(t){const e=this.commentProvider.getComment(t);if(e&&q8(e)){return G8(e).toMarkdown({renderLink:s(((e,n)=>this.documentationLinkRenderer(t,e,n)),"renderLink"),renderTag:s((e=>this.documentationTagRenderer(t,e)),"renderTag")})}}documentationLinkRenderer(t,e,n){var r;const i=null!==(r=this.findNameInPrecomputedScopes(t,e))&&void 0!==r?r:this.findNameInGlobalScope(t,e);if(i&&i.nameSegment){const t=i.nameSegment.range.start.line+1,e=i.nameSegment.range.start.character+1;return`[${n}](${i.documentUri.with({fragment:`L${t},${e}`}).toString()})`}}documentationTagRenderer(t,e){}findNameInPrecomputedScopes(t,e){const n=MQ(t).precomputedScopes;if(!n)return;let r=t;do{const t=n.get(r).find((t=>t.name===e));if(t)return t;r=r.$container}while(r)}findNameInGlobalScope(t,e){const n=this.indexManager.allElements().find((t=>t.name===e));return n}},m9=class{static{s(this,"DefaultCommentProvider")}constructor(t){this.grammarConfig=()=>t.parser.GrammarConfig}getComment(t){var e;return v8(t)?t.$comment:null===(e=_K(t.$cstNode,this.grammarConfig().multilineCommentRules))||void 0===e?void 0:e.text}},y9={};u(y9,d(HX(),1));var v9,x9=class{static{s(this,"DefaultAsyncParser")}constructor(t){this.syncParser=t.parser.LangiumParser}parse(t){return Promise.resolve(this.syncParser.parse(t))}},b9=class{static{s(this,"AbstractThreadedAsyncParser")}constructor(t){this.threadCount=8,this.terminationDelay=200,this.workerPool=[],this.queue=[],this.hydrator=t.serializer.Hydrator}initializeWorkers(){for(;this.workerPool.length<this.threadCount;){const t=this.createWorker();t.onReady((()=>{if(this.queue.length>0){const e=this.queue.shift();e&&(t.lock(),e.resolve(t))}})),this.workerPool.push(t)}}async parse(t,e){const n=await this.acquireParserWorker(e),r=new G7;let i;const a=e.onCancellationRequested((()=>{i=setTimeout((()=>{this.terminateWorker(n)}),this.terminationDelay)}));return n.parse(t).then((t=>{const e=this.hydrator.hydrate(t);r.resolve(e)})).catch((t=>{r.reject(t)})).finally((()=>{a.dispose(),clearTimeout(i)})),r.promise}terminateWorker(t){t.terminate();const e=this.workerPool.indexOf(t);e>=0&&this.workerPool.splice(e,1)}async acquireParserWorker(t){this.initializeWorkers();for(const t of this.workerPool)if(t.ready)return t.lock(),t;const e=new G7;return t.onCancellationRequested((()=>{const t=this.queue.indexOf(e);t>=0&&this.queue.splice(t,1),e.reject(B7)})),this.queue.push(e),e.promise}},w9=class{static{s(this,"ParserWorker")}get ready(){return this._ready}get onReady(){return this.onReadyEmitter.event}constructor(t,e,n,r){this.onReadyEmitter=new y9.Emitter,this.deferred=new G7,this._ready=!0,this._parsing=!1,this.sendMessage=t,this._terminate=r,e((t=>{const e=t;this.deferred.resolve(e),this.unlock()})),n((t=>{this.deferred.reject(t),this.unlock()}))}terminate(){this.deferred.reject(B7),this._terminate()}lock(){this._ready=!1}unlock(){this._parsing=!1,this._ready=!0,this.onReadyEmitter.fire()}parse(t){if(this._parsing)throw new Error("Parser worker is busy");return this._parsing=!0,this.deferred=new G7,this.sendMessage(t),this.deferred.promise}},k9=class{static{s(this,"DefaultWorkspaceLock")}constructor(){this.previousTokenSource=new I7.CancellationTokenSource,this.writeQueue=[],this.readQueue=[],this.done=!0}write(t){this.cancelWrite();const e=new I7.CancellationTokenSource;return this.previousTokenSource=e,this.enqueue(this.writeQueue,t,e.token)}read(t){return this.enqueue(this.readQueue,t)}enqueue(t,e,n){const r=new G7,i={action:e,deferred:r,cancellationToken:null!=n?n:I7.CancellationToken.None};return t.push(i),this.performNextOperation(),r.promise}async performNextOperation(){if(!this.done)return;const t=[];if(this.writeQueue.length>0)t.push(this.writeQueue.shift());else{if(!(this.readQueue.length>0))return;t.push(...this.readQueue.splice(0,this.readQueue.length))}this.done=!1,await Promise.all(t.map((async({action:t,deferred:e,cancellationToken:n})=>{try{const r=await Promise.resolve().then((()=>t(n)));e.resolve(r)}catch(t){$7(t)?e.resolve(void 0):e.reject(t)}}))),this.done=!0,this.performNextOperation()}cancelWrite(){this.previousTokenSource.cancel()}},T9=class{static{s(this,"DefaultHydrator")}constructor(t){this.grammarElementIdMap=new o8,this.tokenTypeIdMap=new o8,this.grammar=t.Grammar,this.lexer=t.parser.Lexer,this.linker=t.references.Linker}dehydrate(t){return{lexerErrors:t.lexerErrors.map((t=>Object.assign({},t))),parserErrors:t.parserErrors.map((t=>Object.assign({},t))),value:this.dehydrateAstNode(t.value,this.createDehyrationContext(t.value))}}createDehyrationContext(t){const e=new Map,n=new Map;for(const n of PQ(t))e.set(n,{});if(t.$cstNode)for(const e of fK(t.$cstNode))n.set(e,{});return{astNodes:e,cstNodes:n}}dehydrateAstNode(t,e){const n=e.astNodes.get(t);n.$type=t.$type,n.$containerIndex=t.$containerIndex,n.$containerProperty=t.$containerProperty,void 0!==t.$cstNode&&(n.$cstNode=this.dehydrateCstNode(t.$cstNode,e));for(const[r,i]of Object.entries(t))if(!r.startsWith("$"))if(Array.isArray(i)){const t=[];n[r]=t;for(const n of i)ZX(n)?t.push(this.dehydrateAstNode(n,e)):QX(n)?t.push(this.dehydrateReference(n,e)):t.push(n)}else ZX(i)?n[r]=this.dehydrateAstNode(i,e):QX(i)?n[r]=this.dehydrateReference(i,e):void 0!==i&&(n[r]=i);return n}dehydrateReference(t,e){const n={};return n.$refText=t.$refText,t.$refNode&&(n.$refNode=e.cstNodes.get(t.$refNode)),n}dehydrateCstNode(t,e){const n=e.cstNodes.get(t);return iK(t)?n.fullText=t.fullText:n.grammarSource=this.getGrammarElementId(t.grammarSource),n.hidden=t.hidden,n.astNode=e.astNodes.get(t.astNode),nK(t)?n.content=t.content.map((t=>this.dehydrateCstNode(t,e))):rK(t)&&(n.tokenType=t.tokenType.name,n.offset=t.offset,n.length=t.length,n.startLine=t.range.start.line,n.startColumn=t.range.start.character,n.endLine=t.range.end.line,n.endColumn=t.range.end.character),n}hydrate(t){const e=t.value,n=this.createHydrationContext(e);return"$cstNode"in e&&this.hydrateCstNode(e.$cstNode,n),{lexerErrors:t.lexerErrors,parserErrors:t.parserErrors,value:this.hydrateAstNode(e,n)}}createHydrationContext(t){const e=new Map,n=new Map;for(const n of PQ(t))e.set(n,{});let r;if(t.$cstNode)for(const e of fK(t.$cstNode)){let t;"fullText"in e?(t=new Z6(e.fullText),r=t):"content"in e?t=new X6:"tokenType"in e&&(t=this.hydrateCstLeafNode(e)),t&&(n.set(e,t),t.root=r)}return{astNodes:e,cstNodes:n}}hydrateAstNode(t,e){const n=e.astNodes.get(t);n.$type=t.$type,n.$containerIndex=t.$containerIndex,n.$containerProperty=t.$containerProperty,t.$cstNode&&(n.$cstNode=e.cstNodes.get(t.$cstNode));for(const[r,i]of Object.entries(t))if(!r.startsWith("$"))if(Array.isArray(i)){const t=[];n[r]=t;for(const a of i)ZX(a)?t.push(this.setParent(this.hydrateAstNode(a,e),n)):QX(a)?t.push(this.hydrateReference(a,n,r,e)):t.push(a)}else ZX(i)?n[r]=this.setParent(this.hydrateAstNode(i,e),n):QX(i)?n[r]=this.hydrateReference(i,n,r,e):void 0!==i&&(n[r]=i);return n}setParent(t,e){return t.$container=e,t}hydrateReference(t,e,n,r){return this.linker.buildReference(e,n,r.cstNodes.get(t.$refNode),t.$refText)}hydrateCstNode(t,e,n=0){const r=e.cstNodes.get(t);if("number"==typeof t.grammarSource&&(r.grammarSource=this.getGrammarElement(t.grammarSource)),r.astNode=e.astNodes.get(t.astNode),nK(r))for(const i of t.content){const t=this.hydrateCstNode(i,e,n++);r.content.push(t)}return r}hydrateCstLeafNode(t){const e=this.getTokenType(t.tokenType),n=t.offset,r=t.length,i=t.startLine,a=t.startColumn,s=t.endLine,o=t.endColumn,l=t.hidden;return new V6(n,r,{start:{line:i,character:a},end:{line:s,character:o}},e,l)}getTokenType(t){return this.lexer.definition[t]}getGrammarElementId(t){return 0===this.grammarElementIdMap.size&&this.createGrammarElementIdMap(),this.grammarElementIdMap.get(t)}getGrammarElement(t){0===this.grammarElementIdMap.size&&this.createGrammarElementIdMap();const e=this.grammarElementIdMap.getKey(t);if(e)return e;throw new Error("Invalid grammar element id: "+t)}createGrammarElementIdMap(){let t=0;for(const e of PQ(this.grammar))JK(e)&&this.grammarElementIdMap.set(e,t++)}};function _9(t){return{documentation:{CommentProvider:s((t=>new m9(t)),"CommentProvider"),DocumentationProvider:s((t=>new f9(t)),"DocumentationProvider")},parser:{AsyncParser:s((t=>new x9(t)),"AsyncParser"),GrammarConfig:s((t=>QJ(t)),"GrammarConfig"),LangiumParser:s((t=>C7(t)),"LangiumParser"),CompletionParser:s((t=>E7(t)),"CompletionParser"),ValueConverter:s((()=>new N7),"ValueConverter"),TokenBuilder:s((()=>new L7),"TokenBuilder"),Lexer:s((t=>new $8(t)),"Lexer"),ParserErrorMessageProvider:s((()=>new i7),"ParserErrorMessageProvider")},workspace:{AstNodeLocator:s((()=>new R8),"AstNodeLocator"),AstNodeDescriptionProvider:s((t=>new I8(t)),"AstNodeDescriptionProvider"),ReferenceDescriptionProvider:s((t=>new M8(t)),"ReferenceDescriptionProvider")},references:{Linker:s((t=>new n8(t)),"Linker"),NameProvider:s((()=>new i8),"NameProvider"),ScopeProvider:s((t=>new y8(t)),"ScopeProvider"),ScopeComputation:s((t=>new l8(t)),"ScopeComputation"),References:s((t=>new a8(t)),"References")},serializer:{Hydrator:s((t=>new T9(t)),"Hydrator"),JsonSerializer:s((t=>new w8(t)),"JsonSerializer")},validation:{DocumentValidator:s((t=>new S8(t)),"DocumentValidator"),ValidationRegistry:s((t=>new C8(t)),"ValidationRegistry")},shared:s((()=>t.shared),"shared")}}function E9(t){return{ServiceRegistry:s((()=>new k8),"ServiceRegistry"),workspace:{LangiumDocuments:s((t=>new e8(t)),"LangiumDocuments"),LangiumDocumentFactory:s((t=>new t8(t)),"LangiumDocumentFactory"),DocumentBuilder:s((t=>new O8(t)),"DocumentBuilder"),IndexManager:s((t=>new P8(t)),"IndexManager"),WorkspaceManager:s((t=>new B8(t)),"WorkspaceManager"),FileSystemProvider:s((e=>t.fileSystemProvider(e)),"FileSystemProvider"),WorkspaceLock:s((()=>new k9),"WorkspaceLock"),ConfigurationProvider:s((t=>new D8(t)),"ConfigurationProvider")}}}function C9(t,e,n,r,i,a,s,o,l){return L9([t,e,n,r,i,a,s,o,l].reduce(M9,{}))}s(_9,"createDefaultCoreModule"),s(E9,"createDefaultSharedCoreModule"),(v9||(v9={})).merge=(t,e)=>M9(M9({},t),e),s(C9,"inject");var S9=Symbol("isProxy");function A9(t){if(t&&t[S9])for(const e of Object.values(t))A9(e);return t}function L9(t,e){const n=new Proxy({},{deleteProperty:s((()=>!1),"deleteProperty"),get:s(((r,i)=>I9(r,i,t,e||n)),"get"),getOwnPropertyDescriptor:s(((r,i)=>(I9(r,i,t,e||n),Object.getOwnPropertyDescriptor(r,i))),"getOwnPropertyDescriptor"),has:s(((e,n)=>n in t),"has"),ownKeys:s((()=>[...Reflect.ownKeys(t),S9]),"ownKeys")});return n[S9]=!0,n}s(A9,"eagerLoad"),s(L9,"_inject");var N9=Symbol();function I9(t,e,n,r){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]===N9)throw new Error('Cycle detected. Please make "'+String(e)+'" lazy. See https://langium.org/docs/configuration-services/#resolving-cyclic-dependencies');return t[e]}if(e in n){const i=n[e];t[e]=N9;try{t[e]="function"==typeof i?i(r):L9(i,r)}catch(n){throw t[e]=n instanceof Error?n:void 0,n}return t[e]}}function M9(t,e){if(e)for(const[n,r]of Object.entries(e))if(void 0!==r){const e=t[n];t[n]=null!==e&&null!==r&&"object"==typeof e&&"object"==typeof r?M9(e,r):r}return t}s(I9,"_resolve"),s(M9,"_merge");var R9={};l(R9,{AstUtils:()=>AQ,BiMap:()=>o8,Cancellation:()=>I7,ContextCache:()=>g8,CstUtils:()=>KX,DONE_RESULT:()=>cK,Deferred:()=>G7,Disposable:()=>N8,DisposableCache:()=>d8,DocumentCache:()=>f8,EMPTY_STREAM:()=>lK,ErrorWithLocation:()=>PK,GrammarUtils:()=>OK,MultiMap:()=>s8,OperationCancelled:()=>B7,Reduction:()=>uK,RegExpUtils:()=>qQ,SimpleCache:()=>p8,StreamImpl:()=>aK,TreeStreamImpl:()=>gK,URI:()=>Q7,UriUtils:()=>X7,WorkspaceCache:()=>m8,assertUnreachable:()=>BK,delayNextTick:()=>M7,interruptAndCheck:()=>F7,isOperationCancelled:()=>$7,loadGrammarFromJson:()=>F9,setInterruptionPeriod:()=>P7,startCancelableOperation:()=>O7,stream:()=>hK}),u(R9,y9);var D9=class{static{s(this,"EmptyFileSystemProvider")}readFile(){throw new Error("No file system is available.")}async readDirectory(){return[]}},O9={fileSystemProvider:s((()=>new D9),"fileSystemProvider")},P9={Grammar:s((()=>{}),"Grammar"),LanguageMetaData:s((()=>({caseInsensitive:!1,fileExtensions:[".langium"],languageId:"langium"})),"LanguageMetaData")},B9={AstReflection:s((()=>new CQ),"AstReflection")};function $9(){const t=C9(E9(O9),B9),e=C9(_9({shared:t}),P9);return t.ServiceRegistry.register(e),e}function F9(t){var e;const n=$9(),r=n.serializer.JsonSerializer.deserialize(t);return n.shared.workspace.LangiumDocumentFactory.fromModel(r,Q7.parse(`memory://${null!==(e=r.name)&&void 0!==e?e:"grammar"}.langium`)),r}s($9,"createMinimalGrammarServices"),s(F9,"loadGrammarFromJson"),u(XX,R9);var z9=Object.defineProperty,U9=s(((t,e)=>z9(t,"name",{value:e,configurable:!0})),"__name");function G9(t){return att.isInstance(t,"Architecture")}s(G9,"isArchitecture"),U9(G9,"isArchitecture");function q9(t){return att.isInstance(t,"Branch")}s(q9,"isBranch"),U9(q9,"isBranch");function j9(t){return att.isInstance(t,"Commit")}s(j9,"isCommit"),U9(j9,"isCommit");function Y9(t){return att.isInstance(t,"Common")}s(Y9,"isCommon"),U9(Y9,"isCommon");function W9(t){return att.isInstance(t,"GitGraph")}s(W9,"isGitGraph"),U9(W9,"isGitGraph");function H9(t){return att.isInstance(t,"Info")}s(H9,"isInfo"),U9(H9,"isInfo");function V9(t){return att.isInstance(t,"Merge")}s(V9,"isMerge"),U9(V9,"isMerge");function X9(t){return att.isInstance(t,"Packet")}s(X9,"isPacket"),U9(X9,"isPacket");function K9(t){return att.isInstance(t,"PacketBlock")}s(K9,"isPacketBlock"),U9(K9,"isPacketBlock");function Z9(t){return att.isInstance(t,"Pie")}s(Z9,"isPie"),U9(Z9,"isPie");function Q9(t){return att.isInstance(t,"PieSection")}s(Q9,"isPieSection"),U9(Q9,"isPieSection");var J9,ttt,ett,ntt,rtt,itt=class extends eK{static{s(this,"MermaidAstReflection")}static{U9(this,"MermaidAstReflection")}getAllTypes(){return["Architecture","Branch","Checkout","CherryPicking","Commit","Common","Direction","Edge","GitGraph","Group","Info","Junction","Merge","Packet","PacketBlock","Pie","PieSection","Service","Statement"]}computeIsSubtype(t,e){switch(t){case"Branch":case"Checkout":case"CherryPicking":case"Commit":case"Merge":return this.isSubtype("Statement",e);case"Direction":return this.isSubtype("GitGraph",e);default:return!1}}getReferenceType(t){const e=`${t.container.$type}:${t.property}`;throw new Error(`${e} is not a valid reference id.`)}getTypeMetaData(t){switch(t){case"Architecture":return{name:"Architecture",properties:[{name:"accDescr"},{name:"accTitle"},{name:"edges",defaultValue:[]},{name:"groups",defaultValue:[]},{name:"junctions",defaultValue:[]},{name:"services",defaultValue:[]},{name:"title"}]};case"Branch":return{name:"Branch",properties:[{name:"name"},{name:"order"}]};case"Checkout":return{name:"Checkout",properties:[{name:"branch"}]};case"CherryPicking":return{name:"CherryPicking",properties:[{name:"id"},{name:"parent"},{name:"tags",defaultValue:[]}]};case"Commit":return{name:"Commit",properties:[{name:"id"},{name:"message"},{name:"tags",defaultValue:[]},{name:"type"}]};case"Common":return{name:"Common",properties:[{name:"accDescr"},{name:"accTitle"},{name:"title"}]};case"Edge":return{name:"Edge",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"GitGraph":return{name:"GitGraph",properties:[{name:"accDescr"},{name:"accTitle"},{name:"statements",defaultValue:[]},{name:"title"}]};case"Group":return{name:"Group",properties:[{name:"icon"},{name:"id"},{name:"in"},{name:"title"}]};case"Info":return{name:"Info",properties:[{name:"accDescr"},{name:"accTitle"},{name:"title"}]};case"Junction":return{name:"Junction",properties:[{name:"id"},{name:"in"}]};case"Merge":return{name:"Merge",properties:[{name:"branch"},{name:"id"},{name:"tags",defaultValue:[]},{name:"type"}]};case"Packet":return{name:"Packet",properties:[{name:"accDescr"},{name:"accTitle"},{name:"blocks",defaultValue:[]},{name:"title"}]};case"PacketBlock":return{name:"PacketBlock",properties:[{name:"end"},{name:"label"},{name:"start"}]};case"Pie":return{name:"Pie",properties:[{name:"accDescr"},{name:"accTitle"},{name:"sections",defaultValue:[]},{name:"showData",defaultValue:!1},{name:"title"}]};case"PieSection":return{name:"PieSection",properties:[{name:"label"},{name:"value"}]};case"Service":return{name:"Service",properties:[{name:"icon"},{name:"iconText"},{name:"id"},{name:"in"},{name:"title"}]};case"Direction":return{name:"Direction",properties:[{name:"accDescr"},{name:"accTitle"},{name:"dir"},{name:"statements",defaultValue:[]},{name:"title"}]};default:return{name:t,properties:[]}}}},att=new itt,stt=U9((()=>J9??(J9=F9('{"$type":"Grammar","isDeclared":true,"name":"Info","imports":[],"rules":[{"$type":"ParserRule","name":"Info","entry":true,"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"info"},{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"Keyword","value":"showInfo"},{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[],"cardinality":"*"}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[],"cardinality":"?"}]},"definesHiddenTokens":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"TitleAndAccessibilities","fragment":true,"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@2"},"arguments":[]}],"cardinality":"+"},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"EOL","fragment":true,"dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/"},"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","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":[{"$type":"Interface","name":"Common","attributes":[{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"types":[],"usedGrammars":[]}'))),"InfoGrammar"),ott=U9((()=>ttt??(ttt=F9('{"$type":"Grammar","isDeclared":true,"name":"Packet","imports":[],"rules":[{"$type":"ParserRule","name":"Packet","entry":true,"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"packet-beta"},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"Assignment","feature":"blocks","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]},"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[],"cardinality":"+"},{"$type":"Assignment","feature":"blocks","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]},"cardinality":"+"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[],"cardinality":"*"}]}]},"definesHiddenTokens":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"PacketBlock","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"start","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"-"},{"$type":"Assignment","feature":"end","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"?"},{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":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":"STRING","definition":{"$type":"RegexToken","regex":"/\\"[^\\"]*\\"|\'[^\']*\'/"},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"TitleAndAccessibilities","fragment":true,"definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}],"cardinality":"+"},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"EOL","fragment":true,"dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/"},"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","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":[{"$type":"Interface","name":"Common","attributes":[{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"types":[],"usedGrammars":[]}'))),"PacketGrammar"),ltt=U9((()=>ett??(ett=F9('{"$type":"Grammar","isDeclared":true,"name":"Pie","imports":[],"rules":[{"$type":"ParserRule","name":"Pie","entry":true,"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"pie"},{"$type":"Assignment","feature":"showData","operator":"?=","terminal":{"$type":"Keyword","value":"showData"},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"Assignment","feature":"sections","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]},"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[],"cardinality":"+"},{"$type":"Assignment","feature":"sections","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]},"cardinality":"+"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"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@2"},"arguments":[]}},{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"PIE_SECTION_LABEL","definition":{"$type":"RegexToken","regex":"/\\"[^\\"]+\\"/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"PIE_SECTION_VALUE","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/(0|[1-9][0-9]*)(\\\\.[0-9]+)?/"},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"TitleAndAccessibilities","fragment":true,"definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}],"cardinality":"+"},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"EOL","fragment":true,"dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/"},"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","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":[{"$type":"Interface","name":"Common","attributes":[{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"types":[],"usedGrammars":[]}'))),"PieGrammar"),ctt=U9((()=>ntt??(ntt=F9('{"$type":"Grammar","isDeclared":true,"name":"Architecture","imports":[],"rules":[{"$type":"ParserRule","name":"Architecture","entry":true,"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"architecture-beta"},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}]},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[],"cardinality":"*"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[],"cardinality":"*"}]}]},"definesHiddenTokens":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Statement","fragment":true,"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","name":"LeftPort","fragment":true,"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","name":"RightPort","fragment":true,"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","name":"Arrow","fragment":true,"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]},{"$type":"Assignment","feature":"lhsInto","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"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@13"},"arguments":[]}},{"$type":"Keyword","value":"-"}]}]},{"$type":"Assignment","feature":"rhsInto","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"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@10"},"arguments":[]}},{"$type":"Assignment","feature":"icon","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},"cardinality":"?"},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"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@10"},"arguments":[]}},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"iconText","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"Assignment","feature":"icon","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}}],"cardinality":"?"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},"cardinality":"?"},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"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@10"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"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@10"},"arguments":[]}},{"$type":"Assignment","feature":"lhsGroup","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"Assignment","feature":"rhsId","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Assignment","feature":"rhsGroup","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"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":"ARCH_ID","definition":{"$type":"RegexToken","regex":"/[\\\\w]+/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARCH_TEXT_ICON","definition":{"$type":"RegexToken","regex":"/\\\\(\\"[^\\"]+\\"\\\\)/"},"fragment":false,"hidden":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},{"$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","name":"TitleAndAccessibilities","fragment":true,"definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}],"cardinality":"+"},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"EOL","fragment":true,"dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/"},"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","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":[{"$type":"Interface","name":"Common","attributes":[{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"types":[],"usedGrammars":[]}'))),"ArchitectureGrammar"),htt=U9((()=>rtt??(rtt=F9('{"$type":"Grammar","isDeclared":true,"name":"GitGraph","interfaces":[{"$type":"Interface","name":"Common","attributes":[{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"rules":[{"$type":"ParserRule","name":"TitleAndAccessibilities","fragment":true,"definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}],"cardinality":"+"},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"EOL","fragment":true,"dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/"},"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","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":"ParserRule","name":"GitGraph","entry":true,"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"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@12"},"arguments":[]},{"$type":"Keyword","value":":"}]}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]},{"$type":"Assignment","feature":"statements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}],"cardinality":"*"}]}]},"definesHiddenTokens":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Statement","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"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@20"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"msg:","cardinality":"?"},{"$type":"Assignment","feature":"message","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"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@1"},"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@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"order:"},{"$type":"Assignment","feature":"order","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"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@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}]}},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"id:"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"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@1"},"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@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"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@20"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"parent:"},{"$type":"Assignment","feature":"parent","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}]}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+(?=\\\\s)/"},"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":"STRING","definition":{"$type":"RegexToken","regex":"/\\"[^\\"]*\\"|\'[^\']*\'/"},"fragment":false,"hidden":false}],"definesHiddenTokens":false,"hiddenTokens":[],"imports":[],"types":[],"usedGrammars":[]}'))),"GitGraphGrammar"),utt={languageId:"info",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1},dtt={languageId:"packet",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1},ptt={languageId:"pie",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1},gtt={languageId:"architecture",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1},ftt={languageId:"gitGraph",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1},mtt={AstReflection:U9((()=>new itt),"AstReflection")},ytt={Grammar:U9((()=>stt()),"Grammar"),LanguageMetaData:U9((()=>utt),"LanguageMetaData"),parser:{}},vtt={Grammar:U9((()=>ott()),"Grammar"),LanguageMetaData:U9((()=>dtt),"LanguageMetaData"),parser:{}},xtt={Grammar:U9((()=>ltt()),"Grammar"),LanguageMetaData:U9((()=>ptt),"LanguageMetaData"),parser:{}},btt={Grammar:U9((()=>ctt()),"Grammar"),LanguageMetaData:U9((()=>gtt),"LanguageMetaData"),parser:{}},wtt={Grammar:U9((()=>htt()),"Grammar"),LanguageMetaData:U9((()=>ftt),"LanguageMetaData"),parser:{}},ktt={ACC_DESCR:/accDescr(?:[\t ]*:([^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/accTitle[\t ]*:([^\n\r]*)/,TITLE:/title([\t ][^\n\r]*|)/},Ttt=class extends N7{static{s(this,"AbstractMermaidValueConverter")}static{U9(this,"AbstractMermaidValueConverter")}runConverter(t,e,n){let r=this.runCommonConverter(t,e,n);return void 0===r&&(r=this.runCustomConverter(t,e,n)),void 0===r?super.runConverter(t,e,n):r}runCommonConverter(t,e,n){const r=ktt[t.name];if(void 0===r)return;const i=r.exec(e);return null!==i?void 0!==i[1]?i[1].trim().replace(/[\t ]{2,}/gm," "):void 0!==i[2]?i[2].replace(/^\s*/gm,"").replace(/\s+$/gm,"").replace(/[\t ]{2,}/gm," ").replace(/[\n\r]{2,}/gm,"\n"):void 0:void 0}},_tt=class extends Ttt{static{s(this,"CommonValueConverter")}static{U9(this,"CommonValueConverter")}runCustomConverter(t,e,n){}},Ett=class extends L7{static{s(this,"AbstractMermaidTokenBuilder")}static{U9(this,"AbstractMermaidTokenBuilder")}constructor(t){super(),this.keywords=new Set(t)}buildKeywordTokens(t,e,n){const r=super.buildKeywordTokens(t,e,n);return r.forEach((t=>{this.keywords.has(t.name)&&void 0!==t.PATTERN&&(t.PATTERN=new RegExp(t.PATTERN.toString()+"(?:(?=%%)|(?!\\S))"))})),r}};(class extends Ett{static{s(this,"CommonTokenBuilder")}static{U9(this,"CommonTokenBuilder")}});var Ctt={},Stt={info:U9((async()=>{const{createInfoServices:t}=await Promise.resolve().then((function(){return uMt})),e=t().Info.parser.LangiumParser;Ctt.info=e}),"info"),packet:U9((async()=>{const{createPacketServices:t}=await Promise.resolve().then((function(){return dMt})),e=t().Packet.parser.LangiumParser;Ctt.packet=e}),"packet"),pie:U9((async()=>{const{createPieServices:t}=await Promise.resolve().then((function(){return pMt})),e=t().Pie.parser.LangiumParser;Ctt.pie=e}),"pie"),architecture:U9((async()=>{const{createArchitectureServices:t}=await Promise.resolve().then((function(){return gMt})),e=t().Architecture.parser.LangiumParser;Ctt.architecture=e}),"architecture"),gitGraph:U9((async()=>{const{createGitGraphServices:t}=await Promise.resolve().then((function(){return fMt})),e=t().GitGraph.parser.LangiumParser;Ctt.gitGraph=e}),"gitGraph")};async function Att(t,e){const n=Stt[t];if(!n)throw new Error(`Unknown diagram type: ${t}`);Ctt[t]||await n();const r=Ctt[t].parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new Ltt(r);return r.value}s(Att,"parse"),U9(Att,"parse");var Ltt=class extends Error{static{s(this,"MermaidParseError")}constructor(t){super(`Parsing failed: ${t.lexerErrors.map((t=>t.message)).join("\n")} ${t.parserErrors.map((t=>t.message)).join("\n")}`),this.result=t}static{U9(this,"MermaidParseError")}},Ntt=class extends Ett{static{s(this,"PieTokenBuilder")}static{U9(this,"PieTokenBuilder")}constructor(){super(["pie","showData"])}},Itt=class extends Ttt{static{s(this,"PieValueConverter")}static{U9(this,"PieValueConverter")}runCustomConverter(t,e,n){if("PIE_SECTION_LABEL"===t.name)return e.replace(/"/g,"").trim()}},Mtt={parser:{TokenBuilder:U9((()=>new Ntt),"TokenBuilder"),ValueConverter:U9((()=>new Itt),"ValueConverter")}};function Rtt(t=O9){const e=C9(E9(t),mtt),n=C9(_9({shared:e}),xtt,Mtt);return e.ServiceRegistry.register(n),{shared:e,Pie:n}}s(Rtt,"createPieServices"),U9(Rtt,"createPieServices");var Dtt=class extends Ett{static{s(this,"ArchitectureTokenBuilder")}static{U9(this,"ArchitectureTokenBuilder")}constructor(){super(["architecture"])}},Ott=class extends Ttt{static{s(this,"ArchitectureValueConverter")}static{U9(this,"ArchitectureValueConverter")}runCustomConverter(t,e,n){return"ARCH_ICON"===t.name?e.replace(/[()]/g,"").trim():"ARCH_TEXT_ICON"===t.name?e.replace(/["()]/g,""):"ARCH_TITLE"===t.name?e.replace(/[[\]]/g,"").trim():void 0}},Ptt={parser:{TokenBuilder:U9((()=>new Dtt),"TokenBuilder"),ValueConverter:U9((()=>new Ott),"ValueConverter")}};function Btt(t=O9){const e=C9(E9(t),mtt),n=C9(_9({shared:e}),btt,Ptt);return e.ServiceRegistry.register(n),{shared:e,Architecture:n}}s(Btt,"createArchitectureServices"),U9(Btt,"createArchitectureServices");var $tt=class extends Ett{static{s(this,"GitGraphTokenBuilder")}static{U9(this,"GitGraphTokenBuilder")}constructor(){super(["gitGraph"])}},Ftt={parser:{TokenBuilder:U9((()=>new $tt),"TokenBuilder"),ValueConverter:U9((()=>new _tt),"ValueConverter")}};function ztt(t=O9){const e=C9(E9(t),mtt),n=C9(_9({shared:e}),wtt,Ftt);return e.ServiceRegistry.register(n),{shared:e,GitGraph:n}}s(ztt,"createGitGraphServices"),U9(ztt,"createGitGraphServices");var Utt=class extends Ett{static{s(this,"InfoTokenBuilder")}static{U9(this,"InfoTokenBuilder")}constructor(){super(["info","showInfo"])}},Gtt={parser:{TokenBuilder:U9((()=>new Utt),"TokenBuilder"),ValueConverter:U9((()=>new _tt),"ValueConverter")}};function qtt(t=O9){const e=C9(E9(t),mtt),n=C9(_9({shared:e}),ytt,Gtt);return e.ServiceRegistry.register(n),{shared:e,Info:n}}s(qtt,"createInfoServices"),U9(qtt,"createInfoServices");var jtt=class extends Ett{static{s(this,"PacketTokenBuilder")}static{U9(this,"PacketTokenBuilder")}constructor(){super(["packet-beta"])}},Ytt={parser:{TokenBuilder:U9((()=>new jtt),"TokenBuilder"),ValueConverter:U9((()=>new _tt),"ValueConverter")}};function Wtt(t=O9){const e=C9(E9(t),mtt),n=C9(_9({shared:e}),vtt,Ytt);return e.ServiceRegistry.register(n),{shared:e,Packet:n}}s(Wtt,"createPacketServices"),U9(Wtt,"createPacketServices");var Htt={NORMAL:0,REVERSE:1,HIGHLIGHT:2,MERGE:3,CHERRY_PICK:4},Vtt=Ct.gitGraph,Xtt=s((()=>mk({...Vtt,...Ft().gitGraph})),"getConfig"),Ktt=new qX((()=>{const t=Xtt(),e=t.mainBranchName,n=t.mainBranchOrder;return{mainBranchName:e,commits:new Map,head:null,branchConfig:new Map([[e,{name:e,order:n}]]),branches:new Map([[e,null]]),currBranch:e,direction:"LR",seq:0,options:{}}}));function Ztt(){return nk({length:7})}function Qtt(t,e){const n=Object.create(null);return t.reduce(((t,r)=>{const i=e(r);return n[i]||(n[i]=!0,t.push(r)),t}),[])}s(Ztt,"getID"),s(Qtt,"uniqBy");var Jtt=s((function(t){Ktt.records.direction=t}),"setDirection"),tet=s((function(t){m.debug("options str",t),t=t?.trim(),t=t||"{}";try{Ktt.records.options=JSON.parse(t)}catch(t){m.error("error while parsing gitGraph options",t.message)}}),"setOptions"),eet=s((function(){return Ktt.records.options}),"getOptions"),net=s((function(t){let e=t.msg,n=t.id;const r=t.type;let i=t.tags;m.info("commit",e,n,r,i),m.debug("Entering commit:",e,n,r,i);const a=Xtt();n=_n.sanitizeText(n,a),e=_n.sanitizeText(e,a),i=i?.map((t=>_n.sanitizeText(t,a)));const s={id:n||Ktt.records.seq+"-"+Ztt(),message:e,seq:Ktt.records.seq++,type:r??Htt.NORMAL,tags:i??[],parents:null==Ktt.records.head?[]:[Ktt.records.head.id],branch:Ktt.records.currBranch};Ktt.records.head=s,m.info("main branch",a.mainBranchName),Ktt.records.commits.set(s.id,s),Ktt.records.branches.set(Ktt.records.currBranch,s.id),m.debug("in pushCommit "+s.id)}),"commit"),ret=s((function(t){let e=t.name;const n=t.order;if(e=_n.sanitizeText(e,Xtt()),Ktt.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}")`);Ktt.records.branches.set(e,null!=Ktt.records.head?Ktt.records.head.id:null),Ktt.records.branchConfig.set(e,{name:e,order:n}),set(e),m.debug("in createBranch")}),"branch"),iet=s((t=>{let e=t.branch,n=t.id;const r=t.type,i=t.tags,a=Xtt();e=_n.sanitizeText(e,a),n&&(n=_n.sanitizeText(n,a));const s=Ktt.records.branches.get(Ktt.records.currBranch),o=Ktt.records.branches.get(e),l=s?Ktt.records.commits.get(s):void 0,c=o?Ktt.records.commits.get(o):void 0;if(l&&c&&l.branch===e)throw new Error(`Cannot merge branch '${e}' into itself.`);if(Ktt.records.currBranch===e){const t=new Error('Incorrect usage of "merge". Cannot merge a branch to itself');throw t.hash={text:`merge ${e}`,token:`merge ${e}`,expected:["branch abc"]},t}if(void 0===l||!l){const t=new Error(`Incorrect usage of "merge". Current branch (${Ktt.records.currBranch})has no commits`);throw t.hash={text:`merge ${e}`,token:`merge ${e}`,expected:["commit"]},t}if(!Ktt.records.branches.has(e)){const t=new Error('Incorrect usage of "merge". Branch to be merged ('+e+") does not exist");throw t.hash={text:`merge ${e}`,token:`merge ${e}`,expected:[`branch ${e}`]},t}if(void 0===c||!c){const t=new Error('Incorrect usage of "merge". Branch to be merged ('+e+") has no commits");throw t.hash={text:`merge ${e}`,token:`merge ${e}`,expected:['"commit"']},t}if(l===c){const t=new Error('Incorrect usage of "merge". Both branches have same head');throw t.hash={text:`merge ${e}`,token:`merge ${e}`,expected:["branch abc"]},t}if(n&&Ktt.records.commits.has(n)){const t=new Error('Incorrect usage of "merge". Commit with id:'+n+" already exists, use different custom Id");throw t.hash={text:`merge ${e} ${n} ${r} ${i?.join(" ")}`,token:`merge ${e} ${n} ${r} ${i?.join(" ")}`,expected:[`merge ${e} ${n}_UNIQUE ${r} ${i?.join(" ")}`]},t}const h=o||"",u={id:n||`${Ktt.records.seq}-${Ztt()}`,message:`merged branch ${e} into ${Ktt.records.currBranch}`,seq:Ktt.records.seq++,parents:null==Ktt.records.head?[]:[Ktt.records.head.id,h],branch:Ktt.records.currBranch,type:Htt.MERGE,customType:r,customId:!!n,tags:i??[]};Ktt.records.head=u,Ktt.records.commits.set(u.id,u),Ktt.records.branches.set(Ktt.records.currBranch,u.id),m.debug(Ktt.records.branches),m.debug("in mergeBranch")}),"merge"),aet=s((function(t){let e=t.id,n=t.targetId,r=t.tags,i=t.parent;m.debug("Entering cherryPick:",e,n,r);const a=Xtt();if(e=_n.sanitizeText(e,a),n=_n.sanitizeText(n,a),r=r?.map((t=>_n.sanitizeText(t,a))),i=_n.sanitizeText(i,a),!e||!Ktt.records.commits.has(e)){const t=new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');throw t.hash={text:`cherryPick ${e} ${n}`,token:`cherryPick ${e} ${n}`,expected:["cherry-pick abc"]},t}const s=Ktt.records.commits.get(e);if(void 0===s||!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===Htt.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(!n||!Ktt.records.commits.has(n)){if(o===Ktt.records.currBranch){const t=new Error('Incorrect usage of "cherryPick". Source commit is already on current branch');throw t.hash={text:`cherryPick ${e} ${n}`,token:`cherryPick ${e} ${n}`,expected:["cherry-pick abc"]},t}const t=Ktt.records.branches.get(Ktt.records.currBranch);if(void 0===t||!t){const t=new Error(`Incorrect usage of "cherry-pick". Current branch (${Ktt.records.currBranch})has no commits`);throw t.hash={text:`cherryPick ${e} ${n}`,token:`cherryPick ${e} ${n}`,expected:["cherry-pick abc"]},t}const a=Ktt.records.commits.get(t);if(void 0===a||!a){const t=new Error(`Incorrect usage of "cherry-pick". Current branch (${Ktt.records.currBranch})has no commits`);throw t.hash={text:`cherryPick ${e} ${n}`,token:`cherryPick ${e} ${n}`,expected:["cherry-pick abc"]},t}const l={id:Ktt.records.seq+"-"+Ztt(),message:`cherry-picked ${s?.message} into ${Ktt.records.currBranch}`,seq:Ktt.records.seq++,parents:null==Ktt.records.head?[]:[Ktt.records.head.id,s.id],branch:Ktt.records.currBranch,type:Htt.CHERRY_PICK,tags:r?r.filter(Boolean):[`cherry-pick:${s.id}${s.type===Htt.MERGE?`|parent:${i}`:""}`]};Ktt.records.head=l,Ktt.records.commits.set(l.id,l),Ktt.records.branches.set(Ktt.records.currBranch,l.id),m.debug(Ktt.records.branches),m.debug("in cherryPick")}}),"cherryPick"),set=s((function(t){if(t=_n.sanitizeText(t,Xtt()),!Ktt.records.branches.has(t)){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}{Ktt.records.currBranch=t;const e=Ktt.records.branches.get(Ktt.records.currBranch);Ktt.records.head=void 0!==e&&e?Ktt.records.commits.get(e)??null:null}}),"checkout");function oet(t,e,n){const r=t.indexOf(e);-1===r?t.push(n):t.splice(r,1,n)}function cet(t){const e=t.reduce(((t,e)=>t.seq>e.seq?t:e),t[0]);let n="";t.forEach((function(t){n+=t===e?"\t*":"\t|"}));const r=[n,e.id,e.seq];for(const t in Ktt.records.branches)Ktt.records.branches.get(t)===e.id&&r.push(t);if(m.debug(r.join(" ")),e.parents&&2==e.parents.length&&e.parents[0]&&e.parents[1]){const n=Ktt.records.commits.get(e.parents[0]);oet(t,e,n),e.parents[1]&&t.push(Ktt.records.commits.get(e.parents[1]))}else{if(0==e.parents.length)return;if(e.parents[0]){const n=Ktt.records.commits.get(e.parents[0]);oet(t,e,n)}}cet(t=Qtt(t,(t=>t.id)))}s(oet,"upsert"),s(cet,"prettyPrintCommitHistory");var het=s((function(){m.debug(Ktt.records.commits);cet([fet()[0]])}),"prettyPrint"),uet=s((function(){Ktt.reset(),$n()}),"clear"),det=s((function(){const t=[...Ktt.records.branchConfig.values()].map(((t,e)=>null!==t.order&&void 0!==t.order?t:{...t,order:parseFloat(`0.${e}`)})).sort(((t,e)=>(t.order??0)-(e.order??0))).map((({name:t})=>({name:t})));return t}),"getBranchesAsObjArray"),pet=s((function(){return Ktt.records.branches}),"getBranches"),get=s((function(){return Ktt.records.commits}),"getCommits"),fet=s((function(){const t=[...Ktt.records.commits.values()];return t.forEach((function(t){m.debug(t.id)})),t.sort(((t,e)=>t.seq-e.seq)),t}),"getCommitsArray"),met={commitType:Htt,getConfig:Xtt,setDirection:Jtt,setOptions:tet,getOptions:eet,commit:net,branch:ret,merge:iet,cherryPick:aet,checkout:set,prettyPrint:het,clear:uet,getBranchesAsObjArray:det,getBranches:pet,getCommits:get,getCommitsArray:fet,getCurrentBranch:s((function(){return Ktt.records.currBranch}),"getCurrentBranch"),getDirection:s((function(){return Ktt.records.direction}),"getDirection"),getHead:s((function(){return Ktt.records.head}),"getHead"),setAccTitle:Fn,getAccTitle:zn,getAccDescription:Gn,setAccDescription:Un,setDiagramTitle:qn,getDiagramTitle:jn},yet=s(((t,e)=>{jX(t,e),t.dir&&e.setDirection(t.dir);for(const n of t.statements)vet(n,e)}),"populate"),vet=s(((t,e)=>{const n={Commit:s((t=>e.commit(xet(t))),"Commit"),Branch:s((t=>e.branch(bet(t))),"Branch"),Merge:s((t=>e.merge(wet(t))),"Merge"),Checkout:s((t=>e.checkout(ket(t))),"Checkout"),CherryPicking:s((t=>e.cherryPick(Tet(t))),"CherryPicking")}[t.$type];n?n(t):m.error(`Unknown statement type: ${t.$type}`)}),"parseStatement"),xet=s((t=>({id:t.id,msg:t.message??"",type:void 0!==t.type?Htt[t.type]:Htt.NORMAL,tags:t.tags??void 0})),"parseCommit"),bet=s((t=>({name:t.name,order:t.order??0})),"parseBranch"),wet=s((t=>({branch:t.branch,id:t.id??"",type:void 0!==t.type?Htt[t.type]:void 0,tags:t.tags??void 0})),"parseMerge"),ket=s((t=>t.branch),"parseCheckout"),Tet=s((t=>({id:t.id,targetId:"",tags:0===t.tags?.length?void 0:t.tags,parent:t.parent})),"parseCherryPicking"),_et={parse:s((async t=>{const e=await Att("gitGraph",t);m.debug(e),yet(e,met)}),"parse")},Eet=Hn()?.gitGraph,Cet=new Map,Aet=new Map,Let=new Map,Net=[],Iet=0,Met="LR",Ret=s((()=>{Cet.clear(),Aet.clear(),Let.clear(),Iet=0,Net=[],Met="LR"}),"clear"),Det=s((t=>{const e=document.createElementNS("http://www.w3.org/2000/svg","text");return("string"==typeof t?t.split(/\\n|\n|<br\s*\/?>/gi):t).forEach((t=>{const n=document.createElementNS("http://www.w3.org/2000/svg","tspan");n.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),n.setAttribute("dy","1em"),n.setAttribute("x","0"),n.setAttribute("class","row"),n.textContent=t.trim(),e.appendChild(n)})),e}),"drawText"),Oet=s((t=>{let e,n,r;return"BT"===Met?(n=s(((t,e)=>t<=e),"comparisonFunc"),r=1/0):(n=s(((t,e)=>t>=e),"comparisonFunc"),r=0),t.forEach((t=>{const i="TB"===Met||"BT"==Met?Aet.get(t)?.y:Aet.get(t)?.x;void 0!==i&&n(i,r)&&(e=t,r=i)})),e}),"findClosestParent"),Pet=s((t=>{let e="",n=1/0;return t.forEach((t=>{const r=Aet.get(t).y;r<=n&&(e=t,n=r)})),e||void 0}),"findClosestParentBT"),Bet=s(((t,e,n)=>{let r=n,i=n;const a=[];t.forEach((t=>{const n=e.get(t);if(!n)throw new Error(`Commit not found for key ${t}`);n.parents.length?(r=Fet(n),i=Math.max(r,i)):a.push(n),zet(n,r)})),r=i,a.forEach((t=>{Uet(t,r,n)})),t.forEach((t=>{const n=e.get(t);if(n?.parents.length){const t=Pet(n.parents);r=Aet.get(t).y-40,r<=i&&(i=r);const e=Cet.get(n.branch).pos,a=r-10;Aet.set(n.id,{x:e,y:a})}}))}),"setParallelBTPos"),$et=s((t=>{const e=Oet(t.parents.filter((t=>null!==t)));if(!e)throw new Error(`Closest parent not found for commit ${t.id}`);const n=Aet.get(e)?.y;if(void 0===n)throw new Error(`Closest parent position not found for commit ${t.id}`);return n}),"findClosestParentPos"),Fet=s((t=>$et(t)+40),"calculateCommitPosition"),zet=s(((t,e)=>{const n=Cet.get(t.branch);if(!n)throw new Error(`Branch not found for commit ${t.id}`);const r=n.pos,i=e+10;return Aet.set(t.id,{x:r,y:i}),{x:r,y:i}}),"setCommitPosition"),Uet=s(((t,e,n)=>{const r=Cet.get(t.branch);if(!r)throw new Error(`Branch not found for commit ${t.id}`);const i=e+n,a=r.pos;Aet.set(t.id,{x:a,y:i})}),"setRootPosition"),Get=s(((t,e,n,r,i,a)=>{if(a===Htt.HIGHLIGHT)t.append("rect").attr("x",n.x-10).attr("y",n.y-10).attr("width",20).attr("height",20).attr("class",`commit ${e.id} commit-highlight${i%8} ${r}-outer`),t.append("rect").attr("x",n.x-6).attr("y",n.y-6).attr("width",12).attr("height",12).attr("class",`commit ${e.id} commit${i%8} ${r}-inner`);else if(a===Htt.CHERRY_PICK)t.append("circle").attr("cx",n.x).attr("cy",n.y).attr("r",10).attr("class",`commit ${e.id} ${r}`),t.append("circle").attr("cx",n.x-3).attr("cy",n.y+2).attr("r",2.75).attr("fill","#fff").attr("class",`commit ${e.id} ${r}`),t.append("circle").attr("cx",n.x+3).attr("cy",n.y+2).attr("r",2.75).attr("fill","#fff").attr("class",`commit ${e.id} ${r}`),t.append("line").attr("x1",n.x+3).attr("y1",n.y+1).attr("x2",n.x).attr("y2",n.y-5).attr("stroke","#fff").attr("class",`commit ${e.id} ${r}`),t.append("line").attr("x1",n.x-3).attr("y1",n.y+1).attr("x2",n.x).attr("y2",n.y-5).attr("stroke","#fff").attr("class",`commit ${e.id} ${r}`);else{const s=t.append("circle");if(s.attr("cx",n.x),s.attr("cy",n.y),s.attr("r",e.type===Htt.MERGE?9:10),s.attr("class",`commit ${e.id} commit${i%8}`),a===Htt.MERGE){const a=t.append("circle");a.attr("cx",n.x),a.attr("cy",n.y),a.attr("r",6),a.attr("class",`commit ${r} ${e.id} commit${i%8}`)}if(a===Htt.REVERSE){t.append("path").attr("d",`M ${n.x-5},${n.y-5}L${n.x+5},${n.y+5}M${n.x-5},${n.y+5}L${n.x+5},${n.y-5}`).attr("class",`commit ${r} ${e.id} commit${i%8}`)}}}),"drawCommitBullet"),qet=s(((t,e,n,r)=>{if(e.type!==Htt.CHERRY_PICK&&(e.customId&&e.type===Htt.MERGE||e.type!==Htt.MERGE)&&Eet?.showCommitLabel){const i=t.append("g"),a=i.insert("rect").attr("class","commit-label-bkg"),s=i.append("text").attr("x",r).attr("y",n.y+25).attr("class","commit-label").text(e.id),o=s.node()?.getBBox();if(o&&(a.attr("x",n.posWithOffset-o.width/2-2).attr("y",n.y+13.5).attr("width",o.width+4).attr("height",o.height+4),"TB"===Met||"BT"===Met?(a.attr("x",n.x-(o.width+16+5)).attr("y",n.y-12),s.attr("x",n.x-(o.width+16)).attr("y",n.y+o.height-12)):s.attr("x",n.posWithOffset-o.width/2),Eet.rotateCommitLabel))if("TB"===Met||"BT"===Met)s.attr("transform","rotate(-45, "+n.x+", "+n.y+")"),a.attr("transform","rotate(-45, "+n.x+", "+n.y+")");else{const t=-7.5-(o.width+10)/25*9.5,e=10+o.width/25*8.5;i.attr("transform","translate("+t+", "+e+") rotate(-45, "+r+", "+n.y+")")}}}),"drawCommitLabel"),jet=s(((t,e,n,r)=>{if(e.tags.length>0){let i=0,a=0,s=0;const o=[];for(const r of e.tags.reverse()){const e=t.insert("polygon"),l=t.append("circle"),c=t.append("text").attr("y",n.y-16-i).attr("class","tag-label").text(r),h=c.node()?.getBBox();if(!h)throw new Error("Tag bbox not found");a=Math.max(a,h.width),s=Math.max(s,h.height),c.attr("x",n.posWithOffset-h.width/2),o.push({tag:c,hole:l,rect:e,yOffset:i}),i+=20}for(const{tag:t,hole:e,rect:i,yOffset:l}of o){const o=s/2,c=n.y-19.2-l;if(i.attr("class","tag-label-bkg").attr("points",`\n ${r-a/2-2},${c+2} \n ${r-a/2-2},${c-2}\n ${n.posWithOffset-a/2-4},${c-o-2}\n ${n.posWithOffset+a/2+4},${c-o-2}\n ${n.posWithOffset+a/2+4},${c+o+2}\n ${n.posWithOffset-a/2-4},${c+o+2}`),e.attr("cy",c).attr("cx",r-a/2+2).attr("r",1.5).attr("class","tag-hole"),"TB"===Met||"BT"===Met){const s=r+l;i.attr("class","tag-label-bkg").attr("points",`\n ${n.x},${s+2}\n ${n.x},${s-2}\n ${n.x+10},${s-o-2}\n ${n.x+10+a+4},${s-o-2}\n ${n.x+10+a+4},${s+o+2}\n ${n.x+10},${s+o+2}`).attr("transform","translate(12,12) rotate(45, "+n.x+","+r+")"),e.attr("cx",n.x+2).attr("cy",s).attr("transform","translate(12,12) rotate(45, "+n.x+","+r+")"),t.attr("x",n.x+5).attr("y",s+3).attr("transform","translate(14,14) rotate(45, "+n.x+","+r+")")}}}}),"drawCommitTags"),Yet=s((t=>{switch(t.customType??t.type){case Htt.NORMAL:return"commit-normal";case Htt.REVERSE:return"commit-reverse";case Htt.HIGHLIGHT:return"commit-highlight";case Htt.MERGE:return"commit-merge";case Htt.CHERRY_PICK:return"commit-cherry-pick";default:return"commit-normal"}}),"getCommitClassType"),Wet=s(((t,e,n,r)=>{const i={x:0,y:0};if(!(t.parents.length>0)){if("TB"===e)return 30;if("BT"===e){return(r.get(t.id)??i).y-40}return 0}{const n=Oet(t.parents);if(n){const a=r.get(n)??i;if("TB"===e)return a.y+40;if("BT"===e){return(r.get(t.id)??i).y-40}return a.x+40}}return 0}),"calculatePosition"),Het=s(((t,e,n)=>{const r="BT"===Met&&n?e:e+10,i="TB"===Met||"BT"===Met?r:Cet.get(t.branch)?.pos,a="TB"===Met||"BT"===Met?Cet.get(t.branch)?.pos:r;if(void 0===a||void 0===i)throw new Error(`Position were undefined for commit ${t.id}`);return{x:a,y:i,posWithOffset:r}}),"getCommitPosition"),Vet=s(((t,e,n)=>{if(!Eet)throw new Error("GitGraph config not found");const r=t.append("g").attr("class","commit-bullets"),i=t.append("g").attr("class","commit-labels");let a="TB"===Met||"BT"===Met?30:0;const o=[...e.keys()],l=Eet?.parallelCommits??!1,c=s(((t,n)=>{const r=e.get(t)?.seq,i=e.get(n)?.seq;return void 0!==r&&void 0!==i?r-i:0}),"sortKeys");let h=o.sort(c);"BT"===Met&&(l&&Bet(h,e,a),h=h.reverse()),h.forEach((t=>{const s=e.get(t);if(!s)throw new Error(`Commit not found for key ${t}`);l&&(a=Wet(s,Met,a,Aet));const o=Het(s,a,l);if(n){const t=Yet(s),e=s.customType??s.type,n=Cet.get(s.branch)?.index??0;Get(r,s,o,t,n,e),qet(i,s,o,a),jet(i,s,o,a)}"TB"===Met||"BT"===Met?Aet.set(s.id,{x:o.x,y:o.posWithOffset}):Aet.set(s.id,{x:o.posWithOffset,y:o.y}),a="BT"===Met&&l?a+40:a+40+10,a>Iet&&(Iet=a)}))}),"drawCommits"),Xet=s(((t,e,n,r,i)=>{const a=("TB"===Met||"BT"===Met?n.x<r.x:n.y<r.y)?e.branch:t.branch,o=s((t=>t.branch===a),"isOnBranchToGetCurve"),l=s((n=>n.seq>t.seq&&n.seq<e.seq),"isBetweenCommits");return[...i.values()].some((t=>l(t)&&o(t)))}),"shouldRerouteArrow"),Ket=s(((t,e,n=0)=>{const r=t+Math.abs(t-e)/2;if(n>5)return r;if(Net.every((t=>Math.abs(t-r)>=10)))return Net.push(r),r;const i=Math.abs(t-e);return Ket(t,e-i/5,n+1)}),"findLane"),Zet=s(((t,e,n,r)=>{const i=Aet.get(e.id),a=Aet.get(n.id);if(void 0===i||void 0===a)throw new Error(`Commit positions not found for commits ${e.id} and ${n.id}`);const s=Xet(e,n,i,a,r);let o,l="",c="",h=0,u=0,d=Cet.get(n.branch)?.index;if(n.type===Htt.MERGE&&e.id!==n.parents[0]&&(d=Cet.get(e.branch)?.index),s){l="A 10 10, 0, 0, 0,",c="A 10 10, 0, 0, 1,",h=10,u=10;const t=i.y<a.y?Ket(i.y,a.y):Ket(a.y,i.y),n=i.x<a.x?Ket(i.x,a.x):Ket(a.x,i.x);"TB"===Met?i.x<a.x?o=`M ${i.x} ${i.y} L ${n-h} ${i.y} ${c} ${n} ${i.y+u} L ${n} ${a.y-h} ${l} ${n+u} ${a.y} L ${a.x} ${a.y}`:(d=Cet.get(e.branch)?.index,o=`M ${i.x} ${i.y} L ${n+h} ${i.y} ${l} ${n} ${i.y+u} L ${n} ${a.y-h} ${c} ${n-u} ${a.y} L ${a.x} ${a.y}`):"BT"===Met?i.x<a.x?o=`M ${i.x} ${i.y} L ${n-h} ${i.y} ${l} ${n} ${i.y-u} L ${n} ${a.y+h} ${c} ${n+u} ${a.y} L ${a.x} ${a.y}`:(d=Cet.get(e.branch)?.index,o=`M ${i.x} ${i.y} L ${n+h} ${i.y} ${c} ${n} ${i.y-u} L ${n} ${a.y+h} ${l} ${n-u} ${a.y} L ${a.x} ${a.y}`):i.y<a.y?o=`M ${i.x} ${i.y} L ${i.x} ${t-h} ${l} ${i.x+u} ${t} L ${a.x-h} ${t} ${c} ${a.x} ${t+u} L ${a.x} ${a.y}`:(d=Cet.get(e.branch)?.index,o=`M ${i.x} ${i.y} L ${i.x} ${t+h} ${c} ${i.x+u} ${t} L ${a.x-h} ${t} ${l} ${a.x} ${t-u} L ${a.x} ${a.y}`)}else l="A 20 20, 0, 0, 0,",c="A 20 20, 0, 0, 1,",h=20,u=20,"TB"===Met?(i.x<a.x&&(o=n.type===Htt.MERGE&&e.id!==n.parents[0]?`M ${i.x} ${i.y} L ${i.x} ${a.y-h} ${l} ${i.x+u} ${a.y} L ${a.x} ${a.y}`:`M ${i.x} ${i.y} L ${a.x-h} ${i.y} ${c} ${a.x} ${i.y+u} L ${a.x} ${a.y}`),i.x>a.x&&(l="A 20 20, 0, 0, 0,",c="A 20 20, 0, 0, 1,",h=20,u=20,o=n.type===Htt.MERGE&&e.id!==n.parents[0]?`M ${i.x} ${i.y} L ${i.x} ${a.y-h} ${c} ${i.x-u} ${a.y} L ${a.x} ${a.y}`:`M ${i.x} ${i.y} L ${a.x+h} ${i.y} ${l} ${a.x} ${i.y+u} L ${a.x} ${a.y}`),i.x===a.x&&(o=`M ${i.x} ${i.y} L ${a.x} ${a.y}`)):"BT"===Met?(i.x<a.x&&(o=n.type===Htt.MERGE&&e.id!==n.parents[0]?`M ${i.x} ${i.y} L ${i.x} ${a.y+h} ${c} ${i.x+u} ${a.y} L ${a.x} ${a.y}`:`M ${i.x} ${i.y} L ${a.x-h} ${i.y} ${l} ${a.x} ${i.y-u} L ${a.x} ${a.y}`),i.x>a.x&&(l="A 20 20, 0, 0, 0,",c="A 20 20, 0, 0, 1,",h=20,u=20,o=n.type===Htt.MERGE&&e.id!==n.parents[0]?`M ${i.x} ${i.y} L ${i.x} ${a.y+h} ${l} ${i.x-u} ${a.y} L ${a.x} ${a.y}`:`M ${i.x} ${i.y} L ${a.x-h} ${i.y} ${l} ${a.x} ${i.y-u} L ${a.x} ${a.y}`),i.x===a.x&&(o=`M ${i.x} ${i.y} L ${a.x} ${a.y}`)):(i.y<a.y&&(o=n.type===Htt.MERGE&&e.id!==n.parents[0]?`M ${i.x} ${i.y} L ${a.x-h} ${i.y} ${c} ${a.x} ${i.y+u} L ${a.x} ${a.y}`:`M ${i.x} ${i.y} L ${i.x} ${a.y-h} ${l} ${i.x+u} ${a.y} L ${a.x} ${a.y}`),i.y>a.y&&(o=n.type===Htt.MERGE&&e.id!==n.parents[0]?`M ${i.x} ${i.y} L ${a.x-h} ${i.y} ${l} ${a.x} ${i.y-u} L ${a.x} ${a.y}`:`M ${i.x} ${i.y} L ${i.x} ${a.y+h} ${c} ${i.x+u} ${a.y} L ${a.x} ${a.y}`),i.y===a.y&&(o=`M ${i.x} ${i.y} L ${a.x} ${a.y}`));if(void 0===o)throw new Error("Line definition not found");t.append("path").attr("d",o).attr("class","arrow arrow"+d%8)}),"drawArrow"),Qet=s(((t,e)=>{const n=t.append("g").attr("class","commit-arrows");[...e.keys()].forEach((t=>{const r=e.get(t);r.parents&&r.parents.length>0&&r.parents.forEach((t=>{Zet(n,e.get(t),r,e)}))}))}),"drawArrows"),Jet=s(((t,e)=>{const n=t.append("g");e.forEach(((t,e)=>{const r=e%8,i=Cet.get(t.name)?.pos;if(void 0===i)throw new Error(`Position not found for branch ${t.name}`);const a=n.append("line");a.attr("x1",0),a.attr("y1",i),a.attr("x2",Iet),a.attr("y2",i),a.attr("class","branch branch"+r),"TB"===Met?(a.attr("y1",30),a.attr("x1",i),a.attr("y2",Iet),a.attr("x2",i)):"BT"===Met&&(a.attr("y1",Iet),a.attr("x1",i),a.attr("y2",30),a.attr("x2",i)),Net.push(i);const s=t.name,o=Det(s),l=n.insert("rect"),c=n.insert("g").attr("class","branchLabel").insert("g").attr("class","label branch-label"+r);c.node().appendChild(o);const h=o.getBBox();l.attr("class","branchLabelBkg label"+r).attr("rx",4).attr("ry",4).attr("x",-h.width-4-(!0===Eet?.rotateCommitLabel?30:0)).attr("y",-h.height/2+8).attr("width",h.width+18).attr("height",h.height+4),c.attr("transform","translate("+(-h.width-14-(!0===Eet?.rotateCommitLabel?30:0))+", "+(i-h.height/2-1)+")"),"TB"===Met?(l.attr("x",i-h.width/2-10).attr("y",0),c.attr("transform","translate("+(i-h.width/2-5)+", 0)")):"BT"===Met?(l.attr("x",i-h.width/2-10).attr("y",Iet),c.attr("transform","translate("+(i-h.width/2-5)+", "+Iet+")")):l.attr("transform","translate(-19, "+(i-h.height/2)+")")}))}),"drawBranches"),tnt=s((function(t,e,n,r,i){return Cet.set(t,{pos:e,index:n}),e+=50+(i?40:0)+("TB"===Met||"BT"===Met?r.width/2:0)}),"setBranchPosition"),ent=s((function(t,e,n,r){if(Ret(),m.debug("in gitgraph renderer",t+"\n","id:",e,n),!Eet)throw new Error("GitGraph config not found");const i=Eet.rotateCommitLabel??!1,a=r.db;Let=a.getCommits();const s=a.getBranchesAsObjArray();Met=a.getDirection();const o=Oa(`[id="${e}"]`);let l=0;s.forEach(((t,e)=>{const n=Det(t.name),r=o.append("g"),a=r.insert("g").attr("class","branchLabel"),s=a.insert("g").attr("class","label branch-label");s.node()?.appendChild(n);const c=n.getBBox();l=tnt(t.name,l,e,c,i),s.remove(),a.remove(),r.remove()})),Vet(o,Let,!1),Eet.showBranches&&Jet(o,s),Qet(o,Let),Vet(o,Let,!0),yk.insertTitle(o,"gitTitleText",Eet.titleTopMargin??0,a.getDiagramTitle()),Zn(void 0,o,Eet.diagramPadding,Eet.useMaxWidth)}),"draw"),nnt={draw:ent},rnt=s((t=>`\n .commit-id,\n .commit-msg,\n .branch-label {\n fill: lightgrey;\n color: lightgrey;\n font-family: 'trebuchet ms', verdana, arial, sans-serif;\n font-family: var(--mermaid-font-family);\n }\n ${[0,1,2,3,4,5,6,7].map((e=>`\n .branch-label${e} { fill: ${t["gitBranchLabel"+e]}; }\n .commit${e} { stroke: ${t["git"+e]}; fill: ${t["git"+e]}; }\n .commit-highlight${e} { stroke: ${t["gitInv"+e]}; fill: ${t["gitInv"+e]}; }\n .label${e} { fill: ${t["git"+e]}; }\n .arrow${e} { stroke: ${t["git"+e]}; }\n `)).join("\n")}\n\n .branch {\n stroke-width: 1;\n stroke: ${t.lineColor};\n stroke-dasharray: 2;\n }\n .commit-label { font-size: ${t.commitLabelFontSize}; fill: ${t.commitLabelColor};}\n .commit-label-bkg { font-size: ${t.commitLabelFontSize}; fill: ${t.commitLabelBackground}; opacity: 0.5; }\n .tag-label { font-size: ${t.tagLabelFontSize}; fill: ${t.tagLabelColor};}\n .tag-label-bkg { fill: ${t.tagLabelBackground}; stroke: ${t.tagLabelBorder}; }\n .tag-hole { fill: ${t.textColor}; }\n\n .commit-merge {\n stroke: ${t.primaryColor};\n fill: ${t.primaryColor};\n }\n .commit-reverse {\n stroke: ${t.primaryColor};\n fill: ${t.primaryColor};\n stroke-width: 3;\n }\n .commit-highlight-outer {\n }\n .commit-highlight-inner {\n stroke: ${t.primaryColor};\n fill: ${t.primaryColor};\n }\n\n .arrow { stroke-width: 8; stroke-linecap: round; fill: none}\n .gitTitleText {\n text-anchor: middle;\n font-size: 18px;\n fill: ${t.textColor};\n }\n`),"getStyles"),int={parser:_et,db:met,renderer:nnt,styles:rnt},ant=Object.freeze({__proto__:null,diagram:int}),snt=o({"../../node_modules/.pnpm/dayjs@1.11.13/node_modules/dayjs/plugin/isoWeek.js"(t,e){!function(n,r){"object"==typeof t&&void 0!==e?e.exports=r():"function"==typeof define&&define.amd?define(r):(n="undefined"!=typeof globalThis?globalThis:n||self).dayjs_plugin_isoWeek=r()}(t,(function(){var t="day";return function(e,n,r){var i=s((function(e){return e.add(4-e.isoWeekday(),t)}),"a"),a=n.prototype;a.isoWeekYear=function(){return i(this).year()},a.isoWeek=function(e){if(!this.$utils().u(e))return this.add(7*(e-this.isoWeek()),t);var n,a,s,o=i(this),l=(n=this.isoWeekYear(),s=4-(a=(this.$u?r.utc:r)().year(n).startOf("year")).isoWeekday(),a.isoWeekday()>4&&(s+=7),a.add(s,t));return o.diff(l,"week")+1},a.isoWeekday=function(t){return this.$utils().u(t)?this.day()||7:this.day(this.day()%7?t:t-7)};var o=a.startOf;a.startOf=function(t,e){var n=this.$utils(),r=!!n.u(e)||e;return"isoweek"===n.p(t)?r?this.date(this.date()-(this.isoWeekday()-1)).startOf("day"):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf("day"):o.bind(this)(t,e)}}}))}}),ont=o({"../../node_modules/.pnpm/dayjs@1.11.13/node_modules/dayjs/plugin/customParseFormat.js"(t,e){!function(n,r){"object"==typeof t&&void 0!==e?e.exports=r():"function"==typeof define&&define.amd?define(r):(n="undefined"!=typeof globalThis?globalThis:n||self).dayjs_plugin_customParseFormat=r()}(t,(function(){var t={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"},e=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,n=/\d/,r=/\d\d/,i=/\d\d?/,a=/\d*[^-_:/,()\s\d]+/,o={},l=s((function(t){return(t=+t)+(t>68?1900:2e3)}),"a"),c=s((function(t){return function(e){this[t]=+e}}),"f"),h=[/[+-]\d\d:?(\d\d)?|Z/,function(t){(this.zone||(this.zone={})).offset=function(t){if(!t)return 0;if("Z"===t)return 0;var e=t.match(/([+-]|\d\d)/g),n=60*e[1]+(+e[2]||0);return 0===n?0:"+"===e[0]?-n:n}(t)}],u=s((function(t){var e=o[t];return e&&(e.indexOf?e:e.s.concat(e.f))}),"u"),d=s((function(t,e){var n,r=o.meridiem;if(r){for(var i=1;i<=24;i+=1)if(t.indexOf(r(i,0,e))>-1){n=i>12;break}}else n=t===(e?"pm":"PM");return n}),"d"),p={A:[a,function(t){this.afternoon=d(t,!1)}],a:[a,function(t){this.afternoon=d(t,!0)}],Q:[n,function(t){this.month=3*(t-1)+1}],S:[n,function(t){this.milliseconds=100*+t}],SS:[r,function(t){this.milliseconds=10*+t}],SSS:[/\d{3}/,function(t){this.milliseconds=+t}],s:[i,c("seconds")],ss:[i,c("seconds")],m:[i,c("minutes")],mm:[i,c("minutes")],H:[i,c("hours")],h:[i,c("hours")],HH:[i,c("hours")],hh:[i,c("hours")],D:[i,c("day")],DD:[r,c("day")],Do:[a,function(t){var e=o.ordinal,n=t.match(/\d+/);if(this.day=n[0],e)for(var r=1;r<=31;r+=1)e(r).replace(/\[|\]/g,"")===t&&(this.day=r)}],w:[i,c("week")],ww:[r,c("week")],M:[i,c("month")],MM:[r,c("month")],MMM:[a,function(t){var e=u("months"),n=(u("monthsShort")||e.map((function(t){return t.slice(0,3)}))).indexOf(t)+1;if(n<1)throw new Error;this.month=n%12||n}],MMMM:[a,function(t){var e=u("months").indexOf(t)+1;if(e<1)throw new Error;this.month=e%12||e}],Y:[/[+-]?\d+/,c("year")],YY:[r,function(t){this.year=l(t)}],YYYY:[/\d{4}/,c("year")],Z:h,ZZ:h};function g(n){var r,i;r=n,i=o&&o.formats;for(var a=(n=r.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(e,n,r){var a=r&&r.toUpperCase();return n||i[r]||t[r]||i[a].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(t,e,n){return e||n.slice(1)}))}))).match(e),s=a.length,l=0;l<s;l+=1){var c=a[l],h=p[c],u=h&&h[0],d=h&&h[1];a[l]=d?{regex:u,parser:d}:c.replace(/^\[|\]$/g,"")}return function(t){for(var e={},n=0,r=0;n<s;n+=1){var i=a[n];if("string"==typeof i)r+=i.length;else{var o=i.regex,l=i.parser,c=t.slice(r),h=o.exec(c)[0];l.call(e,h),t=t.replace(h,"")}}return function(t){var e=t.afternoon;if(void 0!==e){var n=t.hours;e?n<12&&(t.hours+=12):12===n&&(t.hours=0),delete t.afternoon}}(e),e}}return s(g,"l"),function(t,e,n){n.p.customParseFormat=!0,t&&t.parseTwoDigitYear&&(l=t.parseTwoDigitYear);var r=e.prototype,i=r.parse;r.parse=function(t){var e=t.date,r=t.utc,a=t.args;this.$u=r;var s=a[1];if("string"==typeof s){var l=!0===a[2],c=!0===a[3],h=l||c,u=a[2];c&&(u=a[2]),o=this.$locale(),!l&&u&&(o=n.Ls[u]),this.$d=function(t,e,n,r){try{if(["x","X"].indexOf(e)>-1)return new Date(("X"===e?1e3:1)*t);var i=g(e)(t),a=i.year,s=i.month,o=i.day,l=i.hours,c=i.minutes,h=i.seconds,u=i.milliseconds,d=i.zone,p=i.week,f=new Date,m=o||(a||s?1:f.getDate()),y=a||f.getFullYear(),v=0;a&&!s||(v=s>0?s-1:f.getMonth());var x,b=l||0,w=c||0,k=h||0,T=u||0;return d?new Date(Date.UTC(y,v,m,b,w,k,T+60*d.offset*1e3)):n?new Date(Date.UTC(y,v,m,b,w,k,T)):(x=new Date(y,v,m,b,w,k,T),p&&(x=r(x).week(p).toDate()),x)}catch(t){return new Date("")}}(e,s,r,n),this.init(),u&&!0!==u&&(this.$L=this.locale(u).$L),h&&e!=this.format(s)&&(this.$d=new Date("")),o={}}else if(s instanceof Array)for(var d=s.length,p=1;p<=d;p+=1){a[1]=s[p-1];var f=n.apply(this,a);if(f.isValid()){this.$d=f.$d,this.$L=f.$L,this.init();break}p===d&&(this.$d=new Date(""))}else i.call(this,t)}}}))}}),lnt=o({"../../node_modules/.pnpm/dayjs@1.11.13/node_modules/dayjs/plugin/advancedFormat.js"(t,e){!function(n,r){"object"==typeof t&&void 0!==e?e.exports=r():"function"==typeof define&&define.amd?define(r):(n="undefined"!=typeof globalThis?globalThis:n||self).dayjs_plugin_advancedFormat=r()}(t,(function(){return function(t,e){var n=e.prototype,r=n.format;n.format=function(t){var e=this,n=this.$locale();if(!this.isValid())return r.bind(this)(t);var i=this.$utils(),a=(t||"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(t){switch(t){case"Q":return Math.ceil((e.$M+1)/3);case"Do":return n.ordinal(e.$D);case"gggg":return e.weekYear();case"GGGG":return e.isoWeekYear();case"wo":return n.ordinal(e.week(),"W");case"w":case"ww":return i.s(e.week(),"w"===t?1:2,"0");case"W":case"WW":return i.s(e.isoWeek(),"W"===t?1:2,"0");case"k":case"kk":return i.s(String(0===e.$H?24:e.$H),"k"===t?1:2,"0");case"X":return Math.floor(e.$d.getTime()/1e3);case"x":return e.$d.getTime();case"z":return"["+e.offsetName()+"]";case"zzz":return"["+e.offsetName("long")+"]";default:return t}}));return r.bind(this)(a)}}}))}}),cnt=function(){var t=s((function(t,e,n,r){for(n=n||{},r=t.length;r--;n[t[r]]=e);return n}),"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],n=[1,26],r=[1,27],i=[1,28],a=[1,29],o=[1,30],l=[1,31],c=[1,32],h=[1,33],u=[1,34],d=[1,9],p=[1,10],g=[1,11],f=[1,12],m=[1,13],y=[1,14],v=[1,15],x=[1,16],b=[1,19],w=[1,20],k=[1,21],T=[1,22],_=[1,23],E=[1,25],C=[1,35],S={trace:s((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:s((function(t,e,n,r,i,a,s){var o=a.length-1;switch(i){case 1:return a[o-1];case 2:case 6:case 7:this.$=[];break;case 3:a[o-1].push(a[o]),this.$=a[o-1];break;case 4:case 5:this.$=a[o];break;case 8:r.setWeekday("monday");break;case 9:r.setWeekday("tuesday");break;case 10:r.setWeekday("wednesday");break;case 11:r.setWeekday("thursday");break;case 12:r.setWeekday("friday");break;case 13:r.setWeekday("saturday");break;case 14:r.setWeekday("sunday");break;case 15:r.setWeekend("friday");break;case 16:r.setWeekend("saturday");break;case 17:r.setDateFormat(a[o].substr(11)),this.$=a[o].substr(11);break;case 18:r.enableInclusiveEndDates(),this.$=a[o].substr(18);break;case 19:r.TopAxis(),this.$=a[o].substr(8);break;case 20:r.setAxisFormat(a[o].substr(11)),this.$=a[o].substr(11);break;case 21:r.setTickInterval(a[o].substr(13)),this.$=a[o].substr(13);break;case 22:r.setExcludes(a[o].substr(9)),this.$=a[o].substr(9);break;case 23:r.setIncludes(a[o].substr(9)),this.$=a[o].substr(9);break;case 24:r.setTodayMarker(a[o].substr(12)),this.$=a[o].substr(12);break;case 27:r.setDiagramTitle(a[o].substr(6)),this.$=a[o].substr(6);break;case 28:this.$=a[o].trim(),r.setAccTitle(this.$);break;case 29:case 30:this.$=a[o].trim(),r.setAccDescription(this.$);break;case 31:r.addSection(a[o].substr(8)),this.$=a[o].substr(8);break;case 33:r.addTask(a[o-1],a[o]),this.$="task";break;case 34:this.$=a[o-1],r.setClickEvent(a[o-1],a[o],null);break;case 35:this.$=a[o-2],r.setClickEvent(a[o-2],a[o-1],a[o]);break;case 36:this.$=a[o-2],r.setClickEvent(a[o-2],a[o-1],null),r.setLink(a[o-2],a[o]);break;case 37:this.$=a[o-3],r.setClickEvent(a[o-3],a[o-2],a[o-1]),r.setLink(a[o-3],a[o]);break;case 38:this.$=a[o-2],r.setClickEvent(a[o-2],a[o],null),r.setLink(a[o-2],a[o-1]);break;case 39:this.$=a[o-3],r.setClickEvent(a[o-3],a[o-1],a[o]),r.setLink(a[o-3],a[o-2]);break;case 40:this.$=a[o-1],r.setLink(a[o-1],a[o]);break;case 41:case 47:this.$=a[o-1]+" "+a[o];break;case 42:case 43:case 45:this.$=a[o-2]+" "+a[o-1]+" "+a[o];break;case 44:case 46:this.$=a[o-3]+" "+a[o-2]+" "+a[o-1]+" "+a[o]}}),"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:n,13:r,14:i,15:a,16:o,17:l,18:c,19:18,20:h,21:u,22:d,23:p,24:g,25:f,26:m,27:y,28:v,29:x,30:b,31:w,33:k,35:T,36:_,37:24,38:E,40:C},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:36,11:17,12:n,13:r,14:i,15:a,16:o,17:l,18:c,19:18,20:h,21:u,22:d,23:p,24:g,25:f,26:m,27:y,28:v,29:x,30:b,31:w,33:k,35:T,36:_,37:24,38:E,40:C},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:s((function(t,e){if(!e.recoverable){var n=new Error(t);throw n.hash=e,n}this.trace(t)}),"parseError"),parse:s((function(t){var e=this,n=[0],r=[],i=[null],a=[],o=this.table,l="",c=0,h=0,u=2,d=1,p=a.slice.call(arguments,1),g=Object.create(this.lexer),f={yy:{}};for(var m in this.yy)Object.prototype.hasOwnProperty.call(this.yy,m)&&(f.yy[m]=this.yy[m]);g.setInput(t,f.yy),f.yy.lexer=g,f.yy.parser=this,void 0===g.yylloc&&(g.yylloc={});var y=g.yylloc;a.push(y);var v=g.options&&g.options.ranges;function x(t){n.length=n.length-2*t,i.length=i.length-t,a.length=a.length-t}function b(){var t;return"number"!=typeof(t=r.pop()||g.lex()||d)&&(t instanceof Array&&(t=(r=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof f.yy.parseError?this.parseError=f.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,s(x,"popStack"),s(b,"lex");for(var w,k,T,_,E,C,S,A,L={};;){if(k=n[n.length-1],this.defaultActions[k]?T=this.defaultActions[k]:(null==w&&(w=b()),T=o[k]&&o[k][w]),void 0===T||!T.length||!T[0]){var N="";for(E in A=[],o[k])this.terminals_[E]&&E>u&&A.push("'"+this.terminals_[E]+"'");N=g.showPosition?"Parse error on line "+(c+1)+":\n"+g.showPosition()+"\nExpecting "+A.join(", ")+", got '"+(this.terminals_[w]||w)+"'":"Parse error on line "+(c+1)+": Unexpected "+(w==d?"end of input":"'"+(this.terminals_[w]||w)+"'"),this.parseError(N,{text:g.match,token:this.terminals_[w]||w,line:g.yylineno,loc:y,expected:A})}if(T[0]instanceof Array&&T.length>1)throw new Error("Parse Error: multiple actions possible at state: "+k+", token: "+w);switch(T[0]){case 1:n.push(w),i.push(g.yytext),a.push(g.yylloc),n.push(T[1]),w=null,h=g.yyleng,l=g.yytext,c=g.yylineno,y=g.yylloc;break;case 2:if(C=this.productions_[T[1]][1],L.$=i[i.length-C],L._$={first_line:a[a.length-(C||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(C||1)].first_column,last_column:a[a.length-1].last_column},v&&(L._$.range=[a[a.length-(C||1)].range[0],a[a.length-1].range[1]]),void 0!==(_=this.performAction.apply(L,[l,h,c,f.yy,T[1],i,a].concat(p))))return _;C&&(n=n.slice(0,-1*C*2),i=i.slice(0,-1*C),a=a.slice(0,-1*C)),n.push(this.productions_[T[1]][0]),i.push(L.$),a.push(L._$),S=o[n[n.length-2]][n[n.length-1]],n.push(S);break;case 3:return!0}}return!0}),"parse")},A=function(){var t={EOF:1,parseError:s((function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)}),"parseError"),setInput:s((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:s((function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(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:s((function(t){var e=t.length,n=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 r=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 i=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===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this}),"unput"),more:s((function(){return this._more=!0,this}),"more"),reject:s((function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):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).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}),"reject"),less:s((function(t){this.unput(this.match.slice(t))}),"less"),pastInput:s((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:s((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:s((function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"}),"showPosition"),test_match:s((function(t,e){var n,r,i;if(this.options.backtrack_lexer&&(i={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&&(i.yylloc.range=this.yylloc.range.slice(0))),(r=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.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],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1}),"test_match"),next:s((function(){if(this.done)return this.EOF;var t,e,n,r;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;a<i.length;a++)if((n=this._input.match(this.rules[i[a]]))&&(!e||n[0].length>e[0].length)){if(e=n,r=a,this.options.backtrack_lexer){if(!1!==(t=this.test_match(n,i[a])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,i[r]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}),"next"),lex:s((function(){var t=this.next();return t||this.lex()}),"lex"),begin:s((function(t){this.conditionStack.push(t)}),"begin"),popState:s((function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]}),"popState"),_currentRules:s((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:s((function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"}),"topState"),pushState:s((function(t){this.begin(t)}),"pushState"),stateStackSize:s((function(){return this.conditionStack.length}),"stateStackSize"),options:{"case-insensitive":!0},performAction:s((function(t,e,n,r){switch(n){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:case 15:case 18:case 21:case 24:this.popState();break;case 7:return"acc_descr_multiline_value";case 8:case 9:case 10:case 12:case 13:break;case 11:return 10;case 14:this.begin("href");break;case 16:return 43;case 17:this.begin("callbackname");break;case 19:this.popState(),this.begin("callbackargs");break;case 20:return 41;case 22:return 42;case 23:this.begin("click");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 t}();function L(){this.yy={}}return S.lexer=A,s(L,"Parser"),L.prototype=S,S.Parser=L,new L}();cnt.parser=cnt;var hnt=cnt,unt=d(Cy(),1),dnt=d(p(),1),pnt=d(snt(),1),gnt=d(ont(),1),fnt=d(lnt(),1);dnt.default.extend(pnt.default),dnt.default.extend(gnt.default),dnt.default.extend(fnt.default);var mnt,ynt,vnt={friday:5,saturday:6},xnt="",bnt="",wnt=void 0,knt="",Tnt=[],_nt=[],Ent=new Map,Cnt=[],Snt=[],Ant="",Lnt="",Nnt=["active","done","crit","milestone"],Int=[],Mnt=!1,Rnt=!1,Dnt="sunday",Ont="saturday",Pnt=0,Bnt=s((function(){Cnt=[],Snt=[],Ant="",Int=[],frt=0,mnt=void 0,ynt=void 0,xrt=[],xnt="",bnt="",Lnt="",wnt=void 0,knt="",Tnt=[],_nt=[],Mnt=!1,Rnt=!1,Pnt=0,Ent=new Map,$n(),Dnt="sunday",Ont="saturday"}),"clear"),$nt=s((function(t){bnt=t}),"setAxisFormat"),Fnt=s((function(){return bnt}),"getAxisFormat"),znt=s((function(t){wnt=t}),"setTickInterval"),Unt=s((function(){return wnt}),"getTickInterval"),Gnt=s((function(t){knt=t}),"setTodayMarker"),qnt=s((function(){return knt}),"getTodayMarker"),jnt=s((function(t){xnt=t}),"setDateFormat"),Ynt=s((function(){Mnt=!0}),"enableInclusiveEndDates"),Wnt=s((function(){return Mnt}),"endDatesAreInclusive"),Hnt=s((function(){Rnt=!0}),"enableTopAxis"),Vnt=s((function(){return Rnt}),"topAxisEnabled"),Xnt=s((function(t){Lnt=t}),"setDisplayMode"),Knt=s((function(){return Lnt}),"getDisplayMode"),Znt=s((function(){return xnt}),"getDateFormat"),Qnt=s((function(t){Tnt=t.toLowerCase().split(/[\s,]+/)}),"setIncludes"),Jnt=s((function(){return Tnt}),"getIncludes"),trt=s((function(t){_nt=t.toLowerCase().split(/[\s,]+/)}),"setExcludes"),ert=s((function(){return _nt}),"getExcludes"),nrt=s((function(){return Ent}),"getLinks"),rrt=s((function(t){Ant=t,Cnt.push(t)}),"addSection"),irt=s((function(){return Cnt}),"getSections"),art=s((function(){let t=_rt();let e=0;for(;!t&&e<10;)t=_rt(),e++;return Snt=xrt}),"getTasks"),srt=s((function(t,e,n,r){return!r.includes(t.format(e.trim()))&&(!(!n.includes("weekends")||t.isoWeekday()!==vnt[Ont]&&t.isoWeekday()!==vnt[Ont]+1)||(!!n.includes(t.format("dddd").toLowerCase())||n.includes(t.format(e.trim()))))}),"isInvalidDate"),ort=s((function(t){Dnt=t}),"setWeekday"),lrt=s((function(){return Dnt}),"getWeekday"),crt=s((function(t){Ont=t}),"setWeekend"),hrt=s((function(t,e,n,r){if(!n.length||t.manualEndTime)return;let i,a;i=t.startTime instanceof Date?(0,dnt.default)(t.startTime):(0,dnt.default)(t.startTime,e,!0),i=i.add(1,"d"),a=t.endTime instanceof Date?(0,dnt.default)(t.endTime):(0,dnt.default)(t.endTime,e,!0);const[s,o]=urt(i,a,e,n,r);t.endTime=s.toDate(),t.renderEndTime=o}),"checkTaskDates"),urt=s((function(t,e,n,r,i){let a=!1,s=null;for(;t<=e;)a||(s=e.toDate()),a=srt(t,n,r,i),a&&(e=e.add(1,"d")),t=t.add(1,"d");return[e,s]}),"fixTaskDates"),drt=s((function(t,e,n){n=n.trim();const r=/^after\s+(?<ids>[\d\w- ]+)/.exec(n);if(null!==r){let t=null;for(const e of r.groups.ids.split(" ")){let n=krt(e);void 0!==n&&(!t||n.endTime>t.endTime)&&(t=n)}if(t)return t.endTime;const e=new Date;return e.setHours(0,0,0,0),e}let i=(0,dnt.default)(n,e.trim(),!0);if(i.isValid())return i.toDate();{m.debug("Invalid date:"+n),m.debug("With date format:"+e.trim());const t=new Date(n);if(void 0===t||isNaN(t.getTime())||t.getFullYear()<-1e4||t.getFullYear()>1e4)throw new Error("Invalid date:"+n);return t}}),"getStartDate"),prt=s((function(t){const e=/^(\d+(?:\.\d+)?)([Mdhmswy]|ms)$/.exec(t.trim());return null!==e?[Number.parseFloat(e[1]),e[2]]:[NaN,"ms"]}),"parseDuration"),grt=s((function(t,e,n,r=!1){n=n.trim();const i=/^until\s+(?<ids>[\d\w- ]+)/.exec(n);if(null!==i){let t=null;for(const e of i.groups.ids.split(" ")){let n=krt(e);void 0!==n&&(!t||n.startTime<t.startTime)&&(t=n)}if(t)return t.startTime;const e=new Date;return e.setHours(0,0,0,0),e}let a=(0,dnt.default)(n,e.trim(),!0);if(a.isValid())return r&&(a=a.add(1,"d")),a.toDate();let s=(0,dnt.default)(t);const[o,l]=prt(n);if(!Number.isNaN(o)){const t=s.add(o,l);t.isValid()&&(s=t)}return s.toDate()}),"getEndDate"),frt=0,mrt=s((function(t){return void 0===t?"task"+(frt+=1):t}),"parseId"),yrt=s((function(t,e){let n;n=":"===e.substr(0,1)?e.substr(1,e.length):e;const r=n.split(","),i={};Mrt(r,i,Nnt);for(let t=0;t<r.length;t++)r[t]=r[t].trim();let a="";switch(r.length){case 1:i.id=mrt(),i.startTime=t.endTime,a=r[0];break;case 2:i.id=mrt(),i.startTime=drt(void 0,xnt,r[0]),a=r[1];break;case 3:i.id=mrt(r[0]),i.startTime=drt(void 0,xnt,r[1]),a=r[2]}return a&&(i.endTime=grt(i.startTime,xnt,a,Mnt),i.manualEndTime=(0,dnt.default)(a,"YYYY-MM-DD",!0).isValid(),hrt(i,xnt,_nt,Tnt)),i}),"compileData"),vrt=s((function(t,e){let n;n=":"===e.substr(0,1)?e.substr(1,e.length):e;const r=n.split(","),i={};Mrt(r,i,Nnt);for(let t=0;t<r.length;t++)r[t]=r[t].trim();switch(r.length){case 1:i.id=mrt(),i.startTime={type:"prevTaskEnd",id:t},i.endTime={data:r[0]};break;case 2:i.id=mrt(),i.startTime={type:"getStartDate",startData:r[0]},i.endTime={data:r[1]};break;case 3:i.id=mrt(r[0]),i.startTime={type:"getStartDate",startData:r[1]},i.endTime={data:r[2]}}return i}),"parseData"),xrt=[],brt={},wrt=s((function(t,e){const n={section:Ant,type:Ant,processed:!1,manualEndTime:!1,renderEndTime:null,raw:{data:e},task:t,classes:[]},r=vrt(ynt,e);n.raw.startTime=r.startTime,n.raw.endTime=r.endTime,n.id=r.id,n.prevTaskId=ynt,n.active=r.active,n.done=r.done,n.crit=r.crit,n.milestone=r.milestone,n.order=Pnt,Pnt++;const i=xrt.push(n);ynt=n.id,brt[n.id]=i-1}),"addTask"),krt=s((function(t){const e=brt[t];return xrt[e]}),"findTaskById"),Trt=s((function(t,e){const n={section:Ant,type:Ant,description:t,task:t,classes:[]},r=yrt(mnt,e);n.startTime=r.startTime,n.endTime=r.endTime,n.id=r.id,n.active=r.active,n.done=r.done,n.crit=r.crit,n.milestone=r.milestone,mnt=n,Snt.push(n)}),"addTaskOrg"),_rt=s((function(){const t=s((function(t){const e=xrt[t];let n="";switch(xrt[t].raw.startTime.type){case"prevTaskEnd":{const t=krt(e.prevTaskId);e.startTime=t.endTime;break}case"getStartDate":n=drt(void 0,xnt,xrt[t].raw.startTime.startData),n&&(xrt[t].startTime=n)}return xrt[t].startTime&&(xrt[t].endTime=grt(xrt[t].startTime,xnt,xrt[t].raw.endTime.data,Mnt),xrt[t].endTime&&(xrt[t].processed=!0,xrt[t].manualEndTime=(0,dnt.default)(xrt[t].raw.endTime.data,"YYYY-MM-DD",!0).isValid(),hrt(xrt[t],xnt,_nt,Tnt))),xrt[t].processed}),"compileTask");let e=!0;for(const[n,r]of xrt.entries())t(n),e=e&&r.processed;return e}),"compileTasks"),Ert=s((function(t,e){let n=e;"loose"!==Hn().securityLevel&&(n=(0,unt.sanitizeUrl)(e)),t.split(",").forEach((function(t){void 0!==krt(t)&&(Art(t,(()=>{window.open(n,"_self")})),Ent.set(t,n))})),Crt(t,"clickable")}),"setLink"),Crt=s((function(t,e){t.split(",").forEach((function(t){let n=krt(t);void 0!==n&&n.classes.push(e)}))}),"setClass"),Srt=s((function(t,e,n){if("loose"!==Hn().securityLevel)return;if(void 0===e)return;let r=[];if("string"==typeof n){r=n.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let t=0;t<r.length;t++){let e=r[t].trim();e.startsWith('"')&&e.endsWith('"')&&(e=e.substr(1,e.length-2)),r[t]=e}}0===r.length&&r.push(t),void 0!==krt(t)&&Art(t,(()=>{yk.runFunc(e,...r)}))}),"setClickFun"),Art=s((function(t,e){Int.push((function(){const n=document.querySelector(`[id="${t}"]`);null!==n&&n.addEventListener("click",(function(){e()}))}),(function(){const n=document.querySelector(`[id="${t}-text"]`);null!==n&&n.addEventListener("click",(function(){e()}))}))}),"pushFun"),Lrt=s((function(t,e,n){t.split(",").forEach((function(t){Srt(t,e,n)})),Crt(t,"clickable")}),"setClickEvent"),Nrt=s((function(t){Int.forEach((function(e){e(t)}))}),"bindFunctions"),Irt={getConfig:s((()=>Hn().gantt),"getConfig"),clear:Bnt,setDateFormat:jnt,getDateFormat:Znt,enableInclusiveEndDates:Ynt,endDatesAreInclusive:Wnt,enableTopAxis:Hnt,topAxisEnabled:Vnt,setAxisFormat:$nt,getAxisFormat:Fnt,setTickInterval:znt,getTickInterval:Unt,setTodayMarker:Gnt,getTodayMarker:qnt,setAccTitle:Fn,getAccTitle:zn,setDiagramTitle:qn,getDiagramTitle:jn,setDisplayMode:Xnt,getDisplayMode:Knt,setAccDescription:Un,getAccDescription:Gn,addSection:rrt,getSections:irt,getTasks:art,addTask:wrt,findTaskById:krt,addTaskOrg:Trt,setIncludes:Qnt,getIncludes:Jnt,setExcludes:trt,getExcludes:ert,setClickEvent:Lrt,setLink:Ert,getLinks:nrt,bindFunctions:Nrt,parseDuration:prt,isInvalidDate:srt,setWeekday:ort,getWeekday:lrt,setWeekend:crt};function Mrt(t,e,n){let r=!0;for(;r;)r=!1,n.forEach((function(n){const i=new RegExp("^\\s*"+n+"\\s*$");t[0].match(i)&&(e[n]=!0,t.shift(1),r=!0)}))}s(Mrt,"getTaskTags");var Rrt,Drt=d(p(),1),Ort=s((function(){m.debug("Something is calling, setConf, remove the call")}),"setConf"),Prt={monday:ml,tuesday:yl,wednesday:vl,thursday:xl,friday:bl,saturday:wl,sunday:fl},Brt=s(((t,e)=>{let n=[...t].map((()=>-1/0)),r=[...t].sort(((t,e)=>t.startTime-e.startTime||t.order-e.order)),i=0;for(const t of r)for(let r=0;r<n.length;r++)if(t.startTime>=n[r]){n[r]=t.endTime,t.order=r+e,r>i&&(i=r);break}return i}),"getMaxIntersections"),$rt=s((function(t,e,n,r){const i=Hn().gantt,a=Hn().securityLevel;let o;"sandbox"===a&&(o=Oa("#i"+e));const l=Oa("sandbox"===a?o.nodes()[0].contentDocument.body:"body"),c="sandbox"===a?o.nodes()[0].contentDocument:document,h=c.getElementById(e);void 0===(Rrt=h.parentElement.offsetWidth)&&(Rrt=1200),void 0!==i.useWidth&&(Rrt=i.useWidth);const u=r.db.getTasks();let d=[];for(const t of u)d.push(t.type);d=E(d);const p={};let g=2*i.topPadding;if("compact"===r.db.getDisplayMode()||"compact"===i.displayMode){const t={};for(const e of u)void 0===t[e.section]?t[e.section]=[e]:t[e.section].push(e);let e=0;for(const n of Object.keys(t)){const r=Brt(t[n],e)+1;e+=r,g+=r*(i.barHeight+i.barGap),p[n]=r}}else{g+=u.length*(i.barHeight+i.barGap);for(const t of d)p[t]=u.filter((e=>e.type===t)).length}h.setAttribute("viewBox","0 0 "+Rrt+" "+g);const f=l.select(`[id="${e}"]`),y=uh().domain([ir(u,(function(t){return t.startTime})),rr(u,(function(t){return t.endTime}))]).rangeRound([0,Rrt-i.leftPadding-i.rightPadding]);function v(t,e){const n=t.startTime,r=e.startTime;let i=0;return n>r?i=1:n<r&&(i=-1),i}function x(t,e,n){const a=i.barHeight,s=a+i.barGap,o=i.topPadding,l=i.leftPadding,c=el().domain([0,d.length]).range(["#00B9FA","#F95002"]).interpolate(qs);w(s,o,l,e,n,t,r.db.getExcludes(),r.db.getIncludes()),k(l,o,e,n),b(t,s,o,l,a,c,e),T(s,o),_(l,o,e,n)}function b(t,n,a,s,o,l,c){const h=[...new Set(t.map((t=>t.order)))].map((e=>t.find((t=>t.order===e))));f.append("g").selectAll("rect").data(h).enter().append("rect").attr("x",0).attr("y",(function(t,e){return t.order*n+a-2})).attr("width",(function(){return c-i.rightPadding/2})).attr("height",n).attr("class",(function(t){for(const[e,n]of d.entries())if(t.type===n)return"section section"+e%i.numberSectionStyles;return"section section0"}));const u=f.append("g").selectAll("rect").data(t).enter(),p=r.db.getLinks();u.append("rect").attr("id",(function(t){return t.id})).attr("rx",3).attr("ry",3).attr("x",(function(t){return t.milestone?y(t.startTime)+s+.5*(y(t.endTime)-y(t.startTime))-.5*o:y(t.startTime)+s})).attr("y",(function(t,e){return t.order*n+a})).attr("width",(function(t){return t.milestone?o:y(t.renderEndTime||t.endTime)-y(t.startTime)})).attr("height",o).attr("transform-origin",(function(t,e){return e=t.order,(y(t.startTime)+s+.5*(y(t.endTime)-y(t.startTime))).toString()+"px "+(e*n+a+.5*o).toString()+"px"})).attr("class",(function(t){let e="";t.classes.length>0&&(e=t.classes.join(" "));let n=0;for(const[e,r]of d.entries())t.type===r&&(n=e%i.numberSectionStyles);let r="";return t.active?t.crit?r+=" activeCrit":r=" active":t.done?r=t.crit?" doneCrit":" done":t.crit&&(r+=" crit"),0===r.length&&(r=" task"),t.milestone&&(r=" milestone "+r),r+=n,r+=" "+e,"task"+r})),u.append("text").attr("id",(function(t){return t.id+"-text"})).text((function(t){return t.task})).attr("font-size",i.fontSize).attr("x",(function(t){let e=y(t.startTime),n=y(t.renderEndTime||t.endTime);t.milestone&&(e+=.5*(y(t.endTime)-y(t.startTime))-.5*o),t.milestone&&(n=e+o);const r=this.getBBox().width;return r>n-e?n+r+1.5*i.leftPadding>c?e+s-5:n+s+5:(n-e)/2+e+s})).attr("y",(function(t,e){return t.order*n+i.barHeight/2+(i.fontSize/2-2)+a})).attr("text-height",o).attr("class",(function(t){const e=y(t.startTime);let n=y(t.endTime);t.milestone&&(n=e+o);const r=this.getBBox().width;let a="";t.classes.length>0&&(a=t.classes.join(" "));let s=0;for(const[e,n]of d.entries())t.type===n&&(s=e%i.numberSectionStyles);let l="";return t.active&&(l=t.crit?"activeCritText"+s:"activeText"+s),t.done?l=t.crit?l+" doneCritText"+s:l+" doneText"+s:t.crit&&(l=l+" critText"+s),t.milestone&&(l+=" milestoneText"),r>n-e?n+r+1.5*i.leftPadding>c?a+" taskTextOutsideLeft taskTextOutside"+s+" "+l:a+" taskTextOutsideRight taskTextOutside"+s+" "+l+" width-"+r:a+" taskText taskText"+s+" "+l+" width-"+r}));if("sandbox"===Hn().securityLevel){let t;t=Oa("#i"+e);const n=t.nodes()[0].contentDocument;u.filter((function(t){return p.has(t.id)})).each((function(t){var e=n.querySelector("#"+t.id),r=n.querySelector("#"+t.id+"-text");const i=e.parentNode;var a=n.createElement("a");a.setAttribute("xlink:href",p.get(t.id)),a.setAttribute("target","_top"),i.appendChild(a),a.appendChild(e),a.appendChild(r)}))}}function w(t,e,n,a,s,o,l,c){if(0===l.length&&0===c.length)return;let h,u;for(const{startTime:t,endTime:e}of o)(void 0===h||t<h)&&(h=t),(void 0===u||e>u)&&(u=e);if(!h||!u)return;if((0,Drt.default)(u).diff((0,Drt.default)(h),"year")>5)return void m.warn("The difference between the min and max time is more than 5 years. This will cause performance issues. Skipping drawing exclude days.");const d=r.db.getDateFormat(),p=[];let g=null,v=(0,Drt.default)(h);for(;v.valueOf()<=u;)r.db.isInvalidDate(v,d,l,c)?g?g.end=v:g={start:v,end:v}:g&&(p.push(g),g=null),v=v.add(1,"d");f.append("g").selectAll("rect").data(p).enter().append("rect").attr("id",(function(t){return"exclude-"+t.start.format("YYYY-MM-DD")})).attr("x",(function(t){return y(t.start)+n})).attr("y",i.gridLineStartPadding).attr("width",(function(t){const e=t.end.add(1,"day");return y(e)-y(t.start)})).attr("height",s-e-i.gridLineStartPadding).attr("transform-origin",(function(e,r){return(y(e.start)+n+.5*(y(e.end)-y(e.start))).toString()+"px "+(r*t+.5*s).toString()+"px"})).attr("class","exclude-range")}function k(t,e,n,a){let s=Dr(y).tickSize(-a+e+i.gridLineStartPadding).tickFormat(Gl(r.db.getAxisFormat()||i.axisFormat||"%Y-%m-%d"));const o=/^([1-9]\d*)(millisecond|second|minute|hour|day|week|month)$/.exec(r.db.getTickInterval()||i.tickInterval);if(null!==o){const t=o[1],e=o[2],n=r.db.getWeekday()||i.weekday;switch(e){case"millisecond":s.ticks(al.every(t));break;case"second":s.ticks(sl.every(t));break;case"minute":s.ticks(ol.every(t));break;case"hour":s.ticks(cl.every(t));break;case"day":s.ticks(ul.every(t));break;case"week":s.ticks(Prt[n].every(t));break;case"month":s.ticks(Nl.every(t))}}if(f.append("g").attr("class","grid").attr("transform","translate("+t+", "+(a-50)+")").call(s).selectAll("text").style("text-anchor","middle").attr("fill","#000").attr("stroke","none").attr("font-size",10).attr("dy","1em"),r.db.topAxisEnabled()||i.topAxis){let n=Rr(y).tickSize(-a+e+i.gridLineStartPadding).tickFormat(Gl(r.db.getAxisFormat()||i.axisFormat||"%Y-%m-%d"));if(null!==o){const t=o[1],e=o[2],a=r.db.getWeekday()||i.weekday;switch(e){case"millisecond":n.ticks(al.every(t));break;case"second":n.ticks(sl.every(t));break;case"minute":n.ticks(ol.every(t));break;case"hour":n.ticks(cl.every(t));break;case"day":n.ticks(ul.every(t));break;case"week":n.ticks(Prt[a].every(t));break;case"month":n.ticks(Nl.every(t))}}f.append("g").attr("class","grid").attr("transform","translate("+t+", "+e+")").call(n).selectAll("text").style("text-anchor","middle").attr("fill","#000").attr("stroke","none").attr("font-size",10)}}function T(t,e){let n=0;const r=Object.keys(p).map((t=>[t,p[t]]));f.append("g").selectAll("text").data(r).enter().append((function(t){const e=t[0].split(_n.lineBreakRegex),n=-(e.length-1)/2,r=c.createElementNS("http://www.w3.org/2000/svg","text");r.setAttribute("dy",n+"em");for(const[t,n]of e.entries()){const e=c.createElementNS("http://www.w3.org/2000/svg","tspan");e.setAttribute("alignment-baseline","central"),e.setAttribute("x","10"),t>0&&e.setAttribute("dy","1em"),e.textContent=n,r.appendChild(e)}return r})).attr("x",10).attr("y",(function(i,a){if(!(a>0))return i[1]*t/2+e;for(let s=0;s<a;s++)return n+=r[a-1][1],i[1]*t/2+n*t+e})).attr("font-size",i.sectionFontSize).attr("class",(function(t){for(const[e,n]of d.entries())if(t[0]===n)return"sectionTitle sectionTitle"+e%i.numberSectionStyles;return"sectionTitle"}))}function _(t,e,n,a){const s=r.db.getTodayMarker();if("off"===s)return;const o=f.append("g").attr("class","today"),l=new Date,c=o.append("line");c.attr("x1",y(l)+t).attr("x2",y(l)+t).attr("y1",i.titleTopMargin).attr("y2",a-i.titleTopMargin).attr("class","today"),""!==s&&c.attr("style",s.replace(/,/g,";"))}function E(t){const e={},n=[];for(let r=0,i=t.length;r<i;++r)Object.prototype.hasOwnProperty.call(e,t[r])||(e[t[r]]=!0,n.push(t[r]));return n}s(v,"taskCompare"),u.sort(v),x(u,Rrt,g),Sn(f,g,Rrt,i.useMaxWidth),f.append("text").text(r.db.getDiagramTitle()).attr("x",Rrt/2).attr("y",i.titleTopMargin).attr("class","titleText"),s(x,"makeGantt"),s(b,"drawRects"),s(w,"drawExcludeDays"),s(k,"makeGrid"),s(T,"vertLabels"),s(_,"drawToday"),s(E,"checkUnique")}),"draw"),Frt={parser:hnt,db:Irt,renderer:{setConf:Ort,draw:$rt},styles:s((t=>`\n .mermaid-main-font {\n font-family: var(--mermaid-font-family, "trebuchet ms", verdana, arial, sans-serif);\n }\n\n .exclude-range {\n fill: ${t.excludeBkgColor};\n }\n\n .section {\n stroke: none;\n opacity: 0.2;\n }\n\n .section0 {\n fill: ${t.sectionBkgColor};\n }\n\n .section2 {\n fill: ${t.sectionBkgColor2};\n }\n\n .section1,\n .section3 {\n fill: ${t.altSectionBkgColor};\n opacity: 0.2;\n }\n\n .sectionTitle0 {\n fill: ${t.titleColor};\n }\n\n .sectionTitle1 {\n fill: ${t.titleColor};\n }\n\n .sectionTitle2 {\n fill: ${t.titleColor};\n }\n\n .sectionTitle3 {\n fill: ${t.titleColor};\n }\n\n .sectionTitle {\n text-anchor: start;\n font-family: var(--mermaid-font-family, "trebuchet ms", verdana, arial, sans-serif);\n }\n\n\n /* Grid and axis */\n\n .grid .tick {\n stroke: ${t.gridColor};\n opacity: 0.8;\n shape-rendering: crispEdges;\n }\n\n .grid .tick text {\n font-family: ${t.fontFamily};\n fill: ${t.textColor};\n }\n\n .grid path {\n stroke-width: 0;\n }\n\n\n /* Today line */\n\n .today {\n fill: none;\n stroke: ${t.todayLineColor};\n stroke-width: 2px;\n }\n\n\n /* Task styling */\n\n /* Default task */\n\n .task {\n stroke-width: 2;\n }\n\n .taskText {\n text-anchor: middle;\n font-family: var(--mermaid-font-family, "trebuchet ms", verdana, arial, sans-serif);\n }\n\n .taskTextOutsideRight {\n fill: ${t.taskTextDarkColor};\n text-anchor: start;\n font-family: var(--mermaid-font-family, "trebuchet ms", verdana, arial, sans-serif);\n }\n\n .taskTextOutsideLeft {\n fill: ${t.taskTextDarkColor};\n text-anchor: end;\n }\n\n\n /* Special case clickable */\n\n .task.clickable {\n cursor: pointer;\n }\n\n .taskText.clickable {\n cursor: pointer;\n fill: ${t.taskTextClickableColor} !important;\n font-weight: bold;\n }\n\n .taskTextOutsideLeft.clickable {\n cursor: pointer;\n fill: ${t.taskTextClickableColor} !important;\n font-weight: bold;\n }\n\n .taskTextOutsideRight.clickable {\n cursor: pointer;\n fill: ${t.taskTextClickableColor} !important;\n font-weight: bold;\n }\n\n\n /* Specific task settings for the sections*/\n\n .taskText0,\n .taskText1,\n .taskText2,\n .taskText3 {\n fill: ${t.taskTextColor};\n }\n\n .task0,\n .task1,\n .task2,\n .task3 {\n fill: ${t.taskBkgColor};\n stroke: ${t.taskBorderColor};\n }\n\n .taskTextOutside0,\n .taskTextOutside2\n {\n fill: ${t.taskTextOutsideColor};\n }\n\n .taskTextOutside1,\n .taskTextOutside3 {\n fill: ${t.taskTextOutsideColor};\n }\n\n\n /* Active task */\n\n .active0,\n .active1,\n .active2,\n .active3 {\n fill: ${t.activeTaskBkgColor};\n stroke: ${t.activeTaskBorderColor};\n }\n\n .activeText0,\n .activeText1,\n .activeText2,\n .activeText3 {\n fill: ${t.taskTextDarkColor} !important;\n }\n\n\n /* Completed task */\n\n .done0,\n .done1,\n .done2,\n .done3 {\n stroke: ${t.doneTaskBorderColor};\n fill: ${t.doneTaskBkgColor};\n stroke-width: 2;\n }\n\n .doneText0,\n .doneText1,\n .doneText2,\n .doneText3 {\n fill: ${t.taskTextDarkColor} !important;\n }\n\n\n /* Tasks on the critical line */\n\n .crit0,\n .crit1,\n .crit2,\n .crit3 {\n stroke: ${t.critBorderColor};\n fill: ${t.critBkgColor};\n stroke-width: 2;\n }\n\n .activeCrit0,\n .activeCrit1,\n .activeCrit2,\n .activeCrit3 {\n stroke: ${t.critBorderColor};\n fill: ${t.activeTaskBkgColor};\n stroke-width: 2;\n }\n\n .doneCrit0,\n .doneCrit1,\n .doneCrit2,\n .doneCrit3 {\n stroke: ${t.critBorderColor};\n fill: ${t.doneTaskBkgColor};\n stroke-width: 2;\n cursor: pointer;\n shape-rendering: crispEdges;\n }\n\n .milestone {\n transform: rotate(45deg) scale(0.8,0.8);\n }\n\n .milestoneText {\n font-style: italic;\n }\n .doneCritText0,\n .doneCritText1,\n .doneCritText2,\n .doneCritText3 {\n fill: ${t.taskTextDarkColor} !important;\n }\n\n .activeCritText0,\n .activeCritText1,\n .activeCritText2,\n .activeCritText3 {\n fill: ${t.taskTextDarkColor} !important;\n }\n\n .titleText {\n text-anchor: middle;\n font-size: 18px;\n fill: ${t.titleColor||t.textColor};\n font-family: var(--mermaid-font-family, "trebuchet ms", verdana, arial, sans-serif);\n }\n`),"getStyles")},zrt=Object.freeze({__proto__:null,diagram:Frt}),Urt={parse:s((async t=>{const e=await Att("info",t);m.debug(e)}),"parse")},Grt="11.4.1",qrt={getVersion:s((()=>Grt),"getVersion")},jrt=s(((t,e,n)=>{m.debug("rendering info diagram\n"+t);const r=zp(e);Sn(r,100,400,!0);r.append("g").append("text").attr("x",100).attr("y",40).attr("class","version").attr("font-size",32).style("text-anchor","middle").text(`v${n}`)}),"draw"),Yrt={parser:Urt,db:qrt,renderer:{draw:jrt}},Wrt=Object.freeze({__proto__:null,diagram:Yrt}),Hrt=Ct.pie,Vrt={sections:new Map,showData:!1,config:Hrt},Xrt=Vrt.sections,Krt=Vrt.showData,Zrt=structuredClone(Hrt),Qrt=s((()=>structuredClone(Zrt)),"getConfig"),Jrt=s((()=>{Xrt=new Map,Krt=Vrt.showData,$n()}),"clear"),tit=s((({label:t,value:e})=>{Xrt.has(t)||(Xrt.set(t,e),m.debug(`added new section: ${t}, with value: ${e}`))}),"addSection"),eit={getConfig:Qrt,clear:Jrt,setDiagramTitle:qn,getDiagramTitle:jn,setAccTitle:Fn,getAccTitle:zn,setAccDescription:Un,getAccDescription:Gn,addSection:tit,getSections:s((()=>Xrt),"getSections"),setShowData:s((t=>{Krt=t}),"setShowData"),getShowData:s((()=>Krt),"getShowData")},nit=s(((t,e)=>{jX(t,e),e.setShowData(t.showData),t.sections.map(e.addSection)}),"populateDb"),rit={parse:s((async t=>{const e=await Att("pie",t);m.debug(e),nit(e,eit)}),"parse")},iit=s((t=>`\n .pieCircle{\n stroke: ${t.pieStrokeColor};\n stroke-width : ${t.pieStrokeWidth};\n opacity : ${t.pieOpacity};\n }\n .pieOuterCircle{\n stroke: ${t.pieOuterStrokeColor};\n stroke-width: ${t.pieOuterStrokeWidth};\n fill: none;\n }\n .pieTitleText {\n text-anchor: middle;\n font-size: ${t.pieTitleTextSize};\n fill: ${t.pieTitleTextColor};\n font-family: ${t.fontFamily};\n }\n .slice {\n font-family: ${t.fontFamily};\n fill: ${t.pieSectionTextColor};\n font-size:${t.pieSectionTextSize};\n // fill: white;\n }\n .legend text {\n fill: ${t.pieLegendTextColor};\n font-family: ${t.fontFamily};\n font-size: ${t.pieLegendTextSize};\n }\n`),"getStyles"),ait=s((t=>{const e=[...t.entries()].map((t=>({label:t[0],value:t[1]}))).sort(((t,e)=>e.value-t.value));return Qh().value((t=>t.value))(e)}),"createPieArcs"),sit=s(((t,e,n,r)=>{m.debug("rendering pie chart\n"+t);const i=r.db,a=Hn(),s=mk(i.getConfig(),a.pie),o=18,l=450,c=zp(e),h=c.append("g");h.attr("transform","translate(225,225)");const{themeVariables:u}=a;let[d]=fk(u.pieOuterStrokeWidth);d??=2;const p=s.textPosition,g=Math.min(450,l)/2-40,f=qh().innerRadius(0).outerRadius(g),y=qh().innerRadius(g*p).outerRadius(g*p);h.append("circle").attr("cx",0).attr("cy",0).attr("r",g+d/2).attr("class","pieOuterCircle");const v=i.getSections(),x=ait(v),b=yo([u.pie1,u.pie2,u.pie3,u.pie4,u.pie5,u.pie6,u.pie7,u.pie8,u.pie9,u.pie10,u.pie11,u.pie12]);h.selectAll("mySlices").data(x).enter().append("path").attr("d",f).attr("fill",(t=>b(t.data.label))).attr("class","pieCircle");let w=0;v.forEach((t=>{w+=t})),h.selectAll("mySlices").data(x).enter().append("text").text((t=>(t.data.value/w*100).toFixed(0)+"%")).attr("transform",(t=>"translate("+y.centroid(t)+")")).style("text-anchor","middle").attr("class","slice"),h.append("text").text(i.getDiagramTitle()).attr("x",0).attr("y",-200).attr("class","pieTitleText");const k=h.selectAll(".legend").data(b.domain()).enter().append("g").attr("class","legend").attr("transform",((t,e)=>"translate(216,"+(22*e-22*b.domain().length/2)+")"));k.append("rect").attr("width",o).attr("height",o).style("fill",b).style("stroke",b),k.data(x).append("text").attr("x",22).attr("y",14).text((t=>{const{label:e,value:n}=t.data;return i.getShowData()?`${e} [${n}]`:e}));const T=Math.max(...k.selectAll("text").nodes().map((t=>t?.getBoundingClientRect().width??0))),_=512+T;c.attr("viewBox",`0 0 ${_} 450`),Sn(c,l,_,s.useMaxWidth)}),"draw"),oit={parser:rit,db:eit,renderer:{draw:sit},styles:iit},lit=Object.freeze({__proto__:null,diagram:oit}),cit=function(){var t=s((function(t,e,n,r){for(n=n||{},r=t.length;r--;n[t[r]]=e);return n}),"o"),e=[1,3],n=[1,4],r=[1,5],i=[1,6],a=[1,7],o=[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],l=[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],c=[55,56,57],h=[2,36],u=[1,37],d=[1,36],p=[1,38],g=[1,35],f=[1,43],m=[1,41],y=[1,14],v=[1,23],x=[1,18],b=[1,19],w=[1,20],k=[1,21],T=[1,22],_=[1,24],E=[1,25],C=[1,26],S=[1,27],A=[1,28],L=[1,29],N=[1,32],I=[1,33],M=[1,34],R=[1,39],D=[1,40],O=[1,42],P=[1,44],B=[1,62],$=[1,61],F=[4,5,8,10,12,13,14,18,44,47,49,55,56,57,63,64,65,66,67],z=[1,65],U=[1,66],G=[1,67],q=[1,68],j=[1,69],Y=[1,70],W=[1,71],H=[1,72],V=[1,73],X=[1,74],K=[1,75],Z=[1,76],Q=[4,5,6,7,8,9,10,11,12,13,14,15,18],J=[1,90],tt=[1,91],et=[1,92],nt=[1,99],rt=[1,93],it=[1,96],at=[1,94],st=[1,95],ot=[1,97],lt=[1,98],ct=[1,102],ht=[10,55,56,57],ut=[4,5,6,8,10,11,13,17,18,19,20,55,56,57],dt={trace:s((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:s((function(t,e,n,r,i,a,s){var o=a.length-1;switch(i){case 23:case 68:this.$=a[o];break;case 24:case 69:this.$=a[o-1]+""+a[o];break;case 26:this.$=a[o-1]+a[o];break;case 27:this.$=[a[o].trim()];break;case 28:a[o-2].push(a[o].trim()),this.$=a[o-2];break;case 29:this.$=a[o-4],r.addClass(a[o-2],a[o]);break;case 37:this.$=[];break;case 42:this.$=a[o].trim(),r.setDiagramTitle(this.$);break;case 43:this.$=a[o].trim(),r.setAccTitle(this.$);break;case 44:case 45:this.$=a[o].trim(),r.setAccDescription(this.$);break;case 46:r.addSection(a[o].substr(8)),this.$=a[o].substr(8);break;case 47:r.addPoint(a[o-3],"",a[o-1],a[o],[]);break;case 48:r.addPoint(a[o-4],a[o-3],a[o-1],a[o],[]);break;case 49:r.addPoint(a[o-4],"",a[o-2],a[o-1],a[o]);break;case 50:r.addPoint(a[o-5],a[o-4],a[o-2],a[o-1],a[o]);break;case 51:r.setXAxisLeftText(a[o-2]),r.setXAxisRightText(a[o]);break;case 52:a[o-1].text+=" ⟶ ",r.setXAxisLeftText(a[o-1]);break;case 53:r.setXAxisLeftText(a[o]);break;case 54:r.setYAxisBottomText(a[o-2]),r.setYAxisTopText(a[o]);break;case 55:a[o-1].text+=" ⟶ ",r.setYAxisBottomText(a[o-1]);break;case 56:r.setYAxisBottomText(a[o]);break;case 57:r.setQuadrant1Text(a[o]);break;case 58:r.setQuadrant2Text(a[o]);break;case 59:r.setQuadrant3Text(a[o]);break;case 60:r.setQuadrant4Text(a[o]);break;case 64:case 66:this.$={text:a[o],type:"text"};break;case 65:this.$={text:a[o-1].text+""+a[o],type:a[o-1].type};break;case 67:this.$={text:a[o],type:"markdown"}}}),"anonymous"),table:[{18:e,26:1,27:2,28:n,55:r,56:i,57:a},{1:[3]},{18:e,26:8,27:2,28:n,55:r,56:i,57:a},{18:e,26:9,27:2,28:n,55:r,56:i,57:a},t(o,[2,33],{29:10}),t(l,[2,61]),t(l,[2,62]),t(l,[2,63]),{1:[2,30]},{1:[2,31]},t(c,h,{30:11,31:12,24:13,32:15,33:16,34:17,43:30,58:31,1:[2,32],4:u,5:d,10:p,12:g,13:f,14:m,18:y,25:v,35:x,37:b,39:w,41:k,42:T,48:_,50:E,51:C,52:S,53:A,54:L,60:N,61:I,63:M,64:R,65:D,66:O,67:P}),t(o,[2,34]),{27:45,55:r,56:i,57:a},t(c,[2,37]),t(c,h,{24:13,32:15,33:16,34:17,43:30,58:31,31:46,4:u,5:d,10:p,12:g,13:f,14:m,18:y,25:v,35:x,37:b,39:w,41:k,42:T,48:_,50:E,51:C,52:S,53:A,54:L,60:N,61:I,63:M,64:R,65:D,66:O,67:P}),t(c,[2,39]),t(c,[2,40]),t(c,[2,41]),{36:[1,47]},{38:[1,48]},{40:[1,49]},t(c,[2,45]),t(c,[2,46]),{18:[1,50]},{4:u,5:d,10:p,12:g,13:f,14:m,43:51,58:31,60:N,61:I,63:M,64:R,65:D,66:O,67:P},{4:u,5:d,10:p,12:g,13:f,14:m,43:52,58:31,60:N,61:I,63:M,64:R,65:D,66:O,67:P},{4:u,5:d,10:p,12:g,13:f,14:m,43:53,58:31,60:N,61:I,63:M,64:R,65:D,66:O,67:P},{4:u,5:d,10:p,12:g,13:f,14:m,43:54,58:31,60:N,61:I,63:M,64:R,65:D,66:O,67:P},{4:u,5:d,10:p,12:g,13:f,14:m,43:55,58:31,60:N,61:I,63:M,64:R,65:D,66:O,67:P},{4:u,5:d,10:p,12:g,13:f,14:m,43:56,58:31,60:N,61:I,63:M,64:R,65:D,66:O,67:P},{4:u,5:d,8:B,10:p,12:g,13:f,14:m,18:$,44:[1,57],47:[1,58],58:60,59:59,63:M,64:R,65:D,66:O,67:P},t(F,[2,64]),t(F,[2,66]),t(F,[2,67]),t(F,[2,70]),t(F,[2,71]),t(F,[2,72]),t(F,[2,73]),t(F,[2,74]),t(F,[2,75]),t(F,[2,76]),t(F,[2,77]),t(F,[2,78]),t(F,[2,79]),t(F,[2,80]),t(o,[2,35]),t(c,[2,38]),t(c,[2,42]),t(c,[2,43]),t(c,[2,44]),{3:64,4:z,5:U,6:G,7:q,8:j,9:Y,10:W,11:H,12:V,13:X,14:K,15:Z,21:63},t(c,[2,53],{59:59,58:60,4:u,5:d,8:B,10:p,12:g,13:f,14:m,18:$,49:[1,77],63:M,64:R,65:D,66:O,67:P}),t(c,[2,56],{59:59,58:60,4:u,5:d,8:B,10:p,12:g,13:f,14:m,18:$,49:[1,78],63:M,64:R,65:D,66:O,67:P}),t(c,[2,57],{59:59,58:60,4:u,5:d,8:B,10:p,12:g,13:f,14:m,18:$,63:M,64:R,65:D,66:O,67:P}),t(c,[2,58],{59:59,58:60,4:u,5:d,8:B,10:p,12:g,13:f,14:m,18:$,63:M,64:R,65:D,66:O,67:P}),t(c,[2,59],{59:59,58:60,4:u,5:d,8:B,10:p,12:g,13:f,14:m,18:$,63:M,64:R,65:D,66:O,67:P}),t(c,[2,60],{59:59,58:60,4:u,5:d,8:B,10:p,12:g,13:f,14:m,18:$,63:M,64:R,65:D,66:O,67:P}),{45:[1,79]},{44:[1,80]},t(F,[2,65]),t(F,[2,81]),t(F,[2,82]),t(F,[2,83]),{3:82,4:z,5:U,6:G,7:q,8:j,9:Y,10:W,11:H,12:V,13:X,14:K,15:Z,18:[1,81]},t(Q,[2,23]),t(Q,[2,1]),t(Q,[2,2]),t(Q,[2,3]),t(Q,[2,4]),t(Q,[2,5]),t(Q,[2,6]),t(Q,[2,7]),t(Q,[2,8]),t(Q,[2,9]),t(Q,[2,10]),t(Q,[2,11]),t(Q,[2,12]),t(c,[2,52],{58:31,43:83,4:u,5:d,10:p,12:g,13:f,14:m,60:N,61:I,63:M,64:R,65:D,66:O,67:P}),t(c,[2,55],{58:31,43:84,4:u,5:d,10:p,12:g,13:f,14:m,60:N,61:I,63:M,64:R,65:D,66:O,67:P}),{46:[1,85]},{45:[1,86]},{4:J,5:tt,6:et,8:nt,11:rt,13:it,16:89,17:at,18:st,19:ot,20:lt,22:88,23:87},t(Q,[2,24]),t(c,[2,51],{59:59,58:60,4:u,5:d,8:B,10:p,12:g,13:f,14:m,18:$,63:M,64:R,65:D,66:O,67:P}),t(c,[2,54],{59:59,58:60,4:u,5:d,8:B,10:p,12:g,13:f,14:m,18:$,63:M,64:R,65:D,66:O,67:P}),t(c,[2,47],{22:88,16:89,23:100,4:J,5:tt,6:et,8:nt,11:rt,13:it,17:at,18:st,19:ot,20:lt}),{46:[1,101]},t(c,[2,29],{10:ct}),t(ht,[2,27],{16:103,4:J,5:tt,6:et,8:nt,11:rt,13:it,17:at,18:st,19:ot,20:lt}),t(ut,[2,25]),t(ut,[2,13]),t(ut,[2,14]),t(ut,[2,15]),t(ut,[2,16]),t(ut,[2,17]),t(ut,[2,18]),t(ut,[2,19]),t(ut,[2,20]),t(ut,[2,21]),t(ut,[2,22]),t(c,[2,49],{10:ct}),t(c,[2,48],{22:88,16:89,23:104,4:J,5:tt,6:et,8:nt,11:rt,13:it,17:at,18:st,19:ot,20:lt}),{4:J,5:tt,6:et,8:nt,11:rt,13:it,16:89,17:at,18:st,19:ot,20:lt,22:105},t(ut,[2,26]),t(c,[2,50],{10:ct}),t(ht,[2,28],{16:103,4:J,5:tt,6:et,8:nt,11:rt,13:it,17:at,18:st,19:ot,20:lt})],defaultActions:{8:[2,30],9:[2,31]},parseError:s((function(t,e){if(!e.recoverable){var n=new Error(t);throw n.hash=e,n}this.trace(t)}),"parseError"),parse:s((function(t){var e=this,n=[0],r=[],i=[null],a=[],o=this.table,l="",c=0,h=0,u=2,d=1,p=a.slice.call(arguments,1),g=Object.create(this.lexer),f={yy:{}};for(var m in this.yy)Object.prototype.hasOwnProperty.call(this.yy,m)&&(f.yy[m]=this.yy[m]);g.setInput(t,f.yy),f.yy.lexer=g,f.yy.parser=this,void 0===g.yylloc&&(g.yylloc={});var y=g.yylloc;a.push(y);var v=g.options&&g.options.ranges;function x(t){n.length=n.length-2*t,i.length=i.length-t,a.length=a.length-t}function b(){var t;return"number"!=typeof(t=r.pop()||g.lex()||d)&&(t instanceof Array&&(t=(r=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof f.yy.parseError?this.parseError=f.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,s(x,"popStack"),s(b,"lex");for(var w,k,T,_,E,C,S,A,L={};;){if(k=n[n.length-1],this.defaultActions[k]?T=this.defaultActions[k]:(null==w&&(w=b()),T=o[k]&&o[k][w]),void 0===T||!T.length||!T[0]){var N="";for(E in A=[],o[k])this.terminals_[E]&&E>u&&A.push("'"+this.terminals_[E]+"'");N=g.showPosition?"Parse error on line "+(c+1)+":\n"+g.showPosition()+"\nExpecting "+A.join(", ")+", got '"+(this.terminals_[w]||w)+"'":"Parse error on line "+(c+1)+": Unexpected "+(w==d?"end of input":"'"+(this.terminals_[w]||w)+"'"),this.parseError(N,{text:g.match,token:this.terminals_[w]||w,line:g.yylineno,loc:y,expected:A})}if(T[0]instanceof Array&&T.length>1)throw new Error("Parse Error: multiple actions possible at state: "+k+", token: "+w);switch(T[0]){case 1:n.push(w),i.push(g.yytext),a.push(g.yylloc),n.push(T[1]),w=null,h=g.yyleng,l=g.yytext,c=g.yylineno,y=g.yylloc;break;case 2:if(C=this.productions_[T[1]][1],L.$=i[i.length-C],L._$={first_line:a[a.length-(C||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(C||1)].first_column,last_column:a[a.length-1].last_column},v&&(L._$.range=[a[a.length-(C||1)].range[0],a[a.length-1].range[1]]),void 0!==(_=this.performAction.apply(L,[l,h,c,f.yy,T[1],i,a].concat(p))))return _;C&&(n=n.slice(0,-1*C*2),i=i.slice(0,-1*C),a=a.slice(0,-1*C)),n.push(this.productions_[T[1]][0]),i.push(L.$),a.push(L._$),S=o[n[n.length-2]][n[n.length-1]],n.push(S);break;case 3:return!0}}return!0}),"parse")},pt=function(){var t={EOF:1,parseError:s((function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)}),"parseError"),setInput:s((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:s((function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(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:s((function(t){var e=t.length,n=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 r=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 i=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===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this}),"unput"),more:s((function(){return this._more=!0,this}),"more"),reject:s((function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):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).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}),"reject"),less:s((function(t){this.unput(this.match.slice(t))}),"less"),pastInput:s((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:s((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:s((function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"}),"showPosition"),test_match:s((function(t,e){var n,r,i;if(this.options.backtrack_lexer&&(i={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&&(i.yylloc.range=this.yylloc.range.slice(0))),(r=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.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],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1}),"test_match"),next:s((function(){if(this.done)return this.EOF;var t,e,n,r;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;a<i.length;a++)if((n=this._input.match(this.rules[i[a]]))&&(!e||n[0].length>e[0].length)){if(e=n,r=a,this.options.backtrack_lexer){if(!1!==(t=this.test_match(n,i[a])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,i[r]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}),"next"),lex:s((function(){var t=this.next();return t||this.lex()}),"lex"),begin:s((function(t){this.conditionStack.push(t)}),"begin"),popState:s((function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]}),"popState"),_currentRules:s((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:s((function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"}),"topState"),pushState:s((function(t){this.begin(t)}),"pushState"),stateStackSize:s((function(){return this.conditionStack.length}),"stateStackSize"),options:{"case-insensitive":!0},performAction:s((function(t,e,n,r){switch(n){case 0:case 1:case 3:break;case 2:return 55;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:case 23:case 25:case 31: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 24:this.begin("string");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 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: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 t}();function gt(){this.yy={}}return dt.lexer=pt,s(gt,"Parser"),gt.prototype=dt,dt.Parser=gt,new gt}();cit.parser=cit;var hit=cit,uit=yt(),dit=class{constructor(){this.classes=new Map,this.config=this.getDefaultConfig(),this.themeConfig=this.getDefaultThemeConfig(),this.data=this.getDefaultData()}static{s(this,"QuadrantBuilder")}getDefaultData(){return{titleText:"",quadrant1Text:"",quadrant2Text:"",quadrant3Text:"",quadrant4Text:"",xAxisLeftText:"",xAxisRightText:"",yAxisBottomText:"",yAxisTopText:"",points:[]}}getDefaultConfig(){return{showXAxis:!0,showYAxis:!0,showTitle:!0,chartHeight:Ct.quadrantChart?.chartWidth||500,chartWidth:Ct.quadrantChart?.chartHeight||500,titlePadding:Ct.quadrantChart?.titlePadding||10,titleFontSize:Ct.quadrantChart?.titleFontSize||20,quadrantPadding:Ct.quadrantChart?.quadrantPadding||5,xAxisLabelPadding:Ct.quadrantChart?.xAxisLabelPadding||5,yAxisLabelPadding:Ct.quadrantChart?.yAxisLabelPadding||5,xAxisLabelFontSize:Ct.quadrantChart?.xAxisLabelFontSize||16,yAxisLabelFontSize:Ct.quadrantChart?.yAxisLabelFontSize||16,quadrantLabelFontSize:Ct.quadrantChart?.quadrantLabelFontSize||16,quadrantTextTopPadding:Ct.quadrantChart?.quadrantTextTopPadding||5,pointTextPadding:Ct.quadrantChart?.pointTextPadding||5,pointLabelFontSize:Ct.quadrantChart?.pointLabelFontSize||12,pointRadius:Ct.quadrantChart?.pointRadius||5,xAxisPosition:Ct.quadrantChart?.xAxisPosition||"top",yAxisPosition:Ct.quadrantChart?.yAxisPosition||"left",quadrantInternalBorderStrokeWidth:Ct.quadrantChart?.quadrantInternalBorderStrokeWidth||1,quadrantExternalBorderStrokeWidth:Ct.quadrantChart?.quadrantExternalBorderStrokeWidth||2}}getDefaultThemeConfig(){return{quadrant1Fill:uit.quadrant1Fill,quadrant2Fill:uit.quadrant2Fill,quadrant3Fill:uit.quadrant3Fill,quadrant4Fill:uit.quadrant4Fill,quadrant1TextFill:uit.quadrant1TextFill,quadrant2TextFill:uit.quadrant2TextFill,quadrant3TextFill:uit.quadrant3TextFill,quadrant4TextFill:uit.quadrant4TextFill,quadrantPointFill:uit.quadrantPointFill,quadrantPointTextFill:uit.quadrantPointTextFill,quadrantXAxisTextFill:uit.quadrantXAxisTextFill,quadrantYAxisTextFill:uit.quadrantYAxisTextFill,quadrantTitleFill:uit.quadrantTitleFill,quadrantInternalBorderStrokeFill:uit.quadrantInternalBorderStrokeFill,quadrantExternalBorderStrokeFill:uit.quadrantExternalBorderStrokeFill}}clear(){this.config=this.getDefaultConfig(),this.themeConfig=this.getDefaultThemeConfig(),this.data=this.getDefaultData(),this.classes=new Map,m.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){m.trace("setConfig called with: ",t),this.config={...this.config,...t}}setThemeConfig(t){m.trace("setThemeConfig called with: ",t),this.themeConfig={...this.themeConfig,...t}}calculateSpace(t,e,n,r){const i=2*this.config.xAxisLabelPadding+this.config.xAxisLabelFontSize,a={top:"top"===t&&e?i:0,bottom:"bottom"===t&&e?i:0},s=2*this.config.yAxisLabelPadding+this.config.yAxisLabelFontSize,o={left:"left"===this.config.yAxisPosition&&n?s:0,right:"right"===this.config.yAxisPosition&&n?s:0},l=this.config.titleFontSize+2*this.config.titlePadding,c={top:r?l:0},h=this.config.quadrantPadding+o.left,u=this.config.quadrantPadding+a.top+c.top,d=this.config.chartWidth-2*this.config.quadrantPadding-o.left-o.right,p=this.config.chartHeight-2*this.config.quadrantPadding-a.top-a.bottom-c.top;return{xAxisSpace:a,yAxisSpace:o,titleSpace:c,quadrantSpace:{quadrantLeft:h,quadrantTop:u,quadrantWidth:d,quadrantHalfWidth:d/2,quadrantHeight:p,quadrantHalfHeight:p/2}}}getAxisLabels(t,e,n,r){const{quadrantSpace:i,titleSpace:a}=r,{quadrantHalfHeight:s,quadrantHeight:o,quadrantLeft:l,quadrantHalfWidth:c,quadrantTop:h,quadrantWidth:u}=i,d=Boolean(this.data.xAxisRightText),p=Boolean(this.data.yAxisTopText),g=[];return this.data.xAxisLeftText&&e&&g.push({text:this.data.xAxisLeftText,fill:this.themeConfig.quadrantXAxisTextFill,x:l+(d?c/2:0),y:"top"===t?this.config.xAxisLabelPadding+a.top:this.config.xAxisLabelPadding+h+o+this.config.quadrantPadding,fontSize:this.config.xAxisLabelFontSize,verticalPos:d?"center":"left",horizontalPos:"top",rotation:0}),this.data.xAxisRightText&&e&&g.push({text:this.data.xAxisRightText,fill:this.themeConfig.quadrantXAxisTextFill,x:l+c+(d?c/2:0),y:"top"===t?this.config.xAxisLabelPadding+a.top:this.config.xAxisLabelPadding+h+o+this.config.quadrantPadding,fontSize:this.config.xAxisLabelFontSize,verticalPos:d?"center":"left",horizontalPos:"top",rotation:0}),this.data.yAxisBottomText&&n&&g.push({text:this.data.yAxisBottomText,fill:this.themeConfig.quadrantYAxisTextFill,x:"left"===this.config.yAxisPosition?this.config.yAxisLabelPadding:this.config.yAxisLabelPadding+l+u+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&&n&&g.push({text:this.data.yAxisTopText,fill:this.themeConfig.quadrantYAxisTextFill,x:"left"===this.config.yAxisPosition?this.config.yAxisLabelPadding:this.config.yAxisLabelPadding+l+u+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:n,quadrantLeft:r,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:r+i,y:a,width:i,height:n,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:r,y:a,width:i,height:n,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:r,y:a+n,width:i,height:n,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:r+i,y:a+n,width:i,height:n,fill:this.themeConfig.quadrant4Fill}];for(const t of s)t.text.x=t.x+t.width/2,0===this.data.points.length?(t.text.y=t.y+t.height/2,t.text.horizontalPos="middle"):(t.text.y=t.y+this.config.quadrantTextTopPadding,t.text.horizontalPos="top");return s}getQuadrantPoints(t){const{quadrantSpace:e}=t,{quadrantHeight:n,quadrantLeft:r,quadrantTop:i,quadrantWidth:a}=e,s=el().domain([0,1]).range([r,a+r]),o=el().domain([0,1]).range([n+i,i]),l=this.data.points.map((t=>{const e=this.classes.get(t.className);e&&(t={...e,...t});return{x:s(t.x),y:o(t.y),fill:t.color??this.themeConfig.quadrantPointFill,radius:t.radius??this.config.pointRadius,text:{text:t.text,fill:this.themeConfig.quadrantPointTextFill,x:s(t.x),y:o(t.y)+this.config.pointTextPadding,verticalPos:"center",horizontalPos:"top",fontSize:this.config.pointLabelFontSize,rotation:0},strokeColor:t.strokeColor??this.themeConfig.quadrantPointFill,strokeWidth:t.strokeWidth??"0px"}}));return l}getBorders(t){const e=this.config.quadrantExternalBorderStrokeWidth/2,{quadrantSpace:n}=t,{quadrantHalfHeight:r,quadrantHeight:i,quadrantLeft:a,quadrantHalfWidth:s,quadrantTop:o,quadrantWidth:l}=n;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+r,x2:a+l-e,y2:o+r}]}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),n=this.config.showTitle&&!!this.data.titleText,r=this.data.points.length>0?"bottom":this.config.xAxisPosition,i=this.calculateSpace(r,t,e,n);return{points:this.getQuadrantPoints(i),quadrants:this.getQuadrants(i),axisLabels:this.getAxisLabels(r,t,e,i),borderLines:this.getBorders(i),title:this.getTitle(n)}}},pit=class extends Error{static{s(this,"InvalidStyleError")}constructor(t,e,n){super(`value for ${t} ${e} is invalid, please use a valid ${n}`),this.name="InvalidStyleError"}};function git(t){return!/^#?([\dA-Fa-f]{6}|[\dA-Fa-f]{3})$/.test(t)}function fit(t){return!/^\d+$/.test(t)}function mit(t){return!/^\d+px$/.test(t)}s(git,"validateHexCode"),s(fit,"validateNumber"),s(mit,"validateSizeInPixels");var yit=Hn();function vit(t){return an(t.trim(),yit)}s(vit,"textSanitizer");var xit=new dit;function bit(t){xit.setData({quadrant1Text:vit(t.text)})}function wit(t){xit.setData({quadrant2Text:vit(t.text)})}function kit(t){xit.setData({quadrant3Text:vit(t.text)})}function Tit(t){xit.setData({quadrant4Text:vit(t.text)})}function _it(t){xit.setData({xAxisLeftText:vit(t.text)})}function Eit(t){xit.setData({xAxisRightText:vit(t.text)})}function Cit(t){xit.setData({yAxisTopText:vit(t.text)})}function Sit(t){xit.setData({yAxisBottomText:vit(t.text)})}function Ait(t){const e={};for(const n of t){const[t,r]=n.trim().split(/\s*:\s*/);if("radius"===t){if(fit(r))throw new pit(t,r,"number");e.radius=parseInt(r)}else if("color"===t){if(git(r))throw new pit(t,r,"hex code");e.color=r}else if("stroke-color"===t){if(git(r))throw new pit(t,r,"hex code");e.strokeColor=r}else{if("stroke-width"!==t)throw new Error(`style named ${t} is not supported.`);if(mit(r))throw new pit(t,r,"number of pixels (eg. 10px)");e.strokeWidth=r}}return e}function Lit(t,e,n,r,i){const a=Ait(i);xit.addPoints([{x:n,y:r,text:vit(t.text),className:e,...a}])}function Nit(t,e){xit.addClass(t,Ait(e))}function Iit(t){xit.setConfig({chartWidth:t})}function Mit(t){xit.setConfig({chartHeight:t})}function Rit(){const t=Hn(),{themeVariables:e,quadrantChart:n}=t;return n&&xit.setConfig(n),xit.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}),xit.setData({titleText:jn()}),xit.build()}s(bit,"setQuadrant1Text"),s(wit,"setQuadrant2Text"),s(kit,"setQuadrant3Text"),s(Tit,"setQuadrant4Text"),s(_it,"setXAxisLeftText"),s(Eit,"setXAxisRightText"),s(Cit,"setYAxisTopText"),s(Sit,"setYAxisBottomText"),s(Ait,"parseStyles"),s(Lit,"addPoint"),s(Nit,"addClass"),s(Iit,"setWidth"),s(Mit,"setHeight"),s(Rit,"getQuadrantData");var Dit={setWidth:Iit,setHeight:Mit,setQuadrant1Text:bit,setQuadrant2Text:wit,setQuadrant3Text:kit,setQuadrant4Text:Tit,setXAxisLeftText:_it,setXAxisRightText:Eit,setYAxisTopText:Cit,setYAxisBottomText:Sit,parseStyles:Ait,addPoint:Lit,addClass:Nit,getQuadrantData:Rit,clear:s((function(){xit.clear(),$n()}),"clear"),setAccTitle:Fn,getAccTitle:zn,setDiagramTitle:qn,getDiagramTitle:jn,getAccDescription:Gn,setAccDescription:Un},Oit=s(((t,e,n,r)=>{function i(t){return"top"===t?"hanging":"middle"}function a(t){return"left"===t?"start":"middle"}function o(t){return`translate(${t.x}, ${t.y}) rotate(${t.rotation||0})`}s(i,"getDominantBaseLine"),s(a,"getTextAnchor"),s(o,"getTransformation");const l=Hn();m.debug("Rendering quadrant chart\n"+t);const c=l.securityLevel;let h;"sandbox"===c&&(h=Oa("#i"+e));const u=Oa("sandbox"===c?h.nodes()[0].contentDocument.body:"body").select(`[id="${e}"]`),d=u.append("g").attr("class","main"),p=l.quadrantChart?.chartWidth??500,g=l.quadrantChart?.chartHeight??500;Sn(u,g,p,l.quadrantChart?.useMaxWidth??!0),u.attr("viewBox","0 0 "+p+" "+g),r.db.setHeight(g),r.db.setWidth(p);const f=r.db.getQuadrantData(),y=d.append("g").attr("class","quadrants"),v=d.append("g").attr("class","border"),x=d.append("g").attr("class","data-points"),b=d.append("g").attr("class","labels"),w=d.append("g").attr("class","title");f.title&&w.append("text").attr("x",0).attr("y",0).attr("fill",f.title.fill).attr("font-size",f.title.fontSize).attr("dominant-baseline",i(f.title.horizontalPos)).attr("text-anchor",a(f.title.verticalPos)).attr("transform",o(f.title)).text(f.title.text),f.borderLines&&v.selectAll("line").data(f.borderLines).enter().append("line").attr("x1",(t=>t.x1)).attr("y1",(t=>t.y1)).attr("x2",(t=>t.x2)).attr("y2",(t=>t.y2)).style("stroke",(t=>t.strokeFill)).style("stroke-width",(t=>t.strokeWidth));const k=y.selectAll("g.quadrant").data(f.quadrants).enter().append("g").attr("class","quadrant");k.append("rect").attr("x",(t=>t.x)).attr("y",(t=>t.y)).attr("width",(t=>t.width)).attr("height",(t=>t.height)).attr("fill",(t=>t.fill)),k.append("text").attr("x",0).attr("y",0).attr("fill",(t=>t.text.fill)).attr("font-size",(t=>t.text.fontSize)).attr("dominant-baseline",(t=>i(t.text.horizontalPos))).attr("text-anchor",(t=>a(t.text.verticalPos))).attr("transform",(t=>o(t.text))).text((t=>t.text.text));b.selectAll("g.label").data(f.axisLabels).enter().append("g").attr("class","label").append("text").attr("x",0).attr("y",0).text((t=>t.text)).attr("fill",(t=>t.fill)).attr("font-size",(t=>t.fontSize)).attr("dominant-baseline",(t=>i(t.horizontalPos))).attr("text-anchor",(t=>a(t.verticalPos))).attr("transform",(t=>o(t)));const T=x.selectAll("g.data-point").data(f.points).enter().append("g").attr("class","data-point");T.append("circle").attr("cx",(t=>t.x)).attr("cy",(t=>t.y)).attr("r",(t=>t.radius)).attr("fill",(t=>t.fill)).attr("stroke",(t=>t.strokeColor)).attr("stroke-width",(t=>t.strokeWidth)),T.append("text").attr("x",0).attr("y",0).text((t=>t.text.text)).attr("fill",(t=>t.text.fill)).attr("font-size",(t=>t.text.fontSize)).attr("dominant-baseline",(t=>i(t.text.horizontalPos))).attr("text-anchor",(t=>a(t.text.verticalPos))).attr("transform",(t=>o(t.text)))}),"draw"),Pit={parser:hit,db:Dit,renderer:{draw:Oit},styles:s((()=>""),"styles")},Bit=Object.freeze({__proto__:null,diagram:Pit}),$it=function(){var t=s((function(t,e,n,r){for(n=n||{},r=t.length;r--;n[t[r]]=e);return n}),"o"),e=[1,10,12,14,16,18,19,21,23],n=[2,6],r=[1,3],i=[1,5],a=[1,6],o=[1,7],l=[1,5,10,12,14,16,18,19,21,23,34,35,36],c=[1,25],h=[1,26],u=[1,28],d=[1,29],p=[1,30],g=[1,31],f=[1,32],m=[1,33],y=[1,34],v=[1,35],x=[1,36],b=[1,37],w=[1,43],k=[1,42],T=[1,47],_=[1,50],E=[1,10,12,14,16,18,19,21,23,34,35,36],C=[1,10,12,14,16,18,19,21,23,24,26,27,28,34,35,36],S=[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],A=[1,64],L={trace:s((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:s((function(t,e,n,r,i,a,s){var o=a.length-1;switch(i){case 5:r.setOrientation(a[o]);break;case 9:r.setDiagramTitle(a[o].text.trim());break;case 12:r.setLineData({text:"",type:"text"},a[o]);break;case 13:r.setLineData(a[o-1],a[o]);break;case 14:r.setBarData({text:"",type:"text"},a[o]);break;case 15:r.setBarData(a[o-1],a[o]);break;case 16:this.$=a[o].trim(),r.setAccTitle(this.$);break;case 17:case 18:this.$=a[o].trim(),r.setAccDescription(this.$);break;case 19:case 27:this.$=a[o-1];break;case 20:this.$=[Number(a[o-2]),...a[o]];break;case 21:this.$=[Number(a[o])];break;case 22:r.setXAxisTitle(a[o]);break;case 23:r.setXAxisTitle(a[o-1]);break;case 24:r.setXAxisTitle({type:"text",text:""});break;case 25:r.setXAxisBand(a[o]);break;case 26:r.setXAxisRangeData(Number(a[o-2]),Number(a[o]));break;case 28:this.$=[a[o-2],...a[o]];break;case 29:this.$=[a[o]];break;case 30:r.setYAxisTitle(a[o]);break;case 31:r.setYAxisTitle(a[o-1]);break;case 32:r.setYAxisTitle({type:"text",text:""});break;case 33:r.setYAxisRangeData(Number(a[o-2]),Number(a[o]));break;case 37:case 38:this.$={text:a[o],type:"text"};break;case 39:this.$={text:a[o],type:"markdown"};break;case 40:this.$=a[o];break;case 41:this.$=a[o-1]+""+a[o]}}),"anonymous"),table:[t(e,n,{3:1,4:2,7:4,5:r,34:i,35:a,36:o}),{1:[3]},t(e,n,{4:2,7:4,3:8,5:r,34:i,35:a,36:o}),t(e,n,{4:2,7:4,6:9,3:10,5:r,8:[1,11],34:i,35:a,36:o}),{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(l,[2,34]),t(l,[2,35]),t(l,[2,36]),{1:[2,1]},t(e,n,{4:2,7:4,3:21,5:r,34:i,35:a,36:o}),{1:[2,3]},t(l,[2,5]),t(e,[2,7],{4:22,34:i,35:a,36:o}),{11:23,37:24,38:c,39:h,40:27,41:u,42:d,43:p,44:g,45:f,46:m,47:y,48:v,49:x,50:b},{11:39,13:38,24:w,27:k,29:40,30:41,37:24,38:c,39:h,40:27,41:u,42:d,43:p,44:g,45:f,46:m,47:y,48:v,49:x,50:b},{11:45,15:44,27:T,33:46,37:24,38:c,39:h,40:27,41:u,42:d,43:p,44:g,45:f,46:m,47:y,48:v,49:x,50:b},{11:49,17:48,24:_,37:24,38:c,39:h,40:27,41:u,42:d,43:p,44:g,45:f,46:m,47:y,48:v,49:x,50:b},{11:52,17:51,24:_,37:24,38:c,39:h,40:27,41:u,42:d,43:p,44:g,45:f,46:m,47:y,48:v,49:x,50:b},{20:[1,53]},{22:[1,54]},t(E,[2,18]),{1:[2,2]},t(E,[2,8]),t(E,[2,9]),t(C,[2,37],{40:55,41:u,42:d,43:p,44:g,45:f,46:m,47:y,48:v,49:x,50:b}),t(C,[2,38]),t(C,[2,39]),t(S,[2,40]),t(S,[2,42]),t(S,[2,43]),t(S,[2,44]),t(S,[2,45]),t(S,[2,46]),t(S,[2,47]),t(S,[2,48]),t(S,[2,49]),t(S,[2,50]),t(S,[2,51]),t(E,[2,10]),t(E,[2,22],{30:41,29:56,24:w,27:k}),t(E,[2,24]),t(E,[2,25]),{31:[1,57]},{11:59,32:58,37:24,38:c,39:h,40:27,41:u,42:d,43:p,44:g,45:f,46:m,47:y,48:v,49:x,50:b},t(E,[2,11]),t(E,[2,30],{33:60,27:T}),t(E,[2,32]),{31:[1,61]},t(E,[2,12]),{17:62,24:_},{25:63,27:A},t(E,[2,14]),{17:65,24:_},t(E,[2,16]),t(E,[2,17]),t(S,[2,41]),t(E,[2,23]),{27:[1,66]},{26:[1,67]},{26:[2,29],28:[1,68]},t(E,[2,31]),{27:[1,69]},t(E,[2,13]),{26:[1,70]},{26:[2,21],28:[1,71]},t(E,[2,15]),t(E,[2,26]),t(E,[2,27]),{11:59,32:72,37:24,38:c,39:h,40:27,41:u,42:d,43:p,44:g,45:f,46:m,47:y,48:v,49:x,50:b},t(E,[2,33]),t(E,[2,19]),{25:73,27:A},{26:[2,28]},{26:[2,20]}],defaultActions:{8:[2,1],10:[2,3],21:[2,2],72:[2,28],73:[2,20]},parseError:s((function(t,e){if(!e.recoverable){var n=new Error(t);throw n.hash=e,n}this.trace(t)}),"parseError"),parse:s((function(t){var e=this,n=[0],r=[],i=[null],a=[],o=this.table,l="",c=0,h=0,u=2,d=1,p=a.slice.call(arguments,1),g=Object.create(this.lexer),f={yy:{}};for(var m in this.yy)Object.prototype.hasOwnProperty.call(this.yy,m)&&(f.yy[m]=this.yy[m]);g.setInput(t,f.yy),f.yy.lexer=g,f.yy.parser=this,void 0===g.yylloc&&(g.yylloc={});var y=g.yylloc;a.push(y);var v=g.options&&g.options.ranges;function x(t){n.length=n.length-2*t,i.length=i.length-t,a.length=a.length-t}function b(){var t;return"number"!=typeof(t=r.pop()||g.lex()||d)&&(t instanceof Array&&(t=(r=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof f.yy.parseError?this.parseError=f.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,s(x,"popStack"),s(b,"lex");for(var w,k,T,_,E,C,S,A,L={};;){if(k=n[n.length-1],this.defaultActions[k]?T=this.defaultActions[k]:(null==w&&(w=b()),T=o[k]&&o[k][w]),void 0===T||!T.length||!T[0]){var N="";for(E in A=[],o[k])this.terminals_[E]&&E>u&&A.push("'"+this.terminals_[E]+"'");N=g.showPosition?"Parse error on line "+(c+1)+":\n"+g.showPosition()+"\nExpecting "+A.join(", ")+", got '"+(this.terminals_[w]||w)+"'":"Parse error on line "+(c+1)+": Unexpected "+(w==d?"end of input":"'"+(this.terminals_[w]||w)+"'"),this.parseError(N,{text:g.match,token:this.terminals_[w]||w,line:g.yylineno,loc:y,expected:A})}if(T[0]instanceof Array&&T.length>1)throw new Error("Parse Error: multiple actions possible at state: "+k+", token: "+w);switch(T[0]){case 1:n.push(w),i.push(g.yytext),a.push(g.yylloc),n.push(T[1]),w=null,h=g.yyleng,l=g.yytext,c=g.yylineno,y=g.yylloc;break;case 2:if(C=this.productions_[T[1]][1],L.$=i[i.length-C],L._$={first_line:a[a.length-(C||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(C||1)].first_column,last_column:a[a.length-1].last_column},v&&(L._$.range=[a[a.length-(C||1)].range[0],a[a.length-1].range[1]]),void 0!==(_=this.performAction.apply(L,[l,h,c,f.yy,T[1],i,a].concat(p))))return _;C&&(n=n.slice(0,-1*C*2),i=i.slice(0,-1*C),a=a.slice(0,-1*C)),n.push(this.productions_[T[1]][0]),i.push(L.$),a.push(L._$),S=o[n[n.length-2]][n[n.length-1]],n.push(S);break;case 3:return!0}}return!0}),"parse")},N=function(){var t={EOF:1,parseError:s((function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)}),"parseError"),setInput:s((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:s((function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(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:s((function(t){var e=t.length,n=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 r=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 i=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===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this}),"unput"),more:s((function(){return this._more=!0,this}),"more"),reject:s((function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):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).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}),"reject"),less:s((function(t){this.unput(this.match.slice(t))}),"less"),pastInput:s((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:s((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:s((function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"}),"showPosition"),test_match:s((function(t,e){var n,r,i;if(this.options.backtrack_lexer&&(i={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&&(i.yylloc.range=this.yylloc.range.slice(0))),(r=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.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],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1}),"test_match"),next:s((function(){if(this.done)return this.EOF;var t,e,n,r;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;a<i.length;a++)if((n=this._input.match(this.rules[i[a]]))&&(!e||n[0].length>e[0].length)){if(e=n,r=a,this.options.backtrack_lexer){if(!1!==(t=this.test_match(n,i[a])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,i[r]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}),"next"),lex:s((function(){var t=this.next();return t||this.lex()}),"lex"),begin:s((function(t){this.conditionStack.push(t)}),"begin"),popState:s((function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]}),"popState"),_currentRules:s((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:s((function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"}),"topState"),pushState:s((function(t){this.begin(t)}),"pushState"),stateStackSize:s((function(){return this.conditionStack.length}),"stateStackSize"),options:{"case-insensitive":!0},performAction:s((function(t,e,n,r){switch(n){case 0:case 1:case 5:case 43:break;case 2:case 3:return this.popState(),34;case 4:return 34;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:case 25:case 27:this.popState();break;case 13:return"acc_descr_multiline_value";case 14:return 5;case 15:return 8;case 16:return this.pushState("axis_data"),"X_AXIS";case 17:return this.pushState("axis_data"),"Y_AXIS";case 18:return this.pushState("axis_band_data"),24;case 19:return 31;case 20:return this.pushState("data"),16;case 21:return this.pushState("data"),18;case 22:return this.pushState("data_inner"),24;case 23:return 27;case 24:return this.popState(),26;case 26:this.pushState("string");break;case 28:return"STR";case 29:return 24;case 30:return 26;case 31:return 43;case 32:return"COLON";case 33:return 44;case 34:return 28;case 35:return 45;case 36:return 46;case 37:return 48;case 38:return 50;case 39:return 47;case 40:return 41;case 41:return 49;case 42:return 42;case 44:return 35;case 45: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,/^(?:(?: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,20,21,23,24,25,26,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45],inclusive:!0},data:{rules:[0,1,3,4,5,6,7,9,11,14,15,16,17,20,21,22,25,26,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45],inclusive:!0},axis_band_data:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,20,21,24,25,26,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45],inclusive:!0},axis_data:{rules:[0,1,2,4,5,6,7,9,11,14,15,16,17,18,19,20,21,23,25,26,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45],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:[27,28],inclusive:!1},INITIAL:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,20,21,25,26,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45],inclusive:!0}}};return t}();function I(){this.yy={}}return L.lexer=N,s(I,"Parser"),I.prototype=L,L.Parser=I,new I}();$it.parser=$it;var Fit=$it;function zit(t){return"bar"===t.type}function Uit(t){return"band"===t.type}function Git(t){return"linear"===t.type}s(zit,"isBarPlot"),s(Uit,"isBandAxisData"),s(Git,"isLinearAxisData");var qit=class{constructor(t){this.parentGroup=t}static{s(this,"TextDimensionCalculatorWithFont")}getMaxDimension(t,e){if(!this.parentGroup)return{width:t.reduce(((t,e)=>Math.max(e.length,t)),0)*e,height:e};const n={width:0,height:0},r=this.parentGroup.append("g").attr("visibility","hidden").attr("font-size",e);for(const i of t){const t=WT(r,1,i),a=t?t.width:i.length*e,s=t?t.height:e;n.width=Math.max(n.width,a),n.height=Math.max(n.height,s)}return r.remove(),n}},jit=class{constructor(t,e,n,r){this.axisConfig=t,this.title=e,this.textDimensionCalculator=n,this.axisThemeConfig=r,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{s(this,"BaseAxis")}setRange(t){this.range=t,"left"===this.axisPosition||"right"===this.axisPosition?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(){.7*this.getTickDistance()>2*this.outerPadding&&(this.outerPadding=Math.floor(.7*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 n=this.getLabelDimension(),r=.2*t.width;this.outerPadding=Math.min(n.width/2,r);const i=n.height+2*this.axisConfig.labelPadding;this.labelTextHeight=n.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 t=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),n=t.height+2*this.axisConfig.titlePadding;this.titleTextHeight=t.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 n=this.getLabelDimension(),r=.2*t.height;this.outerPadding=Math.min(n.height/2,r);const i=n.width+2*this.axisConfig.labelPadding;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 t=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),n=t.height+2*this.axisConfig.titlePadding;this.titleTextHeight=t.height,n<=e&&(e-=n,this.showTitle=!0)}this.boundingRect.width=t.width-e,this.boundingRect.height=t.height}calculateSpace(t){return"left"===this.axisPosition||"right"===this.axisPosition?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((t=>({text:t.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(t),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((t=>({path:`M ${e},${this.getScaleValue(t)} L ${e-this.axisConfig.tickLength},${this.getScaleValue(t)}`,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((t=>({text:t.toString(),x:this.getScaleValue(t),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((t=>({path:`M ${this.getScaleValue(t)},${e} L ${this.getScaleValue(t)},${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((t=>({text:t.toString(),x:this.getScaleValue(t),y:this.boundingRect.y+(this.showTitle?this.titleTextHeight+2*this.axisConfig.titlePadding: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((t=>({path:`M ${this.getScaleValue(t)},${e+this.boundingRect.height-(this.showAxisLine?this.axisConfig.axisLineWidth:0)} L ${this.getScaleValue(t)},${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("left"===this.axisPosition)return this.getDrawableElementsForLeftAxis();if("right"===this.axisPosition)throw Error("Drawing of right axis is not implemented");return"bottom"===this.axisPosition?this.getDrawableElementsForBottomAxis():"top"===this.axisPosition?this.getDrawableElementsForTopAxis():[]}},Yit=class extends jit{static{s(this,"BandAxis")}constructor(t,e,n,r,i){super(t,r,i,e),this.categories=n,this.scale=dh().domain(this.categories).range(this.getRange())}setRange(t){super.setRange(t)}recalculateScale(){this.scale=dh().domain(this.categories).range(this.getRange()).paddingInner(1).paddingOuter(0).align(.5),m.trace("BandAxis axis final categories, range: ",this.categories,this.getRange())}getTickValues(){return this.categories}getScaleValue(t){return this.scale(t)??this.getRange()[0]}},Wit=class extends jit{static{s(this,"LinearAxis")}constructor(t,e,n,r,i){super(t,r,i,e),this.domain=n,this.scale=el().domain(this.domain).range(this.getRange())}getTickValues(){return this.scale.ticks()}recalculateScale(){const t=[...this.domain];"left"===this.axisPosition&&t.reverse(),this.scale=el().domain(t).range(this.getRange())}getScaleValue(t){return this.scale(t)}};function Hit(t,e,n,r){const i=new qit(r);return Uit(t)?new Yit(e,n,t.categories,t.title,i):new Wit(e,n,[t.min,t.max],t.title,i)}s(Hit,"getAxis");var Vit=class{constructor(t,e,n,r){this.textDimensionCalculator=t,this.chartConfig=e,this.chartData=n,this.chartThemeConfig=r,this.boundingRect={x:0,y:0,width:0,height:0},this.showChartTitle=!1}static{s(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),n=Math.max(e.width,t.width),r=e.height+2*this.chartConfig.titlePadding;return e.width<=n&&e.height<=r&&this.chartConfig.showTitle&&this.chartData.title&&(this.boundingRect.width=n,this.boundingRect.height=r,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 Xit(t,e,n,r){const i=new qit(r);return new Vit(i,t,e,n)}s(Xit,"getChartTitleComponent");var Kit=class{constructor(t,e,n,r,i){this.plotData=t,this.xAxis=e,this.yAxis=n,this.orientation=r,this.plotIndex=i}static{s(this,"LinePlot")}getDrawableElement(){const t=this.plotData.data.map((t=>[this.xAxis.getScaleValue(t[0]),this.yAxis.getScaleValue(t[1])]));let e;return e="horizontal"===this.orientation?Xh().y((t=>t[0])).x((t=>t[1]))(t):Xh().x((t=>t[0])).y((t=>t[1]))(t),e?[{groupTexts:["plot",`line-plot-${this.plotIndex}`],type:"path",data:[{path:e,strokeFill:this.plotData.strokeFill,strokeWidth:this.plotData.strokeWidth}]}]:[]}},Zit=class{constructor(t,e,n,r,i,a){this.barData=t,this.boundingRect=e,this.xAxis=n,this.yAxis=r,this.orientation=i,this.plotIndex=a}static{s(this,"BarPlot")}getDrawableElement(){const t=this.barData.data.map((t=>[this.xAxis.getScaleValue(t[0]),this.yAxis.getScaleValue(t[1])])),e=.95*Math.min(2*this.xAxis.getAxisOuterPadding(),this.xAxis.getTickDistance()),n=e/2;return"horizontal"===this.orientation?[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:t.map((t=>({x:this.boundingRect.x,y:t[0]-n,height:e,width:t[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((t=>({x:t[0]-n,y:t[1],width:e,height:this.boundingRect.y+this.boundingRect.height-t[1],fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill})))}]}},Qit=class{constructor(t,e,n){this.chartConfig=t,this.chartData=e,this.chartThemeConfig=n,this.boundingRect={x:0,y:0,width:0,height:0}}static{s(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,n]of this.chartData.plots.entries())switch(n.type){case"line":{const r=new Kit(n,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,e);t.push(...r.getDrawableElement())}break;case"bar":{const r=new Zit(n,this.boundingRect,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,e);t.push(...r.getDrawableElement())}}return t}};function Jit(t,e,n){return new Qit(t,e,n)}s(Jit,"getPlotComponent");var tat,eat=class{constructor(t,e,n,r){this.chartConfig=t,this.chartData=e,this.componentStore={title:Xit(t,e,n,r),plot:Jit(t,e,n),xAxis:Hit(e.xAxis,t.xAxis,{titleColor:n.xAxisTitleColor,labelColor:n.xAxisLabelColor,tickColor:n.xAxisTickColor,axisLineColor:n.xAxisLineColor},r),yAxis:Hit(e.yAxis,t.yAxis,{titleColor:n.yAxisTitleColor,labelColor:n.yAxisLabelColor,tickColor:n.yAxisTickColor,axisLineColor:n.yAxisLineColor},r)}}static{s(this,"Orchestrator")}calculateVerticalSpace(){let t=this.chartConfig.width,e=this.chartConfig.height,n=0,r=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}),r=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}),n=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:n,y:r}),this.componentStore.xAxis.setRange([n,n+i]),this.componentStore.xAxis.setBoundingBoxXY({x:n,y:r+a}),this.componentStore.yAxis.setRange([r,r+a]),this.componentStore.yAxis.setBoundingBoxXY({x:0,y:r}),this.chartData.plots.some((t=>zit(t)))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateHorizontalSpace(){let t=this.chartConfig.width,e=this.chartConfig.height,n=0,r=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}),n=o.height,e-=o.height,this.componentStore.xAxis.setAxisPosition("left"),o=this.componentStore.xAxis.calculateSpace({width:t,height:e}),t-=o.width,r=o.width,this.componentStore.yAxis.setAxisPosition("top"),o=this.componentStore.yAxis.calculateSpace({width:t,height:e}),e-=o.height,i=n+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:r,y:i}),this.componentStore.yAxis.setRange([r,r+a]),this.componentStore.yAxis.setBoundingBoxXY({x:r,y:n}),this.componentStore.xAxis.setRange([i,i+s]),this.componentStore.xAxis.setBoundingBoxXY({x:0,y:i}),this.chartData.plots.some((t=>zit(t)))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateSpace(){"horizontal"===this.chartConfig.chartOrientation?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}},nat=class{static{s(this,"XYChartBuilder")}static build(t,e,n,r){return new eat(t,e,n,r).getDrawableElement()}},rat=0,iat=uat(),aat=hat(),sat=dat(),oat=aat.plotColorPalette.split(",").map((t=>t.trim())),lat=!1,cat=!1;function hat(){const t=yt(),e=Ft();return mk(t.xyChart,e.themeVariables.xyChart)}function uat(){const t=Ft();return mk(Ct.xyChart,t.xyChart)}function dat(){return{yAxis:{type:"linear",title:"",min:1/0,max:-1/0},xAxis:{type:"band",title:"",categories:[]},title:"",plots:[]}}function pat(t){const e=Ft();return an(t.trim(),e)}function gat(t){tat=t}function fat(t){iat.chartOrientation="horizontal"===t?"horizontal":"vertical"}function mat(t){sat.xAxis.title=pat(t.text)}function yat(t,e){sat.xAxis={type:"linear",title:sat.xAxis.title,min:t,max:e},lat=!0}function vat(t){sat.xAxis={type:"band",title:sat.xAxis.title,categories:t.map((t=>pat(t.text)))},lat=!0}function xat(t){sat.yAxis.title=pat(t.text)}function bat(t,e){sat.yAxis={type:"linear",title:sat.yAxis.title,min:t,max:e},cat=!0}function wat(t){const e=Math.min(...t),n=Math.max(...t),r=Git(sat.yAxis)?sat.yAxis.min:1/0,i=Git(sat.yAxis)?sat.yAxis.max:-1/0;sat.yAxis={type:"linear",title:sat.yAxis.title,min:Math.min(r,e),max:Math.max(i,n)}}function kat(t){let e=[];if(0===t.length)return e;if(!lat){const e=Git(sat.xAxis)?sat.xAxis.min:1/0,n=Git(sat.xAxis)?sat.xAxis.max:-1/0;yat(Math.min(e,1),Math.max(n,t.length))}if(cat||wat(t),Uit(sat.xAxis)&&(e=sat.xAxis.categories.map(((e,n)=>[e,t[n]]))),Git(sat.xAxis)){const n=sat.xAxis.min,r=sat.xAxis.max,i=(r-n)/(t.length-1),a=[];for(let t=n;t<=r;t+=i)a.push(`${t}`);e=a.map(((e,n)=>[e,t[n]]))}return e}function Tat(t){return oat[0===t?0:t%oat.length]}function _at(t,e){const n=kat(e);sat.plots.push({type:"line",strokeFill:Tat(rat),strokeWidth:2,data:n}),rat++}function Eat(t,e){const n=kat(e);sat.plots.push({type:"bar",fill:Tat(rat),data:n}),rat++}function Cat(){if(0===sat.plots.length)throw Error("No Plot to render, please provide a plot with some data");return sat.title=jn(),nat.build(iat,sat,aat,tat)}function Sat(){return aat}function Aat(){return iat}s(hat,"getChartDefaultThemeConfig"),s(uat,"getChartDefaultConfig"),s(dat,"getChartDefaultData"),s(pat,"textSanitizer"),s(gat,"setTmpSVGG"),s(fat,"setOrientation"),s(mat,"setXAxisTitle"),s(yat,"setXAxisRangeData"),s(vat,"setXAxisBand"),s(xat,"setYAxisTitle"),s(bat,"setYAxisRangeData"),s(wat,"setYAxisRangeFromPlotData"),s(kat,"transformDataWithoutCategory"),s(Tat,"getPlotColorFromPalette"),s(_at,"setLineData"),s(Eat,"setBarData"),s(Cat,"getDrawableElem"),s(Sat,"getChartThemeConfig"),s(Aat,"getChartConfig");var Lat=s((function(){$n(),rat=0,iat=uat(),sat={yAxis:{type:"linear",title:"",min:1/0,max:-1/0},xAxis:{type:"band",title:"",categories:[]},title:"",plots:[]},aat=hat(),oat=aat.plotColorPalette.split(",").map((t=>t.trim())),lat=!1,cat=!1}),"clear"),Nat={getDrawableElem:Cat,clear:Lat,setAccTitle:Fn,getAccTitle:zn,setDiagramTitle:qn,getDiagramTitle:jn,getAccDescription:Gn,setAccDescription:Un,setOrientation:fat,setXAxisTitle:mat,setXAxisRangeData:yat,setXAxisBand:vat,setYAxisTitle:xat,setYAxisRangeData:bat,setLineData:_at,setBarData:Eat,setTmpSVGG:gat,getChartThemeConfig:Sat,getChartConfig:Aat},Iat=s(((t,e,n,r)=>{const i=r.db,a=i.getChartThemeConfig(),o=i.getChartConfig();function l(t){return"top"===t?"text-before-edge":"middle"}function c(t){return"left"===t?"start":"right"===t?"end":"middle"}function h(t){return`translate(${t.x}, ${t.y}) rotate(${t.rotation||0})`}s(l,"getDominantBaseLine"),s(c,"getTextAnchor"),s(h,"getTextTransformation"),m.debug("Rendering xychart chart\n"+t);const u=zp(e),d=u.append("g").attr("class","main"),p=d.append("rect").attr("width",o.width).attr("height",o.height).attr("class","background");Sn(u,o.height,o.width,!0),u.attr("viewBox",`0 0 ${o.width} ${o.height}`),p.attr("fill",a.backgroundColor),i.setTmpSVGG(u.append("g").attr("class","mermaid-tmp-group"));const g=i.getDrawableElem(),f={};function y(t){let e=d,n="";for(const[r]of t.entries()){let i=d;r>0&&f[n]&&(i=f[n]),n+=t[r],e=f[n],e||(e=f[n]=i.append("g").attr("class",t[r]))}return e}s(y,"getGroup");for(const t of g){if(0===t.data.length)continue;const e=y(t.groupTexts);switch(t.type){case"rect":e.selectAll("rect").data(t.data).enter().append("rect").attr("x",(t=>t.x)).attr("y",(t=>t.y)).attr("width",(t=>t.width)).attr("height",(t=>t.height)).attr("fill",(t=>t.fill)).attr("stroke",(t=>t.strokeFill)).attr("stroke-width",(t=>t.strokeWidth));break;case"text":e.selectAll("text").data(t.data).enter().append("text").attr("x",0).attr("y",0).attr("fill",(t=>t.fill)).attr("font-size",(t=>t.fontSize)).attr("dominant-baseline",(t=>l(t.verticalPos))).attr("text-anchor",(t=>c(t.horizontalPos))).attr("transform",(t=>h(t))).text((t=>t.text));break;case"path":e.selectAll("path").data(t.data).enter().append("path").attr("d",(t=>t.path)).attr("fill",(t=>t.fill?t.fill:"none")).attr("stroke",(t=>t.strokeFill)).attr("stroke-width",(t=>t.strokeWidth))}}}),"draw"),Mat={parser:Fit,db:Nat,renderer:{draw:Iat}},Rat=Object.freeze({__proto__:null,diagram:Mat}),Dat=function(){var t=s((function(t,e,n,r){for(n=n||{},r=t.length;r--;n[t[r]]=e);return n}),"o"),e=[1,3],n=[1,4],r=[1,5],i=[1,6],a=[5,6,8,9,11,13,31,32,33,34,35,36,44,62,63],o=[1,18],l=[2,7],c=[1,22],h=[1,23],u=[1,24],d=[1,25],p=[1,26],g=[1,27],f=[1,20],m=[1,28],y=[1,29],v=[62,63],x=[5,8,9,11,13,31,32,33,34,35,36,44,51,53,62,63],b=[1,47],w=[1,48],k=[1,49],T=[1,50],_=[1,51],E=[1,52],C=[1,53],S=[53,54],A=[1,64],L=[1,60],N=[1,61],I=[1,62],M=[1,63],R=[1,65],D=[1,69],O=[1,70],P=[1,67],B=[1,68],$=[5,8,9,11,13,31,32,33,34,35,36,44,62,63],F={trace:s((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,requirementType:17,requirementName:18,STRUCT_START:19,requirementBody:20,ID:21,COLONSEP:22,id:23,TEXT:24,text:25,RISK:26,riskLevel:27,VERIFYMTHD:28,verifyType:29,STRUCT_STOP:30,REQUIREMENT:31,FUNCTIONAL_REQUIREMENT:32,INTERFACE_REQUIREMENT:33,PERFORMANCE_REQUIREMENT:34,PHYSICAL_REQUIREMENT:35,DESIGN_CONSTRAINT:36,LOW_RISK:37,MED_RISK:38,HIGH_RISK:39,VERIFY_ANALYSIS:40,VERIFY_DEMONSTRATION:41,VERIFY_INSPECTION:42,VERIFY_TEST:43,ELEMENT:44,elementName:45,elementBody:46,TYPE:47,type:48,DOCREF:49,ref:50,END_ARROW_L:51,relationship:52,LINE:53,END_ARROW_R:54,CONTAINS:55,COPIES:56,DERIVES:57,SATISFIES:58,VERIFIES:59,REFINES:60,TRACES:61,unqString:62,qString:63,$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",19:"STRUCT_START",21:"ID",22:"COLONSEP",24:"TEXT",26:"RISK",28:"VERIFYMTHD",30:"STRUCT_STOP",31:"REQUIREMENT",32:"FUNCTIONAL_REQUIREMENT",33:"INTERFACE_REQUIREMENT",34:"PERFORMANCE_REQUIREMENT",35:"PHYSICAL_REQUIREMENT",36:"DESIGN_CONSTRAINT",37:"LOW_RISK",38:"MED_RISK",39:"HIGH_RISK",40:"VERIFY_ANALYSIS",41:"VERIFY_DEMONSTRATION",42:"VERIFY_INSPECTION",43:"VERIFY_TEST",44:"ELEMENT",47:"TYPE",49:"DOCREF",51:"END_ARROW_L",53:"LINE",54:"END_ARROW_R",55:"CONTAINS",56:"COPIES",57:"DERIVES",58:"SATISFIES",59:"VERIFIES",60:"REFINES",61:"TRACES",62:"unqString",63:"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],[14,5],[20,5],[20,5],[20,5],[20,5],[20,2],[20,1],[17,1],[17,1],[17,1],[17,1],[17,1],[17,1],[27,1],[27,1],[27,1],[29,1],[29,1],[29,1],[29,1],[15,5],[46,5],[46,5],[46,2],[46,1],[16,5],[16,5],[52,1],[52,1],[52,1],[52,1],[52,1],[52,1],[52,1],[18,1],[18,1],[23,1],[23,1],[25,1],[25,1],[45,1],[45,1],[48,1],[48,1],[50,1],[50,1]],performAction:s((function(t,e,n,r,i,a,s){var o=a.length-1;switch(i){case 4:this.$=a[o].trim(),r.setAccTitle(this.$);break;case 5:case 6:this.$=a[o].trim(),r.setAccDescription(this.$);break;case 7:this.$=[];break;case 13:r.addRequirement(a[o-3],a[o-4]);break;case 14:r.setNewReqId(a[o-2]);break;case 15:r.setNewReqText(a[o-2]);break;case 16:r.setNewReqRisk(a[o-2]);break;case 17:r.setNewReqVerifyMethod(a[o-2]);break;case 20:this.$=r.RequirementType.REQUIREMENT;break;case 21:this.$=r.RequirementType.FUNCTIONAL_REQUIREMENT;break;case 22:this.$=r.RequirementType.INTERFACE_REQUIREMENT;break;case 23:this.$=r.RequirementType.PERFORMANCE_REQUIREMENT;break;case 24:this.$=r.RequirementType.PHYSICAL_REQUIREMENT;break;case 25:this.$=r.RequirementType.DESIGN_CONSTRAINT;break;case 26:this.$=r.RiskLevel.LOW_RISK;break;case 27:this.$=r.RiskLevel.MED_RISK;break;case 28:this.$=r.RiskLevel.HIGH_RISK;break;case 29:this.$=r.VerifyType.VERIFY_ANALYSIS;break;case 30:this.$=r.VerifyType.VERIFY_DEMONSTRATION;break;case 31:this.$=r.VerifyType.VERIFY_INSPECTION;break;case 32:this.$=r.VerifyType.VERIFY_TEST;break;case 33:r.addElement(a[o-3]);break;case 34:r.setNewElementType(a[o-2]);break;case 35:r.setNewElementDocRef(a[o-2]);break;case 38:r.addRelationship(a[o-2],a[o],a[o-4]);break;case 39:r.addRelationship(a[o-2],a[o-4],a[o]);break;case 40:this.$=r.Relationships.CONTAINS;break;case 41:this.$=r.Relationships.COPIES;break;case 42:this.$=r.Relationships.DERIVES;break;case 43:this.$=r.Relationships.SATISFIES;break;case 44:this.$=r.Relationships.VERIFIES;break;case 45:this.$=r.Relationships.REFINES;break;case 46:this.$=r.Relationships.TRACES}}),"anonymous"),table:[{3:1,4:2,6:e,9:n,11:r,13:i},{1:[3]},{3:8,4:2,5:[1,7],6:e,9:n,11:r,13:i},{5:[1,9]},{10:[1,10]},{12:[1,11]},t(a,[2,6]),{3:12,4:2,6:e,9:n,11:r,13:i},{1:[2,2]},{4:17,5:o,7:13,8:l,9:n,11:r,13:i,14:14,15:15,16:16,17:19,23:21,31:c,32:h,33:u,34:d,35:p,36:g,44:f,62:m,63:y},t(a,[2,4]),t(a,[2,5]),{1:[2,1]},{8:[1,30]},{4:17,5:o,7:31,8:l,9:n,11:r,13:i,14:14,15:15,16:16,17:19,23:21,31:c,32:h,33:u,34:d,35:p,36:g,44:f,62:m,63:y},{4:17,5:o,7:32,8:l,9:n,11:r,13:i,14:14,15:15,16:16,17:19,23:21,31:c,32:h,33:u,34:d,35:p,36:g,44:f,62:m,63:y},{4:17,5:o,7:33,8:l,9:n,11:r,13:i,14:14,15:15,16:16,17:19,23:21,31:c,32:h,33:u,34:d,35:p,36:g,44:f,62:m,63:y},{4:17,5:o,7:34,8:l,9:n,11:r,13:i,14:14,15:15,16:16,17:19,23:21,31:c,32:h,33:u,34:d,35:p,36:g,44:f,62:m,63:y},{4:17,5:o,7:35,8:l,9:n,11:r,13:i,14:14,15:15,16:16,17:19,23:21,31:c,32:h,33:u,34:d,35:p,36:g,44:f,62:m,63:y},{18:36,62:[1,37],63:[1,38]},{45:39,62:[1,40],63:[1,41]},{51:[1,42],53:[1,43]},t(v,[2,20]),t(v,[2,21]),t(v,[2,22]),t(v,[2,23]),t(v,[2,24]),t(v,[2,25]),t(x,[2,49]),t(x,[2,50]),{1:[2,3]},{8:[2,8]},{8:[2,9]},{8:[2,10]},{8:[2,11]},{8:[2,12]},{19:[1,44]},{19:[2,47]},{19:[2,48]},{19:[1,45]},{19:[2,53]},{19:[2,54]},{52:46,55:b,56:w,57:k,58:T,59:_,60:E,61:C},{52:54,55:b,56:w,57:k,58:T,59:_,60:E,61:C},{5:[1,55]},{5:[1,56]},{53:[1,57]},t(S,[2,40]),t(S,[2,41]),t(S,[2,42]),t(S,[2,43]),t(S,[2,44]),t(S,[2,45]),t(S,[2,46]),{54:[1,58]},{5:A,20:59,21:L,24:N,26:I,28:M,30:R},{5:D,30:O,46:66,47:P,49:B},{23:71,62:m,63:y},{23:72,62:m,63:y},t($,[2,13]),{22:[1,73]},{22:[1,74]},{22:[1,75]},{22:[1,76]},{5:A,20:77,21:L,24:N,26:I,28:M,30:R},t($,[2,19]),t($,[2,33]),{22:[1,78]},{22:[1,79]},{5:D,30:O,46:80,47:P,49:B},t($,[2,37]),t($,[2,38]),t($,[2,39]),{23:81,62:m,63:y},{25:82,62:[1,83],63:[1,84]},{27:85,37:[1,86],38:[1,87],39:[1,88]},{29:89,40:[1,90],41:[1,91],42:[1,92],43:[1,93]},t($,[2,18]),{48:94,62:[1,95],63:[1,96]},{50:97,62:[1,98],63:[1,99]},t($,[2,36]),{5:[1,100]},{5:[1,101]},{5:[2,51]},{5:[2,52]},{5:[1,102]},{5:[2,26]},{5:[2,27]},{5:[2,28]},{5:[1,103]},{5:[2,29]},{5:[2,30]},{5:[2,31]},{5:[2,32]},{5:[1,104]},{5:[2,55]},{5:[2,56]},{5:[1,105]},{5:[2,57]},{5:[2,58]},{5:A,20:106,21:L,24:N,26:I,28:M,30:R},{5:A,20:107,21:L,24:N,26:I,28:M,30:R},{5:A,20:108,21:L,24:N,26:I,28:M,30:R},{5:A,20:109,21:L,24:N,26:I,28:M,30:R},{5:D,30:O,46:110,47:P,49:B},{5:D,30:O,46:111,47:P,49:B},t($,[2,14]),t($,[2,15]),t($,[2,16]),t($,[2,17]),t($,[2,34]),t($,[2,35])],defaultActions:{8:[2,2],12:[2,1],30:[2,3],31:[2,8],32:[2,9],33:[2,10],34:[2,11],35:[2,12],37:[2,47],38:[2,48],40:[2,53],41:[2,54],83:[2,51],84:[2,52],86:[2,26],87:[2,27],88:[2,28],90:[2,29],91:[2,30],92:[2,31],93:[2,32],95:[2,55],96:[2,56],98:[2,57],99:[2,58]},parseError:s((function(t,e){if(!e.recoverable){var n=new Error(t);throw n.hash=e,n}this.trace(t)}),"parseError"),parse:s((function(t){var e=this,n=[0],r=[],i=[null],a=[],o=this.table,l="",c=0,h=0,u=2,d=1,p=a.slice.call(arguments,1),g=Object.create(this.lexer),f={yy:{}};for(var m in this.yy)Object.prototype.hasOwnProperty.call(this.yy,m)&&(f.yy[m]=this.yy[m]);g.setInput(t,f.yy),f.yy.lexer=g,f.yy.parser=this,void 0===g.yylloc&&(g.yylloc={});var y=g.yylloc;a.push(y);var v=g.options&&g.options.ranges;function x(t){n.length=n.length-2*t,i.length=i.length-t,a.length=a.length-t}function b(){var t;return"number"!=typeof(t=r.pop()||g.lex()||d)&&(t instanceof Array&&(t=(r=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof f.yy.parseError?this.parseError=f.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,s(x,"popStack"),s(b,"lex");for(var w,k,T,_,E,C,S,A,L={};;){if(k=n[n.length-1],this.defaultActions[k]?T=this.defaultActions[k]:(null==w&&(w=b()),T=o[k]&&o[k][w]),void 0===T||!T.length||!T[0]){var N="";for(E in A=[],o[k])this.terminals_[E]&&E>u&&A.push("'"+this.terminals_[E]+"'");N=g.showPosition?"Parse error on line "+(c+1)+":\n"+g.showPosition()+"\nExpecting "+A.join(", ")+", got '"+(this.terminals_[w]||w)+"'":"Parse error on line "+(c+1)+": Unexpected "+(w==d?"end of input":"'"+(this.terminals_[w]||w)+"'"),this.parseError(N,{text:g.match,token:this.terminals_[w]||w,line:g.yylineno,loc:y,expected:A})}if(T[0]instanceof Array&&T.length>1)throw new Error("Parse Error: multiple actions possible at state: "+k+", token: "+w);switch(T[0]){case 1:n.push(w),i.push(g.yytext),a.push(g.yylloc),n.push(T[1]),w=null,h=g.yyleng,l=g.yytext,c=g.yylineno,y=g.yylloc;break;case 2:if(C=this.productions_[T[1]][1],L.$=i[i.length-C],L._$={first_line:a[a.length-(C||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(C||1)].first_column,last_column:a[a.length-1].last_column},v&&(L._$.range=[a[a.length-(C||1)].range[0],a[a.length-1].range[1]]),void 0!==(_=this.performAction.apply(L,[l,h,c,f.yy,T[1],i,a].concat(p))))return _;C&&(n=n.slice(0,-1*C*2),i=i.slice(0,-1*C),a=a.slice(0,-1*C)),n.push(this.productions_[T[1]][0]),i.push(L.$),a.push(L._$),S=o[n[n.length-2]][n[n.length-1]],n.push(S);break;case 3:return!0}}return!0}),"parse")},z=function(){var t={EOF:1,parseError:s((function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)}),"parseError"),setInput:s((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:s((function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(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:s((function(t){var e=t.length,n=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 r=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 i=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===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this}),"unput"),more:s((function(){return this._more=!0,this}),"more"),reject:s((function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):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).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}),"reject"),less:s((function(t){this.unput(this.match.slice(t))}),"less"),pastInput:s((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:s((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:s((function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"}),"showPosition"),test_match:s((function(t,e){var n,r,i;if(this.options.backtrack_lexer&&(i={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&&(i.yylloc.range=this.yylloc.range.slice(0))),(r=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.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],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1}),"test_match"),next:s((function(){if(this.done)return this.EOF;var t,e,n,r;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;a<i.length;a++)if((n=this._input.match(this.rules[i[a]]))&&(!e||n[0].length>e[0].length)){if(e=n,r=a,this.options.backtrack_lexer){if(!1!==(t=this.test_match(n,i[a])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,i[r]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}),"next"),lex:s((function(){var t=this.next();return t||this.lex()}),"lex"),begin:s((function(t){this.conditionStack.push(t)}),"begin"),popState:s((function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]}),"popState"),_currentRules:s((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:s((function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"}),"topState"),pushState:s((function(t){this.begin(t)}),"pushState"),stateStackSize:s((function(){return this.conditionStack.length}),"stateStackSize"),options:{"case-insensitive":!0},performAction:s((function(t,e,n,r){switch(n){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:case 48:this.popState();break;case 7:return"acc_descr_multiline_value";case 8:return 5;case 9:case 10:case 11:break;case 12:return 8;case 13:return 6;case 14:return 19;case 15:return 30;case 16:return 22;case 17:return 21;case 18:return 24;case 19:return 26;case 20:return 28;case 21:return 31;case 22:return 32;case 23:return 33;case 24:return 34;case 25:return 35;case 26:return 36;case 27:return 37;case 28:return 38;case 29:return 39;case 30:return 40;case 31:return 41;case 32:return 42;case 33:return 43;case 34:return 44;case 35:return 55;case 36:return 56;case 37:return 57;case 38:return 58;case 39:return 59;case 40:return 60;case 41:return 61;case 42:return 47;case 43:return 49;case 44:return 51;case 45:return 54;case 46:return 53;case 47:this.begin("string");break;case 49:return"qString";case 50:return e.yytext=e.yytext.trim(),62}}),"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,/^(?:(\r?\n)+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:%[^\n]*)/i,/^(?:$)/i,/^(?:requirementDiagram\b)/i,/^(?:\{)/i,/^(?:\})/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,/^(?:<-)/i,/^(?:->)/i,/^(?:-)/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[\w][^\r\n\{\<\>\-\=]*)/i],conditions:{acc_descr_multiline:{rules:[6,7],inclusive:!1},acc_descr:{rules:[4],inclusive:!1},acc_title:{rules:[2],inclusive:!1},unqString:{rules:[],inclusive:!1},token:{rules:[],inclusive:!1},string:{rules:[48,49],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,50],inclusive:!0}}};return t}();function U(){this.yy={}}return F.lexer=z,s(U,"Parser"),U.prototype=F,F.Parser=U,new U}();Dat.parser=Dat;var Oat=Dat,Pat=[],Bat={},$at=new Map,Fat={},zat=new Map,Uat=s(((t,e)=>($at.has(t)||$at.set(t,{name:t,type:e,id:Bat.id,text:Bat.text,risk:Bat.risk,verifyMethod:Bat.verifyMethod}),Bat={},$at.get(t))),"addRequirement"),Gat=s((()=>$at),"getRequirements"),qat=s((t=>{void 0!==Bat&&(Bat.id=t)}),"setNewReqId"),jat=s((t=>{void 0!==Bat&&(Bat.text=t)}),"setNewReqText"),Yat=s((t=>{void 0!==Bat&&(Bat.risk=t)}),"setNewReqRisk"),Wat=s((t=>{void 0!==Bat&&(Bat.verifyMethod=t)}),"setNewReqVerifyMethod"),Hat=s((t=>(zat.has(t)||(zat.set(t,{name:t,type:Fat.type,docRef:Fat.docRef}),m.info("Added new requirement: ",t)),Fat={},zat.get(t))),"addElement"),Vat=s((()=>zat),"getElements"),Xat=s((t=>{void 0!==Fat&&(Fat.type=t)}),"setNewElementType"),Kat=s((t=>{void 0!==Fat&&(Fat.docRef=t)}),"setNewElementDocRef"),Zat=s(((t,e,n)=>{Pat.push({type:t,src:e,dst:n})}),"addRelationship"),Qat=s((()=>Pat),"getRelationships"),Jat=s((()=>{Pat=[],Bat={},$at=new Map,Fat={},zat=new Map,$n()}),"clear"),tst={RequirementType:{REQUIREMENT:"Requirement",FUNCTIONAL_REQUIREMENT:"Functional Requirement",INTERFACE_REQUIREMENT:"Interface Requirement",PERFORMANCE_REQUIREMENT:"Performance Requirement",PHYSICAL_REQUIREMENT:"Physical Requirement",DESIGN_CONSTRAINT:"Design Constraint"},RiskLevel:{LOW_RISK:"Low",MED_RISK:"Medium",HIGH_RISK:"High"},VerifyType:{VERIFY_ANALYSIS:"Analysis",VERIFY_DEMONSTRATION:"Demonstration",VERIFY_INSPECTION:"Inspection",VERIFY_TEST:"Test"},Relationships:{CONTAINS:"contains",COPIES:"copies",DERIVES:"derives",SATISFIES:"satisfies",VERIFIES:"verifies",REFINES:"refines",TRACES:"traces"},getConfig:s((()=>Hn().req),"getConfig"),addRequirement:Uat,getRequirements:Gat,setNewReqId:qat,setNewReqText:jat,setNewReqRisk:Yat,setNewReqVerifyMethod:Wat,setAccTitle:Fn,getAccTitle:zn,setAccDescription:Un,getAccDescription:Gn,addElement:Hat,getElements:Vat,setNewElementType:Xat,setNewElementDocRef:Kat,addRelationship:Zat,getRelationships:Qat,clear:Jat},est=s((t=>`\n\n marker {\n fill: ${t.relationColor};\n stroke: ${t.relationColor};\n }\n\n marker.cross {\n stroke: ${t.lineColor};\n }\n\n svg {\n font-family: ${t.fontFamily};\n font-size: ${t.fontSize};\n }\n\n .reqBox {\n fill: ${t.requirementBackground};\n fill-opacity: 1.0;\n stroke: ${t.requirementBorderColor};\n stroke-width: ${t.requirementBorderSize};\n }\n \n .reqTitle, .reqLabel{\n fill: ${t.requirementTextColor};\n }\n .reqLabelBox {\n fill: ${t.relationLabelBackground};\n fill-opacity: 1.0;\n }\n\n .req-title-line {\n stroke: ${t.requirementBorderColor};\n stroke-width: ${t.requirementBorderSize};\n }\n .relationshipLine {\n stroke: ${t.relationColor};\n stroke-width: 1;\n }\n .relationshipLabel {\n fill: ${t.relationLabelColor};\n }\n\n`),"getStyles"),nst={CONTAINS:"contains",ARROW:"arrow"},rst={ReqMarkers:nst,insertLineEndings:s(((t,e)=>{let n=t.append("defs").append("marker").attr("id",nst.CONTAINS+"_line_ending").attr("refX",0).attr("refY",e.line_height/2).attr("markerWidth",e.line_height).attr("markerHeight",e.line_height).attr("orient","auto").append("g");n.append("circle").attr("cx",e.line_height/2).attr("cy",e.line_height/2).attr("r",e.line_height/2).attr("fill","none"),n.append("line").attr("x1",0).attr("x2",e.line_height).attr("y1",e.line_height/2).attr("y2",e.line_height/2).attr("stroke-width",1),n.append("line").attr("y1",0).attr("y2",e.line_height).attr("x1",e.line_height/2).attr("x2",e.line_height/2).attr("stroke-width",1),t.append("defs").append("marker").attr("id",nst.ARROW+"_line_ending").attr("refX",e.line_height).attr("refY",.5*e.line_height).attr("markerWidth",e.line_height).attr("markerHeight",e.line_height).attr("orient","auto").append("path").attr("d",`M0,0\n L${e.line_height},${e.line_height/2}\n M${e.line_height},${e.line_height/2}\n L0,${e.line_height}`).attr("stroke-width",1)}),"insertLineEndings")},ist={},ast=0,sst=s(((t,e)=>t.insert("rect","#"+e).attr("class","req reqBox").attr("x",0).attr("y",0).attr("width",ist.rect_min_width+"px").attr("height",ist.rect_min_height+"px")),"newRectNode"),ost=s(((t,e,n)=>{let r=ist.rect_min_width/2,i=t.append("text").attr("class","req reqLabel reqTitle").attr("id",e).attr("x",r).attr("y",ist.rect_padding).attr("dominant-baseline","hanging"),a=0;n.forEach((t=>{0==a?i.append("tspan").attr("text-anchor","middle").attr("x",ist.rect_min_width/2).attr("dy",0).text(t):i.append("tspan").attr("text-anchor","middle").attr("x",ist.rect_min_width/2).attr("dy",.75*ist.line_height).text(t),a++}));let s=1.5*ist.rect_padding+a*ist.line_height*.75;return t.append("line").attr("class","req-title-line").attr("x1","0").attr("x2",ist.rect_min_width).attr("y1",s).attr("y2",s),{titleNode:i,y:s}}),"newTitleNode"),lst=s(((t,e,n,r)=>{let i=t.append("text").attr("class","req reqLabel").attr("id",e).attr("x",ist.rect_padding).attr("y",r).attr("dominant-baseline","hanging"),a=0;let s=[];return n.forEach((t=>{let e=t.length;for(;e>30&&a<3;){let n=t.substring(0,30);e=(t=t.substring(30,t.length)).length,s[s.length]=n,a++}if(3==a){let t=s[s.length-1];s[s.length-1]=t.substring(0,t.length-4)+"..."}else s[s.length]=t;a=0})),s.forEach((t=>{i.append("tspan").attr("x",ist.rect_padding).attr("dy",ist.line_height).text(t)})),i}),"newBodyNode"),cst=s(((t,e,n,r)=>{const i=e.node().getTotalLength(),a=e.node().getPointAtLength(.5*i),s="rel"+ast;ast++;const o=t.append("text").attr("class","req relationshipLabel").attr("id",s).attr("x",a.x).attr("y",a.y).attr("text-anchor","middle").attr("dominant-baseline","middle").text(r).node().getBBox();t.insert("rect","#"+s).attr("class","req reqLabelBox").attr("x",a.x-o.width/2).attr("y",a.y-o.height/2).attr("width",o.width).attr("height",o.height).attr("fill","white").attr("fill-opacity","85%")}),"addEdgeLabel"),hst=s((function(t,e,n,r,i){const a=n.edge(fst(e.src),fst(e.dst)),s=Xh().x((function(t){return t.x})).y((function(t){return t.y})),o=t.insert("path","#"+r).attr("class","er relationshipLine").attr("d",s(a.points)).attr("fill","none");e.type==i.db.Relationships.CONTAINS?o.attr("marker-start","url("+_n.getUrl(ist.arrowMarkerAbsolute)+"#"+e.type+"_line_ending)"):(o.attr("stroke-dasharray","10,7"),o.attr("marker-end","url("+_n.getUrl(ist.arrowMarkerAbsolute)+"#"+rst.ReqMarkers.ARROW+"_line_ending)")),cst(t,o,ist,`<<${e.type}>>`)}),"drawRelationshipFromLayout"),ust=s(((t,e,n)=>{t.forEach(((t,r)=>{r=fst(r),m.info("Added new requirement: ",r);const i=n.append("g").attr("id",r),a=sst(i,"req-"+r);let s=[],o=ost(i,r+"_title",[`<<${t.type}>>`,`${t.name}`]);s.push(o.titleNode);let l=lst(i,r+"_body",[`Id: ${t.id}`,`Text: ${t.text}`,`Risk: ${t.risk}`,`Verification: ${t.verifyMethod}`],o.y);s.push(l);const c=a.node().getBBox();e.setNode(r,{width:c.width,height:c.height,shape:"rect",id:r})}))}),"drawReqs"),dst=s(((t,e,n)=>{t.forEach(((t,r)=>{const i=fst(r),a=n.append("g").attr("id",i),s="element-"+i,o=sst(a,s);let l=[],c=ost(a,s+"_title",["<<Element>>",`${r}`]);l.push(c.titleNode);let h=lst(a,s+"_body",[`Type: ${t.type||"Not Specified"}`,`Doc Ref: ${t.docRef||"None"}`],c.y);l.push(h);const u=o.node().getBBox();e.setNode(i,{width:u.width,height:u.height,shape:"rect",id:i})}))}),"drawElements"),pst=s(((t,e)=>(t.forEach((function(t){let n=fst(t.src),r=fst(t.dst);e.setEdge(n,r,{relationship:t})})),t)),"addRelationships"),gst=s((function(t,e){e.nodes().forEach((function(n){void 0!==n&&void 0!==e.node(n)&&(t.select("#"+n),t.select("#"+n).attr("transform","translate("+(e.node(n).x-e.node(n).width/2)+","+(e.node(n).y-e.node(n).height/2)+" )"))}))}),"adjustEntities"),fst=s((t=>t.replace(/\s/g,"").replace(/\./g,"_")),"elementString"),mst=s(((t,e,n,r)=>{const i=(ist=Hn().requirement).securityLevel;let a;"sandbox"===i&&(a=Oa("#i"+e));const s=Oa("sandbox"===i?a.nodes()[0].contentDocument.body:"body").select(`[id='${e}']`);rst.insertLineEndings(s,ist);const o=new nq({multigraph:!1,compound:!1,directed:!0}).setGraph({rankdir:ist.layoutDirection,marginx:20,marginy:20,nodesep:100,edgesep:100,ranksep:100}).setDefaultEdgeLabel((function(){return{}}));let l=r.db.getRequirements(),c=r.db.getElements(),h=r.db.getRelationships();ust(l,o,s),dst(c,o,s),pst(h,o),cY(o),gst(s,o),h.forEach((function(t){hst(s,t,o,e,r)}));const u=ist.rect_padding,d=s.node().getBBox(),p=d.width+2*u,g=d.height+2*u;Sn(s,g,p,ist.useMaxWidth),s.attr("viewBox",`${d.x-u} ${d.y-u} ${p} ${g}`)}),"draw"),yst={parser:Oat,db:tst,renderer:{draw:mst},styles:est},vst=Object.freeze({__proto__:null,diagram:yst}),xst=function(){var t=s((function(t,e,n,r){for(n=n||{},r=t.length;r--;n[t[r]]=e);return n}),"o"),e=[1,2],n=[1,3],r=[1,4],i=[2,4],a=[1,9],o=[1,11],l=[1,13],c=[1,14],h=[1,16],u=[1,17],d=[1,18],p=[1,24],g=[1,25],f=[1,26],m=[1,27],y=[1,28],v=[1,29],x=[1,30],b=[1,31],w=[1,32],k=[1,33],T=[1,34],_=[1,35],E=[1,36],C=[1,37],S=[1,38],A=[1,39],L=[1,41],N=[1,42],I=[1,43],M=[1,44],R=[1,45],D=[1,46],O=[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,54,59,60,61,62,70],P=[4,5,16,50,52,53],B=[4,5,13,14,16,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,50,52,53,54,59,60,61,62,70],$=[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,54,59,60,61,62,70],F=[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,54,59,60,61,62,70],z=[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,54,59,60,61,62,70],U=[68,69,70],G=[1,122],q={trace:s((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,note:54,placement:55,text2:56,over:57,actor_pair:58,links:59,link:60,properties:61,details:62,spaceList:63,",":64,left_of:65,right_of:66,signaltype:67,"+":68,"-":69,ACTOR:70,SOLID_OPEN_ARROW:71,DOTTED_OPEN_ARROW:72,SOLID_ARROW:73,BIDIRECTIONAL_SOLID_ARROW:74,DOTTED_ARROW:75,BIDIRECTIONAL_DOTTED_ARROW:76,SOLID_CROSS:77,DOTTED_CROSS:78,SOLID_POINT:79,DOTTED_POINT:80,TXT:81,$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",54:"note",57:"over",59:"links",60:"link",61:"properties",62:"details",64:",",65:"left_of",66:"right_of",68:"+",69:"-",70:"ACTOR",71:"SOLID_OPEN_ARROW",72:"DOTTED_OPEN_ARROW",73:"SOLID_ARROW",74:"BIDIRECTIONAL_SOLID_ARROW",75:"DOTTED_ARROW",76:"BIDIRECTIONAL_DOTTED_ARROW",77:"SOLID_CROSS",78:"DOTTED_CROSS",79:"SOLID_POINT",80:"DOTTED_POINT",81:"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],[24,4],[24,4],[25,3],[26,3],[27,3],[28,3],[63,2],[63,1],[58,3],[58,1],[55,1],[55,1],[17,5],[17,5],[17,4],[22,1],[67,1],[67,1],[67,1],[67,1],[67,1],[67,1],[67,1],[67,1],[67,1],[67,1],[56,1]],performAction:s((function(t,e,n,r,i,a,s){var o=a.length-1;switch(i){case 3:return r.apply(a[o]),a[o];case 4:case 9:case 8:case 13:this.$=[];break;case 5:case 10:a[o-1].push(a[o]),this.$=a[o-1];break;case 6:case 7:case 11:case 12:case 62:this.$=a[o];break;case 15:a[o].type="createParticipant",this.$=a[o];break;case 16:a[o-1].unshift({type:"boxStart",boxData:r.parseBoxData(a[o-2])}),a[o-1].push({type:"boxEnd",boxText:a[o-2]}),this.$=a[o-1];break;case 18:this.$={type:"sequenceIndex",sequenceIndex:Number(a[o-2]),sequenceIndexStep:Number(a[o-1]),sequenceVisible:!0,signalType:r.LINETYPE.AUTONUMBER};break;case 19:this.$={type:"sequenceIndex",sequenceIndex:Number(a[o-1]),sequenceIndexStep:1,sequenceVisible:!0,signalType:r.LINETYPE.AUTONUMBER};break;case 20:this.$={type:"sequenceIndex",sequenceVisible:!1,signalType:r.LINETYPE.AUTONUMBER};break;case 21:this.$={type:"sequenceIndex",sequenceVisible:!0,signalType:r.LINETYPE.AUTONUMBER};break;case 22:this.$={type:"activeStart",signalType:r.LINETYPE.ACTIVE_START,actor:a[o-1].actor};break;case 23:this.$={type:"activeEnd",signalType:r.LINETYPE.ACTIVE_END,actor:a[o-1].actor};break;case 29:r.setDiagramTitle(a[o].substring(6)),this.$=a[o].substring(6);break;case 30:r.setDiagramTitle(a[o].substring(7)),this.$=a[o].substring(7);break;case 31:this.$=a[o].trim(),r.setAccTitle(this.$);break;case 32:case 33:this.$=a[o].trim(),r.setAccDescription(this.$);break;case 34:a[o-1].unshift({type:"loopStart",loopText:r.parseMessage(a[o-2]),signalType:r.LINETYPE.LOOP_START}),a[o-1].push({type:"loopEnd",loopText:a[o-2],signalType:r.LINETYPE.LOOP_END}),this.$=a[o-1];break;case 35:a[o-1].unshift({type:"rectStart",color:r.parseMessage(a[o-2]),signalType:r.LINETYPE.RECT_START}),a[o-1].push({type:"rectEnd",color:r.parseMessage(a[o-2]),signalType:r.LINETYPE.RECT_END}),this.$=a[o-1];break;case 36:a[o-1].unshift({type:"optStart",optText:r.parseMessage(a[o-2]),signalType:r.LINETYPE.OPT_START}),a[o-1].push({type:"optEnd",optText:r.parseMessage(a[o-2]),signalType:r.LINETYPE.OPT_END}),this.$=a[o-1];break;case 37:a[o-1].unshift({type:"altStart",altText:r.parseMessage(a[o-2]),signalType:r.LINETYPE.ALT_START}),a[o-1].push({type:"altEnd",signalType:r.LINETYPE.ALT_END}),this.$=a[o-1];break;case 38:a[o-1].unshift({type:"parStart",parText:r.parseMessage(a[o-2]),signalType:r.LINETYPE.PAR_START}),a[o-1].push({type:"parEnd",signalType:r.LINETYPE.PAR_END}),this.$=a[o-1];break;case 39:a[o-1].unshift({type:"parStart",parText:r.parseMessage(a[o-2]),signalType:r.LINETYPE.PAR_OVER_START}),a[o-1].push({type:"parEnd",signalType:r.LINETYPE.PAR_END}),this.$=a[o-1];break;case 40:a[o-1].unshift({type:"criticalStart",criticalText:r.parseMessage(a[o-2]),signalType:r.LINETYPE.CRITICAL_START}),a[o-1].push({type:"criticalEnd",signalType:r.LINETYPE.CRITICAL_END}),this.$=a[o-1];break;case 41:a[o-1].unshift({type:"breakStart",breakText:r.parseMessage(a[o-2]),signalType:r.LINETYPE.BREAK_START}),a[o-1].push({type:"breakEnd",optText:r.parseMessage(a[o-2]),signalType:r.LINETYPE.BREAK_END}),this.$=a[o-1];break;case 43:this.$=a[o-3].concat([{type:"option",optionText:r.parseMessage(a[o-1]),signalType:r.LINETYPE.CRITICAL_OPTION},a[o]]);break;case 45:this.$=a[o-3].concat([{type:"and",parText:r.parseMessage(a[o-1]),signalType:r.LINETYPE.PAR_AND},a[o]]);break;case 47:this.$=a[o-3].concat([{type:"else",altText:r.parseMessage(a[o-1]),signalType:r.LINETYPE.ALT_ELSE},a[o]]);break;case 48:a[o-3].draw="participant",a[o-3].type="addParticipant",a[o-3].description=r.parseMessage(a[o-1]),this.$=a[o-3];break;case 49:a[o-1].draw="participant",a[o-1].type="addParticipant",this.$=a[o-1];break;case 50:a[o-3].draw="actor",a[o-3].type="addParticipant",a[o-3].description=r.parseMessage(a[o-1]),this.$=a[o-3];break;case 51:a[o-1].draw="actor",a[o-1].type="addParticipant",this.$=a[o-1];break;case 52:a[o-1].type="destroyParticipant",this.$=a[o-1];break;case 53:this.$=[a[o-1],{type:"addNote",placement:a[o-2],actor:a[o-1].actor,text:a[o]}];break;case 54:a[o-2]=[].concat(a[o-1],a[o-1]).slice(0,2),a[o-2][0]=a[o-2][0].actor,a[o-2][1]=a[o-2][1].actor,this.$=[a[o-1],{type:"addNote",placement:r.PLACEMENT.OVER,actor:a[o-2].slice(0,2),text:a[o]}];break;case 55:this.$=[a[o-1],{type:"addLinks",actor:a[o-1].actor,text:a[o]}];break;case 56:this.$=[a[o-1],{type:"addALink",actor:a[o-1].actor,text:a[o]}];break;case 57:this.$=[a[o-1],{type:"addProperties",actor:a[o-1].actor,text:a[o]}];break;case 58:this.$=[a[o-1],{type:"addDetails",actor:a[o-1].actor,text:a[o]}];break;case 61:this.$=[a[o-2],a[o]];break;case 63:this.$=r.PLACEMENT.LEFTOF;break;case 64:this.$=r.PLACEMENT.RIGHTOF;break;case 65:this.$=[a[o-4],a[o-1],{type:"addMessage",from:a[o-4].actor,to:a[o-1].actor,signalType:a[o-3],msg:a[o],activate:!0},{type:"activeStart",signalType:r.LINETYPE.ACTIVE_START,actor:a[o-1].actor}];break;case 66:this.$=[a[o-4],a[o-1],{type:"addMessage",from:a[o-4].actor,to:a[o-1].actor,signalType:a[o-3],msg:a[o]},{type:"activeEnd",signalType:r.LINETYPE.ACTIVE_END,actor:a[o-4].actor}];break;case 67:this.$=[a[o-3],a[o-1],{type:"addMessage",from:a[o-3].actor,to:a[o-1].actor,signalType:a[o-2],msg:a[o]}];break;case 68:this.$={type:"addParticipant",actor:a[o]};break;case 69:this.$=r.LINETYPE.SOLID_OPEN;break;case 70:this.$=r.LINETYPE.DOTTED_OPEN;break;case 71:this.$=r.LINETYPE.SOLID;break;case 72:this.$=r.LINETYPE.BIDIRECTIONAL_SOLID;break;case 73:this.$=r.LINETYPE.DOTTED;break;case 74:this.$=r.LINETYPE.BIDIRECTIONAL_DOTTED;break;case 75:this.$=r.LINETYPE.SOLID_CROSS;break;case 76:this.$=r.LINETYPE.DOTTED_CROSS;break;case 77:this.$=r.LINETYPE.SOLID_POINT;break;case 78:this.$=r.LINETYPE.DOTTED_POINT;break;case 79:this.$=r.parseMessage(a[o].trim().substring(1))}}),"anonymous"),table:[{3:1,4:e,5:n,6:r},{1:[3]},{3:5,4:e,5:n,6:r},{3:6,4:e,5:n,6:r},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,54,59,60,61,62,70],i,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:a,5:o,8:8,9:10,12:12,13:l,14:c,17:15,18:h,21:u,22:40,23:d,24:19,25:20,26:21,27:22,28:23,29:p,30:g,31:f,33:m,35:y,36:v,37:x,38:b,39:w,41:k,43:T,44:_,46:E,50:C,52:S,53:A,54:L,59:N,60:I,61:M,62:R,70:D},t(O,[2,5]),{9:47,12:12,13:l,14:c,17:15,18:h,21:u,22:40,23:d,24:19,25:20,26:21,27:22,28:23,29:p,30:g,31:f,33:m,35:y,36:v,37:x,38:b,39:w,41:k,43:T,44:_,46:E,50:C,52:S,53:A,54:L,59:N,60:I,61:M,62:R,70:D},t(O,[2,7]),t(O,[2,8]),t(O,[2,14]),{12:48,50:C,52:S,53:A},{15:[1,49]},{5:[1,50]},{5:[1,53],19:[1,51],20:[1,52]},{22:54,70:D},{22:55,70:D},{5:[1,56]},{5:[1,57]},{5:[1,58]},{5:[1,59]},{5:[1,60]},t(O,[2,29]),t(O,[2,30]),{32:[1,61]},{34:[1,62]},t(O,[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,70:D},{22:72,70:D},{22:73,70:D},{67:74,71:[1,75],72:[1,76],73:[1,77],74:[1,78],75:[1,79],76:[1,80],77:[1,81],78:[1,82],79:[1,83],80:[1,84]},{55:85,57:[1,86],65:[1,87],66:[1,88]},{22:89,70:D},{22:90,70:D},{22:91,70:D},{22:92,70:D},t([5,51,64,71,72,73,74,75,76,77,78,79,80,81],[2,68]),t(O,[2,6]),t(O,[2,15]),t(P,[2,9],{10:93}),t(O,[2,17]),{5:[1,95],19:[1,94]},{5:[1,96]},t(O,[2,21]),{5:[1,97]},{5:[1,98]},t(O,[2,24]),t(O,[2,25]),t(O,[2,26]),t(O,[2,27]),t(O,[2,28]),t(O,[2,31]),t(O,[2,32]),t(B,i,{7:99}),t(B,i,{7:100}),t(B,i,{7:101}),t($,i,{40:102,7:103}),t(F,i,{42:104,7:105}),t(F,i,{7:105,42:106}),t(z,i,{45:107,7:108}),t(B,i,{7:109}),{5:[1,111],51:[1,110]},{5:[1,113],51:[1,112]},{5:[1,114]},{22:117,68:[1,115],69:[1,116],70:D},t(U,[2,69]),t(U,[2,70]),t(U,[2,71]),t(U,[2,72]),t(U,[2,73]),t(U,[2,74]),t(U,[2,75]),t(U,[2,76]),t(U,[2,77]),t(U,[2,78]),{22:118,70:D},{22:120,58:119,70:D},{70:[2,63]},{70:[2,64]},{56:121,81:G},{56:123,81:G},{56:124,81:G},{56:125,81:G},{4:[1,128],5:[1,130],11:127,12:129,16:[1,126],50:C,52:S,53:A},{5:[1,131]},t(O,[2,19]),t(O,[2,20]),t(O,[2,22]),t(O,[2,23]),{4:a,5:o,8:8,9:10,12:12,13:l,14:c,16:[1,132],17:15,18:h,21:u,22:40,23:d,24:19,25:20,26:21,27:22,28:23,29:p,30:g,31:f,33:m,35:y,36:v,37:x,38:b,39:w,41:k,43:T,44:_,46:E,50:C,52:S,53:A,54:L,59:N,60:I,61:M,62:R,70:D},{4:a,5:o,8:8,9:10,12:12,13:l,14:c,16:[1,133],17:15,18:h,21:u,22:40,23:d,24:19,25:20,26:21,27:22,28:23,29:p,30:g,31:f,33:m,35:y,36:v,37:x,38:b,39:w,41:k,43:T,44:_,46:E,50:C,52:S,53:A,54:L,59:N,60:I,61:M,62:R,70:D},{4:a,5:o,8:8,9:10,12:12,13:l,14:c,16:[1,134],17:15,18:h,21:u,22:40,23:d,24:19,25:20,26:21,27:22,28:23,29:p,30:g,31:f,33:m,35:y,36:v,37:x,38:b,39:w,41:k,43:T,44:_,46:E,50:C,52:S,53:A,54:L,59:N,60:I,61:M,62:R,70:D},{16:[1,135]},{4:a,5:o,8:8,9:10,12:12,13:l,14:c,16:[2,46],17:15,18:h,21:u,22:40,23:d,24:19,25:20,26:21,27:22,28:23,29:p,30:g,31:f,33:m,35:y,36:v,37:x,38:b,39:w,41:k,43:T,44:_,46:E,49:[1,136],50:C,52:S,53:A,54:L,59:N,60:I,61:M,62:R,70:D},{16:[1,137]},{4:a,5:o,8:8,9:10,12:12,13:l,14:c,16:[2,44],17:15,18:h,21:u,22:40,23:d,24:19,25:20,26:21,27:22,28:23,29:p,30:g,31:f,33:m,35:y,36:v,37:x,38:b,39:w,41:k,43:T,44:_,46:E,48:[1,138],50:C,52:S,53:A,54:L,59:N,60:I,61:M,62:R,70:D},{16:[1,139]},{16:[1,140]},{4:a,5:o,8:8,9:10,12:12,13:l,14:c,16:[2,42],17:15,18:h,21:u,22:40,23:d,24:19,25:20,26:21,27:22,28:23,29:p,30:g,31:f,33:m,35:y,36:v,37:x,38:b,39:w,41:k,43:T,44:_,46:E,47:[1,141],50:C,52:S,53:A,54:L,59:N,60:I,61:M,62:R,70:D},{4:a,5:o,8:8,9:10,12:12,13:l,14:c,16:[1,142],17:15,18:h,21:u,22:40,23:d,24:19,25:20,26:21,27:22,28:23,29:p,30:g,31:f,33:m,35:y,36:v,37:x,38:b,39:w,41:k,43:T,44:_,46:E,50:C,52:S,53:A,54:L,59:N,60:I,61:M,62:R,70:D},{15:[1,143]},t(O,[2,49]),{15:[1,144]},t(O,[2,51]),t(O,[2,52]),{22:145,70:D},{22:146,70:D},{56:147,81:G},{56:148,81:G},{56:149,81:G},{64:[1,150],81:[2,62]},{5:[2,55]},{5:[2,79]},{5:[2,56]},{5:[2,57]},{5:[2,58]},t(O,[2,16]),t(P,[2,10]),{12:151,50:C,52:S,53:A},t(P,[2,12]),t(P,[2,13]),t(O,[2,18]),t(O,[2,34]),t(O,[2,35]),t(O,[2,36]),t(O,[2,37]),{15:[1,152]},t(O,[2,38]),{15:[1,153]},t(O,[2,39]),t(O,[2,40]),{15:[1,154]},t(O,[2,41]),{5:[1,155]},{5:[1,156]},{56:157,81:G},{56:158,81:G},{5:[2,67]},{5:[2,53]},{5:[2,54]},{22:159,70:D},t(P,[2,11]),t($,i,{7:103,40:160}),t(F,i,{7:105,42:161}),t(z,i,{7:108,45:162}),t(O,[2,48]),t(O,[2,50]),{5:[2,65]},{5:[2,66]},{81:[2,61]},{16:[2,47]},{16:[2,45]},{16:[2,43]}],defaultActions:{5:[2,1],6:[2,2],87:[2,63],88:[2,64],121:[2,55],122:[2,79],123:[2,56],124:[2,57],125:[2,58],147:[2,67],148:[2,53],149:[2,54],157:[2,65],158:[2,66],159:[2,61],160:[2,47],161:[2,45],162:[2,43]},parseError:s((function(t,e){if(!e.recoverable){var n=new Error(t);throw n.hash=e,n}this.trace(t)}),"parseError"),parse:s((function(t){var e=this,n=[0],r=[],i=[null],a=[],o=this.table,l="",c=0,h=0,u=2,d=1,p=a.slice.call(arguments,1),g=Object.create(this.lexer),f={yy:{}};for(var m in this.yy)Object.prototype.hasOwnProperty.call(this.yy,m)&&(f.yy[m]=this.yy[m]);g.setInput(t,f.yy),f.yy.lexer=g,f.yy.parser=this,void 0===g.yylloc&&(g.yylloc={});var y=g.yylloc;a.push(y);var v=g.options&&g.options.ranges;function x(t){n.length=n.length-2*t,i.length=i.length-t,a.length=a.length-t}function b(){var t;return"number"!=typeof(t=r.pop()||g.lex()||d)&&(t instanceof Array&&(t=(r=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof f.yy.parseError?this.parseError=f.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,s(x,"popStack"),s(b,"lex");for(var w,k,T,_,E,C,S,A,L={};;){if(k=n[n.length-1],this.defaultActions[k]?T=this.defaultActions[k]:(null==w&&(w=b()),T=o[k]&&o[k][w]),void 0===T||!T.length||!T[0]){var N="";for(E in A=[],o[k])this.terminals_[E]&&E>u&&A.push("'"+this.terminals_[E]+"'");N=g.showPosition?"Parse error on line "+(c+1)+":\n"+g.showPosition()+"\nExpecting "+A.join(", ")+", got '"+(this.terminals_[w]||w)+"'":"Parse error on line "+(c+1)+": Unexpected "+(w==d?"end of input":"'"+(this.terminals_[w]||w)+"'"),this.parseError(N,{text:g.match,token:this.terminals_[w]||w,line:g.yylineno,loc:y,expected:A})}if(T[0]instanceof Array&&T.length>1)throw new Error("Parse Error: multiple actions possible at state: "+k+", token: "+w);switch(T[0]){case 1:n.push(w),i.push(g.yytext),a.push(g.yylloc),n.push(T[1]),w=null,h=g.yyleng,l=g.yytext,c=g.yylineno,y=g.yylloc;break;case 2:if(C=this.productions_[T[1]][1],L.$=i[i.length-C],L._$={first_line:a[a.length-(C||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(C||1)].first_column,last_column:a[a.length-1].last_column},v&&(L._$.range=[a[a.length-(C||1)].range[0],a[a.length-1].range[1]]),void 0!==(_=this.performAction.apply(L,[l,h,c,f.yy,T[1],i,a].concat(p))))return _;C&&(n=n.slice(0,-1*C*2),i=i.slice(0,-1*C),a=a.slice(0,-1*C)),n.push(this.productions_[T[1]][0]),i.push(L.$),a.push(L._$),S=o[n[n.length-2]][n[n.length-1]],n.push(S);break;case 3:return!0}}return!0}),"parse")},j=function(){var t={EOF:1,parseError:s((function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)}),"parseError"),setInput:s((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:s((function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(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:s((function(t){var e=t.length,n=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 r=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 i=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===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this}),"unput"),more:s((function(){return this._more=!0,this}),"more"),reject:s((function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):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).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}),"reject"),less:s((function(t){this.unput(this.match.slice(t))}),"less"),pastInput:s((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:s((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:s((function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"}),"showPosition"),test_match:s((function(t,e){var n,r,i;if(this.options.backtrack_lexer&&(i={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&&(i.yylloc.range=this.yylloc.range.slice(0))),(r=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.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],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1}),"test_match"),next:s((function(){if(this.done)return this.EOF;var t,e,n,r;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;a<i.length;a++)if((n=this._input.match(this.rules[i[a]]))&&(!e||n[0].length>e[0].length)){if(e=n,r=a,this.options.backtrack_lexer){if(!1!==(t=this.test_match(n,i[a])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,i[r]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}),"next"),lex:s((function(){var t=this.next();return t||this.lex()}),"lex"),begin:s((function(t){this.conditionStack.push(t)}),"begin"),popState:s((function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]}),"popState"),_currentRules:s((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:s((function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"}),"topState"),pushState:s((function(t){this.begin(t)}),"pushState"),stateStackSize:s((function(){return this.conditionStack.length}),"stateStackSize"),options:{"case-insensitive":!0},performAction:s((function(t,e,n,r){switch(n){case 0:case 51:case 66:return 5;case 1:case 2:case 3:case 4:case 5:break;case 6:return 19;case 7:return this.begin("LINE"),14;case 8:return this.begin("ID"),50;case 9:return this.begin("ID"),52;case 10:return 13;case 11:return this.begin("ID"),53;case 12:return e.yytext=e.yytext.trim(),this.begin("ALIAS"),70;case 13:return this.popState(),this.popState(),this.begin("LINE"),51;case 14:return this.popState(),this.popState(),5;case 15:return this.begin("LINE"),36;case 16:return this.begin("LINE"),37;case 17:return this.begin("LINE"),38;case 18:return this.begin("LINE"),39;case 19:return this.begin("LINE"),49;case 20:return this.begin("LINE"),41;case 21:return this.begin("LINE"),43;case 22:return this.begin("LINE"),48;case 23:return this.begin("LINE"),44;case 24:return this.begin("LINE"),47;case 25:return this.begin("LINE"),46;case 26:return this.popState(),15;case 27:return 16;case 28:return 65;case 29:return 66;case 30:return 59;case 31:return 60;case 32:return 61;case 33:return 62;case 34:return 57;case 35:return 54;case 36:return this.begin("ID"),21;case 37:return this.begin("ID"),23;case 38:return 29;case 39:return 30;case 40:return this.begin("acc_title"),31;case 41:return this.popState(),"acc_title_value";case 42:return this.begin("acc_descr"),33;case 43:return this.popState(),"acc_descr_value";case 44:this.begin("acc_descr_multiline");break;case 45:this.popState();break;case 46:return"acc_descr_multiline_value";case 47:return 6;case 48:return 18;case 49:return 20;case 50:return 64;case 52:return e.yytext=e.yytext.trim(),70;case 53:return 73;case 54:return 74;case 55:return 75;case 56:return 76;case 57:return 71;case 58:return 72;case 59:return 77;case 60:return 78;case 61:return 79;case 62:return 80;case 63:return 81;case 64:return 68;case 65:return 69;case 67:return"INVALID"}}),"anonymous"),rules:[/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[0-9]+(?=[ \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],conditions:{acc_descr_multiline:{rules:[45,46],inclusive:!1},acc_descr:{rules:[43],inclusive:!1},acc_title:{rules:[41],inclusive:!1},ID:{rules:[2,3,12],inclusive:!1},ALIAS:{rules:[2,3,13,14],inclusive:!1},LINE:{rules:[2,3,26],inclusive:!1},INITIAL:{rules:[0,1,3,4,5,6,7,8,9,10,11,15,16,17,18,19,20,21,22,23,24,25,27,28,29,30,31,32,33,34,35,36,37,38,39,40,42,44,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67],inclusive:!0}}};return t}();function Y(){this.yy={}}return q.lexer=j,s(Y,"Parser"),Y.prototype=q,q.Parser=Y,new Y}();xst.parser=xst;var bst=xst,wst=new qX((()=>({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}))),kst=s((function(t){wst.records.boxes.push({name:t.text,wrap:t.wrap??Ust(),fill:t.color,actorKeys:[]}),wst.records.currentBox=wst.records.boxes.slice(-1)[0]}),"addBox"),Tst=s((function(t,e,n,r){let i=wst.records.currentBox;const a=wst.records.actors.get(t);if(a){if(wst.records.currentBox&&a.box&&wst.records.currentBox!==a.box)throw new Error(`A same participant should only be defined in one Box: ${a.name} can't be in '${a.box.name}' and in '${wst.records.currentBox.name}' at the same time.`);if(i=a.box?a.box:wst.records.currentBox,a.box=i,a&&e===a.name&&null==n)return}if(null==n?.text&&(n={text:e,type:r}),null!=r&&null!=n.text||(n={text:e,type:r}),wst.records.actors.set(t,{box:i,name:e,description:n.text,wrap:n.wrap??Ust(),prevActor:wst.records.prevActor,links:{},properties:{},actorCnt:null,rectData:null,type:r??"participant"}),wst.records.prevActor){const e=wst.records.actors.get(wst.records.prevActor);e&&(e.nextActor=t)}wst.records.currentBox&&wst.records.currentBox.actorKeys.push(t),wst.records.prevActor=t}),"addActor"),_st=s((t=>{let e,n=0;if(!t)return 0;for(e=0;e<wst.records.messages.length;e++)wst.records.messages[e].type===Yst.ACTIVE_START&&wst.records.messages[e].from===t&&n++,wst.records.messages[e].type===Yst.ACTIVE_END&&wst.records.messages[e].from===t&&n--;return n}),"activationCount"),Est=s((function(t,e,n,r){wst.records.messages.push({from:t,to:e,message:n.text,wrap:n.wrap??Ust(),answer:r})}),"addMessage"),Cst=s((function(t,e,n,r,i=!1){if(r===Yst.ACTIVE_END){if(_st(t??"")<1){const e=new Error("Trying to inactivate an inactive participant ("+t+")");throw e.hash={text:"->>-",token:"->>-",line:"1",loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:["'ACTIVE_PARTICIPANT'"]},e}}return wst.records.messages.push({from:t,to:e,message:n?.text??"",wrap:n?.wrap??Ust(),type:r,activate:i}),!0}),"addSignal"),Sst=s((function(){return wst.records.boxes.length>0}),"hasAtLeastOneBox"),Ast=s((function(){return wst.records.boxes.some((t=>t.name))}),"hasAtLeastOneBoxWithTitle"),Lst=s((function(){return wst.records.messages}),"getMessages"),Nst=s((function(){return wst.records.boxes}),"getBoxes"),Ist=s((function(){return wst.records.actors}),"getActors"),Mst=s((function(){return wst.records.createdActors}),"getCreatedActors"),Rst=s((function(){return wst.records.destroyedActors}),"getDestroyedActors"),Dst=s((function(t){return wst.records.actors.get(t)}),"getActor"),Ost=s((function(){return[...wst.records.actors.keys()]}),"getActorKeys"),Pst=s((function(){wst.records.sequenceNumbersEnabled=!0}),"enableSequenceNumbers"),Bst=s((function(){wst.records.sequenceNumbersEnabled=!1}),"disableSequenceNumbers"),$st=s((()=>wst.records.sequenceNumbersEnabled),"showSequenceNumbers"),Fst=s((function(t){wst.records.wrapEnabled=t}),"setWrap"),zst=s((t=>{if(void 0===t)return{};t=t.trim();const e=null!==/^:?wrap:/.exec(t)||null===/^:?nowrap:/.exec(t)&&void 0;return{cleanedText:(void 0===e?t:t.replace(/^:?(?:no)?wrap:/,"")).trim(),wrap:e}}),"extractWrap"),Ust=s((()=>void 0!==wst.records.wrapEnabled?wst.records.wrapEnabled:Hn().sequence?.wrap??!1),"autoWrap"),Gst=s((function(){wst.reset(),$n()}),"clear"),qst=s((function(t){const e=t.trim(),{wrap:n,cleanedText:r}=zst(e),i={text:r,wrap:n};return m.debug(`parseMessage: ${JSON.stringify(i)}`),i}),"parseMessage"),jst=s((function(t){const e=/^((?:rgba?|hsla?)\s*\(.*\)|\w*)(.*)$/.exec(t);let n=e?.[1]?e[1].trim():"transparent",r=e?.[2]?e[2].trim():void 0;if(window?.CSS)window.CSS.supports("color",n)||(n="transparent",r=t.trim());else{const e=(new Option).style;e.color=n,e.color!==n&&(n="transparent",r=t.trim())}const{wrap:i,cleanedText:a}=zst(r);return{text:a?an(a,Hn()):void 0,color:n,wrap:i}}),"parseBoxData"),Yst={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},Wst=s((function(t,e,n){const r={actor:t,placement:e,message:n.text,wrap:n.wrap??Ust()},i=[].concat(t,t);wst.records.notes.push(r),wst.records.messages.push({from:i[0],to:i[1],message:n.text,wrap:n.wrap??Ust(),type:Yst.NOTE,placement:e})}),"addNote"),Hst=s((function(t,e){const n=Dst(t);try{let t=an(e.text,Hn());t=t.replace(/&amp;/g,"&"),t=t.replace(/&equals;/g,"=");Xst(n,JSON.parse(t))}catch(t){m.error("error while parsing actor link text",t)}}),"addLinks"),Vst=s((function(t,e){const n=Dst(t);try{const t={};let r=an(e.text,Hn());const i=r.indexOf("@");r=r.replace(/&amp;/g,"&"),r=r.replace(/&equals;/g,"=");const a=r.slice(0,i-1).trim(),s=r.slice(i+1).trim();t[a]=s,Xst(n,t)}catch(t){m.error("error while parsing actor link text",t)}}),"addALink");function Xst(t,e){if(null==t.links)t.links=e;else for(const n in e)t.links[n]=e[n]}s(Xst,"insertLinks");var Kst=s((function(t,e){const n=Dst(t);try{const t=an(e.text,Hn());Zst(n,JSON.parse(t))}catch(t){m.error("error while parsing actor properties text",t)}}),"addProperties");function Zst(t,e){if(null==t.properties)t.properties=e;else for(const n in e)t.properties[n]=e[n]}function Qst(){wst.records.currentBox=void 0}s(Zst,"insertProperties"),s(Qst,"boxEnd");var Jst=s((function(t,e){const n=Dst(t),r=document.getElementById(e.text);try{const t=r.innerHTML,e=JSON.parse(t);e.properties&&Zst(n,e.properties),e.links&&Xst(n,e.links)}catch(t){m.error("error while parsing actor details text",t)}}),"addDetails"),tot=s((function(t,e){if(void 0!==t?.properties)return t.properties[e]}),"getActorProperty"),eot=s((function(t){if(Array.isArray(t))t.forEach((function(t){eot(t)}));else switch(t.type){case"sequenceIndex":wst.records.messages.push({from:void 0,to:void 0,message:{start:t.sequenceIndex,step:t.sequenceIndexStep,visible:t.sequenceVisible},wrap:!1,type:t.signalType});break;case"addParticipant":Tst(t.actor,t.actor,t.description,t.draw);break;case"createParticipant":if(wst.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");wst.records.lastCreated=t.actor,Tst(t.actor,t.actor,t.description,t.draw),wst.records.createdActors.set(t.actor,wst.records.messages.length);break;case"destroyParticipant":wst.records.lastDestroyed=t.actor,wst.records.destroyedActors.set(t.actor,wst.records.messages.length);break;case"activeStart":case"activeEnd":Cst(t.actor,void 0,void 0,t.signalType);break;case"addNote":Wst(t.actor,t.placement,t.text);break;case"addLinks":Hst(t.actor,t.text);break;case"addALink":Vst(t.actor,t.text);break;case"addProperties":Kst(t.actor,t.text);break;case"addDetails":Jst(t.actor,t.text);break;case"addMessage":if(wst.records.lastCreated){if(t.to!==wst.records.lastCreated)throw new Error("The created participant "+wst.records.lastCreated.name+" does not have an associated creating message after its declaration. Please check the sequence diagram.");wst.records.lastCreated=void 0}else if(wst.records.lastDestroyed){if(t.to!==wst.records.lastDestroyed&&t.from!==wst.records.lastDestroyed)throw new Error("The destroyed participant "+wst.records.lastDestroyed.name+" does not have an associated destroying message after its declaration. Please check the sequence diagram.");wst.records.lastDestroyed=void 0}Cst(t.from,t.to,t.msg,t.signalType,t.activate);break;case"boxStart":kst(t.boxData);break;case"boxEnd":Qst();break;case"loopStart":Cst(void 0,void 0,t.loopText,t.signalType);break;case"loopEnd":case"rectEnd":case"optEnd":case"altEnd":case"parEnd":case"criticalEnd":case"breakEnd":Cst(void 0,void 0,void 0,t.signalType);break;case"rectStart":Cst(void 0,void 0,t.color,t.signalType);break;case"optStart":Cst(void 0,void 0,t.optText,t.signalType);break;case"altStart":case"else":Cst(void 0,void 0,t.altText,t.signalType);break;case"setAccTitle":Fn(t.text);break;case"parStart":case"and":Cst(void 0,void 0,t.parText,t.signalType);break;case"criticalStart":Cst(void 0,void 0,t.criticalText,t.signalType);break;case"option":Cst(void 0,void 0,t.optionText,t.signalType);break;case"breakStart":Cst(void 0,void 0,t.breakText,t.signalType)}}),"apply"),not={addActor:Tst,addMessage:Est,addSignal:Cst,addLinks:Hst,addDetails:Jst,addProperties:Kst,autoWrap:Ust,setWrap:Fst,enableSequenceNumbers:Pst,disableSequenceNumbers:Bst,showSequenceNumbers:$st,getMessages:Lst,getActors:Ist,getCreatedActors:Mst,getDestroyedActors:Rst,getActor:Dst,getActorKeys:Ost,getActorProperty:tot,getAccTitle:zn,getBoxes:Nst,getDiagramTitle:jn,setDiagramTitle:qn,getConfig:s((()=>Hn().sequence),"getConfig"),clear:Gst,parseMessage:qst,parseBoxData:jst,LINETYPE:Yst,ARROWTYPE:{FILLED:0,OPEN:1},PLACEMENT:{LEFTOF:0,RIGHTOF:1,OVER:2},addNote:Wst,setAccTitle:Fn,apply:eot,setAccDescription:Un,getAccDescription:Gn,hasAtLeastOneBox:Sst,hasAtLeastOneBoxWithTitle:Ast},rot=s((t=>`.actor {\n stroke: ${t.actorBorder};\n fill: ${t.actorBkg};\n }\n\n text.actor > tspan {\n fill: ${t.actorTextColor};\n stroke: none;\n }\n\n .actor-line {\n stroke: ${t.actorLineColor};\n }\n\n .messageLine0 {\n stroke-width: 1.5;\n stroke-dasharray: none;\n stroke: ${t.signalColor};\n }\n\n .messageLine1 {\n stroke-width: 1.5;\n stroke-dasharray: 2, 2;\n stroke: ${t.signalColor};\n }\n\n #arrowhead path {\n fill: ${t.signalColor};\n stroke: ${t.signalColor};\n }\n\n .sequenceNumber {\n fill: ${t.sequenceNumberColor};\n }\n\n #sequencenumber {\n fill: ${t.signalColor};\n }\n\n #crosshead path {\n fill: ${t.signalColor};\n stroke: ${t.signalColor};\n }\n\n .messageText {\n fill: ${t.signalTextColor};\n stroke: none;\n }\n\n .labelBox {\n stroke: ${t.labelBoxBorderColor};\n fill: ${t.labelBoxBkgColor};\n }\n\n .labelText, .labelText > tspan {\n fill: ${t.labelTextColor};\n stroke: none;\n }\n\n .loopText, .loopText > tspan {\n fill: ${t.loopTextColor};\n stroke: none;\n }\n\n .loopLine {\n stroke-width: 2px;\n stroke-dasharray: 2, 2;\n stroke: ${t.labelBoxBorderColor};\n fill: ${t.labelBoxBorderColor};\n }\n\n .note {\n //stroke: #decc93;\n stroke: ${t.noteBorderColor};\n fill: ${t.noteBkgColor};\n }\n\n .noteText, .noteText > tspan {\n fill: ${t.noteTextColor};\n stroke: none;\n }\n\n .activation0 {\n fill: ${t.activationBkgColor};\n stroke: ${t.activationBorderColor};\n }\n\n .activation1 {\n fill: ${t.activationBkgColor};\n stroke: ${t.activationBorderColor};\n }\n\n .activation2 {\n fill: ${t.activationBkgColor};\n stroke: ${t.activationBorderColor};\n }\n\n .actorPopupMenu {\n position: absolute;\n }\n\n .actorPopupMenuPanel {\n position: absolute;\n fill: ${t.actorBkg};\n box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);\n filter: drop-shadow(3px 5px 2px rgb(0 0 0 / 0.4));\n}\n .actor-man line {\n stroke: ${t.actorBorder};\n fill: ${t.actorBkg};\n }\n .actor-man circle, line {\n stroke: ${t.actorBorder};\n fill: ${t.actorBkg};\n stroke-width: 2px;\n }\n`),"getStyles"),iot=d(Cy(),1),aot=s((function(t,e){return rW(t,e)}),"drawRect"),sot=s((function(t,e,n,r,i){if(void 0===e.links||null===e.links||0===Object.keys(e.links).length)return{height:0,width:0};const a=e.links,s=e.actorCnt,o=e.rectData;var l="none";i&&(l="block !important");const c=t.append("g");c.attr("id","actor"+s+"_popup"),c.attr("class","actorPopupMenu"),c.attr("display",l);var h="";void 0!==o.class&&(h=" "+o.class);let u=o.width>n?o.width:n;const d=c.append("rect");if(d.attr("class","actorPopupMenuPanel"+h),d.attr("x",o.x),d.attr("y",o.height),d.attr("fill",o.fill),d.attr("stroke",o.stroke),d.attr("width",u),d.attr("height",o.height),d.attr("rx",o.rx),d.attr("ry",o.ry),null!=a){var p=20;for(let t in a){var g=c.append("a"),f=(0,iot.sanitizeUrl)(a[t]);g.attr("xlink:href",f),g.attr("target","_blank"),Iot(r)(t,g,o.x+10,o.height+p,u,20,{class:"actor"},r),p+=30}}return d.attr("height",p),{height:o.height+p,width:u}}),"drawPopup"),oot=s((function(t){return"var pu = document.getElementById('"+t+"'); if (pu != null) { pu.style.display = pu.style.display == 'block' ? 'none' : 'block'; }"}),"popupMenuToggle"),lot=s((async function(t,e,n=null){let r=t.append("foreignObject");const i=await Tn(e.text,Ft()),a=r.append("xhtml:div").attr("style","width: fit-content;").attr("xmlns","http://www.w3.org/1999/xhtml").html(i).node().getBoundingClientRect();if(r.attr("height",Math.round(a.height)).attr("width",Math.round(a.width)),"noteText"===e.class){const n=t.node().firstChild;n.setAttribute("height",a.height+2*e.textMargin);const i=n.getBBox();r.attr("x",Math.round(i.x+i.width/2-a.width/2)).attr("y",Math.round(i.y+i.height/2-a.height/2))}else if(n){let{startx:t,stopx:i,starty:s}=n;if(t>i){const e=t;t=i,i=e}r.attr("x",Math.round(t+Math.abs(t-i)/2-a.width/2)),"loopText"===e.class?r.attr("y",Math.round(s)):r.attr("y",Math.round(s-a.height))}return[r]}),"drawKatex"),cot=s((function(t,e){let n=0,r=0;const i=e.text.split(_n.lineBreakRegex),[a,o]=fk(e.fontSize);let l=[],c=0,h=s((()=>e.y),"yfunc");if(void 0!==e.valign&&void 0!==e.textMargin&&e.textMargin>0)switch(e.valign){case"top":case"start":h=s((()=>Math.round(e.y+e.textMargin)),"yfunc");break;case"middle":case"center":h=s((()=>Math.round(e.y+(n+r+e.textMargin)/2)),"yfunc");break;case"bottom":case"end":h=s((()=>Math.round(e.y+(n+r+2*e.textMargin)-e.textMargin)),"yfunc")}if(void 0!==e.anchor&&void 0!==e.textMargin&&void 0!==e.width)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"}for(let[s,u]of i.entries()){void 0!==e.textMargin&&0===e.textMargin&&void 0!==a&&(c=s*a);const i=t.append("text");i.attr("x",e.x),i.attr("y",h()),void 0!==e.anchor&&i.attr("text-anchor",e.anchor).attr("dominant-baseline",e.dominantBaseline).attr("alignment-baseline",e.alignmentBaseline),void 0!==e.fontFamily&&i.style("font-family",e.fontFamily),void 0!==o&&i.style("font-size",o),void 0!==e.fontWeight&&i.style("font-weight",e.fontWeight),void 0!==e.fill&&i.attr("fill",e.fill),void 0!==e.class&&i.attr("class",e.class),void 0!==e.dy?i.attr("dy",e.dy):0!==c&&i.attr("dy",c);const d=u||"​";if(e.tspan){const t=i.append("tspan");t.attr("x",e.x),void 0!==e.fill&&t.attr("fill",e.fill),t.text(d)}else i.text(d);void 0!==e.valign&&void 0!==e.textMargin&&e.textMargin>0&&(r+=(i._groups||i)[0][0].getBBox().height,n=r),l.push(i)}return l}),"drawText"),hot=s((function(t,e){function n(t,e,n,r,i){return t+","+e+" "+(t+n)+","+e+" "+(t+n)+","+(e+r-i)+" "+(t+n-1.2*i)+","+(e+r)+" "+t+","+(e+r)}s(n,"genPoints");const r=t.append("polygon");return r.attr("points",n(e.x,e.y,e.width,e.height,7)),r.attr("class","labelBox"),e.y=e.y+e.height/2,cot(t,e),r}),"drawLabel"),uot=-1,dot=s(((t,e,n,r)=>{t.select&&n.forEach((n=>{const i=e.get(n),a=t.select("#actor"+i.actorCnt);!r.mirrorActors&&i.stopy?a.attr("y2",i.stopy+i.height/2):r.mirrorActors&&a.attr("y2",i.stopy)}))}),"fixLifeLineHeights"),pot=s((function(t,e,n,r){const i=r?e.stopy:e.starty,a=e.x+e.width/2,s=i+e.height,o=t.append("g").lower();var l=o;r||(uot++,Object.keys(e.links||{}).length&&!n.forceMenus&&l.attr("onclick",oot(`actor${uot}_popup`)).attr("cursor","pointer"),l.append("line").attr("id","actor"+uot).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=uot,null!=e.links&&l.attr("id","root-"+uot));const c=lW();var h="actor";e.properties?.class?h=e.properties.class:c.fill="#eaeaea",h+=r?" actor-bottom":" actor-top",c.x=e.x,c.y=i,c.width=e.width,c.height=e.height,c.class=h,c.rx=3,c.ry=3,c.name=e.name;const u=aot(l,c);if(e.rectData=c,e.properties?.icon){const t=e.properties.icon.trim();"@"===t.charAt(0)?oW(l,c.x+c.width-20,c.y+10,t.substr(1)):sW(l,c.x+c.width-20,c.y+10,t)}Not(n,wn(e.description))(e.description,l,c.x,c.y,c.width,c.height,{class:"actor actor-box"},n);let d=e.height;if(u.node){const t=u.node().getBBox();e.height=t.height,d=t.height}return d}),"drawActorTypeParticipant"),got=s((function(t,e,n,r){const i=r?e.stopy:e.starty,a=e.x+e.width/2,s=i+80,o=t.append("g").lower();r||(uot++,o.append("line").attr("id","actor"+uot).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=uot);const l=t.append("g");let c="actor-man";c+=r?" actor-bottom":" actor-top",l.attr("class",c),l.attr("name",e.name);const h=lW();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"+uot).attr("x1",a).attr("y1",i+25).attr("x2",a).attr("y2",i+45),l.append("line").attr("id","actor-man-arms"+uot).attr("x1",a-18).attr("y1",i+33).attr("x2",a+18).attr("y2",i+33),l.append("line").attr("x1",a-18).attr("y1",i+60).attr("x2",a).attr("y2",i+45),l.append("line").attr("x1",a).attr("y1",i+45).attr("x2",a+18-2).attr("y2",i+60);const u=l.append("circle");u.attr("cx",e.x+e.width/2),u.attr("cy",i+10),u.attr("r",15),u.attr("width",e.width),u.attr("height",e.height);const d=l.node().getBBox();return e.height=d.height,Not(n,wn(e.description))(e.description,l,h.x,h.y+35,h.width,h.height,{class:"actor actor-man"},n),e.height}),"drawActorTypeActor"),fot=s((async function(t,e,n,r){switch(e.type){case"actor":return await got(t,e,n,r);case"participant":return await pot(t,e,n,r)}}),"drawActor"),mot=s((function(t,e,n){const r=t.append("g");bot(r,e),e.name&&Not(n)(e.name,r,e.x,e.y+(e.textMaxHeight||0)/2,e.width,0,{class:"text"},n),r.lower()}),"drawBox"),yot=s((function(t){return t.append("g")}),"anchorElement"),vot=s((function(t,e,n,r,i){const a=lW(),s=e.anchored;a.x=e.startx,a.y=e.starty,a.class="activation"+i%3,a.width=e.stopx-e.startx,a.height=n-e.starty,aot(s,a)}),"drawActivation"),xot=s((async function(t,e,n,r){const{boxMargin:i,boxTextMargin:a,labelBoxHeight:o,labelBoxWidth:l,messageFontFamily:c,messageFontSize:h,messageFontWeight:u}=r,d=t.append("g"),p=s((function(t,e,n,r){return d.append("line").attr("x1",t).attr("y1",e).attr("x2",n).attr("y2",r).attr("class","loopLine")}),"drawLoopLine");p(e.startx,e.starty,e.stopx,e.starty),p(e.stopx,e.starty,e.stopx,e.stopy),p(e.startx,e.stopy,e.stopx,e.stopy),p(e.startx,e.starty,e.startx,e.stopy),void 0!==e.sections&&e.sections.forEach((function(t){p(e.startx,t.y,e.stopx,t.y).style("stroke-dasharray","3, 3")}));let g=cW();g.text=n,g.x=e.startx,g.y=e.starty,g.fontFamily=c,g.fontSize=h,g.fontWeight=u,g.anchor="middle",g.valign="middle",g.tspan=!1,g.width=l||50,g.height=o||20,g.textMargin=a,g.class="labelText",hot(d,g),g=Aot(),g.text=e.title,g.x=e.startx+l/2+(e.stopx-e.startx)/2,g.y=e.starty+i+a,g.anchor="middle",g.valign="middle",g.textMargin=a,g.class="loopText",g.fontFamily=c,g.fontSize=h,g.fontWeight=u,g.wrap=!0;let f=wn(g.text)?await lot(d,g,e):cot(d,g);if(void 0!==e.sectionTitles)for(const[t,n]of Object.entries(e.sectionTitles))if(n.message){g.text=n.message,g.x=e.startx+(e.stopx-e.startx)/2,g.y=e.sections[t].y+i+a,g.class="loopText",g.anchor="middle",g.valign="middle",g.tspan=!1,g.fontFamily=c,g.fontSize=h,g.fontWeight=u,g.wrap=e.wrap,wn(g.text)?(e.starty=e.sections[t].y,await lot(d,g,e)):cot(d,g);let r=Math.round(f.map((t=>(t._groups||t)[0][0].getBBox().height)).reduce(((t,e)=>t+e)));e.sections[t].height+=r-(i+a)}return e.height=Math.round(e.stopy-e.starty),d}),"drawLoop"),bot=s((function(t,e){iW(t,e)}),"drawBackgroundRect"),wot=s((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"),kot=s((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"),Tot=s((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"),_ot=s((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"),Eot=s((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"),Cot=s((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"),Sot=s((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"),Aot=s((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"),Lot=s((function(){return{x:0,y:0,fill:"#EDF2AE",stroke:"#666",width:100,anchor:"start",height:100,rx:0,ry:0}}),"getNoteRect"),Not=function(){function t(t,e,n,r,a,s,o){i(e.append("text").attr("x",n+a/2).attr("y",r+s/2+5).style("text-anchor","middle").text(t),o)}function e(t,e,n,r,a,s,o,l){const{actorFontSize:c,actorFontFamily:h,actorFontWeight:u}=l,[d,p]=fk(c),g=t.split(_n.lineBreakRegex);for(let t=0;t<g.length;t++){const l=t*d-d*(g.length-1)/2,c=e.append("text").attr("x",n+a/2).attr("y",r).style("text-anchor","middle").style("font-size",p).style("font-weight",u).style("font-family",h);c.append("tspan").attr("x",n+a/2).attr("dy",l).text(g[t]),c.attr("y",r+s/2).attr("dominant-baseline","central").attr("alignment-baseline","central"),i(c,o)}}function n(t,n,r,a,s,o,l,c){const h=n.append("switch"),u=h.append("foreignObject").attr("x",r).attr("y",a).attr("width",s).attr("height",o).append("xhtml:div").style("display","table").style("height","100%").style("width","100%");u.append("div").style("display","table-cell").style("text-align","center").style("vertical-align","middle").text(t),e(t,h,r,a,s,o,l,c),i(u,l)}async function r(t,n,r,a,s,o,l,c){const h=await kn(t,Ft()),u=n.append("switch"),d=u.append("foreignObject").attr("x",r+s/2-h.width/2).attr("y",a+o/2-h.height/2).attr("width",h.width).attr("height",h.height).append("xhtml:div").style("height","100%").style("width","100%");d.append("div").style("text-align","center").style("vertical-align","middle").html(await Tn(t,Ft())),e(t,u,r,a,s,o,l,c),i(d,l)}function i(t,e){for(const n in e)e.hasOwnProperty(n)&&t.attr(n,e[n])}return s(t,"byText"),s(e,"byTspan"),s(n,"byFo"),s(r,"byKatex"),s(i,"_setTextAttrs"),function(i,a=!1){return a?r:"fo"===i.textPlacement?n:"old"===i.textPlacement?t:e}}(),Iot=function(){function t(t,e,n,i,a,s,o){r(e.append("text").attr("x",n).attr("y",i).style("text-anchor","start").text(t),o)}function e(t,e,n,i,a,s,o,l){const{actorFontSize:c,actorFontFamily:h,actorFontWeight:u}=l,d=t.split(_n.lineBreakRegex);for(let t=0;t<d.length;t++){const a=t*c-c*(d.length-1)/2,l=e.append("text").attr("x",n).attr("y",i).style("text-anchor","start").style("font-size",c).style("font-weight",u).style("font-family",h);l.append("tspan").attr("x",n).attr("dy",a).text(d[t]),l.attr("y",i+s/2).attr("dominant-baseline","central").attr("alignment-baseline","central"),r(l,o)}}function n(t,n,i,a,s,o,l,c){const h=n.append("switch"),u=h.append("foreignObject").attr("x",i).attr("y",a).attr("width",s).attr("height",o).append("xhtml:div").style("display","table").style("height","100%").style("width","100%");u.append("div").style("display","table-cell").style("text-align","center").style("vertical-align","middle").text(t),e(t,h,i,a,0,o,l,c),r(u,l)}function r(t,e){for(const n in e)e.hasOwnProperty(n)&&t.attr(n,e[n])}return s(t,"byText"),s(e,"byTspan"),s(n,"byFo"),s(r,"_setTextAttrs"),function(r){return"fo"===r.textPlacement?n:"old"===r.textPlacement?t:e}}(),Mot={drawRect:aot,drawText:cot,drawLabel:hot,drawActor:fot,drawBox:mot,drawPopup:sot,anchorElement:yot,drawActivation:vot,drawLoop:xot,drawBackgroundRect:bot,insertArrowHead:_ot,insertArrowFilledHead:Eot,insertSequenceNumber:Cot,insertArrowCrossHead:Sot,insertDatabaseIcon:wot,insertComputerIcon:kot,insertClockIcon:Tot,getTextObj:Aot,getNoteRect:Lot,fixLifeLineHeights:dot,sanitizeUrl:iot.sanitizeUrl},Rot={},Dot={data:{startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},verticalPos:0,sequenceItems:[],activations:[],models:{getHeight:s((function(){return Math.max.apply(null,0===this.actors.length?[0]:this.actors.map((t=>t.height||0)))+(0===this.loops.length?0:this.loops.map((t=>t.height||0)).reduce(((t,e)=>t+e)))+(0===this.messages.length?0:this.messages.map((t=>t.height||0)).reduce(((t,e)=>t+e)))+(0===this.notes.length?0:this.notes.map((t=>t.height||0)).reduce(((t,e)=>t+e)))}),"getHeight"),clear:s((function(){this.actors=[],this.boxes=[],this.loops=[],this.messages=[],this.notes=[]}),"clear"),addBox:s((function(t){this.boxes.push(t)}),"addBox"),addActor:s((function(t){this.actors.push(t)}),"addActor"),addLoop:s((function(t){this.loops.push(t)}),"addLoop"),addMessage:s((function(t){this.messages.push(t)}),"addMessage"),addNote:s((function(t){this.notes.push(t)}),"addNote"),lastActor:s((function(){return this.actors[this.actors.length-1]}),"lastActor"),lastLoop:s((function(){return this.loops[this.loops.length-1]}),"lastLoop"),lastMessage:s((function(){return this.messages[this.messages.length-1]}),"lastMessage"),lastNote:s((function(){return this.notes[this.notes.length-1]}),"lastNote"),actors:[],boxes:[],loops:[],messages:[],notes:[]},init:s((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,jot(Hn())}),"init"),updateVal:s((function(t,e,n,r){void 0===t[e]?t[e]=n:t[e]=r(n,t[e])}),"updateVal"),updateBounds:s((function(t,e,n,r){const i=this;let a=0;function o(o){return s((function(s){a++;const l=i.sequenceItems.length-a+1;i.updateVal(s,"starty",e-l*Rot.boxMargin,Math.min),i.updateVal(s,"stopy",r+l*Rot.boxMargin,Math.max),i.updateVal(Dot.data,"startx",t-l*Rot.boxMargin,Math.min),i.updateVal(Dot.data,"stopx",n+l*Rot.boxMargin,Math.max),"activation"!==o&&(i.updateVal(s,"startx",t-l*Rot.boxMargin,Math.min),i.updateVal(s,"stopx",n+l*Rot.boxMargin,Math.max),i.updateVal(Dot.data,"starty",e-l*Rot.boxMargin,Math.min),i.updateVal(Dot.data,"stopy",r+l*Rot.boxMargin,Math.max))}),"updateItemBounds")}s(o,"updateFn"),this.sequenceItems.forEach(o()),this.activations.forEach(o("activation"))}),"updateBounds"),insert:s((function(t,e,n,r){const i=_n.getMin(t,n),a=_n.getMax(t,n),s=_n.getMin(e,r),o=_n.getMax(e,r);this.updateVal(Dot.data,"startx",i,Math.min),this.updateVal(Dot.data,"starty",s,Math.min),this.updateVal(Dot.data,"stopx",a,Math.max),this.updateVal(Dot.data,"stopy",o,Math.max),this.updateBounds(i,s,a,o)}),"insert"),newActivation:s((function(t,e,n){const r=n.get(t.from),i=Yot(t.from).length||0,a=r.x+r.width/2+(i-1)*Rot.activationWidth/2;this.activations.push({startx:a,starty:this.verticalPos+2,stopx:a+Rot.activationWidth,stopy:void 0,actor:t.from,anchored:Mot.anchorElement(e)})}),"newActivation"),endActivation:s((function(t){const e=this.activations.map((function(t){return t.actor})).lastIndexOf(t.from);return this.activations.splice(e,1)[0]}),"endActivation"),createLoop:s((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:s((function(t={message:void 0,wrap:!1,width:void 0},e){this.sequenceItems.push(this.createLoop(t,e))}),"newLoop"),endLoop:s((function(){return this.sequenceItems.pop()}),"endLoop"),isLoopOverlap:s((function(){return!!this.sequenceItems.length&&this.sequenceItems[this.sequenceItems.length-1].overlap}),"isLoopOverlap"),addSectionToLoop:s((function(t){const e=this.sequenceItems.pop();e.sections=e.sections||[],e.sectionTitles=e.sectionTitles||[],e.sections.push({y:Dot.getVerticalPos(),height:0}),e.sectionTitles.push(t),this.sequenceItems.push(e)}),"addSectionToLoop"),saveVerticalPos:s((function(){this.isLoopOverlap()&&(this.savedVerticalPos=this.verticalPos)}),"saveVerticalPos"),resetVerticalPos:s((function(){this.isLoopOverlap()&&(this.verticalPos=this.savedVerticalPos)}),"resetVerticalPos"),bumpVerticalPos:s((function(t){this.verticalPos=this.verticalPos+t,this.data.stopy=_n.getMax(this.data.stopy,this.verticalPos)}),"bumpVerticalPos"),getVerticalPos:s((function(){return this.verticalPos}),"getVerticalPos"),getBounds:s((function(){return{bounds:this.data,models:this.models}}),"getBounds")},Oot=s((async function(t,e){Dot.bumpVerticalPos(Rot.boxMargin),e.height=Rot.boxMargin,e.starty=Dot.getVerticalPos();const n=lW();n.x=e.startx,n.y=e.starty,n.width=e.width||Rot.width,n.class="note";const r=t.append("g"),i=Mot.drawRect(r,n),a=cW();a.x=e.startx,a.y=e.starty,a.width=n.width,a.dy="1em",a.text=e.message,a.class="noteText",a.fontFamily=Rot.noteFontFamily,a.fontSize=Rot.noteFontSize,a.fontWeight=Rot.noteFontWeight,a.anchor=Rot.noteAlign,a.textMargin=Rot.noteMargin,a.valign="center";const s=wn(a.text)?await lot(r,a):cot(r,a),o=Math.round(s.map((t=>(t._groups||t)[0][0].getBBox().height)).reduce(((t,e)=>t+e)));i.attr("height",o+2*Rot.noteMargin),e.height+=o+2*Rot.noteMargin,Dot.bumpVerticalPos(o+2*Rot.noteMargin),e.stopy=e.starty+o+2*Rot.noteMargin,e.stopx=e.startx+n.width,Dot.insert(e.startx,e.starty,e.stopx,e.stopy),Dot.models.addNote(e)}),"drawNote"),Pot=s((t=>({fontFamily:t.messageFontFamily,fontSize:t.messageFontSize,fontWeight:t.messageFontWeight})),"messageFont"),Bot=s((t=>({fontFamily:t.noteFontFamily,fontSize:t.noteFontSize,fontWeight:t.noteFontWeight})),"noteFont"),$ot=s((t=>({fontFamily:t.actorFontFamily,fontSize:t.actorFontSize,fontWeight:t.actorFontWeight})),"actorFont");async function Fot(t,e){Dot.bumpVerticalPos(10);const{startx:n,stopx:r,message:i}=e,a=_n.splitBreaks(i).length,s=wn(i),o=s?await kn(i,Hn()):yk.calculateTextDimensions(i,Pot(Rot));if(!s){const t=o.height/a;e.height+=t,Dot.bumpVerticalPos(t)}let l,c=o.height-10;const h=o.width;if(n===r){l=Dot.getVerticalPos()+c,Rot.rightAngles||(c+=Rot.boxMargin,l=Dot.getVerticalPos()+c),c+=30;const t=_n.getMax(h/2,Rot.width/2);Dot.insert(n-t,Dot.getVerticalPos()-10+c,r+t,Dot.getVerticalPos()+30+c)}else c+=Rot.boxMargin,l=Dot.getVerticalPos()+c,Dot.insert(n,l-10,r,l);return Dot.bumpVerticalPos(c),e.height+=c,e.stopy=e.starty+e.height,Dot.insert(e.fromBounds,e.starty,e.toBounds,e.stopy),l}s(Fot,"boundMessage");var zot=s((async function(t,e,n,r){const{startx:i,stopx:a,starty:s,message:o,type:l,sequenceIndex:c,sequenceVisible:h}=e,u=yk.calculateTextDimensions(o,Pot(Rot)),d=cW();d.x=i,d.y=s+10,d.width=a-i,d.class="messageText",d.dy="1em",d.text=o,d.fontFamily=Rot.messageFontFamily,d.fontSize=Rot.messageFontSize,d.fontWeight=Rot.messageFontWeight,d.anchor=Rot.messageAlign,d.valign="center",d.textMargin=Rot.wrapPadding,d.tspan=!1,wn(d.text)?await lot(t,d,{startx:i,stopx:a,starty:n}):cot(t,d);const p=u.width;let g;i===a?g=Rot.rightAngles?t.append("path").attr("d",`M ${i},${n} H ${i+_n.getMax(Rot.width/2,p/2)} V ${n+25} H ${i}`):t.append("path").attr("d","M "+i+","+n+" C "+(i+60)+","+(n-10)+" "+(i+60)+","+(n+30)+" "+i+","+(n+20)):(g=t.append("line"),g.attr("x1",i),g.attr("y1",n),g.attr("x2",a),g.attr("y2",n)),l===r.db.LINETYPE.DOTTED||l===r.db.LINETYPE.DOTTED_CROSS||l===r.db.LINETYPE.DOTTED_POINT||l===r.db.LINETYPE.DOTTED_OPEN||l===r.db.LINETYPE.BIDIRECTIONAL_DOTTED?(g.style("stroke-dasharray","3, 3"),g.attr("class","messageLine1")):g.attr("class","messageLine0");let f="";Rot.arrowMarkerAbsolute&&(f=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,f=f.replace(/\(/g,"\\("),f=f.replace(/\)/g,"\\)")),g.attr("stroke-width",2),g.attr("stroke","none"),g.style("fill","none"),l!==r.db.LINETYPE.SOLID&&l!==r.db.LINETYPE.DOTTED||g.attr("marker-end","url("+f+"#arrowhead)"),l!==r.db.LINETYPE.BIDIRECTIONAL_SOLID&&l!==r.db.LINETYPE.BIDIRECTIONAL_DOTTED||(g.attr("marker-start","url("+f+"#arrowhead)"),g.attr("marker-end","url("+f+"#arrowhead)")),l!==r.db.LINETYPE.SOLID_POINT&&l!==r.db.LINETYPE.DOTTED_POINT||g.attr("marker-end","url("+f+"#filled-head)"),l!==r.db.LINETYPE.SOLID_CROSS&&l!==r.db.LINETYPE.DOTTED_CROSS||g.attr("marker-end","url("+f+"#crosshead)"),(h||Rot.showSequenceNumbers)&&(g.attr("marker-start","url("+f+"#sequencenumber)"),t.append("text").attr("x",i).attr("y",n+4).attr("font-family","sans-serif").attr("font-size","12px").attr("text-anchor","middle").attr("class","sequenceNumber").text(c))}),"drawMessage"),Uot=s((function(t,e,n,r,i,a,s){let o,l=0,c=0,h=0;for(const t of r){const r=e.get(t),a=r.box;o&&o!=a&&(s||Dot.models.addBox(o),c+=Rot.boxMargin+o.margin),a&&a!=o&&(s||(a.x=l+c,a.y=i),c+=a.margin),r.width=r.width||Rot.width,r.height=_n.getMax(r.height||Rot.height,Rot.height),r.margin=r.margin||Rot.actorMargin,h=_n.getMax(h,r.height),n.get(r.name)&&(c+=r.width/2),r.x=l+c,r.starty=Dot.getVerticalPos(),Dot.insert(r.x,i,r.x+r.width,r.height),l+=r.width+c,r.box&&(r.box.width=l+a.margin-r.box.x),c=r.margin,o=r.box,Dot.models.addActor(r)}o&&!s&&Dot.models.addBox(o),Dot.bumpVerticalPos(h)}),"addActorRenderingData"),Got=s((async function(t,e,n,r){if(r){let r=0;Dot.bumpVerticalPos(2*Rot.boxMargin);for(const i of n){const n=e.get(i);n.stopy||(n.stopy=Dot.getVerticalPos());const a=await Mot.drawActor(t,n,Rot,!0);r=_n.getMax(r,a)}Dot.bumpVerticalPos(r+Rot.boxMargin)}else for(const r of n){const n=e.get(r);await Mot.drawActor(t,n,Rot,!1)}}),"drawActors"),qot=s((function(t,e,n,r){let i=0,a=0;for(const s of n){const n=e.get(s),o=Zot(n),l=Mot.drawPopup(t,n,o,Rot,Rot.forceMenus,r);l.height>i&&(i=l.height),l.width+n.x>a&&(a=l.width+n.x)}return{maxHeight:i,maxWidth:a}}),"drawActorsPopup"),jot=s((function(t){L(Rot,t),t.fontFamily&&(Rot.actorFontFamily=Rot.noteFontFamily=Rot.messageFontFamily=t.fontFamily),t.fontSize&&(Rot.actorFontSize=Rot.noteFontSize=Rot.messageFontSize=t.fontSize),t.fontWeight&&(Rot.actorFontWeight=Rot.noteFontWeight=Rot.messageFontWeight=t.fontWeight)}),"setConf"),Yot=s((function(t){return Dot.activations.filter((function(e){return e.actor===t}))}),"actorActivations"),Wot=s((function(t,e){const n=e.get(t),r=Yot(t);return[r.reduce((function(t,e){return _n.getMin(t,e.startx)}),n.x+n.width/2-1),r.reduce((function(t,e){return _n.getMax(t,e.stopx)}),n.x+n.width/2+1)]}),"activationBounds");function Hot(t,e,n,r,i){Dot.bumpVerticalPos(n);let a=r;if(e.id&&e.message&&t[e.id]){const n=t[e.id].width,i=Pot(Rot);e.message=yk.wrapLabel(`[${e.message}]`,n-2*Rot.wrapPadding,i),e.width=n,e.wrap=!0;const s=yk.calculateTextDimensions(e.message,i),o=_n.getMax(s.height,Rot.labelBoxHeight);a=r+o,m.debug(`${o} - ${e.message}`)}i(e),Dot.bumpVerticalPos(a)}function Vot(t,e,n,r,i,a,o){function l(n,r){n.x<i.get(t.from).x?(Dot.insert(e.stopx-r,e.starty,e.startx,e.stopy+n.height/2+Rot.noteMargin),e.stopx=e.stopx+r):(Dot.insert(e.startx,e.starty,e.stopx+r,e.stopy+n.height/2+Rot.noteMargin),e.stopx=e.stopx-r)}function c(n,r){n.x<i.get(t.to).x?(Dot.insert(e.startx-r,e.starty,e.stopx,e.stopy+n.height/2+Rot.noteMargin),e.startx=e.startx+r):(Dot.insert(e.stopx,e.starty,e.startx+r,e.stopy+n.height/2+Rot.noteMargin),e.startx=e.startx-r)}if(s(l,"receiverAdjustment"),s(c,"senderAdjustment"),a.get(t.to)==r){const e=i.get(t.to);l(e,"actor"==e.type?21:e.width/2+3),e.starty=n-e.height/2,Dot.bumpVerticalPos(e.height/2)}else if(o.get(t.from)==r){const e=i.get(t.from);if(Rot.mirrorActors){c(e,"actor"==e.type?18:e.width/2)}e.stopy=n-e.height/2,Dot.bumpVerticalPos(e.height/2)}else if(o.get(t.to)==r){const e=i.get(t.to);if(Rot.mirrorActors){l(e,"actor"==e.type?21:e.width/2+3)}e.stopy=n-e.height/2,Dot.bumpVerticalPos(e.height/2)}}s(Hot,"adjustLoopHeightForWrap"),s(Vot,"adjustCreatedDestroyedData");var Xot=s((async function(t,e,n,r){const{securityLevel:i,sequence:a}=Hn();let o;Rot=a,"sandbox"===i&&(o=Oa("#i"+e));const l=Oa("sandbox"===i?o.nodes()[0].contentDocument.body:"body"),c="sandbox"===i?o.nodes()[0].contentDocument:document;Dot.init(),m.debug(r.db);const h="sandbox"===i?l.select(`[id="${e}"]`):Oa(`[id="${e}"]`),u=r.db.getActors(),d=r.db.getCreatedActors(),p=r.db.getDestroyedActors(),g=r.db.getBoxes();let f=r.db.getActorKeys();const y=r.db.getMessages(),v=r.db.getDiagramTitle(),x=r.db.hasAtLeastOneBox(),b=r.db.hasAtLeastOneBoxWithTitle(),w=await Kot(u,y,r);if(Rot.height=await Qot(u,w,g),Mot.insertComputerIcon(h),Mot.insertDatabaseIcon(h),Mot.insertClockIcon(h),x&&(Dot.bumpVerticalPos(Rot.boxMargin),b&&Dot.bumpVerticalPos(g[0].textMaxHeight)),!0===Rot.hideUnusedParticipants){const t=new Set;y.forEach((e=>{t.add(e.from),t.add(e.to)})),f=f.filter((e=>t.has(e)))}Uot(h,u,d,f,0,y,!1);const k=await elt(y,u,w,r);function T(t,e){const n=Dot.endActivation(t);n.starty+18>e&&(n.starty=e-6,e+=12),Mot.drawActivation(h,n,e,Rot,Yot(t.from).length),Dot.insert(n.startx,e-10,n.stopx,e)}Mot.insertArrowHead(h),Mot.insertArrowCrossHead(h),Mot.insertArrowFilledHead(h),Mot.insertSequenceNumber(h),s(T,"activeEnd");let _=1,E=1;const C=[],S=[];let A=0;for(const t of y){let e,n,i;switch(t.type){case r.db.LINETYPE.NOTE:Dot.resetVerticalPos(),n=t.noteModel,await Oot(h,n);break;case r.db.LINETYPE.ACTIVE_START:Dot.newActivation(t,h,u);break;case r.db.LINETYPE.ACTIVE_END:T(t,Dot.getVerticalPos());break;case r.db.LINETYPE.LOOP_START:Hot(k,t,Rot.boxMargin,Rot.boxMargin+Rot.boxTextMargin,(t=>Dot.newLoop(t)));break;case r.db.LINETYPE.LOOP_END:e=Dot.endLoop(),await Mot.drawLoop(h,e,"loop",Rot),Dot.bumpVerticalPos(e.stopy-Dot.getVerticalPos()),Dot.models.addLoop(e);break;case r.db.LINETYPE.RECT_START:Hot(k,t,Rot.boxMargin,Rot.boxMargin,(t=>Dot.newLoop(void 0,t.message)));break;case r.db.LINETYPE.RECT_END:e=Dot.endLoop(),S.push(e),Dot.models.addLoop(e),Dot.bumpVerticalPos(e.stopy-Dot.getVerticalPos());break;case r.db.LINETYPE.OPT_START:Hot(k,t,Rot.boxMargin,Rot.boxMargin+Rot.boxTextMargin,(t=>Dot.newLoop(t)));break;case r.db.LINETYPE.OPT_END:e=Dot.endLoop(),await Mot.drawLoop(h,e,"opt",Rot),Dot.bumpVerticalPos(e.stopy-Dot.getVerticalPos()),Dot.models.addLoop(e);break;case r.db.LINETYPE.ALT_START:Hot(k,t,Rot.boxMargin,Rot.boxMargin+Rot.boxTextMargin,(t=>Dot.newLoop(t)));break;case r.db.LINETYPE.ALT_ELSE:Hot(k,t,Rot.boxMargin+Rot.boxTextMargin,Rot.boxMargin,(t=>Dot.addSectionToLoop(t)));break;case r.db.LINETYPE.ALT_END:e=Dot.endLoop(),await Mot.drawLoop(h,e,"alt",Rot),Dot.bumpVerticalPos(e.stopy-Dot.getVerticalPos()),Dot.models.addLoop(e);break;case r.db.LINETYPE.PAR_START:case r.db.LINETYPE.PAR_OVER_START:Hot(k,t,Rot.boxMargin,Rot.boxMargin+Rot.boxTextMargin,(t=>Dot.newLoop(t))),Dot.saveVerticalPos();break;case r.db.LINETYPE.PAR_AND:Hot(k,t,Rot.boxMargin+Rot.boxTextMargin,Rot.boxMargin,(t=>Dot.addSectionToLoop(t)));break;case r.db.LINETYPE.PAR_END:e=Dot.endLoop(),await Mot.drawLoop(h,e,"par",Rot),Dot.bumpVerticalPos(e.stopy-Dot.getVerticalPos()),Dot.models.addLoop(e);break;case r.db.LINETYPE.AUTONUMBER:_=t.message.start||_,E=t.message.step||E,t.message.visible?r.db.enableSequenceNumbers():r.db.disableSequenceNumbers();break;case r.db.LINETYPE.CRITICAL_START:Hot(k,t,Rot.boxMargin,Rot.boxMargin+Rot.boxTextMargin,(t=>Dot.newLoop(t)));break;case r.db.LINETYPE.CRITICAL_OPTION:Hot(k,t,Rot.boxMargin+Rot.boxTextMargin,Rot.boxMargin,(t=>Dot.addSectionToLoop(t)));break;case r.db.LINETYPE.CRITICAL_END:e=Dot.endLoop(),await Mot.drawLoop(h,e,"critical",Rot),Dot.bumpVerticalPos(e.stopy-Dot.getVerticalPos()),Dot.models.addLoop(e);break;case r.db.LINETYPE.BREAK_START:Hot(k,t,Rot.boxMargin,Rot.boxMargin+Rot.boxTextMargin,(t=>Dot.newLoop(t)));break;case r.db.LINETYPE.BREAK_END:e=Dot.endLoop(),await Mot.drawLoop(h,e,"break",Rot),Dot.bumpVerticalPos(e.stopy-Dot.getVerticalPos()),Dot.models.addLoop(e);break;default:try{i=t.msgModel,i.starty=Dot.getVerticalPos(),i.sequenceIndex=_,i.sequenceVisible=r.db.showSequenceNumbers();const e=await Fot(0,i);Vot(t,i,e,A,u,d,p),C.push({messageModel:i,lineStartY:e}),Dot.models.addMessage(i)}catch(t){m.error("error while drawing message",t)}}[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)&&(_+=E),A++}m.debug("createdActors",d),m.debug("destroyedActors",p),await Got(h,u,f,!1);for(const t of C)await zot(h,t.messageModel,t.lineStartY,r);Rot.mirrorActors&&await Got(h,u,f,!0),S.forEach((t=>Mot.drawBackgroundRect(h,t))),dot(h,u,f,Rot);for(const t of Dot.models.boxes)t.height=Dot.getVerticalPos()-t.y,Dot.insert(t.x,t.y,t.x+t.width,t.height),t.startx=t.x,t.starty=t.y,t.stopx=t.startx+t.width,t.stopy=t.starty+t.height,t.stroke="rgb(0,0,0, 0.5)",Mot.drawBox(h,t,Rot);x&&Dot.bumpVerticalPos(Rot.boxMargin);const L=qot(h,u,f,c),{bounds:N}=Dot.getBounds();void 0===N.startx&&(N.startx=0),void 0===N.starty&&(N.starty=0),void 0===N.stopx&&(N.stopx=0),void 0===N.stopy&&(N.stopy=0);let I=N.stopy-N.starty;I<L.maxHeight&&(I=L.maxHeight);let M=I+2*Rot.diagramMarginY;Rot.mirrorActors&&(M=M-Rot.boxMargin+Rot.bottomMarginAdj);let R=N.stopx-N.startx;R<L.maxWidth&&(R=L.maxWidth);const D=R+2*Rot.diagramMarginX;v&&h.append("text").text(v).attr("x",(N.stopx-N.startx)/2-2*Rot.diagramMarginX).attr("y",-25),Sn(h,M,D,Rot.useMaxWidth);const O=v?40:0;h.attr("viewBox",N.startx-Rot.diagramMarginX+" -"+(Rot.diagramMarginY+O)+" "+D+" "+(M+O)),m.debug("models:",Dot.models)}),"draw");async function Kot(t,e,n){const r={};for(const i of e)if(t.get(i.to)&&t.get(i.from)){const e=t.get(i.to);if(i.placement===n.db.PLACEMENT.LEFTOF&&!e.prevActor)continue;if(i.placement===n.db.PLACEMENT.RIGHTOF&&!e.nextActor)continue;const a=void 0!==i.placement,s=!a,o=a?Bot(Rot):Pot(Rot),l=i.wrap?yk.wrapLabel(i.message,Rot.width-2*Rot.wrapPadding,o):i.message,c=(wn(l)?await kn(i.message,Hn()):yk.calculateTextDimensions(l,o)).width+2*Rot.wrapPadding;s&&i.from===e.nextActor?r[i.to]=_n.getMax(r[i.to]||0,c):s&&i.from===e.prevActor?r[i.from]=_n.getMax(r[i.from]||0,c):s&&i.from===i.to?(r[i.from]=_n.getMax(r[i.from]||0,c/2),r[i.to]=_n.getMax(r[i.to]||0,c/2)):i.placement===n.db.PLACEMENT.RIGHTOF?r[i.from]=_n.getMax(r[i.from]||0,c):i.placement===n.db.PLACEMENT.LEFTOF?r[e.prevActor]=_n.getMax(r[e.prevActor]||0,c):i.placement===n.db.PLACEMENT.OVER&&(e.prevActor&&(r[e.prevActor]=_n.getMax(r[e.prevActor]||0,c/2)),e.nextActor&&(r[i.from]=_n.getMax(r[i.from]||0,c/2)))}return m.debug("maxMessageWidthPerActor:",r),r}s(Kot,"getMaxMessageWidthPerActor");var Zot=s((function(t){let e=0;const n=$ot(Rot);for(const r in t.links){const t=yk.calculateTextDimensions(r,n).width+2*Rot.wrapPadding+2*Rot.boxMargin;e<t&&(e=t)}return e}),"getRequiredPopupWidth");async function Qot(t,e,n){let r=0;for(const e of t.keys()){const n=t.get(e);n.wrap&&(n.description=yk.wrapLabel(n.description,Rot.width-2*Rot.wrapPadding,$ot(Rot)));const i=wn(n.description)?await kn(n.description,Hn()):yk.calculateTextDimensions(n.description,$ot(Rot));n.width=n.wrap?Rot.width:_n.getMax(Rot.width,i.width+2*Rot.wrapPadding),n.height=n.wrap?_n.getMax(i.height,Rot.height):Rot.height,r=_n.getMax(r,n.height)}for(const n in e){const r=t.get(n);if(!r)continue;const i=t.get(r.nextActor);if(!i){const t=e[n]+Rot.actorMargin-r.width/2;r.margin=_n.getMax(t,Rot.actorMargin);continue}const a=e[n]+Rot.actorMargin-r.width/2-i.width/2;r.margin=_n.getMax(a,Rot.actorMargin)}let i=0;return n.forEach((e=>{const n=Pot(Rot);let r=e.actorKeys.reduce(((e,n)=>e+(t.get(n).width+(t.get(n).margin||0))),0);r-=2*Rot.boxTextMargin,e.wrap&&(e.name=yk.wrapLabel(e.name,r-2*Rot.wrapPadding,n));const a=yk.calculateTextDimensions(e.name,n);i=_n.getMax(a.height,i);const s=_n.getMax(r,a.width+2*Rot.wrapPadding);if(e.margin=Rot.boxTextMargin,r<s){const t=(s-r)/2;e.margin+=t}})),n.forEach((t=>t.textMaxHeight=i)),_n.getMax(r,Rot.height)}s(Qot,"calculateActorMargins");var Jot=s((async function(t,e,n){const r=e.get(t.from),i=e.get(t.to),a=r.x,s=i.x,o=t.wrap&&t.message;let l=wn(t.message)?await kn(t.message,Hn()):yk.calculateTextDimensions(o?yk.wrapLabel(t.message,Rot.width,Bot(Rot)):t.message,Bot(Rot));const c={width:o?Rot.width:_n.getMax(Rot.width,l.width+2*Rot.noteMargin),height:0,startx:r.x,stopx:0,starty:0,stopy:0,message:t.message};return t.placement===n.db.PLACEMENT.RIGHTOF?(c.width=o?_n.getMax(Rot.width,l.width):_n.getMax(r.width/2+i.width/2,l.width+2*Rot.noteMargin),c.startx=a+(r.width+Rot.actorMargin)/2):t.placement===n.db.PLACEMENT.LEFTOF?(c.width=o?_n.getMax(Rot.width,l.width+2*Rot.noteMargin):_n.getMax(r.width/2+i.width/2,l.width+2*Rot.noteMargin),c.startx=a-c.width+(r.width-Rot.actorMargin)/2):t.to===t.from?(l=yk.calculateTextDimensions(o?yk.wrapLabel(t.message,_n.getMax(Rot.width,r.width),Bot(Rot)):t.message,Bot(Rot)),c.width=o?_n.getMax(Rot.width,r.width):_n.getMax(r.width,Rot.width,l.width+2*Rot.noteMargin),c.startx=a+(r.width-c.width)/2):(c.width=Math.abs(a+r.width/2-(s+i.width/2))+Rot.actorMargin,c.startx=a<s?a+r.width/2-Rot.actorMargin/2:s+i.width/2-Rot.actorMargin/2),o&&(c.message=yk.wrapLabel(t.message,c.width-2*Rot.wrapPadding,Bot(Rot))),m.debug(`NM:[${c.startx},${c.stopx},${c.starty},${c.stopy}:${c.width},${c.height}=${t.message}]`),c}),"buildNoteModel"),tlt=s((function(t,e,n){if(![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(t.type))return{};const[r,i]=Wot(t.from,e),[a,o]=Wot(t.to,e),l=r<=a;let c=l?i:r,h=l?a:o;const u=Math.abs(a-o)>2,d=s((t=>l?-t:t),"adjustValue");t.from===t.to?h=c:(t.activate&&!u&&(h+=d(Rot.activationWidth/2-1)),[n.db.LINETYPE.SOLID_OPEN,n.db.LINETYPE.DOTTED_OPEN].includes(t.type)||(h+=d(3)),[n.db.LINETYPE.BIDIRECTIONAL_SOLID,n.db.LINETYPE.BIDIRECTIONAL_DOTTED].includes(t.type)&&(c-=d(3)));const p=[r,i,a,o],g=Math.abs(c-h);t.wrap&&t.message&&(t.message=yk.wrapLabel(t.message,_n.getMax(g+2*Rot.wrapPadding,Rot.width),Pot(Rot)));const f=yk.calculateTextDimensions(t.message,Pot(Rot));return{width:_n.getMax(t.wrap?0:f.width+2*Rot.wrapPadding,g+2*Rot.wrapPadding,Rot.width),height:0,startx:c,stopx:h,starty:0,stopy:0,message:t.message,type:t.type,wrap:t.wrap,fromBounds:Math.min.apply(null,p),toBounds:Math.max.apply(null,p)}}),"buildMessageModel"),elt=s((async function(t,e,n,r){const i={},a=[];let s,o,l;for(const n of t){switch(n.id=yk.random({length:10}),n.type){case r.db.LINETYPE.LOOP_START:case r.db.LINETYPE.ALT_START:case r.db.LINETYPE.OPT_START:case r.db.LINETYPE.PAR_START:case r.db.LINETYPE.PAR_OVER_START:case r.db.LINETYPE.CRITICAL_START:case r.db.LINETYPE.BREAK_START:a.push({id:n.id,msg:n.message,from:Number.MAX_SAFE_INTEGER,to:Number.MIN_SAFE_INTEGER,width:0});break;case r.db.LINETYPE.ALT_ELSE:case r.db.LINETYPE.PAR_AND:case r.db.LINETYPE.CRITICAL_OPTION:n.message&&(s=a.pop(),i[s.id]=s,i[n.id]=s,a.push(s));break;case r.db.LINETYPE.LOOP_END:case r.db.LINETYPE.ALT_END:case r.db.LINETYPE.OPT_END:case r.db.LINETYPE.PAR_END:case r.db.LINETYPE.CRITICAL_END:case r.db.LINETYPE.BREAK_END:s=a.pop(),i[s.id]=s;break;case r.db.LINETYPE.ACTIVE_START:{const t=e.get(n.from?n.from:n.to.actor),r=Yot(n.from?n.from:n.to.actor).length,i=t.x+t.width/2+(r-1)*Rot.activationWidth/2,a={startx:i,stopx:i+Rot.activationWidth,actor:n.from,enabled:!0};Dot.activations.push(a)}break;case r.db.LINETYPE.ACTIVE_END:{const t=Dot.activations.map((t=>t.actor)).lastIndexOf(n.from);Dot.activations.splice(t,1).splice(0,1)}}void 0!==n.placement?(o=await Jot(n,e,r),n.noteModel=o,a.forEach((t=>{s=t,s.from=_n.getMin(s.from,o.startx),s.to=_n.getMax(s.to,o.startx+o.width),s.width=_n.getMax(s.width,Math.abs(s.from-s.to))-Rot.labelBoxWidth}))):(l=tlt(n,e,r),n.msgModel=l,l.startx&&l.stopx&&a.length>0&&a.forEach((t=>{if(s=t,l.startx===l.stopx){const t=e.get(n.from),r=e.get(n.to);s.from=_n.getMin(t.x-l.width/2,t.x-t.width/2,s.from),s.to=_n.getMax(r.x+l.width/2,r.x+t.width/2,s.to),s.width=_n.getMax(s.width,Math.abs(s.to-s.from))-Rot.labelBoxWidth}else s.from=_n.getMin(l.startx,s.from),s.to=_n.getMax(l.stopx,s.to),s.width=_n.getMax(s.width,l.width)-Rot.labelBoxWidth})))}return Dot.activations=[],m.debug("Loop type widths:",i),i}),"calculateLoopBounds"),nlt={parser:bst,db:not,renderer:{bounds:Dot,drawActors:Got,drawActorsPopup:qot,setConf:jot,draw:Xot},styles:rot,init:s((({wrap:t})=>{not.setWrap(t)}),"init")},rlt=Object.freeze({__proto__:null,diagram:nlt}),ilt=function(){var t=s((function(t,e,n,r){for(n=n||{},r=t.length;r--;n[t[r]]=e);return n}),"o"),e=[1,18],n=[1,19],r=[1,20],i=[1,41],a=[1,42],o=[1,26],l=[1,24],c=[1,25],h=[1,32],u=[1,33],d=[1,34],p=[1,45],g=[1,35],f=[1,36],m=[1,37],y=[1,38],v=[1,27],x=[1,28],b=[1,29],w=[1,30],k=[1,31],T=[1,44],_=[1,46],E=[1,43],C=[1,47],S=[1,9],A=[1,8,9],L=[1,58],N=[1,59],I=[1,60],M=[1,61],R=[1,62],D=[1,63],O=[1,64],P=[1,8,9,41],B=[1,76],$=[1,8,9,12,13,22,39,41,44,66,67,68,69,70,71,72,77,79],F=[1,8,9,12,13,17,20,22,39,41,44,48,58,66,67,68,69,70,71,72,77,79,84,99,101,102],z=[13,58,84,99,101,102],U=[13,58,71,72,84,99,101,102],G=[13,58,66,67,68,69,70,84,99,101,102],q=[1,98],j=[1,115],Y=[1,107],W=[1,113],H=[1,108],V=[1,109],X=[1,110],K=[1,111],Z=[1,112],Q=[1,114],J=[22,58,59,80,84,85,86,87,88,89],tt=[1,8,9,39,41,44],et=[1,8,9,22],nt=[1,143],rt=[1,8,9,59],it=[1,8,9,22,58,59,80,84,85,86,87,88,89],at={trace:s((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,DOT:17,className:18,classLiteralName: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,ANNOTATION_START:47,ANNOTATION_END:48,MEMBER:49,SEPARATOR:50,relation:51,NOTE_FOR:52,noteText:53,NOTE:54,CLASSDEF:55,classList:56,stylesOpt:57,ALPHA:58,COMMA:59,direction_tb:60,direction_bt:61,direction_rl:62,direction_lr:63,relationType:64,lineType:65,AGGREGATION:66,EXTENSION:67,COMPOSITION:68,DEPENDENCY:69,LOLLIPOP:70,LINE:71,DOTTED_LINE:72,CALLBACK:73,LINK:74,LINK_TARGET:75,CLICK:76,CALLBACK_NAME:77,CALLBACK_ARGS:78,HREF:79,STYLE:80,CSSCLASS:81,style:82,styleComponent:83,NUM:84,COLON:85,UNIT:86,SPACE:87,BRKT:88,PCT:89,commentToken:90,textToken:91,graphCodeTokens:92,textNoTagsToken:93,TAGSTART:94,TAGEND:95,"==":96,"--":97,DEFAULT:98,MINUS:99,keywords:100,UNICODE_TEXT:101,BQUOTE_STR:102,$accept:0,$end:1},terminals_:{2:"error",7:"CLASS_DIAGRAM",8:"NEWLINE",9:"EOF",12:"SQS",13:"STR",14:"SQE",17:"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",47:"ANNOTATION_START",48:"ANNOTATION_END",49:"MEMBER",50:"SEPARATOR",52:"NOTE_FOR",54:"NOTE",55:"CLASSDEF",58:"ALPHA",59:"COMMA",60:"direction_tb",61:"direction_bt",62:"direction_rl",63:"direction_lr",66:"AGGREGATION",67:"EXTENSION",68:"COMPOSITION",69:"DEPENDENCY",70:"LOLLIPOP",71:"LINE",72:"DOTTED_LINE",73:"CALLBACK",74:"LINK",75:"LINK_TARGET",76:"CLICK",77:"CALLBACK_NAME",78:"CALLBACK_ARGS",79:"HREF",80:"STYLE",81:"CSSCLASS",84:"NUM",85:"COLON",86:"UNIT",87:"SPACE",88:"BRKT",89:"PCT",92:"graphCodeTokens",94:"TAGSTART",95:"TAGEND",96:"==",97:"--",98:"DEFAULT",99:"MINUS",100:"keywords",101:"UNICODE_TEXT",102:"BQUOTE_STR"},productions_:[0,[3,1],[3,1],[4,1],[6,4],[5,1],[5,2],[5,3],[11,3],[15,1],[15,3],[15,2],[18,1],[18,3],[18,1],[18,2],[18,2],[18,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,6],[43,2],[43,3],[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],[56,1],[56,3],[32,1],[32,1],[32,1],[32,1],[51,3],[51,2],[51,2],[51,1],[64,1],[64,1],[64,1],[64,1],[64,1],[65,1],[65,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],[57,1],[57,3],[82,1],[82,2],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[90,1],[90,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[93,1],[93,1],[93,1],[93,1],[16,1],[16,1],[16,1],[16,1],[19,1],[53,1]],performAction:s((function(t,e,n,r,i,a,s){var o=a.length-1;switch(i){case 8:this.$=a[o-1];break;case 9:case 12:case 14:this.$=a[o];break;case 10:case 13:this.$=a[o-2]+"."+a[o];break;case 11:case 15:case 95:this.$=a[o-1]+a[o];break;case 16:case 17:this.$=a[o-1]+"~"+a[o]+"~";break;case 18:r.addRelation(a[o]);break;case 19:a[o-1].title=r.cleanupLabel(a[o]),r.addRelation(a[o-1]);break;case 30:this.$=a[o].trim(),r.setAccTitle(this.$);break;case 31:case 32:this.$=a[o].trim(),r.setAccDescription(this.$);break;case 33:r.addClassesToNamespace(a[o-3],a[o-1]);break;case 34:r.addClassesToNamespace(a[o-4],a[o-1]);break;case 35:this.$=a[o],r.addNamespace(a[o]);break;case 36:case 46:case 59:case 92:this.$=[a[o]];break;case 37:this.$=[a[o-1]];break;case 38:a[o].unshift(a[o-2]),this.$=a[o];break;case 40:r.setCssClass(a[o-2],a[o]);break;case 41:r.addMembers(a[o-3],a[o-1]);break;case 42:r.setCssClass(a[o-5],a[o-3]),r.addMembers(a[o-5],a[o-1]);break;case 43:this.$=a[o],r.addClass(a[o]);break;case 44:this.$=a[o-1],r.addClass(a[o-1]),r.setClassLabel(a[o-1],a[o]);break;case 45:r.addAnnotation(a[o],a[o-2]);break;case 47:a[o].push(a[o-1]),this.$=a[o];break;case 48:case 50:case 51:break;case 49:r.addMember(a[o-1],r.cleanupLabel(a[o]));break;case 52:this.$={id1:a[o-2],id2:a[o],relation:a[o-1],relationTitle1:"none",relationTitle2:"none"};break;case 53:this.$={id1:a[o-3],id2:a[o],relation:a[o-1],relationTitle1:a[o-2],relationTitle2:"none"};break;case 54:this.$={id1:a[o-3],id2:a[o],relation:a[o-2],relationTitle1:"none",relationTitle2:a[o-1]};break;case 55:this.$={id1:a[o-4],id2:a[o],relation:a[o-2],relationTitle1:a[o-3],relationTitle2:a[o-1]};break;case 56:r.addNote(a[o],a[o-1]);break;case 57:r.addNote(a[o]);break;case 58:this.$=a[o-2],r.defineClass(a[o-1],a[o]);break;case 60:this.$=a[o-2].concat([a[o]]);break;case 61:r.setDirection("TB");break;case 62:r.setDirection("BT");break;case 63:r.setDirection("RL");break;case 64:r.setDirection("LR");break;case 65:this.$={type1:a[o-2],type2:a[o],lineType:a[o-1]};break;case 66:this.$={type1:"none",type2:a[o],lineType:a[o-1]};break;case 67:this.$={type1:a[o-1],type2:"none",lineType:a[o]};break;case 68:this.$={type1:"none",type2:"none",lineType:a[o]};break;case 69:this.$=r.relationType.AGGREGATION;break;case 70:this.$=r.relationType.EXTENSION;break;case 71:this.$=r.relationType.COMPOSITION;break;case 72:this.$=r.relationType.DEPENDENCY;break;case 73:this.$=r.relationType.LOLLIPOP;break;case 74:this.$=r.lineType.LINE;break;case 75:this.$=r.lineType.DOTTED_LINE;break;case 76:case 82:this.$=a[o-2],r.setClickEvent(a[o-1],a[o]);break;case 77:case 83:this.$=a[o-3],r.setClickEvent(a[o-2],a[o-1]),r.setTooltip(a[o-2],a[o]);break;case 78:this.$=a[o-2],r.setLink(a[o-1],a[o]);break;case 79:this.$=a[o-3],r.setLink(a[o-2],a[o-1],a[o]);break;case 80:this.$=a[o-3],r.setLink(a[o-2],a[o-1]),r.setTooltip(a[o-2],a[o]);break;case 81:this.$=a[o-4],r.setLink(a[o-3],a[o-2],a[o]),r.setTooltip(a[o-3],a[o-1]);break;case 84:this.$=a[o-3],r.setClickEvent(a[o-2],a[o-1],a[o]);break;case 85:this.$=a[o-4],r.setClickEvent(a[o-3],a[o-2],a[o-1]),r.setTooltip(a[o-3],a[o]);break;case 86:this.$=a[o-3],r.setLink(a[o-2],a[o]);break;case 87:this.$=a[o-4],r.setLink(a[o-3],a[o-1],a[o]);break;case 88:this.$=a[o-4],r.setLink(a[o-3],a[o-1]),r.setTooltip(a[o-3],a[o]);break;case 89:this.$=a[o-5],r.setLink(a[o-4],a[o-2],a[o]),r.setTooltip(a[o-4],a[o-1]);break;case 90:this.$=a[o-2],r.setCssStyle(a[o-1],a[o]);break;case 91:r.setCssClass(a[o-1],a[o]);break;case 93:a[o-2].push(a[o]),this.$=a[o-2]}}),"anonymous"),table:[{3:1,4:2,5:3,6:4,7:[1,6],10:5,16:39,18:21,19:40,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:n,37:r,38:22,42:i,43:23,46:a,47:o,49:l,50:c,52:h,54:u,55:d,58:p,60:g,61:f,62:m,63:y,73:v,74:x,76:b,80:w,81:k,84:T,99:_,101:E,102:C},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,3]},t(S,[2,5],{8:[1,48]}),{8:[1,49]},t(A,[2,18],{22:[1,50]}),t(A,[2,20]),t(A,[2,21]),t(A,[2,22]),t(A,[2,23]),t(A,[2,24]),t(A,[2,25]),t(A,[2,26]),t(A,[2,27]),t(A,[2,28]),t(A,[2,29]),{34:[1,51]},{36:[1,52]},t(A,[2,32]),t(A,[2,48],{51:53,64:56,65:57,13:[1,54],22:[1,55],66:L,67:N,68:I,69:M,70:R,71:D,72:O}),{39:[1,65]},t(P,[2,39],{39:[1,67],44:[1,66]}),t(A,[2,50]),t(A,[2,51]),{16:68,58:p,84:T,99:_,101:E},{16:39,18:69,19:40,58:p,84:T,99:_,101:E,102:C},{16:39,18:70,19:40,58:p,84:T,99:_,101:E,102:C},{16:39,18:71,19:40,58:p,84:T,99:_,101:E,102:C},{58:[1,72]},{13:[1,73]},{16:39,18:74,19:40,58:p,84:T,99:_,101:E,102:C},{13:B,53:75},{56:77,58:[1,78]},t(A,[2,61]),t(A,[2,62]),t(A,[2,63]),t(A,[2,64]),t($,[2,12],{16:39,19:40,18:80,17:[1,79],20:[1,81],58:p,84:T,99:_,101:E,102:C}),t($,[2,14],{20:[1,82]}),{15:83,16:84,58:p,84:T,99:_,101:E},{16:39,18:85,19:40,58:p,84:T,99:_,101:E,102:C},t(F,[2,118]),t(F,[2,119]),t(F,[2,120]),t(F,[2,121]),t([1,8,9,12,13,20,22,39,41,44,66,67,68,69,70,71,72,77,79],[2,122]),t(S,[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,18:21,38:22,43:23,16:39,19:40,5:86,33:e,35:n,37:r,42:i,46:a,47:o,49:l,50:c,52:h,54:u,55:d,58:p,60:g,61:f,62:m,63:y,73:v,74:x,76:b,80:w,81:k,84:T,99:_,101:E,102:C}),{5:87,10:5,16:39,18:21,19:40,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:n,37:r,38:22,42:i,43:23,46:a,47:o,49:l,50:c,52:h,54:u,55:d,58:p,60:g,61:f,62:m,63:y,73:v,74:x,76:b,80:w,81:k,84:T,99:_,101:E,102:C},t(A,[2,19]),t(A,[2,30]),t(A,[2,31]),{13:[1,89],16:39,18:88,19:40,58:p,84:T,99:_,101:E,102:C},{51:90,64:56,65:57,66:L,67:N,68:I,69:M,70:R,71:D,72:O},t(A,[2,49]),{65:91,71:D,72:O},t(z,[2,68],{64:92,66:L,67:N,68:I,69:M,70:R}),t(U,[2,69]),t(U,[2,70]),t(U,[2,71]),t(U,[2,72]),t(U,[2,73]),t(G,[2,74]),t(G,[2,75]),{8:[1,94],24:95,40:93,43:23,46:a},{16:96,58:p,84:T,99:_,101:E},{45:97,49:q},{48:[1,99]},{13:[1,100]},{13:[1,101]},{77:[1,102],79:[1,103]},{22:j,57:104,58:Y,80:W,82:105,83:106,84:H,85:V,86:X,87:K,88:Z,89:Q},{58:[1,116]},{13:B,53:117},t(A,[2,57]),t(A,[2,123]),{22:j,57:118,58:Y,59:[1,119],80:W,82:105,83:106,84:H,85:V,86:X,87:K,88:Z,89:Q},t(J,[2,59]),{16:39,18:120,19:40,58:p,84:T,99:_,101:E,102:C},t($,[2,15]),t($,[2,16]),t($,[2,17]),{39:[2,35]},{15:122,16:84,17:[1,121],39:[2,9],58:p,84:T,99:_,101:E},t(tt,[2,43],{11:123,12:[1,124]}),t(S,[2,7]),{9:[1,125]},t(et,[2,52]),{16:39,18:126,19:40,58:p,84:T,99:_,101:E,102:C},{13:[1,128],16:39,18:127,19:40,58:p,84:T,99:_,101:E,102:C},t(z,[2,67],{64:129,66:L,67:N,68:I,69:M,70:R}),t(z,[2,66]),{41:[1,130]},{24:95,40:131,43:23,46:a},{8:[1,132],41:[2,36]},t(P,[2,40],{39:[1,133]}),{41:[1,134]},{41:[2,46],45:135,49:q},{16:39,18:136,19:40,58:p,84:T,99:_,101:E,102:C},t(A,[2,76],{13:[1,137]}),t(A,[2,78],{13:[1,139],75:[1,138]}),t(A,[2,82],{13:[1,140],78:[1,141]}),{13:[1,142]},t(A,[2,90],{59:nt}),t(rt,[2,92],{83:144,22:j,58:Y,80:W,84:H,85:V,86:X,87:K,88:Z,89:Q}),t(it,[2,94]),t(it,[2,96]),t(it,[2,97]),t(it,[2,98]),t(it,[2,99]),t(it,[2,100]),t(it,[2,101]),t(it,[2,102]),t(it,[2,103]),t(it,[2,104]),t(A,[2,91]),t(A,[2,56]),t(A,[2,58],{59:nt}),{58:[1,145]},t($,[2,13]),{15:146,16:84,58:p,84:T,99:_,101:E},{39:[2,11]},t(tt,[2,44]),{13:[1,147]},{1:[2,4]},t(et,[2,54]),t(et,[2,53]),{16:39,18:148,19:40,58:p,84:T,99:_,101:E,102:C},t(z,[2,65]),t(A,[2,33]),{41:[1,149]},{24:95,40:150,41:[2,37],43:23,46:a},{45:151,49:q},t(P,[2,41]),{41:[2,47]},t(A,[2,45]),t(A,[2,77]),t(A,[2,79]),t(A,[2,80],{75:[1,152]}),t(A,[2,83]),t(A,[2,84],{13:[1,153]}),t(A,[2,86],{13:[1,155],75:[1,154]}),{22:j,58:Y,80:W,82:156,83:106,84:H,85:V,86:X,87:K,88:Z,89:Q},t(it,[2,95]),t(J,[2,60]),{39:[2,10]},{14:[1,157]},t(et,[2,55]),t(A,[2,34]),{41:[2,38]},{41:[1,158]},t(A,[2,81]),t(A,[2,85]),t(A,[2,87]),t(A,[2,88],{75:[1,159]}),t(rt,[2,93],{83:144,22:j,58:Y,80:W,84:H,85:V,86:X,87:K,88:Z,89:Q}),t(tt,[2,8]),t(P,[2,42]),t(A,[2,89])],defaultActions:{2:[2,1],3:[2,2],4:[2,3],83:[2,35],122:[2,11],125:[2,4],135:[2,47],146:[2,10],150:[2,38]},parseError:s((function(t,e){if(!e.recoverable){var n=new Error(t);throw n.hash=e,n}this.trace(t)}),"parseError"),parse:s((function(t){var e=this,n=[0],r=[],i=[null],a=[],o=this.table,l="",c=0,h=0,u=2,d=1,p=a.slice.call(arguments,1),g=Object.create(this.lexer),f={yy:{}};for(var m in this.yy)Object.prototype.hasOwnProperty.call(this.yy,m)&&(f.yy[m]=this.yy[m]);g.setInput(t,f.yy),f.yy.lexer=g,f.yy.parser=this,void 0===g.yylloc&&(g.yylloc={});var y=g.yylloc;a.push(y);var v=g.options&&g.options.ranges;function x(t){n.length=n.length-2*t,i.length=i.length-t,a.length=a.length-t}function b(){var t;return"number"!=typeof(t=r.pop()||g.lex()||d)&&(t instanceof Array&&(t=(r=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof f.yy.parseError?this.parseError=f.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,s(x,"popStack"),s(b,"lex");for(var w,k,T,_,E,C,S,A,L={};;){if(k=n[n.length-1],this.defaultActions[k]?T=this.defaultActions[k]:(null==w&&(w=b()),T=o[k]&&o[k][w]),void 0===T||!T.length||!T[0]){var N="";for(E in A=[],o[k])this.terminals_[E]&&E>u&&A.push("'"+this.terminals_[E]+"'");N=g.showPosition?"Parse error on line "+(c+1)+":\n"+g.showPosition()+"\nExpecting "+A.join(", ")+", got '"+(this.terminals_[w]||w)+"'":"Parse error on line "+(c+1)+": Unexpected "+(w==d?"end of input":"'"+(this.terminals_[w]||w)+"'"),this.parseError(N,{text:g.match,token:this.terminals_[w]||w,line:g.yylineno,loc:y,expected:A})}if(T[0]instanceof Array&&T.length>1)throw new Error("Parse Error: multiple actions possible at state: "+k+", token: "+w);switch(T[0]){case 1:n.push(w),i.push(g.yytext),a.push(g.yylloc),n.push(T[1]),w=null,h=g.yyleng,l=g.yytext,c=g.yylineno,y=g.yylloc;break;case 2:if(C=this.productions_[T[1]][1],L.$=i[i.length-C],L._$={first_line:a[a.length-(C||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(C||1)].first_column,last_column:a[a.length-1].last_column},v&&(L._$.range=[a[a.length-(C||1)].range[0],a[a.length-1].range[1]]),void 0!==(_=this.performAction.apply(L,[l,h,c,f.yy,T[1],i,a].concat(p))))return _;C&&(n=n.slice(0,-1*C*2),i=i.slice(0,-1*C),a=a.slice(0,-1*C)),n.push(this.productions_[T[1]][0]),i.push(L.$),a.push(L._$),S=o[n[n.length-2]][n[n.length-1]],n.push(S);break;case 3:return!0}}return!0}),"parse")},st=function(){var t={EOF:1,parseError:s((function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)}),"parseError"),setInput:s((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:s((function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(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:s((function(t){var e=t.length,n=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 r=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 i=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===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this}),"unput"),more:s((function(){return this._more=!0,this}),"more"),reject:s((function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):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).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}),"reject"),less:s((function(t){this.unput(this.match.slice(t))}),"less"),pastInput:s((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:s((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:s((function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"}),"showPosition"),test_match:s((function(t,e){var n,r,i;if(this.options.backtrack_lexer&&(i={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&&(i.yylloc.range=this.yylloc.range.slice(0))),(r=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.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],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1}),"test_match"),next:s((function(){if(this.done)return this.EOF;var t,e,n,r;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;a<i.length;a++)if((n=this._input.match(this.rules[i[a]]))&&(!e||n[0].length>e[0].length)){if(e=n,r=a,this.options.backtrack_lexer){if(!1!==(t=this.test_match(n,i[a])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,i[r]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}),"next"),lex:s((function(){var t=this.next();return t||this.lex()}),"lex"),begin:s((function(t){this.conditionStack.push(t)}),"begin"),popState:s((function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]}),"popState"),_currentRules:s((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:s((function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"}),"topState"),pushState:s((function(t){this.begin(t)}),"pushState"),stateStackSize:s((function(){return this.conditionStack.length}),"stateStackSize"),options:{},performAction:s((function(t,e,n,r){switch(n){case 0:return 60;case 1:return 61;case 2:return 62;case 3:return 63;case 4:case 5:case 14:case 31:case 36:case 40:case 47: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:case 19:case 22:case 24:case 58:case 61:this.popState();break;case 12:return"acc_descr_multiline_value";case 13:case 35:return 8;case 15:case 16:return 7;case 17:case 37:case 45:return"EDGE_STATE";case 18:this.begin("callback_name");break;case 20:this.popState(),this.begin("callback_args");break;case 21:return 77;case 23:return 78;case 25:return"STR";case 26:this.begin("string");break;case 27:return 80;case 28:return 55;case 29:return this.begin("namespace"),42;case 30:case 39:return this.popState(),8;case 32:return this.begin("namespace-body"),39;case 33:case 43:return this.popState(),41;case 34:case 44:return"EOF_IN_STRUCT";case 38:return this.begin("class"),46;case 41:return this.popState(),this.popState(),41;case 42:return this.begin("class-body"),39;case 46:return"OPEN_IN_STRUCT";case 48:return"MEMBER";case 49:return 81;case 50:return 73;case 51:return 74;case 52:return 76;case 53:return 52;case 54:return 54;case 55:return 47;case 56:return 48;case 57:return 79;case 59:return"GENERICTYPE";case 60:this.begin("generic");break;case 62:return"BQUOTE_STR";case 63:this.begin("bqstring");break;case 64:case 65:case 66:case 67:return 75;case 68:case 69:return 67;case 70:case 71:return 69;case 72:return 68;case 73:return 66;case 74:return 70;case 75:return 71;case 76:return 72;case 77:return 22;case 78:return 44;case 79:return 99;case 80:return 17;case 81:return"PLUS";case 82:return 85;case 83:return 59;case 84:case 85:return 88;case 86:return 89;case 87:case 88:return"EQUALS";case 89:return 58;case 90:return 12;case 91:return 14;case 92:return"PUNCTUATION";case 93:return 84;case 94:return 101;case 95:case 96:return 87;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 t}();function ot(){this.yy={}}return at.lexer=st,s(ot,"Parser"),ot.prototype=at,at.Parser=ot,new ot}();ilt.parser=ilt;var alt=ilt,slt=["#","+","~","-",""],olt=class{static{s(this,"ClassMember")}constructor(t,e){this.memberType=e,this.visibility="",this.classifier="",this.text="";const n=an(t,Hn());this.parseMember(n)}getDisplayDetails(){let t=this.visibility+fn(this.id);"method"===this.memberType&&(t+=`(${fn(this.parameters.trim())})`,this.returnType&&(t+=" : "+fn(this.returnType))),t=t.trim();return{displayText:t,cssStyle:this.parseClassifier()}}parseMember(t){let e="";if("method"===this.memberType){const n=/([#+~-])?(.+)\((.*)\)([\s$*])?(.*)([$*])?/.exec(t);if(n){const t=n[1]?n[1].trim():"";if(slt.includes(t)&&(this.visibility=t),this.id=n[2],this.parameters=n[3]?n[3].trim():"",e=n[4]?n[4].trim():"",this.returnType=n[5]?n[5].trim():"",""===e){const t=this.returnType.substring(this.returnType.length-1);/[$*]/.exec(t)&&(e=t,this.returnType=this.returnType.substring(0,this.returnType.length-1))}}}else{const n=t.length,r=t.substring(0,1),i=t.substring(n-1);slt.includes(r)&&(this.visibility=r),/[$*]/.exec(i)&&(e=i),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 n=`${this.visibility?"\\"+this.visibility:""}${fn(this.id)}${"method"===this.memberType?`(${fn(this.parameters)})${this.returnType?" : "+fn(this.returnType):""}`:""}`;this.text=n.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""}}},llt=[],clt=new Map,hlt=new Map,ult=[],dlt=[],plt=0,glt=new Map,flt=0,mlt=[],ylt=s((t=>_n.sanitizeText(t,Hn())),"sanitizeText"),vlt=s((function(t){const e=_n.sanitizeText(t,Hn());let n="",r=e;if(e.indexOf("~")>0){const t=e.split("~");r=ylt(t[0]),n=ylt(t[1])}return{className:r,type:n}}),"splitClassNameAndType"),xlt=s((function(t,e){const n=_n.sanitizeText(t,Hn());e&&(e=ylt(e));const{className:r}=vlt(n);clt.get(r).label=e,clt.get(r).text=`${e}${clt.get(r).type?`<${clt.get(r).type}>`:""}`}),"setClassLabel"),blt=s((function(t){const e=_n.sanitizeText(t,Hn()),{className:n,type:r}=vlt(e);if(clt.has(n))return;const i=_n.sanitizeText(n,Hn());clt.set(i,{id:i,type:r,label:i,text:`${i}${r?`&lt;${r}&gt;`:""}`,shape:"classBox",cssClasses:"default",methods:[],members:[],annotations:[],styles:[],domId:"classId-"+i+"-"+plt}),plt++}),"addClass"),wlt=s((function(t,e){const n={id:`interface${dlt.length}`,label:t,classId:e};dlt.push(n)}),"addInterface"),klt=s((function(t){const e=_n.sanitizeText(t,Hn());if(clt.has(e))return clt.get(e).domId;throw new Error("Class not found: "+e)}),"lookUpDomId"),Tlt=s((function(){llt=[],clt=new Map,ult=[],dlt=[],(mlt=[]).push(qlt),glt=new Map,flt=0,jlt="TB",$n()}),"clear"),_lt=s((function(t){return clt.get(t)}),"getClass"),Elt=s((function(){return clt}),"getClasses"),Clt=s((function(){return llt}),"getRelations"),Slt=s((function(){return ult}),"getNotes"),Alt=s((function(t){m.debug("Adding relation: "+JSON.stringify(t));const e=[Glt.LOLLIPOP,Glt.AGGREGATION,Glt.COMPOSITION,Glt.DEPENDENCY,Glt.EXTENSION];t.relation.type1!==Glt.LOLLIPOP||e.includes(t.relation.type2)?t.relation.type2!==Glt.LOLLIPOP||e.includes(t.relation.type1)?(blt(t.id1),blt(t.id2)):(blt(t.id1),wlt(t.id2,t.id1),t.id2="interface"+(dlt.length-1)):(blt(t.id2),wlt(t.id1,t.id2),t.id1="interface"+(dlt.length-1)),t.id1=vlt(t.id1).className,t.id2=vlt(t.id2).className,t.relationTitle1=_n.sanitizeText(t.relationTitle1.trim(),Hn()),t.relationTitle2=_n.sanitizeText(t.relationTitle2.trim(),Hn()),llt.push(t)}),"addRelation"),Llt=s((function(t,e){const n=vlt(t).className;clt.get(n).annotations.push(e)}),"addAnnotation"),Nlt=s((function(t,e){blt(t);const n=vlt(t).className,r=clt.get(n);if("string"==typeof e){const t=e.trim();t.startsWith("<<")&&t.endsWith(">>")?r.annotations.push(ylt(t.substring(2,t.length-2))):t.indexOf(")")>0?r.methods.push(new olt(t,"method")):t&&r.members.push(new olt(t,"attribute"))}}),"addMember"),Ilt=s((function(t,e){Array.isArray(e)&&(e.reverse(),e.forEach((e=>Nlt(t,e))))}),"addMembers"),Mlt=s((function(t,e){const n={id:`note${ult.length}`,class:e,text:t};ult.push(n)}),"addNote"),Rlt=s((function(t){return t.startsWith(":")&&(t=t.substring(1)),ylt(t.trim())}),"cleanupLabel"),Dlt=s((function(t,e){t.split(",").forEach((function(t){let n=t;/\d/.exec(t[0])&&(n="classId-"+n);const r=clt.get(n);r&&(r.cssClasses+=" "+e)}))}),"setCssClass"),Olt=s((function(t,e){for(const n of t){let t=hlt.get(n);void 0===t&&(t={id:n,styles:[],textStyles:[]},hlt.set(n,t)),e&&e.forEach((function(e){if(/color/.exec(e)){const n=e.replace("fill","bgFill");t.textStyles.push(n)}t.styles.push(e)})),clt.forEach((t=>{t.cssClasses.includes(n)&&t.styles.push(...e.flatMap((t=>t.split(","))))}))}}),"defineClass"),Plt=s((function(t,e){t.split(",").forEach((function(t){void 0!==e&&(clt.get(t).tooltip=ylt(e))}))}),"setTooltip"),Blt=s((function(t,e){return e&&glt.has(e)?glt.get(e).classes.get(t).tooltip:clt.get(t).tooltip}),"getTooltip"),$lt=s((function(t,e,n){const r=Hn();t.split(",").forEach((function(t){let i=t;/\d/.exec(t[0])&&(i="classId-"+i);const a=clt.get(i);a&&(a.link=yk.formatUrl(e,r),"sandbox"===r.securityLevel?a.linkTarget="_top":a.linkTarget="string"==typeof n?ylt(n):"_blank")})),Dlt(t,"clickable")}),"setLink"),Flt=s((function(t,e,n){t.split(",").forEach((function(t){zlt(t,e,n),clt.get(t).haveCallback=!0})),Dlt(t,"clickable")}),"setClickEvent"),zlt=s((function(t,e,n){const r=_n.sanitizeText(t,Hn());if("loose"!==Hn().securityLevel)return;if(void 0===e)return;const i=r;if(clt.has(i)){const t=klt(i);let r=[];if("string"==typeof n){r=n.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let t=0;t<r.length;t++){let e=r[t].trim();e.startsWith('"')&&e.endsWith('"')&&(e=e.substr(1,e.length-2)),r[t]=e}}0===r.length&&r.push(t),mlt.push((function(){const n=document.querySelector(`[id="${t}"]`);null!==n&&n.addEventListener("click",(function(){yk.runFunc(e,...r)}),!1)}))}}),"setClickFunc"),Ult=s((function(t){mlt.forEach((function(e){e(t)}))}),"bindFunctions"),Glt={AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3,LOLLIPOP:4},qlt=s((function(t){let e=Oa(".mermaidTooltip");null===(e._groups||e)[0][0]&&(e=Oa("body").append("div").attr("class","mermaidTooltip").style("opacity",0));Oa(t).select("svg").selectAll("g.node").on("mouseover",(function(){const t=Oa(this);if(null===t.attr("title"))return;const n=this.getBoundingClientRect();e.transition().duration(200).style("opacity",".9"),e.text(t.attr("title")).style("left",window.scrollX+n.left+(n.right-n.left)/2+"px").style("top",window.scrollY+n.top-14+document.body.scrollTop+"px"),e.html(e.html().replace(/&lt;br\/&gt;/g,"<br/>")),t.classed("hover",!0)})).on("mouseout",(function(){e.transition().duration(500).style("opacity",0);Oa(this).classed("hover",!1)}))}),"setupToolTips");mlt.push(qlt);var jlt="TB",Ylt=s((()=>jlt),"getDirection"),Wlt=s((t=>{jlt=t}),"setDirection"),Hlt=s((function(t){glt.has(t)||(glt.set(t,{id:t,classes:new Map,children:{},domId:"classId-"+t+"-"+flt}),flt++)}),"addNamespace"),Vlt=s((function(t){return glt.get(t)}),"getNamespace"),Xlt=s((function(){return glt}),"getNamespaces"),Klt=s((function(t,e){if(glt.has(t))for(const n of e){const{className:e}=vlt(n);clt.get(e).parent=t,glt.get(t).classes.set(e,clt.get(e))}}),"addClassesToNamespace"),Zlt=s((function(t,e){const n=clt.get(t);if(e&&n)for(const t of e)t.includes(",")?n.styles.push(...t.split(",")):n.styles.push(t)}),"setCssStyle");function Qlt(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}s(Qlt,"getArrowMarker");var Jlt=s((()=>{const t=[],e=[],n=Hn();for(const e of glt.keys()){const r=glt.get(e);if(r){const e={id:r.id,label:r.id,isGroup:!0,padding:n.class.padding??16,shape:"rect",cssStyles:["fill: none","stroke: black"],look:n.look};t.push(e)}}for(const e of clt.keys()){const r=clt.get(e);if(r){const e=r;e.parentId=r.parent,e.look=n.look,t.push(e)}}let r=0;for(const i of ult){r++;const a={id:i.id,label:i.text,isGroup:!1,shape:"note",padding:n.class.padding??6,cssStyles:["text-align: left","white-space: nowrap",`fill: ${n.themeVariables.noteBkgColor}`,`stroke: ${n.themeVariables.noteBorderColor}`],look:n.look};t.push(a);const s=clt.get(i.class)?.id??"";if(s){const t={id:`edgeNote${r}`,start:i.id,end:s,type:"normal",thickness:"normal",classes:"relation",arrowTypeStart:"none",arrowTypeEnd:"none",arrowheadStyle:"",labelStyle:[""],style:["fill: none"],pattern:"dotted",look:n.look};e.push(t)}}for(const e of dlt){const r={id:e.id,label:e.label,isGroup:!1,shape:"rect",cssStyles:["opacity: 0;"],look:n.look};t.push(r)}r=0;for(const t of llt){r++;const i={id:bk(t.id1,t.id2,{prefix:"id",counter:r}),start:t.id1,end:t.id2,type:"normal",label:t.title,labelpos:"c",thickness:"normal",classes:"relation",arrowTypeStart:Qlt(t.relation.type1),arrowTypeEnd:Qlt(t.relation.type2),startLabelRight:"none"===t.relationTitle1?"":t.relationTitle1,endLabelLeft:"none"===t.relationTitle2?"":t.relationTitle2,arrowheadStyle:"",labelStyle:["display: inline-block"],style:t.style||"",pattern:1==t.relation.lineType?"dashed":"solid",look:n.look};e.push(i)}return{nodes:t,edges:e,other:{},config:n,direction:Ylt()}}),"getData"),tct={setAccTitle:Fn,getAccTitle:zn,getAccDescription:Gn,setAccDescription:Un,getConfig:s((()=>Hn().class),"getConfig"),addClass:blt,bindFunctions:Ult,clear:Tlt,getClass:_lt,getClasses:Elt,getNotes:Slt,addAnnotation:Llt,addNote:Mlt,getRelations:Clt,addRelation:Alt,getDirection:Ylt,setDirection:Wlt,addMember:Nlt,addMembers:Ilt,cleanupLabel:Rlt,lineType:{LINE:0,DOTTED_LINE:1},relationType:Glt,setClickEvent:Flt,setCssClass:Dlt,defineClass:Olt,setLink:$lt,getTooltip:Blt,setTooltip:Plt,lookUpDomId:klt,setDiagramTitle:qn,getDiagramTitle:jn,setClassLabel:xlt,addNamespace:Hlt,addClassesToNamespace:Klt,getNamespace:Vlt,getNamespaces:Xlt,setCssStyle:Zlt,getData:Jlt},ect=s((t=>`g.classGroup text {\n fill: ${t.nodeBorder||t.classText};\n stroke: none;\n font-family: ${t.fontFamily};\n font-size: 10px;\n\n .title {\n font-weight: bolder;\n }\n\n}\n\n.nodeLabel, .edgeLabel {\n color: ${t.classText};\n}\n.edgeLabel .label rect {\n fill: ${t.mainBkg};\n}\n.label text {\n fill: ${t.classText};\n}\n\n.labelBkg {\n background: ${t.mainBkg};\n}\n.edgeLabel .label span {\n background: ${t.mainBkg};\n}\n\n.classTitle {\n font-weight: bolder;\n}\n.node rect,\n .node circle,\n .node ellipse,\n .node polygon,\n .node path {\n fill: ${t.mainBkg};\n stroke: ${t.nodeBorder};\n stroke-width: 1px;\n }\n\n\n.divider {\n stroke: ${t.nodeBorder};\n stroke-width: 1;\n}\n\ng.clickable {\n cursor: pointer;\n}\n\ng.classGroup rect {\n fill: ${t.mainBkg};\n stroke: ${t.nodeBorder};\n}\n\ng.classGroup line {\n stroke: ${t.nodeBorder};\n stroke-width: 1;\n}\n\n.classLabel .box {\n stroke: none;\n stroke-width: 0;\n fill: ${t.mainBkg};\n opacity: 0.5;\n}\n\n.classLabel .label {\n fill: ${t.nodeBorder};\n font-size: 10px;\n}\n\n.relation {\n stroke: ${t.lineColor};\n stroke-width: 1;\n fill: none;\n}\n\n.dashed-line{\n stroke-dasharray: 3;\n}\n\n.dotted-line{\n stroke-dasharray: 1 2;\n}\n\n#compositionStart, .composition {\n fill: ${t.lineColor} !important;\n stroke: ${t.lineColor} !important;\n stroke-width: 1;\n}\n\n#compositionEnd, .composition {\n fill: ${t.lineColor} !important;\n stroke: ${t.lineColor} !important;\n stroke-width: 1;\n}\n\n#dependencyStart, .dependency {\n fill: ${t.lineColor} !important;\n stroke: ${t.lineColor} !important;\n stroke-width: 1;\n}\n\n#dependencyStart, .dependency {\n fill: ${t.lineColor} !important;\n stroke: ${t.lineColor} !important;\n stroke-width: 1;\n}\n\n#extensionStart, .extension {\n fill: transparent !important;\n stroke: ${t.lineColor} !important;\n stroke-width: 1;\n}\n\n#extensionEnd, .extension {\n fill: transparent !important;\n stroke: ${t.lineColor} !important;\n stroke-width: 1;\n}\n\n#aggregationStart, .aggregation {\n fill: transparent !important;\n stroke: ${t.lineColor} !important;\n stroke-width: 1;\n}\n\n#aggregationEnd, .aggregation {\n fill: transparent !important;\n stroke: ${t.lineColor} !important;\n stroke-width: 1;\n}\n\n#lollipopStart, .lollipop {\n fill: ${t.mainBkg} !important;\n stroke: ${t.lineColor} !important;\n stroke-width: 1;\n}\n\n#lollipopEnd, .lollipop {\n fill: ${t.mainBkg} !important;\n stroke: ${t.lineColor} !important;\n stroke-width: 1;\n}\n\n.edgeTerminals {\n font-size: 11px;\n line-height: initial;\n}\n\n.classTitleText {\n text-anchor: middle;\n font-size: 18px;\n fill: ${t.textColor};\n}\n`),"getStyles"),nct=s(((t,e="TB")=>{if(!t.doc)return e;let n=e;for(const e of t.doc)"dir"===e.stmt&&(n=e.value);return n}),"getDir"),rct=s((function(t,e){return e.db.getClasses()}),"getClasses"),ict=s((async function(t,e,n,r){m.info("REF0:"),m.info("Drawing class diagram (v3)",e);const{securityLevel:i,state:a,layout:s}=Hn(),o=r.db.getData(),l=FH(e,i);o.type=r.type,o.layoutAlgorithm=nA(s),o.nodeSpacing=a?.nodeSpacing||50,o.rankSpacing=a?.rankSpacing||50,o.markers=["aggregation","extension","composition","dependency","lollipop"],o.diagramId=e,await eA(o,l);yk.insertTitle(l,"classDiagramTitleText",a?.titleTopMargin??25,r.db.getDiagramTitle()),zH(l,8,"classDiagram",a?.useMaxWidth??!0)}),"draw"),act={getClasses:rct,draw:ict,getDir:nct},sct={parser:alt,db:tct,renderer:act,styles:ect,init:s((t=>{t.class||(t.class={}),t.class.arrowMarkerAbsolute=t.arrowMarkerAbsolute,tct.clear()}),"init")},oct=Object.freeze({__proto__:null,diagram:sct}),lct={parser:alt,db:tct,renderer:act,styles:ect,init:s((t=>{t.class||(t.class={}),t.class.arrowMarkerAbsolute=t.arrowMarkerAbsolute,tct.clear()}),"init")},cct=Object.freeze({__proto__:null,diagram:lct}),hct=function(){var t=s((function(t,e,n,r){for(n=n||{},r=t.length;r--;n[t[r]]=e);return n}),"o"),e=[1,2],n=[1,3],r=[1,4],i=[2,4],a=[1,9],o=[1,11],l=[1,16],c=[1,17],h=[1,18],u=[1,19],d=[1,32],p=[1,20],g=[1,21],f=[1,22],m=[1,23],y=[1,24],v=[1,26],x=[1,27],b=[1,28],w=[1,29],k=[1,30],T=[1,31],_=[1,34],E=[1,35],C=[1,36],S=[1,37],A=[1,33],L=[1,4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,42,45,48,49,50,51,54],N=[1,4,5,14,15,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,42,45,48,49,50,51,54],I=[4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,42,45,48,49,50,51,54],M={trace:s((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,"--\x3e":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,classDef:38,CLASSDEF_ID:39,CLASSDEF_STYLEOPTS:40,DEFAULT:41,style:42,STYLE_IDS:43,STYLEDEF_STYLEOPTS:44,class:45,CLASSENTITY_IDS:46,STYLECLASS:47,direction_tb:48,direction_bt:49,direction_rl:50,direction_lr:51,eol:52,";":53,EDGE_STATE:54,STYLE_SEPARATOR:55,left_of:56,right_of:57,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NL",6:"SD",14:"DESCR",15:"--\x3e",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:"classDef",39:"CLASSDEF_ID",40:"CLASSDEF_STYLEOPTS",41:"DEFAULT",42:"style",43:"STYLE_IDS",44:"STYLEDEF_STYLEOPTS",45:"class",46:"CLASSENTITY_IDS",47:"STYLECLASS",48:"direction_tb",49:"direction_bt",50:"direction_rl",51:"direction_lr",53:";",54:"EDGE_STATE",55:"STYLE_SEPARATOR",56:"left_of",57:"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],[10,3],[10,3],[11,3],[12,3],[32,1],[32,1],[32,1],[32,1],[52,1],[52,1],[13,1],[13,1],[13,3],[13,3],[30,1],[30,1]],performAction:s((function(t,e,n,r,i,a,s){var o=a.length-1;switch(i){case 3:return r.setRootDoc(a[o]),a[o];case 4:this.$=[];break;case 5:"nl"!=a[o]&&(a[o-1].push(a[o]),this.$=a[o-1]);break;case 6:case 7:case 12:this.$=a[o];break;case 8:this.$="nl";break;case 13:const t=a[o-1];t.description=r.trimColon(a[o]),this.$=t;break;case 14:this.$={stmt:"relation",state1:a[o-2],state2:a[o]};break;case 15:const e=r.trimColon(a[o]);this.$={stmt:"relation",state1:a[o-3],state2:a[o-1],description:e};break;case 19:this.$={stmt:"state",id:a[o-3],type:"default",description:"",doc:a[o-1]};break;case 20:var l=a[o],c=a[o-2].trim();if(a[o].match(":")){var h=a[o].split(":");l=h[0],c=[c,h[1]]}this.$={stmt:"state",id:l,type:"default",description:c};break;case 21:this.$={stmt:"state",id:a[o-3],type:"default",description:a[o-5],doc:a[o-1]};break;case 22:this.$={stmt:"state",id:a[o],type:"fork"};break;case 23:this.$={stmt:"state",id:a[o],type:"join"};break;case 24:this.$={stmt:"state",id:a[o],type:"choice"};break;case 25:this.$={stmt:"state",id:r.getDividerId(),type:"divider"};break;case 26:this.$={stmt:"state",id:a[o-1].trim(),note:{position:a[o-2].trim(),text:a[o].trim()}};break;case 29:this.$=a[o].trim(),r.setAccTitle(this.$);break;case 30:case 31:this.$=a[o].trim(),r.setAccDescription(this.$);break;case 32:case 33:this.$={stmt:"classDef",id:a[o-1].trim(),classes:a[o].trim()};break;case 34:this.$={stmt:"style",id:a[o-1].trim(),styleClass:a[o].trim()};break;case 35:this.$={stmt:"applyClass",id:a[o-1].trim(),styleClass:a[o].trim()};break;case 36:r.setDirection("TB"),this.$={stmt:"dir",value:"TB"};break;case 37:r.setDirection("BT"),this.$={stmt:"dir",value:"BT"};break;case 38:r.setDirection("RL"),this.$={stmt:"dir",value:"RL"};break;case 39:r.setDirection("LR"),this.$={stmt:"dir",value:"LR"};break;case 42:case 43:this.$={stmt:"state",id:a[o].trim(),type:"default",description:""};break;case 44:case 45:this.$={stmt:"state",id:a[o-2].trim(),classes:[a[o].trim()],type:"default",description:""}}}),"anonymous"),table:[{3:1,4:e,5:n,6:r},{1:[3]},{3:5,4:e,5:n,6:r},{3:6,4:e,5:n,6:r},t([1,4,5,16,17,19,22,24,25,26,27,28,29,33,35,37,38,42,45,48,49,50,51,54],i,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:a,5:o,8:8,9:10,10:12,11:13,12:14,13:15,16:l,17:c,19:h,22:u,24:d,25:p,26:g,27:f,28:m,29:y,32:25,33:v,35:x,37:b,38:w,42:k,45:T,48:_,49:E,50:C,51:S,54:A},t(L,[2,5]),{9:38,10:12,11:13,12:14,13:15,16:l,17:c,19:h,22:u,24:d,25:p,26:g,27:f,28:m,29:y,32:25,33:v,35:x,37:b,38:w,42:k,45:T,48:_,49:E,50:C,51:S,54:A},t(L,[2,7]),t(L,[2,8]),t(L,[2,9]),t(L,[2,10]),t(L,[2,11]),t(L,[2,12],{14:[1,39],15:[1,40]}),t(L,[2,16]),{18:[1,41]},t(L,[2,18],{20:[1,42]}),{23:[1,43]},t(L,[2,22]),t(L,[2,23]),t(L,[2,24]),t(L,[2,25]),{30:44,31:[1,45],56:[1,46],57:[1,47]},t(L,[2,28]),{34:[1,48]},{36:[1,49]},t(L,[2,31]),{39:[1,50],41:[1,51]},{43:[1,52]},{46:[1,53]},t(N,[2,42],{55:[1,54]}),t(N,[2,43],{55:[1,55]}),t(L,[2,36]),t(L,[2,37]),t(L,[2,38]),t(L,[2,39]),t(L,[2,6]),t(L,[2,13]),{13:56,24:d,54:A},t(L,[2,17]),t(I,i,{7:57}),{24:[1,58]},{24:[1,59]},{23:[1,60]},{24:[2,46]},{24:[2,47]},t(L,[2,29]),t(L,[2,30]),{40:[1,61]},{40:[1,62]},{44:[1,63]},{47:[1,64]},{24:[1,65]},{24:[1,66]},t(L,[2,14],{14:[1,67]}),{4:a,5:o,8:8,9:10,10:12,11:13,12:14,13:15,16:l,17:c,19:h,21:[1,68],22:u,24:d,25:p,26:g,27:f,28:m,29:y,32:25,33:v,35:x,37:b,38:w,42:k,45:T,48:_,49:E,50:C,51:S,54:A},t(L,[2,20],{20:[1,69]}),{31:[1,70]},{24:[1,71]},t(L,[2,32]),t(L,[2,33]),t(L,[2,34]),t(L,[2,35]),t(N,[2,44]),t(N,[2,45]),t(L,[2,15]),t(L,[2,19]),t(I,i,{7:72}),t(L,[2,26]),t(L,[2,27]),{4:a,5:o,8:8,9:10,10:12,11:13,12:14,13:15,16:l,17:c,19:h,21:[1,73],22:u,24:d,25:p,26:g,27:f,28:m,29:y,32:25,33:v,35:x,37:b,38:w,42:k,45:T,48:_,49:E,50:C,51:S,54:A},t(L,[2,21])],defaultActions:{5:[2,1],6:[2,2],46:[2,46],47:[2,47]},parseError:s((function(t,e){if(!e.recoverable){var n=new Error(t);throw n.hash=e,n}this.trace(t)}),"parseError"),parse:s((function(t){var e=this,n=[0],r=[],i=[null],a=[],o=this.table,l="",c=0,h=0,u=2,d=1,p=a.slice.call(arguments,1),g=Object.create(this.lexer),f={yy:{}};for(var m in this.yy)Object.prototype.hasOwnProperty.call(this.yy,m)&&(f.yy[m]=this.yy[m]);g.setInput(t,f.yy),f.yy.lexer=g,f.yy.parser=this,void 0===g.yylloc&&(g.yylloc={});var y=g.yylloc;a.push(y);var v=g.options&&g.options.ranges;function x(t){n.length=n.length-2*t,i.length=i.length-t,a.length=a.length-t}function b(){var t;return"number"!=typeof(t=r.pop()||g.lex()||d)&&(t instanceof Array&&(t=(r=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof f.yy.parseError?this.parseError=f.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,s(x,"popStack"),s(b,"lex");for(var w,k,T,_,E,C,S,A,L={};;){if(k=n[n.length-1],this.defaultActions[k]?T=this.defaultActions[k]:(null==w&&(w=b()),T=o[k]&&o[k][w]),void 0===T||!T.length||!T[0]){var N="";for(E in A=[],o[k])this.terminals_[E]&&E>u&&A.push("'"+this.terminals_[E]+"'");N=g.showPosition?"Parse error on line "+(c+1)+":\n"+g.showPosition()+"\nExpecting "+A.join(", ")+", got '"+(this.terminals_[w]||w)+"'":"Parse error on line "+(c+1)+": Unexpected "+(w==d?"end of input":"'"+(this.terminals_[w]||w)+"'"),this.parseError(N,{text:g.match,token:this.terminals_[w]||w,line:g.yylineno,loc:y,expected:A})}if(T[0]instanceof Array&&T.length>1)throw new Error("Parse Error: multiple actions possible at state: "+k+", token: "+w);switch(T[0]){case 1:n.push(w),i.push(g.yytext),a.push(g.yylloc),n.push(T[1]),w=null,h=g.yyleng,l=g.yytext,c=g.yylineno,y=g.yylloc;break;case 2:if(C=this.productions_[T[1]][1],L.$=i[i.length-C],L._$={first_line:a[a.length-(C||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(C||1)].first_column,last_column:a[a.length-1].last_column},v&&(L._$.range=[a[a.length-(C||1)].range[0],a[a.length-1].range[1]]),void 0!==(_=this.performAction.apply(L,[l,h,c,f.yy,T[1],i,a].concat(p))))return _;C&&(n=n.slice(0,-1*C*2),i=i.slice(0,-1*C),a=a.slice(0,-1*C)),n.push(this.productions_[T[1]][0]),i.push(L.$),a.push(L._$),S=o[n[n.length-2]][n[n.length-1]],n.push(S);break;case 3:return!0}}return!0}),"parse")},R=function(){var t={EOF:1,parseError:s((function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)}),"parseError"),setInput:s((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:s((function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(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:s((function(t){var e=t.length,n=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 r=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 i=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===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this}),"unput"),more:s((function(){return this._more=!0,this}),"more"),reject:s((function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):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).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}),"reject"),less:s((function(t){this.unput(this.match.slice(t))}),"less"),pastInput:s((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:s((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:s((function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"}),"showPosition"),test_match:s((function(t,e){var n,r,i;if(this.options.backtrack_lexer&&(i={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&&(i.yylloc.range=this.yylloc.range.slice(0))),(r=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.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],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1}),"test_match"),next:s((function(){if(this.done)return this.EOF;var t,e,n,r;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;a<i.length;a++)if((n=this._input.match(this.rules[i[a]]))&&(!e||n[0].length>e[0].length)){if(e=n,r=a,this.options.backtrack_lexer){if(!1!==(t=this.test_match(n,i[a])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,i[r]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}),"next"),lex:s((function(){var t=this.next();return t||this.lex()}),"lex"),begin:s((function(t){this.conditionStack.push(t)}),"begin"),popState:s((function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]}),"popState"),_currentRules:s((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:s((function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"}),"topState"),pushState:s((function(t){this.begin(t)}),"pushState"),stateStackSize:s((function(){return this.conditionStack.length}),"stateStackSize"),options:{"case-insensitive":!0},performAction:s((function(t,e,n,r){switch(n){case 0:return 41;case 1:case 42:return 48;case 2:case 43:return 49;case 3:case 44:return 50;case 4:case 45:return 51;case 5:case 6:case 8:case 9:case 10:case 11:case 54:case 56:case 62:break;case 7:case 77:return 5;case 12:case 32:return this.pushState("SCALE"),17;case 13:case 33:return 18;case 14:case 20:case 34:case 49:case 52:this.popState();break;case 15:return this.begin("acc_title"),33;case 16:return this.popState(),"acc_title_value";case 17:return this.begin("acc_descr"),35;case 18:return this.popState(),"acc_descr_value";case 19:this.begin("acc_descr_multiline");break;case 21:return"acc_descr_multiline_value";case 22:return this.pushState("CLASSDEF"),38;case 23:return this.popState(),this.pushState("CLASSDEFID"),"DEFAULT_CLASSDEF_ID";case 24:return this.popState(),this.pushState("CLASSDEFID"),39;case 25:return this.popState(),40;case 26:return this.pushState("CLASS"),45;case 27:return this.popState(),this.pushState("CLASS_STYLE"),46;case 28:return this.popState(),47;case 29:return this.pushState("STYLE"),42;case 30:return this.popState(),this.pushState("STYLEDEF_STYLES"),43;case 31:return this.popState(),44;case 35:this.pushState("STATE");break;case 36:case 39:return this.popState(),e.yytext=e.yytext.slice(0,-8).trim(),25;case 37:case 40:return this.popState(),e.yytext=e.yytext.slice(0,-8).trim(),26;case 38:case 41:return this.popState(),e.yytext=e.yytext.slice(0,-10).trim(),27;case 46:this.pushState("STATE_STRING");break;case 47:return this.pushState("STATE_ID"),"AS";case 48:case 64:return this.popState(),"ID";case 50:return"STATE_DESCR";case 51:return 19;case 53:return this.popState(),this.pushState("struct"),20;case 55:return this.popState(),21;case 57:return this.begin("NOTE"),29;case 58:return this.popState(),this.pushState("NOTE_ID"),56;case 59:return this.popState(),this.pushState("NOTE_ID"),57;case 60:this.popState(),this.pushState("FLOATING_NOTE");break;case 61:return this.popState(),this.pushState("FLOATING_NOTE_ID"),"AS";case 63:return"NOTE_TEXT";case 65:return this.popState(),this.pushState("NOTE_TEXT"),24;case 66:return this.popState(),e.yytext=e.yytext.substr(2).trim(),31;case 67:return this.popState(),e.yytext=e.yytext.slice(0,-8).trim(),31;case 68:case 69:return 6;case 70:return 16;case 71:return 54;case 72:return 24;case 73:return e.yytext=e.yytext.trim(),14;case 74:return 15;case 75:return 28;case 76:return 55;case 78:return"INVALID"}}),"anonymous"),rules:[/^(?: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:[9,10],inclusive:!1},struct:{rules:[9,10,22,26,29,35,42,43,44,45,54,55,56,57,71,72,73,74,75],inclusive:!1},FLOATING_NOTE_ID:{rules:[64],inclusive:!1},FLOATING_NOTE:{rules:[61,62,63],inclusive:!1},NOTE_TEXT:{rules:[66,67],inclusive:!1},NOTE_ID:{rules:[65],inclusive:!1},NOTE:{rules:[58,59,60],inclusive:!1},STYLEDEF_STYLEOPTS:{rules:[],inclusive:!1},STYLEDEF_STYLES:{rules:[31],inclusive:!1},STYLE_IDS:{rules:[],inclusive:!1},STYLE:{rules:[30],inclusive:!1},CLASS_STYLE:{rules:[28],inclusive:!1},CLASS:{rules:[27],inclusive:!1},CLASSDEFID:{rules:[25],inclusive:!1},CLASSDEF:{rules:[23,24],inclusive:!1},acc_descr_multiline:{rules:[20,21],inclusive:!1},acc_descr:{rules:[18],inclusive:!1},acc_title:{rules:[16],inclusive:!1},SCALE:{rules:[13,14,33,34],inclusive:!1},ALIAS:{rules:[],inclusive:!1},STATE_ID:{rules:[48],inclusive:!1},STATE_STRING:{rules:[49,50],inclusive:!1},FORK_STATE:{rules:[],inclusive:!1},STATE:{rules:[9,10,36,37,38,39,40,41,46,47,51,52,53],inclusive:!1},ID:{rules:[9,10],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,10,11,12,15,17,19,22,26,29,32,35,53,57,68,69,70,71,72,73,74,76,77,78],inclusive:!0}}};return t}();function D(){this.yy={}}return M.lexer=R,s(D,"Parser"),D.prototype=M,M.Parser=D,new D}();hct.parser=hct;var uct=hct,dct=s(((t,e="TB")=>{if(!t.doc)return e;let n=e;for(const e of t.doc)"dir"===e.stmt&&(n=e.value);return n}),"getDir"),pct=s((function(t,e){return e.db.extract(e.db.getRootDocV2()),e.db.getClasses()}),"getClasses"),gct=s((async function(t,e,n,r){m.info("REF0:"),m.info("Drawing state diagram (v2)",e);const{securityLevel:i,state:a,layout:s}=Hn();r.db.extract(r.db.getRootDocV2());const o=r.db.getData(),l=FH(e,i);o.type=r.type,o.layoutAlgorithm=s,o.nodeSpacing=a?.nodeSpacing||50,o.rankSpacing=a?.rankSpacing||50,o.markers=["barb"],o.diagramId=e,await eA(o,l);yk.insertTitle(l,"statediagramTitleText",a?.titleTopMargin??25,r.db.getDiagramTitle()),zH(l,8,"statediagram",a?.useMaxWidth??!0)}),"draw"),fct={getClasses:pct,draw:gct,getDir:dct},mct=new Map,yct=0;function vct(t="",e=0,n="",r="----"){return`state-${t}${null!==n&&n.length>0?`${r}${n}`:""}-${e}`}s(vct,"stateDomId");var xct=s(((t,e,n,r,i,a,s,o)=>{m.trace("items",e),e.forEach((e=>{switch(e.stmt){case"state":case"default":_ct(t,e,n,r,i,a,s,o);break;case"relation":{_ct(t,e.state1,n,r,i,a,s,o),_ct(t,e.state2,n,r,i,a,s,o);const l={id:"edge"+yct,start:e.state1.id,end:e.state2.id,arrowhead:"normal",arrowTypeEnd:"arrow_barb",style:"fill:none",labelStyle:"",label:_n.sanitizeText(e.description,Hn()),arrowheadStyle:"fill: #333",labelpos:"c",labelType:"text",thickness:"normal",classes:"transition",look:s};i.push(l),yct++}}}))}),"setupDoc"),bct=s(((t,e="TB")=>{let n=e;if(t.doc)for(const e of t.doc)"dir"===e.stmt&&(n=e.value);return n}),"getDir");function wct(t,e,n){if(!e.id||"</join></fork>"===e.id||"</choice>"===e.id)return;e.cssClasses&&(Array.isArray(e.cssCompiledStyles)||(e.cssCompiledStyles=[]),e.cssClasses.split(" ").forEach((t=>{if(n.get(t)){const r=n.get(t);e.cssCompiledStyles=[...e.cssCompiledStyles,...r.styles]}})));const r=t.find((t=>t.id===e.id));r?Object.assign(r,e):t.push(e)}function kct(t){return t?.classes?.join(" ")??""}function Tct(t){return t?.styles??[]}s(wct,"insertOrUpdateNode"),s(kct,"getClassesFromDbInfo"),s(Tct,"getStylesFromDbInfo");var _ct=s(((t,e,n,r,i,a,s,o)=>{const l=e.id,c=n.get(l),h=kct(c),u=Tct(c);if(m.info("dataFetcher parsedItem",e,c,u),"root"!==l){let n="rect";!0===e.start?n="stateStart":!1===e.start&&(n="stateEnd"),"default"!==e.type&&(n=e.type),mct.get(l)||mct.set(l,{id:l,shape:n,description:_n.sanitizeText(l,Hn()),cssClasses:`${h} statediagram-state`,cssStyles:u});const c=mct.get(l);e.description&&(Array.isArray(c.description)?(c.shape="rectWithTitle",c.description.push(e.description)):c.description?.length>0?(c.shape="rectWithTitle",c.description===l?c.description=[e.description]:c.description=[c.description,e.description]):(c.shape="rect",c.description=e.description),c.description=_n.sanitizeTextOrArray(c.description,Hn())),1===c.description?.length&&"rectWithTitle"===c.shape&&("group"===c.type?c.shape="roundedWithTitle":c.shape="rect"),!c.type&&e.doc&&(m.info("Setting cluster for XCX",l,bct(e)),c.type="group",c.isGroup=!0,c.dir=bct(e),c.shape="divider"===e.type?"divider":"roundedWithTitle",c.cssClasses=`${c.cssClasses} statediagram-cluster ${a?"statediagram-cluster-alt":""}`);const d={labelStyle:"",shape:c.shape,label:c.description,cssClasses:c.cssClasses,cssCompiledStyles:[],cssStyles:c.cssStyles,id:l,dir:c.dir,domId:vct(l,yct),type:c.type,isGroup:"group"===c.type,padding:8,rx:10,ry:10,look:s};if("divider"===d.shape&&(d.label=""),t&&"root"!==t.id&&(m.trace("Setting node ",l," to be child of its parent ",t.id),d.parentId=t.id),d.centerLabel=!0,e.note){const t={labelStyle:"",shape:"note",label:e.note.text,cssClasses:"statediagram-note",cssStyles:[],cssCompilesStyles:[],id:l+"----note-"+yct,domId:vct(l,yct,"note"),type:c.type,isGroup:"group"===c.type,padding:Hn().flowchart.padding,look:s,position:e.note.position},n=l+"----parent",a={labelStyle:"",shape:"noteGroup",label:e.note.text,cssClasses:c.cssClasses,cssStyles:[],id:l+"----parent",domId:vct(l,yct,"parent"),type:"group",isGroup:!0,padding:16,look:s,position:e.note.position};yct++,a.id=n,t.parentId=n,wct(r,a,o),wct(r,t,o),wct(r,d,o);let h=l,u=t.id;"left of"===e.note.position&&(h=t.id,u=l),i.push({id:h+"-"+u,start:h,end:u,arrowhead:"none",arrowTypeEnd:"",style:"fill:none",labelStyle:"",classes:"transition note-edge",arrowheadStyle:"fill: #333",labelpos:"c",labelType:"text",thickness:"normal",look:s})}else wct(r,d,o)}e.doc&&(m.trace("Adding nodes children "),xct(e,e.doc,n,r,i,!a,s,o))}),"dataFetcher"),Ect=s((()=>{mct.clear(),yct=0}),"reset");function Cct(){return new Map}s(Cct,"newClassesList");var Sct=[],Act=[],Lct="LR",Nct=[],Ict=Cct(),Mct=s((()=>({relations:[],states:new Map,documents:{}})),"newDoc"),Rct={root:Mct()},Dct=Rct.root,Oct=0,Pct=0,Bct=s((t=>JSON.parse(JSON.stringify(t))),"clone"),$ct=s((t=>{m.info("Setting root doc",t),Nct=t}),"setRootDoc"),Fct=s((()=>Nct),"getRootDoc"),zct=s(((t,e,n)=>{if("relation"===e.stmt)zct(t,e.state1,!0),zct(t,e.state2,!1);else if("state"===e.stmt&&("[*]"===e.id?(e.id=n?t.id+"_start":t.id+"_end",e.start=n):e.id=e.id.trim()),e.doc){const t=[];let n,r=[];for(n=0;n<e.doc.length;n++)if("divider"===e.doc[n].type){const i=Bct(e.doc[n]);i.doc=Bct(r),t.push(i),r=[]}else r.push(e.doc[n]);if(t.length>0&&r.length>0){const n={stmt:"state",id:tk(),type:"divider",doc:Bct(r)};t.push(Bct(n)),e.doc=t}e.doc.forEach((t=>zct(e,t,!0)))}}),"docTranslator"),Uct=s((()=>(zct({id:"root"},{id:"root",doc:Nct},!0),{id:"root",doc:Nct})),"getRootDocV2"),Gct=s((t=>{let e;e=t.doc?t.doc:t,m.info(e),jct(!0),m.info("Extract initial document:",e),e.forEach((t=>{switch(m.warn("Statement",t.stmt),t.stmt){case"state":qct(t.id.trim(),t.type,t.doc,t.description,t.note,t.classes,t.styles,t.textStyles);break;case"relation":eht(t.state1,t.state2,t.description);break;case"classDef":aht(t.id.trim(),t.classes);break;case"style":{const e=t.id.trim().split(","),n=t.styleClass.split(",");e.forEach((t=>{let e=Yct(t);if(void 0===e){const n=t.trim();qct(n),e=Yct(n)}e.styles=n.map((t=>t.replace(/;/g,"")?.trim()))}))}break;case"applyClass":oht(t.id.trim(),t.styleClass)}}));const n=Wct(),r=Hn().look;Ect(),_ct(void 0,Uct(),n,Sct,Act,!0,r,Ict),Sct.forEach((t=>{if(Array.isArray(t.label)){if(t.description=t.label.slice(1),t.isGroup&&t.description.length>0)throw new Error("Group nodes can only have label. Remove the additional description for node ["+t.id+"]");t.label=t.label[0]}}))}),"extract"),qct=s((function(t,e="default",n=null,r=null,i=null,a=null,s=null,o=null){const l=t?.trim();if(Dct.states.has(l)?(Dct.states.get(l).doc||(Dct.states.get(l).doc=n),Dct.states.get(l).type||(Dct.states.get(l).type=e)):(m.info("Adding state ",l,r),Dct.states.set(l,{id:l,descriptions:[],type:e,doc:n,note:i,classes:[],styles:[],textStyles:[]})),r&&(m.info("Setting state description",l,r),"string"==typeof r&&nht(l,r.trim()),"object"==typeof r&&r.forEach((t=>nht(l,t.trim())))),i){const t=Dct.states.get(l);t.note=i,t.note.text=_n.sanitizeText(t.note.text,Hn())}if(a){m.info("Setting state classes",l,a);("string"==typeof a?[a]:a).forEach((t=>oht(l,t.trim())))}if(s){m.info("Setting state styles",l,s);("string"==typeof s?[s]:s).forEach((t=>lht(l,t.trim())))}if(o){m.info("Setting state styles",l,s);("string"==typeof o?[o]:o).forEach((t=>cht(l,t.trim())))}}),"addState"),jct=s((function(t){Sct=[],Act=[],Rct={root:Mct()},Dct=Rct.root,Oct=0,Ict=Cct(),t||$n()}),"clear"),Yct=s((function(t){return Dct.states.get(t)}),"getState"),Wct=s((function(){return Dct.states}),"getStates"),Hct=s((function(){m.info("Documents = ",Rct)}),"logDocuments"),Vct=s((function(){return Dct.relations}),"getRelations");function Xct(t=""){let e=t;return"[*]"===t&&(e=`start${++Oct}`),e}function Kct(t="",e="default"){return"[*]"===t?"start":e}function Zct(t=""){let e=t;return"[*]"===t&&(e=`end${++Oct}`),e}function Qct(t="",e="default"){return"[*]"===t?"end":e}function Jct(t,e,n){let r=Xct(t.id.trim()),i=Kct(t.id.trim(),t.type),a=Xct(e.id.trim()),s=Kct(e.id.trim(),e.type);qct(r,i,t.doc,t.description,t.note,t.classes,t.styles,t.textStyles),qct(a,s,e.doc,e.description,e.note,e.classes,e.styles,e.textStyles),Dct.relations.push({id1:r,id2:a,relationTitle:_n.sanitizeText(n,Hn())})}s(Xct,"startIdIfNeeded"),s(Kct,"startTypeIfNeeded"),s(Zct,"endIdIfNeeded"),s(Qct,"endTypeIfNeeded"),s(Jct,"addRelationObjs");var tht,eht=s((function(t,e,n){if("object"==typeof t)Jct(t,e,n);else{const r=Xct(t.trim()),i=Kct(t),a=Zct(e.trim()),s=Qct(e);qct(r,i),qct(a,s),Dct.relations.push({id1:r,id2:a,title:_n.sanitizeText(n,Hn())})}}),"addRelation"),nht=s((function(t,e){const n=Dct.states.get(t),r=e.startsWith(":")?e.replace(":","").trim():e;n.descriptions.push(_n.sanitizeText(r,Hn()))}),"addDescription"),rht=s((function(t){return":"===t.substring(0,1)?t.substr(2).trim():t.trim()}),"cleanupLabel"),iht=s((()=>"divider-id-"+ ++Pct),"getDividerId"),aht=s((function(t,e=""){Ict.has(t)||Ict.set(t,{id:t,styles:[],textStyles:[]});const n=Ict.get(t);null!=e&&e.split(",").forEach((t=>{const e=t.replace(/([^;]*);/,"$1").trim();if(RegExp("color").exec(t)){const t=e.replace("fill","bgFill").replace("color","fill");n.textStyles.push(t)}n.styles.push(e)}))}),"addStyleClass"),sht=s((function(){return Ict}),"getClasses"),oht=s((function(t,e){t.split(",").forEach((function(t){let n=Yct(t);if(void 0===n){const e=t.trim();qct(e),n=Yct(e)}n.classes.push(e)}))}),"setCssClass"),lht=s((function(t,e){const n=Yct(t);void 0!==n&&n.styles.push(e)}),"setStyle"),cht=s((function(t,e){const n=Yct(t);void 0!==n&&n.textStyles.push(e)}),"setTextStyle"),hht=s((()=>Lct),"getDirection"),uht=s((t=>{Lct=t}),"setDirection"),dht=s((t=>t&&":"===t[0]?t.substr(1).trim():t.trim()),"trimColon"),pht=s((()=>{const t=Hn();return{nodes:Sct,edges:Act,other:{},config:t,direction:dct(Uct())}}),"getData"),ght={getConfig:s((()=>Hn().state),"getConfig"),getData:pht,addState:qct,clear:jct,getState:Yct,getStates:Wct,getRelations:Vct,getClasses:sht,getDirection:hht,addRelation:eht,getDividerId:iht,setDirection:uht,cleanupLabel:rht,lineType:{LINE:0,DOTTED_LINE:1},relationType:{AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3},logDocuments:Hct,getRootDoc:Fct,setRootDoc:$ct,getRootDocV2:Uct,extract:Gct,trimColon:dht,getAccTitle:zn,setAccTitle:Fn,getAccDescription:Gn,setAccDescription:Un,addStyleClass:aht,setCssClass:oht,addDescription:nht,setDiagramTitle:qn,getDiagramTitle:jn},fht=s((t=>`\ndefs #statediagram-barbEnd {\n fill: ${t.transitionColor};\n stroke: ${t.transitionColor};\n }\ng.stateGroup text {\n fill: ${t.nodeBorder};\n stroke: none;\n font-size: 10px;\n}\ng.stateGroup text {\n fill: ${t.textColor};\n stroke: none;\n font-size: 10px;\n\n}\ng.stateGroup .state-title {\n font-weight: bolder;\n fill: ${t.stateLabelColor};\n}\n\ng.stateGroup rect {\n fill: ${t.mainBkg};\n stroke: ${t.nodeBorder};\n}\n\ng.stateGroup line {\n stroke: ${t.lineColor};\n stroke-width: 1;\n}\n\n.transition {\n stroke: ${t.transitionColor};\n stroke-width: 1;\n fill: none;\n}\n\n.stateGroup .composit {\n fill: ${t.background};\n border-bottom: 1px\n}\n\n.stateGroup .alt-composit {\n fill: #e0e0e0;\n border-bottom: 1px\n}\n\n.state-note {\n stroke: ${t.noteBorderColor};\n fill: ${t.noteBkgColor};\n\n text {\n fill: ${t.noteTextColor};\n stroke: none;\n font-size: 10px;\n }\n}\n\n.stateLabel .box {\n stroke: none;\n stroke-width: 0;\n fill: ${t.mainBkg};\n opacity: 0.5;\n}\n\n.edgeLabel .label rect {\n fill: ${t.labelBackgroundColor};\n opacity: 0.5;\n}\n.edgeLabel {\n background-color: ${t.edgeLabelBackground};\n p {\n background-color: ${t.edgeLabelBackground};\n }\n rect {\n opacity: 0.5;\n background-color: ${t.edgeLabelBackground};\n fill: ${t.edgeLabelBackground};\n }\n text-align: center;\n}\n.edgeLabel .label text {\n fill: ${t.transitionLabelColor||t.tertiaryTextColor};\n}\n.label div .edgeLabel {\n color: ${t.transitionLabelColor||t.tertiaryTextColor};\n}\n\n.stateLabel text {\n fill: ${t.stateLabelColor};\n font-size: 10px;\n font-weight: bold;\n}\n\n.node circle.state-start {\n fill: ${t.specialStateColor};\n stroke: ${t.specialStateColor};\n}\n\n.node .fork-join {\n fill: ${t.specialStateColor};\n stroke: ${t.specialStateColor};\n}\n\n.node circle.state-end {\n fill: ${t.innerEndBackground};\n stroke: ${t.background};\n stroke-width: 1.5\n}\n.end-state-inner {\n fill: ${t.compositeBackground||t.background};\n // stroke: ${t.background};\n stroke-width: 1.5\n}\n\n.node rect {\n fill: ${t.stateBkg||t.mainBkg};\n stroke: ${t.stateBorder||t.nodeBorder};\n stroke-width: 1px;\n}\n.node polygon {\n fill: ${t.mainBkg};\n stroke: ${t.stateBorder||t.nodeBorder};;\n stroke-width: 1px;\n}\n#statediagram-barbEnd {\n fill: ${t.lineColor};\n}\n\n.statediagram-cluster rect {\n fill: ${t.compositeTitleBackground};\n stroke: ${t.stateBorder||t.nodeBorder};\n stroke-width: 1px;\n}\n\n.cluster-label, .nodeLabel {\n color: ${t.stateLabelColor};\n // line-height: 1;\n}\n\n.statediagram-cluster rect.outer {\n rx: 5px;\n ry: 5px;\n}\n.statediagram-state .divider {\n stroke: ${t.stateBorder||t.nodeBorder};\n}\n\n.statediagram-state .title-state {\n rx: 5px;\n ry: 5px;\n}\n.statediagram-cluster.statediagram-cluster .inner {\n fill: ${t.compositeBackground||t.background};\n}\n.statediagram-cluster.statediagram-cluster-alt .inner {\n fill: ${t.altBackground?t.altBackground:"#efefef"};\n}\n\n.statediagram-cluster .inner {\n rx:0;\n ry:0;\n}\n\n.statediagram-state rect.basic {\n rx: 5px;\n ry: 5px;\n}\n.statediagram-state rect.divider {\n stroke-dasharray: 10,10;\n fill: ${t.altBackground?t.altBackground:"#efefef"};\n}\n\n.note-edge {\n stroke-dasharray: 5;\n}\n\n.statediagram-note rect {\n fill: ${t.noteBkgColor};\n stroke: ${t.noteBorderColor};\n stroke-width: 1px;\n rx: 0;\n ry: 0;\n}\n.statediagram-note rect {\n fill: ${t.noteBkgColor};\n stroke: ${t.noteBorderColor};\n stroke-width: 1px;\n rx: 0;\n ry: 0;\n}\n\n.statediagram-note text {\n fill: ${t.noteTextColor};\n}\n\n.statediagram-note .nodeLabel {\n color: ${t.noteTextColor};\n}\n.statediagram .edgeLabel {\n color: red; // ${t.noteTextColor};\n}\n\n#dependencyStart, #dependencyEnd {\n fill: ${t.lineColor};\n stroke: ${t.lineColor};\n stroke-width: 1;\n}\n\n.statediagramTitleText {\n text-anchor: middle;\n font-size: 18px;\n fill: ${t.textColor};\n}\n`),"getStyles"),mht={},yht=s(((t,e)=>{mht[t]=e}),"set"),vht=s((t=>mht[t]),"get"),xht=s((()=>Object.keys(mht)),"keys"),bht=s((()=>xht().length),"size"),wht={get:vht,set:yht,keys:xht,size:bht},kht=s((t=>t.append("circle").attr("class","start-state").attr("r",Hn().state.sizeUnit).attr("cx",Hn().state.padding+Hn().state.sizeUnit).attr("cy",Hn().state.padding+Hn().state.sizeUnit)),"drawStartState"),Tht=s((t=>t.append("line").style("stroke","grey").style("stroke-dasharray","3").attr("x1",Hn().state.textHeight).attr("class","divider").attr("x2",2*Hn().state.textHeight).attr("y1",0).attr("y2",0)),"drawDivider"),_ht=s(((t,e)=>{const n=t.append("text").attr("x",2*Hn().state.padding).attr("y",Hn().state.textHeight+2*Hn().state.padding).attr("font-size",Hn().state.fontSize).attr("class","state-title").text(e.id),r=n.node().getBBox();return t.insert("rect",":first-child").attr("x",Hn().state.padding).attr("y",Hn().state.padding).attr("width",r.width+2*Hn().state.padding).attr("height",r.height+2*Hn().state.padding).attr("rx",Hn().state.radius),n}),"drawSimpleState"),Eht=s(((t,e)=>{const n=s((function(t,e,n){const r=t.append("tspan").attr("x",2*Hn().state.padding).text(e);n||r.attr("dy",Hn().state.textHeight)}),"addTspan"),r=t.append("text").attr("x",2*Hn().state.padding).attr("y",Hn().state.textHeight+1.3*Hn().state.padding).attr("font-size",Hn().state.fontSize).attr("class","state-title").text(e.descriptions[0]).node().getBBox(),i=r.height,a=t.append("text").attr("x",Hn().state.padding).attr("y",i+.4*Hn().state.padding+Hn().state.dividerMargin+Hn().state.textHeight).attr("class","state-description");let o=!0,l=!0;e.descriptions.forEach((function(t){o||(n(a,t,l),l=!1),o=!1}));const c=t.append("line").attr("x1",Hn().state.padding).attr("y1",Hn().state.padding+i+Hn().state.dividerMargin/2).attr("y2",Hn().state.padding+i+Hn().state.dividerMargin/2).attr("class","descr-divider"),h=a.node().getBBox(),u=Math.max(h.width,r.width);return c.attr("x2",u+3*Hn().state.padding),t.insert("rect",":first-child").attr("x",Hn().state.padding).attr("y",Hn().state.padding).attr("width",u+2*Hn().state.padding).attr("height",h.height+i+2*Hn().state.padding).attr("rx",Hn().state.radius),t}),"drawDescrState"),Cht=s(((t,e,n)=>{const r=Hn().state.padding,i=2*Hn().state.padding,a=t.node().getBBox(),s=a.width,o=a.x,l=t.append("text").attr("x",0).attr("y",Hn().state.titleShift).attr("font-size",Hn().state.fontSize).attr("class","state-title").text(e.id),c=l.node().getBBox().width+i;let h,u=Math.max(c,s);u===s&&(u+=i);const d=t.node().getBBox();e.doc,h=o-r,c>s&&(h=(s-u)/2+r),Math.abs(o-d.x)<r&&c>s&&(h=o-(c-s)/2);const p=1-Hn().state.textHeight;return t.insert("rect",":first-child").attr("x",h).attr("y",p).attr("class",n?"alt-composit":"composit").attr("width",u).attr("height",d.height+Hn().state.textHeight+Hn().state.titleShift+1).attr("rx","0"),l.attr("x",h+r),c<=s&&l.attr("x",o+(u-i)/2-c/2+r),t.insert("rect",":first-child").attr("x",h).attr("y",Hn().state.titleShift-Hn().state.textHeight-Hn().state.padding).attr("width",u).attr("height",3*Hn().state.textHeight).attr("rx",Hn().state.radius),t.insert("rect",":first-child").attr("x",h).attr("y",Hn().state.titleShift-Hn().state.textHeight-Hn().state.padding).attr("width",u).attr("height",d.height+3+2*Hn().state.textHeight).attr("rx",Hn().state.radius),t}),"addTitleAndBox"),Sht=s((t=>(t.append("circle").attr("class","end-state-outer").attr("r",Hn().state.sizeUnit+Hn().state.miniPadding).attr("cx",Hn().state.padding+Hn().state.sizeUnit+Hn().state.miniPadding).attr("cy",Hn().state.padding+Hn().state.sizeUnit+Hn().state.miniPadding),t.append("circle").attr("class","end-state-inner").attr("r",Hn().state.sizeUnit).attr("cx",Hn().state.padding+Hn().state.sizeUnit+2).attr("cy",Hn().state.padding+Hn().state.sizeUnit+2))),"drawEndState"),Aht=s(((t,e)=>{let n=Hn().state.forkWidth,r=Hn().state.forkHeight;if(e.parentId){let t=n;n=r,r=t}return t.append("rect").style("stroke","black").style("fill","black").attr("width",n).attr("height",r).attr("x",Hn().state.padding).attr("y",Hn().state.padding)}),"drawForkJoinState"),Lht=s(((t,e,n,r)=>{let i=0;const a=r.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(_n.lineBreakRegex);let l=1.25*Hn().state.noteMargin;for(const t of o){const r=t.trim();if(r.length>0){const t=a.append("tspan");if(t.text(r),0===l){l+=t.node().getBBox().height}i+=l,t.attr("x",e+Hn().state.noteMargin),t.attr("y",n+i+1.25*Hn().state.noteMargin)}}return{textWidth:a.node().getBBox().width,textHeight:i}}),"_drawLongText"),Nht=s(((t,e)=>{e.attr("class","state-note");const n=e.append("rect").attr("x",0).attr("y",Hn().state.padding),r=e.append("g"),{textWidth:i,textHeight:a}=Lht(t,0,0,r);return n.attr("height",a+2*Hn().state.noteMargin),n.attr("width",i+2*Hn().state.noteMargin),n}),"drawNote"),Iht=s((function(t,e){const n=e.id,r={id:n,label:e.id,width:0,height:0},i=t.append("g").attr("id",n).attr("class","stateGroup");"start"===e.type&&kht(i),"end"===e.type&&Sht(i),"fork"!==e.type&&"join"!==e.type||Aht(i,e),"note"===e.type&&Nht(e.note.text,i),"divider"===e.type&&Tht(i),"default"===e.type&&0===e.descriptions.length&&_ht(i,e),"default"===e.type&&e.descriptions.length>0&&Eht(i,e);const a=i.node().getBBox();return r.width=a.width+2*Hn().state.padding,r.height=a.height+2*Hn().state.padding,wht.set(n,r),r}),"drawState"),Mht=0,Rht=s((function(t,e,n){const r=s((function(t){switch(t){case ght.relationType.AGGREGATION:return"aggregation";case ght.relationType.EXTENSION:return"extension";case ght.relationType.COMPOSITION:return"composition";case ght.relationType.DEPENDENCY:return"dependency"}}),"getRelationType");e.points=e.points.filter((t=>!Number.isNaN(t.y)));const i=e.points,a=Xh().x((function(t){return t.x})).y((function(t){return t.y})).curve(iu),o=t.append("path").attr("d",a(i)).attr("id","edge"+Mht).attr("class","transition");let l="";if(Hn().state.arrowMarkerAbsolute&&(l=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,l=l.replace(/\(/g,"\\("),l=l.replace(/\)/g,"\\)")),o.attr("marker-end","url("+l+"#"+r(ght.relationType.DEPENDENCY)+"End)"),void 0!==n.title){const r=t.append("g").attr("class","stateLabel"),{x:i,y:a}=yk.calcLabelPosition(e.points),s=_n.getRows(n.title);let o=0;const l=[];let c=0,h=0;for(let t=0;t<=s.length;t++){const e=r.append("text").attr("text-anchor","middle").text(s[t]).attr("x",i).attr("y",a+o),n=e.node().getBBox();if(c=Math.max(c,n.width),h=Math.min(h,n.x),m.info(n.x,i,a+o),0===o){const t=e.node().getBBox();o=t.height,m.info("Title height",o,a)}l.push(e)}let u=o*s.length;if(s.length>1){const t=(s.length-1)*o*.5;l.forEach(((e,n)=>e.attr("y",a+n*o-t))),u=o*s.length}const d=r.node().getBBox();r.insert("rect",":first-child").attr("class","box").attr("x",i-c/2-Hn().state.padding/2).attr("y",a-u/2-Hn().state.padding/2-3.5).attr("width",c+Hn().state.padding).attr("height",u+Hn().state.padding),m.info(d)}Mht++}),"drawEdge"),Dht={},Oht=s((function(){}),"setConf"),Pht=s((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"),Bht=s((function(t,e,n,r){tht=Hn().state;const i=Hn().securityLevel;let a;"sandbox"===i&&(a=Oa("#i"+e));const s=Oa("sandbox"===i?a.nodes()[0].contentDocument.body:"body"),o="sandbox"===i?a.nodes()[0].contentDocument:document;m.debug("Rendering diagram "+t);const l=s.select(`[id='${e}']`);Pht(l);const c=r.db.getRootDoc();Fht(c,l,void 0,!1,s,o,r);const h=tht.padding,u=l.node().getBBox(),d=u.width+2*h,p=u.height+2*h;Sn(l,p,1.75*d,tht.useMaxWidth),l.attr("viewBox",`${u.x-tht.padding} ${u.y-tht.padding} `+d+" "+p)}),"draw"),$ht=s((t=>t?t.length*tht.fontSizeFactor:1),"getLabelWidth"),Fht=s(((t,e,n,r,i,a,s)=>{const o=new nq({compound:!0,multigraph:!0});let l,c=!0;for(l=0;l<t.length;l++)if("relation"===t[l].stmt){c=!1;break}n?o.setGraph({rankdir:"LR",multigraph:!0,compound:!0,ranker:"tight-tree",ranksep:c?1:tht.edgeLengthFactor,nodeSep:c?1:50,isMultiGraph:!0}):o.setGraph({rankdir:"TB",multigraph:!0,compound:!0,ranksep:c?1:tht.edgeLengthFactor,nodeSep:c?1:50,ranker:"tight-tree",isMultiGraph:!0}),o.setDefaultEdgeLabel((function(){return{}})),s.db.extract(t);const h=s.db.getStates(),u=s.db.getRelations(),d=Object.keys(h);for(const t of d){const l=h[t];let c;if(n&&(l.parentId=n),l.doc){let t=e.append("g").attr("id",l.id).attr("class","stateGroup");c=Fht(l.doc,t,l.id,!r,i,a,s);{t=Cht(t,l,r);let e=t.node().getBBox();c.width=e.width,c.height=e.height+tht.padding/2,Dht[l.id]={y:tht.compositTitleSize}}}else c=Iht(e,l,o);if(l.note){const t={descriptions:[],id:l.id+"-note",note:l.note,type:"note"},n=Iht(e,t,o);"left of"===l.note.position?(o.setNode(c.id+"-note",n),o.setNode(c.id,c)):(o.setNode(c.id,c),o.setNode(c.id+"-note",n)),o.setParent(c.id,c.id+"-group"),o.setParent(c.id+"-note",c.id+"-group")}else o.setNode(c.id,c)}m.debug("Count=",o.nodeCount(),o);let p=0;u.forEach((function(t){p++,m.debug("Setting edge",t),o.setEdge(t.id1,t.id2,{relation:t,width:$ht(t.title),height:tht.labelHeight*_n.getRows(t.title).length,labelpos:"c"},"id"+p)})),cY(o),m.debug("Graph after layout",o.nodes());const g=e.node();o.nodes().forEach((function(t){if(void 0!==t&&void 0!==o.node(t)){m.warn("Node "+t+": "+JSON.stringify(o.node(t))),i.select("#"+g.id+" #"+t).attr("transform","translate("+(o.node(t).x-o.node(t).width/2)+","+(o.node(t).y+(Dht[t]?Dht[t].y:0)-o.node(t).height/2)+" )"),i.select("#"+g.id+" #"+t).attr("data-x-shift",o.node(t).x-o.node(t).width/2);a.querySelectorAll("#"+g.id+" #"+t+" .divider").forEach((t=>{const e=t.parentElement;let n=0,r=0;e&&(e.parentElement&&(n=e.parentElement.getBBox().width),r=parseInt(e.getAttribute("data-x-shift"),10),Number.isNaN(r)&&(r=0)),t.setAttribute("x1",0-r+8),t.setAttribute("x2",n-r-8)}))}else m.debug("No Node "+t+": "+JSON.stringify(o.node(t)))}));let f=g.getBBox();o.edges().forEach((function(t){void 0!==t&&void 0!==o.edge(t)&&(m.debug("Edge "+t.v+" -> "+t.w+": "+JSON.stringify(o.edge(t))),Rht(e,o.edge(t),o.edge(t).relation))})),f=g.getBBox();const y={id:n||"root",label:n||"root",width:0,height:0};return y.width=f.width+2*tht.padding,y.height=f.height+2*tht.padding,m.debug("Doc rendered",y,o),y}),"renderDoc"),zht={parser:uct,db:ght,renderer:{setConf:Oht,draw:Bht},styles:fht,init:s((t=>{t.state||(t.state={}),t.state.arrowMarkerAbsolute=t.arrowMarkerAbsolute,ght.clear()}),"init")},Uht=Object.freeze({__proto__:null,diagram:zht}),Ght={parser:uct,db:ght,renderer:fct,styles:fht,init:s((t=>{t.state||(t.state={}),t.state.arrowMarkerAbsolute=t.arrowMarkerAbsolute,ght.clear()}),"init")},qht=Object.freeze({__proto__:null,diagram:Ght}),jht=function(){var t=s((function(t,e,n,r){for(n=n||{},r=t.length;r--;n[t[r]]=e);return n}),"o"),e=[6,8,10,11,12,14,16,17,18],n=[1,9],r=[1,10],i=[1,11],a=[1,12],o=[1,13],l=[1,14],c={trace:s((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:s((function(t,e,n,r,i,a,s){var o=a.length-1;switch(i){case 1:return a[o-1];case 2:case 6:case 7:this.$=[];break;case 3:a[o-1].push(a[o]),this.$=a[o-1];break;case 4:case 5:this.$=a[o];break;case 8:r.setDiagramTitle(a[o].substr(6)),this.$=a[o].substr(6);break;case 9:this.$=a[o].trim(),r.setAccTitle(this.$);break;case 10:case 11:this.$=a[o].trim(),r.setAccDescription(this.$);break;case 12:r.addSection(a[o].substr(8)),this.$=a[o].substr(8);break;case 13:r.addTask(a[o-1],a[o]),this.$="task"}}),"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:n,12:r,14:i,16:a,17:o,18:l},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:15,11:n,12:r,14:i,16:a,17:o,18:l},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:s((function(t,e){if(!e.recoverable){var n=new Error(t);throw n.hash=e,n}this.trace(t)}),"parseError"),parse:s((function(t){var e=this,n=[0],r=[],i=[null],a=[],o=this.table,l="",c=0,h=0,u=2,d=1,p=a.slice.call(arguments,1),g=Object.create(this.lexer),f={yy:{}};for(var m in this.yy)Object.prototype.hasOwnProperty.call(this.yy,m)&&(f.yy[m]=this.yy[m]);g.setInput(t,f.yy),f.yy.lexer=g,f.yy.parser=this,void 0===g.yylloc&&(g.yylloc={});var y=g.yylloc;a.push(y);var v=g.options&&g.options.ranges;function x(t){n.length=n.length-2*t,i.length=i.length-t,a.length=a.length-t}function b(){var t;return"number"!=typeof(t=r.pop()||g.lex()||d)&&(t instanceof Array&&(t=(r=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof f.yy.parseError?this.parseError=f.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,s(x,"popStack"),s(b,"lex");for(var w,k,T,_,E,C,S,A,L={};;){if(k=n[n.length-1],this.defaultActions[k]?T=this.defaultActions[k]:(null==w&&(w=b()),T=o[k]&&o[k][w]),void 0===T||!T.length||!T[0]){var N="";for(E in A=[],o[k])this.terminals_[E]&&E>u&&A.push("'"+this.terminals_[E]+"'");N=g.showPosition?"Parse error on line "+(c+1)+":\n"+g.showPosition()+"\nExpecting "+A.join(", ")+", got '"+(this.terminals_[w]||w)+"'":"Parse error on line "+(c+1)+": Unexpected "+(w==d?"end of input":"'"+(this.terminals_[w]||w)+"'"),this.parseError(N,{text:g.match,token:this.terminals_[w]||w,line:g.yylineno,loc:y,expected:A})}if(T[0]instanceof Array&&T.length>1)throw new Error("Parse Error: multiple actions possible at state: "+k+", token: "+w);switch(T[0]){case 1:n.push(w),i.push(g.yytext),a.push(g.yylloc),n.push(T[1]),w=null,h=g.yyleng,l=g.yytext,c=g.yylineno,y=g.yylloc;break;case 2:if(C=this.productions_[T[1]][1],L.$=i[i.length-C],L._$={first_line:a[a.length-(C||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(C||1)].first_column,last_column:a[a.length-1].last_column},v&&(L._$.range=[a[a.length-(C||1)].range[0],a[a.length-1].range[1]]),void 0!==(_=this.performAction.apply(L,[l,h,c,f.yy,T[1],i,a].concat(p))))return _;C&&(n=n.slice(0,-1*C*2),i=i.slice(0,-1*C),a=a.slice(0,-1*C)),n.push(this.productions_[T[1]][0]),i.push(L.$),a.push(L._$),S=o[n[n.length-2]][n[n.length-1]],n.push(S);break;case 3:return!0}}return!0}),"parse")},h=function(){var t={EOF:1,parseError:s((function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)}),"parseError"),setInput:s((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:s((function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(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:s((function(t){var e=t.length,n=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 r=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 i=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===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this}),"unput"),more:s((function(){return this._more=!0,this}),"more"),reject:s((function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):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).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}),"reject"),less:s((function(t){this.unput(this.match.slice(t))}),"less"),pastInput:s((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:s((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:s((function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"}),"showPosition"),test_match:s((function(t,e){var n,r,i;if(this.options.backtrack_lexer&&(i={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&&(i.yylloc.range=this.yylloc.range.slice(0))),(r=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.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],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1}),"test_match"),next:s((function(){if(this.done)return this.EOF;var t,e,n,r;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;a<i.length;a++)if((n=this._input.match(this.rules[i[a]]))&&(!e||n[0].length>e[0].length)){if(e=n,r=a,this.options.backtrack_lexer){if(!1!==(t=this.test_match(n,i[a])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,i[r]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}),"next"),lex:s((function(){var t=this.next();return t||this.lex()}),"lex"),begin:s((function(t){this.conditionStack.push(t)}),"begin"),popState:s((function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]}),"popState"),_currentRules:s((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:s((function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"}),"topState"),pushState:s((function(t){this.begin(t)}),"pushState"),stateStackSize:s((function(){return this.conditionStack.length}),"stateStackSize"),options:{"case-insensitive":!0},performAction:s((function(t,e,n,r){switch(n){case 0:case 1:case 3:case 4:break;case 2:return 10;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 t}();function u(){this.yy={}}return c.lexer=h,s(u,"Parser"),u.prototype=c,c.Parser=u,new u}();jht.parser=jht;var Yht=jht,Wht="",Hht=[],Vht=[],Xht=[],Kht=s((function(){Hht.length=0,Vht.length=0,Wht="",Xht.length=0,$n()}),"clear"),Zht=s((function(t){Wht=t,Hht.push(t)}),"addSection"),Qht=s((function(){return Hht}),"getSections"),Jht=s((function(){let t=rut();let e=0;for(;!t&&e<100;)t=rut(),e++;return Vht.push(...Xht),Vht}),"getTasks"),tut=s((function(){const t=[];Vht.forEach((e=>{e.people&&t.push(...e.people)}));return[...new Set(t)].sort()}),"updateActors"),eut=s((function(t,e){const n=e.substr(1).split(":");let r=0,i=[];1===n.length?(r=Number(n[0]),i=[]):(r=Number(n[0]),i=n[1].split(","));const a=i.map((t=>t.trim())),s={section:Wht,type:Wht,people:a,task:t,score:r};Xht.push(s)}),"addTask"),nut=s((function(t){const e={section:Wht,type:Wht,description:t,task:t,classes:[]};Vht.push(e)}),"addTaskOrg"),rut=s((function(){const t=s((function(t){return Xht[t].processed}),"compileTask");let e=!0;for(const[n,r]of Xht.entries())t(n),e=e&&r.processed;return e}),"compileTasks"),iut=s((function(){return tut()}),"getActors"),aut={getConfig:s((()=>Hn().journey),"getConfig"),clear:Kht,setDiagramTitle:qn,getDiagramTitle:jn,setAccTitle:Fn,getAccTitle:zn,setAccDescription:Un,getAccDescription:Gn,addSection:Zht,getSections:Qht,getTasks:Jht,addTask:eut,addTaskOrg:nut,getActors:iut},sut=s((t=>`.label {\n font-family: 'trebuchet ms', verdana, arial, sans-serif;\n font-family: var(--mermaid-font-family);\n color: ${t.textColor};\n }\n .mouth {\n stroke: #666;\n }\n\n line {\n stroke: ${t.textColor}\n }\n\n .legend {\n fill: ${t.textColor};\n }\n\n .label text {\n fill: #333;\n }\n .label {\n color: ${t.textColor}\n }\n\n .face {\n ${t.faceColor?`fill: ${t.faceColor}`:"fill: #FFF8DC"};\n stroke: #999;\n }\n\n .node rect,\n .node circle,\n .node ellipse,\n .node polygon,\n .node path {\n fill: ${t.mainBkg};\n stroke: ${t.nodeBorder};\n stroke-width: 1px;\n }\n\n .node .label {\n text-align: center;\n }\n .node.clickable {\n cursor: pointer;\n }\n\n .arrowheadPath {\n fill: ${t.arrowheadColor};\n }\n\n .edgePath .path {\n stroke: ${t.lineColor};\n stroke-width: 1.5px;\n }\n\n .flowchart-link {\n stroke: ${t.lineColor};\n fill: none;\n }\n\n .edgeLabel {\n background-color: ${t.edgeLabelBackground};\n rect {\n opacity: 0.5;\n }\n text-align: center;\n }\n\n .cluster rect {\n }\n\n .cluster text {\n fill: ${t.titleColor};\n }\n\n div.mermaidTooltip {\n position: absolute;\n text-align: center;\n max-width: 200px;\n padding: 2px;\n font-family: 'trebuchet ms', verdana, arial, sans-serif;\n font-family: var(--mermaid-font-family);\n font-size: 12px;\n background: ${t.tertiaryColor};\n border: 1px solid ${t.border2};\n border-radius: 2px;\n pointer-events: none;\n z-index: 100;\n }\n\n .task-type-0, .section-type-0 {\n ${t.fillType0?`fill: ${t.fillType0}`:""};\n }\n .task-type-1, .section-type-1 {\n ${t.fillType0?`fill: ${t.fillType1}`:""};\n }\n .task-type-2, .section-type-2 {\n ${t.fillType0?`fill: ${t.fillType2}`:""};\n }\n .task-type-3, .section-type-3 {\n ${t.fillType0?`fill: ${t.fillType3}`:""};\n }\n .task-type-4, .section-type-4 {\n ${t.fillType0?`fill: ${t.fillType4}`:""};\n }\n .task-type-5, .section-type-5 {\n ${t.fillType0?`fill: ${t.fillType5}`:""};\n }\n .task-type-6, .section-type-6 {\n ${t.fillType0?`fill: ${t.fillType6}`:""};\n }\n .task-type-7, .section-type-7 {\n ${t.fillType0?`fill: ${t.fillType7}`:""};\n }\n\n .actor-0 {\n ${t.actor0?`fill: ${t.actor0}`:""};\n }\n .actor-1 {\n ${t.actor1?`fill: ${t.actor1}`:""};\n }\n .actor-2 {\n ${t.actor2?`fill: ${t.actor2}`:""};\n }\n .actor-3 {\n ${t.actor3?`fill: ${t.actor3}`:""};\n }\n .actor-4 {\n ${t.actor4?`fill: ${t.actor4}`:""};\n }\n .actor-5 {\n ${t.actor5?`fill: ${t.actor5}`:""};\n }\n`),"getStyles"),out=s((function(t,e){return rW(t,e)}),"drawRect"),lut=s((function(t,e){const n=15,r=t.append("circle").attr("cx",e.cx).attr("cy",e.cy).attr("class","face").attr("r",n).attr("stroke-width",2).attr("overflow","visible"),i=t.append("g");function a(t){const r=qh().startAngle(Math.PI/2).endAngle(Math.PI/2*3).innerRadius(7.5).outerRadius(n/2.2);t.append("path").attr("class","mouth").attr("d",r).attr("transform","translate("+e.cx+","+(e.cy+2)+")")}function o(t){const r=qh().startAngle(3*Math.PI/2).endAngle(Math.PI/2*5).innerRadius(7.5).outerRadius(n/2.2);t.append("path").attr("class","mouth").attr("d",r).attr("transform","translate("+e.cx+","+(e.cy+7)+")")}function l(t){t.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 i.append("circle").attr("cx",e.cx-5).attr("cy",e.cy-5).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),i.append("circle").attr("cx",e.cx+5).attr("cy",e.cy-5).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),s(a,"smile"),s(o,"sad"),s(l,"ambivalent"),e.score>3?a(i):e.score<3?o(i):l(i),r}),"drawFace"),cut=s((function(t,e){const n=t.append("circle");return n.attr("cx",e.cx),n.attr("cy",e.cy),n.attr("class","actor-"+e.pos),n.attr("fill",e.fill),n.attr("stroke",e.stroke),n.attr("r",e.r),void 0!==n.class&&n.attr("class",n.class),void 0!==e.title&&n.append("title").text(e.title),n}),"drawCircle"),hut=s((function(t,e){return aW(t,e)}),"drawText"),uut=s((function(t,e){function n(t,e,n,r,i){return t+","+e+" "+(t+n)+","+e+" "+(t+n)+","+(e+r-i)+" "+(t+n-1.2*i)+","+(e+r)+" "+t+","+(e+r)}s(n,"genPoints");const r=t.append("polygon");r.attr("points",n(e.x,e.y,50,20,7)),r.attr("class","labelBox"),e.y=e.y+e.labelMargin,e.x=e.x+.5*e.labelMargin,hut(t,e)}),"drawLabel"),dut=s((function(t,e,n){const r=t.append("g"),i=lW();i.x=e.x,i.y=e.y,i.fill=e.fill,i.width=n.width*e.taskCount+n.diagramMarginX*(e.taskCount-1),i.height=n.height,i.class="journey-section section-type-"+e.num,i.rx=3,i.ry=3,out(r,i),mut(n)(e.text,r,i.x,i.y,i.width,i.height,{class:"journey-section section-type-"+e.num},n,e.colour)}),"drawSection"),put=-1,gut=s((function(t,e,n){const r=e.x+n.width/2,i=t.append("g");put++;i.append("line").attr("id","task"+put).attr("x1",r).attr("y1",e.y).attr("x2",r).attr("y2",450).attr("class","task-line").attr("stroke-width","1px").attr("stroke-dasharray","4 2").attr("stroke","#666"),lut(i,{cx:r,cy:300+30*(5-e.score),score:e.score});const a=lW();a.x=e.x,a.y=e.y,a.fill=e.fill,a.width=n.width,a.height=n.height,a.class="task task-type-"+e.num,a.rx=3,a.ry=3,out(i,a);let s=e.x+14;e.people.forEach((t=>{const n=e.actors[t].color,r={cx:s,cy:e.y,r:7,fill:n,stroke:"#000",title:t,pos:e.actors[t].position};cut(i,r),s+=10})),mut(n)(e.task,i,a.x,a.y,a.width,a.height,{class:"task"},n,e.colour)}),"drawTask"),fut=s((function(t,e){iW(t,e)}),"drawBackgroundRect"),mut=function(){function t(t,e,n,i,a,s,o,l){r(e.append("text").attr("x",n+a/2).attr("y",i+s/2+5).style("font-color",l).style("text-anchor","middle").text(t),o)}function e(t,e,n,i,a,s,o,l,c){const{taskFontSize:h,taskFontFamily:u}=l,d=t.split(/<br\s*\/?>/gi);for(let t=0;t<d.length;t++){const l=t*h-h*(d.length-1)/2,p=e.append("text").attr("x",n+a/2).attr("y",i).attr("fill",c).style("text-anchor","middle").style("font-size",h).style("font-family",u);p.append("tspan").attr("x",n+a/2).attr("dy",l).text(d[t]),p.attr("y",i+s/2).attr("dominant-baseline","central").attr("alignment-baseline","central"),r(p,o)}}function n(t,n,i,a,s,o,l,c){const h=n.append("switch"),u=h.append("foreignObject").attr("x",i).attr("y",a).attr("width",s).attr("height",o).attr("position","fixed").append("xhtml:div").style("display","table").style("height","100%").style("width","100%");u.append("div").attr("class","label").style("display","table-cell").style("text-align","center").style("vertical-align","middle").text(t),e(t,h,i,a,s,o,l,c),r(u,l)}function r(t,e){for(const n in e)n in e&&t.attr(n,e[n])}return s(t,"byText"),s(e,"byTspan"),s(n,"byFo"),s(r,"_setTextAttrs"),function(r){return"fo"===r.textPlacement?n:"old"===r.textPlacement?t:e}}(),yut={drawRect:out,drawCircle:cut,drawSection:dut,drawText:hut,drawLabel:uut,drawTask:gut,drawBackgroundRect:fut,initGraphics:s((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")},vut=s((function(t){Object.keys(t).forEach((function(e){wut[e]=t[e]}))}),"setConf"),xut={};function but(t){const e=Hn().journey;let n=60;Object.keys(xut).forEach((r=>{const i=xut[r].color,a={cx:20,cy:n,r:7,fill:i,stroke:"#000",pos:xut[r].position};yut.drawCircle(t,a);const s={x:40,y:n+7,fill:"#666",text:r,textMargin:5|e.boxTextMargin};yut.drawText(t,s),n+=20}))}s(but,"drawActorLegend");var wut=Hn().journey,kut=wut.leftMargin,Tut=s((function(t,e,n,r){const i=Hn().journey,a=Hn().securityLevel;let s;"sandbox"===a&&(s=Oa("#i"+e));const o=Oa("sandbox"===a?s.nodes()[0].contentDocument.body:"body");_ut.init();const l=o.select("#"+e);yut.initGraphics(l);const c=r.db.getTasks(),h=r.db.getDiagramTitle(),u=r.db.getActors();for(const t in xut)delete xut[t];let d=0;u.forEach((t=>{xut[t]={color:i.actorColours[d%i.actorColours.length],position:d},d++})),but(l),_ut.insert(0,0,kut,50*Object.keys(xut).length),Sut(l,c,0);const p=_ut.getBounds();h&&l.append("text").text(h).attr("x",kut).attr("font-size","4ex").attr("font-weight","bold").attr("y",25);const g=p.stopy-p.starty+2*i.diagramMarginY,f=kut+p.stopx+2*i.diagramMarginX;Sn(l,g,f,i.useMaxWidth),l.append("line").attr("x1",kut).attr("y1",4*i.height).attr("x2",f-kut-4).attr("y2",4*i.height).attr("stroke-width",4).attr("stroke","black").attr("marker-end","url(#arrowhead)");const m=h?70:0;l.attr("viewBox",`${p.startx} -25 ${f} ${g+m}`),l.attr("preserveAspectRatio","xMinYMin meet"),l.attr("height",g+m+25)}),"draw"),_ut={data:{startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},verticalPos:0,sequenceItems:[],init:s((function(){this.sequenceItems=[],this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},this.verticalPos=0}),"init"),updateVal:s((function(t,e,n,r){void 0===t[e]?t[e]=n:t[e]=r(n,t[e])}),"updateVal"),updateBounds:s((function(t,e,n,r){const i=Hn().journey,a=this;let o=0;function l(l){return s((function(s){o++;const c=a.sequenceItems.length-o+1;a.updateVal(s,"starty",e-c*i.boxMargin,Math.min),a.updateVal(s,"stopy",r+c*i.boxMargin,Math.max),a.updateVal(_ut.data,"startx",t-c*i.boxMargin,Math.min),a.updateVal(_ut.data,"stopx",n+c*i.boxMargin,Math.max),"activation"!==l&&(a.updateVal(s,"startx",t-c*i.boxMargin,Math.min),a.updateVal(s,"stopx",n+c*i.boxMargin,Math.max),a.updateVal(_ut.data,"starty",e-c*i.boxMargin,Math.min),a.updateVal(_ut.data,"stopy",r+c*i.boxMargin,Math.max))}),"updateItemBounds")}s(l,"updateFn"),this.sequenceItems.forEach(l())}),"updateBounds"),insert:s((function(t,e,n,r){const i=Math.min(t,n),a=Math.max(t,n),s=Math.min(e,r),o=Math.max(e,r);this.updateVal(_ut.data,"startx",i,Math.min),this.updateVal(_ut.data,"starty",s,Math.min),this.updateVal(_ut.data,"stopx",a,Math.max),this.updateVal(_ut.data,"stopy",o,Math.max),this.updateBounds(i,s,a,o)}),"insert"),bumpVerticalPos:s((function(t){this.verticalPos=this.verticalPos+t,this.data.stopy=this.verticalPos}),"bumpVerticalPos"),getVerticalPos:s((function(){return this.verticalPos}),"getVerticalPos"),getBounds:s((function(){return this.data}),"getBounds")},Eut=wut.sectionFills,Cut=wut.sectionColours,Sut=s((function(t,e,n){const r=Hn().journey;let i="";const a=n+(2*r.height+r.diagramMarginY);let s=0,o="#CCC",l="black",c=0;for(const[n,h]of e.entries()){if(i!==h.section){o=Eut[s%Eut.length],c=s%Eut.length,l=Cut[s%Cut.length];let a=0;const u=h.section;for(let t=n;t<e.length&&e[t].section==u;t++)a+=1;const d={x:n*r.taskMargin+n*r.width+kut,y:50,text:h.section,fill:o,num:c,colour:l,taskCount:a};yut.drawSection(t,d,r),i=h.section,s++}const u=h.people.reduce(((t,e)=>(xut[e]&&(t[e]=xut[e]),t)),{});h.x=n*r.taskMargin+n*r.width+kut,h.y=a,h.width=r.diagramMarginX,h.height=r.diagramMarginY,h.colour=l,h.fill=o,h.num=c,h.actors=u,yut.drawTask(t,h,r),_ut.insert(h.x,h.y,h.x+h.width+r.taskMargin,450)}}),"drawTasks"),Aut={setConf:vut,draw:Tut},Lut={parser:Yht,db:aut,renderer:Aut,styles:sut,init:s((t=>{Aut.setConf(t.journey),aut.clear()}),"init")},Nut=Object.freeze({__proto__:null,diagram:Lut}),Iut=function(){var t=s((function(t,e,n,r){for(n=n||{},r=t.length;r--;n[t[r]]=e);return n}),"o"),e=[6,8,10,11,12,14,16,17,20,21],n=[1,9],r=[1,10],i=[1,11],a=[1,12],o=[1,13],l=[1,16],c=[1,17],h={trace:s((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:s((function(t,e,n,r,i,a,s){var o=a.length-1;switch(i){case 1:return a[o-1];case 2:case 6:case 7:this.$=[];break;case 3:a[o-1].push(a[o]),this.$=a[o-1];break;case 4:case 5:this.$=a[o];break;case 8:r.getCommonDb().setDiagramTitle(a[o].substr(6)),this.$=a[o].substr(6);break;case 9:this.$=a[o].trim(),r.getCommonDb().setAccTitle(this.$);break;case 10:case 11:this.$=a[o].trim(),r.getCommonDb().setAccDescription(this.$);break;case 12:r.addSection(a[o].substr(8)),this.$=a[o].substr(8);break;case 15:r.addTask(a[o],0,""),this.$=a[o];break;case 16:r.addEvent(a[o].substr(2)),this.$=a[o]}}),"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:n,12:r,14:i,16:a,17:o,18:14,19:15,20:l,21:c},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:18,11:n,12:r,14:i,16:a,17:o,18:14,19:15,20:l,21:c},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:s((function(t,e){if(!e.recoverable){var n=new Error(t);throw n.hash=e,n}this.trace(t)}),"parseError"),parse:s((function(t){var e=this,n=[0],r=[],i=[null],a=[],o=this.table,l="",c=0,h=0,u=2,d=1,p=a.slice.call(arguments,1),g=Object.create(this.lexer),f={yy:{}};for(var m in this.yy)Object.prototype.hasOwnProperty.call(this.yy,m)&&(f.yy[m]=this.yy[m]);g.setInput(t,f.yy),f.yy.lexer=g,f.yy.parser=this,void 0===g.yylloc&&(g.yylloc={});var y=g.yylloc;a.push(y);var v=g.options&&g.options.ranges;function x(t){n.length=n.length-2*t,i.length=i.length-t,a.length=a.length-t}function b(){var t;return"number"!=typeof(t=r.pop()||g.lex()||d)&&(t instanceof Array&&(t=(r=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof f.yy.parseError?this.parseError=f.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,s(x,"popStack"),s(b,"lex");for(var w,k,T,_,E,C,S,A,L={};;){if(k=n[n.length-1],this.defaultActions[k]?T=this.defaultActions[k]:(null==w&&(w=b()),T=o[k]&&o[k][w]),void 0===T||!T.length||!T[0]){var N="";for(E in A=[],o[k])this.terminals_[E]&&E>u&&A.push("'"+this.terminals_[E]+"'");N=g.showPosition?"Parse error on line "+(c+1)+":\n"+g.showPosition()+"\nExpecting "+A.join(", ")+", got '"+(this.terminals_[w]||w)+"'":"Parse error on line "+(c+1)+": Unexpected "+(w==d?"end of input":"'"+(this.terminals_[w]||w)+"'"),this.parseError(N,{text:g.match,token:this.terminals_[w]||w,line:g.yylineno,loc:y,expected:A})}if(T[0]instanceof Array&&T.length>1)throw new Error("Parse Error: multiple actions possible at state: "+k+", token: "+w);switch(T[0]){case 1:n.push(w),i.push(g.yytext),a.push(g.yylloc),n.push(T[1]),w=null,h=g.yyleng,l=g.yytext,c=g.yylineno,y=g.yylloc;break;case 2:if(C=this.productions_[T[1]][1],L.$=i[i.length-C],L._$={first_line:a[a.length-(C||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(C||1)].first_column,last_column:a[a.length-1].last_column},v&&(L._$.range=[a[a.length-(C||1)].range[0],a[a.length-1].range[1]]),void 0!==(_=this.performAction.apply(L,[l,h,c,f.yy,T[1],i,a].concat(p))))return _;C&&(n=n.slice(0,-1*C*2),i=i.slice(0,-1*C),a=a.slice(0,-1*C)),n.push(this.productions_[T[1]][0]),i.push(L.$),a.push(L._$),S=o[n[n.length-2]][n[n.length-1]],n.push(S);break;case 3:return!0}}return!0}),"parse")},u=function(){var t={EOF:1,parseError:s((function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)}),"parseError"),setInput:s((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:s((function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(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:s((function(t){var e=t.length,n=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 r=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 i=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===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this}),"unput"),more:s((function(){return this._more=!0,this}),"more"),reject:s((function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):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).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}),"reject"),less:s((function(t){this.unput(this.match.slice(t))}),"less"),pastInput:s((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:s((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:s((function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"}),"showPosition"),test_match:s((function(t,e){var n,r,i;if(this.options.backtrack_lexer&&(i={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&&(i.yylloc.range=this.yylloc.range.slice(0))),(r=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.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],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1}),"test_match"),next:s((function(){if(this.done)return this.EOF;var t,e,n,r;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;a<i.length;a++)if((n=this._input.match(this.rules[i[a]]))&&(!e||n[0].length>e[0].length)){if(e=n,r=a,this.options.backtrack_lexer){if(!1!==(t=this.test_match(n,i[a])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,i[r]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}),"next"),lex:s((function(){var t=this.next();return t||this.lex()}),"lex"),begin:s((function(t){this.conditionStack.push(t)}),"begin"),popState:s((function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]}),"popState"),_currentRules:s((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:s((function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"}),"topState"),pushState:s((function(t){this.begin(t)}),"pushState"),stateStackSize:s((function(){return this.conditionStack.length}),"stateStackSize"),options:{"case-insensitive":!0},performAction:s((function(t,e,n,r){switch(n){case 0:case 1:case 3:case 4:break;case 2:return 10;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]+)/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 t}();function d(){this.yy={}}return h.lexer=u,s(d,"Parser"),d.prototype=h,h.Parser=d,new d}();Iut.parser=Iut;var Mut=Iut,Rut={};l(Rut,{addEvent:()=>Yut,addSection:()=>Uut,addTask:()=>jut,addTaskOrg:()=>Wut,clear:()=>zut,default:()=>Vut,getCommonDb:()=>Fut,getSections:()=>Gut,getTasks:()=>qut});var Dut="",Out=0,Put=[],But=[],$ut=[],Fut=s((()=>Rn),"getCommonDb"),zut=s((function(){Put.length=0,But.length=0,Dut="",$ut.length=0,$n()}),"clear"),Uut=s((function(t){Dut=t,Put.push(t)}),"addSection"),Gut=s((function(){return Put}),"getSections"),qut=s((function(){let t=Hut();let e=0;for(;!t&&e<100;)t=Hut(),e++;return But.push(...$ut),But}),"getTasks"),jut=s((function(t,e,n){const r={id:Out++,section:Dut,type:Dut,task:t,score:e||0,events:n?[n]:[]};$ut.push(r)}),"addTask"),Yut=s((function(t){$ut.find((t=>t.id===Out-1)).events.push(t)}),"addEvent"),Wut=s((function(t){const e={section:Dut,type:Dut,description:t,task:t,classes:[]};But.push(e)}),"addTaskOrg"),Hut=s((function(){const t=s((function(t){return $ut[t].processed}),"compileTask");let e=!0;for(const[n,r]of $ut.entries())t(n),e=e&&r.processed;return e}),"compileTasks"),Vut={clear:zut,getCommonDb:Fut,addSection:Uut,getSections:Gut,getTasks:qut,addTask:jut,addTaskOrg:Wut,addEvent:Yut},Xut=s((function(t,e){const n=t.append("rect");return n.attr("x",e.x),n.attr("y",e.y),n.attr("fill",e.fill),n.attr("stroke",e.stroke),n.attr("width",e.width),n.attr("height",e.height),n.attr("rx",e.rx),n.attr("ry",e.ry),void 0!==e.class&&n.attr("class",e.class),n}),"drawRect"),Kut=s((function(t,e){const n=15,r=t.append("circle").attr("cx",e.cx).attr("cy",e.cy).attr("class","face").attr("r",n).attr("stroke-width",2).attr("overflow","visible"),i=t.append("g");function a(t){const r=qh().startAngle(Math.PI/2).endAngle(Math.PI/2*3).innerRadius(7.5).outerRadius(n/2.2);t.append("path").attr("class","mouth").attr("d",r).attr("transform","translate("+e.cx+","+(e.cy+2)+")")}function o(t){const r=qh().startAngle(3*Math.PI/2).endAngle(Math.PI/2*5).innerRadius(7.5).outerRadius(n/2.2);t.append("path").attr("class","mouth").attr("d",r).attr("transform","translate("+e.cx+","+(e.cy+7)+")")}function l(t){t.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 i.append("circle").attr("cx",e.cx-5).attr("cy",e.cy-5).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),i.append("circle").attr("cx",e.cx+5).attr("cy",e.cy-5).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),s(a,"smile"),s(o,"sad"),s(l,"ambivalent"),e.score>3?a(i):e.score<3?o(i):l(i),r}),"drawFace"),Zut=s((function(t,e){const n=t.append("circle");return n.attr("cx",e.cx),n.attr("cy",e.cy),n.attr("class","actor-"+e.pos),n.attr("fill",e.fill),n.attr("stroke",e.stroke),n.attr("r",e.r),void 0!==n.class&&n.attr("class",n.class),void 0!==e.title&&n.append("title").text(e.title),n}),"drawCircle"),Qut=s((function(t,e){const n=e.text.replace(/<br\s*\/?>/gi," "),r=t.append("text");r.attr("x",e.x),r.attr("y",e.y),r.attr("class","legend"),r.style("text-anchor",e.anchor),void 0!==e.class&&r.attr("class",e.class);const i=r.append("tspan");return i.attr("x",e.x+2*e.textMargin),i.text(n),r}),"drawText"),Jut=s((function(t,e){function n(t,e,n,r,i){return t+","+e+" "+(t+n)+","+e+" "+(t+n)+","+(e+r-i)+" "+(t+n-1.2*i)+","+(e+r)+" "+t+","+(e+r)}s(n,"genPoints");const r=t.append("polygon");r.attr("points",n(e.x,e.y,50,20,7)),r.attr("class","labelBox"),e.y=e.y+e.labelMargin,e.x=e.x+.5*e.labelMargin,Qut(t,e)}),"drawLabel"),tdt=s((function(t,e,n){const r=t.append("g"),i=adt();i.x=e.x,i.y=e.y,i.fill=e.fill,i.width=n.width,i.height=n.height,i.class="journey-section section-type-"+e.num,i.rx=3,i.ry=3,Xut(r,i),sdt(n)(e.text,r,i.x,i.y,i.width,i.height,{class:"journey-section section-type-"+e.num},n,e.colour)}),"drawSection"),edt=-1,ndt=s((function(t,e,n){const r=e.x+n.width/2,i=t.append("g");edt++;i.append("line").attr("id","task"+edt).attr("x1",r).attr("y1",e.y).attr("x2",r).attr("y2",450).attr("class","task-line").attr("stroke-width","1px").attr("stroke-dasharray","4 2").attr("stroke","#666"),Kut(i,{cx:r,cy:300+30*(5-e.score),score:e.score});const a=adt();a.x=e.x,a.y=e.y,a.fill=e.fill,a.width=n.width,a.height=n.height,a.class="task task-type-"+e.num,a.rx=3,a.ry=3,Xut(i,a),sdt(n)(e.task,i,a.x,a.y,a.width,a.height,{class:"task"},n,e.colour)}),"drawTask"),rdt=s((function(t,e){Xut(t,{x:e.startx,y:e.starty,width:e.stopx-e.startx,height:e.stopy-e.starty,fill:e.fill,class:"rect"}).lower()}),"drawBackgroundRect"),idt=s((function(){return{x:0,y:0,fill:void 0,"text-anchor":"start",width:100,height:100,textMargin:0,rx:0,ry:0}}),"getTextObj"),adt=s((function(){return{x:0,y:0,width:100,anchor:"start",height:100,rx:0,ry:0}}),"getNoteRect"),sdt=function(){function t(t,e,n,i,a,s,o,l){r(e.append("text").attr("x",n+a/2).attr("y",i+s/2+5).style("font-color",l).style("text-anchor","middle").text(t),o)}function e(t,e,n,i,a,s,o,l,c){const{taskFontSize:h,taskFontFamily:u}=l,d=t.split(/<br\s*\/?>/gi);for(let t=0;t<d.length;t++){const l=t*h-h*(d.length-1)/2,p=e.append("text").attr("x",n+a/2).attr("y",i).attr("fill",c).style("text-anchor","middle").style("font-size",h).style("font-family",u);p.append("tspan").attr("x",n+a/2).attr("dy",l).text(d[t]),p.attr("y",i+s/2).attr("dominant-baseline","central").attr("alignment-baseline","central"),r(p,o)}}function n(t,n,i,a,s,o,l,c){const h=n.append("switch"),u=h.append("foreignObject").attr("x",i).attr("y",a).attr("width",s).attr("height",o).attr("position","fixed").append("xhtml:div").style("display","table").style("height","100%").style("width","100%");u.append("div").attr("class","label").style("display","table-cell").style("text-align","center").style("vertical-align","middle").text(t),e(t,h,i,a,s,o,l,c),r(u,l)}function r(t,e){for(const n in e)n in e&&t.attr(n,e[n])}return s(t,"byText"),s(e,"byTspan"),s(n,"byFo"),s(r,"_setTextAttrs"),function(r){return"fo"===r.textPlacement?n:"old"===r.textPlacement?t:e}}(),odt=s((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 ldt(t,e){t.each((function(){var t,n=Oa(this),r=n.text().split(/(\s+|<br>)/).reverse(),i=[],a=n.attr("y"),s=parseFloat(n.attr("dy")),o=n.text(null).append("tspan").attr("x",0).attr("y",a).attr("dy",s+"em");for(let s=0;s<r.length;s++)t=r[r.length-1-s],i.push(t),o.text(i.join(" ").trim()),(o.node().getComputedTextLength()>e||"<br>"===t)&&(i.pop(),o.text(i.join(" ").trim()),i="<br>"===t?[""]:[t],o=n.append("tspan").attr("x",0).attr("y",a).attr("dy","1.1em").text(t))}))}s(ldt,"wrap");var cdt=s((function(t,e,n,r){const i=n%12-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"),l=o.append("text").text(e.descr).attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle").call(ldt,e.width).node().getBBox(),c=r.fontSize?.replace?r.fontSize.replace("px",""):r.fontSize;return e.height=l.height+1.1*c*.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+")"),udt(s,e,i,r),e}),"drawNode"),hdt=s((function(t,e,n){const r=t.append("g"),i=r.append("text").text(e.descr).attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle").call(ldt,e.width).node().getBBox(),a=n.fontSize?.replace?n.fontSize.replace("px",""):n.fontSize;return r.remove(),i.height+1.1*a*.5+e.padding}),"getVirtualNodeHeight"),udt=s((function(t,e,n){t.append("path").attr("id","node-"+e.id).attr("class","node-bkg node-"+e.type).attr("d",`M0 ${e.height-5} v${10-e.height} q0,-5 5,-5 h${e.width-10} q5,0 5,5 v${e.height-5} H0 Z`),t.append("line").attr("class","node-line-"+n).attr("x1",0).attr("y1",e.height).attr("x2",e.width).attr("y2",e.height)}),"defaultBkg"),ddt={drawRect:Xut,drawCircle:Zut,drawSection:tdt,drawText:Qut,drawLabel:Jut,drawTask:ndt,drawBackgroundRect:rdt,getTextObj:idt,getNoteRect:adt,initGraphics:odt,drawNode:cdt,getVirtualNodeHeight:hdt},pdt=s((function(t,e,n,r){const i=Hn(),a=i.leftMargin??50;m.debug("timeline",r.db);const s=i.securityLevel;let o;"sandbox"===s&&(o=Oa("#i"+e));const l=Oa("sandbox"===s?o.nodes()[0].contentDocument.body:"body").select("#"+e);l.append("g");const c=r.db.getTasks(),h=r.db.getCommonDb().getDiagramTitle();m.debug("task",c),ddt.initGraphics(l);const u=r.db.getSections();m.debug("sections",u);let d=0,p=0,g=0,f=0,y=50+a,v=50;f=50;let x=0,b=!0;u.forEach((function(t){const e={number:x,descr:t,section:x,width:150,padding:20,maxHeight:d},n=ddt.getVirtualNodeHeight(l,e,i);m.debug("sectionHeight before draw",n),d=Math.max(d,n+20)}));let w=0,k=0;m.debug("tasks.length",c.length);for(const[t,e]of c.entries()){const n={number:t,descr:e,section:e.section,width:150,padding:20,maxHeight:p},r=ddt.getVirtualNodeHeight(l,n,i);m.debug("taskHeight before draw",r),p=Math.max(p,r+20),w=Math.max(w,e.events.length);let a=0;for(const t of e.events){const n={descr:t,section:e.section,number:e.section,width:150,padding:20,maxHeight:50};a+=ddt.getVirtualNodeHeight(l,n,i)}k=Math.max(k,a)}m.debug("maxSectionHeight before draw",d),m.debug("maxTaskHeight before draw",p),u&&u.length>0?u.forEach((t=>{const e=c.filter((e=>e.section===t)),n={number:x,descr:t,section:x,width:200*Math.max(e.length,1)-50,padding:20,maxHeight:d};m.debug("sectionNode",n);const r=l.append("g"),a=ddt.drawNode(r,n,x,i);m.debug("sectionNode output",a),r.attr("transform",`translate(${y}, 50)`),v+=d+50,e.length>0&&gdt(l,e,x,y,v,p,i,w,k,d,!1),y+=200*Math.max(e.length,1),v=50,x++})):(b=!1,gdt(l,c,x,y,v,p,i,w,k,d,!0));const T=l.node().getBBox();m.debug("bounds",T),h&&l.append("text").text(h).attr("x",T.width/2-a).attr("font-size","4ex").attr("font-weight","bold").attr("y",20),g=b?d+p+150:p+100;l.append("g").attr("class","lineWrapper").append("line").attr("x1",a).attr("y1",g).attr("x2",T.width+3*a).attr("y2",g).attr("stroke-width",4).attr("stroke","black").attr("marker-end","url(#arrowhead)"),An(void 0,l,i.timeline?.padding??50,i.timeline?.useMaxWidth??!1)}),"draw"),gdt=s((function(t,e,n,r,i,a,s,o,l,c,h){for(const o of e){const e={descr:o.task,section:n,number:n,width:150,padding:20,maxHeight:a};m.debug("taskNode",e);const u=t.append("g").attr("class","taskWrapper"),d=ddt.drawNode(u,e,n,s).height;if(m.debug("taskHeight after draw",d),u.attr("transform",`translate(${r}, ${i})`),a=Math.max(a,d),o.events){const e=t.append("g").attr("class","lineWrapper");let u=a;i+=100,u+=fdt(t,o.events,n,r,i,s),i-=100,e.append("line").attr("x1",r+95).attr("y1",i+a).attr("x2",r+95).attr("y2",i+a+(h?a:c)+l+120).attr("stroke-width",2).attr("stroke","black").attr("marker-end","url(#arrowhead)").attr("stroke-dasharray","5,5")}r+=200,h&&!s.timeline?.disableMulticolor&&n++}i-=10}),"drawTasks"),fdt=s((function(t,e,n,r,i,a){let s=0;const o=i;i+=100;for(const o of e){const e={descr:o,section:n,number:n,width:150,padding:20,maxHeight:50};m.debug("eventNode",e);const l=t.append("g").attr("class","eventWrapper"),c=ddt.drawNode(l,e,n,a).height;s+=c,l.attr("transform",`translate(${r}, ${i})`),i=i+10+c}return i=o,s}),"drawEvents"),mdt={setConf:s((()=>{}),"setConf"),draw:pdt},ydt=s((t=>{let e="";for(let e=0;e<t.THEME_COLOR_LIMIT;e++)t["lineColor"+e]=t["lineColor"+e]||t["cScaleInv"+e],rt(t["lineColor"+e])?t["lineColor"+e]=at(t["lineColor"+e],20):t["lineColor"+e]=st(t["lineColor"+e],20);for(let n=0;n<t.THEME_COLOR_LIMIT;n++){const r=""+(17-3*n);e+=`\n .section-${n-1} rect, .section-${n-1} path, .section-${n-1} circle, .section-${n-1} path {\n fill: ${t["cScale"+n]};\n }\n .section-${n-1} text {\n fill: ${t["cScaleLabel"+n]};\n }\n .node-icon-${n-1} {\n font-size: 40px;\n color: ${t["cScaleLabel"+n]};\n }\n .section-edge-${n-1}{\n stroke: ${t["cScale"+n]};\n }\n .edge-depth-${n-1}{\n stroke-width: ${r};\n }\n .section-${n-1} line {\n stroke: ${t["cScaleInv"+n]} ;\n stroke-width: 3;\n }\n\n .lineWrapper line{\n stroke: ${t["cScaleLabel"+n]} ;\n }\n\n .disabled, .disabled circle, .disabled text {\n fill: lightgray;\n }\n .disabled text {\n fill: #efefef;\n }\n `}return e}),"genSections"),vdt={db:Rut,renderer:mdt,parser:Mut,styles:s((t=>`\n .edge {\n stroke-width: 3;\n }\n ${ydt(t)}\n .section-root rect, .section-root path, .section-root circle {\n fill: ${t.git0};\n }\n .section-root text {\n fill: ${t.gitBranchLabel0};\n }\n .icon-container {\n height:100%;\n display: flex;\n justify-content: center;\n align-items: center;\n }\n .edge {\n fill: none;\n }\n .eventWrapper {\n filter: brightness(120%);\n }\n`),"getStyles")},xdt=Object.freeze({__proto__:null,diagram:vdt});function bdt(t){return(bdt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function wdt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function kdt(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Tdt(t,e,n){return e&&kdt(t.prototype,e),n&&kdt(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function _dt(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Edt(t,e){return Cdt(t)||Sdt(t,e)||Adt(t,e)||Ndt()}function Cdt(t){if(Array.isArray(t))return t}function Sdt(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,a=[],s=!0,o=!1;try{for(n=n.call(t);!(s=(r=n.next()).done)&&(a.push(r.value),!e||a.length!==e);s=!0);}catch(t){o=!0,i=t}finally{try{s||null==n.return||n.return()}finally{if(o)throw i}}return a}}function Adt(t,e){if(t){if("string"==typeof t)return Ldt(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ldt(t,e):void 0}}function Ldt(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Ndt(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Idt(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=Adt(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=s((function(){}),"F");return{s:i,n:s((function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}}),"n"),e:s((function(t){throw t}),"e"),f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,l=!1;return{s:s((function(){n=n.call(t)}),"s"),n:s((function(){var t=n.next();return o=t.done,t}),"n"),e:s((function(t){l=!0,a=t}),"e"),f:s((function(){try{o||null==n.return||n.return()}finally{if(l)throw a}}),"f")}}s(bdt,"_typeof"),s(wdt,"_classCallCheck"),s(kdt,"_defineProperties"),s(Tdt,"_createClass"),s(_dt,"_defineProperty$1"),s(Edt,"_slicedToArray"),s(Cdt,"_arrayWithHoles"),s(Sdt,"_iterableToArrayLimit"),s(Adt,"_unsupportedIterableToArray"),s(Ldt,"_arrayLikeToArray"),s(Ndt,"_nonIterableRest"),s(Idt,"_createForOfIteratorHelper");var Mdt="undefined"==typeof window?null:window,Rdt=Mdt?Mdt.navigator:null;Mdt&&Mdt.document;var Ddt=bdt(""),Odt=bdt({}),Pdt=bdt((function(){})),Bdt="undefined"==typeof HTMLElement?"undefined":bdt(HTMLElement),$dt=s((function(t){return t&&t.instanceString&&zdt(t.instanceString)?t.instanceString():null}),"instanceStr"),Fdt=s((function(t){return null!=t&&bdt(t)==Ddt}),"string"),zdt=s((function(t){return null!=t&&bdt(t)===Pdt}),"fn"),Udt=s((function(t){return!Hdt(t)&&(Array.isArray?Array.isArray(t):null!=t&&t instanceof Array)}),"array"),Gdt=s((function(t){return null!=t&&bdt(t)===Odt&&!Udt(t)&&t.constructor===Object}),"plainObject"),qdt=s((function(t){return null!=t&&bdt(t)===Odt}),"object"),jdt=s((function(t){return null!=t&&bdt(t)===bdt(1)&&!isNaN(t)}),"number"),Ydt=s((function(t){return jdt(t)&&Math.floor(t)===t}),"integer"),Wdt=s((function(t){return"undefined"===Bdt?void 0:null!=t&&t instanceof HTMLElement}),"htmlElement"),Hdt=s((function(t){return Vdt(t)||Xdt(t)}),"elementOrCollection"),Vdt=s((function(t){return"collection"===$dt(t)&&t._private.single}),"element"),Xdt=s((function(t){return"collection"===$dt(t)&&!t._private.single}),"collection"),Kdt=s((function(t){return"core"===$dt(t)}),"core"),Zdt=s((function(t){return"stylesheet"===$dt(t)}),"stylesheet"),Qdt=s((function(t){return"event"===$dt(t)}),"event"),Jdt=s((function(t){return null==t||!(""!==t&&!t.match(/^\s+$/))}),"emptyString"),tpt=s((function(t){return"undefined"!=typeof HTMLElement&&t instanceof HTMLElement}),"domElement"),ept=s((function(t){return Gdt(t)&&jdt(t.x1)&&jdt(t.x2)&&jdt(t.y1)&&jdt(t.y2)}),"boundingBox"),npt=s((function(t){return qdt(t)&&zdt(t.then)}),"promise"),rpt=s((function(){return Rdt&&Rdt.userAgent.match(/msie|trident|edge/i)}),"ms"),ipt=s((function(t,e){e||(e=s((function(){if(1===arguments.length)return arguments[0];if(0===arguments.length)return"undefined";for(var t=[],e=0;e<arguments.length;e++)t.push(arguments[e]);return t.join("$")}),"keyFn"));var n=s((function n(){var r,i=this,a=arguments,s=e.apply(i,a),o=n.cache;return(r=o[s])||(r=o[s]=t.apply(i,a)),r}),"memoizedFn");return n.cache={},n}),"memoize"),apt=ipt((function(t){return t.replace(/([A-Z])/g,(function(t){return"-"+t.toLowerCase()}))})),spt=ipt((function(t){return t.replace(/(-\w)/g,(function(t){return t[1].toUpperCase()}))})),opt=ipt((function(t,e){return t+e[0].toUpperCase()+e.substring(1)}),(function(t,e){return t+"$"+e})),lpt=s((function(t){return Jdt(t)?t:t.charAt(0).toUpperCase()+t.substring(1)}),"capitalize"),cpt="(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))",hpt=s((function(t,e){return t<e?-1:t>e?1:0}),"ascending"),upt=s((function(t,e){return-1*hpt(t,e)}),"descending"),dpt=null!=Object.assign?Object.assign.bind(Object):function(t){for(var e=arguments,n=1;n<e.length;n++){var r=e[n];if(null!=r)for(var i=Object.keys(r),a=0;a<i.length;a++){var s=i[a];t[s]=r[s]}}return t},ppt=s((function(t){if((4===t.length||7===t.length)&&"#"===t[0]){var e,n,r,i=16;return 4===t.length?(e=parseInt(t[1]+t[1],i),n=parseInt(t[2]+t[2],i),r=parseInt(t[3]+t[3],i)):(e=parseInt(t[1]+t[2],i),n=parseInt(t[3]+t[4],i),r=parseInt(t[5]+t[6],i)),[e,n,r]}}),"hex2tuple"),gpt=s((function(t){var e,n,r,i,a,o,l,c;function h(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}s(h,"hue2rgb");var u=new RegExp("^hsl[a]?\\(((?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?)))\\s*,\\s*((?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))[%])\\s*,\\s*((?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))[%])(?:\\s*,\\s*((?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))))?\\)$").exec(t);if(u){if((n=parseInt(u[1]))<0?n=(360- -1*n%360)%360:n>360&&(n%=360),n/=360,(r=parseFloat(u[2]))<0||r>100)return;if(r/=100,(i=parseFloat(u[3]))<0||i>100)return;if(i/=100,void 0!==(a=u[4])&&((a=parseFloat(a))<0||a>1))return;if(0===r)o=l=c=Math.round(255*i);else{var d=i<.5?i*(1+r):i+r-i*r,p=2*i-d;o=Math.round(255*h(p,d,n+1/3)),l=Math.round(255*h(p,d,n)),c=Math.round(255*h(p,d,n-1/3))}e=[o,l,c,a]}return e}),"hsl2tuple"),fpt=s((function(t){var e,n=new RegExp("^rgb[a]?\\(((?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))[%]?)\\s*,\\s*((?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))[%]?)\\s*,\\s*((?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))[%]?)(?:\\s*,\\s*((?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))))?\\)$").exec(t);if(n){e=[];for(var r=[],i=1;i<=3;i++){var a=n[i];if("%"===a[a.length-1]&&(r[i]=!0),a=parseFloat(a),r[i]&&(a=a/100*255),a<0||a>255)return;e.push(Math.floor(a))}var s=r[1]||r[2]||r[3],o=r[1]&&r[2]&&r[3];if(s&&!o)return;var l=n[4];if(void 0!==l){if((l=parseFloat(l))<0||l>1)return;e.push(l)}}return e}),"rgb2tuple"),mpt=s((function(t){return vpt[t.toLowerCase()]}),"colorname2tuple"),ypt=s((function(t){return(Udt(t)?t:null)||mpt(t)||ppt(t)||fpt(t)||gpt(t)}),"color2tuple"),vpt={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]},xpt=s((function(t){for(var e=t.map,n=t.keys,r=n.length,i=0;i<r;i++){var a=n[i];if(Gdt(a))throw Error("Tried to set map with object key");i<n.length-1?(null==e[a]&&(e[a]={}),e=e[a]):e[a]=t.value}}),"setMap"),bpt=s((function(t){for(var e=t.map,n=t.keys,r=n.length,i=0;i<r;i++){var a=n[i];if(Gdt(a))throw Error("Tried to get map with object key");if(null==(e=e[a]))return e}return e}),"getMap");function wpt(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}s(wpt,"isObject");var kpt=wpt,Tpt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function _pt(t,e){return t(e={exports:{}},e.exports),e.exports}s(_pt,"createCommonjsModule");var Ept="object"==typeof Tpt&&Tpt&&Tpt.Object===Object&&Tpt,Cpt="object"==typeof self&&self&&self.Object===Object&&self,Spt=Ept||Cpt||Function("return this")(),Apt=s((function(){return Spt.Date.now()}),"now"),Lpt=/\s/;function Npt(t){for(var e=t.length;e--&&Lpt.test(t.charAt(e)););return e}s(Npt,"trimmedEndIndex");var Ipt=Npt,Mpt=/^\s+/;function Rpt(t){return t?t.slice(0,Ipt(t)+1).replace(Mpt,""):t}s(Rpt,"baseTrim");var Dpt=Rpt,Opt=Spt.Symbol,Ppt=Object.prototype,Bpt=Ppt.hasOwnProperty,$pt=Ppt.toString,Fpt=Opt?Opt.toStringTag:void 0;function zpt(t){var e=Bpt.call(t,Fpt),n=t[Fpt];try{t[Fpt]=void 0;var r=!0}catch(t){}var i=$pt.call(t);return r&&(e?t[Fpt]=n:delete t[Fpt]),i}s(zpt,"getRawTag");var Upt=zpt,Gpt=Object.prototype.toString;function qpt(t){return Gpt.call(t)}s(qpt,"objectToString");var jpt=qpt,Ypt=Opt?Opt.toStringTag:void 0;function Wpt(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":Ypt&&Ypt in Object(t)?Upt(t):jpt(t)}s(Wpt,"baseGetTag");var Hpt=Wpt;function Vpt(t){return null!=t&&"object"==typeof t}s(Vpt,"isObjectLike");var Xpt=Vpt;function Kpt(t){return"symbol"==typeof t||Xpt(t)&&"[object Symbol]"==Hpt(t)}s(Kpt,"isSymbol");var Zpt=Kpt,Qpt=/^[-+]0x[0-9a-f]+$/i,Jpt=/^0b[01]+$/i,tgt=/^0o[0-7]+$/i,egt=parseInt;function ngt(t){if("number"==typeof t)return t;if(Zpt(t))return NaN;if(kpt(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=kpt(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=Dpt(t);var n=Jpt.test(t);return n||tgt.test(t)?egt(t.slice(2),n?2:8):Qpt.test(t)?NaN:+t}s(ngt,"toNumber");var rgt=ngt,igt=Math.max,agt=Math.min;function sgt(t,e,n){var r,i,a,o,l,c,h=0,u=!1,d=!1,p=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function g(e){var n=r,a=i;return r=i=void 0,h=e,o=t.apply(a,n)}function f(t){return h=t,l=setTimeout(v,e),u?g(t):o}function m(t){var n=e-(t-c);return d?agt(n,a-(t-h)):n}function y(t){var n=t-c;return void 0===c||n>=e||n<0||d&&t-h>=a}function v(){var t=Apt();if(y(t))return x(t);l=setTimeout(v,m(t))}function x(t){return l=void 0,p&&r?g(t):(r=i=void 0,o)}function b(){void 0!==l&&clearTimeout(l),h=0,r=c=i=l=void 0}function w(){return void 0===l?o:x(Apt())}function k(){var t=Apt(),n=y(t);if(r=arguments,i=this,c=t,n){if(void 0===l)return f(c);if(d)return clearTimeout(l),l=setTimeout(v,e),g(c)}return void 0===l&&(l=setTimeout(v,e)),o}return e=rgt(e)||0,kpt(n)&&(u=!!n.leading,a=(d="maxWait"in n)?igt(rgt(n.maxWait)||0,e):a,p="trailing"in n?!!n.trailing:p),s(g,"invokeFunc"),s(f,"leadingEdge"),s(m,"remainingWait"),s(y,"shouldInvoke"),s(v,"timerExpired"),s(x,"trailingEdge"),s(b,"cancel"),s(w,"flush"),s(k,"debounced"),k.cancel=b,k.flush=w,k}s(sgt,"debounce");var ogt=sgt,lgt=Mdt?Mdt.performance:null,cgt=lgt&&lgt.now?function(){return lgt.now()}:function(){return Date.now()},hgt=function(){if(Mdt){if(Mdt.requestAnimationFrame)return function(t){Mdt.requestAnimationFrame(t)};if(Mdt.mozRequestAnimationFrame)return function(t){Mdt.mozRequestAnimationFrame(t)};if(Mdt.webkitRequestAnimationFrame)return function(t){Mdt.webkitRequestAnimationFrame(t)};if(Mdt.msRequestAnimationFrame)return function(t){Mdt.msRequestAnimationFrame(t)}}return function(t){t&&setTimeout((function(){t(cgt())}),1e3/60)}}(),ugt=s((function(t){return hgt(t)}),"requestAnimationFrame"),dgt=cgt,pgt=65599,ggt=s((function(t){for(var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:9261,r=n;!(e=t.next()).done;)r=r*pgt+e.value|0;return r}),"hashIterableInts"),fgt=s((function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:9261;return e*pgt+t|0}),"hashInt"),mgt=s((function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5381;return(e<<5)+e+t|0}),"hashIntAlt"),ygt=s((function(t,e){return 2097152*t+e}),"combineHashes"),vgt=s((function(t){return 2097152*t[0]+t[1]}),"combineHashesArray"),xgt=s((function(t,e){return[fgt(t[0],e[0]),mgt(t[1],e[1])]}),"hashArrays"),bgt=s((function(t,e){var n={value:0,done:!1},r=0,i=t.length;return ggt({next:s((function(){return r<i?n.value=t[r++]:n.done=!0,n}),"next")},e)}),"hashIntsArray"),wgt=s((function(t,e){var n={value:0,done:!1},r=0,i=t.length;return ggt({next:s((function(){return r<i?n.value=t.charCodeAt(r++):n.done=!0,n}),"next")},e)}),"hashString"),kgt=s((function(){return Tgt(arguments)}),"hashStrings"),Tgt=s((function(t){for(var e,n=0;n<t.length;n++){var r=t[n];e=0===n?wgt(r):wgt(r,e)}return e}),"hashStringsArray"),_gt=!0,Egt=null!=console.warn,Cgt=null!=console.trace,Sgt=Number.MAX_SAFE_INTEGER||9007199254740991,Agt=s((function(){return!0}),"trueify"),Lgt=s((function(){return!1}),"falsify"),Ngt=s((function(){return 0}),"zeroify"),Igt=s((function(){}),"noop"),Mgt=s((function(t){throw new Error(t)}),"error"),Rgt=s((function(t){if(void 0===t)return _gt;_gt=!!t}),"warnings"),Dgt=s((function(t){Rgt()&&(Egt?console.warn(t):(console.log(t),Cgt&&console.trace()))}),"warn"),Ogt=s((function(t){return dpt({},t)}),"clone"),Pgt=s((function(t){return null==t?t:Udt(t)?t.slice():Gdt(t)?Ogt(t):t}),"copy"),Bgt=s((function(t){return t.slice()}),"copyArray"),$gt=s((function(t,e){for(e=t="";t++<36;e+=51*t&52?(15^t?8^Math.random()*(20^t?16:4):4).toString(16):"-");return e}),"uuid"),Fgt={},zgt=s((function(){return Fgt}),"staticEmptyObject"),Ugt=s((function(t){var e=Object.keys(t);return function(n){for(var r={},i=0;i<e.length;i++){var a=e[i],s=null==n?void 0:n[a];r[a]=void 0===s?t[a]:s}return r}}),"defaults"),Ggt=s((function(t,e,n){for(var r=t.length-1;r>=0&&(t[r]!==e||(t.splice(r,1),!n));r--);}),"removeFromArray"),qgt=s((function(t){t.splice(0,t.length)}),"clearArray"),jgt=s((function(t,e){for(var n=0;n<e.length;n++){var r=e[n];t.push(r)}}),"push"),Ygt=s((function(t,e,n){return n&&(e=opt(n,e)),t[e]}),"getPrefixedProperty"),Wgt=s((function(t,e,n,r){n&&(e=opt(n,e)),t[e]=r}),"setPrefixedProperty"),Hgt="undefined"!=typeof Map?Map:function(){function t(){wdt(this,t),this._obj={}}return s(t,"ObjectMap"),Tdt(t,[{key:"set",value:s((function(t,e){return this._obj[t]=e,this}),"set")},{key:"delete",value:s((function(t){return this._obj[t]=void 0,this}),"_delete")},{key:"clear",value:s((function(){this._obj={}}),"clear")},{key:"has",value:s((function(t){return void 0!==this._obj[t]}),"has")},{key:"get",value:s((function(t){return this._obj[t]}),"get")}]),t}(),Vgt=function(){function t(e){if(wdt(this,t),this._obj=Object.create(null),this.size=0,null!=e){var n;n=null!=e.instanceString&&e.instanceString()===this.instanceString()?e.toArray():e;for(var r=0;r<n.length;r++)this.add(n[r])}}return s(t,"ObjectSet"),Tdt(t,[{key:"instanceString",value:s((function(){return"set"}),"instanceString")},{key:"add",value:s((function(t){var e=this._obj;1!==e[t]&&(e[t]=1,this.size++)}),"add")},{key:"delete",value:s((function(t){var e=this._obj;1===e[t]&&(e[t]=0,this.size--)}),"_delete")},{key:"clear",value:s((function(){this._obj=Object.create(null)}),"clear")},{key:"has",value:s((function(t){return 1===this._obj[t]}),"has")},{key:"toArray",value:s((function(){var t=this;return Object.keys(this._obj).filter((function(e){return t.has(e)}))}),"toArray")},{key:"forEach",value:s((function(t,e){return this.toArray().forEach(t,e)}),"forEach")}]),t}(),Xgt="undefined"!==("undefined"==typeof Set?"undefined":bdt(Set))?Set:Vgt,Kgt=s((function(t,e){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(void 0!==t&&void 0!==e&&Kdt(t)){var r=e.group;if(null==r&&(r=e.data&&null!=e.data.source&&null!=e.data.target?"edges":"nodes"),"nodes"===r||"edges"===r){this.length=1,this[0]=this;var i=this._private={cy:t,single:!0,data:e.data||{},position:e.position||{x:0,y:0},autoWidth:void 0,autoHeight:void 0,autoPadding:void 0,compoundBoundsClean:!1,listeners:[],group:r,style:{},rstyle:{},styleCxts:[],styleKeys:{},removed:!0,selected:!!e.selected,selectable:void 0===e.selectable||!!e.selectable,locked:!!e.locked,grabbed:!1,grabbable:void 0===e.grabbable||!!e.grabbable,pannable:void 0===e.pannable?"edges"===r:!!e.pannable,active:!1,classes:new Xgt,animation:{current:[],queue:[]},rscratch:{},scratch:e.scratch||{},edges:[],children:[],parent:e.parent&&e.parent.isNode()?e.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(null==i.position.x&&(i.position.x=0),null==i.position.y&&(i.position.y=0),e.renderedPosition){var a=e.renderedPosition,s=t.pan(),o=t.zoom();i.position={x:(a.x-s.x)/o,y:(a.y-s.y)/o}}var l=[];Udt(e.classes)?l=e.classes:Fdt(e.classes)&&(l=e.classes.split(/\s+/));for(var c=0,h=l.length;c<h;c++){var u=l[c];u&&""!==u&&i.classes.add(u)}this.createEmitter();var d=e.style||e.css;d&&(Dgt("Setting a `style` bypass at element creation should be done only when absolutely necessary. Try to use the stylesheet instead."),this.style(d)),(void 0===n||n)&&this.restore()}else Mgt("An element must be of type `nodes` or `edges`; you specified `"+r+"`")}else Mgt("An element must have a core reference and parameters set")}),"Element"),Zgt=s((function(t){return t={bfs:t.bfs||!t.dfs,dfs:t.dfs||!t.bfs},s((function(e,n,r){var i;Gdt(e)&&!Hdt(e)&&(e=(i=e).roots||i.root,n=i.visit,r=i.directed),r=2!==arguments.length||zdt(n)?r:n,n=zdt(n)?n:function(){};for(var a,o=this._private.cy,l=e=Fdt(e)?this.filter(e):e,c=[],h=[],u={},d={},p={},g=0,f=this.byGroup(),m=f.nodes,y=f.edges,v=0;v<l.length;v++){var x=l[v],b=x.id();x.isNode()&&(c.unshift(x),t.bfs&&(p[b]=!0,h.push(x)),d[b]=0)}for(var w=s((function(){var e=t.bfs?c.shift():c.pop(),i=e.id();if(t.dfs){if(p[i])return"continue";p[i]=!0,h.push(e)}var s,o=d[i],l=u[i],f=null!=l?l.source():null,v=null!=l?l.target():null,x=null==l?void 0:e.same(f)?v[0]:f[0];if(!0===(s=n(e,l,x,g++,o)))return a=e,"break";if(!1===s)return"break";for(var b=e.connectedEdges().filter((function(t){return(!r||t.source().same(e))&&y.has(t)})),w=0;w<b.length;w++){var k=b[w],T=k.connectedNodes().filter((function(t){return!t.same(e)&&m.has(t)})),_=T.id();0===T.length||p[_]||(T=T[0],c.push(T),t.bfs&&(p[_]=!0,h.push(T)),u[_]=k,d[_]=d[i]+1)}}),"_loop");0!==c.length;){var k=w();if("continue"!==k&&"break"===k)break}for(var T=o.collection(),_=0;_<h.length;_++){var E=h[_],C=u[E.id()];null!=C&&T.push(C),T.push(E)}return{path:o.collection(T),found:o.collection(a)}}),"searchFn")}),"defineSearch"),Qgt={breadthFirstSearch:Zgt({bfs:!0}),depthFirstSearch:Zgt({dfs:!0})};Qgt.bfs=Qgt.breadthFirstSearch,Qgt.dfs=Qgt.depthFirstSearch;var Jgt=_pt((function(t,e){(function(){var e,n,r,i,a,o,l,c,h,u,d,p,g,f,m;r=Math.floor,u=Math.min,n=s((function(t,e){return t<e?-1:t>e?1:0}),"defaultCmp"),h=s((function(t,e,i,a,s){var o;if(null==i&&(i=0),null==s&&(s=n),i<0)throw new Error("lo must be non-negative");for(null==a&&(a=t.length);i<a;)s(e,t[o=r((i+a)/2)])<0?a=o:i=o+1;return[].splice.apply(t,[i,i-i].concat(e)),e}),"insort"),o=s((function(t,e,r){return null==r&&(r=n),t.push(e),f(t,0,t.length-1,r)}),"heappush"),a=s((function(t,e){var r,i;return null==e&&(e=n),r=t.pop(),t.length?(i=t[0],t[0]=r,m(t,0,e)):i=r,i}),"heappop"),c=s((function(t,e,r){var i;return null==r&&(r=n),i=t[0],t[0]=e,m(t,0,r),i}),"heapreplace"),l=s((function(t,e,r){var i;return null==r&&(r=n),t.length&&r(t[0],e)<0&&(e=(i=[t[0],e])[0],t[0]=i[1],m(t,0,r)),e}),"heappushpop"),i=s((function(t,e){var i,a,s,o,l,c;for(null==e&&(e=n),l=[],a=0,s=(o=function(){c=[];for(var e=0,n=r(t.length/2);0<=n?e<n:e>n;0<=n?e++:e--)c.push(e);return c}.apply(this).reverse()).length;a<s;a++)i=o[a],l.push(m(t,i,e));return l}),"heapify"),g=s((function(t,e,r){var i;if(null==r&&(r=n),-1!==(i=t.indexOf(e)))return f(t,0,i,r),m(t,i,r)}),"updateItem"),d=s((function(t,e,r){var a,s,o,c,h;if(null==r&&(r=n),!(s=t.slice(0,e)).length)return s;for(i(s,r),o=0,c=(h=t.slice(e)).length;o<c;o++)a=h[o],l(s,a,r);return s.sort(r).reverse()}),"nlargest"),p=s((function(t,e,r){var s,o,l,c,d,p,g,f,m;if(null==r&&(r=n),10*e<=t.length){if(!(l=t.slice(0,e).sort(r)).length)return l;for(o=l[l.length-1],c=0,p=(g=t.slice(e)).length;c<p;c++)r(s=g[c],o)<0&&(h(l,s,0,null,r),l.pop(),o=l[l.length-1]);return l}for(i(t,r),m=[],d=0,f=u(e,t.length);0<=f?d<f:d>f;0<=f?++d:--d)m.push(a(t,r));return m}),"nsmallest"),f=s((function(t,e,r,i){var a,s,o;for(null==i&&(i=n),a=t[r];r>e&&i(a,s=t[o=r-1>>1])<0;)t[r]=s,r=o;return t[r]=a}),"_siftdown"),m=s((function(t,e,r){var i,a,s,o,l;for(null==r&&(r=n),a=t.length,l=e,s=t[e],i=2*e+1;i<a;)(o=i+1)<a&&!(r(t[i],t[o])<0)&&(i=o),t[e]=t[i],i=2*(e=i)+1;return t[e]=s,f(t,l,e,r)}),"_siftup"),e=function(){function t(t){this.cmp=null!=t?t:n,this.nodes=[]}return t.push=o,t.pop=a,t.replace=c,t.pushpop=l,t.heapify=i,t.updateItem=g,t.nlargest=d,t.nsmallest=p,s(t,"Heap"),t.prototype.push=function(t){return o(this.nodes,t,this.cmp)},t.prototype.pop=function(){return a(this.nodes,this.cmp)},t.prototype.peek=function(){return this.nodes[0]},t.prototype.contains=function(t){return-1!==this.nodes.indexOf(t)},t.prototype.replace=function(t){return c(this.nodes,t,this.cmp)},t.prototype.pushpop=function(t){return l(this.nodes,t,this.cmp)},t.prototype.heapify=function(){return i(this.nodes,this.cmp)},t.prototype.updateItem=function(t){return g(this.nodes,t,this.cmp)},t.prototype.clear=function(){return this.nodes=[]},t.prototype.empty=function(){return 0===this.nodes.length},t.prototype.size=function(){return this.nodes.length},t.prototype.clone=function(){var e;return(e=new t).nodes=this.nodes.slice(0),e},t.prototype.toArray=function(){return this.nodes.slice(0)},t.prototype.insert=t.prototype.push,t.prototype.top=t.prototype.peek,t.prototype.front=t.prototype.peek,t.prototype.has=t.prototype.contains,t.prototype.copy=t.prototype.clone,t}(),t.exports=e}).call(Tpt)})),tft=Jgt,eft=Ugt({root:null,weight:s((function(t){return 1}),"weight"),directed:!1}),nft={dijkstra:s((function(t){if(!Gdt(t)){var e=arguments;t={root:e[0],weight:e[1],directed:e[2]}}var n=eft(t),r=n.root,i=n.weight,a=n.directed,o=this,l=i,c=Fdt(r)?this.filter(r)[0]:r[0],h={},u={},d={},p=this.byGroup(),g=p.nodes,f=p.edges;f.unmergeBy((function(t){return t.isLoop()}));for(var m=s((function(t){return h[t.id()]}),"getDist"),y=s((function(t,e){h[t.id()]=e,v.updateItem(t)}),"setDist"),v=new tft((function(t,e){return m(t)-m(e)})),x=0;x<g.length;x++){var b=g[x];h[b.id()]=b.same(c)?0:1/0,v.push(b)}for(var w=s((function(t,e){for(var n,r=(a?t.edgesTo(e):t.edgesWith(e)).intersect(f),i=1/0,s=0;s<r.length;s++){var o=r[s],c=l(o);(c<i||!n)&&(i=c,n=o)}return{edge:n,dist:i}}),"distBetween");v.size()>0;){var k=v.pop(),T=m(k),_=k.id();if(d[_]=T,T!==1/0)for(var E=k.neighborhood().intersect(g),C=0;C<E.length;C++){var S=E[C],A=S.id(),L=w(k,S),N=T+L.dist;N<m(S)&&(y(S,N),u[A]={node:k,edge:L.edge})}}return{distanceTo:s((function(t){var e=Fdt(t)?g.filter(t)[0]:t[0];return d[e.id()]}),"distanceTo"),pathTo:s((function(t){var e=Fdt(t)?g.filter(t)[0]:t[0],n=[],r=e,i=r.id();if(e.length>0)for(n.unshift(e);u[i];){var a=u[i];n.unshift(a.edge),n.unshift(a.node),i=(r=a.node).id()}return o.spawn(n)}),"pathTo")}}),"dijkstra")},rft={kruskal:s((function(t){t=t||function(t){return 1};for(var e=this.byGroup(),n=e.nodes,r=e.edges,i=n.length,a=new Array(i),o=n,l=s((function(t){for(var e=0;e<a.length;e++){if(a[e].has(t))return e}}),"findSetIndex"),c=0;c<i;c++)a[c]=this.spawn(n[c]);for(var h=r.sort((function(e,n){return t(e)-t(n)})),u=0;u<h.length;u++){var d=h[u],p=d.source()[0],g=d.target()[0],f=l(p),m=l(g),y=a[f],v=a[m];f!==m&&(o.merge(d),y.merge(v),a.splice(m,1))}return o}),"kruskal")},ift=Ugt({root:null,goal:null,weight:s((function(t){return 1}),"weight"),heuristic:s((function(t){return 0}),"heuristic"),directed:!1}),aft={aStar:s((function(t){var e=this.cy(),n=ift(t),r=n.root,i=n.goal,a=n.heuristic,o=n.directed,l=n.weight;r=e.collection(r)[0],i=e.collection(i)[0];var c,h,u=r.id(),d=i.id(),p={},g={},f={},m=new tft((function(t,e){return g[t.id()]-g[e.id()]})),y=new Xgt,v={},x={},b=s((function(t,e){m.push(t),y.add(e)}),"addToOpenSet"),w=s((function(){c=m.pop(),h=c.id(),y.delete(h)}),"popFromOpenSet"),k=s((function(t){return y.has(t)}),"isInOpenSet");b(r,u),p[u]=0,g[u]=a(r);for(var T=0;m.size()>0;){if(w(),T++,h===d){for(var _=[],E=i,C=d,S=x[C];_.unshift(E),null!=S&&_.unshift(S),null!=(E=v[C]);)S=x[C=E.id()];return{found:!0,distance:p[h],path:this.spawn(_),steps:T}}f[h]=!0;for(var A=c._private.edges,L=0;L<A.length;L++){var N=A[L];if(this.hasElementWithId(N.id())&&(!o||N.data("source")===h)){var I=N.source(),M=N.target(),R=I.id()!==h?I:M,D=R.id();if(this.hasElementWithId(D)&&!f[D]){var O=p[h]+l(N);k(D)?O<p[D]&&(p[D]=O,g[D]=O+a(R),v[D]=c,x[D]=N):(p[D]=O,g[D]=O+a(R),b(R,D),v[D]=c,x[D]=N)}}}}return{found:!1,distance:void 0,path:void 0,steps:T}}),"aStar")},sft=Ugt({weight:s((function(t){return 1}),"weight"),directed:!1}),oft={floydWarshall:s((function(t){for(var e=this.cy(),n=sft(t),r=n.weight,i=n.directed,a=r,o=this.byGroup(),l=o.nodes,c=o.edges,h=l.length,u=h*h,d=s((function(t){return l.indexOf(t)}),"indexOf"),p=s((function(t){return l[t]}),"atIndex"),g=new Array(u),f=0;f<u;f++){var m=f%h,y=(f-m)/h;g[f]=y===m?0:1/0}for(var v=new Array(u),x=new Array(u),b=0;b<c.length;b++){var w=c[b],k=w.source()[0],T=w.target()[0];if(k!==T){var _=d(k),E=d(T),C=_*h+E,S=a(w);if(g[C]>S&&(g[C]=S,v[C]=E,x[C]=w),!i){var A=E*h+_;!i&&g[A]>S&&(g[A]=S,v[A]=_,x[A]=w)}}}for(var L=0;L<h;L++)for(var N=0;N<h;N++)for(var I=N*h+L,M=0;M<h;M++){var R=N*h+M,D=L*h+M;g[I]+g[D]<g[R]&&(g[R]=g[I]+g[D],v[R]=v[I])}var O=s((function(t){return(Fdt(t)?e.filter(t):t)[0]}),"getArgEle"),P=s((function(t){return d(O(t))}),"indexOfArgEle"),B={distance:s((function(t,e){var n=P(t),r=P(e);return g[n*h+r]}),"distance"),path:s((function(t,n){var r=P(t),i=P(n),a=p(r);if(r===i)return a.collection();if(null==v[r*h+i])return e.collection();var s,o=e.collection(),l=r;for(o.merge(a);r!==i;)l=r,r=v[r*h+i],s=x[l*h+r],o.merge(s),o.merge(p(r));return o}),"path")};return B}),"floydWarshall")},lft=Ugt({weight:s((function(t){return 1}),"weight"),directed:!1,root:null}),cft={bellmanFord:s((function(t){var e=this,n=lft(t),r=n.weight,i=n.directed,a=n.root,o=r,l=this,c=this.cy(),h=this.byGroup(),u=h.edges,d=h.nodes,p=d.length,g=new Hgt,f=!1,m=[];a=c.collection(a)[0],u.unmergeBy((function(t){return t.isLoop()}));for(var y=u.length,v=s((function(t){var e=g.get(t.id());return e||(e={},g.set(t.id(),e)),e}),"getInfo"),x=s((function(t){return(Fdt(t)?c.$(t):t)[0]}),"getNodeFromTo"),b=s((function(t){return v(x(t)).dist}),"distanceTo"),w=s((function(t){for(var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:a,r=x(t),i=[],s=r;;){if(null==s)return e.spawn();var o=v(s),c=o.edge,h=o.pred;if(i.unshift(s[0]),s.same(n)&&i.length>0)break;null!=c&&i.unshift(c),s=h}return l.spawn(i)}),"pathTo"),k=0;k<p;k++){var T=d[k],_=v(T);T.same(a)?_.dist=0:_.dist=1/0,_.pred=null,_.edge=null}for(var E=!1,C=s((function(t,e,n,r,i,a){var s=r.dist+a;s<i.dist&&!n.same(r.edge)&&(i.dist=s,i.pred=t,i.edge=n,E=!0)}),"checkForEdgeReplacement"),S=1;S<p;S++){E=!1;for(var A=0;A<y;A++){var L=u[A],N=L.source(),I=L.target(),M=o(L),R=v(N),D=v(I);C(N,I,L,R,D,M),i||C(I,N,L,D,R,M)}if(!E)break}if(E)for(var O=[],P=0;P<y;P++){var B=u[P],$=B.source(),F=B.target(),z=o(B),U=v($).dist,G=v(F).dist;if(U+z<G||!i&&G+z<U){if(f||(Dgt("Graph contains a negative weight cycle for Bellman-Ford"),f=!0),!1===t.findNegativeWeightCycles)break;var q=[];U+z<G&&q.push($),!i&&G+z<U&&q.push(F);for(var j=q.length,Y=0;Y<j;Y++){var W=q[Y],H=[W];H.push(v(W).edge);for(var V=v(W).pred;-1===H.indexOf(V);)H.push(V),H.push(v(V).edge),V=v(V).pred;for(var X=(H=H.slice(H.indexOf(V)))[0].id(),K=0,Z=2;Z<H.length;Z+=2)H[Z].id()<X&&(X=H[Z].id(),K=Z);(H=H.slice(K).concat(H.slice(0,K))).push(H[0]);var Q=H.map((function(t){return t.id()})).join(",");-1===O.indexOf(Q)&&(m.push(l.spawn(H)),O.push(Q))}}}return{distanceTo:b,pathTo:w,hasNegativeWeightCycle:f,negativeWeightCycles:m}}),"bellmanFord")},hft=Math.sqrt(2),uft=s((function(t,e,n){0===n.length&&Mgt("Karger-Stein must be run on a connected (sub)graph");for(var r=n[t],i=r[1],a=r[2],s=e[i],o=e[a],l=n,c=l.length-1;c>=0;c--){var h=l[c],u=h[1],d=h[2];(e[u]===s&&e[d]===o||e[u]===o&&e[d]===s)&&l.splice(c,1)}for(var p=0;p<l.length;p++){var g=l[p];g[1]===o?(l[p]=g.slice(),l[p][1]=s):g[2]===o&&(l[p]=g.slice(),l[p][2]=s)}for(var f=0;f<e.length;f++)e[f]===o&&(e[f]=s);return l}),"collapse"),dft=s((function(t,e,n,r){for(;n>r;){var i=Math.floor(Math.random()*e.length);e=uft(i,t,e),n--}return e}),"contractUntil"),pft={kargerStein:s((function(){var t=this,e=this.byGroup(),n=e.nodes,r=e.edges;r.unmergeBy((function(t){return t.isLoop()}));var i=n.length,a=r.length,o=Math.ceil(Math.pow(Math.log(i)/Math.LN2,2)),l=Math.floor(i/hft);if(!(i<2)){for(var c=[],h=0;h<a;h++){var u=r[h];c.push([h,n.indexOf(u.source()),n.indexOf(u.target())])}for(var d=1/0,p=[],g=new Array(i),f=new Array(i),m=new Array(i),y=s((function(t,e){for(var n=0;n<i;n++)e[n]=t[n]}),"copyNodesMap"),v=0;v<=o;v++){for(var x=0;x<i;x++)f[x]=x;var b=dft(f,c.slice(),i,l),w=b.slice();y(f,m);var k=dft(f,b,l,2),T=dft(m,w,l,2);k.length<=T.length&&k.length<d?(d=k.length,p=k,y(f,g)):T.length<=k.length&&T.length<d&&(d=T.length,p=T,y(m,g))}for(var _=this.spawn(p.map((function(t){return r[t[0]]}))),E=this.spawn(),C=this.spawn(),S=g[0],A=0;A<g.length;A++){var L=g[A],N=n[A];L===S?E.merge(N):C.merge(N)}var I=s((function(e){var n=t.spawn();return e.forEach((function(e){n.merge(e),e.connectedEdges().forEach((function(e){t.contains(e)&&!_.contains(e)&&n.merge(e)}))})),n}),"constructComponent"),M=[I(E),I(C)];return{cut:_,components:M,partition1:E,partition2:C}}Mgt("At least 2 nodes are required for Karger-Stein algorithm")}),"kargerStein")},gft=s((function(t){return{x:t.x,y:t.y}}),"copyPosition"),fft=s((function(t,e,n){return{x:t.x*e+n.x,y:t.y*e+n.y}}),"modelToRenderedPosition"),mft=s((function(t,e,n){return{x:(t.x-n.x)/e,y:(t.y-n.y)/e}}),"renderedToModelPosition"),yft=s((function(t){return{x:t[0],y:t[1]}}),"array2point"),vft=s((function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t.length,r=1/0,i=e;i<n;i++){var a=t[i];isFinite(a)&&(r=Math.min(a,r))}return r}),"min"),xft=s((function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t.length,r=-1/0,i=e;i<n;i++){var a=t[i];isFinite(a)&&(r=Math.max(a,r))}return r}),"max"),bft=s((function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t.length,r=0,i=0,a=e;a<n;a++){var s=t[a];isFinite(s)&&(r+=s,i++)}return r/i}),"mean"),wft=s((function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t.length,r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],a=!(arguments.length>5&&void 0!==arguments[5])||arguments[5];r?t=t.slice(e,n):(n<t.length&&t.splice(n,t.length-n),e>0&&t.splice(0,e));for(var s=0,o=t.length-1;o>=0;o--){var l=t[o];a?isFinite(l)||(t[o]=-1/0,s++):t.splice(o,1)}i&&t.sort((function(t,e){return t-e}));var c=t.length,h=Math.floor(c/2);return c%2!=0?t[h+1+s]:(t[h-1+s]+t[h+s])/2}),"median"),kft=s((function(t){return Math.PI*t/180}),"deg2rad"),Tft=s((function(t,e){return Math.atan2(e,t)-Math.PI/2}),"getAngleFromDisp"),_ft=Math.log2||function(t){return Math.log(t)/Math.log(2)},Eft=s((function(t){return t>0?1:t<0?-1:0}),"signum"),Cft=s((function(t,e){return Math.sqrt(Sft(t,e))}),"dist"),Sft=s((function(t,e){var n=e.x-t.x,r=e.y-t.y;return n*n+r*r}),"sqdist"),Aft=s((function(t){for(var e=t.length,n=0,r=0;r<e;r++)n+=t[r];for(var i=0;i<e;i++)t[i]=t[i]/n;return t}),"inPlaceSumNormalize"),Lft=s((function(t,e,n,r){return(1-r)*(1-r)*t+2*(1-r)*r*e+r*r*n}),"qbezierAt"),Nft=s((function(t,e,n,r){return{x:Lft(t.x,e.x,n.x,r),y:Lft(t.y,e.y,n.y,r)}}),"qbezierPtAt"),Ift=s((function(t,e,n,r){var i=e.x-t.x,a=e.y-t.y,s=Cft(t,e),o=i/s,l=a/s;return n=null==n?0:n,r=null!=r?r:n*s,{x:t.x+o*r,y:t.y+l*r}}),"lineAt"),Mft=s((function(t,e,n){return Math.max(t,Math.min(n,e))}),"bound"),Rft=s((function(t){if(null==t)return{x1:1/0,y1:1/0,x2:-1/0,y2:-1/0,w:0,h:0};if(null!=t.x1&&null!=t.y1){if(null!=t.x2&&null!=t.y2&&t.x2>=t.x1&&t.y2>=t.y1)return{x1:t.x1,y1:t.y1,x2:t.x2,y2:t.y2,w:t.x2-t.x1,h:t.y2-t.y1};if(null!=t.w&&null!=t.h&&t.w>=0&&t.h>=0)return{x1:t.x1,y1:t.y1,x2:t.x1+t.w,y2:t.y1+t.h,w:t.w,h:t.h}}}),"makeBoundingBox"),Dft=s((function(t){return{x1:t.x1,x2:t.x2,w:t.w,y1:t.y1,y2:t.y2,h:t.h}}),"copyBoundingBox"),Oft=s((function(t){t.x1=1/0,t.y1=1/0,t.x2=-1/0,t.y2=-1/0,t.w=0,t.h=0}),"clearBoundingBox"),Pft=s((function(t,e,n){return{x1:t.x1+e,x2:t.x2+e,y1:t.y1+n,y2:t.y2+n,w:t.w,h:t.h}}),"shiftBoundingBox"),Bft=s((function(t,e){t.x1=Math.min(t.x1,e.x1),t.x2=Math.max(t.x2,e.x2),t.w=t.x2-t.x1,t.y1=Math.min(t.y1,e.y1),t.y2=Math.max(t.y2,e.y2),t.h=t.y2-t.y1}),"updateBoundingBox"),$ft=s((function(t,e,n){t.x1=Math.min(t.x1,e),t.x2=Math.max(t.x2,e),t.w=t.x2-t.x1,t.y1=Math.min(t.y1,n),t.y2=Math.max(t.y2,n),t.h=t.y2-t.y1}),"expandBoundingBoxByPoint"),Fft=s((function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return t.x1-=e,t.x2+=e,t.y1-=e,t.y2+=e,t.w=t.x2-t.x1,t.h=t.y2-t.y1,t}),"expandBoundingBox"),zft=s((function(t){var e,n,r,i,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0];if(1===a.length)e=n=r=i=a[0];else if(2===a.length)e=r=a[0],i=n=a[1];else if(4===a.length){var s=Edt(a,4);e=s[0],n=s[1],r=s[2],i=s[3]}return t.x1-=i,t.x2+=n,t.y1-=e,t.y2+=r,t.w=t.x2-t.x1,t.h=t.y2-t.y1,t}),"expandBoundingBoxSides"),Uft=s((function(t,e){t.x1=e.x1,t.y1=e.y1,t.x2=e.x2,t.y2=e.y2,t.w=t.x2-t.x1,t.h=t.y2-t.y1}),"assignBoundingBox"),Gft=s((function(t,e){return!(t.x1>e.x2)&&(!(e.x1>t.x2)&&(!(t.x2<e.x1)&&(!(e.x2<t.x1)&&(!(t.y2<e.y1)&&(!(e.y2<t.y1)&&(!(t.y1>e.y2)&&!(e.y1>t.y2)))))))}),"boundingBoxesIntersect"),qft=s((function(t,e,n){return t.x1<=e&&e<=t.x2&&t.y1<=n&&n<=t.y2}),"inBoundingBox"),jft=s((function(t,e){return qft(t,e.x,e.y)}),"pointInBoundingBox"),Yft=s((function(t,e){return qft(t,e.x1,e.y1)&&qft(t,e.x2,e.y2)}),"boundingBoxInBoundingBox"),Wft=s((function(t,e,n,r,i,a,s){var o,l,c=arguments.length>7&&void 0!==arguments[7]?arguments[7]:"auto",h="auto"===c?fmt(i,a):c,u=i/2,d=a/2,p=(h=Math.min(h,u,d))!==u,g=h!==d;if(p){var f=n-u+h-s,m=r-d-s,y=n+u-h+s,v=m;if((o=lmt(t,e,n,r,f,m,y,v,!1)).length>0)return o}if(g){var x=n+u+s,b=r-d+h-s,w=x,k=r+d-h+s;if((o=lmt(t,e,n,r,x,b,w,k,!1)).length>0)return o}if(p){var T=n-u+h-s,_=r+d+s,E=n+u-h+s,C=_;if((o=lmt(t,e,n,r,T,_,E,C,!1)).length>0)return o}if(g){var S=n-u-s,A=r-d+h-s,L=S,N=r+d-h+s;if((o=lmt(t,e,n,r,S,A,L,N,!1)).length>0)return o}var I=n-u+h,M=r-d+h;if((l=smt(t,e,n,r,I,M,h+s)).length>0&&l[0]<=I&&l[1]<=M)return[l[0],l[1]];var R=n+u-h,D=r-d+h;if((l=smt(t,e,n,r,R,D,h+s)).length>0&&l[0]>=R&&l[1]<=D)return[l[0],l[1]];var O=n+u-h,P=r+d-h;if((l=smt(t,e,n,r,O,P,h+s)).length>0&&l[0]>=O&&l[1]>=P)return[l[0],l[1]];var B=n-u+h,$=r+d-h;return(l=smt(t,e,n,r,B,$,h+s)).length>0&&l[0]<=B&&l[1]>=$?[l[0],l[1]]:[]}),"roundRectangleIntersectLine"),Hft=s((function(t,e,n,r,i,a,s){var o=s,l=Math.min(n,i),c=Math.max(n,i),h=Math.min(r,a),u=Math.max(r,a);return l-o<=t&&t<=c+o&&h-o<=e&&e<=u+o}),"inLineVicinity"),Vft=s((function(t,e,n,r,i,a,s,o,l){var c=Math.min(n,s,i)-l,h=Math.max(n,s,i)+l,u=Math.min(r,o,a)-l,d=Math.max(r,o,a)+l;return!(t<c||t>h||e<u||e>d)}),"inBezierVicinity"),Xft=s((function(t,e,n,r){var i=e*e-4*t*(n-=r);if(i<0)return[];var a=Math.sqrt(i),s=2*t;return[(-e+a)/s,(-e-a)/s]}),"solveQuadratic"),Kft=s((function(t,e,n,r,i){var a,s,o,l,c,h,u,d;return 0===t&&(t=1e-5),o=-27*(r/=t)+(e/=t)*(9*(n/=t)-e*e*2),a=(s=(3*n-e*e)/9)*s*s+(o/=54)*o,i[1]=0,u=e/3,a>0?(c=(c=o+Math.sqrt(a))<0?-Math.pow(-c,1/3):Math.pow(c,1/3),h=(h=o-Math.sqrt(a))<0?-Math.pow(-h,1/3):Math.pow(h,1/3),i[0]=-u+c+h,u+=(c+h)/2,i[4]=i[2]=-u,u=Math.sqrt(3)*(-h+c)/2,i[3]=u,void(i[5]=-u)):(i[5]=i[3]=0,0===a?(d=o<0?-Math.pow(-o,1/3):Math.pow(o,1/3),i[0]=2*d-u,void(i[4]=i[2]=-(d+u))):(l=(s=-s)*s*s,l=Math.acos(o/Math.sqrt(l)),d=2*Math.sqrt(s),i[0]=-u+d*Math.cos(l/3),i[2]=-u+d*Math.cos((l+2*Math.PI)/3),void(i[4]=-u+d*Math.cos((l+4*Math.PI)/3))))}),"solveCubic"),Zft=s((function(t,e,n,r,i,a,s,o){var l=[];Kft(1*n*n-4*n*i+2*n*s+4*i*i-4*i*s+s*s+r*r-4*r*a+2*r*o+4*a*a-4*a*o+o*o,9*n*i-3*n*n-3*n*s-6*i*i+3*i*s+9*r*a-3*r*r-3*r*o-6*a*a+3*a*o,3*n*n-6*n*i+n*s-n*t+2*i*i+2*i*t-s*t+3*r*r-6*r*a+r*o-r*e+2*a*a+2*a*e-o*e,1*n*i-n*n+n*t-i*t+r*a-r*r+r*e-a*e,l);for(var c=[],h=0;h<6;h+=2)Math.abs(l[h+1])<1e-7&&l[h]>=0&&l[h]<=1&&c.push(l[h]);c.push(1),c.push(0);for(var u,d,p,g=-1,f=0;f<c.length;f++)u=Math.pow(1-c[f],2)*n+2*(1-c[f])*c[f]*i+c[f]*c[f]*s,d=Math.pow(1-c[f],2)*r+2*(1-c[f])*c[f]*a+c[f]*c[f]*o,p=Math.pow(u-t,2)+Math.pow(d-e,2),g>=0?p<g&&(g=p):g=p;return g}),"sqdistToQuadraticBezier"),Qft=s((function(t,e,n,r,i,a){var s=[t-n,e-r],o=[i-n,a-r],l=o[0]*o[0]+o[1]*o[1],c=s[0]*s[0]+s[1]*s[1],h=s[0]*o[0]+s[1]*o[1],u=h*h/l;return h<0?c:u>l?(t-i)*(t-i)+(e-a)*(e-a):c-u}),"sqdistToFiniteLine"),Jft=s((function(t,e,n){for(var r,i,a,s,o=0,l=0;l<n.length/2;l++)if(r=n[2*l],i=n[2*l+1],l+1<n.length/2?(a=n[2*(l+1)],s=n[2*(l+1)+1]):(a=n[2*(l+1-n.length/2)],s=n[2*(l+1-n.length/2)+1]),r==t&&a==t);else{if(!(r>=t&&t>=a||r<=t&&t<=a))continue;(t-r)/(a-r)*(s-i)+i>e&&o++}return o%2!=0}),"pointInsidePolygonPoints"),tmt=s((function(t,e,n,r,i,a,s,o,l){var c,h=new Array(n.length);null!=o[0]?(c=Math.atan(o[1]/o[0]),o[0]<0?c+=Math.PI/2:c=-c-Math.PI/2):c=o;for(var u,d=Math.cos(-c),p=Math.sin(-c),g=0;g<h.length/2;g++)h[2*g]=a/2*(n[2*g]*d-n[2*g+1]*p),h[2*g+1]=s/2*(n[2*g+1]*d+n[2*g]*p),h[2*g]+=r,h[2*g+1]+=i;if(l>0){var f=rmt(h,-l);u=nmt(f)}else u=h;return Jft(t,e,u)}),"pointInsidePolygon"),emt=s((function(t,e,n,r,i,a,s,o){for(var l=new Array(2*n.length),c=0;c<o.length;c++){var h=o[c];if(l[4*c+0]=h.startX,l[4*c+1]=h.startY,l[4*c+2]=h.stopX,l[4*c+3]=h.stopY,Math.pow(h.cx-t,2)+Math.pow(h.cy-e,2)<=Math.pow(h.radius,2))return!0}return Jft(t,e,l)}),"pointInsideRoundPolygon"),nmt=s((function(t){for(var e,n,r,i,a,s,o,l,c=new Array(t.length/2),h=0;h<t.length/4;h++){e=t[4*h],n=t[4*h+1],r=t[4*h+2],i=t[4*h+3],h<t.length/4-1?(a=t[4*(h+1)],s=t[4*(h+1)+1],o=t[4*(h+1)+2],l=t[4*(h+1)+3]):(a=t[0],s=t[1],o=t[2],l=t[3]);var u=lmt(e,n,r,i,a,s,o,l,!0);c[2*h]=u[0],c[2*h+1]=u[1]}return c}),"joinLines"),rmt=s((function(t,e){for(var n,r,i,a,s=new Array(2*t.length),o=0;o<t.length/2;o++){n=t[2*o],r=t[2*o+1],o<t.length/2-1?(i=t[2*(o+1)],a=t[2*(o+1)+1]):(i=t[0],a=t[1]);var l=a-r,c=-(i-n),h=Math.sqrt(l*l+c*c),u=l/h,d=c/h;s[4*o]=n+u*e,s[4*o+1]=r+d*e,s[4*o+2]=i+u*e,s[4*o+3]=a+d*e}return s}),"expandPolygon"),imt=s((function(t,e,n,r,i,a){var s=n-t,o=r-e;s/=i,o/=a;var l=Math.sqrt(s*s+o*o),c=l-1;if(c<0)return[];var h=c/l;return[(n-t)*h+t,(r-e)*h+e]}),"intersectLineEllipse"),amt=s((function(t,e,n,r,i,a,s){return t-=i,e-=a,(t/=n/2+s)*t+(e/=r/2+s)*e<=1}),"checkInEllipse"),smt=s((function(t,e,n,r,i,a,s){var o=[n-t,r-e],l=[t-i,e-a],c=o[0]*o[0]+o[1]*o[1],h=2*(l[0]*o[0]+l[1]*o[1]),u=h*h-4*c*(l[0]*l[0]+l[1]*l[1]-s*s);if(u<0)return[];var d=(-h+Math.sqrt(u))/(2*c),p=(-h-Math.sqrt(u))/(2*c),g=Math.min(d,p),f=Math.max(d,p),m=[];if(g>=0&&g<=1&&m.push(g),f>=0&&f<=1&&m.push(f),0===m.length)return[];var y=m[0]*o[0]+t,v=m[0]*o[1]+e;return m.length>1?m[0]==m[1]?[y,v]:[y,v,m[1]*o[0]+t,m[1]*o[1]+e]:[y,v]}),"intersectLineCircle"),omt=s((function(t,e,n){return e<=t&&t<=n||n<=t&&t<=e?t:t<=e&&e<=n||n<=e&&e<=t?e:n}),"midOfThree"),lmt=s((function(t,e,n,r,i,a,s,o,l){var c=t-i,h=n-t,u=s-i,d=e-a,p=r-e,g=o-a,f=u*d-g*c,m=h*d-p*c,y=g*h-u*p;if(0!==y){var v=f/y,x=m/y,b=-.001;return b<=v&&v<=1.001&&b<=x&&x<=1.001||l?[t+v*h,e+v*p]:[]}return 0===f||0===m?omt(t,n,s)===s?[s,o]:omt(t,n,i)===i?[i,a]:omt(i,s,n)===n?[n,r]:[]:[]}),"finiteLinesIntersect"),cmt=s((function(t,e,n,r,i,a,s,o){var l,c,h,u,d,p,g=[],f=new Array(n.length),m=!0;if(null==a&&(m=!1),m){for(var y=0;y<f.length/2;y++)f[2*y]=n[2*y]*a+r,f[2*y+1]=n[2*y+1]*s+i;if(o>0){var v=rmt(f,-o);c=nmt(v)}else c=f}else c=n;for(var x=0;x<c.length/2;x++)h=c[2*x],u=c[2*x+1],x<c.length/2-1?(d=c[2*(x+1)],p=c[2*(x+1)+1]):(d=c[0],p=c[1]),0!==(l=lmt(t,e,r,i,h,u,d,p)).length&&g.push(l[0],l[1]);return g}),"polygonIntersectLine"),hmt=s((function(t,e,n,r,i,a,s,o,l){var c,h=[],u=new Array(2*n.length);l.forEach((function(n,a){0===a?(u[u.length-2]=n.startX,u[u.length-1]=n.startY):(u[4*a-2]=n.startX,u[4*a-1]=n.startY),u[4*a]=n.stopX,u[4*a+1]=n.stopY,0!==(c=smt(t,e,r,i,n.cx,n.cy,n.radius)).length&&h.push(c[0],c[1])}));for(var d=0;d<u.length/4;d++)0!==(c=lmt(t,e,r,i,u[4*d],u[4*d+1],u[4*d+2],u[4*d+3],!1)).length&&h.push(c[0],c[1]);if(h.length>2){for(var p=[h[0],h[1]],g=Math.pow(p[0]-t,2)+Math.pow(p[1]-e,2),f=1;f<h.length/2;f++){var m=Math.pow(h[2*f]-t,2)+Math.pow(h[2*f+1]-e,2);m<=g&&(p[0]=h[2*f],p[1]=h[2*f+1],g=m)}return p}return h}),"roundPolygonIntersectLine"),umt=s((function(t,e,n){var r=[t[0]-e[0],t[1]-e[1]],i=Math.sqrt(r[0]*r[0]+r[1]*r[1]),a=(i-n)/i;return a<0&&(a=1e-5),[e[0]+a*r[0],e[1]+a*r[1]]}),"shortenIntersection"),dmt=s((function(t,e){var n=gmt(t,e);return n=pmt(n)}),"generateUnitNgonPointsFitToSquare"),pmt=s((function(t){for(var e,n,r=t.length/2,i=1/0,a=1/0,s=-1/0,o=-1/0,l=0;l<r;l++)e=t[2*l],n=t[2*l+1],i=Math.min(i,e),s=Math.max(s,e),a=Math.min(a,n),o=Math.max(o,n);for(var c=2/(s-i),h=2/(o-a),u=0;u<r;u++)e=t[2*u]=t[2*u]*c,n=t[2*u+1]=t[2*u+1]*h,i=Math.min(i,e),s=Math.max(s,e),a=Math.min(a,n),o=Math.max(o,n);if(a<-1)for(var d=0;d<r;d++)n=t[2*d+1]=t[2*d+1]+(-1-a);return t}),"fitPolygonToSquare"),gmt=s((function(t,e){var n=1/t*2*Math.PI,r=t%2==0?Math.PI/2+n/2:Math.PI/2;r+=e;for(var i,a=new Array(2*t),s=0;s<t;s++)i=s*n+r,a[2*s]=Math.cos(i),a[2*s+1]=Math.sin(-i);return a}),"generateUnitNgonPoints"),fmt=s((function(t,e){return Math.min(t/4,e/4,8)}),"getRoundRectangleRadius"),mmt=s((function(t,e){return Math.min(t/10,e/10,8)}),"getRoundPolygonRadius"),ymt=s((function(){return 8}),"getCutRectangleCornerLength"),vmt=s((function(t,e,n){return[t-2*e+n,2*(e-t),t]}),"bezierPtsToQuadCoeff"),xmt=s((function(t,e){return{heightOffset:Math.min(15,.05*e),widthOffset:Math.min(100,.25*t),ctrlPtOffsetPct:.05}}),"getBarrelCurveConstants"),bmt=Ugt({dampingFactor:.8,precision:1e-6,iterations:200,weight:s((function(t){return 1}),"weight")}),wmt={pageRank:s((function(t){for(var e=bmt(t),n=e.dampingFactor,r=e.precision,i=e.iterations,a=e.weight,o=this._private.cy,l=this.byGroup(),c=l.nodes,h=l.edges,u=c.length,d=u*u,p=h.length,g=new Array(d),f=new Array(u),m=(1-n)/u,y=0;y<u;y++){for(var v=0;v<u;v++){g[y*u+v]=0}f[y]=0}for(var x=0;x<p;x++){var b=h[x],w=b.data("source"),k=b.data("target");if(w!==k){var T=c.indexOfId(w),_=c.indexOfId(k),E=a(b);g[_*u+T]+=E,f[T]+=E}}for(var C=1/u+m,S=0;S<u;S++)if(0===f[S])for(var A=0;A<u;A++){g[A*u+S]=C}else for(var L=0;L<u;L++){var N=L*u+S;g[N]=g[N]/f[S]+m}for(var I,M=new Array(u),R=new Array(u),D=0;D<u;D++)M[D]=1;for(var O=0;O<i;O++){for(var P=0;P<u;P++)R[P]=0;for(var B=0;B<u;B++)for(var $=0;$<u;$++){var F=B*u+$;R[B]+=g[F]*M[$]}Aft(R),I=M,M=R,R=I;for(var z=0,U=0;U<u;U++){var G=I[U]-M[U];z+=G*G}if(z<r)break}var q={rank:s((function(t){return t=o.collection(t)[0],M[c.indexOf(t)]}),"rank")};return q}),"pageRank")},kmt=Ugt({root:null,weight:s((function(t){return 1}),"weight"),directed:!1,alpha:0}),Tmt={degreeCentralityNormalized:s((function(t){t=kmt(t);var e=this.cy(),n=this.nodes(),r=n.length;if(t.directed){for(var i={},a={},o=0,l=0,c=0;c<r;c++){var h=n[c],u=h.id();t.root=h;var d=this.degreeCentrality(t);o<d.indegree&&(o=d.indegree),l<d.outdegree&&(l=d.outdegree),i[u]=d.indegree,a[u]=d.outdegree}return{indegree:s((function(t){return 0==o?0:(Fdt(t)&&(t=e.filter(t)),i[t.id()]/o)}),"indegree"),outdegree:s((function(t){return 0===l?0:(Fdt(t)&&(t=e.filter(t)),a[t.id()]/l)}),"outdegree")}}for(var p={},g=0,f=0;f<r;f++){var m=n[f];t.root=m;var y=this.degreeCentrality(t);g<y.degree&&(g=y.degree),p[m.id()]=y.degree}return{degree:s((function(t){return 0===g?0:(Fdt(t)&&(t=e.filter(t)),p[t.id()]/g)}),"degree")}}),"degreeCentralityNormalized"),degreeCentrality:s((function(t){t=kmt(t);var e=this.cy(),n=this,r=t,i=r.root,a=r.weight,s=r.directed,o=r.alpha;if(i=e.collection(i)[0],s){for(var l=i.connectedEdges(),c=l.filter((function(t){return t.target().same(i)&&n.has(t)})),h=l.filter((function(t){return t.source().same(i)&&n.has(t)})),u=c.length,d=h.length,p=0,g=0,f=0;f<c.length;f++)p+=a(c[f]);for(var m=0;m<h.length;m++)g+=a(h[m]);return{indegree:Math.pow(u,1-o)*Math.pow(p,o),outdegree:Math.pow(d,1-o)*Math.pow(g,o)}}for(var y=i.connectedEdges().intersection(n),v=y.length,x=0,b=0;b<y.length;b++)x+=a(y[b]);return{degree:Math.pow(v,1-o)*Math.pow(x,o)}}),"degreeCentrality")};Tmt.dc=Tmt.degreeCentrality,Tmt.dcn=Tmt.degreeCentralityNormalised=Tmt.degreeCentralityNormalized;var _mt=Ugt({harmonic:!0,weight:s((function(){return 1}),"weight"),directed:!1,root:null}),Emt={closenessCentralityNormalized:s((function(t){for(var e=_mt(t),n=e.harmonic,r=e.weight,i=e.directed,a=this.cy(),o={},l=0,c=this.nodes(),h=this.floydWarshall({weight:r,directed:i}),u=0;u<c.length;u++){for(var d=0,p=c[u],g=0;g<c.length;g++)if(u!==g){var f=h.distance(p,c[g]);d+=n?1/f:f}n||(d=1/d),l<d&&(l=d),o[p.id()]=d}return{closeness:s((function(t){return 0==l?0:(t=Fdt(t)?a.filter(t)[0].id():t.id(),o[t]/l)}),"closeness")}}),"closenessCentralityNormalized"),closenessCentrality:s((function(t){var e=_mt(t),n=e.root,r=e.weight,i=e.directed,a=e.harmonic;n=this.filter(n)[0];for(var s=this.dijkstra({root:n,weight:r,directed:i}),o=0,l=this.nodes(),c=0;c<l.length;c++){var h=l[c];if(!h.same(n)){var u=s.distanceTo(h);o+=a?1/u:u}}return a?o:1/o}),"closenessCentrality")};Emt.cc=Emt.closenessCentrality,Emt.ccn=Emt.closenessCentralityNormalised=Emt.closenessCentralityNormalized;var Cmt=Ugt({weight:null,directed:!1}),Smt={betweennessCentrality:s((function(t){for(var e=Cmt(t),n=e.directed,r=e.weight,i=null!=r,a=this.cy(),o=this.nodes(),l={},c={},h=0,u={set:s((function(t,e){c[t]=e,e>h&&(h=e)}),"set"),get:s((function(t){return c[t]}),"get")},d=0;d<o.length;d++){var p=o[d],g=p.id();l[g]=n?p.outgoers().nodes():p.openNeighborhood().nodes(),u.set(g,0)}for(var f=s((function(t){for(var e=o[t].id(),n=[],s={},c={},h={},d=new tft((function(t,e){return h[t]-h[e]})),p=0;p<o.length;p++){var g=o[p].id();s[g]=[],c[g]=0,h[g]=1/0}for(c[e]=1,h[e]=0,d.push(e);!d.empty();){var f=d.pop();if(n.push(f),i)for(var m=0;m<l[f].length;m++){var y=l[f][m],v=a.getElementById(f),x=void 0;x=v.edgesTo(y).length>0?v.edgesTo(y)[0]:y.edgesTo(v)[0];var b=r(x);y=y.id(),h[y]>h[f]+b&&(h[y]=h[f]+b,d.nodes.indexOf(y)<0?d.push(y):d.updateItem(y),c[y]=0,s[y]=[]),h[y]==h[f]+b&&(c[y]=c[y]+c[f],s[y].push(f))}else for(var w=0;w<l[f].length;w++){var k=l[f][w].id();h[k]==1/0&&(d.push(k),h[k]=h[f]+1),h[k]==h[f]+1&&(c[k]=c[k]+c[f],s[k].push(f))}}for(var T={},_=0;_<o.length;_++)T[o[_].id()]=0;for(;n.length>0;){for(var E=n.pop(),C=0;C<s[E].length;C++){var S=s[E][C];T[S]=T[S]+c[S]/c[E]*(1+T[E])}E!=o[t].id()&&u.set(E,u.get(E)+T[E])}}),"_loop"),m=0;m<o.length;m++)f(m);var y={betweenness:s((function(t){var e=a.collection(t).id();return u.get(e)}),"betweenness"),betweennessNormalized:s((function(t){if(0==h)return 0;var e=a.collection(t).id();return u.get(e)/h}),"betweennessNormalized")};return y.betweennessNormalised=y.betweennessNormalized,y}),"betweennessCentrality")};Smt.bc=Smt.betweennessCentrality;var Amt=Ugt({expandFactor:2,inflateFactor:2,multFactor:1,maxIterations:20,attributes:[function(t){return 1}]}),Lmt=s((function(t){return Amt(t)}),"setOptions"),Nmt=s((function(t,e){for(var n=0,r=0;r<e.length;r++)n+=e[r](t);return n}),"getSimilarity"),Imt=s((function(t,e,n){for(var r=0;r<e;r++)t[r*e+r]=n}),"addLoops"),Mmt=s((function(t,e){for(var n,r=0;r<e;r++){n=0;for(var i=0;i<e;i++)n+=t[i*e+r];for(var a=0;a<e;a++)t[a*e+r]=t[a*e+r]/n}}),"normalize"),Rmt=s((function(t,e,n){for(var r=new Array(n*n),i=0;i<n;i++){for(var a=0;a<n;a++)r[i*n+a]=0;for(var s=0;s<n;s++)for(var o=0;o<n;o++)r[i*n+o]+=t[i*n+s]*e[s*n+o]}return r}),"mmult"),Dmt=s((function(t,e,n){for(var r=t.slice(0),i=1;i<n;i++)t=Rmt(t,r,e);return t}),"expand"),Omt=s((function(t,e,n){for(var r=new Array(e*e),i=0;i<e*e;i++)r[i]=Math.pow(t[i],n);return Mmt(r,e),r}),"inflate"),Pmt=s((function(t,e,n,r){for(var i=0;i<n;i++){if(Math.round(t[i]*Math.pow(10,r))/Math.pow(10,r)!==Math.round(e[i]*Math.pow(10,r))/Math.pow(10,r))return!1}return!0}),"hasConverged"),Bmt=s((function(t,e,n,r){for(var i=[],a=0;a<e;a++){for(var s=[],o=0;o<e;o++)Math.round(1e3*t[a*e+o])/1e3>0&&s.push(n[o]);0!==s.length&&i.push(r.collection(s))}return i}),"assign"),$mt=s((function(t,e){for(var n=0;n<t.length;n++)if(!e[n]||t[n].id()!==e[n].id())return!1;return!0}),"isDuplicate"),Fmt=s((function(t){for(var e=0;e<t.length;e++)for(var n=0;n<t.length;n++)e!=n&&$mt(t[e],t[n])&&t.splice(n,1);return t}),"removeDuplicates"),zmt=s((function(t){for(var e=this.nodes(),n=this.edges(),r=this.cy(),i=Lmt(t),a={},s=0;s<e.length;s++)a[e[s].id()]=s;for(var o,l=e.length,c=l*l,h=new Array(c),u=0;u<c;u++)h[u]=0;for(var d=0;d<n.length;d++){var p=n[d],g=a[p.source().id()],f=a[p.target().id()],m=Nmt(p,i.attributes);h[g*l+f]+=m,h[f*l+g]+=m}Imt(h,l,i.multFactor),Mmt(h,l);for(var y=!0,v=0;y&&v<i.maxIterations;)y=!1,o=Dmt(h,l,i.expandFactor),h=Omt(o,l,i.inflateFactor),Pmt(h,o,c,4)||(y=!0),v++;var x=Bmt(h,l,e,r);return x=Fmt(x)}),"markovClustering"),Umt={markovClustering:zmt,mcl:zmt},Gmt=s((function(t){return t}),"identity"),qmt=s((function(t,e){return Math.abs(e-t)}),"absDiff"),jmt=s((function(t,e,n){return t+qmt(e,n)}),"addAbsDiff"),Ymt=s((function(t,e,n){return t+Math.pow(n-e,2)}),"addSquaredDiff"),Wmt=s((function(t){return Math.sqrt(t)}),"sqrt"),Hmt=s((function(t,e,n){return Math.max(t,qmt(e,n))}),"maxAbsDiff"),Vmt=s((function(t,e,n,r,i){for(var a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:Gmt,s=r,o=0;o<t;o++)s=i(s,e(o),n(o));return a(s)}),"getDistance"),Xmt={euclidean:s((function(t,e,n){return t>=2?Vmt(t,e,n,0,Ymt,Wmt):Vmt(t,e,n,0,jmt)}),"euclidean"),squaredEuclidean:s((function(t,e,n){return Vmt(t,e,n,0,Ymt)}),"squaredEuclidean"),manhattan:s((function(t,e,n){return Vmt(t,e,n,0,jmt)}),"manhattan"),max:s((function(t,e,n){return Vmt(t,e,n,-1/0,Hmt)}),"max")};function Kmt(t,e,n,r,i,a){var s;return s=zdt(t)?t:Xmt[t]||Xmt.euclidean,0===e&&zdt(t)?s(i,a):s(e,n,r,i,a)}Xmt["squared-euclidean"]=Xmt.squaredEuclidean,Xmt.squaredeuclidean=Xmt.squaredEuclidean,s(Kmt,"clusteringDistance");var Zmt=Ugt({k:2,m:2,sensitivityThreshold:1e-4,distance:"euclidean",maxIterations:10,attributes:[],testMode:!1,testCentroids:null}),Qmt=s((function(t){return Zmt(t)}),"setOptions"),Jmt=s((function(t,e,n,r,i){var a="kMedoids"!==i?function(t){return n[t]}:function(t){return r[t](n)},o=s((function(t){return r[t](e)}),"getQ"),l=n,c=e;return Kmt(t,r.length,a,o,l,c)}),"getDist"),tyt=s((function(t,e,n){for(var r=n.length,i=new Array(r),a=new Array(r),s=new Array(e),o=null,l=0;l<r;l++)i[l]=t.min(n[l]).value,a[l]=t.max(n[l]).value;for(var c=0;c<e;c++){o=[];for(var h=0;h<r;h++)o[h]=Math.random()*(a[h]-i[h])+i[h];s[c]=o}return s}),"randomCentroids"),eyt=s((function(t,e,n,r,i){for(var a=1/0,s=0,o=0;o<e.length;o++){var l=Jmt(n,t,e[o],r,i);l<a&&(a=l,s=o)}return s}),"classify"),nyt=s((function(t,e,n){for(var r=[],i=null,a=0;a<e.length;a++)n[(i=e[a]).id()]===t&&r.push(i);return r}),"buildCluster"),ryt=s((function(t,e,n){return Math.abs(e-t)<=n}),"haveValuesConverged"),iyt=s((function(t,e,n){for(var r=0;r<t.length;r++)for(var i=0;i<t[r].length;i++){if(Math.abs(t[r][i]-e[r][i])>n)return!1}return!0}),"haveMatricesConverged"),ayt=s((function(t,e,n){for(var r=0;r<n;r++)if(t===e[r])return!0;return!1}),"seenBefore"),syt=s((function(t,e){var n=new Array(e);if(t.length<50)for(var r=0;r<e;r++){for(var i=t[Math.floor(Math.random()*t.length)];ayt(i,n,r);)i=t[Math.floor(Math.random()*t.length)];n[r]=i}else for(var a=0;a<e;a++)n[a]=t[Math.floor(Math.random()*t.length)];return n}),"randomMedoids"),oyt=s((function(t,e,n){for(var r=0,i=0;i<e.length;i++)r+=Jmt("manhattan",e[i],t,n,"kMedoids");return r}),"findCost"),lyt=s((function(t){var e,n=this.cy(),r=this.nodes(),i=null,a=Qmt(t),s=new Array(a.k),o={};a.testMode?"number"==typeof a.testCentroids?(a.testCentroids,e=tyt(r,a.k,a.attributes)):e="object"===bdt(a.testCentroids)?a.testCentroids:tyt(r,a.k,a.attributes):e=tyt(r,a.k,a.attributes);for(var l=!0,c=0;l&&c<a.maxIterations;){for(var h=0;h<r.length;h++)o[(i=r[h]).id()]=eyt(i,e,a.distance,a.attributes,"kMeans");l=!1;for(var u=0;u<a.k;u++){var d=nyt(u,r,o);if(0!==d.length){for(var p=a.attributes.length,g=e[u],f=new Array(p),m=new Array(p),y=0;y<p;y++){m[y]=0;for(var v=0;v<d.length;v++)i=d[v],m[y]+=a.attributes[y](i);f[y]=m[y]/d.length,ryt(f[y],g[y],a.sensitivityThreshold)||(l=!0)}e[u]=f,s[u]=n.collection(d)}}c++}return s}),"kMeans"),cyt=s((function(t){var e,n,r=this.cy(),i=this.nodes(),a=null,s=Qmt(t),o=new Array(s.k),l={},c=new Array(s.k);s.testMode?"number"==typeof s.testCentroids||(e="object"===bdt(s.testCentroids)?s.testCentroids:syt(i,s.k)):e=syt(i,s.k);for(var h=!0,u=0;h&&u<s.maxIterations;){for(var d=0;d<i.length;d++)l[(a=i[d]).id()]=eyt(a,e,s.distance,s.attributes,"kMedoids");h=!1;for(var p=0;p<e.length;p++){var g=nyt(p,i,l);if(0!==g.length){c[p]=oyt(e[p],g,s.attributes);for(var f=0;f<g.length;f++)(n=oyt(g[f],g,s.attributes))<c[p]&&(c[p]=n,e[p]=g[f],h=!0);o[p]=r.collection(g)}}u++}return o}),"kMedoids"),hyt=s((function(t,e,n,r,i){for(var a,s,o=0;o<e.length;o++)for(var l=0;l<t.length;l++)r[o][l]=Math.pow(n[o][l],i.m);for(var c=0;c<t.length;c++)for(var h=0;h<i.attributes.length;h++){a=0,s=0;for(var u=0;u<e.length;u++)a+=r[u][c]*i.attributes[h](e[u]),s+=r[u][c];t[c][h]=a/s}}),"updateCentroids"),uyt=s((function(t,e,n,r,i){for(var a=0;a<t.length;a++)e[a]=t[a].slice();for(var s,o,l,c=2/(i.m-1),h=0;h<n.length;h++)for(var u=0;u<r.length;u++){s=0;for(var d=0;d<n.length;d++)o=Jmt(i.distance,r[u],n[h],i.attributes,"cmeans"),l=Jmt(i.distance,r[u],n[d],i.attributes,"cmeans"),s+=Math.pow(o/l,c);t[u][h]=1/s}}),"updateMembership"),dyt=s((function(t,e,n,r){for(var i,a,s=new Array(n.k),o=0;o<s.length;o++)s[o]=[];for(var l=0;l<e.length;l++){i=-1/0,a=-1;for(var c=0;c<e[0].length;c++)e[l][c]>i&&(i=e[l][c],a=c);s[a].push(t[l])}for(var h=0;h<s.length;h++)s[h]=r.collection(s[h]);return s}),"assign"),pyt=s((function(t){var e,n,r,i,a=this.cy(),s=this.nodes(),o=Qmt(t);r=new Array(s.length);for(var l=0;l<s.length;l++)r[l]=new Array(o.k);n=new Array(s.length);for(var c=0;c<s.length;c++)n[c]=new Array(o.k);for(var h=0;h<s.length;h++){for(var u=0,d=0;d<o.k;d++)n[h][d]=Math.random(),u+=n[h][d];for(var p=0;p<o.k;p++)n[h][p]=n[h][p]/u}e=new Array(o.k);for(var g=0;g<o.k;g++)e[g]=new Array(o.attributes.length);i=new Array(s.length);for(var f=0;f<s.length;f++)i[f]=new Array(o.k);for(var m=!0,y=0;m&&y<o.maxIterations;)m=!1,hyt(e,s,n,i,o),uyt(n,r,e,s,o),iyt(n,r,o.sensitivityThreshold)||(m=!0),y++;return{clusters:dyt(s,n,o,a),degreeOfMembership:n}}),"fuzzyCMeans"),gyt={kMeans:lyt,kMedoids:cyt,fuzzyCMeans:pyt,fcm:pyt},fyt=Ugt({distance:"euclidean",linkage:"min",mode:"threshold",threshold:1/0,addDendrogram:!1,dendrogramDepth:0,attributes:[]}),myt={single:"min",complete:"max"},yyt=s((function(t){var e=fyt(t),n=myt[e.linkage];return null!=n&&(e.linkage=n),e}),"setOptions"),vyt=s((function(t,e,n,r,i){for(var a,o=0,l=1/0,c=i.attributes,h=s((function(t,e){return Kmt(i.distance,c.length,(function(e){return c[e](t)}),(function(t){return c[t](e)}),t,e)}),"getDist"),u=0;u<t.length;u++){var d=t[u].key,p=n[d][r[d]];p<l&&(o=d,l=p)}if("threshold"===i.mode&&l>=i.threshold||"dendrogram"===i.mode&&1===t.length)return!1;var g,f=e[o],m=e[r[o]];g="dendrogram"===i.mode?{left:f,right:m,key:f.key}:{value:f.value.concat(m.value),key:f.key},t[f.index]=g,t.splice(m.index,1),e[f.key]=g;for(var y=0;y<t.length;y++){var v=t[y];f.key===v.key?a=1/0:"min"===i.linkage?(a=n[f.key][v.key],n[f.key][v.key]>n[m.key][v.key]&&(a=n[m.key][v.key])):"max"===i.linkage?(a=n[f.key][v.key],n[f.key][v.key]<n[m.key][v.key]&&(a=n[m.key][v.key])):a="mean"===i.linkage?(n[f.key][v.key]*f.size+n[m.key][v.key]*m.size)/(f.size+m.size):"dendrogram"===i.mode?h(v.value,f.value):h(v.value[0],f.value[0]),n[f.key][v.key]=n[v.key][f.key]=a}for(var x=0;x<t.length;x++){var b=t[x].key;if(r[b]===f.key||r[b]===m.key){for(var w=b,k=0;k<t.length;k++){var T=t[k].key;n[b][T]<n[b][w]&&(w=T)}r[b]=w}t[x].index=x}return f.key=m.key=f.index=m.index=null,!0}),"mergeClosest"),xyt=s((function t(e,n,r){e&&(e.value?n.push(e.value):(e.left&&t(e.left,n),e.right&&t(e.right,n)))}),"getAllChildren"),byt=s((function t(e,n){if(!e)return"";if(e.left&&e.right){var r=t(e.left,n),i=t(e.right,n),a=n.add({group:"nodes",data:{id:r+","+i}});return n.add({group:"edges",data:{source:r,target:a.id()}}),n.add({group:"edges",data:{source:i,target:a.id()}}),a.id()}return e.value?e.value.id():void 0}),"buildDendrogram"),wyt=s((function t(e,n,r){if(!e)return[];var i=[],a=[],s=[];return 0===n?(e.left&&xyt(e.left,i),e.right&&xyt(e.right,a),s=i.concat(a),[r.collection(s)]):1===n?e.value?[r.collection(e.value)]:(e.left&&xyt(e.left,i),e.right&&xyt(e.right,a),[r.collection(i),r.collection(a)]):e.value?[r.collection(e.value)]:(e.left&&(i=t(e.left,n-1,r)),e.right&&(a=t(e.right,n-1,r)),i.concat(a))}),"buildClustersFromTree"),kyt=s((function(t){for(var e=this.cy(),n=this.nodes(),r=yyt(t),i=r.attributes,a=s((function(t,e){return Kmt(r.distance,i.length,(function(e){return i[e](t)}),(function(t){return i[t](e)}),t,e)}),"getDist"),o=[],l=[],c=[],h=[],u=0;u<n.length;u++){var d={value:"dendrogram"===r.mode?n[u]:[n[u]],key:u,index:u};o[u]=d,h[u]=d,l[u]=[],c[u]=0}for(var p=0;p<o.length;p++)for(var g=0;g<=p;g++){var f=void 0;f="dendrogram"===r.mode?p===g?1/0:a(o[p].value,o[g].value):p===g?1/0:a(o[p].value[0],o[g].value[0]),l[p][g]=f,l[g][p]=f,f<l[p][c[p]]&&(c[p]=g)}for(var m,y=vyt(o,h,l,c,r);y;)y=vyt(o,h,l,c,r);return"dendrogram"===r.mode?(m=wyt(o[0],r.dendrogramDepth,e),r.addDendrogram&&byt(o[0],e)):(m=new Array(o.length),o.forEach((function(t,n){t.key=t.index=null,m[n]=e.collection(t.value)}))),m}),"hierarchicalClustering"),Tyt={hierarchicalClustering:kyt,hca:kyt},_yt=Ugt({distance:"euclidean",preference:"median",damping:.8,maxIterations:1e3,minIterations:100,attributes:[]}),Eyt=s((function(t){var e=t.damping,n=t.preference;.5<=e&&e<1||Mgt("Damping must range on [0.5, 1). Got: ".concat(e));var r=["median","mean","min","max"];return r.some((function(t){return t===n}))||jdt(n)||Mgt("Preference must be one of [".concat(r.map((function(t){return"'".concat(t,"'")})).join(", "),"] or a number. Got: ").concat(n)),_yt(t)}),"setOptions"),Cyt=s((function(t,e,n,r){var i=s((function(t,e){return r[e](t)}),"attr");return-Kmt(t,r.length,(function(t){return i(e,t)}),(function(t){return i(n,t)}),e,n)}),"getSimilarity"),Syt=s((function(t,e){return"median"===e?wft(t):"mean"===e?bft(t):"min"===e?vft(t):"max"===e?xft(t):e}),"getPreference"),Ayt=s((function(t,e,n){for(var r=[],i=0;i<t;i++)e[i*t+i]+n[i*t+i]>0&&r.push(i);return r}),"findExemplars"),Lyt=s((function(t,e,n){for(var r=[],i=0;i<t;i++){for(var a=-1,s=-1/0,o=0;o<n.length;o++){var l=n[o];e[i*t+l]>s&&(a=l,s=e[i*t+l])}a>0&&r.push(a)}for(var c=0;c<n.length;c++)r[n[c]]=n[c];return r}),"assignClusters"),Nyt=s((function(t,e,n){for(var r=Lyt(t,e,n),i=0;i<n.length;i++){for(var a=[],s=0;s<r.length;s++)r[s]===n[i]&&a.push(s);for(var o=-1,l=-1/0,c=0;c<a.length;c++){for(var h=0,u=0;u<a.length;u++)h+=e[a[u]*t+a[c]];h>l&&(o=c,l=h)}n[i]=a[o]}return r=Lyt(t,e,n)}),"assign"),Iyt=s((function(t){for(var e,n,r,i,a,s,o=this.cy(),l=this.nodes(),c=Eyt(t),h={},u=0;u<l.length;u++)h[l[u].id()]=u;n=(e=l.length)*e,r=new Array(n);for(var d=0;d<n;d++)r[d]=-1/0;for(var p=0;p<e;p++)for(var g=0;g<e;g++)p!==g&&(r[p*e+g]=Cyt(c.distance,l[p],l[g],c.attributes));i=Syt(r,c.preference);for(var f=0;f<e;f++)r[f*e+f]=i;a=new Array(n);for(var m=0;m<n;m++)a[m]=0;s=new Array(n);for(var y=0;y<n;y++)s[y]=0;for(var v=new Array(e),x=new Array(e),b=new Array(e),w=0;w<e;w++)v[w]=0,x[w]=0,b[w]=0;for(var k,T=new Array(e*c.minIterations),_=0;_<T.length;_++)T[_]=0;for(k=0;k<c.maxIterations;k++){for(var E=0;E<e;E++){for(var C=-1/0,S=-1/0,A=-1,L=0,N=0;N<e;N++)v[N]=a[E*e+N],(L=s[E*e+N]+r[E*e+N])>=C?(S=C,C=L,A=N):L>S&&(S=L);for(var I=0;I<e;I++)a[E*e+I]=(1-c.damping)*(r[E*e+I]-C)+c.damping*v[I];a[E*e+A]=(1-c.damping)*(r[E*e+A]-S)+c.damping*v[A]}for(var M=0;M<e;M++){for(var R=0,D=0;D<e;D++)v[D]=s[D*e+M],x[D]=Math.max(0,a[D*e+M]),R+=x[D];R-=x[M],x[M]=a[M*e+M],R+=x[M];for(var O=0;O<e;O++)s[O*e+M]=(1-c.damping)*Math.min(0,R-x[O])+c.damping*v[O];s[M*e+M]=(1-c.damping)*(R-x[M])+c.damping*v[M]}for(var P=0,B=0;B<e;B++){var $=s[B*e+B]+a[B*e+B]>0?1:0;T[k%c.minIterations*e+B]=$,P+=$}if(P>0&&(k>=c.minIterations-1||k==c.maxIterations-1)){for(var F=0,z=0;z<e;z++){b[z]=0;for(var U=0;U<c.minIterations;U++)b[z]+=T[U*e+z];0!==b[z]&&b[z]!==c.minIterations||F++}if(F===e)break}}for(var G=Ayt(e,a,s),q=Nyt(e,r,G),j={},Y=0;Y<G.length;Y++)j[G[Y]]=[];for(var W=0;W<l.length;W++){var H=q[h[l[W].id()]];null!=H&&j[H].push(l[W])}for(var V=new Array(G.length),X=0;X<G.length;X++)V[X]=o.collection(j[G[X]]);return V}),"affinityPropagation"),Myt={affinityPropagation:Iyt,ap:Iyt},Ryt=Ugt({root:void 0,directed:!1}),Dyt={hierholzer:s((function(t){if(!Gdt(t)){var e=arguments;t={root:e[0],directed:e[1]}}var n,r,i,a=Ryt(t),o=a.root,l=a.directed,c=this,h=!1;o&&(i=Fdt(o)?this.filter(o)[0].id():o[0].id());var u={},d={};l?c.forEach((function(t){var e=t.id();if(t.isNode()){var i=t.indegree(!0),a=t.outdegree(!0),s=i-a,o=a-i;1==s?n?h=!0:n=e:1==o?r?h=!0:r=e:(o>1||s>1)&&(h=!0),u[e]=[],t.outgoers().forEach((function(t){t.isEdge()&&u[e].push(t.id())}))}else d[e]=[void 0,t.target().id()]})):c.forEach((function(t){var e=t.id();t.isNode()?(t.degree(!0)%2&&(n?r?h=!0:r=e:n=e),u[e]=[],t.connectedEdges().forEach((function(t){return u[e].push(t.id())}))):d[e]=[t.source().id(),t.target().id()]}));var p={found:!1,trail:void 0};if(h)return p;if(r&&n)if(l){if(i&&r!=i)return p;i=r}else{if(i&&r!=i&&n!=i)return p;i||(i=r)}else i||(i=c[0].id());var g=s((function(t){for(var e,n,r,i=t,a=[t];u[i].length;)e=u[i].shift(),n=d[e][0],i!=(r=d[e][1])?(u[r]=u[r].filter((function(t){return t!=e})),i=r):l||i==n||(u[n]=u[n].filter((function(t){return t!=e})),i=n),a.unshift(e),a.unshift(i);return a}),"walk"),f=[],m=[];for(m=g(i);1!=m.length;)0==u[m[0]].length?(f.unshift(c.getElementById(m.shift())),f.unshift(c.getElementById(m.shift()))):m=g(m.shift()).concat(m);for(var y in f.unshift(c.getElementById(m.shift())),u)if(u[y].length)return p;return p.found=!0,p.trail=this.spawn(f,!0),p}),"hierholzer")},Oyt=s((function(){var t=this,e={},n=0,r=0,i=[],a=[],o={},l=s((function(n,r){for(var s=a.length-1,o=[],l=t.spawn();a[s].x!=n||a[s].y!=r;)o.push(a.pop().edge),s--;o.push(a.pop().edge),o.forEach((function(n){var r=n.connectedNodes().intersection(t);l.merge(n),r.forEach((function(n){var r=n.id(),i=n.connectedEdges().intersection(t);l.merge(n),e[r].cutVertex?l.merge(i.filter((function(t){return t.isLoop()}))):l.merge(i)}))})),i.push(l)}),"buildComponent"),c=s((function s(c,h,u){c===u&&(r+=1),e[h]={id:n,low:n++,cutVertex:!1};var d,p,g,f,m=t.getElementById(h).connectedEdges().intersection(t);0===m.size()?i.push(t.spawn(t.getElementById(h))):m.forEach((function(t){d=t.source().id(),p=t.target().id(),(g=d===h?p:d)!==u&&(f=t.id(),o[f]||(o[f]=!0,a.push({x:h,y:g,edge:t})),g in e?e[h].low=Math.min(e[h].low,e[g].id):(s(c,g,h),e[h].low=Math.min(e[h].low,e[g].low),e[h].id<=e[g].low&&(e[h].cutVertex=!0,l(h,g))))}))}),"biconnectedSearch");t.forEach((function(t){if(t.isNode()){var n=t.id();n in e||(r=0,c(n,n),e[n].cutVertex=r>1)}}));var h=Object.keys(e).filter((function(t){return e[t].cutVertex})).map((function(e){return t.getElementById(e)}));return{cut:t.spawn(h),components:i}}),"hopcroftTarjanBiconnected"),Pyt={hopcroftTarjanBiconnected:Oyt,htbc:Oyt,htb:Oyt,hopcroftTarjanBiconnectedComponents:Oyt},Byt=s((function(){var t=this,e={},n=0,r=[],i=[],a=t.spawn(t),o=s((function s(o){if(i.push(o),e[o]={index:n,low:n++,explored:!1},t.getElementById(o).connectedEdges().intersection(t).forEach((function(t){var n=t.target().id();n!==o&&(n in e||s(n),e[n].explored||(e[o].low=Math.min(e[o].low,e[n].low)))})),e[o].index===e[o].low){for(var l=t.spawn();;){var c=i.pop();if(l.merge(t.getElementById(c)),e[c].low=e[o].index,e[c].explored=!0,c===o)break}var h=l.edgesWith(l),u=l.merge(h);r.push(u),a=a.difference(u)}}),"stronglyConnectedSearch");return t.forEach((function(t){if(t.isNode()){var n=t.id();n in e||o(n)}})),{cut:a,components:r}}),"tarjanStronglyConnected"),$yt={};[Qgt,nft,rft,aft,oft,cft,pft,wmt,Tmt,Emt,Smt,Umt,gyt,Tyt,Myt,Dyt,Pyt,{tarjanStronglyConnected:Byt,tsc:Byt,tscc:Byt,tarjanStronglyConnectedComponents:Byt}].forEach((function(t){dpt($yt,t)}));var Fyt=s((function t(e){if(!(this instanceof t))return new t(e);this.id="Thenable/1.0.7",this.state=0,this.fulfillValue=void 0,this.rejectReason=void 0,this.onFulfilled=[],this.onRejected=[],this.proxy={then:this.then.bind(this)},"function"==typeof e&&e.call(this,this.fulfill.bind(this),this.reject.bind(this))}),"api");Fyt.prototype={fulfill:s((function(t){return zyt(this,1,"fulfillValue",t)}),"fulfill"),reject:s((function(t){return zyt(this,2,"rejectReason",t)}),"reject"),then:s((function(t,e){var n=this,r=new Fyt;return n.onFulfilled.push(qyt(t,r,"fulfill")),n.onRejected.push(qyt(e,r,"reject")),Uyt(n),r.proxy}),"then")};var zyt=s((function(t,e,n,r){return 0===t.state&&(t.state=e,t[n]=r,Uyt(t)),t}),"deliver"),Uyt=s((function(t){1===t.state?Gyt(t,"onFulfilled",t.fulfillValue):2===t.state&&Gyt(t,"onRejected",t.rejectReason)}),"execute"),Gyt=s((function(t,e,n){if(0!==t[e].length){var r=t[e];t[e]=[];var i=s((function(){for(var t=0;t<r.length;t++)r[t](n)}),"func");"function"==typeof setImmediate?setImmediate(i):setTimeout(i,0)}}),"execute_handlers"),qyt=s((function(t,e,n){return function(r){if("function"!=typeof t)e[n].call(e,r);else{var i;try{i=t(r)}catch(t){return void e.reject(t)}jyt(e,i)}}}),"resolver"),jyt=s((function t(e,n){if(e!==n&&e.proxy!==n){var r;if("object"===bdt(n)&&null!==n||"function"==typeof n)try{r=n.then}catch(t){return void e.reject(t)}if("function"!=typeof r)e.fulfill(n);else{var i=!1;try{r.call(n,(function(r){i||(i=!0,r===n?e.reject(new TypeError("circular thenable chain")):t(e,r))}),(function(t){i||(i=!0,e.reject(t))}))}catch(t){i||e.reject(t)}}}else e.reject(new TypeError("cannot resolve promise with itself"))}),"resolve");Fyt.all=function(t){return new Fyt((function(e,n){for(var r=new Array(t.length),i=0,a=s((function(n,a){r[n]=a,++i===t.length&&e(r)}),"fulfill"),o=0;o<t.length;o++)!function(e){var r=t[e];null!=r&&null!=r.then?r.then((function(t){a(e,t)}),(function(t){n(t)})):a(e,r)}(o)}))},Fyt.resolve=function(t){return new Fyt((function(e,n){e(t)}))},Fyt.reject=function(t){return new Fyt((function(e,n){n(t)}))};var Yyt="undefined"!=typeof Promise?Promise:Fyt,Wyt=s((function(t,e,n){var r=Kdt(t),i=!r,a=this._private=dpt({duration:1e3},e,n);if(a.target=t,a.style=a.style||a.css,a.started=!1,a.playing=!1,a.hooked=!1,a.applying=!1,a.progress=0,a.completes=[],a.frames=[],a.complete&&zdt(a.complete)&&a.completes.push(a.complete),i){var s=t.position();a.startPosition=a.startPosition||{x:s.x,y:s.y},a.startStyle=a.startStyle||t.cy().style().getAnimationStartStyle(t,a.style)}if(r){var o=t.pan();a.startPan={x:o.x,y:o.y},a.startZoom=t.zoom()}this.length=1,this[0]=this}),"Animation"),Hyt=Wyt.prototype;dpt(Hyt,{instanceString:s((function(){return"animation"}),"instanceString"),hook:s((function(){var t=this._private;if(!t.hooked){var e=t.target._private.animation;(t.queue?e.queue:e.current).push(this),Hdt(t.target)&&t.target.cy().addToAnimationPool(t.target),t.hooked=!0}return this}),"hook"),play:s((function(){var t=this._private;return 1===t.progress&&(t.progress=0),t.playing=!0,t.started=!1,t.stopped=!1,this.hook(),this}),"play"),playing:s((function(){return this._private.playing}),"playing"),apply:s((function(){var t=this._private;return t.applying=!0,t.started=!1,t.stopped=!1,this.hook(),this}),"apply"),applying:s((function(){return this._private.applying}),"applying"),pause:s((function(){var t=this._private;return t.playing=!1,t.started=!1,this}),"pause"),stop:s((function(){var t=this._private;return t.playing=!1,t.started=!1,t.stopped=!0,this}),"stop"),rewind:s((function(){return this.progress(0)}),"rewind"),fastforward:s((function(){return this.progress(1)}),"fastforward"),time:s((function(t){var e=this._private;return void 0===t?e.progress*e.duration:this.progress(t/e.duration)}),"time"),progress:s((function(t){var e=this._private,n=e.playing;return void 0===t?e.progress:(n&&this.pause(),e.progress=t,e.started=!1,n&&this.play(),this)}),"progress"),completed:s((function(){return 1===this._private.progress}),"completed"),reverse:s((function(){var t=this._private,e=t.playing;e&&this.pause(),t.progress=1-t.progress,t.started=!1;var n=s((function(e,n){var r=t[e];null!=r&&(t[e]=t[n],t[n]=r)}),"swap");if(n("zoom","startZoom"),n("pan","startPan"),n("position","startPosition"),t.style)for(var r=0;r<t.style.length;r++){var i=t.style[r],a=i.name,o=t.startStyle[a];t.startStyle[a]=i,t.style[r]=o}return e&&this.play(),this}),"reverse"),promise:s((function(t){var e,n=this._private;if("frame"===t)e=n.frames;else e=n.completes;return new Yyt((function(t,n){e.push((function(){t()}))}))}),"promise")}),Hyt.complete=Hyt.completed,Hyt.run=Hyt.play,Hyt.running=Hyt.playing;var Vyt={animated:s((function(){return s((function(){var t=this,e=void 0!==t.length?t:[t];if(!(this._private.cy||this).styleEnabled())return!1;var n=e[0];return n?n._private.animation.current.length>0:void 0}),"animatedImpl")}),"animated"),clearQueue:s((function(){return s((function(){var t=this,e=void 0!==t.length?t:[t];if(!(this._private.cy||this).styleEnabled())return this;for(var n=0;n<e.length;n++){e[n]._private.animation.queue=[]}return this}),"clearQueueImpl")}),"clearQueue"),delay:s((function(){return s((function(t,e){return(this._private.cy||this).styleEnabled()?this.animate({delay:t,duration:t,complete:e}):this}),"delayImpl")}),"delay"),delayAnimation:s((function(){return s((function(t,e){return(this._private.cy||this).styleEnabled()?this.animation({delay:t,duration:t,complete:e}):this}),"delayAnimationImpl")}),"delayAnimation"),animation:s((function(){return s((function(t,e){var n=this,r=void 0!==n.length,i=r?n:[n],a=this._private.cy||this,s=!r,o=!s;if(!a.styleEnabled())return this;var l=a.style();if(t=dpt({},t,e),0===Object.keys(t).length)return new Wyt(i[0],t);switch(void 0===t.duration&&(t.duration=400),t.duration){case"slow":t.duration=600;break;case"fast":t.duration=200}if(o&&(t.style=l.getPropsList(t.style||t.css),t.css=void 0),o&&null!=t.renderedPosition){var c=t.renderedPosition,h=a.pan(),u=a.zoom();t.position=mft(c,u,h)}if(s&&null!=t.panBy){var d=t.panBy,p=a.pan();t.pan={x:p.x+d.x,y:p.y+d.y}}var g=t.center||t.centre;if(s&&null!=g){var f=a.getCenterPan(g.eles,t.zoom);null!=f&&(t.pan=f)}if(s&&null!=t.fit){var m=t.fit,y=a.getFitViewport(m.eles||m.boundingBox,m.padding);null!=y&&(t.pan=y.pan,t.zoom=y.zoom)}if(s&&Gdt(t.zoom)){var v=a.getZoomedViewport(t.zoom);null!=v?(v.zoomed&&(t.zoom=v.zoom),v.panned&&(t.pan=v.pan)):t.zoom=null}return new Wyt(i[0],t)}),"animationImpl")}),"animation"),animate:s((function(){return s((function(t,e){var n=this,r=void 0!==n.length?n:[n];if(!(this._private.cy||this).styleEnabled())return this;e&&(t=dpt({},t,e));for(var i=0;i<r.length;i++){var a=r[i],s=a.animated()&&(void 0===t.queue||t.queue);a.animation(t,s?{queue:!0}:void 0).play()}return this}),"animateImpl")}),"animate"),stop:s((function(){return s((function(t,e){var n=this,r=void 0!==n.length?n:[n],i=this._private.cy||this;if(!i.styleEnabled())return this;for(var a=0;a<r.length;a++){for(var s=r[a]._private,o=s.animation.current,l=0;l<o.length;l++){var c=o[l]._private;e&&(c.duration=0)}t&&(s.animation.queue=[]),e||(s.animation.current=[])}return i.notify("draw"),this}),"stopImpl")}),"stop")},Xyt=Array.isArray,Kyt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Zyt=/^\w*$/;function Qyt(t,e){if(Xyt(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!Zpt(t))||(Zyt.test(t)||!Kyt.test(t)||null!=e&&t in Object(e))}s(Qyt,"isKey");var Jyt=Qyt;function tvt(t){if(!kpt(t))return!1;var e=Hpt(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}s(tvt,"isFunction");var evt=tvt,nvt=Spt["__core-js_shared__"],rvt=function(){var t=/[^.]+$/.exec(nvt&&nvt.keys&&nvt.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function ivt(t){return!!rvt&&rvt in t}s(ivt,"isMasked");var avt=ivt,svt=Function.prototype.toString;function ovt(t){if(null!=t){try{return svt.call(t)}catch(t){}try{return t+""}catch(t){}}return""}s(ovt,"toSource");var lvt=ovt,cvt=/^\[object .+?Constructor\]$/,hvt=Function.prototype,uvt=Object.prototype,dvt=hvt.toString,pvt=uvt.hasOwnProperty,gvt=RegExp("^"+dvt.call(pvt).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function fvt(t){return!(!kpt(t)||avt(t))&&(evt(t)?gvt:cvt).test(lvt(t))}s(fvt,"baseIsNative");var mvt=fvt;function yvt(t,e){return null==t?void 0:t[e]}s(yvt,"getValue$1");var vvt=yvt;function xvt(t,e){var n=vvt(t,e);return mvt(n)?n:void 0}s(xvt,"getNative");var bvt=xvt,wvt=bvt(Object,"create");function kvt(){this.__data__=wvt?wvt(null):{},this.size=0}s(kvt,"hashClear");var Tvt=kvt;function _vt(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}s(_vt,"hashDelete");var Evt=_vt,Cvt=Object.prototype.hasOwnProperty;function Svt(t){var e=this.__data__;if(wvt){var n=e[t];return"__lodash_hash_undefined__"===n?void 0:n}return Cvt.call(e,t)?e[t]:void 0}s(Svt,"hashGet");var Avt=Svt,Lvt=Object.prototype.hasOwnProperty;function Nvt(t){var e=this.__data__;return wvt?void 0!==e[t]:Lvt.call(e,t)}s(Nvt,"hashHas");var Ivt=Nvt;function Mvt(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=wvt&&void 0===e?"__lodash_hash_undefined__":e,this}s(Mvt,"hashSet");var Rvt=Mvt;function Dvt(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}s(Dvt,"Hash"),Dvt.prototype.clear=Tvt,Dvt.prototype.delete=Evt,Dvt.prototype.get=Avt,Dvt.prototype.has=Ivt,Dvt.prototype.set=Rvt;var Ovt=Dvt;function Pvt(){this.__data__=[],this.size=0}s(Pvt,"listCacheClear");var Bvt=Pvt;function $vt(t,e){return t===e||t!=t&&e!=e}s($vt,"eq");var Fvt=$vt;function zvt(t,e){for(var n=t.length;n--;)if(Fvt(t[n][0],e))return n;return-1}s(zvt,"assocIndexOf");var Uvt=zvt,Gvt=Array.prototype.splice;function qvt(t){var e=this.__data__,n=Uvt(e,t);return!(n<0)&&(n==e.length-1?e.pop():Gvt.call(e,n,1),--this.size,!0)}s(qvt,"listCacheDelete");var jvt=qvt;function Yvt(t){var e=this.__data__,n=Uvt(e,t);return n<0?void 0:e[n][1]}s(Yvt,"listCacheGet");var Wvt=Yvt;function Hvt(t){return Uvt(this.__data__,t)>-1}s(Hvt,"listCacheHas");var Vvt=Hvt;function Xvt(t,e){var n=this.__data__,r=Uvt(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}s(Xvt,"listCacheSet");var Kvt=Xvt;function Zvt(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}s(Zvt,"ListCache"),Zvt.prototype.clear=Bvt,Zvt.prototype.delete=jvt,Zvt.prototype.get=Wvt,Zvt.prototype.has=Vvt,Zvt.prototype.set=Kvt;var Qvt=Zvt,Jvt=bvt(Spt,"Map");function txt(){this.size=0,this.__data__={hash:new Ovt,map:new(Jvt||Qvt),string:new Ovt}}s(txt,"mapCacheClear");var ext=txt;function nxt(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}s(nxt,"isKeyable");var rxt=nxt;function ixt(t,e){var n=t.__data__;return rxt(e)?n["string"==typeof e?"string":"hash"]:n.map}s(ixt,"getMapData");var axt=ixt;function sxt(t){var e=axt(this,t).delete(t);return this.size-=e?1:0,e}s(sxt,"mapCacheDelete");var oxt=sxt;function lxt(t){return axt(this,t).get(t)}s(lxt,"mapCacheGet");var cxt=lxt;function hxt(t){return axt(this,t).has(t)}s(hxt,"mapCacheHas");var uxt=hxt;function dxt(t,e){var n=axt(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this}s(dxt,"mapCacheSet");var pxt=dxt;function gxt(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}s(gxt,"MapCache"),gxt.prototype.clear=ext,gxt.prototype.delete=oxt,gxt.prototype.get=cxt,gxt.prototype.has=uxt,gxt.prototype.set=pxt;var fxt=gxt;function mxt(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");var n=s((function(){var r=arguments,i=e?e.apply(this,r):r[0],a=n.cache;if(a.has(i))return a.get(i);var s=t.apply(this,r);return n.cache=a.set(i,s)||a,s}),"memoized");return n.cache=new(mxt.Cache||fxt),n}s(mxt,"memoize"),mxt.Cache=fxt;var yxt=mxt;function vxt(t){var e=yxt(t,(function(t){return 500===n.size&&n.clear(),t})),n=e.cache;return e}s(vxt,"memoizeCapped");var xxt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,bxt=/\\(\\)?/g,wxt=vxt((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(xxt,(function(t,n,r,i){e.push(r?i.replace(bxt,"$1"):n||t)})),e})),kxt=wxt;function Txt(t,e){for(var n=-1,r=null==t?0:t.length,i=Array(r);++n<r;)i[n]=e(t[n],n,t);return i}s(Txt,"arrayMap");var _xt=Txt,Ext=Opt?Opt.prototype:void 0,Cxt=Ext?Ext.toString:void 0;function Sxt(t){if("string"==typeof t)return t;if(Xyt(t))return _xt(t,Sxt)+"";if(Zpt(t))return Cxt?Cxt.call(t):"";var e=t+"";return"0"==e&&1/t==-Infinity?"-0":e}s(Sxt,"baseToString");var Axt=Sxt;function Lxt(t){return null==t?"":Axt(t)}s(Lxt,"toString$1");var Nxt=Lxt;function Ixt(t,e){return Xyt(t)?t:Jyt(t,e)?[t]:kxt(Nxt(t))}s(Ixt,"castPath");var Mxt=Ixt;function Rxt(t){if("string"==typeof t||Zpt(t))return t;var e=t+"";return"0"==e&&1/t==-Infinity?"-0":e}s(Rxt,"toKey");var Dxt=Rxt;function Oxt(t,e){for(var n=0,r=(e=Mxt(e,t)).length;null!=t&&n<r;)t=t[Dxt(e[n++])];return n&&n==r?t:void 0}s(Oxt,"baseGet");var Pxt=Oxt;function Bxt(t,e,n){var r=null==t?void 0:Pxt(t,e);return void 0===r?n:r}s(Bxt,"get");var $xt=Bxt,Fxt=function(){try{var t=bvt(Object,"defineProperty");return t({},"",{}),t}catch(t){}}();function zxt(t,e,n){"__proto__"==e&&Fxt?Fxt(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}s(zxt,"baseAssignValue");var Uxt=zxt,Gxt=Object.prototype.hasOwnProperty;function qxt(t,e,n){var r=t[e];Gxt.call(t,e)&&Fvt(r,n)&&(void 0!==n||e in t)||Uxt(t,e,n)}s(qxt,"assignValue");var jxt=qxt,Yxt=/^(?:0|[1-9]\d*)$/;function Wxt(t,e){var n=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==n||"symbol"!=n&&Yxt.test(t))&&t>-1&&t%1==0&&t<e}s(Wxt,"isIndex");var Hxt=Wxt;function Vxt(t,e,n,r){if(!kpt(t))return t;for(var i=-1,a=(e=Mxt(e,t)).length,s=a-1,o=t;null!=o&&++i<a;){var l=Dxt(e[i]),c=n;if("__proto__"===l||"constructor"===l||"prototype"===l)return t;if(i!=s){var h=o[l];void 0===(c=r?r(h,l,o):void 0)&&(c=kpt(h)?h:Hxt(e[i+1])?[]:{})}jxt(o,l,c),o=o[l]}return t}s(Vxt,"baseSet");var Xxt=Vxt;function Kxt(t,e,n){return null==t?t:Xxt(t,e,n)}s(Kxt,"set");var Zxt=Kxt;function Qxt(t,e){var n=-1,r=t.length;for(e||(e=Array(r));++n<r;)e[n]=t[n];return e}s(Qxt,"copyArray");var Jxt=Qxt;function tbt(t){return Xyt(t)?_xt(t,Dxt):Zpt(t)?[t]:Jxt(kxt(Nxt(t)))}s(tbt,"toPath");var ebt=tbt,nbt={data:s((function(t){return t=dpt({},{field:"data",bindingEvent:"data",allowBinding:!1,allowSetting:!1,allowGetting:!1,settingEvent:"data",settingTriggersEvent:!1,triggerFnName:"trigger",immutableKeys:{},updateStyle:!1,beforeGet:s((function(t){}),"beforeGet"),beforeSet:s((function(t,e){}),"beforeSet"),onSet:s((function(t){}),"onSet"),canSet:s((function(t){return!0}),"canSet")},t),s((function(e,n){var r=t,i=this,a=void 0!==i.length,s=a?i:[i],o=a?i[0]:i;if(Fdt(e)){var l,c=-1!==e.indexOf(".")&&ebt(e);if(r.allowGetting&&void 0===n)return o&&(r.beforeGet(o),l=c&&void 0===o._private[r.field][e]?$xt(o._private[r.field],c):o._private[r.field][e]),l;if(r.allowSetting&&void 0!==n&&!r.immutableKeys[e]){var h=_dt({},e,n);r.beforeSet(i,h);for(var u=0,d=s.length;u<d;u++){var p=s[u];r.canSet(p)&&(c&&void 0===o._private[r.field][e]?Zxt(p._private[r.field],c,n):p._private[r.field][e]=n)}r.updateStyle&&i.updateStyle(),r.onSet(i),r.settingTriggersEvent&&i[r.triggerFnName](r.settingEvent)}}else if(r.allowSetting&&Gdt(e)){var g,f,m=e,y=Object.keys(m);r.beforeSet(i,m);for(var v=0;v<y.length;v++){if(f=m[g=y[v]],!r.immutableKeys[g])for(var x=0;x<s.length;x++){var b=s[x];r.canSet(b)&&(b._private[r.field][g]=f)}}r.updateStyle&&i.updateStyle(),r.onSet(i),r.settingTriggersEvent&&i[r.triggerFnName](r.settingEvent)}else if(r.allowBinding&&zdt(e)){var w=e;i.on(r.bindingEvent,w)}else if(r.allowGetting&&void 0===e){var k;return o&&(r.beforeGet(o),k=o._private[r.field]),k}return i}),"dataImpl")}),"data"),removeData:s((function(t){return t=dpt({},{field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!1,immutableKeys:{}},t),s((function(e){var n=t,r=this,i=void 0!==r.length?r:[r];if(Fdt(e)){for(var a=e.split(/\s+/),s=a.length,o=0;o<s;o++){var l=a[o];if(!Jdt(l))if(!n.immutableKeys[l])for(var c=0,h=i.length;c<h;c++)i[c]._private[n.field][l]=void 0}n.triggerEvent&&r[n.triggerFnName](n.event)}else if(void 0===e){for(var u=0,d=i.length;u<d;u++)for(var p=i[u]._private[n.field],g=Object.keys(p),f=0;f<g.length;f++){var m=g[f];!n.immutableKeys[m]&&(p[m]=void 0)}n.triggerEvent&&r[n.triggerFnName](n.event)}return r}),"removeDataImpl")}),"removeData")},rbt={eventAliasesOn:s((function(t){var e=t;e.addListener=e.listen=e.bind=e.on,e.unlisten=e.unbind=e.off=e.removeListener,e.trigger=e.emit,e.pon=e.promiseOn=function(t,e){var n=this,r=Array.prototype.slice.call(arguments,0);return new Yyt((function(t,e){var i=s((function(e){n.off.apply(n,o),t(e)}),"callback"),a=r.concat([i]),o=a.concat([]);n.on.apply(n,a)}))}}),"eventAliasesOn")},ibt={};[Vyt,nbt,rbt].forEach((function(t){dpt(ibt,t)}));var abt={animate:ibt.animate(),animation:ibt.animation(),animated:ibt.animated(),clearQueue:ibt.clearQueue(),delay:ibt.delay(),delayAnimation:ibt.delayAnimation(),stop:ibt.stop()},sbt={classes:s((function(t){var e=this;if(void 0===t){var n=[];return e[0]._private.classes.forEach((function(t){return n.push(t)})),n}Udt(t)||(t=(t||"").match(/\S+/g)||[]);for(var r=[],i=new Xgt(t),a=0;a<e.length;a++){for(var s=e[a],o=s._private,l=o.classes,c=!1,h=0;h<t.length;h++){var u=t[h];if(!l.has(u)){c=!0;break}}c||(c=l.size!==t.length),c&&(o.classes=i,r.push(s))}return r.length>0&&this.spawn(r).updateStyle().emit("class"),e}),"classes"),addClass:s((function(t){return this.toggleClass(t,!0)}),"addClass"),hasClass:s((function(t){var e=this[0];return null!=e&&e._private.classes.has(t)}),"hasClass"),toggleClass:s((function(t,e){Udt(t)||(t=t.match(/\S+/g)||[]);for(var n=this,r=void 0===e,i=[],a=0,s=n.length;a<s;a++)for(var o=n[a],l=o._private.classes,c=!1,h=0;h<t.length;h++){var u=t[h],d=l.has(u),p=!1;e||r&&!d?(l.add(u),p=!0):(!e||r&&d)&&(l.delete(u),p=!0),!c&&p&&(i.push(o),c=!0)}return i.length>0&&this.spawn(i).updateStyle().emit("class"),n}),"toggleClass"),removeClass:s((function(t){return this.toggleClass(t,!1)}),"removeClass"),flashClass:s((function(t,e){var n=this;if(null==e)e=250;else if(0===e)return n;return n.addClass(t),setTimeout((function(){n.removeClass(t)}),e),n}),"flashClass")};sbt.className=sbt.classNames=sbt.classes;var obt={metaChar:"[\\!\\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\]\\^\\`\\{\\|\\}\\~]",comparatorOp:"=|\\!=|>|>=|<|<=|\\$=|\\^=|\\*=",boolOp:"\\?|\\!|\\^",string:"\"(?:\\\\\"|[^\"])*\"|'(?:\\\\'|[^'])*'",number:cpt,meta:"degree|indegree|outdegree",separator:"\\s*,\\s*",descendant:"\\s+",child:"\\s+>\\s+",subject:"\\$",group:"node|edge|\\*",directedEdge:"\\s+->\\s+",undirectedEdge:"\\s+<->\\s+"};obt.variable="(?:[\\w-.]|(?:\\\\"+obt.metaChar+"))+",obt.className="(?:[\\w-]|(?:\\\\"+obt.metaChar+"))+",obt.value=obt.string+"|"+obt.number,obt.id=obt.variable,function(){var t,e,n;for(t=obt.comparatorOp.split("|"),n=0;n<t.length;n++)e=t[n],obt.comparatorOp+="|@"+e;for(t=obt.comparatorOp.split("|"),n=0;n<t.length;n++)(e=t[n]).indexOf("!")>=0||"="!==e&&(obt.comparatorOp+="|\\!"+e)}();var lbt=s((function(){return{checks:[]}}),"newQuery"),cbt=0,hbt=1,ubt=2,dbt=3,pbt=4,gbt=5,fbt=6,mbt=7,ybt=8,vbt=9,xbt=10,bbt=11,wbt=12,kbt=13,Tbt=14,_bt=15,Ebt=16,Cbt=17,Sbt=18,Abt=19,Lbt=20,Nbt=[{selector:":selected",matches:s((function(t){return t.selected()}),"matches")},{selector:":unselected",matches:s((function(t){return!t.selected()}),"matches")},{selector:":selectable",matches:s((function(t){return t.selectable()}),"matches")},{selector:":unselectable",matches:s((function(t){return!t.selectable()}),"matches")},{selector:":locked",matches:s((function(t){return t.locked()}),"matches")},{selector:":unlocked",matches:s((function(t){return!t.locked()}),"matches")},{selector:":visible",matches:s((function(t){return t.visible()}),"matches")},{selector:":hidden",matches:s((function(t){return!t.visible()}),"matches")},{selector:":transparent",matches:s((function(t){return t.transparent()}),"matches")},{selector:":grabbed",matches:s((function(t){return t.grabbed()}),"matches")},{selector:":free",matches:s((function(t){return!t.grabbed()}),"matches")},{selector:":removed",matches:s((function(t){return t.removed()}),"matches")},{selector:":inside",matches:s((function(t){return!t.removed()}),"matches")},{selector:":grabbable",matches:s((function(t){return t.grabbable()}),"matches")},{selector:":ungrabbable",matches:s((function(t){return!t.grabbable()}),"matches")},{selector:":animated",matches:s((function(t){return t.animated()}),"matches")},{selector:":unanimated",matches:s((function(t){return!t.animated()}),"matches")},{selector:":parent",matches:s((function(t){return t.isParent()}),"matches")},{selector:":childless",matches:s((function(t){return t.isChildless()}),"matches")},{selector:":child",matches:s((function(t){return t.isChild()}),"matches")},{selector:":orphan",matches:s((function(t){return t.isOrphan()}),"matches")},{selector:":nonorphan",matches:s((function(t){return t.isChild()}),"matches")},{selector:":compound",matches:s((function(t){return t.isNode()?t.isParent():t.source().isParent()||t.target().isParent()}),"matches")},{selector:":loop",matches:s((function(t){return t.isLoop()}),"matches")},{selector:":simple",matches:s((function(t){return t.isSimple()}),"matches")},{selector:":active",matches:s((function(t){return t.active()}),"matches")},{selector:":inactive",matches:s((function(t){return!t.active()}),"matches")},{selector:":backgrounding",matches:s((function(t){return t.backgrounding()}),"matches")},{selector:":nonbackgrounding",matches:s((function(t){return!t.backgrounding()}),"matches")}].sort((function(t,e){return upt(t.selector,e.selector)})),Ibt=function(){for(var t,e={},n=0;n<Nbt.length;n++)e[(t=Nbt[n]).selector]=t.matches;return e}(),Mbt=s((function(t,e){return Ibt[t](e)}),"stateSelectorMatches"),Rbt="("+Nbt.map((function(t){return t.selector})).join("|")+")",Dbt=s((function(t){return t.replace(new RegExp("\\\\("+obt.metaChar+")","g"),(function(t,e){return e}))}),"cleanMetaChars"),Obt=s((function(t,e,n){t[t.length-1]=n}),"replaceLastQuery"),Pbt=[{name:"group",query:!0,regex:"("+obt.group+")",populate:s((function(t,e,n){var r=Edt(n,1)[0];e.checks.push({type:cbt,value:"*"===r?r:r+"s"})}),"populate")},{name:"state",query:!0,regex:Rbt,populate:s((function(t,e,n){var r=Edt(n,1)[0];e.checks.push({type:mbt,value:r})}),"populate")},{name:"id",query:!0,regex:"\\#("+obt.id+")",populate:s((function(t,e,n){var r=Edt(n,1)[0];e.checks.push({type:ybt,value:Dbt(r)})}),"populate")},{name:"className",query:!0,regex:"\\.("+obt.className+")",populate:s((function(t,e,n){var r=Edt(n,1)[0];e.checks.push({type:vbt,value:Dbt(r)})}),"populate")},{name:"dataExists",query:!0,regex:"\\[\\s*("+obt.variable+")\\s*\\]",populate:s((function(t,e,n){var r=Edt(n,1)[0];e.checks.push({type:pbt,field:Dbt(r)})}),"populate")},{name:"dataCompare",query:!0,regex:"\\[\\s*("+obt.variable+")\\s*("+obt.comparatorOp+")\\s*("+obt.value+")\\s*\\]",populate:s((function(t,e,n){var r=Edt(n,3),i=r[0],a=r[1],s=r[2];s=null!=new RegExp("^"+obt.string+"$").exec(s)?s.substring(1,s.length-1):parseFloat(s),e.checks.push({type:dbt,field:Dbt(i),operator:a,value:s})}),"populate")},{name:"dataBool",query:!0,regex:"\\[\\s*("+obt.boolOp+")\\s*("+obt.variable+")\\s*\\]",populate:s((function(t,e,n){var r=Edt(n,2),i=r[0],a=r[1];e.checks.push({type:gbt,field:Dbt(a),operator:i})}),"populate")},{name:"metaCompare",query:!0,regex:"\\[\\[\\s*("+obt.meta+")\\s*("+obt.comparatorOp+")\\s*("+obt.number+")\\s*\\]\\]",populate:s((function(t,e,n){var r=Edt(n,3),i=r[0],a=r[1],s=r[2];e.checks.push({type:fbt,field:Dbt(i),operator:a,value:parseFloat(s)})}),"populate")},{name:"nextQuery",separator:!0,regex:obt.separator,populate:s((function(t,e){var n=t.currentSubject,r=t.edgeCount,i=t.compoundCount,a=t[t.length-1];return null!=n&&(a.subject=n,t.currentSubject=null),a.edgeCount=r,a.compoundCount=i,t.edgeCount=0,t.compoundCount=0,t[t.length++]=lbt()}),"populate")},{name:"directedEdge",separator:!0,regex:obt.directedEdge,populate:s((function(t,e){if(null==t.currentSubject){var n=lbt(),r=e,i=lbt();return n.checks.push({type:bbt,source:r,target:i}),Obt(t,e,n),t.edgeCount++,i}var a=lbt(),s=e,o=lbt();return a.checks.push({type:wbt,source:s,target:o}),Obt(t,e,a),t.edgeCount++,o}),"populate")},{name:"undirectedEdge",separator:!0,regex:obt.undirectedEdge,populate:s((function(t,e){if(null==t.currentSubject){var n=lbt(),r=e,i=lbt();return n.checks.push({type:xbt,nodes:[r,i]}),Obt(t,e,n),t.edgeCount++,i}var a=lbt(),s=e,o=lbt();return a.checks.push({type:Tbt,node:s,neighbor:o}),Obt(t,e,a),o}),"populate")},{name:"child",separator:!0,regex:obt.child,populate:s((function(t,e){if(null==t.currentSubject){var n=lbt(),r=lbt(),i=t[t.length-1];return n.checks.push({type:_bt,parent:i,child:r}),Obt(t,e,n),t.compoundCount++,r}if(t.currentSubject===e){var a=lbt(),s=t[t.length-1],o=lbt(),l=lbt(),c=lbt(),h=lbt();return a.checks.push({type:Abt,left:s,right:o,subject:l}),l.checks=e.checks,e.checks=[{type:Lbt}],h.checks.push({type:Lbt}),o.checks.push({type:Cbt,parent:h,child:c}),Obt(t,s,a),t.currentSubject=l,t.compoundCount++,c}var u=lbt(),d=lbt(),p=[{type:Cbt,parent:u,child:d}];return u.checks=e.checks,e.checks=p,t.compoundCount++,d}),"populate")},{name:"descendant",separator:!0,regex:obt.descendant,populate:s((function(t,e){if(null==t.currentSubject){var n=lbt(),r=lbt(),i=t[t.length-1];return n.checks.push({type:Ebt,ancestor:i,descendant:r}),Obt(t,e,n),t.compoundCount++,r}if(t.currentSubject===e){var a=lbt(),s=t[t.length-1],o=lbt(),l=lbt(),c=lbt(),h=lbt();return a.checks.push({type:Abt,left:s,right:o,subject:l}),l.checks=e.checks,e.checks=[{type:Lbt}],h.checks.push({type:Lbt}),o.checks.push({type:Sbt,ancestor:h,descendant:c}),Obt(t,s,a),t.currentSubject=l,t.compoundCount++,c}var u=lbt(),d=lbt(),p=[{type:Sbt,ancestor:u,descendant:d}];return u.checks=e.checks,e.checks=p,t.compoundCount++,d}),"populate")},{name:"subject",modifier:!0,regex:obt.subject,populate:s((function(t,e){if(null!=t.currentSubject&&t.currentSubject!==e)return Dgt("Redefinition of subject in selector `"+t.toString()+"`"),!1;t.currentSubject=e;var n=t[t.length-1].checks[0],r=null==n?null:n.type;r===bbt?n.type=kbt:r===xbt&&(n.type=Tbt,n.node=n.nodes[1],n.neighbor=n.nodes[0],n.nodes=null)}),"populate")}];Pbt.forEach((function(t){return t.regexObj=new RegExp("^"+t.regex)}));var Bbt=s((function(t){for(var e,n,r,i=0;i<Pbt.length;i++){var a=Pbt[i],s=a.name,o=t.match(a.regexObj);if(null!=o){n=o,e=a,r=s;var l=o[0];t=t.substring(l.length);break}}return{expr:e,match:n,name:r,remaining:t}}),"consumeExpr"),$bt=s((function(t){var e=t.match(/^\s+/);if(e){var n=e[0];t=t.substring(n.length)}return t}),"consumeWhitespace"),Fbt=s((function(t){var e=this,n=e.inputText=t,r=e[0]=lbt();for(e.length=1,n=$bt(n);;){var i=Bbt(n);if(null==i.expr)return Dgt("The selector `"+t+"`is invalid"),!1;var a=i.match.slice(1),s=i.expr.populate(e,r,a);if(!1===s)return!1;if(null!=s&&(r=s),(n=i.remaining).match(/^\s*$/))break}var o=e[e.length-1];null!=e.currentSubject&&(o.subject=e.currentSubject),o.edgeCount=e.edgeCount,o.compoundCount=e.compoundCount;for(var l=0;l<e.length;l++){var c=e[l];if(c.compoundCount>0&&c.edgeCount>0)return Dgt("The selector `"+t+"` is invalid because it uses both a compound selector and an edge selector"),!1;if(c.edgeCount>1)return Dgt("The selector `"+t+"` is invalid because it uses multiple edge selectors"),!1;1===c.edgeCount&&Dgt("The selector `"+t+"` 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}),"parse"),zbt=s((function(){if(null!=this.toStringCache)return this.toStringCache;for(var t=s((function(t){return null==t?"":t}),"clean"),e=s((function(e){return Fdt(e)?'"'+e+'"':t(e)}),"cleanVal"),n=s((function(t){return" "+t+" "}),"space"),r=s((function(r,a){var s=r.type,o=r.value;switch(s){case cbt:var l=t(o);return l.substring(0,l.length-1);case dbt:var c=r.field,h=r.operator;return"["+c+n(t(h))+e(o)+"]";case gbt:var u=r.operator,d=r.field;return"["+t(u)+d+"]";case pbt:return"["+r.field+"]";case fbt:var p=r.operator;return"[["+r.field+n(t(p))+e(o)+"]]";case mbt:return o;case ybt:return"#"+o;case vbt:return"."+o;case Cbt:case _bt:return i(r.parent,a)+n(">")+i(r.child,a);case Sbt:case Ebt:return i(r.ancestor,a)+" "+i(r.descendant,a);case Abt:var g=i(r.left,a),f=i(r.subject,a),m=i(r.right,a);return g+(g.length>0?" ":"")+f+m;case Lbt:return""}}),"checkToString"),i=s((function(t,e){return t.checks.reduce((function(n,i,a){return n+(e===t&&0===a?"$":"")+r(i,e)}),"")}),"queryToString"),a="",o=0;o<this.length;o++){var l=this[o];a+=i(l,l.subject),this.length>1&&o<this.length-1&&(a+=", ")}return this.toStringCache=a,a}),"toString"),Ubt={parse:Fbt,toString:zbt},Gbt=s((function(t,e,n){var r,i,a,s=Fdt(t),o=jdt(t),l=Fdt(n),c=!1,h=!1,u=!1;switch(e.indexOf("!")>=0&&(e=e.replace("!",""),h=!0),e.indexOf("@")>=0&&(e=e.replace("@",""),c=!0),(s||l||c)&&(i=s||o?""+t:"",a=""+n),c&&(t=i=i.toLowerCase(),n=a=a.toLowerCase()),e){case"*=":r=i.indexOf(a)>=0;break;case"$=":r=i.indexOf(a,i.length-a.length)>=0;break;case"^=":r=0===i.indexOf(a);break;case"=":r=t===n;break;case">":u=!0,r=t>n;break;case">=":u=!0,r=t>=n;break;case"<":u=!0,r=t<n;break;case"<=":u=!0,r=t<=n;break;default:r=!1}return!h||null==t&&u||(r=!r),r}),"valCmp"),qbt=s((function(t,e){switch(e){case"?":return!!t;case"!":return!t;case"^":return void 0===t}}),"boolCmp"),jbt=s((function(t){return void 0!==t}),"existCmp"),Ybt=s((function(t,e){return t.data(e)}),"data"),Wbt=s((function(t,e){return t[e]()}),"meta"),Hbt=[],Vbt=s((function(t,e){return t.checks.every((function(t){return Hbt[t.type](t,e)}))}),"matches");Hbt[cbt]=function(t,e){var n=t.value;return"*"===n||n===e.group()},Hbt[mbt]=function(t,e){var n=t.value;return Mbt(n,e)},Hbt[ybt]=function(t,e){var n=t.value;return e.id()===n},Hbt[vbt]=function(t,e){var n=t.value;return e.hasClass(n)},Hbt[fbt]=function(t,e){var n=t.field,r=t.operator,i=t.value;return Gbt(Wbt(e,n),r,i)},Hbt[dbt]=function(t,e){var n=t.field,r=t.operator,i=t.value;return Gbt(Ybt(e,n),r,i)},Hbt[gbt]=function(t,e){var n=t.field,r=t.operator;return qbt(Ybt(e,n),r)},Hbt[pbt]=function(t,e){var n=t.field;return t.operator,jbt(Ybt(e,n))},Hbt[xbt]=function(t,e){var n=t.nodes[0],r=t.nodes[1],i=e.source(),a=e.target();return Vbt(n,i)&&Vbt(r,a)||Vbt(r,i)&&Vbt(n,a)},Hbt[Tbt]=function(t,e){return Vbt(t.node,e)&&e.neighborhood().some((function(e){return e.isNode()&&Vbt(t.neighbor,e)}))},Hbt[bbt]=function(t,e){return Vbt(t.source,e.source())&&Vbt(t.target,e.target())},Hbt[wbt]=function(t,e){return Vbt(t.source,e)&&e.outgoers().some((function(e){return e.isNode()&&Vbt(t.target,e)}))},Hbt[kbt]=function(t,e){return Vbt(t.target,e)&&e.incomers().some((function(e){return e.isNode()&&Vbt(t.source,e)}))},Hbt[_bt]=function(t,e){return Vbt(t.child,e)&&Vbt(t.parent,e.parent())},Hbt[Cbt]=function(t,e){return Vbt(t.parent,e)&&e.children().some((function(e){return Vbt(t.child,e)}))},Hbt[Ebt]=function(t,e){return Vbt(t.descendant,e)&&e.ancestors().some((function(e){return Vbt(t.ancestor,e)}))},Hbt[Sbt]=function(t,e){return Vbt(t.ancestor,e)&&e.descendants().some((function(e){return Vbt(t.descendant,e)}))},Hbt[Abt]=function(t,e){return Vbt(t.subject,e)&&Vbt(t.left,e)&&Vbt(t.right,e)},Hbt[Lbt]=function(){return!0},Hbt[hbt]=function(t,e){return t.value.has(e)},Hbt[ubt]=function(t,e){return(0,t.value)(e)};var Xbt=s((function(t){var e=this;if(1===e.length&&1===e[0].checks.length&&e[0].checks[0].type===ybt)return t.getElementById(e[0].checks[0].value).collection();var n=s((function(t){for(var n=0;n<e.length;n++){var r=e[n];if(Vbt(r,t))return!0}return!1}),"selectorFunction");return null==e.text()&&(n=s((function(){return!0}),"selectorFunction")),t.filter(n)}),"filter"),Kbt=s((function(t){for(var e=0;e<this.length;e++){var n=this[e];if(Vbt(n,t))return!0}return!1}),"matches"),Zbt={matches:Kbt,filter:Xbt},Qbt=s((function(t){this.inputText=t,this.currentSubject=null,this.compoundCount=0,this.edgeCount=0,this.length=0,null==t||Fdt(t)&&t.match(/^\s*$/)||(Hdt(t)?this.addQuery({checks:[{type:hbt,value:t.collection()}]}):zdt(t)?this.addQuery({checks:[{type:ubt,value:t}]}):Fdt(t)?this.parse(t)||(this.invalid=!0):Mgt("A selector must be created from a string; found "))}),"Selector"),Jbt=Qbt.prototype;[Ubt,Zbt].forEach((function(t){return dpt(Jbt,t)})),Jbt.text=function(){return this.inputText},Jbt.size=function(){return this.length},Jbt.eq=function(t){return this[t]},Jbt.sameText=function(t){return!this.invalid&&!t.invalid&&this.text()===t.text()},Jbt.addQuery=function(t){this[this.length++]=t},Jbt.selector=Jbt.toString;var twt={allAre:s((function(t){var e=new Qbt(t);return this.every((function(t){return e.matches(t)}))}),"allAre"),is:s((function(t){var e=new Qbt(t);return this.some((function(t){return e.matches(t)}))}),"is"),some:s((function(t,e){for(var n=0;n<this.length;n++){if(e?t.apply(e,[this[n],n,this]):t(this[n],n,this))return!0}return!1}),"some"),every:s((function(t,e){for(var n=0;n<this.length;n++){if(!(e?t.apply(e,[this[n],n,this]):t(this[n],n,this)))return!1}return!0}),"every"),same:s((function(t){if(this===t)return!0;t=this.cy().collection(t);var e=this.length;return e===t.length&&(1===e?this[0]===t[0]:this.every((function(e){return t.hasElementWithId(e.id())})))}),"same"),anySame:s((function(t){return t=this.cy().collection(t),this.some((function(e){return t.hasElementWithId(e.id())}))}),"anySame"),allAreNeighbors:s((function(t){t=this.cy().collection(t);var e=this.neighborhood();return t.every((function(t){return e.hasElementWithId(t.id())}))}),"allAreNeighbors"),contains:s((function(t){t=this.cy().collection(t);var e=this;return t.every((function(t){return e.hasElementWithId(t.id())}))}),"contains")};twt.allAreNeighbours=twt.allAreNeighbors,twt.has=twt.contains,twt.equal=twt.equals=twt.same;var ewt,nwt,rwt=s((function(t,e){return s((function(n,r,i,a){var s,o=n,l=this;if(null==o?s="":Hdt(o)&&1===o.length&&(s=o.id()),1===l.length&&s){var c=l[0]._private,h=c.traversalCache=c.traversalCache||{},u=h[e]=h[e]||[],d=wgt(s),p=u[d];return p||(u[d]=t.call(l,n,r,i,a))}return t.call(l,n,r,i,a)}),"traversalCache")}),"cache"),iwt={parent:s((function(t){var e=[];if(1===this.length){var n=this[0]._private.parent;if(n)return n}for(var r=0;r<this.length;r++){var i=this[r]._private.parent;i&&e.push(i)}return this.spawn(e,!0).filter(t)}),"parent"),parents:s((function(t){for(var e=[],n=this.parent();n.nonempty();){for(var r=0;r<n.length;r++){var i=n[r];e.push(i)}n=n.parent()}return this.spawn(e,!0).filter(t)}),"parents"),commonAncestors:s((function(t){for(var e,n=0;n<this.length;n++){var r=this[n].parents();e=(e=e||r).intersect(r)}return e.filter(t)}),"commonAncestors"),orphans:s((function(t){return this.stdFilter((function(t){return t.isOrphan()})).filter(t)}),"orphans"),nonorphans:s((function(t){return this.stdFilter((function(t){return t.isChild()})).filter(t)}),"nonorphans"),children:rwt((function(t){for(var e=[],n=0;n<this.length;n++)for(var r=this[n]._private.children,i=0;i<r.length;i++)e.push(r[i]);return this.spawn(e,!0).filter(t)}),"children"),siblings:s((function(t){return this.parent().children().not(this).filter(t)}),"siblings"),isParent:s((function(){var t=this[0];if(t)return t.isNode()&&0!==t._private.children.length}),"isParent"),isChildless:s((function(){var t=this[0];if(t)return t.isNode()&&0===t._private.children.length}),"isChildless"),isChild:s((function(){var t=this[0];if(t)return t.isNode()&&null!=t._private.parent}),"isChild"),isOrphan:s((function(){var t=this[0];if(t)return t.isNode()&&null==t._private.parent}),"isOrphan"),descendants:s((function(t){var e=[];function n(t){for(var r=0;r<t.length;r++){var i=t[r];e.push(i),i.children().nonempty()&&n(i.children())}}return s(n,"add"),n(this.children()),this.spawn(e,!0).filter(t)}),"descendants")};function awt(t,e,n,r){for(var i=[],a=new Xgt,s=t.cy().hasCompoundNodes(),o=0;o<t.length;o++){var l=t[o];n?i.push(l):s&&r(i,a,l)}for(;i.length>0;){var c=i.shift();e(c),a.add(c.id()),s&&r(i,a,c)}return t}function swt(t,e,n){if(n.isParent())for(var r=n._private.children,i=0;i<r.length;i++){var a=r[i];e.has(a.id())||t.push(a)}}function owt(t,e,n){if(n.isChild()){var r=n._private.parent;e.has(r.id())||t.push(r)}}function lwt(t,e,n){owt(t,e,n),swt(t,e,n)}s(awt,"forEachCompound"),s(swt,"addChildren"),iwt.forEachDown=function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return awt(this,t,e,swt)},s(owt,"addParent"),iwt.forEachUp=function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return awt(this,t,e,owt)},s(lwt,"addParentAndChildren"),iwt.forEachUpAndDown=function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return awt(this,t,e,lwt)},iwt.ancestors=iwt.parents,(ewt=nwt={data:ibt.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:ibt.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),scratch:ibt.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:ibt.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),rscratch:ibt.data({field:"rscratch",allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!0}),removeRscratch:ibt.removeData({field:"rscratch",triggerEvent:!1}),id:s((function(){var t=this[0];if(t)return t._private.data.id}),"id")}).attr=ewt.data,ewt.removeAttr=ewt.removeData;var cwt,hwt,uwt=nwt,dwt={};function pwt(t){return function(e){var n=this;if(void 0===e&&(e=!0),0!==n.length&&n.isNode()&&!n.removed()){for(var r=0,i=n[0],a=i._private.edges,s=0;s<a.length;s++){var o=a[s];!e&&o.isLoop()||(r+=t(i,o))}return r}}}function gwt(t,e){return function(n){for(var r,i=this.nodes(),a=0;a<i.length;a++){var s=i[a][t](n);void 0===s||void 0!==r&&!e(s,r)||(r=s)}return r}}s(pwt,"defineDegreeFunction"),dpt(dwt,{degree:pwt((function(t,e){return e.source().same(e.target())?2:1})),indegree:pwt((function(t,e){return e.target().same(t)?1:0})),outdegree:pwt((function(t,e){return e.source().same(t)?1:0}))}),s(gwt,"defineDegreeBoundsFunction"),dpt(dwt,{minDegree:gwt("degree",(function(t,e){return t<e})),maxDegree:gwt("degree",(function(t,e){return t>e})),minIndegree:gwt("indegree",(function(t,e){return t<e})),maxIndegree:gwt("indegree",(function(t,e){return t>e})),minOutdegree:gwt("outdegree",(function(t,e){return t<e})),maxOutdegree:gwt("outdegree",(function(t,e){return t>e}))}),dpt(dwt,{totalDegree:s((function(t){for(var e=0,n=this.nodes(),r=0;r<n.length;r++)e+=n[r].degree(t);return e}),"totalDegree")});var fwt=s((function(t,e,n){for(var r=0;r<t.length;r++){var i=t[r];if(!i.locked()){var a=i._private.position,s={x:null!=e.x?e.x-a.x:0,y:null!=e.y?e.y-a.y:0};!i.isParent()||0===s.x&&0===s.y||i.children().shift(s,n),i.dirtyBoundingBoxCache()}}}),"beforePositionSet"),mwt={field:"position",bindingEvent:"position",allowBinding:!0,allowSetting:!0,settingEvent:"position",settingTriggersEvent:!0,triggerFnName:"emitAndNotify",allowGetting:!0,validKeys:["x","y"],beforeGet:s((function(t){t.updateCompoundBounds()}),"beforeGet"),beforeSet:s((function(t,e){fwt(t,e,!1)}),"beforeSet"),onSet:s((function(t){t.dirtyCompoundBoundsCache()}),"onSet"),canSet:s((function(t){return!t.locked()}),"canSet")};cwt=hwt={position:ibt.data(mwt),silentPosition:ibt.data(dpt({},mwt,{allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!1,beforeSet:s((function(t,e){fwt(t,e,!0)}),"beforeSet"),onSet:s((function(t){t.dirtyCompoundBoundsCache()}),"onSet")})),positions:s((function(t,e){if(Gdt(t))e?this.silentPosition(t):this.position(t);else if(zdt(t)){var n=t,r=this.cy();r.startBatch();for(var i=0;i<this.length;i++){var a,s=this[i];(a=n(s,i))&&(e?s.silentPosition(a):s.position(a))}r.endBatch()}return this}),"positions"),silentPositions:s((function(t){return this.positions(t,!0)}),"silentPositions"),shift:s((function(t,e,n){var r;if(Gdt(t)?(r={x:jdt(t.x)?t.x:0,y:jdt(t.y)?t.y:0},n=e):Fdt(t)&&jdt(e)&&((r={x:0,y:0})[t]=e),null!=r){var i=this.cy();i.startBatch();for(var a=0;a<this.length;a++){var s=this[a];if(!(i.hasCompoundNodes()&&s.isChild()&&s.ancestors().anySame(this))){var o=s.position(),l={x:o.x+r.x,y:o.y+r.y};n?s.silentPosition(l):s.position(l)}}i.endBatch()}return this}),"shift"),silentShift:s((function(t,e){return Gdt(t)?this.shift(t,!0):Fdt(t)&&jdt(e)&&this.shift(t,e,!0),this}),"silentShift"),renderedPosition:s((function(t,e){var n=this[0],r=this.cy(),i=r.zoom(),a=r.pan(),s=Gdt(t)?t:void 0,o=void 0!==s||void 0!==e&&Fdt(t);if(n&&n.isNode()){if(!o){var l=n.position();return s=fft(l,i,a),void 0===t?s:s[t]}for(var c=0;c<this.length;c++){var h=this[c];void 0!==e?h.position(t,(e-a[t])/i):void 0!==s&&h.position(mft(s,i,a))}}else if(!o)return;return this}),"renderedPosition"),relativePosition:s((function(t,e){var n=this[0],r=this.cy(),i=Gdt(t)?t:void 0,a=void 0!==i||void 0!==e&&Fdt(t),s=r.hasCompoundNodes();if(n&&n.isNode()){if(!a){var o=n.position(),l=s?n.parent():null,c=l&&l.length>0,h=c;c&&(l=l[0]);var u=h?l.position():{x:0,y:0};return i={x:o.x-u.x,y:o.y-u.y},void 0===t?i:i[t]}for(var d=0;d<this.length;d++){var p=this[d],g=s?p.parent():null,f=g&&g.length>0,m=f;f&&(g=g[0]);var y=m?g.position():{x:0,y:0};void 0!==e?p.position(t,e+y[t]):void 0!==i&&p.position({x:i.x+y.x,y:i.y+y.y})}}else if(!a)return;return this}),"relativePosition")},cwt.modelPosition=cwt.point=cwt.position,cwt.modelPositions=cwt.points=cwt.positions,cwt.renderedPoint=cwt.renderedPosition,cwt.relativePoint=cwt.relativePosition;var ywt,vwt,xwt=hwt;ywt=vwt={},vwt.renderedBoundingBox=function(t){var e=this.boundingBox(t),n=this.cy(),r=n.zoom(),i=n.pan(),a=e.x1*r+i.x,s=e.x2*r+i.x,o=e.y1*r+i.y,l=e.y2*r+i.y;return{x1:a,x2:s,y1:o,y2:l,w:s-a,h:l-o}},vwt.dirtyCompoundBoundsCache=function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=this.cy();return e.styleEnabled()&&e.hasCompoundNodes()?(this.forEachUp((function(e){if(e.isParent()){var n=e._private;n.compoundBoundsClean=!1,n.bbCache=null,t||e.emitAndNotify("bounds")}})),this):this},vwt.updateCompoundBounds=function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=this.cy();if(!e.styleEnabled()||!e.hasCompoundNodes())return this;if(!t&&e.batching())return this;function n(t){if(t.isParent()){var e=t._private,n=t.children(),r="include"===t.pstyle("compound-sizing-wrt-labels").value,i={width:{val:t.pstyle("min-width").pfValue,left:t.pstyle("min-width-bias-left"),right:t.pstyle("min-width-bias-right")},height:{val:t.pstyle("min-height").pfValue,top:t.pstyle("min-height-bias-top"),bottom:t.pstyle("min-height-bias-bottom")}},a=n.boundingBox({includeLabels:r,includeOverlays:!1,useCache:!1}),o=e.position;0!==a.w&&0!==a.h||((a={w:t.pstyle("width").pfValue,h:t.pstyle("height").pfValue}).x1=o.x-a.w/2,a.x2=o.x+a.w/2,a.y1=o.y-a.h/2,a.y2=o.y+a.h/2),s(v,"computeBiasValues"),s(x,"computePaddingValues");var l=i.width.left.value;"px"===i.width.left.units&&i.width.val>0&&(l=100*l/i.width.val);var c=i.width.right.value;"px"===i.width.right.units&&i.width.val>0&&(c=100*c/i.width.val);var h=i.height.top.value;"px"===i.height.top.units&&i.height.val>0&&(h=100*h/i.height.val);var u=i.height.bottom.value;"px"===i.height.bottom.units&&i.height.val>0&&(u=100*u/i.height.val);var d=v(i.width.val-a.w,l,c),p=d.biasDiff,g=d.biasComplementDiff,f=v(i.height.val-a.h,h,u),m=f.biasDiff,y=f.biasComplementDiff;e.autoPadding=x(a.w,a.h,t.pstyle("padding"),t.pstyle("padding-relative-to").value),e.autoWidth=Math.max(a.w,i.width.val),o.x=(-p+a.x1+a.x2+g)/2,e.autoHeight=Math.max(a.h,i.height.val),o.y=(-m+a.y1+a.y2+y)/2}function v(t,e,n){var r=0,i=0,a=e+n;return t>0&&a>0&&(r=e/a*t,i=n/a*t),{biasDiff:r,biasComplementDiff:i}}function x(t,e,n,r){if("%"!==n.units)return"px"===n.units?n.pfValue:0;switch(r){case"width":return t>0?n.pfValue*t:0;case"height":return e>0?n.pfValue*e:0;case"average":return t>0&&e>0?n.pfValue*(t+e)/2:0;case"min":return t>0&&e>0?t>e?n.pfValue*e:n.pfValue*t:0;case"max":return t>0&&e>0?t>e?n.pfValue*t:n.pfValue*e:0;default:return 0}}}s(n,"update");for(var r=0;r<this.length;r++){var i=this[r],a=i._private;a.compoundBoundsClean&&!t||(n(i),e.batching()||(a.compoundBoundsClean=!0))}return this};var bwt=s((function(t){return t===1/0||t===-1/0?0:t}),"noninf"),wwt=s((function(t,e,n,r,i){r-e!=0&&i-n!=0&&null!=e&&null!=n&&null!=r&&null!=i&&(t.x1=e<t.x1?e:t.x1,t.x2=r>t.x2?r:t.x2,t.y1=n<t.y1?n:t.y1,t.y2=i>t.y2?i:t.y2,t.w=t.x2-t.x1,t.h=t.y2-t.y1)}),"updateBounds"),kwt=s((function(t,e){return null==e?t:wwt(t,e.x1,e.y1,e.x2,e.y2)}),"updateBoundsFromBox"),Twt=s((function(t,e,n){return Ygt(t,e,n)}),"prefixedProperty"),_wt=s((function(t,e,n){if(!e.cy().headless()){var r,i,a=e._private,s=a.rstyle,o=s.arrowWidth/2;if("none"!==e.pstyle(n+"-arrow-shape").value){"source"===n?(r=s.srcX,i=s.srcY):"target"===n?(r=s.tgtX,i=s.tgtY):(r=s.midX,i=s.midY);var l=a.arrowBounds=a.arrowBounds||{},c=l[n]=l[n]||{};c.x1=r-o,c.y1=i-o,c.x2=r+o,c.y2=i+o,c.w=c.x2-c.x1,c.h=c.y2-c.y1,Fft(c,1),wwt(t,c.x1,c.y1,c.x2,c.y2)}}}),"updateBoundsFromArrow"),Ewt=s((function(t,e,n){if(!e.cy().headless()){var r;r=n?n+"-":"";var i=e._private,a=i.rstyle;if(e.pstyle(r+"label").strValue){var o,l,c,h,u=e.pstyle("text-halign"),d=e.pstyle("text-valign"),p=Twt(a,"labelWidth",n),g=Twt(a,"labelHeight",n),f=Twt(a,"labelX",n),m=Twt(a,"labelY",n),y=e.pstyle(r+"text-margin-x").pfValue,v=e.pstyle(r+"text-margin-y").pfValue,x=e.isEdge(),b=e.pstyle(r+"text-rotation"),w=e.pstyle("text-outline-width").pfValue,k=e.pstyle("text-border-width").pfValue/2,T=e.pstyle("text-background-padding").pfValue,_=g,E=p,C=E/2,S=_/2;if(x)o=f-C,l=f+C,c=m-S,h=m+S;else{switch(u.value){case"left":o=f-E,l=f;break;case"center":o=f-C,l=f+C;break;case"right":o=f,l=f+E}switch(d.value){case"top":c=m-_,h=m;break;case"center":c=m-S,h=m+S;break;case"bottom":c=m,h=m+_}}o+=y-Math.max(w,k)-T-2,l+=y+Math.max(w,k)+T+2,c+=v-Math.max(w,k)-T-2,h+=v+Math.max(w,k)+T+2;var A=n||"main",L=i.labelBounds,N=L[A]=L[A]||{};N.x1=o,N.y1=c,N.x2=l,N.y2=h,N.w=l-o,N.h=h-c;var I=x&&"autorotate"===b.strValue,M=null!=b.pfValue&&0!==b.pfValue;if(I||M){var R=I?Twt(i.rstyle,"labelAngle",n):b.pfValue,D=Math.cos(R),O=Math.sin(R),P=(o+l)/2,B=(c+h)/2;if(!x){switch(u.value){case"left":P=l;break;case"right":P=o}switch(d.value){case"top":B=h;break;case"bottom":B=c}}var $=s((function(t,e){return{x:(t-=P)*D-(e-=B)*O+P,y:t*O+e*D+B}}),"rotate"),F=$(o,c),z=$(o,h),U=$(l,c),G=$(l,h);o=Math.min(F.x,z.x,U.x,G.x),l=Math.max(F.x,z.x,U.x,G.x),c=Math.min(F.y,z.y,U.y,G.y),h=Math.max(F.y,z.y,U.y,G.y)}var q=A+"Rot",j=L[q]=L[q]||{};j.x1=o,j.y1=c,j.x2=l,j.y2=h,j.w=l-o,j.h=h-c,wwt(t,o,c,l,h),wwt(i.labelBounds.all,o,c,l,h)}return t}}),"updateBoundsFromLabel"),Cwt=s((function(t,e){if(!e.cy().headless()){var n=e.pstyle("outline-opacity").value,r=e.pstyle("outline-width").value;if(n>0&&r>0){var i=e.pstyle("outline-offset").value,a=e.pstyle("shape").value,s=r+i,o=(t.w+2*s)/t.w,l=(t.h+2*s)/t.h,c=0;["diamond","pentagon","round-triangle"].includes(a)?(o=(t.w+2.4*s)/t.w,c=-s/3.6):["concave-hexagon","rhomboid","right-rhomboid"].includes(a)?o=(t.w+2.4*s)/t.w:"star"===a?(o=(t.w+2.8*s)/t.w,l=(t.h+2.6*s)/t.h,c=-s/3.8):"triangle"===a?(o=(t.w+2.8*s)/t.w,l=(t.h+2.4*s)/t.h,c=-s/1.4):"vee"===a&&(o=(t.w+4.4*s)/t.w,l=(t.h+3.8*s)/t.h,c=.5*-s);var h=t.h*l-t.h,u=t.w*o-t.w;if(zft(t,[Math.ceil(h/2),Math.ceil(u/2)]),0!==c){var d=Pft(t,0,c);Bft(t,d)}}}}),"updateBoundsFromOutline"),Swt=s((function(t,e){var n,r,i,a,o,l,c=t._private.cy,h=c.styleEnabled(),u=c.headless(),d=Rft(),p=t._private,g=t.isNode(),f=t.isEdge(),m=p.rstyle,y=g&&h?t.pstyle("bounds-expansion").pfValue:[0],v=s((function(t){return"none"!==t.pstyle("display").value}),"isDisplayed"),x=!h||v(t)&&(!f||v(t.source())&&v(t.target()));if(x){var b=0;h&&e.includeOverlays&&0!==t.pstyle("overlay-opacity").value&&(b=t.pstyle("overlay-padding").value);var w=0;h&&e.includeUnderlays&&0!==t.pstyle("underlay-opacity").value&&(w=t.pstyle("underlay-padding").value);var k=Math.max(b,w),T=0;if(h&&(T=t.pstyle("width").pfValue/2),g&&e.includeNodes){var _=t.position();o=_.x,l=_.y;var E=t.outerWidth()/2,C=t.outerHeight()/2;wwt(d,n=o-E,i=l-C,r=o+E,a=l+C),h&&e.includeOutlines&&Cwt(d,t)}else if(f&&e.includeEdges)if(h&&!u){var S=t.pstyle("curve-style").strValue;if(n=Math.min(m.srcX,m.midX,m.tgtX),r=Math.max(m.srcX,m.midX,m.tgtX),i=Math.min(m.srcY,m.midY,m.tgtY),a=Math.max(m.srcY,m.midY,m.tgtY),wwt(d,n-=T,i-=T,r+=T,a+=T),"haystack"===S){var A=m.haystackPts;if(A&&2===A.length){if(n=A[0].x,i=A[0].y,n>(r=A[1].x)){var L=n;n=r,r=L}if(i>(a=A[1].y)){var N=i;i=a,a=N}wwt(d,n-T,i-T,r+T,a+T)}}else if("bezier"===S||"unbundled-bezier"===S||S.endsWith("segments")||S.endsWith("taxi")){var I;switch(S){case"bezier":case"unbundled-bezier":I=m.bezierPts;break;case"segments":case"taxi":case"round-segments":case"round-taxi":I=m.linePts}if(null!=I)for(var M=0;M<I.length;M++){var R=I[M];n=R.x-T,r=R.x+T,i=R.y-T,a=R.y+T,wwt(d,n,i,r,a)}}}else{var D=t.source().position(),O=t.target().position();if((n=D.x)>(r=O.x)){var P=n;n=r,r=P}if((i=D.y)>(a=O.y)){var B=i;i=a,a=B}wwt(d,n-=T,i-=T,r+=T,a+=T)}if(h&&e.includeEdges&&f&&(_wt(d,t,"mid-source"),_wt(d,t,"mid-target"),_wt(d,t,"source"),_wt(d,t,"target")),h)if("yes"===t.pstyle("ghost").value){var $=t.pstyle("ghost-offset-x").pfValue,F=t.pstyle("ghost-offset-y").pfValue;wwt(d,d.x1+$,d.y1+F,d.x2+$,d.y2+F)}var z=p.bodyBounds=p.bodyBounds||{};Uft(z,d),zft(z,y),Fft(z,1),h&&(n=d.x1,r=d.x2,i=d.y1,a=d.y2,wwt(d,n-k,i-k,r+k,a+k));var U=p.overlayBounds=p.overlayBounds||{};Uft(U,d),zft(U,y),Fft(U,1);var G=p.labelBounds=p.labelBounds||{};null!=G.all?Oft(G.all):G.all=Rft(),h&&e.includeLabels&&(e.includeMainLabels&&Ewt(d,t,null),f&&(e.includeSourceLabels&&Ewt(d,t,"source"),e.includeTargetLabels&&Ewt(d,t,"target")))}return d.x1=bwt(d.x1),d.y1=bwt(d.y1),d.x2=bwt(d.x2),d.y2=bwt(d.y2),d.w=bwt(d.x2-d.x1),d.h=bwt(d.y2-d.y1),d.w>0&&d.h>0&&x&&(zft(d,y),Fft(d,1)),d}),"boundingBoxImpl"),Awt=s((function(t){var e=0,n=s((function(t){return(t?1:0)<<e++}),"tf"),r=0;return r+=n(t.incudeNodes),r+=n(t.includeEdges),r+=n(t.includeLabels),r+=n(t.includeMainLabels),r+=n(t.includeSourceLabels),r+=n(t.includeTargetLabels),r+=n(t.includeOverlays),r+=n(t.includeOutlines)}),"getKey"),Lwt=s((function(t){if(t.isEdge()){var e=t.source().position(),n=t.target().position(),r=s((function(t){return Math.round(t)}),"r");return bgt([r(e.x),r(e.y),r(n.x),r(n.y)])}return 0}),"getBoundingBoxPosKey"),Nwt=s((function(t,e){var n,r=t._private,i=t.isEdge(),a=(null==e?Mwt:Awt(e))===Mwt,o=Lwt(t),l=r.bbCachePosKey===o,c=e.useCache&&l,h=s((function(t){return null==t._private.bbCache||t._private.styleDirty}),"isDirty");if(!c||h(t)||i&&h(t.source())||h(t.target())?(l||t.recalculateRenderedStyle(c),n=Swt(t,Iwt),r.bbCache=n,r.bbCachePosKey=o):n=r.bbCache,!a){var u=t.isNode();n=Rft(),(e.includeNodes&&u||e.includeEdges&&!u)&&(e.includeOverlays?kwt(n,r.overlayBounds):kwt(n,r.bodyBounds)),e.includeLabels&&(e.includeMainLabels&&(!i||e.includeSourceLabels&&e.includeTargetLabels)?kwt(n,r.labelBounds.all):(e.includeMainLabels&&kwt(n,r.labelBounds.mainRot),e.includeSourceLabels&&kwt(n,r.labelBounds.sourceRot),e.includeTargetLabels&&kwt(n,r.labelBounds.targetRot))),n.w=n.x2-n.x1,n.h=n.y2-n.y1}return n}),"cachedBoundingBoxImpl"),Iwt={includeNodes:!0,includeEdges:!0,includeLabels:!0,includeMainLabels:!0,includeSourceLabels:!0,includeTargetLabels:!0,includeOverlays:!0,includeUnderlays:!0,includeOutlines:!0,useCache:!0},Mwt=Awt(Iwt),Rwt=Ugt(Iwt);vwt.boundingBox=function(t){var e;if(1!==this.length||null==this[0]._private.bbCache||this[0]._private.styleDirty||void 0!==t&&void 0!==t.useCache&&!0!==t.useCache){e=Rft();var n=Rwt(t=t||Iwt),r=this;if(r.cy().styleEnabled())for(var i=0;i<r.length;i++){var a=r[i],s=a._private,o=Lwt(a),l=s.bbCachePosKey===o,c=n.useCache&&l&&!s.styleDirty;a.recalculateRenderedStyle(c)}this.updateCompoundBounds(!t.useCache);for(var h=0;h<r.length;h++){var u=r[h];kwt(e,Nwt(u,n))}}else t=void 0===t?Iwt:Rwt(t),e=Nwt(this[0],t);return e.x1=bwt(e.x1),e.y1=bwt(e.y1),e.x2=bwt(e.x2),e.y2=bwt(e.y2),e.w=bwt(e.x2-e.x1),e.h=bwt(e.y2-e.y1),e},vwt.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},vwt.boundingBoxAt=function(t){var e=this.nodes(),n=this.cy(),r=n.hasCompoundNodes(),i=n.collection();if(r&&(i=e.filter((function(t){return t.isParent()})),e=e.not(i)),Gdt(t)){var a=t;t=s((function(){return a}),"fn")}var o=s((function(e,n){return e._private.bbAtOldPos=t(e,n)}),"storeOldPos"),l=s((function(t){return t._private.bbAtOldPos}),"getOldPos");n.startBatch(),e.forEach(o).silentPositions(t),r&&(i.dirtyCompoundBoundsCache(),i.dirtyBoundingBoxCache(),i.updateCompoundBounds(!0));var c=Dft(this.boundingBox({useCache:!1}));return e.silentPositions(l),r&&(i.dirtyCompoundBoundsCache(),i.dirtyBoundingBoxCache(),i.updateCompoundBounds(!0)),n.endBatch(),c},ywt.boundingbox=ywt.bb=ywt.boundingBox,ywt.renderedBoundingbox=ywt.renderedBoundingBox;var Dwt,Owt,Pwt=vwt;Dwt=Owt={};var Bwt=s((function(t){t.uppercaseName=lpt(t.name),t.autoName="auto"+t.uppercaseName,t.labelName="label"+t.uppercaseName,t.outerName="outer"+t.uppercaseName,t.uppercaseOuterName=lpt(t.outerName),Dwt[t.name]=s((function(){var e=this[0],n=e._private,r=n.cy._private.styleEnabled;if(e){if(r){if(e.isParent())return e.updateCompoundBounds(),n[t.autoName]||0;var i=e.pstyle(t.name);return"label"===i.strValue?(e.recalculateRenderedStyle(),n.rstyle[t.labelName]||0):i.pfValue}return 1}}),"dimImpl"),Dwt["outer"+t.uppercaseName]=s((function(){var e=this[0],n=e._private.cy._private.styleEnabled;if(e)return n?e[t.name]()+e.pstyle("border-width").pfValue+2*e.padding():1}),"outerDimImpl"),Dwt["rendered"+t.uppercaseName]=s((function(){var e=this[0];if(e)return e[t.name]()*this.cy().zoom()}),"renderedDimImpl"),Dwt["rendered"+t.uppercaseOuterName]=s((function(){var e=this[0];if(e)return e[t.outerName]()*this.cy().zoom()}),"renderedOuterDimImpl")}),"defineDimFns");Bwt({name:"width"}),Bwt({name:"height"}),Owt.padding=function(){var t=this[0],e=t._private;return t.isParent()?(t.updateCompoundBounds(),void 0!==e.autoPadding?e.autoPadding:t.pstyle("padding").pfValue):t.pstyle("padding").pfValue},Owt.paddedHeight=function(){var t=this[0];return t.height()+2*t.padding()},Owt.paddedWidth=function(){var t=this[0];return t.width()+2*t.padding()};var $wt=Owt,Fwt=s((function(t,e){if(t.isEdge())return e(t)}),"ifEdge"),zwt=s((function(t,e){if(t.isEdge()){var n=t.cy();return fft(e(t),n.zoom(),n.pan())}}),"ifEdgeRenderedPosition"),Uwt=s((function(t,e){if(t.isEdge()){var n=t.cy(),r=n.pan(),i=n.zoom();return e(t).map((function(t){return fft(t,i,r)}))}}),"ifEdgeRenderedPositions"),Gwt={controlPoints:{get:s((function(t){return t.renderer().getControlPoints(t)}),"controlPoints"),mult:!0},segmentPoints:{get:s((function(t){return t.renderer().getSegmentPoints(t)}),"segmentPoints"),mult:!0},sourceEndpoint:{get:s((function(t){return t.renderer().getSourceEndpoint(t)}),"sourceEndpoint")},targetEndpoint:{get:s((function(t){return t.renderer().getTargetEndpoint(t)}),"targetEndpoint")},midpoint:{get:s((function(t){return t.renderer().getEdgeMidpoint(t)}),"midpoint")}},qwt=s((function(t){return"rendered"+t[0].toUpperCase()+t.substr(1)}),"renderedName"),jwt=Object.keys(Gwt).reduce((function(t,e){var n=Gwt[e],r=qwt(e);return t[e]=function(){return Fwt(this,n.get)},n.mult?t[r]=function(){return Uwt(this,n.get)}:t[r]=function(){return zwt(this,n.get)},t}),{}),Ywt=dpt({},xwt,Pwt,$wt,jwt),Wwt=s((function(t,e){this.recycle(t,e)}),"Event");function Hwt(){return!1}function Vwt(){return!0}s(Hwt,"returnFalse"),s(Vwt,"returnTrue"),Wwt.prototype={instanceString:s((function(){return"event"}),"instanceString"),recycle:s((function(t,e){if(this.isImmediatePropagationStopped=this.isPropagationStopped=this.isDefaultPrevented=Hwt,null!=t&&t.preventDefault?(this.type=t.type,this.isDefaultPrevented=t.defaultPrevented?Vwt:Hwt):null!=t&&t.type?e=t:this.type=t,null!=e&&(this.originalEvent=e.originalEvent,this.type=null!=e.type?e.type:this.type,this.cy=e.cy,this.target=e.target,this.position=e.position,this.renderedPosition=e.renderedPosition,this.namespace=e.namespace,this.layout=e.layout),null!=this.cy&&null!=this.position&&null==this.renderedPosition){var n=this.position,r=this.cy.zoom(),i=this.cy.pan();this.renderedPosition={x:n.x*r+i.x,y:n.y*r+i.y}}this.timeStamp=t&&t.timeStamp||Date.now()}),"recycle"),preventDefault:s((function(){this.isDefaultPrevented=Vwt;var t=this.originalEvent;t&&t.preventDefault&&t.preventDefault()}),"preventDefault"),stopPropagation:s((function(){this.isPropagationStopped=Vwt;var t=this.originalEvent;t&&t.stopPropagation&&t.stopPropagation()}),"stopPropagation"),stopImmediatePropagation:s((function(){this.isImmediatePropagationStopped=Vwt,this.stopPropagation()}),"stopImmediatePropagation"),isDefaultPrevented:Hwt,isPropagationStopped:Hwt,isImmediatePropagationStopped:Hwt};var Xwt=/^([^.]+)(\.(?:[^.]+))?$/,Kwt={qualifierCompare:s((function(t,e){return t===e}),"qualifierCompare"),eventMatches:s((function(){return!0}),"eventMatches"),addEventFields:s((function(){}),"addEventFields"),callbackContext:s((function(t){return t}),"callbackContext"),beforeEmit:s((function(){}),"beforeEmit"),afterEmit:s((function(){}),"afterEmit"),bubble:s((function(){return!1}),"bubble"),parent:s((function(){return null}),"parent"),context:null},Zwt=Object.keys(Kwt),Qwt={};function Jwt(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Qwt,e=arguments.length>1?arguments[1]:void 0,n=0;n<Zwt.length;n++){var r=Zwt[n];this[r]=t[r]||Kwt[r]}this.context=e||this.context,this.listeners=[],this.emitting=0}s(Jwt,"Emitter");var tkt=Jwt.prototype,ekt=s((function(t,e,n,r,i,a,s){zdt(r)&&(i=r,r=null),s&&(a=null==a?s:dpt({},a,s));for(var o=Udt(n)?n:n.split(/\s+/),l=0;l<o.length;l++){var c=o[l];if(!Jdt(c)){var h=c.match(Xwt);if(h)if(!1===e(t,c,h[1],h[2]?h[2]:null,r,i,a))break}}}),"forEachEvent"),nkt=s((function(t,e){return t.addEventFields(t.context,e),new Wwt(e.type,e)}),"makeEventObj"),rkt=s((function(t,e,n){if(Qdt(n))e(t,n);else if(Gdt(n))e(t,nkt(t,n));else for(var r=Udt(n)?n:n.split(/\s+/),i=0;i<r.length;i++){var a=r[i];if(!Jdt(a)){var s=a.match(Xwt);if(s){var o=s[1],l=s[2]?s[2]:null;e(t,nkt(t,{type:o,namespace:l,target:t.context}))}}}}),"forEachEventObj");tkt.on=tkt.addListener=function(t,e,n,r,i){return ekt(this,(function(t,e,n,r,i,a,s){zdt(a)&&t.listeners.push({event:e,callback:a,type:n,namespace:r,qualifier:i,conf:s})}),t,e,n,r,i),this},tkt.one=function(t,e,n,r){return this.on(t,e,n,r,{one:!0})},tkt.removeListener=tkt.off=function(t,e,n,r){var i=this;0!==this.emitting&&(this.listeners=Bgt(this.listeners));for(var a=this.listeners,o=s((function(s){var o=a[s];ekt(i,(function(e,n,r,i,l,c){if((o.type===r||"*"===t)&&(!i&&".*"!==o.namespace||o.namespace===i)&&(!l||e.qualifierCompare(o.qualifier,l))&&(!c||o.callback===c))return a.splice(s,1),!1}),t,e,n,r)}),"_loop"),l=a.length-1;l>=0;l--)o(l);return this},tkt.removeAllListeners=function(){return this.removeListener("*")},tkt.emit=tkt.trigger=function(t,e,n){var r=this.listeners,i=r.length;return this.emitting++,Udt(e)||(e=[e]),rkt(this,(function(t,a){null!=n&&(r=[{event:a.event,type:a.type,namespace:a.namespace,callback:n}],i=r.length);for(var o=s((function(n){var i=r[n];if(i.type===a.type&&(!i.namespace||i.namespace===a.namespace||".*"===i.namespace)&&t.eventMatches(t.context,i,a)){var s=[a];null!=e&&jgt(s,e),t.beforeEmit(t.context,i,a),i.conf&&i.conf.one&&(t.listeners=t.listeners.filter((function(t){return t!==i})));var o=t.callbackContext(t.context,i,a),l=i.callback.apply(o,s);t.afterEmit(t.context,i,a),!1===l&&(a.stopPropagation(),a.preventDefault())}}),"_loop2"),l=0;l<i;l++)o(l);t.bubble(t.context)&&!a.isPropagationStopped()&&t.parent(t.context).emit(a,e)}),t),this.emitting--,this};var ikt={qualifierCompare:s((function(t,e){return null==t||null==e?null==t&&null==e:t.sameText(e)}),"qualifierCompare"),eventMatches:s((function(t,e,n){var r=e.qualifier;return null==r||t!==n.target&&Vdt(n.target)&&r.matches(n.target)}),"eventMatches"),addEventFields:s((function(t,e){e.cy=t.cy(),e.target=t}),"addEventFields"),callbackContext:s((function(t,e,n){return null!=e.qualifier?n.target:t}),"callbackContext"),beforeEmit:s((function(t,e){e.conf&&e.conf.once&&e.conf.onceCollection.removeListener(e.event,e.qualifier,e.callback)}),"beforeEmit"),bubble:s((function(){return!0}),"bubble"),parent:s((function(t){return t.isChild()?t.parent():t.cy()}),"parent")},akt=s((function(t){return Fdt(t)?new Qbt(t):t}),"argSelector"),skt={createEmitter:s((function(){for(var t=0;t<this.length;t++){var e=this[t],n=e._private;n.emitter||(n.emitter=new Jwt(ikt,e))}return this}),"createEmitter"),emitter:s((function(){return this._private.emitter}),"emitter"),on:s((function(t,e,n){for(var r=akt(e),i=0;i<this.length;i++){this[i].emitter().on(t,r,n)}return this}),"on"),removeListener:s((function(t,e,n){for(var r=akt(e),i=0;i<this.length;i++){this[i].emitter().removeListener(t,r,n)}return this}),"removeListener"),removeAllListeners:s((function(){for(var t=0;t<this.length;t++){this[t].emitter().removeAllListeners()}return this}),"removeAllListeners"),one:s((function(t,e,n){for(var r=akt(e),i=0;i<this.length;i++){this[i].emitter().one(t,r,n)}return this}),"one"),once:s((function(t,e,n){for(var r=akt(e),i=0;i<this.length;i++){this[i].emitter().on(t,r,n,{once:!0,onceCollection:this})}}),"once"),emit:s((function(t,e){for(var n=0;n<this.length;n++){this[n].emitter().emit(t,e)}return this}),"emit"),emitAndNotify:s((function(t,e){if(0!==this.length)return this.cy().notify(t,this),this.emit(t,e),this}),"emitAndNotify")};ibt.eventAliasesOn(skt);var okt={nodes:s((function(t){return this.filter((function(t){return t.isNode()})).filter(t)}),"nodes"),edges:s((function(t){return this.filter((function(t){return t.isEdge()})).filter(t)}),"edges"),byGroup:s((function(){for(var t=this.spawn(),e=this.spawn(),n=0;n<this.length;n++){var r=this[n];r.isNode()?t.push(r):e.push(r)}return{nodes:t,edges:e}}),"byGroup"),filter:s((function(t,e){if(void 0===t)return this;if(Fdt(t)||Hdt(t))return new Qbt(t).filter(this);if(zdt(t)){for(var n=this.spawn(),r=this,i=0;i<r.length;i++){var a=r[i];(e?t.apply(e,[a,i,r]):t(a,i,r))&&n.push(a)}return n}return this.spawn()}),"filter"),not:s((function(t){if(t){Fdt(t)&&(t=this.filter(t));for(var e=this.spawn(),n=0;n<this.length;n++){var r=this[n];t.has(r)||e.push(r)}return e}return this}),"not"),absoluteComplement:s((function(){return this.cy().mutableElements().not(this)}),"absoluteComplement"),intersect:s((function(t){if(Fdt(t)){var e=t;return this.filter(e)}for(var n=this.spawn(),r=t,i=this.length<t.length,a=i?this:r,s=i?r:this,o=0;o<a.length;o++){var l=a[o];s.has(l)&&n.push(l)}return n}),"intersect"),xor:s((function(t){var e=this._private.cy;Fdt(t)&&(t=e.$(t));var n=this.spawn(),r=t,i=s((function(t,e){for(var r=0;r<t.length;r++){var i=t[r],a=i._private.data.id;e.hasElementWithId(a)||n.push(i)}}),"add");return i(this,r),i(r,this),n}),"xor"),diff:s((function(t){var e=this._private.cy;Fdt(t)&&(t=e.$(t));var n=this.spawn(),r=this.spawn(),i=this.spawn(),a=t,o=s((function(t,e,n){for(var r=0;r<t.length;r++){var a=t[r],s=a._private.data.id;e.hasElementWithId(s)?i.merge(a):n.push(a)}}),"add");return o(this,a,n),o(a,this,r),{left:n,right:r,both:i}}),"diff"),add:s((function(t){var e=this._private.cy;if(!t)return this;if(Fdt(t)){var n=t;t=e.mutableElements().filter(n)}for(var r=this.spawnSelf(),i=0;i<t.length;i++){var a=t[i];!this.has(a)&&r.push(a)}return r}),"add"),merge:s((function(t){var e=this._private,n=e.cy;if(!t)return this;if(t&&Fdt(t)){var r=t;t=n.mutableElements().filter(r)}for(var i=e.map,a=0;a<t.length;a++){var s=t[a],o=s._private.data.id;if(!i.has(o)){var l=this.length++;this[l]=s,i.set(o,{ele:s,index:l})}}return this}),"merge"),unmergeAt:s((function(t){var e=this[t].id(),n=this._private.map;this[t]=void 0,n.delete(e);var r=t===this.length-1;if(this.length>1&&!r){var i=this.length-1,a=this[i],s=a._private.data.id;this[i]=void 0,this[t]=a,n.set(s,{ele:a,index:t})}return this.length--,this}),"unmergeAt"),unmergeOne:s((function(t){t=t[0];var e=this._private,n=t._private.data.id,r=e.map.get(n);if(!r)return this;var i=r.index;return this.unmergeAt(i),this}),"unmergeOne"),unmerge:s((function(t){var e=this._private.cy;if(!t)return this;if(t&&Fdt(t)){var n=t;t=e.mutableElements().filter(n)}for(var r=0;r<t.length;r++)this.unmergeOne(t[r]);return this}),"unmerge"),unmergeBy:s((function(t){for(var e=this.length-1;e>=0;e--){t(this[e])&&this.unmergeAt(e)}return this}),"unmergeBy"),map:s((function(t,e){for(var n=[],r=this,i=0;i<r.length;i++){var a=r[i],s=e?t.apply(e,[a,i,r]):t(a,i,r);n.push(s)}return n}),"map"),reduce:s((function(t,e){for(var n=e,r=this,i=0;i<r.length;i++)n=t(n,r[i],i,r);return n}),"reduce"),max:s((function(t,e){for(var n,r=-1/0,i=this,a=0;a<i.length;a++){var s=i[a],o=e?t.apply(e,[s,a,i]):t(s,a,i);o>r&&(r=o,n=s)}return{value:r,ele:n}}),"max"),min:s((function(t,e){for(var n,r=1/0,i=this,a=0;a<i.length;a++){var s=i[a],o=e?t.apply(e,[s,a,i]):t(s,a,i);o<r&&(r=o,n=s)}return{value:r,ele:n}}),"min")},lkt=okt;lkt.u=lkt["|"]=lkt["+"]=lkt.union=lkt.or=lkt.add,lkt["\\"]=lkt["!"]=lkt["-"]=lkt.difference=lkt.relativeComplement=lkt.subtract=lkt.not,lkt.n=lkt["&"]=lkt["."]=lkt.and=lkt.intersection=lkt.intersect,lkt["^"]=lkt["(+)"]=lkt["(-)"]=lkt.symmetricDifference=lkt.symdiff=lkt.xor,lkt.fnFilter=lkt.filterFn=lkt.stdFilter=lkt.filter,lkt.complement=lkt.abscomp=lkt.absoluteComplement;var ckt={isNode:s((function(){return"nodes"===this.group()}),"isNode"),isEdge:s((function(){return"edges"===this.group()}),"isEdge"),isLoop:s((function(){return this.isEdge()&&this.source()[0]===this.target()[0]}),"isLoop"),isSimple:s((function(){return this.isEdge()&&this.source()[0]!==this.target()[0]}),"isSimple"),group:s((function(){var t=this[0];if(t)return t._private.group}),"group")},hkt=s((function(t,e){var n=t.cy().hasCompoundNodes();function r(t){var e=t.pstyle("z-compound-depth");return"auto"===e.value?n?t.zDepth():0:"bottom"===e.value?-1:"top"===e.value?Sgt:0}s(r,"getDepth");var i=r(t)-r(e);if(0!==i)return i;function a(t){return"auto"===t.pstyle("z-index-compare").value&&t.isNode()?1:0}s(a,"getEleDepth");var o=a(t)-a(e);if(0!==o)return o;var l=t.pstyle("z-index").value-e.pstyle("z-index").value;return 0!==l?l:t.poolIndex()-e.poolIndex()}),"zIndexSort"),ukt={forEach:s((function(t,e){if(zdt(t))for(var n=this.length,r=0;r<n;r++){var i=this[r];if(!1===(e?t.apply(e,[i,r,this]):t(i,r,this)))break}return this}),"forEach"),toArray:s((function(){for(var t=[],e=0;e<this.length;e++)t.push(this[e]);return t}),"toArray"),slice:s((function(t,e){var n=[],r=this.length;null==e&&(e=r),null==t&&(t=0),t<0&&(t=r+t),e<0&&(e=r+e);for(var i=t;i>=0&&i<e&&i<r;i++)n.push(this[i]);return this.spawn(n)}),"slice"),size:s((function(){return this.length}),"size"),eq:s((function(t){return this[t]||this.spawn()}),"eq"),first:s((function(){return this[0]||this.spawn()}),"first"),last:s((function(){return this[this.length-1]||this.spawn()}),"last"),empty:s((function(){return 0===this.length}),"empty"),nonempty:s((function(){return!this.empty()}),"nonempty"),sort:s((function(t){if(!zdt(t))return this;var e=this.toArray().sort(t);return this.spawn(e)}),"sort"),sortByZIndex:s((function(){return this.sort(hkt)}),"sortByZIndex"),zDepth:s((function(){var t=this[0];if(t){var e=t._private;if("nodes"===e.group){var n=e.data.parent?t.parents().size():0;return t.isParent()?n:Sgt-1}var r=e.source,i=e.target,a=r.zDepth(),s=i.zDepth();return Math.max(a,s,0)}}),"zDepth")};ukt.each=ukt.forEach;var dkt=s((function(){var t="undefined";("undefined"==typeof Symbol?"undefined":bdt(Symbol))!=t&&bdt(Symbol.iterator)!=t&&(ukt[Symbol.iterator]=function(){var t=this,e={value:void 0,done:!1},n=0,r=this.length;return _dt({next:s((function(){return n<r?e.value=t[n++]:(e.value=void 0,e.done=!0),e}),"next")},Symbol.iterator,(function(){return this}))})}),"defineSymbolIterator");dkt();var pkt=Ugt({nodeDimensionsIncludeLabels:!1}),gkt={layoutDimensions:s((function(t){var e;if(t=pkt(t),this.takesUpSpace())if(t.nodeDimensionsIncludeLabels){var n=this.boundingBox();e={w:n.w,h:n.h}}else e={w:this.outerWidth(),h:this.outerHeight()};else e={w:0,h:0};return 0!==e.w&&0!==e.h||(e.w=e.h=1),e}),"layoutDimensions"),layoutPositions:s((function(t,e,n){var r=this.nodes().filter((function(t){return!t.isParent()})),i=this.cy(),a=e.eles,o=s((function(t){return t.id()}),"getMemoizeKey"),l=ipt(n,o);t.emit({type:"layoutstart",layout:t}),t.animations=[];var c=s((function(t,e,n){var r=e.x1+e.w/2,i=e.y1+e.h/2;return{x:r+(n.x-r)*t,y:i+(n.y-i)*t}}),"calculateSpacing"),h=e.spacingFactor&&1!==e.spacingFactor,u=s((function(){if(!h)return null;for(var t=Rft(),e=0;e<r.length;e++){var n=r[e],i=l(n,e);$ft(t,i.x,i.y)}return t}),"spacingBb")(),d=ipt((function(t,n){var r=l(t,n);if(h){var i=Math.abs(e.spacingFactor);r=c(i,u,r)}return null!=e.transform&&(r=e.transform(t,r)),r}),o);if(e.animate){for(var p=0;p<r.length;p++){var g=r[p],f=d(g,p);if(null==e.animateFilter||e.animateFilter(g,p)){var m=g.animation({position:f,duration:e.animationDuration,easing:e.animationEasing});t.animations.push(m)}else g.position(f)}if(e.fit){var y=i.animation({fit:{boundingBox:a.boundingBoxAt(d),padding:e.padding},duration:e.animationDuration,easing:e.animationEasing});t.animations.push(y)}else if(void 0!==e.zoom&&void 0!==e.pan){var v=i.animation({zoom:e.zoom,pan:e.pan,duration:e.animationDuration,easing:e.animationEasing});t.animations.push(v)}t.animations.forEach((function(t){return t.play()})),t.one("layoutready",e.ready),t.emit({type:"layoutready",layout:t}),Yyt.all(t.animations.map((function(t){return t.promise()}))).then((function(){t.one("layoutstop",e.stop),t.emit({type:"layoutstop",layout:t})}))}else r.positions(d),e.fit&&i.fit(e.eles,e.padding),null!=e.zoom&&i.zoom(e.zoom),e.pan&&i.pan(e.pan),t.one("layoutready",e.ready),t.emit({type:"layoutready",layout:t}),t.one("layoutstop",e.stop),t.emit({type:"layoutstop",layout:t});return this}),"layoutPositions"),layout:s((function(t){return this.cy().makeLayout(dpt({},t,{eles:this}))}),"layout")};function fkt(t,e,n){var r,i=n._private,a=i.styleCache=i.styleCache||[];return null!=(r=a[t])?r:r=a[t]=e(n)}function mkt(t,e){return t=wgt(t),s((function(n){return fkt(t,e,n)}),"cachedStyleFunction")}function ykt(t,e){t=wgt(t);var n=s((function(t){return e.call(t)}),"selfFn");return s((function(){var e=this[0];if(e)return fkt(t,n,e)}),"cachedPrototypeStyleFunction")}gkt.createLayout=gkt.makeLayout=gkt.layout,s(fkt,"styleCache"),s(mkt,"cacheStyleFunction"),s(ykt,"cachePrototypeStyleFunction");var vkt={recalculateRenderedStyle:s((function(t){var e=this.cy(),n=e.renderer(),r=e.styleEnabled();return n&&r&&n.recalculateRenderedStyle(this,t),this}),"recalculateRenderedStyle"),dirtyStyleCache:s((function(){var t,e=this.cy(),n=s((function(t){return t._private.styleCache=null}),"dirty");e.hasCompoundNodes()?((t=this.spawnSelf().merge(this.descendants()).merge(this.parents())).merge(t.connectedEdges()),t.forEach(n)):this.forEach((function(t){n(t),t.connectedEdges().forEach(n)}));return this}),"dirtyStyleCache"),updateStyle:s((function(t){var e=this._private.cy;if(!e.styleEnabled())return this;if(e.batching())return e._private.batchStyleEles.merge(this),this;var n=this;t=!(!t&&void 0!==t),e.hasCompoundNodes()&&(n=this.spawnSelf().merge(this.descendants()).merge(this.parents()));var r=n;return t?r.emitAndNotify("style"):r.emit("style"),n.forEach((function(t){return t._private.styleDirty=!0})),this}),"updateStyle"),cleanStyle:s((function(){var t=this.cy();if(t.styleEnabled())for(var e=0;e<this.length;e++){var n=this[e];n._private.styleDirty&&(n._private.styleDirty=!1,t.style().apply(n))}}),"cleanStyle"),parsedStyle:s((function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this[0],r=n.cy();if(r.styleEnabled()&&n){this.cleanStyle();var i=n._private.style[t];return null!=i?i:e?r.style().getDefaultProperty(t):null}}),"parsedStyle"),numericStyle:s((function(t){var e=this[0];if(e.cy().styleEnabled()&&e){var n=e.pstyle(t);return void 0!==n.pfValue?n.pfValue:n.value}}),"numericStyle"),numericStyleUnits:s((function(t){var e=this[0];if(e.cy().styleEnabled())return e?e.pstyle(t).units:void 0}),"numericStyleUnits"),renderedStyle:s((function(t){var e=this.cy();if(!e.styleEnabled())return this;var n=this[0];return n?e.style().getRenderedStyle(n,t):void 0}),"renderedStyle"),style:s((function(t,e){var n=this.cy();if(!n.styleEnabled())return this;var r=n.style();if(Gdt(t)){var i=t;r.applyBypass(this,i,false),this.emitAndNotify("style")}else if(Fdt(t)){if(void 0===e){var a=this[0];return a?r.getStylePropertyValue(a,t):void 0}r.applyBypass(this,t,e,false),this.emitAndNotify("style")}else if(void 0===t){var s=this[0];return s?r.getRawStyle(s):void 0}return this}),"style"),removeStyle:s((function(t){var e=this.cy();if(!e.styleEnabled())return this;var n=e.style(),r=this;if(void 0===t)for(var i=0;i<r.length;i++){var a=r[i];n.removeAllBypasses(a,false)}else{t=t.split(/\s+/);for(var s=0;s<r.length;s++){var o=r[s];n.removeBypasses(o,t,false)}}return this.emitAndNotify("style"),this}),"removeStyle"),show:s((function(){return this.css("display","element"),this}),"show"),hide:s((function(){return this.css("display","none"),this}),"hide"),effectiveOpacity:s((function(){var t=this.cy();if(!t.styleEnabled())return 1;var e=t.hasCompoundNodes(),n=this[0];if(n){var r=n._private,i=n.pstyle("opacity").value;if(!e)return i;var a=r.data.parent?n.parents():null;if(a)for(var s=0;s<a.length;s++){i*=a[s].pstyle("opacity").value}return i}}),"effectiveOpacity"),transparent:s((function(){if(!this.cy().styleEnabled())return!1;var t=this[0],e=t.cy().hasCompoundNodes();return t?e?0===t.effectiveOpacity():0===t.pstyle("opacity").value:void 0}),"transparent"),backgrounding:s((function(){return!!this.cy().styleEnabled()&&!!this[0]._private.backgrounding}),"backgrounding")};function xkt(t,e){var n=t._private.data.parent?t.parents():null;if(n)for(var r=0;r<n.length;r++){if(!e(n[r]))return!1}return!0}function bkt(t){var e=t.ok,n=t.edgeOkViaNode||t.ok,r=t.parentOk||t.ok;return function(){var t=this.cy();if(!t.styleEnabled())return!0;var i=this[0],a=t.hasCompoundNodes();if(i){var s=i._private;if(!e(i))return!1;if(i.isNode())return!a||xkt(i,r);var o=s.source,l=s.target;return n(o)&&(!a||xkt(o,n))&&(o===l||n(l)&&(!a||xkt(l,n)))}}}s(xkt,"checkCompound"),s(bkt,"defineDerivedStateFunction");var wkt=mkt("eleTakesUpSpace",(function(t){return"element"===t.pstyle("display").value&&0!==t.width()&&(!t.isNode()||0!==t.height())}));vkt.takesUpSpace=ykt("takesUpSpace",bkt({ok:wkt}));var kkt=mkt("eleInteractive",(function(t){return"yes"===t.pstyle("events").value&&"visible"===t.pstyle("visibility").value&&wkt(t)})),Tkt=mkt("parentInteractive",(function(t){return"visible"===t.pstyle("visibility").value&&wkt(t)}));vkt.interactive=ykt("interactive",bkt({ok:kkt,parentOk:Tkt,edgeOkViaNode:wkt})),vkt.noninteractive=function(){var t=this[0];if(t)return!t.interactive()};var _kt=mkt("eleVisible",(function(t){return"visible"===t.pstyle("visibility").value&&0!==t.pstyle("opacity").pfValue&&wkt(t)})),Ekt=wkt;vkt.visible=ykt("visible",bkt({ok:_kt,edgeOkViaNode:Ekt})),vkt.hidden=function(){var t=this[0];if(t)return!t.visible()},vkt.isBundledBezier=ykt("isBundledBezier",(function(){return!!this.cy().styleEnabled()&&(!this.removed()&&"bezier"===this.pstyle("curve-style").value&&this.takesUpSpace())})),vkt.bypass=vkt.css=vkt.style,vkt.renderedCss=vkt.renderedStyle,vkt.removeBypass=vkt.removeCss=vkt.removeStyle,vkt.pstyle=vkt.parsedStyle;var Ckt={};function Skt(t){return function(){var e=arguments,n=[];if(2===e.length){var r=e[0],i=e[1];this.on(t.event,r,i)}else if(1===e.length&&zdt(e[0])){var a=e[0];this.on(t.event,a)}else if(0===e.length||1===e.length&&Udt(e[0])){for(var s=1===e.length?e[0]:null,o=0;o<this.length;o++){var l=this[o],c=!t.ableField||l._private[t.ableField],h=l._private[t.field]!=t.value;if(t.overrideAble){var u=t.overrideAble(l);if(void 0!==u&&(c=u,!u))return this}c&&(l._private[t.field]=t.value,h&&n.push(l))}var d=this.spawn(n);d.updateStyle(),d.emit(t.event),s&&d.emit(s)}return this}}function Akt(t){Ckt[t.field]=function(){var e=this[0];if(e){if(t.overrideField){var n=t.overrideField(e);if(void 0!==n)return n}return e._private[t.field]}},Ckt[t.on]=Skt({event:t.on,field:t.field,ableField:t.ableField,overrideAble:t.overrideAble,value:!0}),Ckt[t.off]=Skt({event:t.off,field:t.field,ableField:t.ableField,overrideAble:t.overrideAble,value:!1})}s(Skt,"defineSwitchFunction"),s(Akt,"defineSwitchSet"),Akt({field:"locked",overrideField:s((function(t){return!!t.cy().autolock()||void 0}),"overrideField"),on:"lock",off:"unlock"}),Akt({field:"grabbable",overrideField:s((function(t){return!t.cy().autoungrabify()&&!t.pannable()&&void 0}),"overrideField"),on:"grabify",off:"ungrabify"}),Akt({field:"selected",ableField:"selectable",overrideAble:s((function(t){return!t.cy().autounselectify()&&void 0}),"overrideAble"),on:"select",off:"unselect"}),Akt({field:"selectable",overrideField:s((function(t){return!t.cy().autounselectify()&&void 0}),"overrideField"),on:"selectify",off:"unselectify"}),Ckt.deselect=Ckt.unselect,Ckt.grabbed=function(){var t=this[0];if(t)return t._private.grabbed},Akt({field:"active",on:"activate",off:"unactivate"}),Akt({field:"pannable",on:"panify",off:"unpanify"}),Ckt.inactive=function(){var t=this[0];if(t)return!t._private.active};var Lkt={},Nkt=s((function(t){return s((function(e){for(var n=[],r=0;r<this.length;r++){var i=this[r];if(i.isNode()){for(var a=!1,s=i.connectedEdges(),o=0;o<s.length;o++){var l=s[o],c=l.source(),h=l.target();if(t.noIncomingEdges&&h===i&&c!==i||t.noOutgoingEdges&&c===i&&h!==i){a=!0;break}}a||n.push(i)}}return this.spawn(n,!0).filter(e)}),"dagExtremityImpl")}),"defineDagExtremity"),Ikt=s((function(t){return function(e){for(var n=[],r=0;r<this.length;r++){var i=this[r];if(i.isNode())for(var a=i.connectedEdges(),s=0;s<a.length;s++){var o=a[s],l=o.source(),c=o.target();t.outgoing&&l===i?(n.push(o),n.push(c)):t.incoming&&c===i&&(n.push(o),n.push(l))}}return this.spawn(n,!0).filter(e)}}),"defineDagOneHop"),Mkt=s((function(t){return function(e){for(var n=this,r=[],i={};;){var a=t.outgoing?n.outgoers():n.incomers();if(0===a.length)break;for(var s=!1,o=0;o<a.length;o++){var l=a[o],c=l.id();i[c]||(i[c]=!0,r.push(l),s=!0)}if(!s)break;n=a}return this.spawn(r,!0).filter(e)}}),"defineDagAllHops");function Rkt(t){return s((function(e){for(var n=[],r=0;r<this.length;r++){var i=this[r]._private[t.attr];i&&n.push(i)}return this.spawn(n,!0).filter(e)}),"sourceImpl")}function Dkt(t){return s((function(e){var n=[],r=this._private.cy,i=t||{};Fdt(e)&&(e=r.$(e));for(var a=0;a<e.length;a++)for(var s=e[a]._private.edges,o=0;o<s.length;o++){var l=s[o],c=l._private.data,h=this.hasElementWithId(c.source)&&e.hasElementWithId(c.target),u=e.hasElementWithId(c.source)&&this.hasElementWithId(c.target);if(h||u){if(i.thisIsSrc||i.thisIsTgt){if(i.thisIsSrc&&!h)continue;if(i.thisIsTgt&&!u)continue}n.push(l)}}return this.spawn(n,!0)}),"edgesWithImpl")}function Okt(t){return t=dpt({},{codirected:!1},t),s((function(e){for(var n=[],r=this.edges(),i=t,a=0;a<r.length;a++)for(var s=r[a]._private,o=s.source,l=o._private.data.id,c=s.data.target,h=o._private.edges,u=0;u<h.length;u++){var d=h[u],p=d._private.data,g=p.target,f=p.source,m=g===c&&f===l,y=l===g&&c===f;(i.codirected&&m||!i.codirected&&(m||y))&&n.push(d)}return this.spawn(n,!0).filter(e)}),"parallelEdgesImpl")}Lkt.clearTraversalCache=function(){for(var t=0;t<this.length;t++)this[t]._private.traversalCache=null},dpt(Lkt,{roots:Nkt({noIncomingEdges:!0}),leaves:Nkt({noOutgoingEdges:!0}),outgoers:rwt(Ikt({outgoing:!0}),"outgoers"),successors:Mkt({outgoing:!0}),incomers:rwt(Ikt({incoming:!0}),"incomers"),predecessors:Mkt({incoming:!0})}),dpt(Lkt,{neighborhood:rwt((function(t){for(var e=[],n=this.nodes(),r=0;r<n.length;r++)for(var i=n[r],a=i.connectedEdges(),s=0;s<a.length;s++){var o=a[s],l=o.source(),c=o.target(),h=i===l?c:l;h.length>0&&e.push(h[0]),e.push(o[0])}return this.spawn(e,!0).filter(t)}),"neighborhood"),closedNeighborhood:s((function(t){return this.neighborhood().add(this).filter(t)}),"closedNeighborhood"),openNeighborhood:s((function(t){return this.neighborhood(t)}),"openNeighborhood")}),Lkt.neighbourhood=Lkt.neighborhood,Lkt.closedNeighbourhood=Lkt.closedNeighborhood,Lkt.openNeighbourhood=Lkt.openNeighborhood,dpt(Lkt,{source:rwt(s((function(t){var e,n=this[0];return n&&(e=n._private.source||n.cy().collection()),e&&t?e.filter(t):e}),"sourceImpl"),"source"),target:rwt(s((function(t){var e,n=this[0];return n&&(e=n._private.target||n.cy().collection()),e&&t?e.filter(t):e}),"targetImpl"),"target"),sources:Rkt({attr:"source"}),targets:Rkt({attr:"target"})}),s(Rkt,"defineSourceFunction"),dpt(Lkt,{edgesWith:rwt(Dkt(),"edgesWith"),edgesTo:rwt(Dkt({thisIsSrc:!0}),"edgesTo")}),s(Dkt,"defineEdgesWithFunction"),dpt(Lkt,{connectedEdges:rwt((function(t){for(var e=[],n=0;n<this.length;n++){var r=this[n];if(r.isNode())for(var i=r._private.edges,a=0;a<i.length;a++){var s=i[a];e.push(s)}}return this.spawn(e,!0).filter(t)}),"connectedEdges"),connectedNodes:rwt((function(t){for(var e=[],n=0;n<this.length;n++){var r=this[n];r.isEdge()&&(e.push(r.source()[0]),e.push(r.target()[0]))}return this.spawn(e,!0).filter(t)}),"connectedNodes"),parallelEdges:rwt(Okt(),"parallelEdges"),codirectedEdges:rwt(Okt({codirected:!0}),"codirectedEdges")}),s(Okt,"defineParallelEdgesFunction"),dpt(Lkt,{components:s((function(t){var e=this,n=e.cy(),r=n.collection(),i=null==t?e.nodes():t.nodes(),a=[];null!=t&&i.empty()&&(i=t.sources());var o=s((function(t,e){r.merge(t),i.unmerge(t),e.merge(t)}),"visitInComponent");if(i.empty())return e.spawn();var l=s((function(){var t=n.collection();a.push(t);var r=i[0];o(r,t),e.bfs({directed:!1,roots:r,visit:s((function(e){return o(e,t)}),"visit")}),t.forEach((function(n){n.connectedEdges().forEach((function(n){e.has(n)&&t.has(n.source())&&t.has(n.target())&&t.merge(n)}))}))}),"_loop");do{l()}while(i.length>0);return a}),"components"),component:s((function(){var t=this[0];return t.cy().mutableElements().components(t)[0]}),"component")}),Lkt.componentsOf=Lkt.components;var Pkt=s((function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(void 0!==t){var i=new Hgt,a=!1;if(e){if(e.length>0&&Gdt(e[0])&&!Vdt(e[0])){a=!0;for(var o=[],l=new Xgt,c=0,h=e.length;c<h;c++){var u=e[c];null==u.data&&(u.data={});var d=u.data;if(null==d.id)d.id=$gt();else if(t.hasElementWithId(d.id)||l.has(d.id))continue;var p=new Kgt(t,u,!1);o.push(p),l.add(d.id)}e=o}}else e=[];this.length=0;for(var g=0,f=e.length;g<f;g++){var m=e[g][0];if(null!=m){var y=m._private.data.id;n&&i.has(y)||(n&&i.set(y,{index:this.length,ele:m}),this[this.length]=m,this.length++)}}this._private={eles:this,cy:t,get map(){return null==this.lazyMap&&this.rebuildMap(),this.lazyMap},set map(t){this.lazyMap=t},rebuildMap:s((function(){for(var t=this.lazyMap=new Hgt,e=this.eles,n=0;n<e.length;n++){var r=e[n];t.set(r.id(),{index:n,ele:r})}}),"rebuildMap")},n&&(this._private.map=i),a&&!r&&this.restore()}else Mgt("A collection must have a reference to the core")}),"Collection"),Bkt=Kgt.prototype=Pkt.prototype=Object.create(Array.prototype);Bkt.instanceString=function(){return"collection"},Bkt.spawn=function(t,e){return new Pkt(this.cy(),t,e)},Bkt.spawnSelf=function(){return this.spawn(this)},Bkt.cy=function(){return this._private.cy},Bkt.renderer=function(){return this._private.cy.renderer()},Bkt.element=function(){return this[0]},Bkt.collection=function(){return Xdt(this)?this:new Pkt(this._private.cy,[this])},Bkt.unique=function(){return new Pkt(this._private.cy,this,!0)},Bkt.hasElementWithId=function(t){return t=""+t,this._private.map.has(t)},Bkt.getElementById=function(t){t=""+t;var e=this._private.cy,n=this._private.map.get(t);return n?n.ele:new Pkt(e)},Bkt.$id=Bkt.getElementById,Bkt.poolIndex=function(){var t=this._private.cy._private.elements,e=this[0]._private.data.id;return t._private.map.get(e).index},Bkt.indexOf=function(t){var e=t[0]._private.data.id;return this._private.map.get(e).index},Bkt.indexOfId=function(t){return t=""+t,this._private.map.get(t).index},Bkt.json=function(t){var e=this.element(),n=this.cy();if(null==e&&t)return this;if(null!=e){var r=e._private;if(Gdt(t)){if(n.startBatch(),t.data){e.data(t.data);var i=r.data;if(e.isEdge()){var a=!1,o={},l=t.data.source,c=t.data.target;null!=l&&l!=i.source&&(o.source=""+l,a=!0),null!=c&&c!=i.target&&(o.target=""+c,a=!0),a&&(e=e.move(o))}else{var h="parent"in t.data,u=t.data.parent;!h||null==u&&null==i.parent||u==i.parent||(void 0===u&&(u=null),null!=u&&(u=""+u),e=e.move({parent:u}))}}t.position&&e.position(t.position);var d=s((function(n,i,a){var s=t[n];null!=s&&s!==r[n]&&(s?e[i]():e[a]())}),"checkSwitch");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"),null!=t.classes&&e.classes(t.classes),n.endBatch(),this}if(void 0===t){var p={data:Pgt(r.data),position:Pgt(r.position),group:r.group,removed:r.removed,selected:r.selected,selectable:r.selectable,locked:r.locked,grabbable:r.grabbable,pannable:r.pannable,classes:null};p.classes="";var g=0;return r.classes.forEach((function(t){return p.classes+=0==g++?t:" "+t})),p}}},Bkt.jsons=function(){for(var t=[],e=0;e<this.length;e++){var n=this[e].json();t.push(n)}return t},Bkt.clone=function(){for(var t=this.cy(),e=[],n=0;n<this.length;n++){var r=this[n].json(),i=new Kgt(t,r,!1);e.push(i)}return new Pkt(t,e)},Bkt.copy=Bkt.clone,Bkt.restore=function(){for(var t,e,n=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=this,a=i.cy(),o=a._private,l=[],c=[],h=0,u=i.length;h<u;h++){var d=i[h];r&&!d.removed()||(d.isNode()?l.push(d):c.push(d))}t=l.concat(c);var p=s((function(){t.splice(e,1),e--}),"removeFromElements");for(e=0;e<t.length;e++){var g=t[e],f=g._private,m=f.data;if(g.clearTraversalCache(),r||f.removed)if(void 0===m.id)m.id=$gt();else if(jdt(m.id))m.id=""+m.id;else{if(Jdt(m.id)||!Fdt(m.id)){Mgt("Can not create element with invalid string ID `"+m.id+"`"),p();continue}if(a.hasElementWithId(m.id)){Mgt("Can not create second element with ID `"+m.id+"`"),p();continue}}else;var y=m.id;if(g.isNode()){var v=f.position;null==v.x&&(v.x=0),null==v.y&&(v.y=0)}if(g.isEdge()){for(var x=g,b=["source","target"],w=b.length,k=!1,T=0;T<w;T++){var _=b[T],E=m[_];jdt(E)&&(E=m[_]=""+m[_]),null==E||""===E?(Mgt("Can not create edge `"+y+"` with unspecified "+_),k=!0):a.hasElementWithId(E)||(Mgt("Can not create edge `"+y+"` with nonexistant "+_+" `"+E+"`"),k=!0)}if(k){p();continue}var C=a.getElementById(m.source),S=a.getElementById(m.target);C.same(S)?C._private.edges.push(x):(C._private.edges.push(x),S._private.edges.push(x)),x._private.source=C,x._private.target=S}f.map=new Hgt,f.map.set(y,{ele:g,index:0}),f.removed=!1,r&&a.addToPool(g)}for(var A=0;A<l.length;A++){var L=l[A],N=L._private.data;jdt(N.parent)&&(N.parent=""+N.parent);var I=N.parent,M=null!=I;if(M||L._private.parent){var R=L._private.parent?a.collection().merge(L._private.parent):a.getElementById(I);if(R.empty())N.parent=void 0;else if(R[0].removed())Dgt("Node added with missing parent, reference to parent removed"),N.parent=void 0,L._private.parent=null;else{for(var D=!1,O=R;!O.empty();){if(L.same(O)){D=!0,N.parent=void 0;break}O=O.parent()}D||(R[0]._private.children.push(L),L._private.parent=R[0],o.hasCompoundNodes=!0)}}}if(t.length>0){for(var P=t.length===i.length?i:new Pkt(a,t),B=0;B<P.length;B++){var $=P[B];$.isNode()||($.parallelEdges().clearTraversalCache(),$.source().clearTraversalCache(),$.target().clearTraversalCache())}(o.hasCompoundNodes?a.collection().merge(P).merge(P.connectedNodes()).merge(P.parent()):P).dirtyCompoundBoundsCache().dirtyBoundingBoxCache().updateStyle(n),n?P.emitAndNotify("add"):r&&P.emit("add")}return i},Bkt.removed=function(){var t=this[0];return t&&t._private.removed},Bkt.inside=function(){var t=this[0];return t&&!t._private.removed},Bkt.remove=function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this,r=[],i={},a=n._private.cy;function o(t){for(var e=t._private.edges,n=0;n<e.length;n++)c(e[n])}function l(t){for(var e=t._private.children,n=0;n<e.length;n++)c(e[n])}function c(t){var n=i[t.id()];e&&t.removed()||n||(i[t.id()]=!0,t.isNode()?(r.push(t),o(t),l(t)):r.unshift(t))}s(o,"addConnectedEdges"),s(l,"addChildren"),s(c,"add");for(var h=0,u=n.length;h<u;h++){var d=n[h];c(d)}function p(t,e){var n=t._private.edges;Ggt(n,e),t.clearTraversalCache()}function g(t){t.clearTraversalCache()}s(p,"removeEdgeRef"),s(g,"removeParallelRef");var f=[];function m(t,e){e=e[0];var n=(t=t[0])._private.children,r=t.id();Ggt(n,e),e._private.parent=null,f.ids[r]||(f.ids[r]=!0,f.push(t))}f.ids={},s(m,"removeChildRef"),n.dirtyCompoundBoundsCache(),e&&a.removeFromPool(r);for(var y=0;y<r.length;y++){var v=r[y];if(v.isEdge()){var x=v.source()[0],b=v.target()[0];p(x,v),p(b,v);for(var w=v.parallelEdges(),k=0;k<w.length;k++){var T=w[k];g(T),T.isBundledBezier()&&T.dirtyBoundingBoxCache()}}else{var _=v.parent();0!==_.length&&m(_,v)}e&&(v._private.removed=!0)}var E=a._private.elements;a._private.hasCompoundNodes=!1;for(var C=0;C<E.length;C++){var S=E[C];if(S.isParent()){a._private.hasCompoundNodes=!0;break}}var A=new Pkt(this.cy(),r);A.size()>0&&(t?A.emitAndNotify("remove"):e&&A.emit("remove"));for(var L=0;L<f.length;L++){var N=f[L];e&&N.removed()||N.updateStyle()}return A},Bkt.move=function(t){var e=this._private.cy,n=this,r=!1,i=!1,a=s((function(t){return null==t?t:""+t}),"toString");if(void 0!==t.source||void 0!==t.target){var o=a(t.source),l=a(t.target),c=null!=o&&e.hasElementWithId(o),h=null!=l&&e.hasElementWithId(l);(c||h)&&(e.batch((function(){n.remove(r,i),n.emitAndNotify("moveout");for(var t=0;t<n.length;t++){var e=n[t],a=e._private.data;e.isEdge()&&(c&&(a.source=o),h&&(a.target=l))}n.restore(r,i)})),n.emitAndNotify("move"))}else if(void 0!==t.parent){var u=a(t.parent);if(null===u||e.hasElementWithId(u)){var d=null===u?void 0:u;e.batch((function(){var t=n.remove(r,i);t.emitAndNotify("moveout");for(var e=0;e<n.length;e++){var a=n[e],s=a._private.data;a.isNode()&&(s.parent=d)}t.restore(r,i)})),n.emitAndNotify("move")}}return this},[$yt,abt,sbt,twt,iwt,uwt,dwt,Ywt,skt,okt,ckt,ukt,gkt,vkt,Ckt,Lkt].forEach((function(t){dpt(Bkt,t)}));var $kt={add:s((function(t){var e,n=this;if(Hdt(t)){var r=t;if(r._private.cy===n)e=r.restore();else{for(var i=[],a=0;a<r.length;a++){var s=r[a];i.push(s.json())}e=new Pkt(n,i)}}else if(Udt(t)){e=new Pkt(n,t)}else if(Gdt(t)&&(Udt(t.nodes)||Udt(t.edges))){for(var o=t,l=[],c=["nodes","edges"],h=0,u=c.length;h<u;h++){var d=c[h],p=o[d];if(Udt(p))for(var g=0,f=p.length;g<f;g++){var m=dpt({group:d},p[g]);l.push(m)}}e=new Pkt(n,l)}else{e=new Kgt(n,t).collection()}return e}),"add"),remove:s((function(t){if(Hdt(t));else if(Fdt(t)){var e=t;t=this.$(e)}return t.remove()}),"remove")};function Fkt(t,e,n,r){var i=4,a=.001,o=1e-7,l=10,c=11,h=1/(c-1),u="undefined"!=typeof Float32Array;if(4!==arguments.length)return!1;for(var d=0;d<4;++d)if("number"!=typeof arguments[d]||isNaN(arguments[d])||!isFinite(arguments[d]))return!1;t=Math.min(t,1),n=Math.min(n,1),t=Math.max(t,0),n=Math.max(n,0);var p=u?new Float32Array(c):new Array(c);function g(t,e){return 1-3*e+3*t}function f(t,e){return 3*e-6*t}function m(t){return 3*t}function y(t,e,n){return((g(e,n)*t+f(e,n))*t+m(e))*t}function v(t,e,n){return 3*g(e,n)*t*t+2*f(e,n)*t+m(e)}function x(e,r){for(var a=0;a<i;++a){var s=v(r,t,n);if(0===s)return r;r-=(y(r,t,n)-e)/s}return r}function b(){for(var e=0;e<c;++e)p[e]=y(e*h,t,n)}function w(e,r,i){var a,s,c=0;do{(a=y(s=r+(i-r)/2,t,n)-e)>0?i=s:r=s}while(Math.abs(a)>o&&++c<l);return s}function k(e){for(var r=0,i=1,s=c-1;i!==s&&p[i]<=e;++i)r+=h;--i;var o=r+(e-p[i])/(p[i+1]-p[i])*h,l=v(o,t,n);return l>=a?x(e,o):0===l?o:w(e,r,r+h)}s(g,"A"),s(f,"B"),s(m,"C"),s(y,"calcBezier"),s(v,"getSlope"),s(x,"newtonRaphsonIterate"),s(b,"calcSampleValues"),s(w,"binarySubdivide"),s(k,"getTForX");var T=!1;function _(){T=!0,t===e&&n===r||b()}s(_,"precompute");var E=s((function(i){return T||_(),t===e&&n===r?i:0===i?0:1===i?1:y(k(i),e,r)}),"f");E.getControlPoints=function(){return[{x:t,y:e},{x:n,y:r}]};var C="generateBezier("+[t,e,n,r]+")";return E.toString=function(){return C},E}s(Fkt,"generateCubicBezier");var zkt=function(){function t(t){return-t.tension*t.x-t.friction*t.v}function e(e,n,r){var i={x:e.x+r.dx*n,v:e.v+r.dv*n,tension:e.tension,friction:e.friction};return{dx:i.v,dv:t(i)}}function n(n,r){var i={dx:n.v,dv:t(n)},a=e(n,.5*r,i),s=e(n,.5*r,a),o=e(n,r,s),l=1/6*(i.dx+2*(a.dx+s.dx)+o.dx),c=1/6*(i.dv+2*(a.dv+s.dv)+o.dv);return n.x=n.x+l*r,n.v=n.v+c*r,n}return s(t,"springAccelerationForState"),s(e,"springEvaluateStateWithDerivative"),s(n,"springIntegrateState"),s((function t(e,r,i){var a,s,o,l={x:-1,v:0,tension:null,friction:null},c=[0],h=0,u=1e-4;for(e=parseFloat(e)||500,r=parseFloat(r)||20,i=i||null,l.tension=e,l.friction=r,s=(a=null!==i)?(h=t(e,r))/i*.016:.016;o=n(o||l,s),c.push(1+o.x),h+=16,Math.abs(o.x)>u&&Math.abs(o.v)>u;);return a?function(t){return c[t*(c.length-1)|0]}:h}),"springRK4Factory")}(),Ukt=s((function(t,e,n,r){var i=Fkt(t,e,n,r);return function(t,e,n){return t+(e-t)*i(n)}}),"cubicBezier"),Gkt={linear:s((function(t,e,n){return t+(e-t)*n}),"linear"),ease:Ukt(.25,.1,.25,1),"ease-in":Ukt(.42,0,1,1),"ease-out":Ukt(0,0,.58,1),"ease-in-out":Ukt(.42,0,.58,1),"ease-in-sine":Ukt(.47,0,.745,.715),"ease-out-sine":Ukt(.39,.575,.565,1),"ease-in-out-sine":Ukt(.445,.05,.55,.95),"ease-in-quad":Ukt(.55,.085,.68,.53),"ease-out-quad":Ukt(.25,.46,.45,.94),"ease-in-out-quad":Ukt(.455,.03,.515,.955),"ease-in-cubic":Ukt(.55,.055,.675,.19),"ease-out-cubic":Ukt(.215,.61,.355,1),"ease-in-out-cubic":Ukt(.645,.045,.355,1),"ease-in-quart":Ukt(.895,.03,.685,.22),"ease-out-quart":Ukt(.165,.84,.44,1),"ease-in-out-quart":Ukt(.77,0,.175,1),"ease-in-quint":Ukt(.755,.05,.855,.06),"ease-out-quint":Ukt(.23,1,.32,1),"ease-in-out-quint":Ukt(.86,0,.07,1),"ease-in-expo":Ukt(.95,.05,.795,.035),"ease-out-expo":Ukt(.19,1,.22,1),"ease-in-out-expo":Ukt(1,0,0,1),"ease-in-circ":Ukt(.6,.04,.98,.335),"ease-out-circ":Ukt(.075,.82,.165,1),"ease-in-out-circ":Ukt(.785,.135,.15,.86),spring:s((function(t,e,n){if(0===n)return Gkt.linear;var r=zkt(t,e,n);return function(t,e,n){return t+(e-t)*r(n)}}),"spring"),"cubic-bezier":Ukt};function qkt(t,e,n,r,i){if(1===r)return n;if(e===n)return n;var a=i(e,n,r);return null==t||((t.roundValue||t.color)&&(a=Math.round(a)),void 0!==t.min&&(a=Math.max(a,t.min)),void 0!==t.max&&(a=Math.min(a,t.max))),a}function jkt(t,e){return null!=t.pfValue||null!=t.value?null==t.pfValue||null!=e&&"%"===e.type.units?t.value:t.pfValue:t}function Ykt(t,e,n,r,i){var a=null!=i?i.type:null;n<0?n=0:n>1&&(n=1);var s=jkt(t,i),o=jkt(e,i);if(jdt(s)&&jdt(o))return qkt(a,s,o,n,r);if(Udt(s)&&Udt(o)){for(var l=[],c=0;c<o.length;c++){var h=s[c],u=o[c];if(null!=h&&null!=u){var d=qkt(a,h,u,n,r);l.push(d)}else l.push(u)}return l}}function Wkt(t,e,n,r){var i=!r,a=t._private,s=e._private,o=s.easing,l=s.startTime,c=(r?t:t.cy()).style();if(!s.easingImpl)if(null==o)s.easingImpl=Gkt.linear;else{var h,u,d;if(Fdt(o))h=c.parse("transition-timing-function",o).value;else h=o;Fdt(h)?(u=h,d=[]):(u=h[1],d=h.slice(2).map((function(t){return+t}))),d.length>0?("spring"===u&&d.push(s.duration),s.easingImpl=Gkt[u].apply(null,d)):s.easingImpl=Gkt[u]}var p,g=s.easingImpl;if(p=0===s.duration?1:(n-l)/s.duration,s.applying&&(p=s.progress),p<0?p=0:p>1&&(p=1),null==s.delay){var f=s.startPosition,m=s.position;if(m&&i&&!t.locked()){var y={};Hkt(f.x,m.x)&&(y.x=Ykt(f.x,m.x,p,g)),Hkt(f.y,m.y)&&(y.y=Ykt(f.y,m.y,p,g)),t.position(y)}var v=s.startPan,x=s.pan,b=a.pan,w=null!=x&&r;w&&(Hkt(v.x,x.x)&&(b.x=Ykt(v.x,x.x,p,g)),Hkt(v.y,x.y)&&(b.y=Ykt(v.y,x.y,p,g)),t.emit("pan"));var k=s.startZoom,T=s.zoom,_=null!=T&&r;_&&(Hkt(k,T)&&(a.zoom=Mft(a.minZoom,Ykt(k,T,p,g),a.maxZoom)),t.emit("zoom")),(w||_)&&t.emit("viewport");var E=s.style;if(E&&E.length>0&&i){for(var C=0;C<E.length;C++){var S=E[C],A=S.name,L=S,N=s.startStyle[A],I=Ykt(N,L,p,g,c.properties[N.name]);c.overrideBypass(t,A,I)}t.emit("style")}}return s.progress=p,p}function Hkt(t,e){return null!=t&&null!=e&&(!(!jdt(t)||!jdt(e))||!(!t||!e))}function Vkt(t,e,n,r){var i=e._private;i.started=!0,i.startTime=n-i.progress*i.duration}function Xkt(t,e){var n=e._private.aniEles,r=[];function i(e,n){var i=e._private,a=i.animation.current,o=i.animation.queue,l=!1;if(0===a.length){var c=o.shift();c&&a.push(c)}for(var h=s((function(t){for(var e=t.length-1;e>=0;e--){(0,t[e])()}t.splice(0,t.length)}),"callbacks"),u=a.length-1;u>=0;u--){var d=a[u],p=d._private;p.stopped?(a.splice(u,1),p.hooked=!1,p.playing=!1,p.started=!1,h(p.frames)):(p.playing||p.applying)&&(p.playing&&p.applying&&(p.applying=!1),p.started||Vkt(0,d,t),Wkt(e,d,t,n),p.applying&&(p.applying=!1),h(p.frames),null!=p.step&&p.step(t),d.completed()&&(a.splice(u,1),p.hooked=!1,p.playing=!1,p.started=!1,h(p.completes)),l=!0)}return n||0!==a.length||0!==o.length||r.push(e),l}s(i,"stepOne");for(var a=!1,o=0;o<n.length;o++){var l=i(n[o]);a=a||l}var c=i(e,!0);(a||c)&&(n.length>0?e.notify("draw",n):e.notify("draw")),n.unmerge(r),e.emit("step")}s(qkt,"getEasedValue"),s(jkt,"getValue"),s(Ykt,"ease"),s(Wkt,"step$1"),s(Hkt,"valid"),s(Vkt,"startAnimation"),s(Xkt,"stepAll");var Kkt={animate:ibt.animate(),animation:ibt.animation(),animated:ibt.animated(),clearQueue:ibt.clearQueue(),delay:ibt.delay(),delayAnimation:ibt.delayAnimation(),stop:ibt.stop(),addToAnimationPool:s((function(t){this.styleEnabled()&&this._private.aniEles.merge(t)}),"addToAnimationPool"),stopAnimationLoop:s((function(){this._private.animationsRunning=!1}),"stopAnimationLoop"),startAnimationLoop:s((function(){var t=this;if(t._private.animationsRunning=!0,t.styleEnabled()){s(n,"headlessStep");var e=t.renderer();e&&e.beforeRender?e.beforeRender(s((function(e,n){Xkt(n,t)}),"rendererAnimationStep"),e.beforeRenderPriorities.animations):n()}function n(){t._private.animationsRunning&&ugt(s((function(e){Xkt(e,t),n()}),"animationStep"))}}),"startAnimationLoop")},Zkt={qualifierCompare:s((function(t,e){return null==t||null==e?null==t&&null==e:t.sameText(e)}),"qualifierCompare"),eventMatches:s((function(t,e,n){var r=e.qualifier;return null==r||t!==n.target&&Vdt(n.target)&&r.matches(n.target)}),"eventMatches"),addEventFields:s((function(t,e){e.cy=t,e.target=t}),"addEventFields"),callbackContext:s((function(t,e,n){return null!=e.qualifier?n.target:t}),"callbackContext")},Qkt=s((function(t){return Fdt(t)?new Qbt(t):t}),"argSelector"),Jkt={createEmitter:s((function(){var t=this._private;return t.emitter||(t.emitter=new Jwt(Zkt,this)),this}),"createEmitter"),emitter:s((function(){return this._private.emitter}),"emitter"),on:s((function(t,e,n){return this.emitter().on(t,Qkt(e),n),this}),"on"),removeListener:s((function(t,e,n){return this.emitter().removeListener(t,Qkt(e),n),this}),"removeListener"),removeAllListeners:s((function(){return this.emitter().removeAllListeners(),this}),"removeAllListeners"),one:s((function(t,e,n){return this.emitter().one(t,Qkt(e),n),this}),"one"),once:s((function(t,e,n){return this.emitter().one(t,Qkt(e),n),this}),"once"),emit:s((function(t,e){return this.emitter().emit(t,e),this}),"emit"),emitAndNotify:s((function(t,e){return this.emit(t),this.notify(t,e),this}),"emitAndNotify")};ibt.eventAliasesOn(Jkt);var tTt={png:s((function(t){return t=t||{},this._private.renderer.png(t)}),"png"),jpg:s((function(t){var e=this._private.renderer;return(t=t||{}).bg=t.bg||"#fff",e.jpg(t)}),"jpg")};tTt.jpeg=tTt.jpg;var eTt={layout:s((function(t){var e=this;if(null!=t)if(null!=t.name){var n,r=t.name,i=e.extension("layout",r);if(null!=i)return n=Fdt(t.eles)?e.$(t.eles):null!=t.eles?t.eles:e.$(),new i(dpt({},t,{cy:e,eles:n}));Mgt("No such layout `"+r+"` found. Did you forget to import it and `cytoscape.use()` it?")}else Mgt("A `name` must be specified to make a layout");else Mgt("Layout options must be specified to make a layout")}),"layout")};eTt.createLayout=eTt.makeLayout=eTt.layout;var nTt={notify:s((function(t,e){var n=this._private;if(this.batching()){n.batchNotifications=n.batchNotifications||{};var r=n.batchNotifications[t]=n.batchNotifications[t]||this.collection();null!=e&&r.merge(e)}else if(n.notificationsEnabled){var i=this.renderer();!this.destroyed()&&i&&i.notify(t,e)}}),"notify"),notifications:s((function(t){var e=this._private;return void 0===t?e.notificationsEnabled:(e.notificationsEnabled=!!t,this)}),"notifications"),noNotifications:s((function(t){this.notifications(!1),t(),this.notifications(!0)}),"noNotifications"),batching:s((function(){return this._private.batchCount>0}),"batching"),startBatch:s((function(){var t=this._private;return null==t.batchCount&&(t.batchCount=0),0===t.batchCount&&(t.batchStyleEles=this.collection(),t.batchNotifications={}),t.batchCount++,this}),"startBatch"),endBatch:s((function(){var t=this._private;if(0===t.batchCount)return this;if(t.batchCount--,0===t.batchCount){t.batchStyleEles.updateStyle();var e=this.renderer();Object.keys(t.batchNotifications).forEach((function(n){var r=t.batchNotifications[n];r.empty()?e.notify(n):e.notify(n,r)}))}return this}),"endBatch"),batch:s((function(t){return this.startBatch(),t(),this.endBatch(),this}),"batch"),batchData:s((function(t){var e=this;return this.batch((function(){for(var n=Object.keys(t),r=0;r<n.length;r++){var i=n[r],a=t[i];e.getElementById(i).data(a)}}))}),"batchData")},rTt=Ugt({hideEdgesOnViewport:!1,textureOnViewport:!1,motionBlur:!1,motionBlurOpacity:.05,pixelRatio:void 0,desktopTapThreshold:4,touchTapThreshold:8,wheelSensitivity:1,debug:!1,showFps:!1}),iTt={renderTo:s((function(t,e,n,r){return this._private.renderer.renderTo(t,e,n,r),this}),"renderTo"),renderer:s((function(){return this._private.renderer}),"renderer"),forceRender:s((function(){return this.notify("draw"),this}),"forceRender"),resize:s((function(){return this.invalidateSize(),this.emitAndNotify("resize"),this}),"resize"),initRenderer:s((function(t){var e=this,n=e.extension("renderer",t.name);if(null!=n){void 0!==t.wheelSensitivity&&Dgt("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 r=rTt(t);r.cy=e,e._private.renderer=new n(r),this.notify("init")}else Mgt("Can not initialise: No such renderer `".concat(t.name,"` found. Did you forget to import it and `cytoscape.use()` it?"))}),"initRenderer"),destroyRenderer:s((function(){var t=this;t.notify("destroy");var e=t.container();if(e)for(e._cyreg=null;e.childNodes.length>0;)e.removeChild(e.childNodes[0]);t._private.renderer=null,t.mutableElements().forEach((function(t){var e=t._private;e.rscratch={},e.rstyle={},e.animation.current=[],e.animation.queue=[]}))}),"destroyRenderer"),onRender:s((function(t){return this.on("render",t)}),"onRender"),offRender:s((function(t){return this.off("render",t)}),"offRender")};iTt.invalidateDimensions=iTt.resize;var aTt={collection:s((function(t,e){return Fdt(t)?this.$(t):Hdt(t)?t.collection():Udt(t)?(e||(e={}),new Pkt(this,t,e.unique,e.removed)):new Pkt(this)}),"collection"),nodes:s((function(t){var e=this.$((function(t){return t.isNode()}));return t?e.filter(t):e}),"nodes"),edges:s((function(t){var e=this.$((function(t){return t.isEdge()}));return t?e.filter(t):e}),"edges"),$:s((function(t){var e=this._private.elements;return t?e.filter(t):e.spawnSelf()}),"$"),mutableElements:s((function(){return this._private.elements}),"mutableElements")};aTt.elements=aTt.filter=aTt.$;var sTt={};sTt.apply=function(t){for(var e=this,n=e._private.cy.collection(),r=0;r<t.length;r++){var i=t[r],a=e.getContextMeta(i);if(!a.empty){var s=e.getContextStyle(a),o=e.applyContextStyle(a,s,i);i._private.appliedInitStyle?e.updateTransitions(i,o.diffProps):i._private.appliedInitStyle=!0,e.updateStyleHints(i)&&n.push(i)}}return n},sTt.getPropertiesDiff=function(t,e){var n=this,r=n._private.propDiffs=n._private.propDiffs||{},i=t+"-"+e,a=r[i];if(a)return a;for(var s=[],o={},l=0;l<n.length;l++){var c=n[l],h="t"===t[l],u="t"===e[l],d=h!==u,p=c.mappedProperties.length>0;if(d||u&&p){var g=void 0;d&&p||d?g=c.properties:p&&(g=c.mappedProperties);for(var f=0;f<g.length;f++){for(var m=g[f],y=m.name,v=!1,x=l+1;x<n.length;x++){var b=n[x];if("t"===e[x]&&(v=null!=b.properties[m.name]))break}o[y]||v||(o[y]=!0,s.push(y))}}}return r[i]=s,s},sTt.getContextMeta=function(t){for(var e,n=this,r="",i=t._private.styleCxtKey||"",a=0;a<n.length;a++){var s=n[a];r+=s.selector&&s.selector.matches(t)?"t":"f"}return e=n.getPropertiesDiff(i,r),t._private.styleCxtKey=r,{key:r,diffPropNames:e,empty:0===e.length}},sTt.getContextStyle=function(t){var e=t.key,n=this._private.contextStyles=this._private.contextStyles||{};if(n[e])return n[e];for(var r={_private:{key:e}},i=0;i<this.length;i++){var a=this[i];if("t"===e[i])for(var s=0;s<a.properties.length;s++){var o=a.properties[s];r[o.name]=o}}return n[e]=r,r},sTt.applyContextStyle=function(t,e,n){for(var r=t.diffPropNames,i={},a=this.types,s=0;s<r.length;s++){var o=r[s],l=e[o],c=n.pstyle(o);if(!l){if(!c)continue;l=c.bypass?{name:o,deleteBypassed:!0}:{name:o,delete:!0}}if(c!==l){if(l.mapped===a.fn&&null!=c&&null!=c.mapping&&c.mapping.value===l.value){var h=c.mapping;if((h.fnValue=l.value(n))===h.prevFnValue)continue}var u=i[o]={prev:c};this.applyParsedProperty(n,l),u.next=n.pstyle(o),u.next&&u.next.bypass&&(u.next=u.next.bypassed)}}return{diffProps:i}},sTt.updateStyleHints=function(t){var e=t._private,n=this,r=n.propertyGroupNames,i=n.propertyGroupKeys,a=s((function(t,e,r){return n.getPropertiesHash(t,e,r)}),"propHash"),o=e.styleKey;if(t.removed())return!1;var l="nodes"===e.group,c=t._private.style;r=Object.keys(c);for(var h=0;h<i.length;h++){var u=i[h];e.styleKeys[u]=[9261,5381]}for(var d=s((function(t,n){return e.styleKeys[n][0]=fgt(t,e.styleKeys[n][0])}),"updateGrKey1"),p=s((function(t,n){return e.styleKeys[n][1]=mgt(t,e.styleKeys[n][1])}),"updateGrKey2"),g=s((function(t,e){d(t,e),p(t,e)}),"updateGrKey"),f=s((function(t,e){for(var n=0;n<t.length;n++){var r=t.charCodeAt(n);d(r,e),p(r,e)}}),"updateGrKeyWStr"),m=s((function(t){return-128<t&&t<128&&Math.floor(t)!==t?2e9-(1024*t|0):t}),"cleanNum"),y=0;y<r.length;y++){var v=r[y],x=c[v];if(null!=x){var b=this.properties[v],w=b.type,k=b.groupKey,T=void 0;null!=b.hashOverride?T=b.hashOverride(t,x):null!=x.pfValue&&(T=x.pfValue);var _=null==b.enums?x.value:null,E=null!=T,C=E||null!=_,S=x.units;if(w.number&&C&&!w.multiple)g(m(E?T:_),k),E||null==S||f(S,k);else f(x.strValue,k)}}for(var A=[9261,5381],L=0;L<i.length;L++){var N=i[L],I=e.styleKeys[N];A[0]=fgt(I[0],A[0]),A[1]=mgt(I[1],A[1])}e.styleKey=ygt(A[0],A[1]);var M=e.styleKeys;e.labelDimsKey=vgt(M.labelDimensions);var R=a(t,["label"],M.labelDimensions);if(e.labelKey=vgt(R),e.labelStyleKey=vgt(xgt(M.commonLabel,R)),!l){var D=a(t,["source-label"],M.labelDimensions);e.sourceLabelKey=vgt(D),e.sourceLabelStyleKey=vgt(xgt(M.commonLabel,D));var O=a(t,["target-label"],M.labelDimensions);e.targetLabelKey=vgt(O),e.targetLabelStyleKey=vgt(xgt(M.commonLabel,O))}if(l){var P=e.styleKeys,B=P.nodeBody,$=P.nodeBorder,F=P.nodeOutline,z=P.backgroundImage,U=P.compound,G=P.pie,q=[B,$,F,z,U,G].filter((function(t){return null!=t})).reduce(xgt,[9261,5381]);e.nodeKey=vgt(q),e.hasPie=null!=G&&9261!==G[0]&&5381!==G[1]}return o!==e.styleKey},sTt.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},sTt.applyParsedProperty=function(t,e){var n,r=this,i=e,a=t._private.style,o=r.types,l=r.properties[i.name].type,c=i.bypass,h=a[i.name],u=h&&h.bypass,d=t._private,p="mapping",g=s((function(t){return null==t?null:null!=t.pfValue?t.pfValue:t.value}),"getVal"),f=s((function(){var e=g(h),n=g(i);r.checkTriggers(t,i.name,e,n)}),"checkTriggers");if("curve-style"===e.name&&t.isEdge()&&("bezier"!==e.value&&t.isLoop()||"haystack"===e.value&&(t.source().isParent()||t.target().isParent()))&&(i=e=this.parse(e.name,"bezier",c)),i.delete)return a[i.name]=void 0,f(),!0;if(i.deleteBypassed)return h?!!h.bypass&&(h.bypassed=void 0,f(),!0):(f(),!0);if(i.deleteBypass)return h?!!h.bypass&&(a[i.name]=h.bypassed,f(),!0):(f(),!0);var m=s((function(){Dgt("Do not assign mappings to elements without corresponding data (i.e. ele `"+t.id()+"` has no mapping for property `"+i.name+"` with data field `"+i.field+"`); try a `["+i.field+"]` selector to limit scope to elements with `"+i.field+"` defined")}),"printMappingErr");switch(i.mapped){case o.mapData:for(var y,v=i.field.split("."),x=d.data,b=0;b<v.length&&x;b++){x=x[v[b]]}if(null==x)return m(),!1;if(!jdt(x))return Dgt("Do not use continuous mappers without specifying numeric data (i.e. `"+i.field+": "+x+"` for `"+t.id()+"` is non-numeric)"),!1;var w=i.fieldMax-i.fieldMin;if((y=0===w?0:(x-i.fieldMin)/w)<0?y=0:y>1&&(y=1),l.color){var k=i.valueMin[0],T=i.valueMax[0],_=i.valueMin[1],E=i.valueMax[1],C=i.valueMin[2],S=i.valueMax[2],A=null==i.valueMin[3]?1:i.valueMin[3],L=null==i.valueMax[3]?1:i.valueMax[3],N=[Math.round(k+(T-k)*y),Math.round(_+(E-_)*y),Math.round(C+(S-C)*y),Math.round(A+(L-A)*y)];n={bypass:i.bypass,name:i.name,value:N,strValue:"rgb("+N[0]+", "+N[1]+", "+N[2]+")"}}else{if(!l.number)return!1;var I=i.valueMin+(i.valueMax-i.valueMin)*y;n=this.parse(i.name,I,i.bypass,p)}if(!n)return m(),!1;n.mapping=i,i=n;break;case o.data:for(var M=i.field.split("."),R=d.data,D=0;D<M.length&&R;D++){R=R[M[D]]}if(null!=R&&(n=this.parse(i.name,R,i.bypass,p)),!n)return m(),!1;n.mapping=i,i=n;break;case o.fn:var O=i.value,P=null!=i.fnValue?i.fnValue:O(t);if(i.prevFnValue=P,null==P)return Dgt("Custom function mappers may not return null (i.e. `"+i.name+"` for ele `"+t.id()+"` is null)"),!1;if(!(n=this.parse(i.name,P,i.bypass,p)))return Dgt("Custom function mappers may not return invalid values for the property type (i.e. `"+i.name+"` for ele `"+t.id()+"` is invalid)"),!1;n.mapping=Pgt(i),i=n;break;case void 0:break;default:return!1}return c?(i.bypassed=u?h.bypassed:h,a[i.name]=i):u?h.bypassed=i:a[i.name]=i,f(),!0},sTt.cleanElements=function(t,e){for(var n=0;n<t.length;n++){var r=t[n];if(this.clearStyleHints(r),r.dirtyCompoundBoundsCache(),r.dirtyBoundingBoxCache(),e)for(var i=r._private.style,a=Object.keys(i),s=0;s<a.length;s++){var o=a[s],l=i[o];null!=l&&(l.bypass?l.bypassed=null:i[o]=null)}else r._private.style={}}},sTt.update=function(){this._private.cy.mutableElements().updateStyle()},sTt.updateTransitions=function(t,e){var n=this,r=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,c=0;c<i.length;c++){var h=i[c],u=t.pstyle(h),d=e[h];if(d){var p=d.prev,g=null!=d.next?d.next:u,f=!1,m=void 0,y=1e-6;p&&(jdt(p.pfValue)&&jdt(g.pfValue)?(f=g.pfValue-p.pfValue,m=p.pfValue+y*f):jdt(p.value)&&jdt(g.value)?(f=g.value-p.value,m=p.value+y*f):Udt(p.value)&&Udt(g.value)&&(f=p.value[0]!==g.value[0]||p.value[1]!==g.value[1]||p.value[2]!==g.value[2],m=p.strValue),f&&(o[h]=g.strValue,this.applyBypass(t,h,m),l=!0))}}if(!l)return;r.transitioning=!0,new Yyt((function(e){s>0?t.delayAnimation(s).play().promise().then(e):e()})).then((function(){return t.animation({style:o,duration:a,easing:t.pstyle("transition-timing-function").value,queue:!1}).play().promise()})).then((function(){n.removeBypasses(t,i),t.emitAndNotify("style"),r.transitioning=!1}))}else r.transitioning&&(this.removeBypasses(t,i),t.emitAndNotify("style"),r.transitioning=!1)},sTt.checkTrigger=function(t,e,n,r,i,a){var s=this.properties[e],o=i(s);null!=o&&o(n,r)&&a(s)},sTt.checkZOrderTrigger=function(t,e,n,r){var i=this;this.checkTrigger(t,e,n,r,(function(t){return t.triggersZOrder}),(function(){i._private.cy.notify("zorder",t)}))},sTt.checkBoundsTrigger=function(t,e,n,r){this.checkTrigger(t,e,n,r,(function(t){return t.triggersBounds}),(function(i){t.dirtyCompoundBoundsCache(),t.dirtyBoundingBoxCache(),!i.triggersBoundsOfParallelBeziers||"curve-style"!==e||"bezier"!==n&&"bezier"!==r||t.parallelEdges().forEach((function(t){t.isBundledBezier()&&t.dirtyBoundingBoxCache()})),!i.triggersBoundsOfConnectedEdges||"display"!==e||"none"!==n&&"none"!==r||t.connectedEdges().forEach((function(t){t.dirtyBoundingBoxCache()}))}))},sTt.checkTriggers=function(t,e,n,r){t.dirtyStyleCache(),this.checkZOrderTrigger(t,e,n,r),this.checkBoundsTrigger(t,e,n,r)};var oTt={applyBypass:function(t,e,n,r){var i=[];if("*"===e||"**"===e){if(void 0!==n)for(var a=0;a<this.properties.length;a++){var s=this.properties[a].name,o=this.parse(s,n,!0);o&&i.push(o)}}else if(Fdt(e)){var l=this.parse(e,n,!0);l&&i.push(l)}else{if(!Gdt(e))return!1;var c=e;r=n;for(var h=Object.keys(c),u=0;u<h.length;u++){var d=h[u],p=c[d];if(void 0===p&&(p=c[spt(d)]),void 0!==p){var g=this.parse(d,p,!0);g&&i.push(g)}}}if(0===i.length)return!1;for(var f=!1,m=0;m<t.length;m++){for(var y=t[m],v={},x=void 0,b=0;b<i.length;b++){var w=i[b];if(r){var k=y.pstyle(w.name);x=v[w.name]={prev:k}}f=this.applyParsedProperty(y,Pgt(w))||f,r&&(x.next=y.pstyle(w.name))}f&&this.updateStyleHints(y),r&&this.updateTransitions(y,v,true)}return f},overrideBypass:function(t,e,n){e=apt(e);for(var r=0;r<t.length;r++){var i=t[r],a=i._private.style[e],s=this.properties[e].type,o=s.color,l=s.mutiple,c=a?null!=a.pfValue?a.pfValue:a.value:null;a&&a.bypass?(a.value=n,null!=a.pfValue&&(a.pfValue=n),a.strValue=o?"rgb("+n.join(",")+")":l?n.join(" "):""+n,this.updateStyleHints(i)):this.applyBypass(i,e,n),this.checkTriggers(i,e,c,n)}},removeAllBypasses:function(t,e){return this.removeBypasses(t,this.propertyNames,e)},removeBypasses:function(t,e,n){for(var r=0;r<t.length;r++){for(var i=t[r],a={},s=0;s<e.length;s++){var o=e[s],l=this.properties[o],c=i.pstyle(l.name);if(c&&c.bypass){var h=this.parse(o,"",!0),u=a[l.name]={prev:c};this.applyParsedProperty(i,h),u.next=i.pstyle(l.name)}}this.updateStyleHints(i),n&&this.updateTransitions(i,a,true)}}},lTt={getEmSizeInPixels:function(){var t=this.containerCss("font-size");return null!=t?parseFloat(t):1},containerCss:function(t){var e=this._private.cy,n=e.container(),r=e.window();if(r&&n&&r.getComputedStyle)return r.getComputedStyle(n).getPropertyValue(t)}},cTt={getRenderedStyle:function(t,e){return e?this.getStylePropertyValue(t,e,!0):this.getRawStyle(t,!0)},getRawStyle:function(t,e){var n=this;if(t=t[0]){for(var r={},i=0;i<n.properties.length;i++){var a=n.properties[i],s=n.getStylePropertyValue(t,a.name,e);null!=s&&(r[a.name]=s,r[spt(a.name)]=s)}return r}},getIndexedStyle:function(t,e,n,r){var i=t.pstyle(e)[n][r];return null!=i?i:t.cy().style().getDefaultProperty(e)[n][0]},getStylePropertyValue:function(t,e,n){if(t=t[0]){var r=this.properties[e];r.alias&&(r=r.pointsTo);var i=r.type,a=t.pstyle(r.name);if(a){var o=a.value,l=a.units,c=a.strValue;if(n&&i.number&&null!=o&&jdt(o)){var h=t.cy().zoom(),u=s((function(t){return t*h}),"getRenderedValue"),d=s((function(t,e){return u(t)+e}),"getValueStringWithUnits"),p=Udt(o),g=p?l.every((function(t){return null!=t})):null!=l;return g?p?o.map((function(t,e){return d(t,l[e])})).join(" "):d(o,l):p?o.map((function(t){return Fdt(t)?t:""+u(t)})).join(" "):""+u(o)}if(null!=c)return c}return null}},getAnimationStartStyle:function(t,e){for(var n={},r=0;r<e.length;r++){var i=e[r].name,a=t.pstyle(i);void 0!==a&&(a=Gdt(a)?this.parse(i,a.strValue):this.parse(i,a)),a&&(n[i]=a)}return n},getPropsList:function(t){var e=[],n=t,r=this.properties;if(n)for(var i=Object.keys(n),a=0;a<i.length;a++){var s=i[a],o=n[s],l=r[s]||r[apt(s)],c=this.parse(l.name,o);c&&e.push(c)}return e},getNonDefaultPropertiesHash:function(t,e,n){var r,i,a,s,o,l,c=n.slice();for(o=0;o<e.length;o++)if(r=e[o],null!=(i=t.pstyle(r,!1)))if(null!=i.pfValue)c[0]=fgt(s,c[0]),c[1]=mgt(s,c[1]);else for(a=i.strValue,l=0;l<a.length;l++)s=a.charCodeAt(l),c[0]=fgt(s,c[0]),c[1]=mgt(s,c[1]);return c}};cTt.getPropertiesHash=cTt.getNonDefaultPropertiesHash;var hTt={appendFromJson:function(t){for(var e=this,n=0;n<t.length;n++){var r=t[n],i=r.selector,a=r.style||r.css,s=Object.keys(a);e.selector(i);for(var o=0;o<s.length;o++){var l=s[o],c=a[l];e.css(l,c)}}return e},fromJson:function(t){var e=this;return e.resetToDefault(),e.appendFromJson(t),e},json:function(){for(var t=[],e=this.defaultLength;e<this.length;e++){for(var n=this[e],r=n.selector,i=n.properties,a={},s=0;s<i.length;s++){var o=i[s];a[o.name]=o.strValue}t.push({selector:r?r.toString():"core",style:a})}return t}},uTt={appendFromString:function(t){var e,n,r,i=this,a=""+t;function o(){a=a.length>e.length?a.substr(e.length):""}function l(){n=n.length>r.length?n.substr(r.length):""}for(a=a.replace(/[/][*](\s|.)+?[*][/]/g,""),s(o,"removeSelAndBlockFromRemaining"),s(l,"removePropAndValFromRem");;){if(a.match(/^\s*$/))break;var c=a.match(/^\s*((?:.|\s)+?)\s*\{((?:.|\s)+?)\}/);if(!c){Dgt("Halting stylesheet parsing: String stylesheet contains more to parse but no selector and block found in: "+a);break}e=c[0];var h=c[1];if("core"!==h)if(new Qbt(h).invalid){Dgt("Skipping parsing of block: Invalid selector found in string stylesheet: "+h),o();continue}var u=c[2],d=!1;n=u;for(var p=[];;){if(n.match(/^\s*$/))break;var g=n.match(/^\s*(.+?)\s*:\s*(.+?)(?:\s*;|\s*$)/);if(!g){Dgt("Skipping parsing of block: Invalid formatting of style property and value definitions found in:"+u),d=!0;break}r=g[0];var f=g[1],m=g[2];if(this.properties[f])i.parse(f,m)?(p.push({name:f,val:m}),l()):(Dgt("Skipping property: Invalid property definition in: "+r),l());else Dgt("Skipping property: Invalid property name in: "+r),l()}if(d){o();break}i.selector(h);for(var y=0;y<p.length;y++){var v=p[y];i.css(v.name,v.val)}o()}return i},fromString:function(t){var e=this;return e.resetToDefault(),e.appendFromString(t),e}},dTt={};!function(){var t=cpt,e=s((function(t){return"^"+t+"\\s*\\(\\s*([\\w\\.]+)\\s*\\)$"}),"data"),n=s((function(e){var n=t+"|\\w+|rgb[a]?\\((?:(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))[%]?)\\s*,\\s*(?:(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))[%]?)\\s*,\\s*(?:(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))[%]?)(?:\\s*,\\s*(?:(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))))?\\)|hsl[a]?\\((?:(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?)))\\s*,\\s*(?:(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))[%])\\s*,\\s*(?:(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))[%])(?:\\s*,\\s*(?:(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))))?\\)|\\#[0-9a-fA-F]{3}|\\#[0-9a-fA-F]{6}";return"^"+e+"\\s*\\(([\\w\\.]+)\\s*\\,\\s*("+t+")\\s*\\,\\s*("+t+")\\s*,\\s*("+n+")\\s*\\,\\s*("+n+")\\)$"}),"mapData"),r=["^url\\s*\\(\\s*['\"]?(.+?)['\"]?\\s*\\)$","^(none)$","^(.+)$"];dTt.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"]},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},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"]},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:e("data")},layoutData:{mapping:!0,regex:e("layoutData")},scratch:{mapping:!0,regex:e("scratch")},mapData:{mapping:!0,regex:n("mapData")},mapLayoutData:{mapping:!0,regex:n("mapLayoutData")},mapScratch:{mapping:!0,regex:n("mapScratch")},fn:{mapping:!0,fn:!0},url:{regexes:r,singleRegexMatchValue:!0},urls:{regexes:r,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:s((function(t,e){switch(t.length){case 2:return"deg"!==e[0]&&"rad"!==e[0]&&"deg"!==e[1]&&"rad"!==e[1];case 1:return Fdt(t[0])||"deg"===e[0]||"rad"===e[0];default:return!1}}),"validate")},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:s((function(t){var e=t.length;return 1===e||2===e||4===e}),"validate")}};var i={zeroNonZero:s((function(t,e){return(null==t||null==e)&&t!==e||(0==t&&0!=e||0!=t&&0==e)}),"zeroNonZero"),any:s((function(t,e){return t!=e}),"any"),emptyNonEmpty:s((function(t,e){var n=Jdt(t),r=Jdt(e);return n&&!r||!n&&r}),"emptyNonEmpty")},a=dTt.types,o=[{name:"label",type:a.text,triggersBounds:i.any,triggersZOrder:i.emptyNonEmpty},{name:"text-rotation",type:a.textRotation,triggersBounds:i.any},{name:"text-margin-x",type:a.bidirectionalSize,triggersBounds:i.any},{name:"text-margin-y",type:a.bidirectionalSize,triggersBounds:i.any}],l=[{name:"source-label",type:a.text,triggersBounds:i.any},{name:"source-text-rotation",type:a.textRotation,triggersBounds:i.any},{name:"source-text-margin-x",type:a.bidirectionalSize,triggersBounds:i.any},{name:"source-text-margin-y",type:a.bidirectionalSize,triggersBounds:i.any},{name:"source-text-offset",type:a.size,triggersBounds:i.any}],c=[{name:"target-label",type:a.text,triggersBounds:i.any},{name:"target-text-rotation",type:a.textRotation,triggersBounds:i.any},{name:"target-text-margin-x",type:a.bidirectionalSize,triggersBounds:i.any},{name:"target-text-margin-y",type:a.bidirectionalSize,triggersBounds:i.any},{name:"target-text-offset",type:a.size,triggersBounds:i.any}],h=[{name:"font-family",type:a.fontFamily,triggersBounds:i.any},{name:"font-style",type:a.fontStyle,triggersBounds:i.any},{name:"font-weight",type:a.fontWeight,triggersBounds:i.any},{name:"font-size",type:a.size,triggersBounds:i.any},{name:"text-transform",type:a.textTransform,triggersBounds:i.any},{name:"text-wrap",type:a.textWrap,triggersBounds:i.any},{name:"text-overflow-wrap",type:a.textOverflowWrap,triggersBounds:i.any},{name:"text-max-width",type:a.size,triggersBounds:i.any},{name:"text-outline-width",type:a.size,triggersBounds:i.any},{name:"line-height",type:a.positiveNumber,triggersBounds:i.any}],u=[{name:"text-valign",type:a.valign,triggersBounds:i.any},{name:"text-halign",type:a.halign,triggersBounds:i.any},{name:"color",type:a.color},{name:"text-outline-color",type:a.color},{name:"text-outline-opacity",type:a.zeroOneNumber},{name:"text-background-color",type:a.color},{name:"text-background-opacity",type:a.zeroOneNumber},{name:"text-background-padding",type:a.size,triggersBounds:i.any},{name:"text-border-opacity",type:a.zeroOneNumber},{name:"text-border-color",type:a.color},{name:"text-border-width",type:a.size,triggersBounds:i.any},{name:"text-border-style",type:a.borderStyle,triggersBounds:i.any},{name:"text-background-shape",type:a.textBackgroundShape,triggersBounds:i.any},{name:"text-justification",type:a.justification}],d=[{name:"events",type:a.bool,triggersZOrder:i.any},{name:"text-events",type:a.bool,triggersZOrder:i.any}],p=[{name:"display",type:a.display,triggersZOrder:i.any,triggersBounds:i.any,triggersBoundsOfConnectedEdges:!0},{name:"visibility",type:a.visibility,triggersZOrder:i.any},{name:"opacity",type:a.zeroOneNumber,triggersZOrder:i.zeroNonZero},{name:"text-opacity",type:a.zeroOneNumber},{name:"min-zoomed-font-size",type:a.size},{name:"z-compound-depth",type:a.zCompoundDepth,triggersZOrder:i.any},{name:"z-index-compare",type:a.zIndexCompare,triggersZOrder:i.any},{name:"z-index",type:a.number,triggersZOrder:i.any}],g=[{name:"overlay-padding",type:a.size,triggersBounds:i.any},{name:"overlay-color",type:a.color},{name:"overlay-opacity",type:a.zeroOneNumber,triggersBounds:i.zeroNonZero},{name:"overlay-shape",type:a.overlayShape,triggersBounds:i.any},{name:"overlay-corner-radius",type:a.cornerRadius}],f=[{name:"underlay-padding",type:a.size,triggersBounds:i.any},{name:"underlay-color",type:a.color},{name:"underlay-opacity",type:a.zeroOneNumber,triggersBounds:i.zeroNonZero},{name:"underlay-shape",type:a.overlayShape,triggersBounds:i.any},{name:"underlay-corner-radius",type:a.cornerRadius}],m=[{name:"transition-property",type:a.propList},{name:"transition-duration",type:a.time},{name:"transition-delay",type:a.time},{name:"transition-timing-function",type:a.easing}],y=s((function(t,e){return"label"===e.value?-t.poolIndex():e.pfValue}),"nodeSizeHashOverride"),v=[{name:"height",type:a.nodeSize,triggersBounds:i.any,hashOverride:y},{name:"width",type:a.nodeSize,triggersBounds:i.any,hashOverride:y},{name:"shape",type:a.nodeShape,triggersBounds:i.any},{name:"shape-polygon-points",type:a.polygonPointList,triggersBounds:i.any},{name:"corner-radius",type:a.cornerRadius},{name:"background-color",type:a.color},{name:"background-fill",type:a.fill},{name:"background-opacity",type:a.zeroOneNumber},{name:"background-blacken",type:a.nOneOneNumber},{name:"background-gradient-stop-colors",type:a.colors},{name:"background-gradient-stop-positions",type:a.percentages},{name:"background-gradient-direction",type:a.gradientDirection},{name:"padding",type:a.sizeMaybePercent,triggersBounds:i.any},{name:"padding-relative-to",type:a.paddingRelativeTo,triggersBounds:i.any},{name:"bounds-expansion",type:a.boundsExpansion,triggersBounds:i.any}],x=[{name:"border-color",type:a.color},{name:"border-opacity",type:a.zeroOneNumber},{name:"border-width",type:a.size,triggersBounds:i.any},{name:"border-style",type:a.borderStyle},{name:"border-cap",type:a.lineCap},{name:"border-join",type:a.lineJoin},{name:"border-dash-pattern",type:a.numbers},{name:"border-dash-offset",type:a.number},{name:"border-position",type:a.linePosition}],b=[{name:"outline-color",type:a.color},{name:"outline-opacity",type:a.zeroOneNumber},{name:"outline-width",type:a.size,triggersBounds:i.any},{name:"outline-style",type:a.borderStyle},{name:"outline-offset",type:a.size,triggersBounds:i.any}],w=[{name:"background-image",type:a.urls},{name:"background-image-crossorigin",type:a.bgCrossOrigin},{name:"background-image-opacity",type:a.zeroOneNumbers},{name:"background-image-containment",type:a.bgContainment},{name:"background-image-smoothing",type:a.bools},{name:"background-position-x",type:a.bgPos},{name:"background-position-y",type:a.bgPos},{name:"background-width-relative-to",type:a.bgRelativeTo},{name:"background-height-relative-to",type:a.bgRelativeTo},{name:"background-repeat",type:a.bgRepeat},{name:"background-fit",type:a.bgFit},{name:"background-clip",type:a.bgClip},{name:"background-width",type:a.bgWH},{name:"background-height",type:a.bgWH},{name:"background-offset-x",type:a.bgPos},{name:"background-offset-y",type:a.bgPos}],k=[{name:"position",type:a.position,triggersBounds:i.any},{name:"compound-sizing-wrt-labels",type:a.compoundIncludeLabels,triggersBounds:i.any},{name:"min-width",type:a.size,triggersBounds:i.any},{name:"min-width-bias-left",type:a.sizeMaybePercent,triggersBounds:i.any},{name:"min-width-bias-right",type:a.sizeMaybePercent,triggersBounds:i.any},{name:"min-height",type:a.size,triggersBounds:i.any},{name:"min-height-bias-top",type:a.sizeMaybePercent,triggersBounds:i.any},{name:"min-height-bias-bottom",type:a.sizeMaybePercent,triggersBounds:i.any}],T=[{name:"line-style",type:a.lineStyle},{name:"line-color",type:a.color},{name:"line-fill",type:a.fill},{name:"line-cap",type:a.lineCap},{name:"line-opacity",type:a.zeroOneNumber},{name:"line-dash-pattern",type:a.numbers},{name:"line-dash-offset",type:a.number},{name:"line-outline-width",type:a.size},{name:"line-outline-color",type:a.color},{name:"line-gradient-stop-colors",type:a.colors},{name:"line-gradient-stop-positions",type:a.percentages},{name:"curve-style",type:a.curveStyle,triggersBounds:i.any,triggersBoundsOfParallelBeziers:!0},{name:"haystack-radius",type:a.zeroOneNumber,triggersBounds:i.any},{name:"source-endpoint",type:a.edgeEndpoint,triggersBounds:i.any},{name:"target-endpoint",type:a.edgeEndpoint,triggersBounds:i.any},{name:"control-point-step-size",type:a.size,triggersBounds:i.any},{name:"control-point-distances",type:a.bidirectionalSizes,triggersBounds:i.any},{name:"control-point-weights",type:a.numbers,triggersBounds:i.any},{name:"segment-distances",type:a.bidirectionalSizes,triggersBounds:i.any},{name:"segment-weights",type:a.numbers,triggersBounds:i.any},{name:"segment-radii",type:a.numbers,triggersBounds:i.any},{name:"radius-type",type:a.radiusType,triggersBounds:i.any},{name:"taxi-turn",type:a.bidirectionalSizeMaybePercent,triggersBounds:i.any},{name:"taxi-turn-min-distance",type:a.size,triggersBounds:i.any},{name:"taxi-direction",type:a.axisDirection,triggersBounds:i.any},{name:"taxi-radius",type:a.number,triggersBounds:i.any},{name:"edge-distances",type:a.edgeDistances,triggersBounds:i.any},{name:"arrow-scale",type:a.positiveNumber,triggersBounds:i.any},{name:"loop-direction",type:a.angle,triggersBounds:i.any},{name:"loop-sweep",type:a.angle,triggersBounds:i.any},{name:"source-distance-from-node",type:a.size,triggersBounds:i.any},{name:"target-distance-from-node",type:a.size,triggersBounds:i.any}],_=[{name:"ghost",type:a.bool,triggersBounds:i.any},{name:"ghost-offset-x",type:a.bidirectionalSize,triggersBounds:i.any},{name:"ghost-offset-y",type:a.bidirectionalSize,triggersBounds:i.any},{name:"ghost-opacity",type:a.zeroOneNumber}],E=[{name:"selection-box-color",type:a.color},{name:"selection-box-opacity",type:a.zeroOneNumber},{name:"selection-box-border-color",type:a.color},{name:"selection-box-border-width",type:a.size},{name:"active-bg-color",type:a.color},{name:"active-bg-opacity",type:a.zeroOneNumber},{name:"active-bg-size",type:a.size},{name:"outside-texture-bg-color",type:a.color},{name:"outside-texture-bg-opacity",type:a.zeroOneNumber}],C=[];dTt.pieBackgroundN=16,C.push({name:"pie-size",type:a.sizeMaybePercent});for(var S=1;S<=dTt.pieBackgroundN;S++)C.push({name:"pie-"+S+"-background-color",type:a.color}),C.push({name:"pie-"+S+"-background-size",type:a.percent}),C.push({name:"pie-"+S+"-background-opacity",type:a.zeroOneNumber});var A=[],L=dTt.arrowPrefixes=["source","mid-source","target","mid-target"];[{name:"arrow-shape",type:a.arrowShape,triggersBounds:i.any},{name:"arrow-color",type:a.color},{name:"arrow-fill",type:a.arrowFill},{name:"arrow-width",type:a.arrowWidth}].forEach((function(t){L.forEach((function(e){var n=e+"-"+t.name,r=t.type,i=t.triggersBounds;A.push({name:n,type:r,triggersBounds:i})}))}),{});var N=dTt.properties=[].concat(d,m,p,g,f,_,u,h,o,l,c,v,x,b,w,C,k,T,A,E),I=dTt.propertyGroups={behavior:d,transition:m,visibility:p,overlay:g,underlay:f,ghost:_,commonLabel:u,labelDimensions:h,mainLabel:o,sourceLabel:l,targetLabel:c,nodeBody:v,nodeBorder:x,nodeOutline:b,backgroundImage:w,pie:C,compound:k,edgeLine:T,edgeArrow:A,core:E},M=dTt.propertyGroupNames={};(dTt.propertyGroupKeys=Object.keys(I)).forEach((function(t){M[t]=I[t].map((function(t){return t.name})),I[t].forEach((function(e){return e.groupKey=t}))}));var R=dTt.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"}];dTt.propertyNames=N.map((function(t){return t.name}));for(var D=0;D<N.length;D++){var O=N[D];N[O.name]=O}for(var P=0;P<R.length;P++){var B=R[P],$=N[B.pointsTo],F={name:B.name,alias:!0,pointsTo:$};N.push(F),N[B.name]=F}}(),dTt.getDefaultProperty=function(t){return this.getDefaultProperties()[t]},dTt.getDefaultProperties=function(){var t=this._private;if(null!=t.defaultProperties)return t.defaultProperties;for(var e=dpt({"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","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","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%"},[{name:"pie-{{i}}-background-color",value:"black"},{name:"pie-{{i}}-background-size",value:"0%"},{name:"pie-{{i}}-background-opacity",value:1}].reduce((function(t,e){for(var n=1;n<=dTt.pieBackgroundN;n++){var r=e.name.replace("{{i}}",n),i=e.value;t[r]=i}return t}),{}),{"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(t,e){return dTt.arrowPrefixes.forEach((function(n){var r=n+"-"+e.name,i=e.value;t[r]=i})),t}),{})),n={},r=0;r<this.properties.length;r++){var i=this.properties[r];if(!i.pointsTo){var a=i.name,s=e[a],o=this.parse(a,s);n[a]=o}}return t.defaultProperties=n,t.defaultProperties},dTt.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 pTt={parse:function(t,e,n,r){var i=this;if(zdt(e))return i.parseImplWarn(t,e,n,r);var a,s=kgt(t,""+e,n?"t":"f","mapping"===r||!0===r||!1===r||null==r?"dontcare":r),o=i.propCache=i.propCache||[];return(a=o[s])||(a=o[s]=i.parseImplWarn(t,e,n,r)),(n||"mapping"===r)&&(a=Pgt(a))&&(a.value=Pgt(a.value)),a},parseImplWarn:function(t,e,n,r){var i=this.parseImpl(t,e,n,r);return i||null==e||Dgt("The style property `".concat(t,": ").concat(e,"` is invalid")),!i||"width"!==i.name&&"height"!==i.name||"label"!==e||Dgt("The style value of `label` is deprecated for `"+i.name+"`"),i},parseImpl:function(t,e,n,r){var i=this;t=apt(t);var a=i.properties[t],o=e,l=i.types;if(!a)return null;if(void 0===e)return null;a.alias&&(a=a.pointsTo,t=a.name);var c=Fdt(e);c&&(e=e.trim());var h,u,d=a.type;if(!d)return null;if(n&&(""===e||null===e))return{name:t,value:e,bypass:!0,deleteBypass:!0};if(zdt(e))return{name:t,value:e,strValue:"fn",mapped:l.fn,bypass:n};if(!c||r||e.length<7||"a"!==e[1]);else{if(e.length>=7&&"d"===e[0]&&(h=new RegExp(l.data.regex).exec(e))){if(n)return!1;var p=l.data;return{name:t,value:h,strValue:""+e,mapped:p,field:h[1],bypass:n}}if(e.length>=10&&"m"===e[0]&&(u=new RegExp(l.mapData.regex).exec(e))){if(n)return!1;if(d.multiple)return!1;var g=l.mapData;if(!d.color&&!d.number)return!1;var f=this.parse(t,u[4]);if(!f||f.mapped)return!1;var m=this.parse(t,u[5]);if(!m||m.mapped)return!1;if(f.pfValue===m.pfValue||f.strValue===m.strValue)return Dgt("`"+t+": "+e+"` is not a valid mapper because the output range is zero; converting to `"+t+": "+f.strValue+"`"),this.parse(t,f.strValue);if(d.color){var y=f.value,v=m.value;if(!(y[0]!==v[0]||y[1]!==v[1]||y[2]!==v[2]||y[3]!==v[3]&&(null!=y[3]&&1!==y[3]||null!=v[3]&&1!==v[3])))return!1}return{name:t,value:u,strValue:""+e,mapped:g,field:u[1],fieldMin:parseFloat(u[2]),fieldMax:parseFloat(u[3]),valueMin:f.value,valueMax:m.value,bypass:n}}}if(d.multiple&&"multiple"!==r){var x;if(x=c?e.split(/\s+/):Udt(e)?e:[e],d.evenMultiple&&x.length%2!=0)return null;for(var b=[],w=[],k=[],T="",_=!1,E=0;E<x.length;E++){var C=i.parse(t,x[E],n,"multiple");_=_||Fdt(C.value),b.push(C.value),k.push(null!=C.pfValue?C.pfValue:C.value),w.push(C.units),T+=(E>0?" ":"")+C.strValue}return d.validate&&!d.validate(b,w)?null:d.singleEnum&&_?1===b.length&&Fdt(b[0])?{name:t,value:b[0],strValue:b[0],bypass:n}:null:{name:t,value:b,pfValue:k,strValue:T,bypass:n,units:w}}var S=s((function(){for(var r=0;r<d.enums.length;r++){if(d.enums[r]===e)return{name:t,value:e,strValue:""+e,bypass:n}}return null}),"checkEnums");if(d.number){var A,L="px";if(d.units&&(A=d.units),d.implicitUnits&&(L=d.implicitUnits),!d.unitless)if(c){var N="px|em"+(d.allowPercent?"|\\%":"");A&&(N=A);var I=e.match("^("+cpt+")("+N+")?$");I&&(e=I[1],A=I[2]||L)}else A&&!d.implicitUnits||(A=L);if(e=parseFloat(e),isNaN(e)&&void 0===d.enums)return null;if(isNaN(e)&&void 0!==d.enums)return e=o,S();if(d.integer&&!Ydt(e))return null;if(void 0!==d.min&&(e<d.min||d.strictMin&&e===d.min)||void 0!==d.max&&(e>d.max||d.strictMax&&e===d.max))return null;var M={name:t,value:e,strValue:""+e+(A||""),units:A,bypass:n};return d.unitless||"px"!==A&&"em"!==A?M.pfValue=e:M.pfValue="px"!==A&&A?this.getEmSizeInPixels()*e:e,"ms"!==A&&"s"!==A||(M.pfValue="ms"===A?e:1e3*e),"deg"!==A&&"rad"!==A||(M.pfValue="rad"===A?e:kft(e)),"%"===A&&(M.pfValue=e/100),M}if(d.propList){var R=[],D=""+e;if("none"===D);else{for(var O=D.split(/\s*,\s*|\s+/),P=0;P<O.length;P++){var B=O[P].trim();i.properties[B]?R.push(B):Dgt("`"+B+"` is not a valid property name")}if(0===R.length)return null}return{name:t,value:R,strValue:0===R.length?"none":R.join(" "),bypass:n}}if(d.color){var $=ypt(e);return $?{name:t,value:$,pfValue:$,strValue:"rgb("+$[0]+","+$[1]+","+$[2]+")",bypass:n}:null}if(d.regex||d.regexes){if(d.enums){var F=S();if(F)return F}for(var z=d.regexes?d.regexes:[d.regex],U=0;U<z.length;U++){var G=new RegExp(z[U]).exec(e);if(G)return{name:t,value:d.singleRegexMatchValue?G[1]:G,strValue:""+e,bypass:n}}return null}return d.string?{name:t,value:""+e,strValue:""+e,bypass:n}:d.enums?S():null}},gTt=s((function t(e){if(!(this instanceof t))return new t(e);Kdt(e)?(this._private={cy:e,coreStyle:{}},this.length=0,this.resetToDefault()):Mgt("A style must have a core reference")}),"Style"),fTt=gTt.prototype;fTt.instanceString=function(){return"style"},fTt.clear=function(){for(var t=this._private,e=t.cy.elements(),n=0;n<this.length;n++)this[n]=void 0;return this.length=0,t.contextStyles={},t.propDiffs={},this.cleanElements(e,!0),e.forEach((function(t){var e=t[0]._private;e.styleDirty=!0,e.appliedInitStyle=!1})),this},fTt.resetToDefault=function(){return this.clear(),this.addDefaultStylesheet(),this},fTt.core=function(t){return this._private.coreStyle[t]||this.getDefaultProperty(t)},fTt.selector=function(t){var e="core"===t?null:new Qbt(t),n=this.length++;return this[n]={selector:e,properties:[],mappedProperties:[],index:n},this},fTt.css=function(){var t=this,e=arguments;if(1===e.length)for(var n=e[0],r=0;r<t.properties.length;r++){var i=t.properties[r],a=n[i.name];void 0===a&&(a=n[spt(i.name)]),void 0!==a&&this.cssRule(i.name,a)}else 2===e.length&&this.cssRule(e[0],e[1]);return this},fTt.style=fTt.css,fTt.cssRule=function(t,e){var n=this.parse(t,e);if(n){var r=this.length-1;this[r].properties.push(n),this[r].properties[n.name]=n,n.name.match(/pie-(\d+)-background-size/)&&n.value&&(this._private.hasPie=!0),n.mapped&&this[r].mappedProperties.push(n),!this[r].selector&&(this._private.coreStyle[n.name]=n)}return this},fTt.append=function(t){return Zdt(t)?t.appendToStyle(this):Udt(t)?this.appendFromJson(t):Fdt(t)&&this.appendFromString(t),this},gTt.fromJson=function(t,e){var n=new gTt(t);return n.fromJson(e),n},gTt.fromString=function(t,e){return new gTt(t).fromString(e)},[sTt,oTt,lTt,cTt,hTt,uTt,dTt,pTt].forEach((function(t){dpt(fTt,t)})),gTt.types=fTt.types,gTt.properties=fTt.properties,gTt.propertyGroups=fTt.propertyGroups,gTt.propertyGroupNames=fTt.propertyGroupNames,gTt.propertyGroupKeys=fTt.propertyGroupKeys;var mTt={style:s((function(t){t&&this.setStyle(t).update();return this._private.style}),"style"),setStyle:s((function(t){var e=this._private;return Zdt(t)?e.style=t.generateStyle(this):Udt(t)?e.style=gTt.fromJson(this,t):Fdt(t)?e.style=gTt.fromString(this,t):e.style=gTt(this),e.style}),"setStyle"),updateStyle:s((function(){this.mutableElements().updateStyle()}),"updateStyle")},yTt={autolock:s((function(t){return void 0===t?this._private.autolock:(this._private.autolock=!!t,this)}),"autolock"),autoungrabify:s((function(t){return void 0===t?this._private.autoungrabify:(this._private.autoungrabify=!!t,this)}),"autoungrabify"),autounselectify:s((function(t){return void 0===t?this._private.autounselectify:(this._private.autounselectify=!!t,this)}),"autounselectify"),selectionType:s((function(t){var e=this._private;return null==e.selectionType&&(e.selectionType="single"),void 0===t?e.selectionType:("additive"!==t&&"single"!==t||(e.selectionType=t),this)}),"selectionType"),panningEnabled:s((function(t){return void 0===t?this._private.panningEnabled:(this._private.panningEnabled=!!t,this)}),"panningEnabled"),userPanningEnabled:s((function(t){return void 0===t?this._private.userPanningEnabled:(this._private.userPanningEnabled=!!t,this)}),"userPanningEnabled"),zoomingEnabled:s((function(t){return void 0===t?this._private.zoomingEnabled:(this._private.zoomingEnabled=!!t,this)}),"zoomingEnabled"),userZoomingEnabled:s((function(t){return void 0===t?this._private.userZoomingEnabled:(this._private.userZoomingEnabled=!!t,this)}),"userZoomingEnabled"),boxSelectionEnabled:s((function(t){return void 0===t?this._private.boxSelectionEnabled:(this._private.boxSelectionEnabled=!!t,this)}),"boxSelectionEnabled"),pan:s((function(){var t,e,n,r,i,a=arguments,s=this._private.pan;switch(a.length){case 0:return s;case 1:if(Fdt(a[0]))return s[t=a[0]];if(Gdt(a[0])){if(!this._private.panningEnabled)return this;r=(n=a[0]).x,i=n.y,jdt(r)&&(s.x=r),jdt(i)&&(s.y=i),this.emit("pan viewport")}break;case 2:if(!this._private.panningEnabled)return this;t=a[0],e=a[1],"x"!==t&&"y"!==t||!jdt(e)||(s[t]=e),this.emit("pan viewport")}return this.notify("viewport"),this}),"pan"),panBy:s((function(t,e){var n,r,i,a,s,o=arguments,l=this._private.pan;if(!this._private.panningEnabled)return this;switch(o.length){case 1:Gdt(t)&&(a=(i=o[0]).x,s=i.y,jdt(a)&&(l.x+=a),jdt(s)&&(l.y+=s),this.emit("pan viewport"));break;case 2:r=e,"x"!==(n=t)&&"y"!==n||!jdt(r)||(l[n]+=r),this.emit("pan viewport")}return this.notify("viewport"),this}),"panBy"),fit:s((function(t,e){var n=this.getFitViewport(t,e);if(n){var r=this._private;r.zoom=n.zoom,r.pan=n.pan,this.emit("pan zoom viewport"),this.notify("viewport")}return this}),"fit"),getFitViewport:s((function(t,e){if(jdt(t)&&void 0===e&&(e=t,t=void 0),this._private.panningEnabled&&this._private.zoomingEnabled){var n;if(Fdt(t)){var r=t;t=this.$(r)}else if(ept(t)){var i=t;(n={x1:i.x1,y1:i.y1,x2:i.x2,y2:i.y2}).w=n.x2-n.x1,n.h=n.y2-n.y1}else Hdt(t)||(t=this.mutableElements());if(!Hdt(t)||!t.empty()){n=n||t.boundingBox();var a,s=this.width(),o=this.height();if(e=jdt(e)?e:0,!isNaN(s)&&!isNaN(o)&&s>0&&o>0&&!isNaN(n.w)&&!isNaN(n.h)&&n.w>0&&n.h>0)return{zoom:a=(a=(a=Math.min((s-2*e)/n.w,(o-2*e)/n.h))>this._private.maxZoom?this._private.maxZoom:a)<this._private.minZoom?this._private.minZoom:a,pan:{x:(s-a*(n.x1+n.x2))/2,y:(o-a*(n.y1+n.y2))/2}}}}}),"getFitViewport"),zoomRange:s((function(t,e){var n=this._private;if(null==e){var r=t;t=r.min,e=r.max}return jdt(t)&&jdt(e)&&t<=e?(n.minZoom=t,n.maxZoom=e):jdt(t)&&void 0===e&&t<=n.maxZoom?n.minZoom=t:jdt(e)&&void 0===t&&e>=n.minZoom&&(n.maxZoom=e),this}),"zoomRange"),minZoom:s((function(t){return void 0===t?this._private.minZoom:this.zoomRange({min:t})}),"minZoom"),maxZoom:s((function(t){return void 0===t?this._private.maxZoom:this.zoomRange({max:t})}),"maxZoom"),getZoomedViewport:s((function(t){var e,n,r=this._private,i=r.pan,a=r.zoom,s=!1;if(r.zoomingEnabled||(s=!0),jdt(t)?n=t:Gdt(t)&&(n=t.level,null!=t.position?e=fft(t.position,a,i):null!=t.renderedPosition&&(e=t.renderedPosition),null==e||r.panningEnabled||(s=!0)),n=(n=n>r.maxZoom?r.maxZoom:n)<r.minZoom?r.minZoom:n,s||!jdt(n)||n===a||null!=e&&(!jdt(e.x)||!jdt(e.y)))return null;if(null!=e){var o=i,l=a,c=n;return{zoomed:!0,panned:!0,zoom:c,pan:{x:-c/l*(e.x-o.x)+e.x,y:-c/l*(e.y-o.y)+e.y}}}return{zoomed:!0,panned:!1,zoom:n,pan:i}}),"getZoomedViewport"),zoom:s((function(t){if(void 0===t)return this._private.zoom;var e=this.getZoomedViewport(t),n=this._private;return null!=e&&e.zoomed?(n.zoom=e.zoom,e.panned&&(n.pan.x=e.pan.x,n.pan.y=e.pan.y),this.emit("zoom"+(e.panned?" pan":"")+" viewport"),this.notify("viewport"),this):this}),"zoom"),viewport:s((function(t){var e=this._private,n=!0,r=!0,i=[],a=!1,s=!1;if(!t)return this;if(jdt(t.zoom)||(n=!1),Gdt(t.pan)||(r=!1),!n&&!r)return this;if(n){var o=t.zoom;o<e.minZoom||o>e.maxZoom||!e.zoomingEnabled?a=!0:(e.zoom=o,i.push("zoom"))}if(r&&(!a||!t.cancelOnFailedZoom)&&e.panningEnabled){var l=t.pan;jdt(l.x)&&(e.pan.x=l.x,s=!1),jdt(l.y)&&(e.pan.y=l.y,s=!1),s||i.push("pan")}return i.length>0&&(i.push("viewport"),this.emit(i.join(" ")),this.notify("viewport")),this}),"viewport"),center:s((function(t){var e=this.getCenterPan(t);return e&&(this._private.pan=e,this.emit("pan viewport"),this.notify("viewport")),this}),"center"),getCenterPan:s((function(t,e){if(this._private.panningEnabled){if(Fdt(t)){var n=t;t=this.mutableElements().filter(n)}else Hdt(t)||(t=this.mutableElements());if(0!==t.length){var r=t.boundingBox(),i=this.width(),a=this.height();return{x:(i-(e=void 0===e?this._private.zoom:e)*(r.x1+r.x2))/2,y:(a-e*(r.y1+r.y2))/2}}}}),"getCenterPan"),reset:s((function(){return this._private.panningEnabled&&this._private.zoomingEnabled?(this.viewport({pan:{x:0,y:0},zoom:1}),this):this}),"reset"),invalidateSize:s((function(){this._private.sizeCache=null}),"invalidateSize"),size:s((function(){var t,e,n=this._private,r=n.container,i=this;return n.sizeCache=n.sizeCache||(r?(t=i.window().getComputedStyle(r),e=s((function(e){return parseFloat(t.getPropertyValue(e))}),"val"),{width:r.clientWidth-e("padding-left")-e("padding-right"),height:r.clientHeight-e("padding-top")-e("padding-bottom")}):{width:1,height:1})}),"size"),width:s((function(){return this.size().width}),"width"),height:s((function(){return this.size().height}),"height"),extent:s((function(){var t=this._private.pan,e=this._private.zoom,n=this.renderedExtent(),r={x1:(n.x1-t.x)/e,x2:(n.x2-t.x)/e,y1:(n.y1-t.y)/e,y2:(n.y2-t.y)/e};return r.w=r.x2-r.x1,r.h=r.y2-r.y1,r}),"extent"),renderedExtent:s((function(){var t=this.width(),e=this.height();return{x1:0,y1:0,x2:t,y2:e,w:t,h:e}}),"renderedExtent"),multiClickDebounceTime:s((function(t){return t?(this._private.multiClickDebounceTime=t,this):this._private.multiClickDebounceTime}),"multiClickDebounceTime")};yTt.centre=yTt.center,yTt.autolockNodes=yTt.autolock,yTt.autoungrabifyNodes=yTt.autoungrabify;var vTt={data:ibt.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeData:ibt.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),scratch:ibt.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:ibt.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0})};vTt.attr=vTt.data,vTt.removeAttr=vTt.removeData;var xTt=s((function(t){var e=this,n=(t=dpt({},t)).container;n&&!Wdt(n)&&Wdt(n[0])&&(n=n[0]);var r=n?n._cyreg:null;(r=r||{})&&r.cy&&(r.cy.destroy(),r={});var i=r.readies=r.readies||[];n&&(n._cyreg=r),r.cy=e;var a=void 0!==Mdt&&void 0!==n&&!t.headless,o=t;o.layout=dpt({name:a?"grid":"null"},o.layout),o.renderer=dpt({name:a?"canvas":"null"},o.renderer);var l=s((function(t,e,n){return void 0!==e?e:void 0!==n?n:t}),"defVal"),c=this._private={container:n,ready:!1,options:o,elements:new Pkt(this),listeners:[],aniEles:new Pkt(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:void 0===o.styleEnabled?a:o.styleEnabled,zoom:jdt(o.zoom)?o.zoom:1,pan:{x:Gdt(o.pan)&&jdt(o.pan.x)?o.pan.x:0,y:Gdt(o.pan)&&jdt(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=s((function(t,e){if(t.some(npt))return Yyt.all(t).then(e);e(t)}),"loadExtData");c.styleEnabled&&e.setStyle([]);var u=dpt({},o,o.renderer);e.initRenderer(u);var d=s((function(t,n,r){e.notifications(!1);var i=e.mutableElements();i.length>0&&i.remove(),null!=t&&(Gdt(t)||Udt(t))&&e.add(t),e.one("layoutready",(function(t){e.notifications(!0),e.emit(t),e.one("load",n),e.emitAndNotify("load")})).one("layoutstop",(function(){e.one("done",r),e.emit("done")}));var a=dpt({},e._private.options.layout);a.eles=e.elements(),e.layout(a).run()}),"setElesAndLayout");h([o.style,o.elements],(function(t){var n=t[0],a=t[1];c.styleEnabled&&e.style().append(n),d(a,(function(){e.startAnimationLoop(),c.ready=!0,zdt(o.ready)&&e.on("ready",o.ready);for(var t=0;t<i.length;t++){var n=i[t];e.on("ready",n)}r&&(r.readies=[]),e.emit("ready")}),o.done)}))}),"Core"),bTt=xTt.prototype;dpt(bTt,{instanceString:s((function(){return"core"}),"instanceString"),isReady:s((function(){return this._private.ready}),"isReady"),destroyed:s((function(){return this._private.destroyed}),"destroyed"),ready:s((function(t){return this.isReady()?this.emitter().emit("ready",[],t):this.on("ready",t),this}),"ready"),destroy:s((function(){var t=this;if(!t.destroyed())return t.stopAnimationLoop(),t.destroyRenderer(),this.emit("destroy"),t._private.destroyed=!0,t}),"destroy"),hasElementWithId:s((function(t){return this._private.elements.hasElementWithId(t)}),"hasElementWithId"),getElementById:s((function(t){return this._private.elements.getElementById(t)}),"getElementById"),hasCompoundNodes:s((function(){return this._private.hasCompoundNodes}),"hasCompoundNodes"),headless:s((function(){return this._private.renderer.isHeadless()}),"headless"),styleEnabled:s((function(){return this._private.styleEnabled}),"styleEnabled"),addToPool:s((function(t){return this._private.elements.merge(t),this}),"addToPool"),removeFromPool:s((function(t){return this._private.elements.unmerge(t),this}),"removeFromPool"),container:s((function(){return this._private.container||null}),"container"),window:s((function(){if(null==this._private.container)return Mdt;var t=this._private.container.ownerDocument;return void 0===t||null==t?Mdt:t.defaultView||Mdt}),"window"),mount:s((function(t){if(null!=t){var e=this,n=e._private,r=n.options;return!Wdt(t)&&Wdt(t[0])&&(t=t[0]),e.stopAnimationLoop(),e.destroyRenderer(),n.container=t,n.styleEnabled=!0,e.invalidateSize(),e.initRenderer(dpt({},r,r.renderer,{name:"null"===r.renderer.name?"canvas":r.renderer.name})),e.startAnimationLoop(),e.style(r.style),e.emit("mount"),e}}),"mount"),unmount:s((function(){var t=this;return t.stopAnimationLoop(),t.destroyRenderer(),t.initRenderer({name:"null"}),t.emit("unmount"),t}),"unmount"),options:s((function(){return Pgt(this._private.options)}),"options"),json:s((function(t){var e=this,n=e._private,r=e.mutableElements(),i=s((function(t){return e.getElementById(t.id())}),"getFreshRef");if(Gdt(t)){if(e.startBatch(),t.elements){var a={},o=s((function(t,n){for(var r=[],i=[],s=0;s<t.length;s++){var o=t[s];if(o.data.id){var l=""+o.data.id,c=e.getElementById(l);a[l]=!0,0!==c.length?i.push({ele:c,json:o}):n?(o.group=n,r.push(o)):r.push(o)}else Dgt("cy.json() cannot handle elements without an ID attribute")}e.add(r);for(var h=0;h<i.length;h++){var u=i[h],d=u.ele,p=u.json;d.json(p)}}),"updateEles");if(Udt(t.elements))o(t.elements);else for(var l=["nodes","edges"],c=0;c<l.length;c++){var h=l[c],u=t.elements[h];Udt(u)&&o(u,h)}var d=e.collection();r.filter((function(t){return!a[t.id()]})).forEach((function(t){t.isParent()?d.merge(t):t.remove()})),d.forEach((function(t){return t.children().move({parent:null})})),d.forEach((function(t){return i(t).remove()}))}t.style&&e.style(t.style),null!=t.zoom&&t.zoom!==n.zoom&&e.zoom(t.zoom),t.pan&&(t.pan.x===n.pan.x&&t.pan.y===n.pan.y||e.pan(t.pan)),t.data&&e.data(t.data);for(var p=["minZoom","maxZoom","zoomingEnabled","userZoomingEnabled","panningEnabled","userPanningEnabled","boxSelectionEnabled","autolock","autoungrabify","autounselectify","multiClickDebounceTime"],g=0;g<p.length;g++){var f=p[g];null!=t[f]&&e[f](t[f])}return e.endBatch(),this}var m={};!!t?m.elements=this.elements().map((function(t){return t.json()})):(m.elements={},r.forEach((function(t){var e=t.group();m.elements[e]||(m.elements[e]=[]),m.elements[e].push(t.json())}))),this._private.styleEnabled&&(m.style=e.style().json()),m.data=Pgt(e.data());var y=n.options;return m.zoomingEnabled=n.zoomingEnabled,m.userZoomingEnabled=n.userZoomingEnabled,m.zoom=n.zoom,m.minZoom=n.minZoom,m.maxZoom=n.maxZoom,m.panningEnabled=n.panningEnabled,m.userPanningEnabled=n.userPanningEnabled,m.pan=Pgt(n.pan),m.boxSelectionEnabled=n.boxSelectionEnabled,m.renderer=Pgt(y.renderer),m.hideEdgesOnViewport=y.hideEdgesOnViewport,m.textureOnViewport=y.textureOnViewport,m.wheelSensitivity=y.wheelSensitivity,m.motionBlur=y.motionBlur,m.multiClickDebounceTime=y.multiClickDebounceTime,m}),"json")}),bTt.$id=bTt.getElementById,[$kt,Kkt,Jkt,tTt,eTt,nTt,iTt,aTt,mTt,yTt,vTt].forEach((function(t){dpt(bTt,t)}));var wTt={fit:!0,directed:!1,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:s((function(t,e){return!0}),"animateFilter"),ready:void 0,stop:void 0,transform:s((function(t,e){return e}),"transform")},kTt={maximal:!1,acyclic:!1},TTt=s((function(t){return t.scratch("breadthfirst")}),"getInfo"),_Tt=s((function(t,e){return t.scratch("breadthfirst",e)}),"setInfo");function ETt(t){this.options=dpt({},wTt,kTt,t)}s(ETt,"BreadthFirstLayout"),ETt.prototype.run=function(){var t,e=this.options,n=e,r=e.cy,i=n.eles,a=i.nodes().filter((function(t){return!t.isParent()})),o=i,l=n.directed,c=n.acyclic||n.maximal||n.maximalAdjustments>0,h=Rft(n.boundingBox?n.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()});if(Hdt(n.roots))t=n.roots;else if(Udt(n.roots)){for(var u=[],d=0;d<n.roots.length;d++){var p=n.roots[d],g=r.getElementById(p);u.push(g)}t=r.collection(u)}else if(Fdt(n.roots))t=r.$(n.roots);else if(l)t=a.roots();else{var f=i.components();t=r.collection();for(var m=s((function(e){var n=f[e],r=n.maxDegree(!1),i=n.filter((function(t){return t.degree(!1)===r}));t=t.add(i)}),"_loop"),y=0;y<f.length;y++)m(y)}var v=[],x={},b=s((function(t,e){null==v[e]&&(v[e]=[]);var n=v[e].length;v[e].push(t),_Tt(t,{index:n,depth:e})}),"addToDepth"),w=s((function(t,e){var n=TTt(t),r=n.depth,i=n.index;v[r][i]=null,b(t,e)}),"changeDepth");o.bfs({roots:t,directed:n.directed,visit:s((function(t,e,n,r,i){var a=t[0],s=a.id();b(a,i),x[s]=!0}),"visit")});for(var k=[],T=0;T<a.length;T++){var _=a[T];x[_.id()]||k.push(_)}var E=s((function(t){for(var e=v[t],n=0;n<e.length;n++){var r=e[n];null!=r?_Tt(r,{depth:t,index:n}):(e.splice(n,1),n--)}}),"assignDepthsAt"),C=s((function(){for(var t=0;t<v.length;t++)E(t)}),"assignDepths"),S=s((function(t,e){for(var r=TTt(t),a=t.incomers().filter((function(t){return t.isNode()&&i.has(t)})),s=-1,o=t.id(),l=0;l<a.length;l++){var c=a[l],h=TTt(c);s=Math.max(s,h.depth)}if(r.depth<=s){if(!n.acyclic&&e[o])return null;var u=s+1;return w(t,u),e[o]=u,!0}return!1}),"adjustMaximally");if(l&&c){var A=[],L={},N=s((function(t){return A.push(t)}),"enqueue"),I=s((function(){return A.shift()}),"dequeue");for(a.forEach((function(t){return A.push(t)}));A.length>0;){var M=I(),R=S(M,L);if(R)M.outgoers().filter((function(t){return t.isNode()&&i.has(t)})).forEach(N);else if(null===R){Dgt("Detected double maximal shift for node `"+M.id()+"`. Bailing maximal adjustment due to cycle. Use `options.maximal: true` only on DAGs.");break}}}C();var D=0;if(n.avoidOverlap)for(var O=0;O<a.length;O++){var P=a[O].layoutDimensions(n),B=P.w,$=P.h;D=Math.max(D,B,$)}var F={},z=s((function(t){if(F[t.id()])return F[t.id()];for(var e=TTt(t).depth,n=t.neighborhood(),r=0,i=0,s=0;s<n.length;s++){var o=n[s];if(!o.isEdge()&&!o.isParent()&&a.has(o)){var l=TTt(o);if(null!=l){var c=l.index,h=l.depth;if(null!=c&&null!=h){var u=v[h].length;h<e&&(r+=c/u,i++)}}}}return r/=i=Math.max(1,i),0===i&&(r=0),F[t.id()]=r,r}),"getWeightedPercent"),U=s((function(t,e){var n=z(t)-z(e);return 0===n?hpt(t.id(),e.id()):n}),"sortFn");void 0!==n.depthSort&&(U=n.depthSort);for(var G=0;G<v.length;G++)v[G].sort(U),E(G);for(var q=[],j=0;j<k.length;j++)q.push(k[j]);v.unshift(q),C();for(var Y=0,W=0;W<v.length;W++)Y=Math.max(v[W].length,Y);var H=h.x1+h.w/2,V=h.x1+h.h/2,X=v.reduce((function(t,e){return Math.max(t,e.length)}),0),K=s((function(t){var e=TTt(t),r=e.depth,i=e.index,a=v[r].length,s=Math.max(h.w/((n.grid?X:a)+1),D),o=Math.max(h.h/(v.length+1),D),l=Math.min(h.w/2/v.length,h.h/2/v.length);if(l=Math.max(l,D),n.circle){var c=l*r+l-(v.length>0&&v[0].length<=3?l/2:0),u=2*Math.PI/v[r].length*i;return 0===r&&1===v[0].length&&(c=1),{x:H+c*Math.cos(u),y:V+c*Math.sin(u)}}return{x:H+(i+1-(a+1)/2)*s,y:(r+1)*o}}),"getPosition");return i.nodes().layoutPositions(this,n,K),this};var CTt={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,radius:void 0,startAngle:1.5*Math.PI,sweep:void 0,clockwise:!0,sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:s((function(t,e){return!0}),"animateFilter"),ready:void 0,stop:void 0,transform:s((function(t,e){return e}),"transform")};function STt(t){this.options=dpt({},CTt,t)}s(STt,"CircleLayout"),STt.prototype.run=function(){var t=this.options,e=t,n=t.cy,r=e.eles,i=void 0!==e.counterclockwise?!e.counterclockwise:e.clockwise,a=r.nodes().not(":parent");e.sort&&(a=a.sort(e.sort));for(var o,l=Rft(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()}),c=l.x1+l.w/2,h=l.y1+l.h/2,u=(void 0===e.sweep?2*Math.PI-2*Math.PI/a.length:e.sweep)/Math.max(1,a.length-1),d=0,p=0;p<a.length;p++){var g=a[p].layoutDimensions(e),f=g.w,m=g.h;d=Math.max(d,f,m)}if(o=jdt(e.radius)?e.radius:a.length<=1?0:Math.min(l.h,l.w)/2-d,a.length>1&&e.avoidOverlap){d*=1.75;var y=Math.cos(u)-Math.cos(0),v=Math.sin(u)-Math.sin(0),x=Math.sqrt(d*d/(y*y+v*v));o=Math.max(x,o)}var b=s((function(t,n){var r=e.startAngle+n*u*(i?1:-1),a=o*Math.cos(r),s=o*Math.sin(r);return{x:c+a,y:h+s}}),"getPos");return r.nodes().layoutPositions(this,e,b),this};var ATt,LTt={fit:!0,padding:30,startAngle:1.5*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:s((function(t){return t.degree()}),"concentric"),levelWidth:s((function(t){return t.maxDegree()/4}),"levelWidth"),animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:s((function(t,e){return!0}),"animateFilter"),ready:void 0,stop:void 0,transform:s((function(t,e){return e}),"transform")};function NTt(t){this.options=dpt({},LTt,t)}s(NTt,"ConcentricLayout"),NTt.prototype.run=function(){for(var t=this.options,e=t,n=void 0!==e.counterclockwise?!e.counterclockwise:e.clockwise,r=t.cy,i=e.eles,a=i.nodes().not(":parent"),s=Rft(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()}),o=s.x1+s.w/2,l=s.y1+s.h/2,c=[],h=0,u=0;u<a.length;u++){var d,p=a[u];d=e.concentric(p),c.push({value:d,node:p}),p._private.scratch.concentric=d}a.updateStyle();for(var g=0;g<a.length;g++){var f=a[g].layoutDimensions(e);h=Math.max(h,f.w,f.h)}c.sort((function(t,e){return e.value-t.value}));for(var m=e.levelWidth(a),y=[[]],v=y[0],x=0;x<c.length;x++){var b=c[x];if(v.length>0)Math.abs(v[0].value-b.value)>=m&&(v=[],y.push(v));v.push(b)}var w=h+e.minNodeSpacing;if(!e.avoidOverlap){var k=y.length>0&&y[0].length>1,T=(Math.min(s.w,s.h)/2-w)/(y.length+k?1:0);w=Math.min(w,T)}for(var _=0,E=0;E<y.length;E++){var C=y[E],S=void 0===e.sweep?2*Math.PI-2*Math.PI/C.length:e.sweep,A=C.dTheta=S/Math.max(1,C.length-1);if(C.length>1&&e.avoidOverlap){var L=Math.cos(A)-Math.cos(0),N=Math.sin(A)-Math.sin(0),I=Math.sqrt(w*w/(L*L+N*N));_=Math.max(I,_)}C.r=_,_+=w}if(e.equidistant){for(var M=0,R=0,D=0;D<y.length;D++){var O=y[D].r-R;M=Math.max(M,O)}R=0;for(var P=0;P<y.length;P++){var B=y[P];0===P&&(R=B.r),B.r=R,R+=M}}for(var $={},F=0;F<y.length;F++)for(var z=y[F],U=z.dTheta,G=z.r,q=0;q<z.length;q++){var j=z[q],Y=e.startAngle+(n?1:-1)*U*q,W={x:o+G*Math.cos(Y),y:l+G*Math.sin(Y)};$[j.node.id()]=W}return i.nodes().layoutPositions(this,e,(function(t){var e=t.id();return $[e]})),this};var ITt={ready:s((function(){}),"ready"),stop:s((function(){}),"stop"),animate:!0,animationEasing:void 0,animationDuration:void 0,animateFilter:s((function(t,e){return!0}),"animateFilter"),animationThreshold:250,refresh:20,fit:!0,padding:30,boundingBox:void 0,nodeDimensionsIncludeLabels:!1,randomize:!1,componentSpacing:40,nodeRepulsion:s((function(t){return 2048}),"nodeRepulsion"),nodeOverlap:4,idealEdgeLength:s((function(t){return 32}),"idealEdgeLength"),edgeElasticity:s((function(t){return 32}),"edgeElasticity"),nestingFactor:1.2,gravity:1,numIter:1e3,initialTemp:1e3,coolingFactor:.99,minTemp:1};function MTt(t){this.options=dpt({},ITt,t),this.options.layout=this;var e=this.options.eles.nodes(),n=this.options.eles.edges().filter((function(t){var n=t.source().data("id"),r=t.target().data("id"),i=e.some((function(t){return t.data("id")===n})),a=e.some((function(t){return t.data("id")===r}));return!i||!a}));this.options.eles=this.options.eles.not(n)}s(MTt,"CoseLayout"),MTt.prototype.run=function(){var t=this.options,e=t.cy,n=this;n.stopped=!1,!0!==t.animate&&!1!==t.animate||n.emit({type:"layoutstart",layout:n}),ATt=!0===t.debug;var r=RTt(e,n,t);ATt&&undefined(r),t.randomize&&PTt(r);var i=dgt(),a=s((function(){$Tt(r,e,t),!0===t.fit&&e.fit(t.padding)}),"refresh"),o=s((function(e){return!(n.stopped||e>=t.numIter)&&(FTt(r,t),r.temperature=r.temperature*t.coolingFactor,!(r.temperature<t.minTemp))}),"mainLoop"),l=s((function(){if(!0===t.animate||!1===t.animate)a(),n.one("layoutstop",t.stop),n.emit({type:"layoutstop",layout:n});else{var e=t.eles.nodes(),i=BTt(r,t,e);e.layoutPositions(n,t,i)}}),"done"),c=0,h=!0;if(!0===t.animate){var u=s((function e(){for(var n=0;h&&n<t.refresh;)h=o(c),c++,n++;h?(dgt()-i>=t.animationThreshold&&a(),ugt(e)):(ZTt(r,t),l())}),"frame");u()}else{for(;h;)h=o(c),c++;ZTt(r,t),l()}return this},MTt.prototype.stop=function(){return this.stopped=!0,this.thread&&this.thread.stop(),this.emit("layoutstop"),this},MTt.prototype.destroy=function(){return this.thread&&this.thread.stop(),this};var RTt=s((function(t,e,n){for(var r=n.eles.edges(),i=n.eles.nodes(),a=Rft(n.boundingBox?n.boundingBox:{x1:0,y1:0,w:t.width(),h:t.height()}),s={isCompound:t.hasCompoundNodes(),layoutNodes:[],idToIndex:{},nodeSize:i.size(),graphSet:[],indexToGraph:[],layoutEdges:[],edgeSize:r.size(),temperature:n.initialTemp,clientWidth:a.w,clientHeight:a.h,boundingBox:a},o=n.eles.components(),l={},c=0;c<o.length;c++)for(var h=o[c],u=0;u<h.length;u++){l[h[u].id()]=c}for(c=0;c<s.nodeSize;c++){var d=(y=i[c]).layoutDimensions(n);(R={}).isLocked=y.locked(),R.id=y.data("id"),R.parentId=y.data("parent"),R.cmptId=l[y.id()],R.children=[],R.positionX=y.position("x"),R.positionY=y.position("y"),R.offsetX=0,R.offsetY=0,R.height=d.w,R.width=d.h,R.maxX=R.positionX+R.width/2,R.minX=R.positionX-R.width/2,R.maxY=R.positionY+R.height/2,R.minY=R.positionY-R.height/2,R.padLeft=parseFloat(y.style("padding")),R.padRight=parseFloat(y.style("padding")),R.padTop=parseFloat(y.style("padding")),R.padBottom=parseFloat(y.style("padding")),R.nodeRepulsion=zdt(n.nodeRepulsion)?n.nodeRepulsion(y):n.nodeRepulsion,s.layoutNodes.push(R),s.idToIndex[R.id]=c}var p=[],g=0,f=-1,m=[];for(c=0;c<s.nodeSize;c++){var y,v=(y=s.layoutNodes[c]).parentId;null!=v?s.layoutNodes[s.idToIndex[v]].children.push(y.id):(p[++f]=y.id,m.push(y.id))}for(s.graphSet.push(m);g<=f;){var x=p[g++],b=s.idToIndex[x],w=s.layoutNodes[b].children;if(w.length>0){s.graphSet.push(w);for(c=0;c<w.length;c++)p[++f]=w[c]}}for(c=0;c<s.graphSet.length;c++){var k=s.graphSet[c];for(u=0;u<k.length;u++){var T=s.idToIndex[k[u]];s.indexToGraph[T]=c}}for(c=0;c<s.edgeSize;c++){var _=r[c],E={};E.id=_.data("id"),E.sourceId=_.data("source"),E.targetId=_.data("target");var C=zdt(n.idealEdgeLength)?n.idealEdgeLength(_):n.idealEdgeLength,S=zdt(n.edgeElasticity)?n.edgeElasticity(_):n.edgeElasticity,A=s.idToIndex[E.sourceId],L=s.idToIndex[E.targetId];if(s.indexToGraph[A]!=s.indexToGraph[L]){for(var N=DTt(E.sourceId,E.targetId,s),I=s.graphSet[N],M=0,R=s.layoutNodes[A];-1===I.indexOf(R.id);)R=s.layoutNodes[s.idToIndex[R.parentId]],M++;for(R=s.layoutNodes[L];-1===I.indexOf(R.id);)R=s.layoutNodes[s.idToIndex[R.parentId]],M++;C*=M*n.nestingFactor}E.idealLength=C,E.elasticity=S,s.layoutEdges.push(E)}return s}),"createLayoutInfo"),DTt=s((function(t,e,n){var r=OTt(t,e,0,n);return 2>r.count?0:r.graph}),"findLCA"),OTt=s((function t(e,n,r,i){var a=i.graphSet[r];if(-1<a.indexOf(e)&&-1<a.indexOf(n))return{count:2,graph:r};for(var s=0,o=0;o<a.length;o++){var l=a[o],c=i.idToIndex[l],h=i.layoutNodes[c].children;if(0!==h.length){var u=t(e,n,i.indexToGraph[i.idToIndex[h[0]]],i);if(0!==u.count){if(1!==u.count)return u;if(2===++s)break}}}return{count:s,graph:r}}),"findLCA_aux"),PTt=s((function(t,e){for(var n=t.clientWidth,r=t.clientHeight,i=0;i<t.nodeSize;i++){var a=t.layoutNodes[i];0!==a.children.length||a.isLocked||(a.positionX=Math.random()*n,a.positionY=Math.random()*r)}}),"randomizePositions"),BTt=s((function(t,e,n){var r=t.boundingBox,i={x1:1/0,x2:-1/0,y1:1/0,y2:-1/0};return e.boundingBox&&(n.forEach((function(e){var n=t.layoutNodes[t.idToIndex[e.data("id")]];i.x1=Math.min(i.x1,n.positionX),i.x2=Math.max(i.x2,n.positionX),i.y1=Math.min(i.y1,n.positionY),i.y2=Math.max(i.y2,n.positionY)})),i.w=i.x2-i.x1,i.h=i.y2-i.y1),function(n,a){var s=t.layoutNodes[t.idToIndex[n.data("id")]];if(e.boundingBox){var o=(s.positionX-i.x1)/i.w,l=(s.positionY-i.y1)/i.h;return{x:r.x1+o*r.w,y:r.y1+l*r.h}}return{x:s.positionX,y:s.positionY}}}),"getScaleInBoundsFn"),$Tt=s((function(t,e,n){var r=n.layout,i=n.eles.nodes(),a=BTt(t,n,i);i.positions(a),!0!==t.ready&&(t.ready=!0,r.one("layoutready",n.ready),r.emit({type:"layoutready",layout:this}))}),"refreshPositions"),FTt=s((function(t,e,n){zTt(t,e),YTt(t),WTt(t,e),HTt(t),VTt(t)}),"step"),zTt=s((function(t,e){for(var n=0;n<t.graphSet.length;n++)for(var r=t.graphSet[n],i=r.length,a=0;a<i;a++)for(var s=t.layoutNodes[t.idToIndex[r[a]]],o=a+1;o<i;o++){var l=t.layoutNodes[t.idToIndex[r[o]]];GTt(s,l,t,e)}}),"calculateNodeForces"),UTt=s((function(t){return-t+2*t*Math.random()}),"randomDistance"),GTt=s((function(t,e,n,r){if(t.cmptId===e.cmptId||n.isCompound){var i=e.positionX-t.positionX,a=e.positionY-t.positionY;0===i&&0===a&&(i=UTt(1),a=UTt(1));var s=qTt(t,e,i,a);if(s>0)var o=(c=r.nodeOverlap*s)*i/(f=Math.sqrt(i*i+a*a)),l=c*a/f;else{var c,h=jTt(t,i,a),u=jTt(e,-1*i,-1*a),d=u.x-h.x,p=u.y-h.y,g=d*d+p*p,f=Math.sqrt(g);o=(c=(t.nodeRepulsion+e.nodeRepulsion)/g)*d/f,l=c*p/f}t.isLocked||(t.offsetX-=o,t.offsetY-=l),e.isLocked||(e.offsetX+=o,e.offsetY+=l)}}),"nodeRepulsion"),qTt=s((function(t,e,n,r){if(n>0)var i=t.maxX-e.minX;else i=e.maxX-t.minX;if(r>0)var a=t.maxY-e.minY;else a=e.maxY-t.minY;return i>=0&&a>=0?Math.sqrt(i*i+a*a):0}),"nodesOverlap"),jTt=s((function(t,e,n){var r=t.positionX,i=t.positionY,a=t.height||1,s=t.width||1,o=n/e,l=a/s,c={};return 0===e&&0<n||0===e&&0>n?(c.x=r,c.y=i+a/2,c):0<e&&-1*l<=o&&o<=l?(c.x=r+s/2,c.y=i+s*n/2/e,c):0>e&&-1*l<=o&&o<=l?(c.x=r-s/2,c.y=i-s*n/2/e,c):0<n&&(o<=-1*l||o>=l)?(c.x=r+a*e/2/n,c.y=i+a/2,c):0>n&&(o<=-1*l||o>=l)?(c.x=r-a*e/2/n,c.y=i-a/2,c):c}),"findClippingPoint"),YTt=s((function(t,e){for(var n=0;n<t.edgeSize;n++){var r=t.layoutEdges[n],i=t.idToIndex[r.sourceId],a=t.layoutNodes[i],s=t.idToIndex[r.targetId],o=t.layoutNodes[s],l=o.positionX-a.positionX,c=o.positionY-a.positionY;if(0!==l||0!==c){var h=jTt(a,l,c),u=jTt(o,-1*l,-1*c),d=u.x-h.x,p=u.y-h.y,g=Math.sqrt(d*d+p*p),f=Math.pow(r.idealLength-g,2)/r.elasticity;if(0!==g)var m=f*d/g,y=f*p/g;else m=0,y=0;a.isLocked||(a.offsetX+=m,a.offsetY+=y),o.isLocked||(o.offsetX-=m,o.offsetY-=y)}}}),"calculateEdgeForces"),WTt=s((function(t,e){if(0!==e.gravity)for(var n=0;n<t.graphSet.length;n++){var r=t.graphSet[n],i=r.length;if(0===n)var a=t.clientHeight/2,s=t.clientWidth/2;else{var o=t.layoutNodes[t.idToIndex[r[0]]],l=t.layoutNodes[t.idToIndex[o.parentId]];a=l.positionX,s=l.positionY}for(var c=0;c<i;c++){var h=t.layoutNodes[t.idToIndex[r[c]]];if(!h.isLocked){var u=a-h.positionX,d=s-h.positionY,p=Math.sqrt(u*u+d*d);if(p>1){var g=e.gravity*u/p,f=e.gravity*d/p;h.offsetX+=g,h.offsetY+=f}}}}}),"calculateGravityForces"),HTt=s((function(t,e){var n=[],r=0,i=-1;for(n.push.apply(n,t.graphSet[0]),i+=t.graphSet[0].length;r<=i;){var a=n[r++],s=t.idToIndex[a],o=t.layoutNodes[s],l=o.children;if(0<l.length&&!o.isLocked){for(var c=o.offsetX,h=o.offsetY,u=0;u<l.length;u++){var d=t.layoutNodes[t.idToIndex[l[u]]];d.offsetX+=c,d.offsetY+=h,n[++i]=l[u]}o.offsetX=0,o.offsetY=0}}}),"propagateForces"),VTt=s((function(t,e){for(var n=0;n<t.nodeSize;n++){0<(i=t.layoutNodes[n]).children.length&&(i.maxX=void 0,i.minX=void 0,i.maxY=void 0,i.minY=void 0)}for(n=0;n<t.nodeSize;n++){if(!(0<(i=t.layoutNodes[n]).children.length||i.isLocked)){var r=XTt(i.offsetX,i.offsetY,t.temperature);i.positionX+=r.x,i.positionY+=r.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,KTt(i,t)}}for(n=0;n<t.nodeSize;n++){var i;0<(i=t.layoutNodes[n]).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)}}),"updatePositions"),XTt=s((function(t,e,n){var r=Math.sqrt(t*t+e*e);if(r>n)var i={x:n*t/r,y:n*e/r};else i={x:t,y:e};return i}),"limitForce"),KTt=s((function t(e,n){var r=e.parentId;if(null!=r){var i=n.layoutNodes[n.idToIndex[r]],a=!1;return(null==i.maxX||e.maxX+i.padRight>i.maxX)&&(i.maxX=e.maxX+i.padRight,a=!0),(null==i.minX||e.minX-i.padLeft<i.minX)&&(i.minX=e.minX-i.padLeft,a=!0),(null==i.maxY||e.maxY+i.padBottom>i.maxY)&&(i.maxY=e.maxY+i.padBottom,a=!0),(null==i.minY||e.minY-i.padTop<i.minY)&&(i.minY=e.minY-i.padTop,a=!0),a?t(i,n):void 0}}),"updateAncestryBoundaries"),ZTt=s((function(t,e){for(var n=t.layoutNodes,r=[],i=0;i<n.length;i++){var a=n[i],s=a.cmptId;(r[s]=r[s]||[]).push(a)}var o=0;for(i=0;i<r.length;i++){if(f=r[i]){f.x1=1/0,f.x2=-1/0,f.y1=1/0,f.y2=-1/0;for(var l=0;l<f.length;l++){var c=f[l];f.x1=Math.min(f.x1,c.positionX-c.width/2),f.x2=Math.max(f.x2,c.positionX+c.width/2),f.y1=Math.min(f.y1,c.positionY-c.height/2),f.y2=Math.max(f.y2,c.positionY+c.height/2)}f.w=f.x2-f.x1,f.h=f.y2-f.y1,o+=f.w*f.h}}r.sort((function(t,e){return e.w*e.h-t.w*t.h}));var h=0,u=0,d=0,p=0,g=Math.sqrt(o)*t.clientWidth/t.clientHeight;for(i=0;i<r.length;i++){var f;if(f=r[i]){for(l=0;l<f.length;l++){(c=f[l]).isLocked||(c.positionX+=h-f.x1,c.positionY+=u-f.y1)}h+=f.w+e.componentSpacing,d+=f.w+e.componentSpacing,p=Math.max(p,f.h),d>g&&(u+=p+e.componentSpacing,h=0,d=0,p=0)}}}),"separateComponents"),QTt={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:s((function(t){}),"position"),sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:s((function(t,e){return!0}),"animateFilter"),ready:void 0,stop:void 0,transform:s((function(t,e){return e}),"transform")};function JTt(t){this.options=dpt({},QTt,t)}s(JTt,"GridLayout"),JTt.prototype.run=function(){var t=this.options,e=t,n=t.cy,r=e.eles,i=r.nodes().not(":parent");e.sort&&(i=i.sort(e.sort));var a=Rft(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()});if(0===a.h||0===a.w)r.nodes().layoutPositions(this,e,(function(t){return{x:a.x1,y:a.y1}}));else{var o=i.size(),l=Math.sqrt(o*a.h/a.w),c=Math.round(l),h=Math.round(a.w/a.h*l),u=s((function(t){if(null==t)return Math.min(c,h);Math.min(c,h)==c?c=t:h=t}),"small"),d=s((function(t){if(null==t)return Math.max(c,h);Math.max(c,h)==c?c=t:h=t}),"large"),p=e.rows,g=null!=e.cols?e.cols:e.columns;if(null!=p&&null!=g)c=p,h=g;else if(null!=p&&null==g)c=p,h=Math.ceil(o/c);else if(null==p&&null!=g)h=g,c=Math.ceil(o/h);else if(h*c>o){var f=u(),m=d();(f-1)*m>=o?u(f-1):(m-1)*f>=o&&d(m-1)}else for(;h*c<o;){var y=u(),v=d();(v+1)*y>=o?d(v+1):u(y+1)}var x=a.w/h,b=a.h/c;if(e.condense&&(x=0,b=0),e.avoidOverlap)for(var w=0;w<i.length;w++){var k=i[w],T=k._private.position;null!=T.x&&null!=T.y||(T.x=0,T.y=0);var _=k.layoutDimensions(e),E=e.avoidOverlapPadding,C=_.w+E,S=_.h+E;x=Math.max(x,C),b=Math.max(b,S)}for(var A={},L=s((function(t,e){return!!A["c-"+t+"-"+e]}),"used"),N=s((function(t,e){A["c-"+t+"-"+e]=!0}),"use"),I=0,M=0,R=s((function(){++M>=h&&(M=0,I++)}),"moveToNextCell"),D={},O=0;O<i.length;O++){var P=i[O],B=e.position(P);if(B&&(void 0!==B.row||void 0!==B.col)){var $={row:B.row,col:B.col};if(void 0===$.col)for($.col=0;L($.row,$.col);)$.col++;else if(void 0===$.row)for($.row=0;L($.row,$.col);)$.row++;D[P.id()]=$,N($.row,$.col)}}var F=s((function(t,e){var n,r;if(t.locked()||t.isParent())return!1;var i=D[t.id()];if(i)n=i.col*x+x/2+a.x1,r=i.row*b+b/2+a.y1;else{for(;L(I,M);)R();n=M*x+x/2+a.x1,r=I*b+b/2+a.y1,N(I,M),R()}return{x:n,y:r}}),"getPos");i.layoutPositions(this,e,F)}return this};var t_t={ready:s((function(){}),"ready"),stop:s((function(){}),"stop")};function e_t(t){this.options=dpt({},t_t,t)}s(e_t,"NullLayout"),e_t.prototype.run=function(){var t=this.options,e=t.eles,n=this;return t.cy,n.emit("layoutstart"),e.nodes().positions((function(){return{x:0,y:0}})),n.one("layoutready",t.ready),n.emit("layoutready"),n.one("layoutstop",t.stop),n.emit("layoutstop"),this},e_t.prototype.stop=function(){return this};var n_t={positions:void 0,zoom:void 0,pan:void 0,fit:!0,padding:30,spacingFactor:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:s((function(t,e){return!0}),"animateFilter"),ready:void 0,stop:void 0,transform:s((function(t,e){return e}),"transform")};function r_t(t){this.options=dpt({},n_t,t)}s(r_t,"PresetLayout"),r_t.prototype.run=function(){var t=this.options,e=t.eles.nodes(),n=zdt(t.positions);function r(e){if(null==t.positions)return gft(e.position());if(n)return t.positions(e);var r=t.positions[e._private.data.id];return null==r?null:r}return s(r,"getPosition"),e.layoutPositions(this,t,(function(t,e){var n=r(t);return!t.locked()&&null!=n&&n})),this};var i_t={fit:!0,padding:30,boundingBox:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:s((function(t,e){return!0}),"animateFilter"),ready:void 0,stop:void 0,transform:s((function(t,e){return e}),"transform")};function a_t(t){this.options=dpt({},i_t,t)}s(a_t,"RandomLayout"),a_t.prototype.run=function(){var t=this.options,e=t.cy,n=t.eles,r=Rft(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:e.width(),h:e.height()}),i=s((function(t,e){return{x:r.x1+Math.round(Math.random()*r.w),y:r.y1+Math.round(Math.random()*r.h)}}),"getPos");return n.nodes().layoutPositions(this,t,i),this};var s_t=[{name:"breadthfirst",impl:ETt},{name:"circle",impl:STt},{name:"concentric",impl:NTt},{name:"cose",impl:MTt},{name:"grid",impl:JTt},{name:"null",impl:e_t},{name:"preset",impl:r_t},{name:"random",impl:a_t}];function o_t(t){this.options=t,this.notifications=0}s(o_t,"NullRenderer");var l_t=s((function(){}),"noop"),c_t=s((function(){throw new Error("A headless instance can not render images")}),"throwImgErr");o_t.prototype={recalculateRenderedStyle:l_t,notify:s((function(){this.notifications++}),"notify"),init:l_t,isHeadless:s((function(){return!0}),"isHeadless"),png:c_t,jpg:c_t};var h_t,u_t,d_t={arrowShapeWidth:.3,registerArrowShapes:function(){var t=this.arrowShapes={},e=this,n=s((function(t,e,n,r,i,a,s){var o=i.x-n/2-s,l=i.x+n/2+s,c=i.y-n/2-s,h=i.y+n/2+s;return o<=t&&t<=l&&c<=e&&e<=h}),"bbCollide"),r=s((function(t,e,n,r,i){var a=t*Math.cos(r)-e*Math.sin(r),s=(t*Math.sin(r)+e*Math.cos(r))*n;return{x:a*n+i.x,y:s+i.y}}),"transform"),i=s((function(t,e,n,i){for(var a=[],s=0;s<t.length;s+=2){var o=t[s],l=t[s+1];a.push(r(o,l,e,n,i))}return a}),"transformPoints"),a=s((function(t){for(var e=[],n=0;n<t.length;n++){var r=t[n];e.push(r.x,r.y)}return e}),"pointsToArr"),o=s((function(t){return t.pstyle("width").pfValue*t.pstyle("arrow-scale").pfValue*2}),"standardGap"),l=s((function(r,l){Fdt(l)&&(l=t[l]),t[r]=dpt({name:r,points:[-.15,-.3,.15,-.3,.15,.3,-.15,.3],collide:s((function(t,e,n,r,s,o){var l=a(i(this.points,n+2*o,r,s));return Jft(t,e,l)}),"collide"),roughCollide:n,draw:s((function(t,n,r,a){var s=i(this.points,n,r,a);e.arrowShapeImpl("polygon")(t,s)}),"draw"),spacing:s((function(t){return 0}),"spacing"),gap:o},l)}),"defineArrowShape");l("none",{collide:Lgt,roughCollide:Lgt,draw:Igt,spacing:Ngt,gap:Ngt}),l("triangle",{points:[-.15,-.3,0,0,.15,-.3]}),l("arrow","triangle"),l("triangle-backcurve",{points:t.triangle.points,controlPoint:[0,-.15],roughCollide:n,draw:s((function(t,n,a,s,o){var l=i(this.points,n,a,s),c=this.controlPoint,h=r(c[0],c[1],n,a,s);e.arrowShapeImpl(this.name)(t,l,h)}),"draw"),gap:s((function(t){return.8*o(t)}),"gap")}),l("triangle-tee",{points:[0,0,.15,-.3,-.15,-.3,0,0],pointsTee:[-.15,-.4,-.15,-.5,.15,-.5,.15,-.4],collide:s((function(t,e,n,r,s,o,l){var c=a(i(this.points,n+2*l,r,s)),h=a(i(this.pointsTee,n+2*l,r,s));return Jft(t,e,c)||Jft(t,e,h)}),"collide"),draw:s((function(t,n,r,a,s){var o=i(this.points,n,r,a),l=i(this.pointsTee,n,r,a);e.arrowShapeImpl(this.name)(t,o,l)}),"draw")}),l("circle-triangle",{radius:.15,pointsTr:[0,-.15,.15,-.45,-.15,-.45,0,-.15],collide:s((function(t,e,n,r,s,o,l){var c=s,h=Math.pow(c.x-t,2)+Math.pow(c.y-e,2)<=Math.pow((n+2*l)*this.radius,2),u=a(i(this.points,n+2*l,r,s));return Jft(t,e,u)||h}),"collide"),draw:s((function(t,n,r,a,s){var o=i(this.pointsTr,n,r,a);e.arrowShapeImpl(this.name)(t,o,a.x,a.y,this.radius*n)}),"draw"),spacing:s((function(t){return e.getArrowWidth(t.pstyle("width").pfValue,t.pstyle("arrow-scale").value)*this.radius}),"spacing")}),l("triangle-cross",{points:[0,0,.15,-.3,-.15,-.3,0,0],baseCrossLinePts:[-.15,-.4,-.15,-.4,.15,-.4,.15,-.4],crossLinePts:s((function(t,e){var n=this.baseCrossLinePts.slice(),r=e/t;return n[3]=n[3]-r,n[5]=n[5]-r,n}),"crossLinePts"),collide:s((function(t,e,n,r,s,o,l){var c=a(i(this.points,n+2*l,r,s)),h=a(i(this.crossLinePts(n,o),n+2*l,r,s));return Jft(t,e,c)||Jft(t,e,h)}),"collide"),draw:s((function(t,n,r,a,s){var o=i(this.points,n,r,a),l=i(this.crossLinePts(n,s),n,r,a);e.arrowShapeImpl(this.name)(t,o,l)}),"draw")}),l("vee",{points:[-.15,-.3,0,0,.15,-.3,0,-.15],gap:s((function(t){return.525*o(t)}),"gap")}),l("circle",{radius:.15,collide:s((function(t,e,n,r,i,a,s){var o=i;return Math.pow(o.x-t,2)+Math.pow(o.y-e,2)<=Math.pow((n+2*s)*this.radius,2)}),"collide"),draw:s((function(t,n,r,i,a){e.arrowShapeImpl(this.name)(t,i.x,i.y,this.radius*n)}),"draw"),spacing:s((function(t){return e.getArrowWidth(t.pstyle("width").pfValue,t.pstyle("arrow-scale").value)*this.radius}),"spacing")}),l("tee",{points:[-.15,0,-.15,-.1,.15,-.1,.15,0],spacing:s((function(t){return 1}),"spacing"),gap:s((function(t){return 1}),"gap")}),l("square",{points:[-.15,0,.15,0,.15,-.3,-.15,-.3]}),l("diamond",{points:[-.15,-.15,0,-.3,.15,-.15,0,0],gap:s((function(t){return t.pstyle("width").pfValue*t.pstyle("arrow-scale").value}),"gap")}),l("chevron",{points:[0,0,-.15,-.15,-.1,-.2,0,-.1,.1,-.2,.15,-.15],gap:s((function(t){return.95*t.pstyle("width").pfValue*t.pstyle("arrow-scale").value}),"gap")})}},p_t={projectIntoViewport:function(t,e){var n=this.cy,r=this.findContainerClientCoords(),i=r[0],a=r[1],s=r[4],o=n.pan(),l=n.zoom();return[((t-i)/s-o.x)/l,((e-a)/s-o.y)/l]},findContainerClientCoords:function(){if(this.containerBB)return this.containerBB;var t=this.container,e=t.getBoundingClientRect(),n=this.cy.window().getComputedStyle(t),r=s((function(t){return parseFloat(n.getPropertyValue(t))}),"styleValue"),i=r("padding-left"),a=r("padding-right"),o=r("padding-top"),l=r("padding-bottom"),c=r("border-left-width"),h=r("border-right-width"),u=r("border-top-width"),d=(r("border-bottom-width"),t.clientWidth),p=t.clientHeight,g=i+a,f=o+l,m=c+h,y=e.width/(d+m),v=d-g,x=p-f,b=e.left+i+c,w=e.top+o+u;return this.containerBB=[b,w,v,x,y]},invalidateContainerClientCoordsCache:function(){this.containerBB=null},findNearestElement:function(t,e,n,r){return this.findNearestElements(t,e,n,r)[0]},findNearestElements:function(t,e,n,r){var i,a,o=this,l=this,c=l.getCachedZSortedEles(),h=[],u=l.cy.zoom(),d=l.cy.hasCompoundNodes(),p=(r?24:8)/u,g=(r?8:2)/u,f=(r?8:2)/u,m=1/0;function y(t,e){if(t.isNode()){if(a)return;a=t,h.push(t)}if(t.isEdge()&&(null==e||e<m))if(i){if(i.pstyle("z-compound-depth").value===t.pstyle("z-compound-depth").value&&i.pstyle("z-compound-depth").value===t.pstyle("z-compound-depth").value)for(var n=0;n<h.length;n++)if(h[n].isEdge()){h[n]=t,i=t,m=null!=e?e:m;break}}else h.push(t),i=t,m=null!=e?e:m}function v(n){var r=n.outerWidth()+2*g,i=n.outerHeight()+2*g,a=r/2,s=i/2,c=n.position(),h="auto"===n.pstyle("corner-radius").value?"auto":n.pstyle("corner-radius").pfValue,u=n._private.rscratch;if(c.x-a<=t&&t<=c.x+a&&c.y-s<=e&&e<=c.y+s&&l.nodeShapes[o.getNodeShape(n)].checkPoint(t,e,0,r,i,c.x,c.y,h,u))return y(n,0),!0}function x(n){var r,i=n._private,a=i.rscratch,s=n.pstyle("width").pfValue,c=n.pstyle("arrow-scale").value,u=s/2+p,g=u*u,f=2*u,m=i.source,x=i.target;if("segments"===a.edgeType||"straight"===a.edgeType||"haystack"===a.edgeType){for(var b=a.allpts,w=0;w+3<b.length;w+=2)if(Hft(t,e,b[w],b[w+1],b[w+2],b[w+3],f)&&g>(r=Qft(t,e,b[w],b[w+1],b[w+2],b[w+3])))return y(n,r),!0}else if("bezier"===a.edgeType||"multibezier"===a.edgeType||"self"===a.edgeType||"compound"===a.edgeType)for(b=a.allpts,w=0;w+5<a.allpts.length;w+=4)if(Vft(t,e,b[w],b[w+1],b[w+2],b[w+3],b[w+4],b[w+5],f)&&g>(r=Zft(t,e,b[w],b[w+1],b[w+2],b[w+3],b[w+4],b[w+5])))return y(n,r),!0;m=m||i.source,x=x||i.target;var k=o.getArrowWidth(s,c),T=[{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}];for(w=0;w<T.length;w++){var _=T[w],E=l.arrowShapes[n.pstyle(_.name+"-arrow-shape").value],C=n.pstyle("width").pfValue;if(E.roughCollide(t,e,k,_.angle,{x:_.x,y:_.y},C,p)&&E.collide(t,e,k,_.angle,{x:_.x,y:_.y},C,p))return y(n),!0}d&&h.length>0&&(v(m),v(x))}function b(t,e,n){return Ygt(t,e,n)}function w(n,r){var i,a=n._private,o=f;i=r?r+"-":"",n.boundingBox();var l=a.labelBounds[r||"main"],c=n.pstyle(i+"label").value;if("yes"===n.pstyle("text-events").strValue&&c){var h=b(a.rscratch,"labelX",r),u=b(a.rscratch,"labelY",r),d=b(a.rscratch,"labelAngle",r),p=n.pstyle(i+"text-margin-x").pfValue,g=n.pstyle(i+"text-margin-y").pfValue,m=l.x1-o-p,v=l.x2+o-p,x=l.y1-o-g,w=l.y2+o-g;if(d){var k=Math.cos(d),T=Math.sin(d),_=s((function(t,e){return{x:(t-=h)*k-(e-=u)*T+h,y:t*T+e*k+u}}),"rotate"),E=_(m,x),C=_(m,w),S=_(v,x),A=_(v,w),L=[E.x+p,E.y+g,S.x+p,S.y+g,A.x+p,A.y+g,C.x+p,C.y+g];if(Jft(t,e,L))return y(n),!0}else if(qft(l,t,e))return y(n),!0}}n&&(c=c.interactive),s(y,"addEle"),s(v,"checkNode"),s(x,"checkEdge"),s(b,"preprop"),s(w,"checkLabel");for(var k=c.length-1;k>=0;k--){var T=c[k];T.isNode()?v(T)||w(T):x(T)||w(T)||w(T,"source")||w(T,"target")}return h},getAllInBox:function(t,e,n,r){for(var i=this.getCachedZSortedEles().interactive,a=[],s=Math.min(t,n),o=Math.max(t,n),l=Math.min(e,r),c=Math.max(e,r),h=Rft({x1:t=s,y1:e=l,x2:n=o,y2:r=c}),u=0;u<i.length;u++){var d=i[u];if(d.isNode()){var p=d,g=p.boundingBox({includeNodes:!0,includeEdges:!1,includeLabels:!1});Gft(h,g)&&!Yft(g,h)&&a.push(p)}else{var f=d,m=f._private,y=m.rscratch;if(null!=y.startX&&null!=y.startY&&!qft(h,y.startX,y.startY))continue;if(null!=y.endX&&null!=y.endY&&!qft(h,y.endX,y.endY))continue;if("bezier"===y.edgeType||"multibezier"===y.edgeType||"self"===y.edgeType||"compound"===y.edgeType||"segments"===y.edgeType||"haystack"===y.edgeType){for(var v=m.rstyle.bezierPts||m.rstyle.linePts||m.rstyle.haystackPts,x=!0,b=0;b<v.length;b++)if(!jft(h,v[b])){x=!1;break}x&&a.push(f)}else"haystack"!==y.edgeType&&"straight"!==y.edgeType||a.push(f)}}return a}},g_t={};g_t.calculateArrowAngles=function(t){var e,n,r,i,a,s,o=t._private.rscratch,l="haystack"===o.edgeType,c="bezier"===o.edgeType,h="multibezier"===o.edgeType,u="segments"===o.edgeType,d="compound"===o.edgeType,p="self"===o.edgeType;if(l?(r=o.haystackPts[0],i=o.haystackPts[1],a=o.haystackPts[2],s=o.haystackPts[3]):(r=o.arrowStartX,i=o.arrowStartY,a=o.arrowEndX,s=o.arrowEndY),f=o.midX,m=o.midY,u)e=r-o.segpts[0],n=i-o.segpts[1];else if(h||d||p||c){var g=o.allpts;e=r-Lft(g[0],g[2],g[4],.1),n=i-Lft(g[1],g[3],g[5],.1)}else e=r-f,n=i-m;o.srcArrowAngle=Tft(e,n);var f=o.midX,m=o.midY;if(l&&(f=(r+a)/2,m=(i+s)/2),e=a-r,n=s-i,u)if((g=o.allpts).length/2%2==0){var y=(E=g.length/2)-2;e=g[E]-g[y],n=g[E+1]-g[y+1]}else if(o.isRound)e=o.midVector[1],n=-o.midVector[0];else{y=(E=g.length/2-1)-2;e=g[E]-g[y],n=g[E+1]-g[y+1]}else if(h||d||p){var v,x,b,w,g=o.allpts;if(o.ctrlpts.length/2%2==0){var k=(T=(_=g.length/2-1)+2)+2;v=Lft(g[_],g[T],g[k],0),x=Lft(g[_+1],g[T+1],g[k+1],0),b=Lft(g[_],g[T],g[k],1e-4),w=Lft(g[_+1],g[T+1],g[k+1],1e-4)}else{var T,_;k=(T=g.length/2-1)+2;v=Lft(g[_=T-2],g[T],g[k],.4999),x=Lft(g[_+1],g[T+1],g[k+1],.4999),b=Lft(g[_],g[T],g[k],.5),w=Lft(g[_+1],g[T+1],g[k+1],.5)}e=b-v,n=w-x}if(o.midtgtArrowAngle=Tft(e,n),o.midDispX=e,o.midDispY=n,e*=-1,n*=-1,u)if((g=o.allpts).length/2%2==0);else if(!o.isRound){var E,C=(E=g.length/2-1)+2;e=-(g[C]-g[E]),n=-(g[C+1]-g[E+1])}if(o.midsrcArrowAngle=Tft(e,n),u)e=a-o.segpts[o.segpts.length-2],n=s-o.segpts[o.segpts.length-1];else if(h||d||p||c){var S=(g=o.allpts).length;e=a-Lft(g[S-6],g[S-4],g[S-2],.9),n=s-Lft(g[S-5],g[S-3],g[S-1],.9)}else e=a-f,n=s-m;o.tgtArrowAngle=Tft(e,n)},g_t.getArrowWidth=g_t.getArrowHeight=function(t,e){var n=this.arrowWidthCache=this.arrowWidthCache||{},r=n[t+", "+e];return r||(r=Math.max(Math.pow(13.37*t,.9),29)*e,n[t+", "+e]=r,r)};var f_t,m_t,y_t,v_t,x_t,b_t,w_t,k_t,T_t,__t,E_t,C_t,S_t,A_t,L_t,N_t={},I_t={},M_t=s((function(t,e,n){n.x=e.x-t.x,n.y=e.y-t.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)}),"asVec"),R_t=s((function(t,e){e.x=-1*t.x,e.y=-1*t.y,e.nx=-1*t.nx,e.ny=-1*t.ny,e.ang=t.ang>0?-(Math.PI-t.ang):Math.PI+t.ang}),"invertVec"),D_t=s((function(t,e,n,r,i){if(t!==L_t?M_t(e,t,N_t):R_t(I_t,N_t),M_t(e,n,I_t),f_t=N_t.nx*I_t.ny-N_t.ny*I_t.nx,m_t=N_t.nx*I_t.nx-N_t.ny*-I_t.ny,x_t=Math.asin(Math.max(-1,Math.min(1,f_t))),Math.abs(x_t)<1e-6)return h_t=e.x,u_t=e.y,void(w_t=T_t=0);y_t=1,v_t=!1,m_t<0?x_t<0?x_t=Math.PI+x_t:(x_t=Math.PI-x_t,y_t=-1,v_t=!0):x_t>0&&(y_t=-1,v_t=!0),T_t=void 0!==e.radius?e.radius:r,b_t=x_t/2,__t=Math.min(N_t.len/2,I_t.len/2),i?(k_t=Math.abs(Math.cos(b_t)*T_t/Math.sin(b_t)))>__t?(k_t=__t,w_t=Math.abs(k_t*Math.sin(b_t)/Math.cos(b_t))):w_t=T_t:(k_t=Math.min(__t,T_t),w_t=Math.abs(k_t*Math.sin(b_t)/Math.cos(b_t))),S_t=e.x+I_t.nx*k_t,A_t=e.y+I_t.ny*k_t,h_t=S_t-I_t.ny*w_t*y_t,u_t=A_t+I_t.nx*w_t*y_t,E_t=e.x+N_t.nx*k_t,C_t=e.y+N_t.ny*k_t,L_t=e}),"calcCornerArc");function O_t(t,e){0===e.radius?t.lineTo(e.cx,e.cy):t.arc(e.cx,e.cy,e.radius,e.startAngle,e.endAngle,e.counterClockwise)}function P_t(t,e,n,r){var i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];return 0===r||0===e.radius?{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}:(D_t(t,e,n,r,i),{cx:h_t,cy:u_t,radius:w_t,startX:E_t,startY:C_t,stopX:S_t,stopY:A_t,startAngle:N_t.ang+Math.PI/2*y_t,endAngle:I_t.ang-Math.PI/2*y_t,counterClockwise:v_t})}s(O_t,"drawPreparedRoundCorner"),s(P_t,"getRoundCorner");var B_t={};function $_t(t){var e=[];if(null!=t){for(var n=0;n<t.length;n+=2){var r=t[n],i=t[n+1];e.push({x:r,y:i})}return e}}B_t.findMidptPtsEtc=function(t,e){var n,r=e.posPts,i=e.intersectionPts,a=e.vectorNormInverse,o=t.pstyle("source-endpoint"),l=t.pstyle("target-endpoint"),c=null!=o.units&&null!=l.units,h=s((function(t,e,n,r){var i=r-e,a=n-t,s=Math.sqrt(a*a+i*i);return{x:-i/s,y:a/s}}),"recalcVectorNormInverse");switch(t.pstyle("edge-distances").value){case"node-position":n=r;break;case"intersection":n=i;break;case"endpoints":if(c){var u=Edt(this.manualEndptToPx(t.source()[0],o),2),d=u[0],p=u[1],g=Edt(this.manualEndptToPx(t.target()[0],l),2),f=g[0],m=g[1],y={x1:d,y1:p,x2:f,y2:m};a=h(d,p,f,m),n=y}else Dgt("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).")),n=i}return{midptPts:n,vectorNormInverse:a}},B_t.findHaystackPoints=function(t){for(var e=0;e<t.length;e++){var n=t[e],r=n._private,i=r.rscratch;if(!i.haystack){var a=2*Math.random()*Math.PI;i.source={x:Math.cos(a),y:Math.sin(a)},a=2*Math.random()*Math.PI,i.target={x:Math.cos(a),y:Math.sin(a)}}var s=r.source,o=r.target,l=s.position(),c=o.position(),h=s.width(),u=o.width(),d=s.height(),p=o.height(),g=n.pstyle("haystack-radius").value/2;i.haystackPts=i.allpts=[i.source.x*h*g+l.x,i.source.y*d*g+l.y,i.target.x*u*g+c.x,i.target.y*p*g+c.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(n),this.calculateArrowAngles(n),this.recalculateEdgeLabelProjections(n),this.calculateLabelAngles(n)}},B_t.findSegmentsPoints=function(t,e){var n=t._private.rscratch,r=t.pstyle("segment-weights"),i=t.pstyle("segment-distances"),a=t.pstyle("segment-radii"),s=t.pstyle("radius-type"),o=Math.min(r.pfValue.length,i.pfValue.length),l=a.pfValue[a.pfValue.length-1],c=s.pfValue[s.pfValue.length-1];n.edgeType="segments",n.segpts=[],n.radii=[],n.isArcRadius=[];for(var h=0;h<o;h++){var u=r.pfValue[h],d=i.pfValue[h],p=1-u,g=u,f=this.findMidptPtsEtc(t,e),m=f.midptPts,y=f.vectorNormInverse,v={x:m.x1*p+m.x2*g,y:m.y1*p+m.y2*g};n.segpts.push(v.x+y.x*d,v.y+y.y*d),n.radii.push(void 0!==a.pfValue[h]?a.pfValue[h]:l),n.isArcRadius.push("arc-radius"===(void 0!==s.pfValue[h]?s.pfValue[h]:c))}},B_t.findLoopPoints=function(t,e,n,r){var i=t._private.rscratch,a=e.dirCounts,s=e.srcPos,o=t.pstyle("control-point-distances"),l=o?o.pfValue[0]:void 0,c=t.pstyle("loop-direction").pfValue,h=t.pstyle("loop-sweep").pfValue,u=t.pstyle("control-point-step-size").pfValue;i.edgeType="self";var d=n,p=u;r&&(d=0,p=l);var g=c-Math.PI/2,f=g-h/2,m=g+h/2,y=String(c+"_"+h);d=void 0===a[y]?a[y]=0:++a[y],i.ctrlpts=[s.x+1.4*Math.cos(f)*p*(d/3+1),s.y+1.4*Math.sin(f)*p*(d/3+1),s.x+1.4*Math.cos(m)*p*(d/3+1),s.y+1.4*Math.sin(m)*p*(d/3+1)]},B_t.findCompoundLoopPoints=function(t,e,n,r){var i=t._private.rscratch;i.edgeType="compound";var a=e.srcPos,s=e.tgtPos,o=e.srcW,l=e.srcH,c=e.tgtW,h=e.tgtH,u=t.pstyle("control-point-step-size").pfValue,d=t.pstyle("control-point-distances"),p=d?d.pfValue[0]:void 0,g=n,f=u;r&&(g=0,f=p);var m={x:a.x-o/2,y:a.y-l/2},y={x:s.x-c/2,y:s.y-h/2},v={x:Math.min(m.x,y.x),y:Math.min(m.y,y.y)},x=Math.max(.5,Math.log(.01*o)),b=Math.max(.5,Math.log(.01*c));i.ctrlpts=[v.x,v.y-(1+Math.pow(50,1.12)/100)*f*(g/3+1)*x,v.x-(1+Math.pow(50,1.12)/100)*f*(g/3+1)*b,v.y]},B_t.findStraightEdgePoints=function(t){t._private.rscratch.edgeType="straight"},B_t.findBezierPoints=function(t,e,n,r,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"),c=o&&l?Math.min(o.value.length,l.value.length):1,h=o?o.pfValue[0]:void 0,u=l.value[0],d=r;a.edgeType=d?"multibezier":"bezier",a.ctrlpts=[];for(var p=0;p<c;p++){var g=(.5-e.eles.length/2+n)*s*(i?-1:1),f=void 0,m=Eft(g);d&&(h=o?o.pfValue[p]:s,u=l.value[p]);var y=void 0!==(f=r?h:void 0!==h?m*h:void 0)?f:g,v=1-u,x=u,b=this.findMidptPtsEtc(t,e),w=b.midptPts,k=b.vectorNormInverse,T={x:w.x1*v+w.x2*x,y:w.y1*v+w.y2*x};a.ctrlpts.push(T.x+k.x*y,T.y+k.y*y)}},B_t.findTaxiPoints=function(t,e){var n=t._private.rscratch;n.edgeType="segments";var r="vertical",i="horizontal",a="leftward",o="rightward",l="downward",c="upward",h=e.posPts,u=e.srcW,d=e.srcH,p=e.tgtW,g=e.tgtH,f="node-position"!==t.pstyle("edge-distances").value,m=t.pstyle("taxi-direction").value,y=m,v=t.pstyle("taxi-turn"),x="%"===v.units,b=v.pfValue,w=b<0,k=t.pstyle("taxi-turn-min-distance").pfValue,T=f?(u+p)/2:0,_=f?(d+g)/2:0,E=h.x2-h.x1,C=h.y2-h.y1,S=s((function(t,e){return t>0?Math.max(t-e,0):Math.min(t+e,0)}),"subDWH"),A=S(E,T),L=S(C,_),N=!1;"auto"===y?m=Math.abs(A)>Math.abs(L)?i:r:y===c||y===l?(m=r,N=!0):y!==a&&y!==o||(m=i,N=!0);var I,M=m===r,R=M?L:A,D=M?C:E,O=Eft(D),P=!1;(N&&(x||w)||!(y===l&&D<0||y===c&&D>0||y===a&&D>0||y===o&&D<0)||(R=(O*=-1)*Math.abs(R),P=!0),x)?I=(b<0?1+b:b)*R:I=(b<0?R:0)+b*O;var B=s((function(t){return Math.abs(t)<k||Math.abs(t)>=Math.abs(R)}),"getIsTooClose"),$=B(I),F=B(Math.abs(R)-Math.abs(I));if(($||F)&&!P)if(M){var z=Math.abs(D)<=d/2,U=Math.abs(E)<=p/2;if(z){var G=(h.x1+h.x2)/2,q=h.y1,j=h.y2;n.segpts=[G,q,G,j]}else if(U){var Y=(h.y1+h.y2)/2,W=h.x1,H=h.x2;n.segpts=[W,Y,H,Y]}else n.segpts=[h.x1,h.y2]}else{var V=Math.abs(D)<=u/2,X=Math.abs(C)<=g/2;if(V){var K=(h.y1+h.y2)/2,Z=h.x1,Q=h.x2;n.segpts=[Z,K,Q,K]}else if(X){var J=(h.x1+h.x2)/2,tt=h.y1,et=h.y2;n.segpts=[J,tt,J,et]}else n.segpts=[h.x2,h.y1]}else if(M){var nt=h.y1+I+(f?d/2*O:0),rt=h.x1,it=h.x2;n.segpts=[rt,nt,it,nt]}else{var at=h.x1+I+(f?u/2*O:0),st=h.y1,ot=h.y2;n.segpts=[at,st,at,ot]}if(n.isRound){var lt=t.pstyle("taxi-radius").value,ct="arc-radius"===t.pstyle("radius-type").value[0];n.radii=new Array(n.segpts.length/2).fill(lt),n.isArcRadius=new Array(n.segpts.length/2).fill(ct)}},B_t.tryToCorrectInvalidPoints=function(t,e){var n=t._private.rscratch;if("bezier"===n.edgeType){var r=e.srcPos,i=e.tgtPos,a=e.srcW,s=e.srcH,o=e.tgtW,l=e.tgtH,c=e.srcShape,h=e.tgtShape,u=e.srcCornerRadius,d=e.tgtCornerRadius,p=e.srcRs,g=e.tgtRs,f=!jdt(n.startX)||!jdt(n.startY),m=!jdt(n.arrowStartX)||!jdt(n.arrowStartY),y=!jdt(n.endX)||!jdt(n.endY),v=!jdt(n.arrowEndX)||!jdt(n.arrowEndY),x=3*(this.getArrowWidth(t.pstyle("width").pfValue,t.pstyle("arrow-scale").value)*this.arrowShapeWidth),b=Cft({x:n.ctrlpts[0],y:n.ctrlpts[1]},{x:n.startX,y:n.startY}),w=b<x,k=Cft({x:n.ctrlpts[0],y:n.ctrlpts[1]},{x:n.endX,y:n.endY}),T=k<x,_=!1;if(f||m||w){_=!0;var E={x:n.ctrlpts[0]-r.x,y:n.ctrlpts[1]-r.y},C=Math.sqrt(E.x*E.x+E.y*E.y),S={x:E.x/C,y:E.y/C},A=Math.max(a,s),L={x:n.ctrlpts[0]+2*S.x*A,y:n.ctrlpts[1]+2*S.y*A},N=c.intersectLine(r.x,r.y,a,s,L.x,L.y,0,u,p);w?(n.ctrlpts[0]=n.ctrlpts[0]+S.x*(x-b),n.ctrlpts[1]=n.ctrlpts[1]+S.y*(x-b)):(n.ctrlpts[0]=N[0]+S.x*x,n.ctrlpts[1]=N[1]+S.y*x)}if(y||v||T){_=!0;var I={x:n.ctrlpts[0]-i.x,y:n.ctrlpts[1]-i.y},M=Math.sqrt(I.x*I.x+I.y*I.y),R={x:I.x/M,y:I.y/M},D=Math.max(a,s),O={x:n.ctrlpts[0]+2*R.x*D,y:n.ctrlpts[1]+2*R.y*D},P=h.intersectLine(i.x,i.y,o,l,O.x,O.y,0,d,g);T?(n.ctrlpts[0]=n.ctrlpts[0]+R.x*(x-k),n.ctrlpts[1]=n.ctrlpts[1]+R.y*(x-k)):(n.ctrlpts[0]=P[0]+R.x*x,n.ctrlpts[1]=P[1]+R.y*x)}_&&this.findEndpoints(t)}},B_t.storeAllpts=function(t){var e=t._private.rscratch;if("multibezier"===e.edgeType||"bezier"===e.edgeType||"self"===e.edgeType||"compound"===e.edgeType){e.allpts=[],e.allpts.push(e.startX,e.startY);for(var n=0;n+1<e.ctrlpts.length;n+=2)e.allpts.push(e.ctrlpts[n],e.ctrlpts[n+1]),n+3<e.ctrlpts.length&&e.allpts.push((e.ctrlpts[n]+e.ctrlpts[n+2])/2,(e.ctrlpts[n+1]+e.ctrlpts[n+3])/2);var r;e.allpts.push(e.endX,e.endY),e.ctrlpts.length/2%2==0?(r=e.allpts.length/2-1,e.midX=e.allpts[r],e.midY=e.allpts[r+1]):(r=e.allpts.length/2-3,.5,e.midX=Lft(e.allpts[r],e.allpts[r+2],e.allpts[r+4],.5),e.midY=Lft(e.allpts[r+1],e.allpts[r+3],e.allpts[r+5],.5))}else if("straight"===e.edgeType)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("segments"===e.edgeType){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 i=2;i+3<e.allpts.length;i+=2){var a=e.radii[i/2-1],s=e.isArcRadius[i/2-1];e.roundCorners.push(P_t({x:e.allpts[i-2],y:e.allpts[i-1]},{x:e.allpts[i],y:e.allpts[i+1],radius:a},{x:e.allpts[i+2],y:e.allpts[i+3]},a,s))}}if(e.segpts.length%4==0){var o=e.segpts.length/2,l=o-2;e.midX=(e.segpts[l]+e.segpts[o])/2,e.midY=(e.segpts[l+1]+e.segpts[o+1])/2}else{var c=e.segpts.length/2-1;if(e.isRound){var h={x:e.segpts[c],y:e.segpts[c+1]},u=e.roundCorners[c/2],d=[h.x-u.cx,h.y-u.cy],p=u.radius/Math.sqrt(Math.pow(d[0],2)+Math.pow(d[1],2));d=d.map((function(t){return t*p})),e.midX=u.cx+d[0],e.midY=u.cy+d[1],e.midVector=d}else e.midX=e.segpts[c],e.midY=e.segpts[c+1]}}},B_t.checkForInvalidEdgeWarning=function(t){var e=t[0]._private.rscratch;e.nodesOverlap||jdt(e.startX)&&jdt(e.startY)&&jdt(e.endX)&&jdt(e.endY)?e.loggedErr=!1:e.loggedErr||(e.loggedErr=!0,Dgt("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."))},B_t.findEdgeControlPoints=function(t){var e=this;if(t&&0!==t.length){for(var n=this,r=n.cy.hasCompoundNodes(),i={map:new Hgt,get:s((function(t){var e=this.map.get(t[0]);return null!=e?e.get(t[1]):null}),"get"),set:s((function(t,e){var n=this.map.get(t[0]);null==n&&(n=new Hgt,this.map.set(t[0],n)),n.set(t[1],e)}),"set")},a=[],o=[],l=0;l<t.length;l++){var c=t[l],h=c._private,u=c.pstyle("curve-style").value;if(!c.removed()&&c.takesUpSpace())if("haystack"!==u){var d="unbundled-bezier"===u||u.endsWith("segments")||"straight"===u||"straight-triangle"===u||u.endsWith("taxi"),p="unbundled-bezier"===u||"bezier"===u,g=h.source,f=h.target,m=[g.poolIndex(),f.poolIndex()].sort(),y=i.get(m);null==y&&(y={eles:[]},i.set(m,y),a.push(m)),y.eles.push(c),d&&(y.hasUnbundled=!0),p&&(y.hasBezier=!0)}else o.push(c)}for(var v=s((function(t){var s=a[t],o=i.get(s),l=void 0;if(!o.hasUnbundled){var c=o.eles[0].parallelEdges().filter((function(t){return t.isBundledBezier()}));qgt(o.eles),c.forEach((function(t){return o.eles.push(t)})),o.eles.sort((function(t,e){return t.poolIndex()-e.poolIndex()}))}var h=o.eles[0],u=h.source(),d=h.target();if(u.poolIndex()>d.poolIndex()){var p=u;u=d,d=p}var g=o.srcPos=u.position(),f=o.tgtPos=d.position(),m=o.srcW=u.outerWidth(),y=o.srcH=u.outerHeight(),v=o.tgtW=d.outerWidth(),x=o.tgtH=d.outerHeight(),b=o.srcShape=n.nodeShapes[e.getNodeShape(u)],w=o.tgtShape=n.nodeShapes[e.getNodeShape(d)],k=o.srcCornerRadius="auto"===u.pstyle("corner-radius").value?"auto":u.pstyle("corner-radius").pfValue,T=o.tgtCornerRadius="auto"===d.pstyle("corner-radius").value?"auto":d.pstyle("corner-radius").pfValue,_=o.tgtRs=d._private.rscratch,E=o.srcRs=u._private.rscratch;o.dirCounts={north:0,west:0,south:0,east:0,northwest:0,southwest:0,northeast:0,southeast:0};for(var C=0;C<o.eles.length;C++){var S=o.eles[C],A=S[0]._private.rscratch,L=S.pstyle("curve-style").value,N="unbundled-bezier"===L||L.endsWith("segments")||L.endsWith("taxi"),I=!u.same(S.source());if(!o.calculatedIntersection&&u!==d&&(o.hasBezier||o.hasUnbundled)){o.calculatedIntersection=!0;var M=b.intersectLine(g.x,g.y,m,y,f.x,f.y,0,k,E),R=o.srcIntn=M,D=w.intersectLine(f.x,f.y,v,x,g.x,g.y,0,T,_),O=o.tgtIntn=D,P=o.intersectionPts={x1:M[0],x2:D[0],y1:M[1],y2:D[1]},B=o.posPts={x1:g.x,x2:f.x,y1:g.y,y2:f.y},$=D[1]-M[1],F=D[0]-M[0],z=Math.sqrt(F*F+$*$),U=o.vector={x:F,y:$},G=o.vectorNorm={x:U.x/z,y:U.y/z},q={x:-G.y,y:G.x};o.nodesOverlap=!jdt(z)||w.checkPoint(M[0],M[1],0,v,x,f.x,f.y,T,_)||b.checkPoint(D[0],D[1],0,m,y,g.x,g.y,k,E),o.vectorNormInverse=q,l={nodesOverlap:o.nodesOverlap,dirCounts:o.dirCounts,calculatedIntersection:!0,hasBezier:o.hasBezier,hasUnbundled:o.hasUnbundled,eles:o.eles,srcPos:f,tgtPos:g,srcW:v,srcH:x,tgtW:m,tgtH:y,srcIntn:O,tgtIntn:R,srcShape:w,tgtShape:b,posPts:{x1:B.x2,y1:B.y2,x2:B.x1,y2:B.y1},intersectionPts:{x1:P.x2,y1:P.y2,x2:P.x1,y2:P.y1},vector:{x:-U.x,y:-U.y},vectorNorm:{x:-G.x,y:-G.y},vectorNormInverse:{x:-q.x,y:-q.y}}}var j=I?l:o;A.nodesOverlap=j.nodesOverlap,A.srcIntn=j.srcIntn,A.tgtIntn=j.tgtIntn,A.isRound=L.startsWith("round"),r&&(u.isParent()||u.isChild()||d.isParent()||d.isChild())&&(u.parents().anySame(d)||d.parents().anySame(u)||u.same(d)&&u.isParent())?e.findCompoundLoopPoints(S,j,C,N):u===d?e.findLoopPoints(S,j,C,N):L.endsWith("segments")?e.findSegmentsPoints(S,j):L.endsWith("taxi")?e.findTaxiPoints(S,j):"straight"===L||!N&&o.eles.length%2==1&&C===Math.floor(o.eles.length/2)?e.findStraightEdgePoints(S):e.findBezierPoints(S,j,C,N,I),e.findEndpoints(S),e.tryToCorrectInvalidPoints(S,j),e.checkForInvalidEdgeWarning(S),e.storeAllpts(S),e.storeEdgeProjections(S),e.calculateArrowAngles(S),e.recalculateEdgeLabelProjections(S),e.calculateLabelAngles(S)}}),"_loop"),x=0;x<a.length;x++)v(x);this.findHaystackPoints(o)}},s($_t,"getPts"),B_t.getSegmentPoints=function(t){var e=t[0]._private.rscratch;if("segments"===e.edgeType)return this.recalculateRenderedStyle(t),$_t(e.segpts)},B_t.getControlPoints=function(t){var e=t[0]._private.rscratch,n=e.edgeType;if("bezier"===n||"multibezier"===n||"self"===n||"compound"===n)return this.recalculateRenderedStyle(t),$_t(e.ctrlpts)},B_t.getEdgeMidpoint=function(t){var e=t[0]._private.rscratch;return this.recalculateRenderedStyle(t),{x:e.midX,y:e.midY}};var F_t={manualEndptToPx:function(t,e){var n=t.position(),r=t.outerWidth(),i=t.outerHeight(),a=t._private.rscratch;if(2===e.value.length){var s=[e.pfValue[0],e.pfValue[1]];return"%"===e.units[0]&&(s[0]=s[0]*r),"%"===e.units[1]&&(s[1]=s[1]*i),s[0]+=n.x,s[1]+=n.y,s}var o=e.pfValue[0];o=-Math.PI/2+o;var l=2*Math.max(r,i),c=[n.x+Math.cos(o)*l,n.y+Math.sin(o)*l];return this.nodeShapes[this.getNodeShape(t)].intersectLine(n.x,n.y,r,i,c[0],c[1],0,"auto"===t.pstyle("corner-radius").value?"auto":t.pstyle("corner-radius").pfValue,a)},findEndpoints:function(t){var e,n,r,i,a,s=this,o=t.source()[0],l=t.target()[0],c=o.position(),h=l.position(),u=t.pstyle("target-arrow-shape").value,d=t.pstyle("source-arrow-shape").value,p=t.pstyle("target-distance-from-node").pfValue,g=t.pstyle("source-distance-from-node").pfValue,f=o._private.rscratch,m=l._private.rscratch,y=t.pstyle("curve-style").value,v=t._private.rscratch,x=v.edgeType,b="self"===x||"compound"===x,w="bezier"===x||"multibezier"===x||b,k="bezier"!==x,T="straight"===x||"segments"===x,_="segments"===x,E=w||k||T,C=b||"taxi"===y,S=t.pstyle("source-endpoint"),A=C?"outside-to-node":S.value,L="auto"===o.pstyle("corner-radius").value?"auto":o.pstyle("corner-radius").pfValue,N=t.pstyle("target-endpoint"),I=C?"outside-to-node":N.value,M="auto"===l.pstyle("corner-radius").value?"auto":l.pstyle("corner-radius").pfValue;if(v.srcManEndpt=S,v.tgtManEndpt=N,w){var R=[v.ctrlpts[0],v.ctrlpts[1]];n=k?[v.ctrlpts[v.ctrlpts.length-2],v.ctrlpts[v.ctrlpts.length-1]]:R,r=R}else if(T){var D=_?v.segpts.slice(0,2):[h.x,h.y];n=_?v.segpts.slice(v.segpts.length-2):[c.x,c.y],r=D}if("inside-to-node"===I)e=[h.x,h.y];else if(N.units)e=this.manualEndptToPx(l,N);else if("outside-to-line"===I)e=v.tgtIntn;else if("outside-to-node"===I||"outside-to-node-or-label"===I?i=n:"outside-to-line"!==I&&"outside-to-line-or-label"!==I||(i=[c.x,c.y]),e=s.nodeShapes[this.getNodeShape(l)].intersectLine(h.x,h.y,l.outerWidth(),l.outerHeight(),i[0],i[1],0,M,m),"outside-to-node-or-label"===I||"outside-to-line-or-label"===I){var O=l._private.rscratch,P=O.labelWidth,B=O.labelHeight,$=O.labelX,F=O.labelY,z=P/2,U=B/2,G=l.pstyle("text-valign").value;"top"===G?F-=U:"bottom"===G&&(F+=U);var q=l.pstyle("text-halign").value;"left"===q?$-=z:"right"===q&&($+=z);var j=cmt(i[0],i[1],[$-z,F-U,$+z,F-U,$+z,F+U,$-z,F+U],h.x,h.y);if(j.length>0){var Y=c,W=Sft(Y,yft(e)),H=Sft(Y,yft(j)),V=W;if(H<W&&(e=j,V=H),j.length>2)Sft(Y,{x:j[2],y:j[3]})<V&&(e=[j[2],j[3]])}}var X=umt(e,n,s.arrowShapes[u].spacing(t)+p),K=umt(e,n,s.arrowShapes[u].gap(t)+p);if(v.endX=K[0],v.endY=K[1],v.arrowEndX=X[0],v.arrowEndY=X[1],"inside-to-node"===A)e=[c.x,c.y];else if(S.units)e=this.manualEndptToPx(o,S);else if("outside-to-line"===A)e=v.srcIntn;else if("outside-to-node"===A||"outside-to-node-or-label"===A?a=r:"outside-to-line"!==A&&"outside-to-line-or-label"!==A||(a=[h.x,h.y]),e=s.nodeShapes[this.getNodeShape(o)].intersectLine(c.x,c.y,o.outerWidth(),o.outerHeight(),a[0],a[1],0,L,f),"outside-to-node-or-label"===A||"outside-to-line-or-label"===A){var Z=o._private.rscratch,Q=Z.labelWidth,J=Z.labelHeight,tt=Z.labelX,et=Z.labelY,nt=Q/2,rt=J/2,it=o.pstyle("text-valign").value;"top"===it?et-=rt:"bottom"===it&&(et+=rt);var at=o.pstyle("text-halign").value;"left"===at?tt-=nt:"right"===at&&(tt+=nt);var st=cmt(a[0],a[1],[tt-nt,et-rt,tt+nt,et-rt,tt+nt,et+rt,tt-nt,et+rt],c.x,c.y);if(st.length>0){var ot=h,lt=Sft(ot,yft(e)),ct=Sft(ot,yft(st)),ht=lt;if(ct<lt&&(e=[st[0],st[1]],ht=ct),st.length>2)Sft(ot,{x:st[2],y:st[3]})<ht&&(e=[st[2],st[3]])}}var ut=umt(e,r,s.arrowShapes[d].spacing(t)+g),dt=umt(e,r,s.arrowShapes[d].gap(t)+g);v.startX=dt[0],v.startY=dt[1],v.arrowStartX=ut[0],v.arrowStartY=ut[1],E&&(jdt(v.startX)&&jdt(v.startY)&&jdt(v.endX)&&jdt(v.endY)?v.badLine=!1:v.badLine=!0)},getSourceEndpoint:function(t){var e=t[0]._private.rscratch;return this.recalculateRenderedStyle(t),"haystack"===e.edgeType?{x:e.haystackPts[0],y:e.haystackPts[1]}:{x:e.arrowStartX,y:e.arrowStartY}},getTargetEndpoint:function(t){var e=t[0]._private.rscratch;return this.recalculateRenderedStyle(t),"haystack"===e.edgeType?{x:e.haystackPts[2],y:e.haystackPts[3]}:{x:e.arrowEndX,y:e.arrowEndY}}},z_t={};function U_t(t,e,n){for(var r=s((function(t,e,n,r){return Lft(t,e,n,r)}),"qbezierAt$1"),i=e._private.rstyle.bezierPts,a=0;a<t.bezierProjPcts.length;a++){var o=t.bezierProjPcts[a];i.push({x:r(n[0],n[2],n[4],o),y:r(n[1],n[3],n[5],o)})}}s(U_t,"pushBezierPts"),z_t.storeEdgeProjections=function(t){var e=t._private,n=e.rscratch,r=n.edgeType;if(e.rstyle.bezierPts=null,e.rstyle.linePts=null,e.rstyle.haystackPts=null,"multibezier"===r||"bezier"===r||"self"===r||"compound"===r){e.rstyle.bezierPts=[];for(var i=0;i+5<n.allpts.length;i+=4)U_t(this,t,n.allpts.slice(i,i+6))}else if("segments"===r){var a=e.rstyle.linePts=[];for(i=0;i+1<n.allpts.length;i+=2)a.push({x:n.allpts[i],y:n.allpts[i+1]})}else if("haystack"===r){var s=n.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},z_t.recalculateEdgeProjections=function(t){this.findEdgeControlPoints(t)};var G_t={recalculateNodeLabelProjection:function(t){var e=t.pstyle("label").strValue;if(!Jdt(e)){var n,r,i=t._private,a=t.width(),s=t.height(),o=t.padding(),l=t.position(),c=t.pstyle("text-halign").strValue,h=t.pstyle("text-valign").strValue,u=i.rscratch,d=i.rstyle;switch(c){case"left":n=l.x-a/2-o;break;case"right":n=l.x+a/2+o;break;default:n=l.x}switch(h){case"top":r=l.y-s/2-o;break;case"bottom":r=l.y+s/2+o;break;default:r=l.y}u.labelX=n,u.labelY=r,d.labelX=n,d.labelY=r,this.calculateLabelAngles(t),this.applyLabelDimensions(t)}}},q_t=s((function(t,e){var n=Math.atan(e/t);return 0===t&&n<0&&(n*=-1),n}),"lineAngleFromDelta"),j_t=s((function(t,e){var n=e.x-t.x,r=e.y-t.y;return q_t(n,r)}),"lineAngle"),Y_t=s((function(t,e,n,r){var i=Mft(0,r-.001,1),a=Mft(0,r+.001,1),s=Nft(t,e,n,i),o=Nft(t,e,n,a);return j_t(s,o)}),"bezierAngle");G_t.recalculateEdgeLabelProjections=function(t){var e,n=t._private,r=n.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:r.midX,y:r.midY};var o=s((function(t,e,r){Wgt(n.rscratch,t,e,r),Wgt(n.rstyle,t,e,r)}),"setRs");o("labelX",null,e.x),o("labelY",null,e.y);var l=q_t(r.midDispX,r.midDispY);o("labelAutoAngle",null,l);var c=s((function t(){if(t.cache)return t.cache;for(var e=[],a=0;a+5<r.allpts.length;a+=4){var o={x:r.allpts[a],y:r.allpts[a+1]},l={x:r.allpts[a+2],y:r.allpts[a+3]},c={x:r.allpts[a+4],y:r.allpts[a+5]};e.push({p0:o,p1:l,p2:c,startDist:0,length:0,segments:[]})}var h=n.rstyle.bezierPts,u=i.bezierProjPcts.length;function d(t,e,n,r,i){var a=Cft(e,n),s=t.segments[t.segments.length-1],o={p0:e,p1:n,t0:r,t1:i,startDist:s?s.startDist+s.length:0,length:a};t.segments.push(o),t.length+=a}s(d,"addSegment");for(var p=0;p<e.length;p++){var g=e[p],f=e[p-1];f&&(g.startDist=f.startDist+f.length),d(g,g.p0,h[p*u],0,i.bezierProjPcts[0]);for(var m=0;m<u-1;m++)d(g,h[p*u+m],h[p*u+m+1],i.bezierProjPcts[m],i.bezierProjPcts[m+1]);d(g,h[p*u+u-1],g.p2,i.bezierProjPcts[u-1],1)}return t.cache=e}),"createControlPointInfo"),h=s((function(n){var i,s="source"===n;if(a[n]){var l=t.pstyle(n+"-text-offset").pfValue;switch(r.edgeType){case"self":case"compound":case"bezier":case"multibezier":for(var h,u=c(),d=0,p=0,g=0;g<u.length;g++){for(var f=u[s?g:u.length-1-g],m=0;m<f.segments.length;m++){var y=f.segments[s?m:f.segments.length-1-m],v=g===u.length-1&&m===f.segments.length-1;if(d=p,(p+=y.length)>=l||v){h={cp:f,segment:y};break}}if(h)break}var x=h.cp,b=h.segment,w=(l-d)/b.length,k=b.t1-b.t0,T=s?b.t0+k*w:b.t1-k*w;T=Mft(0,T,1),e=Nft(x.p0,x.p1,x.p2,T),i=Y_t(x.p0,x.p1,x.p2,T);break;case"straight":case"segments":case"haystack":for(var _,E,C,S,A=0,L=r.allpts.length,N=0;N+3<L&&(s?(C={x:r.allpts[N],y:r.allpts[N+1]},S={x:r.allpts[N+2],y:r.allpts[N+3]}):(C={x:r.allpts[L-2-N],y:r.allpts[L-1-N]},S={x:r.allpts[L-4-N],y:r.allpts[L-3-N]}),E=A,!((A+=_=Cft(C,S))>=l));N+=2);var I=(l-E)/_;I=Mft(0,I,1),e=Ift(C,S,I),i=j_t(C,S)}o("labelX",n,e.x),o("labelY",n,e.y),o("labelAutoAngle",n,i)}}),"calculateEndProjection");h("source"),h("target"),this.applyLabelDimensions(t)}},G_t.applyLabelDimensions=function(t){this.applyPrefixedLabelDimensions(t),t.isEdge()&&(this.applyPrefixedLabelDimensions(t,"source"),this.applyPrefixedLabelDimensions(t,"target"))},G_t.applyPrefixedLabelDimensions=function(t,e){var n=t._private,r=this.getLabelText(t,e),i=this.calculateLabelDimensions(t,r),a=t.pstyle("line-height").pfValue,s=t.pstyle("text-wrap").strValue,o=Ygt(n.rscratch,"labelWrapCachedLines",e)||[],l="wrap"!==s?1:Math.max(o.length,1),c=i.height/l,h=c*a,u=i.width,d=i.height+(l-1)*(a-1)*c;Wgt(n.rstyle,"labelWidth",e,u),Wgt(n.rscratch,"labelWidth",e,u),Wgt(n.rstyle,"labelHeight",e,d),Wgt(n.rscratch,"labelHeight",e,d),Wgt(n.rscratch,"labelLineHeight",e,h)},G_t.getLabelText=function(t,e){var n=t._private,r=e?e+"-":"",i=t.pstyle(r+"label").strValue,a=t.pstyle("text-transform").value,o=s((function(t,r){return r?(Wgt(n.rscratch,t,e,r),r):Ygt(n.rscratch,t,e)}),"rscratch");if(!i)return"";"none"==a||("uppercase"==a?i=i.toUpperCase():"lowercase"==a&&(i=i.toLowerCase()));var l=t.pstyle("text-wrap").value;if("wrap"===l){var c=o("labelKey");if(null!=c&&o("labelWrapKey")===c)return o("labelWrapCachedText");for(var h=i.split("\n"),u=t.pstyle("text-max-width").pfValue,d="anywhere"===t.pstyle("text-overflow-wrap").value,p=[],g=/[\s\u200b]+|$/g,f=0;f<h.length;f++){var m=h[f],y=this.calculateLabelDimensions(t,m).width;if(d){var v=m.split("").join("​");m=v}if(y>u){var x,b="",w=0,k=Idt(m.matchAll(g));try{for(k.s();!(x=k.n()).done;){var T=x.value,_=T[0],E=m.substring(w,T.index);w=T.index+_.length;var C=0===b.length?E:b+E+_;this.calculateLabelDimensions(t,C).width<=u?b+=E+_:(b&&p.push(b),b=E+_)}}catch(t){k.e(t)}finally{k.f()}b.match(/^[\s\u200b]+$/)||p.push(b)}else p.push(m)}o("labelWrapCachedLines",p),i=o("labelWrapCachedText",p.join("\n")),o("labelWrapKey",c)}else if("ellipsis"===l){var S=t.pstyle("text-max-width").pfValue,A="",L=!1;if(this.calculateLabelDimensions(t,i).width<S)return i;for(var N=0;N<i.length;N++){if(this.calculateLabelDimensions(t,A+i[N]+"…").width>S)break;A+=i[N],N===i.length-1&&(L=!0)}return L||(A+="…"),A}return i},G_t.getLabelJustification=function(t){var e=t.pstyle("text-justification").strValue,n=t.pstyle("text-halign").strValue;if("auto"!==e)return e;if(!t.isNode())return"center";switch(n){case"left":return"right";case"right":return"left";default:return"center"}},G_t.calculateLabelDimensions=function(t,e){var n=this,r=n.cy.window().document,i=wgt(e,t._private.labelDimsKey),a=n.labelDimCache||(n.labelDimCache=[]),s=a[i];if(null!=s)return s;var o=t.pstyle("font-style").strValue,l=t.pstyle("font-size").pfValue,c=t.pstyle("font-family").strValue,h=t.pstyle("font-weight").strValue,u=this.labelCalcCanvas,d=this.labelCalcCanvasContext;if(!u){u=this.labelCalcCanvas=r.createElement("canvas"),d=this.labelCalcCanvasContext=u.getContext("2d");var p=u.style;p.position="absolute",p.left="-9999px",p.top="-9999px",p.zIndex="-1",p.visibility="hidden",p.pointerEvents="none"}d.font="".concat(o," ").concat(h," ").concat(l,"px ").concat(c);for(var g=0,f=0,m=e.split("\n"),y=0;y<m.length;y++){var v=m[y],x=d.measureText(v),b=Math.ceil(x.width),w=l;g=Math.max(b,g),f+=w}return g+=0,f+=0,a[i]={width:g,height:f}},G_t.calculateLabelAngle=function(t,e){var n=t._private.rscratch,r=t.isEdge(),i=e?e+"-":"",a=t.pstyle(i+"text-rotation"),s=a.strValue;return"none"===s?0:r&&"autorotate"===s?n.labelAutoAngle:"autorotate"===s?0:a.pfValue},G_t.calculateLabelAngles=function(t){var e=this,n=t.isEdge(),r=t._private.rscratch;r.labelAngle=e.calculateLabelAngle(t),n&&(r.sourceLabelAngle=e.calculateLabelAngle(t,"source"),r.targetLabelAngle=e.calculateLabelAngle(t,"target"))};var W_t={},H_t=!1;W_t.getNodeShape=function(t){var e=t.pstyle("shape").value;if("cutrectangle"===e&&(t.width()<28||t.height()<28))return H_t||(Dgt("The `cutrectangle` node shape can not be used at small sizes so `rectangle` is used instead"),H_t=!0),"rectangle";if(t.isParent())return"rectangle"===e||"roundrectangle"===e||"round-rectangle"===e||"cutrectangle"===e||"cut-rectangle"===e||"barrel"===e?e:"rectangle";if("polygon"===e){var n=t.pstyle("shape-polygon-points").value;return this.nodeShapes.makePolygon(n).name}return e};var V_t={registerCalculationListeners:function(){var t=this.cy,e=t.collection(),n=this,r=s((function(t){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(e.merge(t),n)for(var r=0;r<t.length;r++){var i=t[r],a=i._private,s=a.rstyle;s.clean=!1,s.cleanConnected=!1}}),"enqueue");n.binder(t).on("bounds.* dirty.*",s((function(t){var e=t.target;r(e)}),"onDirtyBounds")).on("style.* background.*",s((function(t){var e=t.target;r(e,!1)}),"onDirtyStyle"));var i=s((function(i){if(i){var a=n.onUpdateEleCalcsFns;e.cleanStyle();for(var s=0;s<e.length;s++){var o=e[s],l=o._private.rstyle;o.isNode()&&!l.cleanConnected&&(r(o.connectedEdges()),l.cleanConnected=!0)}if(a)for(var c=0;c<a.length;c++){(0,a[c])(i,e)}n.recalculateRenderedStyle(e),e=t.collection()}}),"updateEleCalcs");n.flushRenderedStyleQueue=function(){i(!0)},n.beforeRender(i,n.beforeRenderPriorities.eleCalcs)},onUpdateEleCalcs:function(t){(this.onUpdateEleCalcsFns=this.onUpdateEleCalcsFns||[]).push(t)},recalculateRenderedStyle:function(t,e){var n=s((function(t){return t._private.rstyle.cleanConnected}),"isCleanConnected"),r=[],i=[];if(!this.destroyed){void 0===e&&(e=!0);for(var a=0;a<t.length;a++){var o=t[a],l=o._private,c=l.rstyle;!o.isEdge()||n(o.source())&&n(o.target())||(c.clean=!1),e&&c.clean||o.removed()||"none"!==o.pstyle("display").value&&("nodes"===l.group?i.push(o):r.push(o),c.clean=!0)}for(var h=0;h<i.length;h++){var u=i[h],d=u._private.rstyle,p=u.position();this.recalculateNodeLabelProjection(u),d.nodeX=p.x,d.nodeY=p.y,d.nodeW=u.pstyle("width").pfValue,d.nodeH=u.pstyle("height").pfValue}this.recalculateEdgeProjections(r);for(var g=0;g<r.length;g++){var f=r[g]._private,m=f.rstyle,y=f.rscratch;m.srcX=y.arrowStartX,m.srcY=y.arrowStartY,m.tgtX=y.arrowEndX,m.tgtY=y.arrowEndY,m.midX=y.midX,m.midY=y.midY,m.labelAngle=y.labelAngle,m.sourceLabelAngle=y.sourceLabelAngle,m.targetLabelAngle=y.targetLabelAngle}}}},X_t={updateCachedGrabbedEles:function(){var t=this.cachedZSortedEles;if(t){t.drag=[],t.nondrag=[];for(var e=[],n=0;n<t.length;n++){var r=(i=t[n])._private.rscratch;i.grabbed()&&!i.isParent()?e.push(i):r.inDragLayer?t.drag.push(i):t.nondrag.push(i)}for(n=0;n<e.length;n++){var i=e[n];t.drag.push(i)}}},invalidateCachedZSortedEles:function(){this.cachedZSortedEles=null},getCachedZSortedEles:function(t){if(t||!this.cachedZSortedEles){var e=this.cy.mutableElements().toArray();e.sort(hkt),e.interactive=e.filter((function(t){return t.interactive()})),this.cachedZSortedEles=e,this.updateCachedGrabbedEles()}else e=this.cachedZSortedEles;return e}},K_t={};[p_t,g_t,B_t,F_t,z_t,G_t,W_t,V_t,X_t].forEach((function(t){dpt(K_t,t)}));var Z_t={getCachedImage:function(t,e,n){var r=this.imageCache=this.imageCache||{},i=r[t];if(i)return i.image.complete||i.image.addEventListener("load",n),i.image;var a=(i=r[t]=r[t]||{}).image=new Image;a.addEventListener("load",n),a.addEventListener("error",(function(){a.error=!0}));var s="data:";return t.substring(0,s.length).toLowerCase()===s||(e="null"===e?null:e,a.crossOrigin=e),a.src=t,a}},Q_t={registerBinding:function(t,e,n,r){var i=Array.prototype.slice.apply(arguments,[1]),a=this.binder(t);return a.on.apply(a,i)},binder:function(t){var e=this,n=e.cy.window(),r=t===n||t===n.document||t===n.document.body||tpt(t);if(null==e.supportsPassiveEvents){var i=!1;try{var a=Object.defineProperty({},"passive",{get:s((function(){return i=!0,!0}),"get")});n.addEventListener("test",null,a)}catch(t){}e.supportsPassiveEvents=i}var o=s((function(n,i,a){var s=Array.prototype.slice.call(arguments);return r&&e.supportsPassiveEvents&&(s[2]={capture:null!=a&&a,passive:!1,once:!1}),e.bindings.push({target:t,args:s}),(t.addEventListener||t.on).apply(t,s),this}),"on");return{on:o,addEventListener:o,addListener:o,bind:o}},nodeIsDraggable:function(t){return t&&t.isNode()&&!t.locked()&&t.grabbable()},nodeIsGrabbable:function(t){return this.nodeIsDraggable(t)&&t.interactive()},load:function(){var t=this,e=t.cy.window(),n=s((function(t){return t.selected()}),"isSelected"),r=s((function(e,n,r,i){null==e&&(e=t.cy);for(var a=0;a<n.length;a++){var s=n[a];e.emit({originalEvent:r,type:s,position:i})}}),"triggerEvents"),i=s((function(t){return t.shiftKey||t.metaKey||t.ctrlKey}),"isMultSelKeyDown"),a=s((function(e,n){var r=!0;if(t.cy.hasCompoundNodes()&&e&&e.pannable())for(var i=0;n&&i<n.length;i++){if((e=n[i]).isNode()&&e.isParent()&&!e.pannable()){r=!1;break}}else r=!0;return r}),"allowPanningPassthrough"),o=s((function(t){t[0]._private.grabbed=!0}),"setGrabbed"),l=s((function(t){t[0]._private.grabbed=!1}),"setFreed"),c=s((function(t){t[0]._private.rscratch.inDragLayer=!0}),"setInDragLayer"),h=s((function(t){t[0]._private.rscratch.inDragLayer=!1}),"setOutDragLayer"),u=s((function(t){t[0]._private.rscratch.isGrabTarget=!0}),"setGrabTarget"),d=s((function(t){t[0]._private.rscratch.isGrabTarget=!1}),"removeGrabTarget"),p=s((function(t,e){var n=e.addToList;n.has(t)||!t.grabbable()||t.locked()||(n.merge(t),o(t))}),"addToDragList"),g=s((function(t,e){if(t.cy().hasCompoundNodes()&&(null!=e.inDragLayer||null!=e.addToList)){var n=t.descendants();e.inDragLayer&&(n.forEach(c),n.connectedEdges().forEach(c)),e.addToList&&p(n,e)}}),"addDescendantsToDrag"),f=s((function(e,n){n=n||{};var r=e.cy().hasCompoundNodes();n.inDragLayer&&(e.forEach(c),e.neighborhood().stdFilter((function(t){return!r||t.isEdge()})).forEach(c)),n.addToList&&e.forEach((function(t){p(t,n)})),g(e,n),v(e,{inDragLayer:n.inDragLayer}),t.updateCachedGrabbedEles()}),"addNodesToDrag"),m=f,y=s((function(e){e&&(t.getCachedZSortedEles().forEach((function(t){l(t),h(t),d(t)})),t.updateCachedGrabbedEles())}),"freeDraggedElements"),v=s((function(t,e){if((null!=e.inDragLayer||null!=e.addToList)&&t.cy().hasCompoundNodes()){var n=t.ancestors().orphans();if(!n.same(t)){var r=n.descendants().spawnSelf().merge(n).unmerge(t).unmerge(t.descendants()),i=r.connectedEdges();e.inDragLayer&&(i.forEach(c),r.forEach(c)),e.addToList&&r.forEach((function(t){p(t,e)}))}}}),"updateAncestorsInDragLayer"),x=s((function(){null!=document.activeElement&&null!=document.activeElement.blur&&document.activeElement.blur()}),"blurActiveDomElement"),b="undefined"!=typeof MutationObserver,w="undefined"!=typeof ResizeObserver;b?(t.removeObserver=new MutationObserver((function(e){for(var n=0;n<e.length;n++){var r=e[n].removedNodes;if(r)for(var i=0;i<r.length;i++){if(r[i]===t.container){t.destroy();break}}}})),t.container.parentNode&&t.removeObserver.observe(t.container.parentNode,{childList:!0})):t.registerBinding(t.container,"DOMNodeRemoved",(function(e){t.destroy()}));var k=ogt((function(){t.cy.resize()}),100);b&&(t.styleObserver=new MutationObserver(k),t.styleObserver.observe(t.container,{attributes:!0})),t.registerBinding(e,"resize",k),w&&(t.resizeObserver=new ResizeObserver(k),t.resizeObserver.observe(t.container));var T=s((function(t,e){for(;null!=t;)e(t),t=t.parentNode}),"forEachUp"),_=s((function(){t.invalidateContainerClientCoordsCache()}),"invalidateCoords");T(t.container,(function(e){t.registerBinding(e,"transitionend",_),t.registerBinding(e,"animationend",_),t.registerBinding(e,"scroll",_)})),t.registerBinding(t.container,"contextmenu",(function(t){t.preventDefault()}));var E,C,S,A=s((function(){return 0!==t.selection[4]}),"inBoxSelection"),L=s((function(e){for(var n=t.findContainerClientCoords(),r=n[0],i=n[1],a=n[2],s=n[3],o=e.touches?e.touches:[e],l=!1,c=0;c<o.length;c++){var h=o[c];if(r<=h.clientX&&h.clientX<=r+a&&i<=h.clientY&&h.clientY<=i+s){l=!0;break}}if(!l)return!1;for(var u=t.container,d=e.target.parentNode,p=!1;d;){if(d===u){p=!0;break}d=d.parentNode}return!!p}),"eventInContainer");t.registerBinding(t.container,"mousedown",s((function(e){if(L(e)&&(1!==t.hoverData.which||1===e.which)){e.preventDefault(),x(),t.hoverData.capture=!0,t.hoverData.which=e.which;var n=t.cy,i=[e.clientX,e.clientY],a=t.projectIntoViewport(i[0],i[1]),o=t.selection,l=t.findNearestElements(a[0],a[1],!0,!1),c=l[0],h=t.dragData.possibleDragElements;t.hoverData.mdownPos=a,t.hoverData.mdownGPos=i;var d=s((function(){t.hoverData.tapholdCancelled=!1,clearTimeout(t.hoverData.tapholdTimeout),t.hoverData.tapholdTimeout=setTimeout((function(){if(!t.hoverData.tapholdCancelled){var r=t.hoverData.down;r?r.emit({originalEvent:e,type:"taphold",position:{x:a[0],y:a[1]}}):n.emit({originalEvent:e,type:"taphold",position:{x:a[0],y:a[1]}})}}),t.tapholdDuration)}),"checkForTaphold");if(3==e.which){t.hoverData.cxtStarted=!0;var p={originalEvent:e,type:"cxttapstart",position:{x:a[0],y:a[1]}};c?(c.activate(),c.emit(p),t.hoverData.down=c):n.emit(p),t.hoverData.downTime=(new Date).getTime(),t.hoverData.cxtDragged=!1}else if(1==e.which){if(c&&c.activate(),null!=c&&t.nodeIsGrabbable(c)){var g=s((function(t){return{originalEvent:e,type:t,position:{x:a[0],y:a[1]}}}),"makeEvent"),y=s((function(t){t.emit(g("grab"))}),"triggerGrab");if(u(c),c.selected()){h=t.dragData.possibleDragElements=n.collection();var v=n.$((function(e){return e.isNode()&&e.selected()&&t.nodeIsGrabbable(e)}));f(v,{addToList:h}),c.emit(g("grabon")),v.forEach(y)}else h=t.dragData.possibleDragElements=n.collection(),m(c,{addToList:h}),c.emit(g("grabon")).emit(g("grab"));t.redrawHint("eles",!0),t.redrawHint("drag",!0)}t.hoverData.down=c,t.hoverData.downs=l,t.hoverData.downTime=(new Date).getTime(),r(c,["mousedown","tapstart","vmousedown"],e,{x:a[0],y:a[1]}),null==c?(o[4]=1,t.data.bgActivePosistion={x:a[0],y:a[1]},t.redrawHint("select",!0),t.redraw()):c.pannable()&&(o[4]=1),d()}o[0]=o[2]=a[0],o[1]=o[3]=a[1]}}),"mousedownHandler"),!1),t.registerBinding(e,"mousemove",s((function(e){if(t.hoverData.capture||L(e)){var n=!1,o=t.cy,l=o.zoom(),c=[e.clientX,e.clientY],h=t.projectIntoViewport(c[0],c[1]),u=t.hoverData.mdownPos,d=t.hoverData.mdownGPos,p=t.selection,g=null;t.hoverData.draggingEles||t.hoverData.dragging||t.hoverData.selecting||(g=t.findNearestElement(h[0],h[1],!0,!1));var m,v=t.hoverData.last,x=t.hoverData.down,b=[h[0]-p[2],h[1]-p[3]],w=t.dragData.possibleDragElements;if(d){var k=c[0]-d[0],T=k*k,_=c[1]-d[1],E=T+_*_;t.hoverData.isOverThresholdDrag=m=E>=t.desktopTapThreshold2}var C=i(e);m&&(t.hoverData.tapholdCancelled=!0);var S=s((function(){var e=t.hoverData.dragDelta=t.hoverData.dragDelta||[];0===e.length?(e.push(b[0]),e.push(b[1])):(e[0]+=b[0],e[1]+=b[1])}),"updateDragDelta");n=!0,r(g,["mousemove","vmousemove","tapdrag"],e,{x:h[0],y:h[1]});var A=s((function(){t.data.bgActivePosistion=void 0,t.hoverData.selecting||o.emit({originalEvent:e,type:"boxstart",position:{x:h[0],y:h[1]}}),p[4]=1,t.hoverData.selecting=!0,t.redrawHint("select",!0),t.redraw()}),"goIntoBoxMode");if(3===t.hoverData.which){if(m){var N={originalEvent:e,type:"cxtdrag",position:{x:h[0],y:h[1]}};x?x.emit(N):o.emit(N),t.hoverData.cxtDragged=!0,t.hoverData.cxtOver&&g===t.hoverData.cxtOver||(t.hoverData.cxtOver&&t.hoverData.cxtOver.emit({originalEvent:e,type:"cxtdragout",position:{x:h[0],y:h[1]}}),t.hoverData.cxtOver=g,g&&g.emit({originalEvent:e,type:"cxtdragover",position:{x:h[0],y:h[1]}}))}}else if(t.hoverData.dragging){if(n=!0,o.panningEnabled()&&o.userPanningEnabled()){var I;if(t.hoverData.justStartedPan){var M=t.hoverData.mdownPos;I={x:(h[0]-M[0])*l,y:(h[1]-M[1])*l},t.hoverData.justStartedPan=!1}else I={x:b[0]*l,y:b[1]*l};o.panBy(I),o.emit("dragpan"),t.hoverData.dragged=!0}h=t.projectIntoViewport(e.clientX,e.clientY)}else if(1!=p[4]||null!=x&&!x.pannable()){if(x&&x.pannable()&&x.active()&&x.unactivate(),x&&x.grabbed()||g==v||(v&&r(v,["mouseout","tapdragout"],e,{x:h[0],y:h[1]}),g&&r(g,["mouseover","tapdragover"],e,{x:h[0],y:h[1]}),t.hoverData.last=g),x)if(m){if(o.boxSelectionEnabled()&&C)x&&x.grabbed()&&(y(w),x.emit("freeon"),w.emit("free"),t.dragData.didDrag&&(x.emit("dragfreeon"),w.emit("dragfree"))),A();else if(x&&x.grabbed()&&t.nodeIsDraggable(x)){var R=!t.dragData.didDrag;R&&t.redrawHint("eles",!0),t.dragData.didDrag=!0,t.hoverData.draggingEles||f(w,{inDragLayer:!0});var D={x:0,y:0};if(jdt(b[0])&&jdt(b[1])&&(D.x+=b[0],D.y+=b[1],R)){var O=t.hoverData.dragDelta;O&&jdt(O[0])&&jdt(O[1])&&(D.x+=O[0],D.y+=O[1])}t.hoverData.draggingEles=!0,w.silentShift(D).emit("position drag"),t.redrawHint("drag",!0),t.redraw()}}else S();n=!0}else if(m){if(t.hoverData.dragging||!o.boxSelectionEnabled()||!C&&o.panningEnabled()&&o.userPanningEnabled()){if(!t.hoverData.selecting&&o.panningEnabled()&&o.userPanningEnabled()){a(x,t.hoverData.downs)&&(t.hoverData.dragging=!0,t.hoverData.justStartedPan=!0,p[4]=0,t.data.bgActivePosistion=yft(u),t.redrawHint("select",!0),t.redraw())}}else A();x&&x.pannable()&&x.active()&&x.unactivate()}return p[2]=h[0],p[3]=h[1],n?(e.stopPropagation&&e.stopPropagation(),e.preventDefault&&e.preventDefault(),!1):void 0}}),"mousemoveHandler"),!1),t.registerBinding(e,"mouseup",s((function(e){if((1!==t.hoverData.which||1===e.which||!t.hoverData.capture)&&t.hoverData.capture){t.hoverData.capture=!1;var a=t.cy,o=t.projectIntoViewport(e.clientX,e.clientY),l=t.selection,c=t.findNearestElement(o[0],o[1],!0,!1),h=t.dragData.possibleDragElements,u=t.hoverData.down,d=i(e);if(t.data.bgActivePosistion&&(t.redrawHint("select",!0),t.redraw()),t.hoverData.tapholdCancelled=!0,t.data.bgActivePosistion=void 0,u&&u.unactivate(),3===t.hoverData.which){var p={originalEvent:e,type:"cxttapend",position:{x:o[0],y:o[1]}};if(u?u.emit(p):a.emit(p),!t.hoverData.cxtDragged){var g={originalEvent:e,type:"cxttap",position:{x:o[0],y:o[1]}};u?u.emit(g):a.emit(g)}t.hoverData.cxtDragged=!1,t.hoverData.which=null}else if(1===t.hoverData.which){if(r(c,["mouseup","tapend","vmouseup"],e,{x:o[0],y:o[1]}),t.dragData.didDrag||t.hoverData.dragged||t.hoverData.selecting||t.hoverData.isOverThresholdDrag||(r(u,["click","tap","vclick"],e,{x:o[0],y:o[1]}),C=!1,e.timeStamp-S<=a.multiClickDebounceTime()?(E&&clearTimeout(E),C=!0,S=null,r(u,["dblclick","dbltap","vdblclick"],e,{x:o[0],y:o[1]})):(E=setTimeout((function(){C||r(u,["oneclick","onetap","voneclick"],e,{x:o[0],y:o[1]})}),a.multiClickDebounceTime()),S=e.timeStamp)),null!=u||t.dragData.didDrag||t.hoverData.selecting||t.hoverData.dragged||i(e)||(a.$(n).unselect(["tapunselect"]),h.length>0&&t.redrawHint("eles",!0),t.dragData.possibleDragElements=h=a.collection()),c!=u||t.dragData.didDrag||t.hoverData.selecting||null!=c&&c._private.selectable&&(t.hoverData.dragging||("additive"===a.selectionType()||d?c.selected()?c.unselect(["tapunselect"]):c.select(["tapselect"]):d||(a.$(n).unmerge(c).unselect(["tapunselect"]),c.select(["tapselect"]))),t.redrawHint("eles",!0)),t.hoverData.selecting){var f=a.collection(t.getAllInBox(l[0],l[1],l[2],l[3]));t.redrawHint("select",!0),f.length>0&&t.redrawHint("eles",!0),a.emit({type:"boxend",originalEvent:e,position:{x:o[0],y:o[1]}});var m=s((function(t){return t.selectable()&&!t.selected()}),"eleWouldBeSelected");"additive"===a.selectionType()||d||a.$(n).unmerge(f).unselect(),f.emit("box").stdFilter(m).select().emit("boxselect"),t.redraw()}if(t.hoverData.dragging&&(t.hoverData.dragging=!1,t.redrawHint("select",!0),t.redrawHint("eles",!0),t.redraw()),!l[4]){t.redrawHint("drag",!0),t.redrawHint("eles",!0);var v=u&&u.grabbed();y(h),v&&(u.emit("freeon"),h.emit("free"),t.dragData.didDrag&&(u.emit("dragfreeon"),h.emit("dragfree")))}}l[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}}),"mouseupHandler"),!1);var N,I,M,R,D,O,P,B,$,F,z,U,G,q=s((function(e){if(!t.scrollingPage){var n=t.cy,r=n.zoom(),i=n.pan(),a=t.projectIntoViewport(e.clientX,e.clientY),s=[a[0]*r+i.x,a[1]*r+i.y];if(t.hoverData.draggingEles||t.hoverData.dragging||t.hoverData.cxtStarted||A())e.preventDefault();else if(n.panningEnabled()&&n.userPanningEnabled()&&n.zoomingEnabled()&&n.userZoomingEnabled()){var o;e.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),o=null!=e.deltaY?e.deltaY/-250:null!=e.wheelDeltaY?e.wheelDeltaY/1e3:e.wheelDelta/1e3,o*=t.wheelSensitivity,1===e.deltaMode&&(o*=33);var l=n.zoom()*Math.pow(10,o);"gesturechange"===e.type&&(l=t.gestureStartZoom*e.scale),n.zoom({level:l,renderedPosition:{x:s[0],y:s[1]}}),n.emit("gesturechange"===e.type?"pinchzoom":"scrollzoom")}}}),"wheelHandler");t.registerBinding(t.container,"wheel",q,!0),t.registerBinding(e,"scroll",s((function(e){t.scrollingPage=!0,clearTimeout(t.scrollingPageTimeout),t.scrollingPageTimeout=setTimeout((function(){t.scrollingPage=!1}),250)}),"scrollHandler"),!0),t.registerBinding(t.container,"gesturestart",s((function(e){t.gestureStartZoom=t.cy.zoom(),t.hasTouchStarted||e.preventDefault()}),"gestureStartHandler"),!0),t.registerBinding(t.container,"gesturechange",(function(e){t.hasTouchStarted||q(e)}),!0),t.registerBinding(t.container,"mouseout",s((function(e){var n=t.projectIntoViewport(e.clientX,e.clientY);t.cy.emit({originalEvent:e,type:"mouseout",position:{x:n[0],y:n[1]}})}),"mouseOutHandler"),!1),t.registerBinding(t.container,"mouseover",s((function(e){var n=t.projectIntoViewport(e.clientX,e.clientY);t.cy.emit({originalEvent:e,type:"mouseover",position:{x:n[0],y:n[1]}})}),"mouseOverHandler"),!1);var j,Y,W,H,V,X,K,Z=s((function(t,e,n,r){return Math.sqrt((n-t)*(n-t)+(r-e)*(r-e))}),"distance"),Q=s((function(t,e,n,r){return(n-t)*(n-t)+(r-e)*(r-e)}),"distanceSq");if(t.registerBinding(t.container,"touchstart",j=s((function(e){if(t.hasTouchStarted=!0,L(e)){x(),t.touchData.capture=!0,t.data.bgActivePosistion=void 0;var n=t.cy,i=t.touchData.now,a=t.touchData.earlier;if(e.touches[0]){var o=t.projectIntoViewport(e.touches[0].clientX,e.touches[0].clientY);i[0]=o[0],i[1]=o[1]}if(e.touches[1]){o=t.projectIntoViewport(e.touches[1].clientX,e.touches[1].clientY);i[2]=o[0],i[3]=o[1]}if(e.touches[2]){o=t.projectIntoViewport(e.touches[2].clientX,e.touches[2].clientY);i[4]=o[0],i[5]=o[1]}if(e.touches[1]){t.touchData.singleTouchMoved=!0,y(t.dragData.touchDragEles);var l=t.findContainerClientCoords();$=l[0],F=l[1],z=l[2],U=l[3],N=e.touches[0].clientX-$,I=e.touches[0].clientY-F,M=e.touches[1].clientX-$,R=e.touches[1].clientY-F,G=0<=N&&N<=z&&0<=M&&M<=z&&0<=I&&I<=U&&0<=R&&R<=U;var c=n.pan(),h=n.zoom();D=Z(N,I,M,R),O=Q(N,I,M,R),B=[((P=[(N+M)/2,(I+R)/2])[0]-c.x)/h,(P[1]-c.y)/h];if(O<4e4&&!e.touches[2]){var d=t.findNearestElement(i[0],i[1],!0,!0),p=t.findNearestElement(i[2],i[3],!0,!0);return d&&d.isNode()?(d.activate().emit({originalEvent:e,type:"cxttapstart",position:{x:i[0],y:i[1]}}),t.touchData.start=d):p&&p.isNode()?(p.activate().emit({originalEvent:e,type:"cxttapstart",position:{x:i[0],y:i[1]}}),t.touchData.start=p):n.emit({originalEvent:e,type:"cxttapstart",position:{x:i[0],y:i[1]}}),t.touchData.start&&(t.touchData.start._private.grabbed=!1),t.touchData.cxt=!0,t.touchData.cxtDragged=!1,t.data.bgActivePosistion=void 0,void t.redraw()}}if(e.touches[2])n.boxSelectionEnabled()&&e.preventDefault();else if(e.touches[1]);else if(e.touches[0]){var g=t.findNearestElements(i[0],i[1],!0,!0),v=g[0];if(null!=v&&(v.activate(),t.touchData.start=v,t.touchData.starts=g,t.nodeIsGrabbable(v))){var b=t.dragData.touchDragEles=n.collection(),w=null;t.redrawHint("eles",!0),t.redrawHint("drag",!0),v.selected()?(w=n.$((function(e){return e.selected()&&t.nodeIsGrabbable(e)})),f(w,{addToList:b})):m(v,{addToList:b}),u(v);var k=s((function(t){return{originalEvent:e,type:t,position:{x:i[0],y:i[1]}}}),"makeEvent");v.emit(k("grabon")),w?w.forEach((function(t){t.emit(k("grab"))})):v.emit(k("grab"))}r(v,["touchstart","tapstart","vmousedown"],e,{x:i[0],y:i[1]}),null==v&&(t.data.bgActivePosistion={x:o[0],y:o[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(){!1!==t.touchData.singleTouchMoved||t.pinching||t.touchData.selecting||r(t.touchData.start,["taphold"],e,{x:i[0],y:i[1]})}),t.tapholdDuration)}if(e.touches.length>=1){for(var T=t.touchData.startPosition=[null,null,null,null,null,null],_=0;_<i.length;_++)T[_]=a[_]=i[_];var E=e.touches[0];t.touchData.startGPosition=[E.clientX,E.clientY]}}}),"touchstartHandler"),!1),t.registerBinding(e,"touchmove",Y=s((function(e){var n=t.touchData.capture;if(n||L(e)){var i=t.selection,s=t.cy,o=t.touchData.now,l=t.touchData.earlier,c=s.zoom();if(e.touches[0]){var h=t.projectIntoViewport(e.touches[0].clientX,e.touches[0].clientY);o[0]=h[0],o[1]=h[1]}if(e.touches[1]){h=t.projectIntoViewport(e.touches[1].clientX,e.touches[1].clientY);o[2]=h[0],o[3]=h[1]}if(e.touches[2]){h=t.projectIntoViewport(e.touches[2].clientX,e.touches[2].clientY);o[4]=h[0],o[5]=h[1]}var u,d=t.touchData.startGPosition;if(n&&e.touches[0]&&d){for(var p=[],g=0;g<o.length;g++)p[g]=o[g]-l[g];var m=e.touches[0].clientX-d[0],v=m*m,x=e.touches[0].clientY-d[1];u=v+x*x>=t.touchTapThreshold2}if(n&&t.touchData.cxt){e.preventDefault();var b=e.touches[0].clientX-$,w=e.touches[0].clientY-F,k=e.touches[1].clientX-$,T=e.touches[1].clientY-F,_=Q(b,w,k,T);if(_/O>=2.25||_>=22500){t.touchData.cxt=!1,t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var E={originalEvent:e,type:"cxttapend",position:{x:o[0],y:o[1]}};t.touchData.start?(t.touchData.start.unactivate().emit(E),t.touchData.start=null):s.emit(E)}}if(n&&t.touchData.cxt){E={originalEvent:e,type:"cxtdrag",position:{x:o[0],y:o[1]}};t.data.bgActivePosistion=void 0,t.redrawHint("select",!0),t.touchData.start?t.touchData.start.emit(E):s.emit(E),t.touchData.start&&(t.touchData.start._private.grabbed=!1),t.touchData.cxtDragged=!0;var C=t.findNearestElement(o[0],o[1],!0,!0);t.touchData.cxtOver&&C===t.touchData.cxtOver||(t.touchData.cxtOver&&t.touchData.cxtOver.emit({originalEvent:e,type:"cxtdragout",position:{x:o[0],y:o[1]}}),t.touchData.cxtOver=C,C&&C.emit({originalEvent:e,type:"cxtdragover",position:{x:o[0],y:o[1]}}))}else if(n&&e.touches[2]&&s.boxSelectionEnabled())e.preventDefault(),t.data.bgActivePosistion=void 0,this.lastThreeTouch=+new Date,t.touchData.selecting||s.emit({originalEvent:e,type:"boxstart",position:{x:o[0],y:o[1]}}),t.touchData.selecting=!0,t.touchData.didSelect=!0,i[4]=1,i&&0!==i.length&&void 0!==i[0]?(i[2]=(o[0]+o[2]+o[4])/3,i[3]=(o[1]+o[3]+o[5])/3):(i[0]=(o[0]+o[2]+o[4])/3,i[1]=(o[1]+o[3]+o[5])/3,i[2]=(o[0]+o[2]+o[4])/3+1,i[3]=(o[1]+o[3]+o[5])/3+1),t.redrawHint("select",!0),t.redraw();else if(n&&e.touches[1]&&!t.touchData.didSelect&&s.zoomingEnabled()&&s.panningEnabled()&&s.userZoomingEnabled()&&s.userPanningEnabled()){if(e.preventDefault(),t.data.bgActivePosistion=void 0,t.redrawHint("select",!0),J=t.dragData.touchDragEles){t.redrawHint("drag",!0);for(var S=0;S<J.length;S++){var A=J[S]._private;A.grabbed=!1,A.rscratch.inDragLayer=!1}}var P=t.touchData.start,z=(b=e.touches[0].clientX-$,w=e.touches[0].clientY-F,k=e.touches[1].clientX-$,T=e.touches[1].clientY-F,Z(b,w,k,T)),U=z/D;if(G){var q=(b-N+(k-M))/2,j=(w-I+(T-R))/2,Y=s.zoom(),W=Y*U,H=s.pan(),V=B[0]*Y+H.x,X=B[1]*Y+H.y,K={x:-W/Y*(V-H.x-q)+V,y:-W/Y*(X-H.y-j)+X};if(P&&P.active()){var J=t.dragData.touchDragEles;y(J),t.redrawHint("drag",!0),t.redrawHint("eles",!0),P.unactivate().emit("freeon"),J.emit("free"),t.dragData.didDrag&&(P.emit("dragfreeon"),J.emit("dragfree"))}s.viewport({zoom:W,pan:K,cancelOnFailedZoom:!0}),s.emit("pinchzoom"),D=z,N=b,I=w,M=k,R=T,t.pinching=!0}if(e.touches[0]){h=t.projectIntoViewport(e.touches[0].clientX,e.touches[0].clientY);o[0]=h[0],o[1]=h[1]}if(e.touches[1]){h=t.projectIntoViewport(e.touches[1].clientX,e.touches[1].clientY);o[2]=h[0],o[3]=h[1]}if(e.touches[2]){h=t.projectIntoViewport(e.touches[2].clientX,e.touches[2].clientY);o[4]=h[0],o[5]=h[1]}}else if(e.touches[0]&&!t.touchData.didSelect){var tt=t.touchData.start,et=t.touchData.last;if(t.hoverData.draggingEles||t.swipePanning||(C=t.findNearestElement(o[0],o[1],!0,!0)),n&&null!=tt&&e.preventDefault(),n&&null!=tt&&t.nodeIsDraggable(tt))if(u){J=t.dragData.touchDragEles;var nt=!t.dragData.didDrag;nt&&f(J,{inDragLayer:!0}),t.dragData.didDrag=!0;var rt={x:0,y:0};if(jdt(p[0])&&jdt(p[1]))if(rt.x+=p[0],rt.y+=p[1],nt)t.redrawHint("eles",!0),(it=t.touchData.dragDelta)&&jdt(it[0])&&jdt(it[1])&&(rt.x+=it[0],rt.y+=it[1]);t.hoverData.draggingEles=!0,J.silentShift(rt).emit("position drag"),t.redrawHint("drag",!0),t.touchData.startPosition[0]==l[0]&&t.touchData.startPosition[1]==l[1]&&t.redrawHint("eles",!0),t.redraw()}else{var it;0===(it=t.touchData.dragDelta=t.touchData.dragDelta||[]).length?(it.push(p[0]),it.push(p[1])):(it[0]+=p[0],it[1]+=p[1])}if(r(tt||C,["touchmove","tapdrag","vmousemove"],e,{x:o[0],y:o[1]}),tt&&tt.grabbed()||C==et||(et&&et.emit({originalEvent:e,type:"tapdragout",position:{x:o[0],y:o[1]}}),C&&C.emit({originalEvent:e,type:"tapdragover",position:{x:o[0],y:o[1]}})),t.touchData.last=C,n)for(S=0;S<o.length;S++)o[S]&&t.touchData.startPosition[S]&&u&&(t.touchData.singleTouchMoved=!0);if(n&&(null==tt||tt.pannable())&&s.panningEnabled()&&s.userPanningEnabled()){a(tt,t.touchData.starts)&&(e.preventDefault(),t.data.bgActivePosistion||(t.data.bgActivePosistion=yft(t.touchData.startPosition)),t.swipePanning?(s.panBy({x:p[0]*c,y:p[1]*c}),s.emit("dragpan")):u&&(t.swipePanning=!0,s.panBy({x:m*c,y:x*c}),s.emit("dragpan"),tt&&(tt.unactivate(),t.redrawHint("select",!0),t.touchData.start=null)));h=t.projectIntoViewport(e.touches[0].clientX,e.touches[0].clientY);o[0]=h[0],o[1]=h[1]}}for(g=0;g<o.length;g++)l[g]=o[g];n&&e.touches.length>0&&!t.hoverData.draggingEles&&!t.swipePanning&&null!=t.data.bgActivePosistion&&(t.data.bgActivePosistion=void 0,t.redrawHint("select",!0),t.redraw())}}),"touchmoveHandler"),!1),t.registerBinding(e,"touchcancel",W=s((function(e){var n=t.touchData.start;t.touchData.capture=!1,n&&n.unactivate()}),"touchcancelHandler")),t.registerBinding(e,"touchend",H=s((function(e){var i=t.touchData.start;if(t.touchData.capture){0===e.touches.length&&(t.touchData.capture=!1),e.preventDefault();var a=t.selection;t.swipePanning=!1,t.hoverData.draggingEles=!1;var o,l=t.cy,c=l.zoom(),h=t.touchData.now,u=t.touchData.earlier;if(e.touches[0]){var d=t.projectIntoViewport(e.touches[0].clientX,e.touches[0].clientY);h[0]=d[0],h[1]=d[1]}if(e.touches[1]){d=t.projectIntoViewport(e.touches[1].clientX,e.touches[1].clientY);h[2]=d[0],h[3]=d[1]}if(e.touches[2]){d=t.projectIntoViewport(e.touches[2].clientX,e.touches[2].clientY);h[4]=d[0],h[5]=d[1]}if(i&&i.unactivate(),t.touchData.cxt){if(o={originalEvent:e,type:"cxttapend",position:{x:h[0],y:h[1]}},i?i.emit(o):l.emit(o),!t.touchData.cxtDragged){var p={originalEvent:e,type:"cxttap",position:{x:h[0],y:h[1]}};i?i.emit(p):l.emit(p)}return t.touchData.start&&(t.touchData.start._private.grabbed=!1),t.touchData.cxt=!1,t.touchData.start=null,void t.redraw()}if(!e.touches[2]&&l.boxSelectionEnabled()&&t.touchData.selecting){t.touchData.selecting=!1;var g=l.collection(t.getAllInBox(a[0],a[1],a[2],a[3]));a[0]=void 0,a[1]=void 0,a[2]=void 0,a[3]=void 0,a[4]=0,t.redrawHint("select",!0),l.emit({type:"boxend",originalEvent:e,position:{x:h[0],y:h[1]}});var f=s((function(t){return t.selectable()&&!t.selected()}),"eleWouldBeSelected");g.emit("box").stdFilter(f).select().emit("boxselect"),g.nonempty()&&t.redrawHint("eles",!0),t.redraw()}if(null!=i&&i.unactivate(),e.touches[2])t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);else if(e.touches[1]);else if(e.touches[0]);else if(!e.touches[0]){t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var m=t.dragData.touchDragEles;if(null!=i){var v=i._private.grabbed;y(m),t.redrawHint("drag",!0),t.redrawHint("eles",!0),v&&(i.emit("freeon"),m.emit("free"),t.dragData.didDrag&&(i.emit("dragfreeon"),m.emit("dragfree"))),r(i,["touchend","tapend","vmouseup","tapdragout"],e,{x:h[0],y:h[1]}),i.unactivate(),t.touchData.start=null}else{var x=t.findNearestElement(h[0],h[1],!0,!0);r(x,["touchend","tapend","vmouseup","tapdragout"],e,{x:h[0],y:h[1]})}var b=t.touchData.startPosition[0]-h[0],w=b*b,k=t.touchData.startPosition[1]-h[1],T=(w+k*k)*c*c;t.touchData.singleTouchMoved||(i||l.$(":selected").unselect(["tapunselect"]),r(i,["tap","vclick"],e,{x:h[0],y:h[1]}),V=!1,e.timeStamp-K<=l.multiClickDebounceTime()?(X&&clearTimeout(X),V=!0,K=null,r(i,["dbltap","vdblclick"],e,{x:h[0],y:h[1]})):(X=setTimeout((function(){V||r(i,["onetap","voneclick"],e,{x:h[0],y:h[1]})}),l.multiClickDebounceTime()),K=e.timeStamp)),null!=i&&!t.dragData.didDrag&&i._private.selectable&&T<t.touchTapThreshold2&&!t.pinching&&("single"===l.selectionType()?(l.$(n).unmerge(i).unselect(["tapunselect"]),i.select(["tapselect"])):i.selected()?i.unselect(["tapunselect"]):i.select(["tapselect"]),t.redrawHint("eles",!0)),t.touchData.singleTouchMoved=!0}for(var _=0;_<h.length;_++)u[_]=h[_];t.dragData.didDrag=!1,0===e.touches.length&&(t.touchData.dragDelta=[],t.touchData.startPosition=[null,null,null,null,null,null],t.touchData.startGPosition=null,t.touchData.didSelect=!1),e.touches.length<2&&(1===e.touches.length&&(t.touchData.startGPosition=[e.touches[0].clientX,e.touches[0].clientY]),t.pinching=!1,t.redrawHint("eles",!0),t.redraw())}}),"touchendHandler"),!1),"undefined"==typeof TouchEvent){var J=[],tt=s((function(t){return{clientX:t.clientX,clientY:t.clientY,force:1,identifier:t.pointerId,pageX:t.pageX,pageY:t.pageY,radiusX:t.width/2,radiusY:t.height/2,screenX:t.screenX,screenY:t.screenY,target:t.target}}),"makeTouch"),et=s((function(t){return{event:t,touch:tt(t)}}),"makePointer"),nt=s((function(t){J.push(et(t))}),"addPointer"),rt=s((function(t){for(var e=0;e<J.length;e++){if(J[e].event.pointerId===t.pointerId)return void J.splice(e,1)}}),"removePointer"),it=s((function(t){var e=J.filter((function(e){return e.event.pointerId===t.pointerId}))[0];e.event=t,e.touch=tt(t)}),"updatePointer"),at=s((function(t){t.touches=J.map((function(t){return t.touch}))}),"addTouchesToEvent"),st=s((function(t){return"mouse"===t.pointerType||4===t.pointerType}),"pointerIsMouse");t.registerBinding(t.container,"pointerdown",(function(t){st(t)||(t.preventDefault(),nt(t),at(t),j(t))})),t.registerBinding(t.container,"pointerup",(function(t){st(t)||(rt(t),at(t),H(t))})),t.registerBinding(t.container,"pointercancel",(function(t){st(t)||(rt(t),at(t),W(t))})),t.registerBinding(t.container,"pointermove",(function(t){st(t)||(t.preventDefault(),it(t),at(t),Y(t))}))}}},J_t={generatePolygon:function(t,e){return this.nodeShapes[t]={renderer:this,name:t,points:e,draw:s((function(t,e,n,r,i,a){this.renderer.nodeShapeImpl("polygon",t,e,n,r,i,this.points)}),"draw"),intersectLine:s((function(t,e,n,r,i,a,s,o){return cmt(i,a,this.points,t,e,n/2,r/2,s)}),"intersectLine"),checkPoint:s((function(t,e,n,r,i,a,s,o){return tmt(t,e,this.points,a,s,r,i,[0,-1],n)}),"checkPoint")}},generateEllipse:function(){return this.nodeShapes.ellipse={renderer:this,name:"ellipse",draw:s((function(t,e,n,r,i,a){this.renderer.nodeShapeImpl(this.name,t,e,n,r,i)}),"draw"),intersectLine:s((function(t,e,n,r,i,a,s,o){return imt(i,a,t,e,n/2+s,r/2+s)}),"intersectLine"),checkPoint:s((function(t,e,n,r,i,a,s,o){return amt(t,e,r,i,a,s,n)}),"checkPoint")}},generateRoundPolygon:function(t,e){return this.nodeShapes[t]={renderer:this,name:t,points:e,getOrCreateCorners:s((function(t,n,r,i,a,s,o){if(void 0!==s[o]&&s[o+"-cx"]===t&&s[o+"-cy"]===n)return s[o];s[o]=new Array(e.length/2),s[o+"-cx"]=t,s[o+"-cy"]=n;var l=r/2,c=i/2;a="auto"===a?mmt(r,i):a;for(var h=new Array(e.length/2),u=0;u<e.length/2;u++)h[u]={x:t+l*e[2*u],y:n+c*e[2*u+1]};var d,p,g,f,m=h.length;for(p=h[m-1],d=0;d<m;d++)g=h[d%m],f=h[(d+1)%m],s[o][d]=P_t(p,g,f,a),p=g,g=f;return s[o]}),"getOrCreateCorners"),draw:s((function(t,e,n,r,i,a,s){this.renderer.nodeShapeImpl("round-polygon",t,e,n,r,i,this.points,this.getOrCreateCorners(e,n,r,i,a,s,"drawCorners"))}),"draw"),intersectLine:s((function(t,e,n,r,i,a,s,o,l){return hmt(i,a,this.points,t,e,n,r,s,this.getOrCreateCorners(t,e,n,r,o,l,"corners"))}),"intersectLine"),checkPoint:s((function(t,e,n,r,i,a,s,o,l){return emt(t,e,this.points,a,s,r,i,this.getOrCreateCorners(a,s,r,i,o,l,"corners"))}),"checkPoint")}},generateRoundRectangle:function(){return this.nodeShapes["round-rectangle"]=this.nodeShapes.roundrectangle={renderer:this,name:"round-rectangle",points:dmt(4,0),draw:s((function(t,e,n,r,i,a){this.renderer.nodeShapeImpl(this.name,t,e,n,r,i,this.points,a)}),"draw"),intersectLine:s((function(t,e,n,r,i,a,s,o){return Wft(i,a,t,e,n,r,s,o)}),"intersectLine"),checkPoint:s((function(t,e,n,r,i,a,s,o){var l=r/2,c=i/2;o="auto"===o?fmt(r,i):o;var h=2*(o=Math.min(l,c,o));return!!tmt(t,e,this.points,a,s,r,i-h,[0,-1],n)||(!!tmt(t,e,this.points,a,s,r-h,i,[0,-1],n)||(!!amt(t,e,h,h,a-l+o,s-c+o,n)||(!!amt(t,e,h,h,a+l-o,s-c+o,n)||(!!amt(t,e,h,h,a+l-o,s+c-o,n)||!!amt(t,e,h,h,a-l+o,s+c-o,n)))))}),"checkPoint")}},generateCutRectangle:function(){return this.nodeShapes["cut-rectangle"]=this.nodeShapes.cutrectangle={renderer:this,name:"cut-rectangle",cornerLength:ymt(),points:dmt(4,0),draw:s((function(t,e,n,r,i,a){this.renderer.nodeShapeImpl(this.name,t,e,n,r,i,null,a)}),"draw"),generateCutTrianglePts:s((function(t,e,n,r,i){var a="auto"===i?this.cornerLength:i,s=e/2,o=t/2,l=n-o,c=n+o,h=r-s,u=r+s;return{topLeft:[l,h+a,l+a,h,l+a,h+a],topRight:[c-a,h,c,h+a,c-a,h+a],bottomRight:[c,u-a,c-a,u,c-a,u-a],bottomLeft:[l+a,u,l,u-a,l+a,u-a]}}),"generateCutTrianglePts"),intersectLine:s((function(t,e,n,r,i,a,s,o){var l=this.generateCutTrianglePts(n+2*s,r+2*s,t,e,o),c=[].concat.apply([],[l.topLeft.splice(0,4),l.topRight.splice(0,4),l.bottomRight.splice(0,4),l.bottomLeft.splice(0,4)]);return cmt(i,a,c,t,e)}),"intersectLine"),checkPoint:s((function(t,e,n,r,i,a,s,o){var l="auto"===o?this.cornerLength:o;if(tmt(t,e,this.points,a,s,r,i-2*l,[0,-1],n))return!0;if(tmt(t,e,this.points,a,s,r-2*l,i,[0,-1],n))return!0;var c=this.generateCutTrianglePts(r,i,a,s);return Jft(t,e,c.topLeft)||Jft(t,e,c.topRight)||Jft(t,e,c.bottomRight)||Jft(t,e,c.bottomLeft)}),"checkPoint")}},generateBarrel:function(){return this.nodeShapes.barrel={renderer:this,name:"barrel",points:dmt(4,0),draw:s((function(t,e,n,r,i,a){this.renderer.nodeShapeImpl(this.name,t,e,n,r,i)}),"draw"),intersectLine:s((function(t,e,n,r,i,a,o,l){var c=this.generateBarrelBezierPts(n+2*o,r+2*o,t,e),h=s((function(t){var e=Nft({x:t[0],y:t[1]},{x:t[2],y:t[3]},{x:t[4],y:t[5]},.15),n=Nft({x:t[0],y:t[1]},{x:t[2],y:t[3]},{x:t[4],y:t[5]},.5),r=Nft({x:t[0],y:t[1]},{x:t[2],y:t[3]},{x:t[4],y:t[5]},.85);return[t[0],t[1],e.x,e.y,n.x,n.y,r.x,r.y,t[4],t[5]]}),"approximateBarrelCurvePts"),u=[].concat(h(c.topLeft),h(c.topRight),h(c.bottomRight),h(c.bottomLeft));return cmt(i,a,u,t,e)}),"intersectLine"),generateBarrelBezierPts:s((function(t,e,n,r){var i=e/2,a=t/2,s=n-a,o=n+a,l=r-i,c=r+i,h=xmt(t,e),u=h.heightOffset,d=h.widthOffset,p=h.ctrlPtOffsetPct*t,g={topLeft:[s,l+u,s+p,l,s+d,l],topRight:[o-d,l,o-p,l,o,l+u],bottomRight:[o,c-u,o-p,c,o-d,c],bottomLeft:[s+d,c,s+p,c,s,c-u]};return g.topLeft.isTop=!0,g.topRight.isTop=!0,g.bottomLeft.isBottom=!0,g.bottomRight.isBottom=!0,g}),"generateBarrelBezierPts"),checkPoint:s((function(t,e,n,r,i,a,o,l){var c=xmt(r,i),h=c.heightOffset,u=c.widthOffset;if(tmt(t,e,this.points,a,o,r,i-2*h,[0,-1],n))return!0;if(tmt(t,e,this.points,a,o,r-2*u,i,[0,-1],n))return!0;for(var d=this.generateBarrelBezierPts(r,i,a,o),p=s((function(t,e,n){var r=n[4],i=n[2],a=n[0],s=n[5],o=n[1],l=Math.min(r,a),c=Math.max(r,a),h=Math.min(s,o),u=Math.max(s,o);if(l<=t&&t<=c&&h<=e&&e<=u){var d=vmt(r,i,a),p=Xft(d[0],d[1],d[2],t).filter((function(t){return 0<=t&&t<=1}));if(p.length>0)return p[0]}return null}),"getCurveT"),g=Object.keys(d),f=0;f<g.length;f++){var m=d[g[f]],y=p(t,e,m);if(null!=y){var v=m[5],x=m[3],b=m[1],w=Lft(v,x,b,y);if(m.isTop&&w<=e)return!0;if(m.isBottom&&e<=w)return!0}}return!1}),"checkPoint")}},generateBottomRoundrectangle:function(){return this.nodeShapes["bottom-round-rectangle"]=this.nodeShapes.bottomroundrectangle={renderer:this,name:"bottom-round-rectangle",points:dmt(4,0),draw:s((function(t,e,n,r,i,a){this.renderer.nodeShapeImpl(this.name,t,e,n,r,i,this.points,a)}),"draw"),intersectLine:s((function(t,e,n,r,i,a,s,o){var l=e-(r/2+s),c=lmt(i,a,t,e,t-(n/2+s),l,t+(n/2+s),l,!1);return c.length>0?c:Wft(i,a,t,e,n,r,s,o)}),"intersectLine"),checkPoint:s((function(t,e,n,r,i,a,s,o){var l=2*(o="auto"===o?fmt(r,i):o);if(tmt(t,e,this.points,a,s,r,i-l,[0,-1],n))return!0;if(tmt(t,e,this.points,a,s,r-l,i,[0,-1],n))return!0;var c=r/2+2*n,h=i/2+2*n;return!!Jft(t,e,[a-c,s-h,a-c,s,a+c,s,a+c,s-h])||(!!amt(t,e,l,l,a+r/2-o,s+i/2-o,n)||!!amt(t,e,l,l,a-r/2+o,s+i/2-o,n))}),"checkPoint")}},registerNodeShapes:function(){var t=this.nodeShapes={},e=this;this.generateEllipse(),this.generatePolygon("triangle",dmt(3,0)),this.generateRoundPolygon("round-triangle",dmt(3,0)),this.generatePolygon("rectangle",dmt(4,0)),t.square=t.rectangle,this.generateRoundRectangle(),this.generateCutRectangle(),this.generateBarrel(),this.generateBottomRoundrectangle();var n=[0,1,1,0,0,-1,-1,0];this.generatePolygon("diamond",n),this.generateRoundPolygon("round-diamond",n),this.generatePolygon("pentagon",dmt(5,0)),this.generateRoundPolygon("round-pentagon",dmt(5,0)),this.generatePolygon("hexagon",dmt(6,0)),this.generateRoundPolygon("round-hexagon",dmt(6,0)),this.generatePolygon("heptagon",dmt(7,0)),this.generateRoundPolygon("round-heptagon",dmt(7,0)),this.generatePolygon("octagon",dmt(8,0)),this.generateRoundPolygon("round-octagon",dmt(8,0));var r=new Array(20),i=gmt(5,0),a=gmt(5,Math.PI/5),s=.5*(3-Math.sqrt(5));s*=1.57;for(var o=0;o<a.length/2;o++)a[2*o]*=s,a[2*o+1]*=s;for(o=0;o<5;o++)r[4*o]=i[2*o],r[4*o+1]=i[2*o+1],r[4*o+2]=a[2*o],r[4*o+3]=a[2*o+1];r=pmt(r),this.generatePolygon("star",r),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(t){var n,r="polygon-"+t.join("$");return(n=this[r])?n:e.generatePolygon(r,t)}}},tEt={timeToRender:function(){return this.redrawTotalTime/this.redrawCount},redraw:function(t){t=t||zgt();var e=this;void 0===e.averageRedrawTime&&(e.averageRedrawTime=0),void 0===e.lastRedrawTime&&(e.lastRedrawTime=0),void 0===e.lastDrawTime&&(e.lastDrawTime=0),e.requestedFrame=!0,e.renderOptions=t},beforeRender:function(t,e){if(!this.destroyed){null==e&&Mgt("Priority is not optional for beforeRender");var n=this.beforeRenderCallbacks;n.push({fn:t,priority:e}),n.sort((function(t,e){return e.priority-t.priority}))}}},eEt=s((function(t,e,n){for(var r=t.beforeRenderCallbacks,i=0;i<r.length;i++)r[i].fn(e,n)}),"beforeRenderCallbacks");tEt.startRenderLoop=function(){var t=this,e=t.cy;if(!t.renderLoopStarted){t.renderLoopStarted=!0;var n=s((function n(r){if(!t.destroyed){if(e.batching());else if(t.requestedFrame&&!t.skipFrame){eEt(t,!0,r);var i=dgt();t.render(t.renderOptions);var a=t.lastDrawTime=dgt();void 0===t.averageRedrawTime&&(t.averageRedrawTime=a-i),void 0===t.redrawCount&&(t.redrawCount=0),t.redrawCount++,void 0===t.redrawTotalTime&&(t.redrawTotalTime=0);var s=a-i;t.redrawTotalTime+=s,t.lastRedrawTime=s,t.averageRedrawTime=t.averageRedrawTime/2+s/2,t.requestedFrame=!1}else eEt(t,!1,r);t.skipFrame=!1,ugt(n)}}),"renderFn");ugt(n)}};var nEt=s((function(t){this.init(t)}),"BaseRenderer"),rEt=nEt.prototype;rEt.clientFunctions=["redrawHint","render","renderTo","matchCanvasSize","nodeShapeImpl","arrowShapeImpl"],rEt.init=function(t){var e=this;e.options=t,e.cy=t.cy;var n=e.container=t.cy.container(),r=e.cy.window();if(r){var i=r.document,a=i.head,s="__________cytoscape_stylesheet",o="__________cytoscape_container",l=null!=i.getElementById(s);if(n.className.indexOf(o)<0&&(n.className=(n.className||"")+" "+o),!l){var c=i.createElement("style");c.id=s,c.textContent="."+o+" { position: relative; }",a.insertBefore(c,a.children[0])}"static"===r.getComputedStyle(n).getPropertyValue("position")&&Dgt("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.hideEdgesOnViewport=t.hideEdgesOnViewport,e.textureOnViewport=t.textureOnViewport,e.wheelSensitivity=t.wheelSensitivity,e.motionBlurEnabled=t.motionBlur,e.forcedPixelRatio=jdt(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()},rEt.notify=function(t,e){var n=this,r=n.cy;this.destroyed||("init"!==t?"destroy"!==t?(("add"===t||"remove"===t||"move"===t&&r.hasCompoundNodes()||"load"===t||"zorder"===t||"mount"===t)&&n.invalidateCachedZSortedEles(),"viewport"===t&&n.redrawHint("select",!0),"load"!==t&&"resize"!==t&&"mount"!==t||(n.invalidateContainerClientCoordsCache(),n.matchCanvasSize(n.container)),n.redrawHint("eles",!0),n.redrawHint("drag",!0),this.startRenderLoop(),this.redraw()):n.destroy():n.load())},rEt.destroy=function(){var t=this;t.destroyed=!0,t.cy.stopAnimationLoop();for(var e=0;e<t.bindings.length;e++){var n=t.bindings[e],r=n.target;(r.off||r.removeEventListener).apply(r,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(t){}},rEt.isHeadless=function(){return!1},[d_t,K_t,Z_t,Q_t,J_t,tEt].forEach((function(t){dpt(rEt,t)}));var iEt={setupDequeueing:s((function(t){return s((function(){var e=this,n=this.renderer;if(!e.dequeueingSetup){e.dequeueingSetup=!0;var r=ogt((function(){n.redrawHint("eles",!0),n.redrawHint("drag",!0),n.redraw()}),t.deqRedrawThreshold),i=s((function(i,a){var s=dgt(),o=n.averageRedrawTime,l=n.lastRedrawTime,c=[],h=n.cy.extent(),u=n.getPixelRatio();for(i||n.flushRenderedStyleQueue();;){var d=dgt(),p=d-s,g=d-a;if(l<16.666666666666668){var f=16.666666666666668-(i?o:0);if(g>=t.deqFastCost*f)break}else if(i){if(p>=t.deqCost*l||p>=t.deqAvgCost*o)break}else if(g>=16.666666666666668*t.deqNoDrawCost)break;var m=t.deq(e,u,h);if(!(m.length>0))break;for(var y=0;y<m.length;y++)c.push(m[y])}c.length>0&&(t.onDeqd(e,c),!i&&t.shouldRedraw(e,c,u,h)&&r())}),"dequeue"),a=t.priority||Igt;n.beforeRender(i,a(e))}}),"setupDequeueingImpl")}),"setupDequeueing")},aEt=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Lgt;wdt(this,t),this.idsByKey=new Hgt,this.keyForId=new Hgt,this.cachesByLvl=new Hgt,this.lvls=[],this.getKey=e,this.doesEleInvalidateKey=n}return s(t,"ElementTextureCacheLookup"),Tdt(t,[{key:"getIdsFor",value:s((function(t){null==t&&Mgt("Can not get id list for null key");var e=this.idsByKey,n=this.idsByKey.get(t);return n||(n=new Xgt,e.set(t,n)),n}),"getIdsFor")},{key:"addIdForKey",value:s((function(t,e){null!=t&&this.getIdsFor(t).add(e)}),"addIdForKey")},{key:"deleteIdForKey",value:s((function(t,e){null!=t&&this.getIdsFor(t).delete(e)}),"deleteIdForKey")},{key:"getNumberOfIdsForKey",value:s((function(t){return null==t?0:this.getIdsFor(t).size}),"getNumberOfIdsForKey")},{key:"updateKeyMappingFor",value:s((function(t){var e=t.id(),n=this.keyForId.get(e),r=this.getKey(t);this.deleteIdForKey(n,e),this.addIdForKey(r,e),this.keyForId.set(e,r)}),"updateKeyMappingFor")},{key:"deleteKeyMappingFor",value:s((function(t){var e=t.id(),n=this.keyForId.get(e);this.deleteIdForKey(n,e),this.keyForId.delete(e)}),"deleteKeyMappingFor")},{key:"keyHasChangedFor",value:s((function(t){var e=t.id();return this.keyForId.get(e)!==this.getKey(t)}),"keyHasChangedFor")},{key:"isInvalid",value:s((function(t){return this.keyHasChangedFor(t)||this.doesEleInvalidateKey(t)}),"isInvalid")},{key:"getCachesAt",value:s((function(t){var e=this.cachesByLvl,n=this.lvls,r=e.get(t);return r||(r=new Hgt,e.set(t,r),n.push(t)),r}),"getCachesAt")},{key:"getCache",value:s((function(t,e){return this.getCachesAt(e).get(t)}),"getCache")},{key:"get",value:s((function(t,e){var n=this.getKey(t),r=this.getCache(n,e);return null!=r&&this.updateKeyMappingFor(t),r}),"get")},{key:"getForCachedKey",value:s((function(t,e){var n=this.keyForId.get(t.id());return this.getCache(n,e)}),"getForCachedKey")},{key:"hasCache",value:s((function(t,e){return this.getCachesAt(e).has(t)}),"hasCache")},{key:"has",value:s((function(t,e){var n=this.getKey(t);return this.hasCache(n,e)}),"has")},{key:"setCache",value:s((function(t,e,n){n.key=t,this.getCachesAt(e).set(t,n)}),"setCache")},{key:"set",value:s((function(t,e,n){var r=this.getKey(t);this.setCache(r,e,n),this.updateKeyMappingFor(t)}),"set")},{key:"deleteCache",value:s((function(t,e){this.getCachesAt(e).delete(t)}),"deleteCache")},{key:"delete",value:s((function(t,e){var n=this.getKey(t);this.deleteCache(n,e)}),"_delete")},{key:"invalidateKey",value:s((function(t){var e=this;this.lvls.forEach((function(n){return e.deleteCache(t,n)}))}),"invalidateKey")},{key:"invalidate",value:s((function(t){var e=t.id(),n=this.keyForId.get(e);this.deleteKeyMappingFor(t);var r=this.doesEleInvalidateKey(t);return r&&this.invalidateKey(n),r||0===this.getNumberOfIdsForKey(n)}),"invalidate")}]),t}(),sEt={dequeue:"dequeue",downscale:"downscale",highQuality:"highQuality"},oEt=Ugt({getKey:null,doesEleInvalidateKey:Lgt,drawElement:null,getBoundingBox:null,getRotationPoint:null,getRotationOffset:null,isVisible:Agt,allowEdgeTxrCaching:!0,allowParentTxrCaching:!0}),lEt=s((function(t,e){var n=this;n.renderer=t,n.onDequeues=[];var r=oEt(e);dpt(n,r),n.lookup=new aEt(r.getKey,r.doesEleInvalidateKey),n.setupDequeueing()}),"ElementTextureCache"),cEt=lEt.prototype;cEt.reasons=sEt,cEt.getTextureQueue=function(t){var e=this;return e.eleImgCaches=e.eleImgCaches||{},e.eleImgCaches[t]=e.eleImgCaches[t]||[]},cEt.getRetiredTextureQueue=function(t){var e=this.eleImgCaches.retired=this.eleImgCaches.retired||{};return e[t]=e[t]||[]},cEt.getElementQueue=function(){var t=this.eleCacheQueue=this.eleCacheQueue||new tft((function(t,e){return e.reqs-t.reqs}));return t},cEt.getElementKeyToQueue=function(){return this.eleKeyToCacheQueue=this.eleKeyToCacheQueue||{}},cEt.getElement=function(t,e,n,r,i){var a=this,o=this.renderer,l=o.cy.zoom(),c=this.lookup;if(!e||0===e.w||0===e.h||isNaN(e.w)||isNaN(e.h)||!t.visible()||t.removed())return null;if(!a.allowEdgeTxrCaching&&t.isEdge()||!a.allowParentTxrCaching&&t.isParent())return null;if(null==r&&(r=Math.ceil(_ft(l*n))),r<-4)r=-4;else if(l>=7.99||r>3)return null;var h=Math.pow(2,r),u=e.h*h,d=e.w*h,p=o.eleTextBiggerThanMin(t,h);if(!this.isVisible(t,p))return null;var g,f=c.get(t,r);if(f&&f.invalidated&&(f.invalidated=!1,f.texture.invalidatedWidth-=f.width),f)return f;if(g=u<=25?25:u<=50?50:50*Math.ceil(u/50),u>1024||d>1024)return null;var m=a.getTextureQueue(g),y=m[m.length-2],v=s((function(){return a.recycleTexture(g,d)||a.addTexture(g,d)}),"addNewTxr");y||(y=m[m.length-1]),y||(y=v()),y.width-y.usedWidth<d&&(y=v());for(var x,b=s((function(t){return t&&t.scaledLabelShown===p}),"scalableFrom"),w=i&&i===sEt.dequeue,k=i&&i===sEt.highQuality,T=i&&i===sEt.downscale,_=r+1;_<=3;_++){var E=c.get(t,_);if(E){x=E;break}}var C=x&&x.level===r+1?x:null,S=s((function(){y.context.drawImage(C.texture.canvas,C.x,0,C.width,C.height,y.usedWidth,0,d,u)}),"downscale");if(y.context.setTransform(1,0,0,1,0,0),y.context.clearRect(y.usedWidth,0,d,g),b(C))S();else if(b(x)){if(!k)return a.queueElement(t,x.level-1),x;for(var A=x.level;A>r;A--)C=a.getElement(t,e,n,A,sEt.downscale);S()}else{var L;if(!w&&!k&&!T)for(var N=r-1;N>=-4;N--){var I=c.get(t,N);if(I){L=I;break}}if(b(L))return a.queueElement(t,r),L;y.context.translate(y.usedWidth,0),y.context.scale(h,h),this.drawElement(y.context,t,e,p,!1),y.context.scale(1/h,1/h),y.context.translate(-y.usedWidth,0)}return f={x:y.usedWidth,texture:y,level:r,scale:h,width:d,height:u,scaledLabelShown:p},y.usedWidth+=Math.ceil(d+8),y.eleCaches.push(f),c.set(t,r,f),a.checkTextureFullness(y),f},cEt.invalidateElements=function(t){for(var e=0;e<t.length;e++)this.invalidateElement(t[e])},cEt.invalidateElement=function(t){var e=this,n=e.lookup,r=[];if(n.isInvalid(t)){for(var i=-4;i<=3;i++){var a=n.getForCachedKey(t,i);a&&r.push(a)}if(n.invalidate(t))for(var s=0;s<r.length;s++){var o=r[s],l=o.texture;l.invalidatedWidth+=o.width,o.invalidated=!0,e.checkTextureUtility(l)}e.removeFromQueue(t)}},cEt.checkTextureUtility=function(t){t.invalidatedWidth>=.2*t.width&&this.retireTexture(t)},cEt.checkTextureFullness=function(t){var e=this.getTextureQueue(t.height);t.usedWidth/t.width>.8&&t.fullnessChecks>=10?Ggt(e,t):t.fullnessChecks++},cEt.retireTexture=function(t){var e=t.height,n=this.getTextureQueue(e),r=this.lookup;Ggt(n,t),t.retired=!0;for(var i=t.eleCaches,a=0;a<i.length;a++){var s=i[a];r.deleteCache(s.key,s.level)}qgt(i),this.getRetiredTextureQueue(e).push(t)},cEt.addTexture=function(t,e){var n={};return this.getTextureQueue(t).push(n),n.eleCaches=[],n.height=t,n.width=Math.max(1024,e),n.usedWidth=0,n.invalidatedWidth=0,n.fullnessChecks=0,n.canvas=this.renderer.makeOffscreenCanvas(n.width,n.height),n.context=n.canvas.getContext("2d"),n},cEt.recycleTexture=function(t,e){for(var n=this.getTextureQueue(t),r=this.getRetiredTextureQueue(t),i=0;i<r.length;i++){var a=r[i];if(a.width>=e)return a.retired=!1,a.usedWidth=0,a.invalidatedWidth=0,a.fullnessChecks=0,qgt(a.eleCaches),a.context.setTransform(1,0,0,1,0,0),a.context.clearRect(0,0,a.width,a.height),Ggt(r,a),n.push(a),a}},cEt.queueElement=function(t,e){var n=this.getElementQueue(),r=this.getElementKeyToQueue(),i=this.getKey(t),a=r[i];if(a)a.level=Math.max(a.level,e),a.eles.merge(t),a.reqs++,n.updateItem(a);else{var s={eles:t.spawn().merge(t),level:e,reqs:1,key:i};n.push(s),r[i]=s}},cEt.dequeue=function(t){for(var e=this,n=e.getElementQueue(),r=e.getElementKeyToQueue(),i=[],a=e.lookup,s=0;s<1&&n.size()>0;s++){var o=n.pop(),l=o.key,c=o.eles[0],h=a.hasCache(c,o.level);if(r[l]=null,!h){i.push(o);var u=e.getBoundingBox(c);e.getElement(c,u,t,o.level,sEt.dequeue)}}return i},cEt.removeFromQueue=function(t){var e=this.getElementQueue(),n=this.getElementKeyToQueue(),r=this.getKey(t),i=n[r];null!=i&&(1===i.eles.length?(i.reqs=Sgt,e.updateItem(i),e.pop(),n[r]=null):i.eles.unmerge(t))},cEt.onDequeue=function(t){this.onDequeues.push(t)},cEt.offDequeue=function(t){Ggt(this.onDequeues,t)},cEt.setupDequeueing=iEt.setupDequeueing({deqRedrawThreshold:100,deqCost:.15,deqAvgCost:.1,deqNoDrawCost:.9,deqFastCost:.9,deq:s((function(t,e,n){return t.dequeue(e,n)}),"deq"),onDeqd:s((function(t,e){for(var n=0;n<t.onDequeues.length;n++){(0,t.onDequeues[n])(e)}}),"onDeqd"),shouldRedraw:s((function(t,e,n,r){for(var i=0;i<e.length;i++)for(var a=e[i].eles,s=0;s<a.length;s++){var o=a[s].boundingBox();if(Gft(o,r))return!0}return!1}),"shouldRedraw"),priority:s((function(t){return t.renderer.beforeRenderPriorities.eleTxrDeq}),"priority")});var hEt=s((function(t){var e=this,n=e.renderer=t,r=n.cy;e.layersByLevel={},e.firstGet=!0,e.lastInvalidationTime=dgt()-500,e.skipping=!1,e.eleTxrDeqs=r.collection(),e.scheduleElementRefinement=ogt((function(){e.refineElementTextures(e.eleTxrDeqs),e.eleTxrDeqs.unmerge(e.eleTxrDeqs)}),50),n.beforeRender((function(t,n){n-e.lastInvalidationTime<=250?e.skipping=!0:e.skipping=!1}),n.beforeRenderPriorities.lyrTxrSkip);var i=s((function(t,e){return e.reqs-t.reqs}),"qSort");e.layersQueue=new tft(i),e.setupDequeueing()}),"LayeredTextureCache"),uEt=hEt.prototype,dEt=0,pEt=Math.pow(2,53)-1;uEt.makeLayer=function(t,e){var n=Math.pow(2,e),r=Math.ceil(t.w*n),i=Math.ceil(t.h*n),a=this.renderer.makeOffscreenCanvas(r,i),s={id:dEt=++dEt%pEt,bb:t,level:e,width:r,height:i,canvas:a,context:a.getContext("2d"),eles:[],elesQueue:[],reqs:0},o=s.context,l=-s.bb.x1,c=-s.bb.y1;return o.scale(n,n),o.translate(l,c),s},uEt.getLayers=function(t,e,n){var r=this,i=r.renderer.cy.zoom(),a=r.firstGet;if(r.firstGet=!1,null==n)if((n=Math.ceil(_ft(i*e)))<-4)n=-4;else if(i>=3.99||n>2)return null;r.validateLayersElesOrdering(n,t);var o,l,c=r.layersByLevel,h=Math.pow(2,n),u=c[n]=c[n]||[],d=r.levelIsComplete(n,t),p=s((function(){var e=s((function(e){if(r.validateLayersElesOrdering(e,t),r.levelIsComplete(e,t))return l=c[e],!0}),"canUseAsTmpLvl"),i=s((function(t){if(!l)for(var r=n+t;-4<=r&&r<=2&&!e(r);r+=t);}),"checkLvls");i(1),i(-1);for(var a=u.length-1;a>=0;a--){var o=u[a];o.invalid&&Ggt(u,o)}}),"checkTempLevels");if(d)return u;p();var g=s((function(){if(!o){o=Rft();for(var e=0;e<t.length;e++)Bft(o,t[e].boundingBox())}return o}),"getBb"),f=s((function(t){var e=(t=t||{}).after;if(g(),o.w*h*(o.h*h)>16e6)return null;var i=r.makeLayer(o,n);if(null!=e){var a=u.indexOf(e)+1;u.splice(a,0,i)}else(void 0===t.insert||t.insert)&&u.unshift(i);return i}),"makeLayer");if(r.skipping&&!a)return null;for(var m=null,y=t.length/1,v=!a,x=0;x<t.length;x++){var b=t[x],w=b._private.rscratch,k=w.imgLayerCaches=w.imgLayerCaches||{},T=k[n];if(T)m=T;else{if((!m||m.eles.length>=y||!Yft(m.bb,b.boundingBox()))&&!(m=f({insert:!0,after:m})))return null;l||v?r.queueLayer(m,b):r.drawEleInLayer(m,b,n,e),m.eles.push(b),k[n]=m}}return l||(v?null:u)},uEt.getEleLevelForLayerLevel=function(t,e){return t},uEt.drawEleInLayer=function(t,e,n,r){var i=this.renderer,a=t.context,s=e.boundingBox();0!==s.w&&0!==s.h&&e.visible()&&(n=this.getEleLevelForLayerLevel(n,r),i.setImgSmoothing(a,!1),i.drawCachedElement(a,e,null,null,n,true),i.setImgSmoothing(a,!0))},uEt.levelIsComplete=function(t,e){var n=this.layersByLevel[t];if(!n||0===n.length)return!1;for(var r=0,i=0;i<n.length;i++){var a=n[i];if(a.reqs>0)return!1;if(a.invalid)return!1;r+=a.eles.length}return r===e.length},uEt.validateLayersElesOrdering=function(t,e){var n=this.layersByLevel[t];if(n)for(var r=0;r<n.length;r++){for(var i=n[r],a=-1,s=0;s<e.length;s++)if(i.eles[0]===e[s]){a=s;break}if(a<0)this.invalidateLayer(i);else{var o=a;for(s=0;s<i.eles.length;s++)if(i.eles[s]!==e[o+s]){this.invalidateLayer(i);break}}}},uEt.updateElementsInLayers=function(t,e){for(var n=Vdt(t[0]),r=0;r<t.length;r++)for(var i=n?null:t[r],a=n?t[r]:t[r].ele,s=a._private.rscratch,o=s.imgLayerCaches=s.imgLayerCaches||{},l=-4;l<=2;l++){var c=o[l];c&&(i&&this.getEleLevelForLayerLevel(c.level)!==i.level||e(c,a,i))}},uEt.haveLayers=function(){for(var t=!1,e=-4;e<=2;e++){var n=this.layersByLevel[e];if(n&&n.length>0){t=!0;break}}return t},uEt.invalidateElements=function(t){var e=this;0!==t.length&&(e.lastInvalidationTime=dgt(),0!==t.length&&e.haveLayers()&&e.updateElementsInLayers(t,s((function(t,n,r){e.invalidateLayer(t)}),"invalAssocLayers")))},uEt.invalidateLayer=function(t){if(this.lastInvalidationTime=dgt(),!t.invalid){var e=t.level,n=t.eles,r=this.layersByLevel[e];Ggt(r,t),t.elesQueue=[],t.invalid=!0,t.replacement&&(t.replacement.invalid=!0);for(var i=0;i<n.length;i++){var a=n[i]._private.rscratch.imgLayerCaches;a&&(a[e]=null)}}},uEt.refineElementTextures=function(t){var e=this;e.updateElementsInLayers(t,s((function(t,n,r){var i=t.replacement;if(i||((i=t.replacement=e.makeLayer(t.bb,t.level)).replaces=t,i.eles=t.eles),!i.reqs)for(var a=0;a<i.eles.length;a++)e.queueLayer(i,i.eles[a])}),"refineEachEle"))},uEt.enqueueElementRefinement=function(t){this.eleTxrDeqs.merge(t),this.scheduleElementRefinement()},uEt.queueLayer=function(t,e){var n=this.layersQueue,r=t.elesQueue,i=r.hasId=r.hasId||{};if(!t.replacement){if(e){if(i[e.id()])return;r.push(e),i[e.id()]=!0}t.reqs?(t.reqs++,n.updateItem(t)):(t.reqs=1,n.push(t))}},uEt.dequeue=function(t){for(var e=this,n=e.layersQueue,r=[],i=0;i<1&&0!==n.size();){var a=n.peek();if(a.replacement)n.pop();else if(a.replaces&&a!==a.replaces.replacement)n.pop();else if(a.invalid)n.pop();else{var s=a.elesQueue.shift();s&&(e.drawEleInLayer(a,s,a.level,t),i++),0===r.length&&r.push(!0),0===a.elesQueue.length&&(n.pop(),a.reqs=0,a.replaces&&e.applyLayerReplacement(a),e.requestRedraw())}}return r},uEt.applyLayerReplacement=function(t){var e=this.layersByLevel[t.level],n=t.replaces,r=e.indexOf(n);if(!(r<0||n.invalid)){e[r]=t;for(var i=0;i<t.eles.length;i++){var a=t.eles[i]._private,s=a.imgLayerCaches=a.imgLayerCaches||{};s&&(s[t.level]=t)}this.requestRedraw()}},uEt.requestRedraw=ogt((function(){var t=this.renderer;t.redrawHint("eles",!0),t.redrawHint("drag",!0),t.redraw()}),100),uEt.setupDequeueing=iEt.setupDequeueing({deqRedrawThreshold:50,deqCost:.15,deqAvgCost:.1,deqNoDrawCost:.9,deqFastCost:.9,deq:s((function(t,e){return t.dequeue(e)}),"deq"),onDeqd:Igt,shouldRedraw:Agt,priority:s((function(t){return t.renderer.beforeRenderPriorities.lyrTxrDeq}),"priority")});var gEt,fEt={};function mEt(t,e){for(var n=0;n<e.length;n++){var r=e[n];t.lineTo(r.x,r.y)}}function yEt(t,e,n){for(var r,i=0;i<e.length;i++){var a=e[i];0===i&&(r=a),t.lineTo(a.x,a.y)}t.quadraticCurveTo(n.x,n.y,r.x,r.y)}function vEt(t,e,n){t.beginPath&&t.beginPath();for(var r=e,i=0;i<r.length;i++){var a=r[i];t.lineTo(a.x,a.y)}var s=n,o=n[0];t.moveTo(o.x,o.y);for(i=1;i<s.length;i++){a=s[i];t.lineTo(a.x,a.y)}t.closePath&&t.closePath()}function xEt(t,e,n,r,i){t.beginPath&&t.beginPath(),t.arc(n,r,i,0,2*Math.PI,!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 bEt(t,e,n,r){t.arc(e,n,r,0,2*Math.PI,!1)}s(mEt,"polygon"),s(yEt,"triangleBackcurve"),s(vEt,"triangleTee"),s(xEt,"circleTriangle"),s(bEt,"circle"),fEt.arrowShapeImpl=function(t){return(gEt||(gEt={polygon:mEt,"triangle-backcurve":yEt,"triangle-tee":vEt,"circle-triangle":xEt,"triangle-cross":vEt,circle:bEt}))[t]};var wEt={drawElement:function(t,e,n,r,i,a){e.isNode()?this.drawNode(t,e,n,r,i,a):this.drawEdge(t,e,n,r,i,a)},drawElementOverlay:function(t,e){e.isNode()?this.drawNodeOverlay(t,e):this.drawEdgeOverlay(t,e)},drawElementUnderlay:function(t,e){e.isNode()?this.drawNodeUnderlay(t,e):this.drawEdgeUnderlay(t,e)},drawCachedElementPortion:function(t,e,n,r,i,a,s,o){var l=this,c=n.getBoundingBox(e);if(0!==c.w&&0!==c.h){var h=n.getElement(e,c,r,i,a);if(null!=h){var u=o(l,e);if(0===u)return;var d,p,g,f,m,y,v=s(l,e),x=c.x1,b=c.y1,w=c.w,k=c.h;if(0!==v){var T=n.getRotationPoint(e);g=T.x,f=T.y,t.translate(g,f),t.rotate(v),(m=l.getImgSmoothing(t))||l.setImgSmoothing(t,!0);var _=n.getRotationOffset(e);d=_.x,p=_.y}else d=x,p=b;1!==u&&(y=t.globalAlpha,t.globalAlpha=y*u),t.drawImage(h.texture.canvas,h.x,0,h.width,h.height,d,p,w,k),1!==u&&(t.globalAlpha=y),0!==v&&(t.rotate(-v),t.translate(-g,-f),m||l.setImgSmoothing(t,!1))}else n.drawElement(t,e)}}},kEt=s((function(){return 0}),"getZeroRotation"),TEt=s((function(t,e){return t.getTextAngle(e,null)}),"getLabelRotation"),_Et=s((function(t,e){return t.getTextAngle(e,"source")}),"getSourceLabelRotation"),EEt=s((function(t,e){return t.getTextAngle(e,"target")}),"getTargetLabelRotation"),CEt=s((function(t,e){return e.effectiveOpacity()}),"getOpacity"),SEt=s((function(t,e){return e.pstyle("text-opacity").pfValue*e.effectiveOpacity()}),"getTextOpacity");wEt.drawCachedElement=function(t,e,n,r,i,a){var s=this,o=s.data,l=o.eleTxrCache,c=o.lblTxrCache,h=o.slbTxrCache,u=o.tlbTxrCache,d=e.boundingBox(),p=!0===a?l.reasons.highQuality:null;if(0!==d.w&&0!==d.h&&e.visible()&&(!r||Gft(d,r))){var g=e.isEdge(),f=e.element()._private.rscratch.badLine;s.drawElementUnderlay(t,e),s.drawCachedElementPortion(t,e,l,n,i,p,kEt,CEt),g&&f||s.drawCachedElementPortion(t,e,c,n,i,p,TEt,SEt),g&&!f&&(s.drawCachedElementPortion(t,e,h,n,i,p,_Et,SEt),s.drawCachedElementPortion(t,e,u,n,i,p,EEt,SEt)),s.drawElementOverlay(t,e)}},wEt.drawElements=function(t,e){for(var n=0;n<e.length;n++){var r=e[n];this.drawElement(t,r)}},wEt.drawCachedElements=function(t,e,n,r){for(var i=0;i<e.length;i++){var a=e[i];this.drawCachedElement(t,a,n,r)}},wEt.drawCachedNodes=function(t,e,n,r){for(var i=0;i<e.length;i++){var a=e[i];a.isNode()&&this.drawCachedElement(t,a,n,r)}},wEt.drawLayeredElements=function(t,e,n,r){var i=this.data.lyrTxrCache.getLayers(e,n);if(i)for(var a=0;a<i.length;a++){var s=i[a],o=s.bb;0!==o.w&&0!==o.h&&t.drawImage(s.canvas,o.x1,o.y1,o.w,o.h)}else this.drawCachedElements(t,e,n,r)};var AEt={drawEdge:function(t,e,n){var r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],a=!(arguments.length>5&&void 0!==arguments[5])||arguments[5],o=this,l=e._private.rscratch;if((!a||e.visible())&&!l.badLine&&null!=l.allpts&&!isNaN(l.allpts[0])){var c;n&&(c=n,t.translate(-c.x1,-c.y1));var h=a?e.pstyle("opacity").value:1,u=a?e.pstyle("line-opacity").value:1,d=e.pstyle("curve-style").value,p=e.pstyle("line-style").value,g=e.pstyle("width").pfValue,f=e.pstyle("line-cap").value,m=e.pstyle("line-outline-width").value,y=e.pstyle("line-outline-color").value,v=h*u,x=h*u,b=s((function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:v;"straight-triangle"===d?(o.eleStrokeStyle(t,e,n),o.drawEdgeTrianglePath(e,t,l.allpts)):(t.lineWidth=g,t.lineCap=f,o.eleStrokeStyle(t,e,n),o.drawEdgePath(e,t,l.allpts,p),t.lineCap="butt")}),"drawLine"),w=s((function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:v;t.lineWidth=g+m,t.lineCap=f,m>0?(o.colorStrokeStyle(t,y[0],y[1],y[2],n),"straight-triangle"===d?o.drawEdgeTrianglePath(e,t,l.allpts):(o.drawEdgePath(e,t,l.allpts,p),t.lineCap="butt")):t.lineCap="butt"}),"drawLineOutline"),k=s((function(){i&&o.drawEdgeOverlay(t,e)}),"drawOverlay"),T=s((function(){i&&o.drawEdgeUnderlay(t,e)}),"drawUnderlay"),_=s((function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:x;o.drawArrowheads(t,e,n)}),"drawArrows"),E=s((function(){o.drawElementText(t,e,null,r)}),"drawText");t.lineJoin="round";var C="yes"===e.pstyle("ghost").value;if(C){var S=e.pstyle("ghost-offset-x").pfValue,A=e.pstyle("ghost-offset-y").pfValue,L=e.pstyle("ghost-opacity").value,N=v*L;t.translate(S,A),b(N),_(N),t.translate(-S,-A)}else w();T(),b(),_(),k(),E(),n&&t.translate(c.x1,c.y1)}}},LEt=s((function(t){if(!["overlay","underlay"].includes(t))throw new Error("Invalid state");return function(e,n){if(n.visible()){var r=n.pstyle("".concat(t,"-opacity")).value;if(0!==r){var i=this,a=i.usePaths(),s=n._private.rscratch,o=2*n.pstyle("".concat(t,"-padding")).pfValue,l=n.pstyle("".concat(t,"-color")).value;e.lineWidth=o,"self"!==s.edgeType||a?e.lineCap="round":e.lineCap="butt",i.colorStrokeStyle(e,l[0],l[1],l[2],r),i.drawEdgePath(n,e,s.allpts,"solid")}}}}),"drawEdgeOverlayUnderlay");AEt.drawEdgeOverlay=LEt("overlay"),AEt.drawEdgeUnderlay=LEt("underlay"),AEt.drawEdgePath=function(t,e,n,r){var i,a=t._private.rscratch,s=e,o=!1,l=this.usePaths(),c=t.pstyle("line-dash-pattern").pfValue,h=t.pstyle("line-dash-offset").pfValue;if(l){var u=n.join("$");a.pathCacheKey&&a.pathCacheKey===u?(i=e=a.pathCache,o=!0):(i=e=new Path2D,a.pathCacheKey=u,a.pathCache=i)}if(s.setLineDash)switch(r){case"dotted":s.setLineDash([1,1]);break;case"dashed":s.setLineDash(c),s.lineDashOffset=h;break;case"solid":s.setLineDash([])}if(!o&&!a.badLine)switch(e.beginPath&&e.beginPath(),e.moveTo(n[0],n[1]),a.edgeType){case"bezier":case"self":case"compound":case"multibezier":for(var d=2;d+3<n.length;d+=4)e.quadraticCurveTo(n[d],n[d+1],n[d+2],n[d+3]);break;case"straight":case"haystack":for(var p=2;p+1<n.length;p+=2)e.lineTo(n[p],n[p+1]);break;case"segments":if(a.isRound){var g,f=Idt(a.roundCorners);try{for(f.s();!(g=f.n()).done;){O_t(e,g.value)}}catch(t){f.e(t)}finally{f.f()}e.lineTo(n[n.length-2],n[n.length-1])}else for(var m=2;m+1<n.length;m+=2)e.lineTo(n[m],n[m+1])}e=s,l?e.stroke(i):e.stroke(),e.setLineDash&&e.setLineDash([])},AEt.drawEdgeTrianglePath=function(t,e,n){e.fillStyle=e.strokeStyle;for(var r=t.pstyle("width").pfValue,i=0;i+1<n.length;i+=2){var a=[n[i+2]-n[i],n[i+3]-n[i+1]],s=Math.sqrt(a[0]*a[0]+a[1]*a[1]),o=[a[1]/s,-a[0]/s],l=[o[0]*r/2,o[1]*r/2];e.beginPath(),e.moveTo(n[i]-l[0],n[i+1]-l[1]),e.lineTo(n[i]+l[0],n[i+1]+l[1]),e.lineTo(n[i+2],n[i+3]),e.closePath(),e.fill()}},AEt.drawArrowheads=function(t,e,n){var r=e._private.rscratch,i="haystack"===r.edgeType;i||this.drawArrowhead(t,e,"source",r.arrowStartX,r.arrowStartY,r.srcArrowAngle,n),this.drawArrowhead(t,e,"mid-target",r.midX,r.midY,r.midtgtArrowAngle,n),this.drawArrowhead(t,e,"mid-source",r.midX,r.midY,r.midsrcArrowAngle,n),i||this.drawArrowhead(t,e,"target",r.arrowEndX,r.arrowEndY,r.tgtArrowAngle,n)},AEt.drawArrowhead=function(t,e,n,r,i,a,s){if(!(isNaN(r)||null==r||isNaN(i)||null==i||isNaN(a)||null==a)){var o=this,l=e.pstyle(n+"-arrow-shape").value;if("none"!==l){var c="hollow"===e.pstyle(n+"-arrow-fill").value?"both":"filled",h=e.pstyle(n+"-arrow-fill").value,u=e.pstyle("width").pfValue,d=e.pstyle(n+"-arrow-width"),p="match-line"===d.value?u:d.pfValue;"%"===d.units&&(p*=u);var g=e.pstyle("opacity").value;void 0===s&&(s=g);var f=t.globalCompositeOperation;1===s&&"hollow"!==h||(t.globalCompositeOperation="destination-out",o.colorFillStyle(t,255,255,255,1),o.colorStrokeStyle(t,255,255,255,1),o.drawArrowShape(e,t,c,u,l,p,r,i,a),t.globalCompositeOperation=f);var m=e.pstyle(n+"-arrow-color").value;o.colorFillStyle(t,m[0],m[1],m[2],s),o.colorStrokeStyle(t,m[0],m[1],m[2],s),o.drawArrowShape(e,t,h,u,l,p,r,i,a)}}},AEt.drawArrowShape=function(t,e,n,r,i,a,s,o,l){var c,h=this,u=this.usePaths()&&"triangle-cross"!==i,d=!1,p=e,g={x:s,y:o},f=t.pstyle("arrow-scale").value,m=this.getArrowWidth(r,f),y=h.arrowShapes[i];if(u){var v=h.arrowPathCache=h.arrowPathCache||[],x=wgt(i),b=v[x];null!=b?(c=e=b,d=!0):(c=e=new Path2D,v[x]=c)}d||(e.beginPath&&e.beginPath(),u?y.draw(e,1,0,{x:0,y:0},1):y.draw(e,m,l,g,r),e.closePath&&e.closePath()),e=p,u&&(e.translate(s,o),e.rotate(l),e.scale(m,m)),"filled"!==n&&"both"!==n||(u?e.fill(c):e.fill()),"hollow"!==n&&"both"!==n||(e.lineWidth=a/(u?m:1),e.lineJoin="miter",u?e.stroke(c):e.stroke()),u&&(e.scale(1/m,1/m),e.rotate(-l),e.translate(-s,-o))};var NEt={safeDrawImage:function(t,e,n,r,i,a,s,o,l,c){if(!(i<=0||a<=0||l<=0||c<=0))try{t.drawImage(e,n,r,i,a,s,o,l,c)}catch(t){Dgt(t)}},drawInscribedImage:function(t,e,n,r,i){var a=this,s=n.position(),o=s.x,l=s.y,c=n.cy().style(),h=c.getIndexedStyle.bind(c),u=h(n,"background-fit","value",r),d=h(n,"background-repeat","value",r),p=n.width(),g=n.height(),f=2*n.padding(),m=p+("inner"===h(n,"background-width-relative-to","value",r)?0:f),y=g+("inner"===h(n,"background-height-relative-to","value",r)?0:f),v=n._private.rscratch,x="node"===h(n,"background-clip","value",r),b=h(n,"background-image-opacity","value",r)*i,w=h(n,"background-image-smoothing","value",r),k=n.pstyle("corner-radius").value;"auto"!==k&&(k=n.pstyle("corner-radius").pfValue);var T=e.width||e.cachedW,_=e.height||e.cachedH;null!=T&&null!=_||(document.body.appendChild(e),T=e.cachedW=e.width||e.offsetWidth,_=e.cachedH=e.height||e.offsetHeight,document.body.removeChild(e));var E=T,C=_;if("auto"!==h(n,"background-width","value",r)&&(E="%"===h(n,"background-width","units",r)?h(n,"background-width","pfValue",r)*m:h(n,"background-width","pfValue",r)),"auto"!==h(n,"background-height","value",r)&&(C="%"===h(n,"background-height","units",r)?h(n,"background-height","pfValue",r)*y:h(n,"background-height","pfValue",r)),0!==E&&0!==C){if("contain"===u)E*=S=Math.min(m/E,y/C),C*=S;else if("cover"===u){var S;E*=S=Math.max(m/E,y/C),C*=S}var A=o-m/2,L=h(n,"background-position-x","units",r),N=h(n,"background-position-x","pfValue",r);A+="%"===L?(m-E)*N:N;var I=h(n,"background-offset-x","units",r),M=h(n,"background-offset-x","pfValue",r);A+="%"===I?(m-E)*M:M;var R=l-y/2,D=h(n,"background-position-y","units",r),O=h(n,"background-position-y","pfValue",r);R+="%"===D?(y-C)*O:O;var P=h(n,"background-offset-y","units",r),B=h(n,"background-offset-y","pfValue",r);R+="%"===P?(y-C)*B:B,v.pathCache&&(A-=o,R-=l,o=0,l=0);var $=t.globalAlpha;t.globalAlpha=b;var F=a.getImgSmoothing(t),z=!1;if("no"===w&&F?(a.setImgSmoothing(t,!1),z=!0):"yes"!==w||F||(a.setImgSmoothing(t,!0),z=!0),"no-repeat"===d)x&&(t.save(),v.pathCache?t.clip(v.pathCache):(a.nodeShapes[a.getNodeShape(n)].draw(t,o,l,m,y,k,v),t.clip())),a.safeDrawImage(t,e,0,0,T,_,A,R,E,C),x&&t.restore();else{var U=t.createPattern(e,d);t.fillStyle=U,a.nodeShapes[a.getNodeShape(n)].draw(t,o,l,m,y,k,v),t.translate(A,R),t.fill(),t.translate(-A,-R)}t.globalAlpha=$,z&&a.setImgSmoothing(t,F)}}},IEt={};function MEt(t,e,n,r,i){var a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:5,s=arguments.length>6?arguments[6]:void 0;t.beginPath(),t.moveTo(e+a,n),t.lineTo(e+r-a,n),t.quadraticCurveTo(e+r,n,e+r,n+a),t.lineTo(e+r,n+i-a),t.quadraticCurveTo(e+r,n+i,e+r-a,n+i),t.lineTo(e+a,n+i),t.quadraticCurveTo(e,n+i,e,n+i-a),t.lineTo(e,n+a),t.quadraticCurveTo(e,n,e+a,n),t.closePath(),s?t.stroke():t.fill()}IEt.eleTextBiggerThanMin=function(t,e){if(!e){var n=t.cy().zoom(),r=this.getPixelRatio(),i=Math.ceil(_ft(n*r));e=Math.pow(2,i)}return!(t.pstyle("font-size").pfValue*e<t.pstyle("min-zoomed-font-size").pfValue)},IEt.drawElementText=function(t,e,n,r,i){var a=!(arguments.length>5&&void 0!==arguments[5])||arguments[5],s=this;if(null==r){if(a&&!s.eleTextBiggerThanMin(e))return}else if(!1===r)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 c=e.element()._private.rscratch.badLine,h=e.pstyle("label"),u=e.pstyle("source-label"),d=e.pstyle("target-label");if(c||(!h||!h.value)&&(!u||!u.value)&&(!d||!d.value))return;t.textAlign="center",t.textBaseline="bottom"}var p,g=!n;n&&(p=n,t.translate(-p.x1,-p.y1)),null==i?(s.drawText(t,e,null,g,a),e.isEdge()&&(s.drawText(t,e,"source",g,a),s.drawText(t,e,"target",g,a))):s.drawText(t,e,i,g,a),n&&t.translate(p.x1,p.y1)},IEt.getFontCache=function(t){var e;this.fontCaches=this.fontCaches||[];for(var n=0;n<this.fontCaches.length;n++)if((e=this.fontCaches[n]).context===t)return e;return e={context:t},this.fontCaches.push(e),e},IEt.setupTextStyle=function(t,e){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=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=n?e.effectiveOpacity()*e.pstyle("text-opacity").value:1,l=e.pstyle("text-outline-opacity").value*o,c=e.pstyle("color").value,h=e.pstyle("text-outline-color").value;t.font=r+" "+s+" "+i+" "+a,t.lineJoin="round",this.colorFillStyle(t,c[0],c[1],c[2],o),this.colorStrokeStyle(t,h[0],h[1],h[2],l)},s(MEt,"roundRect"),IEt.getTextAngle=function(t,e){var n=t._private.rscratch,r=e?e+"-":"",i=t.pstyle(r+"text-rotation"),a=Ygt(n,"labelAngle",e);return"autorotate"===i.strValue?t.isEdge()?a:0:"none"===i.strValue?0:i.pfValue},IEt.drawText=function(t,e,n){var r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],a=e._private,s=a.rscratch,o=i?e.effectiveOpacity():1;if(!i||0!==o&&0!==e.pstyle("text-opacity").value){"main"===n&&(n=null);var l,c,h=Ygt(s,"labelX",n),u=Ygt(s,"labelY",n),d=this.getLabelText(e,n);if(null!=d&&""!==d&&!isNaN(h)&&!isNaN(u)){this.setupTextStyle(t,e,i);var p,g=n?n+"-":"",f=Ygt(s,"labelWidth",n),m=Ygt(s,"labelHeight",n),y=e.pstyle(g+"text-margin-x").pfValue,v=e.pstyle(g+"text-margin-y").pfValue,x=e.isEdge(),b=e.pstyle("text-halign").value,w=e.pstyle("text-valign").value;switch(x&&(b="center",w="center"),h+=y,u+=v,0!==(p=r?this.getTextAngle(e,n):0)&&(l=h,c=u,t.translate(l,c),t.rotate(p),h=0,u=0),w){case"top":break;case"center":u+=m/2;break;case"bottom":u+=m}var k=e.pstyle("text-background-opacity").value,T=e.pstyle("text-border-opacity").value,_=e.pstyle("text-border-width").pfValue,E=e.pstyle("text-background-padding").pfValue,C=e.pstyle("text-background-shape").strValue,S=0===C.indexOf("round"),A=2;if(k>0||_>0&&T>0){var L=h-E;switch(b){case"left":L-=f;break;case"center":L-=f/2}var N=u-m-E,I=f+2*E,M=m+2*E;if(k>0){var R=t.fillStyle,D=e.pstyle("text-background-color").value;t.fillStyle="rgba("+D[0]+","+D[1]+","+D[2]+","+k*o+")",S?MEt(t,L,N,I,M,A):t.fillRect(L,N,I,M),t.fillStyle=R}if(_>0&&T>0){var O=t.strokeStyle,P=t.lineWidth,B=e.pstyle("text-border-color").value,$=e.pstyle("text-border-style").value;if(t.strokeStyle="rgba("+B[0]+","+B[1]+","+B[2]+","+T*o+")",t.lineWidth=_,t.setLineDash)switch($){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash([4,2]);break;case"double":t.lineWidth=_/4,t.setLineDash([]);break;case"solid":t.setLineDash([])}if(S?MEt(t,L,N,I,M,A,"stroke"):t.strokeRect(L,N,I,M),"double"===$){var F=_/2;S?MEt(t,L+F,N+F,I-2*F,M-2*F,A,"stroke"):t.strokeRect(L+F,N+F,I-2*F,M-2*F)}t.setLineDash&&t.setLineDash([]),t.lineWidth=P,t.strokeStyle=O}}var z=2*e.pstyle("text-outline-width").pfValue;if(z>0&&(t.lineWidth=z),"wrap"===e.pstyle("text-wrap").value){var U=Ygt(s,"labelWrapCachedLines",n),G=Ygt(s,"labelLineHeight",n),q=f/2,j=this.getLabelJustification(e);switch("auto"===j||("left"===b?"left"===j?h+=-f:"center"===j&&(h+=-q):"center"===b?"left"===j?h+=-q:"right"===j&&(h+=q):"right"===b&&("center"===j?h+=q:"right"===j&&(h+=f))),w){case"top":case"center":case"bottom":u-=(U.length-1)*G}for(var Y=0;Y<U.length;Y++)z>0&&t.strokeText(U[Y],h,u),t.fillText(U[Y],h,u),u+=G}else z>0&&t.strokeText(d,h,u),t.fillText(d,h,u);0!==p&&(t.rotate(-p),t.translate(-l,-c))}}};var REt={drawNode:function(t,e,n){var r,i,a=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],o=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],l=!(arguments.length>5&&void 0!==arguments[5])||arguments[5],c=this,h=e._private,u=h.rscratch,d=e.position();if(jdt(d.x)&&jdt(d.y)&&(!l||e.visible())){var p,g,f=l?e.effectiveOpacity():1,m=c.usePaths(),y=!1,v=e.padding();r=e.width()+2*v,i=e.height()+2*v,n&&(g=n,t.translate(-g.x1,-g.y1));for(var x=e.pstyle("background-image"),b=x.value,w=new Array(b.length),k=new Array(b.length),T=0,_=0;_<b.length;_++){var E=b[_],C=w[_]=null!=E&&"none"!==E;if(C){var S=e.cy().style().getIndexedStyle(e,"background-image-crossorigin","value",_);T++,k[_]=c.getCachedImage(E,S,(function(){h.backgroundTimestamp=Date.now(),e.emitAndNotify("background")}))}}var A=e.pstyle("background-blacken").value,L=e.pstyle("border-width").pfValue,N=e.pstyle("background-opacity").value*f,I=e.pstyle("border-color").value,M=e.pstyle("border-style").value,R=e.pstyle("border-join").value,D=e.pstyle("border-cap").value,O=e.pstyle("border-position").value,P=e.pstyle("border-dash-pattern").pfValue,B=e.pstyle("border-dash-offset").pfValue,$=e.pstyle("border-opacity").value*f,F=e.pstyle("outline-width").pfValue,z=e.pstyle("outline-color").value,U=e.pstyle("outline-style").value,G=e.pstyle("outline-opacity").value*f,q=e.pstyle("outline-offset").value,j=e.pstyle("corner-radius").value;"auto"!==j&&(j=e.pstyle("corner-radius").pfValue);var Y=s((function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:N;c.eleFillStyle(t,e,n)}),"setupShapeColor"),W=s((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:$;c.colorStrokeStyle(t,I[0],I[1],I[2],e)}),"setupBorderColor"),H=s((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:G;c.colorStrokeStyle(t,z[0],z[1],z[2],e)}),"setupOutlineColor"),V=s((function(t,e,n,r){var i,a=c.nodePathCache=c.nodePathCache||[],s=kgt("polygon"===n?n+","+r.join(","):n,""+e,""+t,""+j),o=a[s],l=!1;return null!=o?(i=o,l=!0,u.pathCache=i):(i=new Path2D,a[s]=u.pathCache=i),{path:i,cacheHit:l}}),"getPath"),X=e.pstyle("shape").strValue,K=e.pstyle("shape-polygon-points").pfValue;if(m){t.translate(d.x,d.y);var Z=V(r,i,X,K);p=Z.path,y=Z.cacheHit}var Q=s((function(){if(!y){var n=d;m&&(n={x:0,y:0}),c.nodeShapes[c.getNodeShape(e)].draw(p||t,n.x,n.y,r,i,j,u)}m?t.fill(p):t.fill()}),"drawShape"),J=s((function(){for(var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:f,r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=h.backgrounding,a=0,s=0;s<k.length;s++){var o=e.cy().style().getIndexedStyle(e,"background-image-containment","value",s);r&&"over"===o||!r&&"inside"===o?a++:w[s]&&k[s].complete&&!k[s].error&&(a++,c.drawInscribedImage(t,k[s],e,s,n))}h.backgrounding=!(a===T),i!==h.backgrounding&&e.updateStyle(!1)}),"drawImages"),tt=s((function(){var n=arguments.length>0&&void 0!==arguments[0]&&arguments[0],a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:f;c.hasPie(e)&&(c.drawPie(t,e,a),n&&(m||c.nodeShapes[c.getNodeShape(e)].draw(t,d.x,d.y,r,i,j,u)))}),"drawPie"),et=s((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:f,n=(A>0?A:-A)*e,r=A>0?0:255;0!==A&&(c.colorFillStyle(t,r,r,r,n),m?t.fill(p):t.fill())}),"darken"),nt=s((function(){if(L>0){if(t.lineWidth=L,t.lineCap=D,t.lineJoin=R,t.setLineDash)switch(M){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash(P),t.lineDashOffset=B;break;case"solid":case"double":t.setLineDash([])}if("center"!==O){if(t.save(),t.lineWidth*=2,"inside"===O)m?t.clip(p):t.clip();else{var e=new Path2D;e.rect(-r/2-L,-i/2-L,r+2*L,i+2*L),e.addPath(p),t.clip(e,"evenodd")}m?t.stroke(p):t.stroke(),t.restore()}else m?t.stroke(p):t.stroke();if("double"===M){t.lineWidth=L/3;var n=t.globalCompositeOperation;t.globalCompositeOperation="destination-out",m?t.stroke(p):t.stroke(),t.globalCompositeOperation=n}t.setLineDash&&t.setLineDash([])}}),"drawBorder"),rt=s((function(){if(F>0){if(t.lineWidth=F,t.lineCap="butt",t.setLineDash)switch(U){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash([4,2]);break;case"solid":case"double":t.setLineDash([])}var n=d;m&&(n={x:0,y:0});var a=c.getNodeShape(e),s=L;"inside"===O&&(s=0),"outside"===O&&(s*=2);var o,l=(r+s+(F+q))/r,h=(i+s+(F+q))/i,u=r*l,p=i*h,g=c.nodeShapes[a].points;if(m)o=V(u,p,a,g).path;if("ellipse"===a)c.drawEllipsePath(o||t,n.x,n.y,u,p);else if(["round-diamond","round-heptagon","round-hexagon","round-octagon","round-pentagon","round-polygon","round-triangle","round-tag"].includes(a)){var f=0,y=0,v=0;"round-diamond"===a?f=1.4*(s+q+F):"round-heptagon"===a?(f=1.075*(s+q+F),v=-(s/2+q+F)/35):"round-hexagon"===a?f=1.12*(s+q+F):"round-pentagon"===a?(f=1.13*(s+q+F),v=-(s/2+q+F)/15):"round-tag"===a?(f=1.12*(s+q+F),y=.07*(s/2+F+q)):"round-triangle"===a&&(f=(s+q+F)*(Math.PI/2),v=-(s+q/2+F)/Math.PI),0!==f&&(u=r*(l=(r+f)/r),["round-hexagon","round-tag"].includes(a)||(p=i*(h=(i+f)/i)));for(var x=u/2,b=p/2,w=(j="auto"===j?mmt(u,p):j)+(s+F+q)/2,k=new Array(g.length/2),T=new Array(g.length/2),_=0;_<g.length/2;_++)k[_]={x:n.x+y+x*g[2*_],y:n.y+v+b*g[2*_+1]};var E,C,S,A,N=k.length;for(C=k[N-1],E=0;E<N;E++)S=k[E%N],A=k[(E+1)%N],T[E]=P_t(C,S,A,w),C=S,S=A;c.drawRoundPolygonPath(o||t,n.x+y,n.y+v,r*l,i*h,g,T)}else if(["roundrectangle","round-rectangle"].includes(a))j="auto"===j?fmt(u,p):j,c.drawRoundRectanglePath(o||t,n.x,n.y,u,p,j+(s+F+q)/2);else if(["cutrectangle","cut-rectangle"].includes(a))j="auto"===j?ymt():j,c.drawCutRectanglePath(o||t,n.x,n.y,u,p,null,j+(s+F+q)/4);else if(["bottomroundrectangle","bottom-round-rectangle"].includes(a))j="auto"===j?fmt(u,p):j,c.drawBottomRoundRectanglePath(o||t,n.x,n.y,u,p,j+(s+F+q)/2);else if("barrel"===a)c.drawBarrelPath(o||t,n.x,n.y,u,p);else if(a.startsWith("polygon")||["rhomboid","right-rhomboid","round-tag","tag","vee"].includes(a)){g=nmt(rmt(g,(s+F+q)/r)),c.drawPolygonPath(o||t,n.x,n.y,r,i,g)}else{g=nmt(rmt(g,-((s+F+q)/r))),c.drawPolygonPath(o||t,n.x,n.y,r,i,g)}if(m?t.stroke(o):t.stroke(),"double"===U){t.lineWidth=s/3;var I=t.globalCompositeOperation;t.globalCompositeOperation="destination-out",m?t.stroke(o):t.stroke(),t.globalCompositeOperation=I}t.setLineDash&&t.setLineDash([])}}),"drawOutline"),it=s((function(){o&&c.drawNodeOverlay(t,e,d,r,i)}),"drawOverlay"),at=s((function(){o&&c.drawNodeUnderlay(t,e,d,r,i)}),"drawUnderlay"),st=s((function(){c.drawElementText(t,e,null,a)}),"drawText"),ot="yes"===e.pstyle("ghost").value;if(ot){var lt=e.pstyle("ghost-offset-x").pfValue,ct=e.pstyle("ghost-offset-y").pfValue,ht=e.pstyle("ghost-opacity").value,ut=ht*f;t.translate(lt,ct),H(),rt(),Y(ht*N),Q(),J(ut,!0),W(ht*$),nt(),tt(0!==A||0!==L),J(ut,!1),et(ut),t.translate(-lt,-ct)}m&&t.translate(-d.x,-d.y),at(),m&&t.translate(d.x,d.y),H(),rt(),Y(),Q(),J(f,!0),W(),nt(),tt(0!==A||0!==L),J(f,!1),et(),m&&t.translate(-d.x,-d.y),st(),it(),n&&t.translate(g.x1,g.y1)}}},DEt=s((function(t){if(!["overlay","underlay"].includes(t))throw new Error("Invalid state");return function(e,n,r,i,a){if(n.visible()){var s=n.pstyle("".concat(t,"-padding")).pfValue,o=n.pstyle("".concat(t,"-opacity")).value,l=n.pstyle("".concat(t,"-color")).value,c=n.pstyle("".concat(t,"-shape")).value,h=n.pstyle("".concat(t,"-corner-radius")).value;if(o>0){if(r=r||n.position(),null==i||null==a){var u=n.padding();i=n.width()+2*u,a=n.height()+2*u}this.colorFillStyle(e,l[0],l[1],l[2],o),this.nodeShapes[c].draw(e,r.x,r.y,i+2*s,a+2*s,h),e.fill()}}}}),"drawNodeOverlayUnderlay");REt.drawNodeOverlay=DEt("overlay"),REt.drawNodeUnderlay=DEt("underlay"),REt.hasPie=function(t){return(t=t[0])._private.hasPie},REt.drawPie=function(t,e,n,r){e=e[0],r=r||e.position();var i=e.cy().style(),a=e.pstyle("pie-size"),s=r.x,o=r.y,l=e.width(),c=e.height(),h=Math.min(l,c)/2,u=0;this.usePaths()&&(s=0,o=0),"%"===a.units?h*=a.pfValue:void 0!==a.pfValue&&(h=a.pfValue/2);for(var d=1;d<=i.pieBackgroundN;d++){var p=e.pstyle("pie-"+d+"-background-size").value,g=e.pstyle("pie-"+d+"-background-color").value,f=e.pstyle("pie-"+d+"-background-opacity").value*n,m=p/100;m+u>1&&(m=1-u);var y=1.5*Math.PI+2*Math.PI*u,v=y+2*Math.PI*m;0===p||u>=1||u+m>1||(t.beginPath(),t.moveTo(s,o),t.arc(s,o,h,y,v),t.closePath(),this.colorFillStyle(t,g[0],g[1],g[2],f),t.fill(),u+=m)}};var OEt={};OEt.getPixelRatio=function(){var t=this.data.contexts[0];if(null!=this.forcedPixelRatio)return this.forcedPixelRatio;var e=this.cy.window(),n=t.backingStorePixelRatio||t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1;return(e.devicePixelRatio||1)/n},OEt.paintCache=function(t){for(var e,n=this.paintCaches=this.paintCaches||[],r=!0,i=0;i<n.length;i++)if((e=n[i]).context===t){r=!1;break}return r&&(e={context:t},n.push(e)),e},OEt.createGradientStyleFor=function(t,e,n,r,i){var a,s=this.usePaths(),o=n.pstyle(e+"-gradient-stop-colors").value,l=n.pstyle(e+"-gradient-stop-positions").pfValue;if("radial-gradient"===r)if(n.isEdge()){var c=n.sourceEndpoint(),h=n.targetEndpoint(),u=n.midpoint(),d=Cft(c,u),p=Cft(h,u);a=t.createRadialGradient(u.x,u.y,0,u.x,u.y,Math.max(d,p))}else{var g=s?{x:0,y:0}:n.position(),f=n.paddedWidth(),m=n.paddedHeight();a=t.createRadialGradient(g.x,g.y,0,g.x,g.y,Math.max(f,m))}else if(n.isEdge()){var y=n.sourceEndpoint(),v=n.targetEndpoint();a=t.createLinearGradient(y.x,y.y,v.x,v.y)}else{var x=s?{x:0,y:0}:n.position(),b=n.paddedWidth()/2,w=n.paddedHeight()/2;switch(n.pstyle("background-gradient-direction").value){case"to-bottom":a=t.createLinearGradient(x.x,x.y-w,x.x,x.y+w);break;case"to-top":a=t.createLinearGradient(x.x,x.y+w,x.x,x.y-w);break;case"to-left":a=t.createLinearGradient(x.x+b,x.y,x.x-b,x.y);break;case"to-right":a=t.createLinearGradient(x.x-b,x.y,x.x+b,x.y);break;case"to-bottom-right":case"to-right-bottom":a=t.createLinearGradient(x.x-b,x.y-w,x.x+b,x.y+w);break;case"to-top-right":case"to-right-top":a=t.createLinearGradient(x.x-b,x.y+w,x.x+b,x.y-w);break;case"to-bottom-left":case"to-left-bottom":a=t.createLinearGradient(x.x+b,x.y-w,x.x-b,x.y+w);break;case"to-top-left":case"to-left-top":a=t.createLinearGradient(x.x+b,x.y+w,x.x-b,x.y-w)}}if(!a)return null;for(var k=l.length===o.length,T=o.length,_=0;_<T;_++)a.addColorStop(k?l[_]:_/(T-1),"rgba("+o[_][0]+","+o[_][1]+","+o[_][2]+","+i+")");return a},OEt.gradientFillStyle=function(t,e,n,r){var i=this.createGradientStyleFor(t,"background",e,n,r);if(!i)return null;t.fillStyle=i},OEt.colorFillStyle=function(t,e,n,r,i){t.fillStyle="rgba("+e+","+n+","+r+","+i+")"},OEt.eleFillStyle=function(t,e,n){var r=e.pstyle("background-fill").value;if("linear-gradient"===r||"radial-gradient"===r)this.gradientFillStyle(t,e,r,n);else{var i=e.pstyle("background-color").value;this.colorFillStyle(t,i[0],i[1],i[2],n)}},OEt.gradientStrokeStyle=function(t,e,n,r){var i=this.createGradientStyleFor(t,"line",e,n,r);if(!i)return null;t.strokeStyle=i},OEt.colorStrokeStyle=function(t,e,n,r,i){t.strokeStyle="rgba("+e+","+n+","+r+","+i+")"},OEt.eleStrokeStyle=function(t,e,n){var r=e.pstyle("line-fill").value;if("linear-gradient"===r||"radial-gradient"===r)this.gradientStrokeStyle(t,e,r,n);else{var i=e.pstyle("line-color").value;this.colorStrokeStyle(t,i[0],i[1],i[2],n)}},OEt.matchCanvasSize=function(t){var e=this,n=e.data,r=e.findContainerClientCoords(),i=r[2],a=r[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,c=i*s,h=a*s;if(c!==e.canvasWidth||h!==e.canvasHeight){e.fontCaches=null;var u=n.canvasContainer;u.style.width=i+"px",u.style.height=a+"px";for(var d=0;d<e.CANVAS_LAYERS;d++)(l=n.canvases[d]).width=c,l.height=h,l.style.width=i+"px",l.style.height=a+"px";for(d=0;d<e.BUFFER_COUNT;d++)(l=n.bufferCanvases[d]).width=c,l.height=h,l.style.width=i+"px",l.style.height=a+"px";e.textureMult=1,s<=1&&(l=n.bufferCanvases[e.TEXTURE_BUFFER],e.textureMult=2,l.width=c*e.textureMult,l.height=h*e.textureMult),e.canvasWidth=c,e.canvasHeight=h}},OEt.renderTo=function(t,e,n,r){this.render({forcedContext:t,forcedZoom:e,forcedPan:n,drawAllLayers:!0,forcedPxRatio:r})},OEt.render=function(t){var e=(t=t||zgt()).forcedContext,n=t.drawAllLayers,r=t.drawOnlyNodeLayer,i=t.forcedZoom,a=t.forcedPan,o=this,l=void 0===t.forcedPxRatio?this.getPixelRatio():t.forcedPxRatio,c=o.cy,h=o.data,u=h.canvasNeedsRedraw,d=o.textureOnViewport&&!e&&(o.pinching||o.hoverData.dragging||o.swipePanning||o.data.wheelZooming),p=void 0!==t.motionBlur?t.motionBlur:o.motionBlur,g=o.motionBlurPxRatio,f=c.hasCompoundNodes(),m=o.hoverData.draggingEles,y=!(!o.hoverData.selecting&&!o.touchData.selecting),v=p=p&&!e&&o.motionBlurEnabled&&!y;e||(o.prevPxRatio!==l&&(o.invalidateContainerClientCoordsCache(),o.matchCanvasSize(o.container),o.redrawHint("eles",!0),o.redrawHint("drag",!0)),o.prevPxRatio=l),!e&&o.motionBlurTimeout&&clearTimeout(o.motionBlurTimeout),p&&(null==o.mbFrames&&(o.mbFrames=0),o.mbFrames++,o.mbFrames<3&&(v=!1),o.mbFrames>o.minMbLowQualFrames&&(o.motionBlurPxRatio=o.mbPxRBlurry)),o.clearingMotionBlur&&(o.motionBlurPxRatio=1),o.textureDrawLastFrame&&!d&&(u[o.NODE]=!0,u[o.SELECT_BOX]=!0);var x=c.style(),b=c.zoom(),w=void 0!==i?i:b,k=c.pan(),T={x:k.x,y:k.y},_={zoom:b,pan:{x:k.x,y:k.y}},E=o.prevViewport;void 0===E||_.zoom!==E.zoom||_.pan.x!==E.pan.x||_.pan.y!==E.pan.y||m&&!f||(o.motionBlurPxRatio=1),a&&(T=a),w*=l,T.x*=l,T.y*=l;var C=o.getCachedZSortedEles();function S(t,e,n,r,i){var a=t.globalCompositeOperation;t.globalCompositeOperation="destination-out",o.colorFillStyle(t,255,255,255,o.motionBlurTransparency),t.fillRect(e,n,r,i),t.globalCompositeOperation=a}function A(t,r){var s,l,c,u;o.clearingMotionBlur||t!==h.bufferContexts[o.MOTIONBLUR_BUFFER_NODE]&&t!==h.bufferContexts[o.MOTIONBLUR_BUFFER_DRAG]?(s=T,l=w,c=o.canvasWidth,u=o.canvasHeight):(s={x:k.x*g,y:k.y*g},l=b*g,c=o.canvasWidth*g,u=o.canvasHeight*g),t.setTransform(1,0,0,1,0,0),"motionBlur"===r?S(t,0,0,c,u):e||void 0!==r&&!r||t.clearRect(0,0,c,u),n||(t.translate(s.x,s.y),t.scale(l,l)),a&&t.translate(a.x,a.y),i&&t.scale(i,i)}if(s(S,"mbclear"),s(A,"setContextTransform"),d||(o.textureDrawLastFrame=!1),d){if(o.textureDrawLastFrame=!0,!o.textureCache){o.textureCache={},o.textureCache.bb=c.mutableElements().boundingBox(),o.textureCache.texture=o.data.bufferCanvases[o.TEXTURE_BUFFER];var L=o.data.bufferContexts[o.TEXTURE_BUFFER];L.setTransform(1,0,0,1,0,0),L.clearRect(0,0,o.canvasWidth*o.textureMult,o.canvasHeight*o.textureMult),o.render({forcedContext:L,drawOnlyNodeLayer:!0,forcedPxRatio:l*o.textureMult}),(_=o.textureCache.viewport={zoom:c.zoom(),pan:c.pan(),width:o.canvasWidth,height:o.canvasHeight}).mpan={x:(0-_.pan.x)/_.zoom,y:(0-_.pan.y)/_.zoom}}u[o.DRAG]=!1,u[o.NODE]=!1;var N=h.contexts[o.NODE],I=o.textureCache.texture;_=o.textureCache.viewport;N.setTransform(1,0,0,1,0,0),p?S(N,0,0,_.width,_.height):N.clearRect(0,0,_.width,_.height);var M=x.core("outside-texture-bg-color").value,R=x.core("outside-texture-bg-opacity").value;o.colorFillStyle(N,M[0],M[1],M[2],R),N.fillRect(0,0,_.width,_.height);b=c.zoom();A(N,!1),N.clearRect(_.mpan.x,_.mpan.y,_.width/_.zoom/l,_.height/_.zoom/l),N.drawImage(I,_.mpan.x,_.mpan.y,_.width/_.zoom/l,_.height/_.zoom/l)}else o.textureOnViewport&&!e&&(o.textureCache=null);var D=c.extent(),O=o.pinching||o.hoverData.dragging||o.swipePanning||o.data.wheelZooming||o.hoverData.draggingEles||o.cy.animated(),P=o.hideEdgesOnViewport&&O,B=[];if(B[o.NODE]=!u[o.NODE]&&p&&!o.clearedForMotionBlur[o.NODE]||o.clearingMotionBlur,B[o.NODE]&&(o.clearedForMotionBlur[o.NODE]=!0),B[o.DRAG]=!u[o.DRAG]&&p&&!o.clearedForMotionBlur[o.DRAG]||o.clearingMotionBlur,B[o.DRAG]&&(o.clearedForMotionBlur[o.DRAG]=!0),u[o.NODE]||n||r||B[o.NODE]){var $=p&&!B[o.NODE]&&1!==g;A(N=e||($?o.data.bufferContexts[o.MOTIONBLUR_BUFFER_NODE]:h.contexts[o.NODE]),p&&!$?"motionBlur":void 0),P?o.drawCachedNodes(N,C.nondrag,l,D):o.drawLayeredElements(N,C.nondrag,l,D),o.debug&&o.drawDebugPoints(N,C.nondrag),n||p||(u[o.NODE]=!1)}if(!r&&(u[o.DRAG]||n||B[o.DRAG])){$=p&&!B[o.DRAG]&&1!==g;A(N=e||($?o.data.bufferContexts[o.MOTIONBLUR_BUFFER_DRAG]:h.contexts[o.DRAG]),p&&!$?"motionBlur":void 0),P?o.drawCachedNodes(N,C.drag,l,D):o.drawCachedElements(N,C.drag,l,D),o.debug&&o.drawDebugPoints(N,C.drag),n||p||(u[o.DRAG]=!1)}if(o.showFps||!r&&u[o.SELECT_BOX]&&!n){if(A(N=e||h.contexts[o.SELECT_BOX]),1==o.selection[4]&&(o.hoverData.selecting||o.touchData.selecting)){b=o.cy.zoom();var F=x.core("selection-box-border-width").value/b;N.lineWidth=F,N.fillStyle="rgba("+x.core("selection-box-color").value[0]+","+x.core("selection-box-color").value[1]+","+x.core("selection-box-color").value[2]+","+x.core("selection-box-opacity").value+")",N.fillRect(o.selection[0],o.selection[1],o.selection[2]-o.selection[0],o.selection[3]-o.selection[1]),F>0&&(N.strokeStyle="rgba("+x.core("selection-box-border-color").value[0]+","+x.core("selection-box-border-color").value[1]+","+x.core("selection-box-border-color").value[2]+","+x.core("selection-box-opacity").value+")",N.strokeRect(o.selection[0],o.selection[1],o.selection[2]-o.selection[0],o.selection[3]-o.selection[1]))}if(h.bgActivePosistion&&!o.hoverData.selecting){b=o.cy.zoom();var z=h.bgActivePosistion;N.fillStyle="rgba("+x.core("active-bg-color").value[0]+","+x.core("active-bg-color").value[1]+","+x.core("active-bg-color").value[2]+","+x.core("active-bg-opacity").value+")",N.beginPath(),N.arc(z.x,z.y,x.core("active-bg-size").pfValue/b,0,2*Math.PI),N.fill()}var U=o.lastRedrawTime;if(o.showFps&&U){U=Math.round(U);var G=Math.round(1e3/U);N.setTransform(1,0,0,1,0,0),N.fillStyle="rgba(255, 0, 0, 0.75)",N.strokeStyle="rgba(255, 0, 0, 0.75)",N.lineWidth=1,N.fillText("1 frame = "+U+" ms = "+G+" fps",0,20);N.strokeRect(0,30,250,20),N.fillRect(0,30,250*Math.min(G/60,1),20)}n||(u[o.SELECT_BOX]=!1)}if(p&&1!==g){var q=h.contexts[o.NODE],j=o.data.bufferCanvases[o.MOTIONBLUR_BUFFER_NODE],Y=h.contexts[o.DRAG],W=o.data.bufferCanvases[o.MOTIONBLUR_BUFFER_DRAG],H=s((function(t,e,n){t.setTransform(1,0,0,1,0,0),n||!v?t.clearRect(0,0,o.canvasWidth,o.canvasHeight):S(t,0,0,o.canvasWidth,o.canvasHeight);var r=g;t.drawImage(e,0,0,o.canvasWidth*r,o.canvasHeight*r,0,0,o.canvasWidth,o.canvasHeight)}),"drawMotionBlur");(u[o.NODE]||B[o.NODE])&&(H(q,j,B[o.NODE]),u[o.NODE]=!1),(u[o.DRAG]||B[o.DRAG])&&(H(Y,W,B[o.DRAG]),u[o.DRAG]=!1)}o.prevViewport=_,o.clearingMotionBlur&&(o.clearingMotionBlur=!1,o.motionBlurCleared=!0,o.motionBlur=!0),p&&(o.motionBlurTimeout=setTimeout((function(){o.motionBlurTimeout=null,o.clearedForMotionBlur[o.NODE]=!1,o.clearedForMotionBlur[o.DRAG]=!1,o.motionBlur=!1,o.clearingMotionBlur=!d,o.mbFrames=0,u[o.NODE]=!0,u[o.DRAG]=!0,o.redraw()}),100)),e||c.emit("render")};var PEt,BEt={drawPolygonPath:function(t,e,n,r,i,a){var s=r/2,o=i/2;t.beginPath&&t.beginPath(),t.moveTo(e+s*a[0],n+o*a[1]);for(var l=1;l<a.length/2;l++)t.lineTo(e+s*a[2*l],n+o*a[2*l+1]);t.closePath()},drawRoundPolygonPath:function(t,e,n,r,i,a,s){s.forEach((function(e){return O_t(t,e)})),t.closePath()},drawRoundRectanglePath:function(t,e,n,r,i,a){var s=r/2,o=i/2,l="auto"===a?fmt(r,i):Math.min(a,o,s);t.beginPath&&t.beginPath(),t.moveTo(e,n-o),t.arcTo(e+s,n-o,e+s,n,l),t.arcTo(e+s,n+o,e,n+o,l),t.arcTo(e-s,n+o,e-s,n,l),t.arcTo(e-s,n-o,e,n-o,l),t.lineTo(e,n-o),t.closePath()},drawBottomRoundRectanglePath:function(t,e,n,r,i,a){var s=r/2,o=i/2,l="auto"===a?fmt(r,i):a;t.beginPath&&t.beginPath(),t.moveTo(e,n-o),t.lineTo(e+s,n-o),t.lineTo(e+s,n),t.arcTo(e+s,n+o,e,n+o,l),t.arcTo(e-s,n+o,e-s,n,l),t.lineTo(e-s,n-o),t.lineTo(e,n-o),t.closePath()},drawCutRectanglePath:function(t,e,n,r,i,a,s){var o=r/2,l=i/2,c="auto"===s?ymt():s;t.beginPath&&t.beginPath(),t.moveTo(e-o+c,n-l),t.lineTo(e+o-c,n-l),t.lineTo(e+o,n-l+c),t.lineTo(e+o,n+l-c),t.lineTo(e+o-c,n+l),t.lineTo(e-o+c,n+l),t.lineTo(e-o,n+l-c),t.lineTo(e-o,n-l+c),t.closePath()},drawBarrelPath:function(t,e,n,r,i){var a=r/2,s=i/2,o=e-a,l=e+a,c=n-s,h=n+s,u=xmt(r,i),d=u.widthOffset,p=u.heightOffset,g=u.ctrlPtOffsetPct*d;t.beginPath&&t.beginPath(),t.moveTo(o,c+p),t.lineTo(o,h-p),t.quadraticCurveTo(o+g,h,o+d,h),t.lineTo(l-d,h),t.quadraticCurveTo(l-g,h,l,h-p),t.lineTo(l,c+p),t.quadraticCurveTo(l-g,c,l-d,c),t.lineTo(o+d,c),t.quadraticCurveTo(o+g,c,o,c+p),t.closePath()}},$Et=Math.sin(0),FEt=Math.cos(0),zEt={},UEt={},GEt=Math.PI/40;for(PEt=0*Math.PI;PEt<2*Math.PI;PEt+=GEt)zEt[PEt]=Math.sin(PEt),UEt[PEt]=Math.cos(PEt);BEt.drawEllipsePath=function(t,e,n,r,i){if(t.beginPath&&t.beginPath(),t.ellipse)t.ellipse(e,n,r/2,i/2,0,0,2*Math.PI);else for(var a,s,o=r/2,l=i/2,c=0*Math.PI;c<2*Math.PI;c+=GEt)a=e-o*zEt[c]*$Et+o*UEt[c]*FEt,s=n+l*UEt[c]*$Et+l*zEt[c]*FEt,0===c?t.moveTo(a,s):t.lineTo(a,s);t.closePath()};var qEt={};function jEt(t,e){for(var n=atob(t),r=new ArrayBuffer(n.length),i=new Uint8Array(r),a=0;a<n.length;a++)i[a]=n.charCodeAt(a);return new Blob([r],{type:e})}function YEt(t){var e=t.indexOf(",");return t.substr(e+1)}function WEt(t,e,n){var r=s((function(){return e.toDataURL(n,t.quality)}),"getB64Uri");switch(t.output){case"blob-promise":return new Yyt((function(r,i){try{e.toBlob((function(t){null!=t?r(t):i(new Error("`canvas.toBlob()` sent a null value in its callback"))}),n,t.quality)}catch(t){i(t)}}));case"blob":return jEt(YEt(r()),n);case"base64":return YEt(r());default:return r()}}qEt.createBuffer=function(t,e){var n=document.createElement("canvas");return n.width=t,n.height=e,[n,n.getContext("2d")]},qEt.bufferCanvasImage=function(t){var e=this.cy,n=e.mutableElements().boundingBox(),r=this.findContainerClientCoords(),i=t.full?Math.ceil(n.w):r[2],a=t.full?Math.ceil(n.h):r[3],s=jdt(t.maxWidth)||jdt(t.maxHeight),o=this.getPixelRatio(),l=1;if(void 0!==t.scale)i*=t.scale,a*=t.scale,l=t.scale;else if(s){var c=1/0,h=1/0;jdt(t.maxWidth)&&(c=l*t.maxWidth/i),jdt(t.maxHeight)&&(h=l*t.maxHeight/a),i*=l=Math.min(c,h),a*=l}s||(i*=o,a*=o,l*=o);var u=document.createElement("canvas");u.width=i,u.height=a,u.style.width=i+"px",u.style.height=a+"px";var d=u.getContext("2d");if(i>0&&a>0){d.clearRect(0,0,i,a),d.globalCompositeOperation="source-over";var p=this.getCachedZSortedEles();if(t.full)d.translate(-n.x1*l,-n.y1*l),d.scale(l,l),this.drawElements(d,p),d.scale(1/l,1/l),d.translate(n.x1*l,n.y1*l);else{var g=e.pan(),f={x:g.x*l,y:g.y*l};l*=e.zoom(),d.translate(f.x,f.y),d.scale(l,l),this.drawElements(d,p),d.scale(1/l,1/l),d.translate(-f.x,-f.y)}t.bg&&(d.globalCompositeOperation="destination-over",d.fillStyle=t.bg,d.rect(0,0,i,a),d.fill())}return u},s(jEt,"b64ToBlob"),s(YEt,"b64UriToB64"),s(WEt,"output"),qEt.png=function(t){return WEt(t,this.bufferCanvasImage(t),"image/png")},qEt.jpg=function(t){return WEt(t,this.bufferCanvasImage(t),"image/jpeg")};var HEt={nodeShapeImpl:function(t,e,n,r,i,a,s,o){switch(t){case"ellipse":return this.drawEllipsePath(e,n,r,i,a);case"polygon":return this.drawPolygonPath(e,n,r,i,a,s);case"round-polygon":return this.drawRoundPolygonPath(e,n,r,i,a,s,o);case"roundrectangle":case"round-rectangle":return this.drawRoundRectanglePath(e,n,r,i,a,o);case"cutrectangle":case"cut-rectangle":return this.drawCutRectanglePath(e,n,r,i,a,s,o);case"bottomroundrectangle":case"bottom-round-rectangle":return this.drawBottomRoundRectanglePath(e,n,r,i,a,o);case"barrel":return this.drawBarrelPath(e,n,r,i,a)}}},VEt=KEt,XEt=KEt.prototype;function KEt(t){var e=this,n=e.cy.window().document;e.data={canvases:new Array(XEt.CANVAS_LAYERS),contexts:new Array(XEt.CANVAS_LAYERS),canvasNeedsRedraw:new Array(XEt.CANVAS_LAYERS),bufferCanvases:new Array(XEt.BUFFER_COUNT),bufferContexts:new Array(XEt.CANVAS_LAYERS)};var r="-webkit-tap-highlight-color",i="rgba(0,0,0,0)";e.data.canvasContainer=n.createElement("div");var a=e.data.canvasContainer.style;e.data.canvasContainer.style[r]=i,a.position="relative",a.zIndex="0",a.overflow="hidden";var o=t.cy.container();o.appendChild(e.data.canvasContainer),o.style[r]=i;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"};rpt()&&(l["-ms-touch-action"]="none",l["touch-action"]="none");for(var c=0;c<XEt.CANVAS_LAYERS;c++){var h=e.data.canvases[c]=n.createElement("canvas");e.data.contexts[c]=h.getContext("2d"),Object.keys(l).forEach((function(t){h.style[t]=l[t]})),h.style.position="absolute",h.setAttribute("data-id","layer"+c),h.style.zIndex=String(XEt.CANVAS_LAYERS-c),e.data.canvasContainer.appendChild(h),e.data.canvasNeedsRedraw[c]=!1}e.data.topCanvas=e.data.canvases[0],e.data.canvases[XEt.NODE].setAttribute("data-id","layer"+XEt.NODE+"-node"),e.data.canvases[XEt.SELECT_BOX].setAttribute("data-id","layer"+XEt.SELECT_BOX+"-selectbox"),e.data.canvases[XEt.DRAG].setAttribute("data-id","layer"+XEt.DRAG+"-drag");for(c=0;c<XEt.BUFFER_COUNT;c++)e.data.bufferCanvases[c]=n.createElement("canvas"),e.data.bufferContexts[c]=e.data.bufferCanvases[c].getContext("2d"),e.data.bufferCanvases[c].style.position="absolute",e.data.bufferCanvases[c].setAttribute("data-id","buffer"+c),e.data.bufferCanvases[c].style.zIndex=String(-c-1),e.data.bufferCanvases[c].style.visibility="hidden";e.pathsEnabled=!0;var u=Rft(),d=s((function(t){return{x:(t.x1+t.x2)/2,y:(t.y1+t.y2)/2}}),"getBoxCenter"),p=s((function(t){return{x:-t.w/2,y:-t.h/2}}),"getCenterOffset"),g=s((function(t){var e=t[0]._private;return!(e.oldBackgroundTimestamp===e.backgroundTimestamp)}),"backgroundTimestampHasChanged"),f=s((function(t){return t[0]._private.nodeKey}),"getStyleKey"),m=s((function(t){return t[0]._private.labelStyleKey}),"getLabelKey"),y=s((function(t){return t[0]._private.sourceLabelStyleKey}),"getSourceLabelKey"),v=s((function(t){return t[0]._private.targetLabelStyleKey}),"getTargetLabelKey"),x=s((function(t,n,r,i,a){return e.drawElement(t,n,r,!1,!1,a)}),"drawElement"),b=s((function(t,n,r,i,a){return e.drawElementText(t,n,r,i,"main",a)}),"drawLabel"),w=s((function(t,n,r,i,a){return e.drawElementText(t,n,r,i,"source",a)}),"drawSourceLabel"),k=s((function(t,n,r,i,a){return e.drawElementText(t,n,r,i,"target",a)}),"drawTargetLabel"),T=s((function(t){return t.boundingBox(),t[0]._private.bodyBounds}),"getElementBox"),_=s((function(t){return t.boundingBox(),t[0]._private.labelBounds.main||u}),"getLabelBox"),E=s((function(t){return t.boundingBox(),t[0]._private.labelBounds.source||u}),"getSourceLabelBox"),C=s((function(t){return t.boundingBox(),t[0]._private.labelBounds.target||u}),"getTargetLabelBox"),S=s((function(t,e){return e}),"isLabelVisibleAtScale"),A=s((function(t){return d(T(t))}),"getElementRotationPoint"),L=s((function(t,e,n){var r=t?t+"-":"";return{x:e.x+n.pstyle(r+"text-margin-x").pfValue,y:e.y+n.pstyle(r+"text-margin-y").pfValue}}),"addTextMargin"),N=s((function(t,e,n){var r=t[0]._private.rscratch;return{x:r[e],y:r[n]}}),"getRsPt"),I=s((function(t){return L("",N(t,"labelX","labelY"),t)}),"getLabelRotationPoint"),M=s((function(t){return L("source",N(t,"sourceLabelX","sourceLabelY"),t)}),"getSourceLabelRotationPoint"),R=s((function(t){return L("target",N(t,"targetLabelX","targetLabelY"),t)}),"getTargetLabelRotationPoint"),D=s((function(t){return p(T(t))}),"getElementRotationOffset"),O=s((function(t){return p(E(t))}),"getSourceLabelRotationOffset"),P=s((function(t){return p(C(t))}),"getTargetLabelRotationOffset"),B=s((function(t){var e=_(t),n=p(_(t));if(t.isNode()){switch(t.pstyle("text-halign").value){case"left":n.x=-e.w;break;case"right":n.x=0}switch(t.pstyle("text-valign").value){case"top":n.y=-e.h;break;case"bottom":n.y=0}}return n}),"getLabelRotationOffset"),$=e.data.eleTxrCache=new lEt(e,{getKey:f,doesEleInvalidateKey:g,drawElement:x,getBoundingBox:T,getRotationPoint:A,getRotationOffset:D,allowEdgeTxrCaching:!1,allowParentTxrCaching:!1}),F=e.data.lblTxrCache=new lEt(e,{getKey:m,drawElement:b,getBoundingBox:_,getRotationPoint:I,getRotationOffset:B,isVisible:S}),z=e.data.slbTxrCache=new lEt(e,{getKey:y,drawElement:w,getBoundingBox:E,getRotationPoint:M,getRotationOffset:O,isVisible:S}),U=e.data.tlbTxrCache=new lEt(e,{getKey:v,drawElement:k,getBoundingBox:C,getRotationPoint:R,getRotationOffset:P,isVisible:S}),G=e.data.lyrTxrCache=new hEt(e);e.onUpdateEleCalcs(s((function(t,e){$.invalidateElements(e),F.invalidateElements(e),z.invalidateElements(e),U.invalidateElements(e),G.invalidateElements(e);for(var n=0;n<e.length;n++){var r=e[n]._private;r.oldBackgroundTimestamp=r.backgroundTimestamp}}),"invalidateTextureCaches"));var q=s((function(t){for(var e=0;e<t.length;e++)G.enqueueElementRefinement(t[e].ele)}),"refineInLayers");$.onDequeue(q),F.onDequeue(q),z.onDequeue(q),U.onDequeue(q)}XEt.CANVAS_LAYERS=3,XEt.SELECT_BOX=0,XEt.DRAG=1,XEt.NODE=2,XEt.BUFFER_COUNT=3,XEt.TEXTURE_BUFFER=0,XEt.MOTIONBLUR_BUFFER_NODE=1,XEt.MOTIONBLUR_BUFFER_DRAG=2,s(KEt,"CanvasRenderer"),XEt.redrawHint=function(t,e){var n=this;switch(t){case"eles":n.data.canvasNeedsRedraw[XEt.NODE]=e;break;case"drag":n.data.canvasNeedsRedraw[XEt.DRAG]=e;break;case"select":n.data.canvasNeedsRedraw[XEt.SELECT_BOX]=e}};var ZEt="undefined"!=typeof Path2D;XEt.path2dEnabled=function(t){if(void 0===t)return this.pathsEnabled;this.pathsEnabled=!!t},XEt.usePaths=function(){return ZEt&&this.pathsEnabled},XEt.setImgSmoothing=function(t,e){null!=t.imageSmoothingEnabled?t.imageSmoothingEnabled=e:(t.webkitImageSmoothingEnabled=e,t.mozImageSmoothingEnabled=e,t.msImageSmoothingEnabled=e)},XEt.getImgSmoothing=function(t){return null!=t.imageSmoothingEnabled?t.imageSmoothingEnabled:t.webkitImageSmoothingEnabled||t.mozImageSmoothingEnabled||t.msImageSmoothingEnabled},XEt.makeOffscreenCanvas=function(t,e){var n;"undefined"!==("undefined"==typeof OffscreenCanvas?"undefined":bdt(OffscreenCanvas))?n=new OffscreenCanvas(t,e):((n=this.cy.window().document.createElement("canvas")).width=t,n.height=e);return n},[fEt,wEt,AEt,NEt,IEt,REt,OEt,BEt,qEt,HEt].forEach((function(t){dpt(XEt,t)}));var QEt=[{type:"layout",extensions:s_t},{type:"renderer",extensions:[{name:"null",impl:o_t},{name:"base",impl:nEt},{name:"canvas",impl:VEt}]}],JEt={},tCt={};function eCt(t,e,n){var r=n,i=s((function(n){Dgt("Can not register `"+e+"` for `"+t+"` since `"+n+"` already exists in the prototype and can not be overridden")}),"overrideErr");if("core"===t){if(xTt.prototype[e])return i(e);xTt.prototype[e]=n}else if("collection"===t){if(Pkt.prototype[e])return i(e);Pkt.prototype[e]=n}else if("layout"===t){for(var a=s((function(t){this.options=t,n.call(this,t),Gdt(this._private)||(this._private={}),this._private.cy=t.cy,this._private.listeners=[],this.createEmitter()}),"Layout"),o=a.prototype=Object.create(n.prototype),l=[],c=0;c<l.length;c++){var h=l[c];o[h]=o[h]||function(){return this}}o.start&&!o.run?o.run=function(){return this.start(),this}:!o.start&&o.run&&(o.start=function(){return this.run(),this});var u=n.prototype.stop;o.stop=function(){var t=this.options;if(t&&t.animate){var e=this.animations;if(e)for(var n=0;n<e.length;n++)e[n].stop()}return u?u.call(this):this.emit("layoutstop"),this},o.destroy||(o.destroy=function(){return this}),o.cy=function(){return this._private.cy};var d=s((function(t){return t._private.cy}),"getCy"),p={addEventFields:s((function(t,e){e.layout=t,e.cy=d(t),e.target=t}),"addEventFields"),bubble:s((function(){return!0}),"bubble"),parent:s((function(t){return d(t)}),"parent")};dpt(o,{createEmitter:s((function(){return this._private.emitter=new Jwt(p,this),this}),"createEmitter"),emitter:s((function(){return this._private.emitter}),"emitter"),on:s((function(t,e){return this.emitter().on(t,e),this}),"on"),one:s((function(t,e){return this.emitter().one(t,e),this}),"one"),once:s((function(t,e){return this.emitter().one(t,e),this}),"once"),removeListener:s((function(t,e){return this.emitter().removeListener(t,e),this}),"removeListener"),removeAllListeners:s((function(){return this.emitter().removeAllListeners(),this}),"removeAllListeners"),emit:s((function(t,e){return this.emitter().emit(t,e),this}),"emit")}),ibt.eventAliasesOn(o),r=a}else if("renderer"===t&&"null"!==e&&"base"!==e){var g=nCt("renderer","base"),f=g.prototype,m=n,y=n.prototype,v=s((function(){g.apply(this,arguments),m.apply(this,arguments)}),"Renderer"),x=v.prototype;for(var b in f){var w=f[b];if(null!=y[b])return i(b);x[b]=w}for(var k in y)x[k]=y[k];f.clientFunctions.forEach((function(t){x[t]=x[t]||function(){Mgt("Renderer does not implement `renderer."+t+"()` on its prototype")}})),r=v}else if("__proto__"===t||"constructor"===t||"prototype"===t)return Mgt(t+" is an illegal type to be registered, possibly lead to prototype pollutions");return xpt({map:JEt,keys:[t,e],value:r})}function nCt(t,e){return bpt({map:JEt,keys:[t,e]})}function rCt(t,e,n,r,i){return xpt({map:tCt,keys:[t,e,n,r],value:i})}function iCt(t,e,n,r){return bpt({map:tCt,keys:[t,e,n,r]})}s(eCt,"setExtension"),s(nCt,"getExtension"),s(rCt,"setModule"),s(iCt,"getModule");var aCt=s((function(){return 2===arguments.length?nCt.apply(null,arguments):3===arguments.length?eCt.apply(null,arguments):4===arguments.length?iCt.apply(null,arguments):5===arguments.length?rCt.apply(null,arguments):void Mgt("Invalid extension access syntax")}),"extension");xTt.prototype.extension=aCt,QEt.forEach((function(t){t.extensions.forEach((function(e){eCt(t.type,e.name,e.impl)}))}));var sCt=s((function t(){if(!(this instanceof t))return new t;this.length=0}),"Stylesheet"),oCt=sCt.prototype;oCt.instanceString=function(){return"stylesheet"},oCt.selector=function(t){return this[this.length++]={selector:t,properties:[]},this},oCt.css=function(t,e){var n=this.length-1;if(Fdt(t))this[n].properties.push({name:t,value:e});else if(Gdt(t))for(var r=t,i=Object.keys(r),a=0;a<i.length;a++){var s=i[a],o=r[s];if(null!=o){var l=gTt.properties[s]||gTt.properties[spt(s)];if(null!=l){var c=l.name,h=o;this[n].properties.push({name:c,value:h})}}}return this},oCt.style=oCt.css,oCt.generateStyle=function(t){var e=new gTt(t);return this.appendToStyle(e)},oCt.appendToStyle=function(t){for(var e=0;e<this.length;e++){var n=this[e],r=n.selector,i=n.properties;t.selector(r);for(var a=0;a<i.length;a++){var s=i[a];t.css(s.name,s.value)}}return t};var lCt=s((function(t){return void 0===t&&(t={}),Gdt(t)?new xTt(t):Fdt(t)?aCt.apply(aCt,arguments):void 0}),"cytoscape");lCt.use=function(t){var e=Array.prototype.slice.call(arguments,1);return e.unshift(lCt),t.apply(null,e),this},lCt.warnings=function(t){return Rgt(t)},lCt.version="3.30.2",lCt.stylesheet=lCt.Stylesheet=sCt;
/*! Bundled license information:
cytoscape/dist/cytoscape.esm.mjs:
(*!
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)
*)
(*!
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
*)
(*! Bezier curve function generator. Copyright Gaetan Renaudeau. MIT License: http://en.wikipedia.org/wiki/MIT_License *)
(*! Runge-Kutta spring physics function generator. Adapted from Framer.js, copyright Koen Bok. MIT License: http://en.wikipedia.org/wiki/MIT_License *)
*/
var cCt=o({"../../node_modules/.pnpm/layout-base@1.0.2/node_modules/layout-base/layout-base.js"(t,e){s((function(n,r){"object"==typeof t&&"object"==typeof e?e.exports=r():"function"==typeof define&&define.amd?define([],r):"object"==typeof t?t.layoutBase=r():n.layoutBase=r()}),"webpackUniversalModuleDefinition")(t,(function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return s(n,"__webpack_require__"),n.m=t,n.c=e,n.i=function(t){return t},n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:r})},n.n=function(t){var e=t&&t.__esModule?s((function(){return t.default}),"getDefault"):s((function(){return t}),"getModuleExports");return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=26)}([function(t,e,n){function r(){}s(r,"LayoutConstants"),r.QUALITY=1,r.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,r.DEFAULT_INCREMENTAL=!1,r.DEFAULT_ANIMATION_ON_LAYOUT=!0,r.DEFAULT_ANIMATION_DURING_LAYOUT=!1,r.DEFAULT_ANIMATION_PERIOD=50,r.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,r.DEFAULT_GRAPH_MARGIN=15,r.NODE_DIMENSIONS_INCLUDE_LABELS=!1,r.SIMPLE_NODE_SIZE=40,r.SIMPLE_NODE_HALF_SIZE=r.SIMPLE_NODE_SIZE/2,r.EMPTY_COMPOUND_NODE_SIZE=40,r.MIN_EDGE_LENGTH=1,r.WORLD_BOUNDARY=1e6,r.INITIAL_WORLD_BOUNDARY=r.WORLD_BOUNDARY/1e3,r.WORLD_CENTER_X=1200,r.WORLD_CENTER_Y=900,t.exports=r},function(t,e,n){var r=n(2),i=n(8),a=n(9);function o(t,e,n){r.call(this,n),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=n,this.bendpoints=[],this.source=t,this.target=e}for(var l in s(o,"LEdge"),o.prototype=Object.create(r.prototype),r)o[l]=r[l];o.prototype.getSource=function(){return this.source},o.prototype.getTarget=function(){return this.target},o.prototype.isInterGraph=function(){return this.isInterGraph},o.prototype.getLength=function(){return this.length},o.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},o.prototype.getBendpoints=function(){return this.bendpoints},o.prototype.getLca=function(){return this.lca},o.prototype.getSourceInLca=function(){return this.sourceInLca},o.prototype.getTargetInLca=function(){return this.targetInLca},o.prototype.getOtherEnd=function(t){if(this.source===t)return this.target;if(this.target===t)return this.source;throw"Node is not incident with this edge"},o.prototype.getOtherEndInGraph=function(t,e){for(var n=this.getOtherEnd(t),r=e.getGraphManager().getRoot();;){if(n.getOwner()==e)return n;if(n.getOwner()==r)break;n=n.getOwner().getParent()}return null},o.prototype.updateLength=function(){var t=new Array(4);this.isOverlapingSourceAndTarget=i.getIntersection(this.target.getRect(),this.source.getRect(),t),this.isOverlapingSourceAndTarget||(this.lengthX=t[0]-t[2],this.lengthY=t[1]-t[3],Math.abs(this.lengthX)<1&&(this.lengthX=a.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=a.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},o.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=a.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=a.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},t.exports=o},function(t,e,n){function r(t){this.vGraphObject=t}s(r,"LGraphObject"),t.exports=r},function(t,e,n){var r=n(2),i=n(10),a=n(13),o=n(0),l=n(16),c=n(4);function h(t,e,n,s){null==n&&null==s&&(s=e),r.call(this,s),null!=t.graphManager&&(t=t.graphManager),this.estimatedSize=i.MIN_VALUE,this.inclusionTreeDepth=i.MAX_VALUE,this.vGraphObject=s,this.edges=[],this.graphManager=t,this.rect=null!=n&&null!=e?new a(e.x,e.y,n.width,n.height):new a}for(var u in s(h,"LNode"),h.prototype=Object.create(r.prototype),r)h[u]=r[u];h.prototype.getEdges=function(){return this.edges},h.prototype.getChild=function(){return this.child},h.prototype.getOwner=function(){return this.owner},h.prototype.getWidth=function(){return this.rect.width},h.prototype.setWidth=function(t){this.rect.width=t},h.prototype.getHeight=function(){return this.rect.height},h.prototype.setHeight=function(t){this.rect.height=t},h.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},h.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},h.prototype.getCenter=function(){return new c(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},h.prototype.getLocation=function(){return new c(this.rect.x,this.rect.y)},h.prototype.getRect=function(){return this.rect},h.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},h.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},h.prototype.setRect=function(t,e){this.rect.x=t.x,this.rect.y=t.y,this.rect.width=e.width,this.rect.height=e.height},h.prototype.setCenter=function(t,e){this.rect.x=t-this.rect.width/2,this.rect.y=e-this.rect.height/2},h.prototype.setLocation=function(t,e){this.rect.x=t,this.rect.y=e},h.prototype.moveBy=function(t,e){this.rect.x+=t,this.rect.y+=e},h.prototype.getEdgeListToNode=function(t){var e=[],n=this;return n.edges.forEach((function(r){if(r.target==t){if(r.source!=n)throw"Incorrect edge source!";e.push(r)}})),e},h.prototype.getEdgesBetween=function(t){var e=[],n=this;return n.edges.forEach((function(r){if(r.source!=n&&r.target!=n)throw"Incorrect edge source and/or target";r.target!=t&&r.source!=t||e.push(r)})),e},h.prototype.getNeighborsList=function(){var t=new Set,e=this;return e.edges.forEach((function(n){if(n.source==e)t.add(n.target);else{if(n.target!=e)throw"Incorrect incidency!";t.add(n.source)}})),t},h.prototype.withChildren=function(){var t=new Set;if(t.add(this),null!=this.child)for(var e=this.child.getNodes(),n=0;n<e.length;n++)e[n].withChildren().forEach((function(e){t.add(e)}));return t},h.prototype.getNoOfChildren=function(){var t=0;if(null==this.child)t=1;else for(var e=this.child.getNodes(),n=0;n<e.length;n++)t+=e[n].getNoOfChildren();return 0==t&&(t=1),t},h.prototype.getEstimatedSize=function(){if(this.estimatedSize==i.MIN_VALUE)throw"assert failed";return this.estimatedSize},h.prototype.calcEstimatedSize=function(){return null==this.child?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)},h.prototype.scatter=function(){var t,e,n=-o.INITIAL_WORLD_BOUNDARY,r=o.INITIAL_WORLD_BOUNDARY;t=o.WORLD_CENTER_X+l.nextDouble()*(r-n)+n;var i=-o.INITIAL_WORLD_BOUNDARY,a=o.INITIAL_WORLD_BOUNDARY;e=o.WORLD_CENTER_Y+l.nextDouble()*(a-i)+i,this.rect.x=t,this.rect.y=e},h.prototype.updateBounds=function(){if(null==this.getChild())throw"assert failed";if(0!=this.getChild().getNodes().length){var t=this.getChild();if(t.updateBounds(!0),this.rect.x=t.getLeft(),this.rect.y=t.getTop(),this.setWidth(t.getRight()-t.getLeft()),this.setHeight(t.getBottom()-t.getTop()),o.NODE_DIMENSIONS_INCLUDE_LABELS){var e=t.getRight()-t.getLeft(),n=t.getBottom()-t.getTop();this.labelWidth>e&&(this.rect.x-=(this.labelWidth-e)/2,this.setWidth(this.labelWidth)),this.labelHeight>n&&("center"==this.labelPos?this.rect.y-=(this.labelHeight-n)/2:"top"==this.labelPos&&(this.rect.y-=this.labelHeight-n),this.setHeight(this.labelHeight))}}},h.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==i.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},h.prototype.transform=function(t){var e=this.rect.x;e>o.WORLD_BOUNDARY?e=o.WORLD_BOUNDARY:e<-o.WORLD_BOUNDARY&&(e=-o.WORLD_BOUNDARY);var n=this.rect.y;n>o.WORLD_BOUNDARY?n=o.WORLD_BOUNDARY:n<-o.WORLD_BOUNDARY&&(n=-o.WORLD_BOUNDARY);var r=new c(e,n),i=t.inverseTransformPoint(r);this.setLocation(i.x,i.y)},h.prototype.getLeft=function(){return this.rect.x},h.prototype.getRight=function(){return this.rect.x+this.rect.width},h.prototype.getTop=function(){return this.rect.y},h.prototype.getBottom=function(){return this.rect.y+this.rect.height},h.prototype.getParent=function(){return null==this.owner?null:this.owner.getParent()},t.exports=h},function(t,e,n){function r(t,e){null==t&&null==e?(this.x=0,this.y=0):(this.x=t,this.y=e)}s(r,"PointD"),r.prototype.getX=function(){return this.x},r.prototype.getY=function(){return this.y},r.prototype.setX=function(t){this.x=t},r.prototype.setY=function(t){this.y=t},r.prototype.getDifference=function(t){return new DimensionD(this.x-t.x,this.y-t.y)},r.prototype.getCopy=function(){return new r(this.x,this.y)},r.prototype.translate=function(t){return this.x+=t.width,this.y+=t.height,this},t.exports=r},function(t,e,n){var r=n(2),i=n(10),a=n(0),o=n(6),l=n(3),c=n(1),h=n(13),u=n(12),d=n(11);function p(t,e,n){r.call(this,n),this.estimatedSize=i.MIN_VALUE,this.margin=a.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=t,null!=e&&e instanceof o?this.graphManager=e:null!=e&&e instanceof Layout&&(this.graphManager=e.graphManager)}for(var g in s(p,"LGraph"),p.prototype=Object.create(r.prototype),r)p[g]=r[g];p.prototype.getNodes=function(){return this.nodes},p.prototype.getEdges=function(){return this.edges},p.prototype.getGraphManager=function(){return this.graphManager},p.prototype.getParent=function(){return this.parent},p.prototype.getLeft=function(){return this.left},p.prototype.getRight=function(){return this.right},p.prototype.getTop=function(){return this.top},p.prototype.getBottom=function(){return this.bottom},p.prototype.isConnected=function(){return this.isConnected},p.prototype.add=function(t,e,n){if(null==e&&null==n){var r=t;if(null==this.graphManager)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(r)>-1)throw"Node already in graph!";return r.owner=this,this.getNodes().push(r),r}var i=t;if(!(this.getNodes().indexOf(e)>-1&&this.getNodes().indexOf(n)>-1))throw"Source or target not in graph!";if(e.owner!=n.owner||e.owner!=this)throw"Both owners must be this graph!";return e.owner!=n.owner?null:(i.source=e,i.target=n,i.isInterGraph=!1,this.getEdges().push(i),e.edges.push(i),n!=e&&n.edges.push(i),i)},p.prototype.remove=function(t){var e=t;if(t instanceof l){if(null==e)throw"Node is null!";if(null==e.owner||e.owner!=this)throw"Owner graph is invalid!";if(null==this.graphManager)throw"Owner graph manager is invalid!";for(var n=e.edges.slice(),r=n.length,i=0;i<r;i++)(a=n[i]).isInterGraph?this.graphManager.remove(a):a.source.owner.remove(a);if(-1==(s=this.nodes.indexOf(e)))throw"Node not in owner node list!";this.nodes.splice(s,1)}else if(t instanceof c){var a;if(null==(a=t))throw"Edge is null!";if(null==a.source||null==a.target)throw"Source and/or target is null!";if(null==a.source.owner||null==a.target.owner||a.source.owner!=this||a.target.owner!=this)throw"Source and/or target owner is invalid!";var s,o=a.source.edges.indexOf(a),h=a.target.edges.indexOf(a);if(!(o>-1&&h>-1))throw"Source and/or target doesn't know this edge!";if(a.source.edges.splice(o,1),a.target!=a.source&&a.target.edges.splice(h,1),-1==(s=a.source.owner.getEdges().indexOf(a)))throw"Not in owner's edge list!";a.source.owner.getEdges().splice(s,1)}},p.prototype.updateLeftTop=function(){for(var t,e,n,r=i.MAX_VALUE,a=i.MAX_VALUE,s=this.getNodes(),o=s.length,l=0;l<o;l++){var c=s[l];r>(t=c.getTop())&&(r=t),a>(e=c.getLeft())&&(a=e)}return r==i.MAX_VALUE?null:(n=null!=s[0].getParent().paddingLeft?s[0].getParent().paddingLeft:this.margin,this.left=a-n,this.top=r-n,new u(this.left,this.top))},p.prototype.updateBounds=function(t){for(var e,n,r,a,s,o=i.MAX_VALUE,l=-i.MAX_VALUE,c=i.MAX_VALUE,u=-i.MAX_VALUE,d=this.nodes,p=d.length,g=0;g<p;g++){var f=d[g];t&&null!=f.child&&f.updateBounds(),o>(e=f.getLeft())&&(o=e),l<(n=f.getRight())&&(l=n),c>(r=f.getTop())&&(c=r),u<(a=f.getBottom())&&(u=a)}var m=new h(o,c,l-o,u-c);o==i.MAX_VALUE&&(this.left=this.parent.getLeft(),this.right=this.parent.getRight(),this.top=this.parent.getTop(),this.bottom=this.parent.getBottom()),s=null!=d[0].getParent().paddingLeft?d[0].getParent().paddingLeft:this.margin,this.left=m.x-s,this.right=m.x+m.width+s,this.top=m.y-s,this.bottom=m.y+m.height+s},p.calculateBounds=function(t){for(var e,n,r,a,s=i.MAX_VALUE,o=-i.MAX_VALUE,l=i.MAX_VALUE,c=-i.MAX_VALUE,u=t.length,d=0;d<u;d++){var p=t[d];s>(e=p.getLeft())&&(s=e),o<(n=p.getRight())&&(o=n),l>(r=p.getTop())&&(l=r),c<(a=p.getBottom())&&(c=a)}return new h(s,l,o-s,c-l)},p.prototype.getInclusionTreeDepth=function(){return this==this.graphManager.getRoot()?1:this.parent.getInclusionTreeDepth()},p.prototype.getEstimatedSize=function(){if(this.estimatedSize==i.MIN_VALUE)throw"assert failed";return this.estimatedSize},p.prototype.calcEstimatedSize=function(){for(var t=0,e=this.nodes,n=e.length,r=0;r<n;r++){t+=e[r].calcEstimatedSize()}return this.estimatedSize=0==t?a.EMPTY_COMPOUND_NODE_SIZE:t/Math.sqrt(this.nodes.length),this.estimatedSize},p.prototype.updateConnected=function(){var t=this;if(0!=this.nodes.length){var e,n,r=new d,i=new Set,a=this.nodes[0];for(a.withChildren().forEach((function(t){r.push(t),i.add(t)}));0!==r.length;)for(var s=(e=(a=r.shift()).getEdges()).length,o=0;o<s;o++){if(null!=(n=e[o].getOtherEndInGraph(a,this))&&!i.has(n))n.withChildren().forEach((function(t){r.push(t),i.add(t)}))}if(this.isConnected=!1,i.size>=this.nodes.length){var l=0;i.forEach((function(e){e.owner==t&&l++})),l==this.nodes.length&&(this.isConnected=!0)}}else this.isConnected=!0},t.exports=p},function(t,e,n){var r,i=n(1);function a(t){r=n(5),this.layout=t,this.graphs=[],this.edges=[]}s(a,"LGraphManager"),a.prototype.addRoot=function(){var t=this.layout.newGraph(),e=this.layout.newNode(null),n=this.add(t,e);return this.setRootGraph(n),this.rootGraph},a.prototype.add=function(t,e,n,r,i){if(null==n&&null==r&&null==i){if(null==t)throw"Graph is null!";if(null==e)throw"Parent node is null!";if(this.graphs.indexOf(t)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(t),null!=t.parent)throw"Already has a parent!";if(null!=e.child)throw"Already has a child!";return t.parent=e,e.child=t,t}i=n,n=t;var a=(r=e).getOwner(),s=i.getOwner();if(null==a||a.getGraphManager()!=this)throw"Source not in this graph mgr!";if(null==s||s.getGraphManager()!=this)throw"Target not in this graph mgr!";if(a==s)return n.isInterGraph=!1,a.add(n,r,i);if(n.isInterGraph=!0,n.source=r,n.target=i,this.edges.indexOf(n)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(n),null==n.source||null==n.target)throw"Edge source and/or target is null!";if(-1!=n.source.edges.indexOf(n)||-1!=n.target.edges.indexOf(n))throw"Edge already in source and/or target incidency list!";return n.source.edges.push(n),n.target.edges.push(n),n},a.prototype.remove=function(t){if(t instanceof r){var e=t;if(e.getGraphManager()!=this)throw"Graph not in this graph mgr";if(e!=this.rootGraph&&(null==e.parent||e.parent.graphManager!=this))throw"Invalid parent node!";for(var n,a=[],s=(a=a.concat(e.getEdges())).length,o=0;o<s;o++)n=a[o],e.remove(n);var l,c=[];s=(c=c.concat(e.getNodes())).length;for(o=0;o<s;o++)l=c[o],e.remove(l);e==this.rootGraph&&this.setRootGraph(null);var h=this.graphs.indexOf(e);this.graphs.splice(h,1),e.parent=null}else if(t instanceof i){if(null==(n=t))throw"Edge is null!";if(!n.isInterGraph)throw"Not an inter-graph edge!";if(null==n.source||null==n.target)throw"Source and/or target is null!";if(-1==n.source.edges.indexOf(n)||-1==n.target.edges.indexOf(n))throw"Source and/or target doesn't know this edge!";h=n.source.edges.indexOf(n);if(n.source.edges.splice(h,1),h=n.target.edges.indexOf(n),n.target.edges.splice(h,1),null==n.source.owner||null==n.source.owner.getGraphManager())throw"Edge owner graph or owner graph manager is null!";if(-1==n.source.owner.getGraphManager().edges.indexOf(n))throw"Not in owner graph manager's edge list!";h=n.source.owner.getGraphManager().edges.indexOf(n);n.source.owner.getGraphManager().edges.splice(h,1)}},a.prototype.updateBounds=function(){this.rootGraph.updateBounds(!0)},a.prototype.getGraphs=function(){return this.graphs},a.prototype.getAllNodes=function(){if(null==this.allNodes){for(var t=[],e=this.getGraphs(),n=e.length,r=0;r<n;r++)t=t.concat(e[r].getNodes());this.allNodes=t}return this.allNodes},a.prototype.resetAllNodes=function(){this.allNodes=null},a.prototype.resetAllEdges=function(){this.allEdges=null},a.prototype.resetAllNodesToApplyGravitation=function(){this.allNodesToApplyGravitation=null},a.prototype.getAllEdges=function(){if(null==this.allEdges){var t=[],e=this.getGraphs();e.length;for(var n=0;n<e.length;n++)t=t.concat(e[n].getEdges());t=t.concat(this.edges),this.allEdges=t}return this.allEdges},a.prototype.getAllNodesToApplyGravitation=function(){return this.allNodesToApplyGravitation},a.prototype.setAllNodesToApplyGravitation=function(t){if(null!=this.allNodesToApplyGravitation)throw"assert failed";this.allNodesToApplyGravitation=t},a.prototype.getRoot=function(){return this.rootGraph},a.prototype.setRootGraph=function(t){if(t.getGraphManager()!=this)throw"Root not in this graph mgr!";this.rootGraph=t,null==t.parent&&(t.parent=this.layout.newNode("Root node"))},a.prototype.getLayout=function(){return this.layout},a.prototype.isOneAncestorOfOther=function(t,e){if(null==t||null==e)throw"assert failed";if(t==e)return!0;for(var n,r=t.getOwner();;){if(null==(n=r.getParent()))break;if(n==e)return!0;if(null==(r=n.getOwner()))break}for(r=e.getOwner();;){if(null==(n=r.getParent()))break;if(n==t)return!0;if(null==(r=n.getOwner()))break}return!1},a.prototype.calcLowestCommonAncestors=function(){for(var t,e,n,r,i,a=this.getAllEdges(),s=a.length,o=0;o<s;o++)if(e=(t=a[o]).source,n=t.target,t.lca=null,t.sourceInLca=e,t.targetInLca=n,e!=n){for(r=e.getOwner();null==t.lca;){for(t.targetInLca=n,i=n.getOwner();null==t.lca;){if(i==r){t.lca=i;break}if(i==this.rootGraph)break;if(null!=t.lca)throw"assert failed";t.targetInLca=i.getParent(),i=t.targetInLca.getOwner()}if(r==this.rootGraph)break;null==t.lca&&(t.sourceInLca=r.getParent(),r=t.sourceInLca.getOwner())}if(null==t.lca)throw"assert failed"}else t.lca=e.getOwner()},a.prototype.calcLowestCommonAncestor=function(t,e){if(t==e)return t.getOwner();for(var n=t.getOwner();;){if(null==n)break;for(var r=e.getOwner();;){if(null==r)break;if(r==n)return r;r=r.getParent().getOwner()}n=n.getParent().getOwner()}return n},a.prototype.calcInclusionTreeDepths=function(t,e){var n;null==t&&null==e&&(t=this.rootGraph,e=1);for(var r=t.getNodes(),i=r.length,a=0;a<i;a++)(n=r[a]).inclusionTreeDepth=e,null!=n.child&&this.calcInclusionTreeDepths(n.child,e+1)},a.prototype.includesInvalidEdge=function(){for(var t,e=this.edges.length,n=0;n<e;n++)if(t=this.edges[n],this.isOneAncestorOfOther(t.source,t.target))return!0;return!1},t.exports=a},function(t,e,n){var r=n(0);function i(){}for(var a in s(i,"FDLayoutConstants"),r)i[a]=r[a];i.MAX_ITERATIONS=2500,i.DEFAULT_EDGE_LENGTH=50,i.DEFAULT_SPRING_STRENGTH=.45,i.DEFAULT_REPULSION_STRENGTH=4500,i.DEFAULT_GRAVITY_STRENGTH=.4,i.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,i.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,i.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,i.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,i.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,i.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,i.COOLING_ADAPTATION_FACTOR=.33,i.ADAPTATION_LOWER_NODE_LIMIT=1e3,i.ADAPTATION_UPPER_NODE_LIMIT=5e3,i.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,i.MAX_NODE_DISPLACEMENT=3*i.MAX_NODE_DISPLACEMENT_INCREMENTAL,i.MIN_REPULSION_DIST=i.DEFAULT_EDGE_LENGTH/10,i.CONVERGENCE_CHECK_PERIOD=100,i.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,i.MIN_EDGE_LENGTH=1,i.GRID_CALCULATION_CHECK_PERIOD=10,t.exports=i},function(t,e,n){var r=n(12);function i(){}s(i,"IGeometry"),i.calcSeparationAmount=function(t,e,n,r){if(!t.intersects(e))throw"assert failed";var i=new Array(2);this.decideDirectionsForOverlappingNodes(t,e,i),n[0]=Math.min(t.getRight(),e.getRight())-Math.max(t.x,e.x),n[1]=Math.min(t.getBottom(),e.getBottom())-Math.max(t.y,e.y),t.getX()<=e.getX()&&t.getRight()>=e.getRight()?n[0]+=Math.min(e.getX()-t.getX(),t.getRight()-e.getRight()):e.getX()<=t.getX()&&e.getRight()>=t.getRight()&&(n[0]+=Math.min(t.getX()-e.getX(),e.getRight()-t.getRight())),t.getY()<=e.getY()&&t.getBottom()>=e.getBottom()?n[1]+=Math.min(e.getY()-t.getY(),t.getBottom()-e.getBottom()):e.getY()<=t.getY()&&e.getBottom()>=t.getBottom()&&(n[1]+=Math.min(t.getY()-e.getY(),e.getBottom()-t.getBottom()));var a=Math.abs((e.getCenterY()-t.getCenterY())/(e.getCenterX()-t.getCenterX()));e.getCenterY()===t.getCenterY()&&e.getCenterX()===t.getCenterX()&&(a=1);var s=a*n[0],o=n[1]/a;n[0]<o?o=n[0]:s=n[1],n[0]=-1*i[0]*(o/2+r),n[1]=-1*i[1]*(s/2+r)},i.decideDirectionsForOverlappingNodes=function(t,e,n){t.getCenterX()<e.getCenterX()?n[0]=-1:n[0]=1,t.getCenterY()<e.getCenterY()?n[1]=-1:n[1]=1},i.getIntersection2=function(t,e,n){var r=t.getCenterX(),i=t.getCenterY(),a=e.getCenterX(),s=e.getCenterY();if(t.intersects(e))return n[0]=r,n[1]=i,n[2]=a,n[3]=s,!0;var o=t.getX(),l=t.getY(),c=t.getRight(),h=t.getX(),u=t.getBottom(),d=t.getRight(),p=t.getWidthHalf(),g=t.getHeightHalf(),f=e.getX(),m=e.getY(),y=e.getRight(),v=e.getX(),x=e.getBottom(),b=e.getRight(),w=e.getWidthHalf(),k=e.getHeightHalf(),T=!1,_=!1;if(r===a){if(i>s)return n[0]=r,n[1]=l,n[2]=a,n[3]=x,!1;if(i<s)return n[0]=r,n[1]=u,n[2]=a,n[3]=m,!1}else if(i===s){if(r>a)return n[0]=o,n[1]=i,n[2]=y,n[3]=s,!1;if(r<a)return n[0]=c,n[1]=i,n[2]=f,n[3]=s,!1}else{var E=t.height/t.width,C=e.height/e.width,S=(s-i)/(a-r),A=void 0,L=void 0,N=void 0,I=void 0,M=void 0,R=void 0;if(-E===S?r>a?(n[0]=h,n[1]=u,T=!0):(n[0]=c,n[1]=l,T=!0):E===S&&(r>a?(n[0]=o,n[1]=l,T=!0):(n[0]=d,n[1]=u,T=!0)),-C===S?a>r?(n[2]=v,n[3]=x,_=!0):(n[2]=y,n[3]=m,_=!0):C===S&&(a>r?(n[2]=f,n[3]=m,_=!0):(n[2]=b,n[3]=x,_=!0)),T&&_)return!1;if(r>a?i>s?(A=this.getCardinalDirection(E,S,4),L=this.getCardinalDirection(C,S,2)):(A=this.getCardinalDirection(-E,S,3),L=this.getCardinalDirection(-C,S,1)):i>s?(A=this.getCardinalDirection(-E,S,1),L=this.getCardinalDirection(-C,S,3)):(A=this.getCardinalDirection(E,S,2),L=this.getCardinalDirection(C,S,4)),!T)switch(A){case 1:I=l,N=r+-g/S,n[0]=N,n[1]=I;break;case 2:N=d,I=i+p*S,n[0]=N,n[1]=I;break;case 3:I=u,N=r+g/S,n[0]=N,n[1]=I;break;case 4:N=h,I=i+-p*S,n[0]=N,n[1]=I}if(!_)switch(L){case 1:R=m,M=a+-k/S,n[2]=M,n[3]=R;break;case 2:M=b,R=s+w*S,n[2]=M,n[3]=R;break;case 3:R=x,M=a+k/S,n[2]=M,n[3]=R;break;case 4:M=v,R=s+-w*S,n[2]=M,n[3]=R}}return!1},i.getCardinalDirection=function(t,e,n){return t>e?n:1+n%4},i.getIntersection=function(t,e,n,i){if(null==i)return this.getIntersection2(t,e,n);var a,s,o,l,c,h,u,d=t.x,p=t.y,g=e.x,f=e.y,m=n.x,y=n.y,v=i.x,x=i.y;return 0===(u=(a=f-p)*(l=m-v)-(s=x-y)*(o=d-g))?null:new r((o*(h=v*y-m*x)-l*(c=g*p-d*f))/u,(s*c-a*h)/u)},i.angleOfVector=function(t,e,n,r){var i=void 0;return t!==n?(i=Math.atan((r-e)/(n-t)),n<t?i+=Math.PI:r<e&&(i+=this.TWO_PI)):i=r<e?this.ONE_AND_HALF_PI:this.HALF_PI,i},i.doIntersect=function(t,e,n,r){var i=t.x,a=t.y,s=e.x,o=e.y,l=n.x,c=n.y,h=r.x,u=r.y,d=(s-i)*(u-c)-(h-l)*(o-a);if(0===d)return!1;var p=((u-c)*(h-i)+(l-h)*(u-a))/d,g=((a-o)*(h-i)+(s-i)*(u-a))/d;return 0<p&&p<1&&0<g&&g<1},i.HALF_PI=.5*Math.PI,i.ONE_AND_HALF_PI=1.5*Math.PI,i.TWO_PI=2*Math.PI,i.THREE_PI=3*Math.PI,t.exports=i},function(t,e,n){function r(){}s(r,"IMath"),r.sign=function(t){return t>0?1:t<0?-1:0},r.floor=function(t){return t<0?Math.ceil(t):Math.floor(t)},r.ceil=function(t){return t<0?Math.floor(t):Math.ceil(t)},t.exports=r},function(t,e,n){function r(){}s(r,"Integer"),r.MAX_VALUE=2147483647,r.MIN_VALUE=-2147483648,t.exports=r},function(t,e,n){var r=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return s(t,"defineProperties"),function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}();function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}s(i,"_classCallCheck");var a=s((function(t){return{value:t,next:null,prev:null}}),"nodeFrom"),o=s((function(t,e,n,r){return null!==t?t.next=e:r.head=e,null!==n?n.prev=e:r.tail=e,e.prev=t,e.next=n,r.length++,e}),"add"),l=s((function(t,e){var n=t.prev,r=t.next;return null!==n?n.next=r:e.head=r,null!==r?r.prev=n:e.tail=n,t.prev=t.next=null,e.length--,t}),"_remove"),c=function(){function t(e){var n=this;i(this,t),this.length=0,this.head=null,this.tail=null,null!=e&&e.forEach((function(t){return n.push(t)}))}return s(t,"LinkedList"),r(t,[{key:"size",value:s((function(){return this.length}),"size")},{key:"insertBefore",value:s((function(t,e){return o(e.prev,a(t),e,this)}),"insertBefore")},{key:"insertAfter",value:s((function(t,e){return o(e,a(t),e.next,this)}),"insertAfter")},{key:"insertNodeBefore",value:s((function(t,e){return o(e.prev,t,e,this)}),"insertNodeBefore")},{key:"insertNodeAfter",value:s((function(t,e){return o(e,t,e.next,this)}),"insertNodeAfter")},{key:"push",value:s((function(t){return o(this.tail,a(t),null,this)}),"push")},{key:"unshift",value:s((function(t){return o(null,a(t),this.head,this)}),"unshift")},{key:"remove",value:s((function(t){return l(t,this)}),"remove")},{key:"pop",value:s((function(){return l(this.tail,this).value}),"pop")},{key:"popNode",value:s((function(){return l(this.tail,this)}),"popNode")},{key:"shift",value:s((function(){return l(this.head,this).value}),"shift")},{key:"shiftNode",value:s((function(){return l(this.head,this)}),"shiftNode")},{key:"get_object_at",value:s((function(t){if(t<=this.length()){for(var e=1,n=this.head;e<t;)n=n.next,e++;return n.value}}),"get_object_at")},{key:"set_object_at",value:s((function(t,e){if(t<=this.length()){for(var n=1,r=this.head;n<t;)r=r.next,n++;r.value=e}}),"set_object_at")}]),t}();t.exports=c},function(t,e,n){function r(t,e,n){this.x=null,this.y=null,null==t&&null==e&&null==n?(this.x=0,this.y=0):"number"==typeof t&&"number"==typeof e&&null==n?(this.x=t,this.y=e):"Point"==t.constructor.name&&null==e&&null==n&&(n=t,this.x=n.x,this.y=n.y)}s(r,"Point"),r.prototype.getX=function(){return this.x},r.prototype.getY=function(){return this.y},r.prototype.getLocation=function(){return new r(this.x,this.y)},r.prototype.setLocation=function(t,e,n){"Point"==t.constructor.name&&null==e&&null==n?(n=t,this.setLocation(n.x,n.y)):"number"==typeof t&&"number"==typeof e&&null==n&&(parseInt(t)==t&&parseInt(e)==e?this.move(t,e):(this.x=Math.floor(t+.5),this.y=Math.floor(e+.5)))},r.prototype.move=function(t,e){this.x=t,this.y=e},r.prototype.translate=function(t,e){this.x+=t,this.y+=e},r.prototype.equals=function(t){if("Point"==t.constructor.name){var e=t;return this.x==e.x&&this.y==e.y}return this==t},r.prototype.toString=function(){return(new r).constructor.name+"[x="+this.x+",y="+this.y+"]"},t.exports=r},function(t,e,n){function r(t,e,n,r){this.x=0,this.y=0,this.width=0,this.height=0,null!=t&&null!=e&&null!=n&&null!=r&&(this.x=t,this.y=e,this.width=n,this.height=r)}s(r,"RectangleD"),r.prototype.getX=function(){return this.x},r.prototype.setX=function(t){this.x=t},r.prototype.getY=function(){return this.y},r.prototype.setY=function(t){this.y=t},r.prototype.getWidth=function(){return this.width},r.prototype.setWidth=function(t){this.width=t},r.prototype.getHeight=function(){return this.height},r.prototype.setHeight=function(t){this.height=t},r.prototype.getRight=function(){return this.x+this.width},r.prototype.getBottom=function(){return this.y+this.height},r.prototype.intersects=function(t){return!(this.getRight()<t.x)&&(!(this.getBottom()<t.y)&&(!(t.getRight()<this.x)&&!(t.getBottom()<this.y)))},r.prototype.getCenterX=function(){return this.x+this.width/2},r.prototype.getMinX=function(){return this.getX()},r.prototype.getMaxX=function(){return this.getX()+this.width},r.prototype.getCenterY=function(){return this.y+this.height/2},r.prototype.getMinY=function(){return this.getY()},r.prototype.getMaxY=function(){return this.getY()+this.height},r.prototype.getWidthHalf=function(){return this.width/2},r.prototype.getHeightHalf=function(){return this.height/2},t.exports=r},function(t,e,n){var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};function i(){}s(i,"UniqueIDGeneretor"),i.lastID=0,i.createID=function(t){return i.isPrimitive(t)?t:(null!=t.uniqueID||(t.uniqueID=i.getString(),i.lastID++),t.uniqueID)},i.getString=function(t){return null==t&&(t=i.lastID),"Object#"+t},i.isPrimitive=function(t){var e=void 0===t?"undefined":r(t);return null==t||"object"!=e&&"function"!=e},t.exports=i},function(t,e,n){function r(t){if(Array.isArray(t)){for(var e=0,n=Array(t.length);e<t.length;e++)n[e]=t[e];return n}return Array.from(t)}s(r,"_toConsumableArray");var i=n(0),a=n(6),o=n(3),l=n(1),c=n(5),h=n(4),u=n(17),d=n(27);function p(t){d.call(this),this.layoutQuality=i.QUALITY,this.createBendsAsNeeded=i.DEFAULT_CREATE_BENDS_AS_NEEDED,this.incremental=i.DEFAULT_INCREMENTAL,this.animationOnLayout=i.DEFAULT_ANIMATION_ON_LAYOUT,this.animationDuringLayout=i.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=i.DEFAULT_ANIMATION_PERIOD,this.uniformLeafNodeSizes=i.DEFAULT_UNIFORM_LEAF_NODE_SIZES,this.edgeToDummyNodes=new Map,this.graphManager=new a(this),this.isLayoutFinished=!1,this.isSubLayout=!1,this.isRemoteUse=!1,null!=t&&(this.isRemoteUse=t)}s(p,"Layout"),p.RANDOM_SEED=1,p.prototype=Object.create(d.prototype),p.prototype.getGraphManager=function(){return this.graphManager},p.prototype.getAllNodes=function(){return this.graphManager.getAllNodes()},p.prototype.getAllEdges=function(){return this.graphManager.getAllEdges()},p.prototype.getAllNodesToApplyGravitation=function(){return this.graphManager.getAllNodesToApplyGravitation()},p.prototype.newGraphManager=function(){var t=new a(this);return this.graphManager=t,t},p.prototype.newGraph=function(t){return new c(null,this.graphManager,t)},p.prototype.newNode=function(t){return new o(this.graphManager,t)},p.prototype.newEdge=function(t){return new l(null,null,t)},p.prototype.checkLayoutSuccess=function(){return null==this.graphManager.getRoot()||0==this.graphManager.getRoot().getNodes().length||this.graphManager.includesInvalidEdge()},p.prototype.runLayout=function(){var t;return this.isLayoutFinished=!1,this.tilingPreLayout&&this.tilingPreLayout(),this.initParameters(),t=!this.checkLayoutSuccess()&&this.layout(),"during"!==i.ANIMATE&&(t&&(this.isSubLayout||this.doPostLayout()),this.tilingPostLayout&&this.tilingPostLayout(),this.isLayoutFinished=!0,t)},p.prototype.doPostLayout=function(){this.incremental||this.transform(),this.update()},p.prototype.update2=function(){if(this.createBendsAsNeeded&&(this.createBendpointsFromDummyNodes(),this.graphManager.resetAllEdges()),!this.isRemoteUse){for(var t=this.graphManager.getAllEdges(),e=0;e<t.length;e++)t[e];var n=this.graphManager.getRoot().getNodes();for(e=0;e<n.length;e++)n[e];this.update(this.graphManager.getRoot())}},p.prototype.update=function(t){if(null==t)this.update2();else if(t instanceof o){var e=t;if(null!=e.getChild())for(var n=e.getChild().getNodes(),r=0;r<n.length;r++)update(n[r]);if(null!=e.vGraphObject)e.vGraphObject.update(e)}else if(t instanceof l){var i=t;if(null!=i.vGraphObject)i.vGraphObject.update(i)}else if(t instanceof c){var a=t;if(null!=a.vGraphObject)a.vGraphObject.update(a)}},p.prototype.initParameters=function(){this.isSubLayout||(this.layoutQuality=i.QUALITY,this.animationDuringLayout=i.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=i.DEFAULT_ANIMATION_PERIOD,this.animationOnLayout=i.DEFAULT_ANIMATION_ON_LAYOUT,this.incremental=i.DEFAULT_INCREMENTAL,this.createBendsAsNeeded=i.DEFAULT_CREATE_BENDS_AS_NEEDED,this.uniformLeafNodeSizes=i.DEFAULT_UNIFORM_LEAF_NODE_SIZES),this.animationDuringLayout&&(this.animationOnLayout=!1)},p.prototype.transform=function(t){if(null==t)this.transform(new h(0,0));else{var e=new u,n=this.graphManager.getRoot().updateLeftTop();if(null!=n){e.setWorldOrgX(t.x),e.setWorldOrgY(t.y),e.setDeviceOrgX(n.x),e.setDeviceOrgY(n.y);for(var r=this.getAllNodes(),i=0;i<r.length;i++)r[i].transform(e)}}},p.prototype.positionNodesRandomly=function(t){if(null==t)this.positionNodesRandomly(this.getGraphManager().getRoot()),this.getGraphManager().getRoot().updateBounds(!0);else for(var e,n,r=t.getNodes(),i=0;i<r.length;i++)null==(n=(e=r[i]).getChild())||0==n.getNodes().length?e.scatter():(this.positionNodesRandomly(n),e.updateBounds())},p.prototype.getFlatForest=function(){for(var t=[],e=!0,n=this.graphManager.getRoot().getNodes(),i=!0,a=0;a<n.length;a++)null!=n[a].getChild()&&(i=!1);if(!i)return t;var s=new Set,o=[],l=new Map,c=[];for(c=c.concat(n);c.length>0&&e;){for(o.push(c[0]);o.length>0&&e;){var h=o[0];o.splice(0,1),s.add(h);var u=h.getEdges();for(a=0;a<u.length;a++){var d=u[a].getOtherEnd(h);if(l.get(h)!=d){if(s.has(d)){e=!1;break}o.push(d),l.set(d,h)}}}if(e){var p=[].concat(r(s));t.push(p);for(a=0;a<p.length;a++){var g=p[a],f=c.indexOf(g);f>-1&&c.splice(f,1)}s=new Set,l=new Map}else t=[]}return t},p.prototype.createDummyNodesForBendpoints=function(t){for(var e=[],n=t.source,r=this.graphManager.calcLowestCommonAncestor(t.source,t.target),i=0;i<t.bendpoints.length;i++){var a=this.newNode(null);a.setRect(new Point(0,0),new Dimension(1,1)),r.add(a);var s=this.newEdge(null);this.graphManager.add(s,n,a),e.add(a),n=a}s=this.newEdge(null);return this.graphManager.add(s,n,t.target),this.edgeToDummyNodes.set(t,e),t.isInterGraph()?this.graphManager.remove(t):r.remove(t),e},p.prototype.createBendpointsFromDummyNodes=function(){var t=[];t=t.concat(this.graphManager.getAllEdges()),t=[].concat(r(this.edgeToDummyNodes.keys())).concat(t);for(var e=0;e<t.length;e++){var n=t[e];if(n.bendpoints.length>0){for(var i=this.edgeToDummyNodes.get(n),a=0;a<i.length;a++){var s=i[a],o=new h(s.getCenterX(),s.getCenterY()),l=n.bendpoints.get(a);l.x=o.x,l.y=o.y,s.getOwner().remove(s)}this.graphManager.add(n,n.source,n.target)}}},p.transform=function(t,e,n,r){if(null!=n&&null!=r){var i=e;if(t<=50)i-=(e-e/n)/50*(50-t);else i+=(e*r-e)/50*(t-50);return i}var a,s;return t<=50?(a=9*e/500,s=e/10):(a=9*e/50,s=-8*e),a*t+s},p.findCenterOfTree=function(t){var e=[];e=e.concat(t);var n=[],r=new Map,i=!1,a=null;1!=e.length&&2!=e.length||(i=!0,a=e[0]);for(var s=0;s<e.length;s++){var o=(h=e[s]).getNeighborsList().size;r.set(h,h.getNeighborsList().size),1==o&&n.push(h)}var l=[];for(l=l.concat(n);!i;){var c=[];c=c.concat(l),l=[];for(s=0;s<e.length;s++){var h=e[s],u=e.indexOf(h);u>=0&&e.splice(u,1),h.getNeighborsList().forEach((function(t){if(n.indexOf(t)<0){var e=r.get(t)-1;1==e&&l.push(t),r.set(t,e)}}))}n=n.concat(l),1!=e.length&&2!=e.length||(i=!0,a=e[0])}return a},p.prototype.setGraphManager=function(t){this.graphManager=t},t.exports=p},function(t,e,n){function r(){}s(r,"RandomSeed"),r.seed=1,r.x=0,r.nextDouble=function(){return r.x=1e4*Math.sin(r.seed++),r.x-Math.floor(r.x)},t.exports=r},function(t,e,n){var r=n(4);function i(t,e){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(i,"Transform"),i.prototype.getWorldOrgX=function(){return this.lworldOrgX},i.prototype.setWorldOrgX=function(t){this.lworldOrgX=t},i.prototype.getWorldOrgY=function(){return this.lworldOrgY},i.prototype.setWorldOrgY=function(t){this.lworldOrgY=t},i.prototype.getWorldExtX=function(){return this.lworldExtX},i.prototype.setWorldExtX=function(t){this.lworldExtX=t},i.prototype.getWorldExtY=function(){return this.lworldExtY},i.prototype.setWorldExtY=function(t){this.lworldExtY=t},i.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},i.prototype.setDeviceOrgX=function(t){this.ldeviceOrgX=t},i.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},i.prototype.setDeviceOrgY=function(t){this.ldeviceOrgY=t},i.prototype.getDeviceExtX=function(){return this.ldeviceExtX},i.prototype.setDeviceExtX=function(t){this.ldeviceExtX=t},i.prototype.getDeviceExtY=function(){return this.ldeviceExtY},i.prototype.setDeviceExtY=function(t){this.ldeviceExtY=t},i.prototype.transformX=function(t){var e=0,n=this.lworldExtX;return 0!=n&&(e=this.ldeviceOrgX+(t-this.lworldOrgX)*this.ldeviceExtX/n),e},i.prototype.transformY=function(t){var e=0,n=this.lworldExtY;return 0!=n&&(e=this.ldeviceOrgY+(t-this.lworldOrgY)*this.ldeviceExtY/n),e},i.prototype.inverseTransformX=function(t){var e=0,n=this.ldeviceExtX;return 0!=n&&(e=this.lworldOrgX+(t-this.ldeviceOrgX)*this.lworldExtX/n),e},i.prototype.inverseTransformY=function(t){var e=0,n=this.ldeviceExtY;return 0!=n&&(e=this.lworldOrgY+(t-this.ldeviceOrgY)*this.lworldExtY/n),e},i.prototype.inverseTransformPoint=function(t){return new r(this.inverseTransformX(t.x),this.inverseTransformY(t.y))},t.exports=i},function(t,e,n){function r(t){if(Array.isArray(t)){for(var e=0,n=Array(t.length);e<t.length;e++)n[e]=t[e];return n}return Array.from(t)}s(r,"_toConsumableArray");var i=n(15),a=n(7),o=n(0),l=n(8),c=n(9);function h(){i.call(this),this.useSmartIdealEdgeLengthCalculation=a.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.idealEdgeLength=a.DEFAULT_EDGE_LENGTH,this.springConstant=a.DEFAULT_SPRING_STRENGTH,this.repulsionConstant=a.DEFAULT_REPULSION_STRENGTH,this.gravityConstant=a.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=a.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=a.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=a.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.displacementThresholdPerNode=3*a.DEFAULT_EDGE_LENGTH/100,this.coolingFactor=a.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.initialCoolingFactor=a.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.totalDisplacement=0,this.oldTotalDisplacement=0,this.maxIterations=a.MAX_ITERATIONS}for(var u in s(h,"FDLayout"),h.prototype=Object.create(i.prototype),i)h[u]=i[u];h.prototype.initParameters=function(){i.prototype.initParameters.call(this,arguments),this.totalIterations=0,this.notAnimatedIterations=0,this.useFRGridVariant=a.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION,this.grid=[]},h.prototype.calcIdealEdgeLengths=function(){for(var t,e,n,r,i,s,l=this.getGraphManager().getAllEdges(),c=0;c<l.length;c++)(t=l[c]).idealLength=this.idealEdgeLength,t.isInterGraph&&(n=t.getSource(),r=t.getTarget(),i=t.getSourceInLca().getEstimatedSize(),s=t.getTargetInLca().getEstimatedSize(),this.useSmartIdealEdgeLengthCalculation&&(t.idealLength+=i+s-2*o.SIMPLE_NODE_SIZE),e=t.getLca().getInclusionTreeDepth(),t.idealLength+=a.DEFAULT_EDGE_LENGTH*a.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR*(n.getInclusionTreeDepth()+r.getInclusionTreeDepth()-2*e))},h.prototype.initSpringEmbedder=function(){var t=this.getAllNodes().length;this.incremental?(t>a.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*a.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(t-a.ADAPTATION_LOWER_NODE_LIMIT)/(a.ADAPTATION_UPPER_NODE_LIMIT-a.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-a.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=a.MAX_NODE_DISPLACEMENT_INCREMENTAL):(t>a.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(a.COOLING_ADAPTATION_FACTOR,1-(t-a.ADAPTATION_LOWER_NODE_LIMIT)/(a.ADAPTATION_UPPER_NODE_LIMIT-a.ADAPTATION_LOWER_NODE_LIMIT)*(1-a.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=a.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(5*this.getAllNodes().length,this.maxIterations),this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},h.prototype.calcSpringForces=function(){for(var t,e=this.getAllEdges(),n=0;n<e.length;n++)t=e[n],this.calcSpringForce(t,t.idealLength)},h.prototype.calcRepulsionForces=function(){var t,e,n,r,i,s=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],o=arguments.length>1&&void 0!==arguments[1]&&arguments[1],l=this.getAllNodes();if(this.useFRGridVariant)for(this.totalIterations%a.GRID_CALCULATION_CHECK_PERIOD==1&&s&&this.updateGrid(),i=new Set,t=0;t<l.length;t++)n=l[t],this.calculateRepulsionForceOfANode(n,i,s,o),i.add(n);else for(t=0;t<l.length;t++)for(n=l[t],e=t+1;e<l.length;e++)r=l[e],n.getOwner()==r.getOwner()&&this.calcRepulsionForce(n,r)},h.prototype.calcGravitationalForces=function(){for(var t,e=this.getAllNodesToApplyGravitation(),n=0;n<e.length;n++)t=e[n],this.calcGravitationalForce(t)},h.prototype.moveNodes=function(){for(var t=this.getAllNodes(),e=0;e<t.length;e++)t[e].move()},h.prototype.calcSpringForce=function(t,e){var n,r,i,a,s=t.getSource(),o=t.getTarget();if(this.uniformLeafNodeSizes&&null==s.getChild()&&null==o.getChild())t.updateLengthSimple();else if(t.updateLength(),t.isOverlapingSourceAndTarget)return;0!=(n=t.getLength())&&(i=(r=this.springConstant*(n-e))*(t.lengthX/n),a=r*(t.lengthY/n),s.springForceX+=i,s.springForceY+=a,o.springForceX-=i,o.springForceY-=a)},h.prototype.calcRepulsionForce=function(t,e){var n,r,i,s,o,h,u,d=t.getRect(),p=e.getRect(),g=new Array(2),f=new Array(4);if(d.intersects(p)){l.calcSeparationAmount(d,p,g,a.DEFAULT_EDGE_LENGTH/2),h=2*g[0],u=2*g[1];var m=t.noOfChildren*e.noOfChildren/(t.noOfChildren+e.noOfChildren);t.repulsionForceX-=m*h,t.repulsionForceY-=m*u,e.repulsionForceX+=m*h,e.repulsionForceY+=m*u}else this.uniformLeafNodeSizes&&null==t.getChild()&&null==e.getChild()?(n=p.getCenterX()-d.getCenterX(),r=p.getCenterY()-d.getCenterY()):(l.getIntersection(d,p,f),n=f[2]-f[0],r=f[3]-f[1]),Math.abs(n)<a.MIN_REPULSION_DIST&&(n=c.sign(n)*a.MIN_REPULSION_DIST),Math.abs(r)<a.MIN_REPULSION_DIST&&(r=c.sign(r)*a.MIN_REPULSION_DIST),i=n*n+r*r,s=Math.sqrt(i),h=(o=this.repulsionConstant*t.noOfChildren*e.noOfChildren/i)*n/s,u=o*r/s,t.repulsionForceX-=h,t.repulsionForceY-=u,e.repulsionForceX+=h,e.repulsionForceY+=u},h.prototype.calcGravitationalForce=function(t){var e,n,r,i,a,s,o,l;n=((e=t.getOwner()).getRight()+e.getLeft())/2,r=(e.getTop()+e.getBottom())/2,i=t.getCenterX()-n,a=t.getCenterY()-r,s=Math.abs(i)+t.getWidth()/2,o=Math.abs(a)+t.getHeight()/2,t.getOwner()==this.graphManager.getRoot()?(s>(l=e.getEstimatedSize()*this.gravityRangeFactor)||o>l)&&(t.gravitationForceX=-this.gravityConstant*i,t.gravitationForceY=-this.gravityConstant*a):(s>(l=e.getEstimatedSize()*this.compoundGravityRangeFactor)||o>l)&&(t.gravitationForceX=-this.gravityConstant*i*this.compoundGravityConstant,t.gravitationForceY=-this.gravityConstant*a*this.compoundGravityConstant)},h.prototype.isConverged=function(){var t,e=!1;return this.totalIterations>this.maxIterations/3&&(e=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),t=this.totalDisplacement<this.totalDisplacementThreshold,this.oldTotalDisplacement=this.totalDisplacement,t||e},h.prototype.animate=function(){this.animationDuringLayout&&!this.isSubLayout&&(this.notAnimatedIterations==this.animationPeriod?(this.update(),this.notAnimatedIterations=0):this.notAnimatedIterations++)},h.prototype.calcNoOfChildrenForAllNodes=function(){for(var t,e=this.graphManager.getAllNodes(),n=0;n<e.length;n++)(t=e[n]).noOfChildren=t.getNoOfChildren()},h.prototype.calcGrid=function(t){var e,n;e=parseInt(Math.ceil((t.getRight()-t.getLeft())/this.repulsionRange)),n=parseInt(Math.ceil((t.getBottom()-t.getTop())/this.repulsionRange));for(var r=new Array(e),i=0;i<e;i++)r[i]=new Array(n);for(i=0;i<e;i++)for(var a=0;a<n;a++)r[i][a]=new Array;return r},h.prototype.addNodeToGrid=function(t,e,n){var r,i,a,s;r=parseInt(Math.floor((t.getRect().x-e)/this.repulsionRange)),i=parseInt(Math.floor((t.getRect().width+t.getRect().x-e)/this.repulsionRange)),a=parseInt(Math.floor((t.getRect().y-n)/this.repulsionRange)),s=parseInt(Math.floor((t.getRect().height+t.getRect().y-n)/this.repulsionRange));for(var o=r;o<=i;o++)for(var l=a;l<=s;l++)this.grid[o][l].push(t),t.setGridCoordinates(r,i,a,s)},h.prototype.updateGrid=function(){var t,e,n=this.getAllNodes();for(this.grid=this.calcGrid(this.graphManager.getRoot()),t=0;t<n.length;t++)e=n[t],this.addNodeToGrid(e,this.graphManager.getRoot().getLeft(),this.graphManager.getRoot().getTop())},h.prototype.calculateRepulsionForceOfANode=function(t,e,n,i){if(this.totalIterations%a.GRID_CALCULATION_CHECK_PERIOD==1&&n||i){var s,o=new Set;t.surrounding=new Array;for(var l=this.grid,c=t.startX-1;c<t.finishX+2;c++)for(var h=t.startY-1;h<t.finishY+2;h++)if(!(c<0||h<0||c>=l.length||h>=l[0].length))for(var u=0;u<l[c][h].length;u++)if(s=l[c][h][u],t.getOwner()==s.getOwner()&&t!=s&&!e.has(s)&&!o.has(s)){var d=Math.abs(t.getCenterX()-s.getCenterX())-(t.getWidth()/2+s.getWidth()/2),p=Math.abs(t.getCenterY()-s.getCenterY())-(t.getHeight()/2+s.getHeight()/2);d<=this.repulsionRange&&p<=this.repulsionRange&&o.add(s)}t.surrounding=[].concat(r(o))}for(c=0;c<t.surrounding.length;c++)this.calcRepulsionForce(t,t.surrounding[c])},h.prototype.calcRepulsionRange=function(){return 0},t.exports=h},function(t,e,n){var r=n(1),i=n(7);function a(t,e,n){r.call(this,t,e,n),this.idealLength=i.DEFAULT_EDGE_LENGTH}for(var o in s(a,"FDLayoutEdge"),a.prototype=Object.create(r.prototype),r)a[o]=r[o];t.exports=a},function(t,e,n){var r=n(3);function i(t,e,n,i){r.call(this,t,e,n,i),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=[]}for(var a in s(i,"FDLayoutNode"),i.prototype=Object.create(r.prototype),r)i[a]=r[a];i.prototype.setGridCoordinates=function(t,e,n,r){this.startX=t,this.finishX=e,this.startY=n,this.finishY=r},t.exports=i},function(t,e,n){function r(t,e){this.width=0,this.height=0,null!==t&&null!==e&&(this.height=e,this.width=t)}s(r,"DimensionD"),r.prototype.getWidth=function(){return this.width},r.prototype.setWidth=function(t){this.width=t},r.prototype.getHeight=function(){return this.height},r.prototype.setHeight=function(t){this.height=t},t.exports=r},function(t,e,n){var r=n(14);function i(){this.map={},this.keys=[]}s(i,"HashMap"),i.prototype.put=function(t,e){var n=r.createID(t);this.contains(n)||(this.map[n]=e,this.keys.push(t))},i.prototype.contains=function(t){return r.createID(t),null!=this.map[t]},i.prototype.get=function(t){var e=r.createID(t);return this.map[e]},i.prototype.keySet=function(){return this.keys},t.exports=i},function(t,e,n){var r=n(14);function i(){this.set={}}s(i,"HashSet"),i.prototype.add=function(t){var e=r.createID(t);this.contains(e)||(this.set[e]=t)},i.prototype.remove=function(t){delete this.set[r.createID(t)]},i.prototype.clear=function(){this.set={}},i.prototype.contains=function(t){return this.set[r.createID(t)]==t},i.prototype.isEmpty=function(){return 0===this.size()},i.prototype.size=function(){return Object.keys(this.set).length},i.prototype.addAllTo=function(t){for(var e=Object.keys(this.set),n=e.length,r=0;r<n;r++)t.push(this.set[e[r]])},i.prototype.size=function(){return Object.keys(this.set).length},i.prototype.addAll=function(t){for(var e=t.length,n=0;n<e;n++){var r=t[n];this.add(r)}},t.exports=i},function(t,e,n){var r=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return s(t,"defineProperties"),function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}();function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}s(i,"_classCallCheck");var a=n(11),o=function(){function t(e,n){i(this,t),null===n&&void 0===n||(this.compareFunction=this._defaultCompareFunction);var r=void 0;r=e instanceof a?e.size():e.length,this._quicksort(e,0,r-1)}return s(t,"Quicksort"),r(t,[{key:"_quicksort",value:s((function(t,e,n){if(e<n){var r=this._partition(t,e,n);this._quicksort(t,e,r),this._quicksort(t,r+1,n)}}),"_quicksort")},{key:"_partition",value:s((function(t,e,n){for(var r=this._get(t,e),i=e,a=n;;){for(;this.compareFunction(r,this._get(t,a));)a--;for(;this.compareFunction(this._get(t,i),r);)i++;if(!(i<a))return a;this._swap(t,i,a),i++,a--}}),"_partition")},{key:"_get",value:s((function(t,e){return t instanceof a?t.get_object_at(e):t[e]}),"_get")},{key:"_set",value:s((function(t,e,n){t instanceof a?t.set_object_at(e,n):t[e]=n}),"_set")},{key:"_swap",value:s((function(t,e,n){var r=this._get(t,e);this._set(t,e,this._get(t,n)),this._set(t,n,r)}),"_swap")},{key:"_defaultCompareFunction",value:s((function(t,e){return e>t}),"_defaultCompareFunction")}]),t}();t.exports=o},function(t,e,n){var r=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return s(t,"defineProperties"),function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}();function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}s(i,"_classCallCheck");var a=function(){function t(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:-1,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:-1;i(this,t),this.sequence1=e,this.sequence2=n,this.match_score=r,this.mismatch_penalty=a,this.gap_penalty=s,this.iMax=e.length+1,this.jMax=n.length+1,this.grid=new Array(this.iMax);for(var o=0;o<this.iMax;o++){this.grid[o]=new Array(this.jMax);for(var l=0;l<this.jMax;l++)this.grid[o][l]=0}this.tracebackGrid=new Array(this.iMax);for(var c=0;c<this.iMax;c++){this.tracebackGrid[c]=new Array(this.jMax);for(var h=0;h<this.jMax;h++)this.tracebackGrid[c][h]=[null,null,null]}this.alignments=[],this.score=-1,this.computeGrids()}return s(t,"NeedlemanWunsch"),r(t,[{key:"getScore",value:s((function(){return this.score}),"getScore")},{key:"getAlignments",value:s((function(){return this.alignments}),"getAlignments")},{key:"computeGrids",value:s((function(){for(var t=1;t<this.jMax;t++)this.grid[0][t]=this.grid[0][t-1]+this.gap_penalty,this.tracebackGrid[0][t]=[!1,!1,!0];for(var e=1;e<this.iMax;e++)this.grid[e][0]=this.grid[e-1][0]+this.gap_penalty,this.tracebackGrid[e][0]=[!1,!0,!1];for(var n=1;n<this.iMax;n++)for(var r=1;r<this.jMax;r++){var i=[this.sequence1[n-1]===this.sequence2[r-1]?this.grid[n-1][r-1]+this.match_score:this.grid[n-1][r-1]+this.mismatch_penalty,this.grid[n-1][r]+this.gap_penalty,this.grid[n][r-1]+this.gap_penalty],a=this.arrayAllMaxIndexes(i);this.grid[n][r]=i[a[0]],this.tracebackGrid[n][r]=[a.includes(0),a.includes(1),a.includes(2)]}this.score=this.grid[this.iMax-1][this.jMax-1]}),"computeGrids")},{key:"alignmentTraceback",value:s((function(){var t=[];for(t.push({pos:[this.sequence1.length,this.sequence2.length],seq1:"",seq2:""});t[0];){var e=t[0],n=this.tracebackGrid[e.pos[0]][e.pos[1]];n[0]&&t.push({pos:[e.pos[0]-1,e.pos[1]-1],seq1:this.sequence1[e.pos[0]-1]+e.seq1,seq2:this.sequence2[e.pos[1]-1]+e.seq2}),n[1]&&t.push({pos:[e.pos[0]-1,e.pos[1]],seq1:this.sequence1[e.pos[0]-1]+e.seq1,seq2:"-"+e.seq2}),n[2]&&t.push({pos:[e.pos[0],e.pos[1]-1],seq1:"-"+e.seq1,seq2:this.sequence2[e.pos[1]-1]+e.seq2}),0===e.pos[0]&&0===e.pos[1]&&this.alignments.push({sequence1:e.seq1,sequence2:e.seq2}),t.shift()}return this.alignments}),"alignmentTraceback")},{key:"getAllIndexes",value:s((function(t,e){for(var n=[],r=-1;-1!==(r=t.indexOf(e,r+1));)n.push(r);return n}),"getAllIndexes")},{key:"arrayAllMaxIndexes",value:s((function(t){return this.getAllIndexes(t,Math.max.apply(null,t))}),"arrayAllMaxIndexes")}]),t}();t.exports=a},function(t,e,n){var r=s((function(){}),"layoutBase");r.FDLayout=n(18),r.FDLayoutConstants=n(7),r.FDLayoutEdge=n(19),r.FDLayoutNode=n(20),r.DimensionD=n(21),r.HashMap=n(22),r.HashSet=n(23),r.IGeometry=n(8),r.IMath=n(9),r.Integer=n(10),r.Point=n(12),r.PointD=n(4),r.RandomSeed=n(16),r.RectangleD=n(13),r.Transform=n(17),r.UniqueIDGeneretor=n(14),r.Quicksort=n(24),r.LinkedList=n(11),r.LGraphObject=n(2),r.LGraph=n(5),r.LEdge=n(1),r.LGraphManager=n(6),r.LNode=n(3),r.Layout=n(15),r.LayoutConstants=n(0),r.NeedlemanWunsch=n(25),t.exports=r},function(t,e,n){function r(){this.listeners=[]}s(r,"Emitter");var i=r.prototype;i.addListener=function(t,e){this.listeners.push({event:t,callback:e})},i.removeListener=function(t,e){for(var n=this.listeners.length;n>=0;n--){var r=this.listeners[n];r.event===t&&r.callback===e&&this.listeners.splice(n,1)}},i.emit=function(t,e){for(var n=0;n<this.listeners.length;n++){var r=this.listeners[n];t===r.event&&r.callback(e)}},t.exports=r}])}))}}),hCt=o({"../../node_modules/.pnpm/cose-base@1.0.3/node_modules/cose-base/cose-base.js"(t,e){s((function(n,r){"object"==typeof t&&"object"==typeof e?e.exports=r(cCt()):"function"==typeof define&&define.amd?define(["layout-base"],r):"object"==typeof t?t.coseBase=r(cCt()):n.coseBase=r(n.layoutBase)}),"webpackUniversalModuleDefinition")(t,(function(t){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return s(n,"__webpack_require__"),n.m=t,n.c=e,n.i=function(t){return t},n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:r})},n.n=function(t){var e=t&&t.__esModule?s((function(){return t.default}),"getDefault"):s((function(){return t}),"getModuleExports");return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=7)}([function(e,n){e.exports=t},function(t,e,n){var r=n(0).FDLayoutConstants;function i(){}for(var a in s(i,"CoSEConstants"),r)i[a]=r[a];i.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,i.DEFAULT_RADIAL_SEPARATION=r.DEFAULT_EDGE_LENGTH,i.DEFAULT_COMPONENT_SEPERATION=60,i.TILE=!0,i.TILING_PADDING_VERTICAL=10,i.TILING_PADDING_HORIZONTAL=10,i.TREE_REDUCTION_ON_INCREMENTAL=!1,t.exports=i},function(t,e,n){var r=n(0).FDLayoutEdge;function i(t,e,n){r.call(this,t,e,n)}for(var a in s(i,"CoSEEdge"),i.prototype=Object.create(r.prototype),r)i[a]=r[a];t.exports=i},function(t,e,n){var r=n(0).LGraph;function i(t,e,n){r.call(this,t,e,n)}for(var a in s(i,"CoSEGraph"),i.prototype=Object.create(r.prototype),r)i[a]=r[a];t.exports=i},function(t,e,n){var r=n(0).LGraphManager;function i(t){r.call(this,t)}for(var a in s(i,"CoSEGraphManager"),i.prototype=Object.create(r.prototype),r)i[a]=r[a];t.exports=i},function(t,e,n){var r=n(0).FDLayoutNode,i=n(0).IMath;function a(t,e,n,i){r.call(this,t,e,n,i)}for(var o in s(a,"CoSENode"),a.prototype=Object.create(r.prototype),r)a[o]=r[o];a.prototype.move=function(){var t=this.graphManager.getLayout();this.displacementX=t.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY=t.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren,Math.abs(this.displacementX)>t.coolingFactor*t.maxNodeDisplacement&&(this.displacementX=t.coolingFactor*t.maxNodeDisplacement*i.sign(this.displacementX)),Math.abs(this.displacementY)>t.coolingFactor*t.maxNodeDisplacement&&(this.displacementY=t.coolingFactor*t.maxNodeDisplacement*i.sign(this.displacementY)),null==this.child||0==this.child.getNodes().length?this.moveBy(this.displacementX,this.displacementY):this.propogateDisplacementToChildren(this.displacementX,this.displacementY),t.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},a.prototype.propogateDisplacementToChildren=function(t,e){for(var n,r=this.getChild().getNodes(),i=0;i<r.length;i++)null==(n=r[i]).getChild()?(n.moveBy(t,e),n.displacementX+=t,n.displacementY+=e):n.propogateDisplacementToChildren(t,e)},a.prototype.setPred1=function(t){this.pred1=t},a.prototype.getPred1=function(){return pred1},a.prototype.getPred2=function(){return pred2},a.prototype.setNext=function(t){this.next=t},a.prototype.getNext=function(){return next},a.prototype.setProcessed=function(t){this.processed=t},a.prototype.isProcessed=function(){return processed},t.exports=a},function(t,e,n){var r=n(0).FDLayout,i=n(4),a=n(3),o=n(5),l=n(2),c=n(1),h=n(0).FDLayoutConstants,u=n(0).LayoutConstants,d=n(0).Point,p=n(0).PointD,g=n(0).Layout,f=n(0).Integer,m=n(0).IGeometry,y=n(0).LGraph,v=n(0).Transform;function x(){r.call(this),this.toBeTiled={}}for(var b in s(x,"CoSELayout"),x.prototype=Object.create(r.prototype),r)x[b]=r[b];x.prototype.newGraphManager=function(){var t=new i(this);return this.graphManager=t,t},x.prototype.newGraph=function(t){return new a(null,this.graphManager,t)},x.prototype.newNode=function(t){return new o(this.graphManager,t)},x.prototype.newEdge=function(t){return new l(null,null,t)},x.prototype.initParameters=function(){r.prototype.initParameters.call(this,arguments),this.isSubLayout||(c.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=c.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=c.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.springConstant=h.DEFAULT_SPRING_STRENGTH,this.repulsionConstant=h.DEFAULT_REPULSION_STRENGTH,this.gravityConstant=h.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=h.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=h.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=h.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/h.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=h.CONVERGENCE_CHECK_PERIOD/this.maxIterations,this.coolingAdjuster=1)},x.prototype.layout=function(){return u.DEFAULT_CREATE_BENDS_AS_NEEDED&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},x.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(c.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();e=new Set(this.getAllNodes()),n=this.nodesWithGravity.filter((function(t){return e.has(t)}));this.graphManager.setAllNodesToApplyGravitation(n)}}else{var t=this.getFlatForest();if(t.length>0)this.positionNodesRadially(t);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var e=new Set(this.getAllNodes()),n=this.nodesWithGravity.filter((function(t){return e.has(t)}));this.graphManager.setAllNodesToApplyGravitation(n),this.positionNodesRandomly()}}return this.initSpringEmbedder(),this.runSpringEmbedder(),!0},x.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished){if(!(this.prunedNodesAll.length>0))return!0;this.isTreeGrowing=!0}if(this.totalIterations%h.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged()){if(!(this.prunedNodesAll.length>0))return!0;this.isTreeGrowing=!0}this.coolingCycle++,0==this.layoutQuality?this.coolingAdjuster=this.coolingCycle:1==this.layoutQuality&&(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 t=new Set(this.getAllNodes()),e=this.nodesWithGravity.filter((function(e){return t.has(e)}));this.graphManager.setAllNodesToApplyGravitation(e),this.graphManager.updateBounds(),this.updateGrid(),this.coolingFactor=h.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=h.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var n=!this.isTreeGrowing&&!this.isGrowthFinished,r=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(n,r),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},x.prototype.getPositionsData=function(){for(var t=this.graphManager.getAllNodes(),e={},n=0;n<t.length;n++){var r=t[n].rect,i=t[n].id;e[i]={id:i,x:r.getCenterX(),y:r.getCenterY(),w:r.width,h:r.height}}return e},x.prototype.runSpringEmbedder=function(){this.initialAnimationPeriod=25,this.animationPeriod=this.initialAnimationPeriod;var t=!1;if("during"===h.ANIMATE)this.emit("layoutstarted");else{for(;!t;)t=this.tick();this.graphManager.updateBounds()}},x.prototype.calculateNodesToApplyGravitationTo=function(){var t,e,n=[],r=this.graphManager.getGraphs(),i=r.length;for(e=0;e<i;e++)(t=r[e]).updateConnected(),t.isConnected||(n=n.concat(t.getNodes()));return n},x.prototype.createBendpoints=function(){var t=[];t=t.concat(this.graphManager.getAllEdges());var e,n=new Set;for(e=0;e<t.length;e++){var r=t[e];if(!n.has(r)){var i=r.getSource(),a=r.getTarget();if(i==a)r.getBendpoints().push(new p),r.getBendpoints().push(new p),this.createDummyNodesForBendpoints(r),n.add(r);else{var s=[];if(s=(s=s.concat(i.getEdgeListToNode(a))).concat(a.getEdgeListToNode(i)),!n.has(s[0])){var o;if(s.length>1)for(o=0;o<s.length;o++){var l=s[o];l.getBendpoints().push(new p),this.createDummyNodesForBendpoints(l)}s.forEach((function(t){n.add(t)}))}}}if(n.size==t.length)break}},x.prototype.positionNodesRadially=function(t){for(var e=new d(0,0),n=Math.ceil(Math.sqrt(t.length)),r=0,i=0,a=0,s=new p(0,0),o=0;o<t.length;o++){o%n==0&&(a=0,i=r,0!=o&&(i+=c.DEFAULT_COMPONENT_SEPERATION),r=0);var l=t[o],h=g.findCenterOfTree(l);e.x=a,e.y=i,(s=x.radialLayout(l,h,e)).y>r&&(r=Math.floor(s.y)),a=Math.floor(s.x+c.DEFAULT_COMPONENT_SEPERATION)}this.transform(new p(u.WORLD_CENTER_X-s.x/2,u.WORLD_CENTER_Y-s.y/2))},x.radialLayout=function(t,e,n){var r=Math.max(this.maxDiagonalInTree(t),c.DEFAULT_RADIAL_SEPARATION);x.branchRadialLayout(e,null,0,359,0,r);var i=y.calculateBounds(t),a=new v;a.setDeviceOrgX(i.getMinX()),a.setDeviceOrgY(i.getMinY()),a.setWorldOrgX(n.x),a.setWorldOrgY(n.y);for(var s=0;s<t.length;s++){t[s].transform(a)}var o=new p(i.getMaxX(),i.getMaxY());return a.inverseTransformPoint(o)},x.branchRadialLayout=function(t,e,n,r,i,a){var s=(r-n+1)/2;s<0&&(s+=180);var o=(s+n)%360*m.TWO_PI/360,l=i*Math.cos(o),c=i*Math.sin(o);t.setCenter(l,c);var h=[],u=(h=h.concat(t.getEdges())).length;null!=e&&u--;for(var d,p=0,g=h.length,f=t.getEdgesBetween(e);f.length>1;){var y=f[0];f.splice(0,1);var v=h.indexOf(y);v>=0&&h.splice(v,1),g--,u--}d=null!=e?(h.indexOf(f[0])+1)%g:0;for(var b=Math.abs(r-n)/u,w=d;p!=u;w=++w%g){var k=h[w].getOtherEnd(t);if(k!=e){var T=(n+p*b)%360,_=(T+b)%360;x.branchRadialLayout(k,t,T,_,i+a,a),p++}}},x.maxDiagonalInTree=function(t){for(var e=f.MIN_VALUE,n=0;n<t.length;n++){var r=t[n].getDiagonal();r>e&&(e=r)}return e},x.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},x.prototype.groupZeroDegreeMembers=function(){var t=this,e={};this.memberGroups={},this.idToDummyNode={};for(var n=[],r=this.graphManager.getAllNodes(),i=0;i<r.length;i++){var a=(s=r[i]).getParent();0!==this.getNodeDegreeWithChildren(s)||null!=a.id&&this.getToBeTiled(a)||n.push(s)}for(i=0;i<n.length;i++){var s,l=(s=n[i]).getParent().id;void 0===e[l]&&(e[l]=[]),e[l]=e[l].concat(s)}Object.keys(e).forEach((function(n){if(e[n].length>1){var r="DummyCompound_"+n;t.memberGroups[r]=e[n];var i=e[n][0].getParent(),a=new o(t.graphManager);a.id=r,a.paddingLeft=i.paddingLeft||0,a.paddingRight=i.paddingRight||0,a.paddingBottom=i.paddingBottom||0,a.paddingTop=i.paddingTop||0,t.idToDummyNode[r]=a;var s=t.getGraphManager().add(t.newGraph(),a),l=i.getChild();l.add(a);for(var c=0;c<e[n].length;c++){var h=e[n][c];l.remove(h),s.add(h)}}}))},x.prototype.clearCompounds=function(){var t={},e={};this.performDFSOnCompounds();for(var n=0;n<this.compoundOrder.length;n++)e[this.compoundOrder[n].id]=this.compoundOrder[n],t[this.compoundOrder[n].id]=[].concat(this.compoundOrder[n].getChild().getNodes()),this.graphManager.remove(this.compoundOrder[n].getChild()),this.compoundOrder[n].child=null;this.graphManager.resetAllNodes(),this.tileCompoundMembers(t,e)},x.prototype.clearZeroDegreeMembers=function(){var t=this,e=this.tiledZeroDegreePack=[];Object.keys(this.memberGroups).forEach((function(n){var r=t.idToDummyNode[n];e[n]=t.tileNodes(t.memberGroups[n],r.paddingLeft+r.paddingRight),r.rect.width=e[n].width,r.rect.height=e[n].height}))},x.prototype.repopulateCompounds=function(){for(var t=this.compoundOrder.length-1;t>=0;t--){var e=this.compoundOrder[t],n=e.id,r=e.paddingLeft,i=e.paddingTop;this.adjustLocations(this.tiledMemberPack[n],e.rect.x,e.rect.y,r,i)}},x.prototype.repopulateZeroDegreeMembers=function(){var t=this,e=this.tiledZeroDegreePack;Object.keys(e).forEach((function(n){var r=t.idToDummyNode[n],i=r.paddingLeft,a=r.paddingTop;t.adjustLocations(e[n],r.rect.x,r.rect.y,i,a)}))},x.prototype.getToBeTiled=function(t){var e=t.id;if(null!=this.toBeTiled[e])return this.toBeTiled[e];var n=t.getChild();if(null==n)return this.toBeTiled[e]=!1,!1;for(var r=n.getNodes(),i=0;i<r.length;i++){var a=r[i];if(this.getNodeDegree(a)>0)return this.toBeTiled[e]=!1,!1;if(null!=a.getChild()){if(!this.getToBeTiled(a))return this.toBeTiled[e]=!1,!1}else this.toBeTiled[a.id]=!1}return this.toBeTiled[e]=!0,!0},x.prototype.getNodeDegree=function(t){t.id;for(var e=t.getEdges(),n=0,r=0;r<e.length;r++){var i=e[r];i.getSource().id!==i.getTarget().id&&(n+=1)}return n},x.prototype.getNodeDegreeWithChildren=function(t){var e=this.getNodeDegree(t);if(null==t.getChild())return e;for(var n=t.getChild().getNodes(),r=0;r<n.length;r++){var i=n[r];e+=this.getNodeDegreeWithChildren(i)}return e},x.prototype.performDFSOnCompounds=function(){this.compoundOrder=[],this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes())},x.prototype.fillCompexOrderByDFS=function(t){for(var e=0;e<t.length;e++){var n=t[e];null!=n.getChild()&&this.fillCompexOrderByDFS(n.getChild().getNodes()),this.getToBeTiled(n)&&this.compoundOrder.push(n)}},x.prototype.adjustLocations=function(t,e,n,r,i){n+=i;for(var a=e+=r,s=0;s<t.rows.length;s++){var o=t.rows[s];e=a;for(var l=0,c=0;c<o.length;c++){var h=o[c];h.rect.x=e,h.rect.y=n,e+=h.rect.width+t.horizontalPadding,h.rect.height>l&&(l=h.rect.height)}n+=l+t.verticalPadding}},x.prototype.tileCompoundMembers=function(t,e){var n=this;this.tiledMemberPack=[],Object.keys(t).forEach((function(r){var i=e[r];n.tiledMemberPack[r]=n.tileNodes(t[r],i.paddingLeft+i.paddingRight),i.rect.width=n.tiledMemberPack[r].width,i.rect.height=n.tiledMemberPack[r].height}))},x.prototype.tileNodes=function(t,e){var n={rows:[],rowWidth:[],rowHeight:[],width:0,height:e,verticalPadding:c.TILING_PADDING_VERTICAL,horizontalPadding:c.TILING_PADDING_HORIZONTAL};t.sort((function(t,e){return t.rect.width*t.rect.height>e.rect.width*e.rect.height?-1:t.rect.width*t.rect.height<e.rect.width*e.rect.height?1:0}));for(var r=0;r<t.length;r++){var i=t[r];0==n.rows.length?this.insertNodeToRow(n,i,0,e):this.canAddHorizontal(n,i.rect.width,i.rect.height)?this.insertNodeToRow(n,i,this.getShortestRowIndex(n),e):this.insertNodeToRow(n,i,n.rows.length,e),this.shiftToLastRow(n)}return n},x.prototype.insertNodeToRow=function(t,e,n,r){var i=r;if(n==t.rows.length){t.rows.push([]),t.rowWidth.push(i),t.rowHeight.push(0)}var a=t.rowWidth[n]+e.rect.width;t.rows[n].length>0&&(a+=t.horizontalPadding),t.rowWidth[n]=a,t.width<a&&(t.width=a);var s=e.rect.height;n>0&&(s+=t.verticalPadding);var o=0;s>t.rowHeight[n]&&(o=t.rowHeight[n],t.rowHeight[n]=s,o=t.rowHeight[n]-o),t.height+=o,t.rows[n].push(e)},x.prototype.getShortestRowIndex=function(t){for(var e=-1,n=Number.MAX_VALUE,r=0;r<t.rows.length;r++)t.rowWidth[r]<n&&(e=r,n=t.rowWidth[r]);return e},x.prototype.getLongestRowIndex=function(t){for(var e=-1,n=Number.MIN_VALUE,r=0;r<t.rows.length;r++)t.rowWidth[r]>n&&(e=r,n=t.rowWidth[r]);return e},x.prototype.canAddHorizontal=function(t,e,n){var r=this.getShortestRowIndex(t);if(r<0)return!0;var i=t.rowWidth[r];if(i+t.horizontalPadding+e<=t.width)return!0;var a,s,o=0;return t.rowHeight[r]<n&&r>0&&(o=n+t.verticalPadding-t.rowHeight[r]),a=t.width-i>=e+t.horizontalPadding?(t.height+o)/(i+e+t.horizontalPadding):(t.height+o)/t.width,o=n+t.verticalPadding,(s=t.width<e?(t.height+o)/e:(t.height+o)/t.width)<1&&(s=1/s),a<1&&(a=1/a),a<s},x.prototype.shiftToLastRow=function(t){var e=this.getLongestRowIndex(t),n=t.rowWidth.length-1,r=t.rows[e],i=r[r.length-1],a=i.width+t.horizontalPadding;if(t.width-t.rowWidth[n]>a&&e!=n){r.splice(-1,1),t.rows[n].push(i),t.rowWidth[e]=t.rowWidth[e]-a,t.rowWidth[n]=t.rowWidth[n]+a,t.width=t.rowWidth[instance.getLongestRowIndex(t)];for(var s=Number.MIN_VALUE,o=0;o<r.length;o++)r[o].height>s&&(s=r[o].height);e>0&&(s+=t.verticalPadding);var l=t.rowHeight[e]+t.rowHeight[n];t.rowHeight[e]=s,t.rowHeight[n]<i.height+t.verticalPadding&&(t.rowHeight[n]=i.height+t.verticalPadding);var c=t.rowHeight[e]+t.rowHeight[n];t.height+=c-l,this.shiftToLastRow(t)}},x.prototype.tilingPreLayout=function(){c.TILE&&(this.groupZeroDegreeMembers(),this.clearCompounds(),this.clearZeroDegreeMembers())},x.prototype.tilingPostLayout=function(){c.TILE&&(this.repopulateZeroDegreeMembers(),this.repopulateCompounds())},x.prototype.reduceTrees=function(){for(var t,e=[],n=!0;n;){var r=this.graphManager.getAllNodes(),i=[];n=!1;for(var a=0;a<r.length;a++)1!=(t=r[a]).getEdges().length||t.getEdges()[0].isInterGraph||null!=t.getChild()||(i.push([t,t.getEdges()[0],t.getOwner()]),n=!0);if(1==n){for(var s=[],o=0;o<i.length;o++)1==i[o][0].getEdges().length&&(s.push(i[o]),i[o][0].getOwner().remove(i[o][0]));e.push(s),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()}}this.prunedNodesAll=e},x.prototype.growTree=function(t){for(var e,n=t[t.length-1],r=0;r<n.length;r++)e=n[r],this.findPlaceforPrunedNode(e),e[2].add(e[0]),e[2].add(e[1],e[1].source,e[1].target);t.splice(t.length-1,1),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()},x.prototype.findPlaceforPrunedNode=function(t){var e,n,r=t[0],i=(n=r==t[1].source?t[1].target:t[1].source).startX,a=n.finishX,s=n.startY,o=n.finishY,l=[0,0,0,0];if(s>0)for(var c=i;c<=a;c++)l[0]+=this.grid[c][s-1].length+this.grid[c][s].length-1;if(a<this.grid.length-1)for(c=s;c<=o;c++)l[1]+=this.grid[a+1][c].length+this.grid[a][c].length-1;if(o<this.grid[0].length-1)for(c=i;c<=a;c++)l[2]+=this.grid[c][o+1].length+this.grid[c][o].length-1;if(i>0)for(c=s;c<=o;c++)l[3]+=this.grid[i-1][c].length+this.grid[i][c].length-1;for(var u,d,p=f.MAX_VALUE,g=0;g<l.length;g++)l[g]<p?(p=l[g],u=1,d=g):l[g]==p&&u++;if(3==u&&0==p)0==l[0]&&0==l[1]&&0==l[2]?e=1:0==l[0]&&0==l[1]&&0==l[3]?e=0:0==l[0]&&0==l[2]&&0==l[3]?e=3:0==l[1]&&0==l[2]&&0==l[3]&&(e=2);else if(2==u&&0==p){var m=Math.floor(2*Math.random());e=0==l[0]&&0==l[1]?0==m?0:1:0==l[0]&&0==l[2]?0==m?0:2:0==l[0]&&0==l[3]?0==m?0:3:0==l[1]&&0==l[2]?0==m?1:2:0==l[1]&&0==l[3]?0==m?1:3:0==m?2:3}else if(4==u&&0==p){e=m=Math.floor(4*Math.random())}else e=d;0==e?r.setCenter(n.getCenterX(),n.getCenterY()-n.getHeight()/2-h.DEFAULT_EDGE_LENGTH-r.getHeight()/2):1==e?r.setCenter(n.getCenterX()+n.getWidth()/2+h.DEFAULT_EDGE_LENGTH+r.getWidth()/2,n.getCenterY()):2==e?r.setCenter(n.getCenterX(),n.getCenterY()+n.getHeight()/2+h.DEFAULT_EDGE_LENGTH+r.getHeight()/2):r.setCenter(n.getCenterX()-n.getWidth()/2-h.DEFAULT_EDGE_LENGTH-r.getWidth()/2,n.getCenterY())},t.exports=x},function(t,e,n){var r={};r.layoutBase=n(0),r.CoSEConstants=n(1),r.CoSEEdge=n(2),r.CoSEGraph=n(3),r.CoSEGraphManager=n(4),r.CoSELayout=n(6),r.CoSENode=n(5),t.exports=r}])}))}}),uCt=o({"../../node_modules/.pnpm/cytoscape-cose-bilkent@4.1.0_cytoscape@3.30.2/node_modules/cytoscape-cose-bilkent/cytoscape-cose-bilkent.js"(t,e){s((function(n,r){"object"==typeof t&&"object"==typeof e?e.exports=r(hCt()):"function"==typeof define&&define.amd?define(["cose-base"],r):"object"==typeof t?t.cytoscapeCoseBilkent=r(hCt()):n.cytoscapeCoseBilkent=r(n.coseBase)}),"webpackUniversalModuleDefinition")(t,(function(t){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return s(n,"__webpack_require__"),n.m=t,n.c=e,n.i=function(t){return t},n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:r})},n.n=function(t){var e=t&&t.__esModule?s((function(){return t.default}),"getDefault"):s((function(){return t}),"getModuleExports");return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=1)}([function(e,n){e.exports=t},function(t,e,n){var r=n(0).layoutBase.LayoutConstants,i=n(0).layoutBase.FDLayoutConstants,a=n(0).CoSEConstants,o=n(0).CoSELayout,l=n(0).CoSENode,c=n(0).layoutBase.PointD,h=n(0).layoutBase.DimensionD,u={ready:s((function(){}),"ready"),stop:s((function(){}),"stop"),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 d(t,e){var n={};for(var r in t)n[r]=t[r];for(var r in e)n[r]=e[r];return n}function p(t){this.options=d(u,t),g(this.options)}s(d,"extend"),s(p,"_CoSELayout");var g=s((function(t){null!=t.nodeRepulsion&&(a.DEFAULT_REPULSION_STRENGTH=i.DEFAULT_REPULSION_STRENGTH=t.nodeRepulsion),null!=t.idealEdgeLength&&(a.DEFAULT_EDGE_LENGTH=i.DEFAULT_EDGE_LENGTH=t.idealEdgeLength),null!=t.edgeElasticity&&(a.DEFAULT_SPRING_STRENGTH=i.DEFAULT_SPRING_STRENGTH=t.edgeElasticity),null!=t.nestingFactor&&(a.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=i.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=t.nestingFactor),null!=t.gravity&&(a.DEFAULT_GRAVITY_STRENGTH=i.DEFAULT_GRAVITY_STRENGTH=t.gravity),null!=t.numIter&&(a.MAX_ITERATIONS=i.MAX_ITERATIONS=t.numIter),null!=t.gravityRange&&(a.DEFAULT_GRAVITY_RANGE_FACTOR=i.DEFAULT_GRAVITY_RANGE_FACTOR=t.gravityRange),null!=t.gravityCompound&&(a.DEFAULT_COMPOUND_GRAVITY_STRENGTH=i.DEFAULT_COMPOUND_GRAVITY_STRENGTH=t.gravityCompound),null!=t.gravityRangeCompound&&(a.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=i.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=t.gravityRangeCompound),null!=t.initialEnergyOnIncremental&&(a.DEFAULT_COOLING_FACTOR_INCREMENTAL=i.DEFAULT_COOLING_FACTOR_INCREMENTAL=t.initialEnergyOnIncremental),"draft"==t.quality?r.QUALITY=0:"proof"==t.quality?r.QUALITY=2:r.QUALITY=1,a.NODE_DIMENSIONS_INCLUDE_LABELS=i.NODE_DIMENSIONS_INCLUDE_LABELS=r.NODE_DIMENSIONS_INCLUDE_LABELS=t.nodeDimensionsIncludeLabels,a.DEFAULT_INCREMENTAL=i.DEFAULT_INCREMENTAL=r.DEFAULT_INCREMENTAL=!t.randomize,a.ANIMATE=i.ANIMATE=r.ANIMATE=t.animate,a.TILE=t.tile,a.TILING_PADDING_VERTICAL="function"==typeof t.tilingPaddingVertical?t.tilingPaddingVertical.call():t.tilingPaddingVertical,a.TILING_PADDING_HORIZONTAL="function"==typeof t.tilingPaddingHorizontal?t.tilingPaddingHorizontal.call():t.tilingPaddingHorizontal}),"getUserOptions");p.prototype.run=function(){var t,e,n=this.options;this.idToLNode={};var r=this.layout=new o,i=this;i.stopped=!1,this.cy=this.options.cy,this.cy.trigger({type:"layoutstart",layout:this});var a=r.newGraphManager();this.gm=a;var l=this.options.eles.nodes(),c=this.options.eles.edges();this.root=a.addRoot(),this.processChildrenList(this.root,this.getTopMostNodes(l),r);for(var h=0;h<c.length;h++){var u=c[h],d=this.idToLNode[u.data("source")],p=this.idToLNode[u.data("target")];if(d!==p&&0==d.getEdgesBetween(p).length)a.add(r.newEdge(),d,p).id=u.id()}var g=s((function(t,e){"number"==typeof t&&(t=e);var n=t.data("id"),r=i.idToLNode[n];return{x:r.getRect().getCenterX(),y:r.getRect().getCenterY()}}),"getPositions"),f=s((function a(){for(var o,l=s((function(){n.fit&&n.cy.fit(n.eles,n.padding),t||(t=!0,i.cy.one("layoutready",n.ready),i.cy.trigger({type:"layoutready",layout:i}))}),"afterReposition"),c=i.options.refresh,h=0;h<c&&!o;h++)o=i.stopped||i.layout.tick();if(o)return r.checkLayoutSuccess()&&!r.isSubLayout&&r.doPostLayout(),r.tilingPostLayout&&r.tilingPostLayout(),r.isLayoutFinished=!0,i.options.eles.nodes().positions(g),l(),i.cy.one("layoutstop",i.options.stop),i.cy.trigger({type:"layoutstop",layout:i}),e&&cancelAnimationFrame(e),void(t=!1);var u=i.layout.getPositionsData();n.eles.nodes().positions((function(t,e){if("number"==typeof t&&(t=e),!t.isParent()){for(var n=t.id(),r=u[n],i=t;null==r&&(r=u[i.data("parent")]||u["DummyCompound_"+i.data("parent")],u[n]=r,null!=(i=i.parent()[0])););return null!=r?{x:r.x,y:r.y}:{x:t.position("x"),y:t.position("y")}}})),l(),e=requestAnimationFrame(a)}),"iterateAnimated");return r.addListener("layoutstarted",(function(){"during"===i.options.animate&&(e=requestAnimationFrame(f))})),r.runLayout(),"during"!==this.options.animate&&(i.options.eles.nodes().not(":parent").layoutPositions(i,i.options,g),t=!1),this},p.prototype.getTopMostNodes=function(t){for(var e={},n=0;n<t.length;n++)e[t[n].id()]=!0;return t.filter((function(t,n){"number"==typeof t&&(t=n);for(var r=t.parent()[0];null!=r;){if(e[r.id()])return!1;r=r.parent()[0]}return!0}))},p.prototype.processChildrenList=function(t,e,n){for(var r=e.length,i=0;i<r;i++){var a,s,o=e[i],u=o.children(),d=o.layoutDimensions({nodeDimensionsIncludeLabels:this.options.nodeDimensionsIncludeLabels});if((a=null!=o.outerWidth()&&null!=o.outerHeight()?t.add(new l(n.graphManager,new c(o.position("x")-d.w/2,o.position("y")-d.h/2),new h(parseFloat(d.w),parseFloat(d.h)))):t.add(new l(this.graphManager))).id=o.data("id"),a.paddingLeft=parseInt(o.css("padding")),a.paddingTop=parseInt(o.css("padding")),a.paddingRight=parseInt(o.css("padding")),a.paddingBottom=parseInt(o.css("padding")),this.options.nodeDimensionsIncludeLabels&&o.isParent()){var p=o.boundingBox({includeLabels:!0,includeNodes:!1}).w,g=o.boundingBox({includeLabels:!0,includeNodes:!1}).h,f=o.css("text-halign");a.labelWidth=p,a.labelHeight=g,a.labelPos=f}if(this.idToLNode[o.data("id")]=a,isNaN(a.rect.x)&&(a.rect.x=0),isNaN(a.rect.y)&&(a.rect.y=0),null!=u&&u.length>0)s=n.getGraphManager().add(n.newGraph(),a),this.processChildrenList(s,u,n)}},p.prototype.stop=function(){return this.stopped=!0,this};var f=s((function(t){t("layout","cose-bilkent",p)}),"register");"undefined"!=typeof cytoscape&&f(cytoscape),t.exports=f}])}))}}),dCt=function(){var t=s((function(t,e,n,r){for(n=n||{},r=t.length;r--;n[t[r]]=e);return n}),"o"),e=[1,4],n=[1,13],r=[1,12],i=[1,15],a=[1,16],o=[1,20],l=[1,19],c=[6,7,8],h=[1,26],u=[1,24],d=[1,25],p=[6,7,11],g=[1,6,13,15,16,19,22],f=[1,33],m=[1,34],y=[1,6,7,11,13,15,16,19,22],v={trace:s((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:s((function(t,e,n,r,i,a,s){var o=a.length-1;switch(i){case 6:case 7:return r;case 8:r.getLogger().trace("Stop NL ");break;case 9:r.getLogger().trace("Stop EOF ");break;case 11:r.getLogger().trace("Stop NL2 ");break;case 12:r.getLogger().trace("Stop EOF2 ");break;case 15:r.getLogger().info("Node: ",a[o].id),r.addNode(a[o-1].length,a[o].id,a[o].descr,a[o].type);break;case 16:r.getLogger().trace("Icon: ",a[o]),r.decorateNode({icon:a[o]});break;case 17:case 21:r.decorateNode({class:a[o]});break;case 18:r.getLogger().trace("SPACELIST");break;case 19:r.getLogger().trace("Node: ",a[o].id),r.addNode(0,a[o].id,a[o].descr,a[o].type);break;case 20:r.decorateNode({icon:a[o]});break;case 25:r.getLogger().trace("node found ..",a[o-2]),this.$={id:a[o-1],descr:a[o-1],type:r.getType(a[o-2],a[o])};break;case 26:this.$={id:a[o],descr:a[o],type:r.nodeType.DEFAULT};break;case 27:r.getLogger().trace("node found ..",a[o-3]),this.$={id:a[o-3],descr:a[o-1],type:r.getType(a[o-2],a[o])}}}),"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:n,7:[1,10],9:9,12:11,13:r,14:14,15:i,16:a,17:17,18:18,19:o,22:l},t(c,[2,3]),{1:[2,2]},t(c,[2,4]),t(c,[2,5]),{1:[2,6],6:n,12:21,13:r,14:14,15:i,16:a,17:17,18:18,19:o,22:l},{6:n,9:22,12:11,13:r,14:14,15:i,16:a,17:17,18:18,19:o,22:l},{6:h,7:u,10:23,11:d},t(p,[2,22],{17:17,18:18,14:27,15:[1,28],16:[1,29],19:o,22:l}),t(p,[2,18]),t(p,[2,19]),t(p,[2,20]),t(p,[2,21]),t(p,[2,23]),t(p,[2,24]),t(p,[2,26],{19:[1,30]}),{20:[1,31]},{6:h,7:u,10:32,11:d},{1:[2,7],6:n,12:21,13:r,14:14,15:i,16:a,17:17,18:18,19:o,22:l},t(g,[2,14],{7:f,11:m}),t(y,[2,8]),t(y,[2,9]),t(y,[2,10]),t(p,[2,15]),t(p,[2,16]),t(p,[2,17]),{20:[1,35]},{21:[1,36]},t(g,[2,13],{7:f,11:m}),t(y,[2,11]),t(y,[2,12]),{21:[1,37]},t(p,[2,25]),t(p,[2,27])],defaultActions:{2:[2,1],6:[2,2]},parseError:s((function(t,e){if(!e.recoverable){var n=new Error(t);throw n.hash=e,n}this.trace(t)}),"parseError"),parse:s((function(t){var e=this,n=[0],r=[],i=[null],a=[],o=this.table,l="",c=0,h=0,u=2,d=1,p=a.slice.call(arguments,1),g=Object.create(this.lexer),f={yy:{}};for(var m in this.yy)Object.prototype.hasOwnProperty.call(this.yy,m)&&(f.yy[m]=this.yy[m]);g.setInput(t,f.yy),f.yy.lexer=g,f.yy.parser=this,void 0===g.yylloc&&(g.yylloc={});var y=g.yylloc;a.push(y);var v=g.options&&g.options.ranges;function x(t){n.length=n.length-2*t,i.length=i.length-t,a.length=a.length-t}function b(){var t;return"number"!=typeof(t=r.pop()||g.lex()||d)&&(t instanceof Array&&(t=(r=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof f.yy.parseError?this.parseError=f.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,s(x,"popStack"),s(b,"lex");for(var w,k,T,_,E,C,S,A,L={};;){if(k=n[n.length-1],this.defaultActions[k]?T=this.defaultActions[k]:(null==w&&(w=b()),T=o[k]&&o[k][w]),void 0===T||!T.length||!T[0]){var N="";for(E in A=[],o[k])this.terminals_[E]&&E>u&&A.push("'"+this.terminals_[E]+"'");N=g.showPosition?"Parse error on line "+(c+1)+":\n"+g.showPosition()+"\nExpecting "+A.join(", ")+", got '"+(this.terminals_[w]||w)+"'":"Parse error on line "+(c+1)+": Unexpected "+(w==d?"end of input":"'"+(this.terminals_[w]||w)+"'"),this.parseError(N,{text:g.match,token:this.terminals_[w]||w,line:g.yylineno,loc:y,expected:A})}if(T[0]instanceof Array&&T.length>1)throw new Error("Parse Error: multiple actions possible at state: "+k+", token: "+w);switch(T[0]){case 1:n.push(w),i.push(g.yytext),a.push(g.yylloc),n.push(T[1]),w=null,h=g.yyleng,l=g.yytext,c=g.yylineno,y=g.yylloc;break;case 2:if(C=this.productions_[T[1]][1],L.$=i[i.length-C],L._$={first_line:a[a.length-(C||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(C||1)].first_column,last_column:a[a.length-1].last_column},v&&(L._$.range=[a[a.length-(C||1)].range[0],a[a.length-1].range[1]]),void 0!==(_=this.performAction.apply(L,[l,h,c,f.yy,T[1],i,a].concat(p))))return _;C&&(n=n.slice(0,-1*C*2),i=i.slice(0,-1*C),a=a.slice(0,-1*C)),n.push(this.productions_[T[1]][0]),i.push(L.$),a.push(L._$),S=o[n[n.length-2]][n[n.length-1]],n.push(S);break;case 3:return!0}}return!0}),"parse")},x=function(){var t={EOF:1,parseError:s((function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)}),"parseError"),setInput:s((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:s((function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(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:s((function(t){var e=t.length,n=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 r=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 i=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===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this}),"unput"),more:s((function(){return this._more=!0,this}),"more"),reject:s((function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):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).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}),"reject"),less:s((function(t){this.unput(this.match.slice(t))}),"less"),pastInput:s((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:s((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:s((function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"}),"showPosition"),test_match:s((function(t,e){var n,r,i;if(this.options.backtrack_lexer&&(i={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&&(i.yylloc.range=this.yylloc.range.slice(0))),(r=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.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],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1}),"test_match"),next:s((function(){if(this.done)return this.EOF;var t,e,n,r;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;a<i.length;a++)if((n=this._input.match(this.rules[i[a]]))&&(!e||n[0].length>e[0].length)){if(e=n,r=a,this.options.backtrack_lexer){if(!1!==(t=this.test_match(n,i[a])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,i[r]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}),"next"),lex:s((function(){var t=this.next();return t||this.lex()}),"lex"),begin:s((function(t){this.conditionStack.push(t)}),"begin"),popState:s((function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]}),"popState"),_currentRules:s((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:s((function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"}),"topState"),pushState:s((function(t){this.begin(t)}),"pushState"),stateStackSize:s((function(){return this.conditionStack.length}),"stateStackSize"),options:{"case-insensitive":!0},performAction:s((function(t,e,n,r){switch(n){case 0:return t.getLogger().trace("Found comment",e.yytext),6;case 1:return 8;case 2:this.begin("CLASS");break;case 3:return this.popState(),16;case 4:case 23:case 26:this.popState();break;case 5:t.getLogger().trace("Begin icon"),this.begin("ICON");break;case 6:return t.getLogger().trace("SPACELINE"),6;case 7:return 7;case 8:return 15;case 9:t.getLogger().trace("end icon"),this.popState();break;case 10:return t.getLogger().trace("Exploding node"),this.begin("NODE"),19;case 11:return t.getLogger().trace("Cloud"),this.begin("NODE"),19;case 12:return t.getLogger().trace("Explosion Bang"),this.begin("NODE"),19;case 13:return t.getLogger().trace("Cloud Bang"),this.begin("NODE"),19;case 14:case 15:case 16: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 24:t.getLogger().trace("Starting NSTR"),this.begin("NSTR");break;case 25:return t.getLogger().trace("description:",e.yytext),"NODE_DESCR";case 27:return this.popState(),t.getLogger().trace("node end ))"),"NODE_DEND";case 28:return this.popState(),t.getLogger().trace("node end )"),"NODE_DEND";case 29:return this.popState(),t.getLogger().trace("node end ...",e.yytext),"NODE_DEND";case 30:case 33:case 34:return this.popState(),t.getLogger().trace("node end (("),"NODE_DEND";case 31:case 32:return this.popState(),t.getLogger().trace("node end (-"),"NODE_DEND";case 35:case 36:return t.getLogger().trace("Long description:",e.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}();function b(){this.yy={}}return v.lexer=x,s(b,"Parser"),b.prototype=v,v.Parser=b,new b}();dCt.parser=dCt;var pCt=dCt,gCt=[],fCt=0,mCt={},yCt=s((()=>{gCt=[],fCt=0,mCt={}}),"clear"),vCt=s((function(t){for(let e=gCt.length-1;e>=0;e--)if(gCt[e].level<t)return gCt[e];return null}),"getParent"),xCt=s((()=>gCt.length>0?gCt[0]:null),"getMindmap"),bCt=s(((t,e,n,r)=>{m.info("addNode",t,e,n,r);const i=Hn();let a=i.mindmap?.padding??Ct.mindmap.padding;switch(r){case wCt.ROUNDED_RECT:case wCt.RECT:case wCt.HEXAGON:a*=2}const s={id:fCt++,nodeId:an(e,i),level:t,descr:an(n,i),type:r,children:[],width:i.mindmap?.maxNodeWidth??Ct.mindmap.maxNodeWidth,padding:a},o=vCt(t);if(o)o.children.push(s),gCt.push(s);else{if(0!==gCt.length)throw new Error('There can be only one root. No parent could be found for ("'+s.descr+'")');gCt.push(s)}}),"addNode"),wCt={DEFAULT:0,NO_BORDER:0,ROUNDED_RECT:1,RECT:2,CIRCLE:3,CLOUD:4,BANG:5,HEXAGON:6},kCt=s(((t,e)=>{switch(m.debug("In get type",t,e),t){case"[":return wCt.RECT;case"(":return")"===e?wCt.ROUNDED_RECT:wCt.CLOUD;case"((":return wCt.CIRCLE;case")":return wCt.CLOUD;case"))":return wCt.BANG;case"{{":return wCt.HEXAGON;default:return wCt.DEFAULT}}),"getType"),TCt=s(((t,e)=>{mCt[t]=e}),"setElementForId"),_Ct=s((t=>{if(!t)return;const e=Hn(),n=gCt[gCt.length-1];t.icon&&(n.icon=an(t.icon,e)),t.class&&(n.class=an(t.class,e))}),"decorateNode"),ECt=s((t=>{switch(t){case wCt.DEFAULT:return"no-border";case wCt.RECT:return"rect";case wCt.ROUNDED_RECT:return"rounded-rect";case wCt.CIRCLE:return"circle";case wCt.CLOUD:return"cloud";case wCt.BANG:return"bang";case wCt.HEXAGON:return"hexgon";default:return"no-border"}}),"type2Str"),CCt=s((()=>m),"getLogger"),SCt=s((t=>mCt[t]),"getElementById"),ACt={clear:yCt,addNode:bCt,getMindmap:xCt,nodeType:wCt,getType:kCt,setElementForId:TCt,decorateNode:_Ct,type2Str:ECt,getLogger:CCt,getElementById:SCt},LCt=d(uCt(),1),NCt=s((function(t,e,n,r){e.append("path").attr("id","node-"+n.id).attr("class","node-bkg node-"+t.type2Str(n.type)).attr("d",`M0 ${n.height-5} v${10-n.height} q0,-5 5,-5 h${n.width-10} q5,0 5,5 v${n.height-5} H0 Z`),e.append("line").attr("class","node-line-"+r).attr("x1",0).attr("y1",n.height).attr("x2",n.width).attr("y2",n.height)}),"defaultBkg"),ICt=s((function(t,e,n){e.append("rect").attr("id","node-"+n.id).attr("class","node-bkg node-"+t.type2Str(n.type)).attr("height",n.height).attr("width",n.width)}),"rectBkg"),MCt=s((function(t,e,n){const r=n.width,i=n.height,a=.15*r,s=.25*r,o=.35*r,l=.2*r;e.append("path").attr("id","node-"+n.id).attr("class","node-bkg node-"+t.type2Str(n.type)).attr("d",`M0 0 a${a},${a} 0 0,1 ${.25*r},${-1*r*.1}\n a${o},${o} 1 0,1 ${.4*r},${-1*r*.1}\n a${s},${s} 1 0,1 ${.35*r},${1*r*.2}\n\n a${a},${a} 1 0,1 ${.15*r},${1*i*.35}\n a${l},${l} 1 0,1 ${-1*r*.15},${1*i*.65}\n\n a${s},${a} 1 0,1 ${-1*r*.25},${.15*r}\n a${o},${o} 1 0,1 ${-1*r*.5},0\n a${a},${a} 1 0,1 ${-1*r*.25},${-1*r*.15}\n\n a${a},${a} 1 0,1 ${-1*r*.1},${-1*i*.35}\n a${l},${l} 1 0,1 ${.1*r},${-1*i*.65}\n\n H0 V0 Z`)}),"cloudBkg"),RCt=s((function(t,e,n){const r=n.width,i=n.height,a=.15*r;e.append("path").attr("id","node-"+n.id).attr("class","node-bkg node-"+t.type2Str(n.type)).attr("d",`M0 0 a${a},${a} 1 0,0 ${.25*r},${-1*i*.1}\n a${a},${a} 1 0,0 ${.25*r},0\n a${a},${a} 1 0,0 ${.25*r},0\n a${a},${a} 1 0,0 ${.25*r},${1*i*.1}\n\n a${a},${a} 1 0,0 ${.15*r},${1*i*.33}\n a${.8*a},${.8*a} 1 0,0 0,${1*i*.34}\n a${a},${a} 1 0,0 ${-1*r*.15},${1*i*.33}\n\n a${a},${a} 1 0,0 ${-1*r*.25},${.15*i}\n a${a},${a} 1 0,0 ${-1*r*.25},0\n a${a},${a} 1 0,0 ${-1*r*.25},0\n a${a},${a} 1 0,0 ${-1*r*.25},${-1*i*.15}\n\n a${a},${a} 1 0,0 ${-1*r*.1},${-1*i*.33}\n a${.8*a},${.8*a} 1 0,0 0,${-1*i*.34}\n a${a},${a} 1 0,0 ${.1*r},${-1*i*.33}\n\n H0 V0 Z`)}),"bangBkg"),DCt=s((function(t,e,n){e.append("circle").attr("id","node-"+n.id).attr("class","node-bkg node-"+t.type2Str(n.type)).attr("r",n.width/2)}),"circleBkg");function OCt(t,e,n,r,i){return t.insert("polygon",":first-child").attr("points",r.map((function(t){return t.x+","+t.y})).join(" ")).attr("transform","translate("+(i.width-e)/2+", "+n+")")}s(OCt,"insertPolygonShape");var PCt=s((function(t,e,n){const r=n.height,i=r/4,a=n.width-n.padding+2*i;OCt(e,a,r,[{x:i,y:0},{x:a-i,y:0},{x:a,y:-r/2},{x:a-i,y:-r},{x:i,y:-r},{x:0,y:-r/2}],n)}),"hexagonBkg"),BCt=s((function(t,e,n){e.append("rect").attr("id","node-"+n.id).attr("class","node-bkg node-"+t.type2Str(n.type)).attr("height",n.height).attr("rx",n.padding).attr("ry",n.padding).attr("width",n.width)}),"roundedRectBkg"),$Ct=s((async function(t,e,n,r,i){const a=i.htmlLabels,s=r%11,o=e.append("g");n.section=s;let l="section-"+s;s<0&&(l+=" section-root"),o.attr("class",(n.class?n.class+" ":"")+"mindmap-node "+l);const c=o.append("g"),h=o.append("g"),u=n.descr.replace(/(<br\/*>)/g,"\n");await KT(h,u,{useHtmlLabels:a,width:n.width,classes:"mindmap-node-label"},i),a||h.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle");const d=h.node().getBBox(),[p]=fk(i.fontSize);if(n.height=d.height+1.1*p*.5+n.padding,n.width=d.width+2*n.padding,n.icon)if(n.type===t.nodeType.CIRCLE){n.height+=50,n.width+=50;o.append("foreignObject").attr("height","50px").attr("width",n.width).attr("style","text-align: center;").append("div").attr("class","icon-container").append("i").attr("class","node-icon-"+s+" "+n.icon),h.attr("transform","translate("+n.width/2+", "+(n.height/2-1.5*n.padding)+")")}else{n.width+=50;const t=n.height;n.height=Math.max(t,60);const e=Math.abs(n.height-t);o.append("foreignObject").attr("width","60px").attr("height",n.height).attr("style","text-align: center;margin-top:"+e/2+"px;").append("div").attr("class","icon-container").append("i").attr("class","node-icon-"+s+" "+n.icon),h.attr("transform","translate("+(25+n.width/2)+", "+(e/2+n.padding/2)+")")}else if(a){const t=(n.width-d.width)/2,e=(n.height-d.height)/2;h.attr("transform","translate("+t+", "+e+")")}else{const t=n.width/2,e=n.padding/2;h.attr("transform","translate("+t+", "+e+")")}switch(n.type){case t.nodeType.DEFAULT:NCt(t,c,n,s);break;case t.nodeType.ROUNDED_RECT:BCt(t,c,n,s);break;case t.nodeType.RECT:ICt(t,c,n,s);break;case t.nodeType.CIRCLE:c.attr("transform","translate("+n.width/2+", "+ +n.height/2+")"),DCt(t,c,n,s);break;case t.nodeType.CLOUD:MCt(t,c,n,s);break;case t.nodeType.BANG:RCt(t,c,n,s);break;case t.nodeType.HEXAGON:PCt(t,c,n,s)}return t.setElementForId(n.id,o),n.height}),"drawNode"),FCt=s((function(t,e){const n=t.getElementById(e.id),r=e.x||0,i=e.y||0;n.attr("transform","translate("+r+","+i+")")}),"positionNode");async function zCt(t,e,n,r,i){await $Ct(t,e,n,r,i),n.children&&await Promise.all(n.children.map(((n,a)=>zCt(t,e,n,r<0?a:r,i))))}function UCt(t,e){e.edges().map(((e,n)=>{const r=e.data();if(e[0]._private.bodyBounds){const i=e[0]._private.rscratch;m.trace("Edge: ",n,r),t.insert("path").attr("d",`M ${i.startX},${i.startY} L ${i.midX},${i.midY} L${i.endX},${i.endY} `).attr("class","edge section-edge-"+r.section+" edge-depth-"+r.depth)}}))}function GCt(t,e,n,r){e.add({group:"nodes",data:{id:t.id.toString(),labelText:t.descr,height:t.height,width:t.width,level:r,nodeId:t.id,padding:t.padding,type:t.type},position:{x:t.x,y:t.y}}),t.children&&t.children.forEach((i=>{GCt(i,e,n,r+1),e.add({group:"edges",data:{id:`${t.id}_${i.id}`,source:t.id,target:i.id,depth:r,section:i.section}})}))}function qCt(t,e){return new Promise((n=>{const r=Oa("body").append("div").attr("id","cy").attr("style","display:none"),i=lCt({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"bezier"}}]});r.remove(),GCt(t,i,e,0),i.nodes().forEach((function(t){t.layoutDimensions=()=>{const e=t.data();return{w:e.width,h:e.height}}})),i.layout({name:"cose-bilkent",quality:"proof",styleEnabled:!1,animate:!1}).run(),i.ready((t=>{m.info("Ready",t),n(i)}))}))}function jCt(t,e){e.nodes().map(((e,n)=>{const r=e.data();r.x=e.position().x,r.y=e.position().y,FCt(t,r);const i=t.getElementById(r.nodeId);m.info("Id:",n,"Position: (",e.position().x,", ",e.position().y,")",r),i.attr("transform",`translate(${e.position().x-r.width/2}, ${e.position().y-r.height/2})`),i.attr("attr",`apa-${n})`)}))}lCt.use(LCt.default),s(zCt,"drawNodes"),s(UCt,"drawEdges"),s(GCt,"addNodes"),s(qCt,"layoutMindmap"),s(jCt,"positionNodes");var YCt=s((async(t,e,n,r)=>{m.debug("Rendering mindmap diagram\n"+t);const i=r.db,a=i.getMindmap();if(!a)return;const s=Hn();s.htmlLabels=!1;const o=zp(e),l=o.append("g");l.attr("class","mindmap-edges");const c=o.append("g");c.attr("class","mindmap-nodes"),await zCt(i,c,a,-1,s);const h=await qCt(a,s);UCt(l,h),jCt(i,h),An(void 0,o,s.mindmap?.padding??Ct.mindmap.padding,s.mindmap?.useMaxWidth??Ct.mindmap.useMaxWidth)}),"draw"),WCt={draw:YCt},HCt=s((t=>{let e="";for(let e=0;e<t.THEME_COLOR_LIMIT;e++)t["lineColor"+e]=t["lineColor"+e]||t["cScaleInv"+e],rt(t["lineColor"+e])?t["lineColor"+e]=at(t["lineColor"+e],20):t["lineColor"+e]=st(t["lineColor"+e],20);for(let n=0;n<t.THEME_COLOR_LIMIT;n++){const r=""+(17-3*n);e+=`\n .section-${n-1} rect, .section-${n-1} path, .section-${n-1} circle, .section-${n-1} polygon, .section-${n-1} path {\n fill: ${t["cScale"+n]};\n }\n .section-${n-1} text {\n fill: ${t["cScaleLabel"+n]};\n }\n .node-icon-${n-1} {\n font-size: 40px;\n color: ${t["cScaleLabel"+n]};\n }\n .section-edge-${n-1}{\n stroke: ${t["cScale"+n]};\n }\n .edge-depth-${n-1}{\n stroke-width: ${r};\n }\n .section-${n-1} line {\n stroke: ${t["cScaleInv"+n]} ;\n stroke-width: 3;\n }\n\n .disabled, .disabled circle, .disabled text {\n fill: lightgray;\n }\n .disabled text {\n fill: #efefef;\n }\n `}return e}),"genSections"),VCt={db:ACt,renderer:WCt,parser:pCt,styles:s((t=>`\n .edge {\n stroke-width: 3;\n }\n ${HCt(t)}\n .section-root rect, .section-root path, .section-root circle, .section-root polygon {\n fill: ${t.git0};\n }\n .section-root text {\n fill: ${t.gitBranchLabel0};\n }\n .icon-container {\n height:100%;\n display: flex;\n justify-content: center;\n align-items: center;\n }\n .edge {\n fill: none;\n }\n .mindmap-node-label {\n dy: 1em;\n alignment-baseline: middle;\n text-anchor: middle;\n dominant-baseline: middle;\n text-align: center;\n }\n`),"getStyles")},XCt=Object.freeze({__proto__:null,diagram:VCt}),KCt=function(){var t=s((function(t,e,n,r){for(n=n||{},r=t.length;r--;n[t[r]]=e);return n}),"o"),e=[1,4],n=[1,13],r=[1,12],i=[1,15],a=[1,16],o=[1,20],l=[1,19],c=[6,7,8],h=[1,26],u=[1,24],d=[1,25],p=[6,7,11],g=[1,31],f=[6,7,11,24],m=[1,6,13,16,17,20,23],y=[1,35],v=[1,36],x=[1,6,7,11,13,16,17,20,23],b=[1,38],w={trace:s((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:s((function(t,e,n,r,i,a,s){var o=a.length-1;switch(i){case 6:case 7:return r;case 8:r.getLogger().trace("Stop NL ");break;case 9:r.getLogger().trace("Stop EOF ");break;case 11:r.getLogger().trace("Stop NL2 ");break;case 12:r.getLogger().trace("Stop EOF2 ");break;case 15:r.getLogger().info("Node: ",a[o-1].id),r.addNode(a[o-2].length,a[o-1].id,a[o-1].descr,a[o-1].type,a[o]);break;case 16:r.getLogger().info("Node: ",a[o].id),r.addNode(a[o-1].length,a[o].id,a[o].descr,a[o].type);break;case 17:r.getLogger().trace("Icon: ",a[o]),r.decorateNode({icon:a[o]});break;case 18:case 23:r.decorateNode({class:a[o]});break;case 19:r.getLogger().trace("SPACELIST");break;case 20:r.getLogger().trace("Node: ",a[o-1].id),r.addNode(0,a[o-1].id,a[o-1].descr,a[o-1].type,a[o]);break;case 21:r.getLogger().trace("Node: ",a[o].id),r.addNode(0,a[o].id,a[o].descr,a[o].type);break;case 22:r.decorateNode({icon:a[o]});break;case 27:r.getLogger().trace("node found ..",a[o-2]),this.$={id:a[o-1],descr:a[o-1],type:r.getType(a[o-2],a[o])};break;case 28:this.$={id:a[o],descr:a[o],type:0};break;case 29:r.getLogger().trace("node found ..",a[o-3]),this.$={id:a[o-3],descr:a[o-1],type:r.getType(a[o-2],a[o])};break;case 30:this.$=a[o-1]+a[o];break;case 31:this.$=a[o]}}),"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:n,7:[1,10],9:9,12:11,13:r,14:14,16:i,17:a,18:17,19:18,20:o,23:l},t(c,[2,3]),{1:[2,2]},t(c,[2,4]),t(c,[2,5]),{1:[2,6],6:n,12:21,13:r,14:14,16:i,17:a,18:17,19:18,20:o,23:l},{6:n,9:22,12:11,13:r,14:14,16:i,17:a,18:17,19:18,20:o,23:l},{6:h,7:u,10:23,11:d},t(p,[2,24],{18:17,19:18,14:27,16:[1,28],17:[1,29],20:o,23:l}),t(p,[2,19]),t(p,[2,21],{15:30,24:g}),t(p,[2,22]),t(p,[2,23]),t(f,[2,25]),t(f,[2,26]),t(f,[2,28],{20:[1,32]}),{21:[1,33]},{6:h,7:u,10:34,11:d},{1:[2,7],6:n,12:21,13:r,14:14,16:i,17:a,18:17,19:18,20:o,23:l},t(m,[2,14],{7:y,11:v}),t(x,[2,8]),t(x,[2,9]),t(x,[2,10]),t(p,[2,16],{15:37,24:g}),t(p,[2,17]),t(p,[2,18]),t(p,[2,20],{24:b}),t(f,[2,31]),{21:[1,39]},{22:[1,40]},t(m,[2,13],{7:y,11:v}),t(x,[2,11]),t(x,[2,12]),t(p,[2,15],{24:b}),t(f,[2,30]),{22:[1,41]},t(f,[2,27]),t(f,[2,29])],defaultActions:{2:[2,1],6:[2,2]},parseError:s((function(t,e){if(!e.recoverable){var n=new Error(t);throw n.hash=e,n}this.trace(t)}),"parseError"),parse:s((function(t){var e=this,n=[0],r=[],i=[null],a=[],o=this.table,l="",c=0,h=0,u=2,d=1,p=a.slice.call(arguments,1),g=Object.create(this.lexer),f={yy:{}};for(var m in this.yy)Object.prototype.hasOwnProperty.call(this.yy,m)&&(f.yy[m]=this.yy[m]);g.setInput(t,f.yy),f.yy.lexer=g,f.yy.parser=this,void 0===g.yylloc&&(g.yylloc={});var y=g.yylloc;a.push(y);var v=g.options&&g.options.ranges;function x(t){n.length=n.length-2*t,i.length=i.length-t,a.length=a.length-t}function b(){var t;return"number"!=typeof(t=r.pop()||g.lex()||d)&&(t instanceof Array&&(t=(r=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof f.yy.parseError?this.parseError=f.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,s(x,"popStack"),s(b,"lex");for(var w,k,T,_,E,C,S,A,L={};;){if(k=n[n.length-1],this.defaultActions[k]?T=this.defaultActions[k]:(null==w&&(w=b()),T=o[k]&&o[k][w]),void 0===T||!T.length||!T[0]){var N="";for(E in A=[],o[k])this.terminals_[E]&&E>u&&A.push("'"+this.terminals_[E]+"'");N=g.showPosition?"Parse error on line "+(c+1)+":\n"+g.showPosition()+"\nExpecting "+A.join(", ")+", got '"+(this.terminals_[w]||w)+"'":"Parse error on line "+(c+1)+": Unexpected "+(w==d?"end of input":"'"+(this.terminals_[w]||w)+"'"),this.parseError(N,{text:g.match,token:this.terminals_[w]||w,line:g.yylineno,loc:y,expected:A})}if(T[0]instanceof Array&&T.length>1)throw new Error("Parse Error: multiple actions possible at state: "+k+", token: "+w);switch(T[0]){case 1:n.push(w),i.push(g.yytext),a.push(g.yylloc),n.push(T[1]),w=null,h=g.yyleng,l=g.yytext,c=g.yylineno,y=g.yylloc;break;case 2:if(C=this.productions_[T[1]][1],L.$=i[i.length-C],L._$={first_line:a[a.length-(C||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(C||1)].first_column,last_column:a[a.length-1].last_column},v&&(L._$.range=[a[a.length-(C||1)].range[0],a[a.length-1].range[1]]),void 0!==(_=this.performAction.apply(L,[l,h,c,f.yy,T[1],i,a].concat(p))))return _;C&&(n=n.slice(0,-1*C*2),i=i.slice(0,-1*C),a=a.slice(0,-1*C)),n.push(this.productions_[T[1]][0]),i.push(L.$),a.push(L._$),S=o[n[n.length-2]][n[n.length-1]],n.push(S);break;case 3:return!0}}return!0}),"parse")},k=function(){var t={EOF:1,parseError:s((function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)}),"parseError"),setInput:s((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:s((function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(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:s((function(t){var e=t.length,n=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 r=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 i=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===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this}),"unput"),more:s((function(){return this._more=!0,this}),"more"),reject:s((function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):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).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}),"reject"),less:s((function(t){this.unput(this.match.slice(t))}),"less"),pastInput:s((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:s((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:s((function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"}),"showPosition"),test_match:s((function(t,e){var n,r,i;if(this.options.backtrack_lexer&&(i={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&&(i.yylloc.range=this.yylloc.range.slice(0))),(r=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.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],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1}),"test_match"),next:s((function(){if(this.done)return this.EOF;var t,e,n,r;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;a<i.length;a++)if((n=this._input.match(this.rules[i[a]]))&&(!e||n[0].length>e[0].length)){if(e=n,r=a,this.options.backtrack_lexer){if(!1!==(t=this.test_match(n,i[a])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,i[r]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}),"next"),lex:s((function(){var t=this.next();return t||this.lex()}),"lex"),begin:s((function(t){this.conditionStack.push(t)}),"begin"),popState:s((function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]}),"popState"),_currentRules:s((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:s((function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"}),"topState"),pushState:s((function(t){this.begin(t)}),"pushState"),stateStackSize:s((function(){return this.conditionStack.length}),"stateStackSize"),options:{"case-insensitive":!0},performAction:s((function(t,e,n,r){switch(n){case 0:return this.pushState("shapeData"),e.yytext="",24;case 1:return this.pushState("shapeDataStr"),24;case 2:return this.popState(),24;case 3:const n=/\n\s*/g;return e.yytext=e.yytext.replace(n,"<br/>"),24;case 4:return 24;case 5:case 10:case 29:case 32:this.popState();break;case 6:return t.getLogger().trace("Found comment",e.yytext),6;case 7:return 8;case 8:this.begin("CLASS");break;case 9:return this.popState(),17;case 11:t.getLogger().trace("Begin icon"),this.begin("ICON");break;case 12:return t.getLogger().trace("SPACELINE"),6;case 13:return 7;case 14:return 16;case 15:t.getLogger().trace("end icon"),this.popState();break;case 16:return t.getLogger().trace("Exploding node"),this.begin("NODE"),20;case 17:return t.getLogger().trace("Cloud"),this.begin("NODE"),20;case 18:return t.getLogger().trace("Explosion Bang"),this.begin("NODE"),20;case 19:return t.getLogger().trace("Cloud Bang"),this.begin("NODE"),20;case 20:case 21:case 22: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 30:t.getLogger().trace("Starting NSTR"),this.begin("NSTR");break;case 31:return t.getLogger().trace("description:",e.yytext),"NODE_DESCR";case 33:return this.popState(),t.getLogger().trace("node end ))"),"NODE_DEND";case 34:return this.popState(),t.getLogger().trace("node end )"),"NODE_DEND";case 35:return this.popState(),t.getLogger().trace("node end ...",e.yytext),"NODE_DEND";case 36:case 39:case 40:return this.popState(),t.getLogger().trace("node end (("),"NODE_DEND";case 37:case 38:return this.popState(),t.getLogger().trace("node end (-"),"NODE_DEND";case 41:case 42:return t.getLogger().trace("Long description:",e.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 t}();function T(){this.yy={}}return w.lexer=k,s(T,"Parser"),T.prototype=w,w.Parser=T,new T}();KCt.parser=KCt;var ZCt=KCt,QCt=[],JCt=[],tSt=0,eSt={},nSt=s((()=>{QCt=[],JCt=[],tSt=0,eSt={}}),"clear"),rSt=s((t=>{if(0===QCt.length)return null;const e=QCt[0].level;let n=null;for(let t=QCt.length-1;t>=0;t--)if(QCt[t].level!==e||n||(n=QCt[t]),QCt[t].level<e)throw new Error('Items without section detected, found section ("'+QCt[t].label+'")');return t===n?.level?null:n}),"getSection"),iSt=s((function(){return JCt}),"getSections"),aSt=s((function(){const t=[],e=iSt(),n=Hn();for(const r of e){const e={id:r.id,label:an(r.label??"",n),isGroup:!0,ticket:r.ticket,shape:"kanbanSection",level:r.level,look:n.look};t.push(e);const i=QCt.filter((t=>t.parentId===r.id));for(const e of i){const i={id:e.id,parentId:r.id,label:an(e.label??"",n),isGroup:!1,ticket:e?.ticket,priority:e?.priority,assigned:e?.assigned,icon:e?.icon,shape:"kanbanItem",level:e.level,rx:5,ry:5,cssStyles:["text-align: left"]};t.push(i)}}return{nodes:t,edges:[],other:{},config:Hn()}}),"getData"),sSt=s(((t,e,n,r,i)=>{const a=Hn();let s=a.mindmap?.padding??Ct.mindmap.padding;switch(r){case oSt.ROUNDED_RECT:case oSt.RECT:case oSt.HEXAGON:s*=2}const o={id:an(e,a)||"kbn"+tSt++,level:t,label:an(n,a),width:a.mindmap?.maxNodeWidth??Ct.mindmap.maxNodeWidth,padding:s,isGroup:!1};if(void 0!==i){let t;t=i.includes("\n")?i+"\n":"{\n"+i+"\n}";const e=Um(t,{schema:zm});if(e.shape&&(e.shape!==e.shape.toLowerCase()||e.shape.includes("_")))throw new Error(`No such shape: ${e.shape}. Shape names should be lowercase.`);e?.shape&&"kanbanItem"===e.shape&&(o.shape=e?.shape),e?.label&&(o.label=e?.label),e?.icon&&(o.icon=e?.icon.toString()),e?.assigned&&(o.assigned=e?.assigned.toString()),e?.ticket&&(o.ticket=e?.ticket.toString()),e?.priority&&(o.priority=e?.priority)}const l=rSt(t);l?o.parentId=l.id||"kbn"+tSt++:JCt.push(o),QCt.push(o)}),"addNode"),oSt={DEFAULT:0,NO_BORDER:0,ROUNDED_RECT:1,RECT:2,CIRCLE:3,CLOUD:4,BANG:5,HEXAGON:6},lSt=s(((t,e)=>{switch(m.debug("In get type",t,e),t){case"[":return oSt.RECT;case"(":return")"===e?oSt.ROUNDED_RECT:oSt.CLOUD;case"((":return oSt.CIRCLE;case")":return oSt.CLOUD;case"))":return oSt.BANG;case"{{":return oSt.HEXAGON;default:return oSt.DEFAULT}}),"getType"),cSt=s(((t,e)=>{eSt[t]=e}),"setElementForId"),hSt=s((t=>{if(!t)return;const e=Hn(),n=QCt[QCt.length-1];t.icon&&(n.icon=an(t.icon,e)),t.class&&(n.cssClasses=an(t.class,e))}),"decorateNode"),uSt=s((t=>{switch(t){case oSt.DEFAULT:return"no-border";case oSt.RECT:return"rect";case oSt.ROUNDED_RECT:return"rounded-rect";case oSt.CIRCLE:return"circle";case oSt.CLOUD:return"cloud";case oSt.BANG:return"bang";case oSt.HEXAGON:return"hexgon";default:return"no-border"}}),"type2Str"),dSt=s((()=>m),"getLogger"),pSt=s((t=>eSt[t]),"getElementById"),gSt={clear:nSt,addNode:sSt,getSections:iSt,getData:aSt,nodeType:oSt,getType:lSt,setElementForId:cSt,decorateNode:hSt,type2Str:uSt,getLogger:dSt,getElementById:pSt},fSt=s((async(t,e,n,r)=>{m.debug("Rendering kanban diagram\n"+t);const i=r.db.getData(),a=Hn();a.htmlLabels=!1;const s=zp(e),o=s.append("g");o.attr("class","sections");const l=s.append("g");l.attr("class","items");const c=i.nodes.filter((t=>t.isGroup));let h=0;const u=[];let d=25;for(const t of c){const e=a?.kanban?.sectionWidth||200;h+=1,t.x=e*h+10*(h-1)/2,t.width=e,t.y=0,t.height=3*e,t.rx=5,t.ry=5,t.cssClasses=t.cssClasses+" section-"+h;const n=await CE(o,t);d=Math.max(d,n?.labelBBox?.height),u.push(n)}let p=0;for(const t of c){const e=u[p];p+=1;const n=a?.kanban?.sectionWidth||200,r=3*-n/2+d;let s=r;const o=i.nodes.filter((e=>e.parentId===t.id));for(const e of o){if(e.isGroup)throw new Error("Groups within groups are not allowed in Kanban diagrams");e.x=t.x,e.width=n-15;const r=(await fS(l,e,{config:a})).node().getBBox();e.y=s+r.height/2,await vS(e),s=e.y+r.height/2+5}const c=e.cluster.select("rect"),h=Math.max(s-r+30,50)+(d-25);c.attr("height",h)}An(void 0,s,a.mindmap?.padding??Ct.kanban.padding,a.mindmap?.useMaxWidth??Ct.kanban.useMaxWidth)}),"draw"),mSt={draw:fSt},ySt=s((t=>{let e="";for(let e=0;e<t.THEME_COLOR_LIMIT;e++)t["lineColor"+e]=t["lineColor"+e]||t["cScaleInv"+e],rt(t["lineColor"+e])?t["lineColor"+e]=at(t["lineColor"+e],20):t["lineColor"+e]=st(t["lineColor"+e],20);const n=s(((e,n)=>t.darkMode?st(e,n):at(e,n)),"adjuster");for(let r=0;r<t.THEME_COLOR_LIMIT;r++){const i=""+(17-3*r);e+=`\n .section-${r-1} rect, .section-${r-1} path, .section-${r-1} circle, .section-${r-1} polygon, .section-${r-1} path {\n fill: ${n(t["cScale"+r],10)};\n stroke: ${n(t["cScale"+r],10)};\n\n }\n .section-${r-1} text {\n fill: ${t["cScaleLabel"+r]};\n }\n .node-icon-${r-1} {\n font-size: 40px;\n color: ${t["cScaleLabel"+r]};\n }\n .section-edge-${r-1}{\n stroke: ${t["cScale"+r]};\n }\n .edge-depth-${r-1}{\n stroke-width: ${i};\n }\n .section-${r-1} line {\n stroke: ${t["cScaleInv"+r]} ;\n stroke-width: 3;\n }\n\n .disabled, .disabled circle, .disabled text {\n fill: lightgray;\n }\n .disabled text {\n fill: #efefef;\n }\n\n .node rect,\n .node circle,\n .node ellipse,\n .node polygon,\n .node path {\n fill: ${t.background};\n stroke: ${t.nodeBorder};\n stroke-width: 1px;\n }\n\n .kanban-ticket-link {\n fill: ${t.background};\n stroke: ${t.nodeBorder};\n text-decoration: underline;\n }\n `}return e}),"genSections"),vSt={db:gSt,renderer:mSt,parser:ZCt,styles:s((t=>`\n .edge {\n stroke-width: 3;\n }\n ${ySt(t)}\n .section-root rect, .section-root path, .section-root circle, .section-root polygon {\n fill: ${t.git0};\n }\n .section-root text {\n fill: ${t.gitBranchLabel0};\n }\n .icon-container {\n height:100%;\n display: flex;\n justify-content: center;\n align-items: center;\n }\n .edge {\n fill: none;\n }\n .cluster-label, .label {\n color: ${t.textColor};\n fill: ${t.textColor};\n }\n .kanban-label {\n dy: 1em;\n alignment-baseline: middle;\n text-anchor: middle;\n dominant-baseline: middle;\n text-align: center;\n }\n`),"getStyles")},xSt=Object.freeze({__proto__:null,diagram:vSt}),bSt=function(){var t=s((function(t,e,n,r){for(n=n||{},r=t.length;r--;n[t[r]]=e);return n}),"o"),e=[1,9],n=[1,10],r=[1,5,10,12],i={trace:s((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:s((function(t,e,n,r,i,a,s){var o=a.length-1;switch(i){case 7:const t=r.findOrCreateNode(a[o-4].trim().replaceAll('""','"')),e=r.findOrCreateNode(a[o-2].trim().replaceAll('""','"')),n=parseFloat(a[o].trim());r.addLink(t,e,n);break;case 8:case 9:case 11:this.$=a[o];break;case 10:this.$=a[o-1]}}),"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:n},{1:[2,6],7:11,10:[1,12]},t(n,[2,4],{9:13,5:[1,14]}),{12:[1,15]},t(r,[2,8]),t(r,[2,9]),{19:[1,16]},t(r,[2,11]),{1:[2,1]},{1:[2,5]},t(n,[2,2]),{6:17,8:5,15:6,16:7,17:8,18:e,20:n},{15:18,16:7,17:8,18:e,20:n},{18:[1,19]},t(n,[2,3]),{12:[1,20]},t(r,[2,10]),{15:21,16:7,17:8,18:e,20:n},t([1,5,10],[2,7])],defaultActions:{11:[2,1],12:[2,5]},parseError:s((function(t,e){if(!e.recoverable){var n=new Error(t);throw n.hash=e,n}this.trace(t)}),"parseError"),parse:s((function(t){var e=this,n=[0],r=[],i=[null],a=[],o=this.table,l="",c=0,h=0,u=2,d=1,p=a.slice.call(arguments,1),g=Object.create(this.lexer),f={yy:{}};for(var m in this.yy)Object.prototype.hasOwnProperty.call(this.yy,m)&&(f.yy[m]=this.yy[m]);g.setInput(t,f.yy),f.yy.lexer=g,f.yy.parser=this,void 0===g.yylloc&&(g.yylloc={});var y=g.yylloc;a.push(y);var v=g.options&&g.options.ranges;function x(t){n.length=n.length-2*t,i.length=i.length-t,a.length=a.length-t}function b(){var t;return"number"!=typeof(t=r.pop()||g.lex()||d)&&(t instanceof Array&&(t=(r=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof f.yy.parseError?this.parseError=f.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,s(x,"popStack"),s(b,"lex");for(var w,k,T,_,E,C,S,A,L={};;){if(k=n[n.length-1],this.defaultActions[k]?T=this.defaultActions[k]:(null==w&&(w=b()),T=o[k]&&o[k][w]),void 0===T||!T.length||!T[0]){var N="";for(E in A=[],o[k])this.terminals_[E]&&E>u&&A.push("'"+this.terminals_[E]+"'");N=g.showPosition?"Parse error on line "+(c+1)+":\n"+g.showPosition()+"\nExpecting "+A.join(", ")+", got '"+(this.terminals_[w]||w)+"'":"Parse error on line "+(c+1)+": Unexpected "+(w==d?"end of input":"'"+(this.terminals_[w]||w)+"'"),this.parseError(N,{text:g.match,token:this.terminals_[w]||w,line:g.yylineno,loc:y,expected:A})}if(T[0]instanceof Array&&T.length>1)throw new Error("Parse Error: multiple actions possible at state: "+k+", token: "+w);switch(T[0]){case 1:n.push(w),i.push(g.yytext),a.push(g.yylloc),n.push(T[1]),w=null,h=g.yyleng,l=g.yytext,c=g.yylineno,y=g.yylloc;break;case 2:if(C=this.productions_[T[1]][1],L.$=i[i.length-C],L._$={first_line:a[a.length-(C||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(C||1)].first_column,last_column:a[a.length-1].last_column},v&&(L._$.range=[a[a.length-(C||1)].range[0],a[a.length-1].range[1]]),void 0!==(_=this.performAction.apply(L,[l,h,c,f.yy,T[1],i,a].concat(p))))return _;C&&(n=n.slice(0,-1*C*2),i=i.slice(0,-1*C),a=a.slice(0,-1*C)),n.push(this.productions_[T[1]][0]),i.push(L.$),a.push(L._$),S=o[n[n.length-2]][n[n.length-1]],n.push(S);break;case 3:return!0}}return!0}),"parse")},a=function(){var t={EOF:1,parseError:s((function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)}),"parseError"),setInput:s((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:s((function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(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:s((function(t){var e=t.length,n=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 r=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 i=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===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this}),"unput"),more:s((function(){return this._more=!0,this}),"more"),reject:s((function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):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).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}),"reject"),less:s((function(t){this.unput(this.match.slice(t))}),"less"),pastInput:s((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:s((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:s((function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"}),"showPosition"),test_match:s((function(t,e){var n,r,i;if(this.options.backtrack_lexer&&(i={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&&(i.yylloc.range=this.yylloc.range.slice(0))),(r=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.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],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1}),"test_match"),next:s((function(){if(this.done)return this.EOF;var t,e,n,r;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;a<i.length;a++)if((n=this._input.match(this.rules[i[a]]))&&(!e||n[0].length>e[0].length)){if(e=n,r=a,this.options.backtrack_lexer){if(!1!==(t=this.test_match(n,i[a])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,i[r]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}),"next"),lex:s((function(){var t=this.next();return t||this.lex()}),"lex"),begin:s((function(t){this.conditionStack.push(t)}),"begin"),popState:s((function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]}),"popState"),_currentRules:s((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:s((function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"}),"topState"),pushState:s((function(t){this.begin(t)}),"pushState"),stateStackSize:s((function(){return this.conditionStack.length}),"stateStackSize"),options:{"case-insensitive":!0},performAction:s((function(t,e,n,r){switch(n){case 0:return this.pushState("csv"),4;case 1:return 10;case 2:return 5;case 3:return 12;case 4:return this.pushState("escaped_text"),18;case 5:return 20;case 6:return this.popState("escaped_text"),18;case 7:return 19}}),"anonymous"),rules:[/^(?:sankey-beta\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:[1,2,3,4,5,6,7],inclusive:!1},escaped_text:{rules:[6,7],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7],inclusive:!0}}};return t}();function o(){this.yy={}}return i.lexer=a,s(o,"Parser"),o.prototype=i,i.Parser=o,new o}();bSt.parser=bSt;var wSt=bSt,kSt=[],TSt=[],_St=new Map,ESt=s((()=>{kSt=[],TSt=[],_St=new Map,$n()}),"clear"),CSt=class{constructor(t,e,n=0){this.source=t,this.target=e,this.value=n}static{s(this,"SankeyLink")}},SSt=s(((t,e,n)=>{kSt.push(new CSt(t,e,n))}),"addLink"),ASt=class{constructor(t){this.ID=t}static{s(this,"SankeyNode")}},LSt=s((t=>{t=_n.sanitizeText(t,Hn());let e=_St.get(t);return void 0===e&&(e=new ASt(t),_St.set(t,e),TSt.push(e)),e}),"findOrCreateNode"),NSt=s((()=>TSt),"getNodes"),ISt=s((()=>kSt),"getLinks"),MSt=s((()=>({nodes:TSt.map((t=>({id:t.ID}))),links:kSt.map((t=>({source:t.source.ID,target:t.target.ID,value:t.value})))})),"getGraph"),RSt={nodesMap:_St,getConfig:s((()=>Hn().sankey),"getConfig"),getNodes:NSt,getLinks:ISt,getGraph:MSt,addLink:SSt,findOrCreateNode:LSt,getAccTitle:zn,setAccTitle:Fn,getAccDescription:Gn,setAccDescription:Un,getDiagramTitle:jn,setDiagramTitle:qn,clear:ESt};function DSt(t,e){let n;if(void 0===e)for(const e of t)null!=e&&(n<e||void 0===n&&e>=e)&&(n=e);else{let r=-1;for(let i of t)null!=(i=e(i,++r,t))&&(n<i||void 0===n&&i>=i)&&(n=i)}return n}function OSt(t,e){let n;if(void 0===e)for(const e of t)null!=e&&(n>e||void 0===n&&e>=e)&&(n=e);else{let r=-1;for(let i of t)null!=(i=e(i,++r,t))&&(n>i||void 0===n&&i>=i)&&(n=i)}return n}function PSt(t,e){let n=0;if(void 0===e)for(let e of t)(e=+e)&&(n+=e);else{let r=-1;for(let i of t)(i=+e(i,++r,t))&&(n+=i)}return n}function BSt(t){return t.target.depth}function $St(t){return t.depth}function FSt(t,e){return e-1-t.height}function zSt(t,e){return t.sourceLinks.length?t.depth:e-1}function USt(t){return t.targetLinks.length?t.depth:t.sourceLinks.length?OSt(t.sourceLinks,BSt)-1:0}function GSt(t){return function(){return t}}function qSt(t,e){return YSt(t.source,e.source)||t.index-e.index}function jSt(t,e){return YSt(t.target,e.target)||t.index-e.index}function YSt(t,e){return t.y0-e.y0}function WSt(t){return t.value}function HSt(t){return t.index}function VSt(t){return t.nodes}function XSt(t){return t.links}function KSt(t,e){const n=t.get(e);if(!n)throw new Error("missing: "+e);return n}function ZSt({nodes:t}){for(const e of t){let t=e.y0,n=t;for(const n of e.sourceLinks)n.y0=t+n.width/2,t+=n.width;for(const t of e.targetLinks)t.y1=n+t.width/2,n+=t.width}}function QSt(){let t,e,n,r=0,i=0,a=1,o=1,l=24,c=8,h=HSt,u=zSt,d=VSt,p=XSt,g=6;function f(){const t={nodes:d.apply(null,arguments),links:p.apply(null,arguments)};return m(t),y(t),v(t),x(t),k(t),ZSt(t),t}function m({nodes:t,links:e}){for(const[e,n]of t.entries())n.index=e,n.sourceLinks=[],n.targetLinks=[];const r=new Map(t.map(((e,n)=>[h(e,n,t),e])));for(const[t,n]of e.entries()){n.index=t;let{source:e,target:i}=n;"object"!=typeof e&&(e=n.source=KSt(r,e)),"object"!=typeof i&&(i=n.target=KSt(r,i)),e.sourceLinks.push(n),i.targetLinks.push(n)}if(null!=n)for(const{sourceLinks:e,targetLinks:r}of t)e.sort(n),r.sort(n)}function y({nodes:t}){for(const e of t)e.value=void 0===e.fixedValue?Math.max(PSt(e.sourceLinks,WSt),PSt(e.targetLinks,WSt)):e.fixedValue}function v({nodes:t}){const e=t.length;let n=new Set(t),r=new Set,i=0;for(;n.size;){for(const t of n){t.depth=i;for(const{target:e}of t.sourceLinks)r.add(e)}if(++i>e)throw new Error("circular link");n=r,r=new Set}}function x({nodes:t}){const e=t.length;let n=new Set(t),r=new Set,i=0;for(;n.size;){for(const t of n){t.height=i;for(const{source:e}of t.targetLinks)r.add(e)}if(++i>e)throw new Error("circular link");n=r,r=new Set}}function b({nodes:t}){const n=DSt(t,(t=>t.depth))+1,i=(a-r-l)/(n-1),s=new Array(n);for(const e of t){const t=Math.max(0,Math.min(n-1,Math.floor(u.call(null,e,n))));e.layer=t,e.x0=r+t*i,e.x1=e.x0+l,s[t]?s[t].push(e):s[t]=[e]}if(e)for(const t of s)t.sort(e);return s}function w(e){const n=OSt(e,(e=>(o-i-(e.length-1)*t)/PSt(e,WSt)));for(const r of e){let e=i;for(const i of r){i.y0=e,i.y1=e+i.value*n,e=i.y1+t;for(const t of i.sourceLinks)t.width=t.value*n}e=(o-e+t)/(r.length+1);for(let t=0;t<r.length;++t){const n=r[t];n.y0+=e*(t+1),n.y1+=e*(t+1)}L(r)}}function k(e){const n=b(e);t=Math.min(c,(o-i)/(DSt(n,(t=>t.length))-1)),w(n);for(let t=0;t<g;++t){const e=Math.pow(.99,t),r=Math.max(1-e,(t+1)/g);_(n,e,r),T(n,e,r)}}function T(t,n,r){for(let i=1,a=t.length;i<a;++i){const a=t[i];for(const t of a){let e=0,r=0;for(const{source:n,value:i}of t.targetLinks){let a=i*(t.layer-n.layer);e+=N(n,t)*a,r+=a}if(!(r>0))continue;let i=(e/r-t.y0)*n;t.y0+=i,t.y1+=i,A(t)}void 0===e&&a.sort(YSt),E(a,r)}}function _(t,n,r){for(let i=t.length-2;i>=0;--i){const a=t[i];for(const t of a){let e=0,r=0;for(const{target:n,value:i}of t.sourceLinks){let a=i*(n.layer-t.layer);e+=I(t,n)*a,r+=a}if(!(r>0))continue;let i=(e/r-t.y0)*n;t.y0+=i,t.y1+=i,A(t)}void 0===e&&a.sort(YSt),E(a,r)}}function E(e,n){const r=e.length>>1,a=e[r];S(e,a.y0-t,r-1,n),C(e,a.y1+t,r+1,n),S(e,o,e.length-1,n),C(e,i,0,n)}function C(e,n,r,i){for(;r<e.length;++r){const a=e[r],s=(n-a.y0)*i;s>1e-6&&(a.y0+=s,a.y1+=s),n=a.y1+t}}function S(e,n,r,i){for(;r>=0;--r){const a=e[r],s=(a.y1-n)*i;s>1e-6&&(a.y0-=s,a.y1-=s),n=a.y0-t}}function A({sourceLinks:t,targetLinks:e}){if(void 0===n){for(const{source:{sourceLinks:t}}of e)t.sort(jSt);for(const{target:{targetLinks:e}}of t)e.sort(qSt)}}function L(t){if(void 0===n)for(const{sourceLinks:e,targetLinks:n}of t)e.sort(jSt),n.sort(qSt)}function N(e,n){let r=e.y0-(e.sourceLinks.length-1)*t/2;for(const{target:i,width:a}of e.sourceLinks){if(i===n)break;r+=a+t}for(const{source:t,width:i}of n.targetLinks){if(t===e)break;r-=i}return r}function I(e,n){let r=n.y0-(n.targetLinks.length-1)*t/2;for(const{source:i,width:a}of n.targetLinks){if(i===e)break;r+=a+t}for(const{target:t,width:i}of e.sourceLinks){if(t===n)break;r-=i}return r}return s(f,"sankey"),f.update=function(t){return ZSt(t),t},f.nodeId=function(t){return arguments.length?(h="function"==typeof t?t:GSt(t),f):h},f.nodeAlign=function(t){return arguments.length?(u="function"==typeof t?t:GSt(t),f):u},f.nodeSort=function(t){return arguments.length?(e=t,f):e},f.nodeWidth=function(t){return arguments.length?(l=+t,f):l},f.nodePadding=function(e){return arguments.length?(c=t=+e,f):c},f.nodes=function(t){return arguments.length?(d="function"==typeof t?t:GSt(t),f):d},f.links=function(t){return arguments.length?(p="function"==typeof t?t:GSt(t),f):p},f.linkSort=function(t){return arguments.length?(n=t,f):n},f.size=function(t){return arguments.length?(r=i=0,a=+t[0],o=+t[1],f):[a-r,o-i]},f.extent=function(t){return arguments.length?(r=+t[0][0],a=+t[1][0],i=+t[0][1],o=+t[1][1],f):[[r,i],[a,o]]},f.iterations=function(t){return arguments.length?(g=+t,f):g},s(m,"computeNodeLinks"),s(y,"computeNodeValues"),s(v,"computeNodeDepths"),s(x,"computeNodeHeights"),s(b,"computeNodeLayers"),s(w,"initializeNodeBreadths"),s(k,"computeNodeBreadths"),s(T,"relaxLeftToRight"),s(_,"relaxRightToLeft"),s(E,"resolveCollisions"),s(C,"resolveCollisionsTopToBottom"),s(S,"resolveCollisionsBottomToTop"),s(A,"reorderNodeLinks"),s(L,"reorderLinks"),s(N,"targetTop"),s(I,"sourceTop"),f}s(DSt,"max"),s(OSt,"min"),s(PSt,"sum"),s(BSt,"targetDepth"),s($St,"left"),s(FSt,"right"),s(zSt,"justify"),s(USt,"center"),s(GSt,"constant"),s(qSt,"ascendingSourceBreadth"),s(jSt,"ascendingTargetBreadth"),s(YSt,"ascendingBreadth"),s(WSt,"value"),s(HSt,"defaultId"),s(VSt,"defaultNodes"),s(XSt,"defaultLinks"),s(KSt,"find"),s(ZSt,"computeLinkBreadths"),s(QSt,"Sankey");var JSt=Math.PI,tAt=2*JSt,eAt=tAt-1e-6;function nAt(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function rAt(){return new nAt}s(nAt,"Path"),s(rAt,"path"),nAt.prototype=rAt.prototype={constructor:nAt,moveTo:s((function(t,e){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)}),"moveTo"),closePath:s((function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")}),"closePath"),lineTo:s((function(t,e){this._+="L"+(this._x1=+t)+","+(this._y1=+e)}),"lineTo"),quadraticCurveTo:s((function(t,e,n,r){this._+="Q"+ +t+","+ +e+","+(this._x1=+n)+","+(this._y1=+r)}),"quadraticCurveTo"),bezierCurveTo:s((function(t,e,n,r,i,a){this._+="C"+ +t+","+ +e+","+ +n+","+ +r+","+(this._x1=+i)+","+(this._y1=+a)}),"bezierCurveTo"),arcTo:s((function(t,e,n,r,i){t=+t,e=+e,n=+n,r=+r,i=+i;var a=this._x1,s=this._y1,o=n-t,l=r-e,c=a-t,h=s-e,u=c*c+h*h;if(i<0)throw new Error("negative radius: "+i);if(null===this._x1)this._+="M"+(this._x1=t)+","+(this._y1=e);else if(u>1e-6)if(Math.abs(h*o-l*c)>1e-6&&i){var d=n-a,p=r-s,g=o*o+l*l,f=d*d+p*p,m=Math.sqrt(g),y=Math.sqrt(u),v=i*Math.tan((JSt-Math.acos((g+u-f)/(2*m*y)))/2),x=v/y,b=v/m;Math.abs(x-1)>1e-6&&(this._+="L"+(t+x*c)+","+(e+x*h)),this._+="A"+i+","+i+",0,0,"+ +(h*d>c*p)+","+(this._x1=t+b*o)+","+(this._y1=e+b*l)}else this._+="L"+(this._x1=t)+","+(this._y1=e);else;}),"arcTo"),arc:s((function(t,e,n,r,i,a){t=+t,e=+e,a=!!a;var s=(n=+n)*Math.cos(r),o=n*Math.sin(r),l=t+s,c=e+o,h=1^a,u=a?r-i:i-r;if(n<0)throw new Error("negative radius: "+n);null===this._x1?this._+="M"+l+","+c:(Math.abs(this._x1-l)>1e-6||Math.abs(this._y1-c)>1e-6)&&(this._+="L"+l+","+c),n&&(u<0&&(u=u%tAt+tAt),u>eAt?this._+="A"+n+","+n+",0,1,"+h+","+(t-s)+","+(e-o)+"A"+n+","+n+",0,1,"+h+","+(this._x1=l)+","+(this._y1=c):u>1e-6&&(this._+="A"+n+","+n+",0,"+ +(u>=JSt)+","+h+","+(this._x1=t+n*Math.cos(i))+","+(this._y1=e+n*Math.sin(i))))}),"arc"),rect:s((function(t,e,n,r){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)+"h"+ +n+"v"+ +r+"h"+-n+"Z"}),"rect"),toString:s((function(){return this._}),"toString")};var iAt=rAt;function aAt(t){return s((function(){return t}),"constant")}function sAt(t){return t[0]}function oAt(t){return t[1]}s(aAt,"default"),s(sAt,"x"),s(oAt,"y");var lAt=Array.prototype.slice;function cAt(t){return t.source}function hAt(t){return t.target}function uAt(t){var e=cAt,n=hAt,r=sAt,i=oAt,a=null;function o(){var s,o=lAt.call(arguments),l=e.apply(this,o),c=n.apply(this,o);if(a||(a=s=iAt()),t(a,+r.apply(this,(o[0]=l,o)),+i.apply(this,o),+r.apply(this,(o[0]=c,o)),+i.apply(this,o)),s)return a=null,s+""||null}return s(o,"link"),o.source=function(t){return arguments.length?(e=t,o):e},o.target=function(t){return arguments.length?(n=t,o):n},o.x=function(t){return arguments.length?(r="function"==typeof t?t:aAt(+t),o):r},o.y=function(t){return arguments.length?(i="function"==typeof t?t:aAt(+t),o):i},o.context=function(t){return arguments.length?(a=null==t?null:t,o):a},o}function dAt(t,e,n,r,i){t.moveTo(e,n),t.bezierCurveTo(e=(e+r)/2,n,e,i,r,i)}function pAt(){return uAt(dAt)}function gAt(t){return[t.source.x1,t.y0]}function fAt(t){return[t.target.x0,t.y1]}function mAt(){return pAt().source(gAt).target(fAt)}s(cAt,"linkSource"),s(hAt,"linkTarget"),s(uAt,"link"),s(dAt,"curveHorizontal"),s(pAt,"linkHorizontal"),s(gAt,"horizontalSource"),s(fAt,"horizontalTarget"),s(mAt,"default");var yAt=class t{static{s(this,"Uid")}static{this.count=0}static next(e){return new t(e+ ++t.count)}constructor(t){this.id=t,this.href=`#${t}`}toString(){return"url("+this.href+")"}},vAt={left:$St,right:FSt,center:USt,justify:zSt},xAt=s((function(t,e,n,r){const{securityLevel:i,sankey:a}=Hn(),o=Xn.sankey;let l;"sandbox"===i&&(l=Oa("#i"+e));const c=Oa("sandbox"===i?l.nodes()[0].contentDocument.body:"body"),h="sandbox"===i?c.select(`[id="${e}"]`):Oa(`[id="${e}"]`),u=a?.width??o.width,d=a?.height??o.width,p=a?.useMaxWidth??o.useMaxWidth,g=a?.nodeAlignment??o.nodeAlignment,f=a?.prefix??o.prefix,m=a?.suffix??o.suffix,y=a?.showValues??o.showValues,v=r.db.getGraph(),x=vAt[g],b=QSt().nodeId((t=>t.id)).nodeWidth(10).nodePadding(10+(y?15:0)).nodeAlign(x).extent([[0,0],[u,d]]);b(v);const w=yo(gh);h.append("g").attr("class","nodes").selectAll(".node").data(v.nodes).join("g").attr("class","node").attr("id",(t=>(t.uid=yAt.next("node-")).id)).attr("transform",(function(t){return"translate("+t.x0+","+t.y0+")"})).attr("x",(t=>t.x0)).attr("y",(t=>t.y0)).append("rect").attr("height",(t=>t.y1-t.y0)).attr("width",(t=>t.x1-t.x0)).attr("fill",(t=>w(t.id)));const k=s((({id:t,value:e})=>y?`${t}\n${f}${Math.round(100*e)/100}${m}`:t),"getText");h.append("g").attr("class","node-labels").attr("font-family","sans-serif").attr("font-size",14).selectAll("text").data(v.nodes).join("text").attr("x",(t=>t.x0<u/2?t.x1+6:t.x0-6)).attr("y",(t=>(t.y1+t.y0)/2)).attr("dy",(y?"0":"0.35")+"em").attr("text-anchor",(t=>t.x0<u/2?"start":"end")).text(k);const T=h.append("g").attr("class","links").attr("fill","none").attr("stroke-opacity",.5).selectAll(".link").data(v.links).join("g").attr("class","link").style("mix-blend-mode","multiply"),_=a?.linkColor??"gradient";if("gradient"===_){const t=T.append("linearGradient").attr("id",(t=>(t.uid=yAt.next("linearGradient-")).id)).attr("gradientUnits","userSpaceOnUse").attr("x1",(t=>t.source.x1)).attr("x2",(t=>t.target.x0));t.append("stop").attr("offset","0%").attr("stop-color",(t=>w(t.source.id))),t.append("stop").attr("offset","100%").attr("stop-color",(t=>w(t.target.id)))}let E;switch(_){case"gradient":E=s((t=>t.uid),"coloring");break;case"source":E=s((t=>w(t.source.id)),"coloring");break;case"target":E=s((t=>w(t.target.id)),"coloring");break;default:E=_}T.append("path").attr("d",mAt()).attr("stroke",E).attr("stroke-width",(t=>Math.max(1,t.width))),An(void 0,h,0,p)}),"draw"),bAt={draw:xAt},wAt=s((t=>t.replaceAll(/^[^\S\n\r]+|[^\S\n\r]+$/g,"").replaceAll(/([\n\r])+/g,"\n").trim()),"prepareTextForParsing"),kAt=wSt.parse.bind(wSt);wSt.parse=t=>kAt(wAt(t));var TAt={parser:wSt,db:RSt,renderer:bAt},_At=Object.freeze({__proto__:null,diagram:TAt}),EAt={packet:[]},CAt=structuredClone(EAt),SAt=Ct.packet,AAt=s((()=>{const t=mk({...SAt,...Ft().packet});return t.showBits&&(t.paddingY+=10),t}),"getConfig"),LAt=s((()=>CAt.packet),"getPacket"),NAt={pushWord:s((t=>{t.length>0&&CAt.packet.push(t)}),"pushWord"),getPacket:LAt,getConfig:AAt,clear:s((()=>{$n(),CAt=structuredClone(EAt)}),"clear"),setAccTitle:Fn,getAccTitle:zn,setDiagramTitle:qn,getDiagramTitle:jn,getAccDescription:Gn,setAccDescription:Un},IAt=s((t=>{jX(t,NAt);let e=-1,n=[],r=1;const{bitsPerRow:i}=NAt.getConfig();for(let{start:a,end:s,label:o}of t.blocks){if(s&&s<a)throw new Error(`Packet block ${a} - ${s} is invalid. End must be greater than start.`);if(a!==e+1)throw new Error(`Packet block ${a} - ${s??a} is not contiguous. It should start from ${e+1}.`);for(e=s??a,m.debug(`Packet block ${a} - ${e} with label ${o}`);n.length<=i+1&&NAt.getPacket().length<1e4;){const[t,e]=MAt({start:a,end:s,label:o},r,i);if(n.push(t),t.end+1===r*i&&(NAt.pushWord(n),n=[],r++),!e)break;({start:a,end:s,label:o}=e)}}NAt.pushWord(n)}),"populate"),MAt=s(((t,e,n)=>{if(void 0===t.end&&(t.end=t.start),t.start>t.end)throw new Error(`Block start ${t.start} is greater than block end ${t.end}.`);return t.end+1<=e*n?[t,void 0]:[{start:t.start,end:e*n-1,label:t.label},{start:e*n,end:t.end,label:t.label}]}),"getNextFittingBlock"),RAt={parse:s((async t=>{const e=await Att("packet",t);m.debug(e),IAt(e)}),"parse")},DAt=s(((t,e,n,r)=>{const i=r.db,a=i.getConfig(),{rowHeight:s,paddingY:o,bitWidth:l,bitsPerRow:c}=a,h=i.getPacket(),u=i.getDiagramTitle(),d=s+o,p=d*(h.length+1)-(u?0:s),g=l*c+2,f=zp(e);f.attr("viewbox",`0 0 ${g} ${p}`),Sn(f,p,g,a.useMaxWidth);for(const[t,e]of h.entries())OAt(f,e,t,a);f.append("text").text(u).attr("x",g/2).attr("y",p-d/2).attr("dominant-baseline","middle").attr("text-anchor","middle").attr("class","packetTitle")}),"draw"),OAt=s(((t,e,n,{rowHeight:r,paddingX:i,paddingY:a,bitWidth:s,bitsPerRow:o,showBits:l})=>{const c=t.append("g"),h=n*(r+a)+a;for(const t of e){const e=t.start%o*s+1,n=(t.end-t.start+1)*s-i;if(c.append("rect").attr("x",e).attr("y",h).attr("width",n).attr("height",r).attr("class","packetBlock"),c.append("text").attr("x",e+n/2).attr("y",h+r/2).attr("class","packetLabel").attr("dominant-baseline","middle").attr("text-anchor","middle").text(t.label),!l)continue;const a=t.end===t.start,u=h-2;c.append("text").attr("x",e+(a?n/2:0)).attr("y",u).attr("class","packetByte start").attr("dominant-baseline","auto").attr("text-anchor",a?"middle":"start").text(t.start),a||c.append("text").attr("x",e+n).attr("y",u).attr("class","packetByte end").attr("dominant-baseline","auto").attr("text-anchor","end").text(t.end)}}),"drawWord"),PAt={draw:DAt},BAt={byteFontSize:"10px",startByteColor:"black",endByteColor:"black",labelColor:"black",labelFontSize:"12px",titleColor:"black",titleFontSize:"14px",blockStrokeColor:"black",blockStrokeWidth:"1",blockFillColor:"#efefef"},$At=s((({packet:t}={})=>{const e=mk(BAt,t);return`\n\t.packetByte {\n\t\tfont-size: ${e.byteFontSize};\n\t}\n\t.packetByte.start {\n\t\tfill: ${e.startByteColor};\n\t}\n\t.packetByte.end {\n\t\tfill: ${e.endByteColor};\n\t}\n\t.packetLabel {\n\t\tfill: ${e.labelColor};\n\t\tfont-size: ${e.labelFontSize};\n\t}\n\t.packetTitle {\n\t\tfill: ${e.titleColor};\n\t\tfont-size: ${e.titleFontSize};\n\t}\n\t.packetBlock {\n\t\tstroke: ${e.blockStrokeColor};\n\t\tstroke-width: ${e.blockStrokeWidth};\n\t\tfill: ${e.blockFillColor};\n\t}\n\t`}),"styles"),FAt={parser:RAt,db:NAt,renderer:PAt,styles:$At},zAt=Object.freeze({__proto__:null,diagram:FAt}),UAt=function(){var t=s((function(t,e,n,r){for(n=n||{},r=t.length;r--;n[t[r]]=e);return n}),"o"),e=[1,7],n=[1,13],r=[1,14],i=[1,15],a=[1,19],o=[1,16],l=[1,17],c=[1,18],h=[8,30],u=[8,21,28,29,30,31,32,40,44,47],d=[1,23],p=[1,24],g=[8,15,16,21,28,29,30,31,32,40,44,47],f=[8,15,16,21,27,28,29,30,31,32,40,44,47],m=[1,49],y={trace:s((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,block:31,NODE_ID:32,nodeShapeNLabel:33,dirList: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:49,$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:"block",32:"NODE_ID",35:"DIR",36:"NODE_DSTART",37:"NODE_DEND",38:"BLOCK_ARROW_START",39:"BLOCK_ARROW_END",40:"classDef",41:"CLASSDEF_ID",42:"CLASSDEF_STYLEOPTS",43:"DEFAULT",44:"class",45:"CLASSENTITY_IDS",46:"STYLECLASS",47:"style",48:"STYLE_ENTITY_IDS",49:"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],[34,1],[34,2],[33,3],[33,4],[23,3],[23,3],[24,3],[25,3]],performAction:s((function(t,e,n,r,i,a,s){var o=a.length-1;switch(i){case 4:r.getLogger().debug("Rule: separator (NL) ");break;case 5:r.getLogger().debug("Rule: separator (Space) ");break;case 6:r.getLogger().debug("Rule: separator (EOF) ");break;case 7:r.getLogger().debug("Rule: hierarchy: ",a[o-1]),r.setHierarchy(a[o-1]);break;case 8:r.getLogger().debug("Stop NL ");break;case 9:r.getLogger().debug("Stop EOF ");break;case 10:r.getLogger().debug("Stop NL2 ");break;case 11:r.getLogger().debug("Stop EOF2 ");break;case 12:r.getLogger().debug("Rule: statement: ",a[o]),"number"==typeof a[o].length?this.$=a[o]:this.$=[a[o]];break;case 13:r.getLogger().debug("Rule: statement #2: ",a[o-1]),this.$=[a[o-1]].concat(a[o]);break;case 14:r.getLogger().debug("Rule: link: ",a[o],t),this.$={edgeTypeStr:a[o],label:""};break;case 15:r.getLogger().debug("Rule: LABEL link: ",a[o-3],a[o-1],a[o]),this.$={edgeTypeStr:a[o],label:a[o-1]};break;case 18:const e=parseInt(a[o]),n=r.generateId();this.$={id:n,type:"space",label:"",width:e,children:[]};break;case 23:r.getLogger().debug("Rule: (nodeStatement link node) ",a[o-2],a[o-1],a[o]," typestr: ",a[o-1].edgeTypeStr);const i=r.edgeStrToEdgeData(a[o-1].edgeTypeStr);this.$=[{id:a[o-2].id,label:a[o-2].label,type:a[o-2].type,directions:a[o-2].directions},{id:a[o-2].id+"-"+a[o].id,start:a[o-2].id,end:a[o].id,label:a[o-1].label,type:"edge",directions:a[o].directions,arrowTypeEnd:i,arrowTypeStart:"arrow_open"},{id:a[o].id,label:a[o].label,type:r.typeStr2Type(a[o].typeStr),directions:a[o].directions}];break;case 24:r.getLogger().debug("Rule: nodeStatement (abc88 node size) ",a[o-1],a[o]),this.$={id:a[o-1].id,label:a[o-1].label,type:r.typeStr2Type(a[o-1].typeStr),directions:a[o-1].directions,widthInColumns:parseInt(a[o],10)};break;case 25:r.getLogger().debug("Rule: nodeStatement (node) ",a[o]),this.$={id:a[o].id,label:a[o].label,type:r.typeStr2Type(a[o].typeStr),directions:a[o].directions,widthInColumns:1};break;case 26:r.getLogger().debug("APA123",this?this:"na"),r.getLogger().debug("COLUMNS: ",a[o]),this.$={type:"column-setting",columns:"auto"===a[o]?-1:parseInt(a[o])};break;case 27:r.getLogger().debug("Rule: id-block statement : ",a[o-2],a[o-1]),r.generateId(),this.$={...a[o-2],type:"composite",children:a[o-1]};break;case 28:r.getLogger().debug("Rule: blockStatement : ",a[o-2],a[o-1],a[o]);const s=r.generateId();this.$={id:s,type:"composite",label:"",children:a[o-1]};break;case 29:r.getLogger().debug("Rule: node (NODE_ID separator): ",a[o]),this.$={id:a[o]};break;case 30:r.getLogger().debug("Rule: node (NODE_ID nodeShapeNLabel separator): ",a[o-1],a[o]),this.$={id:a[o-1],label:a[o].label,typeStr:a[o].typeStr,directions:a[o].directions};break;case 31:r.getLogger().debug("Rule: dirList: ",a[o]),this.$=[a[o]];break;case 32:r.getLogger().debug("Rule: dirList: ",a[o-1],a[o]),this.$=[a[o-1]].concat(a[o]);break;case 33:r.getLogger().debug("Rule: nodeShapeNLabel: ",a[o-2],a[o-1],a[o]),this.$={typeStr:a[o-2]+a[o],label:a[o-1]};break;case 34:r.getLogger().debug("Rule: BLOCK_ARROW nodeShapeNLabel: ",a[o-3],a[o-2]," #3:",a[o-1],a[o]),this.$={typeStr:a[o-3]+a[o],label:a[o-2],directions:a[o-1]};break;case 35:case 36:this.$={type:"classDef",id:a[o-1].trim(),css:a[o].trim()};break;case 37:this.$={type:"applyClass",id:a[o-1].trim(),styleClass:a[o].trim()};break;case 38:this.$={type:"applyStyles",id:a[o-1].trim(),stylesStr:a[o].trim()}}}),"anonymous"),table:[{9:1,10:[1,2]},{1:[3]},{11:3,13:4,19:5,20:6,21:e,22:8,23:9,24:10,25:11,26:12,28:n,29:r,31:i,32:a,40:o,44:l,47:c},{8:[1,20]},t(h,[2,12],{13:4,19:5,20:6,22:8,23:9,24:10,25:11,26:12,11:21,21:e,28:n,29:r,31:i,32:a,40:o,44:l,47:c}),t(u,[2,16],{14:22,15:d,16:p}),t(u,[2,17]),t(u,[2,18]),t(u,[2,19]),t(u,[2,20]),t(u,[2,21]),t(u,[2,22]),t(g,[2,25],{27:[1,25]}),t(u,[2,26]),{19:26,26:12,32:a},{11:27,13:4,19:5,20:6,21:e,22:8,23:9,24:10,25:11,26:12,28:n,29:r,31:i,32:a,40:o,44:l,47:c},{41:[1,28],43:[1,29]},{45:[1,30]},{48:[1,31]},t(f,[2,29],{33:32,36:[1,33],38:[1,34]}),{1:[2,7]},t(h,[2,13]),{26:35,32:a},{32:[2,14]},{17:[1,36]},t(g,[2,24]),{11:37,13:4,14:22,15:d,16:p,19:5,20:6,21:e,22:8,23:9,24:10,25:11,26:12,28:n,29:r,31:i,32:a,40:o,44:l,47:c},{30:[1,38]},{42:[1,39]},{42:[1,40]},{46:[1,41]},{49:[1,42]},t(f,[2,30]),{18:[1,43]},{18:[1,44]},t(g,[2,23]),{18:[1,45]},{30:[1,46]},t(u,[2,28]),t(u,[2,35]),t(u,[2,36]),t(u,[2,37]),t(u,[2,38]),{37:[1,47]},{34:48,35:m},{15:[1,50]},t(u,[2,27]),t(f,[2,33]),{39:[1,51]},{34:52,35:m,39:[2,31]},{32:[2,15]},t(f,[2,34]),{39:[2,32]}],defaultActions:{20:[2,7],23:[2,14],50:[2,15],52:[2,32]},parseError:s((function(t,e){if(!e.recoverable){var n=new Error(t);throw n.hash=e,n}this.trace(t)}),"parseError"),parse:s((function(t){var e=this,n=[0],r=[],i=[null],a=[],o=this.table,l="",c=0,h=0,u=2,d=1,p=a.slice.call(arguments,1),g=Object.create(this.lexer),f={yy:{}};for(var m in this.yy)Object.prototype.hasOwnProperty.call(this.yy,m)&&(f.yy[m]=this.yy[m]);g.setInput(t,f.yy),f.yy.lexer=g,f.yy.parser=this,void 0===g.yylloc&&(g.yylloc={});var y=g.yylloc;a.push(y);var v=g.options&&g.options.ranges;function x(t){n.length=n.length-2*t,i.length=i.length-t,a.length=a.length-t}function b(){var t;return"number"!=typeof(t=r.pop()||g.lex()||d)&&(t instanceof Array&&(t=(r=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof f.yy.parseError?this.parseError=f.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,s(x,"popStack"),s(b,"lex");for(var w,k,T,_,E,C,S,A,L={};;){if(k=n[n.length-1],this.defaultActions[k]?T=this.defaultActions[k]:(null==w&&(w=b()),T=o[k]&&o[k][w]),void 0===T||!T.length||!T[0]){var N="";for(E in A=[],o[k])this.terminals_[E]&&E>u&&A.push("'"+this.terminals_[E]+"'");N=g.showPosition?"Parse error on line "+(c+1)+":\n"+g.showPosition()+"\nExpecting "+A.join(", ")+", got '"+(this.terminals_[w]||w)+"'":"Parse error on line "+(c+1)+": Unexpected "+(w==d?"end of input":"'"+(this.terminals_[w]||w)+"'"),this.parseError(N,{text:g.match,token:this.terminals_[w]||w,line:g.yylineno,loc:y,expected:A})}if(T[0]instanceof Array&&T.length>1)throw new Error("Parse Error: multiple actions possible at state: "+k+", token: "+w);switch(T[0]){case 1:n.push(w),i.push(g.yytext),a.push(g.yylloc),n.push(T[1]),w=null,h=g.yyleng,l=g.yytext,c=g.yylineno,y=g.yylloc;break;case 2:if(C=this.productions_[T[1]][1],L.$=i[i.length-C],L._$={first_line:a[a.length-(C||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(C||1)].first_column,last_column:a[a.length-1].last_column},v&&(L._$.range=[a[a.length-(C||1)].range[0],a[a.length-1].range[1]]),void 0!==(_=this.performAction.apply(L,[l,h,c,f.yy,T[1],i,a].concat(p))))return _;C&&(n=n.slice(0,-1*C*2),i=i.slice(0,-1*C),a=a.slice(0,-1*C)),n.push(this.productions_[T[1]][0]),i.push(L.$),a.push(L._$),S=o[n[n.length-2]][n[n.length-1]],n.push(S);break;case 3:return!0}}return!0}),"parse")},v=function(){var t={EOF:1,parseError:s((function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)}),"parseError"),setInput:s((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:s((function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(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:s((function(t){var e=t.length,n=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 r=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 i=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===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this}),"unput"),more:s((function(){return this._more=!0,this}),"more"),reject:s((function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):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).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}),"reject"),less:s((function(t){this.unput(this.match.slice(t))}),"less"),pastInput:s((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:s((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:s((function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"}),"showPosition"),test_match:s((function(t,e){var n,r,i;if(this.options.backtrack_lexer&&(i={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&&(i.yylloc.range=this.yylloc.range.slice(0))),(r=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.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],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1}),"test_match"),next:s((function(){if(this.done)return this.EOF;var t,e,n,r;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;a<i.length;a++)if((n=this._input.match(this.rules[i[a]]))&&(!e||n[0].length>e[0].length)){if(e=n,r=a,this.options.backtrack_lexer){if(!1!==(t=this.test_match(n,i[a])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,i[r]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}),"next"),lex:s((function(){var t=this.next();return t||this.lex()}),"lex"),begin:s((function(t){this.conditionStack.push(t)}),"begin"),popState:s((function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]}),"popState"),_currentRules:s((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:s((function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"}),"topState"),pushState:s((function(t){this.begin(t)}),"pushState"),stateStackSize:s((function(){return this.conditionStack.length}),"stateStackSize"),options:{},performAction:s((function(t,e,n,r){switch(n){case 0:return 10;case 1:return t.getLogger().debug("Found space-block"),31;case 2:return t.getLogger().debug("Found nl-block"),31;case 3:return t.getLogger().debug("Found space-block"),29;case 4:t.getLogger().debug(".",e.yytext);break;case 5:t.getLogger().debug("_",e.yytext);break;case 6:return 5;case 7:return e.yytext=-1,28;case 8:return e.yytext=e.yytext.replace(/columns\s+/,""),t.getLogger().debug("COLUMNS (LEX)",e.yytext),28;case 9:case 77:case 78:case 100:this.pushState("md_string");break;case 10:return"MD_STR";case 11:case 35:case 80:this.popState();break;case 12:this.pushState("string");break;case 13:t.getLogger().debug("LEX: POPPING STR:",e.yytext),this.popState();break;case 14:return t.getLogger().debug("LEX: STR end:",e.yytext),"STR";case 15:return e.yytext=e.yytext.replace(/space\:/,""),t.getLogger().debug("SPACE NUM (LEX)",e.yytext),21;case 16:return e.yytext="1",t.getLogger().debug("COLUMNS (LEX)",e.yytext),21;case 17:return 43;case 18:return"LINKSTYLE";case 19:return"INTERPOLATE";case 20:return this.pushState("CLASSDEF"),40;case 21:return this.popState(),this.pushState("CLASSDEFID"),"DEFAULT_CLASSDEF_ID";case 22:return this.popState(),this.pushState("CLASSDEFID"),41;case 23:return this.popState(),42;case 24:return this.pushState("CLASS"),44;case 25:return this.popState(),this.pushState("CLASS_STYLE"),45;case 26:return this.popState(),46;case 27:return this.pushState("STYLE_STMNT"),47;case 28:return this.popState(),this.pushState("STYLE_DEFINITION"),48;case 29:return this.popState(),49;case 30:return this.pushState("acc_title"),"acc_title";case 31:return this.popState(),"acc_title_value";case 32:return this.pushState("acc_descr"),"acc_descr";case 33:return this.popState(),"acc_descr_value";case 34:this.pushState("acc_descr_multiline");break;case 36:return"acc_descr_multiline_value";case 37:return 30;case 38:case 39:case 41:case 42:case 45:return this.popState(),t.getLogger().debug("Lex: (("),"NODE_DEND";case 40:return this.popState(),t.getLogger().debug("Lex: ))"),"NODE_DEND";case 43:return this.popState(),t.getLogger().debug("Lex: (-"),"NODE_DEND";case 44:return this.popState(),t.getLogger().debug("Lex: -)"),"NODE_DEND";case 46:return this.popState(),t.getLogger().debug("Lex: ]]"),"NODE_DEND";case 47:return this.popState(),t.getLogger().debug("Lex: ("),"NODE_DEND";case 48:return this.popState(),t.getLogger().debug("Lex: ])"),"NODE_DEND";case 49:case 50:return this.popState(),t.getLogger().debug("Lex: /]"),"NODE_DEND";case 51:return this.popState(),t.getLogger().debug("Lex: )]"),"NODE_DEND";case 52:return this.popState(),t.getLogger().debug("Lex: )"),"NODE_DEND";case 53:return this.popState(),t.getLogger().debug("Lex: ]>"),"NODE_DEND";case 54:return this.popState(),t.getLogger().debug("Lex: ]"),"NODE_DEND";case 55:return t.getLogger().debug("Lexa: -)"),this.pushState("NODE"),36;case 56:return t.getLogger().debug("Lexa: (-"),this.pushState("NODE"),36;case 57:return t.getLogger().debug("Lexa: ))"),this.pushState("NODE"),36;case 58:case 60:case 61:case 62:case 65:return t.getLogger().debug("Lexa: )"),this.pushState("NODE"),36;case 59:return t.getLogger().debug("Lex: ((("),this.pushState("NODE"),36;case 63:return t.getLogger().debug("Lexc: >"),this.pushState("NODE"),36;case 64:return t.getLogger().debug("Lexa: (["),this.pushState("NODE"),36;case 66:case 67:case 68:case 69:case 70:case 71:case 72:return this.pushState("NODE"),36;case 73:return t.getLogger().debug("Lexa: ["),this.pushState("NODE"),36;case 74:return this.pushState("BLOCK_ARROW"),t.getLogger().debug("LEX ARR START"),38;case 75:return t.getLogger().debug("Lex: NODE_ID",e.yytext),32;case 76:return t.getLogger().debug("Lex: EOF",e.yytext),8;case 79:return"NODE_DESCR";case 81:t.getLogger().debug("Lex: Starting string"),this.pushState("string");break;case 82:t.getLogger().debug("LEX ARR: Starting string"),this.pushState("string");break;case 83:return t.getLogger().debug("LEX: NODE_DESCR:",e.yytext),"NODE_DESCR";case 84:t.getLogger().debug("LEX POPPING"),this.popState();break;case 85:t.getLogger().debug("Lex: =>BAE"),this.pushState("ARROW_DIR");break;case 86:return e.yytext=e.yytext.replace(/^,\s*/,""),t.getLogger().debug("Lex (right): dir:",e.yytext),"DIR";case 87:return e.yytext=e.yytext.replace(/^,\s*/,""),t.getLogger().debug("Lex (left):",e.yytext),"DIR";case 88:return e.yytext=e.yytext.replace(/^,\s*/,""),t.getLogger().debug("Lex (x):",e.yytext),"DIR";case 89:return e.yytext=e.yytext.replace(/^,\s*/,""),t.getLogger().debug("Lex (y):",e.yytext),"DIR";case 90:return e.yytext=e.yytext.replace(/^,\s*/,""),t.getLogger().debug("Lex (up):",e.yytext),"DIR";case 91:return e.yytext=e.yytext.replace(/^,\s*/,""),t.getLogger().debug("Lex (down):",e.yytext),"DIR";case 92:return e.yytext="]>",t.getLogger().debug("Lex (ARROW_DIR end):",e.yytext),this.popState(),this.popState(),"BLOCK_ARROW_END";case 93:return t.getLogger().debug("Lex: LINK","#"+e.yytext+"#"),15;case 94:case 95:case 96:return t.getLogger().debug("Lex: LINK",e.yytext),15;case 97:case 98:case 99:return t.getLogger().debug("Lex: START_LINK",e.yytext),this.pushState("LLABEL"),16;case 101:return t.getLogger().debug("Lex: Starting string"),this.pushState("string"),"LINK_LABEL";case 102:return this.popState(),t.getLogger().debug("Lex: LINK","#"+e.yytext+"#"),15;case 103:case 104:return this.popState(),t.getLogger().debug("Lex: LINK",e.yytext),15;case 105:return t.getLogger().debug("Lex: COLON",e.yytext),e.yytext=e.yytext.slice(1),27}}),"anonymous"),rules:[/^(?:block-beta\b)/,/^(?:block\s+)/,/^(?:block\n+)/,/^(?:block:)/,/^(?:[\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:[29],inclusive:!1},STYLE_STMNT:{rules:[28],inclusive:!1},CLASSDEFID:{rules:[23],inclusive:!1},CLASSDEF:{rules:[21,22],inclusive:!1},CLASS_STYLE:{rules:[26],inclusive:!1},CLASS:{rules:[25],inclusive:!1},LLABEL:{rules:[100,101,102,103,104],inclusive:!1},ARROW_DIR:{rules:[86,87,88,89,90,91,92],inclusive:!1},BLOCK_ARROW:{rules:[77,82,85],inclusive:!1},NODE:{rules:[38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,78,81],inclusive:!1},md_string:{rules:[10,11,79,80],inclusive:!1},space:{rules:[],inclusive:!1},string:{rules:[13,14,83,84],inclusive:!1},acc_descr_multiline:{rules:[35,36],inclusive:!1},acc_descr:{rules:[33],inclusive:!1},acc_title:{rules:[31],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,12,15,16,17,18,19,20,24,27,30,32,34,37,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,93,94,95,96,97,98,99,105],inclusive:!0}}};return t}();function x(){this.yy={}}return y.lexer=v,s(x,"Parser"),x.prototype=y,y.Parser=x,new x}();UAt.parser=UAt;var GAt=UAt,qAt=new Map,jAt=[],YAt=new Map,WAt=Hn(),HAt=new Map,VAt=s((t=>_n.sanitizeText(t,WAt)),"sanitizeText"),XAt=s((function(t,e=""){let n=HAt.get(t);n||(n={id:t,styles:[],textStyles:[]},HAt.set(t,n)),null!=e&&e.split(",").forEach((t=>{const e=t.replace(/([^;]*);/,"$1").trim();if(RegExp("color").exec(t)){const t=e.replace("fill","bgFill").replace("color","fill");n.textStyles.push(t)}n.styles.push(e)}))}),"addStyleClass"),KAt=s((function(t,e=""){const n=qAt.get(t);null!=e&&(n.styles=e.split(","))}),"addStyle2Node"),ZAt=s((function(t,e){t.split(",").forEach((function(t){let n=qAt.get(t);if(void 0===n){const e=t.trim();n={id:e,type:"na",children:[]},qAt.set(e,n)}n.classes||(n.classes=[]),n.classes.push(e)}))}),"setCssClass"),QAt=s(((t,e)=>{const n=t.flat(),r=[];for(const t of n)if(t.label&&(t.label=VAt(t.label)),"classDef"!==t.type)if("applyClass"!==t.type)if("applyStyles"!==t.type)if("column-setting"===t.type)e.columns=t.columns??-1;else if("edge"===t.type){const e=(YAt.get(t.id)??0)+1;YAt.set(t.id,e),t.id=e+"-"+t.id,jAt.push(t)}else{t.label||("composite"===t.type?t.label="":t.label=t.id);const e=qAt.get(t.id);if(void 0===e?qAt.set(t.id,t):("na"!==t.type&&(e.type=t.type),t.label!==t.id&&(e.label=t.label)),t.children&&QAt(t.children,t),"space"===t.type){const e=t.width??1;for(let n=0;n<e;n++){const e=CB(t);e.id=e.id+"-"+n,qAt.set(e.id,e),r.push(e)}}else void 0===e&&r.push(t)}else t?.stylesStr&&KAt(t.id,t?.stylesStr);else ZAt(t.id,t?.styleClass??"");else XAt(t.id,t.css);e.children=r}),"populateBlockDatabase"),JAt=[],tLt={id:"root",type:"composite",children:[],columns:-1},eLt=s((()=>{m.debug("Clear called"),$n(),tLt={id:"root",type:"composite",children:[],columns:-1},qAt=new Map([["root",tLt]]),JAt=[],HAt=new Map,jAt=[],YAt=new Map}),"clear");function nLt(t){switch(m.debug("typeStr2Type",t),t){case"[]":return"square";case"()":return m.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"}}function rLt(t){return m.debug("typeStr2Type",t),"=="===t?"thick":"normal"}function iLt(t){switch(t.trim()){case"--x":return"arrow_cross";case"--o":return"arrow_circle";default:return"arrow_point"}}s(nLt,"typeStr2Type"),s(rLt,"edgeTypeStr2Type"),s(iLt,"edgeStrToEdgeData");var aLt=0,sLt=s((()=>(aLt++,"id-"+Math.random().toString(36).substr(2,12)+"-"+aLt)),"generateId"),oLt=s((t=>{tLt.children=t,QAt(t,tLt),JAt=tLt.children}),"setHierarchy"),lLt=s((t=>{const e=qAt.get(t);return e?e.columns?e.columns:e.children?e.children.length:-1:-1}),"getColumns"),cLt=s((()=>[...qAt.values()]),"getBlocksFlat"),hLt=s((()=>JAt||[]),"getBlocks"),uLt=s((()=>jAt),"getEdges"),dLt=s((t=>qAt.get(t)),"getBlock"),pLt=s((t=>{qAt.set(t.id,t)}),"setBlock"),gLt=s((()=>console),"getLogger"),fLt=s((function(){return HAt}),"getClasses"),mLt={getConfig:s((()=>Ft().block),"getConfig"),typeStr2Type:nLt,edgeTypeStr2Type:rLt,edgeStrToEdgeData:iLt,getLogger:gLt,getBlocksFlat:cLt,getBlocks:hLt,getEdges:uLt,setHierarchy:oLt,getBlock:dLt,setBlock:pLt,getColumns:lLt,getClasses:fLt,clear:eLt,generateId:sLt},yLt=s(((t,e)=>{const n=J,r=n(t,"r"),i=n(t,"g"),a=n(t,"b");return Q(r,i,a,e)}),"fade"),vLt=s((t=>`.label {\n font-family: ${t.fontFamily};\n color: ${t.nodeTextColor||t.textColor};\n }\n .cluster-label text {\n fill: ${t.titleColor};\n }\n .cluster-label span,p {\n color: ${t.titleColor};\n }\n\n\n\n .label text,span,p {\n fill: ${t.nodeTextColor||t.textColor};\n color: ${t.nodeTextColor||t.textColor};\n }\n\n .node rect,\n .node circle,\n .node ellipse,\n .node polygon,\n .node path {\n fill: ${t.mainBkg};\n stroke: ${t.nodeBorder};\n stroke-width: 1px;\n }\n .flowchart-label text {\n text-anchor: middle;\n }\n // .flowchart-label .text-outer-tspan {\n // text-anchor: middle;\n // }\n // .flowchart-label .text-inner-tspan {\n // text-anchor: start;\n // }\n\n .node .label {\n text-align: center;\n }\n .node.clickable {\n cursor: pointer;\n }\n\n .arrowheadPath {\n fill: ${t.arrowheadColor};\n }\n\n .edgePath .path {\n stroke: ${t.lineColor};\n stroke-width: 2.0px;\n }\n\n .flowchart-link {\n stroke: ${t.lineColor};\n fill: none;\n }\n\n .edgeLabel {\n background-color: ${t.edgeLabelBackground};\n rect {\n opacity: 0.5;\n background-color: ${t.edgeLabelBackground};\n fill: ${t.edgeLabelBackground};\n }\n text-align: center;\n }\n\n /* For html labels only */\n .labelBkg {\n background-color: ${yLt(t.edgeLabelBackground,.5)};\n // background-color:\n }\n\n .node .cluster {\n // fill: ${yLt(t.mainBkg,.5)};\n fill: ${yLt(t.clusterBkg,.5)};\n stroke: ${yLt(t.clusterBorder,.2)};\n box-shadow: rgba(50, 50, 93, 0.25) 0px 13px 27px -5px, rgba(0, 0, 0, 0.3) 0px 8px 16px -8px;\n stroke-width: 1px;\n }\n\n .cluster text {\n fill: ${t.titleColor};\n }\n\n .cluster span,p {\n color: ${t.titleColor};\n }\n /* .cluster div {\n color: ${t.titleColor};\n } */\n\n div.mermaidTooltip {\n position: absolute;\n text-align: center;\n max-width: 200px;\n padding: 2px;\n font-family: ${t.fontFamily};\n font-size: 12px;\n background: ${t.tertiaryColor};\n border: 1px solid ${t.border2};\n border-radius: 2px;\n pointer-events: none;\n z-index: 100;\n }\n\n .flowchartTitleText {\n text-anchor: middle;\n font-size: 18px;\n fill: ${t.textColor};\n }\n`),"getStyles"),xLt=s(((t,e,n,r)=>{e.forEach((e=>{LLt[e](t,n,r)}))}),"insertMarkers"),bLt=s(((t,e,n)=>{m.trace("Making markers for ",n),t.append("defs").append("marker").attr("id",n+"_"+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",n+"_"+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"),wLt=s(((t,e,n)=>{t.append("defs").append("marker").attr("id",n+"_"+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",n+"_"+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"),kLt=s(((t,e,n)=>{t.append("defs").append("marker").attr("id",n+"_"+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",n+"_"+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"),TLt=s(((t,e,n)=>{t.append("defs").append("marker").attr("id",n+"_"+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",n+"_"+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"),_Lt=s(((t,e,n)=>{t.append("defs").append("marker").attr("id",n+"_"+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",n+"_"+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"),ELt=s(((t,e,n)=>{t.append("marker").attr("id",n+"_"+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",n+"_"+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"),CLt=s(((t,e,n)=>{t.append("marker").attr("id",n+"_"+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",n+"_"+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"),SLt=s(((t,e,n)=>{t.append("marker").attr("id",n+"_"+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",n+"_"+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"),ALt=s(((t,e,n)=>{t.append("defs").append("marker").attr("id",n+"_"+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"),LLt={extension:bLt,composition:wLt,aggregation:kLt,dependency:TLt,lollipop:_Lt,point:ELt,circle:CLt,cross:SLt,barb:ALt},NLt=xLt,ILt=Hn()?.block?.padding??8;function MLt(t,e){if(0===t||!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(1===t)return{px:0,py:e};return{px:e%t,py:Math.floor(e/t)}}s(MLt,"calculateBlockPosition");var RLt=s((t=>{let e=0,n=0;for(const r of t.children){const{width:i,height:a,x:s,y:o}=r.size??{width:0,height:0,x:0,y:0};m.debug("getMaxChildSize abc95 child:",r.id,"width:",i,"height:",a,"x:",s,"y:",o,r.type),"space"!==r.type&&(i>e&&(e=i/(t.widthInColumns??1)),a>n&&(n=a))}return{width:e,height:n}}),"getMaxChildSize");function DLt(t,e,n=0,r=0){m.debug("setBlockSizes abc95 (start)",t.id,t?.size?.x,"block width =",t?.size,"sieblingWidth",n),t?.size?.width||(t.size={width:n,height:r,x:0,y:0});let i=0,a=0;if(t.children?.length>0){for(const n of t.children)DLt(n,e);const s=RLt(t);i=s.width,a=s.height,m.debug("setBlockSizes abc95 maxWidth of",t.id,":s children is ",i,a);for(const e of t.children)e.size&&(m.debug(`abc95 Setting size of children of ${t.id} id=${e.id} ${i} ${a} ${JSON.stringify(e.size)}`),e.size.width=i*(e.widthInColumns??1)+ILt*((e.widthInColumns??1)-1),e.size.height=a,e.size.x=0,e.size.y=0,m.debug(`abc95 updating size of ${t.id} children child:${e.id} maxWidth:${i} maxHeight:${a}`));for(const n of t.children)DLt(n,e,i,a);const o=t.columns??-1;let l=0;for(const e of t.children)l+=e.widthInColumns??1;let c=t.children.length;o>0&&o<l&&(c=o);const h=Math.ceil(l/c);let u=c*(i+ILt)+ILt,d=h*(a+ILt)+ILt;if(u<n){m.debug(`Detected to small siebling: abc95 ${t.id} sieblingWidth ${n} sieblingHeight ${r} width ${u}`),u=n,d=r;const e=(n-c*ILt-ILt)/c,s=(r-h*ILt-ILt)/h;m.debug("Size indata abc88",t.id,"childWidth",e,"maxWidth",i),m.debug("Size indata abc88",t.id,"childHeight",s,"maxHeight",a),m.debug("Size indata abc88 xSize",c,"padding",ILt);for(const n of t.children)n.size&&(n.size.width=e,n.size.height=s,n.size.x=0,n.size.y=0)}if(m.debug(`abc95 (finale calc) ${t.id} xSize ${c} ySize ${h} columns ${o}${t.children.length} width=${Math.max(u,t.size?.width||0)}`),u<(t?.size?.width||0)){u=t?.size?.width||0;const e=o>0?Math.min(t.children.length,o):t.children.length;if(e>0){const n=(u-e*ILt-ILt)/e;m.debug("abc95 (growing to fit) width",t.id,u,t.size?.width,n);for(const e of t.children)e.size&&(e.size.width=n)}}t.size={width:u,height:d,x:0,y:0}}m.debug("setBlockSizes abc94 (done)",t.id,t?.size?.x,t?.size?.width,t?.size?.y,t?.size?.height)}function OLt(t,e){m.debug(`abc85 layout blocks (=>layoutBlocks) ${t.id} x: ${t?.size?.x} y: ${t?.size?.y} width: ${t?.size?.width}`);const n=t.columns??-1;if(m.debug("layoutBlocks columns abc95",t.id,"=>",n,t),t.children&&t.children.length>0){const e=t?.children[0]?.size?.width??0,r=t.children.length*e+(t.children.length-1)*ILt;m.debug("widthOfChildren 88",r,"posX");let i=0;m.debug("abc91 block?.size?.x",t.id,t?.size?.x);let a=t?.size?.x?t?.size?.x+(-t?.size?.width/2||0):-ILt,s=0;for(const e of t.children){const r=t;if(!e.size)continue;const{width:o,height:l}=e.size,{px:c,py:h}=MLt(n,i);if(h!=s&&(s=h,a=t?.size?.x?t?.size?.x+(-t?.size?.width/2||0):-ILt,m.debug("New row in layout for block",t.id," and child ",e.id,s)),m.debug(`abc89 layout blocks (child) id: ${e.id} Pos: ${i} (px, py) ${c},${h} (${r?.size?.x},${r?.size?.y}) parent: ${r.id} width: ${o}${ILt}`),r.size){const t=o/2;e.size.x=a+ILt+t,m.debug(`abc91 layout blocks (calc) px, pyid:${e.id} startingPos=X${a} new startingPosX${e.size.x} ${t} padding=${ILt} width=${o} halfWidth=${t} => x:${e.size.x} y:${e.size.y} ${e.widthInColumns} (width * (child?.w || 1)) / 2 ${o*(e?.widthInColumns??1)/2}`),a=e.size.x+t,e.size.y=r.size.y-r.size.height/2+h*(l+ILt)+l/2+ILt,m.debug(`abc88 layout blocks (calc) px, pyid:${e.id}startingPosX${a}${ILt}${t}=>x:${e.size.x}y:${e.size.y}${e.widthInColumns}(width * (child?.w || 1)) / 2${o*(e?.widthInColumns??1)/2}`)}e.children&&OLt(e),i+=e?.widthInColumns??1,m.debug("abc88 columnsPos",e,i)}}m.debug(`layout blocks (<==layoutBlocks) ${t.id} x: ${t?.size?.x} y: ${t?.size?.y} width: ${t?.size?.width}`)}function PLt(t,{minX:e,minY:n,maxX:r,maxY:i}={minX:0,minY:0,maxX:0,maxY:0}){if(t.size&&"root"!==t.id){const{x:a,y:s,width:o,height:l}=t.size;a-o/2<e&&(e=a-o/2),s-l/2<n&&(n=s-l/2),a+o/2>r&&(r=a+o/2),s+l/2>i&&(i=s+l/2)}if(t.children)for(const a of t.children)({minX:e,minY:n,maxX:r,maxY:i}=PLt(a,{minX:e,minY:n,maxX:r,maxY:i}));return{minX:e,minY:n,maxX:r,maxY:i}}function BLt(t){const e=t.getBlock("root");if(!e)return;DLt(e,t,0,0),OLt(e),m.debug("getBlocks",JSON.stringify(e,null,2));const{minX:n,minY:r,maxX:i,maxY:a}=PLt(e);return{x:n,y:r,width:i-n,height:a-r}}function $Lt(t,e){e&&t.attr("style",e)}function FLt(t){const e=Oa(document.createElementNS("http://www.w3.org/2000/svg","foreignObject")),n=e.append("xhtml:div"),r=t.label,i=t.isNode?"nodeLabel":"edgeLabel",a=n.append("span");return a.html(r),$Lt(a,t.labelStyle),a.attr("class",i),$Lt(n,t.labelStyle),n.style("display","inline-block"),n.style("white-space","nowrap"),n.attr("xmlns","http://www.w3.org/1999/xhtml"),e.node()}s(DLt,"setBlockSizes"),s(OLt,"layoutBlocks"),s(PLt,"findBounds"),s(BLt,"layout"),s($Lt,"applyStyle"),s(FLt,"addHtmlLabel");var zLt=s(((t,e,n,r)=>{let i=t||"";if("object"==typeof i&&(i=i[0]),dn(Hn().flowchart.htmlLabels)){i=i.replace(/\\n|\n/g,"<br />"),m.debug("vertexText"+i);return FLt({isNode:r,label:XT(xk(i)),labelStyle:e.replace("fill:","color:")})}{const t=document.createElementNS("http://www.w3.org/2000/svg","text");t.setAttribute("style",e.replace("color:","fill:"));let r=[];r="string"==typeof i?i.split(/\\n|\n|<br\s*\/?>/gi):Array.isArray(i)?i:[];for(const e of r){const r=document.createElementNS("http://www.w3.org/2000/svg","tspan");r.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),r.setAttribute("dy","1em"),r.setAttribute("x","0"),n?r.setAttribute("class","title-row"):r.setAttribute("class","row"),r.textContent=e.trim(),t.appendChild(r)}return t}}),"createLabel"),ULt=s(((t,e,n,r,i)=>{e.arrowTypeStart&&qLt(t,"start",e.arrowTypeStart,n,r,i),e.arrowTypeEnd&&qLt(t,"end",e.arrowTypeEnd,n,r,i)}),"addEdgeMarkers"),GLt={arrow_cross:"cross",arrow_point:"point",arrow_barb:"barb",arrow_circle:"circle",aggregation:"aggregation",extension:"extension",composition:"composition",dependency:"dependency",lollipop:"lollipop"},qLt=s(((t,e,n,r,i,a)=>{const s=GLt[n];if(!s)return void m.warn(`Unknown arrow type: ${n}`);const o="start"===e?"Start":"End";t.attr(`marker-${e}`,`url(${r}#${i}_${a}-${s}${o})`)}),"addEdgeMarker"),jLt={},YLt={},WLt=s(((t,e)=>{const n=Hn(),r=dn(n.flowchart.htmlLabels),i="markdown"===e.labelType?KT(t,e.label,{style:e.labelStyle,useHtmlLabels:r,addSvgBackground:!0},n):zLt(e.label,e.labelStyle),a=t.insert("g").attr("class","edgeLabel"),s=a.insert("g").attr("class","label");s.node().appendChild(i);let o,l=i.getBBox();if(r){const t=i.children[0],e=Oa(i);l=t.getBoundingClientRect(),e.attr("width",l.width),e.attr("height",l.height)}if(s.attr("transform","translate("+-l.width/2+", "+-l.height/2+")"),jLt[e.id]=a,e.width=l.width,e.height=l.height,e.startLabelLeft){const n=zLt(e.startLabelLeft,e.labelStyle),r=t.insert("g").attr("class","edgeTerminals"),i=r.insert("g").attr("class","inner");o=i.node().appendChild(n);const a=n.getBBox();i.attr("transform","translate("+-a.width/2+", "+-a.height/2+")"),YLt[e.id]||(YLt[e.id]={}),YLt[e.id].startLeft=r,HLt(o,e.startLabelLeft)}if(e.startLabelRight){const n=zLt(e.startLabelRight,e.labelStyle),r=t.insert("g").attr("class","edgeTerminals"),i=r.insert("g").attr("class","inner");o=r.node().appendChild(n),i.node().appendChild(n);const a=n.getBBox();i.attr("transform","translate("+-a.width/2+", "+-a.height/2+")"),YLt[e.id]||(YLt[e.id]={}),YLt[e.id].startRight=r,HLt(o,e.startLabelRight)}if(e.endLabelLeft){const n=zLt(e.endLabelLeft,e.labelStyle),r=t.insert("g").attr("class","edgeTerminals"),i=r.insert("g").attr("class","inner");o=i.node().appendChild(n);const a=n.getBBox();i.attr("transform","translate("+-a.width/2+", "+-a.height/2+")"),r.node().appendChild(n),YLt[e.id]||(YLt[e.id]={}),YLt[e.id].endLeft=r,HLt(o,e.endLabelLeft)}if(e.endLabelRight){const n=zLt(e.endLabelRight,e.labelStyle),r=t.insert("g").attr("class","edgeTerminals"),i=r.insert("g").attr("class","inner");o=i.node().appendChild(n);const a=n.getBBox();i.attr("transform","translate("+-a.width/2+", "+-a.height/2+")"),r.node().appendChild(n),YLt[e.id]||(YLt[e.id]={}),YLt[e.id].endRight=r,HLt(o,e.endLabelRight)}return i}),"insertEdgeLabel");function HLt(t,e){Hn().flowchart.htmlLabels&&t&&(t.style.width=9*e.length+"px",t.style.height="12px")}s(HLt,"setTerminalWidth");var VLt=s(((t,e)=>{m.debug("Moving label abc88 ",t.id,t.label,jLt[t.id],e);let n=e.updatedPath?e.updatedPath:e.originalPath;const r=Hn(),{subGraphTitleTotalMargin:i}=Gm(r);if(t.label){const r=jLt[t.id];let a=t.x,s=t.y;if(n){const r=yk.calcLabelPosition(n);m.debug("Moving label "+t.label+" from (",a,",",s,") to (",r.x,",",r.y,") abc88"),e.updatedPath&&(a=r.x,s=r.y)}r.attr("transform",`translate(${a}, ${s+i/2})`)}if(t.startLabelLeft){const e=YLt[t.id].startLeft;let r=t.x,i=t.y;if(n){const e=yk.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_left",n);r=e.x,i=e.y}e.attr("transform",`translate(${r}, ${i})`)}if(t.startLabelRight){const e=YLt[t.id].startRight;let r=t.x,i=t.y;if(n){const e=yk.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_right",n);r=e.x,i=e.y}e.attr("transform",`translate(${r}, ${i})`)}if(t.endLabelLeft){const e=YLt[t.id].endLeft;let r=t.x,i=t.y;if(n){const e=yk.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_left",n);r=e.x,i=e.y}e.attr("transform",`translate(${r}, ${i})`)}if(t.endLabelRight){const e=YLt[t.id].endRight;let r=t.x,i=t.y;if(n){const e=yk.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_right",n);r=e.x,i=e.y}e.attr("transform",`translate(${r}, ${i})`)}}),"positionEdgeLabel"),XLt=s(((t,e)=>{const n=t.x,r=t.y,i=Math.abs(e.x-n),a=Math.abs(e.y-r),s=t.width/2,o=t.height/2;return i>=s||a>=o}),"outsideNode"),KLt=s(((t,e,n)=>{m.debug(`intersection calc abc89:\n outsidePoint: ${JSON.stringify(e)}\n insidePoint : ${JSON.stringify(n)}\n node : x:${t.x} y:${t.y} w:${t.width} h:${t.height}`);const r=t.x,i=t.y,a=Math.abs(r-n.x),s=t.width/2;let o=n.x<e.x?s-a:s+a;const l=t.height/2,c=Math.abs(e.y-n.y),h=Math.abs(e.x-n.x);if(Math.abs(i-e.y)*s>Math.abs(r-e.x)*l){let t=n.y<e.y?e.y-l-i:i-l-e.y;o=h*t/c;const r={x:n.x<e.x?n.x+o:n.x-h+o,y:n.y<e.y?n.y+c-t:n.y-c+t};return 0===o&&(r.x=e.x,r.y=e.y),0===h&&(r.x=e.x),0===c&&(r.y=e.y),m.debug(`abc89 topp/bott calc, Q ${c}, q ${t}, R ${h}, r ${o}`,r),r}{o=n.x<e.x?e.x-s-r:r-s-e.x;let t=c*o/h,i=n.x<e.x?n.x+h-o:n.x-h+o,a=n.y<e.y?n.y+t:n.y-t;return m.debug(`sides calc abc89, Q ${c}, q ${t}, R ${h}, r ${o}`,{_x:i,_y:a}),0===o&&(i=e.x,a=e.y),0===h&&(i=e.x),0===c&&(a=e.y),{x:i,y:a}}}),"intersection"),ZLt=s(((t,e)=>{m.debug("abc88 cutPathAtIntersect",t,e);let n=[],r=t[0],i=!1;return t.forEach((t=>{if(XLt(e,t)||i)r=t,i||n.push(t);else{const a=KLt(e,r,t);let s=!1;n.forEach((t=>{s=s||t.x===a.x&&t.y===a.y})),n.some((t=>t.x===a.x&&t.y===a.y))||n.push(a),i=!0}})),n}),"cutPathAtIntersect"),QLt=s((function(t,e,n,r,i,a,s){let o=n.points;m.debug("abc88 InsertEdge: edge=",n,"e=",e);let l=!1;const c=a.node(e.v);var h=a.node(e.w);h?.intersect&&c?.intersect&&(o=o.slice(1,n.points.length-1),o.unshift(c.intersect(o[0])),o.push(h.intersect(o[o.length-1]))),n.toCluster&&(m.debug("to cluster abc88",r[n.toCluster]),o=ZLt(n.points,r[n.toCluster].node),l=!0),n.fromCluster&&(m.debug("from cluster abc88",r[n.fromCluster]),o=ZLt(o.reverse(),r[n.fromCluster].node).reverse(),l=!0);const u=o.filter((t=>!Number.isNaN(t.y)));let d=iu;!n.curve||"graph"!==i&&"flowchart"!==i||(d=n.curve);const{x:p,y:g}=kS(n),f=Xh().x(p).y(g).curve(d);let y;switch(n.thickness){case"normal":y="edge-thickness-normal";break;case"thick":case"invisible":y="edge-thickness-thick";break;default:y=""}switch(n.pattern){case"solid":y+=" edge-pattern-solid";break;case"dotted":y+=" edge-pattern-dotted";break;case"dashed":y+=" edge-pattern-dashed"}const v=t.append("path").attr("d",f(u)).attr("id",n.id).attr("class"," "+y+(n.classes?" "+n.classes:"")).attr("style",n.style);let x="";(Hn().flowchart.arrowMarkerAbsolute||Hn().state.arrowMarkerAbsolute)&&(x=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,x=x.replace(/\(/g,"\\("),x=x.replace(/\)/g,"\\)")),ULt(v,n,x,s,i);let b={};return l&&(b.updatedPath=o),b.originalPath=n.points,b}),"insertEdge"),JLt=s((t=>{const e=new Set;for(const n of t)switch(n){case"x":e.add("right"),e.add("left");break;case"y":e.add("up"),e.add("down");break;default:e.add(n)}return e}),"expandAndDeduplicateDirections"),tNt=s(((t,e,n)=>{const r=JLt(t),i=e.height+2*n.padding,a=i/2,s=e.width+2*a+n.padding,o=n.padding/2;return r.has("right")&&r.has("left")&&r.has("up")&&r.has("down")?[{x:0,y:0},{x:a,y:0},{x:s/2,y:2*o},{x:s-a,y:0},{x:s,y:0},{x:s,y:-i/3},{x:s+2*o,y:-i/2},{x:s,y:-2*i/3},{x:s,y:-i},{x:s-a,y:-i},{x:s/2,y:-i-2*o},{x:a,y:-i},{x:0,y:-i},{x:0,y:-2*i/3},{x:-2*o,y:-i/2},{x:0,y:-i/3}]:r.has("right")&&r.has("left")&&r.has("up")?[{x:a,y:0},{x:s-a,y:0},{x:s,y:-i/2},{x:s-a,y:-i},{x:a,y:-i},{x:0,y:-i/2}]:r.has("right")&&r.has("left")&&r.has("down")?[{x:0,y:0},{x:a,y:-i},{x:s-a,y:-i},{x:s,y:0}]:r.has("right")&&r.has("up")&&r.has("down")?[{x:0,y:0},{x:s,y:-a},{x:s,y:-i+a},{x:0,y:-i}]:r.has("left")&&r.has("up")&&r.has("down")?[{x:s,y:0},{x:0,y:-a},{x:0,y:-i+a},{x:s,y:-i}]:r.has("right")&&r.has("left")?[{x:a,y:0},{x:a,y:-o},{x:s-a,y:-o},{x:s-a,y:0},{x:s,y:-i/2},{x:s-a,y:-i},{x:s-a,y:-i+o},{x:a,y:-i+o},{x:a,y:-i},{x:0,y:-i/2}]:r.has("up")&&r.has("down")?[{x:s/2,y:0},{x:0,y:-o},{x:a,y:-o},{x:a,y:-i+o},{x:0,y:-i+o},{x:s/2,y:-i},{x:s,y:-i+o},{x:s-a,y:-i+o},{x:s-a,y:-o},{x:s,y:-o}]:r.has("right")&&r.has("up")?[{x:0,y:0},{x:s,y:-a},{x:0,y:-i}]:r.has("right")&&r.has("down")?[{x:0,y:0},{x:s,y:0},{x:0,y:-i}]:r.has("left")&&r.has("up")?[{x:s,y:0},{x:0,y:-a},{x:s,y:-i}]:r.has("left")&&r.has("down")?[{x:s,y:0},{x:0,y:0},{x:s,y:-i}]:r.has("right")?[{x:a,y:-o},{x:a,y:-o},{x:s-a,y:-o},{x:s-a,y:0},{x:s,y:-i/2},{x:s-a,y:-i},{x:s-a,y:-i+o},{x:a,y:-i+o},{x:a,y:-i+o}]:r.has("left")?[{x:a,y:0},{x:a,y:-o},{x:s-a,y:-o},{x:s-a,y:-i+o},{x:a,y:-i+o},{x:a,y:-i},{x:0,y:-i/2}]:r.has("up")?[{x:a,y:-o},{x:a,y:-i+o},{x:0,y:-i+o},{x:s/2,y:-i},{x:s,y:-i+o},{x:s-a,y:-i+o},{x:s-a,y:-o}]:r.has("down")?[{x:s/2,y:0},{x:0,y:-o},{x:a,y:-o},{x:a,y:-i+o},{x:s-a,y:-i+o},{x:s-a,y:-o},{x:s,y:-o}]:[{x:0,y:0}]}),"getArrowPoints");function eNt(t,e){return t.intersect(e)}s(eNt,"intersectNode");var nNt=eNt;function rNt(t,e,n,r){var i=t.x,a=t.y,s=i-r.x,o=a-r.y,l=Math.sqrt(e*e*o*o+n*n*s*s),c=Math.abs(e*n*s/l);r.x<i&&(c=-c);var h=Math.abs(e*n*o/l);return r.y<a&&(h=-h),{x:i+c,y:a+h}}s(rNt,"intersectEllipse");var iNt=rNt;function aNt(t,e,n){return iNt(t,e,e,n)}s(aNt,"intersectCircle");var sNt=aNt;function oNt(t,e,n,r){var i,a,s,o,l,c,h,u,d,p,g,f,m;if(i=e.y-t.y,s=t.x-e.x,l=e.x*t.y-t.x*e.y,d=i*n.x+s*n.y+l,p=i*r.x+s*r.y+l,!(0!==d&&0!==p&&lNt(d,p)||(a=r.y-n.y,o=n.x-r.x,c=r.x*n.y-n.x*r.y,h=a*t.x+o*t.y+c,u=a*e.x+o*e.y+c,0!==h&&0!==u&&lNt(h,u)||0==(g=i*o-a*s))))return f=Math.abs(g/2),{x:(m=s*c-o*l)<0?(m-f)/g:(m+f)/g,y:(m=a*l-i*c)<0?(m-f)/g:(m+f)/g}}function lNt(t,e){return t*e>0}s(oNt,"intersectLine"),s(lNt,"sameSign");var cNt=oNt,hNt=uNt;function uNt(t,e,n){var r=t.x,i=t.y,a=[],s=Number.POSITIVE_INFINITY,o=Number.POSITIVE_INFINITY;"function"==typeof e.forEach?e.forEach((function(t){s=Math.min(s,t.x),o=Math.min(o,t.y)})):(s=Math.min(s,e.x),o=Math.min(o,e.y));for(var l=r-t.width/2-s,c=i-t.height/2-o,h=0;h<e.length;h++){var u=e[h],d=e[h<e.length-1?h+1:0],p=cNt(t,n,{x:l+u.x,y:c+u.y},{x:l+d.x,y:c+d.y});p&&a.push(p)}return a.length?(a.length>1&&a.sort((function(t,e){var r=t.x-n.x,i=t.y-n.y,a=Math.sqrt(r*r+i*i),s=e.x-n.x,o=e.y-n.y,l=Math.sqrt(s*s+o*o);return a<l?-1:a===l?0:1})),a[0]):t}s(uNt,"intersectPolygon");var dNt=s(((t,e)=>{var n,r,i=t.x,a=t.y,s=e.x-i,o=e.y-a,l=t.width/2,c=t.height/2;return Math.abs(o)*l>Math.abs(s)*c?(o<0&&(c=-c),n=0===o?0:c*s/o,r=c):(s<0&&(l=-l),n=l,r=0===s?0:l*o/s),{x:i+n,y:a+r}}),"intersectRect"),pNt={node:nNt,circle:sNt,ellipse:iNt,polygon:hNt,rect:dNt},gNt=s((async(t,e,n,r)=>{const i=Hn();let a;const o=e.useHtmlLabels||dn(i.flowchart.htmlLabels);a=n||"node default";const l=t.insert("g").attr("class",a).attr("id",e.domId||e.id),c=l.insert("g").attr("class","label").attr("style",e.labelStyle);let h;h=void 0===e.labelText?"":"string"==typeof e.labelText?e.labelText:e.labelText[0];const u=c.node();let d;d="markdown"===e.labelType?KT(c,an(xk(h),i),{useHtmlLabels:o,width:e.width||i.flowchart.wrappingWidth,classes:"markdown-node-label"},i):u.appendChild(zLt(an(xk(h),i),e.labelStyle,!1,r));let p=d.getBBox();const g=e.padding/2;if(dn(i.flowchart.htmlLabels)){const t=d.children[0],e=Oa(d),n=t.getElementsByTagName("img");if(n){const t=""===h.replace(/<img[^>]*>/g,"").trim();await Promise.all([...n].map((e=>new Promise((n=>{function r(){if(e.style.display="flex",e.style.flexDirection="column",t){const t=i.fontSize?i.fontSize:window.getComputedStyle(document.body).fontSize,n=5,r=parseInt(t,10)*n+"px";e.style.minWidth=r,e.style.maxWidth=r}else e.style.width="100%";n(e)}s(r,"setupImage"),setTimeout((()=>{e.complete&&r()})),e.addEventListener("error",r),e.addEventListener("load",r)})))))}p=t.getBoundingClientRect(),e.attr("width",p.width),e.attr("height",p.height)}return o?c.attr("transform","translate("+-p.width/2+", "+-p.height/2+")"):c.attr("transform","translate(0, "+-p.height/2+")"),e.centerLabel&&c.attr("transform","translate("+-p.width/2+", "+-p.height/2+")"),c.insert("rect",":first-child"),{shapeSvg:l,bbox:p,halfPadding:g,label:c}}),"labelHelper"),fNt=s(((t,e)=>{const n=e.node().getBBox();t.width=n.width,t.height=n.height}),"updateNodeBounds");function mNt(t,e,n,r){return t.insert("polygon",":first-child").attr("points",r.map((function(t){return t.x+","+t.y})).join(" ")).attr("class","label-container").attr("transform","translate("+-e/2+","+n/2+")")}s(mNt,"insertPolygonShape");var yNt=s((async(t,e)=>{e.useHtmlLabels||Hn().flowchart.htmlLabels||(e.centerLabel=!0);const{shapeSvg:n,bbox:r,halfPadding:i}=await gNt(t,e,"node "+e.classes,!0);m.info("Classes = ",e.classes);const a=n.insert("rect",":first-child");return a.attr("rx",e.rx).attr("ry",e.ry).attr("x",-r.width/2-i).attr("y",-r.height/2-i).attr("width",r.width+e.padding).attr("height",r.height+e.padding),fNt(e,a),e.intersect=function(t){return pNt.rect(e,t)},n}),"note"),vNt=yNt,xNt=s((t=>t?" "+t:""),"formatClass"),bNt=s(((t,e)=>`${e||"node default"}${xNt(t.classes)} ${xNt(t.class)}`),"getClassesFromNode"),wNt=s((async(t,e)=>{const{shapeSvg:n,bbox:r}=await gNt(t,e,bNt(e,void 0),!0),i=r.width+e.padding+(r.height+e.padding),a=[{x:i/2,y:0},{x:i,y:-i/2},{x:i/2,y:-i},{x:0,y:-i/2}];m.info("Question main (Circle)");const s=mNt(n,i,i,a);return s.attr("style",e.style),fNt(e,s),e.intersect=function(t){return m.warn("Intersect called"),pNt.polygon(e,a,t)},n}),"question"),kNt=s(((t,e)=>{const n=t.insert("g").attr("class","node default").attr("id",e.domId||e.id),r=[{x:0,y:14},{x:14,y:0},{x:0,y:-14},{x:-14,y:0}],i=n.insert("polygon",":first-child").attr("points",r.map((function(t){return t.x+","+t.y})).join(" "));return i.attr("class","state-start").attr("r",7).attr("width",28).attr("height",28),e.width=28,e.height=28,e.intersect=function(t){return pNt.circle(e,14,t)},n}),"choice"),TNt=s((async(t,e)=>{const{shapeSvg:n,bbox:r}=await gNt(t,e,bNt(e,void 0),!0),i=r.height+e.padding,a=i/4,s=r.width+2*a+e.padding,o=[{x:a,y:0},{x:s-a,y:0},{x:s,y:-i/2},{x:s-a,y:-i},{x:a,y:-i},{x:0,y:-i/2}],l=mNt(n,s,i,o);return l.attr("style",e.style),fNt(e,l),e.intersect=function(t){return pNt.polygon(e,o,t)},n}),"hexagon"),_Nt=s((async(t,e)=>{const{shapeSvg:n,bbox:r}=await gNt(t,e,void 0,!0),i=r.height+2*e.padding,a=i/2,s=r.width+2*a+e.padding,o=tNt(e.directions,r,e),l=mNt(n,s,i,o);return l.attr("style",e.style),fNt(e,l),e.intersect=function(t){return pNt.polygon(e,o,t)},n}),"block_arrow"),ENt=s((async(t,e)=>{const{shapeSvg:n,bbox:r}=await gNt(t,e,bNt(e,void 0),!0),i=r.width+e.padding,a=r.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 mNt(n,i,a,s).attr("style",e.style),e.width=i+a,e.height=a,e.intersect=function(t){return pNt.polygon(e,s,t)},n}),"rect_left_inv_arrow"),CNt=s((async(t,e)=>{const{shapeSvg:n,bbox:r}=await gNt(t,e,bNt(e),!0),i=r.width+e.padding,a=r.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=mNt(n,i,a,s);return o.attr("style",e.style),fNt(e,o),e.intersect=function(t){return pNt.polygon(e,s,t)},n}),"lean_right"),SNt=s((async(t,e)=>{const{shapeSvg:n,bbox:r}=await gNt(t,e,bNt(e,void 0),!0),i=r.width+e.padding,a=r.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=mNt(n,i,a,s);return o.attr("style",e.style),fNt(e,o),e.intersect=function(t){return pNt.polygon(e,s,t)},n}),"lean_left"),ANt=s((async(t,e)=>{const{shapeSvg:n,bbox:r}=await gNt(t,e,bNt(e,void 0),!0),i=r.width+e.padding,a=r.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=mNt(n,i,a,s);return o.attr("style",e.style),fNt(e,o),e.intersect=function(t){return pNt.polygon(e,s,t)},n}),"trapezoid"),LNt=s((async(t,e)=>{const{shapeSvg:n,bbox:r}=await gNt(t,e,bNt(e,void 0),!0),i=r.width+e.padding,a=r.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=mNt(n,i,a,s);return o.attr("style",e.style),fNt(e,o),e.intersect=function(t){return pNt.polygon(e,s,t)},n}),"inv_trapezoid"),NNt=s((async(t,e)=>{const{shapeSvg:n,bbox:r}=await gNt(t,e,bNt(e,void 0),!0),i=r.width+e.padding,a=r.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=mNt(n,i,a,s);return o.attr("style",e.style),fNt(e,o),e.intersect=function(t){return pNt.polygon(e,s,t)},n}),"rect_right_inv_arrow"),INt=s((async(t,e)=>{const{shapeSvg:n,bbox:r}=await gNt(t,e,bNt(e,void 0),!0),i=r.width+e.padding,a=i/2,s=a/(2.5+i/50),o=r.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,c=n.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 fNt(e,c),e.intersect=function(t){const n=pNt.rect(e,t),r=n.x-e.x;if(0!=a&&(Math.abs(r)<e.width/2||Math.abs(r)==e.width/2&&Math.abs(n.y-e.y)>e.height/2-s)){let i=s*s*(1-r*r/(a*a));0!=i&&(i=Math.sqrt(i)),i=s-i,t.y-e.y>0&&(i=-i),n.y+=i}return n},n}),"cylinder"),MNt=s((async(t,e)=>{const{shapeSvg:n,bbox:r,halfPadding:i}=await gNt(t,e,"node "+e.classes+" "+e.class,!0),a=n.insert("rect",":first-child"),s=e.positioned?e.width:r.width+e.padding,o=e.positioned?e.height:r.height+e.padding,l=e.positioned?-s/2:-r.width/2-i,c=e.positioned?-o/2:-r.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",c).attr("width",s).attr("height",o),e.props){const t=new Set(Object.keys(e.props));e.props.borders&&(ONt(a,e.props.borders,s,o),t.delete("borders")),t.forEach((t=>{m.warn(`Unknown node property ${t}`)}))}return fNt(e,a),e.intersect=function(t){return pNt.rect(e,t)},n}),"rect"),RNt=s((async(t,e)=>{const{shapeSvg:n,bbox:r,halfPadding:i}=await gNt(t,e,"node "+e.classes,!0),a=n.insert("rect",":first-child"),s=e.positioned?e.width:r.width+e.padding,o=e.positioned?e.height:r.height+e.padding,l=e.positioned?-s/2:-r.width/2-i,c=e.positioned?-o/2:-r.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",c).attr("width",s).attr("height",o),e.props){const t=new Set(Object.keys(e.props));e.props.borders&&(ONt(a,e.props.borders,s,o),t.delete("borders")),t.forEach((t=>{m.warn(`Unknown node property ${t}`)}))}return fNt(e,a),e.intersect=function(t){return pNt.rect(e,t)},n}),"composite"),DNt=s((async(t,e)=>{const{shapeSvg:n}=await gNt(t,e,"label",!0);m.trace("Classes = ",e.class);const r=n.insert("rect",":first-child");if(r.attr("width",0).attr("height",0),n.attr("class","label edgeLabel"),e.props){const t=new Set(Object.keys(e.props));e.props.borders&&(ONt(r,e.props.borders,0,0),t.delete("borders")),t.forEach((t=>{m.warn(`Unknown node property ${t}`)}))}return fNt(e,r),e.intersect=function(t){return pNt.rect(e,t)},n}),"labelRect");function ONt(t,e,n,r){const i=[],a=s((t=>{i.push(t,0)}),"addBorder"),o=s((t=>{i.push(0,t)}),"skipBorder");e.includes("t")?(m.debug("add top border"),a(n)):o(n),e.includes("r")?(m.debug("add right border"),a(r)):o(r),e.includes("b")?(m.debug("add bottom border"),a(n)):o(n),e.includes("l")?(m.debug("add left border"),a(r)):o(r),t.attr("stroke-dasharray",i.join(" "))}s(ONt,"applyNodePropertyBorders");var PNt=s(((t,e)=>{let n;n=e.classes?"node "+e.classes:"node default";const r=t.insert("g").attr("class",n).attr("id",e.domId||e.id),i=r.insert("rect",":first-child"),a=r.insert("line"),s=r.insert("g").attr("class","label"),o=e.labelText.flat?e.labelText.flat():e.labelText;let l="";l="object"==typeof o?o[0]:o,m.info("Label text abc79",l,o,"object"==typeof o);const c=s.node().appendChild(zLt(l,e.labelStyle,!0,!0));let h={width:0,height:0};if(dn(Hn().flowchart.htmlLabels)){const t=c.children[0],e=Oa(c);h=t.getBoundingClientRect(),e.attr("width",h.width),e.attr("height",h.height)}m.info("Text 2",o);const u=o.slice(1,o.length);let d=c.getBBox();const p=s.node().appendChild(zLt(u.join?u.join("<br/>"):u,e.labelStyle,!0,!0));if(dn(Hn().flowchart.htmlLabels)){const t=p.children[0],e=Oa(p);h=t.getBoundingClientRect(),e.attr("width",h.width),e.attr("height",h.height)}const g=e.padding/2;return Oa(p).attr("transform","translate( "+(h.width>d.width?0:(d.width-h.width)/2)+", "+(d.height+g+5)+")"),Oa(c).attr("transform","translate( "+(h.width<d.width?0:-(d.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+d.height+g).attr("y2",-h.height/2-g+d.height+g),fNt(e,i),e.intersect=function(t){return pNt.rect(e,t)},r}),"rectWithTitle"),BNt=s((async(t,e)=>{const{shapeSvg:n,bbox:r}=await gNt(t,e,bNt(e,void 0),!0),i=r.height+e.padding,a=r.width+i/4+e.padding,s=n.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 fNt(e,s),e.intersect=function(t){return pNt.rect(e,t)},n}),"stadium"),$Nt=s((async(t,e)=>{const{shapeSvg:n,bbox:r,halfPadding:i}=await gNt(t,e,bNt(e,void 0),!0),a=n.insert("circle",":first-child");return a.attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("r",r.width/2+i).attr("width",r.width+e.padding).attr("height",r.height+e.padding),m.info("Circle main"),fNt(e,a),e.intersect=function(t){return m.info("Circle intersect",e,r.width/2+i,t),pNt.circle(e,r.width/2+i,t)},n}),"circle"),FNt=s((async(t,e)=>{const{shapeSvg:n,bbox:r,halfPadding:i}=await gNt(t,e,bNt(e,void 0),!0),a=n.insert("g",":first-child"),s=a.insert("circle"),o=a.insert("circle");return a.attr("class",e.class),s.attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("r",r.width/2+i+5).attr("width",r.width+e.padding+10).attr("height",r.height+e.padding+10),o.attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("r",r.width/2+i).attr("width",r.width+e.padding).attr("height",r.height+e.padding),m.info("DoubleCircle main"),fNt(e,s),e.intersect=function(t){return m.info("DoubleCircle intersect",e,r.width/2+i+5,t),pNt.circle(e,r.width/2+i+5,t)},n}),"doublecircle"),zNt=s((async(t,e)=>{const{shapeSvg:n,bbox:r}=await gNt(t,e,bNt(e,void 0),!0),i=r.width+e.padding,a=r.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=mNt(n,i,a,s);return o.attr("style",e.style),fNt(e,o),e.intersect=function(t){return pNt.polygon(e,s,t)},n}),"subroutine"),UNt=s(((t,e)=>{const n=t.insert("g").attr("class","node default").attr("id",e.domId||e.id),r=n.insert("circle",":first-child");return r.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),fNt(e,r),e.intersect=function(t){return pNt.circle(e,7,t)},n}),"start"),GNt=s(((t,e,n)=>{const r=t.insert("g").attr("class","node default").attr("id",e.domId||e.id);let i=70,a=10;"LR"===n&&(i=10,a=70);const s=r.append("rect").attr("x",-1*i/2).attr("y",-1*a/2).attr("width",i).attr("height",a).attr("class","fork-join");return fNt(e,s),e.height=e.height+e.padding/2,e.width=e.width+e.padding/2,e.intersect=function(t){return pNt.rect(e,t)},r}),"forkJoin"),qNt=s(((t,e)=>{const n=t.insert("g").attr("class","node default").attr("id",e.domId||e.id),r=n.insert("circle",":first-child"),i=n.insert("circle",":first-child");return i.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),r.attr("class","state-end").attr("r",5).attr("width",10).attr("height",10),fNt(e,i),e.intersect=function(t){return pNt.circle(e,7,t)},n}),"end"),jNt=s(((t,e)=>{const n=e.padding/2;let r;r=e.classes?"node "+e.classes:"node default";const i=t.insert("g").attr("class",r).attr("id",e.domId||e.id),a=i.insert("rect",":first-child"),s=i.insert("line"),o=i.insert("line");let l=0,c=4;const h=i.insert("g").attr("class","label");let u=0;const d=e.classData.annotations?.[0],p=e.classData.annotations[0]?"«"+e.classData.annotations[0]+"»":"",g=h.node().appendChild(zLt(p,e.labelStyle,!0,!0));let f=g.getBBox();if(dn(Hn().flowchart.htmlLabels)){const t=g.children[0],e=Oa(g);f=t.getBoundingClientRect(),e.attr("width",f.width),e.attr("height",f.height)}e.classData.annotations[0]&&(c+=f.height+4,l+=f.width);let m=e.classData.label;void 0!==e.classData.type&&""!==e.classData.type&&(Hn().flowchart.htmlLabels?m+="&lt;"+e.classData.type+"&gt;":m+="<"+e.classData.type+">");const y=h.node().appendChild(zLt(m,e.labelStyle,!0,!0));Oa(y).attr("class","classTitle");let v=y.getBBox();if(dn(Hn().flowchart.htmlLabels)){const t=y.children[0],e=Oa(y);v=t.getBoundingClientRect(),e.attr("width",v.width),e.attr("height",v.height)}c+=v.height+4,v.width>l&&(l=v.width);const x=[];e.classData.members.forEach((t=>{const n=t.getDisplayDetails();let r=n.displayText;Hn().flowchart.htmlLabels&&(r=r.replace(/</g,"&lt;").replace(/>/g,"&gt;"));const i=h.node().appendChild(zLt(r,n.cssStyle?n.cssStyle:e.labelStyle,!0,!0));let a=i.getBBox();if(dn(Hn().flowchart.htmlLabels)){const t=i.children[0],e=Oa(i);a=t.getBoundingClientRect(),e.attr("width",a.width),e.attr("height",a.height)}a.width>l&&(l=a.width),c+=a.height+4,x.push(i)})),c+=8;const b=[];if(e.classData.methods.forEach((t=>{const n=t.getDisplayDetails();let r=n.displayText;Hn().flowchart.htmlLabels&&(r=r.replace(/</g,"&lt;").replace(/>/g,"&gt;"));const i=h.node().appendChild(zLt(r,n.cssStyle?n.cssStyle:e.labelStyle,!0,!0));let a=i.getBBox();if(dn(Hn().flowchart.htmlLabels)){const t=i.children[0],e=Oa(i);a=t.getBoundingClientRect(),e.attr("width",a.width),e.attr("height",a.height)}a.width>l&&(l=a.width),c+=a.height+4,b.push(i)})),c+=8,d){let t=(l-f.width)/2;Oa(g).attr("transform","translate( "+(-1*l/2+t)+", "+-1*c/2+")"),u=f.height+4}let w=(l-v.width)/2;return Oa(y).attr("transform","translate( "+(-1*l/2+w)+", "+(-1*c/2+u)+")"),u+=v.height+4,s.attr("class","divider").attr("x1",-l/2-n).attr("x2",l/2+n).attr("y1",-c/2-n+8+u).attr("y2",-c/2-n+8+u),u+=8,x.forEach((t=>{Oa(t).attr("transform","translate( "+-l/2+", "+(-1*c/2+u+4)+")");const e=t?.getBBox();u+=(e?.height??0)+4})),u+=8,o.attr("class","divider").attr("x1",-l/2-n).attr("x2",l/2+n).attr("y1",-c/2-n+8+u).attr("y2",-c/2-n+8+u),u+=8,b.forEach((t=>{Oa(t).attr("transform","translate( "+-l/2+", "+(-1*c/2+u)+")");const e=t?.getBBox();u+=(e?.height??0)+4})),a.attr("style",e.style).attr("class","outer title-state").attr("x",-l/2-n).attr("y",-c/2-n).attr("width",l+e.padding).attr("height",c+e.padding),fNt(e,a),e.intersect=function(t){return pNt.rect(e,t)},i}),"class_box"),YNt={rhombus:wNt,composite:RNt,question:wNt,rect:MNt,labelRect:DNt,rectWithTitle:PNt,choice:kNt,circle:$Nt,doublecircle:FNt,stadium:BNt,hexagon:TNt,block_arrow:_Nt,rect_left_inv_arrow:ENt,lean_right:CNt,lean_left:SNt,trapezoid:ANt,inv_trapezoid:LNt,rect_right_inv_arrow:NNt,cylinder:INt,start:UNt,end:qNt,note:vNt,subroutine:zNt,fork:GNt,join:GNt,class_box:jNt},WNt={},HNt=s((async(t,e,n)=>{let r,i;if(e.link){let a;"sandbox"===Hn().securityLevel?a="_top":e.linkTarget&&(a=e.linkTarget||"_blank"),r=t.insert("svg:a").attr("xlink:href",e.link).attr("target",a),i=await YNt[e.shape](r,e,n)}else i=await YNt[e.shape](t,e,n),r=i;return e.tooltip&&i.attr("title",e.tooltip),e.class&&i.attr("class","node default "+e.class),WNt[e.id]=r,e.haveCallback&&WNt[e.id].attr("class",WNt[e.id].attr("class")+" clickable"),r}),"insertNode"),VNt=s((t=>{const e=WNt[t.id];m.trace("Transforming node",t.diff,t,"translate("+(t.x-t.width/2-5)+", "+t.width/2+")");const n=t.diff||0;return t.clusterNode?e.attr("transform","translate("+(t.x+n-t.width/2)+", "+(t.y-t.height/2-8)+")"):e.attr("transform","translate("+t.x+", "+t.y+")"),n}),"positionNode");function XNt(t,e,n=!1){const r=t;let i="default";(r?.classes?.length||0)>0&&(i=(r?.classes??[]).join(" ")),i+=" flowchart-label";let a,s=0,o="";switch(r.type){case"round":s=5,o="rect";break;case"composite":s=0,o="composite",a=0;break;case"square":case"group":default:o="rect";break;case"diamond":o="question";break;case"hexagon":o="hexagon";break;case"block_arrow":o="block_arrow";break;case"odd":case"rect_left_inv_arrow":o="rect_left_inv_arrow";break;case"lean_right":o="lean_right";break;case"lean_left":o="lean_left";break;case"trapezoid":o="trapezoid";break;case"inv_trapezoid":o="inv_trapezoid";break;case"circle":o="circle";break;case"ellipse":o="ellipse";break;case"stadium":o="stadium";break;case"subroutine":o="subroutine";break;case"cylinder":o="cylinder";break;case"doublecircle":o="doublecircle"}const l=Qw(r?.styles??[]),c=r.label,h=r.size??{width:0,height:0,x:0,y:0};return{labelStyle:l.labelStyle,shape:o,labelText:c,rx:s,ry:s,class:i,style:l.style,id:r.id,directions:r.directions,width:h.width,height:h.height,x:h.x,y:h.y,positioned:n,intersect:void 0,type:r.type,padding:a??Ft()?.block?.padding??0}}async function KNt(t,e,n){const r=XNt(e,0,!1);if("group"===r.type)return;const i=Ft(),a=await HNt(t,r,{config:i}),s=a.node().getBBox(),o=n.getBlock(r.id);o.size={width:s.width,height:s.height,x:0,y:0,node:a},n.setBlock(o),a.remove()}async function ZNt(t,e,n){const r=XNt(e,0,!0);if("space"!==n.getBlock(r.id).type){const n=Ft();await HNt(t,r,{config:n}),e.intersect=r?.intersect,VNt(r)}}async function QNt(t,e,n,r){for(const i of e)await r(t,i,n),i.children&&await QNt(t,i.children,n,r)}async function JNt(t,e,n){await QNt(t,e,n,KNt)}async function tIt(t,e,n){await QNt(t,e,n,ZNt)}async function eIt(t,e,n,r,i){const a=new nq({multigraph:!0,compound:!0});a.setGraph({rankdir:"TB",nodesep:10,ranksep:10,marginx:8,marginy:8});for(const t of n)t.size&&a.setNode(t.id,{width:t.size.width,height:t.size.height,intersect:t.intersect});for(const n of e)if(n.start&&n.end){const e=r.getBlock(n.start),s=r.getBlock(n.end);if(e?.size&&s?.size){const r=e.size,o=s.size,l=[{x:r.x,y:r.y},{x:r.x+(o.x-r.x)/2,y:r.y+(o.y-r.y)/2},{x:o.x,y:o.y}];QLt(t,{v:n.start,w:n.end,name:n.id},{...n,arrowTypeEnd:n.arrowTypeEnd,arrowTypeStart:n.arrowTypeStart,points:l,classes:"edge-thickness-normal edge-pattern-solid flowchart-link LS-a1 LE-b1"},void 0,"block",a,i),n.label&&(await WLt(t,{...n,label:n.label,labelStyle:"stroke: #333; stroke-width: 1.5px;fill:none;",arrowTypeEnd:n.arrowTypeEnd,arrowTypeStart:n.arrowTypeStart,points:l,classes:"edge-thickness-normal edge-pattern-solid flowchart-link LS-a1 LE-b1"}),VLt({...n,x:l[1].x,y:l[1].y},{originalPath:l}))}}}s(XNt,"getNodeFromBlock"),s(KNt,"calculateBlockSize"),s(ZNt,"insertBlockPositioned"),s(QNt,"performOperations"),s(JNt,"calculateBlockSizes"),s(tIt,"insertBlocks"),s(eIt,"insertEdges");var nIt=s((function(t,e){return e.db.getClasses()}),"getClasses"),rIt=s((async function(t,e,n,r){const{securityLevel:i,block:a}=Ft(),s=r.db;let o;"sandbox"===i&&(o=Oa("#i"+e));const l=Oa("sandbox"===i?o.nodes()[0].contentDocument.body:"body"),c="sandbox"===i?l.select(`[id="${e}"]`):Oa(`[id="${e}"]`);NLt(c,["point","circle","cross"],r.type,e);const h=s.getBlocks(),u=s.getBlocksFlat(),d=s.getEdges(),p=c.insert("g").attr("class","block");await JNt(p,h,s);const g=BLt(s);if(await tIt(p,h,s),await eIt(p,d,u,s,e),g){const t=g,e=Math.max(1,Math.round(t.width/t.height*.125)),n=t.height+e+10,r=t.width+10,{useMaxWidth:i}=a;Sn(c,n,r,!!i),m.debug("Here Bounds",g,t),c.attr("viewBox",`${t.x-5} ${t.y-5} ${t.width+10} ${t.height+10}`)}}),"draw"),iIt={parser:GAt,db:mLt,renderer:{draw:rIt,getClasses:nIt},styles:vLt},aIt=Object.freeze({__proto__:null,diagram:iIt}),sIt=o({"../../node_modules/.pnpm/layout-base@2.0.1/node_modules/layout-base/layout-base.js"(t,e){s((function(n,r){"object"==typeof t&&"object"==typeof e?e.exports=r():"function"==typeof define&&define.amd?define([],r):"object"==typeof t?t.layoutBase=r():n.layoutBase=r()}),"webpackUniversalModuleDefinition")(t,(function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return s(n,"__webpack_require__"),n.m=t,n.c=e,n.i=function(t){return t},n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:r})},n.n=function(t){var e=t&&t.__esModule?s((function(){return t.default}),"getDefault"):s((function(){return t}),"getModuleExports");return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=28)}([function(t,e,n){function r(){}s(r,"LayoutConstants"),r.QUALITY=1,r.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,r.DEFAULT_INCREMENTAL=!1,r.DEFAULT_ANIMATION_ON_LAYOUT=!0,r.DEFAULT_ANIMATION_DURING_LAYOUT=!1,r.DEFAULT_ANIMATION_PERIOD=50,r.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,r.DEFAULT_GRAPH_MARGIN=15,r.NODE_DIMENSIONS_INCLUDE_LABELS=!1,r.SIMPLE_NODE_SIZE=40,r.SIMPLE_NODE_HALF_SIZE=r.SIMPLE_NODE_SIZE/2,r.EMPTY_COMPOUND_NODE_SIZE=40,r.MIN_EDGE_LENGTH=1,r.WORLD_BOUNDARY=1e6,r.INITIAL_WORLD_BOUNDARY=r.WORLD_BOUNDARY/1e3,r.WORLD_CENTER_X=1200,r.WORLD_CENTER_Y=900,t.exports=r},function(t,e,n){var r=n(2),i=n(8),a=n(9);function o(t,e,n){r.call(this,n),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=n,this.bendpoints=[],this.source=t,this.target=e}for(var l in s(o,"LEdge"),o.prototype=Object.create(r.prototype),r)o[l]=r[l];o.prototype.getSource=function(){return this.source},o.prototype.getTarget=function(){return this.target},o.prototype.isInterGraph=function(){return this.isInterGraph},o.prototype.getLength=function(){return this.length},o.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},o.prototype.getBendpoints=function(){return this.bendpoints},o.prototype.getLca=function(){return this.lca},o.prototype.getSourceInLca=function(){return this.sourceInLca},o.prototype.getTargetInLca=function(){return this.targetInLca},o.prototype.getOtherEnd=function(t){if(this.source===t)return this.target;if(this.target===t)return this.source;throw"Node is not incident with this edge"},o.prototype.getOtherEndInGraph=function(t,e){for(var n=this.getOtherEnd(t),r=e.getGraphManager().getRoot();;){if(n.getOwner()==e)return n;if(n.getOwner()==r)break;n=n.getOwner().getParent()}return null},o.prototype.updateLength=function(){var t=new Array(4);this.isOverlapingSourceAndTarget=i.getIntersection(this.target.getRect(),this.source.getRect(),t),this.isOverlapingSourceAndTarget||(this.lengthX=t[0]-t[2],this.lengthY=t[1]-t[3],Math.abs(this.lengthX)<1&&(this.lengthX=a.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=a.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},o.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=a.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=a.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},t.exports=o},function(t,e,n){function r(t){this.vGraphObject=t}s(r,"LGraphObject"),t.exports=r},function(t,e,n){var r=n(2),i=n(10),a=n(13),o=n(0),l=n(16),c=n(5);function h(t,e,n,s){null==n&&null==s&&(s=e),r.call(this,s),null!=t.graphManager&&(t=t.graphManager),this.estimatedSize=i.MIN_VALUE,this.inclusionTreeDepth=i.MAX_VALUE,this.vGraphObject=s,this.edges=[],this.graphManager=t,this.rect=null!=n&&null!=e?new a(e.x,e.y,n.width,n.height):new a}for(var u in s(h,"LNode"),h.prototype=Object.create(r.prototype),r)h[u]=r[u];h.prototype.getEdges=function(){return this.edges},h.prototype.getChild=function(){return this.child},h.prototype.getOwner=function(){return this.owner},h.prototype.getWidth=function(){return this.rect.width},h.prototype.setWidth=function(t){this.rect.width=t},h.prototype.getHeight=function(){return this.rect.height},h.prototype.setHeight=function(t){this.rect.height=t},h.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},h.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},h.prototype.getCenter=function(){return new c(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},h.prototype.getLocation=function(){return new c(this.rect.x,this.rect.y)},h.prototype.getRect=function(){return this.rect},h.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},h.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},h.prototype.setRect=function(t,e){this.rect.x=t.x,this.rect.y=t.y,this.rect.width=e.width,this.rect.height=e.height},h.prototype.setCenter=function(t,e){this.rect.x=t-this.rect.width/2,this.rect.y=e-this.rect.height/2},h.prototype.setLocation=function(t,e){this.rect.x=t,this.rect.y=e},h.prototype.moveBy=function(t,e){this.rect.x+=t,this.rect.y+=e},h.prototype.getEdgeListToNode=function(t){var e=[],n=this;return n.edges.forEach((function(r){if(r.target==t){if(r.source!=n)throw"Incorrect edge source!";e.push(r)}})),e},h.prototype.getEdgesBetween=function(t){var e=[],n=this;return n.edges.forEach((function(r){if(r.source!=n&&r.target!=n)throw"Incorrect edge source and/or target";r.target!=t&&r.source!=t||e.push(r)})),e},h.prototype.getNeighborsList=function(){var t=new Set,e=this;return e.edges.forEach((function(n){if(n.source==e)t.add(n.target);else{if(n.target!=e)throw"Incorrect incidency!";t.add(n.source)}})),t},h.prototype.withChildren=function(){var t=new Set;if(t.add(this),null!=this.child)for(var e=this.child.getNodes(),n=0;n<e.length;n++)e[n].withChildren().forEach((function(e){t.add(e)}));return t},h.prototype.getNoOfChildren=function(){var t=0;if(null==this.child)t=1;else for(var e=this.child.getNodes(),n=0;n<e.length;n++)t+=e[n].getNoOfChildren();return 0==t&&(t=1),t},h.prototype.getEstimatedSize=function(){if(this.estimatedSize==i.MIN_VALUE)throw"assert failed";return this.estimatedSize},h.prototype.calcEstimatedSize=function(){return null==this.child?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)},h.prototype.scatter=function(){var t,e,n=-o.INITIAL_WORLD_BOUNDARY,r=o.INITIAL_WORLD_BOUNDARY;t=o.WORLD_CENTER_X+l.nextDouble()*(r-n)+n;var i=-o.INITIAL_WORLD_BOUNDARY,a=o.INITIAL_WORLD_BOUNDARY;e=o.WORLD_CENTER_Y+l.nextDouble()*(a-i)+i,this.rect.x=t,this.rect.y=e},h.prototype.updateBounds=function(){if(null==this.getChild())throw"assert failed";if(0!=this.getChild().getNodes().length){var t=this.getChild();if(t.updateBounds(!0),this.rect.x=t.getLeft(),this.rect.y=t.getTop(),this.setWidth(t.getRight()-t.getLeft()),this.setHeight(t.getBottom()-t.getTop()),o.NODE_DIMENSIONS_INCLUDE_LABELS){var e=t.getRight()-t.getLeft(),n=t.getBottom()-t.getTop();this.labelWidth&&("left"==this.labelPosHorizontal?(this.rect.x-=this.labelWidth,this.setWidth(e+this.labelWidth)):"center"==this.labelPosHorizontal&&this.labelWidth>e?(this.rect.x-=(this.labelWidth-e)/2,this.setWidth(this.labelWidth)):"right"==this.labelPosHorizontal&&this.setWidth(e+this.labelWidth)),this.labelHeight&&("top"==this.labelPosVertical?(this.rect.y-=this.labelHeight,this.setHeight(n+this.labelHeight)):"center"==this.labelPosVertical&&this.labelHeight>n?(this.rect.y-=(this.labelHeight-n)/2,this.setHeight(this.labelHeight)):"bottom"==this.labelPosVertical&&this.setHeight(n+this.labelHeight))}}},h.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==i.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},h.prototype.transform=function(t){var e=this.rect.x;e>o.WORLD_BOUNDARY?e=o.WORLD_BOUNDARY:e<-o.WORLD_BOUNDARY&&(e=-o.WORLD_BOUNDARY);var n=this.rect.y;n>o.WORLD_BOUNDARY?n=o.WORLD_BOUNDARY:n<-o.WORLD_BOUNDARY&&(n=-o.WORLD_BOUNDARY);var r=new c(e,n),i=t.inverseTransformPoint(r);this.setLocation(i.x,i.y)},h.prototype.getLeft=function(){return this.rect.x},h.prototype.getRight=function(){return this.rect.x+this.rect.width},h.prototype.getTop=function(){return this.rect.y},h.prototype.getBottom=function(){return this.rect.y+this.rect.height},h.prototype.getParent=function(){return null==this.owner?null:this.owner.getParent()},t.exports=h},function(t,e,n){var r=n(0);function i(){}for(var a in s(i,"FDLayoutConstants"),r)i[a]=r[a];i.MAX_ITERATIONS=2500,i.DEFAULT_EDGE_LENGTH=50,i.DEFAULT_SPRING_STRENGTH=.45,i.DEFAULT_REPULSION_STRENGTH=4500,i.DEFAULT_GRAVITY_STRENGTH=.4,i.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,i.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,i.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,i.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,i.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,i.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,i.COOLING_ADAPTATION_FACTOR=.33,i.ADAPTATION_LOWER_NODE_LIMIT=1e3,i.ADAPTATION_UPPER_NODE_LIMIT=5e3,i.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,i.MAX_NODE_DISPLACEMENT=3*i.MAX_NODE_DISPLACEMENT_INCREMENTAL,i.MIN_REPULSION_DIST=i.DEFAULT_EDGE_LENGTH/10,i.CONVERGENCE_CHECK_PERIOD=100,i.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,i.MIN_EDGE_LENGTH=1,i.GRID_CALCULATION_CHECK_PERIOD=10,t.exports=i},function(t,e,n){function r(t,e){null==t&&null==e?(this.x=0,this.y=0):(this.x=t,this.y=e)}s(r,"PointD"),r.prototype.getX=function(){return this.x},r.prototype.getY=function(){return this.y},r.prototype.setX=function(t){this.x=t},r.prototype.setY=function(t){this.y=t},r.prototype.getDifference=function(t){return new DimensionD(this.x-t.x,this.y-t.y)},r.prototype.getCopy=function(){return new r(this.x,this.y)},r.prototype.translate=function(t){return this.x+=t.width,this.y+=t.height,this},t.exports=r},function(t,e,n){var r=n(2),i=n(10),a=n(0),o=n(7),l=n(3),c=n(1),h=n(13),u=n(12),d=n(11);function p(t,e,n){r.call(this,n),this.estimatedSize=i.MIN_VALUE,this.margin=a.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=t,null!=e&&e instanceof o?this.graphManager=e:null!=e&&e instanceof Layout&&(this.graphManager=e.graphManager)}for(var g in s(p,"LGraph"),p.prototype=Object.create(r.prototype),r)p[g]=r[g];p.prototype.getNodes=function(){return this.nodes},p.prototype.getEdges=function(){return this.edges},p.prototype.getGraphManager=function(){return this.graphManager},p.prototype.getParent=function(){return this.parent},p.prototype.getLeft=function(){return this.left},p.prototype.getRight=function(){return this.right},p.prototype.getTop=function(){return this.top},p.prototype.getBottom=function(){return this.bottom},p.prototype.isConnected=function(){return this.isConnected},p.prototype.add=function(t,e,n){if(null==e&&null==n){var r=t;if(null==this.graphManager)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(r)>-1)throw"Node already in graph!";return r.owner=this,this.getNodes().push(r),r}var i=t;if(!(this.getNodes().indexOf(e)>-1&&this.getNodes().indexOf(n)>-1))throw"Source or target not in graph!";if(e.owner!=n.owner||e.owner!=this)throw"Both owners must be this graph!";return e.owner!=n.owner?null:(i.source=e,i.target=n,i.isInterGraph=!1,this.getEdges().push(i),e.edges.push(i),n!=e&&n.edges.push(i),i)},p.prototype.remove=function(t){var e=t;if(t instanceof l){if(null==e)throw"Node is null!";if(null==e.owner||e.owner!=this)throw"Owner graph is invalid!";if(null==this.graphManager)throw"Owner graph manager is invalid!";for(var n=e.edges.slice(),r=n.length,i=0;i<r;i++)(a=n[i]).isInterGraph?this.graphManager.remove(a):a.source.owner.remove(a);if(-1==(s=this.nodes.indexOf(e)))throw"Node not in owner node list!";this.nodes.splice(s,1)}else if(t instanceof c){var a;if(null==(a=t))throw"Edge is null!";if(null==a.source||null==a.target)throw"Source and/or target is null!";if(null==a.source.owner||null==a.target.owner||a.source.owner!=this||a.target.owner!=this)throw"Source and/or target owner is invalid!";var s,o=a.source.edges.indexOf(a),h=a.target.edges.indexOf(a);if(!(o>-1&&h>-1))throw"Source and/or target doesn't know this edge!";if(a.source.edges.splice(o,1),a.target!=a.source&&a.target.edges.splice(h,1),-1==(s=a.source.owner.getEdges().indexOf(a)))throw"Not in owner's edge list!";a.source.owner.getEdges().splice(s,1)}},p.prototype.updateLeftTop=function(){for(var t,e,n,r=i.MAX_VALUE,a=i.MAX_VALUE,s=this.getNodes(),o=s.length,l=0;l<o;l++){var c=s[l];r>(t=c.getTop())&&(r=t),a>(e=c.getLeft())&&(a=e)}return r==i.MAX_VALUE?null:(n=null!=s[0].getParent().paddingLeft?s[0].getParent().paddingLeft:this.margin,this.left=a-n,this.top=r-n,new u(this.left,this.top))},p.prototype.updateBounds=function(t){for(var e,n,r,a,s,o=i.MAX_VALUE,l=-i.MAX_VALUE,c=i.MAX_VALUE,u=-i.MAX_VALUE,d=this.nodes,p=d.length,g=0;g<p;g++){var f=d[g];t&&null!=f.child&&f.updateBounds(),o>(e=f.getLeft())&&(o=e),l<(n=f.getRight())&&(l=n),c>(r=f.getTop())&&(c=r),u<(a=f.getBottom())&&(u=a)}var m=new h(o,c,l-o,u-c);o==i.MAX_VALUE&&(this.left=this.parent.getLeft(),this.right=this.parent.getRight(),this.top=this.parent.getTop(),this.bottom=this.parent.getBottom()),s=null!=d[0].getParent().paddingLeft?d[0].getParent().paddingLeft:this.margin,this.left=m.x-s,this.right=m.x+m.width+s,this.top=m.y-s,this.bottom=m.y+m.height+s},p.calculateBounds=function(t){for(var e,n,r,a,s=i.MAX_VALUE,o=-i.MAX_VALUE,l=i.MAX_VALUE,c=-i.MAX_VALUE,u=t.length,d=0;d<u;d++){var p=t[d];s>(e=p.getLeft())&&(s=e),o<(n=p.getRight())&&(o=n),l>(r=p.getTop())&&(l=r),c<(a=p.getBottom())&&(c=a)}return new h(s,l,o-s,c-l)},p.prototype.getInclusionTreeDepth=function(){return this==this.graphManager.getRoot()?1:this.parent.getInclusionTreeDepth()},p.prototype.getEstimatedSize=function(){if(this.estimatedSize==i.MIN_VALUE)throw"assert failed";return this.estimatedSize},p.prototype.calcEstimatedSize=function(){for(var t=0,e=this.nodes,n=e.length,r=0;r<n;r++){t+=e[r].calcEstimatedSize()}return this.estimatedSize=0==t?a.EMPTY_COMPOUND_NODE_SIZE:t/Math.sqrt(this.nodes.length),this.estimatedSize},p.prototype.updateConnected=function(){var t=this;if(0!=this.nodes.length){var e,n,r=new d,i=new Set,a=this.nodes[0];for(a.withChildren().forEach((function(t){r.push(t),i.add(t)}));0!==r.length;)for(var s=(e=(a=r.shift()).getEdges()).length,o=0;o<s;o++){if(null!=(n=e[o].getOtherEndInGraph(a,this))&&!i.has(n))n.withChildren().forEach((function(t){r.push(t),i.add(t)}))}if(this.isConnected=!1,i.size>=this.nodes.length){var l=0;i.forEach((function(e){e.owner==t&&l++})),l==this.nodes.length&&(this.isConnected=!0)}}else this.isConnected=!0},t.exports=p},function(t,e,n){var r,i=n(1);function a(t){r=n(6),this.layout=t,this.graphs=[],this.edges=[]}s(a,"LGraphManager"),a.prototype.addRoot=function(){var t=this.layout.newGraph(),e=this.layout.newNode(null),n=this.add(t,e);return this.setRootGraph(n),this.rootGraph},a.prototype.add=function(t,e,n,r,i){if(null==n&&null==r&&null==i){if(null==t)throw"Graph is null!";if(null==e)throw"Parent node is null!";if(this.graphs.indexOf(t)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(t),null!=t.parent)throw"Already has a parent!";if(null!=e.child)throw"Already has a child!";return t.parent=e,e.child=t,t}i=n,n=t;var a=(r=e).getOwner(),s=i.getOwner();if(null==a||a.getGraphManager()!=this)throw"Source not in this graph mgr!";if(null==s||s.getGraphManager()!=this)throw"Target not in this graph mgr!";if(a==s)return n.isInterGraph=!1,a.add(n,r,i);if(n.isInterGraph=!0,n.source=r,n.target=i,this.edges.indexOf(n)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(n),null==n.source||null==n.target)throw"Edge source and/or target is null!";if(-1!=n.source.edges.indexOf(n)||-1!=n.target.edges.indexOf(n))throw"Edge already in source and/or target incidency list!";return n.source.edges.push(n),n.target.edges.push(n),n},a.prototype.remove=function(t){if(t instanceof r){var e=t;if(e.getGraphManager()!=this)throw"Graph not in this graph mgr";if(e!=this.rootGraph&&(null==e.parent||e.parent.graphManager!=this))throw"Invalid parent node!";for(var n,a=[],s=(a=a.concat(e.getEdges())).length,o=0;o<s;o++)n=a[o],e.remove(n);var l,c=[];s=(c=c.concat(e.getNodes())).length;for(o=0;o<s;o++)l=c[o],e.remove(l);e==this.rootGraph&&this.setRootGraph(null);var h=this.graphs.indexOf(e);this.graphs.splice(h,1),e.parent=null}else if(t instanceof i){if(null==(n=t))throw"Edge is null!";if(!n.isInterGraph)throw"Not an inter-graph edge!";if(null==n.source||null==n.target)throw"Source and/or target is null!";if(-1==n.source.edges.indexOf(n)||-1==n.target.edges.indexOf(n))throw"Source and/or target doesn't know this edge!";h=n.source.edges.indexOf(n);if(n.source.edges.splice(h,1),h=n.target.edges.indexOf(n),n.target.edges.splice(h,1),null==n.source.owner||null==n.source.owner.getGraphManager())throw"Edge owner graph or owner graph manager is null!";if(-1==n.source.owner.getGraphManager().edges.indexOf(n))throw"Not in owner graph manager's edge list!";h=n.source.owner.getGraphManager().edges.indexOf(n);n.source.owner.getGraphManager().edges.splice(h,1)}},a.prototype.updateBounds=function(){this.rootGraph.updateBounds(!0)},a.prototype.getGraphs=function(){return this.graphs},a.prototype.getAllNodes=function(){if(null==this.allNodes){for(var t=[],e=this.getGraphs(),n=e.length,r=0;r<n;r++)t=t.concat(e[r].getNodes());this.allNodes=t}return this.allNodes},a.prototype.resetAllNodes=function(){this.allNodes=null},a.prototype.resetAllEdges=function(){this.allEdges=null},a.prototype.resetAllNodesToApplyGravitation=function(){this.allNodesToApplyGravitation=null},a.prototype.getAllEdges=function(){if(null==this.allEdges){var t=[],e=this.getGraphs();e.length;for(var n=0;n<e.length;n++)t=t.concat(e[n].getEdges());t=t.concat(this.edges),this.allEdges=t}return this.allEdges},a.prototype.getAllNodesToApplyGravitation=function(){return this.allNodesToApplyGravitation},a.prototype.setAllNodesToApplyGravitation=function(t){if(null!=this.allNodesToApplyGravitation)throw"assert failed";this.allNodesToApplyGravitation=t},a.prototype.getRoot=function(){return this.rootGraph},a.prototype.setRootGraph=function(t){if(t.getGraphManager()!=this)throw"Root not in this graph mgr!";this.rootGraph=t,null==t.parent&&(t.parent=this.layout.newNode("Root node"))},a.prototype.getLayout=function(){return this.layout},a.prototype.isOneAncestorOfOther=function(t,e){if(null==t||null==e)throw"assert failed";if(t==e)return!0;for(var n,r=t.getOwner();;){if(null==(n=r.getParent()))break;if(n==e)return!0;if(null==(r=n.getOwner()))break}for(r=e.getOwner();;){if(null==(n=r.getParent()))break;if(n==t)return!0;if(null==(r=n.getOwner()))break}return!1},a.prototype.calcLowestCommonAncestors=function(){for(var t,e,n,r,i,a=this.getAllEdges(),s=a.length,o=0;o<s;o++)if(e=(t=a[o]).source,n=t.target,t.lca=null,t.sourceInLca=e,t.targetInLca=n,e!=n){for(r=e.getOwner();null==t.lca;){for(t.targetInLca=n,i=n.getOwner();null==t.lca;){if(i==r){t.lca=i;break}if(i==this.rootGraph)break;if(null!=t.lca)throw"assert failed";t.targetInLca=i.getParent(),i=t.targetInLca.getOwner()}if(r==this.rootGraph)break;null==t.lca&&(t.sourceInLca=r.getParent(),r=t.sourceInLca.getOwner())}if(null==t.lca)throw"assert failed"}else t.lca=e.getOwner()},a.prototype.calcLowestCommonAncestor=function(t,e){if(t==e)return t.getOwner();for(var n=t.getOwner();;){if(null==n)break;for(var r=e.getOwner();;){if(null==r)break;if(r==n)return r;r=r.getParent().getOwner()}n=n.getParent().getOwner()}return n},a.prototype.calcInclusionTreeDepths=function(t,e){var n;null==t&&null==e&&(t=this.rootGraph,e=1);for(var r=t.getNodes(),i=r.length,a=0;a<i;a++)(n=r[a]).inclusionTreeDepth=e,null!=n.child&&this.calcInclusionTreeDepths(n.child,e+1)},a.prototype.includesInvalidEdge=function(){for(var t,e=[],n=this.edges.length,r=0;r<n;r++)t=this.edges[r],this.isOneAncestorOfOther(t.source,t.target)&&e.push(t);for(r=0;r<e.length;r++)this.remove(e[r]);return!1},t.exports=a},function(t,e,n){var r=n(12);function i(){}s(i,"IGeometry"),i.calcSeparationAmount=function(t,e,n,r){if(!t.intersects(e))throw"assert failed";var i=new Array(2);this.decideDirectionsForOverlappingNodes(t,e,i),n[0]=Math.min(t.getRight(),e.getRight())-Math.max(t.x,e.x),n[1]=Math.min(t.getBottom(),e.getBottom())-Math.max(t.y,e.y),t.getX()<=e.getX()&&t.getRight()>=e.getRight()?n[0]+=Math.min(e.getX()-t.getX(),t.getRight()-e.getRight()):e.getX()<=t.getX()&&e.getRight()>=t.getRight()&&(n[0]+=Math.min(t.getX()-e.getX(),e.getRight()-t.getRight())),t.getY()<=e.getY()&&t.getBottom()>=e.getBottom()?n[1]+=Math.min(e.getY()-t.getY(),t.getBottom()-e.getBottom()):e.getY()<=t.getY()&&e.getBottom()>=t.getBottom()&&(n[1]+=Math.min(t.getY()-e.getY(),e.getBottom()-t.getBottom()));var a=Math.abs((e.getCenterY()-t.getCenterY())/(e.getCenterX()-t.getCenterX()));e.getCenterY()===t.getCenterY()&&e.getCenterX()===t.getCenterX()&&(a=1);var s=a*n[0],o=n[1]/a;n[0]<o?o=n[0]:s=n[1],n[0]=-1*i[0]*(o/2+r),n[1]=-1*i[1]*(s/2+r)},i.decideDirectionsForOverlappingNodes=function(t,e,n){t.getCenterX()<e.getCenterX()?n[0]=-1:n[0]=1,t.getCenterY()<e.getCenterY()?n[1]=-1:n[1]=1},i.getIntersection2=function(t,e,n){var r=t.getCenterX(),i=t.getCenterY(),a=e.getCenterX(),s=e.getCenterY();if(t.intersects(e))return n[0]=r,n[1]=i,n[2]=a,n[3]=s,!0;var o=t.getX(),l=t.getY(),c=t.getRight(),h=t.getX(),u=t.getBottom(),d=t.getRight(),p=t.getWidthHalf(),g=t.getHeightHalf(),f=e.getX(),m=e.getY(),y=e.getRight(),v=e.getX(),x=e.getBottom(),b=e.getRight(),w=e.getWidthHalf(),k=e.getHeightHalf(),T=!1,_=!1;if(r===a){if(i>s)return n[0]=r,n[1]=l,n[2]=a,n[3]=x,!1;if(i<s)return n[0]=r,n[1]=u,n[2]=a,n[3]=m,!1}else if(i===s){if(r>a)return n[0]=o,n[1]=i,n[2]=y,n[3]=s,!1;if(r<a)return n[0]=c,n[1]=i,n[2]=f,n[3]=s,!1}else{var E=t.height/t.width,C=e.height/e.width,S=(s-i)/(a-r),A=void 0,L=void 0,N=void 0,I=void 0,M=void 0,R=void 0;if(-E===S?r>a?(n[0]=h,n[1]=u,T=!0):(n[0]=c,n[1]=l,T=!0):E===S&&(r>a?(n[0]=o,n[1]=l,T=!0):(n[0]=d,n[1]=u,T=!0)),-C===S?a>r?(n[2]=v,n[3]=x,_=!0):(n[2]=y,n[3]=m,_=!0):C===S&&(a>r?(n[2]=f,n[3]=m,_=!0):(n[2]=b,n[3]=x,_=!0)),T&&_)return!1;if(r>a?i>s?(A=this.getCardinalDirection(E,S,4),L=this.getCardinalDirection(C,S,2)):(A=this.getCardinalDirection(-E,S,3),L=this.getCardinalDirection(-C,S,1)):i>s?(A=this.getCardinalDirection(-E,S,1),L=this.getCardinalDirection(-C,S,3)):(A=this.getCardinalDirection(E,S,2),L=this.getCardinalDirection(C,S,4)),!T)switch(A){case 1:I=l,N=r+-g/S,n[0]=N,n[1]=I;break;case 2:N=d,I=i+p*S,n[0]=N,n[1]=I;break;case 3:I=u,N=r+g/S,n[0]=N,n[1]=I;break;case 4:N=h,I=i+-p*S,n[0]=N,n[1]=I}if(!_)switch(L){case 1:R=m,M=a+-k/S,n[2]=M,n[3]=R;break;case 2:M=b,R=s+w*S,n[2]=M,n[3]=R;break;case 3:R=x,M=a+k/S,n[2]=M,n[3]=R;break;case 4:M=v,R=s+-w*S,n[2]=M,n[3]=R}}return!1},i.getCardinalDirection=function(t,e,n){return t>e?n:1+n%4},i.getIntersection=function(t,e,n,i){if(null==i)return this.getIntersection2(t,e,n);var a,s,o,l,c,h,u,d=t.x,p=t.y,g=e.x,f=e.y,m=n.x,y=n.y,v=i.x,x=i.y;return 0===(u=(a=f-p)*(l=m-v)-(s=x-y)*(o=d-g))?null:new r((o*(h=v*y-m*x)-l*(c=g*p-d*f))/u,(s*c-a*h)/u)},i.angleOfVector=function(t,e,n,r){var i=void 0;return t!==n?(i=Math.atan((r-e)/(n-t)),n<t?i+=Math.PI:r<e&&(i+=this.TWO_PI)):i=r<e?this.ONE_AND_HALF_PI:this.HALF_PI,i},i.doIntersect=function(t,e,n,r){var i=t.x,a=t.y,s=e.x,o=e.y,l=n.x,c=n.y,h=r.x,u=r.y,d=(s-i)*(u-c)-(h-l)*(o-a);if(0===d)return!1;var p=((u-c)*(h-i)+(l-h)*(u-a))/d,g=((a-o)*(h-i)+(s-i)*(u-a))/d;return 0<p&&p<1&&0<g&&g<1},i.findCircleLineIntersections=function(t,e,n,r,i,a,s){var o=(n-t)*(n-t)+(r-e)*(r-e),l=2*((t-i)*(n-t)+(e-a)*(r-e)),c=(t-i)*(t-i)+(e-a)*(e-a)-s*s;if(l*l-4*o*c>=0){var h=(-l+Math.sqrt(l*l-4*o*c))/(2*o),u=(-l-Math.sqrt(l*l-4*o*c))/(2*o);return h>=0&&h<=1?[h]:u>=0&&u<=1?[u]:null}return null},i.HALF_PI=.5*Math.PI,i.ONE_AND_HALF_PI=1.5*Math.PI,i.TWO_PI=2*Math.PI,i.THREE_PI=3*Math.PI,t.exports=i},function(t,e,n){function r(){}s(r,"IMath"),r.sign=function(t){return t>0?1:t<0?-1:0},r.floor=function(t){return t<0?Math.ceil(t):Math.floor(t)},r.ceil=function(t){return t<0?Math.floor(t):Math.ceil(t)},t.exports=r},function(t,e,n){function r(){}s(r,"Integer"),r.MAX_VALUE=2147483647,r.MIN_VALUE=-2147483648,t.exports=r},function(t,e,n){var r=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return s(t,"defineProperties"),function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}();function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}s(i,"_classCallCheck");var a=s((function(t){return{value:t,next:null,prev:null}}),"nodeFrom"),o=s((function(t,e,n,r){return null!==t?t.next=e:r.head=e,null!==n?n.prev=e:r.tail=e,e.prev=t,e.next=n,r.length++,e}),"add"),l=s((function(t,e){var n=t.prev,r=t.next;return null!==n?n.next=r:e.head=r,null!==r?r.prev=n:e.tail=n,t.prev=t.next=null,e.length--,t}),"_remove"),c=function(){function t(e){var n=this;i(this,t),this.length=0,this.head=null,this.tail=null,null!=e&&e.forEach((function(t){return n.push(t)}))}return s(t,"LinkedList"),r(t,[{key:"size",value:s((function(){return this.length}),"size")},{key:"insertBefore",value:s((function(t,e){return o(e.prev,a(t),e,this)}),"insertBefore")},{key:"insertAfter",value:s((function(t,e){return o(e,a(t),e.next,this)}),"insertAfter")},{key:"insertNodeBefore",value:s((function(t,e){return o(e.prev,t,e,this)}),"insertNodeBefore")},{key:"insertNodeAfter",value:s((function(t,e){return o(e,t,e.next,this)}),"insertNodeAfter")},{key:"push",value:s((function(t){return o(this.tail,a(t),null,this)}),"push")},{key:"unshift",value:s((function(t){return o(null,a(t),this.head,this)}),"unshift")},{key:"remove",value:s((function(t){return l(t,this)}),"remove")},{key:"pop",value:s((function(){return l(this.tail,this).value}),"pop")},{key:"popNode",value:s((function(){return l(this.tail,this)}),"popNode")},{key:"shift",value:s((function(){return l(this.head,this).value}),"shift")},{key:"shiftNode",value:s((function(){return l(this.head,this)}),"shiftNode")},{key:"get_object_at",value:s((function(t){if(t<=this.length()){for(var e=1,n=this.head;e<t;)n=n.next,e++;return n.value}}),"get_object_at")},{key:"set_object_at",value:s((function(t,e){if(t<=this.length()){for(var n=1,r=this.head;n<t;)r=r.next,n++;r.value=e}}),"set_object_at")}]),t}();t.exports=c},function(t,e,n){function r(t,e,n){this.x=null,this.y=null,null==t&&null==e&&null==n?(this.x=0,this.y=0):"number"==typeof t&&"number"==typeof e&&null==n?(this.x=t,this.y=e):"Point"==t.constructor.name&&null==e&&null==n&&(n=t,this.x=n.x,this.y=n.y)}s(r,"Point"),r.prototype.getX=function(){return this.x},r.prototype.getY=function(){return this.y},r.prototype.getLocation=function(){return new r(this.x,this.y)},r.prototype.setLocation=function(t,e,n){"Point"==t.constructor.name&&null==e&&null==n?(n=t,this.setLocation(n.x,n.y)):"number"==typeof t&&"number"==typeof e&&null==n&&(parseInt(t)==t&&parseInt(e)==e?this.move(t,e):(this.x=Math.floor(t+.5),this.y=Math.floor(e+.5)))},r.prototype.move=function(t,e){this.x=t,this.y=e},r.prototype.translate=function(t,e){this.x+=t,this.y+=e},r.prototype.equals=function(t){if("Point"==t.constructor.name){var e=t;return this.x==e.x&&this.y==e.y}return this==t},r.prototype.toString=function(){return(new r).constructor.name+"[x="+this.x+",y="+this.y+"]"},t.exports=r},function(t,e,n){function r(t,e,n,r){this.x=0,this.y=0,this.width=0,this.height=0,null!=t&&null!=e&&null!=n&&null!=r&&(this.x=t,this.y=e,this.width=n,this.height=r)}s(r,"RectangleD"),r.prototype.getX=function(){return this.x},r.prototype.setX=function(t){this.x=t},r.prototype.getY=function(){return this.y},r.prototype.setY=function(t){this.y=t},r.prototype.getWidth=function(){return this.width},r.prototype.setWidth=function(t){this.width=t},r.prototype.getHeight=function(){return this.height},r.prototype.setHeight=function(t){this.height=t},r.prototype.getRight=function(){return this.x+this.width},r.prototype.getBottom=function(){return this.y+this.height},r.prototype.intersects=function(t){return!(this.getRight()<t.x)&&(!(this.getBottom()<t.y)&&(!(t.getRight()<this.x)&&!(t.getBottom()<this.y)))},r.prototype.getCenterX=function(){return this.x+this.width/2},r.prototype.getMinX=function(){return this.getX()},r.prototype.getMaxX=function(){return this.getX()+this.width},r.prototype.getCenterY=function(){return this.y+this.height/2},r.prototype.getMinY=function(){return this.getY()},r.prototype.getMaxY=function(){return this.getY()+this.height},r.prototype.getWidthHalf=function(){return this.width/2},r.prototype.getHeightHalf=function(){return this.height/2},t.exports=r},function(t,e,n){var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};function i(){}s(i,"UniqueIDGeneretor"),i.lastID=0,i.createID=function(t){return i.isPrimitive(t)?t:(null!=t.uniqueID||(t.uniqueID=i.getString(),i.lastID++),t.uniqueID)},i.getString=function(t){return null==t&&(t=i.lastID),"Object#"+t},i.isPrimitive=function(t){var e=void 0===t?"undefined":r(t);return null==t||"object"!=e&&"function"!=e},t.exports=i},function(t,e,n){function r(t){if(Array.isArray(t)){for(var e=0,n=Array(t.length);e<t.length;e++)n[e]=t[e];return n}return Array.from(t)}s(r,"_toConsumableArray");var i=n(0),a=n(7),o=n(3),l=n(1),c=n(6),h=n(5),u=n(17),d=n(29);function p(t){d.call(this),this.layoutQuality=i.QUALITY,this.createBendsAsNeeded=i.DEFAULT_CREATE_BENDS_AS_NEEDED,this.incremental=i.DEFAULT_INCREMENTAL,this.animationOnLayout=i.DEFAULT_ANIMATION_ON_LAYOUT,this.animationDuringLayout=i.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=i.DEFAULT_ANIMATION_PERIOD,this.uniformLeafNodeSizes=i.DEFAULT_UNIFORM_LEAF_NODE_SIZES,this.edgeToDummyNodes=new Map,this.graphManager=new a(this),this.isLayoutFinished=!1,this.isSubLayout=!1,this.isRemoteUse=!1,null!=t&&(this.isRemoteUse=t)}s(p,"Layout"),p.RANDOM_SEED=1,p.prototype=Object.create(d.prototype),p.prototype.getGraphManager=function(){return this.graphManager},p.prototype.getAllNodes=function(){return this.graphManager.getAllNodes()},p.prototype.getAllEdges=function(){return this.graphManager.getAllEdges()},p.prototype.getAllNodesToApplyGravitation=function(){return this.graphManager.getAllNodesToApplyGravitation()},p.prototype.newGraphManager=function(){var t=new a(this);return this.graphManager=t,t},p.prototype.newGraph=function(t){return new c(null,this.graphManager,t)},p.prototype.newNode=function(t){return new o(this.graphManager,t)},p.prototype.newEdge=function(t){return new l(null,null,t)},p.prototype.checkLayoutSuccess=function(){return null==this.graphManager.getRoot()||0==this.graphManager.getRoot().getNodes().length||this.graphManager.includesInvalidEdge()},p.prototype.runLayout=function(){var t;return this.isLayoutFinished=!1,this.tilingPreLayout&&this.tilingPreLayout(),this.initParameters(),t=!this.checkLayoutSuccess()&&this.layout(),"during"!==i.ANIMATE&&(t&&(this.isSubLayout||this.doPostLayout()),this.tilingPostLayout&&this.tilingPostLayout(),this.isLayoutFinished=!0,t)},p.prototype.doPostLayout=function(){this.incremental||this.transform(),this.update()},p.prototype.update2=function(){if(this.createBendsAsNeeded&&(this.createBendpointsFromDummyNodes(),this.graphManager.resetAllEdges()),!this.isRemoteUse){for(var t=this.graphManager.getAllEdges(),e=0;e<t.length;e++)t[e];var n=this.graphManager.getRoot().getNodes();for(e=0;e<n.length;e++)n[e];this.update(this.graphManager.getRoot())}},p.prototype.update=function(t){if(null==t)this.update2();else if(t instanceof o){var e=t;if(null!=e.getChild())for(var n=e.getChild().getNodes(),r=0;r<n.length;r++)update(n[r]);if(null!=e.vGraphObject)e.vGraphObject.update(e)}else if(t instanceof l){var i=t;if(null!=i.vGraphObject)i.vGraphObject.update(i)}else if(t instanceof c){var a=t;if(null!=a.vGraphObject)a.vGraphObject.update(a)}},p.prototype.initParameters=function(){this.isSubLayout||(this.layoutQuality=i.QUALITY,this.animationDuringLayout=i.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=i.DEFAULT_ANIMATION_PERIOD,this.animationOnLayout=i.DEFAULT_ANIMATION_ON_LAYOUT,this.incremental=i.DEFAULT_INCREMENTAL,this.createBendsAsNeeded=i.DEFAULT_CREATE_BENDS_AS_NEEDED,this.uniformLeafNodeSizes=i.DEFAULT_UNIFORM_LEAF_NODE_SIZES),this.animationDuringLayout&&(this.animationOnLayout=!1)},p.prototype.transform=function(t){if(null==t)this.transform(new h(0,0));else{var e=new u,n=this.graphManager.getRoot().updateLeftTop();if(null!=n){e.setWorldOrgX(t.x),e.setWorldOrgY(t.y),e.setDeviceOrgX(n.x),e.setDeviceOrgY(n.y);for(var r=this.getAllNodes(),i=0;i<r.length;i++)r[i].transform(e)}}},p.prototype.positionNodesRandomly=function(t){if(null==t)this.positionNodesRandomly(this.getGraphManager().getRoot()),this.getGraphManager().getRoot().updateBounds(!0);else for(var e,n,r=t.getNodes(),i=0;i<r.length;i++)null==(n=(e=r[i]).getChild())||0==n.getNodes().length?e.scatter():(this.positionNodesRandomly(n),e.updateBounds())},p.prototype.getFlatForest=function(){for(var t=[],e=!0,n=this.graphManager.getRoot().getNodes(),i=!0,a=0;a<n.length;a++)null!=n[a].getChild()&&(i=!1);if(!i)return t;var s=new Set,o=[],l=new Map,c=[];for(c=c.concat(n);c.length>0&&e;){for(o.push(c[0]);o.length>0&&e;){var h=o[0];o.splice(0,1),s.add(h);var u=h.getEdges();for(a=0;a<u.length;a++){var d=u[a].getOtherEnd(h);if(l.get(h)!=d){if(s.has(d)){e=!1;break}o.push(d),l.set(d,h)}}}if(e){var p=[].concat(r(s));t.push(p);for(a=0;a<p.length;a++){var g=p[a],f=c.indexOf(g);f>-1&&c.splice(f,1)}s=new Set,l=new Map}else t=[]}return t},p.prototype.createDummyNodesForBendpoints=function(t){for(var e=[],n=t.source,r=this.graphManager.calcLowestCommonAncestor(t.source,t.target),i=0;i<t.bendpoints.length;i++){var a=this.newNode(null);a.setRect(new Point(0,0),new Dimension(1,1)),r.add(a);var s=this.newEdge(null);this.graphManager.add(s,n,a),e.add(a),n=a}s=this.newEdge(null);return this.graphManager.add(s,n,t.target),this.edgeToDummyNodes.set(t,e),t.isInterGraph()?this.graphManager.remove(t):r.remove(t),e},p.prototype.createBendpointsFromDummyNodes=function(){var t=[];t=t.concat(this.graphManager.getAllEdges()),t=[].concat(r(this.edgeToDummyNodes.keys())).concat(t);for(var e=0;e<t.length;e++){var n=t[e];if(n.bendpoints.length>0){for(var i=this.edgeToDummyNodes.get(n),a=0;a<i.length;a++){var s=i[a],o=new h(s.getCenterX(),s.getCenterY()),l=n.bendpoints.get(a);l.x=o.x,l.y=o.y,s.getOwner().remove(s)}this.graphManager.add(n,n.source,n.target)}}},p.transform=function(t,e,n,r){if(null!=n&&null!=r){var i=e;if(t<=50)i-=(e-e/n)/50*(50-t);else i+=(e*r-e)/50*(t-50);return i}var a,s;return t<=50?(a=9*e/500,s=e/10):(a=9*e/50,s=-8*e),a*t+s},p.findCenterOfTree=function(t){var e=[];e=e.concat(t);var n=[],r=new Map,i=!1,a=null;1!=e.length&&2!=e.length||(i=!0,a=e[0]);for(var s=0;s<e.length;s++){var o=(h=e[s]).getNeighborsList().size;r.set(h,h.getNeighborsList().size),1==o&&n.push(h)}var l=[];for(l=l.concat(n);!i;){var c=[];c=c.concat(l),l=[];for(s=0;s<e.length;s++){var h=e[s],u=e.indexOf(h);u>=0&&e.splice(u,1),h.getNeighborsList().forEach((function(t){if(n.indexOf(t)<0){var e=r.get(t)-1;1==e&&l.push(t),r.set(t,e)}}))}n=n.concat(l),1!=e.length&&2!=e.length||(i=!0,a=e[0])}return a},p.prototype.setGraphManager=function(t){this.graphManager=t},t.exports=p},function(t,e,n){function r(){}s(r,"RandomSeed"),r.seed=1,r.x=0,r.nextDouble=function(){return r.x=1e4*Math.sin(r.seed++),r.x-Math.floor(r.x)},t.exports=r},function(t,e,n){var r=n(5);function i(t,e){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(i,"Transform"),i.prototype.getWorldOrgX=function(){return this.lworldOrgX},i.prototype.setWorldOrgX=function(t){this.lworldOrgX=t},i.prototype.getWorldOrgY=function(){return this.lworldOrgY},i.prototype.setWorldOrgY=function(t){this.lworldOrgY=t},i.prototype.getWorldExtX=function(){return this.lworldExtX},i.prototype.setWorldExtX=function(t){this.lworldExtX=t},i.prototype.getWorldExtY=function(){return this.lworldExtY},i.prototype.setWorldExtY=function(t){this.lworldExtY=t},i.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},i.prototype.setDeviceOrgX=function(t){this.ldeviceOrgX=t},i.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},i.prototype.setDeviceOrgY=function(t){this.ldeviceOrgY=t},i.prototype.getDeviceExtX=function(){return this.ldeviceExtX},i.prototype.setDeviceExtX=function(t){this.ldeviceExtX=t},i.prototype.getDeviceExtY=function(){return this.ldeviceExtY},i.prototype.setDeviceExtY=function(t){this.ldeviceExtY=t},i.prototype.transformX=function(t){var e=0,n=this.lworldExtX;return 0!=n&&(e=this.ldeviceOrgX+(t-this.lworldOrgX)*this.ldeviceExtX/n),e},i.prototype.transformY=function(t){var e=0,n=this.lworldExtY;return 0!=n&&(e=this.ldeviceOrgY+(t-this.lworldOrgY)*this.ldeviceExtY/n),e},i.prototype.inverseTransformX=function(t){var e=0,n=this.ldeviceExtX;return 0!=n&&(e=this.lworldOrgX+(t-this.ldeviceOrgX)*this.lworldExtX/n),e},i.prototype.inverseTransformY=function(t){var e=0,n=this.ldeviceExtY;return 0!=n&&(e=this.lworldOrgY+(t-this.ldeviceOrgY)*this.lworldExtY/n),e},i.prototype.inverseTransformPoint=function(t){return new r(this.inverseTransformX(t.x),this.inverseTransformY(t.y))},t.exports=i},function(t,e,n){function r(t){if(Array.isArray(t)){for(var e=0,n=Array(t.length);e<t.length;e++)n[e]=t[e];return n}return Array.from(t)}s(r,"_toConsumableArray");var i=n(15),a=n(4),o=n(0),l=n(8),c=n(9);function h(){i.call(this),this.useSmartIdealEdgeLengthCalculation=a.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=a.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=a.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=a.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=a.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.displacementThresholdPerNode=3*a.DEFAULT_EDGE_LENGTH/100,this.coolingFactor=a.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.initialCoolingFactor=a.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.totalDisplacement=0,this.oldTotalDisplacement=0,this.maxIterations=a.MAX_ITERATIONS}for(var u in s(h,"FDLayout"),h.prototype=Object.create(i.prototype),i)h[u]=i[u];h.prototype.initParameters=function(){i.prototype.initParameters.call(this,arguments),this.totalIterations=0,this.notAnimatedIterations=0,this.useFRGridVariant=a.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION,this.grid=[]},h.prototype.calcIdealEdgeLengths=function(){for(var t,e,n,r,i,s,l,c=this.getGraphManager().getAllEdges(),h=0;h<c.length;h++)e=(t=c[h]).idealLength,t.isInterGraph&&(r=t.getSource(),i=t.getTarget(),s=t.getSourceInLca().getEstimatedSize(),l=t.getTargetInLca().getEstimatedSize(),this.useSmartIdealEdgeLengthCalculation&&(t.idealLength+=s+l-2*o.SIMPLE_NODE_SIZE),n=t.getLca().getInclusionTreeDepth(),t.idealLength+=e*a.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR*(r.getInclusionTreeDepth()+i.getInclusionTreeDepth()-2*n))},h.prototype.initSpringEmbedder=function(){var t=this.getAllNodes().length;this.incremental?(t>a.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*a.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(t-a.ADAPTATION_LOWER_NODE_LIMIT)/(a.ADAPTATION_UPPER_NODE_LIMIT-a.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-a.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=a.MAX_NODE_DISPLACEMENT_INCREMENTAL):(t>a.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(a.COOLING_ADAPTATION_FACTOR,1-(t-a.ADAPTATION_LOWER_NODE_LIMIT)/(a.ADAPTATION_UPPER_NODE_LIMIT-a.ADAPTATION_LOWER_NODE_LIMIT)*(1-a.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=a.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(5*this.getAllNodes().length,this.maxIterations),this.displacementThresholdPerNode=3*a.DEFAULT_EDGE_LENGTH/100,this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},h.prototype.calcSpringForces=function(){for(var t,e=this.getAllEdges(),n=0;n<e.length;n++)t=e[n],this.calcSpringForce(t,t.idealLength)},h.prototype.calcRepulsionForces=function(){var t,e,n,r,i,s=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],o=arguments.length>1&&void 0!==arguments[1]&&arguments[1],l=this.getAllNodes();if(this.useFRGridVariant)for(this.totalIterations%a.GRID_CALCULATION_CHECK_PERIOD==1&&s&&this.updateGrid(),i=new Set,t=0;t<l.length;t++)n=l[t],this.calculateRepulsionForceOfANode(n,i,s,o),i.add(n);else for(t=0;t<l.length;t++)for(n=l[t],e=t+1;e<l.length;e++)r=l[e],n.getOwner()==r.getOwner()&&this.calcRepulsionForce(n,r)},h.prototype.calcGravitationalForces=function(){for(var t,e=this.getAllNodesToApplyGravitation(),n=0;n<e.length;n++)t=e[n],this.calcGravitationalForce(t)},h.prototype.moveNodes=function(){for(var t=this.getAllNodes(),e=0;e<t.length;e++)t[e].move()},h.prototype.calcSpringForce=function(t,e){var n,r,i,a,s=t.getSource(),o=t.getTarget();if(this.uniformLeafNodeSizes&&null==s.getChild()&&null==o.getChild())t.updateLengthSimple();else if(t.updateLength(),t.isOverlapingSourceAndTarget)return;0!=(n=t.getLength())&&(i=(r=t.edgeElasticity*(n-e))*(t.lengthX/n),a=r*(t.lengthY/n),s.springForceX+=i,s.springForceY+=a,o.springForceX-=i,o.springForceY-=a)},h.prototype.calcRepulsionForce=function(t,e){var n,r,i,s,o,h,u,d=t.getRect(),p=e.getRect(),g=new Array(2),f=new Array(4);if(d.intersects(p)){l.calcSeparationAmount(d,p,g,a.DEFAULT_EDGE_LENGTH/2),h=2*g[0],u=2*g[1];var m=t.noOfChildren*e.noOfChildren/(t.noOfChildren+e.noOfChildren);t.repulsionForceX-=m*h,t.repulsionForceY-=m*u,e.repulsionForceX+=m*h,e.repulsionForceY+=m*u}else this.uniformLeafNodeSizes&&null==t.getChild()&&null==e.getChild()?(n=p.getCenterX()-d.getCenterX(),r=p.getCenterY()-d.getCenterY()):(l.getIntersection(d,p,f),n=f[2]-f[0],r=f[3]-f[1]),Math.abs(n)<a.MIN_REPULSION_DIST&&(n=c.sign(n)*a.MIN_REPULSION_DIST),Math.abs(r)<a.MIN_REPULSION_DIST&&(r=c.sign(r)*a.MIN_REPULSION_DIST),i=n*n+r*r,s=Math.sqrt(i),h=(o=(t.nodeRepulsion/2+e.nodeRepulsion/2)*t.noOfChildren*e.noOfChildren/i)*n/s,u=o*r/s,t.repulsionForceX-=h,t.repulsionForceY-=u,e.repulsionForceX+=h,e.repulsionForceY+=u},h.prototype.calcGravitationalForce=function(t){var e,n,r,i,a,s,o,l;n=((e=t.getOwner()).getRight()+e.getLeft())/2,r=(e.getTop()+e.getBottom())/2,i=t.getCenterX()-n,a=t.getCenterY()-r,s=Math.abs(i)+t.getWidth()/2,o=Math.abs(a)+t.getHeight()/2,t.getOwner()==this.graphManager.getRoot()?(s>(l=e.getEstimatedSize()*this.gravityRangeFactor)||o>l)&&(t.gravitationForceX=-this.gravityConstant*i,t.gravitationForceY=-this.gravityConstant*a):(s>(l=e.getEstimatedSize()*this.compoundGravityRangeFactor)||o>l)&&(t.gravitationForceX=-this.gravityConstant*i*this.compoundGravityConstant,t.gravitationForceY=-this.gravityConstant*a*this.compoundGravityConstant)},h.prototype.isConverged=function(){var t,e=!1;return this.totalIterations>this.maxIterations/3&&(e=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),t=this.totalDisplacement<this.totalDisplacementThreshold,this.oldTotalDisplacement=this.totalDisplacement,t||e},h.prototype.animate=function(){this.animationDuringLayout&&!this.isSubLayout&&(this.notAnimatedIterations==this.animationPeriod?(this.update(),this.notAnimatedIterations=0):this.notAnimatedIterations++)},h.prototype.calcNoOfChildrenForAllNodes=function(){for(var t,e=this.graphManager.getAllNodes(),n=0;n<e.length;n++)(t=e[n]).noOfChildren=t.getNoOfChildren()},h.prototype.calcGrid=function(t){var e,n;e=parseInt(Math.ceil((t.getRight()-t.getLeft())/this.repulsionRange)),n=parseInt(Math.ceil((t.getBottom()-t.getTop())/this.repulsionRange));for(var r=new Array(e),i=0;i<e;i++)r[i]=new Array(n);for(i=0;i<e;i++)for(var a=0;a<n;a++)r[i][a]=new Array;return r},h.prototype.addNodeToGrid=function(t,e,n){var r,i,a,s;r=parseInt(Math.floor((t.getRect().x-e)/this.repulsionRange)),i=parseInt(Math.floor((t.getRect().width+t.getRect().x-e)/this.repulsionRange)),a=parseInt(Math.floor((t.getRect().y-n)/this.repulsionRange)),s=parseInt(Math.floor((t.getRect().height+t.getRect().y-n)/this.repulsionRange));for(var o=r;o<=i;o++)for(var l=a;l<=s;l++)this.grid[o][l].push(t),t.setGridCoordinates(r,i,a,s)},h.prototype.updateGrid=function(){var t,e,n=this.getAllNodes();for(this.grid=this.calcGrid(this.graphManager.getRoot()),t=0;t<n.length;t++)e=n[t],this.addNodeToGrid(e,this.graphManager.getRoot().getLeft(),this.graphManager.getRoot().getTop())},h.prototype.calculateRepulsionForceOfANode=function(t,e,n,i){if(this.totalIterations%a.GRID_CALCULATION_CHECK_PERIOD==1&&n||i){var s,o=new Set;t.surrounding=new Array;for(var l=this.grid,c=t.startX-1;c<t.finishX+2;c++)for(var h=t.startY-1;h<t.finishY+2;h++)if(!(c<0||h<0||c>=l.length||h>=l[0].length))for(var u=0;u<l[c][h].length;u++)if(s=l[c][h][u],t.getOwner()==s.getOwner()&&t!=s&&!e.has(s)&&!o.has(s)){var d=Math.abs(t.getCenterX()-s.getCenterX())-(t.getWidth()/2+s.getWidth()/2),p=Math.abs(t.getCenterY()-s.getCenterY())-(t.getHeight()/2+s.getHeight()/2);d<=this.repulsionRange&&p<=this.repulsionRange&&o.add(s)}t.surrounding=[].concat(r(o))}for(c=0;c<t.surrounding.length;c++)this.calcRepulsionForce(t,t.surrounding[c])},h.prototype.calcRepulsionRange=function(){return 0},t.exports=h},function(t,e,n){var r=n(1),i=n(4);function a(t,e,n){r.call(this,t,e,n),this.idealLength=i.DEFAULT_EDGE_LENGTH,this.edgeElasticity=i.DEFAULT_SPRING_STRENGTH}for(var o in s(a,"FDLayoutEdge"),a.prototype=Object.create(r.prototype),r)a[o]=r[o];t.exports=a},function(t,e,n){var r=n(3),i=n(4);function a(t,e,n,a){r.call(this,t,e,n,a),this.nodeRepulsion=i.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=[]}for(var o in s(a,"FDLayoutNode"),a.prototype=Object.create(r.prototype),r)a[o]=r[o];a.prototype.setGridCoordinates=function(t,e,n,r){this.startX=t,this.finishX=e,this.startY=n,this.finishY=r},t.exports=a},function(t,e,n){function r(t,e){this.width=0,this.height=0,null!==t&&null!==e&&(this.height=e,this.width=t)}s(r,"DimensionD"),r.prototype.getWidth=function(){return this.width},r.prototype.setWidth=function(t){this.width=t},r.prototype.getHeight=function(){return this.height},r.prototype.setHeight=function(t){this.height=t},t.exports=r},function(t,e,n){var r=n(14);function i(){this.map={},this.keys=[]}s(i,"HashMap"),i.prototype.put=function(t,e){var n=r.createID(t);this.contains(n)||(this.map[n]=e,this.keys.push(t))},i.prototype.contains=function(t){return r.createID(t),null!=this.map[t]},i.prototype.get=function(t){var e=r.createID(t);return this.map[e]},i.prototype.keySet=function(){return this.keys},t.exports=i},function(t,e,n){var r=n(14);function i(){this.set={}}s(i,"HashSet"),i.prototype.add=function(t){var e=r.createID(t);this.contains(e)||(this.set[e]=t)},i.prototype.remove=function(t){delete this.set[r.createID(t)]},i.prototype.clear=function(){this.set={}},i.prototype.contains=function(t){return this.set[r.createID(t)]==t},i.prototype.isEmpty=function(){return 0===this.size()},i.prototype.size=function(){return Object.keys(this.set).length},i.prototype.addAllTo=function(t){for(var e=Object.keys(this.set),n=e.length,r=0;r<n;r++)t.push(this.set[e[r]])},i.prototype.size=function(){return Object.keys(this.set).length},i.prototype.addAll=function(t){for(var e=t.length,n=0;n<e;n++){var r=t[n];this.add(r)}},t.exports=i},function(t,e,n){function r(){}s(r,"Matrix"),r.multMat=function(t,e){for(var n=[],r=0;r<t.length;r++){n[r]=[];for(var i=0;i<e[0].length;i++){n[r][i]=0;for(var a=0;a<t[0].length;a++)n[r][i]+=t[r][a]*e[a][i]}}return n},r.transpose=function(t){for(var e=[],n=0;n<t[0].length;n++){e[n]=[];for(var r=0;r<t.length;r++)e[n][r]=t[r][n]}return e},r.multCons=function(t,e){for(var n=[],r=0;r<t.length;r++)n[r]=t[r]*e;return n},r.minusOp=function(t,e){for(var n=[],r=0;r<t.length;r++)n[r]=t[r]-e[r];return n},r.dotProduct=function(t,e){for(var n=0,r=0;r<t.length;r++)n+=t[r]*e[r];return n},r.mag=function(t){return Math.sqrt(this.dotProduct(t,t))},r.normalize=function(t){for(var e=[],n=this.mag(t),r=0;r<t.length;r++)e[r]=t[r]/n;return e},r.multGamma=function(t){for(var e=[],n=0,r=0;r<t.length;r++)n+=t[r];n*=-1/t.length;for(var i=0;i<t.length;i++)e[i]=n+t[i];return e},r.multL=function(t,e,n){for(var r=[],i=[],a=[],s=0;s<e[0].length;s++){for(var o=0,l=0;l<e.length;l++)o+=-.5*e[l][s]*t[l];i[s]=o}for(var c=0;c<n.length;c++){for(var h=0,u=0;u<n.length;u++)h+=n[c][u]*i[u];a[c]=h}for(var d=0;d<e.length;d++){for(var p=0,g=0;g<e[0].length;g++)p+=e[d][g]*a[g];r[d]=p}return r},t.exports=r},function(t,e,n){var r=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return s(t,"defineProperties"),function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}();function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}s(i,"_classCallCheck");var a=n(11),o=function(){function t(e,n){i(this,t),null===n&&void 0===n||(this.compareFunction=this._defaultCompareFunction);var r=void 0;r=e instanceof a?e.size():e.length,this._quicksort(e,0,r-1)}return s(t,"Quicksort"),r(t,[{key:"_quicksort",value:s((function(t,e,n){if(e<n){var r=this._partition(t,e,n);this._quicksort(t,e,r),this._quicksort(t,r+1,n)}}),"_quicksort")},{key:"_partition",value:s((function(t,e,n){for(var r=this._get(t,e),i=e,a=n;;){for(;this.compareFunction(r,this._get(t,a));)a--;for(;this.compareFunction(this._get(t,i),r);)i++;if(!(i<a))return a;this._swap(t,i,a),i++,a--}}),"_partition")},{key:"_get",value:s((function(t,e){return t instanceof a?t.get_object_at(e):t[e]}),"_get")},{key:"_set",value:s((function(t,e,n){t instanceof a?t.set_object_at(e,n):t[e]=n}),"_set")},{key:"_swap",value:s((function(t,e,n){var r=this._get(t,e);this._set(t,e,this._get(t,n)),this._set(t,n,r)}),"_swap")},{key:"_defaultCompareFunction",value:s((function(t,e){return e>t}),"_defaultCompareFunction")}]),t}();t.exports=o},function(t,e,n){function r(){}s(r,"SVD"),r.svd=function(t){this.U=null,this.V=null,this.s=null,this.m=0,this.n=0,this.m=t.length,this.n=t[0].length;var e,n,i=Math.min(this.m,this.n);this.s=function(t){for(var e=[];t-- >0;)e.push(0);return e}(Math.min(this.m+1,this.n)),this.U=(e=[this.m,i],n=s((function t(e){if(0==e.length)return 0;for(var n=[],r=0;r<e[0];r++)n.push(t(e.slice(1)));return n}),"allocate"),n(e)),this.V=function(t){var e=s((function t(e){if(0==e.length)return 0;for(var n=[],r=0;r<e[0];r++)n.push(t(e.slice(1)));return n}),"allocate");return e(t)}([this.n,this.n]);for(var a=function(t){for(var e=[];t-- >0;)e.push(0);return e}(this.n),o=function(t){for(var e=[];t-- >0;)e.push(0);return e}(this.m),l=Math.min(this.m-1,this.n),c=Math.max(0,Math.min(this.n-2,this.m)),h=0;h<Math.max(l,c);h++){if(h<l){this.s[h]=0;for(var u=h;u<this.m;u++)this.s[h]=r.hypot(this.s[h],t[u][h]);if(0!==this.s[h]){t[h][h]<0&&(this.s[h]=-this.s[h]);for(var d=h;d<this.m;d++)t[d][h]/=this.s[h];t[h][h]+=1}this.s[h]=-this.s[h]}for(var p=h+1;p<this.n;p++){if(function(t,e){return t&&e}(h<l,0!==this.s[h])){for(var g=0,f=h;f<this.m;f++)g+=t[f][h]*t[f][p];g=-g/t[h][h];for(var m=h;m<this.m;m++)t[m][p]+=g*t[m][h]}a[p]=t[h][p]}if(function(t,e){return e}(0,h<l))for(var y=h;y<this.m;y++)this.U[y][h]=t[y][h];if(h<c){a[h]=0;for(var v=h+1;v<this.n;v++)a[h]=r.hypot(a[h],a[v]);if(0!==a[h]){a[h+1]<0&&(a[h]=-a[h]);for(var x=h+1;x<this.n;x++)a[x]/=a[h];a[h+1]+=1}if(a[h]=-a[h],function(t,e){return t&&e}(h+1<this.m,0!==a[h])){for(var b=h+1;b<this.m;b++)o[b]=0;for(var w=h+1;w<this.n;w++)for(var k=h+1;k<this.m;k++)o[k]+=a[w]*t[k][w];for(var T=h+1;T<this.n;T++)for(var _=-a[T]/a[h+1],E=h+1;E<this.m;E++)t[E][T]+=_*o[E]}for(var C=h+1;C<this.n;C++)this.V[C][h]=a[C]}}var S=Math.min(this.n,this.m+1);l<this.n&&(this.s[l]=t[l][l]),this.m<S&&(this.s[S-1]=0),c+1<S&&(a[c]=t[c][S-1]),a[S-1]=0;for(var A=l;A<i;A++){for(var L=0;L<this.m;L++)this.U[L][A]=0;this.U[A][A]=1}for(var N=l-1;N>=0;N--)if(0!==this.s[N]){for(var I=N+1;I<i;I++){for(var M=0,R=N;R<this.m;R++)M+=this.U[R][N]*this.U[R][I];M=-M/this.U[N][N];for(var D=N;D<this.m;D++)this.U[D][I]+=M*this.U[D][N]}for(var O=N;O<this.m;O++)this.U[O][N]=-this.U[O][N];this.U[N][N]=1+this.U[N][N];for(var P=0;P<N-1;P++)this.U[P][N]=0}else{for(var B=0;B<this.m;B++)this.U[B][N]=0;this.U[N][N]=1}for(var $=this.n-1;$>=0;$--){if(function(t,e){return t&&e}($<c,0!==a[$]))for(var F=$+1;F<i;F++){for(var z=0,U=$+1;U<this.n;U++)z+=this.V[U][$]*this.V[U][F];z=-z/this.V[$+1][$];for(var G=$+1;G<this.n;G++)this.V[G][F]+=z*this.V[G][$]}for(var q=0;q<this.n;q++)this.V[q][$]=0;this.V[$][$]=1}for(var j=S-1,Y=Math.pow(2,-52),W=Math.pow(2,-966);S>0;){var H=void 0,V=void 0;for(H=S-2;H>=-1&&-1!==H;H--)if(Math.abs(a[H])<=W+Y*(Math.abs(this.s[H])+Math.abs(this.s[H+1]))){a[H]=0;break}if(H===S-2)V=4;else{var X=void 0;for(X=S-1;X>=H&&X!==H;X--){var K=(X!==S?Math.abs(a[X]):0)+(X!==H+1?Math.abs(a[X-1]):0);if(Math.abs(this.s[X])<=W+Y*K){this.s[X]=0;break}}X===H?V=3:X===S-1?V=1:(V=2,H=X)}switch(H++,V){case 1:var Z=a[S-2];a[S-2]=0;for(var Q=S-2;Q>=H;Q--){var J=r.hypot(this.s[Q],Z),tt=this.s[Q]/J,et=Z/J;this.s[Q]=J,Q!==H&&(Z=-et*a[Q-1],a[Q-1]=tt*a[Q-1]);for(var nt=0;nt<this.n;nt++)J=tt*this.V[nt][Q]+et*this.V[nt][S-1],this.V[nt][S-1]=-et*this.V[nt][Q]+tt*this.V[nt][S-1],this.V[nt][Q]=J}break;case 2:var rt=a[H-1];a[H-1]=0;for(var it=H;it<S;it++){var at=r.hypot(this.s[it],rt),st=this.s[it]/at,ot=rt/at;this.s[it]=at,rt=-ot*a[it],a[it]=st*a[it];for(var lt=0;lt<this.m;lt++)at=st*this.U[lt][it]+ot*this.U[lt][H-1],this.U[lt][H-1]=-ot*this.U[lt][it]+st*this.U[lt][H-1],this.U[lt][it]=at}break;case 3:var ct=Math.max(Math.max(Math.max(Math.max(Math.abs(this.s[S-1]),Math.abs(this.s[S-2])),Math.abs(a[S-2])),Math.abs(this.s[H])),Math.abs(a[H])),ht=this.s[S-1]/ct,ut=this.s[S-2]/ct,dt=a[S-2]/ct,pt=this.s[H]/ct,gt=a[H]/ct,ft=((ut+ht)*(ut-ht)+dt*dt)/2,mt=ht*dt*(ht*dt),yt=0;(function(t,e){return t||e})(0!==ft,0!==mt)&&(yt=Math.sqrt(ft*ft+mt),ft<0&&(yt=-yt),yt=mt/(ft+yt));for(var vt=(pt+ht)*(pt-ht)+yt,xt=pt*gt,bt=H;bt<S-1;bt++){var wt=r.hypot(vt,xt),kt=vt/wt,Tt=xt/wt;bt!==H&&(a[bt-1]=wt),vt=kt*this.s[bt]+Tt*a[bt],a[bt]=kt*a[bt]-Tt*this.s[bt],xt=Tt*this.s[bt+1],this.s[bt+1]=kt*this.s[bt+1];for(var _t=0;_t<this.n;_t++)wt=kt*this.V[_t][bt]+Tt*this.V[_t][bt+1],this.V[_t][bt+1]=-Tt*this.V[_t][bt]+kt*this.V[_t][bt+1],this.V[_t][bt]=wt;if(kt=vt/(wt=r.hypot(vt,xt)),Tt=xt/wt,this.s[bt]=wt,vt=kt*a[bt]+Tt*this.s[bt+1],this.s[bt+1]=-Tt*a[bt]+kt*this.s[bt+1],xt=Tt*a[bt+1],a[bt+1]=kt*a[bt+1],bt<this.m-1)for(var Et=0;Et<this.m;Et++)wt=kt*this.U[Et][bt]+Tt*this.U[Et][bt+1],this.U[Et][bt+1]=-Tt*this.U[Et][bt]+kt*this.U[Et][bt+1],this.U[Et][bt]=wt}a[S-2]=vt;break;case 4:if(this.s[H]<=0){this.s[H]=this.s[H]<0?-this.s[H]:0;for(var Ct=0;Ct<=j;Ct++)this.V[Ct][H]=-this.V[Ct][H]}for(;H<j&&!(this.s[H]>=this.s[H+1]);){var St=this.s[H];if(this.s[H]=this.s[H+1],this.s[H+1]=St,H<this.n-1)for(var At=0;At<this.n;At++)St=this.V[At][H+1],this.V[At][H+1]=this.V[At][H],this.V[At][H]=St;if(H<this.m-1)for(var Lt=0;Lt<this.m;Lt++)St=this.U[Lt][H+1],this.U[Lt][H+1]=this.U[Lt][H],this.U[Lt][H]=St;H++}S--}}return{U:this.U,V:this.V,S:this.s}},r.hypot=function(t,e){var n=void 0;return Math.abs(t)>Math.abs(e)?(n=e/t,n=Math.abs(t)*Math.sqrt(1+n*n)):0!=e?(n=t/e,n=Math.abs(e)*Math.sqrt(1+n*n)):n=0,n},t.exports=r},function(t,e,n){var r=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return s(t,"defineProperties"),function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}();function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}s(i,"_classCallCheck");var a=function(){function t(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:-1,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:-1;i(this,t),this.sequence1=e,this.sequence2=n,this.match_score=r,this.mismatch_penalty=a,this.gap_penalty=s,this.iMax=e.length+1,this.jMax=n.length+1,this.grid=new Array(this.iMax);for(var o=0;o<this.iMax;o++){this.grid[o]=new Array(this.jMax);for(var l=0;l<this.jMax;l++)this.grid[o][l]=0}this.tracebackGrid=new Array(this.iMax);for(var c=0;c<this.iMax;c++){this.tracebackGrid[c]=new Array(this.jMax);for(var h=0;h<this.jMax;h++)this.tracebackGrid[c][h]=[null,null,null]}this.alignments=[],this.score=-1,this.computeGrids()}return s(t,"NeedlemanWunsch"),r(t,[{key:"getScore",value:s((function(){return this.score}),"getScore")},{key:"getAlignments",value:s((function(){return this.alignments}),"getAlignments")},{key:"computeGrids",value:s((function(){for(var t=1;t<this.jMax;t++)this.grid[0][t]=this.grid[0][t-1]+this.gap_penalty,this.tracebackGrid[0][t]=[!1,!1,!0];for(var e=1;e<this.iMax;e++)this.grid[e][0]=this.grid[e-1][0]+this.gap_penalty,this.tracebackGrid[e][0]=[!1,!0,!1];for(var n=1;n<this.iMax;n++)for(var r=1;r<this.jMax;r++){var i=[this.sequence1[n-1]===this.sequence2[r-1]?this.grid[n-1][r-1]+this.match_score:this.grid[n-1][r-1]+this.mismatch_penalty,this.grid[n-1][r]+this.gap_penalty,this.grid[n][r-1]+this.gap_penalty],a=this.arrayAllMaxIndexes(i);this.grid[n][r]=i[a[0]],this.tracebackGrid[n][r]=[a.includes(0),a.includes(1),a.includes(2)]}this.score=this.grid[this.iMax-1][this.jMax-1]}),"computeGrids")},{key:"alignmentTraceback",value:s((function(){var t=[];for(t.push({pos:[this.sequence1.length,this.sequence2.length],seq1:"",seq2:""});t[0];){var e=t[0],n=this.tracebackGrid[e.pos[0]][e.pos[1]];n[0]&&t.push({pos:[e.pos[0]-1,e.pos[1]-1],seq1:this.sequence1[e.pos[0]-1]+e.seq1,seq2:this.sequence2[e.pos[1]-1]+e.seq2}),n[1]&&t.push({pos:[e.pos[0]-1,e.pos[1]],seq1:this.sequence1[e.pos[0]-1]+e.seq1,seq2:"-"+e.seq2}),n[2]&&t.push({pos:[e.pos[0],e.pos[1]-1],seq1:"-"+e.seq1,seq2:this.sequence2[e.pos[1]-1]+e.seq2}),0===e.pos[0]&&0===e.pos[1]&&this.alignments.push({sequence1:e.seq1,sequence2:e.seq2}),t.shift()}return this.alignments}),"alignmentTraceback")},{key:"getAllIndexes",value:s((function(t,e){for(var n=[],r=-1;-1!==(r=t.indexOf(e,r+1));)n.push(r);return n}),"getAllIndexes")},{key:"arrayAllMaxIndexes",value:s((function(t){return this.getAllIndexes(t,Math.max.apply(null,t))}),"arrayAllMaxIndexes")}]),t}();t.exports=a},function(t,e,n){var r=s((function(){}),"layoutBase");r.FDLayout=n(18),r.FDLayoutConstants=n(4),r.FDLayoutEdge=n(19),r.FDLayoutNode=n(20),r.DimensionD=n(21),r.HashMap=n(22),r.HashSet=n(23),r.IGeometry=n(8),r.IMath=n(9),r.Integer=n(10),r.Point=n(12),r.PointD=n(5),r.RandomSeed=n(16),r.RectangleD=n(13),r.Transform=n(17),r.UniqueIDGeneretor=n(14),r.Quicksort=n(25),r.LinkedList=n(11),r.LGraphObject=n(2),r.LGraph=n(6),r.LEdge=n(1),r.LGraphManager=n(7),r.LNode=n(3),r.Layout=n(15),r.LayoutConstants=n(0),r.NeedlemanWunsch=n(27),r.Matrix=n(24),r.SVD=n(26),t.exports=r},function(t,e,n){function r(){this.listeners=[]}s(r,"Emitter");var i=r.prototype;i.addListener=function(t,e){this.listeners.push({event:t,callback:e})},i.removeListener=function(t,e){for(var n=this.listeners.length;n>=0;n--){var r=this.listeners[n];r.event===t&&r.callback===e&&this.listeners.splice(n,1)}},i.emit=function(t,e){for(var n=0;n<this.listeners.length;n++){var r=this.listeners[n];t===r.event&&r.callback(e)}},t.exports=r}])}))}}),oIt=o({"../../node_modules/.pnpm/cose-base@2.2.0/node_modules/cose-base/cose-base.js"(t,e){s((function(n,r){"object"==typeof t&&"object"==typeof e?e.exports=r(sIt()):"function"==typeof define&&define.amd?define(["layout-base"],r):"object"==typeof t?t.coseBase=r(sIt()):n.coseBase=r(n.layoutBase)}),"webpackUniversalModuleDefinition")(t,(function(t){return(()=>{var e={45:(t,e,n)=>{var r={};r.layoutBase=n(551),r.CoSEConstants=n(806),r.CoSEEdge=n(767),r.CoSEGraph=n(880),r.CoSEGraphManager=n(578),r.CoSELayout=n(765),r.CoSENode=n(991),r.ConstraintHandler=n(902),t.exports=r},806:(t,e,n)=>{var r=n(551).FDLayoutConstants;function i(){}for(var a in s(i,"CoSEConstants"),r)i[a]=r[a];i.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,i.DEFAULT_RADIAL_SEPARATION=r.DEFAULT_EDGE_LENGTH,i.DEFAULT_COMPONENT_SEPERATION=60,i.TILE=!0,i.TILING_PADDING_VERTICAL=10,i.TILING_PADDING_HORIZONTAL=10,i.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,i.ENFORCE_CONSTRAINTS=!0,i.APPLY_LAYOUT=!0,i.RELAX_MOVEMENT_ON_CONSTRAINTS=!0,i.TREE_REDUCTION_ON_INCREMENTAL=!0,i.PURE_INCREMENTAL=i.DEFAULT_INCREMENTAL,t.exports=i},767:(t,e,n)=>{var r=n(551).FDLayoutEdge;function i(t,e,n){r.call(this,t,e,n)}for(var a in s(i,"CoSEEdge"),i.prototype=Object.create(r.prototype),r)i[a]=r[a];t.exports=i},880:(t,e,n)=>{var r=n(551).LGraph;function i(t,e,n){r.call(this,t,e,n)}for(var a in s(i,"CoSEGraph"),i.prototype=Object.create(r.prototype),r)i[a]=r[a];t.exports=i},578:(t,e,n)=>{var r=n(551).LGraphManager;function i(t){r.call(this,t)}for(var a in s(i,"CoSEGraphManager"),i.prototype=Object.create(r.prototype),r)i[a]=r[a];t.exports=i},765:(t,e,n)=>{var r=n(551).FDLayout,i=n(578),a=n(880),o=n(991),l=n(767),c=n(806),h=n(902),u=n(551).FDLayoutConstants,d=n(551).LayoutConstants,p=n(551).Point,g=n(551).PointD,f=n(551).DimensionD,m=n(551).Layout,y=n(551).Integer,v=n(551).IGeometry,x=n(551).LGraph,b=n(551).Transform,w=n(551).LinkedList;function k(){r.call(this),this.toBeTiled={},this.constraints={}}for(var T in s(k,"CoSELayout"),k.prototype=Object.create(r.prototype),r)k[T]=r[T];k.prototype.newGraphManager=function(){var t=new i(this);return this.graphManager=t,t},k.prototype.newGraph=function(t){return new a(null,this.graphManager,t)},k.prototype.newNode=function(t){return new o(this.graphManager,t)},k.prototype.newEdge=function(t){return new l(null,null,t)},k.prototype.initParameters=function(){r.prototype.initParameters.call(this,arguments),this.isSubLayout||(c.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=c.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=c.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=u.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=u.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=u.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=u.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1)},k.prototype.initSpringEmbedder=function(){r.prototype.initSpringEmbedder.call(this),this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/u.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=.04,this.coolingAdjuster=1},k.prototype.layout=function(){return d.DEFAULT_CREATE_BENDS_AS_NEEDED&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},k.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(c.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();e=new Set(this.getAllNodes()),n=this.nodesWithGravity.filter((function(t){return e.has(t)}));this.graphManager.setAllNodesToApplyGravitation(n)}}else{var t=this.getFlatForest();if(t.length>0)this.positionNodesRadially(t);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var e=new Set(this.getAllNodes()),n=this.nodesWithGravity.filter((function(t){return e.has(t)}));this.graphManager.setAllNodesToApplyGravitation(n),this.positionNodesRandomly()}}return Object.keys(this.constraints).length>0&&(h.handleConstraints(this),this.initConstraintVariables()),this.initSpringEmbedder(),c.APPLY_LAYOUT&&this.runSpringEmbedder(),!0},k.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished){if(!(this.prunedNodesAll.length>0))return!0;this.isTreeGrowing=!0}if(this.totalIterations%u.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged()){if(!(this.prunedNodesAll.length>0))return!0;this.isTreeGrowing=!0}this.coolingCycle++,0==this.layoutQuality?this.coolingAdjuster=this.coolingCycle:1==this.layoutQuality&&(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 t=new Set(this.getAllNodes()),e=this.nodesWithGravity.filter((function(e){return t.has(e)}));this.graphManager.setAllNodesToApplyGravitation(e),this.graphManager.updateBounds(),this.updateGrid(),c.PURE_INCREMENTAL?this.coolingFactor=u.DEFAULT_COOLING_FACTOR_INCREMENTAL/2:this.coolingFactor=u.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()),c.PURE_INCREMENTAL?this.coolingFactor=u.DEFAULT_COOLING_FACTOR_INCREMENTAL/2*((100-this.afterGrowthIterations)/100):this.coolingFactor=u.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var n=!this.isTreeGrowing&&!this.isGrowthFinished,r=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(n,r),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},k.prototype.getPositionsData=function(){for(var t=this.graphManager.getAllNodes(),e={},n=0;n<t.length;n++){var r=t[n].rect,i=t[n].id;e[i]={id:i,x:r.getCenterX(),y:r.getCenterY(),w:r.width,h:r.height}}return e},k.prototype.runSpringEmbedder=function(){this.initialAnimationPeriod=25,this.animationPeriod=this.initialAnimationPeriod;var t=!1;if("during"===u.ANIMATE)this.emit("layoutstarted");else{for(;!t;)t=this.tick();this.graphManager.updateBounds()}},k.prototype.moveNodes=function(){for(var t=this.getAllNodes(),e=0;e<t.length;e++)t[e].calculateDisplacement();Object.keys(this.constraints).length>0&&this.updateDisplacements();for(e=0;e<t.length;e++)t[e].move()},k.prototype.initConstraintVariables=function(){var t=this;this.idToNodeMap=new Map,this.fixedNodeSet=new Set;for(var e=this.graphManager.getAllNodes(),n=0;n<e.length;n++){var r=e[n];this.idToNodeMap.set(r.id,r)}var i=s((function e(n){for(var r,i=n.getChild().getNodes(),a=0,s=0;s<i.length;s++)null==(r=i[s]).getChild()?t.fixedNodeSet.has(r.id)&&(a+=100):a+=e(r);return a}),"calculateCompoundWeight");if(this.constraints.fixedNodeConstraint){this.constraints.fixedNodeConstraint.forEach((function(e){t.fixedNodeSet.add(e.nodeId)}));for(e=this.graphManager.getAllNodes(),n=0;n<e.length;n++)if(null!=(r=e[n]).getChild()){var a=i(r);a>0&&(r.fixedNodeWeight=a)}}if(this.constraints.relativePlacementConstraint){var o=new Map,l=new Map;if(this.dummyToNodeForVerticalAlignment=new Map,this.dummyToNodeForHorizontalAlignment=new Map,this.fixedNodesOnHorizontal=new Set,this.fixedNodesOnVertical=new Set,this.fixedNodeSet.forEach((function(e){t.fixedNodesOnHorizontal.add(e),t.fixedNodesOnVertical.add(e)})),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical){var h=this.constraints.alignmentConstraint.vertical;for(n=0;n<h.length;n++)this.dummyToNodeForVerticalAlignment.set("dummy"+n,[]),h[n].forEach((function(e){o.set(e,"dummy"+n),t.dummyToNodeForVerticalAlignment.get("dummy"+n).push(e),t.fixedNodeSet.has(e)&&t.fixedNodesOnHorizontal.add("dummy"+n)}))}if(this.constraints.alignmentConstraint.horizontal){var u=this.constraints.alignmentConstraint.horizontal;for(n=0;n<u.length;n++)this.dummyToNodeForHorizontalAlignment.set("dummy"+n,[]),u[n].forEach((function(e){l.set(e,"dummy"+n),t.dummyToNodeForHorizontalAlignment.get("dummy"+n).push(e),t.fixedNodeSet.has(e)&&t.fixedNodesOnVertical.add("dummy"+n)}))}}if(c.RELAX_MOVEMENT_ON_CONSTRAINTS)this.shuffle=function(t){var e,n,r;for(r=t.length-1;r>=2*t.length/3;r--)e=Math.floor(Math.random()*(r+1)),n=t[r],t[r]=t[e],t[e]=n;return t},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(e){if(e.left){var n=o.has(e.left)?o.get(e.left):e.left,r=o.has(e.right)?o.get(e.right):e.right;t.nodesInRelativeHorizontal.includes(n)||(t.nodesInRelativeHorizontal.push(n),t.nodeToRelativeConstraintMapHorizontal.set(n,[]),t.dummyToNodeForVerticalAlignment.has(n)?t.nodeToTempPositionMapHorizontal.set(n,t.idToNodeMap.get(t.dummyToNodeForVerticalAlignment.get(n)[0]).getCenterX()):t.nodeToTempPositionMapHorizontal.set(n,t.idToNodeMap.get(n).getCenterX())),t.nodesInRelativeHorizontal.includes(r)||(t.nodesInRelativeHorizontal.push(r),t.nodeToRelativeConstraintMapHorizontal.set(r,[]),t.dummyToNodeForVerticalAlignment.has(r)?t.nodeToTempPositionMapHorizontal.set(r,t.idToNodeMap.get(t.dummyToNodeForVerticalAlignment.get(r)[0]).getCenterX()):t.nodeToTempPositionMapHorizontal.set(r,t.idToNodeMap.get(r).getCenterX())),t.nodeToRelativeConstraintMapHorizontal.get(n).push({right:r,gap:e.gap}),t.nodeToRelativeConstraintMapHorizontal.get(r).push({left:n,gap:e.gap})}else{var i=l.has(e.top)?l.get(e.top):e.top,a=l.has(e.bottom)?l.get(e.bottom):e.bottom;t.nodesInRelativeVertical.includes(i)||(t.nodesInRelativeVertical.push(i),t.nodeToRelativeConstraintMapVertical.set(i,[]),t.dummyToNodeForHorizontalAlignment.has(i)?t.nodeToTempPositionMapVertical.set(i,t.idToNodeMap.get(t.dummyToNodeForHorizontalAlignment.get(i)[0]).getCenterY()):t.nodeToTempPositionMapVertical.set(i,t.idToNodeMap.get(i).getCenterY())),t.nodesInRelativeVertical.includes(a)||(t.nodesInRelativeVertical.push(a),t.nodeToRelativeConstraintMapVertical.set(a,[]),t.dummyToNodeForHorizontalAlignment.has(a)?t.nodeToTempPositionMapVertical.set(a,t.idToNodeMap.get(t.dummyToNodeForHorizontalAlignment.get(a)[0]).getCenterY()):t.nodeToTempPositionMapVertical.set(a,t.idToNodeMap.get(a).getCenterY())),t.nodeToRelativeConstraintMapVertical.get(i).push({bottom:a,gap:e.gap}),t.nodeToRelativeConstraintMapVertical.get(a).push({top:i,gap:e.gap})}}));else{var d=new Map,p=new Map;this.constraints.relativePlacementConstraint.forEach((function(t){if(t.left){var e=o.has(t.left)?o.get(t.left):t.left,n=o.has(t.right)?o.get(t.right):t.right;d.has(e)?d.get(e).push(n):d.set(e,[n]),d.has(n)?d.get(n).push(e):d.set(n,[e])}else{var r=l.has(t.top)?l.get(t.top):t.top,i=l.has(t.bottom)?l.get(t.bottom):t.bottom;p.has(r)?p.get(r).push(i):p.set(r,[i]),p.has(i)?p.get(i).push(r):p.set(i,[r])}}));var g=s((function(t,e){var n=[],r=[],i=new w,a=new Set,s=0;return t.forEach((function(o,l){if(!a.has(l)){n[s]=[],r[s]=!1;var c=l;for(i.push(c),a.add(c),n[s].push(c);0!=i.length;){c=i.shift(),e.has(c)&&(r[s]=!0),t.get(c).forEach((function(t){a.has(t)||(i.push(t),a.add(t),n[s].push(t))}))}s++}})),{components:n,isFixed:r}}),"constructComponents"),f=g(d,t.fixedNodesOnHorizontal);this.componentsOnHorizontal=f.components,this.fixedComponentsOnHorizontal=f.isFixed;var m=g(p,t.fixedNodesOnVertical);this.componentsOnVertical=m.components,this.fixedComponentsOnVertical=m.isFixed}}},k.prototype.updateDisplacements=function(){var t=this;if(this.constraints.fixedNodeConstraint&&this.constraints.fixedNodeConstraint.forEach((function(e){var n=t.idToNodeMap.get(e.nodeId);n.displacementX=0,n.displacementY=0})),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var e=this.constraints.alignmentConstraint.vertical,n=0;n<e.length;n++){for(var r=0,i=0;i<e[n].length;i++){if(this.fixedNodeSet.has(e[n][i])){r=0;break}r+=this.idToNodeMap.get(e[n][i]).displacementX}var a=r/e[n].length;for(i=0;i<e[n].length;i++)this.idToNodeMap.get(e[n][i]).displacementX=a}if(this.constraints.alignmentConstraint.horizontal){var s=this.constraints.alignmentConstraint.horizontal;for(n=0;n<s.length;n++){var o=0;for(i=0;i<s[n].length;i++){if(this.fixedNodeSet.has(s[n][i])){o=0;break}o+=this.idToNodeMap.get(s[n][i]).displacementY}var l=o/s[n].length;for(i=0;i<s[n].length;i++)this.idToNodeMap.get(s[n][i]).displacementY=l}}}if(this.constraints.relativePlacementConstraint)if(c.RELAX_MOVEMENT_ON_CONSTRAINTS)this.totalIterations%10==0&&(this.shuffle(this.nodesInRelativeHorizontal),this.shuffle(this.nodesInRelativeVertical)),this.nodesInRelativeHorizontal.forEach((function(e){if(!t.fixedNodesOnHorizontal.has(e)){var n=0;n=t.dummyToNodeForVerticalAlignment.has(e)?t.idToNodeMap.get(t.dummyToNodeForVerticalAlignment.get(e)[0]).displacementX:t.idToNodeMap.get(e).displacementX,t.nodeToRelativeConstraintMapHorizontal.get(e).forEach((function(r){var i;r.right?(i=t.nodeToTempPositionMapHorizontal.get(r.right)-t.nodeToTempPositionMapHorizontal.get(e)-n)<r.gap&&(n-=r.gap-i):(i=t.nodeToTempPositionMapHorizontal.get(e)-t.nodeToTempPositionMapHorizontal.get(r.left)+n)<r.gap&&(n+=r.gap-i)})),t.nodeToTempPositionMapHorizontal.set(e,t.nodeToTempPositionMapHorizontal.get(e)+n),t.dummyToNodeForVerticalAlignment.has(e)?t.dummyToNodeForVerticalAlignment.get(e).forEach((function(e){t.idToNodeMap.get(e).displacementX=n})):t.idToNodeMap.get(e).displacementX=n}})),this.nodesInRelativeVertical.forEach((function(e){if(!t.fixedNodesOnHorizontal.has(e)){var n=0;n=t.dummyToNodeForHorizontalAlignment.has(e)?t.idToNodeMap.get(t.dummyToNodeForHorizontalAlignment.get(e)[0]).displacementY:t.idToNodeMap.get(e).displacementY,t.nodeToRelativeConstraintMapVertical.get(e).forEach((function(r){var i;r.bottom?(i=t.nodeToTempPositionMapVertical.get(r.bottom)-t.nodeToTempPositionMapVertical.get(e)-n)<r.gap&&(n-=r.gap-i):(i=t.nodeToTempPositionMapVertical.get(e)-t.nodeToTempPositionMapVertical.get(r.top)+n)<r.gap&&(n+=r.gap-i)})),t.nodeToTempPositionMapVertical.set(e,t.nodeToTempPositionMapVertical.get(e)+n),t.dummyToNodeForHorizontalAlignment.has(e)?t.dummyToNodeForHorizontalAlignment.get(e).forEach((function(e){t.idToNodeMap.get(e).displacementY=n})):t.idToNodeMap.get(e).displacementY=n}}));else{for(n=0;n<this.componentsOnHorizontal.length;n++){var h=this.componentsOnHorizontal[n];if(this.fixedComponentsOnHorizontal[n])for(i=0;i<h.length;i++)this.dummyToNodeForVerticalAlignment.has(h[i])?this.dummyToNodeForVerticalAlignment.get(h[i]).forEach((function(e){t.idToNodeMap.get(e).displacementX=0})):this.idToNodeMap.get(h[i]).displacementX=0;else{var u=0,d=0;for(i=0;i<h.length;i++){if(this.dummyToNodeForVerticalAlignment.has(h[i]))u+=(g=this.dummyToNodeForVerticalAlignment.get(h[i])).length*this.idToNodeMap.get(g[0]).displacementX,d+=g.length;else u+=this.idToNodeMap.get(h[i]).displacementX,d++}var p=u/d;for(i=0;i<h.length;i++)this.dummyToNodeForVerticalAlignment.has(h[i])?this.dummyToNodeForVerticalAlignment.get(h[i]).forEach((function(e){t.idToNodeMap.get(e).displacementX=p})):this.idToNodeMap.get(h[i]).displacementX=p}}for(n=0;n<this.componentsOnVertical.length;n++){h=this.componentsOnVertical[n];if(this.fixedComponentsOnVertical[n])for(i=0;i<h.length;i++)this.dummyToNodeForHorizontalAlignment.has(h[i])?this.dummyToNodeForHorizontalAlignment.get(h[i]).forEach((function(e){t.idToNodeMap.get(e).displacementY=0})):this.idToNodeMap.get(h[i]).displacementY=0;else{for(u=0,d=0,i=0;i<h.length;i++){var g;if(this.dummyToNodeForHorizontalAlignment.has(h[i]))u+=(g=this.dummyToNodeForHorizontalAlignment.get(h[i])).length*this.idToNodeMap.get(g[0]).displacementY,d+=g.length;else u+=this.idToNodeMap.get(h[i]).displacementY,d++}for(p=u/d,i=0;i<h.length;i++)this.dummyToNodeForHorizontalAlignment.has(h[i])?this.dummyToNodeForHorizontalAlignment.get(h[i]).forEach((function(e){t.idToNodeMap.get(e).displacementY=p})):this.idToNodeMap.get(h[i]).displacementY=p}}}},k.prototype.calculateNodesToApplyGravitationTo=function(){var t,e,n=[],r=this.graphManager.getGraphs(),i=r.length;for(e=0;e<i;e++)(t=r[e]).updateConnected(),t.isConnected||(n=n.concat(t.getNodes()));return n},k.prototype.createBendpoints=function(){var t=[];t=t.concat(this.graphManager.getAllEdges());var e,n=new Set;for(e=0;e<t.length;e++){var r=t[e];if(!n.has(r)){var i=r.getSource(),a=r.getTarget();if(i==a)r.getBendpoints().push(new g),r.getBendpoints().push(new g),this.createDummyNodesForBendpoints(r),n.add(r);else{var s=[];if(s=(s=s.concat(i.getEdgeListToNode(a))).concat(a.getEdgeListToNode(i)),!n.has(s[0])){var o;if(s.length>1)for(o=0;o<s.length;o++){var l=s[o];l.getBendpoints().push(new g),this.createDummyNodesForBendpoints(l)}s.forEach((function(t){n.add(t)}))}}}if(n.size==t.length)break}},k.prototype.positionNodesRadially=function(t){for(var e=new p(0,0),n=Math.ceil(Math.sqrt(t.length)),r=0,i=0,a=0,s=new g(0,0),o=0;o<t.length;o++){o%n==0&&(a=0,i=r,0!=o&&(i+=c.DEFAULT_COMPONENT_SEPERATION),r=0);var l=t[o],h=m.findCenterOfTree(l);e.x=a,e.y=i,(s=k.radialLayout(l,h,e)).y>r&&(r=Math.floor(s.y)),a=Math.floor(s.x+c.DEFAULT_COMPONENT_SEPERATION)}this.transform(new g(d.WORLD_CENTER_X-s.x/2,d.WORLD_CENTER_Y-s.y/2))},k.radialLayout=function(t,e,n){var r=Math.max(this.maxDiagonalInTree(t),c.DEFAULT_RADIAL_SEPARATION);k.branchRadialLayout(e,null,0,359,0,r);var i=x.calculateBounds(t),a=new b;a.setDeviceOrgX(i.getMinX()),a.setDeviceOrgY(i.getMinY()),a.setWorldOrgX(n.x),a.setWorldOrgY(n.y);for(var s=0;s<t.length;s++){t[s].transform(a)}var o=new g(i.getMaxX(),i.getMaxY());return a.inverseTransformPoint(o)},k.branchRadialLayout=function(t,e,n,r,i,a){var s=(r-n+1)/2;s<0&&(s+=180);var o=(s+n)%360*v.TWO_PI/360,l=i*Math.cos(o),c=i*Math.sin(o);t.setCenter(l,c);var h=[],u=(h=h.concat(t.getEdges())).length;null!=e&&u--;for(var d,p=0,g=h.length,f=t.getEdgesBetween(e);f.length>1;){var m=f[0];f.splice(0,1);var y=h.indexOf(m);y>=0&&h.splice(y,1),g--,u--}d=null!=e?(h.indexOf(f[0])+1)%g:0;for(var x=Math.abs(r-n)/u,b=d;p!=u;b=++b%g){var w=h[b].getOtherEnd(t);if(w!=e){var T=(n+p*x)%360,_=(T+x)%360;k.branchRadialLayout(w,t,T,_,i+a,a),p++}}},k.maxDiagonalInTree=function(t){for(var e=y.MIN_VALUE,n=0;n<t.length;n++){var r=t[n].getDiagonal();r>e&&(e=r)}return e},k.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},k.prototype.groupZeroDegreeMembers=function(){var t=this,e={};this.memberGroups={},this.idToDummyNode={};for(var n=[],r=this.graphManager.getAllNodes(),i=0;i<r.length;i++){var a=(s=r[i]).getParent();0!==this.getNodeDegreeWithChildren(s)||null!=a.id&&this.getToBeTiled(a)||n.push(s)}for(i=0;i<n.length;i++){var s,l=(s=n[i]).getParent().id;void 0===e[l]&&(e[l]=[]),e[l]=e[l].concat(s)}Object.keys(e).forEach((function(n){if(e[n].length>1){var r="DummyCompound_"+n;t.memberGroups[r]=e[n];var i=e[n][0].getParent(),a=new o(t.graphManager);a.id=r,a.paddingLeft=i.paddingLeft||0,a.paddingRight=i.paddingRight||0,a.paddingBottom=i.paddingBottom||0,a.paddingTop=i.paddingTop||0,t.idToDummyNode[r]=a;var s=t.getGraphManager().add(t.newGraph(),a),l=i.getChild();l.add(a);for(var c=0;c<e[n].length;c++){var h=e[n][c];l.remove(h),s.add(h)}}}))},k.prototype.clearCompounds=function(){var t={},e={};this.performDFSOnCompounds();for(var n=0;n<this.compoundOrder.length;n++)e[this.compoundOrder[n].id]=this.compoundOrder[n],t[this.compoundOrder[n].id]=[].concat(this.compoundOrder[n].getChild().getNodes()),this.graphManager.remove(this.compoundOrder[n].getChild()),this.compoundOrder[n].child=null;this.graphManager.resetAllNodes(),this.tileCompoundMembers(t,e)},k.prototype.clearZeroDegreeMembers=function(){var t=this,e=this.tiledZeroDegreePack=[];Object.keys(this.memberGroups).forEach((function(n){var r=t.idToDummyNode[n];if(e[n]=t.tileNodes(t.memberGroups[n],r.paddingLeft+r.paddingRight),r.rect.width=e[n].width,r.rect.height=e[n].height,r.setCenter(e[n].centerX,e[n].centerY),r.labelMarginLeft=0,r.labelMarginTop=0,c.NODE_DIMENSIONS_INCLUDE_LABELS){var i=r.rect.width,a=r.rect.height;r.labelWidth&&("left"==r.labelPosHorizontal?(r.rect.x-=r.labelWidth,r.setWidth(i+r.labelWidth),r.labelMarginLeft=r.labelWidth):"center"==r.labelPosHorizontal&&r.labelWidth>i?(r.rect.x-=(r.labelWidth-i)/2,r.setWidth(r.labelWidth),r.labelMarginLeft=(r.labelWidth-i)/2):"right"==r.labelPosHorizontal&&r.setWidth(i+r.labelWidth)),r.labelHeight&&("top"==r.labelPosVertical?(r.rect.y-=r.labelHeight,r.setHeight(a+r.labelHeight),r.labelMarginTop=r.labelHeight):"center"==r.labelPosVertical&&r.labelHeight>a?(r.rect.y-=(r.labelHeight-a)/2,r.setHeight(r.labelHeight),r.labelMarginTop=(r.labelHeight-a)/2):"bottom"==r.labelPosVertical&&r.setHeight(a+r.labelHeight))}}))},k.prototype.repopulateCompounds=function(){for(var t=this.compoundOrder.length-1;t>=0;t--){var e=this.compoundOrder[t],n=e.id,r=e.paddingLeft,i=e.paddingTop,a=e.labelMarginLeft,s=e.labelMarginTop;this.adjustLocations(this.tiledMemberPack[n],e.rect.x,e.rect.y,r,i,a,s)}},k.prototype.repopulateZeroDegreeMembers=function(){var t=this,e=this.tiledZeroDegreePack;Object.keys(e).forEach((function(n){var r=t.idToDummyNode[n],i=r.paddingLeft,a=r.paddingTop,s=r.labelMarginLeft,o=r.labelMarginTop;t.adjustLocations(e[n],r.rect.x,r.rect.y,i,a,s,o)}))},k.prototype.getToBeTiled=function(t){var e=t.id;if(null!=this.toBeTiled[e])return this.toBeTiled[e];var n=t.getChild();if(null==n)return this.toBeTiled[e]=!1,!1;for(var r=n.getNodes(),i=0;i<r.length;i++){var a=r[i];if(this.getNodeDegree(a)>0)return this.toBeTiled[e]=!1,!1;if(null!=a.getChild()){if(!this.getToBeTiled(a))return this.toBeTiled[e]=!1,!1}else this.toBeTiled[a.id]=!1}return this.toBeTiled[e]=!0,!0},k.prototype.getNodeDegree=function(t){t.id;for(var e=t.getEdges(),n=0,r=0;r<e.length;r++){var i=e[r];i.getSource().id!==i.getTarget().id&&(n+=1)}return n},k.prototype.getNodeDegreeWithChildren=function(t){var e=this.getNodeDegree(t);if(null==t.getChild())return e;for(var n=t.getChild().getNodes(),r=0;r<n.length;r++){var i=n[r];e+=this.getNodeDegreeWithChildren(i)}return e},k.prototype.performDFSOnCompounds=function(){this.compoundOrder=[],this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes())},k.prototype.fillCompexOrderByDFS=function(t){for(var e=0;e<t.length;e++){var n=t[e];null!=n.getChild()&&this.fillCompexOrderByDFS(n.getChild().getNodes()),this.getToBeTiled(n)&&this.compoundOrder.push(n)}},k.prototype.adjustLocations=function(t,e,n,r,i,a,s){n+=i+s;for(var o=e+=r+a,l=0;l<t.rows.length;l++){var c=t.rows[l];e=o;for(var h=0,u=0;u<c.length;u++){var d=c[u];d.rect.x=e,d.rect.y=n,e+=d.rect.width+t.horizontalPadding,d.rect.height>h&&(h=d.rect.height)}n+=h+t.verticalPadding}},k.prototype.tileCompoundMembers=function(t,e){var n=this;this.tiledMemberPack=[],Object.keys(t).forEach((function(r){var i=e[r];if(n.tiledMemberPack[r]=n.tileNodes(t[r],i.paddingLeft+i.paddingRight),i.rect.width=n.tiledMemberPack[r].width,i.rect.height=n.tiledMemberPack[r].height,i.setCenter(n.tiledMemberPack[r].centerX,n.tiledMemberPack[r].centerY),i.labelMarginLeft=0,i.labelMarginTop=0,c.NODE_DIMENSIONS_INCLUDE_LABELS){var a=i.rect.width,s=i.rect.height;i.labelWidth&&("left"==i.labelPosHorizontal?(i.rect.x-=i.labelWidth,i.setWidth(a+i.labelWidth),i.labelMarginLeft=i.labelWidth):"center"==i.labelPosHorizontal&&i.labelWidth>a?(i.rect.x-=(i.labelWidth-a)/2,i.setWidth(i.labelWidth),i.labelMarginLeft=(i.labelWidth-a)/2):"right"==i.labelPosHorizontal&&i.setWidth(a+i.labelWidth)),i.labelHeight&&("top"==i.labelPosVertical?(i.rect.y-=i.labelHeight,i.setHeight(s+i.labelHeight),i.labelMarginTop=i.labelHeight):"center"==i.labelPosVertical&&i.labelHeight>s?(i.rect.y-=(i.labelHeight-s)/2,i.setHeight(i.labelHeight),i.labelMarginTop=(i.labelHeight-s)/2):"bottom"==i.labelPosVertical&&i.setHeight(s+i.labelHeight))}}))},k.prototype.tileNodes=function(t,e){var n=this.tileNodesByFavoringDim(t,e,!0),r=this.tileNodesByFavoringDim(t,e,!1),i=this.getOrgRatio(n);return this.getOrgRatio(r)<i?r:n},k.prototype.getOrgRatio=function(t){var e=t.width/t.height;return e<1&&(e=1/e),e},k.prototype.calcIdealRowWidth=function(t,e){var n=c.TILING_PADDING_VERTICAL,r=c.TILING_PADDING_HORIZONTAL,i=t.length,a=0,s=0,o=0;t.forEach((function(t){a+=t.getWidth(),s+=t.getHeight(),t.getWidth()>o&&(o=t.getWidth())}));var l,h=a/i,u=s/i,d=Math.pow(n-r,2)+4*(h+r)*(u+n)*i,p=(r-n+Math.sqrt(d))/(2*(h+r));e?(l=Math.ceil(p))==p&&l++:l=Math.floor(p);var g=l*(h+r)-r;return o>g&&(g=o),g+=2*r},k.prototype.tileNodesByFavoringDim=function(t,e,n){var r=c.TILING_PADDING_VERTICAL,i=c.TILING_PADDING_HORIZONTAL,a=c.TILING_COMPARE_BY,o={rows:[],rowWidth:[],rowHeight:[],width:0,height:e,verticalPadding:r,horizontalPadding:i,centerX:0,centerY:0};a&&(o.idealRowWidth=this.calcIdealRowWidth(t,n));var l=s((function(t){return t.rect.width*t.rect.height}),"getNodeArea"),h=s((function(t,e){return l(e)-l(t)}),"areaCompareFcn");t.sort((function(t,e){var n=h;return o.idealRowWidth?(n=a)(t.id,e.id):n(t,e)}));for(var u=0,d=0,p=0;p<t.length;p++){u+=(g=t[p]).getCenterX(),d+=g.getCenterY()}o.centerX=u/t.length,o.centerY=d/t.length;for(p=0;p<t.length;p++){var g=t[p];if(0==o.rows.length)this.insertNodeToRow(o,g,0,e);else if(this.canAddHorizontal(o,g.rect.width,g.rect.height)){var f=o.rows.length-1;o.idealRowWidth||(f=this.getShortestRowIndex(o)),this.insertNodeToRow(o,g,f,e)}else this.insertNodeToRow(o,g,o.rows.length,e);this.shiftToLastRow(o)}return o},k.prototype.insertNodeToRow=function(t,e,n,r){var i=r;if(n==t.rows.length){t.rows.push([]),t.rowWidth.push(i),t.rowHeight.push(0)}var a=t.rowWidth[n]+e.rect.width;t.rows[n].length>0&&(a+=t.horizontalPadding),t.rowWidth[n]=a,t.width<a&&(t.width=a);var s=e.rect.height;n>0&&(s+=t.verticalPadding);var o=0;s>t.rowHeight[n]&&(o=t.rowHeight[n],t.rowHeight[n]=s,o=t.rowHeight[n]-o),t.height+=o,t.rows[n].push(e)},k.prototype.getShortestRowIndex=function(t){for(var e=-1,n=Number.MAX_VALUE,r=0;r<t.rows.length;r++)t.rowWidth[r]<n&&(e=r,n=t.rowWidth[r]);return e},k.prototype.getLongestRowIndex=function(t){for(var e=-1,n=Number.MIN_VALUE,r=0;r<t.rows.length;r++)t.rowWidth[r]>n&&(e=r,n=t.rowWidth[r]);return e},k.prototype.canAddHorizontal=function(t,e,n){if(t.idealRowWidth){var r=t.rows.length-1;return t.rowWidth[r]+e+t.horizontalPadding<=t.idealRowWidth}var i=this.getShortestRowIndex(t);if(i<0)return!0;var a=t.rowWidth[i];if(a+t.horizontalPadding+e<=t.width)return!0;var s,o,l=0;return t.rowHeight[i]<n&&i>0&&(l=n+t.verticalPadding-t.rowHeight[i]),s=t.width-a>=e+t.horizontalPadding?(t.height+l)/(a+e+t.horizontalPadding):(t.height+l)/t.width,l=n+t.verticalPadding,(o=t.width<e?(t.height+l)/e:(t.height+l)/t.width)<1&&(o=1/o),s<1&&(s=1/s),s<o},k.prototype.shiftToLastRow=function(t){var e=this.getLongestRowIndex(t),n=t.rowWidth.length-1,r=t.rows[e],i=r[r.length-1],a=i.width+t.horizontalPadding;if(t.width-t.rowWidth[n]>a&&e!=n){r.splice(-1,1),t.rows[n].push(i),t.rowWidth[e]=t.rowWidth[e]-a,t.rowWidth[n]=t.rowWidth[n]+a,t.width=t.rowWidth[instance.getLongestRowIndex(t)];for(var s=Number.MIN_VALUE,o=0;o<r.length;o++)r[o].height>s&&(s=r[o].height);e>0&&(s+=t.verticalPadding);var l=t.rowHeight[e]+t.rowHeight[n];t.rowHeight[e]=s,t.rowHeight[n]<i.height+t.verticalPadding&&(t.rowHeight[n]=i.height+t.verticalPadding);var c=t.rowHeight[e]+t.rowHeight[n];t.height+=c-l,this.shiftToLastRow(t)}},k.prototype.tilingPreLayout=function(){c.TILE&&(this.groupZeroDegreeMembers(),this.clearCompounds(),this.clearZeroDegreeMembers())},k.prototype.tilingPostLayout=function(){c.TILE&&(this.repopulateZeroDegreeMembers(),this.repopulateCompounds())},k.prototype.reduceTrees=function(){for(var t,e=[],n=!0;n;){var r=this.graphManager.getAllNodes(),i=[];n=!1;for(var a=0;a<r.length;a++)if(1==(t=r[a]).getEdges().length&&!t.getEdges()[0].isInterGraph&&null==t.getChild()){if(c.PURE_INCREMENTAL){var s=t.getEdges()[0].getOtherEnd(t),o=new f(t.getCenterX()-s.getCenterX(),t.getCenterY()-s.getCenterY());i.push([t,t.getEdges()[0],t.getOwner(),o])}else i.push([t,t.getEdges()[0],t.getOwner()]);n=!0}if(1==n){for(var l=[],h=0;h<i.length;h++)1==i[h][0].getEdges().length&&(l.push(i[h]),i[h][0].getOwner().remove(i[h][0]));e.push(l),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()}}this.prunedNodesAll=e},k.prototype.growTree=function(t){for(var e,n=t[t.length-1],r=0;r<n.length;r++)e=n[r],this.findPlaceforPrunedNode(e),e[2].add(e[0]),e[2].add(e[1],e[1].source,e[1].target);t.splice(t.length-1,1),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()},k.prototype.findPlaceforPrunedNode=function(t){var e,n,r=t[0];if(n=r==t[1].source?t[1].target:t[1].source,c.PURE_INCREMENTAL)r.setCenter(n.getCenterX()+t[3].getWidth(),n.getCenterY()+t[3].getHeight());else{var i=n.startX,a=n.finishX,s=n.startY,o=n.finishY,l=[0,0,0,0];if(s>0)for(var h=i;h<=a;h++)l[0]+=this.grid[h][s-1].length+this.grid[h][s].length-1;if(a<this.grid.length-1)for(h=s;h<=o;h++)l[1]+=this.grid[a+1][h].length+this.grid[a][h].length-1;if(o<this.grid[0].length-1)for(h=i;h<=a;h++)l[2]+=this.grid[h][o+1].length+this.grid[h][o].length-1;if(i>0)for(h=s;h<=o;h++)l[3]+=this.grid[i-1][h].length+this.grid[i][h].length-1;for(var d,p,g=y.MAX_VALUE,f=0;f<l.length;f++)l[f]<g?(g=l[f],d=1,p=f):l[f]==g&&d++;if(3==d&&0==g)0==l[0]&&0==l[1]&&0==l[2]?e=1:0==l[0]&&0==l[1]&&0==l[3]?e=0:0==l[0]&&0==l[2]&&0==l[3]?e=3:0==l[1]&&0==l[2]&&0==l[3]&&(e=2);else if(2==d&&0==g){var m=Math.floor(2*Math.random());e=0==l[0]&&0==l[1]?0==m?0:1:0==l[0]&&0==l[2]?0==m?0:2:0==l[0]&&0==l[3]?0==m?0:3:0==l[1]&&0==l[2]?0==m?1:2:0==l[1]&&0==l[3]?0==m?1:3:0==m?2:3}else if(4==d&&0==g){e=m=Math.floor(4*Math.random())}else e=p;0==e?r.setCenter(n.getCenterX(),n.getCenterY()-n.getHeight()/2-u.DEFAULT_EDGE_LENGTH-r.getHeight()/2):1==e?r.setCenter(n.getCenterX()+n.getWidth()/2+u.DEFAULT_EDGE_LENGTH+r.getWidth()/2,n.getCenterY()):2==e?r.setCenter(n.getCenterX(),n.getCenterY()+n.getHeight()/2+u.DEFAULT_EDGE_LENGTH+r.getHeight()/2):r.setCenter(n.getCenterX()-n.getWidth()/2-u.DEFAULT_EDGE_LENGTH-r.getWidth()/2,n.getCenterY())}},t.exports=k},991:(t,e,n)=>{var r=n(551).FDLayoutNode,i=n(551).IMath;function a(t,e,n,i){r.call(this,t,e,n,i)}for(var o in s(a,"CoSENode"),a.prototype=Object.create(r.prototype),r)a[o]=r[o];a.prototype.calculateDisplacement=function(){var t=this.graphManager.getLayout();null!=this.getChild()&&this.fixedNodeWeight?(this.displacementX+=t.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.fixedNodeWeight,this.displacementY+=t.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.fixedNodeWeight):(this.displacementX+=t.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY+=t.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren),Math.abs(this.displacementX)>t.coolingFactor*t.maxNodeDisplacement&&(this.displacementX=t.coolingFactor*t.maxNodeDisplacement*i.sign(this.displacementX)),Math.abs(this.displacementY)>t.coolingFactor*t.maxNodeDisplacement&&(this.displacementY=t.coolingFactor*t.maxNodeDisplacement*i.sign(this.displacementY)),this.child&&this.child.getNodes().length>0&&this.propogateDisplacementToChildren(this.displacementX,this.displacementY)},a.prototype.propogateDisplacementToChildren=function(t,e){for(var n,r=this.getChild().getNodes(),i=0;i<r.length;i++)null==(n=r[i]).getChild()?(n.displacementX+=t,n.displacementY+=e):n.propogateDisplacementToChildren(t,e)},a.prototype.move=function(){var t=this.graphManager.getLayout();null!=this.child&&0!=this.child.getNodes().length||(this.moveBy(this.displacementX,this.displacementY),t.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},a.prototype.setPred1=function(t){this.pred1=t},a.prototype.getPred1=function(){return pred1},a.prototype.getPred2=function(){return pred2},a.prototype.setNext=function(t){this.next=t},a.prototype.getNext=function(){return next},a.prototype.setProcessed=function(t){this.processed=t},a.prototype.isProcessed=function(){return processed},t.exports=a},902:(t,e,n)=>{function r(t){if(Array.isArray(t)){for(var e=0,n=Array(t.length);e<t.length;e++)n[e]=t[e];return n}return Array.from(t)}s(r,"_toConsumableArray");var i=n(806),a=n(551).LinkedList,o=n(551).Matrix,l=n(551).SVD;function c(){}s(c,"ConstraintHandler"),c.handleConstraints=function(t){var e={};e.fixedNodeConstraint=t.constraints.fixedNodeConstraint,e.alignmentConstraint=t.constraints.alignmentConstraint,e.relativePlacementConstraint=t.constraints.relativePlacementConstraint;for(var n=new Map,c=new Map,h=[],u=[],d=t.getAllNodes(),p=0,g=0;g<d.length;g++){var f=d[g];null==f.getChild()&&(c.set(f.id,p++),h.push(f.getCenterX()),u.push(f.getCenterY()),n.set(f.id,f))}e.relativePlacementConstraint&&e.relativePlacementConstraint.forEach((function(t){t.gap||0==t.gap||(t.left?t.gap=i.DEFAULT_EDGE_LENGTH+n.get(t.left).getWidth()/2+n.get(t.right).getWidth()/2:t.gap=i.DEFAULT_EDGE_LENGTH+n.get(t.top).getHeight()/2+n.get(t.bottom).getHeight()/2)}));var m=s((function(t,e){return{x:t.x-e.x,y:t.y-e.y}}),"calculatePositionDiff"),y=s((function(t){var e=0,n=0;return t.forEach((function(t){e+=h[c.get(t)],n+=u[c.get(t)]})),{x:e/t.size,y:n/t.size}}),"calculateAvgPosition"),v=s((function(t,e,n,i,o){function l(t,e){var n=new Set(t),r=!0,i=!1,a=void 0;try{for(var s,o=e[Symbol.iterator]();!(r=(s=o.next()).done);r=!0){var l=s.value;n.add(l)}}catch(t){i=!0,a=t}finally{try{!r&&o.return&&o.return()}finally{if(i)throw a}}return n}s(l,"setUnion");var d=new Map;t.forEach((function(t,e){d.set(e,0)})),t.forEach((function(t,e){t.forEach((function(t){d.set(t.id,d.get(t.id)+1)}))}));var p=new Map,g=new Map,f=new a;d.forEach((function(t,r){0==t?(f.push(r),n||("horizontal"==e?p.set(r,c.has(r)?h[c.get(r)]:i.get(r)):p.set(r,c.has(r)?u[c.get(r)]:i.get(r)))):p.set(r,Number.NEGATIVE_INFINITY),n&&g.set(r,new Set([r]))})),n&&o.forEach((function(t){var r=[];if(t.forEach((function(t){n.has(t)&&r.push(t)})),r.length>0){var a=0;r.forEach((function(t){"horizontal"==e?(p.set(t,c.has(t)?h[c.get(t)]:i.get(t)),a+=p.get(t)):(p.set(t,c.has(t)?u[c.get(t)]:i.get(t)),a+=p.get(t))})),a/=r.length,t.forEach((function(t){n.has(t)||p.set(t,a)}))}else{var s=0;t.forEach((function(t){s+="horizontal"==e?c.has(t)?h[c.get(t)]:i.get(t):c.has(t)?u[c.get(t)]:i.get(t)})),s/=t.length,t.forEach((function(t){p.set(t,s)}))}}));for(var m=s((function(){var r=f.shift();t.get(r).forEach((function(t){if(p.get(t.id)<p.get(r)+t.gap)if(n&&n.has(t.id)){var a=void 0;if(a="horizontal"==e?c.has(t.id)?h[c.get(t.id)]:i.get(t.id):c.has(t.id)?u[c.get(t.id)]:i.get(t.id),p.set(t.id,a),a<p.get(r)+t.gap){var s=p.get(r)+t.gap-a;g.get(r).forEach((function(t){p.set(t,p.get(t)-s)}))}}else p.set(t.id,p.get(r)+t.gap);d.set(t.id,d.get(t.id)-1),0==d.get(t.id)&&f.push(t.id),n&&g.set(t.id,l(g.get(r),g.get(t.id)))}))}),"_loop");0!=f.length;)m();if(n){var y=new Set;t.forEach((function(t,e){0==t.length&&y.add(e)}));var v=[];g.forEach((function(t,e){if(y.has(e)){var i=!1,a=!0,s=!1,o=void 0;try{for(var l,c=t[Symbol.iterator]();!(a=(l=c.next()).done);a=!0){var h=l.value;n.has(h)&&(i=!0)}}catch(t){s=!0,o=t}finally{try{!a&&c.return&&c.return()}finally{if(s)throw o}}if(!i){var u=!1,d=void 0;v.forEach((function(e,n){e.has([].concat(r(t))[0])&&(u=!0,d=n)})),u?t.forEach((function(t){v[d].add(t)})):v.push(new Set(t))}}})),v.forEach((function(t,n){var r=Number.POSITIVE_INFINITY,a=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY,o=Number.NEGATIVE_INFINITY,l=!0,d=!1,g=void 0;try{for(var f,m=t[Symbol.iterator]();!(l=(f=m.next()).done);l=!0){var y=f.value,v=void 0;v="horizontal"==e?c.has(y)?h[c.get(y)]:i.get(y):c.has(y)?u[c.get(y)]:i.get(y);var x=p.get(y);v<r&&(r=v),v>s&&(s=v),x<a&&(a=x),x>o&&(o=x)}}catch(t){d=!0,g=t}finally{try{!l&&m.return&&m.return()}finally{if(d)throw g}}var b=(r+s)/2-(a+o)/2,w=!0,k=!1,T=void 0;try{for(var _,E=t[Symbol.iterator]();!(w=(_=E.next()).done);w=!0){var C=_.value;p.set(C,p.get(C)+b)}}catch(t){k=!0,T=t}finally{try{!w&&E.return&&E.return()}finally{if(k)throw T}}}))}return p}),"findAppropriatePositionForRelativePlacement"),x=s((function(t){var e=0,n=0,r=0,i=0;if(t.forEach((function(t){t.left?h[c.get(t.left)]-h[c.get(t.right)]>=0?e++:n++:u[c.get(t.top)]-u[c.get(t.bottom)]>=0?r++:i++})),e>n&&r>i)for(var a=0;a<c.size;a++)h[a]=-1*h[a],u[a]=-1*u[a];else if(e>n)for(var s=0;s<c.size;s++)h[s]=-1*h[s];else if(r>i)for(var o=0;o<c.size;o++)u[o]=-1*u[o]}),"applyReflectionForRelativePlacement"),b=s((function(t){var e=[],n=new a,r=new Set,i=0;return t.forEach((function(a,s){if(!r.has(s)){e[i]=[];var o=s;for(n.push(o),r.add(o),e[i].push(o);0!=n.length;){o=n.shift(),t.get(o).forEach((function(t){r.has(t.id)||(n.push(t.id),r.add(t.id),e[i].push(t.id))}))}i++}})),e}),"findComponents"),w=s((function(t){var e=new Map;return t.forEach((function(t,n){e.set(n,[])})),t.forEach((function(t,n){t.forEach((function(t){e.get(n).push(t),e.get(t.id).push({id:n,gap:t.gap,direction:t.direction})}))})),e}),"dagToUndirected"),k=s((function(t){var e=new Map;return t.forEach((function(t,n){e.set(n,[])})),t.forEach((function(t,n){t.forEach((function(t){e.get(t.id).push({id:n,gap:t.gap,direction:t.direction})}))})),e}),"dagToReversed"),T=[],_=[],E=!1,C=!1,S=new Set,A=new Map,L=new Map,N=[];if(e.fixedNodeConstraint&&e.fixedNodeConstraint.forEach((function(t){S.add(t.nodeId)})),e.relativePlacementConstraint&&(e.relativePlacementConstraint.forEach((function(t){t.left?(A.has(t.left)?A.get(t.left).push({id:t.right,gap:t.gap,direction:"horizontal"}):A.set(t.left,[{id:t.right,gap:t.gap,direction:"horizontal"}]),A.has(t.right)||A.set(t.right,[])):(A.has(t.top)?A.get(t.top).push({id:t.bottom,gap:t.gap,direction:"vertical"}):A.set(t.top,[{id:t.bottom,gap:t.gap,direction:"vertical"}]),A.has(t.bottom)||A.set(t.bottom,[]))})),L=w(A),N=b(L)),i.TRANSFORM_ON_CONSTRAINT_HANDLING){if(e.fixedNodeConstraint&&e.fixedNodeConstraint.length>1)e.fixedNodeConstraint.forEach((function(t,e){T[e]=[t.position.x,t.position.y],_[e]=[h[c.get(t.nodeId)],u[c.get(t.nodeId)]]})),E=!0;else if(e.alignmentConstraint)!function(){var t=0;if(e.alignmentConstraint.vertical){for(var n=e.alignmentConstraint.vertical,i=s((function(e){var i=new Set;n[e].forEach((function(t){i.add(t)}));var a=new Set([].concat(r(i)).filter((function(t){return S.has(t)}))),s=void 0;s=a.size>0?h[c.get(a.values().next().value)]:y(i).x,n[e].forEach((function(e){T[t]=[s,u[c.get(e)]],_[t]=[h[c.get(e)],u[c.get(e)]],t++}))}),"_loop2"),a=0;a<n.length;a++)i(a);E=!0}if(e.alignmentConstraint.horizontal){for(var o=e.alignmentConstraint.horizontal,l=s((function(e){var n=new Set;o[e].forEach((function(t){n.add(t)}));var i=new Set([].concat(r(n)).filter((function(t){return S.has(t)}))),a=void 0;a=i.size>0?h[c.get(i.values().next().value)]:y(n).y,o[e].forEach((function(e){T[t]=[h[c.get(e)],a],_[t]=[h[c.get(e)],u[c.get(e)]],t++}))}),"_loop3"),d=0;d<o.length;d++)l(d);E=!0}e.relativePlacementConstraint&&(C=!0)}();else if(e.relativePlacementConstraint){for(var I=0,M=0,R=0;R<N.length;R++)N[R].length>I&&(I=N[R].length,M=R);if(I<L.size/2)x(e.relativePlacementConstraint),E=!1,C=!1;else{var D=new Map,O=new Map,P=[];N[M].forEach((function(t){A.get(t).forEach((function(e){"horizontal"==e.direction?(D.has(t)?D.get(t).push(e):D.set(t,[e]),D.has(e.id)||D.set(e.id,[]),P.push({left:t,right:e.id})):(O.has(t)?O.get(t).push(e):O.set(t,[e]),O.has(e.id)||O.set(e.id,[]),P.push({top:t,bottom:e.id}))}))})),x(P),C=!1;var B=v(D,"horizontal"),$=v(O,"vertical");N[M].forEach((function(t,e){_[e]=[h[c.get(t)],u[c.get(t)]],T[e]=[],B.has(t)?T[e][0]=B.get(t):T[e][0]=h[c.get(t)],$.has(t)?T[e][1]=$.get(t):T[e][1]=u[c.get(t)]})),E=!0}}if(E){for(var F,z=o.transpose(T),U=o.transpose(_),G=0;G<z.length;G++)z[G]=o.multGamma(z[G]),U[G]=o.multGamma(U[G]);var q=o.multMat(z,o.transpose(U)),j=l.svd(q);F=o.multMat(j.V,o.transpose(j.U));for(var Y=0;Y<c.size;Y++){var W=[h[Y],u[Y]],H=[F[0][0],F[1][0]],V=[F[0][1],F[1][1]];h[Y]=o.dotProduct(W,H),u[Y]=o.dotProduct(W,V)}C&&x(e.relativePlacementConstraint)}}if(i.ENFORCE_CONSTRAINTS){if(e.fixedNodeConstraint&&e.fixedNodeConstraint.length>0){var X={x:0,y:0};e.fixedNodeConstraint.forEach((function(t,e){var n={x:h[c.get(t.nodeId)],y:u[c.get(t.nodeId)]},r=t.position,i=m(r,n);X.x+=i.x,X.y+=i.y})),X.x/=e.fixedNodeConstraint.length,X.y/=e.fixedNodeConstraint.length,h.forEach((function(t,e){h[e]+=X.x})),u.forEach((function(t,e){u[e]+=X.y})),e.fixedNodeConstraint.forEach((function(t){h[c.get(t.nodeId)]=t.position.x,u[c.get(t.nodeId)]=t.position.y}))}if(e.alignmentConstraint){if(e.alignmentConstraint.vertical)for(var K=e.alignmentConstraint.vertical,Z=s((function(t){var e=new Set;K[t].forEach((function(t){e.add(t)}));var n=new Set([].concat(r(e)).filter((function(t){return S.has(t)}))),i=void 0;i=n.size>0?h[c.get(n.values().next().value)]:y(e).x,e.forEach((function(t){S.has(t)||(h[c.get(t)]=i)}))}),"_loop4"),Q=0;Q<K.length;Q++)Z(Q);if(e.alignmentConstraint.horizontal)for(var J=e.alignmentConstraint.horizontal,tt=s((function(t){var e=new Set;J[t].forEach((function(t){e.add(t)}));var n=new Set([].concat(r(e)).filter((function(t){return S.has(t)}))),i=void 0;i=n.size>0?u[c.get(n.values().next().value)]:y(e).y,e.forEach((function(t){S.has(t)||(u[c.get(t)]=i)}))}),"_loop5"),et=0;et<J.length;et++)tt(et)}e.relativePlacementConstraint&&function(){var t=new Map,n=new Map,r=new Map,i=new Map,a=new Map,o=new Map,l=new Set,d=new Set;if(S.forEach((function(t){l.add(t),d.add(t)})),e.alignmentConstraint){if(e.alignmentConstraint.vertical)for(var p=e.alignmentConstraint.vertical,g=s((function(e){r.set("dummy"+e,[]),p[e].forEach((function(n){t.set(n,"dummy"+e),r.get("dummy"+e).push(n),S.has(n)&&l.add("dummy"+e)})),a.set("dummy"+e,h[c.get(p[e][0])])}),"_loop6"),f=0;f<p.length;f++)g(f);if(e.alignmentConstraint.horizontal)for(var m=e.alignmentConstraint.horizontal,y=s((function(t){i.set("dummy"+t,[]),m[t].forEach((function(e){n.set(e,"dummy"+t),i.get("dummy"+t).push(e),S.has(e)&&d.add("dummy"+t)})),o.set("dummy"+t,u[c.get(m[t][0])])}),"_loop7"),x=0;x<m.length;x++)y(x)}var T=new Map,_=new Map,E=s((function(e){A.get(e).forEach((function(r){var i=void 0,a=void 0;"horizontal"==r.direction?(i=t.get(e)?t.get(e):e,a=t.get(r.id)?{id:t.get(r.id),gap:r.gap,direction:r.direction}:r,T.has(i)?T.get(i).push(a):T.set(i,[a]),T.has(a.id)||T.set(a.id,[])):(i=n.get(e)?n.get(e):e,a=n.get(r.id)?{id:n.get(r.id),gap:r.gap,direction:r.direction}:r,_.has(i)?_.get(i).push(a):_.set(i,[a]),_.has(a.id)||_.set(a.id,[]))}))}),"_loop8"),C=!0,L=!1,N=void 0;try{for(var I,M=A.keys()[Symbol.iterator]();!(C=(I=M.next()).done);C=!0){E(I.value)}}catch(t){L=!0,N=t}finally{try{!C&&M.return&&M.return()}finally{if(L)throw N}}var R=w(T),D=w(_),O=b(R),P=b(D),B=k(T),$=k(_),F=[],z=[];O.forEach((function(t,e){F[e]=[],t.forEach((function(t){0==B.get(t).length&&F[e].push(t)}))})),P.forEach((function(t,e){z[e]=[],t.forEach((function(t){0==$.get(t).length&&z[e].push(t)}))}));var U=v(T,"horizontal",l,a,F),G=v(_,"vertical",d,o,z),q=s((function(t){r.get(t)?r.get(t).forEach((function(e){h[c.get(e)]=U.get(t)})):h[c.get(t)]=U.get(t)}),"_loop9"),j=!0,Y=!1,W=void 0;try{for(var H,V=U.keys()[Symbol.iterator]();!(j=(H=V.next()).done);j=!0){q(H.value)}}catch(t){Y=!0,W=t}finally{try{!j&&V.return&&V.return()}finally{if(Y)throw W}}var X=s((function(t){i.get(t)?i.get(t).forEach((function(e){u[c.get(e)]=G.get(t)})):u[c.get(t)]=G.get(t)}),"_loop10"),K=!0,Z=!1,Q=void 0;try{for(var J,tt=G.keys()[Symbol.iterator]();!(K=(J=tt.next()).done);K=!0){X(J.value)}}catch(t){Z=!0,Q=t}finally{try{!K&&tt.return&&tt.return()}finally{if(Z)throw Q}}}()}for(var nt=0;nt<d.length;nt++){var rt=d[nt];null==rt.getChild()&&rt.setCenter(h[c.get(rt.id)],u[c.get(rt.id)])}},t.exports=c},551:e=>{e.exports=t}},n={};function r(t){var i=n[t];if(void 0!==i)return i.exports;var a=n[t]={exports:{}};return e[t](a,a.exports,r),a.exports}return s(r,"__webpack_require__"),r(45)})()}))}}),lIt=o({"../../node_modules/.pnpm/cytoscape-fcose@2.2.0_cytoscape@3.30.2/node_modules/cytoscape-fcose/cytoscape-fcose.js"(t,e){s((function(n,r){"object"==typeof t&&"object"==typeof e?e.exports=r(oIt()):"function"==typeof define&&define.amd?define(["cose-base"],r):"object"==typeof t?t.cytoscapeFcose=r(oIt()):n.cytoscapeFcose=r(n.coseBase)}),"webpackUniversalModuleDefinition")(t,(function(t){return(()=>{var e={658:t=>{t.exports=null!=Object.assign?Object.assign.bind(Object):function(t){for(var e=arguments.length,n=Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return n.forEach((function(e){Object.keys(e).forEach((function(n){return t[n]=e[n]}))})),t}},548:(t,e,n)=>{var r=function(){function t(t,e){var n=[],r=!0,i=!1,a=void 0;try{for(var s,o=t[Symbol.iterator]();!(r=(s=o.next()).done)&&(n.push(s.value),!e||n.length!==e);r=!0);}catch(t){i=!0,a=t}finally{try{!r&&o.return&&o.return()}finally{if(i)throw a}}return n}return s(t,"sliceIterator"),function(e,n){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),i=n(140).layoutBase.LinkedList,a={getTopMostNodes:function(t){for(var e={},n=0;n<t.length;n++)e[t[n].id()]=!0;return t.filter((function(t,n){"number"==typeof t&&(t=n);for(var r=t.parent()[0];null!=r;){if(e[r.id()])return!1;r=r.parent()[0]}return!0}))},connectComponents:function(t,e,n,r){var a=new i,o=new Set,l=[],c=void 0,h=void 0,u=void 0,d=!1,p=1,g=[],f=[],m=s((function(){var r=t.collection();f.push(r);var i=n[0],m=t.collection();m.merge(i).merge(i.descendants().intersection(e)),l.push(i),m.forEach((function(t){a.push(t),o.add(t),r.merge(t)}));for(var y=s((function(){i=a.shift();var s=t.collection();i.neighborhood().nodes().forEach((function(t){e.intersection(i.edgesWith(t)).length>0&&s.merge(t)}));for(var h=0;h<s.length;h++){var u=s[h];if(null!=(c=n.intersection(u.union(u.ancestors())))&&!o.has(c[0]))c.union(c.descendants()).forEach((function(t){a.push(t),o.add(t),r.merge(t),n.has(t)&&l.push(t)}))}}),"_loop2");0!=a.length;)y();if(r.forEach((function(t){e.intersection(t.connectedEdges()).forEach((function(t){r.has(t.source())&&r.has(t.target())&&r.merge(t)}))})),l.length==n.length&&(d=!0),!d||d&&p>1){h=l[0],u=h.connectedEdges().length,l.forEach((function(t){t.connectedEdges().length<u&&(u=t.connectedEdges().length,h=t)})),g.push(h.id());var v=t.collection();v.merge(l[0]),l.forEach((function(t){v.merge(t)})),l=[],n=n.difference(v),p++}}),"_loop");do{m()}while(!d);return r&&g.length>0&&r.set("dummy"+(r.size+1),g),f},relocateComponent:function(t,e,n){if(!n.fixedNodeConstraint){var i=Number.POSITIVE_INFINITY,a=Number.NEGATIVE_INFINITY,s=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY;if("draft"==n.quality){var l=!0,c=!1,h=void 0;try{for(var u,d=e.nodeIndexes[Symbol.iterator]();!(l=(u=d.next()).done);l=!0){var p=u.value,g=r(p,2),f=g[0],m=g[1],y=n.cy.getElementById(f);if(y){var v=y.boundingBox(),x=e.xCoords[m]-v.w/2,b=e.xCoords[m]+v.w/2,w=e.yCoords[m]-v.h/2,k=e.yCoords[m]+v.h/2;x<i&&(i=x),b>a&&(a=b),w<s&&(s=w),k>o&&(o=k)}}}catch(t){c=!0,h=t}finally{try{!l&&d.return&&d.return()}finally{if(c)throw h}}var T=t.x-(a+i)/2,_=t.y-(o+s)/2;e.xCoords=e.xCoords.map((function(t){return t+T})),e.yCoords=e.yCoords.map((function(t){return t+_}))}else{Object.keys(e).forEach((function(t){var n=e[t],r=n.getRect().x,l=n.getRect().x+n.getRect().width,c=n.getRect().y,h=n.getRect().y+n.getRect().height;r<i&&(i=r),l>a&&(a=l),c<s&&(s=c),h>o&&(o=h)}));var E=t.x-(a+i)/2,C=t.y-(o+s)/2;Object.keys(e).forEach((function(t){var n=e[t];n.setCenter(n.getCenterX()+E,n.getCenterY()+C)}))}}},calcBoundingBox:function(t,e,n,r){for(var i=Number.MAX_SAFE_INTEGER,a=Number.MIN_SAFE_INTEGER,s=Number.MAX_SAFE_INTEGER,o=Number.MIN_SAFE_INTEGER,l=void 0,c=void 0,h=void 0,u=void 0,d=t.descendants().not(":parent"),p=d.length,g=0;g<p;g++){var f=d[g];i>(l=e[r.get(f.id())]-f.width()/2)&&(i=l),a<(c=e[r.get(f.id())]+f.width()/2)&&(a=c),s>(h=n[r.get(f.id())]-f.height()/2)&&(s=h),o<(u=n[r.get(f.id())]+f.height()/2)&&(o=u)}var m={};return m.topLeftX=i,m.topLeftY=s,m.width=a-i,m.height=o-s,m},calcParentsWithoutChildren:function(t,e){var n=t.collection();return e.nodes(":parent").forEach((function(t){var e=!1;t.children().forEach((function(t){"none"!=t.css("display")&&(e=!0)})),e||n.merge(t)})),n}};t.exports=a},816:(t,e,n)=>{var r=n(548),i=n(140).CoSELayout,a=n(140).CoSENode,o=n(140).layoutBase.PointD,l=n(140).layoutBase.DimensionD,c=n(140).layoutBase.LayoutConstants,h=n(140).layoutBase.FDLayoutConstants,u=n(140).CoSEConstants,d=s((function(t,e){var n=t.cy,d=t.eles,p=d.nodes(),g=d.edges(),f=void 0,m=void 0,y=void 0,v={};t.randomize&&(f=e.nodeIndexes,m=e.xCoords,y=e.yCoords);var x=s((function(t){return"function"==typeof t}),"isFn"),b=s((function(t,e){return x(t)?t(e):t}),"optFn"),w=r.calcParentsWithoutChildren(n,d),k=s((function t(e,n,i,s){for(var c=n.length,h=0;h<c;h++){var u=n[h],d=null;0==u.intersection(w).length&&(d=u.children());var p=void 0,g=u.layoutDimensions({nodeDimensionsIncludeLabels:s.nodeDimensionsIncludeLabels});if(null!=u.outerWidth()&&null!=u.outerHeight())if(s.randomize)if(u.isParent()){var x=r.calcBoundingBox(u,m,y,f);p=0==u.intersection(w).length?e.add(new a(i.graphManager,new o(x.topLeftX,x.topLeftY),new l(x.width,x.height))):e.add(new a(i.graphManager,new o(x.topLeftX,x.topLeftY),new l(parseFloat(g.w),parseFloat(g.h))))}else p=e.add(new a(i.graphManager,new o(m[f.get(u.id())]-g.w/2,y[f.get(u.id())]-g.h/2),new l(parseFloat(g.w),parseFloat(g.h))));else p=e.add(new a(i.graphManager,new o(u.position("x")-g.w/2,u.position("y")-g.h/2),new l(parseFloat(g.w),parseFloat(g.h))));else p=e.add(new a(this.graphManager));if(p.id=u.data("id"),p.nodeRepulsion=b(s.nodeRepulsion,u),p.paddingLeft=parseInt(u.css("padding")),p.paddingTop=parseInt(u.css("padding")),p.paddingRight=parseInt(u.css("padding")),p.paddingBottom=parseInt(u.css("padding")),s.nodeDimensionsIncludeLabels&&(p.labelWidth=u.boundingBox({includeLabels:!0,includeNodes:!1,includeOverlays:!1}).w,p.labelHeight=u.boundingBox({includeLabels:!0,includeNodes:!1,includeOverlays:!1}).h,p.labelPosVertical=u.css("text-valign"),p.labelPosHorizontal=u.css("text-halign")),v[u.data("id")]=p,isNaN(p.rect.x)&&(p.rect.x=0),isNaN(p.rect.y)&&(p.rect.y=0),null!=d&&d.length>0){t(i.getGraphManager().add(i.newGraph(),p),d,i,s)}}}),"processChildrenList"),T=s((function(e,n,r){for(var i=0,a=0,s=0;s<r.length;s++){var o=r[s],l=v[o.data("source")],c=v[o.data("target")];if(l&&c&&l!==c&&0==l.getEdgesBetween(c).length){var d=n.add(e.newEdge(),l,c);d.id=o.id(),d.idealLength=b(t.idealEdgeLength,o),d.edgeElasticity=b(t.edgeElasticity,o),i+=d.idealLength,a++}}null!=t.idealEdgeLength&&(a>0?u.DEFAULT_EDGE_LENGTH=h.DEFAULT_EDGE_LENGTH=i/a:x(t.idealEdgeLength)?u.DEFAULT_EDGE_LENGTH=h.DEFAULT_EDGE_LENGTH=50:u.DEFAULT_EDGE_LENGTH=h.DEFAULT_EDGE_LENGTH=t.idealEdgeLength,u.MIN_REPULSION_DIST=h.MIN_REPULSION_DIST=h.DEFAULT_EDGE_LENGTH/10,u.DEFAULT_RADIAL_SEPARATION=h.DEFAULT_EDGE_LENGTH)}),"processEdges"),_=s((function(t,e){e.fixedNodeConstraint&&(t.constraints.fixedNodeConstraint=e.fixedNodeConstraint),e.alignmentConstraint&&(t.constraints.alignmentConstraint=e.alignmentConstraint),e.relativePlacementConstraint&&(t.constraints.relativePlacementConstraint=e.relativePlacementConstraint)}),"processConstraints");null!=t.nestingFactor&&(u.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=h.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=t.nestingFactor),null!=t.gravity&&(u.DEFAULT_GRAVITY_STRENGTH=h.DEFAULT_GRAVITY_STRENGTH=t.gravity),null!=t.numIter&&(u.MAX_ITERATIONS=h.MAX_ITERATIONS=t.numIter),null!=t.gravityRange&&(u.DEFAULT_GRAVITY_RANGE_FACTOR=h.DEFAULT_GRAVITY_RANGE_FACTOR=t.gravityRange),null!=t.gravityCompound&&(u.DEFAULT_COMPOUND_GRAVITY_STRENGTH=h.DEFAULT_COMPOUND_GRAVITY_STRENGTH=t.gravityCompound),null!=t.gravityRangeCompound&&(u.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=h.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=t.gravityRangeCompound),null!=t.initialEnergyOnIncremental&&(u.DEFAULT_COOLING_FACTOR_INCREMENTAL=h.DEFAULT_COOLING_FACTOR_INCREMENTAL=t.initialEnergyOnIncremental),null!=t.tilingCompareBy&&(u.TILING_COMPARE_BY=t.tilingCompareBy),"proof"==t.quality?c.QUALITY=2:c.QUALITY=0,u.NODE_DIMENSIONS_INCLUDE_LABELS=h.NODE_DIMENSIONS_INCLUDE_LABELS=c.NODE_DIMENSIONS_INCLUDE_LABELS=t.nodeDimensionsIncludeLabels,u.DEFAULT_INCREMENTAL=h.DEFAULT_INCREMENTAL=c.DEFAULT_INCREMENTAL=!t.randomize,u.ANIMATE=h.ANIMATE=c.ANIMATE=t.animate,u.TILE=t.tile,u.TILING_PADDING_VERTICAL="function"==typeof t.tilingPaddingVertical?t.tilingPaddingVertical.call():t.tilingPaddingVertical,u.TILING_PADDING_HORIZONTAL="function"==typeof t.tilingPaddingHorizontal?t.tilingPaddingHorizontal.call():t.tilingPaddingHorizontal,u.DEFAULT_INCREMENTAL=h.DEFAULT_INCREMENTAL=c.DEFAULT_INCREMENTAL=!0,u.PURE_INCREMENTAL=!t.randomize,c.DEFAULT_UNIFORM_LEAF_NODE_SIZES=t.uniformNodeDimensions,"transformed"==t.step&&(u.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,u.ENFORCE_CONSTRAINTS=!1,u.APPLY_LAYOUT=!1),"enforced"==t.step&&(u.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,u.ENFORCE_CONSTRAINTS=!0,u.APPLY_LAYOUT=!1),"cose"==t.step&&(u.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,u.ENFORCE_CONSTRAINTS=!1,u.APPLY_LAYOUT=!0),"all"==t.step&&(t.randomize?u.TRANSFORM_ON_CONSTRAINT_HANDLING=!0:u.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,u.ENFORCE_CONSTRAINTS=!0,u.APPLY_LAYOUT=!0),t.fixedNodeConstraint||t.alignmentConstraint||t.relativePlacementConstraint?u.TREE_REDUCTION_ON_INCREMENTAL=!1:u.TREE_REDUCTION_ON_INCREMENTAL=!0;var E=new i,C=E.newGraphManager();return k(C.addRoot(),r.getTopMostNodes(p),E,t),T(E,C,g),_(E,t),E.runLayout(),v}),"coseLayout");t.exports={coseLayout:d}},212:(t,e,n)=>{var r=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return s(t,"defineProperties"),function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}();function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}s(i,"_classCallCheck");var a=n(658),o=n(548),l=n(657).spectralLayout,c=n(816).coseLayout,h=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:s((function(t){return 4500}),"nodeRepulsion"),idealEdgeLength:s((function(t){return 50}),"idealEdgeLength"),edgeElasticity:s((function(t){return.45}),"edgeElasticity"),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:s((function(){}),"ready"),stop:s((function(){}),"stop")}),u=function(){function t(e){i(this,t),this.options=a({},h,e)}return s(t,"Layout"),r(t,[{key:"run",value:s((function(){var t=this.options,e=t.cy,n=t.eles,r=[],i=[],a=void 0,h=[];!t.fixedNodeConstraint||Array.isArray(t.fixedNodeConstraint)&&0!=t.fixedNodeConstraint.length||(t.fixedNodeConstraint=void 0),t.alignmentConstraint&&(!t.alignmentConstraint.vertical||Array.isArray(t.alignmentConstraint.vertical)&&0!=t.alignmentConstraint.vertical.length||(t.alignmentConstraint.vertical=void 0),!t.alignmentConstraint.horizontal||Array.isArray(t.alignmentConstraint.horizontal)&&0!=t.alignmentConstraint.horizontal.length||(t.alignmentConstraint.horizontal=void 0)),!t.relativePlacementConstraint||Array.isArray(t.relativePlacementConstraint)&&0!=t.relativePlacementConstraint.length||(t.relativePlacementConstraint=void 0),(t.fixedNodeConstraint||t.alignmentConstraint||t.relativePlacementConstraint)&&(t.tile=!1,t.packComponents=!1);var u=void 0,d=!1;if(e.layoutUtilities&&t.packComponents&&((u=e.layoutUtilities("get"))||(u=e.layoutUtilities()),d=!0),n.nodes().length>0)if(d){var p=o.getTopMostNodes(t.eles.nodes());if((a=o.connectComponents(e,t.eles,p)).forEach((function(t){var e=t.boundingBox();h.push({x:e.x1+e.w/2,y:e.y1+e.h/2})})),t.randomize&&a.forEach((function(e){t.eles=e,r.push(l(t))})),"default"==t.quality||"proof"==t.quality){var g=e.collection();if(t.tile){var f=0,m={nodeIndexes:new Map,xCoords:[],yCoords:[]},y=[];if(a.forEach((function(t,e){0==t.edges().length&&(t.nodes().forEach((function(e,n){g.merge(t.nodes()[n]),e.isParent()||(m.nodeIndexes.set(t.nodes()[n].id(),f++),m.xCoords.push(t.nodes()[0].position().x),m.yCoords.push(t.nodes()[0].position().y))})),y.push(e))})),g.length>1){var v=g.boundingBox();h.push({x:v.x1+v.w/2,y:v.y1+v.h/2}),a.push(g),r.push(m);for(var x=y.length-1;x>=0;x--)a.splice(y[x],1),r.splice(y[x],1),h.splice(y[x],1)}}a.forEach((function(e,n){t.eles=e,i.push(c(t,r[n])),o.relocateComponent(h[n],i[n],t)}))}else a.forEach((function(e,n){o.relocateComponent(h[n],r[n],t)}));var b=new Set;if(a.length>1){var w=[],k=n.filter((function(t){return"none"==t.css("display")}));a.forEach((function(e,n){var a=void 0;if("draft"==t.quality&&(a=r[n].nodeIndexes),e.nodes().not(k).length>0){var s={edges:[],nodes:[]},l=void 0;e.nodes().not(k).forEach((function(e){if("draft"==t.quality)if(e.isParent()){var c=o.calcBoundingBox(e,r[n].xCoords,r[n].yCoords,a);s.nodes.push({x:c.topLeftX,y:c.topLeftY,width:c.width,height:c.height})}else l=a.get(e.id()),s.nodes.push({x:r[n].xCoords[l]-e.boundingbox().w/2,y:r[n].yCoords[l]-e.boundingbox().h/2,width:e.boundingbox().w,height:e.boundingbox().h});else i[n][e.id()]&&s.nodes.push({x:i[n][e.id()].getLeft(),y:i[n][e.id()].getTop(),width:i[n][e.id()].getWidth(),height:i[n][e.id()].getHeight()})})),e.edges().forEach((function(e){var l=e.source(),c=e.target();if("none"!=l.css("display")&&"none"!=c.css("display"))if("draft"==t.quality){var h=a.get(l.id()),u=a.get(c.id()),d=[],p=[];if(l.isParent()){var g=o.calcBoundingBox(l,r[n].xCoords,r[n].yCoords,a);d.push(g.topLeftX+g.width/2),d.push(g.topLeftY+g.height/2)}else d.push(r[n].xCoords[h]),d.push(r[n].yCoords[h]);if(c.isParent()){var f=o.calcBoundingBox(c,r[n].xCoords,r[n].yCoords,a);p.push(f.topLeftX+f.width/2),p.push(f.topLeftY+f.height/2)}else p.push(r[n].xCoords[u]),p.push(r[n].yCoords[u]);s.edges.push({startX:d[0],startY:d[1],endX:p[0],endY:p[1]})}else i[n][l.id()]&&i[n][c.id()]&&s.edges.push({startX:i[n][l.id()].getCenterX(),startY:i[n][l.id()].getCenterY(),endX:i[n][c.id()].getCenterX(),endY:i[n][c.id()].getCenterY()})})),s.nodes.length>0&&(w.push(s),b.add(n))}}));var T=u.packComponents(w,t.randomize).shifts;if("draft"==t.quality)r.forEach((function(t,e){var n=t.xCoords.map((function(t){return t+T[e].dx})),r=t.yCoords.map((function(t){return t+T[e].dy}));t.xCoords=n,t.yCoords=r}));else{var _=0;b.forEach((function(t){Object.keys(i[t]).forEach((function(e){var n=i[t][e];n.setCenter(n.getCenterX()+T[_].dx,n.getCenterY()+T[_].dy)})),_++}))}}}else{var E=t.eles.boundingBox();if(h.push({x:E.x1+E.w/2,y:E.y1+E.h/2}),t.randomize){var C=l(t);r.push(C)}"default"==t.quality||"proof"==t.quality?(i.push(c(t,r[0])),o.relocateComponent(h[0],i[0],t)):o.relocateComponent(h[0],r[0],t)}var S=s((function(e,n){if("default"==t.quality||"proof"==t.quality){"number"==typeof e&&(e=n);var a=void 0,s=void 0,o=e.data("id");return i.forEach((function(t){o in t&&(a={x:t[o].getRect().getCenterX(),y:t[o].getRect().getCenterY()},s=t[o])})),t.nodeDimensionsIncludeLabels&&(s.labelWidth&&("left"==s.labelPosHorizontal?a.x+=s.labelWidth/2:"right"==s.labelPosHorizontal&&(a.x-=s.labelWidth/2)),s.labelHeight&&("top"==s.labelPosVertical?a.y+=s.labelHeight/2:"bottom"==s.labelPosVertical&&(a.y-=s.labelHeight/2))),null==a&&(a={x:e.position("x"),y:e.position("y")}),{x:a.x,y:a.y}}var l=void 0;return r.forEach((function(t){var n=t.nodeIndexes.get(e.id());null!=n&&(l={x:t.xCoords[n],y:t.yCoords[n]})})),null==l&&(l={x:e.position("x"),y:e.position("y")}),{x:l.x,y:l.y}}),"getPositions");if("default"==t.quality||"proof"==t.quality||t.randomize){var A=o.calcParentsWithoutChildren(e,n),L=n.filter((function(t){return"none"==t.css("display")}));t.eles=n.not(L),n.nodes().not(":parent").not(L).layoutPositions(this,t,S),A.length>0&&A.forEach((function(t){t.position(S(t))}))}else console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'.")}),"run")}]),t}();t.exports=u},657:(t,e,n)=>{var r=n(548),i=n(140).layoutBase.Matrix,a=n(140).layoutBase.SVD,o=s((function(t){var e=t.cy,n=t.eles,o=n.nodes(),l=n.nodes(":parent"),c=new Map,h=new Map,u=new Map,d=[],p=[],g=[],f=[],m=[],y=[],v=[],x=[],b=void 0,w=1e8,k=1e-9,T=t.piTol,_=t.samplingType,E=t.nodeSeparation,C=void 0,S=s((function(){for(var t=0,e=0,n=!1;e<C;){t=Math.floor(Math.random()*b),n=!1;for(var r=0;r<e;r++)if(f[r]==t){n=!0;break}n||(f[e]=t,e++)}}),"randomSampleCR"),A=s((function(t,e,n){for(var r=[],i=0,a=0,s=0,o=void 0,l=[],c=0,u=1,p=0;p<b;p++)l[p]=w;for(r[a]=t,l[t]=0;a>=i;){s=r[i++];for(var g=d[s],f=0;f<g.length;f++)l[o=h.get(g[f])]==w&&(l[o]=l[s]+1,r[++a]=o);y[s][e]=l[s]*E}if(n){for(var v=0;v<b;v++)y[v][e]<m[v]&&(m[v]=y[v][e]);for(var x=0;x<b;x++)m[x]>c&&(c=m[x],u=x)}return u}),"BFS"),L=s((function(t){var e=void 0;if(t){e=Math.floor(Math.random()*b);for(var n=0;n<b;n++)m[n]=w;for(var r=0;r<C;r++)f[r]=e,e=A(e,r,t)}else{S();for(var i=0;i<C;i++)A(f[i],i,t,!1)}for(var a=0;a<b;a++)for(var s=0;s<C;s++)y[a][s]*=y[a][s];for(var o=0;o<C;o++)v[o]=[];for(var l=0;l<C;l++)for(var c=0;c<C;c++)v[l][c]=y[f[c]][l]}),"allBFS"),N=s((function(){for(var t=a.svd(v),e=t.S,n=t.U,r=t.V,s=e[0]*e[0]*e[0],o=[],l=0;l<C;l++){o[l]=[];for(var c=0;c<C;c++)o[l][c]=0,l==c&&(o[l][c]=e[l]/(e[l]*e[l]+s/(e[l]*e[l])))}x=i.multMat(i.multMat(r,o),i.transpose(n))}),"sample"),I=s((function(){for(var t=void 0,e=void 0,n=[],r=[],a=[],s=[],o=0;o<b;o++)n[o]=Math.random(),r[o]=Math.random();n=i.normalize(n),r=i.normalize(r);for(var l=k,c=k,h=void 0;;){for(var u=0;u<b;u++)a[u]=n[u];if(n=i.multGamma(i.multL(i.multGamma(a),y,x)),t=i.dotProduct(a,n),n=i.normalize(n),l=i.dotProduct(a,n),(h=Math.abs(l/c))<=1+T&&h>=1)break;c=l}for(var d=0;d<b;d++)a[d]=n[d];for(c=k;;){for(var f=0;f<b;f++)s[f]=r[f];if(s=i.minusOp(s,i.multCons(a,i.dotProduct(a,s))),r=i.multGamma(i.multL(i.multGamma(s),y,x)),e=i.dotProduct(s,r),r=i.normalize(r),l=i.dotProduct(s,r),(h=Math.abs(l/c))<=1+T&&h>=1)break;c=l}for(var m=0;m<b;m++)s[m]=r[m];p=i.multCons(a,Math.sqrt(Math.abs(t))),g=i.multCons(s,Math.sqrt(Math.abs(e)))}),"powerIteration");r.connectComponents(e,n,r.getTopMostNodes(o),c),l.forEach((function(t){r.connectComponents(e,n,r.getTopMostNodes(t.descendants().intersection(n)),c)}));for(var M=0,R=0;R<o.length;R++)o[R].isParent()||h.set(o[R].id(),M++);var D=!0,O=!1,P=void 0;try{for(var B,$=c.keys()[Symbol.iterator]();!(D=(B=$.next()).done);D=!0){var F=B.value;h.set(F,M++)}}catch(t){O=!0,P=t}finally{try{!D&&$.return&&$.return()}finally{if(O)throw P}}for(var z=0;z<h.size;z++)d[z]=[];l.forEach((function(t){for(var e=t.children().intersection(n);0==e.nodes(":childless").length;)e=e.nodes()[0].children().intersection(n);var r=0,i=e.nodes(":childless")[0].connectedEdges().length;e.nodes(":childless").forEach((function(t,e){t.connectedEdges().length<i&&(i=t.connectedEdges().length,r=e)})),u.set(t.id(),e.nodes(":childless")[r].id())})),o.forEach((function(t){var e=void 0;e=t.isParent()?h.get(u.get(t.id())):h.get(t.id()),t.neighborhood().nodes().forEach((function(r){n.intersection(t.edgesWith(r)).length>0&&(r.isParent()?d[e].push(u.get(r.id())):d[e].push(r.id()))}))}));var U=s((function(t){var n=h.get(t),r=void 0;c.get(t).forEach((function(i){r=e.getElementById(i).isParent()?u.get(i):i,d[n].push(r),d[h.get(r)].push(t)}))}),"_loop"),G=!0,q=!1,j=void 0;try{for(var Y,W=c.keys()[Symbol.iterator]();!(G=(Y=W.next()).done);G=!0){U(Y.value)}}catch(t){q=!0,j=t}finally{try{!G&&W.return&&W.return()}finally{if(q)throw j}}var H=void 0;if((b=h.size)>2){C=b<t.sampleSize?b:t.sampleSize;for(var V=0;V<b;V++)y[V]=[];for(var X=0;X<C;X++)x[X]=[];return"draft"==t.quality||"all"==t.step?(L(_),N(),I(),H={nodeIndexes:h,xCoords:p,yCoords:g}):(h.forEach((function(t,n){p.push(e.getElementById(n).position("x")),g.push(e.getElementById(n).position("y"))})),H={nodeIndexes:h,xCoords:p,yCoords:g}),H}var K=h.keys(),Z=e.getElementById(K.next().value),Q=Z.position(),J=Z.outerWidth();if(p.push(Q.x),g.push(Q.y),2==b){var tt=e.getElementById(K.next().value).outerWidth();p.push(Q.x+J/2+tt/2+t.idealEdgeLength),g.push(Q.y)}return H={nodeIndexes:h,xCoords:p,yCoords:g}}),"spectralLayout");t.exports={spectralLayout:o}},579:(t,e,n)=>{var r=n(212),i=s((function(t){t&&t("layout","fcose",r)}),"register");"undefined"!=typeof cytoscape&&i(cytoscape),t.exports=i},140:e=>{e.exports=t}},n={};function r(t){var i=n[t];if(void 0!==i)return i.exports;var a=n[t]={exports:{}};return e[t](a,a.exports,r),a.exports}return s(r,"__webpack_require__"),r(579)})()}))}}),cIt={L:"left",R:"right",T:"top",B:"bottom"},hIt={L:s((t=>`${t},${t/2} 0,${t} 0,0`),"L"),R:s((t=>`0,${t/2} ${t},0 ${t},${t}`),"R"),T:s((t=>`0,0 ${t},0 ${t/2},${t}`),"T"),B:s((t=>`${t/2},0 ${t},${t} 0,${t}`),"B")},uIt={L:s(((t,e)=>t-e+2),"L"),R:s(((t,e)=>t-2),"R"),T:s(((t,e)=>t-e+2),"T"),B:s(((t,e)=>t-2),"B")},dIt=s((function(t){return gIt(t)?"L"===t?"R":"L":"T"===t?"B":"T"}),"getOppositeArchitectureDirection"),pIt=s((function(t){return"L"===t||"R"===t||"T"===t||"B"===t}),"isArchitectureDirection"),gIt=s((function(t){return"L"===t||"R"===t}),"isArchitectureDirectionX"),fIt=s((function(t){return"T"===t||"B"===t}),"isArchitectureDirectionY"),mIt=s((function(t,e){const n=gIt(t)&&fIt(e),r=fIt(t)&&gIt(e);return n||r}),"isArchitectureDirectionXY"),yIt=s((function(t){const e=t[0],n=t[1],r=gIt(e)&&fIt(n),i=fIt(e)&&gIt(n);return r||i}),"isArchitecturePairXY"),vIt=s((function(t){return"LL"!==t&&"RR"!==t&&"TT"!==t&&"BB"!==t}),"isValidArchitectureDirectionPair"),xIt=s((function(t,e){const n=`${t}${e}`;return vIt(n)?n:void 0}),"getArchitectureDirectionPair"),bIt=s((function([t,e],n){const r=n[0],i=n[1];return gIt(r)?fIt(i)?[t+("L"===r?-1:1),e+("T"===i?1:-1)]:[t+("L"===r?-1:1),e]:gIt(i)?[t+("L"===i?1:-1),e+("T"===r?1:-1)]:[t,e+("T"===r?1:-1)]}),"shiftPositionByArchitectureDirectionPair"),wIt=s((function(t){return"LT"===t||"TL"===t?[1,1]:"BL"===t||"LB"===t?[1,-1]:"BR"===t||"RB"===t?[-1,-1]:[-1,1]}),"getArchitectureDirectionXYFactors"),kIt=s((function(t){return"service"===t.type}),"isArchitectureService"),TIt=s((function(t){return"junction"===t.type}),"isArchitectureJunction"),_It=s((t=>t.data()),"edgeData"),EIt=s((t=>t.data()),"nodeData"),CIt=Ct.architecture,SIt=new qX((()=>({nodes:{},groups:{},edges:[],registeredIds:{},config:CIt,dataStructures:void 0,elements:{}}))),AIt=s((()=>{SIt.reset(),$n()}),"clear"),LIt=s((function({id:t,icon:e,in:n,title:r,iconText:i}){if(void 0!==SIt.records.registeredIds[t])throw new Error(`The service id [${t}] is already in use by another ${SIt.records.registeredIds[t]}`);if(void 0!==n){if(t===n)throw new Error(`The service [${t}] cannot be placed within itself`);if(void 0===SIt.records.registeredIds[n])throw new Error(`The service [${t}]'s parent does not exist. Please make sure the parent is created before this service`);if("node"===SIt.records.registeredIds[n])throw new Error(`The service [${t}]'s parent is not a group`)}SIt.records.registeredIds[t]="node",SIt.records.nodes[t]={id:t,type:"service",icon:e,iconText:i,title:r,edges:[],in:n}}),"addService"),NIt=s((()=>Object.values(SIt.records.nodes).filter(kIt)),"getServices"),IIt=s((function({id:t,in:e}){SIt.records.registeredIds[t]="node",SIt.records.nodes[t]={id:t,type:"junction",edges:[],in:e}}),"addJunction"),MIt=s((()=>Object.values(SIt.records.nodes).filter(TIt)),"getJunctions"),RIt=s((()=>Object.values(SIt.records.nodes)),"getNodes"),DIt=s((t=>SIt.records.nodes[t]),"getNode"),OIt=s((function({id:t,icon:e,in:n,title:r}){if(void 0!==SIt.records.registeredIds[t])throw new Error(`The group id [${t}] is already in use by another ${SIt.records.registeredIds[t]}`);if(void 0!==n){if(t===n)throw new Error(`The group [${t}] cannot be placed within itself`);if(void 0===SIt.records.registeredIds[n])throw new Error(`The group [${t}]'s parent does not exist. Please make sure the parent is created before this group`);if("node"===SIt.records.registeredIds[n])throw new Error(`The group [${t}]'s parent is not a group`)}SIt.records.registeredIds[t]="group",SIt.records.groups[t]={id:t,icon:e,title:r,in:n}}),"addGroup"),PIt=s((()=>Object.values(SIt.records.groups)),"getGroups"),BIt=s((function({lhsId:t,rhsId:e,lhsDir:n,rhsDir:r,lhsInto:i,rhsInto:a,lhsGroup:s,rhsGroup:o,title:l}){if(!pIt(n))throw new Error(`Invalid direction given for left hand side of edge ${t}--${e}. Expected (L,R,T,B) got ${n}`);if(!pIt(r))throw new Error(`Invalid direction given for right hand side of edge ${t}--${e}. Expected (L,R,T,B) got ${r}`);if(void 0===SIt.records.nodes[t]&&void 0===SIt.records.groups[t])throw new Error(`The left-hand id [${t}] does not yet exist. Please create the service/group before declaring an edge to it.`);if(void 0===SIt.records.nodes[e]&&void 0===SIt.records.groups[t])throw new Error(`The right-hand id [${e}] does not yet exist. Please create the service/group before declaring an edge to it.`);const c=SIt.records.nodes[t].in,h=SIt.records.nodes[e].in;if(s&&c&&h&&c==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&&c&&h&&c==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 u={lhsId:t,lhsDir:n,lhsInto:i,lhsGroup:s,rhsId:e,rhsDir:r,rhsInto:a,rhsGroup:o,title:l};SIt.records.edges.push(u),SIt.records.nodes[t]&&SIt.records.nodes[e]&&(SIt.records.nodes[t].edges.push(SIt.records.edges[SIt.records.edges.length-1]),SIt.records.nodes[e].edges.push(SIt.records.edges[SIt.records.edges.length-1]))}),"addEdge"),$It=s((()=>SIt.records.edges),"getEdges"),FIt=s((()=>{if(void 0===SIt.records.dataStructures){const t=Object.entries(SIt.records.nodes).reduce(((t,[e,n])=>(t[e]=n.edges.reduce(((t,n)=>{if(n.lhsId===e){const e=xIt(n.lhsDir,n.rhsDir);e&&(t[e]=n.rhsId)}else{const e=xIt(n.rhsDir,n.lhsDir);e&&(t[e]=n.lhsId)}return t}),{}),t)),{}),e=Object.keys(t)[0],n={[e]:1},r=Object.keys(t).reduce(((t,n)=>n===e?t:{...t,[n]:1}),{}),i=s((e=>{const i={[e]:[0,0]},a=[e];for(;a.length>0;){const e=a.shift();if(e){n[e]=1,delete r[e];const s=t[e],[o,l]=i[e];Object.entries(s).forEach((([t,e])=>{n[e]||(i[e]=bIt([o,l],t),a.push(e))}))}}return i}),"BFS"),a=[i(e)];for(;Object.keys(r).length>0;)a.push(i(Object.keys(r)[0]));SIt.records.dataStructures={adjList:t,spatialMaps:a}}return SIt.records.dataStructures}),"getDataStructures"),zIt=s(((t,e)=>{SIt.records.elements[t]=e}),"setElementForId"),UIt=s((t=>SIt.records.elements[t]),"getElementById"),GIt={clear:AIt,setDiagramTitle:qn,getDiagramTitle:jn,setAccTitle:Fn,getAccTitle:zn,setAccDescription:Un,getAccDescription:Gn,addService:LIt,getServices:NIt,addJunction:IIt,getJunctions:MIt,getNodes:RIt,getNode:DIt,addGroup:OIt,getGroups:PIt,addEdge:BIt,getEdges:$It,setElementForId:zIt,getElementById:UIt,getDataStructures:FIt};function qIt(t){const e=Hn().architecture;return e?.[t]?e[t]:CIt[t]}s(qIt,"getConfigField");var jIt=s(((t,e)=>{jX(t,e),t.groups.map(e.addGroup),t.services.map((t=>e.addService({...t,type:"service"}))),t.junctions.map((t=>e.addJunction({...t,type:"junction"}))),t.edges.map(e.addEdge)}),"populateDb"),YIt={parse:s((async t=>{const e=await Att("architecture",t);m.debug(e),jIt(e,GIt)}),"parse")},WIt=s((t=>`\n .edge {\n stroke-width: ${t.archEdgeWidth};\n stroke: ${t.archEdgeColor};\n fill: none;\n }\n\n .arrow {\n fill: ${t.archEdgeArrowColor};\n }\n\n .node-bkg {\n fill: none;\n stroke: ${t.archGroupBorderColor};\n stroke-width: ${t.archGroupBorderWidth};\n stroke-dasharray: 8;\n }\n .node-icon-text {\n display: flex; \n align-items: center;\n }\n \n .node-icon-text > div {\n color: #fff;\n margin: 1px;\n height: fit-content;\n text-align: center;\n overflow: hidden;\n display: -webkit-box;\n -webkit-box-orient: vertical;\n }\n`),"getStyles"),HIt=d(lIt(),1),VIt=s((t=>`<g><rect width="80" height="80" style="fill: #087ebf; stroke-width: 0px;"/>${t}</g>`),"wrapIcon"),XIt={prefix:"mermaid-architecture",height:80,width:80,icons:{database:{body:VIt('<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:VIt('<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:VIt('<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:VIt('<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:VIt('<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:xy,blank:{body:VIt("")}}},KIt=s((async function(t,e){const n=qIt("padding"),r=qIt("iconSize"),i=r/2,a=r/6,s=a/2;await Promise.all(e.edges().map((async e=>{const{source:r,sourceDir:o,sourceArrow:l,sourceGroup:c,target:h,targetDir:u,targetArrow:d,targetGroup:p,label:g}=_It(e);let{x:f,y:m}=e[0].sourceEndpoint();const{x:y,y:v}=e[0].midpoint();let{x:x,y:b}=e[0].targetEndpoint();const w=n+4;if(c&&(gIt(o)?f+="L"===o?-w:w:m+="T"===o?-w:w+18),p&&(gIt(u)?x+="L"===u?-w:w:b+="T"===u?-w:w+18),c||"junction"!==GIt.getNode(r)?.type||(gIt(o)?f+="L"===o?i:-i:m+="T"===o?i:-i),p||"junction"!==GIt.getNode(h)?.type||(gIt(u)?x+="L"===u?i:-i:b+="T"===u?i:-i),e[0]._private.rscratch){const e=t.insert("g");if(e.insert("path").attr("d",`M ${f},${m} L ${y},${v} L${x},${b} `).attr("class","edge"),l){const t=gIt(o)?uIt[o](f,a):f-s,n=fIt(o)?uIt[o](m,a):m-s;e.insert("polygon").attr("points",hIt[o](a)).attr("transform",`translate(${t},${n})`).attr("class","arrow")}if(d){const t=gIt(u)?uIt[u](x,a):x-s,n=fIt(u)?uIt[u](b,a):b-s;e.insert("polygon").attr("points",hIt[u](a)).attr("transform",`translate(${t},${n})`).attr("class","arrow")}if(g){const t=mIt(o,u)?"XY":gIt(o)?"X":"Y";let n=0;n="X"===t?Math.abs(f-x):"Y"===t?Math.abs(m-b)/1.5:Math.abs(f-x)/2;const r=e.append("g");if(await KT(r,g,{useHtmlLabels:!1,width:n,classes:"architecture-service-label"},Hn()),r.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),"X"===t)r.attr("transform","translate("+y+", "+v+")");else if("Y"===t)r.attr("transform","translate("+y+", "+v+") rotate(-90)");else if("XY"===t){const t=xIt(o,u);if(t&&yIt(t)){const e=r.node().getBoundingClientRect(),[n,i]=wIt(t);r.attr("dominant-baseline","auto").attr("transform",`rotate(${-1*n*i*45})`);const a=r.node().getBoundingClientRect();r.attr("transform",`\n translate(${y}, ${v-e.height/2})\n translate(${n*a.width/2}, ${i*a.height/2})\n rotate(${-1*n*i*45}, 0, ${e.height/2})\n `)}}}}})))}),"drawEdges"),ZIt=s((async function(t,e){const n=.75*qIt("padding"),r=qIt("fontSize"),i=qIt("iconSize")/2;await Promise.all(e.nodes().map((async e=>{const a=EIt(e);if("group"===a.type){const{h:s,w:o,x1:l,y1:c}=e.boundingBox();t.append("rect").attr("x",l+i).attr("y",c+i).attr("width",o).attr("height",s).attr("class","node-bkg");const h=t.append("g");let u=l,d=c;if(a.icon){const t=h.append("g");t.html(`<g>${await _y(a.icon,{height:n,width:n,fallbackPrefix:XIt.prefix})}</g>`),t.attr("transform","translate("+(u+i+1)+", "+(d+i+1)+")"),u+=n,d+=r/2-1-2}if(a.label){const t=h.append("g");await KT(t,a.label,{useHtmlLabels:!1,width:o,classes:"architecture-service-label"},Hn()),t.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","start").attr("text-anchor","start"),t.attr("transform","translate("+(u+i+4)+", "+(d+i+2)+")")}}})))}),"drawGroups"),QIt=s((async function(t,e,n){for(const r of n){const n=e.append("g"),i=qIt("iconSize");if(r.title){const t=n.append("g");await KT(t,r.title,{useHtmlLabels:!1,width:1.5*i,classes:"architecture-service-label"},Hn()),t.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),t.attr("transform","translate("+i/2+", "+i+")")}const a=n.append("g");if(r.icon)a.html(`<g>${await _y(r.icon,{height:i,width:i,fallbackPrefix:XIt.prefix})}</g>`);else if(r.iconText){a.html(`<g>${await _y("blank",{height:i,width:i,fallbackPrefix:XIt.prefix})}</g>`);const t=a.append("g").append("foreignObject").attr("width",i).attr("height",i).append("div").attr("class","node-icon-text").attr("style",`height: ${i}px;`).append("div").html(r.iconText),e=parseInt(window.getComputedStyle(t.node(),null).getPropertyValue("font-size").replace(/\D/g,""))??16;t.attr("style",`-webkit-line-clamp: ${Math.floor((i-2)/e)};`)}else a.append("path").attr("class","node-bkg").attr("id","node-"+r.id).attr("d",`M0 ${i} v${-i} q0,-5 5,-5 h${i} q5,0 5,5 v${i} H0 Z`);n.attr("class","architecture-service");const{width:s,height:o}=n._groups[0][0].getBBox();r.width=s,r.height=o,t.setElementForId(r.id,n)}return 0}),"drawServices"),JIt=s((function(t,e,n){n.forEach((n=>{const r=e.append("g"),i=qIt("iconSize");r.append("g").append("rect").attr("id","node-"+n.id).attr("fill-opacity","0").attr("width",i).attr("height",i),r.attr("class","architecture-junction");const{width:a,height:s}=r._groups[0][0].getBBox();r.width=a,r.height=s,t.setElementForId(n.id,r)}))}),"drawJunctions");function tMt(t,e){t.forEach((t=>{e.add({group:"nodes",data:{type:"service",id:t.id,icon:t.icon,label:t.title,parent:t.in,width:qIt("iconSize"),height:qIt("iconSize")},classes:"node-service"})}))}function eMt(t,e){t.forEach((t=>{e.add({group:"nodes",data:{type:"junction",id:t.id,parent:t.in,width:qIt("iconSize"),height:qIt("iconSize")},classes:"node-junction"})}))}function nMt(t,e){e.nodes().map((e=>{const n=EIt(e);if("group"===n.type)return;n.x=e.position().x,n.y=e.position().y;t.getElementById(n.id).attr("transform","translate("+(n.x||0)+","+(n.y||0)+")")}))}function rMt(t,e){t.forEach((t=>{e.add({group:"nodes",data:{type:"group",id:t.id,icon:t.icon,label:t.title,parent:t.in},classes:"node-group"})}))}function iMt(t,e){t.forEach((t=>{const{lhsId:n,rhsId:r,lhsInto:i,lhsGroup:a,rhsInto:s,lhsDir:o,rhsDir:l,rhsGroup:c,title:h}=t,u=mIt(t.lhsDir,t.rhsDir)?"segments":"straight",d={id:`${n}-${r}`,label:h,source:n,sourceDir:o,sourceArrow:i,sourceGroup:a,sourceEndpoint:"L"===o?"0 50%":"R"===o?"100% 50%":"T"===o?"50% 0":"50% 100%",target:r,targetDir:l,targetArrow:s,targetGroup:c,targetEndpoint:"L"===l?"0 50%":"R"===l?"100% 50%":"T"===l?"50% 0":"50% 100%"};e.add({group:"edges",data:d,classes:u})}))}function aMt(t){const e=t.map((t=>{const e={},n={};return Object.entries(t).forEach((([t,[r,i]])=>{e[i]||(e[i]=[]),n[r]||(n[r]=[]),e[i].push(t),n[r].push(t)})),{horiz:Object.values(e).filter((t=>t.length>1)),vert:Object.values(n).filter((t=>t.length>1))}})),[n,r]=e.reduce((([t,e],{horiz:n,vert:r})=>[[...t,...n],[...e,...r]]),[[],[]]);return{horizontal:n,vertical:r}}function sMt(t){const e=[],n=s((t=>`${t[0]},${t[1]}`),"posToStr"),r=s((t=>t.split(",").map((t=>parseInt(t)))),"strToPos");return t.forEach((t=>{const i=Object.fromEntries(Object.entries(t).map((([t,e])=>[n(e),t]))),a=[n([0,0])],s={},o={L:[-1,0],R:[1,0],T:[0,1],B:[0,-1]};for(;a.length>0;){const t=a.shift();if(t){s[t]=1;const l=i[t];if(l){const c=r(t);Object.entries(o).forEach((([t,r])=>{const o=n([c[0]+r[0],c[1]+r[1]]),h=i[o];h&&!s[o]&&(a.push(o),e.push({[cIt[t]]:h,[cIt[dIt(t)]]:l,gap:1.5*qIt("iconSize")}))}))}}}})),e}function oMt(t,e,n,r,{spatialMaps:i}){return new Promise((a=>{const o=Oa("body").append("div").attr("id","cy").attr("style","display:none"),l=lCt({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":`${qIt("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:`${qIt("padding")}px`}}]});o.remove(),rMt(n,l),tMt(t,l),eMt(e,l),iMt(r,l);const c=aMt(i),h=sMt(i),u=l.layout({name:"fcose",quality:"proof",styleEnabled:!1,animate:!1,nodeDimensionsIncludeLabels:!1,idealEdgeLength(t){const[e,n]=t.connectedNodes(),{parent:r}=EIt(e),{parent:i}=EIt(n);return r===i?1.5*qIt("iconSize"):.5*qIt("iconSize")},edgeElasticity(t){const[e,n]=t.connectedNodes(),{parent:r}=EIt(e),{parent:i}=EIt(n);return r===i?.45:.001},alignmentConstraint:c,relativePlacementConstraint:h});u.one("layoutstop",(()=>{function t(t,e,n,r){let i,a;const{x:s,y:o}=t,{x:l,y:c}=e;a=(r-o+(s-n)*(o-c)/(s-l))/Math.sqrt(1+Math.pow((o-c)/(s-l),2)),i=Math.sqrt(Math.pow(r-o,2)+Math.pow(n-s,2)-Math.pow(a,2));i/=Math.sqrt(Math.pow(l-s,2)+Math.pow(c-o,2));let h=(l-s)*(r-o)-(c-o)*(n-s);switch(!0){case h>=0:h=1;break;case h<0:h=-1}let u=(l-s)*(n-s)+(c-o)*(r-o);switch(!0){case u>=0:u=1;break;case u<0:u=-1}return a=Math.abs(a)*h,i*=u,{distances:a,weights:i}}s(t,"getSegmentWeights"),l.startBatch();for(const e of Object.values(l.edges()))if(e.data?.()){const{x:n,y:r}=e.source().position(),{x:i,y:a}=e.target().position();if(n!==i&&r!==a){const n=e.sourceEndpoint(),r=e.targetEndpoint(),{sourceDir:i}=_It(e),[a,s]=fIt(i)?[n.x,r.y]:[r.x,n.y],{weights:o,distances:l}=t(n,r,a,s);e.style("segment-distances",l),e.style("segment-weights",o)}}l.endBatch(),u.run()})),u.run(),l.ready((t=>{m.info("Ready",t),a(l)}))}))}ky([{name:XIt.prefix,icons:XIt}]),lCt.use(HIt.default),s(tMt,"addServices"),s(eMt,"addJunctions"),s(nMt,"positionNodes"),s(rMt,"addGroups"),s(iMt,"addEdges"),s(aMt,"getAlignments"),s(sMt,"getRelativeConstraints"),s(oMt,"layoutArchitecture");var lMt=s((async(t,e,n,r)=>{const i=r.db,a=i.getServices(),s=i.getJunctions(),o=i.getGroups(),l=i.getEdges(),c=i.getDataStructures(),h=zp(e),u=h.append("g");u.attr("class","architecture-edges");const d=h.append("g");d.attr("class","architecture-services");const p=h.append("g");p.attr("class","architecture-groups"),await QIt(i,d,a),JIt(i,d,s);const g=await oMt(a,s,o,l,c);await KIt(u,g),await ZIt(p,g),nMt(i,g),An(void 0,h,qIt("padding"),qIt("useMaxWidth"))}),"draw"),cMt={parser:YIt,db:GIt,renderer:{draw:lMt},styles:WIt},hMt=Object.freeze({__proto__:null,diagram:cMt}),uMt=Object.freeze({__proto__:null,InfoModule:Gtt,createInfoServices:qtt}),dMt=Object.freeze({__proto__:null,PacketModule:Ytt,createPacketServices:Wtt}),pMt=Object.freeze({__proto__:null,PieModule:Mtt,createPieServices:Rtt}),gMt=Object.freeze({__proto__:null,ArchitectureModule:Ptt,createArchitectureServices:Btt}),fMt=Object.freeze({__proto__:null,GitGraphModule:Ftt,createGitGraphServices:ztt});export{zN as default};