From 50406791da6a3ee95d8e9c0efff91b3b80663bd9 Mon Sep 17 00:00:00 2001 From: "posthog-eu[bot]" <226701856+posthog-eu[bot]@users.noreply.github.com> Date: Sun, 2 Aug 2026 08:16:54 +0000 Subject: [PATCH 1/2] feat: add PostHog analytics integration Generated-By: PostHog Code Task-Id: 51fb10f1-b921-420e-909f-d184ae1d34c5 --- .../cmd/openknowledge/viewer_assets/viewer.js | 865 +++++++++--------- packages/web/package.json | 3 +- packages/web/src/main.ts | 3 + packages/web/src/posthog.ts | 29 + packages/web/src/viewer/app.js | 7 + pnpm-lock.yaml | 70 ++ pnpm-workspace.yaml | 4 + 7 files changed, 548 insertions(+), 433 deletions(-) create mode 100644 packages/web/src/posthog.ts diff --git a/packages/cli/cmd/openknowledge/viewer_assets/viewer.js b/packages/cli/cmd/openknowledge/viewer_assets/viewer.js index f95cdeb..f509131 100644 --- a/packages/cli/cmd/openknowledge/viewer_assets/viewer.js +++ b/packages/cli/cmd/openknowledge/viewer_assets/viewer.js @@ -1,8 +1,8 @@ -var Z1t=Object.defineProperty;var Q1t=(Os,no,y0)=>no in Os?Z1t(Os,no,{enumerable:!0,configurable:!0,writable:!0,value:y0}):Os[no]=y0;var Hr=(Os,no,y0)=>Q1t(Os,typeof no!="symbol"?no+"":no,y0);(function(){"use strict";var gm,mm,ym,vm,bm,xm,Tm,wm,Cm,km,Em,Sm,Am,_m,r6,o0,Rm,Lm,Im,Dm,Mm,Nm,Ns,Om,$m,Pm,Bm,Fm,zm,Gm,qm,Vm,Wm,Um,Hm,Ym,Xm,Km,jm,Zm,Qm,Jm,e1,t1,r1,n1,i1,a1,s1,o1,l1,c1,u1,h1,d1,f1,p1,g1,m1,y1,v1,b1,x1,T1,w1,C1,k1,E1,S1,A1,_1,R1,L1,I1,D1,M1,l0,N1,O1,$1,P1,B1,F1,z1,G1,q1,V1,W1,U1,c0,H1,Y1,X1,K1,j1,Z1,Q1,J1,ey,ty,ry,Ph,ny,iy,ay,sy,oy,ly,cy,uy,hy,dy,fy,py,gy,my,yy,vy,by,xy,Ty,wy,Cy,ky,Ey,Sy,Ay,_y,Ry,Ly,Iy,Dy,My,Ny,Oy,$y,Py,By,Fy,zy,Gy,qy,Vy,Wy,Uy,Hy,Yy,Xy,Ky,jy,Zy,Qy,Jy,ev,tv,rv,nv,iv,av,sv,ov,lv,cv,uv,hv,dv,fv,pv,gv,mv,yv,vv,bv,xv,Tv,wv,Cv,kv,Ev,Sv,Av,_v,Rv,Lv,Iv,Dv,Mv,Nv,Ov,$v,Pv,Bv,Fv,zv,Gv,Bh,u0,qv,Vv,Wv,bu,Uv,Qve,Jve,Hv,Yv,Xv,Kv;function Os(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var no={exports:{}},y0=no.exports,jP;function Y2e(){return jP||(jP=1,(function(t,e){(function(r,n){t.exports=n()})(y0,(function(){var r=1e3,n=6e4,i=36e5,a="millisecond",s="second",o="minute",l="hour",u="day",h="week",d="month",f="quarter",p="year",g="date",m="Invalid Date",y=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,v=/\[([^\]]+)]|YYYY|YY|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,T={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(S){var R=["th","st","nd","rd"],N=S%100;return"["+S+(R[(N-20)%10]||R[N]||R[0])+"]"}},b=function(S,R,N){var D=String(S);return!D||D.length>=R?S:""+Array(R+1-D.length).join(N)+S},w={s:b,z:function(S){var R=-S.utcOffset(),N=Math.abs(R),D=Math.floor(N/60),I=N%60;return(R<=0?"+":"-")+b(D,2,"0")+":"+b(I,2,"0")},m:function S(R,N){if(R.date()1)return S(B[0])}else{var P=R.name;A[P]=R,I=P}return!D&&I&&(k=I),I||!D&&k},O=function(S,R){if(_(S))return S.clone();var N=typeof R=="object"?R:{};return N.date=S,N.args=arguments,new z(N)},M=w;M.l=L,M.i=_,M.w=function(S,R){return O(S,{locale:R.$L,utc:R.$u,x:R.$x,$offset:R.$offset})};var z=(function(){function S(N){this.$L=L(N.locale,null,!0),this.parse(N),this.$x=this.$x||N.x||{},this[C]=!0}var R=S.prototype;return R.parse=function(N){this.$d=(function(D){var I=D.date,$=D.utc;if(I===null)return new Date(NaN);if(M.u(I))return new Date;if(I instanceof Date)return new Date(I);if(typeof I=="string"&&!/Z$/i.test(I)){var B=I.match(y);if(B){var P=B[2]-1||0,G=(B[7]||"0").substring(0,3);return $?new Date(Date.UTC(B[1],P,B[3]||1,B[4]||0,B[5]||0,B[6]||0,G)):new Date(B[1],P,B[3]||1,B[4]||0,B[5]||0,B[6]||0,G)}}return new Date(I)})(N),this.init()},R.init=function(){var N=this.$d;this.$y=N.getFullYear(),this.$M=N.getMonth(),this.$D=N.getDate(),this.$W=N.getDay(),this.$H=N.getHours(),this.$m=N.getMinutes(),this.$s=N.getSeconds(),this.$ms=N.getMilliseconds()},R.$utils=function(){return M},R.isValid=function(){return this.$d.toString()!==m},R.isSame=function(N,D){var I=O(N);return this.startOf(D)<=I&&I<=this.endOf(D)},R.isAfter=function(N,D){return O(N)ZP(t,"name",{value:e,configurable:!0}),bw=(t,e)=>{for(var r in e)ZP(t,r,{get:e[r],enumerable:!0})},cc={trace:0,debug:1,info:2,warn:3,error:4,fatal:5},ae={trace:x((...t)=>{},"trace"),debug:x((...t)=>{},"debug"),info:x((...t)=>{},"info"),warn:x((...t)=>{},"warn"),error:x((...t)=>{},"error"),fatal:x((...t)=>{},"fatal")},p6=x(function(t="fatal"){let e=cc.fatal;typeof t=="string"?t.toLowerCase()in cc&&(e=cc[t]):typeof t=="number"&&(e=t),ae.trace=()=>{},ae.debug=()=>{},ae.info=()=>{},ae.warn=()=>{},ae.error=()=>{},ae.fatal=()=>{},e<=cc.fatal&&(ae.fatal=console.error?console.error.bind(console,io("FATAL"),"color: orange"):console.log.bind(console,"\x1B[35m",io("FATAL"))),e<=cc.error&&(ae.error=console.error?console.error.bind(console,io("ERROR"),"color: orange"):console.log.bind(console,"\x1B[31m",io("ERROR"))),e<=cc.warn&&(ae.warn=console.warn?console.warn.bind(console,io("WARN"),"color: orange"):console.log.bind(console,"\x1B[33m",io("WARN"))),e<=cc.info&&(ae.info=console.info?console.info.bind(console,io("INFO"),"color: lightblue"):console.log.bind(console,"\x1B[34m",io("INFO"))),e<=cc.debug&&(ae.debug=console.debug?console.debug.bind(console,io("DEBUG"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",io("DEBUG"))),e<=cc.trace&&(ae.trace=console.debug?console.debug.bind(console,io("TRACE"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",io("TRACE")))},"setLogLevel"),io=x(t=>`%c${Yi().format("ss.SSS")} : ${t} : `,"format");const xw={min:{r:0,g:0,b:0,s:0,l:0,a:0},max:{r:255,g:255,b:255,h:360,s:100,l:100,a:1},clamp:{r:t=>t>=255?255:t<0?0:t,g:t=>t>=255?255:t<0?0:t,b:t=>t>=255?255:t<0?0:t,h:t=>t%360,s:t=>t>=100?100:t<0?0:t,l:t=>t>=100?100:t<0?0:t,a:t=>t>=1?1:t<0?0:t},toLinear:t=>{const e=t/255;return t>.03928?Math.pow((e+.055)/1.055,2.4):e/12.92},hue2rgb:(t,e,r)=>(r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+(e-t)*6*r:r<1/2?e:r<2/3?t+(e-t)*(2/3-r)*6:t),hsl2rgb:({h:t,s:e,l:r},n)=>{if(!e)return r*2.55;t/=360,e/=100,r/=100;const i=r<.5?r*(1+e):r+e-r*e,a=2*r-i;switch(n){case"r":return xw.hue2rgb(a,i,t+1/3)*255;case"g":return xw.hue2rgb(a,i,t)*255;case"b":return xw.hue2rgb(a,i,t-1/3)*255}},rgb2hsl:({r:t,g:e,b:r},n)=>{t/=255,e/=255,r/=255;const i=Math.max(t,e,r),a=Math.min(t,e,r),s=(i+a)/2;if(n==="l")return s*100;if(i===a)return 0;const o=i-a,l=s>.5?o/(2-i-a):o/(i+a);if(n==="s")return l*100;switch(i){case t:return((e-r)/o+(ee>r?Math.min(e,Math.max(r,t)):Math.min(r,Math.max(e,t)),round:t=>Math.round(t*1e10)/1e10},unit:{dec2hex:t=>{const e=Math.round(t).toString(16);return e.length>1?e:`0${e}`}}},Tu={};for(let t=0;t<=255;t++)Tu[t]=Er.unit.dec2hex(t);const ka={ALL:0,RGB:1,HSL:2};let K2e=class{constructor(){this.type=ka.ALL}get(){return this.type}set(e){if(this.type&&this.type!==e)throw new Error("Cannot change both RGB and HSL channels at the same time");this.type=e}reset(){this.type=ka.ALL}is(e){return this.type===e}};class j2e{constructor(e,r){this.color=r,this.changed=!1,this.data=e,this.type=new K2e}set(e,r){return this.color=r,this.changed=!1,this.data=e,this.type.type=ka.ALL,this}_ensureHSL(){const e=this.data,{h:r,s:n,l:i}=e;r===void 0&&(e.h=Er.channel.rgb2hsl(e,"h")),n===void 0&&(e.s=Er.channel.rgb2hsl(e,"s")),i===void 0&&(e.l=Er.channel.rgb2hsl(e,"l"))}_ensureRGB(){const e=this.data,{r,g:n,b:i}=e;r===void 0&&(e.r=Er.channel.hsl2rgb(e,"r")),n===void 0&&(e.g=Er.channel.hsl2rgb(e,"g")),i===void 0&&(e.b=Er.channel.hsl2rgb(e,"b"))}get r(){const e=this.data,r=e.r;return!this.type.is(ka.HSL)&&r!==void 0?r:(this._ensureHSL(),Er.channel.hsl2rgb(e,"r"))}get g(){const e=this.data,r=e.g;return!this.type.is(ka.HSL)&&r!==void 0?r:(this._ensureHSL(),Er.channel.hsl2rgb(e,"g"))}get b(){const e=this.data,r=e.b;return!this.type.is(ka.HSL)&&r!==void 0?r:(this._ensureHSL(),Er.channel.hsl2rgb(e,"b"))}get h(){const e=this.data,r=e.h;return!this.type.is(ka.RGB)&&r!==void 0?r:(this._ensureRGB(),Er.channel.rgb2hsl(e,"h"))}get s(){const e=this.data,r=e.s;return!this.type.is(ka.RGB)&&r!==void 0?r:(this._ensureRGB(),Er.channel.rgb2hsl(e,"s"))}get l(){const e=this.data,r=e.l;return!this.type.is(ka.RGB)&&r!==void 0?r:(this._ensureRGB(),Er.channel.rgb2hsl(e,"l"))}get a(){return this.data.a}set r(e){this.type.set(ka.RGB),this.changed=!0,this.data.r=e}set g(e){this.type.set(ka.RGB),this.changed=!0,this.data.g=e}set b(e){this.type.set(ka.RGB),this.changed=!0,this.data.b=e}set h(e){this.type.set(ka.HSL),this.changed=!0,this.data.h=e}set s(e){this.type.set(ka.HSL),this.changed=!0,this.data.s=e}set l(e){this.type.set(ka.HSL),this.changed=!0,this.data.l=e}set a(e){this.changed=!0,this.data.a=e}}const Tw=new j2e({r:0,g:0,b:0,a:0},"transparent"),v0={re:/^#((?:[a-f0-9]{2}){2,4}|[a-f0-9]{3})$/i,parse:t=>{if(t.charCodeAt(0)!==35)return;const e=t.match(v0.re);if(!e)return;const r=e[1],n=parseInt(r,16),i=r.length,a=i%4===0,s=i>4,o=s?1:17,l=s?8:4,u=a?0:-1,h=s?255:15;return Tw.set({r:(n>>l*(u+3)&h)*o,g:(n>>l*(u+2)&h)*o,b:(n>>l*(u+1)&h)*o,a:a?(n&h)*o/255:1},t)},stringify:t=>{const{r:e,g:r,b:n,a:i}=t;return i<1?`#${Tu[Math.round(e)]}${Tu[Math.round(r)]}${Tu[Math.round(n)]}${Tu[Math.round(i*255)]}`:`#${Tu[Math.round(e)]}${Tu[Math.round(r)]}${Tu[Math.round(n)]}`}},Gh={re:/^hsla?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(?:deg|grad|rad|turn)?)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(%)?))?\s*?\)$/i,hueRe:/^(.+?)(deg|grad|rad|turn)$/i,_hue2deg:t=>{const e=t.match(Gh.hueRe);if(e){const[,r,n]=e;switch(n){case"grad":return Er.channel.clamp.h(parseFloat(r)*.9);case"rad":return Er.channel.clamp.h(parseFloat(r)*180/Math.PI);case"turn":return Er.channel.clamp.h(parseFloat(r)*360)}}return Er.channel.clamp.h(parseFloat(t))},parse:t=>{const e=t.charCodeAt(0);if(e!==104&&e!==72)return;const r=t.match(Gh.re);if(!r)return;const[,n,i,a,s,o]=r;return Tw.set({h:Gh._hue2deg(n),s:Er.channel.clamp.s(parseFloat(i)),l:Er.channel.clamp.l(parseFloat(a)),a:s?Er.channel.clamp.a(o?parseFloat(s)/100:parseFloat(s)):1},t)},stringify:t=>{const{h:e,s:r,l:n,a:i}=t;return i<1?`hsla(${Er.lang.round(e)}, ${Er.lang.round(r)}%, ${Er.lang.round(n)}%, ${i})`:`hsl(${Er.lang.round(e)}, ${Er.lang.round(r)}%, ${Er.lang.round(n)}%)`}},i2={colors:{aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyanaqua:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",transparent:"#00000000",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},parse:t=>{t=t.toLowerCase();const e=i2.colors[t];if(e)return v0.parse(e)},stringify:t=>{const e=v0.stringify(t);for(const r in i2.colors)if(i2.colors[r]===e)return r}},a2={re:/^rgba?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?)))?\s*?\)$/i,parse:t=>{const e=t.charCodeAt(0);if(e!==114&&e!==82)return;const r=t.match(a2.re);if(!r)return;const[,n,i,a,s,o,l,u,h]=r;return Tw.set({r:Er.channel.clamp.r(i?parseFloat(n)*2.55:parseFloat(n)),g:Er.channel.clamp.g(s?parseFloat(a)*2.55:parseFloat(a)),b:Er.channel.clamp.b(l?parseFloat(o)*2.55:parseFloat(o)),a:u?Er.channel.clamp.a(h?parseFloat(u)/100:parseFloat(u)):1},t)},stringify:t=>{const{r:e,g:r,b:n,a:i}=t;return i<1?`rgba(${Er.lang.round(e)}, ${Er.lang.round(r)}, ${Er.lang.round(n)}, ${Er.lang.round(i)})`:`rgb(${Er.lang.round(e)}, ${Er.lang.round(r)}, ${Er.lang.round(n)})`}},So={format:{keyword:i2,hex:v0,rgb:a2,rgba:a2,hsl:Gh,hsla:Gh},parse:t=>{if(typeof t!="string")return t;const e=v0.parse(t)||a2.parse(t)||Gh.parse(t)||i2.parse(t);if(e)return e;throw new Error(`Unsupported color format: "${t}"`)},stringify:t=>!t.changed&&t.color?t.color:t.type.is(ka.HSL)||t.data.r===void 0?Gh.stringify(t):t.a<1||!Number.isInteger(t.r)||!Number.isInteger(t.g)||!Number.isInteger(t.b)?a2.stringify(t):v0.stringify(t)},QP=(t,e)=>{const r=So.parse(t);for(const n in e)r[n]=Er.channel.clamp[n](e[n]);return So.stringify(r)},Ao=(t,e,r=0,n=1)=>{if(typeof t!="number")return QP(t,{a:e});const i=Tw.set({r:Er.channel.clamp.r(t),g:Er.channel.clamp.g(e),b:Er.channel.clamp.b(r),a:Er.channel.clamp.a(n)});return So.stringify(i)},g6=(t,e)=>Er.lang.round(So.parse(t)[e]),Z2e=t=>{const{r:e,g:r,b:n}=So.parse(t),i=.2126*Er.channel.toLinear(e)+.7152*Er.channel.toLinear(r)+.0722*Er.channel.toLinear(n);return Er.lang.round(i)},Q2e=t=>Z2e(t)>=.5,Ba=t=>!Q2e(t),m6=(t,e,r)=>{const n=So.parse(t),i=n[e],a=Er.channel.clamp[e](i+r);return i!==a&&(n[e]=a),So.stringify(n)},at=(t,e)=>m6(t,"l",e),st=(t,e)=>m6(t,"l",-e),JP=(t,e)=>m6(t,"a",-e),le=(t,e)=>{const r=So.parse(t),n={};for(const i in e)e[i]&&(n[i]=r[i]+e[i]);return QP(t,n)},J2e=(t,e,r=50)=>{const{r:n,g:i,b:a,a:s}=So.parse(t),{r:o,g:l,b:u,a:h}=So.parse(e),d=r/100,f=d*2-1,p=s-h,m=((f*p===-1?f:(f+p)/(1+f*p))+1)/2,y=1-m,v=n*m+o*y,T=i*m+l*y,b=a*m+u*y,w=s*d+h*(1-d);return Ao(v,T,b,w)},Ke=(t,e=100)=>{const r=So.parse(t);return r.r=255-r.r,r.g=255-r.g,r.b=255-r.b,J2e(r,t,e)};/*! @license DOMPurify 3.4.12 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.12/LICENSE */function eB(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r2?n-2:0),a=2;a1?r-1:0),i=1;i"u"?null:Ti(BigInt.prototype.toString),lB=typeof Symbol>"u"?null:Ti(Symbol.prototype.toString),Xi=Ti(Object.prototype.hasOwnProperty),l2=Ti(Object.prototype.toString),Ki=Ti(RegExp.prototype.test),qh=fbe(TypeError);function Ti(t){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i2&&arguments[2]!==void 0?arguments[2]:s2;if(rB&&rB(t,null),!wu(e))return t;let n=e.length;for(;n--;){let i=e[n];if(typeof i=="string"){const a=r(i);a!==i&&(abe(e)||(e[n]=a),i=a)}t[i]=!0}return t}function pbe(t){for(let e=0;e/g),Tbe=la(/\${[\w\W]*/g),wbe=la(/^data-[\-\w.\u00B7-\uFFFF]+$/),Cbe=la(/^aria-[\-\w]+$/),fB=la(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),kbe=la(/^(?:\w+script|data):/i),Ebe=la(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Sbe=la(/^html$/i),Abe=la(/^[a-z][.\w]*(-[.\w]+)+$/i),pB=la(/<[/\w!]/g),gB=la(/<[/\w]/g),_be=la(/<\/no(script|embed|frames)/i),Rbe=la(/\/>/i),$s={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Lbe=function(){return typeof window>"u"?null:window},Ibe=function(e,r){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let n=null;const i="data-tt-policy-suffix";r&&r.hasAttribute(i)&&(n=r.getAttribute(i));const a="dompurify"+(n?"#"+n:"");try{return e.createPolicy(a,{createHTML(s){return s},createScriptURL(s){return s}})}catch{return console.warn("TrustedTypes policy "+a+" could not be created."),null}},mB=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},Cu=function(e,r,n,i){return Xi(e,r)&&wu(e[r])?Yr(i.base?Fa(i.base):{},e[r],i.transform):n};function yB(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Lbe();const e=Ot=>yB(Ot);if(e.version="3.4.12",e.removed=[],!t||!t.document||t.document.nodeType!==$s.document||!t.Element)return e.isSupported=!1,e;let r=t.document;const n=r,i=n.currentScript;t.DocumentFragment;const a=t.HTMLTemplateElement,s=t.Node,o=t.Element,l=t.NodeFilter,u=t.NamedNodeMap;u===void 0&&(t.NamedNodeMap||t.MozNamedAttrMap),t.HTMLFormElement;const h=t.DOMParser,d=t.trustedTypes,f=o.prototype,p=cl(f,"cloneNode"),g=cl(f,"remove"),m=cl(f,"nextSibling"),y=cl(f,"childNodes"),v=cl(f,"parentNode"),T=cl(f,"shadowRoot"),b=cl(f,"attributes"),w=s&&s.prototype?cl(s.prototype,"nodeType"):null,k=s&&s.prototype?cl(s.prototype,"nodeName"):null;if(typeof a=="function"){const Ot=r.createElement("template");Ot.content&&Ot.content.ownerDocument&&(r=Ot.content.ownerDocument)}let A,C="",_,L=!1,O=0;const M=function(){if(O>0)throw qh('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},z=function(Re){M(),O++;try{return A.createHTML(Re)}finally{O--}},F=function(Re){M(),O++;try{return A.createScriptURL(Re)}finally{O--}},S=function(){return L||(_=Ibe(d,i),L=!0),_},R=r,N=R.implementation,D=R.createNodeIterator,I=R.createDocumentFragment,$=R.getElementsByTagName,B=n.importNode;let P=mB();e.isSupported=typeof tB=="function"&&typeof v=="function"&&N&&N.createHTMLDocument!==void 0;const G=bbe,V=xbe,Y=Tbe,W=wbe,ie=Cbe,K=kbe,se=Ebe,J=Abe;let Z=fB,ee=null;const ne=Yr({},[...cB,...x6,...T6,...w6,...uB]);let ue=null;const fe=Yr({},[...hB,...C6,...dB,...ww]);let _e=Object.seal(b0(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}})),Ae=null,Ne=null;const me=Object.seal(b0(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let ve=!0,Ge=!0,Te=!1,Ze=!0,ke=!1,Ve=!0,Qe=!1,nt=!1,tt=null,je=null,Ce=!1,Se=!1,H=!1,he=!1,j=!0,pe=!1;const re="user-content-";let Be=!0,xe=!1,Ue={},De=null;const qe=Yr({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]);let Le=null;const Xe=Yr({},["audio","video","img","source","image","track"]);let Ie=null;const it=Yr({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),we="http://www.w3.org/1998/Math/MathML",lt="http://www.w3.org/2000/svg",be="http://www.w3.org/1999/xhtml";let Et=be,vt=!1,ot=null;const It=Yr({},[we,lt,be],b6),xt=oa(["mi","mo","mn","ms","mtext"]);let ht=Yr({},xt);const oe=oa(["annotation-xml"]);let At=Yr({},oe);const dt=Yr({},["title","style","font","a","script"]);let ut=null;const wt=["application/xhtml+xml","text/html"],Mr="text/html";let ye=null,et=null;const ct=r.createElement("form"),_t=function(Re){return Re instanceof RegExp||Re instanceof Function},Ft=function(){let Re=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(et&&et===Re)return;(!Re||typeof Re!="object")&&(Re={}),Re=Fa(Re),ut=wt.indexOf(Re.PARSER_MEDIA_TYPE)===-1?Mr:Re.PARSER_MEDIA_TYPE,ye=ut==="application/xhtml+xml"?b6:s2,ee=Cu(Re,"ALLOWED_TAGS",ne,{transform:ye}),ue=Cu(Re,"ALLOWED_ATTR",fe,{transform:ye}),ot=Cu(Re,"ALLOWED_NAMESPACES",It,{transform:b6}),Ie=Cu(Re,"ADD_URI_SAFE_ATTR",it,{transform:ye,base:it}),Le=Cu(Re,"ADD_DATA_URI_TAGS",Xe,{transform:ye,base:Xe}),De=Cu(Re,"FORBID_CONTENTS",qe,{transform:ye}),Ae=Cu(Re,"FORBID_TAGS",Fa({}),{transform:ye}),Ne=Cu(Re,"FORBID_ATTR",Fa({}),{transform:ye}),Ue=Xi(Re,"USE_PROFILES")?Re.USE_PROFILES&&typeof Re.USE_PROFILES=="object"?Fa(Re.USE_PROFILES):Re.USE_PROFILES:!1,ve=Re.ALLOW_ARIA_ATTR!==!1,Ge=Re.ALLOW_DATA_ATTR!==!1,Te=Re.ALLOW_UNKNOWN_PROTOCOLS||!1,Ze=Re.ALLOW_SELF_CLOSE_IN_ATTR!==!1,ke=Re.SAFE_FOR_TEMPLATES||!1,Ve=Re.SAFE_FOR_XML!==!1,Qe=Re.WHOLE_DOCUMENT||!1,Se=Re.RETURN_DOM||!1,H=Re.RETURN_DOM_FRAGMENT||!1,he=Re.RETURN_TRUSTED_TYPE||!1,Ce=Re.FORCE_BODY||!1,j=Re.SANITIZE_DOM!==!1,pe=Re.SANITIZE_NAMED_PROPS||!1,Be=Re.KEEP_CONTENT!==!1,xe=Re.IN_PLACE||!1,Z=mbe(Re.ALLOWED_URI_REGEXP)?Re.ALLOWED_URI_REGEXP:fB,Et=typeof Re.NAMESPACE=="string"?Re.NAMESPACE:be,ht=Xi(Re,"MATHML_TEXT_INTEGRATION_POINTS")&&Re.MATHML_TEXT_INTEGRATION_POINTS&&typeof Re.MATHML_TEXT_INTEGRATION_POINTS=="object"?Fa(Re.MATHML_TEXT_INTEGRATION_POINTS):Yr({},xt),At=Xi(Re,"HTML_INTEGRATION_POINTS")&&Re.HTML_INTEGRATION_POINTS&&typeof Re.HTML_INTEGRATION_POINTS=="object"?Fa(Re.HTML_INTEGRATION_POINTS):Yr({},oe);const Je=Xi(Re,"CUSTOM_ELEMENT_HANDLING")&&Re.CUSTOM_ELEMENT_HANDLING&&typeof Re.CUSTOM_ELEMENT_HANDLING=="object"?Fa(Re.CUSTOM_ELEMENT_HANDLING):b0(null);if(_e=b0(null),Xi(Je,"tagNameCheck")&&_t(Je.tagNameCheck)&&(_e.tagNameCheck=Je.tagNameCheck),Xi(Je,"attributeNameCheck")&&_t(Je.attributeNameCheck)&&(_e.attributeNameCheck=Je.attributeNameCheck),Xi(Je,"allowCustomizedBuiltInElements")&&typeof Je.allowCustomizedBuiltInElements=="boolean"&&(_e.allowCustomizedBuiltInElements=Je.allowCustomizedBuiltInElements),la(_e),ke&&(Ge=!1),H&&(Se=!0),Ue&&(ee=Yr({},uB),ue=b0(null),Ue.html===!0&&(Yr(ee,cB),Yr(ue,hB)),Ue.svg===!0&&(Yr(ee,x6),Yr(ue,C6),Yr(ue,ww)),Ue.svgFilters===!0&&(Yr(ee,T6),Yr(ue,C6),Yr(ue,ww)),Ue.mathMl===!0&&(Yr(ee,w6),Yr(ue,dB),Yr(ue,ww))),me.tagCheck=null,me.attributeCheck=null,Xi(Re,"ADD_TAGS")&&(typeof Re.ADD_TAGS=="function"?me.tagCheck=Re.ADD_TAGS:wu(Re.ADD_TAGS)&&(ee===ne&&(ee=Fa(ee)),Yr(ee,Re.ADD_TAGS,ye))),Xi(Re,"ADD_ATTR")&&(typeof Re.ADD_ATTR=="function"?me.attributeCheck=Re.ADD_ATTR:wu(Re.ADD_ATTR)&&(ue===fe&&(ue=Fa(ue)),Yr(ue,Re.ADD_ATTR,ye))),Xi(Re,"ADD_URI_SAFE_ATTR")&&wu(Re.ADD_URI_SAFE_ATTR)&&Yr(Ie,Re.ADD_URI_SAFE_ATTR,ye),Xi(Re,"FORBID_CONTENTS")&&wu(Re.FORBID_CONTENTS)&&(De===qe&&(De=Fa(De)),Yr(De,Re.FORBID_CONTENTS,ye)),Xi(Re,"ADD_FORBID_CONTENTS")&&wu(Re.ADD_FORBID_CONTENTS)&&(De===qe&&(De=Fa(De)),Yr(De,Re.ADD_FORBID_CONTENTS,ye)),Be&&(ee["#text"]=!0),Qe&&Yr(ee,["html","head","body"]),ee.table&&(Yr(ee,["tbody"]),delete Ae.tbody),Re.TRUSTED_TYPES_POLICY){if(typeof Re.TRUSTED_TYPES_POLICY.createHTML!="function")throw qh('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof Re.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw qh('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const bt=A;A=Re.TRUSTED_TYPES_POLICY;try{C=z("")}catch(Vt){throw A=bt,Vt}}else Re.TRUSTED_TYPES_POLICY===null?(A=void 0,C=""):(A===void 0&&(A=S()),A&&typeof C=="string"&&(C=z("")));oa&&oa(Re),et=Re},nr=Yr({},[...x6,...T6,...ybe]),ir=Yr({},[...w6,...vbe]),_r=function(Re,Je,bt){return Je.namespaceURI===be?Re==="svg":Je.namespaceURI===we?Re==="svg"&&(bt==="annotation-xml"||ht[bt]):!!nr[Re]},or=function(Re,Je,bt){return Je.namespaceURI===be?Re==="math":Je.namespaceURI===lt?Re==="math"&&At[bt]:!!ir[Re]},Rr=function(Re,Je,bt){return Je.namespaceURI===lt&&!At[bt]||Je.namespaceURI===we&&!ht[bt]?!1:!ir[Re]&&(dt[Re]||!nr[Re])},Jt=function(Re){let Je=v(Re);(!Je||!Je.tagName)&&(Je={namespaceURI:Et,tagName:"template"});const bt=s2(Re.tagName),Vt=s2(Je.tagName);return ot[Re.namespaceURI]?Re.namespaceURI===lt?_r(bt,Je,Vt):Re.namespaceURI===we?or(bt,Je,Vt):Re.namespaceURI===be?Rr(bt,Je,Vt):!!(ut==="application/xhtml+xml"&&ot[Re.namespaceURI]):!1},Nr=function(Re){T0(e.removed,{element:Re});try{v(Re).removeChild(Re)}catch{if(g(Re),!v(Re))throw qh("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},gn=function(Re){ps(Re);const Je=y(Re);if(Je){const Vt=[];x0(Je,dr=>{T0(Vt,dr)}),x0(Vt,dr=>{try{g(dr)}catch{}})}const bt=b(Re);if(bt)for(let Vt=bt.length-1;Vt>=0;--Vt){const dr=bt[Vt],fr=dr&&dr.name;if(typeof fr=="string")try{Re.removeAttribute(fr)}catch{}}},$r=function(Re,Je){try{T0(e.removed,{attribute:Je.getAttributeNode(Re),from:Je})}catch{T0(e.removed,{attribute:null,from:Je})}if(Je.removeAttribute(Re),Re==="is")if(Se||H)try{Nr(Je)}catch{}else try{Je.setAttribute(Re,"")}catch{}},Pa=function(Re){const Je=b(Re);if(Je)for(let bt=Je.length-1;bt>=0;--bt){const Vt=Je[bt],dr=Vt&&Vt.name;if(!(typeof dr!="string"||ue[ye(dr)]))try{Re.removeAttribute(dr)}catch{}}},ps=function(Re){const Je=[Re];for(;Je.length>0;){const bt=Je.pop();(w?w(bt):bt.nodeType)===$s.element&&Pa(bt);const dr=y(bt);if(dr)for(let fr=dr.length-1;fr>=0;--fr)Je.push(dr[fr])}},gs=function(Re){if(!Ve)return;const Je=[Re];for(;Je.length>0;){const bt=Je.pop(),Vt=w?w(bt):bt.nodeType;if(Vt===$s.processingInstruction||Vt===$s.comment&&Ki(gB,bt.data)){try{g(bt)}catch{}continue}if(Vt===$s.element){const fr=bt,mn=ye(k?k(bt):bt.nodeName);try{fr.hasAttribute&&fr.hasAttribute("patchsrc")&&fr.removeAttribute("patchsrc"),fr.hasAttribute&&fr.hasAttribute("for")&&mn!=="label"&&mn!=="output"&&fr.removeAttribute("for")}catch{}}const dr=y(bt);if(dr)for(let fr=dr.length-1;fr>=0;--fr)Je.push(dr[fr])}},li=function(Re){let Je=null,bt=null;if(Ce)Re=""+Re;else{const fr=aB(Re,/^[\r\n\t ]+/);bt=fr&&fr[0]}ut==="application/xhtml+xml"&&Et===be&&(Re=''+Re+"");const Vt=A?z(Re):Re;if(Et===be)try{Je=new h().parseFromString(Vt,ut)}catch{}if(!Je||!Je.documentElement){Je=N.createDocument(Et,"template",null);try{Je.documentElement.innerHTML=vt?C:Vt}catch{}}const dr=Je.body||Je.documentElement;return Re&&bt&&dr.insertBefore(r.createTextNode(bt),dr.childNodes[0]||null),Et===be?$.call(Je,Qe?"html":"body")[0]:Qe?Je.documentElement:dr},Bt=function(Re){return D.call(Re.ownerDocument||Re,Re,l.SHOW_ELEMENT|l.SHOW_COMMENT|l.SHOW_TEXT|l.SHOW_PROCESSING_INSTRUCTION|l.SHOW_CDATA_SECTION,null)},yt=function(Re){return Re=o2(Re,G," "),Re=o2(Re,V," "),Re=o2(Re,Y," "),Re},Pt=function(Re){var Je;Re.normalize();const bt=D.call(Re.ownerDocument||Re,Re,l.SHOW_TEXT|l.SHOW_COMMENT|l.SHOW_CDATA_SECTION|l.SHOW_PROCESSING_INSTRUCTION,null);let Vt=bt.nextNode();for(;Vt;)Vt.data=yt(Vt.data),Vt=bt.nextNode();const dr=(Je=Re.querySelectorAll)===null||Je===void 0?void 0:Je.call(Re,"template");dr&&x0(dr,fr=>{pr(fr.content)&&Pt(fr.content)})},Ct=function(Re){const Je=k?k(Re):null;return typeof Je!="string"||ye(Je)!=="form"?!1:typeof Re.nodeName!="string"||typeof Re.textContent!="string"||typeof Re.removeChild!="function"||Re.attributes!==b(Re)||typeof Re.removeAttribute!="function"||typeof Re.setAttribute!="function"||typeof Re.namespaceURI!="string"||typeof Re.insertBefore!="function"||typeof Re.hasChildNodes!="function"||Re.nodeType!==w(Re)||Re.childNodes!==y(Re)},pr=function(Re){if(!w||typeof Re!="object"||Re===null)return!1;try{return w(Re)===$s.documentFragment}catch{return!1}},Ee=function(Re){if(!w||typeof Re!="object"||Re===null)return!1;try{return typeof w(Re)=="number"}catch{return!1}};function Di(Ot,Re,Je){Ot.length!==0&&x0(Ot,bt=>{bt.call(e,Re,Je,et)})}const Oe=function(Re,Je){return!!(Ve&&Re.hasChildNodes()&&!Ee(Re.firstElementChild)&&Ki(pB,Re.textContent)&&Ki(pB,Re.innerHTML)||Ve&&Re.namespaceURI===be&&Je==="style"&&Ee(Re.firstElementChild)||Re.nodeType===$s.processingInstruction||Ve&&Re.nodeType===$s.comment&&Ki(gB,Re.data))},Ln=function(Re,Je){if(!Ae[Je]&&Qv(Je)&&(_e.tagNameCheck instanceof RegExp&&Ki(_e.tagNameCheck,Je)||_e.tagNameCheck instanceof Function&&_e.tagNameCheck(Je)))return!1;if(Be&&!De[Je]){const bt=v(Re),Vt=y(Re);if(Vt&&bt){const dr=Vt.length;for(let fr=dr-1;fr>=0;--fr){const mn=xe?Vt[fr]:p(Vt[fr],!0);bt.insertBefore(mn,m(Re))}}}return Nr(Re),!0},h0=function(Re,Je){if(Di(P.beforeSanitizeElements,Re,null),Re!==Je&&v(Re)===null)return!0;if(Ct(Re))return Nr(Re),!0;const bt=ye(k?k(Re):Re.nodeName);if(Di(P.uponSanitizeElement,Re,{tagName:bt,allowedTags:ee}),Re!==Je&&v(Re)===null)return!0;if(Oe(Re,bt))return Nr(Re),!0;if(Ae[bt]||!(me.tagCheck instanceof Function&&me.tagCheck(bt))&&!ee[bt]){const dr=Ln(Re,bt);return dr===!1&&Di(P.afterSanitizeElements,Re,null),dr}if((w?w(Re):Re.nodeType)===$s.element&&!Jt(Re)||(bt==="noscript"||bt==="noembed"||bt==="noframes")&&Ki(_be,Re.innerHTML))return Nr(Re),!0;if(ke&&Re.nodeType===$s.text){const dr=yt(Re.textContent);Re.textContent!==dr&&(T0(e.removed,{element:Re.cloneNode()}),Re.textContent=dr)}return Di(P.afterSanitizeElements,Re,null),!1},jv=function(Re,Je,bt){if(Ne[Je]||Ve&&Je==="patchsrc"||Ve&&Je==="for"&&Re!=="label"&&Re!=="output"||j&&(Je==="id"||Je==="name")&&(bt in r||bt in ct))return!1;const Vt=ue[Je]||me.attributeCheck instanceof Function&&me.attributeCheck(Je,Re);if(!(Ge&&Ki(W,Je))){if(!(ve&&Ki(ie,Je))){if(Vt){if(!Ie[Je]){if(!Ki(Z,o2(bt,se,""))){if(!((Je==="src"||Je==="xlink:href"||Je==="href")&&Re!=="script"&&sB(bt,"data:")===0&&Le[Re])){if(!(Te&&!Ki(K,o2(bt,se,"")))){if(bt)return!1}}}}}else if(!(Qv(Re)&&(_e.tagNameCheck instanceof RegExp&&Ki(_e.tagNameCheck,Re)||_e.tagNameCheck instanceof Function&&_e.tagNameCheck(Re))&&(_e.attributeNameCheck instanceof RegExp&&Ki(_e.attributeNameCheck,Je)||_e.attributeNameCheck instanceof Function&&_e.attributeNameCheck(Je,Re))||Je==="is"&&_e.allowCustomizedBuiltInElements&&(_e.tagNameCheck instanceof RegExp&&Ki(_e.tagNameCheck,bt)||_e.tagNameCheck instanceof Function&&_e.tagNameCheck(bt))))return!1}}return!0},Zv=Yr({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),Qv=function(Re){return!Zv[s2(Re)]&&Ki(J,Re)},Jn=function(Re,Je,bt,Vt){if(A&&typeof d=="object"&&typeof d.getAttributeType=="function"&&!bt)switch(d.getAttributeType(Re,Je)){case"TrustedHTML":return z(Vt);case"TrustedScriptURL":return F(Vt)}return Vt},il=function(Re,Je,bt,Vt){try{bt?Re.setAttributeNS(bt,Je,Vt):Re.setAttribute(Je,Vt),Ct(Re)?Nr(Re):iB(e.removed)}catch{$r(Je,Re)}},yi=function(Re){Di(P.beforeSanitizeAttributes,Re,null);const Je=Re.attributes;if(!Je||Ct(Re))return;const bt={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:ue,forceKeepAttr:void 0};let Vt=Je.length;const dr=ye(Re.nodeName);for(;Vt--;){const fr=Je[Vt],mn=fr.name,dn=fr.namespaceURI,vi=fr.value,ei=ye(mn),bi=vi;let Qr=mn==="value"?bi:ube(bi);if(bt.attrName=ei,bt.attrValue=Qr,bt.keepAttr=!0,bt.forceKeepAttr=void 0,Di(P.uponSanitizeAttribute,Re,bt),Qr=bt.attrValue,pe&&(ei==="id"||ei==="name")&&sB(Qr,re)!==0&&($r(mn,Re),Qr=re+Qr),Ve&&Ki(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Qr)){$r(mn,Re);continue}if(ei==="attributename"&&aB(Qr,"href")){$r(mn,Re);continue}if(!bt.forceKeepAttr){if(!bt.keepAttr){$r(mn,Re);continue}if(!Ze&&Ki(Rbe,Qr)){$r(mn,Re);continue}if(ke&&(Qr=yt(Qr)),!jv(dr,ei,Qr)){$r(mn,Re);continue}Qr=Jn(dr,ei,dn,Qr),Qr!==bi&&il(Re,mn,dn,Qr)}}Di(P.afterSanitizeAttributes,Re,null)},al=function(Re){let Je=null;const bt=Bt(Re);for(Di(P.beforeSanitizeShadowDOM,Re,null);Je=bt.nextNode();)if(Di(P.uponSanitizeShadowNode,Je,null),h0(Je,Re),yi(Je),pr(Je.content)&&al(Je.content),(w?w(Je):Je.nodeType)===$s.element){const dr=T(Je);pr(dr)&&(xu(dr),al(dr))}Di(P.afterSanitizeShadowDOM,Re,null)},xu=function(Re){const Je=[{node:Re,shadow:null}];for(;Je.length>0;){const bt=Je.pop();if(bt.shadow){al(bt.shadow);continue}const Vt=bt.node,fr=(w?w(Vt):Vt.nodeType)===$s.element,mn=y(Vt);if(mn)for(let dn=mn.length-1;dn>=0;--dn)Je.push({node:mn[dn],shadow:null});if(fr){const dn=k?k(Vt):null;if(typeof dn=="string"&&ye(dn)==="template"){const vi=Vt.content;pr(vi)&&Je.push({node:vi,shadow:null})}}if(fr){const dn=T(Vt);pr(dn)&&Je.push({node:null,shadow:dn},{node:dn,shadow:null})}}};return e.sanitize=function(Ot){let Re=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Je=null,bt=null,Vt=null,dr=null;if(vt=!Ot,vt&&(Ot=""),typeof Ot!="string"&&!Ee(Ot)&&(Ot=gbe(Ot),typeof Ot!="string"))throw qh("dirty is not a string, aborting");if(!e.isSupported)return Ot;nt?(ee=tt,ue=je):Ft(Re),(P.uponSanitizeElement.length>0||P.uponSanitizeAttribute.length>0)&&(ee=Fa(ee)),P.uponSanitizeAttribute.length>0&&(ue=Fa(ue)),e.removed=[];const fr=xe&&typeof Ot!="string"&&Ee(Ot);if(fr){gs(Ot);const ei=k?k(Ot):Ot.nodeName;if(typeof ei=="string"){const bi=ye(ei);if(!ee[bi]||Ae[bi])throw gn(Ot),qh("root node is forbidden and cannot be sanitized in-place")}if(Ct(Ot))throw gn(Ot),qh("root node is clobbered and cannot be sanitized in-place");try{xu(Ot)}catch(bi){throw gn(Ot),bi}}else if(Ee(Ot))Je=li(""),bt=Je.ownerDocument.importNode(Ot,!0),bt.nodeType===$s.element&&bt.nodeName==="BODY"||bt.nodeName==="HTML"?Je=bt:Je.appendChild(bt),xu(bt);else{if(!Se&&!ke&&!Qe&&Ot.indexOf("<")===-1)return A&&he?z(Ot):Ot;if(Je=li(Ot),!Je)return Se?null:he?C:""}Je&&Ce&&Nr(Je.firstChild);const mn=fr?Ot:Je,dn=Bt(mn);try{for(;Vt=dn.nextNode();)h0(Vt,mn),yi(Vt),pr(Vt.content)&&al(Vt.content)}catch(ei){throw fr&&(gn(Ot),x0(e.removed,bi=>{bi.element&&ps(bi.element)})),ei}if(fr)return x0(e.removed,ei=>{ei.element&&ps(ei.element)}),ke&&Pt(Ot),Ot;if(Se){if(ke&&Pt(Je),H)for(dr=I.call(Je.ownerDocument);Je.firstChild;)dr.appendChild(Je.firstChild);else dr=Je;return(ue.shadowroot||ue.shadowrootmode)&&(dr=B.call(n,dr,!0)),dr}let vi=Qe?Je.outerHTML:Je.innerHTML;return Qe&&ee["!doctype"]&&Je.ownerDocument&&Je.ownerDocument.doctype&&Je.ownerDocument.doctype.name&&Ki(Sbe,Je.ownerDocument.doctype.name)&&(vi=" -`+vi),ke&&(vi=yt(vi)),A&&he?z(vi):vi},e.setConfig=function(){let Ot=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Ft(Ot),nt=!0,tt=ee,je=ue},e.clearConfig=function(){et=null,nt=!1,tt=null,je=null,A=_,C=""},e.isValidAttribute=function(Ot,Re,Je){et||Ft({});const bt=ye(Ot),Vt=ye(Re);return jv(bt,Vt,Je)},e.addHook=function(Ot,Re){typeof Re=="function"&&Xi(P,Ot)&&T0(P[Ot],Re)},e.removeHook=function(Ot,Re){if(Xi(P,Ot)){if(Re!==void 0){const Je=lbe(P[Ot],Re);return Je===-1?void 0:cbe(P[Ot],Je,1)[0]}return iB(P[Ot])}},e.removeHooks=function(Ot){Xi(P,Ot)&&(P[Ot]=[])},e.removeAllHooks=function(){P=mB()},e}var ku=yB(),vB=/^-{3}\s*[\n\r](.*?)[\n\r]-{3}\s*[\n\r]+/s,c2=/%{2}{\s*(?:(\w+)\s*:|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,Dbe=/\s*%%.*\n/gm,bB=(gm=class extends Error{constructor(e){super(e),this.name="UnknownDiagramError"}},x(gm,"UnknownDiagramError"),gm),Vh={},k6=x(function(t,e){t=t.replace(vB,"").replace(c2,"").replace(Dbe,` -`);for(const[r,{detector:n}]of Object.entries(Vh))if(n(t,e))return r;throw new bB(`No diagram type detected matching given configuration for text: ${t}`)},"detectType"),E6=x((...t)=>{for(const{id:e,detector:r,loader:n}of t)xB(e,r,n)},"registerLazyLoadedDiagrams"),xB=x((t,e,r)=>{Vh[t]&&ae.warn(`Detector with key ${t} already exists. Overwriting.`),Vh[t]={detector:e,loader:r},ae.debug(`Detector with key ${t} added${r?" with loader":""}`)},"addDetector"),Mbe=x(t=>Vh[t].loader,"getDiagramLoader"),S6=x((t,e,{depth:r=2,clobber:n=!1}={})=>{const i={depth:r,clobber:n};return Array.isArray(e)&&!Array.isArray(t)?(e.forEach(a=>S6(t,a,i)),t):Array.isArray(e)&&Array.isArray(t)?(e.forEach(a=>{t.includes(a)||t.push(a)}),t):t===void 0||r<=0?t!=null&&typeof t=="object"&&typeof e=="object"?Object.assign(t,e):e:(e!==void 0&&typeof t=="object"&&typeof e=="object"&&Object.keys(e).forEach(a=>{typeof e[a]=="object"&&e[a]!==null&&(t[a]===void 0||typeof t[a]=="object")?(t[a]===void 0&&(t[a]=Array.isArray(e[a])?[]:{}),t[a]=S6(t[a],e[a],{depth:r-1,clobber:n})):(n||typeof t[a]!="object"&&typeof e[a]!="object")&&(t[a]=e[a])}),t)},"assignWithDepth"),ci=S6,ul="#ffffff",hl="#f2f2f2",Tr=x((t,e)=>e?le(t,{s:-40,l:10}):le(t,{s:-40,l:-10}),"mkBorder"),Nbe=(mm=class{constructor(){this.background="#f4f4f4",this.primaryColor="#fff4dd",this.noteBkgColor="#fff5ad",this.noteTextColor="#333",this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.useGradient=!0,this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,1))"}updateColors(){var r,n,i,a,s,o,l,u,h,d,f,p,g,m,y,v,T,b,w,k,A,C,_,L,O,M,z,F,S,R,N,D,I,$;if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||le(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||le(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||Tr(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||Tr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||Tr(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||Tr(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||Ke(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||Ke(this.tertiaryColor),this.lineColor=this.lineColor||Ke(this.background),this.arrowheadColor=this.arrowheadColor||Ke(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||Ke(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.vertLineColor=this.vertLineColor||"navy",this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.noteFontWeight=this.noteFontWeight||"normal",this.fontWeight=this.fontWeight||"normal",this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.darkMode?(this.rowOdd=this.rowOdd||st(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||st(this.mainBkg,10)):(this.rowOdd=this.rowOdd||at(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||at(this.mainBkg,5)),this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||this.tertiaryColor,this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||le(this.primaryColor,{h:30}),this.cScale4=this.cScale4||le(this.primaryColor,{h:60}),this.cScale5=this.cScale5||le(this.primaryColor,{h:90}),this.cScale6=this.cScale6||le(this.primaryColor,{h:120}),this.cScale7=this.cScale7||le(this.primaryColor,{h:150}),this.cScale8=this.cScale8||le(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||le(this.primaryColor,{h:270}),this.cScale10=this.cScale10||le(this.primaryColor,{h:300}),this.cScale11=this.cScale11||le(this.primaryColor,{h:330}),this.darkMode)for(let B=0;B{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},x(mm,"Theme"),mm),Obe=x(t=>{const e=new Nbe;return e.calculate(t),e},"getThemeVariables"),$be=(ym=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=at(this.primaryColor,16),this.tertiaryColor=le(this.primaryColor,{h:-160}),this.primaryBorderColor=Ke(this.background),this.secondaryBorderColor=Tr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Tr(this.tertiaryColor,this.darkMode),this.primaryTextColor=Ke(this.primaryColor),this.secondaryTextColor=Ke(this.secondaryColor),this.tertiaryTextColor=Ke(this.tertiaryColor),this.lineColor=Ke(this.background),this.textColor=Ke(this.background),this.mainBkg="#1f2020",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=at(Ke("#323D47"),10),this.lineColor="calculated",this.border1="#ccc",this.border2=Ao(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.radius=5,this.strokeWidth=1,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.clusterBkg="#302F3D",this.sectionBkgColor=st("#EAE8D9",30),this.altSectionBkgColor="calculated",this.sectionBkgColor2="#EAE8D9",this.excludeBkgColor=st(this.sectionBkgColor,10),this.taskBorderColor=Ao(255,255,255,70),this.taskBkgColor="calculated",this.taskTextColor="calculated",this.taskTextLightColor="calculated",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor=Ao(255,255,255,50),this.activeTaskBkgColor="#81B1DB",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="grey",this.critBorderColor="#E83737",this.critBkgColor="#E83737",this.taskTextDarkColor="calculated",this.todayLineColor="#DB5757",this.vertLineColor="#00BFFF",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.rowOdd=this.rowOdd||at(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||st(this.mainBkg,10),this.labelColor="calculated",this.errorBkgColor="#a44141",this.errorTextColor="#ddd",this.useGradient=!0,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,1))",this.noteFontWeight=this.noteFontWeight||"normal",this.fontWeight=this.fontWeight||"normal"}updateColors(){var e,r,n,i,a,s,o,l,u,h,d,f,p,g,m,y,v,T,b,w,k,A,C,_,L,O,M,z,F,S,R,N,D,I;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=Ke(this.doneTaskBkgColor),this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#555",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.primaryBorderColor,this.specialStateColor="#f4f4f4",this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=le(this.primaryColor,{h:64}),this.fillType3=le(this.secondaryColor,{h:64}),this.fillType4=le(this.primaryColor,{h:-64}),this.fillType5=le(this.secondaryColor,{h:-64}),this.fillType6=le(this.primaryColor,{h:128}),this.fillType7=le(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||le(this.primaryColor,{h:30}),this.cScale4=this.cScale4||le(this.primaryColor,{h:60}),this.cScale5=this.cScale5||le(this.primaryColor,{h:90}),this.cScale6=this.cScale6||le(this.primaryColor,{h:120}),this.cScale7=this.cScale7||le(this.primaryColor,{h:150}),this.cScale8=this.cScale8||le(this.primaryColor,{h:210}),this.cScale9=this.cScale9||le(this.primaryColor,{h:270}),this.cScale10=this.cScale10||le(this.primaryColor,{h:300}),this.cScale11=this.cScale11||le(this.primaryColor,{h:330});for(let $=0;${this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},x(ym,"Theme"),ym),Pbe=x(t=>{const e=new $be;return e.calculate(t),e},"getThemeVariables"),Bbe=(vm=class{constructor(){this.background="#f4f4f4",this.primaryColor="#ECECFF",this.secondaryColor=le(this.primaryColor,{h:120}),this.secondaryColor="#ffffde",this.tertiaryColor=le(this.primaryColor,{h:-160}),this.primaryBorderColor=Tr(this.primaryColor,this.darkMode),this.secondaryBorderColor=Tr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Tr(this.tertiaryColor,this.darkMode),this.primaryTextColor=Ke(this.primaryColor),this.secondaryTextColor=Ke(this.secondaryColor),this.tertiaryTextColor=Ke(this.tertiaryColor),this.lineColor=Ke(this.background),this.textColor=Ke(this.background),this.background="white",this.mainBkg="#ECECFF",this.secondBkg="#ffffde",this.lineColor="#333333",this.border1="#9370DB",this.primaryBorderColor=Tr(this.primaryColor,this.darkMode),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.radius=5,this.strokeWidth=1,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.clusterBkg="#FBFBFF",this.sectionBkgColor="calculated",this.altSectionBkgColor="calculated",this.sectionBkgColor2="calculated",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="calculated",this.taskTextLightColor="calculated",this.taskTextColor=this.taskTextLightColor,this.taskTextDarkColor="calculated",this.taskTextOutsideColor=this.taskTextDarkColor,this.taskTextClickableColor="calculated",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="calculated",this.critBorderColor="calculated",this.critBkgColor="calculated",this.todayLineColor="calculated",this.vertLineColor="calculated",this.sectionBkgColor=Ao(102,102,255,.49),this.altSectionBkgColor="white",this.sectionBkgColor2="#fff400",this.taskBorderColor="#534fbc",this.taskBkgColor="#8a90dd",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="black",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="#534fbc",this.activeTaskBkgColor="#bfc7ff",this.gridColor="lightgrey",this.doneTaskBkgColor="lightgrey",this.doneTaskBorderColor="grey",this.critBorderColor="#ff8888",this.critBkgColor="red",this.todayLineColor="red",this.vertLineColor="navy",this.noteFontWeight=this.noteFontWeight||"normal",this.fontWeight=this.fontWeight||"normal",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.rowOdd="calculated",this.rowEven="calculated",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222",this.useGradient=!1,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow="drop-shadow(1px 2px 2px rgba(185, 185, 185, 1))",this.updateColors()}updateColors(){var e,r,n,i,a,s,o,l,u,h,d,f,p,g,m,y,v,T,b,w,k,A,C,_,L,O,M,z,F,S,R,N,D,I;this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||le(this.primaryColor,{h:30}),this.cScale4=this.cScale4||le(this.primaryColor,{h:60}),this.cScale5=this.cScale5||le(this.primaryColor,{h:90}),this.cScale6=this.cScale6||le(this.primaryColor,{h:120}),this.cScale7=this.cScale7||le(this.primaryColor,{h:150}),this.cScale8=this.cScale8||le(this.primaryColor,{h:210}),this.cScale9=this.cScale9||le(this.primaryColor,{h:270}),this.cScale10=this.cScale10||le(this.primaryColor,{h:300}),this.cScale11=this.cScale11||le(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||st(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||st(this.tertiaryColor,40);for(let $=0;${this[n]==="calculated"&&(this[n]=void 0)}),typeof e!="object"){this.updateColors();return}const r=Object.keys(e);r.forEach(n=>{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},x(vm,"Theme"),vm),w0=x(t=>{const e=new Bbe;return e.calculate(t),e},"getThemeVariables"),Fbe=(bm=class{constructor(){this.background="#f4f4f4",this.primaryColor="#cde498",this.secondaryColor="#cdffb2",this.background="white",this.mainBkg="#cde498",this.secondBkg="#cdffb2",this.lineColor="green",this.border1="#13540c",this.border2="#6eaa49",this.arrowheadColor="green",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.tertiaryColor=at("#cde498",10),this.primaryBorderColor=Tr(this.primaryColor,this.darkMode),this.secondaryBorderColor=Tr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Tr(this.tertiaryColor,this.darkMode),this.primaryTextColor=Ke(this.primaryColor),this.secondaryTextColor=Ke(this.secondaryColor),this.tertiaryTextColor=Ke(this.primaryColor),this.lineColor=Ke(this.background),this.textColor=Ke(this.background),this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="#333",this.edgeLabelBackground="#e8e8e8",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="black",this.actorLineColor="calculated",this.signalColor="#333",this.signalTextColor="#333",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="#326932",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.sectionBkgColor="#6eaa49",this.altSectionBkgColor="white",this.sectionBkgColor2="#6eaa49",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="#487e3a",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="black",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="lightgrey",this.doneTaskBkgColor="lightgrey",this.doneTaskBorderColor="grey",this.critBorderColor="#ff8888",this.critBkgColor="red",this.todayLineColor="red",this.vertLineColor="#00BFFF",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.noteFontWeight="normal",this.fontWeight="normal",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222",this.useGradient=!0,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,0.5))"}updateColors(){var e,r,n,i,a,s,o,l,u,h,d,f,p,g,m,y,v,T,b,w,k,A,C,_,L,O,M,z,F,S,R,N,D,I;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||le(this.primaryColor,{h:30}),this.cScale4=this.cScale4||le(this.primaryColor,{h:60}),this.cScale5=this.cScale5||le(this.primaryColor,{h:90}),this.cScale6=this.cScale6||le(this.primaryColor,{h:120}),this.cScale7=this.cScale7||le(this.primaryColor,{h:150}),this.cScale8=this.cScale8||le(this.primaryColor,{h:210}),this.cScale9=this.cScale9||le(this.primaryColor,{h:270}),this.cScale10=this.cScale10||le(this.primaryColor,{h:300}),this.cScale11=this.cScale11||le(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||st(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||st(this.tertiaryColor,40);for(let $=0;${this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},x(bm,"Theme"),bm),zbe=x(t=>{const e=new Fbe;return e.calculate(t),e},"getThemeVariables"),Gbe=(xm=class{constructor(){this.primaryColor="#eee",this.contrast="#707070",this.secondaryColor=at(this.contrast,55),this.background="#ffffff",this.tertiaryColor=le(this.primaryColor,{h:-160}),this.primaryBorderColor=Tr(this.primaryColor,this.darkMode),this.secondaryBorderColor=Tr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Tr(this.tertiaryColor,this.darkMode),this.primaryTextColor=Ke(this.primaryColor),this.secondaryTextColor=Ke(this.secondaryColor),this.tertiaryTextColor=Ke(this.tertiaryColor),this.lineColor=Ke(this.background),this.textColor=Ke(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.radius=5,this.strokeWidth=1,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="calculated",this.edgeLabelBackground="white",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="calculated",this.actorLineColor=this.actorBorder,this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="calculated",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.sectionBkgColor="calculated",this.altSectionBkgColor="white",this.sectionBkgColor2="calculated",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="calculated",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="calculated",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="calculated",this.critBkgColor="calculated",this.critBorderColor="calculated",this.todayLineColor="calculated",this.vertLineColor="calculated",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.noteFontWeight="normal",this.fontWeight="normal",this.rowOdd=this.rowOdd||at(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||"#f4f4f4",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222",this.useGradient=!0,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,1))"}updateColors(){var e,r,n,i,a,s,o,l,u,h,d,f,p,g,m,y,v,T,b,w,k,A,C,_,L,O,M,z,F,S,R,N,D,I;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 $=0;${this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},x(xm,"Theme"),xm),qbe=x(t=>{const e=new Gbe;return e.calculate(t),e},"getThemeVariables"),Vbe=(Tm=class{constructor(){this.background="#ffffff",this.primaryColor="#cccccc",this.mainBkg="#ffffff",this.noteBkgColor="#fff5ad",this.noteTextColor="#333",this.THEME_COLOR_LIMIT=12,this.radius=3,this.strokeWidth=2,this.primaryBorderColor=Tr(this.primaryColor,this.darkMode),this.fontFamily="arial, sans-serif",this.fontSize="14px",this.nodeBorder="#000000",this.stateBorder="#000000",this.useGradient=!0,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="drop-shadow( 0px 1px 2px rgba(0, 0, 0, 0.25));",this.tertiaryColor="#ffffff",this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.noteFontWeight="normal",this.fontWeight="normal"}updateColors(){var a,s,o,l,u,h,d,f,p,g,m;this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||le(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||le(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||Tr(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||Tr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||Tr(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||Tr(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||Ke(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||Ke(this.tertiaryColor),this.lineColor=this.lineColor||Ke(this.background),this.arrowheadColor=this.arrowheadColor||Ke(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||Ke(this.lineColor);const e="#ECECFE",r="#E9E9F1",n=le(e,{h:180,l:5});if(this.sectionBkgColor=this.sectionBkgColor||n,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||r,this.sectionBkgColor2=this.sectionBkgColor2||e,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||e,this.activeTaskBorderColor=this.activeTaskBorderColor||e,this.activeTaskBkgColor=this.activeTaskBkgColor||at(e,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.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,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||"#f0f0f0",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||e,this.cScale1=this.cScale1||r,this.cScale2=this.cScale2||n,this.cScale3=this.cScale3||le(e,{h:30}),this.cScale4=this.cScale4||le(e,{h:60}),this.cScale5=this.cScale5||le(e,{h:90}),this.cScale6=this.cScale6||le(e,{h:120}),this.cScale7=this.cScale7||le(e,{h:150}),this.cScale8=this.cScale8||le(e,{h:210,l:150}),this.cScale9=this.cScale9||le(e,{h:270}),this.cScale10=this.cScale10||le(e,{h:300}),this.cScale11=this.cScale11||le(e,{h:330}),this.darkMode)for(let y=0;y{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},x(Tm,"Theme"),Tm),Wbe=x(t=>{const e=new Vbe;return e.calculate(t),e},"getThemeVariables"),Ube=(wm=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=at(this.primaryColor,16),this.tertiaryColor=le(this.primaryColor,{h:-160}),this.primaryBorderColor=Ke(this.background),this.secondaryBorderColor=Tr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Tr(this.tertiaryColor,this.darkMode),this.primaryTextColor=Ke(this.primaryColor),this.secondaryTextColor=Ke(this.secondaryColor),this.tertiaryTextColor=Ke(this.tertiaryColor),this.mainBkg="#2a2020",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=at(Ke("#323D47"),10),this.border1="#ccc",this.border2=Ao(255,255,255,.25),this.arrowheadColor=Ke(this.background),this.fontFamily="arial, sans-serif",this.fontSize="14px",this.labelBackground="#181818",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.radius=3,this.strokeWidth=1,this.noteBkgColor="#fff5ad",this.noteTextColor="#333",this.THEME_COLOR_LIMIT=12,this.fontFamily="arial, sans-serif",this.fontSize="14px",this.useGradient=!0,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,0.2))",this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.noteFontWeight="normal",this.fontWeight="normal"}updateColors(){var r,n,i,a,s,o,l,u,h,d,f;if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||le(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||le(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||Tr(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||Tr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||Tr(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||Tr(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||Ke(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||Ke(this.tertiaryColor),this.lineColor=this.lineColor||Ke(this.background),this.arrowheadColor=this.arrowheadColor||Ke(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.border1,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||Ke(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.vertLineColor=this.vertLineColor||this.primaryBorderColor,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.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,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||"#f0f0f0",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||le(this.primaryColor,{h:30}),this.cScale4=this.cScale4||le(this.primaryColor,{h:60}),this.cScale5=this.cScale5||le(this.primaryColor,{h:90}),this.cScale6=this.cScale6||le(this.primaryColor,{h:120}),this.cScale7=this.cScale7||le(this.primaryColor,{h:150}),this.cScale8=this.cScale8||le(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||le(this.primaryColor,{h:270}),this.cScale10=this.cScale10||le(this.primaryColor,{h:300}),this.cScale11=this.cScale11||le(this.primaryColor,{h:330}),this.darkMode)for(let p=0;p{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},x(wm,"Theme"),wm),Hbe=x(t=>{const e=new Ube;return e.calculate(t),e},"getThemeVariables"),Ybe=(Cm=class{constructor(){this.background="#ffffff",this.primaryColor="#cccccc",this.mainBkg="#ffffff",this.noteBkgColor="#fff5ad",this.noteTextColor="#28253D",this.THEME_COLOR_LIMIT=12,this.radius=12,this.strokeWidth=2,this.primaryBorderColor=Tr("#28253D",this.darkMode),this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.nodeBorder="#28253D",this.stateBorder="#28253D",this.useGradient=!1,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="url(#drop-shadow)",this.nodeShadow=!0,this.tertiaryColor="#ffffff",this.clusterBkg="#F9F9FB",this.clusterBorder="#BDBCCC",this.noteBorderColor="#FACC15",this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.actorBorder="#28253D",this.filterColor="#000000"}updateColors(){var a,s,o,l,u,h,d,f,p,g,m;this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#28253D"),this.secondaryColor=this.secondaryColor||le(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||le(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||Tr(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||Tr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||Tr(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||Tr(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#FEF9C3",this.noteTextColor=this.noteTextColor||"#28253D",this.secondaryTextColor=this.secondaryTextColor||Ke(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||Ke(this.tertiaryColor),this.lineColor=this.lineColor||Ke(this.background),this.arrowheadColor=this.arrowheadColor||Ke(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.noteFontWeight=600,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||Ke(this.lineColor);const e="#ECECFE",r="#E9E9F1",n=le(e,{h:180,l:5});this.sectionBkgColor=this.sectionBkgColor||n,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||r,this.sectionBkgColor2=this.sectionBkgColor2||e,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||e,this.activeTaskBorderColor=this.activeTaskBorderColor||e,this.activeTaskBkgColor=this.activeTaskBkgColor||at(e,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.vertLineColor=this.vertLineColor||this.primaryBorderColor,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.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,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.compositeTitleBackground="#F9F9FB",this.altBackground="#F9F9FB",this.stateEdgeLabelBackground="#FFFFFF",this.fontWeight=600,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.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor;for(let y=0;y{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},x(Cm,"Theme"),Cm),Xbe=x(t=>{const e=new Ybe;return e.calculate(t),e},"getThemeVariables"),Kbe=(km=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=at(this.primaryColor,16),this.tertiaryColor=le(this.primaryColor,{h:-160}),this.primaryBorderColor=Ke(this.background),this.secondaryBorderColor=Tr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Tr(this.tertiaryColor,this.darkMode),this.primaryTextColor=Ke(this.primaryColor),this.secondaryTextColor=Ke(this.secondaryColor),this.tertiaryTextColor=Ke(this.tertiaryColor),this.mainBkg="#111113",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=at(Ke("#323D47"),10),this.border1="#ccc",this.border2=Ao(255,255,255,.25),this.arrowheadColor=Ke(this.background),this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.labelBackground="#111113",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.radius=12,this.strokeWidth=2,this.noteBkgColor=this.noteBkgColor??"#FEF9C3",this.noteTextColor=this.noteTextColor??"#28253D",this.THEME_COLOR_LIMIT=12,this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.nodeBorder="#FFFFFF",this.stateBorder="#FFFFFF",this.useGradient=!1,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="url(#drop-shadow)",this.nodeShadow=!0,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.clusterBkg="#1E1A2E",this.clusterBorder="#BDBCCC",this.noteBorderColor="#FACC15",this.noteFontWeight=600,this.filterColor="#FFFFFF"}updateColors(){var r,n,i,a,s,o,l,u,h,d,f;if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#FFFFFF"),this.secondaryColor=this.secondaryColor||le(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||le(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||Tr(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||Tr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||Tr(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||Tr(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#FFFFFF",this.secondaryTextColor=this.secondaryTextColor||Ke(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||Ke(this.tertiaryColor),this.lineColor=this.lineColor||Ke(this.background),this.arrowheadColor=this.arrowheadColor||Ke(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.border1,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="#FFFFFF",this.signalColor="#FFFFFF",this.labelBoxBorderColor="#BDBCCC",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||Ke(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.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,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.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.compositeBackground="#16141F",this.altBackground="#16141F",this.compositeTitleBackground="#16141F",this.stateEdgeLabelBackground="#16141F",this.fontWeight=600,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.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||le(this.primaryColor,{h:30}),this.cScale4=this.cScale4||le(this.primaryColor,{h:60}),this.cScale5=this.cScale5||le(this.primaryColor,{h:90}),this.cScale6=this.cScale6||le(this.primaryColor,{h:120}),this.cScale7=this.cScale7||le(this.primaryColor,{h:150}),this.cScale8=this.cScale8||le(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||le(this.primaryColor,{h:270}),this.cScale10=this.cScale10||le(this.primaryColor,{h:300}),this.cScale11=this.cScale11||le(this.primaryColor,{h:330}),this.darkMode)for(let p=0;p{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},x(km,"Theme"),km),jbe=x(t=>{const e=new Kbe;return e.calculate(t),e},"getThemeVariables"),Zbe=(Em=class{constructor(){this.background="#ffffff",this.primaryColor="#cccccc",this.mainBkg="#ffffff",this.noteBkgColor="#fff5ad",this.noteTextColor="#28253D",this.THEME_COLOR_LIMIT=12,this.radius=12,this.strokeWidth=2,this.primaryBorderColor=Tr(this.primaryColor,this.darkMode),this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.nodeBorder="#28253D",this.stateBorder="#28253D",this.useGradient=!1,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="url(#drop-shadow)",this.nodeShadow=!0,this.tertiaryColor="#ffffff",this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.actorBorder="#28253D",this.noteBorderColor="#FACC15",this.noteFontWeight=600,this.borderColorArray=["#E879F9","#2DD4BF","#FB923C","#22D3EE","#4ADE80","#A78BFA","#F87171","#FACC15","#818CF8","#A3E635 ","#38BDF8","#FB7185"],this.bkgColorArray=["#FDF4FF","#F0FDFA","#FFF7ED","#ECFEFF","#F0FDF4","#F5F3FF","#FEF2F2","#FEFCE8","#EEF2FF","#F7FEE7","#F0F9FF","#FFF1F2"],this.filterColor="#000000"}updateColors(){var a,s,o,l,u,h,d,f,p,g,m;this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#28253D"),this.secondaryColor=this.secondaryColor||le(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||le(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||Tr(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||Tr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||Tr(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||Tr(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#28253D",this.secondaryTextColor=this.secondaryTextColor||Ke(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||Ke(this.tertiaryColor),this.lineColor=this.lineColor||Ke(this.background),this.arrowheadColor=this.arrowheadColor||Ke(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||Ke(this.lineColor);const e="#ECECFE",r="#E9E9F1",n=le(e,{h:180,l:5});this.sectionBkgColor=this.sectionBkgColor||n,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||r,this.sectionBkgColor2=this.sectionBkgColor2||e,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||e,this.activeTaskBorderColor=this.activeTaskBorderColor||e,this.activeTaskBkgColor=this.activeTaskBkgColor||at(e,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.vertLineColor=this.vertLineColor||this.primaryBorderColor,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.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,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||"#f0f0f0",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||"#f4a8ff",this.cScale1=this.cScale1||"#46ecd5",this.cScale2=this.cScale2||"#ffb86a",this.cScale3=this.cScale3||"#dab2ff",this.cScale4=this.cScale4||"#7bf1a8",this.cScale5=this.cScale5||"#c4b4ff",this.cScale6=this.cScale6||"#ffa2a2",this.cScale7=this.cScale7||"#ffdf20",this.cScale8=this.cScale8||"#a3b3ff",this.cScale9=this.cScale9||"#bbf451",this.cScale10=this.cScale10||"#74d4ff",this.cScale11=this.cScale11||"#ffa1ad";for(let y=0;y{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},x(Em,"Theme"),Em),Qbe=x(t=>{const e=new Zbe;return e.calculate(t),e},"getThemeVariables"),Jbe=(Sm=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=at(this.primaryColor,16),this.tertiaryColor=le(this.primaryColor,{h:-160}),this.primaryBorderColor=Ke(this.background),this.secondaryBorderColor=Tr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Tr(this.tertiaryColor,this.darkMode),this.primaryTextColor=Ke(this.primaryColor),this.secondaryTextColor=Ke(this.secondaryColor),this.tertiaryTextColor=Ke(this.tertiaryColor),this.mainBkg="#111113",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=at(Ke("#323D47"),10),this.border1="#ccc",this.border2=Ao(255,255,255,.25),this.arrowheadColor=Ke(this.background),this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.labelBackground="#111113",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.radius=12,this.strokeWidth=2,this.noteBkgColor=this.noteBkgColor??"#FEF9C3",this.noteTextColor=this.noteTextColor??"#28253D",this.THEME_COLOR_LIMIT=12,this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.nodeBorder="#FFFFFF",this.stateBorder="#FFFFFF",this.useGradient=!1,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="url(#drop-shadow)",this.nodeShadow=!0,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.clusterBkg="#1E1A2E",this.clusterBorder="#BDBCCC",this.noteBorderColor="#FACC15",this.noteFontWeight=600,this.borderColorArray=["#E879F9","#2DD4BF","#FB923C","#22D3EE","#4ADE80","#A78BFA","#F87171","#FACC15","#818CF8","#A3E635 ","#38BDF8","#FB7185"],this.bkgColorArray=[],this.filterColor="#FFFFFF"}updateColors(){var r,n,i,a,s,o,l,u,h,d,f;this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#FFFFFF"),this.secondaryColor=this.secondaryColor||le(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||le(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||Tr(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||Tr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||Tr(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||Tr(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#FFFFFF",this.secondaryTextColor=this.secondaryTextColor||Ke(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||Ke(this.tertiaryColor),this.lineColor=this.lineColor||Ke(this.background),this.arrowheadColor=this.arrowheadColor||Ke(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.border1,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="#FFFFFF",this.signalColor="#FFFFFF",this.labelBoxBorderColor="#BDBCCC",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||Ke(this.lineColor),this.rootLabelColor="#FFFFFF",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.vertLineColor=this.vertLineColor||this.primaryBorderColor,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.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,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||"#f0f0f0",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||"#f4a8ff",this.cScale1=this.cScale1||"#46ecd5",this.cScale2=this.cScale2||"#ffb86a",this.cScale3=this.cScale3||"#dab2ff",this.cScale4=this.cScale4||"#7bf1a8",this.cScale5=this.cScale5||"#c4b4ff",this.cScale6=this.cScale6||"#ffa2a2",this.cScale7=this.cScale7||"#ffdf20",this.cScale8=this.cScale8||"#a3b3ff",this.cScale9=this.cScale9||"#bbf451",this.cScale10=this.cScale10||"#74d4ff",this.cScale11=this.cScale11||"#ffa1ad";for(let p=0;p{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},x(Sm,"Theme"),Sm),exe=x(t=>{const e=new Jbe;return e.calculate(t),e},"getThemeVariables"),uc={base:{getThemeVariables:Obe},dark:{getThemeVariables:Pbe},default:{getThemeVariables:w0},forest:{getThemeVariables:zbe},neutral:{getThemeVariables:qbe},neo:{getThemeVariables:Wbe},"neo-dark":{getThemeVariables:Hbe},redux:{getThemeVariables:Xbe},"redux-dark":{getThemeVariables:jbe},"redux-color":{getThemeVariables:Qbe},"redux-dark-color":{getThemeVariables:exe}},za={flowchart:{useMaxWidth:!0,titleTopMargin:25,subGraphTitleMargin:{top:0,bottom:0},diagramPadding:8,htmlLabels:null,nodeSpacing:50,rankSpacing:50,curve:"basis",padding:15,defaultRenderer:"dagre-wrapper",wrappingWidth:200,inheritDir:!1},sequence:{useMaxWidth:!0,hideUnusedParticipants:!1,activationWidth:10,diagramMarginX:50,diagramMarginY:10,actorMargin:50,width:150,height:65,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",mirrorActors:!0,forceMenus:!1,bottomMarginAdj:1,rightAngles:!1,showSequenceNumbers:!1,actorFontSize:14,actorFontFamily:'"Open Sans", sans-serif',actorFontWeight:400,noteFontSize:14,noteFontFamily:'"trebuchet ms", verdana, arial, sans-serif',noteFontWeight:400,noteAlign:"center",messageFontSize:16,messageFontFamily:'"trebuchet ms", verdana, arial, sans-serif',messageFontWeight:400,wrap:!1,wrapPadding:10,labelBoxWidth:50,labelBoxHeight:20},gantt:{useMaxWidth:!0,titleTopMargin:25,barHeight:20,barGap:4,topPadding:50,rightPadding:75,leftPadding:75,gridLineStartPadding:35,fontSize:11,sectionFontSize:11,numberSectionStyles:4,axisFormat:"%Y-%m-%d",topAxis:!1,displayMode:"",weekday:"sunday"},journey:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,leftMargin:150,maxLabelWidth:360,width:150,height:50,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",bottomMarginAdj:1,rightAngles:!1,taskFontSize:14,taskFontFamily:'"Open Sans", sans-serif',taskMargin:50,activationWidth:10,textPlacement:"fo",actorColours:["#8FBC8F","#7CFC00","#00FFFF","#20B2AA","#B0E0E6","#FFFFE0"],sectionFills:["#191970","#8B008B","#4B0082","#2F4F4F","#800000","#8B4513","#00008B"],sectionColours:["#fff"],titleColor:"",titleFontFamily:'"trebuchet ms", verdana, arial, sans-serif',titleFontSize:"4ex"},class:{useMaxWidth:!0,titleTopMargin:25,arrowMarkerAbsolute:!1,dividerMargin:10,padding:5,textHeight:10,defaultRenderer:"dagre-wrapper",htmlLabels:!1,hideEmptyMembersBox:!1,hierarchicalNamespaces:!0},state:{useMaxWidth:!0,titleTopMargin:25,dividerMargin:10,sizeUnit:5,padding:8,textHeight:10,titleShift:-15,noteMargin:10,forkWidth:70,forkHeight:7,miniPadding:2,fontSizeFactor:5.02,fontSize:24,labelHeight:16,edgeLengthFactor:"20",compositTitleSize:35,radius:5,defaultRenderer:"dagre-wrapper"},er:{useMaxWidth:!0,titleTopMargin:25,diagramPadding:20,layoutDirection:"TB",minEntityWidth:100,minEntityHeight:75,entityPadding:15,nodeSpacing:140,rankSpacing:80,stroke:"gray",fill:"honeydew",fontSize:12},pie:{useMaxWidth:!0,textPosition:.75},quadrantChart:{useMaxWidth:!0,chartWidth:500,chartHeight:500,titleFontSize:20,titlePadding:10,quadrantPadding:5,xAxisLabelPadding:5,yAxisLabelPadding:5,xAxisLabelFontSize:16,yAxisLabelFontSize:16,quadrantLabelFontSize:16,quadrantTextTopPadding:5,pointTextPadding:5,pointLabelFontSize:12,pointRadius:5,xAxisPosition:"top",yAxisPosition:"left",quadrantInternalBorderStrokeWidth:1,quadrantExternalBorderStrokeWidth:2},xyChart:{useMaxWidth:!0,width:700,height:500,titleFontSize:20,titlePadding:10,showDataLabel:!1,showDataLabelOutsideBar:!1,showTitle:!0,xAxis:{$ref:"#/$defs/XYChartAxisConfig",showLabel:!0,labelFontSize:14,labelPadding:5,showTitle:!0,titleFontSize:16,titlePadding:5,showTick:!0,tickLength:5,tickWidth:2,showAxisLine:!0,axisLineWidth:2},yAxis:{$ref:"#/$defs/XYChartAxisConfig",showLabel:!0,labelFontSize:14,labelPadding:5,showTitle:!0,titleFontSize:16,titlePadding:5,showTick:!0,tickLength:5,tickWidth:2,showAxisLine:!0,axisLineWidth:2},chartOrientation:"vertical",plotReservedSpacePercent:50},requirement:{useMaxWidth:!0,rect_fill:"#f9f9f9",text_color:"#333",rect_border_size:"0.5px",rect_border_color:"#bbb",rect_min_width:200,rect_min_height:200,fontSize:14,rect_padding:10,line_height:20},mindmap:{useMaxWidth:!0,padding:10,maxNodeWidth:200,layoutAlgorithm:"cose-bilkent"},ishikawa:{useMaxWidth:!0,diagramPadding:20},kanban:{useMaxWidth:!0,padding:8,sectionWidth:200,ticketBaseUrl:""},timeline:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,leftMargin:150,width:150,height:50,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",bottomMarginAdj:1,rightAngles:!1,taskFontSize:14,taskFontFamily:'"Open Sans", sans-serif',taskMargin:50,activationWidth:10,textPlacement:"fo",actorColours:["#8FBC8F","#7CFC00","#00FFFF","#20B2AA","#B0E0E6","#FFFFE0"],sectionFills:["#191970","#8B008B","#4B0082","#2F4F4F","#800000","#8B4513","#00008B"],sectionColours:["#fff"],disableMulticolor:!1},gitGraph:{useMaxWidth:!0,titleTopMargin:25,diagramPadding:8,nodeLabel:{width:75,height:100,x:-25,y:0},mainBranchName:"main",mainBranchOrder:0,showCommitLabel:!0,showBranches:!0,rotateCommitLabel:!0,parallelCommits:!1,arrowMarkerAbsolute:!1},c4:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,c4ShapeMargin:50,c4ShapePadding:20,width:216,height:60,boxMargin:10,c4ShapeInRow:4,nextLinePaddingX:0,c4BoundaryInRow:2,personFontSize:14,personFontFamily:'"Open Sans", sans-serif',personFontWeight:"normal",external_personFontSize:14,external_personFontFamily:'"Open Sans", sans-serif',external_personFontWeight:"normal",systemFontSize:14,systemFontFamily:'"Open Sans", sans-serif',systemFontWeight:"normal",external_systemFontSize:14,external_systemFontFamily:'"Open Sans", sans-serif',external_systemFontWeight:"normal",system_dbFontSize:14,system_dbFontFamily:'"Open Sans", sans-serif',system_dbFontWeight:"normal",external_system_dbFontSize:14,external_system_dbFontFamily:'"Open Sans", sans-serif',external_system_dbFontWeight:"normal",system_queueFontSize:14,system_queueFontFamily:'"Open Sans", sans-serif',system_queueFontWeight:"normal",external_system_queueFontSize:14,external_system_queueFontFamily:'"Open Sans", sans-serif',external_system_queueFontWeight:"normal",boundaryFontSize:14,boundaryFontFamily:'"Open Sans", sans-serif',boundaryFontWeight:"normal",messageFontSize:12,messageFontFamily:'"Open Sans", sans-serif',messageFontWeight:"normal",containerFontSize:14,containerFontFamily:'"Open Sans", sans-serif',containerFontWeight:"normal",external_containerFontSize:14,external_containerFontFamily:'"Open Sans", sans-serif',external_containerFontWeight:"normal",container_dbFontSize:14,container_dbFontFamily:'"Open Sans", sans-serif',container_dbFontWeight:"normal",external_container_dbFontSize:14,external_container_dbFontFamily:'"Open Sans", sans-serif',external_container_dbFontWeight:"normal",container_queueFontSize:14,container_queueFontFamily:'"Open Sans", sans-serif',container_queueFontWeight:"normal",external_container_queueFontSize:14,external_container_queueFontFamily:'"Open Sans", sans-serif',external_container_queueFontWeight:"normal",componentFontSize:14,componentFontFamily:'"Open Sans", sans-serif',componentFontWeight:"normal",external_componentFontSize:14,external_componentFontFamily:'"Open Sans", sans-serif',external_componentFontWeight:"normal",component_dbFontSize:14,component_dbFontFamily:'"Open Sans", sans-serif',component_dbFontWeight:"normal",external_component_dbFontSize:14,external_component_dbFontFamily:'"Open Sans", sans-serif',external_component_dbFontWeight:"normal",component_queueFontSize:14,component_queueFontFamily:'"Open Sans", sans-serif',component_queueFontWeight:"normal",external_component_queueFontSize:14,external_component_queueFontFamily:'"Open Sans", sans-serif',external_component_queueFontWeight:"normal",wrap:!0,wrapPadding:10,person_bg_color:"#08427B",person_border_color:"#073B6F",external_person_bg_color:"#686868",external_person_border_color:"#8A8A8A",system_bg_color:"#1168BD",system_border_color:"#3C7FC0",system_db_bg_color:"#1168BD",system_db_border_color:"#3C7FC0",system_queue_bg_color:"#1168BD",system_queue_border_color:"#3C7FC0",external_system_bg_color:"#999999",external_system_border_color:"#8A8A8A",external_system_db_bg_color:"#999999",external_system_db_border_color:"#8A8A8A",external_system_queue_bg_color:"#999999",external_system_queue_border_color:"#8A8A8A",container_bg_color:"#438DD5",container_border_color:"#3C7FC0",container_db_bg_color:"#438DD5",container_db_border_color:"#3C7FC0",container_queue_bg_color:"#438DD5",container_queue_border_color:"#3C7FC0",external_container_bg_color:"#B3B3B3",external_container_border_color:"#A6A6A6",external_container_db_bg_color:"#B3B3B3",external_container_db_border_color:"#A6A6A6",external_container_queue_bg_color:"#B3B3B3",external_container_queue_border_color:"#A6A6A6",component_bg_color:"#85BBF0",component_border_color:"#78A8D8",component_db_bg_color:"#85BBF0",component_db_border_color:"#78A8D8",component_queue_bg_color:"#85BBF0",component_queue_border_color:"#78A8D8",external_component_bg_color:"#CCCCCC",external_component_border_color:"#BFBFBF",external_component_db_bg_color:"#CCCCCC",external_component_db_border_color:"#BFBFBF",external_component_queue_bg_color:"#CCCCCC",external_component_queue_border_color:"#BFBFBF"},sankey:{useMaxWidth:!0,width:600,height:400,linkColor:"gradient",nodeAlignment:"justify",showValues:!0,prefix:"",suffix:"",nodeWidth:10,nodePadding:12,labelStyle:"legacy"},block:{useMaxWidth:!0,padding:8},packet:{useMaxWidth:!0,rowHeight:32,bitWidth:32,bitsPerRow:32,showBits:!0,paddingX:5,paddingY:5},treeView:{useMaxWidth:!0,rowIndent:10,paddingX:5,paddingY:5,lineThickness:1},architecture:{useMaxWidth:!0,padding:40,iconSize:80,fontSize:16,randomize:!1,nodeSeparation:75,idealEdgeLengthMultiplier:1.5,edgeElasticity:.45,numIter:2500},eventmodeling:{useMaxWidth:!0,padding:30,rowHeight:32},radar:{useMaxWidth:!0,width:600,height:600,marginTop:50,marginRight:50,marginBottom:50,marginLeft:50,axisScaleFactor:1,axisLabelFactor:1.05,curveTension:.17},venn:{useMaxWidth:!0,width:800,height:450,padding:8,useDebugLayout:!1},theme:"default",look:"classic",handDrawnSeed:0,layout:"dagre",maxTextSize:5e4,maxEdges:500,darkMode:!1,fontFamily:'"trebuchet ms", verdana, arial, sans-serif;',logLevel:5,securityLevel:"strict",startOnLoad:!0,arrowMarkerAbsolute:!1,secure:["secure","securityLevel","startOnLoad","maxTextSize","suppressErrorRendering","maxEdges"],legacyMathML:!1,forceLegacyMathML:!1,deterministicIds:!1,fontSize:16,markdownAutoWrap:!0,suppressErrorRendering:!1},TB={...za,deterministicIDSeed:void 0,elk:{mergeEdges:!1,nodePlacementStrategy:"BRANDES_KOEPF",forceNodeModelOrder:!1,considerModelOrder:"NODES_AND_EDGES"},themeCSS:void 0,themeVariables:uc.default.getThemeVariables(),sequence:{...za.sequence,messageFont:x(function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},"messageFont"),noteFont:x(function(){return{fontFamily:this.noteFontFamily,fontSize:this.noteFontSize,fontWeight:this.noteFontWeight}},"noteFont"),actorFont:x(function(){return{fontFamily:this.actorFontFamily,fontSize:this.actorFontSize,fontWeight:this.actorFontWeight}},"actorFont")},class:{hideEmptyMembersBox:!1,hierarchicalNamespaces:!0},gantt:{...za.gantt,tickInterval:void 0,useWidth:void 0},c4:{...za.c4,useWidth:void 0,personFont:x(function(){return{fontFamily:this.personFontFamily,fontSize:this.personFontSize,fontWeight:this.personFontWeight}},"personFont"),flowchart:{...za.flowchart,inheritDir:!1},external_personFont:x(function(){return{fontFamily:this.external_personFontFamily,fontSize:this.external_personFontSize,fontWeight:this.external_personFontWeight}},"external_personFont"),systemFont:x(function(){return{fontFamily:this.systemFontFamily,fontSize:this.systemFontSize,fontWeight:this.systemFontWeight}},"systemFont"),external_systemFont:x(function(){return{fontFamily:this.external_systemFontFamily,fontSize:this.external_systemFontSize,fontWeight:this.external_systemFontWeight}},"external_systemFont"),system_dbFont:x(function(){return{fontFamily:this.system_dbFontFamily,fontSize:this.system_dbFontSize,fontWeight:this.system_dbFontWeight}},"system_dbFont"),external_system_dbFont:x(function(){return{fontFamily:this.external_system_dbFontFamily,fontSize:this.external_system_dbFontSize,fontWeight:this.external_system_dbFontWeight}},"external_system_dbFont"),system_queueFont:x(function(){return{fontFamily:this.system_queueFontFamily,fontSize:this.system_queueFontSize,fontWeight:this.system_queueFontWeight}},"system_queueFont"),external_system_queueFont:x(function(){return{fontFamily:this.external_system_queueFontFamily,fontSize:this.external_system_queueFontSize,fontWeight:this.external_system_queueFontWeight}},"external_system_queueFont"),containerFont:x(function(){return{fontFamily:this.containerFontFamily,fontSize:this.containerFontSize,fontWeight:this.containerFontWeight}},"containerFont"),external_containerFont:x(function(){return{fontFamily:this.external_containerFontFamily,fontSize:this.external_containerFontSize,fontWeight:this.external_containerFontWeight}},"external_containerFont"),container_dbFont:x(function(){return{fontFamily:this.container_dbFontFamily,fontSize:this.container_dbFontSize,fontWeight:this.container_dbFontWeight}},"container_dbFont"),external_container_dbFont:x(function(){return{fontFamily:this.external_container_dbFontFamily,fontSize:this.external_container_dbFontSize,fontWeight:this.external_container_dbFontWeight}},"external_container_dbFont"),container_queueFont:x(function(){return{fontFamily:this.container_queueFontFamily,fontSize:this.container_queueFontSize,fontWeight:this.container_queueFontWeight}},"container_queueFont"),external_container_queueFont:x(function(){return{fontFamily:this.external_container_queueFontFamily,fontSize:this.external_container_queueFontSize,fontWeight:this.external_container_queueFontWeight}},"external_container_queueFont"),componentFont:x(function(){return{fontFamily:this.componentFontFamily,fontSize:this.componentFontSize,fontWeight:this.componentFontWeight}},"componentFont"),external_componentFont:x(function(){return{fontFamily:this.external_componentFontFamily,fontSize:this.external_componentFontSize,fontWeight:this.external_componentFontWeight}},"external_componentFont"),component_dbFont:x(function(){return{fontFamily:this.component_dbFontFamily,fontSize:this.component_dbFontSize,fontWeight:this.component_dbFontWeight}},"component_dbFont"),external_component_dbFont:x(function(){return{fontFamily:this.external_component_dbFontFamily,fontSize:this.external_component_dbFontSize,fontWeight:this.external_component_dbFontWeight}},"external_component_dbFont"),component_queueFont:x(function(){return{fontFamily:this.component_queueFontFamily,fontSize:this.component_queueFontSize,fontWeight:this.component_queueFontWeight}},"component_queueFont"),external_component_queueFont:x(function(){return{fontFamily:this.external_component_queueFontFamily,fontSize:this.external_component_queueFontSize,fontWeight:this.external_component_queueFontWeight}},"external_component_queueFont"),boundaryFont:x(function(){return{fontFamily:this.boundaryFontFamily,fontSize:this.boundaryFontSize,fontWeight:this.boundaryFontWeight}},"boundaryFont"),messageFont:x(function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},"messageFont")},pie:{...za.pie,useWidth:984},xyChart:{...za.xyChart,useWidth:void 0},requirement:{...za.requirement,useWidth:void 0},packet:{...za.packet},eventmodeling:{...za.eventmodeling},treeView:{...za.treeView,useWidth:void 0},radar:{...za.radar},ishikawa:{...za.ishikawa},sankey:{...za.sankey,nodeColors:void 0},treemap:{useMaxWidth:!0,padding:10,diagramPadding:8,showValues:!0,nodeWidth:100,nodeHeight:40,borderWidth:1,valueFontSize:12,labelFontSize:14,valueFormat:","},venn:{...za.venn}},wB=x((t,e="")=>Object.keys(t).reduce((r,n)=>Array.isArray(t[n])?r:typeof t[n]=="object"&&t[n]!==null?[...r,e+n,...wB(t[n],"")]:[...r,e+n],[]),"keyify"),txe=new Set(wB(TB,"")),Fr=TB,Cw=x(t=>{if(ae.debug("sanitizeDirective called with",t),!(typeof t!="object"||t==null)){if(Array.isArray(t)){t.forEach(e=>Cw(e));return}for(const e of Object.keys(t)){if(ae.debug("Checking key",e),e.startsWith("__")||e.includes("proto")||e.includes("constr")||!txe.has(e)||t[e]==null){ae.debug("sanitize deleting key: ",e),delete t[e];continue}if(typeof t[e]=="object"){if(e==="nodeColors"){const n=/^#[\da-f]{3,8}$|^rgb\([\d\s%,.]+\)$|^hsl\([\d\s%,.]+\)$|^[a-z]+$/i;for(const i of Object.keys(t[e]))(typeof t[e][i]!="string"||!n.test(t[e][i]))&&(ae.debug("sanitize deleting invalid color:",i,t[e][i]),delete t[e][i])}else ae.debug("sanitizing object",e),Cw(t[e]);continue}const r=["themeCSS","fontFamily","altFontFamily"];for(const n of r)e.includes(n)&&(ae.debug("sanitizing css option",e),t[e]=CB(t[e]))}if(t.themeVariables)for(const e of Object.keys(t.themeVariables)){const r=t.themeVariables[e];r!=null&&r.match&&!r.match(/^[\d "#%(),.;A-Za-z]+$/)&&(t.themeVariables[e]="")}ae.debug("After sanitization",t)}},"sanitizeDirective"),CB=x(t=>{let e=0,r=0;for(const n of t){if(e!(t===!1||["false","null","0"].includes(String(t).trim().toLowerCase())),"evaluate"),ms=ci({},C0),kw,Wh=[],u2=ci({},C0),Ew=x((t,e)=>{let r=ci({},t),n={};for(const i of e)SB(i),n=ci(n,i);if(r=ci(r,n),n.theme&&n.theme in uc){const i=ci({},kw),a=ci(i.themeVariables||{},n.themeVariables);r.theme&&r.theme in uc&&(r.themeVariables=uc[r.theme].getThemeVariables(a))}return u2=r,RB(u2),u2},"updateCurrentConfig"),rxe=x(t=>(ms=ci({},C0),ms=ci(ms,t),t.theme&&uc[t.theme]&&(ms.themeVariables=uc[t.theme].getThemeVariables(t.themeVariables)),Ew(ms,Wh),ms),"setSiteConfig"),nxe=x(t=>{kw=ci({},t)},"saveConfigFromInitialize"),ixe=x(t=>(ms=ci(ms,t),Ew(ms,Wh),ms),"updateSiteConfig"),kB=x(()=>ci({},ms),"getSiteConfig"),EB=x(t=>(RB(t),ci(u2,t),lr()),"setConfig"),lr=x(()=>ci({},u2),"getConfig"),SB=x(t=>{t&&(["secure",...ms.secure??[]].forEach(e=>{Object.hasOwn(t,e)&&(ae.debug(`Denied attempt to modify a secure key ${e}`,t[e]),delete t[e])}),Object.keys(t).forEach(e=>{e.startsWith("__")&&delete t[e]}),Object.keys(t).forEach(e=>{typeof t[e]=="string"&&(t[e].includes("<")||t[e].includes(">")||t[e].includes("url(data:"))&&delete t[e],typeof t[e]=="object"&&SB(t[e])}))},"sanitize"),axe=x(t=>{var e;Cw(t),t.fontFamily&&!((e=t.themeVariables)!=null&&e.fontFamily)&&(t.themeVariables={...t.themeVariables,fontFamily:t.fontFamily}),Wh.push(t),Ew(ms,Wh)},"addDirective"),Sw=x((t=ms)=>{Wh=[],Ew(t,Wh)},"reset"),sxe={LAZY_LOAD_DEPRECATED:"The configuration options lazyLoadedDiagrams and loadExternalDiagramsAtStartup are deprecated. Please use registerExternalDiagrams instead.",FLOWCHART_HTML_LABELS_DEPRECATED:"flowchart.htmlLabels is deprecated. Please use global htmlLabels instead."},AB={},_B=x(t=>{AB[t]||(ae.warn(sxe[t]),AB[t]=!0)},"issueWarning"),RB=x(t=>{t&&(t.lazyLoadedDiagrams||t.loadExternalDiagramsAtStartup)&&_B("LAZY_LOAD_DEPRECATED")},"checkConfig"),oxe=x(()=>{let t={};kw&&(t=ci(t,kw));for(const e of Wh)t=ci(t,e);return t},"getUserDefinedConfig"),on=x(t=>{var e,r;return((e=t.flowchart)==null?void 0:e.htmlLabels)!=null&&_B("FLOWCHART_HTML_LABELS_DEPRECATED"),hc(t.htmlLabels??((r=t.flowchart)==null?void 0:r.htmlLabels)??!0)},"getEffectiveHtmlLabels"),k0=//gi,lxe=x(t=>t?MB(t).replace(/\\n/g,"#br#").split("#br#"):[""],"getRows"),cxe=(()=>{let t=!1;return()=>{t||(LB(),t=!0)}})();function LB(){const t="data-temp-href-target";ku.addHook("beforeSanitizeAttributes",e=>{e.tagName==="A"&&e.hasAttribute("target")&&e.setAttribute(t,e.getAttribute("target")??"")}),ku.addHook("afterSanitizeAttributes",e=>{e.tagName==="A"&&e.hasAttribute(t)&&(e.setAttribute("target",e.getAttribute(t)??""),e.removeAttribute(t),e.getAttribute("target")==="_blank"&&e.setAttribute("rel","noopener"))})}x(LB,"setupDompurifyHooks");var IB=x(t=>(cxe(),ku.sanitize(t)),"removeScript"),DB=x((t,e)=>{if(on(e)){const r=e.securityLevel;r==="antiscript"||r==="strict"||r==="sandbox"?t=IB(t):r!=="loose"&&(t=MB(t),t=t.replace(//g,">"),t=t.replace(/=/g,"="),t=fxe(t))}return t},"sanitizeMore"),qr=x((t,e)=>t&&(e.dompurifyConfig?t=ku.sanitize(DB(t,e),e.dompurifyConfig).toString():t=ku.sanitize(DB(t,e),{FORBID_TAGS:["style"]}).toString(),t),"sanitizeText"),uxe=x((t,e)=>typeof t=="string"?qr(t,e):t.flat().map(r=>qr(r,e)),"sanitizeTextOrArray"),hxe=x(t=>k0.test(t),"hasBreaks"),dxe=x(t=>t.split(k0),"splitBreaks"),fxe=x(t=>t.replace(/#br#/g,"
"),"placeholderToBreak"),MB=x(t=>t.replace(k0,"#br#"),"breakToPlaceholder"),Aw=x(t=>{let e="";return t&&(e=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,e=CSS.escape(e)),e},"getUrl"),pxe=x(function(...t){const e=t.filter(r=>!isNaN(r));return Math.max(...e)},"getMax"),gxe=x(function(...t){const e=t.filter(r=>!isNaN(r));return Math.min(...e)},"getMin"),Eu=x(function(t){const e=t.split(/(,)/),r=[];for(let n=0;n0&&n+1Math.max(0,t.split(e).length-1),"countOccurrence"),mxe=x((t,e)=>{const r=A6(t,"~"),n=A6(e,"~");return r===1&&n===1},"shouldCombineSets"),yxe=x(t=>{const e=A6(t,"~");let r=!1;if(e<=1)return t;e%2!==0&&t.startsWith("~")&&(t=t.substring(1),r=!0);const n=[...t];let i=n.indexOf("~"),a=n.lastIndexOf("~");for(;i!==-1&&a!==-1&&i!==a;)n[i]="<",n[a]=">",i=n.indexOf("~"),a=n.lastIndexOf("~");return r&&n.unshift("~"),n.join("")},"processSet"),NB=x(()=>window.MathMLElement!==void 0,"isMathMLSupported"),_6=/\$\$(.*)\$\$/g,ui=x(t=>{var e;return(((e=t.match(_6))==null?void 0:e.length)??0)>0},"hasKatex"),h2=x(async(t,e)=>{const r=document.createElement("div");r.innerHTML=await _w(t,e),r.id="katex-temp",r.style.visibility="hidden",r.style.position="absolute",r.style.top="0";const n=document.querySelector("body");n==null||n.insertAdjacentElement("beforeend",r);const i={width:r.clientWidth,height:r.clientHeight};return r.remove(),i},"calculateMathMLDimensions"),vxe=x(async(t,e)=>{if(!ui(t))return t;if(!(NB()||e.legacyMathML||e.forceLegacyMathML))return t.replace(_6,"MathML is unsupported in this environment.");{const{default:r}=await Promise.resolve().then(()=>SLe),n=e.forceLegacyMathML||!NB()&&e.legacyMathML?"htmlAndMathml":"mathml";return t.split(k0).map(i=>ui(i)?`
${i}
`:`
${i}
`).join("").replace(_6,(i,a)=>r.renderToString(a,{throwOnError:!0,displayMode:!0,output:n}).replace(/\n/g," ").replace(//g,""))}},"renderKatexUnsanitized"),_w=x(async(t,e)=>qr(await vxe(t,e),e),"renderKatexSanitized"),Lt={getRows:lxe,sanitizeText:qr,sanitizeTextOrArray:uxe,hasBreaks:hxe,splitBreaks:dxe,lineBreakRegex:k0,removeScript:IB,getUrl:Aw,evaluate:hc,getMax:pxe,getMin:gxe},bxe=x(function(t,e){for(let r of e)t.attr(r[0],r[1])},"d3Attrs"),xxe=x(function(t,e,r){let n=new Map;return r?(n.set("width","100%"),n.set("style",`max-width: ${e}px;`)):(n.set("height",t),n.set("width",e)),n},"calculateSvgSizeAttrs"),wi=x(function(t,e,r,n){const i=xxe(e,r,n);bxe(t,i)},"configureSvgSize"),E0=x(function(t,e,r,n){const i=e.node().getBBox(),a=i.width,s=i.height;ae.info(`SVG bounds: ${a}x${s}`,i);let o=0,l=0;ae.info(`Graph bounds: ${o}x${l}`,t),o=a+r*2,l=s+r*2,ae.info(`Calculated bounds: ${o}x${l}`),wi(e,l,o,n);const u=`${i.x-r} ${i.y-r} ${i.width+2*r} ${i.height+2*r}`;e.attr("viewBox",u)},"setupGraphViewbox"),Rw={};function R6(t){return[...t.cssRules].map(e=>e.cssText).join(` -`)}x(R6,"cssStyleSheetToString");var Txe=x((t,e,r,n)=>{let i="";return t in Rw&&Rw[t]?i=Rw[t]({...r,svgId:n}):ae.warn(`No theme found for ${t}`),` & { +var Pkt=Object.defineProperty;var Bkt=(po,Fo,M0)=>Fo in po?Pkt(po,Fo,{enumerable:!0,configurable:!0,writable:!0,value:M0}):po[Fo]=M0;var tn=(po,Fo,M0)=>Bkt(po,typeof Fo!="symbol"?Fo+"":Fo,M0);(function(){"use strict";var X1,j1,K1,Z1,Q1,J1,ey,ty,ry,ny,iy,ay,sy,oy,t7,C0,ly,cy,uy,hy,dy,fy,fo,py,gy,my,yy,vy,by,xy,Ty,wy,Cy,ky,Ey,Sy,_y,Ay,Ry,Ly,Iy,Dy,My,Ny,$y,Oy,Py,By,Fy,zy,Gy,qy,Vy,Wy,Uy,Hy,Yy,Xy,jy,Ky,Zy,Qy,Jy,ev,tv,rv,nv,iv,av,sv,ov,lv,cv,uv,hv,dv,k0,fv,pv,gv,mv,yv,vv,bv,xv,Tv,wv,Cv,kv,E0,Ev,Sv,_v,Av,Rv,Lv,Iv,Dv,Mv,Nv,$v,Fd,Ov,Pv,Bv,Fv,zv,Gv,qv,Vv,Wv,Uv,Hv,Yv,Xv,jv,Kv,Zv,Qv,Jv,e2,t2,r2,n2,i2,a2,s2,o2,l2,c2,u2,h2,d2,f2,p2,g2,m2,y2,v2,b2,x2,T2,w2,C2,k2,E2,S2,_2,A2,R2,L2,I2,D2,M2,N2,$2,O2,P2,B2,F2,z2,G2,q2,V2,W2,U2,H2,Y2,X2,j2,K2,Z2,Q2,J2,eb,tb,rb,nb,ib,ab,sb,ob,lb,cb,ub,hb,db,fb,pb,gb,mb,yb,vb,bb,xb,zd,S0,Tb,wb,Cb,vh,kb,gke,mke,Eb,Sb,_b,Ab;function po(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Fo={exports:{}},M0=Fo.exports,Eq;function uEe(){return Eq||(Eq=1,(function(t,e){(function(r,n){t.exports=n()})(M0,(function(){var r=1e3,n=6e4,i=36e5,a="millisecond",s="second",o="minute",l="hour",u="day",h="week",d="month",f="quarter",p="year",g="date",m="Invalid Date",y=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,v=/\[([^\]]+)]|YYYY|YY|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,x={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(A){var R=["th","st","nd","rd"],N=A%100;return"["+A+(R[(N-20)%10]||R[N]||R[0])+"]"}},b=function(A,R,N){var M=String(A);return!M||M.length>=R?A:""+Array(R+1-M.length).join(N)+A},w={s:b,z:function(A){var R=-A.utcOffset(),N=Math.abs(R),M=Math.floor(N/60),D=N%60;return(R<=0?"+":"-")+b(M,2,"0")+":"+b(D,2,"0")},m:function A(R,N){if(R.date()1)return A(B[0])}else{var P=R.name;_[P]=R,D=P}return!M&&D&&(C=D),D||!M&&C},$=function(A,R){if(S(A))return A.clone();var N=typeof R=="object"?R:{};return N.date=A,N.args=arguments,new z(N)},I=w;I.l=L,I.i=S,I.w=function(A,R){return $(A,{locale:R.$L,utc:R.$u,x:R.$x,$offset:R.$offset})};var z=(function(){function A(N){this.$L=L(N.locale,null,!0),this.parse(N),this.$x=this.$x||N.x||{},this[k]=!0}var R=A.prototype;return R.parse=function(N){this.$d=(function(M){var D=M.date,O=M.utc;if(D===null)return new Date(NaN);if(I.u(D))return new Date;if(D instanceof Date)return new Date(D);if(typeof D=="string"&&!/Z$/i.test(D)){var B=D.match(y);if(B){var P=B[2]-1||0,G=(B[7]||"0").substring(0,3);return O?new Date(Date.UTC(B[1],P,B[3]||1,B[4]||0,B[5]||0,B[6]||0,G)):new Date(B[1],P,B[3]||1,B[4]||0,B[5]||0,B[6]||0,G)}}return new Date(D)})(N),this.init()},R.init=function(){var N=this.$d;this.$y=N.getFullYear(),this.$M=N.getMonth(),this.$D=N.getDate(),this.$W=N.getDay(),this.$H=N.getHours(),this.$m=N.getMinutes(),this.$s=N.getSeconds(),this.$ms=N.getMilliseconds()},R.$utils=function(){return I},R.isValid=function(){return this.$d.toString()!==m},R.isSame=function(N,M){var D=$(N);return this.startOf(M)<=D&&D<=this.endOf(M)},R.isAfter=function(N,M){return $(N)Sq(t,"name",{value:e,configurable:!0}),S4=(t,e)=>{for(var r in e)Sq(t,r,{get:e[r],enumerable:!0})},Qc={trace:0,debug:1,info:2,warn:3,error:4,fatal:5},se={trace:T((...t)=>{},"trace"),debug:T((...t)=>{},"debug"),info:T((...t)=>{},"info"),warn:T((...t)=>{},"warn"),error:T((...t)=>{},"error"),fatal:T((...t)=>{},"fatal")},f7=T(function(t="fatal"){let e=Qc.fatal;typeof t=="string"?t.toLowerCase()in Qc&&(e=Qc[t]):typeof t=="number"&&(e=t),se.trace=()=>{},se.debug=()=>{},se.info=()=>{},se.warn=()=>{},se.error=()=>{},se.fatal=()=>{},e<=Qc.fatal&&(se.fatal=console.error?console.error.bind(console,zo("FATAL"),"color: orange"):console.log.bind(console,"\x1B[35m",zo("FATAL"))),e<=Qc.error&&(se.error=console.error?console.error.bind(console,zo("ERROR"),"color: orange"):console.log.bind(console,"\x1B[31m",zo("ERROR"))),e<=Qc.warn&&(se.warn=console.warn?console.warn.bind(console,zo("WARN"),"color: orange"):console.log.bind(console,"\x1B[33m",zo("WARN"))),e<=Qc.info&&(se.info=console.info?console.info.bind(console,zo("INFO"),"color: lightblue"):console.log.bind(console,"\x1B[34m",zo("INFO"))),e<=Qc.debug&&(se.debug=console.debug?console.debug.bind(console,zo("DEBUG"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",zo("DEBUG"))),e<=Qc.trace&&(se.trace=console.debug?console.debug.bind(console,zo("TRACE"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",zo("TRACE")))},"setLogLevel"),zo=T(t=>`%c${ma().format("ss.SSS")} : ${t} : `,"format");const _4={min:{r:0,g:0,b:0,s:0,l:0,a:0},max:{r:255,g:255,b:255,h:360,s:100,l:100,a:1},clamp:{r:t=>t>=255?255:t<0?0:t,g:t=>t>=255?255:t<0?0:t,b:t=>t>=255?255:t<0?0:t,h:t=>t%360,s:t=>t>=100?100:t<0?0:t,l:t=>t>=100?100:t<0?0:t,a:t=>t>=1?1:t<0?0:t},toLinear:t=>{const e=t/255;return t>.03928?Math.pow((e+.055)/1.055,2.4):e/12.92},hue2rgb:(t,e,r)=>(r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+(e-t)*6*r:r<1/2?e:r<2/3?t+(e-t)*(2/3-r)*6:t),hsl2rgb:({h:t,s:e,l:r},n)=>{if(!e)return r*2.55;t/=360,e/=100,r/=100;const i=r<.5?r*(1+e):r+e-r*e,a=2*r-i;switch(n){case"r":return _4.hue2rgb(a,i,t+1/3)*255;case"g":return _4.hue2rgb(a,i,t)*255;case"b":return _4.hue2rgb(a,i,t-1/3)*255}},rgb2hsl:({r:t,g:e,b:r},n)=>{t/=255,e/=255,r/=255;const i=Math.max(t,e,r),a=Math.min(t,e,r),s=(i+a)/2;if(n==="l")return s*100;if(i===a)return 0;const o=i-a,l=s>.5?o/(2-i-a):o/(i+a);if(n==="s")return l*100;switch(i){case t:return((e-r)/o+(ee>r?Math.min(e,Math.max(r,t)):Math.min(r,Math.max(e,t)),round:t=>Math.round(t*1e10)/1e10},unit:{dec2hex:t=>{const e=Math.round(t).toString(16);return e.length>1?e:`0${e}`}}},xh={};for(let t=0;t<=255;t++)xh[t]=Dr.unit.dec2hex(t);const ja={ALL:0,RGB:1,HSL:2};let dEe=class{constructor(){this.type=ja.ALL}get(){return this.type}set(e){if(this.type&&this.type!==e)throw new Error("Cannot change both RGB and HSL channels at the same time");this.type=e}reset(){this.type=ja.ALL}is(e){return this.type===e}};class fEe{constructor(e,r){this.color=r,this.changed=!1,this.data=e,this.type=new dEe}set(e,r){return this.color=r,this.changed=!1,this.data=e,this.type.type=ja.ALL,this}_ensureHSL(){const e=this.data,{h:r,s:n,l:i}=e;r===void 0&&(e.h=Dr.channel.rgb2hsl(e,"h")),n===void 0&&(e.s=Dr.channel.rgb2hsl(e,"s")),i===void 0&&(e.l=Dr.channel.rgb2hsl(e,"l"))}_ensureRGB(){const e=this.data,{r,g:n,b:i}=e;r===void 0&&(e.r=Dr.channel.hsl2rgb(e,"r")),n===void 0&&(e.g=Dr.channel.hsl2rgb(e,"g")),i===void 0&&(e.b=Dr.channel.hsl2rgb(e,"b"))}get r(){const e=this.data,r=e.r;return!this.type.is(ja.HSL)&&r!==void 0?r:(this._ensureHSL(),Dr.channel.hsl2rgb(e,"r"))}get g(){const e=this.data,r=e.g;return!this.type.is(ja.HSL)&&r!==void 0?r:(this._ensureHSL(),Dr.channel.hsl2rgb(e,"g"))}get b(){const e=this.data,r=e.b;return!this.type.is(ja.HSL)&&r!==void 0?r:(this._ensureHSL(),Dr.channel.hsl2rgb(e,"b"))}get h(){const e=this.data,r=e.h;return!this.type.is(ja.RGB)&&r!==void 0?r:(this._ensureRGB(),Dr.channel.rgb2hsl(e,"h"))}get s(){const e=this.data,r=e.s;return!this.type.is(ja.RGB)&&r!==void 0?r:(this._ensureRGB(),Dr.channel.rgb2hsl(e,"s"))}get l(){const e=this.data,r=e.l;return!this.type.is(ja.RGB)&&r!==void 0?r:(this._ensureRGB(),Dr.channel.rgb2hsl(e,"l"))}get a(){return this.data.a}set r(e){this.type.set(ja.RGB),this.changed=!0,this.data.r=e}set g(e){this.type.set(ja.RGB),this.changed=!0,this.data.g=e}set b(e){this.type.set(ja.RGB),this.changed=!0,this.data.b=e}set h(e){this.type.set(ja.HSL),this.changed=!0,this.data.h=e}set s(e){this.type.set(ja.HSL),this.changed=!0,this.data.s=e}set l(e){this.type.set(ja.HSL),this.changed=!0,this.data.l=e}set a(e){this.changed=!0,this.data.a=e}}const A4=new fEe({r:0,g:0,b:0,a:0},"transparent"),N0={re:/^#((?:[a-f0-9]{2}){2,4}|[a-f0-9]{3})$/i,parse:t=>{if(t.charCodeAt(0)!==35)return;const e=t.match(N0.re);if(!e)return;const r=e[1],n=parseInt(r,16),i=r.length,a=i%4===0,s=i>4,o=s?1:17,l=s?8:4,u=a?0:-1,h=s?255:15;return A4.set({r:(n>>l*(u+3)&h)*o,g:(n>>l*(u+2)&h)*o,b:(n>>l*(u+1)&h)*o,a:a?(n&h)*o/255:1},t)},stringify:t=>{const{r:e,g:r,b:n,a:i}=t;return i<1?`#${xh[Math.round(e)]}${xh[Math.round(r)]}${xh[Math.round(n)]}${xh[Math.round(i*255)]}`:`#${xh[Math.round(e)]}${xh[Math.round(r)]}${xh[Math.round(n)]}`}},Vd={re:/^hsla?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(?:deg|grad|rad|turn)?)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(%)?))?\s*?\)$/i,hueRe:/^(.+?)(deg|grad|rad|turn)$/i,_hue2deg:t=>{const e=t.match(Vd.hueRe);if(e){const[,r,n]=e;switch(n){case"grad":return Dr.channel.clamp.h(parseFloat(r)*.9);case"rad":return Dr.channel.clamp.h(parseFloat(r)*180/Math.PI);case"turn":return Dr.channel.clamp.h(parseFloat(r)*360)}}return Dr.channel.clamp.h(parseFloat(t))},parse:t=>{const e=t.charCodeAt(0);if(e!==104&&e!==72)return;const r=t.match(Vd.re);if(!r)return;const[,n,i,a,s,o]=r;return A4.set({h:Vd._hue2deg(n),s:Dr.channel.clamp.s(parseFloat(i)),l:Dr.channel.clamp.l(parseFloat(a)),a:s?Dr.channel.clamp.a(o?parseFloat(s)/100:parseFloat(s)):1},t)},stringify:t=>{const{h:e,s:r,l:n,a:i}=t;return i<1?`hsla(${Dr.lang.round(e)}, ${Dr.lang.round(r)}%, ${Dr.lang.round(n)}%, ${i})`:`hsl(${Dr.lang.round(e)}, ${Dr.lang.round(r)}%, ${Dr.lang.round(n)}%)`}},Pb={colors:{aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyanaqua:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",transparent:"#00000000",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},parse:t=>{t=t.toLowerCase();const e=Pb.colors[t];if(e)return N0.parse(e)},stringify:t=>{const e=N0.stringify(t);for(const r in Pb.colors)if(Pb.colors[r]===e)return r}},Bb={re:/^rgba?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?)))?\s*?\)$/i,parse:t=>{const e=t.charCodeAt(0);if(e!==114&&e!==82)return;const r=t.match(Bb.re);if(!r)return;const[,n,i,a,s,o,l,u,h]=r;return A4.set({r:Dr.channel.clamp.r(i?parseFloat(n)*2.55:parseFloat(n)),g:Dr.channel.clamp.g(s?parseFloat(a)*2.55:parseFloat(a)),b:Dr.channel.clamp.b(l?parseFloat(o)*2.55:parseFloat(o)),a:u?Dr.channel.clamp.a(h?parseFloat(u)/100:parseFloat(u)):1},t)},stringify:t=>{const{r:e,g:r,b:n,a:i}=t;return i<1?`rgba(${Dr.lang.round(e)}, ${Dr.lang.round(r)}, ${Dr.lang.round(n)}, ${Dr.lang.round(i)})`:`rgb(${Dr.lang.round(e)}, ${Dr.lang.round(r)}, ${Dr.lang.round(n)})`}},hl={format:{keyword:Pb,hex:N0,rgb:Bb,rgba:Bb,hsl:Vd,hsla:Vd},parse:t=>{if(typeof t!="string")return t;const e=N0.parse(t)||Bb.parse(t)||Vd.parse(t)||Pb.parse(t);if(e)return e;throw new Error(`Unsupported color format: "${t}"`)},stringify:t=>!t.changed&&t.color?t.color:t.type.is(ja.HSL)||t.data.r===void 0?Vd.stringify(t):t.a<1||!Number.isInteger(t.r)||!Number.isInteger(t.g)||!Number.isInteger(t.b)?Bb.stringify(t):N0.stringify(t)},_q=(t,e)=>{const r=hl.parse(t);for(const n in e)r[n]=Dr.channel.clamp[n](e[n]);return hl.stringify(r)},dl=(t,e,r=0,n=1)=>{if(typeof t!="number")return _q(t,{a:e});const i=A4.set({r:Dr.channel.clamp.r(t),g:Dr.channel.clamp.g(e),b:Dr.channel.clamp.b(r),a:Dr.channel.clamp.a(n)});return hl.stringify(i)},p7=(t,e)=>Dr.lang.round(hl.parse(t)[e]),pEe=t=>{const{r:e,g:r,b:n}=hl.parse(t),i=.2126*Dr.channel.toLinear(e)+.7152*Dr.channel.toLinear(r)+.0722*Dr.channel.toLinear(n);return Dr.lang.round(i)},gEe=t=>pEe(t)>=.5,hs=t=>!gEe(t),g7=(t,e,r)=>{const n=hl.parse(t),i=n[e],a=Dr.channel.clamp[e](i+r);return i!==a&&(n[e]=a),hl.stringify(n)},st=(t,e)=>g7(t,"l",e),ot=(t,e)=>g7(t,"l",-e),Aq=(t,e)=>g7(t,"a",-e),ce=(t,e)=>{const r=hl.parse(t),n={};for(const i in e)e[i]&&(n[i]=r[i]+e[i]);return _q(t,n)},mEe=(t,e,r=50)=>{const{r:n,g:i,b:a,a:s}=hl.parse(t),{r:o,g:l,b:u,a:h}=hl.parse(e),d=r/100,f=d*2-1,p=s-h,m=((f*p===-1?f:(f+p)/(1+f*p))+1)/2,y=1-m,v=n*m+o*y,x=i*m+l*y,b=a*m+u*y,w=s*d+h*(1-d);return dl(v,x,b,w)},je=(t,e=100)=>{const r=hl.parse(t);return r.r=255-r.r,r.g=255-r.g,r.b=255-r.b,mEe(r,t,e)};/*! @license DOMPurify 3.4.12 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.12/LICENSE */function Rq(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r2?n-2:0),a=2;a1?r-1:0),i=1;i"u"?null:Vi(BigInt.prototype.toString),Pq=typeof Symbol>"u"?null:Vi(Symbol.prototype.toString),ya=Vi(Object.prototype.hasOwnProperty),Gb=Vi(Object.prototype.toString),va=Vi(RegExp.prototype.test),Wd=LEe(TypeError);function Vi(t){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i2&&arguments[2]!==void 0?arguments[2]:Fb;if(Iq&&Iq(t,null),!Th(e))return t;let n=e.length;for(;n--;){let i=e[n];if(typeof i=="string"){const a=r(i);a!==i&&(wEe(e)||(e[n]=a),i=a)}t[i]=!0}return t}function IEe(t){for(let e=0;e/g),BEe=Ia(/\${[\w\W]*/g),FEe=Ia(/^data-[\-\w.\u00B7-\uFFFF]+$/),zEe=Ia(/^aria-[\-\w]+$/),qq=Ia(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),GEe=Ia(/^(?:\w+script|data):/i),qEe=Ia(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),VEe=Ia(/^html$/i),WEe=Ia(/^[a-z][.\w]*(-[.\w]+)+$/i),Vq=Ia(/<[/\w!]/g),Wq=Ia(/<[/\w]/g),UEe=Ia(/<\/no(script|embed|frames)/i),HEe=Ia(/\/>/i),go={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},YEe=function(){return typeof window>"u"?null:window},XEe=function(e,r){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let n=null;const i="data-tt-policy-suffix";r&&r.hasAttribute(i)&&(n=r.getAttribute(i));const a="dompurify"+(n?"#"+n:"");try{return e.createPolicy(a,{createHTML(s){return s},createScriptURL(s){return s}})}catch{return console.warn("TrustedTypes policy "+a+" could not be created."),null}},Uq=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},wh=function(e,r,n,i){return ya(e,r)&&Th(e[r])?rn(i.base?ds(i.base):{},e[r],i.transform):n};function Hq(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:YEe();const e=Ft=>Hq(Ft);if(e.version="3.4.12",e.removed=[],!t||!t.document||t.document.nodeType!==go.document||!t.Element)return e.isSupported=!1,e;let r=t.document;const n=r,i=n.currentScript;t.DocumentFragment;const a=t.HTMLTemplateElement,s=t.Node,o=t.Element,l=t.NodeFilter,u=t.NamedNodeMap;u===void 0&&(t.NamedNodeMap||t.MozNamedAttrMap),t.HTMLFormElement;const h=t.DOMParser,d=t.trustedTypes,f=o.prototype,p=jl(f,"cloneNode"),g=jl(f,"remove"),m=jl(f,"nextSibling"),y=jl(f,"childNodes"),v=jl(f,"parentNode"),x=jl(f,"shadowRoot"),b=jl(f,"attributes"),w=s&&s.prototype?jl(s.prototype,"nodeType"):null,C=s&&s.prototype?jl(s.prototype,"nodeName"):null;if(typeof a=="function"){const Ft=r.createElement("template");Ft.content&&Ft.content.ownerDocument&&(r=Ft.content.ownerDocument)}let _,k="",S,L=!1,$=0;const I=function(){if($>0)throw Wd('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},z=function(Re){I(),$++;try{return _.createHTML(Re)}finally{$--}},F=function(Re){I(),$++;try{return _.createScriptURL(Re)}finally{$--}},A=function(){return L||(S=XEe(d,i),L=!0),S},R=r,N=R.implementation,M=R.createNodeIterator,D=R.createDocumentFragment,O=R.getElementsByTagName,B=n.importNode;let P=Uq();e.isSupported=typeof Lq=="function"&&typeof v=="function"&&N&&N.createHTMLDocument!==void 0;const G=OEe,V=PEe,H=BEe,W=FEe,ie=zEe,j=GEe,ae=qEe,J=WEe;let K=qq,Q=null;const re=rn({},[...Bq,...b7,...x7,...T7,...Fq]);let le=null;const fe=rn({},[...zq,...w7,...Gq,...R4]);let Ae=Object.seal($0(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}})),Se=null,Ne=null;const ge=Object.seal($0(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let ve=!0,ze=!0,xe=!1,Ke=!0,Ce=!1,Ve=!0,Qe=!1,nt=!1,tt=null,Ze=null,ke=!1,_e=!1,Y=!1,he=!1,Z=!0,pe=!1;const ne="user-content-";let Be=!0,Te=!1,Ue={},De=null;const qe=rn({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]);let Le=null;const Xe=rn({},["audio","video","img","source","image","track"]);let Ie=null;const it=rn({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),we="http://www.w3.org/1998/Math/MathML",ct="http://www.w3.org/2000/svg",be="http://www.w3.org/1999/xhtml";let _t=be,bt=!1,lt=null;const Mt=rn({},[we,ct,be],v7),Tt=La(["mi","mo","mn","ms","mtext"]);let dt=rn({},Tt);const oe=La(["annotation-xml"]);let Rt=rn({},oe);const ft=rn({},["title","style","font","a","script"]);let ht=null;const kt=["application/xhtml+xml","text/html"],qr="text/html";let ye=null,et=null;const ut=r.createElement("form"),Lt=function(Re){return Re instanceof RegExp||Re instanceof Function},Vt=function(){let Re=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(et&&et===Re)return;(!Re||typeof Re!="object")&&(Re={}),Re=ds(Re),ht=kt.indexOf(Re.PARSER_MEDIA_TYPE)===-1?qr:Re.PARSER_MEDIA_TYPE,ye=ht==="application/xhtml+xml"?v7:Fb,Q=wh(Re,"ALLOWED_TAGS",re,{transform:ye}),le=wh(Re,"ALLOWED_ATTR",fe,{transform:ye}),lt=wh(Re,"ALLOWED_NAMESPACES",Mt,{transform:v7}),Ie=wh(Re,"ADD_URI_SAFE_ATTR",it,{transform:ye,base:it}),Le=wh(Re,"ADD_DATA_URI_TAGS",Xe,{transform:ye,base:Xe}),De=wh(Re,"FORBID_CONTENTS",qe,{transform:ye}),Se=wh(Re,"FORBID_TAGS",ds({}),{transform:ye}),Ne=wh(Re,"FORBID_ATTR",ds({}),{transform:ye}),Ue=ya(Re,"USE_PROFILES")?Re.USE_PROFILES&&typeof Re.USE_PROFILES=="object"?ds(Re.USE_PROFILES):Re.USE_PROFILES:!1,ve=Re.ALLOW_ARIA_ATTR!==!1,ze=Re.ALLOW_DATA_ATTR!==!1,xe=Re.ALLOW_UNKNOWN_PROTOCOLS||!1,Ke=Re.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Ce=Re.SAFE_FOR_TEMPLATES||!1,Ve=Re.SAFE_FOR_XML!==!1,Qe=Re.WHOLE_DOCUMENT||!1,_e=Re.RETURN_DOM||!1,Y=Re.RETURN_DOM_FRAGMENT||!1,he=Re.RETURN_TRUSTED_TYPE||!1,ke=Re.FORCE_BODY||!1,Z=Re.SANITIZE_DOM!==!1,pe=Re.SANITIZE_NAMED_PROPS||!1,Be=Re.KEEP_CONTENT!==!1,Te=Re.IN_PLACE||!1,K=MEe(Re.ALLOWED_URI_REGEXP)?Re.ALLOWED_URI_REGEXP:qq,_t=typeof Re.NAMESPACE=="string"?Re.NAMESPACE:be,dt=ya(Re,"MATHML_TEXT_INTEGRATION_POINTS")&&Re.MATHML_TEXT_INTEGRATION_POINTS&&typeof Re.MATHML_TEXT_INTEGRATION_POINTS=="object"?ds(Re.MATHML_TEXT_INTEGRATION_POINTS):rn({},Tt),Rt=ya(Re,"HTML_INTEGRATION_POINTS")&&Re.HTML_INTEGRATION_POINTS&&typeof Re.HTML_INTEGRATION_POINTS=="object"?ds(Re.HTML_INTEGRATION_POINTS):rn({},oe);const Je=ya(Re,"CUSTOM_ELEMENT_HANDLING")&&Re.CUSTOM_ELEMENT_HANDLING&&typeof Re.CUSTOM_ELEMENT_HANDLING=="object"?ds(Re.CUSTOM_ELEMENT_HANDLING):$0(null);if(Ae=$0(null),ya(Je,"tagNameCheck")&&Lt(Je.tagNameCheck)&&(Ae.tagNameCheck=Je.tagNameCheck),ya(Je,"attributeNameCheck")&&Lt(Je.attributeNameCheck)&&(Ae.attributeNameCheck=Je.attributeNameCheck),ya(Je,"allowCustomizedBuiltInElements")&&typeof Je.allowCustomizedBuiltInElements=="boolean"&&(Ae.allowCustomizedBuiltInElements=Je.allowCustomizedBuiltInElements),Ia(Ae),Ce&&(ze=!1),Y&&(_e=!0),Ue&&(Q=rn({},Fq),le=$0(null),Ue.html===!0&&(rn(Q,Bq),rn(le,zq)),Ue.svg===!0&&(rn(Q,b7),rn(le,w7),rn(le,R4)),Ue.svgFilters===!0&&(rn(Q,x7),rn(le,w7),rn(le,R4)),Ue.mathMl===!0&&(rn(Q,T7),rn(le,Gq),rn(le,R4))),ge.tagCheck=null,ge.attributeCheck=null,ya(Re,"ADD_TAGS")&&(typeof Re.ADD_TAGS=="function"?ge.tagCheck=Re.ADD_TAGS:Th(Re.ADD_TAGS)&&(Q===re&&(Q=ds(Q)),rn(Q,Re.ADD_TAGS,ye))),ya(Re,"ADD_ATTR")&&(typeof Re.ADD_ATTR=="function"?ge.attributeCheck=Re.ADD_ATTR:Th(Re.ADD_ATTR)&&(le===fe&&(le=ds(le)),rn(le,Re.ADD_ATTR,ye))),ya(Re,"ADD_URI_SAFE_ATTR")&&Th(Re.ADD_URI_SAFE_ATTR)&&rn(Ie,Re.ADD_URI_SAFE_ATTR,ye),ya(Re,"FORBID_CONTENTS")&&Th(Re.FORBID_CONTENTS)&&(De===qe&&(De=ds(De)),rn(De,Re.FORBID_CONTENTS,ye)),ya(Re,"ADD_FORBID_CONTENTS")&&Th(Re.ADD_FORBID_CONTENTS)&&(De===qe&&(De=ds(De)),rn(De,Re.ADD_FORBID_CONTENTS,ye)),Be&&(Q["#text"]=!0),Qe&&rn(Q,["html","head","body"]),Q.table&&(rn(Q,["tbody"]),delete Se.tbody),Re.TRUSTED_TYPES_POLICY){if(typeof Re.TRUSTED_TYPES_POLICY.createHTML!="function")throw Wd('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof Re.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Wd('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const xt=_;_=Re.TRUSTED_TYPES_POLICY;try{k=z("")}catch(Xt){throw _=xt,Xt}}else Re.TRUSTED_TYPES_POLICY===null?(_=void 0,k=""):(_===void 0&&(_=A()),_&&typeof k=="string"&&(k=z("")));La&&La(Re),et=Re},lr=rn({},[...b7,...x7,...NEe]),cr=rn({},[...T7,...$Ee]),$r=function(Re,Je,xt){return Je.namespaceURI===be?Re==="svg":Je.namespaceURI===we?Re==="svg"&&(xt==="annotation-xml"||dt[xt]):!!lr[Re]},dr=function(Re,Je,xt){return Je.namespaceURI===be?Re==="math":Je.namespaceURI===ct?Re==="math"&&Rt[xt]:!!cr[Re]},Or=function(Re,Je,xt){return Je.namespaceURI===ct&&!Rt[xt]||Je.namespaceURI===we&&!dt[xt]?!1:!cr[Re]&&(ft[Re]||!lr[Re])},ir=function(Re){let Je=v(Re);(!Je||!Je.tagName)&&(Je={namespaceURI:_t,tagName:"template"});const xt=Fb(Re.tagName),Xt=Fb(Je.tagName);return lt[Re.namespaceURI]?Re.namespaceURI===ct?$r(xt,Je,Xt):Re.namespaceURI===we?dr(xt,Je,Xt):Re.namespaceURI===be?Or(xt,Je,Xt):!!(ht==="application/xhtml+xml"&<[Re.namespaceURI]):!1},Vr=function(Re){P0(e.removed,{element:Re});try{v(Re).removeChild(Re)}catch{if(g(Re),!v(Re))throw Wd("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},Sn=function(Re){Ws(Re);const Je=y(Re);if(Je){const Xt=[];O0(Je,vr=>{P0(Xt,vr)}),O0(Xt,vr=>{try{g(vr)}catch{}})}const xt=b(Re);if(xt)for(let Xt=xt.length-1;Xt>=0;--Xt){const vr=xt[Xt],br=vr&&vr.name;if(typeof br=="string")try{Re.removeAttribute(br)}catch{}}},Ur=function(Re,Je){try{P0(e.removed,{attribute:Je.getAttributeNode(Re),from:Je})}catch{P0(e.removed,{attribute:null,from:Je})}if(Je.removeAttribute(Re),Re==="is")if(_e||Y)try{Vr(Je)}catch{}else try{Je.setAttribute(Re,"")}catch{}},us=function(Re){const Je=b(Re);if(Je)for(let xt=Je.length-1;xt>=0;--xt){const Xt=Je[xt],vr=Xt&&Xt.name;if(!(typeof vr!="string"||le[ye(vr)]))try{Re.removeAttribute(vr)}catch{}}},Ws=function(Re){const Je=[Re];for(;Je.length>0;){const xt=Je.pop();(w?w(xt):xt.nodeType)===go.element&&us(xt);const vr=y(xt);if(vr)for(let br=vr.length-1;br>=0;--br)Je.push(vr[br])}},Us=function(Re){if(!Ve)return;const Je=[Re];for(;Je.length>0;){const xt=Je.pop(),Xt=w?w(xt):xt.nodeType;if(Xt===go.processingInstruction||Xt===go.comment&&va(Wq,xt.data)){try{g(xt)}catch{}continue}if(Xt===go.element){const br=xt,_n=ye(C?C(xt):xt.nodeName);try{br.hasAttribute&&br.hasAttribute("patchsrc")&&br.removeAttribute("patchsrc"),br.hasAttribute&&br.hasAttribute("for")&&_n!=="label"&&_n!=="output"&&br.removeAttribute("for")}catch{}}const vr=y(xt);if(vr)for(let br=vr.length-1;br>=0;--br)Je.push(vr[br])}},Ri=function(Re){let Je=null,xt=null;if(ke)Re=""+Re;else{const br=Nq(Re,/^[\r\n\t ]+/);xt=br&&br[0]}ht==="application/xhtml+xml"&&_t===be&&(Re=''+Re+"");const Xt=_?z(Re):Re;if(_t===be)try{Je=new h().parseFromString(Xt,ht)}catch{}if(!Je||!Je.documentElement){Je=N.createDocument(_t,"template",null);try{Je.documentElement.innerHTML=bt?k:Xt}catch{}}const vr=Je.body||Je.documentElement;return Re&&xt&&vr.insertBefore(r.createTextNode(xt),vr.childNodes[0]||null),_t===be?O.call(Je,Qe?"html":"body")[0]:Qe?Je.documentElement:vr},qt=function(Re){return M.call(Re.ownerDocument||Re,Re,l.SHOW_ELEMENT|l.SHOW_COMMENT|l.SHOW_TEXT|l.SHOW_PROCESSING_INSTRUCTION|l.SHOW_CDATA_SECTION,null)},vt=function(Re){return Re=zb(Re,G," "),Re=zb(Re,V," "),Re=zb(Re,H," "),Re},Gt=function(Re){var Je;Re.normalize();const xt=M.call(Re.ownerDocument||Re,Re,l.SHOW_TEXT|l.SHOW_COMMENT|l.SHOW_CDATA_SECTION|l.SHOW_PROCESSING_INSTRUCTION,null);let Xt=xt.nextNode();for(;Xt;)Xt.data=vt(Xt.data),Xt=xt.nextNode();const vr=(Je=Re.querySelectorAll)===null||Je===void 0?void 0:Je.call(Re,"template");vr&&O0(vr,br=>{xr(br.content)&&Gt(br.content)})},Et=function(Re){const Je=C?C(Re):null;return typeof Je!="string"||ye(Je)!=="form"?!1:typeof Re.nodeName!="string"||typeof Re.textContent!="string"||typeof Re.removeChild!="function"||Re.attributes!==b(Re)||typeof Re.removeAttribute!="function"||typeof Re.setAttribute!="function"||typeof Re.namespaceURI!="string"||typeof Re.insertBefore!="function"||typeof Re.hasChildNodes!="function"||Re.nodeType!==w(Re)||Re.childNodes!==y(Re)},xr=function(Re){if(!w||typeof Re!="object"||Re===null)return!1;try{return w(Re)===go.documentFragment}catch{return!1}},Ee=function(Re){if(!w||typeof Re!="object"||Re===null)return!1;try{return typeof w(Re)=="number"}catch{return!1}};function ta(Ft,Re,Je){Ft.length!==0&&O0(Ft,xt=>{xt.call(e,Re,Je,et)})}const $e=function(Re,Je){return!!(Ve&&Re.hasChildNodes()&&!Ee(Re.firstElementChild)&&va(Vq,Re.textContent)&&va(Vq,Re.innerHTML)||Ve&&Re.namespaceURI===be&&Je==="style"&&Ee(Re.firstElementChild)||Re.nodeType===go.processingInstruction||Ve&&Re.nodeType===go.comment&&va(Wq,Re.data))},Un=function(Re,Je){if(!Se[Je]&&Ib(Je)&&(Ae.tagNameCheck instanceof RegExp&&va(Ae.tagNameCheck,Je)||Ae.tagNameCheck instanceof Function&&Ae.tagNameCheck(Je)))return!1;if(Be&&!De[Je]){const xt=v(Re),Xt=y(Re);if(Xt&&xt){const vr=Xt.length;for(let br=vr-1;br>=0;--br){const _n=Te?Xt[br]:p(Xt[br],!0);xt.insertBefore(_n,m(Re))}}}return Vr(Re),!0},_0=function(Re,Je){if(ta(P.beforeSanitizeElements,Re,null),Re!==Je&&v(Re)===null)return!0;if(Et(Re))return Vr(Re),!0;const xt=ye(C?C(Re):Re.nodeName);if(ta(P.uponSanitizeElement,Re,{tagName:xt,allowedTags:Q}),Re!==Je&&v(Re)===null)return!0;if($e(Re,xt))return Vr(Re),!0;if(Se[xt]||!(ge.tagCheck instanceof Function&&ge.tagCheck(xt))&&!Q[xt]){const vr=Un(Re,xt);return vr===!1&&ta(P.afterSanitizeElements,Re,null),vr}if((w?w(Re):Re.nodeType)===go.element&&!ir(Re)||(xt==="noscript"||xt==="noembed"||xt==="noframes")&&va(UEe,Re.innerHTML))return Vr(Re),!0;if(Ce&&Re.nodeType===go.text){const vr=vt(Re.textContent);Re.textContent!==vr&&(P0(e.removed,{element:Re.cloneNode()}),Re.textContent=vr)}return ta(P.afterSanitizeElements,Re,null),!1},Rb=function(Re,Je,xt){if(Ne[Je]||Ve&&Je==="patchsrc"||Ve&&Je==="for"&&Re!=="label"&&Re!=="output"||Z&&(Je==="id"||Je==="name")&&(xt in r||xt in ut))return!1;const Xt=le[Je]||ge.attributeCheck instanceof Function&&ge.attributeCheck(Je,Re);if(!(ze&&va(W,Je))){if(!(ve&&va(ie,Je))){if(Xt){if(!Ie[Je]){if(!va(K,zb(xt,ae,""))){if(!((Je==="src"||Je==="xlink:href"||Je==="href")&&Re!=="script"&&$q(xt,"data:")===0&&Le[Re])){if(!(xe&&!va(j,zb(xt,ae,"")))){if(xt)return!1}}}}}else if(!(Ib(Re)&&(Ae.tagNameCheck instanceof RegExp&&va(Ae.tagNameCheck,Re)||Ae.tagNameCheck instanceof Function&&Ae.tagNameCheck(Re))&&(Ae.attributeNameCheck instanceof RegExp&&va(Ae.attributeNameCheck,Je)||Ae.attributeNameCheck instanceof Function&&Ae.attributeNameCheck(Je,Re))||Je==="is"&&Ae.allowCustomizedBuiltInElements&&(Ae.tagNameCheck instanceof RegExp&&va(Ae.tagNameCheck,xt)||Ae.tagNameCheck instanceof Function&&Ae.tagNameCheck(xt))))return!1}}return!0},Lb=rn({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),Ib=function(Re){return!Lb[Fb(Re)]&&va(J,Re)},xi=function(Re,Je,xt,Xt){if(_&&typeof d=="object"&&typeof d.getAttributeType=="function"&&!xt)switch(d.getAttributeType(Re,Je)){case"TrustedHTML":return z(Xt);case"TrustedScriptURL":return F(Xt)}return Xt},Wl=function(Re,Je,xt,Xt){try{xt?Re.setAttributeNS(xt,Je,Xt):Re.setAttribute(Je,Xt),Et(Re)?Vr(Re):Mq(e.removed)}catch{Ur(Je,Re)}},Fi=function(Re){ta(P.beforeSanitizeAttributes,Re,null);const Je=Re.attributes;if(!Je||Et(Re))return;const xt={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:le,forceKeepAttr:void 0};let Xt=Je.length;const vr=ye(Re.nodeName);for(;Xt--;){const br=Je[Xt],_n=br.name,wn=br.namespaceURI,zi=br.value,Ti=ye(_n),Gi=zi;let ln=_n==="value"?Gi:_Ee(Gi);if(xt.attrName=Ti,xt.attrValue=ln,xt.keepAttr=!0,xt.forceKeepAttr=void 0,ta(P.uponSanitizeAttribute,Re,xt),ln=xt.attrValue,pe&&(Ti==="id"||Ti==="name")&&$q(ln,ne)!==0&&(Ur(_n,Re),ln=ne+ln),Ve&&va(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,ln)){Ur(_n,Re);continue}if(Ti==="attributename"&&Nq(ln,"href")){Ur(_n,Re);continue}if(!xt.forceKeepAttr){if(!xt.keepAttr){Ur(_n,Re);continue}if(!Ke&&va(HEe,ln)){Ur(_n,Re);continue}if(Ce&&(ln=vt(ln)),!Rb(vr,Ti,ln)){Ur(_n,Re);continue}ln=xi(vr,Ti,wn,ln),ln!==Gi&&Wl(Re,_n,wn,ln)}}ta(P.afterSanitizeAttributes,Re,null)},Ul=function(Re){let Je=null;const xt=qt(Re);for(ta(P.beforeSanitizeShadowDOM,Re,null);Je=xt.nextNode();)if(ta(P.uponSanitizeShadowNode,Je,null),_0(Je,Re),Fi(Je),xr(Je.content)&&Ul(Je.content),(w?w(Je):Je.nodeType)===go.element){const vr=x(Je);xr(vr)&&(bh(vr),Ul(vr))}ta(P.afterSanitizeShadowDOM,Re,null)},bh=function(Re){const Je=[{node:Re,shadow:null}];for(;Je.length>0;){const xt=Je.pop();if(xt.shadow){Ul(xt.shadow);continue}const Xt=xt.node,br=(w?w(Xt):Xt.nodeType)===go.element,_n=y(Xt);if(_n)for(let wn=_n.length-1;wn>=0;--wn)Je.push({node:_n[wn],shadow:null});if(br){const wn=C?C(Xt):null;if(typeof wn=="string"&&ye(wn)==="template"){const zi=Xt.content;xr(zi)&&Je.push({node:zi,shadow:null})}}if(br){const wn=x(Xt);xr(wn)&&Je.push({node:null,shadow:wn},{node:wn,shadow:null})}}};return e.sanitize=function(Ft){let Re=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Je=null,xt=null,Xt=null,vr=null;if(bt=!Ft,bt&&(Ft=""),typeof Ft!="string"&&!Ee(Ft)&&(Ft=DEe(Ft),typeof Ft!="string"))throw Wd("dirty is not a string, aborting");if(!e.isSupported)return Ft;nt?(Q=tt,le=Ze):Vt(Re),(P.uponSanitizeElement.length>0||P.uponSanitizeAttribute.length>0)&&(Q=ds(Q)),P.uponSanitizeAttribute.length>0&&(le=ds(le)),e.removed=[];const br=Te&&typeof Ft!="string"&&Ee(Ft);if(br){Us(Ft);const Ti=C?C(Ft):Ft.nodeName;if(typeof Ti=="string"){const Gi=ye(Ti);if(!Q[Gi]||Se[Gi])throw Sn(Ft),Wd("root node is forbidden and cannot be sanitized in-place")}if(Et(Ft))throw Sn(Ft),Wd("root node is clobbered and cannot be sanitized in-place");try{bh(Ft)}catch(Gi){throw Sn(Ft),Gi}}else if(Ee(Ft))Je=Ri(""),xt=Je.ownerDocument.importNode(Ft,!0),xt.nodeType===go.element&&xt.nodeName==="BODY"||xt.nodeName==="HTML"?Je=xt:Je.appendChild(xt),bh(xt);else{if(!_e&&!Ce&&!Qe&&Ft.indexOf("<")===-1)return _&&he?z(Ft):Ft;if(Je=Ri(Ft),!Je)return _e?null:he?k:""}Je&&ke&&Vr(Je.firstChild);const _n=br?Ft:Je,wn=qt(_n);try{for(;Xt=wn.nextNode();)_0(Xt,_n),Fi(Xt),xr(Xt.content)&&Ul(Xt.content)}catch(Ti){throw br&&(Sn(Ft),O0(e.removed,Gi=>{Gi.element&&Ws(Gi.element)})),Ti}if(br)return O0(e.removed,Ti=>{Ti.element&&Ws(Ti.element)}),Ce&&Gt(Ft),Ft;if(_e){if(Ce&&Gt(Je),Y)for(vr=D.call(Je.ownerDocument);Je.firstChild;)vr.appendChild(Je.firstChild);else vr=Je;return(le.shadowroot||le.shadowrootmode)&&(vr=B.call(n,vr,!0)),vr}let zi=Qe?Je.outerHTML:Je.innerHTML;return Qe&&Q["!doctype"]&&Je.ownerDocument&&Je.ownerDocument.doctype&&Je.ownerDocument.doctype.name&&va(VEe,Je.ownerDocument.doctype.name)&&(zi=" +`+zi),Ce&&(zi=vt(zi)),_&&he?z(zi):zi},e.setConfig=function(){let Ft=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Vt(Ft),nt=!0,tt=Q,Ze=le},e.clearConfig=function(){et=null,nt=!1,tt=null,Ze=null,_=S,k=""},e.isValidAttribute=function(Ft,Re,Je){et||Vt({});const xt=ye(Ft),Xt=ye(Re);return Rb(xt,Xt,Je)},e.addHook=function(Ft,Re){typeof Re=="function"&&ya(P,Ft)&&P0(P[Ft],Re)},e.removeHook=function(Ft,Re){if(ya(P,Ft)){if(Re!==void 0){const Je=EEe(P[Ft],Re);return Je===-1?void 0:SEe(P[Ft],Je,1)[0]}return Mq(P[Ft])}},e.removeHooks=function(Ft){ya(P,Ft)&&(P[Ft]=[])},e.removeAllHooks=function(){P=Uq()},e}var Ch=Hq(),Yq=/^-{3}\s*[\n\r](.*?)[\n\r]-{3}\s*[\n\r]+/s,qb=/%{2}{\s*(?:(\w+)\s*:|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,jEe=/\s*%%.*\n/gm,Xq=(X1=class extends Error{constructor(e){super(e),this.name="UnknownDiagramError"}},T(X1,"UnknownDiagramError"),X1),Ud={},C7=T(function(t,e){t=t.replace(Yq,"").replace(qb,"").replace(jEe,` +`);for(const[r,{detector:n}]of Object.entries(Ud))if(n(t,e))return r;throw new Xq(`No diagram type detected matching given configuration for text: ${t}`)},"detectType"),k7=T((...t)=>{for(const{id:e,detector:r,loader:n}of t)jq(e,r,n)},"registerLazyLoadedDiagrams"),jq=T((t,e,r)=>{Ud[t]&&se.warn(`Detector with key ${t} already exists. Overwriting.`),Ud[t]={detector:e,loader:r},se.debug(`Detector with key ${t} added${r?" with loader":""}`)},"addDetector"),KEe=T(t=>Ud[t].loader,"getDiagramLoader"),E7=T((t,e,{depth:r=2,clobber:n=!1}={})=>{const i={depth:r,clobber:n};return Array.isArray(e)&&!Array.isArray(t)?(e.forEach(a=>E7(t,a,i)),t):Array.isArray(e)&&Array.isArray(t)?(e.forEach(a=>{t.includes(a)||t.push(a)}),t):t===void 0||r<=0?t!=null&&typeof t=="object"&&typeof e=="object"?Object.assign(t,e):e:(e!==void 0&&typeof t=="object"&&typeof e=="object"&&Object.keys(e).forEach(a=>{typeof e[a]=="object"&&e[a]!==null&&(t[a]===void 0||typeof t[a]=="object")?(t[a]===void 0&&(t[a]=Array.isArray(e[a])?[]:{}),t[a]=E7(t[a],e[a],{depth:r-1,clobber:n})):(n||typeof t[a]!="object"&&typeof e[a]!="object")&&(t[a]=e[a])}),t)},"assignWithDepth"),Li=E7,Kl="#ffffff",Zl="#f2f2f2",_r=T((t,e)=>e?ce(t,{s:-40,l:10}):ce(t,{s:-40,l:-10}),"mkBorder"),ZEe=(j1=class{constructor(){this.background="#f4f4f4",this.primaryColor="#fff4dd",this.noteBkgColor="#fff5ad",this.noteTextColor="#333",this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.useGradient=!0,this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,1))"}updateColors(){var r,n,i,a,s,o,l,u,h,d,f,p,g,m,y,v,x,b,w,C,_,k,S,L,$,I,z,F,A,R,N,M,D,O;if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||ce(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||ce(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||_r(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||_r(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||_r(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||_r(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||je(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||je(this.tertiaryColor),this.lineColor=this.lineColor||je(this.background),this.arrowheadColor=this.arrowheadColor||je(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?ot(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||ot(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||je(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||st(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.vertLineColor=this.vertLineColor||"navy",this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.noteFontWeight=this.noteFontWeight||"normal",this.fontWeight=this.fontWeight||"normal",this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.darkMode?(this.rowOdd=this.rowOdd||ot(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||ot(this.mainBkg,10)):(this.rowOdd=this.rowOdd||st(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||st(this.mainBkg,5)),this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||this.tertiaryColor,this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||ce(this.primaryColor,{h:30}),this.cScale4=this.cScale4||ce(this.primaryColor,{h:60}),this.cScale5=this.cScale5||ce(this.primaryColor,{h:90}),this.cScale6=this.cScale6||ce(this.primaryColor,{h:120}),this.cScale7=this.cScale7||ce(this.primaryColor,{h:150}),this.cScale8=this.cScale8||ce(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||ce(this.primaryColor,{h:270}),this.cScale10=this.cScale10||ce(this.primaryColor,{h:300}),this.cScale11=this.cScale11||ce(this.primaryColor,{h:330}),this.darkMode)for(let B=0;B{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},T(j1,"Theme"),j1),QEe=T(t=>{const e=new ZEe;return e.calculate(t),e},"getThemeVariables"),JEe=(K1=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=st(this.primaryColor,16),this.tertiaryColor=ce(this.primaryColor,{h:-160}),this.primaryBorderColor=je(this.background),this.secondaryBorderColor=_r(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=_r(this.tertiaryColor,this.darkMode),this.primaryTextColor=je(this.primaryColor),this.secondaryTextColor=je(this.secondaryColor),this.tertiaryTextColor=je(this.tertiaryColor),this.lineColor=je(this.background),this.textColor=je(this.background),this.mainBkg="#1f2020",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=st(je("#323D47"),10),this.lineColor="calculated",this.border1="#ccc",this.border2=dl(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.radius=5,this.strokeWidth=1,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.clusterBkg="#302F3D",this.sectionBkgColor=ot("#EAE8D9",30),this.altSectionBkgColor="calculated",this.sectionBkgColor2="#EAE8D9",this.excludeBkgColor=ot(this.sectionBkgColor,10),this.taskBorderColor=dl(255,255,255,70),this.taskBkgColor="calculated",this.taskTextColor="calculated",this.taskTextLightColor="calculated",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor=dl(255,255,255,50),this.activeTaskBkgColor="#81B1DB",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="grey",this.critBorderColor="#E83737",this.critBkgColor="#E83737",this.taskTextDarkColor="calculated",this.todayLineColor="#DB5757",this.vertLineColor="#00BFFF",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.rowOdd=this.rowOdd||st(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||ot(this.mainBkg,10),this.labelColor="calculated",this.errorBkgColor="#a44141",this.errorTextColor="#ddd",this.useGradient=!0,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,1))",this.noteFontWeight=this.noteFontWeight||"normal",this.fontWeight=this.fontWeight||"normal"}updateColors(){var e,r,n,i,a,s,o,l,u,h,d,f,p,g,m,y,v,x,b,w,C,_,k,S,L,$,I,z,F,A,R,N,M,D;this.secondBkg=st(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=st(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=st(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=je(this.doneTaskBkgColor),this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#555",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.primaryBorderColor,this.specialStateColor="#f4f4f4",this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=ce(this.primaryColor,{h:64}),this.fillType3=ce(this.secondaryColor,{h:64}),this.fillType4=ce(this.primaryColor,{h:-64}),this.fillType5=ce(this.secondaryColor,{h:-64}),this.fillType6=ce(this.primaryColor,{h:128}),this.fillType7=ce(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||ce(this.primaryColor,{h:30}),this.cScale4=this.cScale4||ce(this.primaryColor,{h:60}),this.cScale5=this.cScale5||ce(this.primaryColor,{h:90}),this.cScale6=this.cScale6||ce(this.primaryColor,{h:120}),this.cScale7=this.cScale7||ce(this.primaryColor,{h:150}),this.cScale8=this.cScale8||ce(this.primaryColor,{h:210}),this.cScale9=this.cScale9||ce(this.primaryColor,{h:270}),this.cScale10=this.cScale10||ce(this.primaryColor,{h:300}),this.cScale11=this.cScale11||ce(this.primaryColor,{h:330});for(let O=0;O{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},T(K1,"Theme"),K1),e5e=T(t=>{const e=new JEe;return e.calculate(t),e},"getThemeVariables"),t5e=(Z1=class{constructor(){this.background="#f4f4f4",this.primaryColor="#ECECFF",this.secondaryColor=ce(this.primaryColor,{h:120}),this.secondaryColor="#ffffde",this.tertiaryColor=ce(this.primaryColor,{h:-160}),this.primaryBorderColor=_r(this.primaryColor,this.darkMode),this.secondaryBorderColor=_r(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=_r(this.tertiaryColor,this.darkMode),this.primaryTextColor=je(this.primaryColor),this.secondaryTextColor=je(this.secondaryColor),this.tertiaryTextColor=je(this.tertiaryColor),this.lineColor=je(this.background),this.textColor=je(this.background),this.background="white",this.mainBkg="#ECECFF",this.secondBkg="#ffffde",this.lineColor="#333333",this.border1="#9370DB",this.primaryBorderColor=_r(this.primaryColor,this.darkMode),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.radius=5,this.strokeWidth=1,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.clusterBkg="#FBFBFF",this.sectionBkgColor="calculated",this.altSectionBkgColor="calculated",this.sectionBkgColor2="calculated",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="calculated",this.taskTextLightColor="calculated",this.taskTextColor=this.taskTextLightColor,this.taskTextDarkColor="calculated",this.taskTextOutsideColor=this.taskTextDarkColor,this.taskTextClickableColor="calculated",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="calculated",this.critBorderColor="calculated",this.critBkgColor="calculated",this.todayLineColor="calculated",this.vertLineColor="calculated",this.sectionBkgColor=dl(102,102,255,.49),this.altSectionBkgColor="white",this.sectionBkgColor2="#fff400",this.taskBorderColor="#534fbc",this.taskBkgColor="#8a90dd",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="black",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="#534fbc",this.activeTaskBkgColor="#bfc7ff",this.gridColor="lightgrey",this.doneTaskBkgColor="lightgrey",this.doneTaskBorderColor="grey",this.critBorderColor="#ff8888",this.critBkgColor="red",this.todayLineColor="red",this.vertLineColor="navy",this.noteFontWeight=this.noteFontWeight||"normal",this.fontWeight=this.fontWeight||"normal",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.rowOdd="calculated",this.rowEven="calculated",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222",this.useGradient=!1,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow="drop-shadow(1px 2px 2px rgba(185, 185, 185, 1))",this.updateColors()}updateColors(){var e,r,n,i,a,s,o,l,u,h,d,f,p,g,m,y,v,x,b,w,C,_,k,S,L,$,I,z,F,A,R,N,M,D;this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||ce(this.primaryColor,{h:30}),this.cScale4=this.cScale4||ce(this.primaryColor,{h:60}),this.cScale5=this.cScale5||ce(this.primaryColor,{h:90}),this.cScale6=this.cScale6||ce(this.primaryColor,{h:120}),this.cScale7=this.cScale7||ce(this.primaryColor,{h:150}),this.cScale8=this.cScale8||ce(this.primaryColor,{h:210}),this.cScale9=this.cScale9||ce(this.primaryColor,{h:270}),this.cScale10=this.cScale10||ce(this.primaryColor,{h:300}),this.cScale11=this.cScale11||ce(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||ot(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||ot(this.tertiaryColor,40);for(let O=0;O{this[n]==="calculated"&&(this[n]=void 0)}),typeof e!="object"){this.updateColors();return}const r=Object.keys(e);r.forEach(n=>{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},T(Z1,"Theme"),Z1),B0=T(t=>{const e=new t5e;return e.calculate(t),e},"getThemeVariables"),r5e=(Q1=class{constructor(){this.background="#f4f4f4",this.primaryColor="#cde498",this.secondaryColor="#cdffb2",this.background="white",this.mainBkg="#cde498",this.secondBkg="#cdffb2",this.lineColor="green",this.border1="#13540c",this.border2="#6eaa49",this.arrowheadColor="green",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.tertiaryColor=st("#cde498",10),this.primaryBorderColor=_r(this.primaryColor,this.darkMode),this.secondaryBorderColor=_r(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=_r(this.tertiaryColor,this.darkMode),this.primaryTextColor=je(this.primaryColor),this.secondaryTextColor=je(this.secondaryColor),this.tertiaryTextColor=je(this.primaryColor),this.lineColor=je(this.background),this.textColor=je(this.background),this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="#333",this.edgeLabelBackground="#e8e8e8",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="black",this.actorLineColor="calculated",this.signalColor="#333",this.signalTextColor="#333",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="#326932",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.sectionBkgColor="#6eaa49",this.altSectionBkgColor="white",this.sectionBkgColor2="#6eaa49",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="#487e3a",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="black",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="lightgrey",this.doneTaskBkgColor="lightgrey",this.doneTaskBorderColor="grey",this.critBorderColor="#ff8888",this.critBkgColor="red",this.todayLineColor="red",this.vertLineColor="#00BFFF",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.noteFontWeight="normal",this.fontWeight="normal",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222",this.useGradient=!0,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,0.5))"}updateColors(){var e,r,n,i,a,s,o,l,u,h,d,f,p,g,m,y,v,x,b,w,C,_,k,S,L,$,I,z,F,A,R,N,M,D;this.actorBorder=ot(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||ce(this.primaryColor,{h:30}),this.cScale4=this.cScale4||ce(this.primaryColor,{h:60}),this.cScale5=this.cScale5||ce(this.primaryColor,{h:90}),this.cScale6=this.cScale6||ce(this.primaryColor,{h:120}),this.cScale7=this.cScale7||ce(this.primaryColor,{h:150}),this.cScale8=this.cScale8||ce(this.primaryColor,{h:210}),this.cScale9=this.cScale9||ce(this.primaryColor,{h:270}),this.cScale10=this.cScale10||ce(this.primaryColor,{h:300}),this.cScale11=this.cScale11||ce(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||ot(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||ot(this.tertiaryColor,40);for(let O=0;O{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},T(Q1,"Theme"),Q1),n5e=T(t=>{const e=new r5e;return e.calculate(t),e},"getThemeVariables"),i5e=(J1=class{constructor(){this.primaryColor="#eee",this.contrast="#707070",this.secondaryColor=st(this.contrast,55),this.background="#ffffff",this.tertiaryColor=ce(this.primaryColor,{h:-160}),this.primaryBorderColor=_r(this.primaryColor,this.darkMode),this.secondaryBorderColor=_r(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=_r(this.tertiaryColor,this.darkMode),this.primaryTextColor=je(this.primaryColor),this.secondaryTextColor=je(this.secondaryColor),this.tertiaryTextColor=je(this.tertiaryColor),this.lineColor=je(this.background),this.textColor=je(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.radius=5,this.strokeWidth=1,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="calculated",this.edgeLabelBackground="white",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="calculated",this.actorLineColor=this.actorBorder,this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="calculated",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.sectionBkgColor="calculated",this.altSectionBkgColor="white",this.sectionBkgColor2="calculated",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="calculated",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="calculated",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="calculated",this.critBkgColor="calculated",this.critBorderColor="calculated",this.todayLineColor="calculated",this.vertLineColor="calculated",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.noteFontWeight="normal",this.fontWeight="normal",this.rowOdd=this.rowOdd||st(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||"#f4f4f4",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222",this.useGradient=!0,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,1))"}updateColors(){var e,r,n,i,a,s,o,l,u,h,d,f,p,g,m,y,v,x,b,w,C,_,k,S,L,$,I,z,F,A,R,N,M,D;this.secondBkg=st(this.contrast,55),this.border2=this.contrast,this.actorBorder=st(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 O=0;O{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},T(J1,"Theme"),J1),a5e=T(t=>{const e=new i5e;return e.calculate(t),e},"getThemeVariables"),s5e=(ey=class{constructor(){this.background="#ffffff",this.primaryColor="#cccccc",this.mainBkg="#ffffff",this.noteBkgColor="#fff5ad",this.noteTextColor="#333",this.THEME_COLOR_LIMIT=12,this.radius=3,this.strokeWidth=2,this.primaryBorderColor=_r(this.primaryColor,this.darkMode),this.fontFamily="arial, sans-serif",this.fontSize="14px",this.nodeBorder="#000000",this.stateBorder="#000000",this.useGradient=!0,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="drop-shadow( 0px 1px 2px rgba(0, 0, 0, 0.25));",this.tertiaryColor="#ffffff",this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.noteFontWeight="normal",this.fontWeight="normal"}updateColors(){var a,s,o,l,u,h,d,f,p,g,m;this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||ce(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||ce(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||_r(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||_r(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||_r(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||_r(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||je(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||je(this.tertiaryColor),this.lineColor=this.lineColor||je(this.background),this.arrowheadColor=this.arrowheadColor||je(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?ot(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||ot(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||je(this.lineColor);const e="#ECECFE",r="#E9E9F1",n=ce(e,{h:180,l:5});if(this.sectionBkgColor=this.sectionBkgColor||n,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||r,this.sectionBkgColor2=this.sectionBkgColor2||e,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||e,this.activeTaskBorderColor=this.activeTaskBorderColor||e,this.activeTaskBkgColor=this.activeTaskBkgColor||st(e,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.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,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||"#f0f0f0",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||e,this.cScale1=this.cScale1||r,this.cScale2=this.cScale2||n,this.cScale3=this.cScale3||ce(e,{h:30}),this.cScale4=this.cScale4||ce(e,{h:60}),this.cScale5=this.cScale5||ce(e,{h:90}),this.cScale6=this.cScale6||ce(e,{h:120}),this.cScale7=this.cScale7||ce(e,{h:150}),this.cScale8=this.cScale8||ce(e,{h:210,l:150}),this.cScale9=this.cScale9||ce(e,{h:270}),this.cScale10=this.cScale10||ce(e,{h:300}),this.cScale11=this.cScale11||ce(e,{h:330}),this.darkMode)for(let y=0;y{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},T(ey,"Theme"),ey),o5e=T(t=>{const e=new s5e;return e.calculate(t),e},"getThemeVariables"),l5e=(ty=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=st(this.primaryColor,16),this.tertiaryColor=ce(this.primaryColor,{h:-160}),this.primaryBorderColor=je(this.background),this.secondaryBorderColor=_r(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=_r(this.tertiaryColor,this.darkMode),this.primaryTextColor=je(this.primaryColor),this.secondaryTextColor=je(this.secondaryColor),this.tertiaryTextColor=je(this.tertiaryColor),this.mainBkg="#2a2020",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=st(je("#323D47"),10),this.border1="#ccc",this.border2=dl(255,255,255,.25),this.arrowheadColor=je(this.background),this.fontFamily="arial, sans-serif",this.fontSize="14px",this.labelBackground="#181818",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.radius=3,this.strokeWidth=1,this.noteBkgColor="#fff5ad",this.noteTextColor="#333",this.THEME_COLOR_LIMIT=12,this.fontFamily="arial, sans-serif",this.fontSize="14px",this.useGradient=!0,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,0.2))",this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.noteFontWeight="normal",this.fontWeight="normal"}updateColors(){var r,n,i,a,s,o,l,u,h,d,f;if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||ce(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||ce(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||_r(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||_r(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||_r(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||_r(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||je(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||je(this.tertiaryColor),this.lineColor=this.lineColor||je(this.background),this.arrowheadColor=this.arrowheadColor||je(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.border1,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?ot(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||ot(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||je(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||st(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.vertLineColor=this.vertLineColor||this.primaryBorderColor,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.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,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||"#f0f0f0",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||ce(this.primaryColor,{h:30}),this.cScale4=this.cScale4||ce(this.primaryColor,{h:60}),this.cScale5=this.cScale5||ce(this.primaryColor,{h:90}),this.cScale6=this.cScale6||ce(this.primaryColor,{h:120}),this.cScale7=this.cScale7||ce(this.primaryColor,{h:150}),this.cScale8=this.cScale8||ce(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||ce(this.primaryColor,{h:270}),this.cScale10=this.cScale10||ce(this.primaryColor,{h:300}),this.cScale11=this.cScale11||ce(this.primaryColor,{h:330}),this.darkMode)for(let p=0;p{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},T(ty,"Theme"),ty),c5e=T(t=>{const e=new l5e;return e.calculate(t),e},"getThemeVariables"),u5e=(ry=class{constructor(){this.background="#ffffff",this.primaryColor="#cccccc",this.mainBkg="#ffffff",this.noteBkgColor="#fff5ad",this.noteTextColor="#28253D",this.THEME_COLOR_LIMIT=12,this.radius=12,this.strokeWidth=2,this.primaryBorderColor=_r("#28253D",this.darkMode),this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.nodeBorder="#28253D",this.stateBorder="#28253D",this.useGradient=!1,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="url(#drop-shadow)",this.nodeShadow=!0,this.tertiaryColor="#ffffff",this.clusterBkg="#F9F9FB",this.clusterBorder="#BDBCCC",this.noteBorderColor="#FACC15",this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.actorBorder="#28253D",this.filterColor="#000000"}updateColors(){var a,s,o,l,u,h,d,f,p,g,m;this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#28253D"),this.secondaryColor=this.secondaryColor||ce(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||ce(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||_r(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||_r(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||_r(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||_r(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#FEF9C3",this.noteTextColor=this.noteTextColor||"#28253D",this.secondaryTextColor=this.secondaryTextColor||je(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||je(this.tertiaryColor),this.lineColor=this.lineColor||je(this.background),this.arrowheadColor=this.arrowheadColor||je(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?ot(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.noteFontWeight=600,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||ot(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||je(this.lineColor);const e="#ECECFE",r="#E9E9F1",n=ce(e,{h:180,l:5});this.sectionBkgColor=this.sectionBkgColor||n,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||r,this.sectionBkgColor2=this.sectionBkgColor2||e,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||e,this.activeTaskBorderColor=this.activeTaskBorderColor||e,this.activeTaskBkgColor=this.activeTaskBkgColor||st(e,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.vertLineColor=this.vertLineColor||this.primaryBorderColor,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.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,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.compositeTitleBackground="#F9F9FB",this.altBackground="#F9F9FB",this.stateEdgeLabelBackground="#FFFFFF",this.fontWeight=600,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.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor;for(let y=0;y{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},T(ry,"Theme"),ry),h5e=T(t=>{const e=new u5e;return e.calculate(t),e},"getThemeVariables"),d5e=(ny=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=st(this.primaryColor,16),this.tertiaryColor=ce(this.primaryColor,{h:-160}),this.primaryBorderColor=je(this.background),this.secondaryBorderColor=_r(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=_r(this.tertiaryColor,this.darkMode),this.primaryTextColor=je(this.primaryColor),this.secondaryTextColor=je(this.secondaryColor),this.tertiaryTextColor=je(this.tertiaryColor),this.mainBkg="#111113",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=st(je("#323D47"),10),this.border1="#ccc",this.border2=dl(255,255,255,.25),this.arrowheadColor=je(this.background),this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.labelBackground="#111113",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.radius=12,this.strokeWidth=2,this.noteBkgColor=this.noteBkgColor??"#FEF9C3",this.noteTextColor=this.noteTextColor??"#28253D",this.THEME_COLOR_LIMIT=12,this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.nodeBorder="#FFFFFF",this.stateBorder="#FFFFFF",this.useGradient=!1,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="url(#drop-shadow)",this.nodeShadow=!0,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.clusterBkg="#1E1A2E",this.clusterBorder="#BDBCCC",this.noteBorderColor="#FACC15",this.noteFontWeight=600,this.filterColor="#FFFFFF"}updateColors(){var r,n,i,a,s,o,l,u,h,d,f;if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#FFFFFF"),this.secondaryColor=this.secondaryColor||ce(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||ce(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||_r(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||_r(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||_r(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||_r(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#FFFFFF",this.secondaryTextColor=this.secondaryTextColor||je(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||je(this.tertiaryColor),this.lineColor=this.lineColor||je(this.background),this.arrowheadColor=this.arrowheadColor||je(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.border1,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?ot(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder="#FFFFFF",this.signalColor="#FFFFFF",this.labelBoxBorderColor="#BDBCCC",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||ot(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||je(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||st(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.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,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.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.compositeBackground="#16141F",this.altBackground="#16141F",this.compositeTitleBackground="#16141F",this.stateEdgeLabelBackground="#16141F",this.fontWeight=600,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.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||ce(this.primaryColor,{h:30}),this.cScale4=this.cScale4||ce(this.primaryColor,{h:60}),this.cScale5=this.cScale5||ce(this.primaryColor,{h:90}),this.cScale6=this.cScale6||ce(this.primaryColor,{h:120}),this.cScale7=this.cScale7||ce(this.primaryColor,{h:150}),this.cScale8=this.cScale8||ce(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||ce(this.primaryColor,{h:270}),this.cScale10=this.cScale10||ce(this.primaryColor,{h:300}),this.cScale11=this.cScale11||ce(this.primaryColor,{h:330}),this.darkMode)for(let p=0;p{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},T(ny,"Theme"),ny),f5e=T(t=>{const e=new d5e;return e.calculate(t),e},"getThemeVariables"),p5e=(iy=class{constructor(){this.background="#ffffff",this.primaryColor="#cccccc",this.mainBkg="#ffffff",this.noteBkgColor="#fff5ad",this.noteTextColor="#28253D",this.THEME_COLOR_LIMIT=12,this.radius=12,this.strokeWidth=2,this.primaryBorderColor=_r(this.primaryColor,this.darkMode),this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.nodeBorder="#28253D",this.stateBorder="#28253D",this.useGradient=!1,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="url(#drop-shadow)",this.nodeShadow=!0,this.tertiaryColor="#ffffff",this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.actorBorder="#28253D",this.noteBorderColor="#FACC15",this.noteFontWeight=600,this.borderColorArray=["#E879F9","#2DD4BF","#FB923C","#22D3EE","#4ADE80","#A78BFA","#F87171","#FACC15","#818CF8","#A3E635 ","#38BDF8","#FB7185"],this.bkgColorArray=["#FDF4FF","#F0FDFA","#FFF7ED","#ECFEFF","#F0FDF4","#F5F3FF","#FEF2F2","#FEFCE8","#EEF2FF","#F7FEE7","#F0F9FF","#FFF1F2"],this.filterColor="#000000"}updateColors(){var a,s,o,l,u,h,d,f,p,g,m;this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#28253D"),this.secondaryColor=this.secondaryColor||ce(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||ce(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||_r(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||_r(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||_r(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||_r(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#28253D",this.secondaryTextColor=this.secondaryTextColor||je(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||je(this.tertiaryColor),this.lineColor=this.lineColor||je(this.background),this.arrowheadColor=this.arrowheadColor||je(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?ot(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||ot(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||je(this.lineColor);const e="#ECECFE",r="#E9E9F1",n=ce(e,{h:180,l:5});this.sectionBkgColor=this.sectionBkgColor||n,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||r,this.sectionBkgColor2=this.sectionBkgColor2||e,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||e,this.activeTaskBorderColor=this.activeTaskBorderColor||e,this.activeTaskBkgColor=this.activeTaskBkgColor||st(e,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.vertLineColor=this.vertLineColor||this.primaryBorderColor,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.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,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||"#f0f0f0",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||"#f4a8ff",this.cScale1=this.cScale1||"#46ecd5",this.cScale2=this.cScale2||"#ffb86a",this.cScale3=this.cScale3||"#dab2ff",this.cScale4=this.cScale4||"#7bf1a8",this.cScale5=this.cScale5||"#c4b4ff",this.cScale6=this.cScale6||"#ffa2a2",this.cScale7=this.cScale7||"#ffdf20",this.cScale8=this.cScale8||"#a3b3ff",this.cScale9=this.cScale9||"#bbf451",this.cScale10=this.cScale10||"#74d4ff",this.cScale11=this.cScale11||"#ffa1ad";for(let y=0;y{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},T(iy,"Theme"),iy),g5e=T(t=>{const e=new p5e;return e.calculate(t),e},"getThemeVariables"),m5e=(ay=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=st(this.primaryColor,16),this.tertiaryColor=ce(this.primaryColor,{h:-160}),this.primaryBorderColor=je(this.background),this.secondaryBorderColor=_r(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=_r(this.tertiaryColor,this.darkMode),this.primaryTextColor=je(this.primaryColor),this.secondaryTextColor=je(this.secondaryColor),this.tertiaryTextColor=je(this.tertiaryColor),this.mainBkg="#111113",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=st(je("#323D47"),10),this.border1="#ccc",this.border2=dl(255,255,255,.25),this.arrowheadColor=je(this.background),this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.labelBackground="#111113",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.radius=12,this.strokeWidth=2,this.noteBkgColor=this.noteBkgColor??"#FEF9C3",this.noteTextColor=this.noteTextColor??"#28253D",this.THEME_COLOR_LIMIT=12,this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.nodeBorder="#FFFFFF",this.stateBorder="#FFFFFF",this.useGradient=!1,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="url(#drop-shadow)",this.nodeShadow=!0,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.clusterBkg="#1E1A2E",this.clusterBorder="#BDBCCC",this.noteBorderColor="#FACC15",this.noteFontWeight=600,this.borderColorArray=["#E879F9","#2DD4BF","#FB923C","#22D3EE","#4ADE80","#A78BFA","#F87171","#FACC15","#818CF8","#A3E635 ","#38BDF8","#FB7185"],this.bkgColorArray=[],this.filterColor="#FFFFFF"}updateColors(){var r,n,i,a,s,o,l,u,h,d,f;this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#FFFFFF"),this.secondaryColor=this.secondaryColor||ce(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||ce(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||_r(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||_r(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||_r(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||_r(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#FFFFFF",this.secondaryTextColor=this.secondaryTextColor||je(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||je(this.tertiaryColor),this.lineColor=this.lineColor||je(this.background),this.arrowheadColor=this.arrowheadColor||je(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.border1,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?ot(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder="#FFFFFF",this.signalColor="#FFFFFF",this.labelBoxBorderColor="#BDBCCC",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||ot(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||je(this.lineColor),this.rootLabelColor="#FFFFFF",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||st(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.vertLineColor=this.vertLineColor||this.primaryBorderColor,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.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,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||"#f0f0f0",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||"#f4a8ff",this.cScale1=this.cScale1||"#46ecd5",this.cScale2=this.cScale2||"#ffb86a",this.cScale3=this.cScale3||"#dab2ff",this.cScale4=this.cScale4||"#7bf1a8",this.cScale5=this.cScale5||"#c4b4ff",this.cScale6=this.cScale6||"#ffa2a2",this.cScale7=this.cScale7||"#ffdf20",this.cScale8=this.cScale8||"#a3b3ff",this.cScale9=this.cScale9||"#bbf451",this.cScale10=this.cScale10||"#74d4ff",this.cScale11=this.cScale11||"#ffa1ad";for(let p=0;p{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},T(ay,"Theme"),ay),y5e=T(t=>{const e=new m5e;return e.calculate(t),e},"getThemeVariables"),Jc={base:{getThemeVariables:QEe},dark:{getThemeVariables:e5e},default:{getThemeVariables:B0},forest:{getThemeVariables:n5e},neutral:{getThemeVariables:a5e},neo:{getThemeVariables:o5e},"neo-dark":{getThemeVariables:c5e},redux:{getThemeVariables:h5e},"redux-dark":{getThemeVariables:f5e},"redux-color":{getThemeVariables:g5e},"redux-dark-color":{getThemeVariables:y5e}},fs={flowchart:{useMaxWidth:!0,titleTopMargin:25,subGraphTitleMargin:{top:0,bottom:0},diagramPadding:8,htmlLabels:null,nodeSpacing:50,rankSpacing:50,curve:"basis",padding:15,defaultRenderer:"dagre-wrapper",wrappingWidth:200,inheritDir:!1},sequence:{useMaxWidth:!0,hideUnusedParticipants:!1,activationWidth:10,diagramMarginX:50,diagramMarginY:10,actorMargin:50,width:150,height:65,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",mirrorActors:!0,forceMenus:!1,bottomMarginAdj:1,rightAngles:!1,showSequenceNumbers:!1,actorFontSize:14,actorFontFamily:'"Open Sans", sans-serif',actorFontWeight:400,noteFontSize:14,noteFontFamily:'"trebuchet ms", verdana, arial, sans-serif',noteFontWeight:400,noteAlign:"center",messageFontSize:16,messageFontFamily:'"trebuchet ms", verdana, arial, sans-serif',messageFontWeight:400,wrap:!1,wrapPadding:10,labelBoxWidth:50,labelBoxHeight:20},gantt:{useMaxWidth:!0,titleTopMargin:25,barHeight:20,barGap:4,topPadding:50,rightPadding:75,leftPadding:75,gridLineStartPadding:35,fontSize:11,sectionFontSize:11,numberSectionStyles:4,axisFormat:"%Y-%m-%d",topAxis:!1,displayMode:"",weekday:"sunday"},journey:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,leftMargin:150,maxLabelWidth:360,width:150,height:50,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",bottomMarginAdj:1,rightAngles:!1,taskFontSize:14,taskFontFamily:'"Open Sans", sans-serif',taskMargin:50,activationWidth:10,textPlacement:"fo",actorColours:["#8FBC8F","#7CFC00","#00FFFF","#20B2AA","#B0E0E6","#FFFFE0"],sectionFills:["#191970","#8B008B","#4B0082","#2F4F4F","#800000","#8B4513","#00008B"],sectionColours:["#fff"],titleColor:"",titleFontFamily:'"trebuchet ms", verdana, arial, sans-serif',titleFontSize:"4ex"},class:{useMaxWidth:!0,titleTopMargin:25,arrowMarkerAbsolute:!1,dividerMargin:10,padding:5,textHeight:10,defaultRenderer:"dagre-wrapper",htmlLabels:!1,hideEmptyMembersBox:!1,hierarchicalNamespaces:!0},state:{useMaxWidth:!0,titleTopMargin:25,dividerMargin:10,sizeUnit:5,padding:8,textHeight:10,titleShift:-15,noteMargin:10,forkWidth:70,forkHeight:7,miniPadding:2,fontSizeFactor:5.02,fontSize:24,labelHeight:16,edgeLengthFactor:"20",compositTitleSize:35,radius:5,defaultRenderer:"dagre-wrapper"},er:{useMaxWidth:!0,titleTopMargin:25,diagramPadding:20,layoutDirection:"TB",minEntityWidth:100,minEntityHeight:75,entityPadding:15,nodeSpacing:140,rankSpacing:80,stroke:"gray",fill:"honeydew",fontSize:12},pie:{useMaxWidth:!0,textPosition:.75},quadrantChart:{useMaxWidth:!0,chartWidth:500,chartHeight:500,titleFontSize:20,titlePadding:10,quadrantPadding:5,xAxisLabelPadding:5,yAxisLabelPadding:5,xAxisLabelFontSize:16,yAxisLabelFontSize:16,quadrantLabelFontSize:16,quadrantTextTopPadding:5,pointTextPadding:5,pointLabelFontSize:12,pointRadius:5,xAxisPosition:"top",yAxisPosition:"left",quadrantInternalBorderStrokeWidth:1,quadrantExternalBorderStrokeWidth:2},xyChart:{useMaxWidth:!0,width:700,height:500,titleFontSize:20,titlePadding:10,showDataLabel:!1,showDataLabelOutsideBar:!1,showTitle:!0,xAxis:{$ref:"#/$defs/XYChartAxisConfig",showLabel:!0,labelFontSize:14,labelPadding:5,showTitle:!0,titleFontSize:16,titlePadding:5,showTick:!0,tickLength:5,tickWidth:2,showAxisLine:!0,axisLineWidth:2},yAxis:{$ref:"#/$defs/XYChartAxisConfig",showLabel:!0,labelFontSize:14,labelPadding:5,showTitle:!0,titleFontSize:16,titlePadding:5,showTick:!0,tickLength:5,tickWidth:2,showAxisLine:!0,axisLineWidth:2},chartOrientation:"vertical",plotReservedSpacePercent:50},requirement:{useMaxWidth:!0,rect_fill:"#f9f9f9",text_color:"#333",rect_border_size:"0.5px",rect_border_color:"#bbb",rect_min_width:200,rect_min_height:200,fontSize:14,rect_padding:10,line_height:20},mindmap:{useMaxWidth:!0,padding:10,maxNodeWidth:200,layoutAlgorithm:"cose-bilkent"},ishikawa:{useMaxWidth:!0,diagramPadding:20},kanban:{useMaxWidth:!0,padding:8,sectionWidth:200,ticketBaseUrl:""},timeline:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,leftMargin:150,width:150,height:50,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",bottomMarginAdj:1,rightAngles:!1,taskFontSize:14,taskFontFamily:'"Open Sans", sans-serif',taskMargin:50,activationWidth:10,textPlacement:"fo",actorColours:["#8FBC8F","#7CFC00","#00FFFF","#20B2AA","#B0E0E6","#FFFFE0"],sectionFills:["#191970","#8B008B","#4B0082","#2F4F4F","#800000","#8B4513","#00008B"],sectionColours:["#fff"],disableMulticolor:!1},gitGraph:{useMaxWidth:!0,titleTopMargin:25,diagramPadding:8,nodeLabel:{width:75,height:100,x:-25,y:0},mainBranchName:"main",mainBranchOrder:0,showCommitLabel:!0,showBranches:!0,rotateCommitLabel:!0,parallelCommits:!1,arrowMarkerAbsolute:!1},c4:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,c4ShapeMargin:50,c4ShapePadding:20,width:216,height:60,boxMargin:10,c4ShapeInRow:4,nextLinePaddingX:0,c4BoundaryInRow:2,personFontSize:14,personFontFamily:'"Open Sans", sans-serif',personFontWeight:"normal",external_personFontSize:14,external_personFontFamily:'"Open Sans", sans-serif',external_personFontWeight:"normal",systemFontSize:14,systemFontFamily:'"Open Sans", sans-serif',systemFontWeight:"normal",external_systemFontSize:14,external_systemFontFamily:'"Open Sans", sans-serif',external_systemFontWeight:"normal",system_dbFontSize:14,system_dbFontFamily:'"Open Sans", sans-serif',system_dbFontWeight:"normal",external_system_dbFontSize:14,external_system_dbFontFamily:'"Open Sans", sans-serif',external_system_dbFontWeight:"normal",system_queueFontSize:14,system_queueFontFamily:'"Open Sans", sans-serif',system_queueFontWeight:"normal",external_system_queueFontSize:14,external_system_queueFontFamily:'"Open Sans", sans-serif',external_system_queueFontWeight:"normal",boundaryFontSize:14,boundaryFontFamily:'"Open Sans", sans-serif',boundaryFontWeight:"normal",messageFontSize:12,messageFontFamily:'"Open Sans", sans-serif',messageFontWeight:"normal",containerFontSize:14,containerFontFamily:'"Open Sans", sans-serif',containerFontWeight:"normal",external_containerFontSize:14,external_containerFontFamily:'"Open Sans", sans-serif',external_containerFontWeight:"normal",container_dbFontSize:14,container_dbFontFamily:'"Open Sans", sans-serif',container_dbFontWeight:"normal",external_container_dbFontSize:14,external_container_dbFontFamily:'"Open Sans", sans-serif',external_container_dbFontWeight:"normal",container_queueFontSize:14,container_queueFontFamily:'"Open Sans", sans-serif',container_queueFontWeight:"normal",external_container_queueFontSize:14,external_container_queueFontFamily:'"Open Sans", sans-serif',external_container_queueFontWeight:"normal",componentFontSize:14,componentFontFamily:'"Open Sans", sans-serif',componentFontWeight:"normal",external_componentFontSize:14,external_componentFontFamily:'"Open Sans", sans-serif',external_componentFontWeight:"normal",component_dbFontSize:14,component_dbFontFamily:'"Open Sans", sans-serif',component_dbFontWeight:"normal",external_component_dbFontSize:14,external_component_dbFontFamily:'"Open Sans", sans-serif',external_component_dbFontWeight:"normal",component_queueFontSize:14,component_queueFontFamily:'"Open Sans", sans-serif',component_queueFontWeight:"normal",external_component_queueFontSize:14,external_component_queueFontFamily:'"Open Sans", sans-serif',external_component_queueFontWeight:"normal",wrap:!0,wrapPadding:10,person_bg_color:"#08427B",person_border_color:"#073B6F",external_person_bg_color:"#686868",external_person_border_color:"#8A8A8A",system_bg_color:"#1168BD",system_border_color:"#3C7FC0",system_db_bg_color:"#1168BD",system_db_border_color:"#3C7FC0",system_queue_bg_color:"#1168BD",system_queue_border_color:"#3C7FC0",external_system_bg_color:"#999999",external_system_border_color:"#8A8A8A",external_system_db_bg_color:"#999999",external_system_db_border_color:"#8A8A8A",external_system_queue_bg_color:"#999999",external_system_queue_border_color:"#8A8A8A",container_bg_color:"#438DD5",container_border_color:"#3C7FC0",container_db_bg_color:"#438DD5",container_db_border_color:"#3C7FC0",container_queue_bg_color:"#438DD5",container_queue_border_color:"#3C7FC0",external_container_bg_color:"#B3B3B3",external_container_border_color:"#A6A6A6",external_container_db_bg_color:"#B3B3B3",external_container_db_border_color:"#A6A6A6",external_container_queue_bg_color:"#B3B3B3",external_container_queue_border_color:"#A6A6A6",component_bg_color:"#85BBF0",component_border_color:"#78A8D8",component_db_bg_color:"#85BBF0",component_db_border_color:"#78A8D8",component_queue_bg_color:"#85BBF0",component_queue_border_color:"#78A8D8",external_component_bg_color:"#CCCCCC",external_component_border_color:"#BFBFBF",external_component_db_bg_color:"#CCCCCC",external_component_db_border_color:"#BFBFBF",external_component_queue_bg_color:"#CCCCCC",external_component_queue_border_color:"#BFBFBF"},sankey:{useMaxWidth:!0,width:600,height:400,linkColor:"gradient",nodeAlignment:"justify",showValues:!0,prefix:"",suffix:"",nodeWidth:10,nodePadding:12,labelStyle:"legacy"},block:{useMaxWidth:!0,padding:8},packet:{useMaxWidth:!0,rowHeight:32,bitWidth:32,bitsPerRow:32,showBits:!0,paddingX:5,paddingY:5},treeView:{useMaxWidth:!0,rowIndent:10,paddingX:5,paddingY:5,lineThickness:1},architecture:{useMaxWidth:!0,padding:40,iconSize:80,fontSize:16,randomize:!1,nodeSeparation:75,idealEdgeLengthMultiplier:1.5,edgeElasticity:.45,numIter:2500},eventmodeling:{useMaxWidth:!0,padding:30,rowHeight:32},radar:{useMaxWidth:!0,width:600,height:600,marginTop:50,marginRight:50,marginBottom:50,marginLeft:50,axisScaleFactor:1,axisLabelFactor:1.05,curveTension:.17},venn:{useMaxWidth:!0,width:800,height:450,padding:8,useDebugLayout:!1},theme:"default",look:"classic",handDrawnSeed:0,layout:"dagre",maxTextSize:5e4,maxEdges:500,darkMode:!1,fontFamily:'"trebuchet ms", verdana, arial, sans-serif;',logLevel:5,securityLevel:"strict",startOnLoad:!0,arrowMarkerAbsolute:!1,secure:["secure","securityLevel","startOnLoad","maxTextSize","suppressErrorRendering","maxEdges"],legacyMathML:!1,forceLegacyMathML:!1,deterministicIds:!1,fontSize:16,markdownAutoWrap:!0,suppressErrorRendering:!1},Kq={...fs,deterministicIDSeed:void 0,elk:{mergeEdges:!1,nodePlacementStrategy:"BRANDES_KOEPF",forceNodeModelOrder:!1,considerModelOrder:"NODES_AND_EDGES"},themeCSS:void 0,themeVariables:Jc.default.getThemeVariables(),sequence:{...fs.sequence,messageFont:T(function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},"messageFont"),noteFont:T(function(){return{fontFamily:this.noteFontFamily,fontSize:this.noteFontSize,fontWeight:this.noteFontWeight}},"noteFont"),actorFont:T(function(){return{fontFamily:this.actorFontFamily,fontSize:this.actorFontSize,fontWeight:this.actorFontWeight}},"actorFont")},class:{hideEmptyMembersBox:!1,hierarchicalNamespaces:!0},gantt:{...fs.gantt,tickInterval:void 0,useWidth:void 0},c4:{...fs.c4,useWidth:void 0,personFont:T(function(){return{fontFamily:this.personFontFamily,fontSize:this.personFontSize,fontWeight:this.personFontWeight}},"personFont"),flowchart:{...fs.flowchart,inheritDir:!1},external_personFont:T(function(){return{fontFamily:this.external_personFontFamily,fontSize:this.external_personFontSize,fontWeight:this.external_personFontWeight}},"external_personFont"),systemFont:T(function(){return{fontFamily:this.systemFontFamily,fontSize:this.systemFontSize,fontWeight:this.systemFontWeight}},"systemFont"),external_systemFont:T(function(){return{fontFamily:this.external_systemFontFamily,fontSize:this.external_systemFontSize,fontWeight:this.external_systemFontWeight}},"external_systemFont"),system_dbFont:T(function(){return{fontFamily:this.system_dbFontFamily,fontSize:this.system_dbFontSize,fontWeight:this.system_dbFontWeight}},"system_dbFont"),external_system_dbFont:T(function(){return{fontFamily:this.external_system_dbFontFamily,fontSize:this.external_system_dbFontSize,fontWeight:this.external_system_dbFontWeight}},"external_system_dbFont"),system_queueFont:T(function(){return{fontFamily:this.system_queueFontFamily,fontSize:this.system_queueFontSize,fontWeight:this.system_queueFontWeight}},"system_queueFont"),external_system_queueFont:T(function(){return{fontFamily:this.external_system_queueFontFamily,fontSize:this.external_system_queueFontSize,fontWeight:this.external_system_queueFontWeight}},"external_system_queueFont"),containerFont:T(function(){return{fontFamily:this.containerFontFamily,fontSize:this.containerFontSize,fontWeight:this.containerFontWeight}},"containerFont"),external_containerFont:T(function(){return{fontFamily:this.external_containerFontFamily,fontSize:this.external_containerFontSize,fontWeight:this.external_containerFontWeight}},"external_containerFont"),container_dbFont:T(function(){return{fontFamily:this.container_dbFontFamily,fontSize:this.container_dbFontSize,fontWeight:this.container_dbFontWeight}},"container_dbFont"),external_container_dbFont:T(function(){return{fontFamily:this.external_container_dbFontFamily,fontSize:this.external_container_dbFontSize,fontWeight:this.external_container_dbFontWeight}},"external_container_dbFont"),container_queueFont:T(function(){return{fontFamily:this.container_queueFontFamily,fontSize:this.container_queueFontSize,fontWeight:this.container_queueFontWeight}},"container_queueFont"),external_container_queueFont:T(function(){return{fontFamily:this.external_container_queueFontFamily,fontSize:this.external_container_queueFontSize,fontWeight:this.external_container_queueFontWeight}},"external_container_queueFont"),componentFont:T(function(){return{fontFamily:this.componentFontFamily,fontSize:this.componentFontSize,fontWeight:this.componentFontWeight}},"componentFont"),external_componentFont:T(function(){return{fontFamily:this.external_componentFontFamily,fontSize:this.external_componentFontSize,fontWeight:this.external_componentFontWeight}},"external_componentFont"),component_dbFont:T(function(){return{fontFamily:this.component_dbFontFamily,fontSize:this.component_dbFontSize,fontWeight:this.component_dbFontWeight}},"component_dbFont"),external_component_dbFont:T(function(){return{fontFamily:this.external_component_dbFontFamily,fontSize:this.external_component_dbFontSize,fontWeight:this.external_component_dbFontWeight}},"external_component_dbFont"),component_queueFont:T(function(){return{fontFamily:this.component_queueFontFamily,fontSize:this.component_queueFontSize,fontWeight:this.component_queueFontWeight}},"component_queueFont"),external_component_queueFont:T(function(){return{fontFamily:this.external_component_queueFontFamily,fontSize:this.external_component_queueFontSize,fontWeight:this.external_component_queueFontWeight}},"external_component_queueFont"),boundaryFont:T(function(){return{fontFamily:this.boundaryFontFamily,fontSize:this.boundaryFontSize,fontWeight:this.boundaryFontWeight}},"boundaryFont"),messageFont:T(function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},"messageFont")},pie:{...fs.pie,useWidth:984},xyChart:{...fs.xyChart,useWidth:void 0},requirement:{...fs.requirement,useWidth:void 0},packet:{...fs.packet},eventmodeling:{...fs.eventmodeling},treeView:{...fs.treeView,useWidth:void 0},radar:{...fs.radar},ishikawa:{...fs.ishikawa},sankey:{...fs.sankey,nodeColors:void 0},treemap:{useMaxWidth:!0,padding:10,diagramPadding:8,showValues:!0,nodeWidth:100,nodeHeight:40,borderWidth:1,valueFontSize:12,labelFontSize:14,valueFormat:","},venn:{...fs.venn}},Zq=T((t,e="")=>Object.keys(t).reduce((r,n)=>Array.isArray(t[n])?r:typeof t[n]=="object"&&t[n]!==null?[...r,e+n,...Zq(t[n],"")]:[...r,e+n],[]),"keyify"),v5e=new Set(Zq(Kq,"")),Xr=Kq,L4=T(t=>{if(se.debug("sanitizeDirective called with",t),!(typeof t!="object"||t==null)){if(Array.isArray(t)){t.forEach(e=>L4(e));return}for(const e of Object.keys(t)){if(se.debug("Checking key",e),e.startsWith("__")||e.includes("proto")||e.includes("constr")||!v5e.has(e)||t[e]==null){se.debug("sanitize deleting key: ",e),delete t[e];continue}if(typeof t[e]=="object"){if(e==="nodeColors"){const n=/^#[\da-f]{3,8}$|^rgb\([\d\s%,.]+\)$|^hsl\([\d\s%,.]+\)$|^[a-z]+$/i;for(const i of Object.keys(t[e]))(typeof t[e][i]!="string"||!n.test(t[e][i]))&&(se.debug("sanitize deleting invalid color:",i,t[e][i]),delete t[e][i])}else se.debug("sanitizing object",e),L4(t[e]);continue}const r=["themeCSS","fontFamily","altFontFamily"];for(const n of r)e.includes(n)&&(se.debug("sanitizing css option",e),t[e]=Qq(t[e]))}if(t.themeVariables)for(const e of Object.keys(t.themeVariables)){const r=t.themeVariables[e];r!=null&&r.match&&!r.match(/^[\d "#%(),.;A-Za-z]+$/)&&(t.themeVariables[e]="")}se.debug("After sanitization",t)}},"sanitizeDirective"),Qq=T(t=>{let e=0,r=0;for(const n of t){if(e!(t===!1||["false","null","0"].includes(String(t).trim().toLowerCase())),"evaluate"),Hs=Li({},F0),I4,Hd=[],Vb=Li({},F0),D4=T((t,e)=>{let r=Li({},t),n={};for(const i of e)tV(i),n=Li(n,i);if(r=Li(r,n),n.theme&&n.theme in Jc){const i=Li({},I4),a=Li(i.themeVariables||{},n.themeVariables);r.theme&&r.theme in Jc&&(r.themeVariables=Jc[r.theme].getThemeVariables(a))}return Vb=r,iV(Vb),Vb},"updateCurrentConfig"),b5e=T(t=>(Hs=Li({},F0),Hs=Li(Hs,t),t.theme&&Jc[t.theme]&&(Hs.themeVariables=Jc[t.theme].getThemeVariables(t.themeVariables)),D4(Hs,Hd),Hs),"setSiteConfig"),x5e=T(t=>{I4=Li({},t)},"saveConfigFromInitialize"),T5e=T(t=>(Hs=Li(Hs,t),D4(Hs,Hd),Hs),"updateSiteConfig"),Jq=T(()=>Li({},Hs),"getSiteConfig"),eV=T(t=>(iV(t),Li(Vb,t),pr()),"setConfig"),pr=T(()=>Li({},Vb),"getConfig"),tV=T(t=>{t&&(["secure",...Hs.secure??[]].forEach(e=>{Object.hasOwn(t,e)&&(se.debug(`Denied attempt to modify a secure key ${e}`,t[e]),delete t[e])}),Object.keys(t).forEach(e=>{e.startsWith("__")&&delete t[e]}),Object.keys(t).forEach(e=>{typeof t[e]=="string"&&(t[e].includes("<")||t[e].includes(">")||t[e].includes("url(data:"))&&delete t[e],typeof t[e]=="object"&&tV(t[e])}))},"sanitize"),w5e=T(t=>{var e;L4(t),t.fontFamily&&!((e=t.themeVariables)!=null&&e.fontFamily)&&(t.themeVariables={...t.themeVariables,fontFamily:t.fontFamily}),Hd.push(t),D4(Hs,Hd)},"addDirective"),M4=T((t=Hs)=>{Hd=[],D4(t,Hd)},"reset"),C5e={LAZY_LOAD_DEPRECATED:"The configuration options lazyLoadedDiagrams and loadExternalDiagramsAtStartup are deprecated. Please use registerExternalDiagrams instead.",FLOWCHART_HTML_LABELS_DEPRECATED:"flowchart.htmlLabels is deprecated. Please use global htmlLabels instead."},rV={},nV=T(t=>{rV[t]||(se.warn(C5e[t]),rV[t]=!0)},"issueWarning"),iV=T(t=>{t&&(t.lazyLoadedDiagrams||t.loadExternalDiagramsAtStartup)&&nV("LAZY_LOAD_DEPRECATED")},"checkConfig"),k5e=T(()=>{let t={};I4&&(t=Li(t,I4));for(const e of Hd)t=Li(t,e);return t},"getUserDefinedConfig"),mn=T(t=>{var e,r;return((e=t.flowchart)==null?void 0:e.htmlLabels)!=null&&nV("FLOWCHART_HTML_LABELS_DEPRECATED"),eu(t.htmlLabels??((r=t.flowchart)==null?void 0:r.htmlLabels)??!0)},"getEffectiveHtmlLabels"),z0=//gi,E5e=T(t=>t?lV(t).replace(/\\n/g,"#br#").split("#br#"):[""],"getRows"),S5e=(()=>{let t=!1;return()=>{t||(aV(),t=!0)}})();function aV(){const t="data-temp-href-target";Ch.addHook("beforeSanitizeAttributes",e=>{e.tagName==="A"&&e.hasAttribute("target")&&e.setAttribute(t,e.getAttribute("target")??"")}),Ch.addHook("afterSanitizeAttributes",e=>{e.tagName==="A"&&e.hasAttribute(t)&&(e.setAttribute("target",e.getAttribute(t)??""),e.removeAttribute(t),e.getAttribute("target")==="_blank"&&e.setAttribute("rel","noopener"))})}T(aV,"setupDompurifyHooks");var sV=T(t=>(S5e(),Ch.sanitize(t)),"removeScript"),oV=T((t,e)=>{if(mn(e)){const r=e.securityLevel;r==="antiscript"||r==="strict"||r==="sandbox"?t=sV(t):r!=="loose"&&(t=lV(t),t=t.replace(//g,">"),t=t.replace(/=/g,"="),t=L5e(t))}return t},"sanitizeMore"),Zr=T((t,e)=>t&&(e.dompurifyConfig?t=Ch.sanitize(oV(t,e),e.dompurifyConfig).toString():t=Ch.sanitize(oV(t,e),{FORBID_TAGS:["style"]}).toString(),t),"sanitizeText"),_5e=T((t,e)=>typeof t=="string"?Zr(t,e):t.flat().map(r=>Zr(r,e)),"sanitizeTextOrArray"),A5e=T(t=>z0.test(t),"hasBreaks"),R5e=T(t=>t.split(z0),"splitBreaks"),L5e=T(t=>t.replace(/#br#/g,"
"),"placeholderToBreak"),lV=T(t=>t.replace(z0,"#br#"),"breakToPlaceholder"),N4=T(t=>{let e="";return t&&(e=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,e=CSS.escape(e)),e},"getUrl"),I5e=T(function(...t){const e=t.filter(r=>!isNaN(r));return Math.max(...e)},"getMax"),D5e=T(function(...t){const e=t.filter(r=>!isNaN(r));return Math.min(...e)},"getMin"),kh=T(function(t){const e=t.split(/(,)/),r=[];for(let n=0;n0&&n+1Math.max(0,t.split(e).length-1),"countOccurrence"),M5e=T((t,e)=>{const r=S7(t,"~"),n=S7(e,"~");return r===1&&n===1},"shouldCombineSets"),N5e=T(t=>{const e=S7(t,"~");let r=!1;if(e<=1)return t;e%2!==0&&t.startsWith("~")&&(t=t.substring(1),r=!0);const n=[...t];let i=n.indexOf("~"),a=n.lastIndexOf("~");for(;i!==-1&&a!==-1&&i!==a;)n[i]="<",n[a]=">",i=n.indexOf("~"),a=n.lastIndexOf("~");return r&&n.unshift("~"),n.join("")},"processSet"),cV=T(()=>window.MathMLElement!==void 0,"isMathMLSupported"),_7=/\$\$(.*)\$\$/g,Ii=T(t=>{var e;return(((e=t.match(_7))==null?void 0:e.length)??0)>0},"hasKatex"),Wb=T(async(t,e)=>{const r=document.createElement("div");r.innerHTML=await $4(t,e),r.id="katex-temp",r.style.visibility="hidden",r.style.position="absolute",r.style.top="0";const n=document.querySelector("body");n==null||n.insertAdjacentElement("beforeend",r);const i={width:r.clientWidth,height:r.clientHeight};return r.remove(),i},"calculateMathMLDimensions"),$5e=T(async(t,e)=>{if(!Ii(t))return t;if(!(cV()||e.legacyMathML||e.forceLegacyMathML))return t.replace(_7,"MathML is unsupported in this environment.");{const{default:r}=await Promise.resolve().then(()=>dFe),n=e.forceLegacyMathML||!cV()&&e.legacyMathML?"htmlAndMathml":"mathml";return t.split(z0).map(i=>Ii(i)?`
${i}
`:`
${i}
`).join("").replace(_7,(i,a)=>r.renderToString(a,{throwOnError:!0,displayMode:!0,output:n}).replace(/\n/g," ").replace(//g,""))}},"renderKatexUnsanitized"),$4=T(async(t,e)=>Zr(await $5e(t,e),e),"renderKatexSanitized"),Dt={getRows:E5e,sanitizeText:Zr,sanitizeTextOrArray:_5e,hasBreaks:A5e,splitBreaks:R5e,lineBreakRegex:z0,removeScript:sV,getUrl:N4,evaluate:eu,getMax:I5e,getMin:D5e},O5e=T(function(t,e){for(let r of e)t.attr(r[0],r[1])},"d3Attrs"),P5e=T(function(t,e,r){let n=new Map;return r?(n.set("width","100%"),n.set("style",`max-width: ${e}px;`)):(n.set("height",t),n.set("width",e)),n},"calculateSvgSizeAttrs"),Wi=T(function(t,e,r,n){const i=P5e(e,r,n);O5e(t,i)},"configureSvgSize"),G0=T(function(t,e,r,n){const i=e.node().getBBox(),a=i.width,s=i.height;se.info(`SVG bounds: ${a}x${s}`,i);let o=0,l=0;se.info(`Graph bounds: ${o}x${l}`,t),o=a+r*2,l=s+r*2,se.info(`Calculated bounds: ${o}x${l}`),Wi(e,l,o,n);const u=`${i.x-r} ${i.y-r} ${i.width+2*r} ${i.height+2*r}`;e.attr("viewBox",u)},"setupGraphViewbox"),O4={};function A7(t){return[...t.cssRules].map(e=>e.cssText).join(` +`)}T(A7,"cssStyleSheetToString");var B5e=T((t,e,r,n)=>{let i="";return t in O4&&O4[t]?i=O4[t]({...r,svgId:n}):se.warn(`No theme found for ${t}`),` & { font-family: ${r.fontFamily}; font-size: ${r.fontSize}; fill: ${r.textColor} @@ -120,49 +120,49 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho } ${e} -`},"getStyles"),wxe=x((t,e)=>{e!==void 0&&(Rw[t]=e)},"addStylesForDiagram"),Cxe=Txe,L6={};bw(L6,{clear:()=>In,getAccDescription:()=>Gn,getAccTitle:()=>Fn,getDiagramTitle:()=>Mn,setAccDescription:()=>zn,setAccTitle:()=>Dn,setDiagramTitle:()=>qn});var I6="",D6="",M6="",N6=x(t=>qr(t,lr()),"sanitizeText"),In=x(()=>{I6="",M6="",D6=""},"clear"),Dn=x(t=>{I6=N6(t).replace(/^\s+/g,"")},"setAccTitle"),Fn=x(()=>I6,"getAccTitle"),zn=x(t=>{M6=N6(t).replace(/\n\s+/g,` -`)},"setAccDescription"),Gn=x(()=>M6,"getAccDescription"),qn=x(t=>{D6=N6(t)},"setDiagramTitle"),Mn=x(()=>D6,"getDiagramTitle"),OB=ae,kxe=p6,Pe=lr,O6=EB,$B=C0,$6=x(t=>qr(t,Pe()),"sanitizeText"),P6=E0,Exe=x(()=>L6,"getCommonDb"),Lw={},Iw=x((t,e,r)=>{var n;Lw[t]&&OB.warn(`Diagram with id ${t} already registered. Overwriting.`),Lw[t]=e,r&&xB(t,r),wxe(t,e.styles),(n=e.injectUtils)==null||n.call(e,OB,kxe,Pe,$6,P6,Exe(),()=>{})},"registerDiagram"),B6=x(t=>{if(t in Lw)return Lw[t];throw new Sxe(t)},"getDiagram"),Sxe=(Am=class extends Error{constructor(e){super(`Diagram ${e} not found.`)}},x(Am,"DiagramNotFoundError"),Am);function Dw(t,e){return t==null||e==null?NaN:te?1:t>=e?0:NaN}function Axe(t,e){return t==null||e==null?NaN:et?1:e>=t?0:NaN}function F6(t){let e,r,n;t.length!==2?(e=Dw,r=(o,l)=>Dw(t(o),l),n=(o,l)=>t(o)-l):(e=t===Dw||t===Axe?t:_xe,r=t,n=t);function i(o,l,u=0,h=o.length){if(u>>1;r(o[d],l)<0?u=d+1:h=d}while(u>>1;r(o[d],l)<=0?u=d+1:h=d}while(uu&&n(o[d-1],l)>-n(o[d],l)?d-1:d}return{left:i,center:s,right:a}}function _xe(){return 0}function Rxe(t){return t===null?NaN:+t}const Lxe=F6(Dw).right;F6(Rxe).center;class PB extends Map{constructor(e,r=Mxe){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),e!=null)for(const[n,i]of e)this.set(n,i)}get(e){return super.get(BB(this,e))}has(e){return super.has(BB(this,e))}set(e,r){return super.set(Ixe(this,e),r)}delete(e){return super.delete(Dxe(this,e))}}function BB({_intern:t,_key:e},r){const n=e(r);return t.has(n)?t.get(n):r}function Ixe({_intern:t,_key:e},r){const n=e(r);return t.has(n)?t.get(n):(t.set(n,r),r)}function Dxe({_intern:t,_key:e},r){const n=e(r);return t.has(n)&&(r=t.get(n),t.delete(n)),r}function Mxe(t){return t!==null&&typeof t=="object"?t.valueOf():t}const Nxe=Math.sqrt(50),Oxe=Math.sqrt(10),$xe=Math.sqrt(2);function Mw(t,e,r){const n=(e-t)/Math.max(0,r),i=Math.floor(Math.log10(n)),a=n/Math.pow(10,i),s=a>=Nxe?10:a>=Oxe?5:a>=$xe?2:1;let o,l,u;return i<0?(u=Math.pow(10,-i)/s,o=Math.round(t*u),l=Math.round(e*u),o/ue&&--l,u=-u):(u=Math.pow(10,i)*s,o=Math.round(t/u),l=Math.round(e/u),o*ue&&--l),l0))return[];if(t===e)return[t];const n=e=i))return[];const o=a-i+1,l=new Array(o);if(n)if(s<0)for(let u=0;u=n)&&(r=n);else{let n=-1;for(let i of t)(i=e(i,++n,t))!=null&&(r=i)&&(r=i)}return r}function Fxe(t,e){let r;if(e===void 0)for(const n of t)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);else{let n=-1;for(let i of t)(i=e(i,++n,t))!=null&&(r>i||r===void 0&&i>=i)&&(r=i)}return r}function zxe(t,e,r){t=+t,e=+e,r=(i=arguments.length)<2?(e=t,t=0,1):i<3?1:+r;for(var n=-1,i=Math.max(0,Math.ceil((e-t)/r))|0,a=new Array(i);++n+t(e)}function Uxe(t,e){return e=Math.max(0,t.bandwidth()-e*2)/2,t.round()&&(e=Math.round(e)),r=>+t(r)+e}function Hxe(){return!this.__axis}function zB(t,e){var r=[],n=null,i=null,a=6,s=6,o=3,l=typeof window<"u"&&window.devicePixelRatio>1?0:.5,u=t===Nw||t===Ow?-1:1,h=t===Ow||t===q6?"x":"y",d=t===Nw||t===V6?qxe:Vxe;function f(p){var g=n??(e.ticks?e.ticks.apply(e,r):e.domain()),m=i??(e.tickFormat?e.tickFormat.apply(e,r):Gxe),y=Math.max(a,0)+o,v=e.range(),T=+v[0]+l,b=+v[v.length-1]+l,w=(e.bandwidth?Uxe:Wxe)(e.copy(),l),k=p.selection?p.selection():p,A=k.selectAll(".domain").data([null]),C=k.selectAll(".tick").data(g,e).order(),_=C.exit(),L=C.enter().append("g").attr("class","tick"),O=C.select("line"),M=C.select("text");A=A.merge(A.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),C=C.merge(L),O=O.merge(L.append("line").attr("stroke","currentColor").attr(h+"2",u*a)),M=M.merge(L.append("text").attr("fill","currentColor").attr(h,u*y).attr("dy",t===Nw?"0em":t===V6?"0.71em":"0.32em")),p!==k&&(A=A.transition(p),C=C.transition(p),O=O.transition(p),M=M.transition(p),_=_.transition(p).attr("opacity",FB).attr("transform",function(z){return isFinite(z=w(z))?d(z+l):this.getAttribute("transform")}),L.attr("opacity",FB).attr("transform",function(z){var F=this.parentNode.__axis;return d((F&&isFinite(F=F(z))?F:w(z))+l)})),_.remove(),A.attr("d",t===Ow||t===q6?s?"M"+u*s+","+T+"H"+l+"V"+b+"H"+u*s:"M"+l+","+T+"V"+b:s?"M"+T+","+u*s+"V"+l+"H"+b+"V"+u*s:"M"+T+","+l+"H"+b),C.attr("opacity",1).attr("transform",function(z){return d(w(z)+l)}),O.attr(h+"2",u*a),M.attr(h,u*y).text(m),k.filter(Hxe).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",t===q6?"start":t===Ow?"end":"middle"),k.each(function(){this.__axis=w})}return f.scale=function(p){return arguments.length?(e=p,f):e},f.ticks=function(){return r=Array.from(arguments),f},f.tickArguments=function(p){return arguments.length?(r=p==null?[]:Array.from(p),f):r.slice()},f.tickValues=function(p){return arguments.length?(n=p==null?null:Array.from(p),f):n&&n.slice()},f.tickFormat=function(p){return arguments.length?(i=p,f):i},f.tickSize=function(p){return arguments.length?(a=s=+p,f):a},f.tickSizeInner=function(p){return arguments.length?(a=+p,f):a},f.tickSizeOuter=function(p){return arguments.length?(s=+p,f):s},f.tickPadding=function(p){return arguments.length?(o=+p,f):o},f.offset=function(p){return arguments.length?(l=+p,f):l},f}function Yxe(t){return zB(Nw,t)}function Xxe(t){return zB(V6,t)}var Kxe={value:()=>{}};function GB(){for(var t=0,e=arguments.length,r={},n;t=0&&(n=r.slice(i+1),r=r.slice(0,i)),r&&!e.hasOwnProperty(r))throw new Error("unknown type: "+r);return{type:r,name:n}})}$w.prototype=GB.prototype={constructor:$w,on:function(t,e){var r=this._,n=jxe(t+"",r),i,a=-1,s=n.length;if(arguments.length<2){for(;++a0)for(var r=new Array(i),n=0,i,a;n=0&&(e=t.slice(0,r))!=="xmlns"&&(t=t.slice(r+1)),VB.hasOwnProperty(e)?{space:VB[e],local:t}:t}function Qxe(t){return function(){var e=this.ownerDocument,r=this.namespaceURI;return r===W6&&e.documentElement.namespaceURI===W6?e.createElement(t):e.createElementNS(r,t)}}function Jxe(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function WB(t){var e=Pw(t);return(e.local?Jxe:Qxe)(e)}function eTe(){}function U6(t){return t==null?eTe:function(){return this.querySelector(t)}}function tTe(t){typeof t!="function"&&(t=U6(t));for(var e=this._groups,r=e.length,n=new Array(r),i=0;i=b&&(b=T+1);!(k=y[b])&&++b=0;)(s=n[i])&&(a&&s.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(s,a),a=s);return this}function STe(t){t||(t=ATe);function e(d,f){return d&&f?t(d.__data__,f.__data__):!d-!f}for(var r=this._groups,n=r.length,i=new Array(n),a=0;ae?1:t>=e?0:NaN}function _Te(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function RTe(){return Array.from(this)}function LTe(){for(var t=this._groups,e=0,r=t.length;e1?this.each((e==null?GTe:typeof e=="function"?VTe:qTe)(t,e,r??"")):S0(this.node(),t)}function S0(t,e){return t.style.getPropertyValue(e)||KB(t).getComputedStyle(t,null).getPropertyValue(e)}function UTe(t){return function(){delete this[t]}}function HTe(t,e){return function(){this[t]=e}}function YTe(t,e){return function(){var r=e.apply(this,arguments);r==null?delete this[t]:this[t]=r}}function XTe(t,e){return arguments.length>1?this.each((e==null?UTe:typeof e=="function"?YTe:HTe)(t,e)):this.node()[t]}function jB(t){return t.trim().split(/^|\s+/)}function H6(t){return t.classList||new ZB(t)}function ZB(t){this._node=t,this._names=jB(t.getAttribute("class")||"")}ZB.prototype={add:function(t){var e=this._names.indexOf(t);e<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function QB(t,e){for(var r=H6(t),n=-1,i=e.length;++n=0&&(r=e.slice(n+1),e=e.slice(0,n)),{type:e,name:r}})}function wwe(t){return function(){var e=this.__on;if(e){for(var r=0,n=-1,i=e.length,a;r>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):r===8?Gw(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):r===4?Gw(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=Iwe.exec(t))?new Ea(e[1],e[2],e[3],1):(e=Dwe.exec(t))?new Ea(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=Mwe.exec(t))?Gw(e[1],e[2],e[3],e[4]):(e=Nwe.exec(t))?Gw(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=Owe.exec(t))?cF(e[1],e[2]/100,e[3]/100,1):(e=$we.exec(t))?cF(e[1],e[2]/100,e[3]/100,e[4]):rF.hasOwnProperty(t)?aF(rF[t]):t==="transparent"?new Ea(NaN,NaN,NaN,0):null}function aF(t){return new Ea(t>>16&255,t>>8&255,t&255,1)}function Gw(t,e,r,n){return n<=0&&(t=e=r=NaN),new Ea(t,e,r,n)}function sF(t){return t instanceof Uh||(t=Hh(t)),t?(t=t.rgb(),new Ea(t.r,t.g,t.b,t.opacity)):new Ea}function Y6(t,e,r,n){return arguments.length===1?sF(t):new Ea(t,e,r,n??1)}function Ea(t,e,r,n){this.r=+t,this.g=+e,this.b=+r,this.opacity=+n}f2(Ea,Y6,Fw(Uh,{brighter(t){return t=t==null?zw:Math.pow(zw,t),new Ea(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?p2:Math.pow(p2,t),new Ea(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Ea(Yh(this.r),Yh(this.g),Yh(this.b),qw(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:oF,formatHex:oF,formatHex8:Fwe,formatRgb:lF,toString:lF}));function oF(){return`#${Xh(this.r)}${Xh(this.g)}${Xh(this.b)}`}function Fwe(){return`#${Xh(this.r)}${Xh(this.g)}${Xh(this.b)}${Xh((isNaN(this.opacity)?1:this.opacity)*255)}`}function lF(){const t=qw(this.opacity);return`${t===1?"rgb(":"rgba("}${Yh(this.r)}, ${Yh(this.g)}, ${Yh(this.b)}${t===1?")":`, ${t})`}`}function qw(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Yh(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Xh(t){return t=Yh(t),(t<16?"0":"")+t.toString(16)}function cF(t,e,r,n){return n<=0?t=e=r=NaN:r<=0||r>=1?t=e=NaN:e<=0&&(t=NaN),new _o(t,e,r,n)}function uF(t){if(t instanceof _o)return new _o(t.h,t.s,t.l,t.opacity);if(t instanceof Uh||(t=Hh(t)),!t)return new _o;if(t instanceof _o)return t;t=t.rgb();var e=t.r/255,r=t.g/255,n=t.b/255,i=Math.min(e,r,n),a=Math.max(e,r,n),s=NaN,o=a-i,l=(a+i)/2;return o?(e===a?s=(r-n)/o+(r0&&l<1?0:s,new _o(s,o,l,t.opacity)}function zwe(t,e,r,n){return arguments.length===1?uF(t):new _o(t,e,r,n??1)}function _o(t,e,r,n){this.h=+t,this.s=+e,this.l=+r,this.opacity=+n}f2(_o,zwe,Fw(Uh,{brighter(t){return t=t==null?zw:Math.pow(zw,t),new _o(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?p2:Math.pow(p2,t),new _o(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*e,i=2*r-n;return new Ea(X6(t>=240?t-240:t+120,i,n),X6(t,i,n),X6(t<120?t+240:t-120,i,n),this.opacity)},clamp(){return new _o(hF(this.h),Vw(this.s),Vw(this.l),qw(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=qw(this.opacity);return`${t===1?"hsl(":"hsla("}${hF(this.h)}, ${Vw(this.s)*100}%, ${Vw(this.l)*100}%${t===1?")":`, ${t})`}`}}));function hF(t){return t=(t||0)%360,t<0?t+360:t}function Vw(t){return Math.max(0,Math.min(1,t||0))}function X6(t,e,r){return(t<60?e+(r-e)*t/60:t<180?r:t<240?e+(r-e)*(240-t)/60:e)*255}const Gwe=Math.PI/180,qwe=180/Math.PI,Ww=18,dF=.96422,fF=1,pF=.82521,gF=4/29,_0=6/29,mF=3*_0*_0,Vwe=_0*_0*_0;function yF(t){if(t instanceof fl)return new fl(t.l,t.a,t.b,t.opacity);if(t instanceof dc)return vF(t);t instanceof Ea||(t=sF(t));var e=Q6(t.r),r=Q6(t.g),n=Q6(t.b),i=K6((.2225045*e+.7168786*r+.0606169*n)/fF),a,s;return e===r&&r===n?a=s=i:(a=K6((.4360747*e+.3850649*r+.1430804*n)/dF),s=K6((.0139322*e+.0971045*r+.7141733*n)/pF)),new fl(116*i-16,500*(a-i),200*(i-s),t.opacity)}function Wwe(t,e,r,n){return arguments.length===1?yF(t):new fl(t,e,r,n??1)}function fl(t,e,r,n){this.l=+t,this.a=+e,this.b=+r,this.opacity=+n}f2(fl,Wwe,Fw(Uh,{brighter(t){return new fl(this.l+Ww*(t??1),this.a,this.b,this.opacity)},darker(t){return new fl(this.l-Ww*(t??1),this.a,this.b,this.opacity)},rgb(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,r=isNaN(this.b)?t:t-this.b/200;return e=dF*j6(e),t=fF*j6(t),r=pF*j6(r),new Ea(Z6(3.1338561*e-1.6168667*t-.4906146*r),Z6(-.9787684*e+1.9161415*t+.033454*r),Z6(.0719453*e-.2289914*t+1.4052427*r),this.opacity)}}));function K6(t){return t>Vwe?Math.pow(t,1/3):t/mF+gF}function j6(t){return t>_0?t*t*t:mF*(t-gF)}function Z6(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function Q6(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Uwe(t){if(t instanceof dc)return new dc(t.h,t.c,t.l,t.opacity);if(t instanceof fl||(t=yF(t)),t.a===0&&t.b===0)return new dc(NaN,0()=>t;function bF(t,e){return function(r){return t+r*e}}function Hwe(t,e,r){return t=Math.pow(t,r),e=Math.pow(e,r)-t,r=1/r,function(n){return Math.pow(t+n*e,r)}}function Ywe(t,e){var r=e-t;return r?bF(t,r>180||r<-180?r-360*Math.round(r/360):r):Uw(isNaN(t)?e:t)}function Xwe(t){return(t=+t)==1?m2:function(e,r){return r-e?Hwe(e,r,t):Uw(isNaN(e)?r:e)}}function m2(t,e){var r=e-t;return r?bF(t,r):Uw(isNaN(t)?e:t)}const Hw=(function t(e){var r=Xwe(e);function n(i,a){var s=r((i=Y6(i)).r,(a=Y6(a)).r),o=r(i.g,a.g),l=r(i.b,a.b),u=m2(i.opacity,a.opacity);return function(h){return i.r=s(h),i.g=o(h),i.b=l(h),i.opacity=u(h),i+""}}return n.gamma=t,n})(1);function Kwe(t,e){e||(e=[]);var r=t?Math.min(e.length,t.length):0,n=e.slice(),i;return function(a){for(i=0;ir&&(a=e.slice(r,a),o[s]?o[s]+=a:o[++s]=a),(n=n[0])===(i=i[0])?o[s]?o[s]+=i:o[++s]=i:(o[++s]=null,l.push({i:s,x:Ro(n,i)})),r=tA.lastIndex;return r180?h+=360:h-u>180&&(u+=360),f.push({i:d.push(i(d)+"rotate(",null,n)-2,x:Ro(u,h)})):h&&d.push(i(d)+"rotate("+h+n)}function o(u,h,d,f){u!==h?f.push({i:d.push(i(d)+"skewX(",null,n)-2,x:Ro(u,h)}):h&&d.push(i(d)+"skewX("+h+n)}function l(u,h,d,f,p,g){if(u!==d||h!==f){var m=p.push(i(p)+"scale(",null,",",null,")");g.push({i:m-4,x:Ro(u,d)},{i:m-2,x:Ro(h,f)})}else(d!==1||f!==1)&&p.push(i(p)+"scale("+d+","+f+")")}return function(u,h){var d=[],f=[];return u=t(u),h=t(h),a(u.translateX,u.translateY,h.translateX,h.translateY,d,f),s(u.rotate,h.rotate,d,f),o(u.skewX,h.skewX,d,f),l(u.scaleX,u.scaleY,h.scaleX,h.scaleY,d,f),u=h=null,function(p){for(var g=-1,m=f.length,y;++g=0&&t._call.call(void 0,e),t=t._next;--R0}function AF(){Kh=(Kw=x2.now())+jw,R0=y2=0;try{u4e()}finally{R0=0,d4e(),Kh=0}}function h4e(){var t=x2.now(),e=t-Kw;e>kF&&(jw-=e,Kw=t)}function d4e(){for(var t,e=Xw,r,n=1/0;e;)e._call?(n>e._time&&(n=e._time),t=e,e=e._next):(r=e._next,e._next=null,e=t?t._next=r:Xw=r);b2=t,aA(n)}function aA(t){if(!R0){y2&&(y2=clearTimeout(y2));var e=t-Kh;e>24?(t<1/0&&(y2=setTimeout(AF,t-x2.now()-jw)),v2&&(v2=clearInterval(v2))):(v2||(Kw=x2.now(),v2=setInterval(h4e,kF)),R0=1,EF(AF))}}function _F(t,e,r){var n=new Zw;return e=e==null?0:+e,n.restart(i=>{n.stop(),t(i+e)},e,r),n}var f4e=GB("start","end","cancel","interrupt"),p4e=[],RF=0,LF=1,sA=2,Qw=3,IF=4,oA=5,Jw=6;function e4(t,e,r,n,i,a){var s=t.__transition;if(!s)t.__transition={};else if(r in s)return;g4e(t,r,{name:e,index:n,group:i,on:f4e,tween:p4e,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:RF})}function lA(t,e){var r=Lo(t,e);if(r.state>RF)throw new Error("too late; already scheduled");return r}function pl(t,e){var r=Lo(t,e);if(r.state>Qw)throw new Error("too late; already running");return r}function Lo(t,e){var r=t.__transition;if(!r||!(r=r[e]))throw new Error("transition not found");return r}function g4e(t,e,r){var n=t.__transition,i;n[e]=r,r.timer=SF(a,0,r.time);function a(u){r.state=LF,r.timer.restart(s,r.delay,r.time),r.delay<=u&&s(u-r.delay)}function s(u){var h,d,f,p;if(r.state!==LF)return l();for(h in n)if(p=n[h],p.name===r.name){if(p.state===Qw)return _F(s);p.state===IF?(p.state=Jw,p.timer.stop(),p.on.call("interrupt",t,t.__data__,p.index,p.group),delete n[h]):+hsA&&n.state=0&&(e=e.slice(0,r)),!e||e==="start"})}function H4e(t,e,r){var n,i,a=U4e(e)?lA:pl;return function(){var s=a(this,t),o=s.on;o!==n&&(i=(n=o).copy()).on(e,r),s.on=i}}function Y4e(t,e){var r=this._id;return arguments.length<2?Lo(this.node(),r).on.on(t):this.each(H4e(r,t,e))}function X4e(t){return function(){var e=this.parentNode;for(var r in this.__transition)if(+r!==t)return;e&&e.removeChild(this)}}function K4e(){return this.on("end.remove",X4e(this._id))}function j4e(t){var e=this._name,r=this._id;typeof t!="function"&&(t=U6(t));for(var n=this._groups,i=n.length,a=new Array(i),s=0;s=0))throw new Error(`invalid digits: ${t}`);if(e>15)return OF;const r=10**e;return function(n){this._+=n[0];for(let i=1,a=n.length;ijh)if(!(Math.abs(d*l-u*h)>jh)||!a)this._append`L${this._x1=e},${this._y1=r}`;else{let p=n-s,g=i-o,m=l*l+u*u,y=p*p+g*g,v=Math.sqrt(m),T=Math.sqrt(f),b=a*Math.tan((uA-Math.acos((m+f-y)/(2*v*T)))/2),w=b/T,k=b/v;Math.abs(w-1)>jh&&this._append`L${e+w*h},${r+w*d}`,this._append`A${a},${a},0,0,${+(d*p>h*g)},${this._x1=e+k*l},${this._y1=r+k*u}`}}arc(e,r,n,i,a,s){if(e=+e,r=+r,n=+n,s=!!s,n<0)throw new Error(`negative radius: ${n}`);let o=n*Math.cos(i),l=n*Math.sin(i),u=e+o,h=r+l,d=1^s,f=s?i-a:a-i;this._x1===null?this._append`M${u},${h}`:(Math.abs(this._x1-u)>jh||Math.abs(this._y1-h)>jh)&&this._append`L${u},${h}`,n&&(f<0&&(f=f%hA+hA),f>TCe?this._append`A${n},${n},0,1,${d},${e-o},${r-l}A${n},${n},0,1,${d},${this._x1=u},${this._y1=h}`:f>jh&&this._append`A${n},${n},0,${+(f>=uA)},${d},${this._x1=e+n*Math.cos(a)},${this._y1=r+n*Math.sin(a)}`)}rect(e,r,n,i){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+r}h${n=+n}v${+i}h${-n}Z`}toString(){return this._}};function kCe(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function t4(t,e){if(!isFinite(t)||t===0)return null;var r=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"),n=t.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+t.slice(r+1)]}function L0(t){return t=t4(Math.abs(t)),t?t[1]:NaN}function ECe(t,e){return function(r,n){for(var i=r.length,a=[],s=0,o=t[0],l=0;i>0&&o>0&&(l+o+1>n&&(o=Math.max(1,n-l)),a.push(r.substring(i-=o,i+o)),!((l+=o+1)>n));)o=t[s=(s+1)%t.length];return a.reverse().join(e)}}function SCe(t){return function(e){return e.replace(/[0-9]/g,function(r){return t[+r]})}}var ACe=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function r4(t){if(!(e=ACe.exec(t)))throw new Error("invalid format: "+t);var e;return new dA({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]})}r4.prototype=dA.prototype;function dA(t){this.fill=t.fill===void 0?" ":t.fill+"",this.align=t.align===void 0?">":t.align+"",this.sign=t.sign===void 0?"-":t.sign+"",this.symbol=t.symbol===void 0?"":t.symbol+"",this.zero=!!t.zero,this.width=t.width===void 0?void 0:+t.width,this.comma=!!t.comma,this.precision=t.precision===void 0?void 0:+t.precision,this.trim=!!t.trim,this.type=t.type===void 0?"":t.type+""}dA.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function _Ce(t){e:for(var e=t.length,r=1,n=-1,i;r0&&(n=0);break}return n>0?t.slice(0,n)+t.slice(i+1):t}var n4;function RCe(t,e){var r=t4(t,e);if(!r)return n4=void 0,t.toPrecision(e);var n=r[0],i=r[1],a=i-(n4=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,s=n.length;return a===s?n:a>s?n+new Array(a-s+1).join("0"):a>0?n.slice(0,a)+"."+n.slice(a):"0."+new Array(1-a).join("0")+t4(t,Math.max(0,e+a-1))[0]}function $F(t,e){var r=t4(t,e);if(!r)return t+"";var n=r[0],i=r[1];return i<0?"0."+new Array(-i).join("0")+n:n.length>i+1?n.slice(0,i+1)+"."+n.slice(i+1):n+new Array(i-n.length+2).join("0")}const PF={"%":(t,e)=>(t*100).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:kCe,e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>$F(t*100,e),r:$F,s:RCe,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function BF(t){return t}var FF=Array.prototype.map,zF=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function LCe(t){var e=t.grouping===void 0||t.thousands===void 0?BF:ECe(FF.call(t.grouping,Number),t.thousands+""),r=t.currency===void 0?"":t.currency[0]+"",n=t.currency===void 0?"":t.currency[1]+"",i=t.decimal===void 0?".":t.decimal+"",a=t.numerals===void 0?BF:SCe(FF.call(t.numerals,String)),s=t.percent===void 0?"%":t.percent+"",o=t.minus===void 0?"−":t.minus+"",l=t.nan===void 0?"NaN":t.nan+"";function u(d,f){d=r4(d);var p=d.fill,g=d.align,m=d.sign,y=d.symbol,v=d.zero,T=d.width,b=d.comma,w=d.precision,k=d.trim,A=d.type;A==="n"?(b=!0,A="g"):PF[A]||(w===void 0&&(w=12),k=!0,A="g"),(v||p==="0"&&g==="=")&&(v=!0,p="0",g="=");var C=(f&&f.prefix!==void 0?f.prefix:"")+(y==="$"?r:y==="#"&&/[boxX]/.test(A)?"0"+A.toLowerCase():""),_=(y==="$"?n:/[%p]/.test(A)?s:"")+(f&&f.suffix!==void 0?f.suffix:""),L=PF[A],O=/[defgprs%]/.test(A);w=w===void 0?6:/[gprs]/.test(A)?Math.max(1,Math.min(21,w)):Math.max(0,Math.min(20,w));function M(z){var F=C,S=_,R,N,D;if(A==="c")S=L(z)+S,z="";else{z=+z;var I=z<0||1/z<0;if(z=isNaN(z)?l:L(Math.abs(z),w),k&&(z=_Ce(z)),I&&+z==0&&m!=="+"&&(I=!1),F=(I?m==="("?m:o:m==="-"||m==="("?"":m)+F,S=(A==="s"&&!isNaN(z)&&n4!==void 0?zF[8+n4/3]:"")+S+(I&&m==="("?")":""),O){for(R=-1,N=z.length;++RD||D>57){S=(D===46?i+z.slice(R+1):z.slice(R))+S,z=z.slice(0,R);break}}}b&&!v&&(z=e(z,1/0));var $=F.length+z.length+S.length,B=$>1)+F+z+S+B.slice($);break;default:z=B+F+z+S;break}return a(z)}return M.toString=function(){return d+""},M}function h(d,f){var p=Math.max(-8,Math.min(8,Math.floor(L0(f)/3)))*3,g=Math.pow(10,-p),m=u((d=r4(d),d.type="f",d),{suffix:zF[8+p/3]});return function(y){return m(g*y)}}return{format:u,formatPrefix:h}}var i4,Zh,GF;ICe({thousands:",",grouping:[3],currency:["$",""]});function ICe(t){return i4=LCe(t),Zh=i4.format,GF=i4.formatPrefix,i4}function DCe(t){return Math.max(0,-L0(Math.abs(t)))}function MCe(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(L0(e)/3)))*3-L0(Math.abs(t)))}function NCe(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,L0(e)-L0(t))+1}function OCe(t){var e=0,r=t.children,n=r&&r.length;if(!n)e=1;else for(;--n>=0;)e+=r[n].value;t.value=e}function $Ce(){return this.eachAfter(OCe)}function PCe(t,e){let r=-1;for(const n of this)t.call(e,n,++r,this);return this}function BCe(t,e){for(var r=this,n=[r],i,a,s=-1;r=n.pop();)if(t.call(e,r,++s,this),i=r.children)for(a=i.length-1;a>=0;--a)n.push(i[a]);return this}function FCe(t,e){for(var r=this,n=[r],i=[],a,s,o,l=-1;r=n.pop();)if(i.push(r),a=r.children)for(s=0,o=a.length;s=0;)r+=n[i].value;e.value=r})}function qCe(t){return this.eachBefore(function(e){e.children&&e.children.sort(t)})}function VCe(t){for(var e=this,r=WCe(e,t),n=[e];e!==r;)e=e.parent,n.push(e);for(var i=n.length;t!==r;)n.splice(i,0,t),t=t.parent;return n}function WCe(t,e){if(t===e)return t;var r=t.ancestors(),n=e.ancestors(),i=null;for(t=r.pop(),e=n.pop();t===e;)i=t,t=r.pop(),e=n.pop();return i}function UCe(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e}function HCe(){return Array.from(this)}function YCe(){var t=[];return this.eachBefore(function(e){e.children||t.push(e)}),t}function XCe(){var t=this,e=[];return t.each(function(r){r!==t&&e.push({source:r.parent,target:r})}),e}function*KCe(){var t=this,e,r=[t],n,i,a;do for(e=r.reverse(),r=[];t=e.pop();)if(yield t,n=t.children)for(i=0,a=n.length;i=0;--o)i.push(a=s[o]=new a4(s[o])),a.parent=n,a.depth=n.depth+1;return r.eachBefore(e5e)}function jCe(){return fA(this).eachBefore(JCe)}function ZCe(t){return t.children}function QCe(t){return Array.isArray(t)?t[1]:null}function JCe(t){t.data.value!==void 0&&(t.value=t.data.value),t.data=t.data.data}function e5e(t){var e=0;do t.height=e;while((t=t.parent)&&t.height<++e)}function a4(t){this.data=t,this.depth=this.height=0,this.parent=null}a4.prototype=fA.prototype={constructor:a4,count:$Ce,each:PCe,eachAfter:FCe,eachBefore:BCe,find:zCe,sum:GCe,sort:qCe,path:VCe,ancestors:UCe,descendants:HCe,leaves:YCe,links:XCe,copy:jCe,[Symbol.iterator]:KCe};function t5e(t){if(typeof t!="function")throw new Error;return t}function T2(){return 0}function w2(t){return function(){return t}}function r5e(t){t.x0=Math.round(t.x0),t.y0=Math.round(t.y0),t.x1=Math.round(t.x1),t.y1=Math.round(t.y1)}function n5e(t,e,r,n,i){for(var a=t.children,s,o=-1,l=a.length,u=t.value&&(n-e)/t.value;++oT&&(T=u),A=y*y*k,b=Math.max(T/A,A/v),b>w){y-=u;break}w=b}s.push(l={value:y,dice:p1?n:1)},r})(a5e);function l5e(){var t=o5e,e=!1,r=1,n=1,i=[0],a=T2,s=T2,o=T2,l=T2,u=T2;function h(f){return f.x0=f.y0=0,f.x1=r,f.y1=n,f.eachBefore(d),i=[0],e&&f.eachBefore(r5e),f}function d(f){var p=i[f.depth],g=f.x0+p,m=f.y0+p,y=f.x1-p,v=f.y1-p;ye&&(r=t,t=e,e=r),function(n){return Math.max(t,Math.min(e,n))}}function d5e(t,e,r){var n=t[0],i=t[1],a=e[0],s=e[1];return i2?f5e:d5e,l=u=null,d}function d(f){return f==null||isNaN(f=+f)?a:(l||(l=o(t.map(n),e,r)))(n(s(f)))}return d.invert=function(f){return s(i((u||(u=o(e,t.map(n),Ro)))(f)))},d.domain=function(f){return arguments.length?(t=Array.from(f,u5e),h()):t.slice()},d.range=function(f){return arguments.length?(e=Array.from(f),h()):e.slice()},d.rangeRound=function(f){return e=Array.from(f),r=r4e,h()},d.clamp=function(f){return arguments.length?(s=f?!0:I0,h()):s!==I0},d.interpolate=function(f){return arguments.length?(r=f,h()):r},d.unknown=function(f){return arguments.length?(a=f,d):a},function(f,p){return n=f,i=p,h()}}function UF(){return p5e()(I0,I0)}function g5e(t,e,r,n){var i=G6(t,e,r),a;switch(n=r4(n??",f"),n.type){case"s":{var s=Math.max(Math.abs(t),Math.abs(e));return n.precision==null&&!isNaN(a=MCe(i,s))&&(n.precision=a),GF(n,s)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(a=NCe(i,Math.max(Math.abs(t),Math.abs(e))))&&(n.precision=a-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(a=DCe(i))&&(n.precision=a-(n.type==="%")*2);break}}return Zh(n)}function m5e(t){var e=t.domain;return t.ticks=function(r){var n=e();return Pxe(n[0],n[n.length-1],r??10)},t.tickFormat=function(r,n){var i=e();return g5e(i[0],i[i.length-1],r??10,n)},t.nice=function(r){r==null&&(r=10);var n=e(),i=0,a=n.length-1,s=n[i],o=n[a],l,u,h=10;for(o0;){if(u=z6(s,o,r),u===l)return n[i]=s,n[a]=o,e(n);if(u>0)s=Math.floor(s/u)*u,o=Math.ceil(o/u)*u;else if(u<0)s=Math.ceil(s*u)/u,o=Math.floor(o*u)/u;else break;l=u}return t},t}function D0(){var t=UF();return t.copy=function(){return WF(t,D0())},s4.apply(t,arguments),m5e(t)}function y5e(t,e){t=t.slice();var r=0,n=t.length-1,i=t[r],a=t[n],s;return a(t(a=new Date(+a)),a),i.ceil=a=>(t(a=new Date(a-1)),e(a,1),t(a),a),i.round=a=>{const s=i(a),o=i.ceil(a);return a-s(e(a=new Date(+a),s==null?1:Math.floor(s)),a),i.range=(a,s,o)=>{const l=[];if(a=i.ceil(a),o=o==null?1:Math.floor(o),!(a0))return l;let u;do l.push(u=new Date(+a)),e(a,o),t(a);while(uNi(s=>{if(s>=s)for(;t(s),!a(s);)s.setTime(s-1)},(s,o)=>{if(s>=s)if(o<0)for(;++o<=0;)for(;e(s,-1),!a(s););else for(;--o>=0;)for(;e(s,1),!a(s););}),r&&(i.count=(a,s)=>(mA.setTime(+a),yA.setTime(+s),t(mA),t(yA),Math.floor(r(mA,yA))),i.every=a=>(a=Math.floor(a),!isFinite(a)||!(a>0)?null:a>1?i.filter(n?s=>n(s)%a===0:s=>i.count(0,s)%a===0):i)),i}const M0=Ni(()=>{},(t,e)=>{t.setTime(+t+e)},(t,e)=>e-t);M0.every=t=>(t=Math.floor(t),!isFinite(t)||!(t>0)?null:t>1?Ni(e=>{e.setTime(Math.floor(e/t)*t)},(e,r)=>{e.setTime(+e+r*t)},(e,r)=>(r-e)/t):M0),M0.range;const gc=1e3,ao=gc*60,mc=ao*60,yc=mc*24,vA=yc*7,HF=yc*30,bA=yc*365,Su=Ni(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+e*gc)},(t,e)=>(e-t)/gc,t=>t.getUTCSeconds());Su.range;const C2=Ni(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*gc)},(t,e)=>{t.setTime(+t+e*ao)},(t,e)=>(e-t)/ao,t=>t.getMinutes());C2.range,Ni(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+e*ao)},(t,e)=>(e-t)/ao,t=>t.getUTCMinutes()).range;const k2=Ni(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*gc-t.getMinutes()*ao)},(t,e)=>{t.setTime(+t+e*mc)},(t,e)=>(e-t)/mc,t=>t.getHours());k2.range,Ni(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+e*mc)},(t,e)=>(e-t)/mc,t=>t.getUTCHours()).range;const Jh=Ni(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*ao)/yc,t=>t.getDate()-1);Jh.range;const xA=Ni(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/yc,t=>t.getUTCDate()-1);xA.range,Ni(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/yc,t=>Math.floor(t/yc)).range;function ed(t){return Ni(e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},(e,r)=>{e.setDate(e.getDate()+r*7)},(e,r)=>(r-e-(r.getTimezoneOffset()-e.getTimezoneOffset())*ao)/vA)}const E2=ed(0),S2=ed(1),YF=ed(2),XF=ed(3),td=ed(4),KF=ed(5),jF=ed(6);E2.range,S2.range,YF.range,XF.range,td.range,KF.range,jF.range;function rd(t){return Ni(e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)},(e,r)=>{e.setUTCDate(e.getUTCDate()+r*7)},(e,r)=>(r-e)/vA)}const ZF=rd(0),o4=rd(1),v5e=rd(2),b5e=rd(3),N0=rd(4),x5e=rd(5),T5e=rd(6);ZF.range,o4.range,v5e.range,b5e.range,N0.range,x5e.range,T5e.range;const A2=Ni(t=>{t.setDate(1),t.setHours(0,0,0,0)},(t,e)=>{t.setMonth(t.getMonth()+e)},(t,e)=>e.getMonth()-t.getMonth()+(e.getFullYear()-t.getFullYear())*12,t=>t.getMonth());A2.range,Ni(t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCMonth(t.getUTCMonth()+e)},(t,e)=>e.getUTCMonth()-t.getUTCMonth()+(e.getUTCFullYear()-t.getUTCFullYear())*12,t=>t.getUTCMonth()).range;const vc=Ni(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());vc.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:Ni(e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},(e,r)=>{e.setFullYear(e.getFullYear()+r*t)}),vc.range;const nd=Ni(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());nd.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:Ni(e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,r)=>{e.setUTCFullYear(e.getUTCFullYear()+r*t)}),nd.range;function w5e(t,e,r,n,i,a){const s=[[Su,1,gc],[Su,5,5*gc],[Su,15,15*gc],[Su,30,30*gc],[a,1,ao],[a,5,5*ao],[a,15,15*ao],[a,30,30*ao],[i,1,mc],[i,3,3*mc],[i,6,6*mc],[i,12,12*mc],[n,1,yc],[n,2,2*yc],[r,1,vA],[e,1,HF],[e,3,3*HF],[t,1,bA]];function o(u,h,d){const f=hy).right(s,f);if(p===s.length)return t.every(G6(u/bA,h/bA,d));if(p===0)return M0.every(Math.max(G6(u,h,d),1));const[g,m]=s[f/s[p-1][2]53)return null;"w"in ne||(ne.w=1),"Z"in ne?(fe=wA(_2(ne.y,0,1)),_e=fe.getUTCDay(),fe=_e>4||_e===0?o4.ceil(fe):o4(fe),fe=xA.offset(fe,(ne.V-1)*7),ne.y=fe.getUTCFullYear(),ne.m=fe.getUTCMonth(),ne.d=fe.getUTCDate()+(ne.w+6)%7):(fe=TA(_2(ne.y,0,1)),_e=fe.getDay(),fe=_e>4||_e===0?S2.ceil(fe):S2(fe),fe=Jh.offset(fe,(ne.V-1)*7),ne.y=fe.getFullYear(),ne.m=fe.getMonth(),ne.d=fe.getDate()+(ne.w+6)%7)}else("W"in ne||"U"in ne)&&("w"in ne||(ne.w="u"in ne?ne.u%7:"W"in ne?1:0),_e="Z"in ne?wA(_2(ne.y,0,1)).getUTCDay():TA(_2(ne.y,0,1)).getDay(),ne.m=0,ne.d="W"in ne?(ne.w+6)%7+ne.W*7-(_e+5)%7:ne.w+ne.U*7-(_e+6)%7);return"Z"in ne?(ne.H+=ne.Z/100|0,ne.M+=ne.Z%100,wA(ne)):TA(ne)}}function _(J,Z,ee,ne){for(var ue=0,fe=Z.length,_e=ee.length,Ae,Ne;ue=_e)return-1;if(Ae=Z.charCodeAt(ue++),Ae===37){if(Ae=Z.charAt(ue++),Ne=k[Ae in QF?Z.charAt(ue++):Ae],!Ne||(ne=Ne(J,ee,ne))<0)return-1}else if(Ae!=ee.charCodeAt(ne++))return-1}return ne}function L(J,Z,ee){var ne=u.exec(Z.slice(ee));return ne?(J.p=h.get(ne[0].toLowerCase()),ee+ne[0].length):-1}function O(J,Z,ee){var ne=p.exec(Z.slice(ee));return ne?(J.w=g.get(ne[0].toLowerCase()),ee+ne[0].length):-1}function M(J,Z,ee){var ne=d.exec(Z.slice(ee));return ne?(J.w=f.get(ne[0].toLowerCase()),ee+ne[0].length):-1}function z(J,Z,ee){var ne=v.exec(Z.slice(ee));return ne?(J.m=T.get(ne[0].toLowerCase()),ee+ne[0].length):-1}function F(J,Z,ee){var ne=m.exec(Z.slice(ee));return ne?(J.m=y.get(ne[0].toLowerCase()),ee+ne[0].length):-1}function S(J,Z,ee){return _(J,e,Z,ee)}function R(J,Z,ee){return _(J,r,Z,ee)}function N(J,Z,ee){return _(J,n,Z,ee)}function D(J){return s[J.getDay()]}function I(J){return a[J.getDay()]}function $(J){return l[J.getMonth()]}function B(J){return o[J.getMonth()]}function P(J){return i[+(J.getHours()>=12)]}function G(J){return 1+~~(J.getMonth()/3)}function V(J){return s[J.getUTCDay()]}function Y(J){return a[J.getUTCDay()]}function W(J){return l[J.getUTCMonth()]}function ie(J){return o[J.getUTCMonth()]}function K(J){return i[+(J.getUTCHours()>=12)]}function se(J){return 1+~~(J.getUTCMonth()/3)}return{format:function(J){var Z=A(J+="",b);return Z.toString=function(){return J},Z},parse:function(J){var Z=C(J+="",!1);return Z.toString=function(){return J},Z},utcFormat:function(J){var Z=A(J+="",w);return Z.toString=function(){return J},Z},utcParse:function(J){var Z=C(J+="",!0);return Z.toString=function(){return J},Z}}}var QF={"-":"",_:" ",0:"0"},ji=/^\s*\d+/,S5e=/^%/,A5e=/[\\^$*+?|[\]().{}]/g;function Jr(t,e,r){var n=t<0?"-":"",i=(n?-t:t)+"",a=i.length;return n+(a[e.toLowerCase(),r]))}function R5e(t,e,r){var n=ji.exec(e.slice(r,r+1));return n?(t.w=+n[0],r+n[0].length):-1}function L5e(t,e,r){var n=ji.exec(e.slice(r,r+1));return n?(t.u=+n[0],r+n[0].length):-1}function I5e(t,e,r){var n=ji.exec(e.slice(r,r+2));return n?(t.U=+n[0],r+n[0].length):-1}function D5e(t,e,r){var n=ji.exec(e.slice(r,r+2));return n?(t.V=+n[0],r+n[0].length):-1}function M5e(t,e,r){var n=ji.exec(e.slice(r,r+2));return n?(t.W=+n[0],r+n[0].length):-1}function JF(t,e,r){var n=ji.exec(e.slice(r,r+4));return n?(t.y=+n[0],r+n[0].length):-1}function ez(t,e,r){var n=ji.exec(e.slice(r,r+2));return n?(t.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function N5e(t,e,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(r,r+6));return n?(t.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function O5e(t,e,r){var n=ji.exec(e.slice(r,r+1));return n?(t.q=n[0]*3-3,r+n[0].length):-1}function $5e(t,e,r){var n=ji.exec(e.slice(r,r+2));return n?(t.m=n[0]-1,r+n[0].length):-1}function tz(t,e,r){var n=ji.exec(e.slice(r,r+2));return n?(t.d=+n[0],r+n[0].length):-1}function P5e(t,e,r){var n=ji.exec(e.slice(r,r+3));return n?(t.m=0,t.d=+n[0],r+n[0].length):-1}function rz(t,e,r){var n=ji.exec(e.slice(r,r+2));return n?(t.H=+n[0],r+n[0].length):-1}function B5e(t,e,r){var n=ji.exec(e.slice(r,r+2));return n?(t.M=+n[0],r+n[0].length):-1}function F5e(t,e,r){var n=ji.exec(e.slice(r,r+2));return n?(t.S=+n[0],r+n[0].length):-1}function z5e(t,e,r){var n=ji.exec(e.slice(r,r+3));return n?(t.L=+n[0],r+n[0].length):-1}function G5e(t,e,r){var n=ji.exec(e.slice(r,r+6));return n?(t.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function q5e(t,e,r){var n=S5e.exec(e.slice(r,r+1));return n?r+n[0].length:-1}function V5e(t,e,r){var n=ji.exec(e.slice(r));return n?(t.Q=+n[0],r+n[0].length):-1}function W5e(t,e,r){var n=ji.exec(e.slice(r));return n?(t.s=+n[0],r+n[0].length):-1}function nz(t,e){return Jr(t.getDate(),e,2)}function U5e(t,e){return Jr(t.getHours(),e,2)}function H5e(t,e){return Jr(t.getHours()%12||12,e,2)}function Y5e(t,e){return Jr(1+Jh.count(vc(t),t),e,3)}function iz(t,e){return Jr(t.getMilliseconds(),e,3)}function X5e(t,e){return iz(t,e)+"000"}function K5e(t,e){return Jr(t.getMonth()+1,e,2)}function j5e(t,e){return Jr(t.getMinutes(),e,2)}function Z5e(t,e){return Jr(t.getSeconds(),e,2)}function Q5e(t){var e=t.getDay();return e===0?7:e}function J5e(t,e){return Jr(E2.count(vc(t)-1,t),e,2)}function az(t){var e=t.getDay();return e>=4||e===0?td(t):td.ceil(t)}function e3e(t,e){return t=az(t),Jr(td.count(vc(t),t)+(vc(t).getDay()===4),e,2)}function t3e(t){return t.getDay()}function r3e(t,e){return Jr(S2.count(vc(t)-1,t),e,2)}function n3e(t,e){return Jr(t.getFullYear()%100,e,2)}function i3e(t,e){return t=az(t),Jr(t.getFullYear()%100,e,2)}function a3e(t,e){return Jr(t.getFullYear()%1e4,e,4)}function s3e(t,e){var r=t.getDay();return t=r>=4||r===0?td(t):td.ceil(t),Jr(t.getFullYear()%1e4,e,4)}function o3e(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+Jr(e/60|0,"0",2)+Jr(e%60,"0",2)}function sz(t,e){return Jr(t.getUTCDate(),e,2)}function l3e(t,e){return Jr(t.getUTCHours(),e,2)}function c3e(t,e){return Jr(t.getUTCHours()%12||12,e,2)}function u3e(t,e){return Jr(1+xA.count(nd(t),t),e,3)}function oz(t,e){return Jr(t.getUTCMilliseconds(),e,3)}function h3e(t,e){return oz(t,e)+"000"}function d3e(t,e){return Jr(t.getUTCMonth()+1,e,2)}function f3e(t,e){return Jr(t.getUTCMinutes(),e,2)}function p3e(t,e){return Jr(t.getUTCSeconds(),e,2)}function g3e(t){var e=t.getUTCDay();return e===0?7:e}function m3e(t,e){return Jr(ZF.count(nd(t)-1,t),e,2)}function lz(t){var e=t.getUTCDay();return e>=4||e===0?N0(t):N0.ceil(t)}function y3e(t,e){return t=lz(t),Jr(N0.count(nd(t),t)+(nd(t).getUTCDay()===4),e,2)}function v3e(t){return t.getUTCDay()}function b3e(t,e){return Jr(o4.count(nd(t)-1,t),e,2)}function x3e(t,e){return Jr(t.getUTCFullYear()%100,e,2)}function T3e(t,e){return t=lz(t),Jr(t.getUTCFullYear()%100,e,2)}function w3e(t,e){return Jr(t.getUTCFullYear()%1e4,e,4)}function C3e(t,e){var r=t.getUTCDay();return t=r>=4||r===0?N0(t):N0.ceil(t),Jr(t.getUTCFullYear()%1e4,e,4)}function k3e(){return"+0000"}function cz(){return"%"}function uz(t){return+t}function hz(t){return Math.floor(+t/1e3)}var O0,l4;E3e({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function E3e(t){return O0=E5e(t),l4=O0.format,O0.parse,O0.utcFormat,O0.utcParse,O0}function S3e(t){return new Date(t)}function A3e(t){return t instanceof Date?+t:+new Date(+t)}function dz(t,e,r,n,i,a,s,o,l,u){var h=UF(),d=h.invert,f=h.domain,p=u(".%L"),g=u(":%S"),m=u("%I:%M"),y=u("%I %p"),v=u("%a %d"),T=u("%b %d"),b=u("%B"),w=u("%Y");function k(A){return(l(A)1?0:t<-1?I2:Math.acos(t)}function pz(t){return t>=1?c4:t<=-1?-c4:Math.asin(t)}function gz(t){let e=3;return t.digits=function(r){if(!arguments.length)return e;if(r==null)e=null;else{const n=Math.floor(r);if(!(n>=0))throw new RangeError(`invalid digits: ${r}`);e=n}return t},()=>new CCe(e)}function M3e(t){return t.innerRadius}function N3e(t){return t.outerRadius}function O3e(t){return t.startAngle}function $3e(t){return t.endAngle}function P3e(t){return t&&t.padAngle}function B3e(t,e,r,n,i,a,s,o){var l=r-t,u=n-e,h=s-i,d=o-a,f=d*l-h*u;if(!(f*fS*S+R*R&&(_=O,L=M),{cx:_,cy:L,x01:-h,y01:-d,x11:_*(i/k-1),y11:L*(i/k-1)}}function P0(){var t=M3e,e=N3e,r=hi(0),n=null,i=O3e,a=$3e,s=P3e,o=null,l=gz(u);function u(){var h,d,f=+t.apply(this,arguments),p=+e.apply(this,arguments),g=i.apply(this,arguments)-c4,m=a.apply(this,arguments)-c4,y=fz(m-g),v=m>g;if(o||(o=h=l()),pAa))o.moveTo(0,0);else if(y>u4-Aa)o.moveTo(p*id(g),p*gl(g)),o.arc(0,0,p,g,m,!v),f>Aa&&(o.moveTo(f*id(m),f*gl(m)),o.arc(0,0,f,m,g,v));else{var T=g,b=m,w=g,k=m,A=y,C=y,_=s.apply(this,arguments)/2,L=_>Aa&&(n?+n.apply(this,arguments):$0(f*f+p*p)),O=CA(fz(p-f)/2,+r.apply(this,arguments)),M=O,z=O,F,S;if(L>Aa){var R=pz(L/f*gl(_)),N=pz(L/p*gl(_));(A-=R*2)>Aa?(R*=v?1:-1,w+=R,k-=R):(A=0,w=k=(g+m)/2),(C-=N*2)>Aa?(N*=v?1:-1,T+=N,b-=N):(C=0,T=b=(g+m)/2)}var D=p*id(T),I=p*gl(T),$=f*id(k),B=f*gl(k);if(O>Aa){var P=p*id(b),G=p*gl(b),V=f*id(w),Y=f*gl(w),W;if(yAa?z>Aa?(F=h4(V,Y,D,I,p,z,v),S=h4(P,G,$,B,p,z,v),o.moveTo(F.cx+F.x01,F.cy+F.y01),zAa)||!(A>Aa)?o.lineTo($,B):M>Aa?(F=h4($,B,P,G,f,-M,v),S=h4(D,I,V,Y,f,-M,v),o.lineTo(F.cx+F.x01,F.cy+F.y01),Mt?1:e>=t?0:NaN}function q3e(t){return t}function V3e(){var t=q3e,e=G3e,r=null,n=hi(0),i=hi(u4),a=hi(0);function s(o){var l,u=(o=mz(o)).length,h,d,f=0,p=new Array(u),g=new Array(u),m=+n.apply(this,arguments),y=Math.min(u4,Math.max(-u4,i.apply(this,arguments)-m)),v,T=Math.min(Math.abs(y)/u,a.apply(this,arguments)),b=T*(y<0?-1:1),w;for(l=0;l0&&(f+=w);for(e!=null?p.sort(function(k,A){return e(g[k],g[A])}):r!=null&&p.sort(function(k,A){return r(o[k],o[A])}),l=0,d=f?(y-u*b)/f:0;l0?w*d:0)+b,g[h]={data:o[h],index:l,value:w,startAngle:m,endAngle:v,padAngle:T};return g}return s.value=function(o){return arguments.length?(t=typeof o=="function"?o:hi(+o),s):t},s.sortValues=function(o){return arguments.length?(e=o,r=null,s):e},s.sort=function(o){return arguments.length?(r=o,e=null,s):r},s.startAngle=function(o){return arguments.length?(n=typeof o=="function"?o:hi(+o),s):n},s.endAngle=function(o){return arguments.length?(i=typeof o=="function"?o:hi(+o),s):i},s.padAngle=function(o){return arguments.length?(a=typeof o=="function"?o:hi(+o),s):a},s}class vz{constructor(e,r){this._context=e,this._x=r}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(e,r){switch(e=+e,r=+r,this._point){case 0:{this._point=1,this._line?this._context.lineTo(e,r):this._context.moveTo(e,r);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+e)/2,this._y0,this._x0,r,e,r):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+r)/2,e,this._y0,e,r);break}}this._x0=e,this._y0=r}}function bz(t){return new vz(t,!0)}function xz(t){return new vz(t,!1)}function Au(){}function d4(t,e,r){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+r)/6)}function f4(t){this._context=t}f4.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:d4(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:d4(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function N2(t){return new f4(t)}function Tz(t){this._context=t}Tz.prototype={areaStart:Au,areaEnd:Au,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x2=t,this._y2=e;break;case 1:this._point=2,this._x3=t,this._y3=e;break;case 2:this._point=3,this._x4=t,this._y4=e,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+e)/6);break;default:d4(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function W3e(t){return new Tz(t)}function wz(t){this._context=t}wz.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var r=(this._x0+4*this._x1+t)/6,n=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(r,n):this._context.moveTo(r,n);break;case 3:this._point=4;default:d4(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function U3e(t){return new wz(t)}function Cz(t,e){this._basis=new f4(t),this._beta=e}Cz.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,e=this._y,r=t.length-1;if(r>0)for(var n=t[0],i=e[0],a=t[r]-n,s=e[r]-i,o=-1,l;++o<=r;)l=o/r,this._basis.point(this._beta*t[o]+(1-this._beta)*(n+l*a),this._beta*e[o]+(1-this._beta)*(i+l*s));this._x=this._y=null,this._basis.lineEnd()},point:function(t,e){this._x.push(+t),this._y.push(+e)}};const H3e=(function t(e){function r(n){return e===1?new f4(n):new Cz(n,e)}return r.beta=function(n){return t(+n)},r})(.85);function p4(t,e,r){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-r),t._x2,t._y2)}function kA(t,e){this._context=t,this._k=(1-e)/6}kA.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:p4(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:p4(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const kz=(function t(e){function r(n){return new kA(n,e)}return r.tension=function(n){return t(+n)},r})(0);function EA(t,e){this._context=t,this._k=(1-e)/6}EA.prototype={areaStart:Au,areaEnd:Au,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:p4(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const Y3e=(function t(e){function r(n){return new EA(n,e)}return r.tension=function(n){return t(+n)},r})(0);function SA(t,e){this._context=t,this._k=(1-e)/6}SA.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:p4(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const X3e=(function t(e){function r(n){return new SA(n,e)}return r.tension=function(n){return t(+n)},r})(0);function AA(t,e,r){var n=t._x1,i=t._y1,a=t._x2,s=t._y2;if(t._l01_a>Aa){var o=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,l=3*t._l01_a*(t._l01_a+t._l12_a);n=(n*o-t._x0*t._l12_2a+t._x2*t._l01_2a)/l,i=(i*o-t._y0*t._l12_2a+t._y2*t._l01_2a)/l}if(t._l23_a>Aa){var u=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,h=3*t._l23_a*(t._l23_a+t._l12_a);a=(a*u+t._x1*t._l23_2a-e*t._l12_2a)/h,s=(s*u+t._y1*t._l23_2a-r*t._l12_2a)/h}t._context.bezierCurveTo(n,i,a,s,t._x2,t._y2)}function Ez(t,e){this._context=t,this._alpha=e}Ez.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var r=this._x2-t,n=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:AA(this,t,e);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const Sz=(function t(e){function r(n){return e?new Ez(n,e):new kA(n,0)}return r.alpha=function(n){return t(+n)},r})(.5);function Az(t,e){this._context=t,this._alpha=e}Az.prototype={areaStart:Au,areaEnd:Au,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(t,e){if(t=+t,e=+e,this._point){var r=this._x2-t,n=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:AA(this,t,e);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const K3e=(function t(e){function r(n){return e?new Az(n,e):new EA(n,0)}return r.alpha=function(n){return t(+n)},r})(.5);function _z(t,e){this._context=t,this._alpha=e}_z.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var r=this._x2-t,n=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:AA(this,t,e);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const j3e=(function t(e){function r(n){return e?new _z(n,e):new SA(n,0)}return r.alpha=function(n){return t(+n)},r})(.5);function Rz(t){this._context=t}Rz.prototype={areaStart:Au,areaEnd:Au,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,e){t=+t,e=+e,this._point?this._context.lineTo(t,e):(this._point=1,this._context.moveTo(t,e))}};function Z3e(t){return new Rz(t)}function Lz(t){return t<0?-1:1}function Iz(t,e,r){var n=t._x1-t._x0,i=e-t._x1,a=(t._y1-t._y0)/(n||i<0&&-0),s=(r-t._y1)/(i||n<0&&-0),o=(a*i+s*n)/(n+i);return(Lz(a)+Lz(s))*Math.min(Math.abs(a),Math.abs(s),.5*Math.abs(o))||0}function Dz(t,e){var r=t._x1-t._x0;return r?(3*(t._y1-t._y0)/r-e)/2:e}function _A(t,e,r){var n=t._x0,i=t._y0,a=t._x1,s=t._y1,o=(a-n)/3;t._context.bezierCurveTo(n+o,i+o*e,a-o,s-o*r,a,s)}function g4(t){this._context=t}g4.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:_A(this,this._t0,Dz(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){var r=NaN;if(t=+t,e=+e,!(t===this._x1&&e===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,_A(this,Dz(this,r=Iz(this,t,e)),r);break;default:_A(this,this._t0,r=Iz(this,t,e));break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=r}}};function Mz(t){this._context=new Nz(t)}(Mz.prototype=Object.create(g4.prototype)).point=function(t,e){g4.prototype.point.call(this,e,t)};function Nz(t){this._context=t}Nz.prototype={moveTo:function(t,e){this._context.moveTo(e,t)},closePath:function(){this._context.closePath()},lineTo:function(t,e){this._context.lineTo(e,t)},bezierCurveTo:function(t,e,r,n,i,a){this._context.bezierCurveTo(e,t,n,r,a,i)}};function Oz(t){return new g4(t)}function $z(t){return new Mz(t)}function Pz(t){this._context=t}Pz.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var t=this._x,e=this._y,r=t.length;if(r)if(this._line?this._context.lineTo(t[0],e[0]):this._context.moveTo(t[0],e[0]),r===2)this._context.lineTo(t[1],e[1]);else for(var n=Bz(t),i=Bz(e),a=0,s=1;s=0;--e)i[e]=(s[e]-i[e+1])/a[e];for(a[r-1]=(t[r]+i[r-1])/2,e=0;e=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var r=this._x*(1-this._t)+t*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,e)}break}}this._x=t,this._y=e}};function zz(t){return new m4(t,.5)}function Gz(t){return new m4(t,0)}function qz(t){return new m4(t,1)}function O2(t,e,r){this.k=t,this.x=e,this.y=r}O2.prototype={constructor:O2,scale:function(t){return t===1?this:new O2(this.k*t,this.x,this.y)},translate:function(t,e){return t===0&e===0?this:new O2(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}},O2.prototype;var ys=x(t=>{var i;const{securityLevel:e}=Pe();let r=pt("body");if(e==="sandbox"){const s=((i=pt(`#i${t}`).node())==null?void 0:i.contentDocument)??document;r=pt(s.body)}return r.select(`#${t}`)},"selectSvgElement");function RA(t){return typeof t>"u"||t===null}x(RA,"isNothing");function Vz(t){return typeof t=="object"&&t!==null}x(Vz,"isObject");function Wz(t){return Array.isArray(t)?t:RA(t)?[]:[t]}x(Wz,"toArray");function Uz(t,e){var r,n,i,a;if(e)for(a=Object.keys(e),r=0,n=a.length;ro&&(a=" ... ",e=n-o+a.length),r-n>o&&(s=" ...",r=n+o-s.length),{str:a+t.slice(e,r).replace(/\t/g,"→")+s,pos:n-e+a.length}}x(y4,"getLine");function v4(t,e){return Oi.repeat(" ",e-t.length)+t}x(v4,"padStart");function Xz(t,e){if(e=Object.create(e||null),!t.buffer)return null;e.maxLength||(e.maxLength=79),typeof e.indent!="number"&&(e.indent=1),typeof e.linesBefore!="number"&&(e.linesBefore=3),typeof e.linesAfter!="number"&&(e.linesAfter=2);for(var r=/\r?\n|\r|\0/g,n=[0],i=[],a,s=-1;a=r.exec(t.buffer);)i.push(a.index),n.push(a.index+a[0].length),t.position<=a.index&&s<0&&(s=n.length-2);s<0&&(s=n.length-1);var o="",l,u,h=Math.min(t.line+e.linesAfter,i.length).toString().length,d=e.maxLength-(e.indent+h+3);for(l=1;l<=e.linesBefore&&!(s-l<0);l++)u=y4(t.buffer,n[s-l],i[s-l],t.position-(n[s]-n[s-l]),d),o=Oi.repeat(" ",e.indent)+v4((t.line-l+1).toString(),h)+" | "+u.str+` -`+o;for(u=y4(t.buffer,n[s],i[s],t.position,d),o+=Oi.repeat(" ",e.indent)+v4((t.line+1).toString(),h)+" | "+u.str+` -`,o+=Oi.repeat("-",e.indent+h+3+u.pos)+`^ -`,l=1;l<=e.linesAfter&&!(s+l>=i.length);l++)u=y4(t.buffer,n[s+l],i[s+l],t.position-(n[s]-n[s+l]),d),o+=Oi.repeat(" ",e.indent)+v4((t.line+l+1).toString(),h)+" | "+u.str+` -`;return o.replace(/\n$/,"")}x(Xz,"makeSnippet");var ike=Xz,ake=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],ske=["scalar","sequence","mapping"];function Kz(t){var e={};return t!==null&&Object.keys(t).forEach(function(r){t[r].forEach(function(n){e[String(n)]=r})}),e}x(Kz,"compileStyleAliases");function jz(t,e){if(e=e||{},Object.keys(e).forEach(function(r){if(ake.indexOf(r)===-1)throw new vs('Unknown option "'+r+'" is met in definition of "'+t+'" YAML type.')}),this.options=e,this.tag=t,this.kind=e.kind||null,this.resolve=e.resolve||function(){return!0},this.construct=e.construct||function(r){return r},this.instanceOf=e.instanceOf||null,this.predicate=e.predicate||null,this.represent=e.represent||null,this.representName=e.representName||null,this.defaultStyle=e.defaultStyle||null,this.multi=e.multi||!1,this.styleAliases=Kz(e.styleAliases||null),ske.indexOf(this.kind)===-1)throw new vs('Unknown kind "'+this.kind+'" is specified for "'+t+'" YAML type.')}x(jz,"Type$1");var _a=jz;function IA(t,e){var r=[];return t[e].forEach(function(n){var i=r.length;r.forEach(function(a,s){a.tag===n.tag&&a.kind===n.kind&&a.multi===n.multi&&(i=s)}),r[i]=n}),r}x(IA,"compileList");function Zz(){var t={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},e,r;function n(i){i.multi?(t.multi[i.kind].push(i),t.multi.fallback.push(i)):t[i.kind][i.tag]=t.fallback[i.tag]=i}for(x(n,"collectType"),e=0,r=arguments.length;e=0?"0b"+t.toString(2):"-0b"+t.toString(2).slice(1)},"binary"),octal:x(function(t){return t>=0?"0o"+t.toString(8):"-0o"+t.toString(8).slice(1)},"octal"),decimal:x(function(t){return t.toString(10)},"decimal"),hexadecimal:x(function(t){return t>=0?"0x"+t.toString(16).toUpperCase():"-0x"+t.toString(16).toUpperCase().slice(1)},"hexadecimal")},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),gke=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function uG(t){return!(t===null||!gke.test(t)||t[t.length-1]==="_")}x(uG,"resolveYamlFloat");function hG(t){var e,r;return e=t.replace(/_/g,"").toLowerCase(),r=e[0]==="-"?-1:1,"+-".indexOf(e[0])>=0&&(e=e.slice(1)),e===".inf"?r===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:e===".nan"?NaN:r*parseFloat(e,10)}x(hG,"constructYamlFloat");var mke=/^[-+]?[0-9]+e/;function dG(t,e){var r;if(isNaN(t))switch(e){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===t)switch(e){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===t)switch(e){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(Oi.isNegativeZero(t))return"-0.0";return r=t.toString(10),mke.test(r)?r.replace("e",".e"):r}x(dG,"representYamlFloat");function fG(t){return Object.prototype.toString.call(t)==="[object Number]"&&(t%1!==0||Oi.isNegativeZero(t))}x(fG,"isFloat");var yke=new _a("tag:yaml.org,2002:float",{kind:"scalar",resolve:uG,construct:hG,predicate:fG,represent:dG,defaultStyle:"lowercase"}),pG=hke.extend({implicit:[dke,fke,pke,yke]}),vke=pG,gG=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),mG=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 yG(t){return t===null?!1:gG.exec(t)!==null||mG.exec(t)!==null}x(yG,"resolveYamlTimestamp");function vG(t){var e,r,n,i,a,s,o,l=0,u=null,h,d,f;if(e=gG.exec(t),e===null&&(e=mG.exec(t)),e===null)throw new Error("Date resolve error");if(r=+e[1],n=+e[2]-1,i=+e[3],!e[4])return new Date(Date.UTC(r,n,i));if(a=+e[4],s=+e[5],o=+e[6],e[7]){for(l=e[7].slice(0,3);l.length<3;)l+="0";l=+l}return e[9]&&(h=+e[10],d=+(e[11]||0),u=(h*60+d)*6e4,e[9]==="-"&&(u=-u)),f=new Date(Date.UTC(r,n,i,a,s,o,l)),u&&f.setTime(f.getTime()-u),f}x(vG,"constructYamlTimestamp");function bG(t){return t.toISOString()}x(bG,"representYamlTimestamp");var bke=new _a("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:yG,construct:vG,instanceOf:Date,represent:bG});function xG(t){return t==="<<"||t===null}x(xG,"resolveYamlMerge");var xke=new _a("tag:yaml.org,2002:merge",{kind:"scalar",resolve:xG}),DA=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/= -\r`;function TG(t){if(t===null)return!1;var e,r,n=0,i=t.length,a=DA;for(r=0;r64)){if(e<0)return!1;n+=6}return n%8===0}x(TG,"resolveYamlBinary");function wG(t){var e,r,n=t.replace(/[\r\n=]/g,""),i=n.length,a=DA,s=0,o=[];for(e=0;e>16&255),o.push(s>>8&255),o.push(s&255)),s=s<<6|a.indexOf(n.charAt(e));return r=i%4*6,r===0?(o.push(s>>16&255),o.push(s>>8&255),o.push(s&255)):r===18?(o.push(s>>10&255),o.push(s>>2&255)):r===12&&o.push(s>>4&255),new Uint8Array(o)}x(wG,"constructYamlBinary");function CG(t){var e="",r=0,n,i,a=t.length,s=DA;for(n=0;n>18&63],e+=s[r>>12&63],e+=s[r>>6&63],e+=s[r&63]),r=(r<<8)+t[n];return i=a%3,i===0?(e+=s[r>>18&63],e+=s[r>>12&63],e+=s[r>>6&63],e+=s[r&63]):i===2?(e+=s[r>>10&63],e+=s[r>>4&63],e+=s[r<<2&63],e+=s[64]):i===1&&(e+=s[r>>2&63],e+=s[r<<4&63],e+=s[64],e+=s[64]),e}x(CG,"representYamlBinary");function kG(t){return Object.prototype.toString.call(t)==="[object Uint8Array]"}x(kG,"isBinary");var Tke=new _a("tag:yaml.org,2002:binary",{kind:"scalar",resolve:TG,construct:wG,predicate:kG,represent:CG}),wke=Object.prototype.hasOwnProperty,Cke=Object.prototype.toString;function EG(t){if(t===null)return!0;var e=[],r,n,i,a,s,o=t;for(r=0,n=o.length;r>10)+55296,(t-65536&1023)+56320)}x(zG,"charFromCodepoint");function $A(t,e,r){e==="__proto__"?Object.defineProperty(t,e,{configurable:!0,enumerable:!0,writable:!0,value:r}):t[e]=r}x($A,"setProperty");var GG=new Array(256),qG=new Array(256);for(sd=0;sd<256;sd++)GG[sd]=OA(sd)?1:0,qG[sd]=OA(sd);var sd;function VG(t,e){this.input=t,this.filename=e.filename||null,this.schema=e.schema||IG,this.onWarning=e.onWarning||null,this.legacy=e.legacy||!1,this.json=e.json||!1,this.listener=e.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=t.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}x(VG,"State$1");function PA(t,e){var r={name:t.filename,buffer:t.input.slice(0,-1),position:t.position,line:t.line,column:t.position-t.lineStart};return r.snippet=ike(r),new vs(e,r)}x(PA,"generateError");function cr(t,e){throw PA(t,e)}x(cr,"throwError");function $2(t,e){t.onWarning&&t.onWarning.call(null,PA(t,e))}x($2,"throwWarning");var WG={YAML:x(function(e,r,n){var i,a,s;e.version!==null&&cr(e,"duplication of %YAML directive"),n.length!==1&&cr(e,"YAML directive accepts exactly one argument"),i=/^([0-9]+)\.([0-9]+)$/.exec(n[0]),i===null&&cr(e,"ill-formed argument of the YAML directive"),a=parseInt(i[1],10),s=parseInt(i[2],10),a!==1&&cr(e,"unacceptable YAML version of the document"),e.version=n[0],e.checkLineBreaks=s<2,s!==1&&s!==2&&$2(e,"unsupported YAML version of the document")},"handleYamlDirective"),TAG:x(function(e,r,n){var i,a;n.length!==2&&cr(e,"TAG directive accepts exactly two arguments"),i=n[0],a=n[1],OG.test(i)||cr(e,"ill-formed tag handle (first argument) of the TAG directive"),_u.call(e.tagMap,i)&&cr(e,'there is a previously declared suffix for "'+i+'" tag handle'),$G.test(a)||cr(e,"ill-formed tag prefix (second argument) of the TAG directive");try{a=decodeURIComponent(a)}catch{cr(e,"tag prefix is malformed: "+a)}e.tagMap[i]=a},"handleTagDirective")};function bc(t,e,r,n){var i,a,s,o;if(e1&&(t.result+=Oi.repeat(` -`,e-1))}x(C4,"writeFoldedLines");function UG(t,e,r){var n,i,a,s,o,l,u,h,d=t.kind,f=t.result,p;if(p=t.input.charCodeAt(t.position),Ga(p)||ad(p)||p===35||p===38||p===42||p===33||p===124||p===62||p===39||p===34||p===37||p===64||p===96||(p===63||p===45)&&(i=t.input.charCodeAt(t.position+1),Ga(i)||r&&ad(i)))return!1;for(t.kind="scalar",t.result="",a=s=t.position,o=!1;p!==0;){if(p===58){if(i=t.input.charCodeAt(t.position+1),Ga(i)||r&&ad(i))break}else if(p===35){if(n=t.input.charCodeAt(t.position-1),Ga(n))break}else{if(t.position===t.lineStart&&P2(t)||r&&ad(p))break;if(Io(p))if(l=t.line,u=t.lineStart,h=t.lineIndent,di(t,!1,-1),t.lineIndent>=e){o=!0,p=t.input.charCodeAt(t.position);continue}else{t.position=s,t.line=l,t.lineStart=u,t.lineIndent=h;break}}o&&(bc(t,a,s,!1),C4(t,t.line-l),a=s=t.position,o=!1),Ru(p)||(s=t.position+1),p=t.input.charCodeAt(++t.position)}return bc(t,a,s,!1),t.result?!0:(t.kind=d,t.result=f,!1)}x(UG,"readPlainScalar");function HG(t,e){var r,n,i;if(r=t.input.charCodeAt(t.position),r!==39)return!1;for(t.kind="scalar",t.result="",t.position++,n=i=t.position;(r=t.input.charCodeAt(t.position))!==0;)if(r===39)if(bc(t,n,t.position,!0),r=t.input.charCodeAt(++t.position),r===39)n=t.position,t.position++,i=t.position;else return!0;else Io(r)?(bc(t,n,i,!0),C4(t,di(t,!1,e)),n=i=t.position):t.position===t.lineStart&&P2(t)?cr(t,"unexpected end of the document within a single quoted scalar"):(t.position++,i=t.position);cr(t,"unexpected end of the stream within a single quoted scalar")}x(HG,"readSingleQuotedScalar");function YG(t,e){var r,n,i,a,s,o;if(o=t.input.charCodeAt(t.position),o!==34)return!1;for(t.kind="scalar",t.result="",t.position++,r=n=t.position;(o=t.input.charCodeAt(t.position))!==0;){if(o===34)return bc(t,r,t.position,!0),t.position++,!0;if(o===92){if(bc(t,r,t.position,!0),o=t.input.charCodeAt(++t.position),Io(o))di(t,!1,e);else if(o<256&&GG[o])t.result+=qG[o],t.position++;else if((s=BG(o))>0){for(i=s,a=0;i>0;i--)o=t.input.charCodeAt(++t.position),(s=PG(o))>=0?a=(a<<4)+s:cr(t,"expected hexadecimal character");t.result+=zG(a),t.position++}else cr(t,"unknown escape sequence");r=n=t.position}else Io(o)?(bc(t,r,n,!0),C4(t,di(t,!1,e)),r=n=t.position):t.position===t.lineStart&&P2(t)?cr(t,"unexpected end of the document within a double quoted scalar"):(t.position++,n=t.position)}cr(t,"unexpected end of the stream within a double quoted scalar")}x(YG,"readDoubleQuotedScalar");function XG(t,e){var r=!0,n,i,a,s=t.tag,o,l=t.anchor,u,h,d,f,p,g=Object.create(null),m,y,v,T;if(T=t.input.charCodeAt(t.position),T===91)h=93,p=!1,o=[];else if(T===123)h=125,p=!0,o={};else return!1;for(t.anchor!==null&&(t.anchorMap[t.anchor]=o),T=t.input.charCodeAt(++t.position);T!==0;){if(di(t,!0,e),T=t.input.charCodeAt(t.position),T===h)return t.position++,t.tag=s,t.anchor=l,t.kind=p?"mapping":"sequence",t.result=o,!0;r?T===44&&cr(t,"expected the node content, but found ','"):cr(t,"missed comma between flow collection entries"),y=m=v=null,d=f=!1,T===63&&(u=t.input.charCodeAt(t.position+1),Ga(u)&&(d=f=!0,t.position++,di(t,!0,e))),n=t.line,i=t.lineStart,a=t.position,ld(t,e,x4,!1,!0),y=t.tag,m=t.result,di(t,!0,e),T=t.input.charCodeAt(t.position),(f||t.line===n)&&T===58&&(d=!0,T=t.input.charCodeAt(++t.position),di(t,!0,e),ld(t,e,x4,!1,!0),v=t.result),p?od(t,o,g,y,m,v,n,i,a):d?o.push(od(t,null,g,y,m,v,n,i,a)):o.push(m),di(t,!0,e),T=t.input.charCodeAt(t.position),T===44?(r=!0,T=t.input.charCodeAt(++t.position)):r=!1}cr(t,"unexpected end of the stream within a flow collection")}x(XG,"readFlowCollection");function KG(t,e){var r,n,i=MA,a=!1,s=!1,o=e,l=0,u=!1,h,d;if(d=t.input.charCodeAt(t.position),d===124)n=!1;else if(d===62)n=!0;else return!1;for(t.kind="scalar",t.result="";d!==0;)if(d=t.input.charCodeAt(++t.position),d===43||d===45)MA===i?i=d===43?NG:Rke:cr(t,"repeat of a chomping mode identifier");else if((h=FG(d))>=0)h===0?cr(t,"bad explicit indentation width of a block scalar; it cannot be less than one"):s?cr(t,"repeat of an indentation width identifier"):(o=e+h-1,s=!0);else break;if(Ru(d)){do d=t.input.charCodeAt(++t.position);while(Ru(d));if(d===35)do d=t.input.charCodeAt(++t.position);while(!Io(d)&&d!==0)}for(;d!==0;){for(w4(t),t.lineIndent=0,d=t.input.charCodeAt(t.position);(!s||t.lineIndento&&(o=t.lineIndent),Io(d)){l++;continue}if(t.lineIndente)&&l!==0)cr(t,"bad indentation of a sequence entry");else if(t.lineIndente)&&(y&&(s=t.line,o=t.lineStart,l=t.position),ld(t,e,T4,!0,i)&&(y?g=t.result:m=t.result),y||(od(t,d,f,p,g,m,s,o,l),p=g=m=null),di(t,!0,-1),T=t.input.charCodeAt(t.position)),(t.line===a||t.lineIndent>e)&&T!==0)cr(t,"bad indentation of a mapping entry");else if(t.lineIndente?l=1:t.lineIndent===e?l=0:t.lineIndente?l=1:t.lineIndent===e?l=0:t.lineIndent tag; it should be "scalar", not "'+t.kind+'"'),d=0,f=t.implicitTypes.length;d"),t.result!==null&&g.kind!==t.kind&&cr(t,"unacceptable node kind for !<"+t.tag+'> tag; it should be "'+g.kind+'", not "'+t.kind+'"'),g.resolve(t.result,t.tag)?(t.result=g.construct(t.result,t.tag),t.anchor!==null&&(t.anchorMap[t.anchor]=t.result)):cr(t,"cannot resolve a node with !<"+t.tag+"> explicit tag")}return t.listener!==null&&t.listener("close",t),t.tag!==null||t.anchor!==null||h}x(ld,"composeNode");function eq(t){var e=t.position,r,n,i,a=!1,s;for(t.version=null,t.checkLineBreaks=t.legacy,t.tagMap=Object.create(null),t.anchorMap=Object.create(null);(s=t.input.charCodeAt(t.position))!==0&&(di(t,!0,-1),s=t.input.charCodeAt(t.position),!(t.lineIndent>0||s!==37));){for(a=!0,s=t.input.charCodeAt(++t.position),r=t.position;s!==0&&!Ga(s);)s=t.input.charCodeAt(++t.position);for(n=t.input.slice(r,t.position),i=[],n.length<1&&cr(t,"directive name must not be less than one character in length");s!==0;){for(;Ru(s);)s=t.input.charCodeAt(++t.position);if(s===35){do s=t.input.charCodeAt(++t.position);while(s!==0&&!Io(s));break}if(Io(s))break;for(r=t.position;s!==0&&!Ga(s);)s=t.input.charCodeAt(++t.position);i.push(t.input.slice(r,t.position))}s!==0&&w4(t),_u.call(WG,n)?WG[n](t,n,i):$2(t,'unknown document directive "'+n+'"')}if(di(t,!0,-1),t.lineIndent===0&&t.input.charCodeAt(t.position)===45&&t.input.charCodeAt(t.position+1)===45&&t.input.charCodeAt(t.position+2)===45?(t.position+=3,di(t,!0,-1)):a&&cr(t,"directives end mark is expected"),ld(t,t.lineIndent-1,T4,!1,!0),di(t,!0,-1),t.checkLineBreaks&&Ike.test(t.input.slice(e,t.position))&&$2(t,"non-ASCII line breaks are interpreted as content"),t.documents.push(t.result),t.position===t.lineStart&&P2(t)){t.input.charCodeAt(t.position)===46&&(t.position+=3,di(t,!0,-1));return}if(t.position"u"&&(r=e,e=null);var n=zA(t,r);if(typeof e!="function")return n;for(var i=0,a=n.length;i{e!==void 0&&(O4[t]=e)},"addStylesForDiagram"),z5e=B5e,R7={};S4(R7,{clear:()=>Hn,getAccDescription:()=>si,getAccTitle:()=>ii,getDiagramTitle:()=>Xn,setAccDescription:()=>ai,setAccTitle:()=>Yn,setDiagramTitle:()=>oi});var L7="",I7="",D7="",M7=T(t=>Zr(t,pr()),"sanitizeText"),Hn=T(()=>{L7="",D7="",I7=""},"clear"),Yn=T(t=>{L7=M7(t).replace(/^\s+/g,"")},"setAccTitle"),ii=T(()=>L7,"getAccTitle"),ai=T(t=>{D7=M7(t).replace(/\n\s+/g,` +`)},"setAccDescription"),si=T(()=>D7,"getAccDescription"),oi=T(t=>{I7=M7(t)},"setDiagramTitle"),Xn=T(()=>I7,"getDiagramTitle"),uV=se,G5e=f7,Pe=pr,N7=eV,hV=F0,$7=T(t=>Zr(t,Pe()),"sanitizeText"),O7=G0,q5e=T(()=>R7,"getCommonDb"),P4={},B4=T((t,e,r)=>{var n;P4[t]&&uV.warn(`Diagram with id ${t} already registered. Overwriting.`),P4[t]=e,r&&jq(t,r),F5e(t,e.styles),(n=e.injectUtils)==null||n.call(e,uV,G5e,Pe,$7,O7,q5e(),()=>{})},"registerDiagram"),P7=T(t=>{if(t in P4)return P4[t];throw new V5e(t)},"getDiagram"),V5e=(sy=class extends Error{constructor(e){super(`Diagram ${e} not found.`)}},T(sy,"DiagramNotFoundError"),sy);function F4(t,e){return t==null||e==null?NaN:te?1:t>=e?0:NaN}function W5e(t,e){return t==null||e==null?NaN:et?1:e>=t?0:NaN}function B7(t){let e,r,n;t.length!==2?(e=F4,r=(o,l)=>F4(t(o),l),n=(o,l)=>t(o)-l):(e=t===F4||t===W5e?t:U5e,r=t,n=t);function i(o,l,u=0,h=o.length){if(u>>1;r(o[d],l)<0?u=d+1:h=d}while(u>>1;r(o[d],l)<=0?u=d+1:h=d}while(uu&&n(o[d-1],l)>-n(o[d],l)?d-1:d}return{left:i,center:s,right:a}}function U5e(){return 0}function H5e(t){return t===null?NaN:+t}const Y5e=B7(F4).right;B7(H5e).center;class dV extends Map{constructor(e,r=K5e){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),e!=null)for(const[n,i]of e)this.set(n,i)}get(e){return super.get(fV(this,e))}has(e){return super.has(fV(this,e))}set(e,r){return super.set(X5e(this,e),r)}delete(e){return super.delete(j5e(this,e))}}function fV({_intern:t,_key:e},r){const n=e(r);return t.has(n)?t.get(n):r}function X5e({_intern:t,_key:e},r){const n=e(r);return t.has(n)?t.get(n):(t.set(n,r),r)}function j5e({_intern:t,_key:e},r){const n=e(r);return t.has(n)&&(r=t.get(n),t.delete(n)),r}function K5e(t){return t!==null&&typeof t=="object"?t.valueOf():t}const Z5e=Math.sqrt(50),Q5e=Math.sqrt(10),J5e=Math.sqrt(2);function z4(t,e,r){const n=(e-t)/Math.max(0,r),i=Math.floor(Math.log10(n)),a=n/Math.pow(10,i),s=a>=Z5e?10:a>=Q5e?5:a>=J5e?2:1;let o,l,u;return i<0?(u=Math.pow(10,-i)/s,o=Math.round(t*u),l=Math.round(e*u),o/ue&&--l,u=-u):(u=Math.pow(10,i)*s,o=Math.round(t/u),l=Math.round(e/u),o*ue&&--l),l0))return[];if(t===e)return[t];const n=e=i))return[];const o=a-i+1,l=new Array(o);if(n)if(s<0)for(let u=0;u=n)&&(r=n);else{let n=-1;for(let i of t)(i=e(i,++n,t))!=null&&(r=i)&&(r=i)}return r}function r3e(t,e){let r;if(e===void 0)for(const n of t)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);else{let n=-1;for(let i of t)(i=e(i,++n,t))!=null&&(r>i||r===void 0&&i>=i)&&(r=i)}return r}function n3e(t,e,r){t=+t,e=+e,r=(i=arguments.length)<2?(e=t,t=0,1):i<3?1:+r;for(var n=-1,i=Math.max(0,Math.ceil((e-t)/r))|0,a=new Array(i);++n+t(e)}function l3e(t,e){return e=Math.max(0,t.bandwidth()-e*2)/2,t.round()&&(e=Math.round(e)),r=>+t(r)+e}function c3e(){return!this.__axis}function gV(t,e){var r=[],n=null,i=null,a=6,s=6,o=3,l=typeof window<"u"&&window.devicePixelRatio>1?0:.5,u=t===G4||t===q4?-1:1,h=t===q4||t===G7?"x":"y",d=t===G4||t===q7?a3e:s3e;function f(p){var g=n??(e.ticks?e.ticks.apply(e,r):e.domain()),m=i??(e.tickFormat?e.tickFormat.apply(e,r):i3e),y=Math.max(a,0)+o,v=e.range(),x=+v[0]+l,b=+v[v.length-1]+l,w=(e.bandwidth?l3e:o3e)(e.copy(),l),C=p.selection?p.selection():p,_=C.selectAll(".domain").data([null]),k=C.selectAll(".tick").data(g,e).order(),S=k.exit(),L=k.enter().append("g").attr("class","tick"),$=k.select("line"),I=k.select("text");_=_.merge(_.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),k=k.merge(L),$=$.merge(L.append("line").attr("stroke","currentColor").attr(h+"2",u*a)),I=I.merge(L.append("text").attr("fill","currentColor").attr(h,u*y).attr("dy",t===G4?"0em":t===q7?"0.71em":"0.32em")),p!==C&&(_=_.transition(p),k=k.transition(p),$=$.transition(p),I=I.transition(p),S=S.transition(p).attr("opacity",pV).attr("transform",function(z){return isFinite(z=w(z))?d(z+l):this.getAttribute("transform")}),L.attr("opacity",pV).attr("transform",function(z){var F=this.parentNode.__axis;return d((F&&isFinite(F=F(z))?F:w(z))+l)})),S.remove(),_.attr("d",t===q4||t===G7?s?"M"+u*s+","+x+"H"+l+"V"+b+"H"+u*s:"M"+l+","+x+"V"+b:s?"M"+x+","+u*s+"V"+l+"H"+b+"V"+u*s:"M"+x+","+l+"H"+b),k.attr("opacity",1).attr("transform",function(z){return d(w(z)+l)}),$.attr(h+"2",u*a),I.attr(h,u*y).text(m),C.filter(c3e).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",t===G7?"start":t===q4?"end":"middle"),C.each(function(){this.__axis=w})}return f.scale=function(p){return arguments.length?(e=p,f):e},f.ticks=function(){return r=Array.from(arguments),f},f.tickArguments=function(p){return arguments.length?(r=p==null?[]:Array.from(p),f):r.slice()},f.tickValues=function(p){return arguments.length?(n=p==null?null:Array.from(p),f):n&&n.slice()},f.tickFormat=function(p){return arguments.length?(i=p,f):i},f.tickSize=function(p){return arguments.length?(a=s=+p,f):a},f.tickSizeInner=function(p){return arguments.length?(a=+p,f):a},f.tickSizeOuter=function(p){return arguments.length?(s=+p,f):s},f.tickPadding=function(p){return arguments.length?(o=+p,f):o},f.offset=function(p){return arguments.length?(l=+p,f):l},f}function u3e(t){return gV(G4,t)}function h3e(t){return gV(q7,t)}var d3e={value:()=>{}};function mV(){for(var t=0,e=arguments.length,r={},n;t=0&&(n=r.slice(i+1),r=r.slice(0,i)),r&&!e.hasOwnProperty(r))throw new Error("unknown type: "+r);return{type:r,name:n}})}V4.prototype=mV.prototype={constructor:V4,on:function(t,e){var r=this._,n=f3e(t+"",r),i,a=-1,s=n.length;if(arguments.length<2){for(;++a0)for(var r=new Array(i),n=0,i,a;n=0&&(e=t.slice(0,r))!=="xmlns"&&(t=t.slice(r+1)),vV.hasOwnProperty(e)?{space:vV[e],local:t}:t}function g3e(t){return function(){var e=this.ownerDocument,r=this.namespaceURI;return r===V7&&e.documentElement.namespaceURI===V7?e.createElement(t):e.createElementNS(r,t)}}function m3e(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function bV(t){var e=W4(t);return(e.local?m3e:g3e)(e)}function y3e(){}function W7(t){return t==null?y3e:function(){return this.querySelector(t)}}function v3e(t){typeof t!="function"&&(t=W7(t));for(var e=this._groups,r=e.length,n=new Array(r),i=0;i=b&&(b=x+1);!(C=y[b])&&++b=0;)(s=n[i])&&(a&&s.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(s,a),a=s);return this}function V3e(t){t||(t=W3e);function e(d,f){return d&&f?t(d.__data__,f.__data__):!d-!f}for(var r=this._groups,n=r.length,i=new Array(n),a=0;ae?1:t>=e?0:NaN}function U3e(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function H3e(){return Array.from(this)}function Y3e(){for(var t=this._groups,e=0,r=t.length;e1?this.each((e==null?iSe:typeof e=="function"?sSe:aSe)(t,e,r??"")):q0(this.node(),t)}function q0(t,e){return t.style.getPropertyValue(e)||kV(t).getComputedStyle(t,null).getPropertyValue(e)}function lSe(t){return function(){delete this[t]}}function cSe(t,e){return function(){this[t]=e}}function uSe(t,e){return function(){var r=e.apply(this,arguments);r==null?delete this[t]:this[t]=r}}function hSe(t,e){return arguments.length>1?this.each((e==null?lSe:typeof e=="function"?uSe:cSe)(t,e)):this.node()[t]}function EV(t){return t.trim().split(/^|\s+/)}function U7(t){return t.classList||new SV(t)}function SV(t){this._node=t,this._names=EV(t.getAttribute("class")||"")}SV.prototype={add:function(t){var e=this._names.indexOf(t);e<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function _V(t,e){for(var r=U7(t),n=-1,i=e.length;++n=0&&(r=e.slice(n+1),e=e.slice(0,n)),{type:e,name:r}})}function FSe(t){return function(){var e=this.__on;if(e){for(var r=0,n=-1,i=e.length,a;r>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):r===8?X4(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):r===4?X4(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=XSe.exec(t))?new Ka(e[1],e[2],e[3],1):(e=jSe.exec(t))?new Ka(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=KSe.exec(t))?X4(e[1],e[2],e[3],e[4]):(e=ZSe.exec(t))?X4(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=QSe.exec(t))?BV(e[1],e[2]/100,e[3]/100,1):(e=JSe.exec(t))?BV(e[1],e[2]/100,e[3]/100,e[4]):IV.hasOwnProperty(t)?NV(IV[t]):t==="transparent"?new Ka(NaN,NaN,NaN,0):null}function NV(t){return new Ka(t>>16&255,t>>8&255,t&255,1)}function X4(t,e,r,n){return n<=0&&(t=e=r=NaN),new Ka(t,e,r,n)}function $V(t){return t instanceof Yd||(t=Xd(t)),t?(t=t.rgb(),new Ka(t.r,t.g,t.b,t.opacity)):new Ka}function H7(t,e,r,n){return arguments.length===1?$V(t):new Ka(t,e,r,n??1)}function Ka(t,e,r,n){this.r=+t,this.g=+e,this.b=+r,this.opacity=+n}Hb(Ka,H7,H4(Yd,{brighter(t){return t=t==null?Y4:Math.pow(Y4,t),new Ka(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?Yb:Math.pow(Yb,t),new Ka(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Ka(jd(this.r),jd(this.g),jd(this.b),j4(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:OV,formatHex:OV,formatHex8:r_e,formatRgb:PV,toString:PV}));function OV(){return`#${Kd(this.r)}${Kd(this.g)}${Kd(this.b)}`}function r_e(){return`#${Kd(this.r)}${Kd(this.g)}${Kd(this.b)}${Kd((isNaN(this.opacity)?1:this.opacity)*255)}`}function PV(){const t=j4(this.opacity);return`${t===1?"rgb(":"rgba("}${jd(this.r)}, ${jd(this.g)}, ${jd(this.b)}${t===1?")":`, ${t})`}`}function j4(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function jd(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Kd(t){return t=jd(t),(t<16?"0":"")+t.toString(16)}function BV(t,e,r,n){return n<=0?t=e=r=NaN:r<=0||r>=1?t=e=NaN:e<=0&&(t=NaN),new fl(t,e,r,n)}function FV(t){if(t instanceof fl)return new fl(t.h,t.s,t.l,t.opacity);if(t instanceof Yd||(t=Xd(t)),!t)return new fl;if(t instanceof fl)return t;t=t.rgb();var e=t.r/255,r=t.g/255,n=t.b/255,i=Math.min(e,r,n),a=Math.max(e,r,n),s=NaN,o=a-i,l=(a+i)/2;return o?(e===a?s=(r-n)/o+(r0&&l<1?0:s,new fl(s,o,l,t.opacity)}function n_e(t,e,r,n){return arguments.length===1?FV(t):new fl(t,e,r,n??1)}function fl(t,e,r,n){this.h=+t,this.s=+e,this.l=+r,this.opacity=+n}Hb(fl,n_e,H4(Yd,{brighter(t){return t=t==null?Y4:Math.pow(Y4,t),new fl(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?Yb:Math.pow(Yb,t),new fl(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*e,i=2*r-n;return new Ka(Y7(t>=240?t-240:t+120,i,n),Y7(t,i,n),Y7(t<120?t+240:t-120,i,n),this.opacity)},clamp(){return new fl(zV(this.h),K4(this.s),K4(this.l),j4(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=j4(this.opacity);return`${t===1?"hsl(":"hsla("}${zV(this.h)}, ${K4(this.s)*100}%, ${K4(this.l)*100}%${t===1?")":`, ${t})`}`}}));function zV(t){return t=(t||0)%360,t<0?t+360:t}function K4(t){return Math.max(0,Math.min(1,t||0))}function Y7(t,e,r){return(t<60?e+(r-e)*t/60:t<180?r:t<240?e+(r-e)*(240-t)/60:e)*255}const i_e=Math.PI/180,a_e=180/Math.PI,Z4=18,GV=.96422,qV=1,VV=.82521,WV=4/29,W0=6/29,UV=3*W0*W0,s_e=W0*W0*W0;function HV(t){if(t instanceof Jl)return new Jl(t.l,t.a,t.b,t.opacity);if(t instanceof tu)return YV(t);t instanceof Ka||(t=$V(t));var e=Z7(t.r),r=Z7(t.g),n=Z7(t.b),i=X7((.2225045*e+.7168786*r+.0606169*n)/qV),a,s;return e===r&&r===n?a=s=i:(a=X7((.4360747*e+.3850649*r+.1430804*n)/GV),s=X7((.0139322*e+.0971045*r+.7141733*n)/VV)),new Jl(116*i-16,500*(a-i),200*(i-s),t.opacity)}function o_e(t,e,r,n){return arguments.length===1?HV(t):new Jl(t,e,r,n??1)}function Jl(t,e,r,n){this.l=+t,this.a=+e,this.b=+r,this.opacity=+n}Hb(Jl,o_e,H4(Yd,{brighter(t){return new Jl(this.l+Z4*(t??1),this.a,this.b,this.opacity)},darker(t){return new Jl(this.l-Z4*(t??1),this.a,this.b,this.opacity)},rgb(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,r=isNaN(this.b)?t:t-this.b/200;return e=GV*j7(e),t=qV*j7(t),r=VV*j7(r),new Ka(K7(3.1338561*e-1.6168667*t-.4906146*r),K7(-.9787684*e+1.9161415*t+.033454*r),K7(.0719453*e-.2289914*t+1.4052427*r),this.opacity)}}));function X7(t){return t>s_e?Math.pow(t,1/3):t/UV+WV}function j7(t){return t>W0?t*t*t:UV*(t-WV)}function K7(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function Z7(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function l_e(t){if(t instanceof tu)return new tu(t.h,t.c,t.l,t.opacity);if(t instanceof Jl||(t=HV(t)),t.a===0&&t.b===0)return new tu(NaN,0()=>t;function XV(t,e){return function(r){return t+r*e}}function c_e(t,e,r){return t=Math.pow(t,r),e=Math.pow(e,r)-t,r=1/r,function(n){return Math.pow(t+n*e,r)}}function u_e(t,e){var r=e-t;return r?XV(t,r>180||r<-180?r-360*Math.round(r/360):r):Q4(isNaN(t)?e:t)}function h_e(t){return(t=+t)==1?jb:function(e,r){return r-e?c_e(e,r,t):Q4(isNaN(e)?r:e)}}function jb(t,e){var r=e-t;return r?XV(t,r):Q4(isNaN(t)?e:t)}const J4=(function t(e){var r=h_e(e);function n(i,a){var s=r((i=H7(i)).r,(a=H7(a)).r),o=r(i.g,a.g),l=r(i.b,a.b),u=jb(i.opacity,a.opacity);return function(h){return i.r=s(h),i.g=o(h),i.b=l(h),i.opacity=u(h),i+""}}return n.gamma=t,n})(1);function d_e(t,e){e||(e=[]);var r=t?Math.min(e.length,t.length):0,n=e.slice(),i;return function(a){for(i=0;ir&&(a=e.slice(r,a),o[s]?o[s]+=a:o[++s]=a),(n=n[0])===(i=i[0])?o[s]?o[s]+=i:o[++s]=i:(o[++s]=null,l.push({i:s,x:pl(n,i)})),r=eR.lastIndex;return r180?h+=360:h-u>180&&(u+=360),f.push({i:d.push(i(d)+"rotate(",null,n)-2,x:pl(u,h)})):h&&d.push(i(d)+"rotate("+h+n)}function o(u,h,d,f){u!==h?f.push({i:d.push(i(d)+"skewX(",null,n)-2,x:pl(u,h)}):h&&d.push(i(d)+"skewX("+h+n)}function l(u,h,d,f,p,g){if(u!==d||h!==f){var m=p.push(i(p)+"scale(",null,",",null,")");g.push({i:m-4,x:pl(u,d)},{i:m-2,x:pl(h,f)})}else(d!==1||f!==1)&&p.push(i(p)+"scale("+d+","+f+")")}return function(u,h){var d=[],f=[];return u=t(u),h=t(h),a(u.translateX,u.translateY,h.translateX,h.translateY,d,f),s(u.rotate,h.rotate,d,f),o(u.skewX,h.skewX,d,f),l(u.scaleX,u.scaleY,h.scaleX,h.scaleY,d,f),u=h=null,function(p){for(var g=-1,m=f.length,y;++g=0&&t._call.call(void 0,e),t=t._next;--U0}function rW(){Zd=(rk=Jb.now())+nk,U0=Kb=0;try{__e()}finally{U0=0,R_e(),Zd=0}}function A_e(){var t=Jb.now(),e=t-rk;e>JV&&(nk-=e,rk=t)}function R_e(){for(var t,e=tk,r,n=1/0;e;)e._call?(n>e._time&&(n=e._time),t=e,e=e._next):(r=e._next,e._next=null,e=t?t._next=r:tk=r);Qb=t,iR(n)}function iR(t){if(!U0){Kb&&(Kb=clearTimeout(Kb));var e=t-Zd;e>24?(t<1/0&&(Kb=setTimeout(rW,t-Jb.now()-nk)),Zb&&(Zb=clearInterval(Zb))):(Zb||(rk=Jb.now(),Zb=setInterval(A_e,JV)),U0=1,eW(rW))}}function nW(t,e,r){var n=new ik;return e=e==null?0:+e,n.restart(i=>{n.stop(),t(i+e)},e,r),n}var L_e=mV("start","end","cancel","interrupt"),I_e=[],iW=0,aW=1,aR=2,ak=3,sW=4,sR=5,sk=6;function ok(t,e,r,n,i,a){var s=t.__transition;if(!s)t.__transition={};else if(r in s)return;D_e(t,r,{name:e,index:n,group:i,on:L_e,tween:I_e,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:iW})}function oR(t,e){var r=gl(t,e);if(r.state>iW)throw new Error("too late; already scheduled");return r}function ec(t,e){var r=gl(t,e);if(r.state>ak)throw new Error("too late; already running");return r}function gl(t,e){var r=t.__transition;if(!r||!(r=r[e]))throw new Error("transition not found");return r}function D_e(t,e,r){var n=t.__transition,i;n[e]=r,r.timer=tW(a,0,r.time);function a(u){r.state=aW,r.timer.restart(s,r.delay,r.time),r.delay<=u&&s(u-r.delay)}function s(u){var h,d,f,p;if(r.state!==aW)return l();for(h in n)if(p=n[h],p.name===r.name){if(p.state===ak)return nW(s);p.state===sW?(p.state=sk,p.timer.stop(),p.on.call("interrupt",t,t.__data__,p.index,p.group),delete n[h]):+haR&&n.state=0&&(e=e.slice(0,r)),!e||e==="start"})}function c6e(t,e,r){var n,i,a=l6e(e)?oR:ec;return function(){var s=a(this,t),o=s.on;o!==n&&(i=(n=o).copy()).on(e,r),s.on=i}}function u6e(t,e){var r=this._id;return arguments.length<2?gl(this.node(),r).on.on(t):this.each(c6e(r,t,e))}function h6e(t){return function(){var e=this.parentNode;for(var r in this.__transition)if(+r!==t)return;e&&e.removeChild(this)}}function d6e(){return this.on("end.remove",h6e(this._id))}function f6e(t){var e=this._name,r=this._id;typeof t!="function"&&(t=W7(t));for(var n=this._groups,i=n.length,a=new Array(i),s=0;s=0))throw new Error(`invalid digits: ${t}`);if(e>15)return uW;const r=10**e;return function(n){this._+=n[0];for(let i=1,a=n.length;iQd)if(!(Math.abs(d*l-u*h)>Qd)||!a)this._append`L${this._x1=e},${this._y1=r}`;else{let p=n-s,g=i-o,m=l*l+u*u,y=p*p+g*g,v=Math.sqrt(m),x=Math.sqrt(f),b=a*Math.tan((cR-Math.acos((m+f-y)/(2*v*x)))/2),w=b/x,C=b/v;Math.abs(w-1)>Qd&&this._append`L${e+w*h},${r+w*d}`,this._append`A${a},${a},0,0,${+(d*p>h*g)},${this._x1=e+C*l},${this._y1=r+C*u}`}}arc(e,r,n,i,a,s){if(e=+e,r=+r,n=+n,s=!!s,n<0)throw new Error(`negative radius: ${n}`);let o=n*Math.cos(i),l=n*Math.sin(i),u=e+o,h=r+l,d=1^s,f=s?i-a:a-i;this._x1===null?this._append`M${u},${h}`:(Math.abs(this._x1-u)>Qd||Math.abs(this._y1-h)>Qd)&&this._append`L${u},${h}`,n&&(f<0&&(f=f%uR+uR),f>B6e?this._append`A${n},${n},0,1,${d},${e-o},${r-l}A${n},${n},0,1,${d},${this._x1=u},${this._y1=h}`:f>Qd&&this._append`A${n},${n},0,${+(f>=cR)},${d},${this._x1=e+n*Math.cos(a)},${this._y1=r+n*Math.sin(a)}`)}rect(e,r,n,i){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+r}h${n=+n}v${+i}h${-n}Z`}toString(){return this._}};function G6e(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function lk(t,e){if(!isFinite(t)||t===0)return null;var r=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"),n=t.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+t.slice(r+1)]}function H0(t){return t=lk(Math.abs(t)),t?t[1]:NaN}function q6e(t,e){return function(r,n){for(var i=r.length,a=[],s=0,o=t[0],l=0;i>0&&o>0&&(l+o+1>n&&(o=Math.max(1,n-l)),a.push(r.substring(i-=o,i+o)),!((l+=o+1)>n));)o=t[s=(s+1)%t.length];return a.reverse().join(e)}}function V6e(t){return function(e){return e.replace(/[0-9]/g,function(r){return t[+r]})}}var W6e=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function ck(t){if(!(e=W6e.exec(t)))throw new Error("invalid format: "+t);var e;return new hR({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]})}ck.prototype=hR.prototype;function hR(t){this.fill=t.fill===void 0?" ":t.fill+"",this.align=t.align===void 0?">":t.align+"",this.sign=t.sign===void 0?"-":t.sign+"",this.symbol=t.symbol===void 0?"":t.symbol+"",this.zero=!!t.zero,this.width=t.width===void 0?void 0:+t.width,this.comma=!!t.comma,this.precision=t.precision===void 0?void 0:+t.precision,this.trim=!!t.trim,this.type=t.type===void 0?"":t.type+""}hR.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function U6e(t){e:for(var e=t.length,r=1,n=-1,i;r0&&(n=0);break}return n>0?t.slice(0,n)+t.slice(i+1):t}var uk;function H6e(t,e){var r=lk(t,e);if(!r)return uk=void 0,t.toPrecision(e);var n=r[0],i=r[1],a=i-(uk=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,s=n.length;return a===s?n:a>s?n+new Array(a-s+1).join("0"):a>0?n.slice(0,a)+"."+n.slice(a):"0."+new Array(1-a).join("0")+lk(t,Math.max(0,e+a-1))[0]}function hW(t,e){var r=lk(t,e);if(!r)return t+"";var n=r[0],i=r[1];return i<0?"0."+new Array(-i).join("0")+n:n.length>i+1?n.slice(0,i+1)+"."+n.slice(i+1):n+new Array(i-n.length+2).join("0")}const dW={"%":(t,e)=>(t*100).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:G6e,e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>hW(t*100,e),r:hW,s:H6e,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function fW(t){return t}var pW=Array.prototype.map,gW=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Y6e(t){var e=t.grouping===void 0||t.thousands===void 0?fW:q6e(pW.call(t.grouping,Number),t.thousands+""),r=t.currency===void 0?"":t.currency[0]+"",n=t.currency===void 0?"":t.currency[1]+"",i=t.decimal===void 0?".":t.decimal+"",a=t.numerals===void 0?fW:V6e(pW.call(t.numerals,String)),s=t.percent===void 0?"%":t.percent+"",o=t.minus===void 0?"−":t.minus+"",l=t.nan===void 0?"NaN":t.nan+"";function u(d,f){d=ck(d);var p=d.fill,g=d.align,m=d.sign,y=d.symbol,v=d.zero,x=d.width,b=d.comma,w=d.precision,C=d.trim,_=d.type;_==="n"?(b=!0,_="g"):dW[_]||(w===void 0&&(w=12),C=!0,_="g"),(v||p==="0"&&g==="=")&&(v=!0,p="0",g="=");var k=(f&&f.prefix!==void 0?f.prefix:"")+(y==="$"?r:y==="#"&&/[boxX]/.test(_)?"0"+_.toLowerCase():""),S=(y==="$"?n:/[%p]/.test(_)?s:"")+(f&&f.suffix!==void 0?f.suffix:""),L=dW[_],$=/[defgprs%]/.test(_);w=w===void 0?6:/[gprs]/.test(_)?Math.max(1,Math.min(21,w)):Math.max(0,Math.min(20,w));function I(z){var F=k,A=S,R,N,M;if(_==="c")A=L(z)+A,z="";else{z=+z;var D=z<0||1/z<0;if(z=isNaN(z)?l:L(Math.abs(z),w),C&&(z=U6e(z)),D&&+z==0&&m!=="+"&&(D=!1),F=(D?m==="("?m:o:m==="-"||m==="("?"":m)+F,A=(_==="s"&&!isNaN(z)&&uk!==void 0?gW[8+uk/3]:"")+A+(D&&m==="("?")":""),$){for(R=-1,N=z.length;++RM||M>57){A=(M===46?i+z.slice(R+1):z.slice(R))+A,z=z.slice(0,R);break}}}b&&!v&&(z=e(z,1/0));var O=F.length+z.length+A.length,B=O>1)+F+z+A+B.slice(O);break;default:z=B+F+z+A;break}return a(z)}return I.toString=function(){return d+""},I}function h(d,f){var p=Math.max(-8,Math.min(8,Math.floor(H0(f)/3)))*3,g=Math.pow(10,-p),m=u((d=ck(d),d.type="f",d),{suffix:gW[8+p/3]});return function(y){return m(g*y)}}return{format:u,formatPrefix:h}}var hk,Jd,mW;X6e({thousands:",",grouping:[3],currency:["$",""]});function X6e(t){return hk=Y6e(t),Jd=hk.format,mW=hk.formatPrefix,hk}function j6e(t){return Math.max(0,-H0(Math.abs(t)))}function K6e(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(H0(e)/3)))*3-H0(Math.abs(t)))}function Z6e(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,H0(e)-H0(t))+1}function Q6e(t){var e=0,r=t.children,n=r&&r.length;if(!n)e=1;else for(;--n>=0;)e+=r[n].value;t.value=e}function J6e(){return this.eachAfter(Q6e)}function eAe(t,e){let r=-1;for(const n of this)t.call(e,n,++r,this);return this}function tAe(t,e){for(var r=this,n=[r],i,a,s=-1;r=n.pop();)if(t.call(e,r,++s,this),i=r.children)for(a=i.length-1;a>=0;--a)n.push(i[a]);return this}function rAe(t,e){for(var r=this,n=[r],i=[],a,s,o,l=-1;r=n.pop();)if(i.push(r),a=r.children)for(s=0,o=a.length;s=0;)r+=n[i].value;e.value=r})}function aAe(t){return this.eachBefore(function(e){e.children&&e.children.sort(t)})}function sAe(t){for(var e=this,r=oAe(e,t),n=[e];e!==r;)e=e.parent,n.push(e);for(var i=n.length;t!==r;)n.splice(i,0,t),t=t.parent;return n}function oAe(t,e){if(t===e)return t;var r=t.ancestors(),n=e.ancestors(),i=null;for(t=r.pop(),e=n.pop();t===e;)i=t,t=r.pop(),e=n.pop();return i}function lAe(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e}function cAe(){return Array.from(this)}function uAe(){var t=[];return this.eachBefore(function(e){e.children||t.push(e)}),t}function hAe(){var t=this,e=[];return t.each(function(r){r!==t&&e.push({source:r.parent,target:r})}),e}function*dAe(){var t=this,e,r=[t],n,i,a;do for(e=r.reverse(),r=[];t=e.pop();)if(yield t,n=t.children)for(i=0,a=n.length;i=0;--o)i.push(a=s[o]=new dk(s[o])),a.parent=n,a.depth=n.depth+1;return r.eachBefore(yAe)}function fAe(){return dR(this).eachBefore(mAe)}function pAe(t){return t.children}function gAe(t){return Array.isArray(t)?t[1]:null}function mAe(t){t.data.value!==void 0&&(t.value=t.data.value),t.data=t.data.data}function yAe(t){var e=0;do t.height=e;while((t=t.parent)&&t.height<++e)}function dk(t){this.data=t,this.depth=this.height=0,this.parent=null}dk.prototype=dR.prototype={constructor:dk,count:J6e,each:eAe,eachAfter:rAe,eachBefore:tAe,find:nAe,sum:iAe,sort:aAe,path:sAe,ancestors:lAe,descendants:cAe,leaves:uAe,links:hAe,copy:fAe,[Symbol.iterator]:dAe};function vAe(t){if(typeof t!="function")throw new Error;return t}function ex(){return 0}function tx(t){return function(){return t}}function bAe(t){t.x0=Math.round(t.x0),t.y0=Math.round(t.y0),t.x1=Math.round(t.x1),t.y1=Math.round(t.y1)}function xAe(t,e,r,n,i){for(var a=t.children,s,o=-1,l=a.length,u=t.value&&(n-e)/t.value;++ox&&(x=u),_=y*y*C,b=Math.max(x/_,_/v),b>w){y-=u;break}w=b}s.push(l={value:y,dice:p1?n:1)},r})(wAe);function EAe(){var t=kAe,e=!1,r=1,n=1,i=[0],a=ex,s=ex,o=ex,l=ex,u=ex;function h(f){return f.x0=f.y0=0,f.x1=r,f.y1=n,f.eachBefore(d),i=[0],e&&f.eachBefore(bAe),f}function d(f){var p=i[f.depth],g=f.x0+p,m=f.y0+p,y=f.x1-p,v=f.y1-p;ye&&(r=t,t=e,e=r),function(n){return Math.max(t,Math.min(e,n))}}function RAe(t,e,r){var n=t[0],i=t[1],a=e[0],s=e[1];return i2?LAe:RAe,l=u=null,d}function d(f){return f==null||isNaN(f=+f)?a:(l||(l=o(t.map(n),e,r)))(n(s(f)))}return d.invert=function(f){return s(i((u||(u=o(e,t.map(n),pl)))(f)))},d.domain=function(f){return arguments.length?(t=Array.from(f,_Ae),h()):t.slice()},d.range=function(f){return arguments.length?(e=Array.from(f),h()):e.slice()},d.rangeRound=function(f){return e=Array.from(f),r=b_e,h()},d.clamp=function(f){return arguments.length?(s=f?!0:Y0,h()):s!==Y0},d.interpolate=function(f){return arguments.length?(r=f,h()):r},d.unknown=function(f){return arguments.length?(a=f,d):a},function(f,p){return n=f,i=p,h()}}function xW(){return IAe()(Y0,Y0)}function DAe(t,e,r,n){var i=z7(t,e,r),a;switch(n=ck(n??",f"),n.type){case"s":{var s=Math.max(Math.abs(t),Math.abs(e));return n.precision==null&&!isNaN(a=K6e(i,s))&&(n.precision=a),mW(n,s)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(a=Z6e(i,Math.max(Math.abs(t),Math.abs(e))))&&(n.precision=a-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(a=j6e(i))&&(n.precision=a-(n.type==="%")*2);break}}return Jd(n)}function MAe(t){var e=t.domain;return t.ticks=function(r){var n=e();return e3e(n[0],n[n.length-1],r??10)},t.tickFormat=function(r,n){var i=e();return DAe(i[0],i[i.length-1],r??10,n)},t.nice=function(r){r==null&&(r=10);var n=e(),i=0,a=n.length-1,s=n[i],o=n[a],l,u,h=10;for(o0;){if(u=F7(s,o,r),u===l)return n[i]=s,n[a]=o,e(n);if(u>0)s=Math.floor(s/u)*u,o=Math.ceil(o/u)*u;else if(u<0)s=Math.ceil(s*u)/u,o=Math.floor(o*u)/u;else break;l=u}return t},t}function X0(){var t=xW();return t.copy=function(){return bW(t,X0())},fk.apply(t,arguments),MAe(t)}function NAe(t,e){t=t.slice();var r=0,n=t.length-1,i=t[r],a=t[n],s;return a(t(a=new Date(+a)),a),i.ceil=a=>(t(a=new Date(a-1)),e(a,1),t(a),a),i.round=a=>{const s=i(a),o=i.ceil(a);return a-s(e(a=new Date(+a),s==null?1:Math.floor(s)),a),i.range=(a,s,o)=>{const l=[];if(a=i.ceil(a),o=o==null?1:Math.floor(o),!(a0))return l;let u;do l.push(u=new Date(+a)),e(a,o),t(a);while(una(s=>{if(s>=s)for(;t(s),!a(s);)s.setTime(s-1)},(s,o)=>{if(s>=s)if(o<0)for(;++o<=0;)for(;e(s,-1),!a(s););else for(;--o>=0;)for(;e(s,1),!a(s););}),r&&(i.count=(a,s)=>(gR.setTime(+a),mR.setTime(+s),t(gR),t(mR),Math.floor(r(gR,mR))),i.every=a=>(a=Math.floor(a),!isFinite(a)||!(a>0)?null:a>1?i.filter(n?s=>n(s)%a===0:s=>i.count(0,s)%a===0):i)),i}const j0=na(()=>{},(t,e)=>{t.setTime(+t+e)},(t,e)=>e-t);j0.every=t=>(t=Math.floor(t),!isFinite(t)||!(t>0)?null:t>1?na(e=>{e.setTime(Math.floor(e/t)*t)},(e,r)=>{e.setTime(+e+r*t)},(e,r)=>(r-e)/t):j0),j0.range;const iu=1e3,Go=iu*60,au=Go*60,su=au*24,yR=su*7,TW=su*30,vR=su*365,Eh=na(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+e*iu)},(t,e)=>(e-t)/iu,t=>t.getUTCSeconds());Eh.range;const rx=na(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*iu)},(t,e)=>{t.setTime(+t+e*Go)},(t,e)=>(e-t)/Go,t=>t.getMinutes());rx.range,na(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+e*Go)},(t,e)=>(e-t)/Go,t=>t.getUTCMinutes()).range;const nx=na(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*iu-t.getMinutes()*Go)},(t,e)=>{t.setTime(+t+e*au)},(t,e)=>(e-t)/au,t=>t.getHours());nx.range,na(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+e*au)},(t,e)=>(e-t)/au,t=>t.getUTCHours()).range;const tf=na(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*Go)/su,t=>t.getDate()-1);tf.range;const bR=na(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/su,t=>t.getUTCDate()-1);bR.range,na(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/su,t=>Math.floor(t/su)).range;function rf(t){return na(e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},(e,r)=>{e.setDate(e.getDate()+r*7)},(e,r)=>(r-e-(r.getTimezoneOffset()-e.getTimezoneOffset())*Go)/yR)}const ix=rf(0),ax=rf(1),wW=rf(2),CW=rf(3),nf=rf(4),kW=rf(5),EW=rf(6);ix.range,ax.range,wW.range,CW.range,nf.range,kW.range,EW.range;function af(t){return na(e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)},(e,r)=>{e.setUTCDate(e.getUTCDate()+r*7)},(e,r)=>(r-e)/yR)}const SW=af(0),pk=af(1),$Ae=af(2),OAe=af(3),K0=af(4),PAe=af(5),BAe=af(6);SW.range,pk.range,$Ae.range,OAe.range,K0.range,PAe.range,BAe.range;const sx=na(t=>{t.setDate(1),t.setHours(0,0,0,0)},(t,e)=>{t.setMonth(t.getMonth()+e)},(t,e)=>e.getMonth()-t.getMonth()+(e.getFullYear()-t.getFullYear())*12,t=>t.getMonth());sx.range,na(t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCMonth(t.getUTCMonth()+e)},(t,e)=>e.getUTCMonth()-t.getUTCMonth()+(e.getUTCFullYear()-t.getUTCFullYear())*12,t=>t.getUTCMonth()).range;const ou=na(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());ou.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:na(e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},(e,r)=>{e.setFullYear(e.getFullYear()+r*t)}),ou.range;const sf=na(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());sf.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:na(e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,r)=>{e.setUTCFullYear(e.getUTCFullYear()+r*t)}),sf.range;function FAe(t,e,r,n,i,a){const s=[[Eh,1,iu],[Eh,5,5*iu],[Eh,15,15*iu],[Eh,30,30*iu],[a,1,Go],[a,5,5*Go],[a,15,15*Go],[a,30,30*Go],[i,1,au],[i,3,3*au],[i,6,6*au],[i,12,12*au],[n,1,su],[n,2,2*su],[r,1,yR],[e,1,TW],[e,3,3*TW],[t,1,vR]];function o(u,h,d){const f=hy).right(s,f);if(p===s.length)return t.every(z7(u/vR,h/vR,d));if(p===0)return j0.every(Math.max(z7(u,h,d),1));const[g,m]=s[f/s[p-1][2]53)return null;"w"in re||(re.w=1),"Z"in re?(fe=TR(ox(re.y,0,1)),Ae=fe.getUTCDay(),fe=Ae>4||Ae===0?pk.ceil(fe):pk(fe),fe=bR.offset(fe,(re.V-1)*7),re.y=fe.getUTCFullYear(),re.m=fe.getUTCMonth(),re.d=fe.getUTCDate()+(re.w+6)%7):(fe=xR(ox(re.y,0,1)),Ae=fe.getDay(),fe=Ae>4||Ae===0?ax.ceil(fe):ax(fe),fe=tf.offset(fe,(re.V-1)*7),re.y=fe.getFullYear(),re.m=fe.getMonth(),re.d=fe.getDate()+(re.w+6)%7)}else("W"in re||"U"in re)&&("w"in re||(re.w="u"in re?re.u%7:"W"in re?1:0),Ae="Z"in re?TR(ox(re.y,0,1)).getUTCDay():xR(ox(re.y,0,1)).getDay(),re.m=0,re.d="W"in re?(re.w+6)%7+re.W*7-(Ae+5)%7:re.w+re.U*7-(Ae+6)%7);return"Z"in re?(re.H+=re.Z/100|0,re.M+=re.Z%100,TR(re)):xR(re)}}function S(J,K,Q,re){for(var le=0,fe=K.length,Ae=Q.length,Se,Ne;le=Ae)return-1;if(Se=K.charCodeAt(le++),Se===37){if(Se=K.charAt(le++),Ne=C[Se in _W?K.charAt(le++):Se],!Ne||(re=Ne(J,Q,re))<0)return-1}else if(Se!=Q.charCodeAt(re++))return-1}return re}function L(J,K,Q){var re=u.exec(K.slice(Q));return re?(J.p=h.get(re[0].toLowerCase()),Q+re[0].length):-1}function $(J,K,Q){var re=p.exec(K.slice(Q));return re?(J.w=g.get(re[0].toLowerCase()),Q+re[0].length):-1}function I(J,K,Q){var re=d.exec(K.slice(Q));return re?(J.w=f.get(re[0].toLowerCase()),Q+re[0].length):-1}function z(J,K,Q){var re=v.exec(K.slice(Q));return re?(J.m=x.get(re[0].toLowerCase()),Q+re[0].length):-1}function F(J,K,Q){var re=m.exec(K.slice(Q));return re?(J.m=y.get(re[0].toLowerCase()),Q+re[0].length):-1}function A(J,K,Q){return S(J,e,K,Q)}function R(J,K,Q){return S(J,r,K,Q)}function N(J,K,Q){return S(J,n,K,Q)}function M(J){return s[J.getDay()]}function D(J){return a[J.getDay()]}function O(J){return l[J.getMonth()]}function B(J){return o[J.getMonth()]}function P(J){return i[+(J.getHours()>=12)]}function G(J){return 1+~~(J.getMonth()/3)}function V(J){return s[J.getUTCDay()]}function H(J){return a[J.getUTCDay()]}function W(J){return l[J.getUTCMonth()]}function ie(J){return o[J.getUTCMonth()]}function j(J){return i[+(J.getUTCHours()>=12)]}function ae(J){return 1+~~(J.getUTCMonth()/3)}return{format:function(J){var K=_(J+="",b);return K.toString=function(){return J},K},parse:function(J){var K=k(J+="",!1);return K.toString=function(){return J},K},utcFormat:function(J){var K=_(J+="",w);return K.toString=function(){return J},K},utcParse:function(J){var K=k(J+="",!0);return K.toString=function(){return J},K}}}var _W={"-":"",_:" ",0:"0"},ba=/^\s*\d+/,VAe=/^%/,WAe=/[\\^$*+?|[\]().{}]/g;function cn(t,e,r){var n=t<0?"-":"",i=(n?-t:t)+"",a=i.length;return n+(a[e.toLowerCase(),r]))}function HAe(t,e,r){var n=ba.exec(e.slice(r,r+1));return n?(t.w=+n[0],r+n[0].length):-1}function YAe(t,e,r){var n=ba.exec(e.slice(r,r+1));return n?(t.u=+n[0],r+n[0].length):-1}function XAe(t,e,r){var n=ba.exec(e.slice(r,r+2));return n?(t.U=+n[0],r+n[0].length):-1}function jAe(t,e,r){var n=ba.exec(e.slice(r,r+2));return n?(t.V=+n[0],r+n[0].length):-1}function KAe(t,e,r){var n=ba.exec(e.slice(r,r+2));return n?(t.W=+n[0],r+n[0].length):-1}function AW(t,e,r){var n=ba.exec(e.slice(r,r+4));return n?(t.y=+n[0],r+n[0].length):-1}function RW(t,e,r){var n=ba.exec(e.slice(r,r+2));return n?(t.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function ZAe(t,e,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(r,r+6));return n?(t.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function QAe(t,e,r){var n=ba.exec(e.slice(r,r+1));return n?(t.q=n[0]*3-3,r+n[0].length):-1}function JAe(t,e,r){var n=ba.exec(e.slice(r,r+2));return n?(t.m=n[0]-1,r+n[0].length):-1}function LW(t,e,r){var n=ba.exec(e.slice(r,r+2));return n?(t.d=+n[0],r+n[0].length):-1}function e7e(t,e,r){var n=ba.exec(e.slice(r,r+3));return n?(t.m=0,t.d=+n[0],r+n[0].length):-1}function IW(t,e,r){var n=ba.exec(e.slice(r,r+2));return n?(t.H=+n[0],r+n[0].length):-1}function t7e(t,e,r){var n=ba.exec(e.slice(r,r+2));return n?(t.M=+n[0],r+n[0].length):-1}function r7e(t,e,r){var n=ba.exec(e.slice(r,r+2));return n?(t.S=+n[0],r+n[0].length):-1}function n7e(t,e,r){var n=ba.exec(e.slice(r,r+3));return n?(t.L=+n[0],r+n[0].length):-1}function i7e(t,e,r){var n=ba.exec(e.slice(r,r+6));return n?(t.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function a7e(t,e,r){var n=VAe.exec(e.slice(r,r+1));return n?r+n[0].length:-1}function s7e(t,e,r){var n=ba.exec(e.slice(r));return n?(t.Q=+n[0],r+n[0].length):-1}function o7e(t,e,r){var n=ba.exec(e.slice(r));return n?(t.s=+n[0],r+n[0].length):-1}function DW(t,e){return cn(t.getDate(),e,2)}function l7e(t,e){return cn(t.getHours(),e,2)}function c7e(t,e){return cn(t.getHours()%12||12,e,2)}function u7e(t,e){return cn(1+tf.count(ou(t),t),e,3)}function MW(t,e){return cn(t.getMilliseconds(),e,3)}function h7e(t,e){return MW(t,e)+"000"}function d7e(t,e){return cn(t.getMonth()+1,e,2)}function f7e(t,e){return cn(t.getMinutes(),e,2)}function p7e(t,e){return cn(t.getSeconds(),e,2)}function g7e(t){var e=t.getDay();return e===0?7:e}function m7e(t,e){return cn(ix.count(ou(t)-1,t),e,2)}function NW(t){var e=t.getDay();return e>=4||e===0?nf(t):nf.ceil(t)}function y7e(t,e){return t=NW(t),cn(nf.count(ou(t),t)+(ou(t).getDay()===4),e,2)}function v7e(t){return t.getDay()}function b7e(t,e){return cn(ax.count(ou(t)-1,t),e,2)}function x7e(t,e){return cn(t.getFullYear()%100,e,2)}function T7e(t,e){return t=NW(t),cn(t.getFullYear()%100,e,2)}function w7e(t,e){return cn(t.getFullYear()%1e4,e,4)}function C7e(t,e){var r=t.getDay();return t=r>=4||r===0?nf(t):nf.ceil(t),cn(t.getFullYear()%1e4,e,4)}function k7e(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+cn(e/60|0,"0",2)+cn(e%60,"0",2)}function $W(t,e){return cn(t.getUTCDate(),e,2)}function E7e(t,e){return cn(t.getUTCHours(),e,2)}function S7e(t,e){return cn(t.getUTCHours()%12||12,e,2)}function _7e(t,e){return cn(1+bR.count(sf(t),t),e,3)}function OW(t,e){return cn(t.getUTCMilliseconds(),e,3)}function A7e(t,e){return OW(t,e)+"000"}function R7e(t,e){return cn(t.getUTCMonth()+1,e,2)}function L7e(t,e){return cn(t.getUTCMinutes(),e,2)}function I7e(t,e){return cn(t.getUTCSeconds(),e,2)}function D7e(t){var e=t.getUTCDay();return e===0?7:e}function M7e(t,e){return cn(SW.count(sf(t)-1,t),e,2)}function PW(t){var e=t.getUTCDay();return e>=4||e===0?K0(t):K0.ceil(t)}function N7e(t,e){return t=PW(t),cn(K0.count(sf(t),t)+(sf(t).getUTCDay()===4),e,2)}function $7e(t){return t.getUTCDay()}function O7e(t,e){return cn(pk.count(sf(t)-1,t),e,2)}function P7e(t,e){return cn(t.getUTCFullYear()%100,e,2)}function B7e(t,e){return t=PW(t),cn(t.getUTCFullYear()%100,e,2)}function F7e(t,e){return cn(t.getUTCFullYear()%1e4,e,4)}function z7e(t,e){var r=t.getUTCDay();return t=r>=4||r===0?K0(t):K0.ceil(t),cn(t.getUTCFullYear()%1e4,e,4)}function G7e(){return"+0000"}function BW(){return"%"}function FW(t){return+t}function zW(t){return Math.floor(+t/1e3)}var Z0,gk;q7e({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function q7e(t){return Z0=qAe(t),gk=Z0.format,Z0.parse,Z0.utcFormat,Z0.utcParse,Z0}function V7e(t){return new Date(t)}function W7e(t){return t instanceof Date?+t:+new Date(+t)}function GW(t,e,r,n,i,a,s,o,l,u){var h=xW(),d=h.invert,f=h.domain,p=u(".%L"),g=u(":%S"),m=u("%I:%M"),y=u("%I %p"),v=u("%a %d"),x=u("%b %d"),b=u("%B"),w=u("%Y");function C(_){return(l(_)<_?p:o(_)<_?g:s(_)<_?m:a(_)<_?y:n(_)<_?i(_)<_?v:x:r(_)<_?b:w)(_)}return h.invert=function(_){return new Date(d(_))},h.domain=function(_){return arguments.length?f(Array.from(_,W7e)):f().map(V7e)},h.ticks=function(_){var k=f();return t(k[0],k[k.length-1],_??10)},h.tickFormat=function(_,k){return k==null?C:u(k)},h.nice=function(_){var k=f();return(!_||typeof _.range!="function")&&(_=e(k[0],k[k.length-1],_??10)),_?f(NAe(k,_)):h},h.copy=function(){return bW(h,GW(t,e,r,n,i,a,s,o,l,u))},h}function U7e(){return fk.apply(GW(zAe,GAe,ou,sx,ix,tf,nx,rx,Eh,gk).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function H7e(t){for(var e=t.length/6|0,r=new Array(e),n=0;n1?0:t<-1?ux:Math.acos(t)}function VW(t){return t>=1?mk:t<=-1?-mk:Math.asin(t)}function WW(t){let e=3;return t.digits=function(r){if(!arguments.length)return e;if(r==null)e=null;else{const n=Math.floor(r);if(!(n>=0))throw new RangeError(`invalid digits: ${r}`);e=n}return t},()=>new z6e(e)}function K7e(t){return t.innerRadius}function Z7e(t){return t.outerRadius}function Q7e(t){return t.startAngle}function J7e(t){return t.endAngle}function eRe(t){return t&&t.padAngle}function tRe(t,e,r,n,i,a,s,o){var l=r-t,u=n-e,h=s-i,d=o-a,f=d*l-h*u;if(!(f*fA*A+R*R&&(S=$,L=I),{cx:S,cy:L,x01:-h,y01:-d,x11:S*(i/C-1),y11:L*(i/C-1)}}function J0(){var t=K7e,e=Z7e,r=Di(0),n=null,i=Q7e,a=J7e,s=eRe,o=null,l=WW(u);function u(){var h,d,f=+t.apply(this,arguments),p=+e.apply(this,arguments),g=i.apply(this,arguments)-mk,m=a.apply(this,arguments)-mk,y=qW(m-g),v=m>g;if(o||(o=h=l()),pQa))o.moveTo(0,0);else if(y>yk-Qa)o.moveTo(p*of(g),p*tc(g)),o.arc(0,0,p,g,m,!v),f>Qa&&(o.moveTo(f*of(m),f*tc(m)),o.arc(0,0,f,m,g,v));else{var x=g,b=m,w=g,C=m,_=y,k=y,S=s.apply(this,arguments)/2,L=S>Qa&&(n?+n.apply(this,arguments):Q0(f*f+p*p)),$=wR(qW(p-f)/2,+r.apply(this,arguments)),I=$,z=$,F,A;if(L>Qa){var R=VW(L/f*tc(S)),N=VW(L/p*tc(S));(_-=R*2)>Qa?(R*=v?1:-1,w+=R,C-=R):(_=0,w=C=(g+m)/2),(k-=N*2)>Qa?(N*=v?1:-1,x+=N,b-=N):(k=0,x=b=(g+m)/2)}var M=p*of(x),D=p*tc(x),O=f*of(C),B=f*tc(C);if($>Qa){var P=p*of(b),G=p*tc(b),V=f*of(w),H=f*tc(w),W;if(yQa?z>Qa?(F=vk(V,H,M,D,p,z,v),A=vk(P,G,O,B,p,z,v),o.moveTo(F.cx+F.x01,F.cy+F.y01),z<$?o.arc(F.cx,F.cy,z,Za(F.y01,F.x01),Za(A.y01,A.x01),!v):(o.arc(F.cx,F.cy,z,Za(F.y01,F.x01),Za(F.y11,F.x11),!v),o.arc(0,0,p,Za(F.cy+F.y11,F.cx+F.x11),Za(A.cy+A.y11,A.cx+A.x11),!v),o.arc(A.cx,A.cy,z,Za(A.y11,A.x11),Za(A.y01,A.x01),!v))):(o.moveTo(M,D),o.arc(0,0,p,x,b,!v)):o.moveTo(M,D),!(f>Qa)||!(_>Qa)?o.lineTo(O,B):I>Qa?(F=vk(O,B,P,G,f,-I,v),A=vk(M,D,V,H,f,-I,v),o.lineTo(F.cx+F.x01,F.cy+F.y01),I<$?o.arc(F.cx,F.cy,I,Za(F.y01,F.x01),Za(A.y01,A.x01),!v):(o.arc(F.cx,F.cy,I,Za(F.y01,F.x01),Za(F.y11,F.x11),!v),o.arc(0,0,f,Za(F.cy+F.y11,F.cx+F.x11),Za(A.cy+A.y11,A.cx+A.x11),v),o.arc(A.cx,A.cy,I,Za(A.y11,A.x11),Za(A.y01,A.x01),!v))):o.arc(0,0,f,C,w,v)}if(o.closePath(),h)return o=null,h+""||null}return u.centroid=function(){var h=(+t.apply(this,arguments)+ +e.apply(this,arguments))/2,d=(+i.apply(this,arguments)+ +a.apply(this,arguments))/2-ux/2;return[of(d)*h,tc(d)*h]},u.innerRadius=function(h){return arguments.length?(t=typeof h=="function"?h:Di(+h),u):t},u.outerRadius=function(h){return arguments.length?(e=typeof h=="function"?h:Di(+h),u):e},u.cornerRadius=function(h){return arguments.length?(r=typeof h=="function"?h:Di(+h),u):r},u.padRadius=function(h){return arguments.length?(n=h==null?null:typeof h=="function"?h:Di(+h),u):n},u.startAngle=function(h){return arguments.length?(i=typeof h=="function"?h:Di(+h),u):i},u.endAngle=function(h){return arguments.length?(a=typeof h=="function"?h:Di(+h),u):a},u.padAngle=function(h){return arguments.length?(s=typeof h=="function"?h:Di(+h),u):s},u.context=function(h){return arguments.length?(o=h??null,u):o},u}function UW(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function HW(t){this._context=t}HW.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e);break}}};function hx(t){return new HW(t)}function rRe(t){return t[0]}function nRe(t){return t[1]}function dx(t,e){var r=Di(!0),n=null,i=hx,a=null,s=WW(o);t=typeof t=="function"?t:t===void 0?rRe:Di(t),e=typeof e=="function"?e:e===void 0?nRe:Di(e);function o(l){var u,h=(l=UW(l)).length,d,f=!1,p;for(n==null&&(a=i(p=s())),u=0;u<=h;++u)!(ut?1:e>=t?0:NaN}function aRe(t){return t}function sRe(){var t=aRe,e=iRe,r=null,n=Di(0),i=Di(yk),a=Di(0);function s(o){var l,u=(o=UW(o)).length,h,d,f=0,p=new Array(u),g=new Array(u),m=+n.apply(this,arguments),y=Math.min(yk,Math.max(-yk,i.apply(this,arguments)-m)),v,x=Math.min(Math.abs(y)/u,a.apply(this,arguments)),b=x*(y<0?-1:1),w;for(l=0;l0&&(f+=w);for(e!=null?p.sort(function(C,_){return e(g[C],g[_])}):r!=null&&p.sort(function(C,_){return r(o[C],o[_])}),l=0,d=f?(y-u*b)/f:0;l0?w*d:0)+b,g[h]={data:o[h],index:l,value:w,startAngle:m,endAngle:v,padAngle:x};return g}return s.value=function(o){return arguments.length?(t=typeof o=="function"?o:Di(+o),s):t},s.sortValues=function(o){return arguments.length?(e=o,r=null,s):e},s.sort=function(o){return arguments.length?(r=o,e=null,s):r},s.startAngle=function(o){return arguments.length?(n=typeof o=="function"?o:Di(+o),s):n},s.endAngle=function(o){return arguments.length?(i=typeof o=="function"?o:Di(+o),s):i},s.padAngle=function(o){return arguments.length?(a=typeof o=="function"?o:Di(+o),s):a},s}class YW{constructor(e,r){this._context=e,this._x=r}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(e,r){switch(e=+e,r=+r,this._point){case 0:{this._point=1,this._line?this._context.lineTo(e,r):this._context.moveTo(e,r);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+e)/2,this._y0,this._x0,r,e,r):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+r)/2,e,this._y0,e,r);break}}this._x0=e,this._y0=r}}function XW(t){return new YW(t,!0)}function jW(t){return new YW(t,!1)}function Sh(){}function bk(t,e,r){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+r)/6)}function xk(t){this._context=t}xk.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:bk(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:bk(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function fx(t){return new xk(t)}function KW(t){this._context=t}KW.prototype={areaStart:Sh,areaEnd:Sh,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x2=t,this._y2=e;break;case 1:this._point=2,this._x3=t,this._y3=e;break;case 2:this._point=3,this._x4=t,this._y4=e,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+e)/6);break;default:bk(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function oRe(t){return new KW(t)}function ZW(t){this._context=t}ZW.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var r=(this._x0+4*this._x1+t)/6,n=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(r,n):this._context.moveTo(r,n);break;case 3:this._point=4;default:bk(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function lRe(t){return new ZW(t)}function QW(t,e){this._basis=new xk(t),this._beta=e}QW.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,e=this._y,r=t.length-1;if(r>0)for(var n=t[0],i=e[0],a=t[r]-n,s=e[r]-i,o=-1,l;++o<=r;)l=o/r,this._basis.point(this._beta*t[o]+(1-this._beta)*(n+l*a),this._beta*e[o]+(1-this._beta)*(i+l*s));this._x=this._y=null,this._basis.lineEnd()},point:function(t,e){this._x.push(+t),this._y.push(+e)}};const cRe=(function t(e){function r(n){return e===1?new xk(n):new QW(n,e)}return r.beta=function(n){return t(+n)},r})(.85);function Tk(t,e,r){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-r),t._x2,t._y2)}function CR(t,e){this._context=t,this._k=(1-e)/6}CR.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:Tk(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:Tk(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const JW=(function t(e){function r(n){return new CR(n,e)}return r.tension=function(n){return t(+n)},r})(0);function kR(t,e){this._context=t,this._k=(1-e)/6}kR.prototype={areaStart:Sh,areaEnd:Sh,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:Tk(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const uRe=(function t(e){function r(n){return new kR(n,e)}return r.tension=function(n){return t(+n)},r})(0);function ER(t,e){this._context=t,this._k=(1-e)/6}ER.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Tk(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const hRe=(function t(e){function r(n){return new ER(n,e)}return r.tension=function(n){return t(+n)},r})(0);function SR(t,e,r){var n=t._x1,i=t._y1,a=t._x2,s=t._y2;if(t._l01_a>Qa){var o=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,l=3*t._l01_a*(t._l01_a+t._l12_a);n=(n*o-t._x0*t._l12_2a+t._x2*t._l01_2a)/l,i=(i*o-t._y0*t._l12_2a+t._y2*t._l01_2a)/l}if(t._l23_a>Qa){var u=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,h=3*t._l23_a*(t._l23_a+t._l12_a);a=(a*u+t._x1*t._l23_2a-e*t._l12_2a)/h,s=(s*u+t._y1*t._l23_2a-r*t._l12_2a)/h}t._context.bezierCurveTo(n,i,a,s,t._x2,t._y2)}function eU(t,e){this._context=t,this._alpha=e}eU.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var r=this._x2-t,n=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:SR(this,t,e);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const tU=(function t(e){function r(n){return e?new eU(n,e):new CR(n,0)}return r.alpha=function(n){return t(+n)},r})(.5);function rU(t,e){this._context=t,this._alpha=e}rU.prototype={areaStart:Sh,areaEnd:Sh,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(t,e){if(t=+t,e=+e,this._point){var r=this._x2-t,n=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:SR(this,t,e);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const dRe=(function t(e){function r(n){return e?new rU(n,e):new kR(n,0)}return r.alpha=function(n){return t(+n)},r})(.5);function nU(t,e){this._context=t,this._alpha=e}nU.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var r=this._x2-t,n=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:SR(this,t,e);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const fRe=(function t(e){function r(n){return e?new nU(n,e):new ER(n,0)}return r.alpha=function(n){return t(+n)},r})(.5);function iU(t){this._context=t}iU.prototype={areaStart:Sh,areaEnd:Sh,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,e){t=+t,e=+e,this._point?this._context.lineTo(t,e):(this._point=1,this._context.moveTo(t,e))}};function pRe(t){return new iU(t)}function aU(t){return t<0?-1:1}function sU(t,e,r){var n=t._x1-t._x0,i=e-t._x1,a=(t._y1-t._y0)/(n||i<0&&-0),s=(r-t._y1)/(i||n<0&&-0),o=(a*i+s*n)/(n+i);return(aU(a)+aU(s))*Math.min(Math.abs(a),Math.abs(s),.5*Math.abs(o))||0}function oU(t,e){var r=t._x1-t._x0;return r?(3*(t._y1-t._y0)/r-e)/2:e}function _R(t,e,r){var n=t._x0,i=t._y0,a=t._x1,s=t._y1,o=(a-n)/3;t._context.bezierCurveTo(n+o,i+o*e,a-o,s-o*r,a,s)}function wk(t){this._context=t}wk.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:_R(this,this._t0,oU(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){var r=NaN;if(t=+t,e=+e,!(t===this._x1&&e===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,_R(this,oU(this,r=sU(this,t,e)),r);break;default:_R(this,this._t0,r=sU(this,t,e));break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=r}}};function lU(t){this._context=new cU(t)}(lU.prototype=Object.create(wk.prototype)).point=function(t,e){wk.prototype.point.call(this,e,t)};function cU(t){this._context=t}cU.prototype={moveTo:function(t,e){this._context.moveTo(e,t)},closePath:function(){this._context.closePath()},lineTo:function(t,e){this._context.lineTo(e,t)},bezierCurveTo:function(t,e,r,n,i,a){this._context.bezierCurveTo(e,t,n,r,a,i)}};function uU(t){return new wk(t)}function hU(t){return new lU(t)}function dU(t){this._context=t}dU.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var t=this._x,e=this._y,r=t.length;if(r)if(this._line?this._context.lineTo(t[0],e[0]):this._context.moveTo(t[0],e[0]),r===2)this._context.lineTo(t[1],e[1]);else for(var n=fU(t),i=fU(e),a=0,s=1;s=0;--e)i[e]=(s[e]-i[e+1])/a[e];for(a[r-1]=(t[r]+i[r-1])/2,e=0;e=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var r=this._x*(1-this._t)+t*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,e)}break}}this._x=t,this._y=e}};function gU(t){return new Ck(t,.5)}function mU(t){return new Ck(t,0)}function yU(t){return new Ck(t,1)}function px(t,e,r){this.k=t,this.x=e,this.y=r}px.prototype={constructor:px,scale:function(t){return t===1?this:new px(this.k*t,this.x,this.y)},translate:function(t,e){return t===0&e===0?this:new px(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}},px.prototype;var Ys=T(t=>{var i;const{securityLevel:e}=Pe();let r=gt("body");if(e==="sandbox"){const s=((i=gt(`#i${t}`).node())==null?void 0:i.contentDocument)??document;r=gt(s.body)}return r.select(`#${t}`)},"selectSvgElement");function AR(t){return typeof t>"u"||t===null}T(AR,"isNothing");function vU(t){return typeof t=="object"&&t!==null}T(vU,"isObject");function bU(t){return Array.isArray(t)?t:AR(t)?[]:[t]}T(bU,"toArray");function xU(t,e){var r,n,i,a;if(e)for(a=Object.keys(e),r=0,n=a.length;ro&&(a=" ... ",e=n-o+a.length),r-n>o&&(s=" ...",r=n+o-s.length),{str:a+t.slice(e,r).replace(/\t/g,"→")+s,pos:n-e+a.length}}T(kk,"getLine");function Ek(t,e){return ia.repeat(" ",e-t.length)+t}T(Ek,"padStart");function CU(t,e){if(e=Object.create(e||null),!t.buffer)return null;e.maxLength||(e.maxLength=79),typeof e.indent!="number"&&(e.indent=1),typeof e.linesBefore!="number"&&(e.linesBefore=3),typeof e.linesAfter!="number"&&(e.linesAfter=2);for(var r=/\r?\n|\r|\0/g,n=[0],i=[],a,s=-1;a=r.exec(t.buffer);)i.push(a.index),n.push(a.index+a[0].length),t.position<=a.index&&s<0&&(s=n.length-2);s<0&&(s=n.length-1);var o="",l,u,h=Math.min(t.line+e.linesAfter,i.length).toString().length,d=e.maxLength-(e.indent+h+3);for(l=1;l<=e.linesBefore&&!(s-l<0);l++)u=kk(t.buffer,n[s-l],i[s-l],t.position-(n[s]-n[s-l]),d),o=ia.repeat(" ",e.indent)+Ek((t.line-l+1).toString(),h)+" | "+u.str+` +`+o;for(u=kk(t.buffer,n[s],i[s],t.position,d),o+=ia.repeat(" ",e.indent)+Ek((t.line+1).toString(),h)+" | "+u.str+` +`,o+=ia.repeat("-",e.indent+h+3+u.pos)+`^ +`,l=1;l<=e.linesAfter&&!(s+l>=i.length);l++)u=kk(t.buffer,n[s+l],i[s+l],t.position-(n[s]-n[s+l]),d),o+=ia.repeat(" ",e.indent)+Ek((t.line+l+1).toString(),h)+" | "+u.str+` +`;return o.replace(/\n$/,"")}T(CU,"makeSnippet");var TRe=CU,wRe=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],CRe=["scalar","sequence","mapping"];function kU(t){var e={};return t!==null&&Object.keys(t).forEach(function(r){t[r].forEach(function(n){e[String(n)]=r})}),e}T(kU,"compileStyleAliases");function EU(t,e){if(e=e||{},Object.keys(e).forEach(function(r){if(wRe.indexOf(r)===-1)throw new Xs('Unknown option "'+r+'" is met in definition of "'+t+'" YAML type.')}),this.options=e,this.tag=t,this.kind=e.kind||null,this.resolve=e.resolve||function(){return!0},this.construct=e.construct||function(r){return r},this.instanceOf=e.instanceOf||null,this.predicate=e.predicate||null,this.represent=e.represent||null,this.representName=e.representName||null,this.defaultStyle=e.defaultStyle||null,this.multi=e.multi||!1,this.styleAliases=kU(e.styleAliases||null),CRe.indexOf(this.kind)===-1)throw new Xs('Unknown kind "'+this.kind+'" is specified for "'+t+'" YAML type.')}T(EU,"Type$1");var Ja=EU;function LR(t,e){var r=[];return t[e].forEach(function(n){var i=r.length;r.forEach(function(a,s){a.tag===n.tag&&a.kind===n.kind&&a.multi===n.multi&&(i=s)}),r[i]=n}),r}T(LR,"compileList");function SU(){var t={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},e,r;function n(i){i.multi?(t.multi[i.kind].push(i),t.multi.fallback.push(i)):t[i.kind][i.tag]=t.fallback[i.tag]=i}for(T(n,"collectType"),e=0,r=arguments.length;e=0?"0b"+t.toString(2):"-0b"+t.toString(2).slice(1)},"binary"),octal:T(function(t){return t>=0?"0o"+t.toString(8):"-0o"+t.toString(8).slice(1)},"octal"),decimal:T(function(t){return t.toString(10)},"decimal"),hexadecimal:T(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"]}}),DRe=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function FU(t){return!(t===null||!DRe.test(t)||t[t.length-1]==="_")}T(FU,"resolveYamlFloat");function zU(t){var e,r;return e=t.replace(/_/g,"").toLowerCase(),r=e[0]==="-"?-1:1,"+-".indexOf(e[0])>=0&&(e=e.slice(1)),e===".inf"?r===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:e===".nan"?NaN:r*parseFloat(e,10)}T(zU,"constructYamlFloat");var MRe=/^[-+]?[0-9]+e/;function GU(t,e){var r;if(isNaN(t))switch(e){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===t)switch(e){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===t)switch(e){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(ia.isNegativeZero(t))return"-0.0";return r=t.toString(10),MRe.test(r)?r.replace("e",".e"):r}T(GU,"representYamlFloat");function qU(t){return Object.prototype.toString.call(t)==="[object Number]"&&(t%1!==0||ia.isNegativeZero(t))}T(qU,"isFloat");var NRe=new Ja("tag:yaml.org,2002:float",{kind:"scalar",resolve:FU,construct:zU,predicate:qU,represent:GU,defaultStyle:"lowercase"}),VU=ARe.extend({implicit:[RRe,LRe,IRe,NRe]}),$Re=VU,WU=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),UU=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 HU(t){return t===null?!1:WU.exec(t)!==null||UU.exec(t)!==null}T(HU,"resolveYamlTimestamp");function YU(t){var e,r,n,i,a,s,o,l=0,u=null,h,d,f;if(e=WU.exec(t),e===null&&(e=UU.exec(t)),e===null)throw new Error("Date resolve error");if(r=+e[1],n=+e[2]-1,i=+e[3],!e[4])return new Date(Date.UTC(r,n,i));if(a=+e[4],s=+e[5],o=+e[6],e[7]){for(l=e[7].slice(0,3);l.length<3;)l+="0";l=+l}return e[9]&&(h=+e[10],d=+(e[11]||0),u=(h*60+d)*6e4,e[9]==="-"&&(u=-u)),f=new Date(Date.UTC(r,n,i,a,s,o,l)),u&&f.setTime(f.getTime()-u),f}T(YU,"constructYamlTimestamp");function XU(t){return t.toISOString()}T(XU,"representYamlTimestamp");var ORe=new Ja("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:HU,construct:YU,instanceOf:Date,represent:XU});function jU(t){return t==="<<"||t===null}T(jU,"resolveYamlMerge");var PRe=new Ja("tag:yaml.org,2002:merge",{kind:"scalar",resolve:jU}),IR=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/= +\r`;function KU(t){if(t===null)return!1;var e,r,n=0,i=t.length,a=IR;for(r=0;r64)){if(e<0)return!1;n+=6}return n%8===0}T(KU,"resolveYamlBinary");function ZU(t){var e,r,n=t.replace(/[\r\n=]/g,""),i=n.length,a=IR,s=0,o=[];for(e=0;e>16&255),o.push(s>>8&255),o.push(s&255)),s=s<<6|a.indexOf(n.charAt(e));return r=i%4*6,r===0?(o.push(s>>16&255),o.push(s>>8&255),o.push(s&255)):r===18?(o.push(s>>10&255),o.push(s>>2&255)):r===12&&o.push(s>>4&255),new Uint8Array(o)}T(ZU,"constructYamlBinary");function QU(t){var e="",r=0,n,i,a=t.length,s=IR;for(n=0;n>18&63],e+=s[r>>12&63],e+=s[r>>6&63],e+=s[r&63]),r=(r<<8)+t[n];return i=a%3,i===0?(e+=s[r>>18&63],e+=s[r>>12&63],e+=s[r>>6&63],e+=s[r&63]):i===2?(e+=s[r>>10&63],e+=s[r>>4&63],e+=s[r<<2&63],e+=s[64]):i===1&&(e+=s[r>>2&63],e+=s[r<<4&63],e+=s[64],e+=s[64]),e}T(QU,"representYamlBinary");function JU(t){return Object.prototype.toString.call(t)==="[object Uint8Array]"}T(JU,"isBinary");var BRe=new Ja("tag:yaml.org,2002:binary",{kind:"scalar",resolve:KU,construct:ZU,predicate:JU,represent:QU}),FRe=Object.prototype.hasOwnProperty,zRe=Object.prototype.toString;function eH(t){if(t===null)return!0;var e=[],r,n,i,a,s,o=t;for(r=0,n=o.length;r>10)+55296,(t-65536&1023)+56320)}T(gH,"charFromCodepoint");function $R(t,e,r){e==="__proto__"?Object.defineProperty(t,e,{configurable:!0,enumerable:!0,writable:!0,value:r}):t[e]=r}T($R,"setProperty");var mH=new Array(256),yH=new Array(256);for(cf=0;cf<256;cf++)mH[cf]=NR(cf)?1:0,yH[cf]=NR(cf);var cf;function vH(t,e){this.input=t,this.filename=e.filename||null,this.schema=e.schema||sH,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=[]}T(vH,"State$1");function OR(t,e){var r={name:t.filename,buffer:t.input.slice(0,-1),position:t.position,line:t.line,column:t.position-t.lineStart};return r.snippet=TRe(r),new Xs(e,r)}T(OR,"generateError");function gr(t,e){throw OR(t,e)}T(gr,"throwError");function gx(t,e){t.onWarning&&t.onWarning.call(null,OR(t,e))}T(gx,"throwWarning");var bH={YAML:T(function(e,r,n){var i,a,s;e.version!==null&&gr(e,"duplication of %YAML directive"),n.length!==1&&gr(e,"YAML directive accepts exactly one argument"),i=/^([0-9]+)\.([0-9]+)$/.exec(n[0]),i===null&&gr(e,"ill-formed argument of the YAML directive"),a=parseInt(i[1],10),s=parseInt(i[2],10),a!==1&&gr(e,"unacceptable YAML version of the document"),e.version=n[0],e.checkLineBreaks=s<2,s!==1&&s!==2&&gx(e,"unsupported YAML version of the document")},"handleYamlDirective"),TAG:T(function(e,r,n){var i,a;n.length!==2&&gr(e,"TAG directive accepts exactly two arguments"),i=n[0],a=n[1],uH.test(i)||gr(e,"ill-formed tag handle (first argument) of the TAG directive"),_h.call(e.tagMap,i)&&gr(e,'there is a previously declared suffix for "'+i+'" tag handle'),hH.test(a)||gr(e,"ill-formed tag prefix (second argument) of the TAG directive");try{a=decodeURIComponent(a)}catch{gr(e,"tag prefix is malformed: "+a)}e.tagMap[i]=a},"handleTagDirective")};function lu(t,e,r,n){var i,a,s,o;if(e1&&(t.result+=ia.repeat(` +`,e-1))}T(Lk,"writeFoldedLines");function xH(t,e,r){var n,i,a,s,o,l,u,h,d=t.kind,f=t.result,p;if(p=t.input.charCodeAt(t.position),ps(p)||lf(p)||p===35||p===38||p===42||p===33||p===124||p===62||p===39||p===34||p===37||p===64||p===96||(p===63||p===45)&&(i=t.input.charCodeAt(t.position+1),ps(i)||r&&lf(i)))return!1;for(t.kind="scalar",t.result="",a=s=t.position,o=!1;p!==0;){if(p===58){if(i=t.input.charCodeAt(t.position+1),ps(i)||r&&lf(i))break}else if(p===35){if(n=t.input.charCodeAt(t.position-1),ps(n))break}else{if(t.position===t.lineStart&&mx(t)||r&&lf(p))break;if(ml(p))if(l=t.line,u=t.lineStart,h=t.lineIndent,Mi(t,!1,-1),t.lineIndent>=e){o=!0,p=t.input.charCodeAt(t.position);continue}else{t.position=s,t.line=l,t.lineStart=u,t.lineIndent=h;break}}o&&(lu(t,a,s,!1),Lk(t,t.line-l),a=s=t.position,o=!1),Ah(p)||(s=t.position+1),p=t.input.charCodeAt(++t.position)}return lu(t,a,s,!1),t.result?!0:(t.kind=d,t.result=f,!1)}T(xH,"readPlainScalar");function TH(t,e){var r,n,i;if(r=t.input.charCodeAt(t.position),r!==39)return!1;for(t.kind="scalar",t.result="",t.position++,n=i=t.position;(r=t.input.charCodeAt(t.position))!==0;)if(r===39)if(lu(t,n,t.position,!0),r=t.input.charCodeAt(++t.position),r===39)n=t.position,t.position++,i=t.position;else return!0;else ml(r)?(lu(t,n,i,!0),Lk(t,Mi(t,!1,e)),n=i=t.position):t.position===t.lineStart&&mx(t)?gr(t,"unexpected end of the document within a single quoted scalar"):(t.position++,i=t.position);gr(t,"unexpected end of the stream within a single quoted scalar")}T(TH,"readSingleQuotedScalar");function wH(t,e){var r,n,i,a,s,o;if(o=t.input.charCodeAt(t.position),o!==34)return!1;for(t.kind="scalar",t.result="",t.position++,r=n=t.position;(o=t.input.charCodeAt(t.position))!==0;){if(o===34)return lu(t,r,t.position,!0),t.position++,!0;if(o===92){if(lu(t,r,t.position,!0),o=t.input.charCodeAt(++t.position),ml(o))Mi(t,!1,e);else if(o<256&&mH[o])t.result+=yH[o],t.position++;else if((s=fH(o))>0){for(i=s,a=0;i>0;i--)o=t.input.charCodeAt(++t.position),(s=dH(o))>=0?a=(a<<4)+s:gr(t,"expected hexadecimal character");t.result+=gH(a),t.position++}else gr(t,"unknown escape sequence");r=n=t.position}else ml(o)?(lu(t,r,n,!0),Lk(t,Mi(t,!1,e)),r=n=t.position):t.position===t.lineStart&&mx(t)?gr(t,"unexpected end of the document within a double quoted scalar"):(t.position++,n=t.position)}gr(t,"unexpected end of the stream within a double quoted scalar")}T(wH,"readDoubleQuotedScalar");function CH(t,e){var r=!0,n,i,a,s=t.tag,o,l=t.anchor,u,h,d,f,p,g=Object.create(null),m,y,v,x;if(x=t.input.charCodeAt(t.position),x===91)h=93,p=!1,o=[];else if(x===123)h=125,p=!0,o={};else return!1;for(t.anchor!==null&&(t.anchorMap[t.anchor]=o),x=t.input.charCodeAt(++t.position);x!==0;){if(Mi(t,!0,e),x=t.input.charCodeAt(t.position),x===h)return t.position++,t.tag=s,t.anchor=l,t.kind=p?"mapping":"sequence",t.result=o,!0;r?x===44&&gr(t,"expected the node content, but found ','"):gr(t,"missed comma between flow collection entries"),y=m=v=null,d=f=!1,x===63&&(u=t.input.charCodeAt(t.position+1),ps(u)&&(d=f=!0,t.position++,Mi(t,!0,e))),n=t.line,i=t.lineStart,a=t.position,hf(t,e,_k,!1,!0),y=t.tag,m=t.result,Mi(t,!0,e),x=t.input.charCodeAt(t.position),(f||t.line===n)&&x===58&&(d=!0,x=t.input.charCodeAt(++t.position),Mi(t,!0,e),hf(t,e,_k,!1,!0),v=t.result),p?uf(t,o,g,y,m,v,n,i,a):d?o.push(uf(t,null,g,y,m,v,n,i,a)):o.push(m),Mi(t,!0,e),x=t.input.charCodeAt(t.position),x===44?(r=!0,x=t.input.charCodeAt(++t.position)):r=!1}gr(t,"unexpected end of the stream within a flow collection")}T(CH,"readFlowCollection");function kH(t,e){var r,n,i=DR,a=!1,s=!1,o=e,l=0,u=!1,h,d;if(d=t.input.charCodeAt(t.position),d===124)n=!1;else if(d===62)n=!0;else return!1;for(t.kind="scalar",t.result="";d!==0;)if(d=t.input.charCodeAt(++t.position),d===43||d===45)DR===i?i=d===43?cH:HRe:gr(t,"repeat of a chomping mode identifier");else if((h=pH(d))>=0)h===0?gr(t,"bad explicit indentation width of a block scalar; it cannot be less than one"):s?gr(t,"repeat of an indentation width identifier"):(o=e+h-1,s=!0);else break;if(Ah(d)){do d=t.input.charCodeAt(++t.position);while(Ah(d));if(d===35)do d=t.input.charCodeAt(++t.position);while(!ml(d)&&d!==0)}for(;d!==0;){for(Rk(t),t.lineIndent=0,d=t.input.charCodeAt(t.position);(!s||t.lineIndento&&(o=t.lineIndent),ml(d)){l++;continue}if(t.lineIndente)&&l!==0)gr(t,"bad indentation of a sequence entry");else if(t.lineIndente)&&(y&&(s=t.line,o=t.lineStart,l=t.position),hf(t,e,Ak,!0,i)&&(y?g=t.result:m=t.result),y||(uf(t,d,f,p,g,m,s,o,l),p=g=m=null),Mi(t,!0,-1),x=t.input.charCodeAt(t.position)),(t.line===a||t.lineIndent>e)&&x!==0)gr(t,"bad indentation of a mapping entry");else if(t.lineIndente?l=1:t.lineIndent===e?l=0:t.lineIndente?l=1:t.lineIndent===e?l=0:t.lineIndent tag; it should be "scalar", not "'+t.kind+'"'),d=0,f=t.implicitTypes.length;d"),t.result!==null&&g.kind!==t.kind&&gr(t,"unacceptable node kind for !<"+t.tag+'> tag; it should be "'+g.kind+'", not "'+t.kind+'"'),g.resolve(t.result,t.tag)?(t.result=g.construct(t.result,t.tag),t.anchor!==null&&(t.anchorMap[t.anchor]=t.result)):gr(t,"cannot resolve a node with !<"+t.tag+"> explicit tag")}return t.listener!==null&&t.listener("close",t),t.tag!==null||t.anchor!==null||h}T(hf,"composeNode");function RH(t){var e=t.position,r,n,i,a=!1,s;for(t.version=null,t.checkLineBreaks=t.legacy,t.tagMap=Object.create(null),t.anchorMap=Object.create(null);(s=t.input.charCodeAt(t.position))!==0&&(Mi(t,!0,-1),s=t.input.charCodeAt(t.position),!(t.lineIndent>0||s!==37));){for(a=!0,s=t.input.charCodeAt(++t.position),r=t.position;s!==0&&!ps(s);)s=t.input.charCodeAt(++t.position);for(n=t.input.slice(r,t.position),i=[],n.length<1&&gr(t,"directive name must not be less than one character in length");s!==0;){for(;Ah(s);)s=t.input.charCodeAt(++t.position);if(s===35){do s=t.input.charCodeAt(++t.position);while(s!==0&&!ml(s));break}if(ml(s))break;for(r=t.position;s!==0&&!ps(s);)s=t.input.charCodeAt(++t.position);i.push(t.input.slice(r,t.position))}s!==0&&Rk(t),_h.call(bH,n)?bH[n](t,n,i):gx(t,'unknown document directive "'+n+'"')}if(Mi(t,!0,-1),t.lineIndent===0&&t.input.charCodeAt(t.position)===45&&t.input.charCodeAt(t.position+1)===45&&t.input.charCodeAt(t.position+2)===45?(t.position+=3,Mi(t,!0,-1)):a&&gr(t,"directives end mark is expected"),hf(t,t.lineIndent-1,Ak,!1,!0),Mi(t,!0,-1),t.checkLineBreaks&&XRe.test(t.input.slice(e,t.position))&&gx(t,"non-ASCII line breaks are interpreted as content"),t.documents.push(t.result),t.position===t.lineStart&&mx(t)){t.input.charCodeAt(t.position)===46&&(t.position+=3,Mi(t,!0,-1));return}if(t.position"u"&&(r=e,e=null);var n=FR(t,r);if(typeof e!="function")return n;for(var i=0,a=n.length;i=55296&&r<=56319&&e+1=56320&&n<=57343)?(r-55296)*1024+n-56320+65536:r}x(z0,"codePointAt");function HA(t){var e=/^\n* /;return e.test(t)}x(HA,"needIndentIndicator");var gq=1,YA=2,mq=3,yq=4,G0=5;function vq(t,e,r,n,i,a,s,o){var l,u=0,h=null,d=!1,f=!1,p=n!==-1,g=-1,m=fq(z0(t,0))&&pq(z0(t,t.length-1));if(e||s)for(l=0;l=65536?l+=2:l++){if(u=z0(t,l),!F0(u))return G0;m=m&&UA(u,h,o),h=u}else{for(l=0;l=65536?l+=2:l++){if(u=z0(t,l),u===B2)d=!0,p&&(f=f||l-g-1>n&&t[g+1]!==" ",g=l);else if(!F0(u))return G0;m=m&&UA(u,h,o),h=u}f=f||p&&l-g-1>n&&t[g+1]!==" "}return!d&&!f?m&&!s&&!i(t)?gq:a===F2?G0:YA:r>9&&HA(t)?G0:s?a===F2?G0:YA:f?yq:mq}x(vq,"chooseScalarStyle");function bq(t,e,r,n,i){t.dump=(function(){if(e.length===0)return t.quotingType===F2?'""':"''";if(!t.noCompatMode&&(Qke.indexOf(e)!==-1||Jke.test(e)))return t.quotingType===F2?'"'+e+'"':"'"+e+"'";var a=t.indent*Math.max(1,r),s=t.lineWidth===-1?-1:Math.max(Math.min(t.lineWidth,40),t.lineWidth-a),o=n||t.flowLevel>-1&&r>=t.flowLevel;function l(u){return dq(t,u)}switch(x(l,"testAmbiguity"),vq(e,o,t.indent,s,l,t.quotingType,t.forceQuotes&&!n,i)){case gq:return e;case YA:return"'"+e.replace(/'/g,"''")+"'";case mq:return"|"+XA(e,t.indent)+KA(VA(e,a));case yq:return">"+XA(e,t.indent)+KA(VA(xq(e,s),a));case G0:return'"'+Tq(e)+'"';default:throw new vs("impossible error: invalid scalar style")}})()}x(bq,"writeScalar");function XA(t,e){var r=HA(t)?String(e):"",n=t[t.length-1]===` +`&&(a+=r),a+=s;return a}T(qR,"indentString");function Dk(t,e){return` +`+ia.repeat(" ",t.indent*e)}T(Dk,"generateNextLine");function GH(t,e){var r,n,i;for(r=0,n=t.implicitTypes.length;r=55296&&r<=56319&&e+1=56320&&n<=57343)?(r-55296)*1024+n-56320+65536:r}T(rg,"codePointAt");function UR(t){var e=/^\n* /;return e.test(t)}T(UR,"needIndentIndicator");var WH=1,HR=2,UH=3,HH=4,ng=5;function YH(t,e,r,n,i,a,s,o){var l,u=0,h=null,d=!1,f=!1,p=n!==-1,g=-1,m=qH(rg(t,0))&&VH(rg(t,t.length-1));if(e||s)for(l=0;l=65536?l+=2:l++){if(u=rg(t,l),!tg(u))return ng;m=m&&WR(u,h,o),h=u}else{for(l=0;l=65536?l+=2:l++){if(u=rg(t,l),u===yx)d=!0,p&&(f=f||l-g-1>n&&t[g+1]!==" ",g=l);else if(!tg(u))return ng;m=m&&WR(u,h,o),h=u}f=f||p&&l-g-1>n&&t[g+1]!==" "}return!d&&!f?m&&!s&&!i(t)?WH:a===vx?ng:HR:r>9&&UR(t)?ng:s?a===vx?ng:HR:f?HH:UH}T(YH,"chooseScalarStyle");function XH(t,e,r,n,i){t.dump=(function(){if(e.length===0)return t.quotingType===vx?'""':"''";if(!t.noCompatMode&&(g8e.indexOf(e)!==-1||m8e.test(e)))return t.quotingType===vx?'"'+e+'"':"'"+e+"'";var a=t.indent*Math.max(1,r),s=t.lineWidth===-1?-1:Math.max(Math.min(t.lineWidth,40),t.lineWidth-a),o=n||t.flowLevel>-1&&r>=t.flowLevel;function l(u){return GH(t,u)}switch(T(l,"testAmbiguity"),YH(e,o,t.indent,s,l,t.quotingType,t.forceQuotes&&!n,i)){case WH:return e;case HR:return"'"+e.replace(/'/g,"''")+"'";case UH:return"|"+YR(e,t.indent)+XR(qR(e,a));case HH:return">"+YR(e,t.indent)+XR(qR(jH(e,s),a));case ng:return'"'+KH(e)+'"';default:throw new Xs("impossible error: invalid scalar style")}})()}T(XH,"writeScalar");function YR(t,e){var r=UR(t)?String(e):"",n=t[t.length-1]===` `,i=n&&(t[t.length-2]===` `||t===` `),a=i?"+":n?"":"-";return r+a+` -`}x(XA,"blockHeader");function KA(t){return t[t.length-1]===` -`?t.slice(0,-1):t}x(KA,"dropEndingNewline");function xq(t,e){for(var r=/(\n+)([^\n]*)/g,n=(function(){var u=t.indexOf(` -`);return u=u!==-1?u:t.length,r.lastIndex=u,jA(t.slice(0,u),e)})(),i=t[0]===` +`}T(YR,"blockHeader");function XR(t){return t[t.length-1]===` +`?t.slice(0,-1):t}T(XR,"dropEndingNewline");function jH(t,e){for(var r=/(\n+)([^\n]*)/g,n=(function(){var u=t.indexOf(` +`);return u=u!==-1?u:t.length,r.lastIndex=u,jR(t.slice(0,u),e)})(),i=t[0]===` `||t[0]===" ",a,s;s=r.exec(t);){var o=s[1],l=s[2];a=l[0]===" ",n+=o+(!i&&!a&&l!==""?` -`:"")+jA(l,e),i=a}return n}x(xq,"foldString");function jA(t,e){if(t===""||t[0]===" ")return t;for(var r=/ [^ ]/g,n,i=0,a,s=0,o=0,l="";n=r.exec(t);)o=n.index,o-i>e&&(a=s>i?s:o,l+=` +`:"")+jR(l,e),i=a}return n}T(jH,"foldString");function jR(t,e){if(t===""||t[0]===" ")return t;for(var r=/ [^ ]/g,n,i=0,a,s=0,o=0,l="";n=r.exec(t);)o=n.index,o-i>e&&(a=s>i?s:o,l+=` `+t.slice(i,a),i=a+1),s=o;return l+=` `,t.length-i>e&&s>i?l+=t.slice(i,s)+` -`+t.slice(s+1):l+=t.slice(i),l.slice(1)}x(jA,"foldLine");function Tq(t){for(var e="",r=0,n,i=0;i=65536?i+=2:i++)r=z0(t,i),n=Ra[r],!n&&F0(r)?(e+=t[i],r>=65536&&(e+=t[i+1])):e+=n||uq(r);return e}x(Tq,"escapeString");function wq(t,e,r){var n="",i=t.tag,a,s,o;for(a=0,s=r.length;a"u"&&ml(t,e,null,!1,!1))&&(n!==""&&(n+=","+(t.condenseFlow?"":" ")),n+=t.dump);t.tag=i,t.dump="["+n+"]"}x(wq,"writeFlowSequence");function ZA(t,e,r,n){var i="",a=t.tag,s,o,l;for(s=0,o=r.length;s"u"&&ml(t,e+1,null,!0,!0,!1,!0))&&((!n||i!=="")&&(i+=E4(t,e)),t.dump&&B2===t.dump.charCodeAt(0)?i+="-":i+="- ",i+=t.dump);t.tag=a,t.dump=i||"[]"}x(ZA,"writeBlockSequence");function Cq(t,e,r){var n="",i=t.tag,a=Object.keys(r),s,o,l,u,h;for(s=0,o=a.length;s1024&&(h+="? "),h+=t.dump+(t.condenseFlow?'"':"")+":"+(t.condenseFlow?"":" "),ml(t,e,u,!1,!1)&&(h+=t.dump,n+=h));t.tag=i,t.dump="{"+n+"}"}x(Cq,"writeFlowMapping");function kq(t,e,r,n){var i="",a=t.tag,s=Object.keys(r),o,l,u,h,d,f;if(t.sortKeys===!0)s.sort();else if(typeof t.sortKeys=="function")s.sort(t.sortKeys);else if(t.sortKeys)throw new vs("sortKeys must be a boolean or a function");for(o=0,l=s.length;o1024,d&&(t.dump&&B2===t.dump.charCodeAt(0)?f+="?":f+="? "),f+=t.dump,d&&(f+=E4(t,e)),ml(t,e+1,h,!0,d)&&(t.dump&&B2===t.dump.charCodeAt(0)?f+=":":f+=": ",f+=t.dump,i+=f));t.tag=a,t.dump=i||"{}"}x(kq,"writeBlockMapping");function QA(t,e,r){var n,i,a,s,o,l;for(i=r?t.explicitTypes:t.implicitTypes,a=0,s=i.length;a tag resolver accepts not "'+l+'" style');t.dump=n}return!0}return!1}x(QA,"detectType");function ml(t,e,r,n,i,a,s){t.tag=null,t.dump=r,QA(t,r,!1)||QA(t,r,!0);var o=rq.call(t.dump),l=n,u;n&&(n=t.flowLevel<0||t.flowLevel>e);var h=o==="[object Object]"||o==="[object Array]",d,f;if(h&&(d=t.duplicates.indexOf(r),f=d!==-1),(t.tag!==null&&t.tag!=="?"||f||t.indent!==2&&e>0)&&(i=!1),f&&t.usedDuplicates[d])t.dump="*ref_"+d;else{if(h&&f&&!t.usedDuplicates[d]&&(t.usedDuplicates[d]=!0),o==="[object Object]")n&&Object.keys(t.dump).length!==0?(kq(t,e,t.dump,i),f&&(t.dump="&ref_"+d+t.dump)):(Cq(t,e,t.dump),f&&(t.dump="&ref_"+d+" "+t.dump));else if(o==="[object Array]")n&&t.dump.length!==0?(t.noArrayIndent&&!s&&e>0?ZA(t,e-1,t.dump,i):ZA(t,e,t.dump,i),f&&(t.dump="&ref_"+d+t.dump)):(wq(t,e,t.dump),f&&(t.dump="&ref_"+d+" "+t.dump));else if(o==="[object String]")t.tag!=="?"&&bq(t,t.dump,e,a,l);else{if(o==="[object Undefined]")return!1;if(t.skipInvalid)return!1;throw new vs("unacceptable kind of an object to dump "+o)}t.tag!==null&&t.tag!=="?"&&(u=encodeURI(t.tag[0]==="!"?t.tag.slice(1):t.tag).replace(/!/g,"%21"),t.tag[0]==="!"?u="!"+u:u.slice(0,18)==="tag:yaml.org,2002:"?u="!!"+u.slice(18):u="!<"+u+">",t.dump=u+" "+t.dump)}return!0}x(ml,"writeNode");function Eq(t,e){var r=[],n=[],i,a;for(S4(t,r,n),i=0,a=n.length;i=65536?i+=2:i++)r=rg(t,i),n=es[r],!n&&tg(r)?(e+=t[i],r>=65536&&(e+=t[i+1])):e+=n||FH(r);return e}T(KH,"escapeString");function ZH(t,e,r){var n="",i=t.tag,a,s,o;for(a=0,s=r.length;a"u"&&rc(t,e,null,!1,!1))&&(n!==""&&(n+=","+(t.condenseFlow?"":" ")),n+=t.dump);t.tag=i,t.dump="["+n+"]"}T(ZH,"writeFlowSequence");function KR(t,e,r,n){var i="",a=t.tag,s,o,l;for(s=0,o=r.length;s"u"&&rc(t,e+1,null,!0,!0,!1,!0))&&((!n||i!=="")&&(i+=Dk(t,e)),t.dump&&yx===t.dump.charCodeAt(0)?i+="-":i+="- ",i+=t.dump);t.tag=a,t.dump=i||"[]"}T(KR,"writeBlockSequence");function QH(t,e,r){var n="",i=t.tag,a=Object.keys(r),s,o,l,u,h;for(s=0,o=a.length;s1024&&(h+="? "),h+=t.dump+(t.condenseFlow?'"':"")+":"+(t.condenseFlow?"":" "),rc(t,e,u,!1,!1)&&(h+=t.dump,n+=h));t.tag=i,t.dump="{"+n+"}"}T(QH,"writeFlowMapping");function JH(t,e,r,n){var i="",a=t.tag,s=Object.keys(r),o,l,u,h,d,f;if(t.sortKeys===!0)s.sort();else if(typeof t.sortKeys=="function")s.sort(t.sortKeys);else if(t.sortKeys)throw new Xs("sortKeys must be a boolean or a function");for(o=0,l=s.length;o1024,d&&(t.dump&&yx===t.dump.charCodeAt(0)?f+="?":f+="? "),f+=t.dump,d&&(f+=Dk(t,e)),rc(t,e+1,h,!0,d)&&(t.dump&&yx===t.dump.charCodeAt(0)?f+=":":f+=": ",f+=t.dump,i+=f));t.tag=a,t.dump=i||"{}"}T(JH,"writeBlockMapping");function ZR(t,e,r){var n,i,a,s,o,l;for(i=r?t.explicitTypes:t.implicitTypes,a=0,s=i.length;a tag resolver accepts not "'+l+'" style');t.dump=n}return!0}return!1}T(ZR,"detectType");function rc(t,e,r,n,i,a,s){t.tag=null,t.dump=r,ZR(t,r,!1)||ZR(t,r,!0);var o=IH.call(t.dump),l=n,u;n&&(n=t.flowLevel<0||t.flowLevel>e);var h=o==="[object Object]"||o==="[object Array]",d,f;if(h&&(d=t.duplicates.indexOf(r),f=d!==-1),(t.tag!==null&&t.tag!=="?"||f||t.indent!==2&&e>0)&&(i=!1),f&&t.usedDuplicates[d])t.dump="*ref_"+d;else{if(h&&f&&!t.usedDuplicates[d]&&(t.usedDuplicates[d]=!0),o==="[object Object]")n&&Object.keys(t.dump).length!==0?(JH(t,e,t.dump,i),f&&(t.dump="&ref_"+d+t.dump)):(QH(t,e,t.dump),f&&(t.dump="&ref_"+d+" "+t.dump));else if(o==="[object Array]")n&&t.dump.length!==0?(t.noArrayIndent&&!s&&e>0?KR(t,e-1,t.dump,i):KR(t,e,t.dump,i),f&&(t.dump="&ref_"+d+t.dump)):(ZH(t,e,t.dump),f&&(t.dump="&ref_"+d+" "+t.dump));else if(o==="[object String]")t.tag!=="?"&&XH(t,t.dump,e,a,l);else{if(o==="[object Undefined]")return!1;if(t.skipInvalid)return!1;throw new Xs("unacceptable kind of an object to dump "+o)}t.tag!==null&&t.tag!=="?"&&(u=encodeURI(t.tag[0]==="!"?t.tag.slice(1):t.tag).replace(/!/g,"%21"),t.tag[0]==="!"?u="!"+u:u.slice(0,18)==="tag:yaml.org,2002:"?u="!!"+u.slice(18):u="!<"+u+">",t.dump=u+" "+t.dump)}return!0}T(rc,"writeNode");function eY(t,e){var r=[],n=[],i,a;for(Mk(t,r,n),i=0,a=n.length;i{if(e)return"translate("+-t.width/2+", "+-t.height/2+")";const r=t.x??0,n=t.y??0;return"translate("+-(r+t.width/2)+", "+-(n+t.height/2)+")"},"computeLabelTransform"),La={aggregation:17.25,extension:17.25,composition:17.25,dependency:6,lollipop:13.5,arrow_point:4,arrow_barb:0,arrow_barb_neo:5.5},Sq={arrow_point:4,arrow_cross:12.5,arrow_circle:12.5};function G2(t,e){if(t===void 0||e===void 0)return{angle:0,deltaX:0,deltaY:0};t=Vn(t),e=Vn(e);const[r,n]=[t.x,t.y],[i,a]=[e.x,e.y],s=i-r,o=a-n;return{angle:Math.atan(o/s),deltaX:s,deltaY:o}}x(G2,"calculateDeltaAndAngle");var Vn=x(t=>Array.isArray(t)?{x:t[0],y:t[1]}:t,"pointTransformer"),Aq=x(t=>({x:x(function(e,r,n){let i=0;const a=Vn(n[0]).x=0?1:-1)}else if(r===n.length-1&&Object.hasOwn(La,t.arrowTypeEnd)){const{angle:p,deltaX:g}=G2(n[n.length-1],n[n.length-2]);i=La[t.arrowTypeEnd]*Math.cos(p)*(g>=0?1:-1)}const s=Math.abs(Vn(e).x-Vn(n[n.length-1]).x),o=Math.abs(Vn(e).y-Vn(n[n.length-1]).y),l=Math.abs(Vn(e).x-Vn(n[0]).x),u=Math.abs(Vn(e).y-Vn(n[0]).y),h=La[t.arrowTypeStart],d=La[t.arrowTypeEnd],f=1;if(s0&&o0&&u=0?1:-1)}else if(r===n.length-1&&Object.hasOwn(La,t.arrowTypeEnd)){const{angle:p,deltaY:g}=G2(n[n.length-1],n[n.length-2]);i=La[t.arrowTypeEnd]*Math.abs(Math.sin(p))*(g>=0?1:-1)}const s=Math.abs(Vn(e).y-Vn(n[n.length-1]).y),o=Math.abs(Vn(e).x-Vn(n[n.length-1]).x),l=Math.abs(Vn(e).y-Vn(n[0]).y),u=Math.abs(Vn(e).x-Vn(n[0]).x),h=La[t.arrowTypeStart],d=La[t.arrowTypeEnd],f=1;if(s0&&o0&&u-1}function r(s){var o=s.replace(t.ctrlCharactersRegex,"");return o.replace(t.htmlEntitiesRegex,function(l,u){return String.fromCharCode(u)})}function n(s){return URL.canParse(s)}function i(s){try{return decodeURIComponent(s)}catch{return s}}function a(s){if(!s)return t.BLANK_URL;var o,l=i(s.trim());do l=r(l).replace(t.htmlCtrlEntityRegex,"").replace(t.ctrlCharactersRegex,"").replace(t.whitespaceEscapeCharsRegex,"").trim(),l=i(l),o=l.match(t.ctrlCharactersRegex)||l.match(t.htmlEntitiesRegex)||l.match(t.htmlCtrlEntityRegex)||l.match(t.whitespaceEscapeCharsRegex);while(o&&o.length>0);var u=l;if(!u)return t.BLANK_URL;if(e(u))return u;var h=u.trimStart(),d=h.match(t.urlSchemeRegex);if(!d)return u;var f=d[0].toLowerCase().trim();if(t.invalidProtocolRegex.test(f))return t.BLANK_URL;var p=h.replace(/\\/g,"/");if(f==="mailto:"||f.includes("://"))return p;if(f==="http:"||f==="https:"){if(!n(p))return t.BLANK_URL;var g=new URL(p);return g.protocol=g.protocol.toLowerCase(),g.hostname=g.hostname.toLowerCase(),g.toString()}return p}return R4}var cd=iEe();function aEe(t){return Array.isArray(t)}function JA(t){var r;if(typeof t!="object"||t==null)return!1;if(Object.getPrototypeOf(t)===null)return!0;if(Object.prototype.toString.call(t)!=="[object Object]"){const n=t[Symbol.toStringTag];return n==null||!((r=Object.getOwnPropertyDescriptor(t,Symbol.toStringTag))!=null&&r.writable)?!1:t.toString()===`[object ${n}]`}let e=t;for(;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}function sEe(){}function Lq(t){return Object.getOwnPropertySymbols(t).filter(e=>Object.prototype.propertyIsEnumerable.call(t,e))}function q2(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}const Iq="[object RegExp]",e_="[object String]",t_="[object Number]",r_="[object Boolean]",n_="[object Arguments]",Dq="[object Symbol]",Mq="[object Date]",Nq="[object Map]",Oq="[object Set]",$q="[object Array]",Pq="[object ArrayBuffer]",Bq="[object Object]",Fq="[object DataView]",zq="[object Uint8Array]",Gq="[object Uint8ClampedArray]",qq="[object Uint16Array]",Vq="[object Uint32Array]",Wq="[object Int8Array]",Uq="[object Int16Array]",Hq="[object Int32Array]",Yq="[object Float32Array]",Xq="[object Float64Array]",Kq=typeof globalThis=="object"&&globalThis||typeof window=="object"&&window||typeof self=="object"&&self||typeof global=="object"&&global||(function(){return this})();function i_(t){return typeof Kq.Buffer<"u"&&Kq.Buffer.isBuffer(t)}function oEe(t){return Number.isSafeInteger(t)&&t>=0}function jq(t){return t!=null&&typeof t!="function"&&oEe(t.length)}function lEe(t){return t==="__proto__"}function L4(t){return t==null||typeof t!="object"&&typeof t!="function"}function a_(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function cEe(t,e){return q0(t,void 0,t,new Map,e)}function q0(t,e,r,n=new Map,i=void 0){const a=i==null?void 0:i(t,e,r,n);if(a!==void 0)return a;if(L4(t))return t;if(n.has(t))return n.get(t);if(Array.isArray(t)){const s=new Array(t.length);n.set(t,s);for(let o=0;o{if(typeof t=="object"){if(q2(t)==="[object Object]"&&typeof t.constructor!="function"){const s={};return a.set(t,s),Do(s,t,i,a),s}switch(Object.prototype.toString.call(t)){case t_:case e_:case r_:{const s=new t.constructor(t==null?void 0:t.valueOf());return Do(s,t),s}case n_:{const s={};return Do(s,t),s.length=t.length,s[Symbol.iterator]=t[Symbol.iterator],s}default:return}}})}function Zq(t){return hEe(t)}function s_(t){return t!==null&&typeof t=="object"&&q2(t)==="[object Arguments]"}function o_(t){return typeof t=="object"&&t!==null}function dEe(t){return o_(t)&&jq(t)}function V2(t){return a_(t)}function fEe(t){const e=t==null?void 0:t.constructor;return t===(typeof e=="function"?e.prototype:Object.prototype)}function W2(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError("Expected a function");const r=function(...n){const i=e?e.apply(this,n):n[0],a=r.cache;if(a.has(i))return a.get(i);const s=t.apply(this,n);return r.cache=a.set(i,s)||a,s};return r.cache=new(W2.Cache||Map),r}W2.Cache=Map;function pEe(t){if(L4(t))return t;const e=q2(t);if(!gEe(t))return{};if(aEe(t)){const n=Array.from(t);return t.length>0&&typeof t[0]=="string"&&Object.hasOwn(t,"index")&&(n.index=t.index,n.input=t.input),n}if(V2(t)){const n=t,i=n.constructor;return new i(n.buffer,n.byteOffset,n.length)}if(e==="[object ArrayBuffer]")return new ArrayBuffer(t.byteLength);if(e==="[object DataView]"){const n=t,i=n.buffer,a=n.byteOffset,s=n.byteLength,o=new ArrayBuffer(s),l=new Uint8Array(i,a,s);return new Uint8Array(o).set(l),new DataView(o)}if(e==="[object Boolean]"||e==="[object Number]"||e==="[object String]"){const n=t.constructor,i=new n(t.valueOf());return e==="[object String]"?yEe(i,t):l_(i,t),i}if(e==="[object Date]")return new Date(Number(t));if(e==="[object RegExp]"){const n=t,i=new RegExp(n.source,n.flags);return i.lastIndex=n.lastIndex,i}if(e==="[object Symbol]")return Object(Symbol.prototype.valueOf.call(t));if(e==="[object Map]"){const n=t,i=new Map;return n.forEach((a,s)=>{i.set(s,a)}),i}if(e==="[object Set]"){const n=t,i=new Set;return n.forEach(a=>{i.add(a)}),i}if(e==="[object Arguments]"){const n=t,i={};return l_(i,n),i.length=n.length,i[Symbol.iterator]=n[Symbol.iterator],i}const r={};return vEe(r,t),l_(r,t),mEe(r,t),r}function gEe(t){switch(q2(t)){case n_:case $q:case Pq:case Fq:case r_:case Mq:case Yq:case Xq:case Wq:case Uq:case Hq:case Nq:case t_:case Bq:case Iq:case Oq:case e_:case Dq:case zq:case Gq:case qq:case Vq:return!0;default:return!1}}function l_(t,e){for(const r in e)Object.hasOwn(e,r)&&(t[r]=e[r])}function mEe(t,e){const r=Object.getOwnPropertySymbols(e);for(let n=0;n=r)&&(t[n]=e[n])}function vEe(t,e){const r=Object.getPrototypeOf(e);r!==null&&typeof e.constructor=="function"&&Object.setPrototypeOf(t,r)}function bEe(t){if(L4(t))return t;if(Array.isArray(t)||a_(t)||t instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&t instanceof SharedArrayBuffer)return t.slice(0);const e=Object.getPrototypeOf(t);if(e==null)return Object.assign(Object.create(e),t);const r=e.constructor;if(t instanceof Date||t instanceof Map||t instanceof Set)return new r(t);if(t instanceof RegExp){const n=new r(t);return n.lastIndex=t.lastIndex,n}if(t instanceof DataView)return new r(t.buffer.slice(0));if(t instanceof Error){let n;return t instanceof AggregateError?n=new r(t.errors,t.message,{cause:t.cause}):n=new r(t.message,{cause:t.cause}),n.stack=t.stack,Object.assign(n,t),n}return typeof File<"u"&&t instanceof File?new r([t],t.name,{type:t.type,lastModified:t.lastModified}):typeof t=="object"?Object.assign(Object.create(e),t):t}function xEe(t,...e){const r=e.slice(0,-1),n=e[e.length-1];let i=t;for(let a=0;ar!=="constructor").length===0:e.length===0}return!0}var Jq="​",wEe={curveBasis:N2,curveBasisClosed:W3e,curveBasisOpen:U3e,curveBumpX:bz,curveBumpY:xz,curveBundle:H3e,curveCardinalClosed:Y3e,curveCardinalOpen:X3e,curveCardinal:kz,curveCatmullRomClosed:K3e,curveCatmullRomOpen:j3e,curveCatmullRom:Sz,curveLinear:D2,curveLinearClosed:Z3e,curveMonotoneX:Oz,curveMonotoneY:$z,curveNatural:Fz,curveStep:zz,curveStepAfter:qz,curveStepBefore:Gz},CEe=/\s*(?:(\w+)(?=:):|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,kEe=x(function(t,e){const r=eV(t,/(?:init\b)|(?:initialize\b)/);let n={};if(Array.isArray(r)){const s=r.map(o=>o.args);Cw(s),n=ci(n,[...s])}else n=r.args;if(!n)return;let i=k6(t,e);const a="config";return n[a]!==void 0&&(i==="flowchart-v2"&&(i="flowchart"),n[i]=n[a],delete n[a]),n},"detectInit"),eV=x(function(t,e=null){var r,n;try{const i=new RegExp(`[%]{2}(?![{]${CEe.source})(?=[}][%]{2}).* -`,"ig");t=t.trim().replace(i,"").replace(/'/gm,'"'),ae.debug(`Detecting diagram directive${e!==null?" type:"+e:""} based on the text:${t}`);let a;const s=[];for(;(a=c2.exec(t))!==null;)if(a.index===c2.lastIndex&&c2.lastIndex++,a&&!e||e&&((r=a[1])!=null&&r.match(e))||e&&((n=a[2])!=null&&n.match(e))){const o=a[1]?a[1]:a[2],l=a[3]?a[3].trim():a[4]?JSON.parse(a[4].trim()):null;s.push({type:o,args:l})}return s.length===0?{type:t,args:null}:s.length===1?s[0]:s}catch(i){return ae.error(`ERROR: ${i.message} - Unable to parse directive type: '${e}' based on the text: '${t}'`),{type:void 0,args:null}}},"detectDirective"),EEe=x(function(t){return t.replace(c2,"")},"removeDirectives"),SEe=x(function(t,e){for(const[r,n]of e.entries())if(n.match(t))return r;return-1},"isSubstringInArray");function c_(t,e){if(!t)return e;const r=`curve${t.charAt(0).toUpperCase()+t.slice(1)}`;return wEe[r]??e}x(c_,"interpolateToCurve");function tV(t,e){const r=t.trim();if(r)return e.securityLevel!=="loose"?cd.sanitizeUrl(r):r}x(tV,"formatUrl");var AEe=x((t,...e)=>{const r=t.split("."),n=r.length-1,i=r[n];let a=window;for(let s=0;s{r+=u_(i,e),e=i});const n=r/2;return h_(t,n)}x(rV,"traverseEdge");function nV(t){return t.length===1?t[0]:rV(t)}x(nV,"calcLabelPosition");var iV=x((t,e=2)=>{const r=Math.pow(10,e);return Math.round(t*r)/r},"roundNumber"),h_=x((t,e)=>{let r,n=e;for(const i of t){if(r){const a=u_(i,r);if(a===0)return r;if(a=1)return{x:i.x,y:i.y};if(s>0&&s<1)return{x:iV((1-s)*r.x+s*i.x,5),y:iV((1-s)*r.y+s*i.y,5)}}}r=i}throw new Error("Could not find a suitable point for the given distance")},"calculatePoint"),_Ee=x((t,e,r)=>{ae.info(`our points ${JSON.stringify(e)}`),e[0]!==r&&(e=e.reverse());const i=h_(e,25),a=t?10:5,s=Math.atan2(e[0].y-i.y,e[0].x-i.x),o={x:0,y:0};return o.x=Math.sin(s)*a+(e[0].x+i.x)/2,o.y=-Math.cos(s)*a+(e[0].y+i.y)/2,o},"calcCardinalityPosition");function aV(t,e,r){const n=structuredClone(r);ae.info("our points",n),e!=="start_left"&&e!=="start_right"&&n.reverse();const i=25+t,a=h_(n,i),s=10+t*.5,o=Math.atan2(n[0].y-a.y,n[0].x-a.x),l={x:0,y:0};return e==="start_left"?(l.x=Math.sin(o+Math.PI)*s+(n[0].x+a.x)/2,l.y=-Math.cos(o+Math.PI)*s+(n[0].y+a.y)/2):e==="end_right"?(l.x=Math.sin(o-Math.PI)*s+(n[0].x+a.x)/2-5,l.y=-Math.cos(o-Math.PI)*s+(n[0].y+a.y)/2-5):e==="end_left"?(l.x=Math.sin(o)*s+(n[0].x+a.x)/2-5,l.y=-Math.cos(o)*s+(n[0].y+a.y)/2-5):(l.x=Math.sin(o)*s+(n[0].x+a.x)/2,l.y=-Math.cos(o)*s+(n[0].y+a.y)/2),l}x(aV,"calcTerminalLabelPosition");function d_(t){let e="",r="";for(const n of t)n!==void 0&&(n.startsWith("color:")||n.startsWith("text-align:")?r=r+n+";":e=e+n+";");return{style:e,labelStyle:r}}x(d_,"getStylesFromArray");var sV=0,oV=x(()=>(sV++,"id-"+Math.random().toString(36).substr(2,12)+"-"+sV),"generateId");function lV(t){let e="";const r="0123456789abcdef",n=r.length;for(let i=0;ilV(t.length),"random"),REe=x(function(){return{x:0,y:0,fill:void 0,anchor:"start",style:"#666",width:100,height:100,textMargin:0,rx:0,ry:0,valign:void 0,text:""}},"getTextObj"),LEe=x(function(t,e){const r=e.text.replace(Lt.lineBreakRegex," "),[,n]=xc(e.fontSize),i=t.append("text");i.attr("x",e.x),i.attr("y",e.y),i.style("text-anchor",e.anchor),i.style("font-family",e.fontFamily),i.style("font-size",n),i.style("font-weight",e.fontWeight),i.attr("fill",e.fill),e.class!==void 0&&i.attr("class",e.class);const a=i.append("tspan");return a.attr("x",e.x+e.textMargin*2),a.attr("fill",e.fill),a.text(r),i},"drawSimpleText"),U2=W2((t,e,r)=>{if(!t||(r=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",joinWith:"
"},r),Lt.lineBreakRegex.test(t)))return t;const n=t.split(" ").filter(Boolean),i=[];let a="";return n.forEach((s,o)=>{const l=qa(`${s} `,r),u=qa(a,r);if(l>e){const{hyphenatedStrings:f,remainingWord:p}=IEe(s,e,"-",r);i.push(a,...f),a=p}else u+l>=e?(i.push(a),a=s):a=[a,s].filter(Boolean).join(" ");o+1===n.length&&i.push(a)}),i.filter(s=>s!=="").join(r.joinWith)},(t,e,r)=>`${t}${e}${r.fontSize}${r.fontWeight}${r.fontFamily}${r.joinWith}`),IEe=W2((t,e,r="-",n)=>{n=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",margin:0},n);const i=[...t],a=[];let s="";return i.forEach((o,l)=>{const u=`${s}${o}`;if(qa(u,n)>=e){const d=l+1,f=i.length===d,p=`${u}${r}`;a.push(f?u:p),s=""}else s=u}),{hyphenatedStrings:a,remainingWord:s}},(t,e,r="-",n)=>`${t}${e}${r}${n.fontSize}${n.fontWeight}${n.fontFamily}`);function D4(t,e){return M4(t,e).height}x(D4,"calculateTextHeight");function qa(t,e){return M4(t,e).width}x(qa,"calculateTextWidth");var M4=W2((t,e)=>{const{fontSize:r=12,fontFamily:n="Arial",fontWeight:i=400}=e;if(!t)return{width:0,height:0};const[,a]=xc(r),s=["sans-serif",n],o=t.split(Lt.lineBreakRegex),l=[],u=pt("body");if(!u.remove)return{width:0,height:0,lineHeight:0};const h=u.append("svg");for(const f of s){let p=0;const g={width:0,height:0,lineHeight:0};for(const m of o){const y=REe();y.text=m||Jq;const v=LEe(h,y).style("font-size",a).style("font-weight",i).style("font-family",f),T=(v._groups||v)[0][0].getBBox();if(T.width===0&&T.height===0)throw new Error("svg element not in render tree");g.width=Math.round(Math.max(g.width,T.width)),p=Math.round(T.height),g.height+=p,g.lineHeight=Math.round(Math.max(g.lineHeight,p))}l.push(g)}h.remove();const d=isNaN(l[1].height)||isNaN(l[1].width)||isNaN(l[1].lineHeight)||l[0].height>l[1].height&&l[0].width>l[1].width&&l[0].lineHeight>l[1].lineHeight?0:1;return l[d]},(t,e)=>`${t}${e.fontSize}${e.fontWeight}${e.fontFamily}`),DEe=(_m=class{constructor(e=!1,r){this.count=0,this.count=r?r.length:0,this.next=e?()=>this.count++:()=>Date.now()}},x(_m,"InitIDGenerator"),_m),N4,MEe=x(function(t){return N4=N4||document.createElement("div"),t=escape(t).replace(/%26/g,"&").replace(/%23/g,"#").replace(/%3B/g,";"),N4.innerHTML=t,unescape(N4.textContent)},"entityDecode");function f_(t){return"str"in t}x(f_,"isDetailedError");var NEe=x((t,e,r,n)=>{var a;if(!n)return;const i=(a=t.node())==null?void 0:a.getBBox();i&&t.append("text").text(n).attr("text-anchor","middle").attr("x",i.x+i.width/2).attr("y",-r).attr("class",e)},"insertTitle"),xc=x(t=>{if(typeof t=="number")return[t,t+"px"];const e=parseInt(t??"",10);return Number.isNaN(e)?[void 0,void 0]:t===String(e)?[e,t+"px"]:[e,t]},"parseFontSize");function ti(t,e){return TEe({},t,e)}x(ti,"cleanAndMerge");var Lr={assignWithDepth:ci,wrapLabel:U2,calculateTextHeight:D4,calculateTextWidth:qa,calculateTextDimensions:M4,cleanAndMerge:ti,detectInit:kEe,detectDirective:eV,isSubstringInArray:SEe,interpolateToCurve:c_,calcLabelPosition:nV,calcCardinalityPosition:_Ee,calcTerminalLabelPosition:aV,formatUrl:tV,getStylesFromArray:d_,generateId:oV,random:cV,runFunc:AEe,entityDecode:MEe,insertTitle:NEe,isLabelCoordinateInPath:uV,parseFontSize:xc,InitIDGenerator:DEe},OEe=x(function(t){let e=t;return e=e.replace(/style.*:\S*#.*;/g,function(r){return r.substring(0,r.length-1)}),e=e.replace(/classDef.*:\S*#.*;/g,function(r){return r.substring(0,r.length-1)}),e=e.replace(/#\w+;/g,function(r){const n=r.substring(1,r.length-1);return/^\+?\d+$/.test(n)?"fl°°"+n+"¶ß":"fl°"+n+"¶ß"}),e},"encodeEntities"),Tc=x(function(t){return t.replace(/fl°°/g,"&#").replace(/fl°/g,"&").replace(/¶ß/g,";")},"decodeEntities"),V0=x((t,e,{counter:r=0,prefix:n,suffix:i},a)=>a||`${n?`${n}_`:""}${t}_${e}_${r}${i?`_${i}`:""}`,"getEdgeId");function Zi(t){return t??null}x(Zi,"handleUndefinedAttr");function uV(t,e){const r=Math.round(t.x),n=Math.round(t.y),i=e.replace(/(\d+\.\d+)/g,a=>Math.round(parseFloat(a)).toString());return i.includes(r.toString())||i.includes(n.toString())}x(uV,"isLabelCoordinateInPath");var H2=x(({flowchart:t})=>{var i,a;const e=((i=t==null?void 0:t.subGraphTitleMargin)==null?void 0:i.top)??0,r=((a=t==null?void 0:t.subGraphTitleMargin)==null?void 0:a.bottom)??0,n=e+r;return{subGraphTitleTopMargin:e,subGraphTitleBottomMargin:r,subGraphTitleTotalMargin:n}},"getSubGraphTitleMargins");async function p_(t,e){const r=t.getElementsByTagName("img");if(!r||r.length===0)return;const n=e.replace(/]*>/g,"").trim()==="";await Promise.all([...r].map(i=>new Promise(a=>{function s(){if(i.style.display="flex",i.style.flexDirection="column",n){const o=Pe().fontSize?Pe().fontSize:window.getComputedStyle(document.body).fontSize,l=5,[u=Fr.fontSize]=xc(o),h=u*l+"px";i.style.minWidth=h,i.style.maxWidth=h}else i.style.width="100%";a(i)}x(s,"setupImage"),setTimeout(()=>{i.complete&&s()}),i.addEventListener("error",s),i.addEventListener("load",s)})))}x(p_,"configureLabelImages");var $Ee=x(t=>{const{handDrawnSeed:e}=Pe();return{fill:t,hachureAngle:120,hachureGap:4,fillWeight:2,roughness:.7,stroke:t,seed:e}},"solidStateFill"),W0=x(t=>{const e=PEe([...t.cssCompiledStyles||[],...t.cssStyles||[],...t.labelStyle||[]]);return{stylesMap:e,stylesArray:[...e]}},"compileStyles"),PEe=x(t=>{const e=new Map;return t.forEach(r=>{const[n,i]=r.split(":");e.set(n.trim(),i==null?void 0:i.trim())}),e},"styles2Map"),g_=x(t=>t==="color"||t==="font-size"||t==="font-family"||t==="font-weight"||t==="font-style"||t==="text-decoration"||t==="text-align"||t==="text-transform"||t==="line-height"||t==="letter-spacing"||t==="word-spacing"||t==="text-shadow"||t==="text-overflow"||t==="white-space"||t==="word-wrap"||t==="word-break"||t==="overflow-wrap"||t==="hyphens","isLabelStyle"),Xt=x(t=>{const{stylesArray:e}=W0(t),r=[],n=[],i=[],a=[];return e.forEach(s=>{const o=s[0];g_(o)?r.push(s.join(":")+" !important"):(n.push(s.join(":")+" !important"),o.includes("stroke")&&i.push(s.join(":")+" !important"),o==="fill"&&a.push(s.join(":")+" !important"))}),{labelStyles:r.join(";"),nodeStyles:n.join(";"),stylesArray:e,borderStyles:i,backgroundStyles:a}},"styles2String"),Qt=x((t,e)=>{var l;const{themeVariables:r,handDrawnSeed:n}=Pe(),{nodeBorder:i,mainBkg:a}=r,{stylesMap:s}=W0(t);return Object.assign({roughness:.7,fill:s.get("fill")||a,fillStyle:"hachure",fillWeight:4,hachureGap:5.2,stroke:s.get("stroke")||i,seed:n,strokeWidth:((l=s.get("stroke-width"))==null?void 0:l.replace("px",""))||1.3,fillLineDash:[0,0],strokeLineDash:BEe(s.get("stroke-dasharray"))},e)},"userNodeOverrides"),BEe=x(t=>{if(!t)return[0,0];const e=t.trim().split(/\s+/).map(Number);if(e.length===1){const i=isNaN(e[0])?0:e[0];return[i,i]}const r=isNaN(e[0])?0:e[0],n=isNaN(e[1])?0:e[1];return[r,n]},"getStrokeDashArray");const FEe=Object.freeze({left:0,top:0,width:16,height:16}),O4=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),hV=Object.freeze({...FEe,...O4}),zEe=Object.freeze({...hV,body:"",hidden:!1}),GEe=Object.freeze({width:null,height:null}),qEe=Object.freeze({...GEe,...O4}),VEe=(t,e,r,n="")=>{const i=t.split(":");if(t.slice(0,1)==="@"){if(i.length<2||i.length>3)return null;n=i.shift().slice(1)}if(i.length>3||!i.length)return null;if(i.length>1){const o=i.pop(),l=i.pop(),u={provider:i.length>0?i[0]:n,prefix:l,name:o};return m_(u)?u:null}const a=i[0],s=a.split("-");if(s.length>1){const o={provider:n,prefix:s.shift(),name:s.join("-")};return m_(o)?o:null}if(r&&n===""){const o={provider:n,prefix:"",name:a};return m_(o,r)?o:null}return null},m_=(t,e)=>t?!!((e&&t.prefix===""||t.prefix)&&t.name):!1;function WEe(t,e){const r={};!t.hFlip!=!e.hFlip&&(r.hFlip=!0),!t.vFlip!=!e.vFlip&&(r.vFlip=!0);const n=((t.rotate||0)+(e.rotate||0))%4;return n&&(r.rotate=n),r}function dV(t,e){const r=WEe(t,e);for(const n in zEe)n in O4?n in t&&!(n in r)&&(r[n]=O4[n]):n in e?r[n]=e[n]:n in t&&(r[n]=t[n]);return r}function UEe(t,e){const r=t.icons,n=t.aliases||Object.create(null),i=Object.create(null);function a(s){if(r[s])return i[s]=[];if(!(s in i)){i[s]=null;const o=n[s]&&n[s].parent,l=o&&a(o);l&&(i[s]=[o].concat(l))}return i[s]}return(e||Object.keys(r).concat(Object.keys(n))).forEach(a),i}function fV(t,e,r){const n=t.icons,i=t.aliases||Object.create(null);let a={};function s(o){a=dV(n[o]||i[o],a)}return s(e),r.forEach(s),dV(t,a)}function HEe(t,e){if(t.icons[e])return fV(t,e,[]);const r=UEe(t,[e])[e];return r?fV(t,e,r):null}const YEe=/(-?[0-9.]*[0-9]+[0-9.]*)/g,XEe=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function pV(t,e,r){if(e===1)return t;if(r=r||100,typeof t=="number")return Math.ceil(t*e*r)/r;if(typeof t!="string")return t;const n=t.split(YEe);if(n===null||!n.length)return t;const i=[];let a=n.shift(),s=XEe.test(a);for(;;){if(s){const o=parseFloat(a);isNaN(o)?i.push(a):i.push(Math.ceil(o*e*r)/r)}else i.push(a);if(a=n.shift(),a===void 0)return i.join("");s=!s}}function KEe(t,e="defs"){let r="";const n=t.indexOf("<"+e);for(;n>=0;){const i=t.indexOf(">",n),a=t.indexOf("",a);if(s===-1)break;r+=t.slice(i+1,a).trim(),t=t.slice(0,n).trim()+t.slice(s+1)}return{defs:r,content:t}}function jEe(t,e){return t?""+t+""+e:e}function ZEe(t,e,r){const n=KEe(t);return jEe(n.defs,e+n.content+r)}const QEe=t=>t==="unset"||t==="undefined"||t==="none";function JEe(t,e){const r={...hV,...t},n={...qEe,...e},i={left:r.left,top:r.top,width:r.width,height:r.height};let a=r.body;[r,n].forEach(m=>{const y=[],v=m.hFlip,T=m.vFlip;let b=m.rotate;v?T?b+=2:(y.push("translate("+(i.width+i.left).toString()+" "+(0-i.top).toString()+")"),y.push("scale(-1 1)"),i.top=i.left=0):T&&(y.push("translate("+(0-i.left).toString()+" "+(i.height+i.top).toString()+")"),y.push("scale(1 -1)"),i.top=i.left=0);let w;switch(b<0&&(b-=Math.floor(b/4)*4),b=b%4,b){case 1:w=i.height/2+i.top,y.unshift("rotate(90 "+w.toString()+" "+w.toString()+")");break;case 2:y.unshift("rotate(180 "+(i.width/2+i.left).toString()+" "+(i.height/2+i.top).toString()+")");break;case 3:w=i.width/2+i.left,y.unshift("rotate(-90 "+w.toString()+" "+w.toString()+")");break}b%2===1&&(i.left!==i.top&&(w=i.left,i.left=i.top,i.top=w),i.width!==i.height&&(w=i.width,i.width=i.height,i.height=w)),y.length&&(a=ZEe(a,'',""))});const s=n.width,o=n.height,l=i.width,u=i.height;let h,d;s===null?(d=o===null?"1em":o==="auto"?u:o,h=pV(d,l/u)):(h=s==="auto"?l:s,d=o===null?pV(h,u/l):o==="auto"?u:o);const f={},p=(m,y)=>{QEe(y)||(f[m]=y.toString())};p("width",h),p("height",d);const g=[i.left,i.top,l,u];return f.viewBox=g.join(" "),{attributes:f,viewBox:g,body:a}}const eSe=/\sid="(\S+)"/g,gV=new Map;function tSe(t){t=t.replace(/[0-9]+$/,"")||"a";const e=gV.get(t)||0;return gV.set(t,e+1),e?`${t}${e}`:t}function rSe(t){const e=[];let r;for(;r=eSe.exec(t);)e.push(r[1]);if(!e.length)return t;const n="suffix"+(Math.random()*16777216|Date.now()).toString(16);return e.forEach(i=>{const a=tSe(i),s=i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");t=t.replace(new RegExp('([#;"])('+s+')([")]|\\.[a-z])',"g"),"$1"+a+n+"$3")}),t=t.replace(new RegExp(n,"g"),""),t}function nSe(t,e){let r=t.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const n in e)r+=" "+n+'="'+e[n]+'"';return'"+t+""}function y_(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var ud=y_();function mV(t){ud=t}var Y2={exec:()=>null};function en(t,e=""){let r=typeof t=="string"?t:t.source,n={replace:(i,a)=>{let s=typeof a=="string"?a:a.source;return s=s.replace(Va.caret,"$1"),r=r.replace(i,s),n},getRegex:()=>new RegExp(r,e)};return n}var iSe=(()=>{try{return!!new RegExp("(?<=1)(?/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}#`),htmlBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}<(?:[a-z].*>|!--)`,"i")},aSe=/^(?:[ \t]*(?:\n|$))+/,sSe=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,oSe=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,X2=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,lSe=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,v_=/(?:[*+-]|\d{1,9}[.)])/,yV=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,vV=en(yV).replace(/bull/g,v_).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),cSe=en(yV).replace(/bull/g,v_).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),b_=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,uSe=/^[^\n]+/,x_=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,hSe=en(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",x_).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),dSe=en(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,v_).getRegex(),$4="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",T_=/|$))/,fSe=en("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",T_).replace("tag",$4).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),bV=en(b_).replace("hr",X2).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",")|<(?:script|pre|style|textarea|!--)").replace("tag",$4).getRegex(),pSe=en(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",bV).getRegex(),w_={blockquote:pSe,code:sSe,def:hSe,fences:oSe,heading:lSe,hr:X2,html:fSe,lheading:vV,list:dSe,newline:aSe,paragraph:bV,table:Y2,text:uSe},xV=en("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",X2).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",$4).getRegex(),gSe={...w_,lheading:cSe,table:xV,paragraph:en(b_).replace("hr",X2).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",xV).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",$4).getRegex()},mSe={...w_,html:en(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",T_).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:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Y2,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:en(b_).replace("hr",X2).replace("heading",` *#{1,6} *[^ -]`).replace("lheading",vV).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},ySe=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,vSe=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,TV=/^( {2,}|\\)\n(?!\s*$)/,bSe=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\`+)[^`]+\k(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",iSe?"(?`+)[^`]+\k(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),kV=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,kSe=en(kV,"u").replace(/punct/g,P4).getRegex(),ESe=en(kV,"u").replace(/punct/g,CV).getRegex(),EV="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",SSe=en(EV,"gu").replace(/notPunctSpace/g,wV).replace(/punctSpace/g,C_).replace(/punct/g,P4).getRegex(),ASe=en(EV,"gu").replace(/notPunctSpace/g,wSe).replace(/punctSpace/g,TSe).replace(/punct/g,CV).getRegex(),_Se=en("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,wV).replace(/punctSpace/g,C_).replace(/punct/g,P4).getRegex(),RSe=en(/\\(punct)/,"gu").replace(/punct/g,P4).getRegex(),LSe=en(/^<(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(),ISe=en(T_).replace("(?:-->|$)","-->").getRegex(),DSe=en("^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^").replace("comment",ISe).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),B4=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,MSe=en(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",B4).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),SV=en(/^!?\[(label)\]\[(ref)\]/).replace("label",B4).replace("ref",x_).getRegex(),AV=en(/^!?\[(ref)\](?:\[\])?/).replace("ref",x_).getRegex(),NSe=en("reflink|nolink(?!\\()","g").replace("reflink",SV).replace("nolink",AV).getRegex(),_V=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,k_={_backpedal:Y2,anyPunctuation:RSe,autolink:LSe,blockSkip:CSe,br:TV,code:vSe,del:Y2,emStrongLDelim:kSe,emStrongRDelimAst:SSe,emStrongRDelimUnd:_Se,escape:ySe,link:MSe,nolink:AV,punctuation:xSe,reflink:SV,reflinkSearch:NSe,tag:DSe,text:bSe,url:Y2},OSe={...k_,link:en(/^!?\[(label)\]\((.*?)\)/).replace("label",B4).getRegex(),reflink:en(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",B4).getRegex()},E_={...k_,emStrongRDelimAst:ASe,emStrongLDelim:ESe,url:en(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",_V).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:en(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\":">",'"':""","'":"'"},RV=t=>PSe[t];function vl(t,e){if(e){if(Va.escapeTest.test(t))return t.replace(Va.escapeReplace,RV)}else if(Va.escapeTestNoEncode.test(t))return t.replace(Va.escapeReplaceNoEncode,RV);return t}function LV(t){try{t=encodeURI(t).replace(Va.percentDecode,"%")}catch{return null}return t}function IV(t,e){var a;let r=t.replace(Va.findPipe,(s,o,l)=>{let u=!1,h=o;for(;--h>=0&&l[h]==="\\";)u=!u;return u?"|":" |"}),n=r.split(Va.splitPipe),i=0;if(n[0].trim()||n.shift(),n.length>0&&!((a=n.at(-1))!=null&&a.trim())&&n.pop(),e)if(n.length>e)n.splice(e);else for(;n.length0?-2:-1}function DV(t,e,r,n,i){let a=e.href,s=e.title||null,o=t[1].replace(i.other.outputLinkReplace,"$1");n.state.inLink=!0;let l={type:t[0].charAt(0)==="!"?"image":"link",raw:r,href:a,title:s,text:o,tokens:n.inlineTokens(o)};return n.state.inLink=!1,l}function FSe(t,e,r){let n=t.match(r.other.indentCodeCompensation);if(n===null)return e;let i=n[1];return e.split(` + */var nc=T((t,e)=>{if(e)return"translate("+-t.width/2+", "+-t.height/2+")";const r=t.x??0,n=t.y??0;return"translate("+-(r+t.width/2)+", "+-(n+t.height/2)+")"},"computeLabelTransform"),ts={aggregation:17.25,extension:17.25,composition:17.25,dependency:6,lollipop:13.5,arrow_point:4,arrow_barb:0,arrow_barb_neo:5.5},tY={arrow_point:4,arrow_cross:12.5,arrow_circle:12.5};function xx(t,e){if(t===void 0||e===void 0)return{angle:0,deltaX:0,deltaY:0};t=li(t),e=li(e);const[r,n]=[t.x,t.y],[i,a]=[e.x,e.y],s=i-r,o=a-n;return{angle:Math.atan(o/s),deltaX:s,deltaY:o}}T(xx,"calculateDeltaAndAngle");var li=T(t=>Array.isArray(t)?{x:t[0],y:t[1]}:t,"pointTransformer"),rY=T(t=>({x:T(function(e,r,n){let i=0;const a=li(n[0]).x=0?1:-1)}else if(r===n.length-1&&Object.hasOwn(ts,t.arrowTypeEnd)){const{angle:p,deltaX:g}=xx(n[n.length-1],n[n.length-2]);i=ts[t.arrowTypeEnd]*Math.cos(p)*(g>=0?1:-1)}const s=Math.abs(li(e).x-li(n[n.length-1]).x),o=Math.abs(li(e).y-li(n[n.length-1]).y),l=Math.abs(li(e).x-li(n[0]).x),u=Math.abs(li(e).y-li(n[0]).y),h=ts[t.arrowTypeStart],d=ts[t.arrowTypeEnd],f=1;if(s0&&o0&&u=0?1:-1)}else if(r===n.length-1&&Object.hasOwn(ts,t.arrowTypeEnd)){const{angle:p,deltaY:g}=xx(n[n.length-1],n[n.length-2]);i=ts[t.arrowTypeEnd]*Math.abs(Math.sin(p))*(g>=0?1:-1)}const s=Math.abs(li(e).y-li(n[n.length-1]).y),o=Math.abs(li(e).x-li(n[n.length-1]).x),l=Math.abs(li(e).y-li(n[0]).y),u=Math.abs(li(e).x-li(n[0]).x),h=ts[t.arrowTypeStart],d=ts[t.arrowTypeEnd],f=1;if(s0&&o0&&u-1}function r(s){var o=s.replace(t.ctrlCharactersRegex,"");return o.replace(t.htmlEntitiesRegex,function(l,u){return String.fromCharCode(u)})}function n(s){return URL.canParse(s)}function i(s){try{return decodeURIComponent(s)}catch{return s}}function a(s){if(!s)return t.BLANK_URL;var o,l=i(s.trim());do l=r(l).replace(t.htmlCtrlEntityRegex,"").replace(t.ctrlCharactersRegex,"").replace(t.whitespaceEscapeCharsRegex,"").trim(),l=i(l),o=l.match(t.ctrlCharactersRegex)||l.match(t.htmlEntitiesRegex)||l.match(t.htmlCtrlEntityRegex)||l.match(t.whitespaceEscapeCharsRegex);while(o&&o.length>0);var u=l;if(!u)return t.BLANK_URL;if(e(u))return u;var h=u.trimStart(),d=h.match(t.urlSchemeRegex);if(!d)return u;var f=d[0].toLowerCase().trim();if(t.invalidProtocolRegex.test(f))return t.BLANK_URL;var p=h.replace(/\\/g,"/");if(f==="mailto:"||f.includes("://"))return p;if(f==="http:"||f==="https:"){if(!n(p))return t.BLANK_URL;var g=new URL(p);return g.protocol=g.protocol.toLowerCase(),g.hostname=g.hostname.toLowerCase(),g.toString()}return p}return Ok}var df=T8e();function w8e(t){return Array.isArray(t)}function QR(t){var r;if(typeof t!="object"||t==null)return!1;if(Object.getPrototypeOf(t)===null)return!0;if(Object.prototype.toString.call(t)!=="[object Object]"){const n=t[Symbol.toStringTag];return n==null||!((r=Object.getOwnPropertyDescriptor(t,Symbol.toStringTag))!=null&&r.writable)?!1:t.toString()===`[object ${n}]`}let e=t;for(;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}function C8e(){}function aY(t){return Object.getOwnPropertySymbols(t).filter(e=>Object.prototype.propertyIsEnumerable.call(t,e))}function Tx(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}const sY="[object RegExp]",JR="[object String]",e8="[object Number]",t8="[object Boolean]",r8="[object Arguments]",oY="[object Symbol]",lY="[object Date]",cY="[object Map]",uY="[object Set]",hY="[object Array]",dY="[object ArrayBuffer]",fY="[object Object]",pY="[object DataView]",gY="[object Uint8Array]",mY="[object Uint8ClampedArray]",yY="[object Uint16Array]",vY="[object Uint32Array]",bY="[object Int8Array]",xY="[object Int16Array]",TY="[object Int32Array]",wY="[object Float32Array]",CY="[object Float64Array]",kY=typeof globalThis=="object"&&globalThis||typeof window=="object"&&window||typeof self=="object"&&self||typeof global=="object"&&global||(function(){return this})();function n8(t){return typeof kY.Buffer<"u"&&kY.Buffer.isBuffer(t)}function k8e(t){return Number.isSafeInteger(t)&&t>=0}function EY(t){return t!=null&&typeof t!="function"&&k8e(t.length)}function E8e(t){return t==="__proto__"}function Pk(t){return t==null||typeof t!="object"&&typeof t!="function"}function i8(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function S8e(t,e){return ig(t,void 0,t,new Map,e)}function ig(t,e,r,n=new Map,i=void 0){const a=i==null?void 0:i(t,e,r,n);if(a!==void 0)return a;if(Pk(t))return t;if(n.has(t))return n.get(t);if(Array.isArray(t)){const s=new Array(t.length);n.set(t,s);for(let o=0;o{if(typeof t=="object"){if(Tx(t)==="[object Object]"&&typeof t.constructor!="function"){const s={};return a.set(t,s),yl(s,t,i,a),s}switch(Object.prototype.toString.call(t)){case e8:case JR:case t8:{const s=new t.constructor(t==null?void 0:t.valueOf());return yl(s,t),s}case r8:{const s={};return yl(s,t),s.length=t.length,s[Symbol.iterator]=t[Symbol.iterator],s}default:return}}})}function SY(t){return A8e(t)}function a8(t){return t!==null&&typeof t=="object"&&Tx(t)==="[object Arguments]"}function s8(t){return typeof t=="object"&&t!==null}function R8e(t){return s8(t)&&EY(t)}function wx(t){return i8(t)}function L8e(t){const e=t==null?void 0:t.constructor;return t===(typeof e=="function"?e.prototype:Object.prototype)}function Cx(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError("Expected a function");const r=function(...n){const i=e?e.apply(this,n):n[0],a=r.cache;if(a.has(i))return a.get(i);const s=t.apply(this,n);return r.cache=a.set(i,s)||a,s};return r.cache=new(Cx.Cache||Map),r}Cx.Cache=Map;function I8e(t){if(Pk(t))return t;const e=Tx(t);if(!D8e(t))return{};if(w8e(t)){const n=Array.from(t);return t.length>0&&typeof t[0]=="string"&&Object.hasOwn(t,"index")&&(n.index=t.index,n.input=t.input),n}if(wx(t)){const n=t,i=n.constructor;return new i(n.buffer,n.byteOffset,n.length)}if(e==="[object ArrayBuffer]")return new ArrayBuffer(t.byteLength);if(e==="[object DataView]"){const n=t,i=n.buffer,a=n.byteOffset,s=n.byteLength,o=new ArrayBuffer(s),l=new Uint8Array(i,a,s);return new Uint8Array(o).set(l),new DataView(o)}if(e==="[object Boolean]"||e==="[object Number]"||e==="[object String]"){const n=t.constructor,i=new n(t.valueOf());return e==="[object String]"?N8e(i,t):o8(i,t),i}if(e==="[object Date]")return new Date(Number(t));if(e==="[object RegExp]"){const n=t,i=new RegExp(n.source,n.flags);return i.lastIndex=n.lastIndex,i}if(e==="[object Symbol]")return Object(Symbol.prototype.valueOf.call(t));if(e==="[object Map]"){const n=t,i=new Map;return n.forEach((a,s)=>{i.set(s,a)}),i}if(e==="[object Set]"){const n=t,i=new Set;return n.forEach(a=>{i.add(a)}),i}if(e==="[object Arguments]"){const n=t,i={};return o8(i,n),i.length=n.length,i[Symbol.iterator]=n[Symbol.iterator],i}const r={};return $8e(r,t),o8(r,t),M8e(r,t),r}function D8e(t){switch(Tx(t)){case r8:case hY:case dY:case pY:case t8:case lY:case wY:case CY:case bY:case xY:case TY:case cY:case e8:case fY:case sY:case uY:case JR:case oY:case gY:case mY:case yY:case vY:return!0;default:return!1}}function o8(t,e){for(const r in e)Object.hasOwn(e,r)&&(t[r]=e[r])}function M8e(t,e){const r=Object.getOwnPropertySymbols(e);for(let n=0;n=r)&&(t[n]=e[n])}function $8e(t,e){const r=Object.getPrototypeOf(e);r!==null&&typeof e.constructor=="function"&&Object.setPrototypeOf(t,r)}function O8e(t){if(Pk(t))return t;if(Array.isArray(t)||i8(t)||t instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&t instanceof SharedArrayBuffer)return t.slice(0);const e=Object.getPrototypeOf(t);if(e==null)return Object.assign(Object.create(e),t);const r=e.constructor;if(t instanceof Date||t instanceof Map||t instanceof Set)return new r(t);if(t instanceof RegExp){const n=new r(t);return n.lastIndex=t.lastIndex,n}if(t instanceof DataView)return new r(t.buffer.slice(0));if(t instanceof Error){let n;return t instanceof AggregateError?n=new r(t.errors,t.message,{cause:t.cause}):n=new r(t.message,{cause:t.cause}),n.stack=t.stack,Object.assign(n,t),n}return typeof File<"u"&&t instanceof File?new r([t],t.name,{type:t.type,lastModified:t.lastModified}):typeof t=="object"?Object.assign(Object.create(e),t):t}function P8e(t,...e){const r=e.slice(0,-1),n=e[e.length-1];let i=t;for(let a=0;ar!=="constructor").length===0:e.length===0}return!0}var AY="​",F8e={curveBasis:fx,curveBasisClosed:oRe,curveBasisOpen:lRe,curveBumpX:XW,curveBumpY:jW,curveBundle:cRe,curveCardinalClosed:uRe,curveCardinalOpen:hRe,curveCardinal:JW,curveCatmullRomClosed:dRe,curveCatmullRomOpen:fRe,curveCatmullRom:tU,curveLinear:hx,curveLinearClosed:pRe,curveMonotoneX:uU,curveMonotoneY:hU,curveNatural:pU,curveStep:gU,curveStepAfter:yU,curveStepBefore:mU},z8e=/\s*(?:(\w+)(?=:):|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,G8e=T(function(t,e){const r=RY(t,/(?:init\b)|(?:initialize\b)/);let n={};if(Array.isArray(r)){const s=r.map(o=>o.args);L4(s),n=Li(n,[...s])}else n=r.args;if(!n)return;let i=C7(t,e);const a="config";return n[a]!==void 0&&(i==="flowchart-v2"&&(i="flowchart"),n[i]=n[a],delete n[a]),n},"detectInit"),RY=T(function(t,e=null){var r,n;try{const i=new RegExp(`[%]{2}(?![{]${z8e.source})(?=[}][%]{2}).* +`,"ig");t=t.trim().replace(i,"").replace(/'/gm,'"'),se.debug(`Detecting diagram directive${e!==null?" type:"+e:""} based on the text:${t}`);let a;const s=[];for(;(a=qb.exec(t))!==null;)if(a.index===qb.lastIndex&&qb.lastIndex++,a&&!e||e&&((r=a[1])!=null&&r.match(e))||e&&((n=a[2])!=null&&n.match(e))){const o=a[1]?a[1]:a[2],l=a[3]?a[3].trim():a[4]?JSON.parse(a[4].trim()):null;s.push({type:o,args:l})}return s.length===0?{type:t,args:null}:s.length===1?s[0]:s}catch(i){return se.error(`ERROR: ${i.message} - Unable to parse directive type: '${e}' based on the text: '${t}'`),{type:void 0,args:null}}},"detectDirective"),q8e=T(function(t){return t.replace(qb,"")},"removeDirectives"),V8e=T(function(t,e){for(const[r,n]of e.entries())if(n.match(t))return r;return-1},"isSubstringInArray");function l8(t,e){if(!t)return e;const r=`curve${t.charAt(0).toUpperCase()+t.slice(1)}`;return F8e[r]??e}T(l8,"interpolateToCurve");function LY(t,e){const r=t.trim();if(r)return e.securityLevel!=="loose"?df.sanitizeUrl(r):r}T(LY,"formatUrl");var W8e=T((t,...e)=>{const r=t.split("."),n=r.length-1,i=r[n];let a=window;for(let s=0;s{r+=c8(i,e),e=i});const n=r/2;return u8(t,n)}T(IY,"traverseEdge");function DY(t){return t.length===1?t[0]:IY(t)}T(DY,"calcLabelPosition");var MY=T((t,e=2)=>{const r=Math.pow(10,e);return Math.round(t*r)/r},"roundNumber"),u8=T((t,e)=>{let r,n=e;for(const i of t){if(r){const a=c8(i,r);if(a===0)return r;if(a=1)return{x:i.x,y:i.y};if(s>0&&s<1)return{x:MY((1-s)*r.x+s*i.x,5),y:MY((1-s)*r.y+s*i.y,5)}}}r=i}throw new Error("Could not find a suitable point for the given distance")},"calculatePoint"),U8e=T((t,e,r)=>{se.info(`our points ${JSON.stringify(e)}`),e[0]!==r&&(e=e.reverse());const i=u8(e,25),a=t?10:5,s=Math.atan2(e[0].y-i.y,e[0].x-i.x),o={x:0,y:0};return o.x=Math.sin(s)*a+(e[0].x+i.x)/2,o.y=-Math.cos(s)*a+(e[0].y+i.y)/2,o},"calcCardinalityPosition");function NY(t,e,r){const n=structuredClone(r);se.info("our points",n),e!=="start_left"&&e!=="start_right"&&n.reverse();const i=25+t,a=u8(n,i),s=10+t*.5,o=Math.atan2(n[0].y-a.y,n[0].x-a.x),l={x:0,y:0};return e==="start_left"?(l.x=Math.sin(o+Math.PI)*s+(n[0].x+a.x)/2,l.y=-Math.cos(o+Math.PI)*s+(n[0].y+a.y)/2):e==="end_right"?(l.x=Math.sin(o-Math.PI)*s+(n[0].x+a.x)/2-5,l.y=-Math.cos(o-Math.PI)*s+(n[0].y+a.y)/2-5):e==="end_left"?(l.x=Math.sin(o)*s+(n[0].x+a.x)/2-5,l.y=-Math.cos(o)*s+(n[0].y+a.y)/2-5):(l.x=Math.sin(o)*s+(n[0].x+a.x)/2,l.y=-Math.cos(o)*s+(n[0].y+a.y)/2),l}T(NY,"calcTerminalLabelPosition");function h8(t){let e="",r="";for(const n of t)n!==void 0&&(n.startsWith("color:")||n.startsWith("text-align:")?r=r+n+";":e=e+n+";");return{style:e,labelStyle:r}}T(h8,"getStylesFromArray");var $Y=0,OY=T(()=>($Y++,"id-"+Math.random().toString(36).substr(2,12)+"-"+$Y),"generateId");function PY(t){let e="";const r="0123456789abcdef",n=r.length;for(let i=0;iPY(t.length),"random"),H8e=T(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"),Y8e=T(function(t,e){const r=e.text.replace(Dt.lineBreakRegex," "),[,n]=cu(e.fontSize),i=t.append("text");i.attr("x",e.x),i.attr("y",e.y),i.style("text-anchor",e.anchor),i.style("font-family",e.fontFamily),i.style("font-size",n),i.style("font-weight",e.fontWeight),i.attr("fill",e.fill),e.class!==void 0&&i.attr("class",e.class);const a=i.append("tspan");return a.attr("x",e.x+e.textMargin*2),a.attr("fill",e.fill),a.text(r),i},"drawSimpleText"),kx=Cx((t,e,r)=>{if(!t||(r=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",joinWith:"
"},r),Dt.lineBreakRegex.test(t)))return t;const n=t.split(" ").filter(Boolean),i=[];let a="";return n.forEach((s,o)=>{const l=gs(`${s} `,r),u=gs(a,r);if(l>e){const{hyphenatedStrings:f,remainingWord:p}=X8e(s,e,"-",r);i.push(a,...f),a=p}else u+l>=e?(i.push(a),a=s):a=[a,s].filter(Boolean).join(" ");o+1===n.length&&i.push(a)}),i.filter(s=>s!=="").join(r.joinWith)},(t,e,r)=>`${t}${e}${r.fontSize}${r.fontWeight}${r.fontFamily}${r.joinWith}`),X8e=Cx((t,e,r="-",n)=>{n=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",margin:0},n);const i=[...t],a=[];let s="";return i.forEach((o,l)=>{const u=`${s}${o}`;if(gs(u,n)>=e){const d=l+1,f=i.length===d,p=`${u}${r}`;a.push(f?u:p),s=""}else s=u}),{hyphenatedStrings:a,remainingWord:s}},(t,e,r="-",n)=>`${t}${e}${r}${n.fontSize}${n.fontWeight}${n.fontFamily}`);function Fk(t,e){return zk(t,e).height}T(Fk,"calculateTextHeight");function gs(t,e){return zk(t,e).width}T(gs,"calculateTextWidth");var zk=Cx((t,e)=>{const{fontSize:r=12,fontFamily:n="Arial",fontWeight:i=400}=e;if(!t)return{width:0,height:0};const[,a]=cu(r),s=["sans-serif",n],o=t.split(Dt.lineBreakRegex),l=[],u=gt("body");if(!u.remove)return{width:0,height:0,lineHeight:0};const h=u.append("svg");for(const f of s){let p=0;const g={width:0,height:0,lineHeight:0};for(const m of o){const y=H8e();y.text=m||AY;const v=Y8e(h,y).style("font-size",a).style("font-weight",i).style("font-family",f),x=(v._groups||v)[0][0].getBBox();if(x.width===0&&x.height===0)throw new Error("svg element not in render tree");g.width=Math.round(Math.max(g.width,x.width)),p=Math.round(x.height),g.height+=p,g.lineHeight=Math.round(Math.max(g.lineHeight,p))}l.push(g)}h.remove();const d=isNaN(l[1].height)||isNaN(l[1].width)||isNaN(l[1].lineHeight)||l[0].height>l[1].height&&l[0].width>l[1].width&&l[0].lineHeight>l[1].lineHeight?0:1;return l[d]},(t,e)=>`${t}${e.fontSize}${e.fontWeight}${e.fontFamily}`),j8e=(oy=class{constructor(e=!1,r){this.count=0,this.count=r?r.length:0,this.next=e?()=>this.count++:()=>Date.now()}},T(oy,"InitIDGenerator"),oy),Gk,K8e=T(function(t){return Gk=Gk||document.createElement("div"),t=escape(t).replace(/%26/g,"&").replace(/%23/g,"#").replace(/%3B/g,";"),Gk.innerHTML=t,unescape(Gk.textContent)},"entityDecode");function d8(t){return"str"in t}T(d8,"isDetailedError");var Z8e=T((t,e,r,n)=>{var a;if(!n)return;const i=(a=t.node())==null?void 0:a.getBBox();i&&t.append("text").text(n).attr("text-anchor","middle").attr("x",i.x+i.width/2).attr("y",-r).attr("class",e)},"insertTitle"),cu=T(t=>{if(typeof t=="number")return[t,t+"px"];const e=parseInt(t??"",10);return Number.isNaN(e)?[void 0,void 0]:t===String(e)?[e,t+"px"]:[e,t]},"parseFontSize");function wi(t,e){return B8e({},t,e)}T(wi,"cleanAndMerge");var Pr={assignWithDepth:Li,wrapLabel:kx,calculateTextHeight:Fk,calculateTextWidth:gs,calculateTextDimensions:zk,cleanAndMerge:wi,detectInit:G8e,detectDirective:RY,isSubstringInArray:V8e,interpolateToCurve:l8,calcLabelPosition:DY,calcCardinalityPosition:U8e,calcTerminalLabelPosition:NY,formatUrl:LY,getStylesFromArray:h8,generateId:OY,random:BY,runFunc:W8e,entityDecode:K8e,insertTitle:Z8e,isLabelCoordinateInPath:FY,parseFontSize:cu,InitIDGenerator:j8e},Q8e=T(function(t){let e=t;return e=e.replace(/style.*:\S*#.*;/g,function(r){return r.substring(0,r.length-1)}),e=e.replace(/classDef.*:\S*#.*;/g,function(r){return r.substring(0,r.length-1)}),e=e.replace(/#\w+;/g,function(r){const n=r.substring(1,r.length-1);return/^\+?\d+$/.test(n)?"fl°°"+n+"¶ß":"fl°"+n+"¶ß"}),e},"encodeEntities"),uu=T(function(t){return t.replace(/fl°°/g,"&#").replace(/fl°/g,"&").replace(/¶ß/g,";")},"decodeEntities"),ag=T((t,e,{counter:r=0,prefix:n,suffix:i},a)=>a||`${n?`${n}_`:""}${t}_${e}_${r}${i?`_${i}`:""}`,"getEdgeId");function xa(t){return t??null}T(xa,"handleUndefinedAttr");function FY(t,e){const r=Math.round(t.x),n=Math.round(t.y),i=e.replace(/(\d+\.\d+)/g,a=>Math.round(parseFloat(a)).toString());return i.includes(r.toString())||i.includes(n.toString())}T(FY,"isLabelCoordinateInPath");var Ex=T(({flowchart:t})=>{var i,a;const e=((i=t==null?void 0:t.subGraphTitleMargin)==null?void 0:i.top)??0,r=((a=t==null?void 0:t.subGraphTitleMargin)==null?void 0:a.bottom)??0,n=e+r;return{subGraphTitleTopMargin:e,subGraphTitleBottomMargin:r,subGraphTitleTotalMargin:n}},"getSubGraphTitleMargins");async function f8(t,e){const r=t.getElementsByTagName("img");if(!r||r.length===0)return;const n=e.replace(/]*>/g,"").trim()==="";await Promise.all([...r].map(i=>new Promise(a=>{function s(){if(i.style.display="flex",i.style.flexDirection="column",n){const o=Pe().fontSize?Pe().fontSize:window.getComputedStyle(document.body).fontSize,l=5,[u=Xr.fontSize]=cu(o),h=u*l+"px";i.style.minWidth=h,i.style.maxWidth=h}else i.style.width="100%";a(i)}T(s,"setupImage"),setTimeout(()=>{i.complete&&s()}),i.addEventListener("error",s),i.addEventListener("load",s)})))}T(f8,"configureLabelImages");var J8e=T(t=>{const{handDrawnSeed:e}=Pe();return{fill:t,hachureAngle:120,hachureGap:4,fillWeight:2,roughness:.7,stroke:t,seed:e}},"solidStateFill"),sg=T(t=>{const e=eLe([...t.cssCompiledStyles||[],...t.cssStyles||[],...t.labelStyle||[]]);return{stylesMap:e,stylesArray:[...e]}},"compileStyles"),eLe=T(t=>{const e=new Map;return t.forEach(r=>{const[n,i]=r.split(":");e.set(n.trim(),i==null?void 0:i.trim())}),e},"styles2Map"),p8=T(t=>t==="color"||t==="font-size"||t==="font-family"||t==="font-weight"||t==="font-style"||t==="text-decoration"||t==="text-align"||t==="text-transform"||t==="line-height"||t==="letter-spacing"||t==="word-spacing"||t==="text-shadow"||t==="text-overflow"||t==="white-space"||t==="word-wrap"||t==="word-break"||t==="overflow-wrap"||t==="hyphens","isLabelStyle"),Jt=T(t=>{const{stylesArray:e}=sg(t),r=[],n=[],i=[],a=[];return e.forEach(s=>{const o=s[0];p8(o)?r.push(s.join(":")+" !important"):(n.push(s.join(":")+" !important"),o.includes("stroke")&&i.push(s.join(":")+" !important"),o==="fill"&&a.push(s.join(":")+" !important"))}),{labelStyles:r.join(";"),nodeStyles:n.join(";"),stylesArray:e,borderStyles:i,backgroundStyles:a}},"styles2String"),nr=T((t,e)=>{var l;const{themeVariables:r,handDrawnSeed:n}=Pe(),{nodeBorder:i,mainBkg:a}=r,{stylesMap:s}=sg(t);return Object.assign({roughness:.7,fill:s.get("fill")||a,fillStyle:"hachure",fillWeight:4,hachureGap:5.2,stroke:s.get("stroke")||i,seed:n,strokeWidth:((l=s.get("stroke-width"))==null?void 0:l.replace("px",""))||1.3,fillLineDash:[0,0],strokeLineDash:tLe(s.get("stroke-dasharray"))},e)},"userNodeOverrides"),tLe=T(t=>{if(!t)return[0,0];const e=t.trim().split(/\s+/).map(Number);if(e.length===1){const i=isNaN(e[0])?0:e[0];return[i,i]}const r=isNaN(e[0])?0:e[0],n=isNaN(e[1])?0:e[1];return[r,n]},"getStrokeDashArray");const rLe=Object.freeze({left:0,top:0,width:16,height:16}),qk=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),zY=Object.freeze({...rLe,...qk}),nLe=Object.freeze({...zY,body:"",hidden:!1}),iLe=Object.freeze({width:null,height:null}),aLe=Object.freeze({...iLe,...qk}),sLe=(t,e,r,n="")=>{const i=t.split(":");if(t.slice(0,1)==="@"){if(i.length<2||i.length>3)return null;n=i.shift().slice(1)}if(i.length>3||!i.length)return null;if(i.length>1){const o=i.pop(),l=i.pop(),u={provider:i.length>0?i[0]:n,prefix:l,name:o};return g8(u)?u:null}const a=i[0],s=a.split("-");if(s.length>1){const o={provider:n,prefix:s.shift(),name:s.join("-")};return g8(o)?o:null}if(r&&n===""){const o={provider:n,prefix:"",name:a};return g8(o,r)?o:null}return null},g8=(t,e)=>t?!!((e&&t.prefix===""||t.prefix)&&t.name):!1;function oLe(t,e){const r={};!t.hFlip!=!e.hFlip&&(r.hFlip=!0),!t.vFlip!=!e.vFlip&&(r.vFlip=!0);const n=((t.rotate||0)+(e.rotate||0))%4;return n&&(r.rotate=n),r}function GY(t,e){const r=oLe(t,e);for(const n in nLe)n in qk?n in t&&!(n in r)&&(r[n]=qk[n]):n in e?r[n]=e[n]:n in t&&(r[n]=t[n]);return r}function lLe(t,e){const r=t.icons,n=t.aliases||Object.create(null),i=Object.create(null);function a(s){if(r[s])return i[s]=[];if(!(s in i)){i[s]=null;const o=n[s]&&n[s].parent,l=o&&a(o);l&&(i[s]=[o].concat(l))}return i[s]}return(e||Object.keys(r).concat(Object.keys(n))).forEach(a),i}function qY(t,e,r){const n=t.icons,i=t.aliases||Object.create(null);let a={};function s(o){a=GY(n[o]||i[o],a)}return s(e),r.forEach(s),GY(t,a)}function cLe(t,e){if(t.icons[e])return qY(t,e,[]);const r=lLe(t,[e])[e];return r?qY(t,e,r):null}const uLe=/(-?[0-9.]*[0-9]+[0-9.]*)/g,hLe=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function VY(t,e,r){if(e===1)return t;if(r=r||100,typeof t=="number")return Math.ceil(t*e*r)/r;if(typeof t!="string")return t;const n=t.split(uLe);if(n===null||!n.length)return t;const i=[];let a=n.shift(),s=hLe.test(a);for(;;){if(s){const o=parseFloat(a);isNaN(o)?i.push(a):i.push(Math.ceil(o*e*r)/r)}else i.push(a);if(a=n.shift(),a===void 0)return i.join("");s=!s}}function dLe(t,e="defs"){let r="";const n=t.indexOf("<"+e);for(;n>=0;){const i=t.indexOf(">",n),a=t.indexOf("",a);if(s===-1)break;r+=t.slice(i+1,a).trim(),t=t.slice(0,n).trim()+t.slice(s+1)}return{defs:r,content:t}}function fLe(t,e){return t?""+t+""+e:e}function pLe(t,e,r){const n=dLe(t);return fLe(n.defs,e+n.content+r)}const gLe=t=>t==="unset"||t==="undefined"||t==="none";function mLe(t,e){const r={...zY,...t},n={...aLe,...e},i={left:r.left,top:r.top,width:r.width,height:r.height};let a=r.body;[r,n].forEach(m=>{const y=[],v=m.hFlip,x=m.vFlip;let b=m.rotate;v?x?b+=2:(y.push("translate("+(i.width+i.left).toString()+" "+(0-i.top).toString()+")"),y.push("scale(-1 1)"),i.top=i.left=0):x&&(y.push("translate("+(0-i.left).toString()+" "+(i.height+i.top).toString()+")"),y.push("scale(1 -1)"),i.top=i.left=0);let w;switch(b<0&&(b-=Math.floor(b/4)*4),b=b%4,b){case 1:w=i.height/2+i.top,y.unshift("rotate(90 "+w.toString()+" "+w.toString()+")");break;case 2:y.unshift("rotate(180 "+(i.width/2+i.left).toString()+" "+(i.height/2+i.top).toString()+")");break;case 3:w=i.width/2+i.left,y.unshift("rotate(-90 "+w.toString()+" "+w.toString()+")");break}b%2===1&&(i.left!==i.top&&(w=i.left,i.left=i.top,i.top=w),i.width!==i.height&&(w=i.width,i.width=i.height,i.height=w)),y.length&&(a=pLe(a,'',""))});const s=n.width,o=n.height,l=i.width,u=i.height;let h,d;s===null?(d=o===null?"1em":o==="auto"?u:o,h=VY(d,l/u)):(h=s==="auto"?l:s,d=o===null?VY(h,u/l):o==="auto"?u:o);const f={},p=(m,y)=>{gLe(y)||(f[m]=y.toString())};p("width",h),p("height",d);const g=[i.left,i.top,l,u];return f.viewBox=g.join(" "),{attributes:f,viewBox:g,body:a}}const yLe=/\sid="(\S+)"/g,WY=new Map;function vLe(t){t=t.replace(/[0-9]+$/,"")||"a";const e=WY.get(t)||0;return WY.set(t,e+1),e?`${t}${e}`:t}function bLe(t){const e=[];let r;for(;r=yLe.exec(t);)e.push(r[1]);if(!e.length)return t;const n="suffix"+(Math.random()*16777216|Date.now()).toString(16);return e.forEach(i=>{const a=vLe(i),s=i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");t=t.replace(new RegExp('([#;"])('+s+')([")]|\\.[a-z])',"g"),"$1"+a+n+"$3")}),t=t.replace(new RegExp(n,"g"),""),t}function xLe(t,e){let r=t.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const n in e)r+=" "+n+'="'+e[n]+'"';return'"+t+""}function m8(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var ff=m8();function UY(t){ff=t}var Sx={exec:()=>null};function un(t,e=""){let r=typeof t=="string"?t:t.source,n={replace:(i,a)=>{let s=typeof a=="string"?a:a.source;return s=s.replace(ms.caret,"$1"),r=r.replace(i,s),n},getRegex:()=>new RegExp(r,e)};return n}var TLe=(()=>{try{return!!new RegExp("(?<=1)(?/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^
/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}#`),htmlBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}<(?:[a-z].*>|!--)`,"i")},wLe=/^(?:[ \t]*(?:\n|$))+/,CLe=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,kLe=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,_x=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,ELe=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,y8=/(?:[*+-]|\d{1,9}[.)])/,HY=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,YY=un(HY).replace(/bull/g,y8).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),SLe=un(HY).replace(/bull/g,y8).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),v8=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,_Le=/^[^\n]+/,b8=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,ALe=un(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",b8).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),RLe=un(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,y8).getRegex(),Vk="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",x8=/|$))/,LLe=un("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",x8).replace("tag",Vk).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),XY=un(v8).replace("hr",_x).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",")|<(?:script|pre|style|textarea|!--)").replace("tag",Vk).getRegex(),ILe=un(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",XY).getRegex(),T8={blockquote:ILe,code:CLe,def:ALe,fences:kLe,heading:ELe,hr:_x,html:LLe,lheading:YY,list:RLe,newline:wLe,paragraph:XY,table:Sx,text:_Le},jY=un("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",_x).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",Vk).getRegex(),DLe={...T8,lheading:SLe,table:jY,paragraph:un(v8).replace("hr",_x).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",jY).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",Vk).getRegex()},MLe={...T8,html:un(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",x8).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:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Sx,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:un(v8).replace("hr",_x).replace("heading",` *#{1,6} *[^ +]`).replace("lheading",YY).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},NLe=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,$Le=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,KY=/^( {2,}|\\)\n(?!\s*$)/,OLe=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\`+)[^`]+\k(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",TLe?"(?`+)[^`]+\k(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),JY=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,GLe=un(JY,"u").replace(/punct/g,Wk).getRegex(),qLe=un(JY,"u").replace(/punct/g,QY).getRegex(),eX="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",VLe=un(eX,"gu").replace(/notPunctSpace/g,ZY).replace(/punctSpace/g,w8).replace(/punct/g,Wk).getRegex(),WLe=un(eX,"gu").replace(/notPunctSpace/g,FLe).replace(/punctSpace/g,BLe).replace(/punct/g,QY).getRegex(),ULe=un("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,ZY).replace(/punctSpace/g,w8).replace(/punct/g,Wk).getRegex(),HLe=un(/\\(punct)/,"gu").replace(/punct/g,Wk).getRegex(),YLe=un(/^<(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(),XLe=un(x8).replace("(?:-->|$)","-->").getRegex(),jLe=un("^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^").replace("comment",XLe).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Uk=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,KLe=un(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",Uk).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),tX=un(/^!?\[(label)\]\[(ref)\]/).replace("label",Uk).replace("ref",b8).getRegex(),rX=un(/^!?\[(ref)\](?:\[\])?/).replace("ref",b8).getRegex(),ZLe=un("reflink|nolink(?!\\()","g").replace("reflink",tX).replace("nolink",rX).getRegex(),nX=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,C8={_backpedal:Sx,anyPunctuation:HLe,autolink:YLe,blockSkip:zLe,br:KY,code:$Le,del:Sx,emStrongLDelim:GLe,emStrongRDelimAst:VLe,emStrongRDelimUnd:ULe,escape:NLe,link:KLe,nolink:rX,punctuation:PLe,reflink:tX,reflinkSearch:ZLe,tag:jLe,text:OLe,url:Sx},QLe={...C8,link:un(/^!?\[(label)\]\((.*?)\)/).replace("label",Uk).getRegex(),reflink:un(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Uk).getRegex()},k8={...C8,emStrongRDelimAst:WLe,emStrongLDelim:qLe,url:un(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",nX).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:un(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\":">",'"':""","'":"'"},iX=t=>eIe[t];function ic(t,e){if(e){if(ms.escapeTest.test(t))return t.replace(ms.escapeReplace,iX)}else if(ms.escapeTestNoEncode.test(t))return t.replace(ms.escapeReplaceNoEncode,iX);return t}function aX(t){try{t=encodeURI(t).replace(ms.percentDecode,"%")}catch{return null}return t}function sX(t,e){var a;let r=t.replace(ms.findPipe,(s,o,l)=>{let u=!1,h=o;for(;--h>=0&&l[h]==="\\";)u=!u;return u?"|":" |"}),n=r.split(ms.splitPipe),i=0;if(n[0].trim()||n.shift(),n.length>0&&!((a=n.at(-1))!=null&&a.trim())&&n.pop(),e)if(n.length>e)n.splice(e);else for(;n.length0?-2:-1}function oX(t,e,r,n,i){let a=e.href,s=e.title||null,o=t[1].replace(i.other.outputLinkReplace,"$1");n.state.inLink=!0;let l={type:t[0].charAt(0)==="!"?"image":"link",raw:r,href:a,title:s,text:o,tokens:n.inlineTokens(o)};return n.state.inLink=!1,l}function rIe(t,e,r){let n=t.match(r.other.indentCodeCompensation);if(n===null)return e;let i=n[1];return e.split(` `).map(a=>{let s=a.match(r.other.beginningSpace);if(s===null)return a;let[o]=s;return o.length>=i.length?a.slice(i.length):a}).join(` -`)}var z4=class{constructor(e){Hr(this,"options");Hr(this,"rules");Hr(this,"lexer");this.options=e||ud}space(e){let r=this.rules.block.newline.exec(e);if(r&&r[0].length>0)return{type:"space",raw:r[0]}}code(e){let r=this.rules.block.code.exec(e);if(r){let n=r[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:r[0],codeBlockStyle:"indented",text:this.options.pedantic?n:j2(n,` -`)}}}fences(e){let r=this.rules.block.fences.exec(e);if(r){let n=r[0],i=FSe(n,r[3]||"",this.rules);return{type:"code",raw:n,lang:r[2]?r[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):r[2],text:i}}}heading(e){let r=this.rules.block.heading.exec(e);if(r){let n=r[2].trim();if(this.rules.other.endingHash.test(n)){let i=j2(n,"#");(this.options.pedantic||!i||this.rules.other.endingSpaceChar.test(i))&&(n=i.trim())}return{type:"heading",raw:r[0],depth:r[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(e){let r=this.rules.block.hr.exec(e);if(r)return{type:"hr",raw:j2(r[0],` -`)}}blockquote(e){let r=this.rules.block.blockquote.exec(e);if(r){let n=j2(r[0],` +`)}var Yk=class{constructor(e){tn(this,"options");tn(this,"rules");tn(this,"lexer");this.options=e||ff}space(e){let r=this.rules.block.newline.exec(e);if(r&&r[0].length>0)return{type:"space",raw:r[0]}}code(e){let r=this.rules.block.code.exec(e);if(r){let n=r[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:r[0],codeBlockStyle:"indented",text:this.options.pedantic?n:Rx(n,` +`)}}}fences(e){let r=this.rules.block.fences.exec(e);if(r){let n=r[0],i=rIe(n,r[3]||"",this.rules);return{type:"code",raw:n,lang:r[2]?r[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):r[2],text:i}}}heading(e){let r=this.rules.block.heading.exec(e);if(r){let n=r[2].trim();if(this.rules.other.endingHash.test(n)){let i=Rx(n,"#");(this.options.pedantic||!i||this.rules.other.endingSpaceChar.test(i))&&(n=i.trim())}return{type:"heading",raw:r[0],depth:r[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(e){let r=this.rules.block.hr.exec(e);if(r)return{type:"hr",raw:Rx(r[0],` +`)}}blockquote(e){let r=this.rules.block.blockquote.exec(e);if(r){let n=Rx(r[0],` `).split(` `),i="",a="",s=[];for(;n.length>0;){let o=!1,l=[],u;for(u=0;u1,a={type:"list",raw:"",ordered:i,start:i?+n.slice(0,-1):"",loose:!1,items:[]};n=i?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=i?n:"[*+-]");let s=this.rules.other.listItemRegex(n),o=!1;for(;e;){let u=!1,h="",d="";if(!(r=s.exec(e))||this.rules.block.hr.test(e))break;h=r[0],e=e.substring(h.length);let f=r[2].split(` -`,1)[0].replace(this.rules.other.listReplaceTabs,T=>" ".repeat(3*T.length)),p=e.split(` +`,1)[0].replace(this.rules.other.listReplaceTabs,x=>" ".repeat(3*x.length)),p=e.split(` `,1)[0],g=!f.trim(),m=0;if(this.options.pedantic?(m=2,d=f.trimStart()):g?m=r[1].length+1:(m=r[2].search(this.rules.other.nonSpaceChar),m=m>4?1:m,d=f.slice(m),m+=r[1].length),g&&this.rules.other.blankLine.test(p)&&(h+=p+` -`,e=e.substring(p.length+1),u=!0),!u){let T=this.rules.other.nextBulletRegex(m),b=this.rules.other.hrRegex(m),w=this.rules.other.fencesBeginRegex(m),k=this.rules.other.headingBeginRegex(m),A=this.rules.other.htmlBeginRegex(m);for(;e;){let C=e.split(` -`,1)[0],_;if(p=C,this.options.pedantic?(p=p.replace(this.rules.other.listReplaceNesting," "),_=p):_=p.replace(this.rules.other.tabCharGlobal," "),w.test(p)||k.test(p)||A.test(p)||T.test(p)||b.test(p))break;if(_.search(this.rules.other.nonSpaceChar)>=m||!p.trim())d+=` -`+_.slice(m);else{if(g||f.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||w.test(f)||k.test(f)||b.test(f))break;d+=` -`+p}!g&&!p.trim()&&(g=!0),h+=C+` -`,e=e.substring(C.length+1),f=_.slice(m)}}a.loose||(o?a.loose=!0:this.rules.other.doubleBlankLine.test(h)&&(o=!0));let y=null,v;this.options.gfm&&(y=this.rules.other.listIsTask.exec(d),y&&(v=y[0]!=="[ ] ",d=d.replace(this.rules.other.listReplaceTask,""))),a.items.push({type:"list_item",raw:h,task:!!y,checked:v,loose:!1,text:d,tokens:[]}),a.raw+=h}let l=a.items.at(-1);if(l)l.raw=l.raw.trimEnd(),l.text=l.text.trimEnd();else return;a.raw=a.raw.trimEnd();for(let u=0;uf.type==="space"),d=h.length>0&&h.some(f=>this.rules.other.anyLine.test(f.raw));a.loose=d}if(a.loose)for(let u=0;u({text:u,tokens:this.lexer.inline(u),header:!1,align:s.align[h]})));return s}}lheading(e){let r=this.rules.block.lheading.exec(e);if(r)return{type:"heading",raw:r[0],depth:r[2].charAt(0)==="="?1:2,text:r[1],tokens:this.lexer.inline(r[1])}}paragraph(e){let r=this.rules.block.paragraph.exec(e);if(r){let n=r[1].charAt(r[1].length-1)===` -`?r[1].slice(0,-1):r[1];return{type:"paragraph",raw:r[0],text:n,tokens:this.lexer.inline(n)}}}text(e){let r=this.rules.block.text.exec(e);if(r)return{type:"text",raw:r[0],text:r[0],tokens:this.lexer.inline(r[0])}}escape(e){let r=this.rules.inline.escape.exec(e);if(r)return{type:"escape",raw:r[0],text:r[1]}}tag(e){let r=this.rules.inline.tag.exec(e);if(r)return!this.lexer.state.inLink&&this.rules.other.startATag.test(r[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(r[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(r[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(r[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:r[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:r[0]}}link(e){let r=this.rules.inline.link.exec(e);if(r){let n=r[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;let s=j2(n.slice(0,-1),"\\");if((n.length-s.length)%2===0)return}else{let s=BSe(r[2],"()");if(s===-2)return;if(s>-1){let o=(r[0].indexOf("!")===0?5:4)+r[1].length+s;r[2]=r[2].substring(0,s),r[0]=r[0].substring(0,o).trim(),r[3]=""}}let i=r[2],a="";if(this.options.pedantic){let s=this.rules.other.pedanticHrefTitle.exec(i);s&&(i=s[1],a=s[3])}else a=r[3]?r[3].slice(1,-1):"";return i=i.trim(),this.rules.other.startAngleBracket.test(i)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?i=i.slice(1):i=i.slice(1,-1)),DV(r,{href:i&&i.replace(this.rules.inline.anyPunctuation,"$1"),title:a&&a.replace(this.rules.inline.anyPunctuation,"$1")},r[0],this.lexer,this.rules)}}reflink(e,r){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let i=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),a=r[i.toLowerCase()];if(!a){let s=n[0].charAt(0);return{type:"text",raw:s,text:s}}return DV(n,a,n[0],this.lexer,this.rules)}}emStrong(e,r,n=""){let i=this.rules.inline.emStrongLDelim.exec(e);if(!(!i||i[3]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(i[1]||i[2])||!n||this.rules.inline.punctuation.exec(n))){let a=[...i[0]].length-1,s,o,l=a,u=0,h=i[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(h.lastIndex=0,r=r.slice(-1*e.length+a);(i=h.exec(r))!=null;){if(s=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!s)continue;if(o=[...s].length,i[3]||i[4]){l+=o;continue}else if((i[5]||i[6])&&a%3&&!((a+o)%3)){u+=o;continue}if(l-=o,l>0)continue;o=Math.min(o,o+l+u);let d=[...i[0]][0].length,f=e.slice(0,a+i.index+d+o);if(Math.min(a,o)%2){let g=f.slice(1,-1);return{type:"em",raw:f,text:g,tokens:this.lexer.inlineTokens(g)}}let p=f.slice(2,-2);return{type:"strong",raw:f,text:p,tokens:this.lexer.inlineTokens(p)}}}}codespan(e){let r=this.rules.inline.code.exec(e);if(r){let n=r[2].replace(this.rules.other.newLineCharGlobal," "),i=this.rules.other.nonSpaceChar.test(n),a=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return i&&a&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:r[0],text:n}}}br(e){let r=this.rules.inline.br.exec(e);if(r)return{type:"br",raw:r[0]}}del(e){let r=this.rules.inline.del.exec(e);if(r)return{type:"del",raw:r[0],text:r[2],tokens:this.lexer.inlineTokens(r[2])}}autolink(e){let r=this.rules.inline.autolink.exec(e);if(r){let n,i;return r[2]==="@"?(n=r[1],i="mailto:"+n):(n=r[1],i=n),{type:"link",raw:r[0],text:n,href:i,tokens:[{type:"text",raw:n,text:n}]}}}url(e){var n;let r;if(r=this.rules.inline.url.exec(e)){let i,a;if(r[2]==="@")i=r[0],a="mailto:"+i;else{let s;do s=r[0],r[0]=((n=this.rules.inline._backpedal.exec(r[0]))==null?void 0:n[0])??"";while(s!==r[0]);i=r[0],r[1]==="www."?a="http://"+r[0]:a=r[0]}return{type:"link",raw:r[0],text:i,href:a,tokens:[{type:"text",raw:i,text:i}]}}}inlineText(e){let r=this.rules.inline.text.exec(e);if(r){let n=this.lexer.state.inRawBlock;return{type:"text",raw:r[0],text:r[0],escaped:n}}}},Mo=class XP{constructor(e){Hr(this,"tokens");Hr(this,"options");Hr(this,"state");Hr(this,"tokenizer");Hr(this,"inlineQueue");this.tokens=[],this.tokens.links=Object.create(null),this.options=e||ud,this.options.tokenizer=this.options.tokenizer||new z4,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let r={other:Va,block:F4.normal,inline:K2.normal};this.options.pedantic?(r.block=F4.pedantic,r.inline=K2.pedantic):this.options.gfm&&(r.block=F4.gfm,this.options.breaks?r.inline=K2.breaks:r.inline=K2.gfm),this.tokenizer.rules=r}static get rules(){return{block:F4,inline:K2}}static lex(e,r){return new XP(r).lex(e)}static lexInline(e,r){return new XP(r).inlineTokens(e)}lex(e){e=e.replace(Va.carriageReturn,` -`),this.blockTokens(e,this.tokens);for(let r=0;r(o=u.call({lexer:this},e,r))?(e=e.substring(o.raw.length),r.push(o),!0):!1))continue;if(o=this.tokenizer.space(e)){e=e.substring(o.raw.length);let u=r.at(-1);o.raw.length===1&&u!==void 0?u.raw+=` +`,e=e.substring(p.length+1),u=!0),!u){let x=this.rules.other.nextBulletRegex(m),b=this.rules.other.hrRegex(m),w=this.rules.other.fencesBeginRegex(m),C=this.rules.other.headingBeginRegex(m),_=this.rules.other.htmlBeginRegex(m);for(;e;){let k=e.split(` +`,1)[0],S;if(p=k,this.options.pedantic?(p=p.replace(this.rules.other.listReplaceNesting," "),S=p):S=p.replace(this.rules.other.tabCharGlobal," "),w.test(p)||C.test(p)||_.test(p)||x.test(p)||b.test(p))break;if(S.search(this.rules.other.nonSpaceChar)>=m||!p.trim())d+=` +`+S.slice(m);else{if(g||f.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||w.test(f)||C.test(f)||b.test(f))break;d+=` +`+p}!g&&!p.trim()&&(g=!0),h+=k+` +`,e=e.substring(k.length+1),f=S.slice(m)}}a.loose||(o?a.loose=!0:this.rules.other.doubleBlankLine.test(h)&&(o=!0));let y=null,v;this.options.gfm&&(y=this.rules.other.listIsTask.exec(d),y&&(v=y[0]!=="[ ] ",d=d.replace(this.rules.other.listReplaceTask,""))),a.items.push({type:"list_item",raw:h,task:!!y,checked:v,loose:!1,text:d,tokens:[]}),a.raw+=h}let l=a.items.at(-1);if(l)l.raw=l.raw.trimEnd(),l.text=l.text.trimEnd();else return;a.raw=a.raw.trimEnd();for(let u=0;uf.type==="space"),d=h.length>0&&h.some(f=>this.rules.other.anyLine.test(f.raw));a.loose=d}if(a.loose)for(let u=0;u({text:u,tokens:this.lexer.inline(u),header:!1,align:s.align[h]})));return s}}lheading(e){let r=this.rules.block.lheading.exec(e);if(r)return{type:"heading",raw:r[0],depth:r[2].charAt(0)==="="?1:2,text:r[1],tokens:this.lexer.inline(r[1])}}paragraph(e){let r=this.rules.block.paragraph.exec(e);if(r){let n=r[1].charAt(r[1].length-1)===` +`?r[1].slice(0,-1):r[1];return{type:"paragraph",raw:r[0],text:n,tokens:this.lexer.inline(n)}}}text(e){let r=this.rules.block.text.exec(e);if(r)return{type:"text",raw:r[0],text:r[0],tokens:this.lexer.inline(r[0])}}escape(e){let r=this.rules.inline.escape.exec(e);if(r)return{type:"escape",raw:r[0],text:r[1]}}tag(e){let r=this.rules.inline.tag.exec(e);if(r)return!this.lexer.state.inLink&&this.rules.other.startATag.test(r[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(r[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(r[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(r[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:r[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:r[0]}}link(e){let r=this.rules.inline.link.exec(e);if(r){let n=r[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;let s=Rx(n.slice(0,-1),"\\");if((n.length-s.length)%2===0)return}else{let s=tIe(r[2],"()");if(s===-2)return;if(s>-1){let o=(r[0].indexOf("!")===0?5:4)+r[1].length+s;r[2]=r[2].substring(0,s),r[0]=r[0].substring(0,o).trim(),r[3]=""}}let i=r[2],a="";if(this.options.pedantic){let s=this.rules.other.pedanticHrefTitle.exec(i);s&&(i=s[1],a=s[3])}else a=r[3]?r[3].slice(1,-1):"";return i=i.trim(),this.rules.other.startAngleBracket.test(i)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?i=i.slice(1):i=i.slice(1,-1)),oX(r,{href:i&&i.replace(this.rules.inline.anyPunctuation,"$1"),title:a&&a.replace(this.rules.inline.anyPunctuation,"$1")},r[0],this.lexer,this.rules)}}reflink(e,r){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let i=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),a=r[i.toLowerCase()];if(!a){let s=n[0].charAt(0);return{type:"text",raw:s,text:s}}return oX(n,a,n[0],this.lexer,this.rules)}}emStrong(e,r,n=""){let i=this.rules.inline.emStrongLDelim.exec(e);if(!(!i||i[3]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(i[1]||i[2])||!n||this.rules.inline.punctuation.exec(n))){let a=[...i[0]].length-1,s,o,l=a,u=0,h=i[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(h.lastIndex=0,r=r.slice(-1*e.length+a);(i=h.exec(r))!=null;){if(s=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!s)continue;if(o=[...s].length,i[3]||i[4]){l+=o;continue}else if((i[5]||i[6])&&a%3&&!((a+o)%3)){u+=o;continue}if(l-=o,l>0)continue;o=Math.min(o,o+l+u);let d=[...i[0]][0].length,f=e.slice(0,a+i.index+d+o);if(Math.min(a,o)%2){let g=f.slice(1,-1);return{type:"em",raw:f,text:g,tokens:this.lexer.inlineTokens(g)}}let p=f.slice(2,-2);return{type:"strong",raw:f,text:p,tokens:this.lexer.inlineTokens(p)}}}}codespan(e){let r=this.rules.inline.code.exec(e);if(r){let n=r[2].replace(this.rules.other.newLineCharGlobal," "),i=this.rules.other.nonSpaceChar.test(n),a=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return i&&a&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:r[0],text:n}}}br(e){let r=this.rules.inline.br.exec(e);if(r)return{type:"br",raw:r[0]}}del(e){let r=this.rules.inline.del.exec(e);if(r)return{type:"del",raw:r[0],text:r[2],tokens:this.lexer.inlineTokens(r[2])}}autolink(e){let r=this.rules.inline.autolink.exec(e);if(r){let n,i;return r[2]==="@"?(n=r[1],i="mailto:"+n):(n=r[1],i=n),{type:"link",raw:r[0],text:n,href:i,tokens:[{type:"text",raw:n,text:n}]}}}url(e){var n;let r;if(r=this.rules.inline.url.exec(e)){let i,a;if(r[2]==="@")i=r[0],a="mailto:"+i;else{let s;do s=r[0],r[0]=((n=this.rules.inline._backpedal.exec(r[0]))==null?void 0:n[0])??"";while(s!==r[0]);i=r[0],r[1]==="www."?a="http://"+r[0]:a=r[0]}return{type:"link",raw:r[0],text:i,href:a,tokens:[{type:"text",raw:i,text:i}]}}}inlineText(e){let r=this.rules.inline.text.exec(e);if(r){let n=this.lexer.state.inRawBlock;return{type:"text",raw:r[0],text:r[0],escaped:n}}}},vl=class Cq{constructor(e){tn(this,"tokens");tn(this,"options");tn(this,"state");tn(this,"tokenizer");tn(this,"inlineQueue");this.tokens=[],this.tokens.links=Object.create(null),this.options=e||ff,this.options.tokenizer=this.options.tokenizer||new Yk,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let r={other:ms,block:Hk.normal,inline:Ax.normal};this.options.pedantic?(r.block=Hk.pedantic,r.inline=Ax.pedantic):this.options.gfm&&(r.block=Hk.gfm,this.options.breaks?r.inline=Ax.breaks:r.inline=Ax.gfm),this.tokenizer.rules=r}static get rules(){return{block:Hk,inline:Ax}}static lex(e,r){return new Cq(r).lex(e)}static lexInline(e,r){return new Cq(r).inlineTokens(e)}lex(e){e=e.replace(ms.carriageReturn,` +`),this.blockTokens(e,this.tokens);for(let r=0;r(o=u.call({lexer:this},e,r))?(e=e.substring(o.raw.length),r.push(o),!0):!1))continue;if(o=this.tokenizer.space(e)){e=e.substring(o.raw.length);let u=r.at(-1);o.raw.length===1&&u!==void 0?u.raw+=` `:r.push(o);continue}if(o=this.tokenizer.code(e)){e=e.substring(o.raw.length);let u=r.at(-1);(u==null?void 0:u.type)==="paragraph"||(u==null?void 0:u.type)==="text"?(u.raw+=(u.raw.endsWith(` `)?"":` `)+o.raw,u.text+=` @@ -196,16 +196,16 @@ ${d}`:d;let f=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTo `+o.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=u.text):r.push(o),n=l.length!==e.length,e=e.substring(o.raw.length);continue}if(o=this.tokenizer.text(e)){e=e.substring(o.raw.length);let u=r.at(-1);(u==null?void 0:u.type)==="text"?(u.raw+=(u.raw.endsWith(` `)?"":` `)+o.raw,u.text+=` -`+o.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=u.text):r.push(o);continue}if(e){let u="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(u);break}else throw new Error(u)}}return this.state.top=!0,r}inline(e,r=[]){return this.inlineQueue.push({src:e,tokens:r}),r}inlineTokens(e,r=[]){var l,u,h,d,f;let n=e,i=null;if(this.tokens.links){let p=Object.keys(this.tokens.links);if(p.length>0)for(;(i=this.tokenizer.rules.inline.reflinkSearch.exec(n))!=null;)p.includes(i[0].slice(i[0].lastIndexOf("[")+1,-1))&&(n=n.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(i=this.tokenizer.rules.inline.anyPunctuation.exec(n))!=null;)n=n.slice(0,i.index)+"++"+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let a;for(;(i=this.tokenizer.rules.inline.blockSkip.exec(n))!=null;)a=i[2]?i[2].length:0,n=n.slice(0,i.index+a)+"["+"a".repeat(i[0].length-a-2)+"]"+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);n=((u=(l=this.options.hooks)==null?void 0:l.emStrongMask)==null?void 0:u.call({lexer:this},n))??n;let s=!1,o="";for(;e;){s||(o=""),s=!1;let p;if((d=(h=this.options.extensions)==null?void 0:h.inline)!=null&&d.some(m=>(p=m.call({lexer:this},e,r))?(e=e.substring(p.raw.length),r.push(p),!0):!1))continue;if(p=this.tokenizer.escape(e)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.tag(e)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.link(e)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(p.raw.length);let m=r.at(-1);p.type==="text"&&(m==null?void 0:m.type)==="text"?(m.raw+=p.raw,m.text+=p.text):r.push(p);continue}if(p=this.tokenizer.emStrong(e,n,o)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.codespan(e)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.br(e)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.del(e)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.autolink(e)){e=e.substring(p.raw.length),r.push(p);continue}if(!this.state.inLink&&(p=this.tokenizer.url(e))){e=e.substring(p.raw.length),r.push(p);continue}let g=e;if((f=this.options.extensions)!=null&&f.startInline){let m=1/0,y=e.slice(1),v;this.options.extensions.startInline.forEach(T=>{v=T.call({lexer:this},y),typeof v=="number"&&v>=0&&(m=Math.min(m,v))}),m<1/0&&m>=0&&(g=e.substring(0,m+1))}if(p=this.tokenizer.inlineText(g)){e=e.substring(p.raw.length),p.raw.slice(-1)!=="_"&&(o=p.raw.slice(-1)),s=!0;let m=r.at(-1);(m==null?void 0:m.type)==="text"?(m.raw+=p.raw,m.text+=p.text):r.push(p);continue}if(e){let m="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(m);break}else throw new Error(m)}}return r}},G4=class{constructor(e){Hr(this,"options");Hr(this,"parser");this.options=e||ud}space(e){return""}code({text:e,lang:r,escaped:n}){var s;let i=(s=(r||"").match(Va.notSpaceStart))==null?void 0:s[0],a=e.replace(Va.endingNewline,"")+` -`;return i?'
'+(n?a:vl(a,!0))+`
-`:"
"+(n?a:vl(a,!0))+`
+`+o.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=u.text):r.push(o);continue}if(e){let u="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(u);break}else throw new Error(u)}}return this.state.top=!0,r}inline(e,r=[]){return this.inlineQueue.push({src:e,tokens:r}),r}inlineTokens(e,r=[]){var l,u,h,d,f;let n=e,i=null;if(this.tokens.links){let p=Object.keys(this.tokens.links);if(p.length>0)for(;(i=this.tokenizer.rules.inline.reflinkSearch.exec(n))!=null;)p.includes(i[0].slice(i[0].lastIndexOf("[")+1,-1))&&(n=n.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(i=this.tokenizer.rules.inline.anyPunctuation.exec(n))!=null;)n=n.slice(0,i.index)+"++"+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let a;for(;(i=this.tokenizer.rules.inline.blockSkip.exec(n))!=null;)a=i[2]?i[2].length:0,n=n.slice(0,i.index+a)+"["+"a".repeat(i[0].length-a-2)+"]"+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);n=((u=(l=this.options.hooks)==null?void 0:l.emStrongMask)==null?void 0:u.call({lexer:this},n))??n;let s=!1,o="";for(;e;){s||(o=""),s=!1;let p;if((d=(h=this.options.extensions)==null?void 0:h.inline)!=null&&d.some(m=>(p=m.call({lexer:this},e,r))?(e=e.substring(p.raw.length),r.push(p),!0):!1))continue;if(p=this.tokenizer.escape(e)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.tag(e)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.link(e)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(p.raw.length);let m=r.at(-1);p.type==="text"&&(m==null?void 0:m.type)==="text"?(m.raw+=p.raw,m.text+=p.text):r.push(p);continue}if(p=this.tokenizer.emStrong(e,n,o)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.codespan(e)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.br(e)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.del(e)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.autolink(e)){e=e.substring(p.raw.length),r.push(p);continue}if(!this.state.inLink&&(p=this.tokenizer.url(e))){e=e.substring(p.raw.length),r.push(p);continue}let g=e;if((f=this.options.extensions)!=null&&f.startInline){let m=1/0,y=e.slice(1),v;this.options.extensions.startInline.forEach(x=>{v=x.call({lexer:this},y),typeof v=="number"&&v>=0&&(m=Math.min(m,v))}),m<1/0&&m>=0&&(g=e.substring(0,m+1))}if(p=this.tokenizer.inlineText(g)){e=e.substring(p.raw.length),p.raw.slice(-1)!=="_"&&(o=p.raw.slice(-1)),s=!0;let m=r.at(-1);(m==null?void 0:m.type)==="text"?(m.raw+=p.raw,m.text+=p.text):r.push(p);continue}if(e){let m="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(m);break}else throw new Error(m)}}return r}},Xk=class{constructor(e){tn(this,"options");tn(this,"parser");this.options=e||ff}space(e){return""}code({text:e,lang:r,escaped:n}){var s;let i=(s=(r||"").match(ms.notSpaceStart))==null?void 0:s[0],a=e.replace(ms.endingNewline,"")+` +`;return i?'
'+(n?a:ic(a,!0))+`
+`:"
"+(n?a:ic(a,!0))+`
`}blockquote({tokens:e}){return`
${this.parser.parse(e)}
`}html({text:e}){return e}def(e){return""}heading({tokens:e,depth:r}){return`${this.parser.parseInline(e)} `}hr(e){return`
`}list(e){let r=e.ordered,n=e.start,i="";for(let o=0;o `+i+" -`}listitem(e){var n;let r="";if(e.task){let i=this.checkbox({checked:!!e.checked});e.loose?((n=e.tokens[0])==null?void 0:n.type)==="paragraph"?(e.tokens[0].text=i+" "+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&e.tokens[0].tokens[0].type==="text"&&(e.tokens[0].tokens[0].text=i+" "+vl(e.tokens[0].tokens[0].text),e.tokens[0].tokens[0].escaped=!0)):e.tokens.unshift({type:"text",raw:i+" ",text:i+" ",escaped:!0}):r+=i+" "}return r+=this.parser.parse(e.tokens,!!e.loose),`
  • ${r}
  • +`}listitem(e){var n;let r="";if(e.task){let i=this.checkbox({checked:!!e.checked});e.loose?((n=e.tokens[0])==null?void 0:n.type)==="paragraph"?(e.tokens[0].text=i+" "+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&e.tokens[0].tokens[0].type==="text"&&(e.tokens[0].tokens[0].text=i+" "+ic(e.tokens[0].tokens[0].text),e.tokens[0].tokens[0].escaped=!0)):e.tokens.unshift({type:"text",raw:i+" ",text:i+" ",escaped:!0}):r+=i+" "}return r+=this.parser.parse(e.tokens,!!e.loose),`
  • ${r}
  • `}checkbox({checked:e}){return"'}paragraph({tokens:e}){return`

    ${this.parser.parseInline(e)}

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

    An error occurred:

    "+vl(n.message+"",!0)+"
    ";return r?Promise.resolve(i):i}if(r)return Promise.reject(n);throw n}}},hd=new zSe;function ln(t,e){return hd.parse(t,e)}ln.options=ln.setOptions=function(t){return hd.setOptions(t),ln.defaults=hd.defaults,mV(ln.defaults),ln},ln.getDefaults=y_,ln.defaults=ud,ln.use=function(...t){return hd.use(...t),ln.defaults=hd.defaults,mV(ln.defaults),ln},ln.walkTokens=function(t,e){return hd.walkTokens(t,e)},ln.parseInline=hd.parseInline,ln.Parser=No,ln.parser=No.parse,ln.Renderer=G4,ln.TextRenderer=S_,ln.Lexer=Mo,ln.lexer=Mo.lex,ln.Tokenizer=z4,ln.Hooks=Z2,ln.parse=ln,ln.options,ln.setOptions,ln.use,ln.walkTokens,ln.parseInline,No.parse,Mo.lex;function MV(t){for(var e=[],r=1;r${this.parser.parseInline(e)}`}em({tokens:e}){return`${this.parser.parseInline(e)}`}codespan({text:e}){return`${ic(e,!0)}`}br(e){return"
    "}del({tokens:e}){return`${this.parser.parseInline(e)}`}link({href:e,title:r,tokens:n}){let i=this.parser.parseInline(n),a=aX(e);if(a===null)return i;e=a;let s='
    ",s}image({href:e,title:r,text:n,tokens:i}){i&&(n=this.parser.parseInline(i,this.parser.textRenderer));let a=aX(e);if(a===null)return ic(n);e=a;let s=`${n}{let u=o[l].flat(1/0);n=n.concat(this.walkTokens(u,r))}):o.tokens&&(n=n.concat(this.walkTokens(o.tokens,r)))}}return n}use(...e){let r=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(n=>{let i={...n};if(i.async=this.defaults.async||i.async||!1,n.extensions&&(n.extensions.forEach(a=>{if(!a.name)throw new Error("extension name required");if("renderer"in a){let s=r.renderers[a.name];s?r.renderers[a.name]=function(...o){let l=a.renderer.apply(this,o);return l===!1&&(l=s.apply(this,o)),l}:r.renderers[a.name]=a.renderer}if("tokenizer"in a){if(!a.level||a.level!=="block"&&a.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let s=r[a.level];s?s.unshift(a.tokenizer):r[a.level]=[a.tokenizer],a.start&&(a.level==="block"?r.startBlock?r.startBlock.push(a.start):r.startBlock=[a.start]:a.level==="inline"&&(r.startInline?r.startInline.push(a.start):r.startInline=[a.start]))}"childTokens"in a&&a.childTokens&&(r.childTokens[a.name]=a.childTokens)}),i.extensions=r),n.renderer){let a=this.defaults.renderer||new Xk(this.defaults);for(let s in n.renderer){if(!(s in a))throw new Error(`renderer '${s}' does not exist`);if(["options","parser"].includes(s))continue;let o=s,l=n.renderer[o],u=a[o];a[o]=(...h)=>{let d=l.apply(a,h);return d===!1&&(d=u.apply(a,h)),d||""}}i.renderer=a}if(n.tokenizer){let a=this.defaults.tokenizer||new Yk(this.defaults);for(let s in n.tokenizer){if(!(s in a))throw new Error(`tokenizer '${s}' does not exist`);if(["options","rules","lexer"].includes(s))continue;let o=s,l=n.tokenizer[o],u=a[o];a[o]=(...h)=>{let d=l.apply(a,h);return d===!1&&(d=u.apply(a,h)),d}}i.tokenizer=a}if(n.hooks){let a=this.defaults.hooks||new Lx;for(let s in n.hooks){if(!(s in a))throw new Error(`hook '${s}' does not exist`);if(["options","block"].includes(s))continue;let o=s,l=n.hooks[o],u=a[o];Lx.passThroughHooks.has(s)?a[o]=h=>{if(this.defaults.async&&Lx.passThroughHooksRespectAsync.has(s))return(async()=>{let f=await l.call(a,h);return u.call(a,f)})();let d=l.call(a,h);return u.call(a,d)}:a[o]=(...h)=>{if(this.defaults.async)return(async()=>{let f=await l.apply(a,h);return f===!1&&(f=await u.apply(a,h)),f})();let d=l.apply(a,h);return d===!1&&(d=u.apply(a,h)),d}}i.hooks=a}if(n.walkTokens){let a=this.defaults.walkTokens,s=n.walkTokens;i.walkTokens=function(o){let l=[];return l.push(s.call(this,o)),a&&(l=l.concat(a.call(this,o))),l}}this.defaults={...this.defaults,...i}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,r){return vl.lex(e,r??this.defaults)}parser(e,r){return bl.parse(e,r??this.defaults)}parseMarkdown(e){return(r,n)=>{let i={...n},a={...this.defaults,...i},s=this.onError(!!a.silent,!!a.async);if(this.defaults.async===!0&&i.async===!1)return s(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof r>"u"||r===null)return s(new Error("marked(): input parameter is undefined or null"));if(typeof r!="string")return s(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(r)+", string expected"));if(a.hooks&&(a.hooks.options=a,a.hooks.block=e),a.async)return(async()=>{let o=a.hooks?await a.hooks.preprocess(r):r,l=await(a.hooks?await a.hooks.provideLexer():e?vl.lex:vl.lexInline)(o,a),u=a.hooks?await a.hooks.processAllTokens(l):l;a.walkTokens&&await Promise.all(this.walkTokens(u,a.walkTokens));let h=await(a.hooks?await a.hooks.provideParser():e?bl.parse:bl.parseInline)(u,a);return a.hooks?await a.hooks.postprocess(h):h})().catch(s);try{a.hooks&&(r=a.hooks.preprocess(r));let o=(a.hooks?a.hooks.provideLexer():e?vl.lex:vl.lexInline)(r,a);a.hooks&&(o=a.hooks.processAllTokens(o)),a.walkTokens&&this.walkTokens(o,a.walkTokens);let l=(a.hooks?a.hooks.provideParser():e?bl.parse:bl.parseInline)(o,a);return a.hooks&&(l=a.hooks.postprocess(l)),l}catch(o){return s(o)}}}onError(e,r){return n=>{if(n.message+=` +Please report this to https://github.com/markedjs/marked.`,e){let i="

    An error occurred:

    "+ic(n.message+"",!0)+"
    ";return r?Promise.resolve(i):i}if(r)return Promise.reject(n);throw n}}},pf=new nIe;function yn(t,e){return pf.parse(t,e)}yn.options=yn.setOptions=function(t){return pf.setOptions(t),yn.defaults=pf.defaults,UY(yn.defaults),yn},yn.getDefaults=m8,yn.defaults=ff,yn.use=function(...t){return pf.use(...t),yn.defaults=pf.defaults,UY(yn.defaults),yn},yn.walkTokens=function(t,e){return pf.walkTokens(t,e)},yn.parseInline=pf.parseInline,yn.Parser=bl,yn.parser=bl.parse,yn.Renderer=Xk,yn.TextRenderer=E8,yn.Lexer=vl,yn.lexer=vl.lex,yn.Tokenizer=Yk,yn.Hooks=Lx,yn.parse=yn,yn.options,yn.setOptions,yn.use,yn.walkTokens,yn.parseInline,bl.parse,vl.lex;function lX(t){for(var e=[],r=1;r?',height:80,width:80},A_=new Map,OV=new Map,$V=x(t=>{for(const e of t){if(!e.name)throw new Error('Invalid icon loader. Must have a "name" property with non-empty string value.');if(ae.debug("Registering icon pack:",e.name),"loader"in e)OV.set(e.name,e.loader);else if("icons"in e)A_.set(e.name,e.icons);else throw ae.error("Invalid icon loader:",e),new Error('Invalid icon loader. Must have either "icons" or "loader" property.')}},"registerIconPacks"),PV=x(async(t,e)=>{const r=VEe(t,!0,e!==void 0);if(!r)throw new Error(`Invalid icon name: ${t}`);const n=r.prefix||e;if(!n)throw new Error(`Icon name must contain a prefix: ${t}`);let i=A_.get(n);if(!i){const s=OV.get(n);if(!s)throw new Error(`Icon set not found: ${r.prefix}`);try{i={...await s(),prefix:n},A_.set(n,i)}catch(o){throw ae.error(o),new Error(`Failed to load icon set: ${r.prefix}`)}}const a=HEe(i,r.name);if(!a)throw new Error(`Icon not found: ${t}`);return a},"getRegisteredIconData"),GSe=x(async t=>{try{return await PV(t),!0}catch{return!1}},"isIconAvailable"),Lu=x(async(t,e,r)=>{let n;try{n=await PV(t,e==null?void 0:e.fallbackPrefix)}catch(s){ae.error(s),n=NV}const i=JEe(n,e),a=nSe(rSe(i.body),{...i.attributes,...r});return qr(a,lr())},"getIconSVG");function BV(t,{markdownAutoWrap:e}){const n=t.replace(//g,` +`)),s+=d+n[l+1]}),s}var cX={body:'?',height:80,width:80},S8=new Map,uX=new Map,hX=T(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(se.debug("Registering icon pack:",e.name),"loader"in e)uX.set(e.name,e.loader);else if("icons"in e)S8.set(e.name,e.icons);else throw se.error("Invalid icon loader:",e),new Error('Invalid icon loader. Must have either "icons" or "loader" property.')}},"registerIconPacks"),dX=T(async(t,e)=>{const r=sLe(t,!0,e!==void 0);if(!r)throw new Error(`Invalid icon name: ${t}`);const n=r.prefix||e;if(!n)throw new Error(`Icon name must contain a prefix: ${t}`);let i=S8.get(n);if(!i){const s=uX.get(n);if(!s)throw new Error(`Icon set not found: ${r.prefix}`);try{i={...await s(),prefix:n},S8.set(n,i)}catch(o){throw se.error(o),new Error(`Failed to load icon set: ${r.prefix}`)}}const a=cLe(i,r.name);if(!a)throw new Error(`Icon not found: ${t}`);return a},"getRegisteredIconData"),iIe=T(async t=>{try{return await dX(t),!0}catch{return!1}},"isIconAvailable"),Rh=T(async(t,e,r)=>{let n;try{n=await dX(t,e==null?void 0:e.fallbackPrefix)}catch(s){se.error(s),n=cX}const i=mLe(n,e),a=xLe(bLe(i.body),{...i.attributes,...r});return Zr(a,pr())},"getIconSVG");function fX(t,{markdownAutoWrap:e}){const n=t.replace(//g,` `).replace(/\n{2,}/g,` -`);return MV(n)}x(BV,"preprocessMarkdown");function FV(t){return t.split(/\\n|\n|/gi).map(e=>{var r;return((r=e.trim().match(/<[^>]+>|[^\s<>]+/g))==null?void 0:r.map(n=>({content:n,type:"normal"})))??[]})}x(FV,"nonMarkdownToLines");function zV(t,e={}){const r=BV(t,e),n=ln.lexer(r),i=[[]];let a=0;function s(o,l="normal"){o.type==="text"?o.text.split(` -`).forEach((h,d)=>{d!==0&&(a++,i.push([])),h.split(" ").forEach(f=>{f=f.replace(/'/g,"'"),f&&i[a].push({content:f,type:l})})}):o.type==="strong"||o.type==="em"?o.tokens.forEach(u=>{s(u,o.type)}):o.type==="html"&&i[a].push({content:o.text,type:"normal"})}return x(s,"processNode"),n.forEach(o=>{var l;o.type==="paragraph"?(l=o.tokens)==null||l.forEach(u=>{s(u)}):o.type==="html"?i[a].push({content:o.text,type:"normal"}):i[a].push({content:o.raw,type:"normal"})}),i}x(zV,"markdownToLines");function GV(t){return t?`

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

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

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

    `:i.type==="space"?"":i.type==="html"?`${i.text}`:i.type==="escape"?i.text:(ae.warn(`Unsupported markdown: ${i.type}`),i.raw)}return x(n,"output"),r.map(n).join("")}x(qV,"markdownToHTML");function VV(t){return Intl.Segmenter?[...new Intl.Segmenter().segment(t)].map(e=>e.segment):[...t]}x(VV,"splitTextToChars");function WV(t,e){const r=VV(e.content);return __(t,[],r,e.type)}x(WV,"splitWordToFitWidth");function __(t,e,r,n){if(r.length===0)return[{content:e.join(""),type:n},{content:"",type:n}];const[i,...a]=r,s=[...e,i];return t([{content:s.join(""),type:n}])?__(t,s,a,n):(e.length===0&&i&&(e.push(i),r.shift()),[{content:e.join(""),type:n},{content:r.join(""),type:n}])}x(__,"splitWordToFitWidthRecursion");function UV(t,e){if(t.some(({content:r})=>r.includes(` -`)))throw new Error("splitLineToFitWidth does not support newlines in the line");return q4(t,e)}x(UV,"splitLineToFitWidth");function q4(t,e,r=[],n=[]){if(t.length===0)return n.length>0&&r.push(n),r.length>0?r:[];let i="";t[0].content===" "&&(i=" ",t.shift());const a=t.shift()??{content:" ",type:"normal"},s=[...n];if(i!==""&&s.push({content:i,type:"normal"}),s.push(a),e(s))return q4(t,e,r,s);if(n.length>0)r.push(n),t.unshift(a);else if(a.content){const[o,l]=WV(e,a);r.push([o]),l.content&&t.unshift(l)}return q4(t,e,r)}x(q4,"splitLineToFitWidthRecursion");function R_(t,e){e&&t.attr("style",e)}x(R_,"applyStyle");var HV=16384;async function YV(t,e,r,n,i=!1,a=lr()){const s=t.append("foreignObject");s.attr("width",`${Math.min(10*r,HV)}px`),s.attr("height",`${Math.min(10*r,HV)}px`);const o=s.append("xhtml:div"),l=ui(e.label)?await _w(e.label.replace(Lt.lineBreakRegex,` -`),a):qr(e.label,a),u=e.isNode?"nodeLabel":"edgeLabel",h=o.append("span");h.html(l),R_(h,e.labelStyle),h.attr("class",`${u} ${n}`),R_(o,e.labelStyle),o.style("display","table-cell"),o.style("white-space","nowrap"),o.style("line-height","1.5"),r!==Number.POSITIVE_INFINITY&&(o.style("max-width",r+"px"),o.style("text-align","center")),o.attr("xmlns","http://www.w3.org/1999/xhtml"),i&&o.attr("class","labelBkg");let d=o.node().getBoundingClientRect();return d.width===r&&(o.style("display","table"),o.style("white-space","break-spaces"),o.style("width",r+"px"),d=o.node().getBoundingClientRect()),s.node()}x(YV,"addHtmlSpan");function V4(t,e,r,n=!1){const i=t.append("tspan").attr("class","text-outer-tspan").attr("x",0).attr("y",e*r-.1+"em").attr("dy",r+"em");return n&&i.attr("text-anchor","middle"),i}x(V4,"createTspan");function XV(t,e,r){const n=t.append("text"),i=V4(n,1,e);W4(i,r);const a=i.node().getComputedTextLength();return n.remove(),a}x(XV,"computeWidthOfText");function KV(t,e,r){var s;const n=t.append("text"),i=V4(n,1,e);W4(i,[{content:r,type:"normal"}]);const a=(s=i.node())==null?void 0:s.getBoundingClientRect();return a&&n.remove(),a}x(KV,"computeDimensionOfText");function jV(t,e,r,n=!1,i=!1){const s=e.append("g"),o=s.insert("rect").attr("class","background").attr("style","stroke: none"),l=s.append("text").attr("y","-10.1");i&&l.attr("text-anchor","middle");let u=0;for(const h of r){const d=x(p=>XV(s,1.1,p)<=t,"checkWidth"),f=d(h)?[h]:UV(h,d);for(const p of f){const g=V4(l,u,1.1,i);W4(g,p),u++}}if(n){const h=l.node().getBBox(),d=2;return o.attr("x",h.x-d).attr("y",h.y-d).attr("width",h.width+2*d).attr("height",h.height+2*d),s.node()}else return l.node()}x(jV,"createFormattedText");function L_(t){const e=/&(amp|lt|gt);/g;return t.replace(e,(r,n)=>{switch(n){case"amp":return"&";case"lt":return"<";case"gt":return">";default:return r}})}x(L_,"decodeHTMLEntities");function W4(t,e){t.text(""),e.forEach((r,n)=>{const i=t.append("tspan").attr("font-style",r.type==="em"?"italic":"normal").attr("class","text-inner-tspan").attr("font-weight",r.type==="strong"?"bold":"normal");n===0?i.text(L_(r.content)):i.text(" "+L_(r.content))})}x(W4,"updateTextContentAndStyles");async function ZV(t,e={}){const r=[];t.replace(/(fa[bklrs]?):fa-([\w-]+)/g,(i,a,s)=>(r.push((async()=>{const o=`${a}:${s}`;return await GSe(o)?await Lu(o,void 0,{class:"label-icon"}):``})()),i));const n=await Promise.all(r);return t.replace(/(fa[bklrs]?):fa-([\w-]+)/g,()=>n.shift()??"")}x(ZV,"replaceIconSubstring");var Wa=x(async(t,e="",{style:r="",isTitle:n=!1,classes:i="",useHtmlLabels:a=!0,markdown:s=!0,isNode:o=!0,width:l=200,addSvgBackground:u=!1}={},h)=>{if(ae.debug("XYZ createText",e,r,n,i,a,o,"addSvgBackground: ",u),a){const d=s?qV(e,h):GV(e),f=await ZV(Tc(d),h),p=e.replace(/\\\\/g,"\\"),g={isNode:o,label:ui(e)?p:f,labelStyle:r.replace("fill:","color:")};return await YV(t,g,l,i,u,h)}else{const d=Tc(e.replace(//g,"
    ")),f=s?zV(d.replace("
    ","
    "),h):FV(d),p=jV(l,t,f,e?u:!1,!o);if(o){/stroke:/.exec(r)&&(r=r.replace("stroke:","lineColor:"));const g=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");pt(p).attr("style",g)}else{const g=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/background:/g,"fill:");pt(p).select("rect").attr("style",g.replace(/background:/g,"fill:"));const m=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");pt(p).select("text").attr("style",m)}return n?pt(p).selectAll("tspan.text-outer-tspan").classed("title-row",!0):pt(p).selectAll("tspan.text-outer-tspan").classed("row",!0),p}},"createText");function I_(t,e,r){if(t&&t.length){const[n,i]=e,a=Math.PI/180*r,s=Math.cos(a),o=Math.sin(a);for(const l of t){const[u,h]=l;l[0]=(u-n)*s-(h-i)*o+n,l[1]=(u-n)*o+(h-i)*s+i}}}function qSe(t,e){return t[0]===e[0]&&t[1]===e[1]}function VSe(t,e,r,n=1){const i=r,a=Math.max(e,.1),s=t[0]&&t[0][0]&&typeof t[0][0]=="number"?[t]:t,o=[0,0];if(i)for(const u of s)I_(u,o,i);const l=(function(u,h,d){const f=[];for(const T of u){const b=[...T];qSe(b[0],b[b.length-1])||b.push([b[0][0],b[0][1]]),b.length>2&&f.push(b)}const p=[];h=Math.max(h,.1);const g=[];for(const T of f)for(let b=0;bT.yminb.ymin?1:T.xb.x?1:T.ymax===b.ymax?0:(T.ymax-b.ymax)/Math.abs(T.ymax-b.ymax))),!g.length)return p;let m=[],y=g[0].ymin,v=0;for(;m.length||g.length;){if(g.length){let T=-1;for(let b=0;by);b++)T=b;g.splice(0,T+1).forEach((b=>{m.push({s:y,edge:b})}))}if(m=m.filter((T=>!(T.edge.ymax<=y))),m.sort(((T,b)=>T.edge.x===b.edge.x?0:(T.edge.x-b.edge.x)/Math.abs(T.edge.x-b.edge.x))),(d!==1||v%h==0)&&m.length>1)for(let T=0;T=m.length)break;const w=m[T].edge,k=m[b].edge;p.push([[Math.round(w.x),y],[Math.round(k.x),y]])}y+=d,m.forEach((T=>{T.edge.x=T.edge.x+d*T.edge.islope})),v++}return p})(s,a,n);if(i){for(const u of s)I_(u,o,-i);(function(u,h,d){const f=[];u.forEach((p=>f.push(...p))),I_(f,h,d)})(l,o,-i)}return l}function Q2(t,e){var r;const n=e.hachureAngle+90;let i=e.hachureGap;i<0&&(i=4*e.strokeWidth),i=Math.round(Math.max(i,.1));let a=1;return e.roughness>=1&&(((r=e.randomizer)===null||r===void 0?void 0:r.next())||Math.random())>.7&&(a=i),VSe(t,i,n,a||1)}class D_{constructor(e){this.helper=e}fillPolygons(e,r){return this._fillPolygons(e,r)}_fillPolygons(e,r){const n=Q2(e,r);return{type:"fillSketch",ops:this.renderLines(n,r)}}renderLines(e,r){const n=[];for(const i of e)n.push(...this.helper.doubleLineOps(i[0][0],i[0][1],i[1][0],i[1][1],r));return n}}function U4(t){const e=t[0],r=t[1];return Math.sqrt(Math.pow(e[0]-r[0],2)+Math.pow(e[1]-r[1],2))}class WSe extends D_{fillPolygons(e,r){let n=r.hachureGap;n<0&&(n=4*r.strokeWidth),n=Math.max(n,.1);const i=Q2(e,Object.assign({},r,{hachureGap:n})),a=Math.PI/180*r.hachureAngle,s=[],o=.5*n*Math.cos(a),l=.5*n*Math.sin(a);for(const[u,h]of i)U4([u,h])&&s.push([[u[0]-o,u[1]+l],[...h]],[[u[0]+o,u[1]-l],[...h]]);return{type:"fillSketch",ops:this.renderLines(s,r)}}}class USe extends D_{fillPolygons(e,r){const n=this._fillPolygons(e,r),i=Object.assign({},r,{hachureAngle:r.hachureAngle+90}),a=this._fillPolygons(e,i);return n.ops=n.ops.concat(a.ops),n}}let HSe=class{constructor(e){this.helper=e}fillPolygons(e,r){const n=Q2(e,r=Object.assign({},r,{hachureAngle:0}));return this.dotsOnLines(n,r)}dotsOnLines(e,r){const n=[];let i=r.hachureGap;i<0&&(i=4*r.strokeWidth),i=Math.max(i,.1);let a=r.fillWeight;a<0&&(a=r.strokeWidth/2);const s=i/4;for(const o of e){const l=U4(o),u=l/i,h=Math.ceil(u)-1,d=l-h*i,f=(o[0][0]+o[1][0])/2-i/4,p=Math.min(o[0][1],o[1][1]);for(let g=0;g{const o=U4(s),l=Math.floor(o/(n+i)),u=(o+i-l*(n+i))/2;let h=s[0],d=s[1];h[0]>d[0]&&(h=s[1],d=s[0]);const f=Math.atan((d[1]-h[1])/(d[0]-h[0]));for(let p=0;p{const s=U4(a),o=Math.round(s/(2*r));let l=a[0],u=a[1];l[0]>u[0]&&(l=a[1],u=a[0]);const h=Math.atan((u[1]-l[1])/(u[0]-l[0]));for(let d=0;dh%2?u+r:u+e));a.push({key:"C",data:l}),e=l[4],r=l[5];break}case"Q":a.push({key:"Q",data:[...o]}),e=o[2],r=o[3];break;case"q":{const l=o.map(((u,h)=>h%2?u+r:u+e));a.push({key:"Q",data:l}),e=l[2],r=l[3];break}case"A":a.push({key:"A",data:[...o]}),e=o[5],r=o[6];break;case"a":e+=o[5],r+=o[6],a.push({key:"A",data:[o[0],o[1],o[2],o[3],o[4],e,r]});break;case"H":a.push({key:"H",data:[...o]}),e=o[0];break;case"h":e+=o[0],a.push({key:"H",data:[e]});break;case"V":a.push({key:"V",data:[...o]}),r=o[0];break;case"v":r+=o[0],a.push({key:"V",data:[r]});break;case"S":a.push({key:"S",data:[...o]}),e=o[2],r=o[3];break;case"s":{const l=o.map(((u,h)=>h%2?u+r:u+e));a.push({key:"S",data:l}),e=l[2],r=l[3];break}case"T":a.push({key:"T",data:[...o]}),e=o[0],r=o[1];break;case"t":e+=o[0],r+=o[1],a.push({key:"T",data:[e,r]});break;case"Z":case"z":a.push({key:"Z",data:[]}),e=n,r=i}return a}function eW(t){const e=[];let r="",n=0,i=0,a=0,s=0,o=0,l=0;for(const{key:u,data:h}of t){switch(u){case"M":e.push({key:"M",data:[...h]}),[n,i]=h,[a,s]=h;break;case"C":e.push({key:"C",data:[...h]}),n=h[4],i=h[5],o=h[2],l=h[3];break;case"L":e.push({key:"L",data:[...h]}),[n,i]=h;break;case"H":n=h[0],e.push({key:"L",data:[n,i]});break;case"V":i=h[0],e.push({key:"L",data:[n,i]});break;case"S":{let d=0,f=0;r==="C"||r==="S"?(d=n+(n-o),f=i+(i-l)):(d=n,f=i),e.push({key:"C",data:[d,f,...h]}),o=h[0],l=h[1],n=h[2],i=h[3];break}case"T":{const[d,f]=h;let p=0,g=0;r==="Q"||r==="T"?(p=n+(n-o),g=i+(i-l)):(p=n,g=i);const m=n+2*(p-n)/3,y=i+2*(g-i)/3,v=d+2*(p-d)/3,T=f+2*(g-f)/3;e.push({key:"C",data:[m,y,v,T,d,f]}),o=p,l=g,n=d,i=f;break}case"Q":{const[d,f,p,g]=h,m=n+2*(d-n)/3,y=i+2*(f-i)/3,v=p+2*(d-p)/3,T=g+2*(f-g)/3;e.push({key:"C",data:[m,y,v,T,p,g]}),o=d,l=f,n=p,i=g;break}case"A":{const d=Math.abs(h[0]),f=Math.abs(h[1]),p=h[2],g=h[3],m=h[4],y=h[5],v=h[6];d===0||f===0?(e.push({key:"C",data:[n,i,y,v,y,v]}),n=y,i=v):(n!==y||i!==v)&&(tW(n,i,y,v,d,f,p,g,m).forEach((function(T){e.push({key:"C",data:T})})),n=y,i=v);break}case"Z":e.push({key:"Z",data:[]}),n=a,i=s}r=u}return e}function J2(t,e,r){return[t*Math.cos(r)-e*Math.sin(r),t*Math.sin(r)+e*Math.cos(r)]}function tW(t,e,r,n,i,a,s,o,l,u){const h=(d=s,Math.PI*d/180);var d;let f=[],p=0,g=0,m=0,y=0;if(u)[p,g,m,y]=u;else{[t,e]=J2(t,e,-h),[r,n]=J2(r,n,-h);const F=(t-r)/2,S=(e-n)/2;let R=F*F/(i*i)+S*S/(a*a);R>1&&(R=Math.sqrt(R),i*=R,a*=R);const N=i*i,D=a*a,I=N*D-N*S*S-D*F*F,$=N*S*S+D*F*F,B=(o===l?-1:1)*Math.sqrt(Math.abs(I/$));m=B*i*S/a+(t+r)/2,y=B*-a*F/i+(e+n)/2,p=Math.asin(parseFloat(((e-y)/a).toFixed(9))),g=Math.asin(parseFloat(((n-y)/a).toFixed(9))),tg&&(p-=2*Math.PI),!l&&g>p&&(g-=2*Math.PI)}let v=g-p;if(Math.abs(v)>120*Math.PI/180){const F=g,S=r,R=n;g=l&&g>p?p+120*Math.PI/180*1:p+120*Math.PI/180*-1,f=tW(r=m+i*Math.cos(g),n=y+a*Math.sin(g),S,R,i,a,s,0,l,[g,F,m,y])}v=g-p;const T=Math.cos(p),b=Math.sin(p),w=Math.cos(g),k=Math.sin(g),A=Math.tan(v/4),C=4/3*i*A,_=4/3*a*A,L=[t,e],O=[t+C*b,e-_*T],M=[r+C*k,n-_*w],z=[r,n];if(O[0]=2*L[0]-O[0],O[1]=2*L[1]-O[1],u)return[O,M,z].concat(f);{f=[O,M,z].concat(f);const F=[];for(let S=0;S2){const i=[];for(let a=0;a2*Math.PI&&(p=0,g=2*Math.PI);const m=2*Math.PI/l.curveStepCount,y=Math.min(m/2,(g-p)/2),v=uW(y,u,h,d,f,p,g,1,l);if(!l.disableMultiStroke){const T=uW(y,u,h,d,f,p,g,1.5,l);v.push(...T)}return s&&(o?v.push(...Iu(u,h,u+d*Math.cos(p),h+f*Math.sin(p),l),...Iu(u,h,u+d*Math.cos(g),h+f*Math.sin(g),l)):v.push({op:"lineTo",data:[u,h]},{op:"lineTo",data:[u+d*Math.cos(p),h+f*Math.sin(p)]})),{type:"path",ops:v}}function sW(t,e){const r=eW(JV(O_(t))),n=[];let i=[0,0],a=[0,0];for(const{key:s,data:o}of r)switch(s){case"M":a=[o[0],o[1]],i=[o[0],o[1]];break;case"L":n.push(...Iu(a[0],a[1],o[0],o[1],e)),a=[o[0],o[1]];break;case"C":{const[l,u,h,d,f,p]=o;n.push(...JSe(l,u,h,d,f,p,a,e)),a=[f,p];break}case"Z":n.push(...Iu(a[0],a[1],i[0],i[1],e)),a=[i[0],i[1]]}return{type:"path",ops:n}}function P_(t,e){const r=[];for(const n of t)if(n.length){const i=e.maxRandomnessOffset||0,a=n.length;if(a>2){r.push({op:"move",data:[n[0][0]+wr(i,e),n[0][1]+wr(i,e)]});for(let s=1;s500?.4:-.0016668*l+1.233334;let h=i.maxRandomnessOffset||0;h*h*100>o&&(h=l/10);const d=h/2,f=.2+.2*lW(i);let p=i.bowing*i.maxRandomnessOffset*(n-e)/200,g=i.bowing*i.maxRandomnessOffset*(t-r)/200;p=wr(p,i,u),g=wr(g,i,u);const m=[],y=()=>wr(d,i,u),v=()=>wr(h,i,u),T=i.preserveVertices;return s?m.push({op:"move",data:[t+(T?0:y()),e+(T?0:y())]}):m.push({op:"move",data:[t+(T?0:wr(h,i,u)),e+(T?0:wr(h,i,u))]}),s?m.push({op:"bcurveTo",data:[p+t+(r-t)*f+y(),g+e+(n-e)*f+y(),p+t+2*(r-t)*f+y(),g+e+2*(n-e)*f+y(),r+(T?0:y()),n+(T?0:y())]}):m.push({op:"bcurveTo",data:[p+t+(r-t)*f+v(),g+e+(n-e)*f+v(),p+t+2*(r-t)*f+v(),g+e+2*(n-e)*f+v(),r+(T?0:v()),n+(T?0:v())]}),m}function K4(t,e,r){if(!t.length)return[];const n=[];n.push([t[0][0]+wr(e,r),t[0][1]+wr(e,r)]),n.push([t[0][0]+wr(e,r),t[0][1]+wr(e,r)]);for(let i=1;i3){const a=[],s=1-r.curveTightness;i.push({op:"move",data:[t[1][0],t[1][1]]});for(let o=1;o+21&&i.push(o)):i.push(o),i.push(t[e+3])}else{const l=t[e+0],u=t[e+1],h=t[e+2],d=t[e+3],f=dd(l,u,.5),p=dd(u,h,.5),g=dd(h,d,.5),m=dd(f,p,.5),y=dd(p,g,.5),v=dd(m,y,.5);F_([l,f,m,v],0,r,i),F_([v,y,g,d],0,r,i)}var a,s;return i}function t6e(t,e){return Q4(t,0,t.length,e)}function Q4(t,e,r,n,i){const a=i||[],s=t[e],o=t[r-1];let l=0,u=1;for(let h=e+1;hl&&(l=d,u=h)}return Math.sqrt(l)>n?(Q4(t,e,u+1,n,a),Q4(t,u,r,n,a)):(a.length||a.push(s),a.push(o)),a}function z_(t,e=.15,r){const n=[],i=(t.length-1)/3;for(let a=0;a0?Q4(n,0,n.length,r):n}const Bs="none";class J4{constructor(e){this.defaultOptions={maxRandomnessOffset:2,roughness:1,bowing:1,stroke:"#000",strokeWidth:1,curveTightness:0,curveFitting:.95,curveStepCount:9,fillStyle:"hachure",fillWeight:-1,hachureAngle:-41,hachureGap:-1,dashOffset:-1,dashGap:-1,zigzagOffset:-1,seed:0,disableMultiStroke:!1,disableMultiStrokeFill:!1,preserveVertices:!1,fillShapeRoughnessGain:.8},this.config=e||{},this.config.options&&(this.defaultOptions=this._o(this.config.options))}static newSeed(){return Math.floor(Math.random()*2**31)}_o(e){return e?Object.assign({},this.defaultOptions,e):this.defaultOptions}_d(e,r,n){return{shape:e,sets:r||[],options:n||this.defaultOptions}}line(e,r,n,i,a){const s=this._o(a);return this._d("line",[rW(e,r,n,i,s)],s)}rectangle(e,r,n,i,a){const s=this._o(a),o=[],l=QSe(e,r,n,i,s);if(s.fill){const u=[[e,r],[e+n,r],[e+n,r+i],[e,r+i]];s.fillStyle==="solid"?o.push(P_([u],s)):o.push(U0([u],s))}return s.stroke!==Bs&&o.push(l),this._d("rectangle",o,s)}ellipse(e,r,n,i,a){const s=this._o(a),o=[],l=iW(n,i,s),u=$_(e,r,s,l);if(s.fill)if(s.fillStyle==="solid"){const h=$_(e,r,s,l).opset;h.type="fillPath",o.push(h)}else o.push(U0([u.estimatedPoints],s));return s.stroke!==Bs&&o.push(u.opset),this._d("ellipse",o,s)}circle(e,r,n,i){const a=this.ellipse(e,r,n,n,i);return a.shape="circle",a}linearPath(e,r){const n=this._o(r);return this._d("linearPath",[Y4(e,!1,n)],n)}arc(e,r,n,i,a,s,o=!1,l){const u=this._o(l),h=[],d=aW(e,r,n,i,a,s,o,!0,u);if(o&&u.fill)if(u.fillStyle==="solid"){const f=Object.assign({},u);f.disableMultiStroke=!0;const p=aW(e,r,n,i,a,s,!0,!1,f);p.type="fillPath",h.push(p)}else h.push((function(f,p,g,m,y,v,T){const b=f,w=p;let k=Math.abs(g/2),A=Math.abs(m/2);k+=wr(.01*k,T),A+=wr(.01*A,T);let C=y,_=v;for(;C<0;)C+=2*Math.PI,_+=2*Math.PI;_-C>2*Math.PI&&(C=0,_=2*Math.PI);const L=(_-C)/T.curveStepCount,O=[];for(let M=C;M<=_;M+=L)O.push([b+k*Math.cos(M),w+A*Math.sin(M)]);return O.push([b+k*Math.cos(_),w+A*Math.sin(_)]),O.push([b,w]),U0([O],T)})(e,r,n,i,a,s,u));return u.stroke!==Bs&&h.push(d),this._d("arc",h,u)}curve(e,r){const n=this._o(r),i=[],a=nW(e,n);if(n.fill&&n.fill!==Bs)if(n.fillStyle==="solid"){const s=nW(e,Object.assign(Object.assign({},n),{disableMultiStroke:!0,roughness:n.roughness?n.roughness+n.fillShapeRoughnessGain:0}));i.push({type:"fillPath",ops:this._mergedShape(s.ops)})}else{const s=[],o=e;if(o.length){const l=typeof o[0][0]=="number"?[o]:o;for(const u of l)u.length<3?s.push(...u):u.length===3?s.push(...z_(hW([u[0],u[0],u[1],u[2]]),10,(1+n.roughness)/2)):s.push(...z_(hW(u),10,(1+n.roughness)/2))}s.length&&i.push(U0([s],n))}return n.stroke!==Bs&&i.push(a),this._d("curve",i,n)}polygon(e,r){const n=this._o(r),i=[],a=Y4(e,!0,n);return n.fill&&(n.fillStyle==="solid"?i.push(P_([e],n)):i.push(U0([e],n))),n.stroke!==Bs&&i.push(a),this._d("polygon",i,n)}path(e,r){const n=this._o(r),i=[];if(!e)return this._d("path",i,n);e=(e||"").replace(/\n/g," ").replace(/(-\s)/g,"-").replace("/(ss)/g"," ");const a=n.fill&&n.fill!=="transparent"&&n.fill!==Bs,s=n.stroke!==Bs,o=!!(n.simplification&&n.simplification<1),l=(function(h,d,f){const p=eW(JV(O_(h))),g=[];let m=[],y=[0,0],v=[];const T=()=>{v.length>=4&&m.push(...z_(v,d)),v=[]},b=()=>{T(),m.length&&(g.push(m),m=[])};for(const{key:k,data:A}of p)switch(k){case"M":b(),y=[A[0],A[1]],m.push(y);break;case"L":T(),m.push([A[0],A[1]]);break;case"C":if(!v.length){const C=m.length?m[m.length-1]:y;v.push([C[0],C[1]])}v.push([A[0],A[1]]),v.push([A[2],A[3]]),v.push([A[4],A[5]]);break;case"Z":T(),m.push([y[0],y[1]])}if(b(),!f)return g;const w=[];for(const k of g){const A=t6e(k,f);A.length&&w.push(A)}return w})(e,1,o?4-4*(n.simplification||1):(1+n.roughness)/2),u=sW(e,n);if(a)if(n.fillStyle==="solid")if(l.length===1){const h=sW(e,Object.assign(Object.assign({},n),{disableMultiStroke:!0,roughness:n.roughness?n.roughness+n.fillShapeRoughnessGain:0}));i.push({type:"fillPath",ops:this._mergedShape(h.ops)})}else i.push(P_(l,n));else i.push(U0(l,n));return s&&(o?l.forEach((h=>{i.push(Y4(h,!1,n))})):i.push(u)),this._d("path",i,n)}opsToPath(e,r){let n="";for(const i of e.ops){const a=typeof r=="number"&&r>=0?i.data.map((s=>+s.toFixed(r))):i.data;switch(i.op){case"move":n+=`M${a[0]} ${a[1]} `;break;case"bcurveTo":n+=`C${a[0]} ${a[1]}, ${a[2]} ${a[3]}, ${a[4]} ${a[5]} `;break;case"lineTo":n+=`L${a[0]} ${a[1]} `}}return n.trim()}toPaths(e){const r=e.sets||[],n=e.options||this.defaultOptions,i=[];for(const a of r){let s=null;switch(a.type){case"path":s={d:this.opsToPath(a),stroke:n.stroke,strokeWidth:n.strokeWidth,fill:Bs};break;case"fillPath":s={d:this.opsToPath(a),stroke:Bs,strokeWidth:0,fill:n.fill||Bs};break;case"fillSketch":s=this.fillSketch(a,n)}s&&i.push(s)}return i}fillSketch(e,r){let n=r.fillWeight;return n<0&&(n=r.strokeWidth/2),{d:this.opsToPath(e),stroke:r.fill||Bs,strokeWidth:n,fill:Bs}}_mergedShape(e){return e.filter(((r,n)=>n===0||r.op!=="move"))}}class r6e{constructor(e,r){this.canvas=e,this.ctx=this.canvas.getContext("2d"),this.gen=new J4(r)}draw(e){const r=e.sets||[],n=e.options||this.getDefaultOptions(),i=this.ctx,a=e.options.fixedDecimalPlaceDigits;for(const s of r)switch(s.type){case"path":i.save(),i.strokeStyle=n.stroke==="none"?"transparent":n.stroke,i.lineWidth=n.strokeWidth,n.strokeLineDash&&i.setLineDash(n.strokeLineDash),n.strokeLineDashOffset&&(i.lineDashOffset=n.strokeLineDashOffset),this._drawToContext(i,s,a),i.restore();break;case"fillPath":{i.save(),i.fillStyle=n.fill||"";const o=e.shape==="curve"||e.shape==="polygon"||e.shape==="path"?"evenodd":"nonzero";this._drawToContext(i,s,a,o),i.restore();break}case"fillSketch":this.fillSketch(i,s,n)}}fillSketch(e,r,n){let i=n.fillWeight;i<0&&(i=n.strokeWidth/2),e.save(),n.fillLineDash&&e.setLineDash(n.fillLineDash),n.fillLineDashOffset&&(e.lineDashOffset=n.fillLineDashOffset),e.strokeStyle=n.fill||"",e.lineWidth=i,this._drawToContext(e,r,n.fixedDecimalPlaceDigits),e.restore()}_drawToContext(e,r,n,i="nonzero"){e.beginPath();for(const a of r.ops){const s=typeof n=="number"&&n>=0?a.data.map((o=>+o.toFixed(n))):a.data;switch(a.op){case"move":e.moveTo(s[0],s[1]);break;case"bcurveTo":e.bezierCurveTo(s[0],s[1],s[2],s[3],s[4],s[5]);break;case"lineTo":e.lineTo(s[0],s[1])}}r.type==="fillPath"?e.fill(i):e.stroke()}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}line(e,r,n,i,a){const s=this.gen.line(e,r,n,i,a);return this.draw(s),s}rectangle(e,r,n,i,a){const s=this.gen.rectangle(e,r,n,i,a);return this.draw(s),s}ellipse(e,r,n,i,a){const s=this.gen.ellipse(e,r,n,i,a);return this.draw(s),s}circle(e,r,n,i){const a=this.gen.circle(e,r,n,i);return this.draw(a),a}linearPath(e,r){const n=this.gen.linearPath(e,r);return this.draw(n),n}polygon(e,r){const n=this.gen.polygon(e,r);return this.draw(n),n}arc(e,r,n,i,a,s,o=!1,l){const u=this.gen.arc(e,r,n,i,a,s,o,l);return this.draw(u),u}curve(e,r){const n=this.gen.curve(e,r);return this.draw(n),n}path(e,r){const n=this.gen.path(e,r);return this.draw(n),n}}const eC="http://www.w3.org/2000/svg";class n6e{constructor(e,r){this.svg=e,this.gen=new J4(r)}draw(e){const r=e.sets||[],n=e.options||this.getDefaultOptions(),i=this.svg.ownerDocument||window.document,a=i.createElementNS(eC,"g"),s=e.options.fixedDecimalPlaceDigits;for(const o of r){let l=null;switch(o.type){case"path":l=i.createElementNS(eC,"path"),l.setAttribute("d",this.opsToPath(o,s)),l.setAttribute("stroke",n.stroke),l.setAttribute("stroke-width",n.strokeWidth+""),l.setAttribute("fill","none"),n.strokeLineDash&&l.setAttribute("stroke-dasharray",n.strokeLineDash.join(" ").trim()),n.strokeLineDashOffset&&l.setAttribute("stroke-dashoffset",`${n.strokeLineDashOffset}`);break;case"fillPath":l=i.createElementNS(eC,"path"),l.setAttribute("d",this.opsToPath(o,s)),l.setAttribute("stroke","none"),l.setAttribute("stroke-width","0"),l.setAttribute("fill",n.fill||""),e.shape!=="curve"&&e.shape!=="polygon"||l.setAttribute("fill-rule","evenodd");break;case"fillSketch":l=this.fillSketch(i,o,n)}l&&a.appendChild(l)}return a}fillSketch(e,r,n){let i=n.fillWeight;i<0&&(i=n.strokeWidth/2);const a=e.createElementNS(eC,"path");return a.setAttribute("d",this.opsToPath(r,n.fixedDecimalPlaceDigits)),a.setAttribute("stroke",n.fill||""),a.setAttribute("stroke-width",i+""),a.setAttribute("fill","none"),n.fillLineDash&&a.setAttribute("stroke-dasharray",n.fillLineDash.join(" ").trim()),n.fillLineDashOffset&&a.setAttribute("stroke-dashoffset",`${n.fillLineDashOffset}`),a}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}opsToPath(e,r){return this.gen.opsToPath(e,r)}line(e,r,n,i,a){const s=this.gen.line(e,r,n,i,a);return this.draw(s)}rectangle(e,r,n,i,a){const s=this.gen.rectangle(e,r,n,i,a);return this.draw(s)}ellipse(e,r,n,i,a){const s=this.gen.ellipse(e,r,n,i,a);return this.draw(s)}circle(e,r,n,i){const a=this.gen.circle(e,r,n,i);return this.draw(a)}linearPath(e,r){const n=this.gen.linearPath(e,r);return this.draw(n)}polygon(e,r){const n=this.gen.polygon(e,r);return this.draw(n)}arc(e,r,n,i,a,s,o=!1,l){const u=this.gen.arc(e,r,n,i,a,s,o,l);return this.draw(u)}curve(e,r){const n=this.gen.curve(e,r);return this.draw(n)}path(e,r){const n=this.gen.path(e,r);return this.draw(n)}}var Kt={canvas:(t,e)=>new r6e(t,e),svg:(t,e)=>new n6e(t,e),generator:t=>new J4(t),newSeed:()=>J4.newSeed()},xr=x(async(t,e,r)=>{var p,g;let n;const i=e.useHtmlLabels||hc((p=Pe())==null?void 0:p.htmlLabels);r?n=r:n="node default";const a=t.insert("g").attr("class",n).attr("id",e.domId||e.id),s=a.insert("g").attr("class","label").attr("style",Zi(e.labelStyle));let o;e.label===void 0?o="":o=typeof e.label=="string"?e.label:e.label[0];const l=!!e.icon||!!e.img,u=e.labelType==="markdown",h=await Wa(s,qr(Tc(o),Pe()),{useHtmlLabels:i,width:e.width||((g=Pe().flowchart)==null?void 0:g.wrappingWidth),classes:u?"markdown-node-label":"",style:e.labelStyle,addSvgBackground:l,markdown:u},Pe());let d=h.getBBox();const f=((e==null?void 0:e.padding)??0)/2;if(i){const m=h.children[0],y=pt(h);await p_(m,o),d=m.getBoundingClientRect(),y.attr("width",d.width),y.attr("height",d.height)}return i?s.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"):s.attr("transform","translate(0, "+-d.height/2+")"),e.centerLabel&&s.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"),s.insert("rect",":first-child"),{shapeSvg:a,bbox:d,halfPadding:f,label:s}},"labelHelper"),G_=x(async(t,e,r)=>{var l,u;const n=r.useHtmlLabels??on(Pe()),i=t.insert("g").attr("class","label").attr("style",r.labelStyle||""),a=await Wa(i,qr(Tc(e),Pe()),{useHtmlLabels:n,width:r.width||((u=(l=Pe())==null?void 0:l.flowchart)==null?void 0:u.wrappingWidth),style:r.labelStyle,addSvgBackground:!!r.icon||!!r.img});let s=a.getBBox();const o=r.padding/2;if(on(Pe())){const h=a.children[0],d=pt(a);s=h.getBoundingClientRect(),d.attr("width",s.width),d.attr("height",s.height)}return n?i.attr("transform","translate("+-s.width/2+", "+-s.height/2+")"):i.attr("transform","translate(0, "+-s.height/2+")"),r.centerLabel&&i.attr("transform","translate("+-s.width/2+", "+-s.height/2+")"),i.insert("rect",":first-child"),{shapeSvg:t,bbox:s,halfPadding:o,label:i}},"insertLabel"),rr=x((t,e)=>{const r=e.node().getBBox();t.width=r.width,t.height=r.height},"updateNodeBounds"),gr=x((t,e)=>(t.look==="handDrawn"?"rough-node":"node")+" "+t.cssClasses+" "+(e||""),"getNodeClasses");function Wr(t){const e=t.map((r,n)=>`${n===0?"M":"L"}${r.x},${r.y}`);return e.push("Z"),e.join(" ")}x(Wr,"createPathFromPoints");function Du(t,e,r,n,i,a){const s=[],l=r-t,u=n-e,h=l/a,d=2*Math.PI/h,f=e+u/2;for(let p=0;p<=50;p++){const g=p/50,m=t+g*l,y=f+i*Math.sin(d*(m-t));s.push({x:m,y})}return s}x(Du,"generateFullSineWavePoints");function tb(t,e,r,n,i,a){const s=[],o=i*Math.PI/180,h=(a*Math.PI/180-o)/(n-1);for(let d=0;dl.tagName==="path"),r=document.createElementNS("http://www.w3.org/2000/svg","path"),n=e.map(l=>l.getAttribute("d")).filter(l=>l!==null).join(" ");r.setAttribute("d",n);const i=e.find(l=>l.getAttribute("fill")!=="none"),a=e.find(l=>l.getAttribute("stroke")!=="none"),s=x((l,u)=>(l==null?void 0:l.getAttribute(u))??void 0,"getAttr");if(i){const l={fill:s(i,"fill"),"fill-opacity":s(i,"fill-opacity")??"1"};Object.entries(l).forEach(([u,h])=>{h&&r.setAttribute(u,h)})}if(a){const l={stroke:s(a,"stroke"),"stroke-width":s(a,"stroke-width")??"1","stroke-opacity":s(a,"stroke-opacity")??"1"};Object.entries(l).forEach(([u,h])=>{h&&r.setAttribute(u,h)})}const o=document.createElementNS("http://www.w3.org/2000/svg","g");return o.appendChild(r),o}x(q_,"mergePaths");var i6e=x((t,e)=>{var r=t.x,n=t.y,i=e.x-r,a=e.y-n,s=t.width/2,o=t.height/2,l,u;return Math.abs(a)*s>Math.abs(i)*o?(a<0&&(o=-o),l=a===0?0:o*i/a,u=o):(i<0&&(s=-s),l=s,u=i===0?0:s*a/i),{x:r+l,y:n+u}},"intersectRect"),H0=i6e,a6e=x(async(t,e,r,n=!1,i=!1)=>{let a=e||"";typeof a=="object"&&(a=a[0]);const s=Pe(),o=on(s);return await Wa(t,a,{style:r,isTitle:n,useHtmlLabels:o,markdown:!1,isNode:i,width:Number.POSITIVE_INFINITY},s)},"createLabel"),Mu=a6e,Nu=x((t,e,r,n,i)=>["M",t+i,e,"H",t+r-i,"A",i,i,0,0,1,t+r,e+i,"V",e+n-i,"A",i,i,0,0,1,t+r-i,e+n,"H",t+i,"A",i,i,0,0,1,t,e+n-i,"V",e+i,"A",i,i,0,0,1,t+i,e,"Z"].join(" "),"createRoundedRectPathD"),dW=x(async(t,e)=>{ae.info("Creating subgraph rect for ",e.id,e);const r=Pe(),{themeVariables:n,handDrawnSeed:i}=r,{clusterBkg:a,clusterBorder:s}=n,{labelStyles:o,nodeStyles:l,borderStyles:u,backgroundStyles:h}=Xt(e),d=t.insert("g").attr("class","cluster "+e.cssClasses).attr("id",e.domId).attr("data-look",e.look),f=on(r),p=d.insert("g").attr("class","cluster-label ");let g;e.labelType==="markdown"?g=await Wa(p,e.label,{style:e.labelStyle,useHtmlLabels:f,isNode:!0,width:e.width}):g=await Mu(p,e.label,e.labelStyle||"",!1,!0);let m=g.getBBox();if(on(r)){const C=g.children[0],_=pt(g);m=C.getBoundingClientRect(),_.attr("width",m.width),_.attr("height",m.height)}const y=e.width<=m.width+e.padding?m.width+e.padding:e.width;e.width<=m.width+e.padding?e.diff=(y-e.width)/2-e.padding:e.diff=-e.padding;const v=e.height,T=e.x-y/2,b=e.y-v/2;ae.trace("Data ",e,JSON.stringify(e));let w;if(e.look==="handDrawn"){const C=Kt.svg(d),_=Qt(e,{roughness:.7,fill:a,stroke:s,fillWeight:3,seed:i}),L=C.path(Nu(T,b,y,v,0),_);w=d.insert(()=>(ae.debug("Rough node insert CXC",L),L),":first-child"),w.select("path:nth-child(2)").attr("style",u.join(";")),w.select("path").attr("style",h.join(";").replace("fill","stroke"))}else w=d.insert("rect",":first-child"),w.attr("style",l).attr("rx",e.rx).attr("ry",e.ry).attr("x",T).attr("y",b).attr("width",y).attr("height",v);const{subGraphTitleTopMargin:k}=H2(r);if(p.attr("transform",`translate(${e.x-m.width/2}, ${e.y-e.height/2+k})`),o){const C=p.select("span");C&&C.attr("style",o)}const A=w.node().getBBox();return e.offsetX=0,e.width=A.width,e.height=A.height,e.offsetY=m.height-e.padding/2,e.intersect=function(C){return H0(e,C)},{cluster:d,labelBBox:m}},"rect"),s6e=x((t,e)=>{const r=t.insert("g").attr("class","note-cluster").attr("id",e.domId),n=r.insert("rect",":first-child"),i=0*e.padding,a=i/2;n.attr("rx",e.rx).attr("ry",e.ry).attr("x",e.x-e.width/2-a).attr("y",e.y-e.height/2-a).attr("width",e.width+i).attr("height",e.height+i).attr("fill","none");const s=n.node().getBBox();return e.width=s.width,e.height=s.height,e.intersect=function(o){return H0(e,o)},{cluster:r,labelBBox:{width:0,height:0}}},"noteGroup"),o6e=x(async(t,e)=>{const r=Pe(),{themeVariables:n,handDrawnSeed:i}=r,{altBackground:a,compositeBackground:s,compositeTitleBackground:o,nodeBorder:l}=n,u=t.insert("g").attr("class",e.cssClasses).attr("id",e.domId).attr("data-id",e.id).attr("data-look",e.look),h=u.insert("g",":first-child"),d=u.insert("g").attr("class","cluster-label");let f=u.append("rect");const p=await Mu(d,e.label,e.labelStyle,void 0,!0);let g=p.getBBox();if(on(r)){const L=p.children[0],O=pt(p);g=L.getBoundingClientRect(),O.attr("width",g.width),O.attr("height",g.height)}const m=0*e.padding,y=m/2,v=(e.width<=g.width+e.padding?g.width+e.padding:e.width)+m;e.width<=g.width+e.padding?e.diff=(v-e.width)/2-e.padding:e.diff=-e.padding;const T=e.height+m,b=e.height+m-g.height-6,w=e.x-v/2,k=e.y-T/2;e.width=v;const A=e.y-e.height/2-y+g.height+2;let C;if(e.look==="handDrawn"){const L=e.cssClasses.includes("statediagram-cluster-alt"),O=Kt.svg(u),M=e.rx||e.ry?O.path(Nu(w,k,v,T,10),{roughness:.7,fill:o,fillStyle:"solid",stroke:l,seed:i}):O.rectangle(w,k,v,T,{seed:i});C=u.insert(()=>M,":first-child");const z=O.rectangle(w,A,v,b,{fill:L?a:s,fillStyle:L?"hachure":"solid",stroke:l,seed:i});C=u.insert(()=>M,":first-child"),f=u.insert(()=>z)}else C=h.insert("rect",":first-child"),C.attr("class","outer").attr("x",w).attr("y",k).attr("width",v).attr("height",T).attr("data-look",e.look),f.attr("class","inner").attr("x",w).attr("y",A).attr("width",v).attr("height",b);d.attr("transform",`translate(${e.x-g.width/2}, ${k+1-(on(r)?0:3)})`);const _=C.node().getBBox();return e.height=_.height,e.offsetX=0,e.offsetY=g.height-e.padding/2,e.labelBBox=g,e.intersect=function(L){return H0(e,L)},{cluster:u,labelBBox:g}},"roundedWithTitle"),l6e=x(async(t,e)=>{ae.info("Creating subgraph rect for ",e.id,e);const r=Pe(),{themeVariables:n,handDrawnSeed:i}=r,{clusterBkg:a,clusterBorder:s}=n,{labelStyles:o,nodeStyles:l,borderStyles:u,backgroundStyles:h}=Xt(e),d=t.insert("g").attr("class","cluster "+e.cssClasses).attr("id",e.domId).attr("data-look",e.look),f=on(r),p=d.insert("g").attr("class","cluster-label "),g=await Wa(p,e.label,{style:e.labelStyle,useHtmlLabels:f,isNode:!0,width:e.width});let m=g.getBBox();if(on(r)){const C=g.children[0],_=pt(g);m=C.getBoundingClientRect(),_.attr("width",m.width),_.attr("height",m.height)}const y=e.width<=m.width+e.padding?m.width+e.padding:e.width;e.width<=m.width+e.padding?e.diff=(y-e.width)/2-e.padding:e.diff=-e.padding;const v=e.height,T=e.x-y/2,b=e.y-v/2;ae.trace("Data ",e,JSON.stringify(e));let w;if(e.look==="handDrawn"){const C=Kt.svg(d),_=Qt(e,{roughness:.7,fill:a,stroke:s,fillWeight:4,seed:i}),L=C.path(Nu(T,b,y,v,e.rx),_);w=d.insert(()=>(ae.debug("Rough node insert CXC",L),L),":first-child"),w.select("path:nth-child(2)").attr("style",u.join(";")),w.select("path").attr("style",h.join(";").replace("fill","stroke"))}else w=d.insert("rect",":first-child"),w.attr("style",l).attr("rx",e.rx).attr("ry",e.ry).attr("x",T).attr("y",b).attr("width",y).attr("height",v);const{subGraphTitleTopMargin:k}=H2(r);if(p.attr("transform",`translate(${e.x-m.width/2}, ${e.y-e.height/2+k})`),o){const C=p.select("span");C&&C.attr("style",o)}const A=w.node().getBBox();return e.offsetX=0,e.width=A.width,e.height=A.height,e.offsetY=m.height-e.padding/2,e.intersect=function(C){return H0(e,C)},{cluster:d,labelBBox:m}},"kanbanSection"),c6e=x((t,e)=>{const r=Pe(),{themeVariables:n,handDrawnSeed:i}=r,{nodeBorder:a}=n,s=t.insert("g").attr("class",e.cssClasses).attr("id",e.domId).attr("data-look",e.look),o=s.insert("g",":first-child"),l=0*e.padding,u=e.width+l;e.diff=-e.padding;const h=e.height+l,d=e.x-u/2,f=e.y-h/2;e.width=u;let p;if(e.look==="handDrawn"){const y=Kt.svg(s).rectangle(d,f,u,h,{fill:"lightgrey",roughness:.5,strokeLineDash:[5],stroke:a,seed:i});p=s.insert(()=>y,":first-child")}else{p=o.insert("rect",":first-child");let m="outer";e.look,m="divider",p.attr("class",m).attr("x",d).attr("y",f).attr("width",u).attr("height",h).attr("data-look",e.look)}const g=p.node().getBBox();return e.height=g.height,e.offsetX=0,e.offsetY=0,e.intersect=function(m){return H0(e,m)},{cluster:s,labelBBox:{}}},"divider"),u6e=dW,h6e={rect:dW,squareRect:u6e,roundedWithTitle:o6e,noteGroup:s6e,divider:c6e,kanbanSection:l6e},fW=new Map,V_=x(async(t,e)=>{const r=e.shape||"rect",n=await h6e[r](t,e);return fW.set(e.id,n),n},"insertCluster"),d6e=x(()=>{fW=new Map},"clear");function pW(t,e){return t.intersect(e)}x(pW,"intersectNode");var f6e=pW;function gW(t,e,r,n){var i=t.x,a=t.y,s=i-n.x,o=a-n.y,l=Math.sqrt(e*e*o*o+r*r*s*s),u=Math.abs(e*r*s/l);n.x0}x(W_,"sameSign");var g6e=vW;function bW(t,e,r){let n=t.x,i=t.y,a=[],s=Number.POSITIVE_INFINITY,o=Number.POSITIVE_INFINITY;typeof e.forEach=="function"?e.forEach(function(h){s=Math.min(s,h.x),o=Math.min(o,h.y)}):(s=Math.min(s,e.x),o=Math.min(o,e.y));let l=n-t.width/2-s,u=i-t.height/2-o;for(let h=0;h1&&a.sort(function(h,d){let f=h.x-r.x,p=h.y-r.y,g=Math.sqrt(f*f+p*p),m=d.x-r.x,y=d.y-r.y,v=Math.sqrt(m*m+y*y);return gh,":first-child");return d.attr("class","anchor").attr("style",Zi(o)),rr(e,d),e.intersect=function(f){return ae.info("Circle intersect",e,s,f),Ht.circle(e,s,f)},a}x(xW,"anchor");function U_(t,e,r,n,i,a,s){const l=(t+r)/2,u=(e+n)/2,h=Math.atan2(n-e,r-t),d=(r-t)/2,f=(n-e)/2,p=d/i,g=f/a,m=Math.sqrt(p**2+g**2);if(m>1)throw new Error("The given radii are too small to create an arc between the points.");const y=Math.sqrt(1-m**2),v=l+y*a*Math.sin(h)*(s?-1:1),T=u-y*i*Math.cos(h)*(s?-1:1),b=Math.atan2((e-T)/a,(t-v)/i);let k=Math.atan2((n-T)/a,(r-v)/i)-b;s&&k<0&&(k+=2*Math.PI),!s&&k>0&&(k-=2*Math.PI);const A=[];for(let C=0;C<20;C++){const _=C/19,L=b+_*k,O=v+i*Math.cos(L),M=T+a*Math.sin(L);A.push({x:O,y:M})}return A}x(U_,"generateArcPoints");function TW(t,e,r){const[n,i]=[e,r].sort((a,s)=>s-a);return i*(1-Math.sqrt(1-(t/n/2)**2))}x(TW,"calculateArcSagitta");async function wW(t,e){const{labelStyles:r,nodeStyles:n}=Xt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,s=e.look==="neo"?12:i,o=x(L=>L+s,"calcTotalHeight"),l=x(L=>{const O=L/2;return[O/(2.5+L/50),O]},"calcEllipseRadius"),{shapeSvg:u,bbox:h}=await xr(t,e,gr(e)),d=o(e!=null&&e.height?e==null?void 0:e.height:h.height),[f,p]=l(d),g=TW(d,f,p),y=(e!=null&&e.width?e==null?void 0:e.width:h.width)+a*2+g-g,v=d,{cssStyles:T}=e,b=[{x:y/2,y:-v/2},{x:-y/2,y:-v/2},...U_(-y/2,-v/2,-y/2,v/2,f,p,!1),{x:y/2,y:v/2},...U_(y/2,v/2,y/2,-v/2,f,p,!0)],w=Kt.svg(u),k=Qt(e,{});e.look!=="handDrawn"&&(k.roughness=0,k.fillStyle="solid");const A=Wr(b),C=w.path(A,k),_=u.insert(()=>C,":first-child");return _.attr("class","basic label-container outer-path"),T&&e.look!=="handDrawn"&&_.selectAll("path").attr("style",T),n&&e.look!=="handDrawn"&&_.selectAll("path").attr("style",n),_.attr("transform",`translate(${f/2}, 0)`),rr(e,_),e.intersect=function(L){return Ht.polygon(e,b,L)},u}x(wW,"bowTieRect");function wc(t,e,r,n){return t.insert("polygon",":first-child").attr("points",n.map(function(i){return i.x+","+i.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-e/2+","+r/2+")")}x(wc,"insertPolygonShape");var tC=12;async function CW(t,e){const{labelStyles:r,nodeStyles:n}=Xt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?28:i,s=e.look==="neo"?24:i,{shapeSvg:o,bbox:l}=await xr(t,e,gr(e)),u=((e==null?void 0:e.width)??l.width)+(e.look==="neo"?a*2:a+tC),h=((e==null?void 0:e.height)??l.height)+(e.look==="neo"?s*2:s),d=0,f=u,p=-h,g=0,m=[{x:d+tC,y:p},{x:f,y:p},{x:f,y:g},{x:d,y:g},{x:d,y:p+tC},{x:d+tC,y:p}];let y;const{cssStyles:v}=e;if(e.look==="handDrawn"){const T=Kt.svg(o),b=Qt(e,{}),w=Wr(m),k=T.path(w,b);y=o.insert(()=>k,":first-child").attr("transform",`translate(${-u/2}, ${h/2})`),v&&y.attr("style",v)}else y=wc(o,u,h,m);return n&&y.attr("style",n),rr(e,y),e.intersect=function(T){return Ht.polygon(e,m,T)},o}x(CW,"card");function kW(t,e){const{nodeStyles:r}=Xt(e);e.label="";const n=t.insert("g").attr("class",gr(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=Kt.svg(n),l=Qt(e,{});e.look!=="handDrawn"&&(l.roughness=0,l.fillStyle="solid");const u=Wr(s),h=o.path(u,l),d=n.insert(()=>h,":first-child");return i&&e.look!=="handDrawn"&&d.selectAll("path").attr("style",i),r&&e.look!=="handDrawn"&&d.selectAll("path").attr("style",r),e.width=28,e.height=28,e.intersect=function(f){return Ht.polygon(e,s,f)},n}x(kW,"choice");async function H_(t,e,r){const{labelStyles:n,nodeStyles:i}=Xt(e);e.labelStyle=n;const{shapeSvg:a,bbox:s,halfPadding:o}=await xr(t,e,gr(e)),l=16,u=(r==null?void 0:r.padding)??o,h=e.look==="neo"?s.width/2+l*2:s.width/2+u;let d;const{cssStyles:f}=e;if(e.look==="handDrawn"){const p=Kt.svg(a),g=Qt(e,{}),m=p.circle(0,0,h*2,g);d=a.insert(()=>m,":first-child"),d.attr("class","basic label-container").attr("style",Zi(f))}else d=a.insert("circle",":first-child").attr("class","basic label-container").attr("style",i).attr("r",h).attr("cx",0).attr("cy",0);return rr(e,d),e.calcIntersect=function(p,g){const m=p.width/2;return Ht.circle(p,m,g)},e.intersect=function(p){return ae.info("Circle intersect",e,h,p),Ht.circle(e,h,p)},a}x(H_,"circle");function EW(t){const e=Math.cos(Math.PI/4),r=Math.sin(Math.PI/4),n=t*2,i={x:n/2*e,y:n/2*r},a={x:-(n/2)*e,y:n/2*r},s={x:-(n/2)*e,y:-(n/2)*r},o={x:n/2*e,y:-(n/2)*r};return`M ${a.x},${a.y} L ${o.x},${o.y} - M ${i.x},${i.y} L ${s.x},${s.y}`}x(EW,"createLine");function SW(t,e){const{labelStyles:r,nodeStyles:n}=Xt(e);e.labelStyle=r,e.label="";const i=t.insert("g").attr("class",gr(e)).attr("id",e.domId??e.id),a=Math.max(30,(e==null?void 0:e.width)??0),{cssStyles:s}=e,o=Kt.svg(i),l=Qt(e,{});e.look!=="handDrawn"&&(l.roughness=0,l.fillStyle="solid");const u=o.circle(0,0,a*2,l),h=EW(a),d=o.path(h,l),f=i.insert(()=>u,":first-child");return f.insert(()=>d),f.attr("class","outer-path"),s&&e.look!=="handDrawn"&&f.selectAll("path").attr("style",s),n&&e.look!=="handDrawn"&&f.selectAll("path").attr("style",n),rr(e,f),e.intersect=function(p){return ae.info("crossedCircle intersect",e,{radius:a,point:p}),Ht.circle(e,a,p)},i}x(SW,"crossedCircle");function Cc(t,e,r,n=100,i=0,a=180){const s=[],o=i*Math.PI/180,h=(a*Math.PI/180-o)/(n-1);for(let d=0;dk,":first-child").attr("stroke-opacity",0),A.insert(()=>b,":first-child"),A.attr("class","text"),f&&e.look!=="handDrawn"&&A.selectAll("path").attr("style",f),n&&e.look!=="handDrawn"&&A.selectAll("path").attr("style",n),A.attr("transform",`translate(${d}, 0)`),s.attr("transform",`translate(${-u/2+d-(a.x-(a.left??0))},${-h/2+(e.padding??0)/2-(a.y-(a.top??0))})`),rr(e,A),e.intersect=function(C){return Ht.polygon(e,g,C)},i}x(AW,"curlyBraceLeft");function kc(t,e,r,n=100,i=0,a=180){const s=[],o=i*Math.PI/180,h=(a*Math.PI/180-o)/(n-1);for(let d=0;dk,":first-child").attr("stroke-opacity",0),A.insert(()=>b,":first-child"),A.attr("class","text"),f&&e.look!=="handDrawn"&&A.selectAll("path").attr("style",f),n&&e.look!=="handDrawn"&&A.selectAll("path").attr("style",n),A.attr("transform",`translate(${-d}, 0)`),s.attr("transform",`translate(${-u/2+(e.padding??0)/2-(a.x-(a.left??0))},${-h/2+(e.padding??0)/2-(a.y-(a.top??0))})`),rr(e,A),e.intersect=function(C){return Ht.polygon(e,g,C)},i}x(_W,"curlyBraceRight");function ca(t,e,r,n=100,i=0,a=180){const s=[],o=i*Math.PI/180,h=(a*Math.PI/180-o)/(n-1);for(let d=0;dL,":first-child").attr("stroke-opacity",0),O.insert(()=>w,":first-child"),O.insert(()=>C,":first-child"),O.attr("class","text"),f&&e.look!=="handDrawn"&&O.selectAll("path").attr("style",f),n&&e.look!=="handDrawn"&&O.selectAll("path").attr("style",n),O.attr("transform",`translate(${d-d/4}, 0)`),s.attr("transform",`translate(${-u/2+(e.padding??0)/2-(a.x-(a.left??0))},${-h/2+(e.padding??0)/2-(a.y-(a.top??0))})`),rr(e,O),e.intersect=function(M){return Ht.polygon(e,m,M)},i}x(RW,"curlyBraces");async function LW(t,e){const{labelStyles:r,nodeStyles:n}=Xt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,s=e.look==="neo"?12:i,o=20,l=5,{shapeSvg:u,bbox:h}=await xr(t,e,gr(e)),d=Math.max(o,(h.width+a*2)*1.25,(e==null?void 0:e.width)??0),f=Math.max(l,h.height+s*2,(e==null?void 0:e.height)??0),p=f/2,{cssStyles:g}=e,m=Kt.svg(u),y=Qt(e,{});e.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const v=d,T=f,b=v-p,w=T/4,k=[{x:b,y:0},{x:w,y:0},{x:0,y:T/2},{x:w,y:T},{x:b,y:T},...tb(-b,-T/2,p,50,270,90)],A=Wr(k),C=m.path(A,y),_=u.insert(()=>C,":first-child");return _.attr("class","basic label-container outer-path"),g&&e.look!=="handDrawn"&&_.selectChildren("path").attr("style",g),n&&e.look!=="handDrawn"&&_.selectChildren("path").attr("style",n),_.attr("transform",`translate(${-d/2}, ${-f/2})`),rr(e,_),e.intersect=function(L){return Ht.polygon(e,k,L)},u}x(LW,"curvedTrapezoid");var y6e=x((t,e,r,n,i,a)=>[`M${t},${e+a}`,`a${i},${a} 0,0,0 ${r},0`,`a${i},${a} 0,0,0 ${-r},0`,`l0,${n}`,`a${i},${a} 0,0,0 ${r},0`,`l0,${-n}`].join(" "),"createCylinderPathD"),v6e=x((t,e,r,n,i,a)=>[`M${t},${e+a}`,`M${t+r},${e+a}`,`a${i},${a} 0,0,0 ${-r},0`,`l0,${n}`,`a${i},${a} 0,0,0 ${r},0`,`l0,${-n}`].join(" "),"createOuterCylinderPathD"),b6e=x((t,e,r,n,i,a)=>[`M${t-r/2},${-n/2}`,`a${i},${a} 0,0,0 ${r},0`].join(" "),"createInnerCylinderPathD"),IW=8,DW=8;async function MW(t,e){const{labelStyles:r,nodeStyles:n}=Xt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?24:i,s=e.look==="neo"?24:i;if(e.width||e.height){const y=e.width??0;e.width=(e.width??0)-s,e.widthk,":first-child"),g=o.insert(()=>w,":first-child"),g.attr("class","basic label-container"),m&&g.attr("style",m)}else{const y=y6e(0,0,h,p,d,f);g=o.insert("path",":first-child").attr("d",y).attr("class","basic label-container outer-path").attr("style",Zi(m)).attr("style",n)}return g.attr("label-offset-y",f),g.attr("transform",`translate(${-h/2}, ${-(p/2+f)})`),rr(e,g),u.attr("transform",`translate(${-(l.width/2)-(l.x-(l.left??0))}, ${-(l.height/2)+(e.padding??0)/1.5-(l.y-(l.top??0))})`),e.intersect=function(y){const v=Ht.rect(e,y),T=v.x-(e.x??0);if(d!=0&&(Math.abs(T)<(e.width??0)/2||Math.abs(T)==(e.width??0)/2&&Math.abs(v.y-(e.y??0))>(e.height??0)/2-f)){let b=f*f*(1-T*T/(d*d));b>0&&(b=Math.sqrt(b)),b=f-b,y.y-(e.y??0)>0&&(b=-b),v.y+=b}return v},o}x(MW,"cylinder");async function Y0(t,e,r){const{labelStyles:n,nodeStyles:i}=Xt(e);e.labelStyle=n;const{shapeSvg:a,bbox:s}=await xr(t,e,gr(e)),o=Math.max(s.width+r.labelPaddingX*2,(e==null?void 0:e.width)||0),l=Math.max(s.height+r.labelPaddingY*2,(e==null?void 0:e.height)||0),u=-o/2,h=-l/2;let d,{rx:f,ry:p}=e;const{cssStyles:g}=e;if(r!=null&&r.rx&&r.ry&&(f=r.rx,p=r.ry),e.look==="handDrawn"){const m=Kt.svg(a),y=Qt(e,{}),v=f||p?m.path(Nu(u,h,o,l,f||0),y):m.rectangle(u,h,o,l,y);d=a.insert(()=>v,":first-child"),d.attr("class","basic label-container").attr("style",Zi(g))}else d=a.insert("rect",":first-child"),d.attr("class","basic label-container").attr("style",i).attr("rx",Zi(f)).attr("ry",Zi(p)).attr("x",u).attr("y",h).attr("width",o).attr("height",l);return rr(e,d),e.calcIntersect=function(m,y){return Ht.rect(m,y)},e.intersect=function(m){return Ht.rect(e,m)},a}x(Y0,"drawRect");async function NW(t,e){const{cssClasses:r,labelPaddingX:n,labelPaddingY:i,padding:a,width:s,height:o}=e,l={rx:0,ry:0,labelPaddingX:n??(a??0)*2,labelPaddingY:i??a??0},u=await Y0(t,e,l);if(e.look==="handDrawn"){const p=Kt.svg(u),g=Qt(e,{}),m=u.select(".basic.label-container > path:nth-child(2)"),y=m.node();if(!y)return u;let v=null;if(y instanceof SVGGraphicsElement)v=y.getBBox();else return u;return u.insert(()=>p.line(v.x,v.y,v.x+v.width,v.y,g),".basic.label-container g.label"),u.insert(()=>p.line(v.x,v.y+v.height,v.x+v.width,v.y+v.height,g),".basic.label-container g.label"),m.remove(),u}const h=u.select(".basic.label-container"),d=(Number(h.attr("width"))||s)??0,f=(Number(h.attr("height"))||o)??0;return d>0&&f>0&&h.attr("stroke-dasharray",`${d} ${f}`),u}x(NW,"datastore");async function OW(t,e){const{labelStyles:r,nodeStyles:n}=Xt(e);e.labelStyle=r;const i=e.look==="neo"?16:e.padding??0,a=e.look==="neo"?16:e.padding??0,{shapeSvg:s,bbox:o,label:l}=await xr(t,e,gr(e)),u=o.width+i,h=o.height+a,d=h*.2,f=-u/2,p=-h/2-d/2,{cssStyles:g}=e,m=Kt.svg(s),y=Qt(e,{});e.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const v=[{x:f,y:p+d},{x:-f,y:p+d},{x:-f,y:-p},{x:f,y:-p},{x:f,y:p},{x:-f,y:p},{x:-f,y:p+d}],T=m.polygon(v.map(w=>[w.x,w.y]),y),b=s.insert(()=>T,":first-child");return b.attr("class","basic label-container outer-path"),g&&e.look!=="handDrawn"&&b.selectAll("path").attr("style",g),n&&e.look!=="handDrawn"&&b.selectAll("path").attr("style",n),l.attr("transform",`translate(${f+(e.padding??0)/2-(o.x-(o.left??0))}, ${p+d+(e.padding??0)/2-(o.y-(o.top??0))})`),rr(e,b),e.intersect=function(w){return Ht.rect(e,w)},s}x(OW,"dividedRectangle");async function $W(t,e){var p,g;const{labelStyles:r,nodeStyles:n}=Xt(e),i=e.look==="neo"?12:5;e.labelStyle=r;const a=e.padding??0,s=e.look==="neo"?16:a,{shapeSvg:o,bbox:l}=await xr(t,e,gr(e)),u=(e!=null&&e.width?(e==null?void 0:e.width)/2:l.width/2)+(s??0),h=u-i;let d;const{cssStyles:f}=e;if(e.look==="handDrawn"){const m=Kt.svg(o),y=Qt(e,{roughness:.2,strokeWidth:2.5}),v=Qt(e,{roughness:.2,strokeWidth:1.5}),T=m.circle(0,0,u*2,y),b=m.circle(0,0,h*2,v);d=o.insert("g",":first-child"),d.attr("class",Zi(e.cssClasses)).attr("style",Zi(f)),(p=d.node())==null||p.appendChild(T),(g=d.node())==null||g.appendChild(b)}else{d=o.insert("g",":first-child");const m=d.insert("circle",":first-child"),y=d.insert("circle");d.attr("class","basic label-container").attr("style",n),m.attr("class","outer-circle").attr("style",n).attr("r",u).attr("cx",0).attr("cy",0),y.attr("class","inner-circle").attr("style",n).attr("r",h).attr("cx",0).attr("cy",0)}return rr(e,d),e.intersect=function(m){return ae.info("DoubleCircle intersect",e,u,m),Ht.circle(e,u,m)},o}x($W,"doublecircle");function PW(t,e,{config:{themeVariables:r}}){const{labelStyles:n,nodeStyles:i}=Xt(e);e.label="",e.labelStyle=n;const a=t.insert("g").attr("class",gr(e)).attr("id",e.domId??e.id),s=7,{cssStyles:o}=e,l=Kt.svg(a),{nodeBorder:u}=r,h=Qt(e,{fillStyle:"solid"});e.look!=="handDrawn"&&(h.roughness=0);const d=l.circle(0,0,s*2,h),f=a.insert(()=>d,":first-child");return f.selectAll("path").attr("style",`fill: ${u} !important;`),o&&o.length>0&&e.look!=="handDrawn"&&f.selectAll("path").attr("style",o),i&&e.look!=="handDrawn"&&f.selectAll("path").attr("style",i),rr(e,f),e.intersect=function(p){return ae.info("filledCircle intersect",e,{radius:s,point:p}),Ht.circle(e,s,p)},a}x(PW,"filledCircle");var BW=10,FW=10;async function zW(t,e){const{labelStyles:r,nodeStyles:n}=Xt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?i*2:i;(e.width||e.height)&&(e.height=(e==null?void 0:e.height)??0,e.heightv,":first-child").attr("transform",`translate(${-h/2}, ${h/2})`).attr("class","outer-path");return p&&e.look!=="handDrawn"&&T.selectChildren("path").attr("style",p),n&&e.look!=="handDrawn"&&T.selectChildren("path").attr("style",n),e.width=u,e.height=h,rr(e,T),l.attr("transform",`translate(${-o.width/2-(o.x-(o.left??0))}, ${-h/2+(e.padding??0)/2+(o.y-(o.top??0))})`),e.intersect=function(b){return ae.info("Triangle intersect",e,f,b),Ht.polygon(e,f,b)},s}x(zW,"flippedTriangle");function GW(t,e,{dir:r,config:{state:n,themeVariables:i}}){const{nodeStyles:a}=Xt(e);e.label="";const s=t.insert("g").attr("class",gr(e)).attr("id",e.domId??e.id),{cssStyles:o}=e;let l=Math.max(70,(e==null?void 0:e.width)??0),u=Math.max(10,(e==null?void 0:e.height)??0);r==="LR"&&(l=Math.max(10,(e==null?void 0:e.width)??0),u=Math.max(70,(e==null?void 0:e.height)??0));const h=-1*l/2,d=-1*u/2,f=Kt.svg(s),p=Qt(e,{stroke:i.lineColor,fill:i.lineColor});e.look!=="handDrawn"&&(p.roughness=0,p.fillStyle="solid");const g=f.rectangle(h,d,l,u,p),m=s.insert(()=>g,":first-child");o&&e.look!=="handDrawn"&&m.selectAll("path").attr("style",o),a&&e.look!=="handDrawn"&&m.selectAll("path").attr("style",a),rr(e,m);const y=(n==null?void 0:n.padding)??0;return e.width&&e.height&&(e.width+=y/2||0,e.height+=y/2||0),e.intersect=function(v){return Ht.rect(e,v)},s}x(GW,"forkJoin");async function qW(t,e){const{labelStyles:r,nodeStyles:n}=Xt(e);e.labelStyle=r;const i=15,a=10,s=e.look==="neo"?16:e.padding??0,o=e.look==="neo"?12:e.padding??0;(e.width||e.height)&&(e.height=((e==null?void 0:e.height)??0)-o*2,e.heightT,":first-child");return b.attr("class","basic label-container outer-path"),p&&e.look!=="handDrawn"&&b.selectChildren("path").attr("style",p),n&&e.look!=="handDrawn"&&b.selectChildren("path").attr("style",n),rr(e,b),e.intersect=function(w){return ae.info("Pill intersect",e,{radius:f,point:w}),Ht.polygon(e,y,w)},l}x(qW,"halfRoundedRectangle");var x6e=x((t,e,r,n,i)=>[`M${t+i},${e}`,`L${t+r-i},${e}`,`L${t+r},${e-n/2}`,`L${t+r-i},${e-n}`,`L${t+i},${e-n}`,`L${t},${e-n/2}`,"Z"].join(" "),"createHexagonPathD");async function VW(t,e){const{labelStyles:r,nodeStyles:n}=Xt(e),i=e.look==="neo"?3.5:4;e.labelStyle=r;const a=e.padding??0,s=70,o=32,l=e.look==="neo"?s:a,u=e.look==="neo"?o:a;if(e.width||e.height){const b=(e.height??0)/i;e.width=((e==null?void 0:e.width)??0)-2*b-u,e.height=(e.height??0)-l}const{shapeSvg:h,bbox:d}=await xr(t,e,gr(e)),f=(e!=null&&e.height?e==null?void 0:e.height:d.height)+l,p=f/i,g=(e!=null&&e.width?e==null?void 0:e.width:d.width)+2*p+u,m=[{x:p,y:0},{x:g-p,y:0},{x:g,y:-f/2},{x:g-p,y:-f},{x:p,y:-f},{x:0,y:-f/2}];let y;const{cssStyles:v}=e;if(e.look==="handDrawn"){const T=Kt.svg(h),b=Qt(e,{}),w=x6e(0,0,g,f,p),k=T.path(w,b);y=h.insert(()=>k,":first-child").attr("transform",`translate(${-g/2}, ${f/2})`),v&&y.attr("style",v)}else y=wc(h,g,f,m);return n&&y.attr("style",n),e.width=g,e.height=f,rr(e,y),e.intersect=function(T){return Ht.polygon(e,m,T)},h}x(VW,"hexagon");async function WW(t,e){const{labelStyles:r,nodeStyles:n}=Xt(e);e.label="",e.labelStyle=r;const{shapeSvg:i}=await xr(t,e,gr(e)),a=Math.max(30,(e==null?void 0:e.width)??0),s=Math.max(30,(e==null?void 0:e.height)??0),{cssStyles:o}=e,l=Kt.svg(i),u=Qt(e,{});e.look!=="handDrawn"&&(u.roughness=0,u.fillStyle="solid");const h=[{x:0,y:0},{x:a,y:0},{x:0,y:s},{x:a,y:s}],d=Wr(h),f=l.path(d,u),p=i.insert(()=>f,":first-child");return p.attr("class","basic label-container outer-path"),o&&e.look!=="handDrawn"&&p.selectChildren("path").attr("style",o),n&&e.look!=="handDrawn"&&p.selectChildren("path").attr("style",n),p.attr("transform",`translate(${-a/2}, ${-s/2})`),rr(e,p),e.intersect=function(g){return ae.info("Pill intersect",e,{points:h}),Ht.polygon(e,h,g)},i}x(WW,"hourglass");async function UW(t,e,{config:{themeVariables:r,flowchart:n}}){const{labelStyles:i}=Xt(e);e.labelStyle=i;const a=e.assetHeight??48,s=e.assetWidth??48,o=Math.max(a,s),l=n==null?void 0:n.wrappingWidth;e.width=Math.max(o,l??0);const{shapeSvg:u,bbox:h,label:d}=await xr(t,e,"icon-shape default"),f=e.pos==="t",p=o,g=o,{nodeBorder:m}=r,{stylesMap:y}=W0(e),v=-g/2,T=-p/2,b=e.label?8:0,w=Kt.svg(u),k=Qt(e,{stroke:"none",fill:"none"});e.look!=="handDrawn"&&(k.roughness=0,k.fillStyle="solid");const A=w.rectangle(v,T,g,p,k),C=Math.max(g,h.width),_=p+h.height+b,L=w.rectangle(-C/2,-_/2,C,_,{...k,fill:"transparent",stroke:"none"}),O=u.insert(()=>A,":first-child"),M=u.insert(()=>L);if(e.icon){const z=u.append("g");z.html(`${await Lu(e.icon,{height:o,width:o,fallbackPrefix:""})}`);const F=z.node().getBBox(),S=F.width,R=F.height,N=F.x,D=F.y;z.attr("transform",`translate(${-S/2-N},${f?h.height/2+b/2-R/2-D:-h.height/2-b/2-R/2-D})`),z.attr("style",`color: ${y.get("stroke")??m};`)}return d.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${f?-_/2:_/2-h.height})`),O.attr("transform",`translate(0,${f?h.height/2+b/2:-h.height/2-b/2})`),rr(e,M),e.intersect=function(z){if(ae.info("iconSquare intersect",e,z),!e.label)return Ht.rect(e,z);const F=e.x??0,S=e.y??0,R=e.height??0;let N=[];return f?N=[{x:F-h.width/2,y:S-R/2},{x:F+h.width/2,y:S-R/2},{x:F+h.width/2,y:S-R/2+h.height+b},{x:F+g/2,y:S-R/2+h.height+b},{x:F+g/2,y:S+R/2},{x:F-g/2,y:S+R/2},{x:F-g/2,y:S-R/2+h.height+b},{x:F-h.width/2,y:S-R/2+h.height+b}]:N=[{x:F-g/2,y:S-R/2},{x:F+g/2,y:S-R/2},{x:F+g/2,y:S-R/2+p},{x:F+h.width/2,y:S-R/2+p},{x:F+h.width/2/2,y:S+R/2},{x:F-h.width/2,y:S+R/2},{x:F-h.width/2,y:S-R/2+p},{x:F-g/2,y:S-R/2+p}],Ht.polygon(e,N,z)},u}x(UW,"icon");async function HW(t,e,{config:{themeVariables:r,flowchart:n}}){const{labelStyles:i}=Xt(e);e.labelStyle=i;const a=e.assetHeight??48,s=e.assetWidth??48,o=Math.max(a,s),l=n==null?void 0:n.wrappingWidth;e.width=Math.max(o,l??0);const{shapeSvg:u,bbox:h,label:d}=await xr(t,e,"icon-shape default"),f=20,p=e.label?8:0,g=e.pos==="t",{nodeBorder:m,mainBkg:y}=r,{stylesMap:v}=W0(e),T=Kt.svg(u),b=Qt(e,{});e.look!=="handDrawn"&&(b.roughness=0,b.fillStyle="solid");const w=v.get("fill");b.stroke=w??y;const k=u.append("g");e.icon&&k.html(`${await Lu(e.icon,{height:o,width:o,fallbackPrefix:""})}`);const A=k.node().getBBox(),C=A.width,_=A.height,L=A.x,O=A.y,M=Math.max(C,_)*Math.SQRT2+f*2,z=T.circle(0,0,M,b),F=Math.max(M,h.width),S=M+h.height+p,R=T.rectangle(-F/2,-S/2,F,S,{...b,fill:"transparent",stroke:"none"}),N=u.insert(()=>z,":first-child"),D=u.insert(()=>R);return k.attr("transform",`translate(${-C/2-L},${g?h.height/2+p/2-_/2-O:-h.height/2-p/2-_/2-O})`),k.attr("style",`color: ${v.get("stroke")??m};`),d.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${g?-S/2:S/2-h.height})`),N.attr("transform",`translate(0,${g?h.height/2+p/2:-h.height/2-p/2})`),rr(e,D),e.intersect=function(I){return ae.info("iconSquare intersect",e,I),Ht.rect(e,I)},u}x(HW,"iconCircle");async function YW(t,e,{config:{themeVariables:r,flowchart:n}}){const{labelStyles:i}=Xt(e);e.labelStyle=i;const a=e.assetHeight??48,s=e.assetWidth??48,o=Math.max(a,s),l=n==null?void 0:n.wrappingWidth;e.width=Math.max(o,l??0);const{shapeSvg:u,bbox:h,halfPadding:d,label:f}=await xr(t,e,"icon-shape default"),p=e.pos==="t",g=o+d*2,m=o+d*2,{nodeBorder:y,mainBkg:v}=r,{stylesMap:T}=W0(e),b=-m/2,w=-g/2,k=e.label?8:0,A=Kt.svg(u),C=Qt(e,{});e.look!=="handDrawn"&&(C.roughness=0,C.fillStyle="solid");const _=T.get("fill");C.stroke=_??v;const L=A.path(Nu(b,w,m,g,5),C),O=Math.max(m,h.width),M=g+h.height+k,z=A.rectangle(-O/2,-M/2,O,M,{...C,fill:"transparent",stroke:"none"}),F=u.insert(()=>L,":first-child").attr("class","icon-shape2"),S=u.insert(()=>z);if(e.icon){const R=u.append("g");R.html(`${await Lu(e.icon,{height:o,width:o,fallbackPrefix:""})}`);const N=R.node().getBBox(),D=N.width,I=N.height,$=N.x,B=N.y;R.attr("transform",`translate(${-D/2-$},${p?h.height/2+k/2-I/2-B:-h.height/2-k/2-I/2-B})`),R.attr("style",`color: ${T.get("stroke")??y};`)}return f.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${p?-M/2:M/2-h.height})`),F.attr("transform",`translate(0,${p?h.height/2+k/2:-h.height/2-k/2})`),rr(e,S),e.intersect=function(R){if(ae.info("iconSquare intersect",e,R),!e.label)return Ht.rect(e,R);const N=e.x??0,D=e.y??0,I=e.height??0;let $=[];return p?$=[{x:N-h.width/2,y:D-I/2},{x:N+h.width/2,y:D-I/2},{x:N+h.width/2,y:D-I/2+h.height+k},{x:N+m/2,y:D-I/2+h.height+k},{x:N+m/2,y:D+I/2},{x:N-m/2,y:D+I/2},{x:N-m/2,y:D-I/2+h.height+k},{x:N-h.width/2,y:D-I/2+h.height+k}]:$=[{x:N-m/2,y:D-I/2},{x:N+m/2,y:D-I/2},{x:N+m/2,y:D-I/2+g},{x:N+h.width/2,y:D-I/2+g},{x:N+h.width/2/2,y:D+I/2},{x:N-h.width/2,y:D+I/2},{x:N-h.width/2,y:D-I/2+g},{x:N-m/2,y:D-I/2+g}],Ht.polygon(e,$,R)},u}x(YW,"iconRounded");async function XW(t,e,{config:{themeVariables:r,flowchart:n}}){const{labelStyles:i}=Xt(e);e.labelStyle=i;const a=e.assetHeight??48,s=e.assetWidth??48,o=Math.max(a,s),l=n==null?void 0:n.wrappingWidth;e.width=Math.max(o,l??0);const{shapeSvg:u,bbox:h,halfPadding:d,label:f}=await xr(t,e,"icon-shape default"),p=e.pos==="t",g=o+d*2,m=o+d*2,{nodeBorder:y,mainBkg:v}=r,{stylesMap:T}=W0(e),b=-m/2,w=-g/2,k=e.label?8:0,A=Kt.svg(u),C=Qt(e,{});e.look!=="handDrawn"&&(C.roughness=0,C.fillStyle="solid");const _=T.get("fill");C.stroke=_??v;const L=A.path(Nu(b,w,m,g,.1),C),O=Math.max(m,h.width),M=g+h.height+k,z=A.rectangle(-O/2,-M/2,O,M,{...C,fill:"transparent",stroke:"none"}),F=u.insert(()=>L,":first-child"),S=u.insert(()=>z);if(e.icon){const R=u.append("g");R.html(`${await Lu(e.icon,{height:o,width:o,fallbackPrefix:""})}`);const N=R.node().getBBox(),D=N.width,I=N.height,$=N.x,B=N.y;R.attr("transform",`translate(${-D/2-$},${p?h.height/2+k/2-I/2-B:-h.height/2-k/2-I/2-B})`),R.attr("style",`color: ${T.get("stroke")??y};`)}return f.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${p?-M/2:M/2-h.height})`),F.attr("transform",`translate(0,${p?h.height/2+k/2:-h.height/2-k/2})`),rr(e,S),e.intersect=function(R){if(ae.info("iconSquare intersect",e,R),!e.label)return Ht.rect(e,R);const N=e.x??0,D=e.y??0,I=e.height??0;let $=[];return p?$=[{x:N-h.width/2,y:D-I/2},{x:N+h.width/2,y:D-I/2},{x:N+h.width/2,y:D-I/2+h.height+k},{x:N+m/2,y:D-I/2+h.height+k},{x:N+m/2,y:D+I/2},{x:N-m/2,y:D+I/2},{x:N-m/2,y:D-I/2+h.height+k},{x:N-h.width/2,y:D-I/2+h.height+k}]:$=[{x:N-m/2,y:D-I/2},{x:N+m/2,y:D-I/2},{x:N+m/2,y:D-I/2+g},{x:N+h.width/2,y:D-I/2+g},{x:N+h.width/2/2,y:D+I/2},{x:N-h.width/2,y:D+I/2},{x:N-h.width/2,y:D-I/2+g},{x:N-m/2,y:D-I/2+g}],Ht.polygon(e,$,R)},u}x(XW,"iconSquare");async function KW(t,e,{config:{flowchart:r}}){const n=new Image;n.src=(e==null?void 0:e.img)??"",await n.decode();const i=Number(n.naturalWidth.toString().replace("px","")),a=Number(n.naturalHeight.toString().replace("px",""));e.imageAspectRatio=i/a;const{labelStyles:s}=Xt(e);e.labelStyle=s;const o=r==null?void 0:r.wrappingWidth;e.defaultWidth=r==null?void 0:r.wrappingWidth;const l=Math.max(e.label?o??0:0,(e==null?void 0:e.assetWidth)??i),u=e.constraint==="on"&&e!=null&&e.assetHeight?e.assetHeight*e.imageAspectRatio:l,h=e.constraint==="on"?u/e.imageAspectRatio:(e==null?void 0:e.assetHeight)??a;e.width=Math.max(u,o??0);const{shapeSvg:d,bbox:f,label:p}=await xr(t,e,"image-shape default"),g=e.pos==="t",m=-u/2,y=-h/2,v=e.label?8:0,T=Kt.svg(d),b=Qt(e,{});e.look!=="handDrawn"&&(b.roughness=0,b.fillStyle="solid");const w=T.rectangle(m,y,u,h,b),k=Math.max(u,f.width),A=h+f.height+v,C=T.rectangle(-k/2,-A/2,k,A,{...b,fill:"none",stroke:"none"}),_=d.insert(()=>w,":first-child"),L=d.insert(()=>C);if(e.img){const O=d.append("image");O.attr("href",e.img),O.attr("width",u),O.attr("height",h),O.attr("preserveAspectRatio","none"),O.attr("transform",`translate(${-u/2},${g?A/2-h:-A/2})`)}return p.attr("transform",`translate(${-f.width/2-(f.x-(f.left??0))},${g?-h/2-f.height/2-v/2:h/2-f.height/2+v/2})`),_.attr("transform",`translate(0,${g?f.height/2+v/2:-f.height/2-v/2})`),rr(e,L),e.intersect=function(O){if(ae.info("iconSquare intersect",e,O),!e.label)return Ht.rect(e,O);const M=e.x??0,z=e.y??0,F=e.height??0;let S=[];return g?S=[{x:M-f.width/2,y:z-F/2},{x:M+f.width/2,y:z-F/2},{x:M+f.width/2,y:z-F/2+f.height+v},{x:M+u/2,y:z-F/2+f.height+v},{x:M+u/2,y:z+F/2},{x:M-u/2,y:z+F/2},{x:M-u/2,y:z-F/2+f.height+v},{x:M-f.width/2,y:z-F/2+f.height+v}]:S=[{x:M-u/2,y:z-F/2},{x:M+u/2,y:z-F/2},{x:M+u/2,y:z-F/2+h},{x:M+f.width/2,y:z-F/2+h},{x:M+f.width/2/2,y:z+F/2},{x:M-f.width/2,y:z+F/2},{x:M-f.width/2,y:z-F/2+h},{x:M-u/2,y:z-F/2+h}],Ht.polygon(e,S,O)},d}x(KW,"imageSquare");async function jW(t,e){const{labelStyles:r,nodeStyles:n}=Xt(e);e.labelStyle=r;const i=e.padding??0,a=i,s=e.look==="neo"?i*2:i,{shapeSvg:o,bbox:l}=await xr(t,e,gr(e)),u=Math.max(l.width+(s??0)*2,(e==null?void 0:e.width)??0),h=Math.max(l.height+(a??0)*2,(e==null?void 0:e.height)??0),d=[{x:0,y:0},{x:u,y:0},{x:u+3*h/6,y:-h},{x:-3*h/6,y:-h}];let f;const{cssStyles:p}=e;if(e.look==="handDrawn"){const g=Kt.svg(o),m=Qt(e,{}),y=Wr(d),v=g.path(y,m);f=o.insert(()=>v,":first-child").attr("transform",`translate(${-u/2}, ${h/2})`),p&&f.attr("style",p)}else f=wc(o,u,h,d);return n&&f.attr("style",n),e.width=u,e.height=h,rr(e,f),e.intersect=function(g){return Ht.polygon(e,d,g)},o}x(jW,"inv_trapezoid");async function ZW(t,e){const{shapeSvg:r,bbox:n,label:i}=await xr(t,e,"label"),a=r.insert("rect",":first-child");return a.attr("width",.1).attr("height",.1),r.attr("class","label edgeLabel"),i.attr("transform",`translate(${-(n.width/2)-(n.x-(n.left??0))}, ${-(n.height/2)-(n.y-(n.top??0))})`),rr(e,a),e.intersect=function(l){return Ht.rect(e,l)},r}x(ZW,"labelRect");async function QW(t,e){const{labelStyles:r,nodeStyles:n}=Xt(e);e.labelStyle=r;const i=e.padding??0,a=i,s=e.look==="neo"?i*2:i,{shapeSvg:o,bbox:l}=await xr(t,e,gr(e)),u=((e==null?void 0:e.height)??l.height)+a,h=((e==null?void 0:e.width)??l.width)+s,d=[{x:0,y:0},{x:h+3*u/6,y:0},{x:h,y:-u},{x:-(3*u)/6,y:-u}];let f;const{cssStyles:p}=e;if(e.look==="handDrawn"){const g=Kt.svg(o),m=Qt(e,{}),y=Wr(d),v=g.path(y,m);f=o.insert(()=>v,":first-child").attr("transform",`translate(${-h/2}, ${u/2})`),p&&f.attr("style",p)}else f=wc(o,h,u,d);return n&&f.attr("style",n),e.width=h,e.height=u,rr(e,f),e.intersect=function(g){return Ht.polygon(e,d,g)},o}x(QW,"lean_left");async function JW(t,e){const{labelStyles:r,nodeStyles:n}=Xt(e);e.labelStyle=r;const i=e.padding??0,a=i,s=e.look==="neo"?i*2:i,{shapeSvg:o,bbox:l}=await xr(t,e,gr(e)),u=((e==null?void 0:e.height)??l.height)+a,h=((e==null?void 0:e.width)??l.width)+s,d=[{x:-3*u/6,y:0},{x:h,y:0},{x:h+3*u/6,y:-u},{x:0,y:-u}];let f;const{cssStyles:p}=e;if(e.look==="handDrawn"){const g=Kt.svg(o),m=Qt(e,{}),y=Wr(d),v=g.path(y,m);f=o.insert(()=>v,":first-child").attr("transform",`translate(${-h/2}, ${u/2})`),p&&f.attr("style",p)}else f=wc(o,h,u,d);return n&&f.attr("style",n),e.width=h,e.height=u,rr(e,f),e.intersect=function(g){return Ht.polygon(e,d,g)},o}x(JW,"lean_right");function eU(t,e){const{labelStyles:r,nodeStyles:n}=Xt(e);e.label="",e.labelStyle=r;const i=t.insert("g").attr("class",gr(e)).attr("id",e.domId??e.id),{cssStyles:a}=e,s=Math.max(35,(e==null?void 0:e.width)??0),o=Math.max(35,(e==null?void 0:e.height)??0),l=7,u=[{x:s,y:0},{x:0,y:o+l/2},{x:s-2*l,y:o+l/2},{x:0,y:2*o},{x:s,y:o-l/2},{x:2*l,y:o-l/2}],h=Kt.svg(i),d=Qt(e,{});e.look!=="handDrawn"&&(d.roughness=0,d.fillStyle="solid");const f=Wr(u),p=h.path(f,d),g=i.insert(()=>p,":first-child");return g.attr("class","outer-path"),a&&e.look!=="handDrawn"&&g.selectAll("path").attr("style",a),n&&e.look!=="handDrawn"&&g.selectAll("path").attr("style",n),g.attr("transform",`translate(-${s/2},${-o})`),rr(e,g),e.intersect=function(m){return ae.info("lightningBolt intersect",e,m),Ht.polygon(e,u,m)},i}x(eU,"lightningBolt");var T6e=x((t,e,r,n,i,a,s)=>[`M${t},${e+a}`,`a${i},${a} 0,0,0 ${r},0`,`a${i},${a} 0,0,0 ${-r},0`,`l0,${n}`,`a${i},${a} 0,0,0 ${r},0`,`l0,${-n}`,`M${t},${e+a+s}`,`a${i},${a} 0,0,0 ${r},0`].join(" "),"createCylinderPathD"),w6e=x((t,e,r,n,i,a,s)=>[`M${t},${e+a}`,`M${t+r},${e+a}`,`a${i},${a} 0,0,0 ${-r},0`,`l0,${n}`,`a${i},${a} 0,0,0 ${r},0`,`l0,${-n}`,`M${t},${e+a+s}`,`a${i},${a} 0,0,0 ${r},0`].join(" "),"createOuterCylinderPathD"),C6e=x((t,e,r,n,i,a)=>[`M${t-r/2},${-n/2}`,`a${i},${a} 0,0,0 ${r},0`].join(" "),"createInnerCylinderPathD"),tU=10,rU=10;async function nU(t,e){const{labelStyles:r,nodeStyles:n}=Xt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,s=e.look==="neo"?24:i;if(e.width||e.height){const v=e.width??0;e.width=(e.width??0)-a,e.widthA,":first-child").attr("class","line"),m=o.insert(()=>k,":first-child"),m.attr("class","basic label-container"),y&&m.attr("style",y)}else{const v=T6e(0,0,h,p,d,f,g);m=o.insert("path",":first-child").attr("d",v).attr("class","basic label-container outer-path").attr("style",Zi(y)).attr("style",n)}return m.attr("label-offset-y",f),m.attr("transform",`translate(${-h/2}, ${-(p/2+f)})`),rr(e,m),u.attr("transform",`translate(${-(l.width/2)-(l.x-(l.left??0))}, ${-(l.height/2)+f-(l.y-(l.top??0))})`),e.intersect=function(v){const T=Ht.rect(e,v),b=T.x-(e.x??0);if(d!=0&&(Math.abs(b)<(e.width??0)/2||Math.abs(b)==(e.width??0)/2&&Math.abs(T.y-(e.y??0))>(e.height??0)/2-f)){let w=f*f*(1-b*b/(d*d));w>0&&(w=Math.sqrt(w)),w=f-w,v.y-(e.y??0)>0&&(w=-w),T.y+=w}return T},o}x(nU,"linedCylinder");async function iU(t,e){const{labelStyles:r,nodeStyles:n}=Xt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,s=e.look==="neo"?12:i;if(e.width||e.height){const w=e.width;e.width=(w??0)*10/11-a*2,e.width<10&&(e.width=10),e.height=((e==null?void 0:e.height)??0)-s*2,e.height<10&&(e.height=10)}const{shapeSvg:o,bbox:l,label:u}=await xr(t,e,gr(e)),h=(e!=null&&e.width?e==null?void 0:e.width:l.width)+(a??0)*2,d=(e!=null&&e.height?e==null?void 0:e.height:l.height)+(s??0)*2,f=e.look==="neo"?d/4:d/8,p=d+f,{cssStyles:g}=e,m=Kt.svg(o),y=Qt(e,{});e.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const v=[{x:-h/2-h/2*.1,y:-p/2},{x:-h/2-h/2*.1,y:p/2},...Du(-h/2-h/2*.1,p/2,h/2+h/2*.1,p/2,f,.8),{x:h/2+h/2*.1,y:-p/2},{x:-h/2-h/2*.1,y:-p/2},{x:-h/2,y:-p/2},{x:-h/2,y:p/2*1.1},{x:-h/2,y:-p/2}],T=m.polygon(v.map(w=>[w.x,w.y]),y),b=o.insert(()=>T,":first-child");return b.attr("class","basic label-container outer-path"),g&&e.look!=="handDrawn"&&b.selectAll("path").attr("style",g),n&&e.look!=="handDrawn"&&b.selectAll("path").attr("style",n),b.attr("transform",`translate(0,${-f/2})`),u.attr("transform",`translate(${-h/2+(e.padding??0)+h/2*.1/2-(l.x-(l.left??0))},${-d/2+(e.padding??0)-f/2-(l.y-(l.top??0))})`),rr(e,b),e.intersect=function(w){return Ht.polygon(e,v,w)},o}x(iU,"linedWaveEdgedRect");async function aU(t,e){const{labelStyles:r,nodeStyles:n}=Xt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,s=e.look==="neo"?12:i,o=e.look==="neo"?10:5;(e.width||e.height)&&(e.width=Math.max(((e==null?void 0:e.width)??0)-a*2-2*o,10),e.height=Math.max(((e==null?void 0:e.height)??0)-s*2-2*o,10));const{shapeSvg:l,bbox:u,label:h}=await xr(t,e,gr(e)),d=(e!=null&&e.width?e==null?void 0:e.width:u.width)+a*2+2*o,f=(e!=null&&e.height?e==null?void 0:e.height:u.height)+s*2+2*o,p=d-2*o,g=f-2*o,m=-p/2,y=-g/2,{cssStyles:v}=e,T=Kt.svg(l),b=Qt(e,{}),w=[{x:m-o,y:y+o},{x:m-o,y:y+g+o},{x:m+p-o,y:y+g+o},{x:m+p-o,y:y+g},{x:m+p,y:y+g},{x:m+p,y:y+g-o},{x:m+p+o,y:y+g-o},{x:m+p+o,y:y-o},{x:m+o,y:y-o},{x:m+o,y},{x:m,y},{x:m,y:y+o}],k=[{x:m,y:y+o},{x:m+p-o,y:y+o},{x:m+p-o,y:y+g},{x:m+p,y:y+g},{x:m+p,y},{x:m,y}];e.look!=="handDrawn"&&(b.roughness=0,b.fillStyle="solid");const A=Wr(w);let C=T.path(A,b);const _=Wr(k);let L=T.path(_,b);e.look!=="handDrawn"&&(C=q_(C),L=q_(L));const O=l.insert("g",":first-child");return O.insert(()=>C),O.insert(()=>L),O.attr("class","basic label-container outer-path"),v&&e.look!=="handDrawn"&&O.selectAll("path").attr("style",v),n&&e.look!=="handDrawn"&&O.selectAll("path").attr("style",n),h.attr("transform",`translate(${-(u.width/2)-o-(u.x-(u.left??0))}, ${-(u.height/2)+o-(u.y-(u.top??0))})`),rr(e,O),e.intersect=function(M){return Ht.polygon(e,w,M)},l}x(aU,"multiRect");async function sU(t,e){const{labelStyles:r,nodeStyles:n}=Xt(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,label:s}=await xr(t,e,gr(e)),o=e.padding??0,l=e.look==="neo"?16:o,u=e.look==="neo"?12:o;let h=!0;(e.width||e.height)&&(h=!1,e.width=((e==null?void 0:e.width)??0)-l*2,e.height=((e==null?void 0:e.height)??0)-u*3);const d=Math.max(a.width,(e==null?void 0:e.width)??0)+l*2,f=Math.max(a.height,(e==null?void 0:e.height)??0)+u*3,p=e.look==="neo"?f/4:f/8,g=f+(h?p/2:-p/2),m=-d/2,y=-g/2,v=10,{cssStyles:T}=e,b=Du(m-v,y+g+v,m+d-v,y+g+v,p,.8),w=b==null?void 0:b[b.length-1],k=[{x:m-v,y:y+v},{x:m-v,y:y+g+v},...b,{x:m+d-v,y:w.y-v},{x:m+d,y:w.y-v},{x:m+d,y:w.y-2*v},{x:m+d+v,y:w.y-2*v},{x:m+d+v,y:y-v},{x:m+v,y:y-v},{x:m+v,y},{x:m,y},{x:m,y:y+v}],A=[{x:m,y:y+v},{x:m+d-v,y:y+v},{x:m+d-v,y:w.y-v},{x:m+d,y:w.y-v},{x:m+d,y},{x:m,y}],C=Kt.svg(i),_=Qt(e,{});e.look!=="handDrawn"&&(_.roughness=0,_.fillStyle="solid");const L=Wr(k),O=C.path(L,_),M=Wr(A),z=C.path(M,_),F=i.insert(()=>O,":first-child");return F.insert(()=>z),F.attr("class","basic label-container outer-path"),T&&e.look!=="handDrawn"&&F.selectAll("path").attr("style",T),n&&e.look!=="handDrawn"&&F.selectAll("path").attr("style",n),F.attr("transform",`translate(0,${-p/2})`),s.attr("transform",`translate(${-(a.width/2)-v-(a.x-(a.left??0))}, ${-(a.height/2)+v-p/2-(a.y-(a.top??0))})`),rr(e,F),e.intersect=function(S){return Ht.polygon(e,k,S)},i}x(sU,"multiWaveEdgedRectangle");async function oU(t,e,{config:{themeVariables:r}}){const{labelStyles:n,nodeStyles:i}=Xt(e);e.labelStyle=n,e.useHtmlLabels||on(lr())||(e.centerLabel=!0);const{shapeSvg:s,bbox:o,label:l}=await xr(t,e,gr(e)),u=Math.max(o.width+(e.padding??0)*2,(e==null?void 0:e.width)??0),h=Math.max(o.height+(e.padding??0)*2,(e==null?void 0:e.height)??0),d=-u/2,f=-h/2,{cssStyles:p}=e,g=Kt.svg(s),m=Qt(e,{fill:r.noteBkgColor,stroke:r.noteBorderColor});e.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=g.rectangle(d,f,u,h,m),v=s.insert(()=>y,":first-child");return v.attr("class","basic label-container outer-path"),l.attr("class","label noteLabel"),p&&e.look!=="handDrawn"&&v.selectAll("path").attr("style",p),i&&e.look!=="handDrawn"&&v.selectAll("path").attr("style",i),l.attr("transform",`translate(${-o.width/2-(o.x-(o.left??0))}, ${-(o.height/2)-(o.y-(o.top??0))})`),rr(e,v),e.intersect=function(T){return Ht.rect(e,T)},s}x(oU,"note");var k6e=x((t,e,r)=>[`M${t+r/2},${e}`,`L${t+r},${e-r/2}`,`L${t+r/2},${e-r}`,`L${t},${e-r/2}`,"Z"].join(" "),"createDecisionBoxPathD");async function lU(t,e){const{labelStyles:r,nodeStyles:n}=Xt(e);e.labelStyle=r;const{shapeSvg:i,bbox:a}=await xr(t,e,gr(e)),s=a.width+(e.padding??0),o=a.height+(e.padding??0),l=s+o,u=.5,h=[{x:l/2,y:0},{x:l,y:-l/2},{x:l/2,y:-l},{x:0,y:-l/2}];let d;const{cssStyles:f}=e;if(e.look==="handDrawn"){const p=Kt.svg(i),g=Qt(e,{}),m=k6e(0,0,l),y=p.path(m,g);d=i.insert(()=>y,":first-child").attr("transform",`translate(${-l/2+u}, ${l/2})`),f&&d.attr("style",f)}else d=wc(i,l,l,h),d.attr("transform",`translate(${-l/2+u}, ${l/2})`);return n&&d.attr("style",n),rr(e,d),e.calcIntersect=function(p,g){const m=p.width,y=[{x:m/2,y:0},{x:m,y:-m/2},{x:m/2,y:-m},{x:0,y:-m/2}],v=Ht.polygon(p,y,g);return{x:v.x-.5,y:v.y-.5}},e.intersect=function(p){return this.calcIntersect(e,p)},i}x(lU,"question");async function cU(t,e){const{labelStyles:r,nodeStyles:n}=Xt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?21:i??0,s=e.look==="neo"?12:i??0,{shapeSvg:o,bbox:l,label:u}=await xr(t,e,gr(e)),h=((e==null?void 0:e.width)??l.width)+(e.look==="neo"?a*2:a),d=((e==null?void 0:e.height)??l.height)+(e.look==="neo"?s*2:s),f=-h/2,p=-d/2,g=p/2,m=[{x:f+g,y:p},{x:f,y:0},{x:f+g,y:-p},{x:-f,y:-p},{x:-f,y:p}],{cssStyles:y}=e,v=Kt.svg(o),T=Qt(e,{});e.look!=="handDrawn"&&(T.roughness=0,T.fillStyle="solid");const b=Wr(m),w=v.path(b,T),k=o.insert(()=>w,":first-child");return k.attr("class","basic label-container outer-path"),y&&e.look!=="handDrawn"&&k.selectAll("path").attr("style",y),n&&e.look!=="handDrawn"&&k.selectAll("path").attr("style",n),k.attr("transform",`translate(${-g/2},0)`),u.attr("transform",`translate(${-g/2-l.width/2-(l.x-(l.left??0))}, ${-(l.height/2)-(l.y-(l.top??0))})`),rr(e,k),e.intersect=function(A){return Ht.polygon(e,m,A)},o}x(cU,"rect_left_inv_arrow");async function uU(t,e){const{labelStyles:r,nodeStyles:n}=Xt(e);e.labelStyle=r;let i;e.cssClasses?i="node "+e.cssClasses:i="node default";const a=t.insert("g").attr("class",i).attr("id",e.domId||e.id),s=a.insert("g"),o=a.insert("g").attr("class","label").attr("style",n),l=e.description,u=e.label,h=await Mu(o,u,e.labelStyle,!0,!0);let d={width:0,height:0};if(on(Pe())){const _=h.children[0],L=pt(h);d=_.getBoundingClientRect(),L.attr("width",d.width),L.attr("height",d.height)}ae.info("Text 2",l);const f=l||[],p=h.getBBox(),g=await Mu(o,Array.isArray(f)?f.join("
    "):f,e.labelStyle,!0,!0),m=g.children[0],y=pt(g);d=m.getBoundingClientRect(),y.attr("width",d.width),y.attr("height",d.height);const v=(e.padding||0)/2;pt(g).attr("transform","translate( "+(d.width>p.width?0:(p.width-d.width)/2)+", "+(p.height+v+5)+")"),pt(h).attr("transform","translate( "+(d.width(ae.debug("Rough node insert CXC",O),M),":first-child"),A=a.insert(()=>(ae.debug("Rough node insert CXC",O),O),":first-child")}else A=s.insert("rect",":first-child"),C=s.insert("line"),A.attr("class","outer title-state").attr("style",n).attr("x",-d.width/2-v).attr("y",-d.height/2-v).attr("width",d.width+(e.padding||0)).attr("height",d.height+(e.padding||0)),C.attr("class","divider").attr("x1",-d.width/2-v).attr("x2",d.width/2+v).attr("y1",-d.height/2-v+p.height+v).attr("y2",-d.height/2-v+p.height+v);return rr(e,A),e.intersect=function(_){return Ht.rect(e,_)},a}x(uU,"rectWithTitle");async function hU(t,e,{config:{themeVariables:r}}){const n=(r==null?void 0:r.radius)??5,i={rx:n,ry:n,labelPaddingX:((e==null?void 0:e.padding)??0)*1,labelPaddingY:((e==null?void 0:e.padding)??0)*1};return Y0(t,e,i)}x(hU,"roundedRect");var fd=8;async function dU(t,e){const{labelStyles:r,nodeStyles:n}=Xt(e);e.labelStyle=r;const i=e.look==="neo"?16:e.padding??0,a=e.look==="neo"?12:e.padding??0,{shapeSvg:s,bbox:o,label:l}=await xr(t,e,gr(e)),u=((e==null?void 0:e.width)??o.width)+i*2+(e.look==="neo"?fd:fd*2),h=((e==null?void 0:e.height)??o.height)+a*2,d=u-fd,f=h,p=fd-u/2,g=-h/2,{cssStyles:m}=e,y=Kt.svg(s),v=Qt(e,{});e.look!=="handDrawn"&&(v.roughness=0,v.fillStyle="solid");const T=[{x:p,y:g},{x:p+d,y:g},{x:p+d,y:g+f},{x:p-fd,y:g+f},{x:p-fd,y:g},{x:p,y:g},{x:p,y:g+f}],b=y.polygon(T.map(k=>[k.x,k.y]),v),w=s.insert(()=>b,":first-child");return w.attr("class","basic label-container outer-path").attr("style",Zi(m)),n&&e.look!=="handDrawn"&&w.selectAll("path").attr("style",n),m&&e.look!=="handDrawn"&&w.selectAll("path").attr("style",n),l.attr("transform",`translate(${fd/2-o.width/2-(o.x-(o.left??0))}, ${-(o.height/2)-(o.y-(o.top??0))})`),rr(e,w),e.intersect=function(k){return Ht.rect(e,k)},s}x(dU,"shadedProcess");async function fU(t,e){const{labelStyles:r,nodeStyles:n}=Xt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,s=e.look==="neo"?12:i;(e.width||e.height)&&(e.width=Math.max(((e==null?void 0:e.width)??0)-a*2,10),e.height=Math.max(((e==null?void 0:e.height)??0)/1.5-s*2,10));const{shapeSvg:o,bbox:l,label:u}=await xr(t,e,gr(e)),h=(e!=null&&e.width?e==null?void 0:e.width:l.width)+a*2,d=((e!=null&&e.height?e==null?void 0:e.height:l.height)+s*2)*1.5,f=h,p=d/1.5,g=-f/2,m=-p/2,{cssStyles:y}=e,v=Kt.svg(o),T=Qt(e,{});e.look!=="handDrawn"&&(T.roughness=0,T.fillStyle="solid");const b=[{x:g,y:m},{x:g,y:m+p},{x:g+f,y:m+p},{x:g+f,y:m-p/2}],w=Wr(b),k=v.path(w,T),A=o.insert(()=>k,":first-child");return A.attr("class","basic label-container outer-path"),y&&e.look!=="handDrawn"&&A.selectChildren("path").attr("style",y),n&&e.look!=="handDrawn"&&A.selectChildren("path").attr("style",n),A.attr("transform",`translate(0, ${p/4})`),u.attr("transform",`translate(${-f/2+(e.padding??0)-(l.x-(l.left??0))}, ${-p/4+(e.padding??0)-(l.y-(l.top??0))})`),rr(e,A),e.intersect=function(C){return Ht.polygon(e,b,C)},o}x(fU,"slopedRect");async function pU(t,e){const r=e.padding??0,n=e.look==="neo"?16:r*2,i=e.look==="neo"?12:r,a={rx:0,ry:0,labelPaddingX:e.labelPaddingX??n,labelPaddingY:i};return Y0(t,e,a)}x(pU,"squareRect");async function gU(t,e){const{labelStyles:r,nodeStyles:n}=Xt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?20:i,s=e.look==="neo"?12:i,{shapeSvg:o,bbox:l}=await xr(t,e,gr(e)),u=l.height+(e.look==="neo"?s*2:s),h=l.width+u/4+(e.look==="neo"?a*2:a),d=u/2,{cssStyles:f}=e,p=Kt.svg(o),g=Qt(e,{});e.look!=="handDrawn"&&(g.roughness=0,g.fillStyle="solid");const m=[{x:-h/2+d,y:-u/2},{x:h/2-d,y:-u/2},...tb(-h/2+d,0,d,50,90,270),{x:h/2-d,y:u/2},...tb(h/2-d,0,d,50,270,450)],y=Wr(m),v=p.path(y,g),T=o.insert(()=>v,":first-child");return T.attr("class","basic label-container outer-path"),f&&e.look!=="handDrawn"&&T.selectChildren("path").attr("style",f),n&&e.look!=="handDrawn"&&T.selectChildren("path").attr("style",n),rr(e,T),e.intersect=function(b){return Ht.polygon(e,m,b)},o}x(gU,"stadium");async function mU(t,e){const r={rx:e.look==="neo"?3:5,ry:e.look==="neo"?3:5};return Y0(t,e,r)}x(mU,"state");function yU(t,e,{config:{themeVariables:r}}){var T,b;const{labelStyles:n,nodeStyles:i}=Xt(e);e.labelStyle=n;const{cssStyles:a}=e,{lineColor:s,stateBorder:o,nodeBorder:l,nodeShadow:u}=r;(e.width||e.height)&&((e.width??0)<14&&(e.width=14),(e.height??0)<14&&(e.height=14)),e.width||(e.width=14),e.height||(e.height=14);const h=t.insert("g").attr("class","node default").attr("id",e.domId??e.id),d=Kt.svg(h),f=Qt(e,{});e.look!=="handDrawn"&&(f.roughness=0,f.fillStyle="solid");const p=d.circle(0,0,e.width,{...f,stroke:s,strokeWidth:2}),g=o??l,m=(e.width??0)*5/14,y=d.circle(0,0,m,{...f,fill:g,stroke:g,strokeWidth:2,fillStyle:"solid"}),v=h.insert(()=>p,":first-child");if(v.insert(()=>y),e.look!=="handDrawn"&&v.attr("class","outer-path"),a&&v.selectAll("path").attr("style",a),i&&v.selectAll("path").attr("style",i),e.width<25&&u&&e.look!=="handDrawn"){const w=((b=(T=t.node())==null?void 0:T.ownerSVGElement)==null?void 0:b.id)??"",k=w?`${w}-drop-shadow-small`:"drop-shadow-small";v.attr("style",`filter:url(#${k})`)}return rr(e,v),e.intersect=function(w){return Ht.circle(e,(e.width??0)/2,w)},h}x(yU,"stateEnd");function vU(t,e,{config:{themeVariables:r}}){var o,l;const{lineColor:n,nodeShadow:i}=r;(e.width||e.height)&&((e.width??0)<14&&(e.width=14),(e.height??0)<14&&(e.height=14)),e.width||(e.width=14),e.height||(e.height=14);const a=t.insert("g").attr("class","node default").attr("id",e.domId||e.id);let s;if(e.look==="handDrawn"){const h=Kt.svg(a).circle(0,0,e.width,$Ee(n));s=a.insert(()=>h),s.attr("class","state-start").attr("r",(e.width??7)/2).attr("width",e.width??14).attr("height",e.height??14)}else s=a.insert("circle",":first-child"),s.attr("class","state-start").attr("r",(e.width??7)/2).attr("width",e.width??14).attr("height",e.height??14);if(e.width<25&&i&&e.look!=="handDrawn"){const u=((l=(o=t.node())==null?void 0:o.ownerSVGElement)==null?void 0:l.id)??"",h=u?`${u}-drop-shadow-small`:"drop-shadow-small";s.attr("style",`filter:url(#${h})`)}return rr(e,s),e.intersect=function(u){return Ht.circle(e,(e.width??7)/2,u)},a}x(vU,"stateStart");var X0=8;async function bU(t,e){const{labelStyles:r,nodeStyles:n}=Xt(e);e.labelStyle=r;const i=(e==null?void 0:e.padding)??8,a=e.look==="neo"?28:i,s=e.look==="neo"?12:i,{shapeSvg:o,bbox:l}=await xr(t,e,gr(e)),u=((e==null?void 0:e.width)??l.width)+2*X0+a,h=((e==null?void 0:e.height)??l.height)+s,d=u-2*X0,f=h,p=-u/2,g=-h/2,m=[{x:0,y:0},{x:d,y:0},{x:d,y:-f},{x:0,y:-f},{x:0,y:0},{x:-8,y:0},{x:d+8,y:0},{x:d+8,y:-f},{x:-8,y:-f},{x:-8,y:0}];if(e.look==="handDrawn"){const y=Kt.svg(o),v=Qt(e,{}),T=y.rectangle(p,g,d+16,f,v),b=y.line(p+X0,g,p+X0,g+f,v),w=y.line(p+X0+d,g,p+X0+d,g+f,v);o.insert(()=>b,":first-child"),o.insert(()=>w,":first-child");const k=o.insert(()=>T,":first-child"),{cssStyles:A}=e;k.attr("class","basic label-container").attr("style",Zi(A)),rr(e,k)}else{const y=wc(o,d,f,m);n&&y.attr("style",n),rr(e,y)}return e.intersect=function(y){return Ht.polygon(e,m,y)},o}x(bU,"subroutine");var Y_=.2;async function xU(t,e){const{labelStyles:r,nodeStyles:n}=Xt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,s=e.look==="neo"?12:i;(e.width||e.height)&&(e.height=Math.max(((e==null?void 0:e.height)??0)-s*2,10),e.width=Math.max(((e==null?void 0:e.width)??0)-a*2-Y_*(e.height+s*2),10));const{shapeSvg:o,bbox:l}=await xr(t,e,gr(e)),u=(e!=null&&e.height?e==null?void 0:e.height:l.height)+s*2,h=Y_*u,d=Y_*u,p=(e!=null&&e.width?e==null?void 0:e.width:l.width)+a*2+h-h,g=u,m=-p/2,y=-g/2,{cssStyles:v}=e,T=Kt.svg(o),b=Qt(e,{}),w=[{x:m-h/2,y},{x:m+p+h/2,y},{x:m+p+h/2,y:y+g},{x:m-h/2,y:y+g}],k=[{x:m+p-h/2,y:y+g},{x:m+p+h/2,y:y+g},{x:m+p+h/2,y:y+g-d}];e.look!=="handDrawn"&&(b.roughness=0,b.fillStyle="solid");const A=Wr(w),C=T.path(A,b),_=Wr(k),L=T.path(_,{...b,fillStyle:"solid"}),O=o.insert(()=>L,":first-child");return O.insert(()=>C,":first-child"),O.attr("class","basic label-container outer-path"),v&&e.look!=="handDrawn"&&O.selectAll("path").attr("style",v),n&&e.look!=="handDrawn"&&O.selectAll("path").attr("style",n),rr(e,O),e.intersect=function(M){return Ht.polygon(e,w,M)},o}x(xU,"taggedRect");async function TU(t,e){const{labelStyles:r,nodeStyles:n}=Xt(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,label:s}=await xr(t,e,gr(e)),o=Math.max(a.width+(e.padding??0)*2,(e==null?void 0:e.width)??0),l=Math.max(a.height+(e.padding??0)*2,(e==null?void 0:e.height)??0),u=l/8,h=.2*o,d=.2*l,f=l+u,{cssStyles:p}=e,g=Kt.svg(i),m=Qt(e,{});e.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=[{x:-o/2-o/2*.1,y:f/2},...Du(-o/2-o/2*.1,f/2,o/2+o/2*.1,f/2,u,.8),{x:o/2+o/2*.1,y:-f/2},{x:-o/2-o/2*.1,y:-f/2}],v=-o/2+o/2*.1,T=-f/2-d*.4,b=[{x:v+o-h,y:(T+l)*1.3},{x:v+o,y:T+l-d},{x:v+o,y:(T+l)*.9},...Du(v+o,(T+l)*1.25,v+o-h,(T+l)*1.3,-l*.02,.5)],w=Wr(y),k=g.path(w,m),A=Wr(b),C=g.path(A,{...m,fillStyle:"solid"}),_=i.insert(()=>C,":first-child");return _.insert(()=>k,":first-child"),_.attr("class","basic label-container outer-path"),p&&e.look!=="handDrawn"&&_.selectAll("path").attr("style",p),n&&e.look!=="handDrawn"&&_.selectAll("path").attr("style",n),_.attr("transform",`translate(0,${-u/2})`),s.attr("transform",`translate(${-o/2+(e.padding??0)-(a.x-(a.left??0))},${-l/2+(e.padding??0)-u/2-(a.y-(a.top??0))})`),rr(e,_),e.intersect=function(L){return Ht.polygon(e,y,L)},i}x(TU,"taggedWaveEdgedRectangle");async function wU(t,e){const{labelStyles:r,nodeStyles:n}=Xt(e);e.labelStyle=r;const{shapeSvg:i,bbox:a}=await xr(t,e,gr(e)),s=Math.max(a.width+(e.padding??0),(e==null?void 0:e.width)||0),o=Math.max(a.height+(e.padding??0),(e==null?void 0:e.height)||0),l=-s/2,u=-o/2,h=i.insert("rect",":first-child");return h.attr("class","text").attr("style",n).attr("rx",0).attr("ry",0).attr("x",l).attr("y",u).attr("width",s).attr("height",o),rr(e,h),e.intersect=function(d){return Ht.rect(e,d)},i}x(wU,"text");var E6e=x((t,e,r,n,i,a)=>`M${t},${e} +`);return lX(n)}T(fX,"preprocessMarkdown");function pX(t){return t.split(/\\n|\n|/gi).map(e=>{var r;return((r=e.trim().match(/<[^>]+>|[^\s<>]+/g))==null?void 0:r.map(n=>({content:n,type:"normal"})))??[]})}T(pX,"nonMarkdownToLines");function gX(t,e={}){const r=fX(t,e),n=yn.lexer(r),i=[[]];let a=0;function s(o,l="normal"){o.type==="text"?o.text.split(` +`).forEach((h,d)=>{d!==0&&(a++,i.push([])),h.split(" ").forEach(f=>{f=f.replace(/'/g,"'"),f&&i[a].push({content:f,type:l})})}):o.type==="strong"||o.type==="em"?o.tokens.forEach(u=>{s(u,o.type)}):o.type==="html"&&i[a].push({content:o.text,type:"normal"})}return T(s,"processNode"),n.forEach(o=>{var l;o.type==="paragraph"?(l=o.tokens)==null||l.forEach(u=>{s(u)}):o.type==="html"?i[a].push({content:o.text,type:"normal"}):i[a].push({content:o.raw,type:"normal"})}),i}T(gX,"markdownToLines");function mX(t){return t?`

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

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

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

    `:i.type==="space"?"":i.type==="html"?`${i.text}`:i.type==="escape"?i.text:(se.warn(`Unsupported markdown: ${i.type}`),i.raw)}return T(n,"output"),r.map(n).join("")}T(yX,"markdownToHTML");function vX(t){return Intl.Segmenter?[...new Intl.Segmenter().segment(t)].map(e=>e.segment):[...t]}T(vX,"splitTextToChars");function bX(t,e){const r=vX(e.content);return _8(t,[],r,e.type)}T(bX,"splitWordToFitWidth");function _8(t,e,r,n){if(r.length===0)return[{content:e.join(""),type:n},{content:"",type:n}];const[i,...a]=r,s=[...e,i];return t([{content:s.join(""),type:n}])?_8(t,s,a,n):(e.length===0&&i&&(e.push(i),r.shift()),[{content:e.join(""),type:n},{content:r.join(""),type:n}])}T(_8,"splitWordToFitWidthRecursion");function xX(t,e){if(t.some(({content:r})=>r.includes(` +`)))throw new Error("splitLineToFitWidth does not support newlines in the line");return jk(t,e)}T(xX,"splitLineToFitWidth");function jk(t,e,r=[],n=[]){if(t.length===0)return n.length>0&&r.push(n),r.length>0?r:[];let i="";t[0].content===" "&&(i=" ",t.shift());const a=t.shift()??{content:" ",type:"normal"},s=[...n];if(i!==""&&s.push({content:i,type:"normal"}),s.push(a),e(s))return jk(t,e,r,s);if(n.length>0)r.push(n),t.unshift(a);else if(a.content){const[o,l]=bX(e,a);r.push([o]),l.content&&t.unshift(l)}return jk(t,e,r)}T(jk,"splitLineToFitWidthRecursion");function A8(t,e){e&&t.attr("style",e)}T(A8,"applyStyle");var TX=16384;async function wX(t,e,r,n,i=!1,a=pr()){const s=t.append("foreignObject");s.attr("width",`${Math.min(10*r,TX)}px`),s.attr("height",`${Math.min(10*r,TX)}px`);const o=s.append("xhtml:div"),l=Ii(e.label)?await $4(e.label.replace(Dt.lineBreakRegex,` +`),a):Zr(e.label,a),u=e.isNode?"nodeLabel":"edgeLabel",h=o.append("span");h.html(l),A8(h,e.labelStyle),h.attr("class",`${u} ${n}`),A8(o,e.labelStyle),o.style("display","table-cell"),o.style("white-space","nowrap"),o.style("line-height","1.5"),r!==Number.POSITIVE_INFINITY&&(o.style("max-width",r+"px"),o.style("text-align","center")),o.attr("xmlns","http://www.w3.org/1999/xhtml"),i&&o.attr("class","labelBkg");let d=o.node().getBoundingClientRect();return d.width===r&&(o.style("display","table"),o.style("white-space","break-spaces"),o.style("width",r+"px"),d=o.node().getBoundingClientRect()),s.node()}T(wX,"addHtmlSpan");function Kk(t,e,r,n=!1){const i=t.append("tspan").attr("class","text-outer-tspan").attr("x",0).attr("y",e*r-.1+"em").attr("dy",r+"em");return n&&i.attr("text-anchor","middle"),i}T(Kk,"createTspan");function CX(t,e,r){const n=t.append("text"),i=Kk(n,1,e);Zk(i,r);const a=i.node().getComputedTextLength();return n.remove(),a}T(CX,"computeWidthOfText");function kX(t,e,r){var s;const n=t.append("text"),i=Kk(n,1,e);Zk(i,[{content:r,type:"normal"}]);const a=(s=i.node())==null?void 0:s.getBoundingClientRect();return a&&n.remove(),a}T(kX,"computeDimensionOfText");function EX(t,e,r,n=!1,i=!1){const s=e.append("g"),o=s.insert("rect").attr("class","background").attr("style","stroke: none"),l=s.append("text").attr("y","-10.1");i&&l.attr("text-anchor","middle");let u=0;for(const h of r){const d=T(p=>CX(s,1.1,p)<=t,"checkWidth"),f=d(h)?[h]:xX(h,d);for(const p of f){const g=Kk(l,u,1.1,i);Zk(g,p),u++}}if(n){const h=l.node().getBBox(),d=2;return o.attr("x",h.x-d).attr("y",h.y-d).attr("width",h.width+2*d).attr("height",h.height+2*d),s.node()}else return l.node()}T(EX,"createFormattedText");function R8(t){const e=/&(amp|lt|gt);/g;return t.replace(e,(r,n)=>{switch(n){case"amp":return"&";case"lt":return"<";case"gt":return">";default:return r}})}T(R8,"decodeHTMLEntities");function Zk(t,e){t.text(""),e.forEach((r,n)=>{const i=t.append("tspan").attr("font-style",r.type==="em"?"italic":"normal").attr("class","text-inner-tspan").attr("font-weight",r.type==="strong"?"bold":"normal");n===0?i.text(R8(r.content)):i.text(" "+R8(r.content))})}T(Zk,"updateTextContentAndStyles");async function SX(t,e={}){const r=[];t.replace(/(fa[bklrs]?):fa-([\w-]+)/g,(i,a,s)=>(r.push((async()=>{const o=`${a}:${s}`;return await iIe(o)?await Rh(o,void 0,{class:"label-icon"}):``})()),i));const n=await Promise.all(r);return t.replace(/(fa[bklrs]?):fa-([\w-]+)/g,()=>n.shift()??"")}T(SX,"replaceIconSubstring");var ys=T(async(t,e="",{style:r="",isTitle:n=!1,classes:i="",useHtmlLabels:a=!0,markdown:s=!0,isNode:o=!0,width:l=200,addSvgBackground:u=!1}={},h)=>{if(se.debug("XYZ createText",e,r,n,i,a,o,"addSvgBackground: ",u),a){const d=s?yX(e,h):mX(e),f=await SX(uu(d),h),p=e.replace(/\\\\/g,"\\"),g={isNode:o,label:Ii(e)?p:f,labelStyle:r.replace("fill:","color:")};return await wX(t,g,l,i,u,h)}else{const d=uu(e.replace(//g,"
    ")),f=s?gX(d.replace("
    ","
    "),h):pX(d),p=EX(l,t,f,e?u:!1,!o);if(o){/stroke:/.exec(r)&&(r=r.replace("stroke:","lineColor:"));const g=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");gt(p).attr("style",g)}else{const g=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/background:/g,"fill:");gt(p).select("rect").attr("style",g.replace(/background:/g,"fill:"));const m=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");gt(p).select("text").attr("style",m)}return n?gt(p).selectAll("tspan.text-outer-tspan").classed("title-row",!0):gt(p).selectAll("tspan.text-outer-tspan").classed("row",!0),p}},"createText");function L8(t,e,r){if(t&&t.length){const[n,i]=e,a=Math.PI/180*r,s=Math.cos(a),o=Math.sin(a);for(const l of t){const[u,h]=l;l[0]=(u-n)*s-(h-i)*o+n,l[1]=(u-n)*o+(h-i)*s+i}}}function aIe(t,e){return t[0]===e[0]&&t[1]===e[1]}function sIe(t,e,r,n=1){const i=r,a=Math.max(e,.1),s=t[0]&&t[0][0]&&typeof t[0][0]=="number"?[t]:t,o=[0,0];if(i)for(const u of s)L8(u,o,i);const l=(function(u,h,d){const f=[];for(const x of u){const b=[...x];aIe(b[0],b[b.length-1])||b.push([b[0][0],b[0][1]]),b.length>2&&f.push(b)}const p=[];h=Math.max(h,.1);const g=[];for(const x of f)for(let b=0;bx.yminb.ymin?1:x.xb.x?1:x.ymax===b.ymax?0:(x.ymax-b.ymax)/Math.abs(x.ymax-b.ymax))),!g.length)return p;let m=[],y=g[0].ymin,v=0;for(;m.length||g.length;){if(g.length){let x=-1;for(let b=0;by);b++)x=b;g.splice(0,x+1).forEach((b=>{m.push({s:y,edge:b})}))}if(m=m.filter((x=>!(x.edge.ymax<=y))),m.sort(((x,b)=>x.edge.x===b.edge.x?0:(x.edge.x-b.edge.x)/Math.abs(x.edge.x-b.edge.x))),(d!==1||v%h==0)&&m.length>1)for(let x=0;x=m.length)break;const w=m[x].edge,C=m[b].edge;p.push([[Math.round(w.x),y],[Math.round(C.x),y]])}y+=d,m.forEach((x=>{x.edge.x=x.edge.x+d*x.edge.islope})),v++}return p})(s,a,n);if(i){for(const u of s)L8(u,o,-i);(function(u,h,d){const f=[];u.forEach((p=>f.push(...p))),L8(f,h,d)})(l,o,-i)}return l}function Ix(t,e){var r;const n=e.hachureAngle+90;let i=e.hachureGap;i<0&&(i=4*e.strokeWidth),i=Math.round(Math.max(i,.1));let a=1;return e.roughness>=1&&(((r=e.randomizer)===null||r===void 0?void 0:r.next())||Math.random())>.7&&(a=i),sIe(t,i,n,a||1)}let I8=class{constructor(e){this.helper=e}fillPolygons(e,r){return this._fillPolygons(e,r)}_fillPolygons(e,r){const n=Ix(e,r);return{type:"fillSketch",ops:this.renderLines(n,r)}}renderLines(e,r){const n=[];for(const i of e)n.push(...this.helper.doubleLineOps(i[0][0],i[0][1],i[1][0],i[1][1],r));return n}};function Qk(t){const e=t[0],r=t[1];return Math.sqrt(Math.pow(e[0]-r[0],2)+Math.pow(e[1]-r[1],2))}let oIe=class extends I8{fillPolygons(e,r){let n=r.hachureGap;n<0&&(n=4*r.strokeWidth),n=Math.max(n,.1);const i=Ix(e,Object.assign({},r,{hachureGap:n})),a=Math.PI/180*r.hachureAngle,s=[],o=.5*n*Math.cos(a),l=.5*n*Math.sin(a);for(const[u,h]of i)Qk([u,h])&&s.push([[u[0]-o,u[1]+l],[...h]],[[u[0]+o,u[1]-l],[...h]]);return{type:"fillSketch",ops:this.renderLines(s,r)}}},lIe=class extends I8{fillPolygons(e,r){const n=this._fillPolygons(e,r),i=Object.assign({},r,{hachureAngle:r.hachureAngle+90}),a=this._fillPolygons(e,i);return n.ops=n.ops.concat(a.ops),n}},cIe=class{constructor(e){this.helper=e}fillPolygons(e,r){const n=Ix(e,r=Object.assign({},r,{hachureAngle:0}));return this.dotsOnLines(n,r)}dotsOnLines(e,r){const n=[];let i=r.hachureGap;i<0&&(i=4*r.strokeWidth),i=Math.max(i,.1);let a=r.fillWeight;a<0&&(a=r.strokeWidth/2);const s=i/4;for(const o of e){const l=Qk(o),u=l/i,h=Math.ceil(u)-1,d=l-h*i,f=(o[0][0]+o[1][0])/2-i/4,p=Math.min(o[0][1],o[1][1]);for(let g=0;g{const o=Qk(s),l=Math.floor(o/(n+i)),u=(o+i-l*(n+i))/2;let h=s[0],d=s[1];h[0]>d[0]&&(h=s[1],d=s[0]);const f=Math.atan((d[1]-h[1])/(d[0]-h[0]));for(let p=0;p{const s=Qk(a),o=Math.round(s/(2*r));let l=a[0],u=a[1];l[0]>u[0]&&(l=a[1],u=a[0]);const h=Math.atan((u[1]-l[1])/(u[0]-l[0]));for(let d=0;dh%2?u+r:u+e));a.push({key:"C",data:l}),e=l[4],r=l[5];break}case"Q":a.push({key:"Q",data:[...o]}),e=o[2],r=o[3];break;case"q":{const l=o.map(((u,h)=>h%2?u+r:u+e));a.push({key:"Q",data:l}),e=l[2],r=l[3];break}case"A":a.push({key:"A",data:[...o]}),e=o[5],r=o[6];break;case"a":e+=o[5],r+=o[6],a.push({key:"A",data:[o[0],o[1],o[2],o[3],o[4],e,r]});break;case"H":a.push({key:"H",data:[...o]}),e=o[0];break;case"h":e+=o[0],a.push({key:"H",data:[e]});break;case"V":a.push({key:"V",data:[...o]}),r=o[0];break;case"v":r+=o[0],a.push({key:"V",data:[r]});break;case"S":a.push({key:"S",data:[...o]}),e=o[2],r=o[3];break;case"s":{const l=o.map(((u,h)=>h%2?u+r:u+e));a.push({key:"S",data:l}),e=l[2],r=l[3];break}case"T":a.push({key:"T",data:[...o]}),e=o[0],r=o[1];break;case"t":e+=o[0],r+=o[1],a.push({key:"T",data:[e,r]});break;case"Z":case"z":a.push({key:"Z",data:[]}),e=n,r=i}return a}function RX(t){const e=[];let r="",n=0,i=0,a=0,s=0,o=0,l=0;for(const{key:u,data:h}of t){switch(u){case"M":e.push({key:"M",data:[...h]}),[n,i]=h,[a,s]=h;break;case"C":e.push({key:"C",data:[...h]}),n=h[4],i=h[5],o=h[2],l=h[3];break;case"L":e.push({key:"L",data:[...h]}),[n,i]=h;break;case"H":n=h[0],e.push({key:"L",data:[n,i]});break;case"V":i=h[0],e.push({key:"L",data:[n,i]});break;case"S":{let d=0,f=0;r==="C"||r==="S"?(d=n+(n-o),f=i+(i-l)):(d=n,f=i),e.push({key:"C",data:[d,f,...h]}),o=h[0],l=h[1],n=h[2],i=h[3];break}case"T":{const[d,f]=h;let p=0,g=0;r==="Q"||r==="T"?(p=n+(n-o),g=i+(i-l)):(p=n,g=i);const m=n+2*(p-n)/3,y=i+2*(g-i)/3,v=d+2*(p-d)/3,x=f+2*(g-f)/3;e.push({key:"C",data:[m,y,v,x,d,f]}),o=p,l=g,n=d,i=f;break}case"Q":{const[d,f,p,g]=h,m=n+2*(d-n)/3,y=i+2*(f-i)/3,v=p+2*(d-p)/3,x=g+2*(f-g)/3;e.push({key:"C",data:[m,y,v,x,p,g]}),o=d,l=f,n=p,i=g;break}case"A":{const d=Math.abs(h[0]),f=Math.abs(h[1]),p=h[2],g=h[3],m=h[4],y=h[5],v=h[6];d===0||f===0?(e.push({key:"C",data:[n,i,y,v,y,v]}),n=y,i=v):(n!==y||i!==v)&&(LX(n,i,y,v,d,f,p,g,m).forEach((function(x){e.push({key:"C",data:x})})),n=y,i=v);break}case"Z":e.push({key:"Z",data:[]}),n=a,i=s}r=u}return e}function Dx(t,e,r){return[t*Math.cos(r)-e*Math.sin(r),t*Math.sin(r)+e*Math.cos(r)]}function LX(t,e,r,n,i,a,s,o,l,u){const h=(d=s,Math.PI*d/180);var d;let f=[],p=0,g=0,m=0,y=0;if(u)[p,g,m,y]=u;else{[t,e]=Dx(t,e,-h),[r,n]=Dx(r,n,-h);const F=(t-r)/2,A=(e-n)/2;let R=F*F/(i*i)+A*A/(a*a);R>1&&(R=Math.sqrt(R),i*=R,a*=R);const N=i*i,M=a*a,D=N*M-N*A*A-M*F*F,O=N*A*A+M*F*F,B=(o===l?-1:1)*Math.sqrt(Math.abs(D/O));m=B*i*A/a+(t+r)/2,y=B*-a*F/i+(e+n)/2,p=Math.asin(parseFloat(((e-y)/a).toFixed(9))),g=Math.asin(parseFloat(((n-y)/a).toFixed(9))),tg&&(p-=2*Math.PI),!l&&g>p&&(g-=2*Math.PI)}let v=g-p;if(Math.abs(v)>120*Math.PI/180){const F=g,A=r,R=n;g=l&&g>p?p+120*Math.PI/180*1:p+120*Math.PI/180*-1,f=LX(r=m+i*Math.cos(g),n=y+a*Math.sin(g),A,R,i,a,s,0,l,[g,F,m,y])}v=g-p;const x=Math.cos(p),b=Math.sin(p),w=Math.cos(g),C=Math.sin(g),_=Math.tan(v/4),k=4/3*i*_,S=4/3*a*_,L=[t,e],$=[t+k*b,e-S*x],I=[r+k*C,n-S*w],z=[r,n];if($[0]=2*L[0]-$[0],$[1]=2*L[1]-$[1],u)return[$,I,z].concat(f);{f=[$,I,z].concat(f);const F=[];for(let A=0;A2){const i=[];for(let a=0;a2*Math.PI&&(p=0,g=2*Math.PI);const m=2*Math.PI/l.curveStepCount,y=Math.min(m/2,(g-p)/2),v=FX(y,u,h,d,f,p,g,1,l);if(!l.disableMultiStroke){const x=FX(y,u,h,d,f,p,g,1.5,l);v.push(...x)}return s&&(o?v.push(...Lh(u,h,u+d*Math.cos(p),h+f*Math.sin(p),l),...Lh(u,h,u+d*Math.cos(g),h+f*Math.sin(g),l)):v.push({op:"lineTo",data:[u,h]},{op:"lineTo",data:[u+d*Math.cos(p),h+f*Math.sin(p)]})),{type:"path",ops:v}}function $X(t,e){const r=RX(AX(N8(t))),n=[];let i=[0,0],a=[0,0];for(const{key:s,data:o}of r)switch(s){case"M":a=[o[0],o[1]],i=[o[0],o[1]];break;case"L":n.push(...Lh(a[0],a[1],o[0],o[1],e)),a=[o[0],o[1]];break;case"C":{const[l,u,h,d,f,p]=o;n.push(...mIe(l,u,h,d,f,p,a,e)),a=[f,p];break}case"Z":n.push(...Lh(a[0],a[1],i[0],i[1],e)),a=[i[0],i[1]]}return{type:"path",ops:n}}function O8(t,e){const r=[];for(const n of t)if(n.length){const i=e.maxRandomnessOffset||0,a=n.length;if(a>2){r.push({op:"move",data:[n[0][0]+Ar(i,e),n[0][1]+Ar(i,e)]});for(let s=1;s500?.4:-.0016668*l+1.233334;let h=i.maxRandomnessOffset||0;h*h*100>o&&(h=l/10);const d=h/2,f=.2+.2*PX(i);let p=i.bowing*i.maxRandomnessOffset*(n-e)/200,g=i.bowing*i.maxRandomnessOffset*(t-r)/200;p=Ar(p,i,u),g=Ar(g,i,u);const m=[],y=()=>Ar(d,i,u),v=()=>Ar(h,i,u),x=i.preserveVertices;return s?m.push({op:"move",data:[t+(x?0:y()),e+(x?0:y())]}):m.push({op:"move",data:[t+(x?0:Ar(h,i,u)),e+(x?0:Ar(h,i,u))]}),s?m.push({op:"bcurveTo",data:[p+t+(r-t)*f+y(),g+e+(n-e)*f+y(),p+t+2*(r-t)*f+y(),g+e+2*(n-e)*f+y(),r+(x?0:y()),n+(x?0:y())]}):m.push({op:"bcurveTo",data:[p+t+(r-t)*f+v(),g+e+(n-e)*f+v(),p+t+2*(r-t)*f+v(),g+e+2*(n-e)*f+v(),r+(x?0:v()),n+(x?0:v())]}),m}function rE(t,e,r){if(!t.length)return[];const n=[];n.push([t[0][0]+Ar(e,r),t[0][1]+Ar(e,r)]),n.push([t[0][0]+Ar(e,r),t[0][1]+Ar(e,r)]);for(let i=1;i3){const a=[],s=1-r.curveTightness;i.push({op:"move",data:[t[1][0],t[1][1]]});for(let o=1;o+21&&i.push(o)):i.push(o),i.push(t[e+3])}else{const l=t[e+0],u=t[e+1],h=t[e+2],d=t[e+3],f=gf(l,u,.5),p=gf(u,h,.5),g=gf(h,d,.5),m=gf(f,p,.5),y=gf(p,g,.5),v=gf(m,y,.5);B8([l,f,m,v],0,r,i),B8([v,y,g,d],0,r,i)}var a,s;return i}function vIe(t,e){return aE(t,0,t.length,e)}function aE(t,e,r,n,i){const a=i||[],s=t[e],o=t[r-1];let l=0,u=1;for(let h=e+1;hl&&(l=d,u=h)}return Math.sqrt(l)>n?(aE(t,e,u+1,n,a),aE(t,u,r,n,a)):(a.length||a.push(s),a.push(o)),a}function F8(t,e=.15,r){const n=[],i=(t.length-1)/3;for(let a=0;a0?aE(n,0,n.length,r):n}const yo="none";let sE=class{constructor(e){this.defaultOptions={maxRandomnessOffset:2,roughness:1,bowing:1,stroke:"#000",strokeWidth:1,curveTightness:0,curveFitting:.95,curveStepCount:9,fillStyle:"hachure",fillWeight:-1,hachureAngle:-41,hachureGap:-1,dashOffset:-1,dashGap:-1,zigzagOffset:-1,seed:0,disableMultiStroke:!1,disableMultiStrokeFill:!1,preserveVertices:!1,fillShapeRoughnessGain:.8},this.config=e||{},this.config.options&&(this.defaultOptions=this._o(this.config.options))}static newSeed(){return Math.floor(Math.random()*2**31)}_o(e){return e?Object.assign({},this.defaultOptions,e):this.defaultOptions}_d(e,r,n){return{shape:e,sets:r||[],options:n||this.defaultOptions}}line(e,r,n,i,a){const s=this._o(a);return this._d("line",[IX(e,r,n,i,s)],s)}rectangle(e,r,n,i,a){const s=this._o(a),o=[],l=gIe(e,r,n,i,s);if(s.fill){const u=[[e,r],[e+n,r],[e+n,r+i],[e,r+i]];s.fillStyle==="solid"?o.push(O8([u],s)):o.push(og([u],s))}return s.stroke!==yo&&o.push(l),this._d("rectangle",o,s)}ellipse(e,r,n,i,a){const s=this._o(a),o=[],l=MX(n,i,s),u=$8(e,r,s,l);if(s.fill)if(s.fillStyle==="solid"){const h=$8(e,r,s,l).opset;h.type="fillPath",o.push(h)}else o.push(og([u.estimatedPoints],s));return s.stroke!==yo&&o.push(u.opset),this._d("ellipse",o,s)}circle(e,r,n,i){const a=this.ellipse(e,r,n,n,i);return a.shape="circle",a}linearPath(e,r){const n=this._o(r);return this._d("linearPath",[eE(e,!1,n)],n)}arc(e,r,n,i,a,s,o=!1,l){const u=this._o(l),h=[],d=NX(e,r,n,i,a,s,o,!0,u);if(o&&u.fill)if(u.fillStyle==="solid"){const f=Object.assign({},u);f.disableMultiStroke=!0;const p=NX(e,r,n,i,a,s,!0,!1,f);p.type="fillPath",h.push(p)}else h.push((function(f,p,g,m,y,v,x){const b=f,w=p;let C=Math.abs(g/2),_=Math.abs(m/2);C+=Ar(.01*C,x),_+=Ar(.01*_,x);let k=y,S=v;for(;k<0;)k+=2*Math.PI,S+=2*Math.PI;S-k>2*Math.PI&&(k=0,S=2*Math.PI);const L=(S-k)/x.curveStepCount,$=[];for(let I=k;I<=S;I+=L)$.push([b+C*Math.cos(I),w+_*Math.sin(I)]);return $.push([b+C*Math.cos(S),w+_*Math.sin(S)]),$.push([b,w]),og([$],x)})(e,r,n,i,a,s,u));return u.stroke!==yo&&h.push(d),this._d("arc",h,u)}curve(e,r){const n=this._o(r),i=[],a=DX(e,n);if(n.fill&&n.fill!==yo)if(n.fillStyle==="solid"){const s=DX(e,Object.assign(Object.assign({},n),{disableMultiStroke:!0,roughness:n.roughness?n.roughness+n.fillShapeRoughnessGain:0}));i.push({type:"fillPath",ops:this._mergedShape(s.ops)})}else{const s=[],o=e;if(o.length){const l=typeof o[0][0]=="number"?[o]:o;for(const u of l)u.length<3?s.push(...u):u.length===3?s.push(...F8(zX([u[0],u[0],u[1],u[2]]),10,(1+n.roughness)/2)):s.push(...F8(zX(u),10,(1+n.roughness)/2))}s.length&&i.push(og([s],n))}return n.stroke!==yo&&i.push(a),this._d("curve",i,n)}polygon(e,r){const n=this._o(r),i=[],a=eE(e,!0,n);return n.fill&&(n.fillStyle==="solid"?i.push(O8([e],n)):i.push(og([e],n))),n.stroke!==yo&&i.push(a),this._d("polygon",i,n)}path(e,r){const n=this._o(r),i=[];if(!e)return this._d("path",i,n);e=(e||"").replace(/\n/g," ").replace(/(-\s)/g,"-").replace("/(ss)/g"," ");const a=n.fill&&n.fill!=="transparent"&&n.fill!==yo,s=n.stroke!==yo,o=!!(n.simplification&&n.simplification<1),l=(function(h,d,f){const p=RX(AX(N8(h))),g=[];let m=[],y=[0,0],v=[];const x=()=>{v.length>=4&&m.push(...F8(v,d)),v=[]},b=()=>{x(),m.length&&(g.push(m),m=[])};for(const{key:C,data:_}of p)switch(C){case"M":b(),y=[_[0],_[1]],m.push(y);break;case"L":x(),m.push([_[0],_[1]]);break;case"C":if(!v.length){const k=m.length?m[m.length-1]:y;v.push([k[0],k[1]])}v.push([_[0],_[1]]),v.push([_[2],_[3]]),v.push([_[4],_[5]]);break;case"Z":x(),m.push([y[0],y[1]])}if(b(),!f)return g;const w=[];for(const C of g){const _=vIe(C,f);_.length&&w.push(_)}return w})(e,1,o?4-4*(n.simplification||1):(1+n.roughness)/2),u=$X(e,n);if(a)if(n.fillStyle==="solid")if(l.length===1){const h=$X(e,Object.assign(Object.assign({},n),{disableMultiStroke:!0,roughness:n.roughness?n.roughness+n.fillShapeRoughnessGain:0}));i.push({type:"fillPath",ops:this._mergedShape(h.ops)})}else i.push(O8(l,n));else i.push(og(l,n));return s&&(o?l.forEach((h=>{i.push(eE(h,!1,n))})):i.push(u)),this._d("path",i,n)}opsToPath(e,r){let n="";for(const i of e.ops){const a=typeof r=="number"&&r>=0?i.data.map((s=>+s.toFixed(r))):i.data;switch(i.op){case"move":n+=`M${a[0]} ${a[1]} `;break;case"bcurveTo":n+=`C${a[0]} ${a[1]}, ${a[2]} ${a[3]}, ${a[4]} ${a[5]} `;break;case"lineTo":n+=`L${a[0]} ${a[1]} `}}return n.trim()}toPaths(e){const r=e.sets||[],n=e.options||this.defaultOptions,i=[];for(const a of r){let s=null;switch(a.type){case"path":s={d:this.opsToPath(a),stroke:n.stroke,strokeWidth:n.strokeWidth,fill:yo};break;case"fillPath":s={d:this.opsToPath(a),stroke:yo,strokeWidth:0,fill:n.fill||yo};break;case"fillSketch":s=this.fillSketch(a,n)}s&&i.push(s)}return i}fillSketch(e,r){let n=r.fillWeight;return n<0&&(n=r.strokeWidth/2),{d:this.opsToPath(e),stroke:r.fill||yo,strokeWidth:n,fill:yo}}_mergedShape(e){return e.filter(((r,n)=>n===0||r.op!=="move"))}},bIe=class{constructor(e,r){this.canvas=e,this.ctx=this.canvas.getContext("2d"),this.gen=new sE(r)}draw(e){const r=e.sets||[],n=e.options||this.getDefaultOptions(),i=this.ctx,a=e.options.fixedDecimalPlaceDigits;for(const s of r)switch(s.type){case"path":i.save(),i.strokeStyle=n.stroke==="none"?"transparent":n.stroke,i.lineWidth=n.strokeWidth,n.strokeLineDash&&i.setLineDash(n.strokeLineDash),n.strokeLineDashOffset&&(i.lineDashOffset=n.strokeLineDashOffset),this._drawToContext(i,s,a),i.restore();break;case"fillPath":{i.save(),i.fillStyle=n.fill||"";const o=e.shape==="curve"||e.shape==="polygon"||e.shape==="path"?"evenodd":"nonzero";this._drawToContext(i,s,a,o),i.restore();break}case"fillSketch":this.fillSketch(i,s,n)}}fillSketch(e,r,n){let i=n.fillWeight;i<0&&(i=n.strokeWidth/2),e.save(),n.fillLineDash&&e.setLineDash(n.fillLineDash),n.fillLineDashOffset&&(e.lineDashOffset=n.fillLineDashOffset),e.strokeStyle=n.fill||"",e.lineWidth=i,this._drawToContext(e,r,n.fixedDecimalPlaceDigits),e.restore()}_drawToContext(e,r,n,i="nonzero"){e.beginPath();for(const a of r.ops){const s=typeof n=="number"&&n>=0?a.data.map((o=>+o.toFixed(n))):a.data;switch(a.op){case"move":e.moveTo(s[0],s[1]);break;case"bcurveTo":e.bezierCurveTo(s[0],s[1],s[2],s[3],s[4],s[5]);break;case"lineTo":e.lineTo(s[0],s[1])}}r.type==="fillPath"?e.fill(i):e.stroke()}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}line(e,r,n,i,a){const s=this.gen.line(e,r,n,i,a);return this.draw(s),s}rectangle(e,r,n,i,a){const s=this.gen.rectangle(e,r,n,i,a);return this.draw(s),s}ellipse(e,r,n,i,a){const s=this.gen.ellipse(e,r,n,i,a);return this.draw(s),s}circle(e,r,n,i){const a=this.gen.circle(e,r,n,i);return this.draw(a),a}linearPath(e,r){const n=this.gen.linearPath(e,r);return this.draw(n),n}polygon(e,r){const n=this.gen.polygon(e,r);return this.draw(n),n}arc(e,r,n,i,a,s,o=!1,l){const u=this.gen.arc(e,r,n,i,a,s,o,l);return this.draw(u),u}curve(e,r){const n=this.gen.curve(e,r);return this.draw(n),n}path(e,r){const n=this.gen.path(e,r);return this.draw(n),n}};const oE="http://www.w3.org/2000/svg";let xIe=class{constructor(e,r){this.svg=e,this.gen=new sE(r)}draw(e){const r=e.sets||[],n=e.options||this.getDefaultOptions(),i=this.svg.ownerDocument||window.document,a=i.createElementNS(oE,"g"),s=e.options.fixedDecimalPlaceDigits;for(const o of r){let l=null;switch(o.type){case"path":l=i.createElementNS(oE,"path"),l.setAttribute("d",this.opsToPath(o,s)),l.setAttribute("stroke",n.stroke),l.setAttribute("stroke-width",n.strokeWidth+""),l.setAttribute("fill","none"),n.strokeLineDash&&l.setAttribute("stroke-dasharray",n.strokeLineDash.join(" ").trim()),n.strokeLineDashOffset&&l.setAttribute("stroke-dashoffset",`${n.strokeLineDashOffset}`);break;case"fillPath":l=i.createElementNS(oE,"path"),l.setAttribute("d",this.opsToPath(o,s)),l.setAttribute("stroke","none"),l.setAttribute("stroke-width","0"),l.setAttribute("fill",n.fill||""),e.shape!=="curve"&&e.shape!=="polygon"||l.setAttribute("fill-rule","evenodd");break;case"fillSketch":l=this.fillSketch(i,o,n)}l&&a.appendChild(l)}return a}fillSketch(e,r,n){let i=n.fillWeight;i<0&&(i=n.strokeWidth/2);const a=e.createElementNS(oE,"path");return a.setAttribute("d",this.opsToPath(r,n.fixedDecimalPlaceDigits)),a.setAttribute("stroke",n.fill||""),a.setAttribute("stroke-width",i+""),a.setAttribute("fill","none"),n.fillLineDash&&a.setAttribute("stroke-dasharray",n.fillLineDash.join(" ").trim()),n.fillLineDashOffset&&a.setAttribute("stroke-dashoffset",`${n.fillLineDashOffset}`),a}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}opsToPath(e,r){return this.gen.opsToPath(e,r)}line(e,r,n,i,a){const s=this.gen.line(e,r,n,i,a);return this.draw(s)}rectangle(e,r,n,i,a){const s=this.gen.rectangle(e,r,n,i,a);return this.draw(s)}ellipse(e,r,n,i,a){const s=this.gen.ellipse(e,r,n,i,a);return this.draw(s)}circle(e,r,n,i){const a=this.gen.circle(e,r,n,i);return this.draw(a)}linearPath(e,r){const n=this.gen.linearPath(e,r);return this.draw(n)}polygon(e,r){const n=this.gen.polygon(e,r);return this.draw(n)}arc(e,r,n,i,a,s,o=!1,l){const u=this.gen.arc(e,r,n,i,a,s,o,l);return this.draw(u)}curve(e,r){const n=this.gen.curve(e,r);return this.draw(n)}path(e,r){const n=this.gen.path(e,r);return this.draw(n)}};var er={canvas:(t,e)=>new bIe(t,e),svg:(t,e)=>new xIe(t,e),generator:t=>new sE(t),newSeed:()=>sE.newSeed()},Sr=T(async(t,e,r)=>{var p,g;let n;const i=e.useHtmlLabels||eu((p=Pe())==null?void 0:p.htmlLabels);r?n=r:n="node default";const a=t.insert("g").attr("class",n).attr("id",e.domId||e.id),s=a.insert("g").attr("class","label").attr("style",xa(e.labelStyle));let o;e.label===void 0?o="":o=typeof e.label=="string"?e.label:e.label[0];const l=!!e.icon||!!e.img,u=e.labelType==="markdown",h=await ys(s,Zr(uu(o),Pe()),{useHtmlLabels:i,width:e.width||((g=Pe().flowchart)==null?void 0:g.wrappingWidth),classes:u?"markdown-node-label":"",style:e.labelStyle,addSvgBackground:l,markdown:u},Pe());let d=h.getBBox();const f=((e==null?void 0:e.padding)??0)/2;if(i){const m=h.children[0],y=gt(h);await f8(m,o),d=m.getBoundingClientRect(),y.attr("width",d.width),y.attr("height",d.height)}return i?s.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"):s.attr("transform","translate(0, "+-d.height/2+")"),e.centerLabel&&s.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"),s.insert("rect",":first-child"),{shapeSvg:a,bbox:d,halfPadding:f,label:s}},"labelHelper"),z8=T(async(t,e,r)=>{var l,u;const n=r.useHtmlLabels??mn(Pe()),i=t.insert("g").attr("class","label").attr("style",r.labelStyle||""),a=await ys(i,Zr(uu(e),Pe()),{useHtmlLabels:n,width:r.width||((u=(l=Pe())==null?void 0:l.flowchart)==null?void 0:u.wrappingWidth),style:r.labelStyle,addSvgBackground:!!r.icon||!!r.img});let s=a.getBBox();const o=r.padding/2;if(mn(Pe())){const h=a.children[0],d=gt(a);s=h.getBoundingClientRect(),d.attr("width",s.width),d.attr("height",s.height)}return n?i.attr("transform","translate("+-s.width/2+", "+-s.height/2+")"):i.attr("transform","translate(0, "+-s.height/2+")"),r.centerLabel&&i.attr("transform","translate("+-s.width/2+", "+-s.height/2+")"),i.insert("rect",":first-child"),{shapeSvg:t,bbox:s,halfPadding:o,label:i}},"insertLabel"),or=T((t,e)=>{const r=e.node().getBBox();t.width=r.width,t.height=r.height},"updateNodeBounds"),Tr=T((t,e)=>(t.look==="handDrawn"?"rough-node":"node")+" "+t.cssClasses+" "+(e||""),"getNodeClasses");function Jr(t){const e=t.map((r,n)=>`${n===0?"M":"L"}${r.x},${r.y}`);return e.push("Z"),e.join(" ")}T(Jr,"createPathFromPoints");function Ih(t,e,r,n,i,a){const s=[],l=r-t,u=n-e,h=l/a,d=2*Math.PI/h,f=e+u/2;for(let p=0;p<=50;p++){const g=p/50,m=t+g*l,y=f+i*Math.sin(d*(m-t));s.push({x:m,y})}return s}T(Ih,"generateFullSineWavePoints");function Nx(t,e,r,n,i,a){const s=[],o=i*Math.PI/180,h=(a*Math.PI/180-o)/(n-1);for(let d=0;dl.tagName==="path"),r=document.createElementNS("http://www.w3.org/2000/svg","path"),n=e.map(l=>l.getAttribute("d")).filter(l=>l!==null).join(" ");r.setAttribute("d",n);const i=e.find(l=>l.getAttribute("fill")!=="none"),a=e.find(l=>l.getAttribute("stroke")!=="none"),s=T((l,u)=>(l==null?void 0:l.getAttribute(u))??void 0,"getAttr");if(i){const l={fill:s(i,"fill"),"fill-opacity":s(i,"fill-opacity")??"1"};Object.entries(l).forEach(([u,h])=>{h&&r.setAttribute(u,h)})}if(a){const l={stroke:s(a,"stroke"),"stroke-width":s(a,"stroke-width")??"1","stroke-opacity":s(a,"stroke-opacity")??"1"};Object.entries(l).forEach(([u,h])=>{h&&r.setAttribute(u,h)})}const o=document.createElementNS("http://www.w3.org/2000/svg","g");return o.appendChild(r),o}T(G8,"mergePaths");var TIe=T((t,e)=>{var r=t.x,n=t.y,i=e.x-r,a=e.y-n,s=t.width/2,o=t.height/2,l,u;return Math.abs(a)*s>Math.abs(i)*o?(a<0&&(o=-o),l=a===0?0:o*i/a,u=o):(i<0&&(s=-s),l=s,u=i===0?0:s*a/i),{x:r+l,y:n+u}},"intersectRect"),lg=TIe,wIe=T(async(t,e,r,n=!1,i=!1)=>{let a=e||"";typeof a=="object"&&(a=a[0]);const s=Pe(),o=mn(s);return await ys(t,a,{style:r,isTitle:n,useHtmlLabels:o,markdown:!1,isNode:i,width:Number.POSITIVE_INFINITY},s)},"createLabel"),Dh=wIe,Mh=T((t,e,r,n,i)=>["M",t+i,e,"H",t+r-i,"A",i,i,0,0,1,t+r,e+i,"V",e+n-i,"A",i,i,0,0,1,t+r-i,e+n,"H",t+i,"A",i,i,0,0,1,t,e+n-i,"V",e+i,"A",i,i,0,0,1,t+i,e,"Z"].join(" "),"createRoundedRectPathD"),GX=T(async(t,e)=>{se.info("Creating subgraph rect for ",e.id,e);const r=Pe(),{themeVariables:n,handDrawnSeed:i}=r,{clusterBkg:a,clusterBorder:s}=n,{labelStyles:o,nodeStyles:l,borderStyles:u,backgroundStyles:h}=Jt(e),d=t.insert("g").attr("class","cluster "+e.cssClasses).attr("id",e.domId).attr("data-look",e.look),f=mn(r),p=d.insert("g").attr("class","cluster-label ");let g;e.labelType==="markdown"?g=await ys(p,e.label,{style:e.labelStyle,useHtmlLabels:f,isNode:!0,width:e.width}):g=await Dh(p,e.label,e.labelStyle||"",!1,!0);let m=g.getBBox();if(mn(r)){const k=g.children[0],S=gt(g);m=k.getBoundingClientRect(),S.attr("width",m.width),S.attr("height",m.height)}const y=e.width<=m.width+e.padding?m.width+e.padding:e.width;e.width<=m.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;se.trace("Data ",e,JSON.stringify(e));let w;if(e.look==="handDrawn"){const k=er.svg(d),S=nr(e,{roughness:.7,fill:a,stroke:s,fillWeight:3,seed:i}),L=k.path(Mh(x,b,y,v,0),S);w=d.insert(()=>(se.debug("Rough node insert CXC",L),L),":first-child"),w.select("path:nth-child(2)").attr("style",u.join(";")),w.select("path").attr("style",h.join(";").replace("fill","stroke"))}else w=d.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:C}=Ex(r);if(p.attr("transform",`translate(${e.x-m.width/2}, ${e.y-e.height/2+C})`),o){const k=p.select("span");k&&k.attr("style",o)}const _=w.node().getBBox();return e.offsetX=0,e.width=_.width,e.height=_.height,e.offsetY=m.height-e.padding/2,e.intersect=function(k){return lg(e,k)},{cluster:d,labelBBox:m}},"rect"),CIe=T((t,e)=>{const r=t.insert("g").attr("class","note-cluster").attr("id",e.domId),n=r.insert("rect",":first-child"),i=0*e.padding,a=i/2;n.attr("rx",e.rx).attr("ry",e.ry).attr("x",e.x-e.width/2-a).attr("y",e.y-e.height/2-a).attr("width",e.width+i).attr("height",e.height+i).attr("fill","none");const s=n.node().getBBox();return e.width=s.width,e.height=s.height,e.intersect=function(o){return lg(e,o)},{cluster:r,labelBBox:{width:0,height:0}}},"noteGroup"),kIe=T(async(t,e)=>{const r=Pe(),{themeVariables:n,handDrawnSeed:i}=r,{altBackground:a,compositeBackground:s,compositeTitleBackground:o,nodeBorder:l}=n,u=t.insert("g").attr("class",e.cssClasses).attr("id",e.domId).attr("data-id",e.id).attr("data-look",e.look),h=u.insert("g",":first-child"),d=u.insert("g").attr("class","cluster-label");let f=u.append("rect");const p=await Dh(d,e.label,e.labelStyle,void 0,!0);let g=p.getBBox();if(mn(r)){const L=p.children[0],$=gt(p);g=L.getBoundingClientRect(),$.attr("width",g.width),$.attr("height",g.height)}const m=0*e.padding,y=m/2,v=(e.width<=g.width+e.padding?g.width+e.padding:e.width)+m;e.width<=g.width+e.padding?e.diff=(v-e.width)/2-e.padding:e.diff=-e.padding;const x=e.height+m,b=e.height+m-g.height-6,w=e.x-v/2,C=e.y-x/2;e.width=v;const _=e.y-e.height/2-y+g.height+2;let k;if(e.look==="handDrawn"){const L=e.cssClasses.includes("statediagram-cluster-alt"),$=er.svg(u),I=e.rx||e.ry?$.path(Mh(w,C,v,x,10),{roughness:.7,fill:o,fillStyle:"solid",stroke:l,seed:i}):$.rectangle(w,C,v,x,{seed:i});k=u.insert(()=>I,":first-child");const z=$.rectangle(w,_,v,b,{fill:L?a:s,fillStyle:L?"hachure":"solid",stroke:l,seed:i});k=u.insert(()=>I,":first-child"),f=u.insert(()=>z)}else k=h.insert("rect",":first-child"),k.attr("class","outer").attr("x",w).attr("y",C).attr("width",v).attr("height",x).attr("data-look",e.look),f.attr("class","inner").attr("x",w).attr("y",_).attr("width",v).attr("height",b);d.attr("transform",`translate(${e.x-g.width/2}, ${C+1-(mn(r)?0:3)})`);const S=k.node().getBBox();return e.height=S.height,e.offsetX=0,e.offsetY=g.height-e.padding/2,e.labelBBox=g,e.intersect=function(L){return lg(e,L)},{cluster:u,labelBBox:g}},"roundedWithTitle"),EIe=T(async(t,e)=>{se.info("Creating subgraph rect for ",e.id,e);const r=Pe(),{themeVariables:n,handDrawnSeed:i}=r,{clusterBkg:a,clusterBorder:s}=n,{labelStyles:o,nodeStyles:l,borderStyles:u,backgroundStyles:h}=Jt(e),d=t.insert("g").attr("class","cluster "+e.cssClasses).attr("id",e.domId).attr("data-look",e.look),f=mn(r),p=d.insert("g").attr("class","cluster-label "),g=await ys(p,e.label,{style:e.labelStyle,useHtmlLabels:f,isNode:!0,width:e.width});let m=g.getBBox();if(mn(r)){const k=g.children[0],S=gt(g);m=k.getBoundingClientRect(),S.attr("width",m.width),S.attr("height",m.height)}const y=e.width<=m.width+e.padding?m.width+e.padding:e.width;e.width<=m.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;se.trace("Data ",e,JSON.stringify(e));let w;if(e.look==="handDrawn"){const k=er.svg(d),S=nr(e,{roughness:.7,fill:a,stroke:s,fillWeight:4,seed:i}),L=k.path(Mh(x,b,y,v,e.rx),S);w=d.insert(()=>(se.debug("Rough node insert CXC",L),L),":first-child"),w.select("path:nth-child(2)").attr("style",u.join(";")),w.select("path").attr("style",h.join(";").replace("fill","stroke"))}else w=d.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:C}=Ex(r);if(p.attr("transform",`translate(${e.x-m.width/2}, ${e.y-e.height/2+C})`),o){const k=p.select("span");k&&k.attr("style",o)}const _=w.node().getBBox();return e.offsetX=0,e.width=_.width,e.height=_.height,e.offsetY=m.height-e.padding/2,e.intersect=function(k){return lg(e,k)},{cluster:d,labelBBox:m}},"kanbanSection"),SIe=T((t,e)=>{const r=Pe(),{themeVariables:n,handDrawnSeed:i}=r,{nodeBorder:a}=n,s=t.insert("g").attr("class",e.cssClasses).attr("id",e.domId).attr("data-look",e.look),o=s.insert("g",":first-child"),l=0*e.padding,u=e.width+l;e.diff=-e.padding;const h=e.height+l,d=e.x-u/2,f=e.y-h/2;e.width=u;let p;if(e.look==="handDrawn"){const y=er.svg(s).rectangle(d,f,u,h,{fill:"lightgrey",roughness:.5,strokeLineDash:[5],stroke:a,seed:i});p=s.insert(()=>y,":first-child")}else{p=o.insert("rect",":first-child");let m="outer";e.look,m="divider",p.attr("class",m).attr("x",d).attr("y",f).attr("width",u).attr("height",h).attr("data-look",e.look)}const g=p.node().getBBox();return e.height=g.height,e.offsetX=0,e.offsetY=0,e.intersect=function(m){return lg(e,m)},{cluster:s,labelBBox:{}}},"divider"),_Ie=GX,AIe={rect:GX,squareRect:_Ie,roundedWithTitle:kIe,noteGroup:CIe,divider:SIe,kanbanSection:EIe},qX=new Map,q8=T(async(t,e)=>{const r=e.shape||"rect",n=await AIe[r](t,e);return qX.set(e.id,n),n},"insertCluster"),RIe=T(()=>{qX=new Map},"clear");function VX(t,e){return t.intersect(e)}T(VX,"intersectNode");var LIe=VX;function WX(t,e,r,n){var i=t.x,a=t.y,s=i-n.x,o=a-n.y,l=Math.sqrt(e*e*o*o+r*r*s*s),u=Math.abs(e*r*s/l);n.x0}T(V8,"sameSign");var DIe=YX;function XX(t,e,r){let n=t.x,i=t.y,a=[],s=Number.POSITIVE_INFINITY,o=Number.POSITIVE_INFINITY;typeof e.forEach=="function"?e.forEach(function(h){s=Math.min(s,h.x),o=Math.min(o,h.y)}):(s=Math.min(s,e.x),o=Math.min(o,e.y));let l=n-t.width/2-s,u=i-t.height/2-o;for(let h=0;h1&&a.sort(function(h,d){let f=h.x-r.x,p=h.y-r.y,g=Math.sqrt(f*f+p*p),m=d.x-r.x,y=d.y-r.y,v=Math.sqrt(m*m+y*y);return gh,":first-child");return d.attr("class","anchor").attr("style",xa(o)),or(e,d),e.intersect=function(f){return se.info("Circle intersect",e,s,f),Zt.circle(e,s,f)},a}T(jX,"anchor");function W8(t,e,r,n,i,a,s){const l=(t+r)/2,u=(e+n)/2,h=Math.atan2(n-e,r-t),d=(r-t)/2,f=(n-e)/2,p=d/i,g=f/a,m=Math.sqrt(p**2+g**2);if(m>1)throw new Error("The given radii are too small to create an arc between the points.");const y=Math.sqrt(1-m**2),v=l+y*a*Math.sin(h)*(s?-1:1),x=u-y*i*Math.cos(h)*(s?-1:1),b=Math.atan2((e-x)/a,(t-v)/i);let C=Math.atan2((n-x)/a,(r-v)/i)-b;s&&C<0&&(C+=2*Math.PI),!s&&C>0&&(C-=2*Math.PI);const _=[];for(let k=0;k<20;k++){const S=k/19,L=b+S*C,$=v+i*Math.cos(L),I=x+a*Math.sin(L);_.push({x:$,y:I})}return _}T(W8,"generateArcPoints");function KX(t,e,r){const[n,i]=[e,r].sort((a,s)=>s-a);return i*(1-Math.sqrt(1-(t/n/2)**2))}T(KX,"calculateArcSagitta");async function ZX(t,e){const{labelStyles:r,nodeStyles:n}=Jt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,s=e.look==="neo"?12:i,o=T(L=>L+s,"calcTotalHeight"),l=T(L=>{const $=L/2;return[$/(2.5+L/50),$]},"calcEllipseRadius"),{shapeSvg:u,bbox:h}=await Sr(t,e,Tr(e)),d=o(e!=null&&e.height?e==null?void 0:e.height:h.height),[f,p]=l(d),g=KX(d,f,p),y=(e!=null&&e.width?e==null?void 0:e.width:h.width)+a*2+g-g,v=d,{cssStyles:x}=e,b=[{x:y/2,y:-v/2},{x:-y/2,y:-v/2},...W8(-y/2,-v/2,-y/2,v/2,f,p,!1),{x:y/2,y:v/2},...W8(y/2,v/2,y/2,-v/2,f,p,!0)],w=er.svg(u),C=nr(e,{});e.look!=="handDrawn"&&(C.roughness=0,C.fillStyle="solid");const _=Jr(b),k=w.path(_,C),S=u.insert(()=>k,":first-child");return S.attr("class","basic label-container outer-path"),x&&e.look!=="handDrawn"&&S.selectAll("path").attr("style",x),n&&e.look!=="handDrawn"&&S.selectAll("path").attr("style",n),S.attr("transform",`translate(${f/2}, 0)`),or(e,S),e.intersect=function(L){return Zt.polygon(e,b,L)},u}T(ZX,"bowTieRect");function hu(t,e,r,n){return t.insert("polygon",":first-child").attr("points",n.map(function(i){return i.x+","+i.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-e/2+","+r/2+")")}T(hu,"insertPolygonShape");var lE=12;async function QX(t,e){const{labelStyles:r,nodeStyles:n}=Jt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?28:i,s=e.look==="neo"?24:i,{shapeSvg:o,bbox:l}=await Sr(t,e,Tr(e)),u=((e==null?void 0:e.width)??l.width)+(e.look==="neo"?a*2:a+lE),h=((e==null?void 0:e.height)??l.height)+(e.look==="neo"?s*2:s),d=0,f=u,p=-h,g=0,m=[{x:d+lE,y:p},{x:f,y:p},{x:f,y:g},{x:d,y:g},{x:d,y:p+lE},{x:d+lE,y:p}];let y;const{cssStyles:v}=e;if(e.look==="handDrawn"){const x=er.svg(o),b=nr(e,{}),w=Jr(m),C=x.path(w,b);y=o.insert(()=>C,":first-child").attr("transform",`translate(${-u/2}, ${h/2})`),v&&y.attr("style",v)}else y=hu(o,u,h,m);return n&&y.attr("style",n),or(e,y),e.intersect=function(x){return Zt.polygon(e,m,x)},o}T(QX,"card");function JX(t,e){const{nodeStyles:r}=Jt(e);e.label="";const n=t.insert("g").attr("class",Tr(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=er.svg(n),l=nr(e,{});e.look!=="handDrawn"&&(l.roughness=0,l.fillStyle="solid");const u=Jr(s),h=o.path(u,l),d=n.insert(()=>h,":first-child");return i&&e.look!=="handDrawn"&&d.selectAll("path").attr("style",i),r&&e.look!=="handDrawn"&&d.selectAll("path").attr("style",r),e.width=28,e.height=28,e.intersect=function(f){return Zt.polygon(e,s,f)},n}T(JX,"choice");async function U8(t,e,r){const{labelStyles:n,nodeStyles:i}=Jt(e);e.labelStyle=n;const{shapeSvg:a,bbox:s,halfPadding:o}=await Sr(t,e,Tr(e)),l=16,u=(r==null?void 0:r.padding)??o,h=e.look==="neo"?s.width/2+l*2:s.width/2+u;let d;const{cssStyles:f}=e;if(e.look==="handDrawn"){const p=er.svg(a),g=nr(e,{}),m=p.circle(0,0,h*2,g);d=a.insert(()=>m,":first-child"),d.attr("class","basic label-container").attr("style",xa(f))}else d=a.insert("circle",":first-child").attr("class","basic label-container").attr("style",i).attr("r",h).attr("cx",0).attr("cy",0);return or(e,d),e.calcIntersect=function(p,g){const m=p.width/2;return Zt.circle(p,m,g)},e.intersect=function(p){return se.info("Circle intersect",e,h,p),Zt.circle(e,h,p)},a}T(U8,"circle");function ej(t){const e=Math.cos(Math.PI/4),r=Math.sin(Math.PI/4),n=t*2,i={x:n/2*e,y:n/2*r},a={x:-(n/2)*e,y:n/2*r},s={x:-(n/2)*e,y:-(n/2)*r},o={x:n/2*e,y:-(n/2)*r};return`M ${a.x},${a.y} L ${o.x},${o.y} + M ${i.x},${i.y} L ${s.x},${s.y}`}T(ej,"createLine");function tj(t,e){const{labelStyles:r,nodeStyles:n}=Jt(e);e.labelStyle=r,e.label="";const i=t.insert("g").attr("class",Tr(e)).attr("id",e.domId??e.id),a=Math.max(30,(e==null?void 0:e.width)??0),{cssStyles:s}=e,o=er.svg(i),l=nr(e,{});e.look!=="handDrawn"&&(l.roughness=0,l.fillStyle="solid");const u=o.circle(0,0,a*2,l),h=ej(a),d=o.path(h,l),f=i.insert(()=>u,":first-child");return f.insert(()=>d),f.attr("class","outer-path"),s&&e.look!=="handDrawn"&&f.selectAll("path").attr("style",s),n&&e.look!=="handDrawn"&&f.selectAll("path").attr("style",n),or(e,f),e.intersect=function(p){return se.info("crossedCircle intersect",e,{radius:a,point:p}),Zt.circle(e,a,p)},i}T(tj,"crossedCircle");function du(t,e,r,n=100,i=0,a=180){const s=[],o=i*Math.PI/180,h=(a*Math.PI/180-o)/(n-1);for(let d=0;dC,":first-child").attr("stroke-opacity",0),_.insert(()=>b,":first-child"),_.attr("class","text"),f&&e.look!=="handDrawn"&&_.selectAll("path").attr("style",f),n&&e.look!=="handDrawn"&&_.selectAll("path").attr("style",n),_.attr("transform",`translate(${d}, 0)`),s.attr("transform",`translate(${-u/2+d-(a.x-(a.left??0))},${-h/2+(e.padding??0)/2-(a.y-(a.top??0))})`),or(e,_),e.intersect=function(k){return Zt.polygon(e,g,k)},i}T(rj,"curlyBraceLeft");function fu(t,e,r,n=100,i=0,a=180){const s=[],o=i*Math.PI/180,h=(a*Math.PI/180-o)/(n-1);for(let d=0;dC,":first-child").attr("stroke-opacity",0),_.insert(()=>b,":first-child"),_.attr("class","text"),f&&e.look!=="handDrawn"&&_.selectAll("path").attr("style",f),n&&e.look!=="handDrawn"&&_.selectAll("path").attr("style",n),_.attr("transform",`translate(${-d}, 0)`),s.attr("transform",`translate(${-u/2+(e.padding??0)/2-(a.x-(a.left??0))},${-h/2+(e.padding??0)/2-(a.y-(a.top??0))})`),or(e,_),e.intersect=function(k){return Zt.polygon(e,g,k)},i}T(nj,"curlyBraceRight");function Da(t,e,r,n=100,i=0,a=180){const s=[],o=i*Math.PI/180,h=(a*Math.PI/180-o)/(n-1);for(let d=0;dL,":first-child").attr("stroke-opacity",0),$.insert(()=>w,":first-child"),$.insert(()=>k,":first-child"),$.attr("class","text"),f&&e.look!=="handDrawn"&&$.selectAll("path").attr("style",f),n&&e.look!=="handDrawn"&&$.selectAll("path").attr("style",n),$.attr("transform",`translate(${d-d/4}, 0)`),s.attr("transform",`translate(${-u/2+(e.padding??0)/2-(a.x-(a.left??0))},${-h/2+(e.padding??0)/2-(a.y-(a.top??0))})`),or(e,$),e.intersect=function(I){return Zt.polygon(e,m,I)},i}T(ij,"curlyBraces");async function aj(t,e){const{labelStyles:r,nodeStyles:n}=Jt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,s=e.look==="neo"?12:i,o=20,l=5,{shapeSvg:u,bbox:h}=await Sr(t,e,Tr(e)),d=Math.max(o,(h.width+a*2)*1.25,(e==null?void 0:e.width)??0),f=Math.max(l,h.height+s*2,(e==null?void 0:e.height)??0),p=f/2,{cssStyles:g}=e,m=er.svg(u),y=nr(e,{});e.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const v=d,x=f,b=v-p,w=x/4,C=[{x:b,y:0},{x:w,y:0},{x:0,y:x/2},{x:w,y:x},{x:b,y:x},...Nx(-b,-x/2,p,50,270,90)],_=Jr(C),k=m.path(_,y),S=u.insert(()=>k,":first-child");return S.attr("class","basic label-container outer-path"),g&&e.look!=="handDrawn"&&S.selectChildren("path").attr("style",g),n&&e.look!=="handDrawn"&&S.selectChildren("path").attr("style",n),S.attr("transform",`translate(${-d/2}, ${-f/2})`),or(e,S),e.intersect=function(L){return Zt.polygon(e,C,L)},u}T(aj,"curvedTrapezoid");var NIe=T((t,e,r,n,i,a)=>[`M${t},${e+a}`,`a${i},${a} 0,0,0 ${r},0`,`a${i},${a} 0,0,0 ${-r},0`,`l0,${n}`,`a${i},${a} 0,0,0 ${r},0`,`l0,${-n}`].join(" "),"createCylinderPathD"),$Ie=T((t,e,r,n,i,a)=>[`M${t},${e+a}`,`M${t+r},${e+a}`,`a${i},${a} 0,0,0 ${-r},0`,`l0,${n}`,`a${i},${a} 0,0,0 ${r},0`,`l0,${-n}`].join(" "),"createOuterCylinderPathD"),OIe=T((t,e,r,n,i,a)=>[`M${t-r/2},${-n/2}`,`a${i},${a} 0,0,0 ${r},0`].join(" "),"createInnerCylinderPathD"),sj=8,oj=8;async function lj(t,e){const{labelStyles:r,nodeStyles:n}=Jt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?24:i,s=e.look==="neo"?24:i;if(e.width||e.height){const y=e.width??0;e.width=(e.width??0)-s,e.widthC,":first-child"),g=o.insert(()=>w,":first-child"),g.attr("class","basic label-container"),m&&g.attr("style",m)}else{const y=NIe(0,0,h,p,d,f);g=o.insert("path",":first-child").attr("d",y).attr("class","basic label-container outer-path").attr("style",xa(m)).attr("style",n)}return g.attr("label-offset-y",f),g.attr("transform",`translate(${-h/2}, ${-(p/2+f)})`),or(e,g),u.attr("transform",`translate(${-(l.width/2)-(l.x-(l.left??0))}, ${-(l.height/2)+(e.padding??0)/1.5-(l.y-(l.top??0))})`),e.intersect=function(y){const v=Zt.rect(e,y),x=v.x-(e.x??0);if(d!=0&&(Math.abs(x)<(e.width??0)/2||Math.abs(x)==(e.width??0)/2&&Math.abs(v.y-(e.y??0))>(e.height??0)/2-f)){let b=f*f*(1-x*x/(d*d));b>0&&(b=Math.sqrt(b)),b=f-b,y.y-(e.y??0)>0&&(b=-b),v.y+=b}return v},o}T(lj,"cylinder");async function cg(t,e,r){const{labelStyles:n,nodeStyles:i}=Jt(e);e.labelStyle=n;const{shapeSvg:a,bbox:s}=await Sr(t,e,Tr(e)),o=Math.max(s.width+r.labelPaddingX*2,(e==null?void 0:e.width)||0),l=Math.max(s.height+r.labelPaddingY*2,(e==null?void 0:e.height)||0),u=-o/2,h=-l/2;let d,{rx:f,ry:p}=e;const{cssStyles:g}=e;if(r!=null&&r.rx&&r.ry&&(f=r.rx,p=r.ry),e.look==="handDrawn"){const m=er.svg(a),y=nr(e,{}),v=f||p?m.path(Mh(u,h,o,l,f||0),y):m.rectangle(u,h,o,l,y);d=a.insert(()=>v,":first-child"),d.attr("class","basic label-container").attr("style",xa(g))}else d=a.insert("rect",":first-child"),d.attr("class","basic label-container").attr("style",i).attr("rx",xa(f)).attr("ry",xa(p)).attr("x",u).attr("y",h).attr("width",o).attr("height",l);return or(e,d),e.calcIntersect=function(m,y){return Zt.rect(m,y)},e.intersect=function(m){return Zt.rect(e,m)},a}T(cg,"drawRect");async function cj(t,e){const{cssClasses:r,labelPaddingX:n,labelPaddingY:i,padding:a,width:s,height:o}=e,l={rx:0,ry:0,labelPaddingX:n??(a??0)*2,labelPaddingY:i??a??0},u=await cg(t,e,l);if(e.look==="handDrawn"){const p=er.svg(u),g=nr(e,{}),m=u.select(".basic.label-container > path:nth-child(2)"),y=m.node();if(!y)return u;let v=null;if(y instanceof SVGGraphicsElement)v=y.getBBox();else return u;return u.insert(()=>p.line(v.x,v.y,v.x+v.width,v.y,g),".basic.label-container g.label"),u.insert(()=>p.line(v.x,v.y+v.height,v.x+v.width,v.y+v.height,g),".basic.label-container g.label"),m.remove(),u}const h=u.select(".basic.label-container"),d=(Number(h.attr("width"))||s)??0,f=(Number(h.attr("height"))||o)??0;return d>0&&f>0&&h.attr("stroke-dasharray",`${d} ${f}`),u}T(cj,"datastore");async function uj(t,e){const{labelStyles:r,nodeStyles:n}=Jt(e);e.labelStyle=r;const i=e.look==="neo"?16:e.padding??0,a=e.look==="neo"?16:e.padding??0,{shapeSvg:s,bbox:o,label:l}=await Sr(t,e,Tr(e)),u=o.width+i,h=o.height+a,d=h*.2,f=-u/2,p=-h/2-d/2,{cssStyles:g}=e,m=er.svg(s),y=nr(e,{});e.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const v=[{x:f,y:p+d},{x:-f,y:p+d},{x:-f,y:-p},{x:f,y:-p},{x:f,y:p},{x:-f,y:p},{x:-f,y:p+d}],x=m.polygon(v.map(w=>[w.x,w.y]),y),b=s.insert(()=>x,":first-child");return b.attr("class","basic label-container outer-path"),g&&e.look!=="handDrawn"&&b.selectAll("path").attr("style",g),n&&e.look!=="handDrawn"&&b.selectAll("path").attr("style",n),l.attr("transform",`translate(${f+(e.padding??0)/2-(o.x-(o.left??0))}, ${p+d+(e.padding??0)/2-(o.y-(o.top??0))})`),or(e,b),e.intersect=function(w){return Zt.rect(e,w)},s}T(uj,"dividedRectangle");async function hj(t,e){var p,g;const{labelStyles:r,nodeStyles:n}=Jt(e),i=e.look==="neo"?12:5;e.labelStyle=r;const a=e.padding??0,s=e.look==="neo"?16:a,{shapeSvg:o,bbox:l}=await Sr(t,e,Tr(e)),u=(e!=null&&e.width?(e==null?void 0:e.width)/2:l.width/2)+(s??0),h=u-i;let d;const{cssStyles:f}=e;if(e.look==="handDrawn"){const m=er.svg(o),y=nr(e,{roughness:.2,strokeWidth:2.5}),v=nr(e,{roughness:.2,strokeWidth:1.5}),x=m.circle(0,0,u*2,y),b=m.circle(0,0,h*2,v);d=o.insert("g",":first-child"),d.attr("class",xa(e.cssClasses)).attr("style",xa(f)),(p=d.node())==null||p.appendChild(x),(g=d.node())==null||g.appendChild(b)}else{d=o.insert("g",":first-child");const m=d.insert("circle",":first-child"),y=d.insert("circle");d.attr("class","basic label-container").attr("style",n),m.attr("class","outer-circle").attr("style",n).attr("r",u).attr("cx",0).attr("cy",0),y.attr("class","inner-circle").attr("style",n).attr("r",h).attr("cx",0).attr("cy",0)}return or(e,d),e.intersect=function(m){return se.info("DoubleCircle intersect",e,u,m),Zt.circle(e,u,m)},o}T(hj,"doublecircle");function dj(t,e,{config:{themeVariables:r}}){const{labelStyles:n,nodeStyles:i}=Jt(e);e.label="",e.labelStyle=n;const a=t.insert("g").attr("class",Tr(e)).attr("id",e.domId??e.id),s=7,{cssStyles:o}=e,l=er.svg(a),{nodeBorder:u}=r,h=nr(e,{fillStyle:"solid"});e.look!=="handDrawn"&&(h.roughness=0);const d=l.circle(0,0,s*2,h),f=a.insert(()=>d,":first-child");return f.selectAll("path").attr("style",`fill: ${u} !important;`),o&&o.length>0&&e.look!=="handDrawn"&&f.selectAll("path").attr("style",o),i&&e.look!=="handDrawn"&&f.selectAll("path").attr("style",i),or(e,f),e.intersect=function(p){return se.info("filledCircle intersect",e,{radius:s,point:p}),Zt.circle(e,s,p)},a}T(dj,"filledCircle");var fj=10,pj=10;async function gj(t,e){const{labelStyles:r,nodeStyles:n}=Jt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?i*2:i;(e.width||e.height)&&(e.height=(e==null?void 0:e.height)??0,e.heightv,":first-child").attr("transform",`translate(${-h/2}, ${h/2})`).attr("class","outer-path");return p&&e.look!=="handDrawn"&&x.selectChildren("path").attr("style",p),n&&e.look!=="handDrawn"&&x.selectChildren("path").attr("style",n),e.width=u,e.height=h,or(e,x),l.attr("transform",`translate(${-o.width/2-(o.x-(o.left??0))}, ${-h/2+(e.padding??0)/2+(o.y-(o.top??0))})`),e.intersect=function(b){return se.info("Triangle intersect",e,f,b),Zt.polygon(e,f,b)},s}T(gj,"flippedTriangle");function mj(t,e,{dir:r,config:{state:n,themeVariables:i}}){const{nodeStyles:a}=Jt(e);e.label="";const s=t.insert("g").attr("class",Tr(e)).attr("id",e.domId??e.id),{cssStyles:o}=e;let l=Math.max(70,(e==null?void 0:e.width)??0),u=Math.max(10,(e==null?void 0:e.height)??0);r==="LR"&&(l=Math.max(10,(e==null?void 0:e.width)??0),u=Math.max(70,(e==null?void 0:e.height)??0));const h=-1*l/2,d=-1*u/2,f=er.svg(s),p=nr(e,{stroke:i.lineColor,fill:i.lineColor});e.look!=="handDrawn"&&(p.roughness=0,p.fillStyle="solid");const g=f.rectangle(h,d,l,u,p),m=s.insert(()=>g,":first-child");o&&e.look!=="handDrawn"&&m.selectAll("path").attr("style",o),a&&e.look!=="handDrawn"&&m.selectAll("path").attr("style",a),or(e,m);const y=(n==null?void 0:n.padding)??0;return e.width&&e.height&&(e.width+=y/2||0,e.height+=y/2||0),e.intersect=function(v){return Zt.rect(e,v)},s}T(mj,"forkJoin");async function yj(t,e){const{labelStyles:r,nodeStyles:n}=Jt(e);e.labelStyle=r;const i=15,a=10,s=e.look==="neo"?16:e.padding??0,o=e.look==="neo"?12:e.padding??0;(e.width||e.height)&&(e.height=((e==null?void 0:e.height)??0)-o*2,e.heightx,":first-child");return b.attr("class","basic label-container outer-path"),p&&e.look!=="handDrawn"&&b.selectChildren("path").attr("style",p),n&&e.look!=="handDrawn"&&b.selectChildren("path").attr("style",n),or(e,b),e.intersect=function(w){return se.info("Pill intersect",e,{radius:f,point:w}),Zt.polygon(e,y,w)},l}T(yj,"halfRoundedRectangle");var PIe=T((t,e,r,n,i)=>[`M${t+i},${e}`,`L${t+r-i},${e}`,`L${t+r},${e-n/2}`,`L${t+r-i},${e-n}`,`L${t+i},${e-n}`,`L${t},${e-n/2}`,"Z"].join(" "),"createHexagonPathD");async function vj(t,e){const{labelStyles:r,nodeStyles:n}=Jt(e),i=e.look==="neo"?3.5:4;e.labelStyle=r;const a=e.padding??0,s=70,o=32,l=e.look==="neo"?s:a,u=e.look==="neo"?o:a;if(e.width||e.height){const b=(e.height??0)/i;e.width=((e==null?void 0:e.width)??0)-2*b-u,e.height=(e.height??0)-l}const{shapeSvg:h,bbox:d}=await Sr(t,e,Tr(e)),f=(e!=null&&e.height?e==null?void 0:e.height:d.height)+l,p=f/i,g=(e!=null&&e.width?e==null?void 0:e.width:d.width)+2*p+u,m=[{x:p,y:0},{x:g-p,y:0},{x:g,y:-f/2},{x:g-p,y:-f},{x:p,y:-f},{x:0,y:-f/2}];let y;const{cssStyles:v}=e;if(e.look==="handDrawn"){const x=er.svg(h),b=nr(e,{}),w=PIe(0,0,g,f,p),C=x.path(w,b);y=h.insert(()=>C,":first-child").attr("transform",`translate(${-g/2}, ${f/2})`),v&&y.attr("style",v)}else y=hu(h,g,f,m);return n&&y.attr("style",n),e.width=g,e.height=f,or(e,y),e.intersect=function(x){return Zt.polygon(e,m,x)},h}T(vj,"hexagon");async function bj(t,e){const{labelStyles:r,nodeStyles:n}=Jt(e);e.label="",e.labelStyle=r;const{shapeSvg:i}=await Sr(t,e,Tr(e)),a=Math.max(30,(e==null?void 0:e.width)??0),s=Math.max(30,(e==null?void 0:e.height)??0),{cssStyles:o}=e,l=er.svg(i),u=nr(e,{});e.look!=="handDrawn"&&(u.roughness=0,u.fillStyle="solid");const h=[{x:0,y:0},{x:a,y:0},{x:0,y:s},{x:a,y:s}],d=Jr(h),f=l.path(d,u),p=i.insert(()=>f,":first-child");return p.attr("class","basic label-container outer-path"),o&&e.look!=="handDrawn"&&p.selectChildren("path").attr("style",o),n&&e.look!=="handDrawn"&&p.selectChildren("path").attr("style",n),p.attr("transform",`translate(${-a/2}, ${-s/2})`),or(e,p),e.intersect=function(g){return se.info("Pill intersect",e,{points:h}),Zt.polygon(e,h,g)},i}T(bj,"hourglass");async function xj(t,e,{config:{themeVariables:r,flowchart:n}}){const{labelStyles:i}=Jt(e);e.labelStyle=i;const a=e.assetHeight??48,s=e.assetWidth??48,o=Math.max(a,s),l=n==null?void 0:n.wrappingWidth;e.width=Math.max(o,l??0);const{shapeSvg:u,bbox:h,label:d}=await Sr(t,e,"icon-shape default"),f=e.pos==="t",p=o,g=o,{nodeBorder:m}=r,{stylesMap:y}=sg(e),v=-g/2,x=-p/2,b=e.label?8:0,w=er.svg(u),C=nr(e,{stroke:"none",fill:"none"});e.look!=="handDrawn"&&(C.roughness=0,C.fillStyle="solid");const _=w.rectangle(v,x,g,p,C),k=Math.max(g,h.width),S=p+h.height+b,L=w.rectangle(-k/2,-S/2,k,S,{...C,fill:"transparent",stroke:"none"}),$=u.insert(()=>_,":first-child"),I=u.insert(()=>L);if(e.icon){const z=u.append("g");z.html(`${await Rh(e.icon,{height:o,width:o,fallbackPrefix:""})}`);const F=z.node().getBBox(),A=F.width,R=F.height,N=F.x,M=F.y;z.attr("transform",`translate(${-A/2-N},${f?h.height/2+b/2-R/2-M:-h.height/2-b/2-R/2-M})`),z.attr("style",`color: ${y.get("stroke")??m};`)}return d.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${f?-S/2:S/2-h.height})`),$.attr("transform",`translate(0,${f?h.height/2+b/2:-h.height/2-b/2})`),or(e,I),e.intersect=function(z){if(se.info("iconSquare intersect",e,z),!e.label)return Zt.rect(e,z);const F=e.x??0,A=e.y??0,R=e.height??0;let N=[];return f?N=[{x:F-h.width/2,y:A-R/2},{x:F+h.width/2,y:A-R/2},{x:F+h.width/2,y:A-R/2+h.height+b},{x:F+g/2,y:A-R/2+h.height+b},{x:F+g/2,y:A+R/2},{x:F-g/2,y:A+R/2},{x:F-g/2,y:A-R/2+h.height+b},{x:F-h.width/2,y:A-R/2+h.height+b}]:N=[{x:F-g/2,y:A-R/2},{x:F+g/2,y:A-R/2},{x:F+g/2,y:A-R/2+p},{x:F+h.width/2,y:A-R/2+p},{x:F+h.width/2/2,y:A+R/2},{x:F-h.width/2,y:A+R/2},{x:F-h.width/2,y:A-R/2+p},{x:F-g/2,y:A-R/2+p}],Zt.polygon(e,N,z)},u}T(xj,"icon");async function Tj(t,e,{config:{themeVariables:r,flowchart:n}}){const{labelStyles:i}=Jt(e);e.labelStyle=i;const a=e.assetHeight??48,s=e.assetWidth??48,o=Math.max(a,s),l=n==null?void 0:n.wrappingWidth;e.width=Math.max(o,l??0);const{shapeSvg:u,bbox:h,label:d}=await Sr(t,e,"icon-shape default"),f=20,p=e.label?8:0,g=e.pos==="t",{nodeBorder:m,mainBkg:y}=r,{stylesMap:v}=sg(e),x=er.svg(u),b=nr(e,{});e.look!=="handDrawn"&&(b.roughness=0,b.fillStyle="solid");const w=v.get("fill");b.stroke=w??y;const C=u.append("g");e.icon&&C.html(`${await Rh(e.icon,{height:o,width:o,fallbackPrefix:""})}`);const _=C.node().getBBox(),k=_.width,S=_.height,L=_.x,$=_.y,I=Math.max(k,S)*Math.SQRT2+f*2,z=x.circle(0,0,I,b),F=Math.max(I,h.width),A=I+h.height+p,R=x.rectangle(-F/2,-A/2,F,A,{...b,fill:"transparent",stroke:"none"}),N=u.insert(()=>z,":first-child"),M=u.insert(()=>R);return C.attr("transform",`translate(${-k/2-L},${g?h.height/2+p/2-S/2-$:-h.height/2-p/2-S/2-$})`),C.attr("style",`color: ${v.get("stroke")??m};`),d.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${g?-A/2:A/2-h.height})`),N.attr("transform",`translate(0,${g?h.height/2+p/2:-h.height/2-p/2})`),or(e,M),e.intersect=function(D){return se.info("iconSquare intersect",e,D),Zt.rect(e,D)},u}T(Tj,"iconCircle");async function wj(t,e,{config:{themeVariables:r,flowchart:n}}){const{labelStyles:i}=Jt(e);e.labelStyle=i;const a=e.assetHeight??48,s=e.assetWidth??48,o=Math.max(a,s),l=n==null?void 0:n.wrappingWidth;e.width=Math.max(o,l??0);const{shapeSvg:u,bbox:h,halfPadding:d,label:f}=await Sr(t,e,"icon-shape default"),p=e.pos==="t",g=o+d*2,m=o+d*2,{nodeBorder:y,mainBkg:v}=r,{stylesMap:x}=sg(e),b=-m/2,w=-g/2,C=e.label?8:0,_=er.svg(u),k=nr(e,{});e.look!=="handDrawn"&&(k.roughness=0,k.fillStyle="solid");const S=x.get("fill");k.stroke=S??v;const L=_.path(Mh(b,w,m,g,5),k),$=Math.max(m,h.width),I=g+h.height+C,z=_.rectangle(-$/2,-I/2,$,I,{...k,fill:"transparent",stroke:"none"}),F=u.insert(()=>L,":first-child").attr("class","icon-shape2"),A=u.insert(()=>z);if(e.icon){const R=u.append("g");R.html(`${await Rh(e.icon,{height:o,width:o,fallbackPrefix:""})}`);const N=R.node().getBBox(),M=N.width,D=N.height,O=N.x,B=N.y;R.attr("transform",`translate(${-M/2-O},${p?h.height/2+C/2-D/2-B:-h.height/2-C/2-D/2-B})`),R.attr("style",`color: ${x.get("stroke")??y};`)}return f.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${p?-I/2:I/2-h.height})`),F.attr("transform",`translate(0,${p?h.height/2+C/2:-h.height/2-C/2})`),or(e,A),e.intersect=function(R){if(se.info("iconSquare intersect",e,R),!e.label)return Zt.rect(e,R);const N=e.x??0,M=e.y??0,D=e.height??0;let O=[];return p?O=[{x:N-h.width/2,y:M-D/2},{x:N+h.width/2,y:M-D/2},{x:N+h.width/2,y:M-D/2+h.height+C},{x:N+m/2,y:M-D/2+h.height+C},{x:N+m/2,y:M+D/2},{x:N-m/2,y:M+D/2},{x:N-m/2,y:M-D/2+h.height+C},{x:N-h.width/2,y:M-D/2+h.height+C}]:O=[{x:N-m/2,y:M-D/2},{x:N+m/2,y:M-D/2},{x:N+m/2,y:M-D/2+g},{x:N+h.width/2,y:M-D/2+g},{x:N+h.width/2/2,y:M+D/2},{x:N-h.width/2,y:M+D/2},{x:N-h.width/2,y:M-D/2+g},{x:N-m/2,y:M-D/2+g}],Zt.polygon(e,O,R)},u}T(wj,"iconRounded");async function Cj(t,e,{config:{themeVariables:r,flowchart:n}}){const{labelStyles:i}=Jt(e);e.labelStyle=i;const a=e.assetHeight??48,s=e.assetWidth??48,o=Math.max(a,s),l=n==null?void 0:n.wrappingWidth;e.width=Math.max(o,l??0);const{shapeSvg:u,bbox:h,halfPadding:d,label:f}=await Sr(t,e,"icon-shape default"),p=e.pos==="t",g=o+d*2,m=o+d*2,{nodeBorder:y,mainBkg:v}=r,{stylesMap:x}=sg(e),b=-m/2,w=-g/2,C=e.label?8:0,_=er.svg(u),k=nr(e,{});e.look!=="handDrawn"&&(k.roughness=0,k.fillStyle="solid");const S=x.get("fill");k.stroke=S??v;const L=_.path(Mh(b,w,m,g,.1),k),$=Math.max(m,h.width),I=g+h.height+C,z=_.rectangle(-$/2,-I/2,$,I,{...k,fill:"transparent",stroke:"none"}),F=u.insert(()=>L,":first-child"),A=u.insert(()=>z);if(e.icon){const R=u.append("g");R.html(`${await Rh(e.icon,{height:o,width:o,fallbackPrefix:""})}`);const N=R.node().getBBox(),M=N.width,D=N.height,O=N.x,B=N.y;R.attr("transform",`translate(${-M/2-O},${p?h.height/2+C/2-D/2-B:-h.height/2-C/2-D/2-B})`),R.attr("style",`color: ${x.get("stroke")??y};`)}return f.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${p?-I/2:I/2-h.height})`),F.attr("transform",`translate(0,${p?h.height/2+C/2:-h.height/2-C/2})`),or(e,A),e.intersect=function(R){if(se.info("iconSquare intersect",e,R),!e.label)return Zt.rect(e,R);const N=e.x??0,M=e.y??0,D=e.height??0;let O=[];return p?O=[{x:N-h.width/2,y:M-D/2},{x:N+h.width/2,y:M-D/2},{x:N+h.width/2,y:M-D/2+h.height+C},{x:N+m/2,y:M-D/2+h.height+C},{x:N+m/2,y:M+D/2},{x:N-m/2,y:M+D/2},{x:N-m/2,y:M-D/2+h.height+C},{x:N-h.width/2,y:M-D/2+h.height+C}]:O=[{x:N-m/2,y:M-D/2},{x:N+m/2,y:M-D/2},{x:N+m/2,y:M-D/2+g},{x:N+h.width/2,y:M-D/2+g},{x:N+h.width/2/2,y:M+D/2},{x:N-h.width/2,y:M+D/2},{x:N-h.width/2,y:M-D/2+g},{x:N-m/2,y:M-D/2+g}],Zt.polygon(e,O,R)},u}T(Cj,"iconSquare");async function kj(t,e,{config:{flowchart:r}}){const n=new Image;n.src=(e==null?void 0:e.img)??"",await n.decode();const i=Number(n.naturalWidth.toString().replace("px","")),a=Number(n.naturalHeight.toString().replace("px",""));e.imageAspectRatio=i/a;const{labelStyles:s}=Jt(e);e.labelStyle=s;const o=r==null?void 0:r.wrappingWidth;e.defaultWidth=r==null?void 0:r.wrappingWidth;const l=Math.max(e.label?o??0:0,(e==null?void 0:e.assetWidth)??i),u=e.constraint==="on"&&e!=null&&e.assetHeight?e.assetHeight*e.imageAspectRatio:l,h=e.constraint==="on"?u/e.imageAspectRatio:(e==null?void 0:e.assetHeight)??a;e.width=Math.max(u,o??0);const{shapeSvg:d,bbox:f,label:p}=await Sr(t,e,"image-shape default"),g=e.pos==="t",m=-u/2,y=-h/2,v=e.label?8:0,x=er.svg(d),b=nr(e,{});e.look!=="handDrawn"&&(b.roughness=0,b.fillStyle="solid");const w=x.rectangle(m,y,u,h,b),C=Math.max(u,f.width),_=h+f.height+v,k=x.rectangle(-C/2,-_/2,C,_,{...b,fill:"none",stroke:"none"}),S=d.insert(()=>w,":first-child"),L=d.insert(()=>k);if(e.img){const $=d.append("image");$.attr("href",e.img),$.attr("width",u),$.attr("height",h),$.attr("preserveAspectRatio","none"),$.attr("transform",`translate(${-u/2},${g?_/2-h:-_/2})`)}return p.attr("transform",`translate(${-f.width/2-(f.x-(f.left??0))},${g?-h/2-f.height/2-v/2:h/2-f.height/2+v/2})`),S.attr("transform",`translate(0,${g?f.height/2+v/2:-f.height/2-v/2})`),or(e,L),e.intersect=function($){if(se.info("iconSquare intersect",e,$),!e.label)return Zt.rect(e,$);const I=e.x??0,z=e.y??0,F=e.height??0;let A=[];return g?A=[{x:I-f.width/2,y:z-F/2},{x:I+f.width/2,y:z-F/2},{x:I+f.width/2,y:z-F/2+f.height+v},{x:I+u/2,y:z-F/2+f.height+v},{x:I+u/2,y:z+F/2},{x:I-u/2,y:z+F/2},{x:I-u/2,y:z-F/2+f.height+v},{x:I-f.width/2,y:z-F/2+f.height+v}]:A=[{x:I-u/2,y:z-F/2},{x:I+u/2,y:z-F/2},{x:I+u/2,y:z-F/2+h},{x:I+f.width/2,y:z-F/2+h},{x:I+f.width/2/2,y:z+F/2},{x:I-f.width/2,y:z+F/2},{x:I-f.width/2,y:z-F/2+h},{x:I-u/2,y:z-F/2+h}],Zt.polygon(e,A,$)},d}T(kj,"imageSquare");async function Ej(t,e){const{labelStyles:r,nodeStyles:n}=Jt(e);e.labelStyle=r;const i=e.padding??0,a=i,s=e.look==="neo"?i*2:i,{shapeSvg:o,bbox:l}=await Sr(t,e,Tr(e)),u=Math.max(l.width+(s??0)*2,(e==null?void 0:e.width)??0),h=Math.max(l.height+(a??0)*2,(e==null?void 0:e.height)??0),d=[{x:0,y:0},{x:u,y:0},{x:u+3*h/6,y:-h},{x:-3*h/6,y:-h}];let f;const{cssStyles:p}=e;if(e.look==="handDrawn"){const g=er.svg(o),m=nr(e,{}),y=Jr(d),v=g.path(y,m);f=o.insert(()=>v,":first-child").attr("transform",`translate(${-u/2}, ${h/2})`),p&&f.attr("style",p)}else f=hu(o,u,h,d);return n&&f.attr("style",n),e.width=u,e.height=h,or(e,f),e.intersect=function(g){return Zt.polygon(e,d,g)},o}T(Ej,"inv_trapezoid");async function Sj(t,e){const{shapeSvg:r,bbox:n,label:i}=await Sr(t,e,"label"),a=r.insert("rect",":first-child");return a.attr("width",.1).attr("height",.1),r.attr("class","label edgeLabel"),i.attr("transform",`translate(${-(n.width/2)-(n.x-(n.left??0))}, ${-(n.height/2)-(n.y-(n.top??0))})`),or(e,a),e.intersect=function(l){return Zt.rect(e,l)},r}T(Sj,"labelRect");async function _j(t,e){const{labelStyles:r,nodeStyles:n}=Jt(e);e.labelStyle=r;const i=e.padding??0,a=i,s=e.look==="neo"?i*2:i,{shapeSvg:o,bbox:l}=await Sr(t,e,Tr(e)),u=((e==null?void 0:e.height)??l.height)+a,h=((e==null?void 0:e.width)??l.width)+s,d=[{x:0,y:0},{x:h+3*u/6,y:0},{x:h,y:-u},{x:-(3*u)/6,y:-u}];let f;const{cssStyles:p}=e;if(e.look==="handDrawn"){const g=er.svg(o),m=nr(e,{}),y=Jr(d),v=g.path(y,m);f=o.insert(()=>v,":first-child").attr("transform",`translate(${-h/2}, ${u/2})`),p&&f.attr("style",p)}else f=hu(o,h,u,d);return n&&f.attr("style",n),e.width=h,e.height=u,or(e,f),e.intersect=function(g){return Zt.polygon(e,d,g)},o}T(_j,"lean_left");async function Aj(t,e){const{labelStyles:r,nodeStyles:n}=Jt(e);e.labelStyle=r;const i=e.padding??0,a=i,s=e.look==="neo"?i*2:i,{shapeSvg:o,bbox:l}=await Sr(t,e,Tr(e)),u=((e==null?void 0:e.height)??l.height)+a,h=((e==null?void 0:e.width)??l.width)+s,d=[{x:-3*u/6,y:0},{x:h,y:0},{x:h+3*u/6,y:-u},{x:0,y:-u}];let f;const{cssStyles:p}=e;if(e.look==="handDrawn"){const g=er.svg(o),m=nr(e,{}),y=Jr(d),v=g.path(y,m);f=o.insert(()=>v,":first-child").attr("transform",`translate(${-h/2}, ${u/2})`),p&&f.attr("style",p)}else f=hu(o,h,u,d);return n&&f.attr("style",n),e.width=h,e.height=u,or(e,f),e.intersect=function(g){return Zt.polygon(e,d,g)},o}T(Aj,"lean_right");function Rj(t,e){const{labelStyles:r,nodeStyles:n}=Jt(e);e.label="",e.labelStyle=r;const i=t.insert("g").attr("class",Tr(e)).attr("id",e.domId??e.id),{cssStyles:a}=e,s=Math.max(35,(e==null?void 0:e.width)??0),o=Math.max(35,(e==null?void 0:e.height)??0),l=7,u=[{x:s,y:0},{x:0,y:o+l/2},{x:s-2*l,y:o+l/2},{x:0,y:2*o},{x:s,y:o-l/2},{x:2*l,y:o-l/2}],h=er.svg(i),d=nr(e,{});e.look!=="handDrawn"&&(d.roughness=0,d.fillStyle="solid");const f=Jr(u),p=h.path(f,d),g=i.insert(()=>p,":first-child");return g.attr("class","outer-path"),a&&e.look!=="handDrawn"&&g.selectAll("path").attr("style",a),n&&e.look!=="handDrawn"&&g.selectAll("path").attr("style",n),g.attr("transform",`translate(-${s/2},${-o})`),or(e,g),e.intersect=function(m){return se.info("lightningBolt intersect",e,m),Zt.polygon(e,u,m)},i}T(Rj,"lightningBolt");var BIe=T((t,e,r,n,i,a,s)=>[`M${t},${e+a}`,`a${i},${a} 0,0,0 ${r},0`,`a${i},${a} 0,0,0 ${-r},0`,`l0,${n}`,`a${i},${a} 0,0,0 ${r},0`,`l0,${-n}`,`M${t},${e+a+s}`,`a${i},${a} 0,0,0 ${r},0`].join(" "),"createCylinderPathD"),FIe=T((t,e,r,n,i,a,s)=>[`M${t},${e+a}`,`M${t+r},${e+a}`,`a${i},${a} 0,0,0 ${-r},0`,`l0,${n}`,`a${i},${a} 0,0,0 ${r},0`,`l0,${-n}`,`M${t},${e+a+s}`,`a${i},${a} 0,0,0 ${r},0`].join(" "),"createOuterCylinderPathD"),zIe=T((t,e,r,n,i,a)=>[`M${t-r/2},${-n/2}`,`a${i},${a} 0,0,0 ${r},0`].join(" "),"createInnerCylinderPathD"),Lj=10,Ij=10;async function Dj(t,e){const{labelStyles:r,nodeStyles:n}=Jt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,s=e.look==="neo"?24:i;if(e.width||e.height){const v=e.width??0;e.width=(e.width??0)-a,e.width_,":first-child").attr("class","line"),m=o.insert(()=>C,":first-child"),m.attr("class","basic label-container"),y&&m.attr("style",y)}else{const v=BIe(0,0,h,p,d,f,g);m=o.insert("path",":first-child").attr("d",v).attr("class","basic label-container outer-path").attr("style",xa(y)).attr("style",n)}return m.attr("label-offset-y",f),m.attr("transform",`translate(${-h/2}, ${-(p/2+f)})`),or(e,m),u.attr("transform",`translate(${-(l.width/2)-(l.x-(l.left??0))}, ${-(l.height/2)+f-(l.y-(l.top??0))})`),e.intersect=function(v){const x=Zt.rect(e,v),b=x.x-(e.x??0);if(d!=0&&(Math.abs(b)<(e.width??0)/2||Math.abs(b)==(e.width??0)/2&&Math.abs(x.y-(e.y??0))>(e.height??0)/2-f)){let w=f*f*(1-b*b/(d*d));w>0&&(w=Math.sqrt(w)),w=f-w,v.y-(e.y??0)>0&&(w=-w),x.y+=w}return x},o}T(Dj,"linedCylinder");async function Mj(t,e){const{labelStyles:r,nodeStyles:n}=Jt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,s=e.look==="neo"?12:i;if(e.width||e.height){const w=e.width;e.width=(w??0)*10/11-a*2,e.width<10&&(e.width=10),e.height=((e==null?void 0:e.height)??0)-s*2,e.height<10&&(e.height=10)}const{shapeSvg:o,bbox:l,label:u}=await Sr(t,e,Tr(e)),h=(e!=null&&e.width?e==null?void 0:e.width:l.width)+(a??0)*2,d=(e!=null&&e.height?e==null?void 0:e.height:l.height)+(s??0)*2,f=e.look==="neo"?d/4:d/8,p=d+f,{cssStyles:g}=e,m=er.svg(o),y=nr(e,{});e.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const v=[{x:-h/2-h/2*.1,y:-p/2},{x:-h/2-h/2*.1,y:p/2},...Ih(-h/2-h/2*.1,p/2,h/2+h/2*.1,p/2,f,.8),{x:h/2+h/2*.1,y:-p/2},{x:-h/2-h/2*.1,y:-p/2},{x:-h/2,y:-p/2},{x:-h/2,y:p/2*1.1},{x:-h/2,y:-p/2}],x=m.polygon(v.map(w=>[w.x,w.y]),y),b=o.insert(()=>x,":first-child");return b.attr("class","basic label-container outer-path"),g&&e.look!=="handDrawn"&&b.selectAll("path").attr("style",g),n&&e.look!=="handDrawn"&&b.selectAll("path").attr("style",n),b.attr("transform",`translate(0,${-f/2})`),u.attr("transform",`translate(${-h/2+(e.padding??0)+h/2*.1/2-(l.x-(l.left??0))},${-d/2+(e.padding??0)-f/2-(l.y-(l.top??0))})`),or(e,b),e.intersect=function(w){return Zt.polygon(e,v,w)},o}T(Mj,"linedWaveEdgedRect");async function Nj(t,e){const{labelStyles:r,nodeStyles:n}=Jt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,s=e.look==="neo"?12:i,o=e.look==="neo"?10:5;(e.width||e.height)&&(e.width=Math.max(((e==null?void 0:e.width)??0)-a*2-2*o,10),e.height=Math.max(((e==null?void 0:e.height)??0)-s*2-2*o,10));const{shapeSvg:l,bbox:u,label:h}=await Sr(t,e,Tr(e)),d=(e!=null&&e.width?e==null?void 0:e.width:u.width)+a*2+2*o,f=(e!=null&&e.height?e==null?void 0:e.height:u.height)+s*2+2*o,p=d-2*o,g=f-2*o,m=-p/2,y=-g/2,{cssStyles:v}=e,x=er.svg(l),b=nr(e,{}),w=[{x:m-o,y:y+o},{x:m-o,y:y+g+o},{x:m+p-o,y:y+g+o},{x:m+p-o,y:y+g},{x:m+p,y:y+g},{x:m+p,y:y+g-o},{x:m+p+o,y:y+g-o},{x:m+p+o,y:y-o},{x:m+o,y:y-o},{x:m+o,y},{x:m,y},{x:m,y:y+o}],C=[{x:m,y:y+o},{x:m+p-o,y:y+o},{x:m+p-o,y:y+g},{x:m+p,y:y+g},{x:m+p,y},{x:m,y}];e.look!=="handDrawn"&&(b.roughness=0,b.fillStyle="solid");const _=Jr(w);let k=x.path(_,b);const S=Jr(C);let L=x.path(S,b);e.look!=="handDrawn"&&(k=G8(k),L=G8(L));const $=l.insert("g",":first-child");return $.insert(()=>k),$.insert(()=>L),$.attr("class","basic label-container outer-path"),v&&e.look!=="handDrawn"&&$.selectAll("path").attr("style",v),n&&e.look!=="handDrawn"&&$.selectAll("path").attr("style",n),h.attr("transform",`translate(${-(u.width/2)-o-(u.x-(u.left??0))}, ${-(u.height/2)+o-(u.y-(u.top??0))})`),or(e,$),e.intersect=function(I){return Zt.polygon(e,w,I)},l}T(Nj,"multiRect");async function $j(t,e){const{labelStyles:r,nodeStyles:n}=Jt(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,label:s}=await Sr(t,e,Tr(e)),o=e.padding??0,l=e.look==="neo"?16:o,u=e.look==="neo"?12:o;let h=!0;(e.width||e.height)&&(h=!1,e.width=((e==null?void 0:e.width)??0)-l*2,e.height=((e==null?void 0:e.height)??0)-u*3);const d=Math.max(a.width,(e==null?void 0:e.width)??0)+l*2,f=Math.max(a.height,(e==null?void 0:e.height)??0)+u*3,p=e.look==="neo"?f/4:f/8,g=f+(h?p/2:-p/2),m=-d/2,y=-g/2,v=10,{cssStyles:x}=e,b=Ih(m-v,y+g+v,m+d-v,y+g+v,p,.8),w=b==null?void 0:b[b.length-1],C=[{x:m-v,y:y+v},{x:m-v,y:y+g+v},...b,{x:m+d-v,y:w.y-v},{x:m+d,y:w.y-v},{x:m+d,y:w.y-2*v},{x:m+d+v,y:w.y-2*v},{x:m+d+v,y:y-v},{x:m+v,y:y-v},{x:m+v,y},{x:m,y},{x:m,y:y+v}],_=[{x:m,y:y+v},{x:m+d-v,y:y+v},{x:m+d-v,y:w.y-v},{x:m+d,y:w.y-v},{x:m+d,y},{x:m,y}],k=er.svg(i),S=nr(e,{});e.look!=="handDrawn"&&(S.roughness=0,S.fillStyle="solid");const L=Jr(C),$=k.path(L,S),I=Jr(_),z=k.path(I,S),F=i.insert(()=>$,":first-child");return F.insert(()=>z),F.attr("class","basic label-container outer-path"),x&&e.look!=="handDrawn"&&F.selectAll("path").attr("style",x),n&&e.look!=="handDrawn"&&F.selectAll("path").attr("style",n),F.attr("transform",`translate(0,${-p/2})`),s.attr("transform",`translate(${-(a.width/2)-v-(a.x-(a.left??0))}, ${-(a.height/2)+v-p/2-(a.y-(a.top??0))})`),or(e,F),e.intersect=function(A){return Zt.polygon(e,C,A)},i}T($j,"multiWaveEdgedRectangle");async function Oj(t,e,{config:{themeVariables:r}}){const{labelStyles:n,nodeStyles:i}=Jt(e);e.labelStyle=n,e.useHtmlLabels||mn(pr())||(e.centerLabel=!0);const{shapeSvg:s,bbox:o,label:l}=await Sr(t,e,Tr(e)),u=Math.max(o.width+(e.padding??0)*2,(e==null?void 0:e.width)??0),h=Math.max(o.height+(e.padding??0)*2,(e==null?void 0:e.height)??0),d=-u/2,f=-h/2,{cssStyles:p}=e,g=er.svg(s),m=nr(e,{fill:r.noteBkgColor,stroke:r.noteBorderColor});e.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=g.rectangle(d,f,u,h,m),v=s.insert(()=>y,":first-child");return v.attr("class","basic label-container outer-path"),l.attr("class","label noteLabel"),p&&e.look!=="handDrawn"&&v.selectAll("path").attr("style",p),i&&e.look!=="handDrawn"&&v.selectAll("path").attr("style",i),l.attr("transform",`translate(${-o.width/2-(o.x-(o.left??0))}, ${-(o.height/2)-(o.y-(o.top??0))})`),or(e,v),e.intersect=function(x){return Zt.rect(e,x)},s}T(Oj,"note");var GIe=T((t,e,r)=>[`M${t+r/2},${e}`,`L${t+r},${e-r/2}`,`L${t+r/2},${e-r}`,`L${t},${e-r/2}`,"Z"].join(" "),"createDecisionBoxPathD");async function Pj(t,e){const{labelStyles:r,nodeStyles:n}=Jt(e);e.labelStyle=r;const{shapeSvg:i,bbox:a}=await Sr(t,e,Tr(e)),s=a.width+(e.padding??0),o=a.height+(e.padding??0),l=s+o,u=.5,h=[{x:l/2,y:0},{x:l,y:-l/2},{x:l/2,y:-l},{x:0,y:-l/2}];let d;const{cssStyles:f}=e;if(e.look==="handDrawn"){const p=er.svg(i),g=nr(e,{}),m=GIe(0,0,l),y=p.path(m,g);d=i.insert(()=>y,":first-child").attr("transform",`translate(${-l/2+u}, ${l/2})`),f&&d.attr("style",f)}else d=hu(i,l,l,h),d.attr("transform",`translate(${-l/2+u}, ${l/2})`);return n&&d.attr("style",n),or(e,d),e.calcIntersect=function(p,g){const m=p.width,y=[{x:m/2,y:0},{x:m,y:-m/2},{x:m/2,y:-m},{x:0,y:-m/2}],v=Zt.polygon(p,y,g);return{x:v.x-.5,y:v.y-.5}},e.intersect=function(p){return this.calcIntersect(e,p)},i}T(Pj,"question");async function Bj(t,e){const{labelStyles:r,nodeStyles:n}=Jt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?21:i??0,s=e.look==="neo"?12:i??0,{shapeSvg:o,bbox:l,label:u}=await Sr(t,e,Tr(e)),h=((e==null?void 0:e.width)??l.width)+(e.look==="neo"?a*2:a),d=((e==null?void 0:e.height)??l.height)+(e.look==="neo"?s*2:s),f=-h/2,p=-d/2,g=p/2,m=[{x:f+g,y:p},{x:f,y:0},{x:f+g,y:-p},{x:-f,y:-p},{x:-f,y:p}],{cssStyles:y}=e,v=er.svg(o),x=nr(e,{});e.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");const b=Jr(m),w=v.path(b,x),C=o.insert(()=>w,":first-child");return C.attr("class","basic label-container outer-path"),y&&e.look!=="handDrawn"&&C.selectAll("path").attr("style",y),n&&e.look!=="handDrawn"&&C.selectAll("path").attr("style",n),C.attr("transform",`translate(${-g/2},0)`),u.attr("transform",`translate(${-g/2-l.width/2-(l.x-(l.left??0))}, ${-(l.height/2)-(l.y-(l.top??0))})`),or(e,C),e.intersect=function(_){return Zt.polygon(e,m,_)},o}T(Bj,"rect_left_inv_arrow");async function Fj(t,e){const{labelStyles:r,nodeStyles:n}=Jt(e);e.labelStyle=r;let i;e.cssClasses?i="node "+e.cssClasses:i="node default";const a=t.insert("g").attr("class",i).attr("id",e.domId||e.id),s=a.insert("g"),o=a.insert("g").attr("class","label").attr("style",n),l=e.description,u=e.label,h=await Dh(o,u,e.labelStyle,!0,!0);let d={width:0,height:0};if(mn(Pe())){const S=h.children[0],L=gt(h);d=S.getBoundingClientRect(),L.attr("width",d.width),L.attr("height",d.height)}se.info("Text 2",l);const f=l||[],p=h.getBBox(),g=await Dh(o,Array.isArray(f)?f.join("
    "):f,e.labelStyle,!0,!0),m=g.children[0],y=gt(g);d=m.getBoundingClientRect(),y.attr("width",d.width),y.attr("height",d.height);const v=(e.padding||0)/2;gt(g).attr("transform","translate( "+(d.width>p.width?0:(p.width-d.width)/2)+", "+(p.height+v+5)+")"),gt(h).attr("transform","translate( "+(d.width(se.debug("Rough node insert CXC",$),I),":first-child"),_=a.insert(()=>(se.debug("Rough node insert CXC",$),$),":first-child")}else _=s.insert("rect",":first-child"),k=s.insert("line"),_.attr("class","outer title-state").attr("style",n).attr("x",-d.width/2-v).attr("y",-d.height/2-v).attr("width",d.width+(e.padding||0)).attr("height",d.height+(e.padding||0)),k.attr("class","divider").attr("x1",-d.width/2-v).attr("x2",d.width/2+v).attr("y1",-d.height/2-v+p.height+v).attr("y2",-d.height/2-v+p.height+v);return or(e,_),e.intersect=function(S){return Zt.rect(e,S)},a}T(Fj,"rectWithTitle");async function zj(t,e,{config:{themeVariables:r}}){const n=(r==null?void 0:r.radius)??5,i={rx:n,ry:n,labelPaddingX:((e==null?void 0:e.padding)??0)*1,labelPaddingY:((e==null?void 0:e.padding)??0)*1};return cg(t,e,i)}T(zj,"roundedRect");var mf=8;async function Gj(t,e){const{labelStyles:r,nodeStyles:n}=Jt(e);e.labelStyle=r;const i=e.look==="neo"?16:e.padding??0,a=e.look==="neo"?12:e.padding??0,{shapeSvg:s,bbox:o,label:l}=await Sr(t,e,Tr(e)),u=((e==null?void 0:e.width)??o.width)+i*2+(e.look==="neo"?mf:mf*2),h=((e==null?void 0:e.height)??o.height)+a*2,d=u-mf,f=h,p=mf-u/2,g=-h/2,{cssStyles:m}=e,y=er.svg(s),v=nr(e,{});e.look!=="handDrawn"&&(v.roughness=0,v.fillStyle="solid");const x=[{x:p,y:g},{x:p+d,y:g},{x:p+d,y:g+f},{x:p-mf,y:g+f},{x:p-mf,y:g},{x:p,y:g},{x:p,y:g+f}],b=y.polygon(x.map(C=>[C.x,C.y]),v),w=s.insert(()=>b,":first-child");return w.attr("class","basic label-container outer-path").attr("style",xa(m)),n&&e.look!=="handDrawn"&&w.selectAll("path").attr("style",n),m&&e.look!=="handDrawn"&&w.selectAll("path").attr("style",n),l.attr("transform",`translate(${mf/2-o.width/2-(o.x-(o.left??0))}, ${-(o.height/2)-(o.y-(o.top??0))})`),or(e,w),e.intersect=function(C){return Zt.rect(e,C)},s}T(Gj,"shadedProcess");async function qj(t,e){const{labelStyles:r,nodeStyles:n}=Jt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,s=e.look==="neo"?12:i;(e.width||e.height)&&(e.width=Math.max(((e==null?void 0:e.width)??0)-a*2,10),e.height=Math.max(((e==null?void 0:e.height)??0)/1.5-s*2,10));const{shapeSvg:o,bbox:l,label:u}=await Sr(t,e,Tr(e)),h=(e!=null&&e.width?e==null?void 0:e.width:l.width)+a*2,d=((e!=null&&e.height?e==null?void 0:e.height:l.height)+s*2)*1.5,f=h,p=d/1.5,g=-f/2,m=-p/2,{cssStyles:y}=e,v=er.svg(o),x=nr(e,{});e.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");const b=[{x:g,y:m},{x:g,y:m+p},{x:g+f,y:m+p},{x:g+f,y:m-p/2}],w=Jr(b),C=v.path(w,x),_=o.insert(()=>C,":first-child");return _.attr("class","basic label-container outer-path"),y&&e.look!=="handDrawn"&&_.selectChildren("path").attr("style",y),n&&e.look!=="handDrawn"&&_.selectChildren("path").attr("style",n),_.attr("transform",`translate(0, ${p/4})`),u.attr("transform",`translate(${-f/2+(e.padding??0)-(l.x-(l.left??0))}, ${-p/4+(e.padding??0)-(l.y-(l.top??0))})`),or(e,_),e.intersect=function(k){return Zt.polygon(e,b,k)},o}T(qj,"slopedRect");async function Vj(t,e){const r=e.padding??0,n=e.look==="neo"?16:r*2,i=e.look==="neo"?12:r,a={rx:0,ry:0,labelPaddingX:e.labelPaddingX??n,labelPaddingY:i};return cg(t,e,a)}T(Vj,"squareRect");async function Wj(t,e){const{labelStyles:r,nodeStyles:n}=Jt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?20:i,s=e.look==="neo"?12:i,{shapeSvg:o,bbox:l}=await Sr(t,e,Tr(e)),u=l.height+(e.look==="neo"?s*2:s),h=l.width+u/4+(e.look==="neo"?a*2:a),d=u/2,{cssStyles:f}=e,p=er.svg(o),g=nr(e,{});e.look!=="handDrawn"&&(g.roughness=0,g.fillStyle="solid");const m=[{x:-h/2+d,y:-u/2},{x:h/2-d,y:-u/2},...Nx(-h/2+d,0,d,50,90,270),{x:h/2-d,y:u/2},...Nx(h/2-d,0,d,50,270,450)],y=Jr(m),v=p.path(y,g),x=o.insert(()=>v,":first-child");return x.attr("class","basic label-container outer-path"),f&&e.look!=="handDrawn"&&x.selectChildren("path").attr("style",f),n&&e.look!=="handDrawn"&&x.selectChildren("path").attr("style",n),or(e,x),e.intersect=function(b){return Zt.polygon(e,m,b)},o}T(Wj,"stadium");async function Uj(t,e){const r={rx:e.look==="neo"?3:5,ry:e.look==="neo"?3:5};return cg(t,e,r)}T(Uj,"state");function Hj(t,e,{config:{themeVariables:r}}){var x,b;const{labelStyles:n,nodeStyles:i}=Jt(e);e.labelStyle=n;const{cssStyles:a}=e,{lineColor:s,stateBorder:o,nodeBorder:l,nodeShadow:u}=r;(e.width||e.height)&&((e.width??0)<14&&(e.width=14),(e.height??0)<14&&(e.height=14)),e.width||(e.width=14),e.height||(e.height=14);const h=t.insert("g").attr("class","node default").attr("id",e.domId??e.id),d=er.svg(h),f=nr(e,{});e.look!=="handDrawn"&&(f.roughness=0,f.fillStyle="solid");const p=d.circle(0,0,e.width,{...f,stroke:s,strokeWidth:2}),g=o??l,m=(e.width??0)*5/14,y=d.circle(0,0,m,{...f,fill:g,stroke:g,strokeWidth:2,fillStyle:"solid"}),v=h.insert(()=>p,":first-child");if(v.insert(()=>y),e.look!=="handDrawn"&&v.attr("class","outer-path"),a&&v.selectAll("path").attr("style",a),i&&v.selectAll("path").attr("style",i),e.width<25&&u&&e.look!=="handDrawn"){const w=((b=(x=t.node())==null?void 0:x.ownerSVGElement)==null?void 0:b.id)??"",C=w?`${w}-drop-shadow-small`:"drop-shadow-small";v.attr("style",`filter:url(#${C})`)}return or(e,v),e.intersect=function(w){return Zt.circle(e,(e.width??0)/2,w)},h}T(Hj,"stateEnd");function Yj(t,e,{config:{themeVariables:r}}){var o,l;const{lineColor:n,nodeShadow:i}=r;(e.width||e.height)&&((e.width??0)<14&&(e.width=14),(e.height??0)<14&&(e.height=14)),e.width||(e.width=14),e.height||(e.height=14);const a=t.insert("g").attr("class","node default").attr("id",e.domId||e.id);let s;if(e.look==="handDrawn"){const h=er.svg(a).circle(0,0,e.width,J8e(n));s=a.insert(()=>h),s.attr("class","state-start").attr("r",(e.width??7)/2).attr("width",e.width??14).attr("height",e.height??14)}else s=a.insert("circle",":first-child"),s.attr("class","state-start").attr("r",(e.width??7)/2).attr("width",e.width??14).attr("height",e.height??14);if(e.width<25&&i&&e.look!=="handDrawn"){const u=((l=(o=t.node())==null?void 0:o.ownerSVGElement)==null?void 0:l.id)??"",h=u?`${u}-drop-shadow-small`:"drop-shadow-small";s.attr("style",`filter:url(#${h})`)}return or(e,s),e.intersect=function(u){return Zt.circle(e,(e.width??7)/2,u)},a}T(Yj,"stateStart");var ug=8;async function Xj(t,e){const{labelStyles:r,nodeStyles:n}=Jt(e);e.labelStyle=r;const i=(e==null?void 0:e.padding)??8,a=e.look==="neo"?28:i,s=e.look==="neo"?12:i,{shapeSvg:o,bbox:l}=await Sr(t,e,Tr(e)),u=((e==null?void 0:e.width)??l.width)+2*ug+a,h=((e==null?void 0:e.height)??l.height)+s,d=u-2*ug,f=h,p=-u/2,g=-h/2,m=[{x:0,y:0},{x:d,y:0},{x:d,y:-f},{x:0,y:-f},{x:0,y:0},{x:-8,y:0},{x:d+8,y:0},{x:d+8,y:-f},{x:-8,y:-f},{x:-8,y:0}];if(e.look==="handDrawn"){const y=er.svg(o),v=nr(e,{}),x=y.rectangle(p,g,d+16,f,v),b=y.line(p+ug,g,p+ug,g+f,v),w=y.line(p+ug+d,g,p+ug+d,g+f,v);o.insert(()=>b,":first-child"),o.insert(()=>w,":first-child");const C=o.insert(()=>x,":first-child"),{cssStyles:_}=e;C.attr("class","basic label-container").attr("style",xa(_)),or(e,C)}else{const y=hu(o,d,f,m);n&&y.attr("style",n),or(e,y)}return e.intersect=function(y){return Zt.polygon(e,m,y)},o}T(Xj,"subroutine");var H8=.2;async function jj(t,e){const{labelStyles:r,nodeStyles:n}=Jt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,s=e.look==="neo"?12:i;(e.width||e.height)&&(e.height=Math.max(((e==null?void 0:e.height)??0)-s*2,10),e.width=Math.max(((e==null?void 0:e.width)??0)-a*2-H8*(e.height+s*2),10));const{shapeSvg:o,bbox:l}=await Sr(t,e,Tr(e)),u=(e!=null&&e.height?e==null?void 0:e.height:l.height)+s*2,h=H8*u,d=H8*u,p=(e!=null&&e.width?e==null?void 0:e.width:l.width)+a*2+h-h,g=u,m=-p/2,y=-g/2,{cssStyles:v}=e,x=er.svg(o),b=nr(e,{}),w=[{x:m-h/2,y},{x:m+p+h/2,y},{x:m+p+h/2,y:y+g},{x:m-h/2,y:y+g}],C=[{x:m+p-h/2,y:y+g},{x:m+p+h/2,y:y+g},{x:m+p+h/2,y:y+g-d}];e.look!=="handDrawn"&&(b.roughness=0,b.fillStyle="solid");const _=Jr(w),k=x.path(_,b),S=Jr(C),L=x.path(S,{...b,fillStyle:"solid"}),$=o.insert(()=>L,":first-child");return $.insert(()=>k,":first-child"),$.attr("class","basic label-container outer-path"),v&&e.look!=="handDrawn"&&$.selectAll("path").attr("style",v),n&&e.look!=="handDrawn"&&$.selectAll("path").attr("style",n),or(e,$),e.intersect=function(I){return Zt.polygon(e,w,I)},o}T(jj,"taggedRect");async function Kj(t,e){const{labelStyles:r,nodeStyles:n}=Jt(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,label:s}=await Sr(t,e,Tr(e)),o=Math.max(a.width+(e.padding??0)*2,(e==null?void 0:e.width)??0),l=Math.max(a.height+(e.padding??0)*2,(e==null?void 0:e.height)??0),u=l/8,h=.2*o,d=.2*l,f=l+u,{cssStyles:p}=e,g=er.svg(i),m=nr(e,{});e.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=[{x:-o/2-o/2*.1,y:f/2},...Ih(-o/2-o/2*.1,f/2,o/2+o/2*.1,f/2,u,.8),{x:o/2+o/2*.1,y:-f/2},{x:-o/2-o/2*.1,y:-f/2}],v=-o/2+o/2*.1,x=-f/2-d*.4,b=[{x:v+o-h,y:(x+l)*1.3},{x:v+o,y:x+l-d},{x:v+o,y:(x+l)*.9},...Ih(v+o,(x+l)*1.25,v+o-h,(x+l)*1.3,-l*.02,.5)],w=Jr(y),C=g.path(w,m),_=Jr(b),k=g.path(_,{...m,fillStyle:"solid"}),S=i.insert(()=>k,":first-child");return S.insert(()=>C,":first-child"),S.attr("class","basic label-container outer-path"),p&&e.look!=="handDrawn"&&S.selectAll("path").attr("style",p),n&&e.look!=="handDrawn"&&S.selectAll("path").attr("style",n),S.attr("transform",`translate(0,${-u/2})`),s.attr("transform",`translate(${-o/2+(e.padding??0)-(a.x-(a.left??0))},${-l/2+(e.padding??0)-u/2-(a.y-(a.top??0))})`),or(e,S),e.intersect=function(L){return Zt.polygon(e,y,L)},i}T(Kj,"taggedWaveEdgedRectangle");async function Zj(t,e){const{labelStyles:r,nodeStyles:n}=Jt(e);e.labelStyle=r;const{shapeSvg:i,bbox:a}=await Sr(t,e,Tr(e)),s=Math.max(a.width+(e.padding??0),(e==null?void 0:e.width)||0),o=Math.max(a.height+(e.padding??0),(e==null?void 0:e.height)||0),l=-s/2,u=-o/2,h=i.insert("rect",":first-child");return h.attr("class","text").attr("style",n).attr("rx",0).attr("ry",0).attr("x",l).attr("y",u).attr("width",s).attr("height",o),or(e,h),e.intersect=function(d){return Zt.rect(e,d)},i}T(Zj,"text");var qIe=T((t,e,r,n,i,a)=>`M${t},${e} a${i},${a} 0,0,1 0,${-n} l${r},0 a${i},${a} 0,0,1 0,${n} M${r},${-n} a${i},${a} 0,0,0 0,${n} - l${-r},0`,"createCylinderPathD"),S6e=x((t,e,r,n,i,a)=>[`M${t},${e}`,`M${t+r},${e}`,`a${i},${a} 0,0,0 0,${-n}`,`l${-r},0`,`a${i},${a} 0,0,0 0,${n}`,`l${r},0`].join(" "),"createOuterCylinderPathD"),A6e=x((t,e,r,n,i,a)=>[`M${t+r/2},${-n/2}`,`a${i},${a} 0,0,0 0,${n}`].join(" "),"createInnerCylinderPathD"),CU=5,kU=10;async function EU(t,e){const{labelStyles:r,nodeStyles:n}=Xt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?12:i/2;if(e.width||e.height){const m=e.height??0;e.height=(e.height??0)-a,e.heightb,":first-child"),g=s.insert(()=>T,":first-child"),g.attr("class","basic label-container"),p&&g.attr("style",p)}else{const m=E6e(0,0,f,u,d,h);g=s.insert("path",":first-child").attr("d",m).attr("class","basic label-container").attr("style",Zi(p)).attr("style",n),g.attr("class","basic label-container outer-path"),p&&g.selectAll("path").attr("style",p),n&&g.selectAll("path").attr("style",n)}return g.attr("label-offset-x",d),g.attr("transform",`translate(${-f/2}, ${u/2} )`),l.attr("transform",`translate(${-(o.width/2)-d-(o.x-(o.left??0))}, ${-(o.height/2)-(o.y-(o.top??0))})`),rr(e,g),e.intersect=function(m){const y=Ht.rect(e,m),v=y.y-(e.y??0);if(h!=0&&(Math.abs(v)<(e.height??0)/2||Math.abs(v)==(e.height??0)/2&&Math.abs(y.x-(e.x??0))>(e.width??0)/2-d)){let T=d*d*(1-v*v/(h*h));T!=0&&(T=Math.sqrt(Math.abs(T))),T=d-T,m.x-(e.x??0)>0&&(T=-T),y.x+=T}return y},s}x(EU,"tiltedCylinder");async function SU(t,e){const{labelStyles:r,nodeStyles:n}=Xt(e);e.labelStyle=r;const i=e.padding??0,a=(e.look==="neo",i),s=e.look==="neo"?i*2:i,{shapeSvg:o,bbox:l}=await xr(t,e,gr(e)),u=((e==null?void 0:e.height)??l.height)+a,h=((e==null?void 0:e.width)??l.width)+s,d=[{x:-3*u/6,y:0},{x:h+3*u/6,y:0},{x:h,y:-u},{x:0,y:-u}];let f;const{cssStyles:p}=e;if(e.look==="handDrawn"){const g=Kt.svg(o),m=Qt(e,{}),y=Wr(d),v=g.path(y,m);f=o.insert(()=>v,":first-child").attr("transform",`translate(${-h/2}, ${u/2})`),p&&f.attr("style",p)}else f=wc(o,h,u,d);return n&&f.attr("style",n),e.width=h,e.height=u,rr(e,f),e.intersect=function(g){return Ht.polygon(e,d,g)},o}x(SU,"trapezoid");async function AU(t,e){const{labelStyles:r,nodeStyles:n}=Xt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,s=e.look==="neo"?12:i,o=15,l=5;(e.width||e.height)&&(e.height=(e.height??0)-s*2,e.heightT,":first-child");return b.attr("class","basic label-container outer-path"),p&&e.look!=="handDrawn"&&b.selectChildren("path").attr("style",p),n&&e.look!=="handDrawn"&&b.selectChildren("path").attr("style",n),rr(e,b),e.intersect=function(w){return Ht.polygon(e,y,w)},u}x(AU,"trapezoidalPentagon");var _U=10,RU=10;async function LU(t,e){var w;const{labelStyles:r,nodeStyles:n}=Xt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?i*2:i;(e.width||e.height)&&(e.width=(((e==null?void 0:e.width)??0)-a)/2,e.widthT,":first-child").attr("transform",`translate(${-d/2}, ${d/2})`).attr("class","outer-path");return g&&e.look!=="handDrawn"&&b.selectChildren("path").attr("style",g),n&&e.look!=="handDrawn"&&b.selectChildren("path").attr("style",n),e.width=h,e.height=d,rr(e,b),l.attr("transform",`translate(${-o.width/2-(o.x-(o.left??0))}, ${d/2-(o.height+(e.padding??0)/(u?2:1)-(o.y-(o.top??0)))})`),e.intersect=function(k){return ae.info("Triangle intersect",e,p,k),Ht.polygon(e,p,k)},s}x(LU,"triangle");async function IU(t,e){const{labelStyles:r,nodeStyles:n}=Xt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,s=e.look==="neo"?12:i;let o=!0;(e.width||e.height)&&(o=!1,e.width=((e==null?void 0:e.width)??0)-a*2,e.width<10&&(e.width=10),e.height=((e==null?void 0:e.height)??0)-s*2,e.height<10&&(e.height=10));const{shapeSvg:l,bbox:u,label:h}=await xr(t,e,gr(e)),d=(e!=null&&e.width?e==null?void 0:e.width:u.width)+(a??0)*2,f=(e!=null&&e.height?e==null?void 0:e.height:u.height)+(s??0)*2,p=e.look==="neo"?f/4:f/8,g=f+(o?p:-p),{cssStyles:m}=e,v=14-d,T=v>0?v/2:0,b=Kt.svg(l),w=Qt(e,{});e.look!=="handDrawn"&&(w.roughness=0,w.fillStyle="solid");const k=[{x:-d/2-T,y:g/2},...Du(-d/2-T,g/2,d/2+T,g/2,p,.8),{x:d/2+T,y:-g/2},{x:-d/2-T,y:-g/2}],A=Wr(k),C=b.path(A,w),_=l.insert(()=>C,":first-child");return _.attr("class","basic label-container outer-path"),m&&e.look!=="handDrawn"&&_.selectAll("path").attr("style",m),n&&e.look!=="handDrawn"&&_.selectAll("path").attr("style",n),_.attr("transform",`translate(0,${-p/2})`),h.attr("transform",`translate(${-d/2+(e.padding??0)-(u.x-(u.left??0))},${-f/2+(e.padding??0)-p-(u.y-(u.top??0))})`),rr(e,_),e.intersect=function(L){return Ht.polygon(e,k,L)},l}x(IU,"waveEdgedRectangle");async function DU(t,e){const{labelStyles:r,nodeStyles:n}=Xt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,s=e.look==="neo"?20:i;if(e.width||e.height){e.width=(e==null?void 0:e.width)??0,e.width<20&&(e.width=20),e.height=(e==null?void 0:e.height)??0,e.height<10&&(e.height=10);const w=Math.min(e.height*.2,e.height/4);e.height=Math.ceil(e.height-s-w*(20/9)),e.width=e.width-a*2}const{shapeSvg:o,bbox:l}=await xr(t,e,gr(e)),u=(e!=null&&e.width?e==null?void 0:e.width:l.width)+a*2,h=(e!=null&&e.height?e==null?void 0:e.height:l.height)+s,d=h/8,f=h+d*2,{cssStyles:p}=e,g=Kt.svg(o),m=Qt(e,{});e.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=[{x:-u/2,y:f/2},...Du(-u/2,f/2,u/2,f/2,d,1),{x:u/2,y:-f/2},...Du(u/2,-f/2,-u/2,-f/2,d,-1)],v=Wr(y),T=g.path(v,m),b=o.insert(()=>T,":first-child");return b.attr("class","basic label-container"),p&&e.look!=="handDrawn"&&b.selectAll("path").attr("style",p),n&&e.look!=="handDrawn"&&b.selectAll("path").attr("style",n),rr(e,b),e.intersect=function(w){return Ht.polygon(e,y,w)},o}x(DU,"waveRectangle");var ri=10;async function MU(t,e){const{labelStyles:r,nodeStyles:n}=Xt(e);e.labelStyle=r;const i=e.look==="neo"?16:e.padding??0,a=e.look==="neo"?12:e.padding??0;(e.width||e.height)&&(e.width=Math.max(((e==null?void 0:e.width)??0)-i*2-ri,10),e.height=Math.max(((e==null?void 0:e.height)??0)-a*2-ri,10));const{shapeSvg:s,bbox:o,label:l}=await xr(t,e,gr(e)),u=(e!=null&&e.width?e==null?void 0:e.width:o.width)+i*2+ri,h=(e!=null&&e.height?e==null?void 0:e.height:o.height)+a*2+ri,d=u-ri,f=h-ri,p=-d/2,g=-f/2,{cssStyles:m}=e,y=Kt.svg(s),v=Qt(e,{}),T=[{x:p-ri,y:g-ri},{x:p-ri,y:g+f},{x:p+d,y:g+f},{x:p+d,y:g-ri}],b=`M${p-ri},${g-ri} L${p+d},${g-ri} L${p+d},${g+f} L${p-ri},${g+f} L${p-ri},${g-ri} - M${p-ri},${g} L${p+d},${g} - M${p},${g-ri} L${p},${g+f}`;e.look!=="handDrawn"&&(v.roughness=0,v.fillStyle="solid");const w=y.path(b,v),k=s.insert(()=>w,":first-child");return k.attr("transform",`translate(${ri/2}, ${ri/2})`),k.attr("class","basic label-container outer-path"),m&&e.look!=="handDrawn"&&k.selectAll("path").attr("style",m),n&&e.look!=="handDrawn"&&k.selectAll("path").attr("style",n),l.attr("transform",`translate(${-(o.width/2)+ri/2-(o.x-(o.left??0))}, ${-(o.height/2)+ri/2-(o.y-(o.top??0))})`),rr(e,k),e.intersect=function(A){return Ht.polygon(e,T,A)},s}x(MU,"windowPane");var NU=new Set(["redux-color","redux-dark-color"]),_6e=new Set(["redux","redux-dark","redux-color","redux-dark-color"]);async function X_(t,e){var ie,K,se,J;const r=e;r.alias&&(e.label=r.alias);const{theme:n,themeVariables:i}=lr(),{rowEven:a,rowOdd:s,nodeBorder:o,borderColorArray:l}=i;if(e.look==="handDrawn"){const{themeVariables:Z}=lr(),{background:ee}=Z,ne={...e,id:e.id+"-background",domId:(e.domId||e.id)+"-background",look:"default",cssStyles:["stroke: none",`fill: ${ee}`]};await X_(t,ne)}const u=lr();e.useHtmlLabels=u.htmlLabels;let h=((ie=u.er)==null?void 0:ie.diagramPadding)??10,d=((K=u.er)==null?void 0:K.entityPadding)??6;const{cssStyles:f}=e,{labelStyles:p,nodeStyles:g}=Xt(e);if(r.attributes.length===0&&e.label){const Z={rx:0,ry:0,labelPaddingX:h,labelPaddingY:h*1.5};qa(e.label,u)+Z.labelPaddingX*20){const Z=v.width+h*2-(k+A+C+_);k+=Z/M,A+=Z/M,C>0&&(C+=Z/M),_>0&&(_+=Z/M)}const F=k+A+C+_,S=Kt.svg(y),R=Qt(e,{});e.look!=="handDrawn"&&(R.roughness=0,R.fillStyle="solid");let N=0;w.length>0&&(N=w.reduce((Z,ee)=>Z+((ee==null?void 0:ee.rowHeight)??0),0));const D=Math.max(z.width+h*2,(e==null?void 0:e.width)||0,F),I=Math.max((N??0)+v.height,(e==null?void 0:e.height)||0),$=-D/2,B=-I/2;if(y.selectAll("g:not(:first-child)").each((Z,ee,ne)=>{const ue=pt(ne[ee]),fe=ue.attr("transform");let _e=0,Ae=0;if(fe){const me=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(fe);me&&(_e=parseFloat(me[1]),Ae=parseFloat(me[2]),ue.attr("class").includes("attribute-name")?_e+=k:ue.attr("class").includes("attribute-keys")?_e+=k+A:ue.attr("class").includes("attribute-comment")&&(_e+=k+A+C))}ue.attr("transform",`translate(${$+h/2+_e}, ${Ae+B+v.height+d/2})`)}),y.select(".name").attr("transform","translate("+-v.width/2+", "+(B+d/2)+")"),n!=null&&NU.has(n)){const Z=r.colorIndex??0;y.attr("data-color-id",`color-${Z%l.length}`)}const P=S.rectangle($,B,D,I,R),G=y.insert(()=>P,":first-child").attr("class","outer-path").attr("style",f.join(""));b.push(0);for(const[Z,ee]of w.entries()){const ue=(Z+1)%2===0&&ee.yOffset!==0,fe=S.rectangle($,v.height+B+(ee==null?void 0:ee.yOffset),D,ee==null?void 0:ee.rowHeight,{...R,fill:ue?a:s,stroke:o});y.insert(()=>fe,"g.label").attr("style",f.join("")).attr("class",`row-rect-${ue?"even":"odd"}`)}const V=1e-4;let Y=j0($,v.height+B,D+$,v.height+B,V),W=S.polygon(Y.map(Z=>[Z.x,Z.y]),R);if(y.insert(()=>W).attr("class","divider"),Y=j0(k+$,v.height+B,k+$,I+B,V),W=S.polygon(Y.map(Z=>[Z.x,Z.y]),R),y.insert(()=>W).attr("class","divider"),L){const Z=k+A+$;Y=j0(Z,v.height+B,Z,I+B,V),W=S.polygon(Y.map(ee=>[ee.x,ee.y]),R),y.insert(()=>W).attr("class","divider")}if(O){const Z=k+A+C+$;Y=j0(Z,v.height+B,Z,I+B,V),W=S.polygon(Y.map(ee=>[ee.x,ee.y]),R),y.insert(()=>W).attr("class","divider")}for(const Z of b){const ee=v.height+B+Z;Y=j0($,ee,D+$,ee,V),W=S.polygon(Y.map(ne=>[ne.x,ne.y]),R),y.insert(()=>W).attr("class","divider")}if(rr(e,G),g&&e.look!=="handDrawn")if(n!=null&&_6e.has(n))y.selectAll("path").attr("style",g);else{const Z=g.split(";"),ee=(J=Z==null?void 0:Z.filter(ne=>ne.includes("stroke")))==null?void 0:J.map(ne=>`${ne}`).join("; ");y.selectAll("path").attr("style",ee??""),y.selectAll(".row-rect-even path").attr("style",g)}return e.intersect=function(Z){return Ht.rect(e,Z)},y}x(X_,"erBox");async function K0(t,e,r,n=0,i=0,a=[],s=""){const o=t.insert("g").attr("class",`label ${a.join(" ")}`).attr("transform",`translate(${n}, ${i})`).attr("style",s);e!==Eu(e)&&(e=Eu(e),e=e.replaceAll("<","<").replaceAll(">",">"));const l=o.node().appendChild(await Wa(o,e,{width:qa(e,r)+100,style:s,useHtmlLabels:r.htmlLabels},r));if(e.includes("<")||e.includes(">")){let h=l.children[0];for(h.textContent=h.textContent.replaceAll("<","<").replaceAll(">",">");h.childNodes[0];)h=h.childNodes[0],h.textContent=h.textContent.replaceAll("<","<").replaceAll(">",">")}let u=l.getBBox();if(hc(r.htmlLabels)){const h=l.children[0];h.style.textAlign="start";const d=pt(l);u=h.getBoundingClientRect(),d.attr("width",u.width),d.attr("height",u.height)}return u}x(K0,"addText");function j0(t,e,r,n,i){return t===r?[{x:t-i/2,y:e},{x:t+i/2,y:e},{x:r+i/2,y:n},{x:r-i/2,y:n}]:[{x:t,y:e-i/2},{x:t,y:e+i/2},{x:r,y:n+i/2},{x:r,y:n-i/2}]}x(j0,"lineToPolygon");async function OU(t,e,r,n,i=r.class.padding??12){const a=n?0:3,s=t.insert("g").attr("class",gr(e)).attr("id",e.domId||e.id);let o=null,l=null,u=null,h=null,d=0,f=0,p=0;if(o=s.insert("g").attr("class","annotation-group text"),e.annotations.length>0){const T=e.annotations[0];await rb(o,{text:`«${T}»`},0),d=o.node().getBBox().height}l=s.insert("g").attr("class","label-group text"),await rb(l,e,0,["font-weight: bolder"]);const g=l.node().getBBox();f=g.height,u=s.insert("g").attr("class","members-group text");let m=0;for(const T of e.members){const b=await rb(u,T,m,[T.parseClassifier()]);m+=b+a}p=u.node().getBBox().height,p<=0&&(p=i/2),h=s.insert("g").attr("class","methods-group text");let y=0;for(const T of e.methods){const b=await rb(h,T,y,[T.parseClassifier()]);y+=b+a}let v=s.node().getBBox();if(o!==null){const T=o.node().getBBox();o.attr("transform",`translate(${-T.width/2})`)}return l.attr("transform",`translate(${-g.width/2}, ${d})`),v=s.node().getBBox(),u.attr("transform",`translate(0, ${d+f+i*2})`),v=s.node().getBBox(),h.attr("transform",`translate(0, ${d+f+(p?p+i*4:i*2)})`),v=s.node().getBBox(),{shapeSvg:s,bbox:v}}x(OU,"textHelper");async function rb(t,e,r,n=[]){const i=t.insert("g").attr("class","label").attr("style",n.join("; ")),a=lr();let s="useHtmlLabels"in e?e.useHtmlLabels:hc(a.htmlLabels)??!0,o="";"text"in e?o=e.text:o=e.label,!s&&o.startsWith("\\")&&(o=o.substring(1)),ui(o)&&(s=!0);const l=await Wa(i,$6(Tc(o)),{width:qa(o,a)+50,classes:"markdown-node-label",useHtmlLabels:s},a);let u,h=1;if(s){const d=l.children[0],f=pt(l);h=d.innerHTML.split("
    ").length,d.innerHTML.includes("")&&(h+=d.innerHTML.split("").length-1);const p=d.getElementsByTagName("img");if(p){const g=o.replace(/]*>/g,"").trim()==="";await Promise.all([...p].map(m=>new Promise(y=>{function v(){var T;if(m.style.display="flex",m.style.flexDirection="column",g){const b=((T=a.fontSize)==null?void 0:T.toString())??window.getComputedStyle(document.body).fontSize,k=parseInt(b,10)*5+"px";m.style.minWidth=k,m.style.maxWidth=k}else m.style.width="100%";y(m)}x(v,"setupImage"),setTimeout(()=>{m.complete&&v()}),m.addEventListener("error",v),m.addEventListener("load",v)})))}u=d.getBoundingClientRect(),f.attr("width",u.width),f.attr("height",u.height)}else{n.includes("font-weight: bolder")&&pt(l).selectAll("tspan").attr("font-weight",""),h=l.children.length;const d=l.children[0];(l.textContent===""||l.textContent.includes(">"))&&(d.textContent=o[0]+o.substring(1).replaceAll(">",">").replaceAll("<","<").trim(),o[1]===" "&&(d.textContent=d.textContent[0]+" "+d.textContent.substring(1))),d.textContent==="undefined"&&(d.textContent=""),u=l.getBBox()}return i.attr("transform","translate(0,"+(-u.height/(2*h)+r)+")"),u.height}x(rb,"addText");async function $U(t,e){var S,R;const r=Pe(),{themeVariables:n}=r,{useGradient:i}=n,a=r.class.padding??12,s=a,o=e.useHtmlLabels??hc(r.htmlLabels)??!0,l=e;l.annotations=l.annotations??[],l.members=l.members??[],l.methods=l.methods??[];const{shapeSvg:u,bbox:h}=await OU(t,e,r,o,s),{labelStyles:d,nodeStyles:f}=Xt(e);e.labelStyle=d,e.cssStyles=l.styles||"";const p=((S=l.styles)==null?void 0:S.join(";"))||f||"";e.cssStyles||(e.cssStyles=p.replaceAll("!important","").split(";"));const g=l.members.length===0&&l.methods.length===0&&!((R=r.class)!=null&&R.hideEmptyMembersBox),m=Kt.svg(u),y=Qt(e,{});e.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const v=Math.max(e.width??0,h.width);let T=Math.max(e.height??0,h.height);const b=(e.height??0)>h.height;l.members.length===0&&l.methods.length===0?T+=s:l.members.length>0&&l.methods.length===0&&(T+=s*2);const w=-v/2,k=-T/2;let A=g?a*2:l.members.length===0&&l.methods.length===0?-a:0;b&&(A=a*2);const C=m.rectangle(w-a,k-a-(g?a:l.members.length===0&&l.methods.length===0?-a/2:0),v+2*a,T+2*a+A,y),_=u.insert(()=>C,":first-child");_.attr("class","basic label-container outer-path");const L=_.node().getBBox(),O=u.select(".annotation-group").node().getBBox().height-(g?a/2:0)||0,M=u.select(".label-group").node().getBBox().height-(g?a/2:0)||0,z=u.select(".members-group").node().getBBox().height-(g?a/2:0)||0,F=(O+M+k+a-(k-a-(g?a:l.members.length===0&&l.methods.length===0?-a/2:0)))/2;if(u.selectAll(".text").each((N,D,I)=>{var Y,W;const $=pt(I[D]),B=$.attr("transform");let P=0;if(B){const K=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(B);K&&(P=parseFloat(K[2]))}let G=P+k+a-(g?a:l.members.length===0&&l.methods.length===0?-a/2:0);if($.attr("class").includes("methods-group")){const ie=Math.max(z,s/2);b?G=Math.max(F,O+M+ie+k+s*2+a)+s*2:G=O+M+ie+k+s*4+a}l.members.length===0&&l.methods.length===0&&((Y=r.class)!=null&&Y.hideEmptyMembersBox)&&(l.annotations.length>0?G=P-s:G=P),o||(G-=4);let V=w;($.attr("class").includes("label-group")||$.attr("class").includes("annotation-group"))&&(V=-((W=$.node())==null?void 0:W.getBBox().width)/2||0,u.selectAll("text").each(function(ie,K,se){window.getComputedStyle(se[K]).textAnchor==="middle"&&(V=0)})),$.attr("transform",`translate(${V}, ${G})`)}),l.members.length>0||l.methods.length>0||g){const N=O+M+k+a,D=m.line(L.x,N,L.x+L.width,N+.001,y);u.insert(()=>D).attr("class",`divider${e.look==="neo"&&!i?" neo-line":""}`).attr("style",p)}if(g||l.members.length>0||l.methods.length>0){const N=O+M+z+k+s*2+a,D=m.line(L.x,b?Math.max(F,N):N,L.x+L.width,(b?Math.max(F,N):N)+.001,y);u.insert(()=>D).attr("class",`divider${e.look==="neo"&&!i?" neo-line":""}`).attr("style",p)}if(l.look!=="handDrawn"&&u.selectAll("path").attr("style",p),_.select(":nth-child(2)").attr("style",p),u.selectAll(".divider").select("path").attr("style",p),e.labelStyle?u.selectAll("span").attr("style",e.labelStyle):u.selectAll("span").attr("style",p),!o){const N=RegExp(/color\s*:\s*([^;]*)/),D=N.exec(p);if(D){const I=D[0].replace("color","fill");u.selectAll("tspan").attr("style",I)}else if(d){const I=N.exec(d);if(I){const $=I[0].replace("color","fill");u.selectAll("tspan").attr("style",$)}}}return rr(e,_),e.intersect=function(N){return Ht.rect(e,N)},u}x($U,"classBox");async function PU(t,e){var L,O;const{labelStyles:r,nodeStyles:n}=Xt(e);e.labelStyle=r;const i=e,a=e,s=20,o=20,l="verifyMethod"in e,u=gr(e),{themeVariables:h}=Pe(),{borderColorArray:d,requirementEdgeLabelBackground:f}=h,p=t.insert("g").attr("class",u).attr("id",e.domId??e.id);let g;l?g=await bl(p,`<<${i.type}>>`,0,e.labelStyle):g=await bl(p,"<<Element>>",0,e.labelStyle);let m=g;const y=await bl(p,i.name,m,e.labelStyle+"; font-weight: bold;");if(m+=y+o,l){const M=await bl(p,`${i.requirementId?`ID: ${i.requirementId}`:""}`,m,e.labelStyle);m+=M;const z=await bl(p,`${i.text?`Text: ${i.text}`:""}`,m,e.labelStyle);m+=z;const F=await bl(p,`${i.risk?`Risk: ${i.risk}`:""}`,m,e.labelStyle);m+=F,await bl(p,`${i.verifyMethod?`Verification: ${i.verifyMethod}`:""}`,m,e.labelStyle)}else{const M=await bl(p,`${a.type?`Type: ${a.type}`:""}`,m,e.labelStyle);m+=M,await bl(p,`${a.docRef?`Doc Ref: ${a.docRef}`:""}`,m,e.labelStyle)}const v=(((L=p.node())==null?void 0:L.getBBox().width)??200)+s,T=(((O=p.node())==null?void 0:O.getBBox().height)??200)+s,b=-v/2,w=-T/2,k=Kt.svg(p),A=Qt(e,{});e.look!=="handDrawn"&&(A.roughness=0,A.fillStyle="solid");const C=k.rectangle(b,w,v,T,A),_=p.insert(()=>C,":first-child");if(_.attr("class","basic label-container outer-path").attr("style",n),d!=null&&d.length){const M=e.colorIndex??0;p.attr("data-color-id",`color-${M%d.length}`)}if(p.selectAll(".label").each((M,z,F)=>{const S=pt(F[z]),R=S.attr("transform");let N=0,D=0;if(R){const P=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(R);P&&(N=parseFloat(P[1]),D=parseFloat(P[2]))}const I=D-T/2;let $=b+s/2;(z===0||z===1)&&($=N),S.attr("transform",`translate(${$}, ${I+s})`)}),m>g+y+o){const M=w+g+y+o;let z;if(e.look==="neo"){const R=[[b,M],[b+v,M],[b+v,M+.001],[b,M+.001]];z=k.polygon(R,A)}else z=k.line(b,M,b+v,M,A);p.insert(()=>z).attr("class","divider")}return rr(e,_),e.intersect=function(M){return Ht.rect(e,M)},n&&e.look!=="handDrawn"&&(f||d!=null&&d.length)&&p.selectAll("path").attr("style",n),p}x(PU,"requirementBox");async function bl(t,e,r,n=""){if(e==="")return 0;const i=t.insert("g").attr("class","label").attr("style",n),a=Pe(),s=a.htmlLabels??!0,o=await Wa(i,$6(Tc(e)),{width:qa(e,a)+50,classes:"markdown-node-label",useHtmlLabels:s,style:n},a);let l;if(s){const u=o.children[0],h=pt(o);l=u.getBoundingClientRect(),h.attr("width",l.width),h.attr("height",l.height)}else{const u=o.children[0];for(const h of u.children)n&&h.setAttribute("style",n);l=o.getBBox(),l.height+=6}return i.attr("transform",`translate(${-l.width/2},${-l.height/2+r})`),l.height}x(bl,"addText");var R6e=x(t=>{switch(t){case"Very High":return"red";case"High":return"orange";case"Medium":return null;case"Low":return"blue";case"Very Low":return"lightblue"}},"colorFromPriority");async function BU(t,e,{config:r}){var z,F;const{labelStyles:n,nodeStyles:i}=Xt(e);e.labelStyle=n||"";const a=10,s=e.width;e.width=(e.width??200)-10;const{shapeSvg:o,bbox:l,label:u}=await xr(t,e,gr(e)),h=e.padding||10;let d="",f;"ticket"in e&&e.ticket&&((z=r==null?void 0:r.kanban)!=null&&z.ticketBaseUrl)&&(d=(F=r==null?void 0:r.kanban)==null?void 0:F.ticketBaseUrl.replace("#TICKET#",e.ticket),f=o.insert("svg:a",":first-child").attr("class","kanban-ticket-link").attr("xlink:href",d).attr("target","_blank"));const p={useHtmlLabels:e.useHtmlLabels,labelStyle:e.labelStyle||"",width:e.width,img:e.img,padding:e.padding||8,centerLabel:!1};let g,m;f?{label:g,bbox:m}=await G_(f,"ticket"in e&&e.ticket||"",p):{label:g,bbox:m}=await G_(o,"ticket"in e&&e.ticket||"",p);const{label:y,bbox:v}=await G_(o,"assigned"in e&&e.assigned||"",p);e.width=s;const T=10,b=(e==null?void 0:e.width)||0,w=Math.max(m.height,v.height)/2,k=Math.max(l.height+T*2,(e==null?void 0:e.height)||0)+w,A=-b/2,C=-k/2;u.attr("transform","translate("+(h-b/2)+", "+(-w-l.height/2)+")"),g.attr("transform","translate("+(h-b/2)+", "+(-w+l.height/2)+")"),y.attr("transform","translate("+(h+b/2-v.width-2*a)+", "+(-w+l.height/2)+")");let _;const{rx:L,ry:O}=e,{cssStyles:M}=e;if(e.look==="handDrawn"){const S=Kt.svg(o),R=Qt(e,{}),N=L||O?S.path(Nu(A,C,b,k,L||0),R):S.rectangle(A,C,b,k,R);_=o.insert(()=>N,":first-child"),_.attr("class","basic label-container").attr("style",M||null)}else{_=o.insert("rect",":first-child"),_.attr("class","basic label-container __APA__").attr("style",i).attr("rx",L??5).attr("ry",O??5).attr("x",A).attr("y",C).attr("width",b).attr("height",k);const S="priority"in e&&e.priority;if(S){const R=o.append("line"),N=A+2,D=C+Math.floor((L??0)/2),I=C+k-Math.floor((L??0)/2);R.attr("x1",N).attr("y1",D).attr("x2",N).attr("y2",I).attr("stroke-width","4").attr("stroke",R6e(S))}}return rr(e,_),e.height=k,e.intersect=function(S){return Ht.rect(e,S)},o}x(BU,"kanbanItem");async function FU(t,e){const{labelStyles:r,nodeStyles:n}=Xt(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,halfPadding:s,label:o}=await xr(t,e,gr(e)),l=a.width+10*s,u=a.height+8*s,h=.15*l,{cssStyles:d}=e,f=a.width+20,p=a.height+20,g=Math.max(l,f),m=Math.max(u,p);o.attr("transform",`translate(${-a.width/2}, ${-a.height/2})`);let y;const v=`M0 0 + l${-r},0`,"createCylinderPathD"),VIe=T((t,e,r,n,i,a)=>[`M${t},${e}`,`M${t+r},${e}`,`a${i},${a} 0,0,0 0,${-n}`,`l${-r},0`,`a${i},${a} 0,0,0 0,${n}`,`l${r},0`].join(" "),"createOuterCylinderPathD"),WIe=T((t,e,r,n,i,a)=>[`M${t+r/2},${-n/2}`,`a${i},${a} 0,0,0 0,${n}`].join(" "),"createInnerCylinderPathD"),Qj=5,Jj=10;async function eK(t,e){const{labelStyles:r,nodeStyles:n}=Jt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?12:i/2;if(e.width||e.height){const m=e.height??0;e.height=(e.height??0)-a,e.heightb,":first-child"),g=s.insert(()=>x,":first-child"),g.attr("class","basic label-container"),p&&g.attr("style",p)}else{const m=qIe(0,0,f,u,d,h);g=s.insert("path",":first-child").attr("d",m).attr("class","basic label-container").attr("style",xa(p)).attr("style",n),g.attr("class","basic label-container outer-path"),p&&g.selectAll("path").attr("style",p),n&&g.selectAll("path").attr("style",n)}return g.attr("label-offset-x",d),g.attr("transform",`translate(${-f/2}, ${u/2} )`),l.attr("transform",`translate(${-(o.width/2)-d-(o.x-(o.left??0))}, ${-(o.height/2)-(o.y-(o.top??0))})`),or(e,g),e.intersect=function(m){const y=Zt.rect(e,m),v=y.y-(e.y??0);if(h!=0&&(Math.abs(v)<(e.height??0)/2||Math.abs(v)==(e.height??0)/2&&Math.abs(y.x-(e.x??0))>(e.width??0)/2-d)){let x=d*d*(1-v*v/(h*h));x!=0&&(x=Math.sqrt(Math.abs(x))),x=d-x,m.x-(e.x??0)>0&&(x=-x),y.x+=x}return y},s}T(eK,"tiltedCylinder");async function tK(t,e){const{labelStyles:r,nodeStyles:n}=Jt(e);e.labelStyle=r;const i=e.padding??0,a=(e.look==="neo",i),s=e.look==="neo"?i*2:i,{shapeSvg:o,bbox:l}=await Sr(t,e,Tr(e)),u=((e==null?void 0:e.height)??l.height)+a,h=((e==null?void 0:e.width)??l.width)+s,d=[{x:-3*u/6,y:0},{x:h+3*u/6,y:0},{x:h,y:-u},{x:0,y:-u}];let f;const{cssStyles:p}=e;if(e.look==="handDrawn"){const g=er.svg(o),m=nr(e,{}),y=Jr(d),v=g.path(y,m);f=o.insert(()=>v,":first-child").attr("transform",`translate(${-h/2}, ${u/2})`),p&&f.attr("style",p)}else f=hu(o,h,u,d);return n&&f.attr("style",n),e.width=h,e.height=u,or(e,f),e.intersect=function(g){return Zt.polygon(e,d,g)},o}T(tK,"trapezoid");async function rK(t,e){const{labelStyles:r,nodeStyles:n}=Jt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,s=e.look==="neo"?12:i,o=15,l=5;(e.width||e.height)&&(e.height=(e.height??0)-s*2,e.heightx,":first-child");return b.attr("class","basic label-container outer-path"),p&&e.look!=="handDrawn"&&b.selectChildren("path").attr("style",p),n&&e.look!=="handDrawn"&&b.selectChildren("path").attr("style",n),or(e,b),e.intersect=function(w){return Zt.polygon(e,y,w)},u}T(rK,"trapezoidalPentagon");var nK=10,iK=10;async function aK(t,e){var w;const{labelStyles:r,nodeStyles:n}=Jt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?i*2:i;(e.width||e.height)&&(e.width=(((e==null?void 0:e.width)??0)-a)/2,e.widthx,":first-child").attr("transform",`translate(${-d/2}, ${d/2})`).attr("class","outer-path");return g&&e.look!=="handDrawn"&&b.selectChildren("path").attr("style",g),n&&e.look!=="handDrawn"&&b.selectChildren("path").attr("style",n),e.width=h,e.height=d,or(e,b),l.attr("transform",`translate(${-o.width/2-(o.x-(o.left??0))}, ${d/2-(o.height+(e.padding??0)/(u?2:1)-(o.y-(o.top??0)))})`),e.intersect=function(C){return se.info("Triangle intersect",e,p,C),Zt.polygon(e,p,C)},s}T(aK,"triangle");async function sK(t,e){const{labelStyles:r,nodeStyles:n}=Jt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,s=e.look==="neo"?12:i;let o=!0;(e.width||e.height)&&(o=!1,e.width=((e==null?void 0:e.width)??0)-a*2,e.width<10&&(e.width=10),e.height=((e==null?void 0:e.height)??0)-s*2,e.height<10&&(e.height=10));const{shapeSvg:l,bbox:u,label:h}=await Sr(t,e,Tr(e)),d=(e!=null&&e.width?e==null?void 0:e.width:u.width)+(a??0)*2,f=(e!=null&&e.height?e==null?void 0:e.height:u.height)+(s??0)*2,p=e.look==="neo"?f/4:f/8,g=f+(o?p:-p),{cssStyles:m}=e,v=14-d,x=v>0?v/2:0,b=er.svg(l),w=nr(e,{});e.look!=="handDrawn"&&(w.roughness=0,w.fillStyle="solid");const C=[{x:-d/2-x,y:g/2},...Ih(-d/2-x,g/2,d/2+x,g/2,p,.8),{x:d/2+x,y:-g/2},{x:-d/2-x,y:-g/2}],_=Jr(C),k=b.path(_,w),S=l.insert(()=>k,":first-child");return S.attr("class","basic label-container outer-path"),m&&e.look!=="handDrawn"&&S.selectAll("path").attr("style",m),n&&e.look!=="handDrawn"&&S.selectAll("path").attr("style",n),S.attr("transform",`translate(0,${-p/2})`),h.attr("transform",`translate(${-d/2+(e.padding??0)-(u.x-(u.left??0))},${-f/2+(e.padding??0)-p-(u.y-(u.top??0))})`),or(e,S),e.intersect=function(L){return Zt.polygon(e,C,L)},l}T(sK,"waveEdgedRectangle");async function oK(t,e){const{labelStyles:r,nodeStyles:n}=Jt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,s=e.look==="neo"?20:i;if(e.width||e.height){e.width=(e==null?void 0:e.width)??0,e.width<20&&(e.width=20),e.height=(e==null?void 0:e.height)??0,e.height<10&&(e.height=10);const w=Math.min(e.height*.2,e.height/4);e.height=Math.ceil(e.height-s-w*(20/9)),e.width=e.width-a*2}const{shapeSvg:o,bbox:l}=await Sr(t,e,Tr(e)),u=(e!=null&&e.width?e==null?void 0:e.width:l.width)+a*2,h=(e!=null&&e.height?e==null?void 0:e.height:l.height)+s,d=h/8,f=h+d*2,{cssStyles:p}=e,g=er.svg(o),m=nr(e,{});e.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=[{x:-u/2,y:f/2},...Ih(-u/2,f/2,u/2,f/2,d,1),{x:u/2,y:-f/2},...Ih(u/2,-f/2,-u/2,-f/2,d,-1)],v=Jr(y),x=g.path(v,m),b=o.insert(()=>x,":first-child");return b.attr("class","basic label-container"),p&&e.look!=="handDrawn"&&b.selectAll("path").attr("style",p),n&&e.look!=="handDrawn"&&b.selectAll("path").attr("style",n),or(e,b),e.intersect=function(w){return Zt.polygon(e,y,w)},o}T(oK,"waveRectangle");var Ci=10;async function lK(t,e){const{labelStyles:r,nodeStyles:n}=Jt(e);e.labelStyle=r;const i=e.look==="neo"?16:e.padding??0,a=e.look==="neo"?12:e.padding??0;(e.width||e.height)&&(e.width=Math.max(((e==null?void 0:e.width)??0)-i*2-Ci,10),e.height=Math.max(((e==null?void 0:e.height)??0)-a*2-Ci,10));const{shapeSvg:s,bbox:o,label:l}=await Sr(t,e,Tr(e)),u=(e!=null&&e.width?e==null?void 0:e.width:o.width)+i*2+Ci,h=(e!=null&&e.height?e==null?void 0:e.height:o.height)+a*2+Ci,d=u-Ci,f=h-Ci,p=-d/2,g=-f/2,{cssStyles:m}=e,y=er.svg(s),v=nr(e,{}),x=[{x:p-Ci,y:g-Ci},{x:p-Ci,y:g+f},{x:p+d,y:g+f},{x:p+d,y:g-Ci}],b=`M${p-Ci},${g-Ci} L${p+d},${g-Ci} L${p+d},${g+f} L${p-Ci},${g+f} L${p-Ci},${g-Ci} + M${p-Ci},${g} L${p+d},${g} + M${p},${g-Ci} L${p},${g+f}`;e.look!=="handDrawn"&&(v.roughness=0,v.fillStyle="solid");const w=y.path(b,v),C=s.insert(()=>w,":first-child");return C.attr("transform",`translate(${Ci/2}, ${Ci/2})`),C.attr("class","basic label-container outer-path"),m&&e.look!=="handDrawn"&&C.selectAll("path").attr("style",m),n&&e.look!=="handDrawn"&&C.selectAll("path").attr("style",n),l.attr("transform",`translate(${-(o.width/2)+Ci/2-(o.x-(o.left??0))}, ${-(o.height/2)+Ci/2-(o.y-(o.top??0))})`),or(e,C),e.intersect=function(_){return Zt.polygon(e,x,_)},s}T(lK,"windowPane");var cK=new Set(["redux-color","redux-dark-color"]),UIe=new Set(["redux","redux-dark","redux-color","redux-dark-color"]);async function Y8(t,e){var ie,j,ae,J;const r=e;r.alias&&(e.label=r.alias);const{theme:n,themeVariables:i}=pr(),{rowEven:a,rowOdd:s,nodeBorder:o,borderColorArray:l}=i;if(e.look==="handDrawn"){const{themeVariables:K}=pr(),{background:Q}=K,re={...e,id:e.id+"-background",domId:(e.domId||e.id)+"-background",look:"default",cssStyles:["stroke: none",`fill: ${Q}`]};await Y8(t,re)}const u=pr();e.useHtmlLabels=u.htmlLabels;let h=((ie=u.er)==null?void 0:ie.diagramPadding)??10,d=((j=u.er)==null?void 0:j.entityPadding)??6;const{cssStyles:f}=e,{labelStyles:p,nodeStyles:g}=Jt(e);if(r.attributes.length===0&&e.label){const K={rx:0,ry:0,labelPaddingX:h,labelPaddingY:h*1.5};gs(e.label,u)+K.labelPaddingX*20){const K=v.width+h*2-(C+_+k+S);C+=K/I,_+=K/I,k>0&&(k+=K/I),S>0&&(S+=K/I)}const F=C+_+k+S,A=er.svg(y),R=nr(e,{});e.look!=="handDrawn"&&(R.roughness=0,R.fillStyle="solid");let N=0;w.length>0&&(N=w.reduce((K,Q)=>K+((Q==null?void 0:Q.rowHeight)??0),0));const M=Math.max(z.width+h*2,(e==null?void 0:e.width)||0,F),D=Math.max((N??0)+v.height,(e==null?void 0:e.height)||0),O=-M/2,B=-D/2;if(y.selectAll("g:not(:first-child)").each((K,Q,re)=>{const le=gt(re[Q]),fe=le.attr("transform");let Ae=0,Se=0;if(fe){const ge=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(fe);ge&&(Ae=parseFloat(ge[1]),Se=parseFloat(ge[2]),le.attr("class").includes("attribute-name")?Ae+=C:le.attr("class").includes("attribute-keys")?Ae+=C+_:le.attr("class").includes("attribute-comment")&&(Ae+=C+_+k))}le.attr("transform",`translate(${O+h/2+Ae}, ${Se+B+v.height+d/2})`)}),y.select(".name").attr("transform","translate("+-v.width/2+", "+(B+d/2)+")"),n!=null&&cK.has(n)){const K=r.colorIndex??0;y.attr("data-color-id",`color-${K%l.length}`)}const P=A.rectangle(O,B,M,D,R),G=y.insert(()=>P,":first-child").attr("class","outer-path").attr("style",f.join(""));b.push(0);for(const[K,Q]of w.entries()){const le=(K+1)%2===0&&Q.yOffset!==0,fe=A.rectangle(O,v.height+B+(Q==null?void 0:Q.yOffset),M,Q==null?void 0:Q.rowHeight,{...R,fill:le?a:s,stroke:o});y.insert(()=>fe,"g.label").attr("style",f.join("")).attr("class",`row-rect-${le?"even":"odd"}`)}const V=1e-4;let H=dg(O,v.height+B,M+O,v.height+B,V),W=A.polygon(H.map(K=>[K.x,K.y]),R);if(y.insert(()=>W).attr("class","divider"),H=dg(C+O,v.height+B,C+O,D+B,V),W=A.polygon(H.map(K=>[K.x,K.y]),R),y.insert(()=>W).attr("class","divider"),L){const K=C+_+O;H=dg(K,v.height+B,K,D+B,V),W=A.polygon(H.map(Q=>[Q.x,Q.y]),R),y.insert(()=>W).attr("class","divider")}if($){const K=C+_+k+O;H=dg(K,v.height+B,K,D+B,V),W=A.polygon(H.map(Q=>[Q.x,Q.y]),R),y.insert(()=>W).attr("class","divider")}for(const K of b){const Q=v.height+B+K;H=dg(O,Q,M+O,Q,V),W=A.polygon(H.map(re=>[re.x,re.y]),R),y.insert(()=>W).attr("class","divider")}if(or(e,G),g&&e.look!=="handDrawn")if(n!=null&&UIe.has(n))y.selectAll("path").attr("style",g);else{const K=g.split(";"),Q=(J=K==null?void 0:K.filter(re=>re.includes("stroke")))==null?void 0:J.map(re=>`${re}`).join("; ");y.selectAll("path").attr("style",Q??""),y.selectAll(".row-rect-even path").attr("style",g)}return e.intersect=function(K){return Zt.rect(e,K)},y}T(Y8,"erBox");async function hg(t,e,r,n=0,i=0,a=[],s=""){const o=t.insert("g").attr("class",`label ${a.join(" ")}`).attr("transform",`translate(${n}, ${i})`).attr("style",s);e!==kh(e)&&(e=kh(e),e=e.replaceAll("<","<").replaceAll(">",">"));const l=o.node().appendChild(await ys(o,e,{width:gs(e,r)+100,style:s,useHtmlLabels:r.htmlLabels},r));if(e.includes("<")||e.includes(">")){let h=l.children[0];for(h.textContent=h.textContent.replaceAll("<","<").replaceAll(">",">");h.childNodes[0];)h=h.childNodes[0],h.textContent=h.textContent.replaceAll("<","<").replaceAll(">",">")}let u=l.getBBox();if(eu(r.htmlLabels)){const h=l.children[0];h.style.textAlign="start";const d=gt(l);u=h.getBoundingClientRect(),d.attr("width",u.width),d.attr("height",u.height)}return u}T(hg,"addText");function dg(t,e,r,n,i){return t===r?[{x:t-i/2,y:e},{x:t+i/2,y:e},{x:r+i/2,y:n},{x:r-i/2,y:n}]:[{x:t,y:e-i/2},{x:t,y:e+i/2},{x:r,y:n+i/2},{x:r,y:n-i/2}]}T(dg,"lineToPolygon");async function uK(t,e,r,n,i=r.class.padding??12){const a=n?0:3,s=t.insert("g").attr("class",Tr(e)).attr("id",e.domId||e.id);let o=null,l=null,u=null,h=null,d=0,f=0,p=0;if(o=s.insert("g").attr("class","annotation-group text"),e.annotations.length>0){const x=e.annotations[0];await $x(o,{text:`«${x}»`},0),d=o.node().getBBox().height}l=s.insert("g").attr("class","label-group text"),await $x(l,e,0,["font-weight: bolder"]);const g=l.node().getBBox();f=g.height,u=s.insert("g").attr("class","members-group text");let m=0;for(const x of e.members){const b=await $x(u,x,m,[x.parseClassifier()]);m+=b+a}p=u.node().getBBox().height,p<=0&&(p=i/2),h=s.insert("g").attr("class","methods-group text");let y=0;for(const x of e.methods){const b=await $x(h,x,y,[x.parseClassifier()]);y+=b+a}let v=s.node().getBBox();if(o!==null){const x=o.node().getBBox();o.attr("transform",`translate(${-x.width/2})`)}return l.attr("transform",`translate(${-g.width/2}, ${d})`),v=s.node().getBBox(),u.attr("transform",`translate(0, ${d+f+i*2})`),v=s.node().getBBox(),h.attr("transform",`translate(0, ${d+f+(p?p+i*4:i*2)})`),v=s.node().getBBox(),{shapeSvg:s,bbox:v}}T(uK,"textHelper");async function $x(t,e,r,n=[]){const i=t.insert("g").attr("class","label").attr("style",n.join("; ")),a=pr();let s="useHtmlLabels"in e?e.useHtmlLabels:eu(a.htmlLabels)??!0,o="";"text"in e?o=e.text:o=e.label,!s&&o.startsWith("\\")&&(o=o.substring(1)),Ii(o)&&(s=!0);const l=await ys(i,$7(uu(o)),{width:gs(o,a)+50,classes:"markdown-node-label",useHtmlLabels:s},a);let u,h=1;if(s){const d=l.children[0],f=gt(l);h=d.innerHTML.split("
    ").length,d.innerHTML.includes("")&&(h+=d.innerHTML.split("").length-1);const p=d.getElementsByTagName("img");if(p){const g=o.replace(/]*>/g,"").trim()==="";await Promise.all([...p].map(m=>new Promise(y=>{function v(){var x;if(m.style.display="flex",m.style.flexDirection="column",g){const b=((x=a.fontSize)==null?void 0:x.toString())??window.getComputedStyle(document.body).fontSize,C=parseInt(b,10)*5+"px";m.style.minWidth=C,m.style.maxWidth=C}else m.style.width="100%";y(m)}T(v,"setupImage"),setTimeout(()=>{m.complete&&v()}),m.addEventListener("error",v),m.addEventListener("load",v)})))}u=d.getBoundingClientRect(),f.attr("width",u.width),f.attr("height",u.height)}else{n.includes("font-weight: bolder")&>(l).selectAll("tspan").attr("font-weight",""),h=l.children.length;const d=l.children[0];(l.textContent===""||l.textContent.includes(">"))&&(d.textContent=o[0]+o.substring(1).replaceAll(">",">").replaceAll("<","<").trim(),o[1]===" "&&(d.textContent=d.textContent[0]+" "+d.textContent.substring(1))),d.textContent==="undefined"&&(d.textContent=""),u=l.getBBox()}return i.attr("transform","translate(0,"+(-u.height/(2*h)+r)+")"),u.height}T($x,"addText");async function hK(t,e){var A,R;const r=Pe(),{themeVariables:n}=r,{useGradient:i}=n,a=r.class.padding??12,s=a,o=e.useHtmlLabels??eu(r.htmlLabels)??!0,l=e;l.annotations=l.annotations??[],l.members=l.members??[],l.methods=l.methods??[];const{shapeSvg:u,bbox:h}=await uK(t,e,r,o,s),{labelStyles:d,nodeStyles:f}=Jt(e);e.labelStyle=d,e.cssStyles=l.styles||"";const p=((A=l.styles)==null?void 0:A.join(";"))||f||"";e.cssStyles||(e.cssStyles=p.replaceAll("!important","").split(";"));const g=l.members.length===0&&l.methods.length===0&&!((R=r.class)!=null&&R.hideEmptyMembersBox),m=er.svg(u),y=nr(e,{});e.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const v=Math.max(e.width??0,h.width);let x=Math.max(e.height??0,h.height);const b=(e.height??0)>h.height;l.members.length===0&&l.methods.length===0?x+=s:l.members.length>0&&l.methods.length===0&&(x+=s*2);const w=-v/2,C=-x/2;let _=g?a*2:l.members.length===0&&l.methods.length===0?-a:0;b&&(_=a*2);const k=m.rectangle(w-a,C-a-(g?a:l.members.length===0&&l.methods.length===0?-a/2:0),v+2*a,x+2*a+_,y),S=u.insert(()=>k,":first-child");S.attr("class","basic label-container outer-path");const L=S.node().getBBox(),$=u.select(".annotation-group").node().getBBox().height-(g?a/2:0)||0,I=u.select(".label-group").node().getBBox().height-(g?a/2:0)||0,z=u.select(".members-group").node().getBBox().height-(g?a/2:0)||0,F=($+I+C+a-(C-a-(g?a:l.members.length===0&&l.methods.length===0?-a/2:0)))/2;if(u.selectAll(".text").each((N,M,D)=>{var H,W;const O=gt(D[M]),B=O.attr("transform");let P=0;if(B){const j=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(B);j&&(P=parseFloat(j[2]))}let G=P+C+a-(g?a:l.members.length===0&&l.methods.length===0?-a/2:0);if(O.attr("class").includes("methods-group")){const ie=Math.max(z,s/2);b?G=Math.max(F,$+I+ie+C+s*2+a)+s*2:G=$+I+ie+C+s*4+a}l.members.length===0&&l.methods.length===0&&((H=r.class)!=null&&H.hideEmptyMembersBox)&&(l.annotations.length>0?G=P-s:G=P),o||(G-=4);let V=w;(O.attr("class").includes("label-group")||O.attr("class").includes("annotation-group"))&&(V=-((W=O.node())==null?void 0:W.getBBox().width)/2||0,u.selectAll("text").each(function(ie,j,ae){window.getComputedStyle(ae[j]).textAnchor==="middle"&&(V=0)})),O.attr("transform",`translate(${V}, ${G})`)}),l.members.length>0||l.methods.length>0||g){const N=$+I+C+a,M=m.line(L.x,N,L.x+L.width,N+.001,y);u.insert(()=>M).attr("class",`divider${e.look==="neo"&&!i?" neo-line":""}`).attr("style",p)}if(g||l.members.length>0||l.methods.length>0){const N=$+I+z+C+s*2+a,M=m.line(L.x,b?Math.max(F,N):N,L.x+L.width,(b?Math.max(F,N):N)+.001,y);u.insert(()=>M).attr("class",`divider${e.look==="neo"&&!i?" neo-line":""}`).attr("style",p)}if(l.look!=="handDrawn"&&u.selectAll("path").attr("style",p),S.select(":nth-child(2)").attr("style",p),u.selectAll(".divider").select("path").attr("style",p),e.labelStyle?u.selectAll("span").attr("style",e.labelStyle):u.selectAll("span").attr("style",p),!o){const N=RegExp(/color\s*:\s*([^;]*)/),M=N.exec(p);if(M){const D=M[0].replace("color","fill");u.selectAll("tspan").attr("style",D)}else if(d){const D=N.exec(d);if(D){const O=D[0].replace("color","fill");u.selectAll("tspan").attr("style",O)}}}return or(e,S),e.intersect=function(N){return Zt.rect(e,N)},u}T(hK,"classBox");async function dK(t,e){var L,$;const{labelStyles:r,nodeStyles:n}=Jt(e);e.labelStyle=r;const i=e,a=e,s=20,o=20,l="verifyMethod"in e,u=Tr(e),{themeVariables:h}=Pe(),{borderColorArray:d,requirementEdgeLabelBackground:f}=h,p=t.insert("g").attr("class",u).attr("id",e.domId??e.id);let g;l?g=await ac(p,`<<${i.type}>>`,0,e.labelStyle):g=await ac(p,"<<Element>>",0,e.labelStyle);let m=g;const y=await ac(p,i.name,m,e.labelStyle+"; font-weight: bold;");if(m+=y+o,l){const I=await ac(p,`${i.requirementId?`ID: ${i.requirementId}`:""}`,m,e.labelStyle);m+=I;const z=await ac(p,`${i.text?`Text: ${i.text}`:""}`,m,e.labelStyle);m+=z;const F=await ac(p,`${i.risk?`Risk: ${i.risk}`:""}`,m,e.labelStyle);m+=F,await ac(p,`${i.verifyMethod?`Verification: ${i.verifyMethod}`:""}`,m,e.labelStyle)}else{const I=await ac(p,`${a.type?`Type: ${a.type}`:""}`,m,e.labelStyle);m+=I,await ac(p,`${a.docRef?`Doc Ref: ${a.docRef}`:""}`,m,e.labelStyle)}const v=(((L=p.node())==null?void 0:L.getBBox().width)??200)+s,x=((($=p.node())==null?void 0:$.getBBox().height)??200)+s,b=-v/2,w=-x/2,C=er.svg(p),_=nr(e,{});e.look!=="handDrawn"&&(_.roughness=0,_.fillStyle="solid");const k=C.rectangle(b,w,v,x,_),S=p.insert(()=>k,":first-child");if(S.attr("class","basic label-container outer-path").attr("style",n),d!=null&&d.length){const I=e.colorIndex??0;p.attr("data-color-id",`color-${I%d.length}`)}if(p.selectAll(".label").each((I,z,F)=>{const A=gt(F[z]),R=A.attr("transform");let N=0,M=0;if(R){const P=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(R);P&&(N=parseFloat(P[1]),M=parseFloat(P[2]))}const D=M-x/2;let O=b+s/2;(z===0||z===1)&&(O=N),A.attr("transform",`translate(${O}, ${D+s})`)}),m>g+y+o){const I=w+g+y+o;let z;if(e.look==="neo"){const R=[[b,I],[b+v,I],[b+v,I+.001],[b,I+.001]];z=C.polygon(R,_)}else z=C.line(b,I,b+v,I,_);p.insert(()=>z).attr("class","divider")}return or(e,S),e.intersect=function(I){return Zt.rect(e,I)},n&&e.look!=="handDrawn"&&(f||d!=null&&d.length)&&p.selectAll("path").attr("style",n),p}T(dK,"requirementBox");async function ac(t,e,r,n=""){if(e==="")return 0;const i=t.insert("g").attr("class","label").attr("style",n),a=Pe(),s=a.htmlLabels??!0,o=await ys(i,$7(uu(e)),{width:gs(e,a)+50,classes:"markdown-node-label",useHtmlLabels:s,style:n},a);let l;if(s){const u=o.children[0],h=gt(o);l=u.getBoundingClientRect(),h.attr("width",l.width),h.attr("height",l.height)}else{const u=o.children[0];for(const h of u.children)n&&h.setAttribute("style",n);l=o.getBBox(),l.height+=6}return i.attr("transform",`translate(${-l.width/2},${-l.height/2+r})`),l.height}T(ac,"addText");var HIe=T(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 fK(t,e,{config:r}){var z,F;const{labelStyles:n,nodeStyles:i}=Jt(e);e.labelStyle=n||"";const a=10,s=e.width;e.width=(e.width??200)-10;const{shapeSvg:o,bbox:l,label:u}=await Sr(t,e,Tr(e)),h=e.padding||10;let d="",f;"ticket"in e&&e.ticket&&((z=r==null?void 0:r.kanban)!=null&&z.ticketBaseUrl)&&(d=(F=r==null?void 0:r.kanban)==null?void 0:F.ticketBaseUrl.replace("#TICKET#",e.ticket),f=o.insert("svg:a",":first-child").attr("class","kanban-ticket-link").attr("xlink:href",d).attr("target","_blank"));const p={useHtmlLabels:e.useHtmlLabels,labelStyle:e.labelStyle||"",width:e.width,img:e.img,padding:e.padding||8,centerLabel:!1};let g,m;f?{label:g,bbox:m}=await z8(f,"ticket"in e&&e.ticket||"",p):{label:g,bbox:m}=await z8(o,"ticket"in e&&e.ticket||"",p);const{label:y,bbox:v}=await z8(o,"assigned"in e&&e.assigned||"",p);e.width=s;const x=10,b=(e==null?void 0:e.width)||0,w=Math.max(m.height,v.height)/2,C=Math.max(l.height+x*2,(e==null?void 0:e.height)||0)+w,_=-b/2,k=-C/2;u.attr("transform","translate("+(h-b/2)+", "+(-w-l.height/2)+")"),g.attr("transform","translate("+(h-b/2)+", "+(-w+l.height/2)+")"),y.attr("transform","translate("+(h+b/2-v.width-2*a)+", "+(-w+l.height/2)+")");let S;const{rx:L,ry:$}=e,{cssStyles:I}=e;if(e.look==="handDrawn"){const A=er.svg(o),R=nr(e,{}),N=L||$?A.path(Mh(_,k,b,C,L||0),R):A.rectangle(_,k,b,C,R);S=o.insert(()=>N,":first-child"),S.attr("class","basic label-container").attr("style",I||null)}else{S=o.insert("rect",":first-child"),S.attr("class","basic label-container __APA__").attr("style",i).attr("rx",L??5).attr("ry",$??5).attr("x",_).attr("y",k).attr("width",b).attr("height",C);const A="priority"in e&&e.priority;if(A){const R=o.append("line"),N=_+2,M=k+Math.floor((L??0)/2),D=k+C-Math.floor((L??0)/2);R.attr("x1",N).attr("y1",M).attr("x2",N).attr("y2",D).attr("stroke-width","4").attr("stroke",HIe(A))}}return or(e,S),e.height=C,e.intersect=function(A){return Zt.rect(e,A)},o}T(fK,"kanbanItem");async function pK(t,e){const{labelStyles:r,nodeStyles:n}=Jt(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,halfPadding:s,label:o}=await Sr(t,e,Tr(e)),l=a.width+10*s,u=a.height+8*s,h=.15*l,{cssStyles:d}=e,f=a.width+20,p=a.height+20,g=Math.max(l,f),m=Math.max(u,p);o.attr("transform",`translate(${-a.width/2}, ${-a.height/2})`);let y;const v=`M0 0 a${h},${h} 1 0,0 ${g*.25},${-1*m*.1} a${h},${h} 1 0,0 ${g*.25},0 a${h},${h} 1 0,0 ${g*.25},0 @@ -253,7 +253,7 @@ Please report this to https://github.com/markedjs/marked.`,e){let i="

    An error a${h},${h} 1 0,0 ${-1*g*.1},${-1*m*.33} a${h*.8},${h*.8} 1 0,0 0,${-1*m*.34} a${h},${h} 1 0,0 ${g*.1},${-1*m*.33} - H0 V0 Z`;if(e.look==="handDrawn"){const T=Kt.svg(i),b=Qt(e,{}),w=T.path(v,b);y=i.insert(()=>w,":first-child"),y.attr("class","basic label-container").attr("style",Zi(d))}else y=i.insert("path",":first-child").attr("class","basic label-container").attr("style",n).attr("d",v);return y.attr("transform",`translate(${-g/2}, ${-m/2})`),rr(e,y),e.calcIntersect=function(T,b){return Ht.rect(T,b)},e.intersect=function(T){return ae.info("Bang intersect",e,T),Ht.rect(e,T)},i}x(FU,"bang");async function zU(t,e){const{labelStyles:r,nodeStyles:n}=Xt(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,halfPadding:s,label:o}=await xr(t,e,gr(e)),l=a.width+2*s,u=a.height+2*s,h=.15*l,d=.25*l,f=.35*l,p=.2*l,{cssStyles:g}=e;let m;const y=`M0 0 + H0 V0 Z`;if(e.look==="handDrawn"){const x=er.svg(i),b=nr(e,{}),w=x.path(v,b);y=i.insert(()=>w,":first-child"),y.attr("class","basic label-container").attr("style",xa(d))}else y=i.insert("path",":first-child").attr("class","basic label-container").attr("style",n).attr("d",v);return y.attr("transform",`translate(${-g/2}, ${-m/2})`),or(e,y),e.calcIntersect=function(x,b){return Zt.rect(x,b)},e.intersect=function(x){return se.info("Bang intersect",e,x),Zt.rect(e,x)},i}T(pK,"bang");async function gK(t,e){const{labelStyles:r,nodeStyles:n}=Jt(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,halfPadding:s,label:o}=await Sr(t,e,Tr(e)),l=a.width+2*s,u=a.height+2*s,h=.15*l,d=.25*l,f=.35*l,p=.2*l,{cssStyles:g}=e;let m;const y=`M0 0 a${h},${h} 0 0,1 ${l*.25},${-1*l*.1} a${f},${f} 1 0,1 ${l*.4},${-1*l*.1} a${d},${d} 1 0,1 ${l*.35},${l*.2} @@ -267,7 +267,7 @@ Please report this to https://github.com/markedjs/marked.`,e){let i="

    An error a${h},${h} 1 0,1 ${-1*l*.1},${-1*u*.35} a${p},${p} 1 0,1 ${l*.1},${-1*u*.65} - H0 V0 Z`;if(e.look==="handDrawn"){const v=Kt.svg(i),T=Qt(e,{}),b=v.path(y,T);m=i.insert(()=>b,":first-child"),m.attr("class","basic label-container").attr("style",Zi(g))}else m=i.insert("path",":first-child").attr("class","basic label-container").attr("style",n).attr("d",y);return o.attr("transform",`translate(${-a.width/2}, ${-a.height/2})`),m.attr("transform",`translate(${-l/2}, ${-u/2})`),rr(e,m),e.calcIntersect=function(v,T){return Ht.rect(v,T)},e.intersect=function(v){return ae.info("Cloud intersect",e,v),Ht.rect(e,v)},i}x(zU,"cloud");async function GU(t,e){const{labelStyles:r,nodeStyles:n}=Xt(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,halfPadding:s,label:o}=await xr(t,e,gr(e)),l=a.width+8*s,u=a.height+2*s,h=5,d=e.look==="neo"?` + H0 V0 Z`;if(e.look==="handDrawn"){const v=er.svg(i),x=nr(e,{}),b=v.path(y,x);m=i.insert(()=>b,":first-child"),m.attr("class","basic label-container").attr("style",xa(g))}else m=i.insert("path",":first-child").attr("class","basic label-container").attr("style",n).attr("d",y);return o.attr("transform",`translate(${-a.width/2}, ${-a.height/2})`),m.attr("transform",`translate(${-l/2}, ${-u/2})`),or(e,m),e.calcIntersect=function(v,x){return Zt.rect(v,x)},e.intersect=function(v){return se.info("Cloud intersect",e,v),Zt.rect(e,v)},i}T(gK,"cloud");async function mK(t,e){const{labelStyles:r,nodeStyles:n}=Jt(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,halfPadding:s,label:o}=await Sr(t,e,Tr(e)),l=a.width+8*s,u=a.height+2*s,h=5,d=e.look==="neo"?` M${-l/2} ${u/2-h} v${-u+2*h} q0,-${h} ${h},-${h} @@ -287,25 +287,26 @@ Please report this to https://github.com/markedjs/marked.`,e){let i="

    An error h${-(l-2*h)} q${-h},0 ${-h},${-h} Z - `;if(!e.domId)throw new Error(`defaultMindmapNode: node "${e.id}" is missing a domId — was render.ts domId prefixing skipped?`);const f=i.append("path").attr("id",e.domId).attr("class","node-bkg node-"+e.type).attr("style",n).attr("d",d);return i.append("line").attr("class","node-line-").attr("x1",-l/2).attr("y1",u/2).attr("x2",l/2).attr("y2",u/2),o.attr("transform",`translate(${-a.width/2}, ${-a.height/2})`),i.append(()=>o.node()),rr(e,f),e.calcIntersect=function(p,g){return Ht.rect(p,g)},e.intersect=function(p){return Ht.rect(e,p)},i}x(GU,"defaultMindmapNode");async function qU(t,e){const r={padding:e.padding??0};return H_(t,e,r)}x(qU,"mindmapCircle");var L6e=[{semanticName:"Process",name:"Rectangle",shortName:"rect",description:"Standard process shape",aliases:["proc","process","rectangle"],internalAliases:["squareRect"],handler:pU},{semanticName:"Event",name:"Rounded Rectangle",shortName:"rounded",description:"Represents an event",aliases:["event"],internalAliases:["roundedRect"],handler:hU},{semanticName:"Terminal Point",name:"Stadium",shortName:"stadium",description:"Terminal point",aliases:["terminal","pill"],handler:gU},{semanticName:"Subprocess",name:"Framed Rectangle",shortName:"fr-rect",description:"Subprocess",aliases:["subprocess","subproc","framed-rectangle","subroutine"],handler:bU},{semanticName:"Database",name:"Cylinder",shortName:"cyl",description:"Database storage",aliases:["db","database","cylinder"],handler:MW},{semanticName:"Data Store",name:"Data Store",shortName:"datastore",description:"Data flow diagram data store",aliases:["data-store"],handler:NW},{semanticName:"Start",name:"Circle",shortName:"circle",description:"Starting point",aliases:["circ"],handler:H_},{semanticName:"Bang",name:"Bang",shortName:"bang",description:"Bang",aliases:["bang"],handler:FU},{semanticName:"Cloud",name:"Cloud",shortName:"cloud",description:"cloud",aliases:["cloud"],handler:zU},{semanticName:"Decision",name:"Diamond",shortName:"diam",description:"Decision-making step",aliases:["decision","diamond","question"],handler:lU},{semanticName:"Prepare Conditional",name:"Hexagon",shortName:"hex",description:"Preparation or condition step",aliases:["hexagon","prepare"],handler:VW},{semanticName:"Data Input/Output",name:"Lean Right",shortName:"lean-r",description:"Represents input or output",aliases:["lean-right","in-out"],internalAliases:["lean_right"],handler:JW},{semanticName:"Data Input/Output",name:"Lean Left",shortName:"lean-l",description:"Represents output or input",aliases:["lean-left","out-in"],internalAliases:["lean_left"],handler:QW},{semanticName:"Priority Action",name:"Trapezoid Base Bottom",shortName:"trap-b",description:"Priority action",aliases:["priority","trapezoid-bottom","trapezoid"],handler:SU},{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:jW},{semanticName:"Stop",name:"Double Circle",shortName:"dbl-circ",description:"Represents a stop point",aliases:["double-circle"],internalAliases:["doublecircle"],handler:$W},{semanticName:"Text Block",name:"Text Block",shortName:"text",description:"Text block",handler:wU},{semanticName:"Card",name:"Notched Rectangle",shortName:"notch-rect",description:"Represents a card",aliases:["card","notched-rectangle"],handler:CW},{semanticName:"Lined/Shaded Process",name:"Lined Rectangle",shortName:"lin-rect",description:"Lined process shape",aliases:["lined-rectangle","lined-process","lin-proc","shaded-process"],handler:dU},{semanticName:"Start",name:"Small Circle",shortName:"sm-circ",description:"Small starting point",aliases:["start","small-circle"],internalAliases:["stateStart"],handler:vU},{semanticName:"Stop",name:"Framed Circle",shortName:"fr-circ",description:"Stop point",aliases:["stop","framed-circle"],internalAliases:["stateEnd"],handler:yU},{semanticName:"Fork/Join",name:"Filled Rectangle",shortName:"fork",description:"Fork or join in process flow",aliases:["join"],internalAliases:["forkJoin"],handler:GW},{semanticName:"Collate",name:"Hourglass",shortName:"hourglass",description:"Represents a collate operation",aliases:["hourglass","collate"],handler:WW},{semanticName:"Comment",name:"Curly Brace",shortName:"brace",description:"Adds a comment",aliases:["comment","brace-l"],handler:AW},{semanticName:"Comment Right",name:"Curly Brace",shortName:"brace-r",description:"Adds a comment",handler:_W},{semanticName:"Comment with braces on both sides",name:"Curly Braces",shortName:"braces",description:"Adds a comment",handler:RW},{semanticName:"Com Link",name:"Lightning Bolt",shortName:"bolt",description:"Communication link",aliases:["com-link","lightning-bolt"],handler:eU},{semanticName:"Document",name:"Document",shortName:"doc",description:"Represents a document",aliases:["doc","document"],handler:IU},{semanticName:"Delay",name:"Half-Rounded Rectangle",shortName:"delay",description:"Represents a delay",aliases:["half-rounded-rectangle"],handler:qW},{semanticName:"Direct Access Storage",name:"Horizontal Cylinder",shortName:"h-cyl",description:"Direct access storage",aliases:["das","horizontal-cylinder"],handler:EU},{semanticName:"Disk Storage",name:"Lined Cylinder",shortName:"lin-cyl",description:"Disk storage",aliases:["disk","lined-cylinder"],handler:nU},{semanticName:"Display",name:"Curved Trapezoid",shortName:"curv-trap",description:"Represents a display",aliases:["curved-trapezoid","display"],handler:LW},{semanticName:"Divided Process",name:"Divided Rectangle",shortName:"div-rect",description:"Divided process shape",aliases:["div-proc","divided-rectangle","divided-process"],handler:OW},{semanticName:"Extract",name:"Triangle",shortName:"tri",description:"Extraction process",aliases:["extract","triangle"],handler:LU},{semanticName:"Internal Storage",name:"Window Pane",shortName:"win-pane",description:"Internal storage",aliases:["internal-storage","window-pane"],handler:MU},{semanticName:"Junction",name:"Filled Circle",shortName:"f-circ",description:"Junction point",aliases:["junction","filled-circle"],handler:PW},{semanticName:"Loop Limit",name:"Trapezoidal Pentagon",shortName:"notch-pent",description:"Loop limit step",aliases:["loop-limit","notched-pentagon"],handler:AU},{semanticName:"Manual File",name:"Flipped Triangle",shortName:"flip-tri",description:"Manual file operation",aliases:["manual-file","flipped-triangle"],handler:zW},{semanticName:"Manual Input",name:"Sloped Rectangle",shortName:"sl-rect",description:"Manual input step",aliases:["manual-input","sloped-rectangle"],handler:fU},{semanticName:"Multi-Document",name:"Stacked Document",shortName:"docs",description:"Multiple documents",aliases:["documents","st-doc","stacked-document"],handler:sU},{semanticName:"Multi-Process",name:"Stacked Rectangle",shortName:"st-rect",description:"Multiple processes",aliases:["procs","processes","stacked-rectangle"],handler:aU},{semanticName:"Stored Data",name:"Bow Tie Rectangle",shortName:"bow-rect",description:"Stored data",aliases:["stored-data","bow-tie-rectangle"],handler:wW},{semanticName:"Summary",name:"Crossed Circle",shortName:"cross-circ",description:"Summary",aliases:["summary","crossed-circle"],handler:SW},{semanticName:"Tagged Document",name:"Tagged Document",shortName:"tag-doc",description:"Tagged document",aliases:["tag-doc","tagged-document"],handler:TU},{semanticName:"Tagged Process",name:"Tagged Rectangle",shortName:"tag-rect",description:"Tagged process",aliases:["tagged-rectangle","tag-proc","tagged-process"],handler:xU},{semanticName:"Paper Tape",name:"Flag",shortName:"flag",description:"Paper tape",aliases:["paper-tape"],handler:DU},{semanticName:"Odd",name:"Odd",shortName:"odd",description:"Odd shape",internalAliases:["rect_left_inv_arrow"],handler:cU},{semanticName:"Lined Document",name:"Lined Document",shortName:"lin-doc",description:"Lined document",aliases:["lined-document"],handler:iU}],I6e=x(()=>{const e=[...Object.entries({state:mU,choice:kW,note:oU,rectWithTitle:uU,labelRect:ZW,iconSquare:XW,iconCircle:HW,icon:UW,iconRounded:YW,imageSquare:KW,anchor:xW,kanbanItem:BU,mindmapCircle:qU,defaultMindmapNode:GU,classBox:$U,erBox:X_,requirementBox:PU}),...L6e.flatMap(r=>[r.shortName,..."aliases"in r?r.aliases:[],..."internalAliases"in r?r.internalAliases:[]].map(i=>[i,r.handler]))];return Object.fromEntries(e)},"generateShapeMap"),VU=I6e();function WU(t){return t in VU}x(WU,"isValidShape");var rC=new Map;async function nC(t,e,r){let n,i;e.shape==="rect"&&(e.rx&&e.ry?e.shape="roundedRect":e.shape="squareRect");const a=e.shape?VU[e.shape]:void 0;if(!a)throw new Error(`No such shape: ${e.shape}. Please check your syntax.`);if(e.link){let s;r.config.securityLevel==="sandbox"?s="_top":e.linkTarget&&(s=e.linkTarget||"_blank"),n=t.insert("svg:a").attr("xlink:href",e.link).attr("target",s??null),i=await a(n,e,r)}else i=await a(t,e,r),n=i;return n.attr("data-look",Zi(e.look)),e.tooltip&&i.attr("title",e.tooltip),rC.set(e.id,n),e.haveCallback&&n.attr("class",n.attr("class")+" clickable"),n}x(nC,"insertNode");var D6e=x((t,e)=>{rC.set(e.id,t)},"setNodeElem"),M6e=x(()=>{rC.clear()},"clear"),K_=x(t=>{const e=rC.get(t.id);ae.trace("Transforming node",t.diff,t,"translate("+(t.x-t.width/2-5)+", "+t.width/2+")");const r=8,n=t.diff||0;return t.clusterNode?e.attr("transform","translate("+(t.x+n-t.width/2)+", "+(t.y-t.height/2-r)+")"):e.attr("transform","translate("+t.x+", "+t.y+")"),n},"positionNode"),N6e=x((t,e,r,n,i,a=!1,s)=>{e.arrowTypeStart&&UU(t,"start",e.arrowTypeStart,r,n,i,a,s),e.arrowTypeEnd&&UU(t,"end",e.arrowTypeEnd,r,n,i,a,s)},"addEdgeMarkers"),O6e={arrow_cross:{type:"cross",fill:!1},arrow_point:{type:"point",fill:!0},arrow_barb:{type:"barb",fill:!0},arrow_barb_neo:{type:"barb",fill:!0},arrow_circle:{type:"circle",fill:!1},aggregation:{type:"aggregation",fill:!1},extension:{type:"extension",fill:!1},composition:{type:"composition",fill:!0},dependency:{type:"dependency",fill:!0},lollipop:{type:"lollipop",fill:!1},only_one:{type:"onlyOne",fill:!1},zero_or_one:{type:"zeroOrOne",fill:!1},one_or_more:{type:"oneOrMore",fill:!1},zero_or_more:{type:"zeroOrMore",fill:!1},requirement_arrow:{type:"requirement_arrow",fill:!1},requirement_contains:{type:"requirement_contains",fill:!1}},$6e=["cross","point","circle","lollipop","aggregation","extension","composition","dependency","barb"],UU=x((t,e,r,n,i,a,s=!1,o)=>{var g;const l=O6e[r],u=l&&$6e.includes(l.type);if(!l){ae.warn(`Unknown arrow type: ${r}`);return}const h=l.type,p=`${i}_${a}-${h}${e==="start"?"Start":"End"}${s&&u?"-margin":""}`;if(o&&o.trim()!==""){const m=o.replace(/[^\dA-Za-z]/g,"_"),y=`${p}_${m}`;if(!document.getElementById(y)){const v=document.getElementById(p);if(v){const T=v.cloneNode(!0);T.id=y,T.querySelectorAll("path, circle, line").forEach(w=>{w.setAttribute("stroke",o),l.fill&&w.setAttribute("fill",o)}),(g=v.parentNode)==null||g.appendChild(T)}}t.attr(`marker-${e}`,`url(${n}#${y})`)}else t.attr(`marker-${e}`,`url(${n}#${p})`)},"addEdgeMarker"),P6e=x(t=>{var e,r;return typeof t=="string"?t:(r=(e=Pe())==null?void 0:e.flowchart)==null?void 0:r.curve},"resolveEdgeCurveType"),iC=new Map,ua=new Map,B6e=x(()=>{iC.clear(),ua.clear()},"clear"),nb=x(t=>t?typeof t=="string"?t:t.reduce((e,r)=>e+";"+r,""):"","getLabelStyles"),HU=x(async(t,e)=>{const r=Pe();let n=on(r);const{labelStyles:i}=Xt(e);e.labelStyle=i;const a=t.insert("g").attr("class","edgeLabel"),s=a.insert("g").attr("class","label").attr("data-id",e.id),o=e.labelType==="markdown",u=await Wa(t,e.label,{style:nb(e.labelStyle),useHtmlLabels:n,addSvgBackground:!0,isNode:!1,markdown:o,width:o?void 0:void 0},r);s.node().appendChild(u),ae.info("abc82",e,e.labelType);let h=u.getBBox(),d=h;if(n){const p=u.children[0],g=pt(u);h=p.getBoundingClientRect(),d=h,g.attr("width",h.width),g.attr("height",h.height)}else{const p=pt(u).select("text").node();p&&typeof p.getBBox=="function"&&(d=p.getBBox())}s.attr("transform",yl(d,n)),iC.set(e.id,a),e.width=h.width,e.height=h.height;let f;if(e.startLabelLeft){const p=t.insert("g").attr("class","edgeTerminals"),g=p.insert("g").attr("class","inner"),m=await Mu(g,e.startLabelLeft,nb(e.labelStyle)||"",!1,!1);f=m;let y=m.getBBox();if(n){const v=m.children[0],T=pt(m);y=v.getBoundingClientRect(),T.attr("width",y.width),T.attr("height",y.height)}g.attr("transform",yl(y,n)),ua.get(e.id)||ua.set(e.id,{}),ua.get(e.id).startLeft=p,ib(f,e.startLabelLeft)}if(e.startLabelRight){const p=t.insert("g").attr("class","edgeTerminals"),g=p.insert("g").attr("class","inner"),m=await Mu(g,e.startLabelRight,nb(e.labelStyle)||"",!1,!1);f=m;let y=m.getBBox();if(n){const v=m.children[0],T=pt(m);y=v.getBoundingClientRect(),T.attr("width",y.width),T.attr("height",y.height)}g.attr("transform",yl(y,n)),ua.get(e.id)||ua.set(e.id,{}),ua.get(e.id).startRight=p,ib(f,e.startLabelRight)}if(e.endLabelLeft){const p=t.insert("g").attr("class","edgeTerminals"),g=p.insert("g").attr("class","inner"),m=await Mu(p,e.endLabelLeft,nb(e.labelStyle)||"",!1,!1);f=m;let y=m.getBBox();if(n){const v=m.children[0],T=pt(m);y=v.getBoundingClientRect(),T.attr("width",y.width),T.attr("height",y.height)}g.attr("transform",yl(y,n)),ua.get(e.id)||ua.set(e.id,{}),ua.get(e.id).endLeft=p,ib(f,e.endLabelLeft)}if(e.endLabelRight){const p=t.insert("g").attr("class","edgeTerminals"),g=p.insert("g").attr("class","inner"),m=await Mu(p,e.endLabelRight,nb(e.labelStyle)||"",!1,!1);f=m;let y=m.getBBox();if(n){const v=m.children[0],T=pt(m);y=v.getBoundingClientRect(),T.attr("width",y.width),T.attr("height",y.height)}g.attr("transform",yl(y,n)),ua.get(e.id)||ua.set(e.id,{}),ua.get(e.id).endRight=p,ib(f,e.endLabelRight)}return u},"insertEdgeLabel");function ib(t,e){on(Pe())&&t&&(t.style.width=e.length*9+"px",t.style.height="12px")}x(ib,"setTerminalWidth");var YU=x((t,e)=>{ae.debug("Moving label abc88 ",t.id,t.label,iC.get(t.id),e);let r=e.updatedPath?e.updatedPath:e.originalPath;const n=Pe(),{subGraphTitleTotalMargin:i}=H2(n);if(t.label){const a=iC.get(t.id);let s=t.x,o=t.y;if(r){const l=Lr.calcLabelPosition(r);ae.debug("Moving label "+t.label+" from (",s,",",o,") to (",l.x,",",l.y,") abc88"),e.updatedPath&&(s=l.x,o=l.y)}a.attr("transform",`translate(${s}, ${o+i/2})`)}if(t.startLabelLeft){const a=ua.get(t.id).startLeft;let s=t.x,o=t.y;if(r){const l=Lr.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_left",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}if(t.startLabelRight){const a=ua.get(t.id).startRight;let s=t.x,o=t.y;if(r){const l=Lr.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_right",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}if(t.endLabelLeft){const a=ua.get(t.id).endLeft;let s=t.x,o=t.y;if(r){const l=Lr.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_left",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}if(t.endLabelRight){const a=ua.get(t.id).endRight;let s=t.x,o=t.y;if(r){const l=Lr.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_right",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}},"positionEdgeLabel"),F6e=x((t,e)=>{const r=t.x,n=t.y,i=Math.abs(e.x-r),a=Math.abs(e.y-n),s=t.width/2,o=t.height/2;return i>=s||a>=o},"outsideNode"),z6e=x((t,e,r)=>{ae.debug(`intersection calc abc89: + `;if(!e.domId)throw new Error(`defaultMindmapNode: node "${e.id}" is missing a domId — was render.ts domId prefixing skipped?`);const f=i.append("path").attr("id",e.domId).attr("class","node-bkg node-"+e.type).attr("style",n).attr("d",d);return i.append("line").attr("class","node-line-").attr("x1",-l/2).attr("y1",u/2).attr("x2",l/2).attr("y2",u/2),o.attr("transform",`translate(${-a.width/2}, ${-a.height/2})`),i.append(()=>o.node()),or(e,f),e.calcIntersect=function(p,g){return Zt.rect(p,g)},e.intersect=function(p){return Zt.rect(e,p)},i}T(mK,"defaultMindmapNode");async function yK(t,e){const r={padding:e.padding??0};return U8(t,e,r)}T(yK,"mindmapCircle");var YIe=[{semanticName:"Process",name:"Rectangle",shortName:"rect",description:"Standard process shape",aliases:["proc","process","rectangle"],internalAliases:["squareRect"],handler:Vj},{semanticName:"Event",name:"Rounded Rectangle",shortName:"rounded",description:"Represents an event",aliases:["event"],internalAliases:["roundedRect"],handler:zj},{semanticName:"Terminal Point",name:"Stadium",shortName:"stadium",description:"Terminal point",aliases:["terminal","pill"],handler:Wj},{semanticName:"Subprocess",name:"Framed Rectangle",shortName:"fr-rect",description:"Subprocess",aliases:["subprocess","subproc","framed-rectangle","subroutine"],handler:Xj},{semanticName:"Database",name:"Cylinder",shortName:"cyl",description:"Database storage",aliases:["db","database","cylinder"],handler:lj},{semanticName:"Data Store",name:"Data Store",shortName:"datastore",description:"Data flow diagram data store",aliases:["data-store"],handler:cj},{semanticName:"Start",name:"Circle",shortName:"circle",description:"Starting point",aliases:["circ"],handler:U8},{semanticName:"Bang",name:"Bang",shortName:"bang",description:"Bang",aliases:["bang"],handler:pK},{semanticName:"Cloud",name:"Cloud",shortName:"cloud",description:"cloud",aliases:["cloud"],handler:gK},{semanticName:"Decision",name:"Diamond",shortName:"diam",description:"Decision-making step",aliases:["decision","diamond","question"],handler:Pj},{semanticName:"Prepare Conditional",name:"Hexagon",shortName:"hex",description:"Preparation or condition step",aliases:["hexagon","prepare"],handler:vj},{semanticName:"Data Input/Output",name:"Lean Right",shortName:"lean-r",description:"Represents input or output",aliases:["lean-right","in-out"],internalAliases:["lean_right"],handler:Aj},{semanticName:"Data Input/Output",name:"Lean Left",shortName:"lean-l",description:"Represents output or input",aliases:["lean-left","out-in"],internalAliases:["lean_left"],handler:_j},{semanticName:"Priority Action",name:"Trapezoid Base Bottom",shortName:"trap-b",description:"Priority action",aliases:["priority","trapezoid-bottom","trapezoid"],handler:tK},{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:Ej},{semanticName:"Stop",name:"Double Circle",shortName:"dbl-circ",description:"Represents a stop point",aliases:["double-circle"],internalAliases:["doublecircle"],handler:hj},{semanticName:"Text Block",name:"Text Block",shortName:"text",description:"Text block",handler:Zj},{semanticName:"Card",name:"Notched Rectangle",shortName:"notch-rect",description:"Represents a card",aliases:["card","notched-rectangle"],handler:QX},{semanticName:"Lined/Shaded Process",name:"Lined Rectangle",shortName:"lin-rect",description:"Lined process shape",aliases:["lined-rectangle","lined-process","lin-proc","shaded-process"],handler:Gj},{semanticName:"Start",name:"Small Circle",shortName:"sm-circ",description:"Small starting point",aliases:["start","small-circle"],internalAliases:["stateStart"],handler:Yj},{semanticName:"Stop",name:"Framed Circle",shortName:"fr-circ",description:"Stop point",aliases:["stop","framed-circle"],internalAliases:["stateEnd"],handler:Hj},{semanticName:"Fork/Join",name:"Filled Rectangle",shortName:"fork",description:"Fork or join in process flow",aliases:["join"],internalAliases:["forkJoin"],handler:mj},{semanticName:"Collate",name:"Hourglass",shortName:"hourglass",description:"Represents a collate operation",aliases:["hourglass","collate"],handler:bj},{semanticName:"Comment",name:"Curly Brace",shortName:"brace",description:"Adds a comment",aliases:["comment","brace-l"],handler:rj},{semanticName:"Comment Right",name:"Curly Brace",shortName:"brace-r",description:"Adds a comment",handler:nj},{semanticName:"Comment with braces on both sides",name:"Curly Braces",shortName:"braces",description:"Adds a comment",handler:ij},{semanticName:"Com Link",name:"Lightning Bolt",shortName:"bolt",description:"Communication link",aliases:["com-link","lightning-bolt"],handler:Rj},{semanticName:"Document",name:"Document",shortName:"doc",description:"Represents a document",aliases:["doc","document"],handler:sK},{semanticName:"Delay",name:"Half-Rounded Rectangle",shortName:"delay",description:"Represents a delay",aliases:["half-rounded-rectangle"],handler:yj},{semanticName:"Direct Access Storage",name:"Horizontal Cylinder",shortName:"h-cyl",description:"Direct access storage",aliases:["das","horizontal-cylinder"],handler:eK},{semanticName:"Disk Storage",name:"Lined Cylinder",shortName:"lin-cyl",description:"Disk storage",aliases:["disk","lined-cylinder"],handler:Dj},{semanticName:"Display",name:"Curved Trapezoid",shortName:"curv-trap",description:"Represents a display",aliases:["curved-trapezoid","display"],handler:aj},{semanticName:"Divided Process",name:"Divided Rectangle",shortName:"div-rect",description:"Divided process shape",aliases:["div-proc","divided-rectangle","divided-process"],handler:uj},{semanticName:"Extract",name:"Triangle",shortName:"tri",description:"Extraction process",aliases:["extract","triangle"],handler:aK},{semanticName:"Internal Storage",name:"Window Pane",shortName:"win-pane",description:"Internal storage",aliases:["internal-storage","window-pane"],handler:lK},{semanticName:"Junction",name:"Filled Circle",shortName:"f-circ",description:"Junction point",aliases:["junction","filled-circle"],handler:dj},{semanticName:"Loop Limit",name:"Trapezoidal Pentagon",shortName:"notch-pent",description:"Loop limit step",aliases:["loop-limit","notched-pentagon"],handler:rK},{semanticName:"Manual File",name:"Flipped Triangle",shortName:"flip-tri",description:"Manual file operation",aliases:["manual-file","flipped-triangle"],handler:gj},{semanticName:"Manual Input",name:"Sloped Rectangle",shortName:"sl-rect",description:"Manual input step",aliases:["manual-input","sloped-rectangle"],handler:qj},{semanticName:"Multi-Document",name:"Stacked Document",shortName:"docs",description:"Multiple documents",aliases:["documents","st-doc","stacked-document"],handler:$j},{semanticName:"Multi-Process",name:"Stacked Rectangle",shortName:"st-rect",description:"Multiple processes",aliases:["procs","processes","stacked-rectangle"],handler:Nj},{semanticName:"Stored Data",name:"Bow Tie Rectangle",shortName:"bow-rect",description:"Stored data",aliases:["stored-data","bow-tie-rectangle"],handler:ZX},{semanticName:"Summary",name:"Crossed Circle",shortName:"cross-circ",description:"Summary",aliases:["summary","crossed-circle"],handler:tj},{semanticName:"Tagged Document",name:"Tagged Document",shortName:"tag-doc",description:"Tagged document",aliases:["tag-doc","tagged-document"],handler:Kj},{semanticName:"Tagged Process",name:"Tagged Rectangle",shortName:"tag-rect",description:"Tagged process",aliases:["tagged-rectangle","tag-proc","tagged-process"],handler:jj},{semanticName:"Paper Tape",name:"Flag",shortName:"flag",description:"Paper tape",aliases:["paper-tape"],handler:oK},{semanticName:"Odd",name:"Odd",shortName:"odd",description:"Odd shape",internalAliases:["rect_left_inv_arrow"],handler:Bj},{semanticName:"Lined Document",name:"Lined Document",shortName:"lin-doc",description:"Lined document",aliases:["lined-document"],handler:Mj}],XIe=T(()=>{const e=[...Object.entries({state:Uj,choice:JX,note:Oj,rectWithTitle:Fj,labelRect:Sj,iconSquare:Cj,iconCircle:Tj,icon:xj,iconRounded:wj,imageSquare:kj,anchor:jX,kanbanItem:fK,mindmapCircle:yK,defaultMindmapNode:mK,classBox:hK,erBox:Y8,requirementBox:dK}),...YIe.flatMap(r=>[r.shortName,..."aliases"in r?r.aliases:[],..."internalAliases"in r?r.internalAliases:[]].map(i=>[i,r.handler]))];return Object.fromEntries(e)},"generateShapeMap"),vK=XIe();function bK(t){return t in vK}T(bK,"isValidShape");var cE=new Map;async function uE(t,e,r){let n,i;e.shape==="rect"&&(e.rx&&e.ry?e.shape="roundedRect":e.shape="squareRect");const a=e.shape?vK[e.shape]:void 0;if(!a)throw new Error(`No such shape: ${e.shape}. Please check your syntax.`);if(e.link){let s;r.config.securityLevel==="sandbox"?s="_top":e.linkTarget&&(s=e.linkTarget||"_blank"),n=t.insert("svg:a").attr("xlink:href",e.link).attr("target",s??null),i=await a(n,e,r)}else i=await a(t,e,r),n=i;return n.attr("data-look",xa(e.look)),e.tooltip&&i.attr("title",e.tooltip),cE.set(e.id,n),e.haveCallback&&n.attr("class",n.attr("class")+" clickable"),n}T(uE,"insertNode");var jIe=T((t,e)=>{cE.set(e.id,t)},"setNodeElem"),KIe=T(()=>{cE.clear()},"clear"),X8=T(t=>{const e=cE.get(t.id);se.trace("Transforming node",t.diff,t,"translate("+(t.x-t.width/2-5)+", "+t.width/2+")");const r=8,n=t.diff||0;return t.clusterNode?e.attr("transform","translate("+(t.x+n-t.width/2)+", "+(t.y-t.height/2-r)+")"):e.attr("transform","translate("+t.x+", "+t.y+")"),n},"positionNode"),ZIe=T((t,e,r,n,i,a=!1,s)=>{e.arrowTypeStart&&xK(t,"start",e.arrowTypeStart,r,n,i,a,s),e.arrowTypeEnd&&xK(t,"end",e.arrowTypeEnd,r,n,i,a,s)},"addEdgeMarkers"),QIe={arrow_cross:{type:"cross",fill:!1},arrow_point:{type:"point",fill:!0},arrow_barb:{type:"barb",fill:!0},arrow_barb_neo:{type:"barb",fill:!0},arrow_circle:{type:"circle",fill:!1},aggregation:{type:"aggregation",fill:!1},extension:{type:"extension",fill:!1},composition:{type:"composition",fill:!0},dependency:{type:"dependency",fill:!0},lollipop:{type:"lollipop",fill:!1},only_one:{type:"onlyOne",fill:!1},zero_or_one:{type:"zeroOrOne",fill:!1},one_or_more:{type:"oneOrMore",fill:!1},zero_or_more:{type:"zeroOrMore",fill:!1},requirement_arrow:{type:"requirement_arrow",fill:!1},requirement_contains:{type:"requirement_contains",fill:!1}},JIe=["cross","point","circle","lollipop","aggregation","extension","composition","dependency","barb"],xK=T((t,e,r,n,i,a,s=!1,o)=>{var g;const l=QIe[r],u=l&&JIe.includes(l.type);if(!l){se.warn(`Unknown arrow type: ${r}`);return}const h=l.type,p=`${i}_${a}-${h}${e==="start"?"Start":"End"}${s&&u?"-margin":""}`;if(o&&o.trim()!==""){const m=o.replace(/[^\dA-Za-z]/g,"_"),y=`${p}_${m}`;if(!document.getElementById(y)){const v=document.getElementById(p);if(v){const x=v.cloneNode(!0);x.id=y,x.querySelectorAll("path, circle, line").forEach(w=>{w.setAttribute("stroke",o),l.fill&&w.setAttribute("fill",o)}),(g=v.parentNode)==null||g.appendChild(x)}}t.attr(`marker-${e}`,`url(${n}#${y})`)}else t.attr(`marker-${e}`,`url(${n}#${p})`)},"addEdgeMarker"),eDe=T(t=>{var e,r;return typeof t=="string"?t:(r=(e=Pe())==null?void 0:e.flowchart)==null?void 0:r.curve},"resolveEdgeCurveType"),hE=new Map,Ma=new Map,tDe=T(()=>{hE.clear(),Ma.clear()},"clear"),Ox=T(t=>t?typeof t=="string"?t:t.reduce((e,r)=>e+";"+r,""):"","getLabelStyles"),TK=T(async(t,e)=>{const r=Pe();let n=mn(r);const{labelStyles:i}=Jt(e);e.labelStyle=i;const a=t.insert("g").attr("class","edgeLabel"),s=a.insert("g").attr("class","label").attr("data-id",e.id),o=e.labelType==="markdown",u=await ys(t,e.label,{style:Ox(e.labelStyle),useHtmlLabels:n,addSvgBackground:!0,isNode:!1,markdown:o,width:o?void 0:void 0},r);s.node().appendChild(u),se.info("abc82",e,e.labelType);let h=u.getBBox(),d=h;if(n){const p=u.children[0],g=gt(u);h=p.getBoundingClientRect(),d=h,g.attr("width",h.width),g.attr("height",h.height)}else{const p=gt(u).select("text").node();p&&typeof p.getBBox=="function"&&(d=p.getBBox())}s.attr("transform",nc(d,n)),hE.set(e.id,a),e.width=h.width,e.height=h.height;let f;if(e.startLabelLeft){const p=t.insert("g").attr("class","edgeTerminals"),g=p.insert("g").attr("class","inner"),m=await Dh(g,e.startLabelLeft,Ox(e.labelStyle)||"",!1,!1);f=m;let y=m.getBBox();if(n){const v=m.children[0],x=gt(m);y=v.getBoundingClientRect(),x.attr("width",y.width),x.attr("height",y.height)}g.attr("transform",nc(y,n)),Ma.get(e.id)||Ma.set(e.id,{}),Ma.get(e.id).startLeft=p,Px(f,e.startLabelLeft)}if(e.startLabelRight){const p=t.insert("g").attr("class","edgeTerminals"),g=p.insert("g").attr("class","inner"),m=await Dh(g,e.startLabelRight,Ox(e.labelStyle)||"",!1,!1);f=m;let y=m.getBBox();if(n){const v=m.children[0],x=gt(m);y=v.getBoundingClientRect(),x.attr("width",y.width),x.attr("height",y.height)}g.attr("transform",nc(y,n)),Ma.get(e.id)||Ma.set(e.id,{}),Ma.get(e.id).startRight=p,Px(f,e.startLabelRight)}if(e.endLabelLeft){const p=t.insert("g").attr("class","edgeTerminals"),g=p.insert("g").attr("class","inner"),m=await Dh(p,e.endLabelLeft,Ox(e.labelStyle)||"",!1,!1);f=m;let y=m.getBBox();if(n){const v=m.children[0],x=gt(m);y=v.getBoundingClientRect(),x.attr("width",y.width),x.attr("height",y.height)}g.attr("transform",nc(y,n)),Ma.get(e.id)||Ma.set(e.id,{}),Ma.get(e.id).endLeft=p,Px(f,e.endLabelLeft)}if(e.endLabelRight){const p=t.insert("g").attr("class","edgeTerminals"),g=p.insert("g").attr("class","inner"),m=await Dh(p,e.endLabelRight,Ox(e.labelStyle)||"",!1,!1);f=m;let y=m.getBBox();if(n){const v=m.children[0],x=gt(m);y=v.getBoundingClientRect(),x.attr("width",y.width),x.attr("height",y.height)}g.attr("transform",nc(y,n)),Ma.get(e.id)||Ma.set(e.id,{}),Ma.get(e.id).endRight=p,Px(f,e.endLabelRight)}return u},"insertEdgeLabel");function Px(t,e){mn(Pe())&&t&&(t.style.width=e.length*9+"px",t.style.height="12px")}T(Px,"setTerminalWidth");var wK=T((t,e)=>{se.debug("Moving label abc88 ",t.id,t.label,hE.get(t.id),e);let r=e.updatedPath?e.updatedPath:e.originalPath;const n=Pe(),{subGraphTitleTotalMargin:i}=Ex(n);if(t.label){const a=hE.get(t.id);let s=t.x,o=t.y;if(r){const l=Pr.calcLabelPosition(r);se.debug("Moving label "+t.label+" from (",s,",",o,") to (",l.x,",",l.y,") abc88"),e.updatedPath&&(s=l.x,o=l.y)}a.attr("transform",`translate(${s}, ${o+i/2})`)}if(t.startLabelLeft){const a=Ma.get(t.id).startLeft;let s=t.x,o=t.y;if(r){const l=Pr.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_left",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}if(t.startLabelRight){const a=Ma.get(t.id).startRight;let s=t.x,o=t.y;if(r){const l=Pr.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_right",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}if(t.endLabelLeft){const a=Ma.get(t.id).endLeft;let s=t.x,o=t.y;if(r){const l=Pr.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_left",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}if(t.endLabelRight){const a=Ma.get(t.id).endRight;let s=t.x,o=t.y;if(r){const l=Pr.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_right",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}},"positionEdgeLabel"),rDe=T((t,e)=>{const r=t.x,n=t.y,i=Math.abs(e.x-r),a=Math.abs(e.y-n),s=t.width/2,o=t.height/2;return i>=s||a>=o},"outsideNode"),nDe=T((t,e,r)=>{se.debug(`intersection calc abc89: outsidePoint: ${JSON.stringify(e)} insidePoint : ${JSON.stringify(r)} - node : x:${t.x} y:${t.y} w:${t.width} h:${t.height}`);const n=t.x,i=t.y,a=Math.abs(n-r.x),s=t.width/2;let o=r.xMath.abs(n-e.x)*l){let d=r.y{ae.warn("abc88 cutPathAtIntersect",t,e);let r=[],n=t[0],i=!1;return t.forEach(a=>{if(ae.info("abc88 checking point",a,e),!F6e(e,a)&&!i){const s=z6e(e,n,a);ae.debug("abc88 inside",a,n,s),ae.debug("abc88 intersection",s,e);let o=!1;r.forEach(l=>{o=o||l.x===s.x&&l.y===s.y}),r.some(l=>l.x===s.x&&l.y===s.y)?ae.warn("abc88 no intersect",s,r):r.push(s),i=!0}else ae.warn("abc88 outside",a,n),n=a,i||r.push(a)}),ae.debug("returning points",r),r},"cutPathAtIntersect");function KU(t){const e=[],r=[];for(let n=1;n5&&Math.abs(a.y-i.y)>5||i.y===a.y&&a.x===s.x&&Math.abs(a.x-i.x)>5&&Math.abs(a.y-s.y)>5)&&(e.push(a),r.push(n))}return{cornerPoints:e,cornerPointPositions:r}}x(KU,"extractCornerPoints");var jU=x(function(t,e,r){const n=e.x-t.x,i=e.y-t.y,a=Math.sqrt(n*n+i*i),s=r/a;return{x:e.x-s*n,y:e.y-s*i}},"findAdjacentPoint"),G6e=x(function(t){const{cornerPointPositions:e}=KU(t),r=[];for(let n=0;n10&&Math.abs(a.y-i.y)>=10){ae.debug("Corner point fixing",Math.abs(a.x-i.x),Math.abs(a.y-i.y));const p=5;s.x===o.x?f={x:u<0?o.x-p+d:o.x+p-d,y:h<0?o.y-d:o.y+d}:f={x:u<0?o.x-d:o.x+d,y:h<0?o.y-p+d:o.y+p-d}}else ae.debug("Corner point skipping fixing",Math.abs(a.x-i.x),Math.abs(a.y-i.y));r.push(f,l)}else r.push(t[n]);return r},"fixCorners"),q6e=x((t,e,r)=>{const n=t-e-r,i=2,a=2,s=i+a,o=Math.floor(n/s),l=Array(o).fill(`${i} ${a}`).join(" ");return`0 ${e} ${l} ${r}`},"generateDashArray"),ZU=x(function(t,e,r,n,i,a,s,o=!1){var D;if(!s)throw new Error(`insertEdge: missing diagramId for edge "${e.id}" — edge IDs require a diagram prefix for uniqueness`);const{handDrawnSeed:l}=Pe();let u=e.points,h=!1;const d=i;var f=a;const p=[];for(const I in e.cssCompiledStyles)g_(I)||p.push(e.cssCompiledStyles[I]);ae.debug("UIO intersect check",e.points,f.x,d.x),f.intersect&&d.intersect&&!o&&(u=u.slice(1,e.points.length-1),u.unshift(d.intersect(u[0])),ae.debug("Last point UIO",e.start,"-->",e.end,u[u.length-1],f,f.intersect(u[u.length-1])),u.push(f.intersect(u[u.length-1])));const g=btoa(JSON.stringify(u));e.toCluster&&(ae.info("to cluster abc88",r.get(e.toCluster)),u=XU(e.points,r.get(e.toCluster).node),h=!0),e.fromCluster&&(ae.debug("from cluster abc88",r.get(e.fromCluster),JSON.stringify(u,null,2)),u=XU(u.reverse(),r.get(e.fromCluster).node).reverse(),h=!0);let m=u.filter(I=>!Number.isNaN(I.y));const y=P6e(e.curve);y!=="rounded"&&(m=G6e(m));let v=D2;switch(y){case"linear":v=D2;break;case"basis":v=N2;break;case"cardinal":v=kz;break;case"bumpX":v=bz;break;case"bumpY":v=xz;break;case"catmullRom":v=Sz;break;case"monotoneX":v=Oz;break;case"monotoneY":v=$z;break;case"natural":v=Fz;break;case"step":v=zz;break;case"stepAfter":v=qz;break;case"stepBefore":v=Gz;break;case"rounded":v=D2;break;default:v=N2}const{x:T,y:b}=Aq(e),w=M2().x(T).y(b).curve(v);let k;switch(e.thickness){case"normal":k="edge-thickness-normal";break;case"thick":k="edge-thickness-thick";break;case"invisible":k="edge-thickness-invisible";break;default:k="edge-thickness-normal"}switch(e.pattern){case"solid":k+=" edge-pattern-solid";break;case"dotted":k+=" edge-pattern-dotted";break;case"dashed":k+=" edge-pattern-dashed";break;default:k+=" edge-pattern-solid"}let A,C=y==="rounded"?QU(JU(m,e),5):w(m);const _=Array.isArray(e.style)?e.style:[e.style];let L=_.find(I=>I==null?void 0:I.startsWith("stroke:")),O="";e.animate&&(O="edge-animation-fast"),e.animation&&(O="edge-animation-"+e.animation);let M=!1;if(e.look==="handDrawn"){const I=Kt.svg(t);Object.assign([],m);const $=I.path(C,{roughness:.3,seed:l});k+=" transition",A=pt($).select("path").attr("id",`${s}-${e.id}`).attr("class"," "+k+(e.classes?" "+e.classes:"")+(O?" "+O:"")).attr("style",_?_.reduce((P,G)=>P+";"+G,""):"");let B=A.attr("d");A.attr("d",B),t.node().appendChild(A.node())}else{const I=p.join(";"),$=_?_.reduce((W,ie)=>W+ie+";",""):"",B=(I?I+";"+$+";":$)+";"+(_?_.reduce((W,ie)=>W+";"+ie,""):"");A=t.append("path").attr("d",C).attr("id",`${s}-${e.id}`).attr("class"," "+k+(e.classes?" "+e.classes:"")+(O?" "+O:"")).attr("style",B),L=(D=B.match(/stroke:([^;]+)/))==null?void 0:D[1],M=e.animate===!0||!!e.animation||I.includes("animation");const P=A.node(),G=typeof P.getTotalLength=="function"?P.getTotalLength():0,V=Sq[e.arrowTypeStart]||0,Y=Sq[e.arrowTypeEnd]||0;if(e.look==="neo"&&!M){const ie=`stroke-dasharray: ${e.pattern==="dotted"||e.pattern==="dashed"?q6e(G,V,Y):`0 ${V} ${G-V-Y} ${Y}`}; stroke-dashoffset: 0;`;A.attr("style",ie+A.attr("style"))}}A.attr("data-edge",!0),A.attr("data-et","edge"),A.attr("data-id",e.id),A.attr("data-points",g),A.attr("data-look",Zi(e.look)),e.showPoints&&m.forEach(I=>{t.append("circle").style("stroke","red").style("fill","red").attr("r",1).attr("cx",I.x).attr("cy",I.y)});let z="";(Pe().flowchart.arrowMarkerAbsolute||Pe().state.arrowMarkerAbsolute)&&(z=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,z=z.replace(/\(/g,"\\(").replace(/\)/g,"\\)")),ae.info("arrowTypeStart",e.arrowTypeStart),ae.info("arrowTypeEnd",e.arrowTypeEnd);const F=!M&&(e==null?void 0:e.look)==="neo";N6e(A,e,z,s,n,F,L);const S=Math.floor(u.length/2),R=u[S];Lr.isLabelCoordinateInPath(R,A.attr("d"))||(h=!0);let N={};return h&&(N.updatedPath=u),N.originalPath=e.points,N},"insertEdge");function QU(t,e){if(t.length<2)return"";let r="";const n=t.length,i=1e-5;for(let a=0;a({...i}));if(t.length>=2&&La[e.arrowTypeStart]){const i=La[e.arrowTypeStart],a=t[0],s=t[1],{angle:o}=j_(a,s),l=i*Math.cos(o),u=i*Math.sin(o);r[0].x=a.x+l,r[0].y=a.y+u}const n=t.length;if(n>=2&&La[e.arrowTypeEnd]){const i=La[e.arrowTypeEnd],a=t[n-1],s=t[n-2],{angle:o}=j_(s,a),l=i*Math.cos(o),u=i*Math.sin(o);r[n-1].x=a.x-l,r[n-1].y=a.y-u}return r}x(JU,"applyMarkerOffsetsToPoints");var V6e=x((t,e,r,n)=>{e.forEach(i=>{dAe[i](t,r,n)})},"insertMarkers"),W6e=x((t,e,r)=>{ae.trace("Making markers for ",r),t.append("defs").append("marker").attr("id",r+"_"+e+"-extensionStart").attr("class","marker extension "+e).attr("refX",18).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M 1,7 L18,13 V 1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-extensionEnd").attr("class","marker extension "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 1,1 V 13 L18,7 Z"),t.append("marker").attr("id",r+"_"+e+"-extensionStart-margin").attr("class","marker extension "+e).attr("refX",18).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").attr("viewBox","0 0 20 14").append("polygon").attr("points","10,7 18,13 18,1").style("stroke-width",2).style("stroke-dasharray","0"),t.append("defs").append("marker").attr("id",r+"_"+e+"-extensionEnd-margin").attr("class","marker extension "+e).attr("refX",9).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").attr("viewBox","0 0 20 14").append("polygon").attr("points","10,1 10,13 18,7").style("stroke-width",2).style("stroke-dasharray","0")},"extension"),U6e=x((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-compositionStart").attr("class","marker composition "+e).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-compositionEnd").attr("class","marker composition "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-compositionStart-margin").attr("class","marker composition "+e).attr("refX",15).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("viewBox","0 0 15 15").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-compositionEnd-margin").attr("class","marker composition "+e).attr("refX",3.5).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"composition"),H6e=x((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-aggregationStart").attr("class","marker aggregation "+e).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-aggregationEnd").attr("class","marker aggregation "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-aggregationStart-margin").attr("class","marker aggregation "+e).attr("refX",15).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",2).attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-aggregationEnd-margin").attr("class","marker aggregation "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",2).attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"aggregation"),Y6e=x((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-dependencyStart").attr("class","marker dependency "+e).attr("refX",6).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-dependencyEnd").attr("class","marker dependency "+e).attr("refX",13).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-dependencyStart-margin").attr("class","marker dependency "+e).attr("refX",4).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-dependencyEnd-margin").attr("class","marker dependency "+e).attr("refX",16).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"dependency"),X6e=x((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-lollipopStart").attr("class","marker lollipop "+e).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),t.append("defs").append("marker").attr("id",r+"_"+e+"-lollipopEnd").attr("class","marker lollipop "+e).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),t.append("defs").append("marker").attr("id",r+"_"+e+"-lollipopStart-margin").attr("class","marker lollipop "+e).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6).attr("stroke-width",2),t.append("defs").append("marker").attr("id",r+"_"+e+"-lollipopEnd-margin").attr("class","marker lollipop "+e).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6).attr("stroke-width",2)},"lollipop"),K6e=x((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-pointEnd").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",8).attr("markerHeight",8).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-pointStart").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",4.5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",8).attr("markerHeight",8).attr("orient","auto").append("path").attr("d","M 0 5 L 10 10 L 10 0 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-pointEnd-margin").attr("class","marker "+e).attr("viewBox","0 0 11.5 14").attr("refX",11.5).attr("refY",7).attr("markerUnits","userSpaceOnUse").attr("markerWidth",10.5).attr("markerHeight",14).attr("orient","auto").append("path").attr("d","M 0 0 L 11.5 7 L 0 14 z").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-pointStart-margin").attr("class","marker "+e).attr("viewBox","0 0 11.5 14").attr("refX",1).attr("refY",7).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11.5).attr("markerHeight",14).attr("orient","auto").append("polygon").attr("points","0,7 11.5,14 11.5,0").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0")},"point"),j6e=x((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-circleEnd").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",11).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-circleStart").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",-1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-circleEnd-margin").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refY",5).attr("refX",12.25).attr("markerUnits","userSpaceOnUse").attr("markerWidth",14).attr("markerHeight",14).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-circleStart-margin").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",-2).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",14).attr("markerHeight",14).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0")},"circle"),Z6e=x((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-crossEnd").attr("class","marker cross "+e).attr("viewBox","0 0 11 11").attr("refX",12).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-crossStart").attr("class","marker cross "+e).attr("viewBox","0 0 11 11").attr("refX",-1).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-crossEnd-margin").attr("class","marker cross "+e).attr("viewBox","0 0 15 15").attr("refX",17.7).attr("refY",7.5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 1,1 L 14,14 M 1,14 L 14,1").attr("class","arrowMarkerPath").style("stroke-width",2.5),t.append("marker").attr("id",r+"_"+e+"-crossStart-margin").attr("class","marker cross "+e).attr("viewBox","0 0 15 15").attr("refX",-3.5).attr("refY",7.5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 1,1 L 14,14 M 1,14 L 14,1").attr("class","arrowMarkerPath").style("stroke-width",2.5).style("stroke-dasharray","1,0")},"cross"),Q6e=x((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"barb"),J6e=x((t,e,r)=>{const n=lr(),{themeVariables:i}=n,{transitionColor:a}=i;t.append("defs").append("marker").attr("id",r+"_"+e+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","strokeWidth").attr("orient","auto").append("path").attr("d","M 19,7 L11,14 L13,7 L11,0 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-barbEnd-margin").attr("refX",17).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M 19,7 L11,14 L13,7 L11,0 Z").attr("fill",`${a}`)},"barbNeo"),eAe=x((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-onlyOneStart").attr("class","marker onlyOne "+e).attr("refX",0).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").append("path").attr("d","M9,0 L9,18 M15,0 L15,18"),t.append("defs").append("marker").attr("id",r+"_"+e+"-onlyOneEnd").attr("class","marker onlyOne "+e).attr("refX",18).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").append("path").attr("d","M3,0 L3,18 M9,0 L9,18")},"only_one"),tAe=x((t,e,r)=>{const n=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrOneStart").attr("class","marker zeroOrOne "+e).attr("refX",0).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto");n.append("circle").attr("fill","white").attr("cx",21).attr("cy",9).attr("r",6),n.append("path").attr("d","M9,0 L9,18");const i=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrOneEnd").attr("class","marker zeroOrOne "+e).attr("refX",30).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto");i.append("circle").attr("fill","white").attr("cx",9).attr("cy",9).attr("r",6),i.append("path").attr("d","M21,0 L21,18")},"zero_or_one"),rAe=x((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-oneOrMoreStart").attr("class","marker oneOrMore "+e).attr("refX",18).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").append("path").attr("d","M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27"),t.append("defs").append("marker").attr("id",r+"_"+e+"-oneOrMoreEnd").attr("class","marker oneOrMore "+e).attr("refX",27).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").append("path").attr("d","M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18")},"one_or_more"),nAe=x((t,e,r)=>{const n=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrMoreStart").attr("class","marker zeroOrMore "+e).attr("refX",18).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto");n.append("circle").attr("fill","white").attr("cx",48).attr("cy",18).attr("r",6),n.append("path").attr("d","M0,18 Q18,0 36,18 Q18,36 0,18");const i=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrMoreEnd").attr("class","marker zeroOrMore "+e).attr("refX",39).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto");i.append("circle").attr("fill","white").attr("cx",9).attr("cy",18).attr("r",6),i.append("path").attr("d","M21,18 Q39,0 57,18 Q39,36 21,18")},"zero_or_more"),iAe=x((t,e,r)=>{const n=lr(),{themeVariables:i}=n,{strokeWidth:a}=i;t.append("defs").append("marker").attr("id",r+"_"+e+"-onlyOneStart").attr("class","marker onlyOne "+e).attr("refX",0).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M9,0 L9,18 M15,0 L15,18").attr("stroke-width",`${a}`),t.append("defs").append("marker").attr("id",r+"_"+e+"-onlyOneEnd").attr("class","marker onlyOne "+e).attr("refX",18).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M3,0 L3,18 M9,0 L9,18").attr("stroke-width",`${a}`)},"only_one_neo"),aAe=x((t,e,r)=>{const n=lr(),{themeVariables:i}=n,{strokeWidth:a,mainBkg:s}=i,o=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrOneStart").attr("class","marker zeroOrOne "+e).attr("refX",0).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto").attr("markerUnits","userSpaceOnUse");o.append("circle").attr("fill",s??"white").attr("cx",21).attr("cy",9).attr("stroke-width",`${a}`).attr("r",6),o.append("path").attr("d","M9,0 L9,18").attr("stroke-width",`${a}`);const l=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrOneEnd").attr("class","marker zeroOrOne "+e).attr("refX",30).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("markerUnits","userSpaceOnUse").attr("orient","auto");l.append("circle").attr("fill",s??"white").attr("cx",9).attr("cy",9).attr("stroke-width",`${a}`).attr("r",6),l.append("path").attr("d","M21,0 L21,18").attr("stroke-width",`${a}`)},"zero_or_one_neo"),sAe=x((t,e,r)=>{const n=lr(),{themeVariables:i}=n,{strokeWidth:a}=i;t.append("defs").append("marker").attr("id",r+"_"+e+"-oneOrMoreStart").attr("class","marker oneOrMore "+e).attr("refX",18).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27").attr("stroke-width",`${a}`),t.append("defs").append("marker").attr("id",r+"_"+e+"-oneOrMoreEnd").attr("class","marker oneOrMore "+e).attr("refX",27).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18").attr("stroke-width",`${a}`)},"one_or_more_neo"),oAe=x((t,e,r)=>{const n=lr(),{themeVariables:i}=n,{strokeWidth:a,mainBkg:s}=i,o=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrMoreStart").attr("class","marker zeroOrMore "+e).attr("refX",18).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("markerUnits","userSpaceOnUse").attr("orient","auto");o.append("circle").attr("fill",s??"white").attr("cx",45.5).attr("cy",18).attr("r",6).attr("stroke-width",`${a}`),o.append("path").attr("d","M0,18 Q18,0 36,18 Q18,36 0,18").attr("stroke-width",`${a}`);const l=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrMoreEnd").attr("class","marker zeroOrMore "+e).attr("refX",39).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto").attr("markerUnits","userSpaceOnUse");l.append("circle").attr("fill",s??"white").attr("cx",11).attr("cy",18).attr("r",6).attr("stroke-width",`${a}`),l.append("path").attr("d","M21,18 Q39,0 57,18 Q39,36 21,18").attr("stroke-width",`${a}`)},"zero_or_more_neo"),lAe=x((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-requirement_arrowEnd").attr("refX",20).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("path").attr("d",`M0,0 + node : x:${t.x} y:${t.y} w:${t.width} h:${t.height}`);const n=t.x,i=t.y,a=Math.abs(n-r.x),s=t.width/2;let o=r.xMath.abs(n-e.x)*l){let d=r.y{se.warn("abc88 cutPathAtIntersect",t,e);let r=[],n=t[0],i=!1;return t.forEach(a=>{if(se.info("abc88 checking point",a,e),!rDe(e,a)&&!i){const s=nDe(e,n,a);se.debug("abc88 inside",a,n,s),se.debug("abc88 intersection",s,e);let o=!1;r.forEach(l=>{o=o||l.x===s.x&&l.y===s.y}),r.some(l=>l.x===s.x&&l.y===s.y)?se.warn("abc88 no intersect",s,r):r.push(s),i=!0}else se.warn("abc88 outside",a,n),n=a,i||r.push(a)}),se.debug("returning points",r),r},"cutPathAtIntersect");function kK(t){const e=[],r=[];for(let n=1;n5&&Math.abs(a.y-i.y)>5||i.y===a.y&&a.x===s.x&&Math.abs(a.x-i.x)>5&&Math.abs(a.y-s.y)>5)&&(e.push(a),r.push(n))}return{cornerPoints:e,cornerPointPositions:r}}T(kK,"extractCornerPoints");var EK=T(function(t,e,r){const n=e.x-t.x,i=e.y-t.y,a=Math.sqrt(n*n+i*i),s=r/a;return{x:e.x-s*n,y:e.y-s*i}},"findAdjacentPoint"),iDe=T(function(t){const{cornerPointPositions:e}=kK(t),r=[];for(let n=0;n10&&Math.abs(a.y-i.y)>=10){se.debug("Corner point fixing",Math.abs(a.x-i.x),Math.abs(a.y-i.y));const p=5;s.x===o.x?f={x:u<0?o.x-p+d:o.x+p-d,y:h<0?o.y-d:o.y+d}:f={x:u<0?o.x-d:o.x+d,y:h<0?o.y-p+d:o.y+p-d}}else se.debug("Corner point skipping fixing",Math.abs(a.x-i.x),Math.abs(a.y-i.y));r.push(f,l)}else r.push(t[n]);return r},"fixCorners"),aDe=T((t,e,r)=>{const n=t-e-r,i=2,a=2,s=i+a,o=Math.floor(n/s),l=Array(o).fill(`${i} ${a}`).join(" ");return`0 ${e} ${l} ${r}`},"generateDashArray"),SK=T(function(t,e,r,n,i,a,s,o=!1){var M;if(!s)throw new Error(`insertEdge: missing diagramId for edge "${e.id}" — edge IDs require a diagram prefix for uniqueness`);const{handDrawnSeed:l}=Pe();let u=e.points,h=!1;const d=i;var f=a;const p=[];for(const D in e.cssCompiledStyles)p8(D)||p.push(e.cssCompiledStyles[D]);se.debug("UIO intersect check",e.points,f.x,d.x),f.intersect&&d.intersect&&!o&&(u=u.slice(1,e.points.length-1),u.unshift(d.intersect(u[0])),se.debug("Last point UIO",e.start,"-->",e.end,u[u.length-1],f,f.intersect(u[u.length-1])),u.push(f.intersect(u[u.length-1])));const g=btoa(JSON.stringify(u));e.toCluster&&(se.info("to cluster abc88",r.get(e.toCluster)),u=CK(e.points,r.get(e.toCluster).node),h=!0),e.fromCluster&&(se.debug("from cluster abc88",r.get(e.fromCluster),JSON.stringify(u,null,2)),u=CK(u.reverse(),r.get(e.fromCluster).node).reverse(),h=!0);let m=u.filter(D=>!Number.isNaN(D.y));const y=eDe(e.curve);y!=="rounded"&&(m=iDe(m));let v=hx;switch(y){case"linear":v=hx;break;case"basis":v=fx;break;case"cardinal":v=JW;break;case"bumpX":v=XW;break;case"bumpY":v=jW;break;case"catmullRom":v=tU;break;case"monotoneX":v=uU;break;case"monotoneY":v=hU;break;case"natural":v=pU;break;case"step":v=gU;break;case"stepAfter":v=yU;break;case"stepBefore":v=mU;break;case"rounded":v=hx;break;default:v=fx}const{x,y:b}=rY(e),w=dx().x(x).y(b).curve(v);let C;switch(e.thickness){case"normal":C="edge-thickness-normal";break;case"thick":C="edge-thickness-thick";break;case"invisible":C="edge-thickness-invisible";break;default:C="edge-thickness-normal"}switch(e.pattern){case"solid":C+=" edge-pattern-solid";break;case"dotted":C+=" edge-pattern-dotted";break;case"dashed":C+=" edge-pattern-dashed";break;default:C+=" edge-pattern-solid"}let _,k=y==="rounded"?_K(AK(m,e),5):w(m);const S=Array.isArray(e.style)?e.style:[e.style];let L=S.find(D=>D==null?void 0:D.startsWith("stroke:")),$="";e.animate&&($="edge-animation-fast"),e.animation&&($="edge-animation-"+e.animation);let I=!1;if(e.look==="handDrawn"){const D=er.svg(t);Object.assign([],m);const O=D.path(k,{roughness:.3,seed:l});C+=" transition",_=gt(O).select("path").attr("id",`${s}-${e.id}`).attr("class"," "+C+(e.classes?" "+e.classes:"")+($?" "+$:"")).attr("style",S?S.reduce((P,G)=>P+";"+G,""):"");let B=_.attr("d");_.attr("d",B),t.node().appendChild(_.node())}else{const D=p.join(";"),O=S?S.reduce((W,ie)=>W+ie+";",""):"",B=(D?D+";"+O+";":O)+";"+(S?S.reduce((W,ie)=>W+";"+ie,""):"");_=t.append("path").attr("d",k).attr("id",`${s}-${e.id}`).attr("class"," "+C+(e.classes?" "+e.classes:"")+($?" "+$:"")).attr("style",B),L=(M=B.match(/stroke:([^;]+)/))==null?void 0:M[1],I=e.animate===!0||!!e.animation||D.includes("animation");const P=_.node(),G=typeof P.getTotalLength=="function"?P.getTotalLength():0,V=tY[e.arrowTypeStart]||0,H=tY[e.arrowTypeEnd]||0;if(e.look==="neo"&&!I){const ie=`stroke-dasharray: ${e.pattern==="dotted"||e.pattern==="dashed"?aDe(G,V,H):`0 ${V} ${G-V-H} ${H}`}; stroke-dashoffset: 0;`;_.attr("style",ie+_.attr("style"))}}_.attr("data-edge",!0),_.attr("data-et","edge"),_.attr("data-id",e.id),_.attr("data-points",g),_.attr("data-look",xa(e.look)),e.showPoints&&m.forEach(D=>{t.append("circle").style("stroke","red").style("fill","red").attr("r",1).attr("cx",D.x).attr("cy",D.y)});let z="";(Pe().flowchart.arrowMarkerAbsolute||Pe().state.arrowMarkerAbsolute)&&(z=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,z=z.replace(/\(/g,"\\(").replace(/\)/g,"\\)")),se.info("arrowTypeStart",e.arrowTypeStart),se.info("arrowTypeEnd",e.arrowTypeEnd);const F=!I&&(e==null?void 0:e.look)==="neo";ZIe(_,e,z,s,n,F,L);const A=Math.floor(u.length/2),R=u[A];Pr.isLabelCoordinateInPath(R,_.attr("d"))||(h=!0);let N={};return h&&(N.updatedPath=u),N.originalPath=e.points,N},"insertEdge");function _K(t,e){if(t.length<2)return"";let r="";const n=t.length,i=1e-5;for(let a=0;a({...i}));if(t.length>=2&&ts[e.arrowTypeStart]){const i=ts[e.arrowTypeStart],a=t[0],s=t[1],{angle:o}=j8(a,s),l=i*Math.cos(o),u=i*Math.sin(o);r[0].x=a.x+l,r[0].y=a.y+u}const n=t.length;if(n>=2&&ts[e.arrowTypeEnd]){const i=ts[e.arrowTypeEnd],a=t[n-1],s=t[n-2],{angle:o}=j8(s,a),l=i*Math.cos(o),u=i*Math.sin(o);r[n-1].x=a.x-l,r[n-1].y=a.y-u}return r}T(AK,"applyMarkerOffsetsToPoints");var sDe=T((t,e,r,n)=>{e.forEach(i=>{RDe[i](t,r,n)})},"insertMarkers"),oDe=T((t,e,r)=>{se.trace("Making markers for ",r),t.append("defs").append("marker").attr("id",r+"_"+e+"-extensionStart").attr("class","marker extension "+e).attr("refX",18).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M 1,7 L18,13 V 1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-extensionEnd").attr("class","marker extension "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 1,1 V 13 L18,7 Z"),t.append("marker").attr("id",r+"_"+e+"-extensionStart-margin").attr("class","marker extension "+e).attr("refX",18).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").attr("viewBox","0 0 20 14").append("polygon").attr("points","10,7 18,13 18,1").style("stroke-width",2).style("stroke-dasharray","0"),t.append("defs").append("marker").attr("id",r+"_"+e+"-extensionEnd-margin").attr("class","marker extension "+e).attr("refX",9).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").attr("viewBox","0 0 20 14").append("polygon").attr("points","10,1 10,13 18,7").style("stroke-width",2).style("stroke-dasharray","0")},"extension"),lDe=T((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-compositionStart").attr("class","marker composition "+e).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-compositionEnd").attr("class","marker composition "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-compositionStart-margin").attr("class","marker composition "+e).attr("refX",15).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("viewBox","0 0 15 15").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-compositionEnd-margin").attr("class","marker composition "+e).attr("refX",3.5).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"composition"),cDe=T((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-aggregationStart").attr("class","marker aggregation "+e).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-aggregationEnd").attr("class","marker aggregation "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-aggregationStart-margin").attr("class","marker aggregation "+e).attr("refX",15).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",2).attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-aggregationEnd-margin").attr("class","marker aggregation "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",2).attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"aggregation"),uDe=T((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-dependencyStart").attr("class","marker dependency "+e).attr("refX",6).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-dependencyEnd").attr("class","marker dependency "+e).attr("refX",13).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-dependencyStart-margin").attr("class","marker dependency "+e).attr("refX",4).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-dependencyEnd-margin").attr("class","marker dependency "+e).attr("refX",16).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"dependency"),hDe=T((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-lollipopStart").attr("class","marker lollipop "+e).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),t.append("defs").append("marker").attr("id",r+"_"+e+"-lollipopEnd").attr("class","marker lollipop "+e).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),t.append("defs").append("marker").attr("id",r+"_"+e+"-lollipopStart-margin").attr("class","marker lollipop "+e).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6).attr("stroke-width",2),t.append("defs").append("marker").attr("id",r+"_"+e+"-lollipopEnd-margin").attr("class","marker lollipop "+e).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6).attr("stroke-width",2)},"lollipop"),dDe=T((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-pointEnd").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",8).attr("markerHeight",8).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-pointStart").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",4.5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",8).attr("markerHeight",8).attr("orient","auto").append("path").attr("d","M 0 5 L 10 10 L 10 0 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-pointEnd-margin").attr("class","marker "+e).attr("viewBox","0 0 11.5 14").attr("refX",11.5).attr("refY",7).attr("markerUnits","userSpaceOnUse").attr("markerWidth",10.5).attr("markerHeight",14).attr("orient","auto").append("path").attr("d","M 0 0 L 11.5 7 L 0 14 z").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-pointStart-margin").attr("class","marker "+e).attr("viewBox","0 0 11.5 14").attr("refX",1).attr("refY",7).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11.5).attr("markerHeight",14).attr("orient","auto").append("polygon").attr("points","0,7 11.5,14 11.5,0").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0")},"point"),fDe=T((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-circleEnd").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",11).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-circleStart").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",-1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-circleEnd-margin").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refY",5).attr("refX",12.25).attr("markerUnits","userSpaceOnUse").attr("markerWidth",14).attr("markerHeight",14).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-circleStart-margin").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",-2).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",14).attr("markerHeight",14).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0")},"circle"),pDe=T((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-crossEnd").attr("class","marker cross "+e).attr("viewBox","0 0 11 11").attr("refX",12).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-crossStart").attr("class","marker cross "+e).attr("viewBox","0 0 11 11").attr("refX",-1).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-crossEnd-margin").attr("class","marker cross "+e).attr("viewBox","0 0 15 15").attr("refX",17.7).attr("refY",7.5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 1,1 L 14,14 M 1,14 L 14,1").attr("class","arrowMarkerPath").style("stroke-width",2.5),t.append("marker").attr("id",r+"_"+e+"-crossStart-margin").attr("class","marker cross "+e).attr("viewBox","0 0 15 15").attr("refX",-3.5).attr("refY",7.5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 1,1 L 14,14 M 1,14 L 14,1").attr("class","arrowMarkerPath").style("stroke-width",2.5).style("stroke-dasharray","1,0")},"cross"),gDe=T((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"barb"),mDe=T((t,e,r)=>{const n=pr(),{themeVariables:i}=n,{transitionColor:a}=i;t.append("defs").append("marker").attr("id",r+"_"+e+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","strokeWidth").attr("orient","auto").append("path").attr("d","M 19,7 L11,14 L13,7 L11,0 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-barbEnd-margin").attr("refX",17).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M 19,7 L11,14 L13,7 L11,0 Z").attr("fill",`${a}`)},"barbNeo"),yDe=T((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-onlyOneStart").attr("class","marker onlyOne "+e).attr("refX",0).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").append("path").attr("d","M9,0 L9,18 M15,0 L15,18"),t.append("defs").append("marker").attr("id",r+"_"+e+"-onlyOneEnd").attr("class","marker onlyOne "+e).attr("refX",18).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").append("path").attr("d","M3,0 L3,18 M9,0 L9,18")},"only_one"),vDe=T((t,e,r)=>{const n=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrOneStart").attr("class","marker zeroOrOne "+e).attr("refX",0).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto");n.append("circle").attr("fill","white").attr("cx",21).attr("cy",9).attr("r",6),n.append("path").attr("d","M9,0 L9,18");const i=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrOneEnd").attr("class","marker zeroOrOne "+e).attr("refX",30).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto");i.append("circle").attr("fill","white").attr("cx",9).attr("cy",9).attr("r",6),i.append("path").attr("d","M21,0 L21,18")},"zero_or_one"),bDe=T((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-oneOrMoreStart").attr("class","marker oneOrMore "+e).attr("refX",18).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").append("path").attr("d","M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27"),t.append("defs").append("marker").attr("id",r+"_"+e+"-oneOrMoreEnd").attr("class","marker oneOrMore "+e).attr("refX",27).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").append("path").attr("d","M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18")},"one_or_more"),xDe=T((t,e,r)=>{const n=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrMoreStart").attr("class","marker zeroOrMore "+e).attr("refX",18).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto");n.append("circle").attr("fill","white").attr("cx",48).attr("cy",18).attr("r",6),n.append("path").attr("d","M0,18 Q18,0 36,18 Q18,36 0,18");const i=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrMoreEnd").attr("class","marker zeroOrMore "+e).attr("refX",39).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto");i.append("circle").attr("fill","white").attr("cx",9).attr("cy",18).attr("r",6),i.append("path").attr("d","M21,18 Q39,0 57,18 Q39,36 21,18")},"zero_or_more"),TDe=T((t,e,r)=>{const n=pr(),{themeVariables:i}=n,{strokeWidth:a}=i;t.append("defs").append("marker").attr("id",r+"_"+e+"-onlyOneStart").attr("class","marker onlyOne "+e).attr("refX",0).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M9,0 L9,18 M15,0 L15,18").attr("stroke-width",`${a}`),t.append("defs").append("marker").attr("id",r+"_"+e+"-onlyOneEnd").attr("class","marker onlyOne "+e).attr("refX",18).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M3,0 L3,18 M9,0 L9,18").attr("stroke-width",`${a}`)},"only_one_neo"),wDe=T((t,e,r)=>{const n=pr(),{themeVariables:i}=n,{strokeWidth:a,mainBkg:s}=i,o=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrOneStart").attr("class","marker zeroOrOne "+e).attr("refX",0).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto").attr("markerUnits","userSpaceOnUse");o.append("circle").attr("fill",s??"white").attr("cx",21).attr("cy",9).attr("stroke-width",`${a}`).attr("r",6),o.append("path").attr("d","M9,0 L9,18").attr("stroke-width",`${a}`);const l=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrOneEnd").attr("class","marker zeroOrOne "+e).attr("refX",30).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("markerUnits","userSpaceOnUse").attr("orient","auto");l.append("circle").attr("fill",s??"white").attr("cx",9).attr("cy",9).attr("stroke-width",`${a}`).attr("r",6),l.append("path").attr("d","M21,0 L21,18").attr("stroke-width",`${a}`)},"zero_or_one_neo"),CDe=T((t,e,r)=>{const n=pr(),{themeVariables:i}=n,{strokeWidth:a}=i;t.append("defs").append("marker").attr("id",r+"_"+e+"-oneOrMoreStart").attr("class","marker oneOrMore "+e).attr("refX",18).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27").attr("stroke-width",`${a}`),t.append("defs").append("marker").attr("id",r+"_"+e+"-oneOrMoreEnd").attr("class","marker oneOrMore "+e).attr("refX",27).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18").attr("stroke-width",`${a}`)},"one_or_more_neo"),kDe=T((t,e,r)=>{const n=pr(),{themeVariables:i}=n,{strokeWidth:a,mainBkg:s}=i,o=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrMoreStart").attr("class","marker zeroOrMore "+e).attr("refX",18).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("markerUnits","userSpaceOnUse").attr("orient","auto");o.append("circle").attr("fill",s??"white").attr("cx",45.5).attr("cy",18).attr("r",6).attr("stroke-width",`${a}`),o.append("path").attr("d","M0,18 Q18,0 36,18 Q18,36 0,18").attr("stroke-width",`${a}`);const l=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrMoreEnd").attr("class","marker zeroOrMore "+e).attr("refX",39).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto").attr("markerUnits","userSpaceOnUse");l.append("circle").attr("fill",s??"white").attr("cx",11).attr("cy",18).attr("r",6).attr("stroke-width",`${a}`),l.append("path").attr("d","M21,18 Q39,0 57,18 Q39,36 21,18").attr("stroke-width",`${a}`)},"zero_or_more_neo"),EDe=T((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-requirement_arrowEnd").attr("refX",20).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("path").attr("d",`M0,0 L20,10 M20,10 - L0,20`)},"requirement_arrow"),cAe=x((t,e,r)=>{const n=lr(),{themeVariables:i}=n,{strokeWidth:a}=i;t.append("defs").append("marker").attr("id",r+"_"+e+"-requirement_arrowEnd").attr("refX",20).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").attr("markerUnits","userSpaceOnUse").attr("stroke-width",`${a}`).attr("viewBox","0 0 25 20").append("path").attr("d",`M0,0 + L0,20`)},"requirement_arrow"),SDe=T((t,e,r)=>{const n=pr(),{themeVariables:i}=n,{strokeWidth:a}=i;t.append("defs").append("marker").attr("id",r+"_"+e+"-requirement_arrowEnd").attr("refX",20).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").attr("markerUnits","userSpaceOnUse").attr("stroke-width",`${a}`).attr("viewBox","0 0 25 20").append("path").attr("d",`M0,0 L20,10 M20,10 - L0,20`).attr("stroke-linejoin","miter")},"requirement_arrow_neo"),uAe=x((t,e,r)=>{const n=t.append("defs").append("marker").attr("id",r+"_"+e+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("g");n.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),n.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),n.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10)},"requirement_contains"),hAe=x((t,e,r)=>{const n=lr(),{themeVariables:i}=n,{strokeWidth:a}=i,s=t.append("defs").append("marker").attr("id",r+"_"+e+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("g");s.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),s.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),s.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10),s.selectAll("*").attr("stroke-width",`${a}`)},"requirement_contains_neo"),dAe={extension:W6e,composition:U6e,aggregation:H6e,dependency:Y6e,lollipop:X6e,point:K6e,circle:j6e,cross:Z6e,barb:Q6e,barbNeo:J6e,only_one:eAe,zero_or_one:tAe,one_or_more:rAe,zero_or_more:nAe,only_one_neo:iAe,zero_or_one_neo:aAe,one_or_more_neo:sAe,zero_or_more_neo:oAe,requirement_arrow:lAe,requirement_contains:uAe,requirement_arrow_neo:cAe,requirement_contains_neo:hAe},eH=V6e,fAe={common:Lt,getConfig:lr,insertCluster:V_,insertEdge:ZU,insertEdgeLabel:HU,insertMarkers:eH,insertNode:nC,interpolateToCurve:c_,labelHelper:xr,log:ae,positionEdgeLabel:YU},ab={},tH=x(t=>{for(const e of t)ab[e.name]=e},"registerLayoutLoaders"),pAe=x(()=>{tH([{name:"dagre",loader:x(async()=>await Promise.resolve().then(()=>sPe),"loader")},{name:"cose-bilkent",loader:x(async()=>await Promise.resolve().then(()=>jVe),"loader")}])},"registerDefaultLayoutLoaders");pAe();var Z0=x(async(t,e)=>{if(!(t.layoutAlgorithm in ab))throw new Error(`Unknown layout algorithm: ${t.layoutAlgorithm}`);if(t.diagramId)for(const h of t.nodes){const d=h.domId||h.id;h.domId=`${t.diagramId}-${d}`}const r=ab[t.layoutAlgorithm],n=await r.loader(),{theme:i,themeVariables:a}=t.config,{useGradient:s,gradientStart:o,gradientStop:l}=a,u=e.attr("id");if(e.append("defs").append("filter").attr("id",`${u}-drop-shadow`).attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",`${i!=null&&i.includes("dark")?"#FFFFFF":"#000000"}`),e.append("defs").append("filter").attr("id",`${u}-drop-shadow-small`).attr("height","150%").attr("width","150%").append("feDropShadow").attr("dx","2").attr("dy","2").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",`${i!=null&&i.includes("dark")?"#FFFFFF":"#000000"}`),s){const h=e.append("linearGradient").attr("id",e.attr("id")+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");h.append("svg:stop").attr("offset","0%").attr("stop-color",o).attr("stop-opacity",1),h.append("svg:stop").attr("offset","100%").attr("stop-color",l).attr("stop-opacity",1)}return n.render(t,e,fAe,{algorithm:r.algorithm})},"render"),sb=x((t="",{fallback:e="dagre"}={})=>{if(t in ab)return t;if(e in ab)return ae.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"),Z_="comm",rH="rule",nH="decl",gAe="@media",mAe="@import",yAe="@supports",vAe="@namespace",Q_="@keyframes",iH="@layer",bAe="@scope",xAe=Math.abs,ob=String.fromCharCode;function aH(t){return t.trim()}function J_(t,e,r){return t.replace(e,r)}function Q0(t,e){return t.charCodeAt(e)|0}function J0(t,e,r){return t.slice(e,r)}function xl(t){return t.length}function sH(t){return t.length}function aC(t,e){return e.push(t),t}var sC=1,ep=1,oH=0,so=0,Ci=0,tp="";function e7(t,e,r,n,i,a,s,o){return{value:t,root:e,parent:r,type:n,props:i,children:a,line:sC,column:ep,length:s,return:"",siblings:o}}function TAe(){return Ci}function wAe(){return Ci=so>0?Q0(tp,--so):0,ep--,Ci===10&&(ep=1,sC--),Ci}function Oo(){return Ci=so2||lb(Ci)>3?"":" "}function SAe(t,e){for(;--e&&Oo()&&!(Ci<48||Ci>102||Ci>57&&Ci<65||Ci>70&&Ci<97););return lC(t,oC()+(e<6&&Ou()==32&&Oo()==32))}function r7(t){for(;Oo();)switch(Ci){case t:return so;case 34:case 39:t!==34&&t!==39&&r7(Ci);break;case 40:t===41&&r7(t);break;case 92:Oo();break}return so}function AAe(t,e){for(;Oo()&&t+Ci!==57;)if(t+Ci===84&&Ou()===47)break;return"/*"+lC(e,so-1)+"*"+ob(t===47?t:Oo())}function _Ae(t){for(;!lb(Ou());)Oo();return lC(t,so)}function RAe(t){return kAe(cC("",null,null,null,[""],t=CAe(t),0,[0],t))}function cC(t,e,r,n,i,a,s,o,l){for(var u=0,h=0,d=s,f=0,p=0,g=0,m=1,y=1,v=1,T=0,b=0,w="",k=i,A=a,C=n,_=w;y;)switch(g=b,b=Oo()){case 40:g!=108&&Q0(_,d-1)==58?(T++,_+="("):_+=t7(b);break;case 41:T--,_+=")";break;case 34:case 39:case 91:_+=t7(b);break;case 9:case 10:case 13:case 32:if(T>0){_+=ob(b);break}_+=EAe(g);break;case 92:_+=SAe(oC()-1,7);continue;case 47:switch(Ou()){case 42:case 47:aC(LAe(AAe(Oo(),oC()),e,r,l),l),(lb(g||1)==5||lb(Ou()||1)==5)&&xl(_)&&J0(_,-1,void 0)!==" "&&(_+=" ");break;default:_+="/"}break;case 123*m:o[u++]=xl(_)*v;case 125*m:case 59:case 0:if(T>0&&b){_+=ob(b);break}switch(b){case 0:case 125:y=0;case 59+h:v==-1&&(_=J_(_,/\f/g,"")),p>0&&(xl(_)-d||m===0)&&aC(p>32?cH(_+";",n,r,d-1,l):cH(J_(_," ","")+";",n,r,d-2,l),l);break;case 59:_+=";";default:if(aC(C=lH(_,e,r,u,h,i,o,w,k=[],A=[],d,a),a),b===123)if(h===0)cC(_,e,C,C,k,a,d,o,A);else{switch(f){case 99:if(Q0(_,3)===110)break;case 108:if(Q0(_,2)===97)break;default:h=0;case 100:case 109:case 115:}h?cC(t,C,C,n&&aC(lH(t,C,C,0,0,i,o,w,i,k=[],d,A),A),i,A,d,o,n?k:A):cC(_,C,C,C,[""],A,0,o,A)}}u=h=p=0,m=v=1,w=_="",d=s;break;case 58:d=1+xl(_),p=g;default:if(m<1){if(b==123)--m;else if(b==125&&m++==0&&wAe()==125)continue}switch(_+=ob(b),b*m){case 38:v=h>0?1:(_+="\f",-1);break;case 44:if(T>0)break;o[u++]=(xl(_)-1)*v,v=1;break;case 64:Ou()===45&&(_+=t7(Oo())),f=Ou(),h=d=xl(w=_+=_Ae(oC())),b++;break;case 45:g===45&&xl(_)==2&&(m=0)}}return a}function lH(t,e,r,n,i,a,s,o,l,u,h,d){for(var f=i-1,p=i===0?a:[""],g=sH(p),m=0,y=0,v=0;m0?p[T]+" "+b:J_(b,/&\f/g,p[T])))&&(l[v++]=w);return e7(t,e,r,i===0?rH:o,l,u,h,d)}function LAe(t,e,r,n){return e7(t,e,r,Z_,ob(TAe()),J0(t,2,-2),0,n)}function cH(t,e,r,n,i){return e7(t,e,r,nH,J0(t,0,n),J0(t,n+1,-1),n,i)}function n7(t,e){for(var r="",n=0;n/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(t),"detector"),NAe=x(async()=>{const{diagram:t}=await Promise.resolve().then(()=>UWe);return{id:uH,diagram:t}},"loader"),OAe={id:uH,detector:MAe,loader:NAe},$Ae=OAe,hH="flowchart",PAe=x((t,e)=>{var r,n;return((r=e==null?void 0:e.flowchart)==null?void 0:r.defaultRenderer)==="dagre-wrapper"||((n=e==null?void 0:e.flowchart)==null?void 0:n.defaultRenderer)==="elk"?!1:/^\s*graph/.test(t)},"detector"),BAe=x(async()=>{const{diagram:t}=await Promise.resolve().then(()=>xI);return{id:hH,diagram:t}},"loader"),FAe={id:hH,detector:PAe,loader:BAe},zAe=FAe,dH="flowchart-v2",GAe=x((t,e)=>{var r,n,i;return((r=e==null?void 0:e.flowchart)==null?void 0:r.defaultRenderer)==="dagre-d3"?!1:(((n=e==null?void 0:e.flowchart)==null?void 0:n.defaultRenderer)==="elk"&&(e.layout="elk"),/^\s*graph/.test(t)&&((i=e==null?void 0:e.flowchart)==null?void 0:i.defaultRenderer)==="dagre-wrapper"?!0:/^\s*flowchart/.test(t))},"detector"),qAe=x(async()=>{const{diagram:t}=await Promise.resolve().then(()=>xI);return{id:dH,diagram:t}},"loader"),VAe={id:dH,detector:GAe,loader:qAe},WAe=VAe,fH="er",UAe=x(t=>/^\s*erDiagram/.test(t),"detector"),HAe=x(async()=>{const{diagram:t}=await Promise.resolve().then(()=>hUe);return{id:fH,diagram:t}},"loader"),YAe={id:fH,detector:UAe,loader:HAe},XAe=YAe,pH="gitGraph",KAe=x(t=>/^\s*gitGraph/.test(t),"detector"),jAe=x(async()=>{const{diagram:t}=await Promise.resolve().then(()=>yst);return{id:pH,diagram:t}},"loader"),ZAe={id:pH,detector:KAe,loader:jAe},QAe=ZAe,gH="gantt",JAe=x(t=>/^\s*gantt/.test(t),"detector"),e_e=x(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Eot);return{id:gH,diagram:t}},"loader"),t_e={id:gH,detector:JAe,loader:e_e},r_e=t_e,mH="info",n_e=x(t=>/^\s*info/.test(t),"detector"),i_e=x(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Mot);return{id:mH,diagram:t}},"loader"),a_e={id:mH,detector:n_e,loader:i_e},yH="pie",s_e=x(t=>/^\s*pie/.test(t),"detector"),o_e=x(async()=>{const{diagram:t}=await Promise.resolve().then(()=>jot);return{id:yH,diagram:t}},"loader"),l_e={id:yH,detector:s_e,loader:o_e},vH="quadrantChart",c_e=x(t=>/^\s*quadrantChart/.test(t),"detector"),u_e=x(async()=>{const{diagram:t}=await Promise.resolve().then(()=>alt);return{id:vH,diagram:t}},"loader"),h_e={id:vH,detector:c_e,loader:u_e},d_e=h_e,bH="xychart",f_e=x(t=>/^\s*xychart(-beta)?/.test(t),"detector"),p_e=x(async()=>{const{diagram:t}=await Promise.resolve().then(()=>xlt);return{id:bH,diagram:t}},"loader"),g_e={id:bH,detector:f_e,loader:p_e},m_e=g_e,xH="requirement",y_e=x(t=>/^\s*requirement(Diagram)?/.test(t),"detector"),v_e=x(async()=>{const{diagram:t}=await Promise.resolve().then(()=>_lt);return{id:xH,diagram:t}},"loader"),b_e={id:xH,detector:y_e,loader:v_e},x_e=b_e,TH="sequence",T_e=x(t=>/^\s*sequenceDiagram/.test(t),"detector"),w_e=x(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Cct);return{id:TH,diagram:t}},"loader"),C_e={id:TH,detector:T_e,loader:w_e},k_e=C_e,wH="class",E_e=x((t,e)=>{var r;return((r=e==null?void 0:e.class)==null?void 0:r.defaultRenderer)==="dagre-wrapper"?!1:/^\s*classDiagram/.test(t)},"detector"),S_e=x(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Rct);return{id:wH,diagram:t}},"loader"),A_e={id:wH,detector:E_e,loader:S_e},__e=A_e,CH="classDiagram",R_e=x((t,e)=>{var r;return/^\s*classDiagram/.test(t)&&((r=e==null?void 0:e.class)==null?void 0:r.defaultRenderer)==="dagre-wrapper"?!0:/^\s*classDiagram-v2/.test(t)},"detector"),L_e=x(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Ict);return{id:CH,diagram:t}},"loader"),I_e={id:CH,detector:R_e,loader:L_e},D_e=I_e,kH="state",M_e=x((t,e)=>{var r;return((r=e==null?void 0:e.state)==null?void 0:r.defaultRenderer)==="dagre-wrapper"?!1:/^\s*stateDiagram/.test(t)},"detector"),N_e=x(async()=>{const{diagram:t}=await Promise.resolve().then(()=>xut);return{id:kH,diagram:t}},"loader"),O_e={id:kH,detector:M_e,loader:N_e},$_e=O_e,EH="stateDiagram",P_e=x((t,e)=>{var r;return!!(/^\s*stateDiagram-v2/.test(t)||/^\s*stateDiagram/.test(t)&&((r=e==null?void 0:e.state)==null?void 0:r.defaultRenderer)==="dagre-wrapper")},"detector"),B_e=x(async()=>{const{diagram:t}=await Promise.resolve().then(()=>wut);return{id:EH,diagram:t}},"loader"),F_e={id:EH,detector:P_e,loader:B_e},z_e=F_e,SH="journey",G_e=x(t=>/^\s*journey/.test(t),"detector"),q_e=x(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Wut);return{id:SH,diagram:t}},"loader"),V_e={id:SH,detector:G_e,loader:q_e},W_e=V_e,U_e=x((t,e,r)=>{ae.debug(`rendering svg for syntax error -`);const n=ys(e),i=n.append("g");n.attr("viewBox","0 0 2412 512"),wi(n,100,512,!0),i.append("path").attr("class","error-icon").attr("d","m411.313,123.313c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32-9.375,9.375-20.688-20.688c-12.484-12.5-32.766-12.5-45.25,0l-16,16c-1.261,1.261-2.304,2.648-3.31,4.051-21.739-8.561-45.324-13.426-70.065-13.426-105.867,0-192,86.133-192,192s86.133,192 192,192 192-86.133 192-192c0-24.741-4.864-48.327-13.426-70.065 1.402-1.007 2.79-2.049 4.051-3.31l16-16c12.5-12.492 12.5-32.758 0-45.25l-20.688-20.688 9.375-9.375 32.001-31.999zm-219.313,100.687c-52.938,0-96,43.063-96,96 0,8.836-7.164,16-16,16s-16-7.164-16-16c0-70.578 57.422-128 128-128 8.836,0 16,7.164 16,16s-7.164,16-16,16z"),i.append("path").attr("class","error-icon").attr("d","m459.02,148.98c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l16,16c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16.001-16z"),i.append("path").attr("class","error-icon").attr("d","m340.395,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16-16c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l15.999,16z"),i.append("path").attr("class","error-icon").attr("d","m400,64c8.844,0 16-7.164 16-16v-32c0-8.836-7.156-16-16-16-8.844,0-16,7.164-16,16v32c0,8.836 7.156,16 16,16z"),i.append("path").attr("class","error-icon").attr("d","m496,96.586h-32c-8.844,0-16,7.164-16,16 0,8.836 7.156,16 16,16h32c8.844,0 16-7.164 16-16 0-8.836-7.156-16-16-16z"),i.append("path").attr("class","error-icon").attr("d","m436.98,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688l32-32c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32c-6.251,6.25-6.251,16.375-0.001,22.625z"),i.append("text").attr("class","error-text").attr("x",1440).attr("y",250).attr("font-size","150px").style("text-anchor","middle").text("Syntax error in text"),i.append("text").attr("class","error-text").attr("x",1250).attr("y",400).attr("font-size","100px").style("text-anchor","middle").text(`mermaid version ${r}`)},"draw"),AH={draw:U_e},H_e=AH,Y_e={db:{},renderer:AH,parser:{parse:x(()=>{},"parse")}},X_e=Y_e,_H="flowchart-elk",K_e=x((t,e={})=>{var r;return/^\s*flowchart-elk/.test(t)||/^\s*(flowchart|graph)/.test(t)&&((r=e==null?void 0:e.flowchart)==null?void 0:r.defaultRenderer)==="elk"?(e.layout="elk",!0):!1},"detector"),j_e=x(async()=>{const{diagram:t}=await Promise.resolve().then(()=>xI);return{id:_H,diagram:t}},"loader"),Z_e={id:_H,detector:K_e,loader:j_e},Q_e=Z_e,RH="timeline",J_e=x(t=>/^\s*timeline/.test(t),"detector"),e7e=x(async()=>{const{diagram:t}=await Promise.resolve().then(()=>bht);return{id:RH,diagram:t}},"loader"),t7e={id:RH,detector:J_e,loader:e7e},r7e=t7e,LH="mindmap",n7e=x(t=>/^\s*mindmap/.test(t),"detector"),i7e=x(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Oht);return{id:LH,diagram:t}},"loader"),a7e={id:LH,detector:n7e,loader:i7e},s7e=a7e,IH="kanban",o7e=x(t=>/^\s*kanban/.test(t),"detector"),l7e=x(async()=>{const{diagram:t}=await Promise.resolve().then(()=>tdt);return{id:IH,diagram:t}},"loader"),c7e={id:IH,detector:o7e,loader:l7e},u7e=c7e,DH="sankey",h7e=x(t=>/^\s*sankey(-beta)?/.test(t),"detector"),d7e=x(async()=>{const{diagram:t}=await Promise.resolve().then(()=>zdt);return{id:DH,diagram:t}},"loader"),f7e={id:DH,detector:h7e,loader:d7e},p7e=f7e,MH="packet",g7e=x(t=>/^\s*packet(-beta)?/.test(t),"detector"),m7e=x(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Zdt);return{id:MH,diagram:t}},"loader"),y7e={id:MH,detector:g7e,loader:m7e},NH="radar",v7e=x(t=>/^\s*radar-beta/.test(t),"detector"),b7e=x(async()=>{const{diagram:t}=await Promise.resolve().then(()=>vft);return{id:NH,diagram:t}},"loader"),x7e={id:NH,detector:v7e,loader:b7e},OH="block",T7e=x(t=>/^\s*block(-beta)?/.test(t),"detector"),w7e=x(async()=>{const{diagram:t}=await Promise.resolve().then(()=>H0t);return{id:OH,diagram:t}},"loader"),C7e={id:OH,detector:T7e,loader:w7e},k7e=C7e,$H="treeView",E7e=x(t=>/^\s*treeView-beta/.test(t),"detector"),S7e=x(async()=>{const{diagram:t}=await Promise.resolve().then(()=>hpt);return{id:$H,diagram:t}},"loader"),A7e={id:$H,detector:E7e,loader:S7e},_7e=A7e,PH="architecture",R7e=x(t=>/^\s*architecture/.test(t),"detector"),L7e=x(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Fpt);return{id:PH,diagram:t}},"loader"),I7e={id:PH,detector:R7e,loader:L7e},D7e=I7e,BH="eventmodeling",M7e=x(t=>/^\s*eventmodeling/.test(t),"detector"),N7e=x(async()=>{const{diagram:t}=await Promise.resolve().then(()=>tgt);return{id:BH,diagram:t}},"loader"),O7e={id:BH,detector:M7e,loader:N7e},$7e=O7e,FH="ishikawa",P7e=x(t=>/^\s*ishikawa(-beta)?\b/i.test(t),"detector"),B7e=x(async()=>{const{diagram:t}=await Promise.resolve().then(()=>vgt);return{id:FH,diagram:t}},"loader"),F7e={id:FH,detector:P7e,loader:B7e},zH="venn",z7e=x(t=>/^\s*venn-beta/.test(t),"detector"),G7e=x(async()=>{const{diagram:t}=await Promise.resolve().then(()=>nmt);return{id:zH,diagram:t}},"loader"),q7e={id:zH,detector:z7e,loader:G7e},V7e=q7e,GH="treemap",W7e=x(t=>/^\s*treemap/.test(t),"detector"),U7e=x(async()=>{const{diagram:t}=await Promise.resolve().then(()=>pmt);return{id:GH,diagram:t}},"loader"),H7e={id:GH,detector:W7e,loader:U7e},qH="wardley-beta",Y7e=x(t=>/^\s*wardley-beta/i.test(t),"detector"),X7e=x(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Smt);return{id:qH,diagram:t}},"loader"),K7e={id:qH,detector:Y7e,loader:X7e},j7e=K7e,VH=!1,uC=x(()=>{VH||(VH=!0,Iw("error",X_e,t=>t.toLowerCase().trim()==="error"),Iw("---",{db:{clear:x(()=>{},"clear")},styles:{},renderer:{draw:x(()=>{},"draw")},parser:{parse:x(()=>{throw new Error("Diagrams beginning with --- are not valid. If you were trying to use a YAML front-matter, please ensure that you've correctly opened and closed the YAML front-matter with un-indented `---` blocks")},"parse")},init:x(()=>null,"init")},t=>t.toLowerCase().trimStart().startsWith("---")),E6(Q_e,s7e,D7e),E6($Ae,u7e,D_e,__e,XAe,r_e,a_e,l_e,x_e,k_e,WAe,zAe,r7e,QAe,z_e,$_e,W_e,d_e,p7e,y7e,m_e,k7e,$7e,_7e,x7e,F7e,H7e,V7e,j7e))},"addDiagrams"),Z7e=x(async()=>{ae.debug("Loading registered diagrams");const e=(await Promise.allSettled(Object.entries(Vh).map(async([r,{detector:n,loader:i}])=>{if(i)try{B6(r)}catch{try{const{diagram:a,id:s}=await i();Iw(s,a,n)}catch(a){throw ae.error(`Failed to load external diagram with key ${r}. Removing from detectors.`),delete Vh[r],a}}}))).filter(r=>r.status==="rejected");if(e.length>0){ae.error(`Failed to load ${e.length} external diagrams`);for(const r of e)ae.error(r);throw new Error(`Failed to load ${e.length} external diagrams`)}},"loadRegisteredDiagrams"),Q7e="graphics-document document";function WH(t,e){t.attr("role",Q7e),e!==""&&t.attr("aria-roledescription",e)}x(WH,"setA11yDiagramInfo");function UH(t,e,r,n){if(t.insert!==void 0){if(r){const i=`chart-desc-${n}`;t.attr("aria-describedby",i),t.insert("desc",":first-child").attr("id",i).text(r)}if(e){const i=`chart-title-${n}`;t.attr("aria-labelledby",i),t.insert("title",":first-child").attr("id",i).text(e)}}}x(UH,"addSVGa11yTitleDescription");var i7=(o0=class{constructor(e,r,n,i,a){this.type=e,this.text=r,this.db=n,this.parser=i,this.renderer=a}static async fromText(e,r={}){var u,h;const n=lr(),i=k6(e,n);e=OEe(e)+` -`;try{B6(i)}catch{const d=Mbe(i);if(!d)throw new bB(`Diagram ${i} not found.`);const{id:f,diagram:p}=await d();Iw(f,p)}const{db:a,parser:s,renderer:o,init:l}=B6(i);return s.parser&&(s.parser.yy=a),(u=a.clear)==null||u.call(a),l==null||l(n),r.title&&((h=a.setDiagramTitle)==null||h.call(a,r.title)),await s.parse(e),new o0(i,e,a,s,o)}async render(e,r){await this.renderer.draw(this.text,e,r,this)}getParser(){return this.parser}getType(){return this.type}},x(o0,"Diagram"),o0),HH=[],J7e=x(()=>{HH.forEach(t=>{t()}),HH=[]},"attachFunctions"),e8e=x(t=>t.replace(/^\s*%%(?!{)[^\n]+\n?/gm,"").trimStart(),"cleanupComments");function YH(t){const e=t.match(vB);if(!e)return{text:t,metadata:{}};let r=_4(e[1],{schema:A4})??{};r=typeof r=="object"&&!Array.isArray(r)?r:{};const n={};return r.displayMode&&(n.displayMode=r.displayMode.toString()),r.title&&(n.title=r.title.toString()),r.config&&(n.config=r.config),{text:t.slice(e[0].length),metadata:n}}x(YH,"extractFrontMatter");var t8e=x(t=>t.replace(/\r\n?/g,` -`).replace(/<(\w+)([^>]*)>/g,(e,r,n)=>"<"+r+n.replace(/="([^"]*)"/g,"='$1'")+">"),"cleanupText"),r8e=x(t=>{const{text:e,metadata:r}=YH(t),{displayMode:n,title:i,config:a={}}=r;return n&&(a.gantt||(a.gantt={}),a.gantt.displayMode=n),{title:i,config:a,text:e}},"processFrontmatter"),n8e=x(t=>{const e=Lr.detectInit(t)??{},r=Lr.detectDirective(t,"wrap");return Array.isArray(r)?e.wrap=r.some(({type:n})=>n==="wrap"):(r==null?void 0:r.type)==="wrap"&&(e.wrap=!0),{text:EEe(t),directive:e}},"processDirectives");function a7(t){const e=t8e(t),r=r8e(e),n=n8e(r.text),i=ti(r.config,n.directive);return t=e8e(n.text),{code:t,title:r.title,config:i}}x(a7,"preprocessDiagram");function XH(t){const e=new TextEncoder().encode(t),r=Array.from(e,n=>String.fromCodePoint(n)).join("");return btoa(r)}x(XH,"toBase64");var i8e=5e4,a8e="graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa",s8e="sandbox",o8e="loose",l8e="http://www.w3.org/2000/svg",c8e="http://www.w3.org/1999/xlink",u8e="http://www.w3.org/1999/xhtml",h8e="100%",d8e="100%",f8e="border:0;margin:0;",p8e="margin:0",g8e="allow-top-navigation-by-user-activation allow-popups",m8e='The "iframe" tag is not supported by your browser.',y8e=["foreignobject"],v8e=["dominant-baseline"];function s7(t){const e=a7(t);return Sw(),axe(e.config??{}),e}x(s7,"processAndSetConfigs");async function KH(t,e){uC();try{const{code:r,config:n}=s7(t);return{diagramType:(await JH(r)).type,config:n}}catch(r){if(e!=null&&e.suppressErrors)return!1;throw r}}x(KH,"parse");var jH=x((t,e,r=[])=>{const n=CB(`{ ${r.join(" !important; ")} !important; }`);return`.${t} ${e} ${n}`},"cssImportantStyles"),b8e=x((t,e=new Map)=>{const r=new CSSStyleSheet;if(t.fontFamily!==void 0&&r.insertRule(`:root { --mermaid-font-family: ${t.fontFamily}}`,r.cssRules.length),t.altFontFamily!==void 0&&r.insertRule(`:root { --mermaid-alt-font-family: ${t.altFontFamily}}`,r.cssRules.length),e instanceof Map){const o=on(t)?["> *","span"]:["rect","polygon","ellipse","circle","path"];e.forEach(l=>{Qq(l.styles)||o.forEach(u=>{r.insertRule(jH(l.id,u,l.styles),r.cssRules.length)}),Qq(l.textStyles)||r.insertRule(jH(l.id,"tspan",((l==null?void 0:l.textStyles)||[]).map(u=>u.replace("color","fill"))),r.cssRules.length)})}let n="";if(t.themeCSS!==void 0)if(typeof r.replaceSync=="function"){const i=new CSSStyleSheet;i.replaceSync(t.themeCSS),n=R6(i)+` + L0,20`).attr("stroke-linejoin","miter")},"requirement_arrow_neo"),_De=T((t,e,r)=>{const n=t.append("defs").append("marker").attr("id",r+"_"+e+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("g");n.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),n.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),n.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10)},"requirement_contains"),ADe=T((t,e,r)=>{const n=pr(),{themeVariables:i}=n,{strokeWidth:a}=i,s=t.append("defs").append("marker").attr("id",r+"_"+e+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("g");s.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),s.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),s.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10),s.selectAll("*").attr("stroke-width",`${a}`)},"requirement_contains_neo"),RDe={extension:oDe,composition:lDe,aggregation:cDe,dependency:uDe,lollipop:hDe,point:dDe,circle:fDe,cross:pDe,barb:gDe,barbNeo:mDe,only_one:yDe,zero_or_one:vDe,one_or_more:bDe,zero_or_more:xDe,only_one_neo:TDe,zero_or_one_neo:wDe,one_or_more_neo:CDe,zero_or_more_neo:kDe,requirement_arrow:EDe,requirement_contains:_De,requirement_arrow_neo:SDe,requirement_contains_neo:ADe},RK=sDe,LDe={common:Dt,getConfig:pr,insertCluster:q8,insertEdge:SK,insertEdgeLabel:TK,insertMarkers:RK,insertNode:uE,interpolateToCurve:l8,labelHelper:Sr,log:se,positionEdgeLabel:wK},Bx={},LK=T(t=>{for(const e of t)Bx[e.name]=e},"registerLayoutLoaders"),IDe=T(()=>{LK([{name:"dagre",loader:T(async()=>await Promise.resolve().then(()=>HHe),"loader")},{name:"cose-bilkent",loader:T(async()=>await Promise.resolve().then(()=>OJe),"loader")}])},"registerDefaultLayoutLoaders");IDe();var fg=T(async(t,e)=>{if(!(t.layoutAlgorithm in Bx))throw new Error(`Unknown layout algorithm: ${t.layoutAlgorithm}`);if(t.diagramId)for(const h of t.nodes){const d=h.domId||h.id;h.domId=`${t.diagramId}-${d}`}const r=Bx[t.layoutAlgorithm],n=await r.loader(),{theme:i,themeVariables:a}=t.config,{useGradient:s,gradientStart:o,gradientStop:l}=a,u=e.attr("id");if(e.append("defs").append("filter").attr("id",`${u}-drop-shadow`).attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",`${i!=null&&i.includes("dark")?"#FFFFFF":"#000000"}`),e.append("defs").append("filter").attr("id",`${u}-drop-shadow-small`).attr("height","150%").attr("width","150%").append("feDropShadow").attr("dx","2").attr("dy","2").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",`${i!=null&&i.includes("dark")?"#FFFFFF":"#000000"}`),s){const h=e.append("linearGradient").attr("id",e.attr("id")+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");h.append("svg:stop").attr("offset","0%").attr("stop-color",o).attr("stop-opacity",1),h.append("svg:stop").attr("offset","100%").attr("stop-color",l).attr("stop-opacity",1)}return n.render(t,e,LDe,{algorithm:r.algorithm})},"render"),Fx=T((t="",{fallback:e="dagre"}={})=>{if(t in Bx)return t;if(e in Bx)return se.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"),K8="comm",IK="rule",DK="decl",DDe="@media",MDe="@import",NDe="@supports",$De="@namespace",Z8="@keyframes",MK="@layer",ODe="@scope",PDe=Math.abs,zx=String.fromCharCode;function NK(t){return t.trim()}function Q8(t,e,r){return t.replace(e,r)}function pg(t,e){return t.charCodeAt(e)|0}function gg(t,e,r){return t.slice(e,r)}function sc(t){return t.length}function $K(t){return t.length}function dE(t,e){return e.push(t),t}var fE=1,mg=1,OK=0,qo=0,Ui=0,yg="";function J8(t,e,r,n,i,a,s,o){return{value:t,root:e,parent:r,type:n,props:i,children:a,line:fE,column:mg,length:s,return:"",siblings:o}}function BDe(){return Ui}function FDe(){return Ui=qo>0?pg(yg,--qo):0,mg--,Ui===10&&(mg=1,fE--),Ui}function xl(){return Ui=qo2||Gx(Ui)>3?"":" "}function VDe(t,e){for(;--e&&xl()&&!(Ui<48||Ui>102||Ui>57&&Ui<65||Ui>70&&Ui<97););return gE(t,pE()+(e<6&&Nh()==32&&xl()==32))}function tL(t){for(;xl();)switch(Ui){case t:return qo;case 34:case 39:t!==34&&t!==39&&tL(Ui);break;case 40:t===41&&tL(t);break;case 92:xl();break}return qo}function WDe(t,e){for(;xl()&&t+Ui!==57;)if(t+Ui===84&&Nh()===47)break;return"/*"+gE(e,qo-1)+"*"+zx(t===47?t:xl())}function UDe(t){for(;!Gx(Nh());)xl();return gE(t,qo)}function HDe(t){return GDe(mE("",null,null,null,[""],t=zDe(t),0,[0],t))}function mE(t,e,r,n,i,a,s,o,l){for(var u=0,h=0,d=s,f=0,p=0,g=0,m=1,y=1,v=1,x=0,b=0,w="",C=i,_=a,k=n,S=w;y;)switch(g=b,b=xl()){case 40:g!=108&&pg(S,d-1)==58?(x++,S+="("):S+=eL(b);break;case 41:x--,S+=")";break;case 34:case 39:case 91:S+=eL(b);break;case 9:case 10:case 13:case 32:if(x>0){S+=zx(b);break}S+=qDe(g);break;case 92:S+=VDe(pE()-1,7);continue;case 47:switch(Nh()){case 42:case 47:dE(YDe(WDe(xl(),pE()),e,r,l),l),(Gx(g||1)==5||Gx(Nh()||1)==5)&&sc(S)&&gg(S,-1,void 0)!==" "&&(S+=" ");break;default:S+="/"}break;case 123*m:o[u++]=sc(S)*v;case 125*m:case 59:case 0:if(x>0&&b){S+=zx(b);break}switch(b){case 0:case 125:y=0;case 59+h:v==-1&&(S=Q8(S,/\f/g,"")),p>0&&(sc(S)-d||m===0)&&dE(p>32?BK(S+";",n,r,d-1,l):BK(Q8(S," ","")+";",n,r,d-2,l),l);break;case 59:S+=";";default:if(dE(k=PK(S,e,r,u,h,i,o,w,C=[],_=[],d,a),a),b===123)if(h===0)mE(S,e,k,k,C,a,d,o,_);else{switch(f){case 99:if(pg(S,3)===110)break;case 108:if(pg(S,2)===97)break;default:h=0;case 100:case 109:case 115:}h?mE(t,k,k,n&&dE(PK(t,k,k,0,0,i,o,w,i,C=[],d,_),_),i,_,d,o,n?C:_):mE(S,k,k,k,[""],_,0,o,_)}}u=h=p=0,m=v=1,w=S="",d=s;break;case 58:d=1+sc(S),p=g;default:if(m<1){if(b==123)--m;else if(b==125&&m++==0&&FDe()==125)continue}switch(S+=zx(b),b*m){case 38:v=h>0?1:(S+="\f",-1);break;case 44:if(x>0)break;o[u++]=(sc(S)-1)*v,v=1;break;case 64:Nh()===45&&(S+=eL(xl())),f=Nh(),h=d=sc(w=S+=UDe(pE())),b++;break;case 45:g===45&&sc(S)==2&&(m=0)}}return a}function PK(t,e,r,n,i,a,s,o,l,u,h,d){for(var f=i-1,p=i===0?a:[""],g=$K(p),m=0,y=0,v=0;m0?p[x]+" "+b:Q8(b,/&\f/g,p[x])))&&(l[v++]=w);return J8(t,e,r,i===0?IK:o,l,u,h,d)}function YDe(t,e,r,n){return J8(t,e,r,K8,zx(BDe()),gg(t,2,-2),0,n)}function BK(t,e,r,n,i){return J8(t,e,r,DK,gg(t,0,n),gg(t,n+1,-1),n,i)}function rL(t,e){for(var r="",n=0;n/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(t),"detector"),ZDe=T(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Met);return{id:FK,diagram:t}},"loader"),QDe={id:FK,detector:KDe,loader:ZDe},JDe=QDe,zK="flowchart",e9e=T((t,e)=>{var r,n;return((r=e==null?void 0:e.flowchart)==null?void 0:r.defaultRenderer)==="dagre-wrapper"||((n=e==null?void 0:e.flowchart)==null?void 0:n.defaultRenderer)==="elk"?!1:/^\s*graph/.test(t)},"detector"),t9e=T(async()=>{const{diagram:t}=await Promise.resolve().then(()=>jN);return{id:zK,diagram:t}},"loader"),r9e={id:zK,detector:e9e,loader:t9e},n9e=r9e,GK="flowchart-v2",i9e=T((t,e)=>{var r,n,i;return((r=e==null?void 0:e.flowchart)==null?void 0:r.defaultRenderer)==="dagre-d3"?!1:(((n=e==null?void 0:e.flowchart)==null?void 0:n.defaultRenderer)==="elk"&&(e.layout="elk"),/^\s*graph/.test(t)&&((i=e==null?void 0:e.flowchart)==null?void 0:i.defaultRenderer)==="dagre-wrapper"?!0:/^\s*flowchart/.test(t))},"detector"),a9e=T(async()=>{const{diagram:t}=await Promise.resolve().then(()=>jN);return{id:GK,diagram:t}},"loader"),s9e={id:GK,detector:i9e,loader:a9e},o9e=s9e,qK="er",l9e=T(t=>/^\s*erDiagram/.test(t),"detector"),c9e=T(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Jet);return{id:qK,diagram:t}},"loader"),u9e={id:qK,detector:l9e,loader:c9e},h9e=u9e,VK="gitGraph",d9e=T(t=>/^\s*gitGraph/.test(t),"detector"),f9e=T(async()=>{const{diagram:t}=await Promise.resolve().then(()=>ngt);return{id:VK,diagram:t}},"loader"),p9e={id:VK,detector:d9e,loader:f9e},g9e=p9e,WK="gantt",m9e=T(t=>/^\s*gantt/.test(t),"detector"),y9e=T(async()=>{const{diagram:t}=await Promise.resolve().then(()=>hmt);return{id:WK,diagram:t}},"loader"),v9e={id:WK,detector:m9e,loader:y9e},b9e=v9e,UK="info",x9e=T(t=>/^\s*info/.test(t),"detector"),T9e=T(async()=>{const{diagram:t}=await Promise.resolve().then(()=>bmt);return{id:UK,diagram:t}},"loader"),w9e={id:UK,detector:x9e,loader:T9e},HK="pie",C9e=T(t=>/^\s*pie/.test(t),"detector"),k9e=T(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Omt);return{id:HK,diagram:t}},"loader"),E9e={id:HK,detector:C9e,loader:k9e},YK="quadrantChart",S9e=T(t=>/^\s*quadrantChart/.test(t),"detector"),_9e=T(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Umt);return{id:YK,diagram:t}},"loader"),A9e={id:YK,detector:S9e,loader:_9e},R9e=A9e,XK="xychart",L9e=T(t=>/^\s*xychart(-beta)?/.test(t),"detector"),I9e=T(async()=>{const{diagram:t}=await Promise.resolve().then(()=>s1t);return{id:XK,diagram:t}},"loader"),D9e={id:XK,detector:L9e,loader:I9e},M9e=D9e,jK="requirement",N9e=T(t=>/^\s*requirement(Diagram)?/.test(t),"detector"),$9e=T(async()=>{const{diagram:t}=await Promise.resolve().then(()=>p1t);return{id:jK,diagram:t}},"loader"),O9e={id:jK,detector:N9e,loader:$9e},P9e=O9e,KK="sequence",B9e=T(t=>/^\s*sequenceDiagram/.test(t),"detector"),F9e=T(async()=>{const{diagram:t}=await Promise.resolve().then(()=>cyt);return{id:KK,diagram:t}},"loader"),z9e={id:KK,detector:B9e,loader:F9e},G9e=z9e,ZK="class",q9e=T((t,e)=>{var r;return((r=e==null?void 0:e.class)==null?void 0:r.defaultRenderer)==="dagre-wrapper"?!1:/^\s*classDiagram/.test(t)},"detector"),V9e=T(async()=>{const{diagram:t}=await Promise.resolve().then(()=>gyt);return{id:ZK,diagram:t}},"loader"),W9e={id:ZK,detector:q9e,loader:V9e},U9e=W9e,QK="classDiagram",H9e=T((t,e)=>{var r;return/^\s*classDiagram/.test(t)&&((r=e==null?void 0:e.class)==null?void 0:r.defaultRenderer)==="dagre-wrapper"?!0:/^\s*classDiagram-v2/.test(t)},"detector"),Y9e=T(async()=>{const{diagram:t}=await Promise.resolve().then(()=>yyt);return{id:QK,diagram:t}},"loader"),X9e={id:QK,detector:H9e,loader:Y9e},j9e=X9e,JK="state",K9e=T((t,e)=>{var r;return((r=e==null?void 0:e.state)==null?void 0:r.defaultRenderer)==="dagre-wrapper"?!1:/^\s*stateDiagram/.test(t)},"detector"),Z9e=T(async()=>{const{diagram:t}=await Promise.resolve().then(()=>svt);return{id:JK,diagram:t}},"loader"),Q9e={id:JK,detector:K9e,loader:Z9e},J9e=Q9e,eZ="stateDiagram",eMe=T((t,e)=>{var r;return!!(/^\s*stateDiagram-v2/.test(t)||/^\s*stateDiagram/.test(t)&&((r=e==null?void 0:e.state)==null?void 0:r.defaultRenderer)==="dagre-wrapper")},"detector"),tMe=T(async()=>{const{diagram:t}=await Promise.resolve().then(()=>lvt);return{id:eZ,diagram:t}},"loader"),rMe={id:eZ,detector:eMe,loader:tMe},nMe=rMe,tZ="journey",iMe=T(t=>/^\s*journey/.test(t),"detector"),aMe=T(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Lvt);return{id:tZ,diagram:t}},"loader"),sMe={id:tZ,detector:iMe,loader:aMe},oMe=sMe,lMe=T((t,e,r)=>{se.debug(`rendering svg for syntax error +`);const n=Ys(e),i=n.append("g");n.attr("viewBox","0 0 2412 512"),Wi(n,100,512,!0),i.append("path").attr("class","error-icon").attr("d","m411.313,123.313c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32-9.375,9.375-20.688-20.688c-12.484-12.5-32.766-12.5-45.25,0l-16,16c-1.261,1.261-2.304,2.648-3.31,4.051-21.739-8.561-45.324-13.426-70.065-13.426-105.867,0-192,86.133-192,192s86.133,192 192,192 192-86.133 192-192c0-24.741-4.864-48.327-13.426-70.065 1.402-1.007 2.79-2.049 4.051-3.31l16-16c12.5-12.492 12.5-32.758 0-45.25l-20.688-20.688 9.375-9.375 32.001-31.999zm-219.313,100.687c-52.938,0-96,43.063-96,96 0,8.836-7.164,16-16,16s-16-7.164-16-16c0-70.578 57.422-128 128-128 8.836,0 16,7.164 16,16s-7.164,16-16,16z"),i.append("path").attr("class","error-icon").attr("d","m459.02,148.98c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l16,16c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16.001-16z"),i.append("path").attr("class","error-icon").attr("d","m340.395,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16-16c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l15.999,16z"),i.append("path").attr("class","error-icon").attr("d","m400,64c8.844,0 16-7.164 16-16v-32c0-8.836-7.156-16-16-16-8.844,0-16,7.164-16,16v32c0,8.836 7.156,16 16,16z"),i.append("path").attr("class","error-icon").attr("d","m496,96.586h-32c-8.844,0-16,7.164-16,16 0,8.836 7.156,16 16,16h32c8.844,0 16-7.164 16-16 0-8.836-7.156-16-16-16z"),i.append("path").attr("class","error-icon").attr("d","m436.98,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688l32-32c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32c-6.251,6.25-6.251,16.375-0.001,22.625z"),i.append("text").attr("class","error-text").attr("x",1440).attr("y",250).attr("font-size","150px").style("text-anchor","middle").text("Syntax error in text"),i.append("text").attr("class","error-text").attr("x",1250).attr("y",400).attr("font-size","100px").style("text-anchor","middle").text(`mermaid version ${r}`)},"draw"),rZ={draw:lMe},cMe=rZ,uMe={db:{},renderer:rZ,parser:{parse:T(()=>{},"parse")}},hMe=uMe,nZ="flowchart-elk",dMe=T((t,e={})=>{var r;return/^\s*flowchart-elk/.test(t)||/^\s*(flowchart|graph)/.test(t)&&((r=e==null?void 0:e.flowchart)==null?void 0:r.defaultRenderer)==="elk"?(e.layout="elk",!0):!1},"detector"),fMe=T(async()=>{const{diagram:t}=await Promise.resolve().then(()=>jN);return{id:nZ,diagram:t}},"loader"),pMe={id:nZ,detector:dMe,loader:fMe},gMe=pMe,iZ="timeline",mMe=T(t=>/^\s*timeline/.test(t),"detector"),yMe=T(async()=>{const{diagram:t}=await Promise.resolve().then(()=>a2t);return{id:iZ,diagram:t}},"loader"),vMe={id:iZ,detector:mMe,loader:yMe},bMe=vMe,aZ="mindmap",xMe=T(t=>/^\s*mindmap/.test(t),"detector"),TMe=T(async()=>{const{diagram:t}=await Promise.resolve().then(()=>T2t);return{id:aZ,diagram:t}},"loader"),wMe={id:aZ,detector:xMe,loader:TMe},CMe=wMe,sZ="kanban",kMe=T(t=>/^\s*kanban/.test(t),"detector"),EMe=T(async()=>{const{diagram:t}=await Promise.resolve().then(()=>G2t);return{id:sZ,diagram:t}},"loader"),SMe={id:sZ,detector:kMe,loader:EMe},_Me=SMe,oZ="sankey",AMe=T(t=>/^\s*sankey(-beta)?/.test(t),"detector"),RMe=T(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Sbt);return{id:oZ,diagram:t}},"loader"),LMe={id:oZ,detector:AMe,loader:RMe},IMe=LMe,lZ="packet",DMe=T(t=>/^\s*packet(-beta)?/.test(t),"detector"),MMe=T(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Pbt);return{id:lZ,diagram:t}},"loader"),NMe={id:lZ,detector:DMe,loader:MMe},cZ="radar",$Me=T(t=>/^\s*radar-beta/.test(t),"detector"),OMe=T(async()=>{const{diagram:t}=await Promise.resolve().then(()=>ixt);return{id:cZ,diagram:t}},"loader"),PMe={id:cZ,detector:$Me,loader:OMe},uZ="block",BMe=T(t=>/^\s*block(-beta)?/.test(t),"detector"),FMe=T(async()=>{const{diagram:t}=await Promise.resolve().then(()=>DTt);return{id:uZ,diagram:t}},"loader"),zMe={id:uZ,detector:BMe,loader:FMe},GMe=zMe,hZ="treeView",qMe=T(t=>/^\s*treeView-beta/.test(t),"detector"),VMe=T(async()=>{const{diagram:t}=await Promise.resolve().then(()=>ZTt);return{id:hZ,diagram:t}},"loader"),WMe={id:hZ,detector:qMe,loader:VMe},UMe=WMe,dZ="architecture",HMe=T(t=>/^\s*architecture/.test(t),"detector"),YMe=T(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Ewt);return{id:dZ,diagram:t}},"loader"),XMe={id:dZ,detector:HMe,loader:YMe},jMe=XMe,fZ="eventmodeling",KMe=T(t=>/^\s*eventmodeling/.test(t),"detector"),ZMe=T(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Gwt);return{id:fZ,diagram:t}},"loader"),QMe={id:fZ,detector:KMe,loader:ZMe},JMe=QMe,pZ="ishikawa",eNe=T(t=>/^\s*ishikawa(-beta)?\b/i.test(t),"detector"),tNe=T(async()=>{const{diagram:t}=await Promise.resolve().then(()=>iCt);return{id:pZ,diagram:t}},"loader"),rNe={id:pZ,detector:eNe,loader:tNe},gZ="venn",nNe=T(t=>/^\s*venn-beta/.test(t),"detector"),iNe=T(async()=>{const{diagram:t}=await Promise.resolve().then(()=>VCt);return{id:gZ,diagram:t}},"loader"),aNe={id:gZ,detector:nNe,loader:iNe},sNe=aNe,mZ="treemap",oNe=T(t=>/^\s*treemap/.test(t),"detector"),lNe=T(async()=>{const{diagram:t}=await Promise.resolve().then(()=>e4t);return{id:mZ,diagram:t}},"loader"),cNe={id:mZ,detector:oNe,loader:lNe},yZ="wardley-beta",uNe=T(t=>/^\s*wardley-beta/i.test(t),"detector"),hNe=T(async()=>{const{diagram:t}=await Promise.resolve().then(()=>d4t);return{id:yZ,diagram:t}},"loader"),dNe={id:yZ,detector:uNe,loader:hNe},fNe=dNe,vZ=!1,yE=T(()=>{vZ||(vZ=!0,B4("error",hMe,t=>t.toLowerCase().trim()==="error"),B4("---",{db:{clear:T(()=>{},"clear")},styles:{},renderer:{draw:T(()=>{},"draw")},parser:{parse:T(()=>{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:T(()=>null,"init")},t=>t.toLowerCase().trimStart().startsWith("---")),k7(gMe,CMe,jMe),k7(JDe,_Me,j9e,U9e,h9e,b9e,w9e,E9e,P9e,G9e,o9e,n9e,bMe,g9e,nMe,J9e,oMe,R9e,IMe,NMe,M9e,GMe,JMe,UMe,PMe,rNe,cNe,sNe,fNe))},"addDiagrams"),pNe=T(async()=>{se.debug("Loading registered diagrams");const e=(await Promise.allSettled(Object.entries(Ud).map(async([r,{detector:n,loader:i}])=>{if(i)try{P7(r)}catch{try{const{diagram:a,id:s}=await i();B4(s,a,n)}catch(a){throw se.error(`Failed to load external diagram with key ${r}. Removing from detectors.`),delete Ud[r],a}}}))).filter(r=>r.status==="rejected");if(e.length>0){se.error(`Failed to load ${e.length} external diagrams`);for(const r of e)se.error(r);throw new Error(`Failed to load ${e.length} external diagrams`)}},"loadRegisteredDiagrams"),gNe="graphics-document document";function bZ(t,e){t.attr("role",gNe),e!==""&&t.attr("aria-roledescription",e)}T(bZ,"setA11yDiagramInfo");function xZ(t,e,r,n){if(t.insert!==void 0){if(r){const i=`chart-desc-${n}`;t.attr("aria-describedby",i),t.insert("desc",":first-child").attr("id",i).text(r)}if(e){const i=`chart-title-${n}`;t.attr("aria-labelledby",i),t.insert("title",":first-child").attr("id",i).text(e)}}}T(xZ,"addSVGa11yTitleDescription");var nL=(C0=class{constructor(e,r,n,i,a){this.type=e,this.text=r,this.db=n,this.parser=i,this.renderer=a}static async fromText(e,r={}){var u,h;const n=pr(),i=C7(e,n);e=Q8e(e)+` +`;try{P7(i)}catch{const d=KEe(i);if(!d)throw new Xq(`Diagram ${i} not found.`);const{id:f,diagram:p}=await d();B4(f,p)}const{db:a,parser:s,renderer:o,init:l}=P7(i);return s.parser&&(s.parser.yy=a),(u=a.clear)==null||u.call(a),l==null||l(n),r.title&&((h=a.setDiagramTitle)==null||h.call(a,r.title)),await s.parse(e),new C0(i,e,a,s,o)}async render(e,r){await this.renderer.draw(this.text,e,r,this)}getParser(){return this.parser}getType(){return this.type}},T(C0,"Diagram"),C0),TZ=[],mNe=T(()=>{TZ.forEach(t=>{t()}),TZ=[]},"attachFunctions"),yNe=T(t=>t.replace(/^\s*%%(?!{)[^\n]+\n?/gm,"").trimStart(),"cleanupComments");function wZ(t){const e=t.match(Yq);if(!e)return{text:t,metadata:{}};let r=$k(e[1],{schema:Nk})??{};r=typeof r=="object"&&!Array.isArray(r)?r:{};const n={};return r.displayMode&&(n.displayMode=r.displayMode.toString()),r.title&&(n.title=r.title.toString()),r.config&&(n.config=r.config),{text:t.slice(e[0].length),metadata:n}}T(wZ,"extractFrontMatter");var vNe=T(t=>t.replace(/\r\n?/g,` +`).replace(/<(\w+)([^>]*)>/g,(e,r,n)=>"<"+r+n.replace(/="([^"]*)"/g,"='$1'")+">"),"cleanupText"),bNe=T(t=>{const{text:e,metadata:r}=wZ(t),{displayMode:n,title:i,config:a={}}=r;return n&&(a.gantt||(a.gantt={}),a.gantt.displayMode=n),{title:i,config:a,text:e}},"processFrontmatter"),xNe=T(t=>{const e=Pr.detectInit(t)??{},r=Pr.detectDirective(t,"wrap");return Array.isArray(r)?e.wrap=r.some(({type:n})=>n==="wrap"):(r==null?void 0:r.type)==="wrap"&&(e.wrap=!0),{text:q8e(t),directive:e}},"processDirectives");function iL(t){const e=vNe(t),r=bNe(e),n=xNe(r.text),i=wi(r.config,n.directive);return t=yNe(n.text),{code:t,title:r.title,config:i}}T(iL,"preprocessDiagram");function CZ(t){const e=new TextEncoder().encode(t),r=Array.from(e,n=>String.fromCodePoint(n)).join("");return btoa(r)}T(CZ,"toBase64");var TNe=5e4,wNe="graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa",CNe="sandbox",kNe="loose",ENe="http://www.w3.org/2000/svg",SNe="http://www.w3.org/1999/xlink",_Ne="http://www.w3.org/1999/xhtml",ANe="100%",RNe="100%",LNe="border:0;margin:0;",INe="margin:0",DNe="allow-top-navigation-by-user-activation allow-popups",MNe='The "iframe" tag is not supported by your browser.',NNe=["foreignobject"],$Ne=["dominant-baseline"];function aL(t){const e=iL(t);return M4(),w5e(e.config??{}),e}T(aL,"processAndSetConfigs");async function kZ(t,e){yE();try{const{code:r,config:n}=aL(t);return{diagramType:(await AZ(r)).type,config:n}}catch(r){if(e!=null&&e.suppressErrors)return!1;throw r}}T(kZ,"parse");var EZ=T((t,e,r=[])=>{const n=Qq(`{ ${r.join(" !important; ")} !important; }`);return`.${t} ${e} ${n}`},"cssImportantStyles"),ONe=T((t,e=new Map)=>{const r=new CSSStyleSheet;if(t.fontFamily!==void 0&&r.insertRule(`:root { --mermaid-font-family: ${t.fontFamily}}`,r.cssRules.length),t.altFontFamily!==void 0&&r.insertRule(`:root { --mermaid-alt-font-family: ${t.altFontFamily}}`,r.cssRules.length),e instanceof Map){const o=mn(t)?["> *","span"]:["rect","polygon","ellipse","circle","path"];e.forEach(l=>{_Y(l.styles)||o.forEach(u=>{r.insertRule(EZ(l.id,u,l.styles),r.cssRules.length)}),_Y(l.textStyles)||r.insertRule(EZ(l.id,"tspan",((l==null?void 0:l.textStyles)||[]).map(u=>u.replace("color","fill"))),r.cssRules.length)})}let n="";if(t.themeCSS!==void 0)if(typeof r.replaceSync=="function"){const i=new CSSStyleSheet;i.replaceSync(t.themeCSS),n=A7(i)+` `}else n+=`${t.themeCSS} -`;return n+R6(r)},"createCssStyles"),x8e=x((t,e)=>n7(RAe(`${t}{${e}}`),DAe([x(function(n,i,a,s){if(n.type==="rule"&&Array.isArray(n.props)){if(n.parent&&n.parent.type===Q_)return;n.props=n.props.map(o=>o.startsWith(t)?o:`${t} ${o}`)}else n.type.startsWith("@")&&([...[gAe,yAe,iH,bAe,"@container","@starting-style"],Q_].includes(n.type)||(ae.warn(`Removing unsupported at-rule ${n.type} from CSS`),n.type=Z_))},"addNamespace"),IAe])),"compileCSS"),T8e=x((t,e,r,n)=>{const i=b8e(t,r),a=Cxe(e,i,{...t.themeVariables,theme:t.theme,look:t.look},n);return x8e(n,a)},"createUserStyles"),w8e=x((t="",e,r)=>{let n=t;return!r&&!e&&(n=n.replace(/marker-end="url\([\d+./:=?A-Za-z-]*?#/g,'marker-end="url(#')),n=Tc(n),n=n.replace(/
    /g,"
    "),n},"cleanUpSvgCode"),C8e=x((t="",e)=>{var i,a;const r=(a=(i=e==null?void 0:e.viewBox)==null?void 0:i.baseVal)!=null&&a.height?e.viewBox.baseVal.height+"px":d8e,n=XH(`${t}`);return``},"putIntoIFrame"),ZH=x((t,e,r,n,i)=>{const a=t.append("div");a.attr("id",r),n&&a.attr("style",n);const s=a.append("svg").attr("id",e).attr("width","100%").attr("xmlns",l8e);return i&&s.attr("xmlns:xlink",i),s.append("g"),t},"appendDivSvgG");function o7(t,e){return t.append("iframe").attr("id",e).attr("style","width: 100%; height: 100%;").attr("sandbox","")}x(o7,"sandboxedIframe");var k8e=x((t,e,r,n)=>{var i,a,s;(i=t.getElementById(e))==null||i.remove(),(a=t.getElementById(r))==null||a.remove(),(s=t.getElementById(n))==null||s.remove()},"removeExistingElements"),E8e=x(async function(t,e,r){var z,F,S,R,N,D;uC();const n=s7(e);e=n.code;const i=lr();ae.debug(i),e.length>((i==null?void 0:i.maxTextSize)??i8e)&&(e=a8e);const a=`#${t}`,s="i"+t,o="#"+s,l="d"+t,u="#"+l,h=x(()=>{const $=pt(f?o:u).node();$&&"remove"in $&&$.remove()},"removeTempElements");let d=pt(document.body);const f=i.securityLevel===s8e,p=i.securityLevel===o8e,g=i.fontFamily;if(r!==void 0){if(r&&(r.innerHTML=""),f){const I=o7(pt(r),s);d=pt(I.nodes()[0].contentDocument.body),d.node().style.margin="0"}else d=pt(r);ZH(d,t,l,`font-family: ${g}`,c8e)}else{if(k8e(document,t,l,s),f){const I=o7(pt(document.body),s);d=pt(I.nodes()[0].contentDocument.body),d.node().style.margin="0"}else d=pt("body");ZH(d,t,l)}let m,y;try{m=await i7.fromText(e,{title:n.title})}catch(I){if(i.suppressErrorRendering)throw h(),I;m=await i7.fromText("error"),y=I}const v=d.select(u).node(),T=m.type,b=v.firstChild,w=b.firstChild,k=(F=(z=m.renderer).getClasses)==null?void 0:F.call(z,e,m),A=T8e(i,T,k,a),C=document.createElement("style");C.innerHTML=A,b.insertBefore(C,w);try{await m.renderer.draw(e,t,"11.15.0",m)}catch(I){throw i.suppressErrorRendering?h():H_e.draw(e,t,"11.15.0"),I}const _=d.select(`${u} svg`),L=(R=(S=m.db).getAccTitle)==null?void 0:R.call(S),O=(D=(N=m.db).getAccDescription)==null?void 0:D.call(N);eY(T,_,L,O),d.select(`[id="${t}"]`).selectAll("foreignobject > *").attr("xmlns",u8e);let M=d.select(u).node().innerHTML;if(ae.debug("config.arrowMarkerAbsolute",i.arrowMarkerAbsolute),M=w8e(M,f,hc(i.arrowMarkerAbsolute)),f){const I=d.select(u+" svg").node();M=C8e(M,I)}else p||(M=ku.sanitize(M,{ADD_TAGS:y8e,ADD_ATTR:v8e,HTML_INTEGRATION_POINTS:{foreignobject:!0}}));if(J7e(),y)throw y;return h(),{diagramType:T,svg:M,bindFunctions:m.db.bindFunctions}},"render");function QH(t={}){var n;const e=ci({},t);e!=null&&e.fontFamily&&!((n=e.themeVariables)!=null&&n.fontFamily)&&(e.themeVariables||(e.themeVariables={}),e.themeVariables.fontFamily=e.fontFamily),nxe(e),e!=null&&e.theme&&e.theme in uc?e.themeVariables=uc[e.theme].getThemeVariables(e.themeVariables):e&&(e.themeVariables=uc.default.getThemeVariables(e.themeVariables));const r=typeof e=="object"?rxe(e):kB();p6(r.logLevel),uC()}x(QH,"initialize");var JH=x((t,e={})=>{const{code:r}=a7(t);return i7.fromText(r,e)},"getDiagramFromText");function eY(t,e,r,n){WH(e,t),UH(e,r,n,e.attr("id"))}x(eY,"addA11yInfo");var pd=Object.freeze({render:E8e,parse:KH,getDiagramFromText:JH,initialize:QH,getConfig:lr,setConfig:EB,getSiteConfig:kB,updateSiteConfig:ixe,reset:x(()=>{Sw()},"reset"),globalReset:x(()=>{Sw(C0)},"globalReset"),defaultConfig:C0});p6(lr().logLevel),Sw(lr());var S8e=x((t,e,r)=>{ae.warn(t),f_(t)?(r&&r(t.str,t.hash),e.push({...t,message:t.str,error:t})):(r&&r(t),t instanceof Error&&e.push({str:t.message,message:t.message,hash:t.name,error:t}))},"handleError"),tY=x(async function(t={querySelector:".mermaid"}){try{await A8e(t)}catch(e){if(f_(e)&&ae.error(e.str),Fs.parseError&&Fs.parseError(e),!t.suppressErrors)throw ae.error("Use the suppressErrors option to suppress these errors"),e}},"run"),A8e=x(async function({postRenderCallback:t,querySelector:e,nodes:r}={querySelector:".mermaid"}){const n=pd.getConfig();ae.debug(`${t?"":"No "}Callback function found`);let i;if(r)i=r;else if(e)i=document.querySelectorAll(e);else throw new Error("Nodes and querySelector are both undefined");ae.debug(`Found ${i.length} diagrams`),(n==null?void 0:n.startOnLoad)!==void 0&&(ae.debug("Start On Load: "+(n==null?void 0:n.startOnLoad)),pd.updateSiteConfig({startOnLoad:n==null?void 0:n.startOnLoad}));const a=new Lr.InitIDGenerator(n.deterministicIds,n.deterministicIDSeed);let s;const o=[];for(const l of Array.from(i)){if(ae.info("Rendering diagram: "+l.id),l.getAttribute("data-processed"))continue;l.setAttribute("data-processed","true");const u=`mermaid-${a.next()}`;s=l.innerHTML,s=MV(Lr.entityDecode(s)).trim().replace(//gi,"
    ");const h=Lr.detectInit(s);h&&ae.debug("Detected early reinit: ",h);try{const{svg:d,bindFunctions:f}=await aY(u,s,l);l.innerHTML=d,t&&await t(u),f&&f(l)}catch(d){S8e(d,o,Fs.parseError)}}if(o.length>0)throw o[0]},"runThrowsErrors"),rY=x(function(t){pd.initialize(t)},"initialize"),_8e=x(async function(t,e,r){ae.warn("mermaid.init is deprecated. Please use run instead."),t&&rY(t);const n={postRenderCallback:r,querySelector:".mermaid"};typeof e=="string"?n.querySelector=e:e&&(e instanceof HTMLElement?n.nodes=[e]:n.nodes=e),await tY(n)},"init"),R8e=x(async(t,{lazyLoad:e=!0}={})=>{uC(),E6(...t),e===!1&&await Z7e()},"registerExternalDiagrams"),nY=x(function(){if(Fs.startOnLoad){const{startOnLoad:t}=pd.getConfig();t&&Fs.run().catch(e=>ae.error("Mermaid failed to initialize",e))}},"contentLoaded");typeof document<"u"&&window.addEventListener("load",nY,!1);var L8e=x(function(t){Fs.parseError=t},"setParseErrorHandler"),hC=[],l7=!1,iY=x(async()=>{if(!l7){for(l7=!0;hC.length>0;){const t=hC.shift();if(t)try{await t()}catch(e){ae.error("Error executing queue",e)}}l7=!1}},"executeQueue"),I8e=x(async(t,e)=>new Promise((r,n)=>{const i=x(()=>new Promise((a,s)=>{pd.parse(t,e).then(o=>{a(o),r(o)},o=>{var l;ae.error("Error parsing",o),(l=Fs.parseError)==null||l.call(Fs,o),s(o),n(o)})}),"performCall");hC.push(i),iY().catch(n)}),"parse"),aY=x((t,e,r)=>new Promise((n,i)=>{const a=x(()=>new Promise((s,o)=>{pd.render(t,e,r).then(l=>{s(l),n(l)},l=>{var u;ae.error("Error parsing",l),(u=Fs.parseError)==null||u.call(Fs,l),o(l),i(l)})}),"performCall");hC.push(a),iY().catch(i)}),"render"),D8e=x(()=>Object.keys(Vh).map(t=>({id:t})),"getRegisteredDiagramsMetadata"),Fs={startOnLoad:!0,mermaidAPI:pd,parse:I8e,render:aY,init:_8e,run:tY,registerExternalDiagrams:R8e,registerLayoutLoaders:tH,initialize:rY,parseError:void 0,contentLoaded:nY,setParseErrorHandler:L8e,detectType:k6,registerIconPacks:$V,getRegisteredDiagramsMetadata:D8e},M8e=Fs;/*! Check if previously processed *//*! +`;return n+A7(r)},"createCssStyles"),PNe=T((t,e)=>rL(HDe(`${t}{${e}}`),jDe([T(function(n,i,a,s){if(n.type==="rule"&&Array.isArray(n.props)){if(n.parent&&n.parent.type===Z8)return;n.props=n.props.map(o=>o.startsWith(t)?o:`${t} ${o}`)}else n.type.startsWith("@")&&([...[DDe,NDe,MK,ODe,"@container","@starting-style"],Z8].includes(n.type)||(se.warn(`Removing unsupported at-rule ${n.type} from CSS`),n.type=K8))},"addNamespace"),XDe])),"compileCSS"),BNe=T((t,e,r,n)=>{const i=ONe(t,r),a=z5e(e,i,{...t.themeVariables,theme:t.theme,look:t.look},n);return PNe(n,a)},"createUserStyles"),FNe=T((t="",e,r)=>{let n=t;return!r&&!e&&(n=n.replace(/marker-end="url\([\d+./:=?A-Za-z-]*?#/g,'marker-end="url(#')),n=uu(n),n=n.replace(/
    /g,"
    "),n},"cleanUpSvgCode"),zNe=T((t="",e)=>{var i,a;const r=(a=(i=e==null?void 0:e.viewBox)==null?void 0:i.baseVal)!=null&&a.height?e.viewBox.baseVal.height+"px":RNe,n=CZ(`${t}`);return``},"putIntoIFrame"),SZ=T((t,e,r,n,i)=>{const a=t.append("div");a.attr("id",r),n&&a.attr("style",n);const s=a.append("svg").attr("id",e).attr("width","100%").attr("xmlns",ENe);return i&&s.attr("xmlns:xlink",i),s.append("g"),t},"appendDivSvgG");function sL(t,e){return t.append("iframe").attr("id",e).attr("style","width: 100%; height: 100%;").attr("sandbox","")}T(sL,"sandboxedIframe");var GNe=T((t,e,r,n)=>{var i,a,s;(i=t.getElementById(e))==null||i.remove(),(a=t.getElementById(r))==null||a.remove(),(s=t.getElementById(n))==null||s.remove()},"removeExistingElements"),qNe=T(async function(t,e,r){var z,F,A,R,N,M;yE();const n=aL(e);e=n.code;const i=pr();se.debug(i),e.length>((i==null?void 0:i.maxTextSize)??TNe)&&(e=wNe);const a=`#${t}`,s="i"+t,o="#"+s,l="d"+t,u="#"+l,h=T(()=>{const O=gt(f?o:u).node();O&&"remove"in O&&O.remove()},"removeTempElements");let d=gt(document.body);const f=i.securityLevel===CNe,p=i.securityLevel===kNe,g=i.fontFamily;if(r!==void 0){if(r&&(r.innerHTML=""),f){const D=sL(gt(r),s);d=gt(D.nodes()[0].contentDocument.body),d.node().style.margin="0"}else d=gt(r);SZ(d,t,l,`font-family: ${g}`,SNe)}else{if(GNe(document,t,l,s),f){const D=sL(gt(document.body),s);d=gt(D.nodes()[0].contentDocument.body),d.node().style.margin="0"}else d=gt("body");SZ(d,t,l)}let m,y;try{m=await nL.fromText(e,{title:n.title})}catch(D){if(i.suppressErrorRendering)throw h(),D;m=await nL.fromText("error"),y=D}const v=d.select(u).node(),x=m.type,b=v.firstChild,w=b.firstChild,C=(F=(z=m.renderer).getClasses)==null?void 0:F.call(z,e,m),_=BNe(i,x,C,a),k=document.createElement("style");k.innerHTML=_,b.insertBefore(k,w);try{await m.renderer.draw(e,t,"11.15.0",m)}catch(D){throw i.suppressErrorRendering?h():cMe.draw(e,t,"11.15.0"),D}const S=d.select(`${u} svg`),L=(R=(A=m.db).getAccTitle)==null?void 0:R.call(A),$=(M=(N=m.db).getAccDescription)==null?void 0:M.call(N);RZ(x,S,L,$),d.select(`[id="${t}"]`).selectAll("foreignobject > *").attr("xmlns",_Ne);let I=d.select(u).node().innerHTML;if(se.debug("config.arrowMarkerAbsolute",i.arrowMarkerAbsolute),I=FNe(I,f,eu(i.arrowMarkerAbsolute)),f){const D=d.select(u+" svg").node();I=zNe(I,D)}else p||(I=Ch.sanitize(I,{ADD_TAGS:NNe,ADD_ATTR:$Ne,HTML_INTEGRATION_POINTS:{foreignobject:!0}}));if(mNe(),y)throw y;return h(),{diagramType:x,svg:I,bindFunctions:m.db.bindFunctions}},"render");function _Z(t={}){var n;const e=Li({},t);e!=null&&e.fontFamily&&!((n=e.themeVariables)!=null&&n.fontFamily)&&(e.themeVariables||(e.themeVariables={}),e.themeVariables.fontFamily=e.fontFamily),x5e(e),e!=null&&e.theme&&e.theme in Jc?e.themeVariables=Jc[e.theme].getThemeVariables(e.themeVariables):e&&(e.themeVariables=Jc.default.getThemeVariables(e.themeVariables));const r=typeof e=="object"?b5e(e):Jq();f7(r.logLevel),yE()}T(_Z,"initialize");var AZ=T((t,e={})=>{const{code:r}=iL(t);return nL.fromText(r,e)},"getDiagramFromText");function RZ(t,e,r,n){bZ(e,t),xZ(e,r,n,e.attr("id"))}T(RZ,"addA11yInfo");var yf=Object.freeze({render:qNe,parse:kZ,getDiagramFromText:AZ,initialize:_Z,getConfig:pr,setConfig:eV,getSiteConfig:Jq,updateSiteConfig:T5e,reset:T(()=>{M4()},"reset"),globalReset:T(()=>{M4(F0)},"globalReset"),defaultConfig:F0});f7(pr().logLevel),M4(pr());var VNe=T((t,e,r)=>{se.warn(t),d8(t)?(r&&r(t.str,t.hash),e.push({...t,message:t.str,error:t})):(r&&r(t),t instanceof Error&&e.push({str:t.message,message:t.message,hash:t.name,error:t}))},"handleError"),LZ=T(async function(t={querySelector:".mermaid"}){try{await WNe(t)}catch(e){if(d8(e)&&se.error(e.str),vo.parseError&&vo.parseError(e),!t.suppressErrors)throw se.error("Use the suppressErrors option to suppress these errors"),e}},"run"),WNe=T(async function({postRenderCallback:t,querySelector:e,nodes:r}={querySelector:".mermaid"}){const n=yf.getConfig();se.debug(`${t?"":"No "}Callback function found`);let i;if(r)i=r;else if(e)i=document.querySelectorAll(e);else throw new Error("Nodes and querySelector are both undefined");se.debug(`Found ${i.length} diagrams`),(n==null?void 0:n.startOnLoad)!==void 0&&(se.debug("Start On Load: "+(n==null?void 0:n.startOnLoad)),yf.updateSiteConfig({startOnLoad:n==null?void 0:n.startOnLoad}));const a=new Pr.InitIDGenerator(n.deterministicIds,n.deterministicIDSeed);let s;const o=[];for(const l of Array.from(i)){if(se.info("Rendering diagram: "+l.id),l.getAttribute("data-processed"))continue;l.setAttribute("data-processed","true");const u=`mermaid-${a.next()}`;s=l.innerHTML,s=lX(Pr.entityDecode(s)).trim().replace(//gi,"
    ");const h=Pr.detectInit(s);h&&se.debug("Detected early reinit: ",h);try{const{svg:d,bindFunctions:f}=await NZ(u,s,l);l.innerHTML=d,t&&await t(u),f&&f(l)}catch(d){VNe(d,o,vo.parseError)}}if(o.length>0)throw o[0]},"runThrowsErrors"),IZ=T(function(t){yf.initialize(t)},"initialize"),UNe=T(async function(t,e,r){se.warn("mermaid.init is deprecated. Please use run instead."),t&&IZ(t);const n={postRenderCallback:r,querySelector:".mermaid"};typeof e=="string"?n.querySelector=e:e&&(e instanceof HTMLElement?n.nodes=[e]:n.nodes=e),await LZ(n)},"init"),HNe=T(async(t,{lazyLoad:e=!0}={})=>{yE(),k7(...t),e===!1&&await pNe()},"registerExternalDiagrams"),DZ=T(function(){if(vo.startOnLoad){const{startOnLoad:t}=yf.getConfig();t&&vo.run().catch(e=>se.error("Mermaid failed to initialize",e))}},"contentLoaded");typeof document<"u"&&window.addEventListener("load",DZ,!1);var YNe=T(function(t){vo.parseError=t},"setParseErrorHandler"),vE=[],oL=!1,MZ=T(async()=>{if(!oL){for(oL=!0;vE.length>0;){const t=vE.shift();if(t)try{await t()}catch(e){se.error("Error executing queue",e)}}oL=!1}},"executeQueue"),XNe=T(async(t,e)=>new Promise((r,n)=>{const i=T(()=>new Promise((a,s)=>{yf.parse(t,e).then(o=>{a(o),r(o)},o=>{var l;se.error("Error parsing",o),(l=vo.parseError)==null||l.call(vo,o),s(o),n(o)})}),"performCall");vE.push(i),MZ().catch(n)}),"parse"),NZ=T((t,e,r)=>new Promise((n,i)=>{const a=T(()=>new Promise((s,o)=>{yf.render(t,e,r).then(l=>{s(l),n(l)},l=>{var u;se.error("Error parsing",l),(u=vo.parseError)==null||u.call(vo,l),o(l),i(l)})}),"performCall");vE.push(a),MZ().catch(i)}),"render"),jNe=T(()=>Object.keys(Ud).map(t=>({id:t})),"getRegisteredDiagramsMetadata"),vo={startOnLoad:!0,mermaidAPI:yf,parse:XNe,render:NZ,init:UNe,run:LZ,registerExternalDiagrams:HNe,registerLayoutLoaders:LK,initialize:IZ,parseError:void 0,contentLoaded:DZ,setParseErrorHandler:YNe,detectType:C7,registerIconPacks:hX,getRegisteredDiagramsMetadata:jNe},KNe=vo;/*! Check if previously processed *//*! * Wait for document loaded before starting the execution - */window.mermaid=M8e,(function(){var f;if(window.OpenKnowledgeShortcuts)return;const t=[],e=window.navigator&&(window.navigator.platform||((f=window.navigator.userAgentData)==null?void 0:f.platform))||"",r=/\b(Mac|iPhone|iPad|iPod)\b/.test(e);function n(p){return!p||!p.id||typeof p.run!="function"?function(){}:(i(p.id),t.push(Object.assign({preventDefault:!0,allowEditable:!1},p)),function(){i(p.id)})}function i(p){const g=t.findIndex(function(m){return m.id===p});g>=0&&t.splice(g,1)}function a(p){return!!(p&&p.closest&&p.closest("input, textarea, select, [contenteditable='true']"))}function s(p,g){if(g.defaultPrevented||!p.allowEditable&&a(g.target))return!1;if(p.code){if(g.code!==p.code)return!1}else if(String(g.key||"").toLowerCase()!==String(p.key||"").toLowerCase())return!1;return!o(p,g)||g.altKey!==!!p.altKey||g.shiftKey!==!!p.shiftKey?!1:typeof p.when!="function"||p.when(g)}function o(p,g){return p.primaryKey?r?g.metaKey&&!g.ctrlKey:g.ctrlKey&&!g.metaKey:p.metaOrCtrlKey?g.metaKey||g.ctrlKey:g.metaKey===!!p.metaKey&&g.ctrlKey===!!p.ctrlKey}function l(p){for(let g=t.length-1;g>=0;g--){const m=t[g];if(s(m,p)){m.preventDefault!==!1&&p.preventDefault(),m.run(p);return}}}function u(p){const g=p.key||p.code||"",m=String(g).replace(/^Key/,"").replace(/^Digit/,"");return m===" "?"Space":m.length===1?m.toUpperCase():m}function h(p){if(p.label)return p.label;const g=[];return p.primaryKey||p.metaOrCtrlKey?g.push(r?"⌘":"Ctrl"):(p.metaKey&&g.push(r?"⌘":"Meta"),p.ctrlKey&&g.push("Ctrl")),p.altKey&&g.push(r?"⌥":"Alt"),p.shiftKey&&g.push(r?"⇧":"Shift"),g.push(u(p)),r?g.join(""):g.join("+")}function d(p){if(p.ariaKeyShortcut)return p.ariaKeyShortcut;const g=[];return p.primaryKey||p.metaOrCtrlKey?g.push(r?"Meta":"Control"):(p.metaKey&&g.push("Meta"),p.ctrlKey&&g.push("Control")),p.altKey&&g.push("Alt"),p.shiftKey&&g.push("Shift"),g.push(u(p)),g.join("+")}window.OpenKnowledgeShortcuts={register:n,unregister:i,format:h,ariaKeyShortcut:d,isEditableTarget:a,isMacPlatform:r},document.addEventListener("keydown",l)})(),(function(){var V2e;const t=document.querySelector("[data-note-workspace]"),e=document.querySelector("[data-note-stack]"),r=document.querySelector("[data-empty-state]"),n=document.querySelector("[data-file-sidebar]"),i=document.querySelector("[data-sidebar-toggle]"),a=document.querySelector("[data-sidebar-close]"),s=document.querySelector("[data-viewer-settings]"),o=document.querySelector("[data-viewer-settings-trigger]"),l=document.querySelector("[data-viewer-settings-menu]"),u=document.querySelector("[data-navigation-mode-toggle]"),h=document.querySelector("[data-theme-custom-fields]"),d=document.querySelector("[data-frontmatter-visibility]"),f=document.querySelector("[data-accessibility-font]"),p=document.querySelector("[data-accessibility-size]"),g=document.querySelector("[data-accessibility-spacing]"),m=document.querySelector("[data-accessibility-motion]"),y=document.querySelector("[data-readable-line-length]"),v=document.querySelector("[data-high-contrast]"),T=document.querySelector("[data-underline-links]"),b=document.querySelector("[data-workspace-rail]"),w=document.querySelector("[data-workspace-scroll-track]"),k=document.querySelector("[data-workspace-scroll-thumb]");if(!t||!e)return;const A=window.matchMedia("(prefers-reduced-motion: reduce)"),C=window.matchMedia("(max-width: 680px)"),_="openknowledge.viewer.editorOrder",L="openknowledge.viewer.theme",O="openknowledge.viewer.frontmatter",M="openknowledge.viewer.accessibility",z="openknowledge.viewer.navigationMode",F="beside";let S=F;const R=gn(t.dataset.linkPrefix||""),N="openknowledge.viewer.panelWidths."+Qr(t.dataset.noteRoot||R||window.location.pathname).toString(36),D=t1t(),I=Ge(),$=$r(),B=Umt($,"path"),P=Hmt($),G=Pa(),V=Oe(),Y=["default","night","paper","ocean","rose","custom"],W="night",ie={system:'Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI Variable", "Segoe UI", sans-serif',readable:"Verdana, Tahoma, Arial, sans-serif",serif:'Iowan Old Style, Baskerville, "Times New Roman", serif',mono:"ui-monospace, SFMono-Regular, Menlo, Consolas, monospace"},K={small:{value:"14px",scale:"0.9"},default:{value:"15.5px",scale:"1"},large:{value:"18px",scale:"1.16"},"extra-large":{value:"21px",scale:"1.35"}},se={default:{value:"1.62",letterSpacing:"normal"},relaxed:{value:"1.82",letterSpacing:".02em"},spacious:{value:"2.05",letterSpacing:".04em"}},J={font:"system",size:"default",spacing:"default",motion:"system",readableLineLength:!0,highContrast:!1,underlineLinks:!1},Z={page:"#f4f5f4",surface:"#ffffff",text:"#202322",muted:"#707773",accent:"#0b7a53",border:"#e3e6e4"},ee={page:["--ok-color-page","--ok-color-header-bg","--ok-color-viewer-canvas","--ok-color-viewer-header-bg","--ok-color-sidebar","--ok-color-sidebar-header"],surface:["--ok-color-surface","--ok-color-note-chrome-bg","--ok-color-search-input-bg","--ok-color-search-popover-bg","--ok-color-editor-trigger-bg","--ok-color-editor-menu-bg","--ok-color-card-bg","--ok-color-editor-mark-bg"],text:["--ok-color-text","--ok-color-document-text","--ok-color-control-hover-text","--ok-color-editor-mark-text","--ok-color-code-block-bg"],muted:["--ok-color-muted","--ok-color-control-text","--ok-color-close-text","--ok-color-sidebar-text","--ok-color-search-shortcut-text","--ok-color-tree-text","--ok-color-tree-badge-text","--ok-color-note-close-text","--ok-color-editor-trigger-text"],accent:["--ok-color-accent","--ok-color-accent-strong","--ok-color-focus-ring","--ok-color-graph-node-active-border"],border:["--ok-color-border","--ok-color-control-hover-border","--ok-color-close-hover-border","--ok-color-sidebar-border","--ok-color-search-input-border","--ok-color-search-shortcut-border","--ok-color-search-popover-border","--ok-color-card-border","--ok-color-tree-badge-border","--ok-color-note-close-hover-border","--ok-color-editor-trigger-border","--ok-color-editor-trigger-separator","--ok-color-editor-menu-border","--ok-color-editor-menu-separator"]};let ne=Promise.resolve(),ue=0,fe=0,_e=0;const Ae={id:"viewer.panel.close",code:"KeyW",metaOrCtrlKey:!0,altKey:!0,label:"⌘⌥W",ariaKeyShortcut:"Meta+Alt+W",when:function(){return!!f2e()},run:function(){const q=f2e();q&&u6(q)}};function Ne(){return Array.prototype.slice.call(e.querySelectorAll("[data-note-path]"))}function me(q,X){return q?q.closest?q.closest(X):q.parentElement?q.parentElement.closest(X):null:null}function ve(q,X,te){return Math.min(Math.max(q,X),te)}function Ge(){const q=Ze(N);return q&&typeof q=="object"&&!Array.isArray(q)?q:{}}function Te(){const q=JSON.stringify(I);try{window.localStorage.setItem(N,q)}catch{}Qe(N,q)}function Ze(q){const X=[ke(q),Ve(q)];for(const te of X)if(te)try{return JSON.parse(te)}catch{}return null}function ke(q){try{return window.localStorage.getItem(q)}catch{return null}}function Ve(q){const X=encodeURIComponent(q)+"=",te=document.cookie?document.cookie.split("; "):[];for(const de of te)if(de.startsWith(X))try{return decodeURIComponent(de.slice(X.length))}catch{return null}return null}function Qe(q,X){try{document.cookie=encodeURIComponent(q)+"="+encodeURIComponent(X)+"; Max-Age=31536000; Path=/; SameSite=Lax"}catch{}}function nt(q){return q==="beside"||q==="replace"?q:F}function tt(){return nt(Ze(z))}function je(q){const X=JSON.stringify(nt(q));try{window.localStorage.setItem(z,X)}catch{}Qe(z,X)}function Ce(){return S==="beside"?"Links open beside. Hold Shift to replace the current panel.":"Links open in the current panel. Hold Shift to open beside."}function Se(q){S=nt(q),document.documentElement.dataset.viewerNavigationMode=S,u&&(u.dataset.mode=S,u.setAttribute("aria-pressed",S==="beside"?"true":"false"),u.setAttribute("aria-label","Link behavior: "+(S==="beside"?"Open beside":"Open in current panel")),u.title=Ce()),E2e()}function H(q){const X=S==="beside";return q?!X:X}function he(){Se(tt()),!(!u||u.dataset.modeBound==="true")&&(u.dataset.modeBound="true",u.addEventListener("click",function(){const q=S==="beside"?"replace":"beside";je(q),Se(q)}))}function j(){const q=Ze(L);return q&&typeof q=="object"&&!Array.isArray(q)?pe(q):pe({preset:W,custom:Z})}function pe(q){const X=Y.includes(q.preset)?q.preset:W,te=Object.assign({},Z);return Object.keys(Z).forEach(function(de){we(q.custom&&q.custom[de])&&(te[de]=q.custom[de].toLowerCase())}),{preset:X,custom:te}}function re(q){const X=pe(q),te=JSON.stringify(X);try{window.localStorage.setItem(L,te)}catch{}Qe(L,te)}function Be(){const q=Ze(O);return q&&typeof q=="object"&&!Array.isArray(q)&&typeof q.visible=="boolean"?q.visible:!0}function xe(q){const X=JSON.stringify({visible:!!q});try{window.localStorage.setItem(O,X)}catch{}Qe(O,X)}function Ue(){const q=Ze(M);return q&&typeof q=="object"&&!Array.isArray(q)?De(q):De(J)}function De(q){const X=q&&typeof q=="object"?q:{};return{font:Object.prototype.hasOwnProperty.call(ie,X.font)?X.font:J.font,size:Object.prototype.hasOwnProperty.call(K,X.size)?X.size:J.size,spacing:Object.prototype.hasOwnProperty.call(se,X.spacing)?X.spacing:J.spacing,motion:["system","reduced","full"].includes(X.motion)?X.motion:J.motion,readableLineLength:typeof X.readableLineLength=="boolean"?X.readableLineLength:J.readableLineLength,highContrast:typeof X.highContrast=="boolean"?X.highContrast:J.highContrast,underlineLinks:typeof X.underlineLinks=="boolean"?X.underlineLinks:J.underlineLinks}}function qe(q){const X=De(q),te=JSON.stringify(X);try{window.localStorage.setItem(M,te)}catch{}Qe(M,te)}function Le(q){const X=De(q),te=K[X.size],de=se[X.spacing];document.documentElement.dataset.viewerFont=X.font,document.documentElement.dataset.viewerFontSize=X.size,document.documentElement.dataset.viewerMotion=X.motion,document.documentElement.dataset.viewerContrast=X.highContrast?"high":"normal",document.documentElement.dataset.viewerUnderlines=X.underlineLinks?"on":"off",document.documentElement.style.setProperty("--ok-font-body",ie[X.font]),document.documentElement.style.setProperty("--ok-document-font-size",te.value),document.documentElement.style.setProperty("--ok-document-scale",te.scale),document.documentElement.style.setProperty("--ok-document-line-height",de.value),document.documentElement.style.setProperty("--ok-document-letter-spacing",de.letterSpacing),document.documentElement.style.setProperty("--ok-note-body-max-width",X.readableLineLength?"70ch":"none"),document.body.classList.toggle("is-high-contrast",X.highContrast),document.body.classList.toggle("is-links-underlined",X.underlineLinks),Xe(X)}function Xe(q){f&&(f.value=q.font),p&&(p.value=q.size),g&&(g.value=q.spacing),m&&(m.value=q.motion),y&&(y.checked=q.readableLineLength),v&&(v.checked=q.highContrast),T&&(T.checked=q.underlineLinks)}function Ie(){const q=document.documentElement.dataset.viewerMotion||"system";return q==="reduced"||q==="system"&&A.matches}function it(q){document.body.classList.toggle("is-frontmatter-hidden",!q),d&&(d.checked=q)}function we(q){return/^#[0-9a-f]{6}$/i.test(String(q||""))}function lt(q){const X=we(q)?q.slice(1):Z.accent.slice(1);return[parseInt(X.slice(0,2),16),parseInt(X.slice(2,4),16),parseInt(X.slice(4,6),16)]}function be(q,X,te){const de=lt(q),Me=lt(X);return"#"+de.map(function(We,ft){return Math.round(We+(Me[ft]-We)*te)}).map(function(We){return We.toString(16).padStart(2,"0")}).join("")}function Et(q){return vt(q)>.48?"#121715":"#f3f7f4"}function vt(q){const X=lt(q);return(.2126*X[0]+.7152*X[1]+.0722*X[2])/255}function ot(q){const X=pe(q);document.documentElement.dataset.viewerTheme=X.preset;const te=X.preset==="custom"&&vt(X.custom.surface)<=.48;document.documentElement.style.colorScheme=X.preset==="night"||te?"dark":"light",It(),X.preset==="custom"&&xt(X.custom),ht(X),f1t()}function It(){Object.keys(ee).forEach(function(q){ee[q].forEach(function(X){document.documentElement.style.removeProperty(X)})}),["--ok-color-accent-rgb","--ok-color-accent-soft","--ok-color-accent-softer","--ok-color-accent-selected","--ok-color-accent-focus","--ok-color-accent-focus-strong","--ok-color-accent-border","--ok-color-accent-border-strong","--ok-color-shadow","--ok-color-code-inline-bg","--ok-color-code-block-text","--ok-color-control-hover-bg","--ok-color-sidebar-row","--ok-color-sidebar-tree-hover-bg","--ok-color-search-result-hover-bg","--ok-color-editor-menu-item-hover-bg","--ok-color-graph-edge-active"].forEach(function(q){document.documentElement.style.removeProperty(q)})}function xt(q){Object.keys(ee).forEach(function(te){ee[te].forEach(function(de){document.documentElement.style.setProperty(de,q[te])})});const X=lt(q.accent).join(", ");document.documentElement.style.setProperty("--ok-color-accent-rgb",X),document.documentElement.style.setProperty("--ok-color-accent-soft","rgba("+X+", .11)"),document.documentElement.style.setProperty("--ok-color-accent-softer","rgba("+X+", .065)"),document.documentElement.style.setProperty("--ok-color-accent-selected","rgba("+X+", .09)"),document.documentElement.style.setProperty("--ok-color-accent-focus","rgba("+X+", .12)"),document.documentElement.style.setProperty("--ok-color-accent-focus-strong","rgba("+X+", .18)"),document.documentElement.style.setProperty("--ok-color-accent-border","rgba("+X+", .35)"),document.documentElement.style.setProperty("--ok-color-accent-border-strong","rgba("+X+", .5)"),document.documentElement.style.setProperty("--ok-color-shadow","rgba("+lt(q.text).join(", ")+", .1)"),document.documentElement.style.setProperty("--ok-color-code-inline-bg",be(q.surface,q.accent,.1)),document.documentElement.style.setProperty("--ok-color-code-block-text",Et(q.text)),document.documentElement.style.setProperty("--ok-color-control-hover-bg",be(q.page,q.text,.08)),document.documentElement.style.setProperty("--ok-color-sidebar-row",be(q.page,q.text,.11)),document.documentElement.style.setProperty("--ok-color-sidebar-tree-hover-bg",be(q.page,q.accent,.13)),document.documentElement.style.setProperty("--ok-color-search-result-hover-bg",be(q.surface,q.accent,.08)),document.documentElement.style.setProperty("--ok-color-editor-menu-item-hover-bg",be(q.surface,q.accent,.08)),document.documentElement.style.setProperty("--ok-color-graph-edge-active","rgba("+X+", .78)")}function ht(q){document.querySelectorAll("[data-theme-option]").forEach(function(X){const te=X.dataset.themeOption===q.preset;X.classList.toggle("is-selected",te),X.setAttribute("aria-checked",te?"true":"false")}),h&&(h.hidden=q.preset!=="custom",h.querySelectorAll("[data-theme-custom-value]").forEach(function(X){const te=X.dataset.themeCustomValue;q.custom[te]&&(X.value=q.custom[te])}))}function oe(){return Math.min(360,Math.max(260,window.innerWidth-24))}function At(){return window.innerWidth<=680?12:Math.max(22,(window.innerWidth-1180)/2)}function dt(q){const X=Ne();return!!(q&&X.length===1&&X[0]===q)}function ut(q){return dt(q)?Math.max(oe(),window.innerWidth-At()*2):Math.max(wt(),1180)}function wt(){return Math.max(oe(),Mr("var(--ok-note-panel-default-width)",650))}function Mr(q,X){const te=document.createElement("div");te.style.position="absolute",te.style.left="-10000px",te.style.top="-10000px",te.style.visibility="hidden",te.style.pointerEvents="none",te.style.width=q,document.body.append(te);const de=te.getBoundingClientRect().width;return te.remove(),Number.isFinite(de)&&de>0?de:X}function ye(q,X){const te=Number(q);return Number.isFinite(te)?Math.round(ve(te,oe(),ut(X))):null}function et(q){return ye(I[q.dataset.notePath],q)}function ct(q){const X=et(q);if(!X){q.style.removeProperty("--note-panel-width"),delete q.dataset.panelWidth;return}q.style.setProperty("--note-panel-width",X+"px"),q.dataset.panelWidth=String(X)}function _t(q){var X;document.body.classList.toggle("is-sidebar-open",q),n&&n.setAttribute("aria-hidden",q?"false":"true"),i&&i.setAttribute("aria-expanded",q?"true":"false"),q&&Pt(((X=Eo())==null?void 0:X.dataset.notePath)||sl()[0]||"",!0)}function Ft(){_t(!document.body.classList.contains("is-sidebar-open"))}function nr(q,X){if(i6())return Kmt(q,X);let te;try{te=new URL(q,window.location.href)}catch{return null}const de=Jt();if(te.origin!==window.location.origin||!te.pathname.startsWith(de))return null;const Me=te.pathname.slice(de.length)||"index.md";if(!_r(Me))return null;try{return decodeURIComponent(Me)}catch{return Me}}function ir(q,X){return q+X.split("/").map(encodeURIComponent).join("/")}function _r(q){return/\.(md|markdown)$/i.test(String(q).split("?")[0].split("#")[0])}function or(q){return i6()?Ymt(q):ir(Jt(),q)}function Rr(q){return ir(Nr(),q)}function Jt(){return R+"/file/"}function Nr(){return R+"/api/file/"}function gn(q){const X=String(q||"").replace(/\/+$/,"");return X?X.startsWith("/")?X:"/"+X:""}function $r(){var te;const q=(te=window.OpenKnowledgeStaticData)==null?void 0:te.notes;if(Array.isArray(q))return q;const X=document.querySelector("[data-static-notes]");if(!X)return[];try{const de=JSON.parse(X.textContent||"[]");return Array.isArray(de)?de:[]}catch{return[]}}function Pa(){const q=new Set;return $.forEach(function(X){X.path&&q.add(X.path)}),document.querySelectorAll("[data-tree-path]").forEach(function(X){X.dataset.treePath&&q.add(X.dataset.treePath)}),q}function ps(){document.querySelectorAll(".knowledge-tree").forEach(function(q){if(q.dataset.treePrepared==="true")return;q.dataset.treePrepared="true";const X=[];Array.from(q.querySelectorAll(".tree-row")).forEach(function(te){var ft;const de=gs(te);for(;X.length&&X[X.length-1].indent>=de;)X.pop();if(te.dataset.treeParentPath=((ft=X[X.length-1])==null?void 0:ft.path)||"",!te.classList.contains("tree-directory"))return;const Me=String(te.textContent||"").trim(),Fe=X.concat([{name:Me}]).map(function(mt){return mt.name}).join("/");te.dataset.treeDirectoryPath=Fe,te.setAttribute("aria-expanded","false"),te.tabIndex=0,te.title="Expand "+Fe;const We=s6("chevron-down","tree-directory-icon");We.setAttribute("aria-hidden","true"),te.prepend(We),te.addEventListener("click",function(){li(te,te.getAttribute("aria-expanded")!=="true")}),te.addEventListener("keydown",function(mt){if(mt.key==="ArrowRight"){mt.preventDefault(),li(te,!0);return}if(mt.key==="ArrowLeft"){mt.preventDefault(),li(te,!1);return}(mt.key==="Enter"||mt.key===" ")&&(mt.preventDefault(),li(te,te.getAttribute("aria-expanded")!=="true"))}),X.push({indent:de,name:Me,path:Fe})}),Bt(q)}),Ct()}function gs(q){const X=q.style.getPropertyValue("--indent"),te=parseFloat(X);return Number.isFinite(te)?te:0}function li(q,X){q.setAttribute("aria-expanded",X?"true":"false"),q.title=(X?"Collapse ":"Expand ")+q.dataset.treeDirectoryPath;const te=q.closest(".knowledge-tree");te&&Bt(te)}function Bt(q){const X=Object.create(null);q.querySelectorAll("[data-tree-directory-path]").forEach(function(te){X[te.dataset.treeDirectoryPath]=te}),q.querySelectorAll(".tree-row").forEach(function(te){const Me=(te.dataset.treeParentPath||"").split("/").filter(Boolean);let Fe="",We=!1;Me.forEach(function(ft){Fe=Fe?Fe+"/"+ft:ft;const mt=X[Fe];mt&&mt.getAttribute("aria-expanded")!=="true"&&(We=!0)}),te.hidden=We})}function yt(){document.querySelectorAll("[data-tree-directory-path]").forEach(function(q){q.setAttribute("aria-expanded","false"),q.title="Expand "+q.dataset.treeDirectoryPath}),document.querySelectorAll(".knowledge-tree").forEach(Bt)}function Pt(q,X){const te=String(q||""),de=te.split("/").slice(0,-1),Me=new Set;if(de.forEach(function(Fe,We){Me.add(de.slice(0,We+1).join("/"))}),document.querySelectorAll(".knowledge-tree").forEach(function(Fe){Fe.querySelectorAll("[data-tree-directory-path]").forEach(function(We){Me.has(We.dataset.treeDirectoryPath)&&(We.setAttribute("aria-expanded","true"),We.title="Collapse "+We.dataset.treeDirectoryPath)}),Fe.querySelectorAll("[data-tree-path]").forEach(function(We){const ft=We.dataset.treePath===te;We.classList.toggle("is-current-file",ft),ft?(We.setAttribute("aria-current","page"),We.title=We.dataset.treePath):(We.removeAttribute("aria-current"),We.title=Ce())}),Bt(Fe)}),X&&n){const Fe=Array.from(n.querySelectorAll("[data-tree-path]")).find(function(We){return We.dataset.treePath===te});Fe&&window.requestAnimationFrame(function(){Fe.scrollIntoView({block:"center",behavior:Ie()?"auto":"smooth"})})}}function Ct(){const q=n==null?void 0:n.querySelector(".file-sidebar-head"),X=q==null?void 0:q.querySelector("[data-sidebar-close]");if(!q||!X||q.querySelector("[data-sidebar-collapse]"))return;const te=document.createElement("div");te.className="file-sidebar-actions";const de=document.createElement("button");de.type="button",de.className="file-sidebar-collapse",de.dataset.sidebarCollapse="",de.textContent="Collapse all",de.addEventListener("click",yt),X.before(te),te.append(de,X)}function pr(q){const X=q.join("/");return[X+"/index.md",X+"/index.markdown"].find(function(te){return G.has(te)})||""}function Ee(q){const X=String(q||"index.md"),te=X.split("/").filter(Boolean),de=te[te.length-1]||"index.md",Me=/^index\.(md|markdown)$/i.test(de)&&te.length>1,Fe=Me?te.slice(0,-1):te,We=document.createElement("nav");return We.className="note-path note-breadcrumbs",We.dataset.noteBreadcrumbs="",We.dataset.breadcrumbsReady="true",We.dataset.notePathValue=X,We.setAttribute("aria-label","Note path"),We.title=X,Fe.forEach(function(ft,mt){if(mt>0){const er=document.createElement("span");er.className="note-breadcrumb-separator",er.setAttribute("aria-hidden","true"),er.textContent="/",We.append(er)}const St=mt===Fe.length-1,Zt=pr(Fe.slice(0,mt+1)),sr=St?X:Zt,zt=St&&!Me?ft.replace(/\.(md|markdown)$/i,""):ft;if(sr){const er=document.createElement("a");er.className="note-breadcrumb-link"+(St?" note-breadcrumb-current":""),er.href=or(sr),er.dataset.directLink="true",er.textContent=zt,St&&er.setAttribute("aria-current","page"),We.append(er);return}const Ut=document.createElement("span");Ut.className="note-breadcrumb-label",Ut.textContent=zt,We.append(Ut)}),We}function Di(q){const X=q.querySelector("[data-note-breadcrumbs], .note-path");!X||X.dataset.breadcrumbsReady==="true"||X.replaceWith(Ee(q.dataset.notePath))}function Oe(){var te;const q=(te=window.OpenKnowledgeStaticData)==null?void 0:te.graph;if(q)return{nodes:Array.isArray(q.nodes)?q.nodes:[],edges:Array.isArray(q.edges)?q.edges:[]};const X=document.querySelector("[data-knowledge-graph]");if(!X)return{nodes:[],edges:[]};try{const de=JSON.parse(X.textContent||"{}");return{nodes:Array.isArray(de.nodes)?de.nodes:[],edges:Array.isArray(de.edges)?de.edges:[]}}catch{return{nodes:[],edges:[]}}}function Ln(){const q=document.querySelector("[data-knowledge-graph-view]"),X=document.querySelector("[data-knowledge-graph-sidebar]");if(!q)return;q.replaceChildren(),X==null||X.replaceChildren();const te=document.createElement("div");te.className="knowledge-graph-info";const de=document.createElement("h2");de.textContent="Knowledge graph";const Me=document.createElement("p");Me.textContent="Select a node to inspect its connections. Use arrow keys to move and Enter to open.";const Fe=document.createElement("p");if(Fe.className="knowledge-graph-status",Fe.dataset.knowledgeGraphStatus="",Fe.setAttribute("aria-live","polite"),Fe.textContent=V.nodes.length?V.nodes.length+(V.nodes.length===1?" note":" notes"):"No notes",te.append(de,Me,Fe),(X||q).append(te),!V.nodes.length){const Zt=document.createElement("p");Zt.className="empty",Zt.textContent="No Markdown files found.",q.append(Zt);return}const We=900,ft=640,mt=qmt(V.nodes),Nt=Je(V,We,ft,mt),St=document.createElement("canvas");St.className="knowledge-graph-canvas",St.dataset.knowledgeGraphCanvas="true",St.width=We,St.height=ft,St.tabIndex=0,St.setAttribute("role","img"),St.setAttribute("aria-label","Interactive graph of Markdown files. Use arrow keys to select a note and Enter to open it."),q.append(St),h0(St,V,Nt,mt,We,ft,Fe).start()}function h0(q,X,te,de,Me,Fe,We){const ft=q.getContext("2d"),mt=Object.create(null);X.nodes.forEach(function(tr){tr&&typeof tr.path=="string"&&(mt[tr.path]=!0)});const Nt=X.edges.filter(function(tr){return tr&&mt[tr.source]&&mt[tr.target]&&te[tr.source]&&te[tr.target]}),St=X.nodes.filter(function(tr){return tr&&typeof tr.path=="string"&&te[tr.path]}).map(function(tr){const fn=te[tr.path],lc=t2e(tr,de);return{node:tr,path:tr.path,label:lc,fullLabel:r2e(tr,de),radius:tr.path==="index.md"?16:10,labelOffset:tr.path==="index.md"?31:25,baseX:fn.x,baseY:fn.y,x:fn.x,y:fn.y,z:0,vx:0,vy:0}}),Zt=Object.create(null);St.forEach(function(tr){Zt[tr.path]=tr});let sr="",zt=St.findIndex(function(tr){return tr.path==="index.md"});zt<0&&(zt=0);let Ut=null,er=0;const Ar=function(tr){const fn=tr&&Zt[tr]?tr:"";if(fn!==sr)if(sr=fn,q.dataset.activeGraphPath=sr,q.style.cursor=sr?"pointer":"default",sr){const lc=St.findIndex(function(f6){return f6.path===sr});lc>=0&&(zt=lc);const vw=Zt[sr],W2e=Nt.filter(function(f6){return f6.source===sr||f6.target===sr}).length,U2e=W2e+(W2e===1?" connection":" connections");We&&(We.textContent=vw.fullLabel+" · "+U2e+" · Enter to open"),q.setAttribute("aria-label","Selected "+vw.fullLabel+" with "+U2e+". Use arrow keys to move and Enter to open.")}else We&&(We.textContent=X.nodes.length+(X.nodes.length===1?" note":" notes")),q.setAttribute("aria-label","Interactive graph of Markdown files. Use arrow keys to select a note and Enter to open it.")},yn=function(){const tr=Math.max(1,Math.min(window.devicePixelRatio||1,2));q.width=Math.round(Me*tr),q.height=Math.round(Fe*tr),ft.setTransform(tr,0,0,tr,0,0)},xn=function(tr){const fn=q.getBoundingClientRect();return!fn.width||!fn.height?{x:0,y:0}:{x:(tr.clientX-fn.left)*(Me/fn.width),y:(tr.clientY-fn.top)*(Fe/fn.height)}},xi=function(tr){Ut=tr;const fn=al(St,tr);Ar(fn?fn.path:"")};q.addEventListener("pointermove",function(tr){xi(xn(tr))}),q.addEventListener("pointerleave",function(){Ut=null,document.activeElement!==q&&Ar("")}),q.addEventListener("click",function(tr){const fn=al(St,xn(tr));fn&&m0(fn.path,!0,H(!1))}),q.addEventListener("focus",function(){St[zt]&&Ar(St[zt].path)}),q.addEventListener("blur",function(){Ar(Ut?sr:"")}),q.addEventListener("keydown",function(tr){if(!St.length)return;if(tr.key==="Enter"||tr.key===" "){sr&&(tr.preventDefault(),m0(sr,!0,H(!1)));return}if(tr.key!=="ArrowRight"&&tr.key!=="ArrowDown"&&tr.key!=="ArrowLeft"&&tr.key!=="ArrowUp")return;tr.preventDefault();const fn=tr.key==="ArrowRight"||tr.key==="ArrowDown"?1:-1;zt=(zt+fn+St.length)%St.length,Ar(St[zt].path)});const ll=function(){q.isConnected&&(er=window.requestAnimationFrame(ll),jv(St,Nt,Zt,sr,Me,Fe),Jn(ft,St,Nt,Zt,sr,Me,Fe))};return{start:function(){ft&&(yn(),Jn(ft,St,Nt,Zt,sr,Me,Fe),er=window.requestAnimationFrame(ll))},stop:function(){er&&window.cancelAnimationFrame(er)}}}function jv(q,X,te,de,Me,Fe){const We=de?te[de]:null;q.forEach(function(mt){const Nt=mt===We?1:0,St=mt===We?.052:.034;mt.vx+=(mt.baseX-mt.x)*St,mt.vy+=(mt.baseY-mt.y)*St,mt.z+=(Nt-mt.z)*.095});const ft=We?Zv(We.z):0;X.forEach(function(mt){const Nt=te[mt.source],St=te[mt.target];if(!Nt||!St)return;const Zt=St.x-Nt.x||.01,sr=St.y-Nt.y||.01,zt=Math.max(1,Math.sqrt(Zt*Zt+sr*sr)),Ut=We&&(mt.source===We.path||mt.target===We.path),er=104+(Ut?28*ft:0),Ar=(zt-er)*(Ut?.0015:.0011),yn=Zt/zt,xn=sr/zt;Nt.vx+=yn*Ar,Nt.vy+=xn*Ar,St.vx-=yn*Ar,St.vy-=xn*Ar});for(let mt=0;mt.02){const mt=xu(We,We.fullLabel);q.forEach(function(Nt){if(Nt===We)return;const St=ei(mt,xu(Nt,Nt.label));if(!St)return;const Zt=Nt.x-We.x||.01,sr=Nt.y-We.y||.01,zt=Math.max(1,Math.sqrt(Zt*Zt+sr*sr)),Ut=Math.min(3.2,(Math.max(St.x,St.y)*.026+.8)*ft);Nt.vx+=Zt/zt*Ut,Nt.vy+=sr/zt*Ut})}q.forEach(function(mt){mt.x+=mt.vx,mt.y+=mt.vy,bi(mt,Me,Fe),Qv(mt,We?5.5:4.2);const Nt=We?.58:.66;mt.vx*=Nt,mt.vy*=Nt,Math.abs(mt.vx)<.018&&(mt.vx=0),Math.abs(mt.vy)<.018&&(mt.vy=0)})}function Zv(q){const X=ve(q,0,1);return X*X*(3-2*X)}function Qv(q,X){const te=Math.sqrt(q.vx*q.vx+q.vy*q.vy);if(te<=X||te<=0)return;const de=X/te;q.vx*=de,q.vy*=de}function Jn(q,X,te,de,Me,Fe,We){const ft=Me?de[Me]:null,mt=il();q.clearRect(0,0,Fe,We),q.lineCap="round",q.lineJoin="round",te.forEach(function(Nt){const St=de[Nt.source],Zt=de[Nt.target];if(!St||!Zt)return;const sr=ft&&(Nt.source===ft.path||Nt.target===ft.path);q.beginPath(),q.moveTo(St.x,St.y),q.lineTo(Zt.x,Zt.y),q.strokeStyle=sr?mt.edgeActive:ft?mt.edgeMuted:mt.edge,q.lineWidth=sr?2.35:1.05,q.stroke()}),X.slice().sort(function(Nt,St){return Nt.z-St.z}).forEach(function(Nt){const St=Nt===ft,Zt=1+Nt.z*.22,sr=Nt.radius*Zt,zt=St?Nt.fullLabel:Nt.label;q.save(),q.globalAlpha=1,q.beginPath(),q.arc(Nt.x,Nt.y-Nt.z*6,sr,0,Math.PI*2),q.fillStyle=mt.nodeBg,q.fill(),q.strokeStyle=St?mt.nodeActiveBorder:mt.nodeBorder,q.lineWidth=St?3:Nt.path==="index.md"?2:1.55,q.stroke(),q.font=(St?"600 13px":"400 12px")+" "+mt.fontBody,q.textBaseline="middle",q.textAlign=Re(Nt.x,vi(zt),Fe);const Ut=q.textAlign==="start"?Math.max(16,Nt.x-vi(zt)/2):q.textAlign==="end"?Math.min(Fe-16,Nt.x+vi(zt)/2):Nt.x,er=Nt.y+Nt.labelOffset+Nt.z*4;q.fillStyle=St?mt.labelActive:mt.label,q.fillText(zt,Ut,er),q.restore()})}function il(){const q=document.documentElement.dataset.viewerContrast==="high";return{fontBody:yi("--ok-font-body","Inter, ui-sans-serif, system-ui, sans-serif"),edge:q?yi("--ok-color-text","#202322"):yi("--ok-color-graph-edge","rgba(128, 138, 133, .25)"),edgeMuted:q?yi("--ok-color-muted","#707773"):yi("--ok-color-graph-edge-muted","rgba(128, 138, 133, .11)"),edgeActive:yi("--ok-color-graph-edge-active","rgba(15, 122, 77, .78)"),nodeBg:yi("--ok-color-graph-node-bg","#f8f8f8"),nodeBorder:q?yi("--ok-color-text","#202322"):yi("--ok-color-graph-node-border","#aeb8b2"),nodeActiveBorder:yi("--ok-color-graph-node-active-border","#0f7a4d"),label:q?yi("--ok-color-text","#202322"):yi("--ok-color-graph-label","#5f6b66"),labelActive:q?yi("--ok-color-text","#202322"):yi("--ok-color-graph-label-active","#26302c")}}function yi(q,X){return getComputedStyle(document.documentElement).getPropertyValue(q).trim()||X}function al(q,X){for(let te=q.length-1;te>=0;te-=1){const de=q[te],Me=X.x-de.x,Fe=X.y-de.y,We=de.radius*(1+de.z*.22)+6;if(Me*Me+Fe*Fe<=We*We||Ot(X,xu(de,de.z>.6?de.fullLabel:de.label)))return de}return null}function xu(q,X){const te=vi(X),de=q.y+q.labelOffset-10,Me=Math.max(q.radius+8,te/2+9);return{left:q.x-Me,right:q.x+Me,top:Math.min(q.y-q.radius-8,de),bottom:Math.max(q.y+q.radius+8,de+22)}}function Ot(q,X){return q.x>=X.left&&q.x<=X.right&&q.y>=X.top&&q.y<=X.bottom}function Re(q,X,te){return q-X/2<16?"start":q+X/2>te-16?"end":"center"}function Je(q,X,te,de){const Me=q.nodes.filter(function(zt){return zt&&typeof zt.path=="string"&&zt.path.length>0}),Fe=Object.create(null);if(Me.length===0)return Fe;if(Me.length===1)return Fe[Me[0].path]={x:X/2,y:te/2},Fe;const We={x:X/2,y:te/2},ft=Object.create(null),mt=Object.create(null);Me.forEach(function(zt){ft[zt.path]=!0,mt[zt.path]=0});const Nt=[];q.edges.forEach(function(zt){!zt||!ft[zt.source]||!ft[zt.target]||(Nt.push(zt),mt[zt.source]+=1,mt[zt.target]+=1)});const St=bt(Me,X,te),Zt=Me.map(function(zt){const Ut=Vt(zt.path),er=St[Ut]||We,Ar=Qr(zt.path),yn=Ar%360/360*Math.PI*2,xn=26+Ar%74;return{node:zt,group:Ut,label:t2e(zt,de),radius:zt.path==="index.md"?16:10,x:er.x+Math.cos(yn)*xn,y:er.y+Math.sin(yn)*xn,vx:0,vy:0}}),sr=Object.create(null);Zt.forEach(function(zt){sr[zt.node.path]=zt});for(let zt=0;zt<220;zt+=1){for(let Ut=0;Ut0?.006:.018;Ut.vx+=(We.x-Ut.x)*yn,Ut.vy+=(We.y-Ut.y)*yn,Ut.vx+=(er.x-Ut.x)*xn,Ut.vy+=(er.y-Ut.y)*xn,Ut.x+=Ut.vx,Ut.y+=Ut.vy,bi(Ut,X,te),Ut.vx*=.62,Ut.vy*=.62})}return dr(Zt,X,te),mn(Zt,X,te),Zt.forEach(function(zt){Fe[zt.node.path]={x:zt.x,y:zt.y}}),Fe}function bt(q,X,te){const de=Object.create(null);q.forEach(function(St){const Zt=Vt(St.path);de[Zt]=(de[Zt]||0)+1});const Me=Object.keys(de).sort(function(St,Zt){return de[Zt]===de[St]?St.localeCompare(Zt):de[Zt]-de[St]}),Fe=Object.create(null);if(Me.length===0)return Fe;const We=Math.max(1,Math.ceil(Math.sqrt(Me.length*(X/te)))),ft=Math.max(1,Math.ceil(Me.length/We)),mt=X/We,Nt=te/ft;return Me.forEach(function(St,Zt){const sr=Zt%We,zt=Math.floor(Zt/We),Ut=Qr(St),er=(Ut%31-15)*.9,Ar=((Ut>>5)%31-15)*.9;Fe[St]={x:mt*(sr+.5)+er,y:Nt*(zt+.5)+Ar}}),Fe}function Vt(q){const X=n6(q);return X.length<=1?".":X.length>=3?X.slice(0,2).join("/"):X[0]}function dr(q,X,te){let de=1/0,Me=-1/0,Fe=1/0,We=-1/0;q.forEach(function(Ar){de=Math.min(de,Ar.x),Me=Math.max(Me,Ar.x),Fe=Math.min(Fe,Ar.y),We=Math.max(We,Ar.y)});const ft=74,mt=58,Nt=Math.max(1,Me-de),St=Math.max(1,We-Fe),Zt=Math.min((X-ft*2)/Nt,(te-mt*2)/St,1.28),sr=(de+Me)/2,zt=(Fe+We)/2,Ut=X/2,er=te/2;q.forEach(function(Ar){Ar.x=ve(Ut+(Ar.x-sr)*Zt,ft,X-ft),Ar.y=ve(er+(Ar.y-zt)*Zt,mt,te-mt),bi(Ar,X,te)})}function fr(q,X){const te=q.map(dn);for(let de=0;deX-14&&(q.x-=de.right-(X-14)),de.top<18&&(q.y+=18-de.top),de.bottom>te-18&&(q.y-=de.bottom-(te-18))}function Qr(q){let X=2166136261;const te=String(q||"");for(let de=0;de>>0}function qmt(q){const X=Object.create(null);q.forEach(function(de){if(!de||typeof de.path!="string")return;const Me=e2e(de);X[Me]||(X[Me]=[]),X[Me].push(de)});const te=Object.create(null);return Object.keys(X).forEach(function(de){const Me=X[de];if(Me.length===1){te[Me[0].path]=de;return}const Fe=Me.map(function(We){return We.path});Me.forEach(function(We){te[We.path]=Wmt(We.path,Fe)})}),te}function e2e(q){const X=String(q.title||"").trim();return X&&X.toLowerCase()!=="index"?X:Vmt(q.path)}function Vmt(q){const X=n6(q);if(X.length===0)return String(q||"");const te=X[X.length-1];return te.toLowerCase()==="index"&&X.length>1?X.slice(-2).join("/"):te}function Wmt(q,X){const te=n6(q);for(let de=1;de<=te.length;de+=1){const Me=te.slice(-de).join("/");if(X.every(function(We){return We===q||n6(We).slice(-de).join("/")!==Me}))return Me}return te.join("/")||String(q||"")}function n6(q){return String(q||"").replace(/\.md$/i,"").split("/").filter(Boolean)}function t2e(q,X){const te=r2e(q,X);return te.length>22?te.slice(0,21)+"...":te}function r2e(q,X){return X[q.path]||e2e(q)}function Umt(q,X){const te=Object.create(null);return q.forEach(function(de){de&&typeof de[X]=="string"&&(te[de[X]]=de)}),te}function Hmt(q){const X=Object.create(null);return q.forEach(function(te){te&&typeof te.htmlPath=="string"&&typeof te.path=="string"&&n2e(te.htmlPath).forEach(function(de){X[de]===void 0&&(X[de]=te.path)})}),X}function i6(){return $.length>0}function a6(q){const X=String(q).lastIndexOf(".");return X<0?Fh(q+"/index.html"):Fh(q.slice(0,X)+".html")}function n2e(q){const X=Fh(q),te=[];if(lw(te,X),/\.html$/i.test(X)){const de=X.slice(0,-5);lw(te,de),/\/index\.html$/i.test(X)?lw(te,X.slice(0,X.length-10)):/^index\.html$/i.test(X)&&lw(te,"")}return te.slice().forEach(function(de){lw(te,de.toLowerCase())}),te}function lw(q,X){const te=Fh(X);q.includes(te)||q.push(te)}function Ymt(q){var Fe;const X=sl()[0]||((Fe=document.querySelector("[data-note-path]"))==null?void 0:Fe.dataset.notePath)||"index.md",te=a6(X),de=a6(q),Me=te.includes("/")?te.slice(0,te.lastIndexOf("/")+1):"";return Xmt(Me,de)}function Xmt(q,X){const te=Fh(q).split("/").filter(Boolean),de=Fh(X).split("/").filter(Boolean);for(;te.length&&de.length&&te[0]===de[0];)te.shift(),de.shift();return te.map(function(){return".."}).concat(de).join("/")||"."}function Fh(q){const X=String(q||"").replace(/\\/g,"/").split("/"),te=[];return X.forEach(function(de){if(!(!de||de===".")){if(de===".."){te.pop();return}te.push(de)}}),te.join("/")}function Kmt(q,X){const te=String(q||"").trim();if(!te||te.startsWith("#"))return null;const de=te.split("#")[0].split("?")[0];if(!de)return X||null;if(!/^[a-zA-Z][a-zA-Z0-9+.-]*:/.test(de)&&!de.startsWith("/")){const Fe=a6(X||sl()[0]||"index.md"),We=Fe.includes("/")?Fe.slice(0,Fe.lastIndexOf("/")+1):"";return i2e(We+de)}let Me;try{Me=new URL(de,window.location.href)}catch{return null}return Me.origin!==window.location.origin?null:i2e(jmt(Me))}function i2e(q){const X=Fh(q);return P[X]||P[X.toLowerCase()]||null}function jmt(q){var Fe;const X=((Fe=document.querySelector("[data-note-path]"))==null?void 0:Fe.dataset.notePath)||sl()[0]||"index.md";let te=a2e(window.location.pathname),de=a2e(q.pathname);const Me=Zmt(te,X);return Me&&de.toLowerCase().startsWith(Me.toLowerCase())&&(de=de.slice(Me.length)),Fh(de)}function Zmt(q,X){const te=String(q||"").toLowerCase(),de=n2e(a6(X)).filter(Boolean).sort(function(Me,Fe){return Fe.length-Me.length});for(const Me of de){const Fe=["/"+Me,"/"+Me+"/"];for(const We of Fe)if(te.endsWith(We.toLowerCase()))return q.slice(0,q.length-We.length+1)}return q.slice(0,q.lastIndexOf("/")+1)}function a2e(q){try{return decodeURIComponent(q||"")}catch{return q||""}}function Qmt(q){const X=t.dataset.noteRoot||"",te=X.includes("\\")?"\\":"/",de=X.replace(/[\\/]+$/,""),Me=String(q||"").split("/").join(te);return de?de+te+Me:Me}function s2e(q){const X=String(q||"").replace(/\\/g,"/");return(X.startsWith("/")?"/":"")+X.split("/").filter(Boolean).map(encodeURIComponent).join("/")}function Jmt(q){const X=s2e(q);return"file://"+(X.startsWith("/")?"":"/")+X}function e1t(q,X){const te=Qmt(X),de=s2e(te),Me=de.startsWith("/")?de:"/"+de,Fe=Jmt(te);switch(q.id){case"code":return"vscode://file"+Me;case"cursor":return"cursor://file"+Me;case"windsurf":return"windsurf://file"+Me;case"zed":return"zed://file"+Me;case"obsidian":return"obsidian://open?path="+encodeURIComponent(te);case"sublime":return"sublime://open?url="+encodeURIComponent(Fe);case"bbedit":return"bbedit://open?url="+encodeURIComponent(Fe);case"nova":return"nova://open?path="+encodeURIComponent(te);case"intellij":return"idea://open?file="+encodeURIComponent(te);case"webstorm":return"webstorm://open?file="+encodeURIComponent(te);default:return Fe}}function t1t(){var de;const q=[{id:"code",name:"Visual Studio Code",short:"VS",available:!1},{id:"cursor",name:"Cursor",short:"Cu",available:!1},{id:"windsurf",name:"Windsurf",short:"Ws",available:!1},{id:"zed",name:"Zed",short:"Zd",available:!1}],X=(de=window.OpenKnowledgeStaticData)==null?void 0:de.editors;if(Array.isArray(X)&&X.length)return X;const te=document.querySelector("[data-editor-options]");if(!te)return q;try{const Me=JSON.parse(te.textContent||"[]");return Array.isArray(Me)&&Me.length?Me:q}catch{return q}}function r1t(q){return D.find(function(X){return X.id===q})||D[0]}function o2e(q){return q.short||q.name.slice(0,2)}function l2e(q,X){if(q.replaceChildren(),q.dataset.hasIcon=X.icon?"true":"false",!X.icon){q.textContent=o2e(X);return}const te=document.createElement("img");te.className="editor-icon",te.src=X.icon,te.alt="",te.decoding="async",te.draggable=!1,te.addEventListener("error",function(){q.dataset.hasIcon="false",q.replaceChildren(),q.textContent=o2e(X)},{once:!0}),q.append(te)}function s6(q,X){const te=document.createElementNS("http://www.w3.org/2000/svg","svg");if(te.setAttribute("class",X+" control-icon"),te.setAttribute("data-icon",q),te.setAttribute("viewBox","0 0 24 24"),te.setAttribute("aria-hidden","true"),q==="chevron-down"){const Fe=document.createElementNS("http://www.w3.org/2000/svg","path");return Fe.setAttribute("d","m6 9 6 6 6-6"),te.append(Fe),te}if(q==="github"){const Fe=document.createElementNS("http://www.w3.org/2000/svg","path");return Fe.setAttribute("d","M12 .5a12 12 0 0 0-3.79 23.39c.6.11.82-.26.82-.58v-2.17c-3.34.73-4.04-1.42-4.04-1.42-.55-1.39-1.34-1.76-1.34-1.76-1.09-.75.08-.73.08-.73 1.2.08 1.84 1.24 1.84 1.24 1.07 1.83 2.8 1.3 3.49.99.11-.78.42-1.3.76-1.6-2.67-.3-5.47-1.33-5.47-5.93 0-1.31.47-2.38 1.24-3.22-.13-.3-.54-1.52.11-3.18 0 0 1.01-.32 3.3 1.23a11.4 11.4 0 0 1 6 0c2.29-1.55 3.3-1.23 3.3-1.23.65 1.66.24 2.88.12 3.18.77.84 1.23 1.91 1.23 3.22 0 4.61-2.81 5.63-5.48 5.92.43.37.81 1.1.81 2.22v3.29c0 .32.22.69.83.58A12 12 0 0 0 12 .5Z"),te.append(Fe),te}const de=document.createElementNS("http://www.w3.org/2000/svg","path");de.setAttribute("d","M18 6 6 18");const Me=document.createElementNS("http://www.w3.org/2000/svg","path");return Me.setAttribute("d","m6 6 12 12"),te.append(de,Me),te}function c2e(){let q=[];try{q=JSON.parse(window.localStorage.getItem(_)||"[]")}catch{q=[]}Array.isArray(q)||(q=[]);const X=new Set(D.map(function(de){return de.id})),te=q.filter(function(de,Me){return typeof de=="string"&&X.has(de)&&q.indexOf(de)===Me});return D.forEach(function(de){te.includes(de.id)||te.push(de.id)}),te}function n1t(){return c2e().map(r1t).filter(Boolean)}function u2e(q){const X=[q].concat(c2e().filter(function(te){return te!==q}));try{window.localStorage.setItem(_,JSON.stringify(X))}catch{return}}function i1t(){const q=document.createElement("div");q.className="editor-picker",q.dataset.editorPicker="";const X=document.createElement("div");X.className="editor-trigger",X.dataset.editorTrigger="",X.setAttribute("role","group");const te=document.createElement("a");te.className="editor-open",te.href="#",te.dataset.editorOpen="",te.dataset.directLink="true",te.title="Open in editor";const de=document.createElement("span");de.className="editor-mark",de.dataset.editorMark="",de.setAttribute("aria-hidden","true"),de.textContent="--",te.append(de);const Me=document.createElement("button");Me.className="editor-menu-trigger",Me.type="button",Me.dataset.editorMenuTrigger="",Me.setAttribute("aria-haspopup","menu"),Me.setAttribute("aria-expanded","false"),Me.setAttribute("aria-label","Choose editor"),Me.title="Choose editor",Me.append(s6("chevron-down","editor-caret")),X.append(te,Me);const Fe=document.createElement("div");return Fe.className="editor-menu",Fe.dataset.editorMenu="",Fe.hidden=!0,Fe.setAttribute("role","menu"),q.append(X,Fe),q}function a1t(q,X){if(!X)return null;const te=document.createElement("a");return te.className="source-open",te.href=X,te.dataset.sourceOpen="",te.dataset.directLink="true",te.target="_blank",te.rel="noreferrer",te.title="Open on GitHub",te.setAttribute("aria-label","Open "+q+" on GitHub"),te.append(s6("github","source-icon")),te}function GP(q){const X=q.querySelector("[data-editor-trigger]"),te=q.querySelector("[data-editor-open]"),de=q.querySelector("[data-editor-menu-trigger]"),Me=q.querySelector("[data-editor-mark]"),Fe=q.querySelector("[data-editor-menu]"),We=n1t(),ft=We[0],mt=q.closest("[data-note-path]"),Nt=(mt==null?void 0:mt.dataset.notePath)||"";if(!(!X||!te||!de||!Me||!Fe||!ft||!Nt)){if(l2e(Me,ft),X.setAttribute("aria-label","Editor: "+ft.name),te.href=e1t(ft,Nt),te.title="Open "+Nt+" in "+ft.name,te.setAttribute("aria-label","Open "+Nt+" in "+ft.name),de.title="Choose editor",de.setAttribute("aria-label","Choose editor for "+Nt),q.dataset.primaryEditor=ft.id,Fe.replaceChildren(),h2e(Fe,ft,!0),We.length>1){const St=document.createElement("div");St.className="editor-menu-separator",St.setAttribute("role","separator"),Fe.append(St)}We.slice(1).forEach(function(St){h2e(Fe,St,!1)})}}function h2e(q,X,te){const de=document.createElement("button");de.className="editor-menu-item"+(te?" is-selected":""),de.type="button",de.dataset.editorOption=X.id,de.setAttribute("role","menuitemradio"),de.setAttribute("aria-checked",te?"true":"false");const Me=document.createElement("span");Me.className="editor-option-mark",l2e(Me,X);const Fe=document.createElement("span");Fe.className="editor-option-label",Fe.textContent=X.name,de.append(Me,Fe),q.append(de)}function d2e(){document.querySelectorAll("[data-editor-picker]").forEach(GP)}function cw(q,X){const te=q.querySelector("[data-editor-menu-trigger]"),de=q.querySelector("[data-editor-menu]");!te||!de||(X&&(uw(q),GP(q)),de.hidden=!X,te.setAttribute("aria-expanded",X?"true":"false"))}function uw(q){document.querySelectorAll("[data-editor-picker]").forEach(function(X){X!==q&&cw(X,!1)})}function hw(q){!o||!l||(l.hidden=!q,o.setAttribute("aria-expanded",q?"true":"false"))}function s1t(){if(!l)return null;const q=l.querySelector("[data-settings-reset]");if(q)return q;const X=document.createElement("div");X.className="viewer-settings-footer";const te=document.createElement("button");return te.type="button",te.className="viewer-settings-reset",te.dataset.settingsReset="",te.textContent="Reset to defaults",X.append(te),l.append(X),te}function o1t(){if(!s||!o||!l||s.dataset.settingsBound==="true")return;s.dataset.settingsBound="true";let q=j(),X=Be(),te=Ue();ot(q),it(X),Le(te);const de=s1t();de&&de.addEventListener("click",function(){q=pe({preset:W,custom:Z}),X=!0,te=De(J),S=F,re(q),xe(X),qe(te),je(S),ot(q),it(X),Le(te),Se(S)}),o.addEventListener("click",function(Fe){Fe.preventDefault(),Fe.stopPropagation(),hw(l.hidden)}),o.addEventListener("keydown",function(Fe){if(Fe.key!=="ArrowDown"&&Fe.key!=="Enter"&&Fe.key!==" ")return;Fe.preventDefault(),hw(!0);const We=l.querySelector("[data-theme-option].is-selected")||l.querySelector("[data-theme-option]");We&&We.focus()}),l.addEventListener("click",function(Fe){const We=me(Fe.target,"[data-theme-option]");We&&(Fe.preventDefault(),q=pe({preset:We.dataset.themeOption,custom:q.custom}),re(q),ot(q))}),l.addEventListener("keydown",function(Fe){if(Fe.key==="Escape"){Fe.preventDefault(),hw(!1),o.focus();return}if(Fe.key!=="Enter"&&Fe.key!==" ")return;const We=me(Fe.target,"[data-theme-option]");We&&(Fe.preventDefault(),q=pe({preset:We.dataset.themeOption,custom:q.custom}),re(q),ot(q))}),l.querySelectorAll("[data-theme-custom-value]").forEach(function(Fe){Fe.addEventListener("input",function(){const We=Fe.dataset.themeCustomValue;if(!Z[We]||!we(Fe.value))return;const ft=Object.assign({},q.custom);ft[We]=Fe.value.toLowerCase(),q=pe({preset:"custom",custom:ft}),re(q),ot(q)})}),d&&d.addEventListener("change",function(){X=d.checked,xe(X),it(X)});function Me(Fe,We){te=De(Object.assign({},te,{[Fe]:We})),qe(te),Le(te)}f&&f.addEventListener("change",function(){Me("font",f.value)}),p&&p.addEventListener("change",function(){Me("size",p.value)}),g&&g.addEventListener("change",function(){Me("spacing",g.value)}),m&&m.addEventListener("change",function(){Me("motion",m.value)}),y&&y.addEventListener("change",function(){Me("readableLineLength",y.checked)}),v&&v.addEventListener("change",function(){Me("highContrast",v.checked)}),T&&T.addEventListener("change",function(){Me("underlineLinks",T.checked)})}function Eo(){return e.querySelector(".note-panel.is-active-panel")}function l1t(){return me(document.activeElement,"[data-note-path]")}function f2e(){return l1t()||Eo()}function zh(q){!q||!e.contains(q)||(Ne().forEach(function(X){const te=X===q;X.classList.toggle("is-active-panel",te),X.dataset.activePanel=te?"true":"false",te||X.querySelectorAll("[data-editor-picker]").forEach(function(de){cw(de,!1)})}),d0(),Pt(q.dataset.notePath,!1))}function qP(){const q=Ne();q.length&&(Eo()||zh(q[q.length-1]))}function c1t(q){!q||q.dataset.resizeHandlesBound==="true"||(q.dataset.resizeHandlesBound="true",["left","right"].forEach(function(X){const te=document.createElement("button");te.type="button",te.className="note-resize-handle note-resize-handle-"+X,te.dataset.panelResizeHandle=X,te.setAttribute("aria-label","Resize note panel from the "+X),te.title="Resize panel",te.addEventListener("pointerdown",W1t),te.addEventListener("keydown",function(de){V1t(q,X,de)}),q.append(te)}),p2e(q),q.addEventListener("scroll",function(){p2e(q)},{passive:!0}))}function p2e(q){q&&q.style.setProperty("--note-panel-scroll-top",Math.max(0,q.scrollTop||0)+"px")}function u1t(q){if(!q||q.dataset.editorBound==="true")return;q.dataset.editorBound="true",GP(q);const X=q.querySelector("[data-editor-menu-trigger]"),te=q.querySelector("[data-editor-menu]");!X||!te||(X.addEventListener("click",function(de){de.preventDefault(),de.stopPropagation(),cw(q,te.hidden)}),X.addEventListener("keydown",function(de){if(de.key!=="ArrowDown"&&de.key!=="Enter"&&de.key!==" ")return;de.preventDefault(),cw(q,!0);const Me=te.querySelector("[data-editor-option]");Me&&Me.focus()}),te.addEventListener("click",function(de){const Me=me(de.target,"[data-editor-option]");Me&&(de.preventDefault(),de.stopPropagation(),u2e(Me.dataset.editorOption),d2e(),uw())}),te.addEventListener("keydown",function(de){if(de.key==="Escape"){de.preventDefault(),cw(q,!1),X.focus();return}if(de.key!=="Enter"&&de.key!==" ")return;const Me=me(de.target,"[data-editor-option]");Me&&(de.preventDefault(),u2e(Me.dataset.editorOption),d2e(),uw(),X.focus())}))}function sl(){return Ne().map(function(q){return q.dataset.notePath})}function g2e(){const q=new URLSearchParams(window.location.search);return q.get("empty")==="1"?[]:[nr(window.location.href)||sl()[0]||"index.md"].concat(q.getAll("stack").filter(Boolean))}function m2e(){return y2e(window.location.href)}function y2e(q){let X;try{X=new URL(q,window.location.href)}catch{return""}return(X.searchParams.get("ok-highlight")||"").trim()}function v2e(q,X){if(!q.length){const de=new URL(or("index.md"),window.location.href);return de.searchParams.set("empty","1"),de}const te=new URL(or(q[0]||"index.md"),window.location.href);return q.slice(1).forEach(function(de){te.searchParams.append("stack",de)}),X&&te.searchParams.set("ok-highlight",X),te}function Jv(){const q=Ne().length,X=q===0;t.classList.toggle("is-empty",X),t.classList.toggle("is-single-panel",q===1),t.classList.toggle("is-multi-panel",q>1),r&&(r.hidden=!X),Ne().forEach(ct),qP(),h1t(),h6(),o6()}function h1t(){const q=sl();Ne().forEach(function(X,te){const de=X.querySelector("[data-close-panel]");if(!de)return;const Me=q.filter(function(Fe,We){return We!==te});de.href=v2e(Me).href})}function dw(){return Math.max(0,t.scrollWidth-t.clientWidth)}function fw(){return!!(b&&w&&k&&Ne().length>1&&dw()>1&&!t.classList.contains("is-empty"))}function o6(){window.requestAnimationFrame(d1t)}function d1t(){if(!b||!w||!k)return;if(!fw()){b.hidden=!0,b.setAttribute("aria-hidden","true"),k.style.width="",k.style.setProperty("--thumb-x","0px"),k.setAttribute("aria-valuemax","0"),k.setAttribute("aria-valuenow","0");return}b.hidden=!1,b.setAttribute("aria-hidden","false");const q=w.getBoundingClientRect().width;if(q<=0)return;const X=dw(),te=ve(q*(t.clientWidth/t.scrollWidth),44,q),de=Math.max(0,q-te),Me=X>0?t.scrollLeft/X*de:0;k.style.width=te+"px",k.style.setProperty("--thumb-x",ve(Me,0,de)+"px"),k.setAttribute("aria-valuemax",String(Math.round(X))),k.setAttribute("aria-valuenow",String(Math.round(t.scrollLeft)))}function VP(q,X){if(!fw())return;const te=w.getBoundingClientRect(),de=k.getBoundingClientRect(),Me=Math.max(0,te.width-de.width),Fe=dw(),We=ve(q-te.left-X,0,Me);t.scrollLeft=Me>0?We/Me*Fe:0}function d0(){const q=Ne(),X=Eo()||q[q.length-1];if(!X){document.title="Knowledge base - Open Knowledge";return}const te=(X==null?void 0:X.dataset.noteTitle)||(X==null?void 0:X.dataset.notePath)||"Open Knowledge";document.title=te+" - Open Knowledge"}function pw(q,X,te){const de=v2e(q,te),Me={stack:q};window.history.pushState(Me,"",de)}function f1t(){window.clearTimeout(_e),_e=window.setTimeout(function(){b2e(e,!0)},60)}function f0(q,X,te){return q.getPropertyValue(X).trim()||te}function p1t(){const q=window.getComputedStyle(document.documentElement),X=f0(q,"--ok-color-page","#ffffff"),te=f0(q,"--ok-color-surface",X),de=f0(q,"--ok-color-text","#202322"),Me=f0(q,"--ok-color-muted","#707773"),Fe=f0(q,"--ok-color-accent","#0b7a53"),We=f0(q,"--ok-color-border","#e3e6e4");return{startOnLoad:!1,securityLevel:"strict",suppressErrorRendering:!0,logLevel:"fatal",theme:"base",themeVariables:{background:X,primaryColor:te,primaryTextColor:de,primaryBorderColor:We,lineColor:Me,secondaryColor:X,secondaryTextColor:de,secondaryBorderColor:We,tertiaryColor:te,tertiaryTextColor:de,tertiaryBorderColor:We,mainBkg:te,nodeBorder:Fe,clusterBkg:X,clusterBorder:We,titleColor:de,edgeLabelBackground:te,textColor:de,fontFamily:f0(q,"--ok-font-body","sans-serif")},flowchart:{htmlLabels:!1}}}function g1t(q){var te,de;const X=[];return(te=q==null?void 0:q.matches)!=null&&te.call(q,"[data-mermaid-source]")&&X.push(q),(de=q==null?void 0:q.querySelectorAll)==null||de.call(q,"[data-mermaid-source]").forEach(function(Me){X.push(Me)}),X}function m1t(q){var Fe;const X=me(q,"[data-mermaid-diagram]");if(X)return X;const te=document.createElement("figure");te.className="ok-mermaid",te.dataset.mermaidDiagram="";const de=document.createElement("div");de.className="ok-mermaid-output",de.dataset.mermaidOutput="",de.setAttribute("role","img"),de.setAttribute("aria-label","Mermaid diagram"),de.hidden=!0;const Me=document.createElement("p");return Me.className="ok-mermaid-error",Me.dataset.mermaidError="",Me.setAttribute("role","status"),Me.textContent="This Mermaid diagram could not be rendered. Its source is shown below.",Me.hidden=!0,q.parentNode.insertBefore(te,q),te.append(de,Me,q),te._openKnowledgeMermaidSource=String(((Fe=q.querySelector("code"))==null?void 0:Fe.textContent)||q.textContent||""),te}function b2e(q,X){if(!window.mermaid||typeof window.mermaid.render!="function")return;const te=g1t(q).map(m1t).filter(function(Me){const Fe=Me.dataset.mermaidState||"";return X||Fe!=="queued"&&Fe!=="rendering"&&Fe!=="rendered"});if(!te.length)return;const de=++fe;te.forEach(function(Me){Me.dataset.mermaidState="queued",Me._openKnowledgeMermaidRequest=de}),ne=ne.catch(function(){}).then(function(){return y1t(te,de)})}async function y1t(q,X){try{window.mermaid.initialize(p1t())}catch{q.forEach(function(te){const de=te.querySelector("[data-mermaid-source]"),Me=te.querySelector("[data-mermaid-output]"),Fe=te.querySelector("[data-mermaid-error]");te._openKnowledgeMermaidRequest!==X||!de||!Me||!Fe||(Me.hidden=!0,de.hidden=!1,Fe.hidden=!1,te.dataset.mermaidState="error")});return}for(const te of q){if(te._openKnowledgeMermaidRequest!==X)continue;const de=te.querySelector("[data-mermaid-source]"),Me=te.querySelector("[data-mermaid-output]"),Fe=te.querySelector("[data-mermaid-error]");if(!(!de||!Me||!Fe)){te.dataset.mermaidState="rendering",Me.setAttribute("aria-busy","true");try{const We=await window.mermaid.render("ok-mermaid-"+ ++ue,te._openKnowledgeMermaidSource);if(te._openKnowledgeMermaidRequest!==X)continue;Me.innerHTML=We.svg,typeof We.bindFunctions=="function"&&We.bindFunctions(Me),Me.hidden=!1,de.hidden=!0,Fe.hidden=!0,te.dataset.mermaidState="rendered"}catch{if(te._openKnowledgeMermaidRequest!==X)continue;te.dataset.mermaidRendered!=="true"&&(Me.hidden=!0,de.hidden=!1,Fe.hidden=!1),te.dataset.mermaidState="error"}finally{Me.removeAttribute("aria-busy")}te.dataset.mermaidState==="rendered"&&(te.dataset.mermaidRendered="true")}}}function v1t(q){q.querySelectorAll("table").forEach(function(X){var Zt,sr,zt;if(X.dataset.okTableEnhanced==="true")return;const te=(sr=(Zt=X.tHead)==null?void 0:Zt.rows)==null?void 0:sr[0],de=(zt=X.tBodies)==null?void 0:zt[0];if(!te||!de)return;const Me=Array.prototype.slice.call(te.cells),Fe=Array.prototype.slice.call(de.rows);if(!Me.length||!Fe.length)return;X.classList.add("ok-table"),X.dataset.okTable="",X.dataset.okTableEnhanced="true",Fe.forEach(function(Ut,er){Ut.dataset.okTableOriginalIndex=String(er)});const We=b1t(X),ft={query:"",filters:Me.map(function(){return""}),sortColumn:-1,sortDirection:"asc"},mt=document.createElement("span");mt.className="ok-table-count",mt.dataset.okTableCount="";function Nt(){let Ut=0;Fe.forEach(function(er){const Ar=!ft.query||g0(er.textContent).includes(ft.query),yn=ft.filters.every(function(xi,ll){return!xi||g0(p0(er.cells[ll]))===xi}),xn=Ar&&yn;er.hidden=!xn,xn&&(Ut+=1)}),mt.textContent=Ut===Fe.length?w2e(Fe.length):Ut+" / "+w2e(Fe.length)}Me.forEach(function(Ut,er){T1t(Ut,de,Me,Fe,ft,er)});const St=x1t(Me,Fe,ft,mt,Nt);We.insertBefore(St,We.firstChild),Nt()})}function b1t(q){let X=me(q,"[data-ok-table-wrap]");if(!X){X=document.createElement("div"),X.className="ok-table-wrap",X.dataset.okTableWrap="";const te=document.createElement("div");return te.className="ok-table-scroller",q.parentNode.insertBefore(X,q),X.append(te),te.append(q),X}if(!me(q,".ok-table-scroller")){const te=document.createElement("div");te.className="ok-table-scroller",q.parentNode.insertBefore(te,q),te.append(q)}return X}function x1t(q,X,te,de,Me){const Fe=document.createElement("div");Fe.className="ok-table-tools",Fe.dataset.okTableControls="";const We=document.createElement("input");We.className="ok-table-search",We.type="search",We.placeholder="Filter table",We.setAttribute("aria-label","Filter table rows"),We.addEventListener("input",function(){te.query=g0(We.value),Me()}),Fe.append(We);const ft=document.createElement("div");ft.className="ok-table-filter-list";const mt=[];let Nt,St;function Zt(){const sr=te.filters.filter(Boolean).length;Nt&&(Nt.textContent=sr?"Filters ("+sr+")":"Filters"),St&&(St.disabled=sr===0)}if(q.forEach(function(sr,zt){const Ut=C1t(X,zt);if(Ut.length<2||Ut.length>30)return;const er=document.createElement("select"),Ar=p0(sr)||"Column "+(zt+1);er.setAttribute("aria-label","Filter by "+Ar);const yn=document.createElement("option");yn.value="",yn.textContent=Ar+": All",er.append(yn),Ut.forEach(function(xn){const xi=document.createElement("option");xi.value=g0(xn),xi.textContent=xn,er.append(xi)}),er.addEventListener("change",function(){te.filters[zt]=er.value,Zt(),Me()}),mt.push(er),ft.append(er)}),ft.children.length){const sr=document.createElement("details");sr.className="ok-table-filter-menu";const zt=document.createElement("summary");zt.className="ok-table-filter-trigger",zt.setAttribute("role","button"),zt.setAttribute("aria-label","Table filters"),Nt=document.createElement("span"),Nt.textContent="Filters",zt.append(Nt);const Ut=document.createElement("div");Ut.className="ok-table-filter-panel",St=document.createElement("button"),St.className="ok-table-clear",St.type="button",St.textContent="Clear filters",St.addEventListener("click",function(){te.filters=te.filters.map(function(){return""}),mt.forEach(function(er){er.value=""}),Zt(),Me(),mt[0]&&mt[0].focus()}),Ut.append(ft,St),sr.append(zt,Ut),sr.addEventListener("keydown",function(er){er.key==="Escape"&&(sr.open=!1,zt.focus())}),Fe.append(sr),Zt()}return Fe.append(de),Fe}function T1t(q,X,te,de,Me,Fe){if(q.dataset.okTableSort="",q.tabIndex=0,q.setAttribute("aria-label","Sort by "+(p0(q)||"column "+(Fe+1))),!q.querySelector(".ok-table-sort-indicator")){const ft=document.createElement("span");ft.className="ok-table-sort-indicator",ft.setAttribute("aria-hidden","true"),q.append(ft)}function We(ft){ft&&me(ft.target,"a[href], button, input, textarea, select, [contenteditable='true']")||w1t(X,te,de,Me,Fe)}q.addEventListener("click",We),q.addEventListener("keydown",function(ft){ft.key!=="Enter"&&ft.key!==" "||(ft.preventDefault(),We(ft))})}function w1t(q,X,te,de,Me){const Fe=de.sortColumn===Me&&de.sortDirection==="asc"?"desc":"asc";de.sortColumn=Me,de.sortDirection=Fe,X.forEach(function(ft){ft.removeAttribute("aria-sort"),ft.removeAttribute("data-sort-direction")}),X[Me].setAttribute("aria-sort",Fe==="asc"?"ascending":"descending"),X[Me].dataset.sortDirection=Fe;const We=Fe==="asc"?1:-1;te.sort(function(ft,mt){const Nt=x2e(p0(ft.cells[Me]),p0(mt.cells[Me]));return Nt!==0?Nt*We:Number(ft.dataset.okTableOriginalIndex||0)-Number(mt.dataset.okTableOriginalIndex||0)}),te.forEach(function(ft){q.append(ft)})}function C1t(q,X){const te=new Set,de=[];return q.forEach(function(Me){const Fe=p0(Me.cells[X]),We=g0(Fe);!We||te.has(We)||Fe.length>80||(te.add(We),de.push(Fe))}),de.sort(function(Me,Fe){return x2e(Me,Fe)})}function x2e(q,X){const te=g0(q),de=g0(X);if(!te&&de)return 1;if(te&&!de)return-1;const Me=T2e(te),Fe=T2e(de);return Me!==null&&Fe!==null&&Me!==Fe?Me-Fe:te.localeCompare(de,void 0,{numeric:!0,sensitivity:"base"})}function T2e(q){const X=String(q||"").replace(/,/g,"");return/^[+-]?\d+(?:\.\d+)?%?$/.test(X)?Number(X.replace(/%$/,"")):null}function p0(q){return String((q==null?void 0:q.textContent)||"").replace(/\s+/g," ").trim()}function g0(q){return p0({textContent:String(q||"")}).toLocaleLowerCase()}function w2e(q){return q+(q===1?" row":" rows")}function e2(){var X;const q=Ne();q.forEach(function(te){te.querySelectorAll(".note-body a.is-active-note").forEach(function(de){de.classList.remove("is-active-note"),de.removeAttribute("aria-current")})}),q.forEach(function(te,de){var Fe;const Me=(Fe=q[de+1])==null?void 0:Fe.dataset.notePath;Me&&te.querySelectorAll(".note-body a[href]").forEach(function(We){nr(We.getAttribute("href")||We.href,te.dataset.notePath)===Me&&(We.classList.add("is-active-note"),We.setAttribute("aria-current","true"))})}),Pt(((X=Eo()||q[q.length-1])==null?void 0:X.dataset.notePath)||"",!1)}function l6(q){zh(q),window.requestAnimationFrame(function(){q.scrollIntoView({block:"nearest",inline:"end",behavior:Ie()?"auto":"smooth"}),q.focus({preventScroll:!0})})}function WP(q){(q||document).querySelectorAll("mark.ok-search-highlight").forEach(function(te){const de=te.parentNode;de&&(te.replaceWith.apply(te,Array.prototype.slice.call(te.childNodes)),de.normalize())})}function t2(q,X){WP(e);const te=String(X||"").trim(),de=q==null?void 0:q.querySelector(".note-body");!de||!te||window.requestAnimationFrame(function(){const Me=k1t(de,te);if(!Me)return;const Fe=document.createElement("mark");Fe.className="ok-search-highlight",Fe.dataset.searchHighlight="",Fe.append(Me.extractContents()),Me.insertNode(Fe),Fe.scrollIntoView({block:"center",inline:"nearest",behavior:Ie()?"auto":"smooth"}),q.focus({preventScroll:!0})})}function k1t(q,X){const te=S1t(X);if(!te)return null;const de=E1t(q),Me=de.text.indexOf(te);if(Me<0)return null;let Fe=Me,We=Me+te.length;for(;FeFe&&de.text[We-1]===" ";)We--;const ft=de.positions[Fe],mt=de.positions[We-1];if(!ft||!mt)return null;const Nt=document.createRange();return Nt.setStart(ft.node,ft.start),Nt.setEnd(mt.node,mt.end),Nt}function E1t(q){const X=document.createTreeWalker(q,NodeFilter.SHOW_TEXT),te=[],de=[];let Me=!0,Fe;for(;Fe=X.nextNode();){if(me(Fe.parentElement,"[hidden], [aria-hidden='true']"))continue;const We=Fe.nodeValue||"";for(let ft=0;ft1&&!t.classList.contains("is-empty")}function HP(){return mw&&I2e()}function h6(){t.classList.toggle("is-space-panning",HP())}function B1t(q){!L2e(q)||q.defaultPrevented||q.metaKey||q.ctrlKey||q.shiftKey||q.altKey||P1t(q.target)||I2e()&&(mw=!0,h6(),q.preventDefault())}function F1t(q){!L2e(q)||!mw||(mw=!1,h6(),q.preventDefault())}function z1t(){mw=!1,h6()}function D2e(){r2=Date.now()+350,window.setTimeout(function(){Date.now()>=r2&&(r2=0)},360)}function G1t(q){return!r2||Date.now()>r2?!1:(r2=0,q.preventDefault(),q.stopPropagation(),!0)}function M2e(q){return q.getBoundingClientRect().width||et(q)||wt()}function N2e(q,X){const te=ye(X,q);return!te||!q?null:(q.style.setProperty("--note-panel-width",te+"px"),q.dataset.panelWidth=String(te),q.dataset.notePath&&(I[q.dataset.notePath]=te),o6(),te)}function q1t(q,X,te){return(q==="left"?-X:X)*(te?2:1)}function V1t(q,X,te){const de=(te.key||"").toLowerCase(),Me=M2e(q),Fe=te.shiftKey?64:24;let We=Me;if(de==="arrowleft")We+=X==="left"?Fe:-Fe;else if(de==="arrowright")We+=X==="right"?Fe:-Fe;else if(de==="home")We=oe();else if(de==="end")We=ut(q);else return;te.preventDefault(),te.stopPropagation();const ft=N2e(q,We);ft&&(X==="left"&&!dt(q)&&(t.scrollLeft+=ft-Me),Te())}function W1t(q){const X=me(q.target,"[data-panel-resize-handle]"),te=X==null?void 0:X.closest("[data-note-path]");if(!(!X||!te||q.button!==0)){Mi={pointerId:q.pointerId,panel:te,handle:X,edge:X.dataset.panelResizeHandle==="left"?"left":"right",centered:dt(te),startX:q.clientX,startWidth:M2e(te),startScrollLeft:t.scrollLeft,moved:!1},zh(te),te.classList.add("is-panel-resizing"),document.body.classList.add("is-panel-resizing"),window.addEventListener("pointermove",O2e),window.addEventListener("pointerup",d6),window.addEventListener("pointercancel",d6),window.addEventListener("blur",P2e),q.preventDefault(),q.stopPropagation();try{X.setPointerCapture(q.pointerId)}catch{}}}function O2e(q){if(!Mi||q.pointerId!==Mi.pointerId)return;const X=q.clientX-Mi.startX;Math.abs(X)>2&&(Mi.moved=!0);const te=Mi.startWidth+q1t(Mi.edge,X,Mi.centered),de=N2e(Mi.panel,te);de&&(Mi.edge==="left"&&!Mi.centered&&(t.scrollLeft=Mi.startScrollLeft+(de-Mi.startWidth)),q.preventDefault())}function $2e(q){if(!Mi)return;const X=Mi.moved;Mi.panel.classList.remove("is-panel-resizing");try{q!==void 0&&Mi.handle.releasePointerCapture(q)}catch{}Mi=null,document.body.classList.remove("is-panel-resizing"),window.removeEventListener("pointermove",O2e),window.removeEventListener("pointerup",d6),window.removeEventListener("pointercancel",d6),window.removeEventListener("blur",P2e),X&&(Te(),D2e())}function d6(q){!Mi||q.pointerId!==Mi.pointerId||$2e(q.pointerId)}function P2e(){$2e()}function U1t(q){return(q.pointerType||"mouse")!=="mouse"||!R2e.matches||q.button!==0||Ne().length<2||q.defaultPrevented||q.metaKey||q.ctrlKey||q.shiftKey||q.altKey?!1:HP()?!$1t(q.target):!me(q.target,"[data-note-path], a, button, input, textarea, select, [contenteditable='true'], [role='button']")}function H1t(q){if(!U1t(q))return;const X=HP();ol={pointerId:q.pointerId,startX:q.clientX,startScrollLeft:t.scrollLeft,moved:!1,fromSpacePan:X},t.classList.add("is-drag-scrolling"),X&&q.preventDefault();try{t.setPointerCapture(q.pointerId)}catch{}}function Y1t(q){if(!ol||q.pointerId!==ol.pointerId)return;const X=q.clientX-ol.startX;Math.abs(X)<3&&!ol.moved||(ol.moved=!0,t.scrollLeft=ol.startScrollLeft-X,q.preventDefault())}function B2e(q){if(!ol||q.pointerId!==ol.pointerId)return;const X=ol;try{t.releasePointerCapture(q.pointerId)}catch{}(X.moved||X.fromSpacePan)&&D2e(),ol=null,t.classList.remove("is-drag-scrolling")}function X1t(q){if(!fw()||q.button!==0)return;const X=k.getBoundingClientRect();oc={pointerId:q.pointerId,thumbOffset:ve(q.clientX-X.left,0,X.width)},b.classList.add("is-rail-dragging"),window.addEventListener("pointermove",YP),window.addEventListener("pointerup",n2),window.addEventListener("pointercancel",n2),window.addEventListener("blur",z2e),VP(q.clientX,oc.thumbOffset),q.preventDefault();try{k.setPointerCapture(q.pointerId)}catch{}}function K1t(q){if(!fw()||q.button!==0||me(q.target,"[data-workspace-scroll-thumb]"))return;const X=k.getBoundingClientRect();VP(q.clientX,X.width/2),q.preventDefault()}function YP(q){!oc||q.pointerId!==oc.pointerId||(VP(q.clientX,oc.thumbOffset),q.preventDefault())}function F2e(q){const X=q??oc.pointerId;try{k.releasePointerCapture(X)}catch{}oc=null,b.classList.remove("is-rail-dragging"),window.removeEventListener("pointermove",YP),window.removeEventListener("pointerup",n2),window.removeEventListener("pointercancel",n2),window.removeEventListener("blur",z2e)}function n2(q){!oc||q.pointerId!==oc.pointerId||F2e(q.pointerId)}function z2e(){oc&&F2e()}function j1t(q){if(!fw())return;const X=Math.max(48,t.clientWidth*.12),te=Math.max(120,t.clientWidth*.72);let de=t.scrollLeft;const Me=(q.key||"").toLowerCase();if(Me==="arrowleft")de-=X;else if(Me==="arrowright")de+=X;else if(Me==="pageup")de-=te;else if(Me==="pagedown")de+=te;else if(Me==="home")de=0;else if(Me==="end")de=dw();else return;q.preventDefault(),t.scrollLeft=ve(de,0,dw())}if(t.addEventListener("pointerdown",H1t),t.addEventListener("pointermove",Y1t),t.addEventListener("pointerup",B2e),t.addEventListener("pointercancel",B2e),t.addEventListener("scroll",o6),window.addEventListener("keydown",B1t,!0),window.addEventListener("keyup",F1t,!0),window.addEventListener("blur",z1t),window.addEventListener("resize",o6),w&&k&&(w.addEventListener("pointerdown",K1t),k.addEventListener("pointerdown",X1t),k.addEventListener("pointermove",YP),k.addEventListener("pointerup",n2),k.addEventListener("pointercancel",n2),k.addEventListener("keydown",j1t)),t.addEventListener("click",function(q){if(G1t(q))return;const X=me(q.target,"[data-note-path]");X&&zh(X);const te=me(q.target,"[data-close-panel]");if(te){const mt=te.closest("[data-note-path]");if(!mt)return;q.preventDefault(),u6(mt);return}const de=me(q.target,"[data-tree-path]"),Me=me(q.target,"[data-graph-path]");if(de||Me){if(q.defaultPrevented||q.button!==0||q.metaKey||q.ctrlKey||q.altKey)return;q.preventDefault(),m0((de==null?void 0:de.dataset.treePath)||Me.dataset.graphPath,!0,H(q.shiftKey),"",Eo());return}const Fe=me(q.target,"a[href]");if(!Fe||Fe.dataset.directLink==="true"||q.defaultPrevented||q.button!==0||q.metaKey||q.ctrlKey||q.altKey)return;const We=Fe.closest("[data-note-path]");if(!We)return;const ft=nr(Fe.getAttribute("href")||Fe.href,We.dataset.notePath);ft&&(q.preventDefault(),m0(ft,!0,H(q.shiftKey),"",We))}),t.addEventListener("keydown",function(q){if(q.key!=="Enter"||!q.shiftKey||q.metaKey||q.ctrlKey||q.altKey)return;const X=me(q.target,".note-body a[href]"),te=X==null?void 0:X.closest("[data-note-path]");if(!X||!te)return;const de=nr(X.getAttribute("href")||X.href,te.dataset.notePath);de&&(q.preventDefault(),m0(de,!0,H(!0),"",te))}),t.addEventListener("focusin",function(q){const X=me(q.target,"[data-note-path]");X&&zh(X)}),window.OpenKnowledgeShortcuts&&window.OpenKnowledgeShortcuts.register(Ae),i){const q={id:"viewer.sidebar.toggle",code:"KeyS",metaOrCtrlKey:!0,altKey:!0,label:"⌘⌥S",ariaKeyShortcut:"Meta+Alt+S",run:Ft},X=window.OpenKnowledgeShortcuts;if(i.addEventListener("click",Ft),X){X.register(q);const te=X.format(q);i.title="File explorer ("+te+")",i.setAttribute("aria-keyshortcuts",X.ariaKeyShortcut(q)),document.querySelectorAll("[data-sidebar-shortcut]").forEach(function(de){de.textContent=te})}}a&&a.addEventListener("click",function(){_t(!1),i==null||i.focus()}),n&&n.addEventListener("click",function(q){const X=me(q.target,"[data-tree-path]"),te=X||me(q.target,"a[href]");if(!te||q.defaultPrevented||q.button!==0||q.metaKey||q.ctrlKey||q.altKey)return;const de=(X==null?void 0:X.dataset.treePath)||nr(te.getAttribute("href")||te.href);de&&(q.preventDefault(),G2e(te),m0(de,!0,H(q.shiftKey),"",Eo()),C.matches&&_t(!1))});function G2e(q){const X=me(q,".search");if(!X)return;const te=X.querySelector(".search-input"),de=X.querySelector(".search-results"),Me=X.querySelector(".search-status");te&&(te.value=""),Me&&(Me.textContent=""),de&&(de.hidden=!0,de.replaceChildren())}window.addEventListener("popstate",function(){const q=g2e();_2e(q,m2e())}),document.addEventListener("click",function(q){const X=me(q.target,".search-result[href]");if(X){if(q.defaultPrevented||q.button!==0||q.metaKey||q.ctrlKey||q.altKey)return;const te=nr(X.getAttribute("href")||X.href);if(te){q.preventDefault();const de=q.shiftKey||X.dataset.openBeside==="true",Me=H(de);delete X.dataset.openBeside,G2e(X),m0(te,!0,Me,y2e(X.getAttribute("href")||X.href),Eo());return}}me(q.target,"[data-editor-picker]")||uw(),me(q.target,"[data-viewer-settings]")||hw(!1)}),document.addEventListener("keydown",function(q){q.key==="Escape"&&(uw(),hw(!1),_t(!1))});const yw=g2e(),q2e=m2e();he(),o1t(),ps(),Ln(),Ne().forEach(S2e),qP(),yw.length!==1||yw[0]!==((V2e=Ne()[0])==null?void 0:V2e.dataset.notePath)?(window.history.replaceState({stack:yw},"",window.location.href),_2e(yw,q2e)):(window.history.replaceState({stack:yw},"",window.location.href),Jv(),e2(),d0(),t2(Eo(),q2e))})(),(()=>{const t=Array.from(document.querySelectorAll(".search"));if(t.length===0)return;const e=w(),r=document.querySelector("[data-primary-search]")||t[0],n=r==null?void 0:r.querySelector(".search-input"),i=window.OpenKnowledgeShortcuts,a={id:"viewer.search.focus",key:"k",metaOrCtrlKey:!0,label:"⌘K",allowEditable:!0,run:()=>{n==null||n.focus(),n==null||n.select()}};t.forEach(s),i?(i.register(a),document.querySelectorAll("[data-search-shortcut]").forEach(S=>{S.textContent=i.format(a)})):document.addEventListener("keydown",S=>{(S.metaKey||S.ctrlKey)&&!S.altKey&&S.key.toLowerCase()==="k"&&(S.preventDefault(),n==null||n.focus(),n==null||n.select())});function s(S){const R=S.querySelector(".search-input"),N=S.querySelector(".search-results"),D=S.querySelector(".search-status");if(!R||!N||!D)return;const I=S.dataset.searchUrl||"/api/search";let $=0,B=null,P=-1,G=0,V="";m(R,N),K(!1),S===r&&(V=o(),V&&(R.value=V,window.requestAnimationFrame(()=>{R.focus(),R.select(),W(V)}))),R.addEventListener("input",()=>{if(V="",l(),window.clearTimeout($),J(-1,!1),!R.value.trim()){ie(!0);return}$=window.setTimeout(Y,140)}),R.addEventListener("focus",()=>{if(!R.value.trim()){ie(!0);return}y(N).length>0?se(!0):Y()}),R.addEventListener("keydown",Z=>{const ee=y(N);if(Z.key==="ArrowDown"||Z.key==="ArrowUp"){if(!ee.length)return;Z.preventDefault();const ne=Z.key==="ArrowDown"?1:-1,ue=P<0?ne>0?0:ee.length-1:(P+ne+ee.length)%ee.length;J(ue,!0),se(!0);return}if(Z.key==="Enter"){const ne=v(N,P);if(!ne)return;Z.preventDefault(),ne.dataset.openBeside=Z.shiftKey?"true":"false",ne.click(),K(!0);return}Z.key==="Escape"&&(!N.hidden||R.value)&&(Z.preventDefault(),K(!0))}),N.addEventListener("mousemove",Z=>{const ee=T(Z.target);if(!ee)return;const ne=y(N).indexOf(ee);ne>=0&&J(ne,!1)}),N.addEventListener("focusin",Z=>{const ee=T(Z.target);if(!ee)return;const ne=y(N).indexOf(ee);ne>=0&&J(ne,!1)}),N.addEventListener("click",Z=>{!T(Z.target)||b(Z)||K(!0)}),document.addEventListener("pointerdown",Z=>{!N.hidden&&!S.contains(Z.target)&&K(!0)}),document.addEventListener("focusin",Z=>{!N.hidden&&!S.contains(Z.target)&&K(!0)});async function Y(){const Z=R.value.trim();if(!Z){ie(document.activeElement===R);return}const ee=++G;if(J(-1,!1),e.length>0){u(N,D,k(Z),Z,se,J);return}B&&B.abort(),B=new AbortController,D.textContent="Searching...";try{const ne=await fetch(I+"?q="+encodeURIComponent(Z)+"&limit=12",{signal:B.signal});if(!ne.ok)throw new Error("search request failed");const ue=await ne.json();if(ee!==G||R.value.trim()!==Z)return;u(N,D,ue.results||[],Z,se,J)}catch(ne){if(ne.name==="AbortError")return;D.textContent="Search failed.",J(-1,!1),se(!1)}}async function W(Z){var _e;const ee=String(Z||"").trim();if(!ee)return;const ne=++G,ue=((_e=document.querySelector("[data-note-path]"))==null?void 0:_e.dataset.notePath)||"";if(J(-1,!1),e.length>0){const Ae=A(ee,ue);u(N,D,Ae,ee,se,J,{emptyStatus:'No other notes tagged "'+ee+'".',keepOpenWhenEmpty:!0,statusText:Ae.length+" note"+(Ae.length===1?"":"s")+' tagged "'+ee+'"'});return}B&&B.abort(),B=new AbortController,D.textContent="Finding tagged notes...";const fe=new URLSearchParams({tag:ee,limit:"30"});ue&&fe.set("exclude",ue);try{const Ae=await fetch(I+"?"+fe.toString(),{signal:B.signal});if(!Ae.ok)throw new Error("tag search request failed");const Ne=await Ae.json();if(ne!==G||V!==ee)return;const me=Ne.results||[];u(N,D,me,ee,se,J,{emptyStatus:'No other notes tagged "'+ee+'".',keepOpenWhenEmpty:!0,statusText:me.length+" note"+(me.length===1?"":"s")+' tagged "'+ee+'"'})}catch(Ae){if(Ae.name==="AbortError")return;D.textContent="Tag lookup failed.",J(-1,!1),se(!1)}}function ie(Z){G+=1,window.clearTimeout($),B&&(B.abort(),B=null);const ee=p();D.textContent=ee.length?"Top files":"",u(N,D,ee,"",se,J,{emptyStatus:"",keepOpenWhenEmpty:Z,statusText:ee.length?"Top files":""}),se(Z&&ee.length>0)}function K(Z){G+=1,window.clearTimeout($),B&&(B.abort(),B=null),Z&&(R.value="",V="",l()),D.textContent="",N.replaceChildren(),J(-1,!1),se(!1)}function se(Z){N.hidden=!Z,R.setAttribute("aria-expanded",Z?"true":"false"),Z||R.removeAttribute("aria-activedescendant")}function J(Z,ee){const ne=y(N);P=ne.length?(Z+ne.length)%ne.length:-1,ne.forEach((ue,fe)=>{const _e=fe===P;ue.classList.toggle("is-active",_e),ue.setAttribute("aria-selected",_e?"true":"false"),_e&&(R.setAttribute("aria-activedescendant",ue.id),ee&&ue.scrollIntoView({block:"nearest"}))}),P<0&&R.removeAttribute("aria-activedescendant")}}function o(){try{return(new URL(window.location.href).searchParams.get("ok-tag")||"").trim()}catch{return""}}function l(){let S;try{S=new URL(window.location.href)}catch{return}S.searchParams.has("ok-tag")&&(S.searchParams.delete("ok-tag"),window.history.replaceState(window.history.state,"",S))}function u(S,R,N,D,I,$,B){const P=B||{},G=h(N);if(S.replaceChildren(),G.length===0){const V=P.emptyStatus??'No results for "'+D+'".';if(R.textContent=V,V){const Y=document.createElement("div");Y.className="search-empty",Y.textContent=V,S.append(Y)}$(-1,!1),I(!!P.keepOpenWhenEmpty);return}R.textContent=P.statusText||G.length+" document"+(G.length===1?"":"s"),I(!0),G.forEach((V,Y)=>{const W=document.createElement("a");W.className="search-result",W.href=V.highlightURL||V.url||O(V.path),W.id=S.id+"-option-"+Y,W.setAttribute("role","option"),W.setAttribute("aria-selected","false"),W.title=d();const ie=document.createElement("span");ie.className="search-result-title-row";const K=document.createElement("span");if(K.className="search-result-title",f(K,V.title||V.path,D),ie.append(K),V.matchCount>1){const J=document.createElement("span");J.className="search-result-count",J.textContent=V.matchCount+" matches",ie.append(J)}W.append(ie);const se=document.createElement("span");if(se.className="search-result-meta",se.textContent=[V.path,V.type,V.matchCount===1?V.heading:""].filter(Boolean).join(" - "),W.append(se),V.snippet){const J=document.createElement("span");J.className="search-result-snippet",f(J,V.snippet,D),W.append(J)}if(V.headings.length>1){const J=document.createElement("span");J.className="search-result-headings",J.textContent=V.headings.slice(0,3).join(" · "),W.append(J)}S.append(W)}),$(0,!1)}function h(S){const R=[],N=new Map;return S.forEach((D,I)=>{const $=D.path||"__result-"+I;let B=N.get($);B||(B=Object.assign({},D,{matchCount:0,headings:[]}),N.set($,B),R.push(B)),B.matchCount+=1,D.heading&&!B.headings.includes(D.heading)&&B.headings.push(D.heading),!B.snippet&&D.snippet&&(B.snippet=D.snippet)}),R}function d(){return document.documentElement.dataset.viewerNavigationMode==="beside"?"Links open beside. Hold Shift to replace the current panel.":"Links open in the current panel. Hold Shift to open beside."}function f(S,R,N){const D=String(R||""),I=String(N||"").trim();if(!I){S.textContent=D;return}const $=D.toLocaleLowerCase(),B=I.toLocaleLowerCase();let P=0,G=$.indexOf(B);for(;G>=0;){G>P&&S.append(document.createTextNode(D.slice(P,G)));const V=document.createElement("mark");V.className="search-result-highlight",V.textContent=D.slice(G,G+I.length),S.append(V),P=G+I.length,G=$.indexOf(B,P)}P=12)break}return R.sort(function($,B){return g($.path)!==g(B.path)?g($.path)?1:-1:0})}function g(S){return String(S||"").split("/").pop().toLowerCase()==="index.md"}function m(S,R){R.id||(R.id=(S.id||"viewer-search")+"-results-"+Math.random().toString(36).slice(2)),R.setAttribute("role","listbox"),S.setAttribute("role","combobox"),S.setAttribute("aria-autocomplete","list"),S.setAttribute("aria-controls",R.id),S.setAttribute("aria-expanded","false")}function y(S){return Array.from(S.querySelectorAll(".search-result[href]"))}function v(S,R){const N=y(S);return N.length?N[R>=0?R:0]||N[0]:null}function T(S){return S?S.closest?S.closest(".search-result[href]"):S.parentElement?S.parentElement.closest(".search-result[href]"):null:null}function b(S){return S.button!==0||S.metaKey||S.ctrlKey||S.shiftKey||S.altKey}function w(){var N;const S=(N=window.OpenKnowledgeStaticData)==null?void 0:N.notes;if(Array.isArray(S))return S;const R=document.querySelector("[data-static-notes]");if(!R)return[];try{const D=JSON.parse(R.textContent||"[]");return Array.isArray(D)?D:[]}catch{return[]}}function k(S){const R=C(S);return e.map(function(N){const D=_(N.body||""),I=_(N.frontmatter||""),$=N.title||N.path||"",B=N.path||"",P=[I,D].filter(Boolean).join(" "),G=C([$,B,P].join(" ")),V=C($).includes(R),Y=C(B).includes(R);if(!G.includes(R))return null;const ie=(V?3:0)+(Y?2:0)+1;return{path:B,title:$,snippet:L(P,S),score:g(B)?ie*.55:ie}}).filter(Boolean).sort(function(N,D){return D.score!==N.score?D.score-N.score:g(N.path)!==g(D.path)?g(N.path)?1:-1:N.path.localeCompare(D.path)}).slice(0,12)}function A(S,R){const N=C(S).trim();return e.filter(function(D){return D.path!==R&&Array.isArray(D.tags)&&D.tags.some(function(I){return C(I).trim()===N})}).map(function(D){return{path:D.path,title:D.title||D.path,url:O(D.path),type:"tagged note"}}).sort(function(D,I){return D.path.localeCompare(I.path)})}function C(S){return String(S||"").toLowerCase()}function _(S){const R=document.createElement("div");return R.innerHTML=S,R.textContent||""}function L(S,R){const N=String(S||"").replace(/\s+/g," ").trim();if(!N)return"";const D=N.toLowerCase().indexOf(String(R||"").toLowerCase()),I=Math.max(0,D<0?0:D-48),$=Math.min(N.length,I+140);return(I>0?"...":"")+N.slice(I,$)+($15?u="…"+o.slice(i-15,i):u=o.slice(0,i);var h;a+15t.replace(N8e,"-$1").toLowerCase(),$8e={"&":"&",">":">","<":"<",'"':""","'":"'"},P8e=/[&><"']/g,Ia=t=>String(t).replace(P8e,e=>$8e[e]),dC=t=>t.type==="ordgroup"||t.type==="color"?t.body.length===1?dC(t.body[0]):t:t.type==="font"?dC(t.body):t,B8e=new Set(["mathord","textord","atom"]),Ec=t=>B8e.has(dC(t).type),F8e=t=>{var e=/^[\x00-\x20]*([^\\/#?]*?)(:|�*58|�*3a|&colon)/i.exec(t);return e?e[2]!==":"||!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(e[1])?null:e[1].toLowerCase():"_relative"},fC={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 "},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 ",cliDescription:"A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.",cliProcessor:t=>"#"+t},macros:{type:"object",cli:"-m, --macro ",cliDescription:"Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).",cliDefault:[],cliProcessor:(t,e)=>(e.push(t),e)},minRuleThickness:{type:"number",description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:t=>Math.max(0,t),cli:"--min-rule-thickness ",cliProcessor:parseFloat},colorIsTextColor:{type:"boolean",description:"Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.",cli:"-b, --color-is-text-color"},strict:{type:[{enum:["warn","ignore","error"]},"boolean","function"],description:"Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.",cli:"-S, --strict",cliDefault:!1},trust:{type:["boolean","function"],description:"Trust the input, enabling all HTML features such as \\url.",cli:"-T, --trust"},maxSize:{type:"number",default:1/0,description:"If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large",processor:t=>Math.max(0,t),cli:"-s, --max-size ",cliProcessor:parseInt},maxExpand:{type:"number",default:1e3,description:"Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.",processor:t=>Math.max(0,t),cli:"-e, --max-expand ",cliProcessor:t=>t==="Infinity"?1/0:parseInt(t)},globalGroup:{type:"boolean",cli:!1}};function z8e(t){if(typeof t!="string")return t.enum[0];switch(t){case"boolean":return!1;case"string":return"";case"number":return 0;case"object":return{};default:throw new Error("Unexpected schema type; settings must declare an explicit default.")}}function G8e(t){if(t.default!==void 0)return t.default;var e=Array.isArray(t.type)?t.type[0]:t.type;return z8e(e)}function q8e(t,e,r,n){var i=r[e];t[e]=i!==void 0?n.processor?n.processor(i):i:G8e(n)}class c7{constructor(e){e===void 0&&(e={}),this.displayMode=void 0,this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,this.globalGroup=void 0,e=e||{};for(var r of Object.keys(fC)){var n=fC[r];n&&q8e(this,r,e,n)}}reportNonstrict(e,r,n){var i=this.strict;if(typeof i=="function"&&(i=i(e,r,n)),!(!i||i==="ignore")){if(i===!0||i==="error")throw new Dt("LaTeX-incompatible input and strict mode is set to 'error': "+(r+" ["+e+"]"),n);i==="warn"?typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(r+" ["+e+"]")):typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+i+"': "+r+" ["+e+"]"))}}useStrictBehavior(e,r,n){var i=this.strict;if(typeof i=="function")try{i=i(e,r,n)}catch{i="error"}return!i||i==="ignore"?!1:i===!0||i==="error"?!0:i==="warn"?(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(r+" ["+e+"]")),!1):(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+i+"': "+r+" ["+e+"]")),!1)}isTrusted(e){if("url"in e&&e.url&&!e.protocol){var r=F8e(e.url);if(r==null)return!1;e.protocol=r}var n=typeof this.trust=="function"?this.trust(e):this.trust;return!!n}}class $u{constructor(e,r,n){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=e,this.size=r,this.cramped=n}sup(){return Tl[V8e[this.id]]}sub(){return Tl[W8e[this.id]]}fracNum(){return Tl[U8e[this.id]]}fracDen(){return Tl[H8e[this.id]]}cramp(){return Tl[Y8e[this.id]]}text(){return Tl[X8e[this.id]]}isTight(){return this.size>=2}}var u7=0,pC=1,rp=2,Sc=3,cb=4,oo=5,np=6,Ua=7,Tl=[new $u(u7,0,!1),new $u(pC,0,!0),new $u(rp,1,!1),new $u(Sc,1,!0),new $u(cb,2,!1),new $u(oo,2,!0),new $u(np,3,!1),new $u(Ua,3,!0)],V8e=[cb,oo,cb,oo,np,Ua,np,Ua],W8e=[oo,oo,oo,oo,Ua,Ua,Ua,Ua],U8e=[rp,Sc,cb,oo,np,Ua,np,Ua],H8e=[Sc,Sc,oo,oo,Ua,Ua,Ua,Ua],Y8e=[pC,pC,Sc,Sc,oo,oo,Ua,Ua],X8e=[u7,pC,rp,Sc,rp,Sc,rp,Sc],Ir={DISPLAY:Tl[u7],TEXT:Tl[rp],SCRIPT:Tl[cb],SCRIPTSCRIPT:Tl[np]},h7=[{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 K8e(t){for(var e=0;e=i[0]&&t<=i[1])return r.name}return null}var gC=[];h7.forEach(t=>t.blocks.forEach(e=>gC.push(...e)));function sY(t){for(var e=0;e=gC[e]&&t<=gC[e+1])return!0;return!1}var Pi=t=>t+" "+t,ip=80,j8e=function(e,r){return"M95,"+(622+e+r)+` + */window.mermaid=KNe,(function(){var f;if(window.OpenKnowledgeShortcuts)return;const t=[],e=window.navigator&&(window.navigator.platform||((f=window.navigator.userAgentData)==null?void 0:f.platform))||"",r=/\b(Mac|iPhone|iPad|iPod)\b/.test(e);function n(p){return!p||!p.id||typeof p.run!="function"?function(){}:(i(p.id),t.push(Object.assign({preventDefault:!0,allowEditable:!1},p)),function(){i(p.id)})}function i(p){const g=t.findIndex(function(m){return m.id===p});g>=0&&t.splice(g,1)}function a(p){return!!(p&&p.closest&&p.closest("input, textarea, select, [contenteditable='true']"))}function s(p,g){if(g.defaultPrevented||!p.allowEditable&&a(g.target))return!1;if(p.code){if(g.code!==p.code)return!1}else if(String(g.key||"").toLowerCase()!==String(p.key||"").toLowerCase())return!1;return!o(p,g)||g.altKey!==!!p.altKey||g.shiftKey!==!!p.shiftKey?!1:typeof p.when!="function"||p.when(g)}function o(p,g){return p.primaryKey?r?g.metaKey&&!g.ctrlKey:g.ctrlKey&&!g.metaKey:p.metaOrCtrlKey?g.metaKey||g.ctrlKey:g.metaKey===!!p.metaKey&&g.ctrlKey===!!p.ctrlKey}function l(p){for(let g=t.length-1;g>=0;g--){const m=t[g];if(s(m,p)){m.preventDefault!==!1&&p.preventDefault(),m.run(p);return}}}function u(p){const g=p.key||p.code||"",m=String(g).replace(/^Key/,"").replace(/^Digit/,"");return m===" "?"Space":m.length===1?m.toUpperCase():m}function h(p){if(p.label)return p.label;const g=[];return p.primaryKey||p.metaOrCtrlKey?g.push(r?"⌘":"Ctrl"):(p.metaKey&&g.push(r?"⌘":"Meta"),p.ctrlKey&&g.push("Ctrl")),p.altKey&&g.push(r?"⌥":"Alt"),p.shiftKey&&g.push(r?"⇧":"Shift"),g.push(u(p)),r?g.join(""):g.join("+")}function d(p){if(p.ariaKeyShortcut)return p.ariaKeyShortcut;const g=[];return p.primaryKey||p.metaOrCtrlKey?g.push(r?"Meta":"Control"):(p.metaKey&&g.push("Meta"),p.ctrlKey&&g.push("Control")),p.altKey&&g.push("Alt"),p.shiftKey&&g.push("Shift"),g.push(u(p)),g.join("+")}window.OpenKnowledgeShortcuts={register:n,unregister:i,format:h,ariaKeyShortcut:d,isEditableTarget:a,isMacPlatform:r},document.addEventListener("keydown",l)})();var at=typeof window<"u"?window:void 0,rs=typeof globalThis<"u"?globalThis:at,vs=rs==null?void 0:rs.navigator,Wt=rs==null?void 0:rs.document,Ni=rs==null?void 0:rs.location,lL=rs==null?void 0:rs.fetch,cL=rs!=null&&rs.XMLHttpRequest&&"withCredentials"in new rs.XMLHttpRequest?rs.XMLHttpRequest:void 0,$Z=rs==null?void 0:rs.AbortController,ZNe=rs==null?void 0:rs.CompressionStream,Ks=vs==null?void 0:vs.userAgent;function OZ(){return!(!at||at.navigator.onLine===!1)}var qx=typeof globalThis<"u"?globalThis:at;qx&&typeof self>"u"&&(qx.self=qx),qx&&typeof File>"u"&&(qx.File=function(){});var fr=at??{},vn={DEBUG:!1,LIB_VERSION:"0.3.1",LIB_NAME:"browser-common"};function PZ(t,e,r,n,i,a,s){try{var o=t[a](s),l=o.value}catch(u){return void r(u)}o.done?e(l):Promise.resolve(l).then(n,i)}function jn(t){return function(){var e=this,r=arguments;return new Promise((function(n,i){var a=t.apply(e,r);function s(l){PZ(a,n,i,s,o,"next",l)}function o(l){PZ(a,n,i,s,o,"throw",l)}s(void 0)}))}}function wt(){return wt=Object.assign?Object.assign.bind():function(t){for(var e=1;arguments.length>e;e++){var r=arguments[e];for(var n in r)({}).hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},wt.apply(null,arguments)}function BZ(t,e){if(t==null)return{};var r={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(e.indexOf(n)!==-1)continue;r[n]=t[n]}return r}var FZ=t=>{if(typeof t!="string")return t;try{return JSON.parse(t)}catch{return t}};function zZ(t){return typeof t=="string"||t}function GZ(t){return typeof t=="string"?t:void 0}var Vx,QNe=["$feature_flag","$feature_flag_response","$feature_flag_has_experiment","$feature_flag_id","$feature_flag_version","$feature_flag_reason","$feature_flag_request_id","$feature_flag_evaluated_at","$feature_flag_error","locally_evaluated","$groups","$process_person_profile","$geoip_disable","$current_url","$pathname","$session_id","$window_id","$lib","$lib_version","$device_id","$is_server"],pu=(function(t){return t.AnonymousId="anonymous_id",t.DistinctId="distinct_id",t.Props="props",t.EnablePersonProcessing="enable_person_processing",t.PersonMode="person_mode",t.FeatureFlagDetails="feature_flag_details",t.FeatureFlags="feature_flags",t.FeatureFlagPayloads="feature_flag_payloads",t.BootstrapFeatureFlagDetails="bootstrap_feature_flag_details",t.BootstrapFeatureFlags="bootstrap_feature_flags",t.BootstrapFeatureFlagPayloads="bootstrap_feature_flag_payloads",t.OverrideFeatureFlags="override_feature_flags",t.Queue="queue",t.AiQueue="ai_queue",t.LogsQueue="logs_queue",t.OptedOut="opted_out",t.SessionId="session_id",t.SessionStartTimestamp="session_start_timestamp",t.SessionLastTimestamp="session_timestamp",t.PersonProperties="person_properties",t.GroupProperties="group_properties",t.InstalledAppBuild="installed_app_build",t.InstalledAppVersion="installed_app_version",t.SessionReplay="session_replay",t.SessionReplayEventTriggerActivatedSession="session_replay_event_trigger_activated_session",t.SurveyLastSeenDate="survey_last_seen_date",t.SurveysSeen="surveys_seen",t.Surveys="surveys",t.RemoteConfig="remote_config",t.FlagsEndpointWasHit="flags_endpoint_was_hit",t.DeviceId="device_id",t})({}),qZ=(function(t){return t.GZipJS="gzip-js",t.Base64="base64",t})({}),JNe=["$snapshot","$pageview","$pageleave","$set","survey dismissed","survey sent","survey shown","$identify","$groupidentify","$create_alias","$$client_ingestion_warning","$web_experiment_applied","$feature_enrollment_update","$feature_flag_called"],e$e=["token"],VZ="NativeGzipValidationError",uL=t=>t.length>=2&&t[0]===31&&t[1]===139,WZ=(t,e)=>t===qZ.GZipJS||e===qZ.GZipJS||e==="gzip",UZ=t=>!(!t||typeof t!="object")&&("name"in t?String(t.name):"")==="NotReadableError",bE=t=>{var e=new Error("Native gzip produced invalid output: "+t);throw e.name=VZ,e},t$e=(function(){var t=jn((function*(e,r){18>e.size&&bE("too-short");var n=new Uint8Array(yield e.slice(0,10).arrayBuffer());uL(n)&&n[2]===8||bE("invalid-header");var i=new DataView(yield e.slice(e.size-8).arrayBuffer());i.getUint32(0,!0)!==(s=>{for(var o=(()=>{if(Vx)return Vx;Vx=[];for(var h=0;256>h;h++){for(var d=h,f=0;8>f;f++)d=1&d?3988292384^d>>>1:d>>>1;Vx[h]=d>>>0}return Vx})(),l=4294967295,u=0;s.length>u;u++)l=o[255&(l^s[u])]^l>>>8;return(4294967295^l)>>>0})(r)&&bE("invalid-crc");var a=r.length>>>0;i.getUint32(4,!0)!==a&&bE("invalid-size")}));return function(e,r){return t.apply(this,arguments)}})();function hL(){return hL=jn((function*(t,e,r){e===void 0&&(e=!0);try{var n=new TextEncoder().encode(t),i=new globalThis.CompressionStream("gzip"),a=i.writable.getWriter(),s=a.write(n).then((()=>a.close())).catch((function(){var u=jn((function*(h){try{yield a.abort(h)}catch{}throw h}));return function(h){return u.apply(this,arguments)}})()),o=new Response(i.readable).blob(),l=(yield Promise.all([o,s]))[0];return yield t$e(l,n),l}catch(u){if(r!=null&&r.rethrow)throw u;return e&&console.error("Failed to gzip compress data",u),null}})),hL.apply(this,arguments)}var r$e=["amazonbot","amazonproductbot","app.hypefactors.com","applebot","archive.org_bot","awariobot","backlinksextendedbot","baiduspider","bingbot","bingpreview","chrome-lighthouse","dataforseobot","deepscan","duckduckbot","facebookexternal","facebookcatalog","http://yandex.com/bots","hubspot","ia_archiver","leikibot","linkedinbot","meta-externalagent","mj12bot","msnbot","nessus","petalbot","pinterest","prerender","rogerbot","screaming frog","sebot-wa","sitebulb","slackbot","slurp","trendictionbot","turnitin","twitterbot","vercel-screenshot","vercelbot","yahoo! slurp","yandexbot","zoombot","bot.htm","bot.php","(bot;","bot/","crawler","ahrefsbot","ahrefssiteaudit","semrushbot","siteauditbot","splitsignalbot","gptbot","oai-searchbot","chatgpt-user","perplexitybot","better uptime bot","sentryuptimebot","uptimerobot","headlesschrome","cypress","google-hoteladsverifier","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleother","google-cloudvertexbot","googleweblight","mediapartners-google","storebot-google","google-inspectiontool","bytespider"],HZ=function(t,e){if(e===void 0&&(e=[]),!t)return!1;var r=t.toLowerCase();return r$e.concat(e).some((n=>{var i=n.toLowerCase();return r.indexOf(i)!==-1}))};function Rr(t,e){return t.indexOf(e)!==-1}var xE=function(t){return t.trim()},dL=function(t){return t.replace(/^\$/,"")};function YZ(t){var e,r=[];return(e=JSON.stringify(t,(function(n,i){if(typeof i=="bigint")return i.toString();if(typeof i!="function"&&typeof i!="symbol"){if(i instanceof Error)return{name:i.name,message:i.message,stack:i.stack};if(i&&typeof i=="object"){for(;r.length>0&&r[r.length-1]!==this;)r.pop();if(r.includes(i))return"[Circular]";r.push(i)}return i}})))!==null&&e!==void 0?e:"null"}var XZ=Object.prototype,jZ=XZ.hasOwnProperty,TE=XZ.toString,Br=Array.isArray||function(t){return TE.call(t)==="[object Array]"},bo=t=>typeof t=="function",Kn=t=>t===Object(t)&&!Br(t),$h=t=>{if(Kn(t)){for(var e in t)if(jZ.call(t,e))return!1;return!0}return!1},Nt=t=>t===void 0,Rn=t=>TE.call(t)=="[object String]",fL=t=>Rn(t)&&t.trim().length===0,bs=t=>t===null,zr=t=>Nt(t)||bs(t),Na=t=>TE.call(t)=="[object Number]"&&t==t,gu=t=>Na(t)&&t>0,Tl=t=>TE.call(t)==="[object Boolean]",n$e=t=>t instanceof FormData,i$e=t=>Rr(JNe,t),a$e=t=>Rr(e$e,t);function KZ(t){return t===null||typeof t!="object"}function wE(t,e){return{}.toString.call(t)==="[object "+e+"]"}function pL(t){return typeof Event<"u"&&(function(e,r){try{return e instanceof r}catch{return!1}})(t,Event)}var s$e=[!0,"true",1,"1","yes"],gL=t=>Rr(s$e,t),o$e=[!1,"false",0,"0","no"];function oc(t,e,r,n,i){return e>r&&(n.warn("min cannot be greater than max."),e=r),Na(t)?t>r?(n.warn(" cannot be greater than max: "+r+". Using max value instead."),r):e>t?(n.warn(" cannot be less than min: "+e+". Using min value instead."),e):t:(n.warn(" must be a number. using max or fallback. max: "+r+", fallback: "+i),oc(i||r,e,r,n))}class l$e{constructor(e){this.tt={},this.et=e.et,this.rt=oc(e.bucketSize,0,100,e.it),this.nt=oc(e.refillRate,0,this.rt,e.it),this.st=oc(e.refillInterval,0,864e5,e.it)}ot(e,r){var n=Math.floor((r-e.lastAccess)/this.st);n>0&&(e.tokens=Math.min(e.tokens+n*this.nt,this.rt),e.lastAccess=e.lastAccess+n*this.st)}consumeRateLimit(e){var r,n=Date.now(),i=String(e),a=this.tt[i];return a?this.ot(a,n):this.tt[i]=a={tokens:this.rt,lastAccess:n},a.tokens===0||(a.tokens--,a.tokens===0&&((r=this.et)==null||r.call(this,e)),a.tokens===0)}stop(){this.tt={}}}var xo="Mobile",CE="iOS",mu="Android",vg="Tablet",ZZ=mu+" "+vg,QZ="iPad",JZ="Apple",eQ=JZ+" Watch",Wx="Safari",bg="BlackBerry",tQ="Samsung",rQ=tQ+"Browser",nQ=tQ+" Internet",vf="Chrome",c$e=vf+" OS",iQ=vf+" "+CE,mL="Internet Explorer",aQ=mL+" "+xo,yL="Opera",u$e=yL+" Mini",vL="Edge",sQ="Microsoft "+vL,xg="Firefox",oQ=xg+" "+CE,Ux="Nintendo",Hx="PlayStation",Tg="Xbox",lQ=mu+" "+xo,cQ=xo+" "+Wx,Yx="Windows",bL=Yx+" Phone",uQ="Nokia",xL="Ouya",hQ="Generic",h$e=hQ+" "+xo.toLowerCase(),dQ=hQ+" "+vg.toLowerCase(),TL="Konqueror",fQ="Oculus Browser",kE="Vivaldi",pQ="Yandex",EE="Whale",wL="DuckDuckGo",gQ="Pale Moon",SE="Waterfox",Xx="Brave",mQ="Google Search App",ci="(\\d+(\\.\\d+)?)",CL=new RegExp("Version/"+ci),d$e=new RegExp(Tg,"i"),f$e=new RegExp(Hx+" \\w+","i"),p$e=new RegExp(Ux+" \\w+","i"),kL=new RegExp(bg+"|PlayBook|BB10","i"),g$e={"NT3.51":"NT 3.11","NT4.0":"NT 4.0","5.0":"2000",5.1:"XP",5.2:"XP","6.0":"Vista",6.1:"7",6.2:"8",6.3:"8.1",6.4:"10","10.0":"10"},yQ=function(t,e,r,n){e=e||"";var i=(function(a){return a!=null&&a.brave?Xx:null})(r);return i||(n!=null&&n.detectGoogleSearchApp&&Rr(t,"GSA/")?mQ:Rr(t," OPR/")&&Rr(t,"Mini")?u$e:Rr(t," OPR/")?yL:kL.test(t)?bg:Rr(t,"IE"+xo)||Rr(t,"WPDesktop")?aQ:Rr(t,"OculusBrowser")?fQ:Rr(t,rQ)?nQ:Rr(t,vL)||Rr(t,"Edg/")?sQ:Rr(t,kE+"/")?kE:Rr(t,"YaBrowser/")?pQ:Rr(t,EE+"/")?EE:Rr(t,wL+"/")||Rr(t,"Ddg/")?wL:Rr(t,"FBIOS")?"Facebook "+xo:Rr(t,"UCWEB")||Rr(t,"UCBrowser")?"UC Browser":Rr(t,"CriOS")?iQ:Rr(t,"CrMo")||Rr(t,vf)?vf:Rr(t,mu)&&Rr(t,Wx)?lQ:Rr(t,"FxiOS")?oQ:Rr(t.toLowerCase(),TL.toLowerCase())?TL:Rr(t,Xx+"/")?Xx:((a,s)=>s&&Rr(s,JZ)||(function(o){return Rr(o,Wx)&&!Rr(o,vf)&&!Rr(o,mu)})(a))(t,e)?Rr(t,xo)?cQ:Wx:Rr(t,"PaleMoon/")?gQ:Rr(t,SE+"/")?SE:Rr(t,xg)?xg:Rr(t,"MSIE")||Rr(t,"Trident/")?mL:Rr(t,"Gecko")?xg:"")},m$e={[aQ]:[new RegExp("rv:"+ci)],[sQ]:[new RegExp(vL+"?\\/"+ci)],[vf]:[new RegExp("("+vf+"|CrMo)\\/"+ci)],[iQ]:[new RegExp("CriOS\\/"+ci)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+ci)],[Wx]:[CL],[cQ]:[CL],[yL]:[new RegExp("(Opera|OPR)\\/"+ci)],[xg]:[new RegExp(xg+"\\/"+ci)],[oQ]:[new RegExp("FxiOS\\/"+ci)],[TL]:[new RegExp("Konqueror[:/]?"+ci,"i")],[bg]:[new RegExp(bg+" "+ci),CL],[lQ]:[new RegExp("android\\s"+ci,"i")],[nQ]:[new RegExp(rQ+"\\/"+ci)],[fQ]:[new RegExp("OculusBrowser\\/"+ci)],[kE]:[new RegExp(kE+"\\/"+ci)],[pQ]:[new RegExp("YaBrowser\\/"+ci)],[EE]:[new RegExp(EE+"\\/"+ci)],[Xx]:[new RegExp(Xx+"\\/"+ci)],[wL]:[new RegExp("(DuckDuckGo|Ddg)\\/"+ci)],[gQ]:[new RegExp("PaleMoon\\/"+ci)],[SE]:[new RegExp(SE+"\\/"+ci)],[mQ]:[new RegExp("GSA\\/"+ci)],[mL]:[new RegExp("(rv:|MSIE )"+ci)],Mozilla:[new RegExp("rv:"+ci)]},y$e=function(t,e,r,n){var i=yQ(t,e,r,n),a=m$e[i];if(Nt(a))return null;for(var s=0;a.length>s;s++){var o=t.match(a[s]);if(o)return parseFloat(o[o.length-2])}return null},vQ=[[new RegExp(Tg+"; "+Tg+" (.*?)[);]","i"),t=>[Tg,t&&t[1]||""]],[new RegExp(Ux,"i"),[Ux,""]],[new RegExp(Hx,"i"),[Hx,""]],[kL,[bg,""]],[new RegExp(Yx,"i"),(t,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[bL,""];if(new RegExp(xo).test(e)&&!/IEMobile\b/.test(e))return[Yx+" "+xo,""];var r=/Windows NT ([0-9.]+)/i.exec(e);if(r&&r[1]){var n=g$e[r[1]]||"";return/arm/i.test(e)&&(n="RT"),[Yx,n]}return[Yx,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,t=>t&&t[3]?[CE,[t[3],t[4],t[5]||"0"].join(".")]:[CE,""]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,t=>{var e="";return t&&t.length>=3&&(e=Nt(t[2])?t[3]:t[2]),["watchOS",e]}],[new RegExp("("+mu+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+mu+")","i"),t=>t&&t[2]?[mu,[t[2],t[3],t[4]||"0"].join(".")]:[mu,""]],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,t=>{var e=["Mac OS X",""];return t&&t[1]&&(e[1]=[t[1],t[2],t[3]||"0"].join(".")),e}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[c$e,""]],[/Linux|debian/i,["Linux",""]]],bQ=function(t){return p$e.test(t)?Ux:f$e.test(t)?Hx:d$e.test(t)?Tg:new RegExp(xL,"i").test(t)?xL:new RegExp("("+bL+"|WPDesktop)","i").test(t)?bL:/iPad/.test(t)?QZ:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?eQ:kL.test(t)?bg:/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(uQ,"i").test(t)?uQ:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(t)||/(kf[a-z]+)( bui|\)).+silk\//i.test(t)?"Kindle Fire":/(Android|ZTE)/i.test(t)?new RegExp(xo).test(t)&&!/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(t)||/pixel[\daxl ]{1,6}/i.test(t)&&!/pixel c/i.test(t)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(t)||/lmy47v/i.test(t)&&!/QTAQZ3/i.test(t)?mu:ZZ:new RegExp("(pda|"+xo+")","i").test(t)?h$e:new RegExp(vg,"i").test(t)&&!new RegExp(vg+" pc","i").test(t)?dQ:""},v$e=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function xQ(t,e){return typeof(r=t)=="string"&&v$e.test(r)?t:e();var r}function Oh(t){return t&&t.split("#")[0]}function _E(t,e){var r=setTimeout(t,e);return r!=null&&r.unref&&(r==null||r.unref()),r}var b$e=t=>t instanceof Error,TQ={trace:{text:"TRACE",number:1},debug:{text:"DEBUG",number:5},info:{text:"INFO",number:9},warn:{text:"WARN",number:13},error:{text:"ERROR",number:17},fatal:{text:"FATAL",number:21}},x$e=TQ.info;function wQ(t){if(Tl(t))return{boolValue:t};if(typeof t=="number")return Number.isFinite(t)?Number.isInteger(t)?{intValue:t}:{doubleValue:t}:{stringValue:String(t)};if(typeof t=="string")return{stringValue:t};if(Br(t))return{arrayValue:{values:t.map((e=>wQ(e)))}};try{return{stringValue:JSON.stringify(t)}}catch{return{stringValue:String(t)}}}function AE(t){var e=[];for(var r in t){var n=t[r];bs(n)||Nt(n)||e.push({key:r,value:wQ(n)})}return e}function T$e(t,e){var r=TQ[t.level||"info"]||x$e,n=r.text,i=r.number,a=String(Date.now())+"000000",s={};e.distinctId&&(s.posthogDistinctId=e.distinctId),e.sessionId&&(s.sessionId=e.sessionId),e.windowId&&(s["window.id"]=e.windowId),zr(e.sessionStartTimestamp)||(s.sessionStartTimestamp=String(e.sessionStartTimestamp)),zr(e.lastActivityTimestamp)||(s.lastActivityTimestamp=String(e.lastActivityTimestamp)),e.currentUrl&&(s["url.full"]=e.currentUrl),e.screenName&&(s["screen.name"]=e.screenName),e.appState&&(s["app.state"]=e.appState),e.activeFeatureFlags&&e.activeFeatureFlags.length>0&&(s.feature_flags=e.activeFeatureFlags);var o=wt({},s,t.attributes||{}),l={timeUnixNano:a,observedTimeUnixNano:a,severityNumber:i,severityText:n,body:{stringValue:t.body},attributes:AE(o)};return t.trace_id&&(l.traceId=t.trace_id),t.span_id&&(l.spanId=t.span_id),Nt(t.trace_flags)||(l.flags=t.trace_flags),l}function CQ(t,e,r){return wt({},t.resourceAttributes,{"service.name":t.serviceName||"unknown_service"},t.environment&&{"deployment.environment":t.environment},t.serviceVersion&&{"service.version":t.serviceVersion},{"telemetry.sdk.name":e,"telemetry.sdk.version":r})}function kQ(t,e,r,n){return{resourceLogs:[{resource:{attributes:AE(e)},scopeLogs:[{scope:{name:r,version:n},logRecords:t}]}]}}let w$e=class{constructor(t,e,r,n,i,a,s){var o;a===void 0&&(a=()=>Promise.resolve()),this._instance=t,this.Te=e,this.it=r,this.ut=n,this.ht=i,this.dt=a,this.ct=s,this.vt=null,this.ft=0,this.yt=0,this.bt=0,this._t=0,this.wt=!1,this.xt=e.maxBufferSize,this.kt=Math.max((o=e.maxQueueSize)!==null&&o!==void 0?o:e.maxBufferSize,e.maxBufferSize),this.St=e.flushIntervalMs,this.Ct=e.maxBatchRecordsPerPost,this.Mt=e.rateCapWindowMs,this.It=e.maxLogsPerInterval}reset(){this.Tt(),this.vt=null,this.bt=0,this._t=0,this.wt=!1,this.ft=0,this.yt=0,this.Ct=this.Te.maxBatchRecordsPerPost}onReconnect(){this.yt=0,this.Et()}captureLog(t){if(!this._instance.isDisabled&&!this._instance.optedOut&&t!=null&&t.body){var e=this.Rt(t);if(e!==null)if(e.body){if(this.Pt()){var r={record:T$e(e,this.ut())};this.ht((()=>this.Ot(r)))}}else this.it.info("Log was rejected in beforeSend function")}}Rt(t){var e=this.Te.beforeSend;if(!e)return t;var r=Br(e)?e:[e],n=t;for(var i of r)try{var a=i(n);if(!a)return this.it.info("Log was rejected in beforeSend function"),null;n=a}catch(s){return this.it.error("Error in beforeSend function for log:",s),null}return n}Pt(){if(this.It===void 0)return!0;var t=Date.now(),e=t-this.bt;return this.Mt>e&&e>=0||(this.bt=t,this._t=0,this.wt=!1),this.It>this._t?(this._t++,!0):(this.wt||(this.it.warn("captureLog dropping logs: exceeded "+this.It+" logs per "+this.Mt+"ms"),this.wt=!0),!1)}flush(){var t=this;return jn((function*(){if(!t._instance.isDisabled)return t.vt||(t.vt=t.Ft().finally((()=>{t.vt=null}))),t.vt}))()}Ft(){var t=this;return jn((function*(){var e;t.Tt();var r=(e=t._instance.getPersistedProperty(pu.LogsQueue))!==null&&e!==void 0?e:[];if(r.length!==0)for(var n=r.length,i=0;r.length>0&&n>i;){var a,s;t.ft=0;var o=Math.min(r.length,t.Ct),l=r.slice(0,o),u=kQ(l.map((d=>d.record)),t.At(),(a=t.ct)!==null&&a!==void 0?a:t._instance.getLibraryId(),t._instance.getLibraryVersion()),h=yield t._instance.$t(u);if(h.kind==="too-large"&&l.length>1)t.Ct=Math.max(1,Math.floor(l.length/2)),t.it.warn("Received 413 when sending logs batch of size "+l.length+", reducing batch size to "+t.Ct);else if(h.kind==="retry-later"||(h.kind==="too-large"?t.it.warn("Dropping a single log record after 413 with batch size 1 — the record is larger than the server cap and cannot be split further."):h.kind==="ok"&&t.Te.maxBatchRecordsPerPost>t.Ct&&(t.Ct=Math.min(t.Te.maxBatchRecordsPerPost,t.Ct+1)),yield t.Lt(l.length),r=(s=t._instance.getPersistedProperty(pu.LogsQueue))!==null&&s!==void 0?s:[],i+=l.length,h.kind==="fatal"))throw h.error}}))()}Lt(t){var e=this;return jn((function*(){var r,n=Math.max(0,t-e.ft),i=(r=e._instance.getPersistedProperty(pu.LogsQueue))!==null&&r!==void 0?r:[];e._instance.setPersistedProperty(pu.LogsQueue,i.slice(n)),yield e.dt()}))()}At(){return CQ(this.Te,this._instance.getLibraryId(),this._instance.getLibraryVersion())}Ot(t){var e;if(!this._instance.optedOut){var r=(e=this._instance.getPersistedProperty(pu.LogsQueue))!==null&&e!==void 0?e:[];this.kt>r.length||(r.shift(),this.ft++,this.it.info("Logs queue is full, dropping oldest record.")),r.push(t),this._instance.setPersistedProperty(pu.LogsQueue,r),this.xt>r.length?this.Dt():this.Et()}}Dt(t){t===void 0&&(t=this.St),this.Nt||(this.Nt=_E((()=>{this.Nt=void 0,this.Et()}),t))}qt(){var t=Math.min(Math.max(0,this.yt-1),6);return this.St*Math.pow(2,t)}jt(){var t=this._instance.getPersistedProperty(pu.LogsQueue);return!!t&&t.length>0}shutdown(t){var e=this;return jn((function*(){e.Tt();var r=e.flush().catch((()=>{}));t!==void 0?yield Promise.race([r,new Promise((n=>_E(n,t)))]):yield r}))()}flushWithTimeout(t){var e=this;return jn((function*(){var r=!1,n=e.flush(),i=new Promise((a=>_E((()=>{r=!0,a()}),t)));try{yield Promise.race([n,i])}finally{r&&n.catch((()=>{}))}}))()}Et(){this.flush().then((()=>{this.yt=0}),(t=>{this.yt++,this.it.error("PostHog logs flush failed:",t)})).finally((()=>{!this._instance.isDisabled&&this.jt()&&this.Dt(this.qt())}))}Tt(){this.Nt&&(clearTimeout(this.Nt),this.Nt=void 0)}};var EL=[0,5,10,25,50,75,100,250,500,750,1e3,2500,5e3,7500,1e4];function EQ(t){return String(t)+"000000"}function SQ(t,e,r,n){var i="";return n&&(i=Object.keys(n).sort().map((a=>JSON.stringify(a)+":"+JSON.stringify(n[a]))).join(",")),t+"\0"+e+"\0"+(r??"")+"\0"+i}let C$e=class{constructor(t,e,r){this._instance=t,this.Te=e,this.it=r,this.Bt=new Map,this.vt=null,this.Ht=!1,this.Ut=new Map,this.zt=new Set,this.Vt=0}count(t,e,r){e===void 0&&(e=1),this.Wt({name:t,type:"count",value:e,unit:r==null?void 0:r.unit,attributes:r==null?void 0:r.attributes})}gauge(t,e,r){this.Wt({name:t,type:"gauge",value:e,unit:r==null?void 0:r.unit,attributes:r==null?void 0:r.attributes})}histogram(t,e,r){this.Wt({name:t,type:"histogram",value:e,unit:r==null?void 0:r.unit,attributes:r==null?void 0:r.attributes})}flush(){var t=this,e=this.vt,r=(function(){var i=jn((function*(){e&&(yield e.catch((()=>{}))),yield t.Zt()}));return function(){return i.apply(this,arguments)}})(),n=r().finally((()=>{this.vt===n&&(this.vt=null)}));return this.vt=n,n}drainWindow(){if(this.Bt.size===0)return null;var t=this.Bt;return this.Bt=new Map,this.Ht=!1,this.Ut=new Map,this.zt=new Set,this.Gt(t)}reset(){this.Vt++,this.Tt(),this.Bt=new Map,this.vt=null,this.Ht=!1,this.Ut=new Map,this.zt=new Set}Wt(t){if(!this._instance.isDisabled&&!this._instance.optedOut){var e=this.Rt(t);if(e!==null)if(e.name&&typeof e.name=="string")if(typeof e.value=="number"&&Number.isFinite(e.value))if(e.type==="count"&&0>e.value)this.it.warn("Dropping count '"+e.name+"': counters are monotonic, value must be >= 0");else{var r,n;try{r=e.attributes?wt({},e.attributes):void 0,n=SQ(e.type,e.name,e.unit,r)}catch(s){return void this.it.warn("Dropping metric '"+e.name+"': attributes could not be serialized",s)}var i=this.Bt.get(n);if(!i){if(!this.Qt())return;i={name:e.name,type:e.type,unit:e.unit,attributes:r,windowStartMs:Date.now()},this.Bt.set(n,i)}var a=this.Ut.get(e.name);a===void 0?this.Ut.set(e.name,e.type):a===e.type||this.zt.has(e.name)||(this.zt.add(e.name),this.it.warn("Metric name '"+e.name+"' is already used as a "+a+"; recording it as a "+e.type+" too will blend both series in charts. Use a distinct name.")),this.Jt(i,e.value),this.Dt()}else this.it.warn("Dropping metric '"+e.name+"': value must be a finite number");else this.it.warn("Dropping metric with empty name")}}Qt(){return this.Te.maxSeriesPerFlush>this.Bt.size||(this.Ht||(this.Ht=!0,this.it.warn("Metric series cap reached ("+this.Te.maxSeriesPerFlush+" per flush window); dropping new series until the next flush. Reduce attribute cardinality.")),!1)}Jt(t,e){var r;switch(t.type){case"count":t.total=((r=t.total)!==null&&r!==void 0?r:0)+e;break;case"gauge":t.last=e;break;case"histogram":t.hist||(t.hist={count:0,sum:0,min:e,max:e,bucketCounts:new Array(EL.length+1).fill(0)});var n=t.hist;n.count+=1,n.sum+=e,n.min=Math.min(n.min,e),n.max=Math.max(n.max,e),n.bucketCounts[(function(i,a){for(var s=0;a.length>s;s++)if(a[s]>=i)return s;return a.length})(e,EL)]+=1}}Rt(t){var e=this.Te.beforeSend;if(!e)return t;var r=Br(e)?e:[e],n=t;for(var i of r)try{var a=i(n);if(!a)return this.it.info("Metric was rejected in beforeSend function"),null;n=a}catch(s){return this.it.error("Error in beforeSend function for metric:",s),null}return n}Dt(){this.Nt||(this.Nt=_E((()=>{this.Nt=void 0,this.flush().catch((t=>{this.it.error("Metrics flush failed:",t)}))}),this.Te.flushIntervalMs))}Tt(){this.Nt&&(clearTimeout(this.Nt),this.Nt=void 0)}Zt(){var t=this;return jn((function*(){if(t.Bt.size!==0){var e=t.Bt;t.Bt=new Map,t.Ht=!1,t.Ut=new Map,t.zt=new Set;var r=t.Vt,n=yield t._instance.Kt(t.Gt(e));if(r===t.Vt)switch(n.kind){case"ok":return;case"retry-later":return t.Yt(e),void t.Dt();case"too-large":return void t.it.warn("Metrics batch exceeded the server size limit and was dropped");case"fatal":return void t.it.error("Failed to send metrics batch:",n.error)}}}))()}Gt(t){return e=this.Xt(t),r=(function(a,s,o){return wt({},a.resourceAttributes,{"service.name":a.serviceName||"unknown_service"},a.environment&&{"deployment.environment":a.environment},a.serviceVersion&&{"service.version":a.serviceVersion},{"telemetry.sdk.name":s,"telemetry.sdk.version":o})})(this.Te,this._instance.getLibraryId(),this._instance.getLibraryVersion()),n=this._instance.getLibraryId(),i=this._instance.getLibraryVersion(),{resourceMetrics:[{resource:{attributes:AE(r)},scopeMetrics:[{scope:{name:n,version:i},metrics:e}]}]};var e,r,n,i}Xt(t){var e=EQ(Date.now()),r=new Map;for(var n of t.values()){var i,a=SQ(n.type,n.name,n.unit,void 0),s=r.get(a);s||(s=wt({name:n.name},n.unit&&{unit:n.unit}),n.type==="count"?s.sum={aggregationTemporality:1,isMonotonic:!0,dataPoints:[]}:n.type==="gauge"?s.gauge={dataPoints:[]}:s.histogram={aggregationTemporality:1,dataPoints:[]},r.set(a,s));var o=AE((i=n.attributes)!==null&&i!==void 0?i:{}),l=EQ(n.windowStartMs);if(n.type==="count"){var u,h={attributes:o,startTimeUnixNano:l,timeUnixNano:e,asDouble:(u=n.total)!==null&&u!==void 0?u:0};s.sum.dataPoints.push(h)}else if(n.type==="gauge"){var d,f={attributes:o,timeUnixNano:e,asDouble:(d=n.last)!==null&&d!==void 0?d:0};s.gauge.dataPoints.push(f)}else n.hist&&s.histogram.dataPoints.push({attributes:o,startTimeUnixNano:l,timeUnixNano:e,count:n.hist.count,sum:n.hist.sum,min:n.hist.min,max:n.hist.max,bucketCounts:n.hist.bucketCounts,explicitBounds:EL})}return Array.from(r.values())}Yt(t){var e,r;for(var n of t){var i=n[0],a=n[1],s=this.Bt.get(i);if(s)switch(s.windowStartMs=Math.min(s.windowStartMs,a.windowStartMs),s.type){case"count":s.total=((e=s.total)!==null&&e!==void 0?e:0)+((r=a.total)!==null&&r!==void 0?r:0);break;case"gauge":break;case"histogram":if(a.hist)if(s.hist){s.hist.count+=a.hist.count,s.hist.sum+=a.hist.sum,s.hist.min=Math.min(s.hist.min,a.hist.min),s.hist.max=Math.max(s.hist.max,a.hist.max);for(var o=0;s.hist.bucketCounts.length>o;o++)s.hist.bucketCounts[o]+=a.hist.bucketCounts[o]}else s.hist=a.hist}else this.Qt()&&this.Bt.set(i,a)}}};var RE,_Q,SL;function k$e(t){var e=globalThis._posthogChunkIds;if(e){var r=Object.keys(e);return SL&&r.length===_Q||(_Q=r.length,SL=r.reduce(((n,i)=>{RE||(RE={});var a=RE[i];if(a)n[a[0]]=a[1];else for(var s=t(i),o=s.length-1;o>=0;o--){var l=s[o],u=l==null?void 0:l.filename,h=e[i];if(u&&h){n[u]=h,RE[i]=[u,h];break}}return n}),{})),SL}}class E$e{constructor(e,r,n){n===void 0&&(n=[]),this.coercers=e,this.stackParser=r,this.modifiers=n}buildFromUnknown(e,r){r===void 0&&(r={});var n=r&&r.mechanism||{handled:!0,type:"generic"},i=this.buildCoercingContext(n,r,0).apply(e),a=this.buildParsingContext(r),s=this.parseStacktrace(i,a);return{$exception_list:this.convertToExceptionList(s,n),$exception_level:"error"}}modifyFrames(e){var r=this;return jn((function*(){for(var n of e)n.stacktrace&&n.stacktrace.frames&&Br(n.stacktrace.frames)&&(n.stacktrace.frames=yield r.applyModifiers(n.stacktrace.frames));return e}))()}coerceFallback(e){var r;return{type:"Error",value:"Unknown error",stack:(r=e.syntheticException)==null?void 0:r.stack,synthetic:!0}}parseStacktrace(e,r){var n,i;return e.cause!=null&&(n=this.parseStacktrace(e.cause,r)),e.stack!=""&&e.stack!=null&&(i=this.applyChunkIds(this.stackParser(e.stack,e.synthetic?r.skipFirstLines:0),r.chunkIdMap)),wt({},e,{cause:n,stack:i})}applyChunkIds(e,r){return e.map((n=>(n.filename&&r&&(n.chunk_id=r[n.filename]),n)))}applyCoercers(e,r){for(var n of this.coercers)if(n.match(e))return n.coerce(e,r);return this.coerceFallback(r)}applyModifiers(e){var r=this;return jn((function*(){var n=e;for(var i of r.modifiers)n=yield i(n);return n}))()}convertToExceptionList(e,r){var n,i,a,s={type:e.type,value:e.value,mechanism:{type:(n=r.type)!==null&&n!==void 0?n:"generic",handled:(i=r.handled)===null||i===void 0||i,synthetic:(a=e.synthetic)!==null&&a!==void 0&&a}};e.stack&&(s.stacktrace={type:"raw",frames:e.stack});var o=[s];return e.cause!=null&&o.push(...this.convertToExceptionList(e.cause,wt({},r,{handled:!0}))),o}buildParsingContext(e){var r;return{chunkIdMap:k$e(this.stackParser),skipFirstLines:(r=e.skipFirstLines)!==null&&r!==void 0?r:1}}buildCoercingContext(e,r,n){n===void 0&&(n=0);var i=(a,s)=>{if(4>=s){var o=this.buildCoercingContext(e,r,s);return this.applyCoercers(a,o)}};return wt({},r,{syntheticException:n==0?r.syntheticException:void 0,mechanism:e,apply:a=>i(a,n),next:a=>i(a,n+1)})}}var wg="?";function _L(t,e,r,n,i){var a={platform:t,filename:e,function:r===""?wg:r,in_app:!0};return Nt(n)||(a.lineno=n),Nt(i)||(a.colno=i),a}var AQ=(t,e)=>{var r=t.indexOf("safari-extension")!==-1,n=t.indexOf("safari-web-extension")!==-1;return r||n?[t.indexOf("@")!==-1?t.split("@")[0]:wg,r?"safari-extension:"+e:"safari-web-extension:"+e]:[t,e]},S$e=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,_$e=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,A$e=/\((\S*)(?::(\d+))(?::(\d+))\)/,R$e=(t,e)=>{var r=S$e.exec(t);if(r)return _L(e,r[1],wg,+r[2],+r[3]);var n=_$e.exec(t);if(n){if(n[2]&&n[2].indexOf("eval")===0){var i=A$e.exec(n[2]);i&&(n[2]=i[1],n[3]=i[2],n[4]=i[3])}var a=AQ(n[1]||wg,n[2]);return _L(e,a[1],a[0],n[3]?+n[3]:void 0,n[4]?+n[4]:void 0)}},L$e=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,I$e=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,D$e=(t,e)=>{var r=L$e.exec(t);if(r){if(r[3]&&r[3].indexOf(" > eval")>-1){var n=I$e.exec(r[3]);n&&(r[1]=r[1]||"eval",r[3]=n[1],r[4]=n[2],r[5]="")}var i=r[3],a=r[1]||wg,s=AQ(a,i);return _L(e,i=s[1],a=s[0],r[4]?+r[4]:void 0,r[5]?+r[5]:void 0)}},RQ=/\(error: (.*)\)/;class M$e{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,r){var n=Rn(e.stack);return{type:this.getType(e),value:this.getValue(e),stack:n?e.stack:void 0,cause:e.cause?r.next(e.cause):void 0,synthetic:!1}}getType(e){return this.isDOMError(e)?"DOMError":"DOMException"}getValue(e){var r=e.name||(this.isDOMError(e)?"DOMError":"DOMException");return e.message?r+": "+e.message:r}isDOMException(e){return wE(e,"DOMException")}isDOMError(e){return wE(e,"DOMError")}}class N$e{match(e){return(r=>r instanceof Error)(e)}coerce(e,r){return{type:this.getType(e),value:this.getMessage(e,r),stack:this.getStack(e),cause:e.cause?r.next(e.cause):void 0,synthetic:!1}}getType(e){return e.name||e.constructor.name}getMessage(e,r){var n=e.message;return String(n.error&&typeof n.error.message=="string"?n.error.message:n)}getStack(e){return e.stacktrace||e.stack||void 0}}class $$e{constructor(){}match(e){return wE(e,"ErrorEvent")&&e.error!=null}coerce(e,r){var n;return r.apply(e.error)||{type:"ErrorEvent",value:e.message,stack:(n=r.syntheticException)==null?void 0:n.stack,synthetic:!0}}}var O$e=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class P$e{match(e){return typeof e=="string"}coerce(e,r){var n,i=this.getInfos(e),a=i[0],s=i[1];return{type:a??"Error",value:s??e,stack:(n=r.syntheticException)==null?void 0:n.stack,synthetic:!0}}getInfos(e){var r="Error",n=e,i=e.match(O$e);return i&&(r=i[1],n=i[2]),[r,n]}}var B$e=["fatal","error","warning","log","info","debug"];function LQ(t,e){e===void 0&&(e=40);var r=Object.keys(t);if(r.sort(),!r.length)return"[object has no keys]";for(var n=r.length;n>0;n--){var i=r.slice(0,n).join(", ");if(e>=i.length)return n===r.length?i:i.length>e?i.slice(0,e)+"...":i}return""}class F$e{match(e){return typeof e=="object"&&e!==null}coerce(e,r){var n,i=this.getErrorPropertyFromObject(e);return i?r.apply(i):{type:this.getType(e),value:this.getValue(e),stack:(n=r.syntheticException)==null?void 0:n.stack,level:this.isSeverityLevel(e.level)?e.level:"error",synthetic:!0}}getType(e){return pL(e)?e.constructor.name:"Error"}getValue(e){if("name"in e&&typeof e.name=="string"){var r="'"+e.name+"' captured as exception";return"message"in e&&typeof e.message=="string"&&(r+=" with message: '"+e.message+"'"),r}if("message"in e&&typeof e.message=="string")return e.message;var n=this.getObjectClassName(e);return(n&&n!=="Object"?"'"+n+"'":"Object")+" captured as exception with keys: "+LQ(e)}isSeverityLevel(e){return Rn(e)&&!fL(e)&&B$e.indexOf(e)>=0}getErrorPropertyFromObject(e){for(var r in e)if({}.hasOwnProperty.call(e,r)){var n=e[r];if(b$e(n))return n}}getObjectClassName(e){try{var r=Object.getPrototypeOf(e);return r?r.constructor.name:void 0}catch{return}}}class z$e{match(e){return pL(e)}coerce(e,r){var n,i=e.constructor.name;return{type:i,value:i+" captured as exception with keys: "+LQ(e),stack:(n=r.syntheticException)==null?void 0:n.stack,synthetic:!0}}}class G$e{match(e){return KZ(e)}coerce(e,r){var n;return{type:"Error",value:"Primitive value captured as exception: "+String(e),stack:(n=r.syntheticException)==null?void 0:n.stack,synthetic:!0}}}class q$e{match(e){return wE(e,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(e)}isCustomEventWrappingRejection(e){if(!pL(e))return!1;try{var r=e.detail;return r!=null&&typeof r=="object"&&"reason"in r}catch{return!1}}coerce(e,r){var n,i=this.getUnhandledRejectionReason(e);return KZ(i)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(i),stack:(n=r.syntheticException)==null?void 0:n.stack,synthetic:!0}:r.apply(i)}getUnhandledRejectionReason(e){try{if("reason"in e)return e.reason;if("detail"in e&&e.detail!=null&&typeof e.detail=="object"&&"reason"in e.detail)return e.detail.reason}catch{}return e}}var LE="$message",IE="$timestamp",V$e=new Set([LE,IE]),AL={enabled:!0,max_bytes:32768};function DE(t){var e;return t?{enabled:(e=t.enabled)!==null&&e!==void 0?e:AL.enabled,max_bytes:U$e(t.max_bytes,AL.max_bytes)}:wt({},AL)}class W$e{constructor(e){this.$e=[],this.ze=0,this.Te=DE(e)}setConfig(e){this.Te=DE(e),this.Ze()}add(e){var r=(function(i){var a;try{a=YZ(i)}catch{return}try{var s=JSON.parse(a);if(!Kn(s))return;var o=s,l=o[LE],u=o[IE];return!Rn(l)||l.trim().length===0||!Rn(u)&&!Na(u)?void 0:{step:o,json:a}}catch{return}})(e);if(r){var n=(function(i){if(typeof TextEncoder<"u")return new TextEncoder().encode(i).length;for(var a=encodeURIComponent(i),s=0,o=0;a.length>o;o++)a[o]==="%"?(s+=1,o+=2):s+=1;return s})(r.json);n>this.Te.max_bytes||(this.$e.push({step:r.step,bytes:n}),this.ze+=n,this.Ze())}}getAttachable(){return this.$e.map((e=>e.step))}clear(){this.$e=[],this.ze=0}size(){return this.$e.length}Ze(){for(;this.ze>this.Te.max_bytes&&this.$e.length>0;){var e=this.$e.shift();e&&(this.ze-=e.bytes)}}}function U$e(t,e){if(!Na(t)||t===1/0||t===-1/0)return e;var r=Math.floor(t);return 0>r?e:r}var IQ=function(t,e){var r=(e===void 0?{}:e).debugEnabled,n={k(i){if(at&&(vn.DEBUG||at.POSTHOG_DEBUG||r)&&!Nt(at.console)&&at.console){for(var a=("__rrweb_original__"in at.console[i])?at.console[i].__rrweb_original__:at.console[i],s=arguments.length,o=new Array(s>1?s-1:0),l=1;s>l;l++)o[l-1]=arguments[l];a(t,...o)}},debug(){for(var i=arguments.length,a=new Array(i),s=0;i>s;s++)a[s]=arguments[s];n.k("debug",...a)},info(){for(var i=arguments.length,a=new Array(i),s=0;i>s;s++)a[s]=arguments[s];n.k("log",...a)},warn(){for(var i=arguments.length,a=new Array(i),s=0;i>s;s++)a[s]=arguments[s];n.k("warn",...a)},error(){for(var i=arguments.length,a=new Array(i),s=0;i>s;s++)a[s]=arguments[s];n.k("error",...a)},critical(){for(var i=arguments.length,a=new Array(i),s=0;i>s;s++)a[s]=arguments[s];console.error(t,...a)},uninitializedWarning(i){n.error("You must initialize PostHog before calling "+i)},createLogger:(i,a)=>IQ(t+" "+i,a)};return n},Pt=IQ("[PostHog.js]"),Zn=Pt.createLogger,H$e=Zn("[ExternalScriptsLoader]"),RL=(t,e,r)=>{if(t.config.disable_external_dependency_loading)return H$e.warn(e+" was requested but loading of external scripts is disabled."),r("Loading of external scripts is disabled");var n=Wt==null?void 0:Wt.querySelectorAll("script");if(n){for(var i,a=function(){if(n[s].src===e){var l=n[s];return l.__posthog_loading_callback_fired?{v:r()}:(l.addEventListener("load",(u=>{l.__posthog_loading_callback_fired=!0,r(void 0,u)})),l.onerror=u=>r(u),{v:void 0})}},s=0;n.length>s;s++)if(i=a())return i.v}var o=()=>{if(!Wt)return r("document not found");var l=Wt.createElement("script");if(l.type="text/javascript",l.crossOrigin="anonymous",l.src=e,l.onload=d=>{l.__posthog_loading_callback_fired=!0,r(void 0,d)},l.onerror=d=>r(d),t.config.prepare_external_dependency_script&&(l=t.config.prepare_external_dependency_script(l)),!l)return r("prepare_external_dependency_script returned null");if(t.config.external_scripts_inject_target==="head")Wt.head.appendChild(l);else{var u,h=Wt.querySelectorAll("body > script");h.length>0?(u=h[0].parentNode)==null||u.insertBefore(l,h[0]):Wt.body.appendChild(l)}};Wt!=null&&Wt.body?o():Wt==null||Wt.addEventListener("DOMContentLoaded",o)};fr.__PosthogExtensions__=fr.__PosthogExtensions__||{},fr.__PosthogExtensions__.loadExternalDependency=(t,e,r)=>{if(e!=="remote-config"){var n;if(t.config.strict_script_versioning)n=t.requestRouter.endpointFor("assets","/static/"+t.version+"/"+e+".js");else{var i="/static/"+e+".js?v="+t.version;if(e==="toolbar"){var a=3e5;i=i+"&t="+Math.floor(Date.now()/a)*a}n=t.requestRouter.endpointFor("assets",i)}RL(t,n,r)}else{var s=t.requestRouter.endpointFor("assets","/array/"+t.config.token+"/config.js");RL(t,s,r)}},fr.__PosthogExtensions__.loadSiteApp=(t,e,r)=>{var n=t.requestRouter.endpointFor("api",e);RL(t,n,r)},vn.DEBUG=!1,vn.LIB_VERSION="1.409.5",vn.LIB_NAME="web";var DQ="$people_distinct_id",jx="$device_id",LL="$device_model",Kx="__alias",Zx="__timers",IL="$autocapture_disabled_server_side",DL="$heatmaps_enabled_server_side",ML="$exception_capture_enabled_server_side",NL="$error_tracking_suppression_rules",$L="$error_tracking_capture_extension_exceptions",OL="$web_vitals_enabled_server_side",PL="$dead_clicks_enabled_server_side",BL="$product_tours_enabled_server_side",FL="$web_vitals_allowed_metrics",bf="$session_recording_remote_config",MQ="$replay_sample_rate",NQ="$replay_override_sampling",$Q="$replay_override_linked_flag",OQ="$replay_override_url_trigger",PQ="$replay_override_event_trigger",Cg="$sesid",zL="$session_is_sampled",xf="$enabled_feature_flags",ME="$active_feature_flags",Qx="$early_access_features",GL="$feature_flag_details",NE="$feature_flag_payloads",qL="$feature_flag_request_id",$E="$minimal_flag_called_events",yu="$override_feature_flags",kg="$override_feature_flag_payloads",Tf="$stored_person_properties",wf="$stored_group_properties",VL="$surveys",OE="$surveys_loaded_at",WL="$surveys_activated",PE="$surveys_activated_session",Jx="ph_product_tours",eT="$flag_call_reported",UL="$flag_call_reported_session_id",HL="$feature_flag_errors",tT="$feature_flag_evaluated_at",Vo="$user_state",YL="$client_session_props",XL="$capture_rate_limit",jL="$initial_campaign_params",KL="$initial_referrer_info",BE="$initial_person_info",FE="$epp",zE="$posthog_cookieless",BQ="$cookieless_mode",FQ="$sdk_debug_extensions_init_method",zQ="$sdk_debug_extensions_init_time_ms",GQ="$sdk_debug_recording_script_not_loaded",ZL="PostHog loadExternalDependency extension not found.",Cf="on_reject",vu="always",Eg="anonymous",kf="identified",QL="identified_only",GE="visibilitychange",qE="beforeunload",Sg="$pageview",JL="$pageleave",eI="$identify",qQ="$groupidentify";function VE(t,e){Br(t)&&t.forEach(e)}function Ln(t,e){if(!zr(t))if(Br(t))t.forEach(e);else if(n$e(t))t.forEach(((n,i)=>e(n,i)));else for(var r in t)jZ.call(t,r)&&e(t[r],r)}var Nn=function(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;e>n;n++)r[n-1]=arguments[n];for(var i of r)for(var a in i)i[a]!==void 0&&(t[a]=i[a]);return t};function WE(t){for(var e=Object.keys(t),r=e.length,n=new Array(r);r--;)n[r]=[e[r],t[e[r]]];return n}var VQ=function(t){try{return t()}catch{return}},Y$e=function(t){return function(){try{for(var e=arguments.length,r=new Array(e),n=0;e>n;n++)r[n]=arguments[n];return t.apply(this,r)}catch(i){Pt.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),Pt.critical(i)}}},tI=function(t){var e={};return Ln(t,(function(r,n){(Rn(r)&&r.length>0||Na(r))&&(e[n]=r)})),e},X$e=["herokuapp.com","vercel.app","netlify.app"];function j$e(t){var e=t==null?void 0:t.hostname;if(!Rn(e))return!1;var r=e.split(".").slice(-2).join(".");for(var n of X$e)if(r===n)return!1;return!0}function ui(t,e,r,n){var i=n??{},a=i.capture,s=i.passive;t==null||t.addEventListener(e,r,{capture:a!==void 0&&a,passive:s===void 0||s})}function WQ(t){return t.name==="ph_toolbar_internal"}var UQ=t=>{if(Wt){try{for(var e=t+"=",r=Wt.cookie.split(";").filter((a=>a.length)),n=0;r.length>n;n++){for(var i=r[n];i.charAt(0)==" ";)i=i.substring(1,i.length);if(i.indexOf(e)===0)return decodeURIComponent(i.substring(e.length,i.length))}}catch{}return null}};Math.trunc||(Math.trunc=function(t){return 0>t?Math.ceil(t):Math.floor(t)}),Number.isInteger||(Number.isInteger=function(t){return Na(t)&&isFinite(t)&&Math.floor(t)===t});class UE{constructor(e){if(this.bytes=e,e.length!==16)throw new TypeError("not 128-bit length")}static fromFieldsV7(e,r,n,i){if(!Number.isInteger(e)||!Number.isInteger(r)||!Number.isInteger(n)||!Number.isInteger(i)||0>e||0>r||0>n||0>i||e>0xffffffffffff||r>4095||n>1073741823||i>4294967295)throw new RangeError("invalid field value");var a=new Uint8Array(16);return a[0]=e/Math.pow(2,40),a[1]=e/Math.pow(2,32),a[2]=e/Math.pow(2,24),a[3]=e/Math.pow(2,16),a[4]=e/256,a[5]=e,a[6]=112|r>>>8,a[7]=r,a[8]=128|n>>>24,a[9]=n>>>16,a[10]=n>>>8,a[11]=n,a[12]=i>>>24,a[13]=i>>>16,a[14]=i>>>8,a[15]=i,new UE(a)}toString(){for(var e="",r=0;this.bytes.length>r;r++)e=e+(this.bytes[r]>>>4).toString(16)+(15&this.bytes[r]).toString(16),r!==3&&r!==5&&r!==7&&r!==9||(e+="-");if(e.length!==36)throw new Error("Invalid UUIDv7 was generated");return e}clone(){return new UE(this.bytes.slice(0))}equals(e){return this.compareTo(e)===0}compareTo(e){for(var r=0;16>r;r++){var n=this.bytes[r]-e.bytes[r];if(n!==0)return Math.sign(n)}return 0}}class K$e{generate(){var e=this.generateOrAbort();if(!Nt(e))return e;this.S=0;var r=this.generateOrAbort();if(Nt(r))throw new Error("Could not generate UUID after timestamp reset");return r}generateOrAbort(){var e=Date.now();if(e>this.S)this.S=e,this.C();else{if(this.S>=e+1e4)return;this.M++,this.M>4398046511103&&(this.S++,this.C())}return UE.fromFieldsV7(this.S,Math.trunc(this.M/Math.pow(2,30)),this.M&Math.pow(2,30)-1,this.I.nextUint32())}C(){this.M=1024*this.I.nextUint32()+(1023&this.I.nextUint32())}constructor(){this.S=0,this.M=0,this.I=new Z$e}}var HQ,YQ=t=>{if(typeof UUIDV7_DENY_WEAK_RNG<"u"&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var e=0;t.length>e;e++)t[e]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return t};at&&!Nt(at.crypto)&&crypto.getRandomValues&&(YQ=t=>crypto.getRandomValues(t));class Z$e{nextUint32(){return this.R.length>this.O||(YQ(this.R),this.O=0),this.R[this.O++]}constructor(){this.R=new Uint32Array(8),this.O=1/0}}var bu=()=>Q$e().toString(),Q$e=()=>(HQ||(HQ=new K$e)).generate(),rT="",J$e=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i,xu={N:()=>!!Wt,P(t){Pt.error("cookieStore error: "+t)},q:UQ,F(t){var e;try{e=JSON.parse(xu.q(t))||{}}catch{}return e},A(t,e,r,n,i){if(!Wt)return!1;try{var a="",s="",o=(function(h,d){if(d){var f=(function(g,m){if(m===void 0&&(m=Wt),rT)return rT;if(!m||["localhost","127.0.0.1"].includes(g))return"";for(var y=g.split("."),v=Math.min(y.length,8),x="dmn_chk_"+bu();!rT&&v--;){var b=y.slice(v).join("."),w=x+"=1;domain=."+b+";path=/";m.cookie=w+";max-age=3",m.cookie.includes(x)&&(m.cookie=w+";max-age=0",rT=b)}return rT})(h);if(!f){var p=(g=>{var m=g.match(J$e);return m?m[0]:""})(h);p!==f&&Pt.info("Warning: cookie subdomain discovery mismatch",p,f),f=p}return f?"; domain=."+f:""}return""})(Wt.location.hostname,n);if(r){var l=new Date;l.setTime(l.getTime()+864e5*r),a="; expires="+l.toUTCString()}i&&(s="; secure");var u=t+"="+encodeURIComponent(JSON.stringify(e))+a+"; SameSite=Lax; path=/"+o+s;return u.length>3686.4&&Pt.warn("cookieStore warning: large cookie, len="+u.length),Wt.cookie=u,!0}catch{return!1}},D(t,e){if(Wt!=null&&Wt.cookie)try{xu.A(t,"",-1,e)}catch{return}}},rI=null,$n={N(){if(!bs(rI))return rI;var t=!0;if(Nt(at))t=!1;else try{var e="__mplssupport__";$n.A(e,"xyz"),$n.q(e)!=='"xyz"'&&(t=!1),$n.D(e)}catch{t=!1}return t||Pt.error("localStorage unsupported; falling back to cookie store"),rI=t,t},P(t){Pt.error("localStorage error: "+t)},q(t){try{return at==null?void 0:at.localStorage.getItem(t)}catch(e){$n.P(e)}return null},F(t){try{return JSON.parse($n.q(t))||{}}catch{}return null},A(t,e){try{return at==null||at.localStorage.setItem(t,JSON.stringify(e)),!0}catch(r){$n.P(r)}return!1},D(t){try{at==null||at.localStorage.removeItem(t)}catch(e){$n.P(e)}}},eOe=[jx,"distinct_id",Cg,zL,FE,BE,Vo],HE={},tOe={N:()=>!0,P(t){Pt.error("memoryStorage error: "+t)},q:t=>HE[t]||null,F:t=>HE[t]||null,A:(t,e)=>(HE[t]=e,!0),D(t){delete HE[t]}},Ef=null,$a={N(){if(!bs(Ef))return Ef;if(Ef=!0,Nt(at))Ef=!1;else try{var t="__support__";$a.A(t,"xyz"),$a.q(t)!=='"xyz"'&&(Ef=!1),$a.D(t)}catch{Ef=!1}return Ef},P(t){Pt.error("sessionStorage error: ",t)},q(t){try{return at==null?void 0:at.sessionStorage.getItem(t)}catch(e){$a.P(e)}return null},F(t){try{return JSON.parse($a.q(t))||null}catch{}return null},A(t,e){try{return at==null||at.sessionStorage.setItem(t,JSON.stringify(e)),!0}catch(r){$a.P(r)}return!1},D(t){try{at==null||at.sessionStorage.removeItem(t)}catch(e){$a.P(e)}}};class rOe{constructor(e){this._instance=e}get Te(){return this._instance.config}get consent(){return this.Ge()?0:this.Qe}isOptedOut(){return this.Te.cookieless_mode===vu||this.isRejected()||this.consent===-1&&this.Te.cookieless_mode===Cf}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return this.consent===0}isRejected(){return this.consent===0||this.consent===-1&&this.Te.opt_out_capturing_by_default}optInOut(e){this.Je.A(this.Ke,e?1:0,this.Te.cookie_expiration,this.Te.cross_subdomain_cookie,this.Te.secure_cookie)}reset(){this.Je.D(this.Ke,this.Te.cross_subdomain_cookie)}get Ke(){var e=this._instance.config,r=e.token,n=e.opt_out_capturing_cookie_prefix;return e.consent_persistence_name||(n?n+r:"__ph_opt_in_out_"+r)}get Qe(){var e=this.Je.q(this.Ke);return gL(e)?1:Rr(o$e,e)?0:-1}get Je(){var e=this.Te.opt_out_capturing_persistence_type,r=e==="localStorage"?$n:xu;if(!this.Ye||this.Ye!==r){this.Ye=r;var n=e==="localStorage"?xu:$n;n.q(this.Ke)&&(this.Ye.q(this.Ke)||this.optInOut(gL(n.q(this.Ke))),n.D(this.Ke,this.Te.cross_subdomain_cookie))}return this.Ye}Ge(){return!!this.Te.respect_dnt&&[vs==null?void 0:vs.doNotTrack,vs==null?void 0:vs.msDoNotTrack,fr.doNotTrack].some((e=>gL(e)))}}function XQ(t,e){var r,n=t==null||(r=t.config)==null?void 0:r.get_current_url;if(!bo(n))return e;try{var i=n(e);return Rn(i)&&i?i:e}catch(a){return Pt.error("Error in get_current_url, falling back to window.location.href",a),e}}var jQ="__POSTHOG_TOOLBAR__",nOe=1,iOe=3,aOe=11;function KQ(t){return t instanceof Element&&(t.id===jQ||!(t.closest==null||!t.closest(".toolbar-global-fade-container")))}function Ph(t){return!!t&&t.nodeType===nOe}function To(t,e){return!!t&&!!t.tagName&&t.tagName.toLowerCase()===e.toLowerCase()}function ZQ(t){return!!t&&t.nodeType===iOe}function QQ(t){return!!t&&t.nodeType===aOe&&Ph(t.host)}var JQ=1e3;function nI(t){return t?xE(t).split(/\s+/):[]}function eJ(t,e){var r=(function(n){var i,a=at==null||(i=at.location)==null?void 0:i.href;return Nt(a)?void 0:XQ(n,a)})(e);return!!(r&&t&&t.some((n=>r.match(n))))}function YE(t){var e="";switch(typeof t.className){case"string":e=t.className;break;case"object":e=(t.className&&"baseVal"in t.className?t.className.baseVal:null)||t.getAttribute("class")||"";break;default:e=""}return nI(e)}function tJ(t){return zr(t)?null:xE(t).split(/(\s+)/).filter((e=>iT(e))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function nT(t){var e="";return lI(t)&&!lJ(t)&&t.childNodes&&t.childNodes.length&&Ln(t.childNodes,(function(r){var n;ZQ(r)&&r.textContent&&(e+=(n=tJ(r.textContent))!==null&&n!==void 0?n:"")})),xE(e)}function iI(t){var e;return Nt(t.target)?t.srcElement||null:(e=t.target)!=null&&e.shadowRoot?t.composedPath()[0]||null:t.target||null}var aI=["a","button","form","input","select","textarea","label"];function sI(t,e){if(Nt(e))return!0;var r,n=function(a){if(e.some((s=>(function(o,l){var u=o.matches||o.matchesSelector||o.msMatchesSelector||o.mozMatchesSelector||o.webkitMatchesSelector||o.oMatchesSelector;try{return!!u&&u.call(o,l)}catch{return!1}})(a,s))))return{v:!0}};for(var i of t)if(r=n(i))return r.v;return!1}function rJ(t){var e=t.parentNode;return!(!e||!Ph(e))&&e}var sOe=[".ph-no-autocapture","[data-ph-no-autocapture]"],nJ=["next","previous","prev",">","<"],oOe=[...nJ,"+","-","−","–"],iJ=(t,e)=>/[a-z0-9]/i.test(e)?t.includes(e):t===e,aJ=[".ph-no-rageclick",".ph-no-capture"],lOe=["","text","search","email","password","url","tel","number"];function sJ(t,e){if(!at||oI(t))return!1;var r,n,i,a,s;if(Tl(e)?(r=!!e&&aJ,n=void 0,i=!1):(r=(a=e==null?void 0:e.css_selector_ignorelist)!==null&&a!==void 0?a:aJ,n=e==null?void 0:e.content_ignorelist,i=(s=e==null?void 0:e.ignore_text_selection)!==null&&s!==void 0&&s),r===!1||i&&(function(l){return!(!l||!Ph(l))&&(!!To(l,"textarea")||(To(l,"input")?Rr(lOe,(l.getAttribute("type")||"").toLowerCase()):(function(u){if(u.isContentEditable)return!0;var h=u.getAttribute==null?void 0:u.getAttribute("contenteditable");return h==="true"||h===""})(l)))})(t))return!1;var o=oJ(t,!1).targetElementList;return!(function(l,u){if(l===!1||Nt(l))return!1;var h;if(l===!0)h=nJ;else{if(!Br(l))return!1;if(l.length>10)return Pt.error("[PostHog] content_ignorelist array cannot exceed 10 items. Use css_selector_ignorelist for more complex matching."),!1;h=l.map((d=>d.toLowerCase()))}return u.some((d=>{var f=d.safeText,p=d.ariaLabel;return h.some((g=>iJ(f,g)||iJ(p,g)))}))})(n,o.map((l=>{var u;return{safeText:nT(l).toLowerCase(),ariaLabel:((u=l.getAttribute("aria-label"))==null?void 0:u.toLowerCase().trim())||""}})))&&!sI(o,r)}var oI=t=>!t||To(t,"html")||!Ph(t),oJ=(t,e)=>{if(!at||oI(t))return{parentIsUsefulElement:!1,targetElementList:[]};for(var r=!1,n=[t],i=t;i.parentNode&&!To(i,"body");)if(QQ(i.parentNode))n.push(i.parentNode.host),i=i.parentNode.host;else{var a=rJ(i);if(!a)break;if(e||aI.indexOf(a.tagName.toLowerCase())>-1)r=!0;else try{var s=at.getComputedStyle(a);s&&s.getPropertyValue("cursor")==="pointer"&&(r=!0)}catch{}n.push(a),i=a}return{parentIsUsefulElement:r,targetElementList:n}};function lI(t){for(var e=new Set,r=0,n=t;n.parentNode&&!To(n,"body");n=n.parentNode){if(r++>=JQ||e.has(n))return!1;e.add(n);var i=YE(n);if(Rr(i,"ph-sensitive")||Rr(i,"ph-no-capture"))return!1}if(Rr(YE(t),"ph-include"))return!0;var a=t.type||"";if(Rn(a))switch(a.toLowerCase()){case"hidden":case"password":return!1}var s=t.name||t.id||"";return!Rn(s)||!/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(s.replace(/[^a-zA-Z0-9]/g,""))}function lJ(t){return!!(To(t,"input")&&!["button","checkbox","submit","reset"].includes(t.type)||To(t,"select")||To(t,"textarea")||t.getAttribute("contenteditable")==="true")}var cJ=new RegExp("^(?:(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11}))$"),uJ=/(^|[^0-9A-Za-z_])([0-9][0-9 -]*[0-9])(?=$|[^0-9A-Za-z_])/g,cOe=[16,15,14,13],uOe=new RegExp("^(\\d{3}-?\\d{2}-?\\d{4})$"),hJ=new RegExp("(^|[^0-9])((?!000|666)[0-9]{3}-?(?!00)[0-9]{2}-?(?!0000)[0-9]{4})(?=$|([^0-9]))","g"),dJ=/[0-9A-Za-z_]/;function hOe(t){for(var e=0,r=!1,n=t.length-1;n>=0;n--){var i=t.charCodeAt(n)-48;r&&(i*=2)>9&&(i-=9),e+=i,r=!r}return e%10==0}function iT(t,e){if(e===void 0&&(e=!0),zr(t))return!1;if(Rn(t)){t=xE(t);var r=e?cJ.test((t||"").replace(/[- ]/g,"")):(function(i){var a;for(uJ.lastIndex=0;a=uJ.exec(i);){var s=a[2];if(s)for(var o=s.replace(/[- ]/g,""),l=0;o.length>l;l++)for(var u of cOe){var h=l+u;if(o.length>=h){var d=o.slice(l,h);if(cJ.test(d)&&hOe(d))return!0}}}return!1})(t);if(r)return!1;var n=e?uOe.test(t):(function(i){var a;for(hJ.lastIndex=0;a=hJ.exec(i);){var s=a[1],o=a[3];if(!(s&&o&&dJ.test(s)&&dJ.test(o)))return!0}return!1})(t);if(n)return!1}return!0}function fJ(t){var e=nT(t);return iT(e=(e+" "+pJ(t)).trim())?e:""}function pJ(t){var e="";return t&&t.childNodes&&t.childNodes.length&&Ln(t.childNodes,(function(r){var n;if(r&&((n=r.tagName)==null?void 0:n.toLowerCase())==="span")try{var i=nT(r);e=(e+" "+i).trim(),r.childNodes&&r.childNodes.length&&(e=(e+" "+pJ(r)).trim())}catch(a){Pt.error("[AutoCapture]",a)}})),e}function gJ(t){return t.replace(/"|\\"/g,'\\"')}function dOe(t){var e=t.attr__class;if(e)return Br(e)?e:nI(e)}var XE=Zn("[Dead Clicks]"),fOe=()=>!0,pOe=t=>{var e,r=!((e=t.instance.persistence)==null||!e.get_property(PL)),n=t.instance.config.capture_dead_clicks;return Tl(n)?n:!!Kn(n)||r};class mJ{get lazyLoadedDeadClicksAutocapture(){return this.Xe}constructor(e,r,n){this.instance=e,this.isEnabled=r,this.onCapture=n,this.startIfEnabledOrStop()}onRemoteConfig(e){if(e.ok){var r=e.config;"captureDeadClicks"in r&&(this.instance.persistence&&this.instance.persistence.register({[PL]:r.captureDeadClicks}),this.startIfEnabledOrStop())}}startIfEnabledOrStop(){this.isEnabled(this)?this.tr((()=>{this.er()})):this.stop()}tr(e){var r,n;(r=fr.__PosthogExtensions__)!=null&&r.initDeadClicksAutocapture?e():(n=fr.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this.instance,"dead-clicks-autocapture",(i=>{i?XE.error("failed to load script",i):e()}))}er(){var e;if(Wt){if(!this.Xe&&(e=fr.__PosthogExtensions__)!=null&&e.initDeadClicksAutocapture){var r=Kn(this.instance.config.capture_dead_clicks)?wt({},this.instance.config.capture_dead_clicks):{};r.__onCapture=this.onCapture,this.onCapture&&(r.capture_dead_swipes=!1),this.Xe=fr.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,r),this.Xe.start(Wt),XE.info("starting...")}}else XE.error("`document` not found. Cannot start.")}stop(){this.Xe&&(this.Xe.stop(),this.Xe=void 0,XE.info("stopping..."))}}var cI=Zn("[SegmentIntegration]"),yJ="posthog-js";function vJ(t,e){var r=e===void 0?{}:e,n=r.organization,i=r.projectId,a=r.prefix,s=r.severityAllowList,o=s===void 0?["error"]:s,l=r.sendExceptionsToPostHog,u=l===void 0||l;return h=>{var d,f,p,g,m;if(o!=="*"&&!o.includes(h.level)||!t.__loaded)return h;h.tags||(h.tags={});var y=t.requestRouter.endpointFor("ui","/project/"+t.config.token+"/person/"+t.get_distinct_id());h.tags["PostHog Person URL"]=y,t.sessionRecordingStarted()&&(h.tags["PostHog Recording URL"]=t.get_session_replay_url({withTimestamp:!0}));var v,x=((d=h.exception)==null?void 0:d.values)||[],b=x.map((C=>wt({},C,{stacktrace:C.stacktrace?wt({},C.stacktrace,{type:"raw",frames:(C.stacktrace.frames||[]).map((_=>wt({},_,{platform:"web:javascript"})))}):void 0}))),w={$exception_message:((f=x[0])==null?void 0:f.value)||h.message,$exception_type:(p=x[0])==null?void 0:p.type,$exception_level:h.level,$exception_list:b,$sentry_event_id:h.event_id,$sentry_exception:h.exception,$sentry_exception_message:((g=x[0])==null?void 0:g.value)||h.message,$sentry_exception_type:(m=x[0])==null?void 0:m.type,$sentry_tags:h.tags};return n&&i&&(w.$sentry_url=(a||"https://sentry.io/organizations/")+n+"/issues/?project="+i+"&query="+h.event_id),u&&((v=t.exceptions)==null||v.sendExceptionEvent(w)),h}}class gOe{constructor(e,r,n,i,a,s){this.name=yJ,this.setupOnce=function(o){o(vJ(e,{organization:r,projectId:n,prefix:i,severityAllowList:a,sendExceptionsToPostHog:s==null||s}))}}}class bJ{constructor(e){this.rr=(r,n,i)=>{i&&(i.noSessionId||i.activityTimeout||i.sessionPastMaximumLength||i.crossTabAdoption)&&(Pt.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:r,changeReason:i}),this.ir=void 0,this._instance.scrollManager.resetContext())},this._instance=e,this.nr()}nr(){var e;this.sr=(e=this._instance.sessionManager)==null?void 0:e.onSessionId(this.rr)}destroy(){var e;(e=this.sr)==null||e.call(this),this.sr=void 0}doPageView(e,r){var n,i=this.ar(e,r);return this.ir={pathname:(n=at==null?void 0:at.location.pathname)!==null&&n!==void 0?n:"",pageViewId:r,timestamp:e},this._instance.scrollManager.resetContext(),i}doPageLeave(e){var r;return this.ar(e,(r=this.ir)==null?void 0:r.pageViewId)}doEvent(){var e;return{$pageview_id:(e=this.ir)==null?void 0:e.pageViewId}}ar(e,r){var n=this.ir;if(!n)return{$pageview_id:r};var i={$pageview_id:r,$prev_pageview_id:n.pageViewId},a=this._instance.scrollManager.getContext();if(a&&!this._instance.config.disable_scroll_properties){var s=a.maxScrollHeight,o=a.lastScrollY,l=a.maxScrollY,u=a.maxContentHeight,h=a.lastContentY,d=a.maxContentY;if(!(Nt(s)||Nt(o)||Nt(l)||Nt(u)||Nt(h)||Nt(d))){s=Math.ceil(s),o=Math.ceil(o),l=Math.ceil(l),u=Math.ceil(u),h=Math.ceil(h),d=Math.ceil(d);var f=s>1?oc(o/s,0,1,Pt):1,p=s>1?oc(l/s,0,1,Pt):1,g=u>1?oc(h/u,0,1,Pt):1,m=u>1?oc(d/u,0,1,Pt):1;i=Nn(i,{$prev_pageview_last_scroll:o,$prev_pageview_last_scroll_percentage:f,$prev_pageview_max_scroll:l,$prev_pageview_max_scroll_percentage:p,$prev_pageview_last_content:h,$prev_pageview_last_content_percentage:g,$prev_pageview_max_content:d,$prev_pageview_max_content_percentage:m})}}return n.pathname&&(i.$prev_pageview_pathname=n.pathname),n.timestamp&&(i.$prev_pageview_duration=(e.getTime()-n.timestamp.getTime())/1e3),i}}var uI=["flags","surveys"],mOe={[DQ]:{exposure:"hidden"},[Kx]:{exposure:"hidden"},__cmpns:{exposure:"hidden"},[Zx]:{exposure:"hidden"},[IL]:{exposure:"event"},[DL]:{exposure:"hidden"},[ML]:{exposure:"event"},[NL]:{exposure:"hidden"},[$L]:{exposure:"event"},[OL]:{exposure:"event"},[PL]:{exposure:"event"},[BL]:{exposure:"hidden"},[FL]:{exposure:"event"},[bf]:{exposure:"hidden"},$session_recording_enabled_server_side:{exposure:"hidden"},[Cg]:{exposure:"hidden"},[zL]:{exposure:"event"},[MQ]:{exposure:"event",shouldSkipFromEventProperties:t=>bs(t)},$session_past_minimum_duration:{exposure:"event"},$session_recording_url_trigger_activated_session:{exposure:"event"},$session_recording_event_trigger_activated_session:{exposure:"event"},$debug_first_full_snapshot_timestamp:{exposure:"event"},$sess_rec_flush_size:{exposure:"hidden"},[xf]:{exposure:"derived",storageGroup:"flags",shouldSkipFromEventProperties:(t,e)=>e(),transformToEventProperties(t){if(!Kn(t))return{};for(var e={},r=Object.keys(t),n=0;r.length>n;n++)e["$feature/"+r[n]]=t[r[n]];return e}},[ME]:{exposure:"event",storageGroup:"flags"},[Qx]:{exposure:"hidden"},[GL]:{exposure:"hidden",storageGroup:"flags"},[NE]:{exposure:"event",storageGroup:"flags"},[qL]:{exposure:"event",storageGroup:"flags",volatile:!0},[$E]:{exposure:"hidden",storageGroup:"flags"},[yu]:{exposure:"event"},[kg]:{exposure:"hidden"},[Tf]:{exposure:"hidden"},[wf]:{exposure:"hidden"},[VL]:{exposure:"hidden",storageGroup:"surveys"},[OE]:{exposure:"hidden",storageGroup:"surveys",volatile:!0},[WL]:{exposure:"event"},[PE]:{exposure:"hidden"},[Jx]:{exposure:"hidden"},$product_tours_activated:{exposure:"hidden"},$product_tours_activated_session:{exposure:"hidden"},$conversations_widget_session_id:{exposure:"event"},$conversations_ticket_id:{exposure:"event"},$conversations_widget_state:{exposure:"event"},$conversations_user_traits:{exposure:"event"},[eT]:{exposure:"hidden"},[UL]:{exposure:"hidden"},[HL]:{exposure:"hidden"},[tT]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[Vo]:{exposure:"hidden"},[YL]:{exposure:"hidden"},[XL]:{exposure:"hidden"},[jL]:{exposure:"hidden"},[KL]:{exposure:"hidden"},[BE]:{exposure:"hidden"},[FE]:{exposure:"hidden"},[NQ]:{exposure:"event"},[$Q]:{exposure:"event"},[OQ]:{exposure:"event"},[PQ]:{exposure:"event"},[FQ]:{exposure:"event"},[zQ]:{exposure:"event"},[GQ]:{exposure:"event"},$sdk_debug_replay_event_trigger_status:{exposure:"event"},$sdk_debug_replay_linked_flag_trigger_status:{exposure:"event"},$sdk_debug_replay_matched_recording_trigger_groups:{exposure:"event"},$sdk_debug_replay_remote_trigger_matching_config:{exposure:"event"},$sdk_debug_replay_trigger_groups_count:{exposure:"event"},$sdk_debug_replay_url_trigger_status:{exposure:"event"},$session_recording_start_reason:{exposure:"event"}},yOe=[["$posthog_sr_group_event_trigger_",{exposure:"hidden"}],["$posthog_sr_group_url_trigger_",{exposure:"hidden"}],["$posthog_sr_group_sampling_",{exposure:"hidden"}]],Sf=t=>{var e=mOe[t];if(e)return e;for(var r of yOe){var n=r[1];if(t.indexOf(r[0])===0)return n}},_g=(t,e)=>{try{return JSON.stringify(t,((r,n)=>typeof n=="bigint"?n.toString():n),e)}catch{return YZ(t)}},jE=t=>{var e=Wt==null?void 0:Wt.createElement("a");return Nt(e)?null:(e.href=t,e)},Ag=function(t,e){for(var r,n=((t.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),i=0;n.length>i;i++){var a=n[i].split("=");if(a[0]===e){r=a;break}}if(!Br(r)||2>r.length)return"";var s=r[1];try{s=decodeURIComponent(s)}catch{Pt.error("Skipping decoding for malformed query param: "+s)}return s.replace(/\+/g," ")},aT=function(t,e,r){if(!t||!e||!e.length)return t;for(var n=t.split("#"),i=n[1],a=(n[0]||"").split("?"),s=a[1],o=a[0],l=(s||"").split("&"),u=[],h=0;l.length>h;h++){var d=l[h].split("=");Br(d)&&(e.includes(d[0])?u.push(d[0]+"="+r):u.push(l[h]))}var f=o;return s!=null&&(f+="?"+u.join("&")),i!=null&&(f+="#"+i),f},KE=function(t,e){var r=t.match(new RegExp(e+"=([^&]*)"));return r?r[1]:null},xJ=(t,e)=>t>=e&&OZ(),TJ=(t,e,r,n)=>{if(t===0){if(OZ()){var i=e+1;return i===r&&n(),i}return e}return 0},ZE="https?://(.*)",Rg=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],vOe=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...Rg],sT="",bOe=["li_fat_id"];function wJ(t,e,r){if(!Wt)return{};var n,i=e?[...Rg,...r||[]]:[],a=CJ(aT(Wt.URL,i,sT),t),s=(n={},Ln(bOe,(function(o){var l=UQ(o);n[o]=l||null})),n);return Nn(s,a)}function CJ(t,e){var r=vOe.concat(e||[]),n={};return Ln(r,(function(i){var a=Ag(t,i);n[i]=a||null})),n}function kJ(t){var e=(function(a){return a?a.search(ZE+"google.([^/?]*)")===0?"google":a.search(ZE+"bing.com")===0?"bing":a.search(ZE+"yahoo.com")===0?"yahoo":a.search(ZE+"duckduckgo.com")===0?"duckduckgo":null:null})(t),r=e!="yahoo"?"q":"p",n={};if(!bs(e)){n.$search_engine=e;var i=Wt?Ag(Wt.referrer,r):"";i.length&&(n.ph_keyword=i)}return n}function EJ(){return navigator.language||navigator.userLanguage}var QE="$direct";function SJ(){return(Wt==null?void 0:Wt.referrer)||QE}function _J(t,e,r){r===void 0&&(r=!1);var n=t?[...Rg,...e||[]]:[],i=r?Oh(Ni==null?void 0:Ni.href):Ni==null?void 0:Ni.href,a=i==null?void 0:i.substring(0,1e3);return{r:SJ().substring(0,1e3),u:a?aT(a,n,sT):void 0}}function AJ(t,e){var r;e===void 0&&(e=!1);var n=t.r,i=t.u,a=e?Oh(i):i,s={$referrer:n,$referring_domain:n==null?void 0:n==QE?QE:(r=jE(n))==null?void 0:r.host};if(a){s.$current_url=a;var o=jE(a);s.$host=o==null?void 0:o.host,s.$pathname=o==null?void 0:o.pathname;var l=CJ(a);Nn(s,l)}if(n){var u=kJ(n);Nn(s,u)}return s}function RJ(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}function xOe(){try{return new Date().getTimezoneOffset()}catch{return}}var TOe={flags:tT,surveys:OE},wOe=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],Lg="main";class hI{constructor(e,r,n){if(n===void 0&&(n=!0),this.lr={},this.ur=!1,this.hr=!1,this.Te=e,this.dr=n,this.props={},this.cr=void 0,this.vr=(a=>{var s="";return a.token&&(s=a.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),a.persistence_name?"ph_"+a.persistence_name:"ph_"+s+"_posthog"})(e),this.Je=this.pr(e),this.hr=this.gr(e),this.load(),e.debug&&Pt.info("Persistence loaded",e.persistence,wt({},this.props)),this.update_config(e,e,r),this.save(),at){var i=()=>this.flush();ui(at,"beforeunload",i,{capture:!1}),ui(at,"pagehide",i,{capture:!1})}}mr(){var e,r=(e=this.Te)==null?void 0:e.persistence_save_debounce_ms;return Na(r)&&r>0?r:0}isDisabled(){return!!this.yr}pr(e){wOe.indexOf(e.persistence.toLowerCase())===-1&&(Pt.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var r,n=(function(s,o){s===void 0&&(s=[]),o===void 0&&(o=!1);var l=[...eOe,...s];return wt({},$n,{F(u){try{var h={};try{h=xu.F(u)||{}}catch{}var d,f=JSON.parse($n.q(u)||"{}");if(o){var p={};for(var g in h){var m=h[g];bs(m)||m===""||(p[g]=m)}d=Nn(f,p)}else d=Nn(h,f);return $n.A(u,d),d}catch{}return null},A(u,h,d,f,p,g){var m=$n.A(u,h,void 0,void 0,g);try{var y={};l.forEach((v=>{h[v]&&(y[v]=h[v])})),Object.keys(y).length&&xu.A(u,y,d,f,p,g)}catch(v){$n.P(v)}return m},D(u,h){try{at==null||at.localStorage.removeItem(u),xu.D(u,h)}catch(d){$n.P(d)}}})})(e.cookie_persisted_properties||[],e.__preview_cookie_wins_on_conflict||!1),i=!1,a=e.persistence.toLowerCase();return a==="localstorage"&&$n.N()?(r=$n,i=!0):a==="localstorage+cookie"&&n.N()?(r=n,i=!0):a==="sessionstorage"&&$a.N()?r=$a:a==="memory"?r=tOe:a==="cookie"?r=xu:n.N()?(r=n,i=!0):r=xu,this.ur=i,r}br(e){return this.vr+"__"+e}gr(e){return this.ur&&!!e.split_storage}_r(e){var r=e??this.Te.feature_flag_cache_ttl_ms;if(!r||0>=r)return!1;var n=this.props[tT];return!n||typeof n!="number"||Date.now()-n>r}properties(){var e={};return Ln(this.props,((r,n)=>{var i=Sf(n);if((i==null?void 0:i.exposure)==="derived"){if(i.shouldSkipFromEventProperties!=null&&i.shouldSkipFromEventProperties(r,n===xf?()=>this._r():()=>!1))return;i.transformToEventProperties&&Nn(e,i.transformToEventProperties(r))}else if(!i||i.exposure==="event"){if(i!=null&&i.shouldSkipFromEventProperties!=null&&i.shouldSkipFromEventProperties(r,(()=>!1)))return;e[n]=r}})),e}load(){if(!this.yr){var e=this.Je.F(this.vr);e&&(this.props=Nn({},e)),this.hr&&this.wr()}}wr(){for(var e of uI){var r=$n.F(this.br(e));if(r&&!$h(r)){var n=this.kr(e);n.persisted=!0,this.Sr(e)||(n.fingerprint=this.Cr(r,e)),this.Mr(e,r)||Nn(this.props,r)}}}Sr(e){return Object.keys(this.props).some((r=>{var n;return((n=Sf(r))==null?void 0:n.storageGroup)===e}))}Mr(e,r){var n=TOe[e];if(!n)return!1;var i=r[n],a=this.props[n];return Na(i)&&Na(a)&&a>i}refreshKey(e){var r;if(!this.yr){var n=this.hr?(r=Sf(e))==null?void 0:r.storageGroup:void 0,i=n?$n.F(this.br(n)):this.Je.F(this.vr);if(i&&e in i)this.Ir(e,i[e]);else{if(n){var a=this.Je.F(this.vr);if(a&&e in a)return void this.Ir(e,a[e])}this.Tr(e)}}}save(){if(!this.yr){var e=this.mr();e>0?Nt(this.Er)&&(this.Er=setTimeout((()=>{this.Er=void 0,this.Rr()}),e)):this.Rr()}}flush(){Nt(this.Er)||(clearTimeout(this.Er),this.Er=void 0,this.Rr())}Rr(){this.yr||(this.hr?this.Pr():this.Or(this.Je,this.vr,this.props,Lg))}Pr(){var e=this.Fr(),r=e.main,n=e.groups;for(var i of(this.Or(this.Je,this.vr,r,Lg),uI)){var a,s=n[i];(!$h(s)||(a=this.lr[i])!=null&&a.persisted)&&this.Or($n,this.br(i),s,i)}}Fr(){var e={},r={flags:{},surveys:{}};return Ln(this.props,((n,i)=>{var a,s=(a=Sf(i))==null?void 0:a.storageGroup;s?r[s][i]=n:e[i]=n})),{main:e,groups:r}}Cr(e,r){if(r===Lg)return JSON.stringify(e)+"|"+this.Ar+"|"+this.$r+"|"+this.Lr;var n={};return Ln(e,((i,a)=>{var s;n[a]=(s=Sf(a))!=null&&s.volatile?"__volatile__":i})),JSON.stringify(n)}Or(e,r,n,i){var a=this.kr(i);if(i===Lg||a.dirty||Nt(a.fingerprint)){var s;try{if((s=this.Cr(n,i))===a.fingerprint)return void(a.dirty=!1)}catch{s=void 0}e.A(r,n,this.Ar,this.$r,this.Lr,this.Te.debug)?(a.dirty=!1,i!==Lg&&(a.persisted=!0),Nt(s)||(a.fingerprint=s)):this.Te.debug&&Pt.warn('failed to persist storage entry "'+r+'"; will retry on next save')}}remove(e){var r=(e===void 0?{}:e).keepGroupEntries,n=r!==void 0&&r;if(Nt(this.Er)||(clearTimeout(this.Er),this.Er=void 0),this.Je.D(this.vr,!1),this.Je.D(this.vr,!0),!n&&this.dr)for(var i of uI)$n.D(this.br(i));n?delete this.lr[Lg]:this.lr={}}clear(){this.remove(),this.props={}}register_once(e,r,n){if(Kn(e)){Nt(r)&&(r="None"),this.Ar=Nt(n)?this.Dr:n;var i=!1;if(Ln(e,((a,s)=>{this.props.hasOwnProperty(s)&&this.props[s]!==r||(this.Ir(s,a),i=!0)})),i)return this.save(),!0}return!1}register(e,r){if(Kn(e)){this.Ar=Nt(r)?this.Dr:r;var n=!1;if(Ln(e,((i,a)=>{e.hasOwnProperty(a)&&this.props[a]!==i&&(this.Ir(a,i),n=!0)})),n)return this.save(),!0}return!1}unregister(e){e in this.props&&(this.Tr(e),this.save())}update_campaign_params(){var e=Wt==null?void 0:Wt.URL;if(e!==this.cr){var r=wJ(this.Te.custom_campaign_params,this.Te.mask_personal_data_properties,this.Te.custom_personal_data_properties);$h(tI(r))||this.register(r),this.cr=e}}update_search_keyword(){var e;this.register((e=Wt==null?void 0:Wt.referrer)?kJ(e):{})}update_referrer_info(){var e;this.register_once({$referrer:SJ(),$referring_domain:Wt!=null&&Wt.referrer&&((e=jE(Wt.referrer))==null?void 0:e.host)||QE},void 0)}set_initial_person_info(){this.props[jL]||this.props[KL]||this.register_once({[BE]:_J(this.Te.mask_personal_data_properties,this.Te.custom_personal_data_properties,this.Te.disable_capture_url_hashes)},void 0)}get_initial_props(){var e={};Ln([KL,jL],(i=>{var a=this.props[i];a&&Ln(a,(function(s,o){e["$initial_"+dL(o)]=s}))}));var r=this.props[BE];if(r){var n=(function(i,a){a===void 0&&(a=!1);var s=AJ(i,a),o={};return Ln(s,(function(l,u){o["$initial_"+dL(u)]=l})),o})(r,this.Te.disable_capture_url_hashes);Nn(e,n)}return e}safe_merge(e){return Ln(this.props,(function(r,n){n in e||(e[n]=r)})),e}update_config(e,r,n){this.Dr=this.Ar=e.cookie_expiration,this.set_disabled(e.disable_persistence||!!n),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie);var i=e.persistence!==r.persistence||!((l,u)=>{if(l.length!==u.length)return!1;var h=[...l].sort(),d=[...u].sort();return h.every(((f,p)=>f===d[p]))})(e.cookie_persisted_properties||[],r.cookie_persisted_properties||[]),a=i?this.pr(e):this.Je,s=this.gr(e);if(i||s!==this.hr){var o=this.props;this.clear(),this.Je=a,this.hr=s,this.props=o,this.save()}}set_disabled(e){this.yr=e,this.yr?this.remove():this.save()}set_cross_subdomain(e){e!==this.$r&&(this.$r=e,this.remove({keepGroupEntries:!0}),this.save())}set_secure(e){e!==this.Lr&&(this.Lr=e,this.remove({keepGroupEntries:!0}),this.save())}set_event_timer(e,r){var n=this.props[Zx]||{};n[e]=r,this.Ir(Zx,n),this.save()}remove_event_timer(e){var r=this.props[Zx]||{},n=r[e];return Nt(n)||(delete r[e],this.Ir(Zx,r),this.save()),n}get_property(e){return this.props[e]}set_property(e,r){this.Ir(e,r),this.save()}Ir(e,r){var n;this.props[e]=r,(n=Sf(e))!=null&&n.volatile||this.Nr(e)}Tr(e){delete this.props[e],this.Nr(e)}Nr(e){var r,n=(r=Sf(e))==null?void 0:r.storageGroup;n&&(this.kr(n).dirty=!0)}kr(e){return this.lr[e]||(this.lr[e]={})}}function JE(t){var e=!0;return{dispose(){if(e){e=!1;var r=t();r&&bo(r.then)&&r.then(void 0,(()=>{}))}}}}var xs={GZipJS:"gzip-js",Base64:"base64"},oT={Activation:"events",Cancellation:"cancelEvents"},dI={Popover:"popover",API:"api",Widget:"widget"},Tu={SHOWN:"survey shown",DISMISSED:"survey dismissed",SENT:"survey sent"},fI={SURVEY_ID:"$survey_id",SURVEY_ITERATION:"$survey_iteration",SURVEY_LAST_SEEN_DATE:"$survey_last_seen_date"},pI={Popover:"popover",Inline:"inline"},COe={SHOWN:"product tour shown"},LJ={TOUR_LAST_SEEN_DATE:"$product_tour_last_seen_date",TOUR_TYPE:"$product_tour_type"},IJ=Zn("[RateLimiter]");class kOe{constructor(e){this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=r=>{var n=r.text;if(n&&n.length)try{(JSON.parse(n).quota_limited||[]).forEach((i=>{IJ.info((i||"events")+" is quota limited."),this.serverLimits[i]=new Date().getTime()+6e4}))}catch(i){return void IJ.warn('could not rate limit - continuing. Error: "'+(i==null?void 0:i.message)+'"',{text:n})}},this.instance=e,this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}get captureEventsPerSecond(){var e;return((e=this.instance.config.rate_limiting)==null?void 0:e.events_per_second)||10}get captureEventsBurstLimit(){var e;return Math.max(((e=this.instance.config.rate_limiting)==null?void 0:e.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond)}clientRateLimitContext(e){var r,n,i;e===void 0&&(e=!1);var a=this.captureEventsBurstLimit,s=this.captureEventsPerSecond,o=new Date().getTime(),l=(r=(n=this.instance.persistence)==null?void 0:n.get_property(XL))!==null&&r!==void 0?r:{tokens:a,last:o};l.tokens+=(o-l.last)/1e3*s,l.last=o,l.tokens>a&&(l.tokens=a);var u=1>l.tokens;return u||e||(l.tokens=Math.max(0,l.tokens-1)),!u||this.lastEventRateLimited||e||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to "+s+" events per second and "+a+" events burst limit."},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=u,(i=this.instance.persistence)==null||i.set_property(XL,l),{isRateLimited:u,remainingTokens:l.tokens}}isServerRateLimited(e){var r=this.serverLimits[e||"events"]||!1;return r!==!1&&new Date().getTime()e(this.remoteConfig))):e()}jr(e){this._instance._send_request({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),callback(r){e(r.json)}})}load(){try{if(this.remoteConfig)return _f.info("Using preloaded remote config",this.remoteConfig),this.Br(this.remoteConfig),void this.Hr();if(this._instance.Ur())return void _f.warn("Remote config is disabled. Falling back to local config.");this.qr((e=>{if(!e)return _f.info("No config found after loading remote JS config. Falling back to JSON."),void this.jr((r=>{this.Br(r),this.Hr()}));this.Br(e),this.Hr()}))}catch(e){_f.error("Error loading remote config",e),this.Br()}}stop(){this.zr&&(clearInterval(this.zr),this.zr=void 0)}refresh(){!this._instance.Ur()&&Wt&&Wt.visibilityState!=="hidden"&&this._instance.reloadFeatureFlags()}Hr(){var e;if(!this.zr){var r=(e=this._instance.config.remote_config_refresh_interval_ms)!==null&&e!==void 0?e:3e5;r!==0&&(this.zr=setInterval((()=>{this.refresh()}),r))}}Br(e){e||_f.error("Failed to fetch remote config from PostHog.");try{this._instance.Br(e?{ok:!0,config:e}:{ok:!1})}catch(n){_f.error("Error applying remote config",n)}if((e==null?void 0:e.hasFeatureFlags)!==!1&&!this._instance.config.advanced_disable_feature_flags_on_first_load)try{var r;(r=this._instance.featureFlags)==null||r.ensureFlagsLoaded()}catch(n){_f.error("Error loading feature flags",n)}}}var Wo=Uint8Array,Zs=Uint16Array,Ig=Uint32Array,gI=new Wo([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),mI=new Wo([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),MJ=new Wo([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),NJ=function(t,e){for(var r=new Zs(31),n=0;31>n;++n)r[n]=e+=1<n;++n)for(var a=r[n];r[n+1]>a;++a)i[a]=a-r[n]<<5|n;return[r,i]},$J=NJ(gI,2),yI=$J[1];$J[0][28]=258,yI[258]=28;for(var OJ=NJ(mI,0)[1],PJ=new Zs(32768),Qn=0;32768>Qn;++Qn){var Dg=(43690&Qn)>>>1|(21845&Qn)<<1;PJ[Qn]=((65280&(Dg=(61680&(Dg=(52428&Dg)>>>2|(13107&Dg)<<2))>>>4|(3855&Dg)<<4))>>>8|(255&Dg)<<8)>>>1}var lT=function(t,e,r){for(var n=t.length,i=0,a=new Zs(e);n>i;++i)++a[t[i]-1];var s,o=new Zs(e);for(i=0;e>i;++i)o[i]=o[i-1]+a[i-1]<<1;for(s=new Zs(n),i=0;n>i;++i)s[i]=PJ[o[t[i]-1]++]>>>15-t[i];return s},Af=new Wo(288);for(Qn=0;144>Qn;++Qn)Af[Qn]=8;for(Qn=144;256>Qn;++Qn)Af[Qn]=9;for(Qn=256;280>Qn;++Qn)Af[Qn]=7;for(Qn=280;288>Qn;++Qn)Af[Qn]=8;var e5=new Wo(32);for(Qn=0;32>Qn;++Qn)e5[Qn]=5;var EOe=lT(Af,9),SOe=lT(e5,5),BJ=function(t){return(t/8>>0)+(7&t&&1)},FJ=function(t,e,r){(r==null||r>t.length)&&(r=t.length);var n=new(t instanceof Zs?Zs:t instanceof Ig?Ig:Wo)(r-e);return n.set(t.subarray(e,r)),n},wu=function(t,e,r){var n=e/8>>0;t[n]|=r<<=7&e,t[n+1]|=r>>>8},cT=function(t,e,r){var n=e/8>>0;t[n]|=r<<=7&e,t[n+1]|=r>>>8,t[n+2]|=r>>>16},vI=function(t,e){for(var r=[],n=0;t.length>n;++n)t[n]&&r.push({s:n,f:t[n]});var i=r.length,a=r.slice();if(!i)return[new Wo(0),0];if(i==1){var s=new Wo(r[0].s+1);return s[r[0].s]=1,[s,1]}r.sort((function(C,_){return C.f-_.f})),r.push({s:-1,f:25001});var o=r[0],l=r[1],u=0,h=1,d=2;for(r[0]={s:-1,f:o.f+l.f,l:o,r:l};h!=i-1;)o=r[r[d].f>r[u].f?u++:d++],l=r[u!=h&&r[d].f>r[u].f?u++:d++],r[h++]={s:-1,f:o.f+l.f,l:o,r:l};var f=a[0].s;for(n=1;i>n;++n)a[n].s>f&&(f=a[n].s);var p=new Zs(f+1),g=bI(r[h-1],p,0);if(g>e){n=0;var m=0,y=g-e,v=1<n;++n){var x=a[n].s;if(e>=p[x])break;m+=v-(1<>>=y;m>0;){var b=a[n].s;e>p[b]?m-=1<=0&&m;--n){var w=a[n].s;p[w]==e&&(--p[w],++m)}g=e}return[new Wo(p),g]},bI=function(t,e,r){return t.s==-1?Math.max(bI(t.l,e,r+1),bI(t.r,e,r+1)):e[t.s]=r},zJ=function(t){for(var e=t.length;e&&!t[--e];);for(var r=new Zs(++e),n=0,i=t[0],a=1,s=function(l){r[n++]=l},o=1;e>=o;++o)if(t[o]==i&&o!=e)++a;else{if(!i&&a>2){for(;a>138;a-=138)s(32754);a>2&&(s(a>10?a-11<<5|28690:a-3<<5|12305),a=0)}else if(a>3){for(s(i),--a;a>6;a-=6)s(8304);a>2&&(s(a-3<<5|8208),a=0)}for(;a--;)s(i);a=1,i=t[o]}return[r.subarray(0,n),e]},uT=function(t,e){for(var r=0,n=0;e.length>n;++n)r+=t[n]*e[n];return r},xI=function(t,e,r){var n=r.length,i=BJ(e+2);t[i]=255&n,t[i+1]=n>>>8,t[i+2]=255^t[i],t[i+3]=255^t[i+1];for(var a=0;n>a;++a)t[i+a+4]=r[a];return 8*(i+4+n)},GJ=function(t,e,r,n,i,a,s,o,l,u,h){wu(e,h++,r),++i[256];for(var d=vI(i,15),f=d[0],p=d[1],g=vI(a,15),m=g[0],y=g[1],v=zJ(f),x=v[0],b=v[1],w=zJ(m),C=w[0],_=w[1],k=new Zs(19),S=0;x.length>S;++S)k[31&x[S]]++;for(S=0;C.length>S;++S)k[31&C[S]]++;for(var L=vI(k,7),$=L[0],I=L[1],z=19;z>4&&!$[MJ[z-1]];--z);var F,A,R,N,M=u+5<<3,D=uT(i,Af)+uT(a,e5)+s,O=uT(i,f)+uT(a,m)+s+14+3*z+uT(k,$)+(2*k[16]+3*k[17]+7*k[18]);if(D>=M&&O>=M)return xI(e,h,t.subarray(l,l+u));if(wu(e,h,1+(D>O)),h+=2,D>O){F=lT(f,p),A=f,R=lT(m,y),N=m;var B=lT($,I);for(wu(e,h,b-257),wu(e,h+5,_-1),wu(e,h+10,z-4),h+=14,S=0;z>S;++S)wu(e,h+3*S,$[MJ[S]]);h+=3*z;for(var P=[x,C],G=0;2>G;++G){var V=P[G];for(S=0;V.length>S;++S)wu(e,h,B[H=31&V[S]]),h+=$[H],H>15&&(wu(e,h,V[S]>>>5&127),h+=V[S]>>>12)}}else F=EOe,A=Af,R=SOe,N=e5;for(S=0;o>S;++S)if(n[S]>255){var H;cT(e,h,F[257+(H=n[S]>>>18&31)]),h+=A[H+257],H>7&&(wu(e,h,n[S]>>>23&31),h+=gI[H]);var W=31&n[S];cT(e,h,R[W]),h+=N[W],W>3&&(cT(e,h,n[S]>>>5&8191),h+=mI[W])}else cT(e,h,F[n[S]]),h+=A[n[S]];return cT(e,h,F[256]),h+A[256]},_Oe=new Ig([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),AOe=(function(){for(var t=new Ig(256),e=0;256>e;++e){for(var r=e,n=9;--n;)r=(1&r&&3988292384)^r>>>1;t[e]=r}return t})(),TI=function(t,e,r){for(;r;++e)t[e]=r,r>>>=8};function ROe(t,e){e===void 0&&(e={});var r=(function(){var d=4294967295;return{p(f){for(var p=d,g=0;f.length>g;++g)p=AOe[255&p^f[g]]^p>>>8;d=p},d(){return 4294967295^d}}})(),n=t.length;r.p(t);var i,a,s,o,l,u=(o=10+((i=e).filename&&i.filename.length+1||0),l=8,(function(d,f,p,g,m,y){var v=d.length,x=new Wo(g+v+5*(1+Math.floor(v/7e3))+m),b=x.subarray(g,x.length-m),w=0;if(!f||8>v)for(var C=0;v>=C;C+=65535){var _=C+65535;v>_?w=xI(b,w,d.subarray(C,_)):(b[C]=!0,w=xI(b,w,d.subarray(C,v)))}else{for(var k=_Oe[f-1],S=k>>>13,L=8191&k,$=(1<C;++C){var H=R(C),W=32767&C,ie=z[H];if(I[W]=ie,z[H]=W,C>=G){var j=v-C;if((O>7e3||P>24576)&&j>423){w=GJ(d,b,0,N,M,D,B,P,V,C-V,w),P=O=B=0,V=C;for(var ae=0;286>ae;++ae)M[ae]=0;for(ae=0;30>ae;++ae)D[ae]=0}var J=2,K=0,Q=L,re=W-ie&32767;if(j>2&&H==R(C-re))for(var le=Math.min(S,j)-1,fe=Math.min(32767,C),Ae=Math.min(258,j);fe>=re&&--Q&&W!=ie;){if(d[C+J]==d[C+J-re]){for(var Se=0;Ae>Se&&d[C+Se]==d[C+Se-re];++Se);if(Se>J){if(J=Se,K=re,Se>le)break;var Ne=Math.min(re,Se-2),ge=0;for(ae=0;Ne>ae;++ae){var ve=C-re+ae+32768&32767,ze=ve-I[ve]+32768&32767;ze>ge&&(ge=ze,ie=ve)}}}re+=(W=ie)-(ie=I[W])+32768&32767}if(K){N[P++]=268435456|yI[J]<<18|OJ[K];var xe=31&yI[J],Ke=31&OJ[K];B+=gI[xe]+mI[Ke],++M[257+xe],++D[Ke],G=C+J,++O}else N[P++]=d[C],++M[d[C]]}}w=GJ(d,b,!0,N,M,D,B,P,V,C-V,w)}return FJ(x,0,g+BJ(w)+m)})(a=t,(s=e).level==null?6:s.level,s.mem==null?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(a.length)))):12+s.mem,o,l)),h=u.length;return(function(d,f){var p=f.filename;if(d[0]=31,d[1]=139,d[2]=8,d[8]=2>f.level?4:f.level==9?2:0,d[9]=3,f.mtime!=0&&TI(d,4,Math.floor(new Date(f.mtime||Date.now())/1e3)),p){d[3]=8;for(var g=0;p.length>=g;++g)d[g+10]=p.charCodeAt(g)}})(u,e),TI(u,h-8,r.d()),TI(u,h-4,n),u}var LOe=!!cL||!!lL,qJ="text/plain",t5=!1,VJ=(t,e)=>{var r=t.split("#"),n=r[1],i=r[0].split("?"),a=i[0],s=i[1];if(!s)return t;var o=s.split("&").filter((l=>l.split("=")[0]!==e)).join("&");return a+(o?"?"+o:"")+(n?"#"+n:"")},r5=function(t,e,r){var n;r===void 0&&(r=!0);var i=t.split("?"),a=i[0],s=i[1],o=wt({},e),l=(n=s==null?void 0:s.split("&").map((h=>{var d,f=h.split("="),p=f[0],g=r&&(d=o[p])!==null&&d!==void 0?d:f[1];return delete o[p],p+"="+g})))!==null&&n!==void 0?n:[],u=(function(h,d){var f,p;d===void 0&&(d="&");var g=[];return Ln(h,(function(m,y){Nt(m)||Nt(y)||y==="undefined"||(f=encodeURIComponent((v=>v instanceof File)(m)?m.name:m.toString()),p=encodeURIComponent(y),g[g.length]=p+"="+f)})),g.join(d)})(o);return u&&l.push(u),l.length>0?a+"?"+l.join("&"):a},wI=t=>{if(t.Vr)return t.Vr;var e=t.data,r=t.compression;if(e){if(r===xs.GZipJS){var n=ROe((function(o,l){var u=o.length;if(typeof TextEncoder<"u")return new TextEncoder().encode(o);for(var h=new Wo(o.length+(o.length>>>1)),d=0,f=function(y){h[d++]=y},p=0;u>p;++p){if(d+5>h.length){var g=new Wo(d+8+(u-p<<1));g.set(h),h=g}var m=o.charCodeAt(p);128>m?f(m):2048>m?(f(192|m>>>6),f(128|63&m)):m>55295&&57344>m?(f(240|(m=65536+(1047552&m)|1023&o.charCodeAt(++p))>>>18),f(128|m>>>12&63),f(128|m>>>6&63),f(128|63&m)):(f(224|m>>>12),f(128|m>>>6&63),f(128|63&m))}return FJ(h,0,d)})(_g(e)),{mtime:0});return{contentType:qJ,body:n.buffer.slice(n.byteOffset,n.byteOffset+n.byteLength),estimatedSize:n.byteLength}}if(r===xs.Base64){var i=(function(o){return o&&btoa(encodeURIComponent(o).replace(/%([0-9A-F]{2})/g,((l,u)=>String.fromCharCode(parseInt(u,16)))))})(_g(e)),a=(o=>"data="+encodeURIComponent(typeof o=="string"?o:_g(o)))(i);return{contentType:"application/x-www-form-urlencoded",body:a,estimatedSize:new Blob([a]).size}}var s=_g(e);return{contentType:"application/json",body:s,estimatedSize:new Blob([s]).size}}},WJ=t=>{var e,r,n=()=>t.transport==="sendBeacon"?{url:r5(t.url,{compression:xs.Base64}),encodedBody:wI(wt({},t,{compression:xs.Base64,Vr:void 0}))}:{url:VJ(t.url,"compression"),encodedBody:wI(wt({},t,{compression:void 0,Vr:void 0}))};try{e=wI(t)}catch(i){if(WZ(t.compression,Ag(t.url,"compression")))return Pt.error("Failed to gzip request body, sending uncompressed payload",i),n();throw i}return e&&WZ(t.compression,Ag(t.url,"compression"))&&!((r=e.body)instanceof ArrayBuffer?uL(new Uint8Array(r)):ArrayBuffer.isView(r)&&uL(new Uint8Array(r.buffer,r.byteOffset,r.byteLength)))?(t5=!0,n()):{url:t.url,encodedBody:e}},UJ=t=>{try{return WJ(t)}catch(e){return Pt.error(e),void(t.callback==null||t.callback({statusCode:0,error:e}))}},IOe=(function(){var t=jn((function*(e){var r=_g(e.data),n=yield(function(a,s,o){return hL.apply(this,arguments)})(r,vn.DEBUG,{rethrow:!0});if(!n)return e;var i=yield n.arrayBuffer();return wt({},e,{Vr:{contentType:qJ,body:i,estimatedSize:i.byteLength}})}));return function(e){return t.apply(this,arguments)}})(),DOe=/Failed to fetch|NetworkError|Load failed/i,HJ=t=>{var e=UJ(t);if(e){var r=e.url,n=e.encodedBody,i=n??{},a=i.contentType,s=i.body,o=i.estimatedSize,l=new Headers;Ln(t.headers,(function(g,m){l.append(m,g)})),a&&l.append("Content-Type",a);var u=null,h=!1;if($Z){var d=new $Z;u={signal:d.signal,timeout:setTimeout((()=>{var g,m;h=!0,d.abort((g=t.timeout,(m=new Error("PostHog request timed out"+(g?" after "+g+"ms":""))).name="AbortError",m))}),t.timeout)}}var f=g=>{h&&(g==null?void 0:g.name)==="AbortError"||(m=>(m==null?void 0:m.name)==="TypeError"&&DOe.test((m==null?void 0:m.message)||""))(g)?Pt.warn(g):Pt.error(g),t.callback==null||t.callback({statusCode:0,error:g})};try{var p;lL(r,wt({method:(t==null?void 0:t.method)||"GET",headers:l,keepalive:t.method==="POST"&&!t.Wr&&52428.8>(o||0),body:s,signal:(p=u)==null?void 0:p.signal},t.fetchOptions)).then((g=>g.text().then((m=>{var y={statusCode:g.status,text:m};if(g.status===200)try{y.json=JSON.parse(m)}catch(v){Pt.error(v)}t.callback==null||t.callback(y)})))).catch(f).finally((()=>u?clearTimeout(u.timeout):null))}catch(g){u&&clearTimeout(u.timeout),f(g)}}},CI=t=>{try{var e,r=WJ(t),n=r.url,i=r.encodedBody,a=i??{},s=a.body,o=a.estimatedSize;if(!s)return;var l=s instanceof Blob?s:new Blob([s],{type:a.contentType});if(vs.sendBeacon(n,l))return;var u=Br(t.data)?t.data:(e=t.data)==null?void 0:e.batch;if(Br(u)&&u.length>1&&(o??0)>16384){var h=Math.ceil(u.length/2),d=f=>Br(t.data)?f:wt({},t.data,{batch:f});return CI(wt({},t,{data:d(u.slice(0,h))})),void CI(wt({},t,{data:d(u.slice(h))}))}Pt.warn("Beacon of ~"+(o??0)+" bytes was rejected by the browser, falling back to fetch"),HJ(wt({},t,{Wr:!0}))}catch(f){Pt.warn("Beacon send failed",f)}},YJ=(t,e,r,n)=>{var i=n==="query"?e==="POST"?"sent_at":"_":void 0;return r5(r===xs.GZipJS?VJ(t,"compression"):t,wt({},i?{[i]:Date.now().toString()}:{},r===xs.GZipJS?{}:{compression:r}))},n5=[];lL&&n5.push({transport:"fetch",method:HJ}),cL&&n5.push({transport:"XHR",method(t){var e=UJ(t);if(e){var r=new cL,n=e.encodedBody;r.open(t.method||"GET",e.url,!0);var i=n??{},a=i.contentType,s=i.body;Ln(t.headers,(function(o,l){r.setRequestHeader(l,o)})),a&&r.setRequestHeader("Content-Type",a),t.timeout&&(r.timeout=t.timeout),r.onreadystatechange=()=>{if(r.readyState===4){var o={statusCode:r.status,text:r.responseText};if(r.status===200)try{o.json=JSON.parse(r.responseText)}catch{}t.callback==null||t.callback(o)}},r.send(s)}}}),vs!=null&&vs.sendBeacon&&n5.push({transport:"sendBeacon",method:CI});var kI=3e3;class MOe{constructor(e,r){this.Zr=!0,this.Gr=[],this.Qr=oc((r==null?void 0:r.flush_interval_ms)||kI,250,5e3,Pt.createLogger("flush interval"),kI),this.Jr=e}enqueue(e){this.Gr.push(e),this.Kr||this.Yr()}unload(){this.Xr();var e=this.Gr.length>0?this.ti():{},r=Object.values(e);[...r.filter((n=>n.url.indexOf("/e")===0)),...r.filter((n=>n.url.indexOf("/e")!==0))].map((n=>{this.ei(wt({},n,{transport:"sendBeacon"}))}))}enable(){this.Zr=!1,this.Yr()}Yr(){var e=this;this.Zr||(this.Kr=setTimeout((()=>{if(this.Xr(),this.Gr.length>0){var r=this.ti(),n=function(){var a=r[i],s=new Date().getTime();a.data&&Br(a.data)&&Ln(a.data,(o=>{o.offset=Math.abs(o.timestamp-s),delete o.timestamp})),e.ei(a)};for(var i in r)n()}}),this.Qr))}ei(e){try{this.Jr(e)}catch(r){Pt.error(r)}}Xr(){clearTimeout(this.Kr),this.Kr=void 0}ti(){var e={};return Ln(this.Gr,(r=>{var n,i=r,a=(i?i.batchKey:null)||i.url;Nt(e[a])&&(e[a]=wt({},i,{data:[]})),(n=e[a].data)==null||n.push(i.data)})),this.Gr=[],e}}var NOe=["retriesPerformedSoFar"];class $Oe{constructor(e){this.ri=!1,this.ii=3e3,this.Gr=[],this._instance=e,this.Gr=[],this.ni=!0,!Nt(at)&&"onLine"in at.navigator&&(this.ni=at.navigator.onLine,this.si=()=>{this.ni=!0,this.oi()},this.ai=()=>{this.ni=!1},ui(at,"online",this.si),ui(at,"offline",this.ai))}get length(){return this.Gr.length}retriableRequest(e){var r=e.retriesPerformedSoFar,n=BZ(e,NOe);gu(r)&&(n.url=r5(n.url,{retry_count:r})),this._instance._send_request(wt({},n,{callback:i=>{if(i.statusCode!==200&&(400>i.statusCode||i.statusCode>=500)){if((i.statusCode===0?3:10)>(r??0))return void this.Ot(wt({retriesPerformedSoFar:r},n));i.statusCode===0&&Pt.warn("Request failed before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped retrying after "+(r??0)+" retries.")}n.callback==null||n.callback(i)}}))}Ot(e){var r=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=r+1;var n=(function(s){var o=3e3*Math.pow(2,s),l=o/2,u=Math.min(18e5,o),h=Math.random()-.5;return Math.ceil(u+h*(u-l))})(r),i=Date.now()+n;this.Gr.push({retryAt:i,requestOptions:e});var a="Enqueued failed request for retry in "+n;navigator.onLine||(a+=" (Browser is offline)"),Pt.warn(a),this.ri||(this.ri=!0,this.li())}li(){if(this.ui&&clearTimeout(this.ui),this.Gr.length===0)return this.ri=!1,void(this.ui=void 0);this.ui=setTimeout((()=>{this.ni&&this.Gr.length>0&&this.oi(),this.li()}),this.ii)}oi(){var e=Date.now(),r=[],n=this.Gr.filter((a=>e>a.retryAt||(r.push(a),!1)));if(this.Gr=r,n.length>0)for(var i of n)this.retriableRequest(i.requestOptions)}unload(){for(var e of(this.ui&&(clearTimeout(this.ui),this.ui=void 0),this.ri=!1,Nt(at)||(this.si&&(at.removeEventListener("online",this.si),this.si=void 0),this.ai&&(at.removeEventListener("offline",this.ai),this.ai=void 0)),this.Gr)){var r=e.requestOptions;try{this._instance._send_request(wt({},r,{transport:"sendBeacon"}))}catch(n){Pt.error(n)}}this.Gr=[]}}class OOe{constructor(e){this.hi=()=>{var r,n,i,a;this.di||(this.di={});var s=this.scrollElement(),o=this.scrollY(),l=s?Math.max(0,s.scrollHeight-s.clientHeight):0,u=o+((s==null?void 0:s.clientHeight)||0),h=(s==null?void 0:s.scrollHeight)||0;this.di.lastScrollY=Math.ceil(o),this.di.maxScrollY=Math.max(o,(r=this.di.maxScrollY)!==null&&r!==void 0?r:0),this.di.maxScrollHeight=Math.max(l,(n=this.di.maxScrollHeight)!==null&&n!==void 0?n:0),this.di.lastContentY=u,this.di.maxContentY=Math.max(u,(i=this.di.maxContentY)!==null&&i!==void 0?i:0),this.di.maxContentHeight=Math.max(h,(a=this.di.maxContentHeight)!==null&&a!==void 0?a:0)},this._instance=e}get ci(){return this._instance.config.scroll_root_selector}getContext(){return this.di}resetContext(){var e=this.di;return setTimeout(this.hi,0),e}startMeasuringScrollPosition(){ui(at,"scroll",this.hi,{capture:!0}),ui(at,"scrollend",this.hi,{capture:!0}),ui(at,"resize",this.hi)}scrollElement(){if(!this.ci)return at==null?void 0:at.document.documentElement;var e=Br(this.ci)?this.ci:[this.ci];for(var r of e){var n=at==null?void 0:at.document.querySelector(r);if(n)return n}}vi(e){var r=e==="y"?"scrollTop":"scrollLeft";if(this.ci){var n=this.scrollElement();return n&&n[r]||0}return at?e==="y"?at.scrollY||at.pageYOffset||at.document.documentElement.scrollTop||0:at.scrollX||at.pageXOffset||at.document.documentElement.scrollLeft||0:0}scrollY(){return this.vi("y")}scrollX(){return this.vi("x")}}var POe=t=>_J(t==null?void 0:t.config.mask_personal_data_properties,t==null?void 0:t.config.custom_personal_data_properties,t==null?void 0:t.config.disable_capture_url_hashes);class XJ{constructor(e,r,n,i){this.fi=a=>{var s=this.pi();if(!s||s.sessionId!==a){var o={sessionId:a,props:this.gi(this._instance)};this.mi.register({[YL]:o})}},this._instance=e,this.yi=r,this.mi=n,this.gi=i||POe,this.yi.onSessionId(this.fi)}pi(){return this.mi.props[YL]}getSetOnceProps(){var e,r=(e=this.pi())==null?void 0:e.props;return r?"r"in r?AJ(r,this._instance.config.disable_capture_url_hashes):{$referring_domain:r.referringDomain,$pathname:r.initialPathName,utm_source:r.utm_source,utm_campaign:r.utm_campaign,utm_medium:r.utm_medium,utm_content:r.utm_content,utm_term:r.utm_term}:{}}getSessionProps(){var e={};return Ln(tI(this.getSetOnceProps()),((r,n)=>{n==="$current_url"&&(n="url"),e["$session_entry_"+dL(n)]=r})),e}}class EI{on(e,r){return this.bi[e]||(this.bi[e]=[]),this.bi[e].push(r),()=>{this.bi[e]=this.bi[e].filter((n=>n!==r))}}emit(e,r){for(var n of this.bi[e]||[])n(r);for(var i of this.bi["*"]||[])i(e,r)}constructor(){this.bi={}}}var hT=Zn("[SessionId]");class jJ{on(e,r){return this.wi.on(e,r)}constructor(e,r,n){var i;if(this.xi=null,this.ki=[],this.Si=void 0,this.Ci=!1,this.wi=new EI,this.Mi=(u,h)=>!(!gu(u)||!gu(h))&&Math.abs(u-h)>this.sessionTimeoutMs,!e.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(e.config.cookieless_mode===vu)throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.Te=e.config,this.mi=e.persistence,this.Ii=void 0,this.Ti=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.Ei=r||bu,this.Ri=n||bu;var a=this.Te.persistence_name||this.Te.token;if(this._sessionTimeoutMs=1e3*oc(this.Te.session_idle_timeout_seconds||1800,60,36e3,hT.createLogger("session_idle_timeout_seconds"),1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.Pi(),this.Oi="ph_"+a+"_window_id",this.Fi="ph_"+a+"_primary_window_exists",this.Ai()){var s=$a.F(this.Oi),o=$a.F(this.Fi);s&&!o?this.Ii=s:$a.D(this.Oi),$a.A(this.Fi,!0)}if((i=this.Te.bootstrap)!=null&&i.sessionID)try{var l=(u=>{var h=this.Te.bootstrap.sessionID.replace(/-/g,"");if(h.length!==32)throw new Error("Not a valid UUID");if(h[12]!=="7")throw new Error("Not a UUIDv7");return parseInt(h.substring(0,12),16)})();this.$i(this.Te.bootstrap.sessionID,new Date().getTime(),l)}catch(u){hT.error("Invalid sessionID in bootstrap",u)}this.Li()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return Nt(this.ki)&&(this.ki=[]),this.ki.push(e),this.Ti&&e(this.Ti,this.Ii),()=>{this.ki=this.ki.filter((r=>r!==e))}}Ai(){return this.Te.persistence!=="memory"&&!this.mi.yr&&$a.N()}Di(e){e!==this.Ii&&(this.Ii=e,this.Ai()&&$a.A(this.Oi,e))}Ni(){return this.Ii?this.Ii:this.Ai()?$a.F(this.Oi):null}qi(e){var r=this.xi;return!bs(r)&&!bs(e)&&5e3>Math.abs(e-r)}$i(e,r,n){var i=r!==this._sessionActivityTimestamp,a=!(e!==this.Ti||n!==this._sessionStartTimestamp);this._sessionStartTimestamp=n,this._sessionActivityTimestamp=r,this.Ti=e,a&&!i||a&&this.qi(r)||(this.xi=r,this.mi.register({[Cg]:[r,e,n]}))}ji(){var e,r=(e=this.Te)==null?void 0:e.persistence_save_debounce_ms;return gu(r)&&r>0}Bi(){this.ji()?this.mi.refreshKey(Cg):(this.mi.flush(),this.mi.load())}Hi(){var e;if(!bs(this._sessionActivityTimestamp)&&this._sessionActivityTimestamp!==this.xi){this.Bi();var r=this.Ui();r[1]===this.Ti&&r[2]===this._sessionStartTimestamp&&(this.xi=this._sessionActivityTimestamp,this.mi.register({[Cg]:[this._sessionActivityTimestamp,(e=this.Ti)!==null&&e!==void 0?e:null,this._sessionStartTimestamp]}),this.mi.flush())}}zi(){var e=this.Ui()[0],r=gu(e)?e:0,n=gu(this._sessionActivityTimestamp)?this._sessionActivityTimestamp:0;return Math.max(r,n)}Vi(e){return this.Bi(),this.Mi(e,this.zi())}Ui(){var e=this.mi.props[Cg];return Br(e)&&e.length===2&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this.xi=null,clearTimeout(this.Wi),this.Wi=void 0,this.$i(null,null,null)}destroy(){this.Ci=!0,this.Hi(),clearTimeout(this.Wi),this.Wi=void 0,this.Si&&at&&(at.removeEventListener(qE,this.Si,{capture:!1}),this.Si=void 0),this.ki=[]}Li(){this.Si=()=>{this.Hi(),this.Ai()&&$a.D(this.Fi)},ui(at,qE,this.Si,{capture:!1})}checkAndGetSessionAndWindowId(e,r){if(e===void 0&&(e=!1),r===void 0&&(r=null),this.Te.cookieless_mode===vu)throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var n=r||new Date().getTime(),i=this.Ui(),a=i[1],s=i[2],o=this.zi(),l=this.Ni(),u=gu(s)&&Math.abs(n-s)>864e5,h=!1,d=!1,f=!a,p=a,g=!f&&!e&&this.Mi(n,o);if(g){(g=this.Vi(n))||hT.info("cross-tab refresh kept the session alive",{sessionId:a});var m=this.Ui();a=m[1],s=m[2]}f||g||u?(a=this.Ei(),l=this.Ri(),hT.info("new session ID generated",{sessionId:a,windowId:l,changeReason:{noSessionId:f,activityTimeout:g,sessionPastMaximumLength:u}}),s=n,h=!0):(l||(l=this.Ri(),h=!0),(d=a!==p)&&(hT.info("adopted cross-tab session id",{sessionId:a,windowId:l}),h=!0));var y=gu(o)&&e&&!u?o:n,v=gu(s)?s:new Date().getTime();this.Di(l),this.$i(a,y,v),e||this.Pi();var x={noSessionId:f,activityTimeout:g,sessionPastMaximumLength:u,crossTabAdoption:d};return h&&this.ki.forEach((b=>b(a,l,x))),{sessionId:a,windowId:l,sessionStartTimestamp:v,changeReason:h?x:void 0,lastActivityTimestamp:o}}Pi(){this.Ci||(clearTimeout(this.Wi),this.Wi=setTimeout((()=>{if(!this.Ci)if(this.Vi(new Date().getTime())){var e=this.Ti;this.resetSessionId(),this.wi.emit("forcedIdleReset",{idleSessionId:e})}else this.Pi()}),1.1*this.sessionTimeoutMs))}}var KJ=function(t,e){if(!t)return!1;var r=t.userAgent;if(r&&HZ(r,e))return!0;try{var n=t==null?void 0:t.userAgentData;if(n!=null&&n.brands&&n.brands.some((i=>HZ(i==null?void 0:i.brand,e))))return!0}catch{}return!!t.webdriver};function ZJ(){return(ZJ=jn((function*(){var t=vs==null?void 0:vs.userAgentData;if(t!=null&&t.getHighEntropyValues)try{var e=yield t.getHighEntropyValues(["model"]),r=e==null?void 0:e.model;return Rn(r)&&r.length>0?r:void 0}catch(n){return void Pt.info("Unable to resolve $device_model from userAgentData.getHighEntropyValues",n)}}))).apply(this,arguments)}var i5=function(t,e){if(!(function(r){try{new RegExp(r)}catch{return!1}return!0})(e))return!1;try{return new RegExp(e).test(t)}catch{return!1}};function SI(t,e,r){return _g({distinct_id:t,userPropertiesToSet:e,userPropertiesToSetOnce:r})}var QJ={exact:(t,e)=>e.some((r=>t.some((n=>r===n)))),is_not:(t,e)=>e.every((r=>t.every((n=>r!==n)))),regex:(t,e)=>e.some((r=>t.some((n=>i5(r,n))))),not_regex:(t,e)=>e.every((r=>t.every((n=>!i5(r,n))))),icontains:(t,e)=>e.map(a5).some((r=>t.map(a5).some((n=>r.includes(n))))),not_icontains:(t,e)=>e.map(a5).every((r=>t.map(a5).every((n=>!r.includes(n))))),gt:(t,e)=>e.some((r=>{var n=parseFloat(r);return!isNaN(n)&&t.some((i=>n>parseFloat(i)))})),lt:(t,e)=>e.some((r=>{var n=parseFloat(r);return!isNaN(n)&&t.some((i=>nt.toLowerCase();function JJ(t,e){return!t||Object.entries(t).every((r=>{var n=r[1],i=e==null?void 0:e[r[0]];if(Nt(i)||bs(i))return!1;var a=[String(i)],s=QJ[n.operator];return!!s&&s(n.values,a)}))}var _I="custom",eee="i.posthog.com",BOe=/^\/static\//;class FOe{constructor(e){this.Zi={},this.instance=e}get apiHost(){var e=this.instance.config.api_host.trim().replace(/\/$/,"");return e==="https://app.posthog.com"?"https://us.i.posthog.com":e}get flagsApiHost(){var e=this.instance.config.flags_api_host;return e?e.trim().replace(/\/$/,""):this.apiHost}get uiHost(){var e,r=(e=this.instance.config.ui_host)==null?void 0:e.replace(/\/$/,"");return r||(r=this.apiHost.replace("."+eee,".posthog.com")),r==="https://app.posthog.com"?"https://us.posthog.com":r}get region(){return this.Zi[this.apiHost]||(this.Zi[this.apiHost]=/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?"us":/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?"eu":_I),this.Zi[this.apiHost]}Gi(e){if(BOe.test(e)){var r=this.instance.config.asset_host;if(typeof r=="string")return r.trim().replace(/\/$/,"")||void 0}}endpointFor(e,r){if(r===void 0&&(r=""),r&&(r=r[0]==="/"?r:"/"+r),e==="ui")return this.uiHost+r;if(e==="flags")return this.flagsApiHost+r;if(e==="assets"){var n=this.Gi(r);if(n)return""+n+r}if(this.region===_I)return this.apiHost+r;var i=eee+r;switch(e){case"assets":return"https://"+this.region+"-assets."+i;case"api":return"https://"+this.region+"."+i}}}function tee(t){var e;return!((e=t.conditions)==null||(e=e.events)==null||(e=e.values)==null||!e.length)}var kn=Zn("[Surveys]"),ree="seenSurvey_",nee=t=>{try{var e=(r=>((n,i)=>""+ree+(function(a){return a.current_iteration&&a.current_iteration>0?a.id+"_"+a.current_iteration:a.id})(i))(0,r))(t);if(localStorage.getItem(e))return;localStorage.setItem(e,"true")}catch(r){kn.error("Failed to persist survey seen state",r)}},zOe=[dI.Popover,dI.Widget,dI.API],GOe={ignoreConditions:!1,ignoreDelay:!1,displayType:pI.Popover},qOe=Zn("[PostHog ExternalIntegrations]"),VOe={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class WOe{constructor(e){this._instance=e}tr(e,r){var n;(n=fr.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,e,(i=>{if(i)return qOe.error("failed to load script",i);r()}))}startIfEnabledOrStop(){var e=this,r=function(){var a,s,o,l=n[0],u=n[1];!u||(a=fr.__PosthogExtensions__)!=null&&(a=a.integrations)!=null&&a[l]||e.tr(VOe[l],(()=>{var h;(h=fr.__PosthogExtensions__)==null||(h=h.integrations)==null||(h=h[l])==null||h.start(e._instance)})),!u&&(s=fr.__PosthogExtensions__)!=null&&(s=s.integrations)!=null&&s[l]&&((o=fr.__PosthogExtensions__)==null||(o=o.integrations)==null||(o=o[l])==null||o.stop())};for(var n of Object.entries((i=this._instance.config.integrations)!==null&&i!==void 0?i:{})){var i;r()}}}class UOe{constructor(e,r){this.it=e,this.Qi=r,this.Ji=new Map,this.Ki=!1}add(e){var r=this;return jn((function*(){if(r.Ki)throw new Error("Cannot add an extension to a disposed ExtensionRuntime");if(r.Ji.has(e.name))throw new Error('Browser extension "'+e.name+'" is already registered');r.Ji.set(e.name,e);try{var n=e.setup(r.Qi);n&&(yield n)}catch(a){var i=r.Ji.get(e.name)===e;i&&r.Ji.delete(e.name),r.it.error('Failed to set up browser extension "'+e.name+'"',a),i&&r.Yi(e)}}))()}dispose(){if(!this.Ki){this.Ki=!0;var e=Array.from(this.Ji.values()).reverse();for(var r of(this.Ji.clear(),e))this.Yi(r)}}Yi(e){try{var r=e.dispose==null?void 0:e.dispose();r&&bo(r.then)&&r.then(void 0,(n=>{this.it.error('Failed to dispose browser extension "'+e.name+'"',n)}))}catch(n){this.it.error('Failed to dispose browser extension "'+e.name+'"',n)}}}class HOe{constructor(e){this._instance=e}get(e){var r;return(r=this._instance.persistence)==null?void 0:r.get_property(e)}set(e,r){var n;(n=this._instance.persistence)==null||n.set_property(e,r)}remove(e){var r;(r=this._instance.persistence)==null||r.unregister(e)}}var iee="extensionsRemoteConfig";class YOe{constructor(e){this.Ki=!1,this.instance=e,this.it=Pt.createLogger("[BrowserExtensions]"),this.Xi=e.tn,this.kv=new HOe(e),this.onEvent=r=>JE(this.instance.on("eventCaptured",(n=>{try{r({event:n.event,properties:n.properties})}catch(i){this.it.error("Browser extension event listener failed",i)}}))),this.onRemoteConfig=r=>{if(this.Ki)return JE((()=>{}));var n=a=>{try{r(a)}catch(s){this.it.error("Browser extension remote config listener failed",s)}},i=this.instance.en.on(iee,n);return this.Xi&&n(this.Xi),JE(i)},this.rn=new UOe(this.it,this)}get logger(){return this.it}get distinctId(){return this.instance.get_distinct_id()}get anonymousId(){var e;return(e=this.instance.get_property(jx))!==null&&e!==void 0?e:this.distinctId}get groups(){return this.instance.getGroups()}get session(){try{var e,r,n,i,a=(e=this.instance.sessionManager)==null?void 0:e.checkAndGetSessionAndWindowId(!0);return{sessionId:(r=a==null?void 0:a.sessionId)!==null&&r!==void 0?r:"",windowId:(n=a==null?void 0:a.windowId)!==null&&n!==void 0?n:"",sessionStartTimestamp:(i=a==null?void 0:a.sessionStartTimestamp)!==null&&i!==void 0?i:0}}catch{return{sessionId:"",windowId:"",sessionStartTimestamp:0}}}get projectToken(){return this.instance.config.token}add(e){return this.rn.add(e)}capture(e,r,n){var i=this;return jn((function*(){n?i.instance.capture(e,r,{timestamp:n.timestamp,uuid:n.uuid,$set:n.set,$set_once:n.setOnce}):i.instance.capture(e,r)}))()}registerDynamicEventProperties(e){return JE(this.instance.nn(e))}handleRemoteConfig(e){this.Ki||(this.Xi=e,this.instance.en.emit(iee,e))}sendRequest(e,r){var n=this;return jn((function*(){var i;r===void 0&&(r={});var a=n.instance.requestRouter.endpointFor((i=r.target)!==null&&i!==void 0?i:"api",e),s={method:r.method,url:r.query?r5(a,r.query):a,data:r.body,headers:r.headers,timeout:r.timeoutMs,fireCallbackOnDrop:!0,transport:r.transport};return r.transport==="sendBeacon"?(n.instance._send_request(s),{statusCode:202}):new Promise((o=>{s.callback=o,n.instance._send_request(s)}))}))()}dispose(){this.Ki||(this.Ki=!0,this.rn.dispose())}}var dT={},AI=0,s5=()=>{},aee='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',fT="Surveys module not available",see="sanitize_properties is deprecated. Use before_send instead",oee="Invalid value for property_denylist config: ",XOe=["token","distinct_id",BQ],Mg="posthog",lee=!LOe&&(Ks==null?void 0:Ks.indexOf("MSIE"))===-1&&(Ks==null?void 0:Ks.indexOf("Mozilla"))===-1,RI=t=>{var e;return wt({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,asset_host:null,token:"",autocapture:!0,cross_subdomain_cookie:j$e(Wt==null?void 0:Wt.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:s5,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:"if_capture_pageview",defaults:t??"unset",__preview_deferred_init_extensions:!1,__preview_external_dependency_versioned_paths:!1,__preview_cookie_wins_on_conflict:!1,debug:Ni&&Rn(Ni==null?void 0:Ni.search)&&Ni.search.indexOf("__posthog_debug=true")!==-1||!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,disable_surveys_automatic_display:!1,disable_conversations:!1,disable_product_tours:!1,disableDeviceModel:!1,disable_external_dependency_loading:!1,strict_script_versioning:!1,enable_recording_console_log:void 0,secure_cookie:(at==null||(e=at.location)==null?void 0:e.protocol)==="https:",ip:!1,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",consent_persistence_name:null,opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_flags:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_only_evaluate_survey_feature_flags:!1,advanced_feature_flags_dedup_per_session:!1,advanced_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error(r){Pt.error("Bad HTTP status: "+r.statusCode+" "+r.text)},get_device_id:r=>r,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:QL,before_send:void 0,get_current_url:void 0,request_queue_config:{flush_interval_ms:kI},error_tracking:{},_onCapture:s5},(r=>({rageclick:r&&r>="2026-05-30"?{content_ignorelist:oOe,ignore_text_selection:!0}:!r||"2025-11-30">r||{content_ignorelist:!0},capture_pageview:!r||"2025-05-24">r||"history_change",session_recording:r&&r>="2026-06-25"?{strictMinimumDuration:!0,canvasCapture:{resolutionScale:.6},streamNetworkBody:!0}:r&&r>="2026-05-30"?{strictMinimumDuration:!0,canvasCapture:{resolutionScale:.6}}:r&&r>="2025-11-30"?{strictMinimumDuration:!0}:{},external_scripts_inject_target:r&&r>="2026-01-30"?"head":"body",internal_or_test_user_hostname:r&&r>="2026-01-30"?/^(localhost|127\.0\.0\.1)$/:void 0,persistence_save_debounce_ms:r&&r>="2026-05-30"?250:0,split_storage:!(!r||"2026-05-30">r),detect_google_search_app:!(!r||"2026-05-30">r),disable_capture_url_hashes:!(!r||"2026-06-25">r)}))(t))},jOe=[["process_person","person_profiles"],["xhr_headers","request_headers"],["cookie_name","persistence_name"],["disable_cookie","disable_persistence"],["__preview_disable_beacon","disable_beacon"],["store_google","save_campaign_params"],["verbose","debug"]],cee=t=>{var e={};for(var r of jOe){var n=r[0],i=r[1];Nt(t[n])||(e[i]=t[n])}var a=Nn({},e,t),s=t.__preview_external_dependency_versioned_paths;return Nt(s)||(Nt(t.strict_script_versioning)&&(a.strict_script_versioning=!!s),Rn(s)&&Nt(t.asset_host)&&(a.asset_host=s)),Br(t.property_blacklist)&&(Nt(t.property_denylist)?a.property_denylist=t.property_blacklist:Br(t.property_denylist)?a.property_denylist=[...t.property_blacklist,...t.property_denylist]:Pt.error(oee+t.property_denylist)),a};class KOe{constructor(){this.__forceAllowLocalhost=!1}get sn(){return this.__forceAllowLocalhost}set sn(e){Pt.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}class Uo{an(e,r){if(e){var n=this.Ji.indexOf(e);n!==-1&&this.Ji.splice(n,1)}return this.Ji.push(r),r.initialize==null||r.initialize(),r}ln(){return this.config.cookieless_mode===vu||this.config.cookieless_mode===Cf&&this.consent.isRejected()}get decideEndpointWasHit(){var e,r;return(e=(r=this.featureFlags)==null?void 0:r.hasLoadedFlags)!==null&&e!==void 0&&e}get flagsEndpointWasHit(){var e,r;return(e=(r=this.featureFlags)==null?void 0:r.hasLoadedFlags)!==null&&e!==void 0&&e}constructor(){var e;this.webPerformance=new KOe,this.un=!1,this.version=vn.LIB_VERSION,this.en=new EI,this.Ji=[],this.hn=[],this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=RI(),this.SentryIntegration=gOe,this.sentryIntegration=n=>(function(i,a){var s=vJ(i,a);return{name:yJ,processEvent:o=>s(o)}})(this,n),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.dn=!1,this.cn=null,this.vn=null,this.fn=null,this.scrollManager=new OOe(this),this.pageViewManager=new bJ(this),this.rateLimiter=new kOe(this),this.requestRouter=new FOe(this),this.consent=new rOe(this),this.externalIntegrations=new WOe(this);var r=(e=Uo.__defaultExtensionClasses)!==null&&e!==void 0?e:{};this.featureFlags=r.featureFlags&&new r.featureFlags(this),this.toolbar=r.toolbar&&new r.toolbar(this),this.surveys=r.surveys&&new r.surveys(this),this.conversations=r.conversations&&new r.conversations(this),this.logs=r.logs&&new r.logs(this),this.metrics=r.metrics&&new r.metrics(this),this.experiments=r.experiments&&new r.experiments(this),this.exceptions=r.exceptions&&new r.exceptions(this),this.people={set:(n,i,a)=>{var s=Rn(n)?{[n]:i}:n;this.setPersonProperties(s),a==null||a({})},set_once:(n,i,a)=>{var s=Rn(n)?{[n]:i}:n;this.setPersonProperties(void 0,s),a==null||a({})}},this.on("eventCaptured",(n=>Pt.info('send "'+(n==null?void 0:n.event)+'"',n)))}init(e,r,n){if(n&&n!==Mg){var i,a=(i=dT[n])!==null&&i!==void 0?i:new Uo;return a._init(e,r,n),dT[n]=a,dT[Mg][n]=a,a}return this._init(e,r,n)}_init(e,r,n){var i,a;r===void 0&&(r={});var s=Rn(e)?e.trim():"";if(!s)return Pt.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;if(this.__loaded)return console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config=RI(r.defaults),r.debug=this.pn(r.debug),this.gn=r,this.mn=[],r.person_profiles?this.vn=r.person_profiles:r.process_person&&(this.vn=r.process_person);var o=RI(r.defaults),l=cee(r),u=Nn({},o,l,{name:n,token:s});Kn(o.rageclick)&&Kn(l.rageclick)&&(u.rageclick=Nn({},o.rageclick,l.rageclick)),Kn(o.session_recording)&&Kn(l.session_recording)&&(u.session_recording=Nn({},o.session_recording,l.session_recording)),this.set_config(u),this.config.on_xhr_error&&Pt.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=r.disable_compression?void 0:xs.GZipJS;var h=this.yn();this.persistence=new hI(this.config,h),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new hI(wt({},this.config,{persistence:"sessionStorage"}),h,!1);var d=wt({},this.persistence.props),f=wt({},this.sessionPersistence.props);this.register({$initialization_time:new Date().toISOString()}),this.bn=new MOe((w=>this._n(w)),this.config.request_queue_config),this.wn=new $Oe(this),this.__request_queue=[];var p=this.ln();if(p||(this.sessionManager=new jJ(this),this.sessionPropsManager=new XJ(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?(Pt.info("Deferring extension initialization to improve startup performance"),setTimeout((()=>{this.xn(p)}),0)):(Pt.info("Initializing extensions synchronously"),this.xn(p)),vn.DEBUG=vn.DEBUG||this.config.debug,vn.DEBUG&&Pt.info("Starting in debug mode",{this:this,config:r,thisC:wt({},this.config),p:d,s:f}),!this.config.identity_distinct_id||(i=r.bootstrap)!=null&&i.distinctID||(r.bootstrap=wt({},r.bootstrap,{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0})),((a=r.bootstrap)==null?void 0:a.distinctID)!==void 0){var g=r.bootstrap.distinctID,m=this.get_distinct_id(),y=this.persistence.get_property(Vo);if(r.bootstrap.isIdentifiedID&&m!=null&&m!==g&&y===Eg)this.identify(g);else if(r.bootstrap.isIdentifiedID&&m!=null&&m!==g&&y===kf)Pt.warn("Bootstrap distinctID differs from an already-identified user. The existing identity is preserved. Call reset() before reinitializing if you intend to switch users.");else{var v=this.config.get_device_id(bu()),x=r.bootstrap.isIdentifiedID?v:g;this.persistence.set_property(Vo,r.bootstrap.isIdentifiedID?kf:Eg),this.register({distinct_id:g,$device_id:x})}}if(p)this.register_once({distinct_id:zE,$device_id:null},"");else if(!this.get_distinct_id()){var b=this.config.get_device_id(bu());this.register_once({distinct_id:b,$device_id:b},""),this.persistence.set_property(Vo,Eg)}return ui(at,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),r.segment?(function(w,C){var _=w.config.segment;if(!_)return C();(function(k,S){var L=k.config.segment;if(!L)return S();var $=z=>{var F=()=>z.anonymousId()||bu();k.config.get_device_id=F,z.id()&&(k.register({distinct_id:z.id(),$device_id:F()}),k.persistence.set_property(Vo,kf)),S()},I=L.user();"then"in I&&bo(I.then)?I.then($):$(I)})(w,(()=>{_.register((k=>{typeof Promise<"u"&&Promise.resolve||cI.warn("This browser does not have Promise support, and can not use the segment integration");var S=(L,$)=>{if(!$)return L;L.event.userId||L.event.anonymousId===k.get_distinct_id()||(cI.info("No userId set, resetting PostHog"),k.reset()),L.event.userId&&L.event.userId!==k.get_distinct_id()&&(cI.info("UserId set, identifying with PostHog"),k.identify(L.event.userId));var I=k.calculateEventProperties($,L.event.properties);return L.event.properties=Object.assign({},I,L.event.properties),L};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:L=>S(L,L.event.event),page:L=>S(L,Sg),identify:L=>S(L,eI),screen:L=>S(L,"$screen")}})(w)).then((()=>{C()}))}))})(this,(()=>this.kn())):this.kn(),bo(this.config._onCapture)&&this.config._onCapture!==s5&&(Pt.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",(w=>this.config._onCapture(w.event,w)))),this.config.ip&&Pt.warn('The `ip` config option has NO EFFECT AT ALL and has been deprecated. Use a custom transformation or "Discard IP data" project setting instead. See https://posthog.com/tutorials/web-redact-properties#hiding-customer-ip-address for more information.'),this.config.disableDeviceModel||(function(){return ZJ.apply(this,arguments)})().then((w=>{w&&this.register({[LL]:w})})).catch(s5),this}xn(e){var r,n,i,a,s,o,l,u,h=performance.now(),d=wt({},Uo.__defaultExtensionClasses,this.config.__extensionClasses),f=[];d.featureFlags&&this.Ji.push(this.featureFlags=(r=this.featureFlags)!==null&&r!==void 0?r:new d.featureFlags(this)),d.exceptions&&this.Ji.push(this.exceptions=(n=this.exceptions)!==null&&n!==void 0?n:new d.exceptions(this)),d.historyAutocapture&&this.Ji.push(this.historyAutocapture=new d.historyAutocapture(this)),d.tracingHeaders&&this.Ji.push(this.tracingHeaders=new d.tracingHeaders(this)),d.siteApps&&this.Ji.push(this.siteApps=new d.siteApps(this)),d.sessionRecording&&!e&&this.Ji.push(this.sessionRecording=new d.sessionRecording(this)),this.config.disable_scroll_properties||f.push((()=>{this.scrollManager.startMeasuringScrollPosition()})),d.autocapture&&this.Ji.push(this.autocapture=new d.autocapture(this)),d.surveys&&this.Ji.push(this.surveys=(i=this.surveys)!==null&&i!==void 0?i:new d.surveys(this)),d.logs&&this.Ji.push(this.logs=(a=this.logs)!==null&&a!==void 0?a:new d.logs(this)),d.metrics&&this.Ji.push(this.metrics=(s=this.metrics)!==null&&s!==void 0?s:new d.metrics(this)),d.conversations&&this.Ji.push(this.conversations=(o=this.conversations)!==null&&o!==void 0?o:new d.conversations(this)),d.productTours&&this.Ji.push(this.productTours=new d.productTours(this)),d.heatmaps&&this.Ji.push(this.heatmaps=new d.heatmaps(this)),d.webVitalsAutocapture&&this.Ji.push(this.webVitalsAutocapture=new d.webVitalsAutocapture(this)),d.exceptionObserver&&this.Ji.push(this.exceptionObserver=new d.exceptionObserver(this)),d.deadClicksAutocapture&&this.Ji.push(this.deadClicksAutocapture=new d.deadClicksAutocapture(this,pOe)),d.toolbar&&this.Ji.push(this.toolbar=(l=this.toolbar)!==null&&l!==void 0?l:new d.toolbar(this)),d.experiments&&this.Ji.push(this.experiments=(u=this.experiments)!==null&&u!==void 0?u:new d.experiments(this)),this.Ji.forEach((p=>{p.initialize&&f.push((()=>{p.initialize==null||p.initialize()}))})),f.push((()=>{if(this.Sn){var p=this.Sn;this.Sn=void 0,this.Ji.forEach((g=>g.onRemoteConfig==null?void 0:g.onRemoteConfig(p)))}})),this.Cn(f,h)}Cn(e,r){for(;e.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-r>=30&&e.length>0)return void setTimeout((()=>{this.Cn(e,r)}),0);var n=e.shift();if(n)try{n()}catch(a){Pt.error("Error initializing extension:",a)}}var i=Math.round(performance.now()-r);this.register_for_session({[FQ]:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",[zQ]:i}),this.config.__preview_deferred_init_extensions&&Pt.info("PostHog extensions initialized ("+i+"ms)")}Br(e){var r;if(!Wt||!Wt.body)return Pt.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((()=>{this.Br(e)}),500);if(this.config.__preview_deferred_init_extensions&&(this.Sn=e),this.tn=e,this.compression=void 0,e.ok){var n,i=e.config;i.supportedCompression&&!this.config.disable_compression&&(this.compression=Rr(i.supportedCompression,xs.GZipJS)?xs.GZipJS:Rr(i.supportedCompression,xs.Base64)?xs.Base64:void 0),(n=i.analytics)!=null&&n.endpoint&&(this.analyticsDefaultEndpoint=i.analytics.endpoint)}this.set_config({person_profiles:this.vn?this.vn:QL}),(r=this.Mn)==null||r.handleRemoteConfig(e),this.Ji.forEach((a=>a.onRemoteConfig==null?void 0:a.onRemoteConfig(e)))}kn(){try{this.config.loaded(this)}catch(n){Pt.critical("`loaded` function failed",n)}if(this.In(),this.config.internal_or_test_user_hostname&&Ni!=null&&Ni.hostname){var e=Ni.hostname,r=this.config.internal_or_test_user_hostname;(typeof r=="string"?e===r:r.test(e))&&this.setInternalOrTestUser()}this.config.capture_pageview&&setTimeout((()=>{(this.consent.isOptedIn()||this.ln())&&this.Tn()}),1),this.En=new DJ(this),this.En.load()}In(){var e;this.is_capturing()&&this.config.request_batching&&((e=this.bn)==null||e.enable())}_dom_loaded(){this.is_capturing()&&VE(this.__request_queue,(e=>this._n(e))),this.__request_queue=[],this.In()}_handle_unload(){var e,r,n,i,a;(e=this.surveys)==null||e.handlePageUnload==null||e.handlePageUnload(),(r=this.metrics)==null||r.flush("sendBeacon"),this.config.request_batching?(this.Rn()&&this.capture(JL),(n=this.logs)==null||n.flushLogs("sendBeacon"),(i=this.bn)==null||i.unload(),(a=this.wn)==null||a.unload()):this.Rn()&&this.capture(JL,null,{transport:"sendBeacon"})}_send_request(e){this.__loaded?lee?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)?e.fireCallbackOnDrop&&(e.callback==null||e.callback({statusCode:429})):(e.transport=e.transport||this.config.api_transport,e.headers=wt({},this.config.request_headers,e.headers),e.compression=e.compression==="best-available"?this.compression:e.compression,(Nt(this.config.disable_beacon)?this.config.__preview_disable_beacon:this.config.disable_beacon)&&(e.disableTransport=["sendBeacon"]),e.fetchOptions=e.fetchOptions||this.config.fetch_options,(r=>{var n,i,a,s=wt({},r);s.timeout=s.timeout||6e4;var o,l,u,h,d,f=(n=s.transport)!==null&&n!==void 0?n:"fetch";f==="sendBeacon"&&Nt(s.compression)&&s.data&&(s.compression=xs.Base64),s.method==="POST"&&s.data&&(s.timestampMode==="capture-body"?s.data={api_key:(l=(d=(h=Br(o=s.data)?o:[o])[0])==null||(u=d.properties)==null?void 0:u.token)!==null&&l!==void 0?l:d==null?void 0:d.token,batch:h,sent_at:new Date().toISOString()}:s.timestampMode==="body"&&(s.data=(function(m,y){return y===void 0&&(y=new Date().toISOString()),Br(m)?m.map((v=>wt({},v,{sent_at:y}))):wt({},m,{sent_at:y})})(s.data))),s.url=YJ(s.url,s.method,s.compression,s.timestampMode);var p=n5.filter((m=>!s.disableTransport||!m.transport||!s.disableTransport.includes(m.transport))),g=(i=(a=(function(m,y){for(var v=0;m.length>v;v++)if(m[v].transport===f)return m[v]})(p))==null?void 0:a.method)!==null&&i!==void 0?i:p[0].method;if(!g)throw new Error("No available transport method");f!=="sendBeacon"&&s.data&&s.compression===xs.GZipJS&&ZNe&&typeof Promise<"u"&&!t5?IOe(s).then((m=>{g(m)})).catch((m=>{if(UZ(m))return t5=!0,void g(wt({},s,{compression:void 0,url:YJ(r.url,r.method,void 0,r.timestampMode)}));(y=>{if(!y||typeof y!="object")return!1;var v="name"in y?String(y.name):"";return UZ(y)||v===VZ})(m)&&(t5=!0),g(s)})):g(s)})(wt({},e,{callback:r=>{var n,i;this.rateLimiter.checkForLimiting(r),400>r.statusCode||(n=(i=this.config).on_request_error)==null||n.call(i,r),e.callback==null||e.callback(r)}}))):e.fireCallbackOnDrop&&(e.callback==null||e.callback({statusCode:0}))}_n(e){this.wn?this.wn.retriableRequest(e):this._send_request(e)}_execute_array(e){AI++;try{var r,n=[],i=[],a=[];VE(e,(o=>{if(o)if(Br(r=o[0]))a.push(o);else if(bo(o))try{o.call(this)}catch(l){Pt.error("Error executing queued PostHog call",o,l)}else Br(o)&&r==="alias"?n.push(o):Br(o)&&r.indexOf("capture")!==-1&&bo(this[r])?a.push(o):i.push(o)}));var s=function(o,l){VE(o,(function(u){try{if(Br(u[0])){var h=l;Ln(u,(function(d){h=h[d[0]].apply(h,d.slice(1))}))}else l[u[0]].apply(l,u.slice(1))}catch(d){Pt.error("Error executing queued PostHog call",u,d)}}))};s(n,this),s(i,this),s(a,this)}finally{AI--}}push(e){if(AI>0&&Br(e)&&Rn(e[0])){var r=Uo.prototype[e[0]];bo(r)&&r.apply(this,e.slice(1))}else this._execute_array([e])}capture(e,r,n){var i,a,s,o,l,u,h;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.bn){if(this.is_capturing())if(!Nt(e)&&Rn(e)){var d=!this.config.opt_out_useragent_filter&&this._is_bot();if(!d||this.config.__preview_capture_bot_pageviews){var f=n!=null&&n.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(f==null||!f.isRateLimited){if(this.hn.length>0){var p={};for(var g of this.hn.slice())try{Nn(p,g())}catch(B){Pt.error("Failed to produce browser extension event properties",B)}r=wt({},p,r??{})}var m;(i=r)!=null&&i.$current_url&&!Rn((a=r)==null?void 0:a.$current_url)&&(Pt.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),(m=r)==null||delete m.$current_url),e!=="$exception"||n!=null&&n.Pn||Pt.warn("Using `posthog.capture('$exception')` is unreliable because it does not attach required metadata. Use `posthog.captureException(error)` instead, which attaches required metadata automatically."),this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.save_campaign_params||this.config.save_referrer)&&this.persistence.set_initial_person_info();var y=new Date,v=(n==null?void 0:n.timestamp)||y,x=xQ(n==null?void 0:n.uuid,bu),b={uuid:x,event:e,properties:this.calculateEventProperties(e,r||{},v,x)};e===Sg&&this.config.__preview_capture_bot_pageviews&&d&&(b.event="$bot_pageview",b.properties.$browser_type="bot"),f&&(b.properties.$lib_rate_limit_remaining_tokens=f.remainingTokens);var w=e==="$feature_flag_called"&&b.properties.$feature_flag_has_experiment===!1&&this.get_property($E)===!0;n!=null&&n.$set&&!w&&(b.$set=n==null?void 0:n.$set);var C=n==null?void 0:n.$unset;C&&(b.$unset=C);var _,k,S,L=w?void 0:this.On(n==null?void 0:n.$set_once,e!==qQ,e===eI);if(L&&(b.$set_once=L),n!=null&&n._noTruncate||(o=this.config.properties_string_max_length,l=b,u=B=>Rn(B)?B.slice(0,o):B,h=new Set,b=(function B(P,G){if(P!==Object(P))return u?u(P):P;if(!h.has(P)){var V;if(h.add(P),Br(P))V=[],VE(P,(W=>{V.push(B(W))}));else{var H={};Ln(P,((W,ie)=>{h.has(W)||(H[ie]=B(W))})),V=H}return V}})(l)),b.timestamp=v,Nt(n==null?void 0:n.timestamp)||(b.properties.$event_time_override_provided=!0,b.properties.$event_time_override_system_time=y),w&&(b.properties=(function(B,P){P===void 0&&(P=[]);var G={},V=H=>{B[H]!==void 0&&(G[H]=B[H])};return QNe.forEach(V),P.forEach(V),G})(b.properties,XOe)),e===Tu.DISMISSED||e===Tu.SENT){var $,I,z=($=r)==null?void 0:$[fI.SURVEY_ID],F=(I=r)==null?void 0:I[fI.SURVEY_ITERATION];nee({id:z,current_iteration:F}),b.$set=wt({},b.$set,{[(_={id:z,current_iteration:F},k=e===Tu.SENT?"responded":"dismissed",S="$survey_"+k+"/"+_.id,_.current_iteration&&_.current_iteration>0&&(S="$survey_"+k+"/"+_.id+"/"+_.current_iteration),S)]:!0})}else e===Tu.SHOWN&&(b.$set=wt({},b.$set,{[fI.SURVEY_LAST_SEEN_DATE]:new Date().toISOString()}));if(e===COe.SHOWN){var A,R=(A=r)==null?void 0:A[LJ.TOUR_TYPE];R&&(b.$set=wt({},b.$set,{[LJ.TOUR_LAST_SEEN_DATE+"/"+R]:new Date().toISOString()}))}var N=wt({},b.properties.$set,b.$set);if($h(N)||this.setPersonPropertiesForFlags(N),!zr(this.config.before_send)){var M=this.Rt(b);if(!M)return;(b=M).uuid=xQ(b.uuid,bu)}this.en.emit("eventCaptured",b);var D=(s=n==null?void 0:n._url)!==null&&s!==void 0?s:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),O={method:"POST",url:D,data:b,compression:"best-available",timestampMode:(n==null?void 0:n._batchKey)==="recordings"||/\/s\/(?:\?|$)/.test(D)?"body":"capture-body",batchKey:n==null?void 0:n._batchKey,transport:n==null?void 0:n.transport};return!this.config.request_batching||n&&(n==null||!n._batchKey)||n!=null&&n.send_instantly?this._n(O):this.bn.enqueue(O),b}Pt.critical("This capture call is ignored due to client rate limiting.")}}else Pt.error("No event name provided to posthog.capture")}else Pt.uninitializedWarning("posthog.capture")}_addCaptureHook(e){return this.on("eventCaptured",(r=>e(r.event,r)))}Fn(){var e;return(e=this.Mn)!==null&&e!==void 0?e:this.Mn=new YOe(this)}nn(e){this.hn.push(e);var r=!0;return()=>{if(r){r=!1;var n=this.hn.indexOf(e);n!==-1&&this.hn.splice(n,1)}}}calculateEventProperties(e,r,n,i,a){if(n=n||new Date,!this.persistence||!this.sessionPersistence)return r;var s=a?void 0:this.persistence.remove_event_timer(e),o=wt({},r);if(o.token=this.config.token,o.$config_defaults=this.config.defaults,this.ln()&&(o[BQ]=!0),e==="$snapshot"){var l=wt({},this.persistence.properties(),this.sessionPersistence.properties());return o.distinct_id=l.distinct_id,(!Rn(o.distinct_id)&&!Na(o.distinct_id)||fL(o.distinct_id))&&Pt.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),o}var u,h=(function(b,w,C,_){var k,S,L,$;if(_===void 0&&(_=!1),!Ks)return{};var I,z=b?[...Rg,...w||[]]:[],F=(function(le){for(var fe=0;vQ.length>fe;fe++){var Ae=vQ[fe],Se=Ae[1],Ne=Ae[0].exec(le),ge=Ne&&(bo(Se)?Se(Ne,le):Se);if(ge)return ge}return["",""]})(Ks),A=F[0],R=F[1],N=(I=typeof navigator<"u"?navigator:void 0)!=null&&I.brave?{brave:!0}:{},M={};Nt(C)||(M.detectGoogleSearchApp=C);var D={},O=(k=navigator)==null||(k=k.userAgentData)==null?void 0:k.platform,B=(S=navigator)==null?void 0:S.maxTouchPoints,P=at==null||(L=at.screen)==null?void 0:L.width,G=at==null||($=at.screen)==null?void 0:$.height,V=at==null?void 0:at.devicePixelRatio;Nt(O)||(D.userAgentDataPlatform=O),Nt(B)||(D.maxTouchPoints=B),Nt(P)||(D.screenWidth=P),Nt(G)||(D.screenHeight=G),Nt(V)||(D.devicePixelRatio=V);var H,W,ie,j,ae,J,K,Q,re=Nn(tI({$os:A,$os_version:R,$browser:yQ(Ks,navigator.vendor,N,M),$device:bQ(Ks),$device_type:(W=Ks,ie=D,Q=bQ(W),Q===QZ||Q===ZZ||Q==="Kobo"||Q==="Kindle Fire"||Q===dQ?vg:Q===Ux||Q===Tg||Q===Hx||Q===xL?"Console":Q===eQ?"Wearable":Q?xo:(ie==null?void 0:ie.userAgentDataPlatform)==="Android"&&((j=ie==null?void 0:ie.maxTouchPoints)!==null&&j!==void 0?j:0)>0?600>Math.min((ae=ie==null?void 0:ie.screenWidth)!==null&&ae!==void 0?ae:0,(J=ie==null?void 0:ie.screenHeight)!==null&&J!==void 0?J:0)/((K=ie==null?void 0:ie.devicePixelRatio)!==null&&K!==void 0?K:1)?xo:vg:"Desktop"),$timezone:RJ(),$timezone_offset:xOe()}),{$current_url:aT(_?Oh(Ni==null?void 0:Ni.href):Ni==null?void 0:Ni.href,z,sT),$host:Ni==null?void 0:Ni.host,$pathname:Ni==null?void 0:Ni.pathname,$raw_user_agent:Ks.length>1e3?Ks.substring(0,997)+"...":Ks,$browser_version:y$e(Ks,navigator.vendor,N,M),$browser_language:EJ(),$browser_language_prefix:(H=EJ(),typeof H=="string"?H.split("-")[0]:void 0),$screen_height:at==null?void 0:at.screen.height,$screen_width:at==null?void 0:at.screen.width,$viewport_height:at==null?void 0:at.innerHeight,$viewport_width:at==null?void 0:at.innerWidth,$lib:vn.LIB_NAME,$lib_version:vn.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3});return vn.SDK_DIST_CHANNEL&&(re.$sdk_dist_channel=vn.SDK_DIST_CHANNEL),re})(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties,this.config.detect_google_search_app,this.config.disable_capture_url_hashes);if(this.sessionManager){var d=this.sessionManager.checkAndGetSessionAndWindowId(a,n.getTime()),f=d.windowId;o.$session_id=d.sessionId,o.$window_id=f}this.sessionPropsManager&&Nn(o,this.sessionPropsManager.getSessionProps());try{var p;this.sessionRecording&&Nn(o,this.sessionRecording.sdkDebugProperties),o.$sdk_debug_retry_queue_size=(p=this.wn)==null?void 0:p.length}catch(b){o.$sdk_debug_error_capturing_properties=String(b)}if(this.requestRouter.region===_I&&(o.$lib_custom_api_host=this.config.api_host),u=e!==Sg||a?e!==JL||a?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(n):this.pageViewManager.doPageView(n,i),o=Nn(o,u),e===Sg&&Wt&&(o.title=Wt.title),!Nt(s)){var g=n.getTime()-s;o.$duration=parseFloat((g/1e3).toFixed(3))}Ks&&this.config.opt_out_useragent_filter&&(o.$browser_type=this._is_bot()?"bot":"browser");var m=this.persistence.properties(),y=this.sessionPersistence.properties();Ln(["$referrer","$referring_domain"],(b=>{b in m&&delete y[b]})),(o=Nn({},h,m,y,o)).$is_identified=this._isIdentified(),Br(this.config.property_denylist)?Ln(this.config.property_denylist,(function(b){delete o[b]})):Pt.error(oee+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var v=this.config.sanitize_properties;v&&(Pt.error(see),o=v(o,e));var x=this.An();return o.$process_person_profile=x,x&&!a&&this.$n("_calculate_event_properties"),o}On(e,r,n){var i;if(r===void 0&&(r=!0),n===void 0&&(n=!1),!this.persistence||!this.An()||this.un&&!n)return e;var a=this.persistence.get_initial_props(),s=(i=this.sessionPropsManager)==null?void 0:i.getSetOnceProps(),o=Nn({},a,s||{},e||{}),l=this.config.sanitize_properties;return l&&(Pt.error(see),o=l(o,"$set_once")),r&&(this.un=!0),$h(o)?void 0:o}register(e,r){var n;(n=this.persistence)==null||n.register(e,r)}register_once(e,r,n){var i;(i=this.persistence)==null||i.register_once(e,r,n)}register_for_session(e){var r;(r=this.sessionPersistence)==null||r.register(e)}unregister(e){var r;(r=this.persistence)==null||r.unregister(e)}unregister_for_session(e){var r;(r=this.sessionPersistence)==null||r.unregister(e)}Ln(e,r){this.register({[e]:r})}getFeatureFlag(e,r){var n;return(n=this.featureFlags)==null?void 0:n.getFeatureFlag(e,r)}getFeatureFlagPayload(e){var r;return(r=this.featureFlags)==null?void 0:r.getFeatureFlagPayload(e)}getFeatureFlagResult(e,r){var n;return(n=this.featureFlags)==null?void 0:n.getFeatureFlagResult(e,r)}getAllFeatureFlags(){var e,r;return(e=(r=this.featureFlags)==null?void 0:r.getAllFeatureFlags())!==null&&e!==void 0?e:[]}isFeatureEnabled(e,r){var n,i;return(n=(i=this.featureFlags)==null?void 0:i.isFeatureEnabled(e,r))!==null&&n!==void 0?n:r==null?void 0:r.defaultValue}reloadFeatureFlags(){var e;(e=this.featureFlags)==null||e.reloadFeatureFlags()}updateFlags(e,r,n){var i;(i=this.featureFlags)==null||i.updateFlags(e,r,n)}updateEarlyAccessFeatureEnrollment(e,r,n){var i;(i=this.featureFlags)==null||i.updateEarlyAccessFeatureEnrollment(e,r,n)}getEarlyAccessFeatures(e,r,n){var i;return r===void 0&&(r=!1),(i=this.featureFlags)==null?void 0:i.getEarlyAccessFeatures(e,r,n)}on(e,r){return this.en.on(e,r)}onFeatureFlags(e){return this.featureFlags?this.featureFlags.onFeatureFlags(e):(e([],{},{errorsLoading:!0}),()=>{})}onSurveysLoaded(e){return this.surveys?this.surveys.onSurveysLoaded(e):(e([],{isLoaded:!1,error:fT}),()=>{})}onSessionId(e){var r,n;return(r=(n=this.sessionManager)==null?void 0:n.onSessionId(e))!==null&&r!==void 0?r:()=>{}}getSurveys(e,r){r===void 0&&(r=!1),this.surveys?this.surveys.getSurveys(e,r):e([],{isLoaded:!1,error:fT})}getActiveMatchingSurveys(e,r){r===void 0&&(r=!1),this.surveys?this.surveys.getActiveMatchingSurveys(e,r):e([],{isLoaded:!1,error:fT})}renderSurvey(e,r){var n;(n=this.surveys)==null||n.renderSurvey(e,r)}displaySurvey(e,r){var n;r===void 0&&(r=GOe),(n=this.surveys)==null||n.displaySurvey(e,r)}cancelPendingSurvey(e){var r;(r=this.surveys)==null||r.cancelPendingSurvey(e)}canRenderSurvey(e){var r,n;return(r=(n=this.surveys)==null?void 0:n.canRenderSurvey(e))!==null&&r!==void 0?r:{visible:!1,disabledReason:fT}}canRenderSurveyAsync(e,r){var n,i;return r===void 0&&(r=!1),(n=(i=this.surveys)==null?void 0:i.canRenderSurveyAsync(e,r))!==null&&n!==void 0?n:Promise.resolve({visible:!1,disabledReason:fT})}Dn(e){return!e||fL(e)?(Pt.critical("Unique user id has not been set in posthog.identify"),!1):e===zE?(Pt.critical('The string "'+e+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.'),!1):!["distinct_id","distinctid"].includes(e.toLowerCase())&&!["undefined","null"].includes(e.toLowerCase())||(Pt.critical('The string "'+e+'" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.'),!1)}identify(e,r,n){if(!this.__loaded||!this.persistence)return Pt.uninitializedWarning("posthog.identify");if(Na(e)&&(e=e.toString(),Pt.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),this.Dn(e)&&this.$n("posthog.identify")){var i=this.get_distinct_id();this.register({$user_id:e}),this.get_property(jx)||this.register_once({$had_persisted_distinct_id:!0,$device_id:i},""),e!==i&&e!==this.get_property(Kx)&&(this.unregister(Kx),this.register({distinct_id:e}));var a,s=(this.persistence.get_property(Vo)||Eg)===Eg,o=e!==i,l=!o&&s;if(o&&s)this.persistence.set_property(Vo,kf),this.setPersonPropertiesForFlags({$set:r||{},$set_once:n||{}},!1),this.capture(eI,{distinct_id:e,$anon_distinct_id:i},{$set:r||{},$set_once:n||{}}),this.fn=SI(e,r,n),(a=this.featureFlags)==null||a.setAnonymousDistinctId(i);else if(l){this.persistence.set_property(Vo,kf);var u=r||{},h=n||{};this.setPersonPropertiesForFlags({$set:u,$set_once:h},!1),this.capture("$set",{$set:u,$set_once:h}),this.fn=SI(e,r,n)}else(r||n)&&this.setPersonProperties(r,n);o?(this.reloadFeatureFlags(),this.unregister(eT)):l&&(r||n)&&this.reloadFeatureFlags()}}setPersonProperties(e,r){if((e||r)&&this.$n("posthog.setPersonProperties")){var n=SI(this.get_distinct_id(),e,r);this.fn!==n?(this.setPersonPropertiesForFlags({$set:e||{},$set_once:r||{}},!0),this.capture("$set",{$set:e||{},$set_once:r||{}}),this.fn=n):Pt.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}unsetPersonProperties(e){var r,n=(Br(e)?e:[e]).filter((i=>Rn(i)&&i.length>0));n.length!==0&&this.$n("posthog.unsetPersonProperties")&&((r=this.featureFlags)==null||r.unsetPersonPropertiesForFlags(n,!0),this.capture("$set",{$unset:n}),this.fn=null)}group(e,r,n){if(e&&r){var i=this.getGroups(),a=i[e]!==r;if(a&&this.resetGroupPropertiesForFlags(e),this.register({$groups:wt({},i,{[e]:r})}),a||n){var s={$group_type:e,$group_key:r};n&&(s.$group_set=n),this.capture(qQ,s)}n&&this.setGroupPropertiesForFlags({[e]:n}),a&&!n&&this.reloadFeatureFlags()}else Pt.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(e,r){var n;r===void 0&&(r=!0),(n=this.featureFlags)==null||n.setPersonPropertiesForFlags(e,r)}resetPersonPropertiesForFlags(e){var r;e===void 0&&(e=!0),(r=this.featureFlags)==null||r.resetPersonPropertiesForFlags(e)}setGroupPropertiesForFlags(e,r){var n;r===void 0&&(r=!0),this.$n("posthog.setGroupPropertiesForFlags")&&((n=this.featureFlags)==null||n.setGroupPropertiesForFlags(e,r))}resetGroupPropertiesForFlags(e){var r;(r=this.featureFlags)==null||r.resetGroupPropertiesForFlags(e)}reset(e){var r,n,i,a,s,o,l,u,h,d;if(Pt.info("reset"),!this.__loaded)return Pt.uninitializedWarning("posthog.reset");var f,p=this.get_property(jx),g=this.get_property(LL),m=this.get_property(bf);if(this.consent.reset(),(r=this.persistence)==null||r.clear(),(n=this.sessionPersistence)==null||n.clear(),Nt(m)||(f=this.persistence)==null||f.register({[bf]:m}),(i=this.surveys)==null||i.reset(),(a=this.En)==null||a.stop(),(s=this.featureFlags)==null||s.reset(),(o=this.conversations)==null||o.reset(),(l=this.logs)==null||l.reset(),(u=this.metrics)==null||u.reset(),(h=this.persistence)==null||h.set_property(Vo,Eg),(d=this.sessionManager)==null||d.resetSessionId(),this.fn=null,this.config.cookieless_mode===vu)this.register_once({distinct_id:zE,$device_id:null},"");else{var y=this.config.get_device_id(bu());this.register_once({distinct_id:y,$device_id:e?y:p},""),e||Nt(g)||this.register({[LL]:g})}this.register({$last_posthog_reset:new Date().toISOString()},1),delete this.config.identity_distinct_id,delete this.config.identity_hash,this.reloadFeatureFlags()}shutdown(e){var r=this;return jn((function*(){var n,i,a,s,o,l,u;r.__loaded?((n=r.En)==null||n.stop(),(i=r.Mn)==null||i.dispose(),(a=r.logs)==null||a.flushLogs("sendBeacon"),(s=r.metrics)==null||s.flush("sendBeacon"),(o=r.bn)==null||o.unload(),(l=r.wn)==null||l.unload(),(u=r.featureFlags)==null||u.destroy()):Pt.uninitializedWarning("posthog.shutdown")}))()}setIdentity(e,r){var n;this.config.identity_distinct_id=e,this.config.identity_hash=r,this.alias(e),(n=this.conversations)==null||n.Nn()}clearIdentity(){var e;delete this.config.identity_distinct_id,delete this.config.identity_hash,(e=this.conversations)==null||e.qn()}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var e,r;return(e=(r=this.sessionManager)==null?void 0:r.checkAndGetSessionAndWindowId(!0).sessionId)!==null&&e!==void 0?e:""}get_session_replay_url(e){if(!this.sessionManager)return"";var r=this.sessionManager.checkAndGetSessionAndWindowId(!0),n=r.sessionStartTimestamp,i=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+r.sessionId);if(e!=null&&e.withTimestamp&&n){var a,s=(a=e.timestampLookBack)!==null&&a!==void 0?a:10;if(!n)return i;i+="?t="+Math.max(Math.floor((new Date().getTime()-n)/1e3)-s,0)}return i}alias(e,r){return e===this.get_property(DQ)?(Pt.critical("Attempting to create alias for existing People user - aborting."),-2):this.$n("posthog.alias")?(Nt(r)&&(r=this.get_distinct_id()),e!==r?(this.Ln(Kx,e),this.capture("$create_alias",{alias:e,distinct_id:r})):(Pt.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){var r=wt({},this.config);if(Kn(e)){var n,i,a,s,o,l,u,h,d,f,p;Nn(this.config,cee(e));var g=this.yn();(n=this.persistence)==null||n.update_config(this.config,r,g),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new hI(wt({},this.config,{persistence:"sessionStorage"}),g,!1);var m=this.pn(this.config.debug);Tl(m)&&(this.config.debug=m),Tl(this.config.debug)&&(this.config.debug?(vn.DEBUG=!0,$n.N()&&$n.A("ph_debug",!0),Pt.info("set_config",{config:e,oldConfig:r,newConfig:wt({},this.config)})):(vn.DEBUG=!1,$n.N()&&$n.D("ph_debug"))),(i=this.exceptionObserver)==null||i.onConfigChange(),(a=this.exceptions)==null||a.onConfigChange(),(s=this.sessionRecording)==null||s.startIfEnabledOrStop(),(o=this.tracingHeaders)==null||o.startIfEnabledOrStop(),(l=this.autocapture)==null||l.startIfEnabled(),(u=this.heatmaps)==null||u.startIfEnabled(),(h=this.exceptionObserver)==null||h.startIfEnabledOrStop(),(d=this.deadClicksAutocapture)==null||d.startIfEnabledOrStop(),(f=this.surveys)==null||f.loadIfEnabled(),this.jn(),(p=this.externalIntegrations)==null||p.startIfEnabledOrStop()}}_overrideSDKInfo(e,r){vn.LIB_NAME=e,vn.LIB_VERSION=r}startSessionRecording(e){var r,n,i,a,s,o=e===!0,l={sampling:o||!(e==null||!e.sampling),linked_flag:o||!(e==null||!e.linked_flag),url_trigger:o||!(e==null||!e.url_trigger),event_trigger:o||!(e==null||!e.event_trigger)};Object.values(l).some(Boolean)&&((r=this.sessionManager)==null||r.checkAndGetSessionAndWindowId(),l.sampling&&((n=this.sessionRecording)==null||n.overrideSampling()),l.linked_flag&&((i=this.sessionRecording)==null||i.overrideLinkedFlag()),l.url_trigger&&((a=this.sessionRecording)==null||a.overrideTrigger("url")),l.event_trigger&&((s=this.sessionRecording)==null||s.overrideTrigger("event"))),this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var e;return!((e=this.sessionRecording)==null||!e.started)}captureException(e,r){if(this.exceptions){var n=new Error("PostHog syntheticException"),i=this.exceptions.buildProperties(e,{handled:!0,syntheticException:n});return this.exceptions.sendExceptionEvent(wt({},i,r))}}addExceptionStep(e,r){var n;(n=this.exceptions)==null||n.addExceptionStep(e,r)}captureLog(e){var r;(r=this.logs)==null||r.captureLog(e)}get logger(){var e,r;return(e=(r=this.logs)==null?void 0:r.logger)!==null&&e!==void 0?e:Uo.Bn}startExceptionAutocapture(e){this.set_config({capture_exceptions:e==null||e})}stopExceptionAutocapture(){this.set_config({capture_exceptions:!1})}loadToolbar(e){var r,n;return(r=(n=this.toolbar)==null?void 0:n.loadToolbar(e))!==null&&r!==void 0&&r}get_property(e){var r;return(r=this.persistence)==null?void 0:r.props[e]}getSessionProperty(e){var r;return(r=this.sessionPersistence)==null?void 0:r.props[e]}toString(){var e,r=(e=this.config.name)!==null&&e!==void 0?e:Mg;return r!==Mg&&(r=Mg+"."+r),r}_isIdentified(){var e,r;return((e=this.persistence)==null?void 0:e.get_property(Vo))===kf||((r=this.sessionPersistence)==null?void 0:r.get_property(Vo))===kf}An(){var e,r;return!(this.config.person_profiles==="never"||this.config.person_profiles===QL&&!this._isIdentified()&&$h(this.getGroups())&&((e=this.persistence)==null||(e=e.props)==null||!e[Kx])&&((r=this.persistence)==null||(r=r.props)==null||!r[FE]))}Rn(){return this.config.capture_pageleave===!0||this.config.capture_pageleave==="if_capture_pageview"&&(this.config.capture_pageview===!0||this.config.capture_pageview==="history_change")}createPersonProfile(){this.An()||this.$n("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.$n("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}$n(e){return this.config.person_profiles==="never"?(Pt.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.Ln(FE,!0),!0)}yn(){if(this.config.cookieless_mode==="always")return!0;var e=this.consent.isOptedOut();return this.config.disable_persistence||e&&!(!this.config.opt_out_persistence_by_default&&this.config.cookieless_mode!==Cf)}jn(){var e,r,n,i,a=this.yn();return((e=this.persistence)==null?void 0:e.yr)!==a&&((n=this.persistence)==null||n.set_disabled(a)),((r=this.sessionPersistence)==null?void 0:r.yr)!==a&&((i=this.sessionPersistence)==null||i.set_disabled(a)),a}opt_in_capturing(e){var r;if(this.config.cookieless_mode!==vu){if(this.ln()){var n,i,a,s,o;this.reset(!0),(n=this.sessionManager)==null||n.destroy(),(i=this.pageViewManager)==null||i.destroy(),this.sessionManager=new jJ(this),this.pageViewManager=new bJ(this),this.persistence&&(this.sessionPropsManager=new XJ(this,this.sessionManager,this.persistence));var l,u=(a=(s=this.config.__extensionClasses)==null?void 0:s.sessionRecording)!==null&&a!==void 0?a:(o=Uo.__defaultExtensionClasses)==null?void 0:o.sessionRecording;u&&(this.sessionRecording=this.an(this.sessionRecording,new u(this)),this.tn&&((l=this.sessionRecording)==null||l.onRemoteConfig==null||l.onRemoteConfig(this.tn)))}var h,d;this.consent.optInOut(!0),this.jn(),this.In(),(r=this.sessionRecording)==null||r.startIfEnabledOrStop(),this.config.cookieless_mode==Cf&&((h=this.surveys)==null||h.loadIfEnabled()),(Nt(e==null?void 0:e.captureEventName)||e!=null&&e.captureEventName)&&this.capture((d=e==null?void 0:e.captureEventName)!==null&&d!==void 0?d:"$opt_in",e==null?void 0:e.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.Tn()}else Pt.warn(aee)}opt_out_capturing(){var e,r,n;this.config.cookieless_mode!==vu?(this.config.cookieless_mode===Cf&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this.jn(),this.config.cookieless_mode===Cf&&(this.register({distinct_id:zE,$device_id:null}),(e=this.sessionRecording)==null||e.stopRecording(),this.sessionRecording=void 0,(r=this.sessionManager)==null||r.destroy(),(n=this.pageViewManager)==null||n.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,this.config.capture_pageview&&this.Tn(),this.In())):Pt.warn(aee)}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){var e=this.consent.consent;return e===1?"granted":e===0?"denied":"pending"}is_capturing(){return this.config.cookieless_mode===vu||(this.config.cookieless_mode===Cf?this.consent.isRejected()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.jn()}_is_bot(){return vs?KJ(vs,this.config.custom_blocked_useragents):void 0}Tn(){Wt&&(Wt.visibilityState==="visible"?this.dn||(this.dn=!0,this.capture(Sg,{title:Wt.title},{send_instantly:!0}),this.cn&&(Wt.removeEventListener(GE,this.cn),this.cn=null)):this.cn||(this.cn=this.Tn.bind(this),ui(Wt,GE,this.cn)))}debug(e){e===!1?(at==null||at.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(at==null||at.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),this.set_config({debug:!0}))}Ur(){var e=this.gn||{};return"advanced_disable_flags"in e?!!e.advanced_disable_flags:this.config.advanced_disable_flags!==!1?!!this.config.advanced_disable_flags:this.config.advanced_disable_decide===!0?(Pt.warn("Config field 'advanced_disable_decide' is deprecated. Please use 'advanced_disable_flags' instead. The old field will be removed in a future major version."),!0):(function(r,n,i,a,s){var o=n in r&&!zr(r[n]),l=i in r&&!zr(r[i]);return o?r[n]:!!l&&(s&&s.warn("Config field '"+i+"' is deprecated. Please use '"+n+"' instead. The old field will be removed in a future major version."),r[i])})(e,"advanced_disable_flags","advanced_disable_decide",0,Pt)}Rt(e){var r;if(zr(this.config.before_send))return e;var n=Object.keys((r=e.properties)!==null&&r!==void 0?r:{}).filter(a$e),i=Br(this.config.before_send)?this.config.before_send:[this.config.before_send],a=e;for(var s of i){if(a=s(a),zr(a)){var o="Event '"+e.event+"' was rejected in beforeSend function";return i$e(e.event)?Pt.warn(o+". This can cause unexpected behavior."):Pt.info(o),null}a.properties&&!$h(a.properties)||Pt.warn("Event '"+e.event+"' has no properties after beforeSend function, this is likely an error.")}for(var l of n)if(a.properties&&zr(a.properties[l]))return Pt.warn("Event '"+e.event+"' had its '"+l+"' property removed in a beforeSend function. This property is required for ingestion, so the event will be dropped."),null;return a}getPageViewId(){var e;return(e=this.pageViewManager.ir)==null?void 0:e.pageViewId}captureTraceFeedback(e,r){this.capture("$ai_feedback",{$ai_trace_id:String(e),$ai_feedback_text:r})}captureTraceMetric(e,r,n){this.capture("$ai_metric",{$ai_trace_id:String(e),$ai_metric_name:r,$ai_metric_value:String(n)})}pn(e){var r=Tl(e)&&!e,n=$n.N()&&$n.q("ph_debug")==="true";return!r&&(!!n||e)}}Uo.__defaultExtensionClasses={},Uo.Bn=(()=>{var t=()=>{};return{trace:t,debug:t,info:t,warn:t,error:t,fatal:t}})(),(function(t,e){for(var r=0;e.length>r;r++)t.prototype[e[r]]=Y$e(t.prototype[e[r]])})(Uo,["identify"]);class uee{constructor(e){this.disabled=e===!1;var r=Kn(e)?e:{};this.thresholdPx=r.threshold_px||30,this.timeoutMs=r.timeout_ms||1e3,this.clickCount=r.click_count||3,this.clicks=[]}isRageClick(e,r,n){if(this.disabled)return!1;var i=this.clicks[this.clicks.length-1];if(i&&Math.abs(e-i.x)+Math.abs(r-i.y)n-i.timestamp){if(this.clicks.push({x:e,y:r,timestamp:n}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:e,y:r,timestamp:n}];return!1}}var LI="$copy_autocapture",II=Zn("[AutoCapture]");function DI(t,e){return e.length>t?e.slice(0,t)+"...":e}function ZOe(t){if(t.previousElementSibling)return t.previousElementSibling;var e=t;do e=e.previousSibling;while(e&&!Ph(e));return e}function QOe(t,e){var r,n,i=e.e,a=e.maskAllElementAttributes,s=e.maskAllText,o=e.elementAttributeIgnoreList,l=e.elementsChainAsString,u=e.disableCaptureUrlHashes;if(!Ph(t))return{props:{}};for(var h=[t],d=new Set([t]),f=t;f.parentNode&&!To(f,"body")&&JQ>h.length;)if(QQ(f.parentNode)){var p=f.parentNode.host;if(d.has(p))break;d.add(p),h.push(p),f=p}else{if(!Ph(f.parentNode)||d.has(f.parentNode))break;d.add(f.parentNode),h.push(f.parentNode),f=f.parentNode}var g,m,y=[],v={},x=!1,b=!1;if(Ln(h,(S=>{var L=lI(S);if(To(S,"a")){var $=S.getAttribute("href");x=!!(L&&$&&iT($))&&(u?Oh($):$)}Rr(YE(S),"ph-no-capture")&&(b=!0),y.push((function(z,F,A,R,N){N===void 0&&(N=!1);var M=z.tagName.toLowerCase(),D={tag_name:M};aI.indexOf(M)>-1&&!A&&(D.$el_text=M.toLowerCase()==="a"||M.toLowerCase()==="button"?DI(1024,fJ(z)):DI(1024,nT(z)));var O=YE(z);O.length>0&&(D.classes=O.filter((function(V){return V!==""}))),Ln(z.attributes,(function(V){var H;if((!lJ(z)||["name","id","class","aria-label"].indexOf(V.name)!==-1)&&(R==null||!R.includes(V.name))&&!F&&iT(V.value)&&(!Rn(H=V.name)||H.substring(0,10)!=="_ngcontent"&&H.substring(0,7)!=="_nghost")){var W=V.value;V.name==="class"&&(W=nI(W).join(" ")),D["attr__"+V.name]=DI(1024,V.name==="href"&&N?Oh(W):W)}}));for(var B=1,P=1,G=z;G=ZOe(G);)B++,G.tagName===z.tagName&&P++;return D.nth_child=B,D.nth_of_type=P,D})(S,a,s,o,u));var I=(function(z){if(!lI(z))return{};var F={};return Ln(z.attributes,(function(A){if(A.name&&A.name.indexOf("data-ph-capture-attribute")===0){var R=A.name.replace("data-ph-capture-attribute-",""),N=A.value;R&&N&&iT(N)&&(F[R]=N)}})),F})(S);Nn(v,I)})),b)return{props:{},explicitNoCapture:b};if(s||(y[0].$el_text=To(t,"a")||To(t,"button")?fJ(t):nT(t)),x){var w,C;y[0].attr__href=x;var _=(w=jE(x))==null?void 0:w.host,k=at==null||(C=at.location)==null?void 0:C.host;_&&k&&_!==k&&(g=x)}return{props:Nn({$event_type:i.type,$ce_version:1},l?{}:{$elements:y},{$elements_chain:(m=y,(function(S){return S.map((L=>{var $,I,z="";if(L.tag_name&&(z+=L.tag_name),L.attr_class)for(var F of(L.attr_class.sort(),L.attr_class))z+="."+F.replace(/"/g,"");var A=wt({},L.text?{text:L.text}:{},{"nth-child":($=L.nth_child)!==null&&$!==void 0?$:0,"nth-of-type":(I=L.nth_of_type)!==null&&I!==void 0?I:0},L.href?{href:L.href}:{},L.attr_id?{attr_id:L.attr_id}:{},L.attributes),R={};return WE(A).sort(((N,M)=>N[0].localeCompare(M[0]))).forEach((N=>{var M=N[1];return R[gJ(N[0].toString())]=gJ(M.toString())})),(z+=":")+WE(R).map((N=>N[0]+'="'+N[1]+'"')).join("")})).join(";")})((function(S){return S.map((L=>{var $,I,z={text:($=L.$el_text)==null?void 0:$.slice(0,400),tag_name:L.tag_name,href:(I=L.attr__href)==null?void 0:I.slice(0,2048),attr_class:dOe(L),attr_id:L.attr__id,nth_child:L.nth_child,nth_of_type:L.nth_of_type,attributes:{}};return WE(L).filter((F=>F[0].indexOf("attr__")===0)).forEach((F=>z.attributes[F[0]]=F[1])),z}))})(m)))},(r=y[0])!=null&&r.$el_text?{$el_text:(n=y[0])==null?void 0:n.$el_text}:{},g&&i.type==="click"?{$external_click_url:g}:{},v)}}var pT=Zn("[ExceptionAutocapture]"),hee=()=>{},JOe=Zn("[TracingHeaders]"),Rf=Zn("[Web Vitals]"),dee=9e5,fee="disabled",pee="lazy_loading",gT="awaiting_config",o5="missing_config";Zn("[SessionRecording]"),Zn("[SessionRecording]");var MI="[SessionRecording]",Cu=Zn(MI),ePe=Zn("[Heatmaps]");function NI(t){return Kn(t)&&"clientX"in t&&"clientY"in t&&Na(t.clientX)&&Na(t.clientY)}var $I=Zn("[Product Tours]"),OI=t=>{var e;return!t.config.disable_product_tours&&!((e=t.persistence)==null||!e.get_property(BL))},tPe=["$set_once","$set"],lc=Zn("[SiteApps]"),gee="Error while initializing PostHog app with config id ";function Ng(t,e,r){if(zr(t))return!1;switch(r){case"exact":return t===e;case"contains":var n=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*");return new RegExp(n,"i").test(t);case"regex":try{return new RegExp(e).test(t)}catch{return!1}default:return!1}}class rPe{constructor(e){this.Hn=new EI,this.Un=(r,n)=>this.zn(r,n)&&this.Vn(r,n)&&this.Wn(r,n)&&this.Zn(r,n),this.zn=(r,n)=>n==null||!n.event||(r==null?void 0:r.event)===(n==null?void 0:n.event),this._instance=e,this.Gn=new Set,this.Qn=new Set}init(){var e,r;Nt((e=this._instance)==null?void 0:e._addCaptureHook)||(r=this._instance)==null||r._addCaptureHook(((n,i)=>{this.on(n,i)}))}register(e){var r,n;if(!Nt((r=this._instance)==null?void 0:r._addCaptureHook)&&(e.forEach((s=>{var o,l;(o=this.Qn)==null||o.add(s),(l=s.steps)==null||l.forEach((u=>{var h;(h=this.Gn)==null||h.add((u==null?void 0:u.event)||"")}))})),(n=this._instance)!=null&&n.autocapture)){var i,a=new Set;e.forEach((s=>{var o;(o=s.steps)==null||o.forEach((l=>{l!=null&&l.selector&&a.add(l==null?void 0:l.selector)}))})),(i=this._instance)==null||i.autocapture.setElementSelectors(a)}}on(e,r){var n;r!=null&&e.length!=0&&(this.Gn.has(e)||this.Gn.has(r.event))&&this.Qn&&((n=this.Qn)==null?void 0:n.size)>0&&this.Qn.forEach((i=>{this.Jn(r,i)&&this.Hn.emit("actionCaptured",i.name)}))}Kn(e){this.onAction("actionCaptured",(r=>e(r)))}Jn(e,r){if((r==null?void 0:r.steps)==null)return!1;for(var n of r.steps)if(this.Un(e,n))return!0;return!1}onAction(e,r){return this.Hn.on(e,r)}Vn(e,r){if(r!=null&&r.url){var n,i=e==null||(n=e.properties)==null?void 0:n.$current_url;if(!i||typeof i!="string"||!Ng(i,r.url,r.url_matching||"contains"))return!1}return!0}Wn(e,r){return!!this.Yn(e,r)&&!!this.Xn(e,r)&&!!this.ts(e,r)}Yn(e,r){var n;if(r==null||!r.href)return!0;var i=this.es(e);if(i.length>0)return i.some((o=>Ng(o.href,r.href,r.href_matching||"exact")));var a,s=(e==null||(n=e.properties)==null?void 0:n.$elements_chain)||"";return!!s&&Ng((a=s.match(/(?::|")href="(.*?)"/))?a[1]:"",r.href,r.href_matching||"exact")}Xn(e,r){var n;if(r==null||!r.text)return!0;var i=this.es(e);if(i.length>0)return i.some((u=>Ng(u.text,r.text,r.text_matching||"exact")||Ng(u.$el_text,r.text,r.text_matching||"exact")));var a,s,o,l=(e==null||(n=e.properties)==null?void 0:n.$elements_chain)||"";return!!l&&(a=(function(u){for(var h,d=[],f=/(?::|")text="(.*?)"/g;!zr(h=f.exec(u));)d.includes(h[1])||d.push(h[1]);return d})(l),s=r.text,o=r.text_matching||"exact",a.some((u=>Ng(u,s,o))))}ts(e,r){var n,i;if(r==null||!r.selector)return!0;var a=e==null||(n=e.properties)==null?void 0:n.$element_selectors;if(a!=null&&a.includes(r.selector))return!0;var s=(e==null||(i=e.properties)==null?void 0:i.$elements_chain)||"";if(r.selector_regex&&s)try{return new RegExp(r.selector_regex).test(s)}catch{return!1}return!1}es(e){var r;return(e==null||(r=e.properties)==null?void 0:r.$elements)==null?[]:e==null?void 0:e.properties.$elements}Zn(e,r){return r==null||!r.properties||r.properties.length===0||JJ(r.properties.reduce(((n,i)=>{var a=Br(i.value)?i.value.map(String):i.value!=null?[String(i.value)]:[];return n[i.key]={values:a,operator:i.operator||"exact"},n}),{}),e==null?void 0:e.properties)}}class nPe{constructor(e){var r;this.rs=[],this._instance=e,this.ns=new Map,this.ss=new Map,this.os=new Map,(r=this._instance)==null||r.onSessionId==null||r.onSessionId((n=>this.ls(n)))}us(e,r){return!!e&&JJ(e.propertyFilters,r==null?void 0:r.properties)}hs(e,r){var n=new Map;return e.forEach((i=>{var a;(a=i.conditions)==null||(a=a[r])==null||(a=a.values)==null||a.forEach((s=>{if(s!=null&&s.name){var o=n.get(s.name)||[];o.push(i.id),n.set(s.name,o)}}))})),n}ds(e,r,n){var i=(n===oT.Activation?this.ns:this.ss).get(e),a=[];return this.cs((s=>{a=s.filter((o=>i==null?void 0:i.includes(o.id)))})),a.filter((s=>{var o,l=(o=s.conditions)==null||(o=o[n])==null||(o=o.values)==null?void 0:o.find((u=>u.name===e));return this.us(l,r)}))}register(e){var r;Nt((r=this._instance)==null?void 0:r._addCaptureHook)||(this.vs(e),this.fs(e))}fs(e){var r=e.filter((n=>{var i,a;return((i=n.conditions)==null?void 0:i.actions)&&((a=n.conditions)==null||(a=a.actions)==null||(a=a.values)==null?void 0:a.length)>0}));r.length!==0&&(this.ps==null&&(this.ps=new rPe(this._instance),this.ps.init(),this.ps.Kn((n=>{this.onAction(n)}))),r.forEach((n=>{var i,a,s,o,l;n.conditions&&(i=n.conditions)!=null&&i.actions&&(a=n.conditions)!=null&&(a=a.actions)!=null&&a.values&&((s=n.conditions)==null||(s=s.actions)==null||(s=s.values)==null?void 0:s.length)>0&&((o=this.ps)==null||o.register(n.conditions.actions.values),(l=n.conditions)==null||(l=l.actions)==null||(l=l.values)==null||l.forEach((u=>{if(u&&u.name){var h=this.os.get(u.name);h&&h.push(n.id),this.os.set(u.name,h||[n.id])}})))})))}vs(e){var r,n=e.filter((a=>{var s,o;return((s=a.conditions)==null?void 0:s.events)&&((o=a.conditions)==null||(o=o.events)==null||(o=o.values)==null?void 0:o.length)>0})),i=e.filter((a=>{var s,o;return((s=a.conditions)==null?void 0:s.cancelEvents)&&((o=a.conditions)==null||(o=o.cancelEvents)==null||(o=o.values)==null?void 0:o.length)>0}));n.length===0&&i.length===0||((r=this._instance)==null||r._addCaptureHook(((a,s)=>{this.onEvent(a,s)})),this.ns=this.hs(e,oT.Activation),this.ss=this.hs(e,oT.Cancellation))}onEvent(e,r){var n,i,a=this.gs(),s=(r==null||(n=r.properties)==null?void 0:n.$survey_id)||(r==null||(i=r.properties)==null?void 0:i.$product_tour_id);if(s&&this.getActivatedIds().includes(s)){var o=this.ys(e,s);if(o==="consume")return a.info("event consumed activated item, removing it",{event:e,itemId:s}),void this.bs([s]);if(o==="persist")return a.info("shown item promoted to persisted activation",{event:e,itemId:s}),void this._s(s)}if(this.ss.has(e)){var l=this.ds(e,r,oT.Cancellation);l.length>0&&(a.info("cancel event matched, cancelling items",{event:e,itemsToCancel:l.map((h=>h.id))}),this.bs(l.map((h=>h.id))),l.forEach((h=>this.ws(h.id))))}if(this.ns.has(e)){a.info("event name matched",{event:e,eventPayload:r,items:this.ns.get(e)});var u=this.ds(e,r,oT.Activation);this.xs(u.map((h=>h.id)))}}onAction(e){this.os.has(e)&&this.xs(this.os.get(e)||[])}xs(e){e.length!==0&&(this.rs=[...new Set([...this.rs,...e])],this.gs().info("updating activated items",{activatedItems:this.getActivatedIds()}))}_s(e){this.rs=this.rs.filter((n=>n!==e));var r=this.ks();r.includes(e)||(this.Ss([...r,e]),this.Cs())}bs(e){var r=new Set(e);this.rs=this.rs.filter((a=>!r.has(a)));var n=this.Ms(),i=n.filter((a=>!r.has(a)));i.length!==n.length&&(this.Ss(i),i.length===0&&this.Is())}Ms(){var e,r=this.Ts();return((e=this._instance)==null||(e=e.persistence)==null?void 0:e.props[r])||[]}ks(){var e,r,n=this.Ms();if(n.length===0)return[];var i=(e=this._instance)==null||(e=e.persistence)==null?void 0:e.props[this.Es()],a=(r=this._instance)==null||r.get_session_id==null?void 0:r.get_session_id();return a&&i===a?n:[]}Cs(){var e,r=(e=this._instance)==null||e.get_session_id==null?void 0:e.get_session_id();r&&this.Rs(r)}Is(){this.Ps()}ls(e){var r,n=(r=this._instance)==null||(r=r.persistence)==null?void 0:r.props[this.Es()];n&&n!==e&&(this.Ms().length>0&&this.Ss([]),this.Is())}getActivatedIds(){return[...new Set([...this.ks(),...this.rs])].filter((e=>!this.Os(e)))}reset(){this.rs=[],this.Ms().length>0&&this.Ss([]),this.Is()}getEventToItemsMap(){return this.ns}Fs(){return this.ps}}class iPe extends nPe{constructor(e){super(e)}Ts(){return WL}Es(){return PE}As(){return Tu.SHOWN}cs(e){var r;(r=this._instance)==null||r.getSurveys(e)}ws(e){var r;(r=this._instance)==null||r.cancelPendingSurvey(e)}gs(){return kn}Ss(e){var r;(r=this._instance)==null||(r=r.persistence)==null||r.register({[WL]:e})}Rs(e){var r;(r=this._instance)==null||(r=r.persistence)==null||r.register({[PE]:e})}Ps(){var e;(e=this._instance)==null||(e=e.persistence)==null||e.unregister(PE)}Os(){return!1}ys(e,r){var n;this.cs((a=>{n=a.find((s=>s.id===r))}));var i=!n||(function(a){var s;return tee(a)&&!((s=a.conditions)==null||(s=s.events)==null||!s.repeatedActivation)||a.schedule==="always"})(n);return i?e===Tu.SHOWN?"consume":"ignore":e===Tu.SHOWN?"persist":e===Tu.DISMISSED||e===Tu.SENT?"consume":"ignore"}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}}var l5="SDK is not enabled or survey functionality is not yet loaded",mee="Disabled. Not loading surveys.",aPe=at!=null&&at.location?KE(at.location.hash,"__posthog")||KE(location.hash,"state"):null,yee="_postHogToolbarParams",vee=Zn("[Toolbar]"),Hi=Zn("[FeatureFlags]"),Lf=Zn("[FeatureFlags]",{debugEnabled:!0}),PI=`" failed. Feature flags didn't load in time.`,bee=t=>{for(var e={},r=0;t.length>r;r++)e[t[r]]=!0;return e},xee=t=>{var e={};for(var r of WE(t||{})){var n=r[1];n&&(e[r[0]]=n)}return e},cc=Zn("[Error tracking]"),Tee="Refusing to render web experiment since the viewer is a likely bot",sPe={icontains:(t,e)=>e.toLowerCase().indexOf(t.toLowerCase())>-1,not_icontains:(t,e)=>e.toLowerCase().indexOf(t.toLowerCase())===-1,regex:(t,e)=>i5(e,t),not_regex:(t,e)=>!i5(e,t),exact:(t,e)=>e===t,is_not:(t,e)=>e!==t};class ns{get Te(){return this._instance.config}constructor(e){var r=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(n){n===void 0&&(n=!1),r.getWebExperiments((i=>{ns.$s("retrieved web experiments from the server"),r.Ls=new Map,i.forEach((a=>{if(a.feature_flag_key){var s;r.Ls&&(ns.$s("setting flag key ",a.feature_flag_key," to web experiment ",a),(s=r.Ls)==null||s.set(a.feature_flag_key,a));var o=r._instance.getFeatureFlag(a.feature_flag_key);Rn(o)&&a.variants[o]&&r.Ds(a.name,o,a.variants[o].transforms)}else if(a.variants)for(var l in a.variants){var u=a.variants[l];ns.Ns(u,r._instance)&&r.Ds(a.name,l,u.transforms)}}))}),n)},this._instance=e,this._instance.onFeatureFlags((n=>{this.onFeatureFlags(n)}))}initialize(){}onFeatureFlags(e){if(this._is_bot())ns.$s(Tee);else if(!this.Te.disable_web_experiments){if(zr(this.Ls))return this.Ls=new Map,this.loadIfEnabled(),void this.previewWebExperiment();ns.$s("applying feature flags",e),e.forEach((r=>{var n;if(this.Ls&&(n=this.Ls)!=null&&n.has(r)){var i,a=this._instance.getFeatureFlag(r),s=(i=this.Ls)==null?void 0:i.get(r);a&&s!=null&&s.variants[a]&&this.Ds(s.name,a,s.variants[a].transforms)}}))}}previewWebExperiment(){var e=ns.getWindowLocation();if(e!=null&&e.search){var r=Ag(e==null?void 0:e.search,"__experiment_id"),n=Ag(e==null?void 0:e.search,"__experiment_variant");r&&n&&(ns.$s("previewing web experiments "+r+" && "+n),this.getWebExperiments((i=>{this.qs(parseInt(r),n,i)}),!1,!0))}}loadIfEnabled(){this.Te.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,r,n){if(this.Te.disable_web_experiments&&!n)return e([]);var i=this._instance.get_property("$web_experiments");if(i&&!r)return e(i);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/web_experiments/?token="+this.Te.token),method:"GET",timestampMode:"query",callback:a=>e(a.statusCode===200&&a.json&&a.json.experiments||[])})}qs(e,r,n){var i=n.filter((a=>a.id===e));i&&i.length>0&&(ns.$s("Previewing web experiment ["+i[0].name+"] with variant ["+r+"]"),this.Ds(i[0].name,r,i[0].variants[r].transforms))}static Ns(e,r){return!zr(e.conditions)&&ns.js(e,r)&&ns.Bs(e)}static js(e,r){var n;if(zr(e.conditions)||zr((n=e.conditions)==null?void 0:n.url))return!0;var i=ns.getWindowLocation();if(i){var a,s,o,l=XQ(r,i.href);return(a=e.conditions)==null||!a.url||sPe[(s=(o=e.conditions)==null?void 0:o.urlMatchType)!==null&&s!==void 0?s:"icontains"](e.conditions.url,l)}return!1}static getWindowLocation(){return at==null?void 0:at.location}static Bs(e){var r;if(zr(e.conditions)||zr((r=e.conditions)==null?void 0:r.utm))return!0;var n=wJ();if(n.utm_source){var i,a,s,o,l,u,h,d,f=(i=e.conditions)==null||(i=i.utm)==null||!i.utm_campaign||((a=e.conditions)==null||(a=a.utm)==null?void 0:a.utm_campaign)==n.utm_campaign,p=(s=e.conditions)==null||(s=s.utm)==null||!s.utm_source||((o=e.conditions)==null||(o=o.utm)==null?void 0:o.utm_source)==n.utm_source,g=(l=e.conditions)==null||(l=l.utm)==null||!l.utm_medium||((u=e.conditions)==null||(u=u.utm)==null?void 0:u.utm_medium)==n.utm_medium,m=(h=e.conditions)==null||(h=h.utm)==null||!h.utm_term||((d=e.conditions)==null||(d=d.utm)==null?void 0:d.utm_term)==n.utm_term;return f&&g&&m&&p}return!1}static $s(e){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;r>i;i++)n[i-1]=arguments[i];Pt.info("[WebExperiments] "+e,n)}Ds(e,r,n){this._is_bot()?ns.$s(Tee):r!=="control"?n.forEach((i=>{if(i.selector){var a;ns.$s("applying transform of variant "+r+" for experiment "+e+" ",i);var s=(a=document)==null?void 0:a.querySelectorAll(i.selector);s==null||s.forEach((o=>{var l=o;i.html&&(l.innerHTML=i.html),i.css&&l.setAttribute("style",i.css)}))}})):ns.$s("Control variants leave the page unmodified.")}_is_bot(){return vs&&this._instance?KJ(vs,this.Te.custom_blocked_useragents):void 0}}var Ho=Zn("[Conversations]"),If="Conversations not available yet.",wee="console",c5={featureFlags:class{constructor(t){this.Hs=!1,this.Us=!1,this.zs=!1,this.Vs=!1,this.Ws=!1,this.Zs=!1,this.Gs=!1,this.Qs=!1,this.Js=0,this.Ks=()=>{var e=this.Ys();this.Js=0,e&&this.reloadFeatureFlags()},this._instance=t,this.featureFlagEventHandlers=[],at&&ui(at,"online",this.Ks)}destroy(){at==null||at.removeEventListener("online",this.Ks)}get Te(){return this._instance.config}get mi(){return this._instance.persistence}Xs(t){return this._instance.get_property(t)}eo(){var t,e;return(t=(e=this.mi)==null?void 0:e._r(this.Te.feature_flag_cache_ttl_ms))!==null&&t!==void 0&&t}ro(){return!!this.eo()&&(this.Qs||this.zs||(this.Qs=!0,Hi.warn("Feature flag cache is stale, triggering refresh..."),this.reloadFeatureFlags()),!0)}io(){var t,e=(t=this.Te.evaluation_contexts)!==null&&t!==void 0?t:this.Te.evaluation_environments;return!this.Te.evaluation_environments||this.Te.evaluation_contexts||this.Gs||(Hi.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.Gs=!0),e!=null&&e.length?e.filter((r=>{var n=r&&typeof r=="string"&&r.trim().length>0;return n||Hi.error("Invalid evaluation context found:",r,"Expected non-empty string"),n})):[]}no(){return this.io().length>0}so(){var t=this.Te.flag_keys;if(!Nt(t)){if(Br(t))return t.filter((e=>{var r=e&&typeof e=="string"&&e.trim().length>0;return r||Hi.error("Invalid flag key found:",e,"Expected non-empty string"),r}));Hi.error("Invalid flag_keys found:",t,"Expected array of non-empty strings")}}initialize(){var t,e,r=this._instance.config,n=(t=(e=r.bootstrap)==null?void 0:e.featureFlags)!==null&&t!==void 0?t:{};if(Object.keys(n).length){var i,a,s=(i=(a=r.bootstrap)==null?void 0:a.featureFlagPayloads)!==null&&i!==void 0?i:{},o=Object.keys(n).filter((u=>!!n[u])).reduce(((u,h)=>(u[h]=n[h]||!1,u)),{}),l=Object.keys(s).filter((u=>o[u])).reduce(((u,h)=>(s[h]&&(u[h]=s[h]),u)),{});this.receivedFeatureFlags({featureFlags:o,featureFlagPayloads:l})}}updateFlags(t,e,r){var n,i,a=r!=null&&r.merge&&(n=this.Xs(xf))!==null&&n!==void 0?n:{},s=r!=null&&r.merge&&(i=this.Xs(NE))!==null&&i!==void 0?i:{},o=wt({},a,t),l=wt({},s,e),u={};for(var h of Object.entries(o)){var d=h[0],f=h[1];u[d]={key:d,enabled:zZ(f),variant:GZ(f),reason:void 0,metadata:Nt(l==null?void 0:l[d])?void 0:{id:0,version:void 0,description:void 0,payload:l[d]}}}this.receivedFeatureFlags({flags:u})}get hasLoadedFlags(){return this.Us}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var t=this.Xs(GL),e=this.Xs(yu),r=this.Xs(kg);if(!r&&!e)return t||{};var n=Nn({},t||{}),i=[...new Set([...Object.keys(r||{}),...Object.keys(e||{})])];for(var a of i){var s,o,l=n[a],u=e==null?void 0:e[a],h=Nt(u)?(s=l==null?void 0:l.enabled)!==null&&s!==void 0&&s:!!u,d=Nt(u)?l.variant:typeof u=="string"?u:void 0,f=r==null?void 0:r[a],p=wt({},l,{enabled:h,variant:h?d??(l==null?void 0:l.variant):void 0});h!==(l==null?void 0:l.enabled)&&(p.original_enabled=l==null?void 0:l.enabled),d!==(l==null?void 0:l.variant)&&(p.original_variant=l==null?void 0:l.variant),f&&(p.metadata=wt({},l==null?void 0:l.metadata,{payload:f,original_payload:l==null||(o=l.metadata)==null?void 0:o.payload})),n[a]=p}return this.Hs||(Hi.warn(" Overriding feature flag details!",{flagDetails:t,overriddenPayloads:r,finalDetails:n}),this.Hs=!0),n}getAllFeatureFlags(){var t=this.getFlagVariants(),e=this.getFlagPayloads();return Object.keys(t).map((r=>{var n=t[r];return{key:r,enabled:zZ(n),variant:GZ(n),payload:FZ(e[r])}}))}getFlagVariants(){var t=this.Xs(xf),e=this.Xs(yu);if(!e)return t||{};for(var r=Nn({},t),n=Object.keys(e),i=0;n.length>i;i++)r[n[i]]=e[n[i]];return this.Hs||(Hi.warn(" Overriding feature flags!",{enabledFlags:t,overriddenFlags:e,finalFlags:r}),this.Hs=!0),r}getFlagPayloads(){var t=this.Xs(NE),e=this.Xs(kg);if(!e)return t||{};for(var r=Nn({},t||{}),n=Object.keys(e),i=0;n.length>i;i++)r[n[i]]=e[n[i]];return this.Hs||(Hi.warn(" Overriding feature flag payloads!",{flagPayloads:t,overriddenPayloads:e,finalPayloads:r}),this.Hs=!0),r}reloadFeatureFlags(){this.Vs||this.Te.advanced_disable_feature_flags||this.Ys()||this.oo||(this._instance.en.emit("featureFlagsReloading",!0),this.oo=setTimeout((()=>{this.ao()}),5))}lo(){clearTimeout(this.oo),this.oo=void 0}ensureFlagsLoaded(){this.Us||this.zs||this.oo||this.reloadFeatureFlags()}setAnonymousDistinctId(t){this.$anon_distinct_id=t}setReloadingPaused(t){this.Vs=t}ao(t){var e;if(this.lo(),!this._instance.Ur()&&!this.Ys())if(this.zs)this.Ws=!0;else{var r=this.Te.token,n=this.Xs(jx),i={token:r,distinct_id:this._instance.get_distinct_id(),groups:this._instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:wt({},((e=this.mi)==null?void 0:e.get_initial_props())||{},this.Xs(Tf)||{},{$lib:vn.LIB_NAME,$lib_version:vn.LIB_VERSION}),group_properties:this.Xs(wf),timezone:RJ()};bs(n)||Nt(n)||(i.$device_id=n),(t!=null&&t.disableFlags||this.Te.advanced_disable_feature_flags)&&(i.disable_flags=!0),this.no()&&(i.evaluation_contexts=this.io());var a=this.so();Nt(a)||(i.flag_keys=a);var s=!!this.Te.advanced_only_evaluate_survey_feature_flags,o=this._instance.requestRouter.endpointFor("flags","/flags/?v=2"+(this.Te.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":""));this.zs=!0,this._instance._send_request({method:"POST",url:o,data:i,compression:this.Te.disable_compression?void 0:xs.Base64,timestampMode:"body",timeout:this.Te.feature_flag_request_timeout_ms,callback:l=>{var u,h,d,f=!0;if(this.uo(l.statusCode),l.statusCode===200&&(this.Ws||(this.$anon_distinct_id=void 0),f=!1),this.zs=!1,!i.disable_flags||this.Ws){this.Zs=!f;var p=[];l.error?l.error instanceof Error?p.push(l.error.name==="AbortError"?"timeout":"connection_error"):p.push("unknown_error"):l.statusCode!==200&&p.push("api_error_"+l.statusCode),(u=l.json)!=null&&u.errorsWhileComputingFlags&&p.push("errors_while_computing_flags");var g,m=!((h=l.json)==null||(h=h.quotaLimited)==null||!h.includes("feature_flags"));m&&p.push("quota_limited"),(d=this.mi)==null||d.register({[HL]:p}),m?Hi.warn("You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset. Please visit https://posthog.com/docs/billing/limits-alerts to learn more."):(i.disable_flags||this.receivedFeatureFlags((g=l.json)!==null&&g!==void 0?g:{},f,{partialResponse:s}),this.Ws&&(this.Ws=!1,this.ao()))}}})}}Ys(){return xJ(this.Js,3)}uo(t){this.Js=TJ(t,this.Js,3,(()=>Hi.warn("Feature flag requests are failing before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped refreshing feature flags; will try again when connectivity changes.")))}getFeatureFlag(t,e){var r;if(e===void 0&&(e={}),!e.fresh||this.Zs)if(this.Us||this.getFlags()&&this.getFlags().length>0){if(!this.ro()){var n=this.getFeatureFlagResult(t,e);return(r=n==null?void 0:n.variant)!==null&&r!==void 0?r:n==null?void 0:n.enabled}}else Hi.warn('getFeatureFlag for key "'+t+PI)}getFeatureFlagDetails(t){return this.getFlagsWithDetails()[t]}getFeatureFlagPayload(t){var e=this.getFeatureFlagResult(t,{send_event:!1});return e==null?void 0:e.payload}getFeatureFlagResult(t,e){if(e===void 0&&(e={}),!e.fresh||this.Zs)if(this.Us||this.getFlags()&&this.getFlags().length>0){if(!this.ro()){var r=this.getFlagVariants(),n=t in r,i=r[t],a=this.getFlagPayloads()[t],s=String(i),o=this.Xs(qL)||void 0,l=this.Xs(tT)||void 0,u=this.Xs(eT)||{};if(this.Te.advanced_feature_flags_dedup_per_session){var h,d=this._instance.get_session_id(),f=this.Xs(UL);d&&d!==f&&(u={},(h=this.mi)==null||h.register({[eT]:u,[UL]:d}))}if((e.send_event||!("send_event"in e))&&(!(t in u)||!u[t].includes(s))){var p,g,m,y,v,x,b,w,C,_,k;Br(u[t])?u[t].push(s):u[t]=[s],(p=this.mi)==null||p.register({[eT]:u});var S=this.getFeatureFlagDetails(t),L=[...(g=this.Xs(HL))!==null&&g!==void 0?g:[]];Nt(i)&&L.push("flag_missing");var $={$feature_flag:t,$feature_flag_response:i,$feature_flag_payload:a||null,$feature_flag_request_id:o,$feature_flag_evaluated_at:l,$feature_flag_bootstrapped_response:((m=this.Te.bootstrap)==null||(m=m.featureFlags)==null?void 0:m[t])||null,$feature_flag_bootstrapped_payload:((y=this.Te.bootstrap)==null||(y=y.featureFlagPayloads)==null?void 0:y[t])||null,$used_bootstrap_value:!this.Zs};Nt(S==null||(v=S.metadata)==null?void 0:v.has_experiment)||($.$feature_flag_has_experiment=S.metadata.has_experiment),Nt(S==null||(x=S.metadata)==null?void 0:x.version)||($.$feature_flag_version=S.metadata.version);var I,z=(b=S==null||(w=S.reason)==null?void 0:w.description)!==null&&b!==void 0?b:S==null||(C=S.reason)==null?void 0:C.code;z&&($.$feature_flag_reason=z),S!=null&&(_=S.metadata)!=null&&_.id&&($.$feature_flag_id=S.metadata.id),Nt(S==null?void 0:S.original_variant)&&Nt(S==null?void 0:S.original_enabled)||($.$feature_flag_original_response=Nt(S.original_variant)?S.original_enabled:S.original_variant),S!=null&&(k=S.metadata)!=null&&k.original_payload&&($.$feature_flag_original_payload=S==null||(I=S.metadata)==null?void 0:I.original_payload),L.length&&($.$feature_flag_error=L.join(",")),this._instance.capture("$feature_flag_called",$)}if(n)return{key:t,enabled:!!i,variant:typeof i=="string"?i:void 0,payload:FZ(a)}}}else Hi.warn('getFeatureFlagResult for key "'+t+PI)}getRemoteConfigPayload(t,e){var r=this.Te.token,n={distinct_id:this._instance.get_distinct_id(),token:r,person_properties:{$lib:vn.LIB_NAME,$lib_version:vn.LIB_VERSION}};this.no()&&(n.evaluation_contexts=this.io());var i=this.so();Nt(i)||(n.flag_keys=i),this._instance._send_request({method:"POST",url:this._instance.requestRouter.endpointFor("flags","/flags/?v=2"),data:n,compression:this.Te.disable_compression?void 0:xs.Base64,timestampMode:"body",timeout:this.Te.feature_flag_request_timeout_ms,callback(a){var s,o=(s=a.json)==null?void 0:s.featureFlagPayloads;e((o==null?void 0:o[t])||void 0)}})}isFeatureEnabled(t,e){if(e===void 0&&(e={}),e.fresh&&!this.Zs)return e.defaultValue;if(!(this.Us||this.getFlags()&&this.getFlags().length>0))return Hi.warn('isFeatureEnabled for key "'+t+PI),e.defaultValue;var r=this.getFeatureFlag(t,e);return Nt(r)?e.defaultValue:!!r}addFeatureFlagsHandler(t){this.featureFlagEventHandlers.push(t)}removeFeatureFlagsHandler(t){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter((e=>e!==t))}receivedFeatureFlags(t,e,r){if(this.mi){this.Us=!0;var n=this.getFlagVariants(),i=this.getFlagPayloads(),a=this.getFlagsWithDetails();(function(s,o,l,u,h,d){l===void 0&&(l={}),u===void 0&&(u={}),h===void 0&&(h={});var f=(S=>{var L=S.flags;return L?(S.featureFlags=Object.fromEntries(Object.keys(L).map(($=>{var I;return[$,(I=L[$].variant)!==null&&I!==void 0?I:L[$].enabled]}))),S.featureFlagPayloads=Object.fromEntries(Object.keys(L).filter(($=>L[$].enabled)).filter(($=>{var I;return(I=L[$].metadata)==null?void 0:I.payload})).map(($=>{var I;return[$,(I=L[$].metadata)==null?void 0:I.payload]})))):S.featureFlags&&Hi.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),S})(s),p=f.flags,g=f.featureFlags,m=f.featureFlagPayloads;if(g){var y=s.requestId,v=s.evaluatedAt;if(Br(g)){Hi.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var x={};if(g)for(var b=0;g.length>b;b++)x[g[b]]=!0;o&&o.register({[ME]:g,[xf]:x,[$E]:!1})}else{var w=g,C=m,_=p;if(d!=null&&d.partialResponse)w=wt({},l,w),C=wt({},u,C),_=wt({},h,_);else if(s.errorsWhileComputingFlags)if(p){var k=new Set(Object.keys(p).filter((S=>{var L;return!((L=p[S])!=null&&L.failed)})));w=wt({},l,Object.fromEntries(Object.entries(w).filter((S=>k.has(S[0]))))),C=wt({},u,Object.fromEntries(Object.entries(C||{}).filter((S=>k.has(S[0]))))),_=wt({},h,Object.fromEntries(Object.entries(_||{}).filter((S=>k.has(S[0])))))}else w=wt({},l,w),C=wt({},u,C),_=wt({},h,_);o&&o.register(wt({[ME]:Object.keys(xee(w)),[xf]:w||{},[NE]:C||{},[GL]:_||{},[$E]:s.minimalFlagCalledEvents===!0},y?{[qL]:y}:{},v?{[tT]:v}:{}))}}})(t,this.mi,n,i,a,r),e||(this.Qs=!1),this.ho(e)}}override(t,e){e===void 0&&(e=!1),Hi.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:t,suppressWarning:e})}overrideFeatureFlags(t){if(!this._instance.__loaded||!this.mi)return Hi.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(t===!1)return this.mi.unregister(yu),this.mi.unregister(kg),this.ho(),Lf.info("All overrides cleared");if(Br(t)){var e=bee(t);return this.mi.register({[yu]:e}),this.ho(),Lf.info("Flag overrides set",{flags:t})}if(t&&typeof t=="object"&&("flags"in t||"payloads"in t)){var r,n=t;if(this.Hs=!!((r=n.suppressWarning)!==null&&r!==void 0&&r),"flags"in n){if(n.flags===!1)this.mi.unregister(yu),Lf.info("Flag overrides cleared");else if(n.flags){if(Br(n.flags)){var i=bee(n.flags);this.mi.register({[yu]:i})}else this.mi.register({[yu]:n.flags});Lf.info("Flag overrides set",{flags:n.flags})}}return"payloads"in n&&(n.payloads===!1?(this.mi.unregister(kg),Lf.info("Payload overrides cleared")):n.payloads&&(this.mi.register({[kg]:n.payloads}),Lf.info("Payload overrides set",{payloads:n.payloads}))),void this.ho()}if(t&&typeof t=="object")return this.mi.register({[yu]:t}),this.ho(),Lf.info("Flag overrides set",{flags:t});Hi.warn("Invalid overrideOptions provided to overrideFeatureFlags",{overrideOptions:t})}onFeatureFlags(t){if(this.addFeatureFlagsHandler(t),this.Us){var e=this.do(),r=e.flags,n=e.flagVariants;try{t(r,n)}catch(i){Hi.error("Error while running feature flags callback",i)}}return()=>this.removeFeatureFlagsHandler(t)}updateEarlyAccessFeatureEnrollment(t,e,r){var n,i=(this.Xs(Qx)||[]).find((l=>l.flagKey===t)),a={["$feature_enrollment/"+t]:e},s={$feature_flag:t,$feature_enrollment:e,$set:a};i&&(s.$early_access_feature_name=i.name),r&&(s.$feature_enrollment_stage=r),this._instance.capture("$feature_enrollment_update",s),this.setPersonPropertiesForFlags(a,!1);var o=wt({},this.getFlagVariants(),{[t]:e});(n=this.mi)==null||n.register({[ME]:Object.keys(xee(o)),[xf]:o}),this.ho()}getEarlyAccessFeatures(t,e,r){e===void 0&&(e=!1);var n=this.Xs(Qx),i=r?"&"+r.map((a=>"stage="+a)).join("&"):"";if(n&&!e)return t(n);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/early_access_features/?token="+this.Te.token+i),method:"GET",timestampMode:"query",callback:a=>{var s,o;if(a.json){var l=a.json.earlyAccessFeatures;return(s=this.mi)==null||s.unregister(Qx),(o=this.mi)==null||o.register({[Qx]:l}),t(l)}}})}do(){var t=this.getFlags(),e=this.getFlagVariants();return{flags:t.filter((r=>e[r])),flagVariants:Object.keys(e).filter((r=>e[r])).reduce(((r,n)=>(r[n]=e[n],r)),{})}}ho(t){var e=this.do(),r=e.flags,n=e.flagVariants;this.featureFlagEventHandlers.forEach((i=>{try{i(r,n,{errorsLoading:t})}catch(a){Hi.error("Error while running feature flags callback",a)}}))}setPersonPropertiesForFlags(t,e){e===void 0&&(e=!0);var r=this.Xs(Tf)||{},n=(t==null?void 0:t.$set)||(t!=null&&t.$set_once?{}:t),i=t==null?void 0:t.$set_once,a={};if(i)for(var s in i)({}).hasOwnProperty.call(i,s)&&(s in r||(a[s]=i[s]));this._instance.register({[Tf]:wt({},r,a,n)}),e&&this._instance.reloadFeatureFlags()}unsetPersonPropertiesForFlags(t,e){e===void 0&&(e=!0);var r=wt({},this.Xs(Tf)||{});t.forEach((n=>{delete r[n]})),this._instance.register({[Tf]:r}),e&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(t){t===void 0&&(t=!0),this._instance.unregister(Tf),t&&this._instance.reloadFeatureFlags()}setGroupPropertiesForFlags(t,e){e===void 0&&(e=!0);var r=this.Xs(wf)||{};Object.keys(r).length!==0&&Object.keys(r).forEach((n=>{r[n]=wt({},r[n],t[n]),delete t[n]})),this._instance.register({[wf]:wt({},r,t)}),e&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(t){if(t){var e=this.Xs(wf)||{};this._instance.register({[wf]:wt({},e,{[t]:{}})})}else this._instance.unregister(wf)}reset(){this.Us=!1,this.zs=!1,this.Vs=!1,this.Ws=!1,this.Zs=!1,this.$anon_distinct_id=void 0,this.lo(),this.Hs=!1,this.Js=0}}},oPe={sessionRecording:class{get Te(){return this._instance.config}get mi(){return this._instance.persistence}get started(){var t;return!((t=this.co)==null||!t.isStarted)}get status(){var t,e;return this.vo===gT||this.vo===o5?this.vo:(t=(e=this.co)==null?void 0:e.status)!==null&&t!==void 0?t:this.vo}constructor(t){if(this._forceAllowLocalhostNetworkCapture=!1,this.vo=fee,this.fo=void 0,this._instance=t,!this._instance.sessionManager)throw Cu.error("started without valid sessionManager"),new Error(MI+" started without valid sessionManager. This is a bug.");if(this.Te.cookieless_mode===vu)throw new Error(MI+' cannot be used with cookieless_mode="always"')}initialize(){this.startIfEnabledOrStop()}get po(){var t,e=!((t=this._instance.get_property(bf))==null||!t.enabled),r=!this.Te.disable_session_recording,n=this.Te.disable_session_recording||this._instance.consent.isOptedOut();return at&&e&&r&&!n}startIfEnabledOrStop(t){var e;if(!this.po||(e=this.co)==null||!e.isStarted){var r=!Nt(Object.assign)&&!Nt(Array.from);this.po&&r?(this.mo(t),Cu.info("starting")):(this.vo=fee,this.stopRecording())}}mo(t){var e,r,n;this.po&&(this.vo!==gT&&this.vo!==o5&&(this.vo=pee),fr!=null&&(e=fr.__PosthogExtensions__)!=null&&(e=e.rrweb)!=null&&e.record&&(r=fr.__PosthogExtensions__)!=null&&r.initSessionRecording?this.yo(t):(n=fr.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,this.bo,(i=>{if(i)return Cu.error("could not load recorder",i);this.yo(t)})))}stopRecording(){var t,e;(t=this.fo)==null||t.call(this),this.fo=void 0,(e=this.co)==null||e.stop()}_o(){var t,e;(t=this.fo)==null||t.call(this),this.fo=void 0,(e=this.co)==null||e.discard()}wo(){var t,e;(t=this.mi)==null||t.unregister(zL),(e=this.mi)==null||e.unregister(MQ)}xo(t,e){if(zr(t))return null;var r,n=Na(t)?t:parseFloat(t);return typeof(r=n)!="number"||!Number.isFinite(r)||0>r||r>1?(Cu.warn(e+" must be between 0 and 1. Ignoring invalid value:",t),null):n}ko(t){if(this.mi){var e,r,n=this.mi,i=()=>{var a,s=t.sessionRecording===!1?void 0:t.sessionRecording,o=this.xo((a=this.Te.session_recording)==null?void 0:a.sampleRate,"session_recording.sampleRate"),l=this.xo(s==null?void 0:s.sampleRate,"remote config sampleRate"),u=o??l;zr(u)&&this.wo();var h=s==null?void 0:s.minimumDurationMilliseconds;n.register({[bf]:wt({cache_timestamp:Date.now(),enabled:!!s},s,{networkPayloadCapture:wt({capturePerformance:t.capturePerformance},s==null?void 0:s.networkPayloadCapture),canvasRecording:{enabled:s==null?void 0:s.recordCanvas,fps:s==null?void 0:s.canvasFps,quality:s==null?void 0:s.canvasQuality},sampleRate:u,minimumDurationMilliseconds:Nt(h)?null:h,endpoint:s==null?void 0:s.endpoint,triggerMatchType:s==null?void 0:s.triggerMatchType,masking:s==null?void 0:s.masking,urlTriggers:s==null?void 0:s.urlTriggers,version:s==null?void 0:s.version,triggerGroups:s==null?void 0:s.triggerGroups})})};i(),(e=this.fo)==null||e.call(this),this.fo=(r=this._instance.sessionManager)==null?void 0:r.onSessionId(i)}}onRemoteConfig(t){var e=t.ok?t.config:void 0;return e&&"sessionRecording"in e?e.sessionRecording===!1?(this.ko(e),void this._o()):(this.ko(e),void this.startIfEnabledOrStop()):(this.vo===gT&&(this.vo=o5,Cu.warn("config refresh failed, recording will not start until page reload")),void this.startIfEnabledOrStop())}log(t,e){var r;e===void 0&&(e="log"),(r=this.co)!=null&&r.log?this.co.log(t,e):Cu.warn("log called before recorder was ready")}get bo(){var t,e,r=(t=this._instance)==null||(t=t.persistence)==null?void 0:t.get_property(bf);return(r==null||(e=r.scriptConfig)==null?void 0:e.script)||"lazy-recorder"}So(){var t,e,r=this._instance.get_property(bf);if(!r)return!1;try{e=typeof r=="object"?r:JSON.parse(r)}catch(i){return Cu.warn("persisted remote config for session recording is invalid and will be ignored",i),!1}var n=(t=e.cache_timestamp)!==null&&t!==void 0?t:Date.now();return 36e5>=Date.now()-n}yo(t){var e,r;if((e=fr.__PosthogExtensions__)==null||!e.initSessionRecording)return Cu.warn("Called on script loaded before session recording is available. This can be caused by adblockers."),void this._instance.register_for_session({[GQ]:!0});if(this.co||(this.co=(r=fr.__PosthogExtensions__)==null?void 0:r.initSessionRecording(this._instance),this.co._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this.So())return this.vo===o5||this.vo===gT?void 0:(this.vo=gT,Cu.info("persisted remote config is stale, requesting fresh config before starting"),void new DJ(this._instance).load());this.vo=pee,this.co.start(t)}onRRwebEmit(t){var e;(e=this.co)==null||e.onRRwebEmit==null||e.onRRwebEmit(t)}overrideLinkedFlag(){var t,e;this.co||(e=this.mi)==null||e.register({[$Q]:!0}),(t=this.co)==null||t.overrideLinkedFlag()}overrideSampling(){var t,e;this.co||(e=this.mi)==null||e.register({[NQ]:!0}),(t=this.co)==null||t.overrideSampling()}overrideTrigger(t){var e,r;this.co||(r=this.mi)==null||r.register({[t==="url"?OQ:PQ]:!0}),(e=this.co)==null||e.overrideTrigger(t)}get sdkDebugProperties(){var t;return((t=this.co)==null?void 0:t.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(t,e){var r;return!((r=this.co)==null||!r.tryAddCustomEvent(t,e))}}},lPe={autocapture:class{constructor(t){this.Co=!1,this.Mo=null,this.Io=!1,this.To=!1,this.instance=t,this.rageclicks=new uee(t.config.rageclick),this.Eo=null}initialize(){this.startIfEnabled()}get Te(){var t,e,r=Kn(this.instance.config.autocapture)?this.instance.config.autocapture:{};return r.url_allowlist=(t=r.url_allowlist)==null?void 0:t.map((n=>new RegExp(n))),r.url_ignorelist=(e=r.url_ignorelist)==null?void 0:e.map((n=>new RegExp(n))),r}Ro(){if(this.isBrowserSupported()){if(at&&Wt){var t=r=>{r=r||(at==null?void 0:at.event);try{this.Po(r)}catch(n){II.error("Failed to capture event",n)}};if(ui(Wt,"submit",t,{capture:!0}),ui(Wt,"change",t,{capture:!0}),ui(Wt,"click",t,{capture:!0}),this.Te.capture_copied_text){var e=r=>{r=r||(at==null?void 0:at.event);try{this.Po(r,LI)}catch(n){II.error("Failed to capture copy/cut event",n)}};ui(Wt,"copy",e,{capture:!0}),ui(Wt,"cut",e,{capture:!0})}}}else II.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this.Co&&(this.Ro(),this.Co=!0)}onRemoteConfig(t){if(this.Io=!0,t.ok){var e=t.config;e.elementsChainAsString&&(this.To=e.elementsChainAsString);var r=e.autocapture_opt_out;Tl(r)&&(this.instance.persistence&&this.instance.persistence.register({[IL]:r}),this.Mo=r),this.startIfEnabled()}else this.startIfEnabled()}setElementSelectors(t){this.Eo=t}getElementSelectors(t){var e,r=[];return(e=this.Eo)==null||e.forEach((n=>{var i=Wt==null?void 0:Wt.querySelectorAll(n);i==null||i.forEach((a=>{t===a&&r.push(n)}))})),r}get isEnabled(){var t,e,r=(t=this.instance.persistence)==null?void 0:t.props[IL],n=this.Mo,i=this.instance.Ur()&&!this.Io;if(bs(n)&&!Tl(r)&&!i)return!1;var a=(e=this.Mo)!==null&&e!==void 0?e:!!r;return!!this.instance.config.autocapture&&!a}Po(t,e){if(e===void 0&&(e="$autocapture"),this.isEnabled){var r,n=iI(t);ZQ(n)&&(n=n.parentNode||null),e==="$autocapture"&&t.type==="click"&&t instanceof MouseEvent&&this.instance.config.rageclick&&(r=this.rageclicks)!=null&&r.isRageClick(t.clientX,t.clientY,t.timeStamp||new Date().getTime())&&sJ(n,this.instance.config.rageclick)&&this.Po(t,"$rageclick");var i=e===LI;if(n&&(function(d,f,p,g,m,y){var v;if(!at||oI(d)||p!=null&&p.url_allowlist&&!eJ(p.url_allowlist,y)||p!=null&&p.url_ignorelist&&eJ(p.url_ignorelist,y))return!1;if(p!=null&&p.dom_event_allowlist){var x=p.dom_event_allowlist;if(x&&!x.some((S=>f.type===S)))return!1}var b=oJ(d,g),w=b.parentIsUsefulElement,C=b.targetElementList;if(!(function(S,L){var $=L==null?void 0:L.element_allowlist;if(Nt($))return!0;var I,z=function(A){if($.some((R=>A.tagName.toLowerCase()===R)))return{v:!0}};for(var F of S)if(I=z(F))return I.v;return!1})(C,p)||!sI(C,p==null?void 0:p.css_selector_allowlist)||sI(C,(v=p==null?void 0:p.css_selector_ignorelist)!==null&&v!==void 0?v:sOe))return!1;try{var _=at.getComputedStyle(d);if(_&&_.getPropertyValue("cursor")==="pointer"&&f.type==="click")return!0}catch{}var k=d.tagName.toLowerCase();switch(k){case"html":return!1;case"form":return(m||["submit"]).indexOf(f.type)>=0;case"input":case"select":case"textarea":return(m||["change","click"]).indexOf(f.type)>=0;default:return w?(m||["click"]).indexOf(f.type)>=0:(m||["click"]).indexOf(f.type)>=0&&(aI.indexOf(k)>-1||d.getAttribute("contenteditable")==="true")}})(n,t,this.Te,i,i?["copy","cut"]:void 0,this.instance)){var a=QOe(n,{e:t,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.Te.element_attribute_ignorelist,elementsChainAsString:this.To,disableCaptureUrlHashes:this.instance.config.disable_capture_url_hashes}),s=a.props;if(a.explicitNoCapture)return!1;var o=this.getElementSelectors(n);if(o&&o.length>0&&(s.$element_selectors=o),e===LI){var l,u=tJ(at==null||(l=at.getSelection())==null?void 0:l.toString()),h=t.type||"clipboard";if(!u)return!1;s.$selected_content=u,s.$copy_type=h}return this.instance.capture(e,s),!0}}}isBrowserSupported(){return bo(Wt==null?void 0:Wt.querySelectorAll)}},historyAutocapture:class{constructor(t){var e;this._instance=t,this.Oo=(at==null||(e=at.location)==null?void 0:e.pathname)||""}initialize(){this.startIfEnabled()}get isEnabled(){return this._instance.config.capture_pageview==="history_change"}startIfEnabled(){this.isEnabled&&(Pt.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.Fo&&this.Fo(),this.Fo=void 0,Pt.info("History API monitoring stopped")}monitorHistoryChanges(){at&&at.history&&(this.Ao("pushState"),this.Ao("replaceState"),this.$o())}Ao(t){var e;if(at&&((e=at.history[t])==null||!e.__posthog_wrapped__)){var r=this;(function(n,i,a){try{if(!(i in n))return hee;var s={next:n[i]},o=a((function(){for(var l=arguments.length,u=new Array(l),h=0;l>h;h++)u[h]=arguments[h];return s.next.apply(this,u)}));return bo(o)&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__posthog_wrapped__:{enumerable:!1,value:!0},__posthog_layer__:{enumerable:!1,value:s}})),n[i]=o,()=>{if(n[i]!==o)for(var l=n[i];bo(l)&&l.__posthog_layer__;){var u=l.__posthog_layer__;if(u.next===o)return void(u.next=s.next);l=u.next}else n[i]=s.next}}catch{return hee}})(at.history,t,(n=>function(i,a,s){n.call(this,i,a,s),r.Lo(t)}))}}Lo(t){try{var e,r=at==null||(e=at.location)==null?void 0:e.pathname;if(!r)return;r!==this.Oo&&this.isEnabled&&this._instance.capture(Sg,{navigation_type:t}),this.Oo=r}catch(n){Pt.error("Error capturing "+t+" pageview",n)}}$o(){if(!this.Fo){var t=()=>{this.Lo("popstate")};ui(at,"popstate",t),this.Fo=()=>{at&&at.removeEventListener("popstate",t)}}}},heatmaps:class{get Te(){return this.instance.config}constructor(t){var e;this.Do=!1,this.Co=!1,this.No=null,this.instance=t,this.Do=!((e=this.instance.persistence)==null||!e.props[DL]),this.rageclicks=new uee(t.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){var t=5e3;return Kn(this.Te.capture_heatmaps)&&this.Te.capture_heatmaps.flush_interval_milliseconds&&(t=this.Te.capture_heatmaps.flush_interval_milliseconds),t}get isEnabled(){return zr(this.Te.capture_heatmaps)?zr(this.Te.enable_heatmaps)?this.Do:this.Te.enable_heatmaps:this.Te.capture_heatmaps!==!1}startIfEnabled(){if(this.isEnabled){if(this.Co)return;ePe.info("starting..."),this.qo(),this.xe()}else{var t;clearInterval((t=this.No)!==null&&t!==void 0?t:void 0),this.jo(),this.getAndClearBuffer()}}onRemoteConfig(t){if(t.ok){var e=t.config;if("heatmaps"in e){var r=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[DL]:r}),this.Do=r,this.startIfEnabled()}}}getAndClearBuffer(){var t=this.R;return this.R=void 0,t}Bo(t){NI(t.originalEvent)&&this.pe(t.originalEvent,"deadclick")}xe(){this.No&&clearInterval(this.No),this.No=(Wt==null?void 0:Wt.visibilityState)==="visible"?setInterval(this.oi.bind(this),this.flushIntervalMilliseconds):null}qo(){at&&Wt&&(this.Ho=this.oi.bind(this),ui(at,qE,this.Ho),this.Uo=t=>this.pe(t||(at==null?void 0:at.event)),ui(Wt,"click",this.Uo,{capture:!0}),this.zo=t=>this.Vo(t||(at==null?void 0:at.event)),ui(Wt,"mousemove",this.zo,{capture:!0}),this.Wo=new mJ(this.instance,fOe,this.Bo.bind(this)),this.Wo.startIfEnabledOrStop(),this.Zo=this.xe.bind(this),ui(Wt,GE,this.Zo),this.Co=!0)}jo(){var t;at&&Wt&&(this.Ho&&at.removeEventListener(qE,this.Ho),this.Uo&&Wt.removeEventListener("click",this.Uo,{capture:!0}),this.zo&&Wt.removeEventListener("mousemove",this.zo,{capture:!0}),this.Zo&&Wt.removeEventListener(GE,this.Zo),clearTimeout(this.Go),(t=this.Wo)==null||t.stop(),this.Co=!1)}Qo(t,e){var r=this.instance.scrollManager.scrollY(),n=this.instance.scrollManager.scrollX(),i=this.instance.scrollManager.scrollElement(),a=(function(s,o,l){for(var u=s;u&&Ph(u)&&!To(u,"body");){if(u===l)return!1;var h=void 0;try{var d,f,p;h=(d=(f=(p=u.ownerDocument)==null?void 0:p.defaultView)!==null&&f!==void 0?f:at)==null?void 0:d.getComputedStyle(u).position}catch{return!1}if(Rr(o,h))return!0;u=rJ(u)}return!1})(iI(t),["fixed","sticky"],i);return{x:t.clientX+(a?0:n),y:t.clientY+(a?0:r),target_fixed:a,type:e}}pe(t,e){var r;if(e===void 0&&(e="click"),!KQ(t.target)&&NI(t)){var n=this.Qo(t,e);(r=this.rageclicks)!=null&&r.isRageClick(t.clientX,t.clientY,new Date().getTime())&&sJ(iI(t),this.instance.config.rageclick)&&this.Wt(wt({},n,{type:"rageclick"})),this.Wt(n)}}Vo(t){!KQ(t.target)&&NI(t)&&(clearTimeout(this.Go),this.Go=setTimeout((()=>{this.Wt(this.Qo(t,"mousemove"))}),500))}Wt(t){if(at){var e=this.Te.disable_capture_url_hashes?Oh(at.location.href):at.location.href,r=this.Te.custom_personal_data_properties,n=this.Te.mask_personal_data_properties?[...Rg,...r||[]]:[],i=aT(e,n,sT);this.R=this.R||{},this.R[i]||(this.R[i]=[]),this.R[i].push(t)}}oi(){this.R&&!$h(this.R)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:mJ,webVitalsAutocapture:class{constructor(t){var e;this.Do=!1,this.Co=!1,this.R={url:void 0,metrics:[],firstMetricTimestamp:void 0},this.Jo=()=>{clearTimeout(this.Ko),this.R.metrics.length!==0&&(this._instance.capture("$web_vitals",this.R.metrics.reduce(((r,n)=>wt({},r,{["$web_vitals_"+n.name+"_event"]:wt({},n),["$web_vitals_"+n.name+"_value"]:n.value})),{})),this.R={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.Yo=r=>{var n;this.R=this.R||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var i=this.Xo();if(!Nt(i))if(zr(r==null?void 0:r.name)||zr(r==null?void 0:r.value))Rf.error("Invalid metric received",r);else if(!this.ta||this.ta>r.value){this.R.url!==i&&(this.Jo(),this.Ko=setTimeout(this.Jo,this.flushToCaptureTimeoutMs)),Nt(this.R.url)&&(this.R.url=i),this.R.firstMetricTimestamp=Nt(this.R.firstMetricTimestamp)?Date.now():this.R.firstMetricTimestamp,r.attribution&&r.attribution.interactionTargetElement&&(r.attribution.interactionTargetElement=void 0);var a=(n=this._instance.sessionManager)==null?void 0:n.checkAndGetSessionAndWindowId(!0),s=wt({},r,{$current_url:i,timestamp:Date.now()});Nt(a)||(s.$session_id=a.sessionId,s.$window_id=a.windowId),this.R.metrics.push(s),this.R.metrics.length===this.allowedMetrics.length&&this.Jo()}else Rf.error("Ignoring metric with value >= "+this.ta,r)},this.ea=()=>{if(!this.Co){var r,n,i,a,s=fr.__PosthogExtensions__;if(!Nt(s)&&!Nt(s.postHogWebVitalsCallbacks)){var o=s.postHogWebVitalsCallbacks;r=o.onLCP,n=o.onCLS,i=o.onFCP,a=o.onINP}r&&n&&i&&a?(this.allowedMetrics.indexOf("LCP")>-1&&r(this.Yo.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&n(this.Yo.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&i(this.Yo.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&a(this.Yo.bind(this)),this.Co=!0):Rf.error("web vitals callbacks not loaded - not starting")}},this._instance=t,this.Do=!((e=this._instance.persistence)==null||!e.props[OL]),this.startIfEnabled()}get ra(){return this._instance.config.capture_performance}get allowedMetrics(){var t,e,r=Kn(this.ra)?(t=this.ra)==null?void 0:t.web_vitals_allowed_metrics:void 0;return zr(r)?((e=this._instance.persistence)==null?void 0:e.props[FL])||["CLS","FCP","INP","LCP"]:r}get flushToCaptureTimeoutMs(){return(Kn(this.ra)?this.ra.web_vitals_delayed_flush_ms:void 0)||5e3}get useAttribution(){var t=Kn(this.ra)?this.ra.web_vitals_attribution:void 0;return t!=null&&t}get ta(){var t=Kn(this.ra)&&Na(this.ra.__web_vitals_max_value)?this.ra.__web_vitals_max_value:dee;return t>0&&6e4>=t?dee:t}get isEnabled(){var t=Ni==null?void 0:Ni.protocol;if(t!=="http:"&&t!=="https:")return Rf.info("Web Vitals are disabled on non-http/https protocols"),!1;var e=Kn(this.ra)?this.ra.web_vitals:Tl(this.ra)?this.ra:void 0;return Tl(e)?e:this.Do}startIfEnabled(){this.isEnabled&&!this.Co&&(Rf.info("enabled, starting..."),this.tr(this.ea))}onRemoteConfig(t){if(t.ok){var e=t.config;if("capturePerformance"in e){var r=Kn(e.capturePerformance)&&!!e.capturePerformance.web_vitals,n=Kn(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[OL]:r}),this._instance.persistence.register({[FL]:n})),this.Do=r,this.startIfEnabled()}}}tr(t){var e,r;(e=fr.__PosthogExtensions__)!=null&&e.postHogWebVitalsCallbacks?t():(r=fr.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,this.useAttribution?"web-vitals-with-attribution":"web-vitals",(n=>{n?Rf.error("failed to load script",n):t()}))}Xo(){var t=at?this._instance.config.disable_capture_url_hashes?Oh(at.location.href):at.location.href:void 0;if(t){var e=this._instance.config.custom_personal_data_properties,r=this._instance.config.mask_personal_data_properties?[...Rg,...e||[]]:[];return aT(t,r,sT)}Rf.error("Could not determine current URL")}}},cPe={exceptionObserver:class{constructor(t){var e;this.ea=()=>{var r;if(at&&this.isEnabled&&(r=fr.__PosthogExtensions__)!=null&&r.errorWrappingFunctions){var n=fr.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,i=fr.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,a=fr.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.ia&&this.Te.capture_unhandled_errors&&(this.ia=n(this.captureException.bind(this))),!this.na&&this.Te.capture_unhandled_rejections&&(this.na=i(this.captureException.bind(this))),!this.sa&&this.Te.capture_console_errors&&(this.sa=a(this.captureException.bind(this)))}catch(s){pT.error("failed to start",s),this.oa()}}},this._instance=t,this.aa=!((e=this._instance.persistence)==null||!e.props[ML]),this.la=new l$e(wt({},(function(r){var n,i,a,s;return r===void 0&&(r={}),{refillRate:(n=(i=r.exceptionRateLimiterRefillRate)!==null&&i!==void 0?i:r.__exceptionRateLimiterRefillRate)!==null&&n!==void 0?n:1,bucketSize:(a=(s=r.exceptionRateLimiterBucketSize)!==null&&s!==void 0?s:r.__exceptionRateLimiterBucketSize)!==null&&a!==void 0?a:10}})(this._instance.config.error_tracking),{refillInterval:1e4,it:pT})),this.Te=this.ua(),this.startIfEnabledOrStop()}ua(){var t=this._instance.config.capture_exceptions,e={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return Kn(t)?e=wt({},e,t):(Nt(t)?this.aa:t)&&(e=wt({},e,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),e}get isEnabled(){return this.Te.capture_console_errors||this.Te.capture_unhandled_errors||this.Te.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(pT.info("enabled"),this.oa(),this.tr(this.ea)):this.oa()}tr(t){var e,r;(e=fr.__PosthogExtensions__)!=null&&e.errorWrappingFunctions?t():(r=fr.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,"exception-autocapture",(n=>{if(n)return pT.error("failed to load script",n);t()}))}oa(){var t,e,r;(t=this.ia)==null||t.call(this),this.ia=void 0,(e=this.na)==null||e.call(this),this.na=void 0,(r=this.sa)==null||r.call(this),this.sa=void 0}onRemoteConfig(t){if(t.ok){var e=t.config;"autocaptureExceptions"in e&&(this.aa=!!e.autocaptureExceptions||!1,this._instance.persistence&&this._instance.persistence.register({[ML]:this.aa}),this.Te=this.ua(),this.startIfEnabledOrStop())}}onConfigChange(){this.Te=this.ua()}captureException(t){var e,r,n,i=(e=t==null||(r=t.$exception_list)==null||(r=r[0])==null?void 0:r.type)!==null&&e!==void 0?e:"Exception";this.la.consumeRateLimit(i)?pT.info("Skipping exception capture because of client rate limiting.",{exception:i}):(n=this._instance.exceptions)==null||n.sendExceptionEvent(t)}},exceptions:class{constructor(t){var e,r;this.ha=[],this.da=new E$e([new M$e,new q$e,new $$e,new N$e,new z$e,new F$e,new P$e,new G$e],(function(n){for(var i=arguments.length,a=new Array(i>1?i-1:0),s=1;i>s;s++)a[s-1]=arguments[s];return function(o,l){l===void 0&&(l=0);for(var u=[],h=o.split(` +`),d=l;h.length>d;d++){var f=h[d];if(1024>=f.length){var p=RQ.test(f)?f.replace(RQ,"$1"):f;if(!p.match(/\S*Error: /)){for(var g of a){var m=g(p,n);if(m){u.push(m);break}}if(u.length>=50)break}}}return(function(y){if(!y.length)return[];var v=Array.from(y);return v.reverse(),v.slice(0,50).map((x=>{return wt({},x,{filename:x.filename||(b=v,b[b.length-1]||{}).filename,function:x.function||wg});var b}))})(u)}})("web:javascript",R$e,D$e)),this._instance=t,this.ha=(e=(r=this._instance.persistence)==null?void 0:r.get_property(NL))!==null&&e!==void 0?e:[],this.ca=DE(this.va()),this.fa=new W$e(this.ca)}onConfigChange(){this.ca=DE(this.va()),this.fa.setConfig(this.ca)}onRemoteConfig(t){var e,r,n;if(t.ok){var i=t.config;if("errorTracking"in i){var a=(e=(r=i.errorTracking)==null?void 0:r.suppressionRules)!==null&&e!==void 0?e:[],s=(n=i.errorTracking)==null?void 0:n.captureExtensionExceptions;this.ha=a,this._instance.persistence&&this._instance.persistence.register({[NL]:this.ha,[$L]:s})}}}get pa(){var t,e=!!this._instance.get_property($L),r=this._instance.config.error_tracking.captureExtensionExceptions;return(t=r??e)!==null&&t!==void 0&&t}buildProperties(t,e){return this.da.buildFromUnknown(t,{syntheticException:e==null?void 0:e.syntheticException,mechanism:{handled:e==null?void 0:e.handled}})}addExceptionStep(t,e){if(this.ca.enabled)try{if(!Rn(t)||t.trim().length===0)return void cc.warn("Ignoring exception step because message must be a non-empty string");var r=(function(a){if(!a)return{sanitizedProperties:{},droppedKeys:[]};var s=[];return{sanitizedProperties:Object.keys(a).reduce(((o,l)=>V$e.has(l)?(s.push(l),o):(o[l]=a[l],o)),{}),droppedKeys:s}})(this.ga(e)),n=r.sanitizedProperties,i=r.droppedKeys;i.length>0&&cc.warn("Ignoring reserved exception step fields",{droppedKeys:i}),this.fa.add(wt({[LE]:t,[IE]:new Date().toISOString()},n))}catch(a){cc.error("Failed to add exception step. Ignoring breadcrumb.",a)}}sendExceptionEvent(t){try{var e=t.$exception_list;if(this.ma(e)){if(this.ya(e))return this.ba("Exception dropped: matched a suppression rule"),void cc.info("Skipping exception capture because a suppression rule matched");if(!this.pa&&this._a(e))return this.ba("Exception dropped: thrown by a browser extension"),void cc.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.wa(e))return this.ba("Exception dropped: thrown by the PostHog SDK"),void cc.info("Skipping exception capture because it was thrown by the PostHog SDK")}var r=this.ca.enabled&&zr(t.$exception_steps)?this.xa(t):t,n=typeof(a=globalThis._posthogReleaseId)=="string"&&a.length>0?a:void 0;n&&(r.$release_id=n);try{var i=this._instance.capture("$exception",r,{_noTruncate:!0,_batchKey:"exceptionEvent",Pn:!0});return i&&this.fa.clear(),i}catch(s){return cc.error("Failed to capture exception event. Dropping this exception.",s),void this.fa.clear()}}catch(s){return void cc.error("Failed to process exception event. Ignoring this exception.",s)}var a}xa(t){try{var e=this.fa.getAttachable();return e.length===0?t:wt({},t,{$exception_steps:e})}catch(r){return cc.error("Failed to read buffered exception steps. Capturing exception without steps.",r),t}}ba(t){this.ca.enabled&&this.fa.add({[LE]:t,[IE]:new Date().toISOString()})}ga(t){return Kn(t)?wt({},t):{}}va(){var t,e;return(t=(e=this._instance.config.error_tracking)==null?void 0:e.exception_steps)!==null&&t!==void 0?t:{}}ya(t){if(t.length===0)return!1;try{var e=t.reduce(((r,n)=>{var i=n.type,a=n.value;return Rn(i)&&i.length>0&&r.$exception_types.push(i),Rn(a)&&a.length>0&&r.$exception_values.push(a),r}),{$exception_types:[],$exception_values:[]});return this.ha.some((r=>{var n=r.values.map((i=>{var a=QJ[i.operator],s=e[i.key];if(!a||!s)return!1;var o=Br(i.value)?i.value:[i.value];return o.length>0&&a(o,s)}));return r.type==="OR"?n.some(Boolean):n.every(Boolean)}))}catch(r){return cc.warn("Failed to evaluate suppression rules. Capturing the exception.",r),!1}}_a(t){return t.flatMap((e=>{var r,n;return(r=(n=e.stacktrace)==null?void 0:n.frames)!==null&&r!==void 0?r:[]})).some((e=>e.filename&&e.filename.startsWith("chrome-extension://")))}wa(t){if(t.length>0){var e,r,n,i,a=(e=(r=t[0].stacktrace)==null?void 0:r.frames)!==null&&e!==void 0?e:[],s=a[a.length-1];return(n=s==null||(i=s.filename)==null?void 0:i.includes("posthog.com/static"))!==null&&n!==void 0&&n}return!1}ma(t){return!zr(t)&&Br(t)}}},uPe=wt({productTours:class{get mi(){return this._instance.persistence}constructor(t){this.ka=null,this.Sa=null,this._instance=t}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if(t.ok){var e=t.config;if("productTours"in e){var r,n;if(this.mi&&this.mi.register({[BL]:!!e.productTours}),!OI(this._instance))return!this.ka&&zr((r=this.mi)==null?void 0:r.props[Jx])||$I.info("product tours disabled; stopping and clearing cached tours"),(n=this.ka)==null||n.stop(),this.ka=null,void this.clearCache();this.loadIfEnabled()}}}loadIfEnabled(){!this.ka&&OI(this._instance)&&this.tr((()=>this.Ca()))}tr(t){var e,r;(e=fr.__PosthogExtensions__)!=null&&e.generateProductTours?t():(r=fr.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,"product-tours",(n=>{n?$I.error("Could not load product tours script",n):t()}))}Ca(){var t;!this.ka&&(t=fr.__PosthogExtensions__)!=null&&t.generateProductTours&&(this.ka=fr.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(t,e){if(e===void 0&&(e=!1),!Br(this.Sa)||e){var r=this.mi;if(r){var n=r.props[Jx];if(Br(n)&&!e)return this.Sa=n,void t(n,{isLoaded:!0})}this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/product_tours/?token="+this._instance.config.token),method:"GET",timestampMode:"query",callback:i=>{if(OI(this._instance)){var a=i.statusCode;if(a!==200||!i.json){var s="Product Tours API could not be loaded, status: "+a;return $I.error(s),void t([],{isLoaded:!1,error:s})}var o=Br(i.json.product_tours)?i.json.product_tours:[];this.Sa=o,r&&r.register({[Jx]:o}),t(o,{isLoaded:!0})}else t([],{isLoaded:!0})}})}else t(this.Sa,{isLoaded:!0})}getActiveProductTours(t){zr(this.ka)?t([],{isLoaded:!1,error:"Product tours not loaded"}):this.ka.getActiveProductTours(t)}showProductTour(t){var e;(e=this.ka)==null||e.showTourById(t)}previewTour(t){this.ka?this.ka.previewTour(t):this.tr((()=>{var e;this.Ca(),(e=this.ka)==null||e.previewTour(t)}))}dismissProductTour(){var t;(t=this.ka)==null||t.dismissTour("user_clicked_skip")}nextStep(){var t;(t=this.ka)==null||t.nextStep()}previousStep(){var t;(t=this.ka)==null||t.previousStep()}clearCache(){var t;this.Sa=null,(t=this.mi)==null||t.unregister(Jx)}resetTour(t){var e;(e=this.ka)==null||e.resetTour(t)}resetAllTours(){var t;(t=this.ka)==null||t.resetAllTours()}cancelPendingTour(t){var e;(e=this.ka)==null||e.cancelPendingTour(t)}}},c5),hPe={siteApps:class{constructor(t){this.Ma=0,this._instance=t,this.Ia=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}Ta(t,e){if(e){var r=this.globalsForEvent(e);this.Ia.push(r),this.Ia.length>1e3&&(this.Ia=this.Ia.slice(10))}}get siteAppLoaders(){var t;return(t=fr._POSTHOG_REMOTE_CONFIG)==null||(t=t[this._instance.config.token])==null?void 0:t.siteApps}initialize(){if(this.isEnabled){var t=this._instance._addCaptureHook(this.Ta.bind(this));this.Ea=()=>{t(),this.Ia=[],this.Ea=void 0}}}globalsForEvent(t){var e,r,n,i,a,s,o;if(!t)throw new Error("Event payload is required");var l={},u=this._instance.get_property("$groups")||[],h=this._instance.get_property("$stored_group_properties")||{};for(var d of Object.entries(h)){var f=d[0];l[f]={id:u[f],type:f,properties:d[1]}}var p=t.$set_once,g=t.$set;return{event:wt({},BZ(t,tPe),{properties:wt({},t.properties,g?{$set:wt({},(e=(r=t.properties)==null?void 0:r.$set)!==null&&e!==void 0?e:{},g)}:{},p?{$set_once:wt({},(n=(i=t.properties)==null?void 0:i.$set_once)!==null&&n!==void 0?n:{},p)}:{}),elements_chain:(a=(s=t.properties)==null?void 0:s.$elements_chain)!==null&&a!==void 0?a:"",distinct_id:(o=t.properties)==null?void 0:o.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:l}}Ra(t){var e,r=(e=t.tagName)==null?void 0:e.toLowerCase();return r==="style"&&this._instance.config.prepare_external_dependency_stylesheet?this._instance.config.prepare_external_dependency_stylesheet(t)||(lc.error("prepare_external_dependency_stylesheet returned null"),null):r==="script"&&this._instance.config.prepare_external_dependency_script?this._instance.config.prepare_external_dependency_script(t)||(lc.error("prepare_external_dependency_script returned null"),null):t}Pa(){var t,e,r,n,i,a,s,o;if(!this._instance.config.prepare_external_dependency_stylesheet&&!this._instance.config.prepare_external_dependency_script)return()=>{};var l=Wt==null?void 0:Wt.defaultView,u=l==null||(t=l.Node)==null?void 0:t.prototype;if(!l||!u)return()=>{};if(this.Ma++,this.Oa)return this.Fa();var h=[],d=this,f=new WeakSet,p=(y,v,x)=>{if(y!=null&&y[v]){var b=y[v];y[v]=x(b),h.push((()=>{y[v]=b}))}},g=y=>{if(f.has(y))return y;var v=d.Ra(y);return v&&f.add(v),v},m=y=>y.map((v=>typeof v=="string"?v:g(v))).filter((v=>!bs(v)));return p(u,"appendChild",(y=>function(v){var x=g(v);return x?y.call(this,x):v})),p(u,"insertBefore",(y=>function(v,x){var b=g(v);return b?y.call(this,b,x):v})),p(u,"replaceChild",(y=>function(v,x){var b=g(v);return b?y.call(this,b,x):x})),[(e=l.Element)==null?void 0:e.prototype,(r=l.Document)==null?void 0:r.prototype,(n=l.DocumentFragment)==null?void 0:n.prototype].forEach((y=>{p(y,"append",(v=>function(){for(var x=arguments.length,b=new Array(x),w=0;x>w;w++)b[w]=arguments[w];return v.apply(this,m(b))})),p(y,"prepend",(v=>function(){for(var x=arguments.length,b=new Array(x),w=0;x>w;w++)b[w]=arguments[w];return v.apply(this,m(b))}))})),[(i=l.Element)==null?void 0:i.prototype,(a=l.CharacterData)==null?void 0:a.prototype,(s=l.DocumentType)==null?void 0:s.prototype].forEach((y=>{p(y,"before",(v=>function(){for(var x=arguments.length,b=new Array(x),w=0;x>w;w++)b[w]=arguments[w];return v.apply(this,m(b))})),p(y,"after",(v=>function(){for(var x=arguments.length,b=new Array(x),w=0;x>w;w++)b[w]=arguments[w];return v.apply(this,m(b))})),p(y,"replaceWith",(v=>function(){for(var x=arguments.length,b=new Array(x),w=0;x>w;w++)b[w]=arguments[w];var C=m(b);return b.length&&!C.length?void 0:v.apply(this,C)}))})),p((o=l.Element)==null?void 0:o.prototype,"insertAdjacentElement",(y=>function(v,x){var b=g(x);return b?y.call(this,v,b):null})),this.Oa=()=>{h.forEach((y=>y())),this.Oa=void 0},this.Fa()}Fa(){var t=!1;return()=>{var e;t||(t=!0,this.Ma--,this.Ma===0&&((e=this.Oa)==null||e.call(this)))}}Aa(t,e){e===void 0&&(e=!0);var r=this.Pa();try{var n=t(r);return e&&r(),n}catch(i){throw r(),i}}setupSiteApp(t){var e=this.apps[t.id],r=()=>{var s;!e.errored&&this.Ia.length&&(lc.info("Processing "+this.Ia.length+" events for site app with id "+t.id),this.Ia.forEach((o=>this.Aa((()=>e.processEvent==null?void 0:e.processEvent(o))))),e.processedBuffer=!0),Object.values(this.apps).every((o=>o.processedBuffer||o.errored))&&((s=this.Ea)==null||s.call(this))},n=!1,i=s=>{e.errored=!s,e.loaded=!0,lc.info("Site app with id "+t.id+" "+(s?"loaded":"errored")),n&&r()};try{var a=this.Aa((s=>t.init({posthog:this._instance,callback(o){s(),i(o)}})),!1).processEvent;a&&(e.processEvent=a),n=!0}catch(s){lc.error(gee+t.id,s),i(!1)}if(n&&e.loaded)try{r()}catch(s){lc.error("Error while processing buffered events PostHog app with config id "+t.id,s),e.errored=!0}}$a(){var t=this.siteAppLoaders||[];for(var e of t)this.apps[e.id]={id:e.id,loaded:!1,errored:!1,processedBuffer:!1};for(var r of t)this.setupSiteApp(r)}La(t){var e=this;if(Object.keys(this.apps).length!==0){var r=this.globalsForEvent(t),n=function(a){try{e.Aa((()=>a.processEvent==null?void 0:a.processEvent(r)))}catch(s){lc.error("Error while processing event "+t.event+" for site app "+a.id,s)}};for(var i of Object.values(this.apps))n(i)}}onRemoteConfig(t){var e,r,n,i=this;if((e=this.siteAppLoaders)!=null&&e.length)return this.isEnabled?(this.$a(),void this._instance.on("eventCaptured",(l=>this.La(l)))):void lc.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if((r=this.Ea)==null||r.call(this),t.ok){var a=t.config;if((n=a.siteApps)!=null&&n.length)if(this.isEnabled){var s=function(){var l,u=o.id,h=o.url;fr["__$$ph_site_app_"+u]=i._instance,(l=fr.__PosthogExtensions__)==null||l.loadSiteApp==null||l.loadSiteApp(i._instance,h,(d=>{if(d)return lc.error(gee+u,d)}))};for(var o of a.siteApps)s()}else lc.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}}},dPe={tracingHeaders:class{constructor(t){this.Da=void 0,this.Na=void 0,this.qa=void 0,this.ea=()=>{var e,r,n=this.ja();n?(Nt(this.Da)&&(this.Da=(e=fr.__PosthogExtensions__)==null||(e=e.tracingHeadersPatchFns)==null?void 0:e._patchXHR(n,(()=>this._instance.get_distinct_id()),this._instance.sessionManager)),Nt(this.Na)&&(this.Na=(r=fr.__PosthogExtensions__)==null||(r=r.tracingHeadersPatchFns)==null?void 0:r._patchFetch(n,(()=>this._instance.get_distinct_id()),this._instance.sessionManager))):this.oa()},this._instance=t}initialize(){this.startIfEnabledOrStop()}tr(t){var e,r;(e=fr.__PosthogExtensions__)!=null&&e.tracingHeadersPatchFns?t():(r=fr.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,"tracing-headers",(n=>{if(n)return JOe.error("failed to load script",n);t()}))}Ba(){var t,e;return(t=(e=this._instance.config.tracing_headers)!==null&&e!==void 0?e:this._instance.config.addTracingHeaders)!==null&&t!==void 0?t:this._instance.config.__add_tracing_headers}ja(){var t=this.Ba();return Br(t)?(Br(this.qa)?this.qa.splice(0,this.qa.length,...t):this.qa=[...t],t.length>0?this.qa:void 0):(Br(this.qa)&&this.qa.splice(0),this.qa=t||void 0,this.qa)}oa(){var t,e;(t=this.Da)==null||t.call(this),(e=this.Na)==null||e.call(this),this.Da=void 0,this.Na=void 0}startIfEnabledOrStop(){this.ja()?this.tr(this.ea):this.oa()}}},fPe=wt({surveys:class{get Te(){return this._instance.config}constructor(t){this.Ha=void 0,this._surveyManager=null,this.Ua=!1,this.za=[],this.Va=null,this.Wa=null,this._instance=t,this._surveyEventReceiver=null}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if(!this.Te.disable_surveys){if(!t.ok)return kn.warn("Remote config unavailable. Not loading surveys.");var e=t.config.surveys;if(zr(e))return kn.warn("Flags not loaded yet. Not loading surveys.");var r=Br(e);this.Ha=r?e.length>0:e,kn.info("flags response received, isSurveysEnabled: "+this.Ha),this.loadIfEnabled()}}reset(){try{var t;(t=this._surveyEventReceiver)==null||t.reset(),localStorage.removeItem("lastSeenSurveyDate");for(var e=[],r=0;rlocalStorage.removeItem(i)))}catch{}}loadIfEnabled(){if(!this._surveyManager)if(this.Ua)kn.info("Already initializing surveys, skipping...");else if(this.Te.disable_surveys)kn.info(mee);else if(this.Te.cookieless_mode&&this._instance.consent.isOptedOut())kn.info("Not loading surveys in cookieless mode without consent.");else{var t=fr==null?void 0:fr.__PosthogExtensions__;if(t){if(!Nt(this.Ha)||this.Te.advanced_enable_surveys){var e=this.Ha||this.Te.advanced_enable_surveys;this.Ua=!0;try{var r=t.generateSurveys;if(r)return void this.Za(r,e);var n=t.loadExternalDependency;if(!n)return void this.Ga(ZL);n(this._instance,"surveys",(i=>{i||!t.generateSurveys?this.Ga("Could not load surveys script",i):this.Za(t.generateSurveys,e)}))}catch(i){throw this.Ga("Error initializing surveys",i),i}finally{this.Ua=!1}}}else kn.error("PostHog Extensions not found.")}}Za(t,e){this._surveyManager=t(this._instance,e),this._surveyEventReceiver=new iPe(this._instance),kn.info("Surveys loaded successfully"),this.Qa({isLoaded:!0})}Ga(t,e){kn.error(t,e),this.Qa({isLoaded:!1,error:t})}onSurveysLoaded(t){return this.za.push(t),this._surveyManager&&this.Qa({isLoaded:!0}),()=>{this.za=this.za.filter((e=>e!==t))}}getSurveys(t,e){if(e===void 0&&(e=!1),this.Te.disable_surveys)return kn.info(mee),t([]);var r,n=this._instance.get_property(VL);if(n&&!e)return t(n,{isLoaded:!0}),void(this.Ja()&&this.getSurveys((()=>{}),!0));typeof Promise<"u"&&this.Va?this.Va.then((i=>t(i.surveys,i.context))):(typeof Promise<"u"&&(this.Va=new Promise((i=>{r=i}))),this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this.Te.token),method:"GET",timestampMode:"query",timeout:this.Te.surveys_request_timeout_ms,callback:i=>{var a;this.Va=null;var s=i.statusCode;if(s!==200||!i.json){var o="Surveys API could not be loaded, status: "+s;kn.error(o),this.Wa=Date.now();var l={isLoaded:!1,error:o};return t([],l),void(r==null||r({surveys:[],context:l}))}this.Wa=null;var u,h=i.json.surveys||[],d=h.filter((p=>(function(g){return!(!g.start_date||g.end_date)})(p)&&(tee(p)||(function(g){var m;return!((m=g.conditions)==null||(m=m.actions)==null||(m=m.values)==null||!m.length)})(p))));d.length>0&&((u=this._surveyEventReceiver)==null||u.register(d)),(a=this._instance.persistence)==null||a.register({[VL]:h,[OE]:Date.now()});var f={isLoaded:!0};t(h,f),r==null||r({surveys:h,context:f})}}))}Ja(){return this.Ka()&&!this.Va&&!this.Ya()}Ka(){var t=this._instance.get_property(OE);return Na(t)&&Date.now()-t>3e5}Ya(){return Na(this.Wa)&&3e5>Date.now()-this.Wa}markSurveyAsSeen(t,e){var r,n={id:t,current_iteration:(r=e==null?void 0:e.iteration)!==null&&r!==void 0?r:null};nee(n);try{localStorage.setItem("lastSeenSurveyDate",new Date().toISOString())}catch{}}Qa(t){for(var e of this.za)try{if(!t.isLoaded)return e([],t);this.getSurveys(e)}catch(r){kn.error("Error in survey callback",r)}}getActiveMatchingSurveys(t,e){if(e===void 0&&(e=!1),!zr(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(t,e);kn.warn("init was not called")}Xa(t){var e=null;return this.getSurveys((r=>{var n;e=(n=r.find((i=>i.id===t)))!==null&&n!==void 0?n:null})),e}tl(t){if(zr(this._surveyManager))return{eligible:!1,reason:l5};var e=typeof t=="string"?this.Xa(t):t;return e?this._surveyManager.checkSurveyEligibility(e):{eligible:!1,reason:"Survey not found"}}el(t){if(zr(this._surveyManager))return{eligible:!1,reason:l5};var e=typeof t=="string"?this.Xa(t):t;return e?this._surveyManager.checkSurveyRenderability(e):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(t){if(zr(this._surveyManager))return kn.warn("init was not called"),{visible:!1,disabledReason:l5};var e=this.el(t);return{visible:e.eligible,disabledReason:e.reason}}canRenderSurveyAsync(t,e){return zr(this._surveyManager)?(kn.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:l5})):new Promise((r=>{this.getSurveys((n=>{var i,a=(i=n.find((o=>o.id===t)))!==null&&i!==void 0?i:null;if(a){var s=this.el(a);r({visible:s.eligible,disabledReason:s.reason})}else r({visible:!1,disabledReason:"Survey not found"})}),e)}))}renderSurvey(t,e,r){var n;if(zr(this._surveyManager))kn.warn("init was not called");else{var i=typeof t=="string"?this.Xa(t):t;if(i!=null&&i.id)if(zOe.includes(i.type)){var a=Wt==null?void 0:Wt.querySelector(e);if(a)return(n=i.appearance)!=null&&n.surveyPopupDelaySeconds?(kn.info("Rendering survey "+i.id+" with delay of "+i.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout((()=>{var s,o;kn.info("Rendering survey "+i.id+" with delay of "+((s=i.appearance)==null?void 0:s.surveyPopupDelaySeconds)+" seconds"),(o=this._surveyManager)==null||o.renderSurvey(i,a,r),kn.info("Survey "+i.id+" rendered")}),1e3*i.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(i,a,r);kn.warn("Survey element not found")}else kn.warn("Surveys of type "+i.type+" cannot be rendered in the app");else kn.warn("Survey not found")}}displaySurvey(t,e){var r;if(zr(this._surveyManager))kn.warn("init was not called");else{var n=this.Xa(t);if(n){var i=n;if((r=n.appearance)!=null&&r.surveyPopupDelaySeconds&&e.ignoreDelay&&(i=wt({},n,{appearance:wt({},n.appearance,{surveyPopupDelaySeconds:0})})),e.displayType!==pI.Popover&&e.initialResponses&&kn.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),e.ignoreConditions===!1){var a=this.tl(n);if(!a.eligible)return void kn.warn("Survey is not eligible to be displayed: ",a.reason)}e.displayType!==pI.Inline?this._surveyManager.handlePopoverSurvey(i,e):this.renderSurvey(i,e.selector,e.properties)}else kn.warn("Survey not found")}}cancelPendingSurvey(t){zr(this._surveyManager)?kn.warn("init was not called"):this._surveyManager.cancelSurvey(t)}handlePageUnload(){var t;(t=this._surveyManager)==null||t.handlePageUnload==null||t.handlePageUnload()}}},c5),pPe={toolbar:class{constructor(t){this.instance=t}rl(t){fr.ph_toolbar_state=t}il(){var t;return(t=fr.ph_toolbar_state)!==null&&t!==void 0?t:0}initialize(){return this.maybeLoadToolbar()}maybeLoadToolbar(t,e,r){if(t===void 0&&(t=void 0),e===void 0&&(e=void 0),r===void 0&&(r=void 0),WQ(this.instance.config)||!at||!Wt)return!1;t=t??at.location,r=r??at.history;try{if(!e){try{at.localStorage.setItem("test","test"),at.localStorage.removeItem("test")}catch{return!1}e=at==null?void 0:at.localStorage}var n,i=aPe||KE(t.hash,"__posthog")||KE(t.hash,"state"),a=i?VQ((()=>JSON.parse(atob(decodeURIComponent(i)))))||VQ((()=>JSON.parse(decodeURIComponent(i)))):null;return a&&a.action==="ph_authorize"?((n=a).source="url",n&&Object.keys(n).length>0&&(a.desiredHash?t.hash=a.desiredHash:r?r.replaceState(r.state,"",t.pathname+t.search):t.hash="")):((n=JSON.parse(e.getItem(yee)||"{}")).source="localstorage",delete n.userIntent),!(!n.token||this.instance.config.token!==n.token||(this.loadToolbar(n),0))}catch{return!1}}nl(t){var e=fr.ph_load_toolbar||fr.ph_load_editor;!zr(e)&&bo(e)?e(t,this.instance):vee.warn("No toolbar load function found")}loadToolbar(t){var e=!(Wt==null||!Wt.getElementById(jQ));if(!at||e)return!1;var r=this.instance.requestRouter.region==="custom"&&this.instance.config.advanced_disable_toolbar_metrics,n=wt({token:this.instance.config.token},t,{apiURL:this.instance.requestRouter.endpointFor("ui")},r?{instrument:!1}:{});if(at.localStorage.setItem(yee,JSON.stringify(wt({},n,{source:void 0}))),this.il()===2)this.nl(n);else if(this.il()===0){var i;this.rl(1),(i=fr.__PosthogExtensions__)==null||i.loadExternalDependency==null||i.loadExternalDependency(this.instance,"toolbar",(a=>{if(a)return vee.error("[Toolbar] Failed to load",a),void this.rl(0);this.rl(2),this.nl(n)})),ui(at,"turbolinks:load",(()=>{this.rl(0),this.loadToolbar(n)}))}return!0}sl(t){return this.loadToolbar(t)}maybeLoadEditor(t,e,r){return t===void 0&&(t=void 0),e===void 0&&(e=void 0),r===void 0&&(r=void 0),this.maybeLoadToolbar(t,e,r)}}},gPe=wt({experiments:ns},c5),mPe={conversations:class{constructor(t){this.ol=void 0,this._conversationsManager=null,this.al=!1,this.ll=null,this._instance=t}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if(!this._instance.config.disable_conversations&&t.ok){var e=t.config.conversations;zr(e)||(Tl(e)?this.ol=e:(this.ol=e.enabled,this.ll=e),this.loadIfEnabled())}}reset(){var t;(t=this._conversationsManager)==null||t.reset(),this._conversationsManager=null,this.ol=void 0,this.ll=null}loadIfEnabled(){if(!(this._conversationsManager||this.al||this._instance.config.disable_conversations||WQ(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var t=fr==null?void 0:fr.__PosthogExtensions__;if(t&&!Nt(this.ol)&&this.ol)if(this.ll&&this.ll.token){this.al=!0;try{var e=t.initConversations;if(e)return this.ul(e),void(this.al=!1);var r=t.loadExternalDependency;if(!r)return void this.hl(ZL);r(this._instance,"conversations",(n=>{n||!t.initConversations?this.hl("Could not load conversations script",n):this.ul(t.initConversations),this.al=!1}))}catch(n){this.hl("Error initializing conversations",n),this.al=!1}}else Ho.error("Conversations enabled but missing token in remote config.")}}ul(t){if(this.ll)try{this._conversationsManager=t(this.ll,this._instance),Ho.info("Conversations loaded successfully")}catch(e){this.hl("Error completing conversations initialization",e)}else Ho.error("Cannot complete initialization: remote config is null")}hl(t,e){Ho.error(t,e),this._conversationsManager=null,this.al=!1}show(){this._conversationsManager?this._conversationsManager.show():Ho.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return this.ol===!0&&!bs(this._conversationsManager)}isVisible(){var t,e;return(t=(e=this._conversationsManager)==null?void 0:e.isVisible())!==null&&t!==void 0&&t}sendMessage(t,e,r){var n=this;return jn((function*(){return n._conversationsManager?n._conversationsManager.sendMessage(t,e,r):(Ho.warn(If),null)}))()}getMessages(t,e){var r=this;return jn((function*(){return r._conversationsManager?r._conversationsManager.getMessages(t,e):(Ho.warn(If),null)}))()}markAsRead(t){var e=this;return jn((function*(){return e._conversationsManager?e._conversationsManager.markAsRead(t):(Ho.warn(If),null)}))()}getTickets(t){var e=this;return jn((function*(){return e._conversationsManager?e._conversationsManager.getTickets(t):(Ho.warn(If),null)}))()}requestRestoreLink(t){var e=this;return jn((function*(){return e._conversationsManager?e._conversationsManager.requestRestoreLink(t):(Ho.warn(If),null)}))()}restoreFromToken(t){var e=this;return jn((function*(){return e._conversationsManager?e._conversationsManager.restoreFromToken(t):(Ho.warn(If),null)}))()}restoreFromUrlToken(){var t=this;return jn((function*(){return t._conversationsManager?t._conversationsManager.restoreFromUrlToken():(Ho.warn(If),null)}))()}getCurrentTicketId(){var t,e;return(t=(e=this._conversationsManager)==null?void 0:e.getCurrentTicketId())!==null&&t!==void 0?t:null}getWidgetSessionId(){var t,e;return(t=(e=this._conversationsManager)==null?void 0:e.getWidgetSessionId())!==null&&t!==void 0?t:null}Nn(){var t;(t=this._conversationsManager)==null||t.setIdentity()}qn(){var t;(t=this._conversationsManager)==null||t.clearIdentity()}}},yPe={logs:class{constructor(t){var e;this.dl=!1,this.cl=!1,this.it=Zn("[logs]"),this.Gr=[],this.vl=[],this.Js=0,this.fl=()=>{var r,n;this.Js=0,(r=this.pl)==null||r.onReconnect(),(n=this.gl)==null||n.onReconnect()},this._instance=t,this._instance&&(e=this._instance.config.logs)!=null&&e.captureConsoleLogs&&(this.dl=!0),at&&ui(at,"online",this.fl)}ml(t,e,r,n){var i,a=(function(s,o){var l,u,h,d,f,p,g,m=(l=s==null?void 0:s.flushIntervalMs)!==null&&l!==void 0?l:3e3,y=(u=s==null?void 0:s.maxBufferSize)!==null&&u!==void 0?u:100,v=o!=null&&o.consoleCapture?void 0:(h=s==null?void 0:s.maxLogsPerInterval)!==null&&h!==void 0?h:1e3,x=Nt(v)?Math.max(y,2048):Math.max(y,v),b=s==null?void 0:s.resourceAttributes;return{serviceName:(d=(f=b==null?void 0:b["service.name"])!==null&&f!==void 0?f:s==null?void 0:s.serviceName)!==null&&d!==void 0?d:o==null?void 0:o.serviceNameDefault,serviceVersion:(p=b==null?void 0:b["service.version"])!==null&&p!==void 0?p:s==null?void 0:s.serviceVersion,environment:(g=b==null?void 0:b["deployment.environment"])!==null&&g!==void 0?g:s==null?void 0:s.environment,resourceAttributes:b,beforeSend:s==null?void 0:s.beforeSend,flushIntervalMs:m,maxBufferSize:y,maxQueueSize:x,maxBatchRecordsPerPost:100,rateCapWindowMs:m,maxLogsPerInterval:v,backgroundFlushBudgetMs:0,terminationFlushBudgetMs:0}})((i=this._instance)==null||(i=i.config)==null?void 0:i.logs,r);return[new w$e(this.yl(t,e),a,this.it,(()=>this.bl()),(s=>s()),void 0,n),a]}_l(){var t,e=(t=this._instance)==null||(t=t.config)==null?void 0:t.logs;if(!this.pl||this.wl!==e){var r;(r=this.pl)==null||r.reset(),this.wl=e;var n=this.ml((()=>this.Gr),(i=>{this.Gr=i}));this.pl=n[0],this.xl=n[1]}return this.pl}kl(){var t,e=(t=this._instance)==null||(t=t.config)==null?void 0:t.logs;if(!this.gl||this.Sl!==e){var r;(r=this.gl)==null||r.reset(),this.Sl=e;var n=this.ml((()=>this.vl),(i=>{this.vl=i}),{serviceNameDefault:"posthog-browser-logs",consoleCapture:!0},wee);this.gl=n[0],this.Cl=n[1]}return this.gl}initialize(){this.loadIfEnabled()}onRemoteConfig(t){var e;if(t.ok){var r=(e=t.config.logs)==null?void 0:e.captureConsoleLogs;!zr(r)&&r&&(this.dl=!0,this.loadIfEnabled())}}reset(){var t,e;this.Gr=[],(t=this.pl)==null||t.reset(),this.vl=[],(e=this.gl)==null||e.reset(),this.Js=0}captureLog(t){this._l().captureLog(t)}le(t){this.kl().captureLog(t)}get logger(){return this.Ml||(this.Ml={trace:(t,e)=>this.captureLog({body:t,level:"trace",attributes:e}),debug:(t,e)=>this.captureLog({body:t,level:"debug",attributes:e}),info:(t,e)=>this.captureLog({body:t,level:"info",attributes:e}),warn:(t,e)=>this.captureLog({body:t,level:"warn",attributes:e}),error:(t,e)=>this.captureLog({body:t,level:"error",attributes:e}),fatal:(t,e)=>this.captureLog({body:t,level:"fatal",attributes:e})}),this.Ml}flushLogs(t){t?this.Il(t):(this.pl&&this.pl.flush().catch((e=>this.it.error("PostHog logs flush failed:",e))),this.gl&&this.gl.flush().catch((e=>this.it.error("PostHog logs flush failed:",e))))}loadIfEnabled(){if(this.dl&&!this.cl){var t=fr==null?void 0:fr.__PosthogExtensions__;if(t){var e=t.loadExternalDependency;e?e(this._instance,"logs",(r=>{var n;r||(n=t.logs)==null||!n.initializeLogs?this.it.error("Could not load logs script",r):(t.logs.initializeLogs(this._instance),this.cl=!0)})):this.it.error(ZL)}else this.it.error("PostHog Extensions not found.")}}yl(t,e){var r=this._instance;return{get isDisabled(){return!1},get optedOut(){return!r.is_capturing()},getPersistedProperty:n=>n===pu.LogsQueue?t():void 0,setPersistedProperty(n,i){var a;n===pu.LogsQueue&&e((a=i)!==null&&a!==void 0?a:[])},$t:n=>this.$t(n),getLibraryId:()=>vn.LIB_NAME,getLibraryVersion:()=>vn.LIB_VERSION}}$t(t){return new Promise((e=>{if(xJ(this.Js,3))e({kind:"fatal",error:new Error("logs endpoint is unreachable, dropping batch")});else{var r=!1,n=a=>{r||(r=!0,clearTimeout(i),e(a))},i=setTimeout((()=>n({kind:"retry-later",error:new Error("logs request timed out")})),9e4);this._instance._send_request({method:"POST",url:this.Tl(),data:t,compression:"best-available",batchKey:"logs",fireCallbackOnDrop:!0,callback:a=>{var s=a.statusCode;if(this.El(s),s>=200&&300>s)n({kind:"ok"});else if(s===413)n({kind:"too-large"});else if(s!==0&&s!==429&&500>s)n({kind:"fatal",error:new Error("logs request failed with status "+s)});else{var o;n({kind:"retry-later",error:(o=a.error)!==null&&o!==void 0?o:new Error("logs request failed with status "+s)})}}})}}))}El(t){(t!==0||this._instance.__loaded)&&(this.Js=TJ(t,this.Js,3,(()=>this.it.warn("Log requests are failing before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped sending logs; will try again when connectivity changes."))))}Il(t){this.Gr.length>0&&this.Rl(t,this.Gr,this.xl,vn.LIB_NAME,(e=>{this.Gr=e})),this.vl.length>0&&this.Rl(t,this.vl,this.Cl,wee,(e=>{this.vl=e}))}Rl(t,e,r,n,i){if(e.length!==0){var a=e.map((o=>o.record));i([]);var s=kQ(a,CQ(r,vn.LIB_NAME,vn.LIB_VERSION),n,vn.LIB_VERSION);this._instance._send_request({method:"POST",url:this.Tl(),data:s,compression:"best-available",batchKey:"logs",transport:t})}}Tl(){return this._instance.requestRouter.endpointFor("api","/i/v1/logs")+"?token="+encodeURIComponent(this._instance.config.token)}bl(){var t,e={};if(e.distinctId=this._instance.get_distinct_id(),this._instance.sessionManager){var r=this._instance.sessionManager.checkAndGetSessionAndWindowId(!0),n=r.windowId,i=r.sessionStartTimestamp,a=r.lastActivityTimestamp;e.sessionId=r.sessionId,e.windowId=n,zr(i)||(e.sessionStartTimestamp=i),zr(a)||(e.lastActivityTimestamp=a)}if(fr!=null&&(t=fr.location)!=null&&t.href&&(e.currentUrl=this._instance.config.disable_capture_url_hashes?Oh(fr.location.href):fr.location.href),this._instance.featureFlags){var s=this._instance.featureFlags.getFlags();s&&s.length>0&&(e.activeFeatureFlags=s)}return e}}},vPe={metrics:class{constructor(t){this.it=Zn("[metrics]"),this._instance=t}initialize(){}_l(){var t,e,r=(t=this._instance)==null||(t=t.config)==null?void 0:t.metrics;return this.pl&&this.wl===r||((e=this.pl)==null||e.reset(),this.wl=r,this.pl=new C$e(this.yl(),(function(n){var i,a,s,o,l,u=n==null?void 0:n.resourceAttributes;return{serviceName:(i=u==null?void 0:u["service.name"])!==null&&i!==void 0?i:n==null?void 0:n.serviceName,serviceVersion:(a=u==null?void 0:u["service.version"])!==null&&a!==void 0?a:n==null?void 0:n.serviceVersion,environment:(s=u==null?void 0:u["deployment.environment"])!==null&&s!==void 0?s:n==null?void 0:n.environment,resourceAttributes:u,beforeSend:n==null?void 0:n.beforeSend,flushIntervalMs:(o=n==null?void 0:n.flushIntervalMs)!==null&&o!==void 0?o:1e4,maxSeriesPerFlush:(l=n==null?void 0:n.maxSeriesPerFlush)!==null&&l!==void 0?l:1e3}})(r),this.it)),this.pl}count(t,e,r){e===void 0&&(e=1),this._l().count(t,e,r)}gauge(t,e,r){this._l().gauge(t,e,r)}histogram(t,e,r){this._l().histogram(t,e,r)}flush(t){if(!this.pl)return Promise.resolve();if(t){var e=this.pl.drainWindow();return e&&this.Kt(e,t),Promise.resolve()}return this.pl.flush().catch((r=>this.it.error("PostHog metrics flush failed:",r)))}reset(){var t;(t=this.pl)==null||t.reset()}yl(){var t=this._instance,e=this;return{get isDisabled(){return!1},get optedOut(){return!t.is_capturing()},Kt:r=>e.Kt(r),getLibraryId:()=>vn.LIB_NAME,getLibraryVersion:()=>vn.LIB_VERSION}}Kt(t,e){return new Promise((r=>{var n=!1,i=s=>{n||(n=!0,clearTimeout(a),r(s))},a=setTimeout((()=>i({kind:"retry-later",error:new Error("metrics request timed out")})),9e4);this._instance._send_request(wt({method:"POST",url:this.Pl(),data:t,compression:"best-available",batchKey:"metrics"},e&&{transport:e},{fireCallbackOnDrop:!0,callback(s){var o=s.statusCode;if(o>=200&&300>o)i({kind:"ok"});else if(o===413)i({kind:"too-large"});else if(o!==0&&o!==429&&500>o)i({kind:"fatal",error:new Error("metrics request failed with status "+o)});else{var l;i({kind:"retry-later",error:(l=s.error)!==null&&l!==void 0?l:new Error("metrics request failed with status "+o)})}}}))}))}Pl(){return this._instance.requestRouter.endpointFor("api","/i/v1/metrics")+"?token="+encodeURIComponent(this._instance.config.token)}}},bPe=wt({},c5,oPe,lPe,cPe,uPe,hPe,fPe,dPe,pPe,gPe,mPe,yPe,vPe);Uo.__defaultExtensionClasses=wt({},bPe);var u5=(function(){vn.SDK_DIST_CHANNEL="npm";var t=dT[Mg]=new Uo;return(function(){function e(){e.done||(e.done=!0,lee=!1,Ln(dT,(function(r){r._dom_loaded()})))}Wt!=null&&Wt.addEventListener?Wt.readyState==="complete"?e():ui(Wt,"DOMContentLoaded",e,{capture:!1}):at&&Pt.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")})(),t})();u5.init("phc_DdrSDBCkEZqVKPSeTdgAFPjj2xhJrbWWoLJfGW8Wkp39",{api_host:"https://eu.i.posthog.com",capture_exceptions:{capture_unhandled_errors:!0,capture_unhandled_rejections:!0,capture_console_errors:!1}}),(function(){var sEe;const t=document.querySelector("[data-note-workspace]"),e=document.querySelector("[data-note-stack]"),r=document.querySelector("[data-empty-state]"),n=document.querySelector("[data-file-sidebar]"),i=document.querySelector("[data-sidebar-toggle]"),a=document.querySelector("[data-sidebar-close]"),s=document.querySelector("[data-viewer-settings]"),o=document.querySelector("[data-viewer-settings-trigger]"),l=document.querySelector("[data-viewer-settings-menu]"),u=document.querySelector("[data-navigation-mode-toggle]"),h=document.querySelector("[data-theme-custom-fields]"),d=document.querySelector("[data-frontmatter-visibility]"),f=document.querySelector("[data-accessibility-font]"),p=document.querySelector("[data-accessibility-size]"),g=document.querySelector("[data-accessibility-spacing]"),m=document.querySelector("[data-accessibility-motion]"),y=document.querySelector("[data-readable-line-length]"),v=document.querySelector("[data-high-contrast]"),x=document.querySelector("[data-underline-links]"),b=document.querySelector("[data-workspace-rail]"),w=document.querySelector("[data-workspace-scroll-track]"),C=document.querySelector("[data-workspace-scroll-thumb]");if(!t||!e)return;const _=window.matchMedia("(prefers-reduced-motion: reduce)"),k=window.matchMedia("(max-width: 680px)"),S="openknowledge.viewer.editorOrder",L="openknowledge.viewer.theme",$="openknowledge.viewer.frontmatter",I="openknowledge.viewer.accessibility",z="openknowledge.viewer.navigationMode",F="beside";let A=F;const R=Sn(t.dataset.linkPrefix||""),N="openknowledge.viewer.panelWidths."+ln(t.dataset.noteRoot||R||window.location.pathname).toString(36),M=G4t(),D=ze(),O=Ur(),B=I4t(O,"path"),P=D4t(O),G=us(),V=$e(),H=["default","night","paper","ocean","rose","custom"],W="night",ie={system:'Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI Variable", "Segoe UI", sans-serif',readable:"Verdana, Tahoma, Arial, sans-serif",serif:'Iowan Old Style, Baskerville, "Times New Roman", serif',mono:"ui-monospace, SFMono-Regular, Menlo, Consolas, monospace"},j={small:{value:"14px",scale:"0.9"},default:{value:"15.5px",scale:"1"},large:{value:"18px",scale:"1.16"},"extra-large":{value:"21px",scale:"1.35"}},ae={default:{value:"1.62",letterSpacing:"normal"},relaxed:{value:"1.82",letterSpacing:".02em"},spacious:{value:"2.05",letterSpacing:".04em"}},J={font:"system",size:"default",spacing:"default",motion:"system",readableLineLength:!0,highContrast:!1,underlineLinks:!1},K={page:"#f4f5f4",surface:"#ffffff",text:"#202322",muted:"#707773",accent:"#0b7a53",border:"#e3e6e4"},Q={page:["--ok-color-page","--ok-color-header-bg","--ok-color-viewer-canvas","--ok-color-viewer-header-bg","--ok-color-sidebar","--ok-color-sidebar-header"],surface:["--ok-color-surface","--ok-color-note-chrome-bg","--ok-color-search-input-bg","--ok-color-search-popover-bg","--ok-color-editor-trigger-bg","--ok-color-editor-menu-bg","--ok-color-card-bg","--ok-color-editor-mark-bg"],text:["--ok-color-text","--ok-color-document-text","--ok-color-control-hover-text","--ok-color-editor-mark-text","--ok-color-code-block-bg"],muted:["--ok-color-muted","--ok-color-control-text","--ok-color-close-text","--ok-color-sidebar-text","--ok-color-search-shortcut-text","--ok-color-tree-text","--ok-color-tree-badge-text","--ok-color-note-close-text","--ok-color-editor-trigger-text"],accent:["--ok-color-accent","--ok-color-accent-strong","--ok-color-focus-ring","--ok-color-graph-node-active-border"],border:["--ok-color-border","--ok-color-control-hover-border","--ok-color-close-hover-border","--ok-color-sidebar-border","--ok-color-search-input-border","--ok-color-search-shortcut-border","--ok-color-search-popover-border","--ok-color-card-border","--ok-color-tree-badge-border","--ok-color-note-close-hover-border","--ok-color-editor-trigger-border","--ok-color-editor-trigger-separator","--ok-color-editor-menu-border","--ok-color-editor-menu-separator"]};let re=Promise.resolve(),le=0,fe=0,Ae=0;const Se={id:"viewer.panel.close",code:"KeyW",metaOrCtrlKey:!0,altKey:!0,label:"⌘⌥W",ariaKeyShortcut:"Meta+Alt+W",when:function(){return!!Lke()},run:function(){const q=Lke();q&&c7(q)}};function Ne(){return Array.prototype.slice.call(e.querySelectorAll("[data-note-path]"))}function ge(q,X){return q?q.closest?q.closest(X):q.parentElement?q.parentElement.closest(X):null:null}function ve(q,X,te){return Math.min(Math.max(q,X),te)}function ze(){const q=Ke(N);return q&&typeof q=="object"&&!Array.isArray(q)?q:{}}function xe(){const q=JSON.stringify(D);try{window.localStorage.setItem(N,q)}catch{}Qe(N,q)}function Ke(q){const X=[Ce(q),Ve(q)];for(const te of X)if(te)try{return JSON.parse(te)}catch{}return null}function Ce(q){try{return window.localStorage.getItem(q)}catch{return null}}function Ve(q){const X=encodeURIComponent(q)+"=",te=document.cookie?document.cookie.split("; "):[];for(const de of te)if(de.startsWith(X))try{return decodeURIComponent(de.slice(X.length))}catch{return null}return null}function Qe(q,X){try{document.cookie=encodeURIComponent(q)+"="+encodeURIComponent(X)+"; Max-Age=31536000; Path=/; SameSite=Lax"}catch{}}function nt(q){return q==="beside"||q==="replace"?q:F}function tt(){return nt(Ke(z))}function Ze(q){const X=JSON.stringify(nt(q));try{window.localStorage.setItem(z,X)}catch{}Qe(z,X)}function ke(){return A==="beside"?"Links open beside. Hold Shift to replace the current panel.":"Links open in the current panel. Hold Shift to open beside."}function _e(q){A=nt(q),document.documentElement.dataset.viewerNavigationMode=A,u&&(u.dataset.mode=A,u.setAttribute("aria-pressed",A==="beside"?"true":"false"),u.setAttribute("aria-label","Link behavior: "+(A==="beside"?"Open beside":"Open in current panel")),u.title=ke()),qke()}function Y(q){const X=A==="beside";return q?!X:X}function he(){_e(tt()),!(!u||u.dataset.modeBound==="true")&&(u.dataset.modeBound="true",u.addEventListener("click",function(){const q=A==="beside"?"replace":"beside";Ze(q),_e(q)}))}function Z(){const q=Ke(L);return q&&typeof q=="object"&&!Array.isArray(q)?pe(q):pe({preset:W,custom:K})}function pe(q){const X=H.includes(q.preset)?q.preset:W,te=Object.assign({},K);return Object.keys(K).forEach(function(de){we(q.custom&&q.custom[de])&&(te[de]=q.custom[de].toLowerCase())}),{preset:X,custom:te}}function ne(q){const X=pe(q),te=JSON.stringify(X);try{window.localStorage.setItem(L,te)}catch{}Qe(L,te)}function Be(){const q=Ke($);return q&&typeof q=="object"&&!Array.isArray(q)&&typeof q.visible=="boolean"?q.visible:!0}function Te(q){const X=JSON.stringify({visible:!!q});try{window.localStorage.setItem($,X)}catch{}Qe($,X)}function Ue(){const q=Ke(I);return q&&typeof q=="object"&&!Array.isArray(q)?De(q):De(J)}function De(q){const X=q&&typeof q=="object"?q:{};return{font:Object.prototype.hasOwnProperty.call(ie,X.font)?X.font:J.font,size:Object.prototype.hasOwnProperty.call(j,X.size)?X.size:J.size,spacing:Object.prototype.hasOwnProperty.call(ae,X.spacing)?X.spacing:J.spacing,motion:["system","reduced","full"].includes(X.motion)?X.motion:J.motion,readableLineLength:typeof X.readableLineLength=="boolean"?X.readableLineLength:J.readableLineLength,highContrast:typeof X.highContrast=="boolean"?X.highContrast:J.highContrast,underlineLinks:typeof X.underlineLinks=="boolean"?X.underlineLinks:J.underlineLinks}}function qe(q){const X=De(q),te=JSON.stringify(X);try{window.localStorage.setItem(I,te)}catch{}Qe(I,te)}function Le(q){const X=De(q),te=j[X.size],de=ae[X.spacing];document.documentElement.dataset.viewerFont=X.font,document.documentElement.dataset.viewerFontSize=X.size,document.documentElement.dataset.viewerMotion=X.motion,document.documentElement.dataset.viewerContrast=X.highContrast?"high":"normal",document.documentElement.dataset.viewerUnderlines=X.underlineLinks?"on":"off",document.documentElement.style.setProperty("--ok-font-body",ie[X.font]),document.documentElement.style.setProperty("--ok-document-font-size",te.value),document.documentElement.style.setProperty("--ok-document-scale",te.scale),document.documentElement.style.setProperty("--ok-document-line-height",de.value),document.documentElement.style.setProperty("--ok-document-letter-spacing",de.letterSpacing),document.documentElement.style.setProperty("--ok-note-body-max-width",X.readableLineLength?"70ch":"none"),document.body.classList.toggle("is-high-contrast",X.highContrast),document.body.classList.toggle("is-links-underlined",X.underlineLinks),Xe(X)}function Xe(q){f&&(f.value=q.font),p&&(p.value=q.size),g&&(g.value=q.spacing),m&&(m.value=q.motion),y&&(y.checked=q.readableLineLength),v&&(v.checked=q.highContrast),x&&(x.checked=q.underlineLinks)}function Ie(){const q=document.documentElement.dataset.viewerMotion||"system";return q==="reduced"||q==="system"&&_.matches}function it(q){document.body.classList.toggle("is-frontmatter-hidden",!q),d&&(d.checked=q)}function we(q){return/^#[0-9a-f]{6}$/i.test(String(q||""))}function ct(q){const X=we(q)?q.slice(1):K.accent.slice(1);return[parseInt(X.slice(0,2),16),parseInt(X.slice(2,4),16),parseInt(X.slice(4,6),16)]}function be(q,X,te){const de=ct(q),Me=ct(X);return"#"+de.map(function(We,pt){return Math.round(We+(Me[pt]-We)*te)}).map(function(We){return We.toString(16).padStart(2,"0")}).join("")}function _t(q){return bt(q)>.48?"#121715":"#f3f7f4"}function bt(q){const X=ct(q);return(.2126*X[0]+.7152*X[1]+.0722*X[2])/255}function lt(q){const X=pe(q);document.documentElement.dataset.viewerTheme=X.preset;const te=X.preset==="custom"&&bt(X.custom.surface)<=.48;document.documentElement.style.colorScheme=X.preset==="night"||te?"dark":"light",Mt(),X.preset==="custom"&&Tt(X.custom),dt(X),J4t()}function Mt(){Object.keys(Q).forEach(function(q){Q[q].forEach(function(X){document.documentElement.style.removeProperty(X)})}),["--ok-color-accent-rgb","--ok-color-accent-soft","--ok-color-accent-softer","--ok-color-accent-selected","--ok-color-accent-focus","--ok-color-accent-focus-strong","--ok-color-accent-border","--ok-color-accent-border-strong","--ok-color-shadow","--ok-color-code-inline-bg","--ok-color-code-block-text","--ok-color-control-hover-bg","--ok-color-sidebar-row","--ok-color-sidebar-tree-hover-bg","--ok-color-search-result-hover-bg","--ok-color-editor-menu-item-hover-bg","--ok-color-graph-edge-active"].forEach(function(q){document.documentElement.style.removeProperty(q)})}function Tt(q){Object.keys(Q).forEach(function(te){Q[te].forEach(function(de){document.documentElement.style.setProperty(de,q[te])})});const X=ct(q.accent).join(", ");document.documentElement.style.setProperty("--ok-color-accent-rgb",X),document.documentElement.style.setProperty("--ok-color-accent-soft","rgba("+X+", .11)"),document.documentElement.style.setProperty("--ok-color-accent-softer","rgba("+X+", .065)"),document.documentElement.style.setProperty("--ok-color-accent-selected","rgba("+X+", .09)"),document.documentElement.style.setProperty("--ok-color-accent-focus","rgba("+X+", .12)"),document.documentElement.style.setProperty("--ok-color-accent-focus-strong","rgba("+X+", .18)"),document.documentElement.style.setProperty("--ok-color-accent-border","rgba("+X+", .35)"),document.documentElement.style.setProperty("--ok-color-accent-border-strong","rgba("+X+", .5)"),document.documentElement.style.setProperty("--ok-color-shadow","rgba("+ct(q.text).join(", ")+", .1)"),document.documentElement.style.setProperty("--ok-color-code-inline-bg",be(q.surface,q.accent,.1)),document.documentElement.style.setProperty("--ok-color-code-block-text",_t(q.text)),document.documentElement.style.setProperty("--ok-color-control-hover-bg",be(q.page,q.text,.08)),document.documentElement.style.setProperty("--ok-color-sidebar-row",be(q.page,q.text,.11)),document.documentElement.style.setProperty("--ok-color-sidebar-tree-hover-bg",be(q.page,q.accent,.13)),document.documentElement.style.setProperty("--ok-color-search-result-hover-bg",be(q.surface,q.accent,.08)),document.documentElement.style.setProperty("--ok-color-editor-menu-item-hover-bg",be(q.surface,q.accent,.08)),document.documentElement.style.setProperty("--ok-color-graph-edge-active","rgba("+X+", .78)")}function dt(q){document.querySelectorAll("[data-theme-option]").forEach(function(X){const te=X.dataset.themeOption===q.preset;X.classList.toggle("is-selected",te),X.setAttribute("aria-checked",te?"true":"false")}),h&&(h.hidden=q.preset!=="custom",h.querySelectorAll("[data-theme-custom-value]").forEach(function(X){const te=X.dataset.themeCustomValue;q.custom[te]&&(X.value=q.custom[te])}))}function oe(){return Math.min(360,Math.max(260,window.innerWidth-24))}function Rt(){return window.innerWidth<=680?12:Math.max(22,(window.innerWidth-1180)/2)}function ft(q){const X=Ne();return!!(q&&X.length===1&&X[0]===q)}function ht(q){return ft(q)?Math.max(oe(),window.innerWidth-Rt()*2):Math.max(kt(),1180)}function kt(){return Math.max(oe(),qr("var(--ok-note-panel-default-width)",650))}function qr(q,X){const te=document.createElement("div");te.style.position="absolute",te.style.left="-10000px",te.style.top="-10000px",te.style.visibility="hidden",te.style.pointerEvents="none",te.style.width=q,document.body.append(te);const de=te.getBoundingClientRect().width;return te.remove(),Number.isFinite(de)&&de>0?de:X}function ye(q,X){const te=Number(q);return Number.isFinite(te)?Math.round(ve(te,oe(),ht(X))):null}function et(q){return ye(D[q.dataset.notePath],q)}function ut(q){const X=et(q);if(!X){q.style.removeProperty("--note-panel-width"),delete q.dataset.panelWidth;return}q.style.setProperty("--note-panel-width",X+"px"),q.dataset.panelWidth=String(X)}function Lt(q){var X;document.body.classList.toggle("is-sidebar-open",q),n&&n.setAttribute("aria-hidden",q?"false":"true"),i&&i.setAttribute("aria-expanded",q?"true":"false"),q&&Gt(((X=ul())==null?void 0:X.dataset.notePath)||Hl()[0]||"",!0)}function Vt(){Lt(!document.body.classList.contains("is-sidebar-open"))}function lr(q,X){if(n7())return $4t(q,X);let te;try{te=new URL(q,window.location.href)}catch{return null}const de=ir();if(te.origin!==window.location.origin||!te.pathname.startsWith(de))return null;const Me=te.pathname.slice(de.length)||"index.md";if(!$r(Me))return null;try{return decodeURIComponent(Me)}catch{return Me}}function cr(q,X){return q+X.split("/").map(encodeURIComponent).join("/")}function $r(q){return/\.(md|markdown)$/i.test(String(q).split("?")[0].split("#")[0])}function dr(q){return n7()?M4t(q):cr(ir(),q)}function Or(q){return cr(Vr(),q)}function ir(){return R+"/file/"}function Vr(){return R+"/api/file/"}function Sn(q){const X=String(q||"").replace(/\/+$/,"");return X?X.startsWith("/")?X:"/"+X:""}function Ur(){var te;const q=(te=window.OpenKnowledgeStaticData)==null?void 0:te.notes;if(Array.isArray(q))return q;const X=document.querySelector("[data-static-notes]");if(!X)return[];try{const de=JSON.parse(X.textContent||"[]");return Array.isArray(de)?de:[]}catch{return[]}}function us(){const q=new Set;return O.forEach(function(X){X.path&&q.add(X.path)}),document.querySelectorAll("[data-tree-path]").forEach(function(X){X.dataset.treePath&&q.add(X.dataset.treePath)}),q}function Ws(){document.querySelectorAll(".knowledge-tree").forEach(function(q){if(q.dataset.treePrepared==="true")return;q.dataset.treePrepared="true";const X=[];Array.from(q.querySelectorAll(".tree-row")).forEach(function(te){var pt;const de=Us(te);for(;X.length&&X[X.length-1].indent>=de;)X.pop();if(te.dataset.treeParentPath=((pt=X[X.length-1])==null?void 0:pt.path)||"",!te.classList.contains("tree-directory"))return;const Me=String(te.textContent||"").trim(),Fe=X.concat([{name:Me}]).map(function(yt){return yt.name}).join("/");te.dataset.treeDirectoryPath=Fe,te.setAttribute("aria-expanded","false"),te.tabIndex=0,te.title="Expand "+Fe;const We=a7("chevron-down","tree-directory-icon");We.setAttribute("aria-hidden","true"),te.prepend(We),te.addEventListener("click",function(){Ri(te,te.getAttribute("aria-expanded")!=="true")}),te.addEventListener("keydown",function(yt){if(yt.key==="ArrowRight"){yt.preventDefault(),Ri(te,!0);return}if(yt.key==="ArrowLeft"){yt.preventDefault(),Ri(te,!1);return}(yt.key==="Enter"||yt.key===" ")&&(yt.preventDefault(),Ri(te,te.getAttribute("aria-expanded")!=="true"))}),X.push({indent:de,name:Me,path:Fe})}),qt(q)}),Et()}function Us(q){const X=q.style.getPropertyValue("--indent"),te=parseFloat(X);return Number.isFinite(te)?te:0}function Ri(q,X){q.setAttribute("aria-expanded",X?"true":"false"),q.title=(X?"Collapse ":"Expand ")+q.dataset.treeDirectoryPath;const te=q.closest(".knowledge-tree");te&&qt(te)}function qt(q){const X=Object.create(null);q.querySelectorAll("[data-tree-directory-path]").forEach(function(te){X[te.dataset.treeDirectoryPath]=te}),q.querySelectorAll(".tree-row").forEach(function(te){const Me=(te.dataset.treeParentPath||"").split("/").filter(Boolean);let Fe="",We=!1;Me.forEach(function(pt){Fe=Fe?Fe+"/"+pt:pt;const yt=X[Fe];yt&&yt.getAttribute("aria-expanded")!=="true"&&(We=!0)}),te.hidden=We})}function vt(){document.querySelectorAll("[data-tree-directory-path]").forEach(function(q){q.setAttribute("aria-expanded","false"),q.title="Expand "+q.dataset.treeDirectoryPath}),document.querySelectorAll(".knowledge-tree").forEach(qt)}function Gt(q,X){const te=String(q||""),de=te.split("/").slice(0,-1),Me=new Set;if(de.forEach(function(Fe,We){Me.add(de.slice(0,We+1).join("/"))}),document.querySelectorAll(".knowledge-tree").forEach(function(Fe){Fe.querySelectorAll("[data-tree-directory-path]").forEach(function(We){Me.has(We.dataset.treeDirectoryPath)&&(We.setAttribute("aria-expanded","true"),We.title="Collapse "+We.dataset.treeDirectoryPath)}),Fe.querySelectorAll("[data-tree-path]").forEach(function(We){const pt=We.dataset.treePath===te;We.classList.toggle("is-current-file",pt),pt?(We.setAttribute("aria-current","page"),We.title=We.dataset.treePath):(We.removeAttribute("aria-current"),We.title=ke())}),qt(Fe)}),X&&n){const Fe=Array.from(n.querySelectorAll("[data-tree-path]")).find(function(We){return We.dataset.treePath===te});Fe&&window.requestAnimationFrame(function(){Fe.scrollIntoView({block:"center",behavior:Ie()?"auto":"smooth"})})}}function Et(){const q=n==null?void 0:n.querySelector(".file-sidebar-head"),X=q==null?void 0:q.querySelector("[data-sidebar-close]");if(!q||!X||q.querySelector("[data-sidebar-collapse]"))return;const te=document.createElement("div");te.className="file-sidebar-actions";const de=document.createElement("button");de.type="button",de.className="file-sidebar-collapse",de.dataset.sidebarCollapse="",de.textContent="Collapse all",de.addEventListener("click",vt),X.before(te),te.append(de,X)}function xr(q){const X=q.join("/");return[X+"/index.md",X+"/index.markdown"].find(function(te){return G.has(te)})||""}function Ee(q){const X=String(q||"index.md"),te=X.split("/").filter(Boolean),de=te[te.length-1]||"index.md",Me=/^index\.(md|markdown)$/i.test(de)&&te.length>1,Fe=Me?te.slice(0,-1):te,We=document.createElement("nav");return We.className="note-path note-breadcrumbs",We.dataset.noteBreadcrumbs="",We.dataset.breadcrumbsReady="true",We.dataset.notePathValue=X,We.setAttribute("aria-label","Note path"),We.title=X,Fe.forEach(function(pt,yt){if(yt>0){const ar=document.createElement("span");ar.className="note-breadcrumb-separator",ar.setAttribute("aria-hidden","true"),ar.textContent="/",We.append(ar)}const At=yt===Fe.length-1,rr=xr(Fe.slice(0,yt+1)),hr=At?X:rr,Ut=At&&!Me?pt.replace(/\.(md|markdown)$/i,""):pt;if(hr){const ar=document.createElement("a");ar.className="note-breadcrumb-link"+(At?" note-breadcrumb-current":""),ar.href=dr(hr),ar.dataset.directLink="true",ar.textContent=Ut,At&&ar.setAttribute("aria-current","page"),We.append(ar);return}const Kt=document.createElement("span");Kt.className="note-breadcrumb-label",Kt.textContent=Ut,We.append(Kt)}),We}function ta(q){const X=q.querySelector("[data-note-breadcrumbs], .note-path");!X||X.dataset.breadcrumbsReady==="true"||X.replaceWith(Ee(q.dataset.notePath))}function $e(){var te;const q=(te=window.OpenKnowledgeStaticData)==null?void 0:te.graph;if(q)return{nodes:Array.isArray(q.nodes)?q.nodes:[],edges:Array.isArray(q.edges)?q.edges:[]};const X=document.querySelector("[data-knowledge-graph]");if(!X)return{nodes:[],edges:[]};try{const de=JSON.parse(X.textContent||"{}");return{nodes:Array.isArray(de.nodes)?de.nodes:[],edges:Array.isArray(de.edges)?de.edges:[]}}catch{return{nodes:[],edges:[]}}}function Un(){const q=document.querySelector("[data-knowledge-graph-view]"),X=document.querySelector("[data-knowledge-graph-sidebar]");if(!q)return;q.replaceChildren(),X==null||X.replaceChildren();const te=document.createElement("div");te.className="knowledge-graph-info";const de=document.createElement("h2");de.textContent="Knowledge graph";const Me=document.createElement("p");Me.textContent="Select a node to inspect its connections. Use arrow keys to move and Enter to open.";const Fe=document.createElement("p");if(Fe.className="knowledge-graph-status",Fe.dataset.knowledgeGraphStatus="",Fe.setAttribute("aria-live","polite"),Fe.textContent=V.nodes.length?V.nodes.length+(V.nodes.length===1?" note":" notes"):"No notes",te.append(de,Me,Fe),(X||q).append(te),!V.nodes.length){const rr=document.createElement("p");rr.className="empty",rr.textContent="No Markdown files found.",q.append(rr);return}const We=900,pt=640,yt=A4t(V.nodes),Bt=Je(V,We,pt,yt),At=document.createElement("canvas");At.className="knowledge-graph-canvas",At.dataset.knowledgeGraphCanvas="true",At.width=We,At.height=pt,At.tabIndex=0,At.setAttribute("role","img"),At.setAttribute("aria-label","Interactive graph of Markdown files. Use arrow keys to select a note and Enter to open it."),q.append(At),_0(At,V,Bt,yt,We,pt,Fe).start()}function _0(q,X,te,de,Me,Fe,We){const pt=q.getContext("2d"),yt=Object.create(null);X.nodes.forEach(function(sr){sr&&typeof sr.path=="string"&&(yt[sr.path]=!0)});const Bt=X.edges.filter(function(sr){return sr&&yt[sr.source]&&yt[sr.target]&&te[sr.source]&&te[sr.target]}),At=X.nodes.filter(function(sr){return sr&&typeof sr.path=="string"&&te[sr.path]}).map(function(sr){const Cn=te[sr.path],Zc=vke(sr,de);return{node:sr,path:sr.path,label:Zc,fullLabel:bke(sr,de),radius:sr.path==="index.md"?16:10,labelOffset:sr.path==="index.md"?31:25,baseX:Cn.x,baseY:Cn.y,x:Cn.x,y:Cn.y,z:0,vx:0,vy:0}}),rr=Object.create(null);At.forEach(function(sr){rr[sr.path]=sr});let hr="",Ut=At.findIndex(function(sr){return sr.path==="index.md"});Ut<0&&(Ut=0);let Kt=null,ar=0;const Nr=function(sr){const Cn=sr&&rr[sr]?sr:"";if(Cn!==hr)if(hr=Cn,q.dataset.activeGraphPath=hr,q.style.cursor=hr?"pointer":"default",hr){const Zc=At.findIndex(function(d7){return d7.path===hr});Zc>=0&&(Ut=Zc);const E4=rr[hr],oEe=Bt.filter(function(d7){return d7.source===hr||d7.target===hr}).length,lEe=oEe+(oEe===1?" connection":" connections");We&&(We.textContent=E4.fullLabel+" · "+lEe+" · Enter to open"),q.setAttribute("aria-label","Selected "+E4.fullLabel+" with "+lEe+". Use arrow keys to move and Enter to open.")}else We&&(We.textContent=X.nodes.length+(X.nodes.length===1?" note":" notes")),q.setAttribute("aria-label","Interactive graph of Markdown files. Use arrow keys to select a note and Enter to open it.")},An=function(){const sr=Math.max(1,Math.min(window.devicePixelRatio||1,2));q.width=Math.round(Me*sr),q.height=Math.round(Fe*sr),pt.setTransform(sr,0,0,sr,0,0)},Mn=function(sr){const Cn=q.getBoundingClientRect();return!Cn.width||!Cn.height?{x:0,y:0}:{x:(sr.clientX-Cn.left)*(Me/Cn.width),y:(sr.clientY-Cn.top)*(Fe/Cn.height)}},qi=function(sr){Kt=sr;const Cn=Ul(At,sr);Nr(Cn?Cn.path:"")};q.addEventListener("pointermove",function(sr){qi(Mn(sr))}),q.addEventListener("pointerleave",function(){Kt=null,document.activeElement!==q&&Nr("")}),q.addEventListener("click",function(sr){const Cn=Ul(At,Mn(sr));Cn&&D0(Cn.path,!0,Y(!1))}),q.addEventListener("focus",function(){At[Ut]&&Nr(At[Ut].path)}),q.addEventListener("blur",function(){Nr(Kt?hr:"")}),q.addEventListener("keydown",function(sr){if(!At.length)return;if(sr.key==="Enter"||sr.key===" "){hr&&(sr.preventDefault(),D0(hr,!0,Y(!1)));return}if(sr.key!=="ArrowRight"&&sr.key!=="ArrowDown"&&sr.key!=="ArrowLeft"&&sr.key!=="ArrowUp")return;sr.preventDefault();const Cn=sr.key==="ArrowRight"||sr.key==="ArrowDown"?1:-1;Ut=(Ut+Cn+At.length)%At.length,Nr(At[Ut].path)});const Xl=function(){q.isConnected&&(ar=window.requestAnimationFrame(Xl),Rb(At,Bt,rr,hr,Me,Fe),xi(pt,At,Bt,rr,hr,Me,Fe))};return{start:function(){pt&&(An(),xi(pt,At,Bt,rr,hr,Me,Fe),ar=window.requestAnimationFrame(Xl))},stop:function(){ar&&window.cancelAnimationFrame(ar)}}}function Rb(q,X,te,de,Me,Fe){const We=de?te[de]:null;q.forEach(function(yt){const Bt=yt===We?1:0,At=yt===We?.052:.034;yt.vx+=(yt.baseX-yt.x)*At,yt.vy+=(yt.baseY-yt.y)*At,yt.z+=(Bt-yt.z)*.095});const pt=We?Lb(We.z):0;X.forEach(function(yt){const Bt=te[yt.source],At=te[yt.target];if(!Bt||!At)return;const rr=At.x-Bt.x||.01,hr=At.y-Bt.y||.01,Ut=Math.max(1,Math.sqrt(rr*rr+hr*hr)),Kt=We&&(yt.source===We.path||yt.target===We.path),ar=104+(Kt?28*pt:0),Nr=(Ut-ar)*(Kt?.0015:.0011),An=rr/Ut,Mn=hr/Ut;Bt.vx+=An*Nr,Bt.vy+=Mn*Nr,At.vx-=An*Nr,At.vy-=Mn*Nr});for(let yt=0;yt.02){const yt=bh(We,We.fullLabel);q.forEach(function(Bt){if(Bt===We)return;const At=Ti(yt,bh(Bt,Bt.label));if(!At)return;const rr=Bt.x-We.x||.01,hr=Bt.y-We.y||.01,Ut=Math.max(1,Math.sqrt(rr*rr+hr*hr)),Kt=Math.min(3.2,(Math.max(At.x,At.y)*.026+.8)*pt);Bt.vx+=rr/Ut*Kt,Bt.vy+=hr/Ut*Kt})}q.forEach(function(yt){yt.x+=yt.vx,yt.y+=yt.vy,Gi(yt,Me,Fe),Ib(yt,We?5.5:4.2);const Bt=We?.58:.66;yt.vx*=Bt,yt.vy*=Bt,Math.abs(yt.vx)<.018&&(yt.vx=0),Math.abs(yt.vy)<.018&&(yt.vy=0)})}function Lb(q){const X=ve(q,0,1);return X*X*(3-2*X)}function Ib(q,X){const te=Math.sqrt(q.vx*q.vx+q.vy*q.vy);if(te<=X||te<=0)return;const de=X/te;q.vx*=de,q.vy*=de}function xi(q,X,te,de,Me,Fe,We){const pt=Me?de[Me]:null,yt=Wl();q.clearRect(0,0,Fe,We),q.lineCap="round",q.lineJoin="round",te.forEach(function(Bt){const At=de[Bt.source],rr=de[Bt.target];if(!At||!rr)return;const hr=pt&&(Bt.source===pt.path||Bt.target===pt.path);q.beginPath(),q.moveTo(At.x,At.y),q.lineTo(rr.x,rr.y),q.strokeStyle=hr?yt.edgeActive:pt?yt.edgeMuted:yt.edge,q.lineWidth=hr?2.35:1.05,q.stroke()}),X.slice().sort(function(Bt,At){return Bt.z-At.z}).forEach(function(Bt){const At=Bt===pt,rr=1+Bt.z*.22,hr=Bt.radius*rr,Ut=At?Bt.fullLabel:Bt.label;q.save(),q.globalAlpha=1,q.beginPath(),q.arc(Bt.x,Bt.y-Bt.z*6,hr,0,Math.PI*2),q.fillStyle=yt.nodeBg,q.fill(),q.strokeStyle=At?yt.nodeActiveBorder:yt.nodeBorder,q.lineWidth=At?3:Bt.path==="index.md"?2:1.55,q.stroke(),q.font=(At?"600 13px":"400 12px")+" "+yt.fontBody,q.textBaseline="middle",q.textAlign=Re(Bt.x,zi(Ut),Fe);const Kt=q.textAlign==="start"?Math.max(16,Bt.x-zi(Ut)/2):q.textAlign==="end"?Math.min(Fe-16,Bt.x+zi(Ut)/2):Bt.x,ar=Bt.y+Bt.labelOffset+Bt.z*4;q.fillStyle=At?yt.labelActive:yt.label,q.fillText(Ut,Kt,ar),q.restore()})}function Wl(){const q=document.documentElement.dataset.viewerContrast==="high";return{fontBody:Fi("--ok-font-body","Inter, ui-sans-serif, system-ui, sans-serif"),edge:q?Fi("--ok-color-text","#202322"):Fi("--ok-color-graph-edge","rgba(128, 138, 133, .25)"),edgeMuted:q?Fi("--ok-color-muted","#707773"):Fi("--ok-color-graph-edge-muted","rgba(128, 138, 133, .11)"),edgeActive:Fi("--ok-color-graph-edge-active","rgba(15, 122, 77, .78)"),nodeBg:Fi("--ok-color-graph-node-bg","#f8f8f8"),nodeBorder:q?Fi("--ok-color-text","#202322"):Fi("--ok-color-graph-node-border","#aeb8b2"),nodeActiveBorder:Fi("--ok-color-graph-node-active-border","#0f7a4d"),label:q?Fi("--ok-color-text","#202322"):Fi("--ok-color-graph-label","#5f6b66"),labelActive:q?Fi("--ok-color-text","#202322"):Fi("--ok-color-graph-label-active","#26302c")}}function Fi(q,X){return getComputedStyle(document.documentElement).getPropertyValue(q).trim()||X}function Ul(q,X){for(let te=q.length-1;te>=0;te-=1){const de=q[te],Me=X.x-de.x,Fe=X.y-de.y,We=de.radius*(1+de.z*.22)+6;if(Me*Me+Fe*Fe<=We*We||Ft(X,bh(de,de.z>.6?de.fullLabel:de.label)))return de}return null}function bh(q,X){const te=zi(X),de=q.y+q.labelOffset-10,Me=Math.max(q.radius+8,te/2+9);return{left:q.x-Me,right:q.x+Me,top:Math.min(q.y-q.radius-8,de),bottom:Math.max(q.y+q.radius+8,de+22)}}function Ft(q,X){return q.x>=X.left&&q.x<=X.right&&q.y>=X.top&&q.y<=X.bottom}function Re(q,X,te){return q-X/2<16?"start":q+X/2>te-16?"end":"center"}function Je(q,X,te,de){const Me=q.nodes.filter(function(Ut){return Ut&&typeof Ut.path=="string"&&Ut.path.length>0}),Fe=Object.create(null);if(Me.length===0)return Fe;if(Me.length===1)return Fe[Me[0].path]={x:X/2,y:te/2},Fe;const We={x:X/2,y:te/2},pt=Object.create(null),yt=Object.create(null);Me.forEach(function(Ut){pt[Ut.path]=!0,yt[Ut.path]=0});const Bt=[];q.edges.forEach(function(Ut){!Ut||!pt[Ut.source]||!pt[Ut.target]||(Bt.push(Ut),yt[Ut.source]+=1,yt[Ut.target]+=1)});const At=xt(Me,X,te),rr=Me.map(function(Ut){const Kt=Xt(Ut.path),ar=At[Kt]||We,Nr=ln(Ut.path),An=Nr%360/360*Math.PI*2,Mn=26+Nr%74;return{node:Ut,group:Kt,label:vke(Ut,de),radius:Ut.path==="index.md"?16:10,x:ar.x+Math.cos(An)*Mn,y:ar.y+Math.sin(An)*Mn,vx:0,vy:0}}),hr=Object.create(null);rr.forEach(function(Ut){hr[Ut.node.path]=Ut});for(let Ut=0;Ut<220;Ut+=1){for(let Kt=0;Kt0?.006:.018;Kt.vx+=(We.x-Kt.x)*An,Kt.vy+=(We.y-Kt.y)*An,Kt.vx+=(ar.x-Kt.x)*Mn,Kt.vy+=(ar.y-Kt.y)*Mn,Kt.x+=Kt.vx,Kt.y+=Kt.vy,Gi(Kt,X,te),Kt.vx*=.62,Kt.vy*=.62})}return vr(rr,X,te),_n(rr,X,te),rr.forEach(function(Ut){Fe[Ut.node.path]={x:Ut.x,y:Ut.y}}),Fe}function xt(q,X,te){const de=Object.create(null);q.forEach(function(At){const rr=Xt(At.path);de[rr]=(de[rr]||0)+1});const Me=Object.keys(de).sort(function(At,rr){return de[rr]===de[At]?At.localeCompare(rr):de[rr]-de[At]}),Fe=Object.create(null);if(Me.length===0)return Fe;const We=Math.max(1,Math.ceil(Math.sqrt(Me.length*(X/te)))),pt=Math.max(1,Math.ceil(Me.length/We)),yt=X/We,Bt=te/pt;return Me.forEach(function(At,rr){const hr=rr%We,Ut=Math.floor(rr/We),Kt=ln(At),ar=(Kt%31-15)*.9,Nr=((Kt>>5)%31-15)*.9;Fe[At]={x:yt*(hr+.5)+ar,y:Bt*(Ut+.5)+Nr}}),Fe}function Xt(q){const X=r7(q);return X.length<=1?".":X.length>=3?X.slice(0,2).join("/"):X[0]}function vr(q,X,te){let de=1/0,Me=-1/0,Fe=1/0,We=-1/0;q.forEach(function(Nr){de=Math.min(de,Nr.x),Me=Math.max(Me,Nr.x),Fe=Math.min(Fe,Nr.y),We=Math.max(We,Nr.y)});const pt=74,yt=58,Bt=Math.max(1,Me-de),At=Math.max(1,We-Fe),rr=Math.min((X-pt*2)/Bt,(te-yt*2)/At,1.28),hr=(de+Me)/2,Ut=(Fe+We)/2,Kt=X/2,ar=te/2;q.forEach(function(Nr){Nr.x=ve(Kt+(Nr.x-hr)*rr,pt,X-pt),Nr.y=ve(ar+(Nr.y-Ut)*rr,yt,te-yt),Gi(Nr,X,te)})}function br(q,X){const te=q.map(wn);for(let de=0;deX-14&&(q.x-=de.right-(X-14)),de.top<18&&(q.y+=18-de.top),de.bottom>te-18&&(q.y-=de.bottom-(te-18))}function ln(q){let X=2166136261;const te=String(q||"");for(let de=0;de>>0}function A4t(q){const X=Object.create(null);q.forEach(function(de){if(!de||typeof de.path!="string")return;const Me=yke(de);X[Me]||(X[Me]=[]),X[Me].push(de)});const te=Object.create(null);return Object.keys(X).forEach(function(de){const Me=X[de];if(Me.length===1){te[Me[0].path]=de;return}const Fe=Me.map(function(We){return We.path});Me.forEach(function(We){te[We.path]=L4t(We.path,Fe)})}),te}function yke(q){const X=String(q.title||"").trim();return X&&X.toLowerCase()!=="index"?X:R4t(q.path)}function R4t(q){const X=r7(q);if(X.length===0)return String(q||"");const te=X[X.length-1];return te.toLowerCase()==="index"&&X.length>1?X.slice(-2).join("/"):te}function L4t(q,X){const te=r7(q);for(let de=1;de<=te.length;de+=1){const Me=te.slice(-de).join("/");if(X.every(function(We){return We===q||r7(We).slice(-de).join("/")!==Me}))return Me}return te.join("/")||String(q||"")}function r7(q){return String(q||"").replace(/\.md$/i,"").split("/").filter(Boolean)}function vke(q,X){const te=bke(q,X);return te.length>22?te.slice(0,21)+"...":te}function bke(q,X){return X[q.path]||yke(q)}function I4t(q,X){const te=Object.create(null);return q.forEach(function(de){de&&typeof de[X]=="string"&&(te[de[X]]=de)}),te}function D4t(q){const X=Object.create(null);return q.forEach(function(te){te&&typeof te.htmlPath=="string"&&typeof te.path=="string"&&xke(te.htmlPath).forEach(function(de){X[de]===void 0&&(X[de]=te.path)})}),X}function n7(){return O.length>0}function i7(q){const X=String(q).lastIndexOf(".");return X<0?Gd(q+"/index.html"):Gd(q.slice(0,X)+".html")}function xke(q){const X=Gd(q),te=[];if(g4(te,X),/\.html$/i.test(X)){const de=X.slice(0,-5);g4(te,de),/\/index\.html$/i.test(X)?g4(te,X.slice(0,X.length-10)):/^index\.html$/i.test(X)&&g4(te,"")}return te.slice().forEach(function(de){g4(te,de.toLowerCase())}),te}function g4(q,X){const te=Gd(X);q.includes(te)||q.push(te)}function M4t(q){var Fe;const X=Hl()[0]||((Fe=document.querySelector("[data-note-path]"))==null?void 0:Fe.dataset.notePath)||"index.md",te=i7(X),de=i7(q),Me=te.includes("/")?te.slice(0,te.lastIndexOf("/")+1):"";return N4t(Me,de)}function N4t(q,X){const te=Gd(q).split("/").filter(Boolean),de=Gd(X).split("/").filter(Boolean);for(;te.length&&de.length&&te[0]===de[0];)te.shift(),de.shift();return te.map(function(){return".."}).concat(de).join("/")||"."}function Gd(q){const X=String(q||"").replace(/\\/g,"/").split("/"),te=[];return X.forEach(function(de){if(!(!de||de===".")){if(de===".."){te.pop();return}te.push(de)}}),te.join("/")}function $4t(q,X){const te=String(q||"").trim();if(!te||te.startsWith("#"))return null;const de=te.split("#")[0].split("?")[0];if(!de)return X||null;if(!/^[a-zA-Z][a-zA-Z0-9+.-]*:/.test(de)&&!de.startsWith("/")){const Fe=i7(X||Hl()[0]||"index.md"),We=Fe.includes("/")?Fe.slice(0,Fe.lastIndexOf("/")+1):"";return Tke(We+de)}let Me;try{Me=new URL(de,window.location.href)}catch{return null}return Me.origin!==window.location.origin?null:Tke(O4t(Me))}function Tke(q){const X=Gd(q);return P[X]||P[X.toLowerCase()]||null}function O4t(q){var Fe;const X=((Fe=document.querySelector("[data-note-path]"))==null?void 0:Fe.dataset.notePath)||Hl()[0]||"index.md";let te=wke(window.location.pathname),de=wke(q.pathname);const Me=P4t(te,X);return Me&&de.toLowerCase().startsWith(Me.toLowerCase())&&(de=de.slice(Me.length)),Gd(de)}function P4t(q,X){const te=String(q||"").toLowerCase(),de=xke(i7(X)).filter(Boolean).sort(function(Me,Fe){return Fe.length-Me.length});for(const Me of de){const Fe=["/"+Me,"/"+Me+"/"];for(const We of Fe)if(te.endsWith(We.toLowerCase()))return q.slice(0,q.length-We.length+1)}return q.slice(0,q.lastIndexOf("/")+1)}function wke(q){try{return decodeURIComponent(q||"")}catch{return q||""}}function B4t(q){const X=t.dataset.noteRoot||"",te=X.includes("\\")?"\\":"/",de=X.replace(/[\\/]+$/,""),Me=String(q||"").split("/").join(te);return de?de+te+Me:Me}function Cke(q){const X=String(q||"").replace(/\\/g,"/");return(X.startsWith("/")?"/":"")+X.split("/").filter(Boolean).map(encodeURIComponent).join("/")}function F4t(q){const X=Cke(q);return"file://"+(X.startsWith("/")?"":"/")+X}function z4t(q,X){const te=B4t(X),de=Cke(te),Me=de.startsWith("/")?de:"/"+de,Fe=F4t(te);switch(q.id){case"code":return"vscode://file"+Me;case"cursor":return"cursor://file"+Me;case"windsurf":return"windsurf://file"+Me;case"zed":return"zed://file"+Me;case"obsidian":return"obsidian://open?path="+encodeURIComponent(te);case"sublime":return"sublime://open?url="+encodeURIComponent(Fe);case"bbedit":return"bbedit://open?url="+encodeURIComponent(Fe);case"nova":return"nova://open?path="+encodeURIComponent(te);case"intellij":return"idea://open?file="+encodeURIComponent(te);case"webstorm":return"webstorm://open?file="+encodeURIComponent(te);default:return Fe}}function G4t(){var de;const q=[{id:"code",name:"Visual Studio Code",short:"VS",available:!1},{id:"cursor",name:"Cursor",short:"Cu",available:!1},{id:"windsurf",name:"Windsurf",short:"Ws",available:!1},{id:"zed",name:"Zed",short:"Zd",available:!1}],X=(de=window.OpenKnowledgeStaticData)==null?void 0:de.editors;if(Array.isArray(X)&&X.length)return X;const te=document.querySelector("[data-editor-options]");if(!te)return q;try{const Me=JSON.parse(te.textContent||"[]");return Array.isArray(Me)&&Me.length?Me:q}catch{return q}}function q4t(q){return M.find(function(X){return X.id===q})||M[0]}function kke(q){return q.short||q.name.slice(0,2)}function Eke(q,X){if(q.replaceChildren(),q.dataset.hasIcon=X.icon?"true":"false",!X.icon){q.textContent=kke(X);return}const te=document.createElement("img");te.className="editor-icon",te.src=X.icon,te.alt="",te.decoding="async",te.draggable=!1,te.addEventListener("error",function(){q.dataset.hasIcon="false",q.replaceChildren(),q.textContent=kke(X)},{once:!0}),q.append(te)}function a7(q,X){const te=document.createElementNS("http://www.w3.org/2000/svg","svg");if(te.setAttribute("class",X+" control-icon"),te.setAttribute("data-icon",q),te.setAttribute("viewBox","0 0 24 24"),te.setAttribute("aria-hidden","true"),q==="chevron-down"){const Fe=document.createElementNS("http://www.w3.org/2000/svg","path");return Fe.setAttribute("d","m6 9 6 6 6-6"),te.append(Fe),te}if(q==="github"){const Fe=document.createElementNS("http://www.w3.org/2000/svg","path");return Fe.setAttribute("d","M12 .5a12 12 0 0 0-3.79 23.39c.6.11.82-.26.82-.58v-2.17c-3.34.73-4.04-1.42-4.04-1.42-.55-1.39-1.34-1.76-1.34-1.76-1.09-.75.08-.73.08-.73 1.2.08 1.84 1.24 1.84 1.24 1.07 1.83 2.8 1.3 3.49.99.11-.78.42-1.3.76-1.6-2.67-.3-5.47-1.33-5.47-5.93 0-1.31.47-2.38 1.24-3.22-.13-.3-.54-1.52.11-3.18 0 0 1.01-.32 3.3 1.23a11.4 11.4 0 0 1 6 0c2.29-1.55 3.3-1.23 3.3-1.23.65 1.66.24 2.88.12 3.18.77.84 1.23 1.91 1.23 3.22 0 4.61-2.81 5.63-5.48 5.92.43.37.81 1.1.81 2.22v3.29c0 .32.22.69.83.58A12 12 0 0 0 12 .5Z"),te.append(Fe),te}const de=document.createElementNS("http://www.w3.org/2000/svg","path");de.setAttribute("d","M18 6 6 18");const Me=document.createElementNS("http://www.w3.org/2000/svg","path");return Me.setAttribute("d","m6 6 12 12"),te.append(de,Me),te}function Ske(){let q=[];try{q=JSON.parse(window.localStorage.getItem(S)||"[]")}catch{q=[]}Array.isArray(q)||(q=[]);const X=new Set(M.map(function(de){return de.id})),te=q.filter(function(de,Me){return typeof de=="string"&&X.has(de)&&q.indexOf(de)===Me});return M.forEach(function(de){te.includes(de.id)||te.push(de.id)}),te}function V4t(){return Ske().map(q4t).filter(Boolean)}function _ke(q){const X=[q].concat(Ske().filter(function(te){return te!==q}));try{window.localStorage.setItem(S,JSON.stringify(X))}catch{return}}function W4t(){const q=document.createElement("div");q.className="editor-picker",q.dataset.editorPicker="";const X=document.createElement("div");X.className="editor-trigger",X.dataset.editorTrigger="",X.setAttribute("role","group");const te=document.createElement("a");te.className="editor-open",te.href="#",te.dataset.editorOpen="",te.dataset.directLink="true",te.title="Open in editor";const de=document.createElement("span");de.className="editor-mark",de.dataset.editorMark="",de.setAttribute("aria-hidden","true"),de.textContent="--",te.append(de);const Me=document.createElement("button");Me.className="editor-menu-trigger",Me.type="button",Me.dataset.editorMenuTrigger="",Me.setAttribute("aria-haspopup","menu"),Me.setAttribute("aria-expanded","false"),Me.setAttribute("aria-label","Choose editor"),Me.title="Choose editor",Me.append(a7("chevron-down","editor-caret")),X.append(te,Me);const Fe=document.createElement("div");return Fe.className="editor-menu",Fe.dataset.editorMenu="",Fe.hidden=!0,Fe.setAttribute("role","menu"),q.append(X,Fe),q}function U4t(q,X){if(!X)return null;const te=document.createElement("a");return te.className="source-open",te.href=X,te.dataset.sourceOpen="",te.dataset.directLink="true",te.target="_blank",te.rel="noreferrer",te.title="Open on GitHub",te.setAttribute("aria-label","Open "+q+" on GitHub"),te.append(a7("github","source-icon")),te}function mq(q){const X=q.querySelector("[data-editor-trigger]"),te=q.querySelector("[data-editor-open]"),de=q.querySelector("[data-editor-menu-trigger]"),Me=q.querySelector("[data-editor-mark]"),Fe=q.querySelector("[data-editor-menu]"),We=V4t(),pt=We[0],yt=q.closest("[data-note-path]"),Bt=(yt==null?void 0:yt.dataset.notePath)||"";if(!(!X||!te||!de||!Me||!Fe||!pt||!Bt)){if(Eke(Me,pt),X.setAttribute("aria-label","Editor: "+pt.name),te.href=z4t(pt,Bt),te.title="Open "+Bt+" in "+pt.name,te.setAttribute("aria-label","Open "+Bt+" in "+pt.name),de.title="Choose editor",de.setAttribute("aria-label","Choose editor for "+Bt),q.dataset.primaryEditor=pt.id,Fe.replaceChildren(),Ake(Fe,pt,!0),We.length>1){const At=document.createElement("div");At.className="editor-menu-separator",At.setAttribute("role","separator"),Fe.append(At)}We.slice(1).forEach(function(At){Ake(Fe,At,!1)})}}function Ake(q,X,te){const de=document.createElement("button");de.className="editor-menu-item"+(te?" is-selected":""),de.type="button",de.dataset.editorOption=X.id,de.setAttribute("role","menuitemradio"),de.setAttribute("aria-checked",te?"true":"false");const Me=document.createElement("span");Me.className="editor-option-mark",Eke(Me,X);const Fe=document.createElement("span");Fe.className="editor-option-label",Fe.textContent=X.name,de.append(Me,Fe),q.append(de)}function Rke(){document.querySelectorAll("[data-editor-picker]").forEach(mq)}function m4(q,X){const te=q.querySelector("[data-editor-menu-trigger]"),de=q.querySelector("[data-editor-menu]");!te||!de||(X&&(y4(q),mq(q)),de.hidden=!X,te.setAttribute("aria-expanded",X?"true":"false"))}function y4(q){document.querySelectorAll("[data-editor-picker]").forEach(function(X){X!==q&&m4(X,!1)})}function v4(q){!o||!l||(l.hidden=!q,o.setAttribute("aria-expanded",q?"true":"false"))}function H4t(){if(!l)return null;const q=l.querySelector("[data-settings-reset]");if(q)return q;const X=document.createElement("div");X.className="viewer-settings-footer";const te=document.createElement("button");return te.type="button",te.className="viewer-settings-reset",te.dataset.settingsReset="",te.textContent="Reset to defaults",X.append(te),l.append(X),te}function Y4t(){if(!s||!o||!l||s.dataset.settingsBound==="true")return;s.dataset.settingsBound="true";let q=Z(),X=Be(),te=Ue();lt(q),it(X),Le(te);const de=H4t();de&&de.addEventListener("click",function(){q=pe({preset:W,custom:K}),X=!0,te=De(J),A=F,ne(q),Te(X),qe(te),Ze(A),lt(q),it(X),Le(te),_e(A)}),o.addEventListener("click",function(Fe){Fe.preventDefault(),Fe.stopPropagation(),v4(l.hidden)}),o.addEventListener("keydown",function(Fe){if(Fe.key!=="ArrowDown"&&Fe.key!=="Enter"&&Fe.key!==" ")return;Fe.preventDefault(),v4(!0);const We=l.querySelector("[data-theme-option].is-selected")||l.querySelector("[data-theme-option]");We&&We.focus()}),l.addEventListener("click",function(Fe){const We=ge(Fe.target,"[data-theme-option]");We&&(Fe.preventDefault(),q=pe({preset:We.dataset.themeOption,custom:q.custom}),ne(q),lt(q))}),l.addEventListener("keydown",function(Fe){if(Fe.key==="Escape"){Fe.preventDefault(),v4(!1),o.focus();return}if(Fe.key!=="Enter"&&Fe.key!==" ")return;const We=ge(Fe.target,"[data-theme-option]");We&&(Fe.preventDefault(),q=pe({preset:We.dataset.themeOption,custom:q.custom}),ne(q),lt(q))}),l.querySelectorAll("[data-theme-custom-value]").forEach(function(Fe){Fe.addEventListener("input",function(){const We=Fe.dataset.themeCustomValue;if(!K[We]||!we(Fe.value))return;const pt=Object.assign({},q.custom);pt[We]=Fe.value.toLowerCase(),q=pe({preset:"custom",custom:pt}),ne(q),lt(q)})}),d&&d.addEventListener("change",function(){X=d.checked,Te(X),it(X)});function Me(Fe,We){te=De(Object.assign({},te,{[Fe]:We})),qe(te),Le(te)}f&&f.addEventListener("change",function(){Me("font",f.value)}),p&&p.addEventListener("change",function(){Me("size",p.value)}),g&&g.addEventListener("change",function(){Me("spacing",g.value)}),m&&m.addEventListener("change",function(){Me("motion",m.value)}),y&&y.addEventListener("change",function(){Me("readableLineLength",y.checked)}),v&&v.addEventListener("change",function(){Me("highContrast",v.checked)}),x&&x.addEventListener("change",function(){Me("underlineLinks",x.checked)})}function ul(){return e.querySelector(".note-panel.is-active-panel")}function X4t(){return ge(document.activeElement,"[data-note-path]")}function Lke(){return X4t()||ul()}function qd(q){!q||!e.contains(q)||(Ne().forEach(function(X){const te=X===q;X.classList.toggle("is-active-panel",te),X.dataset.activePanel=te?"true":"false",te||X.querySelectorAll("[data-editor-picker]").forEach(function(de){m4(de,!1)})}),A0(),Gt(q.dataset.notePath,!1))}function yq(){const q=Ne();q.length&&(ul()||qd(q[q.length-1]))}function j4t(q){!q||q.dataset.resizeHandlesBound==="true"||(q.dataset.resizeHandlesBound="true",["left","right"].forEach(function(X){const te=document.createElement("button");te.type="button",te.className="note-resize-handle note-resize-handle-"+X,te.dataset.panelResizeHandle=X,te.setAttribute("aria-label","Resize note panel from the "+X),te.title="Resize panel",te.addEventListener("pointerdown",Lkt),te.addEventListener("keydown",function(de){Rkt(q,X,de)}),q.append(te)}),Ike(q),q.addEventListener("scroll",function(){Ike(q)},{passive:!0}))}function Ike(q){q&&q.style.setProperty("--note-panel-scroll-top",Math.max(0,q.scrollTop||0)+"px")}function K4t(q){if(!q||q.dataset.editorBound==="true")return;q.dataset.editorBound="true",mq(q);const X=q.querySelector("[data-editor-menu-trigger]"),te=q.querySelector("[data-editor-menu]");!X||!te||(X.addEventListener("click",function(de){de.preventDefault(),de.stopPropagation(),m4(q,te.hidden)}),X.addEventListener("keydown",function(de){if(de.key!=="ArrowDown"&&de.key!=="Enter"&&de.key!==" ")return;de.preventDefault(),m4(q,!0);const Me=te.querySelector("[data-editor-option]");Me&&Me.focus()}),te.addEventListener("click",function(de){const Me=ge(de.target,"[data-editor-option]");Me&&(de.preventDefault(),de.stopPropagation(),_ke(Me.dataset.editorOption),Rke(),y4())}),te.addEventListener("keydown",function(de){if(de.key==="Escape"){de.preventDefault(),m4(q,!1),X.focus();return}if(de.key!=="Enter"&&de.key!==" ")return;const Me=ge(de.target,"[data-editor-option]");Me&&(de.preventDefault(),_ke(Me.dataset.editorOption),Rke(),y4(),X.focus())}))}function Hl(){return Ne().map(function(q){return q.dataset.notePath})}function Dke(){const q=new URLSearchParams(window.location.search);return q.get("empty")==="1"?[]:[lr(window.location.href)||Hl()[0]||"index.md"].concat(q.getAll("stack").filter(Boolean))}function Mke(){return Nke(window.location.href)}function Nke(q){let X;try{X=new URL(q,window.location.href)}catch{return""}return(X.searchParams.get("ok-highlight")||"").trim()}function $ke(q,X){if(!q.length){const de=new URL(dr("index.md"),window.location.href);return de.searchParams.set("empty","1"),de}const te=new URL(dr(q[0]||"index.md"),window.location.href);return q.slice(1).forEach(function(de){te.searchParams.append("stack",de)}),X&&te.searchParams.set("ok-highlight",X),te}function Db(){const q=Ne().length,X=q===0;t.classList.toggle("is-empty",X),t.classList.toggle("is-single-panel",q===1),t.classList.toggle("is-multi-panel",q>1),r&&(r.hidden=!X),Ne().forEach(ut),yq(),Z4t(),u7(),s7()}function Z4t(){const q=Hl();Ne().forEach(function(X,te){const de=X.querySelector("[data-close-panel]");if(!de)return;const Me=q.filter(function(Fe,We){return We!==te});de.href=$ke(Me).href})}function b4(){return Math.max(0,t.scrollWidth-t.clientWidth)}function x4(){return!!(b&&w&&C&&Ne().length>1&&b4()>1&&!t.classList.contains("is-empty"))}function s7(){window.requestAnimationFrame(Q4t)}function Q4t(){if(!b||!w||!C)return;if(!x4()){b.hidden=!0,b.setAttribute("aria-hidden","true"),C.style.width="",C.style.setProperty("--thumb-x","0px"),C.setAttribute("aria-valuemax","0"),C.setAttribute("aria-valuenow","0");return}b.hidden=!1,b.setAttribute("aria-hidden","false");const q=w.getBoundingClientRect().width;if(q<=0)return;const X=b4(),te=ve(q*(t.clientWidth/t.scrollWidth),44,q),de=Math.max(0,q-te),Me=X>0?t.scrollLeft/X*de:0;C.style.width=te+"px",C.style.setProperty("--thumb-x",ve(Me,0,de)+"px"),C.setAttribute("aria-valuemax",String(Math.round(X))),C.setAttribute("aria-valuenow",String(Math.round(t.scrollLeft)))}function vq(q,X){if(!x4())return;const te=w.getBoundingClientRect(),de=C.getBoundingClientRect(),Me=Math.max(0,te.width-de.width),Fe=b4(),We=ve(q-te.left-X,0,Me);t.scrollLeft=Me>0?We/Me*Fe:0}function A0(){const q=Ne(),X=ul()||q[q.length-1];if(!X){document.title="Knowledge base - Open Knowledge";return}const te=(X==null?void 0:X.dataset.noteTitle)||(X==null?void 0:X.dataset.notePath)||"Open Knowledge";document.title=te+" - Open Knowledge"}function T4(q,X,te){const de=$ke(q,te),Me={stack:q};window.history.pushState(Me,"",de)}function J4t(){window.clearTimeout(Ae),Ae=window.setTimeout(function(){Oke(e,!0)},60)}function R0(q,X,te){return q.getPropertyValue(X).trim()||te}function ekt(){const q=window.getComputedStyle(document.documentElement),X=R0(q,"--ok-color-page","#ffffff"),te=R0(q,"--ok-color-surface",X),de=R0(q,"--ok-color-text","#202322"),Me=R0(q,"--ok-color-muted","#707773"),Fe=R0(q,"--ok-color-accent","#0b7a53"),We=R0(q,"--ok-color-border","#e3e6e4");return{startOnLoad:!1,securityLevel:"strict",suppressErrorRendering:!0,logLevel:"fatal",theme:"base",themeVariables:{background:X,primaryColor:te,primaryTextColor:de,primaryBorderColor:We,lineColor:Me,secondaryColor:X,secondaryTextColor:de,secondaryBorderColor:We,tertiaryColor:te,tertiaryTextColor:de,tertiaryBorderColor:We,mainBkg:te,nodeBorder:Fe,clusterBkg:X,clusterBorder:We,titleColor:de,edgeLabelBackground:te,textColor:de,fontFamily:R0(q,"--ok-font-body","sans-serif")},flowchart:{htmlLabels:!1}}}function tkt(q){var te,de;const X=[];return(te=q==null?void 0:q.matches)!=null&&te.call(q,"[data-mermaid-source]")&&X.push(q),(de=q==null?void 0:q.querySelectorAll)==null||de.call(q,"[data-mermaid-source]").forEach(function(Me){X.push(Me)}),X}function rkt(q){var Fe;const X=ge(q,"[data-mermaid-diagram]");if(X)return X;const te=document.createElement("figure");te.className="ok-mermaid",te.dataset.mermaidDiagram="";const de=document.createElement("div");de.className="ok-mermaid-output",de.dataset.mermaidOutput="",de.setAttribute("role","img"),de.setAttribute("aria-label","Mermaid diagram"),de.hidden=!0;const Me=document.createElement("p");return Me.className="ok-mermaid-error",Me.dataset.mermaidError="",Me.setAttribute("role","status"),Me.textContent="This Mermaid diagram could not be rendered. Its source is shown below.",Me.hidden=!0,q.parentNode.insertBefore(te,q),te.append(de,Me,q),te._openKnowledgeMermaidSource=String(((Fe=q.querySelector("code"))==null?void 0:Fe.textContent)||q.textContent||""),te}function Oke(q,X){if(!window.mermaid||typeof window.mermaid.render!="function")return;const te=tkt(q).map(rkt).filter(function(Me){const Fe=Me.dataset.mermaidState||"";return X||Fe!=="queued"&&Fe!=="rendering"&&Fe!=="rendered"});if(!te.length)return;const de=++fe;te.forEach(function(Me){Me.dataset.mermaidState="queued",Me._openKnowledgeMermaidRequest=de}),re=re.catch(function(){}).then(function(){return nkt(te,de)})}async function nkt(q,X){try{window.mermaid.initialize(ekt())}catch{q.forEach(function(te){const de=te.querySelector("[data-mermaid-source]"),Me=te.querySelector("[data-mermaid-output]"),Fe=te.querySelector("[data-mermaid-error]");te._openKnowledgeMermaidRequest!==X||!de||!Me||!Fe||(Me.hidden=!0,de.hidden=!1,Fe.hidden=!1,te.dataset.mermaidState="error")});return}for(const te of q){if(te._openKnowledgeMermaidRequest!==X)continue;const de=te.querySelector("[data-mermaid-source]"),Me=te.querySelector("[data-mermaid-output]"),Fe=te.querySelector("[data-mermaid-error]");if(!(!de||!Me||!Fe)){te.dataset.mermaidState="rendering",Me.setAttribute("aria-busy","true");try{const We=await window.mermaid.render("ok-mermaid-"+ ++le,te._openKnowledgeMermaidSource);if(te._openKnowledgeMermaidRequest!==X)continue;Me.innerHTML=We.svg,typeof We.bindFunctions=="function"&&We.bindFunctions(Me),Me.hidden=!1,de.hidden=!0,Fe.hidden=!0,te.dataset.mermaidState="rendered"}catch{if(te._openKnowledgeMermaidRequest!==X)continue;te.dataset.mermaidRendered!=="true"&&(Me.hidden=!0,de.hidden=!1,Fe.hidden=!1),te.dataset.mermaidState="error"}finally{Me.removeAttribute("aria-busy")}te.dataset.mermaidState==="rendered"&&(te.dataset.mermaidRendered="true")}}}function ikt(q){q.querySelectorAll("table").forEach(function(X){var rr,hr,Ut;if(X.dataset.okTableEnhanced==="true")return;const te=(hr=(rr=X.tHead)==null?void 0:rr.rows)==null?void 0:hr[0],de=(Ut=X.tBodies)==null?void 0:Ut[0];if(!te||!de)return;const Me=Array.prototype.slice.call(te.cells),Fe=Array.prototype.slice.call(de.rows);if(!Me.length||!Fe.length)return;X.classList.add("ok-table"),X.dataset.okTable="",X.dataset.okTableEnhanced="true",Fe.forEach(function(Kt,ar){Kt.dataset.okTableOriginalIndex=String(ar)});const We=akt(X),pt={query:"",filters:Me.map(function(){return""}),sortColumn:-1,sortDirection:"asc"},yt=document.createElement("span");yt.className="ok-table-count",yt.dataset.okTableCount="";function Bt(){let Kt=0;Fe.forEach(function(ar){const Nr=!pt.query||I0(ar.textContent).includes(pt.query),An=pt.filters.every(function(qi,Xl){return!qi||I0(L0(ar.cells[Xl]))===qi}),Mn=Nr&&An;ar.hidden=!Mn,Mn&&(Kt+=1)}),yt.textContent=Kt===Fe.length?Fke(Fe.length):Kt+" / "+Fke(Fe.length)}Me.forEach(function(Kt,ar){okt(Kt,de,Me,Fe,pt,ar)});const At=skt(Me,Fe,pt,yt,Bt);We.insertBefore(At,We.firstChild),Bt()})}function akt(q){let X=ge(q,"[data-ok-table-wrap]");if(!X){X=document.createElement("div"),X.className="ok-table-wrap",X.dataset.okTableWrap="";const te=document.createElement("div");return te.className="ok-table-scroller",q.parentNode.insertBefore(X,q),X.append(te),te.append(q),X}if(!ge(q,".ok-table-scroller")){const te=document.createElement("div");te.className="ok-table-scroller",q.parentNode.insertBefore(te,q),te.append(q)}return X}function skt(q,X,te,de,Me){const Fe=document.createElement("div");Fe.className="ok-table-tools",Fe.dataset.okTableControls="";const We=document.createElement("input");We.className="ok-table-search",We.type="search",We.placeholder="Filter table",We.setAttribute("aria-label","Filter table rows"),We.addEventListener("input",function(){te.query=I0(We.value),Me()}),Fe.append(We);const pt=document.createElement("div");pt.className="ok-table-filter-list";const yt=[];let Bt,At;function rr(){const hr=te.filters.filter(Boolean).length;Bt&&(Bt.textContent=hr?"Filters ("+hr+")":"Filters"),At&&(At.disabled=hr===0)}if(q.forEach(function(hr,Ut){const Kt=ckt(X,Ut);if(Kt.length<2||Kt.length>30)return;const ar=document.createElement("select"),Nr=L0(hr)||"Column "+(Ut+1);ar.setAttribute("aria-label","Filter by "+Nr);const An=document.createElement("option");An.value="",An.textContent=Nr+": All",ar.append(An),Kt.forEach(function(Mn){const qi=document.createElement("option");qi.value=I0(Mn),qi.textContent=Mn,ar.append(qi)}),ar.addEventListener("change",function(){te.filters[Ut]=ar.value,rr(),Me()}),yt.push(ar),pt.append(ar)}),pt.children.length){const hr=document.createElement("details");hr.className="ok-table-filter-menu";const Ut=document.createElement("summary");Ut.className="ok-table-filter-trigger",Ut.setAttribute("role","button"),Ut.setAttribute("aria-label","Table filters"),Bt=document.createElement("span"),Bt.textContent="Filters",Ut.append(Bt);const Kt=document.createElement("div");Kt.className="ok-table-filter-panel",At=document.createElement("button"),At.className="ok-table-clear",At.type="button",At.textContent="Clear filters",At.addEventListener("click",function(){te.filters=te.filters.map(function(){return""}),yt.forEach(function(ar){ar.value=""}),rr(),Me(),yt[0]&&yt[0].focus()}),Kt.append(pt,At),hr.append(Ut,Kt),hr.addEventListener("keydown",function(ar){ar.key==="Escape"&&(hr.open=!1,Ut.focus())}),Fe.append(hr),rr()}return Fe.append(de),Fe}function okt(q,X,te,de,Me,Fe){if(q.dataset.okTableSort="",q.tabIndex=0,q.setAttribute("aria-label","Sort by "+(L0(q)||"column "+(Fe+1))),!q.querySelector(".ok-table-sort-indicator")){const pt=document.createElement("span");pt.className="ok-table-sort-indicator",pt.setAttribute("aria-hidden","true"),q.append(pt)}function We(pt){pt&&ge(pt.target,"a[href], button, input, textarea, select, [contenteditable='true']")||lkt(X,te,de,Me,Fe)}q.addEventListener("click",We),q.addEventListener("keydown",function(pt){pt.key!=="Enter"&&pt.key!==" "||(pt.preventDefault(),We(pt))})}function lkt(q,X,te,de,Me){const Fe=de.sortColumn===Me&&de.sortDirection==="asc"?"desc":"asc";de.sortColumn=Me,de.sortDirection=Fe,X.forEach(function(pt){pt.removeAttribute("aria-sort"),pt.removeAttribute("data-sort-direction")}),X[Me].setAttribute("aria-sort",Fe==="asc"?"ascending":"descending"),X[Me].dataset.sortDirection=Fe;const We=Fe==="asc"?1:-1;te.sort(function(pt,yt){const Bt=Pke(L0(pt.cells[Me]),L0(yt.cells[Me]));return Bt!==0?Bt*We:Number(pt.dataset.okTableOriginalIndex||0)-Number(yt.dataset.okTableOriginalIndex||0)}),te.forEach(function(pt){q.append(pt)})}function ckt(q,X){const te=new Set,de=[];return q.forEach(function(Me){const Fe=L0(Me.cells[X]),We=I0(Fe);!We||te.has(We)||Fe.length>80||(te.add(We),de.push(Fe))}),de.sort(function(Me,Fe){return Pke(Me,Fe)})}function Pke(q,X){const te=I0(q),de=I0(X);if(!te&&de)return 1;if(te&&!de)return-1;const Me=Bke(te),Fe=Bke(de);return Me!==null&&Fe!==null&&Me!==Fe?Me-Fe:te.localeCompare(de,void 0,{numeric:!0,sensitivity:"base"})}function Bke(q){const X=String(q||"").replace(/,/g,"");return/^[+-]?\d+(?:\.\d+)?%?$/.test(X)?Number(X.replace(/%$/,"")):null}function L0(q){return String((q==null?void 0:q.textContent)||"").replace(/\s+/g," ").trim()}function I0(q){return L0({textContent:String(q||"")}).toLocaleLowerCase()}function Fke(q){return q+(q===1?" row":" rows")}function Mb(){var X;const q=Ne();q.forEach(function(te){te.querySelectorAll(".note-body a.is-active-note").forEach(function(de){de.classList.remove("is-active-note"),de.removeAttribute("aria-current")})}),q.forEach(function(te,de){var Fe;const Me=(Fe=q[de+1])==null?void 0:Fe.dataset.notePath;Me&&te.querySelectorAll(".note-body a[href]").forEach(function(We){lr(We.getAttribute("href")||We.href,te.dataset.notePath)===Me&&(We.classList.add("is-active-note"),We.setAttribute("aria-current","true"))})}),Gt(((X=ul()||q[q.length-1])==null?void 0:X.dataset.notePath)||"",!1)}function o7(q){qd(q),window.requestAnimationFrame(function(){q.scrollIntoView({block:"nearest",inline:"end",behavior:Ie()?"auto":"smooth"}),q.focus({preventScroll:!0})})}function bq(q){(q||document).querySelectorAll("mark.ok-search-highlight").forEach(function(te){const de=te.parentNode;de&&(te.replaceWith.apply(te,Array.prototype.slice.call(te.childNodes)),de.normalize())})}function Nb(q,X){bq(e);const te=String(X||"").trim(),de=q==null?void 0:q.querySelector(".note-body");!de||!te||window.requestAnimationFrame(function(){const Me=ukt(de,te);if(!Me)return;const Fe=document.createElement("mark");Fe.className="ok-search-highlight",Fe.dataset.searchHighlight="",Fe.append(Me.extractContents()),Me.insertNode(Fe),Fe.scrollIntoView({block:"center",inline:"nearest",behavior:Ie()?"auto":"smooth"}),q.focus({preventScroll:!0})})}function ukt(q,X){const te=dkt(X);if(!te)return null;const de=hkt(q),Me=de.text.indexOf(te);if(Me<0)return null;let Fe=Me,We=Me+te.length;for(;FeFe&&de.text[We-1]===" ";)We--;const pt=de.positions[Fe],yt=de.positions[We-1];if(!pt||!yt)return null;const Bt=document.createRange();return Bt.setStart(pt.node,pt.start),Bt.setEnd(yt.node,yt.end),Bt}function hkt(q){const X=document.createTreeWalker(q,NodeFilter.SHOW_TEXT),te=[],de=[];let Me=!0,Fe;for(;Fe=X.nextNode();){if(ge(Fe.parentElement,"[hidden], [aria-hidden='true']"))continue;const We=Fe.nodeValue||"";for(let pt=0;pt1&&!t.classList.contains("is-empty")}function Tq(){return C4&&Xke()}function u7(){t.classList.toggle("is-space-panning",Tq())}function kkt(q){!Yke(q)||q.defaultPrevented||q.metaKey||q.ctrlKey||q.shiftKey||q.altKey||Ckt(q.target)||Xke()&&(C4=!0,u7(),q.preventDefault())}function Ekt(q){!Yke(q)||!C4||(C4=!1,u7(),q.preventDefault())}function Skt(){C4=!1,u7()}function jke(){$b=Date.now()+350,window.setTimeout(function(){Date.now()>=$b&&($b=0)},360)}function _kt(q){return!$b||Date.now()>$b?!1:($b=0,q.preventDefault(),q.stopPropagation(),!0)}function Kke(q){return q.getBoundingClientRect().width||et(q)||kt()}function Zke(q,X){const te=ye(X,q);return!te||!q?null:(q.style.setProperty("--note-panel-width",te+"px"),q.dataset.panelWidth=String(te),q.dataset.notePath&&(D[q.dataset.notePath]=te),s7(),te)}function Akt(q,X,te){return(q==="left"?-X:X)*(te?2:1)}function Rkt(q,X,te){const de=(te.key||"").toLowerCase(),Me=Kke(q),Fe=te.shiftKey?64:24;let We=Me;if(de==="arrowleft")We+=X==="left"?Fe:-Fe;else if(de==="arrowright")We+=X==="right"?Fe:-Fe;else if(de==="home")We=oe();else if(de==="end")We=ht(q);else return;te.preventDefault(),te.stopPropagation();const pt=Zke(q,We);pt&&(X==="left"&&!ft(q)&&(t.scrollLeft+=pt-Me),xe())}function Lkt(q){const X=ge(q.target,"[data-panel-resize-handle]"),te=X==null?void 0:X.closest("[data-note-path]");if(!(!X||!te||q.button!==0)){ra={pointerId:q.pointerId,panel:te,handle:X,edge:X.dataset.panelResizeHandle==="left"?"left":"right",centered:ft(te),startX:q.clientX,startWidth:Kke(te),startScrollLeft:t.scrollLeft,moved:!1},qd(te),te.classList.add("is-panel-resizing"),document.body.classList.add("is-panel-resizing"),window.addEventListener("pointermove",Qke),window.addEventListener("pointerup",h7),window.addEventListener("pointercancel",h7),window.addEventListener("blur",eEe),q.preventDefault(),q.stopPropagation();try{X.setPointerCapture(q.pointerId)}catch{}}}function Qke(q){if(!ra||q.pointerId!==ra.pointerId)return;const X=q.clientX-ra.startX;Math.abs(X)>2&&(ra.moved=!0);const te=ra.startWidth+Akt(ra.edge,X,ra.centered),de=Zke(ra.panel,te);de&&(ra.edge==="left"&&!ra.centered&&(t.scrollLeft=ra.startScrollLeft+(de-ra.startWidth)),q.preventDefault())}function Jke(q){if(!ra)return;const X=ra.moved;ra.panel.classList.remove("is-panel-resizing");try{q!==void 0&&ra.handle.releasePointerCapture(q)}catch{}ra=null,document.body.classList.remove("is-panel-resizing"),window.removeEventListener("pointermove",Qke),window.removeEventListener("pointerup",h7),window.removeEventListener("pointercancel",h7),window.removeEventListener("blur",eEe),X&&(xe(),jke())}function h7(q){!ra||q.pointerId!==ra.pointerId||Jke(q.pointerId)}function eEe(){Jke()}function Ikt(q){return(q.pointerType||"mouse")!=="mouse"||!Hke.matches||q.button!==0||Ne().length<2||q.defaultPrevented||q.metaKey||q.ctrlKey||q.shiftKey||q.altKey?!1:Tq()?!wkt(q.target):!ge(q.target,"[data-note-path], a, button, input, textarea, select, [contenteditable='true'], [role='button']")}function Dkt(q){if(!Ikt(q))return;const X=Tq();Yl={pointerId:q.pointerId,startX:q.clientX,startScrollLeft:t.scrollLeft,moved:!1,fromSpacePan:X},t.classList.add("is-drag-scrolling"),X&&q.preventDefault();try{t.setPointerCapture(q.pointerId)}catch{}}function Mkt(q){if(!Yl||q.pointerId!==Yl.pointerId)return;const X=q.clientX-Yl.startX;Math.abs(X)<3&&!Yl.moved||(Yl.moved=!0,t.scrollLeft=Yl.startScrollLeft-X,q.preventDefault())}function tEe(q){if(!Yl||q.pointerId!==Yl.pointerId)return;const X=Yl;try{t.releasePointerCapture(q.pointerId)}catch{}(X.moved||X.fromSpacePan)&&jke(),Yl=null,t.classList.remove("is-drag-scrolling")}function Nkt(q){if(!x4()||q.button!==0)return;const X=C.getBoundingClientRect();Kc={pointerId:q.pointerId,thumbOffset:ve(q.clientX-X.left,0,X.width)},b.classList.add("is-rail-dragging"),window.addEventListener("pointermove",wq),window.addEventListener("pointerup",Ob),window.addEventListener("pointercancel",Ob),window.addEventListener("blur",nEe),vq(q.clientX,Kc.thumbOffset),q.preventDefault();try{C.setPointerCapture(q.pointerId)}catch{}}function $kt(q){if(!x4()||q.button!==0||ge(q.target,"[data-workspace-scroll-thumb]"))return;const X=C.getBoundingClientRect();vq(q.clientX,X.width/2),q.preventDefault()}function wq(q){!Kc||q.pointerId!==Kc.pointerId||(vq(q.clientX,Kc.thumbOffset),q.preventDefault())}function rEe(q){const X=q??Kc.pointerId;try{C.releasePointerCapture(X)}catch{}Kc=null,b.classList.remove("is-rail-dragging"),window.removeEventListener("pointermove",wq),window.removeEventListener("pointerup",Ob),window.removeEventListener("pointercancel",Ob),window.removeEventListener("blur",nEe)}function Ob(q){!Kc||q.pointerId!==Kc.pointerId||rEe(q.pointerId)}function nEe(){Kc&&rEe()}function Okt(q){if(!x4())return;const X=Math.max(48,t.clientWidth*.12),te=Math.max(120,t.clientWidth*.72);let de=t.scrollLeft;const Me=(q.key||"").toLowerCase();if(Me==="arrowleft")de-=X;else if(Me==="arrowright")de+=X;else if(Me==="pageup")de-=te;else if(Me==="pagedown")de+=te;else if(Me==="home")de=0;else if(Me==="end")de=b4();else return;q.preventDefault(),t.scrollLeft=ve(de,0,b4())}if(t.addEventListener("pointerdown",Dkt),t.addEventListener("pointermove",Mkt),t.addEventListener("pointerup",tEe),t.addEventListener("pointercancel",tEe),t.addEventListener("scroll",s7),window.addEventListener("keydown",kkt,!0),window.addEventListener("keyup",Ekt,!0),window.addEventListener("blur",Skt),window.addEventListener("resize",s7),w&&C&&(w.addEventListener("pointerdown",$kt),C.addEventListener("pointerdown",Nkt),C.addEventListener("pointermove",wq),C.addEventListener("pointerup",Ob),C.addEventListener("pointercancel",Ob),C.addEventListener("keydown",Okt)),t.addEventListener("click",function(q){if(_kt(q))return;const X=ge(q.target,"[data-note-path]");X&&qd(X);const te=ge(q.target,"[data-close-panel]");if(te){const yt=te.closest("[data-note-path]");if(!yt)return;q.preventDefault(),c7(yt);return}const de=ge(q.target,"[data-tree-path]"),Me=ge(q.target,"[data-graph-path]");if(de||Me){if(q.defaultPrevented||q.button!==0||q.metaKey||q.ctrlKey||q.altKey)return;q.preventDefault(),D0((de==null?void 0:de.dataset.treePath)||Me.dataset.graphPath,!0,Y(q.shiftKey),"",ul());return}const Fe=ge(q.target,"a[href]");if(!Fe||Fe.dataset.directLink==="true"||q.defaultPrevented||q.button!==0||q.metaKey||q.ctrlKey||q.altKey)return;const We=Fe.closest("[data-note-path]");if(!We)return;const pt=lr(Fe.getAttribute("href")||Fe.href,We.dataset.notePath);pt&&(q.preventDefault(),D0(pt,!0,Y(q.shiftKey),"",We))}),t.addEventListener("keydown",function(q){if(q.key!=="Enter"||!q.shiftKey||q.metaKey||q.ctrlKey||q.altKey)return;const X=ge(q.target,".note-body a[href]"),te=X==null?void 0:X.closest("[data-note-path]");if(!X||!te)return;const de=lr(X.getAttribute("href")||X.href,te.dataset.notePath);de&&(q.preventDefault(),D0(de,!0,Y(!0),"",te))}),t.addEventListener("focusin",function(q){const X=ge(q.target,"[data-note-path]");X&&qd(X)}),window.OpenKnowledgeShortcuts&&window.OpenKnowledgeShortcuts.register(Se),i){const q={id:"viewer.sidebar.toggle",code:"KeyS",metaOrCtrlKey:!0,altKey:!0,label:"⌘⌥S",ariaKeyShortcut:"Meta+Alt+S",run:Vt},X=window.OpenKnowledgeShortcuts;if(i.addEventListener("click",Vt),X){X.register(q);const te=X.format(q);i.title="File explorer ("+te+")",i.setAttribute("aria-keyshortcuts",X.ariaKeyShortcut(q)),document.querySelectorAll("[data-sidebar-shortcut]").forEach(function(de){de.textContent=te})}}a&&a.addEventListener("click",function(){Lt(!1),i==null||i.focus()}),n&&n.addEventListener("click",function(q){const X=ge(q.target,"[data-tree-path]"),te=X||ge(q.target,"a[href]");if(!te||q.defaultPrevented||q.button!==0||q.metaKey||q.ctrlKey||q.altKey)return;const de=(X==null?void 0:X.dataset.treePath)||lr(te.getAttribute("href")||te.href);de&&(q.preventDefault(),iEe(te),D0(de,!0,Y(q.shiftKey),"",ul()),k.matches&&Lt(!1))});function iEe(q){const X=ge(q,".search");if(!X)return;const te=X.querySelector(".search-input"),de=X.querySelector(".search-results"),Me=X.querySelector(".search-status");te&&(te.value=""),Me&&(Me.textContent=""),de&&(de.hidden=!0,de.replaceChildren())}window.addEventListener("popstate",function(){const q=Dke();Uke(q,Mke())}),document.addEventListener("click",function(q){const X=ge(q.target,".search-result[href]");if(X){if(q.defaultPrevented||q.button!==0||q.metaKey||q.ctrlKey||q.altKey)return;const te=lr(X.getAttribute("href")||X.href);if(te){q.preventDefault();const de=q.shiftKey||X.dataset.openBeside==="true",Me=Y(de);delete X.dataset.openBeside,u5.capture("search_result_opened"),iEe(X),D0(te,!0,Me,Nke(X.getAttribute("href")||X.href),ul());return}}ge(q.target,"[data-editor-picker]")||y4(),ge(q.target,"[data-viewer-settings]")||v4(!1)}),document.addEventListener("keydown",function(q){q.key==="Escape"&&(y4(),v4(!1),Lt(!1))});const k4=Dke(),aEe=Mke();he(),Y4t(),Ws(),Un(),Ne().forEach(Vke),yq(),k4.length!==1||k4[0]!==((sEe=Ne()[0])==null?void 0:sEe.dataset.notePath)?(window.history.replaceState({stack:k4},"",window.location.href),Uke(k4,aEe)):(window.history.replaceState({stack:k4},"",window.location.href),Db(),Mb(),A0(),Nb(ul(),aEe))})(),(()=>{const t=Array.from(document.querySelectorAll(".search"));if(t.length===0)return;const e=w(),r=document.querySelector("[data-primary-search]")||t[0],n=r==null?void 0:r.querySelector(".search-input"),i=window.OpenKnowledgeShortcuts,a={id:"viewer.search.focus",key:"k",metaOrCtrlKey:!0,label:"⌘K",allowEditable:!0,run:()=>{n==null||n.focus(),n==null||n.select()}};t.forEach(s),i?(i.register(a),document.querySelectorAll("[data-search-shortcut]").forEach(A=>{A.textContent=i.format(a)})):document.addEventListener("keydown",A=>{(A.metaKey||A.ctrlKey)&&!A.altKey&&A.key.toLowerCase()==="k"&&(A.preventDefault(),n==null||n.focus(),n==null||n.select())});function s(A){const R=A.querySelector(".search-input"),N=A.querySelector(".search-results"),M=A.querySelector(".search-status");if(!R||!N||!M)return;const D=A.dataset.searchUrl||"/api/search";let O=0,B=null,P=-1,G=0,V="";m(R,N),j(!1),A===r&&(V=o(),V&&(R.value=V,window.requestAnimationFrame(()=>{R.focus(),R.select(),W(V)}))),R.addEventListener("input",()=>{if(V="",l(),window.clearTimeout(O),J(-1,!1),!R.value.trim()){ie(!0);return}O=window.setTimeout(H,140)}),R.addEventListener("focus",()=>{if(!R.value.trim()){ie(!0);return}y(N).length>0?ae(!0):H()}),R.addEventListener("keydown",K=>{const Q=y(N);if(K.key==="ArrowDown"||K.key==="ArrowUp"){if(!Q.length)return;K.preventDefault();const re=K.key==="ArrowDown"?1:-1,le=P<0?re>0?0:Q.length-1:(P+re+Q.length)%Q.length;J(le,!0),ae(!0);return}if(K.key==="Enter"){const re=v(N,P);if(!re)return;K.preventDefault(),re.dataset.openBeside=K.shiftKey?"true":"false",re.click(),j(!0);return}K.key==="Escape"&&(!N.hidden||R.value)&&(K.preventDefault(),j(!0))}),N.addEventListener("mousemove",K=>{const Q=x(K.target);if(!Q)return;const re=y(N).indexOf(Q);re>=0&&J(re,!1)}),N.addEventListener("focusin",K=>{const Q=x(K.target);if(!Q)return;const re=y(N).indexOf(Q);re>=0&&J(re,!1)}),N.addEventListener("click",K=>{!x(K.target)||b(K)||j(!0)}),document.addEventListener("pointerdown",K=>{!N.hidden&&!A.contains(K.target)&&j(!0)}),document.addEventListener("focusin",K=>{!N.hidden&&!A.contains(K.target)&&j(!0)});async function H(){const K=R.value.trim();if(!K){ie(document.activeElement===R);return}const Q=++G;if(J(-1,!1),e.length>0){u(N,M,C(K),K,ae,J);return}B&&B.abort(),B=new AbortController,M.textContent="Searching...";try{const re=await fetch(D+"?q="+encodeURIComponent(K)+"&limit=12",{signal:B.signal});if(!re.ok)throw new Error("search request failed");const le=await re.json();if(Q!==G||R.value.trim()!==K)return;u(N,M,le.results||[],K,ae,J)}catch(re){if(re.name==="AbortError")return;M.textContent="Search failed.",J(-1,!1),ae(!1)}}async function W(K){var Ae;const Q=String(K||"").trim();if(!Q)return;const re=++G,le=((Ae=document.querySelector("[data-note-path]"))==null?void 0:Ae.dataset.notePath)||"";if(J(-1,!1),e.length>0){const Se=_(Q,le);u(N,M,Se,Q,ae,J,{emptyStatus:'No other notes tagged "'+Q+'".',keepOpenWhenEmpty:!0,statusText:Se.length+" note"+(Se.length===1?"":"s")+' tagged "'+Q+'"'});return}B&&B.abort(),B=new AbortController,M.textContent="Finding tagged notes...";const fe=new URLSearchParams({tag:Q,limit:"30"});le&&fe.set("exclude",le);try{const Se=await fetch(D+"?"+fe.toString(),{signal:B.signal});if(!Se.ok)throw new Error("tag search request failed");const Ne=await Se.json();if(re!==G||V!==Q)return;const ge=Ne.results||[];u(N,M,ge,Q,ae,J,{emptyStatus:'No other notes tagged "'+Q+'".',keepOpenWhenEmpty:!0,statusText:ge.length+" note"+(ge.length===1?"":"s")+' tagged "'+Q+'"'})}catch(Se){if(Se.name==="AbortError")return;M.textContent="Tag lookup failed.",J(-1,!1),ae(!1)}}function ie(K){G+=1,window.clearTimeout(O),B&&(B.abort(),B=null);const Q=p();M.textContent=Q.length?"Top files":"",u(N,M,Q,"",ae,J,{emptyStatus:"",keepOpenWhenEmpty:K,statusText:Q.length?"Top files":""}),ae(K&&Q.length>0)}function j(K){G+=1,window.clearTimeout(O),B&&(B.abort(),B=null),K&&(R.value="",V="",l()),M.textContent="",N.replaceChildren(),J(-1,!1),ae(!1)}function ae(K){N.hidden=!K,R.setAttribute("aria-expanded",K?"true":"false"),K||R.removeAttribute("aria-activedescendant")}function J(K,Q){const re=y(N);P=re.length?(K+re.length)%re.length:-1,re.forEach((le,fe)=>{const Ae=fe===P;le.classList.toggle("is-active",Ae),le.setAttribute("aria-selected",Ae?"true":"false"),Ae&&(R.setAttribute("aria-activedescendant",le.id),Q&&le.scrollIntoView({block:"nearest"}))}),P<0&&R.removeAttribute("aria-activedescendant")}}function o(){try{return(new URL(window.location.href).searchParams.get("ok-tag")||"").trim()}catch{return""}}function l(){let A;try{A=new URL(window.location.href)}catch{return}A.searchParams.has("ok-tag")&&(A.searchParams.delete("ok-tag"),window.history.replaceState(window.history.state,"",A))}function u(A,R,N,M,D,O,B){const P=B||{},G=h(N);if(A.replaceChildren(),G.length===0){const V=P.emptyStatus??'No results for "'+M+'".';if(R.textContent=V,V){const H=document.createElement("div");H.className="search-empty",H.textContent=V,A.append(H)}O(-1,!1),D(!!P.keepOpenWhenEmpty);return}R.textContent=P.statusText||G.length+" document"+(G.length===1?"":"s"),D(!0),G.forEach((V,H)=>{const W=document.createElement("a");W.className="search-result",W.href=V.highlightURL||V.url||$(V.path),W.id=A.id+"-option-"+H,W.setAttribute("role","option"),W.setAttribute("aria-selected","false"),W.title=d();const ie=document.createElement("span");ie.className="search-result-title-row";const j=document.createElement("span");if(j.className="search-result-title",f(j,V.title||V.path,M),ie.append(j),V.matchCount>1){const J=document.createElement("span");J.className="search-result-count",J.textContent=V.matchCount+" matches",ie.append(J)}W.append(ie);const ae=document.createElement("span");if(ae.className="search-result-meta",ae.textContent=[V.path,V.type,V.matchCount===1?V.heading:""].filter(Boolean).join(" - "),W.append(ae),V.snippet){const J=document.createElement("span");J.className="search-result-snippet",f(J,V.snippet,M),W.append(J)}if(V.headings.length>1){const J=document.createElement("span");J.className="search-result-headings",J.textContent=V.headings.slice(0,3).join(" · "),W.append(J)}A.append(W)}),O(0,!1)}function h(A){const R=[],N=new Map;return A.forEach((M,D)=>{const O=M.path||"__result-"+D;let B=N.get(O);B||(B=Object.assign({},M,{matchCount:0,headings:[]}),N.set(O,B),R.push(B)),B.matchCount+=1,M.heading&&!B.headings.includes(M.heading)&&B.headings.push(M.heading),!B.snippet&&M.snippet&&(B.snippet=M.snippet)}),R}function d(){return document.documentElement.dataset.viewerNavigationMode==="beside"?"Links open beside. Hold Shift to replace the current panel.":"Links open in the current panel. Hold Shift to open beside."}function f(A,R,N){const M=String(R||""),D=String(N||"").trim();if(!D){A.textContent=M;return}const O=M.toLocaleLowerCase(),B=D.toLocaleLowerCase();let P=0,G=O.indexOf(B);for(;G>=0;){G>P&&A.append(document.createTextNode(M.slice(P,G)));const V=document.createElement("mark");V.className="search-result-highlight",V.textContent=M.slice(G,G+D.length),A.append(V),P=G+D.length,G=O.indexOf(B,P)}P=12)break}return R.sort(function(O,B){return g(O.path)!==g(B.path)?g(O.path)?1:-1:0})}function g(A){return String(A||"").split("/").pop().toLowerCase()==="index.md"}function m(A,R){R.id||(R.id=(A.id||"viewer-search")+"-results-"+Math.random().toString(36).slice(2)),R.setAttribute("role","listbox"),A.setAttribute("role","combobox"),A.setAttribute("aria-autocomplete","list"),A.setAttribute("aria-controls",R.id),A.setAttribute("aria-expanded","false")}function y(A){return Array.from(A.querySelectorAll(".search-result[href]"))}function v(A,R){const N=y(A);return N.length?N[R>=0?R:0]||N[0]:null}function x(A){return A?A.closest?A.closest(".search-result[href]"):A.parentElement?A.parentElement.closest(".search-result[href]"):null:null}function b(A){return A.button!==0||A.metaKey||A.ctrlKey||A.shiftKey||A.altKey}function w(){var N;const A=(N=window.OpenKnowledgeStaticData)==null?void 0:N.notes;if(Array.isArray(A))return A;const R=document.querySelector("[data-static-notes]");if(!R)return[];try{const M=JSON.parse(R.textContent||"[]");return Array.isArray(M)?M:[]}catch{return[]}}function C(A){const R=k(A);return e.map(function(N){const M=S(N.body||""),D=S(N.frontmatter||""),O=N.title||N.path||"",B=N.path||"",P=[D,M].filter(Boolean).join(" "),G=k([O,B,P].join(" ")),V=k(O).includes(R),H=k(B).includes(R);if(!G.includes(R))return null;const ie=(V?3:0)+(H?2:0)+1;return{path:B,title:O,snippet:L(P,A),score:g(B)?ie*.55:ie}}).filter(Boolean).sort(function(N,M){return M.score!==N.score?M.score-N.score:g(N.path)!==g(M.path)?g(N.path)?1:-1:N.path.localeCompare(M.path)}).slice(0,12)}function _(A,R){const N=k(A).trim();return e.filter(function(M){return M.path!==R&&Array.isArray(M.tags)&&M.tags.some(function(D){return k(D).trim()===N})}).map(function(M){return{path:M.path,title:M.title||M.path,url:$(M.path),type:"tagged note"}}).sort(function(M,D){return M.path.localeCompare(D.path)})}function k(A){return String(A||"").toLowerCase()}function S(A){const R=document.createElement("div");return R.innerHTML=A,R.textContent||""}function L(A,R){const N=String(A||"").replace(/\s+/g," ").trim();if(!N)return"";const M=N.toLowerCase().indexOf(String(R||"").toLowerCase()),D=Math.max(0,M<0?0:M-48),O=Math.min(N.length,D+140);return(D>0?"...":"")+N.slice(D,O)+(O15?u="…"+o.slice(i-15,i):u=o.slice(0,i);var h;a+15t.replace(xPe,"-$1").toLowerCase(),wPe={"&":"&",">":">","<":"<",'"':""","'":"'"},CPe=/[&><"']/g,is=t=>String(t).replace(CPe,e=>wPe[e]),h5=t=>t.type==="ordgroup"||t.type==="color"?t.body.length===1?h5(t.body[0]):t:t.type==="font"?h5(t.body):t,kPe=new Set(["mathord","textord","atom"]),ku=t=>kPe.has(h5(t).type),EPe=t=>{var e=/^[\x00-\x20]*([^\\/#?]*?)(:|�*58|�*3a|&colon)/i.exec(t);return e?e[2]!==":"||!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(e[1])?null:e[1].toLowerCase():"_relative"},d5={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 "},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 ",cliDescription:"A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.",cliProcessor:t=>"#"+t},macros:{type:"object",cli:"-m, --macro ",cliDescription:"Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).",cliDefault:[],cliProcessor:(t,e)=>(e.push(t),e)},minRuleThickness:{type:"number",description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:t=>Math.max(0,t),cli:"--min-rule-thickness ",cliProcessor:parseFloat},colorIsTextColor:{type:"boolean",description:"Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.",cli:"-b, --color-is-text-color"},strict:{type:[{enum:["warn","ignore","error"]},"boolean","function"],description:"Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.",cli:"-S, --strict",cliDefault:!1},trust:{type:["boolean","function"],description:"Trust the input, enabling all HTML features such as \\url.",cli:"-T, --trust"},maxSize:{type:"number",default:1/0,description:"If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large",processor:t=>Math.max(0,t),cli:"-s, --max-size ",cliProcessor:parseInt},maxExpand:{type:"number",default:1e3,description:"Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.",processor:t=>Math.max(0,t),cli:"-e, --max-expand ",cliProcessor:t=>t==="Infinity"?1/0:parseInt(t)},globalGroup:{type:"boolean",cli:!1}};function SPe(t){if(typeof t!="string")return t.enum[0];switch(t){case"boolean":return!1;case"string":return"";case"number":return 0;case"object":return{};default:throw new Error("Unexpected schema type; settings must declare an explicit default.")}}function _Pe(t){if(t.default!==void 0)return t.default;var e=Array.isArray(t.type)?t.type[0]:t.type;return SPe(e)}function APe(t,e,r,n){var i=r[e];t[e]=i!==void 0?n.processor?n.processor(i):i:_Pe(n)}class BI{constructor(e){e===void 0&&(e={}),this.displayMode=void 0,this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,this.globalGroup=void 0,e=e||{};for(var r of Object.keys(d5)){var n=d5[r];n&&APe(this,r,e,n)}}reportNonstrict(e,r,n){var i=this.strict;if(typeof i=="function"&&(i=i(e,r,n)),!(!i||i==="ignore")){if(i===!0||i==="error")throw new $t("LaTeX-incompatible input and strict mode is set to 'error': "+(r+" ["+e+"]"),n);i==="warn"?typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(r+" ["+e+"]")):typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+i+"': "+r+" ["+e+"]"))}}useStrictBehavior(e,r,n){var i=this.strict;if(typeof i=="function")try{i=i(e,r,n)}catch{i="error"}return!i||i==="ignore"?!1:i===!0||i==="error"?!0:i==="warn"?(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(r+" ["+e+"]")),!1):(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+i+"': "+r+" ["+e+"]")),!1)}isTrusted(e){if("url"in e&&e.url&&!e.protocol){var r=EPe(e.url);if(r==null)return!1;e.protocol=r}var n=typeof this.trust=="function"?this.trust(e):this.trust;return!!n}}class Bh{constructor(e,r,n){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=e,this.size=r,this.cramped=n}sup(){return uc[RPe[this.id]]}sub(){return uc[LPe[this.id]]}fracNum(){return uc[IPe[this.id]]}fracDen(){return uc[DPe[this.id]]}cramp(){return uc[MPe[this.id]]}text(){return uc[NPe[this.id]]}isTight(){return this.size>=2}}var FI=0,f5=1,$g=2,Eu=3,mT=4,Yo=5,Og=6,Ts=7,uc=[new Bh(FI,0,!1),new Bh(f5,0,!0),new Bh($g,1,!1),new Bh(Eu,1,!0),new Bh(mT,2,!1),new Bh(Yo,2,!0),new Bh(Og,3,!1),new Bh(Ts,3,!0)],RPe=[mT,Yo,mT,Yo,Og,Ts,Og,Ts],LPe=[Yo,Yo,Yo,Yo,Ts,Ts,Ts,Ts],IPe=[$g,Eu,mT,Yo,Og,Ts,Og,Ts],DPe=[Eu,Eu,Yo,Yo,Ts,Ts,Ts,Ts],MPe=[f5,f5,Eu,Eu,Yo,Yo,Ts,Ts],NPe=[FI,f5,$g,Eu,$g,Eu,$g,Eu],Fr={DISPLAY:uc[FI],TEXT:uc[$g],SCRIPT:uc[mT],SCRIPTSCRIPT:uc[Og]},zI=[{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 $Pe(t){for(var e=0;e=i[0]&&t<=i[1])return r.name}return null}var p5=[];zI.forEach(t=>t.blocks.forEach(e=>p5.push(...e)));function Cee(t){for(var e=0;e=p5[e]&&t<=p5[e+1])return!0;return!1}var sa=t=>t+" "+t,Pg=80,OPe=function(e,r){return"M95,"+(622+e+r)+` c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14 c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54 c44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10 @@ -316,7 +317,7 @@ c5.3,-9.3,12,-14,20,-14 H400000v`+(40+e)+`H845.2724 s-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7 c-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z -M`+(834+e)+" "+r+"h400000v"+(40+e)+"h-400000z"},Z8e=function(e,r){return"M263,"+(601+e+r)+`c0.7,0,18,39.7,52,119 +M`+(834+e)+" "+r+"h400000v"+(40+e)+"h-400000z"},PPe=function(e,r){return"M263,"+(601+e+r)+`c0.7,0,18,39.7,52,119 c34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120 c340,-704.7,510.7,-1060.3,512,-1067 l`+e/2.084+" -"+e+` @@ -326,7 +327,7 @@ s-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5, c-22.3,46.7,-33.8,70.3,-34.5,71c-4.7,4.7,-12.3,7,-23,7s-12,-1,-12,-1 s-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26 c-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z -M`+(1001+e)+" "+r+"h400000v"+(40+e)+"h-400000z"},Q8e=function(e,r){return"M983 "+(10+e+r)+` +M`+(1001+e)+" "+r+"h400000v"+(40+e)+"h-400000z"},BPe=function(e,r){return"M983 "+(10+e+r)+` l`+e/3.13+" -"+e+` c4,-6.7,10,-10,18,-10 H400000v`+(40+e)+` H1013.1s-83.4,268,-264.1,840c-180.7,572,-277,876.3,-289,913c-4.7,4.7,-12.7,7,-24,7 @@ -335,7 +336,7 @@ c-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30 c26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722 c56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5 c53.7,-170.3,84.5,-266.8,92.5,-289.5z -M`+(1001+e)+" "+r+"h400000v"+(40+e)+"h-400000z"},J8e=function(e,r){return"M424,"+(2398+e+r)+` +M`+(1001+e)+" "+r+"h400000v"+(40+e)+"h-400000z"},FPe=function(e,r){return"M424,"+(2398+e+r)+` c-1.3,-0.7,-38.5,-172,-111.5,-514c-73,-342,-109.8,-513.3,-110.5,-514 c0,-2,-10.7,14.3,-32,49c-4.7,7.3,-9.8,15.7,-15.5,25c-5.7,9.3,-9.8,16,-12.5,20 s-5,7,-5,7c-4,-3.3,-8.3,-7.7,-13,-13s-13,-13,-13,-13s76,-122,76,-122s77,-121,77,-121 @@ -345,18 +346,18 @@ v`+(40+e)+`H1014.6 s-87.3,378.7,-272.6,1166c-185.3,787.3,-279.3,1182.3,-282,1185 c-2,6,-10,9,-24,9 c-8,0,-12,-0.7,-12,-2z M`+(1001+e)+" "+r+` -h400000v`+(40+e)+"h-400000z"},eRe=function(e,r){return"M473,"+(2713+e+r)+` +h400000v`+(40+e)+"h-400000z"},zPe=function(e,r){return"M473,"+(2713+e+r)+` c339.3,-1799.3,509.3,-2700,510,-2702 l`+e/5.298+" -"+e+` c3.3,-7.3,9.3,-11,18,-11 H400000v`+(40+e)+`H1017.7 s-90.5,478,-276.2,1466c-185.7,988,-279.5,1483,-281.5,1485c-2,6,-10,9,-24,9 c-8,0,-12,-0.7,-12,-2c0,-1.3,-5.3,-32,-16,-92c-50.7,-293.3,-119.7,-693.3,-207,-1200 c0,-1.3,-5.3,8.7,-16,30c-10.7,21.3,-21.3,42.7,-32,64s-16,33,-16,33s-26,-26,-26,-26 s76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104, -606zM`+(1001+e)+" "+r+"h400000v"+(40+e)+"H1017.7z"},tRe=function(e){var r=e/2;return"M400000 "+e+" H0 L"+r+" 0 l65 45 L145 "+(e-80)+" H400000z"},rRe=function(e,r,n){var i=n-54-r-e;return"M702 "+(e+r)+"H400000"+(40+e)+` +606zM`+(1001+e)+" "+r+"h400000v"+(40+e)+"H1017.7z"},GPe=function(e){var r=e/2;return"M400000 "+e+" H0 L"+r+" 0 l65 45 L145 "+(e-80)+" H400000z"},qPe=function(e,r,n){var i=n-54-r-e;return"M702 "+(e+r)+"H400000"+(40+e)+` H742v`+i+`l-4 4-4 4c-.667.7 -2 1.5-4 2.5s-4.167 1.833-6.5 2.5-5.5 1-9.5 1 h-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170 c-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667 -219 661 l218 661zM702 `+r+"H400000v"+(40+e)+"H742z"},nRe=function(e,r,n){r=1e3*r;var i="";switch(e){case"sqrtMain":i=j8e(r,ip);break;case"sqrtSize1":i=Z8e(r,ip);break;case"sqrtSize2":i=Q8e(r,ip);break;case"sqrtSize3":i=J8e(r,ip);break;case"sqrtSize4":i=eRe(r,ip);break;case"sqrtTall":i=rRe(r,ip,n)}return i},iRe=function(e,r){switch(e){case"⎜":return Pi("M291 0 H417 V"+r+" H291z");case"∣":return Pi("M145 0 H188 V"+r+" H145z");case"∥":return Pi("M145 0 H188 V"+r+" H145z")+Pi("M367 0 H410 V"+r+" H367z");case"⎟":return Pi("M457 0 H583 V"+r+" H457z");case"⎢":return Pi("M319 0 H403 V"+r+" H319z");case"⎥":return Pi("M263 0 H347 V"+r+" H263z");case"⎪":return Pi("M384 0 H504 V"+r+" H384z");case"⏐":return Pi("M312 0 H355 V"+r+" H312z");case"‖":return Pi("M257 0 H300 V"+r+" H257z")+Pi("M478 0 H521 V"+r+" H478z");default:return""}},oY={doubleleftarrow:`M262 157 +219 661 l218 661zM702 `+r+"H400000v"+(40+e)+"H742z"},VPe=function(e,r,n){r=1e3*r;var i="";switch(e){case"sqrtMain":i=OPe(r,Pg);break;case"sqrtSize1":i=PPe(r,Pg);break;case"sqrtSize2":i=BPe(r,Pg);break;case"sqrtSize3":i=FPe(r,Pg);break;case"sqrtSize4":i=zPe(r,Pg);break;case"sqrtTall":i=qPe(r,Pg,n)}return i},WPe=function(e,r){switch(e){case"⎜":return sa("M291 0 H417 V"+r+" H291z");case"∣":return sa("M145 0 H188 V"+r+" H145z");case"∥":return sa("M145 0 H188 V"+r+" H145z")+sa("M367 0 H410 V"+r+" H367z");case"⎟":return sa("M457 0 H583 V"+r+" H457z");case"⎢":return sa("M319 0 H403 V"+r+" H319z");case"⎥":return sa("M263 0 H347 V"+r+" H263z");case"⎪":return sa("M384 0 H504 V"+r+" H384z");case"⏐":return sa("M312 0 H355 V"+r+" H312z");case"‖":return sa("M257 0 H300 V"+r+" H257z")+sa("M478 0 H521 V"+r+" H478z");default:return""}},kee={doubleleftarrow:`M262 157 l10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.3 0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-28 14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.5 @@ -402,10 +403,10 @@ m0 0v40h400000v-40z`,leftharpoondown:`M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 v40h399900v-40zM0 241v40h399900v-40zm0 0v40h399900v-40z`,lefthook:`M400000 281 H103s-33-11.2-61-33.5S0 197.3 0 164s14.2-61.2 42.5 -83.5C70.8 58.2 104 47 142 47 c16.7 0 25 6.7 25 20 0 12-8.7 18.7-26 20-40 3.3 -68.7 15.7-86 37-10 12-15 25.3-15 40 0 22.7 9.8 40.7 29.5 54 19.7 13.3 43.5 21 - 71.5 23h399859zM103 281v-40h399897v40z`,leftlinesegment:Pi("M40 281 V428 H0 V94 H40 V241 H400000 v40z"),leftbracketunder:Pi("M0 0 h120 V290 H399995 v120 H0z"),leftbracketover:Pi("M0 440 h120 V150 H399995 v-120 H0z"),leftmapsto:Pi("M40 281 V448H0V74H40V241H400000v40z"),leftToFrom:`M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23 + 71.5 23h399859zM103 281v-40h399897v40z`,leftlinesegment:sa("M40 281 V428 H0 V94 H40 V241 H400000 v40z"),leftbracketunder:sa("M0 0 h120 V290 H399995 v120 H0z"),leftbracketover:sa("M0 440 h120 V150 H399995 v-120 H0z"),leftmapsto:sa("M40 281 V448H0V74H40V241H400000v40z"),leftToFrom:`M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23 -.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69-70-101l-7-8h399905v-40H95l7-8 c28.7-32 52-65.7 70-101 10.7-23.3 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 265.3 - 68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z`,longequal:Pi("M0 50 h400000 v40H0z m0 194h40000v40H0z"),midbrace:`M200428 334 + 68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z`,longequal:sa("M0 50 h400000 v40H0z m0 194h40000v40H0z"),midbrace:`M200428 334 c-100.7-8.3-195.3-44-280-108-55.3-42-101.7-93-139-153l-9-14c-2.7 4-5.7 8.7-9 14 -53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7 311.7-78.3 403-201 6-8 9.7-12 11-12 .7-.7 6.7-1 18-1s17.3.3 18 1c1.3 0 5 4 11 @@ -454,7 +455,7 @@ m0 0v40h399900v-40z m100 194v40h399900v-40zm0 0v40h399900v-40z`,rightharpoondown m0-194v40h400000v-40zm0 0v40h400000v-40z`,righthook:`M399859 241c-764 0 0 0 0 0 40-3.3 68.7-15.7 86-37 10-12 15-25.3 15-40 0-22.7-9.8-40.7-29.5-54-19.7-13.3-43.5-21-71.5-23-17.3-1.3-26-8-26-20 0 -13.3 8.7-20 26-20 38 0 71 11.2 99 33.5 0 0 7 5.6 21 16.7 14 11.2 21 33.5 21 - 66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z`,rightlinesegment:Pi("M399960 241 V94 h40 V428 h-40 V281 H0 v-40z"),rightbracketunder:Pi("M399995 0 h-120 V290 H0 v120 H400000z"),rightbracketover:Pi("M399995 440 h-120 V150 H0 v-120 H399995z"),rightToFrom:`M400000 167c-70.7-42-118-97.7-142-167h-23c-15.3 0-23 .3-23 + 66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z`,rightlinesegment:sa("M399960 241 V94 h40 V428 h-40 V281 H0 v-40z"),rightbracketunder:sa("M399995 0 h-120 V290 H0 v120 H400000z"),rightbracketover:sa("M399995 440 h-120 V150 H0 v-120 H399995z"),rightToFrom:`M400000 167c-70.7-42-118-97.7-142-167h-23c-15.3 0-23 .3-23 1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32 -52 65.7-70 101-10.7 23.3-16 35.7-16 37 0 .7 7.7 1 23 1h23c24-69.3 71.3-125 142 -167z M100 147v40h399900v-40zM0 341v40h399900v-40z`,twoheadleftarrow:`M0 167c68 40 @@ -527,7 +528,7 @@ M93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z` c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199, -231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6 c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z -M500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z`},aRe=function(e,r){switch(e){case"lbrack":return"M403 1759 V84 H666 V0 H319 V1759 v"+r+` v1759 v84 h347 v-84 +M500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z`},UPe=function(e,r){switch(e){case"lbrack":return"M403 1759 V84 H666 V0 H319 V1759 v"+r+` v1759 v84 h347 v-84 H403z M403 1759 V0 H319 V1759 v`+r+" v1759 v84 h84z";case"rbrack":return"M347 1759 V0 H0 V84 H263 V1759 v"+r+` v1759 H0 v84 H347z M347 1759 V0 H263 V1759 v`+r+" v1759 h84z";case"vert":return"M145 15 v585 v"+r+` v585 c2.667,10,9.667,15,21,15 c10,0,16.667,-5,20,-15 v-585 v`+-r+` v-585 c-2.667,-10,-9.667,-15,-21,-15 @@ -555,48 +556,48 @@ c-55.7,194.7,-131.8,370.3,-228.5,527c-20.7,34.7,-41.7,66.3,-63,95c-2,3.3,-4,7,-6 c0,7.3,5.7,11,17,11c0,0,11,0,11,0c9.3,0,14.3,-0.3,15,-1c5.3,-5.3,10.3,-11,15,-17 c242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558 l0,-`+(r+144)+`c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7, --470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z`;default:throw new Error("Unknown stretchy delimiter.")}};function sRe(t){return"toText"in t}class ap{constructor(e){this.children=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.children=e,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(e){return this.classes.includes(e)}toNode(){for(var e=document.createDocumentFragment(),r=0;r{if(sRe(e))return e.toText();throw new Error("Expected MathDomNode with toText, got "+e.constructor.name)}).join("")}}var d7={pt:1,mm:7227/2540,cm:7227/254,in:72.27,bp:803/800,pc:12,dd:1238/1157,cc:14856/1157,nd:685/642,nc:1370/107,sp:1/65536,px:803/800},oRe={ex:!0,em:!0,mu:!0},lY=function(e){return typeof e!="string"&&(e=e.unit),e in d7||e in oRe||e==="ex"},Xn=function(e,r){var n;if(e.unit in d7)n=d7[e.unit]/r.fontMetrics().ptPerEm/r.sizeMultiplier;else if(e.unit==="mu")n=r.fontMetrics().cssEmPerMu;else{var i;if(r.style.isTight()?i=r.havingStyle(r.style.text()):i=r,e.unit==="ex")n=i.fontMetrics().xHeight;else if(e.unit==="em")n=i.fontMetrics().quad;else throw new Dt("Invalid unit: '"+e.unit+"'");i!==r&&(n*=i.sizeMultiplier/r.sizeMultiplier)}return Math.min(e.number*n,r.maxSize)},$t=function(e){return+e.toFixed(4)+"em"},Pu=function(e){return e.filter(r=>r).join(" ")},f7=function(e){var r="";for(var n of Object.keys(e)){var i=e[n];i!==void 0&&(r+=O8e(n)+":"+i+";")}return r},cY=function(e,r,n){if(this.classes=e||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=n||{},r){r.style.isTight()&&this.classes.push("mtight");var i=r.getColor();i&&(this.style.color=i)}},uY=function(e){var r=document.createElement(e);r.className=Pu(this.classes),Object.assign(r.style,this.style);for(var n of Object.keys(this.attributes))r.setAttribute(n,this.attributes[n]);for(var i=0;i/=\x00-\x1f]/,hY=function(e){var r="<"+e;this.classes.length&&(r+=' class="'+Ia(Pu(this.classes))+'"');var n=f7(this.style);n&&(r+=' style="'+Ia(n)+'"');for(var i of Object.keys(this.attributes)){if(lRe.test(i))throw new Dt("Invalid attribute name '"+i+"'");r+=" "+i+'="'+Ia(this.attributes[i])+'"'}r+=">";for(var a=0;a",r};class sp{constructor(e,r,n,i){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.width=void 0,this.maxFontSize=void 0,this.style=void 0,this.italic=void 0,cY.call(this,e,n,i),this.children=r||[]}setAttribute(e,r){this.attributes[e]=r}hasClass(e){return this.classes.includes(e)}toNode(){return uY.call(this,"span")}toMarkup(){return hY.call(this,"span")}}let mC=class{constructor(e,r,n,i){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,cY.call(this,r,i),this.children=n||[],this.setAttribute("href",e)}setAttribute(e,r){this.attributes[e]=r}hasClass(e){return this.classes.includes(e)}toNode(){return uY.call(this,"a")}toMarkup(){return hY.call(this,"a")}};class cRe{constructor(e,r,n){this.src=void 0,this.alt=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.alt=r,this.src=e,this.classes=["mord"],this.height=0,this.depth=0,this.maxFontSize=0,this.style=n}hasClass(e){return this.classes.includes(e)}toNode(){var e=document.createElement("img");return e.src=this.src,e.alt=this.alt,e.className="mord",Object.assign(e.style,this.style),e}toMarkup(){var e=''+Ia(this.alt)+'0&&(r=document.createElement("span"),r.style.marginRight=$t(this.italic)),this.classes.length>0&&(r=r||document.createElement("span"),r.className=Pu(this.classes)),Object.keys(this.style).length>0&&(r=r||document.createElement("span"),Object.assign(r.style,this.style)),r?(r.appendChild(e),r):e}toMarkup(){var e=!1,r="0&&(n+="margin-right:"+$t(this.italic)+";"),n+=f7(this.style),n&&(e=!0,r+=' style="'+Ia(n)+'"');var i=Ia(this.text);return e?(r+=">",r+=i,r+="",r):i}}class Ac{constructor(e,r){this.children=void 0,this.attributes=void 0,this.children=e||[],this.attributes=r||{}}toNode(){var e="http://www.w3.org/2000/svg",r=document.createElementNS(e,"svg");for(var n of Object.keys(this.attributes))r.setAttribute(n,this.attributes[n]);for(var i=0;i':''}}class p7{constructor(e){this.attributes=void 0,this.attributes=e||{}}toNode(){var e="http://www.w3.org/2000/svg",r=document.createElementNS(e,"line");for(var n of Object.keys(this.attributes))r.setAttribute(n,this.attributes[n]);return r}toMarkup(){var e=" but got "+String(t)+".")}var fRe=t=>t instanceof sp||t instanceof mC||t instanceof ap,wl={"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]}},yC={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]},dY={Å:"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 fY(t,e){wl[t]=e}function g7(t,e,r){if(!wl[e])throw new Error("Font metrics not found for font: "+e+".");var n=t.charCodeAt(0),i=wl[e][n];if(!i&&t[0]in dY&&(n=dY[t[0]].charCodeAt(0),i=wl[e][n]),!i&&r==="text"&&sY(n)&&(i=wl[e][77]),i)return{depth:i[0],height:i[1],italic:i[2],skew:i[3],width:i[4]}}var m7={};function pRe(t){var e;if(t>=5?e=0:t>=3?e=1:e=2,!m7[e]){var r=m7[e]={cssEmPerMu:yC.quad[e]/18};for(var n in yC)yC.hasOwnProperty(n)&&(r[n]=yC[n][e])}return m7[e]}var Wn={math:{},text:{}};function U(t,e,r,n,i,a){Wn[t][i]={font:e,group:r,replace:n},a&&n&&(Wn[t][n]=Wn[t][i])}var Q="math",kt="text",ce="main",$e="ams",Un="accent-token",Yt="bin",Ha="close",op="inner",mr="mathord",ki="op-token",Gs="open",ub="punct",ze="rel",_c="spacing",He="textord";U(Q,ce,ze,"≡","\\equiv",!0),U(Q,ce,ze,"≺","\\prec",!0),U(Q,ce,ze,"≻","\\succ",!0),U(Q,ce,ze,"∼","\\sim",!0),U(Q,ce,ze,"⊥","\\perp"),U(Q,ce,ze,"⪯","\\preceq",!0),U(Q,ce,ze,"⪰","\\succeq",!0),U(Q,ce,ze,"≃","\\simeq",!0),U(Q,ce,ze,"∣","\\mid",!0),U(Q,ce,ze,"≪","\\ll",!0),U(Q,ce,ze,"≫","\\gg",!0),U(Q,ce,ze,"≍","\\asymp",!0),U(Q,ce,ze,"∥","\\parallel"),U(Q,ce,ze,"⋈","\\bowtie",!0),U(Q,ce,ze,"⌣","\\smile",!0),U(Q,ce,ze,"⊑","\\sqsubseteq",!0),U(Q,ce,ze,"⊒","\\sqsupseteq",!0),U(Q,ce,ze,"≐","\\doteq",!0),U(Q,ce,ze,"⌢","\\frown",!0),U(Q,ce,ze,"∋","\\ni",!0),U(Q,ce,ze,"∝","\\propto",!0),U(Q,ce,ze,"⊢","\\vdash",!0),U(Q,ce,ze,"⊣","\\dashv",!0),U(Q,ce,ze,"∋","\\owns"),U(Q,ce,ub,".","\\ldotp"),U(Q,ce,ub,"⋅","\\cdotp"),U(Q,ce,ub,"⋅","·"),U(kt,ce,He,"⋅","·"),U(Q,ce,He,"#","\\#"),U(kt,ce,He,"#","\\#"),U(Q,ce,He,"&","\\&"),U(kt,ce,He,"&","\\&"),U(Q,ce,He,"ℵ","\\aleph",!0),U(Q,ce,He,"∀","\\forall",!0),U(Q,ce,He,"ℏ","\\hbar",!0),U(Q,ce,He,"∃","\\exists",!0),U(Q,ce,He,"∇","\\nabla",!0),U(Q,ce,He,"♭","\\flat",!0),U(Q,ce,He,"ℓ","\\ell",!0),U(Q,ce,He,"♮","\\natural",!0),U(Q,ce,He,"♣","\\clubsuit",!0),U(Q,ce,He,"℘","\\wp",!0),U(Q,ce,He,"♯","\\sharp",!0),U(Q,ce,He,"♢","\\diamondsuit",!0),U(Q,ce,He,"ℜ","\\Re",!0),U(Q,ce,He,"♡","\\heartsuit",!0),U(Q,ce,He,"ℑ","\\Im",!0),U(Q,ce,He,"♠","\\spadesuit",!0),U(Q,ce,He,"§","\\S",!0),U(kt,ce,He,"§","\\S"),U(Q,ce,He,"¶","\\P",!0),U(kt,ce,He,"¶","\\P"),U(Q,ce,He,"†","\\dag"),U(kt,ce,He,"†","\\dag"),U(kt,ce,He,"†","\\textdagger"),U(Q,ce,He,"‡","\\ddag"),U(kt,ce,He,"‡","\\ddag"),U(kt,ce,He,"‡","\\textdaggerdbl"),U(Q,ce,Ha,"⎱","\\rmoustache",!0),U(Q,ce,Gs,"⎰","\\lmoustache",!0),U(Q,ce,Ha,"⟯","\\rgroup",!0),U(Q,ce,Gs,"⟮","\\lgroup",!0),U(Q,ce,Yt,"∓","\\mp",!0),U(Q,ce,Yt,"⊖","\\ominus",!0),U(Q,ce,Yt,"⊎","\\uplus",!0),U(Q,ce,Yt,"⊓","\\sqcap",!0),U(Q,ce,Yt,"∗","\\ast"),U(Q,ce,Yt,"⊔","\\sqcup",!0),U(Q,ce,Yt,"◯","\\bigcirc",!0),U(Q,ce,Yt,"∙","\\bullet",!0),U(Q,ce,Yt,"‡","\\ddagger"),U(Q,ce,Yt,"≀","\\wr",!0),U(Q,ce,Yt,"⨿","\\amalg"),U(Q,ce,Yt,"&","\\And"),U(Q,ce,ze,"⟵","\\longleftarrow",!0),U(Q,ce,ze,"⇐","\\Leftarrow",!0),U(Q,ce,ze,"⟸","\\Longleftarrow",!0),U(Q,ce,ze,"⟶","\\longrightarrow",!0),U(Q,ce,ze,"⇒","\\Rightarrow",!0),U(Q,ce,ze,"⟹","\\Longrightarrow",!0),U(Q,ce,ze,"↔","\\leftrightarrow",!0),U(Q,ce,ze,"⟷","\\longleftrightarrow",!0),U(Q,ce,ze,"⇔","\\Leftrightarrow",!0),U(Q,ce,ze,"⟺","\\Longleftrightarrow",!0),U(Q,ce,ze,"↦","\\mapsto",!0),U(Q,ce,ze,"⟼","\\longmapsto",!0),U(Q,ce,ze,"↗","\\nearrow",!0),U(Q,ce,ze,"↩","\\hookleftarrow",!0),U(Q,ce,ze,"↪","\\hookrightarrow",!0),U(Q,ce,ze,"↘","\\searrow",!0),U(Q,ce,ze,"↼","\\leftharpoonup",!0),U(Q,ce,ze,"⇀","\\rightharpoonup",!0),U(Q,ce,ze,"↙","\\swarrow",!0),U(Q,ce,ze,"↽","\\leftharpoondown",!0),U(Q,ce,ze,"⇁","\\rightharpoondown",!0),U(Q,ce,ze,"↖","\\nwarrow",!0),U(Q,ce,ze,"⇌","\\rightleftharpoons",!0),U(Q,$e,ze,"≮","\\nless",!0),U(Q,$e,ze,"","\\@nleqslant"),U(Q,$e,ze,"","\\@nleqq"),U(Q,$e,ze,"⪇","\\lneq",!0),U(Q,$e,ze,"≨","\\lneqq",!0),U(Q,$e,ze,"","\\@lvertneqq"),U(Q,$e,ze,"⋦","\\lnsim",!0),U(Q,$e,ze,"⪉","\\lnapprox",!0),U(Q,$e,ze,"⊀","\\nprec",!0),U(Q,$e,ze,"⋠","\\npreceq",!0),U(Q,$e,ze,"⋨","\\precnsim",!0),U(Q,$e,ze,"⪹","\\precnapprox",!0),U(Q,$e,ze,"≁","\\nsim",!0),U(Q,$e,ze,"","\\@nshortmid"),U(Q,$e,ze,"∤","\\nmid",!0),U(Q,$e,ze,"⊬","\\nvdash",!0),U(Q,$e,ze,"⊭","\\nvDash",!0),U(Q,$e,ze,"⋪","\\ntriangleleft"),U(Q,$e,ze,"⋬","\\ntrianglelefteq",!0),U(Q,$e,ze,"⊊","\\subsetneq",!0),U(Q,$e,ze,"","\\@varsubsetneq"),U(Q,$e,ze,"⫋","\\subsetneqq",!0),U(Q,$e,ze,"","\\@varsubsetneqq"),U(Q,$e,ze,"≯","\\ngtr",!0),U(Q,$e,ze,"","\\@ngeqslant"),U(Q,$e,ze,"","\\@ngeqq"),U(Q,$e,ze,"⪈","\\gneq",!0),U(Q,$e,ze,"≩","\\gneqq",!0),U(Q,$e,ze,"","\\@gvertneqq"),U(Q,$e,ze,"⋧","\\gnsim",!0),U(Q,$e,ze,"⪊","\\gnapprox",!0),U(Q,$e,ze,"⊁","\\nsucc",!0),U(Q,$e,ze,"⋡","\\nsucceq",!0),U(Q,$e,ze,"⋩","\\succnsim",!0),U(Q,$e,ze,"⪺","\\succnapprox",!0),U(Q,$e,ze,"≆","\\ncong",!0),U(Q,$e,ze,"","\\@nshortparallel"),U(Q,$e,ze,"∦","\\nparallel",!0),U(Q,$e,ze,"⊯","\\nVDash",!0),U(Q,$e,ze,"⋫","\\ntriangleright"),U(Q,$e,ze,"⋭","\\ntrianglerighteq",!0),U(Q,$e,ze,"","\\@nsupseteqq"),U(Q,$e,ze,"⊋","\\supsetneq",!0),U(Q,$e,ze,"","\\@varsupsetneq"),U(Q,$e,ze,"⫌","\\supsetneqq",!0),U(Q,$e,ze,"","\\@varsupsetneqq"),U(Q,$e,ze,"⊮","\\nVdash",!0),U(Q,$e,ze,"⪵","\\precneqq",!0),U(Q,$e,ze,"⪶","\\succneqq",!0),U(Q,$e,ze,"","\\@nsubseteqq"),U(Q,$e,Yt,"⊴","\\unlhd"),U(Q,$e,Yt,"⊵","\\unrhd"),U(Q,$e,ze,"↚","\\nleftarrow",!0),U(Q,$e,ze,"↛","\\nrightarrow",!0),U(Q,$e,ze,"⇍","\\nLeftarrow",!0),U(Q,$e,ze,"⇏","\\nRightarrow",!0),U(Q,$e,ze,"↮","\\nleftrightarrow",!0),U(Q,$e,ze,"⇎","\\nLeftrightarrow",!0),U(Q,$e,ze,"△","\\vartriangle"),U(Q,$e,He,"ℏ","\\hslash"),U(Q,$e,He,"▽","\\triangledown"),U(Q,$e,He,"◊","\\lozenge"),U(Q,$e,He,"Ⓢ","\\circledS"),U(Q,$e,He,"®","\\circledR"),U(kt,$e,He,"®","\\circledR"),U(Q,$e,He,"∡","\\measuredangle",!0),U(Q,$e,He,"∄","\\nexists"),U(Q,$e,He,"℧","\\mho"),U(Q,$e,He,"Ⅎ","\\Finv",!0),U(Q,$e,He,"⅁","\\Game",!0),U(Q,$e,He,"‵","\\backprime"),U(Q,$e,He,"▲","\\blacktriangle"),U(Q,$e,He,"▼","\\blacktriangledown"),U(Q,$e,He,"■","\\blacksquare"),U(Q,$e,He,"⧫","\\blacklozenge"),U(Q,$e,He,"★","\\bigstar"),U(Q,$e,He,"∢","\\sphericalangle",!0),U(Q,$e,He,"∁","\\complement",!0),U(Q,$e,He,"ð","\\eth",!0),U(kt,ce,He,"ð","ð"),U(Q,$e,He,"╱","\\diagup"),U(Q,$e,He,"╲","\\diagdown"),U(Q,$e,He,"□","\\square"),U(Q,$e,He,"□","\\Box"),U(Q,$e,He,"◊","\\Diamond"),U(Q,$e,He,"¥","\\yen",!0),U(kt,$e,He,"¥","\\yen",!0),U(Q,$e,He,"✓","\\checkmark",!0),U(kt,$e,He,"✓","\\checkmark"),U(Q,$e,He,"ℶ","\\beth",!0),U(Q,$e,He,"ℸ","\\daleth",!0),U(Q,$e,He,"ℷ","\\gimel",!0),U(Q,$e,He,"ϝ","\\digamma",!0),U(Q,$e,He,"ϰ","\\varkappa"),U(Q,$e,Gs,"┌","\\@ulcorner",!0),U(Q,$e,Ha,"┐","\\@urcorner",!0),U(Q,$e,Gs,"└","\\@llcorner",!0),U(Q,$e,Ha,"┘","\\@lrcorner",!0),U(Q,$e,ze,"≦","\\leqq",!0),U(Q,$e,ze,"⩽","\\leqslant",!0),U(Q,$e,ze,"⪕","\\eqslantless",!0),U(Q,$e,ze,"≲","\\lesssim",!0),U(Q,$e,ze,"⪅","\\lessapprox",!0),U(Q,$e,ze,"≊","\\approxeq",!0),U(Q,$e,Yt,"⋖","\\lessdot"),U(Q,$e,ze,"⋘","\\lll",!0),U(Q,$e,ze,"≶","\\lessgtr",!0),U(Q,$e,ze,"⋚","\\lesseqgtr",!0),U(Q,$e,ze,"⪋","\\lesseqqgtr",!0),U(Q,$e,ze,"≑","\\doteqdot"),U(Q,$e,ze,"≓","\\risingdotseq",!0),U(Q,$e,ze,"≒","\\fallingdotseq",!0),U(Q,$e,ze,"∽","\\backsim",!0),U(Q,$e,ze,"⋍","\\backsimeq",!0),U(Q,$e,ze,"⫅","\\subseteqq",!0),U(Q,$e,ze,"⋐","\\Subset",!0),U(Q,$e,ze,"⊏","\\sqsubset",!0),U(Q,$e,ze,"≼","\\preccurlyeq",!0),U(Q,$e,ze,"⋞","\\curlyeqprec",!0),U(Q,$e,ze,"≾","\\precsim",!0),U(Q,$e,ze,"⪷","\\precapprox",!0),U(Q,$e,ze,"⊲","\\vartriangleleft"),U(Q,$e,ze,"⊴","\\trianglelefteq"),U(Q,$e,ze,"⊨","\\vDash",!0),U(Q,$e,ze,"⊪","\\Vvdash",!0),U(Q,$e,ze,"⌣","\\smallsmile"),U(Q,$e,ze,"⌢","\\smallfrown"),U(Q,$e,ze,"≏","\\bumpeq",!0),U(Q,$e,ze,"≎","\\Bumpeq",!0),U(Q,$e,ze,"≧","\\geqq",!0),U(Q,$e,ze,"⩾","\\geqslant",!0),U(Q,$e,ze,"⪖","\\eqslantgtr",!0),U(Q,$e,ze,"≳","\\gtrsim",!0),U(Q,$e,ze,"⪆","\\gtrapprox",!0),U(Q,$e,Yt,"⋗","\\gtrdot"),U(Q,$e,ze,"⋙","\\ggg",!0),U(Q,$e,ze,"≷","\\gtrless",!0),U(Q,$e,ze,"⋛","\\gtreqless",!0),U(Q,$e,ze,"⪌","\\gtreqqless",!0),U(Q,$e,ze,"≖","\\eqcirc",!0),U(Q,$e,ze,"≗","\\circeq",!0),U(Q,$e,ze,"≜","\\triangleq",!0),U(Q,$e,ze,"∼","\\thicksim"),U(Q,$e,ze,"≈","\\thickapprox"),U(Q,$e,ze,"⫆","\\supseteqq",!0),U(Q,$e,ze,"⋑","\\Supset",!0),U(Q,$e,ze,"⊐","\\sqsupset",!0),U(Q,$e,ze,"≽","\\succcurlyeq",!0),U(Q,$e,ze,"⋟","\\curlyeqsucc",!0),U(Q,$e,ze,"≿","\\succsim",!0),U(Q,$e,ze,"⪸","\\succapprox",!0),U(Q,$e,ze,"⊳","\\vartriangleright"),U(Q,$e,ze,"⊵","\\trianglerighteq"),U(Q,$e,ze,"⊩","\\Vdash",!0),U(Q,$e,ze,"∣","\\shortmid"),U(Q,$e,ze,"∥","\\shortparallel"),U(Q,$e,ze,"≬","\\between",!0),U(Q,$e,ze,"⋔","\\pitchfork",!0),U(Q,$e,ze,"∝","\\varpropto"),U(Q,$e,ze,"◀","\\blacktriangleleft"),U(Q,$e,ze,"∴","\\therefore",!0),U(Q,$e,ze,"∍","\\backepsilon"),U(Q,$e,ze,"▶","\\blacktriangleright"),U(Q,$e,ze,"∵","\\because",!0),U(Q,$e,ze,"⋘","\\llless"),U(Q,$e,ze,"⋙","\\gggtr"),U(Q,$e,Yt,"⊲","\\lhd"),U(Q,$e,Yt,"⊳","\\rhd"),U(Q,$e,ze,"≂","\\eqsim",!0),U(Q,ce,ze,"⋈","\\Join"),U(Q,$e,ze,"≑","\\Doteq",!0),U(Q,$e,Yt,"∔","\\dotplus",!0),U(Q,$e,Yt,"∖","\\smallsetminus"),U(Q,$e,Yt,"⋒","\\Cap",!0),U(Q,$e,Yt,"⋓","\\Cup",!0),U(Q,$e,Yt,"⩞","\\doublebarwedge",!0),U(Q,$e,Yt,"⊟","\\boxminus",!0),U(Q,$e,Yt,"⊞","\\boxplus",!0),U(Q,$e,Yt,"⋇","\\divideontimes",!0),U(Q,$e,Yt,"⋉","\\ltimes",!0),U(Q,$e,Yt,"⋊","\\rtimes",!0),U(Q,$e,Yt,"⋋","\\leftthreetimes",!0),U(Q,$e,Yt,"⋌","\\rightthreetimes",!0),U(Q,$e,Yt,"⋏","\\curlywedge",!0),U(Q,$e,Yt,"⋎","\\curlyvee",!0),U(Q,$e,Yt,"⊝","\\circleddash",!0),U(Q,$e,Yt,"⊛","\\circledast",!0),U(Q,$e,Yt,"⋅","\\centerdot"),U(Q,$e,Yt,"⊺","\\intercal",!0),U(Q,$e,Yt,"⋒","\\doublecap"),U(Q,$e,Yt,"⋓","\\doublecup"),U(Q,$e,Yt,"⊠","\\boxtimes",!0),U(Q,$e,ze,"⇢","\\dashrightarrow",!0),U(Q,$e,ze,"⇠","\\dashleftarrow",!0),U(Q,$e,ze,"⇇","\\leftleftarrows",!0),U(Q,$e,ze,"⇆","\\leftrightarrows",!0),U(Q,$e,ze,"⇚","\\Lleftarrow",!0),U(Q,$e,ze,"↞","\\twoheadleftarrow",!0),U(Q,$e,ze,"↢","\\leftarrowtail",!0),U(Q,$e,ze,"↫","\\looparrowleft",!0),U(Q,$e,ze,"⇋","\\leftrightharpoons",!0),U(Q,$e,ze,"↶","\\curvearrowleft",!0),U(Q,$e,ze,"↺","\\circlearrowleft",!0),U(Q,$e,ze,"↰","\\Lsh",!0),U(Q,$e,ze,"⇈","\\upuparrows",!0),U(Q,$e,ze,"↿","\\upharpoonleft",!0),U(Q,$e,ze,"⇃","\\downharpoonleft",!0),U(Q,ce,ze,"⊶","\\origof",!0),U(Q,ce,ze,"⊷","\\imageof",!0),U(Q,$e,ze,"⊸","\\multimap",!0),U(Q,$e,ze,"↭","\\leftrightsquigarrow",!0),U(Q,$e,ze,"⇉","\\rightrightarrows",!0),U(Q,$e,ze,"⇄","\\rightleftarrows",!0),U(Q,$e,ze,"↠","\\twoheadrightarrow",!0),U(Q,$e,ze,"↣","\\rightarrowtail",!0),U(Q,$e,ze,"↬","\\looparrowright",!0),U(Q,$e,ze,"↷","\\curvearrowright",!0),U(Q,$e,ze,"↻","\\circlearrowright",!0),U(Q,$e,ze,"↱","\\Rsh",!0),U(Q,$e,ze,"⇊","\\downdownarrows",!0),U(Q,$e,ze,"↾","\\upharpoonright",!0),U(Q,$e,ze,"⇂","\\downharpoonright",!0),U(Q,$e,ze,"⇝","\\rightsquigarrow",!0),U(Q,$e,ze,"⇝","\\leadsto"),U(Q,$e,ze,"⇛","\\Rrightarrow",!0),U(Q,$e,ze,"↾","\\restriction"),U(Q,ce,He,"‘","`"),U(Q,ce,He,"$","\\$"),U(kt,ce,He,"$","\\$"),U(kt,ce,He,"$","\\textdollar"),U(Q,ce,He,"%","\\%"),U(kt,ce,He,"%","\\%"),U(Q,ce,He,"_","\\_"),U(kt,ce,He,"_","\\_"),U(kt,ce,He,"_","\\textunderscore"),U(Q,ce,He,"∠","\\angle",!0),U(Q,ce,He,"∞","\\infty",!0),U(Q,ce,He,"′","\\prime"),U(Q,ce,He,"△","\\triangle"),U(Q,ce,He,"Γ","\\Gamma",!0),U(Q,ce,He,"Δ","\\Delta",!0),U(Q,ce,He,"Θ","\\Theta",!0),U(Q,ce,He,"Λ","\\Lambda",!0),U(Q,ce,He,"Ξ","\\Xi",!0),U(Q,ce,He,"Π","\\Pi",!0),U(Q,ce,He,"Σ","\\Sigma",!0),U(Q,ce,He,"Υ","\\Upsilon",!0),U(Q,ce,He,"Φ","\\Phi",!0),U(Q,ce,He,"Ψ","\\Psi",!0),U(Q,ce,He,"Ω","\\Omega",!0),U(Q,ce,He,"A","Α"),U(Q,ce,He,"B","Β"),U(Q,ce,He,"E","Ε"),U(Q,ce,He,"Z","Ζ"),U(Q,ce,He,"H","Η"),U(Q,ce,He,"I","Ι"),U(Q,ce,He,"K","Κ"),U(Q,ce,He,"M","Μ"),U(Q,ce,He,"N","Ν"),U(Q,ce,He,"O","Ο"),U(Q,ce,He,"P","Ρ"),U(Q,ce,He,"T","Τ"),U(Q,ce,He,"X","Χ"),U(Q,ce,He,"¬","\\neg",!0),U(Q,ce,He,"¬","\\lnot"),U(Q,ce,He,"⊤","\\top"),U(Q,ce,He,"⊥","\\bot"),U(Q,ce,He,"∅","\\emptyset"),U(Q,$e,He,"∅","\\varnothing"),U(Q,ce,mr,"α","\\alpha",!0),U(Q,ce,mr,"β","\\beta",!0),U(Q,ce,mr,"γ","\\gamma",!0),U(Q,ce,mr,"δ","\\delta",!0),U(Q,ce,mr,"ϵ","\\epsilon",!0),U(Q,ce,mr,"ζ","\\zeta",!0),U(Q,ce,mr,"η","\\eta",!0),U(Q,ce,mr,"θ","\\theta",!0),U(Q,ce,mr,"ι","\\iota",!0),U(Q,ce,mr,"κ","\\kappa",!0),U(Q,ce,mr,"λ","\\lambda",!0),U(Q,ce,mr,"μ","\\mu",!0),U(Q,ce,mr,"ν","\\nu",!0),U(Q,ce,mr,"ξ","\\xi",!0),U(Q,ce,mr,"ο","\\omicron",!0),U(Q,ce,mr,"π","\\pi",!0),U(Q,ce,mr,"ρ","\\rho",!0),U(Q,ce,mr,"σ","\\sigma",!0),U(Q,ce,mr,"τ","\\tau",!0),U(Q,ce,mr,"υ","\\upsilon",!0),U(Q,ce,mr,"ϕ","\\phi",!0),U(Q,ce,mr,"χ","\\chi",!0),U(Q,ce,mr,"ψ","\\psi",!0),U(Q,ce,mr,"ω","\\omega",!0),U(Q,ce,mr,"ε","\\varepsilon",!0),U(Q,ce,mr,"ϑ","\\vartheta",!0),U(Q,ce,mr,"ϖ","\\varpi",!0),U(Q,ce,mr,"ϱ","\\varrho",!0),U(Q,ce,mr,"ς","\\varsigma",!0),U(Q,ce,mr,"φ","\\varphi",!0),U(Q,ce,Yt,"∗","*",!0),U(Q,ce,Yt,"+","+"),U(Q,ce,Yt,"−","-",!0),U(Q,ce,Yt,"⋅","\\cdot",!0),U(Q,ce,Yt,"∘","\\circ",!0),U(Q,ce,Yt,"÷","\\div",!0),U(Q,ce,Yt,"±","\\pm",!0),U(Q,ce,Yt,"×","\\times",!0),U(Q,ce,Yt,"∩","\\cap",!0),U(Q,ce,Yt,"∪","\\cup",!0),U(Q,ce,Yt,"∖","\\setminus",!0),U(Q,ce,Yt,"∧","\\land"),U(Q,ce,Yt,"∨","\\lor"),U(Q,ce,Yt,"∧","\\wedge",!0),U(Q,ce,Yt,"∨","\\vee",!0),U(Q,ce,He,"√","\\surd"),U(Q,ce,Gs,"⟨","\\langle",!0),U(Q,ce,Gs,"∣","\\lvert"),U(Q,ce,Gs,"∥","\\lVert"),U(Q,ce,Ha,"?","?"),U(Q,ce,Ha,"!","!"),U(Q,ce,Ha,"⟩","\\rangle",!0),U(Q,ce,Ha,"∣","\\rvert"),U(Q,ce,Ha,"∥","\\rVert"),U(Q,ce,ze,"=","="),U(Q,ce,ze,":",":"),U(Q,ce,ze,"≈","\\approx",!0),U(Q,ce,ze,"≅","\\cong",!0),U(Q,ce,ze,"≥","\\ge"),U(Q,ce,ze,"≥","\\geq",!0),U(Q,ce,ze,"←","\\gets"),U(Q,ce,ze,">","\\gt",!0),U(Q,ce,ze,"∈","\\in",!0),U(Q,ce,ze,"","\\@not"),U(Q,ce,ze,"⊂","\\subset",!0),U(Q,ce,ze,"⊃","\\supset",!0),U(Q,ce,ze,"⊆","\\subseteq",!0),U(Q,ce,ze,"⊇","\\supseteq",!0),U(Q,$e,ze,"⊈","\\nsubseteq",!0),U(Q,$e,ze,"⊉","\\nsupseteq",!0),U(Q,ce,ze,"⊨","\\models"),U(Q,ce,ze,"←","\\leftarrow",!0),U(Q,ce,ze,"≤","\\le"),U(Q,ce,ze,"≤","\\leq",!0),U(Q,ce,ze,"<","\\lt",!0),U(Q,ce,ze,"→","\\rightarrow",!0),U(Q,ce,ze,"→","\\to"),U(Q,$e,ze,"≱","\\ngeq",!0),U(Q,$e,ze,"≰","\\nleq",!0),U(Q,ce,_c," ","\\ "),U(Q,ce,_c," ","\\space"),U(Q,ce,_c," ","\\nobreakspace"),U(kt,ce,_c," ","\\ "),U(kt,ce,_c," "," "),U(kt,ce,_c," ","\\space"),U(kt,ce,_c," ","\\nobreakspace"),U(Q,ce,_c,"","\\nobreak"),U(Q,ce,_c,"","\\allowbreak"),U(Q,ce,ub,",",","),U(Q,ce,ub,";",";"),U(Q,$e,Yt,"⊼","\\barwedge",!0),U(Q,$e,Yt,"⊻","\\veebar",!0),U(Q,ce,Yt,"⊙","\\odot",!0),U(Q,ce,Yt,"⊕","\\oplus",!0),U(Q,ce,Yt,"⊗","\\otimes",!0),U(Q,ce,He,"∂","\\partial",!0),U(Q,ce,Yt,"⊘","\\oslash",!0),U(Q,$e,Yt,"⊚","\\circledcirc",!0),U(Q,$e,Yt,"⊡","\\boxdot",!0),U(Q,ce,Yt,"△","\\bigtriangleup"),U(Q,ce,Yt,"▽","\\bigtriangledown"),U(Q,ce,Yt,"†","\\dagger"),U(Q,ce,Yt,"⋄","\\diamond"),U(Q,ce,Yt,"⋆","\\star"),U(Q,ce,Yt,"◃","\\triangleleft"),U(Q,ce,Yt,"▹","\\triangleright"),U(Q,ce,Gs,"{","\\{"),U(kt,ce,He,"{","\\{"),U(kt,ce,He,"{","\\textbraceleft"),U(Q,ce,Ha,"}","\\}"),U(kt,ce,He,"}","\\}"),U(kt,ce,He,"}","\\textbraceright"),U(Q,ce,Gs,"{","\\lbrace"),U(Q,ce,Ha,"}","\\rbrace"),U(Q,ce,Gs,"[","\\lbrack",!0),U(kt,ce,He,"[","\\lbrack",!0),U(Q,ce,Ha,"]","\\rbrack",!0),U(kt,ce,He,"]","\\rbrack",!0),U(Q,ce,Gs,"(","\\lparen",!0),U(Q,ce,Ha,")","\\rparen",!0),U(kt,ce,He,"<","\\textless",!0),U(kt,ce,He,">","\\textgreater",!0),U(Q,ce,Gs,"⌊","\\lfloor",!0),U(Q,ce,Ha,"⌋","\\rfloor",!0),U(Q,ce,Gs,"⌈","\\lceil",!0),U(Q,ce,Ha,"⌉","\\rceil",!0),U(Q,ce,He,"\\","\\backslash"),U(Q,ce,He,"∣","|"),U(Q,ce,He,"∣","\\vert"),U(kt,ce,He,"|","\\textbar",!0),U(Q,ce,He,"∥","\\|"),U(Q,ce,He,"∥","\\Vert"),U(kt,ce,He,"∥","\\textbardbl"),U(kt,ce,He,"~","\\textasciitilde"),U(kt,ce,He,"\\","\\textbackslash"),U(kt,ce,He,"^","\\textasciicircum"),U(Q,ce,ze,"↑","\\uparrow",!0),U(Q,ce,ze,"⇑","\\Uparrow",!0),U(Q,ce,ze,"↓","\\downarrow",!0),U(Q,ce,ze,"⇓","\\Downarrow",!0),U(Q,ce,ze,"↕","\\updownarrow",!0),U(Q,ce,ze,"⇕","\\Updownarrow",!0),U(Q,ce,ki,"∐","\\coprod"),U(Q,ce,ki,"⋁","\\bigvee"),U(Q,ce,ki,"⋀","\\bigwedge"),U(Q,ce,ki,"⨄","\\biguplus"),U(Q,ce,ki,"⋂","\\bigcap"),U(Q,ce,ki,"⋃","\\bigcup"),U(Q,ce,ki,"∫","\\int"),U(Q,ce,ki,"∫","\\intop"),U(Q,ce,ki,"∬","\\iint"),U(Q,ce,ki,"∭","\\iiint"),U(Q,ce,ki,"∏","\\prod"),U(Q,ce,ki,"∑","\\sum"),U(Q,ce,ki,"⨂","\\bigotimes"),U(Q,ce,ki,"⨁","\\bigoplus"),U(Q,ce,ki,"⨀","\\bigodot"),U(Q,ce,ki,"∮","\\oint"),U(Q,ce,ki,"∯","\\oiint"),U(Q,ce,ki,"∰","\\oiiint"),U(Q,ce,ki,"⨆","\\bigsqcup"),U(Q,ce,ki,"∫","\\smallint"),U(kt,ce,op,"…","\\textellipsis"),U(Q,ce,op,"…","\\mathellipsis"),U(kt,ce,op,"…","\\ldots",!0),U(Q,ce,op,"…","\\ldots",!0),U(Q,ce,op,"⋯","\\@cdots",!0),U(Q,ce,op,"⋱","\\ddots",!0),U(Q,ce,He,"⋮","\\varvdots"),U(kt,ce,He,"⋮","\\varvdots"),U(Q,ce,Un,"ˊ","\\acute"),U(Q,ce,Un,"ˋ","\\grave"),U(Q,ce,Un,"¨","\\ddot"),U(Q,ce,Un,"~","\\tilde"),U(Q,ce,Un,"ˉ","\\bar"),U(Q,ce,Un,"˘","\\breve"),U(Q,ce,Un,"ˇ","\\check"),U(Q,ce,Un,"^","\\hat"),U(Q,ce,Un,"⃗","\\vec"),U(Q,ce,Un,"˙","\\dot"),U(Q,ce,Un,"˚","\\mathring"),U(Q,ce,mr,"","\\@imath"),U(Q,ce,mr,"","\\@jmath"),U(Q,ce,He,"ı","ı"),U(Q,ce,He,"ȷ","ȷ"),U(kt,ce,He,"ı","\\i",!0),U(kt,ce,He,"ȷ","\\j",!0),U(kt,ce,He,"ß","\\ss",!0),U(kt,ce,He,"æ","\\ae",!0),U(kt,ce,He,"œ","\\oe",!0),U(kt,ce,He,"ø","\\o",!0),U(kt,ce,He,"Æ","\\AE",!0),U(kt,ce,He,"Œ","\\OE",!0),U(kt,ce,He,"Ø","\\O",!0),U(kt,ce,Un,"ˊ","\\'"),U(kt,ce,Un,"ˋ","\\`"),U(kt,ce,Un,"ˆ","\\^"),U(kt,ce,Un,"˜","\\~"),U(kt,ce,Un,"ˉ","\\="),U(kt,ce,Un,"˘","\\u"),U(kt,ce,Un,"˙","\\."),U(kt,ce,Un,"¸","\\c"),U(kt,ce,Un,"˚","\\r"),U(kt,ce,Un,"ˇ","\\v"),U(kt,ce,Un,"¨",'\\"'),U(kt,ce,Un,"˝","\\H"),U(kt,ce,Un,"◯","\\textcircled");var pY={"--":!0,"---":!0,"``":!0,"''":!0};U(kt,ce,He,"–","--",!0),U(kt,ce,He,"–","\\textendash"),U(kt,ce,He,"—","---",!0),U(kt,ce,He,"—","\\textemdash"),U(kt,ce,He,"‘","`",!0),U(kt,ce,He,"‘","\\textquoteleft"),U(kt,ce,He,"’","'",!0),U(kt,ce,He,"’","\\textquoteright"),U(kt,ce,He,"“","``",!0),U(kt,ce,He,"“","\\textquotedblleft"),U(kt,ce,He,"”","''",!0),U(kt,ce,He,"”","\\textquotedblright"),U(Q,ce,He,"°","\\degree",!0),U(kt,ce,He,"°","\\degree"),U(kt,ce,He,"°","\\textdegree",!0),U(Q,ce,He,"£","\\pounds"),U(Q,ce,He,"£","\\mathsterling",!0),U(kt,ce,He,"£","\\pounds"),U(kt,ce,He,"£","\\textsterling",!0),U(Q,$e,He,"✠","\\maltese"),U(kt,$e,He,"✠","\\maltese");for(var gY='0123456789/@."',y7=0;y7{var e=t.charCodeAt(0),r=t.charCodeAt(1),n=(e-55296)*1024+(r-56320)+65536;if(119808<=n&&n<120484){var i=Math.floor((n-119808)/26);return EY[i]}else if(120782<=n&&n<=120831){var a=Math.floor((n-120782)/10);return mRe[a]}else{if(n===120485||n===120486)return EY[0];if(120486{if(Pu(t.classes)!==Pu(e.classes)||t.skew!==e.skew||t.maxFontSize!==e.maxFontSize||t.italic!==0&&t.hasClass("mathnormal"))return!1;if(t.classes.length===1){var r=t.classes[0];if(r==="mbin"||r==="mord")return!1}for(var n of Object.keys(t.style))if(t.style[n]!==e.style[n])return!1;for(var i of Object.keys(e.style))if(t.style[i]!==e.style[i])return!1;return!0},SY=t=>{for(var e=0;er&&(r=s.height),s.depth>n&&(n=s.depth),s.maxFontSize>i&&(i=s.maxFontSize)}e.height=r,e.depth=n,e.maxFontSize=i},Rt=function(e,r,n,i){var a=new sp(e,r,n,i);return A7(a),a},zu=(t,e,r,n)=>new sp(t,e,r,n),lp=function(e,r,n){var i=Rt([e],[],r);return i.height=Math.max(n||r.fontMetrics().defaultRuleThickness,r.minRuleThickness),i.style.borderBottomWidth=$t(i.height),i.maxFontSize=1,i},xRe=function(e,r,n,i){var a=new mC(e,r,n,i);return A7(a),a},Rc=function(e){var r=new ap(e);return A7(r),r},cp=function(e,r){return e instanceof ap?Rt([],[e],r):e},TRe=function(e){if(e.positionType==="individualShift"){for(var r=e.children,n=[r[0]],i=-r[0].shift-r[0].elem.depth,a=i,s=1;s{var r=Rt(["mspace"],[],e),n=Xn(t,e);return r.style.marginRight=$t(n),r},CC=(t,e,r)=>{var n,i;switch(t){case"amsrm":n="AMS";break;case"textrm":n="Main";break;case"textsf":n="SansSerif";break;case"texttt":n="Typewriter";break;default:n=t}return e==="textbf"&&r==="textit"?i="BoldItalic":e==="textbf"?i="Bold":r==="textit"?i="Italic":i="Regular",n+"-"+i},_7={mathbf:{variant:"bold",fontName:"Main-Bold"},mathrm:{variant:"normal",fontName:"Main-Regular"},textit:{variant:"italic",fontName:"Main-Italic"},mathit:{variant:"italic",fontName:"Main-Italic"},mathnormal:{variant:"italic",fontName:"Math-Italic"},mathsfit:{variant:"sans-serif-italic",fontName:"SansSerif-Italic"},mathbb:{variant:"double-struck",fontName:"AMS-Regular"},mathcal:{variant:"script",fontName:"Caligraphic-Regular"},mathfrak:{variant:"fraktur",fontName:"Fraktur-Regular"},mathscr:{variant:"script",fontName:"Script-Regular"},mathsf:{variant:"sans-serif",fontName:"SansSerif-Regular"},mathtt:{variant:"monospace",fontName:"Typewriter-Regular"}},_Y={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},RY=function(e,r){var[n,i,a]=_Y[e],s=new Bu(n),o=new Ac([s],{width:$t(i),height:$t(a),style:"width:"+$t(i),viewBox:"0 0 "+1e3*i+" "+1e3*a,preserveAspectRatio:"xMinYMin"}),l=zu(["overlay"],[o],r);return l.height=a,l.style.height=$t(a),l.style.width=$t(i),l},Kn={number:3,unit:"mu"},yd={number:4,unit:"mu"},Lc={number:5,unit:"mu"},wRe={mord:{mop:Kn,mbin:yd,mrel:Lc,minner:Kn},mop:{mord:Kn,mop:Kn,mrel:Lc,minner:Kn},mbin:{mord:yd,mop:yd,mopen:yd,minner:yd},mrel:{mord:Lc,mop:Lc,mopen:Lc,minner:Lc},mopen:{},mclose:{mop:Kn,mbin:yd,mrel:Lc,minner:Kn},mpunct:{mord:Kn,mop:Kn,mrel:Lc,mopen:Kn,mclose:Kn,mpunct:Kn,minner:Kn},minner:{mord:Kn,mop:Kn,mbin:yd,mrel:Lc,mopen:Kn,mpunct:Kn,minner:Kn}},CRe={mord:{mop:Kn},mop:{mord:Kn,mop:Kn},mbin:{},mrel:{},mopen:{},mclose:{mop:Kn},mpunct:{},minner:{mop:Kn}},LY={},kC={},EC={};function Wt(t){for(var{type:e,names:r,props:n,handler:i,htmlBuilder:a,mathmlBuilder:s}=t,o={type:e,numArgs:n.numArgs,argTypes:n.argTypes,allowedInArgument:!!n.allowedInArgument,allowedInText:!!n.allowedInText,allowedInMath:n.allowedInMath===void 0?!0:n.allowedInMath,numOptionalArgs:n.numOptionalArgs||0,infix:!!n.infix,primitive:!!n.primitive,handler:i},l=0;l{var y=m.classes[0],v=g.classes[0];y==="mbin"&&ERe.has(v)?m.classes[0]="mord":v==="mbin"&&kRe.has(y)&&(g.classes[0]="mord")},{node:d},f,p),R7(a,(g,m)=>{var y,v,T=I7(m),b=I7(g),w=T&&b?g.hasClass("mtight")?(y=CRe[T])==null?void 0:y[b]:(v=wRe[T])==null?void 0:v[b]:null;if(w)return AY(w,u)},{node:d},f,p),a},R7=function(e,r,n,i,a){i&&e.push(i);for(var s=0;sf=>{e.splice(d+1,0,f),s++})(s)}i&&e.pop()},IY=function(e){return e instanceof ap||e instanceof mC||e instanceof sp&&e.hasClass("enclosing")?e:null},L7=function(e,r){var n=IY(e);if(n){var i=n.children;if(i.length){if(r==="right")return L7(i[i.length-1],"right");if(r==="left")return L7(i[0],"left")}}return e},I7=function(e,r){if(!e)return null;r&&(e=L7(e,r));var n=e.classes[0];return ARe[n]||null},hb=function(e,r){var n=["nulldelimiter"].concat(e.baseSizingClasses());return Rt(r.concat(n))},an=function(e,r,n){if(!e)return Rt();if(kC[e.type]){var i=kC[e.type](e,r);if(n&&r.size!==n.size){i=Rt(r.sizingClasses(n),[i],r);var a=r.sizeMultiplier/n.sizeMultiplier;i.height*=a,i.depth*=a}return i}else throw new Dt("Got group of unknown type: '"+e.type+"'")};function AC(t,e){var r=Rt(["base"],t,e),n=Rt(["strut"]);return n.style.height=$t(r.height+r.depth),r.depth&&(n.style.verticalAlign=$t(-r.depth)),r.children.unshift(n),r}function D7(t,e){var r=null;t.length===1&&t[0].type==="tag"&&(r=t[0].tag,t=t[0].body);var n=Bi(t,e,"root"),i;n.length===2&&n[1].hasClass("tag")&&(i=n.pop());for(var a=[],s=[],o=0;o0&&(a.push(AC(s,e)),s=[]),a.push(n[o]));s.length>0&&a.push(AC(s,e));var u;r?(u=AC(Bi(r,e,!0),e),u.classes=["tag"],a.push(u)):i&&a.push(i);var h=Rt(["katex-html"],a);if(h.setAttribute("aria-hidden","true"),u){var d=u.children[0];d.style.height=$t(h.height+h.depth),h.depth&&(d.style.verticalAlign=$t(-h.depth))}return h}function DY(t){return new ap(t)}class Mt{constructor(e,r,n){this.type=void 0,this.attributes=void 0,this.children=void 0,this.classes=void 0,this.type=e,this.attributes={},this.children=r||[],this.classes=n||[]}setAttribute(e,r){this.attributes[e]=r}getAttribute(e){return this.attributes[e]}toNode(){var e=document.createElementNS("http://www.w3.org/1998/Math/MathML",this.type);for(var r in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,r)&&e.setAttribute(r,this.attributes[r]);this.classes.length>0&&(e.className=Pu(this.classes));for(var n=0;n0&&(e+=' class ="'+Ia(Pu(this.classes))+'"'),e+=">";for(var n=0;n",e}toText(){return this.children.map(e=>e.toText()).join("")}}class Si{constructor(e){this.text=void 0,this.text=e}toNode(){return document.createTextNode(this.text)}toMarkup(){return Ia(this.toText())}toText(){return this.text}}class MY{constructor(e){this.width=void 0,this.character=void 0,this.width=e,e>=.05555&&e<=.05556?this.character=" ":e>=.1666&&e<=.1667?this.character=" ":e>=.2222&&e<=.2223?this.character=" ":e>=.2777&&e<=.2778?this.character="  ":e>=-.05556&&e<=-.05555?this.character=" ⁣":e>=-.1667&&e<=-.1666?this.character=" ⁣":e>=-.2223&&e<=-.2222?this.character=" ⁣":e>=-.2778&&e<=-.2777?this.character=" ⁣":this.character=null}toNode(){if(this.character)return document.createTextNode(this.character);var e=document.createElementNS("http://www.w3.org/1998/Math/MathML","mspace");return e.setAttribute("width",$t(this.width)),e}toMarkup(){return this.character?""+this.character+"":''}toText(){return this.character?this.character:" "}}var _Re=new Set(["\\imath","\\jmath"]),RRe=new Set(["mrow","mtable"]),lo=function(e,r,n){return Wn[r][e]&&Wn[r][e].replace&&e.charCodeAt(0)!==55349&&!(pY.hasOwnProperty(e)&&n&&(n.fontFamily&&n.fontFamily.slice(4,6)==="tt"||n.font&&n.font.slice(4,6)==="tt"))&&(e=Wn[r][e].replace),new Si(e)},M7=function(e){return e.length===1?e[0]:new Mt("mrow",e)},LRe={mathit:"italic",boldsymbol:t=>t.type==="textord"?"bold":"bold-italic",mathbf:"bold",mathbb:"double-struck",mathsfit:"sans-serif-italic",mathfrak:"fraktur",mathscr:"script",mathcal:"script",mathsf:"sans-serif",mathtt:"monospace"},N7=(t,e)=>{if(t.mode==="text"){if(e.fontFamily==="texttt")return"monospace";if(e.fontFamily==="textsf")return e.fontShape==="textit"&&e.fontWeight==="textbf"?"sans-serif-bold-italic":e.fontShape==="textit"?"sans-serif-italic":e.fontWeight==="textbf"?"bold-sans-serif":"sans-serif";if(e.fontShape==="textit"&&e.fontWeight==="textbf")return"bold-italic";if(e.fontShape==="textit")return"italic";if(e.fontWeight==="textbf")return"bold"}var r=e.font;if(!r||r==="mathnormal")return null;var n=t.mode,i=LRe[r];if(i)return typeof i=="function"?i(t):i;var a=t.text;if(_Re.has(a))return null;if(Wn[n][a]){var s=Wn[n][a].replace;s&&(a=s)}var o=_7[r].fontName;return g7(a,o,n)?_7[r].variant:null};function O7(t){if(!t)return!1;if(t.type==="mi"&&t.children.length===1){var e=t.children[0];return e instanceof Si&&e.text==="."}else if(t.type==="mo"&&t.children.length===1&&t.getAttribute("separator")==="true"&&t.getAttribute("lspace")==="0em"&&t.getAttribute("rspace")==="0em"){var r=t.children[0];return r instanceof Si&&r.text===","}else return!1}var qs=function(e,r,n){if(e.length===1){var i=Tn(e[0],r);return n&&i instanceof Mt&&i.type==="mo"&&(i.setAttribute("lspace","0em"),i.setAttribute("rspace","0em")),[i]}for(var a=[],s,o=0;o=1&&(s.type==="mn"||O7(s))){var u=l.children[0];u instanceof Mt&&u.type==="mn"&&(u.children=[...s.children,...u.children],a.pop())}else if(s.type==="mi"&&s.children.length===1){var h=s.children[0];if(h instanceof Si&&h.text==="̸"&&(l.type==="mo"||l.type==="mi"||l.type==="mn")){var d=l.children[0];d instanceof Si&&d.text.length>0&&(d.text=d.text.slice(0,1)+"̸"+d.text.slice(1),a.pop())}}}a.push(l),s=l}return a},Gu=function(e,r,n){return M7(qs(e,r,n))},Tn=function(e,r){if(!e)return new Mt("mrow");if(EC[e.type])return EC[e.type](e,r);throw new Dt("Got group of unknown type: '"+e.type+"'")};function NY(t,e,r,n,i){var a=qs(t,r),s;a.length===1&&a[0]instanceof Mt&&RRe.has(a[0].type)?s=a[0]:s=new Mt("mrow",a);var o=new Mt("annotation",[new Si(e)]);o.setAttribute("encoding","application/x-tex");var l=new Mt("semantics",[s,o]),u=new Mt("math",[l]);u.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),n&&u.setAttribute("display","block");var h=i?"katex":"katex-mathml";return Rt([h],[u])}var IRe=[[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]],OY=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],$Y=function(e,r){return r.size<2?e:IRe[e-1][r.size-1]};class Ic{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||Ic.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=OY[this.size-1],this.maxSize=e.maxSize,this.minRuleThickness=e.minRuleThickness,this._fontMetrics=void 0}extend(e){var r={style:this.style,size:this.size,textSize:this.textSize,color:this.color,phantom:this.phantom,font:this.font,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontShape:this.fontShape,maxSize:this.maxSize,minRuleThickness:this.minRuleThickness};return Object.assign(r,e),new Ic(r)}havingStyle(e){return this.style===e?this:this.extend({style:e,size:$Y(this.textSize,e)})}havingCrampedStyle(){return this.havingStyle(this.style.cramp())}havingSize(e){return this.size===e&&this.textSize===e?this:this.extend({style:this.style.text(),size:e,textSize:e,sizeMultiplier:OY[e-1]})}havingBaseStyle(e){e=e||this.style.text();var r=$Y(Ic.BASESIZE,e);return this.size===r&&this.textSize===Ic.BASESIZE&&this.style===e?this:this.extend({style:e,size:r})}havingBaseSizing(){var e;switch(this.style.id){case 4:case 5:e=3;break;case 6:case 7:e=1;break;default:e=6}return this.extend({style:this.style.text(),size:e})}withColor(e){return this.extend({color:e})}withPhantom(){return this.extend({phantom:!0})}withFont(e){return this.extend({font:e})}withTextFontFamily(e){return this.extend({fontFamily:e,font:""})}withTextFontWeight(e){return this.extend({fontWeight:e,font:""})}withTextFontShape(e){return this.extend({fontShape:e,font:""})}sizingClasses(e){return e.size!==this.size?["sizing","reset-size"+e.size,"size"+this.size]:[]}baseSizingClasses(){return this.size!==Ic.BASESIZE?["sizing","reset-size"+this.size,"size"+Ic.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=pRe(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}}Ic.BASESIZE=6;var PY=function(e){return new Ic({style:e.displayMode?Ir.DISPLAY:Ir.TEXT,maxSize:e.maxSize,minRuleThickness:e.minRuleThickness})},BY=function(e,r){if(r.displayMode){var n=["katex-display"];r.leqno&&n.push("leqno"),r.fleqn&&n.push("fleqn"),e=Rt(n,[e])}return e},DRe=function(e,r,n){var i=PY(n),a;if(n.output==="mathml")return NY(e,r,i,n.displayMode,!0);if(n.output==="html"){var s=D7(e,i);a=Rt(["katex"],[s])}else{var o=NY(e,r,i,n.displayMode,!1),l=D7(e,i);a=Rt(["katex"],[o,l])}return BY(a,n)},MRe=function(e,r,n){var i=PY(n),a=D7(e,i),s=Rt(["katex"],[a]);return BY(s,n)},NRe={widehat:"^",widecheck:"ˇ",widetilde:"~",utilde:"~",overleftarrow:"←",underleftarrow:"←",xleftarrow:"←",overrightarrow:"→",underrightarrow:"→",xrightarrow:"→",underbrace:"⏟",overbrace:"⏞",underbracket:"⎵",overbracket:"⎴",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":"="},_C=function(e){var r=new Mt("mo",[new Si(NRe[e.replace(/^\\/,"")])]);return r.setAttribute("stretchy","true"),r},ORe={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],overbracket:[["leftbracketover","rightbracketover"],1.6,440],underbracket:[["leftbracketunder","rightbracketunder"],1.6,410],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]},$Re=new Set(["widehat","widecheck","widetilde","utilde"]),RC=function(e,r){function n(){var o=4e5,l=e.label.slice(1);if($Re.has(l)&&"base"in e){var u=e.base.type==="ordgroup"?e.base.body.length:1,h,d,f;if(u>5)l==="widehat"||l==="widecheck"?(h=420,o=2364,f=.42,d=l+"4"):(h=312,o=2340,f=.34,d="tilde4");else{var p=[1,1,2,2,3,3][u];l==="widehat"||l==="widecheck"?(o=[0,1062,2364,2364,2364][p],h=[0,239,300,360,420][p],f=[0,.24,.3,.3,.36,.42][p],d=l+p):(o=[0,600,1033,2339,2340][p],h=[0,260,286,306,312][p],f=[0,.26,.286,.3,.306,.34][p],d="tilde"+p)}var g=new Bu(d),m=new Ac([g],{width:"100%",height:$t(f),viewBox:"0 0 "+o+" "+h,preserveAspectRatio:"none"});return{span:zu([],[m],r),minWidth:0,height:f}}else{var y=[],v=ORe[l];if(!v)throw new Error('No SVG data for "'+l+'".');var[T,b,w]=v,k=w/1e3,A=T.length,C,_;if(A===1){if(v.length!==4)throw new Error('Expected 4-tuple for single-path SVG data "'+l+'".');C=["hide-tail"],_=[v[3]]}else if(A===2)C=["halfarrow-left","halfarrow-right"],_=["xMinYMin","xMaxYMin"];else if(A===3)C=["brace-left","brace-center","brace-right"],_=["xMinYMin","xMidYMin","xMaxYMin"];else throw new Error(`Correct katexImagesData or update code here to support - `+A+" children.");for(var L=0;L0&&(i.style.minWidth=$t(a)),i},PRe=function(e,r,n,i,a){var s,o=e.height+e.depth+n+i;if(/fbox|color|angl/.test(r)){if(s=Rt(["stretchy",r],[],a),r==="fbox"){var l=a.color&&a.getColor();l&&(s.style.borderColor=l)}}else{var u=[];/^[bx]cancel$/.test(r)&&u.push(new p7({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(r)&&u.push(new p7({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var h=new Ac(u,{width:"100%",height:$t(o)});s=zu([],[h],a)}return s.height=o,s.style.height=$t(o),s},BRe={bin:1,close:1,inner:1,open:1,punct:1,rel:1},FRe={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1};function zRe(t){return t in BRe}function Or(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 LC(t){var e=IC(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 IC(t){return t&&(t.type==="atom"||FRe.hasOwnProperty(t.type))?t:null}var FY=t=>{if(t instanceof zs)return t;if(fRe(t)&&t.children.length===1)return FY(t.children[0])},$7=(t,e)=>{var r,n,i;t&&t.type==="supsub"?(n=Or(t.base,"accent"),r=n.base,t.base=r,i=dRe(an(t,e)),t.base=n):(n=Or(t,"accent"),r=n.base);var a=an(r,e.havingCrampedStyle()),s=n.isShifty&&Ec(r),o=0;if(s){var l,u;o=(l=(u=FY(a))==null?void 0:u.skew)!=null?l:0}var h=n.label==="\\c",d=h?a.height+a.depth:Math.min(a.height,e.fontMetrics().xHeight),f;if(n.isStretchy)f=RC(n,e),f=nn({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"elem",elem:f,wrapperClasses:["svg-align"],wrapperStyle:o>0?{width:"calc(100% - "+$t(2*o)+")",marginLeft:$t(2*o)}:void 0}]});else{var p,g;n.label==="\\vec"?(p=RY("vec",e),g=_Y.vec[1]):(p=wC({mode:n.mode,text:n.label},e,"textord"),p=hRe(p),p.italic=0,g=p.width,h&&(d+=p.depth)),f=Rt(["accent-body"],[p]);var m=n.label==="\\textcircled";m&&(f.classes.push("accent-full"),d=a.height);var y=o;m||(y-=g/2),f.style.left=$t(y),n.label==="\\textcircled"&&(f.style.top=".2em"),f=nn({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"kern",size:-d},{type:"elem",elem:f}]})}var v=Rt(["mord","accent"],[f],e);return i?(i.children[0]=v,i.height=Math.max(v.height,i.height),i.classes[0]="mord",i):v},zY=(t,e)=>{var r=t.isStretchy?_C(t.label):new Mt("mo",[lo(t.label,t.mode)]),n=new Mt("mover",[Tn(t.base,e),r]);return n.setAttribute("accent","true"),n},GRe=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(t=>"\\"+t).join("|"));Wt({type:"accent",names:["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring","\\widecheck","\\widehat","\\widetilde","\\overrightarrow","\\overleftarrow","\\Overrightarrow","\\overleftrightarrow","\\overgroup","\\overlinesegment","\\overleftharpoon","\\overrightharpoon"],props:{numArgs:1},handler:(t,e)=>{var r=SC(e[0]),n=!GRe.test(t.funcName),i=!n||t.funcName==="\\widehat"||t.funcName==="\\widetilde"||t.funcName==="\\widecheck";return{type:"accent",mode:t.parser.mode,label:t.funcName,isStretchy:n,isShifty:i,base:r}},htmlBuilder:$7,mathmlBuilder:zY}),Wt({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"]},handler:(t,e)=>{var r=e[0],n=t.parser.mode;return n==="math"&&(t.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+t.funcName+" works only in text mode"),n="text"),{type:"accent",mode:n,label:t.funcName,isStretchy:!1,isShifty:!0,base:r}},htmlBuilder:$7,mathmlBuilder:zY}),Wt({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:(t,e)=>{var{parser:r,funcName:n}=t,i=e[0];return{type:"accentUnder",mode:r.mode,label:n,base:i}},htmlBuilder:(t,e)=>{var r=an(t.base,e),n=RC(t,e),i=t.label==="\\utilde"?.12:0,a=nn({positionType:"top",positionData:r.height,children:[{type:"elem",elem:n,wrapperClasses:["svg-align"]},{type:"kern",size:i},{type:"elem",elem:r}]});return Rt(["mord","accentunder"],[a],e)},mathmlBuilder:(t,e)=>{var r=_C(t.label),n=new Mt("munder",[Tn(t.base,e),r]);return n.setAttribute("accentunder","true"),n}});var DC=t=>{var e=new Mt("mpadded",t?[t]:[]);return e.setAttribute("width","+0.6em"),e.setAttribute("lspace","0.3em"),e};Wt({type:"xArrow",names:["\\xleftarrow","\\xrightarrow","\\xLeftarrow","\\xRightarrow","\\xleftrightarrow","\\xLeftrightarrow","\\xhookleftarrow","\\xhookrightarrow","\\xmapsto","\\xrightharpoondown","\\xrightharpoonup","\\xleftharpoondown","\\xleftharpoonup","\\xrightleftharpoons","\\xleftrightharpoons","\\xlongequal","\\xtwoheadrightarrow","\\xtwoheadleftarrow","\\xtofrom","\\xrightleftarrows","\\xrightequilibrium","\\xleftequilibrium","\\\\cdrightarrow","\\\\cdleftarrow","\\\\cdlongequal"],props:{numArgs:1,numOptionalArgs:1},handler(t,e,r){var{parser:n,funcName:i}=t;return{type:"xArrow",mode:n.mode,label:i,body:e[0],below:r[0]}},htmlBuilder(t,e){var r=e.style,n=e.havingStyle(r.sup()),i=cp(an(t.body,n,e),e),a=t.label.slice(0,2)==="\\x"?"x":"cd";i.classes.push(a+"-arrow-pad");var s;t.below&&(n=e.havingStyle(r.sub()),s=cp(an(t.below,n,e),e),s.classes.push(a+"-arrow-pad"));var o=RC(t,e),l=-e.fontMetrics().axisHeight+.5*o.height,u=-e.fontMetrics().axisHeight-.5*o.height-.111;(i.depth>.25||t.label==="\\xleftequilibrium")&&(u-=i.depth);var h;if(s){var d=-e.fontMetrics().axisHeight+s.height+.5*o.height+.111;h=nn({positionType:"individualShift",children:[{type:"elem",elem:i,shift:u},{type:"elem",elem:o,shift:l,wrapperClasses:["svg-align"]},{type:"elem",elem:s,shift:d}]})}else h=nn({positionType:"individualShift",children:[{type:"elem",elem:i,shift:u},{type:"elem",elem:o,shift:l,wrapperClasses:["svg-align"]}]});return Rt(["mrel","x-arrow"],[h],e)},mathmlBuilder(t,e){var r=_C(t.label);r.setAttribute("minsize",t.label.charAt(0)==="x"?"1.75em":"3.0em");var n;if(t.body){var i=DC(Tn(t.body,e));if(t.below){var a=DC(Tn(t.below,e));n=new Mt("munderover",[r,a,i])}else n=new Mt("mover",[r,i])}else if(t.below){var s=DC(Tn(t.below,e));n=new Mt("munder",[r,s])}else n=DC(),n=new Mt("mover",[r,n]);return n}});function GY(t,e){var r=Bi(t.body,e,!0);return Rt([t.mclass],r,e)}function qY(t,e){var r,n=qs(t.body,e);return t.mclass==="minner"?r=new Mt("mpadded",n):t.mclass==="mord"?t.isCharacterBox?(r=n[0],r.type="mi"):r=new Mt("mi",n):(t.isCharacterBox?(r=n[0],r.type="mo"):r=new Mt("mo",n),t.mclass==="mbin"?(r.attributes.lspace="0.22em",r.attributes.rspace="0.22em"):t.mclass==="mpunct"?(r.attributes.lspace="0em",r.attributes.rspace="0.17em"):t.mclass==="mopen"||t.mclass==="mclose"?(r.attributes.lspace="0em",r.attributes.rspace="0em"):t.mclass==="minner"&&(r.attributes.lspace="0.0556em",r.attributes.width="+0.1111em")),r}Wt({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],props:{numArgs:1,primitive:!0},handler(t,e){var{parser:r,funcName:n}=t,i=e[0];return{type:"mclass",mode:r.mode,mclass:"m"+n.slice(5),body:Ei(i),isCharacterBox:Ec(i)}},htmlBuilder:GY,mathmlBuilder:qY});var MC=t=>{var e=t.type==="ordgroup"&&t.body.length?t.body[0]:t;return e.type==="atom"&&(e.family==="bin"||e.family==="rel")?"m"+e.family:"mord"};Wt({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler(t,e){var{parser:r}=t;return{type:"mclass",mode:r.mode,mclass:MC(e[0]),body:Ei(e[1]),isCharacterBox:Ec(e[1])}}}),Wt({type:"mclass",names:["\\stackrel","\\overset","\\underset"],props:{numArgs:2},handler(t,e){var{parser:r,funcName:n}=t,i=e[1],a=e[0],s;n!=="\\stackrel"?s=MC(i):s="mrel";var o={type:"op",mode:i.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:n!=="\\stackrel",body:Ei(i)},l={type:"supsub",mode:a.mode,base:o,sup:n==="\\underset"?null:a,sub:n==="\\underset"?a:null};return{type:"mclass",mode:r.mode,mclass:s,body:[l],isCharacterBox:Ec(l)}},htmlBuilder:GY,mathmlBuilder:qY}),Wt({type:"pmb",names:["\\pmb"],props:{numArgs:1,allowedInText:!0},handler(t,e){var{parser:r}=t;return{type:"pmb",mode:r.mode,mclass:MC(e[0]),body:Ei(e[0])}},htmlBuilder(t,e){var r=Bi(t.body,e,!0),n=Rt([t.mclass],r,e);return n.style.textShadow="0.02em 0.01em 0.04px",n},mathmlBuilder(t,e){var r=qs(t.body,e),n=new Mt("mstyle",r);return n.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),n}});var qRe={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},VY=()=>({type:"styling",body:[],mode:"math",style:"display",resetFont:!0}),WY=t=>t.type==="textord"&&t.text==="@",VRe=(t,e)=>(t.type==="mathord"||t.type==="atom")&&t.text===e;function WRe(t,e,r){var n=qRe[t];switch(n){case"\\\\cdrightarrow":case"\\\\cdleftarrow":return r.callFunction(n,[e[0]],[e[1]]);case"\\uparrow":case"\\downarrow":{var i=r.callFunction("\\\\cdleft",[e[0]],[]),a={type:"atom",text:n,mode:"math",family:"rel"},s=r.callFunction("\\Big",[a],[]),o=r.callFunction("\\\\cdright",[e[1]],[]),l={type:"ordgroup",mode:"math",body:[i,s,o]};return r.callFunction("\\\\cdparent",[l],[])}case"\\\\cdlongequal":return r.callFunction("\\\\cdlongequal",[],[]);case"\\Vert":{var u={type:"textord",text:"\\Vert",mode:"math"};return r.callFunction("\\Big",[u],[])}default:return{type:"textord",text:" ",mode:"math"}}}function URe(t){var e=[];for(t.gullet.beginGroup(),t.gullet.macros.set("\\cr","\\\\\\relax"),t.gullet.beginGroup();;){e.push(t.parseExpression(!1,"\\\\")),t.gullet.endGroup(),t.gullet.beginGroup();var r=t.fetch().text;if(r==="&"||r==="\\\\")t.consume();else if(r==="\\end"){e[e.length-1].length===0&&e.pop();break}else throw new Dt("Expected \\\\ or \\cr or \\end",t.nextToken)}for(var n=[],i=[n],a=0;aAV".includes(u))for(var d=0;d<2;d++){for(var f=!0,p=l+1;pAV=|." after @',s[l]);var g=WRe(u,h,t),m={type:"styling",body:[g],mode:"math",style:"display",resetFont:!0};n.push(m),o=VY()}a%2===0?n.push(o):n.shift(),n=[],i.push(n)}t.gullet.endGroup(),t.gullet.endGroup();var y=new Array(i[0].length).fill({type:"align",align:"c",pregap:.25,postgap:.25});return{type:"array",mode:"math",body:i,arraystretch:1,addJot:!0,rowGaps:[null],cols:y,colSeparationType:"CD",hLinesBeforeRow:new Array(i.length+1).fill([])}}Wt({type:"cdlabel",names:["\\\\cdleft","\\\\cdright"],props:{numArgs:1},handler(t,e){var{parser:r,funcName:n}=t;return{type:"cdlabel",mode:r.mode,side:n.slice(4),label:e[0]}},htmlBuilder(t,e){var r=e.havingStyle(e.style.sup()),n=cp(an(t.label,r,e),e);return n.classes.push("cd-label-"+t.side),n.style.bottom=$t(.8-n.depth),n.height=0,n.depth=0,n},mathmlBuilder(t,e){var r=new Mt("mrow",[Tn(t.label,e)]);return r=new Mt("mpadded",[r]),r.setAttribute("width","0"),t.side==="left"&&r.setAttribute("lspace","-1width"),r.setAttribute("voffset","0.7em"),r=new Mt("mstyle",[r]),r.setAttribute("displaystyle","false"),r.setAttribute("scriptlevel","1"),r}}),Wt({type:"cdlabelparent",names:["\\\\cdparent"],props:{numArgs:1},handler(t,e){var{parser:r}=t;return{type:"cdlabelparent",mode:r.mode,fragment:e[0]}},htmlBuilder(t,e){var r=cp(an(t.fragment,e),e);return r.classes.push("cd-vert-arrow"),r},mathmlBuilder(t,e){return new Mt("mrow",[Tn(t.fragment,e)])}}),Wt({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler(t,e){for(var{parser:r}=t,n=Or(e[0],"ordgroup"),i=n.body,a="",s=0;s=1114111)throw new Dt("\\@char with invalid code point "+a);return l<=65535?u=String.fromCharCode(l):(l-=65536,u=String.fromCharCode((l>>10)+55296,(l&1023)+56320)),{type:"textord",mode:r.mode,text:u}}});var UY=(t,e)=>{var r=Bi(t.body,e.withColor(t.color),!1);return Rc(r)},HY=(t,e)=>{var r=qs(t.body,e.withColor(t.color)),n=new Mt("mstyle",r);return n.setAttribute("mathcolor",t.color),n};Wt({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,argTypes:["color","original"]},handler(t,e){var{parser:r}=t,n=Or(e[0],"color-token").color,i=e[1];return{type:"color",mode:r.mode,color:n,body:Ei(i)}},htmlBuilder:UY,mathmlBuilder:HY}),Wt({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,argTypes:["color"]},handler(t,e){var{parser:r,breakOnTokenText:n}=t,i=Or(e[0],"color-token").color;r.gullet.macros.set("\\current@color",i);var a=r.parseExpression(!0,n);return{type:"color",mode:r.mode,color:i,body:a}},htmlBuilder:UY,mathmlBuilder:HY}),Wt({type:"cr",names:["\\\\"],props:{numArgs:0,numOptionalArgs:0,allowedInText:!0},handler(t,e,r){var{parser:n}=t,i=n.gullet.future().text==="["?n.parseSizeGroup(!0):null,a=!n.settings.displayMode||!n.settings.useStrictBehavior("newLineInDisplayMode","In LaTeX, \\\\ or \\newline does nothing in display mode");return{type:"cr",mode:n.mode,newLine:a,size:i&&Or(i,"size").value}},htmlBuilder(t,e){var r=Rt(["mspace"],[],e);return t.newLine&&(r.classes.push("newline"),t.size&&(r.style.marginTop=$t(Xn(t.size,e)))),r},mathmlBuilder(t,e){var r=new Mt("mspace");return t.newLine&&(r.setAttribute("linebreak","newline"),t.size&&r.setAttribute("height",$t(Xn(t.size,e)))),r}});var P7={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},YY=t=>{var e=t.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(e))throw new Dt("Expected a control sequence",t);return e},HRe=t=>{var e=t.gullet.popToken();return e.text==="="&&(e=t.gullet.popToken(),e.text===" "&&(e=t.gullet.popToken())),e},XY=(t,e,r,n)=>{var i=t.gullet.macros.get(r.text);i==null&&(r.noexpand=!0,i={tokens:[r],numArgs:0,unexpandable:!t.gullet.isExpandable(r.text)}),t.gullet.macros.set(e,i,n)};Wt({type:"internal",names:["\\global","\\long","\\\\globallong"],props:{numArgs:0,allowedInText:!0},handler(t){var{parser:e,funcName:r}=t;e.consumeSpaces();var n=e.fetch();if(P7[n.text])return(r==="\\global"||r==="\\\\globallong")&&(n.text=P7[n.text]),Or(e.parseFunction(),"internal");throw new Dt("Invalid token after macro prefix",n)}}),Wt({type:"internal",names:["\\def","\\gdef","\\edef","\\xdef"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t){var{parser:e,funcName:r}=t,n=e.gullet.popToken(),i=n.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(i))throw new Dt("Expected a control sequence",n);for(var a=0,s,o=[[]];e.gullet.future().text!=="{";)if(n=e.gullet.popToken(),n.text==="#"){if(e.gullet.future().text==="{"){s=e.gullet.future(),o[a].push("{");break}if(n=e.gullet.popToken(),!/^[1-9]$/.test(n.text))throw new Dt('Invalid argument number "'+n.text+'"');if(parseInt(n.text)!==a+1)throw new Dt('Argument number "'+n.text+'" out of order');a++,o.push([])}else{if(n.text==="EOF")throw new Dt("Expected a macro definition");o[a].push(n.text)}var{tokens:l}=e.gullet.consumeArg();return s&&l.unshift(s),(r==="\\edef"||r==="\\xdef")&&(l=e.gullet.expandTokens(l),l.reverse()),e.gullet.macros.set(i,{tokens:l,numArgs:a,delimiters:o},r===P7[r]),{type:"internal",mode:e.mode}}}),Wt({type:"internal",names:["\\let","\\\\globallet"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t){var{parser:e,funcName:r}=t,n=YY(e.gullet.popToken());e.gullet.consumeSpaces();var i=HRe(e);return XY(e,n,i,r==="\\\\globallet"),{type:"internal",mode:e.mode}}}),Wt({type:"internal",names:["\\futurelet","\\\\globalfuture"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t){var{parser:e,funcName:r}=t,n=YY(e.gullet.popToken()),i=e.gullet.popToken(),a=e.gullet.popToken();return XY(e,n,a,r==="\\\\globalfuture"),e.gullet.pushToken(a),e.gullet.pushToken(i),{type:"internal",mode:e.mode}}});var db=function(e,r,n){var i=Wn.math[e]&&Wn.math[e].replace,a=g7(i||e,r,n);if(!a)throw new Error("Unsupported symbol "+e+" and font size "+r+".");return a},B7=function(e,r,n,i){var a=n.havingBaseStyle(r),s=Rt(i.concat(a.sizingClasses(n)),[e],n),o=a.sizeMultiplier/n.sizeMultiplier;return s.height*=o,s.depth*=o,s.maxFontSize=a.sizeMultiplier,s},KY=function(e,r,n){var i=r.havingBaseStyle(n),a=(1-r.sizeMultiplier/i.sizeMultiplier)*r.fontMetrics().axisHeight;e.classes.push("delimcenter"),e.style.top=$t(a),e.height-=a,e.depth+=a},YRe=function(e,r,n,i,a,s){var o=Xa(e,"Main-Regular",a,i),l=B7(o,r,i,s);return KY(l,i,r),l},XRe=function(e,r,n,i){return Xa(e,"Size"+r+"-Regular",n,i)},jY=function(e,r,n,i,a,s){var o=XRe(e,r,a,i),l=B7(Rt(["delimsizing","size"+r],[o],i),Ir.TEXT,i,s);return n&&KY(l,i,Ir.TEXT),l},F7=function(e,r,n){var i;r==="Size1-Regular"?i="delim-size1":i="delim-size4";var a=Rt(["delimsizinginner",i],[Rt([],[Xa(e,r,n)])]);return{type:"elem",elem:a}},z7=function(e,r,n){var i=wl["Size4-Regular"][e.charCodeAt(0)]?wl["Size4-Regular"][e.charCodeAt(0)][4]:wl["Size1-Regular"][e.charCodeAt(0)][4],a=new Bu("inner",iRe(e,Math.round(1e3*r))),s=new Ac([a],{width:$t(i),height:$t(r),style:"width:"+$t(i),viewBox:"0 0 "+1e3*i+" "+Math.round(1e3*r),preserveAspectRatio:"xMinYMin"}),o=zu([],[s],n);return o.height=r,o.style.height=$t(r),o.style.width=$t(i),{type:"elem",elem:o}},G7=.008,NC={type:"kern",size:-1*G7},KRe=new Set(["|","\\lvert","\\rvert","\\vert"]),jRe=new Set(["\\|","\\lVert","\\rVert","\\Vert"]),ZY=function(e,r,n,i,a,s){var o,l,u,h,d="",f=0;o=u=h=e,l=null;var p="Size1-Regular";e==="\\uparrow"?u=h="⏐":e==="\\Uparrow"?u=h="‖":e==="\\downarrow"?o=u="⏐":e==="\\Downarrow"?o=u="‖":e==="\\updownarrow"?(o="\\uparrow",u="⏐",h="\\downarrow"):e==="\\Updownarrow"?(o="\\Uparrow",u="‖",h="\\Downarrow"):KRe.has(e)?(u="∣",d="vert",f=333):jRe.has(e)?(u="∥",d="doublevert",f=556):e==="["||e==="\\lbrack"?(o="⎡",u="⎢",h="⎣",p="Size4-Regular",d="lbrack",f=667):e==="]"||e==="\\rbrack"?(o="⎤",u="⎥",h="⎦",p="Size4-Regular",d="rbrack",f=667):e==="\\lfloor"||e==="⌊"?(u=o="⎢",h="⎣",p="Size4-Regular",d="lfloor",f=667):e==="\\lceil"||e==="⌈"?(o="⎡",u=h="⎢",p="Size4-Regular",d="lceil",f=667):e==="\\rfloor"||e==="⌋"?(u=o="⎥",h="⎦",p="Size4-Regular",d="rfloor",f=667):e==="\\rceil"||e==="⌉"?(o="⎤",u=h="⎥",p="Size4-Regular",d="rceil",f=667):e==="("||e==="\\lparen"?(o="⎛",u="⎜",h="⎝",p="Size4-Regular",d="lparen",f=875):e===")"||e==="\\rparen"?(o="⎞",u="⎟",h="⎠",p="Size4-Regular",d="rparen",f=875):e==="\\{"||e==="\\lbrace"?(o="⎧",l="⎨",h="⎩",u="⎪",p="Size4-Regular"):e==="\\}"||e==="\\rbrace"?(o="⎫",l="⎬",h="⎭",u="⎪",p="Size4-Regular"):e==="\\lgroup"||e==="⟮"?(o="⎧",h="⎩",u="⎪",p="Size4-Regular"):e==="\\rgroup"||e==="⟯"?(o="⎫",h="⎭",u="⎪",p="Size4-Regular"):e==="\\lmoustache"||e==="⎰"?(o="⎧",h="⎭",u="⎪",p="Size4-Regular"):(e==="\\rmoustache"||e==="⎱")&&(o="⎫",h="⎩",u="⎪",p="Size4-Regular");var g=db(o,p,a),m=g.height+g.depth,y=db(u,p,a),v=y.height+y.depth,T=db(h,p,a),b=T.height+T.depth,w=0,k=1;if(l!==null){var A=db(l,p,a);w=A.height+A.depth,k=2}var C=m+b+w,_=Math.max(0,Math.ceil((r-C)/(k*v))),L=C+_*k*v,O=i.fontMetrics().axisHeight;n&&(O*=i.sizeMultiplier);var M=L/2-O,z=[];if(d.length>0){var F=L-m-b,S=Math.round(L*1e3),R=aRe(d,Math.round(F*1e3)),N=new Bu(d,R),D=$t(f/1e3),I=$t(S/1e3),$=new Ac([N],{width:D,height:I,viewBox:"0 0 "+f+" "+S}),B=zu([],[$],i);B.height=S/1e3,B.style.width=D,B.style.height=I,z.push({type:"elem",elem:B})}else{if(z.push(F7(h,p,a)),z.push(NC),l===null){var P=L-m-b+2*G7;z.push(z7(u,P,i))}else{var G=(L-m-b-w)/2+2*G7;z.push(z7(u,G,i)),z.push(NC),z.push(F7(l,p,a)),z.push(NC),z.push(z7(u,G,i))}z.push(NC),z.push(F7(o,p,a))}var V=i.havingBaseStyle(Ir.TEXT),Y=nn({positionType:"bottom",positionData:M,children:z});return B7(Rt(["delimsizing","mult"],[Y],V),Ir.TEXT,i,s)},q7=80,V7=.08,W7=function(e,r,n,i,a){var s=nRe(e,i,n),o=new Bu(e,s),l=new Ac([o],{width:"400em",height:$t(r),viewBox:"0 0 400000 "+n,preserveAspectRatio:"xMinYMin slice"});return zu(["hide-tail"],[l],a)},ZRe=function(e,r){var n=r.havingBaseSizing(),i=rX("\\surd",e*n.sizeMultiplier,tX,n),a=n.sizeMultiplier,s=Math.max(0,r.minRuleThickness-r.fontMetrics().sqrtRuleThickness),o,l,u,h,d;return i.type==="small"?(h=1e3+1e3*s+q7,e<1?a=1:e<1.4&&(a=.7),l=(1+s+V7)/a,u=(1+s)/a,o=W7("sqrtMain",l,h,s,r),o.style.minWidth="0.853em",d=.833/a):i.type==="large"?(h=(1e3+q7)*fb[i.size],u=(fb[i.size]+s)/a,l=(fb[i.size]+s+V7)/a,o=W7("sqrtSize"+i.size,l,h,s,r),o.style.minWidth="1.02em",d=1/a):(l=e+s+V7,u=e+s,h=Math.floor(1e3*e+s)+q7,o=W7("sqrtTall",l,h,s,r),o.style.minWidth="0.742em",d=1.056),o.height=u,o.style.height=$t(l),{span:o,advanceWidth:d,ruleWidth:(r.fontMetrics().sqrtRuleThickness+s)*a}},QY=new Set(["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","\\surd"]),QRe=new Set(["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱"]),JY=new Set(["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"]),fb=[0,1.2,1.8,2.4,3],eX=function(e,r,n,i,a){if(e==="<"||e==="\\lt"||e==="⟨"?e="\\langle":(e===">"||e==="\\gt"||e==="⟩")&&(e="\\rangle"),QY.has(e)||JY.has(e))return jY(e,r,!1,n,i,a);if(QRe.has(e))return ZY(e,fb[r],!1,n,i,a);throw new Dt("Illegal delimiter: '"+e+"'")},JRe=[{type:"small",style:Ir.SCRIPTSCRIPT},{type:"small",style:Ir.SCRIPT},{type:"small",style:Ir.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],eLe=[{type:"small",style:Ir.SCRIPTSCRIPT},{type:"small",style:Ir.SCRIPT},{type:"small",style:Ir.TEXT},{type:"stack"}],tX=[{type:"small",style:Ir.SCRIPTSCRIPT},{type:"small",style:Ir.SCRIPT},{type:"small",style:Ir.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],tLe=function(e){if(e.type==="small")return"Main-Regular";if(e.type==="large")return"Size"+e.size+"-Regular";if(e.type==="stack")return"Size4-Regular";var r=e.type;throw new Error("Add support for delim type '"+r+"' here.")},rX=function(e,r,n,i){for(var a=Math.min(2,3-i.style.size),s=a;sr)return o}return n[n.length-1]},U7=function(e,r,n,i,a,s){e==="<"||e==="\\lt"||e==="⟨"?e="\\langle":(e===">"||e==="\\gt"||e==="⟩")&&(e="\\rangle");var o;JY.has(e)?o=JRe:QY.has(e)?o=tX:o=eLe;var l=rX(e,r,o,i);return l.type==="small"?YRe(e,l.style,n,i,a,s):l.type==="large"?jY(e,l.size,n,i,a,s):ZY(e,r,n,i,a,s)},H7=function(e,r,n,i,a,s){var o=i.fontMetrics().axisHeight*i.sizeMultiplier,l=901,u=5/i.fontMetrics().ptPerEm,h=Math.max(r-o,n+o),d=Math.max(h/500*l,2*h-u);return U7(e,d,!0,i,a,s)},nX={"\\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}},rLe=new Set(["(","\\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 iX(t){return"isMiddle"in t}function OC(t,e){var r=IC(t);if(r&&rLe.has(r.text))return r;throw r?new Dt("Invalid delimiter '"+r.text+"' after '"+e.funcName+"'",t):new Dt("Invalid delimiter type '"+t.type+"'",t)}Wt({type:"delimsizing",names:["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],props:{numArgs:1,argTypes:["primitive"]},handler:(t,e)=>{var r=OC(e[0],t);return{type:"delimsizing",mode:t.parser.mode,size:nX[t.funcName].size,mclass:nX[t.funcName].mclass,delim:r.text}},htmlBuilder:(t,e)=>t.delim==="."?Rt([t.mclass]):eX(t.delim,t.size,e,t.mode,[t.mclass]),mathmlBuilder:t=>{var e=[];t.delim!=="."&&e.push(lo(t.delim,t.mode));var r=new Mt("mo",e);t.mclass==="mopen"||t.mclass==="mclose"?r.setAttribute("fence","true"):r.setAttribute("fence","false"),r.setAttribute("stretchy","true");var n=$t(fb[t.size]);return r.setAttribute("minsize",n),r.setAttribute("maxsize",n),r}});function aX(t){if(!t.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}Wt({type:"leftright-right",names:["\\right"],props:{numArgs:1,primitive:!0},handler:(t,e)=>{var r=t.parser.gullet.macros.get("\\current@color");if(r&&typeof r!="string")throw new Dt("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:t.parser.mode,delim:OC(e[0],t).text,color:r}}}),Wt({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:(t,e)=>{var r=OC(e[0],t),n=t.parser;++n.leftrightDepth;var i=n.parseExpression(!1);--n.leftrightDepth,n.expect("\\right",!1);var a=Or(n.parseFunction(),"leftright-right");return{type:"leftright",mode:n.mode,body:i,left:r.text,right:a.delim,rightColor:a.color}},htmlBuilder:(t,e)=>{aX(t);for(var r=Bi(t.body,e,!0,["mopen","mclose"]),n=0,i=0,a=!1,s=0;s{aX(t);var r=qs(t.body,e);if(t.left!=="."){var n=new Mt("mo",[lo(t.left,t.mode)]);n.setAttribute("fence","true"),r.unshift(n)}if(t.right!=="."){var i=new Mt("mo",[lo(t.right,t.mode)]);i.setAttribute("fence","true"),t.rightColor&&i.setAttribute("mathcolor",t.rightColor),r.push(i)}return M7(r)}}),Wt({type:"middle",names:["\\middle"],props:{numArgs:1,primitive:!0},handler:(t,e)=>{var r=OC(e[0],t);if(!t.parser.leftrightDepth)throw new Dt("\\middle without preceding \\left",r);return{type:"middle",mode:t.parser.mode,delim:r.text}},htmlBuilder:(t,e)=>{var r;return t.delim==="."?r=hb(e,[]):(r=eX(t.delim,1,e,t.mode,[]),r.isMiddle={delim:t.delim,options:e}),r},mathmlBuilder:(t,e)=>{var r=t.delim==="\\vert"||t.delim==="|"?lo("|","text"):lo(t.delim,t.mode),n=new Mt("mo",[r]);return n.setAttribute("fence","true"),n.setAttribute("lspace","0.05em"),n.setAttribute("rspace","0.05em"),n}});var $C=(t,e)=>{var r=cp(an(t.body,e),e),n=t.label.slice(1),i=e.sizeMultiplier,a,s,o=Ec(t.body);if(n==="sout")a=Rt(["stretchy","sout"]),a.height=e.fontMetrics().defaultRuleThickness/i,s=-.5*e.fontMetrics().xHeight;else if(n==="phase"){var l=Xn({number:.6,unit:"pt"},e),u=Xn({number:.35,unit:"ex"},e),h=e.havingBaseSizing();i=i/h.sizeMultiplier;var d=r.height+r.depth+l+u;r.style.paddingLeft=$t(d/2+l);var f=Math.floor(1e3*d*i),p=tRe(f),g=new Ac([new Bu("phase",p)],{width:"400em",height:$t(f/1e3),viewBox:"0 0 400000 "+f,preserveAspectRatio:"xMinYMin slice"});a=zu(["hide-tail"],[g],e),a.style.height=$t(d),s=r.depth+l+u}else{/cancel/.test(n)?o||r.classes.push("cancel-pad"):n==="angl"?r.classes.push("anglpad"):r.classes.push("boxpad");var m,y,v=0;/box/.test(n)?(v=Math.max(e.fontMetrics().fboxrule,e.minRuleThickness),m=e.fontMetrics().fboxsep+(n==="colorbox"?0:v),y=m):n==="angl"?(v=Math.max(e.fontMetrics().defaultRuleThickness,e.minRuleThickness),m=4*v,y=Math.max(0,.25-r.depth)):(m=o?.2:0,y=m),a=PRe(r,n,m,y,e),/fbox|boxed|fcolorbox/.test(n)?(a.style.borderStyle="solid",a.style.borderWidth=$t(v)):n==="angl"&&v!==.049&&(a.style.borderTopWidth=$t(v),a.style.borderRightWidth=$t(v)),s=r.depth+y,t.backgroundColor&&(a.style.backgroundColor=t.backgroundColor,t.borderColor&&(a.style.borderColor=t.borderColor))}var T;if(t.backgroundColor)T=nn({positionType:"individualShift",children:[{type:"elem",elem:a,shift:s},{type:"elem",elem:r,shift:0}]});else{var b=/cancel|phase/.test(n)?["svg-align"]:[];T=nn({positionType:"individualShift",children:[{type:"elem",elem:r,shift:0},{type:"elem",elem:a,shift:s,wrapperClasses:b}]})}return/cancel/.test(n)&&(T.height=r.height,T.depth=r.depth),/cancel/.test(n)&&!o?Rt(["mord","cancel-lap"],[T],e):Rt(["mord"],[T],e)},PC=(t,e)=>{var r,n=new Mt(t.label.includes("colorbox")?"mpadded":"menclose",[Tn(t.body,e)]);switch(t.label){case"\\cancel":n.setAttribute("notation","updiagonalstrike");break;case"\\bcancel":n.setAttribute("notation","downdiagonalstrike");break;case"\\phase":n.setAttribute("notation","phasorangle");break;case"\\sout":n.setAttribute("notation","horizontalstrike");break;case"\\fbox":n.setAttribute("notation","box");break;case"\\angl":n.setAttribute("notation","actuarial");break;case"\\fcolorbox":case"\\colorbox":if(r=e.fontMetrics().fboxsep*e.fontMetrics().ptPerEm,n.setAttribute("width","+"+2*r+"pt"),n.setAttribute("height","+"+2*r+"pt"),n.setAttribute("lspace",r+"pt"),n.setAttribute("voffset",r+"pt"),t.label==="\\fcolorbox"){var i=Math.max(e.fontMetrics().fboxrule,e.minRuleThickness);n.setAttribute("style","border: "+$t(i)+" solid "+t.borderColor)}break;case"\\xcancel":n.setAttribute("notation","updiagonalstrike downdiagonalstrike");break}return t.backgroundColor&&n.setAttribute("mathbackground",t.backgroundColor),n};Wt({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,argTypes:["color","hbox"]},handler(t,e,r){var{parser:n,funcName:i}=t,a=Or(e[0],"color-token").color,s=e[1];return{type:"enclose",mode:n.mode,label:i,backgroundColor:a,body:s}},htmlBuilder:$C,mathmlBuilder:PC}),Wt({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,argTypes:["color","color","hbox"]},handler(t,e,r){var{parser:n,funcName:i}=t,a=Or(e[0],"color-token").color,s=Or(e[1],"color-token").color,o=e[2];return{type:"enclose",mode:n.mode,label:i,backgroundColor:s,borderColor:a,body:o}},htmlBuilder:$C,mathmlBuilder:PC}),Wt({type:"enclose",names:["\\fbox"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!0},handler(t,e){var{parser:r}=t;return{type:"enclose",mode:r.mode,label:"\\fbox",body:e[0]}}}),Wt({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\phase"],props:{numArgs:1},handler(t,e){var{parser:r,funcName:n}=t,i=e[0];return{type:"enclose",mode:r.mode,label:n,body:i}},htmlBuilder:$C,mathmlBuilder:PC}),Wt({type:"enclose",names:["\\sout"],props:{numArgs:1,allowedInText:!0},handler(t,e){var{parser:r,funcName:n}=t;r.mode==="math"&&r.settings.reportNonstrict("mathVsSout","LaTeX's \\sout works only in text mode");var i=e[0];return{type:"enclose",mode:r.mode,label:n,body:i}},htmlBuilder:$C,mathmlBuilder:PC}),Wt({type:"enclose",names:["\\angl"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!1},handler(t,e){var{parser:r}=t;return{type:"enclose",mode:r.mode,label:"\\angl",body:e[0]}}});var sX={};function Cl(t){for(var{type:e,names:r,props:n,handler:i,htmlBuilder:a,mathmlBuilder:s}=t,o={type:e,numArgs:n.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:i},l=0;l{var e=t.parser.settings;if(!e.displayMode)throw new Dt("{"+t.envName+"} can be used only in display mode.")},nLe=new Set(["gather","gather*"]);function Y7(t){if(!t.includes("ed"))return!t.includes("*")}function qu(t,e,r){var{hskipBeforeAndAfter:n,addJot:i,cols:a,arraystretch:s,colSeparationType:o,autoTag:l,singleRow:u,emptySingleRow:h,maxNumCols:d,leqno:f}=e;if(t.gullet.beginGroup(),u||t.gullet.macros.set("\\cr","\\\\\\relax"),!s){var p=t.gullet.expandMacroAsText("\\arraystretch");if(p==null)s=1;else if(s=parseFloat(p),!s||s<0)throw new Dt("Invalid \\arraystretch: "+p)}t.gullet.beginGroup();var g=[],m=[g],y=[],v=[],T=l!=null?[]:void 0;function b(){l&&t.gullet.macros.set("\\@eqnsw","1",!0)}function w(){T&&(t.gullet.macros.get("\\df@tag")?(T.push(t.subparse([new Vs("\\df@tag")])),t.gullet.macros.set("\\df@tag",void 0,!0)):T.push(!!l&&t.gullet.macros.get("\\@eqnsw")==="1"))}for(b(),v.push(lX(t));;){var k=t.parseExpression(!1,u?"\\end":"\\\\");t.gullet.endGroup(),t.gullet.beginGroup();var A={type:"ordgroup",mode:t.mode,body:k};r&&(A={type:"styling",mode:t.mode,style:r,resetFont:!0,body:[A]}),g.push(A);var C=t.fetch().text;if(C==="&"){if(d&&g.length===d){if(u||o)throw new Dt("Too many tab characters: &",t.nextToken);t.settings.reportNonstrict("textEnv","Too few columns specified in the {array} column argument.")}t.consume()}else if(C==="\\end"){w(),g.length===1&&A.type==="styling"&&A.body.length===1&&A.body[0].type==="ordgroup"&&A.body[0].body.length===0&&(m.length>1||!h)&&m.pop(),v.length0&&(b+=.25),u.push({pos:b,isDashed:je[Ce]})}for(w(s[0]),n=0;n0&&(M+=T,Cje))for(n=0;n=o)){var J=void 0;if(i>0||e.hskipBeforeAndAfter){var Z,ee;J=(Z=(ee=V)==null?void 0:ee.pregap)!=null?Z:f,J!==0&&(R=Rt(["arraycolsep"],[]),R.style.width=$t(J),S.push(R))}var ne=[];for(n=0;n0){for(var Te=lp("hline",r,h),Ze=lp("hdashline",r,h),ke=[{type:"elem",elem:Ge,shift:0}];u.length>0;){var Ve=u.pop(),Qe=Ve.pos-z;Ve.isDashed?ke.push({type:"elem",elem:Ze,shift:Qe}):ke.push({type:"elem",elem:Te,shift:Qe})}Ge=nn({positionType:"individualShift",children:ke})}if(D.length===0)return Rt(["mord"],[Ge],r);var nt=nn({positionType:"individualShift",children:D}),tt=Rt(["tag"],[nt],r);return Rc([Ge,tt])},iLe={c:"center ",l:"left ",r:"right "},El=function(e,r){for(var n=[],i=new Mt("mtd",[],["mtr-glue"]),a=new Mt("mtd",[],["mml-eqn-num"]),s=0;s0){var g=e.cols,m="",y=!1,v=0,T=g.length;g[0].type==="separator"&&(f+="top ",v=1),g[g.length-1].type==="separator"&&(f+="bottom ",T-=1);for(var b=v;b0?"left ":"",f+=L[L.length-1].length>0?"right ":"";for(var O=1;O0&&p&&(y=1),n[g]={type:"align",align:m,pregap:y,postgap:0}}return s.colSeparationType=p?"align":"alignat",s};Cl({type:"array",names:["array","darray"],props:{numArgs:1},handler(t,e){var r=IC(e[0]),n=r?[e[0]]:Or(e[0],"ordgroup").body,i=n.map(function(s){var o=LC(s),l=o.text;if("lcr".includes(l))return{type:"align",align:l};if(l==="|")return{type:"separator",separator:"|"};if(l===":")return{type:"separator",separator:":"};throw new Dt("Unknown column alignment: "+l,s)}),a={cols:i,hskipBeforeAndAfter:!0,maxNumCols:i.length};return qu(t.parser,a,X7(t.envName))},htmlBuilder:kl,mathmlBuilder:El}),Cl({type:"array",names:["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],props:{numArgs:0},handler(t){var e={matrix:null,pmatrix:["(",")"],bmatrix:["[","]"],Bmatrix:["\\{","\\}"],vmatrix:["|","|"],Vmatrix:["\\Vert","\\Vert"]}[t.envName.replace("*","")],r="c",n={hskipBeforeAndAfter:!1,cols:[{type:"align",align:r}]};if(t.envName.charAt(t.envName.length-1)==="*"){var i=t.parser;if(i.consumeSpaces(),i.fetch().text==="["){if(i.consume(),i.consumeSpaces(),r=i.fetch().text,!"lcr".includes(r))throw new Dt("Expected l or c or r",i.nextToken);i.consume(),i.consumeSpaces(),i.expect("]"),i.consume(),n.cols=[{type:"align",align:r}]}}var a=qu(t.parser,n,X7(t.envName)),s=Math.max(0,...a.body.map(o=>o.length));return a.cols=new Array(s).fill({type:"align",align:r}),e?{type:"leftright",mode:t.mode,body:[a],left:e[0],right:e[1],rightColor:void 0}:a},htmlBuilder:kl,mathmlBuilder:El}),Cl({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(t){var e={arraystretch:.5},r=qu(t.parser,e,"script");return r.colSeparationType="small",r},htmlBuilder:kl,mathmlBuilder:El}),Cl({type:"array",names:["subarray"],props:{numArgs:1},handler(t,e){var r=IC(e[0]),n=r?[e[0]]:Or(e[0],"ordgroup").body,i=n.map(function(o){var l=LC(o),u=l.text;if("lc".includes(u))return{type:"align",align:u};throw new Dt("Unknown column alignment: "+u,o)});if(i.length>1)throw new Dt("{subarray} can contain only one column");var a={cols:i,hskipBeforeAndAfter:!1,arraystretch:.5},s=qu(t.parser,a,"script");if(s.body.length>0&&s.body[0].length>1)throw new Dt("{subarray} can contain only one column");return s},htmlBuilder:kl,mathmlBuilder:El}),Cl({type:"array",names:["cases","dcases","rcases","drcases"],props:{numArgs:0},handler(t){var e={arraystretch:1.2,cols:[{type:"align",align:"l",pregap:0,postgap:1},{type:"align",align:"l",pregap:0,postgap:0}]},r=qu(t.parser,e,X7(t.envName));return{type:"leftright",mode:t.mode,body:[r],left:t.envName.includes("r")?".":"\\{",right:t.envName.includes("r")?"\\}":".",rightColor:void 0}},htmlBuilder:kl,mathmlBuilder:El}),Cl({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:cX,htmlBuilder:kl,mathmlBuilder:El}),Cl({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(t){nLe.has(t.envName)&&BC(t);var e={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:Y7(t.envName),emptySingleRow:!0,leqno:t.parser.settings.leqno};return qu(t.parser,e,"display")},htmlBuilder:kl,mathmlBuilder:El}),Cl({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:cX,htmlBuilder:kl,mathmlBuilder:El}),Cl({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(t){BC(t);var e={autoTag:Y7(t.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:t.parser.settings.leqno};return qu(t.parser,e,"display")},htmlBuilder:kl,mathmlBuilder:El}),Cl({type:"array",names:["CD"],props:{numArgs:0},handler(t){return BC(t),URe(t.parser)},htmlBuilder:kl,mathmlBuilder:El}),ge("\\nonumber","\\gdef\\@eqnsw{0}"),ge("\\notag","\\nonumber"),Wt({type:"text",names:["\\hline","\\hdashline"],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler(t,e){throw new Dt(t.funcName+" valid only within array environment")}});var uX=sX;Wt({type:"environment",names:["\\begin","\\end"],props:{numArgs:1,argTypes:["text"]},handler(t,e){var{parser:r,funcName:n}=t,i=e[0];if(i.type!=="ordgroup")throw new Dt("Invalid environment name",i);for(var a="",s=0;s{var r=t.font,n=e.withFont(r);return an(t.body,n)},dX=(t,e)=>{var r=t.font,n=e.withFont(r);return Tn(t.body,n)},fX={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak"};Wt({type:"font",names:["\\mathrm","\\mathit","\\mathbf","\\mathnormal","\\mathsfit","\\mathbb","\\mathcal","\\mathfrak","\\mathscr","\\mathsf","\\mathtt","\\Bbb","\\bold","\\frak"],props:{numArgs:1,allowedInArgument:!0},handler:(t,e)=>{var{parser:r,funcName:n}=t,i=SC(e[0]),a=n;return a in fX&&(a=fX[a]),{type:"font",mode:r.mode,font:a.slice(1),body:i}},htmlBuilder:hX,mathmlBuilder:dX}),Wt({type:"mclass",names:["\\boldsymbol","\\bm"],props:{numArgs:1},handler:(t,e)=>{var{parser:r}=t,n=e[0];return{type:"mclass",mode:r.mode,mclass:MC(n),body:[{type:"font",mode:r.mode,font:"boldsymbol",body:n}],isCharacterBox:Ec(n)}}}),Wt({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it","\\cal"],props:{numArgs:0,allowedInText:!0},handler:(t,e)=>{var{parser:r,funcName:n,breakOnTokenText:i}=t,{mode:a}=r,s=r.parseExpression(!0,i);return{type:"font",mode:a,font:"math"+n.slice(1),body:{type:"ordgroup",mode:r.mode,body:s}}},htmlBuilder:hX,mathmlBuilder:dX});var aLe=(t,e)=>{var r=e.style,n=r.fracNum(),i=r.fracDen(),a;a=e.havingStyle(n);var s=an(t.numer,a,e);if(t.continued){var o=8.5/e.fontMetrics().ptPerEm,l=3.5/e.fontMetrics().ptPerEm;s.height=s.height0?g=3*f:g=7*f,m=e.fontMetrics().denom1):(d>0?(p=e.fontMetrics().num2,g=f):(p=e.fontMetrics().num3,g=3*f),m=e.fontMetrics().denom2);var y;if(h){var T=e.fontMetrics().axisHeight;p-s.depth-(T+.5*d){var r=new Mt("mfrac",[Tn(t.numer,e),Tn(t.denom,e)]);if(!t.hasBarLine)r.setAttribute("linethickness","0px");else if(t.barSize){var n=Xn(t.barSize,e);r.setAttribute("linethickness",$t(n))}if(t.leftDelim!=null||t.rightDelim!=null){var i=[];if(t.leftDelim!=null){var a=new Mt("mo",[new Si(t.leftDelim.replace("\\",""))]);a.setAttribute("fence","true"),i.push(a)}if(i.push(r),t.rightDelim!=null){var s=new Mt("mo",[new Si(t.rightDelim.replace("\\",""))]);s.setAttribute("fence","true"),i.push(s)}return M7(i)}return r},pX=(t,e)=>{if(!e)return t;var r={type:"styling",mode:t.mode,style:e,body:[t]};return r};Wt({type:"genfrac",names:["\\cfrac","\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac","\\\\bracefrac","\\\\brackfrac"],props:{numArgs:2,allowedInArgument:!0},handler:(t,e)=>{var{parser:r,funcName:n}=t,i=e[0],a=e[1],s,o=null,l=null;switch(n){case"\\cfrac":case"\\dfrac":case"\\frac":case"\\tfrac":s=!0;break;case"\\\\atopfrac":s=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":s=!1,o="(",l=")";break;case"\\\\bracefrac":s=!1,o="\\{",l="\\}";break;case"\\\\brackfrac":s=!1,o="[",l="]";break;default:throw new Error("Unrecognized genfrac command")}var u=n==="\\cfrac",h=null;return u||n.startsWith("\\d")?h="display":n.startsWith("\\t")&&(h="text"),pX({type:"genfrac",mode:r.mode,numer:i,denom:a,continued:u,hasBarLine:s,leftDelim:o,rightDelim:l,barSize:null},h)},htmlBuilder:aLe,mathmlBuilder:sLe}),Wt({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],props:{numArgs:0,infix:!0},handler(t){var{parser:e,funcName:r,token:n}=t,i;switch(r){case"\\over":i="\\frac";break;case"\\choose":i="\\binom";break;case"\\atop":i="\\\\atopfrac";break;case"\\brace":i="\\\\bracefrac";break;case"\\brack":i="\\\\brackfrac";break;default:throw new Error("Unrecognized infix genfrac command")}return{type:"infix",mode:e.mode,replaceWith:i,token:n}}});var gX=["display","text","script","scriptscript"],mX=function(e){var r=null;return e.length>0&&(r=e,r=r==="."?null:r),r};Wt({type:"genfrac",names:["\\genfrac"],props:{numArgs:6,allowedInArgument:!0,argTypes:["math","math","size","text","math","math"]},handler(t,e){var{parser:r}=t,n=e[4],i=e[5],a=SC(e[0]),s=a.type==="atom"&&a.family==="open"?mX(a.text):null,o=SC(e[1]),l=o.type==="atom"&&o.family==="close"?mX(o.text):null,u=Or(e[2],"size"),h,d=null;u.isBlank?h=!0:(d=u.value,h=d.number>0);var f=null,p=e[3];if(p.type==="ordgroup"){if(p.body.length>0){var g=Or(p.body[0],"textord");f=gX[Number(g.text)]}}else p=Or(p,"textord"),f=gX[Number(p.text)];return pX({type:"genfrac",mode:r.mode,numer:n,denom:i,continued:!1,hasBarLine:h,barSize:d,leftDelim:s,rightDelim:l},f)}}),Wt({type:"infix",names:["\\above"],props:{numArgs:1,argTypes:["size"],infix:!0},handler(t,e){var{parser:r,funcName:n,token:i}=t;return{type:"infix",mode:r.mode,replaceWith:"\\\\abovefrac",size:Or(e[0],"size").value,token:i}}}),Wt({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:(t,e)=>{var{parser:r,funcName:n}=t,i=e[0],a=Or(e[1],"infix").size;if(!a)throw new Error("\\\\abovefrac expected size, but got "+String(a));var s=e[2],o=a.number>0;return{type:"genfrac",mode:r.mode,numer:i,denom:s,continued:!1,hasBarLine:o,barSize:a,leftDelim:null,rightDelim:null}}});var yX=(t,e)=>{var r=e.style,n,i;t.type==="supsub"?(n=t.sup?an(t.sup,e.havingStyle(r.sup()),e):an(t.sub,e.havingStyle(r.sub()),e),i=Or(t.base,"horizBrace")):i=Or(t,"horizBrace");var a=an(i.base,e.havingBaseStyle(Ir.DISPLAY)),s=RC(i,e),o;if(i.isOver?o=nn({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"kern",size:.1},{type:"elem",elem:s,wrapperClasses:["svg-align"]}]}):o=nn({positionType:"bottom",positionData:a.depth+.1+s.height,children:[{type:"elem",elem:s,wrapperClasses:["svg-align"]},{type:"kern",size:.1},{type:"elem",elem:a}]}),n){var l=Rt(["minner",i.isOver?"mover":"munder"],[o],e);i.isOver?o=nn({positionType:"firstBaseline",children:[{type:"elem",elem:l},{type:"kern",size:.2},{type:"elem",elem:n}]}):o=nn({positionType:"bottom",positionData:l.depth+.2+n.height+n.depth,children:[{type:"elem",elem:n},{type:"kern",size:.2},{type:"elem",elem:l}]})}return Rt(["minner",i.isOver?"mover":"munder"],[o],e)},oLe=(t,e)=>{var r=_C(t.label);return new Mt(t.isOver?"mover":"munder",[Tn(t.base,e),r])};Wt({type:"horizBrace",names:["\\overbrace","\\underbrace","\\overbracket","\\underbracket"],props:{numArgs:1},handler(t,e){var{parser:r,funcName:n}=t;return{type:"horizBrace",mode:r.mode,label:n,isOver:n.includes("\\over"),base:e[0]}},htmlBuilder:yX,mathmlBuilder:oLe}),Wt({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:(t,e)=>{var{parser:r}=t,n=e[1],i=Or(e[0],"url").url;return r.settings.isTrusted({command:"\\href",url:i})?{type:"href",mode:r.mode,href:i,body:Ei(n)}:r.formatUnsupportedCmd("\\href")},htmlBuilder:(t,e)=>{var r=Bi(t.body,e,!1);return xRe(t.href,[],r,e)},mathmlBuilder:(t,e)=>{var r=Gu(t.body,e);return r instanceof Mt||(r=new Mt("mrow",[r])),r.setAttribute("href",t.href),r}}),Wt({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:(t,e)=>{var{parser:r}=t,n=Or(e[0],"url").url;if(!r.settings.isTrusted({command:"\\url",url:n}))return r.formatUnsupportedCmd("\\url");for(var i=[],a=0;a{var{parser:r,funcName:n,token:i}=t,a=Or(e[0],"raw").string,s=e[1];r.settings.strict&&r.settings.reportNonstrict("htmlExtension","HTML extension is disabled on strict mode");var o,l={};switch(n){case"\\htmlClass":l.class=a,o={command:"\\htmlClass",class:a};break;case"\\htmlId":l.id=a,o={command:"\\htmlId",id:a};break;case"\\htmlStyle":l.style=a,o={command:"\\htmlStyle",style:a};break;case"\\htmlData":{for(var u=a.split(","),h=0;h{var r=Bi(t.body,e,!1),n=["enclosing"];t.attributes.class&&n.push(...t.attributes.class.trim().split(/\s+/));var i=Rt(n,r,e);for(var a in t.attributes)a!=="class"&&t.attributes.hasOwnProperty(a)&&i.setAttribute(a,t.attributes[a]);return i},mathmlBuilder:(t,e)=>Gu(t.body,e)}),Wt({type:"htmlmathml",names:["\\html@mathml"],props:{numArgs:2,allowedInArgument:!0,allowedInText:!0},handler:(t,e)=>{var{parser:r}=t;return{type:"htmlmathml",mode:r.mode,html:Ei(e[0]),mathml:Ei(e[1])}},htmlBuilder:(t,e)=>{var r=Bi(t.html,e,!1);return Rc(r)},mathmlBuilder:(t,e)=>Gu(t.mathml,e)});var K7=function(e){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(e))return{number:+e,unit:"bp"};var r=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(e);if(!r)throw new Dt("Invalid size: '"+e+"' in \\includegraphics");var n={number:+(r[1]+r[2]),unit:r[3]};if(!lY(n))throw new Dt("Invalid unit: '"+n.unit+"' in \\includegraphics.");return n};Wt({type:"includegraphics",names:["\\includegraphics"],props:{numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1},handler:(t,e,r)=>{var{parser:n}=t,i={number:0,unit:"em"},a={number:.9,unit:"em"},s={number:0,unit:"em"},o="";if(r[0])for(var l=Or(r[0],"raw").string,u=l.split(","),h=0;h{var r=Xn(t.height,e),n=0;t.totalheight.number>0&&(n=Xn(t.totalheight,e)-r);var i=0;t.width.number>0&&(i=Xn(t.width,e));var a={height:$t(r+n)};i>0&&(a.width=$t(i)),n>0&&(a.verticalAlign=$t(-n));var s=new cRe(t.src,t.alt,a);return s.height=r,s.depth=n,s},mathmlBuilder:(t,e)=>{var r=new Mt("mglyph",[]);r.setAttribute("alt",t.alt);var n=Xn(t.height,e),i=0;if(t.totalheight.number>0&&(i=Xn(t.totalheight,e)-n,r.setAttribute("valign",$t(-i))),r.setAttribute("height",$t(n+i)),t.width.number>0){var a=Xn(t.width,e);r.setAttribute("width",$t(a))}return r.setAttribute("src",t.src),r}}),Wt({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],props:{numArgs:1,argTypes:["size"],primitive:!0,allowedInText:!0},handler(t,e){var{parser:r,funcName:n}=t,i=Or(e[0],"size");if(r.settings.strict){var a=n[1]==="m",s=i.value.unit==="mu";a?(s||r.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+n+" supports only mu units, "+("not "+i.value.unit+" units")),r.mode!=="math"&&r.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+n+" works only in math mode")):s&&r.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+n+" doesn't support mu units")}return{type:"kern",mode:r.mode,dimension:i.value}},htmlBuilder(t,e){return AY(t.dimension,e)},mathmlBuilder(t,e){var r=Xn(t.dimension,e);return new MY(r)}}),Wt({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],props:{numArgs:1,allowedInText:!0},handler:(t,e)=>{var{parser:r,funcName:n}=t,i=e[0];return{type:"lap",mode:r.mode,alignment:n.slice(5),body:i}},htmlBuilder:(t,e)=>{var r;t.alignment==="clap"?(r=Rt([],[an(t.body,e)]),r=Rt(["inner"],[r],e)):r=Rt(["inner"],[an(t.body,e)]);var n=Rt(["fix"],[]),i=Rt([t.alignment],[r,n],e),a=Rt(["strut"]);return a.style.height=$t(i.height+i.depth),i.depth&&(a.style.verticalAlign=$t(-i.depth)),i.children.unshift(a),i=Rt(["thinbox"],[i],e),Rt(["mord","vbox"],[i],e)},mathmlBuilder:(t,e)=>{var r=new Mt("mpadded",[Tn(t.body,e)]);if(t.alignment!=="rlap"){var n=t.alignment==="llap"?"-1":"-0.5";r.setAttribute("lspace",n+"width")}return r.setAttribute("width","0px"),r}}),Wt({type:"styling",names:["\\(","$"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(t,e){var{funcName:r,parser:n}=t,i=n.mode;n.switchMode("math");var a=r==="\\("?"\\)":"$",s=n.parseExpression(!1,a);return n.expect(a),n.switchMode(i),{type:"styling",mode:n.mode,style:"text",resetFont:!0,body:s}}}),Wt({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(t,e){throw new Dt("Mismatched "+t.funcName)}});var vX=(t,e)=>{switch(e.style.size){case Ir.DISPLAY.size:return t.display;case Ir.TEXT.size:return t.text;case Ir.SCRIPT.size:return t.script;case Ir.SCRIPTSCRIPT.size:return t.scriptscript;default:return t.text}};Wt({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4,primitive:!0},handler:(t,e)=>{var{parser:r}=t;return{type:"mathchoice",mode:r.mode,display:Ei(e[0]),text:Ei(e[1]),script:Ei(e[2]),scriptscript:Ei(e[3])}},htmlBuilder:(t,e)=>{var r=vX(t,e),n=Bi(r,e,!1);return Rc(n)},mathmlBuilder:(t,e)=>{var r=vX(t,e);return Gu(r,e)}});var bX=(t,e,r,n,i,a,s)=>{t=Rt([],[t]);var o=r&&Ec(r),l,u;if(e){var h=an(e,n.havingStyle(i.sup()),n);u={elem:h,kern:Math.max(n.fontMetrics().bigOpSpacing1,n.fontMetrics().bigOpSpacing3-h.depth)}}if(r){var d=an(r,n.havingStyle(i.sub()),n);l={elem:d,kern:Math.max(n.fontMetrics().bigOpSpacing2,n.fontMetrics().bigOpSpacing4-d.height)}}var f;if(u&&l){var p=n.fontMetrics().bigOpSpacing5+l.elem.height+l.elem.depth+l.kern+t.depth+s;f=nn({positionType:"bottom",positionData:p,children:[{type:"kern",size:n.fontMetrics().bigOpSpacing5},{type:"elem",elem:l.elem,marginLeft:$t(-a)},{type:"kern",size:l.kern},{type:"elem",elem:t},{type:"kern",size:u.kern},{type:"elem",elem:u.elem,marginLeft:$t(a)},{type:"kern",size:n.fontMetrics().bigOpSpacing5}]})}else if(l){var g=t.height-s;f=nn({positionType:"top",positionData:g,children:[{type:"kern",size:n.fontMetrics().bigOpSpacing5},{type:"elem",elem:l.elem,marginLeft:$t(-a)},{type:"kern",size:l.kern},{type:"elem",elem:t}]})}else if(u){var m=t.depth+s;f=nn({positionType:"bottom",positionData:m,children:[{type:"elem",elem:t},{type:"kern",size:u.kern},{type:"elem",elem:u.elem,marginLeft:$t(a)},{type:"kern",size:n.fontMetrics().bigOpSpacing5}]})}else return t;var y=[f];if(l&&a!==0&&!o){var v=Rt(["mspace"],[],n);v.style.marginRight=$t(a),y.unshift(v)}return Rt(["mop","op-limits"],y,n)},xX=new Set(["\\smallint"]),up=(t,e)=>{var r,n,i=!1,a;t.type==="supsub"?(r=t.sup,n=t.sub,a=Or(t.base,"op"),i=!0):a=Or(t,"op");var s=e.style,o=!1;s.size===Ir.DISPLAY.size&&a.symbol&&!xX.has(a.name)&&(o=!0);var l,u;if(a.symbol){var h=o?"Size2-Regular":"Size1-Regular",d="";if((a.name==="\\oiint"||a.name==="\\oiiint")&&(d=a.name.slice(1),a.name=d==="oiint"?"\\iint":"\\iiint"),l=Xa(a.name,h,"math",e,["mop","op-symbol",o?"large-op":"small-op"]),u=l.italic,d.length>0){var f=RY(d+"Size"+(o?"2":"1"),e);l=nn({positionType:"individualShift",children:[{type:"elem",elem:l,shift:0},{type:"elem",elem:f,shift:o?.08:0}]}),a.name="\\"+d,l.classes.unshift("mop"),l.italic=u}}else if(a.body){var p=Bi(a.body,e,!0);p.length===1&&p[0]instanceof zs?(l=p[0],l.classes[0]="mop"):l=Rt(["mop"],p,e)}else{for(var g=[],m=1;m{var r;if(t.symbol)r=new Mt("mo",[lo(t.name,t.mode)]),xX.has(t.name)&&r.setAttribute("largeop","false");else if(t.body)r=new Mt("mo",qs(t.body,e));else{r=new Mt("mi",[new Si(t.name.slice(1))]);var n=new Mt("mo",[lo("⁡","text")]);t.parentIsSupSub?r=new Mt("mrow",[r,n]):r=DY([r,n])}return r},lLe={"∏":"\\prod","∐":"\\coprod","∑":"\\sum","⋀":"\\bigwedge","⋁":"\\bigvee","⋂":"\\bigcap","⋃":"\\bigcup","⨀":"\\bigodot","⨁":"\\bigoplus","⨂":"\\bigotimes","⨄":"\\biguplus","⨆":"\\bigsqcup"};Wt({type:"op",names:["\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigcap","\\bigcup","\\intop","\\prod","\\sum","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","∏","∐","∑","⋀","⋁","⋂","⋃","⨀","⨁","⨂","⨄","⨆"],props:{numArgs:0},handler:(t,e)=>{var{parser:r,funcName:n}=t,i=n;return i.length===1&&(i=lLe[i]),{type:"op",mode:r.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:i}},htmlBuilder:up,mathmlBuilder:pb}),Wt({type:"op",names:["\\mathop"],props:{numArgs:1,primitive:!0},handler:(t,e)=>{var{parser:r}=t,n=e[0];return{type:"op",mode:r.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:Ei(n)}},htmlBuilder:up,mathmlBuilder:pb});var cLe={"∫":"\\int","∬":"\\iint","∭":"\\iiint","∮":"\\oint","∯":"\\oiint","∰":"\\oiiint"};Wt({type:"op",names:["\\arcsin","\\arccos","\\arctan","\\arctg","\\arcctg","\\arg","\\ch","\\cos","\\cosec","\\cosh","\\cot","\\cotg","\\coth","\\csc","\\ctg","\\cth","\\deg","\\dim","\\exp","\\hom","\\ker","\\lg","\\ln","\\log","\\sec","\\sin","\\sinh","\\sh","\\tan","\\tanh","\\tg","\\th"],props:{numArgs:0},handler(t){var{parser:e,funcName:r}=t;return{type:"op",mode:e.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:r}},htmlBuilder:up,mathmlBuilder:pb}),Wt({type:"op",names:["\\det","\\gcd","\\inf","\\lim","\\max","\\min","\\Pr","\\sup"],props:{numArgs:0},handler(t){var{parser:e,funcName:r}=t;return{type:"op",mode:e.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:r}},htmlBuilder:up,mathmlBuilder:pb}),Wt({type:"op",names:["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","∫","∬","∭","∮","∯","∰"],props:{numArgs:0,allowedInArgument:!0},handler(t){var{parser:e,funcName:r}=t,n=r;return n.length===1&&(n=cLe[n]),{type:"op",mode:e.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:n}},htmlBuilder:up,mathmlBuilder:pb});var TX=(t,e)=>{var r,n,i=!1,a;t.type==="supsub"?(r=t.sup,n=t.sub,a=Or(t.base,"operatorname"),i=!0):a=Or(t,"operatorname");var s;if(a.body.length>0){for(var o=a.body.map(d=>{var f="text"in d?d.text:void 0;return typeof f=="string"?{type:"textord",mode:d.mode,text:f}:d}),l=Bi(o,e.withFont("mathrm"),!0),u=0;u{for(var r=qs(t.body,e.withFont("mathrm")),n=!0,i=0;ih.toText()).join("");r=[new Si(o)]}var l=new Mt("mi",r);l.setAttribute("mathvariant","normal");var u=new Mt("mo",[lo("⁡","text")]);return t.parentIsSupSub?new Mt("mrow",[l,u]):DY([l,u])};Wt({type:"operatorname",names:["\\operatorname@","\\operatornamewithlimits"],props:{numArgs:1},handler:(t,e)=>{var{parser:r,funcName:n}=t,i=e[0];return{type:"operatorname",mode:r.mode,body:Ei(i),alwaysHandleSupSub:n==="\\operatornamewithlimits",limits:!1,parentIsSupSub:!1}},htmlBuilder:TX,mathmlBuilder:uLe}),ge("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@"),vd({type:"ordgroup",htmlBuilder(t,e){return t.semisimple?Rc(Bi(t.body,e,!1)):Rt(["mord"],Bi(t.body,e,!0),e)},mathmlBuilder(t,e){return Gu(t.body,e,!0)}}),Wt({type:"overline",names:["\\overline"],props:{numArgs:1},handler(t,e){var{parser:r}=t,n=e[0];return{type:"overline",mode:r.mode,body:n}},htmlBuilder(t,e){var r=an(t.body,e.havingCrampedStyle()),n=lp("overline-line",e),i=e.fontMetrics().defaultRuleThickness,a=nn({positionType:"firstBaseline",children:[{type:"elem",elem:r},{type:"kern",size:3*i},{type:"elem",elem:n},{type:"kern",size:i}]});return Rt(["mord","overline"],[a],e)},mathmlBuilder(t,e){var r=new Mt("mo",[new Si("‾")]);r.setAttribute("stretchy","true");var n=new Mt("mover",[Tn(t.body,e),r]);return n.setAttribute("accent","true"),n}}),Wt({type:"phantom",names:["\\phantom"],props:{numArgs:1,allowedInText:!0},handler:(t,e)=>{var{parser:r}=t,n=e[0];return{type:"phantom",mode:r.mode,body:Ei(n)}},htmlBuilder:(t,e)=>{var r=Bi(t.body,e.withPhantom(),!1);return Rc(r)},mathmlBuilder:(t,e)=>{var r=qs(t.body,e);return new Mt("mphantom",r)}}),ge("\\hphantom","\\smash{\\phantom{#1}}"),Wt({type:"vphantom",names:["\\vphantom"],props:{numArgs:1,allowedInText:!0},handler:(t,e)=>{var{parser:r}=t,n=e[0];return{type:"vphantom",mode:r.mode,body:n}},htmlBuilder:(t,e)=>{var r=Rt(["inner"],[an(t.body,e.withPhantom())]),n=Rt(["fix"],[]);return Rt(["mord","rlap"],[r,n],e)},mathmlBuilder:(t,e)=>{var r=qs(Ei(t.body),e),n=new Mt("mphantom",r),i=new Mt("mpadded",[n]);return i.setAttribute("width","0px"),i}}),Wt({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler(t,e){var{parser:r}=t,n=Or(e[0],"size").value,i=e[1];return{type:"raisebox",mode:r.mode,dy:n,body:i}},htmlBuilder(t,e){var r=an(t.body,e),n=Xn(t.dy,e);return nn({positionType:"shift",positionData:-n,children:[{type:"elem",elem:r}]})},mathmlBuilder(t,e){var r=new Mt("mpadded",[Tn(t.body,e)]),n=t.dy.number+t.dy.unit;return r.setAttribute("voffset",n),r}}),Wt({type:"internal",names:["\\relax"],props:{numArgs:0,allowedInText:!0,allowedInArgument:!0},handler(t){var{parser:e}=t;return{type:"internal",mode:e.mode}}}),Wt({type:"rule",names:["\\rule"],props:{numArgs:2,numOptionalArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["size","size","size"]},handler(t,e,r){var{parser:n}=t,i=r[0],a=Or(e[0],"size"),s=Or(e[1],"size");return{type:"rule",mode:n.mode,shift:i&&Or(i,"size").value,width:a.value,height:s.value}},htmlBuilder(t,e){var r=Rt(["mord","rule"],[],e),n=Xn(t.width,e),i=Xn(t.height,e),a=t.shift?Xn(t.shift,e):0;return r.style.borderRightWidth=$t(n),r.style.borderTopWidth=$t(i),r.style.bottom=$t(a),r.width=n,r.height=i+a,r.depth=-a,r.maxFontSize=i*1.125*e.sizeMultiplier,r},mathmlBuilder(t,e){var r=Xn(t.width,e),n=Xn(t.height,e),i=t.shift?Xn(t.shift,e):0,a=e.color&&e.getColor()||"black",s=new Mt("mspace");s.setAttribute("mathbackground",a),s.setAttribute("width",$t(r)),s.setAttribute("height",$t(n));var o=new Mt("mpadded",[s]);return i>=0?o.setAttribute("height",$t(i)):(o.setAttribute("height",$t(i)),o.setAttribute("depth",$t(-i))),o.setAttribute("voffset",$t(i)),o}});function wX(t,e,r){for(var n=Bi(t,e,!1),i=e.sizeMultiplier/r.sizeMultiplier,a=0;a{var r=e.havingSize(t.size);return wX(t.body,r,e)};Wt({type:"sizing",names:CX,props:{numArgs:0,allowedInText:!0},handler:(t,e)=>{var{breakOnTokenText:r,funcName:n,parser:i}=t,a=i.parseExpression(!1,r);return{type:"sizing",mode:i.mode,size:CX.indexOf(n)+1,body:a}},htmlBuilder:hLe,mathmlBuilder:(t,e)=>{var r=e.havingSize(t.size),n=qs(t.body,r),i=new Mt("mstyle",n);return i.setAttribute("mathsize",$t(r.sizeMultiplier)),i}}),Wt({type:"smash",names:["\\smash"],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:(t,e,r)=>{var{parser:n}=t,i=!1,a=!1,s=r[0]&&Or(r[0],"ordgroup");if(s)for(var o,l=0;l{var r=Rt([],[an(t.body,e)]);if(!t.smashHeight&&!t.smashDepth)return r;if(t.smashHeight&&(r.height=0),t.smashDepth&&(r.depth=0),t.smashHeight&&t.smashDepth)return Rt(["mord","smash"],[r],e);if(r.children)for(var n=0;n{var r=new Mt("mpadded",[Tn(t.body,e)]);return t.smashHeight&&r.setAttribute("height","0px"),t.smashDepth&&r.setAttribute("depth","0px"),r}}),Wt({type:"sqrt",names:["\\sqrt"],props:{numArgs:1,numOptionalArgs:1},handler(t,e,r){var{parser:n}=t,i=r[0],a=e[0];return{type:"sqrt",mode:n.mode,body:a,index:i}},htmlBuilder(t,e){var r=an(t.body,e.havingCrampedStyle());r.height===0&&(r.height=e.fontMetrics().xHeight),r=cp(r,e);var n=e.fontMetrics(),i=n.defaultRuleThickness,a=i;e.style.idr.height+r.depth+s&&(s=(s+d-r.height-r.depth)/2);var f=l.height-r.height-s-u;r.style.paddingLeft=$t(h);var p=nn({positionType:"firstBaseline",children:[{type:"elem",elem:r,wrapperClasses:["svg-align"]},{type:"kern",size:-(r.height+f)},{type:"elem",elem:l},{type:"kern",size:u}]});if(t.index){var g=e.havingStyle(Ir.SCRIPTSCRIPT),m=an(t.index,g,e),y=.6*(p.height-p.depth),v=nn({positionType:"shift",positionData:-y,children:[{type:"elem",elem:m}]}),T=Rt(["root"],[v]);return Rt(["mord","sqrt"],[T,p],e)}else return Rt(["mord","sqrt"],[p],e)},mathmlBuilder(t,e){var{body:r,index:n}=t;return n?new Mt("mroot",[Tn(r,e),Tn(n,e)]):new Mt("msqrt",[Tn(r,e)])}});var j7={display:Ir.DISPLAY,text:Ir.TEXT,script:Ir.SCRIPT,scriptscript:Ir.SCRIPTSCRIPT};function dLe(t){return t in j7}Wt({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t,e){var{breakOnTokenText:r,funcName:n,parser:i}=t,a=i.parseExpression(!0,r),s=n.slice(1,n.length-5);if(!dLe(s))throw new Error("Unknown style: "+s);return{type:"styling",mode:i.mode,style:s,body:a}},htmlBuilder(t,e){var r=j7[t.style],n=e.havingStyle(r);return t.resetFont&&(n=n.withFont("")),wX(t.body,n,e)},mathmlBuilder(t,e){var r=j7[t.style],n=e.havingStyle(r);t.resetFont&&(n=n.withFont(""));var i=qs(t.body,n),a=new Mt("mstyle",i),s={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]},o=s[t.style];return a.setAttribute("scriptlevel",o[0]),a.setAttribute("displaystyle",o[1]),a}});var fLe=function(e,r){var n=e.base;if(n)if(n.type==="op"){var i=n.limits&&(r.style.size===Ir.DISPLAY.size||n.alwaysHandleSupSub);return i?up:null}else if(n.type==="operatorname"){var a=n.alwaysHandleSupSub&&(r.style.size===Ir.DISPLAY.size||n.limits);return a?TX:null}else{if(n.type==="accent")return Ec(n.base)?$7:null;if(n.type==="horizBrace"){var s=!e.sub;return s===n.isOver?yX:null}else return null}else return null};vd({type:"supsub",htmlBuilder(t,e){var r=fLe(t,e);if(r)return r(t,e);var{base:n,sup:i,sub:a}=t,s=an(n,e),o,l,u=e.fontMetrics(),h=0,d=0,f=n&&Ec(n);if(i){var p=e.havingStyle(e.style.sup());o=an(i,p,e),f||(h=s.height-p.fontMetrics().supDrop*p.sizeMultiplier/e.sizeMultiplier)}if(a){var g=e.havingStyle(e.style.sub());l=an(a,g,e),f||(d=s.depth+g.fontMetrics().subDrop*g.sizeMultiplier/e.sizeMultiplier)}var m;e.style===Ir.DISPLAY?m=u.sup1:e.style.cramped?m=u.sup3:m=u.sup2;var y=e.sizeMultiplier,v=$t(.5/u.ptPerEm/y),T=null;if(l){var b=t.base&&t.base.type==="op"&&t.base.name&&(t.base.name==="\\oiint"||t.base.name==="\\oiiint");if(s instanceof zs||b){var w;T=$t(-((w=s.italic)!=null?w:0))}}var k;if(o&&l){h=Math.max(h,m,o.depth+.25*u.xHeight),d=Math.max(d,u.sub2);var A=u.defaultRuleThickness,C=4*A;if(h-o.depth-(l.height-d)0&&(h+=_,d-=_)}var L=[{type:"elem",elem:l,shift:d,marginRight:v,marginLeft:T},{type:"elem",elem:o,shift:-h,marginRight:v}];k=nn({positionType:"individualShift",children:L})}else if(l){d=Math.max(d,u.sub1,l.height-.8*u.xHeight);var O=[{type:"elem",elem:l,marginLeft:T,marginRight:v}];k=nn({positionType:"shift",positionData:d,children:O})}else if(o)h=Math.max(h,m,o.depth+.25*u.xHeight),k=nn({positionType:"shift",positionData:-h,children:[{type:"elem",elem:o,marginRight:v}]});else throw new Error("supsub must have either sup or sub.");var M=I7(s,"right")||"mord";return Rt([M],[s,Rt(["msupsub"],[k])],e)},mathmlBuilder(t,e){var r=!1,n,i;t.base&&t.base.type==="horizBrace"&&(i=!!t.sup,i===t.base.isOver&&(r=!0,n=t.base.isOver)),t.base&&(t.base.type==="op"||t.base.type==="operatorname")&&(t.base.parentIsSupSub=!0);var a=[Tn(t.base,e)];t.sub&&a.push(Tn(t.sub,e)),t.sup&&a.push(Tn(t.sup,e));var s;if(r)s=n?"mover":"munder";else if(t.sub)if(t.sup){var u=t.base;u&&u.type==="op"&&u.limits&&e.style===Ir.DISPLAY||u&&u.type==="operatorname"&&u.alwaysHandleSupSub&&(e.style===Ir.DISPLAY||u.limits)?s="munderover":s="msubsup"}else{var l=t.base;l&&l.type==="op"&&l.limits&&(e.style===Ir.DISPLAY||l.alwaysHandleSupSub)||l&&l.type==="operatorname"&&l.alwaysHandleSupSub&&(l.limits||e.style===Ir.DISPLAY)?s="munder":s="msub"}else{var o=t.base;o&&o.type==="op"&&o.limits&&(e.style===Ir.DISPLAY||o.alwaysHandleSupSub)||o&&o.type==="operatorname"&&o.alwaysHandleSupSub&&(o.limits||e.style===Ir.DISPLAY)?s="mover":s="msup"}return new Mt(s,a)}}),vd({type:"atom",htmlBuilder(t,e){return S7(t.text,t.mode,e,["m"+t.family])},mathmlBuilder(t,e){var r=new Mt("mo",[lo(t.text,t.mode)]);if(t.family==="bin"){var n=N7(t,e);n==="bold-italic"&&r.setAttribute("mathvariant",n)}else t.family==="punct"?r.setAttribute("separator","true"):(t.family==="open"||t.family==="close")&&r.setAttribute("stretchy","false");return r}});var kX={mi:"italic",mn:"normal",mtext:"normal"};vd({type:"mathord",htmlBuilder(t,e){return wC(t,e,"mathord")},mathmlBuilder(t,e){var r=new Mt("mi",[lo(t.text,t.mode,e)]),n=N7(t,e)||"italic";return n!==kX[r.type]&&r.setAttribute("mathvariant",n),r}}),vd({type:"textord",htmlBuilder(t,e){return wC(t,e,"textord")},mathmlBuilder(t,e){var r=lo(t.text,t.mode,e),n=N7(t,e)||"normal",i;return t.mode==="text"?i=new Mt("mtext",[r]):/[0-9]/.test(t.text)?i=new Mt("mn",[r]):t.text==="\\prime"?i=new Mt("mo",[r]):i=new Mt("mi",[r]),n!==kX[i.type]&&i.setAttribute("mathvariant",n),i}});var Z7={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},Q7={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};vd({type:"spacing",htmlBuilder(t,e){if(Q7.hasOwnProperty(t.text)){var r=Q7[t.text].className||"";if(t.mode==="text"){var n=wC(t,e,"textord");return n.classes.push(r),n}else return Rt(["mspace",r],[S7(t.text,t.mode,e)],e)}else{if(Z7.hasOwnProperty(t.text))return Rt(["mspace",Z7[t.text]],[],e);throw new Dt('Unknown type of space "'+t.text+'"')}},mathmlBuilder(t,e){var r;if(Q7.hasOwnProperty(t.text))r=new Mt("mtext",[new Si(" ")]);else{if(Z7.hasOwnProperty(t.text))return new Mt("mspace");throw new Dt('Unknown type of space "'+t.text+'"')}return r}});var EX=()=>{var t=new Mt("mtd",[]);return t.setAttribute("width","50%"),t};vd({type:"tag",mathmlBuilder(t,e){var r=new Mt("mtable",[new Mt("mtr",[EX(),new Mt("mtd",[Gu(t.body,e)]),EX(),new Mt("mtd",[Gu(t.tag,e)])])]);return r.setAttribute("width","100%"),r}});var SX={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},AX={"\\textbf":"textbf","\\textmd":"textmd"},pLe={"\\textit":"textit","\\textup":"textup"},_X=(t,e)=>{var r=t.font;if(r){if(SX[r])return e.withTextFontFamily(SX[r]);if(AX[r])return e.withTextFontWeight(AX[r]);if(r==="\\emph")return e.fontShape==="textit"?e.withTextFontShape("textup"):e.withTextFontShape("textit")}else return e;return e.withTextFontShape(pLe[r])};Wt({type:"text",names:["\\text","\\textrm","\\textsf","\\texttt","\\textnormal","\\textbf","\\textmd","\\textit","\\textup","\\emph"],props:{numArgs:1,argTypes:["text"],allowedInArgument:!0,allowedInText:!0},handler(t,e){var{parser:r,funcName:n}=t,i=e[0];return{type:"text",mode:r.mode,body:Ei(i),font:n}},htmlBuilder(t,e){var r=_X(t,e),n=Bi(t.body,r,!0);return Rt(["mord","text"],n,r)},mathmlBuilder(t,e){var r=_X(t,e);return Gu(t.body,r)}}),Wt({type:"underline",names:["\\underline"],props:{numArgs:1,allowedInText:!0},handler(t,e){var{parser:r}=t;return{type:"underline",mode:r.mode,body:e[0]}},htmlBuilder(t,e){var r=an(t.body,e),n=lp("underline-line",e),i=e.fontMetrics().defaultRuleThickness,a=nn({positionType:"top",positionData:r.height,children:[{type:"kern",size:i},{type:"elem",elem:n},{type:"kern",size:3*i},{type:"elem",elem:r}]});return Rt(["mord","underline"],[a],e)},mathmlBuilder(t,e){var r=new Mt("mo",[new Si("‾")]);r.setAttribute("stretchy","true");var n=new Mt("munder",[Tn(t.body,e),r]);return n.setAttribute("accentunder","true"),n}}),Wt({type:"vcenter",names:["\\vcenter"],props:{numArgs:1,argTypes:["original"],allowedInText:!1},handler(t,e){var{parser:r}=t;return{type:"vcenter",mode:r.mode,body:e[0]}},htmlBuilder(t,e){var r=an(t.body,e),n=e.fontMetrics().axisHeight,i=.5*(r.height-n-(r.depth+n));return nn({positionType:"shift",positionData:i,children:[{type:"elem",elem:r}]})},mathmlBuilder(t,e){var r=new Mt("mpadded",[Tn(t.body,e)],["vcenter"]);return new Mt("mrow",[r])}}),Wt({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler(t,e,r){throw new Dt("\\verb ended by end of line instead of matching delimiter")},htmlBuilder(t,e){for(var r=RX(t),n=[],i=e.havingStyle(e.style.text()),a=0;at.body.replace(/ /g,t.star?"␣":" "),Vu=LY,LX=`[ \r - ]`,gLe="\\\\[a-zA-Z@]+",mLe="\\\\[^\uD800-\uDFFF]",yLe="("+gLe+")"+LX+"*",vLe=`\\\\( +-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.")}};function HPe(t){return"toText"in t}class Bg{constructor(e){this.children=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.children=e,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(e){return this.classes.includes(e)}toNode(){for(var e=document.createDocumentFragment(),r=0;r{if(HPe(e))return e.toText();throw new Error("Expected MathDomNode with toText, got "+e.constructor.name)}).join("")}}var GI={pt:1,mm:7227/2540,cm:7227/254,in:72.27,bp:803/800,pc:12,dd:1238/1157,cc:14856/1157,nd:685/642,nc:1370/107,sp:1/65536,px:803/800},YPe={ex:!0,em:!0,mu:!0},Eee=function(e){return typeof e!="string"&&(e=e.unit),e in GI||e in YPe||e==="ex"},gi=function(e,r){var n;if(e.unit in GI)n=GI[e.unit]/r.fontMetrics().ptPerEm/r.sizeMultiplier;else if(e.unit==="mu")n=r.fontMetrics().cssEmPerMu;else{var i;if(r.style.isTight()?i=r.havingStyle(r.style.text()):i=r,e.unit==="ex")n=i.fontMetrics().xHeight;else if(e.unit==="em")n=i.fontMetrics().quad;else throw new $t("Invalid unit: '"+e.unit+"'");i!==r&&(n*=i.sizeMultiplier/r.sizeMultiplier)}return Math.min(e.number*n,r.maxSize)},zt=function(e){return+e.toFixed(4)+"em"},Fh=function(e){return e.filter(r=>r).join(" ")},qI=function(e){var r="";for(var n of Object.keys(e)){var i=e[n];i!==void 0&&(r+=TPe(n)+":"+i+";")}return r},See=function(e,r,n){if(this.classes=e||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=n||{},r){r.style.isTight()&&this.classes.push("mtight");var i=r.getColor();i&&(this.style.color=i)}},_ee=function(e){var r=document.createElement(e);r.className=Fh(this.classes),Object.assign(r.style,this.style);for(var n of Object.keys(this.attributes))r.setAttribute(n,this.attributes[n]);for(var i=0;i/=\x00-\x1f]/,Aee=function(e){var r="<"+e;this.classes.length&&(r+=' class="'+is(Fh(this.classes))+'"');var n=qI(this.style);n&&(r+=' style="'+is(n)+'"');for(var i of Object.keys(this.attributes)){if(XPe.test(i))throw new $t("Invalid attribute name '"+i+"'");r+=" "+i+'="'+is(this.attributes[i])+'"'}r+=">";for(var a=0;a",r};class Fg{constructor(e,r,n,i){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.width=void 0,this.maxFontSize=void 0,this.style=void 0,this.italic=void 0,See.call(this,e,n,i),this.children=r||[]}setAttribute(e,r){this.attributes[e]=r}hasClass(e){return this.classes.includes(e)}toNode(){return _ee.call(this,"span")}toMarkup(){return Aee.call(this,"span")}}let g5=class{constructor(e,r,n,i){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,See.call(this,r,i),this.children=n||[],this.setAttribute("href",e)}setAttribute(e,r){this.attributes[e]=r}hasClass(e){return this.classes.includes(e)}toNode(){return _ee.call(this,"a")}toMarkup(){return Aee.call(this,"a")}};class jPe{constructor(e,r,n){this.src=void 0,this.alt=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.alt=r,this.src=e,this.classes=["mord"],this.height=0,this.depth=0,this.maxFontSize=0,this.style=n}hasClass(e){return this.classes.includes(e)}toNode(){var e=document.createElement("img");return e.src=this.src,e.alt=this.alt,e.className="mord",Object.assign(e.style,this.style),e}toMarkup(){var e=''+is(this.alt)+'0&&(r=document.createElement("span"),r.style.marginRight=zt(this.italic)),this.classes.length>0&&(r=r||document.createElement("span"),r.className=Fh(this.classes)),Object.keys(this.style).length>0&&(r=r||document.createElement("span"),Object.assign(r.style,this.style)),r?(r.appendChild(e),r):e}toMarkup(){var e=!1,r="0&&(n+="margin-right:"+zt(this.italic)+";"),n+=qI(this.style),n&&(e=!0,r+=' style="'+is(n)+'"');var i=is(this.text);return e?(r+=">",r+=i,r+="",r):i}}class Su{constructor(e,r){this.children=void 0,this.attributes=void 0,this.children=e||[],this.attributes=r||{}}toNode(){var e="http://www.w3.org/2000/svg",r=document.createElementNS(e,"svg");for(var n of Object.keys(this.attributes))r.setAttribute(n,this.attributes[n]);for(var i=0;i':''}}class VI{constructor(e){this.attributes=void 0,this.attributes=e||{}}toNode(){var e="http://www.w3.org/2000/svg",r=document.createElementNS(e,"line");for(var n of Object.keys(this.attributes))r.setAttribute(n,this.attributes[n]);return r}toMarkup(){var e=" but got "+String(t)+".")}var JPe=t=>t instanceof Fg||t instanceof g5||t instanceof Bg,hc={"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]}},m5={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]},Ree={Å:"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 Lee(t,e){hc[t]=e}function WI(t,e,r){if(!hc[e])throw new Error("Font metrics not found for font: "+e+".");var n=t.charCodeAt(0),i=hc[e][n];if(!i&&t[0]in Ree&&(n=Ree[t[0]].charCodeAt(0),i=hc[e][n]),!i&&r==="text"&&Cee(n)&&(i=hc[e][77]),i)return{depth:i[0],height:i[1],italic:i[2],skew:i[3],width:i[4]}}var UI={};function eBe(t){var e;if(t>=5?e=0:t>=3?e=1:e=2,!UI[e]){var r=UI[e]={cssEmPerMu:m5.quad[e]/18};for(var n in m5)m5.hasOwnProperty(n)&&(r[n]=m5[n][e])}return UI[e]}var hi={math:{},text:{}};function U(t,e,r,n,i,a){hi[t][i]={font:e,group:r,replace:n},a&&n&&(hi[t][n]=hi[t][i])}var ee="math",St="text",ue="main",Oe="ams",di="accent-token",Qt="bin",ws="close",zg="inner",wr="mathord",Yi="op-token",Co="open",yT="punct",Ge="rel",_u="spacing",He="textord";U(ee,ue,Ge,"≡","\\equiv",!0),U(ee,ue,Ge,"≺","\\prec",!0),U(ee,ue,Ge,"≻","\\succ",!0),U(ee,ue,Ge,"∼","\\sim",!0),U(ee,ue,Ge,"⊥","\\perp"),U(ee,ue,Ge,"⪯","\\preceq",!0),U(ee,ue,Ge,"⪰","\\succeq",!0),U(ee,ue,Ge,"≃","\\simeq",!0),U(ee,ue,Ge,"∣","\\mid",!0),U(ee,ue,Ge,"≪","\\ll",!0),U(ee,ue,Ge,"≫","\\gg",!0),U(ee,ue,Ge,"≍","\\asymp",!0),U(ee,ue,Ge,"∥","\\parallel"),U(ee,ue,Ge,"⋈","\\bowtie",!0),U(ee,ue,Ge,"⌣","\\smile",!0),U(ee,ue,Ge,"⊑","\\sqsubseteq",!0),U(ee,ue,Ge,"⊒","\\sqsupseteq",!0),U(ee,ue,Ge,"≐","\\doteq",!0),U(ee,ue,Ge,"⌢","\\frown",!0),U(ee,ue,Ge,"∋","\\ni",!0),U(ee,ue,Ge,"∝","\\propto",!0),U(ee,ue,Ge,"⊢","\\vdash",!0),U(ee,ue,Ge,"⊣","\\dashv",!0),U(ee,ue,Ge,"∋","\\owns"),U(ee,ue,yT,".","\\ldotp"),U(ee,ue,yT,"⋅","\\cdotp"),U(ee,ue,yT,"⋅","·"),U(St,ue,He,"⋅","·"),U(ee,ue,He,"#","\\#"),U(St,ue,He,"#","\\#"),U(ee,ue,He,"&","\\&"),U(St,ue,He,"&","\\&"),U(ee,ue,He,"ℵ","\\aleph",!0),U(ee,ue,He,"∀","\\forall",!0),U(ee,ue,He,"ℏ","\\hbar",!0),U(ee,ue,He,"∃","\\exists",!0),U(ee,ue,He,"∇","\\nabla",!0),U(ee,ue,He,"♭","\\flat",!0),U(ee,ue,He,"ℓ","\\ell",!0),U(ee,ue,He,"♮","\\natural",!0),U(ee,ue,He,"♣","\\clubsuit",!0),U(ee,ue,He,"℘","\\wp",!0),U(ee,ue,He,"♯","\\sharp",!0),U(ee,ue,He,"♢","\\diamondsuit",!0),U(ee,ue,He,"ℜ","\\Re",!0),U(ee,ue,He,"♡","\\heartsuit",!0),U(ee,ue,He,"ℑ","\\Im",!0),U(ee,ue,He,"♠","\\spadesuit",!0),U(ee,ue,He,"§","\\S",!0),U(St,ue,He,"§","\\S"),U(ee,ue,He,"¶","\\P",!0),U(St,ue,He,"¶","\\P"),U(ee,ue,He,"†","\\dag"),U(St,ue,He,"†","\\dag"),U(St,ue,He,"†","\\textdagger"),U(ee,ue,He,"‡","\\ddag"),U(St,ue,He,"‡","\\ddag"),U(St,ue,He,"‡","\\textdaggerdbl"),U(ee,ue,ws,"⎱","\\rmoustache",!0),U(ee,ue,Co,"⎰","\\lmoustache",!0),U(ee,ue,ws,"⟯","\\rgroup",!0),U(ee,ue,Co,"⟮","\\lgroup",!0),U(ee,ue,Qt,"∓","\\mp",!0),U(ee,ue,Qt,"⊖","\\ominus",!0),U(ee,ue,Qt,"⊎","\\uplus",!0),U(ee,ue,Qt,"⊓","\\sqcap",!0),U(ee,ue,Qt,"∗","\\ast"),U(ee,ue,Qt,"⊔","\\sqcup",!0),U(ee,ue,Qt,"◯","\\bigcirc",!0),U(ee,ue,Qt,"∙","\\bullet",!0),U(ee,ue,Qt,"‡","\\ddagger"),U(ee,ue,Qt,"≀","\\wr",!0),U(ee,ue,Qt,"⨿","\\amalg"),U(ee,ue,Qt,"&","\\And"),U(ee,ue,Ge,"⟵","\\longleftarrow",!0),U(ee,ue,Ge,"⇐","\\Leftarrow",!0),U(ee,ue,Ge,"⟸","\\Longleftarrow",!0),U(ee,ue,Ge,"⟶","\\longrightarrow",!0),U(ee,ue,Ge,"⇒","\\Rightarrow",!0),U(ee,ue,Ge,"⟹","\\Longrightarrow",!0),U(ee,ue,Ge,"↔","\\leftrightarrow",!0),U(ee,ue,Ge,"⟷","\\longleftrightarrow",!0),U(ee,ue,Ge,"⇔","\\Leftrightarrow",!0),U(ee,ue,Ge,"⟺","\\Longleftrightarrow",!0),U(ee,ue,Ge,"↦","\\mapsto",!0),U(ee,ue,Ge,"⟼","\\longmapsto",!0),U(ee,ue,Ge,"↗","\\nearrow",!0),U(ee,ue,Ge,"↩","\\hookleftarrow",!0),U(ee,ue,Ge,"↪","\\hookrightarrow",!0),U(ee,ue,Ge,"↘","\\searrow",!0),U(ee,ue,Ge,"↼","\\leftharpoonup",!0),U(ee,ue,Ge,"⇀","\\rightharpoonup",!0),U(ee,ue,Ge,"↙","\\swarrow",!0),U(ee,ue,Ge,"↽","\\leftharpoondown",!0),U(ee,ue,Ge,"⇁","\\rightharpoondown",!0),U(ee,ue,Ge,"↖","\\nwarrow",!0),U(ee,ue,Ge,"⇌","\\rightleftharpoons",!0),U(ee,Oe,Ge,"≮","\\nless",!0),U(ee,Oe,Ge,"","\\@nleqslant"),U(ee,Oe,Ge,"","\\@nleqq"),U(ee,Oe,Ge,"⪇","\\lneq",!0),U(ee,Oe,Ge,"≨","\\lneqq",!0),U(ee,Oe,Ge,"","\\@lvertneqq"),U(ee,Oe,Ge,"⋦","\\lnsim",!0),U(ee,Oe,Ge,"⪉","\\lnapprox",!0),U(ee,Oe,Ge,"⊀","\\nprec",!0),U(ee,Oe,Ge,"⋠","\\npreceq",!0),U(ee,Oe,Ge,"⋨","\\precnsim",!0),U(ee,Oe,Ge,"⪹","\\precnapprox",!0),U(ee,Oe,Ge,"≁","\\nsim",!0),U(ee,Oe,Ge,"","\\@nshortmid"),U(ee,Oe,Ge,"∤","\\nmid",!0),U(ee,Oe,Ge,"⊬","\\nvdash",!0),U(ee,Oe,Ge,"⊭","\\nvDash",!0),U(ee,Oe,Ge,"⋪","\\ntriangleleft"),U(ee,Oe,Ge,"⋬","\\ntrianglelefteq",!0),U(ee,Oe,Ge,"⊊","\\subsetneq",!0),U(ee,Oe,Ge,"","\\@varsubsetneq"),U(ee,Oe,Ge,"⫋","\\subsetneqq",!0),U(ee,Oe,Ge,"","\\@varsubsetneqq"),U(ee,Oe,Ge,"≯","\\ngtr",!0),U(ee,Oe,Ge,"","\\@ngeqslant"),U(ee,Oe,Ge,"","\\@ngeqq"),U(ee,Oe,Ge,"⪈","\\gneq",!0),U(ee,Oe,Ge,"≩","\\gneqq",!0),U(ee,Oe,Ge,"","\\@gvertneqq"),U(ee,Oe,Ge,"⋧","\\gnsim",!0),U(ee,Oe,Ge,"⪊","\\gnapprox",!0),U(ee,Oe,Ge,"⊁","\\nsucc",!0),U(ee,Oe,Ge,"⋡","\\nsucceq",!0),U(ee,Oe,Ge,"⋩","\\succnsim",!0),U(ee,Oe,Ge,"⪺","\\succnapprox",!0),U(ee,Oe,Ge,"≆","\\ncong",!0),U(ee,Oe,Ge,"","\\@nshortparallel"),U(ee,Oe,Ge,"∦","\\nparallel",!0),U(ee,Oe,Ge,"⊯","\\nVDash",!0),U(ee,Oe,Ge,"⋫","\\ntriangleright"),U(ee,Oe,Ge,"⋭","\\ntrianglerighteq",!0),U(ee,Oe,Ge,"","\\@nsupseteqq"),U(ee,Oe,Ge,"⊋","\\supsetneq",!0),U(ee,Oe,Ge,"","\\@varsupsetneq"),U(ee,Oe,Ge,"⫌","\\supsetneqq",!0),U(ee,Oe,Ge,"","\\@varsupsetneqq"),U(ee,Oe,Ge,"⊮","\\nVdash",!0),U(ee,Oe,Ge,"⪵","\\precneqq",!0),U(ee,Oe,Ge,"⪶","\\succneqq",!0),U(ee,Oe,Ge,"","\\@nsubseteqq"),U(ee,Oe,Qt,"⊴","\\unlhd"),U(ee,Oe,Qt,"⊵","\\unrhd"),U(ee,Oe,Ge,"↚","\\nleftarrow",!0),U(ee,Oe,Ge,"↛","\\nrightarrow",!0),U(ee,Oe,Ge,"⇍","\\nLeftarrow",!0),U(ee,Oe,Ge,"⇏","\\nRightarrow",!0),U(ee,Oe,Ge,"↮","\\nleftrightarrow",!0),U(ee,Oe,Ge,"⇎","\\nLeftrightarrow",!0),U(ee,Oe,Ge,"△","\\vartriangle"),U(ee,Oe,He,"ℏ","\\hslash"),U(ee,Oe,He,"▽","\\triangledown"),U(ee,Oe,He,"◊","\\lozenge"),U(ee,Oe,He,"Ⓢ","\\circledS"),U(ee,Oe,He,"®","\\circledR"),U(St,Oe,He,"®","\\circledR"),U(ee,Oe,He,"∡","\\measuredangle",!0),U(ee,Oe,He,"∄","\\nexists"),U(ee,Oe,He,"℧","\\mho"),U(ee,Oe,He,"Ⅎ","\\Finv",!0),U(ee,Oe,He,"⅁","\\Game",!0),U(ee,Oe,He,"‵","\\backprime"),U(ee,Oe,He,"▲","\\blacktriangle"),U(ee,Oe,He,"▼","\\blacktriangledown"),U(ee,Oe,He,"■","\\blacksquare"),U(ee,Oe,He,"⧫","\\blacklozenge"),U(ee,Oe,He,"★","\\bigstar"),U(ee,Oe,He,"∢","\\sphericalangle",!0),U(ee,Oe,He,"∁","\\complement",!0),U(ee,Oe,He,"ð","\\eth",!0),U(St,ue,He,"ð","ð"),U(ee,Oe,He,"╱","\\diagup"),U(ee,Oe,He,"╲","\\diagdown"),U(ee,Oe,He,"□","\\square"),U(ee,Oe,He,"□","\\Box"),U(ee,Oe,He,"◊","\\Diamond"),U(ee,Oe,He,"¥","\\yen",!0),U(St,Oe,He,"¥","\\yen",!0),U(ee,Oe,He,"✓","\\checkmark",!0),U(St,Oe,He,"✓","\\checkmark"),U(ee,Oe,He,"ℶ","\\beth",!0),U(ee,Oe,He,"ℸ","\\daleth",!0),U(ee,Oe,He,"ℷ","\\gimel",!0),U(ee,Oe,He,"ϝ","\\digamma",!0),U(ee,Oe,He,"ϰ","\\varkappa"),U(ee,Oe,Co,"┌","\\@ulcorner",!0),U(ee,Oe,ws,"┐","\\@urcorner",!0),U(ee,Oe,Co,"└","\\@llcorner",!0),U(ee,Oe,ws,"┘","\\@lrcorner",!0),U(ee,Oe,Ge,"≦","\\leqq",!0),U(ee,Oe,Ge,"⩽","\\leqslant",!0),U(ee,Oe,Ge,"⪕","\\eqslantless",!0),U(ee,Oe,Ge,"≲","\\lesssim",!0),U(ee,Oe,Ge,"⪅","\\lessapprox",!0),U(ee,Oe,Ge,"≊","\\approxeq",!0),U(ee,Oe,Qt,"⋖","\\lessdot"),U(ee,Oe,Ge,"⋘","\\lll",!0),U(ee,Oe,Ge,"≶","\\lessgtr",!0),U(ee,Oe,Ge,"⋚","\\lesseqgtr",!0),U(ee,Oe,Ge,"⪋","\\lesseqqgtr",!0),U(ee,Oe,Ge,"≑","\\doteqdot"),U(ee,Oe,Ge,"≓","\\risingdotseq",!0),U(ee,Oe,Ge,"≒","\\fallingdotseq",!0),U(ee,Oe,Ge,"∽","\\backsim",!0),U(ee,Oe,Ge,"⋍","\\backsimeq",!0),U(ee,Oe,Ge,"⫅","\\subseteqq",!0),U(ee,Oe,Ge,"⋐","\\Subset",!0),U(ee,Oe,Ge,"⊏","\\sqsubset",!0),U(ee,Oe,Ge,"≼","\\preccurlyeq",!0),U(ee,Oe,Ge,"⋞","\\curlyeqprec",!0),U(ee,Oe,Ge,"≾","\\precsim",!0),U(ee,Oe,Ge,"⪷","\\precapprox",!0),U(ee,Oe,Ge,"⊲","\\vartriangleleft"),U(ee,Oe,Ge,"⊴","\\trianglelefteq"),U(ee,Oe,Ge,"⊨","\\vDash",!0),U(ee,Oe,Ge,"⊪","\\Vvdash",!0),U(ee,Oe,Ge,"⌣","\\smallsmile"),U(ee,Oe,Ge,"⌢","\\smallfrown"),U(ee,Oe,Ge,"≏","\\bumpeq",!0),U(ee,Oe,Ge,"≎","\\Bumpeq",!0),U(ee,Oe,Ge,"≧","\\geqq",!0),U(ee,Oe,Ge,"⩾","\\geqslant",!0),U(ee,Oe,Ge,"⪖","\\eqslantgtr",!0),U(ee,Oe,Ge,"≳","\\gtrsim",!0),U(ee,Oe,Ge,"⪆","\\gtrapprox",!0),U(ee,Oe,Qt,"⋗","\\gtrdot"),U(ee,Oe,Ge,"⋙","\\ggg",!0),U(ee,Oe,Ge,"≷","\\gtrless",!0),U(ee,Oe,Ge,"⋛","\\gtreqless",!0),U(ee,Oe,Ge,"⪌","\\gtreqqless",!0),U(ee,Oe,Ge,"≖","\\eqcirc",!0),U(ee,Oe,Ge,"≗","\\circeq",!0),U(ee,Oe,Ge,"≜","\\triangleq",!0),U(ee,Oe,Ge,"∼","\\thicksim"),U(ee,Oe,Ge,"≈","\\thickapprox"),U(ee,Oe,Ge,"⫆","\\supseteqq",!0),U(ee,Oe,Ge,"⋑","\\Supset",!0),U(ee,Oe,Ge,"⊐","\\sqsupset",!0),U(ee,Oe,Ge,"≽","\\succcurlyeq",!0),U(ee,Oe,Ge,"⋟","\\curlyeqsucc",!0),U(ee,Oe,Ge,"≿","\\succsim",!0),U(ee,Oe,Ge,"⪸","\\succapprox",!0),U(ee,Oe,Ge,"⊳","\\vartriangleright"),U(ee,Oe,Ge,"⊵","\\trianglerighteq"),U(ee,Oe,Ge,"⊩","\\Vdash",!0),U(ee,Oe,Ge,"∣","\\shortmid"),U(ee,Oe,Ge,"∥","\\shortparallel"),U(ee,Oe,Ge,"≬","\\between",!0),U(ee,Oe,Ge,"⋔","\\pitchfork",!0),U(ee,Oe,Ge,"∝","\\varpropto"),U(ee,Oe,Ge,"◀","\\blacktriangleleft"),U(ee,Oe,Ge,"∴","\\therefore",!0),U(ee,Oe,Ge,"∍","\\backepsilon"),U(ee,Oe,Ge,"▶","\\blacktriangleright"),U(ee,Oe,Ge,"∵","\\because",!0),U(ee,Oe,Ge,"⋘","\\llless"),U(ee,Oe,Ge,"⋙","\\gggtr"),U(ee,Oe,Qt,"⊲","\\lhd"),U(ee,Oe,Qt,"⊳","\\rhd"),U(ee,Oe,Ge,"≂","\\eqsim",!0),U(ee,ue,Ge,"⋈","\\Join"),U(ee,Oe,Ge,"≑","\\Doteq",!0),U(ee,Oe,Qt,"∔","\\dotplus",!0),U(ee,Oe,Qt,"∖","\\smallsetminus"),U(ee,Oe,Qt,"⋒","\\Cap",!0),U(ee,Oe,Qt,"⋓","\\Cup",!0),U(ee,Oe,Qt,"⩞","\\doublebarwedge",!0),U(ee,Oe,Qt,"⊟","\\boxminus",!0),U(ee,Oe,Qt,"⊞","\\boxplus",!0),U(ee,Oe,Qt,"⋇","\\divideontimes",!0),U(ee,Oe,Qt,"⋉","\\ltimes",!0),U(ee,Oe,Qt,"⋊","\\rtimes",!0),U(ee,Oe,Qt,"⋋","\\leftthreetimes",!0),U(ee,Oe,Qt,"⋌","\\rightthreetimes",!0),U(ee,Oe,Qt,"⋏","\\curlywedge",!0),U(ee,Oe,Qt,"⋎","\\curlyvee",!0),U(ee,Oe,Qt,"⊝","\\circleddash",!0),U(ee,Oe,Qt,"⊛","\\circledast",!0),U(ee,Oe,Qt,"⋅","\\centerdot"),U(ee,Oe,Qt,"⊺","\\intercal",!0),U(ee,Oe,Qt,"⋒","\\doublecap"),U(ee,Oe,Qt,"⋓","\\doublecup"),U(ee,Oe,Qt,"⊠","\\boxtimes",!0),U(ee,Oe,Ge,"⇢","\\dashrightarrow",!0),U(ee,Oe,Ge,"⇠","\\dashleftarrow",!0),U(ee,Oe,Ge,"⇇","\\leftleftarrows",!0),U(ee,Oe,Ge,"⇆","\\leftrightarrows",!0),U(ee,Oe,Ge,"⇚","\\Lleftarrow",!0),U(ee,Oe,Ge,"↞","\\twoheadleftarrow",!0),U(ee,Oe,Ge,"↢","\\leftarrowtail",!0),U(ee,Oe,Ge,"↫","\\looparrowleft",!0),U(ee,Oe,Ge,"⇋","\\leftrightharpoons",!0),U(ee,Oe,Ge,"↶","\\curvearrowleft",!0),U(ee,Oe,Ge,"↺","\\circlearrowleft",!0),U(ee,Oe,Ge,"↰","\\Lsh",!0),U(ee,Oe,Ge,"⇈","\\upuparrows",!0),U(ee,Oe,Ge,"↿","\\upharpoonleft",!0),U(ee,Oe,Ge,"⇃","\\downharpoonleft",!0),U(ee,ue,Ge,"⊶","\\origof",!0),U(ee,ue,Ge,"⊷","\\imageof",!0),U(ee,Oe,Ge,"⊸","\\multimap",!0),U(ee,Oe,Ge,"↭","\\leftrightsquigarrow",!0),U(ee,Oe,Ge,"⇉","\\rightrightarrows",!0),U(ee,Oe,Ge,"⇄","\\rightleftarrows",!0),U(ee,Oe,Ge,"↠","\\twoheadrightarrow",!0),U(ee,Oe,Ge,"↣","\\rightarrowtail",!0),U(ee,Oe,Ge,"↬","\\looparrowright",!0),U(ee,Oe,Ge,"↷","\\curvearrowright",!0),U(ee,Oe,Ge,"↻","\\circlearrowright",!0),U(ee,Oe,Ge,"↱","\\Rsh",!0),U(ee,Oe,Ge,"⇊","\\downdownarrows",!0),U(ee,Oe,Ge,"↾","\\upharpoonright",!0),U(ee,Oe,Ge,"⇂","\\downharpoonright",!0),U(ee,Oe,Ge,"⇝","\\rightsquigarrow",!0),U(ee,Oe,Ge,"⇝","\\leadsto"),U(ee,Oe,Ge,"⇛","\\Rrightarrow",!0),U(ee,Oe,Ge,"↾","\\restriction"),U(ee,ue,He,"‘","`"),U(ee,ue,He,"$","\\$"),U(St,ue,He,"$","\\$"),U(St,ue,He,"$","\\textdollar"),U(ee,ue,He,"%","\\%"),U(St,ue,He,"%","\\%"),U(ee,ue,He,"_","\\_"),U(St,ue,He,"_","\\_"),U(St,ue,He,"_","\\textunderscore"),U(ee,ue,He,"∠","\\angle",!0),U(ee,ue,He,"∞","\\infty",!0),U(ee,ue,He,"′","\\prime"),U(ee,ue,He,"△","\\triangle"),U(ee,ue,He,"Γ","\\Gamma",!0),U(ee,ue,He,"Δ","\\Delta",!0),U(ee,ue,He,"Θ","\\Theta",!0),U(ee,ue,He,"Λ","\\Lambda",!0),U(ee,ue,He,"Ξ","\\Xi",!0),U(ee,ue,He,"Π","\\Pi",!0),U(ee,ue,He,"Σ","\\Sigma",!0),U(ee,ue,He,"Υ","\\Upsilon",!0),U(ee,ue,He,"Φ","\\Phi",!0),U(ee,ue,He,"Ψ","\\Psi",!0),U(ee,ue,He,"Ω","\\Omega",!0),U(ee,ue,He,"A","Α"),U(ee,ue,He,"B","Β"),U(ee,ue,He,"E","Ε"),U(ee,ue,He,"Z","Ζ"),U(ee,ue,He,"H","Η"),U(ee,ue,He,"I","Ι"),U(ee,ue,He,"K","Κ"),U(ee,ue,He,"M","Μ"),U(ee,ue,He,"N","Ν"),U(ee,ue,He,"O","Ο"),U(ee,ue,He,"P","Ρ"),U(ee,ue,He,"T","Τ"),U(ee,ue,He,"X","Χ"),U(ee,ue,He,"¬","\\neg",!0),U(ee,ue,He,"¬","\\lnot"),U(ee,ue,He,"⊤","\\top"),U(ee,ue,He,"⊥","\\bot"),U(ee,ue,He,"∅","\\emptyset"),U(ee,Oe,He,"∅","\\varnothing"),U(ee,ue,wr,"α","\\alpha",!0),U(ee,ue,wr,"β","\\beta",!0),U(ee,ue,wr,"γ","\\gamma",!0),U(ee,ue,wr,"δ","\\delta",!0),U(ee,ue,wr,"ϵ","\\epsilon",!0),U(ee,ue,wr,"ζ","\\zeta",!0),U(ee,ue,wr,"η","\\eta",!0),U(ee,ue,wr,"θ","\\theta",!0),U(ee,ue,wr,"ι","\\iota",!0),U(ee,ue,wr,"κ","\\kappa",!0),U(ee,ue,wr,"λ","\\lambda",!0),U(ee,ue,wr,"μ","\\mu",!0),U(ee,ue,wr,"ν","\\nu",!0),U(ee,ue,wr,"ξ","\\xi",!0),U(ee,ue,wr,"ο","\\omicron",!0),U(ee,ue,wr,"π","\\pi",!0),U(ee,ue,wr,"ρ","\\rho",!0),U(ee,ue,wr,"σ","\\sigma",!0),U(ee,ue,wr,"τ","\\tau",!0),U(ee,ue,wr,"υ","\\upsilon",!0),U(ee,ue,wr,"ϕ","\\phi",!0),U(ee,ue,wr,"χ","\\chi",!0),U(ee,ue,wr,"ψ","\\psi",!0),U(ee,ue,wr,"ω","\\omega",!0),U(ee,ue,wr,"ε","\\varepsilon",!0),U(ee,ue,wr,"ϑ","\\vartheta",!0),U(ee,ue,wr,"ϖ","\\varpi",!0),U(ee,ue,wr,"ϱ","\\varrho",!0),U(ee,ue,wr,"ς","\\varsigma",!0),U(ee,ue,wr,"φ","\\varphi",!0),U(ee,ue,Qt,"∗","*",!0),U(ee,ue,Qt,"+","+"),U(ee,ue,Qt,"−","-",!0),U(ee,ue,Qt,"⋅","\\cdot",!0),U(ee,ue,Qt,"∘","\\circ",!0),U(ee,ue,Qt,"÷","\\div",!0),U(ee,ue,Qt,"±","\\pm",!0),U(ee,ue,Qt,"×","\\times",!0),U(ee,ue,Qt,"∩","\\cap",!0),U(ee,ue,Qt,"∪","\\cup",!0),U(ee,ue,Qt,"∖","\\setminus",!0),U(ee,ue,Qt,"∧","\\land"),U(ee,ue,Qt,"∨","\\lor"),U(ee,ue,Qt,"∧","\\wedge",!0),U(ee,ue,Qt,"∨","\\vee",!0),U(ee,ue,He,"√","\\surd"),U(ee,ue,Co,"⟨","\\langle",!0),U(ee,ue,Co,"∣","\\lvert"),U(ee,ue,Co,"∥","\\lVert"),U(ee,ue,ws,"?","?"),U(ee,ue,ws,"!","!"),U(ee,ue,ws,"⟩","\\rangle",!0),U(ee,ue,ws,"∣","\\rvert"),U(ee,ue,ws,"∥","\\rVert"),U(ee,ue,Ge,"=","="),U(ee,ue,Ge,":",":"),U(ee,ue,Ge,"≈","\\approx",!0),U(ee,ue,Ge,"≅","\\cong",!0),U(ee,ue,Ge,"≥","\\ge"),U(ee,ue,Ge,"≥","\\geq",!0),U(ee,ue,Ge,"←","\\gets"),U(ee,ue,Ge,">","\\gt",!0),U(ee,ue,Ge,"∈","\\in",!0),U(ee,ue,Ge,"","\\@not"),U(ee,ue,Ge,"⊂","\\subset",!0),U(ee,ue,Ge,"⊃","\\supset",!0),U(ee,ue,Ge,"⊆","\\subseteq",!0),U(ee,ue,Ge,"⊇","\\supseteq",!0),U(ee,Oe,Ge,"⊈","\\nsubseteq",!0),U(ee,Oe,Ge,"⊉","\\nsupseteq",!0),U(ee,ue,Ge,"⊨","\\models"),U(ee,ue,Ge,"←","\\leftarrow",!0),U(ee,ue,Ge,"≤","\\le"),U(ee,ue,Ge,"≤","\\leq",!0),U(ee,ue,Ge,"<","\\lt",!0),U(ee,ue,Ge,"→","\\rightarrow",!0),U(ee,ue,Ge,"→","\\to"),U(ee,Oe,Ge,"≱","\\ngeq",!0),U(ee,Oe,Ge,"≰","\\nleq",!0),U(ee,ue,_u," ","\\ "),U(ee,ue,_u," ","\\space"),U(ee,ue,_u," ","\\nobreakspace"),U(St,ue,_u," ","\\ "),U(St,ue,_u," "," "),U(St,ue,_u," ","\\space"),U(St,ue,_u," ","\\nobreakspace"),U(ee,ue,_u,"","\\nobreak"),U(ee,ue,_u,"","\\allowbreak"),U(ee,ue,yT,",",","),U(ee,ue,yT,";",";"),U(ee,Oe,Qt,"⊼","\\barwedge",!0),U(ee,Oe,Qt,"⊻","\\veebar",!0),U(ee,ue,Qt,"⊙","\\odot",!0),U(ee,ue,Qt,"⊕","\\oplus",!0),U(ee,ue,Qt,"⊗","\\otimes",!0),U(ee,ue,He,"∂","\\partial",!0),U(ee,ue,Qt,"⊘","\\oslash",!0),U(ee,Oe,Qt,"⊚","\\circledcirc",!0),U(ee,Oe,Qt,"⊡","\\boxdot",!0),U(ee,ue,Qt,"△","\\bigtriangleup"),U(ee,ue,Qt,"▽","\\bigtriangledown"),U(ee,ue,Qt,"†","\\dagger"),U(ee,ue,Qt,"⋄","\\diamond"),U(ee,ue,Qt,"⋆","\\star"),U(ee,ue,Qt,"◃","\\triangleleft"),U(ee,ue,Qt,"▹","\\triangleright"),U(ee,ue,Co,"{","\\{"),U(St,ue,He,"{","\\{"),U(St,ue,He,"{","\\textbraceleft"),U(ee,ue,ws,"}","\\}"),U(St,ue,He,"}","\\}"),U(St,ue,He,"}","\\textbraceright"),U(ee,ue,Co,"{","\\lbrace"),U(ee,ue,ws,"}","\\rbrace"),U(ee,ue,Co,"[","\\lbrack",!0),U(St,ue,He,"[","\\lbrack",!0),U(ee,ue,ws,"]","\\rbrack",!0),U(St,ue,He,"]","\\rbrack",!0),U(ee,ue,Co,"(","\\lparen",!0),U(ee,ue,ws,")","\\rparen",!0),U(St,ue,He,"<","\\textless",!0),U(St,ue,He,">","\\textgreater",!0),U(ee,ue,Co,"⌊","\\lfloor",!0),U(ee,ue,ws,"⌋","\\rfloor",!0),U(ee,ue,Co,"⌈","\\lceil",!0),U(ee,ue,ws,"⌉","\\rceil",!0),U(ee,ue,He,"\\","\\backslash"),U(ee,ue,He,"∣","|"),U(ee,ue,He,"∣","\\vert"),U(St,ue,He,"|","\\textbar",!0),U(ee,ue,He,"∥","\\|"),U(ee,ue,He,"∥","\\Vert"),U(St,ue,He,"∥","\\textbardbl"),U(St,ue,He,"~","\\textasciitilde"),U(St,ue,He,"\\","\\textbackslash"),U(St,ue,He,"^","\\textasciicircum"),U(ee,ue,Ge,"↑","\\uparrow",!0),U(ee,ue,Ge,"⇑","\\Uparrow",!0),U(ee,ue,Ge,"↓","\\downarrow",!0),U(ee,ue,Ge,"⇓","\\Downarrow",!0),U(ee,ue,Ge,"↕","\\updownarrow",!0),U(ee,ue,Ge,"⇕","\\Updownarrow",!0),U(ee,ue,Yi,"∐","\\coprod"),U(ee,ue,Yi,"⋁","\\bigvee"),U(ee,ue,Yi,"⋀","\\bigwedge"),U(ee,ue,Yi,"⨄","\\biguplus"),U(ee,ue,Yi,"⋂","\\bigcap"),U(ee,ue,Yi,"⋃","\\bigcup"),U(ee,ue,Yi,"∫","\\int"),U(ee,ue,Yi,"∫","\\intop"),U(ee,ue,Yi,"∬","\\iint"),U(ee,ue,Yi,"∭","\\iiint"),U(ee,ue,Yi,"∏","\\prod"),U(ee,ue,Yi,"∑","\\sum"),U(ee,ue,Yi,"⨂","\\bigotimes"),U(ee,ue,Yi,"⨁","\\bigoplus"),U(ee,ue,Yi,"⨀","\\bigodot"),U(ee,ue,Yi,"∮","\\oint"),U(ee,ue,Yi,"∯","\\oiint"),U(ee,ue,Yi,"∰","\\oiiint"),U(ee,ue,Yi,"⨆","\\bigsqcup"),U(ee,ue,Yi,"∫","\\smallint"),U(St,ue,zg,"…","\\textellipsis"),U(ee,ue,zg,"…","\\mathellipsis"),U(St,ue,zg,"…","\\ldots",!0),U(ee,ue,zg,"…","\\ldots",!0),U(ee,ue,zg,"⋯","\\@cdots",!0),U(ee,ue,zg,"⋱","\\ddots",!0),U(ee,ue,He,"⋮","\\varvdots"),U(St,ue,He,"⋮","\\varvdots"),U(ee,ue,di,"ˊ","\\acute"),U(ee,ue,di,"ˋ","\\grave"),U(ee,ue,di,"¨","\\ddot"),U(ee,ue,di,"~","\\tilde"),U(ee,ue,di,"ˉ","\\bar"),U(ee,ue,di,"˘","\\breve"),U(ee,ue,di,"ˇ","\\check"),U(ee,ue,di,"^","\\hat"),U(ee,ue,di,"⃗","\\vec"),U(ee,ue,di,"˙","\\dot"),U(ee,ue,di,"˚","\\mathring"),U(ee,ue,wr,"","\\@imath"),U(ee,ue,wr,"","\\@jmath"),U(ee,ue,He,"ı","ı"),U(ee,ue,He,"ȷ","ȷ"),U(St,ue,He,"ı","\\i",!0),U(St,ue,He,"ȷ","\\j",!0),U(St,ue,He,"ß","\\ss",!0),U(St,ue,He,"æ","\\ae",!0),U(St,ue,He,"œ","\\oe",!0),U(St,ue,He,"ø","\\o",!0),U(St,ue,He,"Æ","\\AE",!0),U(St,ue,He,"Œ","\\OE",!0),U(St,ue,He,"Ø","\\O",!0),U(St,ue,di,"ˊ","\\'"),U(St,ue,di,"ˋ","\\`"),U(St,ue,di,"ˆ","\\^"),U(St,ue,di,"˜","\\~"),U(St,ue,di,"ˉ","\\="),U(St,ue,di,"˘","\\u"),U(St,ue,di,"˙","\\."),U(St,ue,di,"¸","\\c"),U(St,ue,di,"˚","\\r"),U(St,ue,di,"ˇ","\\v"),U(St,ue,di,"¨",'\\"'),U(St,ue,di,"˝","\\H"),U(St,ue,di,"◯","\\textcircled");var Iee={"--":!0,"---":!0,"``":!0,"''":!0};U(St,ue,He,"–","--",!0),U(St,ue,He,"–","\\textendash"),U(St,ue,He,"—","---",!0),U(St,ue,He,"—","\\textemdash"),U(St,ue,He,"‘","`",!0),U(St,ue,He,"‘","\\textquoteleft"),U(St,ue,He,"’","'",!0),U(St,ue,He,"’","\\textquoteright"),U(St,ue,He,"“","``",!0),U(St,ue,He,"“","\\textquotedblleft"),U(St,ue,He,"”","''",!0),U(St,ue,He,"”","\\textquotedblright"),U(ee,ue,He,"°","\\degree",!0),U(St,ue,He,"°","\\degree"),U(St,ue,He,"°","\\textdegree",!0),U(ee,ue,He,"£","\\pounds"),U(ee,ue,He,"£","\\mathsterling",!0),U(St,ue,He,"£","\\pounds"),U(St,ue,He,"£","\\textsterling",!0),U(ee,Oe,He,"✠","\\maltese"),U(St,Oe,He,"✠","\\maltese");for(var Dee='0123456789/@."',HI=0;HI{var e=t.charCodeAt(0),r=t.charCodeAt(1),n=(e-55296)*1024+(r-56320)+65536;if(119808<=n&&n<120484){var i=Math.floor((n-119808)/26);return qee[i]}else if(120782<=n&&n<=120831){var a=Math.floor((n-120782)/10);return rBe[a]}else{if(n===120485||n===120486)return qee[0];if(120486{if(Fh(t.classes)!==Fh(e.classes)||t.skew!==e.skew||t.maxFontSize!==e.maxFontSize||t.italic!==0&&t.hasClass("mathnormal"))return!1;if(t.classes.length===1){var r=t.classes[0];if(r==="mbin"||r==="mord")return!1}for(var n of Object.keys(t.style))if(t.style[n]!==e.style[n])return!1;for(var i of Object.keys(e.style))if(t.style[i]!==e.style[i])return!1;return!0},Vee=t=>{for(var e=0;er&&(r=s.height),s.depth>n&&(n=s.depth),s.maxFontSize>i&&(i=s.maxFontSize)}e.height=r,e.depth=n,e.maxFontSize=i},It=function(e,r,n,i){var a=new Fg(e,r,n,i);return rD(a),a},qh=(t,e,r,n)=>new Fg(t,e,r,n),Gg=function(e,r,n){var i=It([e],[],r);return i.height=Math.max(n||r.fontMetrics().defaultRuleThickness,r.minRuleThickness),i.style.borderBottomWidth=zt(i.height),i.maxFontSize=1,i},sBe=function(e,r,n,i){var a=new g5(e,r,n,i);return rD(a),a},Au=function(e){var r=new Bg(e);return rD(r),r},qg=function(e,r){return e instanceof Bg?It([],[e],r):e},oBe=function(e){if(e.positionType==="individualShift"){for(var r=e.children,n=[r[0]],i=-r[0].shift-r[0].elem.depth,a=i,s=1;s{var r=It(["mspace"],[],e),n=gi(t,e);return r.style.marginRight=zt(n),r},w5=(t,e,r)=>{var n,i;switch(t){case"amsrm":n="AMS";break;case"textrm":n="Main";break;case"textsf":n="SansSerif";break;case"texttt":n="Typewriter";break;default:n=t}return e==="textbf"&&r==="textit"?i="BoldItalic":e==="textbf"?i="Bold":r==="textit"?i="Italic":i="Regular",n+"-"+i},nD={mathbf:{variant:"bold",fontName:"Main-Bold"},mathrm:{variant:"normal",fontName:"Main-Regular"},textit:{variant:"italic",fontName:"Main-Italic"},mathit:{variant:"italic",fontName:"Main-Italic"},mathnormal:{variant:"italic",fontName:"Math-Italic"},mathsfit:{variant:"sans-serif-italic",fontName:"SansSerif-Italic"},mathbb:{variant:"double-struck",fontName:"AMS-Regular"},mathcal:{variant:"script",fontName:"Caligraphic-Regular"},mathfrak:{variant:"fraktur",fontName:"Fraktur-Regular"},mathscr:{variant:"script",fontName:"Script-Regular"},mathsf:{variant:"sans-serif",fontName:"SansSerif-Regular"},mathtt:{variant:"monospace",fontName:"Typewriter-Regular"}},Uee={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},Hee=function(e,r){var[n,i,a]=Uee[e],s=new zh(n),o=new Su([s],{width:zt(i),height:zt(a),style:"width:"+zt(i),viewBox:"0 0 "+1e3*i+" "+1e3*a,preserveAspectRatio:"xMinYMin"}),l=qh(["overlay"],[o],r);return l.height=a,l.style.height=zt(a),l.style.width=zt(i),l},mi={number:3,unit:"mu"},Nf={number:4,unit:"mu"},Ru={number:5,unit:"mu"},lBe={mord:{mop:mi,mbin:Nf,mrel:Ru,minner:mi},mop:{mord:mi,mop:mi,mrel:Ru,minner:mi},mbin:{mord:Nf,mop:Nf,mopen:Nf,minner:Nf},mrel:{mord:Ru,mop:Ru,mopen:Ru,minner:Ru},mopen:{},mclose:{mop:mi,mbin:Nf,mrel:Ru,minner:mi},mpunct:{mord:mi,mop:mi,mrel:Ru,mopen:mi,mclose:mi,mpunct:mi,minner:mi},minner:{mord:mi,mop:mi,mbin:Nf,mrel:Ru,mopen:mi,mpunct:mi,minner:mi}},cBe={mord:{mop:mi},mop:{mord:mi,mop:mi},mbin:{},mrel:{},mopen:{},mclose:{mop:mi},mpunct:{},minner:{mop:mi}},Yee={},C5={},k5={};function jt(t){for(var{type:e,names:r,props:n,handler:i,htmlBuilder:a,mathmlBuilder:s}=t,o={type:e,numArgs:n.numArgs,argTypes:n.argTypes,allowedInArgument:!!n.allowedInArgument,allowedInText:!!n.allowedInText,allowedInMath:n.allowedInMath===void 0?!0:n.allowedInMath,numOptionalArgs:n.numOptionalArgs||0,infix:!!n.infix,primitive:!!n.primitive,handler:i},l=0;l{var y=m.classes[0],v=g.classes[0];y==="mbin"&&hBe.has(v)?m.classes[0]="mord":v==="mbin"&&uBe.has(y)&&(g.classes[0]="mord")},{node:d},f,p),iD(a,(g,m)=>{var y,v,x=sD(m),b=sD(g),w=x&&b?g.hasClass("mtight")?(y=cBe[x])==null?void 0:y[b]:(v=lBe[x])==null?void 0:v[b]:null;if(w)return Wee(w,u)},{node:d},f,p),a},iD=function(e,r,n,i,a){i&&e.push(i);for(var s=0;sf=>{e.splice(d+1,0,f),s++})(s)}i&&e.pop()},Xee=function(e){return e instanceof Bg||e instanceof g5||e instanceof Fg&&e.hasClass("enclosing")?e:null},aD=function(e,r){var n=Xee(e);if(n){var i=n.children;if(i.length){if(r==="right")return aD(i[i.length-1],"right");if(r==="left")return aD(i[0],"left")}}return e},sD=function(e,r){if(!e)return null;r&&(e=aD(e,r));var n=e.classes[0];return fBe[n]||null},vT=function(e,r){var n=["nulldelimiter"].concat(e.baseSizingClasses());return It(r.concat(n))},pn=function(e,r,n){if(!e)return It();if(C5[e.type]){var i=C5[e.type](e,r);if(n&&r.size!==n.size){i=It(r.sizingClasses(n),[i],r);var a=r.sizeMultiplier/n.sizeMultiplier;i.height*=a,i.depth*=a}return i}else throw new $t("Got group of unknown type: '"+e.type+"'")};function S5(t,e){var r=It(["base"],t,e),n=It(["strut"]);return n.style.height=zt(r.height+r.depth),r.depth&&(n.style.verticalAlign=zt(-r.depth)),r.children.unshift(n),r}function oD(t,e){var r=null;t.length===1&&t[0].type==="tag"&&(r=t[0].tag,t=t[0].body);var n=oa(t,e,"root"),i;n.length===2&&n[1].hasClass("tag")&&(i=n.pop());for(var a=[],s=[],o=0;o0&&(a.push(S5(s,e)),s=[]),a.push(n[o]));s.length>0&&a.push(S5(s,e));var u;r?(u=S5(oa(r,e,!0),e),u.classes=["tag"],a.push(u)):i&&a.push(i);var h=It(["katex-html"],a);if(h.setAttribute("aria-hidden","true"),u){var d=u.children[0];d.style.height=zt(h.height+h.depth),h.depth&&(d.style.verticalAlign=zt(-h.depth))}return h}function jee(t){return new Bg(t)}class Ot{constructor(e,r,n){this.type=void 0,this.attributes=void 0,this.children=void 0,this.classes=void 0,this.type=e,this.attributes={},this.children=r||[],this.classes=n||[]}setAttribute(e,r){this.attributes[e]=r}getAttribute(e){return this.attributes[e]}toNode(){var e=document.createElementNS("http://www.w3.org/1998/Math/MathML",this.type);for(var r in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,r)&&e.setAttribute(r,this.attributes[r]);this.classes.length>0&&(e.className=Fh(this.classes));for(var n=0;n0&&(e+=' class ="'+is(Fh(this.classes))+'"'),e+=">";for(var n=0;n",e}toText(){return this.children.map(e=>e.toText()).join("")}}class ji{constructor(e){this.text=void 0,this.text=e}toNode(){return document.createTextNode(this.text)}toMarkup(){return is(this.toText())}toText(){return this.text}}class Kee{constructor(e){this.width=void 0,this.character=void 0,this.width=e,e>=.05555&&e<=.05556?this.character=" ":e>=.1666&&e<=.1667?this.character=" ":e>=.2222&&e<=.2223?this.character=" ":e>=.2777&&e<=.2778?this.character="  ":e>=-.05556&&e<=-.05555?this.character=" ⁣":e>=-.1667&&e<=-.1666?this.character=" ⁣":e>=-.2223&&e<=-.2222?this.character=" ⁣":e>=-.2778&&e<=-.2777?this.character=" ⁣":this.character=null}toNode(){if(this.character)return document.createTextNode(this.character);var e=document.createElementNS("http://www.w3.org/1998/Math/MathML","mspace");return e.setAttribute("width",zt(this.width)),e}toMarkup(){return this.character?""+this.character+"":''}toText(){return this.character?this.character:" "}}var pBe=new Set(["\\imath","\\jmath"]),gBe=new Set(["mrow","mtable"]),Xo=function(e,r,n){return hi[r][e]&&hi[r][e].replace&&e.charCodeAt(0)!==55349&&!(Iee.hasOwnProperty(e)&&n&&(n.fontFamily&&n.fontFamily.slice(4,6)==="tt"||n.font&&n.font.slice(4,6)==="tt"))&&(e=hi[r][e].replace),new ji(e)},lD=function(e){return e.length===1?e[0]:new Ot("mrow",e)},mBe={mathit:"italic",boldsymbol:t=>t.type==="textord"?"bold":"bold-italic",mathbf:"bold",mathbb:"double-struck",mathsfit:"sans-serif-italic",mathfrak:"fraktur",mathscr:"script",mathcal:"script",mathsf:"sans-serif",mathtt:"monospace"},cD=(t,e)=>{if(t.mode==="text"){if(e.fontFamily==="texttt")return"monospace";if(e.fontFamily==="textsf")return e.fontShape==="textit"&&e.fontWeight==="textbf"?"sans-serif-bold-italic":e.fontShape==="textit"?"sans-serif-italic":e.fontWeight==="textbf"?"bold-sans-serif":"sans-serif";if(e.fontShape==="textit"&&e.fontWeight==="textbf")return"bold-italic";if(e.fontShape==="textit")return"italic";if(e.fontWeight==="textbf")return"bold"}var r=e.font;if(!r||r==="mathnormal")return null;var n=t.mode,i=mBe[r];if(i)return typeof i=="function"?i(t):i;var a=t.text;if(pBe.has(a))return null;if(hi[n][a]){var s=hi[n][a].replace;s&&(a=s)}var o=nD[r].fontName;return WI(a,o,n)?nD[r].variant:null};function uD(t){if(!t)return!1;if(t.type==="mi"&&t.children.length===1){var e=t.children[0];return e instanceof ji&&e.text==="."}else if(t.type==="mo"&&t.children.length===1&&t.getAttribute("separator")==="true"&&t.getAttribute("lspace")==="0em"&&t.getAttribute("rspace")==="0em"){var r=t.children[0];return r instanceof ji&&r.text===","}else return!1}var ko=function(e,r,n){if(e.length===1){var i=On(e[0],r);return n&&i instanceof Ot&&i.type==="mo"&&(i.setAttribute("lspace","0em"),i.setAttribute("rspace","0em")),[i]}for(var a=[],s,o=0;o=1&&(s.type==="mn"||uD(s))){var u=l.children[0];u instanceof Ot&&u.type==="mn"&&(u.children=[...s.children,...u.children],a.pop())}else if(s.type==="mi"&&s.children.length===1){var h=s.children[0];if(h instanceof ji&&h.text==="̸"&&(l.type==="mo"||l.type==="mi"||l.type==="mn")){var d=l.children[0];d instanceof ji&&d.text.length>0&&(d.text=d.text.slice(0,1)+"̸"+d.text.slice(1),a.pop())}}}a.push(l),s=l}return a},Vh=function(e,r,n){return lD(ko(e,r,n))},On=function(e,r){if(!e)return new Ot("mrow");if(k5[e.type])return k5[e.type](e,r);throw new $t("Got group of unknown type: '"+e.type+"'")};function Zee(t,e,r,n,i){var a=ko(t,r),s;a.length===1&&a[0]instanceof Ot&&gBe.has(a[0].type)?s=a[0]:s=new Ot("mrow",a);var o=new Ot("annotation",[new ji(e)]);o.setAttribute("encoding","application/x-tex");var l=new Ot("semantics",[s,o]),u=new Ot("math",[l]);u.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),n&&u.setAttribute("display","block");var h=i?"katex":"katex-mathml";return It([h],[u])}var yBe=[[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]],Qee=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],Jee=function(e,r){return r.size<2?e:yBe[e-1][r.size-1]};class Lu{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||Lu.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=Qee[this.size-1],this.maxSize=e.maxSize,this.minRuleThickness=e.minRuleThickness,this._fontMetrics=void 0}extend(e){var r={style:this.style,size:this.size,textSize:this.textSize,color:this.color,phantom:this.phantom,font:this.font,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontShape:this.fontShape,maxSize:this.maxSize,minRuleThickness:this.minRuleThickness};return Object.assign(r,e),new Lu(r)}havingStyle(e){return this.style===e?this:this.extend({style:e,size:Jee(this.textSize,e)})}havingCrampedStyle(){return this.havingStyle(this.style.cramp())}havingSize(e){return this.size===e&&this.textSize===e?this:this.extend({style:this.style.text(),size:e,textSize:e,sizeMultiplier:Qee[e-1]})}havingBaseStyle(e){e=e||this.style.text();var r=Jee(Lu.BASESIZE,e);return this.size===r&&this.textSize===Lu.BASESIZE&&this.style===e?this:this.extend({style:e,size:r})}havingBaseSizing(){var e;switch(this.style.id){case 4:case 5:e=3;break;case 6:case 7:e=1;break;default:e=6}return this.extend({style:this.style.text(),size:e})}withColor(e){return this.extend({color:e})}withPhantom(){return this.extend({phantom:!0})}withFont(e){return this.extend({font:e})}withTextFontFamily(e){return this.extend({fontFamily:e,font:""})}withTextFontWeight(e){return this.extend({fontWeight:e,font:""})}withTextFontShape(e){return this.extend({fontShape:e,font:""})}sizingClasses(e){return e.size!==this.size?["sizing","reset-size"+e.size,"size"+this.size]:[]}baseSizingClasses(){return this.size!==Lu.BASESIZE?["sizing","reset-size"+this.size,"size"+Lu.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=eBe(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}}Lu.BASESIZE=6;var ete=function(e){return new Lu({style:e.displayMode?Fr.DISPLAY:Fr.TEXT,maxSize:e.maxSize,minRuleThickness:e.minRuleThickness})},tte=function(e,r){if(r.displayMode){var n=["katex-display"];r.leqno&&n.push("leqno"),r.fleqn&&n.push("fleqn"),e=It(n,[e])}return e},vBe=function(e,r,n){var i=ete(n),a;if(n.output==="mathml")return Zee(e,r,i,n.displayMode,!0);if(n.output==="html"){var s=oD(e,i);a=It(["katex"],[s])}else{var o=Zee(e,r,i,n.displayMode,!1),l=oD(e,i);a=It(["katex"],[o,l])}return tte(a,n)},bBe=function(e,r,n){var i=ete(n),a=oD(e,i),s=It(["katex"],[a]);return tte(s,n)},xBe={widehat:"^",widecheck:"ˇ",widetilde:"~",utilde:"~",overleftarrow:"←",underleftarrow:"←",xleftarrow:"←",overrightarrow:"→",underrightarrow:"→",xrightarrow:"→",underbrace:"⏟",overbrace:"⏞",underbracket:"⎵",overbracket:"⎴",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":"="},_5=function(e){var r=new Ot("mo",[new ji(xBe[e.replace(/^\\/,"")])]);return r.setAttribute("stretchy","true"),r},TBe={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],overbracket:[["leftbracketover","rightbracketover"],1.6,440],underbracket:[["leftbracketunder","rightbracketunder"],1.6,410],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]},wBe=new Set(["widehat","widecheck","widetilde","utilde"]),A5=function(e,r){function n(){var o=4e5,l=e.label.slice(1);if(wBe.has(l)&&"base"in e){var u=e.base.type==="ordgroup"?e.base.body.length:1,h,d,f;if(u>5)l==="widehat"||l==="widecheck"?(h=420,o=2364,f=.42,d=l+"4"):(h=312,o=2340,f=.34,d="tilde4");else{var p=[1,1,2,2,3,3][u];l==="widehat"||l==="widecheck"?(o=[0,1062,2364,2364,2364][p],h=[0,239,300,360,420][p],f=[0,.24,.3,.3,.36,.42][p],d=l+p):(o=[0,600,1033,2339,2340][p],h=[0,260,286,306,312][p],f=[0,.26,.286,.3,.306,.34][p],d="tilde"+p)}var g=new zh(d),m=new Su([g],{width:"100%",height:zt(f),viewBox:"0 0 "+o+" "+h,preserveAspectRatio:"none"});return{span:qh([],[m],r),minWidth:0,height:f}}else{var y=[],v=TBe[l];if(!v)throw new Error('No SVG data for "'+l+'".');var[x,b,w]=v,C=w/1e3,_=x.length,k,S;if(_===1){if(v.length!==4)throw new Error('Expected 4-tuple for single-path SVG data "'+l+'".');k=["hide-tail"],S=[v[3]]}else if(_===2)k=["halfarrow-left","halfarrow-right"],S=["xMinYMin","xMaxYMin"];else if(_===3)k=["brace-left","brace-center","brace-right"],S=["xMinYMin","xMidYMin","xMaxYMin"];else throw new Error(`Correct katexImagesData or update code here to support + `+_+" children.");for(var L=0;L<_;L++){var $=new zh(x[L]),I=new Su([$],{width:"400em",height:zt(C),viewBox:"0 0 "+o+" "+w,preserveAspectRatio:S[L]+" slice"}),z=qh([k[L]],[I],r);if(_===1)return{span:z,minWidth:b,height:C};z.style.height=zt(C),y.push(z)}return{span:It(["stretchy"],y,r),minWidth:b,height:C}}}var{span:i,minWidth:a,height:s}=n();return i.height=s,i.style.height=zt(s),a>0&&(i.style.minWidth=zt(a)),i},CBe=function(e,r,n,i,a){var s,o=e.height+e.depth+n+i;if(/fbox|color|angl/.test(r)){if(s=It(["stretchy",r],[],a),r==="fbox"){var l=a.color&&a.getColor();l&&(s.style.borderColor=l)}}else{var u=[];/^[bx]cancel$/.test(r)&&u.push(new VI({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(r)&&u.push(new VI({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var h=new Su(u,{width:"100%",height:zt(o)});s=qh([],[h],a)}return s.height=o,s.style.height=zt(o),s},kBe={bin:1,close:1,inner:1,open:1,punct:1,rel:1},EBe={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1};function SBe(t){return t in kBe}function Wr(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 R5(t){var e=L5(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 L5(t){return t&&(t.type==="atom"||EBe.hasOwnProperty(t.type))?t:null}var rte=t=>{if(t instanceof wo)return t;if(JPe(t)&&t.children.length===1)return rte(t.children[0])},hD=(t,e)=>{var r,n,i;t&&t.type==="supsub"?(n=Wr(t.base,"accent"),r=n.base,t.base=r,i=QPe(pn(t,e)),t.base=n):(n=Wr(t,"accent"),r=n.base);var a=pn(r,e.havingCrampedStyle()),s=n.isShifty&&ku(r),o=0;if(s){var l,u;o=(l=(u=rte(a))==null?void 0:u.skew)!=null?l:0}var h=n.label==="\\c",d=h?a.height+a.depth:Math.min(a.height,e.fontMetrics().xHeight),f;if(n.isStretchy)f=A5(n,e),f=fn({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"elem",elem:f,wrapperClasses:["svg-align"],wrapperStyle:o>0?{width:"calc(100% - "+zt(2*o)+")",marginLeft:zt(2*o)}:void 0}]});else{var p,g;n.label==="\\vec"?(p=Hee("vec",e),g=Uee.vec[1]):(p=T5({mode:n.mode,text:n.label},e,"textord"),p=ZPe(p),p.italic=0,g=p.width,h&&(d+=p.depth)),f=It(["accent-body"],[p]);var m=n.label==="\\textcircled";m&&(f.classes.push("accent-full"),d=a.height);var y=o;m||(y-=g/2),f.style.left=zt(y),n.label==="\\textcircled"&&(f.style.top=".2em"),f=fn({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"kern",size:-d},{type:"elem",elem:f}]})}var v=It(["mord","accent"],[f],e);return i?(i.children[0]=v,i.height=Math.max(v.height,i.height),i.classes[0]="mord",i):v},nte=(t,e)=>{var r=t.isStretchy?_5(t.label):new Ot("mo",[Xo(t.label,t.mode)]),n=new Ot("mover",[On(t.base,e),r]);return n.setAttribute("accent","true"),n},_Be=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(t=>"\\"+t).join("|"));jt({type:"accent",names:["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring","\\widecheck","\\widehat","\\widetilde","\\overrightarrow","\\overleftarrow","\\Overrightarrow","\\overleftrightarrow","\\overgroup","\\overlinesegment","\\overleftharpoon","\\overrightharpoon"],props:{numArgs:1},handler:(t,e)=>{var r=E5(e[0]),n=!_Be.test(t.funcName),i=!n||t.funcName==="\\widehat"||t.funcName==="\\widetilde"||t.funcName==="\\widecheck";return{type:"accent",mode:t.parser.mode,label:t.funcName,isStretchy:n,isShifty:i,base:r}},htmlBuilder:hD,mathmlBuilder:nte}),jt({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"]},handler:(t,e)=>{var r=e[0],n=t.parser.mode;return n==="math"&&(t.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+t.funcName+" works only in text mode"),n="text"),{type:"accent",mode:n,label:t.funcName,isStretchy:!1,isShifty:!0,base:r}},htmlBuilder:hD,mathmlBuilder:nte}),jt({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:(t,e)=>{var{parser:r,funcName:n}=t,i=e[0];return{type:"accentUnder",mode:r.mode,label:n,base:i}},htmlBuilder:(t,e)=>{var r=pn(t.base,e),n=A5(t,e),i=t.label==="\\utilde"?.12:0,a=fn({positionType:"top",positionData:r.height,children:[{type:"elem",elem:n,wrapperClasses:["svg-align"]},{type:"kern",size:i},{type:"elem",elem:r}]});return It(["mord","accentunder"],[a],e)},mathmlBuilder:(t,e)=>{var r=_5(t.label),n=new Ot("munder",[On(t.base,e),r]);return n.setAttribute("accentunder","true"),n}});var I5=t=>{var e=new Ot("mpadded",t?[t]:[]);return e.setAttribute("width","+0.6em"),e.setAttribute("lspace","0.3em"),e};jt({type:"xArrow",names:["\\xleftarrow","\\xrightarrow","\\xLeftarrow","\\xRightarrow","\\xleftrightarrow","\\xLeftrightarrow","\\xhookleftarrow","\\xhookrightarrow","\\xmapsto","\\xrightharpoondown","\\xrightharpoonup","\\xleftharpoondown","\\xleftharpoonup","\\xrightleftharpoons","\\xleftrightharpoons","\\xlongequal","\\xtwoheadrightarrow","\\xtwoheadleftarrow","\\xtofrom","\\xrightleftarrows","\\xrightequilibrium","\\xleftequilibrium","\\\\cdrightarrow","\\\\cdleftarrow","\\\\cdlongequal"],props:{numArgs:1,numOptionalArgs:1},handler(t,e,r){var{parser:n,funcName:i}=t;return{type:"xArrow",mode:n.mode,label:i,body:e[0],below:r[0]}},htmlBuilder(t,e){var r=e.style,n=e.havingStyle(r.sup()),i=qg(pn(t.body,n,e),e),a=t.label.slice(0,2)==="\\x"?"x":"cd";i.classes.push(a+"-arrow-pad");var s;t.below&&(n=e.havingStyle(r.sub()),s=qg(pn(t.below,n,e),e),s.classes.push(a+"-arrow-pad"));var o=A5(t,e),l=-e.fontMetrics().axisHeight+.5*o.height,u=-e.fontMetrics().axisHeight-.5*o.height-.111;(i.depth>.25||t.label==="\\xleftequilibrium")&&(u-=i.depth);var h;if(s){var d=-e.fontMetrics().axisHeight+s.height+.5*o.height+.111;h=fn({positionType:"individualShift",children:[{type:"elem",elem:i,shift:u},{type:"elem",elem:o,shift:l,wrapperClasses:["svg-align"]},{type:"elem",elem:s,shift:d}]})}else h=fn({positionType:"individualShift",children:[{type:"elem",elem:i,shift:u},{type:"elem",elem:o,shift:l,wrapperClasses:["svg-align"]}]});return It(["mrel","x-arrow"],[h],e)},mathmlBuilder(t,e){var r=_5(t.label);r.setAttribute("minsize",t.label.charAt(0)==="x"?"1.75em":"3.0em");var n;if(t.body){var i=I5(On(t.body,e));if(t.below){var a=I5(On(t.below,e));n=new Ot("munderover",[r,a,i])}else n=new Ot("mover",[r,i])}else if(t.below){var s=I5(On(t.below,e));n=new Ot("munder",[r,s])}else n=I5(),n=new Ot("mover",[r,n]);return n}});function ite(t,e){var r=oa(t.body,e,!0);return It([t.mclass],r,e)}function ate(t,e){var r,n=ko(t.body,e);return t.mclass==="minner"?r=new Ot("mpadded",n):t.mclass==="mord"?t.isCharacterBox?(r=n[0],r.type="mi"):r=new Ot("mi",n):(t.isCharacterBox?(r=n[0],r.type="mo"):r=new Ot("mo",n),t.mclass==="mbin"?(r.attributes.lspace="0.22em",r.attributes.rspace="0.22em"):t.mclass==="mpunct"?(r.attributes.lspace="0em",r.attributes.rspace="0.17em"):t.mclass==="mopen"||t.mclass==="mclose"?(r.attributes.lspace="0em",r.attributes.rspace="0em"):t.mclass==="minner"&&(r.attributes.lspace="0.0556em",r.attributes.width="+0.1111em")),r}jt({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],props:{numArgs:1,primitive:!0},handler(t,e){var{parser:r,funcName:n}=t,i=e[0];return{type:"mclass",mode:r.mode,mclass:"m"+n.slice(5),body:Xi(i),isCharacterBox:ku(i)}},htmlBuilder:ite,mathmlBuilder:ate});var D5=t=>{var e=t.type==="ordgroup"&&t.body.length?t.body[0]:t;return e.type==="atom"&&(e.family==="bin"||e.family==="rel")?"m"+e.family:"mord"};jt({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler(t,e){var{parser:r}=t;return{type:"mclass",mode:r.mode,mclass:D5(e[0]),body:Xi(e[1]),isCharacterBox:ku(e[1])}}}),jt({type:"mclass",names:["\\stackrel","\\overset","\\underset"],props:{numArgs:2},handler(t,e){var{parser:r,funcName:n}=t,i=e[1],a=e[0],s;n!=="\\stackrel"?s=D5(i):s="mrel";var o={type:"op",mode:i.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:n!=="\\stackrel",body:Xi(i)},l={type:"supsub",mode:a.mode,base:o,sup:n==="\\underset"?null:a,sub:n==="\\underset"?a:null};return{type:"mclass",mode:r.mode,mclass:s,body:[l],isCharacterBox:ku(l)}},htmlBuilder:ite,mathmlBuilder:ate}),jt({type:"pmb",names:["\\pmb"],props:{numArgs:1,allowedInText:!0},handler(t,e){var{parser:r}=t;return{type:"pmb",mode:r.mode,mclass:D5(e[0]),body:Xi(e[0])}},htmlBuilder(t,e){var r=oa(t.body,e,!0),n=It([t.mclass],r,e);return n.style.textShadow="0.02em 0.01em 0.04px",n},mathmlBuilder(t,e){var r=ko(t.body,e),n=new Ot("mstyle",r);return n.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),n}});var ABe={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},ste=()=>({type:"styling",body:[],mode:"math",style:"display",resetFont:!0}),ote=t=>t.type==="textord"&&t.text==="@",RBe=(t,e)=>(t.type==="mathord"||t.type==="atom")&&t.text===e;function LBe(t,e,r){var n=ABe[t];switch(n){case"\\\\cdrightarrow":case"\\\\cdleftarrow":return r.callFunction(n,[e[0]],[e[1]]);case"\\uparrow":case"\\downarrow":{var i=r.callFunction("\\\\cdleft",[e[0]],[]),a={type:"atom",text:n,mode:"math",family:"rel"},s=r.callFunction("\\Big",[a],[]),o=r.callFunction("\\\\cdright",[e[1]],[]),l={type:"ordgroup",mode:"math",body:[i,s,o]};return r.callFunction("\\\\cdparent",[l],[])}case"\\\\cdlongequal":return r.callFunction("\\\\cdlongequal",[],[]);case"\\Vert":{var u={type:"textord",text:"\\Vert",mode:"math"};return r.callFunction("\\Big",[u],[])}default:return{type:"textord",text:" ",mode:"math"}}}function IBe(t){var e=[];for(t.gullet.beginGroup(),t.gullet.macros.set("\\cr","\\\\\\relax"),t.gullet.beginGroup();;){e.push(t.parseExpression(!1,"\\\\")),t.gullet.endGroup(),t.gullet.beginGroup();var r=t.fetch().text;if(r==="&"||r==="\\\\")t.consume();else if(r==="\\end"){e[e.length-1].length===0&&e.pop();break}else throw new $t("Expected \\\\ or \\cr or \\end",t.nextToken)}for(var n=[],i=[n],a=0;aAV".includes(u))for(var d=0;d<2;d++){for(var f=!0,p=l+1;pAV=|." after @',s[l]);var g=LBe(u,h,t),m={type:"styling",body:[g],mode:"math",style:"display",resetFont:!0};n.push(m),o=ste()}a%2===0?n.push(o):n.shift(),n=[],i.push(n)}t.gullet.endGroup(),t.gullet.endGroup();var y=new Array(i[0].length).fill({type:"align",align:"c",pregap:.25,postgap:.25});return{type:"array",mode:"math",body:i,arraystretch:1,addJot:!0,rowGaps:[null],cols:y,colSeparationType:"CD",hLinesBeforeRow:new Array(i.length+1).fill([])}}jt({type:"cdlabel",names:["\\\\cdleft","\\\\cdright"],props:{numArgs:1},handler(t,e){var{parser:r,funcName:n}=t;return{type:"cdlabel",mode:r.mode,side:n.slice(4),label:e[0]}},htmlBuilder(t,e){var r=e.havingStyle(e.style.sup()),n=qg(pn(t.label,r,e),e);return n.classes.push("cd-label-"+t.side),n.style.bottom=zt(.8-n.depth),n.height=0,n.depth=0,n},mathmlBuilder(t,e){var r=new Ot("mrow",[On(t.label,e)]);return r=new Ot("mpadded",[r]),r.setAttribute("width","0"),t.side==="left"&&r.setAttribute("lspace","-1width"),r.setAttribute("voffset","0.7em"),r=new Ot("mstyle",[r]),r.setAttribute("displaystyle","false"),r.setAttribute("scriptlevel","1"),r}}),jt({type:"cdlabelparent",names:["\\\\cdparent"],props:{numArgs:1},handler(t,e){var{parser:r}=t;return{type:"cdlabelparent",mode:r.mode,fragment:e[0]}},htmlBuilder(t,e){var r=qg(pn(t.fragment,e),e);return r.classes.push("cd-vert-arrow"),r},mathmlBuilder(t,e){return new Ot("mrow",[On(t.fragment,e)])}}),jt({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler(t,e){for(var{parser:r}=t,n=Wr(e[0],"ordgroup"),i=n.body,a="",s=0;s=1114111)throw new $t("\\@char with invalid code point "+a);return l<=65535?u=String.fromCharCode(l):(l-=65536,u=String.fromCharCode((l>>10)+55296,(l&1023)+56320)),{type:"textord",mode:r.mode,text:u}}});var lte=(t,e)=>{var r=oa(t.body,e.withColor(t.color),!1);return Au(r)},cte=(t,e)=>{var r=ko(t.body,e.withColor(t.color)),n=new Ot("mstyle",r);return n.setAttribute("mathcolor",t.color),n};jt({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,argTypes:["color","original"]},handler(t,e){var{parser:r}=t,n=Wr(e[0],"color-token").color,i=e[1];return{type:"color",mode:r.mode,color:n,body:Xi(i)}},htmlBuilder:lte,mathmlBuilder:cte}),jt({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,argTypes:["color"]},handler(t,e){var{parser:r,breakOnTokenText:n}=t,i=Wr(e[0],"color-token").color;r.gullet.macros.set("\\current@color",i);var a=r.parseExpression(!0,n);return{type:"color",mode:r.mode,color:i,body:a}},htmlBuilder:lte,mathmlBuilder:cte}),jt({type:"cr",names:["\\\\"],props:{numArgs:0,numOptionalArgs:0,allowedInText:!0},handler(t,e,r){var{parser:n}=t,i=n.gullet.future().text==="["?n.parseSizeGroup(!0):null,a=!n.settings.displayMode||!n.settings.useStrictBehavior("newLineInDisplayMode","In LaTeX, \\\\ or \\newline does nothing in display mode");return{type:"cr",mode:n.mode,newLine:a,size:i&&Wr(i,"size").value}},htmlBuilder(t,e){var r=It(["mspace"],[],e);return t.newLine&&(r.classes.push("newline"),t.size&&(r.style.marginTop=zt(gi(t.size,e)))),r},mathmlBuilder(t,e){var r=new Ot("mspace");return t.newLine&&(r.setAttribute("linebreak","newline"),t.size&&r.setAttribute("height",zt(gi(t.size,e)))),r}});var dD={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},ute=t=>{var e=t.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(e))throw new $t("Expected a control sequence",t);return e},DBe=t=>{var e=t.gullet.popToken();return e.text==="="&&(e=t.gullet.popToken(),e.text===" "&&(e=t.gullet.popToken())),e},hte=(t,e,r,n)=>{var i=t.gullet.macros.get(r.text);i==null&&(r.noexpand=!0,i={tokens:[r],numArgs:0,unexpandable:!t.gullet.isExpandable(r.text)}),t.gullet.macros.set(e,i,n)};jt({type:"internal",names:["\\global","\\long","\\\\globallong"],props:{numArgs:0,allowedInText:!0},handler(t){var{parser:e,funcName:r}=t;e.consumeSpaces();var n=e.fetch();if(dD[n.text])return(r==="\\global"||r==="\\\\globallong")&&(n.text=dD[n.text]),Wr(e.parseFunction(),"internal");throw new $t("Invalid token after macro prefix",n)}}),jt({type:"internal",names:["\\def","\\gdef","\\edef","\\xdef"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t){var{parser:e,funcName:r}=t,n=e.gullet.popToken(),i=n.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(i))throw new $t("Expected a control sequence",n);for(var a=0,s,o=[[]];e.gullet.future().text!=="{";)if(n=e.gullet.popToken(),n.text==="#"){if(e.gullet.future().text==="{"){s=e.gullet.future(),o[a].push("{");break}if(n=e.gullet.popToken(),!/^[1-9]$/.test(n.text))throw new $t('Invalid argument number "'+n.text+'"');if(parseInt(n.text)!==a+1)throw new $t('Argument number "'+n.text+'" out of order');a++,o.push([])}else{if(n.text==="EOF")throw new $t("Expected a macro definition");o[a].push(n.text)}var{tokens:l}=e.gullet.consumeArg();return s&&l.unshift(s),(r==="\\edef"||r==="\\xdef")&&(l=e.gullet.expandTokens(l),l.reverse()),e.gullet.macros.set(i,{tokens:l,numArgs:a,delimiters:o},r===dD[r]),{type:"internal",mode:e.mode}}}),jt({type:"internal",names:["\\let","\\\\globallet"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t){var{parser:e,funcName:r}=t,n=ute(e.gullet.popToken());e.gullet.consumeSpaces();var i=DBe(e);return hte(e,n,i,r==="\\\\globallet"),{type:"internal",mode:e.mode}}}),jt({type:"internal",names:["\\futurelet","\\\\globalfuture"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t){var{parser:e,funcName:r}=t,n=ute(e.gullet.popToken()),i=e.gullet.popToken(),a=e.gullet.popToken();return hte(e,n,a,r==="\\\\globalfuture"),e.gullet.pushToken(a),e.gullet.pushToken(i),{type:"internal",mode:e.mode}}});var bT=function(e,r,n){var i=hi.math[e]&&hi.math[e].replace,a=WI(i||e,r,n);if(!a)throw new Error("Unsupported symbol "+e+" and font size "+r+".");return a},fD=function(e,r,n,i){var a=n.havingBaseStyle(r),s=It(i.concat(a.sizingClasses(n)),[e],n),o=a.sizeMultiplier/n.sizeMultiplier;return s.height*=o,s.depth*=o,s.maxFontSize=a.sizeMultiplier,s},dte=function(e,r,n){var i=r.havingBaseStyle(n),a=(1-r.sizeMultiplier/i.sizeMultiplier)*r.fontMetrics().axisHeight;e.classes.push("delimcenter"),e.style.top=zt(a),e.height-=a,e.depth+=a},MBe=function(e,r,n,i,a,s){var o=ks(e,"Main-Regular",a,i),l=fD(o,r,i,s);return dte(l,i,r),l},NBe=function(e,r,n,i){return ks(e,"Size"+r+"-Regular",n,i)},fte=function(e,r,n,i,a,s){var o=NBe(e,r,a,i),l=fD(It(["delimsizing","size"+r],[o],i),Fr.TEXT,i,s);return n&&dte(l,i,Fr.TEXT),l},pD=function(e,r,n){var i;r==="Size1-Regular"?i="delim-size1":i="delim-size4";var a=It(["delimsizinginner",i],[It([],[ks(e,r,n)])]);return{type:"elem",elem:a}},gD=function(e,r,n){var i=hc["Size4-Regular"][e.charCodeAt(0)]?hc["Size4-Regular"][e.charCodeAt(0)][4]:hc["Size1-Regular"][e.charCodeAt(0)][4],a=new zh("inner",WPe(e,Math.round(1e3*r))),s=new Su([a],{width:zt(i),height:zt(r),style:"width:"+zt(i),viewBox:"0 0 "+1e3*i+" "+Math.round(1e3*r),preserveAspectRatio:"xMinYMin"}),o=qh([],[s],n);return o.height=r,o.style.height=zt(r),o.style.width=zt(i),{type:"elem",elem:o}},mD=.008,M5={type:"kern",size:-1*mD},$Be=new Set(["|","\\lvert","\\rvert","\\vert"]),OBe=new Set(["\\|","\\lVert","\\rVert","\\Vert"]),pte=function(e,r,n,i,a,s){var o,l,u,h,d="",f=0;o=u=h=e,l=null;var p="Size1-Regular";e==="\\uparrow"?u=h="⏐":e==="\\Uparrow"?u=h="‖":e==="\\downarrow"?o=u="⏐":e==="\\Downarrow"?o=u="‖":e==="\\updownarrow"?(o="\\uparrow",u="⏐",h="\\downarrow"):e==="\\Updownarrow"?(o="\\Uparrow",u="‖",h="\\Downarrow"):$Be.has(e)?(u="∣",d="vert",f=333):OBe.has(e)?(u="∥",d="doublevert",f=556):e==="["||e==="\\lbrack"?(o="⎡",u="⎢",h="⎣",p="Size4-Regular",d="lbrack",f=667):e==="]"||e==="\\rbrack"?(o="⎤",u="⎥",h="⎦",p="Size4-Regular",d="rbrack",f=667):e==="\\lfloor"||e==="⌊"?(u=o="⎢",h="⎣",p="Size4-Regular",d="lfloor",f=667):e==="\\lceil"||e==="⌈"?(o="⎡",u=h="⎢",p="Size4-Regular",d="lceil",f=667):e==="\\rfloor"||e==="⌋"?(u=o="⎥",h="⎦",p="Size4-Regular",d="rfloor",f=667):e==="\\rceil"||e==="⌉"?(o="⎤",u=h="⎥",p="Size4-Regular",d="rceil",f=667):e==="("||e==="\\lparen"?(o="⎛",u="⎜",h="⎝",p="Size4-Regular",d="lparen",f=875):e===")"||e==="\\rparen"?(o="⎞",u="⎟",h="⎠",p="Size4-Regular",d="rparen",f=875):e==="\\{"||e==="\\lbrace"?(o="⎧",l="⎨",h="⎩",u="⎪",p="Size4-Regular"):e==="\\}"||e==="\\rbrace"?(o="⎫",l="⎬",h="⎭",u="⎪",p="Size4-Regular"):e==="\\lgroup"||e==="⟮"?(o="⎧",h="⎩",u="⎪",p="Size4-Regular"):e==="\\rgroup"||e==="⟯"?(o="⎫",h="⎭",u="⎪",p="Size4-Regular"):e==="\\lmoustache"||e==="⎰"?(o="⎧",h="⎭",u="⎪",p="Size4-Regular"):(e==="\\rmoustache"||e==="⎱")&&(o="⎫",h="⎩",u="⎪",p="Size4-Regular");var g=bT(o,p,a),m=g.height+g.depth,y=bT(u,p,a),v=y.height+y.depth,x=bT(h,p,a),b=x.height+x.depth,w=0,C=1;if(l!==null){var _=bT(l,p,a);w=_.height+_.depth,C=2}var k=m+b+w,S=Math.max(0,Math.ceil((r-k)/(C*v))),L=k+S*C*v,$=i.fontMetrics().axisHeight;n&&($*=i.sizeMultiplier);var I=L/2-$,z=[];if(d.length>0){var F=L-m-b,A=Math.round(L*1e3),R=UPe(d,Math.round(F*1e3)),N=new zh(d,R),M=zt(f/1e3),D=zt(A/1e3),O=new Su([N],{width:M,height:D,viewBox:"0 0 "+f+" "+A}),B=qh([],[O],i);B.height=A/1e3,B.style.width=M,B.style.height=D,z.push({type:"elem",elem:B})}else{if(z.push(pD(h,p,a)),z.push(M5),l===null){var P=L-m-b+2*mD;z.push(gD(u,P,i))}else{var G=(L-m-b-w)/2+2*mD;z.push(gD(u,G,i)),z.push(M5),z.push(pD(l,p,a)),z.push(M5),z.push(gD(u,G,i))}z.push(M5),z.push(pD(o,p,a))}var V=i.havingBaseStyle(Fr.TEXT),H=fn({positionType:"bottom",positionData:I,children:z});return fD(It(["delimsizing","mult"],[H],V),Fr.TEXT,i,s)},yD=80,vD=.08,bD=function(e,r,n,i,a){var s=VPe(e,i,n),o=new zh(e,s),l=new Su([o],{width:"400em",height:zt(r),viewBox:"0 0 400000 "+n,preserveAspectRatio:"xMinYMin slice"});return qh(["hide-tail"],[l],a)},PBe=function(e,r){var n=r.havingBaseSizing(),i=bte("\\surd",e*n.sizeMultiplier,vte,n),a=n.sizeMultiplier,s=Math.max(0,r.minRuleThickness-r.fontMetrics().sqrtRuleThickness),o,l,u,h,d;return i.type==="small"?(h=1e3+1e3*s+yD,e<1?a=1:e<1.4&&(a=.7),l=(1+s+vD)/a,u=(1+s)/a,o=bD("sqrtMain",l,h,s,r),o.style.minWidth="0.853em",d=.833/a):i.type==="large"?(h=(1e3+yD)*xT[i.size],u=(xT[i.size]+s)/a,l=(xT[i.size]+s+vD)/a,o=bD("sqrtSize"+i.size,l,h,s,r),o.style.minWidth="1.02em",d=1/a):(l=e+s+vD,u=e+s,h=Math.floor(1e3*e+s)+yD,o=bD("sqrtTall",l,h,s,r),o.style.minWidth="0.742em",d=1.056),o.height=u,o.style.height=zt(l),{span:o,advanceWidth:d,ruleWidth:(r.fontMetrics().sqrtRuleThickness+s)*a}},gte=new Set(["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","\\surd"]),BBe=new Set(["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱"]),mte=new Set(["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"]),xT=[0,1.2,1.8,2.4,3],yte=function(e,r,n,i,a){if(e==="<"||e==="\\lt"||e==="⟨"?e="\\langle":(e===">"||e==="\\gt"||e==="⟩")&&(e="\\rangle"),gte.has(e)||mte.has(e))return fte(e,r,!1,n,i,a);if(BBe.has(e))return pte(e,xT[r],!1,n,i,a);throw new $t("Illegal delimiter: '"+e+"'")},FBe=[{type:"small",style:Fr.SCRIPTSCRIPT},{type:"small",style:Fr.SCRIPT},{type:"small",style:Fr.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],zBe=[{type:"small",style:Fr.SCRIPTSCRIPT},{type:"small",style:Fr.SCRIPT},{type:"small",style:Fr.TEXT},{type:"stack"}],vte=[{type:"small",style:Fr.SCRIPTSCRIPT},{type:"small",style:Fr.SCRIPT},{type:"small",style:Fr.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],GBe=function(e){if(e.type==="small")return"Main-Regular";if(e.type==="large")return"Size"+e.size+"-Regular";if(e.type==="stack")return"Size4-Regular";var r=e.type;throw new Error("Add support for delim type '"+r+"' here.")},bte=function(e,r,n,i){for(var a=Math.min(2,3-i.style.size),s=a;sr)return o}return n[n.length-1]},xD=function(e,r,n,i,a,s){e==="<"||e==="\\lt"||e==="⟨"?e="\\langle":(e===">"||e==="\\gt"||e==="⟩")&&(e="\\rangle");var o;mte.has(e)?o=FBe:gte.has(e)?o=vte:o=zBe;var l=bte(e,r,o,i);return l.type==="small"?MBe(e,l.style,n,i,a,s):l.type==="large"?fte(e,l.size,n,i,a,s):pte(e,r,n,i,a,s)},TD=function(e,r,n,i,a,s){var o=i.fontMetrics().axisHeight*i.sizeMultiplier,l=901,u=5/i.fontMetrics().ptPerEm,h=Math.max(r-o,n+o),d=Math.max(h/500*l,2*h-u);return xD(e,d,!0,i,a,s)},xte={"\\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}},qBe=new Set(["(","\\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 Tte(t){return"isMiddle"in t}function N5(t,e){var r=L5(t);if(r&&qBe.has(r.text))return r;throw r?new $t("Invalid delimiter '"+r.text+"' after '"+e.funcName+"'",t):new $t("Invalid delimiter type '"+t.type+"'",t)}jt({type:"delimsizing",names:["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],props:{numArgs:1,argTypes:["primitive"]},handler:(t,e)=>{var r=N5(e[0],t);return{type:"delimsizing",mode:t.parser.mode,size:xte[t.funcName].size,mclass:xte[t.funcName].mclass,delim:r.text}},htmlBuilder:(t,e)=>t.delim==="."?It([t.mclass]):yte(t.delim,t.size,e,t.mode,[t.mclass]),mathmlBuilder:t=>{var e=[];t.delim!=="."&&e.push(Xo(t.delim,t.mode));var r=new Ot("mo",e);t.mclass==="mopen"||t.mclass==="mclose"?r.setAttribute("fence","true"):r.setAttribute("fence","false"),r.setAttribute("stretchy","true");var n=zt(xT[t.size]);return r.setAttribute("minsize",n),r.setAttribute("maxsize",n),r}});function wte(t){if(!t.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}jt({type:"leftright-right",names:["\\right"],props:{numArgs:1,primitive:!0},handler:(t,e)=>{var r=t.parser.gullet.macros.get("\\current@color");if(r&&typeof r!="string")throw new $t("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:t.parser.mode,delim:N5(e[0],t).text,color:r}}}),jt({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:(t,e)=>{var r=N5(e[0],t),n=t.parser;++n.leftrightDepth;var i=n.parseExpression(!1);--n.leftrightDepth,n.expect("\\right",!1);var a=Wr(n.parseFunction(),"leftright-right");return{type:"leftright",mode:n.mode,body:i,left:r.text,right:a.delim,rightColor:a.color}},htmlBuilder:(t,e)=>{wte(t);for(var r=oa(t.body,e,!0,["mopen","mclose"]),n=0,i=0,a=!1,s=0;s{wte(t);var r=ko(t.body,e);if(t.left!=="."){var n=new Ot("mo",[Xo(t.left,t.mode)]);n.setAttribute("fence","true"),r.unshift(n)}if(t.right!=="."){var i=new Ot("mo",[Xo(t.right,t.mode)]);i.setAttribute("fence","true"),t.rightColor&&i.setAttribute("mathcolor",t.rightColor),r.push(i)}return lD(r)}}),jt({type:"middle",names:["\\middle"],props:{numArgs:1,primitive:!0},handler:(t,e)=>{var r=N5(e[0],t);if(!t.parser.leftrightDepth)throw new $t("\\middle without preceding \\left",r);return{type:"middle",mode:t.parser.mode,delim:r.text}},htmlBuilder:(t,e)=>{var r;return t.delim==="."?r=vT(e,[]):(r=yte(t.delim,1,e,t.mode,[]),r.isMiddle={delim:t.delim,options:e}),r},mathmlBuilder:(t,e)=>{var r=t.delim==="\\vert"||t.delim==="|"?Xo("|","text"):Xo(t.delim,t.mode),n=new Ot("mo",[r]);return n.setAttribute("fence","true"),n.setAttribute("lspace","0.05em"),n.setAttribute("rspace","0.05em"),n}});var $5=(t,e)=>{var r=qg(pn(t.body,e),e),n=t.label.slice(1),i=e.sizeMultiplier,a,s,o=ku(t.body);if(n==="sout")a=It(["stretchy","sout"]),a.height=e.fontMetrics().defaultRuleThickness/i,s=-.5*e.fontMetrics().xHeight;else if(n==="phase"){var l=gi({number:.6,unit:"pt"},e),u=gi({number:.35,unit:"ex"},e),h=e.havingBaseSizing();i=i/h.sizeMultiplier;var d=r.height+r.depth+l+u;r.style.paddingLeft=zt(d/2+l);var f=Math.floor(1e3*d*i),p=GPe(f),g=new Su([new zh("phase",p)],{width:"400em",height:zt(f/1e3),viewBox:"0 0 400000 "+f,preserveAspectRatio:"xMinYMin slice"});a=qh(["hide-tail"],[g],e),a.style.height=zt(d),s=r.depth+l+u}else{/cancel/.test(n)?o||r.classes.push("cancel-pad"):n==="angl"?r.classes.push("anglpad"):r.classes.push("boxpad");var m,y,v=0;/box/.test(n)?(v=Math.max(e.fontMetrics().fboxrule,e.minRuleThickness),m=e.fontMetrics().fboxsep+(n==="colorbox"?0:v),y=m):n==="angl"?(v=Math.max(e.fontMetrics().defaultRuleThickness,e.minRuleThickness),m=4*v,y=Math.max(0,.25-r.depth)):(m=o?.2:0,y=m),a=CBe(r,n,m,y,e),/fbox|boxed|fcolorbox/.test(n)?(a.style.borderStyle="solid",a.style.borderWidth=zt(v)):n==="angl"&&v!==.049&&(a.style.borderTopWidth=zt(v),a.style.borderRightWidth=zt(v)),s=r.depth+y,t.backgroundColor&&(a.style.backgroundColor=t.backgroundColor,t.borderColor&&(a.style.borderColor=t.borderColor))}var x;if(t.backgroundColor)x=fn({positionType:"individualShift",children:[{type:"elem",elem:a,shift:s},{type:"elem",elem:r,shift:0}]});else{var b=/cancel|phase/.test(n)?["svg-align"]:[];x=fn({positionType:"individualShift",children:[{type:"elem",elem:r,shift:0},{type:"elem",elem:a,shift:s,wrapperClasses:b}]})}return/cancel/.test(n)&&(x.height=r.height,x.depth=r.depth),/cancel/.test(n)&&!o?It(["mord","cancel-lap"],[x],e):It(["mord"],[x],e)},O5=(t,e)=>{var r,n=new Ot(t.label.includes("colorbox")?"mpadded":"menclose",[On(t.body,e)]);switch(t.label){case"\\cancel":n.setAttribute("notation","updiagonalstrike");break;case"\\bcancel":n.setAttribute("notation","downdiagonalstrike");break;case"\\phase":n.setAttribute("notation","phasorangle");break;case"\\sout":n.setAttribute("notation","horizontalstrike");break;case"\\fbox":n.setAttribute("notation","box");break;case"\\angl":n.setAttribute("notation","actuarial");break;case"\\fcolorbox":case"\\colorbox":if(r=e.fontMetrics().fboxsep*e.fontMetrics().ptPerEm,n.setAttribute("width","+"+2*r+"pt"),n.setAttribute("height","+"+2*r+"pt"),n.setAttribute("lspace",r+"pt"),n.setAttribute("voffset",r+"pt"),t.label==="\\fcolorbox"){var i=Math.max(e.fontMetrics().fboxrule,e.minRuleThickness);n.setAttribute("style","border: "+zt(i)+" solid "+t.borderColor)}break;case"\\xcancel":n.setAttribute("notation","updiagonalstrike downdiagonalstrike");break}return t.backgroundColor&&n.setAttribute("mathbackground",t.backgroundColor),n};jt({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,argTypes:["color","hbox"]},handler(t,e,r){var{parser:n,funcName:i}=t,a=Wr(e[0],"color-token").color,s=e[1];return{type:"enclose",mode:n.mode,label:i,backgroundColor:a,body:s}},htmlBuilder:$5,mathmlBuilder:O5}),jt({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,argTypes:["color","color","hbox"]},handler(t,e,r){var{parser:n,funcName:i}=t,a=Wr(e[0],"color-token").color,s=Wr(e[1],"color-token").color,o=e[2];return{type:"enclose",mode:n.mode,label:i,backgroundColor:s,borderColor:a,body:o}},htmlBuilder:$5,mathmlBuilder:O5}),jt({type:"enclose",names:["\\fbox"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!0},handler(t,e){var{parser:r}=t;return{type:"enclose",mode:r.mode,label:"\\fbox",body:e[0]}}}),jt({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\phase"],props:{numArgs:1},handler(t,e){var{parser:r,funcName:n}=t,i=e[0];return{type:"enclose",mode:r.mode,label:n,body:i}},htmlBuilder:$5,mathmlBuilder:O5}),jt({type:"enclose",names:["\\sout"],props:{numArgs:1,allowedInText:!0},handler(t,e){var{parser:r,funcName:n}=t;r.mode==="math"&&r.settings.reportNonstrict("mathVsSout","LaTeX's \\sout works only in text mode");var i=e[0];return{type:"enclose",mode:r.mode,label:n,body:i}},htmlBuilder:$5,mathmlBuilder:O5}),jt({type:"enclose",names:["\\angl"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!1},handler(t,e){var{parser:r}=t;return{type:"enclose",mode:r.mode,label:"\\angl",body:e[0]}}});var Cte={};function dc(t){for(var{type:e,names:r,props:n,handler:i,htmlBuilder:a,mathmlBuilder:s}=t,o={type:e,numArgs:n.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:i},l=0;l{var e=t.parser.settings;if(!e.displayMode)throw new $t("{"+t.envName+"} can be used only in display mode.")},VBe=new Set(["gather","gather*"]);function wD(t){if(!t.includes("ed"))return!t.includes("*")}function Wh(t,e,r){var{hskipBeforeAndAfter:n,addJot:i,cols:a,arraystretch:s,colSeparationType:o,autoTag:l,singleRow:u,emptySingleRow:h,maxNumCols:d,leqno:f}=e;if(t.gullet.beginGroup(),u||t.gullet.macros.set("\\cr","\\\\\\relax"),!s){var p=t.gullet.expandMacroAsText("\\arraystretch");if(p==null)s=1;else if(s=parseFloat(p),!s||s<0)throw new $t("Invalid \\arraystretch: "+p)}t.gullet.beginGroup();var g=[],m=[g],y=[],v=[],x=l!=null?[]:void 0;function b(){l&&t.gullet.macros.set("\\@eqnsw","1",!0)}function w(){x&&(t.gullet.macros.get("\\df@tag")?(x.push(t.subparse([new Eo("\\df@tag")])),t.gullet.macros.set("\\df@tag",void 0,!0)):x.push(!!l&&t.gullet.macros.get("\\@eqnsw")==="1"))}for(b(),v.push(Ete(t));;){var C=t.parseExpression(!1,u?"\\end":"\\\\");t.gullet.endGroup(),t.gullet.beginGroup();var _={type:"ordgroup",mode:t.mode,body:C};r&&(_={type:"styling",mode:t.mode,style:r,resetFont:!0,body:[_]}),g.push(_);var k=t.fetch().text;if(k==="&"){if(d&&g.length===d){if(u||o)throw new $t("Too many tab characters: &",t.nextToken);t.settings.reportNonstrict("textEnv","Too few columns specified in the {array} column argument.")}t.consume()}else if(k==="\\end"){w(),g.length===1&&_.type==="styling"&&_.body.length===1&&_.body[0].type==="ordgroup"&&_.body[0].body.length===0&&(m.length>1||!h)&&m.pop(),v.length0&&(b+=.25),u.push({pos:b,isDashed:Ze[ke]})}for(w(s[0]),n=0;n0&&(I+=x,kZe))for(n=0;n=o)){var J=void 0;if(i>0||e.hskipBeforeAndAfter){var K,Q;J=(K=(Q=V)==null?void 0:Q.pregap)!=null?K:f,J!==0&&(R=It(["arraycolsep"],[]),R.style.width=zt(J),A.push(R))}var re=[];for(n=0;n0){for(var xe=Gg("hline",r,h),Ke=Gg("hdashline",r,h),Ce=[{type:"elem",elem:ze,shift:0}];u.length>0;){var Ve=u.pop(),Qe=Ve.pos-z;Ve.isDashed?Ce.push({type:"elem",elem:Ke,shift:Qe}):Ce.push({type:"elem",elem:xe,shift:Qe})}ze=fn({positionType:"individualShift",children:Ce})}if(M.length===0)return It(["mord"],[ze],r);var nt=fn({positionType:"individualShift",children:M}),tt=It(["tag"],[nt],r);return Au([ze,tt])},WBe={c:"center ",l:"left ",r:"right "},pc=function(e,r){for(var n=[],i=new Ot("mtd",[],["mtr-glue"]),a=new Ot("mtd",[],["mml-eqn-num"]),s=0;s0){var g=e.cols,m="",y=!1,v=0,x=g.length;g[0].type==="separator"&&(f+="top ",v=1),g[g.length-1].type==="separator"&&(f+="bottom ",x-=1);for(var b=v;b0?"left ":"",f+=L[L.length-1].length>0?"right ":"";for(var $=1;$0&&p&&(y=1),n[g]={type:"align",align:m,pregap:y,postgap:0}}return s.colSeparationType=p?"align":"alignat",s};dc({type:"array",names:["array","darray"],props:{numArgs:1},handler(t,e){var r=L5(e[0]),n=r?[e[0]]:Wr(e[0],"ordgroup").body,i=n.map(function(s){var o=R5(s),l=o.text;if("lcr".includes(l))return{type:"align",align:l};if(l==="|")return{type:"separator",separator:"|"};if(l===":")return{type:"separator",separator:":"};throw new $t("Unknown column alignment: "+l,s)}),a={cols:i,hskipBeforeAndAfter:!0,maxNumCols:i.length};return Wh(t.parser,a,CD(t.envName))},htmlBuilder:fc,mathmlBuilder:pc}),dc({type:"array",names:["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],props:{numArgs:0},handler(t){var e={matrix:null,pmatrix:["(",")"],bmatrix:["[","]"],Bmatrix:["\\{","\\}"],vmatrix:["|","|"],Vmatrix:["\\Vert","\\Vert"]}[t.envName.replace("*","")],r="c",n={hskipBeforeAndAfter:!1,cols:[{type:"align",align:r}]};if(t.envName.charAt(t.envName.length-1)==="*"){var i=t.parser;if(i.consumeSpaces(),i.fetch().text==="["){if(i.consume(),i.consumeSpaces(),r=i.fetch().text,!"lcr".includes(r))throw new $t("Expected l or c or r",i.nextToken);i.consume(),i.consumeSpaces(),i.expect("]"),i.consume(),n.cols=[{type:"align",align:r}]}}var a=Wh(t.parser,n,CD(t.envName)),s=Math.max(0,...a.body.map(o=>o.length));return a.cols=new Array(s).fill({type:"align",align:r}),e?{type:"leftright",mode:t.mode,body:[a],left:e[0],right:e[1],rightColor:void 0}:a},htmlBuilder:fc,mathmlBuilder:pc}),dc({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(t){var e={arraystretch:.5},r=Wh(t.parser,e,"script");return r.colSeparationType="small",r},htmlBuilder:fc,mathmlBuilder:pc}),dc({type:"array",names:["subarray"],props:{numArgs:1},handler(t,e){var r=L5(e[0]),n=r?[e[0]]:Wr(e[0],"ordgroup").body,i=n.map(function(o){var l=R5(o),u=l.text;if("lc".includes(u))return{type:"align",align:u};throw new $t("Unknown column alignment: "+u,o)});if(i.length>1)throw new $t("{subarray} can contain only one column");var a={cols:i,hskipBeforeAndAfter:!1,arraystretch:.5},s=Wh(t.parser,a,"script");if(s.body.length>0&&s.body[0].length>1)throw new $t("{subarray} can contain only one column");return s},htmlBuilder:fc,mathmlBuilder:pc}),dc({type:"array",names:["cases","dcases","rcases","drcases"],props:{numArgs:0},handler(t){var e={arraystretch:1.2,cols:[{type:"align",align:"l",pregap:0,postgap:1},{type:"align",align:"l",pregap:0,postgap:0}]},r=Wh(t.parser,e,CD(t.envName));return{type:"leftright",mode:t.mode,body:[r],left:t.envName.includes("r")?".":"\\{",right:t.envName.includes("r")?"\\}":".",rightColor:void 0}},htmlBuilder:fc,mathmlBuilder:pc}),dc({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:Ste,htmlBuilder:fc,mathmlBuilder:pc}),dc({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(t){VBe.has(t.envName)&&P5(t);var e={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:wD(t.envName),emptySingleRow:!0,leqno:t.parser.settings.leqno};return Wh(t.parser,e,"display")},htmlBuilder:fc,mathmlBuilder:pc}),dc({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:Ste,htmlBuilder:fc,mathmlBuilder:pc}),dc({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(t){P5(t);var e={autoTag:wD(t.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:t.parser.settings.leqno};return Wh(t.parser,e,"display")},htmlBuilder:fc,mathmlBuilder:pc}),dc({type:"array",names:["CD"],props:{numArgs:0},handler(t){return P5(t),IBe(t.parser)},htmlBuilder:fc,mathmlBuilder:pc}),me("\\nonumber","\\gdef\\@eqnsw{0}"),me("\\notag","\\nonumber"),jt({type:"text",names:["\\hline","\\hdashline"],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler(t,e){throw new $t(t.funcName+" valid only within array environment")}});var _te=Cte;jt({type:"environment",names:["\\begin","\\end"],props:{numArgs:1,argTypes:["text"]},handler(t,e){var{parser:r,funcName:n}=t,i=e[0];if(i.type!=="ordgroup")throw new $t("Invalid environment name",i);for(var a="",s=0;s{var r=t.font,n=e.withFont(r);return pn(t.body,n)},Rte=(t,e)=>{var r=t.font,n=e.withFont(r);return On(t.body,n)},Lte={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak"};jt({type:"font",names:["\\mathrm","\\mathit","\\mathbf","\\mathnormal","\\mathsfit","\\mathbb","\\mathcal","\\mathfrak","\\mathscr","\\mathsf","\\mathtt","\\Bbb","\\bold","\\frak"],props:{numArgs:1,allowedInArgument:!0},handler:(t,e)=>{var{parser:r,funcName:n}=t,i=E5(e[0]),a=n;return a in Lte&&(a=Lte[a]),{type:"font",mode:r.mode,font:a.slice(1),body:i}},htmlBuilder:Ate,mathmlBuilder:Rte}),jt({type:"mclass",names:["\\boldsymbol","\\bm"],props:{numArgs:1},handler:(t,e)=>{var{parser:r}=t,n=e[0];return{type:"mclass",mode:r.mode,mclass:D5(n),body:[{type:"font",mode:r.mode,font:"boldsymbol",body:n}],isCharacterBox:ku(n)}}}),jt({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it","\\cal"],props:{numArgs:0,allowedInText:!0},handler:(t,e)=>{var{parser:r,funcName:n,breakOnTokenText:i}=t,{mode:a}=r,s=r.parseExpression(!0,i);return{type:"font",mode:a,font:"math"+n.slice(1),body:{type:"ordgroup",mode:r.mode,body:s}}},htmlBuilder:Ate,mathmlBuilder:Rte});var UBe=(t,e)=>{var r=e.style,n=r.fracNum(),i=r.fracDen(),a;a=e.havingStyle(n);var s=pn(t.numer,a,e);if(t.continued){var o=8.5/e.fontMetrics().ptPerEm,l=3.5/e.fontMetrics().ptPerEm;s.height=s.height0?g=3*f:g=7*f,m=e.fontMetrics().denom1):(d>0?(p=e.fontMetrics().num2,g=f):(p=e.fontMetrics().num3,g=3*f),m=e.fontMetrics().denom2);var y;if(h){var x=e.fontMetrics().axisHeight;p-s.depth-(x+.5*d){var r=new Ot("mfrac",[On(t.numer,e),On(t.denom,e)]);if(!t.hasBarLine)r.setAttribute("linethickness","0px");else if(t.barSize){var n=gi(t.barSize,e);r.setAttribute("linethickness",zt(n))}if(t.leftDelim!=null||t.rightDelim!=null){var i=[];if(t.leftDelim!=null){var a=new Ot("mo",[new ji(t.leftDelim.replace("\\",""))]);a.setAttribute("fence","true"),i.push(a)}if(i.push(r),t.rightDelim!=null){var s=new Ot("mo",[new ji(t.rightDelim.replace("\\",""))]);s.setAttribute("fence","true"),i.push(s)}return lD(i)}return r},Ite=(t,e)=>{if(!e)return t;var r={type:"styling",mode:t.mode,style:e,body:[t]};return r};jt({type:"genfrac",names:["\\cfrac","\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac","\\\\bracefrac","\\\\brackfrac"],props:{numArgs:2,allowedInArgument:!0},handler:(t,e)=>{var{parser:r,funcName:n}=t,i=e[0],a=e[1],s,o=null,l=null;switch(n){case"\\cfrac":case"\\dfrac":case"\\frac":case"\\tfrac":s=!0;break;case"\\\\atopfrac":s=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":s=!1,o="(",l=")";break;case"\\\\bracefrac":s=!1,o="\\{",l="\\}";break;case"\\\\brackfrac":s=!1,o="[",l="]";break;default:throw new Error("Unrecognized genfrac command")}var u=n==="\\cfrac",h=null;return u||n.startsWith("\\d")?h="display":n.startsWith("\\t")&&(h="text"),Ite({type:"genfrac",mode:r.mode,numer:i,denom:a,continued:u,hasBarLine:s,leftDelim:o,rightDelim:l,barSize:null},h)},htmlBuilder:UBe,mathmlBuilder:HBe}),jt({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],props:{numArgs:0,infix:!0},handler(t){var{parser:e,funcName:r,token:n}=t,i;switch(r){case"\\over":i="\\frac";break;case"\\choose":i="\\binom";break;case"\\atop":i="\\\\atopfrac";break;case"\\brace":i="\\\\bracefrac";break;case"\\brack":i="\\\\brackfrac";break;default:throw new Error("Unrecognized infix genfrac command")}return{type:"infix",mode:e.mode,replaceWith:i,token:n}}});var Dte=["display","text","script","scriptscript"],Mte=function(e){var r=null;return e.length>0&&(r=e,r=r==="."?null:r),r};jt({type:"genfrac",names:["\\genfrac"],props:{numArgs:6,allowedInArgument:!0,argTypes:["math","math","size","text","math","math"]},handler(t,e){var{parser:r}=t,n=e[4],i=e[5],a=E5(e[0]),s=a.type==="atom"&&a.family==="open"?Mte(a.text):null,o=E5(e[1]),l=o.type==="atom"&&o.family==="close"?Mte(o.text):null,u=Wr(e[2],"size"),h,d=null;u.isBlank?h=!0:(d=u.value,h=d.number>0);var f=null,p=e[3];if(p.type==="ordgroup"){if(p.body.length>0){var g=Wr(p.body[0],"textord");f=Dte[Number(g.text)]}}else p=Wr(p,"textord"),f=Dte[Number(p.text)];return Ite({type:"genfrac",mode:r.mode,numer:n,denom:i,continued:!1,hasBarLine:h,barSize:d,leftDelim:s,rightDelim:l},f)}}),jt({type:"infix",names:["\\above"],props:{numArgs:1,argTypes:["size"],infix:!0},handler(t,e){var{parser:r,funcName:n,token:i}=t;return{type:"infix",mode:r.mode,replaceWith:"\\\\abovefrac",size:Wr(e[0],"size").value,token:i}}}),jt({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:(t,e)=>{var{parser:r,funcName:n}=t,i=e[0],a=Wr(e[1],"infix").size;if(!a)throw new Error("\\\\abovefrac expected size, but got "+String(a));var s=e[2],o=a.number>0;return{type:"genfrac",mode:r.mode,numer:i,denom:s,continued:!1,hasBarLine:o,barSize:a,leftDelim:null,rightDelim:null}}});var Nte=(t,e)=>{var r=e.style,n,i;t.type==="supsub"?(n=t.sup?pn(t.sup,e.havingStyle(r.sup()),e):pn(t.sub,e.havingStyle(r.sub()),e),i=Wr(t.base,"horizBrace")):i=Wr(t,"horizBrace");var a=pn(i.base,e.havingBaseStyle(Fr.DISPLAY)),s=A5(i,e),o;if(i.isOver?o=fn({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"kern",size:.1},{type:"elem",elem:s,wrapperClasses:["svg-align"]}]}):o=fn({positionType:"bottom",positionData:a.depth+.1+s.height,children:[{type:"elem",elem:s,wrapperClasses:["svg-align"]},{type:"kern",size:.1},{type:"elem",elem:a}]}),n){var l=It(["minner",i.isOver?"mover":"munder"],[o],e);i.isOver?o=fn({positionType:"firstBaseline",children:[{type:"elem",elem:l},{type:"kern",size:.2},{type:"elem",elem:n}]}):o=fn({positionType:"bottom",positionData:l.depth+.2+n.height+n.depth,children:[{type:"elem",elem:n},{type:"kern",size:.2},{type:"elem",elem:l}]})}return It(["minner",i.isOver?"mover":"munder"],[o],e)},YBe=(t,e)=>{var r=_5(t.label);return new Ot(t.isOver?"mover":"munder",[On(t.base,e),r])};jt({type:"horizBrace",names:["\\overbrace","\\underbrace","\\overbracket","\\underbracket"],props:{numArgs:1},handler(t,e){var{parser:r,funcName:n}=t;return{type:"horizBrace",mode:r.mode,label:n,isOver:n.includes("\\over"),base:e[0]}},htmlBuilder:Nte,mathmlBuilder:YBe}),jt({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:(t,e)=>{var{parser:r}=t,n=e[1],i=Wr(e[0],"url").url;return r.settings.isTrusted({command:"\\href",url:i})?{type:"href",mode:r.mode,href:i,body:Xi(n)}:r.formatUnsupportedCmd("\\href")},htmlBuilder:(t,e)=>{var r=oa(t.body,e,!1);return sBe(t.href,[],r,e)},mathmlBuilder:(t,e)=>{var r=Vh(t.body,e);return r instanceof Ot||(r=new Ot("mrow",[r])),r.setAttribute("href",t.href),r}}),jt({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:(t,e)=>{var{parser:r}=t,n=Wr(e[0],"url").url;if(!r.settings.isTrusted({command:"\\url",url:n}))return r.formatUnsupportedCmd("\\url");for(var i=[],a=0;a{var{parser:r,funcName:n,token:i}=t,a=Wr(e[0],"raw").string,s=e[1];r.settings.strict&&r.settings.reportNonstrict("htmlExtension","HTML extension is disabled on strict mode");var o,l={};switch(n){case"\\htmlClass":l.class=a,o={command:"\\htmlClass",class:a};break;case"\\htmlId":l.id=a,o={command:"\\htmlId",id:a};break;case"\\htmlStyle":l.style=a,o={command:"\\htmlStyle",style:a};break;case"\\htmlData":{for(var u=a.split(","),h=0;h{var r=oa(t.body,e,!1),n=["enclosing"];t.attributes.class&&n.push(...t.attributes.class.trim().split(/\s+/));var i=It(n,r,e);for(var a in t.attributes)a!=="class"&&t.attributes.hasOwnProperty(a)&&i.setAttribute(a,t.attributes[a]);return i},mathmlBuilder:(t,e)=>Vh(t.body,e)}),jt({type:"htmlmathml",names:["\\html@mathml"],props:{numArgs:2,allowedInArgument:!0,allowedInText:!0},handler:(t,e)=>{var{parser:r}=t;return{type:"htmlmathml",mode:r.mode,html:Xi(e[0]),mathml:Xi(e[1])}},htmlBuilder:(t,e)=>{var r=oa(t.html,e,!1);return Au(r)},mathmlBuilder:(t,e)=>Vh(t.mathml,e)});var kD=function(e){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(e))return{number:+e,unit:"bp"};var r=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(e);if(!r)throw new $t("Invalid size: '"+e+"' in \\includegraphics");var n={number:+(r[1]+r[2]),unit:r[3]};if(!Eee(n))throw new $t("Invalid unit: '"+n.unit+"' in \\includegraphics.");return n};jt({type:"includegraphics",names:["\\includegraphics"],props:{numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1},handler:(t,e,r)=>{var{parser:n}=t,i={number:0,unit:"em"},a={number:.9,unit:"em"},s={number:0,unit:"em"},o="";if(r[0])for(var l=Wr(r[0],"raw").string,u=l.split(","),h=0;h{var r=gi(t.height,e),n=0;t.totalheight.number>0&&(n=gi(t.totalheight,e)-r);var i=0;t.width.number>0&&(i=gi(t.width,e));var a={height:zt(r+n)};i>0&&(a.width=zt(i)),n>0&&(a.verticalAlign=zt(-n));var s=new jPe(t.src,t.alt,a);return s.height=r,s.depth=n,s},mathmlBuilder:(t,e)=>{var r=new Ot("mglyph",[]);r.setAttribute("alt",t.alt);var n=gi(t.height,e),i=0;if(t.totalheight.number>0&&(i=gi(t.totalheight,e)-n,r.setAttribute("valign",zt(-i))),r.setAttribute("height",zt(n+i)),t.width.number>0){var a=gi(t.width,e);r.setAttribute("width",zt(a))}return r.setAttribute("src",t.src),r}}),jt({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],props:{numArgs:1,argTypes:["size"],primitive:!0,allowedInText:!0},handler(t,e){var{parser:r,funcName:n}=t,i=Wr(e[0],"size");if(r.settings.strict){var a=n[1]==="m",s=i.value.unit==="mu";a?(s||r.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+n+" supports only mu units, "+("not "+i.value.unit+" units")),r.mode!=="math"&&r.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+n+" works only in math mode")):s&&r.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+n+" doesn't support mu units")}return{type:"kern",mode:r.mode,dimension:i.value}},htmlBuilder(t,e){return Wee(t.dimension,e)},mathmlBuilder(t,e){var r=gi(t.dimension,e);return new Kee(r)}}),jt({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],props:{numArgs:1,allowedInText:!0},handler:(t,e)=>{var{parser:r,funcName:n}=t,i=e[0];return{type:"lap",mode:r.mode,alignment:n.slice(5),body:i}},htmlBuilder:(t,e)=>{var r;t.alignment==="clap"?(r=It([],[pn(t.body,e)]),r=It(["inner"],[r],e)):r=It(["inner"],[pn(t.body,e)]);var n=It(["fix"],[]),i=It([t.alignment],[r,n],e),a=It(["strut"]);return a.style.height=zt(i.height+i.depth),i.depth&&(a.style.verticalAlign=zt(-i.depth)),i.children.unshift(a),i=It(["thinbox"],[i],e),It(["mord","vbox"],[i],e)},mathmlBuilder:(t,e)=>{var r=new Ot("mpadded",[On(t.body,e)]);if(t.alignment!=="rlap"){var n=t.alignment==="llap"?"-1":"-0.5";r.setAttribute("lspace",n+"width")}return r.setAttribute("width","0px"),r}}),jt({type:"styling",names:["\\(","$"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(t,e){var{funcName:r,parser:n}=t,i=n.mode;n.switchMode("math");var a=r==="\\("?"\\)":"$",s=n.parseExpression(!1,a);return n.expect(a),n.switchMode(i),{type:"styling",mode:n.mode,style:"text",resetFont:!0,body:s}}}),jt({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(t,e){throw new $t("Mismatched "+t.funcName)}});var $te=(t,e)=>{switch(e.style.size){case Fr.DISPLAY.size:return t.display;case Fr.TEXT.size:return t.text;case Fr.SCRIPT.size:return t.script;case Fr.SCRIPTSCRIPT.size:return t.scriptscript;default:return t.text}};jt({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4,primitive:!0},handler:(t,e)=>{var{parser:r}=t;return{type:"mathchoice",mode:r.mode,display:Xi(e[0]),text:Xi(e[1]),script:Xi(e[2]),scriptscript:Xi(e[3])}},htmlBuilder:(t,e)=>{var r=$te(t,e),n=oa(r,e,!1);return Au(n)},mathmlBuilder:(t,e)=>{var r=$te(t,e);return Vh(r,e)}});var Ote=(t,e,r,n,i,a,s)=>{t=It([],[t]);var o=r&&ku(r),l,u;if(e){var h=pn(e,n.havingStyle(i.sup()),n);u={elem:h,kern:Math.max(n.fontMetrics().bigOpSpacing1,n.fontMetrics().bigOpSpacing3-h.depth)}}if(r){var d=pn(r,n.havingStyle(i.sub()),n);l={elem:d,kern:Math.max(n.fontMetrics().bigOpSpacing2,n.fontMetrics().bigOpSpacing4-d.height)}}var f;if(u&&l){var p=n.fontMetrics().bigOpSpacing5+l.elem.height+l.elem.depth+l.kern+t.depth+s;f=fn({positionType:"bottom",positionData:p,children:[{type:"kern",size:n.fontMetrics().bigOpSpacing5},{type:"elem",elem:l.elem,marginLeft:zt(-a)},{type:"kern",size:l.kern},{type:"elem",elem:t},{type:"kern",size:u.kern},{type:"elem",elem:u.elem,marginLeft:zt(a)},{type:"kern",size:n.fontMetrics().bigOpSpacing5}]})}else if(l){var g=t.height-s;f=fn({positionType:"top",positionData:g,children:[{type:"kern",size:n.fontMetrics().bigOpSpacing5},{type:"elem",elem:l.elem,marginLeft:zt(-a)},{type:"kern",size:l.kern},{type:"elem",elem:t}]})}else if(u){var m=t.depth+s;f=fn({positionType:"bottom",positionData:m,children:[{type:"elem",elem:t},{type:"kern",size:u.kern},{type:"elem",elem:u.elem,marginLeft:zt(a)},{type:"kern",size:n.fontMetrics().bigOpSpacing5}]})}else return t;var y=[f];if(l&&a!==0&&!o){var v=It(["mspace"],[],n);v.style.marginRight=zt(a),y.unshift(v)}return It(["mop","op-limits"],y,n)},Pte=new Set(["\\smallint"]),Vg=(t,e)=>{var r,n,i=!1,a;t.type==="supsub"?(r=t.sup,n=t.sub,a=Wr(t.base,"op"),i=!0):a=Wr(t,"op");var s=e.style,o=!1;s.size===Fr.DISPLAY.size&&a.symbol&&!Pte.has(a.name)&&(o=!0);var l,u;if(a.symbol){var h=o?"Size2-Regular":"Size1-Regular",d="";if((a.name==="\\oiint"||a.name==="\\oiiint")&&(d=a.name.slice(1),a.name=d==="oiint"?"\\iint":"\\iiint"),l=ks(a.name,h,"math",e,["mop","op-symbol",o?"large-op":"small-op"]),u=l.italic,d.length>0){var f=Hee(d+"Size"+(o?"2":"1"),e);l=fn({positionType:"individualShift",children:[{type:"elem",elem:l,shift:0},{type:"elem",elem:f,shift:o?.08:0}]}),a.name="\\"+d,l.classes.unshift("mop"),l.italic=u}}else if(a.body){var p=oa(a.body,e,!0);p.length===1&&p[0]instanceof wo?(l=p[0],l.classes[0]="mop"):l=It(["mop"],p,e)}else{for(var g=[],m=1;m{var r;if(t.symbol)r=new Ot("mo",[Xo(t.name,t.mode)]),Pte.has(t.name)&&r.setAttribute("largeop","false");else if(t.body)r=new Ot("mo",ko(t.body,e));else{r=new Ot("mi",[new ji(t.name.slice(1))]);var n=new Ot("mo",[Xo("⁡","text")]);t.parentIsSupSub?r=new Ot("mrow",[r,n]):r=jee([r,n])}return r},XBe={"∏":"\\prod","∐":"\\coprod","∑":"\\sum","⋀":"\\bigwedge","⋁":"\\bigvee","⋂":"\\bigcap","⋃":"\\bigcup","⨀":"\\bigodot","⨁":"\\bigoplus","⨂":"\\bigotimes","⨄":"\\biguplus","⨆":"\\bigsqcup"};jt({type:"op",names:["\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigcap","\\bigcup","\\intop","\\prod","\\sum","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","∏","∐","∑","⋀","⋁","⋂","⋃","⨀","⨁","⨂","⨄","⨆"],props:{numArgs:0},handler:(t,e)=>{var{parser:r,funcName:n}=t,i=n;return i.length===1&&(i=XBe[i]),{type:"op",mode:r.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:i}},htmlBuilder:Vg,mathmlBuilder:TT}),jt({type:"op",names:["\\mathop"],props:{numArgs:1,primitive:!0},handler:(t,e)=>{var{parser:r}=t,n=e[0];return{type:"op",mode:r.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:Xi(n)}},htmlBuilder:Vg,mathmlBuilder:TT});var jBe={"∫":"\\int","∬":"\\iint","∭":"\\iiint","∮":"\\oint","∯":"\\oiint","∰":"\\oiiint"};jt({type:"op",names:["\\arcsin","\\arccos","\\arctan","\\arctg","\\arcctg","\\arg","\\ch","\\cos","\\cosec","\\cosh","\\cot","\\cotg","\\coth","\\csc","\\ctg","\\cth","\\deg","\\dim","\\exp","\\hom","\\ker","\\lg","\\ln","\\log","\\sec","\\sin","\\sinh","\\sh","\\tan","\\tanh","\\tg","\\th"],props:{numArgs:0},handler(t){var{parser:e,funcName:r}=t;return{type:"op",mode:e.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:r}},htmlBuilder:Vg,mathmlBuilder:TT}),jt({type:"op",names:["\\det","\\gcd","\\inf","\\lim","\\max","\\min","\\Pr","\\sup"],props:{numArgs:0},handler(t){var{parser:e,funcName:r}=t;return{type:"op",mode:e.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:r}},htmlBuilder:Vg,mathmlBuilder:TT}),jt({type:"op",names:["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","∫","∬","∭","∮","∯","∰"],props:{numArgs:0,allowedInArgument:!0},handler(t){var{parser:e,funcName:r}=t,n=r;return n.length===1&&(n=jBe[n]),{type:"op",mode:e.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:n}},htmlBuilder:Vg,mathmlBuilder:TT});var Bte=(t,e)=>{var r,n,i=!1,a;t.type==="supsub"?(r=t.sup,n=t.sub,a=Wr(t.base,"operatorname"),i=!0):a=Wr(t,"operatorname");var s;if(a.body.length>0){for(var o=a.body.map(d=>{var f="text"in d?d.text:void 0;return typeof f=="string"?{type:"textord",mode:d.mode,text:f}:d}),l=oa(o,e.withFont("mathrm"),!0),u=0;u{for(var r=ko(t.body,e.withFont("mathrm")),n=!0,i=0;ih.toText()).join("");r=[new ji(o)]}var l=new Ot("mi",r);l.setAttribute("mathvariant","normal");var u=new Ot("mo",[Xo("⁡","text")]);return t.parentIsSupSub?new Ot("mrow",[l,u]):jee([l,u])};jt({type:"operatorname",names:["\\operatorname@","\\operatornamewithlimits"],props:{numArgs:1},handler:(t,e)=>{var{parser:r,funcName:n}=t,i=e[0];return{type:"operatorname",mode:r.mode,body:Xi(i),alwaysHandleSupSub:n==="\\operatornamewithlimits",limits:!1,parentIsSupSub:!1}},htmlBuilder:Bte,mathmlBuilder:KBe}),me("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@"),$f({type:"ordgroup",htmlBuilder(t,e){return t.semisimple?Au(oa(t.body,e,!1)):It(["mord"],oa(t.body,e,!0),e)},mathmlBuilder(t,e){return Vh(t.body,e,!0)}}),jt({type:"overline",names:["\\overline"],props:{numArgs:1},handler(t,e){var{parser:r}=t,n=e[0];return{type:"overline",mode:r.mode,body:n}},htmlBuilder(t,e){var r=pn(t.body,e.havingCrampedStyle()),n=Gg("overline-line",e),i=e.fontMetrics().defaultRuleThickness,a=fn({positionType:"firstBaseline",children:[{type:"elem",elem:r},{type:"kern",size:3*i},{type:"elem",elem:n},{type:"kern",size:i}]});return It(["mord","overline"],[a],e)},mathmlBuilder(t,e){var r=new Ot("mo",[new ji("‾")]);r.setAttribute("stretchy","true");var n=new Ot("mover",[On(t.body,e),r]);return n.setAttribute("accent","true"),n}}),jt({type:"phantom",names:["\\phantom"],props:{numArgs:1,allowedInText:!0},handler:(t,e)=>{var{parser:r}=t,n=e[0];return{type:"phantom",mode:r.mode,body:Xi(n)}},htmlBuilder:(t,e)=>{var r=oa(t.body,e.withPhantom(),!1);return Au(r)},mathmlBuilder:(t,e)=>{var r=ko(t.body,e);return new Ot("mphantom",r)}}),me("\\hphantom","\\smash{\\phantom{#1}}"),jt({type:"vphantom",names:["\\vphantom"],props:{numArgs:1,allowedInText:!0},handler:(t,e)=>{var{parser:r}=t,n=e[0];return{type:"vphantom",mode:r.mode,body:n}},htmlBuilder:(t,e)=>{var r=It(["inner"],[pn(t.body,e.withPhantom())]),n=It(["fix"],[]);return It(["mord","rlap"],[r,n],e)},mathmlBuilder:(t,e)=>{var r=ko(Xi(t.body),e),n=new Ot("mphantom",r),i=new Ot("mpadded",[n]);return i.setAttribute("width","0px"),i}}),jt({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler(t,e){var{parser:r}=t,n=Wr(e[0],"size").value,i=e[1];return{type:"raisebox",mode:r.mode,dy:n,body:i}},htmlBuilder(t,e){var r=pn(t.body,e),n=gi(t.dy,e);return fn({positionType:"shift",positionData:-n,children:[{type:"elem",elem:r}]})},mathmlBuilder(t,e){var r=new Ot("mpadded",[On(t.body,e)]),n=t.dy.number+t.dy.unit;return r.setAttribute("voffset",n),r}}),jt({type:"internal",names:["\\relax"],props:{numArgs:0,allowedInText:!0,allowedInArgument:!0},handler(t){var{parser:e}=t;return{type:"internal",mode:e.mode}}}),jt({type:"rule",names:["\\rule"],props:{numArgs:2,numOptionalArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["size","size","size"]},handler(t,e,r){var{parser:n}=t,i=r[0],a=Wr(e[0],"size"),s=Wr(e[1],"size");return{type:"rule",mode:n.mode,shift:i&&Wr(i,"size").value,width:a.value,height:s.value}},htmlBuilder(t,e){var r=It(["mord","rule"],[],e),n=gi(t.width,e),i=gi(t.height,e),a=t.shift?gi(t.shift,e):0;return r.style.borderRightWidth=zt(n),r.style.borderTopWidth=zt(i),r.style.bottom=zt(a),r.width=n,r.height=i+a,r.depth=-a,r.maxFontSize=i*1.125*e.sizeMultiplier,r},mathmlBuilder(t,e){var r=gi(t.width,e),n=gi(t.height,e),i=t.shift?gi(t.shift,e):0,a=e.color&&e.getColor()||"black",s=new Ot("mspace");s.setAttribute("mathbackground",a),s.setAttribute("width",zt(r)),s.setAttribute("height",zt(n));var o=new Ot("mpadded",[s]);return i>=0?o.setAttribute("height",zt(i)):(o.setAttribute("height",zt(i)),o.setAttribute("depth",zt(-i))),o.setAttribute("voffset",zt(i)),o}});function Fte(t,e,r){for(var n=oa(t,e,!1),i=e.sizeMultiplier/r.sizeMultiplier,a=0;a{var r=e.havingSize(t.size);return Fte(t.body,r,e)};jt({type:"sizing",names:zte,props:{numArgs:0,allowedInText:!0},handler:(t,e)=>{var{breakOnTokenText:r,funcName:n,parser:i}=t,a=i.parseExpression(!1,r);return{type:"sizing",mode:i.mode,size:zte.indexOf(n)+1,body:a}},htmlBuilder:ZBe,mathmlBuilder:(t,e)=>{var r=e.havingSize(t.size),n=ko(t.body,r),i=new Ot("mstyle",n);return i.setAttribute("mathsize",zt(r.sizeMultiplier)),i}}),jt({type:"smash",names:["\\smash"],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:(t,e,r)=>{var{parser:n}=t,i=!1,a=!1,s=r[0]&&Wr(r[0],"ordgroup");if(s)for(var o,l=0;l{var r=It([],[pn(t.body,e)]);if(!t.smashHeight&&!t.smashDepth)return r;if(t.smashHeight&&(r.height=0),t.smashDepth&&(r.depth=0),t.smashHeight&&t.smashDepth)return It(["mord","smash"],[r],e);if(r.children)for(var n=0;n{var r=new Ot("mpadded",[On(t.body,e)]);return t.smashHeight&&r.setAttribute("height","0px"),t.smashDepth&&r.setAttribute("depth","0px"),r}}),jt({type:"sqrt",names:["\\sqrt"],props:{numArgs:1,numOptionalArgs:1},handler(t,e,r){var{parser:n}=t,i=r[0],a=e[0];return{type:"sqrt",mode:n.mode,body:a,index:i}},htmlBuilder(t,e){var r=pn(t.body,e.havingCrampedStyle());r.height===0&&(r.height=e.fontMetrics().xHeight),r=qg(r,e);var n=e.fontMetrics(),i=n.defaultRuleThickness,a=i;e.style.idr.height+r.depth+s&&(s=(s+d-r.height-r.depth)/2);var f=l.height-r.height-s-u;r.style.paddingLeft=zt(h);var p=fn({positionType:"firstBaseline",children:[{type:"elem",elem:r,wrapperClasses:["svg-align"]},{type:"kern",size:-(r.height+f)},{type:"elem",elem:l},{type:"kern",size:u}]});if(t.index){var g=e.havingStyle(Fr.SCRIPTSCRIPT),m=pn(t.index,g,e),y=.6*(p.height-p.depth),v=fn({positionType:"shift",positionData:-y,children:[{type:"elem",elem:m}]}),x=It(["root"],[v]);return It(["mord","sqrt"],[x,p],e)}else return It(["mord","sqrt"],[p],e)},mathmlBuilder(t,e){var{body:r,index:n}=t;return n?new Ot("mroot",[On(r,e),On(n,e)]):new Ot("msqrt",[On(r,e)])}});var ED={display:Fr.DISPLAY,text:Fr.TEXT,script:Fr.SCRIPT,scriptscript:Fr.SCRIPTSCRIPT};function QBe(t){return t in ED}jt({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t,e){var{breakOnTokenText:r,funcName:n,parser:i}=t,a=i.parseExpression(!0,r),s=n.slice(1,n.length-5);if(!QBe(s))throw new Error("Unknown style: "+s);return{type:"styling",mode:i.mode,style:s,body:a}},htmlBuilder(t,e){var r=ED[t.style],n=e.havingStyle(r);return t.resetFont&&(n=n.withFont("")),Fte(t.body,n,e)},mathmlBuilder(t,e){var r=ED[t.style],n=e.havingStyle(r);t.resetFont&&(n=n.withFont(""));var i=ko(t.body,n),a=new Ot("mstyle",i),s={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]},o=s[t.style];return a.setAttribute("scriptlevel",o[0]),a.setAttribute("displaystyle",o[1]),a}});var JBe=function(e,r){var n=e.base;if(n)if(n.type==="op"){var i=n.limits&&(r.style.size===Fr.DISPLAY.size||n.alwaysHandleSupSub);return i?Vg:null}else if(n.type==="operatorname"){var a=n.alwaysHandleSupSub&&(r.style.size===Fr.DISPLAY.size||n.limits);return a?Bte:null}else{if(n.type==="accent")return ku(n.base)?hD:null;if(n.type==="horizBrace"){var s=!e.sub;return s===n.isOver?Nte:null}else return null}else return null};$f({type:"supsub",htmlBuilder(t,e){var r=JBe(t,e);if(r)return r(t,e);var{base:n,sup:i,sub:a}=t,s=pn(n,e),o,l,u=e.fontMetrics(),h=0,d=0,f=n&&ku(n);if(i){var p=e.havingStyle(e.style.sup());o=pn(i,p,e),f||(h=s.height-p.fontMetrics().supDrop*p.sizeMultiplier/e.sizeMultiplier)}if(a){var g=e.havingStyle(e.style.sub());l=pn(a,g,e),f||(d=s.depth+g.fontMetrics().subDrop*g.sizeMultiplier/e.sizeMultiplier)}var m;e.style===Fr.DISPLAY?m=u.sup1:e.style.cramped?m=u.sup3:m=u.sup2;var y=e.sizeMultiplier,v=zt(.5/u.ptPerEm/y),x=null;if(l){var b=t.base&&t.base.type==="op"&&t.base.name&&(t.base.name==="\\oiint"||t.base.name==="\\oiiint");if(s instanceof wo||b){var w;x=zt(-((w=s.italic)!=null?w:0))}}var C;if(o&&l){h=Math.max(h,m,o.depth+.25*u.xHeight),d=Math.max(d,u.sub2);var _=u.defaultRuleThickness,k=4*_;if(h-o.depth-(l.height-d)0&&(h+=S,d-=S)}var L=[{type:"elem",elem:l,shift:d,marginRight:v,marginLeft:x},{type:"elem",elem:o,shift:-h,marginRight:v}];C=fn({positionType:"individualShift",children:L})}else if(l){d=Math.max(d,u.sub1,l.height-.8*u.xHeight);var $=[{type:"elem",elem:l,marginLeft:x,marginRight:v}];C=fn({positionType:"shift",positionData:d,children:$})}else if(o)h=Math.max(h,m,o.depth+.25*u.xHeight),C=fn({positionType:"shift",positionData:-h,children:[{type:"elem",elem:o,marginRight:v}]});else throw new Error("supsub must have either sup or sub.");var I=sD(s,"right")||"mord";return It([I],[s,It(["msupsub"],[C])],e)},mathmlBuilder(t,e){var r=!1,n,i;t.base&&t.base.type==="horizBrace"&&(i=!!t.sup,i===t.base.isOver&&(r=!0,n=t.base.isOver)),t.base&&(t.base.type==="op"||t.base.type==="operatorname")&&(t.base.parentIsSupSub=!0);var a=[On(t.base,e)];t.sub&&a.push(On(t.sub,e)),t.sup&&a.push(On(t.sup,e));var s;if(r)s=n?"mover":"munder";else if(t.sub)if(t.sup){var u=t.base;u&&u.type==="op"&&u.limits&&e.style===Fr.DISPLAY||u&&u.type==="operatorname"&&u.alwaysHandleSupSub&&(e.style===Fr.DISPLAY||u.limits)?s="munderover":s="msubsup"}else{var l=t.base;l&&l.type==="op"&&l.limits&&(e.style===Fr.DISPLAY||l.alwaysHandleSupSub)||l&&l.type==="operatorname"&&l.alwaysHandleSupSub&&(l.limits||e.style===Fr.DISPLAY)?s="munder":s="msub"}else{var o=t.base;o&&o.type==="op"&&o.limits&&(e.style===Fr.DISPLAY||o.alwaysHandleSupSub)||o&&o.type==="operatorname"&&o.alwaysHandleSupSub&&(o.limits||e.style===Fr.DISPLAY)?s="mover":s="msup"}return new Ot(s,a)}}),$f({type:"atom",htmlBuilder(t,e){return tD(t.text,t.mode,e,["m"+t.family])},mathmlBuilder(t,e){var r=new Ot("mo",[Xo(t.text,t.mode)]);if(t.family==="bin"){var n=cD(t,e);n==="bold-italic"&&r.setAttribute("mathvariant",n)}else t.family==="punct"?r.setAttribute("separator","true"):(t.family==="open"||t.family==="close")&&r.setAttribute("stretchy","false");return r}});var Gte={mi:"italic",mn:"normal",mtext:"normal"};$f({type:"mathord",htmlBuilder(t,e){return T5(t,e,"mathord")},mathmlBuilder(t,e){var r=new Ot("mi",[Xo(t.text,t.mode,e)]),n=cD(t,e)||"italic";return n!==Gte[r.type]&&r.setAttribute("mathvariant",n),r}}),$f({type:"textord",htmlBuilder(t,e){return T5(t,e,"textord")},mathmlBuilder(t,e){var r=Xo(t.text,t.mode,e),n=cD(t,e)||"normal",i;return t.mode==="text"?i=new Ot("mtext",[r]):/[0-9]/.test(t.text)?i=new Ot("mn",[r]):t.text==="\\prime"?i=new Ot("mo",[r]):i=new Ot("mi",[r]),n!==Gte[i.type]&&i.setAttribute("mathvariant",n),i}});var SD={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},_D={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};$f({type:"spacing",htmlBuilder(t,e){if(_D.hasOwnProperty(t.text)){var r=_D[t.text].className||"";if(t.mode==="text"){var n=T5(t,e,"textord");return n.classes.push(r),n}else return It(["mspace",r],[tD(t.text,t.mode,e)],e)}else{if(SD.hasOwnProperty(t.text))return It(["mspace",SD[t.text]],[],e);throw new $t('Unknown type of space "'+t.text+'"')}},mathmlBuilder(t,e){var r;if(_D.hasOwnProperty(t.text))r=new Ot("mtext",[new ji(" ")]);else{if(SD.hasOwnProperty(t.text))return new Ot("mspace");throw new $t('Unknown type of space "'+t.text+'"')}return r}});var qte=()=>{var t=new Ot("mtd",[]);return t.setAttribute("width","50%"),t};$f({type:"tag",mathmlBuilder(t,e){var r=new Ot("mtable",[new Ot("mtr",[qte(),new Ot("mtd",[Vh(t.body,e)]),qte(),new Ot("mtd",[Vh(t.tag,e)])])]);return r.setAttribute("width","100%"),r}});var Vte={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},Wte={"\\textbf":"textbf","\\textmd":"textmd"},eFe={"\\textit":"textit","\\textup":"textup"},Ute=(t,e)=>{var r=t.font;if(r){if(Vte[r])return e.withTextFontFamily(Vte[r]);if(Wte[r])return e.withTextFontWeight(Wte[r]);if(r==="\\emph")return e.fontShape==="textit"?e.withTextFontShape("textup"):e.withTextFontShape("textit")}else return e;return e.withTextFontShape(eFe[r])};jt({type:"text",names:["\\text","\\textrm","\\textsf","\\texttt","\\textnormal","\\textbf","\\textmd","\\textit","\\textup","\\emph"],props:{numArgs:1,argTypes:["text"],allowedInArgument:!0,allowedInText:!0},handler(t,e){var{parser:r,funcName:n}=t,i=e[0];return{type:"text",mode:r.mode,body:Xi(i),font:n}},htmlBuilder(t,e){var r=Ute(t,e),n=oa(t.body,r,!0);return It(["mord","text"],n,r)},mathmlBuilder(t,e){var r=Ute(t,e);return Vh(t.body,r)}}),jt({type:"underline",names:["\\underline"],props:{numArgs:1,allowedInText:!0},handler(t,e){var{parser:r}=t;return{type:"underline",mode:r.mode,body:e[0]}},htmlBuilder(t,e){var r=pn(t.body,e),n=Gg("underline-line",e),i=e.fontMetrics().defaultRuleThickness,a=fn({positionType:"top",positionData:r.height,children:[{type:"kern",size:i},{type:"elem",elem:n},{type:"kern",size:3*i},{type:"elem",elem:r}]});return It(["mord","underline"],[a],e)},mathmlBuilder(t,e){var r=new Ot("mo",[new ji("‾")]);r.setAttribute("stretchy","true");var n=new Ot("munder",[On(t.body,e),r]);return n.setAttribute("accentunder","true"),n}}),jt({type:"vcenter",names:["\\vcenter"],props:{numArgs:1,argTypes:["original"],allowedInText:!1},handler(t,e){var{parser:r}=t;return{type:"vcenter",mode:r.mode,body:e[0]}},htmlBuilder(t,e){var r=pn(t.body,e),n=e.fontMetrics().axisHeight,i=.5*(r.height-n-(r.depth+n));return fn({positionType:"shift",positionData:i,children:[{type:"elem",elem:r}]})},mathmlBuilder(t,e){var r=new Ot("mpadded",[On(t.body,e)],["vcenter"]);return new Ot("mrow",[r])}}),jt({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler(t,e,r){throw new $t("\\verb ended by end of line instead of matching delimiter")},htmlBuilder(t,e){for(var r=Hte(t),n=[],i=e.havingStyle(e.style.text()),a=0;at.body.replace(/ /g,t.star?"␣":" "),Uh=Yee,Yte=`[ \r + ]`,tFe="\\\\[a-zA-Z@]+",rFe="\\\\[^\uD800-\uDFFF]",nFe="("+tFe+")"+Yte+"*",iFe=`\\\\( |[ \r ]+ -?)[ \r ]*`,J7="[̀-ͯ]",bLe=new RegExp(J7+"+$"),xLe="("+LX+"+)|"+(vLe+"|")+"([!-\\[\\]-‧‪-퟿豈-￿]"+(J7+"*")+"|[\uD800-\uDBFF][\uDC00-\uDFFF]"+(J7+"*")+"|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5"+("|"+yLe)+("|"+mLe+")");let IX=class{constructor(e,r){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=e,this.settings=r,this.tokenRegex=new RegExp(xLe,"g"),this.catcodes={"%":14,"~":13}}setCatcode(e,r){this.catcodes[e]=r}lex(){var e=this.input,r=this.tokenRegex.lastIndex;if(r===e.length)return new Vs("EOF",new xs(this,r,r));var n=this.tokenRegex.exec(e);if(n===null||n.index!==r)throw new Dt("Unexpected character: '"+e[r]+"'",new Vs(e[r],new xs(this,r,r+1)));var i=n[6]||n[3]||(n[2]?"\\ ":" ");if(this.catcodes[i]===14){var a=e.indexOf(` -`,this.tokenRegex.lastIndex);return a===-1?(this.tokenRegex.lastIndex=e.length,this.settings.reportNonstrict("commentAtEnd","% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)")):this.tokenRegex.lastIndex=a+1,this.lex()}return new Vs(i,new xs(this,r,this.tokenRegex.lastIndex))}};class TLe{constructor(e,r){e===void 0&&(e={}),r===void 0&&(r={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=r,this.builtins=e,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(this.undefStack.length===0)throw new Dt("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");var e=this.undefStack.pop();for(var r in e)e.hasOwnProperty(r)&&(e[r]==null?delete this.current[r]:this.current[r]=e[r])}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(e){return this.current.hasOwnProperty(e)||this.builtins.hasOwnProperty(e)}get(e){return this.current.hasOwnProperty(e)?this.current[e]:this.builtins[e]}set(e,r,n){if(n===void 0&&(n=!1),n){for(var i=0;i0&&(this.undefStack[this.undefStack.length-1][e]=r)}else{var a=this.undefStack[this.undefStack.length-1];a&&!a.hasOwnProperty(e)&&(a[e]=this.current[e])}r==null?delete this.current[e]:this.current[e]=r}}var wLe=oX;ge("\\noexpand",function(t){var e=t.popToken();return t.isExpandable(e.text)&&(e.noexpand=!0,e.treatAsRelax=!0),{tokens:[e],numArgs:0}}),ge("\\expandafter",function(t){var e=t.popToken();return t.expandOnce(!0),{tokens:[e],numArgs:0}}),ge("\\@firstoftwo",function(t){var e=t.consumeArgs(2);return{tokens:e[0],numArgs:0}}),ge("\\@secondoftwo",function(t){var e=t.consumeArgs(2);return{tokens:e[1],numArgs:0}}),ge("\\@ifnextchar",function(t){var e=t.consumeArgs(3);t.consumeSpaces();var r=t.future();return e[0].length===1&&e[0][0].text===r.text?{tokens:e[1],numArgs:0}:{tokens:e[2],numArgs:0}}),ge("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}"),ge("\\TextOrMath",function(t){var e=t.consumeArgs(2);return t.mode==="text"?{tokens:e[0],numArgs:0}:{tokens:e[1],numArgs:0}});var DX={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};ge("\\char",function(t){var e=t.popToken(),r,n=0;if(e.text==="'")r=8,e=t.popToken();else if(e.text==='"')r=16,e=t.popToken();else if(e.text==="`")if(e=t.popToken(),e.text[0]==="\\")n=e.text.charCodeAt(1);else{if(e.text==="EOF")throw new Dt("\\char` missing argument");n=e.text.charCodeAt(0)}else r=10;if(r){if(n=DX[e.text],n==null||n>=r)throw new Dt("Invalid base-"+r+" digit "+e.text);for(var i;(i=DX[t.future().text])!=null&&i{var i=t.consumeArg().tokens;if(i.length!==1)throw new Dt("\\newcommand's first argument must be a macro name");var a=i[0].text,s=t.isDefined(a);if(s&&!e)throw new Dt("\\newcommand{"+a+"} attempting to redefine "+(a+"; use \\renewcommand"));if(!s&&!r)throw new Dt("\\renewcommand{"+a+"} when command "+a+" does not yet exist; use \\newcommand");var o=0;if(i=t.consumeArg().tokens,i.length===1&&i[0].text==="["){for(var l="",u=t.expandNextToken();u.text!=="]"&&u.text!=="EOF";)l+=u.text,u=t.expandNextToken();if(!l.match(/^\s*[0-9]+\s*$/))throw new Dt("Invalid number of arguments: "+l);o=parseInt(l),i=t.consumeArg().tokens}return s&&n||t.macros.set(a,{tokens:i,numArgs:o}),""};ge("\\newcommand",t=>e8(t,!1,!0,!1)),ge("\\renewcommand",t=>e8(t,!0,!1,!1)),ge("\\providecommand",t=>e8(t,!0,!0,!0)),ge("\\message",t=>{var e=t.consumeArgs(1)[0];return console.log(e.reverse().map(r=>r.text).join("")),""}),ge("\\errmessage",t=>{var e=t.consumeArgs(1)[0];return console.error(e.reverse().map(r=>r.text).join("")),""}),ge("\\show",t=>{var e=t.popToken(),r=e.text;return console.log(e,t.macros.get(r),Vu[r],Wn.math[r],Wn.text[r]),""}),ge("\\bgroup","{"),ge("\\egroup","}"),ge("~","\\nobreakspace"),ge("\\lq","`"),ge("\\rq","'"),ge("\\aa","\\r a"),ge("\\AA","\\r A"),ge("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}"),ge("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}"),ge("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}"),ge("ℬ","\\mathscr{B}"),ge("ℰ","\\mathscr{E}"),ge("ℱ","\\mathscr{F}"),ge("ℋ","\\mathscr{H}"),ge("ℐ","\\mathscr{I}"),ge("ℒ","\\mathscr{L}"),ge("ℳ","\\mathscr{M}"),ge("ℛ","\\mathscr{R}"),ge("ℭ","\\mathfrak{C}"),ge("ℌ","\\mathfrak{H}"),ge("ℨ","\\mathfrak{Z}"),ge("\\Bbbk","\\Bbb{k}"),ge("\\llap","\\mathllap{\\textrm{#1}}"),ge("\\rlap","\\mathrlap{\\textrm{#1}}"),ge("\\clap","\\mathclap{\\textrm{#1}}"),ge("\\mathstrut","\\vphantom{(}"),ge("\\underbar","\\underline{\\text{#1}}"),ge("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}\\nobreak}{\\char"338}'),ge("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}"),ge("\\ne","\\neq"),ge("≠","\\neq"),ge("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}"),ge("∉","\\notin"),ge("≘","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}"),ge("≙","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}"),ge("≚","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}"),ge("≛","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}"),ge("≝","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}"),ge("≞","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}"),ge("≟","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}"),ge("⟂","\\perp"),ge("‼","\\mathclose{!\\mkern-0.8mu!}"),ge("∌","\\notni"),ge("⌜","\\ulcorner"),ge("⌝","\\urcorner"),ge("⌞","\\llcorner"),ge("⌟","\\lrcorner"),ge("©","\\copyright"),ge("®","\\textregistered"),ge("\\ulcorner",'\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}'),ge("\\urcorner",'\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}'),ge("\\llcorner",'\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}'),ge("\\lrcorner",'\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}'),ge("\\vdots","{\\varvdots\\rule{0pt}{15pt}}"),ge("⋮","\\vdots"),ge("\\varGamma","\\mathit{\\Gamma}"),ge("\\varDelta","\\mathit{\\Delta}"),ge("\\varTheta","\\mathit{\\Theta}"),ge("\\varLambda","\\mathit{\\Lambda}"),ge("\\varXi","\\mathit{\\Xi}"),ge("\\varPi","\\mathit{\\Pi}"),ge("\\varSigma","\\mathit{\\Sigma}"),ge("\\varUpsilon","\\mathit{\\Upsilon}"),ge("\\varPhi","\\mathit{\\Phi}"),ge("\\varPsi","\\mathit{\\Psi}"),ge("\\varOmega","\\mathit{\\Omega}"),ge("\\substack","\\begin{subarray}{c}#1\\end{subarray}"),ge("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax"),ge("\\boxed","\\fbox{$\\displaystyle{#1}$}"),ge("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;"),ge("\\implies","\\DOTSB\\;\\Longrightarrow\\;"),ge("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;"),ge("\\dddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}"),ge("\\ddddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}");var MX={",":"\\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"},CLe=new Set(["bin","rel"]);ge("\\dots",function(t){var e="\\dotso",r=t.expandAfterFuture().text;return r in MX?e=MX[r]:(r.slice(0,4)==="\\not"||r in Wn.math&&CLe.has(Wn.math[r].group))&&(e="\\dotsb"),e});var t8={")":!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};ge("\\dotso",function(t){var e=t.future().text;return e in t8?"\\ldots\\,":"\\ldots"}),ge("\\dotsc",function(t){var e=t.future().text;return e in t8&&e!==","?"\\ldots\\,":"\\ldots"}),ge("\\cdots",function(t){var e=t.future().text;return e in t8?"\\@cdots\\,":"\\@cdots"}),ge("\\dotsb","\\cdots"),ge("\\dotsm","\\cdots"),ge("\\dotsi","\\!\\cdots"),ge("\\dotsx","\\ldots\\,"),ge("\\DOTSI","\\relax"),ge("\\DOTSB","\\relax"),ge("\\DOTSX","\\relax"),ge("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax"),ge("\\,","\\tmspace+{3mu}{.1667em}"),ge("\\thinspace","\\,"),ge("\\>","\\mskip{4mu}"),ge("\\:","\\tmspace+{4mu}{.2222em}"),ge("\\medspace","\\:"),ge("\\;","\\tmspace+{5mu}{.2777em}"),ge("\\thickspace","\\;"),ge("\\!","\\tmspace-{3mu}{.1667em}"),ge("\\negthinspace","\\!"),ge("\\negmedspace","\\tmspace-{4mu}{.2222em}"),ge("\\negthickspace","\\tmspace-{5mu}{.277em}"),ge("\\enspace","\\kern.5em "),ge("\\enskip","\\hskip.5em\\relax"),ge("\\quad","\\hskip1em\\relax"),ge("\\qquad","\\hskip2em\\relax"),ge("\\tag","\\@ifstar\\tag@literal\\tag@paren"),ge("\\tag@paren","\\tag@literal{({#1})}"),ge("\\tag@literal",t=>{if(t.macros.get("\\df@tag"))throw new Dt("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"}),ge("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}"),ge("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)"),ge("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}"),ge("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1"),ge("\\newline","\\\\\\relax"),ge("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");var NX=$t(wl["Main-Regular"][84][1]-.7*wl["Main-Regular"][65][1]);ge("\\LaTeX","\\textrm{\\html@mathml{"+("L\\kern-.36em\\raisebox{"+NX+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{LaTeX}}"),ge("\\KaTeX","\\textrm{\\html@mathml{"+("K\\kern-.17em\\raisebox{"+NX+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{KaTeX}}"),ge("\\hspace","\\@ifstar\\@hspacer\\@hspace"),ge("\\@hspace","\\hskip #1\\relax"),ge("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax"),ge("\\ordinarycolon",":"),ge("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}"),ge("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}'),ge("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}'),ge("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}'),ge("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}'),ge("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}'),ge("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}'),ge("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}'),ge("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}'),ge("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}'),ge("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}'),ge("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}'),ge("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}'),ge("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}'),ge("∷","\\dblcolon"),ge("∹","\\eqcolon"),ge("≔","\\coloneqq"),ge("≕","\\eqqcolon"),ge("⩴","\\Coloneqq"),ge("\\ratio","\\vcentcolon"),ge("\\coloncolon","\\dblcolon"),ge("\\colonequals","\\coloneqq"),ge("\\coloncolonequals","\\Coloneqq"),ge("\\equalscolon","\\eqqcolon"),ge("\\equalscoloncolon","\\Eqqcolon"),ge("\\colonminus","\\coloneq"),ge("\\coloncolonminus","\\Coloneq"),ge("\\minuscolon","\\eqcolon"),ge("\\minuscoloncolon","\\Eqcolon"),ge("\\coloncolonapprox","\\Colonapprox"),ge("\\coloncolonsim","\\Colonsim"),ge("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}"),ge("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}"),ge("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}"),ge("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}"),ge("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}"),ge("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}"),ge("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}"),ge("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}"),ge("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}"),ge("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}"),ge("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}"),ge("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}"),ge("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}"),ge("\\gvertneqq","\\html@mathml{\\@gvertneqq}{≩}"),ge("\\lvertneqq","\\html@mathml{\\@lvertneqq}{≨}"),ge("\\ngeqq","\\html@mathml{\\@ngeqq}{≱}"),ge("\\ngeqslant","\\html@mathml{\\@ngeqslant}{≱}"),ge("\\nleqq","\\html@mathml{\\@nleqq}{≰}"),ge("\\nleqslant","\\html@mathml{\\@nleqslant}{≰}"),ge("\\nshortmid","\\html@mathml{\\@nshortmid}{∤}"),ge("\\nshortparallel","\\html@mathml{\\@nshortparallel}{∦}"),ge("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{⊈}"),ge("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{⊉}"),ge("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{⊊}"),ge("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{⫋}"),ge("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{⊋}"),ge("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{⫌}"),ge("\\imath","\\html@mathml{\\@imath}{ı}"),ge("\\jmath","\\html@mathml{\\@jmath}{ȷ}"),ge("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}"),ge("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}"),ge("⟦","\\llbracket"),ge("⟧","\\rrbracket"),ge("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}"),ge("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}"),ge("⦃","\\lBrace"),ge("⦄","\\rBrace"),ge("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}"),ge("⦵","\\minuso"),ge("\\darr","\\downarrow"),ge("\\dArr","\\Downarrow"),ge("\\Darr","\\Downarrow"),ge("\\lang","\\langle"),ge("\\rang","\\rangle"),ge("\\uarr","\\uparrow"),ge("\\uArr","\\Uparrow"),ge("\\Uarr","\\Uparrow"),ge("\\N","\\mathbb{N}"),ge("\\R","\\mathbb{R}"),ge("\\Z","\\mathbb{Z}"),ge("\\alef","\\aleph"),ge("\\alefsym","\\aleph"),ge("\\Alpha","\\mathrm{A}"),ge("\\Beta","\\mathrm{B}"),ge("\\bull","\\bullet"),ge("\\Chi","\\mathrm{X}"),ge("\\clubs","\\clubsuit"),ge("\\cnums","\\mathbb{C}"),ge("\\Complex","\\mathbb{C}"),ge("\\Dagger","\\ddagger"),ge("\\diamonds","\\diamondsuit"),ge("\\empty","\\emptyset"),ge("\\Epsilon","\\mathrm{E}"),ge("\\Eta","\\mathrm{H}"),ge("\\exist","\\exists"),ge("\\harr","\\leftrightarrow"),ge("\\hArr","\\Leftrightarrow"),ge("\\Harr","\\Leftrightarrow"),ge("\\hearts","\\heartsuit"),ge("\\image","\\Im"),ge("\\infin","\\infty"),ge("\\Iota","\\mathrm{I}"),ge("\\isin","\\in"),ge("\\Kappa","\\mathrm{K}"),ge("\\larr","\\leftarrow"),ge("\\lArr","\\Leftarrow"),ge("\\Larr","\\Leftarrow"),ge("\\lrarr","\\leftrightarrow"),ge("\\lrArr","\\Leftrightarrow"),ge("\\Lrarr","\\Leftrightarrow"),ge("\\Mu","\\mathrm{M}"),ge("\\natnums","\\mathbb{N}"),ge("\\Nu","\\mathrm{N}"),ge("\\Omicron","\\mathrm{O}"),ge("\\plusmn","\\pm"),ge("\\rarr","\\rightarrow"),ge("\\rArr","\\Rightarrow"),ge("\\Rarr","\\Rightarrow"),ge("\\real","\\Re"),ge("\\reals","\\mathbb{R}"),ge("\\Reals","\\mathbb{R}"),ge("\\Rho","\\mathrm{P}"),ge("\\sdot","\\cdot"),ge("\\sect","\\S"),ge("\\spades","\\spadesuit"),ge("\\sub","\\subset"),ge("\\sube","\\subseteq"),ge("\\supe","\\supseteq"),ge("\\Tau","\\mathrm{T}"),ge("\\thetasym","\\vartheta"),ge("\\weierp","\\wp"),ge("\\Zeta","\\mathrm{Z}"),ge("\\argmin","\\DOTSB\\operatorname*{arg\\,min}"),ge("\\argmax","\\DOTSB\\operatorname*{arg\\,max}"),ge("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits"),ge("\\bra","\\mathinner{\\langle{#1}|}"),ge("\\ket","\\mathinner{|{#1}\\rangle}"),ge("\\braket","\\mathinner{\\langle{#1}\\rangle}"),ge("\\Bra","\\left\\langle#1\\right|"),ge("\\Ket","\\left|#1\\right\\rangle");var OX=t=>e=>{var r=e.consumeArg().tokens,n=e.consumeArg().tokens,i=e.consumeArg().tokens,a=e.consumeArg().tokens,s=e.macros.get("|"),o=e.macros.get("\\|");e.macros.beginGroup();var l=d=>f=>{t&&(f.macros.set("|",s),i.length&&f.macros.set("\\|",o));var p=d;if(!d&&i.length){var g=f.future();g.text==="|"&&(f.popToken(),p=!0)}return{tokens:p?i:n,numArgs:0}};e.macros.set("|",l(!1)),i.length&&e.macros.set("\\|",l(!0));var u=e.consumeArg().tokens,h=e.expandTokens([...a,...u,...r]);return e.macros.endGroup(),{tokens:h.reverse(),numArgs:0}};ge("\\bra@ket",OX(!1)),ge("\\bra@set",OX(!0)),ge("\\Braket","\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}"),ge("\\Set","\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}"),ge("\\set","\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}"),ge("\\angln","{\\angl n}"),ge("\\blue","\\textcolor{##6495ed}{#1}"),ge("\\orange","\\textcolor{##ffa500}{#1}"),ge("\\pink","\\textcolor{##ff00af}{#1}"),ge("\\red","\\textcolor{##df0030}{#1}"),ge("\\green","\\textcolor{##28ae7b}{#1}"),ge("\\gray","\\textcolor{gray}{#1}"),ge("\\purple","\\textcolor{##9d38bd}{#1}"),ge("\\blueA","\\textcolor{##ccfaff}{#1}"),ge("\\blueB","\\textcolor{##80f6ff}{#1}"),ge("\\blueC","\\textcolor{##63d9ea}{#1}"),ge("\\blueD","\\textcolor{##11accd}{#1}"),ge("\\blueE","\\textcolor{##0c7f99}{#1}"),ge("\\tealA","\\textcolor{##94fff5}{#1}"),ge("\\tealB","\\textcolor{##26edd5}{#1}"),ge("\\tealC","\\textcolor{##01d1c1}{#1}"),ge("\\tealD","\\textcolor{##01a995}{#1}"),ge("\\tealE","\\textcolor{##208170}{#1}"),ge("\\greenA","\\textcolor{##b6ffb0}{#1}"),ge("\\greenB","\\textcolor{##8af281}{#1}"),ge("\\greenC","\\textcolor{##74cf70}{#1}"),ge("\\greenD","\\textcolor{##1fab54}{#1}"),ge("\\greenE","\\textcolor{##0d923f}{#1}"),ge("\\goldA","\\textcolor{##ffd0a9}{#1}"),ge("\\goldB","\\textcolor{##ffbb71}{#1}"),ge("\\goldC","\\textcolor{##ff9c39}{#1}"),ge("\\goldD","\\textcolor{##e07d10}{#1}"),ge("\\goldE","\\textcolor{##a75a05}{#1}"),ge("\\redA","\\textcolor{##fca9a9}{#1}"),ge("\\redB","\\textcolor{##ff8482}{#1}"),ge("\\redC","\\textcolor{##f9685d}{#1}"),ge("\\redD","\\textcolor{##e84d39}{#1}"),ge("\\redE","\\textcolor{##bc2612}{#1}"),ge("\\maroonA","\\textcolor{##ffbde0}{#1}"),ge("\\maroonB","\\textcolor{##ff92c6}{#1}"),ge("\\maroonC","\\textcolor{##ed5fa6}{#1}"),ge("\\maroonD","\\textcolor{##ca337c}{#1}"),ge("\\maroonE","\\textcolor{##9e034e}{#1}"),ge("\\purpleA","\\textcolor{##ddd7ff}{#1}"),ge("\\purpleB","\\textcolor{##c6b9fc}{#1}"),ge("\\purpleC","\\textcolor{##aa87ff}{#1}"),ge("\\purpleD","\\textcolor{##7854ab}{#1}"),ge("\\purpleE","\\textcolor{##543b78}{#1}"),ge("\\mintA","\\textcolor{##f5f9e8}{#1}"),ge("\\mintB","\\textcolor{##edf2df}{#1}"),ge("\\mintC","\\textcolor{##e0e5cc}{#1}"),ge("\\grayA","\\textcolor{##f6f7f7}{#1}"),ge("\\grayB","\\textcolor{##f0f1f2}{#1}"),ge("\\grayC","\\textcolor{##e3e5e6}{#1}"),ge("\\grayD","\\textcolor{##d6d8da}{#1}"),ge("\\grayE","\\textcolor{##babec2}{#1}"),ge("\\grayF","\\textcolor{##888d93}{#1}"),ge("\\grayG","\\textcolor{##626569}{#1}"),ge("\\grayH","\\textcolor{##3b3e40}{#1}"),ge("\\grayI","\\textcolor{##21242c}{#1}"),ge("\\kaBlue","\\textcolor{##314453}{#1}"),ge("\\kaGreen","\\textcolor{##71B307}{#1}");var $X={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0};class kLe{constructor(e,r,n){this.settings=void 0,this.expansionCount=void 0,this.lexer=void 0,this.macros=void 0,this.stack=void 0,this.mode=void 0,this.settings=r,this.expansionCount=0,this.feed(e),this.macros=new TLe(wLe,r.macros),this.mode=n,this.stack=[]}feed(e){this.lexer=new IX(e,this.settings)}switchMode(e){this.mode=e}beginGroup(){this.macros.beginGroup()}endGroup(){this.macros.endGroup()}endGroups(){this.macros.endGroups()}future(){return this.stack.length===0&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]}popToken(){return this.future(),this.stack.pop()}pushToken(e){this.stack.push(e)}pushTokens(e){this.stack.push(...e)}scanArgument(e){var r,n,i;if(e){if(this.consumeSpaces(),this.future().text!=="[")return null;r=this.popToken(),{tokens:i,end:n}=this.consumeArg(["]"])}else({tokens:i,start:r,end:n}=this.consumeArg());return this.pushToken(new Vs("EOF",n.loc)),this.pushTokens(i),new Vs("",xs.range(r,n))}consumeSpaces(){for(;;){var e=this.future();if(e.text===" ")this.stack.pop();else break}}consumeArg(e){var r=[],n=e&&e.length>0;n||this.consumeSpaces();var i=this.future(),a,s=0,o=0;do{if(a=this.popToken(),r.push(a),a.text==="{")++s;else if(a.text==="}"){if(--s,s===-1)throw new Dt("Extra }",a)}else if(a.text==="EOF")throw new Dt("Unexpected end of input in a macro argument, expected '"+(e&&n?e[o]:"}")+"'",a);if(e&&n)if((s===0||s===1&&e[o]==="{")&&a.text===e[o]){if(++o,o===e.length){r.splice(-o,o);break}}else o=0}while(s!==0||n);return i.text==="{"&&r[r.length-1].text==="}"&&(r.pop(),r.shift()),r.reverse(),{tokens:r,start:i,end:a}}consumeArgs(e,r){if(r){if(r.length!==e+1)throw new Dt("The length of delimiters doesn't match the number of args!");for(var n=r[0],i=0;ithis.settings.maxExpand)throw new Dt("Too many expansions: infinite loop or need to increase maxExpand setting")}expandOnce(e){var r=this.popToken(),n=r.text,i=r.noexpand?null:this._getExpansion(n);if(i==null||e&&i.unexpandable){if(e&&i==null&&n[0]==="\\"&&!this.isDefined(n))throw new Dt("Undefined control sequence: "+n);return this.pushToken(r),!1}this.countExpansion(1);var a=i.tokens,s=this.consumeArgs(i.numArgs,i.delimiters);if(i.numArgs){a=a.slice();for(var o=a.length-1;o>=0;--o){var l=a[o];if(l.text==="#"){if(o===0)throw new Dt("Incomplete placeholder at end of macro body",l);if(l=a[--o],l.text==="#")a.splice(o+1,1);else if(/^[1-9]$/.test(l.text))a.splice(o,2,...s[+l.text-1]);else throw new Dt("Not a valid argument number",l)}}}return this.pushTokens(a),a.length}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;)if(this.expandOnce()===!1){var e=this.stack.pop();return e.treatAsRelax&&(e.text="\\relax"),e}}expandMacro(e){return this.macros.has(e)?this.expandTokens([new Vs(e)]):void 0}expandTokens(e){var r=[],n=this.stack.length;for(this.pushTokens(e);this.stack.length>n;)if(this.expandOnce(!0)===!1){var i=this.stack.pop();i.treatAsRelax&&(i.noexpand=!1,i.treatAsRelax=!1),r.push(i)}return this.countExpansion(r.length),r}expandMacroAsText(e){var r=this.expandMacro(e);return r&&r.map(n=>n.text).join("")}_getExpansion(e){var r=this.macros.get(e);if(r==null)return r;if(e.length===1){var n=this.lexer.catcodes[e];if(n!=null&&n!==13)return}var i=typeof r=="function"?r(this):r;if(typeof i=="string"){var a=0;if(i.includes("#"))for(var s=i.replace(/##/g,"");s.includes("#"+(a+1));)++a;for(var o=new IX(i,this.settings),l=[],u=o.lex();u.text!=="EOF";)l.push(u),u=o.lex();l.reverse();var h={tokens:l,numArgs:a};return h}return i}isDefined(e){return this.macros.has(e)||Vu.hasOwnProperty(e)||Wn.math.hasOwnProperty(e)||Wn.text.hasOwnProperty(e)||$X.hasOwnProperty(e)}isExpandable(e){var r=this.macros.get(e);return r!=null?typeof r=="string"||typeof r=="function"||!r.unexpandable:Vu.hasOwnProperty(e)&&!Vu[e].primitive}}var PX=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,FC=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","ᵝ":"β","ᵞ":"γ","ᵟ":"δ","ᵠ":"ϕ","ᵡ":"χ","ᶿ":"θ"}),r8={"́":{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"}},BX={á:"á",à:"à",ä:"ä",ǟ:"ǟ",ã:"ã",ā:"ā",ă:"ă",ắ:"ắ",ằ:"ằ",ẵ:"ẵ",ǎ:"ǎ",â:"â",ấ:"ấ",ầ:"ầ",ẫ:"ẫ",ȧ:"ȧ",ǡ:"ǡ",å:"å",ǻ:"ǻ",ḃ:"ḃ",ć:"ć",ḉ:"ḉ",č:"č",ĉ:"ĉ",ċ:"ċ",ç:"ç",ď:"ď",ḋ:"ḋ",ḑ:"ḑ",é:"é",è:"è",ë:"ë",ẽ:"ẽ",ē:"ē",ḗ:"ḗ",ḕ:"ḕ",ĕ:"ĕ",ḝ:"ḝ",ě:"ě",ê:"ê",ế:"ế",ề:"ề",ễ:"ễ",ė:"ė",ȩ:"ȩ",ḟ:"ḟ",ǵ:"ǵ",ḡ:"ḡ",ğ:"ğ",ǧ:"ǧ",ĝ:"ĝ",ġ:"ġ",ģ:"ģ",ḧ:"ḧ",ȟ:"ȟ",ĥ:"ĥ",ḣ:"ḣ",ḩ:"ḩ",í:"í",ì:"ì",ï:"ï",ḯ:"ḯ",ĩ:"ĩ",ī:"ī",ĭ:"ĭ",ǐ:"ǐ",î:"î",ǰ:"ǰ",ĵ:"ĵ",ḱ:"ḱ",ǩ:"ǩ",ķ:"ķ",ĺ:"ĺ",ľ:"ľ",ļ:"ļ",ḿ:"ḿ",ṁ:"ṁ",ń:"ń",ǹ:"ǹ",ñ:"ñ",ň:"ň",ṅ:"ṅ",ņ:"ņ",ó:"ó",ò:"ò",ö:"ö",ȫ:"ȫ",õ:"õ",ṍ:"ṍ",ṏ:"ṏ",ȭ:"ȭ",ō:"ō",ṓ:"ṓ",ṑ:"ṑ",ŏ:"ŏ",ǒ:"ǒ",ô:"ô",ố:"ố",ồ:"ồ",ỗ:"ỗ",ȯ:"ȯ",ȱ:"ȱ",ő:"ő",ṕ:"ṕ",ṗ:"ṗ",ŕ:"ŕ",ř:"ř",ṙ:"ṙ",ŗ:"ŗ",ś:"ś",ṥ:"ṥ",š:"š",ṧ:"ṧ",ŝ:"ŝ",ṡ:"ṡ",ş:"ş",ẗ:"ẗ",ť:"ť",ṫ:"ṫ",ţ:"ţ",ú:"ú",ù:"ù",ü:"ü",ǘ:"ǘ",ǜ:"ǜ",ǖ:"ǖ",ǚ:"ǚ",ũ:"ũ",ṹ:"ṹ",ū:"ū",ṻ:"ṻ",ŭ:"ŭ",ǔ:"ǔ",û:"û",ů:"ů",ű:"ű",ṽ:"ṽ",ẃ:"ẃ",ẁ:"ẁ",ẅ:"ẅ",ŵ:"ŵ",ẇ:"ẇ",ẘ:"ẘ",ẍ:"ẍ",ẋ:"ẋ",ý:"ý",ỳ:"ỳ",ÿ:"ÿ",ỹ:"ỹ",ȳ:"ȳ",ŷ:"ŷ",ẏ:"ẏ",ẙ:"ẙ",ź:"ź",ž:"ž",ẑ:"ẑ",ż:"ż",Á:"Á",À:"À",Ä:"Ä",Ǟ:"Ǟ",Ã:"Ã",Ā:"Ā",Ă:"Ă",Ắ:"Ắ",Ằ:"Ằ",Ẵ:"Ẵ",Ǎ:"Ǎ",Â:"Â",Ấ:"Ấ",Ầ:"Ầ",Ẫ:"Ẫ",Ȧ:"Ȧ",Ǡ:"Ǡ",Å:"Å",Ǻ:"Ǻ",Ḃ:"Ḃ",Ć:"Ć",Ḉ:"Ḉ",Č:"Č",Ĉ:"Ĉ",Ċ:"Ċ",Ç:"Ç",Ď:"Ď",Ḋ:"Ḋ",Ḑ:"Ḑ",É:"É",È:"È",Ë:"Ë",Ẽ:"Ẽ",Ē:"Ē",Ḗ:"Ḗ",Ḕ:"Ḕ",Ĕ:"Ĕ",Ḝ:"Ḝ",Ě:"Ě",Ê:"Ê",Ế:"Ế",Ề:"Ề",Ễ:"Ễ",Ė:"Ė",Ȩ:"Ȩ",Ḟ:"Ḟ",Ǵ:"Ǵ",Ḡ:"Ḡ",Ğ:"Ğ",Ǧ:"Ǧ",Ĝ:"Ĝ",Ġ:"Ġ",Ģ:"Ģ",Ḧ:"Ḧ",Ȟ:"Ȟ",Ĥ:"Ĥ",Ḣ:"Ḣ",Ḩ:"Ḩ",Í:"Í",Ì:"Ì",Ï:"Ï",Ḯ:"Ḯ",Ĩ:"Ĩ",Ī:"Ī",Ĭ:"Ĭ",Ǐ:"Ǐ",Î:"Î",İ:"İ",Ĵ:"Ĵ",Ḱ:"Ḱ",Ǩ:"Ǩ",Ķ:"Ķ",Ĺ:"Ĺ",Ľ:"Ľ",Ļ:"Ļ",Ḿ:"Ḿ",Ṁ:"Ṁ",Ń:"Ń",Ǹ:"Ǹ",Ñ:"Ñ",Ň:"Ň",Ṅ:"Ṅ",Ņ:"Ņ",Ó:"Ó",Ò:"Ò",Ö:"Ö",Ȫ:"Ȫ",Õ:"Õ",Ṍ:"Ṍ",Ṏ:"Ṏ",Ȭ:"Ȭ",Ō:"Ō",Ṓ:"Ṓ",Ṑ:"Ṑ",Ŏ:"Ŏ",Ǒ:"Ǒ",Ô:"Ô",Ố:"Ố",Ồ:"Ồ",Ỗ:"Ỗ",Ȯ:"Ȯ",Ȱ:"Ȱ",Ő:"Ő",Ṕ:"Ṕ",Ṗ:"Ṗ",Ŕ:"Ŕ",Ř:"Ř",Ṙ:"Ṙ",Ŗ:"Ŗ",Ś:"Ś",Ṥ:"Ṥ",Š:"Š",Ṧ:"Ṧ",Ŝ:"Ŝ",Ṡ:"Ṡ",Ş:"Ş",Ť:"Ť",Ṫ:"Ṫ",Ţ:"Ţ",Ú:"Ú",Ù:"Ù",Ü:"Ü",Ǘ:"Ǘ",Ǜ:"Ǜ",Ǖ:"Ǖ",Ǚ:"Ǚ",Ũ:"Ũ",Ṹ:"Ṹ",Ū:"Ū",Ṻ:"Ṻ",Ŭ:"Ŭ",Ǔ:"Ǔ",Û:"Û",Ů:"Ů",Ű:"Ű",Ṽ:"Ṽ",Ẃ:"Ẃ",Ẁ:"Ẁ",Ẅ:"Ẅ",Ŵ:"Ŵ",Ẇ:"Ẇ",Ẍ:"Ẍ",Ẋ:"Ẋ",Ý:"Ý",Ỳ:"Ỳ",Ÿ:"Ÿ",Ỹ:"Ỹ",Ȳ:"Ȳ",Ŷ:"Ŷ",Ẏ:"Ẏ",Ź:"Ź",Ž:"Ž",Ẑ:"Ẑ",Ż:"Ż",ά:"ά",ὰ:"ὰ",ᾱ:"ᾱ",ᾰ:"ᾰ",έ:"έ",ὲ:"ὲ",ή:"ή",ὴ:"ὴ",ί:"ί",ὶ:"ὶ",ϊ:"ϊ",ΐ:"ΐ",ῒ:"ῒ",ῑ:"ῑ",ῐ:"ῐ",ό:"ό",ὸ:"ὸ",ύ:"ύ",ὺ:"ὺ",ϋ:"ϋ",ΰ:"ΰ",ῢ:"ῢ",ῡ:"ῡ",ῠ:"ῠ",ώ:"ώ",ὼ:"ὼ",Ύ:"Ύ",Ὺ:"Ὺ",Ϋ:"Ϋ",Ῡ:"Ῡ",Ῠ:"Ῠ",Ώ:"Ώ",Ὼ:"Ὼ"};let FX=class H2e{constructor(e,r){this.mode=void 0,this.gullet=void 0,this.settings=void 0,this.leftrightDepth=void 0,this.nextToken=void 0,this.mode="math",this.gullet=new kLe(e,r,this.mode),this.settings=r,this.leftrightDepth=0,this.nextToken=null}expect(e,r){if(r===void 0&&(r=!0),this.fetch().text!==e)throw new Dt("Expected '"+e+"', got '"+this.fetch().text+"'",this.fetch());r&&this.consume()}consume(){this.nextToken=null}fetch(){return this.nextToken==null&&(this.nextToken=this.gullet.expandNextToken()),this.nextToken}switchMode(e){this.mode=e,this.gullet.switchMode(e)}parse(){this.settings.globalGroup||this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set("\\color","\\textcolor");try{var e=this.parseExpression(!1);return this.expect("EOF"),this.settings.globalGroup||this.gullet.endGroup(),e}finally{this.gullet.endGroups()}}subparse(e){var r=this.nextToken;this.consume(),this.gullet.pushToken(new Vs("}")),this.gullet.pushTokens(e);var n=this.parseExpression(!1);return this.expect("}"),this.nextToken=r,n}parseExpression(e,r){for(var n=[];;){this.mode==="math"&&this.consumeSpaces();var i=this.fetch();if(H2e.endOfExpression.has(i.text)||r&&i.text===r||e&&Vu[i.text]&&Vu[i.text].infix)break;var a=this.parseAtom(r);if(a){if(a.type==="internal")continue}else break;n.push(a)}return this.mode==="text"&&this.formLigatures(n),this.handleInfixNodes(n)}handleInfixNodes(e){for(var r=-1,n,i=0;i=128)this.settings.strict&&(sY(r.charCodeAt(0))?this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+r[0]+'" used in math mode',e):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+r[0]+'"'+(" ("+r.charCodeAt(0)+")"),e)),s={type:"textord",mode:"text",loc:xs.range(e),text:r};else return null;if(this.consume(),a)for(var h=0;h0){if(++e>=fIe)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function dp(t){return function(){return t}}var qC=(function(){try{var t=Cd(Object,"defineProperty");return t({},"",{}),t}catch{}})(),yIe=qC?function(t,e){return qC(t,"toString",{configurable:!0,enumerable:!1,value:dp(e),writable:!0})}:Td,nK=mIe(yIe);function iK(t,e){for(var r=-1,n=t==null?0:t.length;++r-1}var wIe=9007199254740991,CIe=/^(?:0|[1-9]\d*)$/;function VC(t,e){var r=typeof t;return e=e??wIe,!!e&&(r=="number"||r!="symbol"&&CIe.test(t))&&t>-1&&t%1==0&&t-1&&t%1==0&&t<=SIe}function Wu(t){return t!=null&&o8(t.length)&&!mb(t)}function vb(t,e,r){if(!Ws(r))return!1;var n=typeof e;return(n=="number"?Wu(r)&&VC(e,r.length):n=="string"&&e in r)?fp(r[e],t):!1}function AIe(t){return HC(function(e,r){var n=-1,i=r.length,a=i>1?r[i-1]:void 0,s=i>2?r[2]:void 0;for(a=t.length>3&&typeof a=="function"?(i--,a):void 0,s&&vb(r[0],r[1],s)&&(a=i<3?void 0:a,i=1),e=Object(e);++n-1}function $9e(t,e){var r=this.__data__,n=jC(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}function Dc(t){var e=-1,r=t==null?0:t.length;for(this.clear();++eo))return!1;var u=a.get(t),h=a.get(e);if(u&&h)return u==e&&h==t;var d=-1,f=!0,p=r&GMe?new kb:void 0;for(a.set(t,e),a.set(e,t);++d2?e[2]:void 0;for(i&&vb(e[0],e[1],i)&&(n=1);++r-1?i[a?e[s]:s]:void 0}}var LNe=Math.max;function INe(t,e,r){var n=t==null?0:t.length;if(!n)return-1;var i=r==null?0:YLe(r);return i<0&&(i=LNe(n+i,0)),aK(t,Uu(e),i)}var A8=RNe(INe);function ij(t,e){var r=-1,n=Wu(t)?Array(t.length):[];return r5(t,function(i,a,s){n[++r]=e(i,a,s)}),n}function _i(t,e){var r=Ai(t)?hp:ij;return r(t,Uu(e))}function DNe(t,e){return t==null?t:w8(t,S8(e),kd)}function MNe(t,e){return t&&C8(t,S8(e))}function NNe(t,e){return t>e}var ONe=Object.prototype,$Ne=ONe.hasOwnProperty;function PNe(t,e){return t!=null&&$Ne.call(t,e)}function aj(t,e){return t!=null&&JK(t,e,PNe)}function BNe(t,e){return hp(e,function(r){return t[r]})}function Oc(t){return t==null?[]:BNe(t,Us(t))}var FNe="[object Map]",zNe="[object Set]",GNe=Object.prototype,qNe=GNe.hasOwnProperty;function sj(t){if(t==null)return!0;if(Wu(t)&&(Ai(t)||typeof t=="string"||typeof t.splice=="function"||gp(t)||KC(t)||pp(t)))return!t.length;var e=uo(t);if(e==FNe||e==zNe)return!t.size;if(YC(t))return!yK(t).length;for(var r in t)if(qNe.call(t,r))return!1;return!0}function fi(t){return t===void 0}function oj(t,e){return te||a&&s&&l&&!o&&!u||n&&s&&l||!r&&l||!i)return 1;if(!n&&!a&&!u&&t=o)return l;var u=r[n];return l*(u=="desc"?-1:1)}}return t.index-e.index}function XNe(t,e,r){e.length?e=hp(e,function(a){return Ai(a)?function(s){return JC(s,a.length===1?a[0]:a)}:a}):e=[Td];var n=-1;e=hp(e,XC(Uu));var i=ij(t,function(a,s,o){var l=hp(e,function(u){return u(a)});return{criteria:l,index:++n,value:a}});return UNe(i,function(a,s){return YNe(a,s,r)})}function KNe(t,e){return WNe(t,e,function(r,n){return ej(t,n)})}var a5=Z9e(function(t,e){return t==null?{}:KNe(t,e)}),jNe=Math.ceil,ZNe=Math.max;function QNe(t,e,r,n){for(var i=-1,a=ZNe(jNe((e-t)/(r||1)),0),s=Array(a);a--;)s[++i]=t,t+=r;return s}function JNe(t){return function(e,r,n){return n&&typeof n!="number"&&vb(e,r,n)&&(r=n=void 0),e=GC(e),r===void 0?(r=e,e=0):r=GC(r),n=n===void 0?e1&&vb(t,e[0],e[1])?e=[]:r>2&&vb(e[0],e[1],e[2])&&(e=[e[0]]),XNe(t,d8(e),[])}),tOe=1/0,rOe=vp&&1/b8(new vp([,-0]))[1]==tOe?function(t){return new vp(t)}:dIe,nOe=200;function iOe(t,e,r){var n=-1,i=TIe,a=t.length,s=!0,o=[],l=o;if(a>=nOe){var u=rOe(t);if(u)return b8(u);s=!1,i=UK,l=new kb}else l=o;e:for(;++n1?i.setNode(a,r):i.setNode(a)}),this}setNode(e,r){return Object.prototype.hasOwnProperty.call(this._nodes,e)?(arguments.length>1&&(this._nodes[e]=r),this):(this._nodes[e]=arguments.length>1?r:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]=Ad,this._children[e]={},this._children[Ad][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount,this)}node(e){return this._nodes[e]}hasNode(e){return Object.prototype.hasOwnProperty.call(this._nodes,e)}removeNode(e){if(Object.prototype.hasOwnProperty.call(this._nodes,e)){var r=n=>this.removeEdge(this._edgeObjs[n]);delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],gt(this.children(e),n=>{this.setParent(n)}),delete this._children[e]),gt(Us(this._in[e]),r),delete this._in[e],delete this._preds[e],gt(Us(this._out[e]),r),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this}setParent(e,r){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(fi(r))r=Ad;else{r+="";for(var n=r;!fi(n);n=this.parent(n))if(n===e)throw new Error("Setting "+r+" as parent of "+e+" would create a cycle");this.setNode(r)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=r,this._children[r][e]=!0,this}_removeFromParentsChildList(e){delete this._children[this._parent[e]][e]}parent(e){if(this._isCompound){var r=this._parent[e];if(r!==Ad)return r}}children(e){if(fi(e)&&(e=Ad),this._isCompound){var r=this._children[e];if(r)return Us(r)}else{if(e===Ad)return this.nodes();if(this.hasNode(e))return[]}}predecessors(e){var r=this._preds[e];if(r)return Us(r)}successors(e){var r=this._sucs[e];if(r)return Us(r)}neighbors(e){var r=this.predecessors(e);if(r)return aOe(r,this.successors(e))}isLeaf(e){var r;return this.isDirected()?r=this.successors(e):r=this.neighbors(e),r.length===0}filterNodes(e){var r=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});r.setGraph(this.graph());var n=this;gt(this._nodes,function(s,o){e(o)&&r.setNode(o,s)}),gt(this._edgeObjs,function(s){r.hasNode(s.v)&&r.hasNode(s.w)&&r.setEdge(s,n.edge(s))});var i={};function a(s){var o=n.parent(s);return o===void 0||r.hasNode(o)?(i[s]=o,o):o in i?i[o]:a(o)}return this._isCompound&>(r.nodes(),function(s){r.setParent(s,a(s))}),r}setDefaultEdgeLabel(e){return mb(e)||(e=dp(e)),this._defaultEdgeLabelFn=e,this}edgeCount(){return this._edgeCount}edges(){return Oc(this._edgeObjs)}setPath(e,r){var n=this,i=arguments;return Sb(e,function(a,s){return i.length>1?n.setEdge(a,s,r):n.setEdge(a,s),s}),this}setEdge(){var e,r,n,i,a=!1,s=arguments[0];typeof s=="object"&&s!==null&&"v"in s?(e=s.v,r=s.w,n=s.name,arguments.length===2&&(i=arguments[1],a=!0)):(e=s,r=arguments[1],n=arguments[3],arguments.length>2&&(i=arguments[2],a=!0)),e=""+e,r=""+r,fi(n)||(n=""+n);var o=_b(this._isDirected,e,r,n);if(Object.prototype.hasOwnProperty.call(this._edgeLabels,o))return a&&(this._edgeLabels[o]=i),this;if(!fi(n)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(e),this.setNode(r),this._edgeLabels[o]=a?i:this._defaultEdgeLabelFn(e,r,n);var l=uOe(this._isDirected,e,r,n);return e=l.v,r=l.w,Object.freeze(l),this._edgeObjs[o]=l,cj(this._preds[r],e),cj(this._sucs[e],r),this._in[r][o]=l,this._out[e][o]=l,this._edgeCount++,this}edge(e,r,n){var i=arguments.length===1?D8(this._isDirected,arguments[0]):_b(this._isDirected,e,r,n);return this._edgeLabels[i]}hasEdge(e,r,n){var i=arguments.length===1?D8(this._isDirected,arguments[0]):_b(this._isDirected,e,r,n);return Object.prototype.hasOwnProperty.call(this._edgeLabels,i)}removeEdge(e,r,n){var i=arguments.length===1?D8(this._isDirected,arguments[0]):_b(this._isDirected,e,r,n),a=this._edgeObjs[i];return a&&(e=a.v,r=a.w,delete this._edgeLabels[i],delete this._edgeObjs[i],uj(this._preds[r],e),uj(this._sucs[e],r),delete this._in[r][i],delete this._out[e][i],this._edgeCount--),this}inEdges(e,r){var n=this._in[e];if(n){var i=Oc(n);return r?Nc(i,function(a){return a.v===r}):i}}outEdges(e,r){var n=this._out[e];if(n){var i=Oc(n);return r?Nc(i,function(a){return a.w===r}):i}}nodeEdges(e,r){var n=this.inEdges(e,r);if(n)return n.concat(this.outEdges(e,r))}}Ts.prototype._nodeCount=0,Ts.prototype._edgeCount=0;function cj(t,e){t[e]?t[e]++:t[e]=1}function uj(t,e){--t[e]||delete t[e]}function _b(t,e,r,n){var i=""+e,a=""+r;if(!t&&i>a){var s=i;i=a,a=s}return i+lj+a+lj+(fi(n)?cOe:n)}function uOe(t,e,r,n){var i=""+e,a=""+r;if(!t&&i>a){var s=i;i=a,a=s}var o={v:i,w:a};return n&&(o.name=n),o}function D8(t,e){return _b(t,e.v,e.w,e.name)}class hOe{constructor(){var e={};e._next=e._prev=e,this._sentinel=e}dequeue(){var e=this._sentinel,r=e._prev;if(r!==e)return hj(r),r}enqueue(e){var r=this._sentinel;e._prev&&e._next&&hj(e),e._next=r._next,r._next._prev=e,r._next=e,e._prev=r}toString(){for(var e=[],r=this._sentinel,n=r._prev;n!==r;)e.push(JSON.stringify(n,dOe)),n=n._prev;return"["+e.join(", ")+"]"}}function hj(t){t._prev._next=t._next,t._next._prev=t._prev,delete t._next,delete t._prev}function dOe(t,e){if(t!=="_next"&&t!=="_prev")return e}var fOe=dp(1);function pOe(t,e){if(t.nodeCount()<=1)return[];var r=mOe(t,e||fOe),n=gOe(r.graph,r.buckets,r.zeroIdx);return yp(_i(n,function(i){return t.outEdges(i.v,i.w)}))}function gOe(t,e,r){for(var n=[],i=e[e.length-1],a=e[0],s;t.nodeCount();){for(;s=a.dequeue();)M8(t,e,r,s);for(;s=i.dequeue();)M8(t,e,r,s);if(t.nodeCount()){for(var o=e.length-2;o>0;--o)if(s=e[o].dequeue(),s){n=n.concat(M8(t,e,r,s,!0));break}}}return n}function M8(t,e,r,n,i){var a=i?[]:void 0;return gt(t.inEdges(n.v),function(s){var o=t.edge(s),l=t.node(s.v);i&&a.push({v:s.v,w:s.w}),l.out-=o,N8(e,r,l)}),gt(t.outEdges(n.v),function(s){var o=t.edge(s),l=s.w,u=t.node(l);u.in-=o,N8(e,r,u)}),t.removeNode(n.v),a}function mOe(t,e){var r=new Ts,n=0,i=0;gt(t.nodes(),function(o){r.setNode(o,{v:o,in:0,out:0})}),gt(t.edges(),function(o){var l=r.edge(o.v,o.w)||0,u=e(o),h=l+u;r.setEdge(o.v,o.w,h),i=Math.max(i,r.node(o.v).out+=u),n=Math.max(n,r.node(o.w).in+=u)});var a=bp(i+n+3).map(function(){return new hOe}),s=n+1;return gt(r.nodes(),function(o){N8(a,s,r.node(o))}),{graph:r,buckets:a,zeroIdx:s}}function N8(t,e,r){r.out?r.in?t[r.out-r.in+e].enqueue(r):t[t.length-1].enqueue(r):t[0].enqueue(r)}function yOe(t){var e=t.graph().acyclicer==="greedy"?pOe(t,r(t)):vOe(t);gt(e,function(n){var i=t.edge(n);t.removeEdge(n),i.forwardName=n.name,i.reversed=!0,t.setEdge(n.w,n.v,i,I8("rev"))});function r(n){return function(i){return n.edge(i).weight}}}function vOe(t){var e=[],r={},n={};function i(a){Object.prototype.hasOwnProperty.call(n,a)||(n[a]=!0,r[a]=!0,gt(t.outEdges(a),function(s){Object.prototype.hasOwnProperty.call(r,s.w)?e.push(s):i(s.w)}),delete r[a])}return gt(t.nodes(),i),e}function bOe(t){gt(t.edges(),function(e){var r=t.edge(e);if(r.reversed){t.removeEdge(e);var n=r.forwardName;delete r.reversed,delete r.forwardName,t.setEdge(e.w,e.v,r,n)}})}function xp(t,e,r,n){var i;do i=I8(n);while(t.hasNode(i));return r.dummy=e,t.setNode(i,r),i}function xOe(t){var e=new Ts().setGraph(t.graph());return gt(t.nodes(),function(r){e.setNode(r,t.node(r))}),gt(t.edges(),function(r){var n=e.edge(r.v,r.w)||{weight:0,minlen:1},i=t.edge(r);e.setEdge(r.v,r.w,{weight:n.weight+i.weight,minlen:Math.max(n.minlen,i.minlen)})}),e}function dj(t){var e=new Ts({multigraph:t.isMultigraph()}).setGraph(t.graph());return gt(t.nodes(),function(r){t.children(r).length||e.setNode(r,t.node(r))}),gt(t.edges(),function(r){e.setEdge(r,t.edge(r))}),e}function fj(t,e){var r=t.x,n=t.y,i=e.x-r,a=e.y-n,s=t.width/2,o=t.height/2;if(!i&&!a)throw new Error("Not possible to find intersection inside of the rectangle");var l,u;return Math.abs(a)*s>Math.abs(i)*o?(a<0&&(o=-o),l=o*i/a,u=o):(i<0&&(s=-s),l=s,u=s*a/i),{x:r+l,y:n+u}}function s5(t){var e=_i(bp(gj(t)+1),function(){return[]});return gt(t.nodes(),function(r){var n=t.node(r),i=n.rank;fi(i)||(e[i][n.order]=r)}),e}function TOe(t){var e=Eb(_i(t.nodes(),function(r){return t.node(r).rank}));gt(t.nodes(),function(r){var n=t.node(r);aj(n,"rank")&&(n.rank-=e)})}function wOe(t){var e=Eb(_i(t.nodes(),function(a){return t.node(a).rank})),r=[];gt(t.nodes(),function(a){var s=t.node(a).rank-e;r[s]||(r[s]=[]),r[s].push(a)});var n=0,i=t.graph().nodeRankFactor;gt(r,function(a,s){fi(a)&&s%i!==0?--n:n&>(a,function(o){t.node(o).rank+=n})})}function pj(t,e,r,n){var i={width:0,height:0};return arguments.length>=4&&(i.rank=r,i.order=n),xp(t,"border",i,e)}function gj(t){return Sd(_i(t.nodes(),function(e){var r=t.node(e).rank;if(!fi(r))return r}))}function COe(t,e){var r={lhs:[],rhs:[]};return gt(t,function(n){e(n)?r.lhs.push(n):r.rhs.push(n)}),r}function kOe(t,e){return e()}function EOe(t){function e(r){var n=t.children(r),i=t.node(r);if(n.length&>(n,e),Object.prototype.hasOwnProperty.call(i,"minRank")){i.borderLeft=[],i.borderRight=[];for(var a=i.minRank,s=i.maxRank+1;as.lim&&(o=s,l=!0);var u=Nc(e.edges(),function(h){return l===Aj(t,t.node(h.v),o)&&l!==Aj(t,t.node(h.w),o)});return L8(u,function(h){return Rb(e,h)})}function Sj(t,e,r,n){var i=r.v,a=r.w;t.removeEdge(i,a),t.setEdge(n.v,n.w,{}),F8(t),B8(t,e),zOe(t,e)}function zOe(t,e){var r=A8(t.nodes(),function(i){return!e.node(i).parent}),n=BOe(t,r);n=n.slice(1),gt(n,function(i){var a=t.node(i).parent,s=e.edge(i,a),o=!1;s||(s=e.edge(a,i),o=!0),e.node(i).rank=e.node(a).rank+(o?s.minlen:-s.minlen)})}function GOe(t,e,r){return t.hasEdge(e,r)}function Aj(t,e,r){return r.low<=e.lim&&e.lim<=r.lim}function qOe(t){switch(t.graph().ranker){case"network-simplex":_j(t);break;case"tight-tree":WOe(t);break;case"longest-path":VOe(t);break;default:_j(t)}}var VOe=P8;function WOe(t){P8(t),bj(t)}function _j(t){_d(t)}function UOe(t){var e=xp(t,"root",{},"_root"),r=HOe(t),n=Sd(Oc(r))-1,i=2*n+1;t.graph().nestingRoot=e,gt(t.edges(),function(s){t.edge(s).minlen*=i});var a=YOe(t)+1;gt(t.children(),function(s){Rj(t,e,i,a,n,r,s)}),t.graph().nodeRankFactor=i}function Rj(t,e,r,n,i,a,s){var o=t.children(s);if(!o.length){s!==e&&t.setEdge(e,s,{weight:0,minlen:r});return}var l=pj(t,"_bt"),u=pj(t,"_bb"),h=t.node(s);t.setParent(l,s),h.borderTop=l,t.setParent(u,s),h.borderBottom=u,gt(o,function(d){Rj(t,e,r,n,i,a,d);var f=t.node(d),p=f.borderTop?f.borderTop:d,g=f.borderBottom?f.borderBottom:d,m=f.borderTop?n:2*n,y=p!==g?1:i-a[s]+1;t.setEdge(l,p,{weight:m,minlen:y,nestingEdge:!0}),t.setEdge(g,u,{weight:m,minlen:y,nestingEdge:!0})}),t.parent(s)||t.setEdge(e,l,{weight:0,minlen:i+a[s]})}function HOe(t){var e={};function r(n,i){var a=t.children(n);a&&a.length&>(a,function(s){r(s,i+1)}),e[n]=i}return gt(t.children(),function(n){r(n,1)}),e}function YOe(t){return Sb(t.edges(),function(e,r){return e+t.edge(r).weight},0)}function XOe(t){var e=t.graph();t.removeNode(e.nestingRoot),delete e.nestingRoot,gt(t.edges(),function(r){var n=t.edge(r);n.nestingEdge&&t.removeEdge(r)})}function KOe(t,e,r){var n={},i;gt(r,function(a){for(var s=t.parent(a),o,l;s;){if(o=t.parent(s),o?(l=n[o],n[o]=s):(l=i,i=s),l&&l!==s){e.setEdge(l,s);return}s=o}})}function jOe(t,e,r){var n=ZOe(t),i=new Ts({compound:!0}).setGraph({root:n}).setDefaultNodeLabel(function(a){return t.node(a)});return gt(t.nodes(),function(a){var s=t.node(a),o=t.parent(a);(s.rank===e||s.minRank<=e&&e<=s.maxRank)&&(i.setNode(a),i.setParent(a,o||n),gt(t[r](a),function(l){var u=l.v===a?l.w:l.v,h=i.edge(u,a),d=fi(h)?0:h.weight;i.setEdge(u,a,{weight:t.edge(l).weight+d})}),Object.prototype.hasOwnProperty.call(s,"minRank")&&i.setNode(a,{borderLeft:s.borderLeft[e],borderRight:s.borderRight[e]}))}),i}function ZOe(t){for(var e;t.hasNode(e=I8("_root")););return e}function QOe(t,e){for(var r=0,n=1;n0;)h%2&&(d+=o[h+1]),h=h-1>>1,o[h]+=u.weight;l+=u.weight*d})),l}function e$e(t){var e={},r=Nc(t.nodes(),function(o){return!t.children(o).length}),n=Sd(_i(r,function(o){return t.node(o).rank})),i=_i(bp(n+1),function(){return[]});function a(o){if(!aj(e,o)){e[o]=!0;var l=t.node(o);i[l.rank].push(o),gt(t.successors(o),a)}}var s=Ab(r,function(o){return t.node(o).rank});return gt(s,a),i}function t$e(t,e){return _i(e,function(r){var n=t.inEdges(r);if(n.length){var i=Sb(n,function(a,s){var o=t.edge(s),l=t.node(s.v);return{sum:a.sum+o.weight*l.order,weight:a.weight+o.weight}},{sum:0,weight:0});return{v:r,barycenter:i.sum/i.weight,weight:i.weight}}else return{v:r}})}function r$e(t,e){var r={};gt(t,function(i,a){var s=r[i.v]={indegree:0,in:[],out:[],vs:[i.v],i:a};fi(i.barycenter)||(s.barycenter=i.barycenter,s.weight=i.weight)}),gt(e.edges(),function(i){var a=r[i.v],s=r[i.w];!fi(a)&&!fi(s)&&(s.indegree++,a.out.push(r[i.w]))});var n=Nc(r,function(i){return!i.indegree});return n$e(n)}function n$e(t){var e=[];function r(a){return function(s){s.merged||(fi(s.barycenter)||fi(a.barycenter)||s.barycenter>=a.barycenter)&&i$e(a,s)}}function n(a){return function(s){s.in.push(a),--s.indegree===0&&t.push(s)}}for(;t.length;){var i=t.pop();e.push(i),gt(i.in.reverse(),r(i)),gt(i.out,n(i))}return _i(Nc(e,function(a){return!a.merged}),function(a){return a5(a,["vs","i","barycenter","weight"])})}function i$e(t,e){var r=0,n=0;t.weight&&(r+=t.barycenter*t.weight,n+=t.weight),e.weight&&(r+=e.barycenter*e.weight,n+=e.weight),t.vs=e.vs.concat(t.vs),t.barycenter=r/n,t.weight=n,t.i=Math.min(e.i,t.i),e.merged=!0}function a$e(t,e){var r=COe(t,function(h){return Object.prototype.hasOwnProperty.call(h,"barycenter")}),n=r.lhs,i=Ab(r.rhs,function(h){return-h.i}),a=[],s=0,o=0,l=0;n.sort(s$e(!!e)),l=Lj(a,i,l),gt(n,function(h){l+=h.vs.length,a.push(h.vs),s+=h.barycenter*h.weight,o+=h.weight,l=Lj(a,i,l)});var u={vs:yp(a)};return o&&(u.barycenter=s/o,u.weight=o),u}function Lj(t,e,r){for(var n;e.length&&(n=n5(e)).i<=r;)e.pop(),t.push(n.vs),r++;return r}function s$e(t){return function(e,r){return e.barycenterr.barycenter?1:t?r.i-e.i:e.i-r.i}}function Ij(t,e,r,n){var i=t.children(e),a=t.node(e),s=a?a.borderLeft:void 0,o=a?a.borderRight:void 0,l={};s&&(i=Nc(i,function(g){return g!==s&&g!==o}));var u=t$e(t,i);gt(u,function(g){if(t.children(g.v).length){var m=Ij(t,g.v,r,n);l[g.v]=m,Object.prototype.hasOwnProperty.call(m,"barycenter")&&l$e(g,m)}});var h=r$e(u,r);o$e(h,l);var d=a$e(h,n);if(s&&(d.vs=yp([s,d.vs,o]),t.predecessors(s).length)){var f=t.node(t.predecessors(s)[0]),p=t.node(t.predecessors(o)[0]);Object.prototype.hasOwnProperty.call(d,"barycenter")||(d.barycenter=0,d.weight=0),d.barycenter=(d.barycenter*d.weight+f.order+p.order)/(d.weight+2),d.weight+=2}return d}function o$e(t,e){gt(t,function(r){r.vs=yp(r.vs.map(function(n){return e[n]?e[n].vs:n}))})}function l$e(t,e){fi(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 c$e(t){var e=gj(t),r=Dj(t,bp(1,e+1),"inEdges"),n=Dj(t,bp(e-1,-1,-1),"outEdges"),i=e$e(t);Mj(t,i);for(var a=Number.POSITIVE_INFINITY,s,o=0,l=0;l<4;++o,++l){u$e(o%2?r:n,o%4>=2),i=s5(t);var u=QOe(t,i);us||o>e[l].lim));for(u=l,l=n;(l=t.parent(l))!==u;)a.push(l);return{path:i.concat(a.reverse()),lca:u}}function f$e(t){var e={},r=0;function n(i){var a=r;gt(t.children(i),n),e[i]={low:a,lim:r++}}return gt(t.children(),n),e}function p$e(t,e){var r={};function n(i,a){var s=0,o=0,l=i.length,u=n5(a);return gt(a,function(h,d){var f=m$e(t,h),p=f?t.node(f).order:l;(f||h===u)&&(gt(a.slice(o,d+1),function(g){gt(t.predecessors(g),function(m){var y=t.node(m),v=y.order;(vu)&&Nj(r,f,h)})})}function i(a,s){var o=-1,l,u=0;return gt(s,function(h,d){if(t.node(h).dummy==="border"){var f=t.predecessors(h);f.length&&(l=t.node(f[0]).order,n(s,u,d,o,l),u=d,o=l)}n(s,u,s.length,l,a.length)}),s}return Sb(e,i),r}function m$e(t,e){if(t.node(e).dummy)return A8(t.predecessors(e),function(r){return t.node(r).dummy})}function Nj(t,e,r){if(e>r){var n=e;e=r,r=n}Object.prototype.hasOwnProperty.call(t,e)||Object.defineProperty(t,e,{enumerable:!0,configurable:!0,value:{},writable:!0});var i=t[e];Object.defineProperty(i,r,{enumerable:!0,configurable:!0,value:!0,writable:!0})}function y$e(t,e,r){if(e>r){var n=e;e=r,r=n}return!!t[e]&&Object.prototype.hasOwnProperty.call(t[e],r)}function v$e(t,e,r,n){var i={},a={},s={};return gt(e,function(o){gt(o,function(l,u){i[l]=l,a[l]=l,s[l]=u})}),gt(e,function(o){var l=-1;gt(o,function(u){var h=n(u);if(h.length){h=Ab(h,function(m){return s[m]});for(var d=(h.length-1)/2,f=Math.floor(d),p=Math.ceil(d);f<=p;++f){var g=h[f];a[u]===u&&l{var n=r(" buildLayoutGraph",()=>F$e(t));r(" runLayout",()=>R$e(n,r)),r(" updateInputGraph",()=>L$e(t,n))})}function R$e(t,e){e(" makeSpaceForEdgeLabels",()=>z$e(t)),e(" removeSelfEdges",()=>K$e(t)),e(" acyclic",()=>yOe(t)),e(" nestingGraph.run",()=>UOe(t)),e(" rank",()=>qOe(dj(t))),e(" injectEdgeLabelProxies",()=>G$e(t)),e(" removeEmptyRanks",()=>wOe(t)),e(" nestingGraph.cleanup",()=>XOe(t)),e(" normalizeRanks",()=>TOe(t)),e(" assignRankMinMax",()=>q$e(t)),e(" removeEdgeLabelProxies",()=>V$e(t)),e(" normalize.run",()=>LOe(t)),e(" parentDummyChains",()=>h$e(t)),e(" addBorderSegments",()=>EOe(t)),e(" order",()=>c$e(t)),e(" insertSelfEdges",()=>j$e(t)),e(" adjustCoordinateSystem",()=>SOe(t)),e(" position",()=>A$e(t)),e(" positionSelfEdges",()=>Z$e(t)),e(" removeBorderNodes",()=>X$e(t)),e(" normalize.undo",()=>DOe(t)),e(" fixupEdgeLabelCoords",()=>H$e(t)),e(" undoCoordinateSystem",()=>AOe(t)),e(" translateGraph",()=>W$e(t)),e(" assignNodeIntersects",()=>U$e(t)),e(" reversePoints",()=>Y$e(t)),e(" acyclic.undo",()=>bOe(t))}function L$e(t,e){gt(t.nodes(),function(r){var n=t.node(r),i=e.node(r);n&&(n.x=i.x,n.y=i.y,e.children(r).length&&(n.width=i.width,n.height=i.height))}),gt(t.edges(),function(r){var n=t.edge(r),i=e.edge(r);n.points=i.points,Object.prototype.hasOwnProperty.call(i,"x")&&(n.x=i.x,n.y=i.y)}),t.graph().width=e.graph().width,t.graph().height=e.graph().height}var I$e=["nodesep","edgesep","ranksep","marginx","marginy"],D$e={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},M$e=["acyclicer","ranker","rankdir","align"],N$e=["width","height"],O$e={width:0,height:0},$$e=["minlen","weight","width","height","labeloffset"],P$e={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},B$e=["labelpos"];function F$e(t){var e=new Ts({multigraph:!0,compound:!0}),r=G8(t.graph());return e.setGraph(R8({},D$e,z8(r,I$e),a5(r,M$e))),gt(t.nodes(),function(n){var i=G8(t.node(n));e.setNode(n,ENe(z8(i,N$e),O$e)),e.setParent(n,t.parent(n))}),gt(t.edges(),function(n){var i=G8(t.edge(n));e.setEdge(n,R8({},P$e,z8(i,$$e),a5(i,B$e)))}),e}function z$e(t){var e=t.graph();e.ranksep/=2,gt(t.edges(),function(r){var n=t.edge(r);n.minlen*=2,n.labelpos.toLowerCase()!=="c"&&(e.rankdir==="TB"||e.rankdir==="BT"?n.width+=n.labeloffset:n.height+=n.labeloffset)})}function G$e(t){gt(t.edges(),function(e){var r=t.edge(e);if(r.width&&r.height){var n=t.node(e.v),i=t.node(e.w),a={rank:(i.rank-n.rank)/2+n.rank,e};xp(t,"edge-proxy",a,"_ep")}})}function q$e(t){var e=0;gt(t.nodes(),function(r){var n=t.node(r);n.borderTop&&(n.minRank=t.node(n.borderTop).rank,n.maxRank=t.node(n.borderBottom).rank,e=Sd(e,n.maxRank))}),t.graph().maxRank=e}function V$e(t){gt(t.nodes(),function(e){var r=t.node(e);r.dummy==="edge-proxy"&&(t.edge(r.e).labelRank=r.rank,t.removeNode(e))})}function W$e(t){var e=Number.POSITIVE_INFINITY,r=0,n=Number.POSITIVE_INFINITY,i=0,a=t.graph(),s=a.marginx||0,o=a.marginy||0;function l(u){var h=u.x,d=u.y,f=u.width,p=u.height;e=Math.min(e,h-f/2),r=Math.max(r,h+f/2),n=Math.min(n,d-p/2),i=Math.max(i,d+p/2)}gt(t.nodes(),function(u){l(t.node(u))}),gt(t.edges(),function(u){var h=t.edge(u);Object.prototype.hasOwnProperty.call(h,"x")&&l(h)}),e-=s,n-=o,gt(t.nodes(),function(u){var h=t.node(u);h.x-=e,h.y-=n}),gt(t.edges(),function(u){var h=t.edge(u);gt(h.points,function(d){d.x-=e,d.y-=n}),Object.prototype.hasOwnProperty.call(h,"x")&&(h.x-=e),Object.prototype.hasOwnProperty.call(h,"y")&&(h.y-=n)}),a.width=r-e+s,a.height=i-n+o}function U$e(t){gt(t.edges(),function(e){var r=t.edge(e),n=t.node(e.v),i=t.node(e.w),a,s;r.points?(a=r.points[0],s=r.points[r.points.length-1]):(r.points=[],a=i,s=n),r.points.unshift(fj(n,a)),r.points.push(fj(i,s))})}function H$e(t){gt(t.edges(),function(e){var r=t.edge(e);if(Object.prototype.hasOwnProperty.call(r,"x"))switch((r.labelpos==="l"||r.labelpos==="r")&&(r.width-=r.labeloffset),r.labelpos){case"l":r.x-=r.width/2+r.labeloffset;break;case"r":r.x+=r.width/2+r.labeloffset;break}})}function Y$e(t){gt(t.edges(),function(e){var r=t.edge(e);r.reversed&&r.points.reverse()})}function X$e(t){gt(t.nodes(),function(e){if(t.children(e).length){var r=t.node(e),n=t.node(r.borderTop),i=t.node(r.borderBottom),a=t.node(n5(r.borderLeft)),s=t.node(n5(r.borderRight));r.width=Math.abs(s.x-a.x),r.height=Math.abs(i.y-n.y),r.x=a.x+r.width/2,r.y=n.y+r.height/2}}),gt(t.nodes(),function(e){t.node(e).dummy==="border"&&t.removeNode(e)})}function K$e(t){gt(t.edges(),function(e){if(e.v===e.w){var r=t.node(e.v);r.selfEdges||(r.selfEdges=[]),r.selfEdges.push({e,label:t.edge(e)}),t.removeEdge(e)}})}function j$e(t){var e=s5(t);gt(e,function(r){var n=0;gt(r,function(i,a){var s=t.node(i);s.order=a+n,gt(s.selfEdges,function(o){xp(t,"selfedge",{width:o.label.width,height:o.label.height,rank:s.rank,order:a+ ++n,e:o.e,label:o.label},"_se")}),delete s.selfEdges})})}function Z$e(t){gt(t.nodes(),function(e){var r=t.node(e);if(r.dummy==="selfedge"){var n=t.node(r.e.v),i=n.x+n.width/2,a=n.y,s=r.x-i,o=n.height/2;t.setEdge(r.e,r.label),t.removeNode(e),r.label.points=[{x:i+2*s/3,y:a-o},{x:i+5*s/6,y:a-o},{x:i+s,y:a},{x:i+5*s/6,y:a+o},{x:i+2*s/3,y:a+o}],r.label.x=r.x,r.label.y=r.y}})}function z8(t,e){return i5(a5(t,e),Number)}function G8(t){var e={};return gt(t,function(r,n){e[n.toLowerCase()]=r}),e}function _l(t){var e={options:{directed:t.isDirected(),multigraph:t.isMultigraph(),compound:t.isCompound()},nodes:Q$e(t),edges:J$e(t)};return fi(t.graph())||(e.value=DMe(t.graph())),e}function Q$e(t){return _i(t.nodes(),function(e){var r=t.node(e),n=t.parent(e),i={v:e};return fi(r)||(i.value=r),fi(n)||(i.parent=n),i})}function J$e(t){return _i(t.edges(),function(e){var r=t.edge(e),n={v:e.v,w:e.w};return fi(e.name)||(n.name=e.name),fi(r)||(n.value=r),n})}var Pr=new Map,Rd=new Map,$j=new Map,ePe=x(()=>{Rd.clear(),$j.clear(),Pr.clear()},"clear"),o5=x((t,e)=>{const r=Rd.get(e)||[];return ae.trace("In isDescendant",e," ",t," = ",r.includes(t)),r.includes(t)},"isDescendant"),tPe=x((t,e)=>{const r=Rd.get(e)||[];return ae.info("Descendants of ",e," is ",r),ae.info("Edge is ",t),t.v===e||t.w===e?!1:r?r.includes(t.v)||o5(t.v,e)||o5(t.w,e)||r.includes(t.w):(ae.debug("Tilt, ",e,",not in descendants"),!1)},"edgeInCluster"),Pj=x((t,e,r,n)=>{ae.warn("Copying children of ",t,"root",n,"data",e.node(t),n);const i=e.children(t)||[];t!==n&&i.push(t),ae.warn("Copying (nodes) clusterId",t,"nodes",i),i.forEach(a=>{if(e.children(a).length>0)Pj(a,e,r,n);else{const s=e.node(a);ae.info("cp ",a," to ",n," with parent ",t),r.setNode(a,s),n!==e.parent(a)&&(ae.warn("Setting parent",a,e.parent(a)),r.setParent(a,e.parent(a))),t!==n&&a!==t?(ae.debug("Setting parent",a,t),r.setParent(a,t)):(ae.info("In copy ",t,"root",n,"data",e.node(t),n),ae.debug("Not Setting parent for node=",a,"cluster!==rootId",t!==n,"node!==clusterId",a!==t));const o=e.edges(a);ae.debug("Copying Edges",o),o.forEach(l=>{ae.info("Edge",l);const u=e.edge(l.v,l.w,l.name);ae.info("Edge data",u,n);try{tPe(l,n)?(ae.info("Copying as ",l.v,l.w,u,l.name),r.setEdge(l.v,l.w,u,l.name),ae.info("newGraph edges ",r.edges(),r.edge(r.edges()[0]))):ae.info("Skipping copy of edge ",l.v,"-->",l.w," rootId: ",n," clusterId:",t)}catch(h){ae.error(h)}})}ae.debug("Removing node",a),e.removeNode(a)})},"copy"),Bj=x((t,e)=>{const r=e.children(t);let n=[...r];for(const i of r)$j.set(i,t),n=[...n,...Bj(i,e)];return n},"extractDescendants"),rPe=x((t,e,r)=>{const n=t.edges().filter(l=>l.v===e||l.w===e),i=t.edges().filter(l=>l.v===r||l.w===r),a=n.map(l=>({v:l.v===e?r:l.v,w:l.w===e?e:l.w})),s=i.map(l=>({v:l.v,w:l.w}));return a.filter(l=>s.some(u=>l.v===u.v&&l.w===u.w))},"findCommonEdges"),Lb=x((t,e,r)=>{const n=e.children(t);if(ae.trace("Searching children of id ",t,n),n.length<1)return t;let i;for(const a of n){const s=Lb(a,e,r),o=rPe(e,r,s);if(s)if(o.length>0)i=s;else return s}return i},"findNonClusterChild"),Fj=x(t=>!Pr.has(t)||!Pr.get(t).externalConnections?t:Pr.has(t)?Pr.get(t).id:t,"getAnchorId"),nPe=x((t,e)=>{if(!t||e>10){ae.debug("Opting out, no graph ");return}else ae.debug("Opting in, graph ");t.nodes().forEach(function(r){t.children(r).length>0&&(ae.warn("Cluster identified",r," Replacement id in edges: ",Lb(r,t,r)),Rd.set(r,Bj(r,t)),Pr.set(r,{id:Lb(r,t,r),clusterData:t.node(r)}))}),t.nodes().forEach(function(r){const n=t.children(r),i=t.edges();n.length>0?(ae.debug("Cluster identified",r,Rd),i.forEach(a=>{const s=o5(a.v,r),o=o5(a.w,r);s^o&&(ae.warn("Edge: ",a," leaves cluster ",r),ae.warn("Descendants of XXX ",r,": ",Rd.get(r)),Pr.get(r).externalConnections=!0)})):ae.debug("Not a cluster ",r,Rd)});for(let r of Pr.keys()){const n=Pr.get(r).id,i=t.parent(n);i!==r&&Pr.has(i)&&!Pr.get(i).externalConnections&&(Pr.get(r).id=i)}t.edges().forEach(function(r){const n=t.edge(r);ae.warn("Edge "+r.v+" -> "+r.w+": "+JSON.stringify(r)),ae.warn("Edge "+r.v+" -> "+r.w+": "+JSON.stringify(t.edge(r)));let i=r.v,a=r.w;if(ae.warn("Fix XXX",Pr,"ids:",r.v,r.w,"Translating: ",Pr.get(r.v)," --- ",Pr.get(r.w)),Pr.get(r.v)||Pr.get(r.w)){if(ae.warn("Fixing and trying - removing XXX",r.v,r.w,r.name),i=Fj(r.v),a=Fj(r.w),t.removeEdge(r.v,r.w,r.name),i!==r.v){const s=t.parent(i);Pr.get(s).externalConnections=!0,n.fromCluster=r.v}if(a!==r.w){const s=t.parent(a);Pr.get(s).externalConnections=!0,n.toCluster=r.w}ae.warn("Fix Replacing with XXX",i,a,r.name),t.setEdge(i,a,n,r.name)}}),ae.warn("Adjusted Graph",_l(t)),zj(t,0),ae.trace(Pr)},"adjustClustersAndEdges"),zj=x((t,e)=>{var i,a;if(ae.warn("extractor - ",e,_l(t),t.children("D")),e>10){ae.error("Bailing out");return}let r=t.nodes(),n=!1;for(const s of r){const o=t.children(s);n=n||o.length>0}if(!n){ae.debug("Done, no node has children",t.nodes());return}ae.debug("Nodes = ",r,e);for(const s of r)if(ae.debug("Extracting node",s,Pr,Pr.has(s)&&!Pr.get(s).externalConnections,!t.parent(s),t.node(s),t.children("D")," Depth ",e),!Pr.has(s))ae.debug("Not a cluster",s,e);else if(!Pr.get(s).externalConnections&&t.children(s)&&t.children(s).length>0){ae.warn("Cluster without external connections, without a parent and with children",s,e);let l=t.graph().rankdir==="TB"?"LR":"TB";(a=(i=Pr.get(s))==null?void 0:i.clusterData)!=null&&a.dir&&(l=Pr.get(s).clusterData.dir,ae.warn("Fixing dir",Pr.get(s).clusterData.dir,l));const u=new Ts({multigraph:!0,compound:!0}).setGraph({rankdir:l,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});ae.warn("Old graph before copy",_l(t)),Pj(s,t,u,s),t.setNode(s,{clusterNode:!0,id:s,clusterData:Pr.get(s).clusterData,label:Pr.get(s).label,graph:u}),ae.warn("New graph after copy node: (",s,")",_l(u)),ae.debug("Old graph after copy",_l(t))}else ae.warn("Cluster ** ",s," **not meeting the criteria !externalConnections:",!Pr.get(s).externalConnections," no parent: ",!t.parent(s)," children ",t.children(s)&&t.children(s).length>0,t.children("D"),e),ae.debug(Pr);r=t.nodes(),ae.warn("New list of nodes",r);for(const s of r){const o=t.node(s);ae.warn(" Now next level",s,o),o!=null&&o.clusterNode&&zj(o.graph,e+1)}},"extractor"),Gj=x((t,e)=>{if(e.length===0)return[];let r=Object.assign([],e);return e.forEach(n=>{const i=t.children(n),a=Gj(t,i);r=[...r,...a]}),r},"sorter"),iPe=x(t=>Gj(t,t.children()),"sortNodesByHierarchy"),qj=x(async(t,e,r,n,i,a)=>{ae.warn("Graph in recursive render:XAX",_l(e),i);const s=e.graph().rankdir;ae.trace("Dir in recursive render - dir:",s);const o=t.insert("g").attr("class","root");e.nodes()?ae.info("Recursive render XXX",e.nodes()):ae.info("No nodes found for",e),e.edges().length>0&&ae.info("Recursive edges",e.edge(e.edges()[0]));const l=o.insert("g").attr("class","clusters"),u=o.insert("g").attr("class","edgePaths"),h=o.insert("g").attr("class","edgeLabels"),d=o.insert("g").attr("class","nodes");await Promise.all(e.nodes().map(async function(m){const y=e.node(m);if(i!==void 0){const v=JSON.parse(JSON.stringify(i.clusterData));ae.trace(`Setting data for parent cluster XXX +?)[ \r ]*`,AD="[̀-ͯ]",aFe=new RegExp(AD+"+$"),sFe="("+Yte+"+)|"+(iFe+"|")+"([!-\\[\\]-‧‪-퟿豈-￿]"+(AD+"*")+"|[\uD800-\uDBFF][\uDC00-\uDFFF]"+(AD+"*")+"|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5"+("|"+nFe)+("|"+rFe+")");let Xte=class{constructor(e,r){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=e,this.settings=r,this.tokenRegex=new RegExp(sFe,"g"),this.catcodes={"%":14,"~":13}}setCatcode(e,r){this.catcodes[e]=r}lex(){var e=this.input,r=this.tokenRegex.lastIndex;if(r===e.length)return new Eo("EOF",new Qs(this,r,r));var n=this.tokenRegex.exec(e);if(n===null||n.index!==r)throw new $t("Unexpected character: '"+e[r]+"'",new Eo(e[r],new Qs(this,r,r+1)));var i=n[6]||n[3]||(n[2]?"\\ ":" ");if(this.catcodes[i]===14){var a=e.indexOf(` +`,this.tokenRegex.lastIndex);return a===-1?(this.tokenRegex.lastIndex=e.length,this.settings.reportNonstrict("commentAtEnd","% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)")):this.tokenRegex.lastIndex=a+1,this.lex()}return new Eo(i,new Qs(this,r,this.tokenRegex.lastIndex))}};class oFe{constructor(e,r){e===void 0&&(e={}),r===void 0&&(r={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=r,this.builtins=e,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(this.undefStack.length===0)throw new $t("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");var e=this.undefStack.pop();for(var r in e)e.hasOwnProperty(r)&&(e[r]==null?delete this.current[r]:this.current[r]=e[r])}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(e){return this.current.hasOwnProperty(e)||this.builtins.hasOwnProperty(e)}get(e){return this.current.hasOwnProperty(e)?this.current[e]:this.builtins[e]}set(e,r,n){if(n===void 0&&(n=!1),n){for(var i=0;i0&&(this.undefStack[this.undefStack.length-1][e]=r)}else{var a=this.undefStack[this.undefStack.length-1];a&&!a.hasOwnProperty(e)&&(a[e]=this.current[e])}r==null?delete this.current[e]:this.current[e]=r}}var lFe=kte;me("\\noexpand",function(t){var e=t.popToken();return t.isExpandable(e.text)&&(e.noexpand=!0,e.treatAsRelax=!0),{tokens:[e],numArgs:0}}),me("\\expandafter",function(t){var e=t.popToken();return t.expandOnce(!0),{tokens:[e],numArgs:0}}),me("\\@firstoftwo",function(t){var e=t.consumeArgs(2);return{tokens:e[0],numArgs:0}}),me("\\@secondoftwo",function(t){var e=t.consumeArgs(2);return{tokens:e[1],numArgs:0}}),me("\\@ifnextchar",function(t){var e=t.consumeArgs(3);t.consumeSpaces();var r=t.future();return e[0].length===1&&e[0][0].text===r.text?{tokens:e[1],numArgs:0}:{tokens:e[2],numArgs:0}}),me("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}"),me("\\TextOrMath",function(t){var e=t.consumeArgs(2);return t.mode==="text"?{tokens:e[0],numArgs:0}:{tokens:e[1],numArgs:0}});var jte={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};me("\\char",function(t){var e=t.popToken(),r,n=0;if(e.text==="'")r=8,e=t.popToken();else if(e.text==='"')r=16,e=t.popToken();else if(e.text==="`")if(e=t.popToken(),e.text[0]==="\\")n=e.text.charCodeAt(1);else{if(e.text==="EOF")throw new $t("\\char` missing argument");n=e.text.charCodeAt(0)}else r=10;if(r){if(n=jte[e.text],n==null||n>=r)throw new $t("Invalid base-"+r+" digit "+e.text);for(var i;(i=jte[t.future().text])!=null&&i{var i=t.consumeArg().tokens;if(i.length!==1)throw new $t("\\newcommand's first argument must be a macro name");var a=i[0].text,s=t.isDefined(a);if(s&&!e)throw new $t("\\newcommand{"+a+"} attempting to redefine "+(a+"; use \\renewcommand"));if(!s&&!r)throw new $t("\\renewcommand{"+a+"} when command "+a+" does not yet exist; use \\newcommand");var o=0;if(i=t.consumeArg().tokens,i.length===1&&i[0].text==="["){for(var l="",u=t.expandNextToken();u.text!=="]"&&u.text!=="EOF";)l+=u.text,u=t.expandNextToken();if(!l.match(/^\s*[0-9]+\s*$/))throw new $t("Invalid number of arguments: "+l);o=parseInt(l),i=t.consumeArg().tokens}return s&&n||t.macros.set(a,{tokens:i,numArgs:o}),""};me("\\newcommand",t=>RD(t,!1,!0,!1)),me("\\renewcommand",t=>RD(t,!0,!1,!1)),me("\\providecommand",t=>RD(t,!0,!0,!0)),me("\\message",t=>{var e=t.consumeArgs(1)[0];return console.log(e.reverse().map(r=>r.text).join("")),""}),me("\\errmessage",t=>{var e=t.consumeArgs(1)[0];return console.error(e.reverse().map(r=>r.text).join("")),""}),me("\\show",t=>{var e=t.popToken(),r=e.text;return console.log(e,t.macros.get(r),Uh[r],hi.math[r],hi.text[r]),""}),me("\\bgroup","{"),me("\\egroup","}"),me("~","\\nobreakspace"),me("\\lq","`"),me("\\rq","'"),me("\\aa","\\r a"),me("\\AA","\\r A"),me("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}"),me("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}"),me("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}"),me("ℬ","\\mathscr{B}"),me("ℰ","\\mathscr{E}"),me("ℱ","\\mathscr{F}"),me("ℋ","\\mathscr{H}"),me("ℐ","\\mathscr{I}"),me("ℒ","\\mathscr{L}"),me("ℳ","\\mathscr{M}"),me("ℛ","\\mathscr{R}"),me("ℭ","\\mathfrak{C}"),me("ℌ","\\mathfrak{H}"),me("ℨ","\\mathfrak{Z}"),me("\\Bbbk","\\Bbb{k}"),me("\\llap","\\mathllap{\\textrm{#1}}"),me("\\rlap","\\mathrlap{\\textrm{#1}}"),me("\\clap","\\mathclap{\\textrm{#1}}"),me("\\mathstrut","\\vphantom{(}"),me("\\underbar","\\underline{\\text{#1}}"),me("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}\\nobreak}{\\char"338}'),me("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}"),me("\\ne","\\neq"),me("≠","\\neq"),me("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}"),me("∉","\\notin"),me("≘","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}"),me("≙","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}"),me("≚","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}"),me("≛","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}"),me("≝","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}"),me("≞","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}"),me("≟","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}"),me("⟂","\\perp"),me("‼","\\mathclose{!\\mkern-0.8mu!}"),me("∌","\\notni"),me("⌜","\\ulcorner"),me("⌝","\\urcorner"),me("⌞","\\llcorner"),me("⌟","\\lrcorner"),me("©","\\copyright"),me("®","\\textregistered"),me("\\ulcorner",'\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}'),me("\\urcorner",'\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}'),me("\\llcorner",'\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}'),me("\\lrcorner",'\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}'),me("\\vdots","{\\varvdots\\rule{0pt}{15pt}}"),me("⋮","\\vdots"),me("\\varGamma","\\mathit{\\Gamma}"),me("\\varDelta","\\mathit{\\Delta}"),me("\\varTheta","\\mathit{\\Theta}"),me("\\varLambda","\\mathit{\\Lambda}"),me("\\varXi","\\mathit{\\Xi}"),me("\\varPi","\\mathit{\\Pi}"),me("\\varSigma","\\mathit{\\Sigma}"),me("\\varUpsilon","\\mathit{\\Upsilon}"),me("\\varPhi","\\mathit{\\Phi}"),me("\\varPsi","\\mathit{\\Psi}"),me("\\varOmega","\\mathit{\\Omega}"),me("\\substack","\\begin{subarray}{c}#1\\end{subarray}"),me("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax"),me("\\boxed","\\fbox{$\\displaystyle{#1}$}"),me("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;"),me("\\implies","\\DOTSB\\;\\Longrightarrow\\;"),me("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;"),me("\\dddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}"),me("\\ddddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}");var Kte={",":"\\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"},cFe=new Set(["bin","rel"]);me("\\dots",function(t){var e="\\dotso",r=t.expandAfterFuture().text;return r in Kte?e=Kte[r]:(r.slice(0,4)==="\\not"||r in hi.math&&cFe.has(hi.math[r].group))&&(e="\\dotsb"),e});var LD={")":!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};me("\\dotso",function(t){var e=t.future().text;return e in LD?"\\ldots\\,":"\\ldots"}),me("\\dotsc",function(t){var e=t.future().text;return e in LD&&e!==","?"\\ldots\\,":"\\ldots"}),me("\\cdots",function(t){var e=t.future().text;return e in LD?"\\@cdots\\,":"\\@cdots"}),me("\\dotsb","\\cdots"),me("\\dotsm","\\cdots"),me("\\dotsi","\\!\\cdots"),me("\\dotsx","\\ldots\\,"),me("\\DOTSI","\\relax"),me("\\DOTSB","\\relax"),me("\\DOTSX","\\relax"),me("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax"),me("\\,","\\tmspace+{3mu}{.1667em}"),me("\\thinspace","\\,"),me("\\>","\\mskip{4mu}"),me("\\:","\\tmspace+{4mu}{.2222em}"),me("\\medspace","\\:"),me("\\;","\\tmspace+{5mu}{.2777em}"),me("\\thickspace","\\;"),me("\\!","\\tmspace-{3mu}{.1667em}"),me("\\negthinspace","\\!"),me("\\negmedspace","\\tmspace-{4mu}{.2222em}"),me("\\negthickspace","\\tmspace-{5mu}{.277em}"),me("\\enspace","\\kern.5em "),me("\\enskip","\\hskip.5em\\relax"),me("\\quad","\\hskip1em\\relax"),me("\\qquad","\\hskip2em\\relax"),me("\\tag","\\@ifstar\\tag@literal\\tag@paren"),me("\\tag@paren","\\tag@literal{({#1})}"),me("\\tag@literal",t=>{if(t.macros.get("\\df@tag"))throw new $t("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"}),me("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}"),me("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)"),me("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}"),me("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1"),me("\\newline","\\\\\\relax"),me("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");var Zte=zt(hc["Main-Regular"][84][1]-.7*hc["Main-Regular"][65][1]);me("\\LaTeX","\\textrm{\\html@mathml{"+("L\\kern-.36em\\raisebox{"+Zte+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{LaTeX}}"),me("\\KaTeX","\\textrm{\\html@mathml{"+("K\\kern-.17em\\raisebox{"+Zte+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{KaTeX}}"),me("\\hspace","\\@ifstar\\@hspacer\\@hspace"),me("\\@hspace","\\hskip #1\\relax"),me("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax"),me("\\ordinarycolon",":"),me("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}"),me("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}'),me("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}'),me("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}'),me("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}'),me("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}'),me("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}'),me("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}'),me("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}'),me("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}'),me("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}'),me("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}'),me("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}'),me("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}'),me("∷","\\dblcolon"),me("∹","\\eqcolon"),me("≔","\\coloneqq"),me("≕","\\eqqcolon"),me("⩴","\\Coloneqq"),me("\\ratio","\\vcentcolon"),me("\\coloncolon","\\dblcolon"),me("\\colonequals","\\coloneqq"),me("\\coloncolonequals","\\Coloneqq"),me("\\equalscolon","\\eqqcolon"),me("\\equalscoloncolon","\\Eqqcolon"),me("\\colonminus","\\coloneq"),me("\\coloncolonminus","\\Coloneq"),me("\\minuscolon","\\eqcolon"),me("\\minuscoloncolon","\\Eqcolon"),me("\\coloncolonapprox","\\Colonapprox"),me("\\coloncolonsim","\\Colonsim"),me("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}"),me("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}"),me("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}"),me("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}"),me("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}"),me("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}"),me("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}"),me("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}"),me("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}"),me("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}"),me("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}"),me("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}"),me("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}"),me("\\gvertneqq","\\html@mathml{\\@gvertneqq}{≩}"),me("\\lvertneqq","\\html@mathml{\\@lvertneqq}{≨}"),me("\\ngeqq","\\html@mathml{\\@ngeqq}{≱}"),me("\\ngeqslant","\\html@mathml{\\@ngeqslant}{≱}"),me("\\nleqq","\\html@mathml{\\@nleqq}{≰}"),me("\\nleqslant","\\html@mathml{\\@nleqslant}{≰}"),me("\\nshortmid","\\html@mathml{\\@nshortmid}{∤}"),me("\\nshortparallel","\\html@mathml{\\@nshortparallel}{∦}"),me("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{⊈}"),me("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{⊉}"),me("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{⊊}"),me("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{⫋}"),me("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{⊋}"),me("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{⫌}"),me("\\imath","\\html@mathml{\\@imath}{ı}"),me("\\jmath","\\html@mathml{\\@jmath}{ȷ}"),me("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}"),me("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}"),me("⟦","\\llbracket"),me("⟧","\\rrbracket"),me("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}"),me("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}"),me("⦃","\\lBrace"),me("⦄","\\rBrace"),me("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}"),me("⦵","\\minuso"),me("\\darr","\\downarrow"),me("\\dArr","\\Downarrow"),me("\\Darr","\\Downarrow"),me("\\lang","\\langle"),me("\\rang","\\rangle"),me("\\uarr","\\uparrow"),me("\\uArr","\\Uparrow"),me("\\Uarr","\\Uparrow"),me("\\N","\\mathbb{N}"),me("\\R","\\mathbb{R}"),me("\\Z","\\mathbb{Z}"),me("\\alef","\\aleph"),me("\\alefsym","\\aleph"),me("\\Alpha","\\mathrm{A}"),me("\\Beta","\\mathrm{B}"),me("\\bull","\\bullet"),me("\\Chi","\\mathrm{X}"),me("\\clubs","\\clubsuit"),me("\\cnums","\\mathbb{C}"),me("\\Complex","\\mathbb{C}"),me("\\Dagger","\\ddagger"),me("\\diamonds","\\diamondsuit"),me("\\empty","\\emptyset"),me("\\Epsilon","\\mathrm{E}"),me("\\Eta","\\mathrm{H}"),me("\\exist","\\exists"),me("\\harr","\\leftrightarrow"),me("\\hArr","\\Leftrightarrow"),me("\\Harr","\\Leftrightarrow"),me("\\hearts","\\heartsuit"),me("\\image","\\Im"),me("\\infin","\\infty"),me("\\Iota","\\mathrm{I}"),me("\\isin","\\in"),me("\\Kappa","\\mathrm{K}"),me("\\larr","\\leftarrow"),me("\\lArr","\\Leftarrow"),me("\\Larr","\\Leftarrow"),me("\\lrarr","\\leftrightarrow"),me("\\lrArr","\\Leftrightarrow"),me("\\Lrarr","\\Leftrightarrow"),me("\\Mu","\\mathrm{M}"),me("\\natnums","\\mathbb{N}"),me("\\Nu","\\mathrm{N}"),me("\\Omicron","\\mathrm{O}"),me("\\plusmn","\\pm"),me("\\rarr","\\rightarrow"),me("\\rArr","\\Rightarrow"),me("\\Rarr","\\Rightarrow"),me("\\real","\\Re"),me("\\reals","\\mathbb{R}"),me("\\Reals","\\mathbb{R}"),me("\\Rho","\\mathrm{P}"),me("\\sdot","\\cdot"),me("\\sect","\\S"),me("\\spades","\\spadesuit"),me("\\sub","\\subset"),me("\\sube","\\subseteq"),me("\\supe","\\supseteq"),me("\\Tau","\\mathrm{T}"),me("\\thetasym","\\vartheta"),me("\\weierp","\\wp"),me("\\Zeta","\\mathrm{Z}"),me("\\argmin","\\DOTSB\\operatorname*{arg\\,min}"),me("\\argmax","\\DOTSB\\operatorname*{arg\\,max}"),me("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits"),me("\\bra","\\mathinner{\\langle{#1}|}"),me("\\ket","\\mathinner{|{#1}\\rangle}"),me("\\braket","\\mathinner{\\langle{#1}\\rangle}"),me("\\Bra","\\left\\langle#1\\right|"),me("\\Ket","\\left|#1\\right\\rangle");var Qte=t=>e=>{var r=e.consumeArg().tokens,n=e.consumeArg().tokens,i=e.consumeArg().tokens,a=e.consumeArg().tokens,s=e.macros.get("|"),o=e.macros.get("\\|");e.macros.beginGroup();var l=d=>f=>{t&&(f.macros.set("|",s),i.length&&f.macros.set("\\|",o));var p=d;if(!d&&i.length){var g=f.future();g.text==="|"&&(f.popToken(),p=!0)}return{tokens:p?i:n,numArgs:0}};e.macros.set("|",l(!1)),i.length&&e.macros.set("\\|",l(!0));var u=e.consumeArg().tokens,h=e.expandTokens([...a,...u,...r]);return e.macros.endGroup(),{tokens:h.reverse(),numArgs:0}};me("\\bra@ket",Qte(!1)),me("\\bra@set",Qte(!0)),me("\\Braket","\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}"),me("\\Set","\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}"),me("\\set","\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}"),me("\\angln","{\\angl n}"),me("\\blue","\\textcolor{##6495ed}{#1}"),me("\\orange","\\textcolor{##ffa500}{#1}"),me("\\pink","\\textcolor{##ff00af}{#1}"),me("\\red","\\textcolor{##df0030}{#1}"),me("\\green","\\textcolor{##28ae7b}{#1}"),me("\\gray","\\textcolor{gray}{#1}"),me("\\purple","\\textcolor{##9d38bd}{#1}"),me("\\blueA","\\textcolor{##ccfaff}{#1}"),me("\\blueB","\\textcolor{##80f6ff}{#1}"),me("\\blueC","\\textcolor{##63d9ea}{#1}"),me("\\blueD","\\textcolor{##11accd}{#1}"),me("\\blueE","\\textcolor{##0c7f99}{#1}"),me("\\tealA","\\textcolor{##94fff5}{#1}"),me("\\tealB","\\textcolor{##26edd5}{#1}"),me("\\tealC","\\textcolor{##01d1c1}{#1}"),me("\\tealD","\\textcolor{##01a995}{#1}"),me("\\tealE","\\textcolor{##208170}{#1}"),me("\\greenA","\\textcolor{##b6ffb0}{#1}"),me("\\greenB","\\textcolor{##8af281}{#1}"),me("\\greenC","\\textcolor{##74cf70}{#1}"),me("\\greenD","\\textcolor{##1fab54}{#1}"),me("\\greenE","\\textcolor{##0d923f}{#1}"),me("\\goldA","\\textcolor{##ffd0a9}{#1}"),me("\\goldB","\\textcolor{##ffbb71}{#1}"),me("\\goldC","\\textcolor{##ff9c39}{#1}"),me("\\goldD","\\textcolor{##e07d10}{#1}"),me("\\goldE","\\textcolor{##a75a05}{#1}"),me("\\redA","\\textcolor{##fca9a9}{#1}"),me("\\redB","\\textcolor{##ff8482}{#1}"),me("\\redC","\\textcolor{##f9685d}{#1}"),me("\\redD","\\textcolor{##e84d39}{#1}"),me("\\redE","\\textcolor{##bc2612}{#1}"),me("\\maroonA","\\textcolor{##ffbde0}{#1}"),me("\\maroonB","\\textcolor{##ff92c6}{#1}"),me("\\maroonC","\\textcolor{##ed5fa6}{#1}"),me("\\maroonD","\\textcolor{##ca337c}{#1}"),me("\\maroonE","\\textcolor{##9e034e}{#1}"),me("\\purpleA","\\textcolor{##ddd7ff}{#1}"),me("\\purpleB","\\textcolor{##c6b9fc}{#1}"),me("\\purpleC","\\textcolor{##aa87ff}{#1}"),me("\\purpleD","\\textcolor{##7854ab}{#1}"),me("\\purpleE","\\textcolor{##543b78}{#1}"),me("\\mintA","\\textcolor{##f5f9e8}{#1}"),me("\\mintB","\\textcolor{##edf2df}{#1}"),me("\\mintC","\\textcolor{##e0e5cc}{#1}"),me("\\grayA","\\textcolor{##f6f7f7}{#1}"),me("\\grayB","\\textcolor{##f0f1f2}{#1}"),me("\\grayC","\\textcolor{##e3e5e6}{#1}"),me("\\grayD","\\textcolor{##d6d8da}{#1}"),me("\\grayE","\\textcolor{##babec2}{#1}"),me("\\grayF","\\textcolor{##888d93}{#1}"),me("\\grayG","\\textcolor{##626569}{#1}"),me("\\grayH","\\textcolor{##3b3e40}{#1}"),me("\\grayI","\\textcolor{##21242c}{#1}"),me("\\kaBlue","\\textcolor{##314453}{#1}"),me("\\kaGreen","\\textcolor{##71B307}{#1}");var Jte={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0};class uFe{constructor(e,r,n){this.settings=void 0,this.expansionCount=void 0,this.lexer=void 0,this.macros=void 0,this.stack=void 0,this.mode=void 0,this.settings=r,this.expansionCount=0,this.feed(e),this.macros=new oFe(lFe,r.macros),this.mode=n,this.stack=[]}feed(e){this.lexer=new Xte(e,this.settings)}switchMode(e){this.mode=e}beginGroup(){this.macros.beginGroup()}endGroup(){this.macros.endGroup()}endGroups(){this.macros.endGroups()}future(){return this.stack.length===0&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]}popToken(){return this.future(),this.stack.pop()}pushToken(e){this.stack.push(e)}pushTokens(e){this.stack.push(...e)}scanArgument(e){var r,n,i;if(e){if(this.consumeSpaces(),this.future().text!=="[")return null;r=this.popToken(),{tokens:i,end:n}=this.consumeArg(["]"])}else({tokens:i,start:r,end:n}=this.consumeArg());return this.pushToken(new Eo("EOF",n.loc)),this.pushTokens(i),new Eo("",Qs.range(r,n))}consumeSpaces(){for(;;){var e=this.future();if(e.text===" ")this.stack.pop();else break}}consumeArg(e){var r=[],n=e&&e.length>0;n||this.consumeSpaces();var i=this.future(),a,s=0,o=0;do{if(a=this.popToken(),r.push(a),a.text==="{")++s;else if(a.text==="}"){if(--s,s===-1)throw new $t("Extra }",a)}else if(a.text==="EOF")throw new $t("Unexpected end of input in a macro argument, expected '"+(e&&n?e[o]:"}")+"'",a);if(e&&n)if((s===0||s===1&&e[o]==="{")&&a.text===e[o]){if(++o,o===e.length){r.splice(-o,o);break}}else o=0}while(s!==0||n);return i.text==="{"&&r[r.length-1].text==="}"&&(r.pop(),r.shift()),r.reverse(),{tokens:r,start:i,end:a}}consumeArgs(e,r){if(r){if(r.length!==e+1)throw new $t("The length of delimiters doesn't match the number of args!");for(var n=r[0],i=0;ithis.settings.maxExpand)throw new $t("Too many expansions: infinite loop or need to increase maxExpand setting")}expandOnce(e){var r=this.popToken(),n=r.text,i=r.noexpand?null:this._getExpansion(n);if(i==null||e&&i.unexpandable){if(e&&i==null&&n[0]==="\\"&&!this.isDefined(n))throw new $t("Undefined control sequence: "+n);return this.pushToken(r),!1}this.countExpansion(1);var a=i.tokens,s=this.consumeArgs(i.numArgs,i.delimiters);if(i.numArgs){a=a.slice();for(var o=a.length-1;o>=0;--o){var l=a[o];if(l.text==="#"){if(o===0)throw new $t("Incomplete placeholder at end of macro body",l);if(l=a[--o],l.text==="#")a.splice(o+1,1);else if(/^[1-9]$/.test(l.text))a.splice(o,2,...s[+l.text-1]);else throw new $t("Not a valid argument number",l)}}}return this.pushTokens(a),a.length}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;)if(this.expandOnce()===!1){var e=this.stack.pop();return e.treatAsRelax&&(e.text="\\relax"),e}}expandMacro(e){return this.macros.has(e)?this.expandTokens([new Eo(e)]):void 0}expandTokens(e){var r=[],n=this.stack.length;for(this.pushTokens(e);this.stack.length>n;)if(this.expandOnce(!0)===!1){var i=this.stack.pop();i.treatAsRelax&&(i.noexpand=!1,i.treatAsRelax=!1),r.push(i)}return this.countExpansion(r.length),r}expandMacroAsText(e){var r=this.expandMacro(e);return r&&r.map(n=>n.text).join("")}_getExpansion(e){var r=this.macros.get(e);if(r==null)return r;if(e.length===1){var n=this.lexer.catcodes[e];if(n!=null&&n!==13)return}var i=typeof r=="function"?r(this):r;if(typeof i=="string"){var a=0;if(i.includes("#"))for(var s=i.replace(/##/g,"");s.includes("#"+(a+1));)++a;for(var o=new Xte(i,this.settings),l=[],u=o.lex();u.text!=="EOF";)l.push(u),u=o.lex();l.reverse();var h={tokens:l,numArgs:a};return h}return i}isDefined(e){return this.macros.has(e)||Uh.hasOwnProperty(e)||hi.math.hasOwnProperty(e)||hi.text.hasOwnProperty(e)||Jte.hasOwnProperty(e)}isExpandable(e){var r=this.macros.get(e);return r!=null?typeof r=="string"||typeof r=="function"||!r.unexpandable:Uh.hasOwnProperty(e)&&!Uh[e].primitive}}var ere=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,B5=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","ᵝ":"β","ᵞ":"γ","ᵟ":"δ","ᵠ":"ϕ","ᵡ":"χ","ᶿ":"θ"}),ID={"́":{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"}},tre={á:"á",à:"à",ä:"ä",ǟ:"ǟ",ã:"ã",ā:"ā",ă:"ă",ắ:"ắ",ằ:"ằ",ẵ:"ẵ",ǎ:"ǎ",â:"â",ấ:"ấ",ầ:"ầ",ẫ:"ẫ",ȧ:"ȧ",ǡ:"ǡ",å:"å",ǻ:"ǻ",ḃ:"ḃ",ć:"ć",ḉ:"ḉ",č:"č",ĉ:"ĉ",ċ:"ċ",ç:"ç",ď:"ď",ḋ:"ḋ",ḑ:"ḑ",é:"é",è:"è",ë:"ë",ẽ:"ẽ",ē:"ē",ḗ:"ḗ",ḕ:"ḕ",ĕ:"ĕ",ḝ:"ḝ",ě:"ě",ê:"ê",ế:"ế",ề:"ề",ễ:"ễ",ė:"ė",ȩ:"ȩ",ḟ:"ḟ",ǵ:"ǵ",ḡ:"ḡ",ğ:"ğ",ǧ:"ǧ",ĝ:"ĝ",ġ:"ġ",ģ:"ģ",ḧ:"ḧ",ȟ:"ȟ",ĥ:"ĥ",ḣ:"ḣ",ḩ:"ḩ",í:"í",ì:"ì",ï:"ï",ḯ:"ḯ",ĩ:"ĩ",ī:"ī",ĭ:"ĭ",ǐ:"ǐ",î:"î",ǰ:"ǰ",ĵ:"ĵ",ḱ:"ḱ",ǩ:"ǩ",ķ:"ķ",ĺ:"ĺ",ľ:"ľ",ļ:"ļ",ḿ:"ḿ",ṁ:"ṁ",ń:"ń",ǹ:"ǹ",ñ:"ñ",ň:"ň",ṅ:"ṅ",ņ:"ņ",ó:"ó",ò:"ò",ö:"ö",ȫ:"ȫ",õ:"õ",ṍ:"ṍ",ṏ:"ṏ",ȭ:"ȭ",ō:"ō",ṓ:"ṓ",ṑ:"ṑ",ŏ:"ŏ",ǒ:"ǒ",ô:"ô",ố:"ố",ồ:"ồ",ỗ:"ỗ",ȯ:"ȯ",ȱ:"ȱ",ő:"ő",ṕ:"ṕ",ṗ:"ṗ",ŕ:"ŕ",ř:"ř",ṙ:"ṙ",ŗ:"ŗ",ś:"ś",ṥ:"ṥ",š:"š",ṧ:"ṧ",ŝ:"ŝ",ṡ:"ṡ",ş:"ş",ẗ:"ẗ",ť:"ť",ṫ:"ṫ",ţ:"ţ",ú:"ú",ù:"ù",ü:"ü",ǘ:"ǘ",ǜ:"ǜ",ǖ:"ǖ",ǚ:"ǚ",ũ:"ũ",ṹ:"ṹ",ū:"ū",ṻ:"ṻ",ŭ:"ŭ",ǔ:"ǔ",û:"û",ů:"ů",ű:"ű",ṽ:"ṽ",ẃ:"ẃ",ẁ:"ẁ",ẅ:"ẅ",ŵ:"ŵ",ẇ:"ẇ",ẘ:"ẘ",ẍ:"ẍ",ẋ:"ẋ",ý:"ý",ỳ:"ỳ",ÿ:"ÿ",ỹ:"ỹ",ȳ:"ȳ",ŷ:"ŷ",ẏ:"ẏ",ẙ:"ẙ",ź:"ź",ž:"ž",ẑ:"ẑ",ż:"ż",Á:"Á",À:"À",Ä:"Ä",Ǟ:"Ǟ",Ã:"Ã",Ā:"Ā",Ă:"Ă",Ắ:"Ắ",Ằ:"Ằ",Ẵ:"Ẵ",Ǎ:"Ǎ",Â:"Â",Ấ:"Ấ",Ầ:"Ầ",Ẫ:"Ẫ",Ȧ:"Ȧ",Ǡ:"Ǡ",Å:"Å",Ǻ:"Ǻ",Ḃ:"Ḃ",Ć:"Ć",Ḉ:"Ḉ",Č:"Č",Ĉ:"Ĉ",Ċ:"Ċ",Ç:"Ç",Ď:"Ď",Ḋ:"Ḋ",Ḑ:"Ḑ",É:"É",È:"È",Ë:"Ë",Ẽ:"Ẽ",Ē:"Ē",Ḗ:"Ḗ",Ḕ:"Ḕ",Ĕ:"Ĕ",Ḝ:"Ḝ",Ě:"Ě",Ê:"Ê",Ế:"Ế",Ề:"Ề",Ễ:"Ễ",Ė:"Ė",Ȩ:"Ȩ",Ḟ:"Ḟ",Ǵ:"Ǵ",Ḡ:"Ḡ",Ğ:"Ğ",Ǧ:"Ǧ",Ĝ:"Ĝ",Ġ:"Ġ",Ģ:"Ģ",Ḧ:"Ḧ",Ȟ:"Ȟ",Ĥ:"Ĥ",Ḣ:"Ḣ",Ḩ:"Ḩ",Í:"Í",Ì:"Ì",Ï:"Ï",Ḯ:"Ḯ",Ĩ:"Ĩ",Ī:"Ī",Ĭ:"Ĭ",Ǐ:"Ǐ",Î:"Î",İ:"İ",Ĵ:"Ĵ",Ḱ:"Ḱ",Ǩ:"Ǩ",Ķ:"Ķ",Ĺ:"Ĺ",Ľ:"Ľ",Ļ:"Ļ",Ḿ:"Ḿ",Ṁ:"Ṁ",Ń:"Ń",Ǹ:"Ǹ",Ñ:"Ñ",Ň:"Ň",Ṅ:"Ṅ",Ņ:"Ņ",Ó:"Ó",Ò:"Ò",Ö:"Ö",Ȫ:"Ȫ",Õ:"Õ",Ṍ:"Ṍ",Ṏ:"Ṏ",Ȭ:"Ȭ",Ō:"Ō",Ṓ:"Ṓ",Ṑ:"Ṑ",Ŏ:"Ŏ",Ǒ:"Ǒ",Ô:"Ô",Ố:"Ố",Ồ:"Ồ",Ỗ:"Ỗ",Ȯ:"Ȯ",Ȱ:"Ȱ",Ő:"Ő",Ṕ:"Ṕ",Ṗ:"Ṗ",Ŕ:"Ŕ",Ř:"Ř",Ṙ:"Ṙ",Ŗ:"Ŗ",Ś:"Ś",Ṥ:"Ṥ",Š:"Š",Ṧ:"Ṧ",Ŝ:"Ŝ",Ṡ:"Ṡ",Ş:"Ş",Ť:"Ť",Ṫ:"Ṫ",Ţ:"Ţ",Ú:"Ú",Ù:"Ù",Ü:"Ü",Ǘ:"Ǘ",Ǜ:"Ǜ",Ǖ:"Ǖ",Ǚ:"Ǚ",Ũ:"Ũ",Ṹ:"Ṹ",Ū:"Ū",Ṻ:"Ṻ",Ŭ:"Ŭ",Ǔ:"Ǔ",Û:"Û",Ů:"Ů",Ű:"Ű",Ṽ:"Ṽ",Ẃ:"Ẃ",Ẁ:"Ẁ",Ẅ:"Ẅ",Ŵ:"Ŵ",Ẇ:"Ẇ",Ẍ:"Ẍ",Ẋ:"Ẋ",Ý:"Ý",Ỳ:"Ỳ",Ÿ:"Ÿ",Ỹ:"Ỹ",Ȳ:"Ȳ",Ŷ:"Ŷ",Ẏ:"Ẏ",Ź:"Ź",Ž:"Ž",Ẑ:"Ẑ",Ż:"Ż",ά:"ά",ὰ:"ὰ",ᾱ:"ᾱ",ᾰ:"ᾰ",έ:"έ",ὲ:"ὲ",ή:"ή",ὴ:"ὴ",ί:"ί",ὶ:"ὶ",ϊ:"ϊ",ΐ:"ΐ",ῒ:"ῒ",ῑ:"ῑ",ῐ:"ῐ",ό:"ό",ὸ:"ὸ",ύ:"ύ",ὺ:"ὺ",ϋ:"ϋ",ΰ:"ΰ",ῢ:"ῢ",ῡ:"ῡ",ῠ:"ῠ",ώ:"ώ",ὼ:"ὼ",Ύ:"Ύ",Ὺ:"Ὺ",Ϋ:"Ϋ",Ῡ:"Ῡ",Ῠ:"Ῠ",Ώ:"Ώ",Ὼ:"Ὼ"};let rre=class cEe{constructor(e,r){this.mode=void 0,this.gullet=void 0,this.settings=void 0,this.leftrightDepth=void 0,this.nextToken=void 0,this.mode="math",this.gullet=new uFe(e,r,this.mode),this.settings=r,this.leftrightDepth=0,this.nextToken=null}expect(e,r){if(r===void 0&&(r=!0),this.fetch().text!==e)throw new $t("Expected '"+e+"', got '"+this.fetch().text+"'",this.fetch());r&&this.consume()}consume(){this.nextToken=null}fetch(){return this.nextToken==null&&(this.nextToken=this.gullet.expandNextToken()),this.nextToken}switchMode(e){this.mode=e,this.gullet.switchMode(e)}parse(){this.settings.globalGroup||this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set("\\color","\\textcolor");try{var e=this.parseExpression(!1);return this.expect("EOF"),this.settings.globalGroup||this.gullet.endGroup(),e}finally{this.gullet.endGroups()}}subparse(e){var r=this.nextToken;this.consume(),this.gullet.pushToken(new Eo("}")),this.gullet.pushTokens(e);var n=this.parseExpression(!1);return this.expect("}"),this.nextToken=r,n}parseExpression(e,r){for(var n=[];;){this.mode==="math"&&this.consumeSpaces();var i=this.fetch();if(cEe.endOfExpression.has(i.text)||r&&i.text===r||e&&Uh[i.text]&&Uh[i.text].infix)break;var a=this.parseAtom(r);if(a){if(a.type==="internal")continue}else break;n.push(a)}return this.mode==="text"&&this.formLigatures(n),this.handleInfixNodes(n)}handleInfixNodes(e){for(var r=-1,n,i=0;i=128)this.settings.strict&&(Cee(r.charCodeAt(0))?this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+r[0]+'" used in math mode',e):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+r[0]+'"'+(" ("+r.charCodeAt(0)+")"),e)),s={type:"textord",mode:"text",loc:Qs.range(e),text:r};else return null;if(this.consume(),a)for(var h=0;h0){if(++e>=JFe)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function Ug(t){return function(){return t}}var G5=(function(){try{var t=zf(Object,"defineProperty");return t({},"",{}),t}catch{}})(),nze=G5?function(t,e){return G5(t,"toString",{configurable:!0,enumerable:!1,value:Ug(e),writable:!0})}:Bf,xre=rze(nze);function Tre(t,e){for(var r=-1,n=t==null?0:t.length;++r-1}var lze=9007199254740991,cze=/^(?:0|[1-9]\d*)$/;function q5(t,e){var r=typeof t;return e=e??lze,!!e&&(r=="number"||r!="symbol"&&cze.test(t))&&t>-1&&t%1==0&&t-1&&t%1==0&&t<=dze}function Hh(t){return t!=null&&OD(t.length)&&!CT(t)}function ET(t,e,r){if(!So(r))return!1;var n=typeof e;return(n=="number"?Hh(r)&&q5(e,r.length):n=="string"&&e in r)?Hg(r[e],t):!1}function fze(t){return U5(function(e,r){var n=-1,i=r.length,a=i>1?r[i-1]:void 0,s=i>2?r[2]:void 0;for(a=t.length>3&&typeof a=="function"?(i--,a):void 0,s&&ET(r[0],r[1],s)&&(a=i<3?void 0:a,i=1),e=Object(e);++n-1}function wGe(t,e){var r=this.__data__,n=j5(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}function Iu(t){var e=-1,r=t==null?0:t.length;for(this.clear();++eo))return!1;var u=a.get(t),h=a.get(e);if(u&&h)return u==e&&h==t;var d=-1,f=!0,p=r&_Ve?new IT:void 0;for(a.set(t,e),a.set(e,t);++d2?e[2]:void 0;for(i&&ET(e[0],e[1],i)&&(n=1);++r-1?i[a?e[s]:s]:void 0}}var mWe=Math.max;function yWe(t,e,r){var n=t==null?0:t.length;if(!n)return-1;var i=r==null?0:MFe(r);return i<0&&(i=mWe(n+i,0)),wre(t,Yh(e),i)}var r9=gWe(yWe);function Tne(t,e){var r=-1,n=Hh(t)?Array(t.length):[];return t3(t,function(i,a,s){n[++r]=e(i,a,s)}),n}function Zi(t,e){var r=Ki(t)?Wg:Tne;return r(t,Yh(e))}function vWe(t,e){return t==null?t:ZD(t,t9(e),Gf)}function bWe(t,e){return t&&QD(t,t9(e))}function xWe(t,e){return t>e}var TWe=Object.prototype,wWe=TWe.hasOwnProperty;function CWe(t,e){return t!=null&&wWe.call(t,e)}function wne(t,e){return t!=null&&mne(t,e,CWe)}function kWe(t,e){return Wg(e,function(r){return t[r]})}function Nu(t){return t==null?[]:kWe(t,_o(t))}var EWe="[object Map]",SWe="[object Set]",_We=Object.prototype,AWe=_We.hasOwnProperty;function Cne(t){if(t==null)return!0;if(Hh(t)&&(Ki(t)||typeof t=="string"||typeof t.splice=="function"||Xg(t)||X5(t)||Yg(t)))return!t.length;var e=Ko(t);if(e==EWe||e==SWe)return!t.size;if(H5(t))return!Nre(t).length;for(var r in t)if(AWe.call(t,r))return!1;return!0}function $i(t){return t===void 0}function kne(t,e){return te||a&&s&&l&&!o&&!u||n&&s&&l||!r&&l||!i)return 1;if(!n&&!a&&!u&&t=o)return l;var u=r[n];return l*(u=="desc"?-1:1)}}return t.index-e.index}function NWe(t,e,r){e.length?e=Wg(e,function(a){return Ki(a)?function(s){return Q5(s,a.length===1?a[0]:a)}:a}):e=[Bf];var n=-1;e=Wg(e,Y5(Yh));var i=Tne(t,function(a,s,o){var l=Wg(e,function(u){return u(a)});return{criteria:l,index:++n,value:a}});return IWe(i,function(a,s){return MWe(a,s,r)})}function $We(t,e){return LWe(t,e,function(r,n){return yne(t,n)})}var i3=PGe(function(t,e){return t==null?{}:$We(t,e)}),OWe=Math.ceil,PWe=Math.max;function BWe(t,e,r,n){for(var i=-1,a=PWe(OWe((e-t)/(r||1)),0),s=Array(a);a--;)s[++i]=t,t+=r;return s}function FWe(t){return function(e,r,n){return n&&typeof n!="number"&&ET(e,r,n)&&(r=n=void 0),e=z5(e),r===void 0?(r=e,e=0):r=z5(r),n=n===void 0?e1&&ET(t,e[0],e[1])?e=[]:r>2&&ET(e[0],e[1],e[2])&&(e=[e[0]]),NWe(t,GD(e),[])}),GWe=1/0,qWe=Zg&&1/XD(new Zg([,-0]))[1]==GWe?function(t){return new Zg(t)}:QFe,VWe=200;function WWe(t,e,r){var n=-1,i=oze,a=t.length,s=!0,o=[],l=o;if(a>=VWe){var u=qWe(t);if(u)return XD(u);s=!1,i=lne,l=new IT}else l=o;e:for(;++n1?i.setNode(a,r):i.setNode(a)}),this}setNode(e,r){return Object.prototype.hasOwnProperty.call(this._nodes,e)?(arguments.length>1&&(this._nodes[e]=r),this):(this._nodes[e]=arguments.length>1?r:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]=Wf,this._children[e]={},this._children[Wf][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount,this)}node(e){return this._nodes[e]}hasNode(e){return Object.prototype.hasOwnProperty.call(this._nodes,e)}removeNode(e){if(Object.prototype.hasOwnProperty.call(this._nodes,e)){var r=n=>this.removeEdge(this._edgeObjs[n]);delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],mt(this.children(e),n=>{this.setParent(n)}),delete this._children[e]),mt(_o(this._in[e]),r),delete this._in[e],delete this._preds[e],mt(_o(this._out[e]),r),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this}setParent(e,r){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if($i(r))r=Wf;else{r+="";for(var n=r;!$i(n);n=this.parent(n))if(n===e)throw new Error("Setting "+r+" as parent of "+e+" would create a cycle");this.setNode(r)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=r,this._children[r][e]=!0,this}_removeFromParentsChildList(e){delete this._children[this._parent[e]][e]}parent(e){if(this._isCompound){var r=this._parent[e];if(r!==Wf)return r}}children(e){if($i(e)&&(e=Wf),this._isCompound){var r=this._children[e];if(r)return _o(r)}else{if(e===Wf)return this.nodes();if(this.hasNode(e))return[]}}predecessors(e){var r=this._preds[e];if(r)return _o(r)}successors(e){var r=this._sucs[e];if(r)return _o(r)}neighbors(e){var r=this.predecessors(e);if(r)return UWe(r,this.successors(e))}isLeaf(e){var r;return this.isDirected()?r=this.successors(e):r=this.neighbors(e),r.length===0}filterNodes(e){var r=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});r.setGraph(this.graph());var n=this;mt(this._nodes,function(s,o){e(o)&&r.setNode(o,s)}),mt(this._edgeObjs,function(s){r.hasNode(s.v)&&r.hasNode(s.w)&&r.setEdge(s,n.edge(s))});var i={};function a(s){var o=n.parent(s);return o===void 0||r.hasNode(o)?(i[s]=o,o):o in i?i[o]:a(o)}return this._isCompound&&mt(r.nodes(),function(s){r.setParent(s,a(s))}),r}setDefaultEdgeLabel(e){return CT(e)||(e=Ug(e)),this._defaultEdgeLabelFn=e,this}edgeCount(){return this._edgeCount}edges(){return Nu(this._edgeObjs)}setPath(e,r){var n=this,i=arguments;return MT(e,function(a,s){return i.length>1?n.setEdge(a,s,r):n.setEdge(a,s),s}),this}setEdge(){var e,r,n,i,a=!1,s=arguments[0];typeof s=="object"&&s!==null&&"v"in s?(e=s.v,r=s.w,n=s.name,arguments.length===2&&(i=arguments[1],a=!0)):(e=s,r=arguments[1],n=arguments[3],arguments.length>2&&(i=arguments[2],a=!0)),e=""+e,r=""+r,$i(n)||(n=""+n);var o=$T(this._isDirected,e,r,n);if(Object.prototype.hasOwnProperty.call(this._edgeLabels,o))return a&&(this._edgeLabels[o]=i),this;if(!$i(n)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(e),this.setNode(r),this._edgeLabels[o]=a?i:this._defaultEdgeLabelFn(e,r,n);var l=KWe(this._isDirected,e,r,n);return e=l.v,r=l.w,Object.freeze(l),this._edgeObjs[o]=l,Sne(this._preds[r],e),Sne(this._sucs[e],r),this._in[r][o]=l,this._out[e][o]=l,this._edgeCount++,this}edge(e,r,n){var i=arguments.length===1?o9(this._isDirected,arguments[0]):$T(this._isDirected,e,r,n);return this._edgeLabels[i]}hasEdge(e,r,n){var i=arguments.length===1?o9(this._isDirected,arguments[0]):$T(this._isDirected,e,r,n);return Object.prototype.hasOwnProperty.call(this._edgeLabels,i)}removeEdge(e,r,n){var i=arguments.length===1?o9(this._isDirected,arguments[0]):$T(this._isDirected,e,r,n),a=this._edgeObjs[i];return a&&(e=a.v,r=a.w,delete this._edgeLabels[i],delete this._edgeObjs[i],_ne(this._preds[r],e),_ne(this._sucs[e],r),delete this._in[r][i],delete this._out[e][i],this._edgeCount--),this}inEdges(e,r){var n=this._in[e];if(n){var i=Nu(n);return r?Mu(i,function(a){return a.v===r}):i}}outEdges(e,r){var n=this._out[e];if(n){var i=Nu(n);return r?Mu(i,function(a){return a.w===r}):i}}nodeEdges(e,r){var n=this.inEdges(e,r);if(n)return n.concat(this.outEdges(e,r))}}Js.prototype._nodeCount=0,Js.prototype._edgeCount=0;function Sne(t,e){t[e]?t[e]++:t[e]=1}function _ne(t,e){--t[e]||delete t[e]}function $T(t,e,r,n){var i=""+e,a=""+r;if(!t&&i>a){var s=i;i=a,a=s}return i+Ene+a+Ene+($i(n)?jWe:n)}function KWe(t,e,r,n){var i=""+e,a=""+r;if(!t&&i>a){var s=i;i=a,a=s}var o={v:i,w:a};return n&&(o.name=n),o}function o9(t,e){return $T(t,e.v,e.w,e.name)}class ZWe{constructor(){var e={};e._next=e._prev=e,this._sentinel=e}dequeue(){var e=this._sentinel,r=e._prev;if(r!==e)return Ane(r),r}enqueue(e){var r=this._sentinel;e._prev&&e._next&&Ane(e),e._next=r._next,r._next._prev=e,r._next=e,e._prev=r}toString(){for(var e=[],r=this._sentinel,n=r._prev;n!==r;)e.push(JSON.stringify(n,QWe)),n=n._prev;return"["+e.join(", ")+"]"}}function Ane(t){t._prev._next=t._next,t._next._prev=t._prev,delete t._next,delete t._prev}function QWe(t,e){if(t!=="_next"&&t!=="_prev")return e}var JWe=Ug(1);function eUe(t,e){if(t.nodeCount()<=1)return[];var r=rUe(t,e||JWe),n=tUe(r.graph,r.buckets,r.zeroIdx);return Kg(Zi(n,function(i){return t.outEdges(i.v,i.w)}))}function tUe(t,e,r){for(var n=[],i=e[e.length-1],a=e[0],s;t.nodeCount();){for(;s=a.dequeue();)l9(t,e,r,s);for(;s=i.dequeue();)l9(t,e,r,s);if(t.nodeCount()){for(var o=e.length-2;o>0;--o)if(s=e[o].dequeue(),s){n=n.concat(l9(t,e,r,s,!0));break}}}return n}function l9(t,e,r,n,i){var a=i?[]:void 0;return mt(t.inEdges(n.v),function(s){var o=t.edge(s),l=t.node(s.v);i&&a.push({v:s.v,w:s.w}),l.out-=o,c9(e,r,l)}),mt(t.outEdges(n.v),function(s){var o=t.edge(s),l=s.w,u=t.node(l);u.in-=o,c9(e,r,u)}),t.removeNode(n.v),a}function rUe(t,e){var r=new Js,n=0,i=0;mt(t.nodes(),function(o){r.setNode(o,{v:o,in:0,out:0})}),mt(t.edges(),function(o){var l=r.edge(o.v,o.w)||0,u=e(o),h=l+u;r.setEdge(o.v,o.w,h),i=Math.max(i,r.node(o.v).out+=u),n=Math.max(n,r.node(o.w).in+=u)});var a=Qg(i+n+3).map(function(){return new ZWe}),s=n+1;return mt(r.nodes(),function(o){c9(a,s,r.node(o))}),{graph:r,buckets:a,zeroIdx:s}}function c9(t,e,r){r.out?r.in?t[r.out-r.in+e].enqueue(r):t[t.length-1].enqueue(r):t[0].enqueue(r)}function nUe(t){var e=t.graph().acyclicer==="greedy"?eUe(t,r(t)):iUe(t);mt(e,function(n){var i=t.edge(n);t.removeEdge(n),i.forwardName=n.name,i.reversed=!0,t.setEdge(n.w,n.v,i,s9("rev"))});function r(n){return function(i){return n.edge(i).weight}}}function iUe(t){var e=[],r={},n={};function i(a){Object.prototype.hasOwnProperty.call(n,a)||(n[a]=!0,r[a]=!0,mt(t.outEdges(a),function(s){Object.prototype.hasOwnProperty.call(r,s.w)?e.push(s):i(s.w)}),delete r[a])}return mt(t.nodes(),i),e}function aUe(t){mt(t.edges(),function(e){var r=t.edge(e);if(r.reversed){t.removeEdge(e);var n=r.forwardName;delete r.reversed,delete r.forwardName,t.setEdge(e.w,e.v,r,n)}})}function Jg(t,e,r,n){var i;do i=s9(n);while(t.hasNode(i));return r.dummy=e,t.setNode(i,r),i}function sUe(t){var e=new Js().setGraph(t.graph());return mt(t.nodes(),function(r){e.setNode(r,t.node(r))}),mt(t.edges(),function(r){var n=e.edge(r.v,r.w)||{weight:0,minlen:1},i=t.edge(r);e.setEdge(r.v,r.w,{weight:n.weight+i.weight,minlen:Math.max(n.minlen,i.minlen)})}),e}function Rne(t){var e=new Js({multigraph:t.isMultigraph()}).setGraph(t.graph());return mt(t.nodes(),function(r){t.children(r).length||e.setNode(r,t.node(r))}),mt(t.edges(),function(r){e.setEdge(r,t.edge(r))}),e}function Lne(t,e){var r=t.x,n=t.y,i=e.x-r,a=e.y-n,s=t.width/2,o=t.height/2;if(!i&&!a)throw new Error("Not possible to find intersection inside of the rectangle");var l,u;return Math.abs(a)*s>Math.abs(i)*o?(a<0&&(o=-o),l=o*i/a,u=o):(i<0&&(s=-s),l=s,u=s*a/i),{x:r+l,y:n+u}}function a3(t){var e=Zi(Qg(Dne(t)+1),function(){return[]});return mt(t.nodes(),function(r){var n=t.node(r),i=n.rank;$i(i)||(e[i][n.order]=r)}),e}function oUe(t){var e=DT(Zi(t.nodes(),function(r){return t.node(r).rank}));mt(t.nodes(),function(r){var n=t.node(r);wne(n,"rank")&&(n.rank-=e)})}function lUe(t){var e=DT(Zi(t.nodes(),function(a){return t.node(a).rank})),r=[];mt(t.nodes(),function(a){var s=t.node(a).rank-e;r[s]||(r[s]=[]),r[s].push(a)});var n=0,i=t.graph().nodeRankFactor;mt(r,function(a,s){$i(a)&&s%i!==0?--n:n&&mt(a,function(o){t.node(o).rank+=n})})}function Ine(t,e,r,n){var i={width:0,height:0};return arguments.length>=4&&(i.rank=r,i.order=n),Jg(t,"border",i,e)}function Dne(t){return Vf(Zi(t.nodes(),function(e){var r=t.node(e).rank;if(!$i(r))return r}))}function cUe(t,e){var r={lhs:[],rhs:[]};return mt(t,function(n){e(n)?r.lhs.push(n):r.rhs.push(n)}),r}function uUe(t,e){return e()}function hUe(t){function e(r){var n=t.children(r),i=t.node(r);if(n.length&&mt(n,e),Object.prototype.hasOwnProperty.call(i,"minRank")){i.borderLeft=[],i.borderRight=[];for(var a=i.minRank,s=i.maxRank+1;as.lim&&(o=s,l=!0);var u=Mu(e.edges(),function(h){return l===Wne(t,t.node(h.v),o)&&l!==Wne(t,t.node(h.w),o)});return a9(u,function(h){return OT(e,h)})}function Vne(t,e,r,n){var i=r.v,a=r.w;t.removeEdge(i,a),t.setEdge(n.v,n.w,{}),p9(t),f9(t,e),SUe(t,e)}function SUe(t,e){var r=r9(t.nodes(),function(i){return!e.node(i).parent}),n=kUe(t,r);n=n.slice(1),mt(n,function(i){var a=t.node(i).parent,s=e.edge(i,a),o=!1;s||(s=e.edge(a,i),o=!0),e.node(i).rank=e.node(a).rank+(o?s.minlen:-s.minlen)})}function _Ue(t,e,r){return t.hasEdge(e,r)}function Wne(t,e,r){return r.low<=e.lim&&e.lim<=r.lim}function AUe(t){switch(t.graph().ranker){case"network-simplex":Une(t);break;case"tight-tree":LUe(t);break;case"longest-path":RUe(t);break;default:Une(t)}}var RUe=d9;function LUe(t){d9(t),One(t)}function Une(t){Uf(t)}function IUe(t){var e=Jg(t,"root",{},"_root"),r=DUe(t),n=Vf(Nu(r))-1,i=2*n+1;t.graph().nestingRoot=e,mt(t.edges(),function(s){t.edge(s).minlen*=i});var a=MUe(t)+1;mt(t.children(),function(s){Hne(t,e,i,a,n,r,s)}),t.graph().nodeRankFactor=i}function Hne(t,e,r,n,i,a,s){var o=t.children(s);if(!o.length){s!==e&&t.setEdge(e,s,{weight:0,minlen:r});return}var l=Ine(t,"_bt"),u=Ine(t,"_bb"),h=t.node(s);t.setParent(l,s),h.borderTop=l,t.setParent(u,s),h.borderBottom=u,mt(o,function(d){Hne(t,e,r,n,i,a,d);var f=t.node(d),p=f.borderTop?f.borderTop:d,g=f.borderBottom?f.borderBottom:d,m=f.borderTop?n:2*n,y=p!==g?1:i-a[s]+1;t.setEdge(l,p,{weight:m,minlen:y,nestingEdge:!0}),t.setEdge(g,u,{weight:m,minlen:y,nestingEdge:!0})}),t.parent(s)||t.setEdge(e,l,{weight:0,minlen:i+a[s]})}function DUe(t){var e={};function r(n,i){var a=t.children(n);a&&a.length&&mt(a,function(s){r(s,i+1)}),e[n]=i}return mt(t.children(),function(n){r(n,1)}),e}function MUe(t){return MT(t.edges(),function(e,r){return e+t.edge(r).weight},0)}function NUe(t){var e=t.graph();t.removeNode(e.nestingRoot),delete e.nestingRoot,mt(t.edges(),function(r){var n=t.edge(r);n.nestingEdge&&t.removeEdge(r)})}function $Ue(t,e,r){var n={},i;mt(r,function(a){for(var s=t.parent(a),o,l;s;){if(o=t.parent(s),o?(l=n[o],n[o]=s):(l=i,i=s),l&&l!==s){e.setEdge(l,s);return}s=o}})}function OUe(t,e,r){var n=PUe(t),i=new Js({compound:!0}).setGraph({root:n}).setDefaultNodeLabel(function(a){return t.node(a)});return mt(t.nodes(),function(a){var s=t.node(a),o=t.parent(a);(s.rank===e||s.minRank<=e&&e<=s.maxRank)&&(i.setNode(a),i.setParent(a,o||n),mt(t[r](a),function(l){var u=l.v===a?l.w:l.v,h=i.edge(u,a),d=$i(h)?0:h.weight;i.setEdge(u,a,{weight:t.edge(l).weight+d})}),Object.prototype.hasOwnProperty.call(s,"minRank")&&i.setNode(a,{borderLeft:s.borderLeft[e],borderRight:s.borderRight[e]}))}),i}function PUe(t){for(var e;t.hasNode(e=s9("_root")););return e}function BUe(t,e){for(var r=0,n=1;n0;)h%2&&(d+=o[h+1]),h=h-1>>1,o[h]+=u.weight;l+=u.weight*d})),l}function zUe(t){var e={},r=Mu(t.nodes(),function(o){return!t.children(o).length}),n=Vf(Zi(r,function(o){return t.node(o).rank})),i=Zi(Qg(n+1),function(){return[]});function a(o){if(!wne(e,o)){e[o]=!0;var l=t.node(o);i[l.rank].push(o),mt(t.successors(o),a)}}var s=NT(r,function(o){return t.node(o).rank});return mt(s,a),i}function GUe(t,e){return Zi(e,function(r){var n=t.inEdges(r);if(n.length){var i=MT(n,function(a,s){var o=t.edge(s),l=t.node(s.v);return{sum:a.sum+o.weight*l.order,weight:a.weight+o.weight}},{sum:0,weight:0});return{v:r,barycenter:i.sum/i.weight,weight:i.weight}}else return{v:r}})}function qUe(t,e){var r={};mt(t,function(i,a){var s=r[i.v]={indegree:0,in:[],out:[],vs:[i.v],i:a};$i(i.barycenter)||(s.barycenter=i.barycenter,s.weight=i.weight)}),mt(e.edges(),function(i){var a=r[i.v],s=r[i.w];!$i(a)&&!$i(s)&&(s.indegree++,a.out.push(r[i.w]))});var n=Mu(r,function(i){return!i.indegree});return VUe(n)}function VUe(t){var e=[];function r(a){return function(s){s.merged||($i(s.barycenter)||$i(a.barycenter)||s.barycenter>=a.barycenter)&&WUe(a,s)}}function n(a){return function(s){s.in.push(a),--s.indegree===0&&t.push(s)}}for(;t.length;){var i=t.pop();e.push(i),mt(i.in.reverse(),r(i)),mt(i.out,n(i))}return Zi(Mu(e,function(a){return!a.merged}),function(a){return i3(a,["vs","i","barycenter","weight"])})}function WUe(t,e){var r=0,n=0;t.weight&&(r+=t.barycenter*t.weight,n+=t.weight),e.weight&&(r+=e.barycenter*e.weight,n+=e.weight),t.vs=e.vs.concat(t.vs),t.barycenter=r/n,t.weight=n,t.i=Math.min(e.i,t.i),e.merged=!0}function UUe(t,e){var r=cUe(t,function(h){return Object.prototype.hasOwnProperty.call(h,"barycenter")}),n=r.lhs,i=NT(r.rhs,function(h){return-h.i}),a=[],s=0,o=0,l=0;n.sort(HUe(!!e)),l=Yne(a,i,l),mt(n,function(h){l+=h.vs.length,a.push(h.vs),s+=h.barycenter*h.weight,o+=h.weight,l=Yne(a,i,l)});var u={vs:Kg(a)};return o&&(u.barycenter=s/o,u.weight=o),u}function Yne(t,e,r){for(var n;e.length&&(n=r3(e)).i<=r;)e.pop(),t.push(n.vs),r++;return r}function HUe(t){return function(e,r){return e.barycenterr.barycenter?1:t?r.i-e.i:e.i-r.i}}function Xne(t,e,r,n){var i=t.children(e),a=t.node(e),s=a?a.borderLeft:void 0,o=a?a.borderRight:void 0,l={};s&&(i=Mu(i,function(g){return g!==s&&g!==o}));var u=GUe(t,i);mt(u,function(g){if(t.children(g.v).length){var m=Xne(t,g.v,r,n);l[g.v]=m,Object.prototype.hasOwnProperty.call(m,"barycenter")&&XUe(g,m)}});var h=qUe(u,r);YUe(h,l);var d=UUe(h,n);if(s&&(d.vs=Kg([s,d.vs,o]),t.predecessors(s).length)){var f=t.node(t.predecessors(s)[0]),p=t.node(t.predecessors(o)[0]);Object.prototype.hasOwnProperty.call(d,"barycenter")||(d.barycenter=0,d.weight=0),d.barycenter=(d.barycenter*d.weight+f.order+p.order)/(d.weight+2),d.weight+=2}return d}function YUe(t,e){mt(t,function(r){r.vs=Kg(r.vs.map(function(n){return e[n]?e[n].vs:n}))})}function XUe(t,e){$i(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 jUe(t){var e=Dne(t),r=jne(t,Qg(1,e+1),"inEdges"),n=jne(t,Qg(e-1,-1,-1),"outEdges"),i=zUe(t);Kne(t,i);for(var a=Number.POSITIVE_INFINITY,s,o=0,l=0;l<4;++o,++l){KUe(o%2?r:n,o%4>=2),i=a3(t);var u=BUe(t,i);us||o>e[l].lim));for(u=l,l=n;(l=t.parent(l))!==u;)a.push(l);return{path:i.concat(a.reverse()),lca:u}}function JUe(t){var e={},r=0;function n(i){var a=r;mt(t.children(i),n),e[i]={low:a,lim:r++}}return mt(t.children(),n),e}function eHe(t,e){var r={};function n(i,a){var s=0,o=0,l=i.length,u=r3(a);return mt(a,function(h,d){var f=rHe(t,h),p=f?t.node(f).order:l;(f||h===u)&&(mt(a.slice(o,d+1),function(g){mt(t.predecessors(g),function(m){var y=t.node(m),v=y.order;(vu)&&Zne(r,f,h)})})}function i(a,s){var o=-1,l,u=0;return mt(s,function(h,d){if(t.node(h).dummy==="border"){var f=t.predecessors(h);f.length&&(l=t.node(f[0]).order,n(s,u,d,o,l),u=d,o=l)}n(s,u,s.length,l,a.length)}),s}return MT(e,i),r}function rHe(t,e){if(t.node(e).dummy)return r9(t.predecessors(e),function(r){return t.node(r).dummy})}function Zne(t,e,r){if(e>r){var n=e;e=r,r=n}Object.prototype.hasOwnProperty.call(t,e)||Object.defineProperty(t,e,{enumerable:!0,configurable:!0,value:{},writable:!0});var i=t[e];Object.defineProperty(i,r,{enumerable:!0,configurable:!0,value:!0,writable:!0})}function nHe(t,e,r){if(e>r){var n=e;e=r,r=n}return!!t[e]&&Object.prototype.hasOwnProperty.call(t[e],r)}function iHe(t,e,r,n){var i={},a={},s={};return mt(e,function(o){mt(o,function(l,u){i[l]=l,a[l]=l,s[l]=u})}),mt(e,function(o){var l=-1;mt(o,function(u){var h=n(u);if(h.length){h=NT(h,function(m){return s[m]});for(var d=(h.length-1)/2,f=Math.floor(d),p=Math.ceil(d);f<=p;++f){var g=h[f];a[u]===u&&l{var n=r(" buildLayoutGraph",()=>EHe(t));r(" runLayout",()=>gHe(n,r)),r(" updateInputGraph",()=>mHe(t,n))})}function gHe(t,e){e(" makeSpaceForEdgeLabels",()=>SHe(t)),e(" removeSelfEdges",()=>$He(t)),e(" acyclic",()=>nUe(t)),e(" nestingGraph.run",()=>IUe(t)),e(" rank",()=>AUe(Rne(t))),e(" injectEdgeLabelProxies",()=>_He(t)),e(" removeEmptyRanks",()=>lUe(t)),e(" nestingGraph.cleanup",()=>NUe(t)),e(" normalizeRanks",()=>oUe(t)),e(" assignRankMinMax",()=>AHe(t)),e(" removeEdgeLabelProxies",()=>RHe(t)),e(" normalize.run",()=>mUe(t)),e(" parentDummyChains",()=>ZUe(t)),e(" addBorderSegments",()=>hUe(t)),e(" order",()=>jUe(t)),e(" insertSelfEdges",()=>OHe(t)),e(" adjustCoordinateSystem",()=>dUe(t)),e(" position",()=>fHe(t)),e(" positionSelfEdges",()=>PHe(t)),e(" removeBorderNodes",()=>NHe(t)),e(" normalize.undo",()=>vUe(t)),e(" fixupEdgeLabelCoords",()=>DHe(t)),e(" undoCoordinateSystem",()=>fUe(t)),e(" translateGraph",()=>LHe(t)),e(" assignNodeIntersects",()=>IHe(t)),e(" reversePoints",()=>MHe(t)),e(" acyclic.undo",()=>aUe(t))}function mHe(t,e){mt(t.nodes(),function(r){var n=t.node(r),i=e.node(r);n&&(n.x=i.x,n.y=i.y,e.children(r).length&&(n.width=i.width,n.height=i.height))}),mt(t.edges(),function(r){var n=t.edge(r),i=e.edge(r);n.points=i.points,Object.prototype.hasOwnProperty.call(i,"x")&&(n.x=i.x,n.y=i.y)}),t.graph().width=e.graph().width,t.graph().height=e.graph().height}var yHe=["nodesep","edgesep","ranksep","marginx","marginy"],vHe={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},bHe=["acyclicer","ranker","rankdir","align"],xHe=["width","height"],THe={width:0,height:0},wHe=["minlen","weight","width","height","labeloffset"],CHe={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},kHe=["labelpos"];function EHe(t){var e=new Js({multigraph:!0,compound:!0}),r=m9(t.graph());return e.setGraph(i9({},vHe,g9(r,yHe),i3(r,bHe))),mt(t.nodes(),function(n){var i=m9(t.node(n));e.setNode(n,hWe(g9(i,xHe),THe)),e.setParent(n,t.parent(n))}),mt(t.edges(),function(n){var i=m9(t.edge(n));e.setEdge(n,i9({},CHe,g9(i,wHe),i3(i,kHe)))}),e}function SHe(t){var e=t.graph();e.ranksep/=2,mt(t.edges(),function(r){var n=t.edge(r);n.minlen*=2,n.labelpos.toLowerCase()!=="c"&&(e.rankdir==="TB"||e.rankdir==="BT"?n.width+=n.labeloffset:n.height+=n.labeloffset)})}function _He(t){mt(t.edges(),function(e){var r=t.edge(e);if(r.width&&r.height){var n=t.node(e.v),i=t.node(e.w),a={rank:(i.rank-n.rank)/2+n.rank,e};Jg(t,"edge-proxy",a,"_ep")}})}function AHe(t){var e=0;mt(t.nodes(),function(r){var n=t.node(r);n.borderTop&&(n.minRank=t.node(n.borderTop).rank,n.maxRank=t.node(n.borderBottom).rank,e=Vf(e,n.maxRank))}),t.graph().maxRank=e}function RHe(t){mt(t.nodes(),function(e){var r=t.node(e);r.dummy==="edge-proxy"&&(t.edge(r.e).labelRank=r.rank,t.removeNode(e))})}function LHe(t){var e=Number.POSITIVE_INFINITY,r=0,n=Number.POSITIVE_INFINITY,i=0,a=t.graph(),s=a.marginx||0,o=a.marginy||0;function l(u){var h=u.x,d=u.y,f=u.width,p=u.height;e=Math.min(e,h-f/2),r=Math.max(r,h+f/2),n=Math.min(n,d-p/2),i=Math.max(i,d+p/2)}mt(t.nodes(),function(u){l(t.node(u))}),mt(t.edges(),function(u){var h=t.edge(u);Object.prototype.hasOwnProperty.call(h,"x")&&l(h)}),e-=s,n-=o,mt(t.nodes(),function(u){var h=t.node(u);h.x-=e,h.y-=n}),mt(t.edges(),function(u){var h=t.edge(u);mt(h.points,function(d){d.x-=e,d.y-=n}),Object.prototype.hasOwnProperty.call(h,"x")&&(h.x-=e),Object.prototype.hasOwnProperty.call(h,"y")&&(h.y-=n)}),a.width=r-e+s,a.height=i-n+o}function IHe(t){mt(t.edges(),function(e){var r=t.edge(e),n=t.node(e.v),i=t.node(e.w),a,s;r.points?(a=r.points[0],s=r.points[r.points.length-1]):(r.points=[],a=i,s=n),r.points.unshift(Lne(n,a)),r.points.push(Lne(i,s))})}function DHe(t){mt(t.edges(),function(e){var r=t.edge(e);if(Object.prototype.hasOwnProperty.call(r,"x"))switch((r.labelpos==="l"||r.labelpos==="r")&&(r.width-=r.labeloffset),r.labelpos){case"l":r.x-=r.width/2+r.labeloffset;break;case"r":r.x+=r.width/2+r.labeloffset;break}})}function MHe(t){mt(t.edges(),function(e){var r=t.edge(e);r.reversed&&r.points.reverse()})}function NHe(t){mt(t.nodes(),function(e){if(t.children(e).length){var r=t.node(e),n=t.node(r.borderTop),i=t.node(r.borderBottom),a=t.node(r3(r.borderLeft)),s=t.node(r3(r.borderRight));r.width=Math.abs(s.x-a.x),r.height=Math.abs(i.y-n.y),r.x=a.x+r.width/2,r.y=n.y+r.height/2}}),mt(t.nodes(),function(e){t.node(e).dummy==="border"&&t.removeNode(e)})}function $He(t){mt(t.edges(),function(e){if(e.v===e.w){var r=t.node(e.v);r.selfEdges||(r.selfEdges=[]),r.selfEdges.push({e,label:t.edge(e)}),t.removeEdge(e)}})}function OHe(t){var e=a3(t);mt(e,function(r){var n=0;mt(r,function(i,a){var s=t.node(i);s.order=a+n,mt(s.selfEdges,function(o){Jg(t,"selfedge",{width:o.label.width,height:o.label.height,rank:s.rank,order:a+ ++n,e:o.e,label:o.label},"_se")}),delete s.selfEdges})})}function PHe(t){mt(t.nodes(),function(e){var r=t.node(e);if(r.dummy==="selfedge"){var n=t.node(r.e.v),i=n.x+n.width/2,a=n.y,s=r.x-i,o=n.height/2;t.setEdge(r.e,r.label),t.removeNode(e),r.label.points=[{x:i+2*s/3,y:a-o},{x:i+5*s/6,y:a-o},{x:i+s,y:a},{x:i+5*s/6,y:a+o},{x:i+2*s/3,y:a+o}],r.label.x=r.x,r.label.y=r.y}})}function g9(t,e){return n3(i3(t,e),Number)}function m9(t){var e={};return mt(t,function(r,n){e[n.toLowerCase()]=r}),e}function yc(t){var e={options:{directed:t.isDirected(),multigraph:t.isMultigraph(),compound:t.isCompound()},nodes:BHe(t),edges:FHe(t)};return $i(t.graph())||(e.value=vVe(t.graph())),e}function BHe(t){return Zi(t.nodes(),function(e){var r=t.node(e),n=t.parent(e),i={v:e};return $i(r)||(i.value=r),$i(n)||(i.parent=n),i})}function FHe(t){return Zi(t.edges(),function(e){var r=t.edge(e),n={v:e.v,w:e.w};return $i(e.name)||(n.name=e.name),$i(r)||(n.value=r),n})}var Hr=new Map,Hf=new Map,Jne=new Map,zHe=T(()=>{Hf.clear(),Jne.clear(),Hr.clear()},"clear"),s3=T((t,e)=>{const r=Hf.get(e)||[];return se.trace("In isDescendant",e," ",t," = ",r.includes(t)),r.includes(t)},"isDescendant"),GHe=T((t,e)=>{const r=Hf.get(e)||[];return se.info("Descendants of ",e," is ",r),se.info("Edge is ",t),t.v===e||t.w===e?!1:r?r.includes(t.v)||s3(t.v,e)||s3(t.w,e)||r.includes(t.w):(se.debug("Tilt, ",e,",not in descendants"),!1)},"edgeInCluster"),eie=T((t,e,r,n)=>{se.warn("Copying children of ",t,"root",n,"data",e.node(t),n);const i=e.children(t)||[];t!==n&&i.push(t),se.warn("Copying (nodes) clusterId",t,"nodes",i),i.forEach(a=>{if(e.children(a).length>0)eie(a,e,r,n);else{const s=e.node(a);se.info("cp ",a," to ",n," with parent ",t),r.setNode(a,s),n!==e.parent(a)&&(se.warn("Setting parent",a,e.parent(a)),r.setParent(a,e.parent(a))),t!==n&&a!==t?(se.debug("Setting parent",a,t),r.setParent(a,t)):(se.info("In copy ",t,"root",n,"data",e.node(t),n),se.debug("Not Setting parent for node=",a,"cluster!==rootId",t!==n,"node!==clusterId",a!==t));const o=e.edges(a);se.debug("Copying Edges",o),o.forEach(l=>{se.info("Edge",l);const u=e.edge(l.v,l.w,l.name);se.info("Edge data",u,n);try{GHe(l,n)?(se.info("Copying as ",l.v,l.w,u,l.name),r.setEdge(l.v,l.w,u,l.name),se.info("newGraph edges ",r.edges(),r.edge(r.edges()[0]))):se.info("Skipping copy of edge ",l.v,"-->",l.w," rootId: ",n," clusterId:",t)}catch(h){se.error(h)}})}se.debug("Removing node",a),e.removeNode(a)})},"copy"),tie=T((t,e)=>{const r=e.children(t);let n=[...r];for(const i of r)Jne.set(i,t),n=[...n,...tie(i,e)];return n},"extractDescendants"),qHe=T((t,e,r)=>{const n=t.edges().filter(l=>l.v===e||l.w===e),i=t.edges().filter(l=>l.v===r||l.w===r),a=n.map(l=>({v:l.v===e?r:l.v,w:l.w===e?e:l.w})),s=i.map(l=>({v:l.v,w:l.w}));return a.filter(l=>s.some(u=>l.v===u.v&&l.w===u.w))},"findCommonEdges"),PT=T((t,e,r)=>{const n=e.children(t);if(se.trace("Searching children of id ",t,n),n.length<1)return t;let i;for(const a of n){const s=PT(a,e,r),o=qHe(e,r,s);if(s)if(o.length>0)i=s;else return s}return i},"findNonClusterChild"),rie=T(t=>!Hr.has(t)||!Hr.get(t).externalConnections?t:Hr.has(t)?Hr.get(t).id:t,"getAnchorId"),VHe=T((t,e)=>{if(!t||e>10){se.debug("Opting out, no graph ");return}else se.debug("Opting in, graph ");t.nodes().forEach(function(r){t.children(r).length>0&&(se.warn("Cluster identified",r," Replacement id in edges: ",PT(r,t,r)),Hf.set(r,tie(r,t)),Hr.set(r,{id:PT(r,t,r),clusterData:t.node(r)}))}),t.nodes().forEach(function(r){const n=t.children(r),i=t.edges();n.length>0?(se.debug("Cluster identified",r,Hf),i.forEach(a=>{const s=s3(a.v,r),o=s3(a.w,r);s^o&&(se.warn("Edge: ",a," leaves cluster ",r),se.warn("Descendants of XXX ",r,": ",Hf.get(r)),Hr.get(r).externalConnections=!0)})):se.debug("Not a cluster ",r,Hf)});for(let r of Hr.keys()){const n=Hr.get(r).id,i=t.parent(n);i!==r&&Hr.has(i)&&!Hr.get(i).externalConnections&&(Hr.get(r).id=i)}t.edges().forEach(function(r){const n=t.edge(r);se.warn("Edge "+r.v+" -> "+r.w+": "+JSON.stringify(r)),se.warn("Edge "+r.v+" -> "+r.w+": "+JSON.stringify(t.edge(r)));let i=r.v,a=r.w;if(se.warn("Fix XXX",Hr,"ids:",r.v,r.w,"Translating: ",Hr.get(r.v)," --- ",Hr.get(r.w)),Hr.get(r.v)||Hr.get(r.w)){if(se.warn("Fixing and trying - removing XXX",r.v,r.w,r.name),i=rie(r.v),a=rie(r.w),t.removeEdge(r.v,r.w,r.name),i!==r.v){const s=t.parent(i);Hr.get(s).externalConnections=!0,n.fromCluster=r.v}if(a!==r.w){const s=t.parent(a);Hr.get(s).externalConnections=!0,n.toCluster=r.w}se.warn("Fix Replacing with XXX",i,a,r.name),t.setEdge(i,a,n,r.name)}}),se.warn("Adjusted Graph",yc(t)),nie(t,0),se.trace(Hr)},"adjustClustersAndEdges"),nie=T((t,e)=>{var i,a;if(se.warn("extractor - ",e,yc(t),t.children("D")),e>10){se.error("Bailing out");return}let r=t.nodes(),n=!1;for(const s of r){const o=t.children(s);n=n||o.length>0}if(!n){se.debug("Done, no node has children",t.nodes());return}se.debug("Nodes = ",r,e);for(const s of r)if(se.debug("Extracting node",s,Hr,Hr.has(s)&&!Hr.get(s).externalConnections,!t.parent(s),t.node(s),t.children("D")," Depth ",e),!Hr.has(s))se.debug("Not a cluster",s,e);else if(!Hr.get(s).externalConnections&&t.children(s)&&t.children(s).length>0){se.warn("Cluster without external connections, without a parent and with children",s,e);let l=t.graph().rankdir==="TB"?"LR":"TB";(a=(i=Hr.get(s))==null?void 0:i.clusterData)!=null&&a.dir&&(l=Hr.get(s).clusterData.dir,se.warn("Fixing dir",Hr.get(s).clusterData.dir,l));const u=new Js({multigraph:!0,compound:!0}).setGraph({rankdir:l,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});se.warn("Old graph before copy",yc(t)),eie(s,t,u,s),t.setNode(s,{clusterNode:!0,id:s,clusterData:Hr.get(s).clusterData,label:Hr.get(s).label,graph:u}),se.warn("New graph after copy node: (",s,")",yc(u)),se.debug("Old graph after copy",yc(t))}else se.warn("Cluster ** ",s," **not meeting the criteria !externalConnections:",!Hr.get(s).externalConnections," no parent: ",!t.parent(s)," children ",t.children(s)&&t.children(s).length>0,t.children("D"),e),se.debug(Hr);r=t.nodes(),se.warn("New list of nodes",r);for(const s of r){const o=t.node(s);se.warn(" Now next level",s,o),o!=null&&o.clusterNode&&nie(o.graph,e+1)}},"extractor"),iie=T((t,e)=>{if(e.length===0)return[];let r=Object.assign([],e);return e.forEach(n=>{const i=t.children(n),a=iie(t,i);r=[...r,...a]}),r},"sorter"),WHe=T(t=>iie(t,t.children()),"sortNodesByHierarchy"),aie=T(async(t,e,r,n,i,a)=>{se.warn("Graph in recursive render:XAX",yc(e),i);const s=e.graph().rankdir;se.trace("Dir in recursive render - dir:",s);const o=t.insert("g").attr("class","root");e.nodes()?se.info("Recursive render XXX",e.nodes()):se.info("No nodes found for",e),e.edges().length>0&&se.info("Recursive edges",e.edge(e.edges()[0]));const l=o.insert("g").attr("class","clusters"),u=o.insert("g").attr("class","edgePaths"),h=o.insert("g").attr("class","edgeLabels"),d=o.insert("g").attr("class","nodes");await Promise.all(e.nodes().map(async function(m){const y=e.node(m);if(i!==void 0){const v=JSON.parse(JSON.stringify(i.clusterData));se.trace(`Setting data for parent cluster XXX Node.id = `,m,` data=`,v.height,` -Parent cluster`,i.height),e.setNode(i.id,v),e.parent(m)||(ae.trace("Setting parent",m,i.id),e.setParent(m,i.id,v))}if(ae.info("(Insert) Node XXX"+m+": "+JSON.stringify(e.node(m))),y!=null&&y.clusterNode){ae.info("Cluster identified XBX",m,y.width,e.node(m));const{ranksep:v,nodesep:T}=e.graph();y.graph.setGraph({...y.graph.graph(),ranksep:v+25,nodesep:T});const b=await qj(d,y.graph,r,n,e.node(m),a),w=b.elem;rr(y,w),y.diff=b.diff||0,ae.info("New compound node after recursive render XAX",m,"width",y.width,"height",y.height),D6e(w,y)}else e.children(m).length>0?(ae.trace("Cluster - the non recursive path XBX",m,y.id,y,y.width,"Graph:",e),ae.trace(Lb(y.id,e)),Pr.set(y.id,{id:Lb(y.id,e),node:y})):(ae.trace("Node - the non recursive path XAX",m,d,e.node(m),s),await nC(d,e.node(m),{config:a,dir:s}))})),await x(async()=>{const m=e.edges().map(async function(y){const v=e.edge(y.v,y.w,y.name);ae.info("Edge "+y.v+" -> "+y.w+": "+JSON.stringify(y)),ae.info("Edge "+y.v+" -> "+y.w+": ",y," ",JSON.stringify(e.edge(y))),ae.info("Fix",Pr,"ids:",y.v,y.w,"Translating: ",Pr.get(y.v),Pr.get(y.w)),await HU(h,v)});await Promise.all(m)},"processEdges")(),ae.info("Graph before layout:",JSON.stringify(_l(e))),ae.info("############################################# XXX"),ae.info("### Layout ### XXX"),ae.info("############################################# XXX"),Oj(e),ae.info("Graph after layout:",JSON.stringify(_l(e)));let p=0,{subGraphTitleTotalMargin:g}=H2(a);return await Promise.all(iPe(e).map(async function(m){var v;const y=e.node(m);if(ae.info("Position XBX => "+m+": ("+y.x,","+y.y,") width: ",y.width," height: ",y.height),y!=null&&y.clusterNode)y.y+=g,ae.info("A tainted cluster node XBX1",m,y.id,y.width,y.height,y.x,y.y,e.parent(m)),Pr.get(y.id).node=y,K_(y);else if(e.children(m).length>0){ae.info("A pure cluster node XBX1",m,y.id,y.x,y.y,y.width,y.height,e.parent(m)),y.height+=g,e.node(y.parentId);const T=(y==null?void 0:y.padding)/2||0,b=((v=y==null?void 0:y.labelBBox)==null?void 0:v.height)||0,w=b-T||0;ae.debug("OffsetY",w,"labelHeight",b,"halfPadding",T),await V_(l,y),Pr.get(y.id).node=y}else{const T=e.node(y.parentId);y.y+=g/2,ae.info("A regular node XBX1 - using the padding",y.id,"parent",y.parentId,y.width,y.height,y.x,y.y,"offsetY",y.offsetY,"parent",T,T==null?void 0:T.offsetY,y),K_(y)}})),e.edges().forEach(function(m){const y=e.edge(m);ae.info("Edge "+m.v+" -> "+m.w+": "+JSON.stringify(y),y),y.points.forEach(w=>w.y+=g/2);const v=e.node(m.v);var T=e.node(m.w);const b=ZU(u,y,Pr,r,v,T,n);YU(y,b)}),e.nodes().forEach(function(m){const y=e.node(m);ae.info(m,y.type,y.diff),y.isGroup&&(p=y.diff)}),ae.warn("Returning from recursive render XAX",o,p),{elem:o,diff:p}},"recursiveRender"),aPe=x(async(t,e)=>{var a,s,o,l,u,h;const r=new Ts({multigraph:!0,compound:!0}).setGraph({rankdir:t.direction,nodesep:((a=t.config)==null?void 0:a.nodeSpacing)||((o=(s=t.config)==null?void 0:s.flowchart)==null?void 0:o.nodeSpacing)||t.nodeSpacing,ranksep:((l=t.config)==null?void 0:l.rankSpacing)||((h=(u=t.config)==null?void 0:u.flowchart)==null?void 0:h.rankSpacing)||t.rankSpacing,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}}),n=e.select("g");eH(n,t.markers,t.type,t.diagramId),M6e(),B6e(),d6e(),ePe(),t.nodes.forEach(d=>{r.setNode(d.id,{...d}),d.parentId&&r.setParent(d.id,d.parentId)}),ae.debug("Edges:",t.edges),t.edges.forEach(d=>{if(d.start===d.end){const f=d.start,p=f+"---"+f+"---1",g=f+"---"+f+"---2",m=r.node(f);r.setNode(p,{domId:p,id:p,parentId:m.parentId,labelStyle:"",label:"",padding:0,shape:"labelRect",style:"",width:10,height:10}),r.setParent(p,m.parentId),r.setNode(g,{domId:g,id:g,parentId:m.parentId,labelStyle:"",padding:0,shape:"labelRect",label:"",style:"",width:10,height:10}),r.setParent(g,m.parentId);const y=structuredClone(d),v=structuredClone(d),T=structuredClone(d);y.label="",y.arrowTypeEnd="none",y.endLabelLeft="",y.endLabelRight="",y.startLabelLeft="",y.id=f+"-cyclic-special-1",v.startLabelRight="",v.startLabelLeft="",v.endLabelLeft="",v.endLabelRight="",v.arrowTypeStart="none",v.arrowTypeEnd="none",v.id=f+"-cyclic-special-mid",T.label="",T.startLabelRight="",T.startLabelLeft="",T.arrowTypeStart="none",m.isGroup&&(y.fromCluster=f,T.toCluster=f),T.id=f+"-cyclic-special-2",T.arrowTypeStart="none",r.setEdge(f,p,y,f+"-cyclic-special-0"),r.setEdge(p,g,v,f+"-cyclic-special-1"),r.setEdge(g,f,T,f+"-cyct.length)&&(e=t.length);for(var r=0,n=Array(e);r=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a,s=!0,o=!1;return{s:function(){r=r.call(t)},n:function(){var l=r.next();return s=l.done,l},e:function(l){o=!0,a=l},f:function(){try{s||r.return==null||r.return()}finally{if(o)throw a}}}}function Vj(t,e,r){return(e=Wj(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function uPe(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function hPe(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,a,s,o=[],l=!0,u=!1;try{if(a=(r=r.call(t)).next,e===0){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(o.push(n.value),o.length!==e);l=!0);}catch(h){u=!0,i=h}finally{try{if(!l&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(u)throw i}}return o}}function dPe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function fPe(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ri(t,e){return oPe(t)||hPe(t,e)||V8(t,e)||dPe()}function l5(t){return lPe(t)||uPe(t)||V8(t)||fPe()}function pPe(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function Wj(t){var e=pPe(t,"string");return typeof e=="symbol"?e:e+""}function Fi(t){"@babel/helpers - typeof";return Fi=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Fi(t)}function V8(t,e){if(t){if(typeof t=="string")return q8(t,e);var r={}.toString.call(t).slice(8,-1);return r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set"?Array.from(t):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?q8(t,e):void 0}}var zi=typeof window>"u"?null:window,Uj=zi?zi.navigator:null;zi&&zi.document;var gPe=Fi(""),Hj=Fi({}),mPe=Fi(function(){}),yPe=typeof HTMLElement>"u"?"undefined":Fi(HTMLElement),Ib=function(e){return e&&e.instanceString&&jn(e.instanceString)?e.instanceString():null},hr=function(e){return e!=null&&Fi(e)==gPe},jn=function(e){return e!=null&&Fi(e)===mPe},wn=function(e){return!Hs(e)&&(Array.isArray?Array.isArray(e):e!=null&&e instanceof Array)},Kr=function(e){return e!=null&&Fi(e)===Hj&&!wn(e)&&e.constructor===Object},vPe=function(e){return e!=null&&Fi(e)===Hj},Gt=function(e){return e!=null&&Fi(e)===Fi(1)&&!isNaN(e)},bPe=function(e){return Gt(e)&&Math.floor(e)===e},c5=function(e){if(yPe!=="undefined")return e!=null&&e instanceof HTMLElement},Hs=function(e){return Db(e)||Yj(e)},Db=function(e){return Ib(e)==="collection"&&e._private.single},Yj=function(e){return Ib(e)==="collection"&&!e._private.single},W8=function(e){return Ib(e)==="core"},Xj=function(e){return Ib(e)==="stylesheet"},xPe=function(e){return Ib(e)==="event"},Xu=function(e){return e==null?!0:!!(e===""||e.match(/^\s+$/))},TPe=function(e){return typeof HTMLElement>"u"?!1:e instanceof HTMLElement},wPe=function(e){return Kr(e)&&Gt(e.x1)&&Gt(e.x2)&&Gt(e.y1)&&Gt(e.y2)},CPe=function(e){return vPe(e)&&jn(e.then)},kPe=function(){return Uj&&Uj.userAgent.match(/msie|trident|edge/i)},Tp=function(e,r){r||(r=function(){if(arguments.length===1)return arguments[0];if(arguments.length===0)return"undefined";for(var a=[],s=0;sr?1:0},IPe=function(e,r){return-1*Zj(e,r)},yr=Object.assign!=null?Object.assign.bind(Object):function(t){for(var e=arguments,r=1;r1&&(y-=1),y<1/6?g+(m-g)*6*y:y<1/2?m:y<2/3?g+(m-g)*(2/3-y)*6:g}var d=new RegExp("^"+APe+"$").exec(e);if(d){if(n=parseInt(d[1]),n<0?n=(360- -1*n%360)%360:n>360&&(n=n%360),n/=360,i=parseFloat(d[2]),i<0||i>100||(i=i/100,a=parseFloat(d[3]),a<0||a>100)||(a=a/100,s=d[4],s!==void 0&&(s=parseFloat(s),s<0||s>1)))return;if(i===0)o=l=u=Math.round(a*255);else{var f=a<.5?a*(1+i):a+i-a*i,p=2*a-f;o=Math.round(255*h(p,f,n+1/3)),l=Math.round(255*h(p,f,n)),u=Math.round(255*h(p,f,n-1/3))}r=[o,l,u,s]}return r},NPe=function(e){var r,n=new RegExp("^"+EPe+"$").exec(e);if(n){r=[];for(var i=[],a=1;a<=3;a++){var s=n[a];if(s[s.length-1]==="%"&&(i[a]=!0),s=parseFloat(s),i[a]&&(s=s/100*255),s<0||s>255)return;r.push(Math.floor(s))}var o=i[1]||i[2]||i[3],l=i[1]&&i[2]&&i[3];if(o&&!l)return;var u=n[4];if(u!==void 0){if(u=parseFloat(u),u<0||u>1)return;r.push(u)}}return r},OPe=function(e){return $Pe[e.toLowerCase()]},Qj=function(e){return(wn(e)?e:null)||OPe(e)||DPe(e)||NPe(e)||MPe(e)},$Pe={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]},Jj=function(e){for(var r=e.map,n=e.keys,i=n.length,a=0;a=l||S<0||T&&R>=f}function _(){var F=e();if(C(F))return L(F);g=setTimeout(_,A(F))}function L(F){return g=void 0,b&&h?w(F):(h=d=void 0,p)}function O(){g!==void 0&&clearTimeout(g),y=0,h=m=d=g=void 0}function M(){return g===void 0?p:L(e())}function z(){var F=e(),S=C(F);if(h=arguments,d=this,m=F,S){if(g===void 0)return k(m);if(T)return clearTimeout(g),g=setTimeout(_,l),w(m)}return g===void 0&&(g=setTimeout(_,l)),p}return z.cancel=O,z.flush=M,z}return sR=s,sR}var HPe=UPe(),$b=Mb(HPe),oR=zi?zi.performance:null,mZ=oR&&oR.now?function(){return oR.now()}:function(){return Date.now()},YPe=(function(){if(zi){if(zi.requestAnimationFrame)return function(t){zi.requestAnimationFrame(t)};if(zi.mozRequestAnimationFrame)return function(t){zi.mozRequestAnimationFrame(t)};if(zi.webkitRequestAnimationFrame)return function(t){zi.webkitRequestAnimationFrame(t)};if(zi.msRequestAnimationFrame)return function(t){zi.msRequestAnimationFrame(t)}}return function(t){t&&setTimeout(function(){t(mZ())},1e3/60)}})(),f5=function(e){return YPe(e)},$c=mZ,Ld=9261,yZ=65599,wp=5381,vZ=function(e){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ld,n=r,i;i=e.next(),!i.done;)n=n*yZ+i.value|0;return n},Pb=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ld;return r*yZ+e|0},Bb=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:wp;return(r<<5)+r+e|0},XPe=function(e,r){return e*2097152+r},ju=function(e){return e[0]*2097152+e[1]},p5=function(e,r){return[Pb(e[0],r[0]),Bb(e[1],r[1])]},bZ=function(e,r){var n={value:0,done:!1},i=0,a=e.length,s={next:function(){return i=0;i--)e[i]===r&&e.splice(i,1)},uR=function(e){e.splice(0,e.length)},iBe=function(e,r){for(var n=0;n"u"?"undefined":Fi(Set))!==sBe?Set:oBe,m5=function(e,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(e===void 0||r===void 0||!W8(e)){Hn("An element must have a core reference and parameters set");return}var i=r.group;if(i==null&&(r.data&&r.data.source!=null&&r.data.target!=null?i="edges":i="nodes"),i!=="nodes"&&i!=="edges"){Hn("An element must be of type `nodes` or `edges`; you specified `"+i+"`");return}this.length=1,this[0]=this;var a=this._private={cy:e,single:!0,data:r.data||{},position:r.position||{x:0,y:0},autoWidth:void 0,autoHeight:void 0,autoPadding:void 0,compoundBoundsClean:!1,listeners:[],group:i,style:{},rstyle:{},styleCxts:[],styleKeys:{},removed:!0,selected:!!r.selected,selectable:r.selectable===void 0?!0:!!r.selectable,locked:!!r.locked,grabbed:!1,grabbable:r.grabbable===void 0?!0:!!r.grabbable,pannable:r.pannable===void 0?i==="edges":!!r.pannable,active:!1,classes:new Cp,animation:{current:[],queue:[]},rscratch:{},scratch:r.scratch||{},edges:[],children:[],parent:r.parent&&r.parent.isNode()?r.parent:null,traversalCache:{},backgrounding:!1,bbCache:null,bbCacheShift:{x:0,y:0},bodyBounds:null,overlayBounds:null,labelBounds:{all:null,source:null,target:null,main:null},arrowBounds:{source:null,target:null,"mid-source":null,"mid-target":null}};if(a.position.x==null&&(a.position.x=0),a.position.y==null&&(a.position.y=0),r.renderedPosition){var s=r.renderedPosition,o=e.pan(),l=e.zoom();a.position={x:(s.x-o.x)/l,y:(s.y-o.y)/l}}var u=[];wn(r.classes)?u=r.classes:hr(r.classes)&&(u=r.classes.split(/\s+/));for(var h=0,d=u.length;hT?1:0},h=function(v,T,b,w,k){var A;if(b==null&&(b=0),k==null&&(k=n),b<0)throw new Error("lo must be non-negative");for(w==null&&(w=v.length);bO;0<=O?L++:L--)_.push(L);return _}).apply(this).reverse(),C=[],w=0,k=A.length;wM;0<=M?++_:--_)z.push(s(v,b));return z},m=function(v,T,b,w){var k,A,C;for(w==null&&(w=n),k=v[b];b>T;){if(C=b-1>>1,A=v[C],w(k,A)<0){v[b]=A,b=C;continue}break}return v[b]=k},y=function(v,T,b){var w,k,A,C,_;for(b==null&&(b=n),k=v.length,_=T,A=v[T],w=2*T+1;w0;){var A=T.pop(),C=y(A),_=A.id();if(f[_]=C,C!==1/0)for(var L=A.neighborhood().intersect(g),O=0;O0)for(I.unshift(D);d[B];){var P=d[B];I.unshift(P.edge),I.unshift(P.node),$=P.node,B=$.id()}return o.spawn(I)}}}},pBe={kruskal:function(e){e=e||function(b){return 1};for(var r=this.byGroup(),n=r.nodes,i=r.edges,a=n.length,s=new Array(a),o=n,l=function(w){for(var k=0;k0;){if(k(),C++,w===h){for(var _=[],L=a,O=h,M=v[O];_.unshift(L),M!=null&&_.unshift(M),L=y[O],L!=null;)O=L.id(),M=v[O];return{found:!0,distance:d[w],path:this.spawn(_),steps:C}}p[w]=!0;for(var z=b._private.edges,F=0;FM&&(g[O]=M,T[O]=L,b[O]=k),!a){var z=L*h+_;!a&&g[z]>M&&(g[z]=M,T[z]=_,b[z]=k)}}}for(var F=0;F1&&arguments[1]!==void 0?arguments[1]:s,Ge=b(me),Te=[],Ze=Ge;;){if(Ze==null)return r.spawn();var ke=T(Ze),Ve=ke.edge,Qe=ke.pred;if(Te.unshift(Ze[0]),Ze.same(ve)&&Te.length>0)break;Ve!=null&&Te.unshift(Ve),Ze=Qe}return l.spawn(Te)},A=0;A=0;h--){var d=u[h],f=d[1],p=d[2];(r[f]===o&&r[p]===l||r[f]===l&&r[p]===o)&&u.splice(h,1)}for(var g=0;gi;){var a=Math.floor(Math.random()*r.length);r=wBe(a,e,r),n--}return r},CBe={kargerStein:function(){var e=this,r=this.byGroup(),n=r.nodes,i=r.edges;i.unmergeBy(function(I){return I.isLoop()});var a=n.length,s=i.length,o=Math.ceil(Math.pow(Math.log(a)/Math.LN2,2)),l=Math.floor(a/TBe);if(a<2){Hn("At least 2 nodes are required for Karger-Stein algorithm");return}for(var u=[],h=0;h1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,i=1/0,a=r;a1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,i=-1/0,a=r;a1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,i=0,a=0,s=r;s1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0;i?e=e.slice(r,n):(n0&&e.splice(0,r));for(var o=0,l=e.length-1;l>=0;l--){var u=e[l];s?isFinite(u)||(e[l]=-1/0,o++):e.splice(l,1)}a&&e.sort(function(f,p){return f-p});var h=e.length,d=Math.floor(h/2);return h%2!==0?e[d+1+o]:(e[d-1+o]+e[d+o])/2},RBe=function(e){return Math.PI*e/180},b5=function(e,r){return Math.atan2(r,e)-Math.PI/2},pR=Math.log2||function(t){return Math.log(t)/Math.log(2)},gR=function(e){return e>0?1:e<0?-1:0},Dd=function(e,r){return Math.sqrt(Md(e,r))},Md=function(e,r){var n=r.x-e.x,i=r.y-e.y;return n*n+i*i},LBe=function(e){for(var r=e.length,n=0,i=0;i=e.x1&&e.y2>=e.y1)return{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,w:e.x2-e.x1,h:e.y2-e.y1};if(e.w!=null&&e.h!=null&&e.w>=0&&e.h>=0)return{x1:e.x1,y1:e.y1,x2:e.x1+e.w,y2:e.y1+e.h,w:e.w,h:e.h}}},DBe=function(e){return{x1:e.x1,x2:e.x2,w:e.w,y1:e.y1,y2:e.y2,h:e.h}},MBe=function(e){e.x1=1/0,e.y1=1/0,e.x2=-1/0,e.y2=-1/0,e.w=0,e.h=0},NBe=function(e,r){e.x1=Math.min(e.x1,r.x1),e.x2=Math.max(e.x2,r.x2),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,r.y1),e.y2=Math.max(e.y2,r.y2),e.h=e.y2-e.y1},IZ=function(e,r,n){e.x1=Math.min(e.x1,r),e.x2=Math.max(e.x2,r),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,n),e.y2=Math.max(e.y2,n),e.h=e.y2-e.y1},x5=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return e.x1-=r,e.x2+=r,e.y1-=r,e.y2+=r,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},T5=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0],n,i,a,s;if(r.length===1)n=i=a=s=r[0];else if(r.length===2)n=a=r[0],s=i=r[1];else if(r.length===4){var o=Ri(r,4);n=o[0],i=o[1],a=o[2],s=o[3]}return e.x1-=s,e.x2+=i,e.y1-=n,e.y2+=a,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},DZ=function(e,r){e.x1=r.x1,e.y1=r.y1,e.x2=r.x2,e.y2=r.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1},mR=function(e,r){return!(e.x1>r.x2||r.x1>e.x2||e.x2r.y2||r.y1>e.y2)},Qu=function(e,r,n){return e.x1<=r&&r<=e.x2&&e.y1<=n&&n<=e.y2},MZ=function(e,r){return Qu(e,r.x,r.y)},NZ=function(e,r){return Qu(e,r.x1,r.y1)&&Qu(e,r.x2,r.y2)},OBe=(fR=Math.hypot)!==null&&fR!==void 0?fR:function(t,e){return Math.sqrt(t*t+e*e)};function $Be(t,e){if(t.length<3)throw new Error("Need at least 3 vertices");var r=function(_,L){return{x:_.x+L.x,y:_.y+L.y}},n=function(_,L){return{x:_.x-L.x,y:_.y-L.y}},i=function(_,L){return{x:_.x*L,y:_.y*L}},a=function(_,L){return _.x*L.y-_.y*L.x},s=function(_){var L=OBe(_.x,_.y);return L===0?{x:0,y:0}:{x:_.x/L,y:_.y/L}},o=function(_){for(var L=0,O=0;O<_.length;O++){var M=_[O],z=_[(O+1)%_.length];L+=M.x*z.y-z.x*M.y}return L/2},l=function(_,L,O,M){var z=n(L,_),F=n(M,O),S=a(z,F);if(Math.abs(S)<1e-9)return r(_,i(z,.5));var R=a(n(O,_),F)/S;return r(_,i(z,R))},u=t.map(function(C){return{x:C.x,y:C.y}});o(u)<0&&u.reverse();for(var h=u.length,d=[],f=0;f7&&arguments[7]!==void 0?arguments[7]:"auto",u=l==="auto"?eh(a,s):l,h=a/2,d=s/2;u=Math.min(u,h,d);var f=u!==h,p=u!==d,g;if(f){var m=n-h+u-o,y=i-d-o,v=n+h-u+o,T=y;if(g=Ju(e,r,n,i,m,y,v,T,!1),g.length>0)return g}if(p){var b=n+h+o,w=i-d+u-o,k=b,A=i+d-u+o;if(g=Ju(e,r,n,i,b,w,k,A,!1),g.length>0)return g}if(f){var C=n-h+u-o,_=i+d+o,L=n+h-u+o,O=_;if(g=Ju(e,r,n,i,C,_,L,O,!1),g.length>0)return g}if(p){var M=n-h-o,z=i-d+u-o,F=M,S=i+d-u+o;if(g=Ju(e,r,n,i,M,z,F,S,!1),g.length>0)return g}var R;{var N=n-h+u,D=i-d+u;if(R=qb(e,r,n,i,N,D,u+o),R.length>0&&R[0]<=N&&R[1]<=D)return[R[0],R[1]]}{var I=n+h-u,$=i-d+u;if(R=qb(e,r,n,i,I,$,u+o),R.length>0&&R[0]>=I&&R[1]<=$)return[R[0],R[1]]}{var B=n+h-u,P=i+d-u;if(R=qb(e,r,n,i,B,P,u+o),R.length>0&&R[0]>=B&&R[1]>=P)return[R[0],R[1]]}{var G=n-h+u,V=i+d-u;if(R=qb(e,r,n,i,G,V,u+o),R.length>0&&R[0]<=G&&R[1]>=V)return[R[0],R[1]]}return[]},BBe=function(e,r,n,i,a,s,o){var l=o,u=Math.min(n,a),h=Math.max(n,a),d=Math.min(i,s),f=Math.max(i,s);return u-l<=e&&e<=h+l&&d-l<=r&&r<=f+l},FBe=function(e,r,n,i,a,s,o,l,u){var h={x1:Math.min(n,o,a)-u,x2:Math.max(n,o,a)+u,y1:Math.min(i,l,s)-u,y2:Math.max(i,l,s)+u};return!(eh.x2||rh.y2)},zBe=function(e,r,n,i){n-=i;var a=r*r-4*e*n;if(a<0)return[];var s=Math.sqrt(a),o=2*e,l=(-r+s)/o,u=(-r-s)/o;return[l,u]},GBe=function(e,r,n,i,a){var s=1e-5;e===0&&(e=s),r/=e,n/=e,i/=e;var o,l,u,h,d,f,p,g;if(l=(3*n-r*r)/9,u=-(27*i)+r*(9*n-2*(r*r)),u/=54,o=l*l*l+u*u,a[1]=0,p=r/3,o>0){d=u+Math.sqrt(o),d=d<0?-Math.pow(-d,1/3):Math.pow(d,1/3),f=u-Math.sqrt(o),f=f<0?-Math.pow(-f,1/3):Math.pow(f,1/3),a[0]=-p+d+f,p+=(d+f)/2,a[4]=a[2]=-p,p=Math.sqrt(3)*(-f+d)/2,a[3]=p,a[5]=-p;return}if(a[5]=a[3]=0,o===0){g=u<0?-Math.pow(-u,1/3):Math.pow(u,1/3),a[0]=-p+2*g,a[4]=a[2]=-(g+p);return}l=-l,h=l*l*l,h=Math.acos(u/Math.sqrt(h)),g=2*Math.sqrt(l),a[0]=-p+g*Math.cos(h/3),a[2]=-p+g*Math.cos((h+2*Math.PI)/3),a[4]=-p+g*Math.cos((h+4*Math.PI)/3)},qBe=function(e,r,n,i,a,s,o,l){var u=1*n*n-4*n*a+2*n*o+4*a*a-4*a*o+o*o+i*i-4*i*s+2*i*l+4*s*s-4*s*l+l*l,h=9*n*a-3*n*n-3*n*o-6*a*a+3*a*o+9*i*s-3*i*i-3*i*l-6*s*s+3*s*l,d=3*n*n-6*n*a+n*o-n*e+2*a*a+2*a*e-o*e+3*i*i-6*i*s+i*l-i*r+2*s*s+2*s*r-l*r,f=1*n*a-n*n+n*e-a*e+i*s-i*i+i*r-s*r,p=[];GBe(u,h,d,f,p);for(var g=1e-7,m=[],y=0;y<6;y+=2)Math.abs(p[y+1])=0&&p[y]<=1&&m.push(p[y]);m.push(1),m.push(0);for(var v=-1,T,b,w,k=0;k=0?wu?(e-a)*(e-a)+(r-s)*(r-s):h-f},Cs=function(e,r,n){for(var i,a,s,o,l,u=0,h=0;h=e&&e>=s||i<=e&&e<=s)l=(e-i)/(s-i)*(o-a)+a,l>r&&u++;else continue;return u%2!==0},Bc=function(e,r,n,i,a,s,o,l,u){var h=new Array(n.length),d;l[0]!=null?(d=Math.atan(l[1]/l[0]),l[0]<0?d=d+Math.PI/2:d=-d-Math.PI/2):d=l;for(var f=Math.cos(-d),p=Math.sin(-d),g=0;g0){var y=C5(h,-u);m=w5(y)}else m=h;return Cs(e,r,m)},WBe=function(e,r,n,i,a,s,o,l){for(var u=new Array(n.length*2),h=0;h=0&&y<=1&&T.push(y),v>=0&&v<=1&&T.push(v),T.length===0)return[];var b=T[0]*l[0]+e,w=T[0]*l[1]+r;if(T.length>1){if(T[0]==T[1])return[b,w];var k=T[1]*l[0]+e,A=T[1]*l[1]+r;return[b,w,k,A]}else return[b,w]},yR=function(e,r,n){return r<=e&&e<=n||n<=e&&e<=r?e:e<=r&&r<=n||n<=r&&r<=e?r:n},Ju=function(e,r,n,i,a,s,o,l,u){var h=e-a,d=n-e,f=o-a,p=r-s,g=i-r,m=l-s,y=f*p-m*h,v=d*p-g*h,T=m*d-f*g;if(T!==0){var b=y/T,w=v/T,k=.001,A=0-k,C=1+k;return A<=b&&b<=C&&A<=w&&w<=C?[e+b*d,r+b*g]:u?[e+b*d,r+b*g]:[]}else return y===0||v===0?yR(e,n,o)===o?[o,l]:yR(e,n,a)===a?[a,s]:yR(a,o,n)===n?[n,i]:[]:[]},HBe=function(e,r,n,i,a){var s=[],o=i/2,l=a/2,u=r,h=n;s.push({x:u+o*e[0],y:h+l*e[1]});for(var d=1;d0){var m=C5(d,-l);p=w5(m)}else p=d}else p=n;for(var y,v,T,b,w=0;w2){for(var g=[h[0],h[1]],m=Math.pow(g[0]-e,2)+Math.pow(g[1]-r,2),y=1;yh&&(h=w)},get:function(b){return u[b]}},f=0;f0?R=S.edgesTo(F)[0]:R=F.edgesTo(S)[0];var N=i(R);F=F.id(),C[F]>C[M]+N&&(C[F]=C[M]+N,_.nodes.indexOf(F)<0?_.push(F):_.updateItem(F),A[F]=0,k[F]=[]),C[F]==C[M]+N&&(A[F]=A[F]+A[M],k[F].push(M))}else for(var D=0;D0;){for(var P=w.pop(),G=0;G0&&o.push(n[l]);o.length!==0&&a.push(i.collection(o))}return a},oFe=function(e,r){for(var n=0;n5&&arguments[5]!==void 0?arguments[5]:uFe,o=i,l,u,h=0;h=2?Wb(e,r,n,0,WZ,hFe):Wb(e,r,n,0,VZ)},squaredEuclidean:function(e,r,n){return Wb(e,r,n,0,WZ)},manhattan:function(e,r,n){return Wb(e,r,n,0,VZ)},max:function(e,r,n){return Wb(e,r,n,-1/0,dFe)}};_p["squared-euclidean"]=_p.squaredEuclidean,_p.squaredeuclidean=_p.squaredEuclidean;function E5(t,e,r,n,i,a){var s;return jn(t)?s=t:s=_p[t]||_p.euclidean,e===0&&jn(t)?s(i,a):s(e,r,n,i,a)}var fFe=ha({k:2,m:2,sensitivityThreshold:1e-4,distance:"euclidean",maxIterations:10,attributes:[],testMode:!1,testCentroids:null}),CR=function(e){return fFe(e)},S5=function(e,r,n,i,a){var s=a!=="kMedoids",o=s?function(d){return n[d]}:function(d){return i[d](n)},l=function(f){return i[f](r)},u=n,h=r;return E5(e,i.length,o,l,u,h)},kR=function(e,r,n){for(var i=n.length,a=new Array(i),s=new Array(i),o=new Array(r),l=null,u=0;un)return!1}return!0},mFe=function(e,r,n){for(var i=0;io&&(o=r[u][h],l=h);a[l].push(e[u])}for(var d=0;d=a.threshold||a.mode==="dendrogram"&&e.length===1)return!1;var g=r[s],m=r[i[s]],y;a.mode==="dendrogram"?y={left:g,right:m,key:g.key}:y={value:g.value.concat(m.value),key:g.key},e[g.index]=y,e.splice(m.index,1),r[g.key]=y;for(var v=0;vn[m.key][T.key]&&(l=n[m.key][T.key])):a.linkage==="max"?(l=n[g.key][T.key],n[g.key][T.key]0&&i.push(a);return i},QZ=function(e,r,n){for(var i=[],a=0;ao&&(s=u,o=r[a*e+u])}s>0&&i.push(s)}for(var h=0;hu&&(l=h,u=d)}n[a]=s[l]}return i=QZ(e,r,n),i},JZ=function(e){for(var r=this.cy(),n=this.nodes(),i=_Fe(e),a={},s=0;s=M?(z=M,M=S,F=R):S>z&&(z=S);for(var N=0;N0?1:0;C[L%i.minIterations*o+G]=V,P+=V}if(P>0&&(L>=i.minIterations-1||L==i.maxIterations-1)){for(var Y=0,W=0;W1||A>1)&&(o=!0),d[b]=[],T.outgoers().forEach(function(_){_.isEdge()&&d[b].push(_.id())})}else f[b]=[void 0,T.target().id()]}):s.forEach(function(T){var b=T.id();if(T.isNode()){var w=T.degree(!0);w%2&&(l?u?o=!0:u=b:l=b),d[b]=[],T.connectedEdges().forEach(function(k){return d[b].push(k.id())})}else f[b]=[T.source().id(),T.target().id()]});var p={found:!1,trail:void 0};if(o)return p;if(u&&l)if(a){if(h&&u!=h)return p;h=u}else{if(h&&u!=h&&l!=h)return p;h||(h=u)}else h||(h=s[0].id());var g=function(b){for(var w=b,k=[b],A,C,_;d[w].length;)A=d[w].shift(),C=f[A][0],_=f[A][1],w!=_?(d[_]=d[_].filter(function(L){return L!=A}),w=_):!a&&w!=C&&(d[C]=d[C].filter(function(L){return L!=A}),w=C),k.unshift(A),k.unshift(w);return k},m=[],y=[];for(y=g(h);y.length!=1;)d[y[0]].length==0?(m.unshift(s.getElementById(y.shift())),m.unshift(s.getElementById(y.shift()))):y=g(y.shift()).concat(y);m.unshift(s.getElementById(y.shift()));for(var v in d)if(d[v].length)return p;return p.found=!0,p.trail=this.spawn(m,!0),p}},A5=function(){var e=this,r={},n=0,i=0,a=[],s=[],o={},l=function(f,p){for(var g=s.length-1,m=[],y=e.spawn();s[g].x!=f||s[g].y!=p;)m.push(s.pop().edge),g--;m.push(s.pop().edge),m.forEach(function(v){var T=v.connectedNodes().intersection(e);y.merge(v),T.forEach(function(b){var w=b.id(),k=b.connectedEdges().intersection(e);y.merge(b),r[w].cutVertex?y.merge(k.filter(function(A){return A.isLoop()})):y.merge(k)})}),a.push(y)},u=function(f,p,g){f===g&&(i+=1),r[p]={id:n,low:n++,cutVertex:!1};var m=e.getElementById(p).connectedEdges().intersection(e);if(m.size()===0)a.push(e.spawn(e.getElementById(p)));else{var y,v,T,b;m.forEach(function(w){y=w.source().id(),v=w.target().id(),T=y===p?v:y,T!==g&&(b=w.id(),o[b]||(o[b]=!0,s.push({x:p,y:T,edge:w})),T in r?r[p].low=Math.min(r[p].low,r[T].id):(u(f,T,p),r[p].low=Math.min(r[p].low,r[T].low),r[p].id<=r[T].low&&(r[p].cutVertex=!0,l(p,T))))})}};e.forEach(function(d){if(d.isNode()){var f=d.id();f in r||(i=0,u(f,f),r[f].cutVertex=i>1)}});var h=Object.keys(r).filter(function(d){return r[d].cutVertex}).map(function(d){return e.getElementById(d)});return{cut:e.spawn(h),components:a}},$Fe={hopcroftTarjanBiconnected:A5,htbc:A5,htb:A5,hopcroftTarjanBiconnectedComponents:A5},_5=function(){var e=this,r={},n=0,i=[],a=[],s=e.spawn(e),o=function(u){a.push(u),r[u]={index:n,low:n++,explored:!1};var h=e.getElementById(u).connectedEdges().intersection(e);if(h.forEach(function(m){var y=m.target().id();y!==u&&(y in r||o(y),r[y].explored||(r[u].low=Math.min(r[u].low,r[y].low)))}),r[u].index===r[u].low){for(var d=e.spawn();;){var f=a.pop();if(d.merge(e.getElementById(f)),r[f].low=r[u].index,r[f].explored=!0,f===u)break}var p=d.edgesWith(d),g=d.merge(p);i.push(g),s=s.difference(g)}};return e.forEach(function(l){if(l.isNode()){var u=l.id();u in r||o(u)}}),{cut:s,components:i}},PFe={tarjanStronglyConnected:_5,tsc:_5,tscc:_5,tarjanStronglyConnectedComponents:_5},eQ={};[Fb,fBe,pBe,mBe,vBe,xBe,CBe,jBe,Sp,Ap,wR,cFe,wFe,SFe,MFe,OFe,$Fe,PFe].forEach(function(t){yr(eQ,t)});/*! +Parent cluster`,i.height),e.setNode(i.id,v),e.parent(m)||(se.trace("Setting parent",m,i.id),e.setParent(m,i.id,v))}if(se.info("(Insert) Node XXX"+m+": "+JSON.stringify(e.node(m))),y!=null&&y.clusterNode){se.info("Cluster identified XBX",m,y.width,e.node(m));const{ranksep:v,nodesep:x}=e.graph();y.graph.setGraph({...y.graph.graph(),ranksep:v+25,nodesep:x});const b=await aie(d,y.graph,r,n,e.node(m),a),w=b.elem;or(y,w),y.diff=b.diff||0,se.info("New compound node after recursive render XAX",m,"width",y.width,"height",y.height),jIe(w,y)}else e.children(m).length>0?(se.trace("Cluster - the non recursive path XBX",m,y.id,y,y.width,"Graph:",e),se.trace(PT(y.id,e)),Hr.set(y.id,{id:PT(y.id,e),node:y})):(se.trace("Node - the non recursive path XAX",m,d,e.node(m),s),await uE(d,e.node(m),{config:a,dir:s}))})),await T(async()=>{const m=e.edges().map(async function(y){const v=e.edge(y.v,y.w,y.name);se.info("Edge "+y.v+" -> "+y.w+": "+JSON.stringify(y)),se.info("Edge "+y.v+" -> "+y.w+": ",y," ",JSON.stringify(e.edge(y))),se.info("Fix",Hr,"ids:",y.v,y.w,"Translating: ",Hr.get(y.v),Hr.get(y.w)),await TK(h,v)});await Promise.all(m)},"processEdges")(),se.info("Graph before layout:",JSON.stringify(yc(e))),se.info("############################################# XXX"),se.info("### Layout ### XXX"),se.info("############################################# XXX"),Qne(e),se.info("Graph after layout:",JSON.stringify(yc(e)));let p=0,{subGraphTitleTotalMargin:g}=Ex(a);return await Promise.all(WHe(e).map(async function(m){var v;const y=e.node(m);if(se.info("Position XBX => "+m+": ("+y.x,","+y.y,") width: ",y.width," height: ",y.height),y!=null&&y.clusterNode)y.y+=g,se.info("A tainted cluster node XBX1",m,y.id,y.width,y.height,y.x,y.y,e.parent(m)),Hr.get(y.id).node=y,X8(y);else if(e.children(m).length>0){se.info("A pure cluster node XBX1",m,y.id,y.x,y.y,y.width,y.height,e.parent(m)),y.height+=g,e.node(y.parentId);const x=(y==null?void 0:y.padding)/2||0,b=((v=y==null?void 0:y.labelBBox)==null?void 0:v.height)||0,w=b-x||0;se.debug("OffsetY",w,"labelHeight",b,"halfPadding",x),await q8(l,y),Hr.get(y.id).node=y}else{const x=e.node(y.parentId);y.y+=g/2,se.info("A regular node XBX1 - using the padding",y.id,"parent",y.parentId,y.width,y.height,y.x,y.y,"offsetY",y.offsetY,"parent",x,x==null?void 0:x.offsetY,y),X8(y)}})),e.edges().forEach(function(m){const y=e.edge(m);se.info("Edge "+m.v+" -> "+m.w+": "+JSON.stringify(y),y),y.points.forEach(w=>w.y+=g/2);const v=e.node(m.v);var x=e.node(m.w);const b=SK(u,y,Hr,r,v,x,n);wK(y,b)}),e.nodes().forEach(function(m){const y=e.node(m);se.info(m,y.type,y.diff),y.isGroup&&(p=y.diff)}),se.warn("Returning from recursive render XAX",o,p),{elem:o,diff:p}},"recursiveRender"),UHe=T(async(t,e)=>{var a,s,o,l,u,h;const r=new Js({multigraph:!0,compound:!0}).setGraph({rankdir:t.direction,nodesep:((a=t.config)==null?void 0:a.nodeSpacing)||((o=(s=t.config)==null?void 0:s.flowchart)==null?void 0:o.nodeSpacing)||t.nodeSpacing,ranksep:((l=t.config)==null?void 0:l.rankSpacing)||((h=(u=t.config)==null?void 0:u.flowchart)==null?void 0:h.rankSpacing)||t.rankSpacing,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}}),n=e.select("g");RK(n,t.markers,t.type,t.diagramId),KIe(),tDe(),RIe(),zHe(),t.nodes.forEach(d=>{r.setNode(d.id,{...d}),d.parentId&&r.setParent(d.id,d.parentId)}),se.debug("Edges:",t.edges),t.edges.forEach(d=>{if(d.start===d.end){const f=d.start,p=f+"---"+f+"---1",g=f+"---"+f+"---2",m=r.node(f);r.setNode(p,{domId:p,id:p,parentId:m.parentId,labelStyle:"",label:"",padding:0,shape:"labelRect",style:"",width:10,height:10}),r.setParent(p,m.parentId),r.setNode(g,{domId:g,id:g,parentId:m.parentId,labelStyle:"",padding:0,shape:"labelRect",label:"",style:"",width:10,height:10}),r.setParent(g,m.parentId);const y=structuredClone(d),v=structuredClone(d),x=structuredClone(d);y.label="",y.arrowTypeEnd="none",y.endLabelLeft="",y.endLabelRight="",y.startLabelLeft="",y.id=f+"-cyclic-special-1",v.startLabelRight="",v.startLabelLeft="",v.endLabelLeft="",v.endLabelRight="",v.arrowTypeStart="none",v.arrowTypeEnd="none",v.id=f+"-cyclic-special-mid",x.label="",x.startLabelRight="",x.startLabelLeft="",x.arrowTypeStart="none",m.isGroup&&(y.fromCluster=f,x.toCluster=f),x.id=f+"-cyclic-special-2",x.arrowTypeStart="none",r.setEdge(f,p,y,f+"-cyclic-special-0"),r.setEdge(p,g,v,f+"-cyclic-special-1"),r.setEdge(g,f,x,f+"-cyct.length)&&(e=t.length);for(var r=0,n=Array(e);r=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a,s=!0,o=!1;return{s:function(){r=r.call(t)},n:function(){var l=r.next();return s=l.done,l},e:function(l){o=!0,a=l},f:function(){try{s||r.return==null||r.return()}finally{if(o)throw a}}}}function sie(t,e,r){return(e=oie(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function KHe(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function ZHe(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,a,s,o=[],l=!0,u=!1;try{if(a=(r=r.call(t)).next,e===0){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(o.push(n.value),o.length!==e);l=!0);}catch(h){u=!0,i=h}finally{try{if(!l&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(u)throw i}}return o}}function QHe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function JHe(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Qi(t,e){return YHe(t)||ZHe(t,e)||v9(t,e)||QHe()}function o3(t){return XHe(t)||KHe(t)||v9(t)||JHe()}function eYe(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function oie(t){var e=eYe(t,"string");return typeof e=="symbol"?e:e+""}function la(t){"@babel/helpers - typeof";return la=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},la(t)}function v9(t,e){if(t){if(typeof t=="string")return y9(t,e);var r={}.toString.call(t).slice(8,-1);return r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set"?Array.from(t):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?y9(t,e):void 0}}var ca=typeof window>"u"?null:window,lie=ca?ca.navigator:null;ca&&ca.document;var tYe=la(""),cie=la({}),rYe=la(function(){}),nYe=typeof HTMLElement>"u"?"undefined":la(HTMLElement),BT=function(e){return e&&e.instanceString&&yi(e.instanceString)?e.instanceString():null},yr=function(e){return e!=null&&la(e)==tYe},yi=function(e){return e!=null&&la(e)===rYe},Pn=function(e){return!Ao(e)&&(Array.isArray?Array.isArray(e):e!=null&&e instanceof Array)},an=function(e){return e!=null&&la(e)===cie&&!Pn(e)&&e.constructor===Object},iYe=function(e){return e!=null&&la(e)===cie},Ht=function(e){return e!=null&&la(e)===la(1)&&!isNaN(e)},aYe=function(e){return Ht(e)&&Math.floor(e)===e},l3=function(e){if(nYe!=="undefined")return e!=null&&e instanceof HTMLElement},Ao=function(e){return FT(e)||uie(e)},FT=function(e){return BT(e)==="collection"&&e._private.single},uie=function(e){return BT(e)==="collection"&&!e._private.single},b9=function(e){return BT(e)==="core"},hie=function(e){return BT(e)==="stylesheet"},sYe=function(e){return BT(e)==="event"},Kh=function(e){return e==null?!0:!!(e===""||e.match(/^\s+$/))},oYe=function(e){return typeof HTMLElement>"u"?!1:e instanceof HTMLElement},lYe=function(e){return an(e)&&Ht(e.x1)&&Ht(e.x2)&&Ht(e.y1)&&Ht(e.y2)},cYe=function(e){return iYe(e)&&yi(e.then)},uYe=function(){return lie&&lie.userAgent.match(/msie|trident|edge/i)},em=function(e,r){r||(r=function(){if(arguments.length===1)return arguments[0];if(arguments.length===0)return"undefined";for(var a=[],s=0;sr?1:0},yYe=function(e,r){return-1*pie(e,r)},Cr=Object.assign!=null?Object.assign.bind(Object):function(t){for(var e=arguments,r=1;r1&&(y-=1),y<1/6?g+(m-g)*6*y:y<1/2?m:y<2/3?g+(m-g)*(2/3-y)*6:g}var d=new RegExp("^"+fYe+"$").exec(e);if(d){if(n=parseInt(d[1]),n<0?n=(360- -1*n%360)%360:n>360&&(n=n%360),n/=360,i=parseFloat(d[2]),i<0||i>100||(i=i/100,a=parseFloat(d[3]),a<0||a>100)||(a=a/100,s=d[4],s!==void 0&&(s=parseFloat(s),s<0||s>1)))return;if(i===0)o=l=u=Math.round(a*255);else{var f=a<.5?a*(1+i):a+i-a*i,p=2*a-f;o=Math.round(255*h(p,f,n+1/3)),l=Math.round(255*h(p,f,n)),u=Math.round(255*h(p,f,n-1/3))}r=[o,l,u,s]}return r},xYe=function(e){var r,n=new RegExp("^"+hYe+"$").exec(e);if(n){r=[];for(var i=[],a=1;a<=3;a++){var s=n[a];if(s[s.length-1]==="%"&&(i[a]=!0),s=parseFloat(s),i[a]&&(s=s/100*255),s<0||s>255)return;r.push(Math.floor(s))}var o=i[1]||i[2]||i[3],l=i[1]&&i[2]&&i[3];if(o&&!l)return;var u=n[4];if(u!==void 0){if(u=parseFloat(u),u<0||u>1)return;r.push(u)}}return r},TYe=function(e){return wYe[e.toLowerCase()]},gie=function(e){return(Pn(e)?e:null)||TYe(e)||vYe(e)||xYe(e)||bYe(e)},wYe={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]},mie=function(e){for(var r=e.map,n=e.keys,i=n.length,a=0;a=l||A<0||x&&R>=f}function S(){var F=e();if(k(F))return L(F);g=setTimeout(S,_(F))}function L(F){return g=void 0,b&&h?w(F):(h=d=void 0,p)}function $(){g!==void 0&&clearTimeout(g),y=0,h=m=d=g=void 0}function I(){return g===void 0?p:L(e())}function z(){var F=e(),A=k(F);if(h=arguments,d=this,m=F,A){if(g===void 0)return C(m);if(x)return clearTimeout(g),g=setTimeout(S,l),w(m)}return g===void 0&&(g=setTimeout(S,l)),p}return z.cancel=$,z.flush=I,z}return $9=s,$9}var DYe=IYe(),VT=zT(DYe),O9=ca?ca.performance:null,Mie=O9&&O9.now?function(){return O9.now()}:function(){return Date.now()},MYe=(function(){if(ca){if(ca.requestAnimationFrame)return function(t){ca.requestAnimationFrame(t)};if(ca.mozRequestAnimationFrame)return function(t){ca.mozRequestAnimationFrame(t)};if(ca.webkitRequestAnimationFrame)return function(t){ca.webkitRequestAnimationFrame(t)};if(ca.msRequestAnimationFrame)return function(t){ca.msRequestAnimationFrame(t)}}return function(t){t&&setTimeout(function(){t(Mie())},1e3/60)}})(),d3=function(e){return MYe(e)},$u=Mie,Yf=9261,Nie=65599,tm=5381,$ie=function(e){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Yf,n=r,i;i=e.next(),!i.done;)n=n*Nie+i.value|0;return n},WT=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Yf;return r*Nie+e|0},UT=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:tm;return(r<<5)+r+e|0},NYe=function(e,r){return e*2097152+r},Qh=function(e){return e[0]*2097152+e[1]},f3=function(e,r){return[WT(e[0],r[0]),UT(e[1],r[1])]},Oie=function(e,r){var n={value:0,done:!1},i=0,a=e.length,s={next:function(){return i=0;i--)e[i]===r&&e.splice(i,1)},F9=function(e){e.splice(0,e.length)},WYe=function(e,r){for(var n=0;n"u"?"undefined":la(Set))!==HYe?Set:YYe,g3=function(e,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(e===void 0||r===void 0||!b9(e)){fi("An element must have a core reference and parameters set");return}var i=r.group;if(i==null&&(r.data&&r.data.source!=null&&r.data.target!=null?i="edges":i="nodes"),i!=="nodes"&&i!=="edges"){fi("An element must be of type `nodes` or `edges`; you specified `"+i+"`");return}this.length=1,this[0]=this;var a=this._private={cy:e,single:!0,data:r.data||{},position:r.position||{x:0,y:0},autoWidth:void 0,autoHeight:void 0,autoPadding:void 0,compoundBoundsClean:!1,listeners:[],group:i,style:{},rstyle:{},styleCxts:[],styleKeys:{},removed:!0,selected:!!r.selected,selectable:r.selectable===void 0?!0:!!r.selectable,locked:!!r.locked,grabbed:!1,grabbable:r.grabbable===void 0?!0:!!r.grabbable,pannable:r.pannable===void 0?i==="edges":!!r.pannable,active:!1,classes:new rm,animation:{current:[],queue:[]},rscratch:{},scratch:r.scratch||{},edges:[],children:[],parent:r.parent&&r.parent.isNode()?r.parent:null,traversalCache:{},backgrounding:!1,bbCache:null,bbCacheShift:{x:0,y:0},bodyBounds:null,overlayBounds:null,labelBounds:{all:null,source:null,target:null,main:null},arrowBounds:{source:null,target:null,"mid-source":null,"mid-target":null}};if(a.position.x==null&&(a.position.x=0),a.position.y==null&&(a.position.y=0),r.renderedPosition){var s=r.renderedPosition,o=e.pan(),l=e.zoom();a.position={x:(s.x-o.x)/l,y:(s.y-o.y)/l}}var u=[];Pn(r.classes)?u=r.classes:yr(r.classes)&&(u=r.classes.split(/\s+/));for(var h=0,d=u.length;hx?1:0},h=function(v,x,b,w,C){var _;if(b==null&&(b=0),C==null&&(C=n),b<0)throw new Error("lo must be non-negative");for(w==null&&(w=v.length);b$;0<=$?L++:L--)S.push(L);return S}).apply(this).reverse(),k=[],w=0,C=_.length;wI;0<=I?++S:--S)z.push(s(v,b));return z},m=function(v,x,b,w){var C,_,k;for(w==null&&(w=n),C=v[b];b>x;){if(k=b-1>>1,_=v[k],w(C,_)<0){v[b]=_,b=k;continue}break}return v[b]=C},y=function(v,x,b){var w,C,_,k,S;for(b==null&&(b=n),C=v.length,S=x,_=v[x],w=2*x+1;w0;){var _=x.pop(),k=y(_),S=_.id();if(f[S]=k,k!==1/0)for(var L=_.neighborhood().intersect(g),$=0;$0)for(D.unshift(M);d[B];){var P=d[B];D.unshift(P.edge),D.unshift(P.node),O=P.node,B=O.id()}return o.spawn(D)}}}},eXe={kruskal:function(e){e=e||function(b){return 1};for(var r=this.byGroup(),n=r.nodes,i=r.edges,a=n.length,s=new Array(a),o=n,l=function(w){for(var C=0;C0;){if(C(),k++,w===h){for(var S=[],L=a,$=h,I=v[$];S.unshift(L),I!=null&&S.unshift(I),L=y[$],L!=null;)$=L.id(),I=v[$];return{found:!0,distance:d[w],path:this.spawn(S),steps:k}}p[w]=!0;for(var z=b._private.edges,F=0;FI&&(g[$]=I,x[$]=L,b[$]=C),!a){var z=L*h+S;!a&&g[z]>I&&(g[z]=I,x[z]=S,b[z]=C)}}}for(var F=0;F1&&arguments[1]!==void 0?arguments[1]:s,ze=b(ge),xe=[],Ke=ze;;){if(Ke==null)return r.spawn();var Ce=x(Ke),Ve=Ce.edge,Qe=Ce.pred;if(xe.unshift(Ke[0]),Ke.same(ve)&&xe.length>0)break;Ve!=null&&xe.unshift(Ve),Ke=Qe}return l.spawn(xe)},_=0;_=0;h--){var d=u[h],f=d[1],p=d[2];(r[f]===o&&r[p]===l||r[f]===l&&r[p]===o)&&u.splice(h,1)}for(var g=0;gi;){var a=Math.floor(Math.random()*r.length);r=lXe(a,e,r),n--}return r},cXe={kargerStein:function(){var e=this,r=this.byGroup(),n=r.nodes,i=r.edges;i.unmergeBy(function(D){return D.isLoop()});var a=n.length,s=i.length,o=Math.ceil(Math.pow(Math.log(a)/Math.LN2,2)),l=Math.floor(a/oXe);if(a<2){fi("At least 2 nodes are required for Karger-Stein algorithm");return}for(var u=[],h=0;h1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,i=1/0,a=r;a1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,i=-1/0,a=r;a1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,i=0,a=0,s=r;s1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0;i?e=e.slice(r,n):(n0&&e.splice(0,r));for(var o=0,l=e.length-1;l>=0;l--){var u=e[l];s?isFinite(u)||(e[l]=-1/0,o++):e.splice(l,1)}a&&e.sort(function(f,p){return f-p});var h=e.length,d=Math.floor(h/2);return h%2!==0?e[d+1+o]:(e[d-1+o]+e[d+o])/2},gXe=function(e){return Math.PI*e/180},v3=function(e,r){return Math.atan2(r,e)-Math.PI/2},V9=Math.log2||function(t){return Math.log(t)/Math.log(2)},W9=function(e){return e>0?1:e<0?-1:0},jf=function(e,r){return Math.sqrt(Kf(e,r))},Kf=function(e,r){var n=r.x-e.x,i=r.y-e.y;return n*n+i*i},mXe=function(e){for(var r=e.length,n=0,i=0;i=e.x1&&e.y2>=e.y1)return{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,w:e.x2-e.x1,h:e.y2-e.y1};if(e.w!=null&&e.h!=null&&e.w>=0&&e.h>=0)return{x1:e.x1,y1:e.y1,x2:e.x1+e.w,y2:e.y1+e.h,w:e.w,h:e.h}}},vXe=function(e){return{x1:e.x1,x2:e.x2,w:e.w,y1:e.y1,y2:e.y2,h:e.h}},bXe=function(e){e.x1=1/0,e.y1=1/0,e.x2=-1/0,e.y2=-1/0,e.w=0,e.h=0},xXe=function(e,r){e.x1=Math.min(e.x1,r.x1),e.x2=Math.max(e.x2,r.x2),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,r.y1),e.y2=Math.max(e.y2,r.y2),e.h=e.y2-e.y1},Xie=function(e,r,n){e.x1=Math.min(e.x1,r),e.x2=Math.max(e.x2,r),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,n),e.y2=Math.max(e.y2,n),e.h=e.y2-e.y1},b3=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return e.x1-=r,e.x2+=r,e.y1-=r,e.y2+=r,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},x3=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0],n,i,a,s;if(r.length===1)n=i=a=s=r[0];else if(r.length===2)n=a=r[0],s=i=r[1];else if(r.length===4){var o=Qi(r,4);n=o[0],i=o[1],a=o[2],s=o[3]}return e.x1-=s,e.x2+=i,e.y1-=n,e.y2+=a,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},jie=function(e,r){e.x1=r.x1,e.y1=r.y1,e.x2=r.x2,e.y2=r.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1},U9=function(e,r){return!(e.x1>r.x2||r.x1>e.x2||e.x2r.y2||r.y1>e.y2)},ed=function(e,r,n){return e.x1<=r&&r<=e.x2&&e.y1<=n&&n<=e.y2},Kie=function(e,r){return ed(e,r.x,r.y)},Zie=function(e,r){return ed(e,r.x1,r.y1)&&ed(e,r.x2,r.y2)},TXe=(q9=Math.hypot)!==null&&q9!==void 0?q9:function(t,e){return Math.sqrt(t*t+e*e)};function wXe(t,e){if(t.length<3)throw new Error("Need at least 3 vertices");var r=function(S,L){return{x:S.x+L.x,y:S.y+L.y}},n=function(S,L){return{x:S.x-L.x,y:S.y-L.y}},i=function(S,L){return{x:S.x*L,y:S.y*L}},a=function(S,L){return S.x*L.y-S.y*L.x},s=function(S){var L=TXe(S.x,S.y);return L===0?{x:0,y:0}:{x:S.x/L,y:S.y/L}},o=function(S){for(var L=0,$=0;$7&&arguments[7]!==void 0?arguments[7]:"auto",u=l==="auto"?rd(a,s):l,h=a/2,d=s/2;u=Math.min(u,h,d);var f=u!==h,p=u!==d,g;if(f){var m=n-h+u-o,y=i-d-o,v=n+h-u+o,x=y;if(g=td(e,r,n,i,m,y,v,x,!1),g.length>0)return g}if(p){var b=n+h+o,w=i-d+u-o,C=b,_=i+d-u+o;if(g=td(e,r,n,i,b,w,C,_,!1),g.length>0)return g}if(f){var k=n-h+u-o,S=i+d+o,L=n+h-u+o,$=S;if(g=td(e,r,n,i,k,S,L,$,!1),g.length>0)return g}if(p){var I=n-h-o,z=i-d+u-o,F=I,A=i+d-u+o;if(g=td(e,r,n,i,I,z,F,A,!1),g.length>0)return g}var R;{var N=n-h+u,M=i-d+u;if(R=jT(e,r,n,i,N,M,u+o),R.length>0&&R[0]<=N&&R[1]<=M)return[R[0],R[1]]}{var D=n+h-u,O=i-d+u;if(R=jT(e,r,n,i,D,O,u+o),R.length>0&&R[0]>=D&&R[1]<=O)return[R[0],R[1]]}{var B=n+h-u,P=i+d-u;if(R=jT(e,r,n,i,B,P,u+o),R.length>0&&R[0]>=B&&R[1]>=P)return[R[0],R[1]]}{var G=n-h+u,V=i+d-u;if(R=jT(e,r,n,i,G,V,u+o),R.length>0&&R[0]<=G&&R[1]>=V)return[R[0],R[1]]}return[]},kXe=function(e,r,n,i,a,s,o){var l=o,u=Math.min(n,a),h=Math.max(n,a),d=Math.min(i,s),f=Math.max(i,s);return u-l<=e&&e<=h+l&&d-l<=r&&r<=f+l},EXe=function(e,r,n,i,a,s,o,l,u){var h={x1:Math.min(n,o,a)-u,x2:Math.max(n,o,a)+u,y1:Math.min(i,l,s)-u,y2:Math.max(i,l,s)+u};return!(eh.x2||rh.y2)},SXe=function(e,r,n,i){n-=i;var a=r*r-4*e*n;if(a<0)return[];var s=Math.sqrt(a),o=2*e,l=(-r+s)/o,u=(-r-s)/o;return[l,u]},_Xe=function(e,r,n,i,a){var s=1e-5;e===0&&(e=s),r/=e,n/=e,i/=e;var o,l,u,h,d,f,p,g;if(l=(3*n-r*r)/9,u=-(27*i)+r*(9*n-2*(r*r)),u/=54,o=l*l*l+u*u,a[1]=0,p=r/3,o>0){d=u+Math.sqrt(o),d=d<0?-Math.pow(-d,1/3):Math.pow(d,1/3),f=u-Math.sqrt(o),f=f<0?-Math.pow(-f,1/3):Math.pow(f,1/3),a[0]=-p+d+f,p+=(d+f)/2,a[4]=a[2]=-p,p=Math.sqrt(3)*(-f+d)/2,a[3]=p,a[5]=-p;return}if(a[5]=a[3]=0,o===0){g=u<0?-Math.pow(-u,1/3):Math.pow(u,1/3),a[0]=-p+2*g,a[4]=a[2]=-(g+p);return}l=-l,h=l*l*l,h=Math.acos(u/Math.sqrt(h)),g=2*Math.sqrt(l),a[0]=-p+g*Math.cos(h/3),a[2]=-p+g*Math.cos((h+2*Math.PI)/3),a[4]=-p+g*Math.cos((h+4*Math.PI)/3)},AXe=function(e,r,n,i,a,s,o,l){var u=1*n*n-4*n*a+2*n*o+4*a*a-4*a*o+o*o+i*i-4*i*s+2*i*l+4*s*s-4*s*l+l*l,h=9*n*a-3*n*n-3*n*o-6*a*a+3*a*o+9*i*s-3*i*i-3*i*l-6*s*s+3*s*l,d=3*n*n-6*n*a+n*o-n*e+2*a*a+2*a*e-o*e+3*i*i-6*i*s+i*l-i*r+2*s*s+2*s*r-l*r,f=1*n*a-n*n+n*e-a*e+i*s-i*i+i*r-s*r,p=[];_Xe(u,h,d,f,p);for(var g=1e-7,m=[],y=0;y<6;y+=2)Math.abs(p[y+1])=0&&p[y]<=1&&m.push(p[y]);m.push(1),m.push(0);for(var v=-1,x,b,w,C=0;C=0?wu?(e-a)*(e-a)+(r-s)*(r-s):h-f},to=function(e,r,n){for(var i,a,s,o,l,u=0,h=0;h=e&&e>=s||i<=e&&e<=s)l=(e-i)/(s-i)*(o-a)+a,l>r&&u++;else continue;return u%2!==0},Pu=function(e,r,n,i,a,s,o,l,u){var h=new Array(n.length),d;l[0]!=null?(d=Math.atan(l[1]/l[0]),l[0]<0?d=d+Math.PI/2:d=-d-Math.PI/2):d=l;for(var f=Math.cos(-d),p=Math.sin(-d),g=0;g0){var y=w3(h,-u);m=T3(y)}else m=h;return to(e,r,m)},LXe=function(e,r,n,i,a,s,o,l){for(var u=new Array(n.length*2),h=0;h=0&&y<=1&&x.push(y),v>=0&&v<=1&&x.push(v),x.length===0)return[];var b=x[0]*l[0]+e,w=x[0]*l[1]+r;if(x.length>1){if(x[0]==x[1])return[b,w];var C=x[1]*l[0]+e,_=x[1]*l[1]+r;return[b,w,C,_]}else return[b,w]},H9=function(e,r,n){return r<=e&&e<=n||n<=e&&e<=r?e:e<=r&&r<=n||n<=r&&r<=e?r:n},td=function(e,r,n,i,a,s,o,l,u){var h=e-a,d=n-e,f=o-a,p=r-s,g=i-r,m=l-s,y=f*p-m*h,v=d*p-g*h,x=m*d-f*g;if(x!==0){var b=y/x,w=v/x,C=.001,_=0-C,k=1+C;return _<=b&&b<=k&&_<=w&&w<=k?[e+b*d,r+b*g]:u?[e+b*d,r+b*g]:[]}else return y===0||v===0?H9(e,n,o)===o?[o,l]:H9(e,n,a)===a?[a,s]:H9(a,o,n)===n?[n,i]:[]:[]},DXe=function(e,r,n,i,a){var s=[],o=i/2,l=a/2,u=r,h=n;s.push({x:u+o*e[0],y:h+l*e[1]});for(var d=1;d0){var m=w3(d,-l);p=T3(m)}else p=d}else p=n;for(var y,v,x,b,w=0;w2){for(var g=[h[0],h[1]],m=Math.pow(g[0]-e,2)+Math.pow(g[1]-r,2),y=1;yh&&(h=w)},get:function(b){return u[b]}},f=0;f0?R=A.edgesTo(F)[0]:R=F.edgesTo(A)[0];var N=i(R);F=F.id(),k[F]>k[I]+N&&(k[F]=k[I]+N,S.nodes.indexOf(F)<0?S.push(F):S.updateItem(F),_[F]=0,C[F]=[]),k[F]==k[I]+N&&(_[F]=_[F]+_[I],C[F].push(I))}else for(var M=0;M0;){for(var P=w.pop(),G=0;G0&&o.push(n[l]);o.length!==0&&a.push(i.collection(o))}return a},YXe=function(e,r){for(var n=0;n5&&arguments[5]!==void 0?arguments[5]:KXe,o=i,l,u,h=0;h=2?ZT(e,r,n,0,oae,ZXe):ZT(e,r,n,0,sae)},squaredEuclidean:function(e,r,n){return ZT(e,r,n,0,oae)},manhattan:function(e,r,n){return ZT(e,r,n,0,sae)},max:function(e,r,n){return ZT(e,r,n,-1/0,QXe)}};om["squared-euclidean"]=om.squaredEuclidean,om.squaredeuclidean=om.squaredEuclidean;function k3(t,e,r,n,i,a){var s;return yi(t)?s=t:s=om[t]||om.euclidean,e===0&&yi(t)?s(i,a):s(e,r,n,i,a)}var JXe=Oa({k:2,m:2,sensitivityThreshold:1e-4,distance:"euclidean",maxIterations:10,attributes:[],testMode:!1,testCentroids:null}),Q9=function(e){return JXe(e)},E3=function(e,r,n,i,a){var s=a!=="kMedoids",o=s?function(d){return n[d]}:function(d){return i[d](n)},l=function(f){return i[f](r)},u=n,h=r;return k3(e,i.length,o,l,u,h)},J9=function(e,r,n){for(var i=n.length,a=new Array(i),s=new Array(i),o=new Array(r),l=null,u=0;un)return!1}return!0},rje=function(e,r,n){for(var i=0;io&&(o=r[u][h],l=h);a[l].push(e[u])}for(var d=0;d=a.threshold||a.mode==="dendrogram"&&e.length===1)return!1;var g=r[s],m=r[i[s]],y;a.mode==="dendrogram"?y={left:g,right:m,key:g.key}:y={value:g.value.concat(m.value),key:g.key},e[g.index]=y,e.splice(m.index,1),r[g.key]=y;for(var v=0;vn[m.key][x.key]&&(l=n[m.key][x.key])):a.linkage==="max"?(l=n[g.key][x.key],n[g.key][x.key]0&&i.push(a);return i},gae=function(e,r,n){for(var i=[],a=0;ao&&(s=u,o=r[a*e+u])}s>0&&i.push(s)}for(var h=0;hu&&(l=h,u=d)}n[a]=s[l]}return i=gae(e,r,n),i},mae=function(e){for(var r=this.cy(),n=this.nodes(),i=pje(e),a={},s=0;s=I?(z=I,I=A,F=R):A>z&&(z=A);for(var N=0;N0?1:0;k[L%i.minIterations*o+G]=V,P+=V}if(P>0&&(L>=i.minIterations-1||L==i.maxIterations-1)){for(var H=0,W=0;W1||_>1)&&(o=!0),d[b]=[],x.outgoers().forEach(function(S){S.isEdge()&&d[b].push(S.id())})}else f[b]=[void 0,x.target().id()]}):s.forEach(function(x){var b=x.id();if(x.isNode()){var w=x.degree(!0);w%2&&(l?u?o=!0:u=b:l=b),d[b]=[],x.connectedEdges().forEach(function(C){return d[b].push(C.id())})}else f[b]=[x.source().id(),x.target().id()]});var p={found:!1,trail:void 0};if(o)return p;if(u&&l)if(a){if(h&&u!=h)return p;h=u}else{if(h&&u!=h&&l!=h)return p;h||(h=u)}else h||(h=s[0].id());var g=function(b){for(var w=b,C=[b],_,k,S;d[w].length;)_=d[w].shift(),k=f[_][0],S=f[_][1],w!=S?(d[S]=d[S].filter(function(L){return L!=_}),w=S):!a&&w!=k&&(d[k]=d[k].filter(function(L){return L!=_}),w=k),C.unshift(_),C.unshift(w);return C},m=[],y=[];for(y=g(h);y.length!=1;)d[y[0]].length==0?(m.unshift(s.getElementById(y.shift())),m.unshift(s.getElementById(y.shift()))):y=g(y.shift()).concat(y);m.unshift(s.getElementById(y.shift()));for(var v in d)if(d[v].length)return p;return p.found=!0,p.trail=this.spawn(m,!0),p}},S3=function(){var e=this,r={},n=0,i=0,a=[],s=[],o={},l=function(f,p){for(var g=s.length-1,m=[],y=e.spawn();s[g].x!=f||s[g].y!=p;)m.push(s.pop().edge),g--;m.push(s.pop().edge),m.forEach(function(v){var x=v.connectedNodes().intersection(e);y.merge(v),x.forEach(function(b){var w=b.id(),C=b.connectedEdges().intersection(e);y.merge(b),r[w].cutVertex?y.merge(C.filter(function(_){return _.isLoop()})):y.merge(C)})}),a.push(y)},u=function(f,p,g){f===g&&(i+=1),r[p]={id:n,low:n++,cutVertex:!1};var m=e.getElementById(p).connectedEdges().intersection(e);if(m.size()===0)a.push(e.spawn(e.getElementById(p)));else{var y,v,x,b;m.forEach(function(w){y=w.source().id(),v=w.target().id(),x=y===p?v:y,x!==g&&(b=w.id(),o[b]||(o[b]=!0,s.push({x:p,y:x,edge:w})),x in r?r[p].low=Math.min(r[p].low,r[x].id):(u(f,x,p),r[p].low=Math.min(r[p].low,r[x].low),r[p].id<=r[x].low&&(r[p].cutVertex=!0,l(p,x))))})}};e.forEach(function(d){if(d.isNode()){var f=d.id();f in r||(i=0,u(f,f),r[f].cutVertex=i>1)}});var h=Object.keys(r).filter(function(d){return r[d].cutVertex}).map(function(d){return e.getElementById(d)});return{cut:e.spawn(h),components:a}},wje={hopcroftTarjanBiconnected:S3,htbc:S3,htb:S3,hopcroftTarjanBiconnectedComponents:S3},_3=function(){var e=this,r={},n=0,i=[],a=[],s=e.spawn(e),o=function(u){a.push(u),r[u]={index:n,low:n++,explored:!1};var h=e.getElementById(u).connectedEdges().intersection(e);if(h.forEach(function(m){var y=m.target().id();y!==u&&(y in r||o(y),r[y].explored||(r[u].low=Math.min(r[u].low,r[y].low)))}),r[u].index===r[u].low){for(var d=e.spawn();;){var f=a.pop();if(d.merge(e.getElementById(f)),r[f].low=r[u].index,r[f].explored=!0,f===u)break}var p=d.edgesWith(d),g=d.merge(p);i.push(g),s=s.difference(g)}};return e.forEach(function(l){if(l.isNode()){var u=l.id();u in r||o(u)}}),{cut:s,components:i}},Cje={tarjanStronglyConnected:_3,tsc:_3,tscc:_3,tarjanStronglyConnectedComponents:_3},yae={};[HT,JYe,eXe,rXe,iXe,sXe,cXe,OXe,am,sm,Z9,jXe,lje,dje,bje,Tje,wje,Cje].forEach(function(t){Cr(yae,t)});/*! Embeddable Minimum Strictly-Compliant Promises/A+ 1.1.1 Thenable Copyright (c) 2013-2014 Ralf S. Engelschall (http://engelschall.com) Licensed under The MIT License (http://opensource.org/licenses/MIT) -*/var tQ=0,rQ=1,nQ=2,Po=function(e){if(!(this instanceof Po))return new Po(e);this.id="Thenable/1.0.7",this.state=tQ,this.fulfillValue=void 0,this.rejectReason=void 0,this.onFulfilled=[],this.onRejected=[],this.proxy={then:this.then.bind(this)},typeof e=="function"&&e.call(this,this.fulfill.bind(this),this.reject.bind(this))};Po.prototype={fulfill:function(e){return iQ(this,rQ,"fulfillValue",e)},reject:function(e){return iQ(this,nQ,"rejectReason",e)},then:function(e,r){var n=this,i=new Po;return n.onFulfilled.push(oQ(e,i,"fulfill")),n.onRejected.push(oQ(r,i,"reject")),aQ(n),i.proxy}};var iQ=function(e,r,n,i){return e.state===tQ&&(e.state=r,e[n]=i,aQ(e)),e},aQ=function(e){e.state===rQ?sQ(e,"onFulfilled",e.fulfillValue):e.state===nQ&&sQ(e,"onRejected",e.rejectReason)},sQ=function(e,r,n){if(e[r].length!==0){var i=e[r];e[r]=[];var a=function(){for(var o=0;o0}},clearQueue:function(){return function(){var r=this,n=r.length!==void 0,i=n?r:[r],a=this._private.cy||this;if(!a.styleEnabled())return this;for(var s=0;s-1}return jR=e,jR}var ZR,DQ;function rze(){if(DQ)return ZR;DQ=1;var t=I5();function e(r,n){var i=this.__data__,a=t(i,r);return a<0?(++this.size,i.push([r,n])):i[a][1]=n,this}return ZR=e,ZR}var QR,MQ;function nze(){if(MQ)return QR;MQ=1;var t=QFe(),e=JFe(),r=eze(),n=tze(),i=rze();function a(s){var o=-1,l=s==null?0:s.length;for(this.clear();++o-1&&n%1==0&&n0&&this.spawn(i).updateStyle().emit("class"),r},addClass:function(e){return this.toggleClass(e,!0)},hasClass:function(e){var r=this[0];return r!=null&&r._private.classes.has(e)},toggleClass:function(e,r){wn(e)||(e=e.match(/\S+/g)||[]);for(var n=this,i=r===void 0,a=[],s=0,o=n.length;s0&&this.spawn(a).updateStyle().emit("class"),n},removeClass:function(e){return this.toggleClass(e,!1)},flashClass:function(e,r){var n=this;if(r==null)r=250;else if(r===0)return n;return n.addClass(e),setTimeout(function(){n.removeClass(e)},r),n}};M5.className=M5.classNames=M5.classes;var jr={metaChar:"[\\!\\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\]\\^\\`\\{\\|\\}\\~]",comparatorOp:"=|\\!=|>|>=|<|<=|\\$=|\\^=|\\*=",boolOp:"\\?|\\!|\\^",string:`"(?:\\\\"|[^"])*"|'(?:\\\\'|[^'])*'`,number:Gi,meta:"degree|indegree|outdegree",separator:"\\s*,\\s*",descendant:"\\s+",child:"\\s+>\\s+",subject:"\\$",group:"node|edge|\\*",directedEdge:"\\s+->\\s+",undirectedEdge:"\\s+<->\\s+"};jr.variable="(?:[\\w-.]|(?:\\\\"+jr.metaChar+"))+",jr.className="(?:[\\w-]|(?:\\\\"+jr.metaChar+"))+",jr.value=jr.string+"|"+jr.number,jr.id=jr.variable,(function(){var t,e,r;for(t=jr.comparatorOp.split("|"),r=0;r=0)&&e!=="="&&(jr.comparatorOp+="|\\!"+e)})();var vn=function(){return{checks:[]}},jt={GROUP:0,COLLECTION:1,FILTER:2,DATA_COMPARE:3,DATA_EXIST:4,DATA_BOOL:5,META_COMPARE:6,STATE:7,ID:8,CLASS:9,UNDIRECTED_EDGE:10,DIRECTED_EDGE:11,NODE_SOURCE:12,NODE_TARGET:13,NODE_NEIGHBOR:14,CHILD:15,DESCENDANT:16,PARENT:17,ANCESTOR:18,COMPOUND_SPLIT:19,TRUE:20},AL=[{selector:":selected",matches:function(e){return e.selected()}},{selector:":unselected",matches:function(e){return!e.selected()}},{selector:":selectable",matches:function(e){return e.selectable()}},{selector:":unselectable",matches:function(e){return!e.selectable()}},{selector:":locked",matches:function(e){return e.locked()}},{selector:":unlocked",matches:function(e){return!e.locked()}},{selector:":visible",matches:function(e){return e.visible()}},{selector:":hidden",matches:function(e){return!e.visible()}},{selector:":transparent",matches:function(e){return e.transparent()}},{selector:":grabbed",matches:function(e){return e.grabbed()}},{selector:":free",matches:function(e){return!e.grabbed()}},{selector:":removed",matches:function(e){return e.removed()}},{selector:":inside",matches:function(e){return!e.removed()}},{selector:":grabbable",matches:function(e){return e.grabbable()}},{selector:":ungrabbable",matches:function(e){return!e.grabbable()}},{selector:":animated",matches:function(e){return e.animated()}},{selector:":unanimated",matches:function(e){return!e.animated()}},{selector:":parent",matches:function(e){return e.isParent()}},{selector:":childless",matches:function(e){return e.isChildless()}},{selector:":child",matches:function(e){return e.isChild()}},{selector:":orphan",matches:function(e){return e.isOrphan()}},{selector:":nonorphan",matches:function(e){return e.isChild()}},{selector:":compound",matches:function(e){return e.isNode()?e.isParent():e.source().isParent()||e.target().isParent()}},{selector:":loop",matches:function(e){return e.isLoop()}},{selector:":simple",matches:function(e){return e.isSimple()}},{selector:":active",matches:function(e){return e.active()}},{selector:":inactive",matches:function(e){return!e.active()}},{selector:":backgrounding",matches:function(e){return e.backgrounding()}},{selector:":nonbackgrounding",matches:function(e){return!e.backgrounding()}}].sort(function(t,e){return IPe(t.selector,e.selector)}),Nze=(function(){for(var t={},e,r=0;r0&&h.edgeCount>0)return cn("The selector `"+e+"` is invalid because it uses both a compound selector and an edge selector"),!1;if(h.edgeCount>1)return cn("The selector `"+e+"` is invalid because it uses multiple edge selectors"),!1;h.edgeCount===1&&cn("The selector `"+e+"` is deprecated. Edge selectors do not take effect on changes to source and target nodes after an edge is added, for performance reasons. Use a class or data selector on edges instead, updating the class or data of an edge when your app detects a change in source or target nodes.")}return!0},zze=function(){if(this.toStringCache!=null)return this.toStringCache;for(var e=function(h){return h??""},r=function(h){return hr(h)?'"'+h+'"':e(h)},n=function(h){return" "+h+" "},i=function(h,d){var f=h.type,p=h.value;switch(f){case jt.GROUP:{var g=e(p);return g.substring(0,g.length-1)}case jt.DATA_COMPARE:{var m=h.field,y=h.operator;return"["+m+n(e(y))+r(p)+"]"}case jt.DATA_BOOL:{var v=h.operator,T=h.field;return"["+e(v)+T+"]"}case jt.DATA_EXIST:{var b=h.field;return"["+b+"]"}case jt.META_COMPARE:{var w=h.operator,k=h.field;return"[["+k+n(e(w))+r(p)+"]]"}case jt.STATE:return p;case jt.ID:return"#"+p;case jt.CLASS:return"."+p;case jt.PARENT:case jt.CHILD:return a(h.parent,d)+n(">")+a(h.child,d);case jt.ANCESTOR:case jt.DESCENDANT:return a(h.ancestor,d)+" "+a(h.descendant,d);case jt.COMPOUND_SPLIT:{var A=a(h.left,d),C=a(h.subject,d),_=a(h.right,d);return A+(A.length>0?" ":"")+C+_}case jt.TRUE:return""}},a=function(h,d){return h.checks.reduce(function(f,p,g){return f+(d===h&&g===0?"$":"")+i(p,d)},"")},s="",o=0;o1&&o=0&&(r=r.replace("!",""),d=!0),r.indexOf("@")>=0&&(r=r.replace("@",""),h=!0),(a||o||h)&&(l=!a&&!s?"":""+e,u=""+n),h&&(e=l=l.toLowerCase(),n=u=u.toLowerCase()),r){case"*=":i=l.indexOf(u)>=0;break;case"$=":i=l.indexOf(u,l.length-u.length)>=0;break;case"^=":i=l.indexOf(u)===0;break;case"=":i=e===n;break;case">":f=!0,i=e>n;break;case">=":f=!0,i=e>=n;break;case"<":f=!0,i=e0;){var h=i.shift();e(h),a.add(h.id()),o&&n(i,a,h)}return t}function dJ(t,e,r){if(r.isParent())for(var n=r._private.children,i=0;i1&&arguments[1]!==void 0?arguments[1]:!0;return LL(this,t,e,dJ)};function fJ(t,e,r){if(r.isChild()){var n=r._private.parent;e.has(n.id())||t.push(n)}}Dp.forEachUp=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return LL(this,t,e,fJ)};function Xze(t,e,r){fJ(t,e,r),dJ(t,e,r)}Dp.forEachUpAndDown=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return LL(this,t,e,Xze)},Dp.ancestors=Dp.parents;var Ub,pJ;Ub=pJ={data:un.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:un.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),scratch:un.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:un.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),rscratch:un.data({field:"rscratch",allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!0}),removeRscratch:un.removeData({field:"rscratch",triggerEvent:!1}),id:function(){var e=this[0];if(e)return e._private.data.id}},Ub.attr=Ub.data,Ub.removeAttr=Ub.removeData;var Kze=pJ,N5={};function IL(t){return function(e){var r=this;if(e===void 0&&(e=!0),r.length!==0)if(r.isNode()&&!r.removed()){for(var n=0,i=r[0],a=i._private.edges,s=0;se}),minIndegree:Mp("indegree",function(t,e){return te}),minOutdegree:Mp("outdegree",function(t,e){return te})}),yr(N5,{totalDegree:function(e){for(var r=0,n=this.nodes(),i=0;i0,f=d;d&&(h=h[0]);var p=f?h.position():{x:0,y:0};r!==void 0?u.position(e,r+p[e]):a!==void 0&&u.position({x:a.x+p.x,y:a.y+p.y})}else{var g=n.position(),m=o?n.parent():null,y=m&&m.length>0,v=y;y&&(m=m[0]);var T=v?m.position():{x:0,y:0};return a={x:g.x-T.x,y:g.y-T.y},e===void 0?a:a[e]}else if(!s)return;return this}},Bo.modelPosition=Bo.point=Bo.position,Bo.modelPositions=Bo.points=Bo.positions,Bo.renderedPoint=Bo.renderedPosition,Bo.relativePoint=Bo.relativePosition;var jze=gJ,Np=function(e){switch(e){case"left":case"right-inside":return"left";case"right":case"left-inside":return"right";default:return"center"}},Op=function(e){switch(e){case"top":case"bottom-inside":return"top";case"bottom":case"top-inside":return"bottom";default:return"center"}},Zze=function(e){switch(e){case"left":return"right";case"right":return"left";case"left-inside":return"left";case"right-inside":return"right";default:return"center"}},$p,ah;$p=ah={},ah.renderedBoundingBox=function(t){var e=this.boundingBox(t),r=this.cy(),n=r.zoom(),i=r.pan(),a=e.x1*n+i.x,s=e.x2*n+i.x,o=e.y1*n+i.y,l=e.y2*n+i.y;return{x1:a,x2:s,y1:o,y2:l,w:s-a,h:l-o}},ah.dirtyCompoundBoundsCache=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,e=this.cy();return!e.styleEnabled()||!e.hasCompoundNodes()?this:(this.forEachUp(function(r){if(r.isParent()){var n=r._private;n.compoundBoundsClean=!1,n.bbCache=null,t||r.emitAndNotify("bounds")}}),this)},ah.updateCompoundBounds=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,e=this.cy();if(!e.styleEnabled()||!e.hasCompoundNodes())return this;if(!t&&e.batching())return this;function r(s){if(!s.isParent())return;var o=s._private,l=s.children(),u=s.pstyle("compound-sizing-wrt-labels").value==="include",h={width:{val:s.pstyle("min-width").pfValue,left:s.pstyle("min-width-bias-left"),right:s.pstyle("min-width-bias-right")},height:{val:s.pstyle("min-height").pfValue,top:s.pstyle("min-height-bias-top"),bottom:s.pstyle("min-height-bias-bottom")}},d=l.boundingBox({includeLabels:u,includeOverlays:!1,useCache:!1}),f=o.position;(d.w===0||d.h===0)&&(d={w:s.pstyle("width").pfValue,h:s.pstyle("height").pfValue},d.x1=f.x-d.w/2,d.x2=f.x+d.w/2,d.y1=f.y-d.h/2,d.y2=f.y+d.h/2);function p(L,O,M){var z=0,F=0,S=O+M;return L>0&&S>0&&(z=O/S*L,F=M/S*L),{biasDiff:z,biasComplementDiff:F}}function g(L,O,M,z){if(M.units==="%")switch(z){case"width":return L>0?M.pfValue*L:0;case"height":return O>0?M.pfValue*O:0;case"average":return L>0&&O>0?M.pfValue*(L+O)/2:0;case"min":return L>0&&O>0?L>O?M.pfValue*O:M.pfValue*L:0;case"max":return L>0&&O>0?L>O?M.pfValue*L:M.pfValue*O:0;default:return 0}else return M.units==="px"?M.pfValue:0}var m=h.width.left.value;h.width.left.units==="px"&&h.width.val>0&&(m=m*100/h.width.val);var y=h.width.right.value;h.width.right.units==="px"&&h.width.val>0&&(y=y*100/h.width.val);var v=h.height.top.value;h.height.top.units==="px"&&h.height.val>0&&(v=v*100/h.height.val);var T=h.height.bottom.value;h.height.bottom.units==="px"&&h.height.val>0&&(T=T*100/h.height.val);var b=p(h.width.val-d.w,m,y),w=b.biasDiff,k=b.biasComplementDiff,A=p(h.height.val-d.h,v,T),C=A.biasDiff,_=A.biasComplementDiff;o.autoPadding=g(d.w,d.h,s.pstyle("padding"),s.pstyle("padding-relative-to").value),o.autoWidth=Math.max(d.w,h.width.val),f.x=(-w+d.x1+d.x2+k)/2,o.autoHeight=Math.max(d.h,h.height.val),f.y=(-C+d.y1+d.y2+_)/2}for(var n=0;ne.x2?i:e.x2,e.y1=ne.y2?a:e.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1)},sh=function(e,r){return r==null?e:Fo(e,r.x1,r.y1,r.x2,r.y2)},Hb=function(e,r,n){return Ka(e,r,n)},O5=function(e,r,n){if(!r.cy().headless()){var i=r._private,a=i.rstyle,s=a.arrowWidth/2,o=r.pstyle(n+"-arrow-shape").value,l,u;if(o!=="none"){n==="source"?(l=a.srcX,u=a.srcY):n==="target"?(l=a.tgtX,u=a.tgtY):(l=a.midX,u=a.midY);var h=i.arrowBounds=i.arrowBounds||{},d=h[n]=h[n]||{};d.x1=l-s,d.y1=u-s,d.x2=l+s,d.y2=u+s,d.w=d.x2-d.x1,d.h=d.y2-d.y1,x5(d,1),Fo(e,d.x1,d.y1,d.x2,d.y2)}}},DL=function(e,r,n){if(!r.cy().headless()){var i;n?i=n+"-":i="";var a=r._private,s=a.rstyle,o=r.pstyle(i+"label").strValue;if(o){var l=r.pstyle("text-halign"),u=r.pstyle("text-valign"),h=Hb(s,"labelWidth",n),d=Hb(s,"labelHeight",n),f=Hb(s,"labelX",n),p=Hb(s,"labelY",n),g=r.pstyle(i+"text-margin-x").pfValue,m=r.pstyle(i+"text-margin-y").pfValue,y=r.isEdge(),v=r.pstyle(i+"text-rotation"),T=r.pstyle("text-outline-width").pfValue,b=r.pstyle("text-border-width").pfValue,w=b/2,k=r.pstyle("text-background-padding").pfValue,A=2,C=d,_=h,L=_/2,O=C/2,M,z,F,S;if(y)M=f-L,z=f+L,F=p-O,S=p+O;else{switch(Np(l.value)){case"left":M=f-_,z=f;break;case"center":M=f-L,z=f+L;break;case"right":M=f,z=f+_;break}switch(Op(u.value)){case"top":F=p-C,S=p;break;case"center":F=p-O,S=p+O;break;case"bottom":F=p,S=p+C;break}}var R=g-Math.max(T,w)-k-A,N=g+Math.max(T,w)+k+A,D=m-Math.max(T,w)-k-A,I=m+Math.max(T,w)+k+A;M+=R,z+=N,F+=D,S+=I;var $=n||"main",B=a.labelBounds,P=B[$]=B[$]||{};P.x1=M,P.y1=F,P.x2=z,P.y2=S,P.w=z-M,P.h=S-F,P.leftPad=R,P.rightPad=N,P.topPad=D,P.botPad=I;var G=y&&v.strValue==="autorotate",V=v.pfValue!=null&&v.pfValue!==0;if(G||V){var Y=G?Hb(a.rstyle,"labelAngle",n):v.pfValue,W=Math.cos(Y),ie=Math.sin(Y),K=(M+z)/2,se=(F+S)/2;if(!y){switch(Np(l.value)){case"left":K=z;break;case"right":K=M;break}switch(Op(u.value)){case"top":se=S;break;case"bottom":se=F;break}}var J=function(Ne,me){return Ne=Ne-K,me=me-se,{x:Ne*W-me*ie+K,y:Ne*ie+me*W+se}},Z=J(M,F),ee=J(M,S),ne=J(z,F),ue=J(z,S);M=Math.min(Z.x,ee.x,ne.x,ue.x),z=Math.max(Z.x,ee.x,ne.x,ue.x),F=Math.min(Z.y,ee.y,ne.y,ue.y),S=Math.max(Z.y,ee.y,ne.y,ue.y)}var fe=$+"Rot",_e=B[fe]=B[fe]||{};_e.x1=M,_e.y1=F,_e.x2=z,_e.y2=S,_e.w=z-M,_e.h=S-F,Fo(e,M,F,z,S),Fo(a.labelBounds.all,M,F,z,S)}return e}},vJ=function(e,r){if(!r.cy().headless()){var n=r.pstyle("outline-opacity").value,i=r.pstyle("outline-width").value,a=r.pstyle("outline-offset").value,s=i+a;bJ(e,r,n,s,"outside",s/2)}},bJ=function(e,r,n,i,a,s){if(!(n===0||i<=0||a==="inside")){var o=r.cy(),l=o.renderer(),u=l.nodeShapes[l.getNodeShape(r)];if(u){var h=r.position(),d=h.x,f=h.y,p=r.width(),g=r.height();if(u.hasMiterBounds){a==="center"&&(i/=2);var m=u.miterBounds(d,f,p,g,i);sh(e,m)}else s!=null&&s>0&&T5(e,[s,s,s,s])}}},Qze=function(e,r){if(!r.cy().headless()){var n=r.pstyle("border-opacity").value,i=r.pstyle("border-width").pfValue,a=r.pstyle("border-position").value;bJ(e,r,n,i,a)}},Jze=function(e,r){var n=e._private.cy,i=n.styleEnabled(),a=n.headless(),s=ja(),o=e._private,l=e.isNode(),u=e.isEdge(),h,d,f,p,g,m,y=o.rstyle,v=l&&i?e.pstyle("bounds-expansion").pfValue:[0],T=function(Ae){return Ae.pstyle("display").value!=="none"},b=!i||T(e)&&(!u||T(e.source())&&T(e.target()));if(b){var w=0,k=0;i&&r.includeOverlays&&(w=e.pstyle("overlay-opacity").value,w!==0&&(k=e.pstyle("overlay-padding").value));var A=0,C=0;i&&r.includeUnderlays&&(A=e.pstyle("underlay-opacity").value,A!==0&&(C=e.pstyle("underlay-padding").value));var _=Math.max(k,C),L=0,O=0;if(i&&(L=e.pstyle("width").pfValue,O=L/2),l&&r.includeNodes){var M=e.position();g=M.x,m=M.y;var z=e.outerWidth(),F=z/2,S=e.outerHeight(),R=S/2;h=g-F,d=g+F,f=m-R,p=m+R,Fo(s,h,f,d,p),i&&vJ(s,e),i&&r.includeOutlines&&!a&&vJ(s,e),i&&Qze(s,e)}else if(u&&r.includeEdges)if(i&&!a){var N=e.pstyle("curve-style").strValue;if(h=Math.min(y.srcX,y.midX,y.tgtX),d=Math.max(y.srcX,y.midX,y.tgtX),f=Math.min(y.srcY,y.midY,y.tgtY),p=Math.max(y.srcY,y.midY,y.tgtY),h-=O,d+=O,f-=O,p+=O,Fo(s,h,f,d,p),N==="haystack"){var D=y.haystackPts;if(D&&D.length===2){if(h=D[0].x,f=D[0].y,d=D[1].x,p=D[1].y,h>d){var I=h;h=d,d=I}if(f>p){var $=f;f=p,p=$}Fo(s,h-O,f-O,d+O,p+O)}}else if(N==="bezier"||N==="unbundled-bezier"||Ku(N,"segments")||Ku(N,"taxi")){var B;switch(N){case"bezier":case"unbundled-bezier":B=y.bezierPts;break;case"segments":case"taxi":case"round-segments":case"round-taxi":B=y.linePts;break}if(B!=null)for(var P=0;Pd){var K=h;h=d,d=K}if(f>p){var se=f;f=p,p=se}h-=O,d+=O,f-=O,p+=O,Fo(s,h,f,d,p)}if(i&&r.includeEdges&&u&&(O5(s,e,"mid-source"),O5(s,e,"mid-target"),O5(s,e,"source"),O5(s,e,"target")),i){var J=e.pstyle("ghost").value==="yes";if(J){var Z=e.pstyle("ghost-offset-x").pfValue,ee=e.pstyle("ghost-offset-y").pfValue;Fo(s,s.x1+Z,s.y1+ee,s.x2+Z,s.y2+ee)}}var ne=o.bodyBounds=o.bodyBounds||{};DZ(ne,s),T5(ne,v),x5(ne,1),i&&(h=s.x1,d=s.x2,f=s.y1,p=s.y2,Fo(s,h-_,f-_,d+_,p+_));var ue=o.overlayBounds=o.overlayBounds||{};DZ(ue,s),T5(ue,v),x5(ue,1);var fe=o.labelBounds=o.labelBounds||{};fe.all!=null?MBe(fe.all):fe.all=ja(),i&&r.includeLabels&&(r.includeMainLabels&&DL(s,e,null),u&&(r.includeSourceLabels&&DL(s,e,"source"),r.includeTargetLabels&&DL(s,e,"target")))}return s.x1=fo(s.x1),s.y1=fo(s.y1),s.x2=fo(s.x2),s.y2=fo(s.y2),s.w=fo(s.x2-s.x1),s.h=fo(s.y2-s.y1),s.w>0&&s.h>0&&b&&(T5(s,v),x5(s,1)),s},xJ=function(e){var r=0,n=function(s){return(s?1:0)<0}},clearQueue:function(){return function(){var r=this,n=r.length!==void 0,i=n?r:[r],a=this._private.cy||this;if(!a.styleEnabled())return this;for(var s=0;s-1}return EM=e,EM}var SM,jae;function qje(){if(jae)return SM;jae=1;var t=L3();function e(r,n){var i=this.__data__,a=t(i,r);return a<0?(++this.size,i.push([r,n])):i[a][1]=n,this}return SM=e,SM}var _M,Kae;function Vje(){if(Kae)return _M;Kae=1;var t=Bje(),e=Fje(),r=zje(),n=Gje(),i=qje();function a(s){var o=-1,l=s==null?0:s.length;for(this.clear();++o-1&&n%1==0&&n0&&this.spawn(i).updateStyle().emit("class"),r},addClass:function(e){return this.toggleClass(e,!0)},hasClass:function(e){var r=this[0];return r!=null&&r._private.classes.has(e)},toggleClass:function(e,r){Pn(e)||(e=e.match(/\S+/g)||[]);for(var n=this,i=r===void 0,a=[],s=0,o=n.length;s0&&this.spawn(a).updateStyle().emit("class"),n},removeClass:function(e){return this.toggleClass(e,!1)},flashClass:function(e,r){var n=this;if(r==null)r=250;else if(r===0)return n;return n.addClass(e),setTimeout(function(){n.removeClass(e)},r),n}};D3.className=D3.classNames=D3.classes;var sn={metaChar:"[\\!\\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\]\\^\\`\\{\\|\\}\\~]",comparatorOp:"=|\\!=|>|>=|<|<=|\\$=|\\^=|\\*=",boolOp:"\\?|\\!|\\^",string:`"(?:\\\\"|[^"])*"|'(?:\\\\'|[^'])*'`,number:ua,meta:"degree|indegree|outdegree",separator:"\\s*,\\s*",descendant:"\\s+",child:"\\s+>\\s+",subject:"\\$",group:"node|edge|\\*",directedEdge:"\\s+->\\s+",undirectedEdge:"\\s+<->\\s+"};sn.variable="(?:[\\w-.]|(?:\\\\"+sn.metaChar+"))+",sn.className="(?:[\\w-]|(?:\\\\"+sn.metaChar+"))+",sn.value=sn.string+"|"+sn.number,sn.id=sn.variable,(function(){var t,e,r;for(t=sn.comparatorOp.split("|"),r=0;r=0)&&e!=="="&&(sn.comparatorOp+="|\\!"+e)})();var In=function(){return{checks:[]}},tr={GROUP:0,COLLECTION:1,FILTER:2,DATA_COMPARE:3,DATA_EXIST:4,DATA_BOOL:5,META_COMPARE:6,STATE:7,ID:8,CLASS:9,UNDIRECTED_EDGE:10,DIRECTED_EDGE:11,NODE_SOURCE:12,NODE_TARGET:13,NODE_NEIGHBOR:14,CHILD:15,DESCENDANT:16,PARENT:17,ANCESTOR:18,COMPOUND_SPLIT:19,TRUE:20},rN=[{selector:":selected",matches:function(e){return e.selected()}},{selector:":unselected",matches:function(e){return!e.selected()}},{selector:":selectable",matches:function(e){return e.selectable()}},{selector:":unselectable",matches:function(e){return!e.selectable()}},{selector:":locked",matches:function(e){return e.locked()}},{selector:":unlocked",matches:function(e){return!e.locked()}},{selector:":visible",matches:function(e){return e.visible()}},{selector:":hidden",matches:function(e){return!e.visible()}},{selector:":transparent",matches:function(e){return e.transparent()}},{selector:":grabbed",matches:function(e){return e.grabbed()}},{selector:":free",matches:function(e){return!e.grabbed()}},{selector:":removed",matches:function(e){return e.removed()}},{selector:":inside",matches:function(e){return!e.removed()}},{selector:":grabbable",matches:function(e){return e.grabbable()}},{selector:":ungrabbable",matches:function(e){return!e.grabbable()}},{selector:":animated",matches:function(e){return e.animated()}},{selector:":unanimated",matches:function(e){return!e.animated()}},{selector:":parent",matches:function(e){return e.isParent()}},{selector:":childless",matches:function(e){return e.isChildless()}},{selector:":child",matches:function(e){return e.isChild()}},{selector:":orphan",matches:function(e){return e.isOrphan()}},{selector:":nonorphan",matches:function(e){return e.isChild()}},{selector:":compound",matches:function(e){return e.isNode()?e.isParent():e.source().isParent()||e.target().isParent()}},{selector:":loop",matches:function(e){return e.isLoop()}},{selector:":simple",matches:function(e){return e.isSimple()}},{selector:":active",matches:function(e){return e.active()}},{selector:":inactive",matches:function(e){return!e.active()}},{selector:":backgrounding",matches:function(e){return e.backgrounding()}},{selector:":nonbackgrounding",matches:function(e){return!e.backgrounding()}}].sort(function(t,e){return yYe(t.selector,e.selector)}),xKe=(function(){for(var t={},e,r=0;r0&&h.edgeCount>0)return bn("The selector `"+e+"` is invalid because it uses both a compound selector and an edge selector"),!1;if(h.edgeCount>1)return bn("The selector `"+e+"` is invalid because it uses multiple edge selectors"),!1;h.edgeCount===1&&bn("The selector `"+e+"` is deprecated. Edge selectors do not take effect on changes to source and target nodes after an edge is added, for performance reasons. Use a class or data selector on edges instead, updating the class or data of an edge when your app detects a change in source or target nodes.")}return!0},SKe=function(){if(this.toStringCache!=null)return this.toStringCache;for(var e=function(h){return h??""},r=function(h){return yr(h)?'"'+h+'"':e(h)},n=function(h){return" "+h+" "},i=function(h,d){var f=h.type,p=h.value;switch(f){case tr.GROUP:{var g=e(p);return g.substring(0,g.length-1)}case tr.DATA_COMPARE:{var m=h.field,y=h.operator;return"["+m+n(e(y))+r(p)+"]"}case tr.DATA_BOOL:{var v=h.operator,x=h.field;return"["+e(v)+x+"]"}case tr.DATA_EXIST:{var b=h.field;return"["+b+"]"}case tr.META_COMPARE:{var w=h.operator,C=h.field;return"[["+C+n(e(w))+r(p)+"]]"}case tr.STATE:return p;case tr.ID:return"#"+p;case tr.CLASS:return"."+p;case tr.PARENT:case tr.CHILD:return a(h.parent,d)+n(">")+a(h.child,d);case tr.ANCESTOR:case tr.DESCENDANT:return a(h.ancestor,d)+" "+a(h.descendant,d);case tr.COMPOUND_SPLIT:{var _=a(h.left,d),k=a(h.subject,d),S=a(h.right,d);return _+(_.length>0?" ":"")+k+S}case tr.TRUE:return""}},a=function(h,d){return h.checks.reduce(function(f,p,g){return f+(d===h&&g===0?"$":"")+i(p,d)},"")},s="",o=0;o1&&o=0&&(r=r.replace("!",""),d=!0),r.indexOf("@")>=0&&(r=r.replace("@",""),h=!0),(a||o||h)&&(l=!a&&!s?"":""+e,u=""+n),h&&(e=l=l.toLowerCase(),n=u=u.toLowerCase()),r){case"*=":i=l.indexOf(u)>=0;break;case"$=":i=l.indexOf(u,l.length-u.length)>=0;break;case"^=":i=l.indexOf(u)===0;break;case"=":i=e===n;break;case">":f=!0,i=e>n;break;case">=":f=!0,i=e>=n;break;case"<":f=!0,i=e0;){var h=i.shift();e(h),a.add(h.id()),o&&n(i,a,h)}return t}function Rse(t,e,r){if(r.isParent())for(var n=r._private.children,i=0;i1&&arguments[1]!==void 0?arguments[1]:!0;return aN(this,t,e,Rse)};function Lse(t,e,r){if(r.isChild()){var n=r._private.parent;e.has(n.id())||t.push(n)}}hm.forEachUp=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return aN(this,t,e,Lse)};function NKe(t,e,r){Lse(t,e,r),Rse(t,e,r)}hm.forEachUpAndDown=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return aN(this,t,e,NKe)},hm.ancestors=hm.parents;var QT,Ise;QT=Ise={data:xn.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:xn.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),scratch:xn.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:xn.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),rscratch:xn.data({field:"rscratch",allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!0}),removeRscratch:xn.removeData({field:"rscratch",triggerEvent:!1}),id:function(){var e=this[0];if(e)return e._private.data.id}},QT.attr=QT.data,QT.removeAttr=QT.removeData;var $Ke=Ise,M3={};function sN(t){return function(e){var r=this;if(e===void 0&&(e=!0),r.length!==0)if(r.isNode()&&!r.removed()){for(var n=0,i=r[0],a=i._private.edges,s=0;se}),minIndegree:dm("indegree",function(t,e){return te}),minOutdegree:dm("outdegree",function(t,e){return te})}),Cr(M3,{totalDegree:function(e){for(var r=0,n=this.nodes(),i=0;i0,f=d;d&&(h=h[0]);var p=f?h.position():{x:0,y:0};r!==void 0?u.position(e,r+p[e]):a!==void 0&&u.position({x:a.x+p.x,y:a.y+p.y})}else{var g=n.position(),m=o?n.parent():null,y=m&&m.length>0,v=y;y&&(m=m[0]);var x=v?m.position():{x:0,y:0};return a={x:g.x-x.x,y:g.y-x.y},e===void 0?a:a[e]}else if(!s)return;return this}},kl.modelPosition=kl.point=kl.position,kl.modelPositions=kl.points=kl.positions,kl.renderedPoint=kl.renderedPosition,kl.relativePoint=kl.relativePosition;var OKe=Dse,fm=function(e){switch(e){case"left":case"right-inside":return"left";case"right":case"left-inside":return"right";default:return"center"}},pm=function(e){switch(e){case"top":case"bottom-inside":return"top";case"bottom":case"top-inside":return"bottom";default:return"center"}},PKe=function(e){switch(e){case"left":return"right";case"right":return"left";case"left-inside":return"left";case"right-inside":return"right";default:return"center"}},gm,od;gm=od={},od.renderedBoundingBox=function(t){var e=this.boundingBox(t),r=this.cy(),n=r.zoom(),i=r.pan(),a=e.x1*n+i.x,s=e.x2*n+i.x,o=e.y1*n+i.y,l=e.y2*n+i.y;return{x1:a,x2:s,y1:o,y2:l,w:s-a,h:l-o}},od.dirtyCompoundBoundsCache=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,e=this.cy();return!e.styleEnabled()||!e.hasCompoundNodes()?this:(this.forEachUp(function(r){if(r.isParent()){var n=r._private;n.compoundBoundsClean=!1,n.bbCache=null,t||r.emitAndNotify("bounds")}}),this)},od.updateCompoundBounds=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,e=this.cy();if(!e.styleEnabled()||!e.hasCompoundNodes())return this;if(!t&&e.batching())return this;function r(s){if(!s.isParent())return;var o=s._private,l=s.children(),u=s.pstyle("compound-sizing-wrt-labels").value==="include",h={width:{val:s.pstyle("min-width").pfValue,left:s.pstyle("min-width-bias-left"),right:s.pstyle("min-width-bias-right")},height:{val:s.pstyle("min-height").pfValue,top:s.pstyle("min-height-bias-top"),bottom:s.pstyle("min-height-bias-bottom")}},d=l.boundingBox({includeLabels:u,includeOverlays:!1,useCache:!1}),f=o.position;(d.w===0||d.h===0)&&(d={w:s.pstyle("width").pfValue,h:s.pstyle("height").pfValue},d.x1=f.x-d.w/2,d.x2=f.x+d.w/2,d.y1=f.y-d.h/2,d.y2=f.y+d.h/2);function p(L,$,I){var z=0,F=0,A=$+I;return L>0&&A>0&&(z=$/A*L,F=I/A*L),{biasDiff:z,biasComplementDiff:F}}function g(L,$,I,z){if(I.units==="%")switch(z){case"width":return L>0?I.pfValue*L:0;case"height":return $>0?I.pfValue*$:0;case"average":return L>0&&$>0?I.pfValue*(L+$)/2:0;case"min":return L>0&&$>0?L>$?I.pfValue*$:I.pfValue*L:0;case"max":return L>0&&$>0?L>$?I.pfValue*L:I.pfValue*$:0;default:return 0}else return I.units==="px"?I.pfValue:0}var m=h.width.left.value;h.width.left.units==="px"&&h.width.val>0&&(m=m*100/h.width.val);var y=h.width.right.value;h.width.right.units==="px"&&h.width.val>0&&(y=y*100/h.width.val);var v=h.height.top.value;h.height.top.units==="px"&&h.height.val>0&&(v=v*100/h.height.val);var x=h.height.bottom.value;h.height.bottom.units==="px"&&h.height.val>0&&(x=x*100/h.height.val);var b=p(h.width.val-d.w,m,y),w=b.biasDiff,C=b.biasComplementDiff,_=p(h.height.val-d.h,v,x),k=_.biasDiff,S=_.biasComplementDiff;o.autoPadding=g(d.w,d.h,s.pstyle("padding"),s.pstyle("padding-relative-to").value),o.autoWidth=Math.max(d.w,h.width.val),f.x=(-w+d.x1+d.x2+C)/2,o.autoHeight=Math.max(d.h,h.height.val),f.y=(-k+d.y1+d.y2+S)/2}for(var n=0;ne.x2?i:e.x2,e.y1=ne.y2?a:e.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1)},ld=function(e,r){return r==null?e:El(e,r.x1,r.y1,r.x2,r.y2)},JT=function(e,r,n){return Es(e,r,n)},N3=function(e,r,n){if(!r.cy().headless()){var i=r._private,a=i.rstyle,s=a.arrowWidth/2,o=r.pstyle(n+"-arrow-shape").value,l,u;if(o!=="none"){n==="source"?(l=a.srcX,u=a.srcY):n==="target"?(l=a.tgtX,u=a.tgtY):(l=a.midX,u=a.midY);var h=i.arrowBounds=i.arrowBounds||{},d=h[n]=h[n]||{};d.x1=l-s,d.y1=u-s,d.x2=l+s,d.y2=u+s,d.w=d.x2-d.x1,d.h=d.y2-d.y1,b3(d,1),El(e,d.x1,d.y1,d.x2,d.y2)}}},oN=function(e,r,n){if(!r.cy().headless()){var i;n?i=n+"-":i="";var a=r._private,s=a.rstyle,o=r.pstyle(i+"label").strValue;if(o){var l=r.pstyle("text-halign"),u=r.pstyle("text-valign"),h=JT(s,"labelWidth",n),d=JT(s,"labelHeight",n),f=JT(s,"labelX",n),p=JT(s,"labelY",n),g=r.pstyle(i+"text-margin-x").pfValue,m=r.pstyle(i+"text-margin-y").pfValue,y=r.isEdge(),v=r.pstyle(i+"text-rotation"),x=r.pstyle("text-outline-width").pfValue,b=r.pstyle("text-border-width").pfValue,w=b/2,C=r.pstyle("text-background-padding").pfValue,_=2,k=d,S=h,L=S/2,$=k/2,I,z,F,A;if(y)I=f-L,z=f+L,F=p-$,A=p+$;else{switch(fm(l.value)){case"left":I=f-S,z=f;break;case"center":I=f-L,z=f+L;break;case"right":I=f,z=f+S;break}switch(pm(u.value)){case"top":F=p-k,A=p;break;case"center":F=p-$,A=p+$;break;case"bottom":F=p,A=p+k;break}}var R=g-Math.max(x,w)-C-_,N=g+Math.max(x,w)+C+_,M=m-Math.max(x,w)-C-_,D=m+Math.max(x,w)+C+_;I+=R,z+=N,F+=M,A+=D;var O=n||"main",B=a.labelBounds,P=B[O]=B[O]||{};P.x1=I,P.y1=F,P.x2=z,P.y2=A,P.w=z-I,P.h=A-F,P.leftPad=R,P.rightPad=N,P.topPad=M,P.botPad=D;var G=y&&v.strValue==="autorotate",V=v.pfValue!=null&&v.pfValue!==0;if(G||V){var H=G?JT(a.rstyle,"labelAngle",n):v.pfValue,W=Math.cos(H),ie=Math.sin(H),j=(I+z)/2,ae=(F+A)/2;if(!y){switch(fm(l.value)){case"left":j=z;break;case"right":j=I;break}switch(pm(u.value)){case"top":ae=A;break;case"bottom":ae=F;break}}var J=function(Ne,ge){return Ne=Ne-j,ge=ge-ae,{x:Ne*W-ge*ie+j,y:Ne*ie+ge*W+ae}},K=J(I,F),Q=J(I,A),re=J(z,F),le=J(z,A);I=Math.min(K.x,Q.x,re.x,le.x),z=Math.max(K.x,Q.x,re.x,le.x),F=Math.min(K.y,Q.y,re.y,le.y),A=Math.max(K.y,Q.y,re.y,le.y)}var fe=O+"Rot",Ae=B[fe]=B[fe]||{};Ae.x1=I,Ae.y1=F,Ae.x2=z,Ae.y2=A,Ae.w=z-I,Ae.h=A-F,El(e,I,F,z,A),El(a.labelBounds.all,I,F,z,A)}return e}},$se=function(e,r){if(!r.cy().headless()){var n=r.pstyle("outline-opacity").value,i=r.pstyle("outline-width").value,a=r.pstyle("outline-offset").value,s=i+a;Ose(e,r,n,s,"outside",s/2)}},Ose=function(e,r,n,i,a,s){if(!(n===0||i<=0||a==="inside")){var o=r.cy(),l=o.renderer(),u=l.nodeShapes[l.getNodeShape(r)];if(u){var h=r.position(),d=h.x,f=h.y,p=r.width(),g=r.height();if(u.hasMiterBounds){a==="center"&&(i/=2);var m=u.miterBounds(d,f,p,g,i);ld(e,m)}else s!=null&&s>0&&x3(e,[s,s,s,s])}}},BKe=function(e,r){if(!r.cy().headless()){var n=r.pstyle("border-opacity").value,i=r.pstyle("border-width").pfValue,a=r.pstyle("border-position").value;Ose(e,r,n,i,a)}},FKe=function(e,r){var n=e._private.cy,i=n.styleEnabled(),a=n.headless(),s=Ss(),o=e._private,l=e.isNode(),u=e.isEdge(),h,d,f,p,g,m,y=o.rstyle,v=l&&i?e.pstyle("bounds-expansion").pfValue:[0],x=function(Se){return Se.pstyle("display").value!=="none"},b=!i||x(e)&&(!u||x(e.source())&&x(e.target()));if(b){var w=0,C=0;i&&r.includeOverlays&&(w=e.pstyle("overlay-opacity").value,w!==0&&(C=e.pstyle("overlay-padding").value));var _=0,k=0;i&&r.includeUnderlays&&(_=e.pstyle("underlay-opacity").value,_!==0&&(k=e.pstyle("underlay-padding").value));var S=Math.max(C,k),L=0,$=0;if(i&&(L=e.pstyle("width").pfValue,$=L/2),l&&r.includeNodes){var I=e.position();g=I.x,m=I.y;var z=e.outerWidth(),F=z/2,A=e.outerHeight(),R=A/2;h=g-F,d=g+F,f=m-R,p=m+R,El(s,h,f,d,p),i&&$se(s,e),i&&r.includeOutlines&&!a&&$se(s,e),i&&BKe(s,e)}else if(u&&r.includeEdges)if(i&&!a){var N=e.pstyle("curve-style").strValue;if(h=Math.min(y.srcX,y.midX,y.tgtX),d=Math.max(y.srcX,y.midX,y.tgtX),f=Math.min(y.srcY,y.midY,y.tgtY),p=Math.max(y.srcY,y.midY,y.tgtY),h-=$,d+=$,f-=$,p+=$,El(s,h,f,d,p),N==="haystack"){var M=y.haystackPts;if(M&&M.length===2){if(h=M[0].x,f=M[0].y,d=M[1].x,p=M[1].y,h>d){var D=h;h=d,d=D}if(f>p){var O=f;f=p,p=O}El(s,h-$,f-$,d+$,p+$)}}else if(N==="bezier"||N==="unbundled-bezier"||Zh(N,"segments")||Zh(N,"taxi")){var B;switch(N){case"bezier":case"unbundled-bezier":B=y.bezierPts;break;case"segments":case"taxi":case"round-segments":case"round-taxi":B=y.linePts;break}if(B!=null)for(var P=0;Pd){var j=h;h=d,d=j}if(f>p){var ae=f;f=p,p=ae}h-=$,d+=$,f-=$,p+=$,El(s,h,f,d,p)}if(i&&r.includeEdges&&u&&(N3(s,e,"mid-source"),N3(s,e,"mid-target"),N3(s,e,"source"),N3(s,e,"target")),i){var J=e.pstyle("ghost").value==="yes";if(J){var K=e.pstyle("ghost-offset-x").pfValue,Q=e.pstyle("ghost-offset-y").pfValue;El(s,s.x1+K,s.y1+Q,s.x2+K,s.y2+Q)}}var re=o.bodyBounds=o.bodyBounds||{};jie(re,s),x3(re,v),b3(re,1),i&&(h=s.x1,d=s.x2,f=s.y1,p=s.y2,El(s,h-S,f-S,d+S,p+S));var le=o.overlayBounds=o.overlayBounds||{};jie(le,s),x3(le,v),b3(le,1);var fe=o.labelBounds=o.labelBounds||{};fe.all!=null?bXe(fe.all):fe.all=Ss(),i&&r.includeLabels&&(r.includeMainLabels&&oN(s,e,null),u&&(r.includeSourceLabels&&oN(s,e,"source"),r.includeTargetLabels&&oN(s,e,"target")))}return s.x1=Qo(s.x1),s.y1=Qo(s.y1),s.x2=Qo(s.x2),s.y2=Qo(s.y2),s.w=Qo(s.x2-s.x1),s.h=Qo(s.y2-s.y1),s.w>0&&s.h>0&&b&&(x3(s,v),b3(s,1)),s},Pse=function(e){var r=0,n=function(s){return(s?1:0)<0&&arguments[0]!==void 0?arguments[0]:pGe,e=arguments.length>1?arguments[1]:void 0,r=0;r=0;o--)s(o);return this},oh.removeAllListeners=function(){return this.removeListener("*")},oh.emit=oh.trigger=function(t,e,r){var n=this.listeners,i=n.length;return this.emitting++,wn(e)||(e=[e]),gGe(this,function(a,s){r!=null&&(n=[{event:s.event,type:s.type,namespace:s.namespace,callback:r}],i=n.length);for(var o=function(){var h=n[l];if(h.type===s.type&&(!h.namespace||h.namespace===s.namespace||h.namespace===fGe)&&a.eventMatches(a.context,h,s)){var d=[s];e!=null&&iBe(d,e),a.beforeEmit(a.context,h,s),h.conf&&h.conf.one&&(a.listeners=a.listeners.filter(function(g){return g!==h}));var f=a.callbackContext(a.context,h,s),p=h.callback.apply(f,d);a.afterEmit(a.context,h,s),p===!1&&(s.stopPropagation(),s.preventDefault())}},l=0;l1&&!s){var o=this.length-1,l=this[o],u=l._private.data.id;this[o]=void 0,this[e]=l,a.set(u,{ele:l,index:e})}return this.length--,this},unmergeOne:function(e){e=e[0];var r=this._private,n=e._private.data.id,i=r.map,a=i.get(n);if(!a)return this;var s=a.index;return this.unmergeAt(s),this},unmerge:function(e){var r=this._private.cy;if(!e)return this;if(e&&hr(e)){var n=e;e=r.mutableElements().filter(n)}for(var i=0;i=0;r--){var n=this[r];e(n)&&this.unmergeAt(r)}return this},map:function(e,r){for(var n=[],i=this,a=0;an&&(n=l,i=o)}return{value:n,ele:i}},min:function(e,r){for(var n=1/0,i,a=this,s=0;s=0&&a"u"?"undefined":Fi(Symbol))!=e&&Fi(Symbol.iterator)!=e;r&&(F5[Symbol.iterator]=function(){var n=this,i={value:void 0,done:!1},a=0,s=this.length;return Vj({next:function(){return a1&&arguments[1]!==void 0?arguments[1]:!0,n=this[0],i=n.cy();if(i.styleEnabled()&&n){n._private.styleDirty&&(n._private.styleDirty=!1,i.style().apply(n));var a=n._private.style[e];return a??(r?i.style().getDefaultProperty(e):null)}},numericStyle:function(e){var r=this[0];if(r.cy().styleEnabled()&&r){var n=r.pstyle(e);return n.pfValue!==void 0?n.pfValue:n.value}},numericStyleUnits:function(e){var r=this[0];if(r.cy().styleEnabled()&&r)return r.pstyle(e).units},renderedStyle:function(e){var r=this.cy();if(!r.styleEnabled())return this;var n=this[0];if(n)return r.style().getRenderedStyle(n,e)},style:function(e,r){var n=this.cy();if(!n.styleEnabled())return this;var i=!1,a=n.style();if(Kr(e)){var s=e;a.applyBypass(this,s,i),this.emitAndNotify("style")}else if(hr(e))if(r===void 0){var o=this[0];return o?a.getStylePropertyValue(o,e):void 0}else a.applyBypass(this,e,r,i),this.emitAndNotify("style");else if(e===void 0){var l=this[0];return l?a.getRawStyle(l):void 0}return this},removeStyle:function(e){var r=this.cy();if(!r.styleEnabled())return this;var n=!1,i=r.style(),a=this;if(e===void 0)for(var s=0;s0&&e.push(h[0]),e.push(o[0])}return this.spawn(e,!0).filter(t)},"neighborhood"),closedNeighborhood:function(e){return this.neighborhood().add(this).filter(e)},openNeighborhood:function(e){return this.neighborhood(e)}}),Da.neighbourhood=Da.neighborhood,Da.closedNeighbourhood=Da.closedNeighborhood,Da.openNeighbourhood=Da.openNeighborhood,yr(Da,{source:ho(function(e){var r=this[0],n;return r&&(n=r._private.source||r.cy().collection()),n&&e?n.filter(e):n},"source"),target:ho(function(e){var r=this[0],n;return r&&(n=r._private.target||r.cy().collection()),n&&e?n.filter(e):n},"target"),sources:GJ({attr:"source"}),targets:GJ({attr:"target"})});function GJ(t){return function(r){for(var n=[],i=0;i0);return s},component:function(){var e=this[0];return e.cy().mutableElements().components(e)[0]}}),Da.componentsOf=Da.components;var fa=function(e,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(e===void 0){Hn("A collection must have a reference to the core");return}var a=new Pc,s=!1;if(!r)r=[];else if(r.length>0&&Kr(r[0])&&!Db(r[0])){s=!0;for(var o=[],l=new Cp,u=0,h=r.length;u0&&arguments[0]!==void 0?arguments[0]:!0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=this,n=r.cy(),i=n._private,a=[],s=[],o,l=0,u=r.length;l0){for(var $=o.length===r.length?r:new fa(n,o),B=0;B<$.length;B++){var P=$[B];P.isNode()||(P.parallelEdges().clearTraversalCache(),P.source().clearTraversalCache(),P.target().clearTraversalCache())}var G;i.hasCompoundNodes?G=n.collection().merge($).merge($.connectedNodes()).merge($.parent()):G=$,G.dirtyCompoundBoundsCache().dirtyBoundingBoxCache().updateStyle(t),t?$.emitAndNotify("add"):e&&$.emit("add")}return r},kn.removed=function(){var t=this[0];return t&&t._private.removed},kn.inside=function(){var t=this[0];return t&&!t._private.removed},kn.remove=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=this,n=[],i={},a=r._private.cy;function s(S){for(var R=S._private.edges,N=0;N0&&(t?M.emitAndNotify("remove"):e&&M.emit("remove"));for(var z=0;z0?z=S:M=S;while(Math.abs(F)>s&&++R=a?T(O,R):N===0?R:w(O,M,M+u)}var A=!1;function C(){A=!0,(t!==e||r!==n)&&b()}var _=function(M){return A||C(),t===e&&r===n?M:M===0?0:M===1?1:y(k(M),e,n)};_.getControlPoints=function(){return[{x:t,y:e},{x:r,y:n}]};var L="generateBezier("+[t,e,r,n]+")";return _.toString=function(){return L},_}/*! Runge-Kutta spring physics function generator. Adapted from Framer.js, copyright Koen Bok. MIT License: http://en.wikipedia.org/wiki/MIT_License */var SGe=(function(){function t(n){return-n.tension*n.x-n.friction*n.v}function e(n,i,a){var s={x:n.x+a.dx*i,v:n.v+a.dv*i,tension:n.tension,friction:n.friction};return{dx:s.v,dv:t(s)}}function r(n,i){var a={dx:n.v,dv:t(n)},s=e(n,i*.5,a),o=e(n,i*.5,s),l=e(n,i,o),u=1/6*(a.dx+2*(s.dx+o.dx)+l.dx),h=1/6*(a.dv+2*(s.dv+o.dv)+l.dv);return n.x=n.x+u*i,n.v=n.v+h*i,n}return function n(i,a,s){var o={x:-1,v:0,tension:null,friction:null},l=[0],u=0,h=1/1e4,d=16/1e3,f,p,g;for(i=parseFloat(i)||500,a=parseFloat(a)||20,s=s||null,o.tension=i,o.friction=a,f=s!==null,f?(u=n(i,a),p=u/s*d):p=d;g=r(g||o,p),l.push(1+g.x),u+=16,Math.abs(g.x)>h&&Math.abs(g.v)>h;);return f?function(m){return l[m*(l.length-1)|0]}:u}})(),En=function(e,r,n,i){var a=EGe(e,r,n,i);return function(s,o,l){return s+(o-s)*a(l)}},V5={linear:function(e,r,n){return e+(r-e)*n},ease:En(.25,.1,.25,1),"ease-in":En(.42,0,1,1),"ease-out":En(0,0,.58,1),"ease-in-out":En(.42,0,.58,1),"ease-in-sine":En(.47,0,.745,.715),"ease-out-sine":En(.39,.575,.565,1),"ease-in-out-sine":En(.445,.05,.55,.95),"ease-in-quad":En(.55,.085,.68,.53),"ease-out-quad":En(.25,.46,.45,.94),"ease-in-out-quad":En(.455,.03,.515,.955),"ease-in-cubic":En(.55,.055,.675,.19),"ease-out-cubic":En(.215,.61,.355,1),"ease-in-out-cubic":En(.645,.045,.355,1),"ease-in-quart":En(.895,.03,.685,.22),"ease-out-quart":En(.165,.84,.44,1),"ease-in-out-quart":En(.77,0,.175,1),"ease-in-quint":En(.755,.05,.855,.06),"ease-out-quint":En(.23,1,.32,1),"ease-in-out-quint":En(.86,0,.07,1),"ease-in-expo":En(.95,.05,.795,.035),"ease-out-expo":En(.19,1,.22,1),"ease-in-out-expo":En(1,0,0,1),"ease-in-circ":En(.6,.04,.98,.335),"ease-out-circ":En(.075,.82,.165,1),"ease-in-out-circ":En(.785,.135,.15,.86),spring:function(e,r,n){if(n===0)return V5.linear;var i=SGe(e,r,n);return function(a,s,o){return a+(s-a)*i(o)}},"cubic-bezier":En};function WJ(t,e,r,n,i){if(n===1||e===r)return r;var a=i(e,r,n);return t==null||((t.roundValue||t.color)&&(a=Math.round(a)),t.min!==void 0&&(a=Math.max(a,t.min)),t.max!==void 0&&(a=Math.min(a,t.max))),a}function UJ(t,e){return t.pfValue!=null||t.value!=null?t.pfValue!=null&&(e==null||e.type.units!=="%")?t.pfValue:t.value:t}function Fp(t,e,r,n,i){var a=i!=null?i.type:null;r<0?r=0:r>1&&(r=1);var s=UJ(t,i),o=UJ(e,i);if(Gt(s)&&Gt(o))return WJ(a,s,o,r,n);if(wn(s)&&wn(o)){for(var l=[],u=0;u0?(p==="spring"&&g.push(s.duration),s.easingImpl=V5[p].apply(null,g)):s.easingImpl=V5[p]}var m=s.easingImpl,y;if(s.duration===0?y=1:y=(r-l)/s.duration,s.applying&&(y=s.progress),y<0?y=0:y>1&&(y=1),s.delay==null){var v=s.startPosition,T=s.position;if(T&&i&&!t.locked()){var b={};Zb(v.x,T.x)&&(b.x=Fp(v.x,T.x,y,m)),Zb(v.y,T.y)&&(b.y=Fp(v.y,T.y,y,m)),t.position(b)}var w=s.startPan,k=s.pan,A=a.pan,C=k!=null&&n;C&&(Zb(w.x,k.x)&&(A.x=Fp(w.x,k.x,y,m)),Zb(w.y,k.y)&&(A.y=Fp(w.y,k.y,y,m)),t.emit("pan"));var _=s.startZoom,L=s.zoom,O=L!=null&&n;O&&(Zb(_,L)&&(a.zoom=Gb(a.minZoom,Fp(_,L,y,m),a.maxZoom)),t.emit("zoom")),(C||O)&&t.emit("viewport");var M=s.style;if(M&&M.length>0&&i){for(var z=0;z=0;C--){var _=A[C];_()}A.splice(0,A.length)},T=p.length-1;T>=0;T--){var b=p[T],w=b._private;if(w.stopped){p.splice(T,1),w.hooked=!1,w.playing=!1,w.started=!1,v(w.frames);continue}!w.playing&&!w.applying||(w.playing&&w.applying&&(w.applying=!1),w.started||_Ge(h,b,t),AGe(h,b,t,d),w.applying&&(w.applying=!1),v(w.frames),w.step!=null&&w.step(t),b.completed()&&(p.splice(T,1),w.hooked=!1,w.playing=!1,w.started=!1,v(w.completes)),m=!0)}return!d&&p.length===0&&g.length===0&&n.push(h),m}for(var a=!1,s=0;s0?e.notify("draw",r):e.notify("draw")),r.unmerge(n),e.emit("step")}var RGe={animate:un.animate(),animation:un.animation(),animated:un.animated(),clearQueue:un.clearQueue(),delay:un.delay(),delayAnimation:un.delayAnimation(),stop:un.stop(),addToAnimationPool:function(e){var r=this;r.styleEnabled()&&r._private.aniEles.merge(e)},stopAnimationLoop:function(){this._private.animationsRunning=!1},startAnimationLoop:function(){var e=this;if(e._private.animationsRunning=!0,!e.styleEnabled())return;function r(){e._private.animationsRunning&&f5(function(a){HJ(a,e),r()})}var n=e.renderer();n&&n.beforeRender?n.beforeRender(function(a,s){HJ(s,e)},n.beforeRenderPriorities.animations):r()}},LGe={qualifierCompare:function(e,r){return e==null||r==null?e==null&&r==null:e.sameText(r)},eventMatches:function(e,r,n){var i=r.qualifier;return i!=null?e!==n.target&&Db(n.target)&&i.matches(n.target):!0},addEventFields:function(e,r){r.cy=e,r.target=e},callbackContext:function(e,r,n){return r.qualifier!=null?n.target:e}},W5=function(e){return hr(e)?new rh(e):e},YJ={createEmitter:function(){var e=this._private;return e.emitter||(e.emitter=new P5(LGe,this)),this},emitter:function(){return this._private.emitter},on:function(e,r,n){return this.emitter().on(e,W5(r),n),this},removeListener:function(e,r,n){return this.emitter().removeListener(e,W5(r),n),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},one:function(e,r,n){return this.emitter().one(e,W5(r),n),this},once:function(e,r,n){return this.emitter().one(e,W5(r),n),this},emit:function(e,r){return this.emitter().emit(e,r),this},emitAndNotify:function(e,r){return this.emit(e),this.notify(e,r),this}};un.eventAliasesOn(YJ);var OL={png:function(e){var r=this._private.renderer;return e=e||{},r.png(e)},jpg:function(e){var r=this._private.renderer;return e=e||{},e.bg=e.bg||"#fff",r.jpg(e)}};OL.jpeg=OL.jpg;var U5={layout:function(e){var r=this;if(e==null){Hn("Layout options must be specified to make a layout");return}if(e.name==null){Hn("A `name` must be specified to make a layout");return}var n=e.name,i=r.extension("layout",n);if(i==null){Hn("No such layout `"+n+"` found. Did you forget to import it and `cytoscape.use()` it?");return}var a;hr(e.eles)?a=r.$(e.eles):a=e.eles!=null?e.eles:r.$();var s=new i(yr({},e,{cy:r,eles:a}));return s}};U5.createLayout=U5.makeLayout=U5.layout;var IGe={notify:function(e,r){var n=this._private;if(this.batching()){n.batchNotifications=n.batchNotifications||{};var i=n.batchNotifications[e]=n.batchNotifications[e]||this.collection();r!=null&&i.merge(r);return}if(n.notificationsEnabled){var a=this.renderer();this.destroyed()||!a||a.notify(e,r)}},notifications:function(e){var r=this._private;return e===void 0?r.notificationsEnabled:(r.notificationsEnabled=!!e,this)},noNotifications:function(e){this.notifications(!1),e(),this.notifications(!0)},batching:function(){return this._private.batchCount>0},startBatch:function(){var e=this._private;return e.batchCount==null&&(e.batchCount=0),e.batchCount===0&&(e.batchStyleEles=this.collection(),e.batchNotifications={}),e.batchCount++,this},endBatch:function(){var e=this._private;if(e.batchCount===0)return this;if(e.batchCount--,e.batchCount===0){e.batchStyleEles.updateStyle();var r=this.renderer();Object.keys(e.batchNotifications).forEach(function(n){var i=e.batchNotifications[n];i.empty()?r.notify(n):r.notify(n,i)})}return this},batch:function(e){return this.startBatch(),e(),this.endBatch(),this},batchData:function(e){var r=this;return this.batch(function(){for(var n=Object.keys(e),i=0;i0;)r.removeChild(r.childNodes[0]);e._private.renderer=null,e.mutableElements().forEach(function(n){var i=n._private;i.rscratch={},i.rstyle={},i.animation.current=[],i.animation.queue=[]})},onRender:function(e){return this.on("render",e)},offRender:function(e){return this.off("render",e)}};$L.invalidateDimensions=$L.resize;var H5={collection:function(e,r){return hr(e)?this.$(e):Hs(e)?e.collection():wn(e)?(r||(r={}),new fa(this,e,r.unique,r.removed)):new fa(this)},nodes:function(e){var r=this.$(function(n){return n.isNode()});return e?r.filter(e):r},edges:function(e){var r=this.$(function(n){return n.isEdge()});return e?r.filter(e):r},$:function(e){var r=this._private.elements;return e?r.filter(e):r.spawnSelf()},mutableElements:function(){return this._private.elements}};H5.elements=H5.filter=H5.$;var Ji={},Qb="t",MGe="f";Ji.apply=function(t){for(var e=this,r=e._private,n=r.cy,i=n.collection(),a=0;a0;if(f||d&&p){var g=void 0;f&&p||f?g=u.properties:p&&(g=u.mappedProperties);for(var m=0;m1&&(w=1),o.color){var A=n.valueMin[0],C=n.valueMax[0],_=n.valueMin[1],L=n.valueMax[1],O=n.valueMin[2],M=n.valueMax[2],z=n.valueMin[3]==null?1:n.valueMin[3],F=n.valueMax[3]==null?1:n.valueMax[3],S=[Math.round(A+(C-A)*w),Math.round(_+(L-_)*w),Math.round(O+(M-O)*w),Math.round(z+(F-z)*w)];a={bypass:n.bypass,name:n.name,value:S,strValue:"rgb("+S[0]+", "+S[1]+", "+S[2]+")"}}else if(o.number){var R=n.valueMin+(n.valueMax-n.valueMin)*w;a=this.parse(n.name,R,n.bypass,f)}else return!1;if(!a)return m(),!1;a.mapping=n,n=a;break}case s.data:{for(var N=n.field.split("."),D=d.data,I=0;I0&&a>0){for(var o={},l=!1,u=0;u0?t.delayAnimation(s).play().promise().then(b):b()}).then(function(){return t.animation({style:o,duration:a,easing:t.pstyle("transition-timing-function").value,queue:!1}).play().promise()}).then(function(){r.removeBypasses(t,i),t.emitAndNotify("style"),n.transitioning=!1})}else n.transitioning&&(this.removeBypasses(t,i),t.emitAndNotify("style"),n.transitioning=!1)},Ji.checkTrigger=function(t,e,r,n,i,a){var s=this.properties[e],o=i(s);t.removed()||o!=null&&o(r,n,t)&&a(s)},Ji.checkZOrderTrigger=function(t,e,r,n){var i=this;this.checkTrigger(t,e,r,n,function(a){return a.triggersZOrder},function(){i._private.cy.notify("zorder",t)})},Ji.checkBoundsTrigger=function(t,e,r,n){this.checkTrigger(t,e,r,n,function(i){return i.triggersBounds},function(i){t.dirtyCompoundBoundsCache(),t.dirtyBoundingBoxCache()})},Ji.checkConnectedEdgesBoundsTrigger=function(t,e,r,n){this.checkTrigger(t,e,r,n,function(i){return i.triggersBoundsOfConnectedEdges},function(i){t.connectedEdges().forEach(function(a){a.dirtyBoundingBoxCache()})})},Ji.checkParallelEdgesBoundsTrigger=function(t,e,r,n){this.checkTrigger(t,e,r,n,function(i){return i.triggersBoundsOfParallelEdges},function(i){t.parallelEdges().forEach(function(a){a.dirtyBoundingBoxCache()})})},Ji.checkTriggers=function(t,e,r,n){t.dirtyStyleCache(),this.checkZOrderTrigger(t,e,r,n),this.checkBoundsTrigger(t,e,r,n),this.checkConnectedEdgesBoundsTrigger(t,e,r,n),this.checkParallelEdgesBoundsTrigger(t,e,r,n)};var Jb={};Jb.applyBypass=function(t,e,r,n){var i=this,a=[],s=!0;if(e==="*"||e==="**"){if(r!==void 0)for(var o=0;oi.length?n=n.substr(i.length):n=""}function l(){a.length>s.length?a=a.substr(s.length):a=""}for(;;){var u=n.match(/^\s*$/);if(u)break;var h=n.match(/^\s*((?:.|\s)+?)\s*\{((?:.|\s)+?)\}/);if(!h){cn("Halting stylesheet parsing: String stylesheet contains more to parse but no selector and block found in: "+n);break}i=h[0];var d=h[1];if(d!=="core"){var f=new rh(d);if(f.invalid){cn("Skipping parsing of block: Invalid selector found in string stylesheet: "+d),o();continue}}var p=h[2],g=!1;a=p;for(var m=[];;){var y=a.match(/^\s*$/);if(y)break;var v=a.match(/^\s*(.+?)\s*:\s*(.+?)(?:\s*;|\s*$)/);if(!v){cn("Skipping parsing of block: Invalid formatting of style property and value definitions found in:"+p),g=!0;break}s=v[0];var T=v[1],b=v[2],w=e.properties[T];if(!w){cn("Skipping property: Invalid property name in: "+s),l();continue}var k=r.parse(T,b);if(!k){cn("Skipping property: Invalid property definition in: "+s),l();continue}m.push({name:T,val:b}),l()}if(g){o();break}r.selector(d);for(var A=0;A=7&&e[0]==="d"&&(h=new RegExp(o.data.regex).exec(e))){if(r)return!1;var f=o.data;return{name:t,value:h,strValue:""+e,mapped:f,field:h[1],bypass:r}}else if(e.length>=10&&e[0]==="m"&&(d=new RegExp(o.mapData.regex).exec(e))){if(r||u.multiple)return!1;var p=o.mapData;if(!(u.color||u.number))return!1;var g=this.parse(t,d[4]);if(!g||g.mapped)return!1;var m=this.parse(t,d[5]);if(!m||m.mapped)return!1;if(g.pfValue===m.pfValue||g.strValue===m.strValue)return cn("`"+t+": "+e+"` is not a valid mapper because the output range is zero; converting to `"+t+": "+g.strValue+"`"),this.parse(t,g.strValue);if(u.color){var y=g.value,v=m.value,T=y[0]===v[0]&&y[1]===v[1]&&y[2]===v[2]&&(y[3]===v[3]||(y[3]==null||y[3]===1)&&(v[3]==null||v[3]===1));if(T)return!1}return{name:t,value:d,strValue:""+e,mapped:p,field:d[1],fieldMin:parseFloat(d[2]),fieldMax:parseFloat(d[3]),valueMin:g.value,valueMax:m.value,bypass:r}}}if(u.multiple&&n!=="multiple"){var b;if(l?b=e.split(/\s+/):wn(e)?b=e:b=[e],u.evenMultiple&&b.length%2!==0)return null;for(var w=[],k=[],A=[],C="",_=!1,L=0;L0?" ":"")+O.strValue}return u.validate&&!u.validate(w,k)?null:u.singleEnum&&_?w.length===1&&hr(w[0])?{name:t,value:w[0],strValue:w[0],bypass:r}:null:{name:t,value:w,pfValue:A,strValue:C,bypass:r,units:k}}var M=function(){for(var J=0;Ju.max||u.strictMax&&e===u.max))return null;var N={name:t,value:e,strValue:""+e+(z||""),units:z,bypass:r};return u.unitless||z!=="px"&&z!=="em"?N.pfValue=e:N.pfValue=z==="px"||!z?e:this.getEmSizeInPixels()*e,(z==="ms"||z==="s")&&(N.pfValue=z==="ms"?e:1e3*e),(z==="deg"||z==="rad")&&(N.pfValue=z==="rad"?e:RBe(e)),z==="%"&&(N.pfValue=e/100),N}else if(u.propList){var D=[],I=""+e;if(I!=="none"){for(var $=I.split(/\s*,\s*|\s+/),B=0;B<$.length;B++){var P=$[B].trim();i.properties[P]?D.push(P):cn("`"+P+"` is not a valid property name")}if(D.length===0)return null}return{name:t,value:D,strValue:D.length===0?"none":D.join(" "),bypass:r}}else if(u.color){var G=Qj(e);return G?{name:t,value:G,pfValue:G,strValue:"rgb("+G[0]+","+G[1]+","+G[2]+")",bypass:r}:null}else if(u.regex||u.regexes){if(u.enums){var V=M();if(V)return V}for(var Y=u.regexes?u.regexes:[u.regex],W=0;W0&&o>0&&!isNaN(n.w)&&!isNaN(n.h)&&n.w>0&&n.h>0){l=Math.min((s-2*r)/n.w,(o-2*r)/n.h),l=l>this._private.maxZoom?this._private.maxZoom:l,l=l=n.minZoom&&(n.maxZoom=r),this},minZoom:function(e){return e===void 0?this._private.minZoom:this.zoomRange({min:e})},maxZoom:function(e){return e===void 0?this._private.maxZoom:this.zoomRange({max:e})},getZoomedViewport:function(e){var r=this._private,n=r.pan,i=r.zoom,a,s,o=!1;if(r.zoomingEnabled||(o=!0),Gt(e)?s=e:Kr(e)&&(s=e.level,e.position!=null?a=v5(e.position,i,n):e.renderedPosition!=null&&(a=e.renderedPosition),a!=null&&!r.panningEnabled&&(o=!0)),s=s>r.maxZoom?r.maxZoom:s,s=sr.maxZoom||!r.zoomingEnabled?s=!0:(r.zoom=l,a.push("zoom"))}if(i&&(!s||!e.cancelOnFailedZoom)&&r.panningEnabled){var u=e.pan;Gt(u.x)&&(r.pan.x=u.x,o=!1),Gt(u.y)&&(r.pan.y=u.y,o=!1),o||a.push("pan")}return a.length>0&&(a.push("viewport"),this.emit(a.join(" ")),this.notify("viewport")),this},center:function(e){var r=this.getCenterPan(e);return r&&(this._private.pan=r,this.emit("pan viewport"),this.notify("viewport")),this},getCenterPan:function(e,r){if(this._private.panningEnabled){if(hr(e)){var n=e;e=this.mutableElements().filter(n)}else Hs(e)||(e=this.mutableElements());if(e.length!==0){var i=e.boundingBox(),a=this.width(),s=this.height();r=r===void 0?this._private.zoom:r;var o={x:(a-r*(i.x1+i.x2))/2,y:(s-r*(i.y1+i.y2))/2};return o}}},reset:function(){return!this._private.panningEnabled||!this._private.zoomingEnabled?this:(this.viewport({pan:{x:0,y:0},zoom:1}),this)},invalidateSize:function(){this._private.sizeCache=null},size:function(){var e=this._private,r=e.container,n=this;return e.sizeCache=e.sizeCache||(r?(function(){var i=n.window().getComputedStyle(r),a=function(o){return parseFloat(i.getPropertyValue(o))};return{width:r.clientWidth-a("padding-left")-a("padding-right"),height:r.clientHeight-a("padding-top")-a("padding-bottom")}})():{width:1,height:1})},width:function(){return this.size().width},height:function(){return this.size().height},extent:function(){var e=this._private.pan,r=this._private.zoom,n=this.renderedExtent(),i={x1:(n.x1-e.x)/r,x2:(n.x2-e.x)/r,y1:(n.y1-e.y)/r,y2:(n.y2-e.y)/r};return i.w=i.x2-i.x1,i.h=i.y2-i.y1,i},renderedExtent:function(){var e=this.width(),r=this.height();return{x1:0,y1:0,x2:e,y2:r,w:e,h:r}},multiClickDebounceTime:function(e){if(e)this._private.multiClickDebounceTime=e;else return this._private.multiClickDebounceTime;return this}};$d.centre=$d.center,$d.autolockNodes=$d.autolock,$d.autoungrabifyNodes=$d.autoungrabify;var ex={data:un.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeData:un.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),scratch:un.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:un.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0})};ex.attr=ex.data,ex.removeAttr=ex.removeData;var tx=function(e){var r=this;e=yr({},e);var n=e.container;n&&!c5(n)&&c5(n[0])&&(n=n[0]);var i=n?n._cyreg:null;i=i||{},i&&i.cy&&(i.cy.destroy(),i={});var a=i.readies=i.readies||[];n&&(n._cyreg=i),i.cy=r;var s=zi!==void 0&&n!==void 0&&!e.headless,o=e;o.layout=yr({name:s?"grid":"null"},o.layout),o.renderer=yr({name:s?"canvas":"null"},o.renderer);var l=function(g,m,y){return m!==void 0?m:y!==void 0?y:g},u=this._private={container:n,ready:!1,options:o,elements:new fa(this),listeners:[],aniEles:new fa(this),data:o.data||{},scratch:{},layout:null,renderer:null,destroyed:!1,notificationsEnabled:!0,minZoom:1e-50,maxZoom:1e50,zoomingEnabled:l(!0,o.zoomingEnabled),userZoomingEnabled:l(!0,o.userZoomingEnabled),panningEnabled:l(!0,o.panningEnabled),userPanningEnabled:l(!0,o.userPanningEnabled),boxSelectionEnabled:l(!0,o.boxSelectionEnabled),autolock:l(!1,o.autolock,o.autolockNodes),autoungrabify:l(!1,o.autoungrabify,o.autoungrabifyNodes),autounselectify:l(!1,o.autounselectify),styleEnabled:o.styleEnabled===void 0?s:o.styleEnabled,zoom:Gt(o.zoom)?o.zoom:1,pan:{x:Kr(o.pan)&&Gt(o.pan.x)?o.pan.x:0,y:Kr(o.pan)&&Gt(o.pan.y)?o.pan.y:0},animation:{current:[],queue:[]},hasCompoundNodes:!1,multiClickDebounceTime:l(250,o.multiClickDebounceTime)};this.createEmitter(),this.selectionType(o.selectionType),this.zoomRange({min:o.minZoom,max:o.maxZoom});var h=function(g,m){var y=g.some(CPe);if(y)return Lp.all(g).then(m);m(g)};u.styleEnabled&&r.setStyle([]);var d=yr({},o,o.renderer);r.initRenderer(d);var f=function(g,m,y){r.notifications(!1);var v=r.mutableElements();v.length>0&&v.remove(),g!=null&&(Kr(g)||wn(g))&&r.add(g),r.one("layoutready",function(b){r.notifications(!0),r.emit(b),r.one("load",m),r.emitAndNotify("load")}).one("layoutstop",function(){r.one("done",y),r.emit("done")});var T=yr({},r._private.options.layout);T.eles=r.elements(),r.layout(T).run()};h([o.style,o.elements],function(p){var g=p[0],m=p[1];u.styleEnabled&&r.style().append(g),f(m,function(){r.startAnimationLoop(),u.ready=!0,jn(o.ready)&&r.on("ready",o.ready);for(var y=0;y0,o=!!t.boundingBox,l=ja(o?t.boundingBox:structuredClone(e.extent())),u;if(Hs(t.roots))u=t.roots;else if(wn(t.roots)){for(var h=[],d=0;d0;){var S=F(),R=L(S,M);if(R)S.outgoers().filter(function(ve){return ve.isNode()&&r.has(ve)}).forEach(z);else if(R===null){cn("Detected double maximal shift for node `"+S.id()+"`. Bailing maximal adjustment due to cycle. Use `options.maximal: true` only on DAGs.");break}}}var N=0;if(t.avoidOverlap)for(var D=0;D0&&v[0].length<=3?Ve/2:0),nt=2*Math.PI/v[Ze].length*ke;return Ze===0&&v[0].length===1&&(Qe=1),{x:ne.x+Qe*Math.cos(nt),y:ne.y+Qe*Math.sin(nt)}}else{var tt=v[Ze].length,je=Math.max(tt===1?0:o?(l.w-t.padding*2-ue.w)/((t.grid?_e:tt)-1):(l.w-t.padding*2-ue.w)/((t.grid?_e:tt)+1),N),Ce={x:ne.x+(ke+1-(tt+1)/2)*je,y:ne.y+(Ze+1-(W+1)/2)*fe};return Ce}},Ne={downward:0,leftward:90,upward:180,rightward:-90};Object.keys(Ne).indexOf(t.direction)===-1&&Hn("Invalid direction '".concat(t.direction,"' specified for breadthfirst layout. Valid values are: ").concat(Object.keys(Ne).join(", ")));var me=function(Ge){return QPe(Ae(Ge),l,Ne[t.direction])};return r.nodes().layoutPositions(this,t,me),this};var BGe={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,radius:void 0,startAngle:3/2*Math.PI,sweep:void 0,clockwise:!0,sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}};function jJ(t){this.options=yr({},BGe,t)}jJ.prototype.run=function(){var t=this.options,e=t,r=t.cy,n=e.eles,i=e.counterclockwise!==void 0?!e.counterclockwise:e.clockwise,a=n.nodes().not(":parent");e.sort&&(a=a.sort(e.sort));for(var s=ja(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()}),o={x:s.x1+s.w/2,y:s.y1+s.h/2},l=e.sweep===void 0?2*Math.PI-2*Math.PI/a.length:e.sweep,u=l/Math.max(1,a.length-1),h,d=0,f=0;f1&&e.avoidOverlap){d*=1.75;var v=Math.cos(u)-Math.cos(0),T=Math.sin(u)-Math.sin(0),b=Math.sqrt(d*d/(v*v+T*T));h=Math.max(b,h)}var w=function(A,C){var _=e.startAngle+C*u*(i?1:-1),L=h*Math.cos(_),O=h*Math.sin(_),M={x:o.x+L,y:o.y+O};return M};return n.nodes().layoutPositions(this,e,w),this};var FGe={fit:!0,padding:30,startAngle:3/2*Math.PI,sweep:void 0,clockwise:!0,equidistant:!1,minNodeSpacing:10,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,height:void 0,width:void 0,spacingFactor:void 0,concentric:function(e){return e.degree()},levelWidth:function(e){return e.maxDegree()/4},animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}};function ZJ(t){this.options=yr({},FGe,t)}ZJ.prototype.run=function(){for(var t=this.options,e=t,r=e.counterclockwise!==void 0?!e.counterclockwise:e.clockwise,n=t.cy,i=e.eles,a=i.nodes().not(":parent"),s=ja(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()}),o={x:s.x1+s.w/2,y:s.y1+s.h/2},l=[],u=0,h=0;h0){var k=Math.abs(T[0].value-w.value);k>=y&&(T=[],v.push(T))}T.push(w)}var A=u+e.minNodeSpacing;if(!e.avoidOverlap){var C=v.length>0&&v[0].length>1,_=Math.min(s.w,s.h)/2-A,L=_/(v.length+C?1:0);A=Math.min(A,L)}for(var O=0,M=0;M1&&e.avoidOverlap){var R=Math.cos(S)-Math.cos(0),N=Math.sin(S)-Math.sin(0),D=Math.sqrt(A*A/(R*R+N*N));O=Math.max(D,O)}z.r=O,O+=A}if(e.equidistant){for(var I=0,$=0,B=0;B=t.numIter||(HGe(n,t),n.temperature=n.temperature*t.coolingFactor,n.temperature=t.animationThreshold&&a(),f5(h)}};h()}else{for(;u;)u=s(l),l++;ree(n,t),o()}return this},j5.prototype.stop=function(){return this.stopped=!0,this.thread&&this.thread.stop(),this.emit("layoutstop"),this},j5.prototype.destroy=function(){return this.thread&&this.thread.stop(),this};var GGe=function(e,r,n){for(var i=n.eles.edges(),a=n.eles.nodes(),s=ja(n.boundingBox?n.boundingBox:{x1:0,y1:0,w:e.width(),h:e.height()}),o={isCompound:e.hasCompoundNodes(),layoutNodes:[],idToIndex:{},nodeSize:a.size(),graphSet:[],indexToGraph:[],layoutEdges:[],edgeSize:i.size(),temperature:n.initialTemp,clientWidth:s.w,clientHeight:s.h,boundingBox:s},l=n.eles.components(),u={},h=0;h0){o.graphSet.push(_);for(var h=0;h<_.length;h++)v[++b]=_[h]}}for(var h=0;hi.count?0:i.graph},QJ=function(e,r,n,i){var a=i.graphSet[n];if(-10)var d=i.nodeOverlap*h,f=Math.sqrt(o*o+l*l),p=d*o/f,g=d*l/f;else var m=Z5(e,o,l),y=Z5(r,-1*o,-1*l),v=y.x-m.x,T=y.y-m.y,b=v*v+T*T,f=Math.sqrt(b),d=(e.nodeRepulsion+r.nodeRepulsion)/b,p=d*v/f,g=d*T/f;e.isLocked||(e.offsetX-=p,e.offsetY-=g),r.isLocked||(r.offsetX+=p,r.offsetY+=g)}},KGe=function(e,r,n,i){if(n>0)var a=e.maxX-r.minX;else var a=r.maxX-e.minX;if(i>0)var s=e.maxY-r.minY;else var s=r.maxY-e.minY;return a>=0&&s>=0?Math.sqrt(a*a+s*s):0},Z5=function(e,r,n){var i=e.positionX,a=e.positionY,s=e.height||1,o=e.width||1,l=n/r,u=s/o,h={};return r===0&&0n?(h.x=i,h.y=a+s/2,h):0r&&-1*u<=l&&l<=u?(h.x=i-o/2,h.y=a-o*n/2/r,h):0=u)?(h.x=i+s*r/2/n,h.y=a+s/2,h):(0>n&&(l<=-1*u||l>=u)&&(h.x=i-s*r/2/n,h.y=a-s/2),h)},jGe=function(e,r){for(var n=0;nn){var y=r.gravity*p/m,v=r.gravity*g/m;f.offsetX+=y,f.offsetY+=v}}}}},QGe=function(e,r){var n=[],i=0,a=-1;for(n.push.apply(n,e.graphSet[0]),a+=e.graphSet[0].length;i<=a;){var s=n[i++],o=e.idToIndex[s],l=e.layoutNodes[o],u=l.children;if(0n)var a={x:n*e/i,y:n*r/i};else var a={x:e,y:r};return a},tee=function(e,r){var n=e.parentId;if(n!=null){var i=r.layoutNodes[r.idToIndex[n]],a=!1;if((i.maxX==null||e.maxX+i.padRight>i.maxX)&&(i.maxX=e.maxX+i.padRight,a=!0),(i.minX==null||e.minX-i.padLefti.maxY)&&(i.maxY=e.maxY+i.padBottom,a=!0),(i.minY==null||e.minY-i.padTopv&&(g+=y+r.componentSpacing,p=0,m=0,y=0)}}},tqe={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,avoidOverlapPadding:10,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,condense:!1,rows:void 0,cols:void 0,position:function(e){},sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}};function nee(t){this.options=yr({},tqe,t)}nee.prototype.run=function(){var t=this.options,e=t,r=t.cy,n=e.eles,i=n.nodes().not(":parent");e.sort&&(i=i.sort(e.sort));var a=ja(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()});if(a.h===0||a.w===0)n.nodes().layoutPositions(this,e,function(V){return{x:a.x1,y:a.y1}});else{var s=i.size(),o=Math.sqrt(s*a.h/a.w),l=Math.round(o),u=Math.round(a.w/a.h*o),h=function(Y){if(Y==null)return Math.min(l,u);var W=Math.min(l,u);W==l?l=Y:u=Y},d=function(Y){if(Y==null)return Math.max(l,u);var W=Math.max(l,u);W==l?l=Y:u=Y},f=e.rows,p=e.cols!=null?e.cols:e.columns;if(f!=null&&p!=null)l=f,u=p;else if(f!=null&&p==null)l=f,u=Math.ceil(s/l);else if(f==null&&p!=null)u=p,l=Math.ceil(s/u);else if(u*l>s){var g=h(),m=d();(g-1)*m>=s?h(g-1):(m-1)*g>=s&&d(m-1)}else for(;u*l=s?d(v+1):h(y+1)}var T=a.w/u,b=a.h/l;if(e.condense&&(T=0,b=0),e.avoidOverlap)for(var w=0;w=u&&(R=0,S++)},D={},I=0;I(R=VBe(t,e,N[D],N[D+1],N[D+2],N[D+3])))return y(C,R),!0}else if(L.edgeType==="bezier"||L.edgeType==="multibezier"||L.edgeType==="self"||L.edgeType==="compound"){for(var N=L.allpts,D=0;D+5(R=qBe(t,e,N[D],N[D+1],N[D+2],N[D+3],N[D+4],N[D+5])))return y(C,R),!0}for(var I=I||_.source,$=$||_.target,B=i.getArrowWidth(O,M),P=[{name:"source",x:L.arrowStartX,y:L.arrowStartY,angle:L.srcArrowAngle},{name:"target",x:L.arrowEndX,y:L.arrowEndY,angle:L.tgtArrowAngle},{name:"mid-source",x:L.midX,y:L.midY,angle:L.midsrcArrowAngle},{name:"mid-target",x:L.midX,y:L.midY,angle:L.midtgtArrowAngle}],D=0;D0&&(v(I),v($))}function b(C,_,L){return Ka(C,_,L)}function w(C,_){var L=C._private,O=f,M;_?M=_+"-":M="",C.boundingBox();var z=L.labelBounds[_||"main"],F=C.pstyle(M+"label").value,S=C.pstyle("text-events").strValue==="yes";if(!(!S||!F)){var R=b(L.rscratch,"labelX",_),N=b(L.rscratch,"labelY",_),D=b(L.rscratch,"labelAngle",_),I=C.pstyle(M+"text-margin-x").pfValue,$=C.pstyle(M+"text-margin-y").pfValue,B=z.x1-O-I,P=z.x2+O-I,G=z.y1-O-$,V=z.y2+O-$;if(D){var Y=Math.cos(D),W=Math.sin(D),ie=function(ue,fe){return ue=ue-R,fe=fe-N,{x:ue*Y-fe*W+R,y:ue*W+fe*Y+N}},K=ie(B,G),se=ie(B,V),J=ie(P,G),Z=ie(P,V),ee=[K.x+I,K.y+$,J.x+I,J.y+$,Z.x+I,Z.y+$,se.x+I,se.y+$];if(Cs(t,e,ee))return y(C),!0}else if(Qu(z,t,e))return y(C),!0}}for(var k=s.length-1;k>=0;k--){var A=s[k];A.isNode()?v(A)||w(A):T(A)||w(A)||w(A,"source")||w(A,"target")}return o},Pd.getAllInBox=function(t,e,r,n){var i=this.getCachedZSortedEles().interactive,a=this.cy.zoom(),s=2/a,o=[],l=Math.min(t,r),u=Math.max(t,r),h=Math.min(e,n),d=Math.max(e,n);t=l,r=u,e=h,n=d;var f=ja({x1:t,y1:e,x2:r,y2:n}),p=[{x:f.x1,y:f.y1},{x:f.x2,y:f.y1},{x:f.x2,y:f.y2},{x:f.x1,y:f.y2}],g=[[p[0],p[1]],[p[1],p[2]],[p[2],p[3]],[p[3],p[0]]];function m(ue,fe,_e){return Ka(ue,fe,_e)}function y(ue,fe){var _e=ue._private,Ae=s,Ne="";ue.boundingBox();var me=_e.labelBounds.main;if(!me)return null;var ve=m(_e.rscratch,"labelX",fe),Ge=m(_e.rscratch,"labelY",fe),Te=m(_e.rscratch,"labelAngle",fe),Ze=ue.pstyle(Ne+"text-margin-x").pfValue,ke=ue.pstyle(Ne+"text-margin-y").pfValue,Ve=me.x1-Ae-Ze,Qe=me.x2+Ae-Ze,nt=me.y1-Ae-ke,tt=me.y2+Ae-ke;if(Te){var je=Math.cos(Te),Ce=Math.sin(Te),Se=function(he,j){return he=he-ve,j=j-Ge,{x:he*je-j*Ce+ve,y:he*Ce+j*je+Ge}};return[Se(Ve,nt),Se(Qe,nt),Se(Qe,tt),Se(Ve,tt)]}else return[{x:Ve,y:nt},{x:Qe,y:nt},{x:Qe,y:tt},{x:Ve,y:tt}]}function v(ue,fe,_e,Ae){function Ne(me,ve,Ge){return(Ge.y-me.y)*(ve.x-me.x)>(ve.y-me.y)*(Ge.x-me.x)}return Ne(ue,_e,Ae)!==Ne(fe,_e,Ae)&&Ne(ue,fe,_e)!==Ne(ue,fe,Ae)}for(var T=0;T0?-(Math.PI-e.ang):Math.PI+e.ang},oqe=function(e,r,n,i,a){if(e!==fee?pee(r,e,Dl):sqe(po,Dl),pee(r,n,po),cee=Dl.nx*po.ny-Dl.ny*po.nx,uee=Dl.nx*po.nx-Dl.ny*-po.ny,Fc=Math.asin(Math.max(-1,Math.min(1,cee))),Math.abs(Fc)<1e-6){qL=r.x,VL=r.y,zd=Gp=0;return}Bd=1,J5=!1,uee<0?Fc<0?Fc=Math.PI+Fc:(Fc=Math.PI-Fc,Bd=-1,J5=!0):Fc>0&&(Bd=-1,J5=!0),r.radius!==void 0?Gp=r.radius:Gp=i,Fd=Fc/2,e3=Math.min(Dl.len/2,po.len/2),a?(Ml=Math.abs(Math.cos(Fd)*Gp/Math.sin(Fd)),Ml>e3?(Ml=e3,zd=Math.abs(Ml*Math.sin(Fd)/Math.cos(Fd))):zd=Gp):(Ml=Math.min(e3,Gp),zd=Math.abs(Ml*Math.sin(Fd)/Math.cos(Fd))),WL=r.x+po.nx*Ml,UL=r.y+po.ny*Ml,qL=WL-po.ny*zd*Bd,VL=UL+po.nx*zd*Bd,hee=r.x+Dl.nx*Ml,dee=r.y+Dl.ny*Ml,fee=r};function gee(t,e){e.radius===0?t.lineTo(e.cx,e.cy):t.arc(e.cx,e.cy,e.radius,e.startAngle,e.endAngle,e.counterClockwise)}function HL(t,e,r,n){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0;return n===0||e.radius===0?{cx:e.x,cy:e.y,radius:0,startX:e.x,startY:e.y,stopX:e.x,stopY:e.y,startAngle:void 0,endAngle:void 0,counterClockwise:void 0}:(oqe(t,e,r,n,i),{cx:qL,cy:VL,radius:zd,startX:hee,startY:dee,stopX:WL,stopY:UL,startAngle:Dl.ang+Math.PI/2*Bd,endAngle:po.ang-Math.PI/2*Bd,counterClockwise:J5})}var rx=.01,lqe=Math.sqrt(2*rx),Na={};Na.findMidptPtsEtc=function(t,e){var r=e.posPts,n=e.intersectionPts,i=e.vectorNormInverse,a,s=t.pstyle("source-endpoint"),o=t.pstyle("target-endpoint"),l=s.units!=null&&o.units!=null,u=function(k,A,C,_){var L=_-A,O=C-k,M=Math.sqrt(O*O+L*L);return{x:-L/M,y:O/M}},h=t.pstyle("edge-distances").value;switch(h){case"node-position":a=r;break;case"intersection":a=n;break;case"endpoints":{if(l){var d=this.manualEndptToPx(t.source()[0],s),f=Ri(d,2),p=f[0],g=f[1],m=this.manualEndptToPx(t.target()[0],o),y=Ri(m,2),v=y[0],T=y[1],b={x1:p,y1:g,x2:v,y2:T};i=u(p,g,v,T),a=b}else cn("Edge ".concat(t.id()," has edge-distances:endpoints specified without manual endpoints specified via source-endpoint and target-endpoint. Falling back on edge-distances:intersection (default).")),a=n;break}}return{midptPts:a,vectorNormInverse:i}},Na.findHaystackPoints=function(t){for(var e=0;e0?Math.max(j-pe,0):Math.min(j+pe,0)},F=z(O,_),S=z(M,L),R=!1;T===u?v=Math.abs(F)>Math.abs(S)?i:n:T===l||T===o?(v=n,R=!0):(T===a||T===s)&&(v=i,R=!0);var N=v===n,D=N?S:F,I=N?M:O,$=gR(I),B=!1;!(R&&(w||A))&&(T===o&&I<0||T===l&&I>0||T===a&&I>0||T===s&&I<0)&&($*=-1,D=$*Math.abs(D),B=!0);var P;if(w){var G=k<0?1+k:k;P=G*D}else{var V=k<0?D:0;P=V+k*$}var Y=function(j){return Math.abs(j)=Math.abs(D)},W=Y(P),ie=Y(Math.abs(D)-Math.abs(P)),K=W||ie;if(K&&!B)if(N){var se=Math.abs(I)<=f/2,J=Math.abs(O)<=p/2;if(se){var Z=(h.x1+h.x2)/2,ee=h.y1,ne=h.y2;r.segpts=[Z,ee,Z,ne]}else if(J){var ue=(h.y1+h.y2)/2,fe=h.x1,_e=h.x2;r.segpts=[fe,ue,_e,ue]}else r.segpts=[h.x1,h.y2]}else{var Ae=Math.abs(I)<=d/2,Ne=Math.abs(M)<=g/2;if(Ae){var me=(h.y1+h.y2)/2,ve=h.x1,Ge=h.x2;r.segpts=[ve,me,Ge,me]}else if(Ne){var Te=(h.x1+h.x2)/2,Ze=h.y1,ke=h.y2;r.segpts=[Te,Ze,Te,ke]}else r.segpts=[h.x2,h.y1]}else if(N){var Ve=h.y1+P+(y?f/2*$:0),Qe=h.x1,nt=h.x2;r.segpts=[Qe,Ve,nt,Ve]}else{var tt=h.x1+P+(y?d/2*$:0),je=h.y1,Ce=h.y2;r.segpts=[tt,je,tt,Ce]}if(r.isRound){var Se=t.pstyle("taxi-radius").value,H=t.pstyle("radius-type").value[0]==="arc-radius";r.radii=new Array(r.segpts.length/2).fill(Se),r.isArcRadius=new Array(r.segpts.length/2).fill(H)}},Na.tryToCorrectInvalidPoints=function(t,e){var r=t._private.rscratch;if(r.edgeType==="bezier"){var n=e.srcPos,i=e.tgtPos,a=e.srcW,s=e.srcH,o=e.tgtW,l=e.tgtH,u=e.srcShape,h=e.tgtShape,d=e.srcCornerRadius,f=e.tgtCornerRadius,p=e.srcRs,g=e.tgtRs,m=!Gt(r.startX)||!Gt(r.startY),y=!Gt(r.arrowStartX)||!Gt(r.arrowStartY),v=!Gt(r.endX)||!Gt(r.endY),T=!Gt(r.arrowEndX)||!Gt(r.arrowEndY),b=3,w=this.getArrowWidth(t.pstyle("width").pfValue,t.pstyle("arrow-scale").value)*this.arrowShapeWidth,k=b*w,A=Dd({x:r.ctrlpts[0],y:r.ctrlpts[1]},{x:r.startX,y:r.startY}),C=AI.poolIndex()){var $=D;D=I,I=$}var B=F.srcPos=D.position(),P=F.tgtPos=I.position(),G=F.srcW=D.outerWidth(),V=F.srcH=D.outerHeight(),Y=F.tgtW=I.outerWidth(),W=F.tgtH=I.outerHeight(),ie=F.srcShape=r.nodeShapes[e.getNodeShape(D)],K=F.tgtShape=r.nodeShapes[e.getNodeShape(I)],se=F.srcCornerRadius=D.pstyle("corner-radius").value==="auto"?"auto":D.pstyle("corner-radius").pfValue,J=F.tgtCornerRadius=I.pstyle("corner-radius").value==="auto"?"auto":I.pstyle("corner-radius").pfValue,Z=F.tgtRs=I._private.rscratch,ee=F.srcRs=D._private.rscratch;F.dirCounts={north:0,west:0,south:0,east:0,northwest:0,southwest:0,northeast:0,southeast:0};for(var ne=0;ne=lqe||(nt=Math.sqrt(Math.max(Qe*Qe,rx)+Math.max(Ve*Ve,rx)));var tt=F.vector={x:Qe,y:Ve},je=F.vectorNorm={x:tt.x/nt,y:tt.y/nt},Ce={x:-je.y,y:je.x};F.nodesOverlap=!Gt(nt)||K.checkPoint(me[0],me[1],0,Y,W,P.x,P.y,J,Z)||ie.checkPoint(Ge[0],Ge[1],0,G,V,B.x,B.y,se,ee),F.vectorNormInverse=Ce,S={nodesOverlap:F.nodesOverlap,dirCounts:F.dirCounts,calculatedIntersection:!0,hasBezier:F.hasBezier,hasUnbundled:F.hasUnbundled,eles:F.eles,srcPos:P,srcRs:Z,tgtPos:B,tgtRs:ee,srcW:Y,srcH:W,tgtW:G,tgtH:V,srcIntn:Te,tgtIntn:ve,srcShape:K,tgtShape:ie,posPts:{x1:ke.x2,y1:ke.y2,x2:ke.x1,y2:ke.y1},intersectionPts:{x1:Ze.x2,y1:Ze.y2,x2:Ze.x1,y2:Ze.y1},vector:{x:-tt.x,y:-tt.y},vectorNorm:{x:-je.x,y:-je.y},vectorNormInverse:{x:-Ce.x,y:-Ce.y}}}var Se=Ne?S:F;fe.nodesOverlap=Se.nodesOverlap,fe.srcIntn=Se.srcIntn,fe.tgtIntn=Se.tgtIntn,fe.isRound=_e.startsWith("round"),i&&(D.isParent()||D.isChild()||I.isParent()||I.isChild())&&(D.parents().anySame(I)||I.parents().anySame(D)||D.same(I)&&D.isParent())?e.findCompoundLoopPoints(ue,Se,ne,Ae):D===I?e.findLoopPoints(ue,Se,ne,Ae):_e.endsWith("segments")?e.findSegmentsPoints(ue,Se):_e.endsWith("taxi")?e.findTaxiPoints(ue,Se):_e==="straight"||!Ae&&F.eles.length%2===1&&ne===Math.floor(F.eles.length/2)?e.findStraightEdgePoints(ue):e.findBezierPoints(ue,Se,ne,Ae,Ne),e.findEndpoints(ue),e.tryToCorrectInvalidPoints(ue,Se),e.checkForInvalidEdgeWarning(ue),e.storeAllpts(ue),e.storeEdgeProjections(ue),e.calculateArrowAngles(ue),e.recalculateEdgeLabelProjections(ue),e.calculateLabelAngles(ue)}},C=0;C0){var me=u,ve=Md(me,kp(s)),Ge=Md(me,kp(Ne)),Te=ve;if(Ge2){var Ze=Md(me,{x:Ne[2],y:Ne[3]});Ze0){var re=h,Be=Md(re,kp(s)),xe=Md(re,kp(pe)),Ue=Be;if(xe2){var De=Md(re,{x:pe[2],y:pe[3]});De=g||C){y={cp:w,segment:A};break}}if(y)break}var _=y.cp,L=y.segment,O=(g-v)/L.length,M=L.t1-L.t0,z=p?L.t0+M*O:L.t1-M*O;z=Gb(0,z,1),e=Ep(_.p0,_.p1,_.p2,z),f=uqe(_.p0,_.p1,_.p2,z);break}case"straight":case"segments":case"haystack":{for(var F=0,S,R,N,D,I=n.allpts.length,$=0;$+3=g));$+=2);var B=g-R,P=B/S;P=Gb(0,P,1),e=IBe(N,D,P),f=vee(N,D);break}}s("labelX",d,e.x),s("labelY",d,e.y),s("labelAutoAngle",d,f)}};u("source"),u("target"),this.applyLabelDimensions(t)}},Nl.applyLabelDimensions=function(t){this.applyPrefixedLabelDimensions(t),t.isEdge()&&(this.applyPrefixedLabelDimensions(t,"source"),this.applyPrefixedLabelDimensions(t,"target"))},Nl.applyPrefixedLabelDimensions=function(t,e){var r=t._private,n=this.getLabelText(t,e),i=Id(n,t._private.labelDimsKey);if(Ka(r.rscratch,"prefixedLabelDimsKey",e)!==i){Ll(r.rscratch,"prefixedLabelDimsKey",e,i);var a=this.calculateLabelDimensions(t,n),s=t.pstyle("line-height").pfValue,o=t.pstyle("font-size").pfValue,l=t.pstyle("text-wrap").strValue,u=Ka(r.rscratch,"labelWrapCachedLines",e)||[],h=l!=="wrap"?1:Math.max(u.length,1),d=o*s,f=a.width,p=a.height+(h-1)*(s-1)*o;Ll(r.rstyle,"labelWidth",e,f),Ll(r.rscratch,"labelWidth",e,f),Ll(r.rstyle,"labelHeight",e,p),Ll(r.rscratch,"labelHeight",e,p),Ll(r.rscratch,"labelLineHeight",e,d),Ll(r.rscratch,"labelActualDescent",e,a.labelActualDescent)}},Nl.getLabelText=function(t,e){var r=t._private,n=e?e+"-":"",i=t.pstyle(n+"label").strValue,a=t.pstyle("text-transform").value,s=function(V,Y){return Y?(Ll(r.rscratch,V,e,Y),Y):Ka(r.rscratch,V,e)};if(!i)return"";a=="none"||(a=="uppercase"?i=i.toUpperCase():a=="lowercase"&&(i=i.toLowerCase()));var o=t.pstyle("text-wrap").value;if(o==="wrap"){var l=s("labelKey");if(l!=null&&s("labelWrapKey")===l)return s("labelWrapCachedText");for(var u="​",h=i.split(` -`),d=t.pstyle("text-max-width").pfValue,f=t.pstyle("text-overflow-wrap").value,p=f==="anywhere",g=[],m=/[\s\u200b]+|$/g,y=0;yd){var k=v.matchAll(m),A="",C=0,_=ws(k),L;try{for(_.s();!(L=_.n()).done;){var O=L.value,M=O[0],z=v.substring(C,O.index);C=O.index+M.length;var F=A.length===0?z:A+z+M,S=this.calculateLabelDimensions(t,F),R=S.width;R<=d?A+=z+M:(A&&g.push(A),A=z+M)}}catch(G){_.e(G)}finally{_.f()}A.match(/^[\s\u200b]+$/)||g.push(A)}else g.push(v)}s("labelWrapCachedLines",g),i=s("labelWrapCachedText",g.join(` -`)),s("labelWrapKey",l)}else if(o==="ellipsis"){var N=t.pstyle("text-max-width").pfValue,D="",I="…",$=!1;if(this.calculateLabelDimensions(t,i).widthN)break;D+=i[B],B===i.length-1&&($=!0)}return $||(D+=I),D}return i},Nl.getLabelJustification=function(t){var e=t.pstyle("text-justification").strValue,r=t.pstyle("text-halign").strValue;return e==="auto"?t.isNode()?Zze(r):"center":e},Nl.calculateLabelDimensions=function(t,e){var r=this,n=r.cy.window(),i=n.document,a=0,s=t.pstyle("font-style").strValue,o=t.pstyle("font-size").pfValue,l=t.pstyle("font-family").strValue,u=t.pstyle("font-weight").strValue,h=t.pstyle("text-metrics").strValue||"font",d=this.labelCalcCanvas,f=this.labelCalcCanvasContext;if(!d){d=this.labelCalcCanvas=i.createElement("canvas"),f=this.labelCalcCanvasContext=d.getContext("2d");var p=d.style;p.position="absolute",p.left="-9999px",p.top="-9999px",p.zIndex="-1",p.visibility="hidden",p.pointerEvents="none"}f.font="".concat(s," ").concat(u," ").concat(o,"px ").concat(l);for(var g=0,m=0,y=e.split(` -`),v=y.length,T=0,b=0,w=0;w1&&arguments[1]!==void 0?arguments[1]:!0;if(e.merge(s),o)for(var l=0;l=t.desktopTapThreshold2}var xt=a(H);lt&&(t.hoverData.tapholdCancelled=!0);var ht=function(){var Ft=t.hoverData.dragDelta=t.hoverData.dragDelta||[];Ft.length===0?(Ft.push(it[0]),Ft.push(it[1])):(Ft[0]+=it[0],Ft[1]+=it[1])};j=!0,i(Le,["mousemove","vmousemove","tapdrag"],H,{x:xe[0],y:xe[1]});var oe=function(Ft){return{originalEvent:H,type:Ft,position:{x:xe[0],y:xe[1]}}},At=function(){t.data.bgActivePosistion=void 0,t.hoverData.selecting||pe.emit(oe("boxstart")),qe[4]=1,t.hoverData.selecting=!0,t.redrawHint("select",!0),t.redraw()};if(t.hoverData.which===3){if(lt){var dt=oe("cxtdrag");Ie?Ie.emit(dt):pe.emit(dt),t.hoverData.cxtDragged=!0,(!t.hoverData.cxtOver||Le!==t.hoverData.cxtOver)&&(t.hoverData.cxtOver&&t.hoverData.cxtOver.emit(oe("cxtdragout")),t.hoverData.cxtOver=Le,Le&&Le.emit(oe("cxtdragover")))}}else if(t.hoverData.dragging){if(j=!0,pe.panningEnabled()&&pe.userPanningEnabled()){var ut;if(t.hoverData.justStartedPan){var wt=t.hoverData.mdownPos;ut={x:(xe[0]-wt[0])*re,y:(xe[1]-wt[1])*re},t.hoverData.justStartedPan=!1}else ut={x:it[0]*re,y:it[1]*re};pe.panBy(ut),pe.emit(oe("dragpan")),t.hoverData.dragged=!0}xe=t.projectIntoViewport(H.clientX,H.clientY)}else if(qe[4]==1&&(Ie==null||Ie.pannable())){if(lt){if(!t.hoverData.dragging&&pe.boxSelectionEnabled()&&(xt||!pe.panningEnabled()||!pe.userPanningEnabled()))At();else if(!t.hoverData.selecting&&pe.panningEnabled()&&pe.userPanningEnabled()){var Mr=s(Ie,t.hoverData.downs);Mr&&(t.hoverData.dragging=!0,t.hoverData.justStartedPan=!0,qe[4]=0,t.data.bgActivePosistion=kp(Ue),t.redrawHint("select",!0),t.redraw())}Ie&&Ie.pannable()&&Ie.active()&&Ie.unactivate()}}else{if(Ie&&Ie.pannable()&&Ie.active()&&Ie.unactivate(),(!Ie||!Ie.grabbed())&&Le!=Xe&&(Xe&&i(Xe,["mouseout","tapdragout"],H,{x:xe[0],y:xe[1]}),Le&&i(Le,["mouseover","tapdragover"],H,{x:xe[0],y:xe[1]}),t.hoverData.last=Le),Ie)if(lt){if(pe.boxSelectionEnabled()&&xt)Ie&&Ie.grabbed()&&(m(we),Ie.emit(oe("freeon")),we.emit(oe("free")),t.dragData.didDrag&&(Ie.emit(oe("dragfreeon")),we.emit(oe("dragfree")))),At();else if(Ie&&Ie.grabbed()&&t.nodeIsDraggable(Ie)){var ye=!t.dragData.didDrag;ye&&t.redrawHint("eles",!0),t.dragData.didDrag=!0,t.hoverData.draggingEles||p(we,{inDragLayer:!0});var et={x:0,y:0};if(Gt(it[0])&&Gt(it[1])&&(et.x+=it[0],et.y+=it[1],ye)){var ct=t.hoverData.dragDelta;ct&&Gt(ct[0])&&Gt(ct[1])&&(et.x+=ct[0],et.y+=ct[1])}t.hoverData.draggingEles=!0,we.silentShift(et).emit(oe("position")).emit(oe("drag")),t.redrawHint("drag",!0),t.redraw()}}else ht();j=!0}if(qe[2]=xe[0],qe[3]=xe[1],j)return H.stopPropagation&&H.stopPropagation(),H.preventDefault&&H.preventDefault(),!1}},!1);var O,M,z;t.registerBinding(e,"mouseup",function(H){if(!(t.hoverData.which===1&&H.which!==1&&t.hoverData.capture)){var he=t.hoverData.capture;if(he){t.hoverData.capture=!1;var j=t.cy,pe=t.projectIntoViewport(H.clientX,H.clientY),re=t.selection,Be=t.findNearestElement(pe[0],pe[1],!0,!1),xe=t.dragData.possibleDragElements,Ue=t.hoverData.down,De=a(H);t.data.bgActivePosistion&&(t.redrawHint("select",!0),t.redraw()),t.hoverData.tapholdCancelled=!0,t.data.bgActivePosistion=void 0,Ue&&Ue.unactivate();var qe=function(be){return{originalEvent:H,type:be,position:{x:pe[0],y:pe[1]}}};if(t.hoverData.which===3){var Le=qe("cxttapend");if(Ue?Ue.emit(Le):j.emit(Le),!t.hoverData.cxtDragged){var Xe=qe("cxttap");Ue?Ue.emit(Xe):j.emit(Xe)}t.hoverData.cxtDragged=!1,t.hoverData.which=null}else if(t.hoverData.which===1){if(i(Be,["mouseup","tapend","vmouseup"],H,{x:pe[0],y:pe[1]}),!t.dragData.didDrag&&!t.hoverData.dragged&&!t.hoverData.selecting&&!t.hoverData.isOverThresholdDrag&&(i(Ue,["click","tap","vclick"],H,{x:pe[0],y:pe[1]}),M=!1,H.timeStamp-z<=j.multiClickDebounceTime()?(O&&clearTimeout(O),M=!0,z=null,i(Ue,["dblclick","dbltap","vdblclick"],H,{x:pe[0],y:pe[1]})):(O=setTimeout(function(){M||i(Ue,["oneclick","onetap","voneclick"],H,{x:pe[0],y:pe[1]})},j.multiClickDebounceTime()),z=H.timeStamp)),Ue==null&&!t.dragData.didDrag&&!t.hoverData.selecting&&!t.hoverData.dragged&&!a(H)&&(j.$(r).unselect(["tapunselect"]),xe.length>0&&t.redrawHint("eles",!0),t.dragData.possibleDragElements=xe=j.collection()),Be==Ue&&!t.dragData.didDrag&&!t.hoverData.selecting&&Be!=null&&Be._private.selectable&&(t.hoverData.dragging||(j.selectionType()==="additive"||De?Be.selected()?Be.unselect(["tapunselect"]):Be.select(["tapselect"]):De||(j.$(r).unmerge(Be).unselect(["tapunselect"]),Be.select(["tapselect"]))),t.redrawHint("eles",!0)),t.hoverData.selecting){var Ie=j.collection(t.getAllInBox(re[0],re[1],re[2],re[3]));t.redrawHint("select",!0),Ie.length>0&&t.redrawHint("eles",!0),j.emit(qe("boxend"));var it=function(be){return be.selectable()&&!be.selected()};j.selectionType()==="additive"||De||j.$(r).unmerge(Ie).unselect(),Ie.emit(qe("box")).stdFilter(it).select().emit(qe("boxselect")),t.redraw()}if(t.hoverData.dragging&&(t.hoverData.dragging=!1,t.redrawHint("select",!0),t.redrawHint("eles",!0),t.redraw()),!re[4]){t.redrawHint("drag",!0),t.redrawHint("eles",!0);var we=Ue&&Ue.grabbed();m(xe),we&&(Ue.emit(qe("freeon")),xe.emit(qe("free")),t.dragData.didDrag&&(Ue.emit(qe("dragfreeon")),xe.emit(qe("dragfree"))))}}re[4]=0,t.hoverData.down=null,t.hoverData.cxtStarted=!1,t.hoverData.draggingEles=!1,t.hoverData.selecting=!1,t.hoverData.isOverThresholdDrag=!1,t.dragData.didDrag=!1,t.hoverData.dragged=!1,t.hoverData.dragDelta=[],t.hoverData.mdownPos=null,t.hoverData.mdownGPos=null,t.hoverData.which=null}}},!1);var F=[],S=4,R,N=1e5,D=function(H,he){for(var j=0;j=S){var pe=F;if(R=D(pe,5),!R){var re=Math.abs(pe[0]);R=I(pe)&&re>5}if(R)for(var Be=0;Be5&&(j=gR(j)*5),Xe=j/-250,R&&(Xe/=N,Xe*=3),Xe=Xe*t.wheelSensitivity;var Ie=H.deltaMode===1;Ie&&(Xe*=33);var it=xe.zoom()*Math.pow(10,Xe);H.type==="gesturechange"&&(it=t.gestureStartZoom*H.scale),xe.zoom({level:it,renderedPosition:{x:Le[0],y:Le[1]}}),xe.emit({type:H.type==="gesturechange"?"pinchzoom":"scrollzoom",originalEvent:H,position:{x:qe[0],y:qe[1]}})}}}};t.registerBinding(t.container,"wheel",$,!0),t.registerBinding(e,"scroll",function(H){t.scrollingPage=!0,clearTimeout(t.scrollingPageTimeout),t.scrollingPageTimeout=setTimeout(function(){t.scrollingPage=!1},250)},!0),t.registerBinding(t.container,"gesturestart",function(H){t.gestureStartZoom=t.cy.zoom(),t.hasTouchStarted||H.preventDefault()},!0),t.registerBinding(t.container,"gesturechange",function(Se){t.hasTouchStarted||$(Se)},!0),t.registerBinding(t.container,"mouseout",function(H){var he=t.projectIntoViewport(H.clientX,H.clientY);t.cy.emit({originalEvent:H,type:"mouseout",position:{x:he[0],y:he[1]}})},!1),t.registerBinding(t.container,"mouseover",function(H){var he=t.projectIntoViewport(H.clientX,H.clientY);t.cy.emit({originalEvent:H,type:"mouseover",position:{x:he[0],y:he[1]}})},!1);var B,P,G,V,Y,W,ie,K,se,J,Z,ee,ne,ue=function(H,he,j,pe){return Math.sqrt((j-H)*(j-H)+(pe-he)*(pe-he))},fe=function(H,he,j,pe){return(j-H)*(j-H)+(pe-he)*(pe-he)},_e;t.registerBinding(t.container,"touchstart",_e=function(H){if(t.hasTouchStarted=!0,!!_(H)){v(),t.touchData.capture=!0,t.data.bgActivePosistion=void 0;var he=t.cy,j=t.touchData.now,pe=t.touchData.earlier;if(H.touches[0]){var re=t.projectIntoViewport(H.touches[0].clientX,H.touches[0].clientY);j[0]=re[0],j[1]=re[1]}if(H.touches[1]){var re=t.projectIntoViewport(H.touches[1].clientX,H.touches[1].clientY);j[2]=re[0],j[3]=re[1]}if(H.touches[2]){var re=t.projectIntoViewport(H.touches[2].clientX,H.touches[2].clientY);j[4]=re[0],j[5]=re[1]}var Be=function(xt){return{originalEvent:H,type:xt,position:{x:j[0],y:j[1]}}};if(H.touches[1]){t.touchData.singleTouchMoved=!0,m(t.dragData.touchDragEles);var xe=t.findContainerClientCoords();se=xe[0],J=xe[1],Z=xe[2],ee=xe[3],B=H.touches[0].clientX-se,P=H.touches[0].clientY-J,G=H.touches[1].clientX-se,V=H.touches[1].clientY-J,ne=0<=B&&B<=Z&&0<=G&&G<=Z&&0<=P&&P<=ee&&0<=V&&V<=ee;var Ue=he.pan(),De=he.zoom();Y=ue(B,P,G,V),W=fe(B,P,G,V),ie=[(B+G)/2,(P+V)/2],K=[(ie[0]-Ue.x)/De,(ie[1]-Ue.y)/De];var qe=200,Le=qe*qe;if(W=1){for(var Et=t.touchData.startPosition=[null,null,null,null,null,null],vt=0;vt=t.touchTapThreshold2}if(he&&t.touchData.cxt){H.preventDefault();var vt=H.touches[0].clientX-se,ot=H.touches[0].clientY-J,It=H.touches[1].clientX-se,xt=H.touches[1].clientY-J,ht=fe(vt,ot,It,xt),oe=ht/W,At=150,dt=At*At,ut=1.5,wt=ut*ut;if(oe>=wt||ht>=dt){t.touchData.cxt=!1,t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var Mr=De("cxttapend");t.touchData.start?(t.touchData.start.unactivate().emit(Mr),t.touchData.start=null):pe.emit(Mr)}}if(he&&t.touchData.cxt){var Mr=De("cxtdrag");t.data.bgActivePosistion=void 0,t.redrawHint("select",!0),t.touchData.start?t.touchData.start.emit(Mr):pe.emit(Mr),t.touchData.start&&(t.touchData.start._private.grabbed=!1),t.touchData.cxtDragged=!0;var ye=t.findNearestElement(re[0],re[1],!0,!0);(!t.touchData.cxtOver||ye!==t.touchData.cxtOver)&&(t.touchData.cxtOver&&t.touchData.cxtOver.emit(De("cxtdragout")),t.touchData.cxtOver=ye,ye&&ye.emit(De("cxtdragover")))}else if(he&&H.touches[2]&&pe.boxSelectionEnabled())H.preventDefault(),t.data.bgActivePosistion=void 0,this.lastThreeTouch=+new Date,t.touchData.selecting||pe.emit(De("boxstart")),t.touchData.selecting=!0,t.touchData.didSelect=!0,j[4]=1,!j||j.length===0||j[0]===void 0?(j[0]=(re[0]+re[2]+re[4])/3,j[1]=(re[1]+re[3]+re[5])/3,j[2]=(re[0]+re[2]+re[4])/3+1,j[3]=(re[1]+re[3]+re[5])/3+1):(j[2]=(re[0]+re[2]+re[4])/3,j[3]=(re[1]+re[3]+re[5])/3),t.redrawHint("select",!0),t.redraw();else if(he&&H.touches[1]&&!t.touchData.didSelect&&pe.zoomingEnabled()&&pe.panningEnabled()&&pe.userZoomingEnabled()&&pe.userPanningEnabled()){H.preventDefault(),t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var et=t.dragData.touchDragEles;if(et){t.redrawHint("drag",!0);for(var ct=0;ct0&&!t.hoverData.draggingEles&&!t.swipePanning&&t.data.bgActivePosistion!=null&&(t.data.bgActivePosistion=void 0,t.redrawHint("select",!0),t.redraw())}},!1);var Ne;t.registerBinding(e,"touchcancel",Ne=function(H){var he=t.touchData.start;t.touchData.capture=!1,he&&he.unactivate()});var me,ve,Ge,Te;if(t.registerBinding(e,"touchend",me=function(H){var he=t.touchData.start,j=t.touchData.capture;if(j)H.touches.length===0&&(t.touchData.capture=!1),H.preventDefault();else return;var pe=t.selection;t.swipePanning=!1,t.hoverData.draggingEles=!1;var re=t.cy,Be=re.zoom(),xe=t.touchData.now,Ue=t.touchData.earlier;if(H.touches[0]){var De=t.projectIntoViewport(H.touches[0].clientX,H.touches[0].clientY);xe[0]=De[0],xe[1]=De[1]}if(H.touches[1]){var De=t.projectIntoViewport(H.touches[1].clientX,H.touches[1].clientY);xe[2]=De[0],xe[3]=De[1]}if(H.touches[2]){var De=t.projectIntoViewport(H.touches[2].clientX,H.touches[2].clientY);xe[4]=De[0],xe[5]=De[1]}var qe=function(dt){return{originalEvent:H,type:dt,position:{x:xe[0],y:xe[1]}}};he&&he.unactivate();var Le;if(t.touchData.cxt){if(Le=qe("cxttapend"),he?he.emit(Le):re.emit(Le),!t.touchData.cxtDragged){var Xe=qe("cxttap");he?he.emit(Xe):re.emit(Xe)}t.touchData.start&&(t.touchData.start._private.grabbed=!1),t.touchData.cxt=!1,t.touchData.start=null,t.redraw();return}if(!H.touches[2]&&re.boxSelectionEnabled()&&t.touchData.selecting){t.touchData.selecting=!1;var Ie=re.collection(t.getAllInBox(pe[0],pe[1],pe[2],pe[3]));pe[0]=void 0,pe[1]=void 0,pe[2]=void 0,pe[3]=void 0,pe[4]=0,t.redrawHint("select",!0),re.emit(qe("boxend"));var it=function(dt){return dt.selectable()&&!dt.selected()};Ie.emit(qe("box")).stdFilter(it).select().emit(qe("boxselect")),Ie.nonempty()&&t.redrawHint("eles",!0),t.redraw()}if(he!=null&&he.unactivate(),H.touches[2])t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);else if(!H.touches[1]){if(!H.touches[0]){if(!H.touches[0]){t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var we=t.dragData.touchDragEles;if(he!=null){var lt=he._private.grabbed;m(we),t.redrawHint("drag",!0),t.redrawHint("eles",!0),lt&&(he.emit(qe("freeon")),we.emit(qe("free")),t.dragData.didDrag&&(he.emit(qe("dragfreeon")),we.emit(qe("dragfree")))),i(he,["touchend","tapend","vmouseup","tapdragout"],H,{x:xe[0],y:xe[1]}),he.unactivate(),t.touchData.start=null}else{var be=t.findNearestElement(xe[0],xe[1],!0,!0);i(be,["touchend","tapend","vmouseup","tapdragout"],H,{x:xe[0],y:xe[1]})}var Et=t.touchData.startPosition[0]-xe[0],vt=Et*Et,ot=t.touchData.startPosition[1]-xe[1],It=ot*ot,xt=vt+It,ht=xt*Be*Be;t.touchData.singleTouchMoved||(he||re.$(":selected").unselect(["tapunselect"]),i(he,["tap","vclick"],H,{x:xe[0],y:xe[1]}),ve=!1,H.timeStamp-Te<=re.multiClickDebounceTime()?(Ge&&clearTimeout(Ge),ve=!0,Te=null,i(he,["dbltap","vdblclick"],H,{x:xe[0],y:xe[1]})):(Ge=setTimeout(function(){ve||i(he,["onetap","voneclick"],H,{x:xe[0],y:xe[1]})},re.multiClickDebounceTime()),Te=H.timeStamp)),he!=null&&!t.dragData.didDrag&&he._private.selectable&&ht"u"){var Ze=[],ke=function(H){return{clientX:H.clientX,clientY:H.clientY,force:1,identifier:H.pointerId,pageX:H.pageX,pageY:H.pageY,radiusX:H.width/2,radiusY:H.height/2,screenX:H.screenX,screenY:H.screenY,target:H.target}},Ve=function(H){return{event:H,touch:ke(H)}},Qe=function(H){Ze.push(Ve(H))},nt=function(H){for(var he=0;he0)return G[0]}return null},g=Object.keys(f),m=0;m0?p:OZ(a,s,e,r,n,i,o,l)},checkPoint:function(e,r,n,i,a,s,o,l){l=l==="auto"?eh(i,a):l;var u=2*l;if(Bc(e,r,this.points,s,o,i,a-u,[0,-1],n)||Bc(e,r,this.points,s,o,i-u,a,[0,-1],n))return!0;var h=i/2+2*n,d=a/2+2*n,f=[s-h,o-d,s-h,o,s+h,o,s+h,o-d];return!!(Cs(e,r,f)||Nd(e,r,u,u,s+i/2-l,o+a/2-l,n)||Nd(e,r,u,u,s-i/2+l,o+a/2-l,n))}}},zc.registerNodeShapes=function(){var t=this.nodeShapes={},e=this;this.generateEllipse(),this.generatePolygon("triangle",Za(3,0)),this.generateRoundPolygon("round-triangle",Za(3,0)),this.generatePolygon("rectangle",Za(4,0)),t.square=t.rectangle,this.generateRoundRectangle(),this.generateCutRectangle(),this.generateBarrel(),this.generateBottomRoundrectangle();{var r=[0,1,1,0,0,-1,-1,0];this.generatePolygon("diamond",r),this.generateRoundPolygon("round-diamond",r)}this.generatePolygon("pentagon",Za(5,0)),this.generateRoundPolygon("round-pentagon",Za(5,0)),this.generatePolygon("hexagon",Za(6,0)),this.generateRoundPolygon("round-hexagon",Za(6,0)),this.generatePolygon("heptagon",Za(7,0)),this.generateRoundPolygon("round-heptagon",Za(7,0)),this.generatePolygon("octagon",Za(8,0)),this.generateRoundPolygon("round-octagon",Za(8,0));var n=new Array(20);{var i=vR(5,0),a=vR(5,Math.PI/5),s=.5*(3-Math.sqrt(5));s*=1.57;for(var o=0;o=e.deqFastCost*w)break}else if(u){if(T>=e.deqCost*p||T>=e.deqAvgCost*f)break}else if(b>=e.deqNoDrawCost*XL)break;var k=e.deq(n,y,m);if(k.length>0)for(var A=0;A0&&(e.onDeqd(n,g),!u&&e.shouldRedraw(n,g,y,m)&&a())},o=e.priority||cR;i.beforeRender(s,o(n))}}}},pqe=(function(){function t(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:g5;Hu(this,t),this.idsByKey=new Pc,this.keyForId=new Pc,this.cachesByLvl=new Pc,this.lvls=[],this.getKey=e,this.doesEleInvalidateKey=r}return Yu(t,[{key:"getIdsFor",value:function(r){r==null&&Hn("Can not get id list for null key");var n=this.idsByKey,i=this.idsByKey.get(r);return i||(i=new Cp,n.set(r,i)),i}},{key:"addIdForKey",value:function(r,n){r!=null&&this.getIdsFor(r).add(n)}},{key:"deleteIdForKey",value:function(r,n){r!=null&&this.getIdsFor(r).delete(n)}},{key:"getNumberOfIdsForKey",value:function(r){return r==null?0:this.getIdsFor(r).size}},{key:"updateKeyMappingFor",value:function(r){var n=r.id(),i=this.keyForId.get(n),a=this.getKey(r);this.deleteIdForKey(i,n),this.addIdForKey(a,n),this.keyForId.set(n,a)}},{key:"deleteKeyMappingFor",value:function(r){var n=r.id(),i=this.keyForId.get(n);this.deleteIdForKey(i,n),this.keyForId.delete(n)}},{key:"keyHasChangedFor",value:function(r){var n=r.id(),i=this.keyForId.get(n),a=this.getKey(r);return i!==a}},{key:"isInvalid",value:function(r){return this.keyHasChangedFor(r)||this.doesEleInvalidateKey(r)}},{key:"getCachesAt",value:function(r){var n=this.cachesByLvl,i=this.lvls,a=n.get(r);return a||(a=new Pc,n.set(r,a),i.push(r)),a}},{key:"getCache",value:function(r,n){return this.getCachesAt(n).get(r)}},{key:"get",value:function(r,n){var i=this.getKey(r),a=this.getCache(i,n);return a!=null&&this.updateKeyMappingFor(r),a}},{key:"getForCachedKey",value:function(r,n){var i=this.keyForId.get(r.id()),a=this.getCache(i,n);return a}},{key:"hasCache",value:function(r,n){return this.getCachesAt(n).has(r)}},{key:"has",value:function(r,n){var i=this.getKey(r);return this.hasCache(i,n)}},{key:"setCache",value:function(r,n,i){i.key=r,this.getCachesAt(n).set(r,i)}},{key:"set",value:function(r,n,i){var a=this.getKey(r);this.setCache(a,n,i),this.updateKeyMappingFor(r)}},{key:"deleteCache",value:function(r,n){this.getCachesAt(n).delete(r)}},{key:"delete",value:function(r,n){var i=this.getKey(r);this.deleteCache(i,n)}},{key:"invalidateKey",value:function(r){var n=this;this.lvls.forEach(function(i){return n.deleteCache(r,i)})}},{key:"invalidate",value:function(r){var n=r.id(),i=this.keyForId.get(n);this.deleteKeyMappingFor(r);var a=this.doesEleInvalidateKey(r);return a&&this.invalidateKey(i),a||this.getNumberOfIdsForKey(i)===0}}])})(),_ee=25,n3=50,i3=-4,KL=3,Ree=7.99,gqe=8,mqe=1024,yqe=1024,vqe=1024,bqe=.2,xqe=.8,Tqe=10,wqe=.15,Cqe=.1,kqe=.9,Eqe=.9,Sqe=100,Aqe=1,Wp={dequeue:"dequeue",downscale:"downscale",highQuality:"highQuality"},_qe=ha({getKey:null,doesEleInvalidateKey:g5,drawElement:null,getBoundingBox:null,getRotationPoint:null,getRotationOffset:null,isVisible:wZ,allowEdgeTxrCaching:!0,allowParentTxrCaching:!0}),ax=function(e,r){var n=this;n.renderer=e,n.onDequeues=[];var i=_qe(r);yr(n,i),n.lookup=new pqe(i.getKey,i.doesEleInvalidateKey),n.setupDequeueing()},qi=ax.prototype;qi.reasons=Wp,qi.getTextureQueue=function(t){var e=this;return e.eleImgCaches=e.eleImgCaches||{},e.eleImgCaches[t]=e.eleImgCaches[t]||[]},qi.getRetiredTextureQueue=function(t){var e=this,r=e.eleImgCaches.retired=e.eleImgCaches.retired||{},n=r[t]=r[t]||[];return n},qi.getElementQueue=function(){var t=this,e=t.eleCacheQueue=t.eleCacheQueue||new zb(function(r,n){return n.reqs-r.reqs});return e},qi.getElementKeyToQueue=function(){var t=this,e=t.eleKeyToCacheQueue=t.eleKeyToCacheQueue||{};return e},qi.getElement=function(t,e,r,n,i){var a=this,s=this.renderer,o=s.cy.zoom(),l=this.lookup;if(!e||e.w===0||e.h===0||isNaN(e.w)||isNaN(e.h)||!t.visible()||t.removed()||!a.allowEdgeTxrCaching&&t.isEdge()||!a.allowParentTxrCaching&&t.isParent())return null;if(n==null&&(n=Math.ceil(pR(o*r))),n=Ree||n>KL)return null;var u=Math.pow(2,n),h=e.h*u,d=e.w*u,f=s.eleTextBiggerThanMin(t,u);if(!this.isVisible(t,f))return null;var p=l.get(t,n);if(p&&p.invalidated&&(p.invalidated=!1,p.texture.invalidatedWidth-=p.width),p)return p;var g;if(h<=_ee?g=_ee:h<=n3?g=n3:g=Math.ceil(h/n3)*n3,h>vqe||d>yqe)return null;var m=a.getTextureQueue(g),y=m[m.length-2],v=function(){return a.recycleTexture(g,d)||a.addTexture(g,d)};y||(y=m[m.length-1]),y||(y=v()),y.width-y.usedWidthn;M--)L=a.getElement(t,e,r,M,Wp.downscale);O()}else return a.queueElement(t,A.level-1),A;else{var z;if(!b&&!w&&!k)for(var F=n-1;F>=i3;F--){var S=l.get(t,F);if(S){z=S;break}}if(T(z))return a.queueElement(t,n),z;y.context.translate(y.usedWidth,0),y.context.scale(u,u),this.drawElement(y.context,t,e,f,!1),y.context.scale(1/u,1/u),y.context.translate(-y.usedWidth,0)}return p={x:y.usedWidth,texture:y,level:n,scale:u,width:d,height:h,scaledLabelShown:f},y.usedWidth+=Math.ceil(d+gqe),y.eleCaches.push(p),l.set(t,n,p),a.checkTextureFullness(y),p},qi.invalidateElements=function(t){for(var e=0;e=bqe*t.width&&this.retireTexture(t)},qi.checkTextureFullness=function(t){var e=this,r=e.getTextureQueue(t.height);t.usedWidth/t.width>xqe&&t.fullnessChecks>=Tqe?Zu(r,t):t.fullnessChecks++},qi.retireTexture=function(t){var e=this,r=t.height,n=e.getTextureQueue(r),i=this.lookup;Zu(n,t),t.retired=!0;for(var a=t.eleCaches,s=0;s=e)return s.retired=!1,s.usedWidth=0,s.invalidatedWidth=0,s.fullnessChecks=0,uR(s.eleCaches),s.context.setTransform(1,0,0,1,0,0),s.context.clearRect(0,0,s.width,s.height),Zu(i,s),n.push(s),s}},qi.queueElement=function(t,e){var r=this,n=r.getElementQueue(),i=r.getElementKeyToQueue(),a=this.getKey(t),s=i[a];if(s)s.level=Math.max(s.level,e),s.eles.merge(t),s.reqs++,n.updateItem(s);else{var o={eles:t.spawn().merge(t),level:e,reqs:1,key:a};n.push(o),i[a]=o}},qi.dequeue=function(t){for(var e=this,r=e.getElementQueue(),n=e.getElementKeyToQueue(),i=[],a=e.lookup,s=0;s0;s++){var o=r.pop(),l=o.key,u=o.eles[0],h=a.hasCache(u,o.level);if(n[l]=null,h)continue;i.push(o);var d=e.getBoundingBox(u);e.getElement(u,d,t,o.level,Wp.dequeue)}return i},qi.removeFromQueue=function(t){var e=this,r=e.getElementQueue(),n=e.getElementKeyToQueue(),i=this.getKey(t),a=n[i];a!=null&&(a.eles.length===1?(a.reqs=lR,r.updateItem(a),r.pop(),n[i]=null):a.eles.unmerge(t))},qi.onDequeue=function(t){this.onDequeues.push(t)},qi.offDequeue=function(t){Zu(this.onDequeues,t)},qi.setupDequeueing=Aee.setupDequeueing({deqRedrawThreshold:Sqe,deqCost:wqe,deqAvgCost:Cqe,deqNoDrawCost:kqe,deqFastCost:Eqe,deq:function(e,r,n){return e.dequeue(r,n)},onDeqd:function(e,r){for(var n=0;n=Lqe||r>a3)return null}n.validateLayersElesOrdering(r,t);var l=n.layersByLevel,u=Math.pow(2,r),h=l[r]=l[r]||[],d,f=n.levelIsComplete(r,t),p,g=function(){var O=function(R){if(n.validateLayersElesOrdering(R,t),n.levelIsComplete(R,t))return p=l[R],!0},M=function(R){if(!p)for(var N=r+R;sx<=N&&N<=a3&&!O(N);N+=R);};M(1),M(-1);for(var z=h.length-1;z>=0;z--){var F=h[z];F.invalid&&Zu(h,F)}};if(!f)g();else return h;var m=function(){if(!d){d=ja();for(var O=0;OIee||F>Iee)return null;var S=z*F;if(S>Bqe)return null;var R=n.makeLayer(d,r);if(M!=null){var N=h.indexOf(M)+1;h.splice(N,0,R)}else(O.insert===void 0||O.insert)&&h.unshift(R);return R};if(n.skipping&&!o)return null;for(var v=null,T=t.length/Rqe,b=!o,w=0;w=T||!NZ(v.bb,k.boundingBox()))&&(v=y({insert:!0,after:v}),!v))return null;p||b?n.queueLayer(v,k):n.drawEleInLayer(v,k,r,e),v.eles.push(k),C[r]=v}return p||(b?null:h)},pa.getEleLevelForLayerLevel=function(t,e){return t},pa.drawEleInLayer=function(t,e,r,n){var i=this,a=this.renderer,s=t.context,o=e.boundingBox();o.w===0||o.h===0||!e.visible()||(r=i.getEleLevelForLayerLevel(r,n),a.setImgSmoothing(s,!1),a.drawCachedElement(s,e,null,null,r,Fqe),a.setImgSmoothing(s,!0))},pa.levelIsComplete=function(t,e){var r=this,n=r.layersByLevel[t];if(!n||n.length===0)return!1;for(var i=0,a=0;a0||s.invalid)return!1;i+=s.eles.length}return i===e.length},pa.validateLayersElesOrdering=function(t,e){var r=this.layersByLevel[t];if(r)for(var n=0;n0){e=!0;break}}return e},pa.invalidateElements=function(t){var e=this;t.length!==0&&(e.lastInvalidationTime=$c(),!(t.length===0||!e.haveLayers())&&e.updateElementsInLayers(t,function(n,i,a){e.invalidateLayer(n)}))},pa.invalidateLayer=function(t){if(this.lastInvalidationTime=$c(),!t.invalid){var e=t.level,r=t.eles,n=this.layersByLevel[e];Zu(n,t),t.elesQueue=[],t.invalid=!0,t.replacement&&(t.replacement.invalid=!0);for(var i=0;i3&&arguments[3]!==void 0?arguments[3]:!0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,s=this,o=e._private.rscratch;if(!(a&&!e.visible())&&!(o.badLine||o.allpts==null||isNaN(o.allpts[0]))){var l;r&&(l=r,t.translate(-l.x1,-l.y1));var u=a?e.pstyle("opacity").value:1,h=a?e.pstyle("line-opacity").value:1,d=e.pstyle("curve-style").value,f=e.pstyle("line-style").value,p=e.pstyle("width").pfValue,g=e.pstyle("line-cap").value,m=e.pstyle("line-outline-width").value,y=e.pstyle("line-outline-color").value,v=u*h,T=u*h,b=function(){var R=arguments.length>0&&arguments[0]!==void 0?arguments[0]:v;d==="straight-triangle"?(s.eleStrokeStyle(t,e,R),s.drawEdgeTrianglePath(e,t,o.allpts)):(t.lineWidth=p,t.lineCap=g,s.eleStrokeStyle(t,e,R),s.drawEdgePath(e,t,o.allpts,f),t.lineCap="butt")},w=function(){var R=arguments.length>0&&arguments[0]!==void 0?arguments[0]:v;if(t.lineWidth=p+m,t.lineCap=g,m>0)s.colorStrokeStyle(t,y[0],y[1],y[2],R);else{t.lineCap="butt";return}d==="straight-triangle"?s.drawEdgeTrianglePath(e,t,o.allpts):(s.drawEdgePath(e,t,o.allpts,f),t.lineCap="butt")},k=function(){i&&s.drawEdgeOverlay(t,e)},A=function(){i&&s.drawEdgeUnderlay(t,e)},C=function(){var R=arguments.length>0&&arguments[0]!==void 0?arguments[0]:T;s.drawArrowheads(t,e,R)},_=function(){s.drawElementText(t,e,null,n)};t.lineJoin="round";var L=e.pstyle("ghost").value==="yes";if(L){var O=e.pstyle("ghost-offset-x").pfValue,M=e.pstyle("ghost-offset-y").pfValue,z=e.pstyle("ghost-opacity").value,F=v*z;t.translate(O,M),b(F),C(F),t.translate(-O,-M)}else w();A(),b(),C(),k(),_(),r&&t.translate(l.x1,l.y1)}};var Pee=function(e){if(!["overlay","underlay"].includes(e))throw new Error("Invalid state");return function(r,n){if(n.visible()){var i=n.pstyle("".concat(e,"-opacity")).value;if(i!==0){var a=this,s=a.usePaths(),o=n._private.rscratch,l=n.pstyle("".concat(e,"-padding")).pfValue,u=2*l,h=n.pstyle("".concat(e,"-color")).value;r.lineWidth=u,o.edgeType==="self"&&!s?r.lineCap="butt":r.lineCap="round",a.colorStrokeStyle(r,h[0],h[1],h[2],i),a.drawEdgePath(n,r,o.allpts,"solid")}}}};Gc.drawEdgeOverlay=Pee("overlay"),Gc.drawEdgeUnderlay=Pee("underlay"),Gc.drawEdgePath=function(t,e,r,n){var i=t._private.rscratch,a=e,s,o=!1,l=this.usePaths(),u=t.pstyle("line-dash-pattern").pfValue,h=t.pstyle("line-dash-offset").pfValue;if(l){var d=r.join("$"),f=i.pathCacheKey&&i.pathCacheKey===d;f?(s=e=i.pathCache,o=!0):(s=e=new Path2D,i.pathCacheKey=d,i.pathCache=s)}if(a.setLineDash)switch(n){case"dotted":a.setLineDash([1,1]);break;case"dashed":a.setLineDash(u),a.lineDashOffset=h;break;case"solid":a.setLineDash([]);break}if(!o&&!i.badLine)switch(e.beginPath&&e.beginPath(),e.moveTo(r[0],r[1]),i.edgeType){case"bezier":case"self":case"compound":case"multibezier":for(var p=2;p+35&&arguments[5]!==void 0?arguments[5]:!0,s=this;if(n==null){if(a&&!s.eleTextBiggerThanMin(e))return}else if(n===!1)return;if(e.isNode()){var o=e.pstyle("label");if(!o||!o.value)return;var l=s.getLabelJustification(e),u=e.pstyle("text-metrics").strValue==="glyph";t.textAlign=l,t.textBaseline=u?"alphabetic":"bottom"}else{var h=e.element()._private.rscratch.badLine,d=e.pstyle("label"),f=e.pstyle("source-label"),p=e.pstyle("target-label");if(h||(!d||!d.value)&&(!f||!f.value)&&(!p||!p.value))return;t.textAlign="center",t.textBaseline="bottom"}var g=!r,m;r&&(m=r,t.translate(-m.x1,-m.y1)),i==null?(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),r&&t.translate(m.x1,m.y1)},Gd.getFontCache=function(t){var e;this.fontCaches=this.fontCaches||[];for(var r=0;r2&&arguments[2]!==void 0?arguments[2]:!0,n=e.pstyle("font-style").strValue,i=e.pstyle("font-size").pfValue+"px",a=e.pstyle("font-family").strValue,s=e.pstyle("font-weight").strValue,o=r?e.effectiveOpacity()*e.pstyle("text-opacity").value:1,l=e.pstyle("text-outline-opacity").value*o,u=e.pstyle("color").value,h=e.pstyle("text-outline-color").value;t.font=n+" "+s+" "+i+" "+a,t.lineJoin="round",this.colorFillStyle(t,u[0],u[1],u[2],o),this.colorStrokeStyle(t,h[0],h[1],h[2],l)};function jqe(t,e,r,n,i){var a=Math.min(n,i),s=a/2,o=e+n/2,l=r+i/2;t.beginPath(),t.arc(o,l,s,0,Math.PI*2),t.closePath()}function Bee(t,e,r,n,i){var a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:5,s=Math.min(a,n/2,i/2);t.beginPath(),t.moveTo(e+s,r),t.lineTo(e+n-s,r),t.quadraticCurveTo(e+n,r,e+n,r+s),t.lineTo(e+n,r+i-s),t.quadraticCurveTo(e+n,r+i,e+n-s,r+i),t.lineTo(e+s,r+i),t.quadraticCurveTo(e,r+i,e,r+i-s),t.lineTo(e,r+s),t.quadraticCurveTo(e,r,e+s,r),t.closePath()}Gd.getTextAngle=function(t,e){var r,n=t._private,i=n.rscratch,a=e?e+"-":"",s=t.pstyle(a+"text-rotation");if(s.strValue==="autorotate"){var o=Ka(i,"labelAngle",e);r=t.isEdge()?o:0}else s.strValue==="none"?r=0:r=s.pfValue;return r},Gd.drawText=function(t,e,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,a=e._private,s=a.rscratch,o=i?e.effectiveOpacity():1;if(!(i&&(o===0||e.pstyle("text-opacity").value===0))){r==="main"&&(r=null);var l=Ka(s,"labelX",r),u=Ka(s,"labelY",r),h,d,f=this.getLabelText(e,r);if(f!=null&&f!==""&&!isNaN(l)&&!isNaN(u)){this.setupTextStyle(t,e,i);var p=r?r+"-":"",g=Ka(s,"labelWidth",r),m=Ka(s,"labelHeight",r),y=Ka(s,"labelActualDescent",r),v=e.pstyle(p+"text-margin-x").pfValue,T=e.pstyle(p+"text-margin-y").pfValue,b=e.isEdge(),w=e.pstyle("text-halign").value,k=e.pstyle("text-valign").value;b&&(w="center",k="center"),l+=v,u+=T;var A;n?A=this.getTextAngle(e,r):A=0,A!==0&&(h=l,d=u,t.translate(h,d),t.rotate(A),l=0,u=0);var C=Np(w),_=Op(k);switch(_){case"top":break;case"center":u+=m/2;break;case"bottom":u+=m;break}var L=e.pstyle("text-background-opacity").value,O=e.pstyle("text-border-opacity").value,M=e.pstyle("text-border-width").pfValue,z=e.pstyle("text-background-padding").pfValue,F=e.pstyle("text-background-shape").strValue,S=F==="round-rectangle"||F==="roundrectangle",R=F==="circle",N=2;if(L>0||M>0&&O>0){var D=t.fillStyle,I=t.strokeStyle,$=t.lineWidth,B=e.pstyle("text-background-color").value,P=e.pstyle("text-border-color").value,G=e.pstyle("text-border-style").value,V=L>0,Y=M>0&&O>0,W=l-z;switch(C){case"left":W-=g;break;case"center":W-=g/2;break}var ie=u-m-z,K=g+2*z,se=m+2*z;if(V&&(t.fillStyle="rgba(".concat(B[0],",").concat(B[1],",").concat(B[2],",").concat(L*o,")")),Y&&(t.strokeStyle="rgba(".concat(P[0],",").concat(P[1],",").concat(P[2],",").concat(O*o,")"),t.lineWidth=M,t.setLineDash))switch(G){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash([4,2]);break;case"double":t.lineWidth=M/4,t.setLineDash([]);break;case"solid":default:t.setLineDash([]);break}if(S?(t.beginPath(),Bee(t,W,ie,K,se,N)):R?(t.beginPath(),jqe(t,W,ie,K,se)):(t.beginPath(),t.rect(W,ie,K,se)),V&&t.fill(),Y&&t.stroke(),Y&&G==="double"){var J=M/2;t.beginPath(),S?Bee(t,W+J,ie+J,K-2*J,se-2*J,N):t.rect(W+J,ie+J,K-2*J,se-2*J),t.stroke()}t.fillStyle=D,t.strokeStyle=I,t.lineWidth=$,t.setLineDash&&t.setLineDash([])}var Z=2*e.pstyle("text-outline-width").pfValue;if(Z>0&&(t.lineWidth=Z),u-=y,e.pstyle("text-wrap").value==="wrap"){var ee=Ka(s,"labelWrapCachedLines",r),ne=Ka(s,"labelLineHeight",r),ue=g/2,fe=this.getLabelJustification(e);switch(fe==="auto"||(C==="left"?fe==="left"?l+=-g:fe==="center"&&(l+=-ue):C==="center"?fe==="left"?l+=-ue:fe==="right"&&(l+=ue):C==="right"&&(fe==="center"?l+=ue:fe==="right"&&(l+=g))),_){case"top":u-=(ee.length-1)*ne;break;case"center":case"bottom":u-=(ee.length-1)*ne;break}for(var _e=0;_e0&&t.strokeText(ee[_e],l,u),t.fillText(ee[_e],l,u),u+=ne}else Z>0&&t.strokeText(f,l,u),t.fillText(f,l,u);A!==0&&(t.rotate(-A),t.translate(-h,-d))}}};var ch={};ch.drawNode=function(t,e,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,s=this,o,l,u=e._private,h=u.rscratch,d=e.position();if(!(!Gt(d.x)||!Gt(d.y))&&!(a&&!e.visible())){var f=a?e.effectiveOpacity():1,p=s.usePaths(),g,m=!1,y=e.padding();o=e.width()+2*y,l=e.height()+2*y;var v;r&&(v=r,t.translate(-v.x1,-v.y1));for(var T=e.pstyle("background-image"),b=T.value,w=new Array(b.length),k=new Array(b.length),A=0,C=0;C0&&arguments[0]!==void 0?arguments[0]:F;s.eleFillStyle(t,e,H)},J=function(){var H=arguments.length>0&&arguments[0]!==void 0?arguments[0]:P;s.colorStrokeStyle(t,S[0],S[1],S[2],H)},Z=function(){var H=arguments.length>0&&arguments[0]!==void 0?arguments[0]:W;s.colorStrokeStyle(t,V[0],V[1],V[2],H)},ee=function(H,he,j,pe){var re=s.nodePathCache=s.nodePathCache||[],Be=xZ(j==="polygon"?j+","+pe.join(","):j,""+he,""+H,""+K),xe=re[Be],Ue,De=!1;return xe!=null?(Ue=xe,De=!0,h.pathCache=Ue):(Ue=new Path2D,re[Be]=h.pathCache=Ue),{path:Ue,cacheHit:De}},ne=e.pstyle("shape").strValue,ue=e.pstyle("shape-polygon-points").pfValue;if(p){t.translate(d.x,d.y);var fe=ee(o,l,ne,ue);g=fe.path,m=fe.cacheHit}var _e=function(){if(!m){var H=d;p&&(H={x:0,y:0}),s.nodeShapes[s.getNodeShape(e)].draw(g||t,H.x,H.y,o,l,K,h)}p?t.fill(g):t.fill()},Ae=function(){for(var H=arguments.length>0&&arguments[0]!==void 0?arguments[0]:f,he=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,j=u.backgrounding,pe=0,re=0;re0&&arguments[0]!==void 0?arguments[0]:!1,he=arguments.length>1&&arguments[1]!==void 0?arguments[1]:f;s.hasPie(e)&&(s.drawPie(t,e,he),H&&(p||s.nodeShapes[s.getNodeShape(e)].draw(t,d.x,d.y,o,l,K,h)))},me=function(){var H=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,he=arguments.length>1&&arguments[1]!==void 0?arguments[1]:f;s.hasStripe(e)&&(t.save(),p?t.clip(h.pathCache):(s.nodeShapes[s.getNodeShape(e)].draw(t,d.x,d.y,o,l,K,h),t.clip()),s.drawStripe(t,e,he),t.restore(),H&&(p||s.nodeShapes[s.getNodeShape(e)].draw(t,d.x,d.y,o,l,K,h)))},ve=function(){var H=arguments.length>0&&arguments[0]!==void 0?arguments[0]:f,he=(M>0?M:-M)*H,j=M>0?0:255;M!==0&&(s.colorFillStyle(t,j,j,j,he),p?t.fill(g):t.fill())},Ge=function(){if(z>0){if(t.lineWidth=z,t.lineCap=D,t.lineJoin=N,t.setLineDash)switch(R){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash($),t.lineDashOffset=B;break;case"solid":case"double":t.setLineDash([]);break}if(I!=="center"){if(t.save(),t.lineWidth*=2,I==="inside")p?t.clip(g):t.clip();else{var H=new Path2D;H.rect(-o/2-z,-l/2-z,o+2*z,l+2*z),H.addPath(g),t.clip(H,"evenodd")}p?t.stroke(g):t.stroke(),t.restore()}else p?t.stroke(g):t.stroke();if(R==="double"){t.lineWidth=z/3;var he=t.globalCompositeOperation;t.globalCompositeOperation="destination-out",p?t.stroke(g):t.stroke(),t.globalCompositeOperation=he}t.setLineDash&&t.setLineDash([])}},Te=function(){if(G>0){if(t.lineWidth=G,t.lineCap="butt",t.setLineDash)switch(Y){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash([4,2]);break;case"solid":case"double":t.setLineDash([]);break}var H=d;p&&(H={x:0,y:0});var he=s.getNodeShape(e),j=z;I==="inside"&&(j=0),I==="outside"&&(j*=2);var pe=(o+j+(G+ie))/o,re=(l+j+(G+ie))/l,Be=o*pe,xe=l*re,Ue=s.nodeShapes[he].points,De;if(p){var qe=ee(Be,xe,he,Ue);De=qe.path}if(he==="ellipse")s.drawEllipsePath(De||t,H.x,H.y,Be,xe);else if(["round-diamond","round-heptagon","round-hexagon","round-octagon","round-pentagon","round-polygon","round-triangle","round-tag"].includes(he)){var Le=0,Xe=0,Ie=0;he==="round-diamond"?Le=(j+ie+G)*1.4:he==="round-heptagon"?(Le=(j+ie+G)*1.075,Ie=-(j/2+ie+G)/35):he==="round-hexagon"?Le=(j+ie+G)*1.12:he==="round-pentagon"?(Le=(j+ie+G)*1.13,Ie=-(j/2+ie+G)/15):he==="round-tag"?(Le=(j+ie+G)*1.12,Xe=(j/2+G+ie)*.07):he==="round-triangle"&&(Le=(j+ie+G)*(Math.PI/2),Ie=-(j+ie/2+G)/Math.PI),Le!==0&&(pe=(o+Le)/o,Be=o*pe,["round-hexagon","round-tag"].includes(he)||(re=(l+Le)/l,xe=l*re)),K=K==="auto"?PZ(Be,xe):K;for(var it=Be/2,we=xe/2,lt=K+(j+G+ie)/2,be=new Array(Ue.length/2),Et=new Array(Ue.length/2),vt=0;vt0){if(i=i||n.position(),a==null||s==null){var p=n.padding();a=n.width()+2*p,s=n.height()+2*p}o.colorFillStyle(r,h[0],h[1],h[2],u),o.nodeShapes[d].draw(r,i.x,i.y,a+l*2,s+l*2,f),r.fill()}}}};ch.drawNodeOverlay=Fee("overlay"),ch.drawNodeUnderlay=Fee("underlay"),ch.hasPie=function(t){return t=t[0],t._private.hasPie},ch.hasStripe=function(t){return t=t[0],t._private.hasStripe},ch.drawPie=function(t,e,r,n){e=e[0],n=n||e.position();var i=e.cy().style(),a=e.pstyle("pie-size"),s=e.pstyle("pie-hole"),o=e.pstyle("pie-start-angle").pfValue,l=n.x,u=n.y,h=e.width(),d=e.height(),f=Math.min(h,d)/2,p,g=0,m=this.usePaths();if(m&&(l=0,u=0),a.units==="%"?f=f*a.pfValue:a.pfValue!==void 0&&(f=a.pfValue/2),s.units==="%"?p=f*s.pfValue:s.pfValue!==void 0&&(p=s.pfValue/2),!(p>=f))for(var y=1;y<=i.pieBackgroundN;y++){var v=e.pstyle("pie-"+y+"-background-size").value,T=e.pstyle("pie-"+y+"-background-color").value,b=e.pstyle("pie-"+y+"-background-opacity").value*r,w=v/100;w+g>1&&(w=1-g);var k=1.5*Math.PI+2*Math.PI*g;k+=o;var A=2*Math.PI*w,C=k+A;v===0||g>=1||g+w>1||(p===0?(t.beginPath(),t.moveTo(l,u),t.arc(l,u,f,k,C),t.closePath()):(t.beginPath(),t.arc(l,u,f,k,C),t.arc(l,u,p,C,k,!0),t.closePath()),this.colorFillStyle(t,T[0],T[1],T[2],b),t.fill(),g+=w)}},ch.drawStripe=function(t,e,r,n){e=e[0],n=n||e.position();var i=e.cy().style(),a=n.x,s=n.y,o=e.width(),l=e.height(),u=0,h=this.usePaths();t.save();var d=e.pstyle("stripe-direction").value,f=e.pstyle("stripe-size");switch(d){case"vertical":break;case"righward":t.rotate(-Math.PI/2);break}var p=o,g=l;f.units==="%"?(p=p*f.pfValue,g=g*f.pfValue):f.pfValue!==void 0&&(p=f.pfValue,g=f.pfValue),h&&(a=0,s=0),s-=p/2,a-=g/2;for(var m=1;m<=i.stripeBackgroundN;m++){var y=e.pstyle("stripe-"+m+"-background-size").value,v=e.pstyle("stripe-"+m+"-background-color").value,T=e.pstyle("stripe-"+m+"-background-opacity").value*r,b=y/100;b+u>1&&(b=1-u),!(y===0||u>=1||u+b>1)&&(t.beginPath(),t.rect(a,s+g*u,p,g*b),t.closePath(),this.colorFillStyle(t,v[0],v[1],v[2],T),t.fill(),u+=b)}t.restore()};var Qa={},Zqe=100;Qa.getPixelRatio=function(){var t=this.data.contexts[0];if(this.forcedPixelRatio!=null)return this.forcedPixelRatio;var e=this.cy.window(),r=t.backingStorePixelRatio||t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1;return(e.devicePixelRatio||1)/r},Qa.paintCache=function(t){for(var e=this.paintCaches=this.paintCaches||[],r=!0,n,i=0;ie.minMbLowQualFrames&&(e.motionBlurPxRatio=e.mbPxRBlurry)),e.clearingMotionBlur&&(e.motionBlurPxRatio=1),e.textureDrawLastFrame&&!d&&(h[e.NODE]=!0,h[e.SELECT_BOX]=!0);var T=r.style(),b=r.zoom(),w=s!==void 0?s:b,k=r.pan(),A={x:k.x,y:k.y},C={zoom:b,pan:{x:k.x,y:k.y}},_=e.prevViewport,L=_===void 0||C.zoom!==_.zoom||C.pan.x!==_.pan.x||C.pan.y!==_.pan.y;!L&&!(m&&!g)&&(e.motionBlurPxRatio=1),o&&(A=o),w*=l,A.x*=l,A.y*=l;var O=e.getCachedZSortedEles();function M(J,Z,ee,ne,ue){var fe=J.globalCompositeOperation;J.globalCompositeOperation="destination-out",e.colorFillStyle(J,255,255,255,e.motionBlurTransparency),J.fillRect(Z,ee,ne,ue),J.globalCompositeOperation=fe}function z(J,Z){var ee,ne,ue,fe;!e.clearingMotionBlur&&(J===u.bufferContexts[e.MOTIONBLUR_BUFFER_NODE]||J===u.bufferContexts[e.MOTIONBLUR_BUFFER_DRAG])?(ee={x:k.x*p,y:k.y*p},ne=b*p,ue=e.canvasWidth*p,fe=e.canvasHeight*p):(ee=A,ne=w,ue=e.canvasWidth,fe=e.canvasHeight),J.setTransform(1,0,0,1,0,0),Z==="motionBlur"?M(J,0,0,ue,fe):!n&&(Z===void 0||Z)&&J.clearRect(0,0,ue,fe),i||(J.translate(ee.x,ee.y),J.scale(ne,ne)),o&&J.translate(o.x,o.y),s&&J.scale(s,s)}if(d||(e.textureDrawLastFrame=!1),d){if(e.textureDrawLastFrame=!0,!e.textureCache){e.textureCache={},e.textureCache.bb=r.mutableElements().boundingBox(),e.textureCache.texture=e.data.bufferCanvases[e.TEXTURE_BUFFER];var F=e.data.bufferContexts[e.TEXTURE_BUFFER];F.setTransform(1,0,0,1,0,0),F.clearRect(0,0,e.canvasWidth*e.textureMult,e.canvasHeight*e.textureMult),e.render({forcedContext:F,drawOnlyNodeLayer:!0,forcedPxRatio:l*e.textureMult});var C=e.textureCache.viewport={zoom:r.zoom(),pan:r.pan(),width:e.canvasWidth,height:e.canvasHeight};C.mpan={x:(0-C.pan.x)/C.zoom,y:(0-C.pan.y)/C.zoom}}h[e.DRAG]=!1,h[e.NODE]=!1;var S=u.contexts[e.NODE],R=e.textureCache.texture,C=e.textureCache.viewport;S.setTransform(1,0,0,1,0,0),f?M(S,0,0,C.width,C.height):S.clearRect(0,0,C.width,C.height);var N=T.core("outside-texture-bg-color").value,D=T.core("outside-texture-bg-opacity").value;e.colorFillStyle(S,N[0],N[1],N[2],D),S.fillRect(0,0,C.width,C.height);var b=r.zoom();z(S,!1),S.clearRect(C.mpan.x,C.mpan.y,C.width/C.zoom/l,C.height/C.zoom/l),S.drawImage(R,C.mpan.x,C.mpan.y,C.width/C.zoom/l,C.height/C.zoom/l)}else e.textureOnViewport&&!n&&(e.textureCache=null);var I=r.extent(),$=e.pinching||e.hoverData.dragging||e.swipePanning||e.data.wheelZooming||e.hoverData.draggingEles||e.cy.animated(),B=e.hideEdgesOnViewport&&$,P=[];if(P[e.NODE]=!h[e.NODE]&&f&&!e.clearedForMotionBlur[e.NODE]||e.clearingMotionBlur,P[e.NODE]&&(e.clearedForMotionBlur[e.NODE]=!0),P[e.DRAG]=!h[e.DRAG]&&f&&!e.clearedForMotionBlur[e.DRAG]||e.clearingMotionBlur,P[e.DRAG]&&(e.clearedForMotionBlur[e.DRAG]=!0),h[e.NODE]||i||a||P[e.NODE]){var G=f&&!P[e.NODE]&&p!==1,S=n||(G?e.data.bufferContexts[e.MOTIONBLUR_BUFFER_NODE]:u.contexts[e.NODE]),V=f&&!G?"motionBlur":void 0;z(S,V),B?e.drawCachedNodes(S,O.nondrag,l,I):e.drawLayeredElements(S,O.nondrag,l,I),e.debug&&e.drawDebugPoints(S,O.nondrag),!i&&!f&&(h[e.NODE]=!1)}if(!a&&(h[e.DRAG]||i||P[e.DRAG])){var G=f&&!P[e.DRAG]&&p!==1,S=n||(G?e.data.bufferContexts[e.MOTIONBLUR_BUFFER_DRAG]:u.contexts[e.DRAG]);z(S,f&&!G?"motionBlur":void 0),B?e.drawCachedNodes(S,O.drag,l,I):e.drawCachedElements(S,O.drag,l,I),e.debug&&e.drawDebugPoints(S,O.drag),!i&&!f&&(h[e.DRAG]=!1)}if(this.drawSelectionRectangle(t,z),f&&p!==1){var Y=u.contexts[e.NODE],W=e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_NODE],ie=u.contexts[e.DRAG],K=e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_DRAG],se=function(Z,ee,ne){Z.setTransform(1,0,0,1,0,0),ne||!v?Z.clearRect(0,0,e.canvasWidth,e.canvasHeight):M(Z,0,0,e.canvasWidth,e.canvasHeight);var ue=p;Z.drawImage(ee,0,0,e.canvasWidth*ue,e.canvasHeight*ue,0,0,e.canvasWidth,e.canvasHeight)};(h[e.NODE]||P[e.NODE])&&(se(Y,W,P[e.NODE]),h[e.NODE]=!1),(h[e.DRAG]||P[e.DRAG])&&(se(ie,K,P[e.DRAG]),h[e.DRAG]=!1)}e.prevViewport=C,e.clearingMotionBlur&&(e.clearingMotionBlur=!1,e.motionBlurCleared=!0,e.motionBlur=!0),f&&(e.motionBlurTimeout=setTimeout(function(){e.motionBlurTimeout=null,e.clearedForMotionBlur[e.NODE]=!1,e.clearedForMotionBlur[e.DRAG]=!1,e.motionBlur=!1,e.clearingMotionBlur=!d,e.mbFrames=0,h[e.NODE]=!0,h[e.DRAG]=!0,e.redraw()},Zqe)),n||r.emit("render")};var ox;Qa.drawSelectionRectangle=function(t,e){var r=this,n=r.cy,i=r.data,a=n.style(),s=t.drawOnlyNodeLayer,o=t.drawAllLayers,l=i.canvasNeedsRedraw,u=t.forcedContext;if(r.showFps||!s&&l[r.SELECT_BOX]&&!o){var h=u||i.contexts[r.SELECT_BOX];if(e(h),r.selection[4]==1&&(r.hoverData.selecting||r.touchData.selecting)){var d=r.cy.zoom(),f=a.core("selection-box-border-width").value/d;h.lineWidth=f,h.fillStyle="rgba("+a.core("selection-box-color").value[0]+","+a.core("selection-box-color").value[1]+","+a.core("selection-box-color").value[2]+","+a.core("selection-box-opacity").value+")",h.fillRect(r.selection[0],r.selection[1],r.selection[2]-r.selection[0],r.selection[3]-r.selection[1]),f>0&&(h.strokeStyle="rgba("+a.core("selection-box-border-color").value[0]+","+a.core("selection-box-border-color").value[1]+","+a.core("selection-box-border-color").value[2]+","+a.core("selection-box-opacity").value+")",h.strokeRect(r.selection[0],r.selection[1],r.selection[2]-r.selection[0],r.selection[3]-r.selection[1]))}if(i.bgActivePosistion&&!r.hoverData.selecting){var d=r.cy.zoom(),p=i.bgActivePosistion;h.fillStyle="rgba("+a.core("active-bg-color").value[0]+","+a.core("active-bg-color").value[1]+","+a.core("active-bg-color").value[2]+","+a.core("active-bg-opacity").value+")",h.beginPath(),h.arc(p.x,p.y,a.core("active-bg-size").pfValue/d,0,2*Math.PI),h.fill()}var g=r.lastRedrawTime;if(r.showFps&&g){g=Math.round(g);var m=Math.round(1e3/g),y="1 frame = "+g+" ms = "+m+" fps";if(h.setTransform(1,0,0,1,0,0),h.fillStyle="rgba(255, 0, 0, 0.75)",h.strokeStyle="rgba(255, 0, 0, 0.75)",h.font="30px Arial",!ox){var v=h.measureText(y);ox=v.actualBoundingBoxAscent}h.fillText(y,0,ox);var T=60;h.strokeRect(0,ox+10,250,20),h.fillRect(0,ox+10,250*Math.min(m/T,1),20)}o||(l[r.SELECT_BOX]=!1)}};function zee(t,e,r){var n=t.createShader(e);if(t.shaderSource(n,r),t.compileShader(n),!t.getShaderParameter(n,t.COMPILE_STATUS))throw new Error(t.getShaderInfoLog(n));return n}function Qqe(t,e,r){var n=zee(t,t.VERTEX_SHADER,e),i=zee(t,t.FRAGMENT_SHADER,r),a=t.createProgram();if(t.attachShader(a,n),t.attachShader(a,i),t.linkProgram(a),!t.getProgramParameter(a,t.LINK_STATUS))throw new Error("Could not initialize shaders");return a}function Jqe(t,e,r){r===void 0&&(r=e);var n=t.makeOffscreenCanvas(e,r),i=n.context=n.getContext("2d");return n.clear=function(){return i.clearRect(0,0,n.width,n.height)},n.clear(),n}function QL(t){var e=t.pixelRatio,r=t.cy.zoom(),n=t.cy.pan();return{zoom:r*e,pan:{x:n.x*e,y:n.y*e}}}function eVe(t){var e=t.pixelRatio,r=t.cy.zoom();return r*e}function tVe(t,e,r,n,i){var a=n*r+e.x,s=i*r+e.y;return s=Math.round(t.canvasHeight-s),[a,s]}function rVe(t,e){return e.picking?!0:t.pstyle("background-fill").value!=="solid"||t.pstyle("background-image").strValue!=="none"?!1:t.pstyle("border-width").value===0||t.pstyle("border-opacity").value===0?!0:t.pstyle("border-style").value==="solid"}function nVe(t,e){if(t.length!==e.length)return!1;for(var r=0;r>0&255)/255,r[1]=(t>>8&255)/255,r[2]=(t>>16&255)/255,r[3]=(t>>24&255)/255,r}function iVe(t){return t[0]+(t[1]<<8)+(t[2]<<16)+(t[3]<<24)}function aVe(t,e){var r=t.createTexture();return r.buffer=function(n){t.bindTexture(t.TEXTURE_2D,r),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR_MIPMAP_NEAREST),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,n),t.generateMipmap(t.TEXTURE_2D),t.bindTexture(t.TEXTURE_2D,null)},r.deleteTexture=function(){t.deleteTexture(r)},r}function Gee(t,e){switch(e){case"float":return[1,t.FLOAT,4];case"vec2":return[2,t.FLOAT,4];case"vec3":return[3,t.FLOAT,4];case"vec4":return[4,t.FLOAT,4];case"int":return[1,t.INT,4];case"ivec2":return[2,t.INT,4]}}function qee(t,e,r){switch(e){case t.FLOAT:return new Float32Array(r);case t.INT:return new Int32Array(r)}}function sVe(t,e,r,n,i,a){switch(e){case t.FLOAT:return new Float32Array(r.buffer,a*n,i);case t.INT:return new Int32Array(r.buffer,a*n,i)}}function oVe(t,e,r,n){var i=Gee(t,e),a=Ri(i,2),s=a[0],o=a[1],l=qee(t,o,n),u=t.createBuffer();return t.bindBuffer(t.ARRAY_BUFFER,u),t.bufferData(t.ARRAY_BUFFER,l,t.STATIC_DRAW),o===t.FLOAT?t.vertexAttribPointer(r,s,o,!1,0,0):o===t.INT&&t.vertexAttribIPointer(r,s,o,0,0),t.enableVertexAttribArray(r),t.bindBuffer(t.ARRAY_BUFFER,null),u}function $l(t,e,r,n){var i=Gee(t,r),a=Ri(i,3),s=a[0],o=a[1],l=a[2],u=qee(t,o,e*s),h=s*l,d=t.createBuffer();t.bindBuffer(t.ARRAY_BUFFER,d),t.bufferData(t.ARRAY_BUFFER,e*h,t.DYNAMIC_DRAW),t.enableVertexAttribArray(n),o===t.FLOAT?t.vertexAttribPointer(n,s,o,!1,h,0):o===t.INT&&t.vertexAttribIPointer(n,s,o,h,0),t.vertexAttribDivisor(n,1),t.bindBuffer(t.ARRAY_BUFFER,null);for(var f=new Array(e),p=0;ps&&(o=s/n,l=n*o,u=i*o),{scale:o,texW:l,texH:u}}},{key:"draw",value:function(r,n,i){var a=this;if(this.locked)throw new Error("can't draw, atlas is locked");var s=this.texSize,o=this.texRows,l=this.texHeight,u=this.getScale(n),h=u.scale,d=u.texW,f=u.texH,p=function(b,w){if(i&&w){var k=w.context,A=b.x,C=b.row,_=A,L=l*C;k.save(),k.translate(_,L),k.scale(h,h),i(k,n),k.restore()}},g=[null,null],m=function(){p(a.freePointer,a.canvas),g[0]={x:a.freePointer.x,y:a.freePointer.row*l,w:d,h:f},g[1]={x:a.freePointer.x+d,y:a.freePointer.row*l,w:0,h:f},a.freePointer.x+=d,a.freePointer.x==s&&(a.freePointer.x=0,a.freePointer.row++)},y=function(){var b=a.scratch,w=a.canvas;b.clear(),p({x:0,row:0},b);var k=s-a.freePointer.x,A=d-k,C=l;{var _=a.freePointer.x,L=a.freePointer.row*l,O=k;w.context.drawImage(b,0,0,O,C,_,L,O,C),g[0]={x:_,y:L,w:O,h:f}}{var M=k,z=(a.freePointer.row+1)*l,F=A;w&&w.context.drawImage(b,M,0,F,C,0,z,F,C),g[1]={x:0,y:z,w:F,h:f}}a.freePointer.x=A,a.freePointer.row++},v=function(){a.freePointer.x=0,a.freePointer.row++};if(this.freePointer.x+d<=s)m();else{if(this.freePointer.row>=o-1)return!1;this.freePointer.x===s?(v(),m()):this.enableWrapping?y():(v(),m())}return this.keyToLocation.set(r,g),this.needsBuffer=!0,g}},{key:"getOffsets",value:function(r){return this.keyToLocation.get(r)}},{key:"isEmpty",value:function(){return this.freePointer.x===0&&this.freePointer.row===0}},{key:"canFit",value:function(r){if(this.locked)return!1;var n=this.texSize,i=this.texRows,a=this.getScale(r),s=a.texW;return this.freePointer.x+s>n?this.freePointer.row1&&arguments[1]!==void 0?arguments[1]:{},a=i.forceRedraw,s=a===void 0?!1:a,o=i.filterEle,l=o===void 0?function(){return!0}:o,u=i.filterType,h=u===void 0?function(){return!0}:u,d=!1,f=!1,p=ws(r),g;try{for(p.s();!(g=p.n()).done;){var m=g.value;if(l(m)){var y=ws(this.renderTypes.values()),v;try{var T=function(){var w=v.value,k=w.type;if(h(k)){var A=n.collections.get(w.collection),C=w.getKey(m),_=Array.isArray(C)?C:[C];if(s)_.forEach(function(z){return A.markKeyForGC(z)}),f=!0;else{var L=w.getID?w.getID(m):m.id(),O=n._key(k,L),M=n.typeAndIdToKey.get(O);M!==void 0&&!nVe(_,M)&&(d=!0,n.typeAndIdToKey.delete(O),M.forEach(function(z){return A.markKeyForGC(z)}))}}};for(y.s();!(v=y.n()).done;)T()}catch(b){y.e(b)}finally{y.f()}}}}catch(b){p.e(b)}finally{p.f()}return f&&(this.gc(),d=!1),d}},{key:"gc",value:function(){var r=ws(this.collections.values()),n;try{for(r.s();!(n=r.n()).done;){var i=n.value;i.gc()}}catch(a){r.e(a)}finally{r.f()}}},{key:"getOrCreateAtlas",value:function(r,n,i,a){var s=this.renderTypes.get(n),o=this.collections.get(s.collection),l=!1,u=o.draw(a,i,function(f){s.drawClipped?(f.save(),f.beginPath(),f.rect(0,0,i.w,i.h),f.clip(),s.drawElement(f,r,i,!0,!0),f.restore()):s.drawElement(f,r,i,!0,!0),l=!0});if(l){var h=s.getID?s.getID(r):r.id(),d=this._key(n,h);this.typeAndIdToKey.has(d)?this.typeAndIdToKey.get(d).push(a):this.typeAndIdToKey.set(d,[a])}return u}},{key:"getAtlasInfo",value:function(r,n){var i=this,a=this.renderTypes.get(n),s=a.getKey(r),o=Array.isArray(s)?s:[s];return o.map(function(l){var u=a.getBoundingBox(r,l),h=i.getOrCreateAtlas(r,n,u,l),d=h.getOffsets(l),f=Ri(d,2),p=f[0],g=f[1];return{atlas:h,tex:p,tex1:p,tex2:g,bb:u}})}},{key:"getDebugInfo",value:function(){var r=[],n=ws(this.collections),i;try{for(n.s();!(i=n.n()).done;){var a=Ri(i.value,2),s=a[0],o=a[1],l=o.getCounts(),u=l.keyCount,h=l.atlasCount;r.push({type:s,keyCount:u,atlasCount:h})}}catch(d){n.e(d)}finally{n.f()}return r}}])})(),mVe=(function(){function t(e){Hu(this,t),this.globalOptions=e,this.atlasSize=e.webglTexSize,this.maxAtlasesPerBatch=e.webglTexPerBatch,this.batchAtlases=[]}return Yu(t,[{key:"getMaxAtlasesPerBatch",value:function(){return this.maxAtlasesPerBatch}},{key:"getAtlasSize",value:function(){return this.atlasSize}},{key:"getIndexArray",value:function(){return Array.from({length:this.maxAtlasesPerBatch},function(r,n){return n})}},{key:"startBatch",value:function(){this.batchAtlases=[]}},{key:"getAtlasCount",value:function(){return this.batchAtlases.length}},{key:"getAtlases",value:function(){return this.batchAtlases}},{key:"canAddToCurrentBatch",value:function(r){return this.batchAtlases.length===this.maxAtlasesPerBatch?this.batchAtlases.includes(r):!0}},{key:"getAtlasIndexForBatch",value:function(r){var n=this.batchAtlases.indexOf(r);if(n<0){if(this.batchAtlases.length===this.maxAtlasesPerBatch)throw new Error("cannot add more atlases to batch");this.batchAtlases.push(r),n=this.batchAtlases.length-1}return n}}])})(),yVe=` + */var Wse=function(e,r){this.recycle(e,r)};function nw(){return!1}function $3(){return!0}Wse.prototype={instanceString:function(){return"event"},recycle:function(e,r){if(this.isImmediatePropagationStopped=this.isPropagationStopped=this.isDefaultPrevented=nw,e!=null&&e.preventDefault?(this.type=e.type,this.isDefaultPrevented=e.defaultPrevented?$3:nw):e!=null&&e.type?r=e:this.type=e,r!=null&&(this.originalEvent=r.originalEvent,this.type=r.type!=null?r.type:this.type,this.cy=r.cy,this.target=r.target,this.position=r.position,this.renderedPosition=r.renderedPosition,this.namespace=r.namespace,this.layout=r.layout),this.cy!=null&&this.position!=null&&this.renderedPosition==null){var n=this.position,i=this.cy.zoom(),a=this.cy.pan();this.renderedPosition={x:n.x*i+a.x,y:n.y*i+a.y}}this.timeStamp=e&&e.timeStamp||Date.now()},preventDefault:function(){this.isDefaultPrevented=$3;var e=this.originalEvent;e&&e.preventDefault&&e.preventDefault()},stopPropagation:function(){this.isPropagationStopped=$3;var e=this.originalEvent;e&&e.stopPropagation&&e.stopPropagation()},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=$3,this.stopPropagation()},isDefaultPrevented:nw,isPropagationStopped:nw,isImmediatePropagationStopped:nw};var Use=/^([^.]+)(\.(?:[^.]+))?$/,JKe=".*",Hse={qualifierCompare:function(e,r){return e===r},eventMatches:function(){return!0},addEventFields:function(){},callbackContext:function(e){return e},beforeEmit:function(){},afterEmit:function(){},bubble:function(){return!1},parent:function(){return null},context:null},Yse=Object.keys(Hse),eZe={};function O3(){for(var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:eZe,e=arguments.length>1?arguments[1]:void 0,r=0;r=0;o--)s(o);return this},cd.removeAllListeners=function(){return this.removeListener("*")},cd.emit=cd.trigger=function(t,e,r){var n=this.listeners,i=n.length;return this.emitting++,Pn(e)||(e=[e]),tZe(this,function(a,s){r!=null&&(n=[{event:s.event,type:s.type,namespace:s.namespace,callback:r}],i=n.length);for(var o=function(){var h=n[l];if(h.type===s.type&&(!h.namespace||h.namespace===s.namespace||h.namespace===JKe)&&a.eventMatches(a.context,h,s)){var d=[s];e!=null&&WYe(d,e),a.beforeEmit(a.context,h,s),h.conf&&h.conf.one&&(a.listeners=a.listeners.filter(function(g){return g!==h}));var f=a.callbackContext(a.context,h,s),p=h.callback.apply(f,d);a.afterEmit(a.context,h,s),p===!1&&(s.stopPropagation(),s.preventDefault())}},l=0;l1&&!s){var o=this.length-1,l=this[o],u=l._private.data.id;this[o]=void 0,this[e]=l,a.set(u,{ele:l,index:e})}return this.length--,this},unmergeOne:function(e){e=e[0];var r=this._private,n=e._private.data.id,i=r.map,a=i.get(n);if(!a)return this;var s=a.index;return this.unmergeAt(s),this},unmerge:function(e){var r=this._private.cy;if(!e)return this;if(e&&yr(e)){var n=e;e=r.mutableElements().filter(n)}for(var i=0;i=0;r--){var n=this[r];e(n)&&this.unmergeAt(r)}return this},map:function(e,r){for(var n=[],i=this,a=0;an&&(n=l,i=o)}return{value:n,ele:i}},min:function(e,r){for(var n=1/0,i,a=this,s=0;s=0&&a"u"?"undefined":la(Symbol))!=e&&la(Symbol.iterator)!=e;r&&(B3[Symbol.iterator]=function(){var n=this,i={value:void 0,done:!1},a=0,s=this.length;return sie({next:function(){return a1&&arguments[1]!==void 0?arguments[1]:!0,n=this[0],i=n.cy();if(i.styleEnabled()&&n){n._private.styleDirty&&(n._private.styleDirty=!1,i.style().apply(n));var a=n._private.style[e];return a??(r?i.style().getDefaultProperty(e):null)}},numericStyle:function(e){var r=this[0];if(r.cy().styleEnabled()&&r){var n=r.pstyle(e);return n.pfValue!==void 0?n.pfValue:n.value}},numericStyleUnits:function(e){var r=this[0];if(r.cy().styleEnabled()&&r)return r.pstyle(e).units},renderedStyle:function(e){var r=this.cy();if(!r.styleEnabled())return this;var n=this[0];if(n)return r.style().getRenderedStyle(n,e)},style:function(e,r){var n=this.cy();if(!n.styleEnabled())return this;var i=!1,a=n.style();if(an(e)){var s=e;a.applyBypass(this,s,i),this.emitAndNotify("style")}else if(yr(e))if(r===void 0){var o=this[0];return o?a.getStylePropertyValue(o,e):void 0}else a.applyBypass(this,e,r,i),this.emitAndNotify("style");else if(e===void 0){var l=this[0];return l?a.getRawStyle(l):void 0}return this},removeStyle:function(e){var r=this.cy();if(!r.styleEnabled())return this;var n=!1,i=r.style(),a=this;if(e===void 0)for(var s=0;s0&&e.push(h[0]),e.push(o[0])}return this.spawn(e,!0).filter(t)},"neighborhood"),closedNeighborhood:function(e){return this.neighborhood().add(this).filter(e)},openNeighborhood:function(e){return this.neighborhood(e)}}),as.neighbourhood=as.neighborhood,as.closedNeighbourhood=as.closedNeighborhood,as.openNeighbourhood=as.openNeighborhood,Cr(as,{source:Zo(function(e){var r=this[0],n;return r&&(n=r._private.source||r.cy().collection()),n&&e?n.filter(e):n},"source"),target:Zo(function(e){var r=this[0],n;return r&&(n=r._private.target||r.cy().collection()),n&&e?n.filter(e):n},"target"),sources:ioe({attr:"source"}),targets:ioe({attr:"target"})});function ioe(t){return function(r){for(var n=[],i=0;i0);return s},component:function(){var e=this[0];return e.cy().mutableElements().components(e)[0]}}),as.componentsOf=as.components;var Ba=function(e,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(e===void 0){fi("A collection must have a reference to the core");return}var a=new Ou,s=!1;if(!r)r=[];else if(r.length>0&&an(r[0])&&!FT(r[0])){s=!0;for(var o=[],l=new rm,u=0,h=r.length;u0&&arguments[0]!==void 0?arguments[0]:!0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=this,n=r.cy(),i=n._private,a=[],s=[],o,l=0,u=r.length;l0){for(var O=o.length===r.length?r:new Ba(n,o),B=0;B0&&arguments[0]!==void 0?arguments[0]:!0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=this,n=[],i={},a=r._private.cy;function s(A){for(var R=A._private.edges,N=0;N0&&(t?I.emitAndNotify("remove"):e&&I.emit("remove"));for(var z=0;z0?z=A:I=A;while(Math.abs(F)>s&&++R=a?x($,R):N===0?R:w($,I,I+u)}var _=!1;function k(){_=!0,(t!==e||r!==n)&&b()}var S=function(I){return _||k(),t===e&&r===n?I:I===0?0:I===1?1:y(C(I),e,n)};S.getControlPoints=function(){return[{x:t,y:e},{x:r,y:n}]};var L="generateBezier("+[t,e,r,n]+")";return S.toString=function(){return L},S}/*! Runge-Kutta spring physics function generator. Adapted from Framer.js, copyright Koen Bok. MIT License: http://en.wikipedia.org/wiki/MIT_License */var dZe=(function(){function t(n){return-n.tension*n.x-n.friction*n.v}function e(n,i,a){var s={x:n.x+a.dx*i,v:n.v+a.dv*i,tension:n.tension,friction:n.friction};return{dx:s.v,dv:t(s)}}function r(n,i){var a={dx:n.v,dv:t(n)},s=e(n,i*.5,a),o=e(n,i*.5,s),l=e(n,i,o),u=1/6*(a.dx+2*(s.dx+o.dx)+l.dx),h=1/6*(a.dv+2*(s.dv+o.dv)+l.dv);return n.x=n.x+u*i,n.v=n.v+h*i,n}return function n(i,a,s){var o={x:-1,v:0,tension:null,friction:null},l=[0],u=0,h=1/1e4,d=16/1e3,f,p,g;for(i=parseFloat(i)||500,a=parseFloat(a)||20,s=s||null,o.tension=i,o.friction=a,f=s!==null,f?(u=n(i,a),p=u/s*d):p=d;g=r(g||o,p),l.push(1+g.x),u+=16,Math.abs(g.x)>h&&Math.abs(g.v)>h;);return f?function(m){return l[m*(l.length-1)|0]}:u}})(),zn=function(e,r,n,i){var a=hZe(e,r,n,i);return function(s,o,l){return s+(o-s)*a(l)}},q3={linear:function(e,r,n){return e+(r-e)*n},ease:zn(.25,.1,.25,1),"ease-in":zn(.42,0,1,1),"ease-out":zn(0,0,.58,1),"ease-in-out":zn(.42,0,.58,1),"ease-in-sine":zn(.47,0,.745,.715),"ease-out-sine":zn(.39,.575,.565,1),"ease-in-out-sine":zn(.445,.05,.55,.95),"ease-in-quad":zn(.55,.085,.68,.53),"ease-out-quad":zn(.25,.46,.45,.94),"ease-in-out-quad":zn(.455,.03,.515,.955),"ease-in-cubic":zn(.55,.055,.675,.19),"ease-out-cubic":zn(.215,.61,.355,1),"ease-in-out-cubic":zn(.645,.045,.355,1),"ease-in-quart":zn(.895,.03,.685,.22),"ease-out-quart":zn(.165,.84,.44,1),"ease-in-out-quart":zn(.77,0,.175,1),"ease-in-quint":zn(.755,.05,.855,.06),"ease-out-quint":zn(.23,1,.32,1),"ease-in-out-quint":zn(.86,0,.07,1),"ease-in-expo":zn(.95,.05,.795,.035),"ease-out-expo":zn(.19,1,.22,1),"ease-in-out-expo":zn(1,0,0,1),"ease-in-circ":zn(.6,.04,.98,.335),"ease-out-circ":zn(.075,.82,.165,1),"ease-in-out-circ":zn(.785,.135,.15,.86),spring:function(e,r,n){if(n===0)return q3.linear;var i=dZe(e,r,n);return function(a,s,o){return a+(s-a)*i(o)}},"cubic-bezier":zn};function ooe(t,e,r,n,i){if(n===1||e===r)return r;var a=i(e,r,n);return t==null||((t.roundValue||t.color)&&(a=Math.round(a)),t.min!==void 0&&(a=Math.max(a,t.min)),t.max!==void 0&&(a=Math.min(a,t.max))),a}function loe(t,e){return t.pfValue!=null||t.value!=null?t.pfValue!=null&&(e==null||e.type.units!=="%")?t.pfValue:t.value:t}function vm(t,e,r,n,i){var a=i!=null?i.type:null;r<0?r=0:r>1&&(r=1);var s=loe(t,i),o=loe(e,i);if(Ht(s)&&Ht(o))return ooe(a,s,o,r,n);if(Pn(s)&&Pn(o)){for(var l=[],u=0;u0?(p==="spring"&&g.push(s.duration),s.easingImpl=q3[p].apply(null,g)):s.easingImpl=q3[p]}var m=s.easingImpl,y;if(s.duration===0?y=1:y=(r-l)/s.duration,s.applying&&(y=s.progress),y<0?y=0:y>1&&(y=1),s.delay==null){var v=s.startPosition,x=s.position;if(x&&i&&!t.locked()){var b={};iw(v.x,x.x)&&(b.x=vm(v.x,x.x,y,m)),iw(v.y,x.y)&&(b.y=vm(v.y,x.y,y,m)),t.position(b)}var w=s.startPan,C=s.pan,_=a.pan,k=C!=null&&n;k&&(iw(w.x,C.x)&&(_.x=vm(w.x,C.x,y,m)),iw(w.y,C.y)&&(_.y=vm(w.y,C.y,y,m)),t.emit("pan"));var S=s.startZoom,L=s.zoom,$=L!=null&&n;$&&(iw(S,L)&&(a.zoom=XT(a.minZoom,vm(S,L,y,m),a.maxZoom)),t.emit("zoom")),(k||$)&&t.emit("viewport");var I=s.style;if(I&&I.length>0&&i){for(var z=0;z=0;k--){var S=_[k];S()}_.splice(0,_.length)},x=p.length-1;x>=0;x--){var b=p[x],w=b._private;if(w.stopped){p.splice(x,1),w.hooked=!1,w.playing=!1,w.started=!1,v(w.frames);continue}!w.playing&&!w.applying||(w.playing&&w.applying&&(w.applying=!1),w.started||pZe(h,b,t),fZe(h,b,t,d),w.applying&&(w.applying=!1),v(w.frames),w.step!=null&&w.step(t),b.completed()&&(p.splice(x,1),w.hooked=!1,w.playing=!1,w.started=!1,v(w.completes)),m=!0)}return!d&&p.length===0&&g.length===0&&n.push(h),m}for(var a=!1,s=0;s0?e.notify("draw",r):e.notify("draw")),r.unmerge(n),e.emit("step")}var gZe={animate:xn.animate(),animation:xn.animation(),animated:xn.animated(),clearQueue:xn.clearQueue(),delay:xn.delay(),delayAnimation:xn.delayAnimation(),stop:xn.stop(),addToAnimationPool:function(e){var r=this;r.styleEnabled()&&r._private.aniEles.merge(e)},stopAnimationLoop:function(){this._private.animationsRunning=!1},startAnimationLoop:function(){var e=this;if(e._private.animationsRunning=!0,!e.styleEnabled())return;function r(){e._private.animationsRunning&&d3(function(a){coe(a,e),r()})}var n=e.renderer();n&&n.beforeRender?n.beforeRender(function(a,s){coe(s,e)},n.beforeRenderPriorities.animations):r()}},mZe={qualifierCompare:function(e,r){return e==null||r==null?e==null&&r==null:e.sameText(r)},eventMatches:function(e,r,n){var i=r.qualifier;return i!=null?e!==n.target&&FT(n.target)&&i.matches(n.target):!0},addEventFields:function(e,r){r.cy=e,r.target=e},callbackContext:function(e,r,n){return r.qualifier!=null?n.target:e}},V3=function(e){return yr(e)?new id(e):e},uoe={createEmitter:function(){var e=this._private;return e.emitter||(e.emitter=new O3(mZe,this)),this},emitter:function(){return this._private.emitter},on:function(e,r,n){return this.emitter().on(e,V3(r),n),this},removeListener:function(e,r,n){return this.emitter().removeListener(e,V3(r),n),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},one:function(e,r,n){return this.emitter().one(e,V3(r),n),this},once:function(e,r,n){return this.emitter().one(e,V3(r),n),this},emit:function(e,r){return this.emitter().emit(e,r),this},emitAndNotify:function(e,r){return this.emit(e),this.notify(e,r),this}};xn.eventAliasesOn(uoe);var uN={png:function(e){var r=this._private.renderer;return e=e||{},r.png(e)},jpg:function(e){var r=this._private.renderer;return e=e||{},e.bg=e.bg||"#fff",r.jpg(e)}};uN.jpeg=uN.jpg;var W3={layout:function(e){var r=this;if(e==null){fi("Layout options must be specified to make a layout");return}if(e.name==null){fi("A `name` must be specified to make a layout");return}var n=e.name,i=r.extension("layout",n);if(i==null){fi("No such layout `"+n+"` found. Did you forget to import it and `cytoscape.use()` it?");return}var a;yr(e.eles)?a=r.$(e.eles):a=e.eles!=null?e.eles:r.$();var s=new i(Cr({},e,{cy:r,eles:a}));return s}};W3.createLayout=W3.makeLayout=W3.layout;var yZe={notify:function(e,r){var n=this._private;if(this.batching()){n.batchNotifications=n.batchNotifications||{};var i=n.batchNotifications[e]=n.batchNotifications[e]||this.collection();r!=null&&i.merge(r);return}if(n.notificationsEnabled){var a=this.renderer();this.destroyed()||!a||a.notify(e,r)}},notifications:function(e){var r=this._private;return e===void 0?r.notificationsEnabled:(r.notificationsEnabled=!!e,this)},noNotifications:function(e){this.notifications(!1),e(),this.notifications(!0)},batching:function(){return this._private.batchCount>0},startBatch:function(){var e=this._private;return e.batchCount==null&&(e.batchCount=0),e.batchCount===0&&(e.batchStyleEles=this.collection(),e.batchNotifications={}),e.batchCount++,this},endBatch:function(){var e=this._private;if(e.batchCount===0)return this;if(e.batchCount--,e.batchCount===0){e.batchStyleEles.updateStyle();var r=this.renderer();Object.keys(e.batchNotifications).forEach(function(n){var i=e.batchNotifications[n];i.empty()?r.notify(n):r.notify(n,i)})}return this},batch:function(e){return this.startBatch(),e(),this.endBatch(),this},batchData:function(e){var r=this;return this.batch(function(){for(var n=Object.keys(e),i=0;i0;)r.removeChild(r.childNodes[0]);e._private.renderer=null,e.mutableElements().forEach(function(n){var i=n._private;i.rscratch={},i.rstyle={},i.animation.current=[],i.animation.queue=[]})},onRender:function(e){return this.on("render",e)},offRender:function(e){return this.off("render",e)}};hN.invalidateDimensions=hN.resize;var U3={collection:function(e,r){return yr(e)?this.$(e):Ao(e)?e.collection():Pn(e)?(r||(r={}),new Ba(this,e,r.unique,r.removed)):new Ba(this)},nodes:function(e){var r=this.$(function(n){return n.isNode()});return e?r.filter(e):r},edges:function(e){var r=this.$(function(n){return n.isEdge()});return e?r.filter(e):r},$:function(e){var r=this._private.elements;return e?r.filter(e):r.spawnSelf()},mutableElements:function(){return this._private.elements}};U3.elements=U3.filter=U3.$;var wa={},aw="t",bZe="f";wa.apply=function(t){for(var e=this,r=e._private,n=r.cy,i=n.collection(),a=0;a0;if(f||d&&p){var g=void 0;f&&p||f?g=u.properties:p&&(g=u.mappedProperties);for(var m=0;m1&&(w=1),o.color){var _=n.valueMin[0],k=n.valueMax[0],S=n.valueMin[1],L=n.valueMax[1],$=n.valueMin[2],I=n.valueMax[2],z=n.valueMin[3]==null?1:n.valueMin[3],F=n.valueMax[3]==null?1:n.valueMax[3],A=[Math.round(_+(k-_)*w),Math.round(S+(L-S)*w),Math.round($+(I-$)*w),Math.round(z+(F-z)*w)];a={bypass:n.bypass,name:n.name,value:A,strValue:"rgb("+A[0]+", "+A[1]+", "+A[2]+")"}}else if(o.number){var R=n.valueMin+(n.valueMax-n.valueMin)*w;a=this.parse(n.name,R,n.bypass,f)}else return!1;if(!a)return m(),!1;a.mapping=n,n=a;break}case s.data:{for(var N=n.field.split("."),M=d.data,D=0;D0&&a>0){for(var o={},l=!1,u=0;u0?t.delayAnimation(s).play().promise().then(b):b()}).then(function(){return t.animation({style:o,duration:a,easing:t.pstyle("transition-timing-function").value,queue:!1}).play().promise()}).then(function(){r.removeBypasses(t,i),t.emitAndNotify("style"),n.transitioning=!1})}else n.transitioning&&(this.removeBypasses(t,i),t.emitAndNotify("style"),n.transitioning=!1)},wa.checkTrigger=function(t,e,r,n,i,a){var s=this.properties[e],o=i(s);t.removed()||o!=null&&o(r,n,t)&&a(s)},wa.checkZOrderTrigger=function(t,e,r,n){var i=this;this.checkTrigger(t,e,r,n,function(a){return a.triggersZOrder},function(){i._private.cy.notify("zorder",t)})},wa.checkBoundsTrigger=function(t,e,r,n){this.checkTrigger(t,e,r,n,function(i){return i.triggersBounds},function(i){t.dirtyCompoundBoundsCache(),t.dirtyBoundingBoxCache()})},wa.checkConnectedEdgesBoundsTrigger=function(t,e,r,n){this.checkTrigger(t,e,r,n,function(i){return i.triggersBoundsOfConnectedEdges},function(i){t.connectedEdges().forEach(function(a){a.dirtyBoundingBoxCache()})})},wa.checkParallelEdgesBoundsTrigger=function(t,e,r,n){this.checkTrigger(t,e,r,n,function(i){return i.triggersBoundsOfParallelEdges},function(i){t.parallelEdges().forEach(function(a){a.dirtyBoundingBoxCache()})})},wa.checkTriggers=function(t,e,r,n){t.dirtyStyleCache(),this.checkZOrderTrigger(t,e,r,n),this.checkBoundsTrigger(t,e,r,n),this.checkConnectedEdgesBoundsTrigger(t,e,r,n),this.checkParallelEdgesBoundsTrigger(t,e,r,n)};var sw={};sw.applyBypass=function(t,e,r,n){var i=this,a=[],s=!0;if(e==="*"||e==="**"){if(r!==void 0)for(var o=0;oi.length?n=n.substr(i.length):n=""}function l(){a.length>s.length?a=a.substr(s.length):a=""}for(;;){var u=n.match(/^\s*$/);if(u)break;var h=n.match(/^\s*((?:.|\s)+?)\s*\{((?:.|\s)+?)\}/);if(!h){bn("Halting stylesheet parsing: String stylesheet contains more to parse but no selector and block found in: "+n);break}i=h[0];var d=h[1];if(d!=="core"){var f=new id(d);if(f.invalid){bn("Skipping parsing of block: Invalid selector found in string stylesheet: "+d),o();continue}}var p=h[2],g=!1;a=p;for(var m=[];;){var y=a.match(/^\s*$/);if(y)break;var v=a.match(/^\s*(.+?)\s*:\s*(.+?)(?:\s*;|\s*$)/);if(!v){bn("Skipping parsing of block: Invalid formatting of style property and value definitions found in:"+p),g=!0;break}s=v[0];var x=v[1],b=v[2],w=e.properties[x];if(!w){bn("Skipping property: Invalid property name in: "+s),l();continue}var C=r.parse(x,b);if(!C){bn("Skipping property: Invalid property definition in: "+s),l();continue}m.push({name:x,val:b}),l()}if(g){o();break}r.selector(d);for(var _=0;_=7&&e[0]==="d"&&(h=new RegExp(o.data.regex).exec(e))){if(r)return!1;var f=o.data;return{name:t,value:h,strValue:""+e,mapped:f,field:h[1],bypass:r}}else if(e.length>=10&&e[0]==="m"&&(d=new RegExp(o.mapData.regex).exec(e))){if(r||u.multiple)return!1;var p=o.mapData;if(!(u.color||u.number))return!1;var g=this.parse(t,d[4]);if(!g||g.mapped)return!1;var m=this.parse(t,d[5]);if(!m||m.mapped)return!1;if(g.pfValue===m.pfValue||g.strValue===m.strValue)return bn("`"+t+": "+e+"` is not a valid mapper because the output range is zero; converting to `"+t+": "+g.strValue+"`"),this.parse(t,g.strValue);if(u.color){var y=g.value,v=m.value,x=y[0]===v[0]&&y[1]===v[1]&&y[2]===v[2]&&(y[3]===v[3]||(y[3]==null||y[3]===1)&&(v[3]==null||v[3]===1));if(x)return!1}return{name:t,value:d,strValue:""+e,mapped:p,field:d[1],fieldMin:parseFloat(d[2]),fieldMax:parseFloat(d[3]),valueMin:g.value,valueMax:m.value,bypass:r}}}if(u.multiple&&n!=="multiple"){var b;if(l?b=e.split(/\s+/):Pn(e)?b=e:b=[e],u.evenMultiple&&b.length%2!==0)return null;for(var w=[],C=[],_=[],k="",S=!1,L=0;L0?" ":"")+$.strValue}return u.validate&&!u.validate(w,C)?null:u.singleEnum&&S?w.length===1&&yr(w[0])?{name:t,value:w[0],strValue:w[0],bypass:r}:null:{name:t,value:w,pfValue:_,strValue:k,bypass:r,units:C}}var I=function(){for(var J=0;Ju.max||u.strictMax&&e===u.max))return null;var N={name:t,value:e,strValue:""+e+(z||""),units:z,bypass:r};return u.unitless||z!=="px"&&z!=="em"?N.pfValue=e:N.pfValue=z==="px"||!z?e:this.getEmSizeInPixels()*e,(z==="ms"||z==="s")&&(N.pfValue=z==="ms"?e:1e3*e),(z==="deg"||z==="rad")&&(N.pfValue=z==="rad"?e:gXe(e)),z==="%"&&(N.pfValue=e/100),N}else if(u.propList){var M=[],D=""+e;if(D!=="none"){for(var O=D.split(/\s*,\s*|\s+/),B=0;B0&&o>0&&!isNaN(n.w)&&!isNaN(n.h)&&n.w>0&&n.h>0){l=Math.min((s-2*r)/n.w,(o-2*r)/n.h),l=l>this._private.maxZoom?this._private.maxZoom:l,l=l=n.minZoom&&(n.maxZoom=r),this},minZoom:function(e){return e===void 0?this._private.minZoom:this.zoomRange({min:e})},maxZoom:function(e){return e===void 0?this._private.maxZoom:this.zoomRange({max:e})},getZoomedViewport:function(e){var r=this._private,n=r.pan,i=r.zoom,a,s,o=!1;if(r.zoomingEnabled||(o=!0),Ht(e)?s=e:an(e)&&(s=e.level,e.position!=null?a=y3(e.position,i,n):e.renderedPosition!=null&&(a=e.renderedPosition),a!=null&&!r.panningEnabled&&(o=!0)),s=s>r.maxZoom?r.maxZoom:s,s=sr.maxZoom||!r.zoomingEnabled?s=!0:(r.zoom=l,a.push("zoom"))}if(i&&(!s||!e.cancelOnFailedZoom)&&r.panningEnabled){var u=e.pan;Ht(u.x)&&(r.pan.x=u.x,o=!1),Ht(u.y)&&(r.pan.y=u.y,o=!1),o||a.push("pan")}return a.length>0&&(a.push("viewport"),this.emit(a.join(" ")),this.notify("viewport")),this},center:function(e){var r=this.getCenterPan(e);return r&&(this._private.pan=r,this.emit("pan viewport"),this.notify("viewport")),this},getCenterPan:function(e,r){if(this._private.panningEnabled){if(yr(e)){var n=e;e=this.mutableElements().filter(n)}else Ao(e)||(e=this.mutableElements());if(e.length!==0){var i=e.boundingBox(),a=this.width(),s=this.height();r=r===void 0?this._private.zoom:r;var o={x:(a-r*(i.x1+i.x2))/2,y:(s-r*(i.y1+i.y2))/2};return o}}},reset:function(){return!this._private.panningEnabled||!this._private.zoomingEnabled?this:(this.viewport({pan:{x:0,y:0},zoom:1}),this)},invalidateSize:function(){this._private.sizeCache=null},size:function(){var e=this._private,r=e.container,n=this;return e.sizeCache=e.sizeCache||(r?(function(){var i=n.window().getComputedStyle(r),a=function(o){return parseFloat(i.getPropertyValue(o))};return{width:r.clientWidth-a("padding-left")-a("padding-right"),height:r.clientHeight-a("padding-top")-a("padding-bottom")}})():{width:1,height:1})},width:function(){return this.size().width},height:function(){return this.size().height},extent:function(){var e=this._private.pan,r=this._private.zoom,n=this.renderedExtent(),i={x1:(n.x1-e.x)/r,x2:(n.x2-e.x)/r,y1:(n.y1-e.y)/r,y2:(n.y2-e.y)/r};return i.w=i.x2-i.x1,i.h=i.y2-i.y1,i},renderedExtent:function(){var e=this.width(),r=this.height();return{x1:0,y1:0,x2:e,y2:r,w:e,h:r}},multiClickDebounceTime:function(e){if(e)this._private.multiClickDebounceTime=e;else return this._private.multiClickDebounceTime;return this}};Jf.centre=Jf.center,Jf.autolockNodes=Jf.autolock,Jf.autoungrabifyNodes=Jf.autoungrabify;var ow={data:xn.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeData:xn.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),scratch:xn.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:xn.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0})};ow.attr=ow.data,ow.removeAttr=ow.removeData;var lw=function(e){var r=this;e=Cr({},e);var n=e.container;n&&!l3(n)&&l3(n[0])&&(n=n[0]);var i=n?n._cyreg:null;i=i||{},i&&i.cy&&(i.cy.destroy(),i={});var a=i.readies=i.readies||[];n&&(n._cyreg=i),i.cy=r;var s=ca!==void 0&&n!==void 0&&!e.headless,o=e;o.layout=Cr({name:s?"grid":"null"},o.layout),o.renderer=Cr({name:s?"canvas":"null"},o.renderer);var l=function(g,m,y){return m!==void 0?m:y!==void 0?y:g},u=this._private={container:n,ready:!1,options:o,elements:new Ba(this),listeners:[],aniEles:new Ba(this),data:o.data||{},scratch:{},layout:null,renderer:null,destroyed:!1,notificationsEnabled:!0,minZoom:1e-50,maxZoom:1e50,zoomingEnabled:l(!0,o.zoomingEnabled),userZoomingEnabled:l(!0,o.userZoomingEnabled),panningEnabled:l(!0,o.panningEnabled),userPanningEnabled:l(!0,o.userPanningEnabled),boxSelectionEnabled:l(!0,o.boxSelectionEnabled),autolock:l(!1,o.autolock,o.autolockNodes),autoungrabify:l(!1,o.autoungrabify,o.autoungrabifyNodes),autounselectify:l(!1,o.autounselectify),styleEnabled:o.styleEnabled===void 0?s:o.styleEnabled,zoom:Ht(o.zoom)?o.zoom:1,pan:{x:an(o.pan)&&Ht(o.pan.x)?o.pan.x:0,y:an(o.pan)&&Ht(o.pan.y)?o.pan.y:0},animation:{current:[],queue:[]},hasCompoundNodes:!1,multiClickDebounceTime:l(250,o.multiClickDebounceTime)};this.createEmitter(),this.selectionType(o.selectionType),this.zoomRange({min:o.minZoom,max:o.maxZoom});var h=function(g,m){var y=g.some(cYe);if(y)return cm.all(g).then(m);m(g)};u.styleEnabled&&r.setStyle([]);var d=Cr({},o,o.renderer);r.initRenderer(d);var f=function(g,m,y){r.notifications(!1);var v=r.mutableElements();v.length>0&&v.remove(),g!=null&&(an(g)||Pn(g))&&r.add(g),r.one("layoutready",function(b){r.notifications(!0),r.emit(b),r.one("load",m),r.emitAndNotify("load")}).one("layoutstop",function(){r.one("done",y),r.emit("done")});var x=Cr({},r._private.options.layout);x.eles=r.elements(),r.layout(x).run()};h([o.style,o.elements],function(p){var g=p[0],m=p[1];u.styleEnabled&&r.style().append(g),f(m,function(){r.startAnimationLoop(),u.ready=!0,yi(o.ready)&&r.on("ready",o.ready);for(var y=0;y0,o=!!t.boundingBox,l=Ss(o?t.boundingBox:structuredClone(e.extent())),u;if(Ao(t.roots))u=t.roots;else if(Pn(t.roots)){for(var h=[],d=0;d0;){var A=F(),R=L(A,I);if(R)A.outgoers().filter(function(ve){return ve.isNode()&&r.has(ve)}).forEach(z);else if(R===null){bn("Detected double maximal shift for node `"+A.id()+"`. Bailing maximal adjustment due to cycle. Use `options.maximal: true` only on DAGs.");break}}}var N=0;if(t.avoidOverlap)for(var M=0;M0&&v[0].length<=3?Ve/2:0),nt=2*Math.PI/v[Ke].length*Ce;return Ke===0&&v[0].length===1&&(Qe=1),{x:re.x+Qe*Math.cos(nt),y:re.y+Qe*Math.sin(nt)}}else{var tt=v[Ke].length,Ze=Math.max(tt===1?0:o?(l.w-t.padding*2-le.w)/((t.grid?Ae:tt)-1):(l.w-t.padding*2-le.w)/((t.grid?Ae:tt)+1),N),ke={x:re.x+(Ce+1-(tt+1)/2)*Ze,y:re.y+(Ke+1-(W+1)/2)*fe};return ke}},Ne={downward:0,leftward:90,upward:180,rightward:-90};Object.keys(Ne).indexOf(t.direction)===-1&&fi("Invalid direction '".concat(t.direction,"' specified for breadthfirst layout. Valid values are: ").concat(Object.keys(Ne).join(", ")));var ge=function(ze){return BYe(Se(ze),l,Ne[t.direction])};return r.nodes().layoutPositions(this,t,ge),this};var kZe={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,radius:void 0,startAngle:3/2*Math.PI,sweep:void 0,clockwise:!0,sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}};function foe(t){this.options=Cr({},kZe,t)}foe.prototype.run=function(){var t=this.options,e=t,r=t.cy,n=e.eles,i=e.counterclockwise!==void 0?!e.counterclockwise:e.clockwise,a=n.nodes().not(":parent");e.sort&&(a=a.sort(e.sort));for(var s=Ss(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()}),o={x:s.x1+s.w/2,y:s.y1+s.h/2},l=e.sweep===void 0?2*Math.PI-2*Math.PI/a.length:e.sweep,u=l/Math.max(1,a.length-1),h,d=0,f=0;f1&&e.avoidOverlap){d*=1.75;var v=Math.cos(u)-Math.cos(0),x=Math.sin(u)-Math.sin(0),b=Math.sqrt(d*d/(v*v+x*x));h=Math.max(b,h)}var w=function(_,k){var S=e.startAngle+k*u*(i?1:-1),L=h*Math.cos(S),$=h*Math.sin(S),I={x:o.x+L,y:o.y+$};return I};return n.nodes().layoutPositions(this,e,w),this};var EZe={fit:!0,padding:30,startAngle:3/2*Math.PI,sweep:void 0,clockwise:!0,equidistant:!1,minNodeSpacing:10,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,height:void 0,width:void 0,spacingFactor:void 0,concentric:function(e){return e.degree()},levelWidth:function(e){return e.maxDegree()/4},animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}};function poe(t){this.options=Cr({},EZe,t)}poe.prototype.run=function(){for(var t=this.options,e=t,r=e.counterclockwise!==void 0?!e.counterclockwise:e.clockwise,n=t.cy,i=e.eles,a=i.nodes().not(":parent"),s=Ss(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()}),o={x:s.x1+s.w/2,y:s.y1+s.h/2},l=[],u=0,h=0;h0){var C=Math.abs(x[0].value-w.value);C>=y&&(x=[],v.push(x))}x.push(w)}var _=u+e.minNodeSpacing;if(!e.avoidOverlap){var k=v.length>0&&v[0].length>1,S=Math.min(s.w,s.h)/2-_,L=S/(v.length+k?1:0);_=Math.min(_,L)}for(var $=0,I=0;I1&&e.avoidOverlap){var R=Math.cos(A)-Math.cos(0),N=Math.sin(A)-Math.sin(0),M=Math.sqrt(_*_/(R*R+N*N));$=Math.max(M,$)}z.r=$,$+=_}if(e.equidistant){for(var D=0,O=0,B=0;B=t.numIter||(DZe(n,t),n.temperature=n.temperature*t.coolingFactor,n.temperature=t.animationThreshold&&a(),d3(h)}};h()}else{for(;u;)u=s(l),l++;boe(n,t),o()}return this},j3.prototype.stop=function(){return this.stopped=!0,this.thread&&this.thread.stop(),this.emit("layoutstop"),this},j3.prototype.destroy=function(){return this.thread&&this.thread.stop(),this};var _Ze=function(e,r,n){for(var i=n.eles.edges(),a=n.eles.nodes(),s=Ss(n.boundingBox?n.boundingBox:{x1:0,y1:0,w:e.width(),h:e.height()}),o={isCompound:e.hasCompoundNodes(),layoutNodes:[],idToIndex:{},nodeSize:a.size(),graphSet:[],indexToGraph:[],layoutEdges:[],edgeSize:i.size(),temperature:n.initialTemp,clientWidth:s.w,clientHeight:s.h,boundingBox:s},l=n.eles.components(),u={},h=0;h0){o.graphSet.push(S);for(var h=0;hi.count?0:i.graph},goe=function(e,r,n,i){var a=i.graphSet[n];if(-10)var d=i.nodeOverlap*h,f=Math.sqrt(o*o+l*l),p=d*o/f,g=d*l/f;else var m=K3(e,o,l),y=K3(r,-1*o,-1*l),v=y.x-m.x,x=y.y-m.y,b=v*v+x*x,f=Math.sqrt(b),d=(e.nodeRepulsion+r.nodeRepulsion)/b,p=d*v/f,g=d*x/f;e.isLocked||(e.offsetX-=p,e.offsetY-=g),r.isLocked||(r.offsetX+=p,r.offsetY+=g)}},$Ze=function(e,r,n,i){if(n>0)var a=e.maxX-r.minX;else var a=r.maxX-e.minX;if(i>0)var s=e.maxY-r.minY;else var s=r.maxY-e.minY;return a>=0&&s>=0?Math.sqrt(a*a+s*s):0},K3=function(e,r,n){var i=e.positionX,a=e.positionY,s=e.height||1,o=e.width||1,l=n/r,u=s/o,h={};return r===0&&0n?(h.x=i,h.y=a+s/2,h):0r&&-1*u<=l&&l<=u?(h.x=i-o/2,h.y=a-o*n/2/r,h):0=u)?(h.x=i+s*r/2/n,h.y=a+s/2,h):(0>n&&(l<=-1*u||l>=u)&&(h.x=i-s*r/2/n,h.y=a-s/2),h)},OZe=function(e,r){for(var n=0;nn){var y=r.gravity*p/m,v=r.gravity*g/m;f.offsetX+=y,f.offsetY+=v}}}}},BZe=function(e,r){var n=[],i=0,a=-1;for(n.push.apply(n,e.graphSet[0]),a+=e.graphSet[0].length;i<=a;){var s=n[i++],o=e.idToIndex[s],l=e.layoutNodes[o],u=l.children;if(0n)var a={x:n*e/i,y:n*r/i};else var a={x:e,y:r};return a},voe=function(e,r){var n=e.parentId;if(n!=null){var i=r.layoutNodes[r.idToIndex[n]],a=!1;if((i.maxX==null||e.maxX+i.padRight>i.maxX)&&(i.maxX=e.maxX+i.padRight,a=!0),(i.minX==null||e.minX-i.padLefti.maxY)&&(i.maxY=e.maxY+i.padBottom,a=!0),(i.minY==null||e.minY-i.padTopv&&(g+=y+r.componentSpacing,p=0,m=0,y=0)}}},GZe={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,avoidOverlapPadding:10,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,condense:!1,rows:void 0,cols:void 0,position:function(e){},sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}};function xoe(t){this.options=Cr({},GZe,t)}xoe.prototype.run=function(){var t=this.options,e=t,r=t.cy,n=e.eles,i=n.nodes().not(":parent");e.sort&&(i=i.sort(e.sort));var a=Ss(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()});if(a.h===0||a.w===0)n.nodes().layoutPositions(this,e,function(V){return{x:a.x1,y:a.y1}});else{var s=i.size(),o=Math.sqrt(s*a.h/a.w),l=Math.round(o),u=Math.round(a.w/a.h*o),h=function(H){if(H==null)return Math.min(l,u);var W=Math.min(l,u);W==l?l=H:u=H},d=function(H){if(H==null)return Math.max(l,u);var W=Math.max(l,u);W==l?l=H:u=H},f=e.rows,p=e.cols!=null?e.cols:e.columns;if(f!=null&&p!=null)l=f,u=p;else if(f!=null&&p==null)l=f,u=Math.ceil(s/l);else if(f==null&&p!=null)u=p,l=Math.ceil(s/u);else if(u*l>s){var g=h(),m=d();(g-1)*m>=s?h(g-1):(m-1)*g>=s&&d(m-1)}else for(;u*l=s?d(v+1):h(y+1)}var x=a.w/u,b=a.h/l;if(e.condense&&(x=0,b=0),e.avoidOverlap)for(var w=0;w=u&&(R=0,A++)},M={},D=0;D(R=RXe(t,e,N[M],N[M+1],N[M+2],N[M+3])))return y(k,R),!0}else if(L.edgeType==="bezier"||L.edgeType==="multibezier"||L.edgeType==="self"||L.edgeType==="compound"){for(var N=L.allpts,M=0;M+5(R=AXe(t,e,N[M],N[M+1],N[M+2],N[M+3],N[M+4],N[M+5])))return y(k,R),!0}for(var D=D||S.source,O=O||S.target,B=i.getArrowWidth($,I),P=[{name:"source",x:L.arrowStartX,y:L.arrowStartY,angle:L.srcArrowAngle},{name:"target",x:L.arrowEndX,y:L.arrowEndY,angle:L.tgtArrowAngle},{name:"mid-source",x:L.midX,y:L.midY,angle:L.midsrcArrowAngle},{name:"mid-target",x:L.midX,y:L.midY,angle:L.midtgtArrowAngle}],M=0;M0&&(v(D),v(O))}function b(k,S,L){return Es(k,S,L)}function w(k,S){var L=k._private,$=f,I;S?I=S+"-":I="",k.boundingBox();var z=L.labelBounds[S||"main"],F=k.pstyle(I+"label").value,A=k.pstyle("text-events").strValue==="yes";if(!(!A||!F)){var R=b(L.rscratch,"labelX",S),N=b(L.rscratch,"labelY",S),M=b(L.rscratch,"labelAngle",S),D=k.pstyle(I+"text-margin-x").pfValue,O=k.pstyle(I+"text-margin-y").pfValue,B=z.x1-$-D,P=z.x2+$-D,G=z.y1-$-O,V=z.y2+$-O;if(M){var H=Math.cos(M),W=Math.sin(M),ie=function(le,fe){return le=le-R,fe=fe-N,{x:le*H-fe*W+R,y:le*W+fe*H+N}},j=ie(B,G),ae=ie(B,V),J=ie(P,G),K=ie(P,V),Q=[j.x+D,j.y+O,J.x+D,J.y+O,K.x+D,K.y+O,ae.x+D,ae.y+O];if(to(t,e,Q))return y(k),!0}else if(ed(z,t,e))return y(k),!0}}for(var C=s.length-1;C>=0;C--){var _=s[C];_.isNode()?v(_)||w(_):x(_)||w(_)||w(_,"source")||w(_,"target")}return o},ep.getAllInBox=function(t,e,r,n){var i=this.getCachedZSortedEles().interactive,a=this.cy.zoom(),s=2/a,o=[],l=Math.min(t,r),u=Math.max(t,r),h=Math.min(e,n),d=Math.max(e,n);t=l,r=u,e=h,n=d;var f=Ss({x1:t,y1:e,x2:r,y2:n}),p=[{x:f.x1,y:f.y1},{x:f.x2,y:f.y1},{x:f.x2,y:f.y2},{x:f.x1,y:f.y2}],g=[[p[0],p[1]],[p[1],p[2]],[p[2],p[3]],[p[3],p[0]]];function m(le,fe,Ae){return Es(le,fe,Ae)}function y(le,fe){var Ae=le._private,Se=s,Ne="";le.boundingBox();var ge=Ae.labelBounds.main;if(!ge)return null;var ve=m(Ae.rscratch,"labelX",fe),ze=m(Ae.rscratch,"labelY",fe),xe=m(Ae.rscratch,"labelAngle",fe),Ke=le.pstyle(Ne+"text-margin-x").pfValue,Ce=le.pstyle(Ne+"text-margin-y").pfValue,Ve=ge.x1-Se-Ke,Qe=ge.x2+Se-Ke,nt=ge.y1-Se-Ce,tt=ge.y2+Se-Ce;if(xe){var Ze=Math.cos(xe),ke=Math.sin(xe),_e=function(he,Z){return he=he-ve,Z=Z-ze,{x:he*Ze-Z*ke+ve,y:he*ke+Z*Ze+ze}};return[_e(Ve,nt),_e(Qe,nt),_e(Qe,tt),_e(Ve,tt)]}else return[{x:Ve,y:nt},{x:Qe,y:nt},{x:Qe,y:tt},{x:Ve,y:tt}]}function v(le,fe,Ae,Se){function Ne(ge,ve,ze){return(ze.y-ge.y)*(ve.x-ge.x)>(ve.y-ge.y)*(ze.x-ge.x)}return Ne(le,Ae,Se)!==Ne(fe,Ae,Se)&&Ne(le,fe,Ae)!==Ne(le,fe,Se)}for(var x=0;x0?-(Math.PI-e.ang):Math.PI+e.ang},YZe=function(e,r,n,i,a){if(e!==Loe?Ioe(r,e,Tc):HZe(Jo,Tc),Ioe(r,n,Jo),Soe=Tc.nx*Jo.ny-Tc.ny*Jo.nx,_oe=Tc.nx*Jo.nx-Tc.ny*-Jo.ny,Bu=Math.asin(Math.max(-1,Math.min(1,Soe))),Math.abs(Bu)<1e-6){yN=r.x,vN=r.y,np=xm=0;return}tp=1,Q3=!1,_oe<0?Bu<0?Bu=Math.PI+Bu:(Bu=Math.PI-Bu,tp=-1,Q3=!0):Bu>0&&(tp=-1,Q3=!0),r.radius!==void 0?xm=r.radius:xm=i,rp=Bu/2,J3=Math.min(Tc.len/2,Jo.len/2),a?(wc=Math.abs(Math.cos(rp)*xm/Math.sin(rp)),wc>J3?(wc=J3,np=Math.abs(wc*Math.sin(rp)/Math.cos(rp))):np=xm):(wc=Math.min(J3,xm),np=Math.abs(wc*Math.sin(rp)/Math.cos(rp))),bN=r.x+Jo.nx*wc,xN=r.y+Jo.ny*wc,yN=bN-Jo.ny*np*tp,vN=xN+Jo.nx*np*tp,Aoe=r.x+Tc.nx*wc,Roe=r.y+Tc.ny*wc,Loe=r};function Doe(t,e){e.radius===0?t.lineTo(e.cx,e.cy):t.arc(e.cx,e.cy,e.radius,e.startAngle,e.endAngle,e.counterClockwise)}function TN(t,e,r,n){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0;return n===0||e.radius===0?{cx:e.x,cy:e.y,radius:0,startX:e.x,startY:e.y,stopX:e.x,stopY:e.y,startAngle:void 0,endAngle:void 0,counterClockwise:void 0}:(YZe(t,e,r,n,i),{cx:yN,cy:vN,radius:np,startX:Aoe,startY:Roe,stopX:bN,stopY:xN,startAngle:Tc.ang+Math.PI/2*tp,endAngle:Jo.ang-Math.PI/2*tp,counterClockwise:Q3})}var cw=.01,XZe=Math.sqrt(2*cw),os={};os.findMidptPtsEtc=function(t,e){var r=e.posPts,n=e.intersectionPts,i=e.vectorNormInverse,a,s=t.pstyle("source-endpoint"),o=t.pstyle("target-endpoint"),l=s.units!=null&&o.units!=null,u=function(C,_,k,S){var L=S-_,$=k-C,I=Math.sqrt($*$+L*L);return{x:-L/I,y:$/I}},h=t.pstyle("edge-distances").value;switch(h){case"node-position":a=r;break;case"intersection":a=n;break;case"endpoints":{if(l){var d=this.manualEndptToPx(t.source()[0],s),f=Qi(d,2),p=f[0],g=f[1],m=this.manualEndptToPx(t.target()[0],o),y=Qi(m,2),v=y[0],x=y[1],b={x1:p,y1:g,x2:v,y2:x};i=u(p,g,v,x),a=b}else bn("Edge ".concat(t.id()," has edge-distances:endpoints specified without manual endpoints specified via source-endpoint and target-endpoint. Falling back on edge-distances:intersection (default).")),a=n;break}}return{midptPts:a,vectorNormInverse:i}},os.findHaystackPoints=function(t){for(var e=0;e0?Math.max(Z-pe,0):Math.min(Z+pe,0)},F=z($,S),A=z(I,L),R=!1;x===u?v=Math.abs(F)>Math.abs(A)?i:n:x===l||x===o?(v=n,R=!0):(x===a||x===s)&&(v=i,R=!0);var N=v===n,M=N?A:F,D=N?I:$,O=W9(D),B=!1;!(R&&(w||_))&&(x===o&&D<0||x===l&&D>0||x===a&&D>0||x===s&&D<0)&&(O*=-1,M=O*Math.abs(M),B=!0);var P;if(w){var G=C<0?1+C:C;P=G*M}else{var V=C<0?M:0;P=V+C*O}var H=function(Z){return Math.abs(Z)=Math.abs(M)},W=H(P),ie=H(Math.abs(M)-Math.abs(P)),j=W||ie;if(j&&!B)if(N){var ae=Math.abs(D)<=f/2,J=Math.abs($)<=p/2;if(ae){var K=(h.x1+h.x2)/2,Q=h.y1,re=h.y2;r.segpts=[K,Q,K,re]}else if(J){var le=(h.y1+h.y2)/2,fe=h.x1,Ae=h.x2;r.segpts=[fe,le,Ae,le]}else r.segpts=[h.x1,h.y2]}else{var Se=Math.abs(D)<=d/2,Ne=Math.abs(I)<=g/2;if(Se){var ge=(h.y1+h.y2)/2,ve=h.x1,ze=h.x2;r.segpts=[ve,ge,ze,ge]}else if(Ne){var xe=(h.x1+h.x2)/2,Ke=h.y1,Ce=h.y2;r.segpts=[xe,Ke,xe,Ce]}else r.segpts=[h.x2,h.y1]}else if(N){var Ve=h.y1+P+(y?f/2*O:0),Qe=h.x1,nt=h.x2;r.segpts=[Qe,Ve,nt,Ve]}else{var tt=h.x1+P+(y?d/2*O:0),Ze=h.y1,ke=h.y2;r.segpts=[tt,Ze,tt,ke]}if(r.isRound){var _e=t.pstyle("taxi-radius").value,Y=t.pstyle("radius-type").value[0]==="arc-radius";r.radii=new Array(r.segpts.length/2).fill(_e),r.isArcRadius=new Array(r.segpts.length/2).fill(Y)}},os.tryToCorrectInvalidPoints=function(t,e){var r=t._private.rscratch;if(r.edgeType==="bezier"){var n=e.srcPos,i=e.tgtPos,a=e.srcW,s=e.srcH,o=e.tgtW,l=e.tgtH,u=e.srcShape,h=e.tgtShape,d=e.srcCornerRadius,f=e.tgtCornerRadius,p=e.srcRs,g=e.tgtRs,m=!Ht(r.startX)||!Ht(r.startY),y=!Ht(r.arrowStartX)||!Ht(r.arrowStartY),v=!Ht(r.endX)||!Ht(r.endY),x=!Ht(r.arrowEndX)||!Ht(r.arrowEndY),b=3,w=this.getArrowWidth(t.pstyle("width").pfValue,t.pstyle("arrow-scale").value)*this.arrowShapeWidth,C=b*w,_=jf({x:r.ctrlpts[0],y:r.ctrlpts[1]},{x:r.startX,y:r.startY}),k=_D.poolIndex()){var O=M;M=D,D=O}var B=F.srcPos=M.position(),P=F.tgtPos=D.position(),G=F.srcW=M.outerWidth(),V=F.srcH=M.outerHeight(),H=F.tgtW=D.outerWidth(),W=F.tgtH=D.outerHeight(),ie=F.srcShape=r.nodeShapes[e.getNodeShape(M)],j=F.tgtShape=r.nodeShapes[e.getNodeShape(D)],ae=F.srcCornerRadius=M.pstyle("corner-radius").value==="auto"?"auto":M.pstyle("corner-radius").pfValue,J=F.tgtCornerRadius=D.pstyle("corner-radius").value==="auto"?"auto":D.pstyle("corner-radius").pfValue,K=F.tgtRs=D._private.rscratch,Q=F.srcRs=M._private.rscratch;F.dirCounts={north:0,west:0,south:0,east:0,northwest:0,southwest:0,northeast:0,southeast:0};for(var re=0;re=XZe||(nt=Math.sqrt(Math.max(Qe*Qe,cw)+Math.max(Ve*Ve,cw)));var tt=F.vector={x:Qe,y:Ve},Ze=F.vectorNorm={x:tt.x/nt,y:tt.y/nt},ke={x:-Ze.y,y:Ze.x};F.nodesOverlap=!Ht(nt)||j.checkPoint(ge[0],ge[1],0,H,W,P.x,P.y,J,K)||ie.checkPoint(ze[0],ze[1],0,G,V,B.x,B.y,ae,Q),F.vectorNormInverse=ke,A={nodesOverlap:F.nodesOverlap,dirCounts:F.dirCounts,calculatedIntersection:!0,hasBezier:F.hasBezier,hasUnbundled:F.hasUnbundled,eles:F.eles,srcPos:P,srcRs:K,tgtPos:B,tgtRs:Q,srcW:H,srcH:W,tgtW:G,tgtH:V,srcIntn:xe,tgtIntn:ve,srcShape:j,tgtShape:ie,posPts:{x1:Ce.x2,y1:Ce.y2,x2:Ce.x1,y2:Ce.y1},intersectionPts:{x1:Ke.x2,y1:Ke.y2,x2:Ke.x1,y2:Ke.y1},vector:{x:-tt.x,y:-tt.y},vectorNorm:{x:-Ze.x,y:-Ze.y},vectorNormInverse:{x:-ke.x,y:-ke.y}}}var _e=Ne?A:F;fe.nodesOverlap=_e.nodesOverlap,fe.srcIntn=_e.srcIntn,fe.tgtIntn=_e.tgtIntn,fe.isRound=Ae.startsWith("round"),i&&(M.isParent()||M.isChild()||D.isParent()||D.isChild())&&(M.parents().anySame(D)||D.parents().anySame(M)||M.same(D)&&M.isParent())?e.findCompoundLoopPoints(le,_e,re,Se):M===D?e.findLoopPoints(le,_e,re,Se):Ae.endsWith("segments")?e.findSegmentsPoints(le,_e):Ae.endsWith("taxi")?e.findTaxiPoints(le,_e):Ae==="straight"||!Se&&F.eles.length%2===1&&re===Math.floor(F.eles.length/2)?e.findStraightEdgePoints(le):e.findBezierPoints(le,_e,re,Se,Ne),e.findEndpoints(le),e.tryToCorrectInvalidPoints(le,_e),e.checkForInvalidEdgeWarning(le),e.storeAllpts(le),e.storeEdgeProjections(le),e.calculateArrowAngles(le),e.recalculateEdgeLabelProjections(le),e.calculateLabelAngles(le)}},k=0;k0){var ge=u,ve=Kf(ge,nm(s)),ze=Kf(ge,nm(Ne)),xe=ve;if(ze2){var Ke=Kf(ge,{x:Ne[2],y:Ne[3]});Ke0){var ne=h,Be=Kf(ne,nm(s)),Te=Kf(ne,nm(pe)),Ue=Be;if(Te2){var De=Kf(ne,{x:pe[2],y:pe[3]});De=g||k){y={cp:w,segment:_};break}}if(y)break}var S=y.cp,L=y.segment,$=(g-v)/L.length,I=L.t1-L.t0,z=p?L.t0+I*$:L.t1-I*$;z=XT(0,z,1),e=im(S.p0,S.p1,S.p2,z),f=KZe(S.p0,S.p1,S.p2,z);break}case"straight":case"segments":case"haystack":{for(var F=0,A,R,N,M,D=n.allpts.length,O=0;O+3=g));O+=2);var B=g-R,P=B/A;P=XT(0,P,1),e=yXe(N,M,P),f=$oe(N,M);break}}s("labelX",d,e.x),s("labelY",d,e.y),s("labelAutoAngle",d,f)}};u("source"),u("target"),this.applyLabelDimensions(t)}},Cc.applyLabelDimensions=function(t){this.applyPrefixedLabelDimensions(t),t.isEdge()&&(this.applyPrefixedLabelDimensions(t,"source"),this.applyPrefixedLabelDimensions(t,"target"))},Cc.applyPrefixedLabelDimensions=function(t,e){var r=t._private,n=this.getLabelText(t,e),i=Xf(n,t._private.labelDimsKey);if(Es(r.rscratch,"prefixedLabelDimsKey",e)!==i){bc(r.rscratch,"prefixedLabelDimsKey",e,i);var a=this.calculateLabelDimensions(t,n),s=t.pstyle("line-height").pfValue,o=t.pstyle("font-size").pfValue,l=t.pstyle("text-wrap").strValue,u=Es(r.rscratch,"labelWrapCachedLines",e)||[],h=l!=="wrap"?1:Math.max(u.length,1),d=o*s,f=a.width,p=a.height+(h-1)*(s-1)*o;bc(r.rstyle,"labelWidth",e,f),bc(r.rscratch,"labelWidth",e,f),bc(r.rstyle,"labelHeight",e,p),bc(r.rscratch,"labelHeight",e,p),bc(r.rscratch,"labelLineHeight",e,d),bc(r.rscratch,"labelActualDescent",e,a.labelActualDescent)}},Cc.getLabelText=function(t,e){var r=t._private,n=e?e+"-":"",i=t.pstyle(n+"label").strValue,a=t.pstyle("text-transform").value,s=function(V,H){return H?(bc(r.rscratch,V,e,H),H):Es(r.rscratch,V,e)};if(!i)return"";a=="none"||(a=="uppercase"?i=i.toUpperCase():a=="lowercase"&&(i=i.toLowerCase()));var o=t.pstyle("text-wrap").value;if(o==="wrap"){var l=s("labelKey");if(l!=null&&s("labelWrapKey")===l)return s("labelWrapCachedText");for(var u="​",h=i.split(` +`),d=t.pstyle("text-max-width").pfValue,f=t.pstyle("text-overflow-wrap").value,p=f==="anywhere",g=[],m=/[\s\u200b]+|$/g,y=0;yd){var C=v.matchAll(m),_="",k=0,S=eo(C),L;try{for(S.s();!(L=S.n()).done;){var $=L.value,I=$[0],z=v.substring(k,$.index);k=$.index+I.length;var F=_.length===0?z:_+z+I,A=this.calculateLabelDimensions(t,F),R=A.width;R<=d?_+=z+I:(_&&g.push(_),_=z+I)}}catch(G){S.e(G)}finally{S.f()}_.match(/^[\s\u200b]+$/)||g.push(_)}else g.push(v)}s("labelWrapCachedLines",g),i=s("labelWrapCachedText",g.join(` +`)),s("labelWrapKey",l)}else if(o==="ellipsis"){var N=t.pstyle("text-max-width").pfValue,M="",D="…",O=!1;if(this.calculateLabelDimensions(t,i).widthN)break;M+=i[B],B===i.length-1&&(O=!0)}return O||(M+=D),M}return i},Cc.getLabelJustification=function(t){var e=t.pstyle("text-justification").strValue,r=t.pstyle("text-halign").strValue;return e==="auto"?t.isNode()?PKe(r):"center":e},Cc.calculateLabelDimensions=function(t,e){var r=this,n=r.cy.window(),i=n.document,a=0,s=t.pstyle("font-style").strValue,o=t.pstyle("font-size").pfValue,l=t.pstyle("font-family").strValue,u=t.pstyle("font-weight").strValue,h=t.pstyle("text-metrics").strValue||"font",d=this.labelCalcCanvas,f=this.labelCalcCanvasContext;if(!d){d=this.labelCalcCanvas=i.createElement("canvas"),f=this.labelCalcCanvasContext=d.getContext("2d");var p=d.style;p.position="absolute",p.left="-9999px",p.top="-9999px",p.zIndex="-1",p.visibility="hidden",p.pointerEvents="none"}f.font="".concat(s," ").concat(u," ").concat(o,"px ").concat(l);for(var g=0,m=0,y=e.split(` +`),v=y.length,x=0,b=0,w=0;w1&&arguments[1]!==void 0?arguments[1]:!0;if(e.merge(s),o)for(var l=0;l=t.desktopTapThreshold2}var Tt=a(Y);ct&&(t.hoverData.tapholdCancelled=!0);var dt=function(){var Vt=t.hoverData.dragDelta=t.hoverData.dragDelta||[];Vt.length===0?(Vt.push(it[0]),Vt.push(it[1])):(Vt[0]+=it[0],Vt[1]+=it[1])};Z=!0,i(Le,["mousemove","vmousemove","tapdrag"],Y,{x:Te[0],y:Te[1]});var oe=function(Vt){return{originalEvent:Y,type:Vt,position:{x:Te[0],y:Te[1]}}},Rt=function(){t.data.bgActivePosistion=void 0,t.hoverData.selecting||pe.emit(oe("boxstart")),qe[4]=1,t.hoverData.selecting=!0,t.redrawHint("select",!0),t.redraw()};if(t.hoverData.which===3){if(ct){var ft=oe("cxtdrag");Ie?Ie.emit(ft):pe.emit(ft),t.hoverData.cxtDragged=!0,(!t.hoverData.cxtOver||Le!==t.hoverData.cxtOver)&&(t.hoverData.cxtOver&&t.hoverData.cxtOver.emit(oe("cxtdragout")),t.hoverData.cxtOver=Le,Le&&Le.emit(oe("cxtdragover")))}}else if(t.hoverData.dragging){if(Z=!0,pe.panningEnabled()&&pe.userPanningEnabled()){var ht;if(t.hoverData.justStartedPan){var kt=t.hoverData.mdownPos;ht={x:(Te[0]-kt[0])*ne,y:(Te[1]-kt[1])*ne},t.hoverData.justStartedPan=!1}else ht={x:it[0]*ne,y:it[1]*ne};pe.panBy(ht),pe.emit(oe("dragpan")),t.hoverData.dragged=!0}Te=t.projectIntoViewport(Y.clientX,Y.clientY)}else if(qe[4]==1&&(Ie==null||Ie.pannable())){if(ct){if(!t.hoverData.dragging&&pe.boxSelectionEnabled()&&(Tt||!pe.panningEnabled()||!pe.userPanningEnabled()))Rt();else if(!t.hoverData.selecting&&pe.panningEnabled()&&pe.userPanningEnabled()){var qr=s(Ie,t.hoverData.downs);qr&&(t.hoverData.dragging=!0,t.hoverData.justStartedPan=!0,qe[4]=0,t.data.bgActivePosistion=nm(Ue),t.redrawHint("select",!0),t.redraw())}Ie&&Ie.pannable()&&Ie.active()&&Ie.unactivate()}}else{if(Ie&&Ie.pannable()&&Ie.active()&&Ie.unactivate(),(!Ie||!Ie.grabbed())&&Le!=Xe&&(Xe&&i(Xe,["mouseout","tapdragout"],Y,{x:Te[0],y:Te[1]}),Le&&i(Le,["mouseover","tapdragover"],Y,{x:Te[0],y:Te[1]}),t.hoverData.last=Le),Ie)if(ct){if(pe.boxSelectionEnabled()&&Tt)Ie&&Ie.grabbed()&&(m(we),Ie.emit(oe("freeon")),we.emit(oe("free")),t.dragData.didDrag&&(Ie.emit(oe("dragfreeon")),we.emit(oe("dragfree")))),Rt();else if(Ie&&Ie.grabbed()&&t.nodeIsDraggable(Ie)){var ye=!t.dragData.didDrag;ye&&t.redrawHint("eles",!0),t.dragData.didDrag=!0,t.hoverData.draggingEles||p(we,{inDragLayer:!0});var et={x:0,y:0};if(Ht(it[0])&&Ht(it[1])&&(et.x+=it[0],et.y+=it[1],ye)){var ut=t.hoverData.dragDelta;ut&&Ht(ut[0])&&Ht(ut[1])&&(et.x+=ut[0],et.y+=ut[1])}t.hoverData.draggingEles=!0,we.silentShift(et).emit(oe("position")).emit(oe("drag")),t.redrawHint("drag",!0),t.redraw()}}else dt();Z=!0}if(qe[2]=Te[0],qe[3]=Te[1],Z)return Y.stopPropagation&&Y.stopPropagation(),Y.preventDefault&&Y.preventDefault(),!1}},!1);var $,I,z;t.registerBinding(e,"mouseup",function(Y){if(!(t.hoverData.which===1&&Y.which!==1&&t.hoverData.capture)){var he=t.hoverData.capture;if(he){t.hoverData.capture=!1;var Z=t.cy,pe=t.projectIntoViewport(Y.clientX,Y.clientY),ne=t.selection,Be=t.findNearestElement(pe[0],pe[1],!0,!1),Te=t.dragData.possibleDragElements,Ue=t.hoverData.down,De=a(Y);t.data.bgActivePosistion&&(t.redrawHint("select",!0),t.redraw()),t.hoverData.tapholdCancelled=!0,t.data.bgActivePosistion=void 0,Ue&&Ue.unactivate();var qe=function(be){return{originalEvent:Y,type:be,position:{x:pe[0],y:pe[1]}}};if(t.hoverData.which===3){var Le=qe("cxttapend");if(Ue?Ue.emit(Le):Z.emit(Le),!t.hoverData.cxtDragged){var Xe=qe("cxttap");Ue?Ue.emit(Xe):Z.emit(Xe)}t.hoverData.cxtDragged=!1,t.hoverData.which=null}else if(t.hoverData.which===1){if(i(Be,["mouseup","tapend","vmouseup"],Y,{x:pe[0],y:pe[1]}),!t.dragData.didDrag&&!t.hoverData.dragged&&!t.hoverData.selecting&&!t.hoverData.isOverThresholdDrag&&(i(Ue,["click","tap","vclick"],Y,{x:pe[0],y:pe[1]}),I=!1,Y.timeStamp-z<=Z.multiClickDebounceTime()?($&&clearTimeout($),I=!0,z=null,i(Ue,["dblclick","dbltap","vdblclick"],Y,{x:pe[0],y:pe[1]})):($=setTimeout(function(){I||i(Ue,["oneclick","onetap","voneclick"],Y,{x:pe[0],y:pe[1]})},Z.multiClickDebounceTime()),z=Y.timeStamp)),Ue==null&&!t.dragData.didDrag&&!t.hoverData.selecting&&!t.hoverData.dragged&&!a(Y)&&(Z.$(r).unselect(["tapunselect"]),Te.length>0&&t.redrawHint("eles",!0),t.dragData.possibleDragElements=Te=Z.collection()),Be==Ue&&!t.dragData.didDrag&&!t.hoverData.selecting&&Be!=null&&Be._private.selectable&&(t.hoverData.dragging||(Z.selectionType()==="additive"||De?Be.selected()?Be.unselect(["tapunselect"]):Be.select(["tapselect"]):De||(Z.$(r).unmerge(Be).unselect(["tapunselect"]),Be.select(["tapselect"]))),t.redrawHint("eles",!0)),t.hoverData.selecting){var Ie=Z.collection(t.getAllInBox(ne[0],ne[1],ne[2],ne[3]));t.redrawHint("select",!0),Ie.length>0&&t.redrawHint("eles",!0),Z.emit(qe("boxend"));var it=function(be){return be.selectable()&&!be.selected()};Z.selectionType()==="additive"||De||Z.$(r).unmerge(Ie).unselect(),Ie.emit(qe("box")).stdFilter(it).select().emit(qe("boxselect")),t.redraw()}if(t.hoverData.dragging&&(t.hoverData.dragging=!1,t.redrawHint("select",!0),t.redrawHint("eles",!0),t.redraw()),!ne[4]){t.redrawHint("drag",!0),t.redrawHint("eles",!0);var we=Ue&&Ue.grabbed();m(Te),we&&(Ue.emit(qe("freeon")),Te.emit(qe("free")),t.dragData.didDrag&&(Ue.emit(qe("dragfreeon")),Te.emit(qe("dragfree"))))}}ne[4]=0,t.hoverData.down=null,t.hoverData.cxtStarted=!1,t.hoverData.draggingEles=!1,t.hoverData.selecting=!1,t.hoverData.isOverThresholdDrag=!1,t.dragData.didDrag=!1,t.hoverData.dragged=!1,t.hoverData.dragDelta=[],t.hoverData.mdownPos=null,t.hoverData.mdownGPos=null,t.hoverData.which=null}}},!1);var F=[],A=4,R,N=1e5,M=function(Y,he){for(var Z=0;Z=A){var pe=F;if(R=M(pe,5),!R){var ne=Math.abs(pe[0]);R=D(pe)&&ne>5}if(R)for(var Be=0;Be5&&(Z=W9(Z)*5),Xe=Z/-250,R&&(Xe/=N,Xe*=3),Xe=Xe*t.wheelSensitivity;var Ie=Y.deltaMode===1;Ie&&(Xe*=33);var it=Te.zoom()*Math.pow(10,Xe);Y.type==="gesturechange"&&(it=t.gestureStartZoom*Y.scale),Te.zoom({level:it,renderedPosition:{x:Le[0],y:Le[1]}}),Te.emit({type:Y.type==="gesturechange"?"pinchzoom":"scrollzoom",originalEvent:Y,position:{x:qe[0],y:qe[1]}})}}}};t.registerBinding(t.container,"wheel",O,!0),t.registerBinding(e,"scroll",function(Y){t.scrollingPage=!0,clearTimeout(t.scrollingPageTimeout),t.scrollingPageTimeout=setTimeout(function(){t.scrollingPage=!1},250)},!0),t.registerBinding(t.container,"gesturestart",function(Y){t.gestureStartZoom=t.cy.zoom(),t.hasTouchStarted||Y.preventDefault()},!0),t.registerBinding(t.container,"gesturechange",function(_e){t.hasTouchStarted||O(_e)},!0),t.registerBinding(t.container,"mouseout",function(Y){var he=t.projectIntoViewport(Y.clientX,Y.clientY);t.cy.emit({originalEvent:Y,type:"mouseout",position:{x:he[0],y:he[1]}})},!1),t.registerBinding(t.container,"mouseover",function(Y){var he=t.projectIntoViewport(Y.clientX,Y.clientY);t.cy.emit({originalEvent:Y,type:"mouseover",position:{x:he[0],y:he[1]}})},!1);var B,P,G,V,H,W,ie,j,ae,J,K,Q,re,le=function(Y,he,Z,pe){return Math.sqrt((Z-Y)*(Z-Y)+(pe-he)*(pe-he))},fe=function(Y,he,Z,pe){return(Z-Y)*(Z-Y)+(pe-he)*(pe-he)},Ae;t.registerBinding(t.container,"touchstart",Ae=function(Y){if(t.hasTouchStarted=!0,!!S(Y)){v(),t.touchData.capture=!0,t.data.bgActivePosistion=void 0;var he=t.cy,Z=t.touchData.now,pe=t.touchData.earlier;if(Y.touches[0]){var ne=t.projectIntoViewport(Y.touches[0].clientX,Y.touches[0].clientY);Z[0]=ne[0],Z[1]=ne[1]}if(Y.touches[1]){var ne=t.projectIntoViewport(Y.touches[1].clientX,Y.touches[1].clientY);Z[2]=ne[0],Z[3]=ne[1]}if(Y.touches[2]){var ne=t.projectIntoViewport(Y.touches[2].clientX,Y.touches[2].clientY);Z[4]=ne[0],Z[5]=ne[1]}var Be=function(Tt){return{originalEvent:Y,type:Tt,position:{x:Z[0],y:Z[1]}}};if(Y.touches[1]){t.touchData.singleTouchMoved=!0,m(t.dragData.touchDragEles);var Te=t.findContainerClientCoords();ae=Te[0],J=Te[1],K=Te[2],Q=Te[3],B=Y.touches[0].clientX-ae,P=Y.touches[0].clientY-J,G=Y.touches[1].clientX-ae,V=Y.touches[1].clientY-J,re=0<=B&&B<=K&&0<=G&&G<=K&&0<=P&&P<=Q&&0<=V&&V<=Q;var Ue=he.pan(),De=he.zoom();H=le(B,P,G,V),W=fe(B,P,G,V),ie=[(B+G)/2,(P+V)/2],j=[(ie[0]-Ue.x)/De,(ie[1]-Ue.y)/De];var qe=200,Le=qe*qe;if(W=1){for(var _t=t.touchData.startPosition=[null,null,null,null,null,null],bt=0;bt=t.touchTapThreshold2}if(he&&t.touchData.cxt){Y.preventDefault();var bt=Y.touches[0].clientX-ae,lt=Y.touches[0].clientY-J,Mt=Y.touches[1].clientX-ae,Tt=Y.touches[1].clientY-J,dt=fe(bt,lt,Mt,Tt),oe=dt/W,Rt=150,ft=Rt*Rt,ht=1.5,kt=ht*ht;if(oe>=kt||dt>=ft){t.touchData.cxt=!1,t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var qr=De("cxttapend");t.touchData.start?(t.touchData.start.unactivate().emit(qr),t.touchData.start=null):pe.emit(qr)}}if(he&&t.touchData.cxt){var qr=De("cxtdrag");t.data.bgActivePosistion=void 0,t.redrawHint("select",!0),t.touchData.start?t.touchData.start.emit(qr):pe.emit(qr),t.touchData.start&&(t.touchData.start._private.grabbed=!1),t.touchData.cxtDragged=!0;var ye=t.findNearestElement(ne[0],ne[1],!0,!0);(!t.touchData.cxtOver||ye!==t.touchData.cxtOver)&&(t.touchData.cxtOver&&t.touchData.cxtOver.emit(De("cxtdragout")),t.touchData.cxtOver=ye,ye&&ye.emit(De("cxtdragover")))}else if(he&&Y.touches[2]&&pe.boxSelectionEnabled())Y.preventDefault(),t.data.bgActivePosistion=void 0,this.lastThreeTouch=+new Date,t.touchData.selecting||pe.emit(De("boxstart")),t.touchData.selecting=!0,t.touchData.didSelect=!0,Z[4]=1,!Z||Z.length===0||Z[0]===void 0?(Z[0]=(ne[0]+ne[2]+ne[4])/3,Z[1]=(ne[1]+ne[3]+ne[5])/3,Z[2]=(ne[0]+ne[2]+ne[4])/3+1,Z[3]=(ne[1]+ne[3]+ne[5])/3+1):(Z[2]=(ne[0]+ne[2]+ne[4])/3,Z[3]=(ne[1]+ne[3]+ne[5])/3),t.redrawHint("select",!0),t.redraw();else if(he&&Y.touches[1]&&!t.touchData.didSelect&&pe.zoomingEnabled()&&pe.panningEnabled()&&pe.userZoomingEnabled()&&pe.userPanningEnabled()){Y.preventDefault(),t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var et=t.dragData.touchDragEles;if(et){t.redrawHint("drag",!0);for(var ut=0;ut0&&!t.hoverData.draggingEles&&!t.swipePanning&&t.data.bgActivePosistion!=null&&(t.data.bgActivePosistion=void 0,t.redrawHint("select",!0),t.redraw())}},!1);var Ne;t.registerBinding(e,"touchcancel",Ne=function(Y){var he=t.touchData.start;t.touchData.capture=!1,he&&he.unactivate()});var ge,ve,ze,xe;if(t.registerBinding(e,"touchend",ge=function(Y){var he=t.touchData.start,Z=t.touchData.capture;if(Z)Y.touches.length===0&&(t.touchData.capture=!1),Y.preventDefault();else return;var pe=t.selection;t.swipePanning=!1,t.hoverData.draggingEles=!1;var ne=t.cy,Be=ne.zoom(),Te=t.touchData.now,Ue=t.touchData.earlier;if(Y.touches[0]){var De=t.projectIntoViewport(Y.touches[0].clientX,Y.touches[0].clientY);Te[0]=De[0],Te[1]=De[1]}if(Y.touches[1]){var De=t.projectIntoViewport(Y.touches[1].clientX,Y.touches[1].clientY);Te[2]=De[0],Te[3]=De[1]}if(Y.touches[2]){var De=t.projectIntoViewport(Y.touches[2].clientX,Y.touches[2].clientY);Te[4]=De[0],Te[5]=De[1]}var qe=function(ft){return{originalEvent:Y,type:ft,position:{x:Te[0],y:Te[1]}}};he&&he.unactivate();var Le;if(t.touchData.cxt){if(Le=qe("cxttapend"),he?he.emit(Le):ne.emit(Le),!t.touchData.cxtDragged){var Xe=qe("cxttap");he?he.emit(Xe):ne.emit(Xe)}t.touchData.start&&(t.touchData.start._private.grabbed=!1),t.touchData.cxt=!1,t.touchData.start=null,t.redraw();return}if(!Y.touches[2]&&ne.boxSelectionEnabled()&&t.touchData.selecting){t.touchData.selecting=!1;var Ie=ne.collection(t.getAllInBox(pe[0],pe[1],pe[2],pe[3]));pe[0]=void 0,pe[1]=void 0,pe[2]=void 0,pe[3]=void 0,pe[4]=0,t.redrawHint("select",!0),ne.emit(qe("boxend"));var it=function(ft){return ft.selectable()&&!ft.selected()};Ie.emit(qe("box")).stdFilter(it).select().emit(qe("boxselect")),Ie.nonempty()&&t.redrawHint("eles",!0),t.redraw()}if(he!=null&&he.unactivate(),Y.touches[2])t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);else if(!Y.touches[1]){if(!Y.touches[0]){if(!Y.touches[0]){t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var we=t.dragData.touchDragEles;if(he!=null){var ct=he._private.grabbed;m(we),t.redrawHint("drag",!0),t.redrawHint("eles",!0),ct&&(he.emit(qe("freeon")),we.emit(qe("free")),t.dragData.didDrag&&(he.emit(qe("dragfreeon")),we.emit(qe("dragfree")))),i(he,["touchend","tapend","vmouseup","tapdragout"],Y,{x:Te[0],y:Te[1]}),he.unactivate(),t.touchData.start=null}else{var be=t.findNearestElement(Te[0],Te[1],!0,!0);i(be,["touchend","tapend","vmouseup","tapdragout"],Y,{x:Te[0],y:Te[1]})}var _t=t.touchData.startPosition[0]-Te[0],bt=_t*_t,lt=t.touchData.startPosition[1]-Te[1],Mt=lt*lt,Tt=bt+Mt,dt=Tt*Be*Be;t.touchData.singleTouchMoved||(he||ne.$(":selected").unselect(["tapunselect"]),i(he,["tap","vclick"],Y,{x:Te[0],y:Te[1]}),ve=!1,Y.timeStamp-xe<=ne.multiClickDebounceTime()?(ze&&clearTimeout(ze),ve=!0,xe=null,i(he,["dbltap","vdblclick"],Y,{x:Te[0],y:Te[1]})):(ze=setTimeout(function(){ve||i(he,["onetap","voneclick"],Y,{x:Te[0],y:Te[1]})},ne.multiClickDebounceTime()),xe=Y.timeStamp)),he!=null&&!t.dragData.didDrag&&he._private.selectable&&dt"u"){var Ke=[],Ce=function(Y){return{clientX:Y.clientX,clientY:Y.clientY,force:1,identifier:Y.pointerId,pageX:Y.pageX,pageY:Y.pageY,radiusX:Y.width/2,radiusY:Y.height/2,screenX:Y.screenX,screenY:Y.screenY,target:Y.target}},Ve=function(Y){return{event:Y,touch:Ce(Y)}},Qe=function(Y){Ke.push(Ve(Y))},nt=function(Y){for(var he=0;he0)return G[0]}return null},g=Object.keys(f),m=0;m0?p:Qie(a,s,e,r,n,i,o,l)},checkPoint:function(e,r,n,i,a,s,o,l){l=l==="auto"?rd(i,a):l;var u=2*l;if(Pu(e,r,this.points,s,o,i,a-u,[0,-1],n)||Pu(e,r,this.points,s,o,i-u,a,[0,-1],n))return!0;var h=i/2+2*n,d=a/2+2*n,f=[s-h,o-d,s-h,o,s+h,o,s+h,o-d];return!!(to(e,r,f)||Zf(e,r,u,u,s+i/2-l,o+a/2-l,n)||Zf(e,r,u,u,s-i/2+l,o+a/2-l,n))}}},Fu.registerNodeShapes=function(){var t=this.nodeShapes={},e=this;this.generateEllipse(),this.generatePolygon("triangle",_s(3,0)),this.generateRoundPolygon("round-triangle",_s(3,0)),this.generatePolygon("rectangle",_s(4,0)),t.square=t.rectangle,this.generateRoundRectangle(),this.generateCutRectangle(),this.generateBarrel(),this.generateBottomRoundrectangle();{var r=[0,1,1,0,0,-1,-1,0];this.generatePolygon("diamond",r),this.generateRoundPolygon("round-diamond",r)}this.generatePolygon("pentagon",_s(5,0)),this.generateRoundPolygon("round-pentagon",_s(5,0)),this.generatePolygon("hexagon",_s(6,0)),this.generateRoundPolygon("round-hexagon",_s(6,0)),this.generatePolygon("heptagon",_s(7,0)),this.generateRoundPolygon("round-heptagon",_s(7,0)),this.generatePolygon("octagon",_s(8,0)),this.generateRoundPolygon("round-octagon",_s(8,0));var n=new Array(20);{var i=Y9(5,0),a=Y9(5,Math.PI/5),s=.5*(3-Math.sqrt(5));s*=1.57;for(var o=0;o=e.deqFastCost*w)break}else if(u){if(x>=e.deqCost*p||x>=e.deqAvgCost*f)break}else if(b>=e.deqNoDrawCost*CN)break;var C=e.deq(n,y,m);if(C.length>0)for(var _=0;_0&&(e.onDeqd(n,g),!u&&e.shouldRedraw(n,g,y,m)&&a())},o=e.priority||B9;i.beforeRender(s,o(n))}}}},eQe=(function(){function t(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:p3;Xh(this,t),this.idsByKey=new Ou,this.keyForId=new Ou,this.cachesByLvl=new Ou,this.lvls=[],this.getKey=e,this.doesEleInvalidateKey=r}return jh(t,[{key:"getIdsFor",value:function(r){r==null&&fi("Can not get id list for null key");var n=this.idsByKey,i=this.idsByKey.get(r);return i||(i=new rm,n.set(r,i)),i}},{key:"addIdForKey",value:function(r,n){r!=null&&this.getIdsFor(r).add(n)}},{key:"deleteIdForKey",value:function(r,n){r!=null&&this.getIdsFor(r).delete(n)}},{key:"getNumberOfIdsForKey",value:function(r){return r==null?0:this.getIdsFor(r).size}},{key:"updateKeyMappingFor",value:function(r){var n=r.id(),i=this.keyForId.get(n),a=this.getKey(r);this.deleteIdForKey(i,n),this.addIdForKey(a,n),this.keyForId.set(n,a)}},{key:"deleteKeyMappingFor",value:function(r){var n=r.id(),i=this.keyForId.get(n);this.deleteIdForKey(i,n),this.keyForId.delete(n)}},{key:"keyHasChangedFor",value:function(r){var n=r.id(),i=this.keyForId.get(n),a=this.getKey(r);return i!==a}},{key:"isInvalid",value:function(r){return this.keyHasChangedFor(r)||this.doesEleInvalidateKey(r)}},{key:"getCachesAt",value:function(r){var n=this.cachesByLvl,i=this.lvls,a=n.get(r);return a||(a=new Ou,n.set(r,a),i.push(r)),a}},{key:"getCache",value:function(r,n){return this.getCachesAt(n).get(r)}},{key:"get",value:function(r,n){var i=this.getKey(r),a=this.getCache(i,n);return a!=null&&this.updateKeyMappingFor(r),a}},{key:"getForCachedKey",value:function(r,n){var i=this.keyForId.get(r.id()),a=this.getCache(i,n);return a}},{key:"hasCache",value:function(r,n){return this.getCachesAt(n).has(r)}},{key:"has",value:function(r,n){var i=this.getKey(r);return this.hasCache(i,n)}},{key:"setCache",value:function(r,n,i){i.key=r,this.getCachesAt(n).set(r,i)}},{key:"set",value:function(r,n,i){var a=this.getKey(r);this.setCache(a,n,i),this.updateKeyMappingFor(r)}},{key:"deleteCache",value:function(r,n){this.getCachesAt(n).delete(r)}},{key:"delete",value:function(r,n){var i=this.getKey(r);this.deleteCache(i,n)}},{key:"invalidateKey",value:function(r){var n=this;this.lvls.forEach(function(i){return n.deleteCache(r,i)})}},{key:"invalidate",value:function(r){var n=r.id(),i=this.keyForId.get(n);this.deleteKeyMappingFor(r);var a=this.doesEleInvalidateKey(r);return a&&this.invalidateKey(i),a||this.getNumberOfIdsForKey(i)===0}}])})(),Uoe=25,rS=50,nS=-4,kN=3,Hoe=7.99,tQe=8,rQe=1024,nQe=1024,iQe=1024,aQe=.2,sQe=.8,oQe=10,lQe=.15,cQe=.1,uQe=.9,hQe=.9,dQe=100,fQe=1,Cm={dequeue:"dequeue",downscale:"downscale",highQuality:"highQuality"},pQe=Oa({getKey:null,doesEleInvalidateKey:p3,drawElement:null,getBoundingBox:null,getRotationPoint:null,getRotationOffset:null,isVisible:Fie,allowEdgeTxrCaching:!0,allowParentTxrCaching:!0}),dw=function(e,r){var n=this;n.renderer=e,n.onDequeues=[];var i=pQe(r);Cr(n,i),n.lookup=new eQe(i.getKey,i.doesEleInvalidateKey),n.setupDequeueing()},ha=dw.prototype;ha.reasons=Cm,ha.getTextureQueue=function(t){var e=this;return e.eleImgCaches=e.eleImgCaches||{},e.eleImgCaches[t]=e.eleImgCaches[t]||[]},ha.getRetiredTextureQueue=function(t){var e=this,r=e.eleImgCaches.retired=e.eleImgCaches.retired||{},n=r[t]=r[t]||[];return n},ha.getElementQueue=function(){var t=this,e=t.eleCacheQueue=t.eleCacheQueue||new YT(function(r,n){return n.reqs-r.reqs});return e},ha.getElementKeyToQueue=function(){var t=this,e=t.eleKeyToCacheQueue=t.eleKeyToCacheQueue||{};return e},ha.getElement=function(t,e,r,n,i){var a=this,s=this.renderer,o=s.cy.zoom(),l=this.lookup;if(!e||e.w===0||e.h===0||isNaN(e.w)||isNaN(e.h)||!t.visible()||t.removed()||!a.allowEdgeTxrCaching&&t.isEdge()||!a.allowParentTxrCaching&&t.isParent())return null;if(n==null&&(n=Math.ceil(V9(o*r))),n=Hoe||n>kN)return null;var u=Math.pow(2,n),h=e.h*u,d=e.w*u,f=s.eleTextBiggerThanMin(t,u);if(!this.isVisible(t,f))return null;var p=l.get(t,n);if(p&&p.invalidated&&(p.invalidated=!1,p.texture.invalidatedWidth-=p.width),p)return p;var g;if(h<=Uoe?g=Uoe:h<=rS?g=rS:g=Math.ceil(h/rS)*rS,h>iQe||d>nQe)return null;var m=a.getTextureQueue(g),y=m[m.length-2],v=function(){return a.recycleTexture(g,d)||a.addTexture(g,d)};y||(y=m[m.length-1]),y||(y=v()),y.width-y.usedWidthn;I--)L=a.getElement(t,e,r,I,Cm.downscale);$()}else return a.queueElement(t,_.level-1),_;else{var z;if(!b&&!w&&!C)for(var F=n-1;F>=nS;F--){var A=l.get(t,F);if(A){z=A;break}}if(x(z))return a.queueElement(t,n),z;y.context.translate(y.usedWidth,0),y.context.scale(u,u),this.drawElement(y.context,t,e,f,!1),y.context.scale(1/u,1/u),y.context.translate(-y.usedWidth,0)}return p={x:y.usedWidth,texture:y,level:n,scale:u,width:d,height:h,scaledLabelShown:f},y.usedWidth+=Math.ceil(d+tQe),y.eleCaches.push(p),l.set(t,n,p),a.checkTextureFullness(y),p},ha.invalidateElements=function(t){for(var e=0;e=aQe*t.width&&this.retireTexture(t)},ha.checkTextureFullness=function(t){var e=this,r=e.getTextureQueue(t.height);t.usedWidth/t.width>sQe&&t.fullnessChecks>=oQe?Jh(r,t):t.fullnessChecks++},ha.retireTexture=function(t){var e=this,r=t.height,n=e.getTextureQueue(r),i=this.lookup;Jh(n,t),t.retired=!0;for(var a=t.eleCaches,s=0;s=e)return s.retired=!1,s.usedWidth=0,s.invalidatedWidth=0,s.fullnessChecks=0,F9(s.eleCaches),s.context.setTransform(1,0,0,1,0,0),s.context.clearRect(0,0,s.width,s.height),Jh(i,s),n.push(s),s}},ha.queueElement=function(t,e){var r=this,n=r.getElementQueue(),i=r.getElementKeyToQueue(),a=this.getKey(t),s=i[a];if(s)s.level=Math.max(s.level,e),s.eles.merge(t),s.reqs++,n.updateItem(s);else{var o={eles:t.spawn().merge(t),level:e,reqs:1,key:a};n.push(o),i[a]=o}},ha.dequeue=function(t){for(var e=this,r=e.getElementQueue(),n=e.getElementKeyToQueue(),i=[],a=e.lookup,s=0;s0;s++){var o=r.pop(),l=o.key,u=o.eles[0],h=a.hasCache(u,o.level);if(n[l]=null,h)continue;i.push(o);var d=e.getBoundingBox(u);e.getElement(u,d,t,o.level,Cm.dequeue)}return i},ha.removeFromQueue=function(t){var e=this,r=e.getElementQueue(),n=e.getElementKeyToQueue(),i=this.getKey(t),a=n[i];a!=null&&(a.eles.length===1?(a.reqs=P9,r.updateItem(a),r.pop(),n[i]=null):a.eles.unmerge(t))},ha.onDequeue=function(t){this.onDequeues.push(t)},ha.offDequeue=function(t){Jh(this.onDequeues,t)},ha.setupDequeueing=Woe.setupDequeueing({deqRedrawThreshold:dQe,deqCost:lQe,deqAvgCost:cQe,deqNoDrawCost:uQe,deqFastCost:hQe,deq:function(e,r,n){return e.dequeue(r,n)},onDeqd:function(e,r){for(var n=0;n=mQe||r>iS)return null}n.validateLayersElesOrdering(r,t);var l=n.layersByLevel,u=Math.pow(2,r),h=l[r]=l[r]||[],d,f=n.levelIsComplete(r,t),p,g=function(){var $=function(R){if(n.validateLayersElesOrdering(R,t),n.levelIsComplete(R,t))return p=l[R],!0},I=function(R){if(!p)for(var N=r+R;fw<=N&&N<=iS&&!$(N);N+=R);};I(1),I(-1);for(var z=h.length-1;z>=0;z--){var F=h[z];F.invalid&&Jh(h,F)}};if(!f)g();else return h;var m=function(){if(!d){d=Ss();for(var $=0;$Xoe||F>Xoe)return null;var A=z*F;if(A>kQe)return null;var R=n.makeLayer(d,r);if(I!=null){var N=h.indexOf(I)+1;h.splice(N,0,R)}else($.insert===void 0||$.insert)&&h.unshift(R);return R};if(n.skipping&&!o)return null;for(var v=null,x=t.length/gQe,b=!o,w=0;w=x||!Zie(v.bb,C.boundingBox()))&&(v=y({insert:!0,after:v}),!v))return null;p||b?n.queueLayer(v,C):n.drawEleInLayer(v,C,r,e),v.eles.push(C),k[r]=v}return p||(b?null:h)},Fa.getEleLevelForLayerLevel=function(t,e){return t},Fa.drawEleInLayer=function(t,e,r,n){var i=this,a=this.renderer,s=t.context,o=e.boundingBox();o.w===0||o.h===0||!e.visible()||(r=i.getEleLevelForLayerLevel(r,n),a.setImgSmoothing(s,!1),a.drawCachedElement(s,e,null,null,r,EQe),a.setImgSmoothing(s,!0))},Fa.levelIsComplete=function(t,e){var r=this,n=r.layersByLevel[t];if(!n||n.length===0)return!1;for(var i=0,a=0;a0||s.invalid)return!1;i+=s.eles.length}return i===e.length},Fa.validateLayersElesOrdering=function(t,e){var r=this.layersByLevel[t];if(r)for(var n=0;n0){e=!0;break}}return e},Fa.invalidateElements=function(t){var e=this;t.length!==0&&(e.lastInvalidationTime=$u(),!(t.length===0||!e.haveLayers())&&e.updateElementsInLayers(t,function(n,i,a){e.invalidateLayer(n)}))},Fa.invalidateLayer=function(t){if(this.lastInvalidationTime=$u(),!t.invalid){var e=t.level,r=t.eles,n=this.layersByLevel[e];Jh(n,t),t.elesQueue=[],t.invalid=!0,t.replacement&&(t.replacement.invalid=!0);for(var i=0;i3&&arguments[3]!==void 0?arguments[3]:!0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,s=this,o=e._private.rscratch;if(!(a&&!e.visible())&&!(o.badLine||o.allpts==null||isNaN(o.allpts[0]))){var l;r&&(l=r,t.translate(-l.x1,-l.y1));var u=a?e.pstyle("opacity").value:1,h=a?e.pstyle("line-opacity").value:1,d=e.pstyle("curve-style").value,f=e.pstyle("line-style").value,p=e.pstyle("width").pfValue,g=e.pstyle("line-cap").value,m=e.pstyle("line-outline-width").value,y=e.pstyle("line-outline-color").value,v=u*h,x=u*h,b=function(){var R=arguments.length>0&&arguments[0]!==void 0?arguments[0]:v;d==="straight-triangle"?(s.eleStrokeStyle(t,e,R),s.drawEdgeTrianglePath(e,t,o.allpts)):(t.lineWidth=p,t.lineCap=g,s.eleStrokeStyle(t,e,R),s.drawEdgePath(e,t,o.allpts,f),t.lineCap="butt")},w=function(){var R=arguments.length>0&&arguments[0]!==void 0?arguments[0]:v;if(t.lineWidth=p+m,t.lineCap=g,m>0)s.colorStrokeStyle(t,y[0],y[1],y[2],R);else{t.lineCap="butt";return}d==="straight-triangle"?s.drawEdgeTrianglePath(e,t,o.allpts):(s.drawEdgePath(e,t,o.allpts,f),t.lineCap="butt")},C=function(){i&&s.drawEdgeOverlay(t,e)},_=function(){i&&s.drawEdgeUnderlay(t,e)},k=function(){var R=arguments.length>0&&arguments[0]!==void 0?arguments[0]:x;s.drawArrowheads(t,e,R)},S=function(){s.drawElementText(t,e,null,n)};t.lineJoin="round";var L=e.pstyle("ghost").value==="yes";if(L){var $=e.pstyle("ghost-offset-x").pfValue,I=e.pstyle("ghost-offset-y").pfValue,z=e.pstyle("ghost-opacity").value,F=v*z;t.translate($,I),b(F),k(F),t.translate(-$,-I)}else w();_(),b(),k(),C(),S(),r&&t.translate(l.x1,l.y1)}};var ele=function(e){if(!["overlay","underlay"].includes(e))throw new Error("Invalid state");return function(r,n){if(n.visible()){var i=n.pstyle("".concat(e,"-opacity")).value;if(i!==0){var a=this,s=a.usePaths(),o=n._private.rscratch,l=n.pstyle("".concat(e,"-padding")).pfValue,u=2*l,h=n.pstyle("".concat(e,"-color")).value;r.lineWidth=u,o.edgeType==="self"&&!s?r.lineCap="butt":r.lineCap="round",a.colorStrokeStyle(r,h[0],h[1],h[2],i),a.drawEdgePath(n,r,o.allpts,"solid")}}}};zu.drawEdgeOverlay=ele("overlay"),zu.drawEdgeUnderlay=ele("underlay"),zu.drawEdgePath=function(t,e,r,n){var i=t._private.rscratch,a=e,s,o=!1,l=this.usePaths(),u=t.pstyle("line-dash-pattern").pfValue,h=t.pstyle("line-dash-offset").pfValue;if(l){var d=r.join("$"),f=i.pathCacheKey&&i.pathCacheKey===d;f?(s=e=i.pathCache,o=!0):(s=e=new Path2D,i.pathCacheKey=d,i.pathCache=s)}if(a.setLineDash)switch(n){case"dotted":a.setLineDash([1,1]);break;case"dashed":a.setLineDash(u),a.lineDashOffset=h;break;case"solid":a.setLineDash([]);break}if(!o&&!i.badLine)switch(e.beginPath&&e.beginPath(),e.moveTo(r[0],r[1]),i.edgeType){case"bezier":case"self":case"compound":case"multibezier":for(var p=2;p+35&&arguments[5]!==void 0?arguments[5]:!0,s=this;if(n==null){if(a&&!s.eleTextBiggerThanMin(e))return}else if(n===!1)return;if(e.isNode()){var o=e.pstyle("label");if(!o||!o.value)return;var l=s.getLabelJustification(e),u=e.pstyle("text-metrics").strValue==="glyph";t.textAlign=l,t.textBaseline=u?"alphabetic":"bottom"}else{var h=e.element()._private.rscratch.badLine,d=e.pstyle("label"),f=e.pstyle("source-label"),p=e.pstyle("target-label");if(h||(!d||!d.value)&&(!f||!f.value)&&(!p||!p.value))return;t.textAlign="center",t.textBaseline="bottom"}var g=!r,m;r&&(m=r,t.translate(-m.x1,-m.y1)),i==null?(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),r&&t.translate(m.x1,m.y1)},ip.getFontCache=function(t){var e;this.fontCaches=this.fontCaches||[];for(var r=0;r2&&arguments[2]!==void 0?arguments[2]:!0,n=e.pstyle("font-style").strValue,i=e.pstyle("font-size").pfValue+"px",a=e.pstyle("font-family").strValue,s=e.pstyle("font-weight").strValue,o=r?e.effectiveOpacity()*e.pstyle("text-opacity").value:1,l=e.pstyle("text-outline-opacity").value*o,u=e.pstyle("color").value,h=e.pstyle("text-outline-color").value;t.font=n+" "+s+" "+i+" "+a,t.lineJoin="round",this.colorFillStyle(t,u[0],u[1],u[2],o),this.colorStrokeStyle(t,h[0],h[1],h[2],l)};function OQe(t,e,r,n,i){var a=Math.min(n,i),s=a/2,o=e+n/2,l=r+i/2;t.beginPath(),t.arc(o,l,s,0,Math.PI*2),t.closePath()}function tle(t,e,r,n,i){var a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:5,s=Math.min(a,n/2,i/2);t.beginPath(),t.moveTo(e+s,r),t.lineTo(e+n-s,r),t.quadraticCurveTo(e+n,r,e+n,r+s),t.lineTo(e+n,r+i-s),t.quadraticCurveTo(e+n,r+i,e+n-s,r+i),t.lineTo(e+s,r+i),t.quadraticCurveTo(e,r+i,e,r+i-s),t.lineTo(e,r+s),t.quadraticCurveTo(e,r,e+s,r),t.closePath()}ip.getTextAngle=function(t,e){var r,n=t._private,i=n.rscratch,a=e?e+"-":"",s=t.pstyle(a+"text-rotation");if(s.strValue==="autorotate"){var o=Es(i,"labelAngle",e);r=t.isEdge()?o:0}else s.strValue==="none"?r=0:r=s.pfValue;return r},ip.drawText=function(t,e,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,a=e._private,s=a.rscratch,o=i?e.effectiveOpacity():1;if(!(i&&(o===0||e.pstyle("text-opacity").value===0))){r==="main"&&(r=null);var l=Es(s,"labelX",r),u=Es(s,"labelY",r),h,d,f=this.getLabelText(e,r);if(f!=null&&f!==""&&!isNaN(l)&&!isNaN(u)){this.setupTextStyle(t,e,i);var p=r?r+"-":"",g=Es(s,"labelWidth",r),m=Es(s,"labelHeight",r),y=Es(s,"labelActualDescent",r),v=e.pstyle(p+"text-margin-x").pfValue,x=e.pstyle(p+"text-margin-y").pfValue,b=e.isEdge(),w=e.pstyle("text-halign").value,C=e.pstyle("text-valign").value;b&&(w="center",C="center"),l+=v,u+=x;var _;n?_=this.getTextAngle(e,r):_=0,_!==0&&(h=l,d=u,t.translate(h,d),t.rotate(_),l=0,u=0);var k=fm(w),S=pm(C);switch(S){case"top":break;case"center":u+=m/2;break;case"bottom":u+=m;break}var L=e.pstyle("text-background-opacity").value,$=e.pstyle("text-border-opacity").value,I=e.pstyle("text-border-width").pfValue,z=e.pstyle("text-background-padding").pfValue,F=e.pstyle("text-background-shape").strValue,A=F==="round-rectangle"||F==="roundrectangle",R=F==="circle",N=2;if(L>0||I>0&&$>0){var M=t.fillStyle,D=t.strokeStyle,O=t.lineWidth,B=e.pstyle("text-background-color").value,P=e.pstyle("text-border-color").value,G=e.pstyle("text-border-style").value,V=L>0,H=I>0&&$>0,W=l-z;switch(k){case"left":W-=g;break;case"center":W-=g/2;break}var ie=u-m-z,j=g+2*z,ae=m+2*z;if(V&&(t.fillStyle="rgba(".concat(B[0],",").concat(B[1],",").concat(B[2],",").concat(L*o,")")),H&&(t.strokeStyle="rgba(".concat(P[0],",").concat(P[1],",").concat(P[2],",").concat($*o,")"),t.lineWidth=I,t.setLineDash))switch(G){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash([4,2]);break;case"double":t.lineWidth=I/4,t.setLineDash([]);break;case"solid":default:t.setLineDash([]);break}if(A?(t.beginPath(),tle(t,W,ie,j,ae,N)):R?(t.beginPath(),OQe(t,W,ie,j,ae)):(t.beginPath(),t.rect(W,ie,j,ae)),V&&t.fill(),H&&t.stroke(),H&&G==="double"){var J=I/2;t.beginPath(),A?tle(t,W+J,ie+J,j-2*J,ae-2*J,N):t.rect(W+J,ie+J,j-2*J,ae-2*J),t.stroke()}t.fillStyle=M,t.strokeStyle=D,t.lineWidth=O,t.setLineDash&&t.setLineDash([])}var K=2*e.pstyle("text-outline-width").pfValue;if(K>0&&(t.lineWidth=K),u-=y,e.pstyle("text-wrap").value==="wrap"){var Q=Es(s,"labelWrapCachedLines",r),re=Es(s,"labelLineHeight",r),le=g/2,fe=this.getLabelJustification(e);switch(fe==="auto"||(k==="left"?fe==="left"?l+=-g:fe==="center"&&(l+=-le):k==="center"?fe==="left"?l+=-le:fe==="right"&&(l+=le):k==="right"&&(fe==="center"?l+=le:fe==="right"&&(l+=g))),S){case"top":u-=(Q.length-1)*re;break;case"center":case"bottom":u-=(Q.length-1)*re;break}for(var Ae=0;Ae0&&t.strokeText(Q[Ae],l,u),t.fillText(Q[Ae],l,u),u+=re}else K>0&&t.strokeText(f,l,u),t.fillText(f,l,u);_!==0&&(t.rotate(-_),t.translate(-h,-d))}}};var hd={};hd.drawNode=function(t,e,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,s=this,o,l,u=e._private,h=u.rscratch,d=e.position();if(!(!Ht(d.x)||!Ht(d.y))&&!(a&&!e.visible())){var f=a?e.effectiveOpacity():1,p=s.usePaths(),g,m=!1,y=e.padding();o=e.width()+2*y,l=e.height()+2*y;var v;r&&(v=r,t.translate(-v.x1,-v.y1));for(var x=e.pstyle("background-image"),b=x.value,w=new Array(b.length),C=new Array(b.length),_=0,k=0;k0&&arguments[0]!==void 0?arguments[0]:F;s.eleFillStyle(t,e,Y)},J=function(){var Y=arguments.length>0&&arguments[0]!==void 0?arguments[0]:P;s.colorStrokeStyle(t,A[0],A[1],A[2],Y)},K=function(){var Y=arguments.length>0&&arguments[0]!==void 0?arguments[0]:W;s.colorStrokeStyle(t,V[0],V[1],V[2],Y)},Q=function(Y,he,Z,pe){var ne=s.nodePathCache=s.nodePathCache||[],Be=Pie(Z==="polygon"?Z+","+pe.join(","):Z,""+he,""+Y,""+j),Te=ne[Be],Ue,De=!1;return Te!=null?(Ue=Te,De=!0,h.pathCache=Ue):(Ue=new Path2D,ne[Be]=h.pathCache=Ue),{path:Ue,cacheHit:De}},re=e.pstyle("shape").strValue,le=e.pstyle("shape-polygon-points").pfValue;if(p){t.translate(d.x,d.y);var fe=Q(o,l,re,le);g=fe.path,m=fe.cacheHit}var Ae=function(){if(!m){var Y=d;p&&(Y={x:0,y:0}),s.nodeShapes[s.getNodeShape(e)].draw(g||t,Y.x,Y.y,o,l,j,h)}p?t.fill(g):t.fill()},Se=function(){for(var Y=arguments.length>0&&arguments[0]!==void 0?arguments[0]:f,he=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,Z=u.backgrounding,pe=0,ne=0;ne0&&arguments[0]!==void 0?arguments[0]:!1,he=arguments.length>1&&arguments[1]!==void 0?arguments[1]:f;s.hasPie(e)&&(s.drawPie(t,e,he),Y&&(p||s.nodeShapes[s.getNodeShape(e)].draw(t,d.x,d.y,o,l,j,h)))},ge=function(){var Y=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,he=arguments.length>1&&arguments[1]!==void 0?arguments[1]:f;s.hasStripe(e)&&(t.save(),p?t.clip(h.pathCache):(s.nodeShapes[s.getNodeShape(e)].draw(t,d.x,d.y,o,l,j,h),t.clip()),s.drawStripe(t,e,he),t.restore(),Y&&(p||s.nodeShapes[s.getNodeShape(e)].draw(t,d.x,d.y,o,l,j,h)))},ve=function(){var Y=arguments.length>0&&arguments[0]!==void 0?arguments[0]:f,he=(I>0?I:-I)*Y,Z=I>0?0:255;I!==0&&(s.colorFillStyle(t,Z,Z,Z,he),p?t.fill(g):t.fill())},ze=function(){if(z>0){if(t.lineWidth=z,t.lineCap=M,t.lineJoin=N,t.setLineDash)switch(R){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash(O),t.lineDashOffset=B;break;case"solid":case"double":t.setLineDash([]);break}if(D!=="center"){if(t.save(),t.lineWidth*=2,D==="inside")p?t.clip(g):t.clip();else{var Y=new Path2D;Y.rect(-o/2-z,-l/2-z,o+2*z,l+2*z),Y.addPath(g),t.clip(Y,"evenodd")}p?t.stroke(g):t.stroke(),t.restore()}else p?t.stroke(g):t.stroke();if(R==="double"){t.lineWidth=z/3;var he=t.globalCompositeOperation;t.globalCompositeOperation="destination-out",p?t.stroke(g):t.stroke(),t.globalCompositeOperation=he}t.setLineDash&&t.setLineDash([])}},xe=function(){if(G>0){if(t.lineWidth=G,t.lineCap="butt",t.setLineDash)switch(H){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash([4,2]);break;case"solid":case"double":t.setLineDash([]);break}var Y=d;p&&(Y={x:0,y:0});var he=s.getNodeShape(e),Z=z;D==="inside"&&(Z=0),D==="outside"&&(Z*=2);var pe=(o+Z+(G+ie))/o,ne=(l+Z+(G+ie))/l,Be=o*pe,Te=l*ne,Ue=s.nodeShapes[he].points,De;if(p){var qe=Q(Be,Te,he,Ue);De=qe.path}if(he==="ellipse")s.drawEllipsePath(De||t,Y.x,Y.y,Be,Te);else if(["round-diamond","round-heptagon","round-hexagon","round-octagon","round-pentagon","round-polygon","round-triangle","round-tag"].includes(he)){var Le=0,Xe=0,Ie=0;he==="round-diamond"?Le=(Z+ie+G)*1.4:he==="round-heptagon"?(Le=(Z+ie+G)*1.075,Ie=-(Z/2+ie+G)/35):he==="round-hexagon"?Le=(Z+ie+G)*1.12:he==="round-pentagon"?(Le=(Z+ie+G)*1.13,Ie=-(Z/2+ie+G)/15):he==="round-tag"?(Le=(Z+ie+G)*1.12,Xe=(Z/2+G+ie)*.07):he==="round-triangle"&&(Le=(Z+ie+G)*(Math.PI/2),Ie=-(Z+ie/2+G)/Math.PI),Le!==0&&(pe=(o+Le)/o,Be=o*pe,["round-hexagon","round-tag"].includes(he)||(ne=(l+Le)/l,Te=l*ne)),j=j==="auto"?eae(Be,Te):j;for(var it=Be/2,we=Te/2,ct=j+(Z+G+ie)/2,be=new Array(Ue.length/2),_t=new Array(Ue.length/2),bt=0;bt0){if(i=i||n.position(),a==null||s==null){var p=n.padding();a=n.width()+2*p,s=n.height()+2*p}o.colorFillStyle(r,h[0],h[1],h[2],u),o.nodeShapes[d].draw(r,i.x,i.y,a+l*2,s+l*2,f),r.fill()}}}};hd.drawNodeOverlay=rle("overlay"),hd.drawNodeUnderlay=rle("underlay"),hd.hasPie=function(t){return t=t[0],t._private.hasPie},hd.hasStripe=function(t){return t=t[0],t._private.hasStripe},hd.drawPie=function(t,e,r,n){e=e[0],n=n||e.position();var i=e.cy().style(),a=e.pstyle("pie-size"),s=e.pstyle("pie-hole"),o=e.pstyle("pie-start-angle").pfValue,l=n.x,u=n.y,h=e.width(),d=e.height(),f=Math.min(h,d)/2,p,g=0,m=this.usePaths();if(m&&(l=0,u=0),a.units==="%"?f=f*a.pfValue:a.pfValue!==void 0&&(f=a.pfValue/2),s.units==="%"?p=f*s.pfValue:s.pfValue!==void 0&&(p=s.pfValue/2),!(p>=f))for(var y=1;y<=i.pieBackgroundN;y++){var v=e.pstyle("pie-"+y+"-background-size").value,x=e.pstyle("pie-"+y+"-background-color").value,b=e.pstyle("pie-"+y+"-background-opacity").value*r,w=v/100;w+g>1&&(w=1-g);var C=1.5*Math.PI+2*Math.PI*g;C+=o;var _=2*Math.PI*w,k=C+_;v===0||g>=1||g+w>1||(p===0?(t.beginPath(),t.moveTo(l,u),t.arc(l,u,f,C,k),t.closePath()):(t.beginPath(),t.arc(l,u,f,C,k),t.arc(l,u,p,k,C,!0),t.closePath()),this.colorFillStyle(t,x[0],x[1],x[2],b),t.fill(),g+=w)}},hd.drawStripe=function(t,e,r,n){e=e[0],n=n||e.position();var i=e.cy().style(),a=n.x,s=n.y,o=e.width(),l=e.height(),u=0,h=this.usePaths();t.save();var d=e.pstyle("stripe-direction").value,f=e.pstyle("stripe-size");switch(d){case"vertical":break;case"righward":t.rotate(-Math.PI/2);break}var p=o,g=l;f.units==="%"?(p=p*f.pfValue,g=g*f.pfValue):f.pfValue!==void 0&&(p=f.pfValue,g=f.pfValue),h&&(a=0,s=0),s-=p/2,a-=g/2;for(var m=1;m<=i.stripeBackgroundN;m++){var y=e.pstyle("stripe-"+m+"-background-size").value,v=e.pstyle("stripe-"+m+"-background-color").value,x=e.pstyle("stripe-"+m+"-background-opacity").value*r,b=y/100;b+u>1&&(b=1-u),!(y===0||u>=1||u+b>1)&&(t.beginPath(),t.rect(a,s+g*u,p,g*b),t.closePath(),this.colorFillStyle(t,v[0],v[1],v[2],x),t.fill(),u+=b)}t.restore()};var As={},PQe=100;As.getPixelRatio=function(){var t=this.data.contexts[0];if(this.forcedPixelRatio!=null)return this.forcedPixelRatio;var e=this.cy.window(),r=t.backingStorePixelRatio||t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1;return(e.devicePixelRatio||1)/r},As.paintCache=function(t){for(var e=this.paintCaches=this.paintCaches||[],r=!0,n,i=0;ie.minMbLowQualFrames&&(e.motionBlurPxRatio=e.mbPxRBlurry)),e.clearingMotionBlur&&(e.motionBlurPxRatio=1),e.textureDrawLastFrame&&!d&&(h[e.NODE]=!0,h[e.SELECT_BOX]=!0);var x=r.style(),b=r.zoom(),w=s!==void 0?s:b,C=r.pan(),_={x:C.x,y:C.y},k={zoom:b,pan:{x:C.x,y:C.y}},S=e.prevViewport,L=S===void 0||k.zoom!==S.zoom||k.pan.x!==S.pan.x||k.pan.y!==S.pan.y;!L&&!(m&&!g)&&(e.motionBlurPxRatio=1),o&&(_=o),w*=l,_.x*=l,_.y*=l;var $=e.getCachedZSortedEles();function I(J,K,Q,re,le){var fe=J.globalCompositeOperation;J.globalCompositeOperation="destination-out",e.colorFillStyle(J,255,255,255,e.motionBlurTransparency),J.fillRect(K,Q,re,le),J.globalCompositeOperation=fe}function z(J,K){var Q,re,le,fe;!e.clearingMotionBlur&&(J===u.bufferContexts[e.MOTIONBLUR_BUFFER_NODE]||J===u.bufferContexts[e.MOTIONBLUR_BUFFER_DRAG])?(Q={x:C.x*p,y:C.y*p},re=b*p,le=e.canvasWidth*p,fe=e.canvasHeight*p):(Q=_,re=w,le=e.canvasWidth,fe=e.canvasHeight),J.setTransform(1,0,0,1,0,0),K==="motionBlur"?I(J,0,0,le,fe):!n&&(K===void 0||K)&&J.clearRect(0,0,le,fe),i||(J.translate(Q.x,Q.y),J.scale(re,re)),o&&J.translate(o.x,o.y),s&&J.scale(s,s)}if(d||(e.textureDrawLastFrame=!1),d){if(e.textureDrawLastFrame=!0,!e.textureCache){e.textureCache={},e.textureCache.bb=r.mutableElements().boundingBox(),e.textureCache.texture=e.data.bufferCanvases[e.TEXTURE_BUFFER];var F=e.data.bufferContexts[e.TEXTURE_BUFFER];F.setTransform(1,0,0,1,0,0),F.clearRect(0,0,e.canvasWidth*e.textureMult,e.canvasHeight*e.textureMult),e.render({forcedContext:F,drawOnlyNodeLayer:!0,forcedPxRatio:l*e.textureMult});var k=e.textureCache.viewport={zoom:r.zoom(),pan:r.pan(),width:e.canvasWidth,height:e.canvasHeight};k.mpan={x:(0-k.pan.x)/k.zoom,y:(0-k.pan.y)/k.zoom}}h[e.DRAG]=!1,h[e.NODE]=!1;var A=u.contexts[e.NODE],R=e.textureCache.texture,k=e.textureCache.viewport;A.setTransform(1,0,0,1,0,0),f?I(A,0,0,k.width,k.height):A.clearRect(0,0,k.width,k.height);var N=x.core("outside-texture-bg-color").value,M=x.core("outside-texture-bg-opacity").value;e.colorFillStyle(A,N[0],N[1],N[2],M),A.fillRect(0,0,k.width,k.height);var b=r.zoom();z(A,!1),A.clearRect(k.mpan.x,k.mpan.y,k.width/k.zoom/l,k.height/k.zoom/l),A.drawImage(R,k.mpan.x,k.mpan.y,k.width/k.zoom/l,k.height/k.zoom/l)}else e.textureOnViewport&&!n&&(e.textureCache=null);var D=r.extent(),O=e.pinching||e.hoverData.dragging||e.swipePanning||e.data.wheelZooming||e.hoverData.draggingEles||e.cy.animated(),B=e.hideEdgesOnViewport&&O,P=[];if(P[e.NODE]=!h[e.NODE]&&f&&!e.clearedForMotionBlur[e.NODE]||e.clearingMotionBlur,P[e.NODE]&&(e.clearedForMotionBlur[e.NODE]=!0),P[e.DRAG]=!h[e.DRAG]&&f&&!e.clearedForMotionBlur[e.DRAG]||e.clearingMotionBlur,P[e.DRAG]&&(e.clearedForMotionBlur[e.DRAG]=!0),h[e.NODE]||i||a||P[e.NODE]){var G=f&&!P[e.NODE]&&p!==1,A=n||(G?e.data.bufferContexts[e.MOTIONBLUR_BUFFER_NODE]:u.contexts[e.NODE]),V=f&&!G?"motionBlur":void 0;z(A,V),B?e.drawCachedNodes(A,$.nondrag,l,D):e.drawLayeredElements(A,$.nondrag,l,D),e.debug&&e.drawDebugPoints(A,$.nondrag),!i&&!f&&(h[e.NODE]=!1)}if(!a&&(h[e.DRAG]||i||P[e.DRAG])){var G=f&&!P[e.DRAG]&&p!==1,A=n||(G?e.data.bufferContexts[e.MOTIONBLUR_BUFFER_DRAG]:u.contexts[e.DRAG]);z(A,f&&!G?"motionBlur":void 0),B?e.drawCachedNodes(A,$.drag,l,D):e.drawCachedElements(A,$.drag,l,D),e.debug&&e.drawDebugPoints(A,$.drag),!i&&!f&&(h[e.DRAG]=!1)}if(this.drawSelectionRectangle(t,z),f&&p!==1){var H=u.contexts[e.NODE],W=e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_NODE],ie=u.contexts[e.DRAG],j=e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_DRAG],ae=function(K,Q,re){K.setTransform(1,0,0,1,0,0),re||!v?K.clearRect(0,0,e.canvasWidth,e.canvasHeight):I(K,0,0,e.canvasWidth,e.canvasHeight);var le=p;K.drawImage(Q,0,0,e.canvasWidth*le,e.canvasHeight*le,0,0,e.canvasWidth,e.canvasHeight)};(h[e.NODE]||P[e.NODE])&&(ae(H,W,P[e.NODE]),h[e.NODE]=!1),(h[e.DRAG]||P[e.DRAG])&&(ae(ie,j,P[e.DRAG]),h[e.DRAG]=!1)}e.prevViewport=k,e.clearingMotionBlur&&(e.clearingMotionBlur=!1,e.motionBlurCleared=!0,e.motionBlur=!0),f&&(e.motionBlurTimeout=setTimeout(function(){e.motionBlurTimeout=null,e.clearedForMotionBlur[e.NODE]=!1,e.clearedForMotionBlur[e.DRAG]=!1,e.motionBlur=!1,e.clearingMotionBlur=!d,e.mbFrames=0,h[e.NODE]=!0,h[e.DRAG]=!0,e.redraw()},PQe)),n||r.emit("render")};var pw;As.drawSelectionRectangle=function(t,e){var r=this,n=r.cy,i=r.data,a=n.style(),s=t.drawOnlyNodeLayer,o=t.drawAllLayers,l=i.canvasNeedsRedraw,u=t.forcedContext;if(r.showFps||!s&&l[r.SELECT_BOX]&&!o){var h=u||i.contexts[r.SELECT_BOX];if(e(h),r.selection[4]==1&&(r.hoverData.selecting||r.touchData.selecting)){var d=r.cy.zoom(),f=a.core("selection-box-border-width").value/d;h.lineWidth=f,h.fillStyle="rgba("+a.core("selection-box-color").value[0]+","+a.core("selection-box-color").value[1]+","+a.core("selection-box-color").value[2]+","+a.core("selection-box-opacity").value+")",h.fillRect(r.selection[0],r.selection[1],r.selection[2]-r.selection[0],r.selection[3]-r.selection[1]),f>0&&(h.strokeStyle="rgba("+a.core("selection-box-border-color").value[0]+","+a.core("selection-box-border-color").value[1]+","+a.core("selection-box-border-color").value[2]+","+a.core("selection-box-opacity").value+")",h.strokeRect(r.selection[0],r.selection[1],r.selection[2]-r.selection[0],r.selection[3]-r.selection[1]))}if(i.bgActivePosistion&&!r.hoverData.selecting){var d=r.cy.zoom(),p=i.bgActivePosistion;h.fillStyle="rgba("+a.core("active-bg-color").value[0]+","+a.core("active-bg-color").value[1]+","+a.core("active-bg-color").value[2]+","+a.core("active-bg-opacity").value+")",h.beginPath(),h.arc(p.x,p.y,a.core("active-bg-size").pfValue/d,0,2*Math.PI),h.fill()}var g=r.lastRedrawTime;if(r.showFps&&g){g=Math.round(g);var m=Math.round(1e3/g),y="1 frame = "+g+" ms = "+m+" fps";if(h.setTransform(1,0,0,1,0,0),h.fillStyle="rgba(255, 0, 0, 0.75)",h.strokeStyle="rgba(255, 0, 0, 0.75)",h.font="30px Arial",!pw){var v=h.measureText(y);pw=v.actualBoundingBoxAscent}h.fillText(y,0,pw);var x=60;h.strokeRect(0,pw+10,250,20),h.fillRect(0,pw+10,250*Math.min(m/x,1),20)}o||(l[r.SELECT_BOX]=!1)}};function nle(t,e,r){var n=t.createShader(e);if(t.shaderSource(n,r),t.compileShader(n),!t.getShaderParameter(n,t.COMPILE_STATUS))throw new Error(t.getShaderInfoLog(n));return n}function BQe(t,e,r){var n=nle(t,t.VERTEX_SHADER,e),i=nle(t,t.FRAGMENT_SHADER,r),a=t.createProgram();if(t.attachShader(a,n),t.attachShader(a,i),t.linkProgram(a),!t.getProgramParameter(a,t.LINK_STATUS))throw new Error("Could not initialize shaders");return a}function FQe(t,e,r){r===void 0&&(r=e);var n=t.makeOffscreenCanvas(e,r),i=n.context=n.getContext("2d");return n.clear=function(){return i.clearRect(0,0,n.width,n.height)},n.clear(),n}function _N(t){var e=t.pixelRatio,r=t.cy.zoom(),n=t.cy.pan();return{zoom:r*e,pan:{x:n.x*e,y:n.y*e}}}function zQe(t){var e=t.pixelRatio,r=t.cy.zoom();return r*e}function GQe(t,e,r,n,i){var a=n*r+e.x,s=i*r+e.y;return s=Math.round(t.canvasHeight-s),[a,s]}function qQe(t,e){return e.picking?!0:t.pstyle("background-fill").value!=="solid"||t.pstyle("background-image").strValue!=="none"?!1:t.pstyle("border-width").value===0||t.pstyle("border-opacity").value===0?!0:t.pstyle("border-style").value==="solid"}function VQe(t,e){if(t.length!==e.length)return!1;for(var r=0;r>0&255)/255,r[1]=(t>>8&255)/255,r[2]=(t>>16&255)/255,r[3]=(t>>24&255)/255,r}function WQe(t){return t[0]+(t[1]<<8)+(t[2]<<16)+(t[3]<<24)}function UQe(t,e){var r=t.createTexture();return r.buffer=function(n){t.bindTexture(t.TEXTURE_2D,r),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR_MIPMAP_NEAREST),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,n),t.generateMipmap(t.TEXTURE_2D),t.bindTexture(t.TEXTURE_2D,null)},r.deleteTexture=function(){t.deleteTexture(r)},r}function ile(t,e){switch(e){case"float":return[1,t.FLOAT,4];case"vec2":return[2,t.FLOAT,4];case"vec3":return[3,t.FLOAT,4];case"vec4":return[4,t.FLOAT,4];case"int":return[1,t.INT,4];case"ivec2":return[2,t.INT,4]}}function ale(t,e,r){switch(e){case t.FLOAT:return new Float32Array(r);case t.INT:return new Int32Array(r)}}function HQe(t,e,r,n,i,a){switch(e){case t.FLOAT:return new Float32Array(r.buffer,a*n,i);case t.INT:return new Int32Array(r.buffer,a*n,i)}}function YQe(t,e,r,n){var i=ile(t,e),a=Qi(i,2),s=a[0],o=a[1],l=ale(t,o,n),u=t.createBuffer();return t.bindBuffer(t.ARRAY_BUFFER,u),t.bufferData(t.ARRAY_BUFFER,l,t.STATIC_DRAW),o===t.FLOAT?t.vertexAttribPointer(r,s,o,!1,0,0):o===t.INT&&t.vertexAttribIPointer(r,s,o,0,0),t.enableVertexAttribArray(r),t.bindBuffer(t.ARRAY_BUFFER,null),u}function Ec(t,e,r,n){var i=ile(t,r),a=Qi(i,3),s=a[0],o=a[1],l=a[2],u=ale(t,o,e*s),h=s*l,d=t.createBuffer();t.bindBuffer(t.ARRAY_BUFFER,d),t.bufferData(t.ARRAY_BUFFER,e*h,t.DYNAMIC_DRAW),t.enableVertexAttribArray(n),o===t.FLOAT?t.vertexAttribPointer(n,s,o,!1,h,0):o===t.INT&&t.vertexAttribIPointer(n,s,o,h,0),t.vertexAttribDivisor(n,1),t.bindBuffer(t.ARRAY_BUFFER,null);for(var f=new Array(e),p=0;ps&&(o=s/n,l=n*o,u=i*o),{scale:o,texW:l,texH:u}}},{key:"draw",value:function(r,n,i){var a=this;if(this.locked)throw new Error("can't draw, atlas is locked");var s=this.texSize,o=this.texRows,l=this.texHeight,u=this.getScale(n),h=u.scale,d=u.texW,f=u.texH,p=function(b,w){if(i&&w){var C=w.context,_=b.x,k=b.row,S=_,L=l*k;C.save(),C.translate(S,L),C.scale(h,h),i(C,n),C.restore()}},g=[null,null],m=function(){p(a.freePointer,a.canvas),g[0]={x:a.freePointer.x,y:a.freePointer.row*l,w:d,h:f},g[1]={x:a.freePointer.x+d,y:a.freePointer.row*l,w:0,h:f},a.freePointer.x+=d,a.freePointer.x==s&&(a.freePointer.x=0,a.freePointer.row++)},y=function(){var b=a.scratch,w=a.canvas;b.clear(),p({x:0,row:0},b);var C=s-a.freePointer.x,_=d-C,k=l;{var S=a.freePointer.x,L=a.freePointer.row*l,$=C;w.context.drawImage(b,0,0,$,k,S,L,$,k),g[0]={x:S,y:L,w:$,h:f}}{var I=C,z=(a.freePointer.row+1)*l,F=_;w&&w.context.drawImage(b,I,0,F,k,0,z,F,k),g[1]={x:0,y:z,w:F,h:f}}a.freePointer.x=_,a.freePointer.row++},v=function(){a.freePointer.x=0,a.freePointer.row++};if(this.freePointer.x+d<=s)m();else{if(this.freePointer.row>=o-1)return!1;this.freePointer.x===s?(v(),m()):this.enableWrapping?y():(v(),m())}return this.keyToLocation.set(r,g),this.needsBuffer=!0,g}},{key:"getOffsets",value:function(r){return this.keyToLocation.get(r)}},{key:"isEmpty",value:function(){return this.freePointer.x===0&&this.freePointer.row===0}},{key:"canFit",value:function(r){if(this.locked)return!1;var n=this.texSize,i=this.texRows,a=this.getScale(r),s=a.texW;return this.freePointer.x+s>n?this.freePointer.row1&&arguments[1]!==void 0?arguments[1]:{},a=i.forceRedraw,s=a===void 0?!1:a,o=i.filterEle,l=o===void 0?function(){return!0}:o,u=i.filterType,h=u===void 0?function(){return!0}:u,d=!1,f=!1,p=eo(r),g;try{for(p.s();!(g=p.n()).done;){var m=g.value;if(l(m)){var y=eo(this.renderTypes.values()),v;try{var x=function(){var w=v.value,C=w.type;if(h(C)){var _=n.collections.get(w.collection),k=w.getKey(m),S=Array.isArray(k)?k:[k];if(s)S.forEach(function(z){return _.markKeyForGC(z)}),f=!0;else{var L=w.getID?w.getID(m):m.id(),$=n._key(C,L),I=n.typeAndIdToKey.get($);I!==void 0&&!VQe(S,I)&&(d=!0,n.typeAndIdToKey.delete($),I.forEach(function(z){return _.markKeyForGC(z)}))}}};for(y.s();!(v=y.n()).done;)x()}catch(b){y.e(b)}finally{y.f()}}}}catch(b){p.e(b)}finally{p.f()}return f&&(this.gc(),d=!1),d}},{key:"gc",value:function(){var r=eo(this.collections.values()),n;try{for(r.s();!(n=r.n()).done;){var i=n.value;i.gc()}}catch(a){r.e(a)}finally{r.f()}}},{key:"getOrCreateAtlas",value:function(r,n,i,a){var s=this.renderTypes.get(n),o=this.collections.get(s.collection),l=!1,u=o.draw(a,i,function(f){s.drawClipped?(f.save(),f.beginPath(),f.rect(0,0,i.w,i.h),f.clip(),s.drawElement(f,r,i,!0,!0),f.restore()):s.drawElement(f,r,i,!0,!0),l=!0});if(l){var h=s.getID?s.getID(r):r.id(),d=this._key(n,h);this.typeAndIdToKey.has(d)?this.typeAndIdToKey.get(d).push(a):this.typeAndIdToKey.set(d,[a])}return u}},{key:"getAtlasInfo",value:function(r,n){var i=this,a=this.renderTypes.get(n),s=a.getKey(r),o=Array.isArray(s)?s:[s];return o.map(function(l){var u=a.getBoundingBox(r,l),h=i.getOrCreateAtlas(r,n,u,l),d=h.getOffsets(l),f=Qi(d,2),p=f[0],g=f[1];return{atlas:h,tex:p,tex1:p,tex2:g,bb:u}})}},{key:"getDebugInfo",value:function(){var r=[],n=eo(this.collections),i;try{for(n.s();!(i=n.n()).done;){var a=Qi(i.value,2),s=a[0],o=a[1],l=o.getCounts(),u=l.keyCount,h=l.atlasCount;r.push({type:s,keyCount:u,atlasCount:h})}}catch(d){n.e(d)}finally{n.f()}return r}}])})(),rJe=(function(){function t(e){Xh(this,t),this.globalOptions=e,this.atlasSize=e.webglTexSize,this.maxAtlasesPerBatch=e.webglTexPerBatch,this.batchAtlases=[]}return jh(t,[{key:"getMaxAtlasesPerBatch",value:function(){return this.maxAtlasesPerBatch}},{key:"getAtlasSize",value:function(){return this.atlasSize}},{key:"getIndexArray",value:function(){return Array.from({length:this.maxAtlasesPerBatch},function(r,n){return n})}},{key:"startBatch",value:function(){this.batchAtlases=[]}},{key:"getAtlasCount",value:function(){return this.batchAtlases.length}},{key:"getAtlases",value:function(){return this.batchAtlases}},{key:"canAddToCurrentBatch",value:function(r){return this.batchAtlases.length===this.maxAtlasesPerBatch?this.batchAtlases.includes(r):!0}},{key:"getAtlasIndexForBatch",value:function(r){var n=this.batchAtlases.indexOf(r);if(n<0){if(this.batchAtlases.length===this.maxAtlasesPerBatch)throw new Error("cannot add more atlases to batch");this.batchAtlases.push(r),n=this.batchAtlases.length-1}return n}}])})(),nJe=` float circleSD(vec2 p, float r) { return distance(vec2(0), p) - r; // signed distance } -`,vVe=` +`,iJe=` float rectangleSD(vec2 p, vec2 b) { vec2 d = abs(p)-b; return distance(vec2(0),max(d,0.0)) + min(max(d.x,d.y),0.0); } -`,bVe=` +`,aJe=` float roundRectangleSD(vec2 p, vec2 b, vec4 cr) { cr.xy = (p.x > 0.0) ? cr.xy : cr.zw; cr.x = (p.y > 0.0) ? cr.x : cr.y; vec2 q = abs(p) - b + cr.x; return min(max(q.x, q.y), 0.0) + distance(vec2(0), max(q, 0.0)) - cr.x; } -`,xVe=` +`,sJe=` float ellipseSD(vec2 p, vec2 ab) { p = abs( p ); // symmetry @@ -609,28 +610,28 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT) vec2 v = ab*vec2(-cs.y,cs.x); w = w + dot(p-u,v)/(dot(p-u,u)+dot(v,v)); } - + // compute final point and distance float d = length(p-ab*vec2(cos(w),sin(w))); - + // return signed distance return (dot(p/ab,p/ab)>1.0) ? d : -d; } -`,lx={SCREEN:{name:"screen",screen:!0},PICKING:{name:"picking",picking:!0}},o3={IGNORE:1,USE_BB:2},tI=0,Hee=1,Yee=2,rI=3,Hp=4,l3=5,cx=6,ux=7,TVe=(function(){function t(e,r,n){Hu(this,t),this.r=e,this.gl=r,this.maxInstances=n.webglBatchSize,this.atlasSize=n.webglTexSize,this.bgColor=n.bgColor,this.debug=n.webglDebug,this.batchDebugInfo=[],n.enableWrapping=!0,n.createTextureCanvas=Jqe,this.atlasManager=new gVe(e,n),this.batchManager=new mVe(n),this.simpleShapeOptions=new Map,this.program=this._createShaderProgram(lx.SCREEN),this.pickingProgram=this._createShaderProgram(lx.PICKING),this.vao=this._createVAO()}return Yu(t,[{key:"addAtlasCollection",value:function(r,n){this.atlasManager.addAtlasCollection(r,n)}},{key:"addTextureAtlasRenderType",value:function(r,n){this.atlasManager.addRenderType(r,n)}},{key:"addSimpleShapeRenderType",value:function(r,n){this.simpleShapeOptions.set(r,n)}},{key:"invalidate",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=n.type,a=this.atlasManager;return i?a.invalidate(r,{filterType:function(o){return o===i},forceRedraw:!0}):a.invalidate(r)}},{key:"gc",value:function(){this.atlasManager.gc()}},{key:"_createShaderProgram",value:function(r){var n=this.gl,i=`#version 300 es +`,gw={SCREEN:{name:"screen",screen:!0},PICKING:{name:"picking",picking:!0}},sS={IGNORE:1,USE_BB:2},LN=0,cle=1,ule=2,IN=3,Em=4,oS=5,mw=6,yw=7,oJe=(function(){function t(e,r,n){Xh(this,t),this.r=e,this.gl=r,this.maxInstances=n.webglBatchSize,this.atlasSize=n.webglTexSize,this.bgColor=n.bgColor,this.debug=n.webglDebug,this.batchDebugInfo=[],n.enableWrapping=!0,n.createTextureCanvas=FQe,this.atlasManager=new tJe(e,n),this.batchManager=new rJe(n),this.simpleShapeOptions=new Map,this.program=this._createShaderProgram(gw.SCREEN),this.pickingProgram=this._createShaderProgram(gw.PICKING),this.vao=this._createVAO()}return jh(t,[{key:"addAtlasCollection",value:function(r,n){this.atlasManager.addAtlasCollection(r,n)}},{key:"addTextureAtlasRenderType",value:function(r,n){this.atlasManager.addRenderType(r,n)}},{key:"addSimpleShapeRenderType",value:function(r,n){this.simpleShapeOptions.set(r,n)}},{key:"invalidate",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=n.type,a=this.atlasManager;return i?a.invalidate(r,{filterType:function(o){return o===i},forceRedraw:!0}):a.invalidate(r)}},{key:"gc",value:function(){this.atlasManager.gc()}},{key:"_createShaderProgram",value:function(r){var n=this.gl,i=`#version 300 es precision highp float; uniform mat3 uPanZoomMatrix; uniform int uAtlasSize; - + // instanced in vec2 aPosition; // a vertex from the unit square - + in mat3 aTransform; // used to transform verticies, eg into a bounding box in int aVertType; // the type of thing we are rendering // the z-index that is output when using picking mode in vec4 aIndex; - + // For textures in int aAtlasId; // which shader unit/atlas to use in vec4 aTex; // x/y/w/h of texture in atlas @@ -650,7 +651,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT) out vec4 vColor; out vec2 vPosition; // flat values are not interpolated - flat out int vAtlasId; + flat out int vAtlasId; flat out int vVertType; flat out vec2 vTopRight; flat out vec2 vBotLeft; @@ -658,12 +659,12 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT) flat out vec4 vBorderColor; flat out vec2 vBorderWidth; flat out vec4 vIndex; - + void main(void) { int vid = gl_VertexID; vec2 position = aPosition; // TODO make this a vec3, simplifies some code below - if(aVertType == `.concat(tI,`) { + if(aVertType == `.concat(LN,`) { float texX = aTex.x; // texture coordinates float texY = aTex.y; float texW = aTex.z; @@ -681,8 +682,8 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT) gl_Position = vec4(uPanZoomMatrix * aTransform * vec3(position, 1.0), 1.0); } - else if(aVertType == `).concat(Hp," || aVertType == ").concat(ux,` - || aVertType == `).concat(l3," || aVertType == ").concat(cx,`) { // simple shapes + else if(aVertType == `).concat(Em," || aVertType == ").concat(yw,` + || aVertType == `).concat(oS," || aVertType == ").concat(mw,`) { // simple shapes // the bounding box is needed by the fragment shader vBotLeft = (aTransform * vec3(0, 0, 1)).xy; // flat @@ -697,7 +698,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT) gl_Position = vec4(uPanZoomMatrix * aTransform * vec3(position, 1.0), 1.0); } - else if(aVertType == `).concat(Hee,`) { + else if(aVertType == `).concat(cle,`) { vec2 source = aPointAPointB.xy; vec2 target = aPointAPointB.zw; @@ -711,8 +712,8 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT) gl_Position = vec4(uPanZoomMatrix * vec3(point, 1.0), 1.0); vColor = aColor; - } - else if(aVertType == `).concat(Yee,`) { + } + else if(aVertType == `).concat(ule,`) { vec2 pointA = aPointAPointB.xy; vec2 pointB = aPointAPointB.zw; vec2 pointC = aPointCPointD.xy; @@ -760,8 +761,8 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT) } vColor = aColor; - } - else if(aVertType == `).concat(rI,` && vid < 3) { + } + else if(aVertType == `).concat(IN,` && vid < 3) { // massage the first triangle into an edge arrow if(vid == 0) position = vec2(-0.15, -0.3); @@ -806,40 +807,40 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT) out vec4 outColor; - `).concat(yVe,` - `).concat(vVe,` - `).concat(bVe,` - `).concat(xVe,` + `).concat(nJe,` + `).concat(iJe,` + `).concat(aJe,` + `).concat(sJe,` vec4 blend(vec4 top, vec4 bot) { // blend colors with premultiplied alpha - return vec4( + return vec4( top.rgb + (bot.rgb * (1.0 - top.a)), - top.a + (bot.a * (1.0 - top.a)) + top.a + (bot.a * (1.0 - top.a)) ); } vec4 distInterp(vec4 cA, vec4 cB, float d) { // interpolate color using Signed Distance // scale to the zoom level so that borders don't look blurry when zoomed in // note 1.5 is an aribitrary value chosen because it looks good - return mix(cA, cB, 1.0 - smoothstep(0.0, 1.5 / uZoom, abs(d))); + return mix(cA, cB, 1.0 - smoothstep(0.0, 1.5 / uZoom, abs(d))); } void main(void) { - if(vVertType == `).concat(tI,`) { + if(vVertType == `).concat(LN,`) { // look up the texel from the texture unit `).concat(a.map(function(u){return"if(vAtlasId == ".concat(u,") outColor = texture(uTexture").concat(u,", vTexCoord);")}).join(` else `),` - } - else if(vVertType == `).concat(rI,`) { + } + else if(vVertType == `).concat(IN,`) { // mimics how canvas renderer uses context.globalCompositeOperation = 'destination-out'; outColor = blend(vColor, uBGColor); outColor.a = 1.0; // make opaque, masks out line under arrow } - else if(vVertType == `).concat(Hp,` && vBorderWidth == vec2(0.0)) { // simple rectangle with no border + else if(vVertType == `).concat(Em,` && vBorderWidth == vec2(0.0)) { // simple rectangle with no border outColor = vColor; // unit square is already transformed to the rectangle, nothing else needs to be done } - else if(vVertType == `).concat(Hp," || vVertType == ").concat(ux,` - || vVertType == `).concat(l3," || vVertType == ").concat(cx,`) { // use SDF + else if(vVertType == `).concat(Em," || vVertType == ").concat(yw,` + || vVertType == `).concat(oS," || vVertType == ").concat(mw,`) { // use SDF float outerBorder = vBorderWidth[0]; float innerBorder = vBorderWidth[1]; @@ -850,11 +851,11 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT) vec2 p = vPosition - vec2(vTopRight.x - b[0] - outerBorder, vTopRight.y - b[1] - outerBorder); // translate to center float d; // signed distance - if(vVertType == `).concat(Hp,`) { + if(vVertType == `).concat(Em,`) { d = rectangleSD(p, b); - } else if(vVertType == `).concat(ux,` && w == h) { + } else if(vVertType == `).concat(yw,` && w == h) { d = circleSD(p, b.x); // faster than ellipse - } else if(vVertType == `).concat(ux,`) { + } else if(vVertType == `).concat(yw,`) { d = ellipseSD(p, b); } else { d = roundRectangleSD(p, b, vCornerRadius.wzyx); @@ -873,7 +874,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT) vec4 outerColor = outerBorder == 0.0 ? vec4(0) : vBorderColor; vec4 innerBorderColor = blend(vBorderColor, vColor); outColor = distInterp(innerBorderColor, outerColor, d); - } + } else { vec4 outerColor; if(innerBorder == 0.0 && outerBorder == 0.0) { @@ -894,16 +895,16 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT) `).concat(r.picking?`if(outColor.a == 0.0) discard; else outColor = vIndex;`:"",` } - `),o=Qqe(n,i,s);o.aPosition=n.getAttribLocation(o,"aPosition"),o.aIndex=n.getAttribLocation(o,"aIndex"),o.aVertType=n.getAttribLocation(o,"aVertType"),o.aTransform=n.getAttribLocation(o,"aTransform"),o.aAtlasId=n.getAttribLocation(o,"aAtlasId"),o.aTex=n.getAttribLocation(o,"aTex"),o.aPointAPointB=n.getAttribLocation(o,"aPointAPointB"),o.aPointCPointD=n.getAttribLocation(o,"aPointCPointD"),o.aLineWidth=n.getAttribLocation(o,"aLineWidth"),o.aColor=n.getAttribLocation(o,"aColor"),o.aCornerRadius=n.getAttribLocation(o,"aCornerRadius"),o.aBorderColor=n.getAttribLocation(o,"aBorderColor"),o.uPanZoomMatrix=n.getUniformLocation(o,"uPanZoomMatrix"),o.uAtlasSize=n.getUniformLocation(o,"uAtlasSize"),o.uBGColor=n.getUniformLocation(o,"uBGColor"),o.uZoom=n.getUniformLocation(o,"uZoom"),o.uTextures=[];for(var l=0;l1&&arguments[1]!==void 0?arguments[1]:lx.SCREEN;this.panZoomMatrix=r,this.renderTarget=n,this.batchDebugInfo=[],this.wrappedCount=0,this.simpleCount=0,this.startBatch()}},{key:"startBatch",value:function(){this.instanceCount=0,this.batchManager.startBatch()}},{key:"endFrame",value:function(){this.endBatch()}},{key:"_isVisible",value:function(r,n){return r.visible()?n&&n.isVisible?n.isVisible(r):!0:!1}},{key:"drawTexture",value:function(r,n,i){var a=this.atlasManager,s=this.batchManager,o=a.getRenderTypeOpts(i);if(this._isVisible(r,o)&&!(r.isEdge()&&!this._isValidEdge(r))){if(this.renderTarget.picking&&o.getTexPickingMode){var l=o.getTexPickingMode(r);if(l===o3.IGNORE)return;if(l==o3.USE_BB){this.drawPickingRectangle(r,n,i);return}}var u=a.getAtlasInfo(r,i),h=ws(u),d;try{for(h.s();!(d=h.n()).done;){var f=d.value,p=f.atlas,g=f.tex1,m=f.tex2;s.canAddToCurrentBatch(p)||this.endBatch();for(var y=s.getAtlasIndexForBatch(p),v=0,T=[[g,!0],[m,!1]];v=this.maxInstances&&this.endBatch()}}}}catch(M){h.e(M)}finally{h.f()}}}},{key:"setTransformMatrix",value:function(r,n,i,a){var s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,o=0;if(i.shapeProps&&i.shapeProps.padding&&(o=r.pstyle(i.shapeProps.padding).pfValue),a){var l=a.bb,u=a.tex1,h=a.tex2,d=u.w/(u.w+h.w);s||(d=1-d);var f=this._getAdjustedBB(l,o,s,d);this._applyTransformMatrix(n,f,i,r)}else{var p=i.getBoundingBox(r),g=this._getAdjustedBB(p,o,!0,1);this._applyTransformMatrix(n,g,i,r)}}},{key:"_applyTransformMatrix",value:function(r,n,i,a){var s,o;Wee(r);var l=i.getRotation?i.getRotation(a):0;if(l!==0){var u=i.getRotationPoint(a),h=u.x,d=u.y;s3(r,r,[h,d]),Uee(r,r,l);var f=i.getRotationOffset(a);s=f.x+(n.xOffset||0),o=f.y+(n.yOffset||0)}else s=n.x1,o=n.y1;s3(r,r,[s,o]),eI(r,r,[n.w,n.h])}},{key:"_getAdjustedBB",value:function(r,n,i,a){var s=r.x1,o=r.y1,l=r.w,u=r.h,h=r.yOffset;n&&(s-=n,o-=n,l+=2*n,u+=2*n);var d=0,f=l*a;return i&&a<1?l=f:!i&&a<1&&(d=l-f,s+=d,l=f),{x1:s,y1:o,w:l,h:u,xOffset:d,yOffset:h}}},{key:"drawPickingRectangle",value:function(r,n,i){var a=this.atlasManager.getRenderTypeOpts(i),s=this.instanceCount;this.vertTypeBuffer.getView(s)[0]=Hp;var o=this.indexBuffer.getView(s);Up(n,o);var l=this.colorBuffer.getView(s);qd([0,0,0],1,l);var u=this.transformBuffer.getMatrixView(s);this.setTransformMatrix(r,u,a),this.simpleCount++,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}},{key:"drawNode",value:function(r,n,i){var a=this.simpleShapeOptions.get(i);if(this._isVisible(r,a)){var s=a.shapeProps,o=this._getVertTypeForShape(r,s.shape);if(o===void 0||a.isSimple&&!a.isSimple(r,this.renderTarget)){this.drawTexture(r,n,i);return}var l=this.instanceCount;if(this.vertTypeBuffer.getView(l)[0]=o,o===l3||o===cx){var u=a.getBoundingBox(r),h=this._getCornerRadius(r,s.radius,u),d=this.cornerRadiusBuffer.getView(l);d[0]=h,d[1]=h,d[2]=h,d[3]=h,o===cx&&(d[0]=0,d[2]=0)}var f=this.indexBuffer.getView(l);Up(n,f);var p=this.renderTarget.picking?1:i==="node-body"?r.effectiveOpacity():1,g=this.renderTarget.picking?1:r.pstyle(s.opacity).value*p,m=r.pstyle(s.color).value,y=this.colorBuffer.getView(l);qd(m,g,y);var v=this.lineWidthBuffer.getView(l);if(v[0]=0,v[1]=0,s.border){var T=r.pstyle("border-width").value;if(T>0){var b=r.pstyle("border-color").value,w=p*r.pstyle("border-opacity").value,k=this.borderColorBuffer.getView(l);qd(b,w,k);var A=r.pstyle("border-position").value;if(A==="inside")v[0]=0,v[1]=-T;else if(A==="outside")v[0]=T,v[1]=0;else{var C=T/2;v[0]=C,v[1]=-C}}}var _=this.transformBuffer.getMatrixView(l);this.setTransformMatrix(r,_,a),this.simpleCount++,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}},{key:"_getVertTypeForShape",value:function(r,n){var i=r.pstyle(n).value;switch(i){case"rectangle":return Hp;case"ellipse":return ux;case"roundrectangle":case"round-rectangle":return l3;case"bottom-round-rectangle":return cx;default:return}}},{key:"_getCornerRadius",value:function(r,n,i){var a=i.w,s=i.h;if(r.pstyle(n).value==="auto")return eh(a,s);var o=r.pstyle(n).pfValue,l=a/2,u=s/2;return Math.min(o,u,l)}},{key:"drawEdgeArrow",value:function(r,n,i){if(r.visible()){var a=r._private.rscratch,s,o,l;if(i==="source"?(s=a.arrowStartX,o=a.arrowStartY,l=a.srcArrowAngle):(s=a.arrowEndX,o=a.arrowEndY,l=a.tgtArrowAngle),!(isNaN(s)||s==null||isNaN(o)||o==null||isNaN(l)||l==null)){var u=r.pstyle(i+"-arrow-shape").value;if(u!=="none"){var h=r.pstyle(i+"-arrow-color").value,d=r.pstyle("opacity").value,f=r.pstyle("line-opacity").value,p=d*f,g=r.pstyle("width").pfValue,m=r.pstyle("arrow-scale").value,y=this.r.getArrowWidth(g,m),v=this.instanceCount,T=this.transformBuffer.getMatrixView(v);Wee(T),s3(T,T,[s,o]),eI(T,T,[y,y]),Uee(T,T,l),this.vertTypeBuffer.getView(v)[0]=rI;var b=this.indexBuffer.getView(v);Up(n,b);var w=this.colorBuffer.getView(v);qd(h,p,w),this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}}}},{key:"drawEdgeLine",value:function(r,n){if(r.visible()){var i=this._getEdgePoints(r);if(i){var a=r.pstyle("opacity").value,s=r.pstyle("line-opacity").value,o=r.pstyle("width").pfValue,l=r.pstyle("line-color").value,u=a*s;if(i.length/2+this.instanceCount>this.maxInstances&&this.endBatch(),i.length==4){var h=this.instanceCount;this.vertTypeBuffer.getView(h)[0]=Hee;var d=this.indexBuffer.getView(h);Up(n,d);var f=this.colorBuffer.getView(h);qd(l,u,f);var p=this.lineWidthBuffer.getView(h);p[0]=o;var g=this.pointAPointBBuffer.getView(h);g[0]=i[0],g[1]=i[1],g[2]=i[2],g[3]=i[3],this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}else for(var m=0;m=this.maxInstances&&this.endBatch()}}}}},{key:"_isValidEdge",value:function(r){var n=r._private.rscratch;return!(n.badLine||n.allpts==null||isNaN(n.allpts[0]))}},{key:"_getEdgePoints",value:function(r){var n=r._private.rscratch;if(this._isValidEdge(r)){var i=n.allpts;if(i.length==4)return i;var a=this._getNumSegments(r);return this._getCurveSegmentPoints(i,a)}}},{key:"_getNumSegments",value:function(r){var n=15;return Math.min(Math.max(n,5),this.maxInstances)}},{key:"_getCurveSegmentPoints",value:function(r,n){if(r.length==4)return r;for(var i=Array((n+1)*2),a=0;a<=n;a++)if(a==0)i[0]=r[0],i[1]=r[1];else if(a==n)i[a*2]=r[r.length-2],i[a*2+1]=r[r.length-1];else{var s=a/n;this._setCurvePoint(r,s,i,a*2)}return i}},{key:"_setCurvePoint",value:function(r,n,i,a){if(r.length<=2)i[a]=r[0],i[a+1]=r[1];else{for(var s=Array(r.length-2),o=0;o0}},o=function(d){var f=d.pstyle("text-events").strValue==="yes";return f?o3.USE_BB:o3.IGNORE},l=function(d){var f=d.position(),p=f.x,g=f.y,m=d.outerWidth(),y=d.outerHeight();return{w:m,h:y,x1:p-m/2,y1:g-y/2}};r.drawing.addAtlasCollection("node",{texRows:t.webglTexRowsNodes}),r.drawing.addAtlasCollection("label",{texRows:t.webglTexRows}),r.drawing.addTextureAtlasRenderType("node-body",{collection:"node",getKey:e.getStyleKey,getBoundingBox:e.getElementBox,drawElement:e.drawElement}),r.drawing.addSimpleShapeRenderType("node-body",{getBoundingBox:l,isSimple:rVe,shapeProps:{shape:"shape",color:"background-color",opacity:"background-opacity",radius:"corner-radius",border:!0}}),r.drawing.addSimpleShapeRenderType("node-overlay",{getBoundingBox:l,isVisible:s("overlay"),shapeProps:{shape:"overlay-shape",color:"overlay-color",opacity:"overlay-opacity",padding:"overlay-padding",radius:"overlay-corner-radius"}}),r.drawing.addSimpleShapeRenderType("node-underlay",{getBoundingBox:l,isVisible:s("underlay"),shapeProps:{shape:"underlay-shape",color:"underlay-color",opacity:"underlay-opacity",padding:"underlay-padding",radius:"underlay-corner-radius"}}),r.drawing.addTextureAtlasRenderType("label",{collection:"label",getTexPickingMode:o,getKey:nI(e.getLabelKey,null),getBoundingBox:iI(e.getLabelBox,null),drawClipped:!0,drawElement:e.drawLabel,getRotation:i(null),getRotationPoint:e.getLabelRotationPoint,getRotationOffset:e.getLabelRotationOffset,isVisible:a("label")}),r.drawing.addTextureAtlasRenderType("edge-source-label",{collection:"label",getTexPickingMode:o,getKey:nI(e.getSourceLabelKey,"source"),getBoundingBox:iI(e.getSourceLabelBox,"source"),drawClipped:!0,drawElement:e.drawSourceLabel,getRotation:i("source"),getRotationPoint:e.getSourceLabelRotationPoint,getRotationOffset:e.getSourceLabelRotationOffset,isVisible:a("source-label")}),r.drawing.addTextureAtlasRenderType("edge-target-label",{collection:"label",getTexPickingMode:o,getKey:nI(e.getTargetLabelKey,"target"),getBoundingBox:iI(e.getTargetLabelBox,"target"),drawClipped:!0,drawElement:e.drawTargetLabel,getRotation:i("target"),getRotationPoint:e.getTargetLabelRotationPoint,getRotationOffset:e.getTargetLabelRotationOffset,isVisible:a("target-label")});var u=$b(function(){console.log("garbage collect flag set"),r.data.gc=!0},1e4);r.onUpdateEleCalcs(function(h,d){var f=!1;d&&d.length>0&&(f|=r.drawing.invalidate(d)),f&&u()}),CVe(r)};function wVe(t){var e=t.cy.container(),r=e&&e.style&&e.style.backgroundColor||"white";return Qj(r)}function Kee(t,e){var r=t._private.rscratch;return Ka(r,"labelWrapCachedLines",e)||[]}var nI=function(e,r){return function(n){var i=e(n),a=Kee(n,r);return a.length>1?a.map(function(s,o){return"".concat(i,"_").concat(o)}):i}},iI=function(e,r){return function(n,i){var a=e(n);if(typeof i=="string"){var s=i.indexOf("_");if(s>0){var o=Number(i.substring(s+1)),l=Kee(n,r),u=a.h/l.length,h=u*o,d=a.y1+h;return{x1:a.x1,w:a.w,y1:d,h:u,yOffset:h}}}return a}};function CVe(t){{var e=t.render;t.render=function(a){a=a||{};var s=t.cy;t.webgl&&(s.zoom()>Ree?(kVe(t),e.call(t,a)):(EVe(t),Zee(t,a,lx.SCREEN)))}}{var r=t.matchCanvasSize;t.matchCanvasSize=function(a){r.call(t,a),t.pickingFrameBuffer.setFramebufferAttachmentSizes(t.canvasWidth,t.canvasHeight),t.pickingFrameBuffer.needsDraw=!0}}t.findNearestElements=function(a,s,o,l){return IVe(t,a,s)};{var n=t.invalidateCachedZSortedEles;t.invalidateCachedZSortedEles=function(){n.call(t),t.pickingFrameBuffer.needsDraw=!0}}{var i=t.notify;t.notify=function(a,s){i.call(t,a,s),a==="viewport"||a==="bounds"?t.pickingFrameBuffer.needsDraw=!0:a==="background"&&t.drawing.invalidate(s,{type:"node-body"})}}}function kVe(t){var e=t.data.contexts[t.WEBGL];e.clear(e.COLOR_BUFFER_BIT|e.DEPTH_BUFFER_BIT)}function EVe(t){var e=function(n){n.save(),n.setTransform(1,0,0,1,0,0),n.clearRect(0,0,t.canvasWidth,t.canvasHeight),n.restore()};e(t.data.contexts[t.NODE]),e(t.data.contexts[t.DRAG])}function SVe(t){var e=t.canvasWidth,r=t.canvasHeight,n=QL(t),i=n.pan,a=n.zoom,s=JL();s3(s,s,[i.x,i.y]),eI(s,s,[a,a]);var o=JL();hVe(o,e,r);var l=JL();return uVe(l,o,s),l}function jee(t,e){var r=t.canvasWidth,n=t.canvasHeight,i=QL(t),a=i.pan,s=i.zoom;e.setTransform(1,0,0,1,0,0),e.clearRect(0,0,r,n),e.translate(a.x,a.y),e.scale(s,s)}function AVe(t,e){t.drawSelectionRectangle(e,function(r){return jee(t,r)})}function _Ve(t){var e=t.data.contexts[t.NODE];e.save(),jee(t,e),e.strokeStyle="rgba(0, 0, 0, 0.3)",e.beginPath(),e.moveTo(-1e3,0),e.lineTo(1e3,0),e.stroke(),e.beginPath(),e.moveTo(0,-1e3),e.lineTo(0,1e3),e.stroke(),e.restore()}function RVe(t){var e=function(i,a,s){for(var o=i.atlasManager.getAtlasCollection(a),l=t.data.contexts[t.NODE],u=o.atlases,h=0;h=0&&w.add(C)}return w}function IVe(t,e,r){var n=LVe(t,e,r),i=t.getCachedZSortedEles(),a,s,o=ws(n),l;try{for(o.s();!(l=o.n()).done;){var u=l.value,h=i[u];if(!a&&h.isNode()&&(a=h),!s&&h.isEdge()&&(s=h),a&&s)break}}catch(d){o.e(d)}finally{o.f()}return[a,s].filter(Boolean)}function aI(t,e,r){var n=t.drawing;e+=1,r.isNode()?(n.drawNode(r,e,"node-underlay"),n.drawNode(r,e,"node-body"),n.drawTexture(r,e,"label"),n.drawNode(r,e,"node-overlay")):(n.drawEdgeLine(r,e),n.drawEdgeArrow(r,e,"source"),n.drawEdgeArrow(r,e,"target"),n.drawTexture(r,e,"label"),n.drawTexture(r,e,"edge-source-label"),n.drawTexture(r,e,"edge-target-label"))}function Zee(t,e,r){var n;t.webglDebug&&(n=performance.now());var i=t.drawing,a=0;if(r.screen&&t.data.canvasNeedsRedraw[t.SELECT_BOX]&&AVe(t,e),t.data.canvasNeedsRedraw[t.NODE]||r.picking){var s=t.data.contexts[t.WEBGL];r.screen?(s.clearColor(0,0,0,0),s.enable(s.BLEND),s.blendFunc(s.ONE,s.ONE_MINUS_SRC_ALPHA)):s.disable(s.BLEND),s.clear(s.COLOR_BUFFER_BIT|s.DEPTH_BUFFER_BIT),s.viewport(0,0,s.canvas.width,s.canvas.height);var o=SVe(t),l=t.getCachedZSortedEles();if(a=l.length,i.startFrame(o,r),r.screen){for(var u=0;u0&&s>0){p.clearRect(0,0,a,s),p.globalCompositeOperation="source-over";var g=this.getCachedZSortedEles();if(t.full)p.translate(-n.x1*u,-n.y1*u),p.scale(u,u),this.drawElements(p,g),p.scale(1/u,1/u),p.translate(n.x1*u,n.y1*u);else{var m=e.pan(),y={x:m.x*u,y:m.y*u};u*=e.zoom(),p.translate(y.x,y.y),p.scale(u,u),this.drawElements(p,g),p.scale(1/u,1/u),p.translate(-y.x,-y.y)}t.bg&&(p.globalCompositeOperation="destination-over",p.fillStyle=t.bg,p.rect(0,0,a,s),p.fill())}return f};function DVe(t,e){for(var r=atob(t),n=new ArrayBuffer(r.length),i=new Uint8Array(n),a=0;a"u"?"undefined":Fi(OffscreenCanvas))!=="undefined")r=new OffscreenCanvas(t,e);else{var n=this.cy.window(),i=n.document;r=i.createElement("canvas"),r.width=t,r.height=e}return r},[Nee,Ol,Gc,ZL,Gd,ch,Qa,Xee,uh,hx,nte].forEach(function(t){yr(Br,t)});var OVe=[{name:"null",impl:see},{name:"base",impl:See},{name:"canvas",impl:MVe}],$Ve=[{type:"layout",extensions:aqe},{type:"renderer",extensions:OVe}],ate={},ste={};function ote(t,e,r){var n=r,i=function(_){cn("Can not register `"+e+"` for `"+t+"` since `"+_+"` already exists in the prototype and can not be overridden")};if(t==="core"){if(tx.prototype[e])return i(e);tx.prototype[e]=r}else if(t==="collection"){if(fa.prototype[e])return i(e);fa.prototype[e]=r}else if(t==="layout"){for(var a=function(_){this.options=_,r.call(this,_),Kr(this._private)||(this._private={}),this._private.cy=_.cy,this._private.listeners=[],this.createEmitter()},s=a.prototype=Object.create(r.prototype),o=[],l=0;lg&&(this.rect.x-=(this.labelWidth-g)/2,this.setWidth(this.labelWidth)),this.labelHeight>m&&(this.labelPos=="center"?this.rect.y-=(this.labelHeight-m)/2:this.labelPos=="top"&&(this.rect.y-=this.labelHeight-m),this.setHeight(this.labelHeight))}}},d.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==s.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},d.prototype.transform=function(p){var g=this.rect.x;g>l.WORLD_BOUNDARY?g=l.WORLD_BOUNDARY:g<-l.WORLD_BOUNDARY&&(g=-l.WORLD_BOUNDARY);var m=this.rect.y;m>l.WORLD_BOUNDARY?m=l.WORLD_BOUNDARY:m<-l.WORLD_BOUNDARY&&(m=-l.WORLD_BOUNDARY);var y=new h(g,m),v=p.inverseTransformPoint(y);this.setLocation(v.x,v.y)},d.prototype.getLeft=function(){return this.rect.x},d.prototype.getRight=function(){return this.rect.x+this.rect.width},d.prototype.getTop=function(){return this.rect.y},d.prototype.getBottom=function(){return this.rect.y+this.rect.height},d.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},r.exports=d}),(function(r,n,i){function a(s,o){s==null&&o==null?(this.x=0,this.y=0):(this.x=s,this.y=o)}a.prototype.getX=function(){return this.x},a.prototype.getY=function(){return this.y},a.prototype.setX=function(s){this.x=s},a.prototype.setY=function(s){this.y=s},a.prototype.getDifference=function(s){return new DimensionD(this.x-s.x,this.y-s.y)},a.prototype.getCopy=function(){return new a(this.x,this.y)},a.prototype.translate=function(s){return this.x+=s.width,this.y+=s.height,this},r.exports=a}),(function(r,n,i){var a=i(2),s=i(10),o=i(0),l=i(6),u=i(3),h=i(1),d=i(13),f=i(12),p=i(11);function g(y,v,T){a.call(this,T),this.estimatedSize=s.MIN_VALUE,this.margin=o.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=y,v!=null&&v instanceof l?this.graphManager=v:v!=null&&v instanceof Layout&&(this.graphManager=v.graphManager)}g.prototype=Object.create(a.prototype);for(var m in a)g[m]=a[m];g.prototype.getNodes=function(){return this.nodes},g.prototype.getEdges=function(){return this.edges},g.prototype.getGraphManager=function(){return this.graphManager},g.prototype.getParent=function(){return this.parent},g.prototype.getLeft=function(){return this.left},g.prototype.getRight=function(){return this.right},g.prototype.getTop=function(){return this.top},g.prototype.getBottom=function(){return this.bottom},g.prototype.isConnected=function(){return this.isConnected},g.prototype.add=function(y,v,T){if(v==null&&T==null){var b=y;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(b)>-1)throw"Node already in graph!";return b.owner=this,this.getNodes().push(b),b}else{var w=y;if(!(this.getNodes().indexOf(v)>-1&&this.getNodes().indexOf(T)>-1))throw"Source or target not in graph!";if(!(v.owner==T.owner&&v.owner==this))throw"Both owners must be this graph!";return v.owner!=T.owner?null:(w.source=v,w.target=T,w.isInterGraph=!1,this.getEdges().push(w),v.edges.push(w),T!=v&&T.edges.push(w),w)}},g.prototype.remove=function(y){var v=y;if(y instanceof u){if(v==null)throw"Node is null!";if(!(v.owner!=null&&v.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";for(var T=v.edges.slice(),b,w=T.length,k=0;k-1&&_>-1))throw"Source and/or target doesn't know this edge!";b.source.edges.splice(C,1),b.target!=b.source&&b.target.edges.splice(_,1);var A=b.source.owner.getEdges().indexOf(b);if(A==-1)throw"Not in owner's edge list!";b.source.owner.getEdges().splice(A,1)}},g.prototype.updateLeftTop=function(){for(var y=s.MAX_VALUE,v=s.MAX_VALUE,T,b,w,k=this.getNodes(),A=k.length,C=0;CT&&(y=T),v>b&&(v=b)}return y==s.MAX_VALUE?null:(k[0].getParent().paddingLeft!=null?w=k[0].getParent().paddingLeft:w=this.margin,this.left=v-w,this.top=y-w,new f(this.left,this.top))},g.prototype.updateBounds=function(y){for(var v=s.MAX_VALUE,T=-s.MAX_VALUE,b=s.MAX_VALUE,w=-s.MAX_VALUE,k,A,C,_,L,O=this.nodes,M=O.length,z=0;zk&&(v=k),TC&&(b=C),w<_&&(w=_)}var S=new d(v,b,T-v,w-b);v==s.MAX_VALUE&&(this.left=this.parent.getLeft(),this.right=this.parent.getRight(),this.top=this.parent.getTop(),this.bottom=this.parent.getBottom()),O[0].getParent().paddingLeft!=null?L=O[0].getParent().paddingLeft:L=this.margin,this.left=S.x-L,this.right=S.x+S.width+L,this.top=S.y-L,this.bottom=S.y+S.height+L},g.calculateBounds=function(y){for(var v=s.MAX_VALUE,T=-s.MAX_VALUE,b=s.MAX_VALUE,w=-s.MAX_VALUE,k,A,C,_,L=y.length,O=0;Ok&&(v=k),TC&&(b=C),w<_&&(w=_)}var z=new d(v,b,T-v,w-b);return z},g.prototype.getInclusionTreeDepth=function(){return this==this.graphManager.getRoot()?1:this.parent.getInclusionTreeDepth()},g.prototype.getEstimatedSize=function(){if(this.estimatedSize==s.MIN_VALUE)throw"assert failed";return this.estimatedSize},g.prototype.calcEstimatedSize=function(){for(var y=0,v=this.nodes,T=v.length,b=0;b=this.nodes.length){var M=0;T.forEach(function(z){z.owner==y&&M++}),M==this.nodes.length&&(this.isConnected=!0)}},r.exports=g}),(function(r,n,i){var a,s=i(1);function o(l){a=i(5),this.layout=l,this.graphs=[],this.edges=[]}o.prototype.addRoot=function(){var l=this.layout.newGraph(),u=this.layout.newNode(null),h=this.add(l,u);return this.setRootGraph(h),this.rootGraph},o.prototype.add=function(l,u,h,d,f){if(h==null&&d==null&&f==null){if(l==null)throw"Graph is null!";if(u==null)throw"Parent node is null!";if(this.graphs.indexOf(l)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(l),l.parent!=null)throw"Already has a parent!";if(u.child!=null)throw"Already has a child!";return l.parent=u,u.child=l,l}else{f=h,d=u,h=l;var p=d.getOwner(),g=f.getOwner();if(!(p!=null&&p.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(g!=null&&g.getGraphManager()==this))throw"Target not in this graph mgr!";if(p==g)return h.isInterGraph=!1,p.add(h,d,f);if(h.isInterGraph=!0,h.source=d,h.target=f,this.edges.indexOf(h)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(h),!(h.source!=null&&h.target!=null))throw"Edge source and/or target is null!";if(!(h.source.edges.indexOf(h)==-1&&h.target.edges.indexOf(h)==-1))throw"Edge already in source and/or target incidency list!";return h.source.edges.push(h),h.target.edges.push(h),h}},o.prototype.remove=function(l){if(l instanceof a){var u=l;if(u.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(u==this.rootGraph||u.parent!=null&&u.parent.graphManager==this))throw"Invalid parent node!";var h=[];h=h.concat(u.getEdges());for(var d,f=h.length,p=0;p=l.getRight()?u[0]+=Math.min(l.getX()-o.getX(),o.getRight()-l.getRight()):l.getX()<=o.getX()&&l.getRight()>=o.getRight()&&(u[0]+=Math.min(o.getX()-l.getX(),l.getRight()-o.getRight())),o.getY()<=l.getY()&&o.getBottom()>=l.getBottom()?u[1]+=Math.min(l.getY()-o.getY(),o.getBottom()-l.getBottom()):l.getY()<=o.getY()&&l.getBottom()>=o.getBottom()&&(u[1]+=Math.min(o.getY()-l.getY(),l.getBottom()-o.getBottom()));var f=Math.abs((l.getCenterY()-o.getCenterY())/(l.getCenterX()-o.getCenterX()));l.getCenterY()===o.getCenterY()&&l.getCenterX()===o.getCenterX()&&(f=1);var p=f*u[0],g=u[1]/f;u[0]p)return u[0]=h,u[1]=m,u[2]=f,u[3]=O,!1;if(df)return u[0]=g,u[1]=d,u[2]=_,u[3]=p,!1;if(hf?(u[0]=v,u[1]=T,S=!0):(u[0]=y,u[1]=m,S=!0):N===I&&(h>f?(u[0]=g,u[1]=m,S=!0):(u[0]=b,u[1]=T,S=!0)),-D===I?f>h?(u[2]=L,u[3]=O,R=!0):(u[2]=_,u[3]=C,R=!0):D===I&&(f>h?(u[2]=A,u[3]=C,R=!0):(u[2]=M,u[3]=O,R=!0)),S&&R)return!1;if(h>f?d>p?($=this.getCardinalDirection(N,I,4),B=this.getCardinalDirection(D,I,2)):($=this.getCardinalDirection(-N,I,3),B=this.getCardinalDirection(-D,I,1)):d>p?($=this.getCardinalDirection(-N,I,1),B=this.getCardinalDirection(-D,I,3)):($=this.getCardinalDirection(N,I,2),B=this.getCardinalDirection(D,I,4)),!S)switch($){case 1:G=m,P=h+-k/I,u[0]=P,u[1]=G;break;case 2:P=b,G=d+w*I,u[0]=P,u[1]=G;break;case 3:G=T,P=h+k/I,u[0]=P,u[1]=G;break;case 4:P=v,G=d+-w*I,u[0]=P,u[1]=G;break}if(!R)switch(B){case 1:Y=C,V=f+-F/I,u[2]=V,u[3]=Y;break;case 2:V=M,Y=p+z*I,u[2]=V,u[3]=Y;break;case 3:Y=O,V=f+F/I,u[2]=V,u[3]=Y;break;case 4:V=L,Y=p+-z*I,u[2]=V,u[3]=Y;break}}return!1},s.getCardinalDirection=function(o,l,u){return o>l?u:1+u%4},s.getIntersection=function(o,l,u,h){if(h==null)return this.getIntersection2(o,l,u);var d=o.x,f=o.y,p=l.x,g=l.y,m=u.x,y=u.y,v=h.x,T=h.y,b=void 0,w=void 0,k=void 0,A=void 0,C=void 0,_=void 0,L=void 0,O=void 0,M=void 0;return k=g-f,C=d-p,L=p*f-d*g,A=T-y,_=m-v,O=v*y-m*T,M=k*_-A*C,M===0?null:(b=(C*O-_*L)/M,w=(A*L-k*O)/M,new a(b,w))},s.angleOfVector=function(o,l,u,h){var d=void 0;return o!==u?(d=Math.atan((h-l)/(u-o)),u0?1:s<0?-1:0},a.floor=function(s){return s<0?Math.ceil(s):Math.floor(s)},a.ceil=function(s){return s<0?Math.floor(s):Math.ceil(s)},r.exports=a}),(function(r,n,i){function a(){}a.MAX_VALUE=2147483647,a.MIN_VALUE=-2147483648,r.exports=a}),(function(r,n,i){var a=(function(){function d(f,p){for(var g=0;g"u"?"undefined":a(o);return o==null||l!="object"&&l!="function"},r.exports=s}),(function(r,n,i){function a(m){if(Array.isArray(m)){for(var y=0,v=Array(m.length);y0&&y;){for(k.push(C[0]);k.length>0&&y;){var _=k[0];k.splice(0,1),w.add(_);for(var L=_.getEdges(),b=0;b-1&&C.splice(F,1)}w=new Set,A=new Map}}return m},g.prototype.createDummyNodesForBendpoints=function(m){for(var y=[],v=m.source,T=this.graphManager.calcLowestCommonAncestor(m.source,m.target),b=0;b0){for(var T=this.edgeToDummyNodes.get(v),b=0;b=0&&y.splice(O,1);var M=A.getNeighborsList();M.forEach(function(S){if(v.indexOf(S)<0){var R=T.get(S),N=R-1;N==1&&_.push(S),T.set(S,N)}})}v=v.concat(_),(y.length==1||y.length==2)&&(b=!0,w=y[0])}return w},g.prototype.setGraphManager=function(m){this.graphManager=m},r.exports=g}),(function(r,n,i){function a(){}a.seed=1,a.x=0,a.nextDouble=function(){return a.x=Math.sin(a.seed++)*1e4,a.x-Math.floor(a.x)},r.exports=a}),(function(r,n,i){var a=i(4);function s(o,l){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}s.prototype.getWorldOrgX=function(){return this.lworldOrgX},s.prototype.setWorldOrgX=function(o){this.lworldOrgX=o},s.prototype.getWorldOrgY=function(){return this.lworldOrgY},s.prototype.setWorldOrgY=function(o){this.lworldOrgY=o},s.prototype.getWorldExtX=function(){return this.lworldExtX},s.prototype.setWorldExtX=function(o){this.lworldExtX=o},s.prototype.getWorldExtY=function(){return this.lworldExtY},s.prototype.setWorldExtY=function(o){this.lworldExtY=o},s.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},s.prototype.setDeviceOrgX=function(o){this.ldeviceOrgX=o},s.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},s.prototype.setDeviceOrgY=function(o){this.ldeviceOrgY=o},s.prototype.getDeviceExtX=function(){return this.ldeviceExtX},s.prototype.setDeviceExtX=function(o){this.ldeviceExtX=o},s.prototype.getDeviceExtY=function(){return this.ldeviceExtY},s.prototype.setDeviceExtY=function(o){this.ldeviceExtY=o},s.prototype.transformX=function(o){var l=0,u=this.lworldExtX;return u!=0&&(l=this.ldeviceOrgX+(o-this.lworldOrgX)*this.ldeviceExtX/u),l},s.prototype.transformY=function(o){var l=0,u=this.lworldExtY;return u!=0&&(l=this.ldeviceOrgY+(o-this.lworldOrgY)*this.ldeviceExtY/u),l},s.prototype.inverseTransformX=function(o){var l=0,u=this.ldeviceExtX;return u!=0&&(l=this.lworldOrgX+(o-this.ldeviceOrgX)*this.lworldExtX/u),l},s.prototype.inverseTransformY=function(o){var l=0,u=this.ldeviceExtY;return u!=0&&(l=this.lworldOrgY+(o-this.ldeviceOrgY)*this.lworldExtY/u),l},s.prototype.inverseTransformPoint=function(o){var l=new a(this.inverseTransformX(o.x),this.inverseTransformY(o.y));return l},r.exports=s}),(function(r,n,i){function a(p){if(Array.isArray(p)){for(var g=0,m=Array(p.length);go.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*o.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(p-o.ADAPTATION_LOWER_NODE_LIMIT)/(o.ADAPTATION_UPPER_NODE_LIMIT-o.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-o.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=o.MAX_NODE_DISPLACEMENT_INCREMENTAL):(p>o.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(o.COOLING_ADAPTATION_FACTOR,1-(p-o.ADAPTATION_LOWER_NODE_LIMIT)/(o.ADAPTATION_UPPER_NODE_LIMIT-o.ADAPTATION_LOWER_NODE_LIMIT)*(1-o.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=o.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},d.prototype.calcSpringForces=function(){for(var p=this.getAllEdges(),g,m=0;m0&&arguments[0]!==void 0?arguments[0]:!0,g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,m,y,v,T,b=this.getAllNodes(),w;if(this.useFRGridVariant)for(this.totalIterations%o.GRID_CALCULATION_CHECK_PERIOD==1&&p&&this.updateGrid(),w=new Set,m=0;mk||w>k)&&(p.gravitationForceX=-this.gravityConstant*v,p.gravitationForceY=-this.gravityConstant*T)):(k=g.getEstimatedSize()*this.compoundGravityRangeFactor,(b>k||w>k)&&(p.gravitationForceX=-this.gravityConstant*v*this.compoundGravityConstant,p.gravitationForceY=-this.gravityConstant*T*this.compoundGravityConstant))},d.prototype.isConverged=function(){var p,g=!1;return this.totalIterations>this.maxIterations/3&&(g=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),p=this.totalDisplacement=b.length||k>=b[0].length)){for(var A=0;Ad}}]),u})();r.exports=l}),(function(r,n,i){var a=(function(){function l(u,h){for(var d=0;d2&&arguments[2]!==void 0?arguments[2]:1,f=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,p=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;s(this,l),this.sequence1=u,this.sequence2=h,this.match_score=d,this.mismatch_penalty=f,this.gap_penalty=p,this.iMax=u.length+1,this.jMax=h.length+1,this.grid=new Array(this.iMax);for(var g=0;g=0;u--){var h=this.listeners[u];h.event===o&&h.callback===l&&this.listeners.splice(u,1)}},s.emit=function(o,l){for(var u=0;uh.coolingFactor*h.maxNodeDisplacement&&(this.displacementX=h.coolingFactor*h.maxNodeDisplacement*o.sign(this.displacementX)),Math.abs(this.displacementY)>h.coolingFactor*h.maxNodeDisplacement&&(this.displacementY=h.coolingFactor*h.maxNodeDisplacement*o.sign(this.displacementY)),this.child==null?this.moveBy(this.displacementX,this.displacementY):this.child.getNodes().length==0?this.moveBy(this.displacementX,this.displacementY):this.propogateDisplacementToChildren(this.displacementX,this.displacementY),h.totalDisplacement+=Math.abs(this.displacementX)+Math.abs(this.displacementY),this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0},l.prototype.propogateDisplacementToChildren=function(h,d){for(var f=this.getChild().getNodes(),p,g=0;g0)this.positionNodesRadially(C);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var _=new Set(this.getAllNodes()),L=this.nodesWithGravity.filter(function(O){return _.has(O)});this.graphManager.setAllNodesToApplyGravitation(L),this.positionNodesRandomly()}}return this.initSpringEmbedder(),this.runSpringEmbedder(),!0},k.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished)if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.totalIterations%f.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;this.coolingCycle++,this.layoutQuality==0?this.coolingAdjuster=this.coolingCycle:this.layoutQuality==1&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var C=new Set(this.getAllNodes()),_=this.nodesWithGravity.filter(function(M){return C.has(M)});this.graphManager.setAllNodesToApplyGravitation(_),this.graphManager.updateBounds(),this.updateGrid(),this.coolingFactor=f.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),this.coolingFactor=f.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var L=!this.isTreeGrowing&&!this.isGrowthFinished,O=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(L,O),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},k.prototype.getPositionsData=function(){for(var C=this.graphManager.getAllNodes(),_={},L=0;L1){var S;for(S=0;SO&&(O=Math.floor(F.y)),z=Math.floor(F.x+d.DEFAULT_COMPONENT_SEPERATION)}this.transform(new m(p.WORLD_CENTER_X-F.x/2,p.WORLD_CENTER_Y-F.y/2))},k.radialLayout=function(C,_,L){var O=Math.max(this.maxDiagonalInTree(C),d.DEFAULT_RADIAL_SEPARATION);k.branchRadialLayout(_,null,0,359,0,O);var M=b.calculateBounds(C),z=new w;z.setDeviceOrgX(M.getMinX()),z.setDeviceOrgY(M.getMinY()),z.setWorldOrgX(L.x),z.setWorldOrgY(L.y);for(var F=0;F1;){var Y=V[0];V.splice(0,1);var W=I.indexOf(Y);W>=0&&I.splice(W,1),P--,$--}_!=null?G=(I.indexOf(V[0])+1)%P:G=0;for(var ie=Math.abs(O-L)/$,K=G;B!=$;K=++K%P){var se=I[K].getOtherEnd(C);if(se!=_){var J=(L+B*ie)%360,Z=(J+ie)%360;k.branchRadialLayout(se,C,J,Z,M+z,z),B++}}},k.maxDiagonalInTree=function(C){for(var _=v.MIN_VALUE,L=0;L_&&(_=M)}return _},k.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},k.prototype.groupZeroDegreeMembers=function(){var C=this,_={};this.memberGroups={},this.idToDummyNode={};for(var L=[],O=this.graphManager.getAllNodes(),M=0;M"u"&&(_[S]=[]),_[S]=_[S].concat(z)}Object.keys(_).forEach(function(R){if(_[R].length>1){var N="DummyCompound_"+R;C.memberGroups[N]=_[R];var D=_[R][0].getParent(),I=new u(C.graphManager);I.id=N,I.paddingLeft=D.paddingLeft||0,I.paddingRight=D.paddingRight||0,I.paddingBottom=D.paddingBottom||0,I.paddingTop=D.paddingTop||0,C.idToDummyNode[N]=I;var $=C.getGraphManager().add(C.newGraph(),I),B=D.getChild();B.add(I);for(var P=0;P<_[R].length;P++){var G=_[R][P];B.remove(G),$.add(G)}}})},k.prototype.clearCompounds=function(){var C={},_={};this.performDFSOnCompounds();for(var L=0;L=0;C--){var _=this.compoundOrder[C],L=_.id,O=_.paddingLeft,M=_.paddingTop;this.adjustLocations(this.tiledMemberPack[L],_.rect.x,_.rect.y,O,M)}},k.prototype.repopulateZeroDegreeMembers=function(){var C=this,_=this.tiledZeroDegreePack;Object.keys(_).forEach(function(L){var O=C.idToDummyNode[L],M=O.paddingLeft,z=O.paddingTop;C.adjustLocations(_[L],O.rect.x,O.rect.y,M,z)})},k.prototype.getToBeTiled=function(C){var _=C.id;if(this.toBeTiled[_]!=null)return this.toBeTiled[_];var L=C.getChild();if(L==null)return this.toBeTiled[_]=!1,!1;for(var O=L.getNodes(),M=0;M0)return this.toBeTiled[_]=!1,!1;if(z.getChild()==null){this.toBeTiled[z.id]=!1;continue}if(!this.getToBeTiled(z))return this.toBeTiled[_]=!1,!1}return this.toBeTiled[_]=!0,!0},k.prototype.getNodeDegree=function(C){C.id;for(var _=C.getEdges(),L=0,O=0;O<_.length;O++){var M=_[O];M.getSource().id!==M.getTarget().id&&(L=L+1)}return L},k.prototype.getNodeDegreeWithChildren=function(C){var _=this.getNodeDegree(C);if(C.getChild()==null)return _;for(var L=C.getChild().getNodes(),O=0;OR&&(R=D.rect.height)}L+=R+C.verticalPadding}},k.prototype.tileCompoundMembers=function(C,_){var L=this;this.tiledMemberPack=[],Object.keys(C).forEach(function(O){var M=_[O];L.tiledMemberPack[O]=L.tileNodes(C[O],M.paddingLeft+M.paddingRight),M.rect.width=L.tiledMemberPack[O].width,M.rect.height=L.tiledMemberPack[O].height})},k.prototype.tileNodes=function(C,_){var L=d.TILING_PADDING_VERTICAL,O=d.TILING_PADDING_HORIZONTAL,M={rows:[],rowWidth:[],rowHeight:[],width:0,height:_,verticalPadding:L,horizontalPadding:O};C.sort(function(S,R){return S.rect.width*S.rect.height>R.rect.width*R.rect.height?-1:S.rect.width*S.rect.height0&&(F+=C.horizontalPadding),C.rowWidth[L]=F,C.width0&&(S+=C.verticalPadding);var R=0;S>C.rowHeight[L]&&(R=C.rowHeight[L],C.rowHeight[L]=S,R=C.rowHeight[L]-R),C.height+=R,C.rows[L].push(_)},k.prototype.getShortestRowIndex=function(C){for(var _=-1,L=Number.MAX_VALUE,O=0;OL&&(_=O,L=C.rowWidth[O]);return _},k.prototype.canAddHorizontal=function(C,_,L){var O=this.getShortestRowIndex(C);if(O<0)return!0;var M=C.rowWidth[O];if(M+C.horizontalPadding+_<=C.width)return!0;var z=0;C.rowHeight[O]0&&(z=L+C.verticalPadding-C.rowHeight[O]);var F;C.width-M>=_+C.horizontalPadding?F=(C.height+z)/(M+_+C.horizontalPadding):F=(C.height+z)/C.width,z=L+C.verticalPadding;var S;return C.width<_?S=(C.height+z)/_:S=(C.height+z)/C.width,S<1&&(S=1/S),F<1&&(F=1/F),Fz&&_!=L){O.splice(-1,1),C.rows[L].push(M),C.rowWidth[_]=C.rowWidth[_]-z,C.rowWidth[L]=C.rowWidth[L]+z,C.width=C.rowWidth[instance.getLongestRowIndex(C)];for(var F=Number.MIN_VALUE,S=0;SF&&(F=O[S].height);_>0&&(F+=C.verticalPadding);var R=C.rowHeight[_]+C.rowHeight[L];C.rowHeight[_]=F,C.rowHeight[L]0)for(var B=M;B<=z;B++)$[0]+=this.grid[B][F-1].length+this.grid[B][F].length-1;if(z0)for(var B=F;B<=S;B++)$[3]+=this.grid[M-1][B].length+this.grid[M][B].length-1;for(var P=v.MAX_VALUE,G,V,Y=0;Y<$.length;Y++)$[Y]0){var S;S=w.getGraphManager().add(w.newGraph(),L),this.processChildrenList(S,_,w)}}},m.prototype.stop=function(){return this.stopped=!0,this};var v=function(b){b("layout","cose-bilkent",m)};typeof cytoscape<"u"&&v(cytoscape),n.exports=v})])})})(u3)),u3.exports}var HVe=UVe();const YVe=Os(HVe);Pl.use(YVe);function dte(t,e){t.forEach(r=>{const n={id:r.id,labelText:r.label,height:r.height,width:r.width,padding:r.padding??0};Object.keys(r).forEach(i=>{["id","label","height","width","padding","x","y"].includes(i)||(n[i]=r[i])}),e.add({group:"nodes",data:n,position:{x:r.x??0,y:r.y??0}})})}x(dte,"addNodes");function fte(t,e){t.forEach(r=>{const n={id:r.id,source:r.start,target:r.end};Object.keys(r).forEach(i=>{["id","start","end"].includes(i)||(n[i]=r[i])}),e.add({group:"edges",data:n})})}x(fte,"addEdges");function pte(t){return new Promise(e=>{const r=pt("body").append("div").attr("id","cy").attr("style","display:none"),n=Pl({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"bezier"}}]});r.remove(),dte(t.nodes,n),fte(t.edges,n),n.nodes().forEach(function(a){a.layoutDimensions=()=>{const s=a.data();return{w:s.width,h:s.height}}});const i={name:"cose-bilkent",quality:"proof",styleEnabled:!1,animate:!1};n.layout(i).run(),n.ready(a=>{ae.info("Cytoscape ready",a),e(n)})})}x(pte,"createCytoscapeInstance");function gte(t){return t.nodes().map(e=>{const r=e.data(),n=e.position(),i={id:r.id,x:n.x,y:n.y};return Object.keys(r).forEach(a=>{a!=="id"&&(i[a]=r[a])}),i})}x(gte,"extractPositionedNodes");function mte(t){return t.edges().map(e=>{const r=e.data(),n=e._private.rscratch,i={id:r.id,source:r.source,target:r.target,startX:n.startX,startY:n.startY,midX:n.midX,midY:n.midY,endX:n.endX,endY:n.endY};return Object.keys(r).forEach(a=>{["id","source","target"].includes(a)||(i[a]=r[a])}),i})}x(mte,"extractPositionedEdges");async function yte(t,e){ae.debug("Starting cose-bilkent layout algorithm");try{vte(t);const r=await pte(t),n=gte(r),i=mte(r);return ae.debug(`Layout completed: ${n.length} nodes, ${i.length} edges`),{nodes:n,edges:i}}catch(r){throw ae.error("Error in cose-bilkent layout algorithm:",r),r}}x(yte,"executeCoseBilkentLayout");function vte(t){if(!t)throw new Error("Layout data is required");if(!t.config)throw new Error("Configuration is required in layout data");if(!t.rootNode)throw new Error("Root node is required");if(!t.nodes||!Array.isArray(t.nodes))throw new Error("No nodes found in layout data");if(!Array.isArray(t.edges))throw new Error("Edges array is required in layout data");return!0}x(vte,"validateLayoutData");var XVe=x(async(t,e,{insertCluster:r,insertEdge:n,insertEdgeLabel:i,insertMarkers:a,insertNode:s,log:o,positionEdgeLabel:l},{algorithm:u})=>{const h={},d={},f=e.select("g");a(f,t.markers,t.type,t.diagramId);const p=f.insert("g").attr("class","subgraphs"),g=f.insert("g").attr("class","edgePaths"),m=f.insert("g").attr("class","edgeLabels"),y=f.insert("g").attr("class","nodes");o.debug("Inserting nodes into DOM for dimension calculation"),await Promise.all(t.nodes.map(async b=>{if(b.isGroup){const w={...b};d[b.id]=w,h[b.id]=w,await r(p,b)}else{const w={...b};h[b.id]=w;const k=await s(y,b,{config:t.config,dir:t.direction||"TB"}),A=k.node().getBBox();w.width=A.width,w.height=A.height,w.domId=k,o.debug(`Node ${b.id} dimensions: ${A.width}x${A.height}`)}})),o.debug("Running cose-bilkent layout algorithm");const v={...t,nodes:t.nodes.map(b=>{const w=h[b.id];return{...b,width:w.width,height:w.height}})},T=await yte(v,t.config);o.debug("Positioning nodes based on layout results"),T.nodes.forEach(b=>{const w=h[b.id];w!=null&&w.domId&&(w.domId.attr("transform",`translate(${b.x}, ${b.y})`),w.x=b.x,w.y=b.y,o.debug(`Positioned node ${w.id} at center (${b.x}, ${b.y})`))}),T.edges.forEach(b=>{const w=t.edges.find(k=>k.id===b.id);w&&(w.points=[{x:b.startX,y:b.startY},{x:b.midX,y:b.midY},{x:b.endX,y:b.endY}])}),o.debug("Inserting and positioning edges"),await Promise.all(t.edges.map(async b=>{await i(m,b);const w=h[b.start??""],k=h[b.end??""];if(w&&k){const A=T.edges.find(C=>C.id===b.id);if(A){o.debug("APA01 positionedEdge",A);const C={...b},_=n(g,C,d,t.type,w,k,t.diagramId);l(C,_)}else{const C={...b,points:[{x:w.x||0,y:w.y||0},{x:k.x||0,y:k.y||0}]},_=n(g,C,d,t.type,w,k,t.diagramId);l(C,_)}}})),o.debug("Cose-bilkent rendering completed")},"render"),KVe=XVe;const jVe=Object.freeze(Object.defineProperty({__proto__:null,render:KVe},Symbol.toStringTag,{value:"Module"}));var f3=x((t,e)=>{const r=t.append("rect");if(r.attr("x",e.x),r.attr("y",e.y),r.attr("fill",e.fill),r.attr("stroke",e.stroke),r.attr("width",e.width),r.attr("height",e.height),e.name&&r.attr("name",e.name),e.rx&&r.attr("rx",e.rx),e.ry&&r.attr("ry",e.ry),e.attrs!==void 0)for(const n in e.attrs)r.attr(n,e.attrs[n]);return e.class&&r.attr("class",e.class),r},"drawRect"),bte=x((t,e)=>{const r={x:e.startx,y:e.starty,width:e.stopx-e.startx,height:e.stopy-e.starty,fill:e.fill,stroke:e.stroke,class:"rect"};f3(t,r).lower()},"drawBackgroundRect"),ZVe=x((t,e)=>{const r=e.text.replace(k0," "),n=t.append("text");n.attr("x",e.x),n.attr("y",e.y),n.attr("class","legend"),n.style("text-anchor",e.anchor),e.class&&n.attr("class",e.class);const i=n.append("tspan");return i.attr("x",e.x+e.textMargin*2),i.text(r),n},"drawText"),cI=x((t,e,r,n)=>{const i=t.append("image");i.attr("x",e),i.attr("y",r);const a=cd.sanitizeUrl(n);i.attr("xlink:href",a)},"drawImage"),uI=x((t,e,r,n)=>{const i=t.append("use");i.attr("x",e),i.attr("y",r);const a=cd.sanitizeUrl(n);i.attr("xlink:href",`#${a}`)},"drawEmbeddedImage"),Ys=x(()=>({x:0,y:0,width:100,height:100,fill:"#EDF2AE",stroke:"#666",anchor:"start",rx:0,ry:0}),"getNoteRect"),hI=x(()=>({x:0,y:0,width:100,height:100,"text-anchor":"start",style:"#666",textMargin:0,rx:0,ry:0,tspan:!0}),"getTextObj"),xte=x(()=>{let t=pt(".mermaidTooltip");return t.empty()&&(t=pt("body").append("div").attr("class","mermaidTooltip").style("opacity",0).style("position","absolute").style("text-align","center").style("max-width","200px").style("padding","2px").style("font-size","12px").style("background","#ffffde").style("border","1px solid #333").style("border-radius","2px").style("pointer-events","none").style("z-index","100")),t},"createTooltip"),p3=(function(){var t=x(function(ke,Ve,Qe,nt){for(Qe=Qe||{},nt=ke.length;nt--;Qe[ke[nt]]=Ve);return Qe},"o"),e=[1,24],r=[1,25],n=[1,26],i=[1,27],a=[1,28],s=[1,63],o=[1,64],l=[1,65],u=[1,66],h=[1,67],d=[1,68],f=[1,69],p=[1,29],g=[1,30],m=[1,31],y=[1,32],v=[1,33],T=[1,34],b=[1,35],w=[1,36],k=[1,37],A=[1,38],C=[1,39],_=[1,40],L=[1,41],O=[1,42],M=[1,43],z=[1,44],F=[1,45],S=[1,46],R=[1,47],N=[1,48],D=[1,50],I=[1,51],$=[1,52],B=[1,53],P=[1,54],G=[1,55],V=[1,56],Y=[1,57],W=[1,58],ie=[1,59],K=[1,60],se=[14,42],J=[14,34,36,37,38,39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],Z=[12,14,34,36,37,38,39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],ee=[1,82],ne=[1,83],ue=[1,84],fe=[1,85],_e=[12,14,42],Ae=[12,14,33,42],Ne=[12,14,33,42,76,77,79,80],me=[12,33],ve=[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],Ge={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mermaidDoc:4,direction:5,direction_tb:6,direction_bt:7,direction_rl:8,direction_lr:9,graphConfig:10,C4_CONTEXT:11,NEWLINE:12,statements:13,EOF:14,C4_CONTAINER:15,C4_COMPONENT:16,C4_DYNAMIC:17,C4_DEPLOYMENT:18,otherStatements:19,diagramStatements:20,otherStatement:21,title:22,accDescription:23,acc_title:24,acc_title_value:25,acc_descr:26,acc_descr_value:27,acc_descr_multiline_value:28,boundaryStatement:29,boundaryStartStatement:30,boundaryStopStatement:31,boundaryStart:32,LBRACE:33,ENTERPRISE_BOUNDARY:34,attributes:35,SYSTEM_BOUNDARY:36,BOUNDARY:37,CONTAINER_BOUNDARY:38,NODE:39,NODE_L:40,NODE_R:41,RBRACE:42,diagramStatement:43,PERSON:44,PERSON_EXT:45,SYSTEM:46,SYSTEM_DB:47,SYSTEM_QUEUE:48,SYSTEM_EXT:49,SYSTEM_EXT_DB:50,SYSTEM_EXT_QUEUE:51,CONTAINER:52,CONTAINER_DB:53,CONTAINER_QUEUE:54,CONTAINER_EXT:55,CONTAINER_EXT_DB:56,CONTAINER_EXT_QUEUE:57,COMPONENT:58,COMPONENT_DB:59,COMPONENT_QUEUE:60,COMPONENT_EXT:61,COMPONENT_EXT_DB:62,COMPONENT_EXT_QUEUE:63,REL:64,BIREL:65,REL_U:66,REL_D:67,REL_L:68,REL_R:69,REL_B:70,REL_INDEX:71,UPDATE_EL_STYLE:72,UPDATE_REL_STYLE:73,UPDATE_LAYOUT_CONFIG:74,attribute:75,STR:76,STR_KEY:77,STR_VALUE:78,ATTRIBUTE:79,ATTRIBUTE_EMPTY:80,$accept:0,$end:1},terminals_:{2:"error",6:"direction_tb",7:"direction_bt",8:"direction_rl",9:"direction_lr",11:"C4_CONTEXT",12:"NEWLINE",14:"EOF",15:"C4_CONTAINER",16:"C4_COMPONENT",17:"C4_DYNAMIC",18:"C4_DEPLOYMENT",22:"title",23:"accDescription",24:"acc_title",25:"acc_title_value",26:"acc_descr",27:"acc_descr_value",28:"acc_descr_multiline_value",33:"LBRACE",34:"ENTERPRISE_BOUNDARY",36:"SYSTEM_BOUNDARY",37:"BOUNDARY",38:"CONTAINER_BOUNDARY",39:"NODE",40:"NODE_L",41:"NODE_R",42:"RBRACE",44:"PERSON",45:"PERSON_EXT",46:"SYSTEM",47:"SYSTEM_DB",48:"SYSTEM_QUEUE",49:"SYSTEM_EXT",50:"SYSTEM_EXT_DB",51:"SYSTEM_EXT_QUEUE",52:"CONTAINER",53:"CONTAINER_DB",54:"CONTAINER_QUEUE",55:"CONTAINER_EXT",56:"CONTAINER_EXT_DB",57:"CONTAINER_EXT_QUEUE",58:"COMPONENT",59:"COMPONENT_DB",60:"COMPONENT_QUEUE",61:"COMPONENT_EXT",62:"COMPONENT_EXT_DB",63:"COMPONENT_EXT_QUEUE",64:"REL",65:"BIREL",66:"REL_U",67:"REL_D",68:"REL_L",69:"REL_R",70:"REL_B",71:"REL_INDEX",72:"UPDATE_EL_STYLE",73:"UPDATE_REL_STYLE",74:"UPDATE_LAYOUT_CONFIG",76:"STR",77:"STR_KEY",78:"STR_VALUE",79:"ATTRIBUTE",80:"ATTRIBUTE_EMPTY"},productions_:[0,[3,1],[3,1],[5,1],[5,1],[5,1],[5,1],[4,1],[10,4],[10,4],[10,4],[10,4],[10,4],[13,1],[13,1],[13,2],[19,1],[19,2],[19,3],[21,1],[21,1],[21,2],[21,2],[21,1],[29,3],[30,3],[30,3],[30,4],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[31,1],[20,1],[20,2],[20,3],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,1],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[35,1],[35,2],[75,1],[75,2],[75,1],[75,1]],performAction:x(function(Ve,Qe,nt,tt,je,Ce,Se){var H=Ce.length-1;switch(je){case 3:tt.setDirection("TB");break;case 4:tt.setDirection("BT");break;case 5:tt.setDirection("RL");break;case 6:tt.setDirection("LR");break;case 8:case 9:case 10:case 11:case 12:tt.setC4Type(Ce[H-3]);break;case 19:tt.setTitle(Ce[H].substring(6)),this.$=Ce[H].substring(6);break;case 20:tt.setAccDescription(Ce[H].substring(15)),this.$=Ce[H].substring(15);break;case 21:this.$=Ce[H].trim(),tt.setTitle(this.$);break;case 22:case 23:this.$=Ce[H].trim(),tt.setAccDescription(this.$);break;case 28:Ce[H].splice(2,0,"ENTERPRISE"),tt.addPersonOrSystemBoundary(...Ce[H]),this.$=Ce[H];break;case 29:Ce[H].splice(2,0,"SYSTEM"),tt.addPersonOrSystemBoundary(...Ce[H]),this.$=Ce[H];break;case 30:tt.addPersonOrSystemBoundary(...Ce[H]),this.$=Ce[H];break;case 31:Ce[H].splice(2,0,"CONTAINER"),tt.addContainerBoundary(...Ce[H]),this.$=Ce[H];break;case 32:tt.addDeploymentNode("node",...Ce[H]),this.$=Ce[H];break;case 33:tt.addDeploymentNode("nodeL",...Ce[H]),this.$=Ce[H];break;case 34:tt.addDeploymentNode("nodeR",...Ce[H]),this.$=Ce[H];break;case 35:tt.popBoundaryParseStack();break;case 39:tt.addPersonOrSystem("person",...Ce[H]),this.$=Ce[H];break;case 40:tt.addPersonOrSystem("external_person",...Ce[H]),this.$=Ce[H];break;case 41:tt.addPersonOrSystem("system",...Ce[H]),this.$=Ce[H];break;case 42:tt.addPersonOrSystem("system_db",...Ce[H]),this.$=Ce[H];break;case 43:tt.addPersonOrSystem("system_queue",...Ce[H]),this.$=Ce[H];break;case 44:tt.addPersonOrSystem("external_system",...Ce[H]),this.$=Ce[H];break;case 45:tt.addPersonOrSystem("external_system_db",...Ce[H]),this.$=Ce[H];break;case 46:tt.addPersonOrSystem("external_system_queue",...Ce[H]),this.$=Ce[H];break;case 47:tt.addContainer("container",...Ce[H]),this.$=Ce[H];break;case 48:tt.addContainer("container_db",...Ce[H]),this.$=Ce[H];break;case 49:tt.addContainer("container_queue",...Ce[H]),this.$=Ce[H];break;case 50:tt.addContainer("external_container",...Ce[H]),this.$=Ce[H];break;case 51:tt.addContainer("external_container_db",...Ce[H]),this.$=Ce[H];break;case 52:tt.addContainer("external_container_queue",...Ce[H]),this.$=Ce[H];break;case 53:tt.addComponent("component",...Ce[H]),this.$=Ce[H];break;case 54:tt.addComponent("component_db",...Ce[H]),this.$=Ce[H];break;case 55:tt.addComponent("component_queue",...Ce[H]),this.$=Ce[H];break;case 56:tt.addComponent("external_component",...Ce[H]),this.$=Ce[H];break;case 57:tt.addComponent("external_component_db",...Ce[H]),this.$=Ce[H];break;case 58:tt.addComponent("external_component_queue",...Ce[H]),this.$=Ce[H];break;case 60:tt.addRel("rel",...Ce[H]),this.$=Ce[H];break;case 61:tt.addRel("birel",...Ce[H]),this.$=Ce[H];break;case 62:tt.addRel("rel_u",...Ce[H]),this.$=Ce[H];break;case 63:tt.addRel("rel_d",...Ce[H]),this.$=Ce[H];break;case 64:tt.addRel("rel_l",...Ce[H]),this.$=Ce[H];break;case 65:tt.addRel("rel_r",...Ce[H]),this.$=Ce[H];break;case 66:tt.addRel("rel_b",...Ce[H]),this.$=Ce[H];break;case 67:Ce[H].splice(0,1),tt.addRel("rel",...Ce[H]),this.$=Ce[H];break;case 68:tt.updateElStyle("update_el_style",...Ce[H]),this.$=Ce[H];break;case 69:tt.updateRelStyle("update_rel_style",...Ce[H]),this.$=Ce[H];break;case 70:tt.updateLayoutConfig("update_layout_config",...Ce[H]),this.$=Ce[H];break;case 71:this.$=[Ce[H]];break;case 72:Ce[H].unshift(Ce[H-1]),this.$=Ce[H];break;case 73:case 75:this.$=Ce[H].trim();break;case 74:let he={};he[Ce[H-1].trim()]=Ce[H].trim(),this.$=he;break;case 76:this.$="";break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],7:[1,6],8:[1,7],9:[1,8],10:4,11:[1,9],15:[1,10],16:[1,11],17:[1,12],18:[1,13]},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,7]},{1:[2,3]},{1:[2,4]},{1:[2,5]},{1:[2,6]},{12:[1,14]},{12:[1,15]},{12:[1,16]},{12:[1,17]},{12:[1,18]},{13:19,19:20,20:21,21:22,22:e,23:r,24:n,26:i,28:a,29:49,30:61,32:62,34:s,36:o,37:l,38:u,39:h,40:d,41:f,43:23,44:p,45:g,46:m,47:y,48:v,49:T,50:b,51:w,52:k,53:A,54:C,55:_,56:L,57:O,58:M,59:z,60:F,61:S,62:R,63:N,64:D,65:I,66:$,67:B,68:P,69:G,70:V,71:Y,72:W,73:ie,74:K},{13:70,19:20,20:21,21:22,22:e,23:r,24:n,26:i,28:a,29:49,30:61,32:62,34:s,36:o,37:l,38:u,39:h,40:d,41:f,43:23,44:p,45:g,46:m,47:y,48:v,49:T,50:b,51:w,52:k,53:A,54:C,55:_,56:L,57:O,58:M,59:z,60:F,61:S,62:R,63:N,64:D,65:I,66:$,67:B,68:P,69:G,70:V,71:Y,72:W,73:ie,74:K},{13:71,19:20,20:21,21:22,22:e,23:r,24:n,26:i,28:a,29:49,30:61,32:62,34:s,36:o,37:l,38:u,39:h,40:d,41:f,43:23,44:p,45:g,46:m,47:y,48:v,49:T,50:b,51:w,52:k,53:A,54:C,55:_,56:L,57:O,58:M,59:z,60:F,61:S,62:R,63:N,64:D,65:I,66:$,67:B,68:P,69:G,70:V,71:Y,72:W,73:ie,74:K},{13:72,19:20,20:21,21:22,22:e,23:r,24:n,26:i,28:a,29:49,30:61,32:62,34:s,36:o,37:l,38:u,39:h,40:d,41:f,43:23,44:p,45:g,46:m,47:y,48:v,49:T,50:b,51:w,52:k,53:A,54:C,55:_,56:L,57:O,58:M,59:z,60:F,61:S,62:R,63:N,64:D,65:I,66:$,67:B,68:P,69:G,70:V,71:Y,72:W,73:ie,74:K},{13:73,19:20,20:21,21:22,22:e,23:r,24:n,26:i,28:a,29:49,30:61,32:62,34:s,36:o,37:l,38:u,39:h,40:d,41:f,43:23,44:p,45:g,46:m,47:y,48:v,49:T,50:b,51:w,52:k,53:A,54:C,55:_,56:L,57:O,58:M,59:z,60:F,61:S,62:R,63:N,64:D,65:I,66:$,67:B,68:P,69:G,70:V,71:Y,72:W,73:ie,74:K},{14:[1,74]},t(se,[2,13],{43:23,29:49,30:61,32:62,20:75,34:s,36:o,37:l,38:u,39:h,40:d,41:f,44:p,45:g,46:m,47:y,48:v,49:T,50:b,51:w,52:k,53:A,54:C,55:_,56:L,57:O,58:M,59:z,60:F,61:S,62:R,63:N,64:D,65:I,66:$,67:B,68:P,69:G,70:V,71:Y,72:W,73:ie,74:K}),t(se,[2,14]),t(J,[2,16],{12:[1,76]}),t(se,[2,36],{12:[1,77]}),t(Z,[2,19]),t(Z,[2,20]),{25:[1,78]},{27:[1,79]},t(Z,[2,23]),{35:80,75:81,76:ee,77:ne,79:ue,80:fe},{35:86,75:81,76:ee,77:ne,79:ue,80:fe},{35:87,75:81,76:ee,77:ne,79:ue,80:fe},{35:88,75:81,76:ee,77:ne,79:ue,80:fe},{35:89,75:81,76:ee,77:ne,79:ue,80:fe},{35:90,75:81,76:ee,77:ne,79:ue,80:fe},{35:91,75:81,76:ee,77:ne,79:ue,80:fe},{35:92,75:81,76:ee,77:ne,79:ue,80:fe},{35:93,75:81,76:ee,77:ne,79:ue,80:fe},{35:94,75:81,76:ee,77:ne,79:ue,80:fe},{35:95,75:81,76:ee,77:ne,79:ue,80:fe},{35:96,75:81,76:ee,77:ne,79:ue,80:fe},{35:97,75:81,76:ee,77:ne,79:ue,80:fe},{35:98,75:81,76:ee,77:ne,79:ue,80:fe},{35:99,75:81,76:ee,77:ne,79:ue,80:fe},{35:100,75:81,76:ee,77:ne,79:ue,80:fe},{35:101,75:81,76:ee,77:ne,79:ue,80:fe},{35:102,75:81,76:ee,77:ne,79:ue,80:fe},{35:103,75:81,76:ee,77:ne,79:ue,80:fe},{35:104,75:81,76:ee,77:ne,79:ue,80:fe},t(_e,[2,59]),{35:105,75:81,76:ee,77:ne,79:ue,80:fe},{35:106,75:81,76:ee,77:ne,79:ue,80:fe},{35:107,75:81,76:ee,77:ne,79:ue,80:fe},{35:108,75:81,76:ee,77:ne,79:ue,80:fe},{35:109,75:81,76:ee,77:ne,79:ue,80:fe},{35:110,75:81,76:ee,77:ne,79:ue,80:fe},{35:111,75:81,76:ee,77:ne,79:ue,80:fe},{35:112,75:81,76:ee,77:ne,79:ue,80:fe},{35:113,75:81,76:ee,77:ne,79:ue,80:fe},{35:114,75:81,76:ee,77:ne,79:ue,80:fe},{35:115,75:81,76:ee,77:ne,79:ue,80:fe},{20:116,29:49,30:61,32:62,34:s,36:o,37:l,38:u,39:h,40:d,41:f,43:23,44:p,45:g,46:m,47:y,48:v,49:T,50:b,51:w,52:k,53:A,54:C,55:_,56:L,57:O,58:M,59:z,60:F,61:S,62:R,63:N,64:D,65:I,66:$,67:B,68:P,69:G,70:V,71:Y,72:W,73:ie,74:K},{12:[1,118],33:[1,117]},{35:119,75:81,76:ee,77:ne,79:ue,80:fe},{35:120,75:81,76:ee,77:ne,79:ue,80:fe},{35:121,75:81,76:ee,77:ne,79:ue,80:fe},{35:122,75:81,76:ee,77:ne,79:ue,80:fe},{35:123,75:81,76:ee,77:ne,79:ue,80:fe},{35:124,75:81,76:ee,77:ne,79:ue,80:fe},{35:125,75:81,76:ee,77:ne,79:ue,80:fe},{14:[1,126]},{14:[1,127]},{14:[1,128]},{14:[1,129]},{1:[2,8]},t(se,[2,15]),t(J,[2,17],{21:22,19:130,22:e,23:r,24:n,26:i,28:a}),t(se,[2,37],{19:20,20:21,21:22,43:23,29:49,30:61,32:62,13:131,22:e,23:r,24:n,26:i,28:a,34:s,36:o,37:l,38:u,39:h,40:d,41:f,44:p,45:g,46:m,47:y,48:v,49:T,50:b,51:w,52:k,53:A,54:C,55:_,56:L,57:O,58:M,59:z,60:F,61:S,62:R,63:N,64:D,65:I,66:$,67:B,68:P,69:G,70:V,71:Y,72:W,73:ie,74:K}),t(Z,[2,21]),t(Z,[2,22]),t(_e,[2,39]),t(Ae,[2,71],{75:81,35:132,76:ee,77:ne,79:ue,80:fe}),t(Ne,[2,73]),{78:[1,133]},t(Ne,[2,75]),t(Ne,[2,76]),t(_e,[2,40]),t(_e,[2,41]),t(_e,[2,42]),t(_e,[2,43]),t(_e,[2,44]),t(_e,[2,45]),t(_e,[2,46]),t(_e,[2,47]),t(_e,[2,48]),t(_e,[2,49]),t(_e,[2,50]),t(_e,[2,51]),t(_e,[2,52]),t(_e,[2,53]),t(_e,[2,54]),t(_e,[2,55]),t(_e,[2,56]),t(_e,[2,57]),t(_e,[2,58]),t(_e,[2,60]),t(_e,[2,61]),t(_e,[2,62]),t(_e,[2,63]),t(_e,[2,64]),t(_e,[2,65]),t(_e,[2,66]),t(_e,[2,67]),t(_e,[2,68]),t(_e,[2,69]),t(_e,[2,70]),{31:134,42:[1,135]},{12:[1,136]},{33:[1,137]},t(me,[2,28]),t(me,[2,29]),t(me,[2,30]),t(me,[2,31]),t(me,[2,32]),t(me,[2,33]),t(me,[2,34]),{1:[2,9]},{1:[2,10]},{1:[2,11]},{1:[2,12]},t(J,[2,18]),t(se,[2,38]),t(Ae,[2,72]),t(Ne,[2,74]),t(_e,[2,24]),t(_e,[2,35]),t(ve,[2,25]),t(ve,[2,26],{12:[1,138]}),t(ve,[2,27])],defaultActions:{2:[2,1],3:[2,2],4:[2,7],5:[2,3],6:[2,4],7:[2,5],8:[2,6],74:[2,8],126:[2,9],127:[2,10],128:[2,11],129:[2,12]},parseError:x(function(Ve,Qe){if(Qe.recoverable)this.trace(Ve);else{var nt=new Error(Ve);throw nt.hash=Qe,nt}},"parseError"),parse:x(function(Ve){var Qe=this,nt=[0],tt=[],je=[null],Ce=[],Se=this.table,H="",he=0,j=0,pe=2,re=1,Be=Ce.slice.call(arguments,1),xe=Object.create(this.lexer),Ue={yy:{}};for(var De in this.yy)Object.prototype.hasOwnProperty.call(this.yy,De)&&(Ue.yy[De]=this.yy[De]);xe.setInput(Ve,Ue.yy),Ue.yy.lexer=xe,Ue.yy.parser=this,typeof xe.yylloc>"u"&&(xe.yylloc={});var qe=xe.yylloc;Ce.push(qe);var Le=xe.options&&xe.options.ranges;typeof Ue.yy.parseError=="function"?this.parseError=Ue.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Xe(oe){nt.length=nt.length-2*oe,je.length=je.length-oe,Ce.length=Ce.length-oe}x(Xe,"popStack");function Ie(){var oe;return oe=tt.pop()||xe.lex()||re,typeof oe!="number"&&(oe instanceof Array&&(tt=oe,oe=tt.pop()),oe=Qe.symbols_[oe]||oe),oe}x(Ie,"lex");for(var it,we,lt,be,Et={},vt,ot,It,xt;;){if(we=nt[nt.length-1],this.defaultActions[we]?lt=this.defaultActions[we]:((it===null||typeof it>"u")&&(it=Ie()),lt=Se[we]&&Se[we][it]),typeof lt>"u"||!lt.length||!lt[0]){var ht="";xt=[];for(vt in Se[we])this.terminals_[vt]&&vt>pe&&xt.push("'"+this.terminals_[vt]+"'");xe.showPosition?ht="Parse error on line "+(he+1)+`: -`+xe.showPosition()+` -Expecting `+xt.join(", ")+", got '"+(this.terminals_[it]||it)+"'":ht="Parse error on line "+(he+1)+": Unexpected "+(it==re?"end of input":"'"+(this.terminals_[it]||it)+"'"),this.parseError(ht,{text:xe.match,token:this.terminals_[it]||it,line:xe.yylineno,loc:qe,expected:xt})}if(lt[0]instanceof Array&<.length>1)throw new Error("Parse Error: multiple actions possible at state: "+we+", token: "+it);switch(lt[0]){case 1:nt.push(it),je.push(xe.yytext),Ce.push(xe.yylloc),nt.push(lt[1]),it=null,j=xe.yyleng,H=xe.yytext,he=xe.yylineno,qe=xe.yylloc;break;case 2:if(ot=this.productions_[lt[1]][1],Et.$=je[je.length-ot],Et._$={first_line:Ce[Ce.length-(ot||1)].first_line,last_line:Ce[Ce.length-1].last_line,first_column:Ce[Ce.length-(ot||1)].first_column,last_column:Ce[Ce.length-1].last_column},Le&&(Et._$.range=[Ce[Ce.length-(ot||1)].range[0],Ce[Ce.length-1].range[1]]),be=this.performAction.apply(Et,[H,j,he,Ue.yy,lt[1],je,Ce].concat(Be)),typeof be<"u")return be;ot&&(nt=nt.slice(0,-1*ot*2),je=je.slice(0,-1*ot),Ce=Ce.slice(0,-1*ot)),nt.push(this.productions_[lt[1]][0]),je.push(Et.$),Ce.push(Et._$),It=Se[nt[nt.length-2]][nt[nt.length-1]],nt.push(It);break;case 3:return!0}}return!0},"parse")},Te=(function(){var ke={EOF:1,parseError:x(function(Qe,nt){if(this.yy.parser)this.yy.parser.parseError(Qe,nt);else throw new Error(Qe)},"parseError"),setInput:x(function(Ve,Qe){return this.yy=Qe||this.yy||{},this._input=Ve,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:x(function(){var Ve=this._input[0];this.yytext+=Ve,this.yyleng++,this.offset++,this.match+=Ve,this.matched+=Ve;var Qe=Ve.match(/(?:\r\n?|\n).*/g);return Qe?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),Ve},"input"),unput:x(function(Ve){var Qe=Ve.length,nt=Ve.split(/(?:\r\n?|\n)/g);this._input=Ve+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-Qe),this.offset-=Qe;var tt=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),nt.length-1&&(this.yylineno-=nt.length-1);var je=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:nt?(nt.length===tt.length?this.yylloc.first_column:0)+tt[tt.length-nt.length].length-nt[0].length:this.yylloc.first_column-Qe},this.options.ranges&&(this.yylloc.range=[je[0],je[0]+this.yyleng-Qe]),this.yyleng=this.yytext.length,this},"unput"),more:x(function(){return this._more=!0,this},"more"),reject:x(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). -`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:x(function(Ve){this.unput(this.match.slice(Ve))},"less"),pastInput:x(function(){var Ve=this.matched.substr(0,this.matched.length-this.match.length);return(Ve.length>20?"...":"")+Ve.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:x(function(){var Ve=this.match;return Ve.length<20&&(Ve+=this._input.substr(0,20-Ve.length)),(Ve.substr(0,20)+(Ve.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:x(function(){var Ve=this.pastInput(),Qe=new Array(Ve.length+1).join("-");return Ve+this.upcomingInput()+` -`+Qe+"^"},"showPosition"),test_match:x(function(Ve,Qe){var nt,tt,je;if(this.options.backtrack_lexer&&(je={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&&(je.yylloc.range=this.yylloc.range.slice(0))),tt=Ve[0].match(/(?:\r\n?|\n).*/g),tt&&(this.yylineno+=tt.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:tt?tt[tt.length-1].length-tt[tt.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+Ve[0].length},this.yytext+=Ve[0],this.match+=Ve[0],this.matches=Ve,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(Ve[0].length),this.matched+=Ve[0],nt=this.performAction.call(this,this.yy,this,Qe,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),nt)return nt;if(this._backtrack){for(var Ce in je)this[Ce]=je[Ce];return!1}return!1},"test_match"),next:x(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var Ve,Qe,nt,tt;this._more||(this.yytext="",this.match="");for(var je=this._currentRules(),Ce=0;CeQe[0].length)){if(Qe=nt,tt=Ce,this.options.backtrack_lexer){if(Ve=this.test_match(nt,je[Ce]),Ve!==!1)return Ve;if(this._backtrack){Qe=!1;continue}else return!1}else if(!this.options.flex)break}return Qe?(Ve=this.test_match(Qe,je[tt]),Ve!==!1?Ve:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var Qe=this.next();return Qe||this.lex()},"lex"),begin:x(function(Qe){this.conditionStack.push(Qe)},"begin"),popState:x(function(){var Qe=this.conditionStack.length-1;return Qe>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(Qe){return Qe=this.conditionStack.length-1-Math.abs(Qe||0),Qe>=0?this.conditionStack[Qe]:"INITIAL"},"topState"),pushState:x(function(Qe){this.begin(Qe)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:x(function(Qe,nt,tt,je){switch(tt){case 0:return 6;case 1:return 7;case 2:return 8;case 3:return 9;case 4:return 22;case 5:return 23;case 6:return this.begin("acc_title"),24;case 7:return this.popState(),"acc_title_value";case 8:return this.begin("acc_descr"),26;case 9:return this.popState(),"acc_descr_value";case 10:this.begin("acc_descr_multiline");break;case 11:this.popState();break;case 12:return"acc_descr_multiline_value";case 13:break;case 14:c;break;case 15:return 12;case 16:break;case 17:return 11;case 18:return 15;case 19:return 16;case 20:return 17;case 21:return 18;case 22:return this.begin("person_ext"),45;case 23:return this.begin("person"),44;case 24:return this.begin("system_ext_queue"),51;case 25:return this.begin("system_ext_db"),50;case 26:return this.begin("system_ext"),49;case 27:return this.begin("system_queue"),48;case 28:return this.begin("system_db"),47;case 29:return this.begin("system"),46;case 30:return this.begin("boundary"),37;case 31:return this.begin("enterprise_boundary"),34;case 32:return this.begin("system_boundary"),36;case 33:return this.begin("container_ext_queue"),57;case 34:return this.begin("container_ext_db"),56;case 35:return this.begin("container_ext"),55;case 36:return this.begin("container_queue"),54;case 37:return this.begin("container_db"),53;case 38:return this.begin("container"),52;case 39:return this.begin("container_boundary"),38;case 40:return this.begin("component_ext_queue"),63;case 41:return this.begin("component_ext_db"),62;case 42:return this.begin("component_ext"),61;case 43:return this.begin("component_queue"),60;case 44:return this.begin("component_db"),59;case 45:return this.begin("component"),58;case 46:return this.begin("node"),39;case 47:return this.begin("node"),39;case 48:return this.begin("node_l"),40;case 49:return this.begin("node_r"),41;case 50:return this.begin("rel"),64;case 51:return this.begin("birel"),65;case 52:return this.begin("rel_u"),66;case 53:return this.begin("rel_u"),66;case 54:return this.begin("rel_d"),67;case 55:return this.begin("rel_d"),67;case 56:return this.begin("rel_l"),68;case 57:return this.begin("rel_l"),68;case 58:return this.begin("rel_r"),69;case 59:return this.begin("rel_r"),69;case 60:return this.begin("rel_b"),70;case 61:return this.begin("rel_index"),71;case 62:return this.begin("update_el_style"),72;case 63:return this.begin("update_rel_style"),73;case 64:return this.begin("update_layout_config"),74;case 65:return"EOF_IN_STRUCT";case 66:return this.begin("attribute"),"ATTRIBUTE_EMPTY";case 67:this.begin("attribute");break;case 68:this.popState(),this.popState();break;case 69:return 80;case 70:break;case 71:return 80;case 72:this.begin("string");break;case 73:this.popState();break;case 74:return"STR";case 75:this.begin("string_kv");break;case 76:return this.begin("string_kv_key"),"STR_KEY";case 77:this.popState(),this.begin("string_kv_value");break;case 78:return"STR_VALUE";case 79:this.popState(),this.popState();break;case 80:return"STR";case 81:return"LBRACE";case 82:return"RBRACE";case 83:return"SPACE";case 84:return"EOL";case 85:return 14}},"anonymous"),rules:[/^(?:.*direction\s+TB[^\n]*)/,/^(?:.*direction\s+BT[^\n]*)/,/^(?:.*direction\s+RL[^\n]*)/,/^(?:.*direction\s+LR[^\n]*)/,/^(?:title\s[^#\n;]+)/,/^(?:accDescription\s[^#\n;]+)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:%%(?!\{)*[^\n]*(\r?\n?)+)/,/^(?:%%[^\n]*(\r?\n)*)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:C4Context\b)/,/^(?:C4Container\b)/,/^(?:C4Component\b)/,/^(?:C4Dynamic\b)/,/^(?:C4Deployment\b)/,/^(?:Person_Ext\b)/,/^(?:Person\b)/,/^(?:SystemQueue_Ext\b)/,/^(?:SystemDb_Ext\b)/,/^(?:System_Ext\b)/,/^(?:SystemQueue\b)/,/^(?:SystemDb\b)/,/^(?:System\b)/,/^(?:Boundary\b)/,/^(?:Enterprise_Boundary\b)/,/^(?:System_Boundary\b)/,/^(?:ContainerQueue_Ext\b)/,/^(?:ContainerDb_Ext\b)/,/^(?:Container_Ext\b)/,/^(?:ContainerQueue\b)/,/^(?:ContainerDb\b)/,/^(?:Container\b)/,/^(?:Container_Boundary\b)/,/^(?:ComponentQueue_Ext\b)/,/^(?:ComponentDb_Ext\b)/,/^(?:Component_Ext\b)/,/^(?:ComponentQueue\b)/,/^(?:ComponentDb\b)/,/^(?:Component\b)/,/^(?:Deployment_Node\b)/,/^(?:Node\b)/,/^(?:Node_L\b)/,/^(?:Node_R\b)/,/^(?:Rel\b)/,/^(?:BiRel\b)/,/^(?:Rel_Up\b)/,/^(?:Rel_U\b)/,/^(?:Rel_Down\b)/,/^(?:Rel_D\b)/,/^(?:Rel_Left\b)/,/^(?:Rel_L\b)/,/^(?:Rel_Right\b)/,/^(?:Rel_R\b)/,/^(?:Rel_Back\b)/,/^(?:RelIndex\b)/,/^(?:UpdateElementStyle\b)/,/^(?:UpdateRelStyle\b)/,/^(?:UpdateLayoutConfig\b)/,/^(?:$)/,/^(?:[(][ ]*[,])/,/^(?:[(])/,/^(?:[)])/,/^(?:,,)/,/^(?:,)/,/^(?:[ ]*["]["])/,/^(?:[ ]*["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:[ ]*[\$])/,/^(?:[^=]*)/,/^(?:[=][ ]*["])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:[^,]+)/,/^(?:\{)/,/^(?:\})/,/^(?:[\s]+)/,/^(?:[\n\r]+)/,/^(?:$)/],conditions:{acc_descr_multiline:{rules:[11,12],inclusive:!1},acc_descr:{rules:[9],inclusive:!1},acc_title:{rules:[7],inclusive:!1},string_kv_value:{rules:[78,79],inclusive:!1},string_kv_key:{rules:[77],inclusive:!1},string_kv:{rules:[76],inclusive:!1},string:{rules:[73,74],inclusive:!1},attribute:{rules:[68,69,70,71,72,75,80],inclusive:!1},update_layout_config:{rules:[65,66,67,68],inclusive:!1},update_rel_style:{rules:[65,66,67,68],inclusive:!1},update_el_style:{rules:[65,66,67,68],inclusive:!1},rel_b:{rules:[65,66,67,68],inclusive:!1},rel_r:{rules:[65,66,67,68],inclusive:!1},rel_l:{rules:[65,66,67,68],inclusive:!1},rel_d:{rules:[65,66,67,68],inclusive:!1},rel_u:{rules:[65,66,67,68],inclusive:!1},rel_bi:{rules:[],inclusive:!1},rel:{rules:[65,66,67,68],inclusive:!1},node_r:{rules:[65,66,67,68],inclusive:!1},node_l:{rules:[65,66,67,68],inclusive:!1},node:{rules:[65,66,67,68],inclusive:!1},index:{rules:[],inclusive:!1},rel_index:{rules:[65,66,67,68],inclusive:!1},component_ext_queue:{rules:[65,66,67,68],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 ke})();Ge.lexer=Te;function Ze(){this.yy={}}return x(Ze,"Parser"),Ze.prototype=Ge,Ge.Parser=Ze,new Ze})();p3.parser=p3;var QVe=p3,zo=[],hh=[""],Ja="global",Go="",Bl=[{alias:"global",label:{text:"global"},type:{text:"global"},tags:null,link:null,parentBoundary:""}],dx=[],dI="",fI=!1,g3=4,m3=2,Tte,JVe=x(function(){return Tte},"getC4Type"),eWe=x(function(t){Tte=qr(t,Pe())},"setC4Type"),tWe=x(function(t,e,r,n,i,a,s,o,l){if(t==null||e===void 0||e===null||r===void 0||r===null||n===void 0||n===null)return;let u={};const h=dx.find(d=>d.from===e&&d.to===r);if(h?u=h:dx.push(u),u.type=t,u.from=e,u.to=r,u.label={text:n},i==null)u.techn={text:""};else if(typeof i=="object"){let[d,f]=Object.entries(i)[0];u[d]={text:f}}else u.techn={text:i};if(a==null)u.descr={text:""};else if(typeof a=="object"){let[d,f]=Object.entries(a)[0];u[d]={text:f}}else u.descr={text:a};if(typeof s=="object"){let[d,f]=Object.entries(s)[0];u[d]=f}else u.sprite=s;if(typeof o=="object"){let[d,f]=Object.entries(o)[0];u[d]=f}else u.tags=o;if(typeof l=="object"){let[d,f]=Object.entries(l)[0];u[d]=f}else u.link=l;u.wrap=dh()},"addRel"),rWe=x(function(t,e,r,n,i,a,s){if(e===null||r===null)return;let o={};const l=zo.find(u=>u.alias===e);if(l&&e===l.alias?o=l:(o.alias=e,zo.push(o)),r==null?o.label={text:""}:o.label={text:r},n==null)o.descr={text:""};else if(typeof n=="object"){let[u,h]=Object.entries(n)[0];o[u]={text:h}}else o.descr={text:n};if(typeof i=="object"){let[u,h]=Object.entries(i)[0];o[u]=h}else o.sprite=i;if(typeof a=="object"){let[u,h]=Object.entries(a)[0];o[u]=h}else o.tags=a;if(typeof s=="object"){let[u,h]=Object.entries(s)[0];o[u]=h}else o.link=s;o.typeC4Shape={text:t},o.parentBoundary=Ja,o.wrap=dh()},"addPersonOrSystem"),nWe=x(function(t,e,r,n,i,a,s,o){if(e===null||r===null)return;let l={};const u=zo.find(h=>h.alias===e);if(u&&e===u.alias?l=u:(l.alias=e,zo.push(l)),r==null?l.label={text:""}:l.label={text:r},n==null)l.techn={text:""};else if(typeof n=="object"){let[h,d]=Object.entries(n)[0];l[h]={text:d}}else l.techn={text:n};if(i==null)l.descr={text:""};else if(typeof i=="object"){let[h,d]=Object.entries(i)[0];l[h]={text:d}}else l.descr={text:i};if(typeof a=="object"){let[h,d]=Object.entries(a)[0];l[h]=d}else l.sprite=a;if(typeof s=="object"){let[h,d]=Object.entries(s)[0];l[h]=d}else l.tags=s;if(typeof o=="object"){let[h,d]=Object.entries(o)[0];l[h]=d}else l.link=o;l.wrap=dh(),l.typeC4Shape={text:t},l.parentBoundary=Ja},"addContainer"),iWe=x(function(t,e,r,n,i,a,s,o){if(e===null||r===null)return;let l={};const u=zo.find(h=>h.alias===e);if(u&&e===u.alias?l=u:(l.alias=e,zo.push(l)),r==null?l.label={text:""}:l.label={text:r},n==null)l.techn={text:""};else if(typeof n=="object"){let[h,d]=Object.entries(n)[0];l[h]={text:d}}else l.techn={text:n};if(i==null)l.descr={text:""};else if(typeof i=="object"){let[h,d]=Object.entries(i)[0];l[h]={text:d}}else l.descr={text:i};if(typeof a=="object"){let[h,d]=Object.entries(a)[0];l[h]=d}else l.sprite=a;if(typeof s=="object"){let[h,d]=Object.entries(s)[0];l[h]=d}else l.tags=s;if(typeof o=="object"){let[h,d]=Object.entries(o)[0];l[h]=d}else l.link=o;l.wrap=dh(),l.typeC4Shape={text:t},l.parentBoundary=Ja},"addComponent"),aWe=x(function(t,e,r,n,i){if(t===null||e===null)return;let a={};const s=Bl.find(o=>o.alias===t);if(s&&t===s.alias?a=s:(a.alias=t,Bl.push(a)),e==null?a.label={text:""}:a.label={text:e},r==null)a.type={text:"system"};else if(typeof r=="object"){let[o,l]=Object.entries(r)[0];a[o]={text:l}}else a.type={text:r};if(typeof n=="object"){let[o,l]=Object.entries(n)[0];a[o]=l}else a.tags=n;if(typeof i=="object"){let[o,l]=Object.entries(i)[0];a[o]=l}else a.link=i;a.parentBoundary=Ja,a.wrap=dh(),Go=Ja,Ja=t,hh.push(Go)},"addPersonOrSystemBoundary"),sWe=x(function(t,e,r,n,i){if(t===null||e===null)return;let a={};const s=Bl.find(o=>o.alias===t);if(s&&t===s.alias?a=s:(a.alias=t,Bl.push(a)),e==null?a.label={text:""}:a.label={text:e},r==null)a.type={text:"container"};else if(typeof r=="object"){let[o,l]=Object.entries(r)[0];a[o]={text:l}}else a.type={text:r};if(typeof n=="object"){let[o,l]=Object.entries(n)[0];a[o]=l}else a.tags=n;if(typeof i=="object"){let[o,l]=Object.entries(i)[0];a[o]=l}else a.link=i;a.parentBoundary=Ja,a.wrap=dh(),Go=Ja,Ja=t,hh.push(Go)},"addContainerBoundary"),oWe=x(function(t,e,r,n,i,a,s,o){if(e===null||r===null)return;let l={};const u=Bl.find(h=>h.alias===e);if(u&&e===u.alias?l=u:(l.alias=e,Bl.push(l)),r==null?l.label={text:""}:l.label={text:r},n==null)l.type={text:"node"};else if(typeof n=="object"){let[h,d]=Object.entries(n)[0];l[h]={text:d}}else l.type={text:n};if(i==null)l.descr={text:""};else if(typeof i=="object"){let[h,d]=Object.entries(i)[0];l[h]={text:d}}else l.descr={text:i};if(typeof s=="object"){let[h,d]=Object.entries(s)[0];l[h]=d}else l.tags=s;if(typeof o=="object"){let[h,d]=Object.entries(o)[0];l[h]=d}else l.link=o;l.nodeType=t,l.parentBoundary=Ja,l.wrap=dh(),Go=Ja,Ja=e,hh.push(Go)},"addDeploymentNode"),lWe=x(function(){Ja=Go,hh.pop(),Go=hh.pop(),hh.push(Go)},"popBoundaryParseStack"),cWe=x(function(t,e,r,n,i,a,s,o,l,u,h){let d=zo.find(f=>f.alias===e);if(!(d===void 0&&(d=Bl.find(f=>f.alias===e),d===void 0))){if(r!=null)if(typeof r=="object"){let[f,p]=Object.entries(r)[0];d[f]=p}else d.bgColor=r;if(n!=null)if(typeof n=="object"){let[f,p]=Object.entries(n)[0];d[f]=p}else d.fontColor=n;if(i!=null)if(typeof i=="object"){let[f,p]=Object.entries(i)[0];d[f]=p}else d.borderColor=i;if(a!=null)if(typeof a=="object"){let[f,p]=Object.entries(a)[0];d[f]=p}else d.shadowing=a;if(s!=null)if(typeof s=="object"){let[f,p]=Object.entries(s)[0];d[f]=p}else d.shape=s;if(o!=null)if(typeof o=="object"){let[f,p]=Object.entries(o)[0];d[f]=p}else d.sprite=o;if(l!=null)if(typeof l=="object"){let[f,p]=Object.entries(l)[0];d[f]=p}else d.techn=l;if(u!=null)if(typeof u=="object"){let[f,p]=Object.entries(u)[0];d[f]=p}else d.legendText=u;if(h!=null)if(typeof h=="object"){let[f,p]=Object.entries(h)[0];d[f]=p}else d.legendSprite=h}},"updateElStyle"),uWe=x(function(t,e,r,n,i,a,s){const o=dx.find(l=>l.from===e&&l.to===r);if(o!==void 0){if(n!=null)if(typeof n=="object"){let[l,u]=Object.entries(n)[0];o[l]=u}else o.textColor=n;if(i!=null)if(typeof i=="object"){let[l,u]=Object.entries(i)[0];o[l]=u}else o.lineColor=i;if(a!=null)if(typeof a=="object"){let[l,u]=Object.entries(a)[0];o[l]=parseInt(u)}else o.offsetX=parseInt(a);if(s!=null)if(typeof s=="object"){let[l,u]=Object.entries(s)[0];o[l]=parseInt(u)}else o.offsetY=parseInt(s)}},"updateRelStyle"),hWe=x(function(t,e,r){let n=g3,i=m3;if(typeof e=="object"){const a=Object.values(e)[0];n=parseInt(a)}else n=parseInt(e);if(typeof r=="object"){const a=Object.values(r)[0];i=parseInt(a)}else i=parseInt(r);n>=1&&(g3=n),i>=1&&(m3=i)},"updateLayoutConfig"),dWe=x(function(){return g3},"getC4ShapeInRow"),fWe=x(function(){return m3},"getC4BoundaryInRow"),pWe=x(function(){return Ja},"getCurrentBoundaryParse"),gWe=x(function(){return Go},"getParentBoundaryParse"),wte=x(function(t){return t==null?zo:zo.filter(e=>e.parentBoundary===t)},"getC4ShapeArray"),mWe=x(function(t){return zo.find(e=>e.alias===t)},"getC4Shape"),yWe=x(function(t){return Object.keys(wte(t))},"getC4ShapeKeys"),Cte=x(function(t){return t==null?Bl:Bl.filter(e=>e.parentBoundary===t)},"getBoundaries"),vWe=Cte,bWe=x(function(){return dx},"getRels"),xWe=x(function(){return dI},"getTitle"),TWe=x(function(t){fI=t},"setWrap"),dh=x(function(){return fI},"autoWrap"),wWe=x(function(){zo=[],Bl=[{alias:"global",label:{text:"global"},type:{text:"global"},tags:null,link:null,parentBoundary:""}],Go="",Ja="global",hh=[""],dx=[],hh=[""],dI="",fI=!1,g3=4,m3=2},"clear"),CWe={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},kWe={FILLED:0,OPEN:1},EWe={LEFTOF:0,RIGHTOF:1,OVER:2},SWe=x(function(t){dI=qr(t,Pe())},"setTitle"),pI={addPersonOrSystem:rWe,addPersonOrSystemBoundary:aWe,addContainer:nWe,addContainerBoundary:sWe,addComponent:iWe,addDeploymentNode:oWe,popBoundaryParseStack:lWe,addRel:tWe,updateElStyle:cWe,updateRelStyle:uWe,updateLayoutConfig:hWe,autoWrap:dh,setWrap:TWe,getC4ShapeArray:wte,getC4Shape:mWe,getC4ShapeKeys:yWe,getBoundaries:Cte,getBoundarys:vWe,getCurrentBoundaryParse:pWe,getParentBoundaryParse:gWe,getRels:bWe,getTitle:xWe,getC4Type:JVe,getC4ShapeInRow:dWe,getC4BoundaryInRow:fWe,setAccTitle:Dn,getAccTitle:Fn,getAccDescription:Gn,setAccDescription:zn,getConfig:x(()=>Pe().c4,"getConfig"),clear:wWe,LINETYPE:CWe,ARROWTYPE:kWe,PLACEMENT:EWe,setTitle:SWe,setC4Type:eWe},gI=x(function(t,e){return f3(t,e)},"drawRect"),kte=x(function(t,e,r,n,i,a){const s=t.append("image");s.attr("width",e),s.attr("height",r),s.attr("x",n),s.attr("y",i);let o=a.startsWith("data:image/png;base64")?a:cd.sanitizeUrl(a);s.attr("xlink:href",o)},"drawImage"),AWe=x((t,e,r,n)=>{const i=t.append("g");let a=0;for(let s of e){let o=s.textColor?s.textColor:"#444444",l=s.lineColor?s.lineColor:"#444444",u=s.offsetX?parseInt(s.offsetX):0,h=s.offsetY?parseInt(s.offsetY):0,d="";if(a===0){let p=i.append("line");p.attr("x1",s.startPoint.x),p.attr("y1",s.startPoint.y),p.attr("x2",s.endPoint.x),p.attr("y2",s.endPoint.y),p.attr("stroke-width","1"),p.attr("stroke",l),p.style("fill","none"),s.type!=="rel_b"&&p.attr("marker-end","url("+d+"#"+n+"-arrowhead)"),(s.type==="birel"||s.type==="rel_b")&&p.attr("marker-start","url("+d+"#"+n+"-arrowend)"),a=-1}else{let p=i.append("path");p.attr("fill","none").attr("stroke-width","1").attr("stroke",l).attr("d","Mstartx,starty Qcontrolx,controly stopx,stopy ".replaceAll("startx",s.startPoint.x).replaceAll("starty",s.startPoint.y).replaceAll("controlx",s.startPoint.x+(s.endPoint.x-s.startPoint.x)/2-(s.endPoint.x-s.startPoint.x)/4).replaceAll("controly",s.startPoint.y+(s.endPoint.y-s.startPoint.y)/2).replaceAll("stopx",s.endPoint.x).replaceAll("stopy",s.endPoint.y)),s.type!=="rel_b"&&p.attr("marker-end","url("+d+"#"+n+"-arrowhead)"),(s.type==="birel"||s.type==="rel_b")&&p.attr("marker-start","url("+d+"#"+n+"-arrowend)")}let f=r.messageFont();qc(r)(s.label.text,i,Math.min(s.startPoint.x,s.endPoint.x)+Math.abs(s.endPoint.x-s.startPoint.x)/2+u,Math.min(s.startPoint.y,s.endPoint.y)+Math.abs(s.endPoint.y-s.startPoint.y)/2+h,s.label.width,s.label.height,{fill:o},f),s.techn&&s.techn.text!==""&&(f=r.messageFont(),qc(r)("["+s.techn.text+"]",i,Math.min(s.startPoint.x,s.endPoint.x)+Math.abs(s.endPoint.x-s.startPoint.x)/2+u,Math.min(s.startPoint.y,s.endPoint.y)+Math.abs(s.endPoint.y-s.startPoint.y)/2+r.messageFontSize+5+h,Math.max(s.label.width,s.techn.width),s.techn.height,{fill:o,"font-style":"italic"},f))}},"drawRels"),_We=x(function(t,e,r){const n=t.append("g");let i=e.bgColor?e.bgColor:"none",a=e.borderColor?e.borderColor:"#444444",s=e.fontColor?e.fontColor:"black",o={"stroke-width":1,"stroke-dasharray":"7.0,7.0"};e.nodeType&&(o={"stroke-width":1});let l={x:e.x,y:e.y,fill:i,stroke:a,width:e.width,height:e.height,rx:2.5,ry:2.5,attrs:o};gI(n,l);let u=r.boundaryFont();u.fontWeight="bold",u.fontSize=u.fontSize+2,u.fontColor=s,qc(r)(e.label.text,n,e.x,e.y+e.label.Y,e.width,e.height,{fill:"#444444"},u),e.type&&e.type.text!==""&&(u=r.boundaryFont(),u.fontColor=s,qc(r)(e.type.text,n,e.x,e.y+e.type.Y,e.width,e.height,{fill:"#444444"},u)),e.descr&&e.descr.text!==""&&(u=r.boundaryFont(),u.fontSize=u.fontSize-2,u.fontColor=s,qc(r)(e.descr.text,n,e.x,e.y+e.descr.Y,e.width,e.height,{fill:"#444444"},u))},"drawBoundary"),RWe=x(function(t,e,r){var d;let n=e.bgColor?e.bgColor:r[e.typeC4Shape.text+"_bg_color"],i=e.borderColor?e.borderColor:r[e.typeC4Shape.text+"_border_color"],a=e.fontColor?e.fontColor:"#FFFFFF",s="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAACD0lEQVR4Xu2YoU4EMRCGT+4j8Ai8AhaH4QHgAUjQuFMECUgMIUgwJAgMhgQsAYUiJCiQIBBY+EITsjfTdme6V24v4c8vyGbb+ZjOtN0bNcvjQXmkH83WvYBWto6PLm6v7p7uH1/w2fXD+PBycX1Pv2l3IdDm/vn7x+dXQiAubRzoURa7gRZWd0iGRIiJbOnhnfYBQZNJjNbuyY2eJG8fkDE3bbG4ep6MHUAsgYxmE3nVs6VsBWJSGccsOlFPmLIViMzLOB7pCVO2AtHJMohH7Fh6zqitQK7m0rJvAVYgGcEpe//PLdDz65sM4pF9N7ICcXDKIB5Nv6j7tD0NoSdM2QrU9Gg0ewE1LqBhHR3BBdvj2vapnidjHxD/q6vd7Pvhr31AwcY8eXMTXAKECZZJFXuEq27aLgQK5uLMohCenGGuGewOxSjBvYBqeG6B+Nqiblggdjnc+ZXDy+FNFpFzw76O3UBAROuXh6FoiAcf5g9eTvUgzy0nWg6I8cXHRUpg5bOVBCo+KDpFajOf23GgPme7RSQ+lacIENUgJ6gg1k6HjgOlqnLqip4tEuhv0hNEMXUD0clyXE3p6pZA0S2nnvTlXwLJEZWlb7cTQH1+USgTN4VhAenm/wea1OCAOmqo6fE1WCb9WSKBah+rbUWPWAmE2Rvk0ApiB45eOyNAzU8xcTvj8KvkKEoOaIYeHNA3ZuygAvFMUO0AAAAASUVORK5CYII=";switch(e.typeC4Shape.text){case"person":s="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAACD0lEQVR4Xu2YoU4EMRCGT+4j8Ai8AhaH4QHgAUjQuFMECUgMIUgwJAgMhgQsAYUiJCiQIBBY+EITsjfTdme6V24v4c8vyGbb+ZjOtN0bNcvjQXmkH83WvYBWto6PLm6v7p7uH1/w2fXD+PBycX1Pv2l3IdDm/vn7x+dXQiAubRzoURa7gRZWd0iGRIiJbOnhnfYBQZNJjNbuyY2eJG8fkDE3bbG4ep6MHUAsgYxmE3nVs6VsBWJSGccsOlFPmLIViMzLOB7pCVO2AtHJMohH7Fh6zqitQK7m0rJvAVYgGcEpe//PLdDz65sM4pF9N7ICcXDKIB5Nv6j7tD0NoSdM2QrU9Gg0ewE1LqBhHR3BBdvj2vapnidjHxD/q6vd7Pvhr31AwcY8eXMTXAKECZZJFXuEq27aLgQK5uLMohCenGGuGewOxSjBvYBqeG6B+Nqiblggdjnc+ZXDy+FNFpFzw76O3UBAROuXh6FoiAcf5g9eTvUgzy0nWg6I8cXHRUpg5bOVBCo+KDpFajOf23GgPme7RSQ+lacIENUgJ6gg1k6HjgOlqnLqip4tEuhv0hNEMXUD0clyXE3p6pZA0S2nnvTlXwLJEZWlb7cTQH1+USgTN4VhAenm/wea1OCAOmqo6fE1WCb9WSKBah+rbUWPWAmE2Rvk0ApiB45eOyNAzU8xcTvj8KvkKEoOaIYeHNA3ZuygAvFMUO0AAAAASUVORK5CYII=";break;case"external_person":s="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAAB6ElEQVR4Xu2YLY+EMBCG9+dWr0aj0Wg0Go1Go0+j8Xdv2uTCvv1gpt0ebHKPuhDaeW4605Z9mJvx4AdXUyTUdd08z+u6flmWZRnHsWkafk9DptAwDPu+f0eAYtu2PEaGWuj5fCIZrBAC2eLBAnRCsEkkxmeaJp7iDJ2QMDdHsLg8SxKFEJaAo8lAXnmuOFIhTMpxxKATebo4UiFknuNo4OniSIXQyRxEA3YsnjGCVEjVXD7yLUAqxBGUyPv/Y4W2beMgGuS7kVQIBycH0fD+oi5pezQETxdHKmQKGk1eQEYldK+jw5GxPfZ9z7Mk0Qnhf1W1m3w//EUn5BDmSZsbR44QQLBEqrBHqOrmSKaQAxdnLArCrxZcM7A7ZKs4ioRq8LFC+NpC3WCBJsvpVw5edm9iEXFuyNfxXAgSwfrFQ1c0iNda8AdejvUgnktOtJQQxmcfFzGglc5WVCj7oDgFqU18boeFSs52CUh8LE8BIVQDT1ABrB0HtgSEYlX5doJnCwv9TXocKCaKbnwhdDKPq4lf3SwU3HLq4V/+WYhHVMa/3b4IlfyikAduCkcBc7mQ3/z/Qq/cTuikhkzB12Ae/mcJC9U+Vo8Ej1gWAtgbeGgFsAMHr50BIWOLCbezvhpBFUdY6EJuJ/QDW0XoMX60zZ0AAAAASUVORK5CYII=";break}const o=t.append("g");o.attr("class","person-man");const l=Ys();switch(e.typeC4Shape.text){case"person":case"external_person":case"system":case"external_system":case"container":case"external_container":case"component":case"external_component":l.x=e.x,l.y=e.y,l.fill=n,l.width=e.width,l.height=e.height,l.stroke=i,l.rx=2.5,l.ry=2.5,l.attrs={"stroke-width":.5},gI(o,l);break;case"system_db":case"external_system_db":case"container_db":case"external_container_db":case"component_db":case"external_component_db":o.append("path").attr("fill",n).attr("stroke-width","0.5").attr("stroke",i).attr("d","Mstartx,startyc0,-10 half,-10 half,-10c0,0 half,0 half,10l0,heightc0,10 -half,10 -half,10c0,0 -half,0 -half,-10l0,-height".replaceAll("startx",e.x).replaceAll("starty",e.y).replaceAll("half",e.width/2).replaceAll("height",e.height)),o.append("path").attr("fill","none").attr("stroke-width","0.5").attr("stroke",i).attr("d","Mstartx,startyc0,10 half,10 half,10c0,0 half,0 half,-10".replaceAll("startx",e.x).replaceAll("starty",e.y).replaceAll("half",e.width/2));break;case"system_queue":case"external_system_queue":case"container_queue":case"external_container_queue":case"component_queue":case"external_component_queue":o.append("path").attr("fill",n).attr("stroke-width","0.5").attr("stroke",i).attr("d","Mstartx,startylwidth,0c5,0 5,half 5,halfc0,0 0,half -5,halfl-width,0c-5,0 -5,-half -5,-halfc0,0 0,-half 5,-half".replaceAll("startx",e.x).replaceAll("starty",e.y).replaceAll("width",e.width).replaceAll("half",e.height/2)),o.append("path").attr("fill","none").attr("stroke-width","0.5").attr("stroke",i).attr("d","Mstartx,startyc-5,0 -5,half -5,halfc0,half 5,half 5,half".replaceAll("startx",e.x+e.width).replaceAll("starty",e.y).replaceAll("half",e.height/2));break}let u=PWe(r,e.typeC4Shape.text);switch(o.append("text").attr("fill",a).attr("font-family",u.fontFamily).attr("font-size",u.fontSize-2).attr("font-style","italic").attr("lengthAdjust","spacing").attr("textLength",e.typeC4Shape.width).attr("x",e.x+e.width/2-e.typeC4Shape.width/2).attr("y",e.y+e.typeC4Shape.Y).text("<<"+e.typeC4Shape.text+">>"),e.typeC4Shape.text){case"person":case"external_person":kte(o,48,48,e.x+e.width/2-24,e.y+e.image.Y,s);break}let h=r[e.typeC4Shape.text+"Font"]();return h.fontWeight="bold",h.fontSize=h.fontSize+2,h.fontColor=a,qc(r)(e.label.text,o,e.x,e.y+e.label.Y,e.width,e.height,{fill:a},h),h=r[e.typeC4Shape.text+"Font"](),h.fontColor=a,e.techn&&((d=e.techn)==null?void 0:d.text)!==""?qc(r)(e.techn.text,o,e.x,e.y+e.techn.Y,e.width,e.height,{fill:a,"font-style":"italic"},h):e.type&&e.type.text!==""&&qc(r)(e.type.text,o,e.x,e.y+e.type.Y,e.width,e.height,{fill:a,"font-style":"italic"},h),e.descr&&e.descr.text!==""&&(h=r.personFont(),h.fontColor=a,qc(r)(e.descr.text,o,e.x,e.y+e.descr.Y,e.width,e.height,{fill:a},h)),e.height},"drawC4Shape"),LWe=x(function(t,e){t.append("defs").append("symbol").attr("id",e+"-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"),IWe=x(function(t,e){t.append("defs").append("symbol").attr("id",e+"-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"),DWe=x(function(t,e){t.append("defs").append("symbol").attr("id",e+"-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"),MWe=x(function(t,e){t.append("defs").append("marker").attr("id",e+"-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"),NWe=x(function(t,e){t.append("defs").append("marker").attr("id",e+"-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"),OWe=x(function(t,e){t.append("defs").append("marker").attr("id",e+"-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"),$We=x(function(t,e){const n=t.append("defs").append("marker").attr("id",e+"-crosshead").attr("markerWidth",15).attr("markerHeight",8).attr("orient","auto").attr("refX",16).attr("refY",4);n.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"),n.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"),PWe=x((t,e)=>({fontFamily:t[e+"FontFamily"],fontSize:t[e+"FontSize"],fontWeight:t[e+"FontWeight"]}),"getC4ShapeFont"),qc=(function(){function t(i,a,s,o,l,u,h){const d=a.append("text").attr("x",s+l/2).attr("y",o+u/2+5).style("text-anchor","middle").text(i);n(d,h)}x(t,"byText");function e(i,a,s,o,l,u,h,d){const{fontSize:f,fontFamily:p,fontWeight:g}=d,m=i.split(Lt.lineBreakRegex);for(let y=0;y=this.data.widthLimit||n>=this.data.widthLimit||this.nextData.cnt>Ete)&&(r=this.nextData.startx+e.margin+ar.nextLinePaddingX,i=this.nextData.stopy+e.margin*2,this.nextData.stopx=n=r+e.width,this.nextData.starty=this.nextData.stopy,this.nextData.stopy=a=i+e.height,this.nextData.cnt=1),e.x=r,e.y=i,this.updateVal(this.data,"startx",r,Math.min),this.updateVal(this.data,"starty",i,Math.min),this.updateVal(this.data,"stopx",n,Math.max),this.updateVal(this.data,"stopy",a,Math.max),this.updateVal(this.nextData,"startx",r,Math.min),this.updateVal(this.nextData,"starty",i,Math.min),this.updateVal(this.nextData,"stopx",n,Math.max),this.updateVal(this.nextData,"stopy",a,Math.max)}init(e){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},yI(e.db.getConfig())}bumpLastMargin(e){this.data.stopx+=e,this.data.stopy+=e}},x(Rm,"Bounds"),Rm),yI=x(function(t){ci(ar,t),t.fontFamily&&(ar.personFontFamily=ar.systemFontFamily=ar.messageFontFamily=t.fontFamily),t.fontSize&&(ar.personFontSize=ar.systemFontSize=ar.messageFontSize=t.fontSize),t.fontWeight&&(ar.personFontWeight=ar.systemFontWeight=ar.messageFontWeight=t.fontWeight)},"setConf"),fx=x((t,e)=>({fontFamily:t[e+"FontFamily"],fontSize:t[e+"FontSize"],fontWeight:t[e+"FontWeight"]}),"c4ShapeFont"),b3=x(t=>({fontFamily:t.boundaryFontFamily,fontSize:t.boundaryFontSize,fontWeight:t.boundaryFontWeight}),"boundaryFont"),BWe=x(t=>({fontFamily:t.messageFontFamily,fontSize:t.messageFontSize,fontWeight:t.messageFontWeight}),"messageFont");function go(t,e,r,n,i){if(!e[t].width)if(r)e[t].text=U2(e[t].text,i,n),e[t].textLines=e[t].text.split(Lt.lineBreakRegex).length,e[t].width=i,e[t].height=D4(e[t].text,n);else{let a=e[t].text.split(Lt.lineBreakRegex);e[t].textLines=a.length;let s=0;e[t].height=0,e[t].width=0;for(const o of a)e[t].width=Math.max(qa(o,n),e[t].width),s=D4(o,n),e[t].height=e[t].height+s}}x(go,"calcC4ShapeTextWH");var Ate=x(function(t,e,r){e.x=r.data.startx,e.y=r.data.starty,e.width=r.data.stopx-r.data.startx,e.height=r.data.stopy-r.data.starty,e.label.y=ar.c4ShapeMargin-35;let n=e.wrap&&ar.wrap,i=b3(ar);i.fontSize=i.fontSize+2,i.fontWeight="bold";let a=qa(e.label.text,i);go("label",e,n,i,a),Fl.drawBoundary(t,e,ar)},"drawBoundary"),_te=x(function(t,e,r,n){let i=0;for(const a of n){i=0;const s=r[a];let o=fx(ar,s.typeC4Shape.text);switch(o.fontSize=o.fontSize-2,s.typeC4Shape.width=qa("«"+s.typeC4Shape.text+"»",o),s.typeC4Shape.height=o.fontSize+2,s.typeC4Shape.Y=ar.c4ShapePadding,i=s.typeC4Shape.Y+s.typeC4Shape.height-4,s.image={width:0,height:0,Y:0},s.typeC4Shape.text){case"person":case"external_person":s.image.width=48,s.image.height=48,s.image.Y=i,i=s.image.Y+s.image.height;break}s.sprite&&(s.image.width=48,s.image.height=48,s.image.Y=i,i=s.image.Y+s.image.height);let l=s.wrap&&ar.wrap,u=ar.width-ar.c4ShapePadding*2,h=fx(ar,s.typeC4Shape.text);if(h.fontSize=h.fontSize+2,h.fontWeight="bold",go("label",s,l,h,u),s.label.Y=i+8,i=s.label.Y+s.label.height,s.type&&s.type.text!==""){s.type.text="["+s.type.text+"]";let p=fx(ar,s.typeC4Shape.text);go("type",s,l,p,u),s.type.Y=i+5,i=s.type.Y+s.type.height}else if(s.techn&&s.techn.text!==""){s.techn.text="["+s.techn.text+"]";let p=fx(ar,s.techn.text);go("techn",s,l,p,u),s.techn.Y=i+5,i=s.techn.Y+s.techn.height}let d=i,f=s.label.width;if(s.descr&&s.descr.text!==""){let p=fx(ar,s.typeC4Shape.text);go("descr",s,l,p,u),s.descr.Y=i+20,i=s.descr.Y+s.descr.height,f=Math.max(s.label.width,s.descr.width),d=i-s.descr.textLines*5}f=f+ar.c4ShapePadding,s.width=Math.max(s.width||ar.width,f,ar.width),s.height=Math.max(s.height||ar.height,d,ar.height),s.margin=s.margin||ar.c4ShapeMargin,t.insert(s),Fl.drawC4Shape(e,s,ar)}t.bumpLastMargin(ar.c4ShapeMargin)},"drawC4ShapeArray"),mo=(Lm=class{constructor(e,r){this.x=e,this.y=r}},x(Lm,"Point"),Lm),Rte=x(function(t,e){let r=t.x,n=t.y,i=e.x,a=e.y,s=r+t.width/2,o=n+t.height/2,l=Math.abs(r-i),u=Math.abs(n-a),h=u/l,d=t.height/t.width,f=null;return n==a&&ri?f=new mo(r,o):r==i&&na&&(f=new mo(s,n)),r>i&&n=h?f=new mo(r,o+h*t.width/2):f=new mo(s-l/u*t.height/2,n+t.height):r=h?f=new mo(r+t.width,o+h*t.width/2):f=new mo(s+l/u*t.height/2,n+t.height):ra?d>=h?f=new mo(r+t.width,o-h*t.width/2):f=new mo(s+t.height/2*l/u,n):r>i&&n>a&&(d>=h?f=new mo(r,o-t.width/2*h):f=new mo(s-t.height/2*l/u,n)),f},"getIntersectPoint"),FWe=x(function(t,e){let r={x:0,y:0};r.x=e.x+e.width/2,r.y=e.y+e.height/2;let n=Rte(t,r);r.x=t.x+t.width/2,r.y=t.y+t.height/2;let i=Rte(e,r);return{startPoint:n,endPoint:i}},"getIntersectPoints"),zWe=x(function(t,e,r,n,i){let a=0;for(let s of e){a=a+1;let o=s.wrap&&ar.wrap,l=BWe(ar);n.db.getC4Type()==="C4Dynamic"&&(s.label.text=a+": "+s.label.text);let h=qa(s.label.text,l);go("label",s,o,l,h),s.techn&&s.techn.text!==""&&(h=qa(s.techn.text,l),go("techn",s,o,l,h)),s.descr&&s.descr.text!==""&&(h=qa(s.descr.text,l),go("descr",s,o,l,h));let d=r(s.from),f=r(s.to),p=FWe(d,f);s.startPoint=p.startPoint,s.endPoint=p.endPoint}Fl.drawRels(t,e,ar,i)},"drawRels");function vI(t,e,r,n,i){let a=new Ste(i);a.data.widthLimit=r.data.widthLimit/Math.min(mI,n.length);for(let[s,o]of n.entries()){let l=0;o.image={width:0,height:0,Y:0},o.sprite&&(o.image.width=48,o.image.height=48,o.image.Y=l,l=o.image.Y+o.image.height);let u=o.wrap&&ar.wrap,h=b3(ar);if(h.fontSize=h.fontSize+2,h.fontWeight="bold",go("label",o,u,h,a.data.widthLimit),o.label.Y=l+8,l=o.label.Y+o.label.height,o.type&&o.type.text!==""){o.type.text="["+o.type.text+"]";let g=b3(ar);go("type",o,u,g,a.data.widthLimit),o.type.Y=l+5,l=o.type.Y+o.type.height}if(o.descr&&o.descr.text!==""){let g=b3(ar);g.fontSize=g.fontSize-2,go("descr",o,u,g,a.data.widthLimit),o.descr.Y=l+20,l=o.descr.Y+o.descr.height}if(s==0||s%mI===0){let g=r.data.startx+ar.diagramMarginX,m=r.data.stopy+ar.diagramMarginY+l;a.setData(g,g,m,m)}else{let g=a.data.stopx!==a.data.startx?a.data.stopx+ar.diagramMarginX:a.data.startx,m=a.data.starty;a.setData(g,g,m,m)}a.name=o.alias;let d=i.db.getC4ShapeArray(o.alias),f=i.db.getC4ShapeKeys(o.alias);f.length>0&&_te(a,t,d,f),e=o.alias;let p=i.db.getBoundaries(e);p.length>0&&vI(t,e,a,p,i),o.alias!=="global"&&Ate(t,o,a),r.data.stopy=Math.max(a.data.stopy+ar.c4ShapeMargin,r.data.stopy),r.data.stopx=Math.max(a.data.stopx+ar.c4ShapeMargin,r.data.stopx),y3=Math.max(y3,r.data.stopx),v3=Math.max(v3,r.data.stopy)}}x(vI,"drawInsideBoundary");var GWe=x(function(t,e,r,n){ar=Pe().c4;const i=Pe().securityLevel;let a;i==="sandbox"&&(a=pt("#i"+e));const s=pt(i==="sandbox"?a.nodes()[0].contentDocument.body:"body");let o=n.db;n.db.setWrap(ar.wrap),Ete=o.getC4ShapeInRow(),mI=o.getC4BoundaryInRow(),ae.debug(`C:${JSON.stringify(ar,null,2)}`);const l=i==="sandbox"?s.select(`[id="${e}"]`):pt(`[id="${e}"]`);Fl.insertComputerIcon(l,e),Fl.insertDatabaseIcon(l,e),Fl.insertClockIcon(l,e);let u=new Ste(n);u.setData(ar.diagramMarginX,ar.diagramMarginX,ar.diagramMarginY,ar.diagramMarginY),u.data.widthLimit=screen.availWidth,y3=ar.diagramMarginX,v3=ar.diagramMarginY;const h=n.db.getTitle();let d=n.db.getBoundaries("");vI(l,"",u,d,n),Fl.insertArrowHead(l,e),Fl.insertArrowEnd(l,e),Fl.insertArrowCrossHead(l,e),Fl.insertArrowFilledHead(l,e),zWe(l,n.db.getRels(),n.db.getC4Shape,n,e),u.data.stopx=y3,u.data.stopy=v3;const f=u.data;let g=f.stopy-f.starty+2*ar.diagramMarginY;const y=f.stopx-f.startx+2*ar.diagramMarginX;h&&l.append("text").text(h).attr("x",(f.stopx-f.startx)/2-4*ar.diagramMarginX).attr("y",f.starty+ar.diagramMarginY),wi(l,g,y,ar.useMaxWidth);const v=h?60:0;l.attr("viewBox",f.startx-ar.diagramMarginX+" -"+(ar.diagramMarginY+v)+" "+y+" "+(g+v)),ae.debug("models:",f)},"draw"),Lte={drawPersonOrSystemArray:_te,drawBoundary:Ate,setConf:yI,draw:GWe},qWe=x(t=>`.person { + `),o=BQe(n,i,s);o.aPosition=n.getAttribLocation(o,"aPosition"),o.aIndex=n.getAttribLocation(o,"aIndex"),o.aVertType=n.getAttribLocation(o,"aVertType"),o.aTransform=n.getAttribLocation(o,"aTransform"),o.aAtlasId=n.getAttribLocation(o,"aAtlasId"),o.aTex=n.getAttribLocation(o,"aTex"),o.aPointAPointB=n.getAttribLocation(o,"aPointAPointB"),o.aPointCPointD=n.getAttribLocation(o,"aPointCPointD"),o.aLineWidth=n.getAttribLocation(o,"aLineWidth"),o.aColor=n.getAttribLocation(o,"aColor"),o.aCornerRadius=n.getAttribLocation(o,"aCornerRadius"),o.aBorderColor=n.getAttribLocation(o,"aBorderColor"),o.uPanZoomMatrix=n.getUniformLocation(o,"uPanZoomMatrix"),o.uAtlasSize=n.getUniformLocation(o,"uAtlasSize"),o.uBGColor=n.getUniformLocation(o,"uBGColor"),o.uZoom=n.getUniformLocation(o,"uZoom"),o.uTextures=[];for(var l=0;l1&&arguments[1]!==void 0?arguments[1]:gw.SCREEN;this.panZoomMatrix=r,this.renderTarget=n,this.batchDebugInfo=[],this.wrappedCount=0,this.simpleCount=0,this.startBatch()}},{key:"startBatch",value:function(){this.instanceCount=0,this.batchManager.startBatch()}},{key:"endFrame",value:function(){this.endBatch()}},{key:"_isVisible",value:function(r,n){return r.visible()?n&&n.isVisible?n.isVisible(r):!0:!1}},{key:"drawTexture",value:function(r,n,i){var a=this.atlasManager,s=this.batchManager,o=a.getRenderTypeOpts(i);if(this._isVisible(r,o)&&!(r.isEdge()&&!this._isValidEdge(r))){if(this.renderTarget.picking&&o.getTexPickingMode){var l=o.getTexPickingMode(r);if(l===sS.IGNORE)return;if(l==sS.USE_BB){this.drawPickingRectangle(r,n,i);return}}var u=a.getAtlasInfo(r,i),h=eo(u),d;try{for(h.s();!(d=h.n()).done;){var f=d.value,p=f.atlas,g=f.tex1,m=f.tex2;s.canAddToCurrentBatch(p)||this.endBatch();for(var y=s.getAtlasIndexForBatch(p),v=0,x=[[g,!0],[m,!1]];v=this.maxInstances&&this.endBatch()}}}}catch(I){h.e(I)}finally{h.f()}}}},{key:"setTransformMatrix",value:function(r,n,i,a){var s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,o=0;if(i.shapeProps&&i.shapeProps.padding&&(o=r.pstyle(i.shapeProps.padding).pfValue),a){var l=a.bb,u=a.tex1,h=a.tex2,d=u.w/(u.w+h.w);s||(d=1-d);var f=this._getAdjustedBB(l,o,s,d);this._applyTransformMatrix(n,f,i,r)}else{var p=i.getBoundingBox(r),g=this._getAdjustedBB(p,o,!0,1);this._applyTransformMatrix(n,g,i,r)}}},{key:"_applyTransformMatrix",value:function(r,n,i,a){var s,o;ole(r);var l=i.getRotation?i.getRotation(a):0;if(l!==0){var u=i.getRotationPoint(a),h=u.x,d=u.y;aS(r,r,[h,d]),lle(r,r,l);var f=i.getRotationOffset(a);s=f.x+(n.xOffset||0),o=f.y+(n.yOffset||0)}else s=n.x1,o=n.y1;aS(r,r,[s,o]),RN(r,r,[n.w,n.h])}},{key:"_getAdjustedBB",value:function(r,n,i,a){var s=r.x1,o=r.y1,l=r.w,u=r.h,h=r.yOffset;n&&(s-=n,o-=n,l+=2*n,u+=2*n);var d=0,f=l*a;return i&&a<1?l=f:!i&&a<1&&(d=l-f,s+=d,l=f),{x1:s,y1:o,w:l,h:u,xOffset:d,yOffset:h}}},{key:"drawPickingRectangle",value:function(r,n,i){var a=this.atlasManager.getRenderTypeOpts(i),s=this.instanceCount;this.vertTypeBuffer.getView(s)[0]=Em;var o=this.indexBuffer.getView(s);km(n,o);var l=this.colorBuffer.getView(s);ap([0,0,0],1,l);var u=this.transformBuffer.getMatrixView(s);this.setTransformMatrix(r,u,a),this.simpleCount++,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}},{key:"drawNode",value:function(r,n,i){var a=this.simpleShapeOptions.get(i);if(this._isVisible(r,a)){var s=a.shapeProps,o=this._getVertTypeForShape(r,s.shape);if(o===void 0||a.isSimple&&!a.isSimple(r,this.renderTarget)){this.drawTexture(r,n,i);return}var l=this.instanceCount;if(this.vertTypeBuffer.getView(l)[0]=o,o===oS||o===mw){var u=a.getBoundingBox(r),h=this._getCornerRadius(r,s.radius,u),d=this.cornerRadiusBuffer.getView(l);d[0]=h,d[1]=h,d[2]=h,d[3]=h,o===mw&&(d[0]=0,d[2]=0)}var f=this.indexBuffer.getView(l);km(n,f);var p=this.renderTarget.picking?1:i==="node-body"?r.effectiveOpacity():1,g=this.renderTarget.picking?1:r.pstyle(s.opacity).value*p,m=r.pstyle(s.color).value,y=this.colorBuffer.getView(l);ap(m,g,y);var v=this.lineWidthBuffer.getView(l);if(v[0]=0,v[1]=0,s.border){var x=r.pstyle("border-width").value;if(x>0){var b=r.pstyle("border-color").value,w=p*r.pstyle("border-opacity").value,C=this.borderColorBuffer.getView(l);ap(b,w,C);var _=r.pstyle("border-position").value;if(_==="inside")v[0]=0,v[1]=-x;else if(_==="outside")v[0]=x,v[1]=0;else{var k=x/2;v[0]=k,v[1]=-k}}}var S=this.transformBuffer.getMatrixView(l);this.setTransformMatrix(r,S,a),this.simpleCount++,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}},{key:"_getVertTypeForShape",value:function(r,n){var i=r.pstyle(n).value;switch(i){case"rectangle":return Em;case"ellipse":return yw;case"roundrectangle":case"round-rectangle":return oS;case"bottom-round-rectangle":return mw;default:return}}},{key:"_getCornerRadius",value:function(r,n,i){var a=i.w,s=i.h;if(r.pstyle(n).value==="auto")return rd(a,s);var o=r.pstyle(n).pfValue,l=a/2,u=s/2;return Math.min(o,u,l)}},{key:"drawEdgeArrow",value:function(r,n,i){if(r.visible()){var a=r._private.rscratch,s,o,l;if(i==="source"?(s=a.arrowStartX,o=a.arrowStartY,l=a.srcArrowAngle):(s=a.arrowEndX,o=a.arrowEndY,l=a.tgtArrowAngle),!(isNaN(s)||s==null||isNaN(o)||o==null||isNaN(l)||l==null)){var u=r.pstyle(i+"-arrow-shape").value;if(u!=="none"){var h=r.pstyle(i+"-arrow-color").value,d=r.pstyle("opacity").value,f=r.pstyle("line-opacity").value,p=d*f,g=r.pstyle("width").pfValue,m=r.pstyle("arrow-scale").value,y=this.r.getArrowWidth(g,m),v=this.instanceCount,x=this.transformBuffer.getMatrixView(v);ole(x),aS(x,x,[s,o]),RN(x,x,[y,y]),lle(x,x,l),this.vertTypeBuffer.getView(v)[0]=IN;var b=this.indexBuffer.getView(v);km(n,b);var w=this.colorBuffer.getView(v);ap(h,p,w),this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}}}},{key:"drawEdgeLine",value:function(r,n){if(r.visible()){var i=this._getEdgePoints(r);if(i){var a=r.pstyle("opacity").value,s=r.pstyle("line-opacity").value,o=r.pstyle("width").pfValue,l=r.pstyle("line-color").value,u=a*s;if(i.length/2+this.instanceCount>this.maxInstances&&this.endBatch(),i.length==4){var h=this.instanceCount;this.vertTypeBuffer.getView(h)[0]=cle;var d=this.indexBuffer.getView(h);km(n,d);var f=this.colorBuffer.getView(h);ap(l,u,f);var p=this.lineWidthBuffer.getView(h);p[0]=o;var g=this.pointAPointBBuffer.getView(h);g[0]=i[0],g[1]=i[1],g[2]=i[2],g[3]=i[3],this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}else for(var m=0;m=this.maxInstances&&this.endBatch()}}}}},{key:"_isValidEdge",value:function(r){var n=r._private.rscratch;return!(n.badLine||n.allpts==null||isNaN(n.allpts[0]))}},{key:"_getEdgePoints",value:function(r){var n=r._private.rscratch;if(this._isValidEdge(r)){var i=n.allpts;if(i.length==4)return i;var a=this._getNumSegments(r);return this._getCurveSegmentPoints(i,a)}}},{key:"_getNumSegments",value:function(r){var n=15;return Math.min(Math.max(n,5),this.maxInstances)}},{key:"_getCurveSegmentPoints",value:function(r,n){if(r.length==4)return r;for(var i=Array((n+1)*2),a=0;a<=n;a++)if(a==0)i[0]=r[0],i[1]=r[1];else if(a==n)i[a*2]=r[r.length-2],i[a*2+1]=r[r.length-1];else{var s=a/n;this._setCurvePoint(r,s,i,a*2)}return i}},{key:"_setCurvePoint",value:function(r,n,i,a){if(r.length<=2)i[a]=r[0],i[a+1]=r[1];else{for(var s=Array(r.length-2),o=0;o0}},o=function(d){var f=d.pstyle("text-events").strValue==="yes";return f?sS.USE_BB:sS.IGNORE},l=function(d){var f=d.position(),p=f.x,g=f.y,m=d.outerWidth(),y=d.outerHeight();return{w:m,h:y,x1:p-m/2,y1:g-y/2}};r.drawing.addAtlasCollection("node",{texRows:t.webglTexRowsNodes}),r.drawing.addAtlasCollection("label",{texRows:t.webglTexRows}),r.drawing.addTextureAtlasRenderType("node-body",{collection:"node",getKey:e.getStyleKey,getBoundingBox:e.getElementBox,drawElement:e.drawElement}),r.drawing.addSimpleShapeRenderType("node-body",{getBoundingBox:l,isSimple:qQe,shapeProps:{shape:"shape",color:"background-color",opacity:"background-opacity",radius:"corner-radius",border:!0}}),r.drawing.addSimpleShapeRenderType("node-overlay",{getBoundingBox:l,isVisible:s("overlay"),shapeProps:{shape:"overlay-shape",color:"overlay-color",opacity:"overlay-opacity",padding:"overlay-padding",radius:"overlay-corner-radius"}}),r.drawing.addSimpleShapeRenderType("node-underlay",{getBoundingBox:l,isVisible:s("underlay"),shapeProps:{shape:"underlay-shape",color:"underlay-color",opacity:"underlay-opacity",padding:"underlay-padding",radius:"underlay-corner-radius"}}),r.drawing.addTextureAtlasRenderType("label",{collection:"label",getTexPickingMode:o,getKey:DN(e.getLabelKey,null),getBoundingBox:MN(e.getLabelBox,null),drawClipped:!0,drawElement:e.drawLabel,getRotation:i(null),getRotationPoint:e.getLabelRotationPoint,getRotationOffset:e.getLabelRotationOffset,isVisible:a("label")}),r.drawing.addTextureAtlasRenderType("edge-source-label",{collection:"label",getTexPickingMode:o,getKey:DN(e.getSourceLabelKey,"source"),getBoundingBox:MN(e.getSourceLabelBox,"source"),drawClipped:!0,drawElement:e.drawSourceLabel,getRotation:i("source"),getRotationPoint:e.getSourceLabelRotationPoint,getRotationOffset:e.getSourceLabelRotationOffset,isVisible:a("source-label")}),r.drawing.addTextureAtlasRenderType("edge-target-label",{collection:"label",getTexPickingMode:o,getKey:DN(e.getTargetLabelKey,"target"),getBoundingBox:MN(e.getTargetLabelBox,"target"),drawClipped:!0,drawElement:e.drawTargetLabel,getRotation:i("target"),getRotationPoint:e.getTargetLabelRotationPoint,getRotationOffset:e.getTargetLabelRotationOffset,isVisible:a("target-label")});var u=VT(function(){console.log("garbage collect flag set"),r.data.gc=!0},1e4);r.onUpdateEleCalcs(function(h,d){var f=!1;d&&d.length>0&&(f|=r.drawing.invalidate(d)),f&&u()}),cJe(r)};function lJe(t){var e=t.cy.container(),r=e&&e.style&&e.style.backgroundColor||"white";return gie(r)}function dle(t,e){var r=t._private.rscratch;return Es(r,"labelWrapCachedLines",e)||[]}var DN=function(e,r){return function(n){var i=e(n),a=dle(n,r);return a.length>1?a.map(function(s,o){return"".concat(i,"_").concat(o)}):i}},MN=function(e,r){return function(n,i){var a=e(n);if(typeof i=="string"){var s=i.indexOf("_");if(s>0){var o=Number(i.substring(s+1)),l=dle(n,r),u=a.h/l.length,h=u*o,d=a.y1+h;return{x1:a.x1,w:a.w,y1:d,h:u,yOffset:h}}}return a}};function cJe(t){{var e=t.render;t.render=function(a){a=a||{};var s=t.cy;t.webgl&&(s.zoom()>Hoe?(uJe(t),e.call(t,a)):(hJe(t),ple(t,a,gw.SCREEN)))}}{var r=t.matchCanvasSize;t.matchCanvasSize=function(a){r.call(t,a),t.pickingFrameBuffer.setFramebufferAttachmentSizes(t.canvasWidth,t.canvasHeight),t.pickingFrameBuffer.needsDraw=!0}}t.findNearestElements=function(a,s,o,l){return yJe(t,a,s)};{var n=t.invalidateCachedZSortedEles;t.invalidateCachedZSortedEles=function(){n.call(t),t.pickingFrameBuffer.needsDraw=!0}}{var i=t.notify;t.notify=function(a,s){i.call(t,a,s),a==="viewport"||a==="bounds"?t.pickingFrameBuffer.needsDraw=!0:a==="background"&&t.drawing.invalidate(s,{type:"node-body"})}}}function uJe(t){var e=t.data.contexts[t.WEBGL];e.clear(e.COLOR_BUFFER_BIT|e.DEPTH_BUFFER_BIT)}function hJe(t){var e=function(n){n.save(),n.setTransform(1,0,0,1,0,0),n.clearRect(0,0,t.canvasWidth,t.canvasHeight),n.restore()};e(t.data.contexts[t.NODE]),e(t.data.contexts[t.DRAG])}function dJe(t){var e=t.canvasWidth,r=t.canvasHeight,n=_N(t),i=n.pan,a=n.zoom,s=AN();aS(s,s,[i.x,i.y]),RN(s,s,[a,a]);var o=AN();ZQe(o,e,r);var l=AN();return KQe(l,o,s),l}function fle(t,e){var r=t.canvasWidth,n=t.canvasHeight,i=_N(t),a=i.pan,s=i.zoom;e.setTransform(1,0,0,1,0,0),e.clearRect(0,0,r,n),e.translate(a.x,a.y),e.scale(s,s)}function fJe(t,e){t.drawSelectionRectangle(e,function(r){return fle(t,r)})}function pJe(t){var e=t.data.contexts[t.NODE];e.save(),fle(t,e),e.strokeStyle="rgba(0, 0, 0, 0.3)",e.beginPath(),e.moveTo(-1e3,0),e.lineTo(1e3,0),e.stroke(),e.beginPath(),e.moveTo(0,-1e3),e.lineTo(0,1e3),e.stroke(),e.restore()}function gJe(t){var e=function(i,a,s){for(var o=i.atlasManager.getAtlasCollection(a),l=t.data.contexts[t.NODE],u=o.atlases,h=0;h=0&&w.add(k)}return w}function yJe(t,e,r){var n=mJe(t,e,r),i=t.getCachedZSortedEles(),a,s,o=eo(n),l;try{for(o.s();!(l=o.n()).done;){var u=l.value,h=i[u];if(!a&&h.isNode()&&(a=h),!s&&h.isEdge()&&(s=h),a&&s)break}}catch(d){o.e(d)}finally{o.f()}return[a,s].filter(Boolean)}function NN(t,e,r){var n=t.drawing;e+=1,r.isNode()?(n.drawNode(r,e,"node-underlay"),n.drawNode(r,e,"node-body"),n.drawTexture(r,e,"label"),n.drawNode(r,e,"node-overlay")):(n.drawEdgeLine(r,e),n.drawEdgeArrow(r,e,"source"),n.drawEdgeArrow(r,e,"target"),n.drawTexture(r,e,"label"),n.drawTexture(r,e,"edge-source-label"),n.drawTexture(r,e,"edge-target-label"))}function ple(t,e,r){var n;t.webglDebug&&(n=performance.now());var i=t.drawing,a=0;if(r.screen&&t.data.canvasNeedsRedraw[t.SELECT_BOX]&&fJe(t,e),t.data.canvasNeedsRedraw[t.NODE]||r.picking){var s=t.data.contexts[t.WEBGL];r.screen?(s.clearColor(0,0,0,0),s.enable(s.BLEND),s.blendFunc(s.ONE,s.ONE_MINUS_SRC_ALPHA)):s.disable(s.BLEND),s.clear(s.COLOR_BUFFER_BIT|s.DEPTH_BUFFER_BIT),s.viewport(0,0,s.canvas.width,s.canvas.height);var o=dJe(t),l=t.getCachedZSortedEles();if(a=l.length,i.startFrame(o,r),r.screen){for(var u=0;u0&&s>0){p.clearRect(0,0,a,s),p.globalCompositeOperation="source-over";var g=this.getCachedZSortedEles();if(t.full)p.translate(-n.x1*u,-n.y1*u),p.scale(u,u),this.drawElements(p,g),p.scale(1/u,1/u),p.translate(n.x1*u,n.y1*u);else{var m=e.pan(),y={x:m.x*u,y:m.y*u};u*=e.zoom(),p.translate(y.x,y.y),p.scale(u,u),this.drawElements(p,g),p.scale(1/u,1/u),p.translate(-y.x,-y.y)}t.bg&&(p.globalCompositeOperation="destination-over",p.fillStyle=t.bg,p.rect(0,0,a,s),p.fill())}return f};function vJe(t,e){for(var r=atob(t),n=new ArrayBuffer(r.length),i=new Uint8Array(n),a=0;a"u"?"undefined":la(OffscreenCanvas))!=="undefined")r=new OffscreenCanvas(t,e);else{var n=this.cy.window(),i=n.document;r=i.createElement("canvas"),r.width=t,r.height=e}return r},[Zoe,kc,zu,SN,ip,hd,As,hle,dd,vw,xle].forEach(function(t){Cr(Yr,t)});var TJe=[{name:"null",impl:Coe},{name:"base",impl:Voe},{name:"canvas",impl:bJe}],wJe=[{type:"layout",extensions:UZe},{type:"renderer",extensions:TJe}],wle={},Cle={};function kle(t,e,r){var n=r,i=function(S){bn("Can not register `"+e+"` for `"+t+"` since `"+S+"` already exists in the prototype and can not be overridden")};if(t==="core"){if(lw.prototype[e])return i(e);lw.prototype[e]=r}else if(t==="collection"){if(Ba.prototype[e])return i(e);Ba.prototype[e]=r}else if(t==="layout"){for(var a=function(S){this.options=S,r.call(this,S),an(this._private)||(this._private={}),this._private.cy=S.cy,this._private.listeners=[],this.createEmitter()},s=a.prototype=Object.create(r.prototype),o=[],l=0;lg&&(this.rect.x-=(this.labelWidth-g)/2,this.setWidth(this.labelWidth)),this.labelHeight>m&&(this.labelPos=="center"?this.rect.y-=(this.labelHeight-m)/2:this.labelPos=="top"&&(this.rect.y-=this.labelHeight-m),this.setHeight(this.labelHeight))}}},d.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==s.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},d.prototype.transform=function(p){var g=this.rect.x;g>l.WORLD_BOUNDARY?g=l.WORLD_BOUNDARY:g<-l.WORLD_BOUNDARY&&(g=-l.WORLD_BOUNDARY);var m=this.rect.y;m>l.WORLD_BOUNDARY?m=l.WORLD_BOUNDARY:m<-l.WORLD_BOUNDARY&&(m=-l.WORLD_BOUNDARY);var y=new h(g,m),v=p.inverseTransformPoint(y);this.setLocation(v.x,v.y)},d.prototype.getLeft=function(){return this.rect.x},d.prototype.getRight=function(){return this.rect.x+this.rect.width},d.prototype.getTop=function(){return this.rect.y},d.prototype.getBottom=function(){return this.rect.y+this.rect.height},d.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},r.exports=d}),(function(r,n,i){function a(s,o){s==null&&o==null?(this.x=0,this.y=0):(this.x=s,this.y=o)}a.prototype.getX=function(){return this.x},a.prototype.getY=function(){return this.y},a.prototype.setX=function(s){this.x=s},a.prototype.setY=function(s){this.y=s},a.prototype.getDifference=function(s){return new DimensionD(this.x-s.x,this.y-s.y)},a.prototype.getCopy=function(){return new a(this.x,this.y)},a.prototype.translate=function(s){return this.x+=s.width,this.y+=s.height,this},r.exports=a}),(function(r,n,i){var a=i(2),s=i(10),o=i(0),l=i(6),u=i(3),h=i(1),d=i(13),f=i(12),p=i(11);function g(y,v,x){a.call(this,x),this.estimatedSize=s.MIN_VALUE,this.margin=o.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=y,v!=null&&v instanceof l?this.graphManager=v:v!=null&&v instanceof Layout&&(this.graphManager=v.graphManager)}g.prototype=Object.create(a.prototype);for(var m in a)g[m]=a[m];g.prototype.getNodes=function(){return this.nodes},g.prototype.getEdges=function(){return this.edges},g.prototype.getGraphManager=function(){return this.graphManager},g.prototype.getParent=function(){return this.parent},g.prototype.getLeft=function(){return this.left},g.prototype.getRight=function(){return this.right},g.prototype.getTop=function(){return this.top},g.prototype.getBottom=function(){return this.bottom},g.prototype.isConnected=function(){return this.isConnected},g.prototype.add=function(y,v,x){if(v==null&&x==null){var b=y;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(b)>-1)throw"Node already in graph!";return b.owner=this,this.getNodes().push(b),b}else{var w=y;if(!(this.getNodes().indexOf(v)>-1&&this.getNodes().indexOf(x)>-1))throw"Source or target not in graph!";if(!(v.owner==x.owner&&v.owner==this))throw"Both owners must be this graph!";return v.owner!=x.owner?null:(w.source=v,w.target=x,w.isInterGraph=!1,this.getEdges().push(w),v.edges.push(w),x!=v&&x.edges.push(w),w)}},g.prototype.remove=function(y){var v=y;if(y instanceof u){if(v==null)throw"Node is null!";if(!(v.owner!=null&&v.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";for(var x=v.edges.slice(),b,w=x.length,C=0;C-1&&S>-1))throw"Source and/or target doesn't know this edge!";b.source.edges.splice(k,1),b.target!=b.source&&b.target.edges.splice(S,1);var _=b.source.owner.getEdges().indexOf(b);if(_==-1)throw"Not in owner's edge list!";b.source.owner.getEdges().splice(_,1)}},g.prototype.updateLeftTop=function(){for(var y=s.MAX_VALUE,v=s.MAX_VALUE,x,b,w,C=this.getNodes(),_=C.length,k=0;k<_;k++){var S=C[k];x=S.getTop(),b=S.getLeft(),y>x&&(y=x),v>b&&(v=b)}return y==s.MAX_VALUE?null:(C[0].getParent().paddingLeft!=null?w=C[0].getParent().paddingLeft:w=this.margin,this.left=v-w,this.top=y-w,new f(this.left,this.top))},g.prototype.updateBounds=function(y){for(var v=s.MAX_VALUE,x=-s.MAX_VALUE,b=s.MAX_VALUE,w=-s.MAX_VALUE,C,_,k,S,L,$=this.nodes,I=$.length,z=0;zC&&(v=C),x<_&&(x=_),b>k&&(b=k),wC&&(v=C),x<_&&(x=_),b>k&&(b=k),w=this.nodes.length){var I=0;x.forEach(function(z){z.owner==y&&I++}),I==this.nodes.length&&(this.isConnected=!0)}},r.exports=g}),(function(r,n,i){var a,s=i(1);function o(l){a=i(5),this.layout=l,this.graphs=[],this.edges=[]}o.prototype.addRoot=function(){var l=this.layout.newGraph(),u=this.layout.newNode(null),h=this.add(l,u);return this.setRootGraph(h),this.rootGraph},o.prototype.add=function(l,u,h,d,f){if(h==null&&d==null&&f==null){if(l==null)throw"Graph is null!";if(u==null)throw"Parent node is null!";if(this.graphs.indexOf(l)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(l),l.parent!=null)throw"Already has a parent!";if(u.child!=null)throw"Already has a child!";return l.parent=u,u.child=l,l}else{f=h,d=u,h=l;var p=d.getOwner(),g=f.getOwner();if(!(p!=null&&p.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(g!=null&&g.getGraphManager()==this))throw"Target not in this graph mgr!";if(p==g)return h.isInterGraph=!1,p.add(h,d,f);if(h.isInterGraph=!0,h.source=d,h.target=f,this.edges.indexOf(h)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(h),!(h.source!=null&&h.target!=null))throw"Edge source and/or target is null!";if(!(h.source.edges.indexOf(h)==-1&&h.target.edges.indexOf(h)==-1))throw"Edge already in source and/or target incidency list!";return h.source.edges.push(h),h.target.edges.push(h),h}},o.prototype.remove=function(l){if(l instanceof a){var u=l;if(u.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(u==this.rootGraph||u.parent!=null&&u.parent.graphManager==this))throw"Invalid parent node!";var h=[];h=h.concat(u.getEdges());for(var d,f=h.length,p=0;p=l.getRight()?u[0]+=Math.min(l.getX()-o.getX(),o.getRight()-l.getRight()):l.getX()<=o.getX()&&l.getRight()>=o.getRight()&&(u[0]+=Math.min(o.getX()-l.getX(),l.getRight()-o.getRight())),o.getY()<=l.getY()&&o.getBottom()>=l.getBottom()?u[1]+=Math.min(l.getY()-o.getY(),o.getBottom()-l.getBottom()):l.getY()<=o.getY()&&l.getBottom()>=o.getBottom()&&(u[1]+=Math.min(o.getY()-l.getY(),l.getBottom()-o.getBottom()));var f=Math.abs((l.getCenterY()-o.getCenterY())/(l.getCenterX()-o.getCenterX()));l.getCenterY()===o.getCenterY()&&l.getCenterX()===o.getCenterX()&&(f=1);var p=f*u[0],g=u[1]/f;u[0]p)return u[0]=h,u[1]=m,u[2]=f,u[3]=$,!1;if(df)return u[0]=g,u[1]=d,u[2]=S,u[3]=p,!1;if(hf?(u[0]=v,u[1]=x,A=!0):(u[0]=y,u[1]=m,A=!0):N===D&&(h>f?(u[0]=g,u[1]=m,A=!0):(u[0]=b,u[1]=x,A=!0)),-M===D?f>h?(u[2]=L,u[3]=$,R=!0):(u[2]=S,u[3]=k,R=!0):M===D&&(f>h?(u[2]=_,u[3]=k,R=!0):(u[2]=I,u[3]=$,R=!0)),A&&R)return!1;if(h>f?d>p?(O=this.getCardinalDirection(N,D,4),B=this.getCardinalDirection(M,D,2)):(O=this.getCardinalDirection(-N,D,3),B=this.getCardinalDirection(-M,D,1)):d>p?(O=this.getCardinalDirection(-N,D,1),B=this.getCardinalDirection(-M,D,3)):(O=this.getCardinalDirection(N,D,2),B=this.getCardinalDirection(M,D,4)),!A)switch(O){case 1:G=m,P=h+-C/D,u[0]=P,u[1]=G;break;case 2:P=b,G=d+w*D,u[0]=P,u[1]=G;break;case 3:G=x,P=h+C/D,u[0]=P,u[1]=G;break;case 4:P=v,G=d+-w*D,u[0]=P,u[1]=G;break}if(!R)switch(B){case 1:H=k,V=f+-F/D,u[2]=V,u[3]=H;break;case 2:V=I,H=p+z*D,u[2]=V,u[3]=H;break;case 3:H=$,V=f+F/D,u[2]=V,u[3]=H;break;case 4:V=L,H=p+-z*D,u[2]=V,u[3]=H;break}}return!1},s.getCardinalDirection=function(o,l,u){return o>l?u:1+u%4},s.getIntersection=function(o,l,u,h){if(h==null)return this.getIntersection2(o,l,u);var d=o.x,f=o.y,p=l.x,g=l.y,m=u.x,y=u.y,v=h.x,x=h.y,b=void 0,w=void 0,C=void 0,_=void 0,k=void 0,S=void 0,L=void 0,$=void 0,I=void 0;return C=g-f,k=d-p,L=p*f-d*g,_=x-y,S=m-v,$=v*y-m*x,I=C*S-_*k,I===0?null:(b=(k*$-S*L)/I,w=(_*L-C*$)/I,new a(b,w))},s.angleOfVector=function(o,l,u,h){var d=void 0;return o!==u?(d=Math.atan((h-l)/(u-o)),u0?1:s<0?-1:0},a.floor=function(s){return s<0?Math.ceil(s):Math.floor(s)},a.ceil=function(s){return s<0?Math.floor(s):Math.ceil(s)},r.exports=a}),(function(r,n,i){function a(){}a.MAX_VALUE=2147483647,a.MIN_VALUE=-2147483648,r.exports=a}),(function(r,n,i){var a=(function(){function d(f,p){for(var g=0;g"u"?"undefined":a(o);return o==null||l!="object"&&l!="function"},r.exports=s}),(function(r,n,i){function a(m){if(Array.isArray(m)){for(var y=0,v=Array(m.length);y0&&y;){for(C.push(k[0]);C.length>0&&y;){var S=C[0];C.splice(0,1),w.add(S);for(var L=S.getEdges(),b=0;b-1&&k.splice(F,1)}w=new Set,_=new Map}}return m},g.prototype.createDummyNodesForBendpoints=function(m){for(var y=[],v=m.source,x=this.graphManager.calcLowestCommonAncestor(m.source,m.target),b=0;b0){for(var x=this.edgeToDummyNodes.get(v),b=0;b=0&&y.splice($,1);var I=_.getNeighborsList();I.forEach(function(A){if(v.indexOf(A)<0){var R=x.get(A),N=R-1;N==1&&S.push(A),x.set(A,N)}})}v=v.concat(S),(y.length==1||y.length==2)&&(b=!0,w=y[0])}return w},g.prototype.setGraphManager=function(m){this.graphManager=m},r.exports=g}),(function(r,n,i){function a(){}a.seed=1,a.x=0,a.nextDouble=function(){return a.x=Math.sin(a.seed++)*1e4,a.x-Math.floor(a.x)},r.exports=a}),(function(r,n,i){var a=i(4);function s(o,l){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}s.prototype.getWorldOrgX=function(){return this.lworldOrgX},s.prototype.setWorldOrgX=function(o){this.lworldOrgX=o},s.prototype.getWorldOrgY=function(){return this.lworldOrgY},s.prototype.setWorldOrgY=function(o){this.lworldOrgY=o},s.prototype.getWorldExtX=function(){return this.lworldExtX},s.prototype.setWorldExtX=function(o){this.lworldExtX=o},s.prototype.getWorldExtY=function(){return this.lworldExtY},s.prototype.setWorldExtY=function(o){this.lworldExtY=o},s.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},s.prototype.setDeviceOrgX=function(o){this.ldeviceOrgX=o},s.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},s.prototype.setDeviceOrgY=function(o){this.ldeviceOrgY=o},s.prototype.getDeviceExtX=function(){return this.ldeviceExtX},s.prototype.setDeviceExtX=function(o){this.ldeviceExtX=o},s.prototype.getDeviceExtY=function(){return this.ldeviceExtY},s.prototype.setDeviceExtY=function(o){this.ldeviceExtY=o},s.prototype.transformX=function(o){var l=0,u=this.lworldExtX;return u!=0&&(l=this.ldeviceOrgX+(o-this.lworldOrgX)*this.ldeviceExtX/u),l},s.prototype.transformY=function(o){var l=0,u=this.lworldExtY;return u!=0&&(l=this.ldeviceOrgY+(o-this.lworldOrgY)*this.ldeviceExtY/u),l},s.prototype.inverseTransformX=function(o){var l=0,u=this.ldeviceExtX;return u!=0&&(l=this.lworldOrgX+(o-this.ldeviceOrgX)*this.lworldExtX/u),l},s.prototype.inverseTransformY=function(o){var l=0,u=this.ldeviceExtY;return u!=0&&(l=this.lworldOrgY+(o-this.ldeviceOrgY)*this.lworldExtY/u),l},s.prototype.inverseTransformPoint=function(o){var l=new a(this.inverseTransformX(o.x),this.inverseTransformY(o.y));return l},r.exports=s}),(function(r,n,i){function a(p){if(Array.isArray(p)){for(var g=0,m=Array(p.length);go.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*o.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(p-o.ADAPTATION_LOWER_NODE_LIMIT)/(o.ADAPTATION_UPPER_NODE_LIMIT-o.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-o.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=o.MAX_NODE_DISPLACEMENT_INCREMENTAL):(p>o.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(o.COOLING_ADAPTATION_FACTOR,1-(p-o.ADAPTATION_LOWER_NODE_LIMIT)/(o.ADAPTATION_UPPER_NODE_LIMIT-o.ADAPTATION_LOWER_NODE_LIMIT)*(1-o.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=o.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},d.prototype.calcSpringForces=function(){for(var p=this.getAllEdges(),g,m=0;m0&&arguments[0]!==void 0?arguments[0]:!0,g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,m,y,v,x,b=this.getAllNodes(),w;if(this.useFRGridVariant)for(this.totalIterations%o.GRID_CALCULATION_CHECK_PERIOD==1&&p&&this.updateGrid(),w=new Set,m=0;mC||w>C)&&(p.gravitationForceX=-this.gravityConstant*v,p.gravitationForceY=-this.gravityConstant*x)):(C=g.getEstimatedSize()*this.compoundGravityRangeFactor,(b>C||w>C)&&(p.gravitationForceX=-this.gravityConstant*v*this.compoundGravityConstant,p.gravitationForceY=-this.gravityConstant*x*this.compoundGravityConstant))},d.prototype.isConverged=function(){var p,g=!1;return this.totalIterations>this.maxIterations/3&&(g=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),p=this.totalDisplacement=b.length||C>=b[0].length)){for(var _=0;_d}}]),u})();r.exports=l}),(function(r,n,i){var a=(function(){function l(u,h){for(var d=0;d2&&arguments[2]!==void 0?arguments[2]:1,f=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,p=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;s(this,l),this.sequence1=u,this.sequence2=h,this.match_score=d,this.mismatch_penalty=f,this.gap_penalty=p,this.iMax=u.length+1,this.jMax=h.length+1,this.grid=new Array(this.iMax);for(var g=0;g=0;u--){var h=this.listeners[u];h.event===o&&h.callback===l&&this.listeners.splice(u,1)}},s.emit=function(o,l){for(var u=0;uh.coolingFactor*h.maxNodeDisplacement&&(this.displacementX=h.coolingFactor*h.maxNodeDisplacement*o.sign(this.displacementX)),Math.abs(this.displacementY)>h.coolingFactor*h.maxNodeDisplacement&&(this.displacementY=h.coolingFactor*h.maxNodeDisplacement*o.sign(this.displacementY)),this.child==null?this.moveBy(this.displacementX,this.displacementY):this.child.getNodes().length==0?this.moveBy(this.displacementX,this.displacementY):this.propogateDisplacementToChildren(this.displacementX,this.displacementY),h.totalDisplacement+=Math.abs(this.displacementX)+Math.abs(this.displacementY),this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0},l.prototype.propogateDisplacementToChildren=function(h,d){for(var f=this.getChild().getNodes(),p,g=0;g0)this.positionNodesRadially(k);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var S=new Set(this.getAllNodes()),L=this.nodesWithGravity.filter(function($){return S.has($)});this.graphManager.setAllNodesToApplyGravitation(L),this.positionNodesRandomly()}}return this.initSpringEmbedder(),this.runSpringEmbedder(),!0},C.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished)if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.totalIterations%f.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;this.coolingCycle++,this.layoutQuality==0?this.coolingAdjuster=this.coolingCycle:this.layoutQuality==1&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var k=new Set(this.getAllNodes()),S=this.nodesWithGravity.filter(function(I){return k.has(I)});this.graphManager.setAllNodesToApplyGravitation(S),this.graphManager.updateBounds(),this.updateGrid(),this.coolingFactor=f.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),this.coolingFactor=f.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var L=!this.isTreeGrowing&&!this.isGrowthFinished,$=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(L,$),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},C.prototype.getPositionsData=function(){for(var k=this.graphManager.getAllNodes(),S={},L=0;L1){var A;for(A=0;A$&&($=Math.floor(F.y)),z=Math.floor(F.x+d.DEFAULT_COMPONENT_SEPERATION)}this.transform(new m(p.WORLD_CENTER_X-F.x/2,p.WORLD_CENTER_Y-F.y/2))},C.radialLayout=function(k,S,L){var $=Math.max(this.maxDiagonalInTree(k),d.DEFAULT_RADIAL_SEPARATION);C.branchRadialLayout(S,null,0,359,0,$);var I=b.calculateBounds(k),z=new w;z.setDeviceOrgX(I.getMinX()),z.setDeviceOrgY(I.getMinY()),z.setWorldOrgX(L.x),z.setWorldOrgY(L.y);for(var F=0;F1;){var H=V[0];V.splice(0,1);var W=D.indexOf(H);W>=0&&D.splice(W,1),P--,O--}S!=null?G=(D.indexOf(V[0])+1)%P:G=0;for(var ie=Math.abs($-L)/O,j=G;B!=O;j=++j%P){var ae=D[j].getOtherEnd(k);if(ae!=S){var J=(L+B*ie)%360,K=(J+ie)%360;C.branchRadialLayout(ae,k,J,K,I+z,z),B++}}},C.maxDiagonalInTree=function(k){for(var S=v.MIN_VALUE,L=0;LS&&(S=I)}return S},C.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},C.prototype.groupZeroDegreeMembers=function(){var k=this,S={};this.memberGroups={},this.idToDummyNode={};for(var L=[],$=this.graphManager.getAllNodes(),I=0;I<$.length;I++){var z=$[I],F=z.getParent();this.getNodeDegreeWithChildren(z)===0&&(F.id==null||!this.getToBeTiled(F))&&L.push(z)}for(var I=0;I"u"&&(S[A]=[]),S[A]=S[A].concat(z)}Object.keys(S).forEach(function(R){if(S[R].length>1){var N="DummyCompound_"+R;k.memberGroups[N]=S[R];var M=S[R][0].getParent(),D=new u(k.graphManager);D.id=N,D.paddingLeft=M.paddingLeft||0,D.paddingRight=M.paddingRight||0,D.paddingBottom=M.paddingBottom||0,D.paddingTop=M.paddingTop||0,k.idToDummyNode[N]=D;var O=k.getGraphManager().add(k.newGraph(),D),B=M.getChild();B.add(D);for(var P=0;P=0;k--){var S=this.compoundOrder[k],L=S.id,$=S.paddingLeft,I=S.paddingTop;this.adjustLocations(this.tiledMemberPack[L],S.rect.x,S.rect.y,$,I)}},C.prototype.repopulateZeroDegreeMembers=function(){var k=this,S=this.tiledZeroDegreePack;Object.keys(S).forEach(function(L){var $=k.idToDummyNode[L],I=$.paddingLeft,z=$.paddingTop;k.adjustLocations(S[L],$.rect.x,$.rect.y,I,z)})},C.prototype.getToBeTiled=function(k){var S=k.id;if(this.toBeTiled[S]!=null)return this.toBeTiled[S];var L=k.getChild();if(L==null)return this.toBeTiled[S]=!1,!1;for(var $=L.getNodes(),I=0;I<$.length;I++){var z=$[I];if(this.getNodeDegree(z)>0)return this.toBeTiled[S]=!1,!1;if(z.getChild()==null){this.toBeTiled[z.id]=!1;continue}if(!this.getToBeTiled(z))return this.toBeTiled[S]=!1,!1}return this.toBeTiled[S]=!0,!0},C.prototype.getNodeDegree=function(k){k.id;for(var S=k.getEdges(),L=0,$=0;$R&&(R=M.rect.height)}L+=R+k.verticalPadding}},C.prototype.tileCompoundMembers=function(k,S){var L=this;this.tiledMemberPack=[],Object.keys(k).forEach(function($){var I=S[$];L.tiledMemberPack[$]=L.tileNodes(k[$],I.paddingLeft+I.paddingRight),I.rect.width=L.tiledMemberPack[$].width,I.rect.height=L.tiledMemberPack[$].height})},C.prototype.tileNodes=function(k,S){var L=d.TILING_PADDING_VERTICAL,$=d.TILING_PADDING_HORIZONTAL,I={rows:[],rowWidth:[],rowHeight:[],width:0,height:S,verticalPadding:L,horizontalPadding:$};k.sort(function(A,R){return A.rect.width*A.rect.height>R.rect.width*R.rect.height?-1:A.rect.width*A.rect.height0&&(F+=k.horizontalPadding),k.rowWidth[L]=F,k.width0&&(A+=k.verticalPadding);var R=0;A>k.rowHeight[L]&&(R=k.rowHeight[L],k.rowHeight[L]=A,R=k.rowHeight[L]-R),k.height+=R,k.rows[L].push(S)},C.prototype.getShortestRowIndex=function(k){for(var S=-1,L=Number.MAX_VALUE,$=0;$L&&(S=$,L=k.rowWidth[$]);return S},C.prototype.canAddHorizontal=function(k,S,L){var $=this.getShortestRowIndex(k);if($<0)return!0;var I=k.rowWidth[$];if(I+k.horizontalPadding+S<=k.width)return!0;var z=0;k.rowHeight[$]0&&(z=L+k.verticalPadding-k.rowHeight[$]);var F;k.width-I>=S+k.horizontalPadding?F=(k.height+z)/(I+S+k.horizontalPadding):F=(k.height+z)/k.width,z=L+k.verticalPadding;var A;return k.widthz&&S!=L){$.splice(-1,1),k.rows[L].push(I),k.rowWidth[S]=k.rowWidth[S]-z,k.rowWidth[L]=k.rowWidth[L]+z,k.width=k.rowWidth[instance.getLongestRowIndex(k)];for(var F=Number.MIN_VALUE,A=0;A<$.length;A++)$[A].height>F&&(F=$[A].height);S>0&&(F+=k.verticalPadding);var R=k.rowHeight[S]+k.rowHeight[L];k.rowHeight[S]=F,k.rowHeight[L]0)for(var B=I;B<=z;B++)O[0]+=this.grid[B][F-1].length+this.grid[B][F].length-1;if(z0)for(var B=F;B<=A;B++)O[3]+=this.grid[I-1][B].length+this.grid[I][B].length-1;for(var P=v.MAX_VALUE,G,V,H=0;H0){var A;A=w.getGraphManager().add(w.newGraph(),L),this.processChildrenList(A,S,w)}}},m.prototype.stop=function(){return this.stopped=!0,this};var v=function(b){b("layout","cose-bilkent",m)};typeof cytoscape<"u"&&v(cytoscape),n.exports=v})])})})(cS)),cS.exports}var DJe=IJe();const MJe=po(DJe);Sc.use(MJe);function Rle(t,e){t.forEach(r=>{const n={id:r.id,labelText:r.label,height:r.height,width:r.width,padding:r.padding??0};Object.keys(r).forEach(i=>{["id","label","height","width","padding","x","y"].includes(i)||(n[i]=r[i])}),e.add({group:"nodes",data:n,position:{x:r.x??0,y:r.y??0}})})}T(Rle,"addNodes");function Lle(t,e){t.forEach(r=>{const n={id:r.id,source:r.start,target:r.end};Object.keys(r).forEach(i=>{["id","start","end"].includes(i)||(n[i]=r[i])}),e.add({group:"edges",data:n})})}T(Lle,"addEdges");function Ile(t){return new Promise(e=>{const r=gt("body").append("div").attr("id","cy").attr("style","display:none"),n=Sc({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"bezier"}}]});r.remove(),Rle(t.nodes,n),Lle(t.edges,n),n.nodes().forEach(function(a){a.layoutDimensions=()=>{const s=a.data();return{w:s.width,h:s.height}}});const i={name:"cose-bilkent",quality:"proof",styleEnabled:!1,animate:!1};n.layout(i).run(),n.ready(a=>{se.info("Cytoscape ready",a),e(n)})})}T(Ile,"createCytoscapeInstance");function Dle(t){return t.nodes().map(e=>{const r=e.data(),n=e.position(),i={id:r.id,x:n.x,y:n.y};return Object.keys(r).forEach(a=>{a!=="id"&&(i[a]=r[a])}),i})}T(Dle,"extractPositionedNodes");function Mle(t){return t.edges().map(e=>{const r=e.data(),n=e._private.rscratch,i={id:r.id,source:r.source,target:r.target,startX:n.startX,startY:n.startY,midX:n.midX,midY:n.midY,endX:n.endX,endY:n.endY};return Object.keys(r).forEach(a=>{["id","source","target"].includes(a)||(i[a]=r[a])}),i})}T(Mle,"extractPositionedEdges");async function Nle(t,e){se.debug("Starting cose-bilkent layout algorithm");try{$le(t);const r=await Ile(t),n=Dle(r),i=Mle(r);return se.debug(`Layout completed: ${n.length} nodes, ${i.length} edges`),{nodes:n,edges:i}}catch(r){throw se.error("Error in cose-bilkent layout algorithm:",r),r}}T(Nle,"executeCoseBilkentLayout");function $le(t){if(!t)throw new Error("Layout data is required");if(!t.config)throw new Error("Configuration is required in layout data");if(!t.rootNode)throw new Error("Root node is required");if(!t.nodes||!Array.isArray(t.nodes))throw new Error("No nodes found in layout data");if(!Array.isArray(t.edges))throw new Error("Edges array is required in layout data");return!0}T($le,"validateLayoutData");var NJe=T(async(t,e,{insertCluster:r,insertEdge:n,insertEdgeLabel:i,insertMarkers:a,insertNode:s,log:o,positionEdgeLabel:l},{algorithm:u})=>{const h={},d={},f=e.select("g");a(f,t.markers,t.type,t.diagramId);const p=f.insert("g").attr("class","subgraphs"),g=f.insert("g").attr("class","edgePaths"),m=f.insert("g").attr("class","edgeLabels"),y=f.insert("g").attr("class","nodes");o.debug("Inserting nodes into DOM for dimension calculation"),await Promise.all(t.nodes.map(async b=>{if(b.isGroup){const w={...b};d[b.id]=w,h[b.id]=w,await r(p,b)}else{const w={...b};h[b.id]=w;const C=await s(y,b,{config:t.config,dir:t.direction||"TB"}),_=C.node().getBBox();w.width=_.width,w.height=_.height,w.domId=C,o.debug(`Node ${b.id} dimensions: ${_.width}x${_.height}`)}})),o.debug("Running cose-bilkent layout algorithm");const v={...t,nodes:t.nodes.map(b=>{const w=h[b.id];return{...b,width:w.width,height:w.height}})},x=await Nle(v,t.config);o.debug("Positioning nodes based on layout results"),x.nodes.forEach(b=>{const w=h[b.id];w!=null&&w.domId&&(w.domId.attr("transform",`translate(${b.x}, ${b.y})`),w.x=b.x,w.y=b.y,o.debug(`Positioned node ${w.id} at center (${b.x}, ${b.y})`))}),x.edges.forEach(b=>{const w=t.edges.find(C=>C.id===b.id);w&&(w.points=[{x:b.startX,y:b.startY},{x:b.midX,y:b.midY},{x:b.endX,y:b.endY}])}),o.debug("Inserting and positioning edges"),await Promise.all(t.edges.map(async b=>{await i(m,b);const w=h[b.start??""],C=h[b.end??""];if(w&&C){const _=x.edges.find(k=>k.id===b.id);if(_){o.debug("APA01 positionedEdge",_);const k={...b},S=n(g,k,d,t.type,w,C,t.diagramId);l(k,S)}else{const k={...b,points:[{x:w.x||0,y:w.y||0},{x:C.x||0,y:C.y||0}]},S=n(g,k,d,t.type,w,C,t.diagramId);l(k,S)}}})),o.debug("Cose-bilkent rendering completed")},"render"),$Je=NJe;const OJe=Object.freeze(Object.defineProperty({__proto__:null,render:$Je},Symbol.toStringTag,{value:"Module"}));var dS=T((t,e)=>{const r=t.append("rect");if(r.attr("x",e.x),r.attr("y",e.y),r.attr("fill",e.fill),r.attr("stroke",e.stroke),r.attr("width",e.width),r.attr("height",e.height),e.name&&r.attr("name",e.name),e.rx&&r.attr("rx",e.rx),e.ry&&r.attr("ry",e.ry),e.attrs!==void 0)for(const n in e.attrs)r.attr(n,e.attrs[n]);return e.class&&r.attr("class",e.class),r},"drawRect"),Ole=T((t,e)=>{const r={x:e.startx,y:e.starty,width:e.stopx-e.startx,height:e.stopy-e.starty,fill:e.fill,stroke:e.stroke,class:"rect"};dS(t,r).lower()},"drawBackgroundRect"),PJe=T((t,e)=>{const r=e.text.replace(z0," "),n=t.append("text");n.attr("x",e.x),n.attr("y",e.y),n.attr("class","legend"),n.style("text-anchor",e.anchor),e.class&&n.attr("class",e.class);const i=n.append("tspan");return i.attr("x",e.x+e.textMargin*2),i.text(r),n},"drawText"),BN=T((t,e,r,n)=>{const i=t.append("image");i.attr("x",e),i.attr("y",r);const a=df.sanitizeUrl(n);i.attr("xlink:href",a)},"drawImage"),FN=T((t,e,r,n)=>{const i=t.append("use");i.attr("x",e),i.attr("y",r);const a=df.sanitizeUrl(n);i.attr("xlink:href",`#${a}`)},"drawEmbeddedImage"),Ro=T(()=>({x:0,y:0,width:100,height:100,fill:"#EDF2AE",stroke:"#666",anchor:"start",rx:0,ry:0}),"getNoteRect"),zN=T(()=>({x:0,y:0,width:100,height:100,"text-anchor":"start",style:"#666",textMargin:0,rx:0,ry:0,tspan:!0}),"getTextObj"),Ple=T(()=>{let t=gt(".mermaidTooltip");return t.empty()&&(t=gt("body").append("div").attr("class","mermaidTooltip").style("opacity",0).style("position","absolute").style("text-align","center").style("max-width","200px").style("padding","2px").style("font-size","12px").style("background","#ffffde").style("border","1px solid #333").style("border-radius","2px").style("pointer-events","none").style("z-index","100")),t},"createTooltip"),fS=(function(){var t=T(function(Ce,Ve,Qe,nt){for(Qe=Qe||{},nt=Ce.length;nt--;Qe[Ce[nt]]=Ve);return Qe},"o"),e=[1,24],r=[1,25],n=[1,26],i=[1,27],a=[1,28],s=[1,63],o=[1,64],l=[1,65],u=[1,66],h=[1,67],d=[1,68],f=[1,69],p=[1,29],g=[1,30],m=[1,31],y=[1,32],v=[1,33],x=[1,34],b=[1,35],w=[1,36],C=[1,37],_=[1,38],k=[1,39],S=[1,40],L=[1,41],$=[1,42],I=[1,43],z=[1,44],F=[1,45],A=[1,46],R=[1,47],N=[1,48],M=[1,50],D=[1,51],O=[1,52],B=[1,53],P=[1,54],G=[1,55],V=[1,56],H=[1,57],W=[1,58],ie=[1,59],j=[1,60],ae=[14,42],J=[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],K=[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],Q=[1,82],re=[1,83],le=[1,84],fe=[1,85],Ae=[12,14,42],Se=[12,14,33,42],Ne=[12,14,33,42,76,77,79,80],ge=[12,33],ve=[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],ze={trace:T(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:T(function(Ve,Qe,nt,tt,Ze,ke,_e){var Y=ke.length-1;switch(Ze){case 3:tt.setDirection("TB");break;case 4:tt.setDirection("BT");break;case 5:tt.setDirection("RL");break;case 6:tt.setDirection("LR");break;case 8:case 9:case 10:case 11:case 12:tt.setC4Type(ke[Y-3]);break;case 19:tt.setTitle(ke[Y].substring(6)),this.$=ke[Y].substring(6);break;case 20:tt.setAccDescription(ke[Y].substring(15)),this.$=ke[Y].substring(15);break;case 21:this.$=ke[Y].trim(),tt.setTitle(this.$);break;case 22:case 23:this.$=ke[Y].trim(),tt.setAccDescription(this.$);break;case 28:ke[Y].splice(2,0,"ENTERPRISE"),tt.addPersonOrSystemBoundary(...ke[Y]),this.$=ke[Y];break;case 29:ke[Y].splice(2,0,"SYSTEM"),tt.addPersonOrSystemBoundary(...ke[Y]),this.$=ke[Y];break;case 30:tt.addPersonOrSystemBoundary(...ke[Y]),this.$=ke[Y];break;case 31:ke[Y].splice(2,0,"CONTAINER"),tt.addContainerBoundary(...ke[Y]),this.$=ke[Y];break;case 32:tt.addDeploymentNode("node",...ke[Y]),this.$=ke[Y];break;case 33:tt.addDeploymentNode("nodeL",...ke[Y]),this.$=ke[Y];break;case 34:tt.addDeploymentNode("nodeR",...ke[Y]),this.$=ke[Y];break;case 35:tt.popBoundaryParseStack();break;case 39:tt.addPersonOrSystem("person",...ke[Y]),this.$=ke[Y];break;case 40:tt.addPersonOrSystem("external_person",...ke[Y]),this.$=ke[Y];break;case 41:tt.addPersonOrSystem("system",...ke[Y]),this.$=ke[Y];break;case 42:tt.addPersonOrSystem("system_db",...ke[Y]),this.$=ke[Y];break;case 43:tt.addPersonOrSystem("system_queue",...ke[Y]),this.$=ke[Y];break;case 44:tt.addPersonOrSystem("external_system",...ke[Y]),this.$=ke[Y];break;case 45:tt.addPersonOrSystem("external_system_db",...ke[Y]),this.$=ke[Y];break;case 46:tt.addPersonOrSystem("external_system_queue",...ke[Y]),this.$=ke[Y];break;case 47:tt.addContainer("container",...ke[Y]),this.$=ke[Y];break;case 48:tt.addContainer("container_db",...ke[Y]),this.$=ke[Y];break;case 49:tt.addContainer("container_queue",...ke[Y]),this.$=ke[Y];break;case 50:tt.addContainer("external_container",...ke[Y]),this.$=ke[Y];break;case 51:tt.addContainer("external_container_db",...ke[Y]),this.$=ke[Y];break;case 52:tt.addContainer("external_container_queue",...ke[Y]),this.$=ke[Y];break;case 53:tt.addComponent("component",...ke[Y]),this.$=ke[Y];break;case 54:tt.addComponent("component_db",...ke[Y]),this.$=ke[Y];break;case 55:tt.addComponent("component_queue",...ke[Y]),this.$=ke[Y];break;case 56:tt.addComponent("external_component",...ke[Y]),this.$=ke[Y];break;case 57:tt.addComponent("external_component_db",...ke[Y]),this.$=ke[Y];break;case 58:tt.addComponent("external_component_queue",...ke[Y]),this.$=ke[Y];break;case 60:tt.addRel("rel",...ke[Y]),this.$=ke[Y];break;case 61:tt.addRel("birel",...ke[Y]),this.$=ke[Y];break;case 62:tt.addRel("rel_u",...ke[Y]),this.$=ke[Y];break;case 63:tt.addRel("rel_d",...ke[Y]),this.$=ke[Y];break;case 64:tt.addRel("rel_l",...ke[Y]),this.$=ke[Y];break;case 65:tt.addRel("rel_r",...ke[Y]),this.$=ke[Y];break;case 66:tt.addRel("rel_b",...ke[Y]),this.$=ke[Y];break;case 67:ke[Y].splice(0,1),tt.addRel("rel",...ke[Y]),this.$=ke[Y];break;case 68:tt.updateElStyle("update_el_style",...ke[Y]),this.$=ke[Y];break;case 69:tt.updateRelStyle("update_rel_style",...ke[Y]),this.$=ke[Y];break;case 70:tt.updateLayoutConfig("update_layout_config",...ke[Y]),this.$=ke[Y];break;case 71:this.$=[ke[Y]];break;case 72:ke[Y].unshift(ke[Y-1]),this.$=ke[Y];break;case 73:case 75:this.$=ke[Y].trim();break;case 74:let he={};he[ke[Y-1].trim()]=ke[Y].trim(),this.$=he;break;case 76:this.$="";break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],7:[1,6],8:[1,7],9:[1,8],10:4,11:[1,9],15:[1,10],16:[1,11],17:[1,12],18:[1,13]},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,7]},{1:[2,3]},{1:[2,4]},{1:[2,5]},{1:[2,6]},{12:[1,14]},{12:[1,15]},{12:[1,16]},{12:[1,17]},{12:[1,18]},{13:19,19:20,20:21,21:22,22:e,23:r,24:n,26:i,28:a,29:49,30:61,32:62,34:s,36:o,37:l,38:u,39:h,40:d,41:f,43:23,44:p,45:g,46:m,47:y,48:v,49:x,50:b,51:w,52:C,53:_,54:k,55:S,56:L,57:$,58:I,59:z,60:F,61:A,62:R,63:N,64:M,65:D,66:O,67:B,68:P,69:G,70:V,71:H,72:W,73:ie,74:j},{13:70,19:20,20:21,21:22,22:e,23:r,24:n,26:i,28:a,29:49,30:61,32:62,34:s,36:o,37:l,38:u,39:h,40:d,41:f,43:23,44:p,45:g,46:m,47:y,48:v,49:x,50:b,51:w,52:C,53:_,54:k,55:S,56:L,57:$,58:I,59:z,60:F,61:A,62:R,63:N,64:M,65:D,66:O,67:B,68:P,69:G,70:V,71:H,72:W,73:ie,74:j},{13:71,19:20,20:21,21:22,22:e,23:r,24:n,26:i,28:a,29:49,30:61,32:62,34:s,36:o,37:l,38:u,39:h,40:d,41:f,43:23,44:p,45:g,46:m,47:y,48:v,49:x,50:b,51:w,52:C,53:_,54:k,55:S,56:L,57:$,58:I,59:z,60:F,61:A,62:R,63:N,64:M,65:D,66:O,67:B,68:P,69:G,70:V,71:H,72:W,73:ie,74:j},{13:72,19:20,20:21,21:22,22:e,23:r,24:n,26:i,28:a,29:49,30:61,32:62,34:s,36:o,37:l,38:u,39:h,40:d,41:f,43:23,44:p,45:g,46:m,47:y,48:v,49:x,50:b,51:w,52:C,53:_,54:k,55:S,56:L,57:$,58:I,59:z,60:F,61:A,62:R,63:N,64:M,65:D,66:O,67:B,68:P,69:G,70:V,71:H,72:W,73:ie,74:j},{13:73,19:20,20:21,21:22,22:e,23:r,24:n,26:i,28:a,29:49,30:61,32:62,34:s,36:o,37:l,38:u,39:h,40:d,41:f,43:23,44:p,45:g,46:m,47:y,48:v,49:x,50:b,51:w,52:C,53:_,54:k,55:S,56:L,57:$,58:I,59:z,60:F,61:A,62:R,63:N,64:M,65:D,66:O,67:B,68:P,69:G,70:V,71:H,72:W,73:ie,74:j},{14:[1,74]},t(ae,[2,13],{43:23,29:49,30:61,32:62,20:75,34:s,36:o,37:l,38:u,39:h,40:d,41:f,44:p,45:g,46:m,47:y,48:v,49:x,50:b,51:w,52:C,53:_,54:k,55:S,56:L,57:$,58:I,59:z,60:F,61:A,62:R,63:N,64:M,65:D,66:O,67:B,68:P,69:G,70:V,71:H,72:W,73:ie,74:j}),t(ae,[2,14]),t(J,[2,16],{12:[1,76]}),t(ae,[2,36],{12:[1,77]}),t(K,[2,19]),t(K,[2,20]),{25:[1,78]},{27:[1,79]},t(K,[2,23]),{35:80,75:81,76:Q,77:re,79:le,80:fe},{35:86,75:81,76:Q,77:re,79:le,80:fe},{35:87,75:81,76:Q,77:re,79:le,80:fe},{35:88,75:81,76:Q,77:re,79:le,80:fe},{35:89,75:81,76:Q,77:re,79:le,80:fe},{35:90,75:81,76:Q,77:re,79:le,80:fe},{35:91,75:81,76:Q,77:re,79:le,80:fe},{35:92,75:81,76:Q,77:re,79:le,80:fe},{35:93,75:81,76:Q,77:re,79:le,80:fe},{35:94,75:81,76:Q,77:re,79:le,80:fe},{35:95,75:81,76:Q,77:re,79:le,80:fe},{35:96,75:81,76:Q,77:re,79:le,80:fe},{35:97,75:81,76:Q,77:re,79:le,80:fe},{35:98,75:81,76:Q,77:re,79:le,80:fe},{35:99,75:81,76:Q,77:re,79:le,80:fe},{35:100,75:81,76:Q,77:re,79:le,80:fe},{35:101,75:81,76:Q,77:re,79:le,80:fe},{35:102,75:81,76:Q,77:re,79:le,80:fe},{35:103,75:81,76:Q,77:re,79:le,80:fe},{35:104,75:81,76:Q,77:re,79:le,80:fe},t(Ae,[2,59]),{35:105,75:81,76:Q,77:re,79:le,80:fe},{35:106,75:81,76:Q,77:re,79:le,80:fe},{35:107,75:81,76:Q,77:re,79:le,80:fe},{35:108,75:81,76:Q,77:re,79:le,80:fe},{35:109,75:81,76:Q,77:re,79:le,80:fe},{35:110,75:81,76:Q,77:re,79:le,80:fe},{35:111,75:81,76:Q,77:re,79:le,80:fe},{35:112,75:81,76:Q,77:re,79:le,80:fe},{35:113,75:81,76:Q,77:re,79:le,80:fe},{35:114,75:81,76:Q,77:re,79:le,80:fe},{35:115,75:81,76:Q,77:re,79:le,80:fe},{20:116,29:49,30:61,32:62,34:s,36:o,37:l,38:u,39:h,40:d,41:f,43:23,44:p,45:g,46:m,47:y,48:v,49:x,50:b,51:w,52:C,53:_,54:k,55:S,56:L,57:$,58:I,59:z,60:F,61:A,62:R,63:N,64:M,65:D,66:O,67:B,68:P,69:G,70:V,71:H,72:W,73:ie,74:j},{12:[1,118],33:[1,117]},{35:119,75:81,76:Q,77:re,79:le,80:fe},{35:120,75:81,76:Q,77:re,79:le,80:fe},{35:121,75:81,76:Q,77:re,79:le,80:fe},{35:122,75:81,76:Q,77:re,79:le,80:fe},{35:123,75:81,76:Q,77:re,79:le,80:fe},{35:124,75:81,76:Q,77:re,79:le,80:fe},{35:125,75:81,76:Q,77:re,79:le,80:fe},{14:[1,126]},{14:[1,127]},{14:[1,128]},{14:[1,129]},{1:[2,8]},t(ae,[2,15]),t(J,[2,17],{21:22,19:130,22:e,23:r,24:n,26:i,28:a}),t(ae,[2,37],{19:20,20:21,21:22,43:23,29:49,30:61,32:62,13:131,22:e,23:r,24:n,26:i,28:a,34:s,36:o,37:l,38:u,39:h,40:d,41:f,44:p,45:g,46:m,47:y,48:v,49:x,50:b,51:w,52:C,53:_,54:k,55:S,56:L,57:$,58:I,59:z,60:F,61:A,62:R,63:N,64:M,65:D,66:O,67:B,68:P,69:G,70:V,71:H,72:W,73:ie,74:j}),t(K,[2,21]),t(K,[2,22]),t(Ae,[2,39]),t(Se,[2,71],{75:81,35:132,76:Q,77:re,79:le,80:fe}),t(Ne,[2,73]),{78:[1,133]},t(Ne,[2,75]),t(Ne,[2,76]),t(Ae,[2,40]),t(Ae,[2,41]),t(Ae,[2,42]),t(Ae,[2,43]),t(Ae,[2,44]),t(Ae,[2,45]),t(Ae,[2,46]),t(Ae,[2,47]),t(Ae,[2,48]),t(Ae,[2,49]),t(Ae,[2,50]),t(Ae,[2,51]),t(Ae,[2,52]),t(Ae,[2,53]),t(Ae,[2,54]),t(Ae,[2,55]),t(Ae,[2,56]),t(Ae,[2,57]),t(Ae,[2,58]),t(Ae,[2,60]),t(Ae,[2,61]),t(Ae,[2,62]),t(Ae,[2,63]),t(Ae,[2,64]),t(Ae,[2,65]),t(Ae,[2,66]),t(Ae,[2,67]),t(Ae,[2,68]),t(Ae,[2,69]),t(Ae,[2,70]),{31:134,42:[1,135]},{12:[1,136]},{33:[1,137]},t(ge,[2,28]),t(ge,[2,29]),t(ge,[2,30]),t(ge,[2,31]),t(ge,[2,32]),t(ge,[2,33]),t(ge,[2,34]),{1:[2,9]},{1:[2,10]},{1:[2,11]},{1:[2,12]},t(J,[2,18]),t(ae,[2,38]),t(Se,[2,72]),t(Ne,[2,74]),t(Ae,[2,24]),t(Ae,[2,35]),t(ve,[2,25]),t(ve,[2,26],{12:[1,138]}),t(ve,[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:T(function(Ve,Qe){if(Qe.recoverable)this.trace(Ve);else{var nt=new Error(Ve);throw nt.hash=Qe,nt}},"parseError"),parse:T(function(Ve){var Qe=this,nt=[0],tt=[],Ze=[null],ke=[],_e=this.table,Y="",he=0,Z=0,pe=2,ne=1,Be=ke.slice.call(arguments,1),Te=Object.create(this.lexer),Ue={yy:{}};for(var De in this.yy)Object.prototype.hasOwnProperty.call(this.yy,De)&&(Ue.yy[De]=this.yy[De]);Te.setInput(Ve,Ue.yy),Ue.yy.lexer=Te,Ue.yy.parser=this,typeof Te.yylloc>"u"&&(Te.yylloc={});var qe=Te.yylloc;ke.push(qe);var Le=Te.options&&Te.options.ranges;typeof Ue.yy.parseError=="function"?this.parseError=Ue.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Xe(oe){nt.length=nt.length-2*oe,Ze.length=Ze.length-oe,ke.length=ke.length-oe}T(Xe,"popStack");function Ie(){var oe;return oe=tt.pop()||Te.lex()||ne,typeof oe!="number"&&(oe instanceof Array&&(tt=oe,oe=tt.pop()),oe=Qe.symbols_[oe]||oe),oe}T(Ie,"lex");for(var it,we,ct,be,_t={},bt,lt,Mt,Tt;;){if(we=nt[nt.length-1],this.defaultActions[we]?ct=this.defaultActions[we]:((it===null||typeof it>"u")&&(it=Ie()),ct=_e[we]&&_e[we][it]),typeof ct>"u"||!ct.length||!ct[0]){var dt="";Tt=[];for(bt in _e[we])this.terminals_[bt]&&bt>pe&&Tt.push("'"+this.terminals_[bt]+"'");Te.showPosition?dt="Parse error on line "+(he+1)+`: +`+Te.showPosition()+` +Expecting `+Tt.join(", ")+", got '"+(this.terminals_[it]||it)+"'":dt="Parse error on line "+(he+1)+": Unexpected "+(it==ne?"end of input":"'"+(this.terminals_[it]||it)+"'"),this.parseError(dt,{text:Te.match,token:this.terminals_[it]||it,line:Te.yylineno,loc:qe,expected:Tt})}if(ct[0]instanceof Array&&ct.length>1)throw new Error("Parse Error: multiple actions possible at state: "+we+", token: "+it);switch(ct[0]){case 1:nt.push(it),Ze.push(Te.yytext),ke.push(Te.yylloc),nt.push(ct[1]),it=null,Z=Te.yyleng,Y=Te.yytext,he=Te.yylineno,qe=Te.yylloc;break;case 2:if(lt=this.productions_[ct[1]][1],_t.$=Ze[Ze.length-lt],_t._$={first_line:ke[ke.length-(lt||1)].first_line,last_line:ke[ke.length-1].last_line,first_column:ke[ke.length-(lt||1)].first_column,last_column:ke[ke.length-1].last_column},Le&&(_t._$.range=[ke[ke.length-(lt||1)].range[0],ke[ke.length-1].range[1]]),be=this.performAction.apply(_t,[Y,Z,he,Ue.yy,ct[1],Ze,ke].concat(Be)),typeof be<"u")return be;lt&&(nt=nt.slice(0,-1*lt*2),Ze=Ze.slice(0,-1*lt),ke=ke.slice(0,-1*lt)),nt.push(this.productions_[ct[1]][0]),Ze.push(_t.$),ke.push(_t._$),Mt=_e[nt[nt.length-2]][nt[nt.length-1]],nt.push(Mt);break;case 3:return!0}}return!0},"parse")},xe=(function(){var Ce={EOF:1,parseError:T(function(Qe,nt){if(this.yy.parser)this.yy.parser.parseError(Qe,nt);else throw new Error(Qe)},"parseError"),setInput:T(function(Ve,Qe){return this.yy=Qe||this.yy||{},this._input=Ve,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:T(function(){var Ve=this._input[0];this.yytext+=Ve,this.yyleng++,this.offset++,this.match+=Ve,this.matched+=Ve;var Qe=Ve.match(/(?:\r\n?|\n).*/g);return Qe?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),Ve},"input"),unput:T(function(Ve){var Qe=Ve.length,nt=Ve.split(/(?:\r\n?|\n)/g);this._input=Ve+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-Qe),this.offset-=Qe;var tt=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),nt.length-1&&(this.yylineno-=nt.length-1);var Ze=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:nt?(nt.length===tt.length?this.yylloc.first_column:0)+tt[tt.length-nt.length].length-nt[0].length:this.yylloc.first_column-Qe},this.options.ranges&&(this.yylloc.range=[Ze[0],Ze[0]+this.yyleng-Qe]),this.yyleng=this.yytext.length,this},"unput"),more:T(function(){return this._more=!0,this},"more"),reject:T(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). +`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:T(function(Ve){this.unput(this.match.slice(Ve))},"less"),pastInput:T(function(){var Ve=this.matched.substr(0,this.matched.length-this.match.length);return(Ve.length>20?"...":"")+Ve.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:T(function(){var Ve=this.match;return Ve.length<20&&(Ve+=this._input.substr(0,20-Ve.length)),(Ve.substr(0,20)+(Ve.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:T(function(){var Ve=this.pastInput(),Qe=new Array(Ve.length+1).join("-");return Ve+this.upcomingInput()+` +`+Qe+"^"},"showPosition"),test_match:T(function(Ve,Qe){var nt,tt,Ze;if(this.options.backtrack_lexer&&(Ze={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(Ze.yylloc.range=this.yylloc.range.slice(0))),tt=Ve[0].match(/(?:\r\n?|\n).*/g),tt&&(this.yylineno+=tt.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:tt?tt[tt.length-1].length-tt[tt.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+Ve[0].length},this.yytext+=Ve[0],this.match+=Ve[0],this.matches=Ve,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(Ve[0].length),this.matched+=Ve[0],nt=this.performAction.call(this,this.yy,this,Qe,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),nt)return nt;if(this._backtrack){for(var ke in Ze)this[ke]=Ze[ke];return!1}return!1},"test_match"),next:T(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var Ve,Qe,nt,tt;this._more||(this.yytext="",this.match="");for(var Ze=this._currentRules(),ke=0;keQe[0].length)){if(Qe=nt,tt=ke,this.options.backtrack_lexer){if(Ve=this.test_match(nt,Ze[ke]),Ve!==!1)return Ve;if(this._backtrack){Qe=!1;continue}else return!1}else if(!this.options.flex)break}return Qe?(Ve=this.test_match(Qe,Ze[tt]),Ve!==!1?Ve:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:T(function(){var Qe=this.next();return Qe||this.lex()},"lex"),begin:T(function(Qe){this.conditionStack.push(Qe)},"begin"),popState:T(function(){var Qe=this.conditionStack.length-1;return Qe>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:T(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:T(function(Qe){return Qe=this.conditionStack.length-1-Math.abs(Qe||0),Qe>=0?this.conditionStack[Qe]:"INITIAL"},"topState"),pushState:T(function(Qe){this.begin(Qe)},"pushState"),stateStackSize:T(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:T(function(Qe,nt,tt,Ze){switch(tt){case 0:return 6;case 1:return 7;case 2:return 8;case 3:return 9;case 4:return 22;case 5:return 23;case 6:return this.begin("acc_title"),24;case 7:return this.popState(),"acc_title_value";case 8:return this.begin("acc_descr"),26;case 9:return this.popState(),"acc_descr_value";case 10:this.begin("acc_descr_multiline");break;case 11:this.popState();break;case 12:return"acc_descr_multiline_value";case 13:break;case 14:c;break;case 15:return 12;case 16:break;case 17:return 11;case 18:return 15;case 19:return 16;case 20:return 17;case 21:return 18;case 22:return this.begin("person_ext"),45;case 23:return this.begin("person"),44;case 24:return this.begin("system_ext_queue"),51;case 25:return this.begin("system_ext_db"),50;case 26:return this.begin("system_ext"),49;case 27:return this.begin("system_queue"),48;case 28:return this.begin("system_db"),47;case 29:return this.begin("system"),46;case 30:return this.begin("boundary"),37;case 31:return this.begin("enterprise_boundary"),34;case 32:return this.begin("system_boundary"),36;case 33:return this.begin("container_ext_queue"),57;case 34:return this.begin("container_ext_db"),56;case 35:return this.begin("container_ext"),55;case 36:return this.begin("container_queue"),54;case 37:return this.begin("container_db"),53;case 38:return this.begin("container"),52;case 39:return this.begin("container_boundary"),38;case 40:return this.begin("component_ext_queue"),63;case 41:return this.begin("component_ext_db"),62;case 42:return this.begin("component_ext"),61;case 43:return this.begin("component_queue"),60;case 44:return this.begin("component_db"),59;case 45:return this.begin("component"),58;case 46:return this.begin("node"),39;case 47:return this.begin("node"),39;case 48:return this.begin("node_l"),40;case 49:return this.begin("node_r"),41;case 50:return this.begin("rel"),64;case 51:return this.begin("birel"),65;case 52:return this.begin("rel_u"),66;case 53:return this.begin("rel_u"),66;case 54:return this.begin("rel_d"),67;case 55:return this.begin("rel_d"),67;case 56:return this.begin("rel_l"),68;case 57:return this.begin("rel_l"),68;case 58:return this.begin("rel_r"),69;case 59:return this.begin("rel_r"),69;case 60:return this.begin("rel_b"),70;case 61:return this.begin("rel_index"),71;case 62:return this.begin("update_el_style"),72;case 63:return this.begin("update_rel_style"),73;case 64:return this.begin("update_layout_config"),74;case 65:return"EOF_IN_STRUCT";case 66:return this.begin("attribute"),"ATTRIBUTE_EMPTY";case 67:this.begin("attribute");break;case 68:this.popState(),this.popState();break;case 69:return 80;case 70:break;case 71:return 80;case 72:this.begin("string");break;case 73:this.popState();break;case 74:return"STR";case 75:this.begin("string_kv");break;case 76:return this.begin("string_kv_key"),"STR_KEY";case 77:this.popState(),this.begin("string_kv_value");break;case 78:return"STR_VALUE";case 79:this.popState(),this.popState();break;case 80:return"STR";case 81:return"LBRACE";case 82:return"RBRACE";case 83:return"SPACE";case 84:return"EOL";case 85:return 14}},"anonymous"),rules:[/^(?:.*direction\s+TB[^\n]*)/,/^(?:.*direction\s+BT[^\n]*)/,/^(?:.*direction\s+RL[^\n]*)/,/^(?:.*direction\s+LR[^\n]*)/,/^(?:title\s[^#\n;]+)/,/^(?:accDescription\s[^#\n;]+)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:%%(?!\{)*[^\n]*(\r?\n?)+)/,/^(?:%%[^\n]*(\r?\n)*)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:C4Context\b)/,/^(?:C4Container\b)/,/^(?:C4Component\b)/,/^(?:C4Dynamic\b)/,/^(?:C4Deployment\b)/,/^(?:Person_Ext\b)/,/^(?:Person\b)/,/^(?:SystemQueue_Ext\b)/,/^(?:SystemDb_Ext\b)/,/^(?:System_Ext\b)/,/^(?:SystemQueue\b)/,/^(?:SystemDb\b)/,/^(?:System\b)/,/^(?:Boundary\b)/,/^(?:Enterprise_Boundary\b)/,/^(?:System_Boundary\b)/,/^(?:ContainerQueue_Ext\b)/,/^(?:ContainerDb_Ext\b)/,/^(?:Container_Ext\b)/,/^(?:ContainerQueue\b)/,/^(?:ContainerDb\b)/,/^(?:Container\b)/,/^(?:Container_Boundary\b)/,/^(?:ComponentQueue_Ext\b)/,/^(?:ComponentDb_Ext\b)/,/^(?:Component_Ext\b)/,/^(?:ComponentQueue\b)/,/^(?:ComponentDb\b)/,/^(?:Component\b)/,/^(?:Deployment_Node\b)/,/^(?:Node\b)/,/^(?:Node_L\b)/,/^(?:Node_R\b)/,/^(?:Rel\b)/,/^(?:BiRel\b)/,/^(?:Rel_Up\b)/,/^(?:Rel_U\b)/,/^(?:Rel_Down\b)/,/^(?:Rel_D\b)/,/^(?:Rel_Left\b)/,/^(?:Rel_L\b)/,/^(?:Rel_Right\b)/,/^(?:Rel_R\b)/,/^(?:Rel_Back\b)/,/^(?:RelIndex\b)/,/^(?:UpdateElementStyle\b)/,/^(?:UpdateRelStyle\b)/,/^(?:UpdateLayoutConfig\b)/,/^(?:$)/,/^(?:[(][ ]*[,])/,/^(?:[(])/,/^(?:[)])/,/^(?:,,)/,/^(?:,)/,/^(?:[ ]*["]["])/,/^(?:[ ]*["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:[ ]*[\$])/,/^(?:[^=]*)/,/^(?:[=][ ]*["])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:[^,]+)/,/^(?:\{)/,/^(?:\})/,/^(?:[\s]+)/,/^(?:[\n\r]+)/,/^(?:$)/],conditions:{acc_descr_multiline:{rules:[11,12],inclusive:!1},acc_descr:{rules:[9],inclusive:!1},acc_title:{rules:[7],inclusive:!1},string_kv_value:{rules:[78,79],inclusive:!1},string_kv_key:{rules:[77],inclusive:!1},string_kv:{rules:[76],inclusive:!1},string:{rules:[73,74],inclusive:!1},attribute:{rules:[68,69,70,71,72,75,80],inclusive:!1},update_layout_config:{rules:[65,66,67,68],inclusive:!1},update_rel_style:{rules:[65,66,67,68],inclusive:!1},update_el_style:{rules:[65,66,67,68],inclusive:!1},rel_b:{rules:[65,66,67,68],inclusive:!1},rel_r:{rules:[65,66,67,68],inclusive:!1},rel_l:{rules:[65,66,67,68],inclusive:!1},rel_d:{rules:[65,66,67,68],inclusive:!1},rel_u:{rules:[65,66,67,68],inclusive:!1},rel_bi:{rules:[],inclusive:!1},rel:{rules:[65,66,67,68],inclusive:!1},node_r:{rules:[65,66,67,68],inclusive:!1},node_l:{rules:[65,66,67,68],inclusive:!1},node:{rules:[65,66,67,68],inclusive:!1},index:{rules:[],inclusive:!1},rel_index:{rules:[65,66,67,68],inclusive:!1},component_ext_queue:{rules:[65,66,67,68],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 Ce})();ze.lexer=xe;function Ke(){this.yy={}}return T(Ke,"Parser"),Ke.prototype=ze,ze.Parser=Ke,new Ke})();fS.parser=fS;var BJe=fS,Sl=[],fd=[""],Rs="global",_l="",_c=[{alias:"global",label:{text:"global"},type:{text:"global"},tags:null,link:null,parentBoundary:""}],bw=[],GN="",qN=!1,pS=4,gS=2,Ble,FJe=T(function(){return Ble},"getC4Type"),zJe=T(function(t){Ble=Zr(t,Pe())},"setC4Type"),GJe=T(function(t,e,r,n,i,a,s,o,l){if(t==null||e===void 0||e===null||r===void 0||r===null||n===void 0||n===null)return;let u={};const h=bw.find(d=>d.from===e&&d.to===r);if(h?u=h:bw.push(u),u.type=t,u.from=e,u.to=r,u.label={text:n},i==null)u.techn={text:""};else if(typeof i=="object"){let[d,f]=Object.entries(i)[0];u[d]={text:f}}else u.techn={text:i};if(a==null)u.descr={text:""};else if(typeof a=="object"){let[d,f]=Object.entries(a)[0];u[d]={text:f}}else u.descr={text:a};if(typeof s=="object"){let[d,f]=Object.entries(s)[0];u[d]=f}else u.sprite=s;if(typeof o=="object"){let[d,f]=Object.entries(o)[0];u[d]=f}else u.tags=o;if(typeof l=="object"){let[d,f]=Object.entries(l)[0];u[d]=f}else u.link=l;u.wrap=pd()},"addRel"),qJe=T(function(t,e,r,n,i,a,s){if(e===null||r===null)return;let o={};const l=Sl.find(u=>u.alias===e);if(l&&e===l.alias?o=l:(o.alias=e,Sl.push(o)),r==null?o.label={text:""}:o.label={text:r},n==null)o.descr={text:""};else if(typeof n=="object"){let[u,h]=Object.entries(n)[0];o[u]={text:h}}else o.descr={text:n};if(typeof i=="object"){let[u,h]=Object.entries(i)[0];o[u]=h}else o.sprite=i;if(typeof a=="object"){let[u,h]=Object.entries(a)[0];o[u]=h}else o.tags=a;if(typeof s=="object"){let[u,h]=Object.entries(s)[0];o[u]=h}else o.link=s;o.typeC4Shape={text:t},o.parentBoundary=Rs,o.wrap=pd()},"addPersonOrSystem"),VJe=T(function(t,e,r,n,i,a,s,o){if(e===null||r===null)return;let l={};const u=Sl.find(h=>h.alias===e);if(u&&e===u.alias?l=u:(l.alias=e,Sl.push(l)),r==null?l.label={text:""}:l.label={text:r},n==null)l.techn={text:""};else if(typeof n=="object"){let[h,d]=Object.entries(n)[0];l[h]={text:d}}else l.techn={text:n};if(i==null)l.descr={text:""};else if(typeof i=="object"){let[h,d]=Object.entries(i)[0];l[h]={text:d}}else l.descr={text:i};if(typeof a=="object"){let[h,d]=Object.entries(a)[0];l[h]=d}else l.sprite=a;if(typeof s=="object"){let[h,d]=Object.entries(s)[0];l[h]=d}else l.tags=s;if(typeof o=="object"){let[h,d]=Object.entries(o)[0];l[h]=d}else l.link=o;l.wrap=pd(),l.typeC4Shape={text:t},l.parentBoundary=Rs},"addContainer"),WJe=T(function(t,e,r,n,i,a,s,o){if(e===null||r===null)return;let l={};const u=Sl.find(h=>h.alias===e);if(u&&e===u.alias?l=u:(l.alias=e,Sl.push(l)),r==null?l.label={text:""}:l.label={text:r},n==null)l.techn={text:""};else if(typeof n=="object"){let[h,d]=Object.entries(n)[0];l[h]={text:d}}else l.techn={text:n};if(i==null)l.descr={text:""};else if(typeof i=="object"){let[h,d]=Object.entries(i)[0];l[h]={text:d}}else l.descr={text:i};if(typeof a=="object"){let[h,d]=Object.entries(a)[0];l[h]=d}else l.sprite=a;if(typeof s=="object"){let[h,d]=Object.entries(s)[0];l[h]=d}else l.tags=s;if(typeof o=="object"){let[h,d]=Object.entries(o)[0];l[h]=d}else l.link=o;l.wrap=pd(),l.typeC4Shape={text:t},l.parentBoundary=Rs},"addComponent"),UJe=T(function(t,e,r,n,i){if(t===null||e===null)return;let a={};const s=_c.find(o=>o.alias===t);if(s&&t===s.alias?a=s:(a.alias=t,_c.push(a)),e==null?a.label={text:""}:a.label={text:e},r==null)a.type={text:"system"};else if(typeof r=="object"){let[o,l]=Object.entries(r)[0];a[o]={text:l}}else a.type={text:r};if(typeof n=="object"){let[o,l]=Object.entries(n)[0];a[o]=l}else a.tags=n;if(typeof i=="object"){let[o,l]=Object.entries(i)[0];a[o]=l}else a.link=i;a.parentBoundary=Rs,a.wrap=pd(),_l=Rs,Rs=t,fd.push(_l)},"addPersonOrSystemBoundary"),HJe=T(function(t,e,r,n,i){if(t===null||e===null)return;let a={};const s=_c.find(o=>o.alias===t);if(s&&t===s.alias?a=s:(a.alias=t,_c.push(a)),e==null?a.label={text:""}:a.label={text:e},r==null)a.type={text:"container"};else if(typeof r=="object"){let[o,l]=Object.entries(r)[0];a[o]={text:l}}else a.type={text:r};if(typeof n=="object"){let[o,l]=Object.entries(n)[0];a[o]=l}else a.tags=n;if(typeof i=="object"){let[o,l]=Object.entries(i)[0];a[o]=l}else a.link=i;a.parentBoundary=Rs,a.wrap=pd(),_l=Rs,Rs=t,fd.push(_l)},"addContainerBoundary"),YJe=T(function(t,e,r,n,i,a,s,o){if(e===null||r===null)return;let l={};const u=_c.find(h=>h.alias===e);if(u&&e===u.alias?l=u:(l.alias=e,_c.push(l)),r==null?l.label={text:""}:l.label={text:r},n==null)l.type={text:"node"};else if(typeof n=="object"){let[h,d]=Object.entries(n)[0];l[h]={text:d}}else l.type={text:n};if(i==null)l.descr={text:""};else if(typeof i=="object"){let[h,d]=Object.entries(i)[0];l[h]={text:d}}else l.descr={text:i};if(typeof s=="object"){let[h,d]=Object.entries(s)[0];l[h]=d}else l.tags=s;if(typeof o=="object"){let[h,d]=Object.entries(o)[0];l[h]=d}else l.link=o;l.nodeType=t,l.parentBoundary=Rs,l.wrap=pd(),_l=Rs,Rs=e,fd.push(_l)},"addDeploymentNode"),XJe=T(function(){Rs=_l,fd.pop(),_l=fd.pop(),fd.push(_l)},"popBoundaryParseStack"),jJe=T(function(t,e,r,n,i,a,s,o,l,u,h){let d=Sl.find(f=>f.alias===e);if(!(d===void 0&&(d=_c.find(f=>f.alias===e),d===void 0))){if(r!=null)if(typeof r=="object"){let[f,p]=Object.entries(r)[0];d[f]=p}else d.bgColor=r;if(n!=null)if(typeof n=="object"){let[f,p]=Object.entries(n)[0];d[f]=p}else d.fontColor=n;if(i!=null)if(typeof i=="object"){let[f,p]=Object.entries(i)[0];d[f]=p}else d.borderColor=i;if(a!=null)if(typeof a=="object"){let[f,p]=Object.entries(a)[0];d[f]=p}else d.shadowing=a;if(s!=null)if(typeof s=="object"){let[f,p]=Object.entries(s)[0];d[f]=p}else d.shape=s;if(o!=null)if(typeof o=="object"){let[f,p]=Object.entries(o)[0];d[f]=p}else d.sprite=o;if(l!=null)if(typeof l=="object"){let[f,p]=Object.entries(l)[0];d[f]=p}else d.techn=l;if(u!=null)if(typeof u=="object"){let[f,p]=Object.entries(u)[0];d[f]=p}else d.legendText=u;if(h!=null)if(typeof h=="object"){let[f,p]=Object.entries(h)[0];d[f]=p}else d.legendSprite=h}},"updateElStyle"),KJe=T(function(t,e,r,n,i,a,s){const o=bw.find(l=>l.from===e&&l.to===r);if(o!==void 0){if(n!=null)if(typeof n=="object"){let[l,u]=Object.entries(n)[0];o[l]=u}else o.textColor=n;if(i!=null)if(typeof i=="object"){let[l,u]=Object.entries(i)[0];o[l]=u}else o.lineColor=i;if(a!=null)if(typeof a=="object"){let[l,u]=Object.entries(a)[0];o[l]=parseInt(u)}else o.offsetX=parseInt(a);if(s!=null)if(typeof s=="object"){let[l,u]=Object.entries(s)[0];o[l]=parseInt(u)}else o.offsetY=parseInt(s)}},"updateRelStyle"),ZJe=T(function(t,e,r){let n=pS,i=gS;if(typeof e=="object"){const a=Object.values(e)[0];n=parseInt(a)}else n=parseInt(e);if(typeof r=="object"){const a=Object.values(r)[0];i=parseInt(a)}else i=parseInt(r);n>=1&&(pS=n),i>=1&&(gS=i)},"updateLayoutConfig"),QJe=T(function(){return pS},"getC4ShapeInRow"),JJe=T(function(){return gS},"getC4BoundaryInRow"),eet=T(function(){return Rs},"getCurrentBoundaryParse"),tet=T(function(){return _l},"getParentBoundaryParse"),Fle=T(function(t){return t==null?Sl:Sl.filter(e=>e.parentBoundary===t)},"getC4ShapeArray"),ret=T(function(t){return Sl.find(e=>e.alias===t)},"getC4Shape"),net=T(function(t){return Object.keys(Fle(t))},"getC4ShapeKeys"),zle=T(function(t){return t==null?_c:_c.filter(e=>e.parentBoundary===t)},"getBoundaries"),iet=zle,aet=T(function(){return bw},"getRels"),set=T(function(){return GN},"getTitle"),oet=T(function(t){qN=t},"setWrap"),pd=T(function(){return qN},"autoWrap"),cet=T(function(){Sl=[],_c=[{alias:"global",label:{text:"global"},type:{text:"global"},tags:null,link:null,parentBoundary:""}],_l="",Rs="global",fd=[""],bw=[],fd=[""],GN="",qN=!1,pS=4,gS=2},"clear"),uet={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},het={FILLED:0,OPEN:1},det={LEFTOF:0,RIGHTOF:1,OVER:2},fet=T(function(t){GN=Zr(t,Pe())},"setTitle"),VN={addPersonOrSystem:qJe,addPersonOrSystemBoundary:UJe,addContainer:VJe,addContainerBoundary:HJe,addComponent:WJe,addDeploymentNode:YJe,popBoundaryParseStack:XJe,addRel:GJe,updateElStyle:jJe,updateRelStyle:KJe,updateLayoutConfig:ZJe,autoWrap:pd,setWrap:oet,getC4ShapeArray:Fle,getC4Shape:ret,getC4ShapeKeys:net,getBoundaries:zle,getBoundarys:iet,getCurrentBoundaryParse:eet,getParentBoundaryParse:tet,getRels:aet,getTitle:set,getC4Type:FJe,getC4ShapeInRow:QJe,getC4BoundaryInRow:JJe,setAccTitle:Yn,getAccTitle:ii,getAccDescription:si,setAccDescription:ai,getConfig:T(()=>Pe().c4,"getConfig"),clear:cet,LINETYPE:uet,ARROWTYPE:het,PLACEMENT:det,setTitle:fet,setC4Type:zJe},WN=T(function(t,e){return dS(t,e)},"drawRect"),Gle=T(function(t,e,r,n,i,a){const s=t.append("image");s.attr("width",e),s.attr("height",r),s.attr("x",n),s.attr("y",i);let o=a.startsWith("data:image/png;base64")?a:df.sanitizeUrl(a);s.attr("xlink:href",o)},"drawImage"),pet=T((t,e,r,n)=>{const i=t.append("g");let a=0;for(let s of e){let o=s.textColor?s.textColor:"#444444",l=s.lineColor?s.lineColor:"#444444",u=s.offsetX?parseInt(s.offsetX):0,h=s.offsetY?parseInt(s.offsetY):0,d="";if(a===0){let p=i.append("line");p.attr("x1",s.startPoint.x),p.attr("y1",s.startPoint.y),p.attr("x2",s.endPoint.x),p.attr("y2",s.endPoint.y),p.attr("stroke-width","1"),p.attr("stroke",l),p.style("fill","none"),s.type!=="rel_b"&&p.attr("marker-end","url("+d+"#"+n+"-arrowhead)"),(s.type==="birel"||s.type==="rel_b")&&p.attr("marker-start","url("+d+"#"+n+"-arrowend)"),a=-1}else{let p=i.append("path");p.attr("fill","none").attr("stroke-width","1").attr("stroke",l).attr("d","Mstartx,starty Qcontrolx,controly stopx,stopy ".replaceAll("startx",s.startPoint.x).replaceAll("starty",s.startPoint.y).replaceAll("controlx",s.startPoint.x+(s.endPoint.x-s.startPoint.x)/2-(s.endPoint.x-s.startPoint.x)/4).replaceAll("controly",s.startPoint.y+(s.endPoint.y-s.startPoint.y)/2).replaceAll("stopx",s.endPoint.x).replaceAll("stopy",s.endPoint.y)),s.type!=="rel_b"&&p.attr("marker-end","url("+d+"#"+n+"-arrowhead)"),(s.type==="birel"||s.type==="rel_b")&&p.attr("marker-start","url("+d+"#"+n+"-arrowend)")}let f=r.messageFont();Gu(r)(s.label.text,i,Math.min(s.startPoint.x,s.endPoint.x)+Math.abs(s.endPoint.x-s.startPoint.x)/2+u,Math.min(s.startPoint.y,s.endPoint.y)+Math.abs(s.endPoint.y-s.startPoint.y)/2+h,s.label.width,s.label.height,{fill:o},f),s.techn&&s.techn.text!==""&&(f=r.messageFont(),Gu(r)("["+s.techn.text+"]",i,Math.min(s.startPoint.x,s.endPoint.x)+Math.abs(s.endPoint.x-s.startPoint.x)/2+u,Math.min(s.startPoint.y,s.endPoint.y)+Math.abs(s.endPoint.y-s.startPoint.y)/2+r.messageFontSize+5+h,Math.max(s.label.width,s.techn.width),s.techn.height,{fill:o,"font-style":"italic"},f))}},"drawRels"),get=T(function(t,e,r){const n=t.append("g");let i=e.bgColor?e.bgColor:"none",a=e.borderColor?e.borderColor:"#444444",s=e.fontColor?e.fontColor:"black",o={"stroke-width":1,"stroke-dasharray":"7.0,7.0"};e.nodeType&&(o={"stroke-width":1});let l={x:e.x,y:e.y,fill:i,stroke:a,width:e.width,height:e.height,rx:2.5,ry:2.5,attrs:o};WN(n,l);let u=r.boundaryFont();u.fontWeight="bold",u.fontSize=u.fontSize+2,u.fontColor=s,Gu(r)(e.label.text,n,e.x,e.y+e.label.Y,e.width,e.height,{fill:"#444444"},u),e.type&&e.type.text!==""&&(u=r.boundaryFont(),u.fontColor=s,Gu(r)(e.type.text,n,e.x,e.y+e.type.Y,e.width,e.height,{fill:"#444444"},u)),e.descr&&e.descr.text!==""&&(u=r.boundaryFont(),u.fontSize=u.fontSize-2,u.fontColor=s,Gu(r)(e.descr.text,n,e.x,e.y+e.descr.Y,e.width,e.height,{fill:"#444444"},u))},"drawBoundary"),met=T(function(t,e,r){var d;let n=e.bgColor?e.bgColor:r[e.typeC4Shape.text+"_bg_color"],i=e.borderColor?e.borderColor:r[e.typeC4Shape.text+"_border_color"],a=e.fontColor?e.fontColor:"#FFFFFF",s="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAACD0lEQVR4Xu2YoU4EMRCGT+4j8Ai8AhaH4QHgAUjQuFMECUgMIUgwJAgMhgQsAYUiJCiQIBBY+EITsjfTdme6V24v4c8vyGbb+ZjOtN0bNcvjQXmkH83WvYBWto6PLm6v7p7uH1/w2fXD+PBycX1Pv2l3IdDm/vn7x+dXQiAubRzoURa7gRZWd0iGRIiJbOnhnfYBQZNJjNbuyY2eJG8fkDE3bbG4ep6MHUAsgYxmE3nVs6VsBWJSGccsOlFPmLIViMzLOB7pCVO2AtHJMohH7Fh6zqitQK7m0rJvAVYgGcEpe//PLdDz65sM4pF9N7ICcXDKIB5Nv6j7tD0NoSdM2QrU9Gg0ewE1LqBhHR3BBdvj2vapnidjHxD/q6vd7Pvhr31AwcY8eXMTXAKECZZJFXuEq27aLgQK5uLMohCenGGuGewOxSjBvYBqeG6B+Nqiblggdjnc+ZXDy+FNFpFzw76O3UBAROuXh6FoiAcf5g9eTvUgzy0nWg6I8cXHRUpg5bOVBCo+KDpFajOf23GgPme7RSQ+lacIENUgJ6gg1k6HjgOlqnLqip4tEuhv0hNEMXUD0clyXE3p6pZA0S2nnvTlXwLJEZWlb7cTQH1+USgTN4VhAenm/wea1OCAOmqo6fE1WCb9WSKBah+rbUWPWAmE2Rvk0ApiB45eOyNAzU8xcTvj8KvkKEoOaIYeHNA3ZuygAvFMUO0AAAAASUVORK5CYII=";switch(e.typeC4Shape.text){case"person":s="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAACD0lEQVR4Xu2YoU4EMRCGT+4j8Ai8AhaH4QHgAUjQuFMECUgMIUgwJAgMhgQsAYUiJCiQIBBY+EITsjfTdme6V24v4c8vyGbb+ZjOtN0bNcvjQXmkH83WvYBWto6PLm6v7p7uH1/w2fXD+PBycX1Pv2l3IdDm/vn7x+dXQiAubRzoURa7gRZWd0iGRIiJbOnhnfYBQZNJjNbuyY2eJG8fkDE3bbG4ep6MHUAsgYxmE3nVs6VsBWJSGccsOlFPmLIViMzLOB7pCVO2AtHJMohH7Fh6zqitQK7m0rJvAVYgGcEpe//PLdDz65sM4pF9N7ICcXDKIB5Nv6j7tD0NoSdM2QrU9Gg0ewE1LqBhHR3BBdvj2vapnidjHxD/q6vd7Pvhr31AwcY8eXMTXAKECZZJFXuEq27aLgQK5uLMohCenGGuGewOxSjBvYBqeG6B+Nqiblggdjnc+ZXDy+FNFpFzw76O3UBAROuXh6FoiAcf5g9eTvUgzy0nWg6I8cXHRUpg5bOVBCo+KDpFajOf23GgPme7RSQ+lacIENUgJ6gg1k6HjgOlqnLqip4tEuhv0hNEMXUD0clyXE3p6pZA0S2nnvTlXwLJEZWlb7cTQH1+USgTN4VhAenm/wea1OCAOmqo6fE1WCb9WSKBah+rbUWPWAmE2Rvk0ApiB45eOyNAzU8xcTvj8KvkKEoOaIYeHNA3ZuygAvFMUO0AAAAASUVORK5CYII=";break;case"external_person":s="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAAB6ElEQVR4Xu2YLY+EMBCG9+dWr0aj0Wg0Go1Go0+j8Xdv2uTCvv1gpt0ebHKPuhDaeW4605Z9mJvx4AdXUyTUdd08z+u6flmWZRnHsWkafk9DptAwDPu+f0eAYtu2PEaGWuj5fCIZrBAC2eLBAnRCsEkkxmeaJp7iDJ2QMDdHsLg8SxKFEJaAo8lAXnmuOFIhTMpxxKATebo4UiFknuNo4OniSIXQyRxEA3YsnjGCVEjVXD7yLUAqxBGUyPv/Y4W2beMgGuS7kVQIBycH0fD+oi5pezQETxdHKmQKGk1eQEYldK+jw5GxPfZ9z7Mk0Qnhf1W1m3w//EUn5BDmSZsbR44QQLBEqrBHqOrmSKaQAxdnLArCrxZcM7A7ZKs4ioRq8LFC+NpC3WCBJsvpVw5edm9iEXFuyNfxXAgSwfrFQ1c0iNda8AdejvUgnktOtJQQxmcfFzGglc5WVCj7oDgFqU18boeFSs52CUh8LE8BIVQDT1ABrB0HtgSEYlX5doJnCwv9TXocKCaKbnwhdDKPq4lf3SwU3HLq4V/+WYhHVMa/3b4IlfyikAduCkcBc7mQ3/z/Qq/cTuikhkzB12Ae/mcJC9U+Vo8Ej1gWAtgbeGgFsAMHr50BIWOLCbezvhpBFUdY6EJuJ/QDW0XoMX60zZ0AAAAASUVORK5CYII=";break}const o=t.append("g");o.attr("class","person-man");const l=Ro();switch(e.typeC4Shape.text){case"person":case"external_person":case"system":case"external_system":case"container":case"external_container":case"component":case"external_component":l.x=e.x,l.y=e.y,l.fill=n,l.width=e.width,l.height=e.height,l.stroke=i,l.rx=2.5,l.ry=2.5,l.attrs={"stroke-width":.5},WN(o,l);break;case"system_db":case"external_system_db":case"container_db":case"external_container_db":case"component_db":case"external_component_db":o.append("path").attr("fill",n).attr("stroke-width","0.5").attr("stroke",i).attr("d","Mstartx,startyc0,-10 half,-10 half,-10c0,0 half,0 half,10l0,heightc0,10 -half,10 -half,10c0,0 -half,0 -half,-10l0,-height".replaceAll("startx",e.x).replaceAll("starty",e.y).replaceAll("half",e.width/2).replaceAll("height",e.height)),o.append("path").attr("fill","none").attr("stroke-width","0.5").attr("stroke",i).attr("d","Mstartx,startyc0,10 half,10 half,10c0,0 half,0 half,-10".replaceAll("startx",e.x).replaceAll("starty",e.y).replaceAll("half",e.width/2));break;case"system_queue":case"external_system_queue":case"container_queue":case"external_container_queue":case"component_queue":case"external_component_queue":o.append("path").attr("fill",n).attr("stroke-width","0.5").attr("stroke",i).attr("d","Mstartx,startylwidth,0c5,0 5,half 5,halfc0,0 0,half -5,halfl-width,0c-5,0 -5,-half -5,-halfc0,0 0,-half 5,-half".replaceAll("startx",e.x).replaceAll("starty",e.y).replaceAll("width",e.width).replaceAll("half",e.height/2)),o.append("path").attr("fill","none").attr("stroke-width","0.5").attr("stroke",i).attr("d","Mstartx,startyc-5,0 -5,half -5,halfc0,half 5,half 5,half".replaceAll("startx",e.x+e.width).replaceAll("starty",e.y).replaceAll("half",e.height/2));break}let u=ket(r,e.typeC4Shape.text);switch(o.append("text").attr("fill",a).attr("font-family",u.fontFamily).attr("font-size",u.fontSize-2).attr("font-style","italic").attr("lengthAdjust","spacing").attr("textLength",e.typeC4Shape.width).attr("x",e.x+e.width/2-e.typeC4Shape.width/2).attr("y",e.y+e.typeC4Shape.Y).text("<<"+e.typeC4Shape.text+">>"),e.typeC4Shape.text){case"person":case"external_person":Gle(o,48,48,e.x+e.width/2-24,e.y+e.image.Y,s);break}let h=r[e.typeC4Shape.text+"Font"]();return h.fontWeight="bold",h.fontSize=h.fontSize+2,h.fontColor=a,Gu(r)(e.label.text,o,e.x,e.y+e.label.Y,e.width,e.height,{fill:a},h),h=r[e.typeC4Shape.text+"Font"](),h.fontColor=a,e.techn&&((d=e.techn)==null?void 0:d.text)!==""?Gu(r)(e.techn.text,o,e.x,e.y+e.techn.Y,e.width,e.height,{fill:a,"font-style":"italic"},h):e.type&&e.type.text!==""&&Gu(r)(e.type.text,o,e.x,e.y+e.type.Y,e.width,e.height,{fill:a,"font-style":"italic"},h),e.descr&&e.descr.text!==""&&(h=r.personFont(),h.fontColor=a,Gu(r)(e.descr.text,o,e.x,e.y+e.descr.Y,e.width,e.height,{fill:a},h)),e.height},"drawC4Shape"),yet=T(function(t,e){t.append("defs").append("symbol").attr("id",e+"-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"),vet=T(function(t,e){t.append("defs").append("symbol").attr("id",e+"-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"),bet=T(function(t,e){t.append("defs").append("symbol").attr("id",e+"-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"),xet=T(function(t,e){t.append("defs").append("marker").attr("id",e+"-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"),Tet=T(function(t,e){t.append("defs").append("marker").attr("id",e+"-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"),wet=T(function(t,e){t.append("defs").append("marker").attr("id",e+"-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"),Cet=T(function(t,e){const n=t.append("defs").append("marker").attr("id",e+"-crosshead").attr("markerWidth",15).attr("markerHeight",8).attr("orient","auto").attr("refX",16).attr("refY",4);n.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"),n.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"),ket=T((t,e)=>({fontFamily:t[e+"FontFamily"],fontSize:t[e+"FontSize"],fontWeight:t[e+"FontWeight"]}),"getC4ShapeFont"),Gu=(function(){function t(i,a,s,o,l,u,h){const d=a.append("text").attr("x",s+l/2).attr("y",o+u/2+5).style("text-anchor","middle").text(i);n(d,h)}T(t,"byText");function e(i,a,s,o,l,u,h,d){const{fontSize:f,fontFamily:p,fontWeight:g}=d,m=i.split(Dt.lineBreakRegex);for(let y=0;y=this.data.widthLimit||n>=this.data.widthLimit||this.nextData.cnt>qle)&&(r=this.nextData.startx+e.margin+ur.nextLinePaddingX,i=this.nextData.stopy+e.margin*2,this.nextData.stopx=n=r+e.width,this.nextData.starty=this.nextData.stopy,this.nextData.stopy=a=i+e.height,this.nextData.cnt=1),e.x=r,e.y=i,this.updateVal(this.data,"startx",r,Math.min),this.updateVal(this.data,"starty",i,Math.min),this.updateVal(this.data,"stopx",n,Math.max),this.updateVal(this.data,"stopy",a,Math.max),this.updateVal(this.nextData,"startx",r,Math.min),this.updateVal(this.nextData,"starty",i,Math.min),this.updateVal(this.nextData,"stopx",n,Math.max),this.updateVal(this.nextData,"stopy",a,Math.max)}init(e){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},HN(e.db.getConfig())}bumpLastMargin(e){this.data.stopx+=e,this.data.stopy+=e}},T(ly,"Bounds"),ly),HN=T(function(t){Li(ur,t),t.fontFamily&&(ur.personFontFamily=ur.systemFontFamily=ur.messageFontFamily=t.fontFamily),t.fontSize&&(ur.personFontSize=ur.systemFontSize=ur.messageFontSize=t.fontSize),t.fontWeight&&(ur.personFontWeight=ur.systemFontWeight=ur.messageFontWeight=t.fontWeight)},"setConf"),xw=T((t,e)=>({fontFamily:t[e+"FontFamily"],fontSize:t[e+"FontSize"],fontWeight:t[e+"FontWeight"]}),"c4ShapeFont"),vS=T(t=>({fontFamily:t.boundaryFontFamily,fontSize:t.boundaryFontSize,fontWeight:t.boundaryFontWeight}),"boundaryFont"),Eet=T(t=>({fontFamily:t.messageFontFamily,fontSize:t.messageFontSize,fontWeight:t.messageFontWeight}),"messageFont");function el(t,e,r,n,i){if(!e[t].width)if(r)e[t].text=kx(e[t].text,i,n),e[t].textLines=e[t].text.split(Dt.lineBreakRegex).length,e[t].width=i,e[t].height=Fk(e[t].text,n);else{let a=e[t].text.split(Dt.lineBreakRegex);e[t].textLines=a.length;let s=0;e[t].height=0,e[t].width=0;for(const o of a)e[t].width=Math.max(gs(o,n),e[t].width),s=Fk(o,n),e[t].height=e[t].height+s}}T(el,"calcC4ShapeTextWH");var Wle=T(function(t,e,r){e.x=r.data.startx,e.y=r.data.starty,e.width=r.data.stopx-r.data.startx,e.height=r.data.stopy-r.data.starty,e.label.y=ur.c4ShapeMargin-35;let n=e.wrap&&ur.wrap,i=vS(ur);i.fontSize=i.fontSize+2,i.fontWeight="bold";let a=gs(e.label.text,i);el("label",e,n,i,a),Ac.drawBoundary(t,e,ur)},"drawBoundary"),Ule=T(function(t,e,r,n){let i=0;for(const a of n){i=0;const s=r[a];let o=xw(ur,s.typeC4Shape.text);switch(o.fontSize=o.fontSize-2,s.typeC4Shape.width=gs("«"+s.typeC4Shape.text+"»",o),s.typeC4Shape.height=o.fontSize+2,s.typeC4Shape.Y=ur.c4ShapePadding,i=s.typeC4Shape.Y+s.typeC4Shape.height-4,s.image={width:0,height:0,Y:0},s.typeC4Shape.text){case"person":case"external_person":s.image.width=48,s.image.height=48,s.image.Y=i,i=s.image.Y+s.image.height;break}s.sprite&&(s.image.width=48,s.image.height=48,s.image.Y=i,i=s.image.Y+s.image.height);let l=s.wrap&&ur.wrap,u=ur.width-ur.c4ShapePadding*2,h=xw(ur,s.typeC4Shape.text);if(h.fontSize=h.fontSize+2,h.fontWeight="bold",el("label",s,l,h,u),s.label.Y=i+8,i=s.label.Y+s.label.height,s.type&&s.type.text!==""){s.type.text="["+s.type.text+"]";let p=xw(ur,s.typeC4Shape.text);el("type",s,l,p,u),s.type.Y=i+5,i=s.type.Y+s.type.height}else if(s.techn&&s.techn.text!==""){s.techn.text="["+s.techn.text+"]";let p=xw(ur,s.techn.text);el("techn",s,l,p,u),s.techn.Y=i+5,i=s.techn.Y+s.techn.height}let d=i,f=s.label.width;if(s.descr&&s.descr.text!==""){let p=xw(ur,s.typeC4Shape.text);el("descr",s,l,p,u),s.descr.Y=i+20,i=s.descr.Y+s.descr.height,f=Math.max(s.label.width,s.descr.width),d=i-s.descr.textLines*5}f=f+ur.c4ShapePadding,s.width=Math.max(s.width||ur.width,f,ur.width),s.height=Math.max(s.height||ur.height,d,ur.height),s.margin=s.margin||ur.c4ShapeMargin,t.insert(s),Ac.drawC4Shape(e,s,ur)}t.bumpLastMargin(ur.c4ShapeMargin)},"drawC4ShapeArray"),tl=(cy=class{constructor(e,r){this.x=e,this.y=r}},T(cy,"Point"),cy),Hle=T(function(t,e){let r=t.x,n=t.y,i=e.x,a=e.y,s=r+t.width/2,o=n+t.height/2,l=Math.abs(r-i),u=Math.abs(n-a),h=u/l,d=t.height/t.width,f=null;return n==a&&ri?f=new tl(r,o):r==i&&na&&(f=new tl(s,n)),r>i&&n=h?f=new tl(r,o+h*t.width/2):f=new tl(s-l/u*t.height/2,n+t.height):r=h?f=new tl(r+t.width,o+h*t.width/2):f=new tl(s+l/u*t.height/2,n+t.height):ra?d>=h?f=new tl(r+t.width,o-h*t.width/2):f=new tl(s+t.height/2*l/u,n):r>i&&n>a&&(d>=h?f=new tl(r,o-t.width/2*h):f=new tl(s-t.height/2*l/u,n)),f},"getIntersectPoint"),_et=T(function(t,e){let r={x:0,y:0};r.x=e.x+e.width/2,r.y=e.y+e.height/2;let n=Hle(t,r);r.x=t.x+t.width/2,r.y=t.y+t.height/2;let i=Hle(e,r);return{startPoint:n,endPoint:i}},"getIntersectPoints"),Aet=T(function(t,e,r,n,i){let a=0;for(let s of e){a=a+1;let o=s.wrap&&ur.wrap,l=Eet(ur);n.db.getC4Type()==="C4Dynamic"&&(s.label.text=a+": "+s.label.text);let h=gs(s.label.text,l);el("label",s,o,l,h),s.techn&&s.techn.text!==""&&(h=gs(s.techn.text,l),el("techn",s,o,l,h)),s.descr&&s.descr.text!==""&&(h=gs(s.descr.text,l),el("descr",s,o,l,h));let d=r(s.from),f=r(s.to),p=_et(d,f);s.startPoint=p.startPoint,s.endPoint=p.endPoint}Ac.drawRels(t,e,ur,i)},"drawRels");function YN(t,e,r,n,i){let a=new Vle(i);a.data.widthLimit=r.data.widthLimit/Math.min(UN,n.length);for(let[s,o]of n.entries()){let l=0;o.image={width:0,height:0,Y:0},o.sprite&&(o.image.width=48,o.image.height=48,o.image.Y=l,l=o.image.Y+o.image.height);let u=o.wrap&&ur.wrap,h=vS(ur);if(h.fontSize=h.fontSize+2,h.fontWeight="bold",el("label",o,u,h,a.data.widthLimit),o.label.Y=l+8,l=o.label.Y+o.label.height,o.type&&o.type.text!==""){o.type.text="["+o.type.text+"]";let g=vS(ur);el("type",o,u,g,a.data.widthLimit),o.type.Y=l+5,l=o.type.Y+o.type.height}if(o.descr&&o.descr.text!==""){let g=vS(ur);g.fontSize=g.fontSize-2,el("descr",o,u,g,a.data.widthLimit),o.descr.Y=l+20,l=o.descr.Y+o.descr.height}if(s==0||s%UN===0){let g=r.data.startx+ur.diagramMarginX,m=r.data.stopy+ur.diagramMarginY+l;a.setData(g,g,m,m)}else{let g=a.data.stopx!==a.data.startx?a.data.stopx+ur.diagramMarginX:a.data.startx,m=a.data.starty;a.setData(g,g,m,m)}a.name=o.alias;let d=i.db.getC4ShapeArray(o.alias),f=i.db.getC4ShapeKeys(o.alias);f.length>0&&Ule(a,t,d,f),e=o.alias;let p=i.db.getBoundaries(e);p.length>0&&YN(t,e,a,p,i),o.alias!=="global"&&Wle(t,o,a),r.data.stopy=Math.max(a.data.stopy+ur.c4ShapeMargin,r.data.stopy),r.data.stopx=Math.max(a.data.stopx+ur.c4ShapeMargin,r.data.stopx),mS=Math.max(mS,r.data.stopx),yS=Math.max(yS,r.data.stopy)}}T(YN,"drawInsideBoundary");var Ret=T(function(t,e,r,n){ur=Pe().c4;const i=Pe().securityLevel;let a;i==="sandbox"&&(a=gt("#i"+e));const s=gt(i==="sandbox"?a.nodes()[0].contentDocument.body:"body");let o=n.db;n.db.setWrap(ur.wrap),qle=o.getC4ShapeInRow(),UN=o.getC4BoundaryInRow(),se.debug(`C:${JSON.stringify(ur,null,2)}`);const l=i==="sandbox"?s.select(`[id="${e}"]`):gt(`[id="${e}"]`);Ac.insertComputerIcon(l,e),Ac.insertDatabaseIcon(l,e),Ac.insertClockIcon(l,e);let u=new Vle(n);u.setData(ur.diagramMarginX,ur.diagramMarginX,ur.diagramMarginY,ur.diagramMarginY),u.data.widthLimit=screen.availWidth,mS=ur.diagramMarginX,yS=ur.diagramMarginY;const h=n.db.getTitle();let d=n.db.getBoundaries("");YN(l,"",u,d,n),Ac.insertArrowHead(l,e),Ac.insertArrowEnd(l,e),Ac.insertArrowCrossHead(l,e),Ac.insertArrowFilledHead(l,e),Aet(l,n.db.getRels(),n.db.getC4Shape,n,e),u.data.stopx=mS,u.data.stopy=yS;const f=u.data;let g=f.stopy-f.starty+2*ur.diagramMarginY;const y=f.stopx-f.startx+2*ur.diagramMarginX;h&&l.append("text").text(h).attr("x",(f.stopx-f.startx)/2-4*ur.diagramMarginX).attr("y",f.starty+ur.diagramMarginY),Wi(l,g,y,ur.useMaxWidth);const v=h?60:0;l.attr("viewBox",f.startx-ur.diagramMarginX+" -"+(ur.diagramMarginY+v)+" "+y+" "+(g+v)),se.debug("models:",f)},"draw"),Yle={drawPersonOrSystemArray:Ule,drawBoundary:Wle,setConf:HN,draw:Ret},Let=T(t=>`.person { stroke: ${t.personBorder}; fill: ${t.personBkg}; } -`,"getStyles"),VWe=qWe,WWe={parser:QVe,db:pI,renderer:Lte,styles:VWe,init:x(({c4:t,wrap:e})=>{Lte.setConf(t),pI.setWrap(e)},"init")};const UWe=Object.freeze(Object.defineProperty({__proto__:null,diagram:WWe},Symbol.toStringTag,{value:"Module"}));var px=x(()=>` +`,"getStyles"),Iet=Let,Det={parser:BJe,db:VN,renderer:Yle,styles:Iet,init:T(({c4:t,wrap:e})=>{Yle.setConf(t),VN.setWrap(e)},"init")};const Met=Object.freeze(Object.defineProperty({__proto__:null,diagram:Det},Symbol.toStringTag,{value:"Module"}));var Tw=T(()=>` /* Font Awesome icon styling - consolidated */ .label-icon { display: inline-block; @@ -911,27 +912,27 @@ Expecting `+xt.join(", ")+", got '"+(this.terminals_[it]||it)+"'":ht="Parse erro overflow: visible; vertical-align: -0.125em; } - + .node .label-icon path { fill: currentColor; stroke: revert; stroke-width: revert; } -`,"getIconStyles"),Xp=x((t,e)=>{let r;return e==="sandbox"&&(r=pt("#i"+t)),pt(e==="sandbox"?r.nodes()[0].contentDocument.body:"body").select(`[id="${t}"]`)},"getDiagramElement"),Wd=x((t,e,r,n)=>{t.attr("class",r);const{width:i,height:a,x:s,y:o}=HWe(t,e);wi(t,a,i,n);const l=YWe(s,o,i,a,e);t.attr("viewBox",l),ae.debug(`viewBox configured: ${l} with padding: ${e}`)},"setupViewPortForSVG"),HWe=x((t,e)=>{var n;const r=((n=t.node())==null?void 0:n.getBBox())||{width:0,height:0,x:0,y:0};return{width:r.width+e*2,height:r.height+e*2,x:r.x,y:r.y}},"calculateDimensionsWithPadding"),YWe=x((t,e,r,n,i)=>`${t-i} ${e-i} ${r} ${n}`,"createViewBox"),XWe="flowchart-",KWe=(Im=class{constructor(){this.vertexCounter=0,this.config=Pe(),this.diagramId="",this.vertices=new Map,this.edges=[],this.classes=new Map,this.subGraphs=[],this.subGraphLookup=new Map,this.tooltips=new Map,this.subCount=0,this.firstGraphFlag=!0,this.secCount=-1,this.posCrossRef=[],this.funs=[],this.setAccTitle=Dn,this.setAccDescription=zn,this.setDiagramTitle=qn,this.getAccTitle=Fn,this.getAccDescription=Gn,this.getDiagramTitle=Mn,this.funs.push(this.setupToolTips.bind(this)),this.addVertex=this.addVertex.bind(this),this.firstGraph=this.firstGraph.bind(this),this.setDirection=this.setDirection.bind(this),this.addSubGraph=this.addSubGraph.bind(this),this.addLink=this.addLink.bind(this),this.setLink=this.setLink.bind(this),this.updateLink=this.updateLink.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.destructLink=this.destructLink.bind(this),this.setClickEvent=this.setClickEvent.bind(this),this.setTooltip=this.setTooltip.bind(this),this.updateLinkInterpolate=this.updateLinkInterpolate.bind(this),this.setClickFun=this.setClickFun.bind(this),this.bindFunctions=this.bindFunctions.bind(this),this.lex={firstGraph:this.firstGraph.bind(this)},this.clear(),this.setGen("gen-2")}sanitizeText(e){return Lt.sanitizeText(e,this.config)}sanitizeNodeLabelType(e){switch(e){case"markdown":case"string":case"text":return e;default:return"markdown"}}setDiagramId(e){this.diagramId=e}lookUpDomId(e){for(const r of this.vertices.values())if(r.id===e)return this.diagramId?`${this.diagramId}-${r.domId}`:r.domId;return this.diagramId?`${this.diagramId}-${e}`:e}addVertex(e,r,n,i,a,s,o={},l){var p,g;if(!e||e.trim().length===0)return;let u;if(l!==void 0){let m;l.includes(` +`,"getIconStyles"),_m=T((t,e)=>{let r;return e==="sandbox"&&(r=gt("#i"+t)),gt(e==="sandbox"?r.nodes()[0].contentDocument.body:"body").select(`[id="${t}"]`)},"getDiagramElement"),op=T((t,e,r,n)=>{t.attr("class",r);const{width:i,height:a,x:s,y:o}=Net(t,e);Wi(t,a,i,n);const l=$et(s,o,i,a,e);t.attr("viewBox",l),se.debug(`viewBox configured: ${l} with padding: ${e}`)},"setupViewPortForSVG"),Net=T((t,e)=>{var n;const r=((n=t.node())==null?void 0:n.getBBox())||{width:0,height:0,x:0,y:0};return{width:r.width+e*2,height:r.height+e*2,x:r.x,y:r.y}},"calculateDimensionsWithPadding"),$et=T((t,e,r,n,i)=>`${t-i} ${e-i} ${r} ${n}`,"createViewBox"),Oet="flowchart-",Pet=(uy=class{constructor(){this.vertexCounter=0,this.config=Pe(),this.diagramId="",this.vertices=new Map,this.edges=[],this.classes=new Map,this.subGraphs=[],this.subGraphLookup=new Map,this.tooltips=new Map,this.subCount=0,this.firstGraphFlag=!0,this.secCount=-1,this.posCrossRef=[],this.funs=[],this.setAccTitle=Yn,this.setAccDescription=ai,this.setDiagramTitle=oi,this.getAccTitle=ii,this.getAccDescription=si,this.getDiagramTitle=Xn,this.funs.push(this.setupToolTips.bind(this)),this.addVertex=this.addVertex.bind(this),this.firstGraph=this.firstGraph.bind(this),this.setDirection=this.setDirection.bind(this),this.addSubGraph=this.addSubGraph.bind(this),this.addLink=this.addLink.bind(this),this.setLink=this.setLink.bind(this),this.updateLink=this.updateLink.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.destructLink=this.destructLink.bind(this),this.setClickEvent=this.setClickEvent.bind(this),this.setTooltip=this.setTooltip.bind(this),this.updateLinkInterpolate=this.updateLinkInterpolate.bind(this),this.setClickFun=this.setClickFun.bind(this),this.bindFunctions=this.bindFunctions.bind(this),this.lex={firstGraph:this.firstGraph.bind(this)},this.clear(),this.setGen("gen-2")}sanitizeText(e){return Dt.sanitizeText(e,this.config)}sanitizeNodeLabelType(e){switch(e){case"markdown":case"string":case"text":return e;default:return"markdown"}}setDiagramId(e){this.diagramId=e}lookUpDomId(e){for(const r of this.vertices.values())if(r.id===e)return this.diagramId?`${this.diagramId}-${r.domId}`:r.domId;return this.diagramId?`${this.diagramId}-${e}`:e}addVertex(e,r,n,i,a,s,o={},l){var p,g;if(!e||e.trim().length===0)return;let u;if(l!==void 0){let m;l.includes(` `)?m=l+` `:m=`{ `+l+` -}`,u=_4(m,{schema:A4})}const h=this.edges.find(m=>m.id===e);if(h){const m=u;(m==null?void 0:m.animate)!==void 0&&(h.animate=m.animate),(m==null?void 0:m.animation)!==void 0&&(h.animation=m.animation),(m==null?void 0:m.curve)!==void 0&&(h.interpolate=m.curve);return}let d,f=this.vertices.get(e);if(f===void 0&&(r===void 0&&n===void 0&&i!==void 0&&i!==null&&ae.warn(`Style applied to unknown node "${e}". This may indicate a typo. The node will be created automatically.`),f={id:e,labelType:"text",domId:XWe+e+"-"+this.vertexCounter,styles:[],classes:[]},this.vertices.set(e,f)),this.vertexCounter++,r!==void 0?(this.config=Pe(),d=this.sanitizeText(r.text.trim()),f.labelType=r.type,d.startsWith('"')&&d.endsWith('"')&&(d=d.substring(1,d.length-1)),f.text=d):f.text===void 0&&(f.text=e),n!==void 0&&(f.type=n),i!=null&&i.forEach(m=>{f.styles.push(m)}),a!=null&&a.forEach(m=>{f.classes.push(m)}),s!==void 0&&(f.dir=s),f.props===void 0?f.props=o:o!==void 0&&Object.assign(f.props,o),u!==void 0){if(u.shape){if(u.shape!==u.shape.toLowerCase()||u.shape.includes("_"))throw new Error(`No such shape: ${u.shape}. Shape names should be lowercase.`);if(!WU(u.shape))throw new Error(`No such shape: ${u.shape}.`);f.type=u==null?void 0:u.shape}u!=null&&u.label&&(f.text=u==null?void 0:u.label,f.labelType=this.sanitizeNodeLabelType(u==null?void 0:u.labelType)),u!=null&&u.icon&&(f.icon=u==null?void 0:u.icon,!((p=u.label)!=null&&p.trim())&&f.text===e&&(f.text="")),u!=null&&u.form&&(f.form=u==null?void 0:u.form),u!=null&&u.pos&&(f.pos=u==null?void 0:u.pos),u!=null&&u.img&&(f.img=u==null?void 0:u.img,!((g=u.label)!=null&&g.trim())&&f.text===e&&(f.text="")),u!=null&&u.constraint&&(f.constraint=u.constraint),u.w&&(f.assetWidth=Number(u.w)),u.h&&(f.assetHeight=Number(u.h))}}addSingleLink(e,r,n,i){const o={start:e,end:r,type:void 0,text:"",labelType:"text",classes:[],isUserDefinedId:!1,interpolate:this.edges.defaultInterpolate};ae.info("abc78 Got edge...",o);const l=n.text;if(l!==void 0&&(o.text=this.sanitizeText(l.text.trim()),o.text.startsWith('"')&&o.text.endsWith('"')&&(o.text=o.text.substring(1,o.text.length-1)),o.labelType=this.sanitizeNodeLabelType(l.type)),n!==void 0&&(o.type=n.type,o.stroke=n.stroke,o.length=n.length>10?10:n.length),i&&!this.edges.some(u=>u.id===i))o.id=i,o.isUserDefinedId=!0;else{const u=this.edges.filter(h=>h.start===o.start&&h.end===o.end);u.length===0?o.id=V0(o.start,o.end,{counter:0,prefix:"L"}):o.id=V0(o.start,o.end,{counter:u.length+1,prefix:"L"})}if(this.edges.length<(this.config.maxEdges??500))ae.info("Pushing edge..."),this.edges.push(o);else throw new Error(`Edge limit exceeded. ${this.edges.length} edges found, but the limit is ${this.config.maxEdges}. +}`,u=$k(m,{schema:Nk})}const h=this.edges.find(m=>m.id===e);if(h){const m=u;(m==null?void 0:m.animate)!==void 0&&(h.animate=m.animate),(m==null?void 0:m.animation)!==void 0&&(h.animation=m.animation),(m==null?void 0:m.curve)!==void 0&&(h.interpolate=m.curve);return}let d,f=this.vertices.get(e);if(f===void 0&&(r===void 0&&n===void 0&&i!==void 0&&i!==null&&se.warn(`Style applied to unknown node "${e}". This may indicate a typo. The node will be created automatically.`),f={id:e,labelType:"text",domId:Oet+e+"-"+this.vertexCounter,styles:[],classes:[]},this.vertices.set(e,f)),this.vertexCounter++,r!==void 0?(this.config=Pe(),d=this.sanitizeText(r.text.trim()),f.labelType=r.type,d.startsWith('"')&&d.endsWith('"')&&(d=d.substring(1,d.length-1)),f.text=d):f.text===void 0&&(f.text=e),n!==void 0&&(f.type=n),i!=null&&i.forEach(m=>{f.styles.push(m)}),a!=null&&a.forEach(m=>{f.classes.push(m)}),s!==void 0&&(f.dir=s),f.props===void 0?f.props=o:o!==void 0&&Object.assign(f.props,o),u!==void 0){if(u.shape){if(u.shape!==u.shape.toLowerCase()||u.shape.includes("_"))throw new Error(`No such shape: ${u.shape}. Shape names should be lowercase.`);if(!bK(u.shape))throw new Error(`No such shape: ${u.shape}.`);f.type=u==null?void 0:u.shape}u!=null&&u.label&&(f.text=u==null?void 0:u.label,f.labelType=this.sanitizeNodeLabelType(u==null?void 0:u.labelType)),u!=null&&u.icon&&(f.icon=u==null?void 0:u.icon,!((p=u.label)!=null&&p.trim())&&f.text===e&&(f.text="")),u!=null&&u.form&&(f.form=u==null?void 0:u.form),u!=null&&u.pos&&(f.pos=u==null?void 0:u.pos),u!=null&&u.img&&(f.img=u==null?void 0:u.img,!((g=u.label)!=null&&g.trim())&&f.text===e&&(f.text="")),u!=null&&u.constraint&&(f.constraint=u.constraint),u.w&&(f.assetWidth=Number(u.w)),u.h&&(f.assetHeight=Number(u.h))}}addSingleLink(e,r,n,i){const o={start:e,end:r,type:void 0,text:"",labelType:"text",classes:[],isUserDefinedId:!1,interpolate:this.edges.defaultInterpolate};se.info("abc78 Got edge...",o);const l=n.text;if(l!==void 0&&(o.text=this.sanitizeText(l.text.trim()),o.text.startsWith('"')&&o.text.endsWith('"')&&(o.text=o.text.substring(1,o.text.length-1)),o.labelType=this.sanitizeNodeLabelType(l.type)),n!==void 0&&(o.type=n.type,o.stroke=n.stroke,o.length=n.length>10?10:n.length),i&&!this.edges.some(u=>u.id===i))o.id=i,o.isUserDefinedId=!0;else{const u=this.edges.filter(h=>h.start===o.start&&h.end===o.end);u.length===0?o.id=ag(o.start,o.end,{counter:0,prefix:"L"}):o.id=ag(o.start,o.end,{counter:u.length+1,prefix:"L"})}if(this.edges.length<(this.config.maxEdges??500))se.info("Pushing edge..."),this.edges.push(o);else throw new Error(`Edge limit exceeded. ${this.edges.length} edges found, but the limit is ${this.config.maxEdges}. Initialize mermaid with maxEdges set to a higher number to allow more edges. You cannot set this config via configuration inside the diagram as it is a secure config. -You have to call mermaid.initialize.`)}isLinkData(e){return e!==null&&typeof e=="object"&&"id"in e&&typeof e.id=="string"}addLink(e,r,n){const i=this.isLinkData(n)?n.id.replace("@",""):void 0;ae.info("addLink",e,r,i);for(const a of e)for(const s of r){const o=a===e[e.length-1],l=s===r[0];o&&l?this.addSingleLink(a,s,n,i):this.addSingleLink(a,s,n,void 0)}}updateLinkInterpolate(e,r){e.forEach(n=>{n==="default"?this.edges.defaultInterpolate=r:this.edges[n].interpolate=r})}updateLink(e,r){e.forEach(n=>{var i,a,s,o,l,u;if(typeof n=="number"&&n>=this.edges.length)throw new Error(`The index ${n} for linkStyle is out of bounds. Valid indices for linkStyle are between 0 and ${this.edges.length-1}. (Help: Ensure that the index is within the range of existing edges.)`);n==="default"?this.edges.defaultStyle=r:(this.edges[n].style=r,(((a=(i=this.edges[n])==null?void 0:i.style)==null?void 0:a.length)??0)>0&&!((o=(s=this.edges[n])==null?void 0:s.style)!=null&&o.some(h=>h==null?void 0:h.startsWith("fill")))&&((u=(l=this.edges[n])==null?void 0:l.style)==null||u.push("fill:none")))})}addClass(e,r){const n=r.join().replace(/\\,/g,"§§§").replace(/,/g,";").replace(/§§§/g,",").split(";");e.split(",").forEach(i=>{let a=this.classes.get(i);a===void 0&&(a={id:i,styles:[],textStyles:[]},this.classes.set(i,a)),n!=null&&n.forEach(s=>{if(/color/.exec(s)){const o=s.replace("fill","bgFill");a.textStyles.push(o)}a.styles.push(s)})})}setDirection(e){this.direction=e.trim(),/.*/.exec(this.direction)&&(this.direction="LR"),/.*v/.exec(this.direction)&&(this.direction="TB"),this.direction==="TD"&&(this.direction="TB")}setClass(e,r){for(const n of e.split(",")){const i=this.vertices.get(n);i&&i.classes.push(r);const a=this.edges.find(o=>o.id===n);a&&a.classes.push(r);const s=this.subGraphLookup.get(n);s&&s.classes.push(r)}}setTooltip(e,r){if(r!==void 0){r=this.sanitizeText(r);for(const n of e.split(","))this.tooltips.set(this.version==="gen-1"?this.lookUpDomId(n):n,r)}}setClickFun(e,r,n){if(Pe().securityLevel!=="loose"||r===void 0)return;let i=[];if(typeof n=="string"){i=n.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let s=0;s{const s=this.lookUpDomId(e),o=document.querySelector(`[id="${s}"]`);o!==null&&o.addEventListener("click",()=>{Lr.runFunc(r,...i)},!1)}))}setLink(e,r,n){e.split(",").forEach(i=>{const a=this.vertices.get(i);a!==void 0&&(a.link=Lr.formatUrl(r,this.config),a.linkTarget=n)}),this.setClass(e,"clickable")}getTooltip(e){return this.tooltips.get(e)}setClickEvent(e,r,n){e.split(",").forEach(i=>{this.setClickFun(i,r,n)}),this.setClass(e,"clickable")}bindFunctions(e){this.funs.forEach(r=>{r(e)})}getDirection(){var e;return(e=this.direction)==null?void 0:e.trim()}getVertices(){return this.vertices}getEdges(){return this.edges}getClasses(){return this.classes}setupToolTips(e){const r=xte();pt(e).select("svg").selectAll("g.node").on("mouseover",a=>{var u;const s=pt(a.currentTarget),o=s.attr("title");if(o===null)return;const l=(u=a.currentTarget)==null?void 0:u.getBoundingClientRect();r.transition().duration(200).style("opacity",".9"),r.text(s.attr("title")).style("left",window.scrollX+l.left+(l.right-l.left)/2+"px").style("top",window.scrollY+l.bottom+"px"),r.html(ku.sanitize(o)),s.classed("hover",!0)}).on("mouseout",a=>{r.transition().duration(500).style("opacity",0),pt(a.currentTarget).classed("hover",!1)})}clear(e="gen-2"){this.vertices=new Map,this.classes=new Map,this.edges=[],this.funs=[this.setupToolTips.bind(this)],this.diagramId="",this.subGraphs=[],this.subGraphLookup=new Map,this.subCount=0,this.tooltips=new Map,this.firstGraphFlag=!0,this.version=e,this.config=Pe(),In()}setGen(e){this.version=e||"gen-2"}defaultStyle(){return"fill:#ffa;stroke: #f66; stroke-width: 3px; stroke-dasharray: 5, 5;fill:#ffa;stroke: #666;"}addSubGraph(e,r,n){let i=e.text.trim(),a=n.text;e===n&&/\s/.exec(n.text)&&(i=void 0);const o=x(f=>{const p={boolean:{},number:{},string:{}},g=[];let m;return{nodeList:f.filter(function(v){const T=typeof v;return v.stmt&&v.stmt==="dir"?(m=v.value,!1):v.trim()===""?!1:T in p?p[T].hasOwnProperty(v)?!1:p[T][v]=!0:g.includes(v)?!1:g.push(v)}),dir:m}},"uniq")(r.flat()),l=o.nodeList;let u=o.dir;const h=Pe().flowchart??{};if(u=u??(h.inheritDir?this.getDirection()??Pe().direction??void 0:void 0),this.version==="gen-1")for(let f=0;f2e3)return{result:!1,count:0};if(this.posCrossRef[this.secCount]=r,this.subGraphs[r].id===e)return{result:!0,count:0};let i=0,a=1;for(;i=0){const o=this.indexNodes2(e,s);if(o.result)return{result:!0,count:a+o.count};a=a+o.count}i=i+1}return{result:!1,count:a}}getDepthFirstPos(e){return this.posCrossRef[e]}indexNodes(){this.secCount=-1,this.subGraphs.length>0&&this.indexNodes2("none",this.subGraphs.length-1)}getSubGraphs(){return this.subGraphs}firstGraph(){return this.firstGraphFlag?(this.firstGraphFlag=!1,!0):!1}destructStartLink(e){let r=e.trim(),n="arrow_open";switch(r[0]){case"<":n="arrow_point",r=r.slice(1);break;case"x":n="arrow_cross",r=r.slice(1);break;case"o":n="arrow_circle",r=r.slice(1);break}let i="normal";return r.includes("=")&&(i="thick"),r.includes(".")&&(i="dotted"),{type:n,stroke:i}}countChar(e,r){const n=r.length;let i=0;for(let a=0;a":i="arrow_point",r.startsWith("<")&&(i="double_"+i,n=n.slice(1));break;case"o":i="arrow_circle",r.startsWith("o")&&(i="double_"+i,n=n.slice(1));break}let a="normal",s=n.length-1;n.startsWith("=")&&(a="thick"),n.startsWith("~")&&(a="invisible");const o=this.countChar(".",n);return o&&(a="dotted",s=o),{type:i,stroke:a,length:s}}destructLink(e,r){const n=this.destructEndLink(e);let i;if(r){if(i=this.destructStartLink(r),i.stroke!==n.stroke)return{type:"INVALID",stroke:"INVALID"};if(i.type==="arrow_open")i.type=n.type;else{if(i.type!==n.type)return{type:"INVALID",stroke:"INVALID"};i.type="double_"+i.type}return i.type==="double_arrow"&&(i.type="double_arrow_point"),i.length=n.length,i}return n}exists(e,r){for(const n of e)if(n.nodes.includes(r))return!0;return!1}makeUniq(e,r){const n=[];return e.nodes.forEach((i,a)=>{this.exists(r,i)||n.push(e.nodes[a])}),{nodes:n}}getTypeFromVertex(e){if(e.img)return"imageSquare";if(e.icon)return e.form==="circle"?"iconCircle":e.form==="square"?"iconSquare":e.form==="rounded"?"iconRounded":"icon";switch(e.type){case"square":case void 0:return"squareRect";case"round":return"roundedRect";case"ellipse":return"ellipse";default:return e.type}}findNode(e,r){return e.find(n=>n.id===r)}destructEdgeType(e){let r="none",n="arrow_point";switch(e){case"arrow_point":case"arrow_circle":case"arrow_cross":n=e;break;case"double_arrow_point":case"double_arrow_circle":case"double_arrow_cross":r=e.replace("double_",""),n=r;break}return{arrowTypeStart:r,arrowTypeEnd:n}}addNodeFromVertex(e,r,n,i,a,s){var h;const o=n.get(e.id),l=i.get(e.id)??!1,u=this.findNode(r,e.id);if(u)u.cssStyles=e.styles,u.cssCompiledStyles=this.getCompiledStyles(e.classes),u.cssClasses=e.classes.join(" ");else{const d={id:e.id,label:e.text,labelType:e.labelType,labelStyle:"",parentId:o,padding:((h=a.flowchart)==null?void 0:h.padding)||8,cssStyles:e.styles,cssCompiledStyles:this.getCompiledStyles(["default","node",...e.classes]),cssClasses:"default "+e.classes.join(" "),dir:e.dir,domId:e.domId,look:s,link:e.link,linkTarget:e.linkTarget,tooltip:this.getTooltip(e.id),icon:e.icon,pos:e.pos,img:e.img,assetWidth:e.assetWidth,assetHeight:e.assetHeight,constraint:e.constraint};l?r.push({...d,isGroup:!0,shape:"rect"}):r.push({...d,isGroup:!1,shape:this.getTypeFromVertex(e)})}}getCompiledStyles(e){let r=[];for(const n of e){const i=this.classes.get(n);i!=null&&i.styles&&(r=[...r,...i.styles??[]].map(a=>a.trim())),i!=null&&i.textStyles&&(r=[...r,...i.textStyles??[]].map(a=>a.trim()))}return r}getData(){const e=Pe(),r=[],n=[],i=this.getSubGraphs(),a=new Map,s=new Map;for(let u=i.length-1;u>=0;u--){const h=i[u];h.nodes.length>0&&s.set(h.id,!0);for(const d of h.nodes)a.set(d,h.id)}for(let u=i.length-1;u>=0;u--){const h=i[u];r.push({id:h.id,label:h.title,labelStyle:"",labelType:h.labelType,parentId:a.get(h.id),padding:8,cssCompiledStyles:this.getCompiledStyles(h.classes),cssClasses:h.classes.join(" "),shape:"rect",dir:h.dir,isGroup:!0,look:e.look})}this.getVertices().forEach(u=>{this.addNodeFromVertex(u,r,a,s,e,e.look||"classic")});const l=this.getEdges();return l.forEach((u,h)=>{var m;const{arrowTypeStart:d,arrowTypeEnd:f}=this.destructEdgeType(u.type),p=[...l.defaultStyle??[]];u.style&&p.push(...u.style);const g={id:V0(u.start,u.end,{counter:h,prefix:"L"},u.id),isUserDefinedId:u.isUserDefinedId,start:u.start,end:u.end,type:u.type??"normal",label:u.text,labelType:u.labelType,labelpos:"c",thickness:u.stroke,minlen:u.length,classes:(u==null?void 0:u.stroke)==="invisible"?"":"edge-thickness-normal edge-pattern-solid flowchart-link",arrowTypeStart:(u==null?void 0:u.stroke)==="invisible"||(u==null?void 0:u.type)==="arrow_open"?"none":d,arrowTypeEnd:(u==null?void 0:u.stroke)==="invisible"||(u==null?void 0:u.type)==="arrow_open"?"none":f,arrowheadStyle:"fill: #333",cssCompiledStyles:this.getCompiledStyles(u.classes),labelStyle:p,style:p,pattern:u.stroke,look:e.look,animate:u.animate,animation:u.animation,curve:u.interpolate||this.edges.defaultInterpolate||((m=e.flowchart)==null?void 0:m.curve)};n.push(g)}),{nodes:r,edges:n,other:{},config:e}}defaultConfig(){return $B.flowchart}},x(Im,"FlowDB"),Im),jWe=x(function(t,e){return e.db.getClasses()},"getClasses"),ZWe=x(async function(t,e,r,n){var d;ae.info("REF0:"),ae.info("Drawing state diagram (v2)",e);const{securityLevel:i,flowchart:a,layout:s}=Pe();n.db.setDiagramId(e),ae.debug("Before getData: ");const o=n.db.getData();ae.debug("Data: ",o);const l=Xp(e,i),u=n.db.getDirection();o.type=n.type,o.layoutAlgorithm=sb(s),o.layoutAlgorithm==="dagre"&&s==="elk"&&ae.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."),o.direction=u,o.nodeSpacing=(a==null?void 0:a.nodeSpacing)||50,o.rankSpacing=(a==null?void 0:a.rankSpacing)||50,o.markers=["point","circle","cross"],o.diagramId=e,ae.debug("REF1:",o),await Z0(o,l);const h=((d=o.config.flowchart)==null?void 0:d.diagramPadding)??8;Lr.insertTitle(l,"flowchartTitleText",(a==null?void 0:a.titleTopMargin)||0,n.db.getDiagramTitle()),Wd(l,h,"flowchart",(a==null?void 0:a.useMaxWidth)||!1)},"draw"),QWe={getClasses:jWe,draw:ZWe},bI=(function(){var t=x(function(li,Bt,yt,Pt){for(yt=yt||{},Pt=li.length;Pt--;yt[li[Pt]]=Bt);return yt},"o"),e=[1,4],r=[1,3],n=[1,5],i=[1,8,9,10,11,27,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124,125],a=[2,2],s=[1,13],o=[1,14],l=[1,15],u=[1,16],h=[1,23],d=[1,25],f=[1,26],p=[1,27],g=[1,50],m=[1,49],y=[1,29],v=[1,30],T=[1,31],b=[1,32],w=[1,33],k=[1,45],A=[1,47],C=[1,43],_=[1,48],L=[1,44],O=[1,51],M=[1,46],z=[1,52],F=[1,53],S=[1,34],R=[1,35],N=[1,36],D=[1,37],I=[1,38],$=[1,58],B=[1,8,9,10,11,27,32,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124,125],P=[1,62],G=[1,61],V=[1,63],Y=[8,9,11,75,77,78],W=[1,79],ie=[1,92],K=[1,97],se=[1,96],J=[1,93],Z=[1,89],ee=[1,95],ne=[1,91],ue=[1,98],fe=[1,94],_e=[1,99],Ae=[1,90],Ne=[8,9,10,11,40,75,77,78],me=[8,9,10,11,40,46,75,77,78],ve=[8,9,10,11,29,40,44,46,48,50,52,54,56,58,60,63,65,67,68,70,75,77,78,89,102,105,106,109,111,114,115,116],Ge=[8,9,11,44,60,75,77,78,89,102,105,106,109,111,114,115,116],Te=[44,60,89,102,105,106,109,111,114,115,116],Ze=[1,122],ke=[1,123],Ve=[1,125],Qe=[1,124],nt=[44,60,62,74,89,102,105,106,109,111,114,115,116],tt=[1,134],je=[1,148],Ce=[1,149],Se=[1,150],H=[1,151],he=[1,136],j=[1,138],pe=[1,142],re=[1,143],Be=[1,144],xe=[1,145],Ue=[1,146],De=[1,147],qe=[1,152],Le=[1,153],Xe=[1,132],Ie=[1,133],it=[1,140],we=[1,135],lt=[1,139],be=[1,137],Et=[8,9,10,11,27,32,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124,125],vt=[1,155],ot=[1,157],It=[8,9,11],xt=[8,9,10,11,14,44,60,89,105,106,109,111,114,115,116],ht=[1,177],oe=[1,173],At=[1,174],dt=[1,178],ut=[1,175],wt=[1,176],Mr=[77,116,119],ye=[8,9,10,11,12,14,27,29,32,44,60,75,84,85,86,87,88,89,90,105,109,111,114,115,116],et=[10,106],ct=[31,49,51,53,55,57,62,64,66,67,69,71,116,117,118],_t=[1,248],Ft=[1,246],nr=[1,250],ir=[1,244],_r=[1,245],or=[1,247],Rr=[1,249],Jt=[1,251],Nr=[1,269],gn=[8,9,11,106],$r=[8,9,10,11,60,84,105,106,109,110,111,112],Pa={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,start:3,graphConfig:4,document:5,line:6,statement:7,SEMI:8,NEWLINE:9,SPACE:10,EOF:11,GRAPH:12,NODIR:13,DIR:14,FirstStmtSeparator:15,ending:16,endToken:17,spaceList:18,spaceListNewline:19,vertexStatement:20,separator:21,styleStatement:22,linkStyleStatement:23,classDefStatement:24,classStatement:25,clickStatement:26,subgraph:27,textNoTags:28,SQS:29,text:30,SQE:31,end:32,direction:33,acc_title:34,acc_title_value:35,acc_descr:36,acc_descr_value:37,acc_descr_multiline_value:38,shapeData:39,SHAPE_DATA:40,link:41,node:42,styledVertex:43,AMP:44,vertex:45,STYLE_SEPARATOR:46,idString:47,DOUBLECIRCLESTART:48,DOUBLECIRCLEEND:49,PS:50,PE:51,"(-":52,"-)":53,STADIUMSTART:54,STADIUMEND:55,SUBROUTINESTART:56,SUBROUTINEEND:57,VERTEX_WITH_PROPS_START:58,"NODE_STRING[field]":59,COLON:60,"NODE_STRING[value]":61,PIPE:62,CYLINDERSTART:63,CYLINDEREND:64,DIAMOND_START:65,DIAMOND_STOP:66,TAGEND:67,TRAPSTART:68,TRAPEND:69,INVTRAPSTART:70,INVTRAPEND:71,linkStatement:72,arrowText:73,TESTSTR:74,START_LINK:75,edgeText:76,LINK:77,LINK_ID:78,edgeTextToken:79,STR:80,MD_STR:81,textToken:82,keywords:83,STYLE:84,LINKSTYLE:85,CLASSDEF:86,CLASS:87,CLICK:88,DOWN:89,UP:90,textNoTagsToken:91,stylesOpt:92,"idString[vertex]":93,"idString[class]":94,CALLBACKNAME:95,CALLBACKARGS:96,HREF:97,LINK_TARGET:98,"STR[link]":99,"STR[tooltip]":100,alphaNum:101,DEFAULT:102,numList:103,INTERPOLATE:104,NUM:105,COMMA:106,style:107,styleComponent:108,NODE_STRING:109,UNIT:110,BRKT:111,PCT:112,idStringToken:113,MINUS:114,MULT:115,UNICODE_TEXT:116,TEXT:117,TAGSTART:118,EDGE_TEXT:119,alphaNumToken:120,direction_tb:121,direction_bt:122,direction_rl:123,direction_lr:124,direction_td:125,$accept:0,$end:1},terminals_:{2:"error",8:"SEMI",9:"NEWLINE",10:"SPACE",11:"EOF",12:"GRAPH",13:"NODIR",14:"DIR",27:"subgraph",29:"SQS",31:"SQE",32:"end",34:"acc_title",35:"acc_title_value",36:"acc_descr",37:"acc_descr_value",38:"acc_descr_multiline_value",40:"SHAPE_DATA",44:"AMP",46:"STYLE_SEPARATOR",48:"DOUBLECIRCLESTART",49:"DOUBLECIRCLEEND",50:"PS",51:"PE",52:"(-",53:"-)",54:"STADIUMSTART",55:"STADIUMEND",56:"SUBROUTINESTART",57:"SUBROUTINEEND",58:"VERTEX_WITH_PROPS_START",59:"NODE_STRING[field]",60:"COLON",61:"NODE_STRING[value]",62:"PIPE",63:"CYLINDERSTART",64:"CYLINDEREND",65:"DIAMOND_START",66:"DIAMOND_STOP",67:"TAGEND",68:"TRAPSTART",69:"TRAPEND",70:"INVTRAPSTART",71:"INVTRAPEND",74:"TESTSTR",75:"START_LINK",77:"LINK",78:"LINK_ID",80:"STR",81:"MD_STR",84:"STYLE",85:"LINKSTYLE",86:"CLASSDEF",87:"CLASS",88:"CLICK",89:"DOWN",90:"UP",93:"idString[vertex]",94:"idString[class]",95:"CALLBACKNAME",96:"CALLBACKARGS",97:"HREF",98:"LINK_TARGET",99:"STR[link]",100:"STR[tooltip]",102:"DEFAULT",104:"INTERPOLATE",105:"NUM",106:"COMMA",109:"NODE_STRING",110:"UNIT",111:"BRKT",112:"PCT",114:"MINUS",115:"MULT",116:"UNICODE_TEXT",117:"TEXT",118:"TAGSTART",119:"EDGE_TEXT",121:"direction_tb",122:"direction_bt",123:"direction_rl",124:"direction_lr",125:"direction_td"},productions_:[0,[3,2],[5,0],[5,2],[6,1],[6,1],[6,1],[6,1],[6,1],[4,2],[4,2],[4,2],[4,3],[16,2],[16,1],[17,1],[17,1],[17,1],[15,1],[15,1],[15,2],[19,2],[19,2],[19,1],[19,1],[18,2],[18,1],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,9],[7,6],[7,4],[7,1],[7,2],[7,2],[7,1],[21,1],[21,1],[21,1],[39,2],[39,1],[20,4],[20,3],[20,4],[20,2],[20,2],[20,1],[42,1],[42,6],[42,5],[43,1],[43,3],[45,4],[45,4],[45,6],[45,4],[45,4],[45,4],[45,8],[45,4],[45,4],[45,4],[45,6],[45,4],[45,4],[45,4],[45,4],[45,4],[45,1],[41,2],[41,3],[41,3],[41,1],[41,3],[41,4],[76,1],[76,2],[76,1],[76,1],[72,1],[72,2],[73,3],[30,1],[30,2],[30,1],[30,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[28,1],[28,2],[28,1],[28,1],[24,5],[25,5],[26,2],[26,4],[26,3],[26,5],[26,3],[26,5],[26,5],[26,7],[26,2],[26,4],[26,2],[26,4],[26,4],[26,6],[22,5],[23,5],[23,5],[23,9],[23,9],[23,7],[23,7],[103,1],[103,3],[92,1],[92,3],[107,1],[107,2],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[82,1],[82,1],[82,1],[82,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[79,1],[79,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[47,1],[47,2],[101,1],[101,2],[33,1],[33,1],[33,1],[33,1],[33,1]],performAction:x(function(Bt,yt,Pt,Ct,pr,Ee,Di){var Oe=Ee.length-1;switch(pr){case 2:this.$=[];break;case 3:(!Array.isArray(Ee[Oe])||Ee[Oe].length>0)&&Ee[Oe-1].push(Ee[Oe]),this.$=Ee[Oe-1];break;case 4:case 183:this.$=Ee[Oe];break;case 11:Ct.setDirection("TB"),this.$="TB";break;case 12:Ct.setDirection(Ee[Oe-1]),this.$=Ee[Oe-1];break;case 27:this.$=Ee[Oe-1].nodes;break;case 28:case 29:case 30:case 31:case 32:this.$=[];break;case 33:this.$=Ct.addSubGraph(Ee[Oe-6],Ee[Oe-1],Ee[Oe-4]);break;case 34:this.$=Ct.addSubGraph(Ee[Oe-3],Ee[Oe-1],Ee[Oe-3]);break;case 35:this.$=Ct.addSubGraph(void 0,Ee[Oe-1],void 0);break;case 37:this.$=Ee[Oe].trim(),Ct.setAccTitle(this.$);break;case 38:case 39:this.$=Ee[Oe].trim(),Ct.setAccDescription(this.$);break;case 43:this.$=Ee[Oe-1]+Ee[Oe];break;case 44:this.$=Ee[Oe];break;case 45:Ct.addVertex(Ee[Oe-1][Ee[Oe-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,Ee[Oe]),Ct.addLink(Ee[Oe-3].stmt,Ee[Oe-1],Ee[Oe-2]),this.$={stmt:Ee[Oe-1],nodes:Ee[Oe-1].concat(Ee[Oe-3].nodes)};break;case 46:Ct.addLink(Ee[Oe-2].stmt,Ee[Oe],Ee[Oe-1]),this.$={stmt:Ee[Oe],nodes:Ee[Oe].concat(Ee[Oe-2].nodes)};break;case 47:Ct.addLink(Ee[Oe-3].stmt,Ee[Oe-1],Ee[Oe-2]),this.$={stmt:Ee[Oe-1],nodes:Ee[Oe-1].concat(Ee[Oe-3].nodes)};break;case 48:this.$={stmt:Ee[Oe-1],nodes:Ee[Oe-1]};break;case 49:Ct.addVertex(Ee[Oe-1][Ee[Oe-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,Ee[Oe]),this.$={stmt:Ee[Oe-1],nodes:Ee[Oe-1],shapeData:Ee[Oe]};break;case 50:this.$={stmt:Ee[Oe],nodes:Ee[Oe]};break;case 51:this.$=[Ee[Oe]];break;case 52:Ct.addVertex(Ee[Oe-5][Ee[Oe-5].length-1],void 0,void 0,void 0,void 0,void 0,void 0,Ee[Oe-4]),this.$=Ee[Oe-5].concat(Ee[Oe]);break;case 53:this.$=Ee[Oe-4].concat(Ee[Oe]);break;case 54:this.$=Ee[Oe];break;case 55:this.$=Ee[Oe-2],Ct.setClass(Ee[Oe-2],Ee[Oe]);break;case 56:this.$=Ee[Oe-3],Ct.addVertex(Ee[Oe-3],Ee[Oe-1],"square");break;case 57:this.$=Ee[Oe-3],Ct.addVertex(Ee[Oe-3],Ee[Oe-1],"doublecircle");break;case 58:this.$=Ee[Oe-5],Ct.addVertex(Ee[Oe-5],Ee[Oe-2],"circle");break;case 59:this.$=Ee[Oe-3],Ct.addVertex(Ee[Oe-3],Ee[Oe-1],"ellipse");break;case 60:this.$=Ee[Oe-3],Ct.addVertex(Ee[Oe-3],Ee[Oe-1],"stadium");break;case 61:this.$=Ee[Oe-3],Ct.addVertex(Ee[Oe-3],Ee[Oe-1],"subroutine");break;case 62:this.$=Ee[Oe-7],Ct.addVertex(Ee[Oe-7],Ee[Oe-1],"rect",void 0,void 0,void 0,Object.fromEntries([[Ee[Oe-5],Ee[Oe-3]]]));break;case 63:this.$=Ee[Oe-3],Ct.addVertex(Ee[Oe-3],Ee[Oe-1],"cylinder");break;case 64:this.$=Ee[Oe-3],Ct.addVertex(Ee[Oe-3],Ee[Oe-1],"round");break;case 65:this.$=Ee[Oe-3],Ct.addVertex(Ee[Oe-3],Ee[Oe-1],"diamond");break;case 66:this.$=Ee[Oe-5],Ct.addVertex(Ee[Oe-5],Ee[Oe-2],"hexagon");break;case 67:this.$=Ee[Oe-3],Ct.addVertex(Ee[Oe-3],Ee[Oe-1],"odd");break;case 68:this.$=Ee[Oe-3],Ct.addVertex(Ee[Oe-3],Ee[Oe-1],"trapezoid");break;case 69:this.$=Ee[Oe-3],Ct.addVertex(Ee[Oe-3],Ee[Oe-1],"inv_trapezoid");break;case 70:this.$=Ee[Oe-3],Ct.addVertex(Ee[Oe-3],Ee[Oe-1],"lean_right");break;case 71:this.$=Ee[Oe-3],Ct.addVertex(Ee[Oe-3],Ee[Oe-1],"lean_left");break;case 72:this.$=Ee[Oe],Ct.addVertex(Ee[Oe]);break;case 73:Ee[Oe-1].text=Ee[Oe],this.$=Ee[Oe-1];break;case 74:case 75:Ee[Oe-2].text=Ee[Oe-1],this.$=Ee[Oe-2];break;case 76:this.$=Ee[Oe];break;case 77:var Ln=Ct.destructLink(Ee[Oe],Ee[Oe-2]);this.$={type:Ln.type,stroke:Ln.stroke,length:Ln.length,text:Ee[Oe-1]};break;case 78:var Ln=Ct.destructLink(Ee[Oe],Ee[Oe-2]);this.$={type:Ln.type,stroke:Ln.stroke,length:Ln.length,text:Ee[Oe-1],id:Ee[Oe-3]};break;case 79:this.$={text:Ee[Oe],type:"text"};break;case 80:this.$={text:Ee[Oe-1].text+""+Ee[Oe],type:Ee[Oe-1].type};break;case 81:this.$={text:Ee[Oe],type:"string"};break;case 82:this.$={text:Ee[Oe],type:"markdown"};break;case 83:var Ln=Ct.destructLink(Ee[Oe]);this.$={type:Ln.type,stroke:Ln.stroke,length:Ln.length};break;case 84:var Ln=Ct.destructLink(Ee[Oe]);this.$={type:Ln.type,stroke:Ln.stroke,length:Ln.length,id:Ee[Oe-1]};break;case 85:this.$=Ee[Oe-1];break;case 86:this.$={text:Ee[Oe],type:"text"};break;case 87:this.$={text:Ee[Oe-1].text+""+Ee[Oe],type:Ee[Oe-1].type};break;case 88:this.$={text:Ee[Oe],type:"string"};break;case 89:case 104:this.$={text:Ee[Oe],type:"markdown"};break;case 101:this.$={text:Ee[Oe],type:"text"};break;case 102:this.$={text:Ee[Oe-1].text+""+Ee[Oe],type:Ee[Oe-1].type};break;case 103:this.$={text:Ee[Oe],type:"text"};break;case 105:this.$=Ee[Oe-4],Ct.addClass(Ee[Oe-2],Ee[Oe]);break;case 106:this.$=Ee[Oe-4],Ct.setClass(Ee[Oe-2],Ee[Oe]);break;case 107:case 115:this.$=Ee[Oe-1],Ct.setClickEvent(Ee[Oe-1],Ee[Oe]);break;case 108:case 116:this.$=Ee[Oe-3],Ct.setClickEvent(Ee[Oe-3],Ee[Oe-2]),Ct.setTooltip(Ee[Oe-3],Ee[Oe]);break;case 109:this.$=Ee[Oe-2],Ct.setClickEvent(Ee[Oe-2],Ee[Oe-1],Ee[Oe]);break;case 110:this.$=Ee[Oe-4],Ct.setClickEvent(Ee[Oe-4],Ee[Oe-3],Ee[Oe-2]),Ct.setTooltip(Ee[Oe-4],Ee[Oe]);break;case 111:this.$=Ee[Oe-2],Ct.setLink(Ee[Oe-2],Ee[Oe]);break;case 112:this.$=Ee[Oe-4],Ct.setLink(Ee[Oe-4],Ee[Oe-2]),Ct.setTooltip(Ee[Oe-4],Ee[Oe]);break;case 113:this.$=Ee[Oe-4],Ct.setLink(Ee[Oe-4],Ee[Oe-2],Ee[Oe]);break;case 114:this.$=Ee[Oe-6],Ct.setLink(Ee[Oe-6],Ee[Oe-4],Ee[Oe]),Ct.setTooltip(Ee[Oe-6],Ee[Oe-2]);break;case 117:this.$=Ee[Oe-1],Ct.setLink(Ee[Oe-1],Ee[Oe]);break;case 118:this.$=Ee[Oe-3],Ct.setLink(Ee[Oe-3],Ee[Oe-2]),Ct.setTooltip(Ee[Oe-3],Ee[Oe]);break;case 119:this.$=Ee[Oe-3],Ct.setLink(Ee[Oe-3],Ee[Oe-2],Ee[Oe]);break;case 120:this.$=Ee[Oe-5],Ct.setLink(Ee[Oe-5],Ee[Oe-4],Ee[Oe]),Ct.setTooltip(Ee[Oe-5],Ee[Oe-2]);break;case 121:this.$=Ee[Oe-4],Ct.addVertex(Ee[Oe-2],void 0,void 0,Ee[Oe]);break;case 122:this.$=Ee[Oe-4],Ct.updateLink([Ee[Oe-2]],Ee[Oe]);break;case 123:this.$=Ee[Oe-4],Ct.updateLink(Ee[Oe-2],Ee[Oe]);break;case 124:this.$=Ee[Oe-8],Ct.updateLinkInterpolate([Ee[Oe-6]],Ee[Oe-2]),Ct.updateLink([Ee[Oe-6]],Ee[Oe]);break;case 125:this.$=Ee[Oe-8],Ct.updateLinkInterpolate(Ee[Oe-6],Ee[Oe-2]),Ct.updateLink(Ee[Oe-6],Ee[Oe]);break;case 126:this.$=Ee[Oe-6],Ct.updateLinkInterpolate([Ee[Oe-4]],Ee[Oe]);break;case 127:this.$=Ee[Oe-6],Ct.updateLinkInterpolate(Ee[Oe-4],Ee[Oe]);break;case 128:case 130:this.$=[Ee[Oe]];break;case 129:case 131:Ee[Oe-2].push(Ee[Oe]),this.$=Ee[Oe-2];break;case 133:this.$=Ee[Oe-1]+Ee[Oe];break;case 181:this.$=Ee[Oe];break;case 182:this.$=Ee[Oe-1]+""+Ee[Oe];break;case 184:this.$=Ee[Oe-1]+""+Ee[Oe];break;case 185:this.$={stmt:"dir",value:"TB"};break;case 186:this.$={stmt:"dir",value:"BT"};break;case 187:this.$={stmt:"dir",value:"RL"};break;case 188:this.$={stmt:"dir",value:"LR"};break;case 189:this.$={stmt:"dir",value:"TD"};break}},"anonymous"),table:[{3:1,4:2,9:e,10:r,12:n},{1:[3]},t(i,a,{5:6}),{4:7,9:e,10:r,12:n},{4:8,9:e,10:r,12:n},{13:[1,9],14:[1,10]},{1:[2,1],6:11,7:12,8:s,9:o,10:l,11:u,20:17,22:18,23:19,24:20,25:21,26:22,27:h,33:24,34:d,36:f,38:p,42:28,43:39,44:g,45:40,47:41,60:m,84:y,85:v,86:T,87:b,88:w,89:k,102:A,105:C,106:_,109:L,111:O,113:42,114:M,115:z,116:F,121:S,122:R,123:N,124:D,125:I},t(i,[2,9]),t(i,[2,10]),t(i,[2,11]),{8:[1,55],9:[1,56],10:$,15:54,18:57},t(B,[2,3]),t(B,[2,4]),t(B,[2,5]),t(B,[2,6]),t(B,[2,7]),t(B,[2,8]),{8:P,9:G,11:V,21:59,41:60,72:64,75:[1,65],77:[1,67],78:[1,66]},{8:P,9:G,11:V,21:68},{8:P,9:G,11:V,21:69},{8:P,9:G,11:V,21:70},{8:P,9:G,11:V,21:71},{8:P,9:G,11:V,21:72},{8:P,9:G,10:[1,73],11:V,21:74},t(B,[2,36]),{35:[1,75]},{37:[1,76]},t(B,[2,39]),t(Y,[2,50],{18:77,39:78,10:$,40:W}),{10:[1,80]},{10:[1,81]},{10:[1,82]},{10:[1,83]},{14:ie,44:K,60:se,80:[1,87],89:J,95:[1,84],97:[1,85],101:86,105:Z,106:ee,109:ne,111:ue,114:fe,115:_e,116:Ae,120:88},t(B,[2,185]),t(B,[2,186]),t(B,[2,187]),t(B,[2,188]),t(B,[2,189]),t(Ne,[2,51]),t(Ne,[2,54],{46:[1,100]}),t(me,[2,72],{113:113,29:[1,101],44:g,48:[1,102],50:[1,103],52:[1,104],54:[1,105],56:[1,106],58:[1,107],60:m,63:[1,108],65:[1,109],67:[1,110],68:[1,111],70:[1,112],89:k,102:A,105:C,106:_,109:L,111:O,114:M,115:z,116:F}),t(ve,[2,181]),t(ve,[2,142]),t(ve,[2,143]),t(ve,[2,144]),t(ve,[2,145]),t(ve,[2,146]),t(ve,[2,147]),t(ve,[2,148]),t(ve,[2,149]),t(ve,[2,150]),t(ve,[2,151]),t(ve,[2,152]),t(i,[2,12]),t(i,[2,18]),t(i,[2,19]),{9:[1,114]},t(Ge,[2,26],{18:115,10:$}),t(B,[2,27]),{42:116,43:39,44:g,45:40,47:41,60:m,89:k,102:A,105:C,106:_,109:L,111:O,113:42,114:M,115:z,116:F},t(B,[2,40]),t(B,[2,41]),t(B,[2,42]),t(Te,[2,76],{73:117,62:[1,119],74:[1,118]}),{76:120,79:121,80:Ze,81:ke,116:Ve,119:Qe},{75:[1,126],77:[1,127]},t(nt,[2,83]),t(B,[2,28]),t(B,[2,29]),t(B,[2,30]),t(B,[2,31]),t(B,[2,32]),{10:tt,12:je,14:Ce,27:Se,28:128,32:H,44:he,60:j,75:pe,80:[1,130],81:[1,131],83:141,84:re,85:Be,86:xe,87:Ue,88:De,89:qe,90:Le,91:129,105:Xe,109:Ie,111:it,114:we,115:lt,116:be},t(Et,a,{5:154}),t(B,[2,37]),t(B,[2,38]),t(Y,[2,48],{44:vt}),t(Y,[2,49],{18:156,10:$,40:ot}),t(Ne,[2,44]),{44:g,47:158,60:m,89:k,102:A,105:C,106:_,109:L,111:O,113:42,114:M,115:z,116:F},{102:[1,159],103:160,105:[1,161]},{44:g,47:162,60:m,89:k,102:A,105:C,106:_,109:L,111:O,113:42,114:M,115:z,116:F},{44:g,47:163,60:m,89:k,102:A,105:C,106:_,109:L,111:O,113:42,114:M,115:z,116:F},t(It,[2,107],{10:[1,164],96:[1,165]}),{80:[1,166]},t(It,[2,115],{120:168,10:[1,167],14:ie,44:K,60:se,89:J,105:Z,106:ee,109:ne,111:ue,114:fe,115:_e,116:Ae}),t(It,[2,117],{10:[1,169]}),t(xt,[2,183]),t(xt,[2,170]),t(xt,[2,171]),t(xt,[2,172]),t(xt,[2,173]),t(xt,[2,174]),t(xt,[2,175]),t(xt,[2,176]),t(xt,[2,177]),t(xt,[2,178]),t(xt,[2,179]),t(xt,[2,180]),{44:g,47:170,60:m,89:k,102:A,105:C,106:_,109:L,111:O,113:42,114:M,115:z,116:F},{30:171,67:ht,80:oe,81:At,82:172,116:dt,117:ut,118:wt},{30:179,67:ht,80:oe,81:At,82:172,116:dt,117:ut,118:wt},{30:181,50:[1,180],67:ht,80:oe,81:At,82:172,116:dt,117:ut,118:wt},{30:182,67:ht,80:oe,81:At,82:172,116:dt,117:ut,118:wt},{30:183,67:ht,80:oe,81:At,82:172,116:dt,117:ut,118:wt},{30:184,67:ht,80:oe,81:At,82:172,116:dt,117:ut,118:wt},{109:[1,185]},{30:186,67:ht,80:oe,81:At,82:172,116:dt,117:ut,118:wt},{30:187,65:[1,188],67:ht,80:oe,81:At,82:172,116:dt,117:ut,118:wt},{30:189,67:ht,80:oe,81:At,82:172,116:dt,117:ut,118:wt},{30:190,67:ht,80:oe,81:At,82:172,116:dt,117:ut,118:wt},{30:191,67:ht,80:oe,81:At,82:172,116:dt,117:ut,118:wt},t(ve,[2,182]),t(i,[2,20]),t(Ge,[2,25]),t(Y,[2,46],{39:192,18:193,10:$,40:W}),t(Te,[2,73],{10:[1,194]}),{10:[1,195]},{30:196,67:ht,80:oe,81:At,82:172,116:dt,117:ut,118:wt},{77:[1,197],79:198,116:Ve,119:Qe},t(Mr,[2,79]),t(Mr,[2,81]),t(Mr,[2,82]),t(Mr,[2,168]),t(Mr,[2,169]),{76:199,79:121,80:Ze,81:ke,116:Ve,119:Qe},t(nt,[2,84]),{8:P,9:G,10:tt,11:V,12:je,14:Ce,21:201,27:Se,29:[1,200],32:H,44:he,60:j,75:pe,83:141,84:re,85:Be,86:xe,87:Ue,88:De,89:qe,90:Le,91:202,105:Xe,109:Ie,111:it,114:we,115:lt,116:be},t(ye,[2,101]),t(ye,[2,103]),t(ye,[2,104]),t(ye,[2,157]),t(ye,[2,158]),t(ye,[2,159]),t(ye,[2,160]),t(ye,[2,161]),t(ye,[2,162]),t(ye,[2,163]),t(ye,[2,164]),t(ye,[2,165]),t(ye,[2,166]),t(ye,[2,167]),t(ye,[2,90]),t(ye,[2,91]),t(ye,[2,92]),t(ye,[2,93]),t(ye,[2,94]),t(ye,[2,95]),t(ye,[2,96]),t(ye,[2,97]),t(ye,[2,98]),t(ye,[2,99]),t(ye,[2,100]),{6:11,7:12,8:s,9:o,10:l,11:u,20:17,22:18,23:19,24:20,25:21,26:22,27:h,32:[1,203],33:24,34:d,36:f,38:p,42:28,43:39,44:g,45:40,47:41,60:m,84:y,85:v,86:T,87:b,88:w,89:k,102:A,105:C,106:_,109:L,111:O,113:42,114:M,115:z,116:F,121:S,122:R,123:N,124:D,125:I},{10:$,18:204},{44:[1,205]},t(Ne,[2,43]),{10:[1,206],44:g,60:m,89:k,102:A,105:C,106:_,109:L,111:O,113:113,114:M,115:z,116:F},{10:[1,207]},{10:[1,208],106:[1,209]},t(et,[2,128]),{10:[1,210],44:g,60:m,89:k,102:A,105:C,106:_,109:L,111:O,113:113,114:M,115:z,116:F},{10:[1,211],44:g,60:m,89:k,102:A,105:C,106:_,109:L,111:O,113:113,114:M,115:z,116:F},{80:[1,212]},t(It,[2,109],{10:[1,213]}),t(It,[2,111],{10:[1,214]}),{80:[1,215]},t(xt,[2,184]),{80:[1,216],98:[1,217]},t(Ne,[2,55],{113:113,44:g,60:m,89:k,102:A,105:C,106:_,109:L,111:O,114:M,115:z,116:F}),{31:[1,218],67:ht,82:219,116:dt,117:ut,118:wt},t(ct,[2,86]),t(ct,[2,88]),t(ct,[2,89]),t(ct,[2,153]),t(ct,[2,154]),t(ct,[2,155]),t(ct,[2,156]),{49:[1,220],67:ht,82:219,116:dt,117:ut,118:wt},{30:221,67:ht,80:oe,81:At,82:172,116:dt,117:ut,118:wt},{51:[1,222],67:ht,82:219,116:dt,117:ut,118:wt},{53:[1,223],67:ht,82:219,116:dt,117:ut,118:wt},{55:[1,224],67:ht,82:219,116:dt,117:ut,118:wt},{57:[1,225],67:ht,82:219,116:dt,117:ut,118:wt},{60:[1,226]},{64:[1,227],67:ht,82:219,116:dt,117:ut,118:wt},{66:[1,228],67:ht,82:219,116:dt,117:ut,118:wt},{30:229,67:ht,80:oe,81:At,82:172,116:dt,117:ut,118:wt},{31:[1,230],67:ht,82:219,116:dt,117:ut,118:wt},{67:ht,69:[1,231],71:[1,232],82:219,116:dt,117:ut,118:wt},{67:ht,69:[1,234],71:[1,233],82:219,116:dt,117:ut,118:wt},t(Y,[2,45],{18:156,10:$,40:ot}),t(Y,[2,47],{44:vt}),t(Te,[2,75]),t(Te,[2,74]),{62:[1,235],67:ht,82:219,116:dt,117:ut,118:wt},t(Te,[2,77]),t(Mr,[2,80]),{77:[1,236],79:198,116:Ve,119:Qe},{30:237,67:ht,80:oe,81:At,82:172,116:dt,117:ut,118:wt},t(Et,a,{5:238}),t(ye,[2,102]),t(B,[2,35]),{43:239,44:g,45:40,47:41,60:m,89:k,102:A,105:C,106:_,109:L,111:O,113:42,114:M,115:z,116:F},{10:$,18:240},{10:_t,60:Ft,84:nr,92:241,105:ir,107:242,108:243,109:_r,110:or,111:Rr,112:Jt},{10:_t,60:Ft,84:nr,92:252,104:[1,253],105:ir,107:242,108:243,109:_r,110:or,111:Rr,112:Jt},{10:_t,60:Ft,84:nr,92:254,104:[1,255],105:ir,107:242,108:243,109:_r,110:or,111:Rr,112:Jt},{105:[1,256]},{10:_t,60:Ft,84:nr,92:257,105:ir,107:242,108:243,109:_r,110:or,111:Rr,112:Jt},{44:g,47:258,60:m,89:k,102:A,105:C,106:_,109:L,111:O,113:42,114:M,115:z,116:F},t(It,[2,108]),{80:[1,259]},{80:[1,260],98:[1,261]},t(It,[2,116]),t(It,[2,118],{10:[1,262]}),t(It,[2,119]),t(me,[2,56]),t(ct,[2,87]),t(me,[2,57]),{51:[1,263],67:ht,82:219,116:dt,117:ut,118:wt},t(me,[2,64]),t(me,[2,59]),t(me,[2,60]),t(me,[2,61]),{109:[1,264]},t(me,[2,63]),t(me,[2,65]),{66:[1,265],67:ht,82:219,116:dt,117:ut,118:wt},t(me,[2,67]),t(me,[2,68]),t(me,[2,70]),t(me,[2,69]),t(me,[2,71]),t([10,44,60,89,102,105,106,109,111,114,115,116],[2,85]),t(Te,[2,78]),{31:[1,266],67:ht,82:219,116:dt,117:ut,118:wt},{6:11,7:12,8:s,9:o,10:l,11:u,20:17,22:18,23:19,24:20,25:21,26:22,27:h,32:[1,267],33:24,34:d,36:f,38:p,42:28,43:39,44:g,45:40,47:41,60:m,84:y,85:v,86:T,87:b,88:w,89:k,102:A,105:C,106:_,109:L,111:O,113:42,114:M,115:z,116:F,121:S,122:R,123:N,124:D,125:I},t(Ne,[2,53]),{43:268,44:g,45:40,47:41,60:m,89:k,102:A,105:C,106:_,109:L,111:O,113:42,114:M,115:z,116:F},t(It,[2,121],{106:Nr}),t(gn,[2,130],{108:270,10:_t,60:Ft,84:nr,105:ir,109:_r,110:or,111:Rr,112:Jt}),t($r,[2,132]),t($r,[2,134]),t($r,[2,135]),t($r,[2,136]),t($r,[2,137]),t($r,[2,138]),t($r,[2,139]),t($r,[2,140]),t($r,[2,141]),t(It,[2,122],{106:Nr}),{10:[1,271]},t(It,[2,123],{106:Nr}),{10:[1,272]},t(et,[2,129]),t(It,[2,105],{106:Nr}),t(It,[2,106],{113:113,44:g,60:m,89:k,102:A,105:C,106:_,109:L,111:O,114:M,115:z,116:F}),t(It,[2,110]),t(It,[2,112],{10:[1,273]}),t(It,[2,113]),{98:[1,274]},{51:[1,275]},{62:[1,276]},{66:[1,277]},{8:P,9:G,11:V,21:278},t(B,[2,34]),t(Ne,[2,52]),{10:_t,60:Ft,84:nr,105:ir,107:279,108:243,109:_r,110:or,111:Rr,112:Jt},t($r,[2,133]),{14:ie,44:K,60:se,89:J,101:280,105:Z,106:ee,109:ne,111:ue,114:fe,115:_e,116:Ae,120:88},{14:ie,44:K,60:se,89:J,101:281,105:Z,106:ee,109:ne,111:ue,114:fe,115:_e,116:Ae,120:88},{98:[1,282]},t(It,[2,120]),t(me,[2,58]),{30:283,67:ht,80:oe,81:At,82:172,116:dt,117:ut,118:wt},t(me,[2,66]),t(Et,a,{5:284}),t(gn,[2,131],{108:270,10:_t,60:Ft,84:nr,105:ir,109:_r,110:or,111:Rr,112:Jt}),t(It,[2,126],{120:168,10:[1,285],14:ie,44:K,60:se,89:J,105:Z,106:ee,109:ne,111:ue,114:fe,115:_e,116:Ae}),t(It,[2,127],{120:168,10:[1,286],14:ie,44:K,60:se,89:J,105:Z,106:ee,109:ne,111:ue,114:fe,115:_e,116:Ae}),t(It,[2,114]),{31:[1,287],67:ht,82:219,116:dt,117:ut,118:wt},{6:11,7:12,8:s,9:o,10:l,11:u,20:17,22:18,23:19,24:20,25:21,26:22,27:h,32:[1,288],33:24,34:d,36:f,38:p,42:28,43:39,44:g,45:40,47:41,60:m,84:y,85:v,86:T,87:b,88:w,89:k,102:A,105:C,106:_,109:L,111:O,113:42,114:M,115:z,116:F,121:S,122:R,123:N,124:D,125:I},{10:_t,60:Ft,84:nr,92:289,105:ir,107:242,108:243,109:_r,110:or,111:Rr,112:Jt},{10:_t,60:Ft,84:nr,92:290,105:ir,107:242,108:243,109:_r,110:or,111:Rr,112:Jt},t(me,[2,62]),t(B,[2,33]),t(It,[2,124],{106:Nr}),t(It,[2,125],{106:Nr})],defaultActions:{},parseError:x(function(Bt,yt){if(yt.recoverable)this.trace(Bt);else{var Pt=new Error(Bt);throw Pt.hash=yt,Pt}},"parseError"),parse:x(function(Bt){var yt=this,Pt=[0],Ct=[],pr=[null],Ee=[],Di=this.table,Oe="",Ln=0,h0=0,jv=2,Zv=1,Qv=Ee.slice.call(arguments,1),Jn=Object.create(this.lexer),il={yy:{}};for(var yi in this.yy)Object.prototype.hasOwnProperty.call(this.yy,yi)&&(il.yy[yi]=this.yy[yi]);Jn.setInput(Bt,il.yy),il.yy.lexer=Jn,il.yy.parser=this,typeof Jn.yylloc>"u"&&(Jn.yylloc={});var al=Jn.yylloc;Ee.push(al);var xu=Jn.options&&Jn.options.ranges;typeof il.yy.parseError=="function"?this.parseError=il.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Ot(Qr){Pt.length=Pt.length-2*Qr,pr.length=pr.length-Qr,Ee.length=Ee.length-Qr}x(Ot,"popStack");function Re(){var Qr;return Qr=Ct.pop()||Jn.lex()||Zv,typeof Qr!="number"&&(Qr instanceof Array&&(Ct=Qr,Qr=Ct.pop()),Qr=yt.symbols_[Qr]||Qr),Qr}x(Re,"lex");for(var Je,bt,Vt,dr,fr={},mn,dn,vi,ei;;){if(bt=Pt[Pt.length-1],this.defaultActions[bt]?Vt=this.defaultActions[bt]:((Je===null||typeof Je>"u")&&(Je=Re()),Vt=Di[bt]&&Di[bt][Je]),typeof Vt>"u"||!Vt.length||!Vt[0]){var bi="";ei=[];for(mn in Di[bt])this.terminals_[mn]&&mn>jv&&ei.push("'"+this.terminals_[mn]+"'");Jn.showPosition?bi="Parse error on line "+(Ln+1)+`: -`+Jn.showPosition()+` -Expecting `+ei.join(", ")+", got '"+(this.terminals_[Je]||Je)+"'":bi="Parse error on line "+(Ln+1)+": Unexpected "+(Je==Zv?"end of input":"'"+(this.terminals_[Je]||Je)+"'"),this.parseError(bi,{text:Jn.match,token:this.terminals_[Je]||Je,line:Jn.yylineno,loc:al,expected:ei})}if(Vt[0]instanceof Array&&Vt.length>1)throw new Error("Parse Error: multiple actions possible at state: "+bt+", token: "+Je);switch(Vt[0]){case 1:Pt.push(Je),pr.push(Jn.yytext),Ee.push(Jn.yylloc),Pt.push(Vt[1]),Je=null,h0=Jn.yyleng,Oe=Jn.yytext,Ln=Jn.yylineno,al=Jn.yylloc;break;case 2:if(dn=this.productions_[Vt[1]][1],fr.$=pr[pr.length-dn],fr._$={first_line:Ee[Ee.length-(dn||1)].first_line,last_line:Ee[Ee.length-1].last_line,first_column:Ee[Ee.length-(dn||1)].first_column,last_column:Ee[Ee.length-1].last_column},xu&&(fr._$.range=[Ee[Ee.length-(dn||1)].range[0],Ee[Ee.length-1].range[1]]),dr=this.performAction.apply(fr,[Oe,h0,Ln,il.yy,Vt[1],pr,Ee].concat(Qv)),typeof dr<"u")return dr;dn&&(Pt=Pt.slice(0,-1*dn*2),pr=pr.slice(0,-1*dn),Ee=Ee.slice(0,-1*dn)),Pt.push(this.productions_[Vt[1]][0]),pr.push(fr.$),Ee.push(fr._$),vi=Di[Pt[Pt.length-2]][Pt[Pt.length-1]],Pt.push(vi);break;case 3:return!0}}return!0},"parse")},ps=(function(){var li={EOF:1,parseError:x(function(yt,Pt){if(this.yy.parser)this.yy.parser.parseError(yt,Pt);else throw new Error(yt)},"parseError"),setInput:x(function(Bt,yt){return this.yy=yt||this.yy||{},this._input=Bt,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:x(function(){var Bt=this._input[0];this.yytext+=Bt,this.yyleng++,this.offset++,this.match+=Bt,this.matched+=Bt;var yt=Bt.match(/(?:\r\n?|\n).*/g);return yt?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),Bt},"input"),unput:x(function(Bt){var yt=Bt.length,Pt=Bt.split(/(?:\r\n?|\n)/g);this._input=Bt+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-yt),this.offset-=yt;var Ct=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),Pt.length-1&&(this.yylineno-=Pt.length-1);var pr=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:Pt?(Pt.length===Ct.length?this.yylloc.first_column:0)+Ct[Ct.length-Pt.length].length-Pt[0].length:this.yylloc.first_column-yt},this.options.ranges&&(this.yylloc.range=[pr[0],pr[0]+this.yyleng-yt]),this.yyleng=this.yytext.length,this},"unput"),more:x(function(){return this._more=!0,this},"more"),reject:x(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). -`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:x(function(Bt){this.unput(this.match.slice(Bt))},"less"),pastInput:x(function(){var Bt=this.matched.substr(0,this.matched.length-this.match.length);return(Bt.length>20?"...":"")+Bt.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:x(function(){var Bt=this.match;return Bt.length<20&&(Bt+=this._input.substr(0,20-Bt.length)),(Bt.substr(0,20)+(Bt.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:x(function(){var Bt=this.pastInput(),yt=new Array(Bt.length+1).join("-");return Bt+this.upcomingInput()+` -`+yt+"^"},"showPosition"),test_match:x(function(Bt,yt){var Pt,Ct,pr;if(this.options.backtrack_lexer&&(pr={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&&(pr.yylloc.range=this.yylloc.range.slice(0))),Ct=Bt[0].match(/(?:\r\n?|\n).*/g),Ct&&(this.yylineno+=Ct.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:Ct?Ct[Ct.length-1].length-Ct[Ct.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+Bt[0].length},this.yytext+=Bt[0],this.match+=Bt[0],this.matches=Bt,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(Bt[0].length),this.matched+=Bt[0],Pt=this.performAction.call(this,this.yy,this,yt,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),Pt)return Pt;if(this._backtrack){for(var Ee in pr)this[Ee]=pr[Ee];return!1}return!1},"test_match"),next:x(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var Bt,yt,Pt,Ct;this._more||(this.yytext="",this.match="");for(var pr=this._currentRules(),Ee=0;Eeyt[0].length)){if(yt=Pt,Ct=Ee,this.options.backtrack_lexer){if(Bt=this.test_match(Pt,pr[Ee]),Bt!==!1)return Bt;if(this._backtrack){yt=!1;continue}else return!1}else if(!this.options.flex)break}return yt?(Bt=this.test_match(yt,pr[Ct]),Bt!==!1?Bt:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var yt=this.next();return yt||this.lex()},"lex"),begin:x(function(yt){this.conditionStack.push(yt)},"begin"),popState:x(function(){var yt=this.conditionStack.length-1;return yt>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(yt){return yt=this.conditionStack.length-1-Math.abs(yt||0),yt>=0?this.conditionStack[yt]:"INITIAL"},"topState"),pushState:x(function(yt){this.begin(yt)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:x(function(yt,Pt,Ct,pr){switch(Ct){case 0:return this.begin("acc_title"),34;case 1:return this.popState(),"acc_title_value";case 2:return this.begin("acc_descr"),36;case 3:return this.popState(),"acc_descr_value";case 4:this.begin("acc_descr_multiline");break;case 5:this.popState();break;case 6:return"acc_descr_multiline_value";case 7:return this.pushState("shapeData"),Pt.yytext="",40;case 8:return this.pushState("shapeDataStr"),40;case 9:return this.popState(),40;case 10:const Ee=/\n\s*/g;return Pt.yytext=Pt.yytext.replace(Ee,"
    "),40;case 11:return 40;case 12:this.popState();break;case 13:this.begin("callbackname");break;case 14:this.popState();break;case 15:this.popState(),this.begin("callbackargs");break;case 16:return 95;case 17:this.popState();break;case 18:return 96;case 19:return"MD_STR";case 20:this.popState();break;case 21:this.begin("md_string");break;case 22:return"STR";case 23:this.popState();break;case 24:this.pushState("string");break;case 25:return 84;case 26:return 102;case 27:return 85;case 28:return 104;case 29:return 86;case 30:return 87;case 31:return 97;case 32:this.begin("click");break;case 33:this.popState();break;case 34:return 88;case 35:return yt.lex.firstGraph()&&this.begin("dir"),12;case 36:return yt.lex.firstGraph()&&this.begin("dir"),12;case 37:return yt.lex.firstGraph()&&this.begin("dir"),12;case 38:return 27;case 39:return 32;case 40:return 98;case 41:return 98;case 42:return 98;case 43:return 98;case 44:return this.popState(),13;case 45:return this.popState(),14;case 46:return this.popState(),14;case 47:return this.popState(),14;case 48:return this.popState(),14;case 49:return this.popState(),14;case 50:return this.popState(),14;case 51:return this.popState(),14;case 52:return this.popState(),14;case 53:return this.popState(),14;case 54:return this.popState(),14;case 55:return 121;case 56:return 122;case 57:return 123;case 58:return 124;case 59:return 125;case 60:return 78;case 61:return 105;case 62:return 111;case 63:return 46;case 64:return 60;case 65:return 44;case 66:return 8;case 67:return 106;case 68:return 115;case 69:return this.popState(),77;case 70:return this.pushState("edgeText"),75;case 71:return 119;case 72:return this.popState(),77;case 73:return this.pushState("thickEdgeText"),75;case 74:return 119;case 75:return this.popState(),77;case 76:return this.pushState("dottedEdgeText"),75;case 77:return 119;case 78:return 77;case 79:return this.popState(),53;case 80:return"TEXT";case 81:return this.pushState("ellipseText"),52;case 82:return this.popState(),55;case 83:return this.pushState("text"),54;case 84:return this.popState(),57;case 85:return this.pushState("text"),56;case 86:return 58;case 87:return this.pushState("text"),67;case 88:return this.popState(),64;case 89:return this.pushState("text"),63;case 90:return this.popState(),49;case 91:return this.pushState("text"),48;case 92:return this.popState(),69;case 93:return this.popState(),71;case 94:return 117;case 95:return this.pushState("trapText"),68;case 96:return this.pushState("trapText"),70;case 97:return 118;case 98:return 67;case 99:return 90;case 100:return"SEP";case 101:return 89;case 102:return 115;case 103:return 111;case 104:return 44;case 105:return 109;case 106:return 114;case 107:return 116;case 108:return this.popState(),62;case 109:return this.pushState("text"),62;case 110:return this.popState(),51;case 111:return this.pushState("text"),50;case 112:return this.popState(),31;case 113:return this.pushState("text"),29;case 114:return this.popState(),66;case 115:return this.pushState("text"),65;case 116:return"TEXT";case 117:return"QUOTE";case 118:return 9;case 119:return 10;case 120: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]*)/,/^(?:.*direction\s+TD[^\n]*)/,/^(?:[^\s\"]+@(?=[^\{\"]))/,/^(?:[0-9]+)/,/^(?:#)/,/^(?::::)/,/^(?::)/,/^(?:&)/,/^(?:;)/,/^(?:,)/,/^(?:\*)/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?--\s*)/,/^(?:[^-]|-(?!-)+)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?==\s*)/,/^(?:[^=]|=(?!))/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?:\s*[xo<]?-\.\s*)/,/^(?:[^\.]|\.(?!))/,/^(?:\s*~~[\~]+\s*)/,/^(?:[-/\)][\)])/,/^(?:[^\(\)\[\]\{\}]|!\)+)/,/^(?:\(-)/,/^(?:\]\))/,/^(?:\(\[)/,/^(?:\]\])/,/^(?:\[\[)/,/^(?:\[\|)/,/^(?:>)/,/^(?:\)\])/,/^(?:\[\()/,/^(?:\)\)\))/,/^(?:\(\(\()/,/^(?:[\\(?=\])][\]])/,/^(?:\/(?=\])\])/,/^(?:\/(?!\])|\\(?!\])|[^\\\[\]\(\)\{\}\/]+)/,/^(?:\[\/)/,/^(?:\[\\)/,/^(?:<)/,/^(?:>)/,/^(?:\^)/,/^(?:\\\|)/,/^(?:v\b)/,/^(?:\*)/,/^(?:#)/,/^(?:&)/,/^(?:([A-Za-z0-9!"\#$%&'*+\.`?\\_\/]|-(?=[^\>\-\.])|(?!))+)/,/^(?:-)/,/^(?:[\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6]|[\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377]|[\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5]|[\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA]|[\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE]|[\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA]|[\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A]|[\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39]|[\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8]|[\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C]|[\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C]|[\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99]|[\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0]|[\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1]|[\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81]|[\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3]|[\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6]|[\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A]|[\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081]|[\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D]|[\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0]|[\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310]|[\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC]|[\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D]|[\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D]|[\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3]|[\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F]|[\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128]|[\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184]|[\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3]|[\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6]|[\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE]|[\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B]|[\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788]|[\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805]|[\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5]|[\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4]|[\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E]|[\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D]|[\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36]|[\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D]|[\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC]|[\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF]|[\uFFD2-\uFFD7\uFFDA-\uFFDC])/,/^(?:\|)/,/^(?:\|)/,/^(?:\))/,/^(?:\()/,/^(?:\])/,/^(?:\[)/,/^(?:(\}))/,/^(?:\{)/,/^(?:[^\[\]\(\)\{\}\|\"]+)/,/^(?:")/,/^(?:(\r?\n)+)/,/^(?:\s)/,/^(?:$)/],conditions:{shapeDataEndBracket:{rules:[21,24,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},shapeDataStr:{rules:[9,10,21,24,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},shapeData:{rules:[8,11,12,21,24,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},callbackargs:{rules:[17,18,21,24,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},callbackname:{rules:[14,15,16,21,24,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},href:{rules:[21,24,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},click:{rules:[21,24,33,34,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},dottedEdgeText:{rules:[21,24,75,77,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},thickEdgeText:{rules:[21,24,72,74,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},edgeText:{rules:[21,24,69,71,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},trapText:{rules:[21,24,78,81,83,85,89,91,92,93,94,95,96,109,111,113,115],inclusive:!1},ellipseText:{rules:[21,24,78,79,80,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},text:{rules:[21,24,78,81,82,83,84,85,88,89,90,91,95,96,108,109,110,111,112,113,114,115,116],inclusive:!1},vertex:{rules:[21,24,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},dir:{rules:[21,24,44,45,46,47,48,49,50,51,52,53,54,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},acc_descr_multiline:{rules:[5,6,21,24,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},acc_descr:{rules:[3,21,24,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},acc_title:{rules:[1,21,24,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},md_string:{rules:[19,20,21,24,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},string:{rules:[21,22,23,24,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},INITIAL:{rules:[0,2,4,7,13,21,24,25,26,27,28,29,30,31,32,35,36,37,38,39,40,41,42,43,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,72,73,75,76,78,81,83,85,86,87,89,91,95,96,97,98,99,100,101,102,103,104,105,106,107,109,111,113,115,117,118,119,120],inclusive:!0}}};return li})();Pa.lexer=ps;function gs(){this.yy={}}return x(gs,"Parser"),gs.prototype=Pa,Pa.Parser=gs,new gs})();bI.parser=bI;var Ite=bI,Dte=Object.assign({},Ite);Dte.parse=t=>{const e=t.replace(/}\s*\n/g,`} -`);return Ite.parse(e)};var JWe=Dte,eUe=x((t,e)=>{const r=g6,n=r(t,"r"),i=r(t,"g"),a=r(t,"b");return Ao(n,i,a,e)},"fade"),tUe=x(t=>`.label { +You have to call mermaid.initialize.`)}isLinkData(e){return e!==null&&typeof e=="object"&&"id"in e&&typeof e.id=="string"}addLink(e,r,n){const i=this.isLinkData(n)?n.id.replace("@",""):void 0;se.info("addLink",e,r,i);for(const a of e)for(const s of r){const o=a===e[e.length-1],l=s===r[0];o&&l?this.addSingleLink(a,s,n,i):this.addSingleLink(a,s,n,void 0)}}updateLinkInterpolate(e,r){e.forEach(n=>{n==="default"?this.edges.defaultInterpolate=r:this.edges[n].interpolate=r})}updateLink(e,r){e.forEach(n=>{var i,a,s,o,l,u;if(typeof n=="number"&&n>=this.edges.length)throw new Error(`The index ${n} for linkStyle is out of bounds. Valid indices for linkStyle are between 0 and ${this.edges.length-1}. (Help: Ensure that the index is within the range of existing edges.)`);n==="default"?this.edges.defaultStyle=r:(this.edges[n].style=r,(((a=(i=this.edges[n])==null?void 0:i.style)==null?void 0:a.length)??0)>0&&!((o=(s=this.edges[n])==null?void 0:s.style)!=null&&o.some(h=>h==null?void 0:h.startsWith("fill")))&&((u=(l=this.edges[n])==null?void 0:l.style)==null||u.push("fill:none")))})}addClass(e,r){const n=r.join().replace(/\\,/g,"§§§").replace(/,/g,";").replace(/§§§/g,",").split(";");e.split(",").forEach(i=>{let a=this.classes.get(i);a===void 0&&(a={id:i,styles:[],textStyles:[]},this.classes.set(i,a)),n!=null&&n.forEach(s=>{if(/color/.exec(s)){const o=s.replace("fill","bgFill");a.textStyles.push(o)}a.styles.push(s)})})}setDirection(e){this.direction=e.trim(),/.*/.exec(this.direction)&&(this.direction="LR"),/.*v/.exec(this.direction)&&(this.direction="TB"),this.direction==="TD"&&(this.direction="TB")}setClass(e,r){for(const n of e.split(",")){const i=this.vertices.get(n);i&&i.classes.push(r);const a=this.edges.find(o=>o.id===n);a&&a.classes.push(r);const s=this.subGraphLookup.get(n);s&&s.classes.push(r)}}setTooltip(e,r){if(r!==void 0){r=this.sanitizeText(r);for(const n of e.split(","))this.tooltips.set(this.version==="gen-1"?this.lookUpDomId(n):n,r)}}setClickFun(e,r,n){if(Pe().securityLevel!=="loose"||r===void 0)return;let i=[];if(typeof n=="string"){i=n.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let s=0;s{const s=this.lookUpDomId(e),o=document.querySelector(`[id="${s}"]`);o!==null&&o.addEventListener("click",()=>{Pr.runFunc(r,...i)},!1)}))}setLink(e,r,n){e.split(",").forEach(i=>{const a=this.vertices.get(i);a!==void 0&&(a.link=Pr.formatUrl(r,this.config),a.linkTarget=n)}),this.setClass(e,"clickable")}getTooltip(e){return this.tooltips.get(e)}setClickEvent(e,r,n){e.split(",").forEach(i=>{this.setClickFun(i,r,n)}),this.setClass(e,"clickable")}bindFunctions(e){this.funs.forEach(r=>{r(e)})}getDirection(){var e;return(e=this.direction)==null?void 0:e.trim()}getVertices(){return this.vertices}getEdges(){return this.edges}getClasses(){return this.classes}setupToolTips(e){const r=Ple();gt(e).select("svg").selectAll("g.node").on("mouseover",a=>{var u;const s=gt(a.currentTarget),o=s.attr("title");if(o===null)return;const l=(u=a.currentTarget)==null?void 0:u.getBoundingClientRect();r.transition().duration(200).style("opacity",".9"),r.text(s.attr("title")).style("left",window.scrollX+l.left+(l.right-l.left)/2+"px").style("top",window.scrollY+l.bottom+"px"),r.html(Ch.sanitize(o)),s.classed("hover",!0)}).on("mouseout",a=>{r.transition().duration(500).style("opacity",0),gt(a.currentTarget).classed("hover",!1)})}clear(e="gen-2"){this.vertices=new Map,this.classes=new Map,this.edges=[],this.funs=[this.setupToolTips.bind(this)],this.diagramId="",this.subGraphs=[],this.subGraphLookup=new Map,this.subCount=0,this.tooltips=new Map,this.firstGraphFlag=!0,this.version=e,this.config=Pe(),Hn()}setGen(e){this.version=e||"gen-2"}defaultStyle(){return"fill:#ffa;stroke: #f66; stroke-width: 3px; stroke-dasharray: 5, 5;fill:#ffa;stroke: #666;"}addSubGraph(e,r,n){let i=e.text.trim(),a=n.text;e===n&&/\s/.exec(n.text)&&(i=void 0);const o=T(f=>{const p={boolean:{},number:{},string:{}},g=[];let m;return{nodeList:f.filter(function(v){const x=typeof v;return v.stmt&&v.stmt==="dir"?(m=v.value,!1):v.trim()===""?!1:x in p?p[x].hasOwnProperty(v)?!1:p[x][v]=!0:g.includes(v)?!1:g.push(v)}),dir:m}},"uniq")(r.flat()),l=o.nodeList;let u=o.dir;const h=Pe().flowchart??{};if(u=u??(h.inheritDir?this.getDirection()??Pe().direction??void 0:void 0),this.version==="gen-1")for(let f=0;f2e3)return{result:!1,count:0};if(this.posCrossRef[this.secCount]=r,this.subGraphs[r].id===e)return{result:!0,count:0};let i=0,a=1;for(;i=0){const o=this.indexNodes2(e,s);if(o.result)return{result:!0,count:a+o.count};a=a+o.count}i=i+1}return{result:!1,count:a}}getDepthFirstPos(e){return this.posCrossRef[e]}indexNodes(){this.secCount=-1,this.subGraphs.length>0&&this.indexNodes2("none",this.subGraphs.length-1)}getSubGraphs(){return this.subGraphs}firstGraph(){return this.firstGraphFlag?(this.firstGraphFlag=!1,!0):!1}destructStartLink(e){let r=e.trim(),n="arrow_open";switch(r[0]){case"<":n="arrow_point",r=r.slice(1);break;case"x":n="arrow_cross",r=r.slice(1);break;case"o":n="arrow_circle",r=r.slice(1);break}let i="normal";return r.includes("=")&&(i="thick"),r.includes(".")&&(i="dotted"),{type:n,stroke:i}}countChar(e,r){const n=r.length;let i=0;for(let a=0;a":i="arrow_point",r.startsWith("<")&&(i="double_"+i,n=n.slice(1));break;case"o":i="arrow_circle",r.startsWith("o")&&(i="double_"+i,n=n.slice(1));break}let a="normal",s=n.length-1;n.startsWith("=")&&(a="thick"),n.startsWith("~")&&(a="invisible");const o=this.countChar(".",n);return o&&(a="dotted",s=o),{type:i,stroke:a,length:s}}destructLink(e,r){const n=this.destructEndLink(e);let i;if(r){if(i=this.destructStartLink(r),i.stroke!==n.stroke)return{type:"INVALID",stroke:"INVALID"};if(i.type==="arrow_open")i.type=n.type;else{if(i.type!==n.type)return{type:"INVALID",stroke:"INVALID"};i.type="double_"+i.type}return i.type==="double_arrow"&&(i.type="double_arrow_point"),i.length=n.length,i}return n}exists(e,r){for(const n of e)if(n.nodes.includes(r))return!0;return!1}makeUniq(e,r){const n=[];return e.nodes.forEach((i,a)=>{this.exists(r,i)||n.push(e.nodes[a])}),{nodes:n}}getTypeFromVertex(e){if(e.img)return"imageSquare";if(e.icon)return e.form==="circle"?"iconCircle":e.form==="square"?"iconSquare":e.form==="rounded"?"iconRounded":"icon";switch(e.type){case"square":case void 0:return"squareRect";case"round":return"roundedRect";case"ellipse":return"ellipse";default:return e.type}}findNode(e,r){return e.find(n=>n.id===r)}destructEdgeType(e){let r="none",n="arrow_point";switch(e){case"arrow_point":case"arrow_circle":case"arrow_cross":n=e;break;case"double_arrow_point":case"double_arrow_circle":case"double_arrow_cross":r=e.replace("double_",""),n=r;break}return{arrowTypeStart:r,arrowTypeEnd:n}}addNodeFromVertex(e,r,n,i,a,s){var h;const o=n.get(e.id),l=i.get(e.id)??!1,u=this.findNode(r,e.id);if(u)u.cssStyles=e.styles,u.cssCompiledStyles=this.getCompiledStyles(e.classes),u.cssClasses=e.classes.join(" ");else{const d={id:e.id,label:e.text,labelType:e.labelType,labelStyle:"",parentId:o,padding:((h=a.flowchart)==null?void 0:h.padding)||8,cssStyles:e.styles,cssCompiledStyles:this.getCompiledStyles(["default","node",...e.classes]),cssClasses:"default "+e.classes.join(" "),dir:e.dir,domId:e.domId,look:s,link:e.link,linkTarget:e.linkTarget,tooltip:this.getTooltip(e.id),icon:e.icon,pos:e.pos,img:e.img,assetWidth:e.assetWidth,assetHeight:e.assetHeight,constraint:e.constraint};l?r.push({...d,isGroup:!0,shape:"rect"}):r.push({...d,isGroup:!1,shape:this.getTypeFromVertex(e)})}}getCompiledStyles(e){let r=[];for(const n of e){const i=this.classes.get(n);i!=null&&i.styles&&(r=[...r,...i.styles??[]].map(a=>a.trim())),i!=null&&i.textStyles&&(r=[...r,...i.textStyles??[]].map(a=>a.trim()))}return r}getData(){const e=Pe(),r=[],n=[],i=this.getSubGraphs(),a=new Map,s=new Map;for(let u=i.length-1;u>=0;u--){const h=i[u];h.nodes.length>0&&s.set(h.id,!0);for(const d of h.nodes)a.set(d,h.id)}for(let u=i.length-1;u>=0;u--){const h=i[u];r.push({id:h.id,label:h.title,labelStyle:"",labelType:h.labelType,parentId:a.get(h.id),padding:8,cssCompiledStyles:this.getCompiledStyles(h.classes),cssClasses:h.classes.join(" "),shape:"rect",dir:h.dir,isGroup:!0,look:e.look})}this.getVertices().forEach(u=>{this.addNodeFromVertex(u,r,a,s,e,e.look||"classic")});const l=this.getEdges();return l.forEach((u,h)=>{var m;const{arrowTypeStart:d,arrowTypeEnd:f}=this.destructEdgeType(u.type),p=[...l.defaultStyle??[]];u.style&&p.push(...u.style);const g={id:ag(u.start,u.end,{counter:h,prefix:"L"},u.id),isUserDefinedId:u.isUserDefinedId,start:u.start,end:u.end,type:u.type??"normal",label:u.text,labelType:u.labelType,labelpos:"c",thickness:u.stroke,minlen:u.length,classes:(u==null?void 0:u.stroke)==="invisible"?"":"edge-thickness-normal edge-pattern-solid flowchart-link",arrowTypeStart:(u==null?void 0:u.stroke)==="invisible"||(u==null?void 0:u.type)==="arrow_open"?"none":d,arrowTypeEnd:(u==null?void 0:u.stroke)==="invisible"||(u==null?void 0:u.type)==="arrow_open"?"none":f,arrowheadStyle:"fill: #333",cssCompiledStyles:this.getCompiledStyles(u.classes),labelStyle:p,style:p,pattern:u.stroke,look:e.look,animate:u.animate,animation:u.animation,curve:u.interpolate||this.edges.defaultInterpolate||((m=e.flowchart)==null?void 0:m.curve)};n.push(g)}),{nodes:r,edges:n,other:{},config:e}}defaultConfig(){return hV.flowchart}},T(uy,"FlowDB"),uy),Bet=T(function(t,e){return e.db.getClasses()},"getClasses"),Fet=T(async function(t,e,r,n){var d;se.info("REF0:"),se.info("Drawing state diagram (v2)",e);const{securityLevel:i,flowchart:a,layout:s}=Pe();n.db.setDiagramId(e),se.debug("Before getData: ");const o=n.db.getData();se.debug("Data: ",o);const l=_m(e,i),u=n.db.getDirection();o.type=n.type,o.layoutAlgorithm=Fx(s),o.layoutAlgorithm==="dagre"&&s==="elk"&&se.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."),o.direction=u,o.nodeSpacing=(a==null?void 0:a.nodeSpacing)||50,o.rankSpacing=(a==null?void 0:a.rankSpacing)||50,o.markers=["point","circle","cross"],o.diagramId=e,se.debug("REF1:",o),await fg(o,l);const h=((d=o.config.flowchart)==null?void 0:d.diagramPadding)??8;Pr.insertTitle(l,"flowchartTitleText",(a==null?void 0:a.titleTopMargin)||0,n.db.getDiagramTitle()),op(l,h,"flowchart",(a==null?void 0:a.useMaxWidth)||!1)},"draw"),zet={getClasses:Bet,draw:Fet},XN=(function(){var t=T(function(Ri,qt,vt,Gt){for(vt=vt||{},Gt=Ri.length;Gt--;vt[Ri[Gt]]=qt);return vt},"o"),e=[1,4],r=[1,3],n=[1,5],i=[1,8,9,10,11,27,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124,125],a=[2,2],s=[1,13],o=[1,14],l=[1,15],u=[1,16],h=[1,23],d=[1,25],f=[1,26],p=[1,27],g=[1,50],m=[1,49],y=[1,29],v=[1,30],x=[1,31],b=[1,32],w=[1,33],C=[1,45],_=[1,47],k=[1,43],S=[1,48],L=[1,44],$=[1,51],I=[1,46],z=[1,52],F=[1,53],A=[1,34],R=[1,35],N=[1,36],M=[1,37],D=[1,38],O=[1,58],B=[1,8,9,10,11,27,32,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124,125],P=[1,62],G=[1,61],V=[1,63],H=[8,9,11,75,77,78],W=[1,79],ie=[1,92],j=[1,97],ae=[1,96],J=[1,93],K=[1,89],Q=[1,95],re=[1,91],le=[1,98],fe=[1,94],Ae=[1,99],Se=[1,90],Ne=[8,9,10,11,40,75,77,78],ge=[8,9,10,11,40,46,75,77,78],ve=[8,9,10,11,29,40,44,46,48,50,52,54,56,58,60,63,65,67,68,70,75,77,78,89,102,105,106,109,111,114,115,116],ze=[8,9,11,44,60,75,77,78,89,102,105,106,109,111,114,115,116],xe=[44,60,89,102,105,106,109,111,114,115,116],Ke=[1,122],Ce=[1,123],Ve=[1,125],Qe=[1,124],nt=[44,60,62,74,89,102,105,106,109,111,114,115,116],tt=[1,134],Ze=[1,148],ke=[1,149],_e=[1,150],Y=[1,151],he=[1,136],Z=[1,138],pe=[1,142],ne=[1,143],Be=[1,144],Te=[1,145],Ue=[1,146],De=[1,147],qe=[1,152],Le=[1,153],Xe=[1,132],Ie=[1,133],it=[1,140],we=[1,135],ct=[1,139],be=[1,137],_t=[8,9,10,11,27,32,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124,125],bt=[1,155],lt=[1,157],Mt=[8,9,11],Tt=[8,9,10,11,14,44,60,89,105,106,109,111,114,115,116],dt=[1,177],oe=[1,173],Rt=[1,174],ft=[1,178],ht=[1,175],kt=[1,176],qr=[77,116,119],ye=[8,9,10,11,12,14,27,29,32,44,60,75,84,85,86,87,88,89,90,105,109,111,114,115,116],et=[10,106],ut=[31,49,51,53,55,57,62,64,66,67,69,71,116,117,118],Lt=[1,248],Vt=[1,246],lr=[1,250],cr=[1,244],$r=[1,245],dr=[1,247],Or=[1,249],ir=[1,251],Vr=[1,269],Sn=[8,9,11,106],Ur=[8,9,10,11,60,84,105,106,109,110,111,112],us={trace:T(function(){},"trace"),yy:{},symbols_:{error:2,start:3,graphConfig:4,document:5,line:6,statement:7,SEMI:8,NEWLINE:9,SPACE:10,EOF:11,GRAPH:12,NODIR:13,DIR:14,FirstStmtSeparator:15,ending:16,endToken:17,spaceList:18,spaceListNewline:19,vertexStatement:20,separator:21,styleStatement:22,linkStyleStatement:23,classDefStatement:24,classStatement:25,clickStatement:26,subgraph:27,textNoTags:28,SQS:29,text:30,SQE:31,end:32,direction:33,acc_title:34,acc_title_value:35,acc_descr:36,acc_descr_value:37,acc_descr_multiline_value:38,shapeData:39,SHAPE_DATA:40,link:41,node:42,styledVertex:43,AMP:44,vertex:45,STYLE_SEPARATOR:46,idString:47,DOUBLECIRCLESTART:48,DOUBLECIRCLEEND:49,PS:50,PE:51,"(-":52,"-)":53,STADIUMSTART:54,STADIUMEND:55,SUBROUTINESTART:56,SUBROUTINEEND:57,VERTEX_WITH_PROPS_START:58,"NODE_STRING[field]":59,COLON:60,"NODE_STRING[value]":61,PIPE:62,CYLINDERSTART:63,CYLINDEREND:64,DIAMOND_START:65,DIAMOND_STOP:66,TAGEND:67,TRAPSTART:68,TRAPEND:69,INVTRAPSTART:70,INVTRAPEND:71,linkStatement:72,arrowText:73,TESTSTR:74,START_LINK:75,edgeText:76,LINK:77,LINK_ID:78,edgeTextToken:79,STR:80,MD_STR:81,textToken:82,keywords:83,STYLE:84,LINKSTYLE:85,CLASSDEF:86,CLASS:87,CLICK:88,DOWN:89,UP:90,textNoTagsToken:91,stylesOpt:92,"idString[vertex]":93,"idString[class]":94,CALLBACKNAME:95,CALLBACKARGS:96,HREF:97,LINK_TARGET:98,"STR[link]":99,"STR[tooltip]":100,alphaNum:101,DEFAULT:102,numList:103,INTERPOLATE:104,NUM:105,COMMA:106,style:107,styleComponent:108,NODE_STRING:109,UNIT:110,BRKT:111,PCT:112,idStringToken:113,MINUS:114,MULT:115,UNICODE_TEXT:116,TEXT:117,TAGSTART:118,EDGE_TEXT:119,alphaNumToken:120,direction_tb:121,direction_bt:122,direction_rl:123,direction_lr:124,direction_td:125,$accept:0,$end:1},terminals_:{2:"error",8:"SEMI",9:"NEWLINE",10:"SPACE",11:"EOF",12:"GRAPH",13:"NODIR",14:"DIR",27:"subgraph",29:"SQS",31:"SQE",32:"end",34:"acc_title",35:"acc_title_value",36:"acc_descr",37:"acc_descr_value",38:"acc_descr_multiline_value",40:"SHAPE_DATA",44:"AMP",46:"STYLE_SEPARATOR",48:"DOUBLECIRCLESTART",49:"DOUBLECIRCLEEND",50:"PS",51:"PE",52:"(-",53:"-)",54:"STADIUMSTART",55:"STADIUMEND",56:"SUBROUTINESTART",57:"SUBROUTINEEND",58:"VERTEX_WITH_PROPS_START",59:"NODE_STRING[field]",60:"COLON",61:"NODE_STRING[value]",62:"PIPE",63:"CYLINDERSTART",64:"CYLINDEREND",65:"DIAMOND_START",66:"DIAMOND_STOP",67:"TAGEND",68:"TRAPSTART",69:"TRAPEND",70:"INVTRAPSTART",71:"INVTRAPEND",74:"TESTSTR",75:"START_LINK",77:"LINK",78:"LINK_ID",80:"STR",81:"MD_STR",84:"STYLE",85:"LINKSTYLE",86:"CLASSDEF",87:"CLASS",88:"CLICK",89:"DOWN",90:"UP",93:"idString[vertex]",94:"idString[class]",95:"CALLBACKNAME",96:"CALLBACKARGS",97:"HREF",98:"LINK_TARGET",99:"STR[link]",100:"STR[tooltip]",102:"DEFAULT",104:"INTERPOLATE",105:"NUM",106:"COMMA",109:"NODE_STRING",110:"UNIT",111:"BRKT",112:"PCT",114:"MINUS",115:"MULT",116:"UNICODE_TEXT",117:"TEXT",118:"TAGSTART",119:"EDGE_TEXT",121:"direction_tb",122:"direction_bt",123:"direction_rl",124:"direction_lr",125:"direction_td"},productions_:[0,[3,2],[5,0],[5,2],[6,1],[6,1],[6,1],[6,1],[6,1],[4,2],[4,2],[4,2],[4,3],[16,2],[16,1],[17,1],[17,1],[17,1],[15,1],[15,1],[15,2],[19,2],[19,2],[19,1],[19,1],[18,2],[18,1],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,9],[7,6],[7,4],[7,1],[7,2],[7,2],[7,1],[21,1],[21,1],[21,1],[39,2],[39,1],[20,4],[20,3],[20,4],[20,2],[20,2],[20,1],[42,1],[42,6],[42,5],[43,1],[43,3],[45,4],[45,4],[45,6],[45,4],[45,4],[45,4],[45,8],[45,4],[45,4],[45,4],[45,6],[45,4],[45,4],[45,4],[45,4],[45,4],[45,1],[41,2],[41,3],[41,3],[41,1],[41,3],[41,4],[76,1],[76,2],[76,1],[76,1],[72,1],[72,2],[73,3],[30,1],[30,2],[30,1],[30,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[28,1],[28,2],[28,1],[28,1],[24,5],[25,5],[26,2],[26,4],[26,3],[26,5],[26,3],[26,5],[26,5],[26,7],[26,2],[26,4],[26,2],[26,4],[26,4],[26,6],[22,5],[23,5],[23,5],[23,9],[23,9],[23,7],[23,7],[103,1],[103,3],[92,1],[92,3],[107,1],[107,2],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[82,1],[82,1],[82,1],[82,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[79,1],[79,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[47,1],[47,2],[101,1],[101,2],[33,1],[33,1],[33,1],[33,1],[33,1]],performAction:T(function(qt,vt,Gt,Et,xr,Ee,ta){var $e=Ee.length-1;switch(xr){case 2:this.$=[];break;case 3:(!Array.isArray(Ee[$e])||Ee[$e].length>0)&&Ee[$e-1].push(Ee[$e]),this.$=Ee[$e-1];break;case 4:case 183:this.$=Ee[$e];break;case 11:Et.setDirection("TB"),this.$="TB";break;case 12:Et.setDirection(Ee[$e-1]),this.$=Ee[$e-1];break;case 27:this.$=Ee[$e-1].nodes;break;case 28:case 29:case 30:case 31:case 32:this.$=[];break;case 33:this.$=Et.addSubGraph(Ee[$e-6],Ee[$e-1],Ee[$e-4]);break;case 34:this.$=Et.addSubGraph(Ee[$e-3],Ee[$e-1],Ee[$e-3]);break;case 35:this.$=Et.addSubGraph(void 0,Ee[$e-1],void 0);break;case 37:this.$=Ee[$e].trim(),Et.setAccTitle(this.$);break;case 38:case 39:this.$=Ee[$e].trim(),Et.setAccDescription(this.$);break;case 43:this.$=Ee[$e-1]+Ee[$e];break;case 44:this.$=Ee[$e];break;case 45:Et.addVertex(Ee[$e-1][Ee[$e-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,Ee[$e]),Et.addLink(Ee[$e-3].stmt,Ee[$e-1],Ee[$e-2]),this.$={stmt:Ee[$e-1],nodes:Ee[$e-1].concat(Ee[$e-3].nodes)};break;case 46:Et.addLink(Ee[$e-2].stmt,Ee[$e],Ee[$e-1]),this.$={stmt:Ee[$e],nodes:Ee[$e].concat(Ee[$e-2].nodes)};break;case 47:Et.addLink(Ee[$e-3].stmt,Ee[$e-1],Ee[$e-2]),this.$={stmt:Ee[$e-1],nodes:Ee[$e-1].concat(Ee[$e-3].nodes)};break;case 48:this.$={stmt:Ee[$e-1],nodes:Ee[$e-1]};break;case 49:Et.addVertex(Ee[$e-1][Ee[$e-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,Ee[$e]),this.$={stmt:Ee[$e-1],nodes:Ee[$e-1],shapeData:Ee[$e]};break;case 50:this.$={stmt:Ee[$e],nodes:Ee[$e]};break;case 51:this.$=[Ee[$e]];break;case 52:Et.addVertex(Ee[$e-5][Ee[$e-5].length-1],void 0,void 0,void 0,void 0,void 0,void 0,Ee[$e-4]),this.$=Ee[$e-5].concat(Ee[$e]);break;case 53:this.$=Ee[$e-4].concat(Ee[$e]);break;case 54:this.$=Ee[$e];break;case 55:this.$=Ee[$e-2],Et.setClass(Ee[$e-2],Ee[$e]);break;case 56:this.$=Ee[$e-3],Et.addVertex(Ee[$e-3],Ee[$e-1],"square");break;case 57:this.$=Ee[$e-3],Et.addVertex(Ee[$e-3],Ee[$e-1],"doublecircle");break;case 58:this.$=Ee[$e-5],Et.addVertex(Ee[$e-5],Ee[$e-2],"circle");break;case 59:this.$=Ee[$e-3],Et.addVertex(Ee[$e-3],Ee[$e-1],"ellipse");break;case 60:this.$=Ee[$e-3],Et.addVertex(Ee[$e-3],Ee[$e-1],"stadium");break;case 61:this.$=Ee[$e-3],Et.addVertex(Ee[$e-3],Ee[$e-1],"subroutine");break;case 62:this.$=Ee[$e-7],Et.addVertex(Ee[$e-7],Ee[$e-1],"rect",void 0,void 0,void 0,Object.fromEntries([[Ee[$e-5],Ee[$e-3]]]));break;case 63:this.$=Ee[$e-3],Et.addVertex(Ee[$e-3],Ee[$e-1],"cylinder");break;case 64:this.$=Ee[$e-3],Et.addVertex(Ee[$e-3],Ee[$e-1],"round");break;case 65:this.$=Ee[$e-3],Et.addVertex(Ee[$e-3],Ee[$e-1],"diamond");break;case 66:this.$=Ee[$e-5],Et.addVertex(Ee[$e-5],Ee[$e-2],"hexagon");break;case 67:this.$=Ee[$e-3],Et.addVertex(Ee[$e-3],Ee[$e-1],"odd");break;case 68:this.$=Ee[$e-3],Et.addVertex(Ee[$e-3],Ee[$e-1],"trapezoid");break;case 69:this.$=Ee[$e-3],Et.addVertex(Ee[$e-3],Ee[$e-1],"inv_trapezoid");break;case 70:this.$=Ee[$e-3],Et.addVertex(Ee[$e-3],Ee[$e-1],"lean_right");break;case 71:this.$=Ee[$e-3],Et.addVertex(Ee[$e-3],Ee[$e-1],"lean_left");break;case 72:this.$=Ee[$e],Et.addVertex(Ee[$e]);break;case 73:Ee[$e-1].text=Ee[$e],this.$=Ee[$e-1];break;case 74:case 75:Ee[$e-2].text=Ee[$e-1],this.$=Ee[$e-2];break;case 76:this.$=Ee[$e];break;case 77:var Un=Et.destructLink(Ee[$e],Ee[$e-2]);this.$={type:Un.type,stroke:Un.stroke,length:Un.length,text:Ee[$e-1]};break;case 78:var Un=Et.destructLink(Ee[$e],Ee[$e-2]);this.$={type:Un.type,stroke:Un.stroke,length:Un.length,text:Ee[$e-1],id:Ee[$e-3]};break;case 79:this.$={text:Ee[$e],type:"text"};break;case 80:this.$={text:Ee[$e-1].text+""+Ee[$e],type:Ee[$e-1].type};break;case 81:this.$={text:Ee[$e],type:"string"};break;case 82:this.$={text:Ee[$e],type:"markdown"};break;case 83:var Un=Et.destructLink(Ee[$e]);this.$={type:Un.type,stroke:Un.stroke,length:Un.length};break;case 84:var Un=Et.destructLink(Ee[$e]);this.$={type:Un.type,stroke:Un.stroke,length:Un.length,id:Ee[$e-1]};break;case 85:this.$=Ee[$e-1];break;case 86:this.$={text:Ee[$e],type:"text"};break;case 87:this.$={text:Ee[$e-1].text+""+Ee[$e],type:Ee[$e-1].type};break;case 88:this.$={text:Ee[$e],type:"string"};break;case 89:case 104:this.$={text:Ee[$e],type:"markdown"};break;case 101:this.$={text:Ee[$e],type:"text"};break;case 102:this.$={text:Ee[$e-1].text+""+Ee[$e],type:Ee[$e-1].type};break;case 103:this.$={text:Ee[$e],type:"text"};break;case 105:this.$=Ee[$e-4],Et.addClass(Ee[$e-2],Ee[$e]);break;case 106:this.$=Ee[$e-4],Et.setClass(Ee[$e-2],Ee[$e]);break;case 107:case 115:this.$=Ee[$e-1],Et.setClickEvent(Ee[$e-1],Ee[$e]);break;case 108:case 116:this.$=Ee[$e-3],Et.setClickEvent(Ee[$e-3],Ee[$e-2]),Et.setTooltip(Ee[$e-3],Ee[$e]);break;case 109:this.$=Ee[$e-2],Et.setClickEvent(Ee[$e-2],Ee[$e-1],Ee[$e]);break;case 110:this.$=Ee[$e-4],Et.setClickEvent(Ee[$e-4],Ee[$e-3],Ee[$e-2]),Et.setTooltip(Ee[$e-4],Ee[$e]);break;case 111:this.$=Ee[$e-2],Et.setLink(Ee[$e-2],Ee[$e]);break;case 112:this.$=Ee[$e-4],Et.setLink(Ee[$e-4],Ee[$e-2]),Et.setTooltip(Ee[$e-4],Ee[$e]);break;case 113:this.$=Ee[$e-4],Et.setLink(Ee[$e-4],Ee[$e-2],Ee[$e]);break;case 114:this.$=Ee[$e-6],Et.setLink(Ee[$e-6],Ee[$e-4],Ee[$e]),Et.setTooltip(Ee[$e-6],Ee[$e-2]);break;case 117:this.$=Ee[$e-1],Et.setLink(Ee[$e-1],Ee[$e]);break;case 118:this.$=Ee[$e-3],Et.setLink(Ee[$e-3],Ee[$e-2]),Et.setTooltip(Ee[$e-3],Ee[$e]);break;case 119:this.$=Ee[$e-3],Et.setLink(Ee[$e-3],Ee[$e-2],Ee[$e]);break;case 120:this.$=Ee[$e-5],Et.setLink(Ee[$e-5],Ee[$e-4],Ee[$e]),Et.setTooltip(Ee[$e-5],Ee[$e-2]);break;case 121:this.$=Ee[$e-4],Et.addVertex(Ee[$e-2],void 0,void 0,Ee[$e]);break;case 122:this.$=Ee[$e-4],Et.updateLink([Ee[$e-2]],Ee[$e]);break;case 123:this.$=Ee[$e-4],Et.updateLink(Ee[$e-2],Ee[$e]);break;case 124:this.$=Ee[$e-8],Et.updateLinkInterpolate([Ee[$e-6]],Ee[$e-2]),Et.updateLink([Ee[$e-6]],Ee[$e]);break;case 125:this.$=Ee[$e-8],Et.updateLinkInterpolate(Ee[$e-6],Ee[$e-2]),Et.updateLink(Ee[$e-6],Ee[$e]);break;case 126:this.$=Ee[$e-6],Et.updateLinkInterpolate([Ee[$e-4]],Ee[$e]);break;case 127:this.$=Ee[$e-6],Et.updateLinkInterpolate(Ee[$e-4],Ee[$e]);break;case 128:case 130:this.$=[Ee[$e]];break;case 129:case 131:Ee[$e-2].push(Ee[$e]),this.$=Ee[$e-2];break;case 133:this.$=Ee[$e-1]+Ee[$e];break;case 181:this.$=Ee[$e];break;case 182:this.$=Ee[$e-1]+""+Ee[$e];break;case 184:this.$=Ee[$e-1]+""+Ee[$e];break;case 185:this.$={stmt:"dir",value:"TB"};break;case 186:this.$={stmt:"dir",value:"BT"};break;case 187:this.$={stmt:"dir",value:"RL"};break;case 188:this.$={stmt:"dir",value:"LR"};break;case 189:this.$={stmt:"dir",value:"TD"};break}},"anonymous"),table:[{3:1,4:2,9:e,10:r,12:n},{1:[3]},t(i,a,{5:6}),{4:7,9:e,10:r,12:n},{4:8,9:e,10:r,12:n},{13:[1,9],14:[1,10]},{1:[2,1],6:11,7:12,8:s,9:o,10:l,11:u,20:17,22:18,23:19,24:20,25:21,26:22,27:h,33:24,34:d,36:f,38:p,42:28,43:39,44:g,45:40,47:41,60:m,84:y,85:v,86:x,87:b,88:w,89:C,102:_,105:k,106:S,109:L,111:$,113:42,114:I,115:z,116:F,121:A,122:R,123:N,124:M,125:D},t(i,[2,9]),t(i,[2,10]),t(i,[2,11]),{8:[1,55],9:[1,56],10:O,15:54,18:57},t(B,[2,3]),t(B,[2,4]),t(B,[2,5]),t(B,[2,6]),t(B,[2,7]),t(B,[2,8]),{8:P,9:G,11:V,21:59,41:60,72:64,75:[1,65],77:[1,67],78:[1,66]},{8:P,9:G,11:V,21:68},{8:P,9:G,11:V,21:69},{8:P,9:G,11:V,21:70},{8:P,9:G,11:V,21:71},{8:P,9:G,11:V,21:72},{8:P,9:G,10:[1,73],11:V,21:74},t(B,[2,36]),{35:[1,75]},{37:[1,76]},t(B,[2,39]),t(H,[2,50],{18:77,39:78,10:O,40:W}),{10:[1,80]},{10:[1,81]},{10:[1,82]},{10:[1,83]},{14:ie,44:j,60:ae,80:[1,87],89:J,95:[1,84],97:[1,85],101:86,105:K,106:Q,109:re,111:le,114:fe,115:Ae,116:Se,120:88},t(B,[2,185]),t(B,[2,186]),t(B,[2,187]),t(B,[2,188]),t(B,[2,189]),t(Ne,[2,51]),t(Ne,[2,54],{46:[1,100]}),t(ge,[2,72],{113:113,29:[1,101],44:g,48:[1,102],50:[1,103],52:[1,104],54:[1,105],56:[1,106],58:[1,107],60:m,63:[1,108],65:[1,109],67:[1,110],68:[1,111],70:[1,112],89:C,102:_,105:k,106:S,109:L,111:$,114:I,115:z,116:F}),t(ve,[2,181]),t(ve,[2,142]),t(ve,[2,143]),t(ve,[2,144]),t(ve,[2,145]),t(ve,[2,146]),t(ve,[2,147]),t(ve,[2,148]),t(ve,[2,149]),t(ve,[2,150]),t(ve,[2,151]),t(ve,[2,152]),t(i,[2,12]),t(i,[2,18]),t(i,[2,19]),{9:[1,114]},t(ze,[2,26],{18:115,10:O}),t(B,[2,27]),{42:116,43:39,44:g,45:40,47:41,60:m,89:C,102:_,105:k,106:S,109:L,111:$,113:42,114:I,115:z,116:F},t(B,[2,40]),t(B,[2,41]),t(B,[2,42]),t(xe,[2,76],{73:117,62:[1,119],74:[1,118]}),{76:120,79:121,80:Ke,81:Ce,116:Ve,119:Qe},{75:[1,126],77:[1,127]},t(nt,[2,83]),t(B,[2,28]),t(B,[2,29]),t(B,[2,30]),t(B,[2,31]),t(B,[2,32]),{10:tt,12:Ze,14:ke,27:_e,28:128,32:Y,44:he,60:Z,75:pe,80:[1,130],81:[1,131],83:141,84:ne,85:Be,86:Te,87:Ue,88:De,89:qe,90:Le,91:129,105:Xe,109:Ie,111:it,114:we,115:ct,116:be},t(_t,a,{5:154}),t(B,[2,37]),t(B,[2,38]),t(H,[2,48],{44:bt}),t(H,[2,49],{18:156,10:O,40:lt}),t(Ne,[2,44]),{44:g,47:158,60:m,89:C,102:_,105:k,106:S,109:L,111:$,113:42,114:I,115:z,116:F},{102:[1,159],103:160,105:[1,161]},{44:g,47:162,60:m,89:C,102:_,105:k,106:S,109:L,111:$,113:42,114:I,115:z,116:F},{44:g,47:163,60:m,89:C,102:_,105:k,106:S,109:L,111:$,113:42,114:I,115:z,116:F},t(Mt,[2,107],{10:[1,164],96:[1,165]}),{80:[1,166]},t(Mt,[2,115],{120:168,10:[1,167],14:ie,44:j,60:ae,89:J,105:K,106:Q,109:re,111:le,114:fe,115:Ae,116:Se}),t(Mt,[2,117],{10:[1,169]}),t(Tt,[2,183]),t(Tt,[2,170]),t(Tt,[2,171]),t(Tt,[2,172]),t(Tt,[2,173]),t(Tt,[2,174]),t(Tt,[2,175]),t(Tt,[2,176]),t(Tt,[2,177]),t(Tt,[2,178]),t(Tt,[2,179]),t(Tt,[2,180]),{44:g,47:170,60:m,89:C,102:_,105:k,106:S,109:L,111:$,113:42,114:I,115:z,116:F},{30:171,67:dt,80:oe,81:Rt,82:172,116:ft,117:ht,118:kt},{30:179,67:dt,80:oe,81:Rt,82:172,116:ft,117:ht,118:kt},{30:181,50:[1,180],67:dt,80:oe,81:Rt,82:172,116:ft,117:ht,118:kt},{30:182,67:dt,80:oe,81:Rt,82:172,116:ft,117:ht,118:kt},{30:183,67:dt,80:oe,81:Rt,82:172,116:ft,117:ht,118:kt},{30:184,67:dt,80:oe,81:Rt,82:172,116:ft,117:ht,118:kt},{109:[1,185]},{30:186,67:dt,80:oe,81:Rt,82:172,116:ft,117:ht,118:kt},{30:187,65:[1,188],67:dt,80:oe,81:Rt,82:172,116:ft,117:ht,118:kt},{30:189,67:dt,80:oe,81:Rt,82:172,116:ft,117:ht,118:kt},{30:190,67:dt,80:oe,81:Rt,82:172,116:ft,117:ht,118:kt},{30:191,67:dt,80:oe,81:Rt,82:172,116:ft,117:ht,118:kt},t(ve,[2,182]),t(i,[2,20]),t(ze,[2,25]),t(H,[2,46],{39:192,18:193,10:O,40:W}),t(xe,[2,73],{10:[1,194]}),{10:[1,195]},{30:196,67:dt,80:oe,81:Rt,82:172,116:ft,117:ht,118:kt},{77:[1,197],79:198,116:Ve,119:Qe},t(qr,[2,79]),t(qr,[2,81]),t(qr,[2,82]),t(qr,[2,168]),t(qr,[2,169]),{76:199,79:121,80:Ke,81:Ce,116:Ve,119:Qe},t(nt,[2,84]),{8:P,9:G,10:tt,11:V,12:Ze,14:ke,21:201,27:_e,29:[1,200],32:Y,44:he,60:Z,75:pe,83:141,84:ne,85:Be,86:Te,87:Ue,88:De,89:qe,90:Le,91:202,105:Xe,109:Ie,111:it,114:we,115:ct,116:be},t(ye,[2,101]),t(ye,[2,103]),t(ye,[2,104]),t(ye,[2,157]),t(ye,[2,158]),t(ye,[2,159]),t(ye,[2,160]),t(ye,[2,161]),t(ye,[2,162]),t(ye,[2,163]),t(ye,[2,164]),t(ye,[2,165]),t(ye,[2,166]),t(ye,[2,167]),t(ye,[2,90]),t(ye,[2,91]),t(ye,[2,92]),t(ye,[2,93]),t(ye,[2,94]),t(ye,[2,95]),t(ye,[2,96]),t(ye,[2,97]),t(ye,[2,98]),t(ye,[2,99]),t(ye,[2,100]),{6:11,7:12,8:s,9:o,10:l,11:u,20:17,22:18,23:19,24:20,25:21,26:22,27:h,32:[1,203],33:24,34:d,36:f,38:p,42:28,43:39,44:g,45:40,47:41,60:m,84:y,85:v,86:x,87:b,88:w,89:C,102:_,105:k,106:S,109:L,111:$,113:42,114:I,115:z,116:F,121:A,122:R,123:N,124:M,125:D},{10:O,18:204},{44:[1,205]},t(Ne,[2,43]),{10:[1,206],44:g,60:m,89:C,102:_,105:k,106:S,109:L,111:$,113:113,114:I,115:z,116:F},{10:[1,207]},{10:[1,208],106:[1,209]},t(et,[2,128]),{10:[1,210],44:g,60:m,89:C,102:_,105:k,106:S,109:L,111:$,113:113,114:I,115:z,116:F},{10:[1,211],44:g,60:m,89:C,102:_,105:k,106:S,109:L,111:$,113:113,114:I,115:z,116:F},{80:[1,212]},t(Mt,[2,109],{10:[1,213]}),t(Mt,[2,111],{10:[1,214]}),{80:[1,215]},t(Tt,[2,184]),{80:[1,216],98:[1,217]},t(Ne,[2,55],{113:113,44:g,60:m,89:C,102:_,105:k,106:S,109:L,111:$,114:I,115:z,116:F}),{31:[1,218],67:dt,82:219,116:ft,117:ht,118:kt},t(ut,[2,86]),t(ut,[2,88]),t(ut,[2,89]),t(ut,[2,153]),t(ut,[2,154]),t(ut,[2,155]),t(ut,[2,156]),{49:[1,220],67:dt,82:219,116:ft,117:ht,118:kt},{30:221,67:dt,80:oe,81:Rt,82:172,116:ft,117:ht,118:kt},{51:[1,222],67:dt,82:219,116:ft,117:ht,118:kt},{53:[1,223],67:dt,82:219,116:ft,117:ht,118:kt},{55:[1,224],67:dt,82:219,116:ft,117:ht,118:kt},{57:[1,225],67:dt,82:219,116:ft,117:ht,118:kt},{60:[1,226]},{64:[1,227],67:dt,82:219,116:ft,117:ht,118:kt},{66:[1,228],67:dt,82:219,116:ft,117:ht,118:kt},{30:229,67:dt,80:oe,81:Rt,82:172,116:ft,117:ht,118:kt},{31:[1,230],67:dt,82:219,116:ft,117:ht,118:kt},{67:dt,69:[1,231],71:[1,232],82:219,116:ft,117:ht,118:kt},{67:dt,69:[1,234],71:[1,233],82:219,116:ft,117:ht,118:kt},t(H,[2,45],{18:156,10:O,40:lt}),t(H,[2,47],{44:bt}),t(xe,[2,75]),t(xe,[2,74]),{62:[1,235],67:dt,82:219,116:ft,117:ht,118:kt},t(xe,[2,77]),t(qr,[2,80]),{77:[1,236],79:198,116:Ve,119:Qe},{30:237,67:dt,80:oe,81:Rt,82:172,116:ft,117:ht,118:kt},t(_t,a,{5:238}),t(ye,[2,102]),t(B,[2,35]),{43:239,44:g,45:40,47:41,60:m,89:C,102:_,105:k,106:S,109:L,111:$,113:42,114:I,115:z,116:F},{10:O,18:240},{10:Lt,60:Vt,84:lr,92:241,105:cr,107:242,108:243,109:$r,110:dr,111:Or,112:ir},{10:Lt,60:Vt,84:lr,92:252,104:[1,253],105:cr,107:242,108:243,109:$r,110:dr,111:Or,112:ir},{10:Lt,60:Vt,84:lr,92:254,104:[1,255],105:cr,107:242,108:243,109:$r,110:dr,111:Or,112:ir},{105:[1,256]},{10:Lt,60:Vt,84:lr,92:257,105:cr,107:242,108:243,109:$r,110:dr,111:Or,112:ir},{44:g,47:258,60:m,89:C,102:_,105:k,106:S,109:L,111:$,113:42,114:I,115:z,116:F},t(Mt,[2,108]),{80:[1,259]},{80:[1,260],98:[1,261]},t(Mt,[2,116]),t(Mt,[2,118],{10:[1,262]}),t(Mt,[2,119]),t(ge,[2,56]),t(ut,[2,87]),t(ge,[2,57]),{51:[1,263],67:dt,82:219,116:ft,117:ht,118:kt},t(ge,[2,64]),t(ge,[2,59]),t(ge,[2,60]),t(ge,[2,61]),{109:[1,264]},t(ge,[2,63]),t(ge,[2,65]),{66:[1,265],67:dt,82:219,116:ft,117:ht,118:kt},t(ge,[2,67]),t(ge,[2,68]),t(ge,[2,70]),t(ge,[2,69]),t(ge,[2,71]),t([10,44,60,89,102,105,106,109,111,114,115,116],[2,85]),t(xe,[2,78]),{31:[1,266],67:dt,82:219,116:ft,117:ht,118:kt},{6:11,7:12,8:s,9:o,10:l,11:u,20:17,22:18,23:19,24:20,25:21,26:22,27:h,32:[1,267],33:24,34:d,36:f,38:p,42:28,43:39,44:g,45:40,47:41,60:m,84:y,85:v,86:x,87:b,88:w,89:C,102:_,105:k,106:S,109:L,111:$,113:42,114:I,115:z,116:F,121:A,122:R,123:N,124:M,125:D},t(Ne,[2,53]),{43:268,44:g,45:40,47:41,60:m,89:C,102:_,105:k,106:S,109:L,111:$,113:42,114:I,115:z,116:F},t(Mt,[2,121],{106:Vr}),t(Sn,[2,130],{108:270,10:Lt,60:Vt,84:lr,105:cr,109:$r,110:dr,111:Or,112:ir}),t(Ur,[2,132]),t(Ur,[2,134]),t(Ur,[2,135]),t(Ur,[2,136]),t(Ur,[2,137]),t(Ur,[2,138]),t(Ur,[2,139]),t(Ur,[2,140]),t(Ur,[2,141]),t(Mt,[2,122],{106:Vr}),{10:[1,271]},t(Mt,[2,123],{106:Vr}),{10:[1,272]},t(et,[2,129]),t(Mt,[2,105],{106:Vr}),t(Mt,[2,106],{113:113,44:g,60:m,89:C,102:_,105:k,106:S,109:L,111:$,114:I,115:z,116:F}),t(Mt,[2,110]),t(Mt,[2,112],{10:[1,273]}),t(Mt,[2,113]),{98:[1,274]},{51:[1,275]},{62:[1,276]},{66:[1,277]},{8:P,9:G,11:V,21:278},t(B,[2,34]),t(Ne,[2,52]),{10:Lt,60:Vt,84:lr,105:cr,107:279,108:243,109:$r,110:dr,111:Or,112:ir},t(Ur,[2,133]),{14:ie,44:j,60:ae,89:J,101:280,105:K,106:Q,109:re,111:le,114:fe,115:Ae,116:Se,120:88},{14:ie,44:j,60:ae,89:J,101:281,105:K,106:Q,109:re,111:le,114:fe,115:Ae,116:Se,120:88},{98:[1,282]},t(Mt,[2,120]),t(ge,[2,58]),{30:283,67:dt,80:oe,81:Rt,82:172,116:ft,117:ht,118:kt},t(ge,[2,66]),t(_t,a,{5:284}),t(Sn,[2,131],{108:270,10:Lt,60:Vt,84:lr,105:cr,109:$r,110:dr,111:Or,112:ir}),t(Mt,[2,126],{120:168,10:[1,285],14:ie,44:j,60:ae,89:J,105:K,106:Q,109:re,111:le,114:fe,115:Ae,116:Se}),t(Mt,[2,127],{120:168,10:[1,286],14:ie,44:j,60:ae,89:J,105:K,106:Q,109:re,111:le,114:fe,115:Ae,116:Se}),t(Mt,[2,114]),{31:[1,287],67:dt,82:219,116:ft,117:ht,118:kt},{6:11,7:12,8:s,9:o,10:l,11:u,20:17,22:18,23:19,24:20,25:21,26:22,27:h,32:[1,288],33:24,34:d,36:f,38:p,42:28,43:39,44:g,45:40,47:41,60:m,84:y,85:v,86:x,87:b,88:w,89:C,102:_,105:k,106:S,109:L,111:$,113:42,114:I,115:z,116:F,121:A,122:R,123:N,124:M,125:D},{10:Lt,60:Vt,84:lr,92:289,105:cr,107:242,108:243,109:$r,110:dr,111:Or,112:ir},{10:Lt,60:Vt,84:lr,92:290,105:cr,107:242,108:243,109:$r,110:dr,111:Or,112:ir},t(ge,[2,62]),t(B,[2,33]),t(Mt,[2,124],{106:Vr}),t(Mt,[2,125],{106:Vr})],defaultActions:{},parseError:T(function(qt,vt){if(vt.recoverable)this.trace(qt);else{var Gt=new Error(qt);throw Gt.hash=vt,Gt}},"parseError"),parse:T(function(qt){var vt=this,Gt=[0],Et=[],xr=[null],Ee=[],ta=this.table,$e="",Un=0,_0=0,Rb=2,Lb=1,Ib=Ee.slice.call(arguments,1),xi=Object.create(this.lexer),Wl={yy:{}};for(var Fi in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Fi)&&(Wl.yy[Fi]=this.yy[Fi]);xi.setInput(qt,Wl.yy),Wl.yy.lexer=xi,Wl.yy.parser=this,typeof xi.yylloc>"u"&&(xi.yylloc={});var Ul=xi.yylloc;Ee.push(Ul);var bh=xi.options&&xi.options.ranges;typeof Wl.yy.parseError=="function"?this.parseError=Wl.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Ft(ln){Gt.length=Gt.length-2*ln,xr.length=xr.length-ln,Ee.length=Ee.length-ln}T(Ft,"popStack");function Re(){var ln;return ln=Et.pop()||xi.lex()||Lb,typeof ln!="number"&&(ln instanceof Array&&(Et=ln,ln=Et.pop()),ln=vt.symbols_[ln]||ln),ln}T(Re,"lex");for(var Je,xt,Xt,vr,br={},_n,wn,zi,Ti;;){if(xt=Gt[Gt.length-1],this.defaultActions[xt]?Xt=this.defaultActions[xt]:((Je===null||typeof Je>"u")&&(Je=Re()),Xt=ta[xt]&&ta[xt][Je]),typeof Xt>"u"||!Xt.length||!Xt[0]){var Gi="";Ti=[];for(_n in ta[xt])this.terminals_[_n]&&_n>Rb&&Ti.push("'"+this.terminals_[_n]+"'");xi.showPosition?Gi="Parse error on line "+(Un+1)+`: +`+xi.showPosition()+` +Expecting `+Ti.join(", ")+", got '"+(this.terminals_[Je]||Je)+"'":Gi="Parse error on line "+(Un+1)+": Unexpected "+(Je==Lb?"end of input":"'"+(this.terminals_[Je]||Je)+"'"),this.parseError(Gi,{text:xi.match,token:this.terminals_[Je]||Je,line:xi.yylineno,loc:Ul,expected:Ti})}if(Xt[0]instanceof Array&&Xt.length>1)throw new Error("Parse Error: multiple actions possible at state: "+xt+", token: "+Je);switch(Xt[0]){case 1:Gt.push(Je),xr.push(xi.yytext),Ee.push(xi.yylloc),Gt.push(Xt[1]),Je=null,_0=xi.yyleng,$e=xi.yytext,Un=xi.yylineno,Ul=xi.yylloc;break;case 2:if(wn=this.productions_[Xt[1]][1],br.$=xr[xr.length-wn],br._$={first_line:Ee[Ee.length-(wn||1)].first_line,last_line:Ee[Ee.length-1].last_line,first_column:Ee[Ee.length-(wn||1)].first_column,last_column:Ee[Ee.length-1].last_column},bh&&(br._$.range=[Ee[Ee.length-(wn||1)].range[0],Ee[Ee.length-1].range[1]]),vr=this.performAction.apply(br,[$e,_0,Un,Wl.yy,Xt[1],xr,Ee].concat(Ib)),typeof vr<"u")return vr;wn&&(Gt=Gt.slice(0,-1*wn*2),xr=xr.slice(0,-1*wn),Ee=Ee.slice(0,-1*wn)),Gt.push(this.productions_[Xt[1]][0]),xr.push(br.$),Ee.push(br._$),zi=ta[Gt[Gt.length-2]][Gt[Gt.length-1]],Gt.push(zi);break;case 3:return!0}}return!0},"parse")},Ws=(function(){var Ri={EOF:1,parseError:T(function(vt,Gt){if(this.yy.parser)this.yy.parser.parseError(vt,Gt);else throw new Error(vt)},"parseError"),setInput:T(function(qt,vt){return this.yy=vt||this.yy||{},this._input=qt,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:T(function(){var qt=this._input[0];this.yytext+=qt,this.yyleng++,this.offset++,this.match+=qt,this.matched+=qt;var vt=qt.match(/(?:\r\n?|\n).*/g);return vt?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),qt},"input"),unput:T(function(qt){var vt=qt.length,Gt=qt.split(/(?:\r\n?|\n)/g);this._input=qt+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-vt),this.offset-=vt;var Et=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),Gt.length-1&&(this.yylineno-=Gt.length-1);var xr=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:Gt?(Gt.length===Et.length?this.yylloc.first_column:0)+Et[Et.length-Gt.length].length-Gt[0].length:this.yylloc.first_column-vt},this.options.ranges&&(this.yylloc.range=[xr[0],xr[0]+this.yyleng-vt]),this.yyleng=this.yytext.length,this},"unput"),more:T(function(){return this._more=!0,this},"more"),reject:T(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). +`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:T(function(qt){this.unput(this.match.slice(qt))},"less"),pastInput:T(function(){var qt=this.matched.substr(0,this.matched.length-this.match.length);return(qt.length>20?"...":"")+qt.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:T(function(){var qt=this.match;return qt.length<20&&(qt+=this._input.substr(0,20-qt.length)),(qt.substr(0,20)+(qt.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:T(function(){var qt=this.pastInput(),vt=new Array(qt.length+1).join("-");return qt+this.upcomingInput()+` +`+vt+"^"},"showPosition"),test_match:T(function(qt,vt){var Gt,Et,xr;if(this.options.backtrack_lexer&&(xr={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&&(xr.yylloc.range=this.yylloc.range.slice(0))),Et=qt[0].match(/(?:\r\n?|\n).*/g),Et&&(this.yylineno+=Et.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:Et?Et[Et.length-1].length-Et[Et.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+qt[0].length},this.yytext+=qt[0],this.match+=qt[0],this.matches=qt,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(qt[0].length),this.matched+=qt[0],Gt=this.performAction.call(this,this.yy,this,vt,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),Gt)return Gt;if(this._backtrack){for(var Ee in xr)this[Ee]=xr[Ee];return!1}return!1},"test_match"),next:T(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var qt,vt,Gt,Et;this._more||(this.yytext="",this.match="");for(var xr=this._currentRules(),Ee=0;Eevt[0].length)){if(vt=Gt,Et=Ee,this.options.backtrack_lexer){if(qt=this.test_match(Gt,xr[Ee]),qt!==!1)return qt;if(this._backtrack){vt=!1;continue}else return!1}else if(!this.options.flex)break}return vt?(qt=this.test_match(vt,xr[Et]),qt!==!1?qt:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:T(function(){var vt=this.next();return vt||this.lex()},"lex"),begin:T(function(vt){this.conditionStack.push(vt)},"begin"),popState:T(function(){var vt=this.conditionStack.length-1;return vt>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:T(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:T(function(vt){return vt=this.conditionStack.length-1-Math.abs(vt||0),vt>=0?this.conditionStack[vt]:"INITIAL"},"topState"),pushState:T(function(vt){this.begin(vt)},"pushState"),stateStackSize:T(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:T(function(vt,Gt,Et,xr){switch(Et){case 0:return this.begin("acc_title"),34;case 1:return this.popState(),"acc_title_value";case 2:return this.begin("acc_descr"),36;case 3:return this.popState(),"acc_descr_value";case 4:this.begin("acc_descr_multiline");break;case 5:this.popState();break;case 6:return"acc_descr_multiline_value";case 7:return this.pushState("shapeData"),Gt.yytext="",40;case 8:return this.pushState("shapeDataStr"),40;case 9:return this.popState(),40;case 10:const Ee=/\n\s*/g;return Gt.yytext=Gt.yytext.replace(Ee,"
    "),40;case 11:return 40;case 12:this.popState();break;case 13:this.begin("callbackname");break;case 14:this.popState();break;case 15:this.popState(),this.begin("callbackargs");break;case 16:return 95;case 17:this.popState();break;case 18:return 96;case 19:return"MD_STR";case 20:this.popState();break;case 21:this.begin("md_string");break;case 22:return"STR";case 23:this.popState();break;case 24:this.pushState("string");break;case 25:return 84;case 26:return 102;case 27:return 85;case 28:return 104;case 29:return 86;case 30:return 87;case 31:return 97;case 32:this.begin("click");break;case 33:this.popState();break;case 34:return 88;case 35:return vt.lex.firstGraph()&&this.begin("dir"),12;case 36:return vt.lex.firstGraph()&&this.begin("dir"),12;case 37:return vt.lex.firstGraph()&&this.begin("dir"),12;case 38:return 27;case 39:return 32;case 40:return 98;case 41:return 98;case 42:return 98;case 43:return 98;case 44:return this.popState(),13;case 45:return this.popState(),14;case 46:return this.popState(),14;case 47:return this.popState(),14;case 48:return this.popState(),14;case 49:return this.popState(),14;case 50:return this.popState(),14;case 51:return this.popState(),14;case 52:return this.popState(),14;case 53:return this.popState(),14;case 54:return this.popState(),14;case 55:return 121;case 56:return 122;case 57:return 123;case 58:return 124;case 59:return 125;case 60:return 78;case 61:return 105;case 62:return 111;case 63:return 46;case 64:return 60;case 65:return 44;case 66:return 8;case 67:return 106;case 68:return 115;case 69:return this.popState(),77;case 70:return this.pushState("edgeText"),75;case 71:return 119;case 72:return this.popState(),77;case 73:return this.pushState("thickEdgeText"),75;case 74:return 119;case 75:return this.popState(),77;case 76:return this.pushState("dottedEdgeText"),75;case 77:return 119;case 78:return 77;case 79:return this.popState(),53;case 80:return"TEXT";case 81:return this.pushState("ellipseText"),52;case 82:return this.popState(),55;case 83:return this.pushState("text"),54;case 84:return this.popState(),57;case 85:return this.pushState("text"),56;case 86:return 58;case 87:return this.pushState("text"),67;case 88:return this.popState(),64;case 89:return this.pushState("text"),63;case 90:return this.popState(),49;case 91:return this.pushState("text"),48;case 92:return this.popState(),69;case 93:return this.popState(),71;case 94:return 117;case 95:return this.pushState("trapText"),68;case 96:return this.pushState("trapText"),70;case 97:return 118;case 98:return 67;case 99:return 90;case 100:return"SEP";case 101:return 89;case 102:return 115;case 103:return 111;case 104:return 44;case 105:return 109;case 106:return 114;case 107:return 116;case 108:return this.popState(),62;case 109:return this.pushState("text"),62;case 110:return this.popState(),51;case 111:return this.pushState("text"),50;case 112:return this.popState(),31;case 113:return this.pushState("text"),29;case 114:return this.popState(),66;case 115:return this.pushState("text"),65;case 116:return"TEXT";case 117:return"QUOTE";case 118:return 9;case 119:return 10;case 120: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]*)/,/^(?:.*direction\s+TD[^\n]*)/,/^(?:[^\s\"]+@(?=[^\{\"]))/,/^(?:[0-9]+)/,/^(?:#)/,/^(?::::)/,/^(?::)/,/^(?:&)/,/^(?:;)/,/^(?:,)/,/^(?:\*)/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?--\s*)/,/^(?:[^-]|-(?!-)+)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?==\s*)/,/^(?:[^=]|=(?!))/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?:\s*[xo<]?-\.\s*)/,/^(?:[^\.]|\.(?!))/,/^(?:\s*~~[\~]+\s*)/,/^(?:[-/\)][\)])/,/^(?:[^\(\)\[\]\{\}]|!\)+)/,/^(?:\(-)/,/^(?:\]\))/,/^(?:\(\[)/,/^(?:\]\])/,/^(?:\[\[)/,/^(?:\[\|)/,/^(?:>)/,/^(?:\)\])/,/^(?:\[\()/,/^(?:\)\)\))/,/^(?:\(\(\()/,/^(?:[\\(?=\])][\]])/,/^(?:\/(?=\])\])/,/^(?:\/(?!\])|\\(?!\])|[^\\\[\]\(\)\{\}\/]+)/,/^(?:\[\/)/,/^(?:\[\\)/,/^(?:<)/,/^(?:>)/,/^(?:\^)/,/^(?:\\\|)/,/^(?:v\b)/,/^(?:\*)/,/^(?:#)/,/^(?:&)/,/^(?:([A-Za-z0-9!"\#$%&'*+\.`?\\_\/]|-(?=[^\>\-\.])|(?!))+)/,/^(?:-)/,/^(?:[\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6]|[\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377]|[\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5]|[\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA]|[\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE]|[\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA]|[\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A]|[\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39]|[\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8]|[\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C]|[\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C]|[\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99]|[\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0]|[\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1]|[\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81]|[\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3]|[\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6]|[\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A]|[\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081]|[\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D]|[\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0]|[\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310]|[\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC]|[\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D]|[\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D]|[\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3]|[\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F]|[\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128]|[\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184]|[\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3]|[\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6]|[\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE]|[\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B]|[\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788]|[\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805]|[\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5]|[\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4]|[\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E]|[\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D]|[\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36]|[\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D]|[\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC]|[\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF]|[\uFFD2-\uFFD7\uFFDA-\uFFDC])/,/^(?:\|)/,/^(?:\|)/,/^(?:\))/,/^(?:\()/,/^(?:\])/,/^(?:\[)/,/^(?:(\}))/,/^(?:\{)/,/^(?:[^\[\]\(\)\{\}\|\"]+)/,/^(?:")/,/^(?:(\r?\n)+)/,/^(?:\s)/,/^(?:$)/],conditions:{shapeDataEndBracket:{rules:[21,24,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},shapeDataStr:{rules:[9,10,21,24,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},shapeData:{rules:[8,11,12,21,24,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},callbackargs:{rules:[17,18,21,24,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},callbackname:{rules:[14,15,16,21,24,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},href:{rules:[21,24,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},click:{rules:[21,24,33,34,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},dottedEdgeText:{rules:[21,24,75,77,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},thickEdgeText:{rules:[21,24,72,74,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},edgeText:{rules:[21,24,69,71,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},trapText:{rules:[21,24,78,81,83,85,89,91,92,93,94,95,96,109,111,113,115],inclusive:!1},ellipseText:{rules:[21,24,78,79,80,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},text:{rules:[21,24,78,81,82,83,84,85,88,89,90,91,95,96,108,109,110,111,112,113,114,115,116],inclusive:!1},vertex:{rules:[21,24,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},dir:{rules:[21,24,44,45,46,47,48,49,50,51,52,53,54,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},acc_descr_multiline:{rules:[5,6,21,24,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},acc_descr:{rules:[3,21,24,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},acc_title:{rules:[1,21,24,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},md_string:{rules:[19,20,21,24,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},string:{rules:[21,22,23,24,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},INITIAL:{rules:[0,2,4,7,13,21,24,25,26,27,28,29,30,31,32,35,36,37,38,39,40,41,42,43,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,72,73,75,76,78,81,83,85,86,87,89,91,95,96,97,98,99,100,101,102,103,104,105,106,107,109,111,113,115,117,118,119,120],inclusive:!0}}};return Ri})();us.lexer=Ws;function Us(){this.yy={}}return T(Us,"Parser"),Us.prototype=us,us.Parser=Us,new Us})();XN.parser=XN;var Xle=XN,jle=Object.assign({},Xle);jle.parse=t=>{const e=t.replace(/}\s*\n/g,`} +`);return Xle.parse(e)};var Get=jle,qet=T((t,e)=>{const r=p7,n=r(t,"r"),i=r(t,"g"),a=r(t,"b");return dl(n,i,a,e)},"fade"),Vet=T(t=>`.label { font-family: ${t.fontFamily}; color: ${t.nodeTextColor||t.textColor}; } @@ -1018,7 +1019,7 @@ Expecting `+ei.join(", ")+", got '"+(this.terminals_[Je]||Je)+"'":bi="Parse erro /* For html labels only */ .labelBkg { - background-color: ${eUe(t.edgeLabelBackground,.5)}; + background-color: ${qet(t.edgeLabelBackground,.5)}; // background-color: } @@ -1077,13 +1078,13 @@ Expecting `+ei.join(", ")+", got '"+(this.terminals_[Je]||Je)+"'":bi="Parse erro } text-align: center; } - ${px()} -`,"getStyles"),rUe=tUe,nUe={parser:JWe,get db(){return new KWe},renderer:QWe,styles:rUe,init:x(t=>{t.flowchart||(t.flowchart={}),t.layout&&O6({layout:t.layout}),t.flowchart.arrowMarkerAbsolute=t.arrowMarkerAbsolute,O6({flowchart:{arrowMarkerAbsolute:t.arrowMarkerAbsolute}})},"init")};const xI=Object.freeze(Object.defineProperty({__proto__:null,diagram:nUe},Symbol.toStringTag,{value:"Module"}));var TI=(function(){var t=x(function(_e,Ae,Ne,me){for(Ne=Ne||{},me=_e.length;me--;Ne[_e[me]]=Ae);return Ne},"o"),e=[6,8,10,22,24,26,28,33,34,35,36,37,40,43,44,48,50,51,52],r=[1,10],n=[1,11],i=[1,12],a=[1,13],s=[1,23],o=[1,24],l=[1,25],u=[1,26],h=[1,27],d=[1,19],f=[1,28],p=[1,29],g=[1,20],m=[1,18],y=[1,21],v=[1,22],T=[1,36],b=[1,37],w=[1,38],k=[1,39],A=[1,40],C=[6,8,10,13,15,17,20,21,22,24,26,28,33,34,35,36,37,40,43,44,48,50,51,52,65,66,67,68,69],_=[1,45],L=[1,46],O=[1,55],M=[40,48,50,51,52,70,71],z=[1,66],F=[1,64],S=[1,61],R=[1,65],N=[1,67],D=[6,8,10,13,17,22,24,26,28,33,34,35,36,37,40,41,42,43,44,48,49,50,51,52,65,66,67,68,69],I=[65,66,67,68,69],$=[1,84],B=[1,83],P=[1,81],G=[1,82],V=[6,10,42,47],Y=[6,10,13,41,42,47,48,49],W=[1,92],ie=[1,91],K=[1,90],se=[19,58],J=[1,101],Z=[1,100],ee=[19,58,60,62],ne={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ER_DIAGRAM:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,entityName:11,relSpec:12,COLON:13,role:14,STYLE_SEPARATOR:15,idList:16,BLOCK_START:17,attributes:18,BLOCK_STOP:19,SQS:20,SQE:21,title:22,title_value:23,acc_title:24,acc_title_value:25,acc_descr:26,acc_descr_value:27,acc_descr_multiline_value:28,direction:29,classDefStatement:30,classStatement:31,styleStatement:32,direction_tb:33,direction_bt:34,direction_rl:35,direction_lr:36,CLASSDEF:37,stylesOpt:38,separator:39,UNICODE_TEXT:40,STYLE_TEXT:41,COMMA:42,CLASS:43,STYLE:44,style:45,styleComponent:46,SEMI:47,NUM:48,BRKT:49,ENTITY_NAME:50,DECIMAL_NUM:51,ENTITY_ONE:52,attribute:53,attributeType:54,attributeName:55,attributeKeyTypeList:56,attributeComment:57,ATTRIBUTE_WORD:58,attributeKeyType:59,",":60,ATTRIBUTE_KEY:61,COMMENT:62,cardinality:63,relType:64,ZERO_OR_ONE:65,ZERO_OR_MORE:66,ONE_OR_MORE:67,ONLY_ONE:68,MD_PARENT:69,NON_IDENTIFYING:70,IDENTIFYING:71,WORD:72,$accept:0,$end:1},terminals_:{2:"error",4:"ER_DIAGRAM",6:"EOF",8:"SPACE",10:"NEWLINE",13:"COLON",15:"STYLE_SEPARATOR",17:"BLOCK_START",19:"BLOCK_STOP",20:"SQS",21:"SQE",22:"title",23:"title_value",24:"acc_title",25:"acc_title_value",26:"acc_descr",27:"acc_descr_value",28:"acc_descr_multiline_value",33:"direction_tb",34:"direction_bt",35:"direction_rl",36:"direction_lr",37:"CLASSDEF",40:"UNICODE_TEXT",41:"STYLE_TEXT",42:"COMMA",43:"CLASS",44:"STYLE",47:"SEMI",48:"NUM",49:"BRKT",50:"ENTITY_NAME",51:"DECIMAL_NUM",52:"ENTITY_ONE",58:"ATTRIBUTE_WORD",60:",",61:"ATTRIBUTE_KEY",62:"COMMENT",65:"ZERO_OR_ONE",66:"ZERO_OR_MORE",67:"ONE_OR_MORE",68:"ONLY_ONE",69:"MD_PARENT",70:"NON_IDENTIFYING",71:"IDENTIFYING",72:"WORD"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,5],[9,9],[9,7],[9,7],[9,4],[9,6],[9,3],[9,5],[9,1],[9,3],[9,7],[9,9],[9,6],[9,8],[9,4],[9,6],[9,2],[9,2],[9,2],[9,1],[9,1],[9,1],[9,1],[9,1],[29,1],[29,1],[29,1],[29,1],[30,4],[16,1],[16,1],[16,3],[16,3],[31,3],[32,4],[38,1],[38,3],[45,1],[45,2],[39,1],[39,1],[39,1],[46,1],[46,1],[46,1],[46,1],[11,1],[11,1],[11,1],[11,1],[11,1],[18,1],[18,2],[53,2],[53,3],[53,3],[53,4],[54,1],[55,1],[56,1],[56,3],[59,1],[57,1],[12,3],[63,1],[63,1],[63,1],[63,1],[63,1],[64,1],[64,1],[14,1],[14,1],[14,1]],performAction:x(function(Ae,Ne,me,ve,Ge,Te,Ze){var ke=Te.length-1;switch(Ge){case 1:break;case 2:this.$=[];break;case 3:Te[ke-1].push(Te[ke]),this.$=Te[ke-1];break;case 4:case 5:this.$=Te[ke];break;case 6:case 7:this.$=[];break;case 8:ve.addEntity(Te[ke-4]),ve.addEntity(Te[ke-2]),ve.addRelationship(Te[ke-4],Te[ke],Te[ke-2],Te[ke-3]);break;case 9:ve.addEntity(Te[ke-8]),ve.addEntity(Te[ke-4]),ve.addRelationship(Te[ke-8],Te[ke],Te[ke-4],Te[ke-5]),ve.setClass([Te[ke-8]],Te[ke-6]),ve.setClass([Te[ke-4]],Te[ke-2]);break;case 10:ve.addEntity(Te[ke-6]),ve.addEntity(Te[ke-2]),ve.addRelationship(Te[ke-6],Te[ke],Te[ke-2],Te[ke-3]),ve.setClass([Te[ke-6]],Te[ke-4]);break;case 11:ve.addEntity(Te[ke-6]),ve.addEntity(Te[ke-4]),ve.addRelationship(Te[ke-6],Te[ke],Te[ke-4],Te[ke-5]),ve.setClass([Te[ke-4]],Te[ke-2]);break;case 12:ve.addEntity(Te[ke-3]),ve.addAttributes(Te[ke-3],Te[ke-1]);break;case 13:ve.addEntity(Te[ke-5]),ve.addAttributes(Te[ke-5],Te[ke-1]),ve.setClass([Te[ke-5]],Te[ke-3]);break;case 14:ve.addEntity(Te[ke-2]);break;case 15:ve.addEntity(Te[ke-4]),ve.setClass([Te[ke-4]],Te[ke-2]);break;case 16:ve.addEntity(Te[ke]);break;case 17:ve.addEntity(Te[ke-2]),ve.setClass([Te[ke-2]],Te[ke]);break;case 18:ve.addEntity(Te[ke-6],Te[ke-4]),ve.addAttributes(Te[ke-6],Te[ke-1]);break;case 19:ve.addEntity(Te[ke-8],Te[ke-6]),ve.addAttributes(Te[ke-8],Te[ke-1]),ve.setClass([Te[ke-8]],Te[ke-3]);break;case 20:ve.addEntity(Te[ke-5],Te[ke-3]);break;case 21:ve.addEntity(Te[ke-7],Te[ke-5]),ve.setClass([Te[ke-7]],Te[ke-2]);break;case 22:ve.addEntity(Te[ke-3],Te[ke-1]);break;case 23:ve.addEntity(Te[ke-5],Te[ke-3]),ve.setClass([Te[ke-5]],Te[ke]);break;case 24:case 25:this.$=Te[ke].trim(),ve.setAccTitle(this.$);break;case 26:case 27:this.$=Te[ke].trim(),ve.setAccDescription(this.$);break;case 32:ve.setDirection("TB");break;case 33:ve.setDirection("BT");break;case 34:ve.setDirection("RL");break;case 35:ve.setDirection("LR");break;case 36:this.$=Te[ke-3],ve.addClass(Te[ke-2],Te[ke-1]);break;case 37:case 38:case 59:case 67:this.$=[Te[ke]];break;case 39:case 40:this.$=Te[ke-2].concat([Te[ke]]);break;case 41:this.$=Te[ke-2],ve.setClass(Te[ke-1],Te[ke]);break;case 42:this.$=Te[ke-3],ve.addCssStyles(Te[ke-2],Te[ke-1]);break;case 43:this.$=[Te[ke]];break;case 44:Te[ke-2].push(Te[ke]),this.$=Te[ke-2];break;case 46:this.$=Te[ke-1]+Te[ke];break;case 54:case 79:case 80:this.$=Te[ke].replace(/"/g,"");break;case 55:case 56:case 57:case 58:case 81:this.$=Te[ke];break;case 60:Te[ke].push(Te[ke-1]),this.$=Te[ke];break;case 61:this.$={type:Te[ke-1],name:Te[ke]};break;case 62:this.$={type:Te[ke-2],name:Te[ke-1],keys:Te[ke]};break;case 63:this.$={type:Te[ke-2],name:Te[ke-1],comment:Te[ke]};break;case 64:this.$={type:Te[ke-3],name:Te[ke-2],keys:Te[ke-1],comment:Te[ke]};break;case 65:case 66:case 69:this.$=Te[ke];break;case 68:Te[ke-2].push(Te[ke]),this.$=Te[ke-2];break;case 70:this.$=Te[ke].replace(/"/g,"");break;case 71:this.$={cardA:Te[ke],relType:Te[ke-1],cardB:Te[ke-2]};break;case 72:this.$=ve.Cardinality.ZERO_OR_ONE;break;case 73:this.$=ve.Cardinality.ZERO_OR_MORE;break;case 74:this.$=ve.Cardinality.ONE_OR_MORE;break;case 75:this.$=ve.Cardinality.ONLY_ONE;break;case 76:this.$=ve.Cardinality.MD_PARENT;break;case 77:this.$=ve.Identification.NON_IDENTIFYING;break;case 78:this.$=ve.Identification.IDENTIFYING;break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:9,22:r,24:n,26:i,28:a,29:14,30:15,31:16,32:17,33:s,34:o,35:l,36:u,37:h,40:d,43:f,44:p,48:g,50:m,51:y,52:v},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:30,11:9,22:r,24:n,26:i,28:a,29:14,30:15,31:16,32:17,33:s,34:o,35:l,36:u,37:h,40:d,43:f,44:p,48:g,50:m,51:y,52:v},t(e,[2,5]),t(e,[2,6]),t(e,[2,16],{12:31,63:35,15:[1,32],17:[1,33],20:[1,34],65:T,66:b,67:w,68:k,69:A}),{23:[1,41]},{25:[1,42]},{27:[1,43]},t(e,[2,27]),t(e,[2,28]),t(e,[2,29]),t(e,[2,30]),t(e,[2,31]),t(C,[2,54]),t(C,[2,55]),t(C,[2,56]),t(C,[2,57]),t(C,[2,58]),t(e,[2,32]),t(e,[2,33]),t(e,[2,34]),t(e,[2,35]),{16:44,40:_,41:L},{16:47,40:_,41:L},{16:48,40:_,41:L},t(e,[2,4]),{11:49,40:d,48:g,50:m,51:y,52:v},{16:50,40:_,41:L},{18:51,19:[1,52],53:53,54:54,58:O},{11:56,40:d,48:g,50:m,51:y,52:v},{64:57,70:[1,58],71:[1,59]},t(M,[2,72]),t(M,[2,73]),t(M,[2,74]),t(M,[2,75]),t(M,[2,76]),t(e,[2,24]),t(e,[2,25]),t(e,[2,26]),{13:z,38:60,41:F,42:S,45:62,46:63,48:R,49:N},t(D,[2,37]),t(D,[2,38]),{16:68,40:_,41:L,42:S},{13:z,38:69,41:F,42:S,45:62,46:63,48:R,49:N},{13:[1,70],15:[1,71]},t(e,[2,17],{63:35,12:72,17:[1,73],42:S,65:T,66:b,67:w,68:k,69:A}),{19:[1,74]},t(e,[2,14]),{18:75,19:[2,59],53:53,54:54,58:O},{55:76,58:[1,77]},{58:[2,65]},{21:[1,78]},{63:79,65:T,66:b,67:w,68:k,69:A},t(I,[2,77]),t(I,[2,78]),{6:$,10:B,39:80,42:P,47:G},{40:[1,85],41:[1,86]},t(V,[2,43],{46:87,13:z,41:F,48:R,49:N}),t(Y,[2,45]),t(Y,[2,50]),t(Y,[2,51]),t(Y,[2,52]),t(Y,[2,53]),t(e,[2,41],{42:S}),{6:$,10:B,39:88,42:P,47:G},{14:89,40:W,50:ie,72:K},{16:93,40:_,41:L},{11:94,40:d,48:g,50:m,51:y,52:v},{18:95,19:[1,96],53:53,54:54,58:O},t(e,[2,12]),{19:[2,60]},t(se,[2,61],{56:97,57:98,59:99,61:J,62:Z}),t([19,58,61,62],[2,66]),t(e,[2,22],{15:[1,103],17:[1,102]}),t([40,48,50,51,52],[2,71]),t(e,[2,36]),{13:z,41:F,45:104,46:63,48:R,49:N},t(e,[2,47]),t(e,[2,48]),t(e,[2,49]),t(D,[2,39]),t(D,[2,40]),t(Y,[2,46]),t(e,[2,42]),t(e,[2,8]),t(e,[2,79]),t(e,[2,80]),t(e,[2,81]),{13:[1,105],42:S},{13:[1,107],15:[1,106]},{19:[1,108]},t(e,[2,15]),t(se,[2,62],{57:109,60:[1,110],62:Z}),t(se,[2,63]),t(ee,[2,67]),t(se,[2,70]),t(ee,[2,69]),{18:111,19:[1,112],53:53,54:54,58:O},{16:113,40:_,41:L},t(V,[2,44],{46:87,13:z,41:F,48:R,49:N}),{14:114,40:W,50:ie,72:K},{16:115,40:_,41:L},{14:116,40:W,50:ie,72:K},t(e,[2,13]),t(se,[2,64]),{59:117,61:J},{19:[1,118]},t(e,[2,20]),t(e,[2,23],{17:[1,119],42:S}),t(e,[2,11]),{13:[1,120],42:S},t(e,[2,10]),t(ee,[2,68]),t(e,[2,18]),{18:121,19:[1,122],53:53,54:54,58:O},{14:123,40:W,50:ie,72:K},{19:[1,124]},t(e,[2,21]),t(e,[2,9]),t(e,[2,19])],defaultActions:{55:[2,65],75:[2,60]},parseError:x(function(Ae,Ne){if(Ne.recoverable)this.trace(Ae);else{var me=new Error(Ae);throw me.hash=Ne,me}},"parseError"),parse:x(function(Ae){var Ne=this,me=[0],ve=[],Ge=[null],Te=[],Ze=this.table,ke="",Ve=0,Qe=0,nt=2,tt=1,je=Te.slice.call(arguments,1),Ce=Object.create(this.lexer),Se={yy:{}};for(var H in this.yy)Object.prototype.hasOwnProperty.call(this.yy,H)&&(Se.yy[H]=this.yy[H]);Ce.setInput(Ae,Se.yy),Se.yy.lexer=Ce,Se.yy.parser=this,typeof Ce.yylloc>"u"&&(Ce.yylloc={});var he=Ce.yylloc;Te.push(he);var j=Ce.options&&Ce.options.ranges;typeof Se.yy.parseError=="function"?this.parseError=Se.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function pe(lt){me.length=me.length-2*lt,Ge.length=Ge.length-lt,Te.length=Te.length-lt}x(pe,"popStack");function re(){var lt;return lt=ve.pop()||Ce.lex()||tt,typeof lt!="number"&&(lt instanceof Array&&(ve=lt,lt=ve.pop()),lt=Ne.symbols_[lt]||lt),lt}x(re,"lex");for(var Be,xe,Ue,De,qe={},Le,Xe,Ie,it;;){if(xe=me[me.length-1],this.defaultActions[xe]?Ue=this.defaultActions[xe]:((Be===null||typeof Be>"u")&&(Be=re()),Ue=Ze[xe]&&Ze[xe][Be]),typeof Ue>"u"||!Ue.length||!Ue[0]){var we="";it=[];for(Le in Ze[xe])this.terminals_[Le]&&Le>nt&&it.push("'"+this.terminals_[Le]+"'");Ce.showPosition?we="Parse error on line "+(Ve+1)+`: -`+Ce.showPosition()+` -Expecting `+it.join(", ")+", got '"+(this.terminals_[Be]||Be)+"'":we="Parse error on line "+(Ve+1)+": Unexpected "+(Be==tt?"end of input":"'"+(this.terminals_[Be]||Be)+"'"),this.parseError(we,{text:Ce.match,token:this.terminals_[Be]||Be,line:Ce.yylineno,loc:he,expected:it})}if(Ue[0]instanceof Array&&Ue.length>1)throw new Error("Parse Error: multiple actions possible at state: "+xe+", token: "+Be);switch(Ue[0]){case 1:me.push(Be),Ge.push(Ce.yytext),Te.push(Ce.yylloc),me.push(Ue[1]),Be=null,Qe=Ce.yyleng,ke=Ce.yytext,Ve=Ce.yylineno,he=Ce.yylloc;break;case 2:if(Xe=this.productions_[Ue[1]][1],qe.$=Ge[Ge.length-Xe],qe._$={first_line:Te[Te.length-(Xe||1)].first_line,last_line:Te[Te.length-1].last_line,first_column:Te[Te.length-(Xe||1)].first_column,last_column:Te[Te.length-1].last_column},j&&(qe._$.range=[Te[Te.length-(Xe||1)].range[0],Te[Te.length-1].range[1]]),De=this.performAction.apply(qe,[ke,Qe,Ve,Se.yy,Ue[1],Ge,Te].concat(je)),typeof De<"u")return De;Xe&&(me=me.slice(0,-1*Xe*2),Ge=Ge.slice(0,-1*Xe),Te=Te.slice(0,-1*Xe)),me.push(this.productions_[Ue[1]][0]),Ge.push(qe.$),Te.push(qe._$),Ie=Ze[me[me.length-2]][me[me.length-1]],me.push(Ie);break;case 3:return!0}}return!0},"parse")},ue=(function(){var _e={EOF:1,parseError:x(function(Ne,me){if(this.yy.parser)this.yy.parser.parseError(Ne,me);else throw new Error(Ne)},"parseError"),setInput:x(function(Ae,Ne){return this.yy=Ne||this.yy||{},this._input=Ae,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:x(function(){var Ae=this._input[0];this.yytext+=Ae,this.yyleng++,this.offset++,this.match+=Ae,this.matched+=Ae;var Ne=Ae.match(/(?:\r\n?|\n).*/g);return Ne?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),Ae},"input"),unput:x(function(Ae){var Ne=Ae.length,me=Ae.split(/(?:\r\n?|\n)/g);this._input=Ae+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-Ne),this.offset-=Ne;var ve=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),me.length-1&&(this.yylineno-=me.length-1);var Ge=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:me?(me.length===ve.length?this.yylloc.first_column:0)+ve[ve.length-me.length].length-me[0].length:this.yylloc.first_column-Ne},this.options.ranges&&(this.yylloc.range=[Ge[0],Ge[0]+this.yyleng-Ne]),this.yyleng=this.yytext.length,this},"unput"),more:x(function(){return this._more=!0,this},"more"),reject:x(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). -`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:x(function(Ae){this.unput(this.match.slice(Ae))},"less"),pastInput:x(function(){var Ae=this.matched.substr(0,this.matched.length-this.match.length);return(Ae.length>20?"...":"")+Ae.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:x(function(){var Ae=this.match;return Ae.length<20&&(Ae+=this._input.substr(0,20-Ae.length)),(Ae.substr(0,20)+(Ae.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:x(function(){var Ae=this.pastInput(),Ne=new Array(Ae.length+1).join("-");return Ae+this.upcomingInput()+` -`+Ne+"^"},"showPosition"),test_match:x(function(Ae,Ne){var me,ve,Ge;if(this.options.backtrack_lexer&&(Ge={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&&(Ge.yylloc.range=this.yylloc.range.slice(0))),ve=Ae[0].match(/(?:\r\n?|\n).*/g),ve&&(this.yylineno+=ve.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:ve?ve[ve.length-1].length-ve[ve.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+Ae[0].length},this.yytext+=Ae[0],this.match+=Ae[0],this.matches=Ae,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(Ae[0].length),this.matched+=Ae[0],me=this.performAction.call(this,this.yy,this,Ne,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),me)return me;if(this._backtrack){for(var Te in Ge)this[Te]=Ge[Te];return!1}return!1},"test_match"),next:x(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var Ae,Ne,me,ve;this._more||(this.yytext="",this.match="");for(var Ge=this._currentRules(),Te=0;TeNe[0].length)){if(Ne=me,ve=Te,this.options.backtrack_lexer){if(Ae=this.test_match(me,Ge[Te]),Ae!==!1)return Ae;if(this._backtrack){Ne=!1;continue}else return!1}else if(!this.options.flex)break}return Ne?(Ae=this.test_match(Ne,Ge[ve]),Ae!==!1?Ae:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var Ne=this.next();return Ne||this.lex()},"lex"),begin:x(function(Ne){this.conditionStack.push(Ne)},"begin"),popState:x(function(){var Ne=this.conditionStack.length-1;return Ne>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(Ne){return Ne=this.conditionStack.length-1-Math.abs(Ne||0),Ne>=0?this.conditionStack[Ne]:"INITIAL"},"topState"),pushState:x(function(Ne){this.begin(Ne)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:x(function(Ne,me,ve,Ge){switch(ve){case 0:return this.begin("acc_title"),24;case 1:return this.popState(),"acc_title_value";case 2:return this.begin("acc_descr"),26;case 3:return this.popState(),"acc_descr_value";case 4:this.begin("acc_descr_multiline");break;case 5:this.popState();break;case 6:return"acc_descr_multiline_value";case 7:return 33;case 8:return 34;case 9:return 35;case 10:return 36;case 11:return 10;case 12:break;case 13:return 8;case 14:return 50;case 15:return 72;case 16:return 4;case 17:return this.begin("block"),17;case 18:return 49;case 19:return 49;case 20:return 42;case 21:return 15;case 22:return 13;case 23:break;case 24:return 61;case 25:return 58;case 26:return 58;case 27:return 62;case 28:break;case 29:return this.popState(),19;case 30:return me.yytext[0];case 31:return 20;case 32:return 21;case 33:return this.begin("style"),44;case 34:return this.popState(),10;case 35:break;case 36:return 13;case 37:return 42;case 38:return 49;case 39:return this.begin("style"),37;case 40:return 43;case 41:return 65;case 42:return 67;case 43:return 67;case 44:return 67;case 45:return 65;case 46:return 65;case 47:return 66;case 48:return 66;case 49:return 66;case 50:return 66;case 51:return 66;case 52:return 67;case 53:return 66;case 54:return 67;case 55:return 68;case 56:return 68;case 57:return 51;case 58:return 68;case 59:return 68;case 60:return 68;case 61:return 52;case 62:return 48;case 63:return 68;case 64:return 65;case 65:return 66;case 66:return 67;case 67:return 69;case 68:return 70;case 69:return 71;case 70:return 71;case 71:return 70;case 72:return 70;case 73:return 70;case 74:return 41;case 75:return 47;case 76:return 40;case 77:return me.yytext[0];case 78:return 6}},"anonymous"),rules:[/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:[\s]+)/i,/^(?:"[^"%\r\n\v\b\\]+")/i,/^(?:"[^"]*")/i,/^(?:erDiagram\b)/i,/^(?:\{)/i,/^(?:#)/i,/^(?:#)/i,/^(?:,)/i,/^(?::::)/i,/^(?::)/i,/^(?:\s+)/i,/^(?:\b((?:PK)|(?:FK)|(?:UK))\b)/i,/^(?:([^\s]*)[~].*[~]([^\s]*))/i,/^(?:([\*A-Za-z_\u00C0-\uFFFF][A-Za-z0-9\-\_\[\]\(\)\u00C0-\uFFFF\*]*))/i,/^(?:"[^"]*")/i,/^(?:[\n]+)/i,/^(?:\})/i,/^(?:.)/i,/^(?:\[)/i,/^(?:\])/i,/^(?:style\b)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?::)/i,/^(?:,)/i,/^(?:#)/i,/^(?:classDef\b)/i,/^(?:class\b)/i,/^(?:one or zero\b)/i,/^(?:one or more\b)/i,/^(?:one or many\b)/i,/^(?:1\+)/i,/^(?:\|o\b)/i,/^(?:zero or one\b)/i,/^(?:zero or more\b)/i,/^(?:zero or many\b)/i,/^(?:0\+)/i,/^(?:\}o\b)/i,/^(?:many\(0\))/i,/^(?:many\(1\))/i,/^(?:many\b)/i,/^(?:\}\|)/i,/^(?:one\b)/i,/^(?:only one\b)/i,/^(?:[0-9]+\.[0-9]+)/i,/^(?:1(?=\s+[A-Za-z_"']))/i,/^(?:1(?=\s+[0-9]))/i,/^(?:1(?=(--|\.\.|\.-|-\.)))/i,/^(?:1\b)/i,/^(?:[0-9]+)/i,/^(?:\|\|)/i,/^(?:o\|)/i,/^(?:o\{)/i,/^(?:\|\{)/i,/^(?:u(?=[\.\-\|]))/i,/^(?:\.\.)/i,/^(?:--)/i,/^(?:to\b)/i,/^(?:optionally to\b)/i,/^(?:\.-)/i,/^(?:-\.)/i,/^(?:([^\x00-\x7F]|\w|-|\*)+)/i,/^(?:;)/i,/^(?:([^\x00-\x7F]|\w|-|\*|\.)+)/i,/^(?:.)/i,/^(?:$)/i],conditions:{style:{rules:[34,35,36,37,38,74,75],inclusive:!1},acc_descr_multiline:{rules:[5,6],inclusive:!1},acc_descr:{rules:[3],inclusive:!1},acc_title:{rules:[1],inclusive:!1},block:{rules:[23,24,25,26,27,28,29,30],inclusive:!1},INITIAL:{rules:[0,2,4,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,31,32,33,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,76,77,78],inclusive:!0}}};return _e})();ne.lexer=ue;function fe(){this.yy={}}return x(fe,"Parser"),fe.prototype=ne,ne.Parser=fe,new fe})();TI.parser=TI;var iUe=TI,aUe=(Dm=class{constructor(){this.entities=new Map,this.relationships=[],this.classes=new Map,this.direction="TB",this.Cardinality={ZERO_OR_ONE:"ZERO_OR_ONE",ZERO_OR_MORE:"ZERO_OR_MORE",ONE_OR_MORE:"ONE_OR_MORE",ONLY_ONE:"ONLY_ONE",MD_PARENT:"MD_PARENT"},this.Identification={NON_IDENTIFYING:"NON_IDENTIFYING",IDENTIFYING:"IDENTIFYING"},this.setAccTitle=Dn,this.getAccTitle=Fn,this.setAccDescription=zn,this.getAccDescription=Gn,this.setDiagramTitle=qn,this.getDiagramTitle=Mn,this.getConfig=x(()=>Pe().er,"getConfig"),this.clear(),this.addEntity=this.addEntity.bind(this),this.addAttributes=this.addAttributes.bind(this),this.addRelationship=this.addRelationship.bind(this),this.setDirection=this.setDirection.bind(this),this.addCssStyles=this.addCssStyles.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.setAccTitle=this.setAccTitle.bind(this),this.setAccDescription=this.setAccDescription.bind(this)}addEntity(e,r=""){var n;return this.entities.has(e)?!((n=this.entities.get(e))!=null&&n.alias)&&r&&(this.entities.get(e).alias=r,ae.info(`Add alias '${r}' to entity '${e}'`)):(this.entities.set(e,{id:`entity-${e}-${this.entities.size}`,label:e,attributes:[],alias:r,shape:"erBox",look:Pe().look??"default",cssClasses:"default",cssStyles:[],labelType:"markdown"}),ae.info("Added new entity :",e)),this.entities.get(e)}getEntity(e){return this.entities.get(e)}getEntities(){return this.entities}getClasses(){return this.classes}addAttributes(e,r){const n=this.addEntity(e);let i;for(i=r.length-1;i>=0;i--)r[i].keys||(r[i].keys=[]),r[i].comment||(r[i].comment=""),n.attributes.push(r[i]),ae.debug("Added attribute ",r[i].name)}addRelationship(e,r,n,i){const a=this.entities.get(e),s=this.entities.get(n);if(!a||!s)return;const o={entityA:a.id,roleA:r,entityB:s.id,relSpec:i};this.relationships.push(o),ae.debug("Added new relationship :",o)}getRelationships(){return this.relationships}getDirection(){return this.direction}setDirection(e){this.direction=e}getCompiledStyles(e){let r=[];for(const n of e){const i=this.classes.get(n);i!=null&&i.styles&&(r=[...r,...i.styles??[]].map(a=>a.trim())),i!=null&&i.textStyles&&(r=[...r,...i.textStyles??[]].map(a=>a.trim()))}return r}addCssStyles(e,r){for(const n of e){const i=this.entities.get(n);if(!r||!i)return;for(const a of r)i.cssStyles.push(a)}}addClass(e,r){e.forEach(n=>{let i=this.classes.get(n);i===void 0&&(i={id:n,styles:[],textStyles:[]},this.classes.set(n,i)),r&&r.forEach(function(a){if(/color/.exec(a)){const s=a.replace("fill","bgFill");i.textStyles.push(s)}i.styles.push(a)})})}setClass(e,r){for(const n of e){const i=this.entities.get(n);if(i)for(const a of r)i.cssClasses+=" "+a}}clear(){this.entities=new Map,this.classes=new Map,this.relationships=[],In()}getData(){const e=[],r=[],n=Pe();let i=0;for(const s of this.entities.keys()){const o=this.entities.get(s);o&&(o.cssCompiledStyles=this.getCompiledStyles(o.cssClasses.split(" ")),o.colorIndex=i++,e.push(o))}let a=0;for(const s of this.relationships){const o={id:V0(s.entityA,s.entityB,{prefix:"id",counter:a++}),type:"normal",curve:"basis",start:s.entityA,end:s.entityB,label:s.roleA,labelpos:"c",thickness:"normal",classes:"relationshipLine",arrowTypeStart:s.relSpec.cardB.toLowerCase(),arrowTypeEnd:s.relSpec.cardA.toLowerCase(),pattern:s.relSpec.relType=="IDENTIFYING"?"solid":"dashed",look:n.look,labelType:"markdown"};r.push(o)}return{nodes:e,edges:r,other:{},config:n,direction:"TB"}}},x(Dm,"ErDB"),Dm),Mte={};bw(Mte,{draw:()=>sUe});var sUe=x(async function(t,e,r,n){ae.info("REF0:"),ae.info("Drawing er diagram (unified)",e);const{securityLevel:i,er:a,layout:s}=Pe(),o=n.db.getData(),l=Xp(e,i);o.type=n.type,o.layoutAlgorithm=sb(s),o.config.flowchart.nodeSpacing=(a==null?void 0:a.nodeSpacing)||140,o.config.flowchart.rankSpacing=(a==null?void 0:a.rankSpacing)||80,o.direction=n.db.getDirection();const{config:u}=o,{look:h}=u;h==="neo"?o.markers=["only_one_neo","zero_or_one_neo","one_or_more_neo","zero_or_more_neo"]:o.markers=["only_one","zero_or_one","one_or_more","zero_or_more"],o.diagramId=e,await Z0(o,l),o.layoutAlgorithm==="elk"&&l.select(".edges").lower();const d=l.selectAll('[id*="-background"]');Array.from(d).length>0&&d.each(function(){const p=pt(this),m=p.attr("id").replace("-background",""),y=l.select(`#${CSS.escape(m)}`);if(!y.empty()){const v=y.attr("transform");p.attr("transform",v)}});const f=8;Lr.insertTitle(l,"erDiagramTitleText",(a==null?void 0:a.titleTopMargin)??25,n.db.getDiagramTitle()),Wd(l,f,"erDiagram",(a==null?void 0:a.useMaxWidth)??!0)},"draw"),Nte=x((t,e)=>{const r=g6,n=r(t,"r"),i=r(t,"g"),a=r(t,"b");return Ao(n,i,a,e)},"fade"),x3=new Set(["redux-color","redux-dark-color"]),oUe=x(t=>{const{theme:e,look:r,bkgColorArray:n,borderColorArray:i}=t;if(!x3.has(e))return"";const a=(n==null?void 0:n.length)>0;let s="";for(let o=0;o{t.flowchart||(t.flowchart={}),t.layout&&N7({layout:t.layout}),t.flowchart.arrowMarkerAbsolute=t.arrowMarkerAbsolute,N7({flowchart:{arrowMarkerAbsolute:t.arrowMarkerAbsolute}})},"init")};const jN=Object.freeze(Object.defineProperty({__proto__:null,diagram:Uet},Symbol.toStringTag,{value:"Module"}));var KN=(function(){var t=T(function(Ae,Se,Ne,ge){for(Ne=Ne||{},ge=Ae.length;ge--;Ne[Ae[ge]]=Se);return Ne},"o"),e=[6,8,10,22,24,26,28,33,34,35,36,37,40,43,44,48,50,51,52],r=[1,10],n=[1,11],i=[1,12],a=[1,13],s=[1,23],o=[1,24],l=[1,25],u=[1,26],h=[1,27],d=[1,19],f=[1,28],p=[1,29],g=[1,20],m=[1,18],y=[1,21],v=[1,22],x=[1,36],b=[1,37],w=[1,38],C=[1,39],_=[1,40],k=[6,8,10,13,15,17,20,21,22,24,26,28,33,34,35,36,37,40,43,44,48,50,51,52,65,66,67,68,69],S=[1,45],L=[1,46],$=[1,55],I=[40,48,50,51,52,70,71],z=[1,66],F=[1,64],A=[1,61],R=[1,65],N=[1,67],M=[6,8,10,13,17,22,24,26,28,33,34,35,36,37,40,41,42,43,44,48,49,50,51,52,65,66,67,68,69],D=[65,66,67,68,69],O=[1,84],B=[1,83],P=[1,81],G=[1,82],V=[6,10,42,47],H=[6,10,13,41,42,47,48,49],W=[1,92],ie=[1,91],j=[1,90],ae=[19,58],J=[1,101],K=[1,100],Q=[19,58,60,62],re={trace:T(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ER_DIAGRAM:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,entityName:11,relSpec:12,COLON:13,role:14,STYLE_SEPARATOR:15,idList:16,BLOCK_START:17,attributes:18,BLOCK_STOP:19,SQS:20,SQE:21,title:22,title_value:23,acc_title:24,acc_title_value:25,acc_descr:26,acc_descr_value:27,acc_descr_multiline_value:28,direction:29,classDefStatement:30,classStatement:31,styleStatement:32,direction_tb:33,direction_bt:34,direction_rl:35,direction_lr:36,CLASSDEF:37,stylesOpt:38,separator:39,UNICODE_TEXT:40,STYLE_TEXT:41,COMMA:42,CLASS:43,STYLE:44,style:45,styleComponent:46,SEMI:47,NUM:48,BRKT:49,ENTITY_NAME:50,DECIMAL_NUM:51,ENTITY_ONE:52,attribute:53,attributeType:54,attributeName:55,attributeKeyTypeList:56,attributeComment:57,ATTRIBUTE_WORD:58,attributeKeyType:59,",":60,ATTRIBUTE_KEY:61,COMMENT:62,cardinality:63,relType:64,ZERO_OR_ONE:65,ZERO_OR_MORE:66,ONE_OR_MORE:67,ONLY_ONE:68,MD_PARENT:69,NON_IDENTIFYING:70,IDENTIFYING:71,WORD:72,$accept:0,$end:1},terminals_:{2:"error",4:"ER_DIAGRAM",6:"EOF",8:"SPACE",10:"NEWLINE",13:"COLON",15:"STYLE_SEPARATOR",17:"BLOCK_START",19:"BLOCK_STOP",20:"SQS",21:"SQE",22:"title",23:"title_value",24:"acc_title",25:"acc_title_value",26:"acc_descr",27:"acc_descr_value",28:"acc_descr_multiline_value",33:"direction_tb",34:"direction_bt",35:"direction_rl",36:"direction_lr",37:"CLASSDEF",40:"UNICODE_TEXT",41:"STYLE_TEXT",42:"COMMA",43:"CLASS",44:"STYLE",47:"SEMI",48:"NUM",49:"BRKT",50:"ENTITY_NAME",51:"DECIMAL_NUM",52:"ENTITY_ONE",58:"ATTRIBUTE_WORD",60:",",61:"ATTRIBUTE_KEY",62:"COMMENT",65:"ZERO_OR_ONE",66:"ZERO_OR_MORE",67:"ONE_OR_MORE",68:"ONLY_ONE",69:"MD_PARENT",70:"NON_IDENTIFYING",71:"IDENTIFYING",72:"WORD"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,5],[9,9],[9,7],[9,7],[9,4],[9,6],[9,3],[9,5],[9,1],[9,3],[9,7],[9,9],[9,6],[9,8],[9,4],[9,6],[9,2],[9,2],[9,2],[9,1],[9,1],[9,1],[9,1],[9,1],[29,1],[29,1],[29,1],[29,1],[30,4],[16,1],[16,1],[16,3],[16,3],[31,3],[32,4],[38,1],[38,3],[45,1],[45,2],[39,1],[39,1],[39,1],[46,1],[46,1],[46,1],[46,1],[11,1],[11,1],[11,1],[11,1],[11,1],[18,1],[18,2],[53,2],[53,3],[53,3],[53,4],[54,1],[55,1],[56,1],[56,3],[59,1],[57,1],[12,3],[63,1],[63,1],[63,1],[63,1],[63,1],[64,1],[64,1],[14,1],[14,1],[14,1]],performAction:T(function(Se,Ne,ge,ve,ze,xe,Ke){var Ce=xe.length-1;switch(ze){case 1:break;case 2:this.$=[];break;case 3:xe[Ce-1].push(xe[Ce]),this.$=xe[Ce-1];break;case 4:case 5:this.$=xe[Ce];break;case 6:case 7:this.$=[];break;case 8:ve.addEntity(xe[Ce-4]),ve.addEntity(xe[Ce-2]),ve.addRelationship(xe[Ce-4],xe[Ce],xe[Ce-2],xe[Ce-3]);break;case 9:ve.addEntity(xe[Ce-8]),ve.addEntity(xe[Ce-4]),ve.addRelationship(xe[Ce-8],xe[Ce],xe[Ce-4],xe[Ce-5]),ve.setClass([xe[Ce-8]],xe[Ce-6]),ve.setClass([xe[Ce-4]],xe[Ce-2]);break;case 10:ve.addEntity(xe[Ce-6]),ve.addEntity(xe[Ce-2]),ve.addRelationship(xe[Ce-6],xe[Ce],xe[Ce-2],xe[Ce-3]),ve.setClass([xe[Ce-6]],xe[Ce-4]);break;case 11:ve.addEntity(xe[Ce-6]),ve.addEntity(xe[Ce-4]),ve.addRelationship(xe[Ce-6],xe[Ce],xe[Ce-4],xe[Ce-5]),ve.setClass([xe[Ce-4]],xe[Ce-2]);break;case 12:ve.addEntity(xe[Ce-3]),ve.addAttributes(xe[Ce-3],xe[Ce-1]);break;case 13:ve.addEntity(xe[Ce-5]),ve.addAttributes(xe[Ce-5],xe[Ce-1]),ve.setClass([xe[Ce-5]],xe[Ce-3]);break;case 14:ve.addEntity(xe[Ce-2]);break;case 15:ve.addEntity(xe[Ce-4]),ve.setClass([xe[Ce-4]],xe[Ce-2]);break;case 16:ve.addEntity(xe[Ce]);break;case 17:ve.addEntity(xe[Ce-2]),ve.setClass([xe[Ce-2]],xe[Ce]);break;case 18:ve.addEntity(xe[Ce-6],xe[Ce-4]),ve.addAttributes(xe[Ce-6],xe[Ce-1]);break;case 19:ve.addEntity(xe[Ce-8],xe[Ce-6]),ve.addAttributes(xe[Ce-8],xe[Ce-1]),ve.setClass([xe[Ce-8]],xe[Ce-3]);break;case 20:ve.addEntity(xe[Ce-5],xe[Ce-3]);break;case 21:ve.addEntity(xe[Ce-7],xe[Ce-5]),ve.setClass([xe[Ce-7]],xe[Ce-2]);break;case 22:ve.addEntity(xe[Ce-3],xe[Ce-1]);break;case 23:ve.addEntity(xe[Ce-5],xe[Ce-3]),ve.setClass([xe[Ce-5]],xe[Ce]);break;case 24:case 25:this.$=xe[Ce].trim(),ve.setAccTitle(this.$);break;case 26:case 27:this.$=xe[Ce].trim(),ve.setAccDescription(this.$);break;case 32:ve.setDirection("TB");break;case 33:ve.setDirection("BT");break;case 34:ve.setDirection("RL");break;case 35:ve.setDirection("LR");break;case 36:this.$=xe[Ce-3],ve.addClass(xe[Ce-2],xe[Ce-1]);break;case 37:case 38:case 59:case 67:this.$=[xe[Ce]];break;case 39:case 40:this.$=xe[Ce-2].concat([xe[Ce]]);break;case 41:this.$=xe[Ce-2],ve.setClass(xe[Ce-1],xe[Ce]);break;case 42:this.$=xe[Ce-3],ve.addCssStyles(xe[Ce-2],xe[Ce-1]);break;case 43:this.$=[xe[Ce]];break;case 44:xe[Ce-2].push(xe[Ce]),this.$=xe[Ce-2];break;case 46:this.$=xe[Ce-1]+xe[Ce];break;case 54:case 79:case 80:this.$=xe[Ce].replace(/"/g,"");break;case 55:case 56:case 57:case 58:case 81:this.$=xe[Ce];break;case 60:xe[Ce].push(xe[Ce-1]),this.$=xe[Ce];break;case 61:this.$={type:xe[Ce-1],name:xe[Ce]};break;case 62:this.$={type:xe[Ce-2],name:xe[Ce-1],keys:xe[Ce]};break;case 63:this.$={type:xe[Ce-2],name:xe[Ce-1],comment:xe[Ce]};break;case 64:this.$={type:xe[Ce-3],name:xe[Ce-2],keys:xe[Ce-1],comment:xe[Ce]};break;case 65:case 66:case 69:this.$=xe[Ce];break;case 68:xe[Ce-2].push(xe[Ce]),this.$=xe[Ce-2];break;case 70:this.$=xe[Ce].replace(/"/g,"");break;case 71:this.$={cardA:xe[Ce],relType:xe[Ce-1],cardB:xe[Ce-2]};break;case 72:this.$=ve.Cardinality.ZERO_OR_ONE;break;case 73:this.$=ve.Cardinality.ZERO_OR_MORE;break;case 74:this.$=ve.Cardinality.ONE_OR_MORE;break;case 75:this.$=ve.Cardinality.ONLY_ONE;break;case 76:this.$=ve.Cardinality.MD_PARENT;break;case 77:this.$=ve.Identification.NON_IDENTIFYING;break;case 78:this.$=ve.Identification.IDENTIFYING;break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:9,22:r,24:n,26:i,28:a,29:14,30:15,31:16,32:17,33:s,34:o,35:l,36:u,37:h,40:d,43:f,44:p,48:g,50:m,51:y,52:v},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:30,11:9,22:r,24:n,26:i,28:a,29:14,30:15,31:16,32:17,33:s,34:o,35:l,36:u,37:h,40:d,43:f,44:p,48:g,50:m,51:y,52:v},t(e,[2,5]),t(e,[2,6]),t(e,[2,16],{12:31,63:35,15:[1,32],17:[1,33],20:[1,34],65:x,66:b,67:w,68:C,69:_}),{23:[1,41]},{25:[1,42]},{27:[1,43]},t(e,[2,27]),t(e,[2,28]),t(e,[2,29]),t(e,[2,30]),t(e,[2,31]),t(k,[2,54]),t(k,[2,55]),t(k,[2,56]),t(k,[2,57]),t(k,[2,58]),t(e,[2,32]),t(e,[2,33]),t(e,[2,34]),t(e,[2,35]),{16:44,40:S,41:L},{16:47,40:S,41:L},{16:48,40:S,41:L},t(e,[2,4]),{11:49,40:d,48:g,50:m,51:y,52:v},{16:50,40:S,41:L},{18:51,19:[1,52],53:53,54:54,58:$},{11:56,40:d,48:g,50:m,51:y,52:v},{64:57,70:[1,58],71:[1,59]},t(I,[2,72]),t(I,[2,73]),t(I,[2,74]),t(I,[2,75]),t(I,[2,76]),t(e,[2,24]),t(e,[2,25]),t(e,[2,26]),{13:z,38:60,41:F,42:A,45:62,46:63,48:R,49:N},t(M,[2,37]),t(M,[2,38]),{16:68,40:S,41:L,42:A},{13:z,38:69,41:F,42:A,45:62,46:63,48:R,49:N},{13:[1,70],15:[1,71]},t(e,[2,17],{63:35,12:72,17:[1,73],42:A,65:x,66:b,67:w,68:C,69:_}),{19:[1,74]},t(e,[2,14]),{18:75,19:[2,59],53:53,54:54,58:$},{55:76,58:[1,77]},{58:[2,65]},{21:[1,78]},{63:79,65:x,66:b,67:w,68:C,69:_},t(D,[2,77]),t(D,[2,78]),{6:O,10:B,39:80,42:P,47:G},{40:[1,85],41:[1,86]},t(V,[2,43],{46:87,13:z,41:F,48:R,49:N}),t(H,[2,45]),t(H,[2,50]),t(H,[2,51]),t(H,[2,52]),t(H,[2,53]),t(e,[2,41],{42:A}),{6:O,10:B,39:88,42:P,47:G},{14:89,40:W,50:ie,72:j},{16:93,40:S,41:L},{11:94,40:d,48:g,50:m,51:y,52:v},{18:95,19:[1,96],53:53,54:54,58:$},t(e,[2,12]),{19:[2,60]},t(ae,[2,61],{56:97,57:98,59:99,61:J,62:K}),t([19,58,61,62],[2,66]),t(e,[2,22],{15:[1,103],17:[1,102]}),t([40,48,50,51,52],[2,71]),t(e,[2,36]),{13:z,41:F,45:104,46:63,48:R,49:N},t(e,[2,47]),t(e,[2,48]),t(e,[2,49]),t(M,[2,39]),t(M,[2,40]),t(H,[2,46]),t(e,[2,42]),t(e,[2,8]),t(e,[2,79]),t(e,[2,80]),t(e,[2,81]),{13:[1,105],42:A},{13:[1,107],15:[1,106]},{19:[1,108]},t(e,[2,15]),t(ae,[2,62],{57:109,60:[1,110],62:K}),t(ae,[2,63]),t(Q,[2,67]),t(ae,[2,70]),t(Q,[2,69]),{18:111,19:[1,112],53:53,54:54,58:$},{16:113,40:S,41:L},t(V,[2,44],{46:87,13:z,41:F,48:R,49:N}),{14:114,40:W,50:ie,72:j},{16:115,40:S,41:L},{14:116,40:W,50:ie,72:j},t(e,[2,13]),t(ae,[2,64]),{59:117,61:J},{19:[1,118]},t(e,[2,20]),t(e,[2,23],{17:[1,119],42:A}),t(e,[2,11]),{13:[1,120],42:A},t(e,[2,10]),t(Q,[2,68]),t(e,[2,18]),{18:121,19:[1,122],53:53,54:54,58:$},{14:123,40:W,50:ie,72:j},{19:[1,124]},t(e,[2,21]),t(e,[2,9]),t(e,[2,19])],defaultActions:{55:[2,65],75:[2,60]},parseError:T(function(Se,Ne){if(Ne.recoverable)this.trace(Se);else{var ge=new Error(Se);throw ge.hash=Ne,ge}},"parseError"),parse:T(function(Se){var Ne=this,ge=[0],ve=[],ze=[null],xe=[],Ke=this.table,Ce="",Ve=0,Qe=0,nt=2,tt=1,Ze=xe.slice.call(arguments,1),ke=Object.create(this.lexer),_e={yy:{}};for(var Y in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Y)&&(_e.yy[Y]=this.yy[Y]);ke.setInput(Se,_e.yy),_e.yy.lexer=ke,_e.yy.parser=this,typeof ke.yylloc>"u"&&(ke.yylloc={});var he=ke.yylloc;xe.push(he);var Z=ke.options&&ke.options.ranges;typeof _e.yy.parseError=="function"?this.parseError=_e.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function pe(ct){ge.length=ge.length-2*ct,ze.length=ze.length-ct,xe.length=xe.length-ct}T(pe,"popStack");function ne(){var ct;return ct=ve.pop()||ke.lex()||tt,typeof ct!="number"&&(ct instanceof Array&&(ve=ct,ct=ve.pop()),ct=Ne.symbols_[ct]||ct),ct}T(ne,"lex");for(var Be,Te,Ue,De,qe={},Le,Xe,Ie,it;;){if(Te=ge[ge.length-1],this.defaultActions[Te]?Ue=this.defaultActions[Te]:((Be===null||typeof Be>"u")&&(Be=ne()),Ue=Ke[Te]&&Ke[Te][Be]),typeof Ue>"u"||!Ue.length||!Ue[0]){var we="";it=[];for(Le in Ke[Te])this.terminals_[Le]&&Le>nt&&it.push("'"+this.terminals_[Le]+"'");ke.showPosition?we="Parse error on line "+(Ve+1)+`: +`+ke.showPosition()+` +Expecting `+it.join(", ")+", got '"+(this.terminals_[Be]||Be)+"'":we="Parse error on line "+(Ve+1)+": Unexpected "+(Be==tt?"end of input":"'"+(this.terminals_[Be]||Be)+"'"),this.parseError(we,{text:ke.match,token:this.terminals_[Be]||Be,line:ke.yylineno,loc:he,expected:it})}if(Ue[0]instanceof Array&&Ue.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Te+", token: "+Be);switch(Ue[0]){case 1:ge.push(Be),ze.push(ke.yytext),xe.push(ke.yylloc),ge.push(Ue[1]),Be=null,Qe=ke.yyleng,Ce=ke.yytext,Ve=ke.yylineno,he=ke.yylloc;break;case 2:if(Xe=this.productions_[Ue[1]][1],qe.$=ze[ze.length-Xe],qe._$={first_line:xe[xe.length-(Xe||1)].first_line,last_line:xe[xe.length-1].last_line,first_column:xe[xe.length-(Xe||1)].first_column,last_column:xe[xe.length-1].last_column},Z&&(qe._$.range=[xe[xe.length-(Xe||1)].range[0],xe[xe.length-1].range[1]]),De=this.performAction.apply(qe,[Ce,Qe,Ve,_e.yy,Ue[1],ze,xe].concat(Ze)),typeof De<"u")return De;Xe&&(ge=ge.slice(0,-1*Xe*2),ze=ze.slice(0,-1*Xe),xe=xe.slice(0,-1*Xe)),ge.push(this.productions_[Ue[1]][0]),ze.push(qe.$),xe.push(qe._$),Ie=Ke[ge[ge.length-2]][ge[ge.length-1]],ge.push(Ie);break;case 3:return!0}}return!0},"parse")},le=(function(){var Ae={EOF:1,parseError:T(function(Ne,ge){if(this.yy.parser)this.yy.parser.parseError(Ne,ge);else throw new Error(Ne)},"parseError"),setInput:T(function(Se,Ne){return this.yy=Ne||this.yy||{},this._input=Se,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:T(function(){var Se=this._input[0];this.yytext+=Se,this.yyleng++,this.offset++,this.match+=Se,this.matched+=Se;var Ne=Se.match(/(?:\r\n?|\n).*/g);return Ne?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),Se},"input"),unput:T(function(Se){var Ne=Se.length,ge=Se.split(/(?:\r\n?|\n)/g);this._input=Se+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-Ne),this.offset-=Ne;var ve=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),ge.length-1&&(this.yylineno-=ge.length-1);var ze=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:ge?(ge.length===ve.length?this.yylloc.first_column:0)+ve[ve.length-ge.length].length-ge[0].length:this.yylloc.first_column-Ne},this.options.ranges&&(this.yylloc.range=[ze[0],ze[0]+this.yyleng-Ne]),this.yyleng=this.yytext.length,this},"unput"),more:T(function(){return this._more=!0,this},"more"),reject:T(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). +`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:T(function(Se){this.unput(this.match.slice(Se))},"less"),pastInput:T(function(){var Se=this.matched.substr(0,this.matched.length-this.match.length);return(Se.length>20?"...":"")+Se.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:T(function(){var Se=this.match;return Se.length<20&&(Se+=this._input.substr(0,20-Se.length)),(Se.substr(0,20)+(Se.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:T(function(){var Se=this.pastInput(),Ne=new Array(Se.length+1).join("-");return Se+this.upcomingInput()+` +`+Ne+"^"},"showPosition"),test_match:T(function(Se,Ne){var ge,ve,ze;if(this.options.backtrack_lexer&&(ze={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(ze.yylloc.range=this.yylloc.range.slice(0))),ve=Se[0].match(/(?:\r\n?|\n).*/g),ve&&(this.yylineno+=ve.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:ve?ve[ve.length-1].length-ve[ve.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+Se[0].length},this.yytext+=Se[0],this.match+=Se[0],this.matches=Se,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(Se[0].length),this.matched+=Se[0],ge=this.performAction.call(this,this.yy,this,Ne,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),ge)return ge;if(this._backtrack){for(var xe in ze)this[xe]=ze[xe];return!1}return!1},"test_match"),next:T(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var Se,Ne,ge,ve;this._more||(this.yytext="",this.match="");for(var ze=this._currentRules(),xe=0;xeNe[0].length)){if(Ne=ge,ve=xe,this.options.backtrack_lexer){if(Se=this.test_match(ge,ze[xe]),Se!==!1)return Se;if(this._backtrack){Ne=!1;continue}else return!1}else if(!this.options.flex)break}return Ne?(Se=this.test_match(Ne,ze[ve]),Se!==!1?Se:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:T(function(){var Ne=this.next();return Ne||this.lex()},"lex"),begin:T(function(Ne){this.conditionStack.push(Ne)},"begin"),popState:T(function(){var Ne=this.conditionStack.length-1;return Ne>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:T(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:T(function(Ne){return Ne=this.conditionStack.length-1-Math.abs(Ne||0),Ne>=0?this.conditionStack[Ne]:"INITIAL"},"topState"),pushState:T(function(Ne){this.begin(Ne)},"pushState"),stateStackSize:T(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:T(function(Ne,ge,ve,ze){switch(ve){case 0:return this.begin("acc_title"),24;case 1:return this.popState(),"acc_title_value";case 2:return this.begin("acc_descr"),26;case 3:return this.popState(),"acc_descr_value";case 4:this.begin("acc_descr_multiline");break;case 5:this.popState();break;case 6:return"acc_descr_multiline_value";case 7:return 33;case 8:return 34;case 9:return 35;case 10:return 36;case 11:return 10;case 12:break;case 13:return 8;case 14:return 50;case 15:return 72;case 16:return 4;case 17:return this.begin("block"),17;case 18:return 49;case 19:return 49;case 20:return 42;case 21:return 15;case 22:return 13;case 23:break;case 24:return 61;case 25:return 58;case 26:return 58;case 27:return 62;case 28:break;case 29:return this.popState(),19;case 30:return ge.yytext[0];case 31:return 20;case 32:return 21;case 33:return this.begin("style"),44;case 34:return this.popState(),10;case 35:break;case 36:return 13;case 37:return 42;case 38:return 49;case 39:return this.begin("style"),37;case 40:return 43;case 41:return 65;case 42:return 67;case 43:return 67;case 44:return 67;case 45:return 65;case 46:return 65;case 47:return 66;case 48:return 66;case 49:return 66;case 50:return 66;case 51:return 66;case 52:return 67;case 53:return 66;case 54:return 67;case 55:return 68;case 56:return 68;case 57:return 51;case 58:return 68;case 59:return 68;case 60:return 68;case 61:return 52;case 62:return 48;case 63:return 68;case 64:return 65;case 65:return 66;case 66:return 67;case 67:return 69;case 68:return 70;case 69:return 71;case 70:return 71;case 71:return 70;case 72:return 70;case 73:return 70;case 74:return 41;case 75:return 47;case 76:return 40;case 77:return ge.yytext[0];case 78:return 6}},"anonymous"),rules:[/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:[\s]+)/i,/^(?:"[^"%\r\n\v\b\\]+")/i,/^(?:"[^"]*")/i,/^(?:erDiagram\b)/i,/^(?:\{)/i,/^(?:#)/i,/^(?:#)/i,/^(?:,)/i,/^(?::::)/i,/^(?::)/i,/^(?:\s+)/i,/^(?:\b((?:PK)|(?:FK)|(?:UK))\b)/i,/^(?:([^\s]*)[~].*[~]([^\s]*))/i,/^(?:([\*A-Za-z_\u00C0-\uFFFF][A-Za-z0-9\-\_\[\]\(\)\u00C0-\uFFFF\*]*))/i,/^(?:"[^"]*")/i,/^(?:[\n]+)/i,/^(?:\})/i,/^(?:.)/i,/^(?:\[)/i,/^(?:\])/i,/^(?:style\b)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?::)/i,/^(?:,)/i,/^(?:#)/i,/^(?:classDef\b)/i,/^(?:class\b)/i,/^(?:one or zero\b)/i,/^(?:one or more\b)/i,/^(?:one or many\b)/i,/^(?:1\+)/i,/^(?:\|o\b)/i,/^(?:zero or one\b)/i,/^(?:zero or more\b)/i,/^(?:zero or many\b)/i,/^(?:0\+)/i,/^(?:\}o\b)/i,/^(?:many\(0\))/i,/^(?:many\(1\))/i,/^(?:many\b)/i,/^(?:\}\|)/i,/^(?:one\b)/i,/^(?:only one\b)/i,/^(?:[0-9]+\.[0-9]+)/i,/^(?:1(?=\s+[A-Za-z_"']))/i,/^(?:1(?=\s+[0-9]))/i,/^(?:1(?=(--|\.\.|\.-|-\.)))/i,/^(?:1\b)/i,/^(?:[0-9]+)/i,/^(?:\|\|)/i,/^(?:o\|)/i,/^(?:o\{)/i,/^(?:\|\{)/i,/^(?:u(?=[\.\-\|]))/i,/^(?:\.\.)/i,/^(?:--)/i,/^(?:to\b)/i,/^(?:optionally to\b)/i,/^(?:\.-)/i,/^(?:-\.)/i,/^(?:([^\x00-\x7F]|\w|-|\*)+)/i,/^(?:;)/i,/^(?:([^\x00-\x7F]|\w|-|\*|\.)+)/i,/^(?:.)/i,/^(?:$)/i],conditions:{style:{rules:[34,35,36,37,38,74,75],inclusive:!1},acc_descr_multiline:{rules:[5,6],inclusive:!1},acc_descr:{rules:[3],inclusive:!1},acc_title:{rules:[1],inclusive:!1},block:{rules:[23,24,25,26,27,28,29,30],inclusive:!1},INITIAL:{rules:[0,2,4,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,31,32,33,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,76,77,78],inclusive:!0}}};return Ae})();re.lexer=le;function fe(){this.yy={}}return T(fe,"Parser"),fe.prototype=re,re.Parser=fe,new fe})();KN.parser=KN;var Het=KN,Yet=(hy=class{constructor(){this.entities=new Map,this.relationships=[],this.classes=new Map,this.direction="TB",this.Cardinality={ZERO_OR_ONE:"ZERO_OR_ONE",ZERO_OR_MORE:"ZERO_OR_MORE",ONE_OR_MORE:"ONE_OR_MORE",ONLY_ONE:"ONLY_ONE",MD_PARENT:"MD_PARENT"},this.Identification={NON_IDENTIFYING:"NON_IDENTIFYING",IDENTIFYING:"IDENTIFYING"},this.setAccTitle=Yn,this.getAccTitle=ii,this.setAccDescription=ai,this.getAccDescription=si,this.setDiagramTitle=oi,this.getDiagramTitle=Xn,this.getConfig=T(()=>Pe().er,"getConfig"),this.clear(),this.addEntity=this.addEntity.bind(this),this.addAttributes=this.addAttributes.bind(this),this.addRelationship=this.addRelationship.bind(this),this.setDirection=this.setDirection.bind(this),this.addCssStyles=this.addCssStyles.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.setAccTitle=this.setAccTitle.bind(this),this.setAccDescription=this.setAccDescription.bind(this)}addEntity(e,r=""){var n;return this.entities.has(e)?!((n=this.entities.get(e))!=null&&n.alias)&&r&&(this.entities.get(e).alias=r,se.info(`Add alias '${r}' to entity '${e}'`)):(this.entities.set(e,{id:`entity-${e}-${this.entities.size}`,label:e,attributes:[],alias:r,shape:"erBox",look:Pe().look??"default",cssClasses:"default",cssStyles:[],labelType:"markdown"}),se.info("Added new entity :",e)),this.entities.get(e)}getEntity(e){return this.entities.get(e)}getEntities(){return this.entities}getClasses(){return this.classes}addAttributes(e,r){const n=this.addEntity(e);let i;for(i=r.length-1;i>=0;i--)r[i].keys||(r[i].keys=[]),r[i].comment||(r[i].comment=""),n.attributes.push(r[i]),se.debug("Added attribute ",r[i].name)}addRelationship(e,r,n,i){const a=this.entities.get(e),s=this.entities.get(n);if(!a||!s)return;const o={entityA:a.id,roleA:r,entityB:s.id,relSpec:i};this.relationships.push(o),se.debug("Added new relationship :",o)}getRelationships(){return this.relationships}getDirection(){return this.direction}setDirection(e){this.direction=e}getCompiledStyles(e){let r=[];for(const n of e){const i=this.classes.get(n);i!=null&&i.styles&&(r=[...r,...i.styles??[]].map(a=>a.trim())),i!=null&&i.textStyles&&(r=[...r,...i.textStyles??[]].map(a=>a.trim()))}return r}addCssStyles(e,r){for(const n of e){const i=this.entities.get(n);if(!r||!i)return;for(const a of r)i.cssStyles.push(a)}}addClass(e,r){e.forEach(n=>{let i=this.classes.get(n);i===void 0&&(i={id:n,styles:[],textStyles:[]},this.classes.set(n,i)),r&&r.forEach(function(a){if(/color/.exec(a)){const s=a.replace("fill","bgFill");i.textStyles.push(s)}i.styles.push(a)})})}setClass(e,r){for(const n of e){const i=this.entities.get(n);if(i)for(const a of r)i.cssClasses+=" "+a}}clear(){this.entities=new Map,this.classes=new Map,this.relationships=[],Hn()}getData(){const e=[],r=[],n=Pe();let i=0;for(const s of this.entities.keys()){const o=this.entities.get(s);o&&(o.cssCompiledStyles=this.getCompiledStyles(o.cssClasses.split(" ")),o.colorIndex=i++,e.push(o))}let a=0;for(const s of this.relationships){const o={id:ag(s.entityA,s.entityB,{prefix:"id",counter:a++}),type:"normal",curve:"basis",start:s.entityA,end:s.entityB,label:s.roleA,labelpos:"c",thickness:"normal",classes:"relationshipLine",arrowTypeStart:s.relSpec.cardB.toLowerCase(),arrowTypeEnd:s.relSpec.cardA.toLowerCase(),pattern:s.relSpec.relType=="IDENTIFYING"?"solid":"dashed",look:n.look,labelType:"markdown"};r.push(o)}return{nodes:e,edges:r,other:{},config:n,direction:"TB"}}},T(hy,"ErDB"),hy),Kle={};S4(Kle,{draw:()=>Xet});var Xet=T(async function(t,e,r,n){se.info("REF0:"),se.info("Drawing er diagram (unified)",e);const{securityLevel:i,er:a,layout:s}=Pe(),o=n.db.getData(),l=_m(e,i);o.type=n.type,o.layoutAlgorithm=Fx(s),o.config.flowchart.nodeSpacing=(a==null?void 0:a.nodeSpacing)||140,o.config.flowchart.rankSpacing=(a==null?void 0:a.rankSpacing)||80,o.direction=n.db.getDirection();const{config:u}=o,{look:h}=u;h==="neo"?o.markers=["only_one_neo","zero_or_one_neo","one_or_more_neo","zero_or_more_neo"]:o.markers=["only_one","zero_or_one","one_or_more","zero_or_more"],o.diagramId=e,await fg(o,l),o.layoutAlgorithm==="elk"&&l.select(".edges").lower();const d=l.selectAll('[id*="-background"]');Array.from(d).length>0&&d.each(function(){const p=gt(this),m=p.attr("id").replace("-background",""),y=l.select(`#${CSS.escape(m)}`);if(!y.empty()){const v=y.attr("transform");p.attr("transform",v)}});const f=8;Pr.insertTitle(l,"erDiagramTitleText",(a==null?void 0:a.titleTopMargin)??25,n.db.getDiagramTitle()),op(l,f,"erDiagram",(a==null?void 0:a.useMaxWidth)??!0)},"draw"),Zle=T((t,e)=>{const r=p7,n=r(t,"r"),i=r(t,"g"),a=r(t,"b");return dl(n,i,a,e)},"fade"),bS=new Set(["redux-color","redux-dark-color"]),jet=T(t=>{const{theme:e,look:r,bkgColorArray:n,borderColorArray:i}=t;if(!bS.has(e))return"";const a=(n==null?void 0:n.length)>0;let s="";for(let o=0;o{const{look:e,theme:r,erEdgeLabelBackground:n,strokeWidth:i}=t;return` - ${oUe(t)} + `;return s},"genColor"),Ket=T(t=>{const{look:e,theme:r,erEdgeLabelBackground:n,strokeWidth:i}=t;return` + ${jet(t)} .entityBox { fill: ${t.mainBkg}; stroke: ${t.nodeBorder}; @@ -1111,14 +1112,14 @@ Expecting `+it.join(", ")+", got '"+(this.terminals_[Be]||Be)+"'":we="Parse erro } .labelBkg { - background-color: ${x3.has(r)&&n?n:Nte(t.tertiaryColor,.5)}; + background-color: ${bS.has(r)&&n?n:Zle(t.tertiaryColor,.5)}; } .edgeLabel { - background-color: ${x3.has(r)&&n?n:t.edgeLabelBackground}; + background-color: ${bS.has(r)&&n?n:t.edgeLabelBackground}; } .edgeLabel .label rect { - fill: ${x3.has(r)&&n?n:t.edgeLabelBackground}; + fill: ${bS.has(r)&&n?n:t.edgeLabelBackground}; } .edgeLabel .label text { fill: ${t.textColor}; @@ -1160,169 +1161,169 @@ Expecting `+it.join(", ")+", got '"+(this.terminals_[Be]||Be)+"'":we="Parse erro stroke-width: 1; } [data-look=neo].labelBkg { - background-color: ${Nte(t.tertiaryColor,.5)}; + background-color: ${Zle(t.tertiaryColor,.5)}; } -`},"getStyles"),cUe=lUe,uUe={parser:iUe,get db(){return new aUe},renderer:Mte,styles:cUe};const hUe=Object.freeze(Object.defineProperty({__proto__:null,diagram:uUe},Symbol.toStringTag,{value:"Module"}));function zl(t,e){var r,n,i;t.accDescr&&((r=e.setAccDescription)==null||r.call(e,t.accDescr)),t.accTitle&&((n=e.setAccTitle)==null||n.call(e,t.accTitle)),t.title&&((i=e.setDiagramTitle)==null||i.call(e,t.title))}x(zl,"populateCommonDb");var wI=(Mm=class{constructor(e){this.init=e,this.records=this.init()}reset(){this.records=this.init()}},x(Mm,"ImperativeState"),Mm),dUe=Object.create,gx=Object.defineProperty,fUe=Object.getOwnPropertyDescriptor,CI=Object.getOwnPropertyNames,pUe=Object.getPrototypeOf,gUe=Object.prototype.hasOwnProperty,E=(t,e)=>gx(t,"name",{value:e,configurable:!0}),mUe=(t,e)=>function(){return t&&(e=(0,t[CI(t)[0]])(t=0)),e},Dr=(t,e)=>function(){return e||(0,t[CI(t)[0]])((e={exports:{}}).exports,e),e.exports},fh=(t,e)=>{for(var r in e)gx(t,r,{get:e[r],enumerable:!0})},kI=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of CI(e))!gUe.call(t,i)&&i!==r&&gx(t,i,{get:()=>e[i],enumerable:!(n=fUe(e,i))||n.enumerable});return t},T3=(t,e,r)=>(kI(t,e,"default"),r),EI=(t,e,r)=>(r=t!=null?dUe(pUe(t)):{},kI(gx(r,"default",{value:t,enumerable:!0}),t)),SI=t=>kI(gx({},"__esModule",{value:!0}),t),w3={};fh(w3,{AnnotatedTextEdit:()=>Vc,ChangeAnnotation:()=>Hd,ChangeAnnotationIdentifier:()=>ga,CodeAction:()=>o9,CodeActionContext:()=>s9,CodeActionKind:()=>a9,CodeActionTriggerKind:()=>Cx,CodeDescription:()=>$I,CodeLens:()=>l9,Color:()=>k3,ColorInformation:()=>LI,ColorPresentation:()=>II,Command:()=>Ud,CompletionItem:()=>YI,CompletionItemKind:()=>GI,CompletionItemLabelDetails:()=>HI,CompletionItemTag:()=>VI,CompletionList:()=>XI,CreateFile:()=>Kp,DeleteFile:()=>Zp,Diagnostic:()=>vx,DiagnosticRelatedInformation:()=>E3,DiagnosticSeverity:()=>NI,DiagnosticTag:()=>OI,DocumentHighlight:()=>JI,DocumentHighlightKind:()=>QI,DocumentLink:()=>u9,DocumentSymbol:()=>i9,DocumentUri:()=>AI,EOL:()=>$te,FoldingRange:()=>MI,FoldingRangeKind:()=>DI,FormattingOptions:()=>c9,Hover:()=>KI,InlayHint:()=>b9,InlayHintKind:()=>_3,InlayHintLabelPart:()=>R3,InlineCompletionContext:()=>E9,InlineCompletionItem:()=>T9,InlineCompletionList:()=>w9,InlineCompletionTriggerKind:()=>C9,InlineValueContext:()=>v9,InlineValueEvaluatableExpression:()=>y9,InlineValueText:()=>g9,InlineValueVariableLookup:()=>m9,InsertReplaceEdit:()=>WI,InsertTextFormat:()=>qI,InsertTextMode:()=>UI,Location:()=>yx,LocationLink:()=>RI,MarkedString:()=>wx,MarkupContent:()=>Qp,MarkupKind:()=>A3,OptionalVersionedTextDocumentIdentifier:()=>Tx,ParameterInformation:()=>jI,Position:()=>sn,Range:()=>Ur,RenameFile:()=>jp,SelectedCompletionInfo:()=>k9,SelectionRange:()=>h9,SemanticTokenModifiers:()=>f9,SemanticTokenTypes:()=>d9,SemanticTokens:()=>p9,SignatureInformation:()=>ZI,StringValue:()=>x9,SymbolInformation:()=>r9,SymbolKind:()=>e9,SymbolTag:()=>t9,TextDocument:()=>A9,TextDocumentEdit:()=>bx,TextDocumentIdentifier:()=>BI,TextDocumentItem:()=>zI,TextEdit:()=>Gl,URI:()=>C3,VersionedTextDocumentIdentifier:()=>FI,WorkspaceChange:()=>Ote,WorkspaceEdit:()=>S3,WorkspaceFolder:()=>S9,WorkspaceSymbol:()=>n9,integer:()=>_I,uinteger:()=>mx});var AI,C3,_I,mx,sn,Ur,yx,RI,k3,LI,II,DI,MI,E3,NI,OI,$I,vx,Ud,Gl,Hd,ga,Vc,bx,Kp,jp,Zp,S3,xx,PI,Ote,BI,FI,Tx,zI,A3,Qp,GI,qI,VI,WI,UI,HI,YI,XI,wx,KI,jI,ZI,QI,JI,e9,t9,r9,n9,i9,a9,Cx,s9,o9,l9,c9,u9,h9,d9,f9,p9,g9,m9,y9,v9,_3,R3,b9,x9,T9,w9,C9,k9,E9,S9,$te,A9,Pte,rt,kx=mUe({"../../node_modules/.pnpm/vscode-languageserver-types@3.17.5/node_modules/vscode-languageserver-types/lib/esm/main.js"(){var t,e,r,n;(function(i){function a(s){return typeof s=="string"}E(a,"is"),i.is=a})(AI||(AI={})),(function(i){function a(s){return typeof s=="string"}E(a,"is"),i.is=a})(C3||(C3={})),(function(i){i.MIN_VALUE=-2147483648,i.MAX_VALUE=2147483647;function a(s){return typeof s=="number"&&i.MIN_VALUE<=s&&s<=i.MAX_VALUE}E(a,"is"),i.is=a})(_I||(_I={})),(function(i){i.MIN_VALUE=0,i.MAX_VALUE=2147483647;function a(s){return typeof s=="number"&&i.MIN_VALUE<=s&&s<=i.MAX_VALUE}E(a,"is"),i.is=a})(mx||(mx={})),(function(i){function a(o,l){return o===Number.MAX_VALUE&&(o=mx.MAX_VALUE),l===Number.MAX_VALUE&&(l=mx.MAX_VALUE),{line:o,character:l}}E(a,"create"),i.create=a;function s(o){let l=o;return rt.objectLiteral(l)&&rt.uinteger(l.line)&&rt.uinteger(l.character)}E(s,"is"),i.is=s})(sn||(sn={})),(function(i){function a(o,l,u,h){if(rt.uinteger(o)&&rt.uinteger(l)&&rt.uinteger(u)&&rt.uinteger(h))return{start:sn.create(o,l),end:sn.create(u,h)};if(sn.is(o)&&sn.is(l))return{start:o,end:l};throw new Error(`Range#create called with invalid arguments[${o}, ${l}, ${u}, ${h}]`)}E(a,"create"),i.create=a;function s(o){let l=o;return rt.objectLiteral(l)&&sn.is(l.start)&&sn.is(l.end)}E(s,"is"),i.is=s})(Ur||(Ur={})),(function(i){function a(o,l){return{uri:o,range:l}}E(a,"create"),i.create=a;function s(o){let l=o;return rt.objectLiteral(l)&&Ur.is(l.range)&&(rt.string(l.uri)||rt.undefined(l.uri))}E(s,"is"),i.is=s})(yx||(yx={})),(function(i){function a(o,l,u,h){return{targetUri:o,targetRange:l,targetSelectionRange:u,originSelectionRange:h}}E(a,"create"),i.create=a;function s(o){let l=o;return rt.objectLiteral(l)&&Ur.is(l.targetRange)&&rt.string(l.targetUri)&&Ur.is(l.targetSelectionRange)&&(Ur.is(l.originSelectionRange)||rt.undefined(l.originSelectionRange))}E(s,"is"),i.is=s})(RI||(RI={})),(function(i){function a(o,l,u,h){return{red:o,green:l,blue:u,alpha:h}}E(a,"create"),i.create=a;function s(o){const l=o;return rt.objectLiteral(l)&&rt.numberRange(l.red,0,1)&&rt.numberRange(l.green,0,1)&&rt.numberRange(l.blue,0,1)&&rt.numberRange(l.alpha,0,1)}E(s,"is"),i.is=s})(k3||(k3={})),(function(i){function a(o,l){return{range:o,color:l}}E(a,"create"),i.create=a;function s(o){const l=o;return rt.objectLiteral(l)&&Ur.is(l.range)&&k3.is(l.color)}E(s,"is"),i.is=s})(LI||(LI={})),(function(i){function a(o,l,u){return{label:o,textEdit:l,additionalTextEdits:u}}E(a,"create"),i.create=a;function s(o){const l=o;return rt.objectLiteral(l)&&rt.string(l.label)&&(rt.undefined(l.textEdit)||Gl.is(l))&&(rt.undefined(l.additionalTextEdits)||rt.typedArray(l.additionalTextEdits,Gl.is))}E(s,"is"),i.is=s})(II||(II={})),(function(i){i.Comment="comment",i.Imports="imports",i.Region="region"})(DI||(DI={})),(function(i){function a(o,l,u,h,d,f){const p={startLine:o,endLine:l};return rt.defined(u)&&(p.startCharacter=u),rt.defined(h)&&(p.endCharacter=h),rt.defined(d)&&(p.kind=d),rt.defined(f)&&(p.collapsedText=f),p}E(a,"create"),i.create=a;function s(o){const l=o;return rt.objectLiteral(l)&&rt.uinteger(l.startLine)&&rt.uinteger(l.startLine)&&(rt.undefined(l.startCharacter)||rt.uinteger(l.startCharacter))&&(rt.undefined(l.endCharacter)||rt.uinteger(l.endCharacter))&&(rt.undefined(l.kind)||rt.string(l.kind))}E(s,"is"),i.is=s})(MI||(MI={})),(function(i){function a(o,l){return{location:o,message:l}}E(a,"create"),i.create=a;function s(o){let l=o;return rt.defined(l)&&yx.is(l.location)&&rt.string(l.message)}E(s,"is"),i.is=s})(E3||(E3={})),(function(i){i.Error=1,i.Warning=2,i.Information=3,i.Hint=4})(NI||(NI={})),(function(i){i.Unnecessary=1,i.Deprecated=2})(OI||(OI={})),(function(i){function a(s){const o=s;return rt.objectLiteral(o)&&rt.string(o.href)}E(a,"is"),i.is=a})($I||($I={})),(function(i){function a(o,l,u,h,d,f){let p={range:o,message:l};return rt.defined(u)&&(p.severity=u),rt.defined(h)&&(p.code=h),rt.defined(d)&&(p.source=d),rt.defined(f)&&(p.relatedInformation=f),p}E(a,"create"),i.create=a;function s(o){var l;let u=o;return rt.defined(u)&&Ur.is(u.range)&&rt.string(u.message)&&(rt.number(u.severity)||rt.undefined(u.severity))&&(rt.integer(u.code)||rt.string(u.code)||rt.undefined(u.code))&&(rt.undefined(u.codeDescription)||rt.string((l=u.codeDescription)===null||l===void 0?void 0:l.href))&&(rt.string(u.source)||rt.undefined(u.source))&&(rt.undefined(u.relatedInformation)||rt.typedArray(u.relatedInformation,E3.is))}E(s,"is"),i.is=s})(vx||(vx={})),(function(i){function a(o,l,...u){let h={title:o,command:l};return rt.defined(u)&&u.length>0&&(h.arguments=u),h}E(a,"create"),i.create=a;function s(o){let l=o;return rt.defined(l)&&rt.string(l.title)&&rt.string(l.command)}E(s,"is"),i.is=s})(Ud||(Ud={})),(function(i){function a(u,h){return{range:u,newText:h}}E(a,"replace"),i.replace=a;function s(u,h){return{range:{start:u,end:u},newText:h}}E(s,"insert"),i.insert=s;function o(u){return{range:u,newText:""}}E(o,"del"),i.del=o;function l(u){const h=u;return rt.objectLiteral(h)&&rt.string(h.newText)&&Ur.is(h.range)}E(l,"is"),i.is=l})(Gl||(Gl={})),(function(i){function a(o,l,u){const h={label:o};return l!==void 0&&(h.needsConfirmation=l),u!==void 0&&(h.description=u),h}E(a,"create"),i.create=a;function s(o){const l=o;return rt.objectLiteral(l)&&rt.string(l.label)&&(rt.boolean(l.needsConfirmation)||l.needsConfirmation===void 0)&&(rt.string(l.description)||l.description===void 0)}E(s,"is"),i.is=s})(Hd||(Hd={})),(function(i){function a(s){const o=s;return rt.string(o)}E(a,"is"),i.is=a})(ga||(ga={})),(function(i){function a(u,h,d){return{range:u,newText:h,annotationId:d}}E(a,"replace"),i.replace=a;function s(u,h,d){return{range:{start:u,end:u},newText:h,annotationId:d}}E(s,"insert"),i.insert=s;function o(u,h){return{range:u,newText:"",annotationId:h}}E(o,"del"),i.del=o;function l(u){const h=u;return Gl.is(h)&&(Hd.is(h.annotationId)||ga.is(h.annotationId))}E(l,"is"),i.is=l})(Vc||(Vc={})),(function(i){function a(o,l){return{textDocument:o,edits:l}}E(a,"create"),i.create=a;function s(o){let l=o;return rt.defined(l)&&Tx.is(l.textDocument)&&Array.isArray(l.edits)}E(s,"is"),i.is=s})(bx||(bx={})),(function(i){function a(o,l,u){let h={kind:"create",uri:o};return l!==void 0&&(l.overwrite!==void 0||l.ignoreIfExists!==void 0)&&(h.options=l),u!==void 0&&(h.annotationId=u),h}E(a,"create"),i.create=a;function s(o){let l=o;return l&&l.kind==="create"&&rt.string(l.uri)&&(l.options===void 0||(l.options.overwrite===void 0||rt.boolean(l.options.overwrite))&&(l.options.ignoreIfExists===void 0||rt.boolean(l.options.ignoreIfExists)))&&(l.annotationId===void 0||ga.is(l.annotationId))}E(s,"is"),i.is=s})(Kp||(Kp={})),(function(i){function a(o,l,u,h){let d={kind:"rename",oldUri:o,newUri:l};return u!==void 0&&(u.overwrite!==void 0||u.ignoreIfExists!==void 0)&&(d.options=u),h!==void 0&&(d.annotationId=h),d}E(a,"create"),i.create=a;function s(o){let l=o;return l&&l.kind==="rename"&&rt.string(l.oldUri)&&rt.string(l.newUri)&&(l.options===void 0||(l.options.overwrite===void 0||rt.boolean(l.options.overwrite))&&(l.options.ignoreIfExists===void 0||rt.boolean(l.options.ignoreIfExists)))&&(l.annotationId===void 0||ga.is(l.annotationId))}E(s,"is"),i.is=s})(jp||(jp={})),(function(i){function a(o,l,u){let h={kind:"delete",uri:o};return l!==void 0&&(l.recursive!==void 0||l.ignoreIfNotExists!==void 0)&&(h.options=l),u!==void 0&&(h.annotationId=u),h}E(a,"create"),i.create=a;function s(o){let l=o;return l&&l.kind==="delete"&&rt.string(l.uri)&&(l.options===void 0||(l.options.recursive===void 0||rt.boolean(l.options.recursive))&&(l.options.ignoreIfNotExists===void 0||rt.boolean(l.options.ignoreIfNotExists)))&&(l.annotationId===void 0||ga.is(l.annotationId))}E(s,"is"),i.is=s})(Zp||(Zp={})),(function(i){function a(s){let o=s;return o&&(o.changes!==void 0||o.documentChanges!==void 0)&&(o.documentChanges===void 0||o.documentChanges.every(l=>rt.string(l.kind)?Kp.is(l)||jp.is(l)||Zp.is(l):bx.is(l)))}E(a,"is"),i.is=a})(S3||(S3={})),xx=(t=class{constructor(a,s){this.edits=a,this.changeAnnotations=s}insert(a,s,o){let l,u;if(o===void 0?l=Gl.insert(a,s):ga.is(o)?(u=o,l=Vc.insert(a,s,o)):(this.assertChangeAnnotations(this.changeAnnotations),u=this.changeAnnotations.manage(o),l=Vc.insert(a,s,u)),this.edits.push(l),u!==void 0)return u}replace(a,s,o){let l,u;if(o===void 0?l=Gl.replace(a,s):ga.is(o)?(u=o,l=Vc.replace(a,s,o)):(this.assertChangeAnnotations(this.changeAnnotations),u=this.changeAnnotations.manage(o),l=Vc.replace(a,s,u)),this.edits.push(l),u!==void 0)return u}delete(a,s){let o,l;if(s===void 0?o=Gl.del(a):ga.is(s)?(l=s,o=Vc.del(a,s)):(this.assertChangeAnnotations(this.changeAnnotations),l=this.changeAnnotations.manage(s),o=Vc.del(a,l)),this.edits.push(o),l!==void 0)return l}add(a){this.edits.push(a)}all(){return this.edits}clear(){this.edits.splice(0,this.edits.length)}assertChangeAnnotations(a){if(a===void 0)throw new Error("Text edit change is not configured to manage change annotations.")}},E(t,"TextEditChangeImpl"),t),PI=(e=class{constructor(a){this._annotations=a===void 0?Object.create(null):a,this._counter=0,this._size=0}all(){return this._annotations}get size(){return this._size}manage(a,s){let o;if(ga.is(a)?o=a:(o=this.nextId(),s=a),this._annotations[o]!==void 0)throw new Error(`Id ${o} is already in use.`);if(s===void 0)throw new Error(`No annotation provided for id ${o}`);return this._annotations[o]=s,this._size++,o}nextId(){return this._counter++,this._counter.toString()}},E(e,"ChangeAnnotations"),e),Ote=(r=class{constructor(a){this._textEditChanges=Object.create(null),a!==void 0?(this._workspaceEdit=a,a.documentChanges?(this._changeAnnotations=new PI(a.changeAnnotations),a.changeAnnotations=this._changeAnnotations.all(),a.documentChanges.forEach(s=>{if(bx.is(s)){const o=new xx(s.edits,this._changeAnnotations);this._textEditChanges[s.textDocument.uri]=o}})):a.changes&&Object.keys(a.changes).forEach(s=>{const o=new xx(a.changes[s]);this._textEditChanges[s]=o})):this._workspaceEdit={}}get edit(){return this.initDocumentChanges(),this._changeAnnotations!==void 0&&(this._changeAnnotations.size===0?this._workspaceEdit.changeAnnotations=void 0:this._workspaceEdit.changeAnnotations=this._changeAnnotations.all()),this._workspaceEdit}getTextEditChange(a){if(Tx.is(a)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");const s={uri:a.uri,version:a.version};let o=this._textEditChanges[s.uri];if(!o){const l=[],u={textDocument:s,edits:l};this._workspaceEdit.documentChanges.push(u),o=new xx(l,this._changeAnnotations),this._textEditChanges[s.uri]=o}return o}else{if(this.initChanges(),this._workspaceEdit.changes===void 0)throw new Error("Workspace edit is not configured for normal text edit changes.");let s=this._textEditChanges[a];if(!s){let o=[];this._workspaceEdit.changes[a]=o,s=new xx(o),this._textEditChanges[a]=s}return s}}initDocumentChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new PI,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())}initChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._workspaceEdit.changes=Object.create(null))}createFile(a,s,o){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let l;Hd.is(s)||ga.is(s)?l=s:o=s;let u,h;if(l===void 0?u=Kp.create(a,o):(h=ga.is(l)?l:this._changeAnnotations.manage(l),u=Kp.create(a,o,h)),this._workspaceEdit.documentChanges.push(u),h!==void 0)return h}renameFile(a,s,o,l){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let u;Hd.is(o)||ga.is(o)?u=o:l=o;let h,d;if(u===void 0?h=jp.create(a,s,l):(d=ga.is(u)?u:this._changeAnnotations.manage(u),h=jp.create(a,s,l,d)),this._workspaceEdit.documentChanges.push(h),d!==void 0)return d}deleteFile(a,s,o){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let l;Hd.is(s)||ga.is(s)?l=s:o=s;let u,h;if(l===void 0?u=Zp.create(a,o):(h=ga.is(l)?l:this._changeAnnotations.manage(l),u=Zp.create(a,o,h)),this._workspaceEdit.documentChanges.push(u),h!==void 0)return h}},E(r,"WorkspaceChange"),r),(function(i){function a(o){return{uri:o}}E(a,"create"),i.create=a;function s(o){let l=o;return rt.defined(l)&&rt.string(l.uri)}E(s,"is"),i.is=s})(BI||(BI={})),(function(i){function a(o,l){return{uri:o,version:l}}E(a,"create"),i.create=a;function s(o){let l=o;return rt.defined(l)&&rt.string(l.uri)&&rt.integer(l.version)}E(s,"is"),i.is=s})(FI||(FI={})),(function(i){function a(o,l){return{uri:o,version:l}}E(a,"create"),i.create=a;function s(o){let l=o;return rt.defined(l)&&rt.string(l.uri)&&(l.version===null||rt.integer(l.version))}E(s,"is"),i.is=s})(Tx||(Tx={})),(function(i){function a(o,l,u,h){return{uri:o,languageId:l,version:u,text:h}}E(a,"create"),i.create=a;function s(o){let l=o;return rt.defined(l)&&rt.string(l.uri)&&rt.string(l.languageId)&&rt.integer(l.version)&&rt.string(l.text)}E(s,"is"),i.is=s})(zI||(zI={})),(function(i){i.PlainText="plaintext",i.Markdown="markdown";function a(s){const o=s;return o===i.PlainText||o===i.Markdown}E(a,"is"),i.is=a})(A3||(A3={})),(function(i){function a(s){const o=s;return rt.objectLiteral(s)&&A3.is(o.kind)&&rt.string(o.value)}E(a,"is"),i.is=a})(Qp||(Qp={})),(function(i){i.Text=1,i.Method=2,i.Function=3,i.Constructor=4,i.Field=5,i.Variable=6,i.Class=7,i.Interface=8,i.Module=9,i.Property=10,i.Unit=11,i.Value=12,i.Enum=13,i.Keyword=14,i.Snippet=15,i.Color=16,i.File=17,i.Reference=18,i.Folder=19,i.EnumMember=20,i.Constant=21,i.Struct=22,i.Event=23,i.Operator=24,i.TypeParameter=25})(GI||(GI={})),(function(i){i.PlainText=1,i.Snippet=2})(qI||(qI={})),(function(i){i.Deprecated=1})(VI||(VI={})),(function(i){function a(o,l,u){return{newText:o,insert:l,replace:u}}E(a,"create"),i.create=a;function s(o){const l=o;return l&&rt.string(l.newText)&&Ur.is(l.insert)&&Ur.is(l.replace)}E(s,"is"),i.is=s})(WI||(WI={})),(function(i){i.asIs=1,i.adjustIndentation=2})(UI||(UI={})),(function(i){function a(s){const o=s;return o&&(rt.string(o.detail)||o.detail===void 0)&&(rt.string(o.description)||o.description===void 0)}E(a,"is"),i.is=a})(HI||(HI={})),(function(i){function a(s){return{label:s}}E(a,"create"),i.create=a})(YI||(YI={})),(function(i){function a(s,o){return{items:s||[],isIncomplete:!!o}}E(a,"create"),i.create=a})(XI||(XI={})),(function(i){function a(o){return o.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}E(a,"fromPlainText"),i.fromPlainText=a;function s(o){const l=o;return rt.string(l)||rt.objectLiteral(l)&&rt.string(l.language)&&rt.string(l.value)}E(s,"is"),i.is=s})(wx||(wx={})),(function(i){function a(s){let o=s;return!!o&&rt.objectLiteral(o)&&(Qp.is(o.contents)||wx.is(o.contents)||rt.typedArray(o.contents,wx.is))&&(s.range===void 0||Ur.is(s.range))}E(a,"is"),i.is=a})(KI||(KI={})),(function(i){function a(s,o){return o?{label:s,documentation:o}:{label:s}}E(a,"create"),i.create=a})(jI||(jI={})),(function(i){function a(s,o,...l){let u={label:s};return rt.defined(o)&&(u.documentation=o),rt.defined(l)?u.parameters=l:u.parameters=[],u}E(a,"create"),i.create=a})(ZI||(ZI={})),(function(i){i.Text=1,i.Read=2,i.Write=3})(QI||(QI={})),(function(i){function a(s,o){let l={range:s};return rt.number(o)&&(l.kind=o),l}E(a,"create"),i.create=a})(JI||(JI={})),(function(i){i.File=1,i.Module=2,i.Namespace=3,i.Package=4,i.Class=5,i.Method=6,i.Property=7,i.Field=8,i.Constructor=9,i.Enum=10,i.Interface=11,i.Function=12,i.Variable=13,i.Constant=14,i.String=15,i.Number=16,i.Boolean=17,i.Array=18,i.Object=19,i.Key=20,i.Null=21,i.EnumMember=22,i.Struct=23,i.Event=24,i.Operator=25,i.TypeParameter=26})(e9||(e9={})),(function(i){i.Deprecated=1})(t9||(t9={})),(function(i){function a(s,o,l,u,h){let d={name:s,kind:o,location:{uri:u,range:l}};return h&&(d.containerName=h),d}E(a,"create"),i.create=a})(r9||(r9={})),(function(i){function a(s,o,l,u){return u!==void 0?{name:s,kind:o,location:{uri:l,range:u}}:{name:s,kind:o,location:{uri:l}}}E(a,"create"),i.create=a})(n9||(n9={})),(function(i){function a(o,l,u,h,d,f){let p={name:o,detail:l,kind:u,range:h,selectionRange:d};return f!==void 0&&(p.children=f),p}E(a,"create"),i.create=a;function s(o){let l=o;return l&&rt.string(l.name)&&rt.number(l.kind)&&Ur.is(l.range)&&Ur.is(l.selectionRange)&&(l.detail===void 0||rt.string(l.detail))&&(l.deprecated===void 0||rt.boolean(l.deprecated))&&(l.children===void 0||Array.isArray(l.children))&&(l.tags===void 0||Array.isArray(l.tags))}E(s,"is"),i.is=s})(i9||(i9={})),(function(i){i.Empty="",i.QuickFix="quickfix",i.Refactor="refactor",i.RefactorExtract="refactor.extract",i.RefactorInline="refactor.inline",i.RefactorRewrite="refactor.rewrite",i.Source="source",i.SourceOrganizeImports="source.organizeImports",i.SourceFixAll="source.fixAll"})(a9||(a9={})),(function(i){i.Invoked=1,i.Automatic=2})(Cx||(Cx={})),(function(i){function a(o,l,u){let h={diagnostics:o};return l!=null&&(h.only=l),u!=null&&(h.triggerKind=u),h}E(a,"create"),i.create=a;function s(o){let l=o;return rt.defined(l)&&rt.typedArray(l.diagnostics,vx.is)&&(l.only===void 0||rt.typedArray(l.only,rt.string))&&(l.triggerKind===void 0||l.triggerKind===Cx.Invoked||l.triggerKind===Cx.Automatic)}E(s,"is"),i.is=s})(s9||(s9={})),(function(i){function a(o,l,u){let h={title:o},d=!0;return typeof l=="string"?(d=!1,h.kind=l):Ud.is(l)?h.command=l:h.edit=l,d&&u!==void 0&&(h.kind=u),h}E(a,"create"),i.create=a;function s(o){let l=o;return l&&rt.string(l.title)&&(l.diagnostics===void 0||rt.typedArray(l.diagnostics,vx.is))&&(l.kind===void 0||rt.string(l.kind))&&(l.edit!==void 0||l.command!==void 0)&&(l.command===void 0||Ud.is(l.command))&&(l.isPreferred===void 0||rt.boolean(l.isPreferred))&&(l.edit===void 0||S3.is(l.edit))}E(s,"is"),i.is=s})(o9||(o9={})),(function(i){function a(o,l){let u={range:o};return rt.defined(l)&&(u.data=l),u}E(a,"create"),i.create=a;function s(o){let l=o;return rt.defined(l)&&Ur.is(l.range)&&(rt.undefined(l.command)||Ud.is(l.command))}E(s,"is"),i.is=s})(l9||(l9={})),(function(i){function a(o,l){return{tabSize:o,insertSpaces:l}}E(a,"create"),i.create=a;function s(o){let l=o;return rt.defined(l)&&rt.uinteger(l.tabSize)&&rt.boolean(l.insertSpaces)}E(s,"is"),i.is=s})(c9||(c9={})),(function(i){function a(o,l,u){return{range:o,target:l,data:u}}E(a,"create"),i.create=a;function s(o){let l=o;return rt.defined(l)&&Ur.is(l.range)&&(rt.undefined(l.target)||rt.string(l.target))}E(s,"is"),i.is=s})(u9||(u9={})),(function(i){function a(o,l){return{range:o,parent:l}}E(a,"create"),i.create=a;function s(o){let l=o;return rt.objectLiteral(l)&&Ur.is(l.range)&&(l.parent===void 0||i.is(l.parent))}E(s,"is"),i.is=s})(h9||(h9={})),(function(i){i.namespace="namespace",i.type="type",i.class="class",i.enum="enum",i.interface="interface",i.struct="struct",i.typeParameter="typeParameter",i.parameter="parameter",i.variable="variable",i.property="property",i.enumMember="enumMember",i.event="event",i.function="function",i.method="method",i.macro="macro",i.keyword="keyword",i.modifier="modifier",i.comment="comment",i.string="string",i.number="number",i.regexp="regexp",i.operator="operator",i.decorator="decorator"})(d9||(d9={})),(function(i){i.declaration="declaration",i.definition="definition",i.readonly="readonly",i.static="static",i.deprecated="deprecated",i.abstract="abstract",i.async="async",i.modification="modification",i.documentation="documentation",i.defaultLibrary="defaultLibrary"})(f9||(f9={})),(function(i){function a(s){const o=s;return rt.objectLiteral(o)&&(o.resultId===void 0||typeof o.resultId=="string")&&Array.isArray(o.data)&&(o.data.length===0||typeof o.data[0]=="number")}E(a,"is"),i.is=a})(p9||(p9={})),(function(i){function a(o,l){return{range:o,text:l}}E(a,"create"),i.create=a;function s(o){const l=o;return l!=null&&Ur.is(l.range)&&rt.string(l.text)}E(s,"is"),i.is=s})(g9||(g9={})),(function(i){function a(o,l,u){return{range:o,variableName:l,caseSensitiveLookup:u}}E(a,"create"),i.create=a;function s(o){const l=o;return l!=null&&Ur.is(l.range)&&rt.boolean(l.caseSensitiveLookup)&&(rt.string(l.variableName)||l.variableName===void 0)}E(s,"is"),i.is=s})(m9||(m9={})),(function(i){function a(o,l){return{range:o,expression:l}}E(a,"create"),i.create=a;function s(o){const l=o;return l!=null&&Ur.is(l.range)&&(rt.string(l.expression)||l.expression===void 0)}E(s,"is"),i.is=s})(y9||(y9={})),(function(i){function a(o,l){return{frameId:o,stoppedLocation:l}}E(a,"create"),i.create=a;function s(o){const l=o;return rt.defined(l)&&Ur.is(o.stoppedLocation)}E(s,"is"),i.is=s})(v9||(v9={})),(function(i){i.Type=1,i.Parameter=2;function a(s){return s===1||s===2}E(a,"is"),i.is=a})(_3||(_3={})),(function(i){function a(o){return{value:o}}E(a,"create"),i.create=a;function s(o){const l=o;return rt.objectLiteral(l)&&(l.tooltip===void 0||rt.string(l.tooltip)||Qp.is(l.tooltip))&&(l.location===void 0||yx.is(l.location))&&(l.command===void 0||Ud.is(l.command))}E(s,"is"),i.is=s})(R3||(R3={})),(function(i){function a(o,l,u){const h={position:o,label:l};return u!==void 0&&(h.kind=u),h}E(a,"create"),i.create=a;function s(o){const l=o;return rt.objectLiteral(l)&&sn.is(l.position)&&(rt.string(l.label)||rt.typedArray(l.label,R3.is))&&(l.kind===void 0||_3.is(l.kind))&&l.textEdits===void 0||rt.typedArray(l.textEdits,Gl.is)&&(l.tooltip===void 0||rt.string(l.tooltip)||Qp.is(l.tooltip))&&(l.paddingLeft===void 0||rt.boolean(l.paddingLeft))&&(l.paddingRight===void 0||rt.boolean(l.paddingRight))}E(s,"is"),i.is=s})(b9||(b9={})),(function(i){function a(s){return{kind:"snippet",value:s}}E(a,"createSnippet"),i.createSnippet=a})(x9||(x9={})),(function(i){function a(s,o,l,u){return{insertText:s,filterText:o,range:l,command:u}}E(a,"create"),i.create=a})(T9||(T9={})),(function(i){function a(s){return{items:s}}E(a,"create"),i.create=a})(w9||(w9={})),(function(i){i.Invoked=0,i.Automatic=1})(C9||(C9={})),(function(i){function a(s,o){return{range:s,text:o}}E(a,"create"),i.create=a})(k9||(k9={})),(function(i){function a(s,o){return{triggerKind:s,selectedCompletionInfo:o}}E(a,"create"),i.create=a})(E9||(E9={})),(function(i){function a(s){const o=s;return rt.objectLiteral(o)&&C3.is(o.uri)&&rt.string(o.name)}E(a,"is"),i.is=a})(S9||(S9={})),$te=[` +`},"getStyles"),Zet=Ket,Qet={parser:Het,get db(){return new Yet},renderer:Kle,styles:Zet};const Jet=Object.freeze(Object.defineProperty({__proto__:null,diagram:Qet},Symbol.toStringTag,{value:"Module"}));function Rc(t,e){var r,n,i;t.accDescr&&((r=e.setAccDescription)==null||r.call(e,t.accDescr)),t.accTitle&&((n=e.setAccTitle)==null||n.call(e,t.accTitle)),t.title&&((i=e.setDiagramTitle)==null||i.call(e,t.title))}T(Rc,"populateCommonDb");var ZN=(dy=class{constructor(e){this.init=e,this.records=this.init()}reset(){this.records=this.init()}},T(dy,"ImperativeState"),dy),ett=Object.create,ww=Object.defineProperty,ttt=Object.getOwnPropertyDescriptor,QN=Object.getOwnPropertyNames,rtt=Object.getPrototypeOf,ntt=Object.prototype.hasOwnProperty,E=(t,e)=>ww(t,"name",{value:e,configurable:!0}),itt=(t,e)=>function(){return t&&(e=(0,t[QN(t)[0]])(t=0)),e},Gr=(t,e)=>function(){return e||(0,t[QN(t)[0]])((e={exports:{}}).exports,e),e.exports},gd=(t,e)=>{for(var r in e)ww(t,r,{get:e[r],enumerable:!0})},JN=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of QN(e))!ntt.call(t,i)&&i!==r&&ww(t,i,{get:()=>e[i],enumerable:!(n=ttt(e,i))||n.enumerable});return t},xS=(t,e,r)=>(JN(t,e,"default"),r),e$=(t,e,r)=>(r=t!=null?ett(rtt(t)):{},JN(ww(r,"default",{value:t,enumerable:!0}),t)),t$=t=>JN(ww({},"__esModule",{value:!0}),t),TS={};gd(TS,{AnnotatedTextEdit:()=>qu,ChangeAnnotation:()=>cp,ChangeAnnotationIdentifier:()=>za,CodeAction:()=>O$,CodeActionContext:()=>$$,CodeActionKind:()=>N$,CodeActionTriggerKind:()=>Lw,CodeDescription:()=>h$,CodeLens:()=>P$,Color:()=>CS,ColorInformation:()=>a$,ColorPresentation:()=>s$,Command:()=>lp,CompletionItem:()=>w$,CompletionItemKind:()=>m$,CompletionItemLabelDetails:()=>T$,CompletionItemTag:()=>v$,CompletionList:()=>C$,CreateFile:()=>Am,DeleteFile:()=>Lm,Diagnostic:()=>Ew,DiagnosticRelatedInformation:()=>kS,DiagnosticSeverity:()=>c$,DiagnosticTag:()=>u$,DocumentHighlight:()=>A$,DocumentHighlightKind:()=>_$,DocumentLink:()=>F$,DocumentSymbol:()=>M$,DocumentUri:()=>r$,EOL:()=>Jle,FoldingRange:()=>l$,FoldingRangeKind:()=>o$,FormattingOptions:()=>B$,Hover:()=>k$,InlayHint:()=>X$,InlayHintKind:()=>_S,InlayHintLabelPart:()=>AS,InlineCompletionContext:()=>eO,InlineCompletionItem:()=>K$,InlineCompletionList:()=>Z$,InlineCompletionTriggerKind:()=>Q$,InlineValueContext:()=>Y$,InlineValueEvaluatableExpression:()=>H$,InlineValueText:()=>W$,InlineValueVariableLookup:()=>U$,InsertReplaceEdit:()=>b$,InsertTextFormat:()=>y$,InsertTextMode:()=>x$,Location:()=>kw,LocationLink:()=>i$,MarkedString:()=>Rw,MarkupContent:()=>Im,MarkupKind:()=>SS,OptionalVersionedTextDocumentIdentifier:()=>Aw,ParameterInformation:()=>E$,Position:()=>gn,Range:()=>en,RenameFile:()=>Rm,SelectedCompletionInfo:()=>J$,SelectionRange:()=>z$,SemanticTokenModifiers:()=>q$,SemanticTokenTypes:()=>G$,SemanticTokens:()=>V$,SignatureInformation:()=>S$,StringValue:()=>j$,SymbolInformation:()=>I$,SymbolKind:()=>R$,SymbolTag:()=>L$,TextDocument:()=>rO,TextDocumentEdit:()=>Sw,TextDocumentIdentifier:()=>f$,TextDocumentItem:()=>g$,TextEdit:()=>Lc,URI:()=>wS,VersionedTextDocumentIdentifier:()=>p$,WorkspaceChange:()=>Qle,WorkspaceEdit:()=>ES,WorkspaceFolder:()=>tO,WorkspaceSymbol:()=>D$,integer:()=>n$,uinteger:()=>Cw});var r$,wS,n$,Cw,gn,en,kw,i$,CS,a$,s$,o$,l$,kS,c$,u$,h$,Ew,lp,Lc,cp,za,qu,Sw,Am,Rm,Lm,ES,_w,d$,Qle,f$,p$,Aw,g$,SS,Im,m$,y$,v$,b$,x$,T$,w$,C$,Rw,k$,E$,S$,_$,A$,R$,L$,I$,D$,M$,N$,Lw,$$,O$,P$,B$,F$,z$,G$,q$,V$,W$,U$,H$,Y$,_S,AS,X$,j$,K$,Z$,Q$,J$,eO,tO,Jle,rO,ece,rt,Iw=itt({"../../node_modules/.pnpm/vscode-languageserver-types@3.17.5/node_modules/vscode-languageserver-types/lib/esm/main.js"(){var t,e,r,n;(function(i){function a(s){return typeof s=="string"}E(a,"is"),i.is=a})(r$||(r$={})),(function(i){function a(s){return typeof s=="string"}E(a,"is"),i.is=a})(wS||(wS={})),(function(i){i.MIN_VALUE=-2147483648,i.MAX_VALUE=2147483647;function a(s){return typeof s=="number"&&i.MIN_VALUE<=s&&s<=i.MAX_VALUE}E(a,"is"),i.is=a})(n$||(n$={})),(function(i){i.MIN_VALUE=0,i.MAX_VALUE=2147483647;function a(s){return typeof s=="number"&&i.MIN_VALUE<=s&&s<=i.MAX_VALUE}E(a,"is"),i.is=a})(Cw||(Cw={})),(function(i){function a(o,l){return o===Number.MAX_VALUE&&(o=Cw.MAX_VALUE),l===Number.MAX_VALUE&&(l=Cw.MAX_VALUE),{line:o,character:l}}E(a,"create"),i.create=a;function s(o){let l=o;return rt.objectLiteral(l)&&rt.uinteger(l.line)&&rt.uinteger(l.character)}E(s,"is"),i.is=s})(gn||(gn={})),(function(i){function a(o,l,u,h){if(rt.uinteger(o)&&rt.uinteger(l)&&rt.uinteger(u)&&rt.uinteger(h))return{start:gn.create(o,l),end:gn.create(u,h)};if(gn.is(o)&&gn.is(l))return{start:o,end:l};throw new Error(`Range#create called with invalid arguments[${o}, ${l}, ${u}, ${h}]`)}E(a,"create"),i.create=a;function s(o){let l=o;return rt.objectLiteral(l)&&gn.is(l.start)&&gn.is(l.end)}E(s,"is"),i.is=s})(en||(en={})),(function(i){function a(o,l){return{uri:o,range:l}}E(a,"create"),i.create=a;function s(o){let l=o;return rt.objectLiteral(l)&&en.is(l.range)&&(rt.string(l.uri)||rt.undefined(l.uri))}E(s,"is"),i.is=s})(kw||(kw={})),(function(i){function a(o,l,u,h){return{targetUri:o,targetRange:l,targetSelectionRange:u,originSelectionRange:h}}E(a,"create"),i.create=a;function s(o){let l=o;return rt.objectLiteral(l)&&en.is(l.targetRange)&&rt.string(l.targetUri)&&en.is(l.targetSelectionRange)&&(en.is(l.originSelectionRange)||rt.undefined(l.originSelectionRange))}E(s,"is"),i.is=s})(i$||(i$={})),(function(i){function a(o,l,u,h){return{red:o,green:l,blue:u,alpha:h}}E(a,"create"),i.create=a;function s(o){const l=o;return rt.objectLiteral(l)&&rt.numberRange(l.red,0,1)&&rt.numberRange(l.green,0,1)&&rt.numberRange(l.blue,0,1)&&rt.numberRange(l.alpha,0,1)}E(s,"is"),i.is=s})(CS||(CS={})),(function(i){function a(o,l){return{range:o,color:l}}E(a,"create"),i.create=a;function s(o){const l=o;return rt.objectLiteral(l)&&en.is(l.range)&&CS.is(l.color)}E(s,"is"),i.is=s})(a$||(a$={})),(function(i){function a(o,l,u){return{label:o,textEdit:l,additionalTextEdits:u}}E(a,"create"),i.create=a;function s(o){const l=o;return rt.objectLiteral(l)&&rt.string(l.label)&&(rt.undefined(l.textEdit)||Lc.is(l))&&(rt.undefined(l.additionalTextEdits)||rt.typedArray(l.additionalTextEdits,Lc.is))}E(s,"is"),i.is=s})(s$||(s$={})),(function(i){i.Comment="comment",i.Imports="imports",i.Region="region"})(o$||(o$={})),(function(i){function a(o,l,u,h,d,f){const p={startLine:o,endLine:l};return rt.defined(u)&&(p.startCharacter=u),rt.defined(h)&&(p.endCharacter=h),rt.defined(d)&&(p.kind=d),rt.defined(f)&&(p.collapsedText=f),p}E(a,"create"),i.create=a;function s(o){const l=o;return rt.objectLiteral(l)&&rt.uinteger(l.startLine)&&rt.uinteger(l.startLine)&&(rt.undefined(l.startCharacter)||rt.uinteger(l.startCharacter))&&(rt.undefined(l.endCharacter)||rt.uinteger(l.endCharacter))&&(rt.undefined(l.kind)||rt.string(l.kind))}E(s,"is"),i.is=s})(l$||(l$={})),(function(i){function a(o,l){return{location:o,message:l}}E(a,"create"),i.create=a;function s(o){let l=o;return rt.defined(l)&&kw.is(l.location)&&rt.string(l.message)}E(s,"is"),i.is=s})(kS||(kS={})),(function(i){i.Error=1,i.Warning=2,i.Information=3,i.Hint=4})(c$||(c$={})),(function(i){i.Unnecessary=1,i.Deprecated=2})(u$||(u$={})),(function(i){function a(s){const o=s;return rt.objectLiteral(o)&&rt.string(o.href)}E(a,"is"),i.is=a})(h$||(h$={})),(function(i){function a(o,l,u,h,d,f){let p={range:o,message:l};return rt.defined(u)&&(p.severity=u),rt.defined(h)&&(p.code=h),rt.defined(d)&&(p.source=d),rt.defined(f)&&(p.relatedInformation=f),p}E(a,"create"),i.create=a;function s(o){var l;let u=o;return rt.defined(u)&&en.is(u.range)&&rt.string(u.message)&&(rt.number(u.severity)||rt.undefined(u.severity))&&(rt.integer(u.code)||rt.string(u.code)||rt.undefined(u.code))&&(rt.undefined(u.codeDescription)||rt.string((l=u.codeDescription)===null||l===void 0?void 0:l.href))&&(rt.string(u.source)||rt.undefined(u.source))&&(rt.undefined(u.relatedInformation)||rt.typedArray(u.relatedInformation,kS.is))}E(s,"is"),i.is=s})(Ew||(Ew={})),(function(i){function a(o,l,...u){let h={title:o,command:l};return rt.defined(u)&&u.length>0&&(h.arguments=u),h}E(a,"create"),i.create=a;function s(o){let l=o;return rt.defined(l)&&rt.string(l.title)&&rt.string(l.command)}E(s,"is"),i.is=s})(lp||(lp={})),(function(i){function a(u,h){return{range:u,newText:h}}E(a,"replace"),i.replace=a;function s(u,h){return{range:{start:u,end:u},newText:h}}E(s,"insert"),i.insert=s;function o(u){return{range:u,newText:""}}E(o,"del"),i.del=o;function l(u){const h=u;return rt.objectLiteral(h)&&rt.string(h.newText)&&en.is(h.range)}E(l,"is"),i.is=l})(Lc||(Lc={})),(function(i){function a(o,l,u){const h={label:o};return l!==void 0&&(h.needsConfirmation=l),u!==void 0&&(h.description=u),h}E(a,"create"),i.create=a;function s(o){const l=o;return rt.objectLiteral(l)&&rt.string(l.label)&&(rt.boolean(l.needsConfirmation)||l.needsConfirmation===void 0)&&(rt.string(l.description)||l.description===void 0)}E(s,"is"),i.is=s})(cp||(cp={})),(function(i){function a(s){const o=s;return rt.string(o)}E(a,"is"),i.is=a})(za||(za={})),(function(i){function a(u,h,d){return{range:u,newText:h,annotationId:d}}E(a,"replace"),i.replace=a;function s(u,h,d){return{range:{start:u,end:u},newText:h,annotationId:d}}E(s,"insert"),i.insert=s;function o(u,h){return{range:u,newText:"",annotationId:h}}E(o,"del"),i.del=o;function l(u){const h=u;return Lc.is(h)&&(cp.is(h.annotationId)||za.is(h.annotationId))}E(l,"is"),i.is=l})(qu||(qu={})),(function(i){function a(o,l){return{textDocument:o,edits:l}}E(a,"create"),i.create=a;function s(o){let l=o;return rt.defined(l)&&Aw.is(l.textDocument)&&Array.isArray(l.edits)}E(s,"is"),i.is=s})(Sw||(Sw={})),(function(i){function a(o,l,u){let h={kind:"create",uri:o};return l!==void 0&&(l.overwrite!==void 0||l.ignoreIfExists!==void 0)&&(h.options=l),u!==void 0&&(h.annotationId=u),h}E(a,"create"),i.create=a;function s(o){let l=o;return l&&l.kind==="create"&&rt.string(l.uri)&&(l.options===void 0||(l.options.overwrite===void 0||rt.boolean(l.options.overwrite))&&(l.options.ignoreIfExists===void 0||rt.boolean(l.options.ignoreIfExists)))&&(l.annotationId===void 0||za.is(l.annotationId))}E(s,"is"),i.is=s})(Am||(Am={})),(function(i){function a(o,l,u,h){let d={kind:"rename",oldUri:o,newUri:l};return u!==void 0&&(u.overwrite!==void 0||u.ignoreIfExists!==void 0)&&(d.options=u),h!==void 0&&(d.annotationId=h),d}E(a,"create"),i.create=a;function s(o){let l=o;return l&&l.kind==="rename"&&rt.string(l.oldUri)&&rt.string(l.newUri)&&(l.options===void 0||(l.options.overwrite===void 0||rt.boolean(l.options.overwrite))&&(l.options.ignoreIfExists===void 0||rt.boolean(l.options.ignoreIfExists)))&&(l.annotationId===void 0||za.is(l.annotationId))}E(s,"is"),i.is=s})(Rm||(Rm={})),(function(i){function a(o,l,u){let h={kind:"delete",uri:o};return l!==void 0&&(l.recursive!==void 0||l.ignoreIfNotExists!==void 0)&&(h.options=l),u!==void 0&&(h.annotationId=u),h}E(a,"create"),i.create=a;function s(o){let l=o;return l&&l.kind==="delete"&&rt.string(l.uri)&&(l.options===void 0||(l.options.recursive===void 0||rt.boolean(l.options.recursive))&&(l.options.ignoreIfNotExists===void 0||rt.boolean(l.options.ignoreIfNotExists)))&&(l.annotationId===void 0||za.is(l.annotationId))}E(s,"is"),i.is=s})(Lm||(Lm={})),(function(i){function a(s){let o=s;return o&&(o.changes!==void 0||o.documentChanges!==void 0)&&(o.documentChanges===void 0||o.documentChanges.every(l=>rt.string(l.kind)?Am.is(l)||Rm.is(l)||Lm.is(l):Sw.is(l)))}E(a,"is"),i.is=a})(ES||(ES={})),_w=(t=class{constructor(a,s){this.edits=a,this.changeAnnotations=s}insert(a,s,o){let l,u;if(o===void 0?l=Lc.insert(a,s):za.is(o)?(u=o,l=qu.insert(a,s,o)):(this.assertChangeAnnotations(this.changeAnnotations),u=this.changeAnnotations.manage(o),l=qu.insert(a,s,u)),this.edits.push(l),u!==void 0)return u}replace(a,s,o){let l,u;if(o===void 0?l=Lc.replace(a,s):za.is(o)?(u=o,l=qu.replace(a,s,o)):(this.assertChangeAnnotations(this.changeAnnotations),u=this.changeAnnotations.manage(o),l=qu.replace(a,s,u)),this.edits.push(l),u!==void 0)return u}delete(a,s){let o,l;if(s===void 0?o=Lc.del(a):za.is(s)?(l=s,o=qu.del(a,s)):(this.assertChangeAnnotations(this.changeAnnotations),l=this.changeAnnotations.manage(s),o=qu.del(a,l)),this.edits.push(o),l!==void 0)return l}add(a){this.edits.push(a)}all(){return this.edits}clear(){this.edits.splice(0,this.edits.length)}assertChangeAnnotations(a){if(a===void 0)throw new Error("Text edit change is not configured to manage change annotations.")}},E(t,"TextEditChangeImpl"),t),d$=(e=class{constructor(a){this._annotations=a===void 0?Object.create(null):a,this._counter=0,this._size=0}all(){return this._annotations}get size(){return this._size}manage(a,s){let o;if(za.is(a)?o=a:(o=this.nextId(),s=a),this._annotations[o]!==void 0)throw new Error(`Id ${o} is already in use.`);if(s===void 0)throw new Error(`No annotation provided for id ${o}`);return this._annotations[o]=s,this._size++,o}nextId(){return this._counter++,this._counter.toString()}},E(e,"ChangeAnnotations"),e),Qle=(r=class{constructor(a){this._textEditChanges=Object.create(null),a!==void 0?(this._workspaceEdit=a,a.documentChanges?(this._changeAnnotations=new d$(a.changeAnnotations),a.changeAnnotations=this._changeAnnotations.all(),a.documentChanges.forEach(s=>{if(Sw.is(s)){const o=new _w(s.edits,this._changeAnnotations);this._textEditChanges[s.textDocument.uri]=o}})):a.changes&&Object.keys(a.changes).forEach(s=>{const o=new _w(a.changes[s]);this._textEditChanges[s]=o})):this._workspaceEdit={}}get edit(){return this.initDocumentChanges(),this._changeAnnotations!==void 0&&(this._changeAnnotations.size===0?this._workspaceEdit.changeAnnotations=void 0:this._workspaceEdit.changeAnnotations=this._changeAnnotations.all()),this._workspaceEdit}getTextEditChange(a){if(Aw.is(a)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");const s={uri:a.uri,version:a.version};let o=this._textEditChanges[s.uri];if(!o){const l=[],u={textDocument:s,edits:l};this._workspaceEdit.documentChanges.push(u),o=new _w(l,this._changeAnnotations),this._textEditChanges[s.uri]=o}return o}else{if(this.initChanges(),this._workspaceEdit.changes===void 0)throw new Error("Workspace edit is not configured for normal text edit changes.");let s=this._textEditChanges[a];if(!s){let o=[];this._workspaceEdit.changes[a]=o,s=new _w(o),this._textEditChanges[a]=s}return s}}initDocumentChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new d$,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())}initChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._workspaceEdit.changes=Object.create(null))}createFile(a,s,o){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let l;cp.is(s)||za.is(s)?l=s:o=s;let u,h;if(l===void 0?u=Am.create(a,o):(h=za.is(l)?l:this._changeAnnotations.manage(l),u=Am.create(a,o,h)),this._workspaceEdit.documentChanges.push(u),h!==void 0)return h}renameFile(a,s,o,l){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let u;cp.is(o)||za.is(o)?u=o:l=o;let h,d;if(u===void 0?h=Rm.create(a,s,l):(d=za.is(u)?u:this._changeAnnotations.manage(u),h=Rm.create(a,s,l,d)),this._workspaceEdit.documentChanges.push(h),d!==void 0)return d}deleteFile(a,s,o){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let l;cp.is(s)||za.is(s)?l=s:o=s;let u,h;if(l===void 0?u=Lm.create(a,o):(h=za.is(l)?l:this._changeAnnotations.manage(l),u=Lm.create(a,o,h)),this._workspaceEdit.documentChanges.push(u),h!==void 0)return h}},E(r,"WorkspaceChange"),r),(function(i){function a(o){return{uri:o}}E(a,"create"),i.create=a;function s(o){let l=o;return rt.defined(l)&&rt.string(l.uri)}E(s,"is"),i.is=s})(f$||(f$={})),(function(i){function a(o,l){return{uri:o,version:l}}E(a,"create"),i.create=a;function s(o){let l=o;return rt.defined(l)&&rt.string(l.uri)&&rt.integer(l.version)}E(s,"is"),i.is=s})(p$||(p$={})),(function(i){function a(o,l){return{uri:o,version:l}}E(a,"create"),i.create=a;function s(o){let l=o;return rt.defined(l)&&rt.string(l.uri)&&(l.version===null||rt.integer(l.version))}E(s,"is"),i.is=s})(Aw||(Aw={})),(function(i){function a(o,l,u,h){return{uri:o,languageId:l,version:u,text:h}}E(a,"create"),i.create=a;function s(o){let l=o;return rt.defined(l)&&rt.string(l.uri)&&rt.string(l.languageId)&&rt.integer(l.version)&&rt.string(l.text)}E(s,"is"),i.is=s})(g$||(g$={})),(function(i){i.PlainText="plaintext",i.Markdown="markdown";function a(s){const o=s;return o===i.PlainText||o===i.Markdown}E(a,"is"),i.is=a})(SS||(SS={})),(function(i){function a(s){const o=s;return rt.objectLiteral(s)&&SS.is(o.kind)&&rt.string(o.value)}E(a,"is"),i.is=a})(Im||(Im={})),(function(i){i.Text=1,i.Method=2,i.Function=3,i.Constructor=4,i.Field=5,i.Variable=6,i.Class=7,i.Interface=8,i.Module=9,i.Property=10,i.Unit=11,i.Value=12,i.Enum=13,i.Keyword=14,i.Snippet=15,i.Color=16,i.File=17,i.Reference=18,i.Folder=19,i.EnumMember=20,i.Constant=21,i.Struct=22,i.Event=23,i.Operator=24,i.TypeParameter=25})(m$||(m$={})),(function(i){i.PlainText=1,i.Snippet=2})(y$||(y$={})),(function(i){i.Deprecated=1})(v$||(v$={})),(function(i){function a(o,l,u){return{newText:o,insert:l,replace:u}}E(a,"create"),i.create=a;function s(o){const l=o;return l&&rt.string(l.newText)&&en.is(l.insert)&&en.is(l.replace)}E(s,"is"),i.is=s})(b$||(b$={})),(function(i){i.asIs=1,i.adjustIndentation=2})(x$||(x$={})),(function(i){function a(s){const o=s;return o&&(rt.string(o.detail)||o.detail===void 0)&&(rt.string(o.description)||o.description===void 0)}E(a,"is"),i.is=a})(T$||(T$={})),(function(i){function a(s){return{label:s}}E(a,"create"),i.create=a})(w$||(w$={})),(function(i){function a(s,o){return{items:s||[],isIncomplete:!!o}}E(a,"create"),i.create=a})(C$||(C$={})),(function(i){function a(o){return o.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}E(a,"fromPlainText"),i.fromPlainText=a;function s(o){const l=o;return rt.string(l)||rt.objectLiteral(l)&&rt.string(l.language)&&rt.string(l.value)}E(s,"is"),i.is=s})(Rw||(Rw={})),(function(i){function a(s){let o=s;return!!o&&rt.objectLiteral(o)&&(Im.is(o.contents)||Rw.is(o.contents)||rt.typedArray(o.contents,Rw.is))&&(s.range===void 0||en.is(s.range))}E(a,"is"),i.is=a})(k$||(k$={})),(function(i){function a(s,o){return o?{label:s,documentation:o}:{label:s}}E(a,"create"),i.create=a})(E$||(E$={})),(function(i){function a(s,o,...l){let u={label:s};return rt.defined(o)&&(u.documentation=o),rt.defined(l)?u.parameters=l:u.parameters=[],u}E(a,"create"),i.create=a})(S$||(S$={})),(function(i){i.Text=1,i.Read=2,i.Write=3})(_$||(_$={})),(function(i){function a(s,o){let l={range:s};return rt.number(o)&&(l.kind=o),l}E(a,"create"),i.create=a})(A$||(A$={})),(function(i){i.File=1,i.Module=2,i.Namespace=3,i.Package=4,i.Class=5,i.Method=6,i.Property=7,i.Field=8,i.Constructor=9,i.Enum=10,i.Interface=11,i.Function=12,i.Variable=13,i.Constant=14,i.String=15,i.Number=16,i.Boolean=17,i.Array=18,i.Object=19,i.Key=20,i.Null=21,i.EnumMember=22,i.Struct=23,i.Event=24,i.Operator=25,i.TypeParameter=26})(R$||(R$={})),(function(i){i.Deprecated=1})(L$||(L$={})),(function(i){function a(s,o,l,u,h){let d={name:s,kind:o,location:{uri:u,range:l}};return h&&(d.containerName=h),d}E(a,"create"),i.create=a})(I$||(I$={})),(function(i){function a(s,o,l,u){return u!==void 0?{name:s,kind:o,location:{uri:l,range:u}}:{name:s,kind:o,location:{uri:l}}}E(a,"create"),i.create=a})(D$||(D$={})),(function(i){function a(o,l,u,h,d,f){let p={name:o,detail:l,kind:u,range:h,selectionRange:d};return f!==void 0&&(p.children=f),p}E(a,"create"),i.create=a;function s(o){let l=o;return l&&rt.string(l.name)&&rt.number(l.kind)&&en.is(l.range)&&en.is(l.selectionRange)&&(l.detail===void 0||rt.string(l.detail))&&(l.deprecated===void 0||rt.boolean(l.deprecated))&&(l.children===void 0||Array.isArray(l.children))&&(l.tags===void 0||Array.isArray(l.tags))}E(s,"is"),i.is=s})(M$||(M$={})),(function(i){i.Empty="",i.QuickFix="quickfix",i.Refactor="refactor",i.RefactorExtract="refactor.extract",i.RefactorInline="refactor.inline",i.RefactorRewrite="refactor.rewrite",i.Source="source",i.SourceOrganizeImports="source.organizeImports",i.SourceFixAll="source.fixAll"})(N$||(N$={})),(function(i){i.Invoked=1,i.Automatic=2})(Lw||(Lw={})),(function(i){function a(o,l,u){let h={diagnostics:o};return l!=null&&(h.only=l),u!=null&&(h.triggerKind=u),h}E(a,"create"),i.create=a;function s(o){let l=o;return rt.defined(l)&&rt.typedArray(l.diagnostics,Ew.is)&&(l.only===void 0||rt.typedArray(l.only,rt.string))&&(l.triggerKind===void 0||l.triggerKind===Lw.Invoked||l.triggerKind===Lw.Automatic)}E(s,"is"),i.is=s})($$||($$={})),(function(i){function a(o,l,u){let h={title:o},d=!0;return typeof l=="string"?(d=!1,h.kind=l):lp.is(l)?h.command=l:h.edit=l,d&&u!==void 0&&(h.kind=u),h}E(a,"create"),i.create=a;function s(o){let l=o;return l&&rt.string(l.title)&&(l.diagnostics===void 0||rt.typedArray(l.diagnostics,Ew.is))&&(l.kind===void 0||rt.string(l.kind))&&(l.edit!==void 0||l.command!==void 0)&&(l.command===void 0||lp.is(l.command))&&(l.isPreferred===void 0||rt.boolean(l.isPreferred))&&(l.edit===void 0||ES.is(l.edit))}E(s,"is"),i.is=s})(O$||(O$={})),(function(i){function a(o,l){let u={range:o};return rt.defined(l)&&(u.data=l),u}E(a,"create"),i.create=a;function s(o){let l=o;return rt.defined(l)&&en.is(l.range)&&(rt.undefined(l.command)||lp.is(l.command))}E(s,"is"),i.is=s})(P$||(P$={})),(function(i){function a(o,l){return{tabSize:o,insertSpaces:l}}E(a,"create"),i.create=a;function s(o){let l=o;return rt.defined(l)&&rt.uinteger(l.tabSize)&&rt.boolean(l.insertSpaces)}E(s,"is"),i.is=s})(B$||(B$={})),(function(i){function a(o,l,u){return{range:o,target:l,data:u}}E(a,"create"),i.create=a;function s(o){let l=o;return rt.defined(l)&&en.is(l.range)&&(rt.undefined(l.target)||rt.string(l.target))}E(s,"is"),i.is=s})(F$||(F$={})),(function(i){function a(o,l){return{range:o,parent:l}}E(a,"create"),i.create=a;function s(o){let l=o;return rt.objectLiteral(l)&&en.is(l.range)&&(l.parent===void 0||i.is(l.parent))}E(s,"is"),i.is=s})(z$||(z$={})),(function(i){i.namespace="namespace",i.type="type",i.class="class",i.enum="enum",i.interface="interface",i.struct="struct",i.typeParameter="typeParameter",i.parameter="parameter",i.variable="variable",i.property="property",i.enumMember="enumMember",i.event="event",i.function="function",i.method="method",i.macro="macro",i.keyword="keyword",i.modifier="modifier",i.comment="comment",i.string="string",i.number="number",i.regexp="regexp",i.operator="operator",i.decorator="decorator"})(G$||(G$={})),(function(i){i.declaration="declaration",i.definition="definition",i.readonly="readonly",i.static="static",i.deprecated="deprecated",i.abstract="abstract",i.async="async",i.modification="modification",i.documentation="documentation",i.defaultLibrary="defaultLibrary"})(q$||(q$={})),(function(i){function a(s){const o=s;return rt.objectLiteral(o)&&(o.resultId===void 0||typeof o.resultId=="string")&&Array.isArray(o.data)&&(o.data.length===0||typeof o.data[0]=="number")}E(a,"is"),i.is=a})(V$||(V$={})),(function(i){function a(o,l){return{range:o,text:l}}E(a,"create"),i.create=a;function s(o){const l=o;return l!=null&&en.is(l.range)&&rt.string(l.text)}E(s,"is"),i.is=s})(W$||(W$={})),(function(i){function a(o,l,u){return{range:o,variableName:l,caseSensitiveLookup:u}}E(a,"create"),i.create=a;function s(o){const l=o;return l!=null&&en.is(l.range)&&rt.boolean(l.caseSensitiveLookup)&&(rt.string(l.variableName)||l.variableName===void 0)}E(s,"is"),i.is=s})(U$||(U$={})),(function(i){function a(o,l){return{range:o,expression:l}}E(a,"create"),i.create=a;function s(o){const l=o;return l!=null&&en.is(l.range)&&(rt.string(l.expression)||l.expression===void 0)}E(s,"is"),i.is=s})(H$||(H$={})),(function(i){function a(o,l){return{frameId:o,stoppedLocation:l}}E(a,"create"),i.create=a;function s(o){const l=o;return rt.defined(l)&&en.is(o.stoppedLocation)}E(s,"is"),i.is=s})(Y$||(Y$={})),(function(i){i.Type=1,i.Parameter=2;function a(s){return s===1||s===2}E(a,"is"),i.is=a})(_S||(_S={})),(function(i){function a(o){return{value:o}}E(a,"create"),i.create=a;function s(o){const l=o;return rt.objectLiteral(l)&&(l.tooltip===void 0||rt.string(l.tooltip)||Im.is(l.tooltip))&&(l.location===void 0||kw.is(l.location))&&(l.command===void 0||lp.is(l.command))}E(s,"is"),i.is=s})(AS||(AS={})),(function(i){function a(o,l,u){const h={position:o,label:l};return u!==void 0&&(h.kind=u),h}E(a,"create"),i.create=a;function s(o){const l=o;return rt.objectLiteral(l)&&gn.is(l.position)&&(rt.string(l.label)||rt.typedArray(l.label,AS.is))&&(l.kind===void 0||_S.is(l.kind))&&l.textEdits===void 0||rt.typedArray(l.textEdits,Lc.is)&&(l.tooltip===void 0||rt.string(l.tooltip)||Im.is(l.tooltip))&&(l.paddingLeft===void 0||rt.boolean(l.paddingLeft))&&(l.paddingRight===void 0||rt.boolean(l.paddingRight))}E(s,"is"),i.is=s})(X$||(X$={})),(function(i){function a(s){return{kind:"snippet",value:s}}E(a,"createSnippet"),i.createSnippet=a})(j$||(j$={})),(function(i){function a(s,o,l,u){return{insertText:s,filterText:o,range:l,command:u}}E(a,"create"),i.create=a})(K$||(K$={})),(function(i){function a(s){return{items:s}}E(a,"create"),i.create=a})(Z$||(Z$={})),(function(i){i.Invoked=0,i.Automatic=1})(Q$||(Q$={})),(function(i){function a(s,o){return{range:s,text:o}}E(a,"create"),i.create=a})(J$||(J$={})),(function(i){function a(s,o){return{triggerKind:s,selectedCompletionInfo:o}}E(a,"create"),i.create=a})(eO||(eO={})),(function(i){function a(s){const o=s;return rt.objectLiteral(o)&&wS.is(o.uri)&&rt.string(o.name)}E(a,"is"),i.is=a})(tO||(tO={})),Jle=[` `,`\r -`,"\r"],(function(i){function a(u,h,d,f){return new Pte(u,h,d,f)}E(a,"create"),i.create=a;function s(u){let h=u;return!!(rt.defined(h)&&rt.string(h.uri)&&(rt.undefined(h.languageId)||rt.string(h.languageId))&&rt.uinteger(h.lineCount)&&rt.func(h.getText)&&rt.func(h.positionAt)&&rt.func(h.offsetAt))}E(s,"is"),i.is=s;function o(u,h){let d=u.getText(),f=l(h,(g,m)=>{let y=g.range.start.line-m.range.start.line;return y===0?g.range.start.character-m.range.start.character:y}),p=d.length;for(let g=f.length-1;g>=0;g--){let m=f[g],y=u.offsetAt(m.range.start),v=u.offsetAt(m.range.end);if(v<=p)d=d.substring(0,y)+m.newText+d.substring(v,d.length);else throw new Error("Overlapping edit");p=y}return d}E(o,"applyEdits"),i.applyEdits=o;function l(u,h){if(u.length<=1)return u;const d=u.length/2|0,f=u.slice(0,d),p=u.slice(d);l(f,h),l(p,h);let g=0,m=0,y=0;for(;g{let y=g.range.start.line-m.range.start.line;return y===0?g.range.start.character-m.range.start.character:y}),p=d.length;for(let g=f.length-1;g>=0;g--){let m=f[g],y=u.offsetAt(m.range.start),v=u.offsetAt(m.range.end);if(v<=p)d=d.substring(0,y)+m.newText+d.substring(v,d.length);else throw new Error("Overlapping edit");p=y}return d}E(o,"applyEdits"),i.applyEdits=o;function l(u,h){if(u.length<=1)return u;const d=u.length/2|0,f=u.slice(0,d),p=u.slice(d);l(f,h),l(p,h);let g=0,m=0,y=0;for(;g0&&a.push(s.length),this._lineOffsets=a}return this._lineOffsets}positionAt(a){a=Math.max(Math.min(a,this._content.length),0);let s=this.getLineOffsets(),o=0,l=s.length;if(l===0)return sn.create(0,a);for(;oa?l=h:o=h+1}let u=o-1;return sn.create(u,a-s[u])}offsetAt(a){let s=this.getLineOffsets();if(a.line>=s.length)return this._content.length;if(a.line<0)return 0;let o=s[a.line],l=a.line+1"u"}E(o,"undefined"),i.undefined=o;function l(v){return v===!0||v===!1}E(l,"boolean"),i.boolean=l;function u(v){return a.call(v)==="[object String]"}E(u,"string"),i.string=u;function h(v){return a.call(v)==="[object Number]"}E(h,"number"),i.number=h;function d(v,T,b){return a.call(v)==="[object Number]"&&T<=v&&v<=b}E(d,"numberRange"),i.numberRange=d;function f(v){return a.call(v)==="[object Number]"&&-2147483648<=v&&v<=2147483647}E(f,"integer"),i.integer=f;function p(v){return a.call(v)==="[object Number]"&&0<=v&&v<=2147483647}E(p,"uinteger"),i.uinteger=p;function g(v){return a.call(v)==="[object Function]"}E(g,"func"),i.func=g;function m(v){return v!==null&&typeof v=="object"}E(m,"objectLiteral"),i.objectLiteral=m;function y(v,T){return Array.isArray(v)&&v.every(T)}E(y,"typedArray"),i.typedArray=y})(rt||(rt={}))}}),Yd=Dr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/ral.js"(t){Object.defineProperty(t,"__esModule",{value:!0});var e;function r(){if(e===void 0)throw new Error("No runtime abstraction layer installed");return e}E(r,"RAL"),(function(n){function i(a){if(a===void 0)throw new Error("No runtime abstraction layer provided");e=a}E(i,"install"),n.install=i})(r||(r={})),t.default=r}}),Ex=Dr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/is.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.stringArray=t.array=t.func=t.error=t.number=t.string=t.boolean=void 0;function e(l){return l===!0||l===!1}E(e,"boolean"),t.boolean=e;function r(l){return typeof l=="string"||l instanceof String}E(r,"string"),t.string=r;function n(l){return typeof l=="number"||l instanceof Number}E(n,"number"),t.number=n;function i(l){return l instanceof Error}E(i,"error"),t.error=i;function a(l){return typeof l=="function"}E(a,"func"),t.func=a;function s(l){return Array.isArray(l)}E(s,"array"),t.array=s;function o(l){return s(l)&&l.every(u=>r(u))}E(o,"stringArray"),t.stringArray=o}}),Jp=Dr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/events.js"(t){var a,s;Object.defineProperty(t,"__esModule",{value:!0}),t.Emitter=t.Event=void 0;var e=Yd(),r;(function(o){const l={dispose(){}};o.None=function(){return l}})(r||(t.Event=r={}));var n=(a=class{add(l,u=null,h){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(l),this._contexts.push(u),Array.isArray(h)&&h.push({dispose:E(()=>this.remove(l,u),"dispose")})}remove(l,u=null){if(!this._callbacks)return;let h=!1;for(let d=0,f=this._callbacks.length;d{this._callbacks||(this._callbacks=new n),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(l,u);const d={dispose:E(()=>{this._callbacks&&(this._callbacks.remove(l,u),d.dispose=s._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))},"dispose")};return Array.isArray(h)&&h.push(d),d}),this._event}fire(l){this._callbacks&&this._callbacks.invoke.call(this._callbacks,l)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}},E(s,"Emitter"),s);t.Emitter=i,i._noop=function(){}}}),L3=Dr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/cancellation.js"(t){var l,u;Object.defineProperty(t,"__esModule",{value:!0}),t.CancellationTokenSource=t.CancellationToken=void 0;var e=Yd(),r=Ex(),n=Jp(),i;(function(h){h.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:n.Event.None}),h.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:n.Event.None});function d(f){const p=f;return p&&(p===h.None||p===h.Cancelled||r.boolean(p.isCancellationRequested)&&!!p.onCancellationRequested)}E(d,"is"),h.is=d})(i||(t.CancellationToken=i={}));var a=Object.freeze(function(h,d){const f=(0,e.default)().timer.setTimeout(h.bind(d),0);return{dispose(){f.dispose()}}}),s=(l=class{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 n.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}},E(l,"MutableToken"),l),o=(u=class{get token(){return this._token||(this._token=new s),this._token}cancel(){this._token?this._token.cancel():this._token=i.Cancelled}dispose(){this._token?this._token instanceof s&&this._token.dispose():this._token=i.None}},E(u,"CancellationTokenSource"),u);t.CancellationTokenSource=o}}),Bte=Dr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/messages.js"(t){var F,S,R,N,D,I,$,B,P,G,V,Y,W,ie,K,se,J,Z,ee,ne,ue,fe,_e,Ae,Ne;Object.defineProperty(t,"__esModule",{value:!0}),t.Message=t.NotificationType9=t.NotificationType8=t.NotificationType7=t.NotificationType6=t.NotificationType5=t.NotificationType4=t.NotificationType3=t.NotificationType2=t.NotificationType1=t.NotificationType0=t.NotificationType=t.RequestType9=t.RequestType8=t.RequestType7=t.RequestType6=t.RequestType5=t.RequestType4=t.RequestType3=t.RequestType2=t.RequestType1=t.RequestType=t.RequestType0=t.AbstractMessageSignature=t.ParameterStructures=t.ResponseError=t.ErrorCodes=void 0;var e=Ex(),r;(function(me){me.ParseError=-32700,me.InvalidRequest=-32600,me.MethodNotFound=-32601,me.InvalidParams=-32602,me.InternalError=-32603,me.jsonrpcReservedErrorRangeStart=-32099,me.serverErrorStart=-32099,me.MessageWriteError=-32099,me.MessageReadError=-32098,me.PendingResponseRejected=-32097,me.ConnectionInactive=-32096,me.ServerNotInitialized=-32002,me.UnknownErrorCode=-32001,me.jsonrpcReservedErrorRangeEnd=-32e3,me.serverErrorEnd=-32e3})(r||(t.ErrorCodes=r={}));var n=(F=class extends Error{constructor(ve,Ge,Te){super(Ge),this.code=e.number(ve)?ve:r.UnknownErrorCode,this.data=Te,Object.setPrototypeOf(this,F.prototype)}toJson(){const ve={code:this.code,message:this.message};return this.data!==void 0&&(ve.data=this.data),ve}},E(F,"ResponseError"),F);t.ResponseError=n;var i=(S=class{constructor(ve){this.kind=ve}static is(ve){return ve===S.auto||ve===S.byName||ve===S.byPosition}toString(){return this.kind}},E(S,"ParameterStructures"),S);t.ParameterStructures=i,i.auto=new i("auto"),i.byPosition=new i("byPosition"),i.byName=new i("byName");var a=(R=class{constructor(ve,Ge){this.method=ve,this.numberOfParams=Ge}get parameterStructures(){return i.auto}},E(R,"AbstractMessageSignature"),R);t.AbstractMessageSignature=a;var s=(N=class extends a{constructor(ve){super(ve,0)}},E(N,"RequestType0"),N);t.RequestType0=s;var o=(D=class extends a{constructor(ve,Ge=i.auto){super(ve,1),this._parameterStructures=Ge}get parameterStructures(){return this._parameterStructures}},E(D,"RequestType"),D);t.RequestType=o;var l=(I=class extends a{constructor(ve,Ge=i.auto){super(ve,1),this._parameterStructures=Ge}get parameterStructures(){return this._parameterStructures}},E(I,"RequestType1"),I);t.RequestType1=l;var u=($=class extends a{constructor(ve){super(ve,2)}},E($,"RequestType2"),$);t.RequestType2=u;var h=(B=class extends a{constructor(ve){super(ve,3)}},E(B,"RequestType3"),B);t.RequestType3=h;var d=(P=class extends a{constructor(ve){super(ve,4)}},E(P,"RequestType4"),P);t.RequestType4=d;var f=(G=class extends a{constructor(ve){super(ve,5)}},E(G,"RequestType5"),G);t.RequestType5=f;var p=(V=class extends a{constructor(ve){super(ve,6)}},E(V,"RequestType6"),V);t.RequestType6=p;var g=(Y=class extends a{constructor(ve){super(ve,7)}},E(Y,"RequestType7"),Y);t.RequestType7=g;var m=(W=class extends a{constructor(ve){super(ve,8)}},E(W,"RequestType8"),W);t.RequestType8=m;var y=(ie=class extends a{constructor(ve){super(ve,9)}},E(ie,"RequestType9"),ie);t.RequestType9=y;var v=(K=class extends a{constructor(ve,Ge=i.auto){super(ve,1),this._parameterStructures=Ge}get parameterStructures(){return this._parameterStructures}},E(K,"NotificationType"),K);t.NotificationType=v;var T=(se=class extends a{constructor(ve){super(ve,0)}},E(se,"NotificationType0"),se);t.NotificationType0=T;var b=(J=class extends a{constructor(ve,Ge=i.auto){super(ve,1),this._parameterStructures=Ge}get parameterStructures(){return this._parameterStructures}},E(J,"NotificationType1"),J);t.NotificationType1=b;var w=(Z=class extends a{constructor(ve){super(ve,2)}},E(Z,"NotificationType2"),Z);t.NotificationType2=w;var k=(ee=class extends a{constructor(ve){super(ve,3)}},E(ee,"NotificationType3"),ee);t.NotificationType3=k;var A=(ne=class extends a{constructor(ve){super(ve,4)}},E(ne,"NotificationType4"),ne);t.NotificationType4=A;var C=(ue=class extends a{constructor(ve){super(ve,5)}},E(ue,"NotificationType5"),ue);t.NotificationType5=C;var _=(fe=class extends a{constructor(ve){super(ve,6)}},E(fe,"NotificationType6"),fe);t.NotificationType6=_;var L=(_e=class extends a{constructor(ve){super(ve,7)}},E(_e,"NotificationType7"),_e);t.NotificationType7=L;var O=(Ae=class extends a{constructor(ve){super(ve,8)}},E(Ae,"NotificationType8"),Ae);t.NotificationType8=O;var M=(Ne=class extends a{constructor(ve){super(ve,9)}},E(Ne,"NotificationType9"),Ne);t.NotificationType9=M;var z;(function(me){function ve(Ze){const ke=Ze;return ke&&e.string(ke.method)&&(e.string(ke.id)||e.number(ke.id))}E(ve,"isRequest"),me.isRequest=ve;function Ge(Ze){const ke=Ze;return ke&&e.string(ke.method)&&Ze.id===void 0}E(Ge,"isNotification"),me.isNotification=Ge;function Te(Ze){const ke=Ze;return ke&&(ke.result!==void 0||!!ke.error)&&(e.string(ke.id)||e.number(ke.id)||ke.id===null)}E(Te,"isResponse"),me.isResponse=Te})(z||(t.Message=z={}))}}),Fte=Dr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/linkedMap.js"(t){var a,s;var e;Object.defineProperty(t,"__esModule",{value:!0}),t.LRUCache=t.LinkedMap=t.Touch=void 0;var r;(function(o){o.None=0,o.First=1,o.AsOld=o.First,o.Last=2,o.AsNew=o.Last})(r||(t.Touch=r={}));var n=(a=class{constructor(){this[e]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){var l;return(l=this._head)==null?void 0:l.value}get last(){var l;return(l=this._tail)==null?void 0:l.value}has(l){return this._map.has(l)}get(l,u=r.None){const h=this._map.get(l);if(h)return u!==r.None&&this.touch(h,u),h.value}set(l,u,h=r.None){let d=this._map.get(l);if(d)d.value=u,h!==r.None&&this.touch(d,h);else{switch(d={key:l,value:u,next:void 0,previous:void 0},h){case r.None:this.addItemLast(d);break;case r.First:this.addItemFirst(d);break;case r.Last:this.addItemLast(d);break;default:this.addItemLast(d);break}this._map.set(l,d),this._size++}return this}delete(l){return!!this.remove(l)}remove(l){const u=this._map.get(l);if(u)return this._map.delete(l),this.removeItem(u),this._size--,u.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");const l=this._head;return this._map.delete(l.key),this.removeItem(l),this._size--,l.value}forEach(l,u){const h=this._state;let d=this._head;for(;d;){if(u?l.bind(u)(d.value,d.key,this):l(d.value,d.key,this),this._state!==h)throw new Error("LinkedMap got modified during iteration.");d=d.next}}keys(){const l=this._state;let u=this._head;const h={[Symbol.iterator]:()=>h,next:E(()=>{if(this._state!==l)throw new Error("LinkedMap got modified during iteration.");if(u){const d={value:u.key,done:!1};return u=u.next,d}else return{value:void 0,done:!0}},"next")};return h}values(){const l=this._state;let u=this._head;const h={[Symbol.iterator]:()=>h,next:E(()=>{if(this._state!==l)throw new Error("LinkedMap got modified during iteration.");if(u){const d={value:u.value,done:!1};return u=u.next,d}else return{value:void 0,done:!0}},"next")};return h}entries(){const l=this._state;let u=this._head;const h={[Symbol.iterator]:()=>h,next:E(()=>{if(this._state!==l)throw new Error("LinkedMap got modified during iteration.");if(u){const d={value:[u.key,u.value],done:!1};return u=u.next,d}else return{value:void 0,done:!0}},"next")};return h}[(e=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(l){if(l>=this.size)return;if(l===0){this.clear();return}let u=this._head,h=this.size;for(;u&&h>l;)this._map.delete(u.key),u=u.next,h--;this._head=u,this._size=h,u&&(u.previous=void 0),this._state++}addItemFirst(l){if(!this._head&&!this._tail)this._tail=l;else if(this._head)l.next=this._head,this._head.previous=l;else throw new Error("Invalid list");this._head=l,this._state++}addItemLast(l){if(!this._head&&!this._tail)this._head=l;else if(this._tail)l.previous=this._tail,this._tail.next=l;else throw new Error("Invalid list");this._tail=l,this._state++}removeItem(l){if(l===this._head&&l===this._tail)this._head=void 0,this._tail=void 0;else if(l===this._head){if(!l.next)throw new Error("Invalid list");l.next.previous=void 0,this._head=l.next}else if(l===this._tail){if(!l.previous)throw new Error("Invalid list");l.previous.next=void 0,this._tail=l.previous}else{const u=l.next,h=l.previous;if(!u||!h)throw new Error("Invalid list");u.previous=h,h.next=u}l.next=void 0,l.previous=void 0,this._state++}touch(l,u){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(u!==r.First&&u!==r.Last)){if(u===r.First){if(l===this._head)return;const h=l.next,d=l.previous;l===this._tail?(d.next=void 0,this._tail=d):(h.previous=d,d.next=h),l.previous=void 0,l.next=this._head,this._head.previous=l,this._head=l,this._state++}else if(u===r.Last){if(l===this._tail)return;const h=l.next,d=l.previous;l===this._head?(h.previous=void 0,this._head=h):(h.previous=d,d.next=h),l.next=void 0,l.previous=this._tail,this._tail.next=l,this._tail=l,this._state++}}}toJSON(){const l=[];return this.forEach((u,h)=>{l.push([h,u])}),l}fromJSON(l){this.clear();for(const[u,h]of l)this.set(u,h)}},E(a,"LinkedMap"),a);t.LinkedMap=n;var i=(s=class extends n{constructor(l,u=1){super(),this._limit=l,this._ratio=Math.min(Math.max(0,u),1)}get limit(){return this._limit}set limit(l){this._limit=l,this.checkTrim()}get ratio(){return this._ratio}set ratio(l){this._ratio=Math.min(Math.max(0,l),1),this.checkTrim()}get(l,u=r.AsNew){return super.get(l,u)}peek(l){return super.get(l,r.None)}set(l,u){return super.set(l,u,r.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}},E(s,"LRUCache"),s);t.LRUCache=i}}),yUe=Dr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/disposable.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Disposable=void 0;var e;(function(r){function n(i){return{dispose:i}}E(n,"create"),r.create=n})(e||(t.Disposable=e={}))}}),vUe=Dr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/sharedArrayCancellation.js"(t){var o,l,u,h;Object.defineProperty(t,"__esModule",{value:!0}),t.SharedArrayReceiverStrategy=t.SharedArraySenderStrategy=void 0;var e=L3(),r;(function(d){d.Continue=0,d.Cancelled=1})(r||(r={}));var n=(o=class{constructor(){this.buffers=new Map}enableCancellation(f){if(f.id===null)return;const p=new SharedArrayBuffer(4),g=new Int32Array(p,0,1);g[0]=r.Continue,this.buffers.set(f.id,p),f.$cancellationData=p}async sendCancellation(f,p){const g=this.buffers.get(p);if(g===void 0)return;const m=new Int32Array(g,0,1);Atomics.store(m,0,r.Cancelled)}cleanup(f){this.buffers.delete(f)}dispose(){this.buffers.clear()}},E(o,"SharedArraySenderStrategy"),o);t.SharedArraySenderStrategy=n;var i=(l=class{constructor(f){this.data=new Int32Array(f,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===r.Cancelled}get onCancellationRequested(){throw new Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}},E(l,"SharedArrayBufferCancellationToken"),l),a=(u=class{constructor(f){this.token=new i(f)}cancel(){}dispose(){}},E(u,"SharedArrayBufferCancellationTokenSource"),u),s=(h=class{constructor(){this.kind="request"}createCancellationTokenSource(f){const p=f.$cancellationData;return p===void 0?new e.CancellationTokenSource:new a(p)}},E(h,"SharedArrayReceiverStrategy"),h);t.SharedArrayReceiverStrategy=s}}),zte=Dr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/semaphore.js"(t){var n;Object.defineProperty(t,"__esModule",{value:!0}),t.Semaphore=void 0;var e=Yd(),r=(n=class{constructor(a=1){if(a<=0)throw new Error("Capacity must be greater than 0");this._capacity=a,this._active=0,this._waiting=[]}lock(a){return new Promise((s,o)=>{this._waiting.push({thunk:a,resolve:s,reject:o}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length===0||this._active===this._capacity||(0,e.default)().timer.setImmediate(()=>this.doRunNext())}doRunNext(){if(this._waiting.length===0||this._active===this._capacity)return;const a=this._waiting.shift();if(this._active++,this._active>this._capacity)throw new Error("To many thunks active");try{const s=a.thunk();s instanceof Promise?s.then(o=>{this._active--,a.resolve(o),this.runNext()},o=>{this._active--,a.reject(o),this.runNext()}):(this._active--,a.resolve(s),this.runNext())}catch(s){this._active--,a.reject(s),this.runNext()}}},E(n,"Semaphore"),n);t.Semaphore=r}}),bUe=Dr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/messageReader.js"(t){var u,h;Object.defineProperty(t,"__esModule",{value:!0}),t.ReadableStreamMessageReader=t.AbstractMessageReader=t.MessageReader=void 0;var e=Yd(),r=Ex(),n=Jp(),i=zte(),a;(function(d){function f(p){let g=p;return g&&r.func(g.listen)&&r.func(g.dispose)&&r.func(g.onError)&&r.func(g.onClose)&&r.func(g.onPartialMessage)}E(f,"is"),d.is=f})(a||(t.MessageReader=a={}));var s=(u=class{constructor(){this.errorEmitter=new n.Emitter,this.closeEmitter=new n.Emitter,this.partialMessageEmitter=new n.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(f){this.errorEmitter.fire(this.asError(f))}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}get onPartialMessage(){return this.partialMessageEmitter.event}firePartialMessage(f){this.partialMessageEmitter.fire(f)}asError(f){return f instanceof Error?f:new Error(`Reader received error. Reason: ${r.string(f.message)?f.message:"unknown"}`)}},E(u,"AbstractMessageReader"),u);t.AbstractMessageReader=s;var o;(function(d){function f(p){let g,m;const y=new Map;let v;const T=new Map;if(p===void 0||typeof p=="string")g=p??"utf-8";else{if(g=p.charset??"utf-8",p.contentDecoder!==void 0&&(m=p.contentDecoder,y.set(m.name,m)),p.contentDecoders!==void 0)for(const b of p.contentDecoders)y.set(b.name,b);if(p.contentTypeDecoder!==void 0&&(v=p.contentTypeDecoder,T.set(v.name,v)),p.contentTypeDecoders!==void 0)for(const b of p.contentTypeDecoders)T.set(b.name,b)}return v===void 0&&(v=(0,e.default)().applicationJson.decoder,T.set(v.name,v)),{charset:g,contentDecoder:m,contentDecoders:y,contentTypeDecoder:v,contentTypeDecoders:T}}E(f,"fromOptions"),d.fromOptions=f})(o||(o={}));var l=(h=class extends s{constructor(f,p){super(),this.readable=f,this.options=o.fromOptions(p),this.buffer=(0,e.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new i.Semaphore(1)}set partialMessageTimeout(f){this._partialMessageTimeout=f}get partialMessageTimeout(){return this._partialMessageTimeout}listen(f){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=f;const p=this.readable.onData(g=>{this.onData(g)});return this.readable.onError(g=>this.fireError(g)),this.readable.onClose(()=>this.fireClose()),p}onData(f){try{for(this.buffer.append(f);;){if(this.nextMessageLength===-1){const g=this.buffer.tryReadHeaders(!0);if(!g)return;const m=g.get("content-length");if(!m){this.fireError(new Error(`Header must provide a Content-Length property. -${JSON.stringify(Object.fromEntries(g))}`));return}const y=parseInt(m);if(isNaN(y)){this.fireError(new Error(`Content-Length value must be a number. Got ${m}`));return}this.nextMessageLength=y}const p=this.buffer.tryReadBody(this.nextMessageLength);if(p===void 0){this.setPartialMessageTimer();return}this.clearPartialMessageTimer(),this.nextMessageLength=-1,this.readSemaphore.lock(async()=>{const g=this.options.contentDecoder!==void 0?await this.options.contentDecoder.decode(p):p,m=await this.options.contentTypeDecoder.decode(g,this.options);this.callback(m)}).catch(g=>{this.fireError(g)})}}catch(p){this.fireError(p)}}clearPartialMessageTimer(){this.partialMessageTimer&&(this.partialMessageTimer.dispose(),this.partialMessageTimer=void 0)}setPartialMessageTimer(){this.clearPartialMessageTimer(),!(this._partialMessageTimeout<=0)&&(this.partialMessageTimer=(0,e.default)().timer.setTimeout((f,p)=>{this.partialMessageTimer=void 0,f===this.messageToken&&(this.firePartialMessage({messageToken:f,waitingTime:p}),this.setPartialMessageTimer())},this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}},E(h,"ReadableStreamMessageReader"),h);t.ReadableStreamMessageReader=l}}),xUe=Dr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/messageWriter.js"(t){var d,f;Object.defineProperty(t,"__esModule",{value:!0}),t.WriteableStreamMessageWriter=t.AbstractMessageWriter=t.MessageWriter=void 0;var e=Yd(),r=Ex(),n=zte(),i=Jp(),a="Content-Length: ",s=`\r -`,o;(function(p){function g(m){let y=m;return y&&r.func(y.dispose)&&r.func(y.onClose)&&r.func(y.onError)&&r.func(y.write)}E(g,"is"),p.is=g})(o||(t.MessageWriter=o={}));var l=(d=class{constructor(){this.errorEmitter=new i.Emitter,this.closeEmitter=new i.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(g,m,y){this.errorEmitter.fire([this.asError(g),m,y])}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}asError(g){return g instanceof Error?g:new Error(`Writer received error. Reason: ${r.string(g.message)?g.message:"unknown"}`)}},E(d,"AbstractMessageWriter"),d);t.AbstractMessageWriter=l;var u;(function(p){function g(m){return m===void 0||typeof m=="string"?{charset:m??"utf-8",contentTypeEncoder:(0,e.default)().applicationJson.encoder}:{charset:m.charset??"utf-8",contentEncoder:m.contentEncoder,contentTypeEncoder:m.contentTypeEncoder??(0,e.default)().applicationJson.encoder}}E(g,"fromOptions"),p.fromOptions=g})(u||(u={}));var h=(f=class extends l{constructor(g,m){super(),this.writable=g,this.options=u.fromOptions(m),this.errorCount=0,this.writeSemaphore=new n.Semaphore(1),this.writable.onError(y=>this.fireError(y)),this.writable.onClose(()=>this.fireClose())}async write(g){return this.writeSemaphore.lock(async()=>this.options.contentTypeEncoder.encode(g,this.options).then(y=>this.options.contentEncoder!==void 0?this.options.contentEncoder.encode(y):y).then(y=>{const v=[];return v.push(a,y.byteLength.toString(),s),v.push(s),this.doWrite(g,v,y)},y=>{throw this.fireError(y),y}))}async doWrite(g,m,y){try{return await this.writable.write(m.join(""),"ascii"),this.writable.write(y)}catch(v){return this.handleError(v,g),Promise.reject(v)}}handleError(g,m){this.errorCount++,this.fireError(g,m,this.errorCount)}end(){this.writable.end()}},E(f,"WriteableStreamMessageWriter"),f);t.WriteableStreamMessageWriter=h}}),TUe=Dr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/messageBuffer.js"(t){var a;Object.defineProperty(t,"__esModule",{value:!0}),t.AbstractMessageBuffer=void 0;var e=13,r=10,n=`\r +`&&l++}o&&s.length>0&&a.push(s.length),this._lineOffsets=a}return this._lineOffsets}positionAt(a){a=Math.max(Math.min(a,this._content.length),0);let s=this.getLineOffsets(),o=0,l=s.length;if(l===0)return gn.create(0,a);for(;oa?l=h:o=h+1}let u=o-1;return gn.create(u,a-s[u])}offsetAt(a){let s=this.getLineOffsets();if(a.line>=s.length)return this._content.length;if(a.line<0)return 0;let o=s[a.line],l=a.line+1"u"}E(o,"undefined"),i.undefined=o;function l(v){return v===!0||v===!1}E(l,"boolean"),i.boolean=l;function u(v){return a.call(v)==="[object String]"}E(u,"string"),i.string=u;function h(v){return a.call(v)==="[object Number]"}E(h,"number"),i.number=h;function d(v,x,b){return a.call(v)==="[object Number]"&&x<=v&&v<=b}E(d,"numberRange"),i.numberRange=d;function f(v){return a.call(v)==="[object Number]"&&-2147483648<=v&&v<=2147483647}E(f,"integer"),i.integer=f;function p(v){return a.call(v)==="[object Number]"&&0<=v&&v<=2147483647}E(p,"uinteger"),i.uinteger=p;function g(v){return a.call(v)==="[object Function]"}E(g,"func"),i.func=g;function m(v){return v!==null&&typeof v=="object"}E(m,"objectLiteral"),i.objectLiteral=m;function y(v,x){return Array.isArray(v)&&v.every(x)}E(y,"typedArray"),i.typedArray=y})(rt||(rt={}))}}),up=Gr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/ral.js"(t){Object.defineProperty(t,"__esModule",{value:!0});var e;function r(){if(e===void 0)throw new Error("No runtime abstraction layer installed");return e}E(r,"RAL"),(function(n){function i(a){if(a===void 0)throw new Error("No runtime abstraction layer provided");e=a}E(i,"install"),n.install=i})(r||(r={})),t.default=r}}),Dw=Gr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/is.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.stringArray=t.array=t.func=t.error=t.number=t.string=t.boolean=void 0;function e(l){return l===!0||l===!1}E(e,"boolean"),t.boolean=e;function r(l){return typeof l=="string"||l instanceof String}E(r,"string"),t.string=r;function n(l){return typeof l=="number"||l instanceof Number}E(n,"number"),t.number=n;function i(l){return l instanceof Error}E(i,"error"),t.error=i;function a(l){return typeof l=="function"}E(a,"func"),t.func=a;function s(l){return Array.isArray(l)}E(s,"array"),t.array=s;function o(l){return s(l)&&l.every(u=>r(u))}E(o,"stringArray"),t.stringArray=o}}),Dm=Gr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/events.js"(t){var a,s;Object.defineProperty(t,"__esModule",{value:!0}),t.Emitter=t.Event=void 0;var e=up(),r;(function(o){const l={dispose(){}};o.None=function(){return l}})(r||(t.Event=r={}));var n=(a=class{add(l,u=null,h){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(l),this._contexts.push(u),Array.isArray(h)&&h.push({dispose:E(()=>this.remove(l,u),"dispose")})}remove(l,u=null){if(!this._callbacks)return;let h=!1;for(let d=0,f=this._callbacks.length;d{this._callbacks||(this._callbacks=new n),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(l,u);const d={dispose:E(()=>{this._callbacks&&(this._callbacks.remove(l,u),d.dispose=s._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))},"dispose")};return Array.isArray(h)&&h.push(d),d}),this._event}fire(l){this._callbacks&&this._callbacks.invoke.call(this._callbacks,l)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}},E(s,"Emitter"),s);t.Emitter=i,i._noop=function(){}}}),RS=Gr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/cancellation.js"(t){var l,u;Object.defineProperty(t,"__esModule",{value:!0}),t.CancellationTokenSource=t.CancellationToken=void 0;var e=up(),r=Dw(),n=Dm(),i;(function(h){h.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:n.Event.None}),h.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:n.Event.None});function d(f){const p=f;return p&&(p===h.None||p===h.Cancelled||r.boolean(p.isCancellationRequested)&&!!p.onCancellationRequested)}E(d,"is"),h.is=d})(i||(t.CancellationToken=i={}));var a=Object.freeze(function(h,d){const f=(0,e.default)().timer.setTimeout(h.bind(d),0);return{dispose(){f.dispose()}}}),s=(l=class{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 n.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}},E(l,"MutableToken"),l),o=(u=class{get token(){return this._token||(this._token=new s),this._token}cancel(){this._token?this._token.cancel():this._token=i.Cancelled}dispose(){this._token?this._token instanceof s&&this._token.dispose():this._token=i.None}},E(u,"CancellationTokenSource"),u);t.CancellationTokenSource=o}}),tce=Gr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/messages.js"(t){var F,A,R,N,M,D,O,B,P,G,V,H,W,ie,j,ae,J,K,Q,re,le,fe,Ae,Se,Ne;Object.defineProperty(t,"__esModule",{value:!0}),t.Message=t.NotificationType9=t.NotificationType8=t.NotificationType7=t.NotificationType6=t.NotificationType5=t.NotificationType4=t.NotificationType3=t.NotificationType2=t.NotificationType1=t.NotificationType0=t.NotificationType=t.RequestType9=t.RequestType8=t.RequestType7=t.RequestType6=t.RequestType5=t.RequestType4=t.RequestType3=t.RequestType2=t.RequestType1=t.RequestType=t.RequestType0=t.AbstractMessageSignature=t.ParameterStructures=t.ResponseError=t.ErrorCodes=void 0;var e=Dw(),r;(function(ge){ge.ParseError=-32700,ge.InvalidRequest=-32600,ge.MethodNotFound=-32601,ge.InvalidParams=-32602,ge.InternalError=-32603,ge.jsonrpcReservedErrorRangeStart=-32099,ge.serverErrorStart=-32099,ge.MessageWriteError=-32099,ge.MessageReadError=-32098,ge.PendingResponseRejected=-32097,ge.ConnectionInactive=-32096,ge.ServerNotInitialized=-32002,ge.UnknownErrorCode=-32001,ge.jsonrpcReservedErrorRangeEnd=-32e3,ge.serverErrorEnd=-32e3})(r||(t.ErrorCodes=r={}));var n=(F=class extends Error{constructor(ve,ze,xe){super(ze),this.code=e.number(ve)?ve:r.UnknownErrorCode,this.data=xe,Object.setPrototypeOf(this,F.prototype)}toJson(){const ve={code:this.code,message:this.message};return this.data!==void 0&&(ve.data=this.data),ve}},E(F,"ResponseError"),F);t.ResponseError=n;var i=(A=class{constructor(ve){this.kind=ve}static is(ve){return ve===A.auto||ve===A.byName||ve===A.byPosition}toString(){return this.kind}},E(A,"ParameterStructures"),A);t.ParameterStructures=i,i.auto=new i("auto"),i.byPosition=new i("byPosition"),i.byName=new i("byName");var a=(R=class{constructor(ve,ze){this.method=ve,this.numberOfParams=ze}get parameterStructures(){return i.auto}},E(R,"AbstractMessageSignature"),R);t.AbstractMessageSignature=a;var s=(N=class extends a{constructor(ve){super(ve,0)}},E(N,"RequestType0"),N);t.RequestType0=s;var o=(M=class extends a{constructor(ve,ze=i.auto){super(ve,1),this._parameterStructures=ze}get parameterStructures(){return this._parameterStructures}},E(M,"RequestType"),M);t.RequestType=o;var l=(D=class extends a{constructor(ve,ze=i.auto){super(ve,1),this._parameterStructures=ze}get parameterStructures(){return this._parameterStructures}},E(D,"RequestType1"),D);t.RequestType1=l;var u=(O=class extends a{constructor(ve){super(ve,2)}},E(O,"RequestType2"),O);t.RequestType2=u;var h=(B=class extends a{constructor(ve){super(ve,3)}},E(B,"RequestType3"),B);t.RequestType3=h;var d=(P=class extends a{constructor(ve){super(ve,4)}},E(P,"RequestType4"),P);t.RequestType4=d;var f=(G=class extends a{constructor(ve){super(ve,5)}},E(G,"RequestType5"),G);t.RequestType5=f;var p=(V=class extends a{constructor(ve){super(ve,6)}},E(V,"RequestType6"),V);t.RequestType6=p;var g=(H=class extends a{constructor(ve){super(ve,7)}},E(H,"RequestType7"),H);t.RequestType7=g;var m=(W=class extends a{constructor(ve){super(ve,8)}},E(W,"RequestType8"),W);t.RequestType8=m;var y=(ie=class extends a{constructor(ve){super(ve,9)}},E(ie,"RequestType9"),ie);t.RequestType9=y;var v=(j=class extends a{constructor(ve,ze=i.auto){super(ve,1),this._parameterStructures=ze}get parameterStructures(){return this._parameterStructures}},E(j,"NotificationType"),j);t.NotificationType=v;var x=(ae=class extends a{constructor(ve){super(ve,0)}},E(ae,"NotificationType0"),ae);t.NotificationType0=x;var b=(J=class extends a{constructor(ve,ze=i.auto){super(ve,1),this._parameterStructures=ze}get parameterStructures(){return this._parameterStructures}},E(J,"NotificationType1"),J);t.NotificationType1=b;var w=(K=class extends a{constructor(ve){super(ve,2)}},E(K,"NotificationType2"),K);t.NotificationType2=w;var C=(Q=class extends a{constructor(ve){super(ve,3)}},E(Q,"NotificationType3"),Q);t.NotificationType3=C;var _=(re=class extends a{constructor(ve){super(ve,4)}},E(re,"NotificationType4"),re);t.NotificationType4=_;var k=(le=class extends a{constructor(ve){super(ve,5)}},E(le,"NotificationType5"),le);t.NotificationType5=k;var S=(fe=class extends a{constructor(ve){super(ve,6)}},E(fe,"NotificationType6"),fe);t.NotificationType6=S;var L=(Ae=class extends a{constructor(ve){super(ve,7)}},E(Ae,"NotificationType7"),Ae);t.NotificationType7=L;var $=(Se=class extends a{constructor(ve){super(ve,8)}},E(Se,"NotificationType8"),Se);t.NotificationType8=$;var I=(Ne=class extends a{constructor(ve){super(ve,9)}},E(Ne,"NotificationType9"),Ne);t.NotificationType9=I;var z;(function(ge){function ve(Ke){const Ce=Ke;return Ce&&e.string(Ce.method)&&(e.string(Ce.id)||e.number(Ce.id))}E(ve,"isRequest"),ge.isRequest=ve;function ze(Ke){const Ce=Ke;return Ce&&e.string(Ce.method)&&Ke.id===void 0}E(ze,"isNotification"),ge.isNotification=ze;function xe(Ke){const Ce=Ke;return Ce&&(Ce.result!==void 0||!!Ce.error)&&(e.string(Ce.id)||e.number(Ce.id)||Ce.id===null)}E(xe,"isResponse"),ge.isResponse=xe})(z||(t.Message=z={}))}}),rce=Gr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/linkedMap.js"(t){var a,s;var e;Object.defineProperty(t,"__esModule",{value:!0}),t.LRUCache=t.LinkedMap=t.Touch=void 0;var r;(function(o){o.None=0,o.First=1,o.AsOld=o.First,o.Last=2,o.AsNew=o.Last})(r||(t.Touch=r={}));var n=(a=class{constructor(){this[e]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){var l;return(l=this._head)==null?void 0:l.value}get last(){var l;return(l=this._tail)==null?void 0:l.value}has(l){return this._map.has(l)}get(l,u=r.None){const h=this._map.get(l);if(h)return u!==r.None&&this.touch(h,u),h.value}set(l,u,h=r.None){let d=this._map.get(l);if(d)d.value=u,h!==r.None&&this.touch(d,h);else{switch(d={key:l,value:u,next:void 0,previous:void 0},h){case r.None:this.addItemLast(d);break;case r.First:this.addItemFirst(d);break;case r.Last:this.addItemLast(d);break;default:this.addItemLast(d);break}this._map.set(l,d),this._size++}return this}delete(l){return!!this.remove(l)}remove(l){const u=this._map.get(l);if(u)return this._map.delete(l),this.removeItem(u),this._size--,u.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");const l=this._head;return this._map.delete(l.key),this.removeItem(l),this._size--,l.value}forEach(l,u){const h=this._state;let d=this._head;for(;d;){if(u?l.bind(u)(d.value,d.key,this):l(d.value,d.key,this),this._state!==h)throw new Error("LinkedMap got modified during iteration.");d=d.next}}keys(){const l=this._state;let u=this._head;const h={[Symbol.iterator]:()=>h,next:E(()=>{if(this._state!==l)throw new Error("LinkedMap got modified during iteration.");if(u){const d={value:u.key,done:!1};return u=u.next,d}else return{value:void 0,done:!0}},"next")};return h}values(){const l=this._state;let u=this._head;const h={[Symbol.iterator]:()=>h,next:E(()=>{if(this._state!==l)throw new Error("LinkedMap got modified during iteration.");if(u){const d={value:u.value,done:!1};return u=u.next,d}else return{value:void 0,done:!0}},"next")};return h}entries(){const l=this._state;let u=this._head;const h={[Symbol.iterator]:()=>h,next:E(()=>{if(this._state!==l)throw new Error("LinkedMap got modified during iteration.");if(u){const d={value:[u.key,u.value],done:!1};return u=u.next,d}else return{value:void 0,done:!0}},"next")};return h}[(e=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(l){if(l>=this.size)return;if(l===0){this.clear();return}let u=this._head,h=this.size;for(;u&&h>l;)this._map.delete(u.key),u=u.next,h--;this._head=u,this._size=h,u&&(u.previous=void 0),this._state++}addItemFirst(l){if(!this._head&&!this._tail)this._tail=l;else if(this._head)l.next=this._head,this._head.previous=l;else throw new Error("Invalid list");this._head=l,this._state++}addItemLast(l){if(!this._head&&!this._tail)this._head=l;else if(this._tail)l.previous=this._tail,this._tail.next=l;else throw new Error("Invalid list");this._tail=l,this._state++}removeItem(l){if(l===this._head&&l===this._tail)this._head=void 0,this._tail=void 0;else if(l===this._head){if(!l.next)throw new Error("Invalid list");l.next.previous=void 0,this._head=l.next}else if(l===this._tail){if(!l.previous)throw new Error("Invalid list");l.previous.next=void 0,this._tail=l.previous}else{const u=l.next,h=l.previous;if(!u||!h)throw new Error("Invalid list");u.previous=h,h.next=u}l.next=void 0,l.previous=void 0,this._state++}touch(l,u){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(u!==r.First&&u!==r.Last)){if(u===r.First){if(l===this._head)return;const h=l.next,d=l.previous;l===this._tail?(d.next=void 0,this._tail=d):(h.previous=d,d.next=h),l.previous=void 0,l.next=this._head,this._head.previous=l,this._head=l,this._state++}else if(u===r.Last){if(l===this._tail)return;const h=l.next,d=l.previous;l===this._head?(h.previous=void 0,this._head=h):(h.previous=d,d.next=h),l.next=void 0,l.previous=this._tail,this._tail.next=l,this._tail=l,this._state++}}}toJSON(){const l=[];return this.forEach((u,h)=>{l.push([h,u])}),l}fromJSON(l){this.clear();for(const[u,h]of l)this.set(u,h)}},E(a,"LinkedMap"),a);t.LinkedMap=n;var i=(s=class extends n{constructor(l,u=1){super(),this._limit=l,this._ratio=Math.min(Math.max(0,u),1)}get limit(){return this._limit}set limit(l){this._limit=l,this.checkTrim()}get ratio(){return this._ratio}set ratio(l){this._ratio=Math.min(Math.max(0,l),1),this.checkTrim()}get(l,u=r.AsNew){return super.get(l,u)}peek(l){return super.get(l,r.None)}set(l,u){return super.set(l,u,r.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}},E(s,"LRUCache"),s);t.LRUCache=i}}),att=Gr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/disposable.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Disposable=void 0;var e;(function(r){function n(i){return{dispose:i}}E(n,"create"),r.create=n})(e||(t.Disposable=e={}))}}),stt=Gr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/sharedArrayCancellation.js"(t){var o,l,u,h;Object.defineProperty(t,"__esModule",{value:!0}),t.SharedArrayReceiverStrategy=t.SharedArraySenderStrategy=void 0;var e=RS(),r;(function(d){d.Continue=0,d.Cancelled=1})(r||(r={}));var n=(o=class{constructor(){this.buffers=new Map}enableCancellation(f){if(f.id===null)return;const p=new SharedArrayBuffer(4),g=new Int32Array(p,0,1);g[0]=r.Continue,this.buffers.set(f.id,p),f.$cancellationData=p}async sendCancellation(f,p){const g=this.buffers.get(p);if(g===void 0)return;const m=new Int32Array(g,0,1);Atomics.store(m,0,r.Cancelled)}cleanup(f){this.buffers.delete(f)}dispose(){this.buffers.clear()}},E(o,"SharedArraySenderStrategy"),o);t.SharedArraySenderStrategy=n;var i=(l=class{constructor(f){this.data=new Int32Array(f,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===r.Cancelled}get onCancellationRequested(){throw new Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}},E(l,"SharedArrayBufferCancellationToken"),l),a=(u=class{constructor(f){this.token=new i(f)}cancel(){}dispose(){}},E(u,"SharedArrayBufferCancellationTokenSource"),u),s=(h=class{constructor(){this.kind="request"}createCancellationTokenSource(f){const p=f.$cancellationData;return p===void 0?new e.CancellationTokenSource:new a(p)}},E(h,"SharedArrayReceiverStrategy"),h);t.SharedArrayReceiverStrategy=s}}),nce=Gr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/semaphore.js"(t){var n;Object.defineProperty(t,"__esModule",{value:!0}),t.Semaphore=void 0;var e=up(),r=(n=class{constructor(a=1){if(a<=0)throw new Error("Capacity must be greater than 0");this._capacity=a,this._active=0,this._waiting=[]}lock(a){return new Promise((s,o)=>{this._waiting.push({thunk:a,resolve:s,reject:o}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length===0||this._active===this._capacity||(0,e.default)().timer.setImmediate(()=>this.doRunNext())}doRunNext(){if(this._waiting.length===0||this._active===this._capacity)return;const a=this._waiting.shift();if(this._active++,this._active>this._capacity)throw new Error("To many thunks active");try{const s=a.thunk();s instanceof Promise?s.then(o=>{this._active--,a.resolve(o),this.runNext()},o=>{this._active--,a.reject(o),this.runNext()}):(this._active--,a.resolve(s),this.runNext())}catch(s){this._active--,a.reject(s),this.runNext()}}},E(n,"Semaphore"),n);t.Semaphore=r}}),ott=Gr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/messageReader.js"(t){var u,h;Object.defineProperty(t,"__esModule",{value:!0}),t.ReadableStreamMessageReader=t.AbstractMessageReader=t.MessageReader=void 0;var e=up(),r=Dw(),n=Dm(),i=nce(),a;(function(d){function f(p){let g=p;return g&&r.func(g.listen)&&r.func(g.dispose)&&r.func(g.onError)&&r.func(g.onClose)&&r.func(g.onPartialMessage)}E(f,"is"),d.is=f})(a||(t.MessageReader=a={}));var s=(u=class{constructor(){this.errorEmitter=new n.Emitter,this.closeEmitter=new n.Emitter,this.partialMessageEmitter=new n.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(f){this.errorEmitter.fire(this.asError(f))}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}get onPartialMessage(){return this.partialMessageEmitter.event}firePartialMessage(f){this.partialMessageEmitter.fire(f)}asError(f){return f instanceof Error?f:new Error(`Reader received error. Reason: ${r.string(f.message)?f.message:"unknown"}`)}},E(u,"AbstractMessageReader"),u);t.AbstractMessageReader=s;var o;(function(d){function f(p){let g,m;const y=new Map;let v;const x=new Map;if(p===void 0||typeof p=="string")g=p??"utf-8";else{if(g=p.charset??"utf-8",p.contentDecoder!==void 0&&(m=p.contentDecoder,y.set(m.name,m)),p.contentDecoders!==void 0)for(const b of p.contentDecoders)y.set(b.name,b);if(p.contentTypeDecoder!==void 0&&(v=p.contentTypeDecoder,x.set(v.name,v)),p.contentTypeDecoders!==void 0)for(const b of p.contentTypeDecoders)x.set(b.name,b)}return v===void 0&&(v=(0,e.default)().applicationJson.decoder,x.set(v.name,v)),{charset:g,contentDecoder:m,contentDecoders:y,contentTypeDecoder:v,contentTypeDecoders:x}}E(f,"fromOptions"),d.fromOptions=f})(o||(o={}));var l=(h=class extends s{constructor(f,p){super(),this.readable=f,this.options=o.fromOptions(p),this.buffer=(0,e.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new i.Semaphore(1)}set partialMessageTimeout(f){this._partialMessageTimeout=f}get partialMessageTimeout(){return this._partialMessageTimeout}listen(f){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=f;const p=this.readable.onData(g=>{this.onData(g)});return this.readable.onError(g=>this.fireError(g)),this.readable.onClose(()=>this.fireClose()),p}onData(f){try{for(this.buffer.append(f);;){if(this.nextMessageLength===-1){const g=this.buffer.tryReadHeaders(!0);if(!g)return;const m=g.get("content-length");if(!m){this.fireError(new Error(`Header must provide a Content-Length property. +${JSON.stringify(Object.fromEntries(g))}`));return}const y=parseInt(m);if(isNaN(y)){this.fireError(new Error(`Content-Length value must be a number. Got ${m}`));return}this.nextMessageLength=y}const p=this.buffer.tryReadBody(this.nextMessageLength);if(p===void 0){this.setPartialMessageTimer();return}this.clearPartialMessageTimer(),this.nextMessageLength=-1,this.readSemaphore.lock(async()=>{const g=this.options.contentDecoder!==void 0?await this.options.contentDecoder.decode(p):p,m=await this.options.contentTypeDecoder.decode(g,this.options);this.callback(m)}).catch(g=>{this.fireError(g)})}}catch(p){this.fireError(p)}}clearPartialMessageTimer(){this.partialMessageTimer&&(this.partialMessageTimer.dispose(),this.partialMessageTimer=void 0)}setPartialMessageTimer(){this.clearPartialMessageTimer(),!(this._partialMessageTimeout<=0)&&(this.partialMessageTimer=(0,e.default)().timer.setTimeout((f,p)=>{this.partialMessageTimer=void 0,f===this.messageToken&&(this.firePartialMessage({messageToken:f,waitingTime:p}),this.setPartialMessageTimer())},this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}},E(h,"ReadableStreamMessageReader"),h);t.ReadableStreamMessageReader=l}}),ltt=Gr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/messageWriter.js"(t){var d,f;Object.defineProperty(t,"__esModule",{value:!0}),t.WriteableStreamMessageWriter=t.AbstractMessageWriter=t.MessageWriter=void 0;var e=up(),r=Dw(),n=nce(),i=Dm(),a="Content-Length: ",s=`\r +`,o;(function(p){function g(m){let y=m;return y&&r.func(y.dispose)&&r.func(y.onClose)&&r.func(y.onError)&&r.func(y.write)}E(g,"is"),p.is=g})(o||(t.MessageWriter=o={}));var l=(d=class{constructor(){this.errorEmitter=new i.Emitter,this.closeEmitter=new i.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(g,m,y){this.errorEmitter.fire([this.asError(g),m,y])}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}asError(g){return g instanceof Error?g:new Error(`Writer received error. Reason: ${r.string(g.message)?g.message:"unknown"}`)}},E(d,"AbstractMessageWriter"),d);t.AbstractMessageWriter=l;var u;(function(p){function g(m){return m===void 0||typeof m=="string"?{charset:m??"utf-8",contentTypeEncoder:(0,e.default)().applicationJson.encoder}:{charset:m.charset??"utf-8",contentEncoder:m.contentEncoder,contentTypeEncoder:m.contentTypeEncoder??(0,e.default)().applicationJson.encoder}}E(g,"fromOptions"),p.fromOptions=g})(u||(u={}));var h=(f=class extends l{constructor(g,m){super(),this.writable=g,this.options=u.fromOptions(m),this.errorCount=0,this.writeSemaphore=new n.Semaphore(1),this.writable.onError(y=>this.fireError(y)),this.writable.onClose(()=>this.fireClose())}async write(g){return this.writeSemaphore.lock(async()=>this.options.contentTypeEncoder.encode(g,this.options).then(y=>this.options.contentEncoder!==void 0?this.options.contentEncoder.encode(y):y).then(y=>{const v=[];return v.push(a,y.byteLength.toString(),s),v.push(s),this.doWrite(g,v,y)},y=>{throw this.fireError(y),y}))}async doWrite(g,m,y){try{return await this.writable.write(m.join(""),"ascii"),this.writable.write(y)}catch(v){return this.handleError(v,g),Promise.reject(v)}}handleError(g,m){this.errorCount++,this.fireError(g,m,this.errorCount)}end(){this.writable.end()}},E(f,"WriteableStreamMessageWriter"),f);t.WriteableStreamMessageWriter=h}}),ctt=Gr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/messageBuffer.js"(t){var a;Object.defineProperty(t,"__esModule",{value:!0}),t.AbstractMessageBuffer=void 0;var e=13,r=10,n=`\r `,i=(a=class{constructor(o="utf-8"){this._encoding=o,this._chunks=[],this._totalLength=0}get encoding(){return this._encoding}append(o){const l=typeof o=="string"?this.fromString(o,this._encoding):o;this._chunks.push(l),this._totalLength+=l.byteLength}tryReadHeaders(o=!1){if(this._chunks.length===0)return;let l=0,u=0,h=0,d=0;e:for(;uthis._totalLength)throw new Error("Cannot read so many bytes!");if(this._chunks[0].byteLength===o){const d=this._chunks[0];return this._chunks.shift(),this._totalLength-=o,this.asNative(d)}if(this._chunks[0].byteLength>o){const d=this._chunks[0],f=this.asNative(d,o);return this._chunks[0]=d.slice(o),this._totalLength-=o,f}const l=this.allocNative(o);let u=0,h=0;for(;o>0;){const d=this._chunks[h];if(d.byteLength>o){const f=d.slice(0,o);l.set(f,u),u+=o,this._chunks[h]=d.slice(o),this._totalLength-=o,o-=o}else l.set(d,u),u+=d.byteLength,this._chunks.shift(),this._totalLength-=d.byteLength,o-=d.byteLength}return l}},E(a,"AbstractMessageBuffer"),a);t.AbstractMessageBuffer=i}}),wUe=Dr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/connection.js"(t){var F,S;Object.defineProperty(t,"__esModule",{value:!0}),t.createMessageConnection=t.ConnectionOptions=t.MessageStrategy=t.CancellationStrategy=t.CancellationSenderStrategy=t.CancellationReceiverStrategy=t.RequestCancellationReceiverStrategy=t.IdCancellationReceiverStrategy=t.ConnectionStrategy=t.ConnectionError=t.ConnectionErrors=t.LogTraceNotification=t.SetTraceNotification=t.TraceFormat=t.TraceValues=t.Trace=t.NullLogger=t.ProgressType=t.ProgressToken=void 0;var e=Yd(),r=Ex(),n=Bte(),i=Fte(),a=Jp(),s=L3(),o;(function(R){R.type=new n.NotificationType("$/cancelRequest")})(o||(o={}));var l;(function(R){function N(D){return typeof D=="string"||typeof D=="number"}E(N,"is"),R.is=N})(l||(t.ProgressToken=l={}));var u;(function(R){R.type=new n.NotificationType("$/progress")})(u||(u={}));var h=(F=class{constructor(){}},E(F,"ProgressType"),F);t.ProgressType=h;var d;(function(R){function N(D){return r.func(D)}E(N,"is"),R.is=N})(d||(d={})),t.NullLogger=Object.freeze({error:E(()=>{},"error"),warn:E(()=>{},"warn"),info:E(()=>{},"info"),log:E(()=>{},"log")});var f;(function(R){R[R.Off=0]="Off",R[R.Messages=1]="Messages",R[R.Compact=2]="Compact",R[R.Verbose=3]="Verbose"})(f||(t.Trace=f={}));var p;(function(R){R.Off="off",R.Messages="messages",R.Compact="compact",R.Verbose="verbose"})(p||(t.TraceValues=p={})),(function(R){function N(I){if(!r.string(I))return R.Off;switch(I=I.toLowerCase(),I){case"off":return R.Off;case"messages":return R.Messages;case"compact":return R.Compact;case"verbose":return R.Verbose;default:return R.Off}}E(N,"fromString"),R.fromString=N;function D(I){switch(I){case R.Off:return"off";case R.Messages:return"messages";case R.Compact:return"compact";case R.Verbose:return"verbose";default:return"off"}}E(D,"toString"),R.toString=D})(f||(t.Trace=f={}));var g;(function(R){R.Text="text",R.JSON="json"})(g||(t.TraceFormat=g={})),(function(R){function N(D){return r.string(D)?(D=D.toLowerCase(),D==="json"?R.JSON:R.Text):R.Text}E(N,"fromString"),R.fromString=N})(g||(t.TraceFormat=g={}));var m;(function(R){R.type=new n.NotificationType("$/setTrace")})(m||(t.SetTraceNotification=m={}));var y;(function(R){R.type=new n.NotificationType("$/logTrace")})(y||(t.LogTraceNotification=y={}));var v;(function(R){R[R.Closed=1]="Closed",R[R.Disposed=2]="Disposed",R[R.AlreadyListening=3]="AlreadyListening"})(v||(t.ConnectionErrors=v={}));var T=(S=class extends Error{constructor(N,D){super(D),this.code=N,Object.setPrototypeOf(this,S.prototype)}},E(S,"ConnectionError"),S);t.ConnectionError=T;var b;(function(R){function N(D){const I=D;return I&&r.func(I.cancelUndispatched)}E(N,"is"),R.is=N})(b||(t.ConnectionStrategy=b={}));var w;(function(R){function N(D){const I=D;return I&&(I.kind===void 0||I.kind==="id")&&r.func(I.createCancellationTokenSource)&&(I.dispose===void 0||r.func(I.dispose))}E(N,"is"),R.is=N})(w||(t.IdCancellationReceiverStrategy=w={}));var k;(function(R){function N(D){const I=D;return I&&I.kind==="request"&&r.func(I.createCancellationTokenSource)&&(I.dispose===void 0||r.func(I.dispose))}E(N,"is"),R.is=N})(k||(t.RequestCancellationReceiverStrategy=k={}));var A;(function(R){R.Message=Object.freeze({createCancellationTokenSource(D){return new s.CancellationTokenSource}});function N(D){return w.is(D)||k.is(D)}E(N,"is"),R.is=N})(A||(t.CancellationReceiverStrategy=A={}));var C;(function(R){R.Message=Object.freeze({sendCancellation(D,I){return D.sendNotification(o.type,{id:I})},cleanup(D){}});function N(D){const I=D;return I&&r.func(I.sendCancellation)&&r.func(I.cleanup)}E(N,"is"),R.is=N})(C||(t.CancellationSenderStrategy=C={}));var _;(function(R){R.Message=Object.freeze({receiver:A.Message,sender:C.Message});function N(D){const I=D;return I&&A.is(I.receiver)&&C.is(I.sender)}E(N,"is"),R.is=N})(_||(t.CancellationStrategy=_={}));var L;(function(R){function N(D){const I=D;return I&&r.func(I.handleMessage)}E(N,"is"),R.is=N})(L||(t.MessageStrategy=L={}));var O;(function(R){function N(D){const I=D;return I&&(_.is(I.cancellationStrategy)||b.is(I.connectionStrategy)||L.is(I.messageStrategy))}E(N,"is"),R.is=N})(O||(t.ConnectionOptions=O={}));var M;(function(R){R[R.New=1]="New",R[R.Listening=2]="Listening",R[R.Closed=3]="Closed",R[R.Disposed=4]="Disposed"})(M||(M={}));function z(R,N,D,I){const $=D!==void 0?D:t.NullLogger;let B=0,P=0,G=0;const V="2.0";let Y;const W=new Map;let ie;const K=new Map,se=new Map;let J,Z=new i.LinkedMap,ee=new Map,ne=new Set,ue=new Map,fe=f.Off,_e=g.Text,Ae,Ne=M.New;const me=new a.Emitter,ve=new a.Emitter,Ge=new a.Emitter,Te=new a.Emitter,Ze=new a.Emitter,ke=I&&I.cancellationStrategy?I.cancellationStrategy:_.Message;function Ve(ye){if(ye===null)throw new Error("Can't send requests with id null since the response can't be correlated.");return"req-"+ye.toString()}E(Ve,"createRequestQueueKey");function Qe(ye){return ye===null?"res-unknown-"+(++G).toString():"res-"+ye.toString()}E(Qe,"createResponseQueueKey");function nt(){return"not-"+(++P).toString()}E(nt,"createNotificationQueueKey");function tt(ye,et){n.Message.isRequest(et)?ye.set(Ve(et.id),et):n.Message.isResponse(et)?ye.set(Qe(et.id),et):ye.set(nt(),et)}E(tt,"addMessageToQueue");function je(ye){}E(je,"cancelUndispatched");function Ce(){return Ne===M.Listening}E(Ce,"isListening");function Se(){return Ne===M.Closed}E(Se,"isClosed");function H(){return Ne===M.Disposed}E(H,"isDisposed");function he(){(Ne===M.New||Ne===M.Listening)&&(Ne=M.Closed,ve.fire(void 0))}E(he,"closeHandler");function j(ye){me.fire([ye,void 0,void 0])}E(j,"readErrorHandler");function pe(ye){me.fire(ye)}E(pe,"writeErrorHandler"),R.onClose(he),R.onError(j),N.onClose(he),N.onError(pe);function re(){J||Z.size===0||(J=(0,e.default)().timer.setImmediate(()=>{J=void 0,xe()}))}E(re,"triggerMessageQueue");function Be(ye){n.Message.isRequest(ye)?De(ye):n.Message.isNotification(ye)?Le(ye):n.Message.isResponse(ye)?qe(ye):Xe(ye)}E(Be,"handleMessage");function xe(){if(Z.size===0)return;const ye=Z.shift();try{const et=I==null?void 0:I.messageStrategy;L.is(et)?et.handleMessage(ye,Be):Be(ye)}finally{re()}}E(xe,"processMessageQueue");const Ue=E(ye=>{try{if(n.Message.isNotification(ye)&&ye.method===o.type.method){const et=ye.params.id,ct=Ve(et),_t=Z.get(ct);if(n.Message.isRequest(_t)){const nr=I==null?void 0:I.connectionStrategy,ir=nr&&nr.cancelUndispatched?nr.cancelUndispatched(_t,je):void 0;if(ir&&(ir.error!==void 0||ir.result!==void 0)){Z.delete(ct),ue.delete(et),ir.id=_t.id,lt(ir,ye.method,Date.now()),N.write(ir).catch(()=>$.error("Sending response for canceled message failed."));return}}const Ft=ue.get(et);if(Ft!==void 0){Ft.cancel(),Et(ye);return}else ne.add(et)}tt(Z,ye)}finally{re()}},"callback");function De(ye){if(H())return;function et(or,Rr,Jt){const Nr={jsonrpc:V,id:ye.id};or instanceof n.ResponseError?Nr.error=or.toJson():Nr.result=or===void 0?null:or,lt(Nr,Rr,Jt),N.write(Nr).catch(()=>$.error("Sending response failed."))}E(et,"reply");function ct(or,Rr,Jt){const Nr={jsonrpc:V,id:ye.id,error:or.toJson()};lt(Nr,Rr,Jt),N.write(Nr).catch(()=>$.error("Sending response failed."))}E(ct,"replyError");function _t(or,Rr,Jt){or===void 0&&(or=null);const Nr={jsonrpc:V,id:ye.id,result:or};lt(Nr,Rr,Jt),N.write(Nr).catch(()=>$.error("Sending response failed."))}E(_t,"replySuccess"),be(ye);const Ft=W.get(ye.method);let nr,ir;Ft&&(nr=Ft.type,ir=Ft.handler);const _r=Date.now();if(ir||Y){const or=ye.id??String(Date.now()),Rr=w.is(ke.receiver)?ke.receiver.createCancellationTokenSource(or):ke.receiver.createCancellationTokenSource(ye);ye.id!==null&&ne.has(ye.id)&&Rr.cancel(),ye.id!==null&&ue.set(or,Rr);try{let Jt;if(ir)if(ye.params===void 0){if(nr!==void 0&&nr.numberOfParams!==0){ct(new n.ResponseError(n.ErrorCodes.InvalidParams,`Request ${ye.method} defines ${nr.numberOfParams} params but received none.`),ye.method,_r);return}Jt=ir(Rr.token)}else if(Array.isArray(ye.params)){if(nr!==void 0&&nr.parameterStructures===n.ParameterStructures.byName){ct(new n.ResponseError(n.ErrorCodes.InvalidParams,`Request ${ye.method} defines parameters by name but received parameters by position`),ye.method,_r);return}Jt=ir(...ye.params,Rr.token)}else{if(nr!==void 0&&nr.parameterStructures===n.ParameterStructures.byPosition){ct(new n.ResponseError(n.ErrorCodes.InvalidParams,`Request ${ye.method} defines parameters by position but received parameters by name`),ye.method,_r);return}Jt=ir(ye.params,Rr.token)}else Y&&(Jt=Y(ye.method,ye.params,Rr.token));const Nr=Jt;Jt?Nr.then?Nr.then(gn=>{ue.delete(or),et(gn,ye.method,_r)},gn=>{ue.delete(or),gn instanceof n.ResponseError?ct(gn,ye.method,_r):gn&&r.string(gn.message)?ct(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${ye.method} failed with message: ${gn.message}`),ye.method,_r):ct(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${ye.method} failed unexpectedly without providing any details.`),ye.method,_r)}):(ue.delete(or),et(Jt,ye.method,_r)):(ue.delete(or),_t(Jt,ye.method,_r))}catch(Jt){ue.delete(or),Jt instanceof n.ResponseError?et(Jt,ye.method,_r):Jt&&r.string(Jt.message)?ct(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${ye.method} failed with message: ${Jt.message}`),ye.method,_r):ct(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${ye.method} failed unexpectedly without providing any details.`),ye.method,_r)}}else ct(new n.ResponseError(n.ErrorCodes.MethodNotFound,`Unhandled method ${ye.method}`),ye.method,_r)}E(De,"handleRequest");function qe(ye){if(!H())if(ye.id===null)ye.error?$.error(`Received response message without id: Error is: -${JSON.stringify(ye.error,void 0,4)}`):$.error("Received response message without id. No further error information provided.");else{const et=ye.id,ct=ee.get(et);if(vt(ye,ct),ct!==void 0){ee.delete(et);try{if(ye.error){const _t=ye.error;ct.reject(new n.ResponseError(_t.code,_t.message,_t.data))}else if(ye.result!==void 0)ct.resolve(ye.result);else throw new Error("Should never happen.")}catch(_t){_t.message?$.error(`Response handler '${ct.method}' failed with message: ${_t.message}`):$.error(`Response handler '${ct.method}' failed unexpectedly.`)}}}}E(qe,"handleResponse");function Le(ye){if(H())return;let et,ct;if(ye.method===o.type.method){const _t=ye.params.id;ne.delete(_t),Et(ye);return}else{const _t=K.get(ye.method);_t&&(ct=_t.handler,et=_t.type)}if(ct||ie)try{if(Et(ye),ct)if(ye.params===void 0)et!==void 0&&et.numberOfParams!==0&&et.parameterStructures!==n.ParameterStructures.byName&&$.error(`Notification ${ye.method} defines ${et.numberOfParams} params but received none.`),ct();else if(Array.isArray(ye.params)){const _t=ye.params;ye.method===u.type.method&&_t.length===2&&l.is(_t[0])?ct({token:_t[0],value:_t[1]}):(et!==void 0&&(et.parameterStructures===n.ParameterStructures.byName&&$.error(`Notification ${ye.method} defines parameters by name but received parameters by position`),et.numberOfParams!==ye.params.length&&$.error(`Notification ${ye.method} defines ${et.numberOfParams} params but received ${_t.length} arguments`)),ct(..._t))}else et!==void 0&&et.parameterStructures===n.ParameterStructures.byPosition&&$.error(`Notification ${ye.method} defines parameters by position but received parameters by name`),ct(ye.params);else ie&&ie(ye.method,ye.params)}catch(_t){_t.message?$.error(`Notification handler '${ye.method}' failed with message: ${_t.message}`):$.error(`Notification handler '${ye.method}' failed unexpectedly.`)}else Ge.fire(ye)}E(Le,"handleNotification");function Xe(ye){if(!ye){$.error("Received empty message.");return}$.error(`Received message which is neither a response nor a notification message: -${JSON.stringify(ye,null,4)}`);const et=ye;if(r.string(et.id)||r.number(et.id)){const ct=et.id,_t=ee.get(ct);_t&&_t.reject(new Error("The received response has neither a result nor an error property."))}}E(Xe,"handleInvalidMessage");function Ie(ye){if(ye!=null)switch(fe){case f.Verbose:return JSON.stringify(ye,null,4);case f.Compact:return JSON.stringify(ye);default:return}}E(Ie,"stringifyTrace");function it(ye){if(!(fe===f.Off||!Ae))if(_e===g.Text){let et;(fe===f.Verbose||fe===f.Compact)&&ye.params&&(et=`Params: ${Ie(ye.params)} +${y}`);const x=y.substr(0,v),b=y.substr(v+1).trim();p.set(o?x.toLowerCase():x,b)}return p}tryReadBody(o){if(!(this._totalLengththis._totalLength)throw new Error("Cannot read so many bytes!");if(this._chunks[0].byteLength===o){const d=this._chunks[0];return this._chunks.shift(),this._totalLength-=o,this.asNative(d)}if(this._chunks[0].byteLength>o){const d=this._chunks[0],f=this.asNative(d,o);return this._chunks[0]=d.slice(o),this._totalLength-=o,f}const l=this.allocNative(o);let u=0,h=0;for(;o>0;){const d=this._chunks[h];if(d.byteLength>o){const f=d.slice(0,o);l.set(f,u),u+=o,this._chunks[h]=d.slice(o),this._totalLength-=o,o-=o}else l.set(d,u),u+=d.byteLength,this._chunks.shift(),this._totalLength-=d.byteLength,o-=d.byteLength}return l}},E(a,"AbstractMessageBuffer"),a);t.AbstractMessageBuffer=i}}),utt=Gr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/connection.js"(t){var F,A;Object.defineProperty(t,"__esModule",{value:!0}),t.createMessageConnection=t.ConnectionOptions=t.MessageStrategy=t.CancellationStrategy=t.CancellationSenderStrategy=t.CancellationReceiverStrategy=t.RequestCancellationReceiverStrategy=t.IdCancellationReceiverStrategy=t.ConnectionStrategy=t.ConnectionError=t.ConnectionErrors=t.LogTraceNotification=t.SetTraceNotification=t.TraceFormat=t.TraceValues=t.Trace=t.NullLogger=t.ProgressType=t.ProgressToken=void 0;var e=up(),r=Dw(),n=tce(),i=rce(),a=Dm(),s=RS(),o;(function(R){R.type=new n.NotificationType("$/cancelRequest")})(o||(o={}));var l;(function(R){function N(M){return typeof M=="string"||typeof M=="number"}E(N,"is"),R.is=N})(l||(t.ProgressToken=l={}));var u;(function(R){R.type=new n.NotificationType("$/progress")})(u||(u={}));var h=(F=class{constructor(){}},E(F,"ProgressType"),F);t.ProgressType=h;var d;(function(R){function N(M){return r.func(M)}E(N,"is"),R.is=N})(d||(d={})),t.NullLogger=Object.freeze({error:E(()=>{},"error"),warn:E(()=>{},"warn"),info:E(()=>{},"info"),log:E(()=>{},"log")});var f;(function(R){R[R.Off=0]="Off",R[R.Messages=1]="Messages",R[R.Compact=2]="Compact",R[R.Verbose=3]="Verbose"})(f||(t.Trace=f={}));var p;(function(R){R.Off="off",R.Messages="messages",R.Compact="compact",R.Verbose="verbose"})(p||(t.TraceValues=p={})),(function(R){function N(D){if(!r.string(D))return R.Off;switch(D=D.toLowerCase(),D){case"off":return R.Off;case"messages":return R.Messages;case"compact":return R.Compact;case"verbose":return R.Verbose;default:return R.Off}}E(N,"fromString"),R.fromString=N;function M(D){switch(D){case R.Off:return"off";case R.Messages:return"messages";case R.Compact:return"compact";case R.Verbose:return"verbose";default:return"off"}}E(M,"toString"),R.toString=M})(f||(t.Trace=f={}));var g;(function(R){R.Text="text",R.JSON="json"})(g||(t.TraceFormat=g={})),(function(R){function N(M){return r.string(M)?(M=M.toLowerCase(),M==="json"?R.JSON:R.Text):R.Text}E(N,"fromString"),R.fromString=N})(g||(t.TraceFormat=g={}));var m;(function(R){R.type=new n.NotificationType("$/setTrace")})(m||(t.SetTraceNotification=m={}));var y;(function(R){R.type=new n.NotificationType("$/logTrace")})(y||(t.LogTraceNotification=y={}));var v;(function(R){R[R.Closed=1]="Closed",R[R.Disposed=2]="Disposed",R[R.AlreadyListening=3]="AlreadyListening"})(v||(t.ConnectionErrors=v={}));var x=(A=class extends Error{constructor(N,M){super(M),this.code=N,Object.setPrototypeOf(this,A.prototype)}},E(A,"ConnectionError"),A);t.ConnectionError=x;var b;(function(R){function N(M){const D=M;return D&&r.func(D.cancelUndispatched)}E(N,"is"),R.is=N})(b||(t.ConnectionStrategy=b={}));var w;(function(R){function N(M){const D=M;return D&&(D.kind===void 0||D.kind==="id")&&r.func(D.createCancellationTokenSource)&&(D.dispose===void 0||r.func(D.dispose))}E(N,"is"),R.is=N})(w||(t.IdCancellationReceiverStrategy=w={}));var C;(function(R){function N(M){const D=M;return D&&D.kind==="request"&&r.func(D.createCancellationTokenSource)&&(D.dispose===void 0||r.func(D.dispose))}E(N,"is"),R.is=N})(C||(t.RequestCancellationReceiverStrategy=C={}));var _;(function(R){R.Message=Object.freeze({createCancellationTokenSource(M){return new s.CancellationTokenSource}});function N(M){return w.is(M)||C.is(M)}E(N,"is"),R.is=N})(_||(t.CancellationReceiverStrategy=_={}));var k;(function(R){R.Message=Object.freeze({sendCancellation(M,D){return M.sendNotification(o.type,{id:D})},cleanup(M){}});function N(M){const D=M;return D&&r.func(D.sendCancellation)&&r.func(D.cleanup)}E(N,"is"),R.is=N})(k||(t.CancellationSenderStrategy=k={}));var S;(function(R){R.Message=Object.freeze({receiver:_.Message,sender:k.Message});function N(M){const D=M;return D&&_.is(D.receiver)&&k.is(D.sender)}E(N,"is"),R.is=N})(S||(t.CancellationStrategy=S={}));var L;(function(R){function N(M){const D=M;return D&&r.func(D.handleMessage)}E(N,"is"),R.is=N})(L||(t.MessageStrategy=L={}));var $;(function(R){function N(M){const D=M;return D&&(S.is(D.cancellationStrategy)||b.is(D.connectionStrategy)||L.is(D.messageStrategy))}E(N,"is"),R.is=N})($||(t.ConnectionOptions=$={}));var I;(function(R){R[R.New=1]="New",R[R.Listening=2]="Listening",R[R.Closed=3]="Closed",R[R.Disposed=4]="Disposed"})(I||(I={}));function z(R,N,M,D){const O=M!==void 0?M:t.NullLogger;let B=0,P=0,G=0;const V="2.0";let H;const W=new Map;let ie;const j=new Map,ae=new Map;let J,K=new i.LinkedMap,Q=new Map,re=new Set,le=new Map,fe=f.Off,Ae=g.Text,Se,Ne=I.New;const ge=new a.Emitter,ve=new a.Emitter,ze=new a.Emitter,xe=new a.Emitter,Ke=new a.Emitter,Ce=D&&D.cancellationStrategy?D.cancellationStrategy:S.Message;function Ve(ye){if(ye===null)throw new Error("Can't send requests with id null since the response can't be correlated.");return"req-"+ye.toString()}E(Ve,"createRequestQueueKey");function Qe(ye){return ye===null?"res-unknown-"+(++G).toString():"res-"+ye.toString()}E(Qe,"createResponseQueueKey");function nt(){return"not-"+(++P).toString()}E(nt,"createNotificationQueueKey");function tt(ye,et){n.Message.isRequest(et)?ye.set(Ve(et.id),et):n.Message.isResponse(et)?ye.set(Qe(et.id),et):ye.set(nt(),et)}E(tt,"addMessageToQueue");function Ze(ye){}E(Ze,"cancelUndispatched");function ke(){return Ne===I.Listening}E(ke,"isListening");function _e(){return Ne===I.Closed}E(_e,"isClosed");function Y(){return Ne===I.Disposed}E(Y,"isDisposed");function he(){(Ne===I.New||Ne===I.Listening)&&(Ne=I.Closed,ve.fire(void 0))}E(he,"closeHandler");function Z(ye){ge.fire([ye,void 0,void 0])}E(Z,"readErrorHandler");function pe(ye){ge.fire(ye)}E(pe,"writeErrorHandler"),R.onClose(he),R.onError(Z),N.onClose(he),N.onError(pe);function ne(){J||K.size===0||(J=(0,e.default)().timer.setImmediate(()=>{J=void 0,Te()}))}E(ne,"triggerMessageQueue");function Be(ye){n.Message.isRequest(ye)?De(ye):n.Message.isNotification(ye)?Le(ye):n.Message.isResponse(ye)?qe(ye):Xe(ye)}E(Be,"handleMessage");function Te(){if(K.size===0)return;const ye=K.shift();try{const et=D==null?void 0:D.messageStrategy;L.is(et)?et.handleMessage(ye,Be):Be(ye)}finally{ne()}}E(Te,"processMessageQueue");const Ue=E(ye=>{try{if(n.Message.isNotification(ye)&&ye.method===o.type.method){const et=ye.params.id,ut=Ve(et),Lt=K.get(ut);if(n.Message.isRequest(Lt)){const lr=D==null?void 0:D.connectionStrategy,cr=lr&&lr.cancelUndispatched?lr.cancelUndispatched(Lt,Ze):void 0;if(cr&&(cr.error!==void 0||cr.result!==void 0)){K.delete(ut),le.delete(et),cr.id=Lt.id,ct(cr,ye.method,Date.now()),N.write(cr).catch(()=>O.error("Sending response for canceled message failed."));return}}const Vt=le.get(et);if(Vt!==void 0){Vt.cancel(),_t(ye);return}else re.add(et)}tt(K,ye)}finally{ne()}},"callback");function De(ye){if(Y())return;function et(dr,Or,ir){const Vr={jsonrpc:V,id:ye.id};dr instanceof n.ResponseError?Vr.error=dr.toJson():Vr.result=dr===void 0?null:dr,ct(Vr,Or,ir),N.write(Vr).catch(()=>O.error("Sending response failed."))}E(et,"reply");function ut(dr,Or,ir){const Vr={jsonrpc:V,id:ye.id,error:dr.toJson()};ct(Vr,Or,ir),N.write(Vr).catch(()=>O.error("Sending response failed."))}E(ut,"replyError");function Lt(dr,Or,ir){dr===void 0&&(dr=null);const Vr={jsonrpc:V,id:ye.id,result:dr};ct(Vr,Or,ir),N.write(Vr).catch(()=>O.error("Sending response failed."))}E(Lt,"replySuccess"),be(ye);const Vt=W.get(ye.method);let lr,cr;Vt&&(lr=Vt.type,cr=Vt.handler);const $r=Date.now();if(cr||H){const dr=ye.id??String(Date.now()),Or=w.is(Ce.receiver)?Ce.receiver.createCancellationTokenSource(dr):Ce.receiver.createCancellationTokenSource(ye);ye.id!==null&&re.has(ye.id)&&Or.cancel(),ye.id!==null&&le.set(dr,Or);try{let ir;if(cr)if(ye.params===void 0){if(lr!==void 0&&lr.numberOfParams!==0){ut(new n.ResponseError(n.ErrorCodes.InvalidParams,`Request ${ye.method} defines ${lr.numberOfParams} params but received none.`),ye.method,$r);return}ir=cr(Or.token)}else if(Array.isArray(ye.params)){if(lr!==void 0&&lr.parameterStructures===n.ParameterStructures.byName){ut(new n.ResponseError(n.ErrorCodes.InvalidParams,`Request ${ye.method} defines parameters by name but received parameters by position`),ye.method,$r);return}ir=cr(...ye.params,Or.token)}else{if(lr!==void 0&&lr.parameterStructures===n.ParameterStructures.byPosition){ut(new n.ResponseError(n.ErrorCodes.InvalidParams,`Request ${ye.method} defines parameters by position but received parameters by name`),ye.method,$r);return}ir=cr(ye.params,Or.token)}else H&&(ir=H(ye.method,ye.params,Or.token));const Vr=ir;ir?Vr.then?Vr.then(Sn=>{le.delete(dr),et(Sn,ye.method,$r)},Sn=>{le.delete(dr),Sn instanceof n.ResponseError?ut(Sn,ye.method,$r):Sn&&r.string(Sn.message)?ut(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${ye.method} failed with message: ${Sn.message}`),ye.method,$r):ut(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${ye.method} failed unexpectedly without providing any details.`),ye.method,$r)}):(le.delete(dr),et(ir,ye.method,$r)):(le.delete(dr),Lt(ir,ye.method,$r))}catch(ir){le.delete(dr),ir instanceof n.ResponseError?et(ir,ye.method,$r):ir&&r.string(ir.message)?ut(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${ye.method} failed with message: ${ir.message}`),ye.method,$r):ut(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${ye.method} failed unexpectedly without providing any details.`),ye.method,$r)}}else ut(new n.ResponseError(n.ErrorCodes.MethodNotFound,`Unhandled method ${ye.method}`),ye.method,$r)}E(De,"handleRequest");function qe(ye){if(!Y())if(ye.id===null)ye.error?O.error(`Received response message without id: Error is: +${JSON.stringify(ye.error,void 0,4)}`):O.error("Received response message without id. No further error information provided.");else{const et=ye.id,ut=Q.get(et);if(bt(ye,ut),ut!==void 0){Q.delete(et);try{if(ye.error){const Lt=ye.error;ut.reject(new n.ResponseError(Lt.code,Lt.message,Lt.data))}else if(ye.result!==void 0)ut.resolve(ye.result);else throw new Error("Should never happen.")}catch(Lt){Lt.message?O.error(`Response handler '${ut.method}' failed with message: ${Lt.message}`):O.error(`Response handler '${ut.method}' failed unexpectedly.`)}}}}E(qe,"handleResponse");function Le(ye){if(Y())return;let et,ut;if(ye.method===o.type.method){const Lt=ye.params.id;re.delete(Lt),_t(ye);return}else{const Lt=j.get(ye.method);Lt&&(ut=Lt.handler,et=Lt.type)}if(ut||ie)try{if(_t(ye),ut)if(ye.params===void 0)et!==void 0&&et.numberOfParams!==0&&et.parameterStructures!==n.ParameterStructures.byName&&O.error(`Notification ${ye.method} defines ${et.numberOfParams} params but received none.`),ut();else if(Array.isArray(ye.params)){const Lt=ye.params;ye.method===u.type.method&&Lt.length===2&&l.is(Lt[0])?ut({token:Lt[0],value:Lt[1]}):(et!==void 0&&(et.parameterStructures===n.ParameterStructures.byName&&O.error(`Notification ${ye.method} defines parameters by name but received parameters by position`),et.numberOfParams!==ye.params.length&&O.error(`Notification ${ye.method} defines ${et.numberOfParams} params but received ${Lt.length} arguments`)),ut(...Lt))}else et!==void 0&&et.parameterStructures===n.ParameterStructures.byPosition&&O.error(`Notification ${ye.method} defines parameters by position but received parameters by name`),ut(ye.params);else ie&&ie(ye.method,ye.params)}catch(Lt){Lt.message?O.error(`Notification handler '${ye.method}' failed with message: ${Lt.message}`):O.error(`Notification handler '${ye.method}' failed unexpectedly.`)}else ze.fire(ye)}E(Le,"handleNotification");function Xe(ye){if(!ye){O.error("Received empty message.");return}O.error(`Received message which is neither a response nor a notification message: +${JSON.stringify(ye,null,4)}`);const et=ye;if(r.string(et.id)||r.number(et.id)){const ut=et.id,Lt=Q.get(ut);Lt&&Lt.reject(new Error("The received response has neither a result nor an error property."))}}E(Xe,"handleInvalidMessage");function Ie(ye){if(ye!=null)switch(fe){case f.Verbose:return JSON.stringify(ye,null,4);case f.Compact:return JSON.stringify(ye);default:return}}E(Ie,"stringifyTrace");function it(ye){if(!(fe===f.Off||!Se))if(Ae===g.Text){let et;(fe===f.Verbose||fe===f.Compact)&&ye.params&&(et=`Params: ${Ie(ye.params)} -`),Ae.log(`Sending request '${ye.method} - (${ye.id})'.`,et)}else ot("send-request",ye)}E(it,"traceSendingRequest");function we(ye){if(!(fe===f.Off||!Ae))if(_e===g.Text){let et;(fe===f.Verbose||fe===f.Compact)&&(ye.params?et=`Params: ${Ie(ye.params)} +`),Se.log(`Sending request '${ye.method} - (${ye.id})'.`,et)}else lt("send-request",ye)}E(it,"traceSendingRequest");function we(ye){if(!(fe===f.Off||!Se))if(Ae===g.Text){let et;(fe===f.Verbose||fe===f.Compact)&&(ye.params?et=`Params: ${Ie(ye.params)} `:et=`No parameters provided. -`),Ae.log(`Sending notification '${ye.method}'.`,et)}else ot("send-notification",ye)}E(we,"traceSendingNotification");function lt(ye,et,ct){if(!(fe===f.Off||!Ae))if(_e===g.Text){let _t;(fe===f.Verbose||fe===f.Compact)&&(ye.error&&ye.error.data?_t=`Error data: ${Ie(ye.error.data)} +`),Se.log(`Sending notification '${ye.method}'.`,et)}else lt("send-notification",ye)}E(we,"traceSendingNotification");function ct(ye,et,ut){if(!(fe===f.Off||!Se))if(Ae===g.Text){let Lt;(fe===f.Verbose||fe===f.Compact)&&(ye.error&&ye.error.data?Lt=`Error data: ${Ie(ye.error.data)} -`:ye.result?_t=`Result: ${Ie(ye.result)} +`:ye.result?Lt=`Result: ${Ie(ye.result)} -`:ye.error===void 0&&(_t=`No result returned. +`:ye.error===void 0&&(Lt=`No result returned. -`)),Ae.log(`Sending response '${et} - (${ye.id})'. Processing request took ${Date.now()-ct}ms`,_t)}else ot("send-response",ye)}E(lt,"traceSendingResponse");function be(ye){if(!(fe===f.Off||!Ae))if(_e===g.Text){let et;(fe===f.Verbose||fe===f.Compact)&&ye.params&&(et=`Params: ${Ie(ye.params)} +`)),Se.log(`Sending response '${et} - (${ye.id})'. Processing request took ${Date.now()-ut}ms`,Lt)}else lt("send-response",ye)}E(ct,"traceSendingResponse");function be(ye){if(!(fe===f.Off||!Se))if(Ae===g.Text){let et;(fe===f.Verbose||fe===f.Compact)&&ye.params&&(et=`Params: ${Ie(ye.params)} -`),Ae.log(`Received request '${ye.method} - (${ye.id})'.`,et)}else ot("receive-request",ye)}E(be,"traceReceivedRequest");function Et(ye){if(!(fe===f.Off||!Ae||ye.method===y.type.method))if(_e===g.Text){let et;(fe===f.Verbose||fe===f.Compact)&&(ye.params?et=`Params: ${Ie(ye.params)} +`),Se.log(`Received request '${ye.method} - (${ye.id})'.`,et)}else lt("receive-request",ye)}E(be,"traceReceivedRequest");function _t(ye){if(!(fe===f.Off||!Se||ye.method===y.type.method))if(Ae===g.Text){let et;(fe===f.Verbose||fe===f.Compact)&&(ye.params?et=`Params: ${Ie(ye.params)} `:et=`No parameters provided. -`),Ae.log(`Received notification '${ye.method}'.`,et)}else ot("receive-notification",ye)}E(Et,"traceReceivedNotification");function vt(ye,et){if(!(fe===f.Off||!Ae))if(_e===g.Text){let ct;if((fe===f.Verbose||fe===f.Compact)&&(ye.error&&ye.error.data?ct=`Error data: ${Ie(ye.error.data)} +`),Se.log(`Received notification '${ye.method}'.`,et)}else lt("receive-notification",ye)}E(_t,"traceReceivedNotification");function bt(ye,et){if(!(fe===f.Off||!Se))if(Ae===g.Text){let ut;if((fe===f.Verbose||fe===f.Compact)&&(ye.error&&ye.error.data?ut=`Error data: ${Ie(ye.error.data)} -`:ye.result?ct=`Result: ${Ie(ye.result)} +`:ye.result?ut=`Result: ${Ie(ye.result)} -`:ye.error===void 0&&(ct=`No result returned. +`:ye.error===void 0&&(ut=`No result returned. -`)),et){const _t=ye.error?` Request failed: ${ye.error.message} (${ye.error.code}).`:"";Ae.log(`Received response '${et.method} - (${ye.id})' in ${Date.now()-et.timerStart}ms.${_t}`,ct)}else Ae.log(`Received response ${ye.id} without active response promise.`,ct)}else ot("receive-response",ye)}E(vt,"traceReceivedResponse");function ot(ye,et){if(!Ae||fe===f.Off)return;const ct={isLSPMessage:!0,type:ye,message:et,timestamp:Date.now()};Ae.log(ct)}E(ot,"logLSPMessage");function It(){if(Se())throw new T(v.Closed,"Connection is closed.");if(H())throw new T(v.Disposed,"Connection is disposed.")}E(It,"throwIfClosedOrDisposed");function xt(){if(Ce())throw new T(v.AlreadyListening,"Connection is already listening")}E(xt,"throwIfListening");function ht(){if(!Ce())throw new Error("Call listen() first.")}E(ht,"throwIfNotListening");function oe(ye){return ye===void 0?null:ye}E(oe,"undefinedToNull");function At(ye){if(ye!==null)return ye}E(At,"nullToUndefined");function dt(ye){return ye!=null&&!Array.isArray(ye)&&typeof ye=="object"}E(dt,"isNamedParam");function ut(ye,et){switch(ye){case n.ParameterStructures.auto:return dt(et)?At(et):[oe(et)];case n.ParameterStructures.byName:if(!dt(et))throw new Error("Received parameters by name but param is not an object literal.");return At(et);case n.ParameterStructures.byPosition:return[oe(et)];default:throw new Error(`Unknown parameter structure ${ye.toString()}`)}}E(ut,"computeSingleParam");function wt(ye,et){let ct;const _t=ye.numberOfParams;switch(_t){case 0:ct=void 0;break;case 1:ct=ut(ye.parameterStructures,et[0]);break;default:ct=[];for(let Ft=0;Ft{It();let ct,_t;if(r.string(ye)){ct=ye;const nr=et[0];let ir=0,_r=n.ParameterStructures.auto;n.ParameterStructures.is(nr)&&(ir=1,_r=nr);let or=et.length;const Rr=or-ir;switch(Rr){case 0:_t=void 0;break;case 1:_t=ut(_r,et[ir]);break;default:if(_r===n.ParameterStructures.byName)throw new Error(`Received ${Rr} parameters for 'by Name' notification parameter structure.`);_t=et.slice(ir,or).map(Jt=>oe(Jt));break}}else{const nr=et;ct=ye.method,_t=wt(ye,nr)}const Ft={jsonrpc:V,method:ct,params:_t};return we(Ft),N.write(Ft).catch(nr=>{throw $.error("Sending notification failed."),nr})},"sendNotification"),onNotification:E((ye,et)=>{It();let ct;return r.func(ye)?ie=ye:et&&(r.string(ye)?(ct=ye,K.set(ye,{type:void 0,handler:et})):(ct=ye.method,K.set(ye.method,{type:ye,handler:et}))),{dispose:E(()=>{ct!==void 0?K.delete(ct):ie=void 0},"dispose")}},"onNotification"),onProgress:E((ye,et,ct)=>{if(se.has(et))throw new Error(`Progress handler for token ${et} already registered`);return se.set(et,ct),{dispose:E(()=>{se.delete(et)},"dispose")}},"onProgress"),sendProgress:E((ye,et,ct)=>Mr.sendNotification(u.type,{token:et,value:ct}),"sendProgress"),onUnhandledProgress:Te.event,sendRequest:E((ye,...et)=>{It(),ht();let ct,_t,Ft;if(r.string(ye)){ct=ye;const or=et[0],Rr=et[et.length-1];let Jt=0,Nr=n.ParameterStructures.auto;n.ParameterStructures.is(or)&&(Jt=1,Nr=or);let gn=et.length;s.CancellationToken.is(Rr)&&(gn=gn-1,Ft=Rr);const $r=gn-Jt;switch($r){case 0:_t=void 0;break;case 1:_t=ut(Nr,et[Jt]);break;default:if(Nr===n.ParameterStructures.byName)throw new Error(`Received ${$r} parameters for 'by Name' request parameter structure.`);_t=et.slice(Jt,gn).map(Pa=>oe(Pa));break}}else{const or=et;ct=ye.method,_t=wt(ye,or);const Rr=ye.numberOfParams;Ft=s.CancellationToken.is(or[Rr])?or[Rr]:void 0}const nr=B++;let ir;Ft&&(ir=Ft.onCancellationRequested(()=>{const or=ke.sender.sendCancellation(Mr,nr);return or===void 0?($.log(`Received no promise from cancellation strategy when cancelling id ${nr}`),Promise.resolve()):or.catch(()=>{$.log(`Sending cancellation messages for id ${nr} failed`)})}));const _r={jsonrpc:V,id:nr,method:ct,params:_t};return it(_r),typeof ke.sender.enableCancellation=="function"&&ke.sender.enableCancellation(_r),new Promise(async(or,Rr)=>{const Jt=E($r=>{or($r),ke.sender.cleanup(nr),ir==null||ir.dispose()},"resolveWithCleanup"),Nr=E($r=>{Rr($r),ke.sender.cleanup(nr),ir==null||ir.dispose()},"rejectWithCleanup"),gn={method:ct,timerStart:Date.now(),resolve:Jt,reject:Nr};try{await N.write(_r),ee.set(nr,gn)}catch($r){throw $.error("Sending request failed."),gn.reject(new n.ResponseError(n.ErrorCodes.MessageWriteError,$r.message?$r.message:"Unknown reason")),$r}})},"sendRequest"),onRequest:E((ye,et)=>{It();let ct=null;return d.is(ye)?(ct=void 0,Y=ye):r.string(ye)?(ct=null,et!==void 0&&(ct=ye,W.set(ye,{handler:et,type:void 0}))):et!==void 0&&(ct=ye.method,W.set(ye.method,{type:ye,handler:et})),{dispose:E(()=>{ct!==null&&(ct!==void 0?W.delete(ct):Y=void 0)},"dispose")}},"onRequest"),hasPendingResponse:E(()=>ee.size>0,"hasPendingResponse"),trace:E(async(ye,et,ct)=>{let _t=!1,Ft=g.Text;ct!==void 0&&(r.boolean(ct)?_t=ct:(_t=ct.sendNotification||!1,Ft=ct.traceFormat||g.Text)),fe=ye,_e=Ft,fe===f.Off?Ae=void 0:Ae=et,_t&&!Se()&&!H()&&await Mr.sendNotification(m.type,{value:f.toString(ye)})},"trace"),onError:me.event,onClose:ve.event,onUnhandledNotification:Ge.event,onDispose:Ze.event,end:E(()=>{N.end()},"end"),dispose:E(()=>{if(H())return;Ne=M.Disposed,Ze.fire(void 0);const ye=new n.ResponseError(n.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(const et of ee.values())et.reject(ye);ee=new Map,ue=new Map,ne=new Set,Z=new i.LinkedMap,r.func(N.dispose)&&N.dispose(),r.func(R.dispose)&&R.dispose()},"dispose"),listen:E(()=>{It(),xt(),Ne=M.Listening,R.listen(Ue)},"listen"),inspect:E(()=>{(0,e.default)().console.log("inspect")},"inspect")};return Mr.onNotification(y.type,ye=>{if(fe===f.Off||!Ae)return;const et=fe===f.Verbose||fe===f.Compact;Ae.log(ye.message,et?ye.verbose:void 0)}),Mr.onNotification(u.type,ye=>{const et=se.get(ye.token);et?et(ye.value):Te.fire(ye)}),Mr}E(z,"createMessageConnection"),t.createMessageConnection=z}}),_9=Dr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/api.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ProgressType=t.ProgressToken=t.createMessageConnection=t.NullLogger=t.ConnectionOptions=t.ConnectionStrategy=t.AbstractMessageBuffer=t.WriteableStreamMessageWriter=t.AbstractMessageWriter=t.MessageWriter=t.ReadableStreamMessageReader=t.AbstractMessageReader=t.MessageReader=t.SharedArrayReceiverStrategy=t.SharedArraySenderStrategy=t.CancellationToken=t.CancellationTokenSource=t.Emitter=t.Event=t.Disposable=t.LRUCache=t.Touch=t.LinkedMap=t.ParameterStructures=t.NotificationType9=t.NotificationType8=t.NotificationType7=t.NotificationType6=t.NotificationType5=t.NotificationType4=t.NotificationType3=t.NotificationType2=t.NotificationType1=t.NotificationType0=t.NotificationType=t.ErrorCodes=t.ResponseError=t.RequestType9=t.RequestType8=t.RequestType7=t.RequestType6=t.RequestType5=t.RequestType4=t.RequestType3=t.RequestType2=t.RequestType1=t.RequestType0=t.RequestType=t.Message=t.RAL=void 0,t.MessageStrategy=t.CancellationStrategy=t.CancellationSenderStrategy=t.CancellationReceiverStrategy=t.ConnectionError=t.ConnectionErrors=t.LogTraceNotification=t.SetTraceNotification=t.TraceFormat=t.TraceValues=t.Trace=void 0;var e=Bte();Object.defineProperty(t,"Message",{enumerable:!0,get:E(function(){return e.Message},"get")}),Object.defineProperty(t,"RequestType",{enumerable:!0,get:E(function(){return e.RequestType},"get")}),Object.defineProperty(t,"RequestType0",{enumerable:!0,get:E(function(){return e.RequestType0},"get")}),Object.defineProperty(t,"RequestType1",{enumerable:!0,get:E(function(){return e.RequestType1},"get")}),Object.defineProperty(t,"RequestType2",{enumerable:!0,get:E(function(){return e.RequestType2},"get")}),Object.defineProperty(t,"RequestType3",{enumerable:!0,get:E(function(){return e.RequestType3},"get")}),Object.defineProperty(t,"RequestType4",{enumerable:!0,get:E(function(){return e.RequestType4},"get")}),Object.defineProperty(t,"RequestType5",{enumerable:!0,get:E(function(){return e.RequestType5},"get")}),Object.defineProperty(t,"RequestType6",{enumerable:!0,get:E(function(){return e.RequestType6},"get")}),Object.defineProperty(t,"RequestType7",{enumerable:!0,get:E(function(){return e.RequestType7},"get")}),Object.defineProperty(t,"RequestType8",{enumerable:!0,get:E(function(){return e.RequestType8},"get")}),Object.defineProperty(t,"RequestType9",{enumerable:!0,get:E(function(){return e.RequestType9},"get")}),Object.defineProperty(t,"ResponseError",{enumerable:!0,get:E(function(){return e.ResponseError},"get")}),Object.defineProperty(t,"ErrorCodes",{enumerable:!0,get:E(function(){return e.ErrorCodes},"get")}),Object.defineProperty(t,"NotificationType",{enumerable:!0,get:E(function(){return e.NotificationType},"get")}),Object.defineProperty(t,"NotificationType0",{enumerable:!0,get:E(function(){return e.NotificationType0},"get")}),Object.defineProperty(t,"NotificationType1",{enumerable:!0,get:E(function(){return e.NotificationType1},"get")}),Object.defineProperty(t,"NotificationType2",{enumerable:!0,get:E(function(){return e.NotificationType2},"get")}),Object.defineProperty(t,"NotificationType3",{enumerable:!0,get:E(function(){return e.NotificationType3},"get")}),Object.defineProperty(t,"NotificationType4",{enumerable:!0,get:E(function(){return e.NotificationType4},"get")}),Object.defineProperty(t,"NotificationType5",{enumerable:!0,get:E(function(){return e.NotificationType5},"get")}),Object.defineProperty(t,"NotificationType6",{enumerable:!0,get:E(function(){return e.NotificationType6},"get")}),Object.defineProperty(t,"NotificationType7",{enumerable:!0,get:E(function(){return e.NotificationType7},"get")}),Object.defineProperty(t,"NotificationType8",{enumerable:!0,get:E(function(){return e.NotificationType8},"get")}),Object.defineProperty(t,"NotificationType9",{enumerable:!0,get:E(function(){return e.NotificationType9},"get")}),Object.defineProperty(t,"ParameterStructures",{enumerable:!0,get:E(function(){return e.ParameterStructures},"get")});var r=Fte();Object.defineProperty(t,"LinkedMap",{enumerable:!0,get:E(function(){return r.LinkedMap},"get")}),Object.defineProperty(t,"LRUCache",{enumerable:!0,get:E(function(){return r.LRUCache},"get")}),Object.defineProperty(t,"Touch",{enumerable:!0,get:E(function(){return r.Touch},"get")});var n=yUe();Object.defineProperty(t,"Disposable",{enumerable:!0,get:E(function(){return n.Disposable},"get")});var i=Jp();Object.defineProperty(t,"Event",{enumerable:!0,get:E(function(){return i.Event},"get")}),Object.defineProperty(t,"Emitter",{enumerable:!0,get:E(function(){return i.Emitter},"get")});var a=L3();Object.defineProperty(t,"CancellationTokenSource",{enumerable:!0,get:E(function(){return a.CancellationTokenSource},"get")}),Object.defineProperty(t,"CancellationToken",{enumerable:!0,get:E(function(){return a.CancellationToken},"get")});var s=vUe();Object.defineProperty(t,"SharedArraySenderStrategy",{enumerable:!0,get:E(function(){return s.SharedArraySenderStrategy},"get")}),Object.defineProperty(t,"SharedArrayReceiverStrategy",{enumerable:!0,get:E(function(){return s.SharedArrayReceiverStrategy},"get")});var o=bUe();Object.defineProperty(t,"MessageReader",{enumerable:!0,get:E(function(){return o.MessageReader},"get")}),Object.defineProperty(t,"AbstractMessageReader",{enumerable:!0,get:E(function(){return o.AbstractMessageReader},"get")}),Object.defineProperty(t,"ReadableStreamMessageReader",{enumerable:!0,get:E(function(){return o.ReadableStreamMessageReader},"get")});var l=xUe();Object.defineProperty(t,"MessageWriter",{enumerable:!0,get:E(function(){return l.MessageWriter},"get")}),Object.defineProperty(t,"AbstractMessageWriter",{enumerable:!0,get:E(function(){return l.AbstractMessageWriter},"get")}),Object.defineProperty(t,"WriteableStreamMessageWriter",{enumerable:!0,get:E(function(){return l.WriteableStreamMessageWriter},"get")});var u=TUe();Object.defineProperty(t,"AbstractMessageBuffer",{enumerable:!0,get:E(function(){return u.AbstractMessageBuffer},"get")});var h=wUe();Object.defineProperty(t,"ConnectionStrategy",{enumerable:!0,get:E(function(){return h.ConnectionStrategy},"get")}),Object.defineProperty(t,"ConnectionOptions",{enumerable:!0,get:E(function(){return h.ConnectionOptions},"get")}),Object.defineProperty(t,"NullLogger",{enumerable:!0,get:E(function(){return h.NullLogger},"get")}),Object.defineProperty(t,"createMessageConnection",{enumerable:!0,get:E(function(){return h.createMessageConnection},"get")}),Object.defineProperty(t,"ProgressToken",{enumerable:!0,get:E(function(){return h.ProgressToken},"get")}),Object.defineProperty(t,"ProgressType",{enumerable:!0,get:E(function(){return h.ProgressType},"get")}),Object.defineProperty(t,"Trace",{enumerable:!0,get:E(function(){return h.Trace},"get")}),Object.defineProperty(t,"TraceValues",{enumerable:!0,get:E(function(){return h.TraceValues},"get")}),Object.defineProperty(t,"TraceFormat",{enumerable:!0,get:E(function(){return h.TraceFormat},"get")}),Object.defineProperty(t,"SetTraceNotification",{enumerable:!0,get:E(function(){return h.SetTraceNotification},"get")}),Object.defineProperty(t,"LogTraceNotification",{enumerable:!0,get:E(function(){return h.LogTraceNotification},"get")}),Object.defineProperty(t,"ConnectionErrors",{enumerable:!0,get:E(function(){return h.ConnectionErrors},"get")}),Object.defineProperty(t,"ConnectionError",{enumerable:!0,get:E(function(){return h.ConnectionError},"get")}),Object.defineProperty(t,"CancellationReceiverStrategy",{enumerable:!0,get:E(function(){return h.CancellationReceiverStrategy},"get")}),Object.defineProperty(t,"CancellationSenderStrategy",{enumerable:!0,get:E(function(){return h.CancellationSenderStrategy},"get")}),Object.defineProperty(t,"CancellationStrategy",{enumerable:!0,get:E(function(){return h.CancellationStrategy},"get")}),Object.defineProperty(t,"MessageStrategy",{enumerable:!0,get:E(function(){return h.MessageStrategy},"get")});var d=Yd();t.RAL=d.default}}),CUe=Dr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/browser/ril.js"(t){var l,u,h;Object.defineProperty(t,"__esModule",{value:!0});var e=_9(),r=(l=class extends e.AbstractMessageBuffer{constructor(f="utf-8"){super(f),this.asciiDecoder=new TextDecoder("ascii")}emptyBuffer(){return l.emptyBuffer}fromString(f,p){return new TextEncoder().encode(f)}toString(f,p){return p==="ascii"?this.asciiDecoder.decode(f):new TextDecoder(p).decode(f)}asNative(f,p){return p===void 0?f:f.slice(0,p)}allocNative(f){return new Uint8Array(f)}},E(l,"MessageBuffer"),l);r.emptyBuffer=new Uint8Array(0);var n=(u=class{constructor(f){this.socket=f,this._onData=new e.Emitter,this._messageListener=p=>{p.data.arrayBuffer().then(m=>{this._onData.fire(new Uint8Array(m))},()=>{(0,e.RAL)().console.error("Converting blob to array buffer failed.")})},this.socket.addEventListener("message",this._messageListener)}onClose(f){return this.socket.addEventListener("close",f),e.Disposable.create(()=>this.socket.removeEventListener("close",f))}onError(f){return this.socket.addEventListener("error",f),e.Disposable.create(()=>this.socket.removeEventListener("error",f))}onEnd(f){return this.socket.addEventListener("end",f),e.Disposable.create(()=>this.socket.removeEventListener("end",f))}onData(f){return this._onData.event(f)}},E(u,"ReadableStreamWrapper"),u),i=(h=class{constructor(f){this.socket=f}onClose(f){return this.socket.addEventListener("close",f),e.Disposable.create(()=>this.socket.removeEventListener("close",f))}onError(f){return this.socket.addEventListener("error",f),e.Disposable.create(()=>this.socket.removeEventListener("error",f))}onEnd(f){return this.socket.addEventListener("end",f),e.Disposable.create(()=>this.socket.removeEventListener("end",f))}write(f,p){if(typeof f=="string"){if(p!==void 0&&p!=="utf-8")throw new Error(`In a Browser environments only utf-8 text encoding is supported. But got encoding: ${p}`);this.socket.send(f)}else this.socket.send(f);return Promise.resolve()}end(){this.socket.close()}},E(h,"WritableStreamWrapper"),h),a=new TextEncoder,s=Object.freeze({messageBuffer:Object.freeze({create:E(d=>new r(d),"create")}),applicationJson:Object.freeze({encoder:Object.freeze({name:"application/json",encode:E((d,f)=>{if(f.charset!=="utf-8")throw new Error(`In a Browser environments only utf-8 text encoding is supported. But got encoding: ${f.charset}`);return Promise.resolve(a.encode(JSON.stringify(d,void 0,0)))},"encode")}),decoder:Object.freeze({name:"application/json",decode:E((d,f)=>{if(!(d instanceof Uint8Array))throw new Error("In a Browser environments only Uint8Arrays are supported.");return Promise.resolve(JSON.parse(new TextDecoder(f.charset).decode(d)))},"decode")})}),stream:Object.freeze({asReadableStream:E(d=>new n(d),"asReadableStream"),asWritableStream:E(d=>new i(d),"asWritableStream")}),console,timer:Object.freeze({setTimeout(d,f,...p){const g=setTimeout(d,f,...p);return{dispose:E(()=>clearTimeout(g),"dispose")}},setImmediate(d,...f){const p=setTimeout(d,0,...f);return{dispose:E(()=>clearTimeout(p),"dispose")}},setInterval(d,f,...p){const g=setInterval(d,f,...p);return{dispose:E(()=>clearInterval(g),"dispose")}}})});function o(){return s}E(o,"RIL"),(function(d){function f(){e.RAL.install(s)}E(f,"install"),d.install=f})(o||(o={})),t.default=o}}),eg=Dr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/browser/main.js"(t){var l,u;var e=t&&t.__createBinding||(Object.create?(function(h,d,f,p){p===void 0&&(p=f);var g=Object.getOwnPropertyDescriptor(d,f);(!g||("get"in g?!d.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:E(function(){return d[f]},"get")}),Object.defineProperty(h,p,g)}):(function(h,d,f,p){p===void 0&&(p=f),h[p]=d[f]})),r=t&&t.__exportStar||function(h,d){for(var f in h)f!=="default"&&!Object.prototype.hasOwnProperty.call(d,f)&&e(d,h,f)};Object.defineProperty(t,"__esModule",{value:!0}),t.createMessageConnection=t.BrowserMessageWriter=t.BrowserMessageReader=void 0;var n=CUe();n.default.install();var i=_9();r(_9(),t);var a=(l=class extends i.AbstractMessageReader{constructor(d){super(),this._onData=new i.Emitter,this._messageListener=f=>{this._onData.fire(f.data)},d.addEventListener("error",f=>this.fireError(f)),d.onmessage=this._messageListener}listen(d){return this._onData.event(d)}},E(l,"BrowserMessageReader"),l);t.BrowserMessageReader=a;var s=(u=class extends i.AbstractMessageWriter{constructor(d){super(),this.port=d,this.errorCount=0,d.addEventListener("error",f=>this.fireError(f))}write(d){try{return this.port.postMessage(d),Promise.resolve()}catch(f){return this.handleError(f,d),Promise.reject(f)}}handleError(d,f){this.errorCount++,this.fireError(d,f,this.errorCount)}end(){}},E(u,"BrowserMessageWriter"),u);t.BrowserMessageWriter=s;function o(h,d,f,p){return f===void 0&&(f=i.NullLogger),i.ConnectionStrategy.is(p)&&(p={connectionStrategy:p}),(0,i.createMessageConnection)(h,d,f,p)}E(o,"createMessageConnection"),t.createMessageConnection=o}}),Gte=Dr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/browser.js"(t,e){e.exports=eg()}}),Zn=Dr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/messages.js"(t){var l,u,h,d,f;Object.defineProperty(t,"__esModule",{value:!0}),t.ProtocolNotificationType=t.ProtocolNotificationType0=t.ProtocolRequestType=t.ProtocolRequestType0=t.RegistrationType=t.MessageDirection=void 0;var e=eg(),r;(function(p){p.clientToServer="clientToServer",p.serverToClient="serverToClient",p.both="both"})(r||(t.MessageDirection=r={}));var n=(l=class{constructor(g){this.method=g}},E(l,"RegistrationType"),l);t.RegistrationType=n;var i=(u=class extends e.RequestType0{constructor(g){super(g)}},E(u,"ProtocolRequestType0"),u);t.ProtocolRequestType0=i;var a=(h=class extends e.RequestType{constructor(g){super(g,e.ParameterStructures.byName)}},E(h,"ProtocolRequestType"),h);t.ProtocolRequestType=a;var s=(d=class extends e.NotificationType0{constructor(g){super(g)}},E(d,"ProtocolNotificationType0"),d);t.ProtocolNotificationType0=s;var o=(f=class extends e.NotificationType{constructor(g){super(g,e.ParameterStructures.byName)}},E(f,"ProtocolNotificationType"),f);t.ProtocolNotificationType=o}}),R9=Dr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/utils/is.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.objectLiteral=t.typedArray=t.stringArray=t.array=t.func=t.error=t.number=t.string=t.boolean=void 0;function e(h){return h===!0||h===!1}E(e,"boolean"),t.boolean=e;function r(h){return typeof h=="string"||h instanceof String}E(r,"string"),t.string=r;function n(h){return typeof h=="number"||h instanceof Number}E(n,"number"),t.number=n;function i(h){return h instanceof Error}E(i,"error"),t.error=i;function a(h){return typeof h=="function"}E(a,"func"),t.func=a;function s(h){return Array.isArray(h)}E(s,"array"),t.array=s;function o(h){return s(h)&&h.every(d=>r(d))}E(o,"stringArray"),t.stringArray=o;function l(h,d){return Array.isArray(h)&&h.every(d)}E(l,"typedArray"),t.typedArray=l;function u(h){return h!==null&&typeof h=="object"}E(u,"objectLiteral"),t.objectLiteral=u}}),kUe=Dr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.implementation.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ImplementationRequest=void 0;var e=Zn(),r;(function(n){n.method="textDocument/implementation",n.messageDirection=e.MessageDirection.clientToServer,n.type=new e.ProtocolRequestType(n.method)})(r||(t.ImplementationRequest=r={}))}}),EUe=Dr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.typeDefinition.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.TypeDefinitionRequest=void 0;var e=Zn(),r;(function(n){n.method="textDocument/typeDefinition",n.messageDirection=e.MessageDirection.clientToServer,n.type=new e.ProtocolRequestType(n.method)})(r||(t.TypeDefinitionRequest=r={}))}}),SUe=Dr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.workspaceFolder.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.DidChangeWorkspaceFoldersNotification=t.WorkspaceFoldersRequest=void 0;var e=Zn(),r;(function(i){i.method="workspace/workspaceFolders",i.messageDirection=e.MessageDirection.serverToClient,i.type=new e.ProtocolRequestType0(i.method)})(r||(t.WorkspaceFoldersRequest=r={}));var n;(function(i){i.method="workspace/didChangeWorkspaceFolders",i.messageDirection=e.MessageDirection.clientToServer,i.type=new e.ProtocolNotificationType(i.method)})(n||(t.DidChangeWorkspaceFoldersNotification=n={}))}}),AUe=Dr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.configuration.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ConfigurationRequest=void 0;var e=Zn(),r;(function(n){n.method="workspace/configuration",n.messageDirection=e.MessageDirection.serverToClient,n.type=new e.ProtocolRequestType(n.method)})(r||(t.ConfigurationRequest=r={}))}}),_Ue=Dr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.colorProvider.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ColorPresentationRequest=t.DocumentColorRequest=void 0;var e=Zn(),r;(function(i){i.method="textDocument/documentColor",i.messageDirection=e.MessageDirection.clientToServer,i.type=new e.ProtocolRequestType(i.method)})(r||(t.DocumentColorRequest=r={}));var n;(function(i){i.method="textDocument/colorPresentation",i.messageDirection=e.MessageDirection.clientToServer,i.type=new e.ProtocolRequestType(i.method)})(n||(t.ColorPresentationRequest=n={}))}}),RUe=Dr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.foldingRange.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.FoldingRangeRefreshRequest=t.FoldingRangeRequest=void 0;var e=Zn(),r;(function(i){i.method="textDocument/foldingRange",i.messageDirection=e.MessageDirection.clientToServer,i.type=new e.ProtocolRequestType(i.method)})(r||(t.FoldingRangeRequest=r={}));var n;(function(i){i.method="workspace/foldingRange/refresh",i.messageDirection=e.MessageDirection.serverToClient,i.type=new e.ProtocolRequestType0(i.method)})(n||(t.FoldingRangeRefreshRequest=n={}))}}),LUe=Dr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.declaration.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.DeclarationRequest=void 0;var e=Zn(),r;(function(n){n.method="textDocument/declaration",n.messageDirection=e.MessageDirection.clientToServer,n.type=new e.ProtocolRequestType(n.method)})(r||(t.DeclarationRequest=r={}))}}),IUe=Dr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.selectionRange.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.SelectionRangeRequest=void 0;var e=Zn(),r;(function(n){n.method="textDocument/selectionRange",n.messageDirection=e.MessageDirection.clientToServer,n.type=new e.ProtocolRequestType(n.method)})(r||(t.SelectionRangeRequest=r={}))}}),DUe=Dr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.progress.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.WorkDoneProgressCancelNotification=t.WorkDoneProgressCreateRequest=t.WorkDoneProgress=void 0;var e=eg(),r=Zn(),n;(function(s){s.type=new e.ProgressType;function o(l){return l===s.type}E(o,"is"),s.is=o})(n||(t.WorkDoneProgress=n={}));var i;(function(s){s.method="window/workDoneProgress/create",s.messageDirection=r.MessageDirection.serverToClient,s.type=new r.ProtocolRequestType(s.method)})(i||(t.WorkDoneProgressCreateRequest=i={}));var a;(function(s){s.method="window/workDoneProgress/cancel",s.messageDirection=r.MessageDirection.clientToServer,s.type=new r.ProtocolNotificationType(s.method)})(a||(t.WorkDoneProgressCancelNotification=a={}))}}),MUe=Dr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.callHierarchy.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.CallHierarchyOutgoingCallsRequest=t.CallHierarchyIncomingCallsRequest=t.CallHierarchyPrepareRequest=void 0;var e=Zn(),r;(function(a){a.method="textDocument/prepareCallHierarchy",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(r||(t.CallHierarchyPrepareRequest=r={}));var n;(function(a){a.method="callHierarchy/incomingCalls",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(n||(t.CallHierarchyIncomingCallsRequest=n={}));var i;(function(a){a.method="callHierarchy/outgoingCalls",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(i||(t.CallHierarchyOutgoingCallsRequest=i={}))}}),NUe=Dr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.semanticTokens.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.SemanticTokensRefreshRequest=t.SemanticTokensRangeRequest=t.SemanticTokensDeltaRequest=t.SemanticTokensRequest=t.SemanticTokensRegistrationType=t.TokenFormat=void 0;var e=Zn(),r;(function(l){l.Relative="relative"})(r||(t.TokenFormat=r={}));var n;(function(l){l.method="textDocument/semanticTokens",l.type=new e.RegistrationType(l.method)})(n||(t.SemanticTokensRegistrationType=n={}));var i;(function(l){l.method="textDocument/semanticTokens/full",l.messageDirection=e.MessageDirection.clientToServer,l.type=new e.ProtocolRequestType(l.method),l.registrationMethod=n.method})(i||(t.SemanticTokensRequest=i={}));var a;(function(l){l.method="textDocument/semanticTokens/full/delta",l.messageDirection=e.MessageDirection.clientToServer,l.type=new e.ProtocolRequestType(l.method),l.registrationMethod=n.method})(a||(t.SemanticTokensDeltaRequest=a={}));var s;(function(l){l.method="textDocument/semanticTokens/range",l.messageDirection=e.MessageDirection.clientToServer,l.type=new e.ProtocolRequestType(l.method),l.registrationMethod=n.method})(s||(t.SemanticTokensRangeRequest=s={}));var o;(function(l){l.method="workspace/semanticTokens/refresh",l.messageDirection=e.MessageDirection.serverToClient,l.type=new e.ProtocolRequestType0(l.method)})(o||(t.SemanticTokensRefreshRequest=o={}))}}),OUe=Dr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.showDocument.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ShowDocumentRequest=void 0;var e=Zn(),r;(function(n){n.method="window/showDocument",n.messageDirection=e.MessageDirection.serverToClient,n.type=new e.ProtocolRequestType(n.method)})(r||(t.ShowDocumentRequest=r={}))}}),$Ue=Dr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.linkedEditingRange.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.LinkedEditingRangeRequest=void 0;var e=Zn(),r;(function(n){n.method="textDocument/linkedEditingRange",n.messageDirection=e.MessageDirection.clientToServer,n.type=new e.ProtocolRequestType(n.method)})(r||(t.LinkedEditingRangeRequest=r={}))}}),PUe=Dr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.fileOperations.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.WillDeleteFilesRequest=t.DidDeleteFilesNotification=t.DidRenameFilesNotification=t.WillRenameFilesRequest=t.DidCreateFilesNotification=t.WillCreateFilesRequest=t.FileOperationPatternKind=void 0;var e=Zn(),r;(function(u){u.file="file",u.folder="folder"})(r||(t.FileOperationPatternKind=r={}));var n;(function(u){u.method="workspace/willCreateFiles",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolRequestType(u.method)})(n||(t.WillCreateFilesRequest=n={}));var i;(function(u){u.method="workspace/didCreateFiles",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolNotificationType(u.method)})(i||(t.DidCreateFilesNotification=i={}));var a;(function(u){u.method="workspace/willRenameFiles",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolRequestType(u.method)})(a||(t.WillRenameFilesRequest=a={}));var s;(function(u){u.method="workspace/didRenameFiles",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolNotificationType(u.method)})(s||(t.DidRenameFilesNotification=s={}));var o;(function(u){u.method="workspace/didDeleteFiles",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolNotificationType(u.method)})(o||(t.DidDeleteFilesNotification=o={}));var l;(function(u){u.method="workspace/willDeleteFiles",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolRequestType(u.method)})(l||(t.WillDeleteFilesRequest=l={}))}}),BUe=Dr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.moniker.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.MonikerRequest=t.MonikerKind=t.UniquenessLevel=void 0;var e=Zn(),r;(function(a){a.document="document",a.project="project",a.group="group",a.scheme="scheme",a.global="global"})(r||(t.UniquenessLevel=r={}));var n;(function(a){a.$import="import",a.$export="export",a.local="local"})(n||(t.MonikerKind=n={}));var i;(function(a){a.method="textDocument/moniker",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(i||(t.MonikerRequest=i={}))}}),FUe=Dr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.typeHierarchy.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.TypeHierarchySubtypesRequest=t.TypeHierarchySupertypesRequest=t.TypeHierarchyPrepareRequest=void 0;var e=Zn(),r;(function(a){a.method="textDocument/prepareTypeHierarchy",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(r||(t.TypeHierarchyPrepareRequest=r={}));var n;(function(a){a.method="typeHierarchy/supertypes",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(n||(t.TypeHierarchySupertypesRequest=n={}));var i;(function(a){a.method="typeHierarchy/subtypes",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(i||(t.TypeHierarchySubtypesRequest=i={}))}}),zUe=Dr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.inlineValue.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.InlineValueRefreshRequest=t.InlineValueRequest=void 0;var e=Zn(),r;(function(i){i.method="textDocument/inlineValue",i.messageDirection=e.MessageDirection.clientToServer,i.type=new e.ProtocolRequestType(i.method)})(r||(t.InlineValueRequest=r={}));var n;(function(i){i.method="workspace/inlineValue/refresh",i.messageDirection=e.MessageDirection.serverToClient,i.type=new e.ProtocolRequestType0(i.method)})(n||(t.InlineValueRefreshRequest=n={}))}}),GUe=Dr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.inlayHint.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.InlayHintRefreshRequest=t.InlayHintResolveRequest=t.InlayHintRequest=void 0;var e=Zn(),r;(function(a){a.method="textDocument/inlayHint",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(r||(t.InlayHintRequest=r={}));var n;(function(a){a.method="inlayHint/resolve",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(n||(t.InlayHintResolveRequest=n={}));var i;(function(a){a.method="workspace/inlayHint/refresh",a.messageDirection=e.MessageDirection.serverToClient,a.type=new e.ProtocolRequestType0(a.method)})(i||(t.InlayHintRefreshRequest=i={}))}}),qUe=Dr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.diagnostic.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.DiagnosticRefreshRequest=t.WorkspaceDiagnosticRequest=t.DocumentDiagnosticRequest=t.DocumentDiagnosticReportKind=t.DiagnosticServerCancellationData=void 0;var e=eg(),r=R9(),n=Zn(),i;(function(u){function h(d){const f=d;return f&&r.boolean(f.retriggerRequest)}E(h,"is"),u.is=h})(i||(t.DiagnosticServerCancellationData=i={}));var a;(function(u){u.Full="full",u.Unchanged="unchanged"})(a||(t.DocumentDiagnosticReportKind=a={}));var s;(function(u){u.method="textDocument/diagnostic",u.messageDirection=n.MessageDirection.clientToServer,u.type=new n.ProtocolRequestType(u.method),u.partialResult=new e.ProgressType})(s||(t.DocumentDiagnosticRequest=s={}));var o;(function(u){u.method="workspace/diagnostic",u.messageDirection=n.MessageDirection.clientToServer,u.type=new n.ProtocolRequestType(u.method),u.partialResult=new e.ProgressType})(o||(t.WorkspaceDiagnosticRequest=o={}));var l;(function(u){u.method="workspace/diagnostic/refresh",u.messageDirection=n.MessageDirection.serverToClient,u.type=new n.ProtocolRequestType0(u.method)})(l||(t.DiagnosticRefreshRequest=l={}))}}),VUe=Dr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.notebook.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.DidCloseNotebookDocumentNotification=t.DidSaveNotebookDocumentNotification=t.DidChangeNotebookDocumentNotification=t.NotebookCellArrayChange=t.DidOpenNotebookDocumentNotification=t.NotebookDocumentSyncRegistrationType=t.NotebookDocument=t.NotebookCell=t.ExecutionSummary=t.NotebookCellKind=void 0;var e=(kx(),SI(w3)),r=R9(),n=Zn(),i;(function(g){g.Markup=1,g.Code=2;function m(y){return y===1||y===2}E(m,"is"),g.is=m})(i||(t.NotebookCellKind=i={}));var a;(function(g){function m(T,b){const w={executionOrder:T};return(b===!0||b===!1)&&(w.success=b),w}E(m,"create"),g.create=m;function y(T){const b=T;return r.objectLiteral(b)&&e.uinteger.is(b.executionOrder)&&(b.success===void 0||r.boolean(b.success))}E(y,"is"),g.is=y;function v(T,b){return T===b?!0:T==null||b===null||b===void 0?!1:T.executionOrder===b.executionOrder&&T.success===b.success}E(v,"equals"),g.equals=v})(a||(t.ExecutionSummary=a={}));var s;(function(g){function m(b,w){return{kind:b,document:w}}E(m,"create"),g.create=m;function y(b){const w=b;return r.objectLiteral(w)&&i.is(w.kind)&&e.DocumentUri.is(w.document)&&(w.metadata===void 0||r.objectLiteral(w.metadata))}E(y,"is"),g.is=y;function v(b,w){const k=new Set;return b.document!==w.document&&k.add("document"),b.kind!==w.kind&&k.add("kind"),b.executionSummary!==w.executionSummary&&k.add("executionSummary"),(b.metadata!==void 0||w.metadata!==void 0)&&!T(b.metadata,w.metadata)&&k.add("metadata"),(b.executionSummary!==void 0||w.executionSummary!==void 0)&&!a.equals(b.executionSummary,w.executionSummary)&&k.add("executionSummary"),k}E(v,"diff"),g.diff=v;function T(b,w){if(b===w)return!0;if(b==null||w===null||w===void 0||typeof b!=typeof w||typeof b!="object")return!1;const k=Array.isArray(b),A=Array.isArray(w);if(k!==A)return!1;if(k&&A){if(b.length!==w.length)return!1;for(let C=0;C0}E(At,"hasId"),oe.hasId=At})(I||(t.StaticRegistrationOptions=I={}));var $;(function(oe){function At(dt){const ut=dt;return ut&&(ut.documentSelector===null||z.is(ut.documentSelector))}E(At,"is"),oe.is=At})($||(t.TextDocumentRegistrationOptions=$={}));var B;(function(oe){function At(ut){const wt=ut;return n.objectLiteral(wt)&&(wt.workDoneProgress===void 0||n.boolean(wt.workDoneProgress))}E(At,"is"),oe.is=At;function dt(ut){const wt=ut;return wt&&n.boolean(wt.workDoneProgress)}E(dt,"hasWorkDoneProgress"),oe.hasWorkDoneProgress=dt})(B||(t.WorkDoneProgressOptions=B={}));var P;(function(oe){oe.method="initialize",oe.messageDirection=e.MessageDirection.clientToServer,oe.type=new e.ProtocolRequestType(oe.method)})(P||(t.InitializeRequest=P={}));var G;(function(oe){oe.unknownProtocolVersion=1})(G||(t.InitializeErrorCodes=G={}));var V;(function(oe){oe.method="initialized",oe.messageDirection=e.MessageDirection.clientToServer,oe.type=new e.ProtocolNotificationType(oe.method)})(V||(t.InitializedNotification=V={}));var Y;(function(oe){oe.method="shutdown",oe.messageDirection=e.MessageDirection.clientToServer,oe.type=new e.ProtocolRequestType0(oe.method)})(Y||(t.ShutdownRequest=Y={}));var W;(function(oe){oe.method="exit",oe.messageDirection=e.MessageDirection.clientToServer,oe.type=new e.ProtocolNotificationType0(oe.method)})(W||(t.ExitNotification=W={}));var ie;(function(oe){oe.method="workspace/didChangeConfiguration",oe.messageDirection=e.MessageDirection.clientToServer,oe.type=new e.ProtocolNotificationType(oe.method)})(ie||(t.DidChangeConfigurationNotification=ie={}));var K;(function(oe){oe.Error=1,oe.Warning=2,oe.Info=3,oe.Log=4,oe.Debug=5})(K||(t.MessageType=K={}));var se;(function(oe){oe.method="window/showMessage",oe.messageDirection=e.MessageDirection.serverToClient,oe.type=new e.ProtocolNotificationType(oe.method)})(se||(t.ShowMessageNotification=se={}));var J;(function(oe){oe.method="window/showMessageRequest",oe.messageDirection=e.MessageDirection.serverToClient,oe.type=new e.ProtocolRequestType(oe.method)})(J||(t.ShowMessageRequest=J={}));var Z;(function(oe){oe.method="window/logMessage",oe.messageDirection=e.MessageDirection.serverToClient,oe.type=new e.ProtocolNotificationType(oe.method)})(Z||(t.LogMessageNotification=Z={}));var ee;(function(oe){oe.method="telemetry/event",oe.messageDirection=e.MessageDirection.serverToClient,oe.type=new e.ProtocolNotificationType(oe.method)})(ee||(t.TelemetryEventNotification=ee={}));var ne;(function(oe){oe.None=0,oe.Full=1,oe.Incremental=2})(ne||(t.TextDocumentSyncKind=ne={}));var ue;(function(oe){oe.method="textDocument/didOpen",oe.messageDirection=e.MessageDirection.clientToServer,oe.type=new e.ProtocolNotificationType(oe.method)})(ue||(t.DidOpenTextDocumentNotification=ue={}));var fe;(function(oe){function At(ut){let wt=ut;return wt!=null&&typeof wt.text=="string"&&wt.range!==void 0&&(wt.rangeLength===void 0||typeof wt.rangeLength=="number")}E(At,"isIncremental"),oe.isIncremental=At;function dt(ut){let wt=ut;return wt!=null&&typeof wt.text=="string"&&wt.range===void 0&&wt.rangeLength===void 0}E(dt,"isFull"),oe.isFull=dt})(fe||(t.TextDocumentContentChangeEvent=fe={}));var _e;(function(oe){oe.method="textDocument/didChange",oe.messageDirection=e.MessageDirection.clientToServer,oe.type=new e.ProtocolNotificationType(oe.method)})(_e||(t.DidChangeTextDocumentNotification=_e={}));var Ae;(function(oe){oe.method="textDocument/didClose",oe.messageDirection=e.MessageDirection.clientToServer,oe.type=new e.ProtocolNotificationType(oe.method)})(Ae||(t.DidCloseTextDocumentNotification=Ae={}));var Ne;(function(oe){oe.method="textDocument/didSave",oe.messageDirection=e.MessageDirection.clientToServer,oe.type=new e.ProtocolNotificationType(oe.method)})(Ne||(t.DidSaveTextDocumentNotification=Ne={}));var me;(function(oe){oe.Manual=1,oe.AfterDelay=2,oe.FocusOut=3})(me||(t.TextDocumentSaveReason=me={}));var ve;(function(oe){oe.method="textDocument/willSave",oe.messageDirection=e.MessageDirection.clientToServer,oe.type=new e.ProtocolNotificationType(oe.method)})(ve||(t.WillSaveTextDocumentNotification=ve={}));var Ge;(function(oe){oe.method="textDocument/willSaveWaitUntil",oe.messageDirection=e.MessageDirection.clientToServer,oe.type=new e.ProtocolRequestType(oe.method)})(Ge||(t.WillSaveTextDocumentWaitUntilRequest=Ge={}));var Te;(function(oe){oe.method="workspace/didChangeWatchedFiles",oe.messageDirection=e.MessageDirection.clientToServer,oe.type=new e.ProtocolNotificationType(oe.method)})(Te||(t.DidChangeWatchedFilesNotification=Te={}));var Ze;(function(oe){oe.Created=1,oe.Changed=2,oe.Deleted=3})(Ze||(t.FileChangeType=Ze={}));var ke;(function(oe){function At(dt){const ut=dt;return n.objectLiteral(ut)&&(r.URI.is(ut.baseUri)||r.WorkspaceFolder.is(ut.baseUri))&&n.string(ut.pattern)}E(At,"is"),oe.is=At})(ke||(t.RelativePattern=ke={}));var Ve;(function(oe){oe.Create=1,oe.Change=2,oe.Delete=4})(Ve||(t.WatchKind=Ve={}));var Qe;(function(oe){oe.method="textDocument/publishDiagnostics",oe.messageDirection=e.MessageDirection.serverToClient,oe.type=new e.ProtocolNotificationType(oe.method)})(Qe||(t.PublishDiagnosticsNotification=Qe={}));var nt;(function(oe){oe.Invoked=1,oe.TriggerCharacter=2,oe.TriggerForIncompleteCompletions=3})(nt||(t.CompletionTriggerKind=nt={}));var tt;(function(oe){oe.method="textDocument/completion",oe.messageDirection=e.MessageDirection.clientToServer,oe.type=new e.ProtocolRequestType(oe.method)})(tt||(t.CompletionRequest=tt={}));var je;(function(oe){oe.method="completionItem/resolve",oe.messageDirection=e.MessageDirection.clientToServer,oe.type=new e.ProtocolRequestType(oe.method)})(je||(t.CompletionResolveRequest=je={}));var Ce;(function(oe){oe.method="textDocument/hover",oe.messageDirection=e.MessageDirection.clientToServer,oe.type=new e.ProtocolRequestType(oe.method)})(Ce||(t.HoverRequest=Ce={}));var Se;(function(oe){oe.Invoked=1,oe.TriggerCharacter=2,oe.ContentChange=3})(Se||(t.SignatureHelpTriggerKind=Se={}));var H;(function(oe){oe.method="textDocument/signatureHelp",oe.messageDirection=e.MessageDirection.clientToServer,oe.type=new e.ProtocolRequestType(oe.method)})(H||(t.SignatureHelpRequest=H={}));var he;(function(oe){oe.method="textDocument/definition",oe.messageDirection=e.MessageDirection.clientToServer,oe.type=new e.ProtocolRequestType(oe.method)})(he||(t.DefinitionRequest=he={}));var j;(function(oe){oe.method="textDocument/references",oe.messageDirection=e.MessageDirection.clientToServer,oe.type=new e.ProtocolRequestType(oe.method)})(j||(t.ReferencesRequest=j={}));var pe;(function(oe){oe.method="textDocument/documentHighlight",oe.messageDirection=e.MessageDirection.clientToServer,oe.type=new e.ProtocolRequestType(oe.method)})(pe||(t.DocumentHighlightRequest=pe={}));var re;(function(oe){oe.method="textDocument/documentSymbol",oe.messageDirection=e.MessageDirection.clientToServer,oe.type=new e.ProtocolRequestType(oe.method)})(re||(t.DocumentSymbolRequest=re={}));var Be;(function(oe){oe.method="textDocument/codeAction",oe.messageDirection=e.MessageDirection.clientToServer,oe.type=new e.ProtocolRequestType(oe.method)})(Be||(t.CodeActionRequest=Be={}));var xe;(function(oe){oe.method="codeAction/resolve",oe.messageDirection=e.MessageDirection.clientToServer,oe.type=new e.ProtocolRequestType(oe.method)})(xe||(t.CodeActionResolveRequest=xe={}));var Ue;(function(oe){oe.method="workspace/symbol",oe.messageDirection=e.MessageDirection.clientToServer,oe.type=new e.ProtocolRequestType(oe.method)})(Ue||(t.WorkspaceSymbolRequest=Ue={}));var De;(function(oe){oe.method="workspaceSymbol/resolve",oe.messageDirection=e.MessageDirection.clientToServer,oe.type=new e.ProtocolRequestType(oe.method)})(De||(t.WorkspaceSymbolResolveRequest=De={}));var qe;(function(oe){oe.method="textDocument/codeLens",oe.messageDirection=e.MessageDirection.clientToServer,oe.type=new e.ProtocolRequestType(oe.method)})(qe||(t.CodeLensRequest=qe={}));var Le;(function(oe){oe.method="codeLens/resolve",oe.messageDirection=e.MessageDirection.clientToServer,oe.type=new e.ProtocolRequestType(oe.method)})(Le||(t.CodeLensResolveRequest=Le={}));var Xe;(function(oe){oe.method="workspace/codeLens/refresh",oe.messageDirection=e.MessageDirection.serverToClient,oe.type=new e.ProtocolRequestType0(oe.method)})(Xe||(t.CodeLensRefreshRequest=Xe={}));var Ie;(function(oe){oe.method="textDocument/documentLink",oe.messageDirection=e.MessageDirection.clientToServer,oe.type=new e.ProtocolRequestType(oe.method)})(Ie||(t.DocumentLinkRequest=Ie={}));var it;(function(oe){oe.method="documentLink/resolve",oe.messageDirection=e.MessageDirection.clientToServer,oe.type=new e.ProtocolRequestType(oe.method)})(it||(t.DocumentLinkResolveRequest=it={}));var we;(function(oe){oe.method="textDocument/formatting",oe.messageDirection=e.MessageDirection.clientToServer,oe.type=new e.ProtocolRequestType(oe.method)})(we||(t.DocumentFormattingRequest=we={}));var lt;(function(oe){oe.method="textDocument/rangeFormatting",oe.messageDirection=e.MessageDirection.clientToServer,oe.type=new e.ProtocolRequestType(oe.method)})(lt||(t.DocumentRangeFormattingRequest=lt={}));var be;(function(oe){oe.method="textDocument/rangesFormatting",oe.messageDirection=e.MessageDirection.clientToServer,oe.type=new e.ProtocolRequestType(oe.method)})(be||(t.DocumentRangesFormattingRequest=be={}));var Et;(function(oe){oe.method="textDocument/onTypeFormatting",oe.messageDirection=e.MessageDirection.clientToServer,oe.type=new e.ProtocolRequestType(oe.method)})(Et||(t.DocumentOnTypeFormattingRequest=Et={}));var vt;(function(oe){oe.Identifier=1})(vt||(t.PrepareSupportDefaultBehavior=vt={}));var ot;(function(oe){oe.method="textDocument/rename",oe.messageDirection=e.MessageDirection.clientToServer,oe.type=new e.ProtocolRequestType(oe.method)})(ot||(t.RenameRequest=ot={}));var It;(function(oe){oe.method="textDocument/prepareRename",oe.messageDirection=e.MessageDirection.clientToServer,oe.type=new e.ProtocolRequestType(oe.method)})(It||(t.PrepareRenameRequest=It={}));var xt;(function(oe){oe.method="workspace/executeCommand",oe.messageDirection=e.MessageDirection.clientToServer,oe.type=new e.ProtocolRequestType(oe.method)})(xt||(t.ExecuteCommandRequest=xt={}));var ht;(function(oe){oe.method="workspace/applyEdit",oe.messageDirection=e.MessageDirection.serverToClient,oe.type=new e.ProtocolRequestType("workspace/applyEdit")})(ht||(t.ApplyWorkspaceEditRequest=ht={}))}}),HUe=Dr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/connection.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.createProtocolConnection=void 0;var e=eg();function r(n,i,a,s){return e.ConnectionStrategy.is(s)&&(s={connectionStrategy:s}),(0,e.createMessageConnection)(n,i,a,s)}E(r,"createProtocolConnection"),t.createProtocolConnection=r}}),YUe=Dr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/api.js"(t){var e=t&&t.__createBinding||(Object.create?(function(a,s,o,l){l===void 0&&(l=o);var u=Object.getOwnPropertyDescriptor(s,o);(!u||("get"in u?!s.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:E(function(){return s[o]},"get")}),Object.defineProperty(a,l,u)}):(function(a,s,o,l){l===void 0&&(l=o),a[l]=s[o]})),r=t&&t.__exportStar||function(a,s){for(var o in a)o!=="default"&&!Object.prototype.hasOwnProperty.call(s,o)&&e(s,a,o)};Object.defineProperty(t,"__esModule",{value:!0}),t.LSPErrorCodes=t.createProtocolConnection=void 0,r(eg(),t),r((kx(),SI(w3)),t),r(Zn(),t),r(UUe(),t);var n=HUe();Object.defineProperty(t,"createProtocolConnection",{enumerable:!0,get:E(function(){return n.createProtocolConnection},"get")});var i;(function(a){a.lspReservedErrorRangeStart=-32899,a.RequestFailed=-32803,a.ServerCancelled=-32802,a.ContentModified=-32801,a.RequestCancelled=-32800,a.lspReservedErrorRangeEnd=-32800})(i||(t.LSPErrorCodes=i={}))}}),XUe=Dr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/browser/main.js"(t){var e=t&&t.__createBinding||(Object.create?(function(a,s,o,l){l===void 0&&(l=o);var u=Object.getOwnPropertyDescriptor(s,o);(!u||("get"in u?!s.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:E(function(){return s[o]},"get")}),Object.defineProperty(a,l,u)}):(function(a,s,o,l){l===void 0&&(l=o),a[l]=s[o]})),r=t&&t.__exportStar||function(a,s){for(var o in a)o!=="default"&&!Object.prototype.hasOwnProperty.call(s,o)&&e(s,a,o)};Object.defineProperty(t,"__esModule",{value:!0}),t.createProtocolConnection=void 0;var n=Gte();r(Gte(),t),r(YUe(),t);function i(a,s,o,l){return(0,n.createMessageConnection)(a,s,o,l)}E(i,"createProtocolConnection"),t.createProtocolConnection=i}}),qte={};fh(qte,{AbstractAstReflection:()=>D9,AbstractCstNode:()=>mN,AbstractLangiumParser:()=>vN,AbstractParserErrorMessageProvider:()=>Kde,AbstractThreadedAsyncParser:()=>xnt,AstUtils:()=>M9,BiMap:()=>DE,Cancellation:()=>_n,CompositeCstNodeImpl:()=>xE,ContextCache:()=>NE,CstNodeBuilder:()=>Ude,CstUtils:()=>L9,DEFAULT_TOKENIZE_OPTIONS:()=>FN,DONE_RESULT:()=>ts,DatatypeSymbol:()=>TE,DefaultAstNodeDescriptionProvider:()=>Sfe,DefaultAstNodeLocator:()=>_fe,DefaultAsyncParser:()=>Xfe,DefaultCommentProvider:()=>Yfe,DefaultConfigurationProvider:()=>Rfe,DefaultDocumentBuilder:()=>Lfe,DefaultDocumentValidator:()=>Efe,DefaultHydrator:()=>jfe,DefaultIndexManager:()=>Ife,DefaultJsonSerializer:()=>Tfe,DefaultLangiumDocumentFactory:()=>dfe,DefaultLangiumDocuments:()=>ffe,DefaultLangiumProfiler:()=>Ent,DefaultLexer:()=>zN,DefaultLexerErrorMessageProvider:()=>Mfe,DefaultLinker:()=>pfe,DefaultNameProvider:()=>gfe,DefaultReferenceDescriptionProvider:()=>Afe,DefaultReferences:()=>mfe,DefaultScopeComputation:()=>yfe,DefaultScopeProvider:()=>xfe,DefaultServiceRegistry:()=>wfe,DefaultTokenBuilder:()=>SE,DefaultValueConverter:()=>EN,DefaultWorkspaceLock:()=>Kfe,DefaultWorkspaceManager:()=>Dfe,Deferred:()=>au,Disposable:()=>Ff,DisposableCache:()=>ME,DocumentCache:()=>bfe,DocumentState:()=>zr,DocumentValidator:()=>wo,EMPTY_SCOPE:()=>mnt,EMPTY_STREAM:()=>tg,EmptyFileSystem:()=>ba,EmptyFileSystemProvider:()=>e0e,ErrorWithLocation:()=>rk,GrammarAST:()=>Ute,GrammarUtils:()=>uD,IndentationAwareLexer:()=>wnt,IndentationAwareTokenBuilder:()=>Jfe,JSDocDocumentationProvider:()=>Hfe,LangiumCompletionParser:()=>jde,LangiumParser:()=>Xde,LangiumParserErrorMessageProvider:()=>bN,LeafCstNodeImpl:()=>bE,LexingMode:()=>zf,MapScope:()=>gnt,Module:()=>jN,MultiMap:()=>su,MultiMapScope:()=>vfe,OperationCancelled:()=>Jl,ParserWorker:()=>Tnt,ProfilingTask:()=>r0e,Reduction:()=>Ax,RefResolving:()=>Pf,RegExpUtils:()=>dD,RootCstNodeImpl:()=>yN,SimpleCache:()=>MN,StreamImpl:()=>Vl,StreamScope:()=>DN,TextDocument:()=>LE,TreeStreamImpl:()=>rg,URI:()=>eo,UriTrie:()=>LN,UriUtils:()=>ls,VALIDATE_EACH_NODE:()=>kfe,ValidationCategory:()=>OE,ValidationRegistry:()=>Cfe,ValueConverter:()=>Ql,WorkspaceCache:()=>NN,assertCondition:()=>hD,assertUnreachable:()=>xh,createCompletionParser:()=>wN,createDefaultCoreModule:()=>na,createDefaultSharedCoreModule:()=>ia,createGrammarConfig:()=>ID,createLangiumParser:()=>CN,createParser:()=>CE,delayNextTick:()=>AE,diagnosticData:()=>Bf,eagerLoad:()=>ZN,getDiagnosticRange:()=>PN,indentationBuilderDefaultOptions:()=>eO,inject:()=>Xr,interruptAndCheck:()=>ra,isAstNode:()=>Ii,isAstNodeDescription:()=>I9,isAstNodeWithComment:()=>ON,isCompositeCstNode:()=>Wc,isIMultiModeLexerDefinition:()=>FE,isJSDoc:()=>qN,isLeafCstNode:()=>Kd,isLinkingError:()=>Xd,isMultiReference:()=>ql,isNamed:()=>IN,isOperationCancelled:()=>$f,isReference:()=>es,isRootCstNode:()=>I3,isTokenTypeArray:()=>BE,isTokenTypeDictionary:()=>zE,loadGrammarFromJson:()=>aa,parseJSDoc:()=>GN,prepareLangiumParser:()=>kN,setInterruptionPeriod:()=>SN,startCancelableOperation:()=>RE,stream:()=>pn,toDiagnosticData:()=>BN,toDiagnosticSeverity:()=>RT});var L9={};fh(L9,{DefaultNameRegexp:()=>iD,RangeComparison:()=>Ul,compareRange:()=>rD,findCommentNode:()=>aD,findDeclarationNodeAtOffset:()=>ure,findLeafNodeAtOffset:()=>tk,findLeafNodeBeforeOffset:()=>sD,flattenCst:()=>cre,getDatatypeNode:()=>lre,getInteriorNodes:()=>fre,getNextNode:()=>hre,getPreviousNode:()=>lD,getStartlineNode:()=>dre,inRange:()=>nD,isChildNode:()=>tD,isCommentNode:()=>ek,streamCst:()=>pg,toDocumentSegment:()=>gg,tokenToRange:()=>Bx});function Ii(t){return typeof t=="object"&&t!==null&&typeof t.$type=="string"}E(Ii,"isAstNode");function es(t){return typeof t=="object"&&t!==null&&typeof t.$refText=="string"&&"ref"in t}E(es,"isReference");function ql(t){return typeof t=="object"&&t!==null&&typeof t.$refText=="string"&&"items"in t}E(ql,"isMultiReference");function I9(t){return typeof t=="object"&&t!==null&&typeof t.name=="string"&&typeof t.type=="string"&&typeof t.path=="string"}E(I9,"isAstNodeDescription");function Xd(t){return typeof t=="object"&&t!==null&&typeof t.info=="object"&&typeof t.message=="string"}E(Xd,"isLinkingError");var D9=(Nm=class{constructor(){this.subtypes={},this.allSubtypes={}}getAllTypes(){return Object.keys(this.types)}getReferenceType(e){var i;const r=this.types[e.container.$type];if(!r)throw new Error(`Type ${e.container.$type||"undefined"} not found.`);const n=(i=r.properties[e.property])==null?void 0:i.referenceType;if(!n)throw new Error(`Property ${e.property||"undefined"} of type ${e.container.$type} is not a reference.`);return n}getTypeMetaData(e){const r=this.types[e];return r||{name:e,properties:{},superTypes:[]}}isInstance(e,r){return Ii(e)&&this.isSubtype(e.$type,r)}isSubtype(e,r){if(e===r)return!0;let n=this.subtypes[e];n||(n=this.subtypes[e]={});const i=n[r];if(i!==void 0)return i;{const a=this.types[e],s=a?a.superTypes.some(o=>this.isSubtype(o,r)):!1;return n[r]=s,s}}getAllSubTypes(e){const r=this.allSubtypes[e];if(r)return r;{const n=this.getAllTypes(),i=[];for(const a of n)this.isSubtype(a,e)&&i.push(a);return this.allSubtypes[e]=i,i}}},E(Nm,"AbstractAstReflection"),Nm);function Wc(t){return typeof t=="object"&&t!==null&&Array.isArray(t.content)}E(Wc,"isCompositeCstNode");function Kd(t){return typeof t=="object"&&t!==null&&typeof t.tokenType=="object"}E(Kd,"isLeafCstNode");function I3(t){return Wc(t)&&typeof t.fullText=="string"}E(I3,"isRootCstNode");var Vl=(Ns=class{constructor(e,r){this.startFn=e,this.nextFn=r}iterator(){const e={state:this.startFn(),next:E(()=>this.nextFn(e.state),"next"),[Symbol.iterator]:()=>e};return e}[Symbol.iterator](){return this.iterator()}isEmpty(){return!!this.iterator().next().done}count(){const e=this.iterator();let r=0,n=e.next();for(;!n.done;)r++,n=e.next();return r}toArray(){const e=[],r=this.iterator();let n;do n=r.next(),n.value!==void 0&&e.push(n.value);while(!n.done);return e}toSet(){return new Set(this)}toMap(e,r){const n=this.map(i=>[e?e(i):i,r?r(i):i]);return new Map(n)}toString(){return this.join()}concat(e){return new Ns(()=>({first:this.startFn(),firstDone:!1,iterator:e[Symbol.iterator]()}),r=>{let n;if(!r.firstDone){do if(n=this.nextFn(r.first),!n.done)return n;while(!n.done);r.firstDone=!0}do if(n=r.iterator.next(),!n.done)return n;while(!n.done);return ts})}join(e=","){const r=this.iterator();let n="",i,a=!1;do i=r.next(),i.done||(a&&(n+=e),n+=Vte(i.value)),a=!0;while(!i.done);return n}indexOf(e,r=0){const n=this.iterator();let i=0,a=n.next();for(;!a.done;){if(i>=r&&a.value===e)return i;a=n.next(),i++}return-1}every(e){const r=this.iterator();let n=r.next();for(;!n.done;){if(!e(n.value))return!1;n=r.next()}return!0}some(e){const r=this.iterator();let n=r.next();for(;!n.done;){if(e(n.value))return!0;n=r.next()}return!1}forEach(e){const r=this.iterator();let n=0,i=r.next();for(;!i.done;)e(i.value,n),i=r.next(),n++}map(e){return new Ns(this.startFn,r=>{const{done:n,value:i}=this.nextFn(r);return n?ts:{done:!1,value:e(i)}})}filter(e){return new Ns(this.startFn,r=>{let n;do if(n=this.nextFn(r),!n.done&&e(n.value))return n;while(!n.done);return ts})}nonNullable(){return this.filter(e=>e!=null)}reduce(e,r){const n=this.iterator();let i=r,a=n.next();for(;!a.done;)i===void 0?i=a.value:i=e(i,a.value),a=n.next();return i}reduceRight(e,r){return this.recursiveReduce(this.iterator(),e,r)}recursiveReduce(e,r,n){const i=e.next();if(i.done)return n;const a=this.recursiveReduce(e,r,n);return a===void 0?i.value:r(a,i.value)}find(e){const r=this.iterator();let n=r.next();for(;!n.done;){if(e(n.value))return n.value;n=r.next()}}findIndex(e){const r=this.iterator();let n=0,i=r.next();for(;!i.done;){if(e(i.value))return n;i=r.next(),n++}return-1}includes(e){const r=this.iterator();let n=r.next();for(;!n.done;){if(n.value===e)return!0;n=r.next()}return!1}flatMap(e){return new Ns(()=>({this:this.startFn()}),r=>{do{if(r.iterator){const a=r.iterator.next();if(a.done)r.iterator=void 0;else return a}const{done:n,value:i}=this.nextFn(r.this);if(!n){const a=e(i);if(Sx(a))r.iterator=a[Symbol.iterator]();else return{done:!1,value:a}}}while(r.iterator);return ts})}flat(e){if(e===void 0&&(e=1),e<=0)return this;const r=e>1?this.flat(e-1):this;return new Ns(()=>({this:r.startFn()}),n=>{do{if(n.iterator){const s=n.iterator.next();if(s.done)n.iterator=void 0;else return s}const{done:i,value:a}=r.nextFn(n.this);if(!i)if(Sx(a))n.iterator=a[Symbol.iterator]();else return{done:!1,value:a}}while(n.iterator);return ts})}head(){const r=this.iterator().next();if(!r.done)return r.value}tail(e=1){return new Ns(()=>{const r=this.startFn();for(let n=0;n({size:0,state:this.startFn()}),r=>(r.size++,r.size>e?ts:this.nextFn(r.state)))}distinct(e){return new Ns(()=>({set:new Set,internalState:this.startFn()}),r=>{let n;do if(n=this.nextFn(r.internalState),!n.done){const i=e?e(n.value):n.value;if(!r.set.has(i))return r.set.add(i),n}while(!n.done);return ts})}exclude(e,r){const n=new Set;for(const i of e){const a=r?r(i):i;n.add(a)}return this.filter(i=>{const a=r?r(i):i;return!n.has(a)})}},E(Ns,"StreamImpl"),Ns);function Vte(t){return typeof t=="string"?t:typeof t>"u"?"undefined":typeof t.toString=="function"?t.toString():Object.prototype.toString.call(t)}E(Vte,"toString");function Sx(t){return!!t&&typeof t[Symbol.iterator]=="function"}E(Sx,"isIterable");var tg=new Vl(()=>{},()=>ts),ts=Object.freeze({done:!0,value:void 0});function pn(...t){if(t.length===1){const e=t[0];if(e instanceof Vl)return e;if(Sx(e))return new Vl(()=>e[Symbol.iterator](),r=>r.next());if(typeof e.length=="number")return new Vl(()=>({index:0}),r=>r.index1?new Vl(()=>({collIndex:0,arrIndex:0}),e=>{do{if(e.iterator){const r=e.iterator.next();if(!r.done)return r;e.iterator=void 0}if(e.array){if(e.arrIndex({iterators:n!=null&&n.includeRoot?[[e][Symbol.iterator]()]:[r(e)[Symbol.iterator]()],pruned:!1}),i=>{for(i.pruned&&(i.iterators.pop(),i.pruned=!1);i.iterators.length>0;){const s=i.iterators[i.iterators.length-1].next();if(s.done)i.iterators.pop();else return i.iterators.push(r(s.value)[Symbol.iterator]()),s}return ts})}iterator(){const e={state:this.startFn(),next:E(()=>this.nextFn(e.state),"next"),prune:E(()=>{e.state.pruned=!0},"prune"),[Symbol.iterator]:()=>e};return e}},E(Om,"TreeStreamImpl"),Om),Ax;(function(t){function e(a){return a.reduce((s,o)=>s+o,0)}E(e,"sum"),t.sum=e;function r(a){return a.reduce((s,o)=>s*o,0)}E(r,"product"),t.product=r;function n(a){return a.reduce((s,o)=>Math.min(s,o))}E(n,"min"),t.min=n;function i(a){return a.reduce((s,o)=>Math.max(s,o))}E(i,"max"),t.max=i})(Ax||(Ax={}));var M9={};fh(M9,{assignMandatoryProperties:()=>N9,copyAstNode:()=>N3,findRootNode:()=>ig,getContainerOfType:()=>jd,getDocument:()=>qo,getReferenceNodes:()=>D3,hasContainerOfType:()=>Wte,linkContentToContainer:()=>ng,streamAllContents:()=>Uc,streamAst:()=>Vo,streamContents:()=>_x,streamReferences:()=>ag});function ng(t,e={}){for(const[r,n]of Object.entries(t))r.startsWith("$")||(Array.isArray(n)?n.forEach((i,a)=>{Ii(i)&&(i.$container=t,i.$containerProperty=r,i.$containerIndex=a,e.deep&&ng(i,e))}):Ii(n)&&(n.$container=t,n.$containerProperty=r,e.deep&&ng(n,e)))}E(ng,"linkContentToContainer");function jd(t,e){let r=t;for(;r;){if(e(r))return r;r=r.$container}}E(jd,"getContainerOfType");function Wte(t,e){let r=t;for(;r;){if(e(r))return!0;r=r.$container}return!1}E(Wte,"hasContainerOfType");function qo(t){const r=ig(t).$document;if(!r)throw new Error("AST node has no document.");return r}E(qo,"getDocument");function ig(t){for(;t.$container;)t=t.$container;return t}E(ig,"findRootNode");function D3(t){return es(t)?t.ref?[t.ref]:[]:ql(t)?t.items.map(e=>e.ref):[]}E(D3,"getReferenceNodes");function _x(t,e){if(!t)throw new Error("Node must be an AstNode.");const r=e==null?void 0:e.range;return new Vl(()=>({keys:Object.keys(t),keyIndex:0,arrayIndex:0}),n=>{for(;n.keyIndex_x(r,e))}E(Uc,"streamAllContents");function Vo(t,e){if(t){if(e!=null&&e.range&&!M3(t,e.range))return new rg(t,()=>[])}else throw new Error("Root node must be an AstNode.");return new rg(t,r=>_x(r,e),{includeRoot:!0})}E(Vo,"streamAst");function M3(t,e){var n;if(!e)return!0;const r=(n=t.$cstNode)==null?void 0:n.range;return r?nD(r,e):!1}E(M3,"isAstNodeInRange");function ag(t){return new Vl(()=>({keys:Object.keys(t),keyIndex:0,arrayIndex:0}),e=>{for(;e.keyIndexks,AbstractParserRule:()=>Rx,AbstractRule:()=>sg,AbstractType:()=>Xs,Action:()=>ph,Alternatives:()=>Lx,ArrayLiteral:()=>P3,ArrayType:()=>B3,Assignment:()=>mh,BooleanLiteral:()=>F3,CharacterRange:()=>yh,Condition:()=>vh,Conjunction:()=>Ix,CrossReference:()=>bh,Disjunction:()=>Dx,EndOfFile:()=>z3,Grammar:()=>Yc,GrammarImport:()=>G3,Group:()=>Jd,InferredType:()=>q3,InfixRule:()=>Wl,InfixRuleOperatorList:()=>Nx,InfixRuleOperators:()=>V3,Interface:()=>lg,Keyword:()=>cg,LangiumGrammarAstReflection:()=>eD,LangiumGrammarTerminals:()=>KUe,NamedArgument:()=>ug,NegatedToken:()=>tf,Negation:()=>W3,NumberLiteral:()=>U3,Parameter:()=>hg,ParameterReference:()=>H3,ParserRule:()=>Wo,ReferenceType:()=>Ox,RegexToken:()=>rf,ReturnType:()=>Y3,RuleCall:()=>nf,SimpleType:()=>dg,StringLiteral:()=>K3,TerminalAlternatives:()=>af,TerminalElement:()=>Es,TerminalGroup:()=>sf,TerminalRule:()=>jc,TerminalRuleCall:()=>of,Type:()=>$x,TypeAttribute:()=>lf,TypeDefinition:()=>cf,UnionType:()=>Q3,UnorderedGroup:()=>Px,UntilToken:()=>uf,ValueLiteral:()=>hf,Wildcard:()=>fg,isAbstractElement:()=>O3,isAbstractParserRule:()=>Zd,isAbstractRule:()=>Hte,isAbstractType:()=>Yte,isAction:()=>gh,isAlternatives:()=>$3,isArrayLiteral:()=>Xte,isArrayType:()=>$9,isAssignment:()=>Hc,isBooleanLiteral:()=>P9,isCharacterRange:()=>B9,isCondition:()=>Kte,isConjunction:()=>F9,isCrossReference:()=>Qd,isDisjunction:()=>z9,isEndOfFile:()=>G9,isGrammar:()=>jte,isGrammarImport:()=>Zte,isGroup:()=>ef,isInferredType:()=>Mx,isInfixRule:()=>og,isInfixRuleOperatorList:()=>Qte,isInfixRuleOperators:()=>Jte,isInterface:()=>q9,isKeyword:()=>Xc,isNamedArgument:()=>ere,isNegatedToken:()=>V9,isNegation:()=>W9,isNumberLiteral:()=>tre,isParameter:()=>rre,isParameterReference:()=>U9,isParserRule:()=>rs,isReferenceType:()=>H9,isRegexToken:()=>Y9,isReturnType:()=>X9,isRuleCall:()=>Kc,isSimpleType:()=>X3,isStringLiteral:()=>nre,isTerminalAlternatives:()=>K9,isTerminalElement:()=>ire,isTerminalGroup:()=>j9,isTerminalRule:()=>yo,isTerminalRuleCall:()=>j3,isType:()=>Z3,isTypeAttribute:()=>are,isTypeDefinition:()=>sre,isUnionType:()=>Z9,isUnorderedGroup:()=>J3,isUntilToken:()=>Q9,isValueLiteral:()=>ore,isWildcard:()=>J9,reflection:()=>vr});var KUe={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]*/},ks={$type:"AbstractElement",cardinality:"cardinality"};function O3(t){return vr.isInstance(t,ks.$type)}E(O3,"isAbstractElement");var Rx={$type:"AbstractParserRule"};function Zd(t){return vr.isInstance(t,Rx.$type)}E(Zd,"isAbstractParserRule");var sg={$type:"AbstractRule"};function Hte(t){return vr.isInstance(t,sg.$type)}E(Hte,"isAbstractRule");var Xs={$type:"AbstractType"};function Yte(t){return vr.isInstance(t,Xs.$type)}E(Yte,"isAbstractType");var ph={$type:"Action",cardinality:"cardinality",feature:"feature",inferredType:"inferredType",operator:"operator",type:"type"};function gh(t){return vr.isInstance(t,ph.$type)}E(gh,"isAction");var Lx={$type:"Alternatives",cardinality:"cardinality",elements:"elements"};function $3(t){return vr.isInstance(t,Lx.$type)}E($3,"isAlternatives");var P3={$type:"ArrayLiteral",elements:"elements"};function Xte(t){return vr.isInstance(t,P3.$type)}E(Xte,"isArrayLiteral");var B3={$type:"ArrayType",elementType:"elementType"};function $9(t){return vr.isInstance(t,B3.$type)}E($9,"isArrayType");var mh={$type:"Assignment",cardinality:"cardinality",feature:"feature",operator:"operator",predicate:"predicate",terminal:"terminal"};function Hc(t){return vr.isInstance(t,mh.$type)}E(Hc,"isAssignment");var F3={$type:"BooleanLiteral",true:"true"};function P9(t){return vr.isInstance(t,F3.$type)}E(P9,"isBooleanLiteral");var yh={$type:"CharacterRange",cardinality:"cardinality",left:"left",lookahead:"lookahead",parenthesized:"parenthesized",right:"right"};function B9(t){return vr.isInstance(t,yh.$type)}E(B9,"isCharacterRange");var vh={$type:"Condition"};function Kte(t){return vr.isInstance(t,vh.$type)}E(Kte,"isCondition");var Ix={$type:"Conjunction",left:"left",right:"right"};function F9(t){return vr.isInstance(t,Ix.$type)}E(F9,"isConjunction");var bh={$type:"CrossReference",cardinality:"cardinality",deprecatedSyntax:"deprecatedSyntax",isMulti:"isMulti",terminal:"terminal",type:"type"};function Qd(t){return vr.isInstance(t,bh.$type)}E(Qd,"isCrossReference");var Dx={$type:"Disjunction",left:"left",right:"right"};function z9(t){return vr.isInstance(t,Dx.$type)}E(z9,"isDisjunction");var z3={$type:"EndOfFile",cardinality:"cardinality"};function G9(t){return vr.isInstance(t,z3.$type)}E(G9,"isEndOfFile");var Yc={$type:"Grammar",imports:"imports",interfaces:"interfaces",isDeclared:"isDeclared",name:"name",rules:"rules",types:"types"};function jte(t){return vr.isInstance(t,Yc.$type)}E(jte,"isGrammar");var G3={$type:"GrammarImport",path:"path"};function Zte(t){return vr.isInstance(t,G3.$type)}E(Zte,"isGrammarImport");var Jd={$type:"Group",cardinality:"cardinality",elements:"elements",guardCondition:"guardCondition",predicate:"predicate"};function ef(t){return vr.isInstance(t,Jd.$type)}E(ef,"isGroup");var q3={$type:"InferredType",name:"name"};function Mx(t){return vr.isInstance(t,q3.$type)}E(Mx,"isInferredType");var Wl={$type:"InfixRule",call:"call",dataType:"dataType",inferredType:"inferredType",name:"name",operators:"operators",parameters:"parameters",returnType:"returnType"};function og(t){return vr.isInstance(t,Wl.$type)}E(og,"isInfixRule");var Nx={$type:"InfixRuleOperatorList",associativity:"associativity",operators:"operators"};function Qte(t){return vr.isInstance(t,Nx.$type)}E(Qte,"isInfixRuleOperatorList");var V3={$type:"InfixRuleOperators",precedences:"precedences"};function Jte(t){return vr.isInstance(t,V3.$type)}E(Jte,"isInfixRuleOperators");var lg={$type:"Interface",attributes:"attributes",name:"name",superTypes:"superTypes"};function q9(t){return vr.isInstance(t,lg.$type)}E(q9,"isInterface");var cg={$type:"Keyword",cardinality:"cardinality",predicate:"predicate",value:"value"};function Xc(t){return vr.isInstance(t,cg.$type)}E(Xc,"isKeyword");var ug={$type:"NamedArgument",calledByName:"calledByName",parameter:"parameter",value:"value"};function ere(t){return vr.isInstance(t,ug.$type)}E(ere,"isNamedArgument");var tf={$type:"NegatedToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",terminal:"terminal"};function V9(t){return vr.isInstance(t,tf.$type)}E(V9,"isNegatedToken");var W3={$type:"Negation",value:"value"};function W9(t){return vr.isInstance(t,W3.$type)}E(W9,"isNegation");var U3={$type:"NumberLiteral",value:"value"};function tre(t){return vr.isInstance(t,U3.$type)}E(tre,"isNumberLiteral");var hg={$type:"Parameter",name:"name"};function rre(t){return vr.isInstance(t,hg.$type)}E(rre,"isParameter");var H3={$type:"ParameterReference",parameter:"parameter"};function U9(t){return vr.isInstance(t,H3.$type)}E(U9,"isParameterReference");var Wo={$type:"ParserRule",dataType:"dataType",definition:"definition",entry:"entry",fragment:"fragment",inferredType:"inferredType",name:"name",parameters:"parameters",returnType:"returnType"};function rs(t){return vr.isInstance(t,Wo.$type)}E(rs,"isParserRule");var Ox={$type:"ReferenceType",isMulti:"isMulti",referenceType:"referenceType"};function H9(t){return vr.isInstance(t,Ox.$type)}E(H9,"isReferenceType");var rf={$type:"RegexToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",regex:"regex"};function Y9(t){return vr.isInstance(t,rf.$type)}E(Y9,"isRegexToken");var Y3={$type:"ReturnType",name:"name"};function X9(t){return vr.isInstance(t,Y3.$type)}E(X9,"isReturnType");var nf={$type:"RuleCall",arguments:"arguments",cardinality:"cardinality",predicate:"predicate",rule:"rule"};function Kc(t){return vr.isInstance(t,nf.$type)}E(Kc,"isRuleCall");var dg={$type:"SimpleType",primitiveType:"primitiveType",stringType:"stringType",typeRef:"typeRef"};function X3(t){return vr.isInstance(t,dg.$type)}E(X3,"isSimpleType");var K3={$type:"StringLiteral",value:"value"};function nre(t){return vr.isInstance(t,K3.$type)}E(nre,"isStringLiteral");var af={$type:"TerminalAlternatives",cardinality:"cardinality",elements:"elements",lookahead:"lookahead",parenthesized:"parenthesized"};function K9(t){return vr.isInstance(t,af.$type)}E(K9,"isTerminalAlternatives");var Es={$type:"TerminalElement",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized"};function ire(t){return vr.isInstance(t,Es.$type)}E(ire,"isTerminalElement");var sf={$type:"TerminalGroup",cardinality:"cardinality",elements:"elements",lookahead:"lookahead",parenthesized:"parenthesized"};function j9(t){return vr.isInstance(t,sf.$type)}E(j9,"isTerminalGroup");var jc={$type:"TerminalRule",definition:"definition",fragment:"fragment",hidden:"hidden",name:"name",type:"type"};function yo(t){return vr.isInstance(t,jc.$type)}E(yo,"isTerminalRule");var of={$type:"TerminalRuleCall",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",rule:"rule"};function j3(t){return vr.isInstance(t,of.$type)}E(j3,"isTerminalRuleCall");var $x={$type:"Type",name:"name",type:"type"};function Z3(t){return vr.isInstance(t,$x.$type)}E(Z3,"isType");var lf={$type:"TypeAttribute",defaultValue:"defaultValue",isOptional:"isOptional",name:"name",type:"type"};function are(t){return vr.isInstance(t,lf.$type)}E(are,"isTypeAttribute");var cf={$type:"TypeDefinition"};function sre(t){return vr.isInstance(t,cf.$type)}E(sre,"isTypeDefinition");var Q3={$type:"UnionType",types:"types"};function Z9(t){return vr.isInstance(t,Q3.$type)}E(Z9,"isUnionType");var Px={$type:"UnorderedGroup",cardinality:"cardinality",elements:"elements"};function J3(t){return vr.isInstance(t,Px.$type)}E(J3,"isUnorderedGroup");var uf={$type:"UntilToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",terminal:"terminal"};function Q9(t){return vr.isInstance(t,uf.$type)}E(Q9,"isUntilToken");var hf={$type:"ValueLiteral"};function ore(t){return vr.isInstance(t,hf.$type)}E(ore,"isValueLiteral");var fg={$type:"Wildcard",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized"};function J9(t){return vr.isInstance(t,fg.$type)}E(J9,"isWildcard");var eD=($m=class extends D9{constructor(){super(...arguments),this.types={AbstractElement:{name:ks.$type,properties:{cardinality:{name:ks.cardinality}},superTypes:[]},AbstractParserRule:{name:Rx.$type,properties:{},superTypes:[sg.$type,Xs.$type]},AbstractRule:{name:sg.$type,properties:{},superTypes:[]},AbstractType:{name:Xs.$type,properties:{},superTypes:[]},Action:{name:ph.$type,properties:{cardinality:{name:ph.cardinality},feature:{name:ph.feature},inferredType:{name:ph.inferredType},operator:{name:ph.operator},type:{name:ph.type,referenceType:Xs.$type}},superTypes:[ks.$type]},Alternatives:{name:Lx.$type,properties:{cardinality:{name:Lx.cardinality},elements:{name:Lx.elements,defaultValue:[]}},superTypes:[ks.$type]},ArrayLiteral:{name:P3.$type,properties:{elements:{name:P3.elements,defaultValue:[]}},superTypes:[hf.$type]},ArrayType:{name:B3.$type,properties:{elementType:{name:B3.elementType}},superTypes:[cf.$type]},Assignment:{name:mh.$type,properties:{cardinality:{name:mh.cardinality},feature:{name:mh.feature},operator:{name:mh.operator},predicate:{name:mh.predicate},terminal:{name:mh.terminal}},superTypes:[ks.$type]},BooleanLiteral:{name:F3.$type,properties:{true:{name:F3.true,defaultValue:!1}},superTypes:[vh.$type,hf.$type]},CharacterRange:{name:yh.$type,properties:{cardinality:{name:yh.cardinality},left:{name:yh.left},lookahead:{name:yh.lookahead},parenthesized:{name:yh.parenthesized,defaultValue:!1},right:{name:yh.right}},superTypes:[Es.$type]},Condition:{name:vh.$type,properties:{},superTypes:[]},Conjunction:{name:Ix.$type,properties:{left:{name:Ix.left},right:{name:Ix.right}},superTypes:[vh.$type]},CrossReference:{name:bh.$type,properties:{cardinality:{name:bh.cardinality},deprecatedSyntax:{name:bh.deprecatedSyntax,defaultValue:!1},isMulti:{name:bh.isMulti,defaultValue:!1},terminal:{name:bh.terminal},type:{name:bh.type,referenceType:Xs.$type}},superTypes:[ks.$type]},Disjunction:{name:Dx.$type,properties:{left:{name:Dx.left},right:{name:Dx.right}},superTypes:[vh.$type]},EndOfFile:{name:z3.$type,properties:{cardinality:{name:z3.cardinality}},superTypes:[ks.$type]},Grammar:{name:Yc.$type,properties:{imports:{name:Yc.imports,defaultValue:[]},interfaces:{name:Yc.interfaces,defaultValue:[]},isDeclared:{name:Yc.isDeclared,defaultValue:!1},name:{name:Yc.name},rules:{name:Yc.rules,defaultValue:[]},types:{name:Yc.types,defaultValue:[]}},superTypes:[]},GrammarImport:{name:G3.$type,properties:{path:{name:G3.path}},superTypes:[]},Group:{name:Jd.$type,properties:{cardinality:{name:Jd.cardinality},elements:{name:Jd.elements,defaultValue:[]},guardCondition:{name:Jd.guardCondition},predicate:{name:Jd.predicate}},superTypes:[ks.$type]},InferredType:{name:q3.$type,properties:{name:{name:q3.name}},superTypes:[Xs.$type]},InfixRule:{name:Wl.$type,properties:{call:{name:Wl.call},dataType:{name:Wl.dataType},inferredType:{name:Wl.inferredType},name:{name:Wl.name},operators:{name:Wl.operators},parameters:{name:Wl.parameters,defaultValue:[]},returnType:{name:Wl.returnType,referenceType:Xs.$type}},superTypes:[Rx.$type]},InfixRuleOperatorList:{name:Nx.$type,properties:{associativity:{name:Nx.associativity},operators:{name:Nx.operators,defaultValue:[]}},superTypes:[]},InfixRuleOperators:{name:V3.$type,properties:{precedences:{name:V3.precedences,defaultValue:[]}},superTypes:[]},Interface:{name:lg.$type,properties:{attributes:{name:lg.attributes,defaultValue:[]},name:{name:lg.name},superTypes:{name:lg.superTypes,defaultValue:[],referenceType:Xs.$type}},superTypes:[Xs.$type]},Keyword:{name:cg.$type,properties:{cardinality:{name:cg.cardinality},predicate:{name:cg.predicate},value:{name:cg.value}},superTypes:[ks.$type]},NamedArgument:{name:ug.$type,properties:{calledByName:{name:ug.calledByName,defaultValue:!1},parameter:{name:ug.parameter,referenceType:hg.$type},value:{name:ug.value}},superTypes:[]},NegatedToken:{name:tf.$type,properties:{cardinality:{name:tf.cardinality},lookahead:{name:tf.lookahead},parenthesized:{name:tf.parenthesized,defaultValue:!1},terminal:{name:tf.terminal}},superTypes:[Es.$type]},Negation:{name:W3.$type,properties:{value:{name:W3.value}},superTypes:[vh.$type]},NumberLiteral:{name:U3.$type,properties:{value:{name:U3.value}},superTypes:[hf.$type]},Parameter:{name:hg.$type,properties:{name:{name:hg.name}},superTypes:[]},ParameterReference:{name:H3.$type,properties:{parameter:{name:H3.parameter,referenceType:hg.$type}},superTypes:[vh.$type]},ParserRule:{name:Wo.$type,properties:{dataType:{name:Wo.dataType},definition:{name:Wo.definition},entry:{name:Wo.entry,defaultValue:!1},fragment:{name:Wo.fragment,defaultValue:!1},inferredType:{name:Wo.inferredType},name:{name:Wo.name},parameters:{name:Wo.parameters,defaultValue:[]},returnType:{name:Wo.returnType,referenceType:Xs.$type}},superTypes:[Rx.$type]},ReferenceType:{name:Ox.$type,properties:{isMulti:{name:Ox.isMulti,defaultValue:!1},referenceType:{name:Ox.referenceType}},superTypes:[cf.$type]},RegexToken:{name:rf.$type,properties:{cardinality:{name:rf.cardinality},lookahead:{name:rf.lookahead},parenthesized:{name:rf.parenthesized,defaultValue:!1},regex:{name:rf.regex}},superTypes:[Es.$type]},ReturnType:{name:Y3.$type,properties:{name:{name:Y3.name}},superTypes:[]},RuleCall:{name:nf.$type,properties:{arguments:{name:nf.arguments,defaultValue:[]},cardinality:{name:nf.cardinality},predicate:{name:nf.predicate},rule:{name:nf.rule,referenceType:sg.$type}},superTypes:[ks.$type]},SimpleType:{name:dg.$type,properties:{primitiveType:{name:dg.primitiveType},stringType:{name:dg.stringType},typeRef:{name:dg.typeRef,referenceType:Xs.$type}},superTypes:[cf.$type]},StringLiteral:{name:K3.$type,properties:{value:{name:K3.value}},superTypes:[hf.$type]},TerminalAlternatives:{name:af.$type,properties:{cardinality:{name:af.cardinality},elements:{name:af.elements,defaultValue:[]},lookahead:{name:af.lookahead},parenthesized:{name:af.parenthesized,defaultValue:!1}},superTypes:[Es.$type]},TerminalElement:{name:Es.$type,properties:{cardinality:{name:Es.cardinality},lookahead:{name:Es.lookahead},parenthesized:{name:Es.parenthesized,defaultValue:!1}},superTypes:[ks.$type]},TerminalGroup:{name:sf.$type,properties:{cardinality:{name:sf.cardinality},elements:{name:sf.elements,defaultValue:[]},lookahead:{name:sf.lookahead},parenthesized:{name:sf.parenthesized,defaultValue:!1}},superTypes:[Es.$type]},TerminalRule:{name:jc.$type,properties:{definition:{name:jc.definition},fragment:{name:jc.fragment,defaultValue:!1},hidden:{name:jc.hidden,defaultValue:!1},name:{name:jc.name},type:{name:jc.type}},superTypes:[sg.$type]},TerminalRuleCall:{name:of.$type,properties:{cardinality:{name:of.cardinality},lookahead:{name:of.lookahead},parenthesized:{name:of.parenthesized,defaultValue:!1},rule:{name:of.rule,referenceType:jc.$type}},superTypes:[Es.$type]},Type:{name:$x.$type,properties:{name:{name:$x.name},type:{name:$x.type}},superTypes:[Xs.$type]},TypeAttribute:{name:lf.$type,properties:{defaultValue:{name:lf.defaultValue},isOptional:{name:lf.isOptional,defaultValue:!1},name:{name:lf.name},type:{name:lf.type}},superTypes:[]},TypeDefinition:{name:cf.$type,properties:{},superTypes:[]},UnionType:{name:Q3.$type,properties:{types:{name:Q3.types,defaultValue:[]}},superTypes:[cf.$type]},UnorderedGroup:{name:Px.$type,properties:{cardinality:{name:Px.cardinality},elements:{name:Px.elements,defaultValue:[]}},superTypes:[ks.$type]},UntilToken:{name:uf.$type,properties:{cardinality:{name:uf.cardinality},lookahead:{name:uf.lookahead},parenthesized:{name:uf.parenthesized,defaultValue:!1},terminal:{name:uf.terminal}},superTypes:[Es.$type]},ValueLiteral:{name:hf.$type,properties:{},superTypes:[]},Wildcard:{name:fg.$type,properties:{cardinality:{name:fg.cardinality},lookahead:{name:fg.lookahead},parenthesized:{name:fg.parenthesized,defaultValue:!1}},superTypes:[Es.$type]}}}},E($m,"LangiumGrammarAstReflection"),$m),vr=new eD;function lre(t){let e=t,r=!1;for(;e;){const n=jd(e.grammarSource,rs);if(n&&n.dataType)e=e.container,r=!0;else return r?e:void 0}}E(lre,"getDatatypeNode");function pg(t){return new rg(t,e=>Wc(e)?e.content:[],{includeRoot:!0})}E(pg,"streamCst");function cre(t){return pg(t).filter(Kd)}E(cre,"flattenCst");function tD(t,e){for(;t.container;)if(t=t.container,t===e)return!0;return!1}E(tD,"isChildNode");function Bx(t){return{start:{character:t.startColumn-1,line:t.startLine-1},end:{character:t.endColumn,line:t.endLine-1}}}E(Bx,"tokenToRange");function gg(t){if(!t)return;const{offset:e,end:r,range:n}=t;return{range:n,offset:e,end:r,length:r-e}}E(gg,"toDocumentSegment");var Ul;(function(t){t[t.Before=0]="Before",t[t.After=1]="After",t[t.OverlapFront=2]="OverlapFront",t[t.OverlapBack=3]="OverlapBack",t[t.Inside=4]="Inside",t[t.Outside=5]="Outside"})(Ul||(Ul={}));function rD(t,e){if(t.end.linee.end.line||t.start.line===e.end.line&&t.start.character>=e.end.character)return Ul.After;const r=t.start.line>e.start.line||t.start.line===e.start.line&&t.start.character>=e.start.character,n=t.end.lineUl.After}E(nD,"inRange");var iD=/^[\w\p{L}]$/u;function ure(t,e,r=iD){if(t){if(e>0){const n=e-t.offset,i=t.text.charAt(n);r.test(i)||e--}return tk(t,e)}}E(ure,"findDeclarationNodeAtOffset");function aD(t,e){if(t){const r=lD(t,!0);if(r&&ek(r,e))return r;if(I3(t)){const n=t.content.findIndex(i=>!i.hidden);for(let i=n-1;i>=0;i--){const a=t.content[i];if(ek(a,e))return a}}}}E(aD,"findCommentNode");function ek(t,e){return Kd(t)&&e.includes(t.tokenType.name)}E(ek,"isCommentNode");function tk(t,e){if(Kd(t))return t;if(Wc(t)){const r=oD(t,e,!1);if(r)return tk(r,e)}}E(tk,"findLeafNodeAtOffset");function sD(t,e){if(Kd(t))return t;if(Wc(t)){const r=oD(t,e,!0);if(r)return sD(r,e)}}E(sD,"findLeafNodeBeforeOffset");function oD(t,e,r){let n=0,i=t.content.length-1,a;for(;n<=i;){const s=Math.floor((n+i)/2),o=t.content[s];if(o.offset<=e&&o.end>e)return o;o.end<=e?(a=r?o:void 0,n=s+1):i=s-1}return a}E(oD,"binarySearch");function lD(t,e=!0){for(;t.container;){const r=t.container;let n=r.content.indexOf(t);for(;n>0;){n--;const i=r.content[n];if(e||!i.hidden)return i}t=r}}E(lD,"getPreviousNode");function hre(t,e=!0){for(;t.container;){const r=t.container;let n=r.content.indexOf(t);const i=r.content.length-1;for(;nkD,findNameAssignment:()=>fk,findNodeForKeyword:()=>CD,findNodeForProperty:()=>uk,findNodesForKeyword:()=>Cre,findNodesForKeywordInternal:()=>dk,findNodesForProperty:()=>wD,getActionAtElement:()=>SD,getActionType:()=>_D,getAllReachableRules:()=>ck,getAllRulesUsedForCrossReferences:()=>wre,getCrossReferenceTerminal:()=>xD,getEntryRule:()=>yD,getExplicitRuleType:()=>zx,getHiddenRules:()=>vD,getRuleType:()=>RD,getRuleTypeName:()=>_re,getTypeName:()=>pf,isArrayCardinality:()=>Ere,isArrayOperator:()=>Sre,isCommentTerminal:()=>TD,isDataType:()=>Are,isDataTypeRule:()=>Fx,isOptionalCardinality:()=>kre,terminalRegex:()=>Gx});var rk=(Pm=class extends Error{constructor(e,r){super(e?`${r} at ${e.range.start.line}:${e.range.start.character}`:r)}},E(Pm,"ErrorWithLocation"),Pm);function xh(t,e="Error: Got unexpected value."){throw new Error(e)}E(xh,"assertUnreachable");function hD(t,e="Error: Condition is violated."){if(!t)throw new Error(e)}E(hD,"assertCondition");var dD={};fh(dD,{NEWLINE_REGEXP:()=>vre,escapeRegExp:()=>yg,getTerminalParts:()=>xre,isMultilineComment:()=>pD,isWhitespace:()=>lk,partialMatches:()=>gD,partialRegExp:()=>mD,whitespaceCharacters:()=>Tre});function Cr(t){return t.charCodeAt(0)}E(Cr,"cc");function nk(t,e){Array.isArray(t)?t.forEach(function(r){e.push(r)}):e.push(t)}E(nk,"insertToSet");function mg(t,e){if(t[e]===!0)throw"duplicate flag "+e;t[e],t[e]=!0}E(mg,"addFlag");function df(t){if(t===void 0)throw Error("Internal Error - Should never get here!");return!0}E(df,"ASSERT_EXISTS");function gre(){throw Error("Internal Error - Should never get here!")}E(gre,"ASSERT_NEVER_REACH_HERE");function fD(t){return t.type==="Character"}E(fD,"isCharacter");var ik=[];for(let t=Cr("0");t<=Cr("9");t++)ik.push(t);var ak=[Cr("_")].concat(ik);for(let t=Cr("a");t<=Cr("z");t++)ak.push(t);for(let t=Cr("A");t<=Cr("Z");t++)ak.push(t);var mre=[Cr(" "),Cr("\f"),Cr(` -`),Cr("\r"),Cr(" "),Cr("\v"),Cr(" "),Cr(" "),Cr(" "),Cr(" "),Cr(" "),Cr(" "),Cr(" "),Cr(" "),Cr(" "),Cr(" "),Cr(" "),Cr(" "),Cr(" "),Cr(" "),Cr("\u2028"),Cr("\u2029"),Cr(" "),Cr(" "),Cr(" "),Cr("\uFEFF")],jUe=/[0-9a-fA-F]/,sk=/[0-9]/,ZUe=/[1-9]/,yre=(Bm=class{constructor(){this.idx=0,this.input="",this.groupIdx=0}saveState(){return{idx:this.idx,input:this.input,groupIdx:this.groupIdx}}restoreState(e){this.idx=e.idx,this.input=e.input,this.groupIdx=e.groupIdx}pattern(e){this.idx=0,this.input=e,this.groupIdx=0,this.consumeChar("/");const r=this.disjunction();this.consumeChar("/");const n={type:"Flags",loc:{begin:this.idx,end:e.length},global:!1,ignoreCase:!1,multiLine:!1,unicode:!1,sticky:!1};for(;this.isRegExpFlag();)switch(this.popChar()){case"g":mg(n,"global");break;case"i":mg(n,"ignoreCase");break;case"m":mg(n,"multiLine");break;case"u":mg(n,"unicode");break;case"y":mg(n,"sticky");break}if(this.idx!==this.input.length)throw Error("Redundant input: "+this.input.substring(this.idx));return{type:"Pattern",flags:n,value:r,loc:this.loc(0)}}disjunction(){const e=[],r=this.idx;for(e.push(this.alternative());this.peekChar()==="|";)this.consumeChar("|"),e.push(this.alternative());return{type:"Disjunction",value:e,loc:this.loc(r)}}alternative(){const e=[],r=this.idx;for(;this.isTerm();)e.push(this.term());return{type:"Alternative",value:e,loc:this.loc(r)}}term(){return this.isAssertion()?this.assertion():this.atom()}assertion(){const e=this.idx;switch(this.popChar()){case"^":return{type:"StartAnchor",loc:this.loc(e)};case"$":return{type:"EndAnchor",loc:this.loc(e)};case"\\":switch(this.popChar()){case"b":return{type:"WordBoundary",loc:this.loc(e)};case"B":return{type:"NonWordBoundary",loc:this.loc(e)}}throw Error("Invalid Assertion Escape");case"(":this.consumeChar("?");let r;switch(this.popChar()){case"=":r="Lookahead";break;case"!":r="NegativeLookahead";break;case"<":{switch(this.popChar()){case"=":r="Lookbehind";break;case"!":r="NegativeLookbehind"}break}}df(r);const n=this.disjunction();return this.consumeChar(")"),{type:r,value:n,loc:this.loc(e)}}return gre()}quantifier(e=!1){let r;const n=this.idx;switch(this.popChar()){case"*":r={atLeast:0,atMost:1/0};break;case"+":r={atLeast:1,atMost:1/0};break;case"?":r={atLeast:0,atMost:1};break;case"{":const i=this.integerIncludingZero();switch(this.popChar()){case"}":r={atLeast:i,atMost:i};break;case",":let a;this.isDigit()?(a=this.integerIncludingZero(),r={atLeast:i,atMost:a}):r={atLeast:i,atMost:1/0},this.consumeChar("}");break}if(e===!0&&r===void 0)return;df(r);break}if(!(e===!0&&r===void 0)&&df(r))return this.peekChar(0)==="?"?(this.consumeChar("?"),r.greedy=!1):r.greedy=!0,r.type="Quantifier",r.loc=this.loc(n),r}atom(){let e;const r=this.idx;switch(this.peekChar()){case".":e=this.dotAll();break;case"\\":e=this.atomEscape();break;case"[":e=this.characterClass();break;case"(":e=this.group();break}if(e===void 0&&this.isPatternCharacter()&&(e=this.patternCharacter()),df(e))return e.loc=this.loc(r),this.isQuantifier()&&(e.quantifier=this.quantifier()),e}dotAll(){return this.consumeChar("."),{type:"Set",complement:!0,value:[Cr(` -`),Cr("\r"),Cr("\u2028"),Cr("\u2029")]}}atomEscape(){switch(this.consumeChar("\\"),this.peekChar()){case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return this.decimalEscapeAtom();case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}}decimalEscapeAtom(){return{type:"GroupBackReference",value:this.positiveInteger()}}characterClassEscape(){let e,r=!1;switch(this.popChar()){case"d":e=ik;break;case"D":e=ik,r=!0;break;case"s":e=mre;break;case"S":e=mre,r=!0;break;case"w":e=ak;break;case"W":e=ak,r=!0;break}if(df(e))return{type:"Set",value:e,complement:r}}controlEscapeAtom(){let e;switch(this.popChar()){case"f":e=Cr("\f");break;case"n":e=Cr(` -`);break;case"r":e=Cr("\r");break;case"t":e=Cr(" ");break;case"v":e=Cr("\v");break}if(df(e))return{type:"Character",value:e}}controlLetterEscapeAtom(){this.consumeChar("c");const e=this.popChar();if(/[a-zA-Z]/.test(e)===!1)throw Error("Invalid ");return{type:"Character",value:e.toUpperCase().charCodeAt(0)-64}}nulCharacterAtom(){return this.consumeChar("0"),{type:"Character",value:Cr("\0")}}hexEscapeSequenceAtom(){return this.consumeChar("x"),this.parseHexDigits(2)}regExpUnicodeEscapeSequenceAtom(){return this.consumeChar("u"),this.parseHexDigits(4)}identityEscapeAtom(){const e=this.popChar();return{type:"Character",value:Cr(e)}}classPatternCharacterAtom(){switch(this.peekChar()){case` -`:case"\r":case"\u2028":case"\u2029":case"\\":case"]":throw Error("TBD");default:const e=this.popChar();return{type:"Character",value:Cr(e)}}}characterClass(){const e=[];let r=!1;for(this.consumeChar("["),this.peekChar(0)==="^"&&(this.consumeChar("^"),r=!0);this.isClassAtom();){const n=this.classAtom();if(n.type,fD(n)&&this.isRangeDash()){this.consumeChar("-");const i=this.classAtom();if(i.type,fD(i)){if(i.value{Mt();let ut,Lt;if(r.string(ye)){ut=ye;const lr=et[0];let cr=0,$r=n.ParameterStructures.auto;n.ParameterStructures.is(lr)&&(cr=1,$r=lr);let dr=et.length;const Or=dr-cr;switch(Or){case 0:Lt=void 0;break;case 1:Lt=ht($r,et[cr]);break;default:if($r===n.ParameterStructures.byName)throw new Error(`Received ${Or} parameters for 'by Name' notification parameter structure.`);Lt=et.slice(cr,dr).map(ir=>oe(ir));break}}else{const lr=et;ut=ye.method,Lt=kt(ye,lr)}const Vt={jsonrpc:V,method:ut,params:Lt};return we(Vt),N.write(Vt).catch(lr=>{throw O.error("Sending notification failed."),lr})},"sendNotification"),onNotification:E((ye,et)=>{Mt();let ut;return r.func(ye)?ie=ye:et&&(r.string(ye)?(ut=ye,j.set(ye,{type:void 0,handler:et})):(ut=ye.method,j.set(ye.method,{type:ye,handler:et}))),{dispose:E(()=>{ut!==void 0?j.delete(ut):ie=void 0},"dispose")}},"onNotification"),onProgress:E((ye,et,ut)=>{if(ae.has(et))throw new Error(`Progress handler for token ${et} already registered`);return ae.set(et,ut),{dispose:E(()=>{ae.delete(et)},"dispose")}},"onProgress"),sendProgress:E((ye,et,ut)=>qr.sendNotification(u.type,{token:et,value:ut}),"sendProgress"),onUnhandledProgress:xe.event,sendRequest:E((ye,...et)=>{Mt(),dt();let ut,Lt,Vt;if(r.string(ye)){ut=ye;const dr=et[0],Or=et[et.length-1];let ir=0,Vr=n.ParameterStructures.auto;n.ParameterStructures.is(dr)&&(ir=1,Vr=dr);let Sn=et.length;s.CancellationToken.is(Or)&&(Sn=Sn-1,Vt=Or);const Ur=Sn-ir;switch(Ur){case 0:Lt=void 0;break;case 1:Lt=ht(Vr,et[ir]);break;default:if(Vr===n.ParameterStructures.byName)throw new Error(`Received ${Ur} parameters for 'by Name' request parameter structure.`);Lt=et.slice(ir,Sn).map(us=>oe(us));break}}else{const dr=et;ut=ye.method,Lt=kt(ye,dr);const Or=ye.numberOfParams;Vt=s.CancellationToken.is(dr[Or])?dr[Or]:void 0}const lr=B++;let cr;Vt&&(cr=Vt.onCancellationRequested(()=>{const dr=Ce.sender.sendCancellation(qr,lr);return dr===void 0?(O.log(`Received no promise from cancellation strategy when cancelling id ${lr}`),Promise.resolve()):dr.catch(()=>{O.log(`Sending cancellation messages for id ${lr} failed`)})}));const $r={jsonrpc:V,id:lr,method:ut,params:Lt};return it($r),typeof Ce.sender.enableCancellation=="function"&&Ce.sender.enableCancellation($r),new Promise(async(dr,Or)=>{const ir=E(Ur=>{dr(Ur),Ce.sender.cleanup(lr),cr==null||cr.dispose()},"resolveWithCleanup"),Vr=E(Ur=>{Or(Ur),Ce.sender.cleanup(lr),cr==null||cr.dispose()},"rejectWithCleanup"),Sn={method:ut,timerStart:Date.now(),resolve:ir,reject:Vr};try{await N.write($r),Q.set(lr,Sn)}catch(Ur){throw O.error("Sending request failed."),Sn.reject(new n.ResponseError(n.ErrorCodes.MessageWriteError,Ur.message?Ur.message:"Unknown reason")),Ur}})},"sendRequest"),onRequest:E((ye,et)=>{Mt();let ut=null;return d.is(ye)?(ut=void 0,H=ye):r.string(ye)?(ut=null,et!==void 0&&(ut=ye,W.set(ye,{handler:et,type:void 0}))):et!==void 0&&(ut=ye.method,W.set(ye.method,{type:ye,handler:et})),{dispose:E(()=>{ut!==null&&(ut!==void 0?W.delete(ut):H=void 0)},"dispose")}},"onRequest"),hasPendingResponse:E(()=>Q.size>0,"hasPendingResponse"),trace:E(async(ye,et,ut)=>{let Lt=!1,Vt=g.Text;ut!==void 0&&(r.boolean(ut)?Lt=ut:(Lt=ut.sendNotification||!1,Vt=ut.traceFormat||g.Text)),fe=ye,Ae=Vt,fe===f.Off?Se=void 0:Se=et,Lt&&!_e()&&!Y()&&await qr.sendNotification(m.type,{value:f.toString(ye)})},"trace"),onError:ge.event,onClose:ve.event,onUnhandledNotification:ze.event,onDispose:Ke.event,end:E(()=>{N.end()},"end"),dispose:E(()=>{if(Y())return;Ne=I.Disposed,Ke.fire(void 0);const ye=new n.ResponseError(n.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(const et of Q.values())et.reject(ye);Q=new Map,le=new Map,re=new Set,K=new i.LinkedMap,r.func(N.dispose)&&N.dispose(),r.func(R.dispose)&&R.dispose()},"dispose"),listen:E(()=>{Mt(),Tt(),Ne=I.Listening,R.listen(Ue)},"listen"),inspect:E(()=>{(0,e.default)().console.log("inspect")},"inspect")};return qr.onNotification(y.type,ye=>{if(fe===f.Off||!Se)return;const et=fe===f.Verbose||fe===f.Compact;Se.log(ye.message,et?ye.verbose:void 0)}),qr.onNotification(u.type,ye=>{const et=ae.get(ye.token);et?et(ye.value):xe.fire(ye)}),qr}E(z,"createMessageConnection"),t.createMessageConnection=z}}),nO=Gr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/api.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ProgressType=t.ProgressToken=t.createMessageConnection=t.NullLogger=t.ConnectionOptions=t.ConnectionStrategy=t.AbstractMessageBuffer=t.WriteableStreamMessageWriter=t.AbstractMessageWriter=t.MessageWriter=t.ReadableStreamMessageReader=t.AbstractMessageReader=t.MessageReader=t.SharedArrayReceiverStrategy=t.SharedArraySenderStrategy=t.CancellationToken=t.CancellationTokenSource=t.Emitter=t.Event=t.Disposable=t.LRUCache=t.Touch=t.LinkedMap=t.ParameterStructures=t.NotificationType9=t.NotificationType8=t.NotificationType7=t.NotificationType6=t.NotificationType5=t.NotificationType4=t.NotificationType3=t.NotificationType2=t.NotificationType1=t.NotificationType0=t.NotificationType=t.ErrorCodes=t.ResponseError=t.RequestType9=t.RequestType8=t.RequestType7=t.RequestType6=t.RequestType5=t.RequestType4=t.RequestType3=t.RequestType2=t.RequestType1=t.RequestType0=t.RequestType=t.Message=t.RAL=void 0,t.MessageStrategy=t.CancellationStrategy=t.CancellationSenderStrategy=t.CancellationReceiverStrategy=t.ConnectionError=t.ConnectionErrors=t.LogTraceNotification=t.SetTraceNotification=t.TraceFormat=t.TraceValues=t.Trace=void 0;var e=tce();Object.defineProperty(t,"Message",{enumerable:!0,get:E(function(){return e.Message},"get")}),Object.defineProperty(t,"RequestType",{enumerable:!0,get:E(function(){return e.RequestType},"get")}),Object.defineProperty(t,"RequestType0",{enumerable:!0,get:E(function(){return e.RequestType0},"get")}),Object.defineProperty(t,"RequestType1",{enumerable:!0,get:E(function(){return e.RequestType1},"get")}),Object.defineProperty(t,"RequestType2",{enumerable:!0,get:E(function(){return e.RequestType2},"get")}),Object.defineProperty(t,"RequestType3",{enumerable:!0,get:E(function(){return e.RequestType3},"get")}),Object.defineProperty(t,"RequestType4",{enumerable:!0,get:E(function(){return e.RequestType4},"get")}),Object.defineProperty(t,"RequestType5",{enumerable:!0,get:E(function(){return e.RequestType5},"get")}),Object.defineProperty(t,"RequestType6",{enumerable:!0,get:E(function(){return e.RequestType6},"get")}),Object.defineProperty(t,"RequestType7",{enumerable:!0,get:E(function(){return e.RequestType7},"get")}),Object.defineProperty(t,"RequestType8",{enumerable:!0,get:E(function(){return e.RequestType8},"get")}),Object.defineProperty(t,"RequestType9",{enumerable:!0,get:E(function(){return e.RequestType9},"get")}),Object.defineProperty(t,"ResponseError",{enumerable:!0,get:E(function(){return e.ResponseError},"get")}),Object.defineProperty(t,"ErrorCodes",{enumerable:!0,get:E(function(){return e.ErrorCodes},"get")}),Object.defineProperty(t,"NotificationType",{enumerable:!0,get:E(function(){return e.NotificationType},"get")}),Object.defineProperty(t,"NotificationType0",{enumerable:!0,get:E(function(){return e.NotificationType0},"get")}),Object.defineProperty(t,"NotificationType1",{enumerable:!0,get:E(function(){return e.NotificationType1},"get")}),Object.defineProperty(t,"NotificationType2",{enumerable:!0,get:E(function(){return e.NotificationType2},"get")}),Object.defineProperty(t,"NotificationType3",{enumerable:!0,get:E(function(){return e.NotificationType3},"get")}),Object.defineProperty(t,"NotificationType4",{enumerable:!0,get:E(function(){return e.NotificationType4},"get")}),Object.defineProperty(t,"NotificationType5",{enumerable:!0,get:E(function(){return e.NotificationType5},"get")}),Object.defineProperty(t,"NotificationType6",{enumerable:!0,get:E(function(){return e.NotificationType6},"get")}),Object.defineProperty(t,"NotificationType7",{enumerable:!0,get:E(function(){return e.NotificationType7},"get")}),Object.defineProperty(t,"NotificationType8",{enumerable:!0,get:E(function(){return e.NotificationType8},"get")}),Object.defineProperty(t,"NotificationType9",{enumerable:!0,get:E(function(){return e.NotificationType9},"get")}),Object.defineProperty(t,"ParameterStructures",{enumerable:!0,get:E(function(){return e.ParameterStructures},"get")});var r=rce();Object.defineProperty(t,"LinkedMap",{enumerable:!0,get:E(function(){return r.LinkedMap},"get")}),Object.defineProperty(t,"LRUCache",{enumerable:!0,get:E(function(){return r.LRUCache},"get")}),Object.defineProperty(t,"Touch",{enumerable:!0,get:E(function(){return r.Touch},"get")});var n=att();Object.defineProperty(t,"Disposable",{enumerable:!0,get:E(function(){return n.Disposable},"get")});var i=Dm();Object.defineProperty(t,"Event",{enumerable:!0,get:E(function(){return i.Event},"get")}),Object.defineProperty(t,"Emitter",{enumerable:!0,get:E(function(){return i.Emitter},"get")});var a=RS();Object.defineProperty(t,"CancellationTokenSource",{enumerable:!0,get:E(function(){return a.CancellationTokenSource},"get")}),Object.defineProperty(t,"CancellationToken",{enumerable:!0,get:E(function(){return a.CancellationToken},"get")});var s=stt();Object.defineProperty(t,"SharedArraySenderStrategy",{enumerable:!0,get:E(function(){return s.SharedArraySenderStrategy},"get")}),Object.defineProperty(t,"SharedArrayReceiverStrategy",{enumerable:!0,get:E(function(){return s.SharedArrayReceiverStrategy},"get")});var o=ott();Object.defineProperty(t,"MessageReader",{enumerable:!0,get:E(function(){return o.MessageReader},"get")}),Object.defineProperty(t,"AbstractMessageReader",{enumerable:!0,get:E(function(){return o.AbstractMessageReader},"get")}),Object.defineProperty(t,"ReadableStreamMessageReader",{enumerable:!0,get:E(function(){return o.ReadableStreamMessageReader},"get")});var l=ltt();Object.defineProperty(t,"MessageWriter",{enumerable:!0,get:E(function(){return l.MessageWriter},"get")}),Object.defineProperty(t,"AbstractMessageWriter",{enumerable:!0,get:E(function(){return l.AbstractMessageWriter},"get")}),Object.defineProperty(t,"WriteableStreamMessageWriter",{enumerable:!0,get:E(function(){return l.WriteableStreamMessageWriter},"get")});var u=ctt();Object.defineProperty(t,"AbstractMessageBuffer",{enumerable:!0,get:E(function(){return u.AbstractMessageBuffer},"get")});var h=utt();Object.defineProperty(t,"ConnectionStrategy",{enumerable:!0,get:E(function(){return h.ConnectionStrategy},"get")}),Object.defineProperty(t,"ConnectionOptions",{enumerable:!0,get:E(function(){return h.ConnectionOptions},"get")}),Object.defineProperty(t,"NullLogger",{enumerable:!0,get:E(function(){return h.NullLogger},"get")}),Object.defineProperty(t,"createMessageConnection",{enumerable:!0,get:E(function(){return h.createMessageConnection},"get")}),Object.defineProperty(t,"ProgressToken",{enumerable:!0,get:E(function(){return h.ProgressToken},"get")}),Object.defineProperty(t,"ProgressType",{enumerable:!0,get:E(function(){return h.ProgressType},"get")}),Object.defineProperty(t,"Trace",{enumerable:!0,get:E(function(){return h.Trace},"get")}),Object.defineProperty(t,"TraceValues",{enumerable:!0,get:E(function(){return h.TraceValues},"get")}),Object.defineProperty(t,"TraceFormat",{enumerable:!0,get:E(function(){return h.TraceFormat},"get")}),Object.defineProperty(t,"SetTraceNotification",{enumerable:!0,get:E(function(){return h.SetTraceNotification},"get")}),Object.defineProperty(t,"LogTraceNotification",{enumerable:!0,get:E(function(){return h.LogTraceNotification},"get")}),Object.defineProperty(t,"ConnectionErrors",{enumerable:!0,get:E(function(){return h.ConnectionErrors},"get")}),Object.defineProperty(t,"ConnectionError",{enumerable:!0,get:E(function(){return h.ConnectionError},"get")}),Object.defineProperty(t,"CancellationReceiverStrategy",{enumerable:!0,get:E(function(){return h.CancellationReceiverStrategy},"get")}),Object.defineProperty(t,"CancellationSenderStrategy",{enumerable:!0,get:E(function(){return h.CancellationSenderStrategy},"get")}),Object.defineProperty(t,"CancellationStrategy",{enumerable:!0,get:E(function(){return h.CancellationStrategy},"get")}),Object.defineProperty(t,"MessageStrategy",{enumerable:!0,get:E(function(){return h.MessageStrategy},"get")});var d=up();t.RAL=d.default}}),htt=Gr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/browser/ril.js"(t){var l,u,h;Object.defineProperty(t,"__esModule",{value:!0});var e=nO(),r=(l=class extends e.AbstractMessageBuffer{constructor(f="utf-8"){super(f),this.asciiDecoder=new TextDecoder("ascii")}emptyBuffer(){return l.emptyBuffer}fromString(f,p){return new TextEncoder().encode(f)}toString(f,p){return p==="ascii"?this.asciiDecoder.decode(f):new TextDecoder(p).decode(f)}asNative(f,p){return p===void 0?f:f.slice(0,p)}allocNative(f){return new Uint8Array(f)}},E(l,"MessageBuffer"),l);r.emptyBuffer=new Uint8Array(0);var n=(u=class{constructor(f){this.socket=f,this._onData=new e.Emitter,this._messageListener=p=>{p.data.arrayBuffer().then(m=>{this._onData.fire(new Uint8Array(m))},()=>{(0,e.RAL)().console.error("Converting blob to array buffer failed.")})},this.socket.addEventListener("message",this._messageListener)}onClose(f){return this.socket.addEventListener("close",f),e.Disposable.create(()=>this.socket.removeEventListener("close",f))}onError(f){return this.socket.addEventListener("error",f),e.Disposable.create(()=>this.socket.removeEventListener("error",f))}onEnd(f){return this.socket.addEventListener("end",f),e.Disposable.create(()=>this.socket.removeEventListener("end",f))}onData(f){return this._onData.event(f)}},E(u,"ReadableStreamWrapper"),u),i=(h=class{constructor(f){this.socket=f}onClose(f){return this.socket.addEventListener("close",f),e.Disposable.create(()=>this.socket.removeEventListener("close",f))}onError(f){return this.socket.addEventListener("error",f),e.Disposable.create(()=>this.socket.removeEventListener("error",f))}onEnd(f){return this.socket.addEventListener("end",f),e.Disposable.create(()=>this.socket.removeEventListener("end",f))}write(f,p){if(typeof f=="string"){if(p!==void 0&&p!=="utf-8")throw new Error(`In a Browser environments only utf-8 text encoding is supported. But got encoding: ${p}`);this.socket.send(f)}else this.socket.send(f);return Promise.resolve()}end(){this.socket.close()}},E(h,"WritableStreamWrapper"),h),a=new TextEncoder,s=Object.freeze({messageBuffer:Object.freeze({create:E(d=>new r(d),"create")}),applicationJson:Object.freeze({encoder:Object.freeze({name:"application/json",encode:E((d,f)=>{if(f.charset!=="utf-8")throw new Error(`In a Browser environments only utf-8 text encoding is supported. But got encoding: ${f.charset}`);return Promise.resolve(a.encode(JSON.stringify(d,void 0,0)))},"encode")}),decoder:Object.freeze({name:"application/json",decode:E((d,f)=>{if(!(d instanceof Uint8Array))throw new Error("In a Browser environments only Uint8Arrays are supported.");return Promise.resolve(JSON.parse(new TextDecoder(f.charset).decode(d)))},"decode")})}),stream:Object.freeze({asReadableStream:E(d=>new n(d),"asReadableStream"),asWritableStream:E(d=>new i(d),"asWritableStream")}),console,timer:Object.freeze({setTimeout(d,f,...p){const g=setTimeout(d,f,...p);return{dispose:E(()=>clearTimeout(g),"dispose")}},setImmediate(d,...f){const p=setTimeout(d,0,...f);return{dispose:E(()=>clearTimeout(p),"dispose")}},setInterval(d,f,...p){const g=setInterval(d,f,...p);return{dispose:E(()=>clearInterval(g),"dispose")}}})});function o(){return s}E(o,"RIL"),(function(d){function f(){e.RAL.install(s)}E(f,"install"),d.install=f})(o||(o={})),t.default=o}}),Mm=Gr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/browser/main.js"(t){var l,u;var e=t&&t.__createBinding||(Object.create?(function(h,d,f,p){p===void 0&&(p=f);var g=Object.getOwnPropertyDescriptor(d,f);(!g||("get"in g?!d.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:E(function(){return d[f]},"get")}),Object.defineProperty(h,p,g)}):(function(h,d,f,p){p===void 0&&(p=f),h[p]=d[f]})),r=t&&t.__exportStar||function(h,d){for(var f in h)f!=="default"&&!Object.prototype.hasOwnProperty.call(d,f)&&e(d,h,f)};Object.defineProperty(t,"__esModule",{value:!0}),t.createMessageConnection=t.BrowserMessageWriter=t.BrowserMessageReader=void 0;var n=htt();n.default.install();var i=nO();r(nO(),t);var a=(l=class extends i.AbstractMessageReader{constructor(d){super(),this._onData=new i.Emitter,this._messageListener=f=>{this._onData.fire(f.data)},d.addEventListener("error",f=>this.fireError(f)),d.onmessage=this._messageListener}listen(d){return this._onData.event(d)}},E(l,"BrowserMessageReader"),l);t.BrowserMessageReader=a;var s=(u=class extends i.AbstractMessageWriter{constructor(d){super(),this.port=d,this.errorCount=0,d.addEventListener("error",f=>this.fireError(f))}write(d){try{return this.port.postMessage(d),Promise.resolve()}catch(f){return this.handleError(f,d),Promise.reject(f)}}handleError(d,f){this.errorCount++,this.fireError(d,f,this.errorCount)}end(){}},E(u,"BrowserMessageWriter"),u);t.BrowserMessageWriter=s;function o(h,d,f,p){return f===void 0&&(f=i.NullLogger),i.ConnectionStrategy.is(p)&&(p={connectionStrategy:p}),(0,i.createMessageConnection)(h,d,f,p)}E(o,"createMessageConnection"),t.createMessageConnection=o}}),ice=Gr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/browser.js"(t,e){e.exports=Mm()}}),vi=Gr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/messages.js"(t){var l,u,h,d,f;Object.defineProperty(t,"__esModule",{value:!0}),t.ProtocolNotificationType=t.ProtocolNotificationType0=t.ProtocolRequestType=t.ProtocolRequestType0=t.RegistrationType=t.MessageDirection=void 0;var e=Mm(),r;(function(p){p.clientToServer="clientToServer",p.serverToClient="serverToClient",p.both="both"})(r||(t.MessageDirection=r={}));var n=(l=class{constructor(g){this.method=g}},E(l,"RegistrationType"),l);t.RegistrationType=n;var i=(u=class extends e.RequestType0{constructor(g){super(g)}},E(u,"ProtocolRequestType0"),u);t.ProtocolRequestType0=i;var a=(h=class extends e.RequestType{constructor(g){super(g,e.ParameterStructures.byName)}},E(h,"ProtocolRequestType"),h);t.ProtocolRequestType=a;var s=(d=class extends e.NotificationType0{constructor(g){super(g)}},E(d,"ProtocolNotificationType0"),d);t.ProtocolNotificationType0=s;var o=(f=class extends e.NotificationType{constructor(g){super(g,e.ParameterStructures.byName)}},E(f,"ProtocolNotificationType"),f);t.ProtocolNotificationType=o}}),iO=Gr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/utils/is.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.objectLiteral=t.typedArray=t.stringArray=t.array=t.func=t.error=t.number=t.string=t.boolean=void 0;function e(h){return h===!0||h===!1}E(e,"boolean"),t.boolean=e;function r(h){return typeof h=="string"||h instanceof String}E(r,"string"),t.string=r;function n(h){return typeof h=="number"||h instanceof Number}E(n,"number"),t.number=n;function i(h){return h instanceof Error}E(i,"error"),t.error=i;function a(h){return typeof h=="function"}E(a,"func"),t.func=a;function s(h){return Array.isArray(h)}E(s,"array"),t.array=s;function o(h){return s(h)&&h.every(d=>r(d))}E(o,"stringArray"),t.stringArray=o;function l(h,d){return Array.isArray(h)&&h.every(d)}E(l,"typedArray"),t.typedArray=l;function u(h){return h!==null&&typeof h=="object"}E(u,"objectLiteral"),t.objectLiteral=u}}),dtt=Gr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.implementation.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ImplementationRequest=void 0;var e=vi(),r;(function(n){n.method="textDocument/implementation",n.messageDirection=e.MessageDirection.clientToServer,n.type=new e.ProtocolRequestType(n.method)})(r||(t.ImplementationRequest=r={}))}}),ftt=Gr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.typeDefinition.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.TypeDefinitionRequest=void 0;var e=vi(),r;(function(n){n.method="textDocument/typeDefinition",n.messageDirection=e.MessageDirection.clientToServer,n.type=new e.ProtocolRequestType(n.method)})(r||(t.TypeDefinitionRequest=r={}))}}),ptt=Gr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.workspaceFolder.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.DidChangeWorkspaceFoldersNotification=t.WorkspaceFoldersRequest=void 0;var e=vi(),r;(function(i){i.method="workspace/workspaceFolders",i.messageDirection=e.MessageDirection.serverToClient,i.type=new e.ProtocolRequestType0(i.method)})(r||(t.WorkspaceFoldersRequest=r={}));var n;(function(i){i.method="workspace/didChangeWorkspaceFolders",i.messageDirection=e.MessageDirection.clientToServer,i.type=new e.ProtocolNotificationType(i.method)})(n||(t.DidChangeWorkspaceFoldersNotification=n={}))}}),gtt=Gr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.configuration.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ConfigurationRequest=void 0;var e=vi(),r;(function(n){n.method="workspace/configuration",n.messageDirection=e.MessageDirection.serverToClient,n.type=new e.ProtocolRequestType(n.method)})(r||(t.ConfigurationRequest=r={}))}}),mtt=Gr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.colorProvider.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ColorPresentationRequest=t.DocumentColorRequest=void 0;var e=vi(),r;(function(i){i.method="textDocument/documentColor",i.messageDirection=e.MessageDirection.clientToServer,i.type=new e.ProtocolRequestType(i.method)})(r||(t.DocumentColorRequest=r={}));var n;(function(i){i.method="textDocument/colorPresentation",i.messageDirection=e.MessageDirection.clientToServer,i.type=new e.ProtocolRequestType(i.method)})(n||(t.ColorPresentationRequest=n={}))}}),ytt=Gr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.foldingRange.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.FoldingRangeRefreshRequest=t.FoldingRangeRequest=void 0;var e=vi(),r;(function(i){i.method="textDocument/foldingRange",i.messageDirection=e.MessageDirection.clientToServer,i.type=new e.ProtocolRequestType(i.method)})(r||(t.FoldingRangeRequest=r={}));var n;(function(i){i.method="workspace/foldingRange/refresh",i.messageDirection=e.MessageDirection.serverToClient,i.type=new e.ProtocolRequestType0(i.method)})(n||(t.FoldingRangeRefreshRequest=n={}))}}),vtt=Gr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.declaration.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.DeclarationRequest=void 0;var e=vi(),r;(function(n){n.method="textDocument/declaration",n.messageDirection=e.MessageDirection.clientToServer,n.type=new e.ProtocolRequestType(n.method)})(r||(t.DeclarationRequest=r={}))}}),btt=Gr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.selectionRange.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.SelectionRangeRequest=void 0;var e=vi(),r;(function(n){n.method="textDocument/selectionRange",n.messageDirection=e.MessageDirection.clientToServer,n.type=new e.ProtocolRequestType(n.method)})(r||(t.SelectionRangeRequest=r={}))}}),xtt=Gr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.progress.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.WorkDoneProgressCancelNotification=t.WorkDoneProgressCreateRequest=t.WorkDoneProgress=void 0;var e=Mm(),r=vi(),n;(function(s){s.type=new e.ProgressType;function o(l){return l===s.type}E(o,"is"),s.is=o})(n||(t.WorkDoneProgress=n={}));var i;(function(s){s.method="window/workDoneProgress/create",s.messageDirection=r.MessageDirection.serverToClient,s.type=new r.ProtocolRequestType(s.method)})(i||(t.WorkDoneProgressCreateRequest=i={}));var a;(function(s){s.method="window/workDoneProgress/cancel",s.messageDirection=r.MessageDirection.clientToServer,s.type=new r.ProtocolNotificationType(s.method)})(a||(t.WorkDoneProgressCancelNotification=a={}))}}),Ttt=Gr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.callHierarchy.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.CallHierarchyOutgoingCallsRequest=t.CallHierarchyIncomingCallsRequest=t.CallHierarchyPrepareRequest=void 0;var e=vi(),r;(function(a){a.method="textDocument/prepareCallHierarchy",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(r||(t.CallHierarchyPrepareRequest=r={}));var n;(function(a){a.method="callHierarchy/incomingCalls",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(n||(t.CallHierarchyIncomingCallsRequest=n={}));var i;(function(a){a.method="callHierarchy/outgoingCalls",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(i||(t.CallHierarchyOutgoingCallsRequest=i={}))}}),wtt=Gr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.semanticTokens.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.SemanticTokensRefreshRequest=t.SemanticTokensRangeRequest=t.SemanticTokensDeltaRequest=t.SemanticTokensRequest=t.SemanticTokensRegistrationType=t.TokenFormat=void 0;var e=vi(),r;(function(l){l.Relative="relative"})(r||(t.TokenFormat=r={}));var n;(function(l){l.method="textDocument/semanticTokens",l.type=new e.RegistrationType(l.method)})(n||(t.SemanticTokensRegistrationType=n={}));var i;(function(l){l.method="textDocument/semanticTokens/full",l.messageDirection=e.MessageDirection.clientToServer,l.type=new e.ProtocolRequestType(l.method),l.registrationMethod=n.method})(i||(t.SemanticTokensRequest=i={}));var a;(function(l){l.method="textDocument/semanticTokens/full/delta",l.messageDirection=e.MessageDirection.clientToServer,l.type=new e.ProtocolRequestType(l.method),l.registrationMethod=n.method})(a||(t.SemanticTokensDeltaRequest=a={}));var s;(function(l){l.method="textDocument/semanticTokens/range",l.messageDirection=e.MessageDirection.clientToServer,l.type=new e.ProtocolRequestType(l.method),l.registrationMethod=n.method})(s||(t.SemanticTokensRangeRequest=s={}));var o;(function(l){l.method="workspace/semanticTokens/refresh",l.messageDirection=e.MessageDirection.serverToClient,l.type=new e.ProtocolRequestType0(l.method)})(o||(t.SemanticTokensRefreshRequest=o={}))}}),Ctt=Gr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.showDocument.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ShowDocumentRequest=void 0;var e=vi(),r;(function(n){n.method="window/showDocument",n.messageDirection=e.MessageDirection.serverToClient,n.type=new e.ProtocolRequestType(n.method)})(r||(t.ShowDocumentRequest=r={}))}}),ktt=Gr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.linkedEditingRange.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.LinkedEditingRangeRequest=void 0;var e=vi(),r;(function(n){n.method="textDocument/linkedEditingRange",n.messageDirection=e.MessageDirection.clientToServer,n.type=new e.ProtocolRequestType(n.method)})(r||(t.LinkedEditingRangeRequest=r={}))}}),Ett=Gr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.fileOperations.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.WillDeleteFilesRequest=t.DidDeleteFilesNotification=t.DidRenameFilesNotification=t.WillRenameFilesRequest=t.DidCreateFilesNotification=t.WillCreateFilesRequest=t.FileOperationPatternKind=void 0;var e=vi(),r;(function(u){u.file="file",u.folder="folder"})(r||(t.FileOperationPatternKind=r={}));var n;(function(u){u.method="workspace/willCreateFiles",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolRequestType(u.method)})(n||(t.WillCreateFilesRequest=n={}));var i;(function(u){u.method="workspace/didCreateFiles",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolNotificationType(u.method)})(i||(t.DidCreateFilesNotification=i={}));var a;(function(u){u.method="workspace/willRenameFiles",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolRequestType(u.method)})(a||(t.WillRenameFilesRequest=a={}));var s;(function(u){u.method="workspace/didRenameFiles",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolNotificationType(u.method)})(s||(t.DidRenameFilesNotification=s={}));var o;(function(u){u.method="workspace/didDeleteFiles",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolNotificationType(u.method)})(o||(t.DidDeleteFilesNotification=o={}));var l;(function(u){u.method="workspace/willDeleteFiles",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolRequestType(u.method)})(l||(t.WillDeleteFilesRequest=l={}))}}),Stt=Gr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.moniker.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.MonikerRequest=t.MonikerKind=t.UniquenessLevel=void 0;var e=vi(),r;(function(a){a.document="document",a.project="project",a.group="group",a.scheme="scheme",a.global="global"})(r||(t.UniquenessLevel=r={}));var n;(function(a){a.$import="import",a.$export="export",a.local="local"})(n||(t.MonikerKind=n={}));var i;(function(a){a.method="textDocument/moniker",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(i||(t.MonikerRequest=i={}))}}),_tt=Gr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.typeHierarchy.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.TypeHierarchySubtypesRequest=t.TypeHierarchySupertypesRequest=t.TypeHierarchyPrepareRequest=void 0;var e=vi(),r;(function(a){a.method="textDocument/prepareTypeHierarchy",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(r||(t.TypeHierarchyPrepareRequest=r={}));var n;(function(a){a.method="typeHierarchy/supertypes",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(n||(t.TypeHierarchySupertypesRequest=n={}));var i;(function(a){a.method="typeHierarchy/subtypes",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(i||(t.TypeHierarchySubtypesRequest=i={}))}}),Att=Gr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.inlineValue.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.InlineValueRefreshRequest=t.InlineValueRequest=void 0;var e=vi(),r;(function(i){i.method="textDocument/inlineValue",i.messageDirection=e.MessageDirection.clientToServer,i.type=new e.ProtocolRequestType(i.method)})(r||(t.InlineValueRequest=r={}));var n;(function(i){i.method="workspace/inlineValue/refresh",i.messageDirection=e.MessageDirection.serverToClient,i.type=new e.ProtocolRequestType0(i.method)})(n||(t.InlineValueRefreshRequest=n={}))}}),Rtt=Gr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.inlayHint.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.InlayHintRefreshRequest=t.InlayHintResolveRequest=t.InlayHintRequest=void 0;var e=vi(),r;(function(a){a.method="textDocument/inlayHint",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(r||(t.InlayHintRequest=r={}));var n;(function(a){a.method="inlayHint/resolve",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(n||(t.InlayHintResolveRequest=n={}));var i;(function(a){a.method="workspace/inlayHint/refresh",a.messageDirection=e.MessageDirection.serverToClient,a.type=new e.ProtocolRequestType0(a.method)})(i||(t.InlayHintRefreshRequest=i={}))}}),Ltt=Gr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.diagnostic.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.DiagnosticRefreshRequest=t.WorkspaceDiagnosticRequest=t.DocumentDiagnosticRequest=t.DocumentDiagnosticReportKind=t.DiagnosticServerCancellationData=void 0;var e=Mm(),r=iO(),n=vi(),i;(function(u){function h(d){const f=d;return f&&r.boolean(f.retriggerRequest)}E(h,"is"),u.is=h})(i||(t.DiagnosticServerCancellationData=i={}));var a;(function(u){u.Full="full",u.Unchanged="unchanged"})(a||(t.DocumentDiagnosticReportKind=a={}));var s;(function(u){u.method="textDocument/diagnostic",u.messageDirection=n.MessageDirection.clientToServer,u.type=new n.ProtocolRequestType(u.method),u.partialResult=new e.ProgressType})(s||(t.DocumentDiagnosticRequest=s={}));var o;(function(u){u.method="workspace/diagnostic",u.messageDirection=n.MessageDirection.clientToServer,u.type=new n.ProtocolRequestType(u.method),u.partialResult=new e.ProgressType})(o||(t.WorkspaceDiagnosticRequest=o={}));var l;(function(u){u.method="workspace/diagnostic/refresh",u.messageDirection=n.MessageDirection.serverToClient,u.type=new n.ProtocolRequestType0(u.method)})(l||(t.DiagnosticRefreshRequest=l={}))}}),Itt=Gr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.notebook.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.DidCloseNotebookDocumentNotification=t.DidSaveNotebookDocumentNotification=t.DidChangeNotebookDocumentNotification=t.NotebookCellArrayChange=t.DidOpenNotebookDocumentNotification=t.NotebookDocumentSyncRegistrationType=t.NotebookDocument=t.NotebookCell=t.ExecutionSummary=t.NotebookCellKind=void 0;var e=(Iw(),t$(TS)),r=iO(),n=vi(),i;(function(g){g.Markup=1,g.Code=2;function m(y){return y===1||y===2}E(m,"is"),g.is=m})(i||(t.NotebookCellKind=i={}));var a;(function(g){function m(x,b){const w={executionOrder:x};return(b===!0||b===!1)&&(w.success=b),w}E(m,"create"),g.create=m;function y(x){const b=x;return r.objectLiteral(b)&&e.uinteger.is(b.executionOrder)&&(b.success===void 0||r.boolean(b.success))}E(y,"is"),g.is=y;function v(x,b){return x===b?!0:x==null||b===null||b===void 0?!1:x.executionOrder===b.executionOrder&&x.success===b.success}E(v,"equals"),g.equals=v})(a||(t.ExecutionSummary=a={}));var s;(function(g){function m(b,w){return{kind:b,document:w}}E(m,"create"),g.create=m;function y(b){const w=b;return r.objectLiteral(w)&&i.is(w.kind)&&e.DocumentUri.is(w.document)&&(w.metadata===void 0||r.objectLiteral(w.metadata))}E(y,"is"),g.is=y;function v(b,w){const C=new Set;return b.document!==w.document&&C.add("document"),b.kind!==w.kind&&C.add("kind"),b.executionSummary!==w.executionSummary&&C.add("executionSummary"),(b.metadata!==void 0||w.metadata!==void 0)&&!x(b.metadata,w.metadata)&&C.add("metadata"),(b.executionSummary!==void 0||w.executionSummary!==void 0)&&!a.equals(b.executionSummary,w.executionSummary)&&C.add("executionSummary"),C}E(v,"diff"),g.diff=v;function x(b,w){if(b===w)return!0;if(b==null||w===null||w===void 0||typeof b!=typeof w||typeof b!="object")return!1;const C=Array.isArray(b),_=Array.isArray(w);if(C!==_)return!1;if(C&&_){if(b.length!==w.length)return!1;for(let k=0;k0}E(Rt,"hasId"),oe.hasId=Rt})(D||(t.StaticRegistrationOptions=D={}));var O;(function(oe){function Rt(ft){const ht=ft;return ht&&(ht.documentSelector===null||z.is(ht.documentSelector))}E(Rt,"is"),oe.is=Rt})(O||(t.TextDocumentRegistrationOptions=O={}));var B;(function(oe){function Rt(ht){const kt=ht;return n.objectLiteral(kt)&&(kt.workDoneProgress===void 0||n.boolean(kt.workDoneProgress))}E(Rt,"is"),oe.is=Rt;function ft(ht){const kt=ht;return kt&&n.boolean(kt.workDoneProgress)}E(ft,"hasWorkDoneProgress"),oe.hasWorkDoneProgress=ft})(B||(t.WorkDoneProgressOptions=B={}));var P;(function(oe){oe.method="initialize",oe.messageDirection=e.MessageDirection.clientToServer,oe.type=new e.ProtocolRequestType(oe.method)})(P||(t.InitializeRequest=P={}));var G;(function(oe){oe.unknownProtocolVersion=1})(G||(t.InitializeErrorCodes=G={}));var V;(function(oe){oe.method="initialized",oe.messageDirection=e.MessageDirection.clientToServer,oe.type=new e.ProtocolNotificationType(oe.method)})(V||(t.InitializedNotification=V={}));var H;(function(oe){oe.method="shutdown",oe.messageDirection=e.MessageDirection.clientToServer,oe.type=new e.ProtocolRequestType0(oe.method)})(H||(t.ShutdownRequest=H={}));var W;(function(oe){oe.method="exit",oe.messageDirection=e.MessageDirection.clientToServer,oe.type=new e.ProtocolNotificationType0(oe.method)})(W||(t.ExitNotification=W={}));var ie;(function(oe){oe.method="workspace/didChangeConfiguration",oe.messageDirection=e.MessageDirection.clientToServer,oe.type=new e.ProtocolNotificationType(oe.method)})(ie||(t.DidChangeConfigurationNotification=ie={}));var j;(function(oe){oe.Error=1,oe.Warning=2,oe.Info=3,oe.Log=4,oe.Debug=5})(j||(t.MessageType=j={}));var ae;(function(oe){oe.method="window/showMessage",oe.messageDirection=e.MessageDirection.serverToClient,oe.type=new e.ProtocolNotificationType(oe.method)})(ae||(t.ShowMessageNotification=ae={}));var J;(function(oe){oe.method="window/showMessageRequest",oe.messageDirection=e.MessageDirection.serverToClient,oe.type=new e.ProtocolRequestType(oe.method)})(J||(t.ShowMessageRequest=J={}));var K;(function(oe){oe.method="window/logMessage",oe.messageDirection=e.MessageDirection.serverToClient,oe.type=new e.ProtocolNotificationType(oe.method)})(K||(t.LogMessageNotification=K={}));var Q;(function(oe){oe.method="telemetry/event",oe.messageDirection=e.MessageDirection.serverToClient,oe.type=new e.ProtocolNotificationType(oe.method)})(Q||(t.TelemetryEventNotification=Q={}));var re;(function(oe){oe.None=0,oe.Full=1,oe.Incremental=2})(re||(t.TextDocumentSyncKind=re={}));var le;(function(oe){oe.method="textDocument/didOpen",oe.messageDirection=e.MessageDirection.clientToServer,oe.type=new e.ProtocolNotificationType(oe.method)})(le||(t.DidOpenTextDocumentNotification=le={}));var fe;(function(oe){function Rt(ht){let kt=ht;return kt!=null&&typeof kt.text=="string"&&kt.range!==void 0&&(kt.rangeLength===void 0||typeof kt.rangeLength=="number")}E(Rt,"isIncremental"),oe.isIncremental=Rt;function ft(ht){let kt=ht;return kt!=null&&typeof kt.text=="string"&&kt.range===void 0&&kt.rangeLength===void 0}E(ft,"isFull"),oe.isFull=ft})(fe||(t.TextDocumentContentChangeEvent=fe={}));var Ae;(function(oe){oe.method="textDocument/didChange",oe.messageDirection=e.MessageDirection.clientToServer,oe.type=new e.ProtocolNotificationType(oe.method)})(Ae||(t.DidChangeTextDocumentNotification=Ae={}));var Se;(function(oe){oe.method="textDocument/didClose",oe.messageDirection=e.MessageDirection.clientToServer,oe.type=new e.ProtocolNotificationType(oe.method)})(Se||(t.DidCloseTextDocumentNotification=Se={}));var Ne;(function(oe){oe.method="textDocument/didSave",oe.messageDirection=e.MessageDirection.clientToServer,oe.type=new e.ProtocolNotificationType(oe.method)})(Ne||(t.DidSaveTextDocumentNotification=Ne={}));var ge;(function(oe){oe.Manual=1,oe.AfterDelay=2,oe.FocusOut=3})(ge||(t.TextDocumentSaveReason=ge={}));var ve;(function(oe){oe.method="textDocument/willSave",oe.messageDirection=e.MessageDirection.clientToServer,oe.type=new e.ProtocolNotificationType(oe.method)})(ve||(t.WillSaveTextDocumentNotification=ve={}));var ze;(function(oe){oe.method="textDocument/willSaveWaitUntil",oe.messageDirection=e.MessageDirection.clientToServer,oe.type=new e.ProtocolRequestType(oe.method)})(ze||(t.WillSaveTextDocumentWaitUntilRequest=ze={}));var xe;(function(oe){oe.method="workspace/didChangeWatchedFiles",oe.messageDirection=e.MessageDirection.clientToServer,oe.type=new e.ProtocolNotificationType(oe.method)})(xe||(t.DidChangeWatchedFilesNotification=xe={}));var Ke;(function(oe){oe.Created=1,oe.Changed=2,oe.Deleted=3})(Ke||(t.FileChangeType=Ke={}));var Ce;(function(oe){function Rt(ft){const ht=ft;return n.objectLiteral(ht)&&(r.URI.is(ht.baseUri)||r.WorkspaceFolder.is(ht.baseUri))&&n.string(ht.pattern)}E(Rt,"is"),oe.is=Rt})(Ce||(t.RelativePattern=Ce={}));var Ve;(function(oe){oe.Create=1,oe.Change=2,oe.Delete=4})(Ve||(t.WatchKind=Ve={}));var Qe;(function(oe){oe.method="textDocument/publishDiagnostics",oe.messageDirection=e.MessageDirection.serverToClient,oe.type=new e.ProtocolNotificationType(oe.method)})(Qe||(t.PublishDiagnosticsNotification=Qe={}));var nt;(function(oe){oe.Invoked=1,oe.TriggerCharacter=2,oe.TriggerForIncompleteCompletions=3})(nt||(t.CompletionTriggerKind=nt={}));var tt;(function(oe){oe.method="textDocument/completion",oe.messageDirection=e.MessageDirection.clientToServer,oe.type=new e.ProtocolRequestType(oe.method)})(tt||(t.CompletionRequest=tt={}));var Ze;(function(oe){oe.method="completionItem/resolve",oe.messageDirection=e.MessageDirection.clientToServer,oe.type=new e.ProtocolRequestType(oe.method)})(Ze||(t.CompletionResolveRequest=Ze={}));var ke;(function(oe){oe.method="textDocument/hover",oe.messageDirection=e.MessageDirection.clientToServer,oe.type=new e.ProtocolRequestType(oe.method)})(ke||(t.HoverRequest=ke={}));var _e;(function(oe){oe.Invoked=1,oe.TriggerCharacter=2,oe.ContentChange=3})(_e||(t.SignatureHelpTriggerKind=_e={}));var Y;(function(oe){oe.method="textDocument/signatureHelp",oe.messageDirection=e.MessageDirection.clientToServer,oe.type=new e.ProtocolRequestType(oe.method)})(Y||(t.SignatureHelpRequest=Y={}));var he;(function(oe){oe.method="textDocument/definition",oe.messageDirection=e.MessageDirection.clientToServer,oe.type=new e.ProtocolRequestType(oe.method)})(he||(t.DefinitionRequest=he={}));var Z;(function(oe){oe.method="textDocument/references",oe.messageDirection=e.MessageDirection.clientToServer,oe.type=new e.ProtocolRequestType(oe.method)})(Z||(t.ReferencesRequest=Z={}));var pe;(function(oe){oe.method="textDocument/documentHighlight",oe.messageDirection=e.MessageDirection.clientToServer,oe.type=new e.ProtocolRequestType(oe.method)})(pe||(t.DocumentHighlightRequest=pe={}));var ne;(function(oe){oe.method="textDocument/documentSymbol",oe.messageDirection=e.MessageDirection.clientToServer,oe.type=new e.ProtocolRequestType(oe.method)})(ne||(t.DocumentSymbolRequest=ne={}));var Be;(function(oe){oe.method="textDocument/codeAction",oe.messageDirection=e.MessageDirection.clientToServer,oe.type=new e.ProtocolRequestType(oe.method)})(Be||(t.CodeActionRequest=Be={}));var Te;(function(oe){oe.method="codeAction/resolve",oe.messageDirection=e.MessageDirection.clientToServer,oe.type=new e.ProtocolRequestType(oe.method)})(Te||(t.CodeActionResolveRequest=Te={}));var Ue;(function(oe){oe.method="workspace/symbol",oe.messageDirection=e.MessageDirection.clientToServer,oe.type=new e.ProtocolRequestType(oe.method)})(Ue||(t.WorkspaceSymbolRequest=Ue={}));var De;(function(oe){oe.method="workspaceSymbol/resolve",oe.messageDirection=e.MessageDirection.clientToServer,oe.type=new e.ProtocolRequestType(oe.method)})(De||(t.WorkspaceSymbolResolveRequest=De={}));var qe;(function(oe){oe.method="textDocument/codeLens",oe.messageDirection=e.MessageDirection.clientToServer,oe.type=new e.ProtocolRequestType(oe.method)})(qe||(t.CodeLensRequest=qe={}));var Le;(function(oe){oe.method="codeLens/resolve",oe.messageDirection=e.MessageDirection.clientToServer,oe.type=new e.ProtocolRequestType(oe.method)})(Le||(t.CodeLensResolveRequest=Le={}));var Xe;(function(oe){oe.method="workspace/codeLens/refresh",oe.messageDirection=e.MessageDirection.serverToClient,oe.type=new e.ProtocolRequestType0(oe.method)})(Xe||(t.CodeLensRefreshRequest=Xe={}));var Ie;(function(oe){oe.method="textDocument/documentLink",oe.messageDirection=e.MessageDirection.clientToServer,oe.type=new e.ProtocolRequestType(oe.method)})(Ie||(t.DocumentLinkRequest=Ie={}));var it;(function(oe){oe.method="documentLink/resolve",oe.messageDirection=e.MessageDirection.clientToServer,oe.type=new e.ProtocolRequestType(oe.method)})(it||(t.DocumentLinkResolveRequest=it={}));var we;(function(oe){oe.method="textDocument/formatting",oe.messageDirection=e.MessageDirection.clientToServer,oe.type=new e.ProtocolRequestType(oe.method)})(we||(t.DocumentFormattingRequest=we={}));var ct;(function(oe){oe.method="textDocument/rangeFormatting",oe.messageDirection=e.MessageDirection.clientToServer,oe.type=new e.ProtocolRequestType(oe.method)})(ct||(t.DocumentRangeFormattingRequest=ct={}));var be;(function(oe){oe.method="textDocument/rangesFormatting",oe.messageDirection=e.MessageDirection.clientToServer,oe.type=new e.ProtocolRequestType(oe.method)})(be||(t.DocumentRangesFormattingRequest=be={}));var _t;(function(oe){oe.method="textDocument/onTypeFormatting",oe.messageDirection=e.MessageDirection.clientToServer,oe.type=new e.ProtocolRequestType(oe.method)})(_t||(t.DocumentOnTypeFormattingRequest=_t={}));var bt;(function(oe){oe.Identifier=1})(bt||(t.PrepareSupportDefaultBehavior=bt={}));var lt;(function(oe){oe.method="textDocument/rename",oe.messageDirection=e.MessageDirection.clientToServer,oe.type=new e.ProtocolRequestType(oe.method)})(lt||(t.RenameRequest=lt={}));var Mt;(function(oe){oe.method="textDocument/prepareRename",oe.messageDirection=e.MessageDirection.clientToServer,oe.type=new e.ProtocolRequestType(oe.method)})(Mt||(t.PrepareRenameRequest=Mt={}));var Tt;(function(oe){oe.method="workspace/executeCommand",oe.messageDirection=e.MessageDirection.clientToServer,oe.type=new e.ProtocolRequestType(oe.method)})(Tt||(t.ExecuteCommandRequest=Tt={}));var dt;(function(oe){oe.method="workspace/applyEdit",oe.messageDirection=e.MessageDirection.serverToClient,oe.type=new e.ProtocolRequestType("workspace/applyEdit")})(dt||(t.ApplyWorkspaceEditRequest=dt={}))}}),Ntt=Gr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/connection.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.createProtocolConnection=void 0;var e=Mm();function r(n,i,a,s){return e.ConnectionStrategy.is(s)&&(s={connectionStrategy:s}),(0,e.createMessageConnection)(n,i,a,s)}E(r,"createProtocolConnection"),t.createProtocolConnection=r}}),$tt=Gr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/api.js"(t){var e=t&&t.__createBinding||(Object.create?(function(a,s,o,l){l===void 0&&(l=o);var u=Object.getOwnPropertyDescriptor(s,o);(!u||("get"in u?!s.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:E(function(){return s[o]},"get")}),Object.defineProperty(a,l,u)}):(function(a,s,o,l){l===void 0&&(l=o),a[l]=s[o]})),r=t&&t.__exportStar||function(a,s){for(var o in a)o!=="default"&&!Object.prototype.hasOwnProperty.call(s,o)&&e(s,a,o)};Object.defineProperty(t,"__esModule",{value:!0}),t.LSPErrorCodes=t.createProtocolConnection=void 0,r(Mm(),t),r((Iw(),t$(TS)),t),r(vi(),t),r(Mtt(),t);var n=Ntt();Object.defineProperty(t,"createProtocolConnection",{enumerable:!0,get:E(function(){return n.createProtocolConnection},"get")});var i;(function(a){a.lspReservedErrorRangeStart=-32899,a.RequestFailed=-32803,a.ServerCancelled=-32802,a.ContentModified=-32801,a.RequestCancelled=-32800,a.lspReservedErrorRangeEnd=-32800})(i||(t.LSPErrorCodes=i={}))}}),Ott=Gr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/browser/main.js"(t){var e=t&&t.__createBinding||(Object.create?(function(a,s,o,l){l===void 0&&(l=o);var u=Object.getOwnPropertyDescriptor(s,o);(!u||("get"in u?!s.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:E(function(){return s[o]},"get")}),Object.defineProperty(a,l,u)}):(function(a,s,o,l){l===void 0&&(l=o),a[l]=s[o]})),r=t&&t.__exportStar||function(a,s){for(var o in a)o!=="default"&&!Object.prototype.hasOwnProperty.call(s,o)&&e(s,a,o)};Object.defineProperty(t,"__esModule",{value:!0}),t.createProtocolConnection=void 0;var n=ice();r(ice(),t),r($tt(),t);function i(a,s,o,l){return(0,n.createMessageConnection)(a,s,o,l)}E(i,"createProtocolConnection"),t.createProtocolConnection=i}}),ace={};gd(ace,{AbstractAstReflection:()=>oO,AbstractCstNode:()=>UB,AbstractLangiumParser:()=>YB,AbstractParserErrorMessageProvider:()=>dve,AbstractThreadedAsyncParser:()=>sft,AstUtils:()=>lO,BiMap:()=>I6,Cancellation:()=>Vn,CompositeCstNodeImpl:()=>b6,ContextCache:()=>M6,CstNodeBuilder:()=>lve,CstUtils:()=>aO,DEFAULT_TOKENIZE_OPTIONS:()=>pF,DONE_RESULT:()=>Is,DatatypeSymbol:()=>x6,DefaultAstNodeDescriptionProvider:()=>Vve,DefaultAstNodeLocator:()=>Uve,DefaultAsyncParser:()=>h2e,DefaultCommentProvider:()=>u2e,DefaultConfigurationProvider:()=>Hve,DefaultDocumentBuilder:()=>Yve,DefaultDocumentValidator:()=>qve,DefaultHydrator:()=>f2e,DefaultIndexManager:()=>Xve,DefaultJsonSerializer:()=>Bve,DefaultLangiumDocumentFactory:()=>Rve,DefaultLangiumDocuments:()=>Lve,DefaultLangiumProfiler:()=>hft,DefaultLexer:()=>gF,DefaultLexerErrorMessageProvider:()=>Kve,DefaultLinker:()=>Ive,DefaultNameProvider:()=>Dve,DefaultReferenceDescriptionProvider:()=>Wve,DefaultReferences:()=>Mve,DefaultScopeComputation:()=>Nve,DefaultScopeProvider:()=>Pve,DefaultServiceRegistry:()=>Fve,DefaultTokenBuilder:()=>E6,DefaultValueConverter:()=>eF,DefaultWorkspaceLock:()=>d2e,DefaultWorkspaceManager:()=>jve,Deferred:()=>ih,Disposable:()=>t0,DisposableCache:()=>D6,DocumentCache:()=>Ove,DocumentState:()=>jr,DocumentValidator:()=>ol,EMPTY_SCOPE:()=>rft,EMPTY_STREAM:()=>Nm,EmptyFileSystem:()=>Wa,EmptyFileSystemProvider:()=>y2e,ErrorWithLocation:()=>t_,GrammarAST:()=>lce,GrammarUtils:()=>FO,IndentationAwareLexer:()=>lft,IndentationAwareTokenBuilder:()=>m2e,JSDocDocumentationProvider:()=>c2e,LangiumCompletionParser:()=>fve,LangiumParser:()=>hve,LangiumParserErrorMessageProvider:()=>XB,LeafCstNodeImpl:()=>v6,LexingMode:()=>r0,MapScope:()=>tft,Module:()=>EF,MultiMap:()=>ah,MultiMapScope:()=>$ve,OperationCancelled:()=>qc,ParserWorker:()=>oft,ProfilingTask:()=>b2e,Reduction:()=>Nw,RefResolving:()=>Jp,RegExpUtils:()=>GO,RootCstNodeImpl:()=>HB,SimpleCache:()=>lF,StreamImpl:()=>Dc,StreamScope:()=>oF,TextDocument:()=>R6,TreeStreamImpl:()=>$m,URI:()=>Oo,UriTrie:()=>aF,UriUtils:()=>Bs,VALIDATE_EACH_NODE:()=>Gve,ValidationCategory:()=>N6,ValidationRegistry:()=>zve,ValueConverter:()=>Gc,WorkspaceCache:()=>cF,assertCondition:()=>zO,assertUnreachable:()=>wd,createCompletionParser:()=>ZB,createDefaultCoreModule:()=>Sa,createDefaultSharedCoreModule:()=>_a,createGrammarConfig:()=>sP,createLangiumParser:()=>QB,createParser:()=>w6,delayNextTick:()=>S6,diagnosticData:()=>e0,eagerLoad:()=>SF,getDiagnosticRange:()=>dF,indentationBuilderDefaultOptions:()=>RF,inject:()=>nn,interruptAndCheck:()=>Ea,isAstNode:()=>ea,isAstNodeDescription:()=>sO,isAstNodeWithComment:()=>uF,isCompositeCstNode:()=>Vu,isIMultiModeLexerDefinition:()=>B6,isJSDoc:()=>yF,isLeafCstNode:()=>dp,isLinkingError:()=>hp,isMultiReference:()=>Ic,isNamed:()=>sF,isOperationCancelled:()=>Qp,isReference:()=>Ls,isRootCstNode:()=>LS,isTokenTypeArray:()=>P6,isTokenTypeDictionary:()=>F6,loadGrammarFromJson:()=>Aa,parseJSDoc:()=>mF,prepareLangiumParser:()=>JB,setInterruptionPeriod:()=>tF,startCancelableOperation:()=>A6,stream:()=>En,toDiagnosticData:()=>fF,toDiagnosticSeverity:()=>OC});var aO={};gd(aO,{DefaultNameRegexp:()=>MO,RangeComparison:()=>Nc,compareRange:()=>IO,findCommentNode:()=>NO,findDeclarationNodeAtOffset:()=>_ce,findLeafNodeAtOffset:()=>e_,findLeafNodeBeforeOffset:()=>$O,flattenCst:()=>Sce,getDatatypeNode:()=>Ece,getInteriorNodes:()=>Lce,getNextNode:()=>Ace,getPreviousNode:()=>PO,getStartlineNode:()=>Rce,inRange:()=>DO,isChildNode:()=>LO,isCommentNode:()=>JS,streamCst:()=>Ym,toDocumentSegment:()=>Xm,tokenToRange:()=>Uw});function ea(t){return typeof t=="object"&&t!==null&&typeof t.$type=="string"}E(ea,"isAstNode");function Ls(t){return typeof t=="object"&&t!==null&&typeof t.$refText=="string"&&"ref"in t}E(Ls,"isReference");function Ic(t){return typeof t=="object"&&t!==null&&typeof t.$refText=="string"&&"items"in t}E(Ic,"isMultiReference");function sO(t){return typeof t=="object"&&t!==null&&typeof t.name=="string"&&typeof t.type=="string"&&typeof t.path=="string"}E(sO,"isAstNodeDescription");function hp(t){return typeof t=="object"&&t!==null&&typeof t.info=="object"&&typeof t.message=="string"}E(hp,"isLinkingError");var oO=(fy=class{constructor(){this.subtypes={},this.allSubtypes={}}getAllTypes(){return Object.keys(this.types)}getReferenceType(e){var i;const r=this.types[e.container.$type];if(!r)throw new Error(`Type ${e.container.$type||"undefined"} not found.`);const n=(i=r.properties[e.property])==null?void 0:i.referenceType;if(!n)throw new Error(`Property ${e.property||"undefined"} of type ${e.container.$type} is not a reference.`);return n}getTypeMetaData(e){const r=this.types[e];return r||{name:e,properties:{},superTypes:[]}}isInstance(e,r){return ea(e)&&this.isSubtype(e.$type,r)}isSubtype(e,r){if(e===r)return!0;let n=this.subtypes[e];n||(n=this.subtypes[e]={});const i=n[r];if(i!==void 0)return i;{const a=this.types[e],s=a?a.superTypes.some(o=>this.isSubtype(o,r)):!1;return n[r]=s,s}}getAllSubTypes(e){const r=this.allSubtypes[e];if(r)return r;{const n=this.getAllTypes(),i=[];for(const a of n)this.isSubtype(a,e)&&i.push(a);return this.allSubtypes[e]=i,i}}},E(fy,"AbstractAstReflection"),fy);function Vu(t){return typeof t=="object"&&t!==null&&Array.isArray(t.content)}E(Vu,"isCompositeCstNode");function dp(t){return typeof t=="object"&&t!==null&&typeof t.tokenType=="object"}E(dp,"isLeafCstNode");function LS(t){return Vu(t)&&typeof t.fullText=="string"}E(LS,"isRootCstNode");var Dc=(fo=class{constructor(e,r){this.startFn=e,this.nextFn=r}iterator(){const e={state:this.startFn(),next:E(()=>this.nextFn(e.state),"next"),[Symbol.iterator]:()=>e};return e}[Symbol.iterator](){return this.iterator()}isEmpty(){return!!this.iterator().next().done}count(){const e=this.iterator();let r=0,n=e.next();for(;!n.done;)r++,n=e.next();return r}toArray(){const e=[],r=this.iterator();let n;do n=r.next(),n.value!==void 0&&e.push(n.value);while(!n.done);return e}toSet(){return new Set(this)}toMap(e,r){const n=this.map(i=>[e?e(i):i,r?r(i):i]);return new Map(n)}toString(){return this.join()}concat(e){return new fo(()=>({first:this.startFn(),firstDone:!1,iterator:e[Symbol.iterator]()}),r=>{let n;if(!r.firstDone){do if(n=this.nextFn(r.first),!n.done)return n;while(!n.done);r.firstDone=!0}do if(n=r.iterator.next(),!n.done)return n;while(!n.done);return Is})}join(e=","){const r=this.iterator();let n="",i,a=!1;do i=r.next(),i.done||(a&&(n+=e),n+=sce(i.value)),a=!0;while(!i.done);return n}indexOf(e,r=0){const n=this.iterator();let i=0,a=n.next();for(;!a.done;){if(i>=r&&a.value===e)return i;a=n.next(),i++}return-1}every(e){const r=this.iterator();let n=r.next();for(;!n.done;){if(!e(n.value))return!1;n=r.next()}return!0}some(e){const r=this.iterator();let n=r.next();for(;!n.done;){if(e(n.value))return!0;n=r.next()}return!1}forEach(e){const r=this.iterator();let n=0,i=r.next();for(;!i.done;)e(i.value,n),i=r.next(),n++}map(e){return new fo(this.startFn,r=>{const{done:n,value:i}=this.nextFn(r);return n?Is:{done:!1,value:e(i)}})}filter(e){return new fo(this.startFn,r=>{let n;do if(n=this.nextFn(r),!n.done&&e(n.value))return n;while(!n.done);return Is})}nonNullable(){return this.filter(e=>e!=null)}reduce(e,r){const n=this.iterator();let i=r,a=n.next();for(;!a.done;)i===void 0?i=a.value:i=e(i,a.value),a=n.next();return i}reduceRight(e,r){return this.recursiveReduce(this.iterator(),e,r)}recursiveReduce(e,r,n){const i=e.next();if(i.done)return n;const a=this.recursiveReduce(e,r,n);return a===void 0?i.value:r(a,i.value)}find(e){const r=this.iterator();let n=r.next();for(;!n.done;){if(e(n.value))return n.value;n=r.next()}}findIndex(e){const r=this.iterator();let n=0,i=r.next();for(;!i.done;){if(e(i.value))return n;i=r.next(),n++}return-1}includes(e){const r=this.iterator();let n=r.next();for(;!n.done;){if(n.value===e)return!0;n=r.next()}return!1}flatMap(e){return new fo(()=>({this:this.startFn()}),r=>{do{if(r.iterator){const a=r.iterator.next();if(a.done)r.iterator=void 0;else return a}const{done:n,value:i}=this.nextFn(r.this);if(!n){const a=e(i);if(Mw(a))r.iterator=a[Symbol.iterator]();else return{done:!1,value:a}}}while(r.iterator);return Is})}flat(e){if(e===void 0&&(e=1),e<=0)return this;const r=e>1?this.flat(e-1):this;return new fo(()=>({this:r.startFn()}),n=>{do{if(n.iterator){const s=n.iterator.next();if(s.done)n.iterator=void 0;else return s}const{done:i,value:a}=r.nextFn(n.this);if(!i)if(Mw(a))n.iterator=a[Symbol.iterator]();else return{done:!1,value:a}}while(n.iterator);return Is})}head(){const r=this.iterator().next();if(!r.done)return r.value}tail(e=1){return new fo(()=>{const r=this.startFn();for(let n=0;n({size:0,state:this.startFn()}),r=>(r.size++,r.size>e?Is:this.nextFn(r.state)))}distinct(e){return new fo(()=>({set:new Set,internalState:this.startFn()}),r=>{let n;do if(n=this.nextFn(r.internalState),!n.done){const i=e?e(n.value):n.value;if(!r.set.has(i))return r.set.add(i),n}while(!n.done);return Is})}exclude(e,r){const n=new Set;for(const i of e){const a=r?r(i):i;n.add(a)}return this.filter(i=>{const a=r?r(i):i;return!n.has(a)})}},E(fo,"StreamImpl"),fo);function sce(t){return typeof t=="string"?t:typeof t>"u"?"undefined":typeof t.toString=="function"?t.toString():Object.prototype.toString.call(t)}E(sce,"toString");function Mw(t){return!!t&&typeof t[Symbol.iterator]=="function"}E(Mw,"isIterable");var Nm=new Dc(()=>{},()=>Is),Is=Object.freeze({done:!0,value:void 0});function En(...t){if(t.length===1){const e=t[0];if(e instanceof Dc)return e;if(Mw(e))return new Dc(()=>e[Symbol.iterator](),r=>r.next());if(typeof e.length=="number")return new Dc(()=>({index:0}),r=>r.index1?new Dc(()=>({collIndex:0,arrIndex:0}),e=>{do{if(e.iterator){const r=e.iterator.next();if(!r.done)return r;e.iterator=void 0}if(e.array){if(e.arrIndex({iterators:n!=null&&n.includeRoot?[[e][Symbol.iterator]()]:[r(e)[Symbol.iterator]()],pruned:!1}),i=>{for(i.pruned&&(i.iterators.pop(),i.pruned=!1);i.iterators.length>0;){const s=i.iterators[i.iterators.length-1].next();if(s.done)i.iterators.pop();else return i.iterators.push(r(s.value)[Symbol.iterator]()),s}return Is})}iterator(){const e={state:this.startFn(),next:E(()=>this.nextFn(e.state),"next"),prune:E(()=>{e.state.pruned=!0},"prune"),[Symbol.iterator]:()=>e};return e}},E(py,"TreeStreamImpl"),py),Nw;(function(t){function e(a){return a.reduce((s,o)=>s+o,0)}E(e,"sum"),t.sum=e;function r(a){return a.reduce((s,o)=>s*o,0)}E(r,"product"),t.product=r;function n(a){return a.reduce((s,o)=>Math.min(s,o))}E(n,"min"),t.min=n;function i(a){return a.reduce((s,o)=>Math.max(s,o))}E(i,"max"),t.max=i})(Nw||(Nw={}));var lO={};gd(lO,{assignMandatoryProperties:()=>cO,copyAstNode:()=>MS,findRootNode:()=>Pm,getContainerOfType:()=>fp,getDocument:()=>Al,getReferenceNodes:()=>IS,hasContainerOfType:()=>oce,linkContentToContainer:()=>Om,streamAllContents:()=>Wu,streamAst:()=>Rl,streamContents:()=>$w,streamReferences:()=>Bm});function Om(t,e={}){for(const[r,n]of Object.entries(t))r.startsWith("$")||(Array.isArray(n)?n.forEach((i,a)=>{ea(i)&&(i.$container=t,i.$containerProperty=r,i.$containerIndex=a,e.deep&&Om(i,e))}):ea(n)&&(n.$container=t,n.$containerProperty=r,e.deep&&Om(n,e)))}E(Om,"linkContentToContainer");function fp(t,e){let r=t;for(;r;){if(e(r))return r;r=r.$container}}E(fp,"getContainerOfType");function oce(t,e){let r=t;for(;r;){if(e(r))return!0;r=r.$container}return!1}E(oce,"hasContainerOfType");function Al(t){const r=Pm(t).$document;if(!r)throw new Error("AST node has no document.");return r}E(Al,"getDocument");function Pm(t){for(;t.$container;)t=t.$container;return t}E(Pm,"findRootNode");function IS(t){return Ls(t)?t.ref?[t.ref]:[]:Ic(t)?t.items.map(e=>e.ref):[]}E(IS,"getReferenceNodes");function $w(t,e){if(!t)throw new Error("Node must be an AstNode.");const r=e==null?void 0:e.range;return new Dc(()=>({keys:Object.keys(t),keyIndex:0,arrayIndex:0}),n=>{for(;n.keyIndex$w(r,e))}E(Wu,"streamAllContents");function Rl(t,e){if(t){if(e!=null&&e.range&&!DS(t,e.range))return new $m(t,()=>[])}else throw new Error("Root node must be an AstNode.");return new $m(t,r=>$w(r,e),{includeRoot:!0})}E(Rl,"streamAst");function DS(t,e){var n;if(!e)return!0;const r=(n=t.$cstNode)==null?void 0:n.range;return r?DO(r,e):!1}E(DS,"isAstNodeInRange");function Bm(t){return new Dc(()=>({keys:Object.keys(t),keyIndex:0,arrayIndex:0}),e=>{for(;e.keyIndexro,AbstractParserRule:()=>Ow,AbstractRule:()=>Fm,AbstractType:()=>Lo,Action:()=>md,Alternatives:()=>Pw,ArrayLiteral:()=>OS,ArrayType:()=>PS,Assignment:()=>vd,BooleanLiteral:()=>BS,CharacterRange:()=>bd,Condition:()=>xd,Conjunction:()=>Bw,CrossReference:()=>Td,Disjunction:()=>Fw,EndOfFile:()=>FS,Grammar:()=>Hu,GrammarImport:()=>zS,Group:()=>mp,InferredType:()=>GS,InfixRule:()=>Mc,InfixRuleOperatorList:()=>Gw,InfixRuleOperators:()=>qS,Interface:()=>Gm,Keyword:()=>qm,LangiumGrammarAstReflection:()=>RO,LangiumGrammarTerminals:()=>Ptt,NamedArgument:()=>Vm,NegatedToken:()=>vp,Negation:()=>VS,NumberLiteral:()=>WS,Parameter:()=>Wm,ParameterReference:()=>US,ParserRule:()=>Ll,ReferenceType:()=>qw,RegexToken:()=>bp,ReturnType:()=>HS,RuleCall:()=>xp,SimpleType:()=>Um,StringLiteral:()=>XS,TerminalAlternatives:()=>Tp,TerminalElement:()=>no,TerminalGroup:()=>wp,TerminalRule:()=>ju,TerminalRuleCall:()=>Cp,Type:()=>Vw,TypeAttribute:()=>kp,TypeDefinition:()=>Ep,UnionType:()=>ZS,UnorderedGroup:()=>Ww,UntilToken:()=>Sp,ValueLiteral:()=>_p,Wildcard:()=>Hm,isAbstractElement:()=>NS,isAbstractParserRule:()=>pp,isAbstractRule:()=>cce,isAbstractType:()=>uce,isAction:()=>yd,isAlternatives:()=>$S,isArrayLiteral:()=>hce,isArrayType:()=>hO,isAssignment:()=>Uu,isBooleanLiteral:()=>dO,isCharacterRange:()=>fO,isCondition:()=>dce,isConjunction:()=>pO,isCrossReference:()=>gp,isDisjunction:()=>gO,isEndOfFile:()=>mO,isGrammar:()=>fce,isGrammarImport:()=>pce,isGroup:()=>yp,isInferredType:()=>zw,isInfixRule:()=>zm,isInfixRuleOperatorList:()=>gce,isInfixRuleOperators:()=>mce,isInterface:()=>yO,isKeyword:()=>Yu,isNamedArgument:()=>yce,isNegatedToken:()=>vO,isNegation:()=>bO,isNumberLiteral:()=>vce,isParameter:()=>bce,isParameterReference:()=>xO,isParserRule:()=>Ds,isReferenceType:()=>TO,isRegexToken:()=>wO,isReturnType:()=>CO,isRuleCall:()=>Xu,isSimpleType:()=>YS,isStringLiteral:()=>xce,isTerminalAlternatives:()=>kO,isTerminalElement:()=>Tce,isTerminalGroup:()=>EO,isTerminalRule:()=>rl,isTerminalRuleCall:()=>jS,isType:()=>KS,isTypeAttribute:()=>wce,isTypeDefinition:()=>Cce,isUnionType:()=>SO,isUnorderedGroup:()=>QS,isUntilToken:()=>_O,isValueLiteral:()=>kce,isWildcard:()=>AO,reflection:()=>kr});var Ptt={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]*/},ro={$type:"AbstractElement",cardinality:"cardinality"};function NS(t){return kr.isInstance(t,ro.$type)}E(NS,"isAbstractElement");var Ow={$type:"AbstractParserRule"};function pp(t){return kr.isInstance(t,Ow.$type)}E(pp,"isAbstractParserRule");var Fm={$type:"AbstractRule"};function cce(t){return kr.isInstance(t,Fm.$type)}E(cce,"isAbstractRule");var Lo={$type:"AbstractType"};function uce(t){return kr.isInstance(t,Lo.$type)}E(uce,"isAbstractType");var md={$type:"Action",cardinality:"cardinality",feature:"feature",inferredType:"inferredType",operator:"operator",type:"type"};function yd(t){return kr.isInstance(t,md.$type)}E(yd,"isAction");var Pw={$type:"Alternatives",cardinality:"cardinality",elements:"elements"};function $S(t){return kr.isInstance(t,Pw.$type)}E($S,"isAlternatives");var OS={$type:"ArrayLiteral",elements:"elements"};function hce(t){return kr.isInstance(t,OS.$type)}E(hce,"isArrayLiteral");var PS={$type:"ArrayType",elementType:"elementType"};function hO(t){return kr.isInstance(t,PS.$type)}E(hO,"isArrayType");var vd={$type:"Assignment",cardinality:"cardinality",feature:"feature",operator:"operator",predicate:"predicate",terminal:"terminal"};function Uu(t){return kr.isInstance(t,vd.$type)}E(Uu,"isAssignment");var BS={$type:"BooleanLiteral",true:"true"};function dO(t){return kr.isInstance(t,BS.$type)}E(dO,"isBooleanLiteral");var bd={$type:"CharacterRange",cardinality:"cardinality",left:"left",lookahead:"lookahead",parenthesized:"parenthesized",right:"right"};function fO(t){return kr.isInstance(t,bd.$type)}E(fO,"isCharacterRange");var xd={$type:"Condition"};function dce(t){return kr.isInstance(t,xd.$type)}E(dce,"isCondition");var Bw={$type:"Conjunction",left:"left",right:"right"};function pO(t){return kr.isInstance(t,Bw.$type)}E(pO,"isConjunction");var Td={$type:"CrossReference",cardinality:"cardinality",deprecatedSyntax:"deprecatedSyntax",isMulti:"isMulti",terminal:"terminal",type:"type"};function gp(t){return kr.isInstance(t,Td.$type)}E(gp,"isCrossReference");var Fw={$type:"Disjunction",left:"left",right:"right"};function gO(t){return kr.isInstance(t,Fw.$type)}E(gO,"isDisjunction");var FS={$type:"EndOfFile",cardinality:"cardinality"};function mO(t){return kr.isInstance(t,FS.$type)}E(mO,"isEndOfFile");var Hu={$type:"Grammar",imports:"imports",interfaces:"interfaces",isDeclared:"isDeclared",name:"name",rules:"rules",types:"types"};function fce(t){return kr.isInstance(t,Hu.$type)}E(fce,"isGrammar");var zS={$type:"GrammarImport",path:"path"};function pce(t){return kr.isInstance(t,zS.$type)}E(pce,"isGrammarImport");var mp={$type:"Group",cardinality:"cardinality",elements:"elements",guardCondition:"guardCondition",predicate:"predicate"};function yp(t){return kr.isInstance(t,mp.$type)}E(yp,"isGroup");var GS={$type:"InferredType",name:"name"};function zw(t){return kr.isInstance(t,GS.$type)}E(zw,"isInferredType");var Mc={$type:"InfixRule",call:"call",dataType:"dataType",inferredType:"inferredType",name:"name",operators:"operators",parameters:"parameters",returnType:"returnType"};function zm(t){return kr.isInstance(t,Mc.$type)}E(zm,"isInfixRule");var Gw={$type:"InfixRuleOperatorList",associativity:"associativity",operators:"operators"};function gce(t){return kr.isInstance(t,Gw.$type)}E(gce,"isInfixRuleOperatorList");var qS={$type:"InfixRuleOperators",precedences:"precedences"};function mce(t){return kr.isInstance(t,qS.$type)}E(mce,"isInfixRuleOperators");var Gm={$type:"Interface",attributes:"attributes",name:"name",superTypes:"superTypes"};function yO(t){return kr.isInstance(t,Gm.$type)}E(yO,"isInterface");var qm={$type:"Keyword",cardinality:"cardinality",predicate:"predicate",value:"value"};function Yu(t){return kr.isInstance(t,qm.$type)}E(Yu,"isKeyword");var Vm={$type:"NamedArgument",calledByName:"calledByName",parameter:"parameter",value:"value"};function yce(t){return kr.isInstance(t,Vm.$type)}E(yce,"isNamedArgument");var vp={$type:"NegatedToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",terminal:"terminal"};function vO(t){return kr.isInstance(t,vp.$type)}E(vO,"isNegatedToken");var VS={$type:"Negation",value:"value"};function bO(t){return kr.isInstance(t,VS.$type)}E(bO,"isNegation");var WS={$type:"NumberLiteral",value:"value"};function vce(t){return kr.isInstance(t,WS.$type)}E(vce,"isNumberLiteral");var Wm={$type:"Parameter",name:"name"};function bce(t){return kr.isInstance(t,Wm.$type)}E(bce,"isParameter");var US={$type:"ParameterReference",parameter:"parameter"};function xO(t){return kr.isInstance(t,US.$type)}E(xO,"isParameterReference");var Ll={$type:"ParserRule",dataType:"dataType",definition:"definition",entry:"entry",fragment:"fragment",inferredType:"inferredType",name:"name",parameters:"parameters",returnType:"returnType"};function Ds(t){return kr.isInstance(t,Ll.$type)}E(Ds,"isParserRule");var qw={$type:"ReferenceType",isMulti:"isMulti",referenceType:"referenceType"};function TO(t){return kr.isInstance(t,qw.$type)}E(TO,"isReferenceType");var bp={$type:"RegexToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",regex:"regex"};function wO(t){return kr.isInstance(t,bp.$type)}E(wO,"isRegexToken");var HS={$type:"ReturnType",name:"name"};function CO(t){return kr.isInstance(t,HS.$type)}E(CO,"isReturnType");var xp={$type:"RuleCall",arguments:"arguments",cardinality:"cardinality",predicate:"predicate",rule:"rule"};function Xu(t){return kr.isInstance(t,xp.$type)}E(Xu,"isRuleCall");var Um={$type:"SimpleType",primitiveType:"primitiveType",stringType:"stringType",typeRef:"typeRef"};function YS(t){return kr.isInstance(t,Um.$type)}E(YS,"isSimpleType");var XS={$type:"StringLiteral",value:"value"};function xce(t){return kr.isInstance(t,XS.$type)}E(xce,"isStringLiteral");var Tp={$type:"TerminalAlternatives",cardinality:"cardinality",elements:"elements",lookahead:"lookahead",parenthesized:"parenthesized"};function kO(t){return kr.isInstance(t,Tp.$type)}E(kO,"isTerminalAlternatives");var no={$type:"TerminalElement",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized"};function Tce(t){return kr.isInstance(t,no.$type)}E(Tce,"isTerminalElement");var wp={$type:"TerminalGroup",cardinality:"cardinality",elements:"elements",lookahead:"lookahead",parenthesized:"parenthesized"};function EO(t){return kr.isInstance(t,wp.$type)}E(EO,"isTerminalGroup");var ju={$type:"TerminalRule",definition:"definition",fragment:"fragment",hidden:"hidden",name:"name",type:"type"};function rl(t){return kr.isInstance(t,ju.$type)}E(rl,"isTerminalRule");var Cp={$type:"TerminalRuleCall",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",rule:"rule"};function jS(t){return kr.isInstance(t,Cp.$type)}E(jS,"isTerminalRuleCall");var Vw={$type:"Type",name:"name",type:"type"};function KS(t){return kr.isInstance(t,Vw.$type)}E(KS,"isType");var kp={$type:"TypeAttribute",defaultValue:"defaultValue",isOptional:"isOptional",name:"name",type:"type"};function wce(t){return kr.isInstance(t,kp.$type)}E(wce,"isTypeAttribute");var Ep={$type:"TypeDefinition"};function Cce(t){return kr.isInstance(t,Ep.$type)}E(Cce,"isTypeDefinition");var ZS={$type:"UnionType",types:"types"};function SO(t){return kr.isInstance(t,ZS.$type)}E(SO,"isUnionType");var Ww={$type:"UnorderedGroup",cardinality:"cardinality",elements:"elements"};function QS(t){return kr.isInstance(t,Ww.$type)}E(QS,"isUnorderedGroup");var Sp={$type:"UntilToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",terminal:"terminal"};function _O(t){return kr.isInstance(t,Sp.$type)}E(_O,"isUntilToken");var _p={$type:"ValueLiteral"};function kce(t){return kr.isInstance(t,_p.$type)}E(kce,"isValueLiteral");var Hm={$type:"Wildcard",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized"};function AO(t){return kr.isInstance(t,Hm.$type)}E(AO,"isWildcard");var RO=(gy=class extends oO{constructor(){super(...arguments),this.types={AbstractElement:{name:ro.$type,properties:{cardinality:{name:ro.cardinality}},superTypes:[]},AbstractParserRule:{name:Ow.$type,properties:{},superTypes:[Fm.$type,Lo.$type]},AbstractRule:{name:Fm.$type,properties:{},superTypes:[]},AbstractType:{name:Lo.$type,properties:{},superTypes:[]},Action:{name:md.$type,properties:{cardinality:{name:md.cardinality},feature:{name:md.feature},inferredType:{name:md.inferredType},operator:{name:md.operator},type:{name:md.type,referenceType:Lo.$type}},superTypes:[ro.$type]},Alternatives:{name:Pw.$type,properties:{cardinality:{name:Pw.cardinality},elements:{name:Pw.elements,defaultValue:[]}},superTypes:[ro.$type]},ArrayLiteral:{name:OS.$type,properties:{elements:{name:OS.elements,defaultValue:[]}},superTypes:[_p.$type]},ArrayType:{name:PS.$type,properties:{elementType:{name:PS.elementType}},superTypes:[Ep.$type]},Assignment:{name:vd.$type,properties:{cardinality:{name:vd.cardinality},feature:{name:vd.feature},operator:{name:vd.operator},predicate:{name:vd.predicate},terminal:{name:vd.terminal}},superTypes:[ro.$type]},BooleanLiteral:{name:BS.$type,properties:{true:{name:BS.true,defaultValue:!1}},superTypes:[xd.$type,_p.$type]},CharacterRange:{name:bd.$type,properties:{cardinality:{name:bd.cardinality},left:{name:bd.left},lookahead:{name:bd.lookahead},parenthesized:{name:bd.parenthesized,defaultValue:!1},right:{name:bd.right}},superTypes:[no.$type]},Condition:{name:xd.$type,properties:{},superTypes:[]},Conjunction:{name:Bw.$type,properties:{left:{name:Bw.left},right:{name:Bw.right}},superTypes:[xd.$type]},CrossReference:{name:Td.$type,properties:{cardinality:{name:Td.cardinality},deprecatedSyntax:{name:Td.deprecatedSyntax,defaultValue:!1},isMulti:{name:Td.isMulti,defaultValue:!1},terminal:{name:Td.terminal},type:{name:Td.type,referenceType:Lo.$type}},superTypes:[ro.$type]},Disjunction:{name:Fw.$type,properties:{left:{name:Fw.left},right:{name:Fw.right}},superTypes:[xd.$type]},EndOfFile:{name:FS.$type,properties:{cardinality:{name:FS.cardinality}},superTypes:[ro.$type]},Grammar:{name:Hu.$type,properties:{imports:{name:Hu.imports,defaultValue:[]},interfaces:{name:Hu.interfaces,defaultValue:[]},isDeclared:{name:Hu.isDeclared,defaultValue:!1},name:{name:Hu.name},rules:{name:Hu.rules,defaultValue:[]},types:{name:Hu.types,defaultValue:[]}},superTypes:[]},GrammarImport:{name:zS.$type,properties:{path:{name:zS.path}},superTypes:[]},Group:{name:mp.$type,properties:{cardinality:{name:mp.cardinality},elements:{name:mp.elements,defaultValue:[]},guardCondition:{name:mp.guardCondition},predicate:{name:mp.predicate}},superTypes:[ro.$type]},InferredType:{name:GS.$type,properties:{name:{name:GS.name}},superTypes:[Lo.$type]},InfixRule:{name:Mc.$type,properties:{call:{name:Mc.call},dataType:{name:Mc.dataType},inferredType:{name:Mc.inferredType},name:{name:Mc.name},operators:{name:Mc.operators},parameters:{name:Mc.parameters,defaultValue:[]},returnType:{name:Mc.returnType,referenceType:Lo.$type}},superTypes:[Ow.$type]},InfixRuleOperatorList:{name:Gw.$type,properties:{associativity:{name:Gw.associativity},operators:{name:Gw.operators,defaultValue:[]}},superTypes:[]},InfixRuleOperators:{name:qS.$type,properties:{precedences:{name:qS.precedences,defaultValue:[]}},superTypes:[]},Interface:{name:Gm.$type,properties:{attributes:{name:Gm.attributes,defaultValue:[]},name:{name:Gm.name},superTypes:{name:Gm.superTypes,defaultValue:[],referenceType:Lo.$type}},superTypes:[Lo.$type]},Keyword:{name:qm.$type,properties:{cardinality:{name:qm.cardinality},predicate:{name:qm.predicate},value:{name:qm.value}},superTypes:[ro.$type]},NamedArgument:{name:Vm.$type,properties:{calledByName:{name:Vm.calledByName,defaultValue:!1},parameter:{name:Vm.parameter,referenceType:Wm.$type},value:{name:Vm.value}},superTypes:[]},NegatedToken:{name:vp.$type,properties:{cardinality:{name:vp.cardinality},lookahead:{name:vp.lookahead},parenthesized:{name:vp.parenthesized,defaultValue:!1},terminal:{name:vp.terminal}},superTypes:[no.$type]},Negation:{name:VS.$type,properties:{value:{name:VS.value}},superTypes:[xd.$type]},NumberLiteral:{name:WS.$type,properties:{value:{name:WS.value}},superTypes:[_p.$type]},Parameter:{name:Wm.$type,properties:{name:{name:Wm.name}},superTypes:[]},ParameterReference:{name:US.$type,properties:{parameter:{name:US.parameter,referenceType:Wm.$type}},superTypes:[xd.$type]},ParserRule:{name:Ll.$type,properties:{dataType:{name:Ll.dataType},definition:{name:Ll.definition},entry:{name:Ll.entry,defaultValue:!1},fragment:{name:Ll.fragment,defaultValue:!1},inferredType:{name:Ll.inferredType},name:{name:Ll.name},parameters:{name:Ll.parameters,defaultValue:[]},returnType:{name:Ll.returnType,referenceType:Lo.$type}},superTypes:[Ow.$type]},ReferenceType:{name:qw.$type,properties:{isMulti:{name:qw.isMulti,defaultValue:!1},referenceType:{name:qw.referenceType}},superTypes:[Ep.$type]},RegexToken:{name:bp.$type,properties:{cardinality:{name:bp.cardinality},lookahead:{name:bp.lookahead},parenthesized:{name:bp.parenthesized,defaultValue:!1},regex:{name:bp.regex}},superTypes:[no.$type]},ReturnType:{name:HS.$type,properties:{name:{name:HS.name}},superTypes:[]},RuleCall:{name:xp.$type,properties:{arguments:{name:xp.arguments,defaultValue:[]},cardinality:{name:xp.cardinality},predicate:{name:xp.predicate},rule:{name:xp.rule,referenceType:Fm.$type}},superTypes:[ro.$type]},SimpleType:{name:Um.$type,properties:{primitiveType:{name:Um.primitiveType},stringType:{name:Um.stringType},typeRef:{name:Um.typeRef,referenceType:Lo.$type}},superTypes:[Ep.$type]},StringLiteral:{name:XS.$type,properties:{value:{name:XS.value}},superTypes:[_p.$type]},TerminalAlternatives:{name:Tp.$type,properties:{cardinality:{name:Tp.cardinality},elements:{name:Tp.elements,defaultValue:[]},lookahead:{name:Tp.lookahead},parenthesized:{name:Tp.parenthesized,defaultValue:!1}},superTypes:[no.$type]},TerminalElement:{name:no.$type,properties:{cardinality:{name:no.cardinality},lookahead:{name:no.lookahead},parenthesized:{name:no.parenthesized,defaultValue:!1}},superTypes:[ro.$type]},TerminalGroup:{name:wp.$type,properties:{cardinality:{name:wp.cardinality},elements:{name:wp.elements,defaultValue:[]},lookahead:{name:wp.lookahead},parenthesized:{name:wp.parenthesized,defaultValue:!1}},superTypes:[no.$type]},TerminalRule:{name:ju.$type,properties:{definition:{name:ju.definition},fragment:{name:ju.fragment,defaultValue:!1},hidden:{name:ju.hidden,defaultValue:!1},name:{name:ju.name},type:{name:ju.type}},superTypes:[Fm.$type]},TerminalRuleCall:{name:Cp.$type,properties:{cardinality:{name:Cp.cardinality},lookahead:{name:Cp.lookahead},parenthesized:{name:Cp.parenthesized,defaultValue:!1},rule:{name:Cp.rule,referenceType:ju.$type}},superTypes:[no.$type]},Type:{name:Vw.$type,properties:{name:{name:Vw.name},type:{name:Vw.type}},superTypes:[Lo.$type]},TypeAttribute:{name:kp.$type,properties:{defaultValue:{name:kp.defaultValue},isOptional:{name:kp.isOptional,defaultValue:!1},name:{name:kp.name},type:{name:kp.type}},superTypes:[]},TypeDefinition:{name:Ep.$type,properties:{},superTypes:[]},UnionType:{name:ZS.$type,properties:{types:{name:ZS.types,defaultValue:[]}},superTypes:[Ep.$type]},UnorderedGroup:{name:Ww.$type,properties:{cardinality:{name:Ww.cardinality},elements:{name:Ww.elements,defaultValue:[]}},superTypes:[ro.$type]},UntilToken:{name:Sp.$type,properties:{cardinality:{name:Sp.cardinality},lookahead:{name:Sp.lookahead},parenthesized:{name:Sp.parenthesized,defaultValue:!1},terminal:{name:Sp.terminal}},superTypes:[no.$type]},ValueLiteral:{name:_p.$type,properties:{},superTypes:[]},Wildcard:{name:Hm.$type,properties:{cardinality:{name:Hm.cardinality},lookahead:{name:Hm.lookahead},parenthesized:{name:Hm.parenthesized,defaultValue:!1}},superTypes:[no.$type]}}}},E(gy,"LangiumGrammarAstReflection"),gy),kr=new RO;function Ece(t){let e=t,r=!1;for(;e;){const n=fp(e.grammarSource,Ds);if(n&&n.dataType)e=e.container,r=!0;else return r?e:void 0}}E(Ece,"getDatatypeNode");function Ym(t){return new $m(t,e=>Vu(e)?e.content:[],{includeRoot:!0})}E(Ym,"streamCst");function Sce(t){return Ym(t).filter(dp)}E(Sce,"flattenCst");function LO(t,e){for(;t.container;)if(t=t.container,t===e)return!0;return!1}E(LO,"isChildNode");function Uw(t){return{start:{character:t.startColumn-1,line:t.startLine-1},end:{character:t.endColumn,line:t.endLine-1}}}E(Uw,"tokenToRange");function Xm(t){if(!t)return;const{offset:e,end:r,range:n}=t;return{range:n,offset:e,end:r,length:r-e}}E(Xm,"toDocumentSegment");var Nc;(function(t){t[t.Before=0]="Before",t[t.After=1]="After",t[t.OverlapFront=2]="OverlapFront",t[t.OverlapBack=3]="OverlapBack",t[t.Inside=4]="Inside",t[t.Outside=5]="Outside"})(Nc||(Nc={}));function IO(t,e){if(t.end.linee.end.line||t.start.line===e.end.line&&t.start.character>=e.end.character)return Nc.After;const r=t.start.line>e.start.line||t.start.line===e.start.line&&t.start.character>=e.start.character,n=t.end.lineNc.After}E(DO,"inRange");var MO=/^[\w\p{L}]$/u;function _ce(t,e,r=MO){if(t){if(e>0){const n=e-t.offset,i=t.text.charAt(n);r.test(i)||e--}return e_(t,e)}}E(_ce,"findDeclarationNodeAtOffset");function NO(t,e){if(t){const r=PO(t,!0);if(r&&JS(r,e))return r;if(LS(t)){const n=t.content.findIndex(i=>!i.hidden);for(let i=n-1;i>=0;i--){const a=t.content[i];if(JS(a,e))return a}}}}E(NO,"findCommentNode");function JS(t,e){return dp(t)&&e.includes(t.tokenType.name)}E(JS,"isCommentNode");function e_(t,e){if(dp(t))return t;if(Vu(t)){const r=OO(t,e,!1);if(r)return e_(r,e)}}E(e_,"findLeafNodeAtOffset");function $O(t,e){if(dp(t))return t;if(Vu(t)){const r=OO(t,e,!0);if(r)return $O(r,e)}}E($O,"findLeafNodeBeforeOffset");function OO(t,e,r){let n=0,i=t.content.length-1,a;for(;n<=i;){const s=Math.floor((n+i)/2),o=t.content[s];if(o.offset<=e&&o.end>e)return o;o.end<=e?(a=r?o:void 0,n=s+1):i=s-1}return a}E(OO,"binarySearch");function PO(t,e=!0){for(;t.container;){const r=t.container;let n=r.content.indexOf(t);for(;n>0;){n--;const i=r.content[n];if(e||!i.hidden)return i}t=r}}E(PO,"getPreviousNode");function Ace(t,e=!0){for(;t.container;){const r=t.container;let n=r.content.indexOf(t);const i=r.content.length-1;for(;nJO,findNameAssignment:()=>d_,findNodeForKeyword:()=>QO,findNodeForProperty:()=>c_,findNodesForKeyword:()=>zce,findNodesForKeywordInternal:()=>h_,findNodesForProperty:()=>ZO,getActionAtElement:()=>tP,getActionType:()=>nP,getAllReachableRules:()=>l_,getAllRulesUsedForCrossReferences:()=>Fce,getCrossReferenceTerminal:()=>jO,getEntryRule:()=>HO,getExplicitRuleType:()=>Yw,getHiddenRules:()=>YO,getRuleType:()=>iP,getRuleTypeName:()=>Uce,getTypeName:()=>Lp,isArrayCardinality:()=>qce,isArrayOperator:()=>Vce,isCommentTerminal:()=>KO,isDataType:()=>Wce,isDataTypeRule:()=>Hw,isOptionalCardinality:()=>Gce,terminalRegex:()=>Xw});var t_=(my=class extends Error{constructor(e,r){super(e?`${r} at ${e.range.start.line}:${e.range.start.character}`:r)}},E(my,"ErrorWithLocation"),my);function wd(t,e="Error: Got unexpected value."){throw new Error(e)}E(wd,"assertUnreachable");function zO(t,e="Error: Condition is violated."){if(!t)throw new Error(e)}E(zO,"assertCondition");var GO={};gd(GO,{NEWLINE_REGEXP:()=>$ce,escapeRegExp:()=>Km,getTerminalParts:()=>Pce,isMultilineComment:()=>VO,isWhitespace:()=>o_,partialMatches:()=>WO,partialRegExp:()=>UO,whitespaceCharacters:()=>Bce});function Lr(t){return t.charCodeAt(0)}E(Lr,"cc");function r_(t,e){Array.isArray(t)?t.forEach(function(r){e.push(r)}):e.push(t)}E(r_,"insertToSet");function jm(t,e){if(t[e]===!0)throw"duplicate flag "+e;t[e],t[e]=!0}E(jm,"addFlag");function Ap(t){if(t===void 0)throw Error("Internal Error - Should never get here!");return!0}E(Ap,"ASSERT_EXISTS");function Dce(){throw Error("Internal Error - Should never get here!")}E(Dce,"ASSERT_NEVER_REACH_HERE");function qO(t){return t.type==="Character"}E(qO,"isCharacter");var n_=[];for(let t=Lr("0");t<=Lr("9");t++)n_.push(t);var i_=[Lr("_")].concat(n_);for(let t=Lr("a");t<=Lr("z");t++)i_.push(t);for(let t=Lr("A");t<=Lr("Z");t++)i_.push(t);var Mce=[Lr(" "),Lr("\f"),Lr(` +`),Lr("\r"),Lr(" "),Lr("\v"),Lr(" "),Lr(" "),Lr(" "),Lr(" "),Lr(" "),Lr(" "),Lr(" "),Lr(" "),Lr(" "),Lr(" "),Lr(" "),Lr(" "),Lr(" "),Lr(" "),Lr("\u2028"),Lr("\u2029"),Lr(" "),Lr(" "),Lr(" "),Lr("\uFEFF")],Btt=/[0-9a-fA-F]/,a_=/[0-9]/,Ftt=/[1-9]/,Nce=(yy=class{constructor(){this.idx=0,this.input="",this.groupIdx=0}saveState(){return{idx:this.idx,input:this.input,groupIdx:this.groupIdx}}restoreState(e){this.idx=e.idx,this.input=e.input,this.groupIdx=e.groupIdx}pattern(e){this.idx=0,this.input=e,this.groupIdx=0,this.consumeChar("/");const r=this.disjunction();this.consumeChar("/");const n={type:"Flags",loc:{begin:this.idx,end:e.length},global:!1,ignoreCase:!1,multiLine:!1,unicode:!1,sticky:!1};for(;this.isRegExpFlag();)switch(this.popChar()){case"g":jm(n,"global");break;case"i":jm(n,"ignoreCase");break;case"m":jm(n,"multiLine");break;case"u":jm(n,"unicode");break;case"y":jm(n,"sticky");break}if(this.idx!==this.input.length)throw Error("Redundant input: "+this.input.substring(this.idx));return{type:"Pattern",flags:n,value:r,loc:this.loc(0)}}disjunction(){const e=[],r=this.idx;for(e.push(this.alternative());this.peekChar()==="|";)this.consumeChar("|"),e.push(this.alternative());return{type:"Disjunction",value:e,loc:this.loc(r)}}alternative(){const e=[],r=this.idx;for(;this.isTerm();)e.push(this.term());return{type:"Alternative",value:e,loc:this.loc(r)}}term(){return this.isAssertion()?this.assertion():this.atom()}assertion(){const e=this.idx;switch(this.popChar()){case"^":return{type:"StartAnchor",loc:this.loc(e)};case"$":return{type:"EndAnchor",loc:this.loc(e)};case"\\":switch(this.popChar()){case"b":return{type:"WordBoundary",loc:this.loc(e)};case"B":return{type:"NonWordBoundary",loc:this.loc(e)}}throw Error("Invalid Assertion Escape");case"(":this.consumeChar("?");let r;switch(this.popChar()){case"=":r="Lookahead";break;case"!":r="NegativeLookahead";break;case"<":{switch(this.popChar()){case"=":r="Lookbehind";break;case"!":r="NegativeLookbehind"}break}}Ap(r);const n=this.disjunction();return this.consumeChar(")"),{type:r,value:n,loc:this.loc(e)}}return Dce()}quantifier(e=!1){let r;const n=this.idx;switch(this.popChar()){case"*":r={atLeast:0,atMost:1/0};break;case"+":r={atLeast:1,atMost:1/0};break;case"?":r={atLeast:0,atMost:1};break;case"{":const i=this.integerIncludingZero();switch(this.popChar()){case"}":r={atLeast:i,atMost:i};break;case",":let a;this.isDigit()?(a=this.integerIncludingZero(),r={atLeast:i,atMost:a}):r={atLeast:i,atMost:1/0},this.consumeChar("}");break}if(e===!0&&r===void 0)return;Ap(r);break}if(!(e===!0&&r===void 0)&&Ap(r))return this.peekChar(0)==="?"?(this.consumeChar("?"),r.greedy=!1):r.greedy=!0,r.type="Quantifier",r.loc=this.loc(n),r}atom(){let e;const r=this.idx;switch(this.peekChar()){case".":e=this.dotAll();break;case"\\":e=this.atomEscape();break;case"[":e=this.characterClass();break;case"(":e=this.group();break}if(e===void 0&&this.isPatternCharacter()&&(e=this.patternCharacter()),Ap(e))return e.loc=this.loc(r),this.isQuantifier()&&(e.quantifier=this.quantifier()),e}dotAll(){return this.consumeChar("."),{type:"Set",complement:!0,value:[Lr(` +`),Lr("\r"),Lr("\u2028"),Lr("\u2029")]}}atomEscape(){switch(this.consumeChar("\\"),this.peekChar()){case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return this.decimalEscapeAtom();case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}}decimalEscapeAtom(){return{type:"GroupBackReference",value:this.positiveInteger()}}characterClassEscape(){let e,r=!1;switch(this.popChar()){case"d":e=n_;break;case"D":e=n_,r=!0;break;case"s":e=Mce;break;case"S":e=Mce,r=!0;break;case"w":e=i_;break;case"W":e=i_,r=!0;break}if(Ap(e))return{type:"Set",value:e,complement:r}}controlEscapeAtom(){let e;switch(this.popChar()){case"f":e=Lr("\f");break;case"n":e=Lr(` +`);break;case"r":e=Lr("\r");break;case"t":e=Lr(" ");break;case"v":e=Lr("\v");break}if(Ap(e))return{type:"Character",value:e}}controlLetterEscapeAtom(){this.consumeChar("c");const e=this.popChar();if(/[a-zA-Z]/.test(e)===!1)throw Error("Invalid ");return{type:"Character",value:e.toUpperCase().charCodeAt(0)-64}}nulCharacterAtom(){return this.consumeChar("0"),{type:"Character",value:Lr("\0")}}hexEscapeSequenceAtom(){return this.consumeChar("x"),this.parseHexDigits(2)}regExpUnicodeEscapeSequenceAtom(){return this.consumeChar("u"),this.parseHexDigits(4)}identityEscapeAtom(){const e=this.popChar();return{type:"Character",value:Lr(e)}}classPatternCharacterAtom(){switch(this.peekChar()){case` +`:case"\r":case"\u2028":case"\u2029":case"\\":case"]":throw Error("TBD");default:const e=this.popChar();return{type:"Character",value:Lr(e)}}}characterClass(){const e=[];let r=!1;for(this.consumeChar("["),this.peekChar(0)==="^"&&(this.consumeChar("^"),r=!0);this.isClassAtom();){const n=this.classAtom();if(n.type,qO(n)&&this.isRangeDash()){this.consumeChar("-");const i=this.classAtom();if(i.type,qO(i)){if(i.value=this.input.length)throw Error("Unexpected end of input");this.idx++}loc(e){return{begin:e,end:this.idx}}},E(Bm,"RegExpParser"),Bm),ok=(Fm=class{visitChildren(e){for(const r in e){const n=e[r];e.hasOwnProperty(r)&&(n.type!==void 0?this.visit(n):Array.isArray(n)&&n.forEach(i=>{this.visit(i)},this))}}visit(e){switch(e.type){case"Pattern":this.visitPattern(e);break;case"Flags":this.visitFlags(e);break;case"Disjunction":this.visitDisjunction(e);break;case"Alternative":this.visitAlternative(e);break;case"StartAnchor":this.visitStartAnchor(e);break;case"EndAnchor":this.visitEndAnchor(e);break;case"WordBoundary":this.visitWordBoundary(e);break;case"NonWordBoundary":this.visitNonWordBoundary(e);break;case"Lookahead":this.visitLookahead(e);break;case"NegativeLookahead":this.visitNegativeLookahead(e);break;case"Lookbehind":this.visitLookbehind(e);break;case"NegativeLookbehind":this.visitNegativeLookbehind(e);break;case"Character":this.visitCharacter(e);break;case"Set":this.visitSet(e);break;case"Group":this.visitGroup(e);break;case"GroupBackReference":this.visitGroupBackReference(e);break;case"Quantifier":this.visitQuantifier(e);break}this.visitChildren(e)}visitPattern(e){}visitFlags(e){}visitDisjunction(e){}visitAlternative(e){}visitStartAnchor(e){}visitEndAnchor(e){}visitWordBoundary(e){}visitNonWordBoundary(e){}visitLookahead(e){}visitNegativeLookahead(e){}visitLookbehind(e){}visitNegativeLookbehind(e){}visitCharacter(e){}visitSet(e){}visitGroup(e){}visitGroupBackReference(e){}visitQuantifier(e){}},E(Fm,"BaseRegExpVisitor"),Fm),vre=/\r?\n/gm,bre=new yre,QUe=(zm=class extends ok{constructor(){super(...arguments),this.isStarting=!0,this.endRegexpStack=[],this.multiline=!1}get endRegex(){return this.endRegexpStack.join("")}reset(e){this.multiline=!1,this.regex=e,this.startRegexp="",this.isStarting=!0,this.endRegexpStack=[]}visitGroup(e){e.quantifier&&(this.isStarting=!1,this.endRegexpStack=[])}visitCharacter(e){const r=String.fromCharCode(e.value);if(!this.multiline&&r===` -`&&(this.multiline=!0),e.quantifier)this.isStarting=!1,this.endRegexpStack=[];else{const n=yg(r);this.endRegexpStack.push(n),this.isStarting&&(this.startRegexp+=n)}}visitSet(e){if(!this.multiline){const r=this.regex.substring(e.loc.begin,e.loc.end),n=new RegExp(r);this.multiline=!!` -`.match(n)}if(e.quantifier)this.isStarting=!1,this.endRegexpStack=[];else{const r=this.regex.substring(e.loc.begin,e.loc.end);this.endRegexpStack.push(r),this.isStarting&&(this.startRegexp+=r)}}visitChildren(e){e.type==="Group"&&e.quantifier||super.visitChildren(e)}},E(zm,"TerminalRegExpVisitor"),zm),ff=new QUe;function xre(t){try{typeof t!="string"&&(t=t.source),t=`/${t}/`;const e=bre.pattern(t),r=[];for(const n of e.value.value)ff.reset(t),ff.visit(n),r.push({start:ff.startRegexp,end:ff.endRegex});return r}catch{return[]}}E(xre,"getTerminalParts");function pD(t){try{return typeof t=="string"&&(t=new RegExp(t)),t=t.toString(),ff.reset(t),ff.visit(bre.pattern(t)),ff.multiline}catch{return!1}}E(pD,"isMultilineComment");var Tre=`\f -\r \v              \u2028\u2029   \uFEFF`.split("");function lk(t){const e=typeof t=="string"?new RegExp(t):t;return Tre.some(r=>e.test(r))}E(lk,"isWhitespace");function yg(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}E(yg,"escapeRegExp");function gD(t,e){const r=mD(t),n=e.match(r);return!!n&&n[0].length>0}E(gD,"partialMatches");function mD(t){typeof t=="string"&&(t=new RegExp(t));const e=t,r=t.source;let n=0;function i(){let a="",s;function o(u){a+=r.substr(n,u),n+=u}E(o,"appendRaw");function l(u){a+="(?:"+r.substr(n,u)+"|$)",n+=u}for(E(l,"appendOptional");n",n)-n+1);break;default:l(2);break}break;case"[":s=/\[(?:\\.|.)*?\]/g,s.lastIndex=n,s=s.exec(r)||[],l(s[0].length);break;case"|":case"^":case"$":case"*":case"+":case"?":o(1);break;case"{":s=/\{\d+,?\d*\}/g,s.lastIndex=n,s=s.exec(r),s?o(s[0].length):l(1);break;case"(":if(r[n+1]==="?")switch(r[n+2]){case":":a+="(?:",n+=3,a+=i()+"|$)";break;case"=":a+="(?=",n+=3,a+=i()+")";break;case"!":s=n,n+=3,i(),a+=r.substr(s,n-s);break;case"<":switch(r[n+3]){case"=":case"!":s=n,n+=4,i(),a+=r.substr(s,n-s);break;default:o(r.indexOf(">",n)-n+1),a+=i()+"|$)";break}break}else o(1),a+=i()+"|$)";break;case")":return++n,a;default:l(1);break}return a}return E(i,"process"),new RegExp(i(),t.flags)}E(mD,"partialRegExp");function yD(t){return t.rules.find(e=>rs(e)&&e.entry)}E(yD,"getEntryRule");function vD(t){return t.rules.filter(e=>yo(e)&&e.hidden)}E(vD,"getHiddenRules");function ck(t,e){const r=new Set,n=yD(t);if(!n)return new Set(t.rules);const i=[n].concat(vD(t));for(const s of i)bD(s,r,e);const a=new Set;for(const s of t.rules)(r.has(s.name)||yo(s)&&s.hidden)&&a.add(s);return a}E(ck,"getAllReachableRules");function bD(t,e,r){e.add(t.name),Uc(t).forEach(n=>{if(Kc(n)||r&&j3(n)){const i=n.rule.ref;i&&!e.has(i.name)&&bD(i,e,r)}})}E(bD,"ruleDfs");function wre(t){const e=new Set;return Uc(t).forEach(r=>{Qd(r)&&(rs(r.type.ref)&&e.add(r.type.ref),Mx(r.type.ref)&&rs(r.type.ref.$container)&&e.add(r.type.ref.$container))}),e}E(wre,"getAllRulesUsedForCrossReferences");function xD(t){if(t.terminal)return t.terminal;if(t.type.ref){const e=fk(t.type.ref);return e==null?void 0:e.terminal}}E(xD,"getCrossReferenceTerminal");function TD(t){return t.hidden&&!lk(Gx(t))}E(TD,"isCommentTerminal");function wD(t,e){return!t||!e?[]:hk(t,e,t.astNode,!0)}E(wD,"findNodesForProperty");function uk(t,e,r){if(!t||!e)return;const n=hk(t,e,t.astNode,!0);if(n.length!==0)return r!==void 0?r=Math.max(0,Math.min(r,n.length-1)):r=0,n[r]}E(uk,"findNodeForProperty");function hk(t,e,r,n){if(!n){const i=jd(t.grammarSource,Hc);if(i&&i.feature===e)return[t]}return Wc(t)&&t.astNode===r?t.content.flatMap(i=>hk(i,e,r,!1)):[]}E(hk,"findNodesForPropertyInternal");function Cre(t,e){return t?dk(t,e,t==null?void 0:t.astNode):[]}E(Cre,"findNodesForKeyword");function CD(t,e,r){if(!t)return;const n=dk(t,e,t==null?void 0:t.astNode);if(n.length!==0)return r!==void 0?r=Math.max(0,Math.min(r,n.length-1)):r=0,n[r]}E(CD,"findNodeForKeyword");function dk(t,e,r){if(t.astNode!==r)return[];if(Xc(t.grammarSource)&&t.grammarSource.value===e)return[t];const n=pg(t).iterator();let i;const a=[];do if(i=n.next(),!i.done){const s=i.value;s.astNode===r?Xc(s.grammarSource)&&s.grammarSource.value===e&&a.push(s):n.prune()}while(!i.done);return a}E(dk,"findNodesForKeywordInternal");function kD(t){var r;const e=t.astNode;for(;e===((r=t.container)==null?void 0:r.astNode);){const n=jd(t.grammarSource,Hc);if(n)return n;t=t.container}}E(kD,"findAssignment");function fk(t){let e=t;return Mx(e)&&(gh(e.$container)?e=e.$container.$container:Zd(e.$container)?e=e.$container:xh(e.$container)),ED(t,e,new Map)}E(fk,"findNameAssignment");function ED(t,e,r){var i;function n(a,s){let o;return jd(a,Hc)||(o=ED(s,s,r)),r.set(t,o),o}if(E(n,"go"),r.has(t))return r.get(t);r.set(t,void 0);for(const a of Uc(e)){if(Hc(a)&&a.feature.toLowerCase()==="name")return r.set(t,a),a;if(Kc(a)&&rs(a.rule.ref))return n(a,a.rule.ref);if(X3(a)&&((i=a.typeRef)!=null&&i.ref))return n(a,a.typeRef.ref)}}E(ED,"findNameAssignmentInternal");function SD(t){const e=t.$container;if(ef(e)){const r=e.elements,n=r.indexOf(t);for(let i=n-1;i>=0;i--){const a=r[i];if(gh(a))return a;{const s=Uc(r[i]).find(gh);if(s)return s}}}if(O3(e))return SD(e)}E(SD,"getActionAtElement");function kre(t,e){return t==="?"||t==="*"||ef(e)&&!!e.guardCondition}E(kre,"isOptionalCardinality");function Ere(t){return t==="*"||t==="+"}E(Ere,"isArrayCardinality");function Sre(t){return t==="+="}E(Sre,"isArrayOperator");function Fx(t){return AD(t,new Set)}E(Fx,"isDataTypeRule");function AD(t,e){if(e.has(t))return!0;e.add(t);for(const r of Uc(t))if(Kc(r)){if(!r.rule.ref||rs(r.rule.ref)&&!AD(r.rule.ref,e)||og(r.rule.ref))return!1}else{if(Hc(r))return!1;if(gh(r))return!1}return!!t.definition}E(AD,"isDataTypeRuleInternal");function Are(t){return pk(t.type,new Set)}E(Are,"isDataType");function pk(t,e){if(e.has(t))return!0;if(e.add(t),$9(t))return!1;if(H9(t))return!1;if(Z9(t))return t.types.every(r=>pk(r,e));if(X3(t)){if(t.primitiveType!==void 0)return!0;if(t.stringType!==void 0)return!0;if(t.typeRef!==void 0){const r=t.typeRef.ref;return Z3(r)?pk(r.type,e):!1}else return!1}else return!1}E(pk,"isDataTypeInternal");function zx(t){if(!yo(t)){if(t.inferredType)return t.inferredType.name;if(t.dataType)return t.dataType;if(t.returnType){const e=t.returnType.ref;if(e)return e.name}}}E(zx,"getExplicitRuleType");function pf(t){if(Zd(t))return rs(t)&&Fx(t)?t.name:zx(t)??t.name;if(q9(t)||Z3(t)||X9(t))return t.name;if(gh(t)){const e=_D(t);if(e)return e}else if(Mx(t))return t.name;throw new Error("Cannot get name of Unknown Type")}E(pf,"getTypeName");function _D(t){var e;if(t.inferredType)return t.inferredType.name;if((e=t.type)!=null&&e.ref)return pf(t.type.ref)}E(_D,"getActionType");function _re(t){var e;return yo(t)?((e=t.type)==null?void 0:e.name)??"string":rs(t)&&Fx(t)?t.name:zx(t)??t.name}E(_re,"getRuleTypeName");function RD(t){var e;return yo(t)?((e=t.type)==null?void 0:e.name)??"string":zx(t)??t.name}E(RD,"getRuleType");function Gx(t){const e={s:!1,i:!1,u:!1},r=gf(t.definition,e),n=Object.entries(e).filter(([,i])=>i).map(([i])=>i).join("");return new RegExp(r,n)}E(Gx,"terminalRegex");var LD=/[\s\S]/.source;function gf(t,e){var r;if(K9(t))return Rre(t);if(j9(t))return Lre(t);if(B9(t))return Mre(t);if(j3(t)){const n=t.rule.ref;if(!n)throw new Error("Missing rule reference.");return Hl(gf(n.definition),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized})}else{if(V9(t))return Dre(t);if(Q9(t))return Ire(t);if(Y9(t)){const n=t.regex.lastIndexOf("/"),i=t.regex.substring(1,n),a=t.regex.substring(n+1);return e&&(e.i=a.includes("i"),e.s=a.includes("s"),e.u=a.includes("u")),Hl(i,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}else{if(J9(t))return Hl(LD,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized});throw new Error(`Invalid terminal element: ${t==null?void 0:t.$type}, ${(r=t==null?void 0:t.$cstNode)==null?void 0:r.text}`)}}}E(gf,"abstractElementToRegex");function Rre(t){return Hl(t.elements.map(e=>gf(e)).join("|"),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}E(Rre,"terminalAlternativesToRegex");function Lre(t){return Hl(t.elements.map(e=>gf(e)).join(""),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}E(Lre,"terminalGroupToRegex");function Ire(t){return Hl(`${LD}*?${gf(t.terminal)}`,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized})}E(Ire,"untilTokenToRegex");function Dre(t){return Hl(`(?!${gf(t.terminal)})${LD}*?`,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized})}E(Dre,"negateTokenToRegex");function Mre(t){return t.right?Hl(`[${gk(t.left)}-${gk(t.right)}]`,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1}):Hl(gk(t.left),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}E(Mre,"characterRangeToRegex");function gk(t){return yg(t.value)}E(gk,"keywordToRegex");function Hl(t,e){return(e.parenthesized||e.lookahead||e.wrap!==!1)&&(t=`(${e.lookahead??(e.parenthesized?"":"?:")}${t})`),e.cardinality?`${t}${e.cardinality}`:t}E(Hl,"withCardinality");function ID(t){const e=[],r=t.Grammar;for(const n of r.rules)yo(n)&&TD(n)&&pD(Gx(n))&&e.push(n.name);return{multilineCommentRules:e,nameRegexp:iD}}E(ID,"createGrammarConfig");var JUe=typeof global=="object"&&global&&global.Object===Object&&global,Nre=JUe,eHe=typeof self=="object"&&self&&self.Object===Object&&self,tHe=Nre||eHe||Function("return this")(),Yl=tHe,rHe=Yl.Symbol,vo=rHe,Ore=Object.prototype,nHe=Ore.hasOwnProperty,iHe=Ore.toString,qx=vo?vo.toStringTag:void 0;function $re(t){var e=nHe.call(t,qx),r=t[qx];try{t[qx]=void 0;var n=!0}catch{}var i=iHe.call(t);return n&&(e?t[qx]=r:delete t[qx]),i}E($re,"getRawTag");var aHe=$re,sHe=Object.prototype,oHe=sHe.toString;function Pre(t){return oHe.call(t)}E(Pre,"objectToString");var lHe=Pre,cHe="[object Null]",uHe="[object Undefined]",Bre=vo?vo.toStringTag:void 0;function Fre(t){return t==null?t===void 0?uHe:cHe:Bre&&Bre in Object(t)?aHe(t):lHe(t)}E(Fre,"baseGetTag");var Th=Fre;function zre(t){return t!=null&&typeof t=="object"}E(zre,"isObjectLike");var Uo=zre,hHe="[object Symbol]";function Gre(t){return typeof t=="symbol"||Uo(t)&&Th(t)==hHe}E(Gre,"isSymbol");var mk=Gre;function qre(t,e){for(var r=-1,n=t==null?0:t.length,i=Array(n);++r0){if(++e>=YHe)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}E(hne,"shortOut");var jHe=hne;function dne(t){return function(){return t}}E(dne,"constant");var ZHe=dne,QHe=(function(){try{var t=yf(Object,"defineProperty");return t({},"",{}),t}catch{}})(),yk=QHe,JHe=yk?function(t,e){return yk(t,"toString",{configurable:!0,enumerable:!1,value:ZHe(e),writable:!0})}:Ux,eYe=JHe,tYe=jHe(eYe),rYe=tYe;function fne(t,e){for(var r=-1,n=t==null?0:t.length;++r-1}E(xne,"arrayIncludes");var Tne=xne,aYe=9007199254740991,sYe=/^(?:0|[1-9]\d*)$/;function wne(t,e){var r=typeof t;return e=e??aYe,!!e&&(r=="number"||r!="symbol"&&sYe.test(t))&&t>-1&&t%1==0&&t-1&&t%1==0&&t<=uYe}E(Lne,"isLength");var BD=Lne;function Ine(t){return t!=null&&BD(t.length)&&!Zc(t)}E(Ine,"isArrayLike");var Xl=Ine;function Dne(t,e,r){if(!bo(r))return!1;var n=typeof e;return(n=="number"?Xl(r)&&vk(e,r.length):n=="string"&&e in r)?Hx(r[e],t):!1}E(Dne,"isIterateeCall");var xk=Dne;function Mne(t){return PD(function(e,r){var n=-1,i=r.length,a=i>1?r[i-1]:void 0,s=i>2?r[2]:void 0;for(a=t.length>3&&typeof a=="function"?(i--,a):void 0,s&&xk(r[0],r[1],s)&&(a=i<3?void 0:a,i=1),e=Object(e);++n-1}E(pie,"listCacheHas");var _Xe=pie;function gie(t,e){var r=this.__data__,n=Ck(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}E(gie,"listCacheSet");var RXe=gie;function bf(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e0&&r(o)?e>1?WD(o,e-1,r,n,i):VD(i,o):n||(i[i.length]=o)}return i}E(WD,"baseFlatten");var UD=WD;function Die(t){var e=t==null?0:t.length;return e?UD(t,1):[]}E(Die,"flatten");var Ho=Die,XXe=jne(Object.getPrototypeOf,Object),Mie=XXe;function Nie(t,e,r){var n=-1,i=t.length;e<0&&(e=-e>i?0:i+e),r=r>i?i:r,r<0&&(r+=i),i=e>r?0:r-e>>>0,e>>>=0;for(var a=Array(i);++no))return!1;var u=a.get(t),h=a.get(e);if(u&&h)return u==e&&h==t;var d=-1,f=!0,p=r&Bje?new QD:void 0;for(a.set(t,e),a.set(e,t);++d2?e[2]:void 0;for(i&&xk(e[0],e[1],i)&&(n=1);++r=IZe&&(a=JD,s=!1,e=new QD(e));e:for(;++i-1?i[a?e[s]:s]:void 0}}E(Mse,"createFind");var PZe=Mse,BZe=Math.max;function Nse(t,e,r){var n=t==null?0:t.length;if(!n)return-1;var i=r==null?0:Wx(r);return i<0&&(i=BZe(n+i,0)),mne(t,Kl(e),i)}E(Nse,"findIndex");var FZe=Nse,zZe=PZe(FZe),xg=zZe;function Ose(t){return t&&t.length?t[0]:void 0}E(Ose,"head");var Xo=Ose;function $se(t,e){var r=-1,n=Xl(t)?Array(t.length):[];return Cf(t,function(i,a,s){n[++r]=e(i,a,s)}),n}E($se,"baseMap");var GZe=$se;function Pse(t,e){var r=Zr(t)?Vx:GZe;return r(t,Kl(e))}E(Pse,"map");var ur=Pse;function Bse(t,e){return UD(ur(t,e),1)}E(Bse,"flatMap");var To=Bse,qZe=Object.prototype,VZe=qZe.hasOwnProperty,WZe=_Ze(function(t,e,r){VZe.call(t,r)?t[r].push(e):$D(t,r,[e])}),UZe=WZe,HZe=Object.prototype,YZe=HZe.hasOwnProperty;function Fse(t,e){return t!=null&&YZe.call(t,e)}E(Fse,"baseHas");var XZe=Fse;function zse(t,e){return t!=null&&nse(t,e,XZe)}E(zse,"has");var br=zse,KZe="[object String]";function Gse(t){return typeof t=="string"||!Zr(t)&&Uo(t)&&Th(t)==KZe}E(Gse,"isString");var Ss=Gse;function qse(t,e){return Vx(e,function(r){return t[r]})}E(qse,"baseValues");var jZe=qse;function Vse(t){return t==null?[]:jZe(t,Ks(t))}E(Vse,"values");var Vi=Vse,ZZe=Math.max;function Wse(t,e,r,n){t=Xl(t)?t:Vi(t),r=r&&!n?Wx(r):0;var i=t.length;return r<0&&(r=ZZe(i+r,0)),Ss(t)?r<=i&&t.indexOf(e,r)>-1:!!i&&OD(t,e,r)>-1}E(Wse,"includes");var ns=Wse,QZe=Math.max;function Use(t,e,r){var n=t==null?0:t.length;if(!n)return-1;var i=r==null?0:Wx(r);return i<0&&(i=QZe(n+i,0)),OD(t,e,i)}E(Use,"indexOf");var Hse=Use,JZe="[object Map]",eQe="[object Set]",tQe=Object.prototype,rQe=tQe.hasOwnProperty;function Yse(t){if(t==null)return!0;if(Xl(t)&&(Zr(t)||typeof t=="string"||typeof t.splice=="function"||Kx(t)||zD(t)||Tk(t)))return!t.length;var e=bg(t);if(e==JZe||e==eQe)return!t.size;if(Xx(t))return!Qne(t).length;for(var r in t)if(rQe.call(t,r))return!1;return!0}E(Yse,"isEmpty");var An=Yse,nQe="[object RegExp]";function Xse(t){return Uo(t)&&Th(t)==nQe}E(Xse,"baseIsRegExp");var iQe=Xse,Kse=wh&&wh.isRegExp,aQe=Kse?jx(Kse):iQe,Qc=aQe;function jse(t){return t===void 0}E(jse,"isUndefined");var Jc=jse,sQe="Expected a function";function Zse(t){if(typeof t!="function")throw new TypeError(sQe);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)}}E(Zse,"negate");var oQe=Zse;function Qse(t,e,r,n){if(!bo(t))return t;e=_k(e,t);for(var i=-1,a=e.length,s=a-1,o=t;o!=null&&++i=gQe){var u=e?null:pQe(t);if(u)return eM(u);s=!1,i=JD,l=new QD}else l=e?[]:o;e:for(;++n{r.accept(e)})}},E(Gm,"AbstractProduction"),Gm),is=(qm=class extends jl{constructor(e){super([]),this.idx=1,js(this,Ko(e,r=>r!==void 0))}set definition(e){}get definition(){return this.referencedRule!==void 0?this.referencedRule.definition:[]}accept(e){e.visit(this)}},E(qm,"NonTerminal"),qm),Tg=(Vm=class extends jl{constructor(e){super(e.definition),this.orgText="",js(this,Ko(e,r=>r!==void 0))}},E(Vm,"Rule"),Vm),As=(Wm=class extends jl{constructor(e){super(e.definition),this.ignoreAmbiguities=!1,js(this,Ko(e,r=>r!==void 0))}},E(Wm,"Alternative"),Wm),va=(Um=class extends jl{constructor(e){super(e.definition),this.idx=1,js(this,Ko(e,r=>r!==void 0))}},E(Um,"Option"),Um),Qs=(Hm=class extends jl{constructor(e){super(e.definition),this.idx=1,js(this,Ko(e,r=>r!==void 0))}},E(Hm,"RepetitionMandatory"),Hm),Js=(Ym=class extends jl{constructor(e){super(e.definition),this.idx=1,js(this,Ko(e,r=>r!==void 0))}},E(Ym,"RepetitionMandatoryWithSeparator"),Ym),ai=(Xm=class extends jl{constructor(e){super(e.definition),this.idx=1,js(this,Ko(e,r=>r!==void 0))}},E(Xm,"Repetition"),Xm),_s=(Km=class extends jl{constructor(e){super(e.definition),this.idx=1,js(this,Ko(e,r=>r!==void 0))}},E(Km,"RepetitionWithSeparator"),Km),Rs=(jm=class extends jl{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){super(e.definition),this.idx=1,this.ignoreAmbiguities=!1,this.hasPredicates=!1,js(this,Ko(e,r=>r!==void 0))}},E(jm,"Alternation"),jm),Pn=(Zm=class{constructor(e){this.idx=1,js(this,Ko(e,r=>r!==void 0))}accept(e){e.visit(this)}},E(Zm,"Terminal"),Zm);function hoe(t){return ur(t,sT)}E(hoe,"serializeGrammar");function sT(t){function e(r){return ur(r,sT)}if(E(e,"convertDefinition"),t instanceof is){const r={type:"NonTerminal",name:t.nonTerminalName,idx:t.idx};return Ss(t.label)&&(r.label=t.label),r}else{if(t instanceof As)return{type:"Alternative",definition:e(t.definition)};if(t instanceof va)return{type:"Option",idx:t.idx,definition:e(t.definition)};if(t instanceof Qs)return{type:"RepetitionMandatory",idx:t.idx,definition:e(t.definition)};if(t instanceof Js)return{type:"RepetitionMandatoryWithSeparator",idx:t.idx,separator:sT(new Pn({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof _s)return{type:"RepetitionWithSeparator",idx:t.idx,separator:sT(new Pn({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof ai)return{type:"Repetition",idx:t.idx,definition:e(t.definition)};if(t instanceof Rs)return{type:"Alternation",idx:t.idx,definition:e(t.definition)};if(t instanceof Pn){const r={type:"Terminal",name:t.terminalType.name,label:coe(t.terminalType),idx:t.idx};Ss(t.label)&&(r.terminalLabel=t.label);const n=t.terminalType.PATTERN;return t.terminalType.PATTERN&&(r.pattern=Qc(n)?n.source:n),r}else{if(t instanceof Tg)return{type:"Rule",name:t.name,orgText:t.orgText,definition:e(t.definition)};throw Error("non exhaustive match")}}}E(sT,"serializeProduction");var wg=(Qm=class{visit(e){const r=e;switch(r.constructor){case is:return this.visitNonTerminal(r);case As:return this.visitAlternative(r);case va:return this.visitOption(r);case Qs:return this.visitRepetitionMandatory(r);case Js:return this.visitRepetitionMandatoryWithSeparator(r);case _s:return this.visitRepetitionWithSeparator(r);case ai:return this.visitRepetition(r);case Rs:return this.visitAlternation(r);case Pn:return this.visitTerminal(r);case Tg:return this.visitRule(r);default:throw Error("non exhaustive match")}}visitNonTerminal(e){}visitAlternative(e){}visitOption(e){}visitRepetition(e){}visitRepetitionMandatory(e){}visitRepetitionMandatoryWithSeparator(e){}visitRepetitionWithSeparator(e){}visitAlternation(e){}visitTerminal(e){}visitRule(e){}},E(Qm,"GAstVisitor"),Qm);function doe(t){return t instanceof As||t instanceof va||t instanceof ai||t instanceof Qs||t instanceof Js||t instanceof _s||t instanceof Pn||t instanceof Tg}E(doe,"isSequenceProd");function oT(t,e=[]){return t instanceof va||t instanceof ai||t instanceof _s?!0:t instanceof Rs?soe(t.definition,n=>oT(n,e)):t instanceof is&&ns(e,t)?!1:t instanceof jl?(t instanceof is&&e.push(t),Yo(t.definition,n=>oT(n,e))):!1}E(oT,"isOptionalProd");function foe(t){return t instanceof Rs}E(foe,"isBranchingProd");function jo(t){if(t instanceof is)return"SUBRULE";if(t instanceof va)return"OPTION";if(t instanceof Rs)return"OR";if(t instanceof Qs)return"AT_LEAST_ONE";if(t instanceof Js)return"AT_LEAST_ONE_SEP";if(t instanceof _s)return"MANY_SEP";if(t instanceof ai)return"MANY";if(t instanceof Pn)return"CONSUME";throw Error("non exhaustive match")}E(jo,"getProductionDslName");var Nk=(Jm=class{walk(e,r=[]){kr(e.definition,(n,i)=>{const a=ya(e.definition,i+1);if(n instanceof is)this.walkProdRef(n,a,r);else if(n instanceof Pn)this.walkTerminal(n,a,r);else if(n instanceof As)this.walkFlat(n,a,r);else if(n instanceof va)this.walkOption(n,a,r);else if(n instanceof Qs)this.walkAtLeastOne(n,a,r);else if(n instanceof Js)this.walkAtLeastOneSep(n,a,r);else if(n instanceof _s)this.walkManySep(n,a,r);else if(n instanceof ai)this.walkMany(n,a,r);else if(n instanceof Rs)this.walkOr(n,a,r);else throw Error("non exhaustive match")})}walkTerminal(e,r,n){}walkProdRef(e,r,n){}walkFlat(e,r,n){const i=r.concat(n);this.walk(e,i)}walkOption(e,r,n){const i=r.concat(n);this.walk(e,i)}walkAtLeastOne(e,r,n){const i=[new va({definition:e.definition})].concat(r,n);this.walk(e,i)}walkAtLeastOneSep(e,r,n){const i=lM(e,r,n);this.walk(e,i)}walkMany(e,r,n){const i=[new va({definition:e.definition})].concat(r,n);this.walk(e,i)}walkManySep(e,r,n){const i=lM(e,r,n);this.walk(e,i)}walkOr(e,r,n){const i=r.concat(n);kr(e.definition,a=>{const s=new As({definition:[a]});this.walk(s,i)})}},E(Jm,"RestWalker"),Jm);function lM(t,e,r){return[new va({definition:[new Pn({terminalType:t.separator})].concat(t.definition)})].concat(e,r)}E(lM,"restForRepetitionWithSeparator");function Cg(t){if(t instanceof is)return Cg(t.referencedRule);if(t instanceof Pn)return moe(t);if(doe(t))return poe(t);if(foe(t))return goe(t);throw Error("non exhaustive match")}E(Cg,"first");function poe(t){let e=[];const r=t.definition;let n=0,i=r.length>n,a,s=!0;for(;i&&s;)a=r[n],s=oT(a),e=e.concat(Cg(a)),n=n+1,i=r.length>n;return iM(e)}E(poe,"firstForSequence");function goe(t){const e=ur(t.definition,r=>Cg(r));return iM(Ho(e))}E(goe,"firstForBranching");function moe(t){return[t.terminalType]}E(moe,"firstForTerminal");var yoe="_~IN~_",yQe=(e1=class extends Nk{constructor(e){super(),this.topProd=e,this.follows={}}startWalking(){return this.walk(this.topProd),this.follows}walkTerminal(e,r,n){}walkProdRef(e,r,n){const i=boe(e.referencedRule,e.idx)+this.topProd.name,a=r.concat(n),s=new As({definition:a}),o=Cg(s);this.follows[i]=o}},E(e1,"ResyncFollowsWalker"),e1);function voe(t){const e={};return kr(t,r=>{const n=new yQe(r).startWalking();js(e,n)}),e}E(voe,"computeAllProdsFollows");function boe(t,e){return t.name+e+yoe}E(boe,"buildBetweenProdsFollowPrefix");var Ok={},vQe=new yre;function lT(t){const e=t.toString();if(Ok.hasOwnProperty(e))return Ok[e];{const r=vQe.pattern(e);return Ok[e]=r,r}}E(lT,"getRegExpAst");function xoe(){Ok={}}E(xoe,"clearRegExpParserCache");var Toe="Complement Sets are not supported for first char optimization",$k=`Unable to use "first char" lexer optimizations: -`;function woe(t,e=!1){try{const r=lT(t);return Pk(r.value,{},r.flags.ignoreCase)}catch(r){if(r.message===Toe)e&&aM(`${$k} Unable to optimize: < ${t.toString()} > +`:case"\r":case"\u2028":case"\u2029":return!1;default:return!0}}parseHexDigits(e){let r="";for(let i=0;i=this.input.length)throw Error("Unexpected end of input");this.idx++}loc(e){return{begin:e,end:this.idx}}},E(yy,"RegExpParser"),yy),s_=(vy=class{visitChildren(e){for(const r in e){const n=e[r];e.hasOwnProperty(r)&&(n.type!==void 0?this.visit(n):Array.isArray(n)&&n.forEach(i=>{this.visit(i)},this))}}visit(e){switch(e.type){case"Pattern":this.visitPattern(e);break;case"Flags":this.visitFlags(e);break;case"Disjunction":this.visitDisjunction(e);break;case"Alternative":this.visitAlternative(e);break;case"StartAnchor":this.visitStartAnchor(e);break;case"EndAnchor":this.visitEndAnchor(e);break;case"WordBoundary":this.visitWordBoundary(e);break;case"NonWordBoundary":this.visitNonWordBoundary(e);break;case"Lookahead":this.visitLookahead(e);break;case"NegativeLookahead":this.visitNegativeLookahead(e);break;case"Lookbehind":this.visitLookbehind(e);break;case"NegativeLookbehind":this.visitNegativeLookbehind(e);break;case"Character":this.visitCharacter(e);break;case"Set":this.visitSet(e);break;case"Group":this.visitGroup(e);break;case"GroupBackReference":this.visitGroupBackReference(e);break;case"Quantifier":this.visitQuantifier(e);break}this.visitChildren(e)}visitPattern(e){}visitFlags(e){}visitDisjunction(e){}visitAlternative(e){}visitStartAnchor(e){}visitEndAnchor(e){}visitWordBoundary(e){}visitNonWordBoundary(e){}visitLookahead(e){}visitNegativeLookahead(e){}visitLookbehind(e){}visitNegativeLookbehind(e){}visitCharacter(e){}visitSet(e){}visitGroup(e){}visitGroupBackReference(e){}visitQuantifier(e){}},E(vy,"BaseRegExpVisitor"),vy),$ce=/\r?\n/gm,Oce=new Nce,ztt=(by=class extends s_{constructor(){super(...arguments),this.isStarting=!0,this.endRegexpStack=[],this.multiline=!1}get endRegex(){return this.endRegexpStack.join("")}reset(e){this.multiline=!1,this.regex=e,this.startRegexp="",this.isStarting=!0,this.endRegexpStack=[]}visitGroup(e){e.quantifier&&(this.isStarting=!1,this.endRegexpStack=[])}visitCharacter(e){const r=String.fromCharCode(e.value);if(!this.multiline&&r===` +`&&(this.multiline=!0),e.quantifier)this.isStarting=!1,this.endRegexpStack=[];else{const n=Km(r);this.endRegexpStack.push(n),this.isStarting&&(this.startRegexp+=n)}}visitSet(e){if(!this.multiline){const r=this.regex.substring(e.loc.begin,e.loc.end),n=new RegExp(r);this.multiline=!!` +`.match(n)}if(e.quantifier)this.isStarting=!1,this.endRegexpStack=[];else{const r=this.regex.substring(e.loc.begin,e.loc.end);this.endRegexpStack.push(r),this.isStarting&&(this.startRegexp+=r)}}visitChildren(e){e.type==="Group"&&e.quantifier||super.visitChildren(e)}},E(by,"TerminalRegExpVisitor"),by),Rp=new ztt;function Pce(t){try{typeof t!="string"&&(t=t.source),t=`/${t}/`;const e=Oce.pattern(t),r=[];for(const n of e.value.value)Rp.reset(t),Rp.visit(n),r.push({start:Rp.startRegexp,end:Rp.endRegex});return r}catch{return[]}}E(Pce,"getTerminalParts");function VO(t){try{return typeof t=="string"&&(t=new RegExp(t)),t=t.toString(),Rp.reset(t),Rp.visit(Oce.pattern(t)),Rp.multiline}catch{return!1}}E(VO,"isMultilineComment");var Bce=`\f +\r \v              \u2028\u2029   \uFEFF`.split("");function o_(t){const e=typeof t=="string"?new RegExp(t):t;return Bce.some(r=>e.test(r))}E(o_,"isWhitespace");function Km(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}E(Km,"escapeRegExp");function WO(t,e){const r=UO(t),n=e.match(r);return!!n&&n[0].length>0}E(WO,"partialMatches");function UO(t){typeof t=="string"&&(t=new RegExp(t));const e=t,r=t.source;let n=0;function i(){let a="",s;function o(u){a+=r.substr(n,u),n+=u}E(o,"appendRaw");function l(u){a+="(?:"+r.substr(n,u)+"|$)",n+=u}for(E(l,"appendOptional");n",n)-n+1);break;default:l(2);break}break;case"[":s=/\[(?:\\.|.)*?\]/g,s.lastIndex=n,s=s.exec(r)||[],l(s[0].length);break;case"|":case"^":case"$":case"*":case"+":case"?":o(1);break;case"{":s=/\{\d+,?\d*\}/g,s.lastIndex=n,s=s.exec(r),s?o(s[0].length):l(1);break;case"(":if(r[n+1]==="?")switch(r[n+2]){case":":a+="(?:",n+=3,a+=i()+"|$)";break;case"=":a+="(?=",n+=3,a+=i()+")";break;case"!":s=n,n+=3,i(),a+=r.substr(s,n-s);break;case"<":switch(r[n+3]){case"=":case"!":s=n,n+=4,i(),a+=r.substr(s,n-s);break;default:o(r.indexOf(">",n)-n+1),a+=i()+"|$)";break}break}else o(1),a+=i()+"|$)";break;case")":return++n,a;default:l(1);break}return a}return E(i,"process"),new RegExp(i(),t.flags)}E(UO,"partialRegExp");function HO(t){return t.rules.find(e=>Ds(e)&&e.entry)}E(HO,"getEntryRule");function YO(t){return t.rules.filter(e=>rl(e)&&e.hidden)}E(YO,"getHiddenRules");function l_(t,e){const r=new Set,n=HO(t);if(!n)return new Set(t.rules);const i=[n].concat(YO(t));for(const s of i)XO(s,r,e);const a=new Set;for(const s of t.rules)(r.has(s.name)||rl(s)&&s.hidden)&&a.add(s);return a}E(l_,"getAllReachableRules");function XO(t,e,r){e.add(t.name),Wu(t).forEach(n=>{if(Xu(n)||r&&jS(n)){const i=n.rule.ref;i&&!e.has(i.name)&&XO(i,e,r)}})}E(XO,"ruleDfs");function Fce(t){const e=new Set;return Wu(t).forEach(r=>{gp(r)&&(Ds(r.type.ref)&&e.add(r.type.ref),zw(r.type.ref)&&Ds(r.type.ref.$container)&&e.add(r.type.ref.$container))}),e}E(Fce,"getAllRulesUsedForCrossReferences");function jO(t){if(t.terminal)return t.terminal;if(t.type.ref){const e=d_(t.type.ref);return e==null?void 0:e.terminal}}E(jO,"getCrossReferenceTerminal");function KO(t){return t.hidden&&!o_(Xw(t))}E(KO,"isCommentTerminal");function ZO(t,e){return!t||!e?[]:u_(t,e,t.astNode,!0)}E(ZO,"findNodesForProperty");function c_(t,e,r){if(!t||!e)return;const n=u_(t,e,t.astNode,!0);if(n.length!==0)return r!==void 0?r=Math.max(0,Math.min(r,n.length-1)):r=0,n[r]}E(c_,"findNodeForProperty");function u_(t,e,r,n){if(!n){const i=fp(t.grammarSource,Uu);if(i&&i.feature===e)return[t]}return Vu(t)&&t.astNode===r?t.content.flatMap(i=>u_(i,e,r,!1)):[]}E(u_,"findNodesForPropertyInternal");function zce(t,e){return t?h_(t,e,t==null?void 0:t.astNode):[]}E(zce,"findNodesForKeyword");function QO(t,e,r){if(!t)return;const n=h_(t,e,t==null?void 0:t.astNode);if(n.length!==0)return r!==void 0?r=Math.max(0,Math.min(r,n.length-1)):r=0,n[r]}E(QO,"findNodeForKeyword");function h_(t,e,r){if(t.astNode!==r)return[];if(Yu(t.grammarSource)&&t.grammarSource.value===e)return[t];const n=Ym(t).iterator();let i;const a=[];do if(i=n.next(),!i.done){const s=i.value;s.astNode===r?Yu(s.grammarSource)&&s.grammarSource.value===e&&a.push(s):n.prune()}while(!i.done);return a}E(h_,"findNodesForKeywordInternal");function JO(t){var r;const e=t.astNode;for(;e===((r=t.container)==null?void 0:r.astNode);){const n=fp(t.grammarSource,Uu);if(n)return n;t=t.container}}E(JO,"findAssignment");function d_(t){let e=t;return zw(e)&&(yd(e.$container)?e=e.$container.$container:pp(e.$container)?e=e.$container:wd(e.$container)),eP(t,e,new Map)}E(d_,"findNameAssignment");function eP(t,e,r){var i;function n(a,s){let o;return fp(a,Uu)||(o=eP(s,s,r)),r.set(t,o),o}if(E(n,"go"),r.has(t))return r.get(t);r.set(t,void 0);for(const a of Wu(e)){if(Uu(a)&&a.feature.toLowerCase()==="name")return r.set(t,a),a;if(Xu(a)&&Ds(a.rule.ref))return n(a,a.rule.ref);if(YS(a)&&((i=a.typeRef)!=null&&i.ref))return n(a,a.typeRef.ref)}}E(eP,"findNameAssignmentInternal");function tP(t){const e=t.$container;if(yp(e)){const r=e.elements,n=r.indexOf(t);for(let i=n-1;i>=0;i--){const a=r[i];if(yd(a))return a;{const s=Wu(r[i]).find(yd);if(s)return s}}}if(NS(e))return tP(e)}E(tP,"getActionAtElement");function Gce(t,e){return t==="?"||t==="*"||yp(e)&&!!e.guardCondition}E(Gce,"isOptionalCardinality");function qce(t){return t==="*"||t==="+"}E(qce,"isArrayCardinality");function Vce(t){return t==="+="}E(Vce,"isArrayOperator");function Hw(t){return rP(t,new Set)}E(Hw,"isDataTypeRule");function rP(t,e){if(e.has(t))return!0;e.add(t);for(const r of Wu(t))if(Xu(r)){if(!r.rule.ref||Ds(r.rule.ref)&&!rP(r.rule.ref,e)||zm(r.rule.ref))return!1}else{if(Uu(r))return!1;if(yd(r))return!1}return!!t.definition}E(rP,"isDataTypeRuleInternal");function Wce(t){return f_(t.type,new Set)}E(Wce,"isDataType");function f_(t,e){if(e.has(t))return!0;if(e.add(t),hO(t))return!1;if(TO(t))return!1;if(SO(t))return t.types.every(r=>f_(r,e));if(YS(t)){if(t.primitiveType!==void 0)return!0;if(t.stringType!==void 0)return!0;if(t.typeRef!==void 0){const r=t.typeRef.ref;return KS(r)?f_(r.type,e):!1}else return!1}else return!1}E(f_,"isDataTypeInternal");function Yw(t){if(!rl(t)){if(t.inferredType)return t.inferredType.name;if(t.dataType)return t.dataType;if(t.returnType){const e=t.returnType.ref;if(e)return e.name}}}E(Yw,"getExplicitRuleType");function Lp(t){if(pp(t))return Ds(t)&&Hw(t)?t.name:Yw(t)??t.name;if(yO(t)||KS(t)||CO(t))return t.name;if(yd(t)){const e=nP(t);if(e)return e}else if(zw(t))return t.name;throw new Error("Cannot get name of Unknown Type")}E(Lp,"getTypeName");function nP(t){var e;if(t.inferredType)return t.inferredType.name;if((e=t.type)!=null&&e.ref)return Lp(t.type.ref)}E(nP,"getActionType");function Uce(t){var e;return rl(t)?((e=t.type)==null?void 0:e.name)??"string":Ds(t)&&Hw(t)?t.name:Yw(t)??t.name}E(Uce,"getRuleTypeName");function iP(t){var e;return rl(t)?((e=t.type)==null?void 0:e.name)??"string":Yw(t)??t.name}E(iP,"getRuleType");function Xw(t){const e={s:!1,i:!1,u:!1},r=Ip(t.definition,e),n=Object.entries(e).filter(([,i])=>i).map(([i])=>i).join("");return new RegExp(r,n)}E(Xw,"terminalRegex");var aP=/[\s\S]/.source;function Ip(t,e){var r;if(kO(t))return Hce(t);if(EO(t))return Yce(t);if(fO(t))return Kce(t);if(jS(t)){const n=t.rule.ref;if(!n)throw new Error("Missing rule reference.");return $c(Ip(n.definition),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized})}else{if(vO(t))return jce(t);if(_O(t))return Xce(t);if(wO(t)){const n=t.regex.lastIndexOf("/"),i=t.regex.substring(1,n),a=t.regex.substring(n+1);return e&&(e.i=a.includes("i"),e.s=a.includes("s"),e.u=a.includes("u")),$c(i,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}else{if(AO(t))return $c(aP,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized});throw new Error(`Invalid terminal element: ${t==null?void 0:t.$type}, ${(r=t==null?void 0:t.$cstNode)==null?void 0:r.text}`)}}}E(Ip,"abstractElementToRegex");function Hce(t){return $c(t.elements.map(e=>Ip(e)).join("|"),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}E(Hce,"terminalAlternativesToRegex");function Yce(t){return $c(t.elements.map(e=>Ip(e)).join(""),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}E(Yce,"terminalGroupToRegex");function Xce(t){return $c(`${aP}*?${Ip(t.terminal)}`,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized})}E(Xce,"untilTokenToRegex");function jce(t){return $c(`(?!${Ip(t.terminal)})${aP}*?`,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized})}E(jce,"negateTokenToRegex");function Kce(t){return t.right?$c(`[${p_(t.left)}-${p_(t.right)}]`,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1}):$c(p_(t.left),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}E(Kce,"characterRangeToRegex");function p_(t){return Km(t.value)}E(p_,"keywordToRegex");function $c(t,e){return(e.parenthesized||e.lookahead||e.wrap!==!1)&&(t=`(${e.lookahead??(e.parenthesized?"":"?:")}${t})`),e.cardinality?`${t}${e.cardinality}`:t}E($c,"withCardinality");function sP(t){const e=[],r=t.Grammar;for(const n of r.rules)rl(n)&&KO(n)&&VO(Xw(n))&&e.push(n.name);return{multilineCommentRules:e,nameRegexp:MO}}E(sP,"createGrammarConfig");var Gtt=typeof global=="object"&&global&&global.Object===Object&&global,Zce=Gtt,qtt=typeof self=="object"&&self&&self.Object===Object&&self,Vtt=Zce||qtt||Function("return this")(),Oc=Vtt,Wtt=Oc.Symbol,nl=Wtt,Qce=Object.prototype,Utt=Qce.hasOwnProperty,Htt=Qce.toString,jw=nl?nl.toStringTag:void 0;function Jce(t){var e=Utt.call(t,jw),r=t[jw];try{t[jw]=void 0;var n=!0}catch{}var i=Htt.call(t);return n&&(e?t[jw]=r:delete t[jw]),i}E(Jce,"getRawTag");var Ytt=Jce,Xtt=Object.prototype,jtt=Xtt.toString;function eue(t){return jtt.call(t)}E(eue,"objectToString");var Ktt=eue,Ztt="[object Null]",Qtt="[object Undefined]",tue=nl?nl.toStringTag:void 0;function rue(t){return t==null?t===void 0?Qtt:Ztt:tue&&tue in Object(t)?Ytt(t):Ktt(t)}E(rue,"baseGetTag");var Cd=rue;function nue(t){return t!=null&&typeof t=="object"}E(nue,"isObjectLike");var Il=nue,Jtt="[object Symbol]";function iue(t){return typeof t=="symbol"||Il(t)&&Cd(t)==Jtt}E(iue,"isSymbol");var g_=iue;function aue(t,e){for(var r=-1,n=t==null?0:t.length,i=Array(n);++r0){if(++e>=$rt)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}E(Aue,"shortOut");var Brt=Aue;function Rue(t){return function(){return t}}E(Rue,"constant");var Frt=Rue,zrt=(function(){try{var t=Mp(Object,"defineProperty");return t({},"",{}),t}catch{}})(),m_=zrt,Grt=m_?function(t,e){return m_(t,"toString",{configurable:!0,enumerable:!1,value:Frt(e),writable:!0})}:Qw,qrt=Grt,Vrt=Brt(qrt),Wrt=Vrt;function Lue(t,e){for(var r=-1,n=t==null?0:t.length;++r-1}E(Pue,"arrayIncludes");var Bue=Pue,Yrt=9007199254740991,Xrt=/^(?:0|[1-9]\d*)$/;function Fue(t,e){var r=typeof t;return e=e??Yrt,!!e&&(r=="number"||r!="symbol"&&Xrt.test(t))&&t>-1&&t%1==0&&t-1&&t%1==0&&t<=Qrt}E(Yue,"isLength");var fP=Yue;function Xue(t){return t!=null&&fP(t.length)&&!Ku(t)}E(Xue,"isArrayLike");var Pc=Xue;function jue(t,e,r){if(!il(r))return!1;var n=typeof e;return(n=="number"?Pc(r)&&y_(e,r.length):n=="string"&&e in r)?Jw(r[e],t):!1}E(jue,"isIterateeCall");var b_=jue;function Kue(t){return dP(function(e,r){var n=-1,i=r.length,a=i>1?r[i-1]:void 0,s=i>2?r[2]:void 0;for(a=t.length>3&&typeof a=="function"?(i--,a):void 0,s&&b_(r[0],r[1],s)&&(a=i<3?void 0:a,i=1),e=Object(e);++n-1}E(Ihe,"listCacheHas");var mit=Ihe;function Dhe(t,e){var r=this.__data__,n=w_(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}E(Dhe,"listCacheSet");var yit=Dhe;function $p(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e0&&r(o)?e>1?bP(o,e-1,r,n,i):vP(i,o):n||(i[i.length]=o)}return i}E(bP,"baseFlatten");var xP=bP;function jhe(t){var e=t==null?0:t.length;return e?xP(t,1):[]}E(jhe,"flatten");var Dl=jhe,Oit=fhe(Object.getPrototypeOf,Object),Khe=Oit;function Zhe(t,e,r){var n=-1,i=t.length;e<0&&(e=-e>i?0:i+e),r=r>i?i:r,r<0&&(r+=i),i=e>r?0:r-e>>>0,e>>>=0;for(var a=Array(i);++no))return!1;var u=a.get(t),h=a.get(e);if(u&&h)return u==e&&h==t;var d=-1,f=!0,p=r&Sst?new _P:void 0;for(a.set(t,e),a.set(e,t);++d2?e[2]:void 0;for(i&&b_(e[0],e[1],i)&&(n=1);++r=bot&&(a=AP,s=!1,e=new _P(e));e:for(;++i-1?i[a?e[s]:s]:void 0}}E(Kfe,"createFind");var Eot=Kfe,Sot=Math.max;function Zfe(t,e,r){var n=t==null?0:t.length;if(!n)return-1;var i=r==null?0:Zw(r);return i<0&&(i=Sot(n+i,0)),Mue(t,Bc(e),i)}E(Zfe,"findIndex");var _ot=Zfe,Aot=Eot(_ot),Jm=Aot;function Qfe(t){return t&&t.length?t[0]:void 0}E(Qfe,"head");var Nl=Qfe;function Jfe(t,e){var r=-1,n=Pc(t)?Array(t.length):[];return Fp(t,function(i,a,s){n[++r]=e(i,a,s)}),n}E(Jfe,"baseMap");var Rot=Jfe;function epe(t,e){var r=on(t)?Kw:Rot;return r(t,Bc(e))}E(epe,"map");var mr=epe;function tpe(t,e){return xP(mr(t,e),1)}E(tpe,"flatMap");var sl=tpe,Lot=Object.prototype,Iot=Lot.hasOwnProperty,Dot=mot(function(t,e,r){Iot.call(t,r)?t[r].push(e):hP(t,r,[e])}),Mot=Dot,Not=Object.prototype,$ot=Not.hasOwnProperty;function rpe(t,e){return t!=null&&$ot.call(t,e)}E(rpe,"baseHas");var Oot=rpe;function npe(t,e){return t!=null&&xfe(t,e,Oot)}E(npe,"has");var Er=npe,Pot="[object String]";function ipe(t){return typeof t=="string"||!on(t)&&Il(t)&&Cd(t)==Pot}E(ipe,"isString");var io=ipe;function ape(t,e){return Kw(e,function(r){return t[r]})}E(ape,"baseValues");var Bot=ape;function spe(t){return t==null?[]:Bot(t,Io(t))}E(spe,"values");var da=spe,Fot=Math.max;function ope(t,e,r,n){t=Pc(t)?t:da(t),r=r&&!n?Zw(r):0;var i=t.length;return r<0&&(r=Fot(i+r,0)),io(t)?r<=i&&t.indexOf(e,r)>-1:!!i&&uP(t,e,r)>-1}E(ope,"includes");var Ms=ope,zot=Math.max;function lpe(t,e,r){var n=t==null?0:t.length;if(!n)return-1;var i=r==null?0:Zw(r);return i<0&&(i=zot(n+i,0)),uP(t,e,i)}E(lpe,"indexOf");var cpe=lpe,Got="[object Map]",qot="[object Set]",Vot=Object.prototype,Wot=Vot.hasOwnProperty;function upe(t){if(t==null)return!0;if(Pc(t)&&(on(t)||typeof t=="string"||typeof t.splice=="function"||rC(t)||gP(t)||x_(t)))return!t.length;var e=Qm(t);if(e==Got||e==qot)return!t.size;if(tC(t))return!ghe(t).length;for(var r in t)if(Wot.call(t,r))return!1;return!0}E(upe,"isEmpty");var qn=upe,Uot="[object RegExp]";function hpe(t){return Il(t)&&Cd(t)==Uot}E(hpe,"baseIsRegExp");var Hot=hpe,dpe=kd&&kd.isRegExp,Yot=dpe?nC(dpe):Hot,Zu=Yot;function fpe(t){return t===void 0}E(fpe,"isUndefined");var Qu=fpe,Xot="Expected a function";function ppe(t){if(typeof t!="function")throw new TypeError(Xot);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)}}E(ppe,"negate");var jot=ppe;function gpe(t,e,r,n){if(!il(t))return t;e=__(e,t);for(var i=-1,a=e.length,s=a-1,o=t;o!=null&&++i=nlt){var u=e?null:rlt(t);if(u)return RP(u);s=!1,i=AP,l=new _P}else l=e?[]:o;e:for(;++n{r.accept(e)})}},E(xy,"AbstractProduction"),xy),Ns=(Ty=class extends Fc{constructor(e){super([]),this.idx=1,Do(this,$l(e,r=>r!==void 0))}set definition(e){}get definition(){return this.referencedRule!==void 0?this.referencedRule.definition:[]}accept(e){e.visit(this)}},E(Ty,"NonTerminal"),Ty),e1=(wy=class extends Fc{constructor(e){super(e.definition),this.orgText="",Do(this,$l(e,r=>r!==void 0))}},E(wy,"Rule"),wy),ao=(Cy=class extends Fc{constructor(e){super(e.definition),this.ignoreAmbiguities=!1,Do(this,$l(e,r=>r!==void 0))}},E(Cy,"Alternative"),Cy),Va=(ky=class extends Fc{constructor(e){super(e.definition),this.idx=1,Do(this,$l(e,r=>r!==void 0))}},E(ky,"Option"),ky),No=(Ey=class extends Fc{constructor(e){super(e.definition),this.idx=1,Do(this,$l(e,r=>r!==void 0))}},E(Ey,"RepetitionMandatory"),Ey),$o=(Sy=class extends Fc{constructor(e){super(e.definition),this.idx=1,Do(this,$l(e,r=>r!==void 0))}},E(Sy,"RepetitionMandatoryWithSeparator"),Sy),Si=(_y=class extends Fc{constructor(e){super(e.definition),this.idx=1,Do(this,$l(e,r=>r!==void 0))}},E(_y,"Repetition"),_y),so=(Ay=class extends Fc{constructor(e){super(e.definition),this.idx=1,Do(this,$l(e,r=>r!==void 0))}},E(Ay,"RepetitionWithSeparator"),Ay),oo=(Ry=class extends Fc{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){super(e.definition),this.idx=1,this.ignoreAmbiguities=!1,this.hasPredicates=!1,Do(this,$l(e,r=>r!==void 0))}},E(Ry,"Alternation"),Ry),ri=(Ly=class{constructor(e){this.idx=1,Do(this,$l(e,r=>r!==void 0))}accept(e){e.visit(this)}},E(Ly,"Terminal"),Ly);function Ape(t){return mr(t,fC)}E(Ape,"serializeGrammar");function fC(t){function e(r){return mr(r,fC)}if(E(e,"convertDefinition"),t instanceof Ns){const r={type:"NonTerminal",name:t.nonTerminalName,idx:t.idx};return io(t.label)&&(r.label=t.label),r}else{if(t instanceof ao)return{type:"Alternative",definition:e(t.definition)};if(t instanceof Va)return{type:"Option",idx:t.idx,definition:e(t.definition)};if(t instanceof No)return{type:"RepetitionMandatory",idx:t.idx,definition:e(t.definition)};if(t instanceof $o)return{type:"RepetitionMandatoryWithSeparator",idx:t.idx,separator:fC(new ri({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof so)return{type:"RepetitionWithSeparator",idx:t.idx,separator:fC(new ri({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof Si)return{type:"Repetition",idx:t.idx,definition:e(t.definition)};if(t instanceof oo)return{type:"Alternation",idx:t.idx,definition:e(t.definition)};if(t instanceof ri){const r={type:"Terminal",name:t.terminalType.name,label:Spe(t.terminalType),idx:t.idx};io(t.label)&&(r.terminalLabel=t.label);const n=t.terminalType.PATTERN;return t.terminalType.PATTERN&&(r.pattern=Zu(n)?n.source:n),r}else{if(t instanceof e1)return{type:"Rule",name:t.name,orgText:t.orgText,definition:e(t.definition)};throw Error("non exhaustive match")}}}E(fC,"serializeProduction");var t1=(Iy=class{visit(e){const r=e;switch(r.constructor){case Ns:return this.visitNonTerminal(r);case ao:return this.visitAlternative(r);case Va:return this.visitOption(r);case No:return this.visitRepetitionMandatory(r);case $o:return this.visitRepetitionMandatoryWithSeparator(r);case so:return this.visitRepetitionWithSeparator(r);case Si:return this.visitRepetition(r);case oo:return this.visitAlternation(r);case ri:return this.visitTerminal(r);case e1:return this.visitRule(r);default:throw Error("non exhaustive match")}}visitNonTerminal(e){}visitAlternative(e){}visitOption(e){}visitRepetition(e){}visitRepetitionMandatory(e){}visitRepetitionMandatoryWithSeparator(e){}visitRepetitionWithSeparator(e){}visitAlternation(e){}visitTerminal(e){}visitRule(e){}},E(Iy,"GAstVisitor"),Iy);function Rpe(t){return t instanceof ao||t instanceof Va||t instanceof Si||t instanceof No||t instanceof $o||t instanceof so||t instanceof ri||t instanceof e1}E(Rpe,"isSequenceProd");function pC(t,e=[]){return t instanceof Va||t instanceof Si||t instanceof so?!0:t instanceof oo?Cpe(t.definition,n=>pC(n,e)):t instanceof Ns&&Ms(e,t)?!1:t instanceof Fc?(t instanceof Ns&&e.push(t),Ml(t.definition,n=>pC(n,e))):!1}E(pC,"isOptionalProd");function Lpe(t){return t instanceof oo}E(Lpe,"isBranchingProd");function Ol(t){if(t instanceof Ns)return"SUBRULE";if(t instanceof Va)return"OPTION";if(t instanceof oo)return"OR";if(t instanceof No)return"AT_LEAST_ONE";if(t instanceof $o)return"AT_LEAST_ONE_SEP";if(t instanceof so)return"MANY_SEP";if(t instanceof Si)return"MANY";if(t instanceof ri)return"CONSUME";throw Error("non exhaustive match")}E(Ol,"getProductionDslName");var M_=(Dy=class{walk(e,r=[]){Ir(e.definition,(n,i)=>{const a=qa(e.definition,i+1);if(n instanceof Ns)this.walkProdRef(n,a,r);else if(n instanceof ri)this.walkTerminal(n,a,r);else if(n instanceof ao)this.walkFlat(n,a,r);else if(n instanceof Va)this.walkOption(n,a,r);else if(n instanceof No)this.walkAtLeastOne(n,a,r);else if(n instanceof $o)this.walkAtLeastOneSep(n,a,r);else if(n instanceof so)this.walkManySep(n,a,r);else if(n instanceof Si)this.walkMany(n,a,r);else if(n instanceof oo)this.walkOr(n,a,r);else throw Error("non exhaustive match")})}walkTerminal(e,r,n){}walkProdRef(e,r,n){}walkFlat(e,r,n){const i=r.concat(n);this.walk(e,i)}walkOption(e,r,n){const i=r.concat(n);this.walk(e,i)}walkAtLeastOne(e,r,n){const i=[new Va({definition:e.definition})].concat(r,n);this.walk(e,i)}walkAtLeastOneSep(e,r,n){const i=PP(e,r,n);this.walk(e,i)}walkMany(e,r,n){const i=[new Va({definition:e.definition})].concat(r,n);this.walk(e,i)}walkManySep(e,r,n){const i=PP(e,r,n);this.walk(e,i)}walkOr(e,r,n){const i=r.concat(n);Ir(e.definition,a=>{const s=new ao({definition:[a]});this.walk(s,i)})}},E(Dy,"RestWalker"),Dy);function PP(t,e,r){return[new Va({definition:[new ri({terminalType:t.separator})].concat(t.definition)})].concat(e,r)}E(PP,"restForRepetitionWithSeparator");function r1(t){if(t instanceof Ns)return r1(t.referencedRule);if(t instanceof ri)return Mpe(t);if(Rpe(t))return Ipe(t);if(Lpe(t))return Dpe(t);throw Error("non exhaustive match")}E(r1,"first");function Ipe(t){let e=[];const r=t.definition;let n=0,i=r.length>n,a,s=!0;for(;i&&s;)a=r[n],s=pC(a),e=e.concat(r1(a)),n=n+1,i=r.length>n;return MP(e)}E(Ipe,"firstForSequence");function Dpe(t){const e=mr(t.definition,r=>r1(r));return MP(Dl(e))}E(Dpe,"firstForBranching");function Mpe(t){return[t.terminalType]}E(Mpe,"firstForTerminal");var Npe="_~IN~_",alt=(My=class extends M_{constructor(e){super(),this.topProd=e,this.follows={}}startWalking(){return this.walk(this.topProd),this.follows}walkTerminal(e,r,n){}walkProdRef(e,r,n){const i=Ope(e.referencedRule,e.idx)+this.topProd.name,a=r.concat(n),s=new ao({definition:a}),o=r1(s);this.follows[i]=o}},E(My,"ResyncFollowsWalker"),My);function $pe(t){const e={};return Ir(t,r=>{const n=new alt(r).startWalking();Do(e,n)}),e}E($pe,"computeAllProdsFollows");function Ope(t,e){return t.name+e+Npe}E(Ope,"buildBetweenProdsFollowPrefix");var N_={},slt=new Nce;function gC(t){const e=t.toString();if(N_.hasOwnProperty(e))return N_[e];{const r=slt.pattern(e);return N_[e]=r,r}}E(gC,"getRegExpAst");function Ppe(){N_={}}E(Ppe,"clearRegExpParserCache");var Bpe="Complement Sets are not supported for first char optimization",$_=`Unable to use "first char" lexer optimizations: +`;function Fpe(t,e=!1){try{const r=gC(t);return O_(r.value,{},r.flags.ignoreCase)}catch(r){if(r.message===Bpe)e&&NP(`${$_} Unable to optimize: < ${t.toString()} > Complement Sets cannot be automatically optimized. This will disable the lexer's first char optimizations. See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#COMPLEMENT for details.`);else{let n="";e&&(n=` This will disable the lexer's first char optimizations. - See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details.`),Mk(`${$k} + See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details.`),D_(`${$_} Failed parsing: < ${t.toString()} > Using the @chevrotain/regexp-to-ast library - Please open an issue at: https://github.com/chevrotain/chevrotain/issues`+n)}}return[]}E(woe,"getOptimizedStartCodesIndices");function Pk(t,e,r){switch(t.type){case"Disjunction":for(let i=0;i{if(typeof l=="number")cT(l,e,r);else{const u=l;if(r===!0)for(let h=u.from;h<=u.to;h++)cT(h,e,r);else{for(let h=u.from;h<=u.to&&h=hT){const h=u.from>=hT?u.from:hT,d=u.to,f=eu(h),p=eu(d);for(let g=f;g<=p;g++)e[g]=g}}}});break;case"Group":Pk(s.value,e,r);break;default:throw Error("Non Exhaustive Match")}const o=s.quantifier!==void 0&&s.quantifier.atLeast===0;if(s.type==="Group"&&Bk(s)===!1||s.type!=="Group"&&o===!1)break}break;default:throw Error("non exhaustive match!")}return Vi(e)}E(Pk,"firstCharOptimizedIndices");function cT(t,e,r){const n=eu(t);e[n]=n,r===!0&&Coe(t,e)}E(cT,"addOptimizedIdxToResult");function Coe(t,e){const r=String.fromCharCode(t),n=r.toUpperCase();if(n!==r){const i=eu(n.charCodeAt(0));e[i]=i}else{const i=r.toLowerCase();if(i!==r){const a=eu(i.charCodeAt(0));e[a]=a}}}E(Coe,"handleIgnoreCase");function cM(t,e){return xg(t.value,r=>{if(typeof r=="number")return ns(e,r);{const n=r;return xg(e,i=>n.from<=i&&i<=n.to)!==void 0}})}E(cM,"findCode");function Bk(t){const e=t.quantifier;return e&&e.atLeast===0?!0:t.value?Zr(t.value)?Yo(t.value,Bk):Bk(t.value):!1}E(Bk,"isWholeOptional");var bQe=(t1=class extends ok{constructor(e){super(),this.targetCharCodes=e,this.found=!1}visitChildren(e){if(this.found!==!0){switch(e.type){case"Lookahead":this.visitLookahead(e);return;case"NegativeLookahead":this.visitNegativeLookahead(e);return;case"Lookbehind":this.visitLookbehind(e);return;case"NegativeLookbehind":this.visitNegativeLookbehind(e);return}super.visitChildren(e)}}visitCharacter(e){ns(this.targetCharCodes,e.value)&&(this.found=!0)}visitSet(e){e.complement?cM(e,this.targetCharCodes)===void 0&&(this.found=!0):cM(e,this.targetCharCodes)!==void 0&&(this.found=!0)}},E(t1,"CharCodeFinder"),t1);function Fk(t,e){if(e instanceof RegExp){const r=lT(e),n=new bQe(t);return n.visit(r),n.found}else return xg(e,r=>ns(t,r.charCodeAt(0)))!==void 0}E(Fk,"canMatchCharCode");var Ef="PATTERN",uT="defaultMode",zk="modes";function koe(t,e){e=nM(e,{debug:!1,safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r",` -`],tracer:E((T,b)=>b(),"tracer")});const r=e.tracer;r("initCharCodeToOptimizedIndexMap",()=>{Uoe()});let n;r("Reject Lexer.NA",()=>{n=Dk(t,T=>T[Ef]===as.NA)});let i=!1,a;r("Transform Patterns",()=>{i=!1,a=ur(n,T=>{const b=T[Ef];if(Qc(b)){const w=b.source;return w.length===1&&w!=="^"&&w!=="$"&&w!=="."&&!b.ignoreCase?w:w.length===2&&w[0]==="\\"&&!ns(["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"],w[1])?w[1]:uM(b)}else{if(Zc(b))return i=!0,{exec:b};if(typeof b=="object")return i=!0,b;if(typeof b=="string"){if(b.length===1)return b;{const w=b.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),k=new RegExp(w);return uM(k)}}else throw Error("non exhaustive match")}})});let s,o,l,u,h;r("misc mapping",()=>{s=ur(n,T=>T.tokenTypeIdx),o=ur(n,T=>{const b=T.GROUP;if(b!==as.SKIPPED){if(Ss(b))return b;if(Jc(b))return!1;throw Error("non exhaustive match")}}),l=ur(n,T=>{const b=T.LONGER_ALT;if(b)return Zr(b)?ur(b,k=>Hse(n,k)):[Hse(n,b)]}),u=ur(n,T=>T.PUSH_MODE),h=ur(n,T=>br(T,"POP_MODE"))});let d;r("Line Terminator Handling",()=>{const T=fM(e.lineTerminatorCharacters);d=ur(n,b=>!1),e.positionTracking!=="onlyOffset"&&(d=ur(n,b=>br(b,"LINE_BREAKS")?!!b.LINE_BREAKS:dM(b,T)===!1&&Fk(T,b.PATTERN)))});let f,p,g,m;r("Misc Mapping #2",()=>{f=ur(n,hM),p=ur(a,Voe),g=Zs(n,(T,b)=>{const w=b.GROUP;return Ss(w)&&w!==as.SKIPPED&&(T[w]=[]),T},{}),m=ur(a,(T,b)=>({pattern:a[b],longerAlt:l[b],canLineTerminator:d[b],isCustom:f[b],short:p[b],group:o[b],push:u[b],pop:h[b],tokenTypeIdx:s[b],tokenType:n[b]}))});let y=!0,v=[];return e.safeMode||r("First Char Optimization",()=>{v=Zs(n,(T,b,w)=>{if(typeof b.PATTERN=="string"){const k=b.PATTERN.charCodeAt(0),A=eu(k);Gk(T,A,m[w])}else if(Zr(b.START_CHARS_HINT)){let k;kr(b.START_CHARS_HINT,A=>{const C=typeof A=="string"?A.charCodeAt(0):A,_=eu(C);k!==_&&(k=_,Gk(T,_,m[w]))})}else if(Qc(b.PATTERN))if(b.PATTERN.unicode)y=!1,e.ensureOptimizations&&Mk(`${$k} Unable to analyze < ${b.PATTERN.toString()} > pattern. + Please open an issue at: https://github.com/chevrotain/chevrotain/issues`+n)}}return[]}E(Fpe,"getOptimizedStartCodesIndices");function O_(t,e,r){switch(t.type){case"Disjunction":for(let i=0;i{if(typeof l=="number")mC(l,e,r);else{const u=l;if(r===!0)for(let h=u.from;h<=u.to;h++)mC(h,e,r);else{for(let h=u.from;h<=u.to&&h=vC){const h=u.from>=vC?u.from:vC,d=u.to,f=Ju(h),p=Ju(d);for(let g=f;g<=p;g++)e[g]=g}}}});break;case"Group":O_(s.value,e,r);break;default:throw Error("Non Exhaustive Match")}const o=s.quantifier!==void 0&&s.quantifier.atLeast===0;if(s.type==="Group"&&P_(s)===!1||s.type!=="Group"&&o===!1)break}break;default:throw Error("non exhaustive match!")}return da(e)}E(O_,"firstCharOptimizedIndices");function mC(t,e,r){const n=Ju(t);e[n]=n,r===!0&&zpe(t,e)}E(mC,"addOptimizedIdxToResult");function zpe(t,e){const r=String.fromCharCode(t),n=r.toUpperCase();if(n!==r){const i=Ju(n.charCodeAt(0));e[i]=i}else{const i=r.toLowerCase();if(i!==r){const a=Ju(i.charCodeAt(0));e[a]=a}}}E(zpe,"handleIgnoreCase");function BP(t,e){return Jm(t.value,r=>{if(typeof r=="number")return Ms(e,r);{const n=r;return Jm(e,i=>n.from<=i&&i<=n.to)!==void 0}})}E(BP,"findCode");function P_(t){const e=t.quantifier;return e&&e.atLeast===0?!0:t.value?on(t.value)?Ml(t.value,P_):P_(t.value):!1}E(P_,"isWholeOptional");var olt=(Ny=class extends s_{constructor(e){super(),this.targetCharCodes=e,this.found=!1}visitChildren(e){if(this.found!==!0){switch(e.type){case"Lookahead":this.visitLookahead(e);return;case"NegativeLookahead":this.visitNegativeLookahead(e);return;case"Lookbehind":this.visitLookbehind(e);return;case"NegativeLookbehind":this.visitNegativeLookbehind(e);return}super.visitChildren(e)}}visitCharacter(e){Ms(this.targetCharCodes,e.value)&&(this.found=!0)}visitSet(e){e.complement?BP(e,this.targetCharCodes)===void 0&&(this.found=!0):BP(e,this.targetCharCodes)!==void 0&&(this.found=!0)}},E(Ny,"CharCodeFinder"),Ny);function B_(t,e){if(e instanceof RegExp){const r=gC(e),n=new olt(t);return n.visit(r),n.found}else return Jm(e,r=>Ms(t,r.charCodeAt(0)))!==void 0}E(B_,"canMatchCharCode");var Gp="PATTERN",yC="defaultMode",F_="modes";function Gpe(t,e){e=DP(e,{debug:!1,safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r",` +`],tracer:E((x,b)=>b(),"tracer")});const r=e.tracer;r("initCharCodeToOptimizedIndexMap",()=>{l0e()});let n;r("Reject Lexer.NA",()=>{n=I_(t,x=>x[Gp]===$s.NA)});let i=!1,a;r("Transform Patterns",()=>{i=!1,a=mr(n,x=>{const b=x[Gp];if(Zu(b)){const w=b.source;return w.length===1&&w!=="^"&&w!=="$"&&w!=="."&&!b.ignoreCase?w:w.length===2&&w[0]==="\\"&&!Ms(["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"],w[1])?w[1]:FP(b)}else{if(Ku(b))return i=!0,{exec:b};if(typeof b=="object")return i=!0,b;if(typeof b=="string"){if(b.length===1)return b;{const w=b.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),C=new RegExp(w);return FP(C)}}else throw Error("non exhaustive match")}})});let s,o,l,u,h;r("misc mapping",()=>{s=mr(n,x=>x.tokenTypeIdx),o=mr(n,x=>{const b=x.GROUP;if(b!==$s.SKIPPED){if(io(b))return b;if(Qu(b))return!1;throw Error("non exhaustive match")}}),l=mr(n,x=>{const b=x.LONGER_ALT;if(b)return on(b)?mr(b,C=>cpe(n,C)):[cpe(n,b)]}),u=mr(n,x=>x.PUSH_MODE),h=mr(n,x=>Er(x,"POP_MODE"))});let d;r("Line Terminator Handling",()=>{const x=qP(e.lineTerminatorCharacters);d=mr(n,b=>!1),e.positionTracking!=="onlyOffset"&&(d=mr(n,b=>Er(b,"LINE_BREAKS")?!!b.LINE_BREAKS:GP(b,x)===!1&&B_(x,b.PATTERN)))});let f,p,g,m;r("Misc Mapping #2",()=>{f=mr(n,zP),p=mr(a,s0e),g=Mo(n,(x,b)=>{const w=b.GROUP;return io(w)&&w!==$s.SKIPPED&&(x[w]=[]),x},{}),m=mr(a,(x,b)=>({pattern:a[b],longerAlt:l[b],canLineTerminator:d[b],isCustom:f[b],short:p[b],group:o[b],push:u[b],pop:h[b],tokenTypeIdx:s[b],tokenType:n[b]}))});let y=!0,v=[];return e.safeMode||r("First Char Optimization",()=>{v=Mo(n,(x,b,w)=>{if(typeof b.PATTERN=="string"){const C=b.PATTERN.charCodeAt(0),_=Ju(C);z_(x,_,m[w])}else if(on(b.START_CHARS_HINT)){let C;Ir(b.START_CHARS_HINT,_=>{const k=typeof _=="string"?_.charCodeAt(0):_,S=Ju(k);C!==S&&(C=S,z_(x,S,m[w]))})}else if(Zu(b.PATTERN))if(b.PATTERN.unicode)y=!1,e.ensureOptimizations&&D_(`${$_} Unable to analyze < ${b.PATTERN.toString()} > pattern. The regexp unicode flag is not currently supported by the regexp-to-ast library. This will disable the lexer's first char optimizations. - For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE`);else{const k=woe(b.PATTERN,e.ensureOptimizations);An(k)&&(y=!1),kr(k,A=>{Gk(T,A,m[w])})}else e.ensureOptimizations&&Mk(`${$k} TokenType: <${b.name}> is using a custom token pattern without providing parameter. + For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE`);else{const C=Fpe(b.PATTERN,e.ensureOptimizations);qn(C)&&(y=!1),Ir(C,_=>{z_(x,_,m[w])})}else e.ensureOptimizations&&D_(`${$_} TokenType: <${b.name}> is using a custom token pattern without providing parameter. This will disable the lexer's first char optimizations. - For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE`),y=!1;return T},[])}),{emptyGroups:g,patternIdxToConfig:m,charCodeToPatternIdxToConfig:v,hasCustom:i,canBeOptimized:y}}E(koe,"analyzeTokenTypes");function Eoe(t,e){let r=[];const n=Aoe(t);r=r.concat(n.errors);const i=_oe(n.valid),a=i.valid;return r=r.concat(i.errors),r=r.concat(Soe(a)),r=r.concat(Noe(a)),r=r.concat(Ooe(a,e)),r=r.concat($oe(a)),r}E(Eoe,"validatePatterns");function Soe(t){let e=[];const r=xo(t,n=>Qc(n[Ef]));return e=e.concat(Roe(r)),e=e.concat(Ioe(r)),e=e.concat(Doe(r)),e=e.concat(Moe(r)),e=e.concat(Loe(r)),e}E(Soe,"validateRegExpPattern");function Aoe(t){const e=xo(t,i=>!br(i,Ef)),r=ur(e,i=>({message:"Token Type: ->"+i.name+"<- missing static 'PATTERN' property",type:si.MISSING_PATTERN,tokenTypes:[i]})),n=Ik(t,e);return{errors:r,valid:n}}E(Aoe,"findMissingPatterns");function _oe(t){const e=xo(t,i=>{const a=i[Ef];return!Qc(a)&&!Zc(a)&&!br(a,"exec")&&!Ss(a)}),r=ur(e,i=>({message:"Token Type: ->"+i.name+"<- static 'PATTERN' can only be a RegExp, a Function matching the {CustomPatternMatcherFunc} type or an Object matching the {ICustomPattern} interface.",type:si.INVALID_PATTERN,tokenTypes:[i]})),n=Ik(t,e);return{errors:r,valid:n}}E(_oe,"findInvalidPatterns");var xQe=/[^\\][$]/;function Roe(t){const i=class i extends ok{constructor(){super(...arguments),this.found=!1}visitEndAnchor(s){this.found=!0}};E(i,"EndAnchorFinder");let e=i;const r=xo(t,a=>{const s=a.PATTERN;try{const o=lT(s),l=new e;return l.visit(o),l.found}catch{return xQe.test(s.source)}});return ur(r,a=>({message:`Unexpected RegExp Anchor Error: + For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE`),y=!1;return x},[])}),{emptyGroups:g,patternIdxToConfig:m,charCodeToPatternIdxToConfig:v,hasCustom:i,canBeOptimized:y}}E(Gpe,"analyzeTokenTypes");function qpe(t,e){let r=[];const n=Wpe(t);r=r.concat(n.errors);const i=Upe(n.valid),a=i.valid;return r=r.concat(i.errors),r=r.concat(Vpe(a)),r=r.concat(Zpe(a)),r=r.concat(Qpe(a,e)),r=r.concat(Jpe(a)),r}E(qpe,"validatePatterns");function Vpe(t){let e=[];const r=al(t,n=>Zu(n[Gp]));return e=e.concat(Hpe(r)),e=e.concat(Xpe(r)),e=e.concat(jpe(r)),e=e.concat(Kpe(r)),e=e.concat(Ype(r)),e}E(Vpe,"validateRegExpPattern");function Wpe(t){const e=al(t,i=>!Er(i,Gp)),r=mr(e,i=>({message:"Token Type: ->"+i.name+"<- missing static 'PATTERN' property",type:_i.MISSING_PATTERN,tokenTypes:[i]})),n=L_(t,e);return{errors:r,valid:n}}E(Wpe,"findMissingPatterns");function Upe(t){const e=al(t,i=>{const a=i[Gp];return!Zu(a)&&!Ku(a)&&!Er(a,"exec")&&!io(a)}),r=mr(e,i=>({message:"Token Type: ->"+i.name+"<- static 'PATTERN' can only be a RegExp, a Function matching the {CustomPatternMatcherFunc} type or an Object matching the {ICustomPattern} interface.",type:_i.INVALID_PATTERN,tokenTypes:[i]})),n=L_(t,e);return{errors:r,valid:n}}E(Upe,"findInvalidPatterns");var llt=/[^\\][$]/;function Hpe(t){const i=class i extends s_{constructor(){super(...arguments),this.found=!1}visitEndAnchor(s){this.found=!0}};E(i,"EndAnchorFinder");let e=i;const r=al(t,a=>{const s=a.PATTERN;try{const o=gC(s),l=new e;return l.visit(o),l.found}catch{return llt.test(s.source)}});return mr(r,a=>({message:`Unexpected RegExp Anchor Error: Token Type: ->`+a.name+`<- static 'PATTERN' cannot contain end of input anchor '$' - See chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:si.EOI_ANCHOR_FOUND,tokenTypes:[a]}))}E(Roe,"findEndOfInputAnchor");function Loe(t){const e=xo(t,n=>n.PATTERN.test(""));return ur(e,n=>({message:"Token Type: ->"+n.name+"<- static 'PATTERN' must not match an empty string",type:si.EMPTY_MATCH_PATTERN,tokenTypes:[n]}))}E(Loe,"findEmptyMatchRegExps");var TQe=/[^\\[][\^]|^\^/;function Ioe(t){const i=class i extends ok{constructor(){super(...arguments),this.found=!1}visitStartAnchor(s){this.found=!0}};E(i,"StartAnchorFinder");let e=i;const r=xo(t,a=>{const s=a.PATTERN;try{const o=lT(s),l=new e;return l.visit(o),l.found}catch{return TQe.test(s.source)}});return ur(r,a=>({message:`Unexpected RegExp Anchor Error: + See chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:_i.EOI_ANCHOR_FOUND,tokenTypes:[a]}))}E(Hpe,"findEndOfInputAnchor");function Ype(t){const e=al(t,n=>n.PATTERN.test(""));return mr(e,n=>({message:"Token Type: ->"+n.name+"<- static 'PATTERN' must not match an empty string",type:_i.EMPTY_MATCH_PATTERN,tokenTypes:[n]}))}E(Ype,"findEmptyMatchRegExps");var clt=/[^\\[][\^]|^\^/;function Xpe(t){const i=class i extends s_{constructor(){super(...arguments),this.found=!1}visitStartAnchor(s){this.found=!0}};E(i,"StartAnchorFinder");let e=i;const r=al(t,a=>{const s=a.PATTERN;try{const o=gC(s),l=new e;return l.visit(o),l.found}catch{return clt.test(s.source)}});return mr(r,a=>({message:`Unexpected RegExp Anchor Error: Token Type: ->`+a.name+`<- static 'PATTERN' cannot contain start of input anchor '^' - See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:si.SOI_ANCHOR_FOUND,tokenTypes:[a]}))}E(Ioe,"findStartOfInputAnchor");function Doe(t){const e=xo(t,n=>{const i=n[Ef];return i instanceof RegExp&&(i.multiline||i.global)});return ur(e,n=>({message:"Token Type: ->"+n.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:si.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[n]}))}E(Doe,"findUnsupportedFlags");function Moe(t){const e=[];let r=ur(t,a=>Zs(t,(s,o)=>(a.PATTERN.source===o.PATTERN.source&&!ns(e,o)&&o.PATTERN!==as.NA&&(e.push(o),s.push(o)),s),[]));r=nT(r);const n=xo(r,a=>a.length>1);return ur(n,a=>{const s=ur(a,l=>l.name);return{message:`The same RegExp pattern ->${Xo(a).PATTERN}<-has been used in all of the following Token Types: ${s.join(", ")} <-`,type:si.DUPLICATE_PATTERNS_FOUND,tokenTypes:a}})}E(Moe,"findDuplicatePatterns");function Noe(t){const e=xo(t,n=>{if(!br(n,"GROUP"))return!1;const i=n.GROUP;return i!==as.SKIPPED&&i!==as.NA&&!Ss(i)});return ur(e,n=>({message:"Token Type: ->"+n.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:si.INVALID_GROUP_TYPE_FOUND,tokenTypes:[n]}))}E(Noe,"findInvalidGroupType");function Ooe(t,e){const r=xo(t,i=>i.PUSH_MODE!==void 0&&!ns(e,i.PUSH_MODE));return ur(r,i=>({message:`Token Type: ->${i.name}<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->${i.PUSH_MODE}<-which does not exist`,type:si.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[i]}))}E(Ooe,"findModesThatDoNotExist");function $oe(t){const e=[],r=Zs(t,(n,i,a)=>{const s=i.PATTERN;return s===as.NA||(Ss(s)?n.push({str:s,idx:a,tokenType:i}):Qc(s)&&Boe(s)&&n.push({str:s.source,idx:a,tokenType:i})),n},[]);return kr(t,(n,i)=>{kr(r,({str:a,idx:s,tokenType:o})=>{if(i${o.name}<- can never be matched. + See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:_i.SOI_ANCHOR_FOUND,tokenTypes:[a]}))}E(Xpe,"findStartOfInputAnchor");function jpe(t){const e=al(t,n=>{const i=n[Gp];return i instanceof RegExp&&(i.multiline||i.global)});return mr(e,n=>({message:"Token Type: ->"+n.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:_i.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[n]}))}E(jpe,"findUnsupportedFlags");function Kpe(t){const e=[];let r=mr(t,a=>Mo(t,(s,o)=>(a.PATTERN.source===o.PATTERN.source&&!Ms(e,o)&&o.PATTERN!==$s.NA&&(e.push(o),s.push(o)),s),[]));r=uC(r);const n=al(r,a=>a.length>1);return mr(n,a=>{const s=mr(a,l=>l.name);return{message:`The same RegExp pattern ->${Nl(a).PATTERN}<-has been used in all of the following Token Types: ${s.join(", ")} <-`,type:_i.DUPLICATE_PATTERNS_FOUND,tokenTypes:a}})}E(Kpe,"findDuplicatePatterns");function Zpe(t){const e=al(t,n=>{if(!Er(n,"GROUP"))return!1;const i=n.GROUP;return i!==$s.SKIPPED&&i!==$s.NA&&!io(i)});return mr(e,n=>({message:"Token Type: ->"+n.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:_i.INVALID_GROUP_TYPE_FOUND,tokenTypes:[n]}))}E(Zpe,"findInvalidGroupType");function Qpe(t,e){const r=al(t,i=>i.PUSH_MODE!==void 0&&!Ms(e,i.PUSH_MODE));return mr(r,i=>({message:`Token Type: ->${i.name}<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->${i.PUSH_MODE}<-which does not exist`,type:_i.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[i]}))}E(Qpe,"findModesThatDoNotExist");function Jpe(t){const e=[],r=Mo(t,(n,i,a)=>{const s=i.PATTERN;return s===$s.NA||(io(s)?n.push({str:s,idx:a,tokenType:i}):Zu(s)&&t0e(s)&&n.push({str:s.source,idx:a,tokenType:i})),n},[]);return Ir(t,(n,i)=>{Ir(r,({str:a,idx:s,tokenType:o})=>{if(i${o.name}<- can never be matched. Because it appears AFTER the Token Type ->${n.name}<-in the lexer's definition. -See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;e.push({message:l,type:si.UNREACHABLE_PATTERN,tokenTypes:[n,o]})}})}),e}E($oe,"findUnreachablePatterns");function Poe(t,e){if(Qc(e)){if(Foe(e))return!1;const r=e.exec(t);return r!==null&&r.index===0}else{if(Zc(e))return e(t,0,[],{});if(br(e,"exec"))return e.exec(t,0,[],{});if(typeof e=="string")return e===t;throw Error("non exhaustive match")}}E(Poe,"tryToMatchStrToPattern");function Boe(t){return xg([".","\\","[","]","|","^","$","(",")","?","*","+","{"],r=>t.source.indexOf(r)!==-1)===void 0}E(Boe,"noMetaChar");function Foe(t){return/(\(\?=)|(\(\?!)|(\(\?<=)|(\(\? property in its definition -`,type:si.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),br(t,zk)||n.push({message:"A MultiMode Lexer cannot be initialized without a <"+zk+`> property in its definition -`,type:si.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),br(t,zk)&&br(t,uT)&&!br(t.modes,t.defaultMode)&&n.push({message:`A MultiMode Lexer cannot be initialized with a ${uT}: <${t.defaultMode}>which does not exist -`,type:si.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),br(t,zk)&&kr(t.modes,(i,a)=>{kr(i,(s,o)=>{if(Jc(s))n.push({message:`A Lexer cannot be initialized using an undefined Token Type. Mode:<${a}> at index: <${o}> -`,type:si.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED});else if(br(s,"LONGER_ALT")){const l=Zr(s.LONGER_ALT)?s.LONGER_ALT:[s.LONGER_ALT];kr(l,u=>{!Jc(u)&&!ns(i,u)&&n.push({message:`A MultiMode Lexer cannot be initialized with a longer_alt <${u.name}> on token <${s.name}> outside of mode <${a}> -`,type:si.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE})})}})}),n}E(zoe,"performRuntimeChecks");function Goe(t,e,r){const n=[];let i=!1;const a=nT(Ho(Vi(t.modes))),s=Dk(a,l=>l[Ef]===as.NA),o=fM(r);return e&&kr(s,l=>{const u=dM(l,o);if(u!==!1){const d={message:Woe(l,u),type:u.issue,tokenType:l};n.push(d)}else br(l,"LINE_BREAKS")?l.LINE_BREAKS===!0&&(i=!0):Fk(o,l.PATTERN)&&(i=!0)}),e&&!i&&n.push({message:`Warning: No LINE_BREAKS Found. +See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;e.push({message:l,type:_i.UNREACHABLE_PATTERN,tokenTypes:[n,o]})}})}),e}E(Jpe,"findUnreachablePatterns");function e0e(t,e){if(Zu(e)){if(r0e(e))return!1;const r=e.exec(t);return r!==null&&r.index===0}else{if(Ku(e))return e(t,0,[],{});if(Er(e,"exec"))return e.exec(t,0,[],{});if(typeof e=="string")return e===t;throw Error("non exhaustive match")}}E(e0e,"tryToMatchStrToPattern");function t0e(t){return Jm([".","\\","[","]","|","^","$","(",")","?","*","+","{"],r=>t.source.indexOf(r)!==-1)===void 0}E(t0e,"noMetaChar");function r0e(t){return/(\(\?=)|(\(\?!)|(\(\?<=)|(\(\? property in its definition +`,type:_i.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),Er(t,F_)||n.push({message:"A MultiMode Lexer cannot be initialized without a <"+F_+`> property in its definition +`,type:_i.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),Er(t,F_)&&Er(t,yC)&&!Er(t.modes,t.defaultMode)&&n.push({message:`A MultiMode Lexer cannot be initialized with a ${yC}: <${t.defaultMode}>which does not exist +`,type:_i.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),Er(t,F_)&&Ir(t.modes,(i,a)=>{Ir(i,(s,o)=>{if(Qu(s))n.push({message:`A Lexer cannot be initialized using an undefined Token Type. Mode:<${a}> at index: <${o}> +`,type:_i.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED});else if(Er(s,"LONGER_ALT")){const l=on(s.LONGER_ALT)?s.LONGER_ALT:[s.LONGER_ALT];Ir(l,u=>{!Qu(u)&&!Ms(i,u)&&n.push({message:`A MultiMode Lexer cannot be initialized with a longer_alt <${u.name}> on token <${s.name}> outside of mode <${a}> +`,type:_i.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE})})}})}),n}E(n0e,"performRuntimeChecks");function i0e(t,e,r){const n=[];let i=!1;const a=uC(Dl(da(t.modes))),s=I_(a,l=>l[Gp]===$s.NA),o=qP(r);return e&&Ir(s,l=>{const u=GP(l,o);if(u!==!1){const d={message:o0e(l,u),type:u.issue,tokenType:l};n.push(d)}else Er(l,"LINE_BREAKS")?l.LINE_BREAKS===!0&&(i=!0):B_(o,l.PATTERN)&&(i=!0)}),e&&!i&&n.push({message:`Warning: No LINE_BREAKS Found. This Lexer has been defined to track line and column information, But none of the Token Types can be identified as matching a line terminator. - See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#LINE_BREAKS - for details.`,type:si.NO_LINE_BREAKS_FLAGS}),n}E(Goe,"performWarningRuntimeChecks");function qoe(t){const e={},r=Ks(t);return kr(r,n=>{const i=t[n];if(Zr(i))e[n]=[];else throw Error("non exhaustive match")}),e}E(qoe,"cloneEmptyGroups");function hM(t){const e=t.PATTERN;if(Qc(e))return!1;if(Zc(e))return!0;if(br(e,"exec"))return!0;if(Ss(e))return!1;throw Error("non exhaustive match")}E(hM,"isCustomPattern");function Voe(t){return Ss(t)&&t.length===1?t.charCodeAt(0):!1}E(Voe,"isShortPattern");var wQe={test:E(function(t){const e=t.length;for(let r=this.lastIndex;r{const i=t[n];if(on(i))e[n]=[];else throw Error("non exhaustive match")}),e}E(a0e,"cloneEmptyGroups");function zP(t){const e=t.PATTERN;if(Zu(e))return!1;if(Ku(e))return!0;if(Er(e,"exec"))return!0;if(io(e))return!1;throw Error("non exhaustive match")}E(zP,"isCustomPattern");function s0e(t){return io(t)&&t.length===1?t.charCodeAt(0):!1}E(s0e,"isShortPattern");var ult={test:E(function(t){const e=t.length;for(let r=this.lastIndex;r Token Type Root cause: ${e.errMsg}. - For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR`;if(e.issue===si.CUSTOM_LINE_BREAK)return`Warning: A Custom Token Pattern should specify the option. + For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR`;if(e.issue===_i.CUSTOM_LINE_BREAK)return`Warning: A Custom Token Pattern should specify the option. The problem is in the <${t.name}> Token Type - For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK`;throw Error("non exhaustive match")}E(Woe,"buildLineBreakIssueMessage");function fM(t){return ur(t,r=>Ss(r)?r.charCodeAt(0):r)}E(fM,"getCharCodes");function Gk(t,e,r){t[e]===void 0?t[e]=[r]:t[e].push(r)}E(Gk,"addToMapOfArrays");var hT=256,qk=[];function eu(t){return t255?255+~~(t/255):t}}E(Uoe,"initCharCodeToOptimizedIndexMap");function kg(t,e){const r=t.tokenTypeIdx;return r===e.tokenTypeIdx?!0:e.isParent===!0&&e.categoryMatchesMap[r]===!0}E(kg,"tokenStructuredMatcher");function dT(t,e){return t.tokenTypeIdx===e.tokenTypeIdx}E(dT,"tokenStructuredMatcherNoCategories");var Hoe=1,Yoe={};function Eg(t){const e=Xoe(t);Koe(e),Zoe(e),joe(e),kr(e,r=>{r.isParent=r.categoryMatches.length>0})}E(Eg,"augmentTokenTypes");function Xoe(t){let e=ma(t),r=t,n=!0;for(;n;){r=nT(Ho(ur(r,a=>a.CATEGORIES)));const i=Ik(r,e);e=e.concat(i),An(i)?n=!1:r=i}return e}E(Xoe,"expandCategories");function Koe(t){kr(t,e=>{gM(e)||(Yoe[Hoe]=e,e.tokenTypeIdx=Hoe++),mM(e)&&!Zr(e.CATEGORIES)&&(e.CATEGORIES=[e.CATEGORIES]),mM(e)||(e.CATEGORIES=[]),Qoe(e)||(e.categoryMatches=[]),Joe(e)||(e.categoryMatchesMap={})})}E(Koe,"assignTokenDefaultProps");function joe(t){kr(t,e=>{e.categoryMatches=[],kr(e.categoryMatchesMap,(r,n)=>{e.categoryMatches.push(Yoe[n].tokenTypeIdx)})})}E(joe,"assignCategoriesTokensProp");function Zoe(t){kr(t,e=>{pM([],e)})}E(Zoe,"assignCategoriesMapProp");function pM(t,e){kr(t,r=>{e.categoryMatchesMap[r.tokenTypeIdx]=!0}),kr(e.CATEGORIES,r=>{const n=t.concat(e);ns(n,r)||pM(n,r)})}E(pM,"singleAssignCategoriesToksMap");function gM(t){return br(t,"tokenTypeIdx")}E(gM,"hasShortKeyProperty");function mM(t){return br(t,"CATEGORIES")}E(mM,"hasCategoriesProperty");function Qoe(t){return br(t,"categoryMatches")}E(Qoe,"hasExtendingTokensTypesProperty");function Joe(t){return br(t,"categoryMatchesMap")}E(Joe,"hasExtendingTokensTypesMapProperty");function ele(t){return br(t,"tokenTypeIdx")}E(ele,"isTokenType");var yM={buildUnableToPopLexerModeMessage(t){return`Unable to pop Lexer Mode after encountering Token ->${t.image}<- The Mode Stack is empty`},buildUnexpectedCharactersMessage(t,e,r,n,i,a){return`unexpected character: ->${t.charAt(e)}<- at offset: ${e}, skipped ${r} characters.`}},si;(function(t){t[t.MISSING_PATTERN=0]="MISSING_PATTERN",t[t.INVALID_PATTERN=1]="INVALID_PATTERN",t[t.EOI_ANCHOR_FOUND=2]="EOI_ANCHOR_FOUND",t[t.UNSUPPORTED_FLAGS_FOUND=3]="UNSUPPORTED_FLAGS_FOUND",t[t.DUPLICATE_PATTERNS_FOUND=4]="DUPLICATE_PATTERNS_FOUND",t[t.INVALID_GROUP_TYPE_FOUND=5]="INVALID_GROUP_TYPE_FOUND",t[t.PUSH_MODE_DOES_NOT_EXIST=6]="PUSH_MODE_DOES_NOT_EXIST",t[t.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE=7]="MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE",t[t.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY=8]="MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY",t[t.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST=9]="MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST",t[t.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED=10]="LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED",t[t.SOI_ANCHOR_FOUND=11]="SOI_ANCHOR_FOUND",t[t.EMPTY_MATCH_PATTERN=12]="EMPTY_MATCH_PATTERN",t[t.NO_LINE_BREAKS_FLAGS=13]="NO_LINE_BREAKS_FLAGS",t[t.UNREACHABLE_PATTERN=14]="UNREACHABLE_PATTERN",t[t.IDENTIFY_TERMINATOR=15]="IDENTIFY_TERMINATOR",t[t.CUSTOM_LINE_BREAK=16]="CUSTOM_LINE_BREAK",t[t.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE=17]="MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE"})(si||(si={}));var fT={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:[` -`,"\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:yM,traceInitPerf:!1,skipValidations:!1,recoveryEnabled:!0};Object.freeze(fT);var as=(r1=class{constructor(e,r=fT){if(this.lexerDefinition=e,this.lexerDefinitionErrors=[],this.lexerDefinitionWarning=[],this.patternIdxToConfig={},this.charCodeToPatternIdxToConfig={},this.modes=[],this.emptyGroups={},this.trackStartLines=!0,this.trackEndLines=!0,this.hasCustom=!1,this.canModeBeOptimized={},this.TRACE_INIT=(i,a)=>{if(this.traceInitPerf===!0){this.traceInitIndent++;const s=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent <${i}>`);const{time:o,value:l}=sM(a),u=o>10?console.warn:console.log;return this.traceInitIndent time: ${o}ms`),this.traceInitIndent--,l}else return a()},typeof r=="boolean")throw Error(`The second argument to the Lexer constructor is now an ILexerConfig Object. -a boolean 2nd argument is no longer supported`);this.config=js({},fT,r);const n=this.config.traceInitPerf;n===!0?(this.traceInitMaxIdent=1/0,this.traceInitPerf=!0):typeof n=="number"&&(this.traceInitMaxIdent=n,this.traceInitPerf=!0),this.traceInitIndent=-1,this.TRACE_INIT("Lexer Constructor",()=>{let i,a=!0;this.TRACE_INIT("Lexer Config handling",()=>{if(this.config.lineTerminatorsPattern===fT.lineTerminatorsPattern)this.config.lineTerminatorsPattern=wQe;else if(this.config.lineTerminatorCharacters===fT.lineTerminatorCharacters)throw Error(`Error: Missing property on the Lexer config. - For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#MISSING_LINE_TERM_CHARS`);if(r.safeMode&&r.ensureOptimizations)throw Error('"safeMode" and "ensureOptimizations" flags are mutually exclusive.');this.trackStartLines=/full|onlyStart/i.test(this.config.positionTracking),this.trackEndLines=/full/i.test(this.config.positionTracking),Zr(e)?i={modes:{defaultMode:ma(e)},defaultMode:uT}:(a=!1,i=ma(e))}),this.config.skipValidations===!1&&(this.TRACE_INIT("performRuntimeChecks",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(zoe(i,this.trackStartLines,this.config.lineTerminatorCharacters))}),this.TRACE_INIT("performWarningRuntimeChecks",()=>{this.lexerDefinitionWarning=this.lexerDefinitionWarning.concat(Goe(i,this.trackStartLines,this.config.lineTerminatorCharacters))})),i.modes=i.modes?i.modes:{},kr(i.modes,(o,l)=>{i.modes[l]=Dk(o,u=>Jc(u))});const s=Ks(i.modes);if(kr(i.modes,(o,l)=>{this.TRACE_INIT(`Mode: <${l}> processing`,()=>{if(this.modes.push(l),this.config.skipValidations===!1&&this.TRACE_INIT("validatePatterns",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(Eoe(o,s))}),An(this.lexerDefinitionErrors)){Eg(o);let u;this.TRACE_INIT("analyzeTokenTypes",()=>{u=koe(o,{lineTerminatorCharacters:this.config.lineTerminatorCharacters,positionTracking:r.positionTracking,ensureOptimizations:r.ensureOptimizations,safeMode:r.safeMode,tracer:this.TRACE_INIT})}),this.patternIdxToConfig[l]=u.patternIdxToConfig,this.charCodeToPatternIdxToConfig[l]=u.charCodeToPatternIdxToConfig,this.emptyGroups=js({},this.emptyGroups,u.emptyGroups),this.hasCustom=u.hasCustom||this.hasCustom,this.canModeBeOptimized[l]=u.canBeOptimized}})}),this.defaultMode=i.defaultMode,!An(this.lexerDefinitionErrors)&&!this.config.deferDefinitionErrorsHandling){const l=ur(this.lexerDefinitionErrors,u=>u.message).join(`----------------------- + For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK`;throw Error("non exhaustive match")}E(o0e,"buildLineBreakIssueMessage");function qP(t){return mr(t,r=>io(r)?r.charCodeAt(0):r)}E(qP,"getCharCodes");function z_(t,e,r){t[e]===void 0?t[e]=[r]:t[e].push(r)}E(z_,"addToMapOfArrays");var vC=256,G_=[];function Ju(t){return t255?255+~~(t/255):t}}E(l0e,"initCharCodeToOptimizedIndexMap");function n1(t,e){const r=t.tokenTypeIdx;return r===e.tokenTypeIdx?!0:e.isParent===!0&&e.categoryMatchesMap[r]===!0}E(n1,"tokenStructuredMatcher");function bC(t,e){return t.tokenTypeIdx===e.tokenTypeIdx}E(bC,"tokenStructuredMatcherNoCategories");var c0e=1,u0e={};function i1(t){const e=h0e(t);d0e(e),p0e(e),f0e(e),Ir(e,r=>{r.isParent=r.categoryMatches.length>0})}E(i1,"augmentTokenTypes");function h0e(t){let e=Ga(t),r=t,n=!0;for(;n;){r=uC(Dl(mr(r,a=>a.CATEGORIES)));const i=L_(r,e);e=e.concat(i),qn(i)?n=!1:r=i}return e}E(h0e,"expandCategories");function d0e(t){Ir(t,e=>{WP(e)||(u0e[c0e]=e,e.tokenTypeIdx=c0e++),UP(e)&&!on(e.CATEGORIES)&&(e.CATEGORIES=[e.CATEGORIES]),UP(e)||(e.CATEGORIES=[]),g0e(e)||(e.categoryMatches=[]),m0e(e)||(e.categoryMatchesMap={})})}E(d0e,"assignTokenDefaultProps");function f0e(t){Ir(t,e=>{e.categoryMatches=[],Ir(e.categoryMatchesMap,(r,n)=>{e.categoryMatches.push(u0e[n].tokenTypeIdx)})})}E(f0e,"assignCategoriesTokensProp");function p0e(t){Ir(t,e=>{VP([],e)})}E(p0e,"assignCategoriesMapProp");function VP(t,e){Ir(t,r=>{e.categoryMatchesMap[r.tokenTypeIdx]=!0}),Ir(e.CATEGORIES,r=>{const n=t.concat(e);Ms(n,r)||VP(n,r)})}E(VP,"singleAssignCategoriesToksMap");function WP(t){return Er(t,"tokenTypeIdx")}E(WP,"hasShortKeyProperty");function UP(t){return Er(t,"CATEGORIES")}E(UP,"hasCategoriesProperty");function g0e(t){return Er(t,"categoryMatches")}E(g0e,"hasExtendingTokensTypesProperty");function m0e(t){return Er(t,"categoryMatchesMap")}E(m0e,"hasExtendingTokensTypesMapProperty");function y0e(t){return Er(t,"tokenTypeIdx")}E(y0e,"isTokenType");var HP={buildUnableToPopLexerModeMessage(t){return`Unable to pop Lexer Mode after encountering Token ->${t.image}<- The Mode Stack is empty`},buildUnexpectedCharactersMessage(t,e,r,n,i,a){return`unexpected character: ->${t.charAt(e)}<- at offset: ${e}, skipped ${r} characters.`}},_i;(function(t){t[t.MISSING_PATTERN=0]="MISSING_PATTERN",t[t.INVALID_PATTERN=1]="INVALID_PATTERN",t[t.EOI_ANCHOR_FOUND=2]="EOI_ANCHOR_FOUND",t[t.UNSUPPORTED_FLAGS_FOUND=3]="UNSUPPORTED_FLAGS_FOUND",t[t.DUPLICATE_PATTERNS_FOUND=4]="DUPLICATE_PATTERNS_FOUND",t[t.INVALID_GROUP_TYPE_FOUND=5]="INVALID_GROUP_TYPE_FOUND",t[t.PUSH_MODE_DOES_NOT_EXIST=6]="PUSH_MODE_DOES_NOT_EXIST",t[t.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE=7]="MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE",t[t.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY=8]="MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY",t[t.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST=9]="MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST",t[t.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED=10]="LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED",t[t.SOI_ANCHOR_FOUND=11]="SOI_ANCHOR_FOUND",t[t.EMPTY_MATCH_PATTERN=12]="EMPTY_MATCH_PATTERN",t[t.NO_LINE_BREAKS_FLAGS=13]="NO_LINE_BREAKS_FLAGS",t[t.UNREACHABLE_PATTERN=14]="UNREACHABLE_PATTERN",t[t.IDENTIFY_TERMINATOR=15]="IDENTIFY_TERMINATOR",t[t.CUSTOM_LINE_BREAK=16]="CUSTOM_LINE_BREAK",t[t.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE=17]="MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE"})(_i||(_i={}));var xC={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:[` +`,"\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:HP,traceInitPerf:!1,skipValidations:!1,recoveryEnabled:!0};Object.freeze(xC);var $s=($y=class{constructor(e,r=xC){if(this.lexerDefinition=e,this.lexerDefinitionErrors=[],this.lexerDefinitionWarning=[],this.patternIdxToConfig={},this.charCodeToPatternIdxToConfig={},this.modes=[],this.emptyGroups={},this.trackStartLines=!0,this.trackEndLines=!0,this.hasCustom=!1,this.canModeBeOptimized={},this.TRACE_INIT=(i,a)=>{if(this.traceInitPerf===!0){this.traceInitIndent++;const s=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent <${i}>`);const{time:o,value:l}=$P(a),u=o>10?console.warn:console.log;return this.traceInitIndent time: ${o}ms`),this.traceInitIndent--,l}else return a()},typeof r=="boolean")throw Error(`The second argument to the Lexer constructor is now an ILexerConfig Object. +a boolean 2nd argument is no longer supported`);this.config=Do({},xC,r);const n=this.config.traceInitPerf;n===!0?(this.traceInitMaxIdent=1/0,this.traceInitPerf=!0):typeof n=="number"&&(this.traceInitMaxIdent=n,this.traceInitPerf=!0),this.traceInitIndent=-1,this.TRACE_INIT("Lexer Constructor",()=>{let i,a=!0;this.TRACE_INIT("Lexer Config handling",()=>{if(this.config.lineTerminatorsPattern===xC.lineTerminatorsPattern)this.config.lineTerminatorsPattern=ult;else if(this.config.lineTerminatorCharacters===xC.lineTerminatorCharacters)throw Error(`Error: Missing property on the Lexer config. + For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#MISSING_LINE_TERM_CHARS`);if(r.safeMode&&r.ensureOptimizations)throw Error('"safeMode" and "ensureOptimizations" flags are mutually exclusive.');this.trackStartLines=/full|onlyStart/i.test(this.config.positionTracking),this.trackEndLines=/full/i.test(this.config.positionTracking),on(e)?i={modes:{defaultMode:Ga(e)},defaultMode:yC}:(a=!1,i=Ga(e))}),this.config.skipValidations===!1&&(this.TRACE_INIT("performRuntimeChecks",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(n0e(i,this.trackStartLines,this.config.lineTerminatorCharacters))}),this.TRACE_INIT("performWarningRuntimeChecks",()=>{this.lexerDefinitionWarning=this.lexerDefinitionWarning.concat(i0e(i,this.trackStartLines,this.config.lineTerminatorCharacters))})),i.modes=i.modes?i.modes:{},Ir(i.modes,(o,l)=>{i.modes[l]=I_(o,u=>Qu(u))});const s=Io(i.modes);if(Ir(i.modes,(o,l)=>{this.TRACE_INIT(`Mode: <${l}> processing`,()=>{if(this.modes.push(l),this.config.skipValidations===!1&&this.TRACE_INIT("validatePatterns",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(qpe(o,s))}),qn(this.lexerDefinitionErrors)){i1(o);let u;this.TRACE_INIT("analyzeTokenTypes",()=>{u=Gpe(o,{lineTerminatorCharacters:this.config.lineTerminatorCharacters,positionTracking:r.positionTracking,ensureOptimizations:r.ensureOptimizations,safeMode:r.safeMode,tracer:this.TRACE_INIT})}),this.patternIdxToConfig[l]=u.patternIdxToConfig,this.charCodeToPatternIdxToConfig[l]=u.charCodeToPatternIdxToConfig,this.emptyGroups=Do({},this.emptyGroups,u.emptyGroups),this.hasCustom=u.hasCustom||this.hasCustom,this.canModeBeOptimized[l]=u.canBeOptimized}})}),this.defaultMode=i.defaultMode,!qn(this.lexerDefinitionErrors)&&!this.config.deferDefinitionErrorsHandling){const l=mr(this.lexerDefinitionErrors,u=>u.message).join(`----------------------- `);throw new Error(`Errors detected in definition of Lexer: -`+l)}kr(this.lexerDefinitionWarning,o=>{aM(o.message)}),this.TRACE_INIT("Choosing sub-methods implementations",()=>{if(a&&(this.handleModes=ta),this.trackStartLines===!1&&(this.computeNewColumn=Ux),this.trackEndLines===!1&&(this.updateTokenEndLineColumnLocation=ta),/full/i.test(this.config.positionTracking))this.createTokenInstance=this.createFullToken;else if(/onlyStart/i.test(this.config.positionTracking))this.createTokenInstance=this.createStartOnlyToken;else if(/onlyOffset/i.test(this.config.positionTracking))this.createTokenInstance=this.createOffsetOnlyToken;else throw Error(`Invalid config option: "${this.config.positionTracking}"`);this.hasCustom?(this.addToken=this.addTokenUsingPush,this.handlePayload=this.handlePayloadWithCustom):(this.addToken=this.addTokenUsingMemberAccess,this.handlePayload=this.handlePayloadNoCustom)}),this.TRACE_INIT("Failed Optimization Warnings",()=>{const o=Zs(this.canModeBeOptimized,(l,u,h)=>(u===!1&&l.push(h),l),[]);if(r.ensureOptimizations&&!An(o))throw Error(`Lexer Modes: < ${o.join(", ")} > cannot be optimized. +`+l)}Ir(this.lexerDefinitionWarning,o=>{NP(o.message)}),this.TRACE_INIT("Choosing sub-methods implementations",()=>{if(a&&(this.handleModes=ka),this.trackStartLines===!1&&(this.computeNewColumn=Qw),this.trackEndLines===!1&&(this.updateTokenEndLineColumnLocation=ka),/full/i.test(this.config.positionTracking))this.createTokenInstance=this.createFullToken;else if(/onlyStart/i.test(this.config.positionTracking))this.createTokenInstance=this.createStartOnlyToken;else if(/onlyOffset/i.test(this.config.positionTracking))this.createTokenInstance=this.createOffsetOnlyToken;else throw Error(`Invalid config option: "${this.config.positionTracking}"`);this.hasCustom?(this.addToken=this.addTokenUsingPush,this.handlePayload=this.handlePayloadWithCustom):(this.addToken=this.addTokenUsingMemberAccess,this.handlePayload=this.handlePayloadNoCustom)}),this.TRACE_INIT("Failed Optimization Warnings",()=>{const o=Mo(this.canModeBeOptimized,(l,u,h)=>(u===!1&&l.push(h),l),[]);if(r.ensureOptimizations&&!qn(o))throw Error(`Lexer Modes: < ${o.join(", ")} > cannot be optimized. Disable the "ensureOptimizations" lexer config flag to silently ignore this and run the lexer in an un-optimized mode. - Or inspect the console log for details on how to resolve these issues.`)}),this.TRACE_INIT("clearRegExpParserCache",()=>{xoe()}),this.TRACE_INIT("toFastProperties",()=>{oM(this)})})}tokenize(e,r=this.defaultMode){if(!An(this.lexerDefinitionErrors)){const i=ur(this.lexerDefinitionErrors,a=>a.message).join(`----------------------- + Or inspect the console log for details on how to resolve these issues.`)}),this.TRACE_INIT("clearRegExpParserCache",()=>{Ppe()}),this.TRACE_INIT("toFastProperties",()=>{OP(this)})})}tokenize(e,r=this.defaultMode){if(!qn(this.lexerDefinitionErrors)){const i=mr(this.lexerDefinitionErrors,a=>a.message).join(`----------------------- `);throw new Error(`Unable to Tokenize because Errors detected in definition of Lexer: -`+i)}return this.tokenizeInternal(e,r)}tokenizeInternal(e,r){let n,i,a,s,o,l,u,h,d,f,p,g,m,y,v;const T=e,b=T.length;let w=0,k=0;const A=this.hasCustom?0:Math.floor(e.length/10),C=new Array(A),_=[];let L=this.trackStartLines?1:void 0,O=this.trackStartLines?1:void 0;const M=qoe(this.emptyGroups),z=this.trackStartLines,F=this.config.lineTerminatorsPattern;let S=0,R=[],N=[];const D=[],I=[];Object.freeze(I);let $=!1;const B=E(Y=>{if(D.length===1&&Y.tokenType.PUSH_MODE===void 0){const W=this.config.errorMessageProvider.buildUnableToPopLexerModeMessage(Y);_.push({offset:Y.startOffset,line:Y.startLine,column:Y.startColumn,length:Y.image.length,message:W})}else{D.pop();const W=kf(D);R=this.patternIdxToConfig[W],N=this.charCodeToPatternIdxToConfig[W],S=R.length;const ie=this.canModeBeOptimized[W]&&this.config.safeMode===!1;N&&ie?$=!0:$=!1}},"pop_mode");function P(Y){D.push(Y),N=this.charCodeToPatternIdxToConfig[Y],R=this.patternIdxToConfig[Y],S=R.length,S=R.length;const W=this.canModeBeOptimized[Y]&&this.config.safeMode===!1;N&&W?$=!0:$=!1}E(P,"push_mode"),P.call(this,r);let G;const V=this.config.recoveryEnabled;for(;wl.length){l=s,d=s.length,u=h,G=Z;break}}}break}}if(d!==-1){if(f=G.group,f!==void 0&&(l=l!==null?l:e.substring(w,w+d),p=G.tokenTypeIdx,g=this.createTokenInstance(l,w,p,G.tokenType,L,O,d),this.handlePayload(g,u),f===!1?k=this.addToken(C,k,g):M[f].push(g)),z===!0&&G.canLineTerminator===!0){let K=0,se,J;F.lastIndex=0;do l=l!==null?l:e.substring(w,w+d),se=F.test(l),se===!0&&(J=F.lastIndex-1,K++);while(se===!0);K!==0?(L=L+K,O=d-J,this.updateTokenEndLineColumnLocation(g,f,J,K,L,O,d)):O=this.computeNewColumn(O,d)}else O=this.computeNewColumn(O,d);w=w+d,this.handleModes(G,B,P,g)}else{const K=w,se=L,J=O;let Z=V===!1;for(;Z===!1&&w ${Sf(t)} <--`:`token of type --> ${t.name} <--`} but found --> '${e.image}' <--`},buildNotAllInputParsedMessage({firstRedundant:t,ruleName:e}){return"Redundant input, expecting EOF but found: "+t.image},buildNoViableAltMessage({expectedPathsPerAlt:t,actual:e,previous:r,customUserDescription:n,ruleName:i}){const a="Expecting: ",o=` -but found: '`+Xo(e).image+"'";if(n)return a+n+o;{const l=Zs(t,(f,p)=>f.concat(p),[]),u=ur(l,f=>`[${ur(f,p=>Sf(p)).join(", ")}]`),d=`one of these possible Token sequences: -${ur(u,(f,p)=>` ${p+1}. ${f}`).join(` +`+i)}return this.tokenizeInternal(e,r)}tokenizeInternal(e,r){let n,i,a,s,o,l,u,h,d,f,p,g,m,y,v;const x=e,b=x.length;let w=0,C=0;const _=this.hasCustom?0:Math.floor(e.length/10),k=new Array(_),S=[];let L=this.trackStartLines?1:void 0,$=this.trackStartLines?1:void 0;const I=a0e(this.emptyGroups),z=this.trackStartLines,F=this.config.lineTerminatorsPattern;let A=0,R=[],N=[];const M=[],D=[];Object.freeze(D);let O=!1;const B=E(H=>{if(M.length===1&&H.tokenType.PUSH_MODE===void 0){const W=this.config.errorMessageProvider.buildUnableToPopLexerModeMessage(H);S.push({offset:H.startOffset,line:H.startLine,column:H.startColumn,length:H.image.length,message:W})}else{M.pop();const W=zp(M);R=this.patternIdxToConfig[W],N=this.charCodeToPatternIdxToConfig[W],A=R.length;const ie=this.canModeBeOptimized[W]&&this.config.safeMode===!1;N&&ie?O=!0:O=!1}},"pop_mode");function P(H){M.push(H),N=this.charCodeToPatternIdxToConfig[H],R=this.patternIdxToConfig[H],A=R.length,A=R.length;const W=this.canModeBeOptimized[H]&&this.config.safeMode===!1;N&&W?O=!0:O=!1}E(P,"push_mode"),P.call(this,r);let G;const V=this.config.recoveryEnabled;for(;wl.length){l=s,d=s.length,u=h,G=K;break}}}break}}if(d!==-1){if(f=G.group,f!==void 0&&(l=l!==null?l:e.substring(w,w+d),p=G.tokenTypeIdx,g=this.createTokenInstance(l,w,p,G.tokenType,L,$,d),this.handlePayload(g,u),f===!1?C=this.addToken(k,C,g):I[f].push(g)),z===!0&&G.canLineTerminator===!0){let j=0,ae,J;F.lastIndex=0;do l=l!==null?l:e.substring(w,w+d),ae=F.test(l),ae===!0&&(J=F.lastIndex-1,j++);while(ae===!0);j!==0?(L=L+j,$=d-J,this.updateTokenEndLineColumnLocation(g,f,J,j,L,$,d)):$=this.computeNewColumn($,d)}else $=this.computeNewColumn($,d);w=w+d,this.handleModes(G,B,P,g)}else{const j=w,ae=L,J=$;let K=V===!1;for(;K===!1&&w ${qp(t)} <--`:`token of type --> ${t.name} <--`} but found --> '${e.image}' <--`},buildNotAllInputParsedMessage({firstRedundant:t,ruleName:e}){return"Redundant input, expecting EOF but found: "+t.image},buildNoViableAltMessage({expectedPathsPerAlt:t,actual:e,previous:r,customUserDescription:n,ruleName:i}){const a="Expecting: ",o=` +but found: '`+Nl(e).image+"'";if(n)return a+n+o;{const l=Mo(t,(f,p)=>f.concat(p),[]),u=mr(l,f=>`[${mr(f,p=>qp(p)).join(", ")}]`),d=`one of these possible Token sequences: +${mr(u,(f,p)=>` ${p+1}. ${f}`).join(` `)}`;return a+d+o}},buildEarlyExitMessage({expectedIterationPaths:t,actual:e,customUserDescription:r,ruleName:n}){const i="Expecting: ",s=` -but found: '`+Xo(e).image+"'";if(r)return i+r+s;{const l=`expecting at least one iteration which starts with one of these possible Token sequences:: - <${ur(t,u=>`[${ur(u,h=>Sf(h)).join(",")}]`).join(" ,")}>`;return i+l+s}}};Object.freeze(Ag);var kQe={buildRuleNotFoundError(t,e){return"Invalid grammar, reference to a rule which is not defined: ->"+e.nonTerminalName+`<- -inside top level rule: ->`+t.name+"<-"}},Af={buildDuplicateFoundError(t,e){function r(h){return h instanceof Pn?h.terminalType.name:h instanceof is?h.nonTerminalName:""}E(r,"getExtraProductionArgument");const n=t.name,i=Xo(e),a=i.idx,s=jo(i),o=r(i),l=a>0;let u=`->${s}${l?a:""}<- ${o?`with argument: ->${o}<-`:""} - appears more than once (${e.length} times) in the top level rule: ->${n}<-. - For further details see: https://chevrotain.io/docs/FAQ.html#NUMERICAL_SUFFIXES +but found: '`+Nl(e).image+"'";if(r)return i+r+s;{const l=`expecting at least one iteration which starts with one of these possible Token sequences:: + <${mr(t,u=>`[${mr(u,h=>qp(h)).join(",")}]`).join(" ,")}>`;return i+l+s}}};Object.freeze(s1);var dlt={buildRuleNotFoundError(t,e){return"Invalid grammar, reference to a rule which is not defined: ->"+e.nonTerminalName+`<- +inside top level rule: ->`+t.name+"<-"}},Vp={buildDuplicateFoundError(t,e){function r(h){return h instanceof ri?h.terminalType.name:h instanceof Ns?h.nonTerminalName:""}E(r,"getExtraProductionArgument");const n=t.name,i=Nl(e),a=i.idx,s=Ol(i),o=r(i),l=a>0;let u=`->${s}${l?a:""}<- ${o?`with argument: ->${o}<-`:""} + appears more than once (${e.length} times) in the top level rule: ->${n}<-. + For further details see: https://chevrotain.io/docs/FAQ.html#NUMERICAL_SUFFIXES `;return u=u.replace(/[ \t]+/g," "),u=u.replace(/\s\s+/g,` `),u},buildNamespaceConflictError(t){return`Namespace conflict found in grammar. The grammar has both a Terminal(Token) and a Non-Terminal(Rule) named: <${t.name}>. To resolve this make sure each Terminal and Non-Terminal names are unique This is easy to accomplish by using the convention that Terminal names start with an uppercase letter -and Non-Terminal names start with a lower case letter.`},buildAlternationPrefixAmbiguityError(t){const e=ur(t.prefixPath,i=>Sf(i)).join(", "),r=t.alternation.idx===0?"":t.alternation.idx;return`Ambiguous alternatives: <${t.ambiguityIndices.join(" ,")}> due to common lookahead prefix +and Non-Terminal names start with a lower case letter.`},buildAlternationPrefixAmbiguityError(t){const e=mr(t.prefixPath,i=>qp(i)).join(", "),r=t.alternation.idx===0?"":t.alternation.idx;return`Ambiguous alternatives: <${t.ambiguityIndices.join(" ,")}> due to common lookahead prefix in inside <${t.topLevelRule.name}> Rule, <${e}> may appears as a prefix path in all these alternatives. See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#COMMON_PREFIX For Further details.`},buildAlternationAmbiguityError(t){const e=t.alternation.idx===0?"":t.alternation.idx,r=t.prefixPath.length===0;let n=`Ambiguous Alternatives Detected: <${t.ambiguityIndices.join(" ,")}> in inside <${t.topLevelRule.name}> Rule, `;if(r)n+=`These alternatives are all empty (match no tokens), making them indistinguishable. Only the last alternative may be empty. -`;else{const i=ur(t.prefixPath,a=>Sf(a)).join(", ");n+=`<${i}> may appears as a prefix path in all these alternatives. +`;else{const i=mr(t.prefixPath,a=>qp(a)).join(", ");n+=`<${i}> may appears as a prefix path in all these alternatives. `}return n+=`See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES -For Further details.`,n},buildEmptyRepetitionError(t){let e=jo(t.repetition);return t.repetition.idx!==0&&(e+=t.repetition.idx),`The repetition <${e}> within Rule <${t.topLevelRule.name}> can never consume any tokens. +For Further details.`,n},buildEmptyRepetitionError(t){let e=Ol(t.repetition);return t.repetition.idx!==0&&(e+=t.repetition.idx),`The repetition <${e}> within Rule <${t.topLevelRule.name}> can never consume any tokens. This could lead to an infinite loop.`},buildTokenNameError(t){return"deprecated"},buildEmptyAlternationError(t){return`Ambiguous empty alternative: <${t.emptyChoiceIdx+1}> in inside <${t.topLevelRule.name}> Rule. Only the last alternative may be an empty alternative.`},buildTooManyAlternativesError(t){return`An Alternation cannot have more than 256 alternatives: inside <${t.topLevelRule.name}> Rule. - has ${t.alternation.definition.length+1} alternatives.`},buildLeftRecursionError(t){const e=t.topLevelRule.name,r=ur(t.leftRecursionPath,a=>a.name),n=`${e} --> ${r.concat([e]).join(" --> ")}`;return`Left Recursion found in grammar. + has ${t.alternation.definition.length+1} alternatives.`},buildLeftRecursionError(t){const e=t.topLevelRule.name,r=mr(t.leftRecursionPath,a=>a.name),n=`${e} --> ${r.concat([e]).join(" --> ")}`;return`Left Recursion found in grammar. rule: <${e}> can be invoked from itself (directly or indirectly) -without consuming any Tokens. The grammar path that causes this is: +without consuming any Tokens. The grammar path that causes this is: ${n} To fix this refactor your grammar to remove the left recursion. -see: https://en.wikipedia.org/wiki/LL_parser#Left_factoring.`},buildInvalidRuleNameError(t){return"deprecated"},buildDuplicateRuleNameError(t){let e;return t.topLevelRule instanceof Tg?e=t.topLevelRule.name:e=t.topLevelRule,`Duplicate definition, rule: ->${e}<- is already defined in the grammar: ->${t.grammarName}<-`}};function ule(t,e){const r=new EQe(t,e);return r.resolveRefs(),r.errors}E(ule,"resolveGrammar");var EQe=(n1=class extends wg{constructor(e,r){super(),this.nameToTopRule=e,this.errMsgProvider=r,this.errors=[]}resolveRefs(){kr(Vi(this.nameToTopRule),e=>{this.currTopLevel=e,e.accept(this)})}visitNonTerminal(e){const r=this.nameToTopRule[e.nonTerminalName];if(r)e.referencedRule=r;else{const n=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,e);this.errors.push({message:n,type:ss.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:e.nonTerminalName})}}},E(n1,"GastRefResolverVisitor"),n1),SQe=(i1=class extends Nk{constructor(e,r){super(),this.topProd=e,this.path=r,this.possibleTokTypes=[],this.nextProductionName="",this.nextProductionOccurrence=0,this.found=!1,this.isAtEndOfPath=!1}startWalking(){if(this.found=!1,this.path.ruleStack[0]!==this.topProd.name)throw Error("The path does not start with the walker's top Rule!");return this.ruleStack=ma(this.path.ruleStack).reverse(),this.occurrenceStack=ma(this.path.occurrenceStack).reverse(),this.ruleStack.pop(),this.occurrenceStack.pop(),this.updateExpectedNext(),this.walk(this.topProd),this.possibleTokTypes}walk(e,r=[]){this.found||super.walk(e,r)}walkProdRef(e,r,n){if(e.referencedRule.name===this.nextProductionName&&e.idx===this.nextProductionOccurrence){const i=r.concat(n);this.updateExpectedNext(),this.walk(e.referencedRule,i)}}updateExpectedNext(){An(this.ruleStack)?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())}},E(i1,"AbstractNextPossibleTokensWalker"),i1),AQe=(a1=class extends SQe{constructor(e,r){super(e,r),this.path=r,this.nextTerminalName="",this.nextTerminalOccurrence=0,this.nextTerminalName=this.path.lastTok.name,this.nextTerminalOccurrence=this.path.lastTokOccurrence}walkTerminal(e,r,n){if(this.isAtEndOfPath&&e.terminalType.name===this.nextTerminalName&&e.idx===this.nextTerminalOccurrence&&!this.found){const i=r.concat(n),a=new As({definition:i});this.possibleTokTypes=Cg(a),this.found=!0}}},E(a1,"NextAfterTokenWalker"),a1),Vk=(s1=class extends Nk{constructor(e,r){super(),this.topRule=e,this.occurrence=r,this.result={token:void 0,occurrence:void 0,isEndOfRule:void 0}}startWalking(){return this.walk(this.topRule),this.result}},E(s1,"AbstractNextTerminalAfterProductionWalker"),s1),_Qe=(o1=class extends Vk{walkMany(e,r,n){if(e.idx===this.occurrence){const i=Xo(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof Pn&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkMany(e,r,n)}},E(o1,"NextTerminalAfterManyWalker"),o1),hle=(l1=class extends Vk{walkManySep(e,r,n){if(e.idx===this.occurrence){const i=Xo(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof Pn&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkManySep(e,r,n)}},E(l1,"NextTerminalAfterManySepWalker"),l1),RQe=(c1=class extends Vk{walkAtLeastOne(e,r,n){if(e.idx===this.occurrence){const i=Xo(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof Pn&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOne(e,r,n)}},E(c1,"NextTerminalAfterAtLeastOneWalker"),c1),dle=(u1=class extends Vk{walkAtLeastOneSep(e,r,n){if(e.idx===this.occurrence){const i=Xo(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof Pn&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOneSep(e,r,n)}},E(u1,"NextTerminalAfterAtLeastOneSepWalker"),u1);function Wk(t,e,r=[]){r=ma(r);let n=[],i=0;function a(o){return o.concat(ya(t,i+1))}E(a,"remainingPathWith");function s(o){const l=Wk(a(o),e,r);return n.concat(l)}for(E(s,"getAlternativesForProd");r.length{An(l.definition)===!1&&(n=s(l.definition))}),n;if(o instanceof Pn)r.push(o.terminalType);else throw Error("non exhaustive match")}i++}return n.push({partialPath:r,suffixDef:ya(t,i)}),n}E(Wk,"possiblePathsFrom");function xM(t,e,r,n){const i="EXIT_NONE_TERMINAL",a=[i],s="EXIT_ALTERNATIVE";let o=!1;const l=e.length,u=l-n-1,h=[],d=[];for(d.push({idx:-1,def:t,ruleStack:[],occurrenceStack:[]});!An(d);){const f=d.pop();if(f===s){o&&kf(d).idx<=u&&d.pop();continue}const p=f.def,g=f.idx,m=f.ruleStack,y=f.occurrenceStack;if(An(p))continue;const v=p[0];if(v===i){const T={idx:g,def:ya(p),ruleStack:aT(m),occurrenceStack:aT(y)};d.push(T)}else if(v instanceof Pn)if(g=0;T--){const b=v.definition[T],w={idx:g,def:b.definition.concat(ya(p)),ruleStack:m,occurrenceStack:y};d.push(w),d.push(s)}else if(v instanceof As)d.push({idx:g,def:v.definition.concat(ya(p)),ruleStack:m,occurrenceStack:y});else if(v instanceof Tg)d.push(fle(v,g,m,y));else throw Error("non exhaustive match")}return h}E(xM,"nextPossibleTokensAfter");function fle(t,e,r,n){const i=ma(r);i.push(t.name);const a=ma(n);return a.push(1),{idx:e,def:t.definition,ruleStack:i,occurrenceStack:a}}E(fle,"expandTopLevelRule");var Qn;(function(t){t[t.OPTION=0]="OPTION",t[t.REPETITION=1]="REPETITION",t[t.REPETITION_MANDATORY=2]="REPETITION_MANDATORY",t[t.REPETITION_MANDATORY_WITH_SEPARATOR=3]="REPETITION_MANDATORY_WITH_SEPARATOR",t[t.REPETITION_WITH_SEPARATOR=4]="REPETITION_WITH_SEPARATOR",t[t.ALTERNATION=5]="ALTERNATION"})(Qn||(Qn={}));function Uk(t){if(t instanceof va||t==="Option")return Qn.OPTION;if(t instanceof ai||t==="Repetition")return Qn.REPETITION;if(t instanceof Qs||t==="RepetitionMandatory")return Qn.REPETITION_MANDATORY;if(t instanceof Js||t==="RepetitionMandatoryWithSeparator")return Qn.REPETITION_MANDATORY_WITH_SEPARATOR;if(t instanceof _s||t==="RepetitionWithSeparator")return Qn.REPETITION_WITH_SEPARATOR;if(t instanceof Rs||t==="Alternation")return Qn.ALTERNATION;throw Error("non exhaustive match")}E(Uk,"getProdType");function TM(t){const{occurrence:e,rule:r,prodType:n,maxLookahead:i}=t,a=Uk(n);return a===Qn.ALTERNATION?gT(e,r,i):mT(e,r,a,i)}E(TM,"getLookaheadPaths");function ple(t,e,r,n,i,a){const s=gT(t,e,r),o=kM(s)?dT:kg;return a(s,n,o,i)}E(ple,"buildLookaheadFuncForOr");function gle(t,e,r,n,i,a){const s=mT(t,e,i,r),o=kM(s)?dT:kg;return a(s[0],o,n)}E(gle,"buildLookaheadFuncForOptionalProd");function mle(t,e,r,n){const i=t.length,a=Yo(t,s=>Yo(s,o=>o.length===1));if(e)return function(s){const o=ur(s,l=>l.GATE);for(let l=0;lHo(l)),o=Zs(s,(l,u,h)=>(kr(u,d=>{br(l,d.tokenTypeIdx)||(l[d.tokenTypeIdx]=h),kr(d.categoryMatches,f=>{br(l,f)||(l[f]=h)})}),l),{});return function(){const l=this.LA(1);return o[l.tokenTypeIdx]}}else return function(){for(let s=0;sa.length===1),i=t.length;if(n&&!r){const a=Ho(t);if(a.length===1&&An(a[0].categoryMatches)){const o=a[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===o}}else{const s=Zs(a,(o,l,u)=>(o[l.tokenTypeIdx]=!0,kr(l.categoryMatches,h=>{o[h]=!0}),o),[]);return function(){const o=this.LA(1);return s[o.tokenTypeIdx]===!0}}}else return function(){e:for(let a=0;aWk([s],1)),n=wM(r.length),i=ur(r,s=>{const o={};return kr(s,l=>{const u=Hk(l.partialPath);kr(u,h=>{o[h]=!0})}),o});let a=r;for(let s=1;s<=e;s++){const o=a;a=wM(o.length);for(let l=0;l{const v=Hk(y.partialPath);kr(v,T=>{i[l][T]=!0})})}}}}return n}E(CM,"lookAheadSequenceFromAlternatives");function gT(t,e,r,n){const i=new vle(t,Qn.ALTERNATION,n);return e.accept(i),CM(i.result,r)}E(gT,"getLookaheadPathsForOr");function mT(t,e,r,n){const i=new vle(t,r);e.accept(i);const a=i.result,o=new LQe(e,t,r).startWalking(),l=new As({definition:a}),u=new As({definition:o});return CM([l,u],n)}E(mT,"getLookaheadPathsForOptionalProd");function Yk(t,e){e:for(let r=0;r{const i=e[n];return r===i||i.categoryMatchesMap[r.tokenTypeIdx]})}E(xle,"isStrictPrefixOfPath");function kM(t){return Yo(t,e=>Yo(e,r=>Yo(r,n=>An(n.categoryMatches))))}E(kM,"areTokenCategoriesNotUsed");function Tle(t){const e=t.lookaheadStrategy.validate({rules:t.rules,tokenTypes:t.tokenTypes,grammarName:t.grammarName});return ur(e,r=>Object.assign({type:ss.CUSTOM_LOOKAHEAD_VALIDATION},r))}E(Tle,"validateLookahead");function wle(t,e,r,n){const i=To(t,l=>Cle(l,r)),a=Mle(t,e,r),s=To(t,l=>Rle(l,r)),o=To(t,l=>Ele(l,t,n,r));return i.concat(a,s,o)}E(wle,"validateGrammar");function Cle(t,e){const r=new IQe;t.accept(r);const n=r.allProductions,i=UZe(n,kle),a=Ko(i,o=>o.length>1);return ur(Vi(a),o=>{const l=Xo(o),u=e.buildDuplicateFoundError(t,o),h=jo(l),d={message:u,type:ss.DUPLICATE_PRODUCTIONS,ruleName:t.name,dslName:h,occurrence:l.idx},f=EM(l);return f&&(d.parameter=f),d})}E(Cle,"validateDuplicateProductions");function kle(t){return`${jo(t)}_#_${t.idx}_#_${EM(t)}`}E(kle,"identifyProductionForDuplicates");function EM(t){return t instanceof Pn?t.terminalType.name:t instanceof is?t.nonTerminalName:""}E(EM,"getExtraProductionArgument");var IQe=(f1=class extends wg{constructor(){super(...arguments),this.allProductions=[]}visitNonTerminal(e){this.allProductions.push(e)}visitOption(e){this.allProductions.push(e)}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}visitAlternation(e){this.allProductions.push(e)}visitTerminal(e){this.allProductions.push(e)}},E(f1,"OccurrenceValidationCollector"),f1);function Ele(t,e,r,n){const i=[];if(Zs(e,(s,o)=>o.name===t.name?s+1:s,0)>1){const s=n.buildDuplicateRuleNameError({topLevelRule:t,grammarName:r});i.push({message:s,type:ss.DUPLICATE_RULE_NAME,ruleName:t.name})}return i}E(Ele,"validateRuleDoesNotAlreadyExist");function Sle(t,e,r){const n=[];let i;return ns(e,t)||(i=`Invalid rule override, rule: ->${t}<- cannot be overridden in the grammar: ->${r}<-as it is not defined in any of the super grammars `,n.push({message:i,type:ss.INVALID_RULE_OVERRIDE,ruleName:t})),n}E(Sle,"validateRuleIsOverridden");function SM(t,e,r,n=[]){const i=[],a=yT(e.definition);if(An(a))return[];{const s=t.name;ns(a,t)&&i.push({message:r.buildLeftRecursionError({topLevelRule:t,leftRecursionPath:n}),type:ss.LEFT_RECURSION,ruleName:s});const l=Ik(a,n.concat([t])),u=To(l,h=>{const d=ma(n);return d.push(h),SM(t,h,r,d)});return i.concat(u)}}E(SM,"validateNoLeftRecursion");function yT(t){let e=[];if(An(t))return e;const r=Xo(t);if(r instanceof is)e.push(r.referencedRule);else if(r instanceof As||r instanceof va||r instanceof Qs||r instanceof Js||r instanceof _s||r instanceof ai)e=e.concat(yT(r.definition));else if(r instanceof Rs)e=Ho(ur(r.definition,a=>yT(a.definition)));else if(!(r instanceof Pn))throw Error("non exhaustive match");const n=oT(r),i=t.length>1;if(n&&i){const a=ya(t);return e.concat(yT(a))}else return e}E(yT,"getFirstNoneTerminal");var AM=(p1=class extends wg{constructor(){super(...arguments),this.alternations=[]}visitAlternation(e){this.alternations.push(e)}},E(p1,"OrCollector"),p1);function Ale(t,e){const r=new AM;t.accept(r);const n=r.alternations;return To(n,a=>{const s=aT(a.definition);return To(s,(o,l)=>{const u=xM([o],[],kg,1);return An(u)?[{message:e.buildEmptyAlternationError({topLevelRule:t,alternation:a,emptyChoiceIdx:l}),type:ss.NONE_LAST_EMPTY_ALT,ruleName:t.name,occurrence:a.idx,alternative:l+1}]:[]})})}E(Ale,"validateEmptyOrAlternative");function _le(t,e,r){const n=new AM;t.accept(n);let i=n.alternations;return i=Dk(i,s=>s.ignoreAmbiguities===!0),To(i,s=>{const o=s.idx,l=s.maxLookahead||e,u=gT(o,t,l,s),h=Ile(u,s,t,r),d=Dle(u,s,t,r);return h.concat(d)})}E(_le,"validateAmbiguousAlternationAlternatives");var DQe=(g1=class extends wg{constructor(){super(...arguments),this.allProductions=[]}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}},E(g1,"RepetitionCollector"),g1);function Rle(t,e){const r=new AM;t.accept(r);const n=r.alternations;return To(n,a=>a.definition.length>255?[{message:e.buildTooManyAlternativesError({topLevelRule:t,alternation:a}),type:ss.TOO_MANY_ALTS,ruleName:t.name,occurrence:a.idx}]:[])}E(Rle,"validateTooManyAlts");function Lle(t,e,r){const n=[];return kr(t,i=>{const a=new DQe;i.accept(a);const s=a.allProductions;kr(s,o=>{const l=Uk(o),u=o.maxLookahead||e,h=o.idx,f=mT(h,i,l,u)[0];if(An(Ho(f))){const p=r.buildEmptyRepetitionError({topLevelRule:i,repetition:o});n.push({message:p,type:ss.NO_NON_EMPTY_LOOKAHEAD,ruleName:i.name})}})}),n}E(Lle,"validateSomeNonEmptyLookaheadPath");function Ile(t,e,r,n){const i=[],a=Zs(t,(o,l,u)=>(e.definition[u].ignoreAmbiguities===!0||kr(l,h=>{const d=[u];kr(t,(f,p)=>{u!==p&&Yk(f,h)&&e.definition[p].ignoreAmbiguities!==!0&&d.push(p)}),d.length>1&&!Yk(i,h)&&(i.push(h),o.push({alts:d,path:h}))}),o),[]);return ur(a,o=>{const l=ur(o.alts,h=>h+1);return{message:n.buildAlternationAmbiguityError({topLevelRule:r,alternation:e,ambiguityIndices:l,prefixPath:o.path}),type:ss.AMBIGUOUS_ALTS,ruleName:r.name,occurrence:e.idx,alternatives:o.alts}})}E(Ile,"checkAlternativesAmbiguities");function Dle(t,e,r,n){const i=Zs(t,(s,o,l)=>{const u=ur(o,h=>({idx:l,path:h}));return s.concat(u)},[]);return nT(To(i,s=>{if(e.definition[s.idx].ignoreAmbiguities===!0)return[];const l=s.idx,u=s.path,h=xo(i,f=>e.definition[f.idx].ignoreAmbiguities!==!0&&f.idx{const p=[f.idx+1,l+1],g=e.idx===0?"":e.idx;return{message:n.buildAlternationPrefixAmbiguityError({topLevelRule:r,alternation:e,ambiguityIndices:p,prefixPath:f.path}),type:ss.AMBIGUOUS_PREFIX_ALTS,ruleName:r.name,occurrence:g,alternatives:p}})}))}E(Dle,"checkPrefixAlternativesAmbiguities");function Mle(t,e,r){const n=[],i=ur(e,a=>a.name);return kr(t,a=>{const s=a.name;if(ns(i,s)){const o=r.buildNamespaceConflictError(a);n.push({message:o,type:ss.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:s})}}),n}E(Mle,"checkTerminalAndNoneTerminalsNameSpace");function Nle(t){const e=nM(t,{errMsgProvider:kQe}),r={};return kr(t.rules,n=>{r[n.name]=n}),ule(r,e.errMsgProvider)}E(Nle,"resolveGrammar");function Ole(t){return t=nM(t,{errMsgProvider:Af}),wle(t.rules,t.tokenTypes,t.errMsgProvider,t.grammarName)}E(Ole,"validateGrammar");var $le="MismatchedTokenException",Ple="NoViableAltException",Ble="EarlyExitException",Fle="NotAllInputParsedException",zle=[$le,Ple,Ble,Fle];Object.freeze(zle);function vT(t){return ns(zle,t.name)}E(vT,"isRecognitionException");var Xk=(m1=class extends Error{constructor(e,r){super(e),this.token=r,this.resyncedTokens=[],Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}},E(m1,"RecognitionException"),m1),Gle=(y1=class extends Xk{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=$le}},E(y1,"MismatchedTokenException"),y1),MQe=(v1=class extends Xk{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=Ple}},E(v1,"NoViableAltException"),v1),NQe=(b1=class extends Xk{constructor(e,r){super(e,r),this.name=Fle}},E(b1,"NotAllInputParsedException"),b1),OQe=(x1=class extends Xk{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=Ble}},E(x1,"EarlyExitException"),x1),_M={},qle="InRuleRecoveryException",$Qe=(T1=class extends Error{constructor(e){super(e),this.name=qle}},E(T1,"InRuleRecoveryException"),T1),PQe=(w1=class{initRecoverable(e){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=br(e,"recoveryEnabled")?e.recoveryEnabled:tu.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=Vle)}getTokenToInsert(e){const r=pT(e,"",NaN,NaN,NaN,NaN,NaN,NaN);return r.isInsertedInRecovery=!0,r}canTokenTypeBeInsertedInRecovery(e){return!0}canTokenTypeBeDeletedInRecovery(e){return!0}tryInRepetitionRecovery(e,r,n,i){const a=this.findReSyncTokenType(),s=this.exportLexerState(),o=[];let l=!1;const u=this.LA(1);let h=this.LA(1);const d=E(()=>{const f=this.LA(0),p=this.errorMessageProvider.buildMismatchTokenMessage({expected:i,actual:u,previous:f,ruleName:this.getCurrRuleFullName()}),g=new Gle(p,u,this.LA(0));g.resyncedTokens=aT(o),this.SAVE_ERROR(g)},"generateErrorMessage");for(;!l;)if(this.tokenMatcher(h,i)){d();return}else if(n.call(this)){d(),e.apply(this,r);return}else this.tokenMatcher(h,a)?l=!0:(h=this.SKIP_TOKEN(),this.addToResyncTokens(h,o));this.importLexerState(s)}shouldInRepetitionRecoveryBeTried(e,r,n){return!(n===!1||this.tokenMatcher(this.LA(1),e)||this.isBackTracking()||this.canPerformInRuleRecovery(e,this.getFollowsForInRuleRecovery(e,r)))}getFollowsForInRuleRecovery(e,r){const n=this.getCurrentGrammarPath(e,r);return this.getNextPossibleTokenTypes(n)}tryInRuleRecovery(e,r){if(this.canRecoverWithSingleTokenInsertion(e,r))return this.getTokenToInsert(e);if(this.canRecoverWithSingleTokenDeletion(e)){const n=this.SKIP_TOKEN();return this.consumeToken(),n}throw new $Qe("sad sad panda")}canPerformInRuleRecovery(e,r){return this.canRecoverWithSingleTokenInsertion(e,r)||this.canRecoverWithSingleTokenDeletion(e)}canRecoverWithSingleTokenInsertion(e,r){if(!this.canTokenTypeBeInsertedInRecovery(e)||An(r))return!1;const n=this.LA(1);return xg(r,a=>this.tokenMatcher(n,a))!==void 0}canRecoverWithSingleTokenDeletion(e){return this.canTokenTypeBeDeletedInRecovery(e)?this.tokenMatcher(this.LA(2),e):!1}isInCurrentRuleReSyncSet(e){const r=this.getCurrFollowKey(),n=this.getFollowSetFromFollowKey(r);return ns(n,e)}findReSyncTokenType(){const e=this.flattenFollowSet();let r=this.LA(1),n=2;for(;;){const i=xg(e,a=>bM(r,a));if(i!==void 0)return i;r=this.LA(n),n++}}getCurrFollowKey(){if(this.RULE_STACK.length===1)return _M;const e=this.getLastExplicitRuleShortName(),r=this.getLastExplicitRuleOccurrenceIndex(),n=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(e),idxInCallingRule:r,inRule:this.shortRuleNameToFullName(n)}}buildFullFollowKeyStack(){const e=this.RULE_STACK,r=this.RULE_OCCURRENCE_STACK;return ur(e,(n,i)=>i===0?_M:{ruleName:this.shortRuleNameToFullName(n),idxInCallingRule:r[i],inRule:this.shortRuleNameToFullName(e[i-1])})}flattenFollowSet(){const e=ur(this.buildFullFollowKeyStack(),r=>this.getFollowSetFromFollowKey(r));return Ho(e)}getFollowSetFromFollowKey(e){if(e===_M)return[Ch];const r=e.ruleName+e.idxInCallingRule+yoe+e.inRule;return this.resyncFollows[r]}addToResyncTokens(e,r){return this.tokenMatcher(e,Ch)||r.push(e),r}reSyncTo(e){const r=[];let n=this.LA(1);for(;this.tokenMatcher(n,e)===!1;)n=this.SKIP_TOKEN(),this.addToResyncTokens(n,r);return aT(r)}attemptInRepetitionRecovery(e,r,n,i,a,s,o){}getCurrentGrammarPath(e,r){const n=this.getHumanReadableRuleStack(),i=ma(this.RULE_OCCURRENCE_STACK);return{ruleStack:n,occurrenceStack:i,lastTok:e,lastTokOccurrence:r}}getHumanReadableRuleStack(){return ur(this.RULE_STACK,e=>this.shortRuleNameToFullName(e))}},E(w1,"Recoverable"),w1);function Vle(t,e,r,n,i,a,s){const o=this.getKeyForAutomaticLookahead(n,i);let l=this.firstAfterRepMap[o];if(l===void 0){const f=this.getCurrRuleFullName(),p=this.getGAstProductions()[f];l=new a(p,i).startWalking(),this.firstAfterRepMap[o]=l}let u=l.token,h=l.occurrence;const d=l.isEndOfRule;this.RULE_STACK.length===1&&d&&u===void 0&&(u=Ch,h=1),!(u===void 0||h===void 0)&&this.shouldInRepetitionRecoveryBeTried(u,h,s)&&this.tryInRepetitionRecovery(t,e,r,u)}E(Vle,"attemptInRepetitionRecovery");var BQe=4,kh=8,Wle=1<SM(r,r,Af))}validateEmptyOrAlternatives(e){return To(e,r=>Ale(r,Af))}validateAmbiguousAlternationAlternatives(e,r){return To(e,n=>_le(n,r,Af))}validateSomeNonEmptyLookaheadPath(e,r){return Lle(e,r,Af)}buildLookaheadForAlternation(e){return ple(e.prodOccurrence,e.rule,e.maxLookahead,e.hasPredicates,e.dynamicTokensEnabled,mle)}buildLookaheadForOptional(e){return gle(e.prodOccurrence,e.rule,e.maxLookahead,e.dynamicTokensEnabled,Uk(e.prodType),yle)}},E(C1,"LLkLookaheadStrategy"),C1),FQe=(k1=class{initLooksAhead(e){this.dynamicTokensEnabled=br(e,"dynamicTokensEnabled")?e.dynamicTokensEnabled:tu.dynamicTokensEnabled,this.maxLookahead=br(e,"maxLookahead")?e.maxLookahead:tu.maxLookahead,this.lookaheadStrategy=br(e,"lookaheadStrategy")?e.lookaheadStrategy:new DM({maxLookahead:this.maxLookahead}),this.lookAheadFuncsCache=new Map}preComputeLookaheadFunctions(e){kr(e,r=>{this.TRACE_INIT(`${r.name} Rule Lookahead`,()=>{const{alternation:n,repetition:i,option:a,repetitionMandatory:s,repetitionMandatoryWithSeparator:o,repetitionWithSeparator:l}=Hle(r);kr(n,u=>{const h=u.idx===0?"":u.idx;this.TRACE_INIT(`${jo(u)}${h}`,()=>{const d=this.lookaheadStrategy.buildLookaheadForAlternation({prodOccurrence:u.idx,rule:r,maxLookahead:u.maxLookahead||this.maxLookahead,hasPredicates:u.hasPredicates,dynamicTokensEnabled:this.dynamicTokensEnabled}),f=jk(this.fullRuleNameToShort[r.name],Wle,u.idx);this.setLaFuncCache(f,d)})}),kr(i,u=>{this.computeLookaheadFunc(r,u.idx,RM,"Repetition",u.maxLookahead,jo(u))}),kr(a,u=>{this.computeLookaheadFunc(r,u.idx,Ule,"Option",u.maxLookahead,jo(u))}),kr(s,u=>{this.computeLookaheadFunc(r,u.idx,LM,"RepetitionMandatory",u.maxLookahead,jo(u))}),kr(o,u=>{this.computeLookaheadFunc(r,u.idx,Kk,"RepetitionMandatoryWithSeparator",u.maxLookahead,jo(u))}),kr(l,u=>{this.computeLookaheadFunc(r,u.idx,IM,"RepetitionWithSeparator",u.maxLookahead,jo(u))})})})}computeLookaheadFunc(e,r,n,i,a,s){this.TRACE_INIT(`${s}${r===0?"":r}`,()=>{const o=this.lookaheadStrategy.buildLookaheadForOptional({prodOccurrence:r,rule:e,maxLookahead:a||this.maxLookahead,dynamicTokensEnabled:this.dynamicTokensEnabled,prodType:i}),l=jk(this.fullRuleNameToShort[e.name],n,r);this.setLaFuncCache(l,o)})}getKeyForAutomaticLookahead(e,r){const n=this.getLastExplicitRuleShortName();return jk(n,e,r)}getLaFuncFromCache(e){return this.lookAheadFuncsCache.get(e)}setLaFuncCache(e,r){this.lookAheadFuncsCache.set(e,r)}},E(k1,"LooksAhead"),k1),zQe=(E1=class extends wg{constructor(){super(...arguments),this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}reset(){this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}visitOption(e){this.dslMethods.option.push(e)}visitRepetitionWithSeparator(e){this.dslMethods.repetitionWithSeparator.push(e)}visitRepetitionMandatory(e){this.dslMethods.repetitionMandatory.push(e)}visitRepetitionMandatoryWithSeparator(e){this.dslMethods.repetitionMandatoryWithSeparator.push(e)}visitRepetition(e){this.dslMethods.repetition.push(e)}visitAlternation(e){this.dslMethods.alternation.push(e)}},E(E1,"DslMethodsCollectorVisitor"),E1),Zk=new zQe;function Hle(t){Zk.reset(),t.accept(Zk);const e=Zk.dslMethods;return Zk.reset(),e}E(Hle,"collectMethods");function MM(t,e){isNaN(t.startOffset)===!0?(t.startOffset=e.startOffset,t.endOffset=e.endOffset):t.endOffsets.msg);throw Error(`Errors Detected in CST Visitor <${this.constructor.name}>: +see: https://en.wikipedia.org/wiki/LL_parser#Left_factoring.`},buildInvalidRuleNameError(t){return"deprecated"},buildDuplicateRuleNameError(t){let e;return t.topLevelRule instanceof e1?e=t.topLevelRule.name:e=t.topLevelRule,`Duplicate definition, rule: ->${e}<- is already defined in the grammar: ->${t.grammarName}<-`}};function _0e(t,e){const r=new flt(t,e);return r.resolveRefs(),r.errors}E(_0e,"resolveGrammar");var flt=(Oy=class extends t1{constructor(e,r){super(),this.nameToTopRule=e,this.errMsgProvider=r,this.errors=[]}resolveRefs(){Ir(da(this.nameToTopRule),e=>{this.currTopLevel=e,e.accept(this)})}visitNonTerminal(e){const r=this.nameToTopRule[e.nonTerminalName];if(r)e.referencedRule=r;else{const n=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,e);this.errors.push({message:n,type:Os.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:e.nonTerminalName})}}},E(Oy,"GastRefResolverVisitor"),Oy),plt=(Py=class extends M_{constructor(e,r){super(),this.topProd=e,this.path=r,this.possibleTokTypes=[],this.nextProductionName="",this.nextProductionOccurrence=0,this.found=!1,this.isAtEndOfPath=!1}startWalking(){if(this.found=!1,this.path.ruleStack[0]!==this.topProd.name)throw Error("The path does not start with the walker's top Rule!");return this.ruleStack=Ga(this.path.ruleStack).reverse(),this.occurrenceStack=Ga(this.path.occurrenceStack).reverse(),this.ruleStack.pop(),this.occurrenceStack.pop(),this.updateExpectedNext(),this.walk(this.topProd),this.possibleTokTypes}walk(e,r=[]){this.found||super.walk(e,r)}walkProdRef(e,r,n){if(e.referencedRule.name===this.nextProductionName&&e.idx===this.nextProductionOccurrence){const i=r.concat(n);this.updateExpectedNext(),this.walk(e.referencedRule,i)}}updateExpectedNext(){qn(this.ruleStack)?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())}},E(Py,"AbstractNextPossibleTokensWalker"),Py),glt=(By=class extends plt{constructor(e,r){super(e,r),this.path=r,this.nextTerminalName="",this.nextTerminalOccurrence=0,this.nextTerminalName=this.path.lastTok.name,this.nextTerminalOccurrence=this.path.lastTokOccurrence}walkTerminal(e,r,n){if(this.isAtEndOfPath&&e.terminalType.name===this.nextTerminalName&&e.idx===this.nextTerminalOccurrence&&!this.found){const i=r.concat(n),a=new ao({definition:i});this.possibleTokTypes=r1(a),this.found=!0}}},E(By,"NextAfterTokenWalker"),By),q_=(Fy=class extends M_{constructor(e,r){super(),this.topRule=e,this.occurrence=r,this.result={token:void 0,occurrence:void 0,isEndOfRule:void 0}}startWalking(){return this.walk(this.topRule),this.result}},E(Fy,"AbstractNextTerminalAfterProductionWalker"),Fy),mlt=(zy=class extends q_{walkMany(e,r,n){if(e.idx===this.occurrence){const i=Nl(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof ri&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkMany(e,r,n)}},E(zy,"NextTerminalAfterManyWalker"),zy),A0e=(Gy=class extends q_{walkManySep(e,r,n){if(e.idx===this.occurrence){const i=Nl(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof ri&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkManySep(e,r,n)}},E(Gy,"NextTerminalAfterManySepWalker"),Gy),ylt=(qy=class extends q_{walkAtLeastOne(e,r,n){if(e.idx===this.occurrence){const i=Nl(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof ri&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOne(e,r,n)}},E(qy,"NextTerminalAfterAtLeastOneWalker"),qy),R0e=(Vy=class extends q_{walkAtLeastOneSep(e,r,n){if(e.idx===this.occurrence){const i=Nl(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof ri&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOneSep(e,r,n)}},E(Vy,"NextTerminalAfterAtLeastOneSepWalker"),Vy);function V_(t,e,r=[]){r=Ga(r);let n=[],i=0;function a(o){return o.concat(qa(t,i+1))}E(a,"remainingPathWith");function s(o){const l=V_(a(o),e,r);return n.concat(l)}for(E(s,"getAlternativesForProd");r.length{qn(l.definition)===!1&&(n=s(l.definition))}),n;if(o instanceof ri)r.push(o.terminalType);else throw Error("non exhaustive match")}i++}return n.push({partialPath:r,suffixDef:qa(t,i)}),n}E(V_,"possiblePathsFrom");function jP(t,e,r,n){const i="EXIT_NONE_TERMINAL",a=[i],s="EXIT_ALTERNATIVE";let o=!1;const l=e.length,u=l-n-1,h=[],d=[];for(d.push({idx:-1,def:t,ruleStack:[],occurrenceStack:[]});!qn(d);){const f=d.pop();if(f===s){o&&zp(d).idx<=u&&d.pop();continue}const p=f.def,g=f.idx,m=f.ruleStack,y=f.occurrenceStack;if(qn(p))continue;const v=p[0];if(v===i){const x={idx:g,def:qa(p),ruleStack:dC(m),occurrenceStack:dC(y)};d.push(x)}else if(v instanceof ri)if(g=0;x--){const b=v.definition[x],w={idx:g,def:b.definition.concat(qa(p)),ruleStack:m,occurrenceStack:y};d.push(w),d.push(s)}else if(v instanceof ao)d.push({idx:g,def:v.definition.concat(qa(p)),ruleStack:m,occurrenceStack:y});else if(v instanceof e1)d.push(L0e(v,g,m,y));else throw Error("non exhaustive match")}return h}E(jP,"nextPossibleTokensAfter");function L0e(t,e,r,n){const i=Ga(r);i.push(t.name);const a=Ga(n);return a.push(1),{idx:e,def:t.definition,ruleStack:i,occurrenceStack:a}}E(L0e,"expandTopLevelRule");var bi;(function(t){t[t.OPTION=0]="OPTION",t[t.REPETITION=1]="REPETITION",t[t.REPETITION_MANDATORY=2]="REPETITION_MANDATORY",t[t.REPETITION_MANDATORY_WITH_SEPARATOR=3]="REPETITION_MANDATORY_WITH_SEPARATOR",t[t.REPETITION_WITH_SEPARATOR=4]="REPETITION_WITH_SEPARATOR",t[t.ALTERNATION=5]="ALTERNATION"})(bi||(bi={}));function W_(t){if(t instanceof Va||t==="Option")return bi.OPTION;if(t instanceof Si||t==="Repetition")return bi.REPETITION;if(t instanceof No||t==="RepetitionMandatory")return bi.REPETITION_MANDATORY;if(t instanceof $o||t==="RepetitionMandatoryWithSeparator")return bi.REPETITION_MANDATORY_WITH_SEPARATOR;if(t instanceof so||t==="RepetitionWithSeparator")return bi.REPETITION_WITH_SEPARATOR;if(t instanceof oo||t==="Alternation")return bi.ALTERNATION;throw Error("non exhaustive match")}E(W_,"getProdType");function KP(t){const{occurrence:e,rule:r,prodType:n,maxLookahead:i}=t,a=W_(n);return a===bi.ALTERNATION?wC(e,r,i):CC(e,r,a,i)}E(KP,"getLookaheadPaths");function I0e(t,e,r,n,i,a){const s=wC(t,e,r),o=JP(s)?bC:n1;return a(s,n,o,i)}E(I0e,"buildLookaheadFuncForOr");function D0e(t,e,r,n,i,a){const s=CC(t,e,i,r),o=JP(s)?bC:n1;return a(s[0],o,n)}E(D0e,"buildLookaheadFuncForOptionalProd");function M0e(t,e,r,n){const i=t.length,a=Ml(t,s=>Ml(s,o=>o.length===1));if(e)return function(s){const o=mr(s,l=>l.GATE);for(let l=0;lDl(l)),o=Mo(s,(l,u,h)=>(Ir(u,d=>{Er(l,d.tokenTypeIdx)||(l[d.tokenTypeIdx]=h),Ir(d.categoryMatches,f=>{Er(l,f)||(l[f]=h)})}),l),{});return function(){const l=this.LA(1);return o[l.tokenTypeIdx]}}else return function(){for(let s=0;sa.length===1),i=t.length;if(n&&!r){const a=Dl(t);if(a.length===1&&qn(a[0].categoryMatches)){const o=a[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===o}}else{const s=Mo(a,(o,l,u)=>(o[l.tokenTypeIdx]=!0,Ir(l.categoryMatches,h=>{o[h]=!0}),o),[]);return function(){const o=this.LA(1);return s[o.tokenTypeIdx]===!0}}}else return function(){e:for(let a=0;aV_([s],1)),n=ZP(r.length),i=mr(r,s=>{const o={};return Ir(s,l=>{const u=U_(l.partialPath);Ir(u,h=>{o[h]=!0})}),o});let a=r;for(let s=1;s<=e;s++){const o=a;a=ZP(o.length);for(let l=0;l{const v=U_(y.partialPath);Ir(v,x=>{i[l][x]=!0})})}}}}return n}E(QP,"lookAheadSequenceFromAlternatives");function wC(t,e,r,n){const i=new $0e(t,bi.ALTERNATION,n);return e.accept(i),QP(i.result,r)}E(wC,"getLookaheadPathsForOr");function CC(t,e,r,n){const i=new $0e(t,r);e.accept(i);const a=i.result,o=new vlt(e,t,r).startWalking(),l=new ao({definition:a}),u=new ao({definition:o});return QP([l,u],n)}E(CC,"getLookaheadPathsForOptionalProd");function H_(t,e){e:for(let r=0;r{const i=e[n];return r===i||i.categoryMatchesMap[r.tokenTypeIdx]})}E(P0e,"isStrictPrefixOfPath");function JP(t){return Ml(t,e=>Ml(e,r=>Ml(r,n=>qn(n.categoryMatches))))}E(JP,"areTokenCategoriesNotUsed");function B0e(t){const e=t.lookaheadStrategy.validate({rules:t.rules,tokenTypes:t.tokenTypes,grammarName:t.grammarName});return mr(e,r=>Object.assign({type:Os.CUSTOM_LOOKAHEAD_VALIDATION},r))}E(B0e,"validateLookahead");function F0e(t,e,r,n){const i=sl(t,l=>z0e(l,r)),a=K0e(t,e,r),s=sl(t,l=>H0e(l,r)),o=sl(t,l=>q0e(l,t,n,r));return i.concat(a,s,o)}E(F0e,"validateGrammar");function z0e(t,e){const r=new blt;t.accept(r);const n=r.allProductions,i=Mot(n,G0e),a=$l(i,o=>o.length>1);return mr(da(a),o=>{const l=Nl(o),u=e.buildDuplicateFoundError(t,o),h=Ol(l),d={message:u,type:Os.DUPLICATE_PRODUCTIONS,ruleName:t.name,dslName:h,occurrence:l.idx},f=eB(l);return f&&(d.parameter=f),d})}E(z0e,"validateDuplicateProductions");function G0e(t){return`${Ol(t)}_#_${t.idx}_#_${eB(t)}`}E(G0e,"identifyProductionForDuplicates");function eB(t){return t instanceof ri?t.terminalType.name:t instanceof Ns?t.nonTerminalName:""}E(eB,"getExtraProductionArgument");var blt=(Hy=class extends t1{constructor(){super(...arguments),this.allProductions=[]}visitNonTerminal(e){this.allProductions.push(e)}visitOption(e){this.allProductions.push(e)}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}visitAlternation(e){this.allProductions.push(e)}visitTerminal(e){this.allProductions.push(e)}},E(Hy,"OccurrenceValidationCollector"),Hy);function q0e(t,e,r,n){const i=[];if(Mo(e,(s,o)=>o.name===t.name?s+1:s,0)>1){const s=n.buildDuplicateRuleNameError({topLevelRule:t,grammarName:r});i.push({message:s,type:Os.DUPLICATE_RULE_NAME,ruleName:t.name})}return i}E(q0e,"validateRuleDoesNotAlreadyExist");function V0e(t,e,r){const n=[];let i;return Ms(e,t)||(i=`Invalid rule override, rule: ->${t}<- cannot be overridden in the grammar: ->${r}<-as it is not defined in any of the super grammars `,n.push({message:i,type:Os.INVALID_RULE_OVERRIDE,ruleName:t})),n}E(V0e,"validateRuleIsOverridden");function tB(t,e,r,n=[]){const i=[],a=kC(e.definition);if(qn(a))return[];{const s=t.name;Ms(a,t)&&i.push({message:r.buildLeftRecursionError({topLevelRule:t,leftRecursionPath:n}),type:Os.LEFT_RECURSION,ruleName:s});const l=L_(a,n.concat([t])),u=sl(l,h=>{const d=Ga(n);return d.push(h),tB(t,h,r,d)});return i.concat(u)}}E(tB,"validateNoLeftRecursion");function kC(t){let e=[];if(qn(t))return e;const r=Nl(t);if(r instanceof Ns)e.push(r.referencedRule);else if(r instanceof ao||r instanceof Va||r instanceof No||r instanceof $o||r instanceof so||r instanceof Si)e=e.concat(kC(r.definition));else if(r instanceof oo)e=Dl(mr(r.definition,a=>kC(a.definition)));else if(!(r instanceof ri))throw Error("non exhaustive match");const n=pC(r),i=t.length>1;if(n&&i){const a=qa(t);return e.concat(kC(a))}else return e}E(kC,"getFirstNoneTerminal");var rB=(Yy=class extends t1{constructor(){super(...arguments),this.alternations=[]}visitAlternation(e){this.alternations.push(e)}},E(Yy,"OrCollector"),Yy);function W0e(t,e){const r=new rB;t.accept(r);const n=r.alternations;return sl(n,a=>{const s=dC(a.definition);return sl(s,(o,l)=>{const u=jP([o],[],n1,1);return qn(u)?[{message:e.buildEmptyAlternationError({topLevelRule:t,alternation:a,emptyChoiceIdx:l}),type:Os.NONE_LAST_EMPTY_ALT,ruleName:t.name,occurrence:a.idx,alternative:l+1}]:[]})})}E(W0e,"validateEmptyOrAlternative");function U0e(t,e,r){const n=new rB;t.accept(n);let i=n.alternations;return i=I_(i,s=>s.ignoreAmbiguities===!0),sl(i,s=>{const o=s.idx,l=s.maxLookahead||e,u=wC(o,t,l,s),h=X0e(u,s,t,r),d=j0e(u,s,t,r);return h.concat(d)})}E(U0e,"validateAmbiguousAlternationAlternatives");var xlt=(Xy=class extends t1{constructor(){super(...arguments),this.allProductions=[]}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}},E(Xy,"RepetitionCollector"),Xy);function H0e(t,e){const r=new rB;t.accept(r);const n=r.alternations;return sl(n,a=>a.definition.length>255?[{message:e.buildTooManyAlternativesError({topLevelRule:t,alternation:a}),type:Os.TOO_MANY_ALTS,ruleName:t.name,occurrence:a.idx}]:[])}E(H0e,"validateTooManyAlts");function Y0e(t,e,r){const n=[];return Ir(t,i=>{const a=new xlt;i.accept(a);const s=a.allProductions;Ir(s,o=>{const l=W_(o),u=o.maxLookahead||e,h=o.idx,f=CC(h,i,l,u)[0];if(qn(Dl(f))){const p=r.buildEmptyRepetitionError({topLevelRule:i,repetition:o});n.push({message:p,type:Os.NO_NON_EMPTY_LOOKAHEAD,ruleName:i.name})}})}),n}E(Y0e,"validateSomeNonEmptyLookaheadPath");function X0e(t,e,r,n){const i=[],a=Mo(t,(o,l,u)=>(e.definition[u].ignoreAmbiguities===!0||Ir(l,h=>{const d=[u];Ir(t,(f,p)=>{u!==p&&H_(f,h)&&e.definition[p].ignoreAmbiguities!==!0&&d.push(p)}),d.length>1&&!H_(i,h)&&(i.push(h),o.push({alts:d,path:h}))}),o),[]);return mr(a,o=>{const l=mr(o.alts,h=>h+1);return{message:n.buildAlternationAmbiguityError({topLevelRule:r,alternation:e,ambiguityIndices:l,prefixPath:o.path}),type:Os.AMBIGUOUS_ALTS,ruleName:r.name,occurrence:e.idx,alternatives:o.alts}})}E(X0e,"checkAlternativesAmbiguities");function j0e(t,e,r,n){const i=Mo(t,(s,o,l)=>{const u=mr(o,h=>({idx:l,path:h}));return s.concat(u)},[]);return uC(sl(i,s=>{if(e.definition[s.idx].ignoreAmbiguities===!0)return[];const l=s.idx,u=s.path,h=al(i,f=>e.definition[f.idx].ignoreAmbiguities!==!0&&f.idx{const p=[f.idx+1,l+1],g=e.idx===0?"":e.idx;return{message:n.buildAlternationPrefixAmbiguityError({topLevelRule:r,alternation:e,ambiguityIndices:p,prefixPath:f.path}),type:Os.AMBIGUOUS_PREFIX_ALTS,ruleName:r.name,occurrence:g,alternatives:p}})}))}E(j0e,"checkPrefixAlternativesAmbiguities");function K0e(t,e,r){const n=[],i=mr(e,a=>a.name);return Ir(t,a=>{const s=a.name;if(Ms(i,s)){const o=r.buildNamespaceConflictError(a);n.push({message:o,type:Os.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:s})}}),n}E(K0e,"checkTerminalAndNoneTerminalsNameSpace");function Z0e(t){const e=DP(t,{errMsgProvider:dlt}),r={};return Ir(t.rules,n=>{r[n.name]=n}),_0e(r,e.errMsgProvider)}E(Z0e,"resolveGrammar");function Q0e(t){return t=DP(t,{errMsgProvider:Vp}),F0e(t.rules,t.tokenTypes,t.errMsgProvider,t.grammarName)}E(Q0e,"validateGrammar");var J0e="MismatchedTokenException",ege="NoViableAltException",tge="EarlyExitException",rge="NotAllInputParsedException",nge=[J0e,ege,tge,rge];Object.freeze(nge);function EC(t){return Ms(nge,t.name)}E(EC,"isRecognitionException");var Y_=(jy=class extends Error{constructor(e,r){super(e),this.token=r,this.resyncedTokens=[],Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}},E(jy,"RecognitionException"),jy),ige=(Ky=class extends Y_{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=J0e}},E(Ky,"MismatchedTokenException"),Ky),Tlt=(Zy=class extends Y_{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=ege}},E(Zy,"NoViableAltException"),Zy),wlt=(Qy=class extends Y_{constructor(e,r){super(e,r),this.name=rge}},E(Qy,"NotAllInputParsedException"),Qy),Clt=(Jy=class extends Y_{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=tge}},E(Jy,"EarlyExitException"),Jy),nB={},age="InRuleRecoveryException",klt=(ev=class extends Error{constructor(e){super(e),this.name=age}},E(ev,"InRuleRecoveryException"),ev),Elt=(tv=class{initRecoverable(e){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=Er(e,"recoveryEnabled")?e.recoveryEnabled:eh.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=sge)}getTokenToInsert(e){const r=TC(e,"",NaN,NaN,NaN,NaN,NaN,NaN);return r.isInsertedInRecovery=!0,r}canTokenTypeBeInsertedInRecovery(e){return!0}canTokenTypeBeDeletedInRecovery(e){return!0}tryInRepetitionRecovery(e,r,n,i){const a=this.findReSyncTokenType(),s=this.exportLexerState(),o=[];let l=!1;const u=this.LA(1);let h=this.LA(1);const d=E(()=>{const f=this.LA(0),p=this.errorMessageProvider.buildMismatchTokenMessage({expected:i,actual:u,previous:f,ruleName:this.getCurrRuleFullName()}),g=new ige(p,u,this.LA(0));g.resyncedTokens=dC(o),this.SAVE_ERROR(g)},"generateErrorMessage");for(;!l;)if(this.tokenMatcher(h,i)){d();return}else if(n.call(this)){d(),e.apply(this,r);return}else this.tokenMatcher(h,a)?l=!0:(h=this.SKIP_TOKEN(),this.addToResyncTokens(h,o));this.importLexerState(s)}shouldInRepetitionRecoveryBeTried(e,r,n){return!(n===!1||this.tokenMatcher(this.LA(1),e)||this.isBackTracking()||this.canPerformInRuleRecovery(e,this.getFollowsForInRuleRecovery(e,r)))}getFollowsForInRuleRecovery(e,r){const n=this.getCurrentGrammarPath(e,r);return this.getNextPossibleTokenTypes(n)}tryInRuleRecovery(e,r){if(this.canRecoverWithSingleTokenInsertion(e,r))return this.getTokenToInsert(e);if(this.canRecoverWithSingleTokenDeletion(e)){const n=this.SKIP_TOKEN();return this.consumeToken(),n}throw new klt("sad sad panda")}canPerformInRuleRecovery(e,r){return this.canRecoverWithSingleTokenInsertion(e,r)||this.canRecoverWithSingleTokenDeletion(e)}canRecoverWithSingleTokenInsertion(e,r){if(!this.canTokenTypeBeInsertedInRecovery(e)||qn(r))return!1;const n=this.LA(1);return Jm(r,a=>this.tokenMatcher(n,a))!==void 0}canRecoverWithSingleTokenDeletion(e){return this.canTokenTypeBeDeletedInRecovery(e)?this.tokenMatcher(this.LA(2),e):!1}isInCurrentRuleReSyncSet(e){const r=this.getCurrFollowKey(),n=this.getFollowSetFromFollowKey(r);return Ms(n,e)}findReSyncTokenType(){const e=this.flattenFollowSet();let r=this.LA(1),n=2;for(;;){const i=Jm(e,a=>XP(r,a));if(i!==void 0)return i;r=this.LA(n),n++}}getCurrFollowKey(){if(this.RULE_STACK.length===1)return nB;const e=this.getLastExplicitRuleShortName(),r=this.getLastExplicitRuleOccurrenceIndex(),n=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(e),idxInCallingRule:r,inRule:this.shortRuleNameToFullName(n)}}buildFullFollowKeyStack(){const e=this.RULE_STACK,r=this.RULE_OCCURRENCE_STACK;return mr(e,(n,i)=>i===0?nB:{ruleName:this.shortRuleNameToFullName(n),idxInCallingRule:r[i],inRule:this.shortRuleNameToFullName(e[i-1])})}flattenFollowSet(){const e=mr(this.buildFullFollowKeyStack(),r=>this.getFollowSetFromFollowKey(r));return Dl(e)}getFollowSetFromFollowKey(e){if(e===nB)return[Ed];const r=e.ruleName+e.idxInCallingRule+Npe+e.inRule;return this.resyncFollows[r]}addToResyncTokens(e,r){return this.tokenMatcher(e,Ed)||r.push(e),r}reSyncTo(e){const r=[];let n=this.LA(1);for(;this.tokenMatcher(n,e)===!1;)n=this.SKIP_TOKEN(),this.addToResyncTokens(n,r);return dC(r)}attemptInRepetitionRecovery(e,r,n,i,a,s,o){}getCurrentGrammarPath(e,r){const n=this.getHumanReadableRuleStack(),i=Ga(this.RULE_OCCURRENCE_STACK);return{ruleStack:n,occurrenceStack:i,lastTok:e,lastTokOccurrence:r}}getHumanReadableRuleStack(){return mr(this.RULE_STACK,e=>this.shortRuleNameToFullName(e))}},E(tv,"Recoverable"),tv);function sge(t,e,r,n,i,a,s){const o=this.getKeyForAutomaticLookahead(n,i);let l=this.firstAfterRepMap[o];if(l===void 0){const f=this.getCurrRuleFullName(),p=this.getGAstProductions()[f];l=new a(p,i).startWalking(),this.firstAfterRepMap[o]=l}let u=l.token,h=l.occurrence;const d=l.isEndOfRule;this.RULE_STACK.length===1&&d&&u===void 0&&(u=Ed,h=1),!(u===void 0||h===void 0)&&this.shouldInRepetitionRecoveryBeTried(u,h,s)&&this.tryInRepetitionRecovery(t,e,r,u)}E(sge,"attemptInRepetitionRecovery");var Slt=4,Sd=8,oge=1<tB(r,r,Vp))}validateEmptyOrAlternatives(e){return sl(e,r=>W0e(r,Vp))}validateAmbiguousAlternationAlternatives(e,r){return sl(e,n=>U0e(n,r,Vp))}validateSomeNonEmptyLookaheadPath(e,r){return Y0e(e,r,Vp)}buildLookaheadForAlternation(e){return I0e(e.prodOccurrence,e.rule,e.maxLookahead,e.hasPredicates,e.dynamicTokensEnabled,M0e)}buildLookaheadForOptional(e){return D0e(e.prodOccurrence,e.rule,e.maxLookahead,e.dynamicTokensEnabled,W_(e.prodType),N0e)}},E(rv,"LLkLookaheadStrategy"),rv),_lt=(nv=class{initLooksAhead(e){this.dynamicTokensEnabled=Er(e,"dynamicTokensEnabled")?e.dynamicTokensEnabled:eh.dynamicTokensEnabled,this.maxLookahead=Er(e,"maxLookahead")?e.maxLookahead:eh.maxLookahead,this.lookaheadStrategy=Er(e,"lookaheadStrategy")?e.lookaheadStrategy:new oB({maxLookahead:this.maxLookahead}),this.lookAheadFuncsCache=new Map}preComputeLookaheadFunctions(e){Ir(e,r=>{this.TRACE_INIT(`${r.name} Rule Lookahead`,()=>{const{alternation:n,repetition:i,option:a,repetitionMandatory:s,repetitionMandatoryWithSeparator:o,repetitionWithSeparator:l}=cge(r);Ir(n,u=>{const h=u.idx===0?"":u.idx;this.TRACE_INIT(`${Ol(u)}${h}`,()=>{const d=this.lookaheadStrategy.buildLookaheadForAlternation({prodOccurrence:u.idx,rule:r,maxLookahead:u.maxLookahead||this.maxLookahead,hasPredicates:u.hasPredicates,dynamicTokensEnabled:this.dynamicTokensEnabled}),f=j_(this.fullRuleNameToShort[r.name],oge,u.idx);this.setLaFuncCache(f,d)})}),Ir(i,u=>{this.computeLookaheadFunc(r,u.idx,iB,"Repetition",u.maxLookahead,Ol(u))}),Ir(a,u=>{this.computeLookaheadFunc(r,u.idx,lge,"Option",u.maxLookahead,Ol(u))}),Ir(s,u=>{this.computeLookaheadFunc(r,u.idx,aB,"RepetitionMandatory",u.maxLookahead,Ol(u))}),Ir(o,u=>{this.computeLookaheadFunc(r,u.idx,X_,"RepetitionMandatoryWithSeparator",u.maxLookahead,Ol(u))}),Ir(l,u=>{this.computeLookaheadFunc(r,u.idx,sB,"RepetitionWithSeparator",u.maxLookahead,Ol(u))})})})}computeLookaheadFunc(e,r,n,i,a,s){this.TRACE_INIT(`${s}${r===0?"":r}`,()=>{const o=this.lookaheadStrategy.buildLookaheadForOptional({prodOccurrence:r,rule:e,maxLookahead:a||this.maxLookahead,dynamicTokensEnabled:this.dynamicTokensEnabled,prodType:i}),l=j_(this.fullRuleNameToShort[e.name],n,r);this.setLaFuncCache(l,o)})}getKeyForAutomaticLookahead(e,r){const n=this.getLastExplicitRuleShortName();return j_(n,e,r)}getLaFuncFromCache(e){return this.lookAheadFuncsCache.get(e)}setLaFuncCache(e,r){this.lookAheadFuncsCache.set(e,r)}},E(nv,"LooksAhead"),nv),Alt=(iv=class extends t1{constructor(){super(...arguments),this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}reset(){this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}visitOption(e){this.dslMethods.option.push(e)}visitRepetitionWithSeparator(e){this.dslMethods.repetitionWithSeparator.push(e)}visitRepetitionMandatory(e){this.dslMethods.repetitionMandatory.push(e)}visitRepetitionMandatoryWithSeparator(e){this.dslMethods.repetitionMandatoryWithSeparator.push(e)}visitRepetition(e){this.dslMethods.repetition.push(e)}visitAlternation(e){this.dslMethods.alternation.push(e)}},E(iv,"DslMethodsCollectorVisitor"),iv),K_=new Alt;function cge(t){K_.reset(),t.accept(K_);const e=K_.dslMethods;return K_.reset(),e}E(cge,"collectMethods");function lB(t,e){isNaN(t.startOffset)===!0?(t.startOffset=e.startOffset,t.endOffset=e.endOffset):t.endOffsets.msg);throw Error(`Errors Detected in CST Visitor <${this.constructor.name}>: ${a.join(` `).replace(/\n/g,` - `)}`)}},"validateVisitor")};return r.prototype=n,r.prototype.constructor=r,r._RULE_NAMES=e,r}E(jle,"createBaseSemanticVisitorConstructor");function Zle(t,e,r){const n=E(function(){},"derivedConstructor");OM(n,t+"BaseSemanticsWithDefaults");const i=Object.create(r.prototype);return kr(e,a=>{i[a]=Kle}),n.prototype=i,n.prototype.constructor=n,n}E(Zle,"createBaseVisitorConstructorWithDefaults");var $M;(function(t){t[t.REDUNDANT_METHOD=0]="REDUNDANT_METHOD",t[t.MISSING_METHOD=1]="MISSING_METHOD"})($M||($M={}));function Qle(t,e){return Jle(t,e)}E(Qle,"validateVisitor");function Jle(t,e){const r=xo(e,i=>Zc(t[i])===!1),n=ur(r,i=>({msg:`Missing visitor method: <${i}> on ${t.constructor.name} CST Visitor.`,type:$M.MISSING_METHOD,methodName:i}));return nT(n)}E(Jle,"validateMissingCstMethods");var qQe=(S1=class{initTreeBuilder(e){if(this.CST_STACK=[],this.outputCst=e.outputCst,this.nodeLocationTracking=br(e,"nodeLocationTracking")?e.nodeLocationTracking:tu.nodeLocationTracking,!this.outputCst)this.cstInvocationStateUpdate=ta,this.cstFinallyStateUpdate=ta,this.cstPostTerminal=ta,this.cstPostNonTerminal=ta,this.cstPostRule=ta;else if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=NM,this.setNodeLocationFromNode=NM,this.cstPostRule=ta,this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=ta,this.setNodeLocationFromNode=ta,this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=MM,this.setNodeLocationFromNode=MM,this.cstPostRule=ta,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=ta,this.setNodeLocationFromNode=ta,this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else if(/none/i.test(this.nodeLocationTracking))this.setNodeLocationFromToken=ta,this.setNodeLocationFromNode=ta,this.cstPostRule=ta,this.setInitialNodeLocation=ta;else throw Error(`Invalid config option: "${e.nodeLocationTracking}"`)}setInitialNodeLocationOnlyOffsetRecovery(e){e.location={startOffset:NaN,endOffset:NaN}}setInitialNodeLocationOnlyOffsetRegular(e){e.location={startOffset:this.LA(1).startOffset,endOffset:NaN}}setInitialNodeLocationFullRecovery(e){e.location={startOffset:NaN,startLine:NaN,startColumn:NaN,endOffset:NaN,endLine:NaN,endColumn:NaN}}setInitialNodeLocationFullRegular(e){const r=this.LA(1);e.location={startOffset:r.startOffset,startLine:r.startLine,startColumn:r.startColumn,endOffset:NaN,endLine:NaN,endColumn:NaN}}cstInvocationStateUpdate(e){const r={name:e,children:Object.create(null)};this.setInitialNodeLocation(r),this.CST_STACK.push(r)}cstFinallyStateUpdate(){this.CST_STACK.pop()}cstPostRuleFull(e){const r=this.LA(0),n=e.location;n.startOffset<=r.startOffset?(n.endOffset=r.endOffset,n.endLine=r.endLine,n.endColumn=r.endColumn):(n.startOffset=NaN,n.startLine=NaN,n.startColumn=NaN)}cstPostRuleOnlyOffset(e){const r=this.LA(0),n=e.location;n.startOffset<=r.startOffset?n.endOffset=r.endOffset:n.startOffset=NaN}cstPostTerminal(e,r){const n=this.CST_STACK[this.CST_STACK.length-1];Yle(n,r,e),this.setNodeLocationFromToken(n.location,r)}cstPostNonTerminal(e,r){const n=this.CST_STACK[this.CST_STACK.length-1];Xle(n,r,e),this.setNodeLocationFromNode(n.location,e.location)}getBaseCstVisitorConstructor(){if(Jc(this.baseCstVisitorConstructor)){const e=jle(this.className,Ks(this.gastProductionsCache));return this.baseCstVisitorConstructor=e,e}return this.baseCstVisitorConstructor}getBaseCstVisitorConstructorWithDefaults(){if(Jc(this.baseCstVisitorWithDefaultsConstructor)){const e=Zle(this.className,Ks(this.gastProductionsCache),this.getBaseCstVisitorConstructor());return this.baseCstVisitorWithDefaultsConstructor=e,e}return this.baseCstVisitorWithDefaultsConstructor}getLastExplicitRuleShortName(){const e=this.RULE_STACK;return e[e.length-1]}getPreviousExplicitRuleShortName(){const e=this.RULE_STACK;return e[e.length-2]}getLastExplicitRuleOccurrenceIndex(){const e=this.RULE_OCCURRENCE_STACK;return e[e.length-1]}},E(S1,"TreeBuilder"),S1),VQe=(A1=class{initLexerAdapter(){this.tokVector=[],this.tokVectorLength=0,this.currIdx=-1}set input(e){if(this.selfAnalysisDone!==!0)throw Error("Missing invocation at the end of the Parser's constructor.");this.reset(),this.tokVector=e,this.tokVectorLength=e.length}get input(){return this.tokVector}SKIP_TOKEN(){return this.currIdx<=this.tokVector.length-2?(this.consumeToken(),this.LA(1)):Jk}LA(e){const r=this.currIdx+e;return r<0||this.tokVectorLength<=r?Jk:this.tokVector[r]}consumeToken(){this.currIdx++}exportLexerState(){return this.currIdx}importLexerState(e){this.currIdx=e}resetLexerState(){this.currIdx=-1}moveToTerminatedState(){this.currIdx=this.tokVector.length-1}getLexerPosition(){return this.exportLexerState()}},E(A1,"LexerAdapter"),A1),WQe=(_1=class{ACTION(e){return e.call(this)}consume(e,r,n){return this.consumeInternal(r,e,n)}subrule(e,r,n){return this.subruleInternal(r,e,n)}option(e,r){return this.optionInternal(r,e)}or(e,r){return this.orInternal(r,e)}many(e,r){return this.manyInternal(e,r)}atLeastOne(e,r){return this.atLeastOneInternal(e,r)}CONSUME(e,r){return this.consumeInternal(e,0,r)}CONSUME1(e,r){return this.consumeInternal(e,1,r)}CONSUME2(e,r){return this.consumeInternal(e,2,r)}CONSUME3(e,r){return this.consumeInternal(e,3,r)}CONSUME4(e,r){return this.consumeInternal(e,4,r)}CONSUME5(e,r){return this.consumeInternal(e,5,r)}CONSUME6(e,r){return this.consumeInternal(e,6,r)}CONSUME7(e,r){return this.consumeInternal(e,7,r)}CONSUME8(e,r){return this.consumeInternal(e,8,r)}CONSUME9(e,r){return this.consumeInternal(e,9,r)}SUBRULE(e,r){return this.subruleInternal(e,0,r)}SUBRULE1(e,r){return this.subruleInternal(e,1,r)}SUBRULE2(e,r){return this.subruleInternal(e,2,r)}SUBRULE3(e,r){return this.subruleInternal(e,3,r)}SUBRULE4(e,r){return this.subruleInternal(e,4,r)}SUBRULE5(e,r){return this.subruleInternal(e,5,r)}SUBRULE6(e,r){return this.subruleInternal(e,6,r)}SUBRULE7(e,r){return this.subruleInternal(e,7,r)}SUBRULE8(e,r){return this.subruleInternal(e,8,r)}SUBRULE9(e,r){return this.subruleInternal(e,9,r)}OPTION(e){return this.optionInternal(e,0)}OPTION1(e){return this.optionInternal(e,1)}OPTION2(e){return this.optionInternal(e,2)}OPTION3(e){return this.optionInternal(e,3)}OPTION4(e){return this.optionInternal(e,4)}OPTION5(e){return this.optionInternal(e,5)}OPTION6(e){return this.optionInternal(e,6)}OPTION7(e){return this.optionInternal(e,7)}OPTION8(e){return this.optionInternal(e,8)}OPTION9(e){return this.optionInternal(e,9)}OR(e){return this.orInternal(e,0)}OR1(e){return this.orInternal(e,1)}OR2(e){return this.orInternal(e,2)}OR3(e){return this.orInternal(e,3)}OR4(e){return this.orInternal(e,4)}OR5(e){return this.orInternal(e,5)}OR6(e){return this.orInternal(e,6)}OR7(e){return this.orInternal(e,7)}OR8(e){return this.orInternal(e,8)}OR9(e){return this.orInternal(e,9)}MANY(e){this.manyInternal(0,e)}MANY1(e){this.manyInternal(1,e)}MANY2(e){this.manyInternal(2,e)}MANY3(e){this.manyInternal(3,e)}MANY4(e){this.manyInternal(4,e)}MANY5(e){this.manyInternal(5,e)}MANY6(e){this.manyInternal(6,e)}MANY7(e){this.manyInternal(7,e)}MANY8(e){this.manyInternal(8,e)}MANY9(e){this.manyInternal(9,e)}MANY_SEP(e){this.manySepFirstInternal(0,e)}MANY_SEP1(e){this.manySepFirstInternal(1,e)}MANY_SEP2(e){this.manySepFirstInternal(2,e)}MANY_SEP3(e){this.manySepFirstInternal(3,e)}MANY_SEP4(e){this.manySepFirstInternal(4,e)}MANY_SEP5(e){this.manySepFirstInternal(5,e)}MANY_SEP6(e){this.manySepFirstInternal(6,e)}MANY_SEP7(e){this.manySepFirstInternal(7,e)}MANY_SEP8(e){this.manySepFirstInternal(8,e)}MANY_SEP9(e){this.manySepFirstInternal(9,e)}AT_LEAST_ONE(e){this.atLeastOneInternal(0,e)}AT_LEAST_ONE1(e){return this.atLeastOneInternal(1,e)}AT_LEAST_ONE2(e){this.atLeastOneInternal(2,e)}AT_LEAST_ONE3(e){this.atLeastOneInternal(3,e)}AT_LEAST_ONE4(e){this.atLeastOneInternal(4,e)}AT_LEAST_ONE5(e){this.atLeastOneInternal(5,e)}AT_LEAST_ONE6(e){this.atLeastOneInternal(6,e)}AT_LEAST_ONE7(e){this.atLeastOneInternal(7,e)}AT_LEAST_ONE8(e){this.atLeastOneInternal(8,e)}AT_LEAST_ONE9(e){this.atLeastOneInternal(9,e)}AT_LEAST_ONE_SEP(e){this.atLeastOneSepFirstInternal(0,e)}AT_LEAST_ONE_SEP1(e){this.atLeastOneSepFirstInternal(1,e)}AT_LEAST_ONE_SEP2(e){this.atLeastOneSepFirstInternal(2,e)}AT_LEAST_ONE_SEP3(e){this.atLeastOneSepFirstInternal(3,e)}AT_LEAST_ONE_SEP4(e){this.atLeastOneSepFirstInternal(4,e)}AT_LEAST_ONE_SEP5(e){this.atLeastOneSepFirstInternal(5,e)}AT_LEAST_ONE_SEP6(e){this.atLeastOneSepFirstInternal(6,e)}AT_LEAST_ONE_SEP7(e){this.atLeastOneSepFirstInternal(7,e)}AT_LEAST_ONE_SEP8(e){this.atLeastOneSepFirstInternal(8,e)}AT_LEAST_ONE_SEP9(e){this.atLeastOneSepFirstInternal(9,e)}RULE(e,r,n=eE){if(ns(this.definedRulesNames,e)){const s={message:Af.buildDuplicateRuleNameError({topLevelRule:e,grammarName:this.className}),type:ss.DUPLICATE_RULE_NAME,ruleName:e};this.definitionErrors.push(s)}this.definedRulesNames.push(e);const i=this.defineRule(e,r,n);return this[e]=i,i}OVERRIDE_RULE(e,r,n=eE){const i=Sle(e,this.definedRulesNames,this.className);this.definitionErrors=this.definitionErrors.concat(i);const a=this.defineRule(e,r,n);return this[e]=a,a}BACKTRACK(e,r){return function(){this.isBackTrackingStack.push(1);const n=this.saveRecogState();try{return e.apply(this,r),!0}catch(i){if(vT(i))return!1;throw i}finally{this.reloadRecogState(n),this.isBackTrackingStack.pop()}}}getGAstProductions(){return this.gastProductionsCache}getSerializedGastProductions(){return hoe(Vi(this.gastProductionsCache))}},E(_1,"RecognizerApi"),_1),UQe=(R1=class{initRecognizerEngine(e,r){if(this.className=this.constructor.name,this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=dT,this.subruleIdx=0,this.definedRulesNames=[],this.tokensMap={},this.isBackTrackingStack=[],this.RULE_STACK=[],this.RULE_OCCURRENCE_STACK=[],this.gastProductionsCache={},br(r,"serializedGrammar"))throw Error(`The Parser's configuration can no longer contain a property. + `)}`)}},"validateVisitor")};return r.prototype=n,r.prototype.constructor=r,r._RULE_NAMES=e,r}E(fge,"createBaseSemanticVisitorConstructor");function pge(t,e,r){const n=E(function(){},"derivedConstructor");uB(n,t+"BaseSemanticsWithDefaults");const i=Object.create(r.prototype);return Ir(e,a=>{i[a]=dge}),n.prototype=i,n.prototype.constructor=n,n}E(pge,"createBaseVisitorConstructorWithDefaults");var hB;(function(t){t[t.REDUNDANT_METHOD=0]="REDUNDANT_METHOD",t[t.MISSING_METHOD=1]="MISSING_METHOD"})(hB||(hB={}));function gge(t,e){return mge(t,e)}E(gge,"validateVisitor");function mge(t,e){const r=al(e,i=>Ku(t[i])===!1),n=mr(r,i=>({msg:`Missing visitor method: <${i}> on ${t.constructor.name} CST Visitor.`,type:hB.MISSING_METHOD,methodName:i}));return uC(n)}E(mge,"validateMissingCstMethods");var Llt=(av=class{initTreeBuilder(e){if(this.CST_STACK=[],this.outputCst=e.outputCst,this.nodeLocationTracking=Er(e,"nodeLocationTracking")?e.nodeLocationTracking:eh.nodeLocationTracking,!this.outputCst)this.cstInvocationStateUpdate=ka,this.cstFinallyStateUpdate=ka,this.cstPostTerminal=ka,this.cstPostNonTerminal=ka,this.cstPostRule=ka;else if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=cB,this.setNodeLocationFromNode=cB,this.cstPostRule=ka,this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=ka,this.setNodeLocationFromNode=ka,this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=lB,this.setNodeLocationFromNode=lB,this.cstPostRule=ka,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=ka,this.setNodeLocationFromNode=ka,this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else if(/none/i.test(this.nodeLocationTracking))this.setNodeLocationFromToken=ka,this.setNodeLocationFromNode=ka,this.cstPostRule=ka,this.setInitialNodeLocation=ka;else throw Error(`Invalid config option: "${e.nodeLocationTracking}"`)}setInitialNodeLocationOnlyOffsetRecovery(e){e.location={startOffset:NaN,endOffset:NaN}}setInitialNodeLocationOnlyOffsetRegular(e){e.location={startOffset:this.LA(1).startOffset,endOffset:NaN}}setInitialNodeLocationFullRecovery(e){e.location={startOffset:NaN,startLine:NaN,startColumn:NaN,endOffset:NaN,endLine:NaN,endColumn:NaN}}setInitialNodeLocationFullRegular(e){const r=this.LA(1);e.location={startOffset:r.startOffset,startLine:r.startLine,startColumn:r.startColumn,endOffset:NaN,endLine:NaN,endColumn:NaN}}cstInvocationStateUpdate(e){const r={name:e,children:Object.create(null)};this.setInitialNodeLocation(r),this.CST_STACK.push(r)}cstFinallyStateUpdate(){this.CST_STACK.pop()}cstPostRuleFull(e){const r=this.LA(0),n=e.location;n.startOffset<=r.startOffset?(n.endOffset=r.endOffset,n.endLine=r.endLine,n.endColumn=r.endColumn):(n.startOffset=NaN,n.startLine=NaN,n.startColumn=NaN)}cstPostRuleOnlyOffset(e){const r=this.LA(0),n=e.location;n.startOffset<=r.startOffset?n.endOffset=r.endOffset:n.startOffset=NaN}cstPostTerminal(e,r){const n=this.CST_STACK[this.CST_STACK.length-1];uge(n,r,e),this.setNodeLocationFromToken(n.location,r)}cstPostNonTerminal(e,r){const n=this.CST_STACK[this.CST_STACK.length-1];hge(n,r,e),this.setNodeLocationFromNode(n.location,e.location)}getBaseCstVisitorConstructor(){if(Qu(this.baseCstVisitorConstructor)){const e=fge(this.className,Io(this.gastProductionsCache));return this.baseCstVisitorConstructor=e,e}return this.baseCstVisitorConstructor}getBaseCstVisitorConstructorWithDefaults(){if(Qu(this.baseCstVisitorWithDefaultsConstructor)){const e=pge(this.className,Io(this.gastProductionsCache),this.getBaseCstVisitorConstructor());return this.baseCstVisitorWithDefaultsConstructor=e,e}return this.baseCstVisitorWithDefaultsConstructor}getLastExplicitRuleShortName(){const e=this.RULE_STACK;return e[e.length-1]}getPreviousExplicitRuleShortName(){const e=this.RULE_STACK;return e[e.length-2]}getLastExplicitRuleOccurrenceIndex(){const e=this.RULE_OCCURRENCE_STACK;return e[e.length-1]}},E(av,"TreeBuilder"),av),Ilt=(sv=class{initLexerAdapter(){this.tokVector=[],this.tokVectorLength=0,this.currIdx=-1}set input(e){if(this.selfAnalysisDone!==!0)throw Error("Missing invocation at the end of the Parser's constructor.");this.reset(),this.tokVector=e,this.tokVectorLength=e.length}get input(){return this.tokVector}SKIP_TOKEN(){return this.currIdx<=this.tokVector.length-2?(this.consumeToken(),this.LA(1)):Q_}LA(e){const r=this.currIdx+e;return r<0||this.tokVectorLength<=r?Q_:this.tokVector[r]}consumeToken(){this.currIdx++}exportLexerState(){return this.currIdx}importLexerState(e){this.currIdx=e}resetLexerState(){this.currIdx=-1}moveToTerminatedState(){this.currIdx=this.tokVector.length-1}getLexerPosition(){return this.exportLexerState()}},E(sv,"LexerAdapter"),sv),Dlt=(ov=class{ACTION(e){return e.call(this)}consume(e,r,n){return this.consumeInternal(r,e,n)}subrule(e,r,n){return this.subruleInternal(r,e,n)}option(e,r){return this.optionInternal(r,e)}or(e,r){return this.orInternal(r,e)}many(e,r){return this.manyInternal(e,r)}atLeastOne(e,r){return this.atLeastOneInternal(e,r)}CONSUME(e,r){return this.consumeInternal(e,0,r)}CONSUME1(e,r){return this.consumeInternal(e,1,r)}CONSUME2(e,r){return this.consumeInternal(e,2,r)}CONSUME3(e,r){return this.consumeInternal(e,3,r)}CONSUME4(e,r){return this.consumeInternal(e,4,r)}CONSUME5(e,r){return this.consumeInternal(e,5,r)}CONSUME6(e,r){return this.consumeInternal(e,6,r)}CONSUME7(e,r){return this.consumeInternal(e,7,r)}CONSUME8(e,r){return this.consumeInternal(e,8,r)}CONSUME9(e,r){return this.consumeInternal(e,9,r)}SUBRULE(e,r){return this.subruleInternal(e,0,r)}SUBRULE1(e,r){return this.subruleInternal(e,1,r)}SUBRULE2(e,r){return this.subruleInternal(e,2,r)}SUBRULE3(e,r){return this.subruleInternal(e,3,r)}SUBRULE4(e,r){return this.subruleInternal(e,4,r)}SUBRULE5(e,r){return this.subruleInternal(e,5,r)}SUBRULE6(e,r){return this.subruleInternal(e,6,r)}SUBRULE7(e,r){return this.subruleInternal(e,7,r)}SUBRULE8(e,r){return this.subruleInternal(e,8,r)}SUBRULE9(e,r){return this.subruleInternal(e,9,r)}OPTION(e){return this.optionInternal(e,0)}OPTION1(e){return this.optionInternal(e,1)}OPTION2(e){return this.optionInternal(e,2)}OPTION3(e){return this.optionInternal(e,3)}OPTION4(e){return this.optionInternal(e,4)}OPTION5(e){return this.optionInternal(e,5)}OPTION6(e){return this.optionInternal(e,6)}OPTION7(e){return this.optionInternal(e,7)}OPTION8(e){return this.optionInternal(e,8)}OPTION9(e){return this.optionInternal(e,9)}OR(e){return this.orInternal(e,0)}OR1(e){return this.orInternal(e,1)}OR2(e){return this.orInternal(e,2)}OR3(e){return this.orInternal(e,3)}OR4(e){return this.orInternal(e,4)}OR5(e){return this.orInternal(e,5)}OR6(e){return this.orInternal(e,6)}OR7(e){return this.orInternal(e,7)}OR8(e){return this.orInternal(e,8)}OR9(e){return this.orInternal(e,9)}MANY(e){this.manyInternal(0,e)}MANY1(e){this.manyInternal(1,e)}MANY2(e){this.manyInternal(2,e)}MANY3(e){this.manyInternal(3,e)}MANY4(e){this.manyInternal(4,e)}MANY5(e){this.manyInternal(5,e)}MANY6(e){this.manyInternal(6,e)}MANY7(e){this.manyInternal(7,e)}MANY8(e){this.manyInternal(8,e)}MANY9(e){this.manyInternal(9,e)}MANY_SEP(e){this.manySepFirstInternal(0,e)}MANY_SEP1(e){this.manySepFirstInternal(1,e)}MANY_SEP2(e){this.manySepFirstInternal(2,e)}MANY_SEP3(e){this.manySepFirstInternal(3,e)}MANY_SEP4(e){this.manySepFirstInternal(4,e)}MANY_SEP5(e){this.manySepFirstInternal(5,e)}MANY_SEP6(e){this.manySepFirstInternal(6,e)}MANY_SEP7(e){this.manySepFirstInternal(7,e)}MANY_SEP8(e){this.manySepFirstInternal(8,e)}MANY_SEP9(e){this.manySepFirstInternal(9,e)}AT_LEAST_ONE(e){this.atLeastOneInternal(0,e)}AT_LEAST_ONE1(e){return this.atLeastOneInternal(1,e)}AT_LEAST_ONE2(e){this.atLeastOneInternal(2,e)}AT_LEAST_ONE3(e){this.atLeastOneInternal(3,e)}AT_LEAST_ONE4(e){this.atLeastOneInternal(4,e)}AT_LEAST_ONE5(e){this.atLeastOneInternal(5,e)}AT_LEAST_ONE6(e){this.atLeastOneInternal(6,e)}AT_LEAST_ONE7(e){this.atLeastOneInternal(7,e)}AT_LEAST_ONE8(e){this.atLeastOneInternal(8,e)}AT_LEAST_ONE9(e){this.atLeastOneInternal(9,e)}AT_LEAST_ONE_SEP(e){this.atLeastOneSepFirstInternal(0,e)}AT_LEAST_ONE_SEP1(e){this.atLeastOneSepFirstInternal(1,e)}AT_LEAST_ONE_SEP2(e){this.atLeastOneSepFirstInternal(2,e)}AT_LEAST_ONE_SEP3(e){this.atLeastOneSepFirstInternal(3,e)}AT_LEAST_ONE_SEP4(e){this.atLeastOneSepFirstInternal(4,e)}AT_LEAST_ONE_SEP5(e){this.atLeastOneSepFirstInternal(5,e)}AT_LEAST_ONE_SEP6(e){this.atLeastOneSepFirstInternal(6,e)}AT_LEAST_ONE_SEP7(e){this.atLeastOneSepFirstInternal(7,e)}AT_LEAST_ONE_SEP8(e){this.atLeastOneSepFirstInternal(8,e)}AT_LEAST_ONE_SEP9(e){this.atLeastOneSepFirstInternal(9,e)}RULE(e,r,n=J_){if(Ms(this.definedRulesNames,e)){const s={message:Vp.buildDuplicateRuleNameError({topLevelRule:e,grammarName:this.className}),type:Os.DUPLICATE_RULE_NAME,ruleName:e};this.definitionErrors.push(s)}this.definedRulesNames.push(e);const i=this.defineRule(e,r,n);return this[e]=i,i}OVERRIDE_RULE(e,r,n=J_){const i=V0e(e,this.definedRulesNames,this.className);this.definitionErrors=this.definitionErrors.concat(i);const a=this.defineRule(e,r,n);return this[e]=a,a}BACKTRACK(e,r){return function(){this.isBackTrackingStack.push(1);const n=this.saveRecogState();try{return e.apply(this,r),!0}catch(i){if(EC(i))return!1;throw i}finally{this.reloadRecogState(n),this.isBackTrackingStack.pop()}}}getGAstProductions(){return this.gastProductionsCache}getSerializedGastProductions(){return Ape(da(this.gastProductionsCache))}},E(ov,"RecognizerApi"),ov),Mlt=(lv=class{initRecognizerEngine(e,r){if(this.className=this.constructor.name,this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=bC,this.subruleIdx=0,this.definedRulesNames=[],this.tokensMap={},this.isBackTrackingStack=[],this.RULE_STACK=[],this.RULE_OCCURRENCE_STACK=[],this.gastProductionsCache={},Er(r,"serializedGrammar"))throw Error(`The Parser's configuration can no longer contain a property. See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_6-0-0 - For Further details.`);if(Zr(e)){if(An(e))throw Error(`A Token Vocabulary cannot be empty. + For Further details.`);if(on(e)){if(qn(e))throw Error(`A Token Vocabulary cannot be empty. Note that the first argument for the parser constructor is no longer a Token vector (since v4.0).`);if(typeof e[0].startOffset=="number")throw Error(`The Parser constructor no longer accepts a token vector as the first argument. See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_4-0-0 - For Further details.`)}if(Zr(e))this.tokensMap=Zs(e,(a,s)=>(a[s.name]=s,a),{});else if(br(e,"modes")&&Yo(Ho(Vi(e.modes)),ele)){const a=Ho(Vi(e.modes)),s=iM(a);this.tokensMap=Zs(s,(o,l)=>(o[l.name]=l,o),{})}else if(bo(e))this.tokensMap=ma(e);else throw new Error(" argument must be An Array of Token constructors, A dictionary of Token constructors or an IMultiModeLexerDefinition");this.tokensMap.EOF=Ch;const n=br(e,"modes")?Ho(Vi(e.modes)):Vi(e),i=Yo(n,a=>An(a.categoryMatches));this.tokenMatcher=i?dT:kg,Eg(Vi(this.tokensMap))}defineRule(e,r,n){if(this.selfAnalysisDone)throw Error(`Grammar rule <${e}> may not be defined after the 'performSelfAnalysis' method has been called' -Make sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.`);const i=br(n,"resyncEnabled")?n.resyncEnabled:eE.resyncEnabled,a=br(n,"recoveryValueFunc")?n.recoveryValueFunc:eE.recoveryValueFunc,s=this.ruleShortNameIdx<s.call(this)&&o.call(this),"lookAheadFunc")}}else a=e;if(i.call(this)===!0)return a.call(this)}atLeastOneInternal(e,r){const n=this.getKeyForAutomaticLookahead(LM,e);return this.atLeastOneInternalLogic(e,r,n)}atLeastOneInternalLogic(e,r,n){let i=this.getLaFuncFromCache(n),a;if(typeof r!="function"){a=r.DEF;const s=r.GATE;if(s!==void 0){const o=i;i=E(()=>s.call(this)&&o.call(this),"lookAheadFunc")}}else a=r;if(i.call(this)===!0){let s=this.doSingleRepetition(a);for(;i.call(this)===!0&&s===!0;)s=this.doSingleRepetition(a)}else throw this.raiseEarlyExitException(e,Qn.REPETITION_MANDATORY,r.ERR_MSG);this.attemptInRepetitionRecovery(this.atLeastOneInternal,[e,r],i,LM,e,RQe)}atLeastOneSepFirstInternal(e,r){const n=this.getKeyForAutomaticLookahead(Kk,e);this.atLeastOneSepFirstInternalLogic(e,r,n)}atLeastOneSepFirstInternalLogic(e,r,n){const i=r.DEF,a=r.SEP;if(this.getLaFuncFromCache(n).call(this)===!0){i.call(this);const o=E(()=>this.tokenMatcher(this.LA(1),a),"separatorLookAheadFunc");for(;this.tokenMatcher(this.LA(1),a)===!0;)this.CONSUME(a),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,a,o,i,dle],o,Kk,e,dle)}else throw this.raiseEarlyExitException(e,Qn.REPETITION_MANDATORY_WITH_SEPARATOR,r.ERR_MSG)}manyInternal(e,r){const n=this.getKeyForAutomaticLookahead(RM,e);return this.manyInternalLogic(e,r,n)}manyInternalLogic(e,r,n){let i=this.getLaFuncFromCache(n),a;if(typeof r!="function"){a=r.DEF;const o=r.GATE;if(o!==void 0){const l=i;i=E(()=>o.call(this)&&l.call(this),"lookaheadFunction")}}else a=r;let s=!0;for(;i.call(this)===!0&&s===!0;)s=this.doSingleRepetition(a);this.attemptInRepetitionRecovery(this.manyInternal,[e,r],i,RM,e,_Qe,s)}manySepFirstInternal(e,r){const n=this.getKeyForAutomaticLookahead(IM,e);this.manySepFirstInternalLogic(e,r,n)}manySepFirstInternalLogic(e,r,n){const i=r.DEF,a=r.SEP;if(this.getLaFuncFromCache(n).call(this)===!0){i.call(this);const o=E(()=>this.tokenMatcher(this.LA(1),a),"separatorLookAheadFunc");for(;this.tokenMatcher(this.LA(1),a)===!0;)this.CONSUME(a),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,a,o,i,hle],o,IM,e,hle)}}repetitionSepSecondInternal(e,r,n,i,a){for(;n();)this.CONSUME(r),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,r,n,i,a],n,Kk,e,a)}doSingleRepetition(e){const r=this.getLexerPosition();return e.call(this),this.getLexerPosition()>r}orInternal(e,r){const n=this.getKeyForAutomaticLookahead(Wle,r),i=Zr(e)?e:e.DEF,s=this.getLaFuncFromCache(n).call(this,i);if(s!==void 0)return i[s].ALT.call(this);this.raiseNoAltException(r,e.ERR_MSG)}ruleFinallyStateUpdate(){if(this.RULE_STACK.pop(),this.RULE_OCCURRENCE_STACK.pop(),this.cstFinallyStateUpdate(),this.RULE_STACK.length===0&&this.isAtEndOfInput()===!1){const e=this.LA(1),r=this.errorMessageProvider.buildNotAllInputParsedMessage({firstRedundant:e,ruleName:this.getCurrRuleFullName()});this.SAVE_ERROR(new NQe(r,e))}}subruleInternal(e,r,n){let i;try{const a=n!==void 0?n.ARGS:void 0;return this.subruleIdx=r,i=e.apply(this,a),this.cstPostNonTerminal(i,n!==void 0&&n.LABEL!==void 0?n.LABEL:e.ruleName),i}catch(a){throw this.subruleInternalError(a,n,e.ruleName)}}subruleInternalError(e,r,n){throw vT(e)&&e.partialCstResult!==void 0&&(this.cstPostNonTerminal(e.partialCstResult,r!==void 0&&r.LABEL!==void 0?r.LABEL:n),delete e.partialCstResult),e}consumeInternal(e,r,n){let i;try{const a=this.LA(1);this.tokenMatcher(a,e)===!0?(this.consumeToken(),i=a):this.consumeInternalError(e,a,n)}catch(a){i=this.consumeInternalRecovery(e,r,a)}return this.cstPostTerminal(n!==void 0&&n.LABEL!==void 0?n.LABEL:e.name,i),i}consumeInternalError(e,r,n){let i;const a=this.LA(0);throw n!==void 0&&n.ERR_MSG?i=n.ERR_MSG:i=this.errorMessageProvider.buildMismatchTokenMessage({expected:e,actual:r,previous:a,ruleName:this.getCurrRuleFullName()}),this.SAVE_ERROR(new Gle(i,r,a))}consumeInternalRecovery(e,r,n){if(this.recoveryEnabled&&n.name==="MismatchedTokenException"&&!this.isBackTracking()){const i=this.getFollowsForInRuleRecovery(e,r);try{return this.tryInRuleRecovery(e,i)}catch(a){throw a.name===qle?n:a}}else throw n}saveRecogState(){const e=this.errors,r=ma(this.RULE_STACK);return{errors:e,lexerState:this.exportLexerState(),RULE_STACK:r,CST_STACK:this.CST_STACK}}reloadRecogState(e){this.errors=e.errors,this.importLexerState(e.lexerState),this.RULE_STACK=e.RULE_STACK}ruleInvocationStateUpdate(e,r,n){this.RULE_OCCURRENCE_STACK.push(n),this.RULE_STACK.push(e),this.cstInvocationStateUpdate(r)}isBackTracking(){return this.isBackTrackingStack.length!==0}getCurrRuleFullName(){const e=this.getLastExplicitRuleShortName();return this.shortRuleNameToFull[e]}shortRuleNameToFullName(e){return this.shortRuleNameToFull[e]}isAtEndOfInput(){return this.tokenMatcher(this.LA(1),Ch)}reset(){this.resetLexerState(),this.subruleIdx=0,this.isBackTrackingStack=[],this.errors=[],this.RULE_STACK=[],this.CST_STACK=[],this.RULE_OCCURRENCE_STACK=[]}},E(R1,"RecognizerEngine"),R1),HQe=(L1=class{initErrorHandler(e){this._errors=[],this.errorMessageProvider=br(e,"errorMessageProvider")?e.errorMessageProvider:tu.errorMessageProvider}SAVE_ERROR(e){if(vT(e))return e.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:ma(this.RULE_OCCURRENCE_STACK)},this._errors.push(e),e;throw Error("Trying to save an Error which is not a RecognitionException")}get errors(){return ma(this._errors)}set errors(e){this._errors=e}raiseEarlyExitException(e,r,n){const i=this.getCurrRuleFullName(),a=this.getGAstProductions()[i],o=mT(e,a,r,this.maxLookahead)[0],l=[];for(let h=1;h<=this.maxLookahead;h++)l.push(this.LA(h));const u=this.errorMessageProvider.buildEarlyExitMessage({expectedIterationPaths:o,actual:l,previous:this.LA(0),customUserDescription:n,ruleName:i});throw this.SAVE_ERROR(new OQe(u,this.LA(1),this.LA(0)))}raiseNoAltException(e,r){const n=this.getCurrRuleFullName(),i=this.getGAstProductions()[n],a=gT(e,i,this.maxLookahead),s=[];for(let u=1;u<=this.maxLookahead;u++)s.push(this.LA(u));const o=this.LA(0),l=this.errorMessageProvider.buildNoViableAltMessage({expectedPathsPerAlt:a,actual:s,previous:o,customUserDescription:r,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new MQe(l,this.LA(1),o))}},E(L1,"ErrorHandler"),L1),YQe=(I1=class{initContentAssist(){}computeContentAssist(e,r){const n=this.gastProductionsCache[e];if(Jc(n))throw Error(`Rule ->${e}<- does not exist in this grammar.`);return xM([n],r,this.tokenMatcher,this.maxLookahead)}getNextPossibleTokenTypes(e){const r=Xo(e.ruleStack),i=this.getGAstProductions()[r];return new AQe(i,e).startWalking()}},E(I1,"ContentAssist"),I1),Qk={description:"This Object indicates the Parser is during Recording Phase"};Object.freeze(Qk);var ece=!0,tce=Math.pow(2,kh)-1,rce=Sg({name:"RECORDING_PHASE_TOKEN",pattern:as.NA});Eg([rce]);var nce=pT(rce,`This IToken indicates the Parser is in Recording Phase - See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,-1,-1,-1,-1,-1,-1);Object.freeze(nce);var XQe={name:`This CSTNode indicates the Parser is in Recording Phase - See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,children:{}},KQe=(D1=class{initGastRecorder(e){this.recordingProdStack=[],this.RECORDING_PHASE=!1}enableRecording(){this.RECORDING_PHASE=!0,this.TRACE_INIT("Enable Recording",()=>{for(let e=0;e<10;e++){const r=e>0?e:"";this[`CONSUME${r}`]=function(n,i){return this.consumeInternalRecord(n,e,i)},this[`SUBRULE${r}`]=function(n,i){return this.subruleInternalRecord(n,e,i)},this[`OPTION${r}`]=function(n){return this.optionInternalRecord(n,e)},this[`OR${r}`]=function(n){return this.orInternalRecord(n,e)},this[`MANY${r}`]=function(n){this.manyInternalRecord(e,n)},this[`MANY_SEP${r}`]=function(n){this.manySepFirstInternalRecord(e,n)},this[`AT_LEAST_ONE${r}`]=function(n){this.atLeastOneInternalRecord(e,n)},this[`AT_LEAST_ONE_SEP${r}`]=function(n){this.atLeastOneSepFirstInternalRecord(e,n)}}this.consume=function(e,r,n){return this.consumeInternalRecord(r,e,n)},this.subrule=function(e,r,n){return this.subruleInternalRecord(r,e,n)},this.option=function(e,r){return this.optionInternalRecord(r,e)},this.or=function(e,r){return this.orInternalRecord(r,e)},this.many=function(e,r){this.manyInternalRecord(e,r)},this.atLeastOne=function(e,r){this.atLeastOneInternalRecord(e,r)},this.ACTION=this.ACTION_RECORD,this.BACKTRACK=this.BACKTRACK_RECORD,this.LA=this.LA_RECORD})}disableRecording(){this.RECORDING_PHASE=!1,this.TRACE_INIT("Deleting Recording methods",()=>{const e=this;for(let r=0;r<10;r++){const n=r>0?r:"";delete e[`CONSUME${n}`],delete e[`SUBRULE${n}`],delete e[`OPTION${n}`],delete e[`OR${n}`],delete e[`MANY${n}`],delete e[`MANY_SEP${n}`],delete e[`AT_LEAST_ONE${n}`],delete e[`AT_LEAST_ONE_SEP${n}`]}delete e.consume,delete e.subrule,delete e.option,delete e.or,delete e.many,delete e.atLeastOne,delete e.ACTION,delete e.BACKTRACK,delete e.LA})}ACTION_RECORD(e){}BACKTRACK_RECORD(e,r){return()=>!0}LA_RECORD(e){return Jk}topLevelRuleRecord(e,r){try{const n=new Tg({definition:[],name:e});return n.name=e,this.recordingProdStack.push(n),r.call(this),this.recordingProdStack.pop(),n}catch(n){if(n.KNOWN_RECORDER_ERROR!==!0)try{n.message=n.message+` + For Further details.`)}if(on(e))this.tokensMap=Mo(e,(a,s)=>(a[s.name]=s,a),{});else if(Er(e,"modes")&&Ml(Dl(da(e.modes)),y0e)){const a=Dl(da(e.modes)),s=MP(a);this.tokensMap=Mo(s,(o,l)=>(o[l.name]=l,o),{})}else if(il(e))this.tokensMap=Ga(e);else throw new Error(" argument must be An Array of Token constructors, A dictionary of Token constructors or an IMultiModeLexerDefinition");this.tokensMap.EOF=Ed;const n=Er(e,"modes")?Dl(da(e.modes)):da(e),i=Ml(n,a=>qn(a.categoryMatches));this.tokenMatcher=i?bC:n1,i1(da(this.tokensMap))}defineRule(e,r,n){if(this.selfAnalysisDone)throw Error(`Grammar rule <${e}> may not be defined after the 'performSelfAnalysis' method has been called' +Make sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.`);const i=Er(n,"resyncEnabled")?n.resyncEnabled:J_.resyncEnabled,a=Er(n,"recoveryValueFunc")?n.recoveryValueFunc:J_.recoveryValueFunc,s=this.ruleShortNameIdx<s.call(this)&&o.call(this),"lookAheadFunc")}}else a=e;if(i.call(this)===!0)return a.call(this)}atLeastOneInternal(e,r){const n=this.getKeyForAutomaticLookahead(aB,e);return this.atLeastOneInternalLogic(e,r,n)}atLeastOneInternalLogic(e,r,n){let i=this.getLaFuncFromCache(n),a;if(typeof r!="function"){a=r.DEF;const s=r.GATE;if(s!==void 0){const o=i;i=E(()=>s.call(this)&&o.call(this),"lookAheadFunc")}}else a=r;if(i.call(this)===!0){let s=this.doSingleRepetition(a);for(;i.call(this)===!0&&s===!0;)s=this.doSingleRepetition(a)}else throw this.raiseEarlyExitException(e,bi.REPETITION_MANDATORY,r.ERR_MSG);this.attemptInRepetitionRecovery(this.atLeastOneInternal,[e,r],i,aB,e,ylt)}atLeastOneSepFirstInternal(e,r){const n=this.getKeyForAutomaticLookahead(X_,e);this.atLeastOneSepFirstInternalLogic(e,r,n)}atLeastOneSepFirstInternalLogic(e,r,n){const i=r.DEF,a=r.SEP;if(this.getLaFuncFromCache(n).call(this)===!0){i.call(this);const o=E(()=>this.tokenMatcher(this.LA(1),a),"separatorLookAheadFunc");for(;this.tokenMatcher(this.LA(1),a)===!0;)this.CONSUME(a),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,a,o,i,R0e],o,X_,e,R0e)}else throw this.raiseEarlyExitException(e,bi.REPETITION_MANDATORY_WITH_SEPARATOR,r.ERR_MSG)}manyInternal(e,r){const n=this.getKeyForAutomaticLookahead(iB,e);return this.manyInternalLogic(e,r,n)}manyInternalLogic(e,r,n){let i=this.getLaFuncFromCache(n),a;if(typeof r!="function"){a=r.DEF;const o=r.GATE;if(o!==void 0){const l=i;i=E(()=>o.call(this)&&l.call(this),"lookaheadFunction")}}else a=r;let s=!0;for(;i.call(this)===!0&&s===!0;)s=this.doSingleRepetition(a);this.attemptInRepetitionRecovery(this.manyInternal,[e,r],i,iB,e,mlt,s)}manySepFirstInternal(e,r){const n=this.getKeyForAutomaticLookahead(sB,e);this.manySepFirstInternalLogic(e,r,n)}manySepFirstInternalLogic(e,r,n){const i=r.DEF,a=r.SEP;if(this.getLaFuncFromCache(n).call(this)===!0){i.call(this);const o=E(()=>this.tokenMatcher(this.LA(1),a),"separatorLookAheadFunc");for(;this.tokenMatcher(this.LA(1),a)===!0;)this.CONSUME(a),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,a,o,i,A0e],o,sB,e,A0e)}}repetitionSepSecondInternal(e,r,n,i,a){for(;n();)this.CONSUME(r),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,r,n,i,a],n,X_,e,a)}doSingleRepetition(e){const r=this.getLexerPosition();return e.call(this),this.getLexerPosition()>r}orInternal(e,r){const n=this.getKeyForAutomaticLookahead(oge,r),i=on(e)?e:e.DEF,s=this.getLaFuncFromCache(n).call(this,i);if(s!==void 0)return i[s].ALT.call(this);this.raiseNoAltException(r,e.ERR_MSG)}ruleFinallyStateUpdate(){if(this.RULE_STACK.pop(),this.RULE_OCCURRENCE_STACK.pop(),this.cstFinallyStateUpdate(),this.RULE_STACK.length===0&&this.isAtEndOfInput()===!1){const e=this.LA(1),r=this.errorMessageProvider.buildNotAllInputParsedMessage({firstRedundant:e,ruleName:this.getCurrRuleFullName()});this.SAVE_ERROR(new wlt(r,e))}}subruleInternal(e,r,n){let i;try{const a=n!==void 0?n.ARGS:void 0;return this.subruleIdx=r,i=e.apply(this,a),this.cstPostNonTerminal(i,n!==void 0&&n.LABEL!==void 0?n.LABEL:e.ruleName),i}catch(a){throw this.subruleInternalError(a,n,e.ruleName)}}subruleInternalError(e,r,n){throw EC(e)&&e.partialCstResult!==void 0&&(this.cstPostNonTerminal(e.partialCstResult,r!==void 0&&r.LABEL!==void 0?r.LABEL:n),delete e.partialCstResult),e}consumeInternal(e,r,n){let i;try{const a=this.LA(1);this.tokenMatcher(a,e)===!0?(this.consumeToken(),i=a):this.consumeInternalError(e,a,n)}catch(a){i=this.consumeInternalRecovery(e,r,a)}return this.cstPostTerminal(n!==void 0&&n.LABEL!==void 0?n.LABEL:e.name,i),i}consumeInternalError(e,r,n){let i;const a=this.LA(0);throw n!==void 0&&n.ERR_MSG?i=n.ERR_MSG:i=this.errorMessageProvider.buildMismatchTokenMessage({expected:e,actual:r,previous:a,ruleName:this.getCurrRuleFullName()}),this.SAVE_ERROR(new ige(i,r,a))}consumeInternalRecovery(e,r,n){if(this.recoveryEnabled&&n.name==="MismatchedTokenException"&&!this.isBackTracking()){const i=this.getFollowsForInRuleRecovery(e,r);try{return this.tryInRuleRecovery(e,i)}catch(a){throw a.name===age?n:a}}else throw n}saveRecogState(){const e=this.errors,r=Ga(this.RULE_STACK);return{errors:e,lexerState:this.exportLexerState(),RULE_STACK:r,CST_STACK:this.CST_STACK}}reloadRecogState(e){this.errors=e.errors,this.importLexerState(e.lexerState),this.RULE_STACK=e.RULE_STACK}ruleInvocationStateUpdate(e,r,n){this.RULE_OCCURRENCE_STACK.push(n),this.RULE_STACK.push(e),this.cstInvocationStateUpdate(r)}isBackTracking(){return this.isBackTrackingStack.length!==0}getCurrRuleFullName(){const e=this.getLastExplicitRuleShortName();return this.shortRuleNameToFull[e]}shortRuleNameToFullName(e){return this.shortRuleNameToFull[e]}isAtEndOfInput(){return this.tokenMatcher(this.LA(1),Ed)}reset(){this.resetLexerState(),this.subruleIdx=0,this.isBackTrackingStack=[],this.errors=[],this.RULE_STACK=[],this.CST_STACK=[],this.RULE_OCCURRENCE_STACK=[]}},E(lv,"RecognizerEngine"),lv),Nlt=(cv=class{initErrorHandler(e){this._errors=[],this.errorMessageProvider=Er(e,"errorMessageProvider")?e.errorMessageProvider:eh.errorMessageProvider}SAVE_ERROR(e){if(EC(e))return e.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:Ga(this.RULE_OCCURRENCE_STACK)},this._errors.push(e),e;throw Error("Trying to save an Error which is not a RecognitionException")}get errors(){return Ga(this._errors)}set errors(e){this._errors=e}raiseEarlyExitException(e,r,n){const i=this.getCurrRuleFullName(),a=this.getGAstProductions()[i],o=CC(e,a,r,this.maxLookahead)[0],l=[];for(let h=1;h<=this.maxLookahead;h++)l.push(this.LA(h));const u=this.errorMessageProvider.buildEarlyExitMessage({expectedIterationPaths:o,actual:l,previous:this.LA(0),customUserDescription:n,ruleName:i});throw this.SAVE_ERROR(new Clt(u,this.LA(1),this.LA(0)))}raiseNoAltException(e,r){const n=this.getCurrRuleFullName(),i=this.getGAstProductions()[n],a=wC(e,i,this.maxLookahead),s=[];for(let u=1;u<=this.maxLookahead;u++)s.push(this.LA(u));const o=this.LA(0),l=this.errorMessageProvider.buildNoViableAltMessage({expectedPathsPerAlt:a,actual:s,previous:o,customUserDescription:r,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new Tlt(l,this.LA(1),o))}},E(cv,"ErrorHandler"),cv),$lt=(uv=class{initContentAssist(){}computeContentAssist(e,r){const n=this.gastProductionsCache[e];if(Qu(n))throw Error(`Rule ->${e}<- does not exist in this grammar.`);return jP([n],r,this.tokenMatcher,this.maxLookahead)}getNextPossibleTokenTypes(e){const r=Nl(e.ruleStack),i=this.getGAstProductions()[r];return new glt(i,e).startWalking()}},E(uv,"ContentAssist"),uv),Z_={description:"This Object indicates the Parser is during Recording Phase"};Object.freeze(Z_);var yge=!0,vge=Math.pow(2,Sd)-1,bge=a1({name:"RECORDING_PHASE_TOKEN",pattern:$s.NA});i1([bge]);var xge=TC(bge,`This IToken indicates the Parser is in Recording Phase + See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,-1,-1,-1,-1,-1,-1);Object.freeze(xge);var Olt={name:`This CSTNode indicates the Parser is in Recording Phase + See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,children:{}},Plt=(hv=class{initGastRecorder(e){this.recordingProdStack=[],this.RECORDING_PHASE=!1}enableRecording(){this.RECORDING_PHASE=!0,this.TRACE_INIT("Enable Recording",()=>{for(let e=0;e<10;e++){const r=e>0?e:"";this[`CONSUME${r}`]=function(n,i){return this.consumeInternalRecord(n,e,i)},this[`SUBRULE${r}`]=function(n,i){return this.subruleInternalRecord(n,e,i)},this[`OPTION${r}`]=function(n){return this.optionInternalRecord(n,e)},this[`OR${r}`]=function(n){return this.orInternalRecord(n,e)},this[`MANY${r}`]=function(n){this.manyInternalRecord(e,n)},this[`MANY_SEP${r}`]=function(n){this.manySepFirstInternalRecord(e,n)},this[`AT_LEAST_ONE${r}`]=function(n){this.atLeastOneInternalRecord(e,n)},this[`AT_LEAST_ONE_SEP${r}`]=function(n){this.atLeastOneSepFirstInternalRecord(e,n)}}this.consume=function(e,r,n){return this.consumeInternalRecord(r,e,n)},this.subrule=function(e,r,n){return this.subruleInternalRecord(r,e,n)},this.option=function(e,r){return this.optionInternalRecord(r,e)},this.or=function(e,r){return this.orInternalRecord(r,e)},this.many=function(e,r){this.manyInternalRecord(e,r)},this.atLeastOne=function(e,r){this.atLeastOneInternalRecord(e,r)},this.ACTION=this.ACTION_RECORD,this.BACKTRACK=this.BACKTRACK_RECORD,this.LA=this.LA_RECORD})}disableRecording(){this.RECORDING_PHASE=!1,this.TRACE_INIT("Deleting Recording methods",()=>{const e=this;for(let r=0;r<10;r++){const n=r>0?r:"";delete e[`CONSUME${n}`],delete e[`SUBRULE${n}`],delete e[`OPTION${n}`],delete e[`OR${n}`],delete e[`MANY${n}`],delete e[`MANY_SEP${n}`],delete e[`AT_LEAST_ONE${n}`],delete e[`AT_LEAST_ONE_SEP${n}`]}delete e.consume,delete e.subrule,delete e.option,delete e.or,delete e.many,delete e.atLeastOne,delete e.ACTION,delete e.BACKTRACK,delete e.LA})}ACTION_RECORD(e){}BACKTRACK_RECORD(e,r){return()=>!0}LA_RECORD(e){return Q_}topLevelRuleRecord(e,r){try{const n=new e1({definition:[],name:e});return n.name=e,this.recordingProdStack.push(n),r.call(this),this.recordingProdStack.pop(),n}catch(n){if(n.KNOWN_RECORDER_ERROR!==!0)try{n.message=n.message+` This error was thrown during the "grammar recording phase" For more info see: - https://chevrotain.io/docs/guide/internals.html#grammar-recording`}catch{throw n}throw n}}optionInternalRecord(e,r){return _g.call(this,va,e,r)}atLeastOneInternalRecord(e,r){_g.call(this,Qs,r,e)}atLeastOneSepFirstInternalRecord(e,r){_g.call(this,Js,r,e,ece)}manyInternalRecord(e,r){_g.call(this,ai,r,e)}manySepFirstInternalRecord(e,r){_g.call(this,_s,r,e,ece)}orInternalRecord(e,r){return ice.call(this,e,r)}subruleInternalRecord(e,r,n){if(bT(r),!e||br(e,"ruleName")===!1){const o=new Error(` argument is invalid expecting a Parser method reference but got: <${JSON.stringify(e)}> - inside top level rule: <${this.recordingProdStack[0].name}>`);throw o.KNOWN_RECORDER_ERROR=!0,o}const i=kf(this.recordingProdStack),a=e.ruleName,s=new is({idx:r,nonTerminalName:a,label:n==null?void 0:n.LABEL,referencedRule:void 0});return i.definition.push(s),this.outputCst?XQe:Qk}consumeInternalRecord(e,r,n){if(bT(r),!gM(e)){const s=new Error(` argument is invalid expecting a TokenType reference but got: <${JSON.stringify(e)}> - inside top level rule: <${this.recordingProdStack[0].name}>`);throw s.KNOWN_RECORDER_ERROR=!0,s}const i=kf(this.recordingProdStack),a=new Pn({idx:r,terminalType:e,label:n==null?void 0:n.LABEL});return i.definition.push(a),nce}},E(D1,"GastRecorder"),D1);function _g(t,e,r,n=!1){bT(r);const i=kf(this.recordingProdStack),a=Zc(e)?e:e.DEF,s=new t({definition:[],idx:r});return n&&(s.separator=e.SEP),br(e,"MAX_LOOKAHEAD")&&(s.maxLookahead=e.MAX_LOOKAHEAD),this.recordingProdStack.push(s),a.call(this),i.definition.push(s),this.recordingProdStack.pop(),Qk}E(_g,"recordProd");function ice(t,e){bT(e);const r=kf(this.recordingProdStack),n=Zr(t)===!1,i=n===!1?t:t.DEF,a=new Rs({definition:[],idx:e,ignoreAmbiguities:n&&t.IGNORE_AMBIGUITIES===!0});br(t,"MAX_LOOKAHEAD")&&(a.maxLookahead=t.MAX_LOOKAHEAD);const s=soe(i,o=>Zc(o.GATE));return a.hasPredicates=s,r.definition.push(a),kr(i,o=>{const l=new As({definition:[]});a.definition.push(l),br(o,"IGNORE_AMBIGUITIES")?l.ignoreAmbiguities=o.IGNORE_AMBIGUITIES:br(o,"GATE")&&(l.ignoreAmbiguities=!0),this.recordingProdStack.push(l),o.ALT.call(this),this.recordingProdStack.pop()}),Qk}E(ice,"recordOrProd");function PM(t){return t===0?"":`${t}`}E(PM,"getIdxSuffix");function bT(t){if(t<0||t>tce){const e=new Error(`Invalid DSL Method idx value: <${t}> - Idx value must be a none negative value smaller than ${tce+1}`);throw e.KNOWN_RECORDER_ERROR=!0,e}}E(bT,"assertMethodIdxIsValid");var jQe=(M1=class{initPerformanceTracer(e){if(br(e,"traceInitPerf")){const r=e.traceInitPerf,n=typeof r=="number";this.traceInitMaxIdent=n?r:1/0,this.traceInitPerf=n?r>0:r}else this.traceInitMaxIdent=0,this.traceInitPerf=tu.traceInitPerf;this.traceInitIndent=-1}TRACE_INIT(e,r){if(this.traceInitPerf===!0){this.traceInitIndent++;const n=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent <${e}>`);const{time:i,value:a}=sM(r),s=i>10?console.warn:console.log;return this.traceInitIndent time: ${i}ms`),this.traceInitIndent--,a}else return r()}},E(M1,"PerformanceTracer"),M1);function ace(t,e){e.forEach(r=>{const n=r.prototype;Object.getOwnPropertyNames(n).forEach(i=>{if(i==="constructor")return;const a=Object.getOwnPropertyDescriptor(n,i);a&&(a.get||a.set)?Object.defineProperty(t.prototype,i,a):t.prototype[i]=r.prototype[i]})})}E(ace,"applyMixins");var Jk=pT(Ch,"",NaN,NaN,NaN,NaN,NaN,NaN);Object.freeze(Jk);var tu=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:Ag,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!1}),eE=Object.freeze({recoveryValueFunc:E(()=>{},"recoveryValueFunc"),resyncEnabled:!0}),ss;(function(t){t[t.INVALID_RULE_NAME=0]="INVALID_RULE_NAME",t[t.DUPLICATE_RULE_NAME=1]="DUPLICATE_RULE_NAME",t[t.INVALID_RULE_OVERRIDE=2]="INVALID_RULE_OVERRIDE",t[t.DUPLICATE_PRODUCTIONS=3]="DUPLICATE_PRODUCTIONS",t[t.UNRESOLVED_SUBRULE_REF=4]="UNRESOLVED_SUBRULE_REF",t[t.LEFT_RECURSION=5]="LEFT_RECURSION",t[t.NONE_LAST_EMPTY_ALT=6]="NONE_LAST_EMPTY_ALT",t[t.AMBIGUOUS_ALTS=7]="AMBIGUOUS_ALTS",t[t.CONFLICT_TOKENS_RULES_NAMESPACE=8]="CONFLICT_TOKENS_RULES_NAMESPACE",t[t.INVALID_TOKEN_NAME=9]="INVALID_TOKEN_NAME",t[t.NO_NON_EMPTY_LOOKAHEAD=10]="NO_NON_EMPTY_LOOKAHEAD",t[t.AMBIGUOUS_PREFIX_ALTS=11]="AMBIGUOUS_PREFIX_ALTS",t[t.TOO_MANY_ALTS=12]="TOO_MANY_ALTS",t[t.CUSTOM_LOOKAHEAD_VALIDATION=13]="CUSTOM_LOOKAHEAD_VALIDATION"})(ss||(ss={}));function BM(t=void 0){return function(){return t}}E(BM,"EMPTY_ALT");var FM=(l0=class{static performSelfAnalysis(e){throw Error("The **static** `performSelfAnalysis` method has been deprecated. \nUse the **instance** method with the same name instead.")}performSelfAnalysis(){this.TRACE_INIT("performSelfAnalysis",()=>{let e;this.selfAnalysisDone=!0;const r=this.className;this.TRACE_INIT("toFastProps",()=>{oM(this)}),this.TRACE_INIT("Grammar Recording",()=>{try{this.enableRecording(),kr(this.definedRulesNames,i=>{const s=this[i].originalGrammarAction;let o;this.TRACE_INIT(`${i} Rule`,()=>{o=this.topLevelRuleRecord(i,s)}),this.gastProductionsCache[i]=o})}finally{this.disableRecording()}});let n=[];if(this.TRACE_INIT("Grammar Resolving",()=>{n=Nle({rules:Vi(this.gastProductionsCache)}),this.definitionErrors=this.definitionErrors.concat(n)}),this.TRACE_INIT("Grammar Validations",()=>{if(An(n)&&this.skipValidations===!1){const i=Ole({rules:Vi(this.gastProductionsCache),tokenTypes:Vi(this.tokensMap),errMsgProvider:Af,grammarName:r}),a=Tle({lookaheadStrategy:this.lookaheadStrategy,rules:Vi(this.gastProductionsCache),tokenTypes:Vi(this.tokensMap),grammarName:r});this.definitionErrors=this.definitionErrors.concat(i,a)}}),An(this.definitionErrors)&&(this.recoveryEnabled&&this.TRACE_INIT("computeAllProdsFollows",()=>{const i=voe(Vi(this.gastProductionsCache));this.resyncFollows=i}),this.TRACE_INIT("ComputeLookaheadFunctions",()=>{var i,a;(a=(i=this.lookaheadStrategy).initialize)===null||a===void 0||a.call(i,{rules:Vi(this.gastProductionsCache)}),this.preComputeLookaheadFunctions(Vi(this.gastProductionsCache))})),!l0.DEFER_DEFINITION_ERRORS_HANDLING&&!An(this.definitionErrors))throw e=ur(this.definitionErrors,i=>i.message),new Error(`Parser Definition Errors detected: + https://chevrotain.io/docs/guide/internals.html#grammar-recording`}catch{throw n}throw n}}optionInternalRecord(e,r){return o1.call(this,Va,e,r)}atLeastOneInternalRecord(e,r){o1.call(this,No,r,e)}atLeastOneSepFirstInternalRecord(e,r){o1.call(this,$o,r,e,yge)}manyInternalRecord(e,r){o1.call(this,Si,r,e)}manySepFirstInternalRecord(e,r){o1.call(this,so,r,e,yge)}orInternalRecord(e,r){return Tge.call(this,e,r)}subruleInternalRecord(e,r,n){if(SC(r),!e||Er(e,"ruleName")===!1){const o=new Error(` argument is invalid expecting a Parser method reference but got: <${JSON.stringify(e)}> + inside top level rule: <${this.recordingProdStack[0].name}>`);throw o.KNOWN_RECORDER_ERROR=!0,o}const i=zp(this.recordingProdStack),a=e.ruleName,s=new Ns({idx:r,nonTerminalName:a,label:n==null?void 0:n.LABEL,referencedRule:void 0});return i.definition.push(s),this.outputCst?Olt:Z_}consumeInternalRecord(e,r,n){if(SC(r),!WP(e)){const s=new Error(` argument is invalid expecting a TokenType reference but got: <${JSON.stringify(e)}> + inside top level rule: <${this.recordingProdStack[0].name}>`);throw s.KNOWN_RECORDER_ERROR=!0,s}const i=zp(this.recordingProdStack),a=new ri({idx:r,terminalType:e,label:n==null?void 0:n.LABEL});return i.definition.push(a),xge}},E(hv,"GastRecorder"),hv);function o1(t,e,r,n=!1){SC(r);const i=zp(this.recordingProdStack),a=Ku(e)?e:e.DEF,s=new t({definition:[],idx:r});return n&&(s.separator=e.SEP),Er(e,"MAX_LOOKAHEAD")&&(s.maxLookahead=e.MAX_LOOKAHEAD),this.recordingProdStack.push(s),a.call(this),i.definition.push(s),this.recordingProdStack.pop(),Z_}E(o1,"recordProd");function Tge(t,e){SC(e);const r=zp(this.recordingProdStack),n=on(t)===!1,i=n===!1?t:t.DEF,a=new oo({definition:[],idx:e,ignoreAmbiguities:n&&t.IGNORE_AMBIGUITIES===!0});Er(t,"MAX_LOOKAHEAD")&&(a.maxLookahead=t.MAX_LOOKAHEAD);const s=Cpe(i,o=>Ku(o.GATE));return a.hasPredicates=s,r.definition.push(a),Ir(i,o=>{const l=new ao({definition:[]});a.definition.push(l),Er(o,"IGNORE_AMBIGUITIES")?l.ignoreAmbiguities=o.IGNORE_AMBIGUITIES:Er(o,"GATE")&&(l.ignoreAmbiguities=!0),this.recordingProdStack.push(l),o.ALT.call(this),this.recordingProdStack.pop()}),Z_}E(Tge,"recordOrProd");function dB(t){return t===0?"":`${t}`}E(dB,"getIdxSuffix");function SC(t){if(t<0||t>vge){const e=new Error(`Invalid DSL Method idx value: <${t}> + Idx value must be a none negative value smaller than ${vge+1}`);throw e.KNOWN_RECORDER_ERROR=!0,e}}E(SC,"assertMethodIdxIsValid");var Blt=(dv=class{initPerformanceTracer(e){if(Er(e,"traceInitPerf")){const r=e.traceInitPerf,n=typeof r=="number";this.traceInitMaxIdent=n?r:1/0,this.traceInitPerf=n?r>0:r}else this.traceInitMaxIdent=0,this.traceInitPerf=eh.traceInitPerf;this.traceInitIndent=-1}TRACE_INIT(e,r){if(this.traceInitPerf===!0){this.traceInitIndent++;const n=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent <${e}>`);const{time:i,value:a}=$P(r),s=i>10?console.warn:console.log;return this.traceInitIndent time: ${i}ms`),this.traceInitIndent--,a}else return r()}},E(dv,"PerformanceTracer"),dv);function wge(t,e){e.forEach(r=>{const n=r.prototype;Object.getOwnPropertyNames(n).forEach(i=>{if(i==="constructor")return;const a=Object.getOwnPropertyDescriptor(n,i);a&&(a.get||a.set)?Object.defineProperty(t.prototype,i,a):t.prototype[i]=r.prototype[i]})})}E(wge,"applyMixins");var Q_=TC(Ed,"",NaN,NaN,NaN,NaN,NaN,NaN);Object.freeze(Q_);var eh=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:s1,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!1}),J_=Object.freeze({recoveryValueFunc:E(()=>{},"recoveryValueFunc"),resyncEnabled:!0}),Os;(function(t){t[t.INVALID_RULE_NAME=0]="INVALID_RULE_NAME",t[t.DUPLICATE_RULE_NAME=1]="DUPLICATE_RULE_NAME",t[t.INVALID_RULE_OVERRIDE=2]="INVALID_RULE_OVERRIDE",t[t.DUPLICATE_PRODUCTIONS=3]="DUPLICATE_PRODUCTIONS",t[t.UNRESOLVED_SUBRULE_REF=4]="UNRESOLVED_SUBRULE_REF",t[t.LEFT_RECURSION=5]="LEFT_RECURSION",t[t.NONE_LAST_EMPTY_ALT=6]="NONE_LAST_EMPTY_ALT",t[t.AMBIGUOUS_ALTS=7]="AMBIGUOUS_ALTS",t[t.CONFLICT_TOKENS_RULES_NAMESPACE=8]="CONFLICT_TOKENS_RULES_NAMESPACE",t[t.INVALID_TOKEN_NAME=9]="INVALID_TOKEN_NAME",t[t.NO_NON_EMPTY_LOOKAHEAD=10]="NO_NON_EMPTY_LOOKAHEAD",t[t.AMBIGUOUS_PREFIX_ALTS=11]="AMBIGUOUS_PREFIX_ALTS",t[t.TOO_MANY_ALTS=12]="TOO_MANY_ALTS",t[t.CUSTOM_LOOKAHEAD_VALIDATION=13]="CUSTOM_LOOKAHEAD_VALIDATION"})(Os||(Os={}));function fB(t=void 0){return function(){return t}}E(fB,"EMPTY_ALT");var pB=(k0=class{static performSelfAnalysis(e){throw Error("The **static** `performSelfAnalysis` method has been deprecated. \nUse the **instance** method with the same name instead.")}performSelfAnalysis(){this.TRACE_INIT("performSelfAnalysis",()=>{let e;this.selfAnalysisDone=!0;const r=this.className;this.TRACE_INIT("toFastProps",()=>{OP(this)}),this.TRACE_INIT("Grammar Recording",()=>{try{this.enableRecording(),Ir(this.definedRulesNames,i=>{const s=this[i].originalGrammarAction;let o;this.TRACE_INIT(`${i} Rule`,()=>{o=this.topLevelRuleRecord(i,s)}),this.gastProductionsCache[i]=o})}finally{this.disableRecording()}});let n=[];if(this.TRACE_INIT("Grammar Resolving",()=>{n=Z0e({rules:da(this.gastProductionsCache)}),this.definitionErrors=this.definitionErrors.concat(n)}),this.TRACE_INIT("Grammar Validations",()=>{if(qn(n)&&this.skipValidations===!1){const i=Q0e({rules:da(this.gastProductionsCache),tokenTypes:da(this.tokensMap),errMsgProvider:Vp,grammarName:r}),a=B0e({lookaheadStrategy:this.lookaheadStrategy,rules:da(this.gastProductionsCache),tokenTypes:da(this.tokensMap),grammarName:r});this.definitionErrors=this.definitionErrors.concat(i,a)}}),qn(this.definitionErrors)&&(this.recoveryEnabled&&this.TRACE_INIT("computeAllProdsFollows",()=>{const i=$pe(da(this.gastProductionsCache));this.resyncFollows=i}),this.TRACE_INIT("ComputeLookaheadFunctions",()=>{var i,a;(a=(i=this.lookaheadStrategy).initialize)===null||a===void 0||a.call(i,{rules:da(this.gastProductionsCache)}),this.preComputeLookaheadFunctions(da(this.gastProductionsCache))})),!k0.DEFER_DEFINITION_ERRORS_HANDLING&&!qn(this.definitionErrors))throw e=mr(this.definitionErrors,i=>i.message),new Error(`Parser Definition Errors detected: ${e.join(` ------------------------------- -`)}`)})}constructor(e,r){this.definitionErrors=[],this.selfAnalysisDone=!1;const n=this;if(n.initErrorHandler(r),n.initLexerAdapter(),n.initLooksAhead(r),n.initRecognizerEngine(e,r),n.initRecoverable(r),n.initTreeBuilder(r),n.initContentAssist(),n.initGastRecorder(r),n.initPerformanceTracer(r),br(r,"ignoredIssues"))throw new Error(`The IParserConfig property has been deprecated. +`)}`)})}constructor(e,r){this.definitionErrors=[],this.selfAnalysisDone=!1;const n=this;if(n.initErrorHandler(r),n.initLexerAdapter(),n.initLooksAhead(r),n.initRecognizerEngine(e,r),n.initRecoverable(r),n.initTreeBuilder(r),n.initContentAssist(),n.initGastRecorder(r),n.initPerformanceTracer(r),Er(r,"ignoredIssues"))throw new Error(`The IParserConfig property has been deprecated. Please use the flag on the relevant DSL method instead. See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#IGNORING_AMBIGUITIES - For further details.`);this.skipValidations=br(r,"skipValidations")?r.skipValidations:tu.skipValidations}},E(l0,"Parser"),l0);FM.DEFER_DEFINITION_ERRORS_HANDLING=!1,ace(FM,[PQe,FQe,qQe,VQe,UQe,WQe,HQe,YQe,KQe,jQe]);var ZQe=(N1=class extends FM{constructor(e,r=tu){const n=ma(r);n.outputCst=!1,super(e,n)}},E(N1,"EmbeddedActionsParser"),N1);function sce(t,e){for(var r=-1,n=t==null?0:t.length,i=Array(n);++r-1}E(pce,"listCacheHas");var nJe=pce;function gce(t,e){var r=this.__data__,n=tE(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}E(gce,"listCacheSet");var iJe=gce;function _f(t){var e=-1,r=t==null?0:t.length;for(this.clear();++eo))return!1;var u=a.get(t),h=a.get(e);if(u&&h)return u==e&&h==t;var d=-1,f=!0,p=r&het?new Zce:void 0;for(a.set(t,e),a.set(e,t);++d-1&&t%1==0&&t-1&&t%1==0&&t<=Yet}E(Sue,"isLength");var WM=Sue,Xet="[object Arguments]",Ket="[object Array]",jet="[object Boolean]",Zet="[object Date]",Qet="[object Error]",Jet="[object Function]",ett="[object Map]",ttt="[object Number]",rtt="[object Object]",ntt="[object RegExp]",itt="[object Set]",att="[object String]",stt="[object WeakMap]",ott="[object ArrayBuffer]",ltt="[object DataView]",ctt="[object Float32Array]",utt="[object Float64Array]",htt="[object Int8Array]",dtt="[object Int16Array]",ftt="[object Int32Array]",ptt="[object Uint8Array]",gtt="[object Uint8ClampedArray]",mtt="[object Uint16Array]",ytt="[object Uint32Array]",Bn={};Bn[ctt]=Bn[utt]=Bn[htt]=Bn[dtt]=Bn[ftt]=Bn[ptt]=Bn[gtt]=Bn[mtt]=Bn[ytt]=!0,Bn[Xet]=Bn[Ket]=Bn[ott]=Bn[jet]=Bn[ltt]=Bn[Zet]=Bn[Qet]=Bn[Jet]=Bn[ett]=Bn[ttt]=Bn[rtt]=Bn[ntt]=Bn[itt]=Bn[att]=Bn[stt]=!1;function Aue(t){return Ig(t)&&WM(t.length)&&!!Bn[Rg(t)]}E(Aue,"baseIsTypedArray");var vtt=Aue;function _ue(t){return function(e){return t(e)}}E(_ue,"baseUnary");var btt=_ue,Rue=typeof exports=="object"&&exports&&!exports.nodeType&&exports,kT=Rue&&typeof module=="object"&&module&&!module.nodeType&&module,xtt=kT&&kT.exports===Rue,UM=xtt&&xce.process,Ttt=(function(){try{var t=kT&&kT.require&&kT.require("util").types;return t||UM&&UM.binding&&UM.binding("util")}catch{}})(),Lue=Ttt,Iue=Lue&&Lue.isTypedArray,wtt=Iue?btt(Iue):vtt,HM=wtt,Ctt=Object.prototype,ktt=Ctt.hasOwnProperty;function Due(t,e){var r=os(t),n=!r&&sE(t),i=!r&&!n&&oE(t),a=!r&&!n&&!i&&HM(t),s=r||n||i||a,o=s?$et(t.length,String):[],l=o.length;for(var u in t)(e||ktt.call(t,u))&&!(s&&(u=="length"||i&&(u=="offset"||u=="parent")||a&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||Eue(u,l)))&&o.push(u);return o}E(Due,"arrayLikeKeys");var Ett=Due,Stt=Object.prototype;function Mue(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||Stt;return t===r}E(Mue,"isPrototype");var Nue=Mue;function Oue(t,e){return function(r){return t(e(r))}}E(Oue,"overArg");var Att=Oue,_tt=Att(Object.keys,Object),Rtt=_tt,Ltt=Object.prototype,Itt=Ltt.hasOwnProperty;function $ue(t){if(!Nue(t))return Rtt(t);var e=[];for(var r in Object(t))Itt.call(t,r)&&r!="constructor"&&e.push(r);return e}E($ue,"baseKeys");var Pue=$ue;function Bue(t){return t!=null&&WM(t.length)&&!_ce(t)}E(Bue,"isArrayLike");var lE=Bue;function Fue(t){return lE(t)?Ett(t):Pue(t)}E(Fue,"keys");var YM=Fue;function zue(t){return Let(t,YM,Oet)}E(zue,"getAllKeys");var Gue=zue,Dtt=1,Mtt=Object.prototype,Ntt=Mtt.hasOwnProperty;function que(t,e,r,n,i,a){var s=r&Dtt,o=Gue(t),l=o.length,u=Gue(e),h=u.length;if(l!=h&&!s)return!1;for(var d=l;d--;){var f=o[d];if(!(s?f in e:Ntt.call(e,f)))return!1}var p=a.get(t),g=a.get(e);if(p&&g)return p==e&&g==t;var m=!0;a.set(t,e),a.set(e,t);for(var y=s;++daN(t,e,s));return Of(t,e,n,r,...i)}E(Whe,"alternation");function Uhe(t,e,r){const n=Wi(t,e,r,{type:Eh});iu(t,n);const i=Of(t,e,n,r,Sh(t,e,r));return Hhe(t,e,r,i)}E(Uhe,"option");function Sh(t,e,r){const n=Irt(nu(r.definition,i=>aN(t,e,i)),i=>i!==void 0);return n.length===1?n[0]:n.length===0?void 0:Xhe(t,n)}E(Sh,"block");function sN(t,e,r,n,i){const a=n.left,s=n.right,o=Wi(t,e,r,{type:$rt});iu(t,o);const l=Wi(t,e,r,{type:$he});return a.loopback=o,l.loopback=o,t.decisionMap[Nf(e,i?"RepetitionMandatoryWithSeparator":"RepetitionMandatory",r.idx)]=o,pi(s,o),i===void 0?(pi(o,a),pi(o,l)):(pi(o,l),pi(o,i.left),pi(i.right,a)),{left:a,right:l}}E(sN,"plus");function oN(t,e,r,n,i){const a=n.left,s=n.right,o=Wi(t,e,r,{type:Ort});iu(t,o);const l=Wi(t,e,r,{type:$he}),u=Wi(t,e,r,{type:Nrt});return o.loopback=u,l.loopback=u,pi(o,a),pi(o,l),pi(s,u),i!==void 0?(pi(u,l),pi(u,i.left),pi(i.right,a)):pi(u,o),t.decisionMap[Nf(e,i?"RepetitionWithSeparator":"Repetition",r.idx)]=o,{left:o,right:l}}E(oN,"star");function Hhe(t,e,r,n){const i=n.left,a=n.right;return pi(i,a),t.decisionMap[Nf(e,"Option",r.idx)]=i,n}E(Hhe,"optional");function iu(t,e){return t.decisionStates.push(e),e.decision=t.decisionStates.length-1,e.decision}E(iu,"defineDecisionState");function Of(t,e,r,n,...i){const a=Wi(t,e,n,{type:Mrt,start:r});r.end=a;for(const o of i)o!==void 0?(pi(r,o.left),pi(o.right,a)):pi(r,a);const s={left:r,right:a};return t.decisionMap[Nf(e,Yhe(n),n.idx)]=r,s}E(Of,"makeAlts");function Yhe(t){if(t instanceof Rs)return"Alternation";if(t instanceof va)return"Option";if(t instanceof ai)return"Repetition";if(t instanceof _s)return"RepetitionWithSeparator";if(t instanceof Qs)return"RepetitionMandatory";if(t instanceof Js)return"RepetitionMandatoryWithSeparator";throw new Error("Invalid production type encountered")}E(Yhe,"getProdType");function Xhe(t,e){const r=e.length;for(let a=0;ae.alt)}get key(){let e="";for(const r in this.map)e+=r+":";return e}},E(F1,"ATNConfigSet"),F1);function cN(t,e=!0){return`${e?`a${t.alt}`:""}s${t.state.stateNumber}:${t.stack.map(r=>r.stateNumber.toString()).join("_")}`}E(cN,"getATNConfigKey");function Qhe(t,e,r){for(var n=-1,i=t.length;++n0&&r(o)?e>1?uN(o,e-1,r,n,i):cue(i,o):n||(i[i.length]=o)}return i}E(uN,"baseFlatten");var nde=uN;function ide(t,e){return nde(nu(t,e),1)}E(ide,"flatMap");var Grt=ide;function ade(t,e,r,n){for(var i=t.length,a=r+(n?1:-1);n?a--:++a-1}E(cde,"arrayIncludes");var Hrt=cde;function ude(t,e,r){for(var n=-1,i=t==null?0:t.length;++n=Qrt){var u=e?null:Zrt(t);if(u)return qM(u);s=!1,i=eue,l=new Zce}else l=e?[]:o;e:for(;++n{const i=n.toString();let a=r[i];return a!==void 0||(a={atnStartState:t,decision:e,states:{}},r[i]=a),a}}E(Cde,"createDFACache");var kde=(z1=class{constructor(){this.predicates=[]}is(e){return e>=this.predicates.length||this.predicates[e]}set(e,r){this.predicates[e]=r}toString(){let e="";const r=this.predicates.length;for(let n=0;nconsole.log(n))}initialize(e){this.atn=Bhe(e.rules),this.dfas=Sde(this.atn)}validateAmbiguousAlternationAlternatives(){return[]}validateEmptyOrAlternatives(){return[]}buildLookaheadForAlternation(e){const{prodOccurrence:r,rule:n,hasPredicates:i,dynamicTokensEnabled:a}=e,s=this.dfas,o=this.logging,l=Nf(n,"Alternation",r),h=this.atn.decisionMap[l].decision,d=nu(TM({maxLookahead:1,occurrence:r,prodType:"Alternation",rule:n}),f=>nu(f,p=>p[0]));if(dN(d,!1)&&!a){const f=wde(d,(p,g,m)=>(hN(g,y=>{y&&(p[y.tokenTypeIdx]=m,hN(y.categoryMatches,v=>{p[v]=m}))}),p),{});return i?function(p){var g;const m=this.LA(1),y=f[m.tokenTypeIdx];if(p!==void 0&&y!==void 0){const v=(g=p[y])===null||g===void 0?void 0:g.GATE;if(v!==void 0&&v.call(this)===!1)return}return y}:function(){const p=this.LA(1);return f[p.tokenTypeIdx]}}else return i?function(f){const p=new kde,g=f===void 0?0:f.length;for(let y=0;ynu(f,p=>p[0]));if(dN(d)&&d[0][0]&&!a){const f=d[0],p=tnt(f);if(p.length===1&&lnt(p[0].categoryMatches)){const m=p[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===m}}else{const g=wde(p,(m,y)=>(y!==void 0&&(m[y.tokenTypeIdx]=!0,hN(y.categoryMatches,v=>{m[v]=!0})),m),{});return function(){const m=this.LA(1);return g[m.tokenTypeIdx]===!0}}}return function(){const f=vE.call(this,s,h,Ede,o);return typeof f=="object"?!1:f===0}}},E(G1,"LLStarLookaheadStrategy"),G1);function dN(t,e=!0){const r=new Set;for(const n of t){const i=new Set;for(const a of n){if(a===void 0){if(e)break;return!1}const s=[a.tokenTypeIdx].concat(a.categoryMatches);for(const o of s)if(r.has(o)){if(!i.has(o))return!1}else r.add(o),i.add(o)}}return!0}E(dN,"isLL1Sequence");function Sde(t){const e=t.decisionStates.length,r=Array(e);for(let n=0;nSf(i)).join(", "),r=t.production.idx===0?"":t.production.idx;let n=`Ambiguous Alternatives Detected: <${t.ambiguityIndices.join(", ")}> in <${Ide(t.production)}${r}> inside <${t.topLevelRule.name}> Rule, + For further details.`);this.skipValidations=Er(r,"skipValidations")?r.skipValidations:eh.skipValidations}},E(k0,"Parser"),k0);pB.DEFER_DEFINITION_ERRORS_HANDLING=!1,wge(pB,[Elt,_lt,Llt,Ilt,Mlt,Dlt,Nlt,$lt,Plt,Blt]);var Flt=(fv=class extends pB{constructor(e,r=eh){const n=Ga(r);n.outputCst=!1,super(e,n)}},E(fv,"EmbeddedActionsParser"),fv);function Cge(t,e){for(var r=-1,n=t==null?0:t.length,i=Array(n);++r-1}E(Ige,"listCacheHas");var Ult=Ige;function Dge(t,e){var r=this.__data__,n=e6(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}E(Dge,"listCacheSet");var Hlt=Dge;function Wp(t){var e=-1,r=t==null?0:t.length;for(this.clear();++eo))return!1;var u=a.get(t),h=a.get(e);if(u&&h)return u==e&&h==t;var d=-1,f=!0,p=r&Qct?new pme:void 0;for(a.set(t,e),a.set(e,t);++d-1&&t%1==0&&t-1&&t%1==0&&t<=Mut}E(Vme,"isLength");var bB=Vme,Nut="[object Arguments]",$ut="[object Array]",Out="[object Boolean]",Put="[object Date]",But="[object Error]",Fut="[object Function]",zut="[object Map]",Gut="[object Number]",qut="[object Object]",Vut="[object RegExp]",Wut="[object Set]",Uut="[object String]",Hut="[object WeakMap]",Yut="[object ArrayBuffer]",Xut="[object DataView]",jut="[object Float32Array]",Kut="[object Float64Array]",Zut="[object Int8Array]",Qut="[object Int16Array]",Jut="[object Int32Array]",eht="[object Uint8Array]",tht="[object Uint8ClampedArray]",rht="[object Uint16Array]",nht="[object Uint32Array]",ni={};ni[jut]=ni[Kut]=ni[Zut]=ni[Qut]=ni[Jut]=ni[eht]=ni[tht]=ni[rht]=ni[nht]=!0,ni[Nut]=ni[$ut]=ni[Yut]=ni[Out]=ni[Xut]=ni[Put]=ni[But]=ni[Fut]=ni[zut]=ni[Gut]=ni[qut]=ni[Vut]=ni[Wut]=ni[Uut]=ni[Hut]=!1;function Wme(t){return u1(t)&&bB(t.length)&&!!ni[l1(t)]}E(Wme,"baseIsTypedArray");var iht=Wme;function Ume(t){return function(e){return t(e)}}E(Ume,"baseUnary");var aht=Ume,Hme=typeof exports=="object"&&exports&&!exports.nodeType&&exports,IC=Hme&&typeof module=="object"&&module&&!module.nodeType&&module,sht=IC&&IC.exports===Hme,xB=sht&&Pge.process,oht=(function(){try{var t=IC&&IC.require&&IC.require("util").types;return t||xB&&xB.binding&&xB.binding("util")}catch{}})(),Yme=oht,Xme=Yme&&Yme.isTypedArray,lht=Xme?aht(Xme):iht,TB=lht,cht=Object.prototype,uht=cht.hasOwnProperty;function jme(t,e){var r=Ps(t),n=!r&&a6(t),i=!r&&!n&&s6(t),a=!r&&!n&&!i&&TB(t),s=r||n||i||a,o=s?wut(t.length,String):[],l=o.length;for(var u in t)(e||uht.call(t,u))&&!(s&&(u=="length"||i&&(u=="offset"||u=="parent")||a&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||qme(u,l)))&&o.push(u);return o}E(jme,"arrayLikeKeys");var hht=jme,dht=Object.prototype;function Kme(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||dht;return t===r}E(Kme,"isPrototype");var Zme=Kme;function Qme(t,e){return function(r){return t(e(r))}}E(Qme,"overArg");var fht=Qme,pht=fht(Object.keys,Object),ght=pht,mht=Object.prototype,yht=mht.hasOwnProperty;function Jme(t){if(!Zme(t))return ght(t);var e=[];for(var r in Object(t))yht.call(t,r)&&r!="constructor"&&e.push(r);return e}E(Jme,"baseKeys");var e1e=Jme;function t1e(t){return t!=null&&bB(t.length)&&!Uge(t)}E(t1e,"isArrayLike");var o6=t1e;function r1e(t){return o6(t)?hht(t):e1e(t)}E(r1e,"keys");var wB=r1e;function n1e(t){return mut(t,wB,Tut)}E(n1e,"getAllKeys");var i1e=n1e,vht=1,bht=Object.prototype,xht=bht.hasOwnProperty;function a1e(t,e,r,n,i,a){var s=r&vht,o=i1e(t),l=o.length,u=i1e(e),h=u.length;if(l!=h&&!s)return!1;for(var d=l;d--;){var f=o[d];if(!(s?f in e:xht.call(e,f)))return!1}var p=a.get(t),g=a.get(e);if(p&&g)return p==e&&g==t;var m=!0;a.set(t,e),a.set(e,t);for(var y=s;++dNB(t,e,s));return Zp(t,e,n,r,...i)}E(oye,"alternation");function lye(t,e,r){const n=fa(t,e,r,{type:_d});nh(t,n);const i=Zp(t,e,n,r,Ad(t,e,r));return cye(t,e,r,i)}E(lye,"option");function Ad(t,e,r){const n=ydt(rh(r.definition,i=>NB(t,e,i)),i=>i!==void 0);return n.length===1?n[0]:n.length===0?void 0:hye(t,n)}E(Ad,"block");function $B(t,e,r,n,i){const a=n.left,s=n.right,o=fa(t,e,r,{type:wdt});nh(t,o);const l=fa(t,e,r,{type:J1e});return a.loopback=o,l.loopback=o,t.decisionMap[Kp(e,i?"RepetitionMandatoryWithSeparator":"RepetitionMandatory",r.idx)]=o,Oi(s,o),i===void 0?(Oi(o,a),Oi(o,l)):(Oi(o,l),Oi(o,i.left),Oi(i.right,a)),{left:a,right:l}}E($B,"plus");function OB(t,e,r,n,i){const a=n.left,s=n.right,o=fa(t,e,r,{type:Tdt});nh(t,o);const l=fa(t,e,r,{type:J1e}),u=fa(t,e,r,{type:xdt});return o.loopback=u,l.loopback=u,Oi(o,a),Oi(o,l),Oi(s,u),i!==void 0?(Oi(u,l),Oi(u,i.left),Oi(i.right,a)):Oi(u,o),t.decisionMap[Kp(e,i?"RepetitionWithSeparator":"Repetition",r.idx)]=o,{left:o,right:l}}E(OB,"star");function cye(t,e,r,n){const i=n.left,a=n.right;return Oi(i,a),t.decisionMap[Kp(e,"Option",r.idx)]=i,n}E(cye,"optional");function nh(t,e){return t.decisionStates.push(e),e.decision=t.decisionStates.length-1,e.decision}E(nh,"defineDecisionState");function Zp(t,e,r,n,...i){const a=fa(t,e,n,{type:bdt,start:r});r.end=a;for(const o of i)o!==void 0?(Oi(r,o.left),Oi(o.right,a)):Oi(r,a);const s={left:r,right:a};return t.decisionMap[Kp(e,uye(n),n.idx)]=r,s}E(Zp,"makeAlts");function uye(t){if(t instanceof oo)return"Alternation";if(t instanceof Va)return"Option";if(t instanceof Si)return"Repetition";if(t instanceof so)return"RepetitionWithSeparator";if(t instanceof No)return"RepetitionMandatory";if(t instanceof $o)return"RepetitionMandatoryWithSeparator";throw new Error("Invalid production type encountered")}E(uye,"getProdType");function hye(t,e){const r=e.length;for(let a=0;ae.alt)}get key(){let e="";for(const r in this.map)e+=r+":";return e}},E(vv,"ATNConfigSet"),vv);function BB(t,e=!0){return`${e?`a${t.alt}`:""}s${t.state.stateNumber}:${t.stack.map(r=>r.stateNumber.toString()).join("_")}`}E(BB,"getATNConfigKey");function gye(t,e,r){for(var n=-1,i=t.length;++n0&&r(o)?e>1?FB(o,e-1,r,n,i):Sme(i,o):n||(i[i.length]=o)}return i}E(FB,"baseFlatten");var xye=FB;function Tye(t,e){return xye(rh(t,e),1)}E(Tye,"flatMap");var _dt=Tye;function wye(t,e,r,n){for(var i=t.length,a=r+(n?1:-1);n?a--:++a-1}E(Sye,"arrayIncludes");var Ddt=Sye;function _ye(t,e,r){for(var n=-1,i=t==null?0:t.length;++n=Bdt){var u=e?null:Pdt(t);if(u)return yB(u);s=!1,i=yme,l=new pme}else l=e?[]:o;e:for(;++n{const i=n.toString();let a=r[i];return a!==void 0||(a={atnStartState:t,decision:e,states:{}},r[i]=a),a}}E(zye,"createDFACache");var Gye=(bv=class{constructor(){this.predicates=[]}is(e){return e>=this.predicates.length||this.predicates[e]}set(e,r){this.predicates[e]=r}toString(){let e="";const r=this.predicates.length;for(let n=0;nconsole.log(n))}initialize(e){this.atn=tye(e.rules),this.dfas=Vye(this.atn)}validateAmbiguousAlternationAlternatives(){return[]}validateEmptyOrAlternatives(){return[]}buildLookaheadForAlternation(e){const{prodOccurrence:r,rule:n,hasPredicates:i,dynamicTokensEnabled:a}=e,s=this.dfas,o=this.logging,l=Kp(n,"Alternation",r),h=this.atn.decisionMap[l].decision,d=rh(KP({maxLookahead:1,occurrence:r,prodType:"Alternation",rule:n}),f=>rh(f,p=>p[0]));if(GB(d,!1)&&!a){const f=Fye(d,(p,g,m)=>(zB(g,y=>{y&&(p[y.tokenTypeIdx]=m,zB(y.categoryMatches,v=>{p[v]=m}))}),p),{});return i?function(p){var g;const m=this.LA(1),y=f[m.tokenTypeIdx];if(p!==void 0&&y!==void 0){const v=(g=p[y])===null||g===void 0?void 0:g.GATE;if(v!==void 0&&v.call(this)===!1)return}return y}:function(){const p=this.LA(1);return f[p.tokenTypeIdx]}}else return i?function(f){const p=new Gye,g=f===void 0?0:f.length;for(let y=0;yrh(f,p=>p[0]));if(GB(d)&&d[0][0]&&!a){const f=d[0],p=Gdt(f);if(p.length===1&&Xdt(p[0].categoryMatches)){const m=p[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===m}}else{const g=Fye(p,(m,y)=>(y!==void 0&&(m[y.tokenTypeIdx]=!0,zB(y.categoryMatches,v=>{m[v]=!0})),m),{});return function(){const m=this.LA(1);return g[m.tokenTypeIdx]===!0}}}return function(){const f=y6.call(this,s,h,qye,o);return typeof f=="object"?!1:f===0}}},E(xv,"LLStarLookaheadStrategy"),xv);function GB(t,e=!0){const r=new Set;for(const n of t){const i=new Set;for(const a of n){if(a===void 0){if(e)break;return!1}const s=[a.tokenTypeIdx].concat(a.categoryMatches);for(const o of s)if(r.has(o)){if(!i.has(o))return!1}else r.add(o),i.add(o)}}return!0}E(GB,"isLL1Sequence");function Vye(t){const e=t.decisionStates.length,r=Array(e);for(let n=0;nqp(i)).join(", "),r=t.production.idx===0?"":t.production.idx;let n=`Ambiguous Alternatives Detected: <${t.ambiguityIndices.join(", ")}> in <${Xye(t.production)}${r}> inside <${t.topLevelRule.name}> Rule, <${e}> may appears as a prefix path in all these alternatives. `;return n=n+`See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES -For Further details.`,n}E(Lde,"buildAmbiguityError");function Ide(t){if(t instanceof is)return"SUBRULE";if(t instanceof va)return"OPTION";if(t instanceof Rs)return"OR";if(t instanceof Qs)return"AT_LEAST_ONE";if(t instanceof Js)return"AT_LEAST_ONE_SEP";if(t instanceof _s)return"MANY_SEP";if(t instanceof ai)return"MANY";if(t instanceof Pn)return"CONSUME";throw Error("non exhaustive match")}E(Ide,"getProductionDslName");function Dde(t,e,r){const n=Grt(e.configs.elements,a=>a.state.transitions),i=ent(n.filter(a=>a instanceof nN).map(a=>a.tokenType),a=>a.tokenTypeIdx);return{actualToken:r,possibleTokenTypes:i,tokenPath:t}}E(Dde,"buildAdaptivePredictError");function Mde(t,e){return t.edges[e.tokenTypeIdx]}E(Mde,"getExistingTargetState");function Nde(t,e,r){const n=new lN,i=[];for(const s of t.elements){if(r.is(s.alt)===!1)continue;if(s.state.type===ET){i.push(s);continue}const o=s.state.transitions.length;for(let l=0;l0&&!Fde(a))for(const s of i)a.add(s);return a}E(Nde,"computeReachSet");function Ode(t,e){if(t instanceof nN&&bM(e,t.tokenType))return t.target}E(Ode,"getReachableTarget");function $de(t,e){let r;for(const n of t.elements)if(e.is(n.alt)===!0){if(r===void 0)r=n.alt;else if(r!==n.alt)return}return r}E($de,"getUniqueAlt");function fN(t){return{configs:t,edges:{},isAcceptState:!1,prediction:-1}}E(fN,"newDFAState");function pN(t,e,r,n){return n=gN(t,n),e.edges[r.tokenTypeIdx]=n,n}E(pN,"addDFAEdge");function gN(t,e){if(e===yE)return e;const r=e.configs.key,n=t.states[r];return n!==void 0?n:(e.configs.finalize(),t.states[r]=e,e)}E(gN,"addDFAState");function Pde(t){const e=new lN,r=t.transitions.length;for(let n=0;n0){const i=[...t.stack],s={state:i.pop(),alt:t.alt,stack:i};ST(s,e)}else e.add(t);return}r.epsilonOnlyTransitions||e.add(t);const n=r.transitions.length;for(let i=0;i1)return!0;return!1}E(Vde,"hasConflictingAltSet");function Wde(t){for(const e of Array.from(t.values()))if(Object.keys(e).length===1)return!0;return!1}E(Wde,"hasStateAssociatedWithOneAlt"),kx();var Ude=(q1=class{constructor(){this.nodeStack=[]}get current(){return this.nodeStack[this.nodeStack.length-1]??this.rootNode}buildRootNode(e){return this.rootNode=new yN(e),this.rootNode.root=this.rootNode,this.nodeStack=[this.rootNode],this.rootNode}buildCompositeNode(e){const r=new xE;return r.grammarSource=e,r.root=this.rootNode,this.current.content.push(r),this.nodeStack.push(r),r}buildLeafNode(e,r){const n=new bE(e.startOffset,e.image.length,Bx(e),e.tokenType,!r);return n.grammarSource=r,n.root=this.rootNode,this.current.content.push(n),n}removeNode(e){const r=e.container;if(r){const n=r.content.indexOf(e);n>=0&&r.content.splice(n,1)}}addHiddenNodes(e){const r=[];for(const a of e){const s=new bE(a.startOffset,a.image.length,Bx(a),a.tokenType,!0);s.root=this.rootNode,r.push(s)}let n=this.current,i=!1;if(n.content.length>0){n.content.push(...r);return}for(;n.container;){const a=n.container.content.indexOf(n);if(a>0){n.container.content.splice(a,0,...r),i=!0;break}n=n.container}i||this.rootNode.content.unshift(...r)}construct(e){const r=this.current;typeof e.$type=="string"&&!e.$infix&&(this.current.astNode=e),e.$cstNode=r;const n=this.nodeStack.pop();(n==null?void 0:n.content.length)===0&&this.removeNode(n)}},E(q1,"CstNodeBuilder"),q1),mN=(V1=class{get hidden(){return!1}get astNode(){var r,n;const e=typeof((r=this._astNode)==null?void 0:r.$type)=="string"?this._astNode:(n=this.container)==null?void 0:n.astNode;if(!e)throw new Error("This node has no associated AST element");return e}set astNode(e){this._astNode=e}get text(){return this.root.fullText.substring(this.offset,this.end)}},E(V1,"AbstractCstNode"),V1),bE=(W1=class extends mN{get offset(){return this._offset}get length(){return this._length}get end(){return this._offset+this._length}get hidden(){return this._hidden}get tokenType(){return this._tokenType}get range(){return this._range}constructor(e,r,n,i,a=!1){super(),this._hidden=a,this._offset=e,this._tokenType=i,this._length=r,this._range=n}},E(W1,"LeafCstNodeImpl"),W1),xE=(U1=class extends mN{constructor(){super(...arguments),this.content=new dnt(this)}get offset(){var e;return((e=this.firstNonHiddenNode)==null?void 0:e.offset)??0}get length(){return this.end-this.offset}get end(){var e;return((e=this.lastNonHiddenNode)==null?void 0:e.end)??0}get range(){const e=this.firstNonHiddenNode,r=this.lastNonHiddenNode;if(e&&r){if(this._rangeCache===void 0){const{range:n}=e,{range:i}=r;this._rangeCache={start:n.start,end:i.end.line=0;e--){const r=this.content[e];if(!r.hidden)return r}return this.content[this.content.length-1]}},E(U1,"CompositeCstNodeImpl"),U1),dnt=(c0=class extends Array{constructor(e){super(),this.parent=e,Object.setPrototypeOf(this,c0.prototype)}push(...e){return this.addParents(e),super.push(...e)}unshift(...e){return this.addParents(e),super.unshift(...e)}splice(e,r,...n){return this.addParents(n),super.splice(e,r,...n)}addParents(e){for(const r of e)r.container=this.parent}},E(c0,"CstNodeContainer"),c0),yN=(H1=class extends xE{get text(){return this._text.substring(this.offset,this.end)}get fullText(){return this._text}constructor(e){super(),this._text="",this._text=e??""}},E(H1,"RootCstNodeImpl"),H1),TE=Symbol("Datatype");function wE(t){return t.$type===TE}E(wE,"isDataTypeNode");var Hde="​",Yde=E(t=>t.endsWith(Hde)?t:t+Hde,"withRuleSuffix"),vN=(Y1=class{constructor(e){var i;this._unorderedGroups=new Map,this.allRules=new Map,this.lexer=e.parser.Lexer;const r=this.lexer.definition,n=e.LanguageMetaData.mode==="production";(i=e.shared.profilers.LangiumProfiler)!=null&&i.isActive("parsing")?this.wrapper=new pnt(r,{...e.parser.ParserConfig,skipValidations:n,errorMessageProvider:e.parser.ParserErrorMessageProvider},e.shared.profilers.LangiumProfiler.createTask("parsing",e.LanguageMetaData.languageId)):this.wrapper=new Zde(r,{...e.parser.ParserConfig,skipValidations:n,errorMessageProvider:e.parser.ParserErrorMessageProvider})}alternatives(e,r){this.wrapper.wrapOr(e,r)}optional(e,r){this.wrapper.wrapOption(e,r)}many(e,r){this.wrapper.wrapMany(e,r)}atLeastOne(e,r){this.wrapper.wrapAtLeastOne(e,r)}getRule(e){return this.allRules.get(e)}isRecording(){return this.wrapper.IS_RECORDING}get unorderedGroups(){return this._unorderedGroups}getRuleStack(){return this.wrapper.RULE_STACK}finalize(){this.wrapper.wrapSelfAnalysis()}},E(Y1,"AbstractLangiumParser"),Y1),Xde=(X1=class extends vN{get current(){return this.stack[this.stack.length-1]}constructor(e){super(e),this.nodeBuilder=new Ude,this.stack=[],this.assignmentMap=new Map,this.operatorPrecedence=new Map,this.linker=e.references.Linker,this.converter=e.parser.ValueConverter,this.astReflection=e.shared.AstReflection}rule(e,r){const n=this.computeRuleType(e);let i;og(e)&&(i=e.name,this.registerPrecedenceMap(e));const a=this.wrapper.DEFINE_RULE(Yde(e.name),this.startImplementation(n,i,r).bind(this));return this.allRules.set(e.name,a),rs(e)&&e.entry&&(this.mainRule=a),a}registerPrecedenceMap(e){const r=e.name,n=new Map;for(let i=0;i0&&(r=this.construct()),r===void 0)throw new Error("No result from parser");if(this.stack.length>0)throw new Error("Parser stack is not empty after parsing");return r}startImplementation(e,r,n){return i=>{const a=!this.isRecording()&&e!==void 0;if(a){const s={$type:e};this.stack.push(s),e===TE?s.value="":r!==void 0&&(s.$infixName=r)}return n(i),a?this.construct():void 0}}extractHiddenTokens(e){const r=this.lexerResult.hidden;if(!r.length)return[];const n=e.startOffset;for(let i=0;in)return r.splice(0,i);return r.splice(0,r.length)}consume(e,r,n){const i=this.wrapper.wrapConsume(e,r);if(!this.isRecording()&&this.isValidToken(i)){const a=this.extractHiddenTokens(i);this.nodeBuilder.addHiddenNodes(a);const s=this.nodeBuilder.buildLeafNode(i,n),{assignment:o,crossRef:l}=this.getAssignment(n),u=this.current;if(o){const h=Xc(n)?i.image:this.converter.convert(i.image,s);this.assign(o.operator,o.feature,h,s,l)}else if(wE(u)){let h=i.image;Xc(n)||(h=this.converter.convert(h,s).toString()),u.value+=h}}}isValidToken(e){return!e.isInsertedInRecovery&&!isNaN(e.startOffset)&&typeof e.endOffset=="number"&&!isNaN(e.endOffset)}subrule(e,r,n,i,a){let s;!this.isRecording()&&!n&&(s=this.nodeBuilder.buildCompositeNode(i));let o;try{o=this.wrapper.wrapSubrule(e,r,a)}finally{this.isRecording()||(o===void 0&&!n&&(o=this.construct()),o!==void 0&&s&&s.length>0&&this.performSubruleAssignment(o,i,s))}}performSubruleAssignment(e,r,n){const{assignment:i,crossRef:a}=this.getAssignment(r);if(i)this.assign(i.operator,i.feature,e,n,a);else if(!i){const s=this.current;if(wE(s))s.value+=e.toString();else if(typeof e=="object"&&e){const l=this.assignWithoutOverride(e,s);this.stack.pop(),this.stack.push(l)}}}action(e,r){if(!this.isRecording()){let n=this.current;if(r.feature&&r.operator){n=this.construct(),this.nodeBuilder.removeNode(n.$cstNode),this.nodeBuilder.buildCompositeNode(r).content.push(n.$cstNode);const a={$type:e};this.stack.push(a),this.assign(r.operator,r.feature,n,n.$cstNode)}else n.$type=e}}construct(){if(this.isRecording())return;const e=this.stack.pop();return this.nodeBuilder.construct(e),"$infixName"in e?this.constructInfix(e,this.operatorPrecedence.get(e.$infixName)):wE(e)?this.converter.convert(e.value,e.$cstNode):(N9(this.astReflection,e),e)}constructInfix(e,r){const n=e.parts;if(!Array.isArray(n)||n.length===0)return;const i=e.operators;if(!Array.isArray(i)||n.length<2)return n[0];let a=0,s=-1;for(let m=0;ms?(s=v.precedence,a=m):v.precedence===s&&(v.rightAssoc||(a=m))}const o=i.slice(0,a),l=i.slice(a+1),u=n.slice(0,a+1),h=n.slice(a+1),d={$infixName:e.$infixName,$type:e.$type,$cstNode:e.$cstNode,parts:u,operators:o},f={$infixName:e.$infixName,$type:e.$type,$cstNode:e.$cstNode,parts:h,operators:l},p=this.constructInfix(d,r),g=this.constructInfix(f,r);return{$type:e.$type,$cstNode:e.$cstNode,left:p,operator:i[a],right:g}}getAssignment(e){if(!this.assignmentMap.has(e)){const r=jd(e,Hc);this.assignmentMap.set(e,{assignment:r,crossRef:r&&Qd(r.terminal)?r.terminal.isMulti?"multi":"single":void 0})}return this.assignmentMap.get(e)}assign(e,r,n,i,a){const s=this.current;let o;switch(a==="single"&&typeof n=="string"?o=this.linker.buildReference(s,r,i,n):a==="multi"&&typeof n=="string"?o=this.linker.buildMultiReference(s,r,i,n):o=n,e){case"=":{s[r]=o;break}case"?=":{s[r]=!0;break}case"+=":Array.isArray(s[r])||(s[r]=[]),s[r].push(o)}}assignWithoutOverride(e,r){for(const[i,a]of Object.entries(r)){const s=e[i];s===void 0?e[i]=a:Array.isArray(s)&&Array.isArray(a)&&(a.push(...s),e[i]=a)}const n=e.$cstNode;return n&&(n.astNode=void 0,e.$cstNode=void 0),e}get definitionErrors(){return this.wrapper.definitionErrors}},E(X1,"LangiumParser"),X1),Kde=(K1=class{buildMismatchTokenMessage(e){return Ag.buildMismatchTokenMessage(e)}buildNotAllInputParsedMessage(e){return Ag.buildNotAllInputParsedMessage(e)}buildNoViableAltMessage(e){return Ag.buildNoViableAltMessage(e)}buildEarlyExitMessage(e){return Ag.buildEarlyExitMessage(e)}},E(K1,"AbstractParserErrorMessageProvider"),K1),bN=(j1=class extends Kde{buildMismatchTokenMessage({expected:e,actual:r}){return`Expecting ${e.LABEL?"`"+e.LABEL+"`":e.name.endsWith(":KW")?`keyword '${e.name.substring(0,e.name.length-3)}'`:`token of type '${e.name}'`} but found \`${r.image}\`.`}buildNotAllInputParsedMessage({firstRedundant:e}){return`Expecting end of file but found \`${e.image}\`.`}},E(j1,"LangiumParserErrorMessageProvider"),j1),jde=(Z1=class extends vN{constructor(){super(...arguments),this.tokens=[],this.elementStack=[],this.lastElementStack=[],this.nextTokenIndex=0,this.stackSize=0}action(){}construct(){}parse(e){this.resetState();const r=this.lexer.tokenize(e,{mode:"partial"});return this.tokens=r.tokens,this.wrapper.input=[...this.tokens],this.mainRule.call(this.wrapper,{}),this.unorderedGroups.clear(),{tokens:this.tokens,elementStack:[...this.lastElementStack],tokenIndex:this.nextTokenIndex}}rule(e,r){const n=this.wrapper.DEFINE_RULE(Yde(e.name),this.startImplementation(r).bind(this));return this.allRules.set(e.name,n),e.entry&&(this.mainRule=n),n}resetState(){this.elementStack=[],this.lastElementStack=[],this.nextTokenIndex=0,this.stackSize=0}startImplementation(e){return r=>{const n=this.keepStackSize();try{e(r)}finally{this.resetStackSize(n)}}}removeUnexpectedElements(){this.elementStack.splice(this.stackSize)}keepStackSize(){const e=this.elementStack.length;return this.stackSize=e,e}resetStackSize(e){this.removeUnexpectedElements(),this.stackSize=e}consume(e,r,n){this.wrapper.wrapConsume(e,r),this.isRecording()||(this.lastElementStack=[...this.elementStack,n],this.nextTokenIndex=this.currIdx+1)}subrule(e,r,n,i,a){this.before(i),this.wrapper.wrapSubrule(e,r,a),this.after(i)}before(e){this.isRecording()||this.elementStack.push(e)}after(e){if(!this.isRecording()){const r=this.elementStack.lastIndexOf(e);r>=0&&this.elementStack.splice(r)}}get currIdx(){return this.wrapper.currIdx}},E(Z1,"LangiumCompletionParser"),Z1),fnt={recoveryEnabled:!0,nodeLocationTracking:"full",skipValidations:!0,errorMessageProvider:new bN},Zde=(Q1=class extends ZQe{constructor(e,r){const n=r&&"maxLookahead"in r;super(e,{...fnt,lookaheadStrategy:n?new DM({maxLookahead:r.maxLookahead}):new hnt({logging:r.skipValidations?()=>{}:void 0}),...r})}get IS_RECORDING(){return this.RECORDING_PHASE}DEFINE_RULE(e,r,n){return this.RULE(e,r,n)}wrapSelfAnalysis(){this.performSelfAnalysis()}wrapConsume(e,r){return this.consume(e,r,void 0)}wrapSubrule(e,r,n){return this.subrule(e,r,{ARGS:[n]})}wrapOr(e,r){this.or(e,r)}wrapOption(e,r){this.option(e,r)}wrapMany(e,r){this.many(e,r)}wrapAtLeastOne(e,r){this.atLeastOne(e,r)}rule(e){return e.call(this,{})}},E(Q1,"ChevrotainWrapper"),Q1),pnt=(J1=class extends Zde{constructor(e,r,n){super(e,r),this.task=n}rule(e){this.task.start(),this.task.startSubTask(this.ruleName(e));try{return super.rule(e)}finally{this.task.stopSubTask(this.ruleName(e)),this.task.stop()}}ruleName(e){return e.ruleName}subrule(e,r,n){this.task.startSubTask(this.ruleName(r));try{return super.subrule(e,r,n)}finally{this.task.stopSubTask(this.ruleName(r))}}},E(J1,"ProfilerWrapper"),J1);function CE(t,e,r){return Qde({parser:e,tokens:r,ruleNames:new Map},t),e}E(CE,"createParser");function Qde(t,e){const r=ck(e,!1),n=pn(e.rules).filter(rs).filter(a=>r.has(a));for(const a of n){const s={...t,consume:1,optional:1,subrule:1,many:1,or:1};t.parser.rule(a,Ah(s,a.definition))}const i=pn(e.rules).filter(og).filter(a=>r.has(a));for(const a of i)t.parser.rule(a,Jde(t,a))}E(Qde,"buildRules");function Jde(t,e){const r=e.call.rule.ref;if(!r)throw new Error("Could not resolve reference to infix operator rule: "+e.call.rule.$refText);if(yo(r))throw new Error("Cannot use terminal rule in infix expression");const n=e.operators.precedences.flatMap(p=>p.operators),i={$type:"Group",elements:[]},a={$container:i,$type:"Assignment",feature:"parts",operator:"+=",terminal:e.call},s={$container:i,$type:"Group",elements:[],cardinality:"*"};i.elements.push(a,s);const l={$container:s,$type:"Assignment",feature:"operators",operator:"+=",terminal:{$type:"Alternatives",elements:n}},u={...a,$container:s};s.elements.push(l,u);const d=n.map(p=>t.tokens[p.value]).map((p,g)=>({ALT:E(()=>t.parser.consume(g,p,l),"ALT")}));let f;return p=>{f??(f=kE(t,r)),t.parser.subrule(0,f,!1,a,p),t.parser.many(0,{DEF:E(()=>{t.parser.alternatives(0,d),t.parser.subrule(1,f,!1,u,p)},"DEF")})}}E(Jde,"buildInfixRule");function Ah(t,e,r=!1){let n;if(Xc(e))n=sfe(t,e);else if(gh(e))n=efe(t,e);else if(Hc(e))n=Ah(t,e.terminal);else if(Qd(e))n=xN(t,e);else if(Kc(e))n=tfe(t,e);else if($3(e))n=nfe(t,e);else if(J3(e))n=ife(t,e);else if(ef(e))n=afe(t,e);else if(G9(e)){const i=t.consume++;n=E(()=>t.parser.consume(i,Ch,e),"method")}else throw new rk(e.$cstNode,`Unexpected element type: ${e.$type}`);return TN(t,r?void 0:AT(e),n,e.cardinality)}E(Ah,"buildElement");function efe(t,e){const r=pf(e);return()=>t.parser.action(r,e)}E(efe,"buildAction");function tfe(t,e){const r=e.rule.ref;if(Zd(r)){const n=t.subrule++,i=rs(r)&&r.fragment,a=e.arguments.length>0?rfe(r,e.arguments):()=>({});let s;return o=>{s??(s=kE(t,r)),t.parser.subrule(n,s,i,e,a(o))}}else if(yo(r)){const n=t.consume++,i=EE(t,r.name);return()=>t.parser.consume(n,i,e)}else if(r)xh();else throw new rk(e.$cstNode,`Undefined rule: ${e.rule.$refText}`)}E(tfe,"buildRuleCall");function rfe(t,e){if(e.some(n=>n.calledByName)){const n=e.map(i=>{var a,s;return{parameterName:(s=(a=i.parameter)==null?void 0:a.ref)==null?void 0:s.name,predicate:Zo(i.value)}});return i=>{const a={};for(const{parameterName:s,predicate:o}of n)s&&(a[s]=o(i));return a}}else{const n=e.map(i=>Zo(i.value));return i=>{const a={};for(let s=0;se(n)||r(n)}else if(F9(t)){const e=Zo(t.left),r=Zo(t.right);return n=>e(n)&&r(n)}else if(W9(t)){const e=Zo(t.value);return r=>!e(r)}else if(U9(t)){const e=t.parameter.ref.name;return r=>r!==void 0&&r[e]===!0}else if(P9(t)){const e=!!t.true;return()=>e}xh()}E(Zo,"buildPredicate");function nfe(t,e){if(e.elements.length===1)return Ah(t,e.elements[0]);{const r=[];for(const i of e.elements){const a={ALT:Ah(t,i,!0)},s=AT(i);s&&(a.GATE=Zo(s)),r.push(a)}const n=t.or++;return i=>t.parser.alternatives(n,r.map(a=>{const s={ALT:E(()=>a.ALT(i),"ALT")},o=a.GATE;return o&&(s.GATE=()=>o(i)),s}))}}E(nfe,"buildAlternatives");function ife(t,e){if(e.elements.length===1)return Ah(t,e.elements[0]);const r=[];for(const o of e.elements){const l={ALT:Ah(t,o,!0)},u=AT(o);u&&(l.GATE=Zo(u)),r.push(l)}const n=t.or++,i=E((o,l)=>{const u=l.getRuleStack().join("-");return`uGroup_${o}_${u}`},"idFunc"),a=E(o=>t.parser.alternatives(n,r.map((l,u)=>{const h={ALT:E(()=>!0,"ALT")},d=t.parser;h.ALT=()=>{if(l.ALT(o),!d.isRecording()){const p=i(n,d);d.unorderedGroups.get(p)||d.unorderedGroups.set(p,[]);const g=d.unorderedGroups.get(p);typeof(g==null?void 0:g[u])>"u"&&(g[u]=!0)}};const f=l.GATE;return f?h.GATE=()=>f(o):h.GATE=()=>{const p=d.unorderedGroups.get(i(n,d));return!(p!=null&&p[u])},h})),"alternatives"),s=TN(t,AT(e),a,"*");return o=>{s(o),t.parser.isRecording()||t.parser.unorderedGroups.delete(i(n,t.parser))}}E(ife,"buildUnorderedGroup");function afe(t,e){const r=e.elements.map(n=>Ah(t,n));return n=>r.forEach(i=>i(n))}E(afe,"buildGroup");function AT(t){if(ef(t))return t.guardCondition}E(AT,"getGuardCondition");function xN(t,e,r=e.terminal){if(r)if(Kc(r)&&rs(r.rule.ref)){const n=r.rule.ref,i=t.subrule++;let a;return s=>{a??(a=kE(t,n)),t.parser.subrule(i,a,!1,e,s)}}else if(Kc(r)&&yo(r.rule.ref)){const n=t.consume++,i=EE(t,r.rule.ref.name);return()=>t.parser.consume(n,i,e)}else if(Xc(r)){const n=t.consume++,i=EE(t,r.value);return()=>t.parser.consume(n,i,e)}else throw new Error("Could not build cross reference parser");else{if(!e.type.ref)throw new Error("Could not resolve reference to type: "+e.type.$refText);const n=fk(e.type.ref),i=n==null?void 0:n.terminal;if(!i)throw new Error("Could not find name assignment for type: "+pf(e.type.ref));return xN(t,e,i)}}E(xN,"buildCrossReference");function sfe(t,e){const r=t.consume++,n=t.tokens[e.value];if(!n)throw new Error("Could not find token for keyword: "+e.value);return()=>t.parser.consume(r,n,e)}E(sfe,"buildKeyword");function TN(t,e,r,n){const i=e&&Zo(e);if(!n)if(i){const a=t.or++;return s=>t.parser.alternatives(a,[{ALT:E(()=>r(s),"ALT"),GATE:E(()=>i(s),"GATE")},{ALT:BM(),GATE:E(()=>!i(s),"GATE")}])}else return r;if(n==="*"){const a=t.many++;return s=>t.parser.many(a,{DEF:E(()=>r(s),"DEF"),GATE:i?()=>i(s):void 0})}else if(n==="+"){const a=t.many++;if(i){const s=t.or++;return o=>t.parser.alternatives(s,[{ALT:E(()=>t.parser.atLeastOne(a,{DEF:E(()=>r(o),"DEF")}),"ALT"),GATE:E(()=>i(o),"GATE")},{ALT:BM(),GATE:E(()=>!i(o),"GATE")}])}else return s=>t.parser.atLeastOne(a,{DEF:E(()=>r(s),"DEF")})}else if(n==="?"){const a=t.optional++;return s=>t.parser.optional(a,{DEF:E(()=>r(s),"DEF"),GATE:i?()=>i(s):void 0})}else xh()}E(TN,"wrap");function kE(t,e){const r=ofe(t,e),n=t.parser.getRule(r);if(!n)throw new Error(`Rule "${r}" not found."`);return n}E(kE,"getRule");function ofe(t,e){if(Zd(e))return e.name;if(t.ruleNames.has(e))return t.ruleNames.get(e);{let r=e,n=r.$container,i=e.$type;for(;!rs(n);)(ef(n)||$3(n)||J3(n))&&(i=n.elements.indexOf(r).toString()+":"+i),r=n,n=n.$container;return i=n.name+":"+i,t.ruleNames.set(e,i),i}}E(ofe,"getRuleName");function EE(t,e){const r=t.tokens[e];if(!r)throw new Error(`Token "${e}" not found."`);return r}E(EE,"getToken");function wN(t){const e=t.Grammar,r=t.parser.Lexer,n=new jde(t);return CE(e,n,r.definition),n.finalize(),n}E(wN,"createCompletionParser");function CN(t){const e=kN(t);return e.finalize(),e}E(CN,"createLangiumParser");function kN(t){const e=t.Grammar,r=t.parser.Lexer,n=new Xde(t);return CE(e,n,r.definition)}E(kN,"prepareLangiumParser");var SE=(ey=class{constructor(){this.diagnostics=[]}buildTokens(e,r){const n=pn(ck(e,!1)),i=this.buildTerminalTokens(n),a=this.buildKeywordTokens(n,i,r);return a.push(...i),a}flushLexingReport(e){return{diagnostics:this.popDiagnostics()}}popDiagnostics(){const e=[...this.diagnostics];return this.diagnostics=[],e}buildTerminalTokens(e){return e.filter(yo).filter(r=>!r.fragment).map(r=>this.buildTerminalToken(r)).toArray()}buildTerminalToken(e){const r=Gx(e),n=this.requiresCustomPattern(r)?this.regexPatternFunction(r):r,i={name:e.name,PATTERN:n};return typeof n=="function"&&(i.LINE_BREAKS=!0),e.hidden&&(i.GROUP=lk(r)?as.SKIPPED:"hidden"),i}requiresCustomPattern(e){return!!(e.flags.includes("u")||e.flags.includes("s"))}regexPatternFunction(e){const r=new RegExp(e,e.flags+"y");return(n,i)=>(r.lastIndex=i,r.exec(n))}buildKeywordTokens(e,r,n){return e.filter(Zd).flatMap(i=>Uc(i).filter(Xc)).distinct(i=>i.value).toArray().sort((i,a)=>a.value.length-i.value.length).map(i=>this.buildKeywordToken(i,r,!!(n!=null&&n.caseInsensitive)))}buildKeywordToken(e,r,n){const i=this.buildKeywordPattern(e,n),a={name:e.value,PATTERN:i,LONGER_ALT:this.findLongerAlt(e,r)};return typeof i=="function"&&(a.LINE_BREAKS=!0),a}buildKeywordPattern(e,r){return r?new RegExp(yg(e.value),"i"):e.value}findLongerAlt(e,r){return r.reduce((n,i)=>{const a=i==null?void 0:i.PATTERN;return a!=null&&a.source&&gD("^"+a.source+"$",e.value)&&n.push(i),n},[])}},E(ey,"DefaultTokenBuilder"),ey),EN=(ty=class{convert(e,r){let n=r.grammarSource;if(Qd(n)&&(n=xD(n)),Kc(n)){const i=n.rule.ref;if(!i)throw new Error("This cst node was not parsed by a rule.");return this.runConverter(i,e,r)}return e}runConverter(e,r,n){var i;switch(e.name.toUpperCase()){case"INT":return Ql.convertInt(r);case"STRING":return Ql.convertString(r);case"ID":return Ql.convertID(r)}switch((i=RD(e))==null?void 0:i.toLowerCase()){case"number":return Ql.convertNumber(r);case"boolean":return Ql.convertBoolean(r);case"bigint":return Ql.convertBigint(r);case"date":return Ql.convertDate(r);default:return r}}},E(ty,"DefaultValueConverter"),ty),Ql;(function(t){function e(u){let h="";for(let d=1;d{typeof setImmediate>"u"?setTimeout(t,0):setImmediate(t)})}E(AE,"delayNextTick");var _E=0,lfe=10;function RE(){return _E=performance.now(),new _n.CancellationTokenSource}E(RE,"startCancelableOperation");function SN(t){lfe=t}E(SN,"setInterruptionPeriod");var Jl=Symbol("OperationCancelled");function $f(t){return t===Jl}E($f,"isOperationCancelled");async function ra(t){if(t===_n.CancellationToken.None)return;const e=performance.now();if(e-_E>=lfe&&(_E=e,await AE(),_E=performance.now()),t.isCancellationRequested)throw Jl}E(ra,"interruptAndCheck");var au=(ry=class{constructor(){this.promise=new Promise((e,r)=>{this.resolve=n=>(e(n),this),this.reject=n=>(r(n),this)})}},E(ry,"Deferred"),ry),cfe=(Ph=class{constructor(e,r,n,i){this._uri=e,this._languageId=r,this._version=n,this._content=i,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(e){if(e){const r=this.offsetAt(e.start),n=this.offsetAt(e.end);return this._content.substring(r,n)}return this._content}update(e,r){for(const n of e)if(Ph.isIncremental(n)){const i=RN(n.range),a=this.offsetAt(i.start),s=this.offsetAt(i.end);this._content=this._content.substring(0,a)+n.text+this._content.substring(s,this._content.length);const o=Math.max(i.start.line,0),l=Math.max(i.end.line,0);let u=this._lineOffsets;const h=AN(n.text,!1,a);if(l-o===h.length)for(let f=0,p=h.length;fe?i=s:n=s+1}const a=n-1;return e=this.ensureBeforeEOL(e,r[a]),{line:a,character:e-r[a]}}offsetAt(e){const r=this.getLineOffsets();if(e.line>=r.length)return this._content.length;if(e.line<0)return 0;const n=r[e.line];if(e.character<=0)return n;const i=e.line+1r&&_N(this._content.charCodeAt(e-1));)e--;return e}get lineCount(){return this.getLineOffsets().length}static isIncremental(e){const r=e;return r!=null&&typeof r.text=="string"&&r.range!==void 0&&(r.rangeLength===void 0||typeof r.rangeLength=="number")}static isFull(e){const r=e;return r!=null&&typeof r.text=="string"&&r.range===void 0&&r.rangeLength===void 0}},E(Ph,"FullTextDocument"),Ph),LE;(function(t){function e(i,a,s,o){return new cfe(i,a,s,o)}E(e,"create"),t.create=e;function r(i,a,s){if(i instanceof cfe)return i.update(a,s),i;throw new Error("TextDocument.update: document must be created by TextDocument.create")}E(r,"update"),t.update=r;function n(i,a){const s=i.getText(),o=IE(a.map(ufe),(h,d)=>{const f=h.range.start.line-d.range.start.line;return f===0?h.range.start.character-d.range.start.character:f});let l=0;const u=[];for(const h of o){const d=i.offsetAt(h.range.start);if(dl&&u.push(s.substring(l,d)),h.newText.length&&u.push(h.newText),l=i.offsetAt(h.range.end)}return u.push(s.substr(l)),u.join("")}E(n,"applyEdits"),t.applyEdits=n})(LE||(LE={}));function IE(t,e){if(t.length<=1)return t;const r=t.length/2|0,n=t.slice(0,r),i=t.slice(r);IE(n,e),IE(i,e);let a=0,s=0,o=0;for(;ar.line||e.line===r.line&&e.character>r.character?{start:r,end:e}:t}E(RN,"getWellformedRange");function ufe(t){const e=RN(t.range);return e!==t.range?{newText:t.newText,range:e}:t}E(ufe,"getWellformedEdit");var hfe;(()=>{var t={975:F=>{function S(D){if(typeof D!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(D))}E(S,"e");function R(D,I){for(var $,B="",P=0,G=-1,V=0,Y=0;Y<=D.length;++Y){if(Y2){var W=B.lastIndexOf("/");if(W!==B.length-1){W===-1?(B="",P=0):P=(B=B.slice(0,W)).length-1-B.lastIndexOf("/"),G=Y,V=0;continue}}else if(B.length===2||B.length===1){B="",P=0,G=Y,V=0;continue}}I&&(B.length>0?B+="/..":B="..",P=2)}else B.length>0?B+="/"+D.slice(G+1,Y):B=D.slice(G+1,Y),P=Y-G-1;G=Y,V=0}else $===46&&V!==-1?++V:V=-1}return B}E(R,"r");var N={resolve:E(function(){for(var D,I="",$=!1,B=arguments.length-1;B>=-1&&!$;B--){var P;B>=0?P=arguments[B]:(D===void 0&&(D=process.cwd()),P=D),S(P),P.length!==0&&(I=P+"/"+I,$=P.charCodeAt(0)===47)}return I=R(I,!$),$?I.length>0?"/"+I:"/":I.length>0?I:"."},"resolve"),normalize:E(function(D){if(S(D),D.length===0)return".";var I=D.charCodeAt(0)===47,$=D.charCodeAt(D.length-1)===47;return(D=R(D,!I)).length!==0||I||(D="."),D.length>0&&$&&(D+="/"),I?"/"+D:D},"normalize"),isAbsolute:E(function(D){return S(D),D.length>0&&D.charCodeAt(0)===47},"isAbsolute"),join:E(function(){if(arguments.length===0)return".";for(var D,I=0;I0&&(D===void 0?D=$:D+="/"+$)}return D===void 0?".":N.normalize(D)},"join"),relative:E(function(D,I){if(S(D),S(I),D===I||(D=N.resolve(D))===(I=N.resolve(I)))return"";for(var $=1;$Y){if(I.charCodeAt(G+ie)===47)return I.slice(G+ie+1);if(ie===0)return I.slice(G+ie)}else P>Y&&(D.charCodeAt($+ie)===47?W=ie:ie===0&&(W=0));break}var K=D.charCodeAt($+ie);if(K!==I.charCodeAt(G+ie))break;K===47&&(W=ie)}var se="";for(ie=$+W+1;ie<=B;++ie)ie!==B&&D.charCodeAt(ie)!==47||(se.length===0?se+="..":se+="/..");return se.length>0?se+I.slice(G+W):(G+=W,I.charCodeAt(G)===47&&++G,I.slice(G))},"relative"),_makeLong:E(function(D){return D},"_makeLong"),dirname:E(function(D){if(S(D),D.length===0)return".";for(var I=D.charCodeAt(0),$=I===47,B=-1,P=!0,G=D.length-1;G>=1;--G)if((I=D.charCodeAt(G))===47){if(!P){B=G;break}}else P=!1;return B===-1?$?"/":".":$&&B===1?"//":D.slice(0,B)},"dirname"),basename:E(function(D,I){if(I!==void 0&&typeof I!="string")throw new TypeError('"ext" argument must be a string');S(D);var $,B=0,P=-1,G=!0;if(I!==void 0&&I.length>0&&I.length<=D.length){if(I.length===D.length&&I===D)return"";var V=I.length-1,Y=-1;for($=D.length-1;$>=0;--$){var W=D.charCodeAt($);if(W===47){if(!G){B=$+1;break}}else Y===-1&&(G=!1,Y=$+1),V>=0&&(W===I.charCodeAt(V)?--V==-1&&(P=$):(V=-1,P=Y))}return B===P?P=Y:P===-1&&(P=D.length),D.slice(B,P)}for($=D.length-1;$>=0;--$)if(D.charCodeAt($)===47){if(!G){B=$+1;break}}else P===-1&&(G=!1,P=$+1);return P===-1?"":D.slice(B,P)},"basename"),extname:E(function(D){S(D);for(var I=-1,$=0,B=-1,P=!0,G=0,V=D.length-1;V>=0;--V){var Y=D.charCodeAt(V);if(Y!==47)B===-1&&(P=!1,B=V+1),Y===46?I===-1?I=V:G!==1&&(G=1):I!==-1&&(G=-1);else if(!P){$=V+1;break}}return I===-1||B===-1||G===0||G===1&&I===B-1&&I===$+1?"":D.slice(I,B)},"extname"),format:E(function(D){if(D===null||typeof D!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof D);return(function(I,$){var B=$.dir||$.root,P=$.base||($.name||"")+($.ext||"");return B?B===$.root?B+P:B+"/"+P:P})(0,D)},"format"),parse:E(function(D){S(D);var I={root:"",dir:"",base:"",ext:"",name:""};if(D.length===0)return I;var $,B=D.charCodeAt(0),P=B===47;P?(I.root="/",$=1):$=0;for(var G=-1,V=0,Y=-1,W=!0,ie=D.length-1,K=0;ie>=$;--ie)if((B=D.charCodeAt(ie))!==47)Y===-1&&(W=!1,Y=ie+1),B===46?G===-1?G=ie:K!==1&&(K=1):G!==-1&&(K=-1);else if(!W){V=ie+1;break}return G===-1||Y===-1||K===0||K===1&&G===Y-1&&G===V+1?Y!==-1&&(I.base=I.name=V===0&&P?D.slice(1,Y):D.slice(V,Y)):(V===0&&P?(I.name=D.slice(1,G),I.base=D.slice(1,Y)):(I.name=D.slice(V,G),I.base=D.slice(V,Y)),I.ext=D.slice(G,Y)),V>0?I.dir=D.slice(0,V-1):P&&(I.dir="/"),I},"parse"),sep:"/",delimiter:":",win32:null,posix:null};N.posix=N,F.exports=N}},e={};function r(F){var S=e[F];if(S!==void 0)return S.exports;var R=e[F]={exports:{}};return t[F](R,R.exports,r),R.exports}E(r,"r"),r.d=(F,S)=>{for(var R in S)r.o(S,R)&&!r.o(F,R)&&Object.defineProperty(F,R,{enumerable:!0,get:S[R]})},r.o=(F,S)=>Object.prototype.hasOwnProperty.call(F,S),r.r=F=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(F,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(F,"__esModule",{value:!0})};var n={};let i;r.r(n),r.d(n,{URI:E(()=>f,"URI"),Utils:E(()=>O,"Utils")}),typeof process=="object"?i=process.platform==="win32":typeof navigator=="object"&&(i=navigator.userAgent.indexOf("Windows")>=0);const a=/^\w[\w\d+.-]*$/,s=/^\//,o=/^\/\//;function l(F,S){if(!F.scheme&&S)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${F.authority}", path: "${F.path}", query: "${F.query}", fragment: "${F.fragment}"}`);if(F.scheme&&!a.test(F.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(F.path){if(F.authority){if(!s.test(F.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(o.test(F.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}E(l,"a");const u="",h="/",d=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/,M=class M{constructor(S,R,N,D,I,$=!1){Hr(this,"scheme");Hr(this,"authority");Hr(this,"path");Hr(this,"query");Hr(this,"fragment");typeof S=="object"?(this.scheme=S.scheme||u,this.authority=S.authority||u,this.path=S.path||u,this.query=S.query||u,this.fragment=S.fragment||u):(this.scheme=(function(B,P){return B||P?B:"file"})(S,$),this.authority=R||u,this.path=(function(B,P){switch(B){case"https":case"http":case"file":P?P[0]!==h&&(P=h+P):P=h}return P})(this.scheme,N||u),this.query=D||u,this.fragment=I||u,l(this,$))}static isUri(S){return S instanceof M||!!S&&typeof S.authority=="string"&&typeof S.fragment=="string"&&typeof S.path=="string"&&typeof S.query=="string"&&typeof S.scheme=="string"&&typeof S.fsPath=="string"&&typeof S.with=="function"&&typeof S.toString=="function"}get fsPath(){return T(this,!1)}with(S){if(!S)return this;let{scheme:R,authority:N,path:D,query:I,fragment:$}=S;return R===void 0?R=this.scheme:R===null&&(R=u),N===void 0?N=this.authority:N===null&&(N=u),D===void 0?D=this.path:D===null&&(D=u),I===void 0?I=this.query:I===null&&(I=u),$===void 0?$=this.fragment:$===null&&($=u),R===this.scheme&&N===this.authority&&D===this.path&&I===this.query&&$===this.fragment?this:new g(R,N,D,I,$)}static parse(S,R=!1){const N=d.exec(S);return N?new g(N[2]||u,A(N[4]||u),A(N[5]||u),A(N[7]||u),A(N[9]||u),R):new g(u,u,u,u,u)}static file(S){let R=u;if(i&&(S=S.replace(/\\/g,h)),S[0]===h&&S[1]===h){const N=S.indexOf(h,2);N===-1?(R=S.substring(2),S=h):(R=S.substring(2,N),S=S.substring(N)||h)}return new g("file",R,S,u,u)}static from(S){const R=new g(S.scheme,S.authority,S.path,S.query,S.fragment);return l(R,!0),R}toString(S=!1){return b(this,S)}toJSON(){return this}static revive(S){if(S){if(S instanceof M)return S;{const R=new g(S);return R._formatted=S.external,R._fsPath=S._sep===p?S.fsPath:null,R}}return S}};E(M,"l");let f=M;const p=i?1:void 0,z=class z extends f{constructor(){super(...arguments);Hr(this,"_formatted",null);Hr(this,"_fsPath",null)}get fsPath(){return this._fsPath||(this._fsPath=T(this,!1)),this._fsPath}toString(R=!1){return R?b(this,!0):(this._formatted||(this._formatted=b(this,!1)),this._formatted)}toJSON(){const R={$mid:1};return this._fsPath&&(R.fsPath=this._fsPath,R._sep=p),this._formatted&&(R.external=this._formatted),this.path&&(R.path=this.path),this.scheme&&(R.scheme=this.scheme),this.authority&&(R.authority=this.authority),this.query&&(R.query=this.query),this.fragment&&(R.fragment=this.fragment),R}};E(z,"d");let g=z;const m={58:"%3A",47:"%2F",63:"%3F",35:"%23",91:"%5B",93:"%5D",64:"%40",33:"%21",36:"%24",38:"%26",39:"%27",40:"%28",41:"%29",42:"%2A",43:"%2B",44:"%2C",59:"%3B",61:"%3D",32:"%20"};function y(F,S,R){let N,D=-1;for(let I=0;I=97&&$<=122||$>=65&&$<=90||$>=48&&$<=57||$===45||$===46||$===95||$===126||S&&$===47||R&&$===91||R&&$===93||R&&$===58)D!==-1&&(N+=encodeURIComponent(F.substring(D,I)),D=-1),N!==void 0&&(N+=F.charAt(I));else{N===void 0&&(N=F.substr(0,I));const B=m[$];B!==void 0?(D!==-1&&(N+=encodeURIComponent(F.substring(D,I)),D=-1),N+=B):D===-1&&(D=I)}}return D!==-1&&(N+=encodeURIComponent(F.substring(D))),N!==void 0?N:F}E(y,"m");function v(F){let S;for(let R=0;R1&&F.scheme==="file"?`//${F.authority}${F.path}`:F.path.charCodeAt(0)===47&&(F.path.charCodeAt(1)>=65&&F.path.charCodeAt(1)<=90||F.path.charCodeAt(1)>=97&&F.path.charCodeAt(1)<=122)&&F.path.charCodeAt(2)===58?S?F.path.substr(1):F.path[1].toLowerCase()+F.path.substr(2):F.path,i&&(R=R.replace(/\//g,"\\")),R}E(T,"v");function b(F,S){const R=S?v:y;let N="",{scheme:D,authority:I,path:$,query:B,fragment:P}=F;if(D&&(N+=D,N+=":"),(I||D==="file")&&(N+=h,N+=h),I){let G=I.indexOf("@");if(G!==-1){const V=I.substr(0,G);I=I.substr(G+1),G=V.lastIndexOf(":"),G===-1?N+=R(V,!1,!1):(N+=R(V.substr(0,G),!1,!1),N+=":",N+=R(V.substr(G+1),!1,!0)),N+="@"}I=I.toLowerCase(),G=I.lastIndexOf(":"),G===-1?N+=R(I,!1,!0):(N+=R(I.substr(0,G),!1,!0),N+=I.substr(G))}if($){if($.length>=3&&$.charCodeAt(0)===47&&$.charCodeAt(2)===58){const G=$.charCodeAt(1);G>=65&&G<=90&&($=`/${String.fromCharCode(G+32)}:${$.substr(3)}`)}else if($.length>=2&&$.charCodeAt(1)===58){const G=$.charCodeAt(0);G>=65&&G<=90&&($=`${String.fromCharCode(G+32)}:${$.substr(2)}`)}N+=R($,!0,!1)}return B&&(N+="?",N+=R(B,!1,!1)),P&&(N+="#",N+=S?P:y(P,!1,!1)),N}E(b,"b");function w(F){try{return decodeURIComponent(F)}catch{return F.length>3?F.substr(0,3)+w(F.substr(3)):F}}E(w,"C");const k=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function A(F){return F.match(k)?F.replace(k,(S=>w(S))):F}E(A,"w");var C=r(975);const _=C.posix||C,L="/";var O;(function(F){F.joinPath=function(S,...R){return S.with({path:_.join(S.path,...R)})},F.resolvePath=function(S,...R){let N=S.path,D=!1;N[0]!==L&&(N=L+N,D=!0);let I=_.resolve(N,...R);return D&&I[0]===L&&!S.authority&&(I=I.substring(1)),S.with({path:I})},F.dirname=function(S){if(S.path.length===0||S.path===L)return S;let R=_.dirname(S.path);return R.length===1&&R.charCodeAt(0)===46&&(R=""),S.with({path:R})},F.basename=function(S){return _.basename(S.path)},F.extname=function(S){return _.extname(S.path)}})(O||(O={})),hfe=n})();var{URI:eo,Utils:_T}=hfe,ls;(function(t){t.basename=_T.basename,t.dirname=_T.dirname,t.extname=_T.extname,t.joinPath=_T.joinPath,t.resolvePath=_T.resolvePath;const e=typeof process=="object"&&(process==null?void 0:process.platform)==="win32";function r(s,o){return(s==null?void 0:s.toString())===(o==null?void 0:o.toString())}E(r,"equals"),t.equals=r;function n(s,o){const l=typeof s=="string"?eo.parse(s).path:s.path,u=typeof o=="string"?eo.parse(o).path:o.path,h=l.split("/").filter(m=>m.length>0),d=u.split("/").filter(m=>m.length>0);if(e){const m=/^[A-Z]:$/;if(h[0]&&m.test(h[0])&&(h[0]=h[0].toLowerCase()),d[0]&&m.test(d[0])&&(d[0]=d[0].toLowerCase()),h[0]!==d[0])return u.substring(1)}let f=0;for(;f({name:i.name,uri:ls.joinPath(eo.parse(r),i.name).toString(),element:i.element})):[]}all(){return this.collectValues(this.root)}findAll(e){const r=this.getNode(ls.normalize(e),!1);return r?this.collectValues(r):[]}getNode(e,r){const n=e.split("/");e.charAt(e.length-1)==="/"&&n.pop();let i=this.root;for(const a of n){let s=i.children.get(a);if(!s)if(r)s={name:a,children:new Map,parent:i},i.children.set(a,s);else return;i=s}return i}collectValues(e){const r=[];e.element&&r.push(e.element);for(const n of e.children.values())r.push(...this.collectValues(n));return r}},E(ny,"UriTrie"),ny),zr;(function(t){t[t.Changed=0]="Changed",t[t.Parsed=1]="Parsed",t[t.IndexedContent=2]="IndexedContent",t[t.ComputedScopes=3]="ComputedScopes",t[t.Linked=4]="Linked",t[t.IndexedReferences=5]="IndexedReferences",t[t.Validated=6]="Validated"})(zr||(zr={}));var dfe=(iy=class{constructor(e){this.serviceRegistry=e.ServiceRegistry,this.textDocuments=e.workspace.TextDocuments,this.fileSystemProvider=e.workspace.FileSystemProvider}async fromUri(e,r=_n.CancellationToken.None){const n=await this.fileSystemProvider.readFile(e);return this.createAsync(e,n,r)}fromTextDocument(e,r,n){return r=r??eo.parse(e.uri),_n.CancellationToken.is(n)?this.createAsync(r,e,n):this.create(r,e,n)}fromString(e,r,n){return _n.CancellationToken.is(n)?this.createAsync(r,e,n):this.create(r,e,n)}fromModel(e,r){return this.create(r,{$model:e})}create(e,r,n){if(typeof r=="string"){const i=this.parse(e,r,n);return this.createLangiumDocument(i,e,void 0,r)}else if("$model"in r){const i={value:r.$model,parserErrors:[],lexerErrors:[]};return this.createLangiumDocument(i,e)}else{const i=this.parse(e,r.getText(),n);return this.createLangiumDocument(i,e,r)}}async createAsync(e,r,n){if(typeof r=="string"){const i=await this.parseAsync(e,r,n);return this.createLangiumDocument(i,e,void 0,r)}else{const i=await this.parseAsync(e,r.getText(),n);return this.createLangiumDocument(i,e,r)}}createLangiumDocument(e,r,n,i){let a;if(n)a={parseResult:e,uri:r,state:zr.Parsed,references:[],textDocument:n};else{const s=this.createTextDocumentGetter(r,i);a={parseResult:e,uri:r,state:zr.Parsed,references:[],get textDocument(){return s()}}}return e.value.$document=a,a}async update(e,r){var s,o;const n=(s=e.parseResult.value.$cstNode)==null?void 0:s.root.fullText,i=(o=this.textDocuments)==null?void 0:o.get(e.uri.toString()),a=i?i.getText():await this.fileSystemProvider.readFile(e.uri);if(i)Object.defineProperty(e,"textDocument",{value:i});else{const l=this.createTextDocumentGetter(e.uri,a);Object.defineProperty(e,"textDocument",{get:l})}return n!==a&&(e.parseResult=await this.parseAsync(e.uri,a,r),e.parseResult.value.$document=e),e.state=zr.Parsed,e}parse(e,r,n){return this.serviceRegistry.getServices(e).parser.LangiumParser.parse(r,n)}parseAsync(e,r,n){return this.serviceRegistry.getServices(e).parser.AsyncParser.parse(r,n)}createTextDocumentGetter(e,r){const n=this.serviceRegistry;let i;return()=>i??(i=LE.create(e.toString(),n.getServices(e).LanguageMetaData.languageId,0,r??""))}},E(iy,"DefaultLangiumDocumentFactory"),iy),ffe=(ay=class{constructor(e){this.documentTrie=new LN,this.services=e,this.langiumDocumentFactory=e.workspace.LangiumDocumentFactory,this.documentBuilder=()=>e.workspace.DocumentBuilder}get all(){return pn(this.documentTrie.all())}addDocument(e){const r=e.uri.toString();if(this.documentTrie.has(r))throw new Error(`A document with the URI '${r}' is already present.`);this.documentTrie.insert(r,e)}getDocument(e){const r=e.toString();return this.documentTrie.find(r)}getDocuments(e){const r=e.toString();return this.documentTrie.findAll(r)}async getOrCreateDocument(e,r){let n=this.getDocument(e);return n||(n=await this.langiumDocumentFactory.fromUri(e,r),this.addDocument(n),n)}createDocument(e,r,n){if(n)return this.langiumDocumentFactory.fromString(r,e,n).then(i=>(this.addDocument(i),i));{const i=this.langiumDocumentFactory.fromString(r,e);return this.addDocument(i),i}}hasDocument(e){return this.documentTrie.has(e.toString())}invalidateDocument(e){const r=e.toString(),n=this.documentTrie.find(r);return n&&this.documentBuilder().resetToState(n,zr.Changed),n}deleteDocument(e){const r=e.toString(),n=this.documentTrie.find(r);return n&&(n.state=zr.Changed,this.documentTrie.delete(r)),n}deleteDocuments(e){const r=e.toString(),n=this.documentTrie.findAll(r);for(const i of n)i.state=zr.Changed;return this.documentTrie.delete(r),n}},E(ay,"DefaultLangiumDocuments"),ay),Pf=Symbol("RefResolving"),pfe=(sy=class{constructor(e){this.reflection=e.shared.AstReflection,this.langiumDocuments=()=>e.shared.workspace.LangiumDocuments,this.scopeProvider=e.references.ScopeProvider,this.astNodeLocator=e.workspace.AstNodeLocator,this.profiler=e.shared.profilers.LangiumProfiler,this.languageId=e.LanguageMetaData.languageId}async link(e,r=_n.CancellationToken.None){var n;if((n=this.profiler)!=null&&n.isActive("linking")){const i=this.profiler.createTask("linking",this.languageId);i.start();try{for(const a of Vo(e.parseResult.value))await ra(r),ag(a).forEach(s=>{const o=`${a.$type}:${s.property}`;i.startSubTask(o);try{this.doLink(s,e)}finally{i.stopSubTask(o)}})}finally{i.stop()}}else for(const i of Vo(e.parseResult.value))await ra(r),ag(i).forEach(a=>this.doLink(a,e))}doLink(e,r){const n=e.reference;if("_ref"in n&&n._ref===void 0){n._ref=Pf;try{const i=this.getCandidate(e);if(Xd(i))n._ref=i;else{n._nodeDescription=i;const a=this.loadAstNode(i);n._ref=a??this.createLinkingError(e,i)}}catch(i){console.error(`An error occurred while resolving reference to '${n.$refText}':`,i);const a=i.message??String(i);n._ref={info:e,message:`An error occurred while resolving reference to '${n.$refText}': ${a}`}}r.references.push(n)}else if("_items"in n&&n._items===void 0){n._items=Pf;try{const i=this.getCandidates(e),a=[];if(Xd(i))n._linkingError=i;else for(const s of i){const o=this.loadAstNode(s);o&&a.push({ref:o,$nodeDescription:s})}n._items=a}catch(i){n._linkingError={info:e,message:`An error occurred while resolving reference to '${n.$refText}': ${i}`},n._items=[]}r.references.push(n)}}unlink(e){for(const r of e.references)"_ref"in r?(r._ref=void 0,delete r._nodeDescription):"_items"in r&&(r._items=void 0,delete r._linkingError);e.references=[]}getCandidate(e){return this.scopeProvider.getScope(e).getElement(e.reference.$refText)??this.createLinkingError(e)}getCandidates(e){const n=this.scopeProvider.getScope(e).getElements(e.reference.$refText).distinct(i=>`${i.documentUri}#${i.path}`).toArray();return n.length>0?n:this.createLinkingError(e)}buildReference(e,r,n,i){const a=this,s={$refNode:n,$refText:i,_ref:void 0,get ref(){if(Ii(this._ref))return this._ref;if(I9(this._nodeDescription)){const o=a.loadAstNode(this._nodeDescription);this._ref=o??a.createLinkingError({reference:s,container:e,property:r},this._nodeDescription)}else if(this._ref===void 0){this._ref=Pf;const o=ig(e).$document,l=a.getLinkedNode({reference:s,container:e,property:r});if(l.error&&o&&o.state0))return this._linkingError=a.createLinkingError({reference:s,container:e,property:r})}};return s}throwCyclicReferenceError(e,r,n){throw new Error(`Cyclic reference resolution detected: ${this.astNodeLocator.getAstNodePath(e)}/${r} (symbol '${n}')`)}getLinkedNode(e){try{const r=this.getCandidate(e);if(Xd(r))return{error:r};const n=this.loadAstNode(r);return n?{node:n,descr:r}:{descr:r,error:this.createLinkingError(e,r)}}catch(r){console.error(`An error occurred while resolving reference to '${e.reference.$refText}':`,r);const n=r.message??String(r);return{error:{info:e,message:`An error occurred while resolving reference to '${e.reference.$refText}': ${n}`}}}}loadAstNode(e){if(e.node)return e.node;const r=this.langiumDocuments().getDocument(e.documentUri);if(r)return this.astNodeLocator.getAstNode(r.parseResult.value,e.path)}createLinkingError(e,r){const n=ig(e.container).$document;n&&n.stateQd(r)&&r.isMulti)}findDeclarations(e){if(e){const r=kD(e),n=e.astNode;if(r&&n){const i=n[r.feature];if(es(i)||ql(i))return D3(i);if(Array.isArray(i)){for(const a of i)if((es(a)||ql(a))&&a.$refNode&&a.$refNode.offset<=e.offset&&a.$refNode.end>=e.end)return D3(a)}}if(n){const i=this.nameProvider.getNameNode(n);if(i&&(i===e||tD(e,i)))return this.getSelfNodes(n)}}return[]}getSelfNodes(e){if(this.hasMultiReference){const r=this.index.findAllReferences(e,this.nodeLocator.getAstNodePath(e)),n=this.getNodeFromReferenceDescription(r.head());if(n){for(const i of ag(n))if(ql(i.reference)&&i.reference.items.some(a=>a.ref===e))return i.reference.items.map(a=>a.ref)}return[e]}else return[e]}getNodeFromReferenceDescription(e){if(!e)return;const r=this.documents.getDocument(e.sourceUri);if(r)return this.nodeLocator.getAstNode(r.parseResult.value,e.sourcePath)}findDeclarationNodes(e){const r=this.findDeclarations(e),n=[];for(const i of r){const a=this.nameProvider.getNameNode(i)??i.$cstNode;a&&n.push(a)}return n}findReferences(e,r){const n=[];r.includeDeclaration&&n.push(...this.getSelfReferences(e));let i=this.index.findAllReferences(e,this.nodeLocator.getAstNodePath(e));return r.documentUri&&(i=i.filter(a=>ls.equals(a.sourceUri,r.documentUri))),n.push(...i),pn(n)}getSelfReferences(e){const r=this.getSelfNodes(e),n=[];for(const i of r){const a=this.nameProvider.getNameNode(i);if(a){const s=qo(i),o=this.nodeLocator.getAstNodePath(i);n.push({sourceUri:s.uri,sourcePath:o,targetUri:s.uri,targetPath:o,segment:gg(a),local:!0})}}return n}},E(ly,"DefaultReferences"),ly),su=(cy=class{constructor(e){if(this.map=new Map,e)for(const[r,n]of e)this.add(r,n)}get size(){return Ax.sum(pn(this.map.values()).map(e=>e.length))}clear(){this.map.clear()}delete(e,r){if(r===void 0)return this.map.delete(e);{const n=this.map.get(e);if(n){const i=n.indexOf(r);if(i>=0)return n.length===1?this.map.delete(e):n.splice(i,1),!0}return!1}}get(e){return this.map.get(e)??[]}getStream(e){const r=this.map.get(e);return r?pn(r):tg}has(e,r){if(r===void 0)return this.map.has(e);{const n=this.map.get(e);return n?n.indexOf(r)>=0:!1}}add(e,r){return this.map.has(e)?this.map.get(e).push(r):this.map.set(e,[r]),this}addAll(e,r){return this.map.has(e)?this.map.get(e).push(...r):this.map.set(e,Array.from(r)),this}forEach(e){this.map.forEach((r,n)=>r.forEach(i=>e(i,n,this)))}[Symbol.iterator](){return this.entries().iterator()}entries(){return pn(this.map.entries()).flatMap(([e,r])=>r.map(n=>[e,n]))}keys(){return pn(this.map.keys())}values(){return pn(this.map.values()).flat()}entriesGroupedByKey(){return pn(this.map.entries())}},E(cy,"MultiMap"),cy),DE=(uy=class{get size(){return this.map.size}constructor(e){if(this.map=new Map,this.inverse=new Map,e)for(const[r,n]of e)this.set(r,n)}clear(){this.map.clear(),this.inverse.clear()}set(e,r){return this.map.set(e,r),this.inverse.set(r,e),this}get(e){return this.map.get(e)}getKey(e){return this.inverse.get(e)}delete(e){const r=this.map.get(e);return r!==void 0?(this.map.delete(e),this.inverse.delete(r),!0):!1}},E(uy,"BiMap"),uy),yfe=(hy=class{constructor(e){this.nameProvider=e.references.NameProvider,this.descriptions=e.workspace.AstNodeDescriptionProvider}async collectExportedSymbols(e,r=_n.CancellationToken.None){return this.collectExportedSymbolsForNode(e.parseResult.value,e,void 0,r)}async collectExportedSymbolsForNode(e,r,n=_x,i=_n.CancellationToken.None){const a=[];this.addExportedSymbol(e,a,r);for(const s of n(e))await ra(i),this.addExportedSymbol(s,a,r);return a}addExportedSymbol(e,r,n){const i=this.nameProvider.getName(e);i&&r.push(this.descriptions.createDescription(e,i,n))}async collectLocalSymbols(e,r=_n.CancellationToken.None){const n=e.parseResult.value,i=new su;for(const a of Uc(n))await ra(r),this.addLocalSymbol(a,e,i);return i}addLocalSymbol(e,r,n){const i=e.$container;if(i){const a=this.nameProvider.getName(e);a&&n.add(i,this.descriptions.createDescription(e,a,r))}}},E(hy,"DefaultScopeComputation"),hy),DN=(dy=class{constructor(e,r,n){this.elements=e,this.outerScope=r,this.caseInsensitive=(n==null?void 0:n.caseInsensitive)??!1,this.concatOuterScope=(n==null?void 0:n.concatOuterScope)??!0}getAllElements(){return this.outerScope?this.elements.concat(this.outerScope.getAllElements()):this.elements}getElement(e){const r=this.caseInsensitive?e.toLowerCase():e,n=this.caseInsensitive?this.elements.find(i=>i.name.toLowerCase()===r):this.elements.find(i=>i.name===e);if(n)return n;if(this.outerScope)return this.outerScope.getElement(e)}getElements(e){const r=this.caseInsensitive?e.toLowerCase():e,n=this.caseInsensitive?this.elements.filter(i=>i.name.toLowerCase()===r):this.elements.filter(i=>i.name===e);return(this.concatOuterScope||n.isEmpty())&&this.outerScope?n.concat(this.outerScope.getElements(e)):n}},E(dy,"StreamScope"),dy),gnt=(fy=class{constructor(e,r,n){this.elements=new Map,this.caseInsensitive=(n==null?void 0:n.caseInsensitive)??!1,this.concatOuterScope=(n==null?void 0:n.concatOuterScope)??!0;for(const i of e){const a=this.caseInsensitive?i.name.toLowerCase():i.name;this.elements.set(a,i)}this.outerScope=r}getElement(e){const r=this.caseInsensitive?e.toLowerCase():e,n=this.elements.get(r);if(n)return n;if(this.outerScope)return this.outerScope.getElement(e)}getElements(e){const r=this.caseInsensitive?e.toLowerCase():e,n=this.elements.get(r),i=n?[n]:[];return(this.concatOuterScope||i.length>0)&&this.outerScope?pn(i).concat(this.outerScope.getElements(e)):pn(i)}getAllElements(){let e=pn(this.elements.values());return this.outerScope&&(e=e.concat(this.outerScope.getAllElements())),e}},E(fy,"MapScope"),fy),vfe=(py=class{constructor(e,r,n){this.elements=new su,this.caseInsensitive=(n==null?void 0:n.caseInsensitive)??!1,this.concatOuterScope=(n==null?void 0:n.concatOuterScope)??!0;for(const i of e){const a=this.caseInsensitive?i.name.toLowerCase():i.name;this.elements.add(a,i)}this.outerScope=r}getElement(e){const r=this.caseInsensitive?e.toLowerCase():e,n=this.elements.get(r)[0];if(n)return n;if(this.outerScope)return this.outerScope.getElement(e)}getElements(e){const r=this.caseInsensitive?e.toLowerCase():e,n=this.elements.get(r);return(this.concatOuterScope||n.length===0)&&this.outerScope?pn(n).concat(this.outerScope.getElements(e)):pn(n)}getAllElements(){let e=pn(this.elements.values());return this.outerScope&&(e=e.concat(this.outerScope.getAllElements())),e}},E(py,"MultiMapScope"),py),mnt={getElement(){},getElements(){return tg},getAllElements(){return tg}},ME=(gy=class{constructor(){this.toDispose=[],this.isDisposed=!1}onDispose(e){this.toDispose.push(e)}dispose(){this.throwIfDisposed(),this.clear(),this.isDisposed=!0,this.toDispose.forEach(e=>e.dispose())}throwIfDisposed(){if(this.isDisposed)throw new Error("This cache has already been disposed")}},E(gy,"DisposableCache"),gy),MN=(my=class extends ME{constructor(){super(...arguments),this.cache=new Map}has(e){return this.throwIfDisposed(),this.cache.has(e)}set(e,r){this.throwIfDisposed(),this.cache.set(e,r)}get(e,r){if(this.throwIfDisposed(),this.cache.has(e))return this.cache.get(e);if(r){const n=r();return this.cache.set(e,n),n}else return}delete(e){return this.throwIfDisposed(),this.cache.delete(e)}clear(){this.throwIfDisposed(),this.cache.clear()}},E(my,"SimpleCache"),my),NE=(yy=class extends ME{constructor(e){super(),this.cache=new Map,this.converter=e??(r=>r)}has(e,r){return this.throwIfDisposed(),this.cacheForContext(e).has(r)}set(e,r,n){this.throwIfDisposed(),this.cacheForContext(e).set(r,n)}get(e,r,n){this.throwIfDisposed();const i=this.cacheForContext(e);if(i.has(r))return i.get(r);if(n){const a=n();return i.set(r,a),a}else return}delete(e,r){return this.throwIfDisposed(),this.cacheForContext(e).delete(r)}clear(e){if(this.throwIfDisposed(),e){const r=this.converter(e);this.cache.delete(r)}else this.cache.clear()}cacheForContext(e){const r=this.converter(e);let n=this.cache.get(r);return n||(n=new Map,this.cache.set(r,n)),n}},E(yy,"ContextCache"),yy),bfe=(vy=class extends NE{constructor(e,r){super(n=>n.toString()),r?(this.toDispose.push(e.workspace.DocumentBuilder.onDocumentPhase(r,n=>{this.clear(n.uri.toString())})),this.toDispose.push(e.workspace.DocumentBuilder.onUpdate((n,i)=>{for(const a of i)this.clear(a)}))):this.toDispose.push(e.workspace.DocumentBuilder.onUpdate((n,i)=>{const a=n.concat(i);for(const s of a)this.clear(s)}))}},E(vy,"DocumentCache"),vy),NN=(by=class extends MN{constructor(e,r){super(),r?(this.toDispose.push(e.workspace.DocumentBuilder.onBuildPhase(r,()=>{this.clear()})),this.toDispose.push(e.workspace.DocumentBuilder.onUpdate((n,i)=>{i.length>0&&this.clear()}))):this.toDispose.push(e.workspace.DocumentBuilder.onUpdate(()=>{this.clear()}))}},E(by,"WorkspaceCache"),by),xfe=(xy=class{constructor(e){this.reflection=e.shared.AstReflection,this.nameProvider=e.references.NameProvider,this.descriptions=e.workspace.AstNodeDescriptionProvider,this.indexManager=e.shared.workspace.IndexManager,this.globalScopeCache=new NN(e.shared)}getScope(e){const r=[],n=this.reflection.getReferenceType(e),i=qo(e.container).localSymbols;if(i){let s=e.container;do i.has(s)&&r.push(i.getStream(s).filter(o=>this.reflection.isSubtype(o.type,n))),s=s.$container;while(s)}let a=this.getGlobalScope(n,e);for(let s=r.length-1;s>=0;s--)a=this.createScope(r[s],a);return a}createScope(e,r,n){return new DN(pn(e),r,n)}createScopeForNodes(e,r,n){const i=pn(e).map(a=>{const s=this.nameProvider.getName(a);if(s)return this.descriptions.createDescription(a,s)}).nonNullable();return new DN(i,r,n)}getGlobalScope(e,r){return this.globalScopeCache.get(e,()=>new vfe(this.indexManager.allElements(e)))}},E(xy,"DefaultScopeProvider"),xy);function ON(t){return typeof t.$comment=="string"}E(ON,"isAstNodeWithComment");function $N(t){return typeof t=="object"&&!!t&&("$ref"in t||"$error"in t)}E($N,"isIntermediateReference");var Tfe=(Ty=class{constructor(e){this.ignoreProperties=new Set(["$container","$containerProperty","$containerIndex","$document","$cstNode"]),this.langiumDocuments=e.shared.workspace.LangiumDocuments,this.astNodeLocator=e.workspace.AstNodeLocator,this.nameProvider=e.references.NameProvider,this.commentProvider=e.documentation.CommentProvider}serialize(e,r){const n=r??{},i=r==null?void 0:r.replacer,a=E((o,l)=>this.replacer(o,l,n),"defaultReplacer"),s=i?(o,l)=>i(o,l,a):a;try{return this.currentDocument=qo(e),JSON.stringify(e,s,r==null?void 0:r.space)}finally{this.currentDocument=void 0}}deserialize(e,r){const n=r??{},i=JSON.parse(e);return this.linkNode(i,i,n),i}replacer(e,r,{refText:n,sourceText:i,textRegions:a,comments:s,uriConverter:o}){var l,u,h;if(!this.ignoreProperties.has(e))if(es(r)){const d=r.ref,f=n?r.$refText:void 0;if(d){const p=qo(d);let g="";this.currentDocument&&this.currentDocument!==p&&(o?g=o(p.uri,d):g=p.uri.toString());const m=this.astNodeLocator.getAstNodePath(d);return{$ref:`${g}#${m}`,$refText:f}}else return{$error:((l=r.error)==null?void 0:l.message)??"Could not resolve reference",$refText:f}}else if(ql(r)){const d=n?r.$refText:void 0,f=[];for(const p of r.items){const g=p.ref,m=qo(p.ref);let y="";this.currentDocument&&this.currentDocument!==m&&(o?y=o(m.uri,g):y=m.uri.toString());const v=this.astNodeLocator.getAstNodePath(g);f.push(`${y}#${v}`)}return{$refs:f,$refText:d}}else if(Ii(r)){let d;if(a&&(d=this.addAstNodeRegionWithAssignmentsTo({...r}),(!e||r.$document)&&(d!=null&&d.$textRegion)&&(d.$textRegion.documentURI=(u=this.currentDocument)==null?void 0:u.uri.toString())),i&&!e&&(d??(d={...r}),d.$sourceText=(h=r.$cstNode)==null?void 0:h.text),s){d??(d={...r});const f=this.commentProvider.getComment(r);f&&(d.$comment=f.replace(/\r/g,""))}return d??r}else return r}addAstNodeRegionWithAssignmentsTo(e){const r=E(n=>({offset:n.offset,end:n.end,length:n.length,range:n.range}),"createDocumentSegment");if(e.$cstNode){const n=e.$textRegion=r(e.$cstNode),i=n.assignments={};return Object.keys(e).filter(a=>!a.startsWith("$")).forEach(a=>{const s=wD(e.$cstNode,a).map(r);s.length!==0&&(i[a]=s)}),e}}linkNode(e,r,n,i,a,s){for(const[l,u]of Object.entries(e))if(Array.isArray(u))for(let h=0;h{await this.handleException(()=>e.call(r,n,i,a),"An error occurred during validation",i,n)}}async handleException(e,r,n,i){try{await e()}catch(a){if($f(a))throw a;console.error(`${r}:`,a),a instanceof Error&&a.stack&&console.error(a.stack);const s=a instanceof Error?a.message:String(a);n("error",`${r}: ${s}`,{node:i})}}addEntry(e,r){if(e==="AstNode"){this.entries.add("AstNode",r);return}for(const n of this.reflection.getAllSubTypes(e))this.entries.add(n,r)}getChecks(e,r){let n=pn(this.entries.get(e)).concat(this.entries.get("AstNode"));return r&&(n=n.filter(i=>r.includes(i.category))),n.map(i=>i.check)}registerBeforeDocument(e,r=this){this.entriesBefore.push(this.wrapPreparationException(e,"An error occurred during set-up of the validation",r))}registerAfterDocument(e,r=this){this.entriesAfter.push(this.wrapPreparationException(e,"An error occurred during tear-down of the validation",r))}wrapPreparationException(e,r,n){return async(i,a,s,o)=>{await this.handleException(()=>e.call(n,i,a,s,o),r,a,i)}}get checksBefore(){return this.entriesBefore}get checksAfter(){return this.entriesAfter}getAllValidationCategories(e){return this.knownCategories}},E(Cy,"ValidationRegistry"),Cy),kfe=Object.freeze({validateNode:!0,validateChildren:!0}),Efe=(ky=class{constructor(e){this.validationRegistry=e.validation.ValidationRegistry,this.metadata=e.LanguageMetaData,this.profiler=e.shared.profilers.LangiumProfiler,this.languageId=e.LanguageMetaData.languageId}async validateDocument(e,r={},n=_n.CancellationToken.None){const i=e.parseResult,a=[];if(await ra(n),(!r.categories||r.categories.includes("built-in"))&&(this.processLexingErrors(i,a,r),r.stopAfterLexingErrors&&a.some(s=>{var o;return((o=s.data)==null?void 0:o.code)===wo.LexingError})||(this.processParsingErrors(i,a,r),r.stopAfterParsingErrors&&a.some(s=>{var o;return((o=s.data)==null?void 0:o.code)===wo.ParsingError}))||(this.processLinkingErrors(e,a,r),r.stopAfterLinkingErrors&&a.some(s=>{var o;return((o=s.data)==null?void 0:o.code)===wo.LinkingError}))))return a;try{a.push(...await this.validateAst(i.value,r,n))}catch(s){if($f(s))throw s;console.error("An error occurred during validation:",s)}return await ra(n),a}processLexingErrors(e,r,n){var a;const i=[...e.lexerErrors,...((a=e.lexerReport)==null?void 0:a.diagnostics)??[]];for(const s of i){const o=s.severity??"error",l={severity:RT(o),range:{start:{line:s.line-1,character:s.column-1},end:{line:s.line-1,character:s.column+s.length-1}},message:s.message,data:BN(o),source:this.getSource()};r.push(l)}}processParsingErrors(e,r,n){for(const i of e.parserErrors){let a;if(isNaN(i.token.startOffset)){if("previousToken"in i){const s=i.previousToken;if(isNaN(s.startOffset)){const o={line:0,character:0};a={start:o,end:o}}else{const o={line:s.endLine-1,character:s.endColumn};a={start:o,end:o}}}}else a=Bx(i.token);if(a){const s={severity:RT("error"),range:a,message:i.message,data:Bf(wo.ParsingError),source:this.getSource()};r.push(s)}}}processLinkingErrors(e,r,n){var i;for(const a of e.references){const s=a.error;if(s){const o={node:s.info.container,range:(i=a.$refNode)==null?void 0:i.range,property:s.info.property,index:s.info.index,data:{code:wo.LinkingError,containerType:s.info.container.$type,property:s.info.property,refText:s.info.reference.$refText}};r.push(this.toDiagnostic("error",s.message,o))}}}async validateAst(e,r,n=_n.CancellationToken.None){const i=[],a=E((s,o,l)=>{i.push(this.toDiagnostic(s,o,l))},"acceptor");return await this.validateAstBefore(e,r,a,n),await this.validateAstNodes(e,r,a,n),await this.validateAstAfter(e,r,a,n),i}async validateAstBefore(e,r,n,i=_n.CancellationToken.None){const a=this.validationRegistry.checksBefore;for(const s of a)await ra(i),await s(e,n,r.categories??[],i)}async validateAstNodes(e,r,n,i=_n.CancellationToken.None){var a;if((a=this.profiler)!=null&&a.isActive("validating")){const s=this.profiler.createTask("validating",this.languageId);s.start();try{const o=Vo(e).iterator();for(const l of o){s.startSubTask(l.$type);const u=this.validateSingleNodeOptions(l,r);if(u.validateNode)try{const h=this.validationRegistry.getChecks(l.$type,r.categories);for(const d of h)await d(l,n,i)}finally{s.stopSubTask(l.$type)}u.validateChildren||o.prune()}}finally{s.stop()}}else{const s=Vo(e).iterator();for(const o of s){await ra(i);const l=this.validateSingleNodeOptions(o,r);if(l.validateNode){const u=this.validationRegistry.getChecks(o.$type,r.categories);for(const h of u)await h(o,n,i)}l.validateChildren||s.prune()}}}validateSingleNodeOptions(e,r){return kfe}async validateAstAfter(e,r,n,i=_n.CancellationToken.None){const a=this.validationRegistry.checksAfter;for(const s of a)await ra(i),await s(e,n,r.categories??[],i)}toDiagnostic(e,r,n){return{message:r,range:PN(n),severity:RT(e),code:n.code,codeDescription:n.codeDescription,tags:n.tags,relatedInformation:n.relatedInformation,data:n.data,source:this.getSource()}}getSource(){return this.metadata.languageId}},E(ky,"DefaultDocumentValidator"),ky);function PN(t){if(t.range)return t.range;let e;return typeof t.property=="string"?e=uk(t.node.$cstNode,t.property,t.index):typeof t.keyword=="string"&&(e=CD(t.node.$cstNode,t.keyword,t.index)),e??(e=t.node.$cstNode),e?e.range:{start:{line:0,character:0},end:{line:0,character:0}}}E(PN,"getDiagnosticRange");function RT(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)}}E(RT,"toDiagnosticSeverity");function BN(t){switch(t){case"error":return Bf(wo.LexingError);case"warning":return Bf(wo.LexingWarning);case"info":return Bf(wo.LexingInfo);case"hint":return Bf(wo.LexingHint);default:throw new Error("Invalid diagnostic severity: "+t)}}E(BN,"toDiagnosticData");var wo;(function(t){t.LexingError="lexing-error",t.LexingWarning="lexing-warning",t.LexingInfo="lexing-info",t.LexingHint="lexing-hint",t.ParsingError="parsing-error",t.LinkingError="linking-error"})(wo||(wo={}));var Sfe=(Ey=class{constructor(e){this.astNodeLocator=e.workspace.AstNodeLocator,this.nameProvider=e.references.NameProvider}createDescription(e,r,n){const i=n??qo(e);r??(r=this.nameProvider.getName(e));const a=this.astNodeLocator.getAstNodePath(e);if(!r)throw new Error(`Node at path ${a} has no name.`);let s;const o=E(()=>s??(s=gg(this.nameProvider.getNameNode(e)??e.$cstNode)),"nameSegmentGetter");return{node:e,name:r,get nameSegment(){return o()},selectionSegment:gg(e.$cstNode),type:e.$type,documentUri:i.uri,path:a}}},E(Ey,"DefaultAstNodeDescriptionProvider"),Ey),Afe=(Sy=class{constructor(e){this.nodeLocator=e.workspace.AstNodeLocator}async createDescriptions(e,r=_n.CancellationToken.None){const n=[],i=e.parseResult.value;for(const a of Vo(i))await ra(r),ag(a).forEach(s=>{s.reference.error||n.push(...this.createInfoDescriptions(s))});return n}createInfoDescriptions(e){const r=e.reference;if(r.error||!r.$refNode)return[];let n=[];es(r)&&r.$nodeDescription?n=[r.$nodeDescription]:ql(r)&&(n=r.items.map(l=>l.$nodeDescription).filter(l=>l!==void 0));const i=qo(e.container).uri,a=this.nodeLocator.getAstNodePath(e.container),s=[],o=gg(r.$refNode);for(const l of n)s.push({sourceUri:i,sourcePath:a,targetUri:l.documentUri,targetPath:l.path,segment:o,local:ls.equals(l.documentUri,i)});return s}},E(Sy,"DefaultReferenceDescriptionProvider"),Sy),_fe=(Ay=class{constructor(){this.segmentSeparator="/",this.indexSeparator="@"}getAstNodePath(e){if(e.$container){const r=this.getAstNodePath(e.$container),n=this.getPathSegment(e);return r+this.segmentSeparator+n}return""}getPathSegment({$containerProperty:e,$containerIndex:r}){if(!e)throw new Error("Missing '$containerProperty' in AST node.");return r!==void 0?e+this.indexSeparator+r:e}getAstNode(e,r){return r.split(this.segmentSeparator).reduce((i,a)=>{if(!i||a.length===0)return i;const s=a.indexOf(this.indexSeparator);if(s>0){const o=a.substring(0,s),l=parseInt(a.substring(s+1)),u=i[o];return u==null?void 0:u[l]}return i[a]},e)}},E(Ay,"DefaultAstNodeLocator"),Ay),$E={};T3($E,EI(Jp()));var Rfe=(_y=class{constructor(e){this._ready=new au,this.onConfigurationSectionUpdateEmitter=new $E.Emitter,this.settings={},this.workspaceConfig=!1,this.serviceRegistry=e.ServiceRegistry}get ready(){return this._ready.promise}initialize(e){var r;this.workspaceConfig=((r=e.capabilities.workspace)==null?void 0:r.configuration)??!1}async initialized(e){if(this.workspaceConfig){if(e.register){const r=this.serviceRegistry.all;e.register({section:r.map(n=>this.toSectionName(n.LanguageMetaData.languageId))})}if(e.fetchConfiguration){const r=this.serviceRegistry.all.map(i=>({section:this.toSectionName(i.LanguageMetaData.languageId)})),n=await e.fetchConfiguration(r);r.forEach((i,a)=>{this.updateSectionConfiguration(i.section,n[a])})}}this._ready.resolve()}updateConfiguration(e){typeof e.settings!="object"||e.settings===null||Object.entries(e.settings).forEach(([r,n])=>{this.updateSectionConfiguration(r,n),this.onConfigurationSectionUpdateEmitter.fire({section:r,configuration:n})})}updateSectionConfiguration(e,r){this.settings[e]=r}async getConfiguration(e,r){await this.ready;const n=this.toSectionName(e);if(this.settings[n])return this.settings[n][r]}toSectionName(e){return`${e}`}get onConfigurationSectionUpdate(){return this.onConfigurationSectionUpdateEmitter.event}},E(_y,"DefaultConfigurationProvider"),_y),PE=EI(XUe()),Ff;(function(t){function e(r){return{dispose:E(async()=>await r(),"dispose")}}E(e,"create"),t.create=e})(Ff||(Ff={}));var Lfe=(Ry=class{constructor(e){this.updateBuildOptions={validation:{categories:["built-in","fast"]}},this.updateListeners=[],this.buildPhaseListeners=new su,this.documentPhaseListeners=new su,this.buildState=new Map,this.documentBuildWaiters=new Map,this.currentState=zr.Changed,this.langiumDocuments=e.workspace.LangiumDocuments,this.langiumDocumentFactory=e.workspace.LangiumDocumentFactory,this.textDocuments=e.workspace.TextDocuments,this.indexManager=e.workspace.IndexManager,this.fileSystemProvider=e.workspace.FileSystemProvider,this.workspaceManager=()=>e.workspace.WorkspaceManager,this.serviceRegistry=e.ServiceRegistry}async build(e,r={},n=_n.CancellationToken.None){var i;for(const a of e){const s=a.uri.toString();if(a.state===zr.Validated){if(typeof r.validation=="boolean"&&r.validation)this.resetToState(a,zr.IndexedReferences);else if(typeof r.validation=="object"){const o=this.findMissingValidationCategories(a,r);o.length>0&&(this.buildState.set(s,{completed:!1,options:{validation:{categories:o}},result:(i=this.buildState.get(s))==null?void 0:i.result}),a.state=zr.IndexedReferences)}}else this.buildState.delete(s)}this.currentState=zr.Changed,await this.emitUpdate(e.map(a=>a.uri),[]),await this.buildDocuments(e,r,n)}async update(e,r,n=_n.CancellationToken.None){this.currentState=zr.Changed;const i=[];for(const l of r){const u=this.langiumDocuments.deleteDocuments(l);for(const h of u)i.push(h.uri),this.cleanUpDeleted(h)}const a=(await Promise.all(e.map(l=>this.findChangedUris(l)))).flat();for(const l of a){let u=this.langiumDocuments.getDocument(l);u===void 0&&(u=this.langiumDocumentFactory.fromModel({$type:"INVALID"},l),u.state=zr.Changed,this.langiumDocuments.addDocument(u)),this.resetToState(u,zr.Changed)}const s=pn(a).concat(i).map(l=>l.toString()).toSet();this.langiumDocuments.all.filter(l=>!s.has(l.uri.toString())&&this.shouldRelink(l,s)).forEach(l=>this.resetToState(l,zr.ComputedScopes)),await this.emitUpdate(a,i),await ra(n);const o=this.sortDocuments(this.langiumDocuments.all.filter(l=>{var u;return l.state=1}findMissingValidationCategories(e,r){var o,l;const n=this.buildState.get(e.uri.toString()),i=this.serviceRegistry.getServices(e.uri).validation.ValidationRegistry.getAllValidationCategories(e),a=(o=n==null?void 0:n.result)!=null&&o.validationChecks?new Set((l=n==null?void 0:n.result)==null?void 0:l.validationChecks):n!=null&&n.completed?i:new Set,s=r===void 0||r.validation===!0?i:typeof r.validation=="object"?r.validation.categories??i:[];return pn(s).filter(u=>!a.has(u)).toArray()}async findChangedUris(e){var n;if(this.langiumDocuments.getDocument(e)??((n=this.textDocuments)==null?void 0:n.get(e)))return[e];try{const i=await this.fileSystemProvider.stat(e);if(i.isDirectory)return await this.workspaceManager().searchFolder(e);if(this.workspaceManager().shouldIncludeEntry(i))return[e]}catch{}return[]}async emitUpdate(e,r){await Promise.all(this.updateListeners.map(n=>n(e,r)))}sortDocuments(e){let r=0,n=e.length-1;for(;r=0&&!this.hasTextDocument(e[n]);)n--;rn.error!==void 0)?!0:this.indexManager.isAffected(e,r)}onUpdate(e){return this.updateListeners.push(e),Ff.create(()=>{const r=this.updateListeners.indexOf(e);r>=0&&this.updateListeners.splice(r,1)})}resetToState(e,r){switch(r){case zr.Changed:case zr.Parsed:this.indexManager.removeContent(e.uri);case zr.IndexedContent:e.localSymbols=void 0;case zr.ComputedScopes:this.serviceRegistry.getServices(e.uri).references.Linker.unlink(e);case zr.Linked:this.indexManager.removeReferences(e.uri);case zr.IndexedReferences:e.diagnostics=void 0,this.buildState.delete(e.uri.toString());case zr.Validated:}e.state>r&&(e.state=r)}cleanUpDeleted(e){this.buildState.delete(e.uri.toString()),this.indexManager.remove(e.uri),e.state=zr.Changed}async buildDocuments(e,r,n){this.prepareBuild(e,r),await this.runCancelable(e,zr.Parsed,n,s=>this.langiumDocumentFactory.update(s,n)),await this.runCancelable(e,zr.IndexedContent,n,s=>this.indexManager.updateContent(s,n)),await this.runCancelable(e,zr.ComputedScopes,n,async s=>{const o=this.serviceRegistry.getServices(s.uri).references.ScopeComputation;s.localSymbols=await o.collectLocalSymbols(s,n)});const i=e.filter(s=>this.shouldLink(s));await this.runCancelable(i,zr.Linked,n,s=>this.serviceRegistry.getServices(s.uri).references.Linker.link(s,n)),await this.runCancelable(i,zr.IndexedReferences,n,s=>this.indexManager.updateReferences(s,n));const a=e.filter(s=>this.shouldValidate(s)?!0:(this.markAsCompleted(s),!1));await this.runCancelable(a,zr.Validated,n,async s=>{await this.validate(s,n),this.markAsCompleted(s)})}markAsCompleted(e){const r=this.buildState.get(e.uri.toString());r&&(r.completed=!0)}prepareBuild(e,r){for(const n of e){const i=n.uri.toString(),a=this.buildState.get(i);(!a||a.completed)&&this.buildState.set(i,{completed:!1,options:r,result:a==null?void 0:a.result})}}async runCancelable(e,r,n,i){for(const s of e)s.states.state===r);await this.notifyBuildPhase(a,r,n),this.currentState=r}onBuildPhase(e,r){return this.buildPhaseListeners.add(e,r),Ff.create(()=>{this.buildPhaseListeners.delete(e,r)})}onDocumentPhase(e,r){return this.documentPhaseListeners.add(e,r),Ff.create(()=>{this.documentPhaseListeners.delete(e,r)})}waitUntil(e,r,n){let i;return r&&"path"in r?i=r:n=r,n??(n=_n.CancellationToken.None),i?this.awaitDocumentState(e,i,n):this.awaitBuilderState(e,n)}awaitDocumentState(e,r,n){const i=this.langiumDocuments.getDocument(r);if(i){if(i.state>=e)return Promise.resolve(r);if(n.isCancellationRequested)return Promise.reject(Jl);if(this.currentState>=e&&e>i.state)return Promise.reject(new PE.ResponseError(PE.LSPErrorCodes.RequestFailed,`Document state of ${r.toString()} is ${zr[i.state]}, requiring ${zr[e]}, but workspace state is already ${zr[this.currentState]}. Returning undefined.`))}else return Promise.reject(new PE.ResponseError(PE.LSPErrorCodes.ServerCancelled,`No document found for URI: ${r.toString()}`));return new Promise((a,s)=>{const o=this.onDocumentPhase(e,u=>{ls.equals(u.uri,r)&&(o.dispose(),l.dispose(),a(u.uri))}),l=n.onCancellationRequested(()=>{o.dispose(),l.dispose(),s(Jl)})})}awaitBuilderState(e,r){return this.currentState>=e?Promise.resolve():r.isCancellationRequested?Promise.reject(Jl):new Promise((n,i)=>{const a=this.onBuildPhase(e,()=>{a.dispose(),s.dispose(),n()}),s=r.onCancellationRequested(()=>{a.dispose(),s.dispose(),i(Jl)})})}async notifyDocumentPhase(e,r,n){const a=this.documentPhaseListeners.get(r).slice();for(const s of a)try{await ra(n),await s(e,n)}catch(o){if(!$f(o))throw o}}async notifyBuildPhase(e,r,n){if(e.length===0)return;const a=this.buildPhaseListeners.get(r).slice();for(const s of a)await ra(n),await s(e,n)}shouldLink(e){return this.getBuildOptions(e).eagerLinking??!0}shouldValidate(e){return!!this.getBuildOptions(e).validation}async validate(e,r){const n=this.serviceRegistry.getServices(e.uri).validation.DocumentValidator,i=this.getBuildOptions(e),a=typeof i.validation=="object"?{...i.validation}:{};a.categories=this.findMissingValidationCategories(e,i);const s=await n.validateDocument(e,a,r);e.diagnostics?e.diagnostics.push(...s):e.diagnostics=s;const o=this.buildState.get(e.uri.toString());o&&(o.result??(o.result={}),o.result.validationChecks?o.result.validationChecks=pn(o.result.validationChecks).concat(a.categories).distinct().toArray():o.result.validationChecks=[...a.categories])}getBuildOptions(e){var r;return((r=this.buildState.get(e.uri.toString()))==null?void 0:r.options)??{}}},E(Ry,"DefaultDocumentBuilder"),Ry),Ife=(Ly=class{constructor(e){this.symbolIndex=new Map,this.symbolByTypeIndex=new NE,this.referenceIndex=new Map,this.documents=e.workspace.LangiumDocuments,this.serviceRegistry=e.ServiceRegistry,this.astReflection=e.AstReflection}findAllReferences(e,r){const n=qo(e).uri,i=[];return this.referenceIndex.forEach(a=>{a.forEach(s=>{ls.equals(s.targetUri,n)&&s.targetPath===r&&i.push(s)})}),pn(i)}allElements(e,r){let n=pn(this.symbolIndex.keys());return r&&(n=n.filter(i=>!r||r.has(i))),n.map(i=>this.getFileDescriptions(i,e)).flat()}getFileDescriptions(e,r){return r?this.symbolByTypeIndex.get(e,r,()=>(this.symbolIndex.get(e)??[]).filter(a=>this.astReflection.isSubtype(a.type,r))):this.symbolIndex.get(e)??[]}remove(e){this.removeContent(e),this.removeReferences(e)}removeContent(e){const r=e.toString();this.symbolIndex.delete(r),this.symbolByTypeIndex.clear(r)}removeReferences(e){const r=e.toString();this.referenceIndex.delete(r)}async updateContent(e,r=_n.CancellationToken.None){const i=await this.serviceRegistry.getServices(e.uri).references.ScopeComputation.collectExportedSymbols(e,r),a=e.uri.toString();this.symbolIndex.set(a,i),this.symbolByTypeIndex.clear(a)}async updateReferences(e,r=_n.CancellationToken.None){const i=await this.serviceRegistry.getServices(e.uri).workspace.ReferenceDescriptionProvider.createDescriptions(e,r);this.referenceIndex.set(e.uri.toString(),i)}isAffected(e,r){const n=this.referenceIndex.get(e.uri.toString());return n?n.some(i=>!i.local&&r.has(i.targetUri.toString())):!1}},E(Ly,"DefaultIndexManager"),Ly),Dfe=(Iy=class{constructor(e){this.initialBuildOptions={},this._ready=new au,this.serviceRegistry=e.ServiceRegistry,this.langiumDocuments=e.workspace.LangiumDocuments,this.documentBuilder=e.workspace.DocumentBuilder,this.fileSystemProvider=e.workspace.FileSystemProvider,this.mutex=e.workspace.WorkspaceLock}get ready(){return this._ready.promise}get workspaceFolders(){return this.folders}initialize(e){this.folders=e.workspaceFolders??void 0}initialized(e){return this.mutex.write(r=>this.initializeWorkspace(this.folders??[],r))}async initializeWorkspace(e,r=_n.CancellationToken.None){const n=await this.performStartup(e);await ra(r),await this.documentBuilder.build(n,this.initialBuildOptions,r)}async performStartup(e){const r=[],n=E(s=>{r.push(s),this.langiumDocuments.hasDocument(s.uri)||this.langiumDocuments.addDocument(s)},"collector");await this.loadAdditionalDocuments(e,n);const i=[];await Promise.all(e.map(s=>this.getRootFolder(s)).map(async s=>this.traverseFolder(s,i)));const a=pn(i).distinct(s=>s.toString()).filter(s=>!this.langiumDocuments.hasDocument(s));return await this.loadWorkspaceDocuments(a,n),this._ready.resolve(),r}async loadWorkspaceDocuments(e,r){await Promise.all(e.map(async n=>{const i=await this.langiumDocuments.getOrCreateDocument(n);r(i)}))}loadAdditionalDocuments(e,r){return Promise.resolve()}getRootFolder(e){return eo.parse(e.uri)}async traverseFolder(e,r){try{const n=await this.fileSystemProvider.readDirectory(e);await Promise.all(n.map(async i=>{this.shouldIncludeEntry(i)&&(i.isDirectory?await this.traverseFolder(i.uri,r):i.isFile&&r.push(i.uri))}))}catch(n){console.error("Failure to read directory content of "+e.toString(!0),n)}}async searchFolder(e){const r=[];return await this.traverseFolder(e,r),r}shouldIncludeEntry(e){const r=ls.basename(e.uri);return r.startsWith(".")?!1:e.isDirectory?r!=="node_modules"&&r!=="out":e.isFile?this.serviceRegistry.hasServices(e.uri):!1}},E(Iy,"DefaultWorkspaceManager"),Iy),Mfe=(Dy=class{buildUnexpectedCharactersMessage(e,r,n,i,a){return yM.buildUnexpectedCharactersMessage(e,r,n,i,a)}buildUnableToPopLexerModeMessage(e){return yM.buildUnableToPopLexerModeMessage(e)}},E(Dy,"DefaultLexerErrorMessageProvider"),Dy),FN={mode:"full"},zN=(My=class{constructor(e){this.errorMessageProvider=e.parser.LexerErrorMessageProvider,this.tokenBuilder=e.parser.TokenBuilder;const r=this.tokenBuilder.buildTokens(e.Grammar,{caseInsensitive:e.LanguageMetaData.caseInsensitive});this.tokenTypes=this.toTokenTypeDictionary(r);const n=zE(r)?Object.values(r):r,i=e.LanguageMetaData.mode==="production";this.chevrotainLexer=new as(n,{positionTracking:"full",skipValidations:i,errorMessageProvider:this.errorMessageProvider})}get definition(){return this.tokenTypes}tokenize(e,r=FN){var i,a;const n=this.chevrotainLexer.tokenize(e);return{tokens:n.tokens,errors:n.errors,hidden:n.groups.hidden??[],report:(a=(i=this.tokenBuilder).flushLexingReport)==null?void 0:a.call(i,e)}}toTokenTypeDictionary(e){if(zE(e))return e;const r=FE(e)?Object.values(e.modes).flat():e,n={};return r.forEach(i=>n[i.name]=i),n}},E(My,"DefaultLexer"),My);function BE(t){return Array.isArray(t)&&(t.length===0||"name"in t[0])}E(BE,"isTokenTypeArray");function FE(t){return t&&"modes"in t&&"defaultMode"in t}E(FE,"isIMultiModeLexerDefinition");function zE(t){return!BE(t)&&!FE(t)}E(zE,"isTokenTypeDictionary"),kx();function GN(t,e,r){let n,i;typeof t=="string"?(i=e,n=r):(i=t.range.start,n=e),i||(i=sn.create(0,0));const a=VN(t),s=qE(n),o=Ofe({lines:a,position:i,options:s});return Bfe({index:0,tokens:o,position:i})}E(GN,"parseJSDoc");function qN(t,e){const r=qE(e),n=VN(t);if(n.length===0)return!1;const i=n[0],a=n[n.length-1],s=r.start,o=r.end;return!!(s!=null&&s.exec(i))&&!!(o!=null&&o.exec(a))}E(qN,"isJSDoc");function VN(t){let e="";return typeof t=="string"?e=t:e=t.text,e.split(vre)}E(VN,"getLines");var Nfe=/\s*(@([\p{L}][\p{L}\p{N}]*)?)/uy,ynt=/\{(@[\p{L}][\p{L}\p{N}]*)(\s*)([^\r\n}]+)?\}/gu;function Ofe(t){var i,a,s;const e=[];let r=t.position.line,n=t.position.character;for(let o=0;o=h.length){if(e.length>0){const p=sn.create(r,n);e.push({type:"break",content:"",range:Ur.create(p,p)})}}else{Nfe.lastIndex=d;const p=Nfe.exec(h);if(p){const g=p[0],m=p[1],y=sn.create(r,n+d),v=sn.create(r,n+d+g.length);e.push({type:"tag",content:m,range:Ur.create(y,v)}),d+=g.length,d=GE(h,d)}if(d0&&e[e.length-1].type==="break"?e.slice(0,-1):e}E(Ofe,"tokenize");function $fe(t,e,r,n){const i=[];if(t.length===0){const a=sn.create(r,n),s=sn.create(r,n+e.length);i.push({type:"text",content:e,range:Ur.create(a,s)})}else{let a=0;for(const o of t){const l=o.index,u=e.substring(a,l);u.length>0&&i.push({type:"text",content:e.substring(a,l),range:Ur.create(sn.create(r,a+n),sn.create(r,l+n))});let h=u.length+1;const d=o[1];if(i.push({type:"inline-tag",content:d,range:Ur.create(sn.create(r,a+h+n),sn.create(r,a+h+d.length+n))}),h+=d.length,o.length===4){h+=o[2].length;const f=o[3];i.push({type:"text",content:f,range:Ur.create(sn.create(r,a+h+n),sn.create(r,a+h+f.length+n))})}else i.push({type:"text",content:"",range:Ur.create(sn.create(r,a+h+n),sn.create(r,a+h+n))});a=l+o[0].length}const s=e.substring(a);s.length>0&&i.push({type:"text",content:s,range:Ur.create(sn.create(r,a+n),sn.create(r,a+n+s.length))})}return i}E($fe,"buildInlineTokens");var vnt=/\S/,bnt=/\s*$/;function GE(t,e){const r=t.substring(e).match(vnt);return r?e+r.index:t.length}E(GE,"skipWhitespace");function Pfe(t){const e=t.match(bnt);if(e&&typeof e.index=="number")return e.index}E(Pfe,"lastCharacter");function Bfe(t){var a,s;const e=sn.create(t.position.line,t.position.character);if(t.tokens.length===0)return new qfe([],Ur.create(e,e));const r=[];for(;t.indexr.name===e)}getTags(e){return this.getAllTags().filter(r=>r.name===e)}getAllTags(){return this.elements.filter(e=>"name"in e)}toString(){let e="";for(const r of this.elements)if(e.length===0)e=r.toString();else{const n=r.toString();e+=KN(e)+n}return e.trim()}toMarkdown(e){let r="";for(const n of this.elements)if(r.length===0)r=n.toMarkdown(e);else{const i=n.toMarkdown(e);r+=KN(r)+i}return r.trim()}},E(Ny,"JSDocCommentImpl"),Ny),YN=(Oy=class{constructor(e,r,n,i){this.name=e,this.content=r,this.inline=n,this.range=i}toString(){let e=`@${this.name}`;const r=this.content.toString();return this.content.inlines.length===1?e=`${e} ${r}`:this.content.inlines.length>1&&(e=`${e} -${r}`),this.inline?`{${e}}`:e}toMarkdown(e){var r;return((r=e==null?void 0:e.renderTag)==null?void 0:r.call(e,this))??this.toMarkdownDefault(e)}toMarkdownDefault(e){const r=this.content.toMarkdown(e);if(this.inline){const a=Vfe(this.name,r,e??{});if(typeof a=="string")return a}let n="";(e==null?void 0:e.tag)==="italic"||(e==null?void 0:e.tag)===void 0?n="*":(e==null?void 0:e.tag)==="bold"?n="**":(e==null?void 0:e.tag)==="bold-italic"&&(n="***");let i=`${n}@${this.name}${n}`;return this.content.inlines.length===1?i=`${i} — ${r}`:this.content.inlines.length>1&&(i=`${i} -${r}`),this.inline?`{${i}}`:i}},E(Oy,"JSDocTagImpl"),Oy);function Vfe(t,e,r){var n;if(t==="linkplain"||t==="linkcode"||t==="link"){const i=e.indexOf(" ");let a=e;if(i>0){const o=GE(e,i);a=e.substring(o),e=e.substring(0,i)}return(t==="linkcode"||t==="link"&&r.link==="code")&&(a=`\`${a}\``),((n=r.renderLink)==null?void 0:n.call(r,e,a))??Wfe(e,a)}}E(Vfe,"renderInlineTag");function Wfe(t,e){try{return eo.parse(t,!0),`[${e}](${t})`}catch{return t}}E(Wfe,"renderLinkDefault");var XN=($y=class{constructor(e,r){this.inlines=e,this.range=r}toString(){let e="";for(let r=0;rn.range.start.line&&(e+=` +For Further details.`,n}E(Yye,"buildAmbiguityError");function Xye(t){if(t instanceof Ns)return"SUBRULE";if(t instanceof Va)return"OPTION";if(t instanceof oo)return"OR";if(t instanceof No)return"AT_LEAST_ONE";if(t instanceof $o)return"AT_LEAST_ONE_SEP";if(t instanceof so)return"MANY_SEP";if(t instanceof Si)return"MANY";if(t instanceof ri)return"CONSUME";throw Error("non exhaustive match")}E(Xye,"getProductionDslName");function jye(t,e,r){const n=_dt(e.configs.elements,a=>a.state.transitions),i=zdt(n.filter(a=>a instanceof DB).map(a=>a.tokenType),a=>a.tokenTypeIdx);return{actualToken:r,possibleTokenTypes:i,tokenPath:t}}E(jye,"buildAdaptivePredictError");function Kye(t,e){return t.edges[e.tokenTypeIdx]}E(Kye,"getExistingTargetState");function Zye(t,e,r){const n=new PB,i=[];for(const s of t.elements){if(r.is(s.alt)===!1)continue;if(s.state.type===DC){i.push(s);continue}const o=s.state.transitions.length;for(let l=0;l0&&!rve(a))for(const s of i)a.add(s);return a}E(Zye,"computeReachSet");function Qye(t,e){if(t instanceof DB&&XP(e,t.tokenType))return t.target}E(Qye,"getReachableTarget");function Jye(t,e){let r;for(const n of t.elements)if(e.is(n.alt)===!0){if(r===void 0)r=n.alt;else if(r!==n.alt)return}return r}E(Jye,"getUniqueAlt");function qB(t){return{configs:t,edges:{},isAcceptState:!1,prediction:-1}}E(qB,"newDFAState");function VB(t,e,r,n){return n=WB(t,n),e.edges[r.tokenTypeIdx]=n,n}E(VB,"addDFAEdge");function WB(t,e){if(e===m6)return e;const r=e.configs.key,n=t.states[r];return n!==void 0?n:(e.configs.finalize(),t.states[r]=e,e)}E(WB,"addDFAState");function eve(t){const e=new PB,r=t.transitions.length;for(let n=0;n0){const i=[...t.stack],s={state:i.pop(),alt:t.alt,stack:i};MC(s,e)}else e.add(t);return}r.epsilonOnlyTransitions||e.add(t);const n=r.transitions.length;for(let i=0;i1)return!0;return!1}E(sve,"hasConflictingAltSet");function ove(t){for(const e of Array.from(t.values()))if(Object.keys(e).length===1)return!0;return!1}E(ove,"hasStateAssociatedWithOneAlt"),Iw();var lve=(Tv=class{constructor(){this.nodeStack=[]}get current(){return this.nodeStack[this.nodeStack.length-1]??this.rootNode}buildRootNode(e){return this.rootNode=new HB(e),this.rootNode.root=this.rootNode,this.nodeStack=[this.rootNode],this.rootNode}buildCompositeNode(e){const r=new b6;return r.grammarSource=e,r.root=this.rootNode,this.current.content.push(r),this.nodeStack.push(r),r}buildLeafNode(e,r){const n=new v6(e.startOffset,e.image.length,Uw(e),e.tokenType,!r);return n.grammarSource=r,n.root=this.rootNode,this.current.content.push(n),n}removeNode(e){const r=e.container;if(r){const n=r.content.indexOf(e);n>=0&&r.content.splice(n,1)}}addHiddenNodes(e){const r=[];for(const a of e){const s=new v6(a.startOffset,a.image.length,Uw(a),a.tokenType,!0);s.root=this.rootNode,r.push(s)}let n=this.current,i=!1;if(n.content.length>0){n.content.push(...r);return}for(;n.container;){const a=n.container.content.indexOf(n);if(a>0){n.container.content.splice(a,0,...r),i=!0;break}n=n.container}i||this.rootNode.content.unshift(...r)}construct(e){const r=this.current;typeof e.$type=="string"&&!e.$infix&&(this.current.astNode=e),e.$cstNode=r;const n=this.nodeStack.pop();(n==null?void 0:n.content.length)===0&&this.removeNode(n)}},E(Tv,"CstNodeBuilder"),Tv),UB=(wv=class{get hidden(){return!1}get astNode(){var r,n;const e=typeof((r=this._astNode)==null?void 0:r.$type)=="string"?this._astNode:(n=this.container)==null?void 0:n.astNode;if(!e)throw new Error("This node has no associated AST element");return e}set astNode(e){this._astNode=e}get text(){return this.root.fullText.substring(this.offset,this.end)}},E(wv,"AbstractCstNode"),wv),v6=(Cv=class extends UB{get offset(){return this._offset}get length(){return this._length}get end(){return this._offset+this._length}get hidden(){return this._hidden}get tokenType(){return this._tokenType}get range(){return this._range}constructor(e,r,n,i,a=!1){super(),this._hidden=a,this._offset=e,this._tokenType=i,this._length=r,this._range=n}},E(Cv,"LeafCstNodeImpl"),Cv),b6=(kv=class extends UB{constructor(){super(...arguments),this.content=new Qdt(this)}get offset(){var e;return((e=this.firstNonHiddenNode)==null?void 0:e.offset)??0}get length(){return this.end-this.offset}get end(){var e;return((e=this.lastNonHiddenNode)==null?void 0:e.end)??0}get range(){const e=this.firstNonHiddenNode,r=this.lastNonHiddenNode;if(e&&r){if(this._rangeCache===void 0){const{range:n}=e,{range:i}=r;this._rangeCache={start:n.start,end:i.end.line=0;e--){const r=this.content[e];if(!r.hidden)return r}return this.content[this.content.length-1]}},E(kv,"CompositeCstNodeImpl"),kv),Qdt=(E0=class extends Array{constructor(e){super(),this.parent=e,Object.setPrototypeOf(this,E0.prototype)}push(...e){return this.addParents(e),super.push(...e)}unshift(...e){return this.addParents(e),super.unshift(...e)}splice(e,r,...n){return this.addParents(n),super.splice(e,r,...n)}addParents(e){for(const r of e)r.container=this.parent}},E(E0,"CstNodeContainer"),E0),HB=(Ev=class extends b6{get text(){return this._text.substring(this.offset,this.end)}get fullText(){return this._text}constructor(e){super(),this._text="",this._text=e??""}},E(Ev,"RootCstNodeImpl"),Ev),x6=Symbol("Datatype");function T6(t){return t.$type===x6}E(T6,"isDataTypeNode");var cve="​",uve=E(t=>t.endsWith(cve)?t:t+cve,"withRuleSuffix"),YB=(Sv=class{constructor(e){var i;this._unorderedGroups=new Map,this.allRules=new Map,this.lexer=e.parser.Lexer;const r=this.lexer.definition,n=e.LanguageMetaData.mode==="production";(i=e.shared.profilers.LangiumProfiler)!=null&&i.isActive("parsing")?this.wrapper=new eft(r,{...e.parser.ParserConfig,skipValidations:n,errorMessageProvider:e.parser.ParserErrorMessageProvider},e.shared.profilers.LangiumProfiler.createTask("parsing",e.LanguageMetaData.languageId)):this.wrapper=new pve(r,{...e.parser.ParserConfig,skipValidations:n,errorMessageProvider:e.parser.ParserErrorMessageProvider})}alternatives(e,r){this.wrapper.wrapOr(e,r)}optional(e,r){this.wrapper.wrapOption(e,r)}many(e,r){this.wrapper.wrapMany(e,r)}atLeastOne(e,r){this.wrapper.wrapAtLeastOne(e,r)}getRule(e){return this.allRules.get(e)}isRecording(){return this.wrapper.IS_RECORDING}get unorderedGroups(){return this._unorderedGroups}getRuleStack(){return this.wrapper.RULE_STACK}finalize(){this.wrapper.wrapSelfAnalysis()}},E(Sv,"AbstractLangiumParser"),Sv),hve=(_v=class extends YB{get current(){return this.stack[this.stack.length-1]}constructor(e){super(e),this.nodeBuilder=new lve,this.stack=[],this.assignmentMap=new Map,this.operatorPrecedence=new Map,this.linker=e.references.Linker,this.converter=e.parser.ValueConverter,this.astReflection=e.shared.AstReflection}rule(e,r){const n=this.computeRuleType(e);let i;zm(e)&&(i=e.name,this.registerPrecedenceMap(e));const a=this.wrapper.DEFINE_RULE(uve(e.name),this.startImplementation(n,i,r).bind(this));return this.allRules.set(e.name,a),Ds(e)&&e.entry&&(this.mainRule=a),a}registerPrecedenceMap(e){const r=e.name,n=new Map;for(let i=0;i0&&(r=this.construct()),r===void 0)throw new Error("No result from parser");if(this.stack.length>0)throw new Error("Parser stack is not empty after parsing");return r}startImplementation(e,r,n){return i=>{const a=!this.isRecording()&&e!==void 0;if(a){const s={$type:e};this.stack.push(s),e===x6?s.value="":r!==void 0&&(s.$infixName=r)}return n(i),a?this.construct():void 0}}extractHiddenTokens(e){const r=this.lexerResult.hidden;if(!r.length)return[];const n=e.startOffset;for(let i=0;in)return r.splice(0,i);return r.splice(0,r.length)}consume(e,r,n){const i=this.wrapper.wrapConsume(e,r);if(!this.isRecording()&&this.isValidToken(i)){const a=this.extractHiddenTokens(i);this.nodeBuilder.addHiddenNodes(a);const s=this.nodeBuilder.buildLeafNode(i,n),{assignment:o,crossRef:l}=this.getAssignment(n),u=this.current;if(o){const h=Yu(n)?i.image:this.converter.convert(i.image,s);this.assign(o.operator,o.feature,h,s,l)}else if(T6(u)){let h=i.image;Yu(n)||(h=this.converter.convert(h,s).toString()),u.value+=h}}}isValidToken(e){return!e.isInsertedInRecovery&&!isNaN(e.startOffset)&&typeof e.endOffset=="number"&&!isNaN(e.endOffset)}subrule(e,r,n,i,a){let s;!this.isRecording()&&!n&&(s=this.nodeBuilder.buildCompositeNode(i));let o;try{o=this.wrapper.wrapSubrule(e,r,a)}finally{this.isRecording()||(o===void 0&&!n&&(o=this.construct()),o!==void 0&&s&&s.length>0&&this.performSubruleAssignment(o,i,s))}}performSubruleAssignment(e,r,n){const{assignment:i,crossRef:a}=this.getAssignment(r);if(i)this.assign(i.operator,i.feature,e,n,a);else if(!i){const s=this.current;if(T6(s))s.value+=e.toString();else if(typeof e=="object"&&e){const l=this.assignWithoutOverride(e,s);this.stack.pop(),this.stack.push(l)}}}action(e,r){if(!this.isRecording()){let n=this.current;if(r.feature&&r.operator){n=this.construct(),this.nodeBuilder.removeNode(n.$cstNode),this.nodeBuilder.buildCompositeNode(r).content.push(n.$cstNode);const a={$type:e};this.stack.push(a),this.assign(r.operator,r.feature,n,n.$cstNode)}else n.$type=e}}construct(){if(this.isRecording())return;const e=this.stack.pop();return this.nodeBuilder.construct(e),"$infixName"in e?this.constructInfix(e,this.operatorPrecedence.get(e.$infixName)):T6(e)?this.converter.convert(e.value,e.$cstNode):(cO(this.astReflection,e),e)}constructInfix(e,r){const n=e.parts;if(!Array.isArray(n)||n.length===0)return;const i=e.operators;if(!Array.isArray(i)||n.length<2)return n[0];let a=0,s=-1;for(let m=0;ms?(s=v.precedence,a=m):v.precedence===s&&(v.rightAssoc||(a=m))}const o=i.slice(0,a),l=i.slice(a+1),u=n.slice(0,a+1),h=n.slice(a+1),d={$infixName:e.$infixName,$type:e.$type,$cstNode:e.$cstNode,parts:u,operators:o},f={$infixName:e.$infixName,$type:e.$type,$cstNode:e.$cstNode,parts:h,operators:l},p=this.constructInfix(d,r),g=this.constructInfix(f,r);return{$type:e.$type,$cstNode:e.$cstNode,left:p,operator:i[a],right:g}}getAssignment(e){if(!this.assignmentMap.has(e)){const r=fp(e,Uu);this.assignmentMap.set(e,{assignment:r,crossRef:r&&gp(r.terminal)?r.terminal.isMulti?"multi":"single":void 0})}return this.assignmentMap.get(e)}assign(e,r,n,i,a){const s=this.current;let o;switch(a==="single"&&typeof n=="string"?o=this.linker.buildReference(s,r,i,n):a==="multi"&&typeof n=="string"?o=this.linker.buildMultiReference(s,r,i,n):o=n,e){case"=":{s[r]=o;break}case"?=":{s[r]=!0;break}case"+=":Array.isArray(s[r])||(s[r]=[]),s[r].push(o)}}assignWithoutOverride(e,r){for(const[i,a]of Object.entries(r)){const s=e[i];s===void 0?e[i]=a:Array.isArray(s)&&Array.isArray(a)&&(a.push(...s),e[i]=a)}const n=e.$cstNode;return n&&(n.astNode=void 0,e.$cstNode=void 0),e}get definitionErrors(){return this.wrapper.definitionErrors}},E(_v,"LangiumParser"),_v),dve=(Av=class{buildMismatchTokenMessage(e){return s1.buildMismatchTokenMessage(e)}buildNotAllInputParsedMessage(e){return s1.buildNotAllInputParsedMessage(e)}buildNoViableAltMessage(e){return s1.buildNoViableAltMessage(e)}buildEarlyExitMessage(e){return s1.buildEarlyExitMessage(e)}},E(Av,"AbstractParserErrorMessageProvider"),Av),XB=(Rv=class extends dve{buildMismatchTokenMessage({expected:e,actual:r}){return`Expecting ${e.LABEL?"`"+e.LABEL+"`":e.name.endsWith(":KW")?`keyword '${e.name.substring(0,e.name.length-3)}'`:`token of type '${e.name}'`} but found \`${r.image}\`.`}buildNotAllInputParsedMessage({firstRedundant:e}){return`Expecting end of file but found \`${e.image}\`.`}},E(Rv,"LangiumParserErrorMessageProvider"),Rv),fve=(Lv=class extends YB{constructor(){super(...arguments),this.tokens=[],this.elementStack=[],this.lastElementStack=[],this.nextTokenIndex=0,this.stackSize=0}action(){}construct(){}parse(e){this.resetState();const r=this.lexer.tokenize(e,{mode:"partial"});return this.tokens=r.tokens,this.wrapper.input=[...this.tokens],this.mainRule.call(this.wrapper,{}),this.unorderedGroups.clear(),{tokens:this.tokens,elementStack:[...this.lastElementStack],tokenIndex:this.nextTokenIndex}}rule(e,r){const n=this.wrapper.DEFINE_RULE(uve(e.name),this.startImplementation(r).bind(this));return this.allRules.set(e.name,n),e.entry&&(this.mainRule=n),n}resetState(){this.elementStack=[],this.lastElementStack=[],this.nextTokenIndex=0,this.stackSize=0}startImplementation(e){return r=>{const n=this.keepStackSize();try{e(r)}finally{this.resetStackSize(n)}}}removeUnexpectedElements(){this.elementStack.splice(this.stackSize)}keepStackSize(){const e=this.elementStack.length;return this.stackSize=e,e}resetStackSize(e){this.removeUnexpectedElements(),this.stackSize=e}consume(e,r,n){this.wrapper.wrapConsume(e,r),this.isRecording()||(this.lastElementStack=[...this.elementStack,n],this.nextTokenIndex=this.currIdx+1)}subrule(e,r,n,i,a){this.before(i),this.wrapper.wrapSubrule(e,r,a),this.after(i)}before(e){this.isRecording()||this.elementStack.push(e)}after(e){if(!this.isRecording()){const r=this.elementStack.lastIndexOf(e);r>=0&&this.elementStack.splice(r)}}get currIdx(){return this.wrapper.currIdx}},E(Lv,"LangiumCompletionParser"),Lv),Jdt={recoveryEnabled:!0,nodeLocationTracking:"full",skipValidations:!0,errorMessageProvider:new XB},pve=(Iv=class extends Flt{constructor(e,r){const n=r&&"maxLookahead"in r;super(e,{...Jdt,lookaheadStrategy:n?new oB({maxLookahead:r.maxLookahead}):new Zdt({logging:r.skipValidations?()=>{}:void 0}),...r})}get IS_RECORDING(){return this.RECORDING_PHASE}DEFINE_RULE(e,r,n){return this.RULE(e,r,n)}wrapSelfAnalysis(){this.performSelfAnalysis()}wrapConsume(e,r){return this.consume(e,r,void 0)}wrapSubrule(e,r,n){return this.subrule(e,r,{ARGS:[n]})}wrapOr(e,r){this.or(e,r)}wrapOption(e,r){this.option(e,r)}wrapMany(e,r){this.many(e,r)}wrapAtLeastOne(e,r){this.atLeastOne(e,r)}rule(e){return e.call(this,{})}},E(Iv,"ChevrotainWrapper"),Iv),eft=(Dv=class extends pve{constructor(e,r,n){super(e,r),this.task=n}rule(e){this.task.start(),this.task.startSubTask(this.ruleName(e));try{return super.rule(e)}finally{this.task.stopSubTask(this.ruleName(e)),this.task.stop()}}ruleName(e){return e.ruleName}subrule(e,r,n){this.task.startSubTask(this.ruleName(r));try{return super.subrule(e,r,n)}finally{this.task.stopSubTask(this.ruleName(r))}}},E(Dv,"ProfilerWrapper"),Dv);function w6(t,e,r){return gve({parser:e,tokens:r,ruleNames:new Map},t),e}E(w6,"createParser");function gve(t,e){const r=l_(e,!1),n=En(e.rules).filter(Ds).filter(a=>r.has(a));for(const a of n){const s={...t,consume:1,optional:1,subrule:1,many:1,or:1};t.parser.rule(a,Rd(s,a.definition))}const i=En(e.rules).filter(zm).filter(a=>r.has(a));for(const a of i)t.parser.rule(a,mve(t,a))}E(gve,"buildRules");function mve(t,e){const r=e.call.rule.ref;if(!r)throw new Error("Could not resolve reference to infix operator rule: "+e.call.rule.$refText);if(rl(r))throw new Error("Cannot use terminal rule in infix expression");const n=e.operators.precedences.flatMap(p=>p.operators),i={$type:"Group",elements:[]},a={$container:i,$type:"Assignment",feature:"parts",operator:"+=",terminal:e.call},s={$container:i,$type:"Group",elements:[],cardinality:"*"};i.elements.push(a,s);const l={$container:s,$type:"Assignment",feature:"operators",operator:"+=",terminal:{$type:"Alternatives",elements:n}},u={...a,$container:s};s.elements.push(l,u);const d=n.map(p=>t.tokens[p.value]).map((p,g)=>({ALT:E(()=>t.parser.consume(g,p,l),"ALT")}));let f;return p=>{f??(f=C6(t,r)),t.parser.subrule(0,f,!1,a,p),t.parser.many(0,{DEF:E(()=>{t.parser.alternatives(0,d),t.parser.subrule(1,f,!1,u,p)},"DEF")})}}E(mve,"buildInfixRule");function Rd(t,e,r=!1){let n;if(Yu(e))n=Cve(t,e);else if(yd(e))n=yve(t,e);else if(Uu(e))n=Rd(t,e.terminal);else if(gp(e))n=jB(t,e);else if(Xu(e))n=vve(t,e);else if($S(e))n=xve(t,e);else if(QS(e))n=Tve(t,e);else if(yp(e))n=wve(t,e);else if(mO(e)){const i=t.consume++;n=E(()=>t.parser.consume(i,Ed,e),"method")}else throw new t_(e.$cstNode,`Unexpected element type: ${e.$type}`);return KB(t,r?void 0:NC(e),n,e.cardinality)}E(Rd,"buildElement");function yve(t,e){const r=Lp(e);return()=>t.parser.action(r,e)}E(yve,"buildAction");function vve(t,e){const r=e.rule.ref;if(pp(r)){const n=t.subrule++,i=Ds(r)&&r.fragment,a=e.arguments.length>0?bve(r,e.arguments):()=>({});let s;return o=>{s??(s=C6(t,r)),t.parser.subrule(n,s,i,e,a(o))}}else if(rl(r)){const n=t.consume++,i=k6(t,r.name);return()=>t.parser.consume(n,i,e)}else if(r)wd();else throw new t_(e.$cstNode,`Undefined rule: ${e.rule.$refText}`)}E(vve,"buildRuleCall");function bve(t,e){if(e.some(n=>n.calledByName)){const n=e.map(i=>{var a,s;return{parameterName:(s=(a=i.parameter)==null?void 0:a.ref)==null?void 0:s.name,predicate:Pl(i.value)}});return i=>{const a={};for(const{parameterName:s,predicate:o}of n)s&&(a[s]=o(i));return a}}else{const n=e.map(i=>Pl(i.value));return i=>{const a={};for(let s=0;se(n)||r(n)}else if(pO(t)){const e=Pl(t.left),r=Pl(t.right);return n=>e(n)&&r(n)}else if(bO(t)){const e=Pl(t.value);return r=>!e(r)}else if(xO(t)){const e=t.parameter.ref.name;return r=>r!==void 0&&r[e]===!0}else if(dO(t)){const e=!!t.true;return()=>e}wd()}E(Pl,"buildPredicate");function xve(t,e){if(e.elements.length===1)return Rd(t,e.elements[0]);{const r=[];for(const i of e.elements){const a={ALT:Rd(t,i,!0)},s=NC(i);s&&(a.GATE=Pl(s)),r.push(a)}const n=t.or++;return i=>t.parser.alternatives(n,r.map(a=>{const s={ALT:E(()=>a.ALT(i),"ALT")},o=a.GATE;return o&&(s.GATE=()=>o(i)),s}))}}E(xve,"buildAlternatives");function Tve(t,e){if(e.elements.length===1)return Rd(t,e.elements[0]);const r=[];for(const o of e.elements){const l={ALT:Rd(t,o,!0)},u=NC(o);u&&(l.GATE=Pl(u)),r.push(l)}const n=t.or++,i=E((o,l)=>{const u=l.getRuleStack().join("-");return`uGroup_${o}_${u}`},"idFunc"),a=E(o=>t.parser.alternatives(n,r.map((l,u)=>{const h={ALT:E(()=>!0,"ALT")},d=t.parser;h.ALT=()=>{if(l.ALT(o),!d.isRecording()){const p=i(n,d);d.unorderedGroups.get(p)||d.unorderedGroups.set(p,[]);const g=d.unorderedGroups.get(p);typeof(g==null?void 0:g[u])>"u"&&(g[u]=!0)}};const f=l.GATE;return f?h.GATE=()=>f(o):h.GATE=()=>{const p=d.unorderedGroups.get(i(n,d));return!(p!=null&&p[u])},h})),"alternatives"),s=KB(t,NC(e),a,"*");return o=>{s(o),t.parser.isRecording()||t.parser.unorderedGroups.delete(i(n,t.parser))}}E(Tve,"buildUnorderedGroup");function wve(t,e){const r=e.elements.map(n=>Rd(t,n));return n=>r.forEach(i=>i(n))}E(wve,"buildGroup");function NC(t){if(yp(t))return t.guardCondition}E(NC,"getGuardCondition");function jB(t,e,r=e.terminal){if(r)if(Xu(r)&&Ds(r.rule.ref)){const n=r.rule.ref,i=t.subrule++;let a;return s=>{a??(a=C6(t,n)),t.parser.subrule(i,a,!1,e,s)}}else if(Xu(r)&&rl(r.rule.ref)){const n=t.consume++,i=k6(t,r.rule.ref.name);return()=>t.parser.consume(n,i,e)}else if(Yu(r)){const n=t.consume++,i=k6(t,r.value);return()=>t.parser.consume(n,i,e)}else throw new Error("Could not build cross reference parser");else{if(!e.type.ref)throw new Error("Could not resolve reference to type: "+e.type.$refText);const n=d_(e.type.ref),i=n==null?void 0:n.terminal;if(!i)throw new Error("Could not find name assignment for type: "+Lp(e.type.ref));return jB(t,e,i)}}E(jB,"buildCrossReference");function Cve(t,e){const r=t.consume++,n=t.tokens[e.value];if(!n)throw new Error("Could not find token for keyword: "+e.value);return()=>t.parser.consume(r,n,e)}E(Cve,"buildKeyword");function KB(t,e,r,n){const i=e&&Pl(e);if(!n)if(i){const a=t.or++;return s=>t.parser.alternatives(a,[{ALT:E(()=>r(s),"ALT"),GATE:E(()=>i(s),"GATE")},{ALT:fB(),GATE:E(()=>!i(s),"GATE")}])}else return r;if(n==="*"){const a=t.many++;return s=>t.parser.many(a,{DEF:E(()=>r(s),"DEF"),GATE:i?()=>i(s):void 0})}else if(n==="+"){const a=t.many++;if(i){const s=t.or++;return o=>t.parser.alternatives(s,[{ALT:E(()=>t.parser.atLeastOne(a,{DEF:E(()=>r(o),"DEF")}),"ALT"),GATE:E(()=>i(o),"GATE")},{ALT:fB(),GATE:E(()=>!i(o),"GATE")}])}else return s=>t.parser.atLeastOne(a,{DEF:E(()=>r(s),"DEF")})}else if(n==="?"){const a=t.optional++;return s=>t.parser.optional(a,{DEF:E(()=>r(s),"DEF"),GATE:i?()=>i(s):void 0})}else wd()}E(KB,"wrap");function C6(t,e){const r=kve(t,e),n=t.parser.getRule(r);if(!n)throw new Error(`Rule "${r}" not found."`);return n}E(C6,"getRule");function kve(t,e){if(pp(e))return e.name;if(t.ruleNames.has(e))return t.ruleNames.get(e);{let r=e,n=r.$container,i=e.$type;for(;!Ds(n);)(yp(n)||$S(n)||QS(n))&&(i=n.elements.indexOf(r).toString()+":"+i),r=n,n=n.$container;return i=n.name+":"+i,t.ruleNames.set(e,i),i}}E(kve,"getRuleName");function k6(t,e){const r=t.tokens[e];if(!r)throw new Error(`Token "${e}" not found."`);return r}E(k6,"getToken");function ZB(t){const e=t.Grammar,r=t.parser.Lexer,n=new fve(t);return w6(e,n,r.definition),n.finalize(),n}E(ZB,"createCompletionParser");function QB(t){const e=JB(t);return e.finalize(),e}E(QB,"createLangiumParser");function JB(t){const e=t.Grammar,r=t.parser.Lexer,n=new hve(t);return w6(e,n,r.definition)}E(JB,"prepareLangiumParser");var E6=(Mv=class{constructor(){this.diagnostics=[]}buildTokens(e,r){const n=En(l_(e,!1)),i=this.buildTerminalTokens(n),a=this.buildKeywordTokens(n,i,r);return a.push(...i),a}flushLexingReport(e){return{diagnostics:this.popDiagnostics()}}popDiagnostics(){const e=[...this.diagnostics];return this.diagnostics=[],e}buildTerminalTokens(e){return e.filter(rl).filter(r=>!r.fragment).map(r=>this.buildTerminalToken(r)).toArray()}buildTerminalToken(e){const r=Xw(e),n=this.requiresCustomPattern(r)?this.regexPatternFunction(r):r,i={name:e.name,PATTERN:n};return typeof n=="function"&&(i.LINE_BREAKS=!0),e.hidden&&(i.GROUP=o_(r)?$s.SKIPPED:"hidden"),i}requiresCustomPattern(e){return!!(e.flags.includes("u")||e.flags.includes("s"))}regexPatternFunction(e){const r=new RegExp(e,e.flags+"y");return(n,i)=>(r.lastIndex=i,r.exec(n))}buildKeywordTokens(e,r,n){return e.filter(pp).flatMap(i=>Wu(i).filter(Yu)).distinct(i=>i.value).toArray().sort((i,a)=>a.value.length-i.value.length).map(i=>this.buildKeywordToken(i,r,!!(n!=null&&n.caseInsensitive)))}buildKeywordToken(e,r,n){const i=this.buildKeywordPattern(e,n),a={name:e.value,PATTERN:i,LONGER_ALT:this.findLongerAlt(e,r)};return typeof i=="function"&&(a.LINE_BREAKS=!0),a}buildKeywordPattern(e,r){return r?new RegExp(Km(e.value),"i"):e.value}findLongerAlt(e,r){return r.reduce((n,i)=>{const a=i==null?void 0:i.PATTERN;return a!=null&&a.source&&WO("^"+a.source+"$",e.value)&&n.push(i),n},[])}},E(Mv,"DefaultTokenBuilder"),Mv),eF=(Nv=class{convert(e,r){let n=r.grammarSource;if(gp(n)&&(n=jO(n)),Xu(n)){const i=n.rule.ref;if(!i)throw new Error("This cst node was not parsed by a rule.");return this.runConverter(i,e,r)}return e}runConverter(e,r,n){var i;switch(e.name.toUpperCase()){case"INT":return Gc.convertInt(r);case"STRING":return Gc.convertString(r);case"ID":return Gc.convertID(r)}switch((i=iP(e))==null?void 0:i.toLowerCase()){case"number":return Gc.convertNumber(r);case"boolean":return Gc.convertBoolean(r);case"bigint":return Gc.convertBigint(r);case"date":return Gc.convertDate(r);default:return r}}},E(Nv,"DefaultValueConverter"),Nv),Gc;(function(t){function e(u){let h="";for(let d=1;d{typeof setImmediate>"u"?setTimeout(t,0):setImmediate(t)})}E(S6,"delayNextTick");var _6=0,Eve=10;function A6(){return _6=performance.now(),new Vn.CancellationTokenSource}E(A6,"startCancelableOperation");function tF(t){Eve=t}E(tF,"setInterruptionPeriod");var qc=Symbol("OperationCancelled");function Qp(t){return t===qc}E(Qp,"isOperationCancelled");async function Ea(t){if(t===Vn.CancellationToken.None)return;const e=performance.now();if(e-_6>=Eve&&(_6=e,await S6(),_6=performance.now()),t.isCancellationRequested)throw qc}E(Ea,"interruptAndCheck");var ih=($v=class{constructor(){this.promise=new Promise((e,r)=>{this.resolve=n=>(e(n),this),this.reject=n=>(r(n),this)})}},E($v,"Deferred"),$v),Sve=(Fd=class{constructor(e,r,n,i){this._uri=e,this._languageId=r,this._version=n,this._content=i,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(e){if(e){const r=this.offsetAt(e.start),n=this.offsetAt(e.end);return this._content.substring(r,n)}return this._content}update(e,r){for(const n of e)if(Fd.isIncremental(n)){const i=iF(n.range),a=this.offsetAt(i.start),s=this.offsetAt(i.end);this._content=this._content.substring(0,a)+n.text+this._content.substring(s,this._content.length);const o=Math.max(i.start.line,0),l=Math.max(i.end.line,0);let u=this._lineOffsets;const h=rF(n.text,!1,a);if(l-o===h.length)for(let f=0,p=h.length;fe?i=s:n=s+1}const a=n-1;return e=this.ensureBeforeEOL(e,r[a]),{line:a,character:e-r[a]}}offsetAt(e){const r=this.getLineOffsets();if(e.line>=r.length)return this._content.length;if(e.line<0)return 0;const n=r[e.line];if(e.character<=0)return n;const i=e.line+1r&&nF(this._content.charCodeAt(e-1));)e--;return e}get lineCount(){return this.getLineOffsets().length}static isIncremental(e){const r=e;return r!=null&&typeof r.text=="string"&&r.range!==void 0&&(r.rangeLength===void 0||typeof r.rangeLength=="number")}static isFull(e){const r=e;return r!=null&&typeof r.text=="string"&&r.range===void 0&&r.rangeLength===void 0}},E(Fd,"FullTextDocument"),Fd),R6;(function(t){function e(i,a,s,o){return new Sve(i,a,s,o)}E(e,"create"),t.create=e;function r(i,a,s){if(i instanceof Sve)return i.update(a,s),i;throw new Error("TextDocument.update: document must be created by TextDocument.create")}E(r,"update"),t.update=r;function n(i,a){const s=i.getText(),o=L6(a.map(_ve),(h,d)=>{const f=h.range.start.line-d.range.start.line;return f===0?h.range.start.character-d.range.start.character:f});let l=0;const u=[];for(const h of o){const d=i.offsetAt(h.range.start);if(dl&&u.push(s.substring(l,d)),h.newText.length&&u.push(h.newText),l=i.offsetAt(h.range.end)}return u.push(s.substr(l)),u.join("")}E(n,"applyEdits"),t.applyEdits=n})(R6||(R6={}));function L6(t,e){if(t.length<=1)return t;const r=t.length/2|0,n=t.slice(0,r),i=t.slice(r);L6(n,e),L6(i,e);let a=0,s=0,o=0;for(;ar.line||e.line===r.line&&e.character>r.character?{start:r,end:e}:t}E(iF,"getWellformedRange");function _ve(t){const e=iF(t.range);return e!==t.range?{newText:t.newText,range:e}:t}E(_ve,"getWellformedEdit");var Ave;(()=>{var t={975:F=>{function A(M){if(typeof M!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(M))}E(A,"e");function R(M,D){for(var O,B="",P=0,G=-1,V=0,H=0;H<=M.length;++H){if(H2){var W=B.lastIndexOf("/");if(W!==B.length-1){W===-1?(B="",P=0):P=(B=B.slice(0,W)).length-1-B.lastIndexOf("/"),G=H,V=0;continue}}else if(B.length===2||B.length===1){B="",P=0,G=H,V=0;continue}}D&&(B.length>0?B+="/..":B="..",P=2)}else B.length>0?B+="/"+M.slice(G+1,H):B=M.slice(G+1,H),P=H-G-1;G=H,V=0}else O===46&&V!==-1?++V:V=-1}return B}E(R,"r");var N={resolve:E(function(){for(var M,D="",O=!1,B=arguments.length-1;B>=-1&&!O;B--){var P;B>=0?P=arguments[B]:(M===void 0&&(M=process.cwd()),P=M),A(P),P.length!==0&&(D=P+"/"+D,O=P.charCodeAt(0)===47)}return D=R(D,!O),O?D.length>0?"/"+D:"/":D.length>0?D:"."},"resolve"),normalize:E(function(M){if(A(M),M.length===0)return".";var D=M.charCodeAt(0)===47,O=M.charCodeAt(M.length-1)===47;return(M=R(M,!D)).length!==0||D||(M="."),M.length>0&&O&&(M+="/"),D?"/"+M:M},"normalize"),isAbsolute:E(function(M){return A(M),M.length>0&&M.charCodeAt(0)===47},"isAbsolute"),join:E(function(){if(arguments.length===0)return".";for(var M,D=0;D0&&(M===void 0?M=O:M+="/"+O)}return M===void 0?".":N.normalize(M)},"join"),relative:E(function(M,D){if(A(M),A(D),M===D||(M=N.resolve(M))===(D=N.resolve(D)))return"";for(var O=1;OH){if(D.charCodeAt(G+ie)===47)return D.slice(G+ie+1);if(ie===0)return D.slice(G+ie)}else P>H&&(M.charCodeAt(O+ie)===47?W=ie:ie===0&&(W=0));break}var j=M.charCodeAt(O+ie);if(j!==D.charCodeAt(G+ie))break;j===47&&(W=ie)}var ae="";for(ie=O+W+1;ie<=B;++ie)ie!==B&&M.charCodeAt(ie)!==47||(ae.length===0?ae+="..":ae+="/..");return ae.length>0?ae+D.slice(G+W):(G+=W,D.charCodeAt(G)===47&&++G,D.slice(G))},"relative"),_makeLong:E(function(M){return M},"_makeLong"),dirname:E(function(M){if(A(M),M.length===0)return".";for(var D=M.charCodeAt(0),O=D===47,B=-1,P=!0,G=M.length-1;G>=1;--G)if((D=M.charCodeAt(G))===47){if(!P){B=G;break}}else P=!1;return B===-1?O?"/":".":O&&B===1?"//":M.slice(0,B)},"dirname"),basename:E(function(M,D){if(D!==void 0&&typeof D!="string")throw new TypeError('"ext" argument must be a string');A(M);var O,B=0,P=-1,G=!0;if(D!==void 0&&D.length>0&&D.length<=M.length){if(D.length===M.length&&D===M)return"";var V=D.length-1,H=-1;for(O=M.length-1;O>=0;--O){var W=M.charCodeAt(O);if(W===47){if(!G){B=O+1;break}}else H===-1&&(G=!1,H=O+1),V>=0&&(W===D.charCodeAt(V)?--V==-1&&(P=O):(V=-1,P=H))}return B===P?P=H:P===-1&&(P=M.length),M.slice(B,P)}for(O=M.length-1;O>=0;--O)if(M.charCodeAt(O)===47){if(!G){B=O+1;break}}else P===-1&&(G=!1,P=O+1);return P===-1?"":M.slice(B,P)},"basename"),extname:E(function(M){A(M);for(var D=-1,O=0,B=-1,P=!0,G=0,V=M.length-1;V>=0;--V){var H=M.charCodeAt(V);if(H!==47)B===-1&&(P=!1,B=V+1),H===46?D===-1?D=V:G!==1&&(G=1):D!==-1&&(G=-1);else if(!P){O=V+1;break}}return D===-1||B===-1||G===0||G===1&&D===B-1&&D===O+1?"":M.slice(D,B)},"extname"),format:E(function(M){if(M===null||typeof M!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof M);return(function(D,O){var B=O.dir||O.root,P=O.base||(O.name||"")+(O.ext||"");return B?B===O.root?B+P:B+"/"+P:P})(0,M)},"format"),parse:E(function(M){A(M);var D={root:"",dir:"",base:"",ext:"",name:""};if(M.length===0)return D;var O,B=M.charCodeAt(0),P=B===47;P?(D.root="/",O=1):O=0;for(var G=-1,V=0,H=-1,W=!0,ie=M.length-1,j=0;ie>=O;--ie)if((B=M.charCodeAt(ie))!==47)H===-1&&(W=!1,H=ie+1),B===46?G===-1?G=ie:j!==1&&(j=1):G!==-1&&(j=-1);else if(!W){V=ie+1;break}return G===-1||H===-1||j===0||j===1&&G===H-1&&G===V+1?H!==-1&&(D.base=D.name=V===0&&P?M.slice(1,H):M.slice(V,H)):(V===0&&P?(D.name=M.slice(1,G),D.base=M.slice(1,H)):(D.name=M.slice(V,G),D.base=M.slice(V,H)),D.ext=M.slice(G,H)),V>0?D.dir=M.slice(0,V-1):P&&(D.dir="/"),D},"parse"),sep:"/",delimiter:":",win32:null,posix:null};N.posix=N,F.exports=N}},e={};function r(F){var A=e[F];if(A!==void 0)return A.exports;var R=e[F]={exports:{}};return t[F](R,R.exports,r),R.exports}E(r,"r"),r.d=(F,A)=>{for(var R in A)r.o(A,R)&&!r.o(F,R)&&Object.defineProperty(F,R,{enumerable:!0,get:A[R]})},r.o=(F,A)=>Object.prototype.hasOwnProperty.call(F,A),r.r=F=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(F,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(F,"__esModule",{value:!0})};var n={};let i;r.r(n),r.d(n,{URI:E(()=>f,"URI"),Utils:E(()=>$,"Utils")}),typeof process=="object"?i=process.platform==="win32":typeof navigator=="object"&&(i=navigator.userAgent.indexOf("Windows")>=0);const a=/^\w[\w\d+.-]*$/,s=/^\//,o=/^\/\//;function l(F,A){if(!F.scheme&&A)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${F.authority}", path: "${F.path}", query: "${F.query}", fragment: "${F.fragment}"}`);if(F.scheme&&!a.test(F.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(F.path){if(F.authority){if(!s.test(F.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(o.test(F.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}E(l,"a");const u="",h="/",d=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/,I=class I{constructor(A,R,N,M,D,O=!1){tn(this,"scheme");tn(this,"authority");tn(this,"path");tn(this,"query");tn(this,"fragment");typeof A=="object"?(this.scheme=A.scheme||u,this.authority=A.authority||u,this.path=A.path||u,this.query=A.query||u,this.fragment=A.fragment||u):(this.scheme=(function(B,P){return B||P?B:"file"})(A,O),this.authority=R||u,this.path=(function(B,P){switch(B){case"https":case"http":case"file":P?P[0]!==h&&(P=h+P):P=h}return P})(this.scheme,N||u),this.query=M||u,this.fragment=D||u,l(this,O))}static isUri(A){return A instanceof I||!!A&&typeof A.authority=="string"&&typeof A.fragment=="string"&&typeof A.path=="string"&&typeof A.query=="string"&&typeof A.scheme=="string"&&typeof A.fsPath=="string"&&typeof A.with=="function"&&typeof A.toString=="function"}get fsPath(){return x(this,!1)}with(A){if(!A)return this;let{scheme:R,authority:N,path:M,query:D,fragment:O}=A;return R===void 0?R=this.scheme:R===null&&(R=u),N===void 0?N=this.authority:N===null&&(N=u),M===void 0?M=this.path:M===null&&(M=u),D===void 0?D=this.query:D===null&&(D=u),O===void 0?O=this.fragment:O===null&&(O=u),R===this.scheme&&N===this.authority&&M===this.path&&D===this.query&&O===this.fragment?this:new g(R,N,M,D,O)}static parse(A,R=!1){const N=d.exec(A);return N?new g(N[2]||u,_(N[4]||u),_(N[5]||u),_(N[7]||u),_(N[9]||u),R):new g(u,u,u,u,u)}static file(A){let R=u;if(i&&(A=A.replace(/\\/g,h)),A[0]===h&&A[1]===h){const N=A.indexOf(h,2);N===-1?(R=A.substring(2),A=h):(R=A.substring(2,N),A=A.substring(N)||h)}return new g("file",R,A,u,u)}static from(A){const R=new g(A.scheme,A.authority,A.path,A.query,A.fragment);return l(R,!0),R}toString(A=!1){return b(this,A)}toJSON(){return this}static revive(A){if(A){if(A instanceof I)return A;{const R=new g(A);return R._formatted=A.external,R._fsPath=A._sep===p?A.fsPath:null,R}}return A}};E(I,"l");let f=I;const p=i?1:void 0,z=class z extends f{constructor(){super(...arguments);tn(this,"_formatted",null);tn(this,"_fsPath",null)}get fsPath(){return this._fsPath||(this._fsPath=x(this,!1)),this._fsPath}toString(R=!1){return R?b(this,!0):(this._formatted||(this._formatted=b(this,!1)),this._formatted)}toJSON(){const R={$mid:1};return this._fsPath&&(R.fsPath=this._fsPath,R._sep=p),this._formatted&&(R.external=this._formatted),this.path&&(R.path=this.path),this.scheme&&(R.scheme=this.scheme),this.authority&&(R.authority=this.authority),this.query&&(R.query=this.query),this.fragment&&(R.fragment=this.fragment),R}};E(z,"d");let g=z;const m={58:"%3A",47:"%2F",63:"%3F",35:"%23",91:"%5B",93:"%5D",64:"%40",33:"%21",36:"%24",38:"%26",39:"%27",40:"%28",41:"%29",42:"%2A",43:"%2B",44:"%2C",59:"%3B",61:"%3D",32:"%20"};function y(F,A,R){let N,M=-1;for(let D=0;D=97&&O<=122||O>=65&&O<=90||O>=48&&O<=57||O===45||O===46||O===95||O===126||A&&O===47||R&&O===91||R&&O===93||R&&O===58)M!==-1&&(N+=encodeURIComponent(F.substring(M,D)),M=-1),N!==void 0&&(N+=F.charAt(D));else{N===void 0&&(N=F.substr(0,D));const B=m[O];B!==void 0?(M!==-1&&(N+=encodeURIComponent(F.substring(M,D)),M=-1),N+=B):M===-1&&(M=D)}}return M!==-1&&(N+=encodeURIComponent(F.substring(M))),N!==void 0?N:F}E(y,"m");function v(F){let A;for(let R=0;R1&&F.scheme==="file"?`//${F.authority}${F.path}`:F.path.charCodeAt(0)===47&&(F.path.charCodeAt(1)>=65&&F.path.charCodeAt(1)<=90||F.path.charCodeAt(1)>=97&&F.path.charCodeAt(1)<=122)&&F.path.charCodeAt(2)===58?A?F.path.substr(1):F.path[1].toLowerCase()+F.path.substr(2):F.path,i&&(R=R.replace(/\//g,"\\")),R}E(x,"v");function b(F,A){const R=A?v:y;let N="",{scheme:M,authority:D,path:O,query:B,fragment:P}=F;if(M&&(N+=M,N+=":"),(D||M==="file")&&(N+=h,N+=h),D){let G=D.indexOf("@");if(G!==-1){const V=D.substr(0,G);D=D.substr(G+1),G=V.lastIndexOf(":"),G===-1?N+=R(V,!1,!1):(N+=R(V.substr(0,G),!1,!1),N+=":",N+=R(V.substr(G+1),!1,!0)),N+="@"}D=D.toLowerCase(),G=D.lastIndexOf(":"),G===-1?N+=R(D,!1,!0):(N+=R(D.substr(0,G),!1,!0),N+=D.substr(G))}if(O){if(O.length>=3&&O.charCodeAt(0)===47&&O.charCodeAt(2)===58){const G=O.charCodeAt(1);G>=65&&G<=90&&(O=`/${String.fromCharCode(G+32)}:${O.substr(3)}`)}else if(O.length>=2&&O.charCodeAt(1)===58){const G=O.charCodeAt(0);G>=65&&G<=90&&(O=`${String.fromCharCode(G+32)}:${O.substr(2)}`)}N+=R(O,!0,!1)}return B&&(N+="?",N+=R(B,!1,!1)),P&&(N+="#",N+=A?P:y(P,!1,!1)),N}E(b,"b");function w(F){try{return decodeURIComponent(F)}catch{return F.length>3?F.substr(0,3)+w(F.substr(3)):F}}E(w,"C");const C=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function _(F){return F.match(C)?F.replace(C,(A=>w(A))):F}E(_,"w");var k=r(975);const S=k.posix||k,L="/";var $;(function(F){F.joinPath=function(A,...R){return A.with({path:S.join(A.path,...R)})},F.resolvePath=function(A,...R){let N=A.path,M=!1;N[0]!==L&&(N=L+N,M=!0);let D=S.resolve(N,...R);return M&&D[0]===L&&!A.authority&&(D=D.substring(1)),A.with({path:D})},F.dirname=function(A){if(A.path.length===0||A.path===L)return A;let R=S.dirname(A.path);return R.length===1&&R.charCodeAt(0)===46&&(R=""),A.with({path:R})},F.basename=function(A){return S.basename(A.path)},F.extname=function(A){return S.extname(A.path)}})($||($={})),Ave=n})();var{URI:Oo,Utils:$C}=Ave,Bs;(function(t){t.basename=$C.basename,t.dirname=$C.dirname,t.extname=$C.extname,t.joinPath=$C.joinPath,t.resolvePath=$C.resolvePath;const e=typeof process=="object"&&(process==null?void 0:process.platform)==="win32";function r(s,o){return(s==null?void 0:s.toString())===(o==null?void 0:o.toString())}E(r,"equals"),t.equals=r;function n(s,o){const l=typeof s=="string"?Oo.parse(s).path:s.path,u=typeof o=="string"?Oo.parse(o).path:o.path,h=l.split("/").filter(m=>m.length>0),d=u.split("/").filter(m=>m.length>0);if(e){const m=/^[A-Z]:$/;if(h[0]&&m.test(h[0])&&(h[0]=h[0].toLowerCase()),d[0]&&m.test(d[0])&&(d[0]=d[0].toLowerCase()),h[0]!==d[0])return u.substring(1)}let f=0;for(;f({name:i.name,uri:Bs.joinPath(Oo.parse(r),i.name).toString(),element:i.element})):[]}all(){return this.collectValues(this.root)}findAll(e){const r=this.getNode(Bs.normalize(e),!1);return r?this.collectValues(r):[]}getNode(e,r){const n=e.split("/");e.charAt(e.length-1)==="/"&&n.pop();let i=this.root;for(const a of n){let s=i.children.get(a);if(!s)if(r)s={name:a,children:new Map,parent:i},i.children.set(a,s);else return;i=s}return i}collectValues(e){const r=[];e.element&&r.push(e.element);for(const n of e.children.values())r.push(...this.collectValues(n));return r}},E(Ov,"UriTrie"),Ov),jr;(function(t){t[t.Changed=0]="Changed",t[t.Parsed=1]="Parsed",t[t.IndexedContent=2]="IndexedContent",t[t.ComputedScopes=3]="ComputedScopes",t[t.Linked=4]="Linked",t[t.IndexedReferences=5]="IndexedReferences",t[t.Validated=6]="Validated"})(jr||(jr={}));var Rve=(Pv=class{constructor(e){this.serviceRegistry=e.ServiceRegistry,this.textDocuments=e.workspace.TextDocuments,this.fileSystemProvider=e.workspace.FileSystemProvider}async fromUri(e,r=Vn.CancellationToken.None){const n=await this.fileSystemProvider.readFile(e);return this.createAsync(e,n,r)}fromTextDocument(e,r,n){return r=r??Oo.parse(e.uri),Vn.CancellationToken.is(n)?this.createAsync(r,e,n):this.create(r,e,n)}fromString(e,r,n){return Vn.CancellationToken.is(n)?this.createAsync(r,e,n):this.create(r,e,n)}fromModel(e,r){return this.create(r,{$model:e})}create(e,r,n){if(typeof r=="string"){const i=this.parse(e,r,n);return this.createLangiumDocument(i,e,void 0,r)}else if("$model"in r){const i={value:r.$model,parserErrors:[],lexerErrors:[]};return this.createLangiumDocument(i,e)}else{const i=this.parse(e,r.getText(),n);return this.createLangiumDocument(i,e,r)}}async createAsync(e,r,n){if(typeof r=="string"){const i=await this.parseAsync(e,r,n);return this.createLangiumDocument(i,e,void 0,r)}else{const i=await this.parseAsync(e,r.getText(),n);return this.createLangiumDocument(i,e,r)}}createLangiumDocument(e,r,n,i){let a;if(n)a={parseResult:e,uri:r,state:jr.Parsed,references:[],textDocument:n};else{const s=this.createTextDocumentGetter(r,i);a={parseResult:e,uri:r,state:jr.Parsed,references:[],get textDocument(){return s()}}}return e.value.$document=a,a}async update(e,r){var s,o;const n=(s=e.parseResult.value.$cstNode)==null?void 0:s.root.fullText,i=(o=this.textDocuments)==null?void 0:o.get(e.uri.toString()),a=i?i.getText():await this.fileSystemProvider.readFile(e.uri);if(i)Object.defineProperty(e,"textDocument",{value:i});else{const l=this.createTextDocumentGetter(e.uri,a);Object.defineProperty(e,"textDocument",{get:l})}return n!==a&&(e.parseResult=await this.parseAsync(e.uri,a,r),e.parseResult.value.$document=e),e.state=jr.Parsed,e}parse(e,r,n){return this.serviceRegistry.getServices(e).parser.LangiumParser.parse(r,n)}parseAsync(e,r,n){return this.serviceRegistry.getServices(e).parser.AsyncParser.parse(r,n)}createTextDocumentGetter(e,r){const n=this.serviceRegistry;let i;return()=>i??(i=R6.create(e.toString(),n.getServices(e).LanguageMetaData.languageId,0,r??""))}},E(Pv,"DefaultLangiumDocumentFactory"),Pv),Lve=(Bv=class{constructor(e){this.documentTrie=new aF,this.services=e,this.langiumDocumentFactory=e.workspace.LangiumDocumentFactory,this.documentBuilder=()=>e.workspace.DocumentBuilder}get all(){return En(this.documentTrie.all())}addDocument(e){const r=e.uri.toString();if(this.documentTrie.has(r))throw new Error(`A document with the URI '${r}' is already present.`);this.documentTrie.insert(r,e)}getDocument(e){const r=e.toString();return this.documentTrie.find(r)}getDocuments(e){const r=e.toString();return this.documentTrie.findAll(r)}async getOrCreateDocument(e,r){let n=this.getDocument(e);return n||(n=await this.langiumDocumentFactory.fromUri(e,r),this.addDocument(n),n)}createDocument(e,r,n){if(n)return this.langiumDocumentFactory.fromString(r,e,n).then(i=>(this.addDocument(i),i));{const i=this.langiumDocumentFactory.fromString(r,e);return this.addDocument(i),i}}hasDocument(e){return this.documentTrie.has(e.toString())}invalidateDocument(e){const r=e.toString(),n=this.documentTrie.find(r);return n&&this.documentBuilder().resetToState(n,jr.Changed),n}deleteDocument(e){const r=e.toString(),n=this.documentTrie.find(r);return n&&(n.state=jr.Changed,this.documentTrie.delete(r)),n}deleteDocuments(e){const r=e.toString(),n=this.documentTrie.findAll(r);for(const i of n)i.state=jr.Changed;return this.documentTrie.delete(r),n}},E(Bv,"DefaultLangiumDocuments"),Bv),Jp=Symbol("RefResolving"),Ive=(Fv=class{constructor(e){this.reflection=e.shared.AstReflection,this.langiumDocuments=()=>e.shared.workspace.LangiumDocuments,this.scopeProvider=e.references.ScopeProvider,this.astNodeLocator=e.workspace.AstNodeLocator,this.profiler=e.shared.profilers.LangiumProfiler,this.languageId=e.LanguageMetaData.languageId}async link(e,r=Vn.CancellationToken.None){var n;if((n=this.profiler)!=null&&n.isActive("linking")){const i=this.profiler.createTask("linking",this.languageId);i.start();try{for(const a of Rl(e.parseResult.value))await Ea(r),Bm(a).forEach(s=>{const o=`${a.$type}:${s.property}`;i.startSubTask(o);try{this.doLink(s,e)}finally{i.stopSubTask(o)}})}finally{i.stop()}}else for(const i of Rl(e.parseResult.value))await Ea(r),Bm(i).forEach(a=>this.doLink(a,e))}doLink(e,r){const n=e.reference;if("_ref"in n&&n._ref===void 0){n._ref=Jp;try{const i=this.getCandidate(e);if(hp(i))n._ref=i;else{n._nodeDescription=i;const a=this.loadAstNode(i);n._ref=a??this.createLinkingError(e,i)}}catch(i){console.error(`An error occurred while resolving reference to '${n.$refText}':`,i);const a=i.message??String(i);n._ref={info:e,message:`An error occurred while resolving reference to '${n.$refText}': ${a}`}}r.references.push(n)}else if("_items"in n&&n._items===void 0){n._items=Jp;try{const i=this.getCandidates(e),a=[];if(hp(i))n._linkingError=i;else for(const s of i){const o=this.loadAstNode(s);o&&a.push({ref:o,$nodeDescription:s})}n._items=a}catch(i){n._linkingError={info:e,message:`An error occurred while resolving reference to '${n.$refText}': ${i}`},n._items=[]}r.references.push(n)}}unlink(e){for(const r of e.references)"_ref"in r?(r._ref=void 0,delete r._nodeDescription):"_items"in r&&(r._items=void 0,delete r._linkingError);e.references=[]}getCandidate(e){return this.scopeProvider.getScope(e).getElement(e.reference.$refText)??this.createLinkingError(e)}getCandidates(e){const n=this.scopeProvider.getScope(e).getElements(e.reference.$refText).distinct(i=>`${i.documentUri}#${i.path}`).toArray();return n.length>0?n:this.createLinkingError(e)}buildReference(e,r,n,i){const a=this,s={$refNode:n,$refText:i,_ref:void 0,get ref(){if(ea(this._ref))return this._ref;if(sO(this._nodeDescription)){const o=a.loadAstNode(this._nodeDescription);this._ref=o??a.createLinkingError({reference:s,container:e,property:r},this._nodeDescription)}else if(this._ref===void 0){this._ref=Jp;const o=Pm(e).$document,l=a.getLinkedNode({reference:s,container:e,property:r});if(l.error&&o&&o.state0))return this._linkingError=a.createLinkingError({reference:s,container:e,property:r})}};return s}throwCyclicReferenceError(e,r,n){throw new Error(`Cyclic reference resolution detected: ${this.astNodeLocator.getAstNodePath(e)}/${r} (symbol '${n}')`)}getLinkedNode(e){try{const r=this.getCandidate(e);if(hp(r))return{error:r};const n=this.loadAstNode(r);return n?{node:n,descr:r}:{descr:r,error:this.createLinkingError(e,r)}}catch(r){console.error(`An error occurred while resolving reference to '${e.reference.$refText}':`,r);const n=r.message??String(r);return{error:{info:e,message:`An error occurred while resolving reference to '${e.reference.$refText}': ${n}`}}}}loadAstNode(e){if(e.node)return e.node;const r=this.langiumDocuments().getDocument(e.documentUri);if(r)return this.astNodeLocator.getAstNode(r.parseResult.value,e.path)}createLinkingError(e,r){const n=Pm(e.container).$document;n&&n.stategp(r)&&r.isMulti)}findDeclarations(e){if(e){const r=JO(e),n=e.astNode;if(r&&n){const i=n[r.feature];if(Ls(i)||Ic(i))return IS(i);if(Array.isArray(i)){for(const a of i)if((Ls(a)||Ic(a))&&a.$refNode&&a.$refNode.offset<=e.offset&&a.$refNode.end>=e.end)return IS(a)}}if(n){const i=this.nameProvider.getNameNode(n);if(i&&(i===e||LO(e,i)))return this.getSelfNodes(n)}}return[]}getSelfNodes(e){if(this.hasMultiReference){const r=this.index.findAllReferences(e,this.nodeLocator.getAstNodePath(e)),n=this.getNodeFromReferenceDescription(r.head());if(n){for(const i of Bm(n))if(Ic(i.reference)&&i.reference.items.some(a=>a.ref===e))return i.reference.items.map(a=>a.ref)}return[e]}else return[e]}getNodeFromReferenceDescription(e){if(!e)return;const r=this.documents.getDocument(e.sourceUri);if(r)return this.nodeLocator.getAstNode(r.parseResult.value,e.sourcePath)}findDeclarationNodes(e){const r=this.findDeclarations(e),n=[];for(const i of r){const a=this.nameProvider.getNameNode(i)??i.$cstNode;a&&n.push(a)}return n}findReferences(e,r){const n=[];r.includeDeclaration&&n.push(...this.getSelfReferences(e));let i=this.index.findAllReferences(e,this.nodeLocator.getAstNodePath(e));return r.documentUri&&(i=i.filter(a=>Bs.equals(a.sourceUri,r.documentUri))),n.push(...i),En(n)}getSelfReferences(e){const r=this.getSelfNodes(e),n=[];for(const i of r){const a=this.nameProvider.getNameNode(i);if(a){const s=Al(i),o=this.nodeLocator.getAstNodePath(i);n.push({sourceUri:s.uri,sourcePath:o,targetUri:s.uri,targetPath:o,segment:Xm(a),local:!0})}}return n}},E(Gv,"DefaultReferences"),Gv),ah=(qv=class{constructor(e){if(this.map=new Map,e)for(const[r,n]of e)this.add(r,n)}get size(){return Nw.sum(En(this.map.values()).map(e=>e.length))}clear(){this.map.clear()}delete(e,r){if(r===void 0)return this.map.delete(e);{const n=this.map.get(e);if(n){const i=n.indexOf(r);if(i>=0)return n.length===1?this.map.delete(e):n.splice(i,1),!0}return!1}}get(e){return this.map.get(e)??[]}getStream(e){const r=this.map.get(e);return r?En(r):Nm}has(e,r){if(r===void 0)return this.map.has(e);{const n=this.map.get(e);return n?n.indexOf(r)>=0:!1}}add(e,r){return this.map.has(e)?this.map.get(e).push(r):this.map.set(e,[r]),this}addAll(e,r){return this.map.has(e)?this.map.get(e).push(...r):this.map.set(e,Array.from(r)),this}forEach(e){this.map.forEach((r,n)=>r.forEach(i=>e(i,n,this)))}[Symbol.iterator](){return this.entries().iterator()}entries(){return En(this.map.entries()).flatMap(([e,r])=>r.map(n=>[e,n]))}keys(){return En(this.map.keys())}values(){return En(this.map.values()).flat()}entriesGroupedByKey(){return En(this.map.entries())}},E(qv,"MultiMap"),qv),I6=(Vv=class{get size(){return this.map.size}constructor(e){if(this.map=new Map,this.inverse=new Map,e)for(const[r,n]of e)this.set(r,n)}clear(){this.map.clear(),this.inverse.clear()}set(e,r){return this.map.set(e,r),this.inverse.set(r,e),this}get(e){return this.map.get(e)}getKey(e){return this.inverse.get(e)}delete(e){const r=this.map.get(e);return r!==void 0?(this.map.delete(e),this.inverse.delete(r),!0):!1}},E(Vv,"BiMap"),Vv),Nve=(Wv=class{constructor(e){this.nameProvider=e.references.NameProvider,this.descriptions=e.workspace.AstNodeDescriptionProvider}async collectExportedSymbols(e,r=Vn.CancellationToken.None){return this.collectExportedSymbolsForNode(e.parseResult.value,e,void 0,r)}async collectExportedSymbolsForNode(e,r,n=$w,i=Vn.CancellationToken.None){const a=[];this.addExportedSymbol(e,a,r);for(const s of n(e))await Ea(i),this.addExportedSymbol(s,a,r);return a}addExportedSymbol(e,r,n){const i=this.nameProvider.getName(e);i&&r.push(this.descriptions.createDescription(e,i,n))}async collectLocalSymbols(e,r=Vn.CancellationToken.None){const n=e.parseResult.value,i=new ah;for(const a of Wu(n))await Ea(r),this.addLocalSymbol(a,e,i);return i}addLocalSymbol(e,r,n){const i=e.$container;if(i){const a=this.nameProvider.getName(e);a&&n.add(i,this.descriptions.createDescription(e,a,r))}}},E(Wv,"DefaultScopeComputation"),Wv),oF=(Uv=class{constructor(e,r,n){this.elements=e,this.outerScope=r,this.caseInsensitive=(n==null?void 0:n.caseInsensitive)??!1,this.concatOuterScope=(n==null?void 0:n.concatOuterScope)??!0}getAllElements(){return this.outerScope?this.elements.concat(this.outerScope.getAllElements()):this.elements}getElement(e){const r=this.caseInsensitive?e.toLowerCase():e,n=this.caseInsensitive?this.elements.find(i=>i.name.toLowerCase()===r):this.elements.find(i=>i.name===e);if(n)return n;if(this.outerScope)return this.outerScope.getElement(e)}getElements(e){const r=this.caseInsensitive?e.toLowerCase():e,n=this.caseInsensitive?this.elements.filter(i=>i.name.toLowerCase()===r):this.elements.filter(i=>i.name===e);return(this.concatOuterScope||n.isEmpty())&&this.outerScope?n.concat(this.outerScope.getElements(e)):n}},E(Uv,"StreamScope"),Uv),tft=(Hv=class{constructor(e,r,n){this.elements=new Map,this.caseInsensitive=(n==null?void 0:n.caseInsensitive)??!1,this.concatOuterScope=(n==null?void 0:n.concatOuterScope)??!0;for(const i of e){const a=this.caseInsensitive?i.name.toLowerCase():i.name;this.elements.set(a,i)}this.outerScope=r}getElement(e){const r=this.caseInsensitive?e.toLowerCase():e,n=this.elements.get(r);if(n)return n;if(this.outerScope)return this.outerScope.getElement(e)}getElements(e){const r=this.caseInsensitive?e.toLowerCase():e,n=this.elements.get(r),i=n?[n]:[];return(this.concatOuterScope||i.length>0)&&this.outerScope?En(i).concat(this.outerScope.getElements(e)):En(i)}getAllElements(){let e=En(this.elements.values());return this.outerScope&&(e=e.concat(this.outerScope.getAllElements())),e}},E(Hv,"MapScope"),Hv),$ve=(Yv=class{constructor(e,r,n){this.elements=new ah,this.caseInsensitive=(n==null?void 0:n.caseInsensitive)??!1,this.concatOuterScope=(n==null?void 0:n.concatOuterScope)??!0;for(const i of e){const a=this.caseInsensitive?i.name.toLowerCase():i.name;this.elements.add(a,i)}this.outerScope=r}getElement(e){const r=this.caseInsensitive?e.toLowerCase():e,n=this.elements.get(r)[0];if(n)return n;if(this.outerScope)return this.outerScope.getElement(e)}getElements(e){const r=this.caseInsensitive?e.toLowerCase():e,n=this.elements.get(r);return(this.concatOuterScope||n.length===0)&&this.outerScope?En(n).concat(this.outerScope.getElements(e)):En(n)}getAllElements(){let e=En(this.elements.values());return this.outerScope&&(e=e.concat(this.outerScope.getAllElements())),e}},E(Yv,"MultiMapScope"),Yv),rft={getElement(){},getElements(){return Nm},getAllElements(){return Nm}},D6=(Xv=class{constructor(){this.toDispose=[],this.isDisposed=!1}onDispose(e){this.toDispose.push(e)}dispose(){this.throwIfDisposed(),this.clear(),this.isDisposed=!0,this.toDispose.forEach(e=>e.dispose())}throwIfDisposed(){if(this.isDisposed)throw new Error("This cache has already been disposed")}},E(Xv,"DisposableCache"),Xv),lF=(jv=class extends D6{constructor(){super(...arguments),this.cache=new Map}has(e){return this.throwIfDisposed(),this.cache.has(e)}set(e,r){this.throwIfDisposed(),this.cache.set(e,r)}get(e,r){if(this.throwIfDisposed(),this.cache.has(e))return this.cache.get(e);if(r){const n=r();return this.cache.set(e,n),n}else return}delete(e){return this.throwIfDisposed(),this.cache.delete(e)}clear(){this.throwIfDisposed(),this.cache.clear()}},E(jv,"SimpleCache"),jv),M6=(Kv=class extends D6{constructor(e){super(),this.cache=new Map,this.converter=e??(r=>r)}has(e,r){return this.throwIfDisposed(),this.cacheForContext(e).has(r)}set(e,r,n){this.throwIfDisposed(),this.cacheForContext(e).set(r,n)}get(e,r,n){this.throwIfDisposed();const i=this.cacheForContext(e);if(i.has(r))return i.get(r);if(n){const a=n();return i.set(r,a),a}else return}delete(e,r){return this.throwIfDisposed(),this.cacheForContext(e).delete(r)}clear(e){if(this.throwIfDisposed(),e){const r=this.converter(e);this.cache.delete(r)}else this.cache.clear()}cacheForContext(e){const r=this.converter(e);let n=this.cache.get(r);return n||(n=new Map,this.cache.set(r,n)),n}},E(Kv,"ContextCache"),Kv),Ove=(Zv=class extends M6{constructor(e,r){super(n=>n.toString()),r?(this.toDispose.push(e.workspace.DocumentBuilder.onDocumentPhase(r,n=>{this.clear(n.uri.toString())})),this.toDispose.push(e.workspace.DocumentBuilder.onUpdate((n,i)=>{for(const a of i)this.clear(a)}))):this.toDispose.push(e.workspace.DocumentBuilder.onUpdate((n,i)=>{const a=n.concat(i);for(const s of a)this.clear(s)}))}},E(Zv,"DocumentCache"),Zv),cF=(Qv=class extends lF{constructor(e,r){super(),r?(this.toDispose.push(e.workspace.DocumentBuilder.onBuildPhase(r,()=>{this.clear()})),this.toDispose.push(e.workspace.DocumentBuilder.onUpdate((n,i)=>{i.length>0&&this.clear()}))):this.toDispose.push(e.workspace.DocumentBuilder.onUpdate(()=>{this.clear()}))}},E(Qv,"WorkspaceCache"),Qv),Pve=(Jv=class{constructor(e){this.reflection=e.shared.AstReflection,this.nameProvider=e.references.NameProvider,this.descriptions=e.workspace.AstNodeDescriptionProvider,this.indexManager=e.shared.workspace.IndexManager,this.globalScopeCache=new cF(e.shared)}getScope(e){const r=[],n=this.reflection.getReferenceType(e),i=Al(e.container).localSymbols;if(i){let s=e.container;do i.has(s)&&r.push(i.getStream(s).filter(o=>this.reflection.isSubtype(o.type,n))),s=s.$container;while(s)}let a=this.getGlobalScope(n,e);for(let s=r.length-1;s>=0;s--)a=this.createScope(r[s],a);return a}createScope(e,r,n){return new oF(En(e),r,n)}createScopeForNodes(e,r,n){const i=En(e).map(a=>{const s=this.nameProvider.getName(a);if(s)return this.descriptions.createDescription(a,s)}).nonNullable();return new oF(i,r,n)}getGlobalScope(e,r){return this.globalScopeCache.get(e,()=>new $ve(this.indexManager.allElements(e)))}},E(Jv,"DefaultScopeProvider"),Jv);function uF(t){return typeof t.$comment=="string"}E(uF,"isAstNodeWithComment");function hF(t){return typeof t=="object"&&!!t&&("$ref"in t||"$error"in t)}E(hF,"isIntermediateReference");var Bve=(e2=class{constructor(e){this.ignoreProperties=new Set(["$container","$containerProperty","$containerIndex","$document","$cstNode"]),this.langiumDocuments=e.shared.workspace.LangiumDocuments,this.astNodeLocator=e.workspace.AstNodeLocator,this.nameProvider=e.references.NameProvider,this.commentProvider=e.documentation.CommentProvider}serialize(e,r){const n=r??{},i=r==null?void 0:r.replacer,a=E((o,l)=>this.replacer(o,l,n),"defaultReplacer"),s=i?(o,l)=>i(o,l,a):a;try{return this.currentDocument=Al(e),JSON.stringify(e,s,r==null?void 0:r.space)}finally{this.currentDocument=void 0}}deserialize(e,r){const n=r??{},i=JSON.parse(e);return this.linkNode(i,i,n),i}replacer(e,r,{refText:n,sourceText:i,textRegions:a,comments:s,uriConverter:o}){var l,u,h;if(!this.ignoreProperties.has(e))if(Ls(r)){const d=r.ref,f=n?r.$refText:void 0;if(d){const p=Al(d);let g="";this.currentDocument&&this.currentDocument!==p&&(o?g=o(p.uri,d):g=p.uri.toString());const m=this.astNodeLocator.getAstNodePath(d);return{$ref:`${g}#${m}`,$refText:f}}else return{$error:((l=r.error)==null?void 0:l.message)??"Could not resolve reference",$refText:f}}else if(Ic(r)){const d=n?r.$refText:void 0,f=[];for(const p of r.items){const g=p.ref,m=Al(p.ref);let y="";this.currentDocument&&this.currentDocument!==m&&(o?y=o(m.uri,g):y=m.uri.toString());const v=this.astNodeLocator.getAstNodePath(g);f.push(`${y}#${v}`)}return{$refs:f,$refText:d}}else if(ea(r)){let d;if(a&&(d=this.addAstNodeRegionWithAssignmentsTo({...r}),(!e||r.$document)&&(d!=null&&d.$textRegion)&&(d.$textRegion.documentURI=(u=this.currentDocument)==null?void 0:u.uri.toString())),i&&!e&&(d??(d={...r}),d.$sourceText=(h=r.$cstNode)==null?void 0:h.text),s){d??(d={...r});const f=this.commentProvider.getComment(r);f&&(d.$comment=f.replace(/\r/g,""))}return d??r}else return r}addAstNodeRegionWithAssignmentsTo(e){const r=E(n=>({offset:n.offset,end:n.end,length:n.length,range:n.range}),"createDocumentSegment");if(e.$cstNode){const n=e.$textRegion=r(e.$cstNode),i=n.assignments={};return Object.keys(e).filter(a=>!a.startsWith("$")).forEach(a=>{const s=ZO(e.$cstNode,a).map(r);s.length!==0&&(i[a]=s)}),e}}linkNode(e,r,n,i,a,s){for(const[l,u]of Object.entries(e))if(Array.isArray(u))for(let h=0;h{await this.handleException(()=>e.call(r,n,i,a),"An error occurred during validation",i,n)}}async handleException(e,r,n,i){try{await e()}catch(a){if(Qp(a))throw a;console.error(`${r}:`,a),a instanceof Error&&a.stack&&console.error(a.stack);const s=a instanceof Error?a.message:String(a);n("error",`${r}: ${s}`,{node:i})}}addEntry(e,r){if(e==="AstNode"){this.entries.add("AstNode",r);return}for(const n of this.reflection.getAllSubTypes(e))this.entries.add(n,r)}getChecks(e,r){let n=En(this.entries.get(e)).concat(this.entries.get("AstNode"));return r&&(n=n.filter(i=>r.includes(i.category))),n.map(i=>i.check)}registerBeforeDocument(e,r=this){this.entriesBefore.push(this.wrapPreparationException(e,"An error occurred during set-up of the validation",r))}registerAfterDocument(e,r=this){this.entriesAfter.push(this.wrapPreparationException(e,"An error occurred during tear-down of the validation",r))}wrapPreparationException(e,r,n){return async(i,a,s,o)=>{await this.handleException(()=>e.call(n,i,a,s,o),r,a,i)}}get checksBefore(){return this.entriesBefore}get checksAfter(){return this.entriesAfter}getAllValidationCategories(e){return this.knownCategories}},E(r2,"ValidationRegistry"),r2),Gve=Object.freeze({validateNode:!0,validateChildren:!0}),qve=(n2=class{constructor(e){this.validationRegistry=e.validation.ValidationRegistry,this.metadata=e.LanguageMetaData,this.profiler=e.shared.profilers.LangiumProfiler,this.languageId=e.LanguageMetaData.languageId}async validateDocument(e,r={},n=Vn.CancellationToken.None){const i=e.parseResult,a=[];if(await Ea(n),(!r.categories||r.categories.includes("built-in"))&&(this.processLexingErrors(i,a,r),r.stopAfterLexingErrors&&a.some(s=>{var o;return((o=s.data)==null?void 0:o.code)===ol.LexingError})||(this.processParsingErrors(i,a,r),r.stopAfterParsingErrors&&a.some(s=>{var o;return((o=s.data)==null?void 0:o.code)===ol.ParsingError}))||(this.processLinkingErrors(e,a,r),r.stopAfterLinkingErrors&&a.some(s=>{var o;return((o=s.data)==null?void 0:o.code)===ol.LinkingError}))))return a;try{a.push(...await this.validateAst(i.value,r,n))}catch(s){if(Qp(s))throw s;console.error("An error occurred during validation:",s)}return await Ea(n),a}processLexingErrors(e,r,n){var a;const i=[...e.lexerErrors,...((a=e.lexerReport)==null?void 0:a.diagnostics)??[]];for(const s of i){const o=s.severity??"error",l={severity:OC(o),range:{start:{line:s.line-1,character:s.column-1},end:{line:s.line-1,character:s.column+s.length-1}},message:s.message,data:fF(o),source:this.getSource()};r.push(l)}}processParsingErrors(e,r,n){for(const i of e.parserErrors){let a;if(isNaN(i.token.startOffset)){if("previousToken"in i){const s=i.previousToken;if(isNaN(s.startOffset)){const o={line:0,character:0};a={start:o,end:o}}else{const o={line:s.endLine-1,character:s.endColumn};a={start:o,end:o}}}}else a=Uw(i.token);if(a){const s={severity:OC("error"),range:a,message:i.message,data:e0(ol.ParsingError),source:this.getSource()};r.push(s)}}}processLinkingErrors(e,r,n){var i;for(const a of e.references){const s=a.error;if(s){const o={node:s.info.container,range:(i=a.$refNode)==null?void 0:i.range,property:s.info.property,index:s.info.index,data:{code:ol.LinkingError,containerType:s.info.container.$type,property:s.info.property,refText:s.info.reference.$refText}};r.push(this.toDiagnostic("error",s.message,o))}}}async validateAst(e,r,n=Vn.CancellationToken.None){const i=[],a=E((s,o,l)=>{i.push(this.toDiagnostic(s,o,l))},"acceptor");return await this.validateAstBefore(e,r,a,n),await this.validateAstNodes(e,r,a,n),await this.validateAstAfter(e,r,a,n),i}async validateAstBefore(e,r,n,i=Vn.CancellationToken.None){const a=this.validationRegistry.checksBefore;for(const s of a)await Ea(i),await s(e,n,r.categories??[],i)}async validateAstNodes(e,r,n,i=Vn.CancellationToken.None){var a;if((a=this.profiler)!=null&&a.isActive("validating")){const s=this.profiler.createTask("validating",this.languageId);s.start();try{const o=Rl(e).iterator();for(const l of o){s.startSubTask(l.$type);const u=this.validateSingleNodeOptions(l,r);if(u.validateNode)try{const h=this.validationRegistry.getChecks(l.$type,r.categories);for(const d of h)await d(l,n,i)}finally{s.stopSubTask(l.$type)}u.validateChildren||o.prune()}}finally{s.stop()}}else{const s=Rl(e).iterator();for(const o of s){await Ea(i);const l=this.validateSingleNodeOptions(o,r);if(l.validateNode){const u=this.validationRegistry.getChecks(o.$type,r.categories);for(const h of u)await h(o,n,i)}l.validateChildren||s.prune()}}}validateSingleNodeOptions(e,r){return Gve}async validateAstAfter(e,r,n,i=Vn.CancellationToken.None){const a=this.validationRegistry.checksAfter;for(const s of a)await Ea(i),await s(e,n,r.categories??[],i)}toDiagnostic(e,r,n){return{message:r,range:dF(n),severity:OC(e),code:n.code,codeDescription:n.codeDescription,tags:n.tags,relatedInformation:n.relatedInformation,data:n.data,source:this.getSource()}}getSource(){return this.metadata.languageId}},E(n2,"DefaultDocumentValidator"),n2);function dF(t){if(t.range)return t.range;let e;return typeof t.property=="string"?e=c_(t.node.$cstNode,t.property,t.index):typeof t.keyword=="string"&&(e=QO(t.node.$cstNode,t.keyword,t.index)),e??(e=t.node.$cstNode),e?e.range:{start:{line:0,character:0},end:{line:0,character:0}}}E(dF,"getDiagnosticRange");function OC(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)}}E(OC,"toDiagnosticSeverity");function fF(t){switch(t){case"error":return e0(ol.LexingError);case"warning":return e0(ol.LexingWarning);case"info":return e0(ol.LexingInfo);case"hint":return e0(ol.LexingHint);default:throw new Error("Invalid diagnostic severity: "+t)}}E(fF,"toDiagnosticData");var ol;(function(t){t.LexingError="lexing-error",t.LexingWarning="lexing-warning",t.LexingInfo="lexing-info",t.LexingHint="lexing-hint",t.ParsingError="parsing-error",t.LinkingError="linking-error"})(ol||(ol={}));var Vve=(i2=class{constructor(e){this.astNodeLocator=e.workspace.AstNodeLocator,this.nameProvider=e.references.NameProvider}createDescription(e,r,n){const i=n??Al(e);r??(r=this.nameProvider.getName(e));const a=this.astNodeLocator.getAstNodePath(e);if(!r)throw new Error(`Node at path ${a} has no name.`);let s;const o=E(()=>s??(s=Xm(this.nameProvider.getNameNode(e)??e.$cstNode)),"nameSegmentGetter");return{node:e,name:r,get nameSegment(){return o()},selectionSegment:Xm(e.$cstNode),type:e.$type,documentUri:i.uri,path:a}}},E(i2,"DefaultAstNodeDescriptionProvider"),i2),Wve=(a2=class{constructor(e){this.nodeLocator=e.workspace.AstNodeLocator}async createDescriptions(e,r=Vn.CancellationToken.None){const n=[],i=e.parseResult.value;for(const a of Rl(i))await Ea(r),Bm(a).forEach(s=>{s.reference.error||n.push(...this.createInfoDescriptions(s))});return n}createInfoDescriptions(e){const r=e.reference;if(r.error||!r.$refNode)return[];let n=[];Ls(r)&&r.$nodeDescription?n=[r.$nodeDescription]:Ic(r)&&(n=r.items.map(l=>l.$nodeDescription).filter(l=>l!==void 0));const i=Al(e.container).uri,a=this.nodeLocator.getAstNodePath(e.container),s=[],o=Xm(r.$refNode);for(const l of n)s.push({sourceUri:i,sourcePath:a,targetUri:l.documentUri,targetPath:l.path,segment:o,local:Bs.equals(l.documentUri,i)});return s}},E(a2,"DefaultReferenceDescriptionProvider"),a2),Uve=(s2=class{constructor(){this.segmentSeparator="/",this.indexSeparator="@"}getAstNodePath(e){if(e.$container){const r=this.getAstNodePath(e.$container),n=this.getPathSegment(e);return r+this.segmentSeparator+n}return""}getPathSegment({$containerProperty:e,$containerIndex:r}){if(!e)throw new Error("Missing '$containerProperty' in AST node.");return r!==void 0?e+this.indexSeparator+r:e}getAstNode(e,r){return r.split(this.segmentSeparator).reduce((i,a)=>{if(!i||a.length===0)return i;const s=a.indexOf(this.indexSeparator);if(s>0){const o=a.substring(0,s),l=parseInt(a.substring(s+1)),u=i[o];return u==null?void 0:u[l]}return i[a]},e)}},E(s2,"DefaultAstNodeLocator"),s2),$6={};xS($6,e$(Dm()));var Hve=(o2=class{constructor(e){this._ready=new ih,this.onConfigurationSectionUpdateEmitter=new $6.Emitter,this.settings={},this.workspaceConfig=!1,this.serviceRegistry=e.ServiceRegistry}get ready(){return this._ready.promise}initialize(e){var r;this.workspaceConfig=((r=e.capabilities.workspace)==null?void 0:r.configuration)??!1}async initialized(e){if(this.workspaceConfig){if(e.register){const r=this.serviceRegistry.all;e.register({section:r.map(n=>this.toSectionName(n.LanguageMetaData.languageId))})}if(e.fetchConfiguration){const r=this.serviceRegistry.all.map(i=>({section:this.toSectionName(i.LanguageMetaData.languageId)})),n=await e.fetchConfiguration(r);r.forEach((i,a)=>{this.updateSectionConfiguration(i.section,n[a])})}}this._ready.resolve()}updateConfiguration(e){typeof e.settings!="object"||e.settings===null||Object.entries(e.settings).forEach(([r,n])=>{this.updateSectionConfiguration(r,n),this.onConfigurationSectionUpdateEmitter.fire({section:r,configuration:n})})}updateSectionConfiguration(e,r){this.settings[e]=r}async getConfiguration(e,r){await this.ready;const n=this.toSectionName(e);if(this.settings[n])return this.settings[n][r]}toSectionName(e){return`${e}`}get onConfigurationSectionUpdate(){return this.onConfigurationSectionUpdateEmitter.event}},E(o2,"DefaultConfigurationProvider"),o2),O6=e$(Ott()),t0;(function(t){function e(r){return{dispose:E(async()=>await r(),"dispose")}}E(e,"create"),t.create=e})(t0||(t0={}));var Yve=(l2=class{constructor(e){this.updateBuildOptions={validation:{categories:["built-in","fast"]}},this.updateListeners=[],this.buildPhaseListeners=new ah,this.documentPhaseListeners=new ah,this.buildState=new Map,this.documentBuildWaiters=new Map,this.currentState=jr.Changed,this.langiumDocuments=e.workspace.LangiumDocuments,this.langiumDocumentFactory=e.workspace.LangiumDocumentFactory,this.textDocuments=e.workspace.TextDocuments,this.indexManager=e.workspace.IndexManager,this.fileSystemProvider=e.workspace.FileSystemProvider,this.workspaceManager=()=>e.workspace.WorkspaceManager,this.serviceRegistry=e.ServiceRegistry}async build(e,r={},n=Vn.CancellationToken.None){var i;for(const a of e){const s=a.uri.toString();if(a.state===jr.Validated){if(typeof r.validation=="boolean"&&r.validation)this.resetToState(a,jr.IndexedReferences);else if(typeof r.validation=="object"){const o=this.findMissingValidationCategories(a,r);o.length>0&&(this.buildState.set(s,{completed:!1,options:{validation:{categories:o}},result:(i=this.buildState.get(s))==null?void 0:i.result}),a.state=jr.IndexedReferences)}}else this.buildState.delete(s)}this.currentState=jr.Changed,await this.emitUpdate(e.map(a=>a.uri),[]),await this.buildDocuments(e,r,n)}async update(e,r,n=Vn.CancellationToken.None){this.currentState=jr.Changed;const i=[];for(const l of r){const u=this.langiumDocuments.deleteDocuments(l);for(const h of u)i.push(h.uri),this.cleanUpDeleted(h)}const a=(await Promise.all(e.map(l=>this.findChangedUris(l)))).flat();for(const l of a){let u=this.langiumDocuments.getDocument(l);u===void 0&&(u=this.langiumDocumentFactory.fromModel({$type:"INVALID"},l),u.state=jr.Changed,this.langiumDocuments.addDocument(u)),this.resetToState(u,jr.Changed)}const s=En(a).concat(i).map(l=>l.toString()).toSet();this.langiumDocuments.all.filter(l=>!s.has(l.uri.toString())&&this.shouldRelink(l,s)).forEach(l=>this.resetToState(l,jr.ComputedScopes)),await this.emitUpdate(a,i),await Ea(n);const o=this.sortDocuments(this.langiumDocuments.all.filter(l=>{var u;return l.state=1}findMissingValidationCategories(e,r){var o,l;const n=this.buildState.get(e.uri.toString()),i=this.serviceRegistry.getServices(e.uri).validation.ValidationRegistry.getAllValidationCategories(e),a=(o=n==null?void 0:n.result)!=null&&o.validationChecks?new Set((l=n==null?void 0:n.result)==null?void 0:l.validationChecks):n!=null&&n.completed?i:new Set,s=r===void 0||r.validation===!0?i:typeof r.validation=="object"?r.validation.categories??i:[];return En(s).filter(u=>!a.has(u)).toArray()}async findChangedUris(e){var n;if(this.langiumDocuments.getDocument(e)??((n=this.textDocuments)==null?void 0:n.get(e)))return[e];try{const i=await this.fileSystemProvider.stat(e);if(i.isDirectory)return await this.workspaceManager().searchFolder(e);if(this.workspaceManager().shouldIncludeEntry(i))return[e]}catch{}return[]}async emitUpdate(e,r){await Promise.all(this.updateListeners.map(n=>n(e,r)))}sortDocuments(e){let r=0,n=e.length-1;for(;r=0&&!this.hasTextDocument(e[n]);)n--;rn.error!==void 0)?!0:this.indexManager.isAffected(e,r)}onUpdate(e){return this.updateListeners.push(e),t0.create(()=>{const r=this.updateListeners.indexOf(e);r>=0&&this.updateListeners.splice(r,1)})}resetToState(e,r){switch(r){case jr.Changed:case jr.Parsed:this.indexManager.removeContent(e.uri);case jr.IndexedContent:e.localSymbols=void 0;case jr.ComputedScopes:this.serviceRegistry.getServices(e.uri).references.Linker.unlink(e);case jr.Linked:this.indexManager.removeReferences(e.uri);case jr.IndexedReferences:e.diagnostics=void 0,this.buildState.delete(e.uri.toString());case jr.Validated:}e.state>r&&(e.state=r)}cleanUpDeleted(e){this.buildState.delete(e.uri.toString()),this.indexManager.remove(e.uri),e.state=jr.Changed}async buildDocuments(e,r,n){this.prepareBuild(e,r),await this.runCancelable(e,jr.Parsed,n,s=>this.langiumDocumentFactory.update(s,n)),await this.runCancelable(e,jr.IndexedContent,n,s=>this.indexManager.updateContent(s,n)),await this.runCancelable(e,jr.ComputedScopes,n,async s=>{const o=this.serviceRegistry.getServices(s.uri).references.ScopeComputation;s.localSymbols=await o.collectLocalSymbols(s,n)});const i=e.filter(s=>this.shouldLink(s));await this.runCancelable(i,jr.Linked,n,s=>this.serviceRegistry.getServices(s.uri).references.Linker.link(s,n)),await this.runCancelable(i,jr.IndexedReferences,n,s=>this.indexManager.updateReferences(s,n));const a=e.filter(s=>this.shouldValidate(s)?!0:(this.markAsCompleted(s),!1));await this.runCancelable(a,jr.Validated,n,async s=>{await this.validate(s,n),this.markAsCompleted(s)})}markAsCompleted(e){const r=this.buildState.get(e.uri.toString());r&&(r.completed=!0)}prepareBuild(e,r){for(const n of e){const i=n.uri.toString(),a=this.buildState.get(i);(!a||a.completed)&&this.buildState.set(i,{completed:!1,options:r,result:a==null?void 0:a.result})}}async runCancelable(e,r,n,i){for(const s of e)s.states.state===r);await this.notifyBuildPhase(a,r,n),this.currentState=r}onBuildPhase(e,r){return this.buildPhaseListeners.add(e,r),t0.create(()=>{this.buildPhaseListeners.delete(e,r)})}onDocumentPhase(e,r){return this.documentPhaseListeners.add(e,r),t0.create(()=>{this.documentPhaseListeners.delete(e,r)})}waitUntil(e,r,n){let i;return r&&"path"in r?i=r:n=r,n??(n=Vn.CancellationToken.None),i?this.awaitDocumentState(e,i,n):this.awaitBuilderState(e,n)}awaitDocumentState(e,r,n){const i=this.langiumDocuments.getDocument(r);if(i){if(i.state>=e)return Promise.resolve(r);if(n.isCancellationRequested)return Promise.reject(qc);if(this.currentState>=e&&e>i.state)return Promise.reject(new O6.ResponseError(O6.LSPErrorCodes.RequestFailed,`Document state of ${r.toString()} is ${jr[i.state]}, requiring ${jr[e]}, but workspace state is already ${jr[this.currentState]}. Returning undefined.`))}else return Promise.reject(new O6.ResponseError(O6.LSPErrorCodes.ServerCancelled,`No document found for URI: ${r.toString()}`));return new Promise((a,s)=>{const o=this.onDocumentPhase(e,u=>{Bs.equals(u.uri,r)&&(o.dispose(),l.dispose(),a(u.uri))}),l=n.onCancellationRequested(()=>{o.dispose(),l.dispose(),s(qc)})})}awaitBuilderState(e,r){return this.currentState>=e?Promise.resolve():r.isCancellationRequested?Promise.reject(qc):new Promise((n,i)=>{const a=this.onBuildPhase(e,()=>{a.dispose(),s.dispose(),n()}),s=r.onCancellationRequested(()=>{a.dispose(),s.dispose(),i(qc)})})}async notifyDocumentPhase(e,r,n){const a=this.documentPhaseListeners.get(r).slice();for(const s of a)try{await Ea(n),await s(e,n)}catch(o){if(!Qp(o))throw o}}async notifyBuildPhase(e,r,n){if(e.length===0)return;const a=this.buildPhaseListeners.get(r).slice();for(const s of a)await Ea(n),await s(e,n)}shouldLink(e){return this.getBuildOptions(e).eagerLinking??!0}shouldValidate(e){return!!this.getBuildOptions(e).validation}async validate(e,r){const n=this.serviceRegistry.getServices(e.uri).validation.DocumentValidator,i=this.getBuildOptions(e),a=typeof i.validation=="object"?{...i.validation}:{};a.categories=this.findMissingValidationCategories(e,i);const s=await n.validateDocument(e,a,r);e.diagnostics?e.diagnostics.push(...s):e.diagnostics=s;const o=this.buildState.get(e.uri.toString());o&&(o.result??(o.result={}),o.result.validationChecks?o.result.validationChecks=En(o.result.validationChecks).concat(a.categories).distinct().toArray():o.result.validationChecks=[...a.categories])}getBuildOptions(e){var r;return((r=this.buildState.get(e.uri.toString()))==null?void 0:r.options)??{}}},E(l2,"DefaultDocumentBuilder"),l2),Xve=(c2=class{constructor(e){this.symbolIndex=new Map,this.symbolByTypeIndex=new M6,this.referenceIndex=new Map,this.documents=e.workspace.LangiumDocuments,this.serviceRegistry=e.ServiceRegistry,this.astReflection=e.AstReflection}findAllReferences(e,r){const n=Al(e).uri,i=[];return this.referenceIndex.forEach(a=>{a.forEach(s=>{Bs.equals(s.targetUri,n)&&s.targetPath===r&&i.push(s)})}),En(i)}allElements(e,r){let n=En(this.symbolIndex.keys());return r&&(n=n.filter(i=>!r||r.has(i))),n.map(i=>this.getFileDescriptions(i,e)).flat()}getFileDescriptions(e,r){return r?this.symbolByTypeIndex.get(e,r,()=>(this.symbolIndex.get(e)??[]).filter(a=>this.astReflection.isSubtype(a.type,r))):this.symbolIndex.get(e)??[]}remove(e){this.removeContent(e),this.removeReferences(e)}removeContent(e){const r=e.toString();this.symbolIndex.delete(r),this.symbolByTypeIndex.clear(r)}removeReferences(e){const r=e.toString();this.referenceIndex.delete(r)}async updateContent(e,r=Vn.CancellationToken.None){const i=await this.serviceRegistry.getServices(e.uri).references.ScopeComputation.collectExportedSymbols(e,r),a=e.uri.toString();this.symbolIndex.set(a,i),this.symbolByTypeIndex.clear(a)}async updateReferences(e,r=Vn.CancellationToken.None){const i=await this.serviceRegistry.getServices(e.uri).workspace.ReferenceDescriptionProvider.createDescriptions(e,r);this.referenceIndex.set(e.uri.toString(),i)}isAffected(e,r){const n=this.referenceIndex.get(e.uri.toString());return n?n.some(i=>!i.local&&r.has(i.targetUri.toString())):!1}},E(c2,"DefaultIndexManager"),c2),jve=(u2=class{constructor(e){this.initialBuildOptions={},this._ready=new ih,this.serviceRegistry=e.ServiceRegistry,this.langiumDocuments=e.workspace.LangiumDocuments,this.documentBuilder=e.workspace.DocumentBuilder,this.fileSystemProvider=e.workspace.FileSystemProvider,this.mutex=e.workspace.WorkspaceLock}get ready(){return this._ready.promise}get workspaceFolders(){return this.folders}initialize(e){this.folders=e.workspaceFolders??void 0}initialized(e){return this.mutex.write(r=>this.initializeWorkspace(this.folders??[],r))}async initializeWorkspace(e,r=Vn.CancellationToken.None){const n=await this.performStartup(e);await Ea(r),await this.documentBuilder.build(n,this.initialBuildOptions,r)}async performStartup(e){const r=[],n=E(s=>{r.push(s),this.langiumDocuments.hasDocument(s.uri)||this.langiumDocuments.addDocument(s)},"collector");await this.loadAdditionalDocuments(e,n);const i=[];await Promise.all(e.map(s=>this.getRootFolder(s)).map(async s=>this.traverseFolder(s,i)));const a=En(i).distinct(s=>s.toString()).filter(s=>!this.langiumDocuments.hasDocument(s));return await this.loadWorkspaceDocuments(a,n),this._ready.resolve(),r}async loadWorkspaceDocuments(e,r){await Promise.all(e.map(async n=>{const i=await this.langiumDocuments.getOrCreateDocument(n);r(i)}))}loadAdditionalDocuments(e,r){return Promise.resolve()}getRootFolder(e){return Oo.parse(e.uri)}async traverseFolder(e,r){try{const n=await this.fileSystemProvider.readDirectory(e);await Promise.all(n.map(async i=>{this.shouldIncludeEntry(i)&&(i.isDirectory?await this.traverseFolder(i.uri,r):i.isFile&&r.push(i.uri))}))}catch(n){console.error("Failure to read directory content of "+e.toString(!0),n)}}async searchFolder(e){const r=[];return await this.traverseFolder(e,r),r}shouldIncludeEntry(e){const r=Bs.basename(e.uri);return r.startsWith(".")?!1:e.isDirectory?r!=="node_modules"&&r!=="out":e.isFile?this.serviceRegistry.hasServices(e.uri):!1}},E(u2,"DefaultWorkspaceManager"),u2),Kve=(h2=class{buildUnexpectedCharactersMessage(e,r,n,i,a){return HP.buildUnexpectedCharactersMessage(e,r,n,i,a)}buildUnableToPopLexerModeMessage(e){return HP.buildUnableToPopLexerModeMessage(e)}},E(h2,"DefaultLexerErrorMessageProvider"),h2),pF={mode:"full"},gF=(d2=class{constructor(e){this.errorMessageProvider=e.parser.LexerErrorMessageProvider,this.tokenBuilder=e.parser.TokenBuilder;const r=this.tokenBuilder.buildTokens(e.Grammar,{caseInsensitive:e.LanguageMetaData.caseInsensitive});this.tokenTypes=this.toTokenTypeDictionary(r);const n=F6(r)?Object.values(r):r,i=e.LanguageMetaData.mode==="production";this.chevrotainLexer=new $s(n,{positionTracking:"full",skipValidations:i,errorMessageProvider:this.errorMessageProvider})}get definition(){return this.tokenTypes}tokenize(e,r=pF){var i,a;const n=this.chevrotainLexer.tokenize(e);return{tokens:n.tokens,errors:n.errors,hidden:n.groups.hidden??[],report:(a=(i=this.tokenBuilder).flushLexingReport)==null?void 0:a.call(i,e)}}toTokenTypeDictionary(e){if(F6(e))return e;const r=B6(e)?Object.values(e.modes).flat():e,n={};return r.forEach(i=>n[i.name]=i),n}},E(d2,"DefaultLexer"),d2);function P6(t){return Array.isArray(t)&&(t.length===0||"name"in t[0])}E(P6,"isTokenTypeArray");function B6(t){return t&&"modes"in t&&"defaultMode"in t}E(B6,"isIMultiModeLexerDefinition");function F6(t){return!P6(t)&&!B6(t)}E(F6,"isTokenTypeDictionary"),Iw();function mF(t,e,r){let n,i;typeof t=="string"?(i=e,n=r):(i=t.range.start,n=e),i||(i=gn.create(0,0));const a=vF(t),s=G6(n),o=Qve({lines:a,position:i,options:s});return t2e({index:0,tokens:o,position:i})}E(mF,"parseJSDoc");function yF(t,e){const r=G6(e),n=vF(t);if(n.length===0)return!1;const i=n[0],a=n[n.length-1],s=r.start,o=r.end;return!!(s!=null&&s.exec(i))&&!!(o!=null&&o.exec(a))}E(yF,"isJSDoc");function vF(t){let e="";return typeof t=="string"?e=t:e=t.text,e.split($ce)}E(vF,"getLines");var Zve=/\s*(@([\p{L}][\p{L}\p{N}]*)?)/uy,nft=/\{(@[\p{L}][\p{L}\p{N}]*)(\s*)([^\r\n}]+)?\}/gu;function Qve(t){var i,a,s;const e=[];let r=t.position.line,n=t.position.character;for(let o=0;o=h.length){if(e.length>0){const p=gn.create(r,n);e.push({type:"break",content:"",range:en.create(p,p)})}}else{Zve.lastIndex=d;const p=Zve.exec(h);if(p){const g=p[0],m=p[1],y=gn.create(r,n+d),v=gn.create(r,n+d+g.length);e.push({type:"tag",content:m,range:en.create(y,v)}),d+=g.length,d=z6(h,d)}if(d0&&e[e.length-1].type==="break"?e.slice(0,-1):e}E(Qve,"tokenize");function Jve(t,e,r,n){const i=[];if(t.length===0){const a=gn.create(r,n),s=gn.create(r,n+e.length);i.push({type:"text",content:e,range:en.create(a,s)})}else{let a=0;for(const o of t){const l=o.index,u=e.substring(a,l);u.length>0&&i.push({type:"text",content:e.substring(a,l),range:en.create(gn.create(r,a+n),gn.create(r,l+n))});let h=u.length+1;const d=o[1];if(i.push({type:"inline-tag",content:d,range:en.create(gn.create(r,a+h+n),gn.create(r,a+h+d.length+n))}),h+=d.length,o.length===4){h+=o[2].length;const f=o[3];i.push({type:"text",content:f,range:en.create(gn.create(r,a+h+n),gn.create(r,a+h+f.length+n))})}else i.push({type:"text",content:"",range:en.create(gn.create(r,a+h+n),gn.create(r,a+h+n))});a=l+o[0].length}const s=e.substring(a);s.length>0&&i.push({type:"text",content:s,range:en.create(gn.create(r,a+n),gn.create(r,a+n+s.length))})}return i}E(Jve,"buildInlineTokens");var ift=/\S/,aft=/\s*$/;function z6(t,e){const r=t.substring(e).match(ift);return r?e+r.index:t.length}E(z6,"skipWhitespace");function e2e(t){const e=t.match(aft);if(e&&typeof e.index=="number")return e.index}E(e2e,"lastCharacter");function t2e(t){var a,s;const e=gn.create(t.position.line,t.position.character);if(t.tokens.length===0)return new a2e([],en.create(e,e));const r=[];for(;t.indexr.name===e)}getTags(e){return this.getAllTags().filter(r=>r.name===e)}getAllTags(){return this.elements.filter(e=>"name"in e)}toString(){let e="";for(const r of this.elements)if(e.length===0)e=r.toString();else{const n=r.toString();e+=kF(e)+n}return e.trim()}toMarkdown(e){let r="";for(const n of this.elements)if(r.length===0)r=n.toMarkdown(e);else{const i=n.toMarkdown(e);r+=kF(r)+i}return r.trim()}},E(f2,"JSDocCommentImpl"),f2),wF=(p2=class{constructor(e,r,n,i){this.name=e,this.content=r,this.inline=n,this.range=i}toString(){let e=`@${this.name}`;const r=this.content.toString();return this.content.inlines.length===1?e=`${e} ${r}`:this.content.inlines.length>1&&(e=`${e} +${r}`),this.inline?`{${e}}`:e}toMarkdown(e){var r;return((r=e==null?void 0:e.renderTag)==null?void 0:r.call(e,this))??this.toMarkdownDefault(e)}toMarkdownDefault(e){const r=this.content.toMarkdown(e);if(this.inline){const a=s2e(this.name,r,e??{});if(typeof a=="string")return a}let n="";(e==null?void 0:e.tag)==="italic"||(e==null?void 0:e.tag)===void 0?n="*":(e==null?void 0:e.tag)==="bold"?n="**":(e==null?void 0:e.tag)==="bold-italic"&&(n="***");let i=`${n}@${this.name}${n}`;return this.content.inlines.length===1?i=`${i} — ${r}`:this.content.inlines.length>1&&(i=`${i} +${r}`),this.inline?`{${i}}`:i}},E(p2,"JSDocTagImpl"),p2);function s2e(t,e,r){var n;if(t==="linkplain"||t==="linkcode"||t==="link"){const i=e.indexOf(" ");let a=e;if(i>0){const o=z6(e,i);a=e.substring(o),e=e.substring(0,i)}return(t==="linkcode"||t==="link"&&r.link==="code")&&(a=`\`${a}\``),((n=r.renderLink)==null?void 0:n.call(r,e,a))??o2e(e,a)}}E(s2e,"renderInlineTag");function o2e(t,e){try{return Oo.parse(t,!0),`[${e}](${t})`}catch{return t}}E(o2e,"renderLinkDefault");var CF=(g2=class{constructor(e,r){this.inlines=e,this.range=r}toString(){let e="";for(let r=0;rn.range.start.line&&(e+=` `)}return e}toMarkdown(e){let r="";for(let n=0;ni.range.start.line&&(r+=` -`)}return r}},E($y,"JSDocTextImpl"),$y),Ufe=(Py=class{constructor(e,r){this.text=e,this.range=r}toString(){return this.text}toMarkdown(){return this.text}},E(Py,"JSDocLineImpl"),Py);function KN(t){return t.endsWith(` +`)}return r}},E(g2,"JSDocTextImpl"),g2),l2e=(m2=class{constructor(e,r){this.text=e,this.range=r}toString(){return this.text}toMarkdown(){return this.text}},E(m2,"JSDocLineImpl"),m2);function kF(t){return t.endsWith(` `)?` `:` -`}E(KN,"fillNewlines");var Hfe=(By=class{constructor(e){this.indexManager=e.shared.workspace.IndexManager,this.commentProvider=e.documentation.CommentProvider}getDocumentation(e){const r=this.commentProvider.getComment(e);if(r&&qN(r))return GN(r).toMarkdown({renderLink:E((i,a)=>this.documentationLinkRenderer(e,i,a),"renderLink"),renderTag:E(i=>this.documentationTagRenderer(e,i),"renderTag")})}documentationLinkRenderer(e,r,n){const i=this.findNameInLocalSymbols(e,r)??this.findNameInGlobalScope(e,r);if(i&&i.nameSegment){const a=i.nameSegment.range.start.line+1,s=i.nameSegment.range.start.character+1,o=i.documentUri.with({fragment:`L${a},${s}`});return`[${n}](${o.toString()})`}else return}documentationTagRenderer(e,r){}findNameInLocalSymbols(e,r){const i=qo(e).localSymbols;if(!i)return;let a=e;do{const o=i.getStream(a).find(l=>l.name===r);if(o)return o;a=a.$container}while(a)}findNameInGlobalScope(e,r){return this.indexManager.allElements().find(i=>i.name===r)}},E(By,"JSDocDocumentationProvider"),By),Yfe=(Fy=class{constructor(e){this.grammarConfig=()=>e.parser.GrammarConfig}getComment(e){var r;return ON(e)?e.$comment:(r=aD(e.$cstNode,this.grammarConfig().multilineCommentRules))==null?void 0:r.text}},E(Fy,"DefaultCommentProvider"),Fy),Xfe=(zy=class{constructor(e){this.syncParser=e.parser.LangiumParser}parse(e,r){return Promise.resolve(this.syncParser.parse(e))}},E(zy,"DefaultAsyncParser"),zy),xnt=(Gy=class{constructor(e){this.threadCount=8,this.terminationDelay=200,this.workerPool=[],this.queue=[],this.hydrator=e.serializer.Hydrator}initializeWorkers(){for(;this.workerPool.length{if(this.queue.length>0){const r=this.queue.shift();r&&(e.lock(),r.resolve(e))}}),this.workerPool.push(e)}}async parse(e,r){const n=await this.acquireParserWorker(r),i=new au;let a;const s=r.onCancellationRequested(()=>{a=setTimeout(()=>{this.terminateWorker(n)},this.terminationDelay)});return n.parse(e).then(o=>{const l=this.hydrator.hydrate(o);i.resolve(l)}).catch(o=>{i.reject(o)}).finally(()=>{s.dispose(),clearTimeout(a)}),i.promise}terminateWorker(e){e.terminate();const r=this.workerPool.indexOf(e);r>=0&&this.workerPool.splice(r,1)}async acquireParserWorker(e){this.initializeWorkers();for(const n of this.workerPool)if(n.ready)return n.lock(),n;const r=new au;return e.onCancellationRequested(()=>{const n=this.queue.indexOf(r);n>=0&&this.queue.splice(n,1),r.reject(Jl)}),this.queue.push(r),r.promise}},E(Gy,"AbstractThreadedAsyncParser"),Gy),Tnt=(qy=class{get ready(){return this._ready}get onReady(){return this.onReadyEmitter.event}constructor(e,r,n,i){this.onReadyEmitter=new $E.Emitter,this.deferred=new au,this._ready=!0,this._parsing=!1,this.sendMessage=e,this._terminate=i,r(a=>{const s=a;this.deferred.resolve(s),this.unlock()}),n(a=>{this.deferred.reject(a),this.unlock()})}terminate(){this.deferred.reject(Jl),this._terminate()}lock(){this._ready=!1}unlock(){this._parsing=!1,this._ready=!0,this.onReadyEmitter.fire()}parse(e){if(this._parsing)throw new Error("Parser worker is busy");return this._parsing=!0,this.deferred=new au,this.sendMessage(e),this.deferred.promise}},E(qy,"ParserWorker"),qy),Kfe=(Vy=class{constructor(){this.previousTokenSource=new _n.CancellationTokenSource,this.writeQueue=[],this.readQueue=[],this.done=!0}write(e){this.cancelWrite();const r=RE();return this.previousTokenSource=r,this.enqueue(this.writeQueue,e,r.token)}read(e){return this.enqueue(this.readQueue,e)}enqueue(e,r,n=_n.CancellationToken.None){const i=new au,a={action:r,deferred:i,cancellationToken:n};return e.push(a),this.performNextOperation(),i.promise}async performNextOperation(){if(!this.done)return;const e=[];if(this.writeQueue.length>0)e.push(this.writeQueue.shift());else if(this.readQueue.length>0)e.push(...this.readQueue.splice(0,this.readQueue.length));else return;this.done=!1,await Promise.all(e.map(async({action:r,deferred:n,cancellationToken:i})=>{try{const a=await Promise.resolve().then(()=>r(i));n.resolve(a)}catch(a){$f(a)?n.resolve(void 0):n.reject(a)}})),this.done=!0,this.performNextOperation()}cancelWrite(){this.previousTokenSource.cancel()}},E(Vy,"DefaultWorkspaceLock"),Vy),jfe=(Wy=class{constructor(e){this.grammarElementIdMap=new DE,this.tokenTypeIdMap=new DE,this.grammar=e.Grammar,this.lexer=e.parser.Lexer,this.linker=e.references.Linker}dehydrate(e){return{lexerErrors:e.lexerErrors,lexerReport:e.lexerReport?this.dehydrateLexerReport(e.lexerReport):void 0,parserErrors:e.parserErrors.map(r=>({...r,message:r.message})),value:this.dehydrateAstNode(e.value,this.createDehyrationContext(e.value))}}dehydrateLexerReport(e){return e}createDehyrationContext(e){const r=new Map,n=new Map;for(const i of Vo(e))r.set(i,{});if(e.$cstNode)for(const i of pg(e.$cstNode))n.set(i,{});return{astNodes:r,cstNodes:n}}dehydrateAstNode(e,r){const n=r.astNodes.get(e);n.$type=e.$type,n.$containerIndex=e.$containerIndex,n.$containerProperty=e.$containerProperty,e.$cstNode!==void 0&&(n.$cstNode=this.dehydrateCstNode(e.$cstNode,r));for(const[i,a]of Object.entries(e))if(!i.startsWith("$"))if(Array.isArray(a)){const s=[];n[i]=s;for(const o of a)Ii(o)?s.push(this.dehydrateAstNode(o,r)):es(o)?s.push(this.dehydrateReference(o,r)):s.push(o)}else Ii(a)?n[i]=this.dehydrateAstNode(a,r):es(a)?n[i]=this.dehydrateReference(a,r):a!==void 0&&(n[i]=a);return n}dehydrateReference(e,r){const n={};return n.$refText=e.$refText,e.$refNode&&(n.$refNode=r.cstNodes.get(e.$refNode)),n}dehydrateCstNode(e,r){const n=r.cstNodes.get(e);return I3(e)?n.fullText=e.fullText:n.grammarSource=this.getGrammarElementId(e.grammarSource),n.hidden=e.hidden,n.astNode=r.astNodes.get(e.astNode),Wc(e)?n.content=e.content.map(i=>this.dehydrateCstNode(i,r)):Kd(e)&&(n.tokenType=e.tokenType.name,n.offset=e.offset,n.length=e.length,n.startLine=e.range.start.line,n.startColumn=e.range.start.character,n.endLine=e.range.end.line,n.endColumn=e.range.end.character),n}hydrate(e){const r=e.value,n=this.createHydrationContext(r);return"$cstNode"in r&&this.hydrateCstNode(r.$cstNode,n),{lexerErrors:e.lexerErrors,lexerReport:e.lexerReport,parserErrors:e.parserErrors,value:this.hydrateAstNode(r,n)}}createHydrationContext(e){const r=new Map,n=new Map;for(const a of Vo(e))r.set(a,{});let i;if(e.$cstNode)for(const a of pg(e.$cstNode)){let s;"fullText"in a?(s=new yN(a.fullText),i=s):"content"in a?s=new xE:"tokenType"in a&&(s=this.hydrateCstLeafNode(a)),s&&(n.set(a,s),s.root=i)}return{astNodes:r,cstNodes:n}}hydrateAstNode(e,r){const n=r.astNodes.get(e);n.$type=e.$type,n.$containerIndex=e.$containerIndex,n.$containerProperty=e.$containerProperty,e.$cstNode&&(n.$cstNode=r.cstNodes.get(e.$cstNode));for(const[i,a]of Object.entries(e))if(!i.startsWith("$"))if(Array.isArray(a)){const s=[];n[i]=s;for(const o of a)Ii(o)?s.push(this.setParent(this.hydrateAstNode(o,r),n)):es(o)?s.push(this.hydrateReference(o,n,i,r)):s.push(o)}else Ii(a)?n[i]=this.setParent(this.hydrateAstNode(a,r),n):es(a)?n[i]=this.hydrateReference(a,n,i,r):a!==void 0&&(n[i]=a);return n}setParent(e,r){return e.$container=r,e}hydrateReference(e,r,n,i){return this.linker.buildReference(r,n,i.cstNodes.get(e.$refNode),e.$refText)}hydrateCstNode(e,r,n=0){const i=r.cstNodes.get(e);if(typeof e.grammarSource=="number"&&(i.grammarSource=this.getGrammarElement(e.grammarSource)),i.astNode=r.astNodes.get(e.astNode),Wc(i))for(const a of e.content){const s=this.hydrateCstNode(a,r,n++);i.content.push(s)}return i}hydrateCstLeafNode(e){const r=this.getTokenType(e.tokenType),n=e.offset,i=e.length,a=e.startLine,s=e.startColumn,o=e.endLine,l=e.endColumn,u=e.hidden;return new bE(n,i,{start:{line:a,character:s},end:{line:o,character:l}},r,u)}getTokenType(e){return this.lexer.definition[e]}getGrammarElementId(e){if(e)return this.grammarElementIdMap.size===0&&this.createGrammarElementIdMap(),this.grammarElementIdMap.get(e)}getGrammarElement(e){return this.grammarElementIdMap.size===0&&this.createGrammarElementIdMap(),this.grammarElementIdMap.getKey(e)}createGrammarElementIdMap(){let e=0;for(const r of Vo(this.grammar))O3(r)&&this.grammarElementIdMap.set(r,e++)}},E(Wy,"DefaultHydrator"),Wy);function na(t){return{documentation:{CommentProvider:E(e=>new Yfe(e),"CommentProvider"),DocumentationProvider:E(e=>new Hfe(e),"DocumentationProvider")},parser:{AsyncParser:E(e=>new Xfe(e),"AsyncParser"),GrammarConfig:E(e=>ID(e),"GrammarConfig"),LangiumParser:E(e=>CN(e),"LangiumParser"),CompletionParser:E(e=>wN(e),"CompletionParser"),ValueConverter:E(()=>new EN,"ValueConverter"),TokenBuilder:E(()=>new SE,"TokenBuilder"),Lexer:E(e=>new zN(e),"Lexer"),ParserErrorMessageProvider:E(()=>new bN,"ParserErrorMessageProvider"),LexerErrorMessageProvider:E(()=>new Mfe,"LexerErrorMessageProvider")},workspace:{AstNodeLocator:E(()=>new _fe,"AstNodeLocator"),AstNodeDescriptionProvider:E(e=>new Sfe(e),"AstNodeDescriptionProvider"),ReferenceDescriptionProvider:E(e=>new Afe(e),"ReferenceDescriptionProvider")},references:{Linker:E(e=>new pfe(e),"Linker"),NameProvider:E(()=>new gfe,"NameProvider"),ScopeProvider:E(e=>new xfe(e),"ScopeProvider"),ScopeComputation:E(e=>new yfe(e),"ScopeComputation"),References:E(e=>new mfe(e),"References")},serializer:{Hydrator:E(e=>new jfe(e),"Hydrator"),JsonSerializer:E(e=>new Tfe(e),"JsonSerializer")},validation:{DocumentValidator:E(e=>new Efe(e),"DocumentValidator"),ValidationRegistry:E(e=>new Cfe(e),"ValidationRegistry")},shared:E(()=>t.shared,"shared")}}E(na,"createDefaultCoreModule");function ia(t){return{ServiceRegistry:E(e=>new wfe(e),"ServiceRegistry"),workspace:{LangiumDocuments:E(e=>new ffe(e),"LangiumDocuments"),LangiumDocumentFactory:E(e=>new dfe(e),"LangiumDocumentFactory"),DocumentBuilder:E(e=>new Lfe(e),"DocumentBuilder"),IndexManager:E(e=>new Ife(e),"IndexManager"),WorkspaceManager:E(e=>new Dfe(e),"WorkspaceManager"),FileSystemProvider:E(e=>t.fileSystemProvider(e),"FileSystemProvider"),WorkspaceLock:E(()=>new Kfe,"WorkspaceLock"),ConfigurationProvider:E(e=>new Rfe(e),"ConfigurationProvider")},profilers:{}}}E(ia,"createDefaultSharedCoreModule");var jN;(function(t){t.merge=(e,r)=>Mg(Mg({},e),r)})(jN||(jN={}));function Xr(t,e,r,n,i,a,s,o,l){const u=[t,e,r,n,i,a,s,o,l].reduce(Mg,{});return QN(u)}E(Xr,"inject");var Zfe=Symbol("isProxy");function ZN(t){if(t&&t[Zfe])for(const e of Object.values(t))ZN(e);return t}E(ZN,"eagerLoad");function QN(t,e){const r=new Proxy({},{deleteProperty:E(()=>!1,"deleteProperty"),set:E(()=>{throw new Error("Cannot set property on injected service container")},"set"),get:E((n,i)=>i===Zfe?!0:JN(n,i,t,e||r),"get"),getOwnPropertyDescriptor:E((n,i)=>(JN(n,i,t,e||r),Object.getOwnPropertyDescriptor(n,i)),"getOwnPropertyDescriptor"),has:E((n,i)=>i in t,"has"),ownKeys:E(()=>[...Object.getOwnPropertyNames(t)],"ownKeys")});return r}E(QN,"_inject");var Qfe=Symbol();function JN(t,e,r,n){if(e in t){if(t[e]instanceof Error)throw new Error("Construction failure. Please make sure that your dependencies are constructable. Cause: "+t[e]);if(t[e]===Qfe)throw new Error('Cycle detected. Please make "'+String(e)+'" lazy. Visit https://langium.org/docs/reference/configuration-services/#resolving-cyclic-dependencies');return t[e]}else if(e in r){const i=r[e];t[e]=Qfe;try{t[e]=typeof i=="function"?i(n):QN(i,n)}catch(a){throw t[e]=a instanceof Error?a:void 0,a}return t[e]}else return}E(JN,"_resolve");function Mg(t,e){if(e){for(const[r,n]of Object.entries(e))if(n!=null)if(typeof n=="object"){const i=t[r];typeof i=="object"&&i!==null?t[r]=Mg(i,n):t[r]=Mg({},n)}else t[r]=n}return t}E(Mg,"_merge");var eO={indentTokenName:"INDENT",dedentTokenName:"DEDENT",whitespaceTokenName:"WS",ignoreIndentationDelimiters:[]},zf;(function(t){t.REGULAR="indentation-sensitive",t.IGNORE_INDENTATION="ignore-indentation"})(zf||(zf={}));var Jfe=(Uy=class extends SE{constructor(e=eO){super(),this.indentationStack=[0],this.whitespaceRegExp=/[ \t]+/y,this.options={...eO,...e},this.indentTokenType=Sg({name:this.options.indentTokenName,pattern:this.indentMatcher.bind(this),line_breaks:!1}),this.dedentTokenType=Sg({name:this.options.dedentTokenName,pattern:this.dedentMatcher.bind(this),line_breaks:!1})}buildTokens(e,r){const n=super.buildTokens(e,r);if(!BE(n))throw new Error("Invalid tokens built by default builder");const{indentTokenName:i,dedentTokenName:a,whitespaceTokenName:s,ignoreIndentationDelimiters:o}=this.options;let l,u,h;const d=[];for(const f of n){for(const[p,g]of o)f.name===p?f.PUSH_MODE=zf.IGNORE_INDENTATION:f.name===g&&(f.POP_MODE=!0);f.name===a?l=f:f.name===i?u=f:f.name===s?h=f:d.push(f)}if(!l||!u||!h)throw new Error("Some indentation/whitespace tokens not found!");return o.length>0?{modes:{[zf.REGULAR]:[l,u,...d,h],[zf.IGNORE_INDENTATION]:[...d,h]},defaultMode:zf.REGULAR}:[l,u,h,...d]}flushLexingReport(e){return{...super.flushLexingReport(e),remainingDedents:this.flushRemainingDedents(e)}}isStartOfLine(e,r){return r===0||`\r -`.includes(e[r-1])}matchWhitespace(e,r,n,i){this.whitespaceRegExp.lastIndex=r;const a=this.whitespaceRegExp.exec(e);return{currIndentLevel:(a==null?void 0:a[0].length)??0,prevIndentLevel:this.indentationStack.at(-1),match:a}}createIndentationTokenInstance(e,r,n,i){const a=this.getLineNumber(r,i);return pT(e,n,i,i+n.length,a,a,1,n.length)}getLineNumber(e,r){return e.substring(0,r).split(/\r\n|\r|\n/).length}indentMatcher(e,r,n,i){if(!this.isStartOfLine(e,r))return null;const{currIndentLevel:a,prevIndentLevel:s,match:o}=this.matchWhitespace(e,r,n,i);return a<=s?null:(this.indentationStack.push(a),o)}dedentMatcher(e,r,n,i){var d,f;if(!this.isStartOfLine(e,r))return null;const{currIndentLevel:a,prevIndentLevel:s,match:o}=this.matchWhitespace(e,r,n,i);if(a>=s)return null;const l=this.indentationStack.lastIndexOf(a);if(l===-1)return this.diagnostics.push({severity:"error",message:`Invalid dedent level ${a} at offset: ${r}. Current indentation stack: ${this.indentationStack}`,offset:r,length:((d=o==null?void 0:o[0])==null?void 0:d.length)??0,line:this.getLineNumber(e,r),column:1}),null;const u=this.indentationStack.length-l-1,h=((f=e.substring(0,r).match(/[\r\n]+$/))==null?void 0:f[0].length)??1;for(let p=0;p1;)r.push(this.createIndentationTokenInstance(this.dedentTokenType,e,"",e.length)),this.indentationStack.pop();return this.indentationStack=[0],r}},E(Uy,"IndentationAwareTokenBuilder"),Uy),wnt=(Hy=class extends zN{constructor(e){if(super(e),e.parser.TokenBuilder instanceof Jfe)this.indentationTokenBuilder=e.parser.TokenBuilder;else throw new Error("IndentationAwareLexer requires an accompanying IndentationAwareTokenBuilder")}tokenize(e,r=FN){const n=super.tokenize(e),i=n.report;(r==null?void 0:r.mode)==="full"&&n.tokens.push(...i.remainingDedents),i.remainingDedents=[];const{indentTokenType:a,dedentTokenType:s}=this.indentationTokenBuilder,o=a.tokenTypeIdx,l=s.tokenTypeIdx,u=[],h=n.tokens.length-1;for(let d=0;d=0&&u.push(n.tokens[h]),n.tokens=u,n}},E(Hy,"IndentationAwareLexer"),Hy),tO={};fh(tO,{AstUtils:()=>M9,BiMap:()=>DE,Cancellation:()=>_n,ContextCache:()=>NE,CstUtils:()=>L9,DONE_RESULT:()=>ts,Deferred:()=>au,Disposable:()=>Ff,DisposableCache:()=>ME,DocumentCache:()=>bfe,EMPTY_STREAM:()=>tg,ErrorWithLocation:()=>rk,GrammarUtils:()=>uD,MultiMap:()=>su,OperationCancelled:()=>Jl,Reduction:()=>Ax,RegExpUtils:()=>dD,SimpleCache:()=>MN,StreamImpl:()=>Vl,TreeStreamImpl:()=>rg,URI:()=>eo,UriTrie:()=>LN,UriUtils:()=>ls,WorkspaceCache:()=>NN,assertCondition:()=>hD,assertUnreachable:()=>xh,delayNextTick:()=>AE,interruptAndCheck:()=>ra,isOperationCancelled:()=>$f,loadGrammarFromJson:()=>aa,setInterruptionPeriod:()=>SN,startCancelableOperation:()=>RE,stream:()=>pn}),T3(tO,$E);var e0e=(Yy=class{stat(e){throw new Error("No file system is available.")}statSync(e){throw new Error("No file system is available.")}async exists(){return!1}existsSync(){return!1}readBinary(){throw new Error("No file system is available.")}readBinarySync(){throw new Error("No file system is available.")}readFile(){throw new Error("No file system is available.")}readFileSync(){throw new Error("No file system is available.")}async readDirectory(){return[]}readDirectorySync(){return[]}},E(Yy,"EmptyFileSystemProvider"),Yy),ba={fileSystemProvider:E(()=>new e0e,"fileSystemProvider")},Cnt={Grammar:E(()=>{},"Grammar"),LanguageMetaData:E(()=>({caseInsensitive:!1,fileExtensions:[".langium"],languageId:"langium"}),"LanguageMetaData")},knt={AstReflection:E(()=>new eD,"AstReflection")};function t0e(){const t=Xr(ia(ba),knt),e=Xr(na({shared:t}),Cnt);return t.ServiceRegistry.register(e),e}E(t0e,"createMinimalGrammarServices");function aa(t){const e=t0e(),r=e.serializer.JsonSerializer.deserialize(t);return e.shared.workspace.LangiumDocumentFactory.fromModel(r,eo.parse(`memory:/${r.name??"grammar"}.langium`)),r}E(aa,"loadGrammarFromJson"),T3(qte,tO);var Ent=(Xy=class{constructor(e){this.activeCategories=new Set,this.allCategories=new Set(["validating","parsing","linking"]),this.activeCategories=e??new Set(this.allCategories),this.records=new su}isActive(e){return this.activeCategories.has(e)}start(...e){e?e.forEach(r=>this.activeCategories.add(r)):this.activeCategories=new Set(this.allCategories)}stop(...e){e?e.forEach(r=>this.activeCategories.delete(r)):this.activeCategories.clear()}createTask(e,r){if(!this.isActive(e))throw new Error(`Category "${e}" is not active.`);return console.log(`Creating profiling task for '${e}.${r}'.`),new r0e(n=>this.records.add(e,this.dumpRecord(e,n)),r)}dumpRecord(e,r){console.info(`Task ${e}.${r.identifier} executed in ${r.duration.toFixed(2)}ms and ended at ${r.date.toISOString()}`);const n=[];for(const s of r.entries.keys()){const o=r.entries.get(s),l=o.reduce((u,h)=>u+h);n.push({name:`${r.identifier}.${s}`,count:o.length,duration:l})}const i=r.duration-n.map(s=>s.duration).reduce((s,o)=>s+o,0);n.push({name:r.identifier,count:1,duration:i}),n.sort((s,o)=>o.duration-s.duration);function a(s){return Math.round(100*s)/100}return E(a,"Round"),console.table(n.map(s=>({Element:s.name,Count:s.count,"Self %":a(100*s.duration/r.duration),"Time (ms)":a(s.duration)}))),r}getRecords(...e){return e.length===0?this.records.values():this.records.entries().filter(r=>e.some(n=>n===r[0])).flatMap(r=>r[1])}},E(Xy,"DefaultLangiumProfiler"),Xy),r0e=(Ky=class{constructor(e,r){this.stack=[],this.entries=new su,this.addRecord=e,this.identifier=r}start(){if(this.startTime!==void 0)throw new Error(`Task "${this.identifier}" is already started.`);this.startTime=performance.now()}stop(){if(this.startTime===void 0)throw new Error(`Task "${this.identifier}" was not started.`);if(this.stack.length!==0)throw new Error(`Task "${this.identifier}" cannot be stopped before sub-task(s): ${this.stack.map(r=>r.id).join(", ")}.`);const e={identifier:this.identifier,date:new Date,duration:performance.now()-this.startTime,entries:this.entries};this.addRecord(e),this.startTime=void 0,this.entries.clear()}startSubTask(e){this.stack.push({id:e,start:performance.now(),content:0})}stopSubTask(e){const r=this.stack.pop();if(!r)throw new Error(`Task "${this.identifier}.${e}" was not started.`);if(r.id!==e)throw new Error(`Sub-Task "${r.id}" is not already stopped.`);const n=performance.now()-r.start;this.stack.at(-1)!==void 0&&(this.stack[this.stack.length-1].content+=n);const i=n-r.content;this.entries.add(e,i)}},E(Ky,"ProfilingTask"),Ky),rO;(t=>{t.Terminals={ARROW_DIRECTION:/L|R|T|B/,ARROW_GROUP:/\{group\}/,ARROW_INTO:/<|>/,ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,ID:/[\w]([-\w]*\w)?/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,ARCH_ICON:/\([\w-:]+\)/,ARCH_TITLE:/\[(?:"([^"\\]|\\.)*"|'([^'\\]|\\.)*'|[\w ]+)\]/}})(rO||(rO={}));var nO;(t=>{t.Terminals={DOMAIN_NAME:/complex|complicated|clear|chaotic|confusion/,ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(nO||(nO={}));var iO;(t=>{t.Terminals={EM_ID:/[_a-zA-Z][\w_]*/,EM_FID:/\d{1,3}/,EM_DATA_INLINE:/\{(.*)\}|"(.*)"|'(.*)'/,EM_DATA_BLOCK:/\{[\t ]*\r?\n(?:[\S\s]*?\r?\n)?\}(?:\r?\n|(?!\S))/,EM_ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,EM_ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,EM_TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,EM_WS:/\s+/,EM_YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,EM_DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,EM_SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,EM_ML_COMMENT:/\/\*[\s\S]*?\*\//,EM_SL_COMMENT:/\/\/[^\n\r]*/}})(iO||(iO={}));var aO;(t=>{t.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,INT:/0|[1-9][0-9]*(?!\.)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,REFERENCE:/\w([-\./\w]*[-\w])?/}})(aO||(aO={}));var sO;(t=>{t.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(sO||(sO={}));var oO;(t=>{t.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,INT:/0|[1-9][0-9]*(?!\.)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(oO||(oO={}));var lO;(t=>{t.Terminals={NUMBER_PIE:/(?:-?[0-9]+\.[0-9]+(?!\.))|(?:-?(0|[1-9][0-9]*)(?!\.))/,ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(lO||(lO={}));var cO;(t=>{t.Terminals={GRATICULE:/circle|polygon/,BOOLEAN:/true|false/,ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,NUMBER:/(?:[0-9]+\.[0-9]+(?!\.))|(?:0|[1-9][0-9]*(?!\.))/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,ID:/[\w]([-\w]*\w)?/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(cO||(cO={}));var uO;(t=>{t.Terminals={TITLE:/title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,ACC_TITLE:/accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,ACC_DESCR:/accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ABNF_RULENAME:/[A-Za-z][A-Za-z0-9-]*/,ABNF_STRING:/"[^"]*"/,ABNF_NUMVAL:/%[xXdDbB][0-9A-Fa-f]+(?:-[0-9A-Fa-f]+|\.[0-9A-Fa-f]+)*/,ABNF_REPEAT:/[0-9]*\*[0-9]*/,ABNF_EXACT_REPEAT:/[0-9]+/,ABNF_WHITESPACE:/[\t \r\n]+/,ABNF_YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,ABNF_DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,ABNF_SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,ABNF_COMMENT:/;[^\n\r]*/}})(uO||(uO={}));var hO;(t=>{t.Terminals={TITLE:/title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,ACC_TITLE:/accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,ACC_DESCR:/accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,EBNF_ID:/[A-Z_a-z][\w-]*/,EBNF_STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,EBNF_SPECIAL_SEQUENCE:/\?(?=[^?;]*[^?\s;][^?;]*\?)[^?;]*\?/,EBNF_WHITESPACE:/[\t \r\n]+/,EBNF_YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,EBNF_DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,EBNF_SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,EBNF_BLOCK_COMMENT:/\/\*[\s\S]*?\*\//,EBNF_ISO_COMMENT:/\(\*[\s\S]*?\*\)/}})(hO||(hO={}));var dO;(t=>{t.Terminals={TITLE:/title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,ACC_TITLE:/accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,ACC_DESCR:/accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,RR_ID:/[A-Z_a-z][\w-]*/,RR_STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,RR_WHITESPACE:/[\t \r\n]+/,RR_YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,RR_DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,RR_SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,RR_BLOCK_COMMENT:/\/\*[\s\S]*?\*\//}})(dO||(dO={}));var fO;(t=>{t.Terminals={TITLE:/title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,ACC_TITLE:/accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,ACC_DESCR:/accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,PEG_ID:/[A-Z_a-z][\w-]*/,PEG_STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,PEG_WHITESPACE:/[\t \r\n]+/,PEG_YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,PEG_DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,PEG_SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,PEG_LINE_COMMENT:/#[^\n\r]*/}})(fO||(fO={}));var pO;(t=>{t.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,TREEMAP_KEYWORD:/treemap-beta|treemap/,CLASS_DEF:/classDef\s+([a-zA-Z_][a-zA-Z0-9_]+)(?:\s+([^;\r\n]*))?(?:;)?/,STYLE_SEPARATOR:/:::/,SEPARATOR:/:/,COMMA:/,/,INDENTATION:/[ \t]{1,}/,WS:/[ \t]+/,ML_COMMENT:/\%\%[^\n]*/,NL:/\r?\n/,ID2:/[a-zA-Z_][a-zA-Z0-9_]*/,NUMBER2:/[0-9_\.\,]+/,STRING2:/"[^"]*"|'[^']*'/}})(pO||(pO={}));var gO;(t=>{t.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,CLASS_ANNOTATION:/[ \t]+:::[ \t]*[A-Za-z_][\w-]*/,ICON_ANNOTATION:/[ \t]+icon\([\w-]*(?::[\w-]+)?\)/,DESC_ANNOTATION:/[ \t]+##[^\n\r]*/,INDENTATION:/[ \t]{1,}/,QUOTED_NAME:/"[^"]*"|'[^']*'/,WS:/[ \t]+/,ML_COMMENT:/\%\%[^\n]*/,NL:/\r?\n/,BARE_NAME:/(?!:::|icon\(|##)[^ \t\n\r"'](?:(?![ \t]+:::[ \t]*[A-Za-z_]|[ \t]+icon\(|[ \t]+##)[^\n\r])*/}})(gO||(gO={}));var mO;(t=>{t.Terminals={WARDLEY_NUMBER:/[0-9]+\.[0-9]+/,ARROW:/->/,LINK_PORT:/\+<>|\+>|\+|-\.->|>|\+'[^']*'<>|\+'[^']*'<|\+'[^']*'>/,LINK_LABEL:/;[^\n\r]+/,STRATEGY:/build|buy|outsource|market/,KW_WARDLEY:/wardley-beta/,KW_SIZE:/size/,KW_EVOLUTION:/evolution/,KW_ANCHOR:/anchor/,KW_COMPONENT:/component/,KW_LABEL:/label/,KW_INERTIA:/inertia/,KW_EVOLVE:/evolve/,KW_PIPELINE:/pipeline/,KW_NOTE:/note/,KW_ANNOTATIONS:/annotations/,KW_ANNOTATION:/annotation/,KW_ACCELERATOR:/accelerator/,KW_DEACCELERATOR:/deaccelerator/,NAME_WITH_SPACES:/(?!title\s|accTitle|accDescr)[A-Za-z](?:[A-Za-z0-9_()&]|-(?!>))*(?:[ \t]+[A-Za-z(](?:[A-Za-z0-9_()&]|-(?!>))*)*/,WS:/[ \t]+/,ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,INT:/0|[1-9][0-9]*(?!\.)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,ID:/[\w]([-\w]*\w)?/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(mO||(mO={})),{...rO.Terminals,...nO.Terminals,...iO.Terminals,...aO.Terminals,...sO.Terminals,...oO.Terminals,...lO.Terminals,...cO.Terminals,...uO.Terminals,...hO.Terminals,...dO.Terminals,...fO.Terminals,...gO.Terminals,...pO.Terminals,...mO.Terminals};var n0e={$type:"AbnfAlternation",alternatives:"alternatives"},i0e={$type:"AbnfConcatenation",elements:"elements"},yO={$type:"AbnfElement",primary:"primary",repeat:"repeat"},a0e={$type:"AbnfGroup",element:"element"},s0e={$type:"AbnfNumVal",value:"value"},o0e={$type:"AbnfOptionalGroup",element:"element"},Ng={$type:"AbnfPrimary"},vO={$type:"AbnfRule",definition:"definition",name:"name"},l0e={$type:"AbnfRuleName",name:"name"},c0e={$type:"AbnfStringLiteral",value:"value"},WE={$type:"Accelerator",name:"name",x:"x",y:"y"},bO={$type:"Alignment",direction:"direction",members:"members"},UE={$type:"Anchor",evolution:"evolution",name:"name",visibility:"visibility"},LT={$type:"Annotation",number:"number",text:"text",x:"x",y:"y"},xO={$type:"Annotations",x:"x",y:"y"},ec={$type:"Architecture",accDescr:"accDescr",accTitle:"accTitle",alignments:"alignments",edges:"edges",groups:"groups",junctions:"junctions",services:"services",title:"title"};function Snt(t){return gi.isInstance(t,ec.$type)}E(Snt,"isArchitecture");var HE={$type:"Axis",label:"label",name:"name"},YE={$type:"Branch",name:"name",order:"order"};function Ant(t){return gi.isInstance(t,YE.$type)}E(Ant,"isBranch");var u0e={$type:"Checkout",branch:"branch"},XE={$type:"CherryPicking",id:"id",parent:"parent",tags:"tags"},TO={$type:"ClassDefStatement",className:"className",styleText:"styleText"},Og={$type:"Commit",id:"id",message:"message",tags:"tags",type:"type"};function _nt(t){return gi.isInstance(t,Og.$type)}E(_nt,"isCommit");var KE={$type:"Common",accDescr:"accDescr",accTitle:"accTitle",title:"title"},Gf={$type:"Component",decorator:"decorator",evolution:"evolution",inertia:"inertia",label:"label",name:"name",visibility:"visibility"},jE={$type:"Curve",entries:"entries",label:"label",name:"name"},qf={$type:"Cynefin",accDescr:"accDescr",accTitle:"accTitle",domains:"domains",title:"title",transitions:"transitions"};function Rnt(t){return gi.isInstance(t,qf.$type)}E(Rnt,"isCynefin");var ZE={$type:"Deaccelerator",name:"name",x:"x",y:"y"},h0e={$type:"Decorator",strategy:"strategy"},$g={$type:"Direction",accDescr:"accDescr",accTitle:"accTitle",dir:"dir",statements:"statements",title:"title"},QE={$type:"DomainBlock",domain:"domain",items:"items"};function Lnt(t){return gi.isInstance(t,QE.$type)}E(Lnt,"isDomainBlock");var wO={$type:"DomainItem",label:"label"};function Int(t){return gi.isInstance(t,wO.$type)}E(Int,"isDomainItem");var d0e={$type:"EbnfChoice",alternatives:"alternatives"},f0e={$type:"EbnfExceptionPostfix",except:"except"},p0e={$type:"EbnfGroup",element:"element"},g0e={$type:"EbnfNonTerminal",name:"name"},m0e={$type:"EbnfOneOrMorePostfix",operator:"operator"},y0e={$type:"EbnfOptional",element:"element"},v0e={$type:"EbnfOptionalPostfix",operator:"operator"},IT={$type:"EbnfPostfix"},Vf={$type:"EbnfPrimary"},b0e={$type:"EbnfRepetition",element:"element"},CO={$type:"EbnfRule",definition:"definition",name:"name"},x0e={$type:"EbnfSequence",elements:"elements"},T0e={$type:"EbnfSpecial",text:"text"},kO={$type:"EbnfTerm",base:"base",postfixes:"postfixes"},w0e={$type:"EbnfTerminal",value:"value"},C0e={$type:"EbnfZeroOrMorePostfix",operator:"operator"},tc={$type:"Edge",lhsDir:"lhsDir",lhsGroup:"lhsGroup",lhsId:"lhsId",lhsInto:"lhsInto",rhsDir:"rhsDir",rhsGroup:"rhsGroup",rhsId:"rhsId",rhsInto:"rhsInto",title:"title"},Pg={$type:"EmDataEntity",dataBlockValue:"dataBlockValue",dataType:"dataType",name:"name"},Wf={$type:"EmFrame"},DT={$type:"EmGwt",givenStatements:"givenStatements",sourceFrame:"sourceFrame",thenStatements:"thenStatements",whenStatements:"whenStatements"},k0e={$type:"EmGwtStatement",entityIdentifier:"entityIdentifier"},EO={$type:"EmModelEntity",name:"name"};function Dnt(t){return t==="rmo"||t==="readmodel"||t==="ui"||t==="cmd"||t==="command"||t==="evt"||t==="event"||t==="pcr"||t==="processor"}E(Dnt,"isEmModelEntityType");var JE={$type:"EmNoteEntity",dataBlockValue:"dataBlockValue",dataType:"dataType",sourceFrame:"sourceFrame"},ou={$type:"EmResetFrame",dataInlineValue:"dataInlineValue",dataReference:"dataReference",dataType:"dataType",entityIdentifier:"entityIdentifier",modelEntityType:"modelEntityType",name:"name",sourceFrames:"sourceFrames"};function E0e(t){return gi.isInstance(t,ou.$type)}E(E0e,"isEmResetFrame");var _h={$type:"EmTimeFrame",dataInlineValue:"dataInlineValue",dataReference:"dataReference",dataType:"dataType",entityIdentifier:"entityIdentifier",modelEntityType:"modelEntityType",name:"name",sourceFrames:"sourceFrames"},SO={$type:"Entry",axis:"axis",value:"value"},lu={$type:"EventModel",accDescr:"accDescr",accTitle:"accTitle",dataEntities:"dataEntities",frames:"frames",gwtEntities:"gwtEntities",modelEntities:"modelEntities",noteEntities:"noteEntities",title:"title"},S0e={$type:"Evolution",stages:"stages"},eS={$type:"EvolutionStage",boundary:"boundary",name:"name",secondName:"secondName"},AO={$type:"Evolve",component:"component",target:"target"},Uf={$type:"GitGraph",accDescr:"accDescr",accTitle:"accTitle",statements:"statements",title:"title"};function Mnt(t){return gi.isInstance(t,Uf.$type)}E(Mnt,"isGitGraph");var MT={$type:"Group",icon:"icon",id:"id",in:"in",title:"title"},NT={$type:"Info",accDescr:"accDescr",accTitle:"accTitle",title:"title"};function Nnt(t){return gi.isInstance(t,NT.$type)}E(Nnt,"isInfo");var OT={$type:"Item",classSelector:"classSelector",name:"name"},_O={$type:"Junction",id:"id",in:"in"},$T={$type:"Label",negX:"negX",negY:"negY",offsetX:"offsetX",offsetY:"offsetY"},tS={$type:"Leaf",classSelector:"classSelector",name:"name",value:"value"},Hf={$type:"Link",arrow:"arrow",from:"from",fromPort:"fromPort",linkLabel:"linkLabel",to:"to",toPort:"toPort"},Bg={$type:"Merge",branch:"branch",id:"id",tags:"tags",type:"type"};function Ont(t){return gi.isInstance(t,Bg.$type)}E(Ont,"isMerge");var rS={$type:"Note",evolution:"evolution",text:"text",visibility:"visibility"},RO={$type:"Option",name:"name",value:"value"},Fg={$type:"Packet",accDescr:"accDescr",accTitle:"accTitle",blocks:"blocks",title:"title"};function $nt(t){return gi.isInstance(t,Fg.$type)}E($nt,"isPacket");var zg={$type:"PacketBlock",bits:"bits",end:"end",label:"label",start:"start"};function Pnt(t){return gi.isInstance(t,zg.$type)}E(Pnt,"isPacketBlock");var A0e={$type:"PegAny",dot:"dot"},_0e={$type:"PegGroup",element:"element"},R0e={$type:"PegIdentifier",name:"name"},L0e={$type:"PegLiteral",value:"value"},I0e={$type:"PegOrderedChoice",alternatives:"alternatives"},LO={$type:"PegPrefix",operator:"operator",suffix:"suffix"},PT={$type:"PegPrimary"},IO={$type:"PegRule",definition:"definition",name:"name"},D0e={$type:"PegSequence",elements:"elements"},DO={$type:"PegSuffix",operator:"operator",primary:"primary"},Yf={$type:"Pie",accDescr:"accDescr",accTitle:"accTitle",sections:"sections",showData:"showData",title:"title"};function Bnt(t){return gi.isInstance(t,Yf.$type)}E(Bnt,"isPie");var nS={$type:"PieSection",label:"label",value:"value"};function Fnt(t){return gi.isInstance(t,nS.$type)}E(Fnt,"isPieSection");var MO={$type:"Pipeline",components:"components",parent:"parent"},iS={$type:"PipelineComponent",evolution:"evolution",label:"label",name:"name"},Xf={$type:"Radar",accDescr:"accDescr",accTitle:"accTitle",axes:"axes",curves:"curves",options:"options",title:"title"},Gg={$type:"Railroad",accDescr:"accDescr",accTitle:"accTitle",rules:"rules",title:"title"};function znt(t){return gi.isInstance(t,Gg.$type)}E(znt,"isRailroad");var qg={$type:"RailroadAbnf",accDescr:"accDescr",accTitle:"accTitle",rules:"rules",title:"title"};function Gnt(t){return gi.isInstance(t,qg.$type)}E(Gnt,"isRailroadAbnf");var M0e={$type:"RailroadChoiceExpr",alternatives:"alternatives"},Vg={$type:"RailroadEbnf",accDescr:"accDescr",accTitle:"accTitle",rules:"rules",title:"title"};function qnt(t){return gi.isInstance(t,Vg.$type)}E(qnt,"isRailroadEbnf");var cu={$type:"RailroadExpression"},N0e={$type:"RailroadNonTerminalExpr",name:"name"},O0e={$type:"RailroadOneOrMoreExpr",element:"element"},$0e={$type:"RailroadOptionalExpr",element:"element"},Wg={$type:"RailroadPeg",accDescr:"accDescr",accTitle:"accTitle",rules:"rules",title:"title"};function Vnt(t){return gi.isInstance(t,Wg.$type)}E(Vnt,"isRailroadPeg");var NO={$type:"RailroadRule",definition:"definition",name:"name"},P0e={$type:"RailroadSequenceExpr",elements:"elements"},B0e={$type:"RailroadSpecialExpr",text:"text"},F0e={$type:"RailroadTerminalExpr",value:"value"},z0e={$type:"RailroadZeroOrMoreExpr",element:"element"},OO={$type:"Section",classSelector:"classSelector",name:"name"},Ug={$type:"Service",icon:"icon",iconText:"iconText",id:"id",in:"in",title:"title"},$O={$type:"Size",height:"height",width:"width"},Hg={$type:"Statement"},BT={$type:"Transition",from:"from",label:"label",to:"to"};function Wnt(t){return gi.isInstance(t,BT.$type)}E(Wnt,"isTransition");var Yg={$type:"Treemap",accDescr:"accDescr",accTitle:"accTitle",title:"title",TreemapRows:"TreemapRows"};function Unt(t){return gi.isInstance(t,Yg.$type)}E(Unt,"isTreemap");var PO={$type:"TreemapRow",indent:"indent",item:"item"},Xg={$type:"TreeNode",classAnnotation:"classAnnotation",descAnnotation:"descAnnotation",iconAnnotation:"iconAnnotation",indent:"indent",name:"name"},FT={$type:"TreeView",accDescr:"accDescr",accTitle:"accTitle",nodes:"nodes",title:"title"},xa={$type:"Wardley",accDescr:"accDescr",accelerators:"accelerators",accTitle:"accTitle",anchors:"anchors",annotation:"annotation",annotations:"annotations",components:"components",deaccelerators:"deaccelerators",evolution:"evolution",evolves:"evolves",links:"links",notes:"notes",pipelines:"pipelines",size:"size",title:"title"};function Hnt(t){return gi.isInstance(t,xa.$type)}E(Hnt,"isWardley");var G0e=(jy=class extends D9{constructor(){super(...arguments),this.types={AbnfAlternation:{name:n0e.$type,properties:{alternatives:{name:n0e.alternatives,defaultValue:[]}},superTypes:[]},AbnfConcatenation:{name:i0e.$type,properties:{elements:{name:i0e.elements,defaultValue:[]}},superTypes:[]},AbnfElement:{name:yO.$type,properties:{primary:{name:yO.primary},repeat:{name:yO.repeat}},superTypes:[]},AbnfGroup:{name:a0e.$type,properties:{element:{name:a0e.element}},superTypes:[Ng.$type]},AbnfNumVal:{name:s0e.$type,properties:{value:{name:s0e.value}},superTypes:[Ng.$type]},AbnfOptionalGroup:{name:o0e.$type,properties:{element:{name:o0e.element}},superTypes:[Ng.$type]},AbnfPrimary:{name:Ng.$type,properties:{},superTypes:[]},AbnfRule:{name:vO.$type,properties:{definition:{name:vO.definition},name:{name:vO.name}},superTypes:[]},AbnfRuleName:{name:l0e.$type,properties:{name:{name:l0e.name}},superTypes:[Ng.$type]},AbnfStringLiteral:{name:c0e.$type,properties:{value:{name:c0e.value}},superTypes:[Ng.$type]},Accelerator:{name:WE.$type,properties:{name:{name:WE.name},x:{name:WE.x},y:{name:WE.y}},superTypes:[]},Alignment:{name:bO.$type,properties:{direction:{name:bO.direction},members:{name:bO.members,defaultValue:[]}},superTypes:[]},Anchor:{name:UE.$type,properties:{evolution:{name:UE.evolution},name:{name:UE.name},visibility:{name:UE.visibility}},superTypes:[]},Annotation:{name:LT.$type,properties:{number:{name:LT.number},text:{name:LT.text},x:{name:LT.x},y:{name:LT.y}},superTypes:[]},Annotations:{name:xO.$type,properties:{x:{name:xO.x},y:{name:xO.y}},superTypes:[]},Architecture:{name:ec.$type,properties:{accDescr:{name:ec.accDescr},accTitle:{name:ec.accTitle},alignments:{name:ec.alignments,defaultValue:[]},edges:{name:ec.edges,defaultValue:[]},groups:{name:ec.groups,defaultValue:[]},junctions:{name:ec.junctions,defaultValue:[]},services:{name:ec.services,defaultValue:[]},title:{name:ec.title}},superTypes:[]},Axis:{name:HE.$type,properties:{label:{name:HE.label},name:{name:HE.name}},superTypes:[]},Branch:{name:YE.$type,properties:{name:{name:YE.name},order:{name:YE.order}},superTypes:[Hg.$type]},Checkout:{name:u0e.$type,properties:{branch:{name:u0e.branch}},superTypes:[Hg.$type]},CherryPicking:{name:XE.$type,properties:{id:{name:XE.id},parent:{name:XE.parent},tags:{name:XE.tags,defaultValue:[]}},superTypes:[Hg.$type]},ClassDefStatement:{name:TO.$type,properties:{className:{name:TO.className},styleText:{name:TO.styleText}},superTypes:[]},Commit:{name:Og.$type,properties:{id:{name:Og.id},message:{name:Og.message},tags:{name:Og.tags,defaultValue:[]},type:{name:Og.type}},superTypes:[Hg.$type]},Common:{name:KE.$type,properties:{accDescr:{name:KE.accDescr},accTitle:{name:KE.accTitle},title:{name:KE.title}},superTypes:[]},Component:{name:Gf.$type,properties:{decorator:{name:Gf.decorator},evolution:{name:Gf.evolution},inertia:{name:Gf.inertia,defaultValue:!1},label:{name:Gf.label},name:{name:Gf.name},visibility:{name:Gf.visibility}},superTypes:[]},Curve:{name:jE.$type,properties:{entries:{name:jE.entries,defaultValue:[]},label:{name:jE.label},name:{name:jE.name}},superTypes:[]},Cynefin:{name:qf.$type,properties:{accDescr:{name:qf.accDescr},accTitle:{name:qf.accTitle},domains:{name:qf.domains,defaultValue:[]},title:{name:qf.title},transitions:{name:qf.transitions,defaultValue:[]}},superTypes:[]},Deaccelerator:{name:ZE.$type,properties:{name:{name:ZE.name},x:{name:ZE.x},y:{name:ZE.y}},superTypes:[]},Decorator:{name:h0e.$type,properties:{strategy:{name:h0e.strategy}},superTypes:[]},Direction:{name:$g.$type,properties:{accDescr:{name:$g.accDescr},accTitle:{name:$g.accTitle},dir:{name:$g.dir},statements:{name:$g.statements,defaultValue:[]},title:{name:$g.title}},superTypes:[Uf.$type]},DomainBlock:{name:QE.$type,properties:{domain:{name:QE.domain},items:{name:QE.items,defaultValue:[]}},superTypes:[]},DomainItem:{name:wO.$type,properties:{label:{name:wO.label}},superTypes:[]},EbnfChoice:{name:d0e.$type,properties:{alternatives:{name:d0e.alternatives,defaultValue:[]}},superTypes:[]},EbnfExceptionPostfix:{name:f0e.$type,properties:{except:{name:f0e.except}},superTypes:[IT.$type]},EbnfGroup:{name:p0e.$type,properties:{element:{name:p0e.element}},superTypes:[Vf.$type]},EbnfNonTerminal:{name:g0e.$type,properties:{name:{name:g0e.name}},superTypes:[Vf.$type]},EbnfOneOrMorePostfix:{name:m0e.$type,properties:{operator:{name:m0e.operator}},superTypes:[IT.$type]},EbnfOptional:{name:y0e.$type,properties:{element:{name:y0e.element}},superTypes:[Vf.$type]},EbnfOptionalPostfix:{name:v0e.$type,properties:{operator:{name:v0e.operator}},superTypes:[IT.$type]},EbnfPostfix:{name:IT.$type,properties:{},superTypes:[]},EbnfPrimary:{name:Vf.$type,properties:{},superTypes:[]},EbnfRepetition:{name:b0e.$type,properties:{element:{name:b0e.element}},superTypes:[Vf.$type]},EbnfRule:{name:CO.$type,properties:{definition:{name:CO.definition},name:{name:CO.name}},superTypes:[]},EbnfSequence:{name:x0e.$type,properties:{elements:{name:x0e.elements,defaultValue:[]}},superTypes:[]},EbnfSpecial:{name:T0e.$type,properties:{text:{name:T0e.text}},superTypes:[Vf.$type]},EbnfTerm:{name:kO.$type,properties:{base:{name:kO.base},postfixes:{name:kO.postfixes,defaultValue:[]}},superTypes:[]},EbnfTerminal:{name:w0e.$type,properties:{value:{name:w0e.value}},superTypes:[Vf.$type]},EbnfZeroOrMorePostfix:{name:C0e.$type,properties:{operator:{name:C0e.operator}},superTypes:[IT.$type]},Edge:{name:tc.$type,properties:{lhsDir:{name:tc.lhsDir},lhsGroup:{name:tc.lhsGroup,defaultValue:!1},lhsId:{name:tc.lhsId},lhsInto:{name:tc.lhsInto,defaultValue:!1},rhsDir:{name:tc.rhsDir},rhsGroup:{name:tc.rhsGroup,defaultValue:!1},rhsId:{name:tc.rhsId},rhsInto:{name:tc.rhsInto,defaultValue:!1},title:{name:tc.title}},superTypes:[]},EmDataEntity:{name:Pg.$type,properties:{dataBlockValue:{name:Pg.dataBlockValue},dataType:{name:Pg.dataType},name:{name:Pg.name}},superTypes:[]},EmFrame:{name:Wf.$type,properties:{},superTypes:[]},EmGwt:{name:DT.$type,properties:{givenStatements:{name:DT.givenStatements,defaultValue:[]},sourceFrame:{name:DT.sourceFrame,referenceType:Wf.$type},thenStatements:{name:DT.thenStatements,defaultValue:[]},whenStatements:{name:DT.whenStatements,defaultValue:[]}},superTypes:[]},EmGwtStatement:{name:k0e.$type,properties:{entityIdentifier:{name:k0e.entityIdentifier,referenceType:EO.$type}},superTypes:[]},EmModelEntity:{name:EO.$type,properties:{name:{name:EO.name}},superTypes:[]},EmNoteEntity:{name:JE.$type,properties:{dataBlockValue:{name:JE.dataBlockValue},dataType:{name:JE.dataType},sourceFrame:{name:JE.sourceFrame,referenceType:Wf.$type}},superTypes:[]},EmResetFrame:{name:ou.$type,properties:{dataInlineValue:{name:ou.dataInlineValue},dataReference:{name:ou.dataReference,referenceType:Pg.$type},dataType:{name:ou.dataType},entityIdentifier:{name:ou.entityIdentifier},modelEntityType:{name:ou.modelEntityType},name:{name:ou.name},sourceFrames:{name:ou.sourceFrames,defaultValue:[],referenceType:Wf.$type}},superTypes:[Wf.$type]},EmTimeFrame:{name:_h.$type,properties:{dataInlineValue:{name:_h.dataInlineValue},dataReference:{name:_h.dataReference,referenceType:Pg.$type},dataType:{name:_h.dataType},entityIdentifier:{name:_h.entityIdentifier},modelEntityType:{name:_h.modelEntityType},name:{name:_h.name},sourceFrames:{name:_h.sourceFrames,defaultValue:[],referenceType:Wf.$type}},superTypes:[Wf.$type]},Entry:{name:SO.$type,properties:{axis:{name:SO.axis,referenceType:HE.$type},value:{name:SO.value}},superTypes:[]},EventModel:{name:lu.$type,properties:{accDescr:{name:lu.accDescr},accTitle:{name:lu.accTitle},dataEntities:{name:lu.dataEntities,defaultValue:[]},frames:{name:lu.frames,defaultValue:[]},gwtEntities:{name:lu.gwtEntities,defaultValue:[]},modelEntities:{name:lu.modelEntities,defaultValue:[]},noteEntities:{name:lu.noteEntities,defaultValue:[]},title:{name:lu.title}},superTypes:[]},Evolution:{name:S0e.$type,properties:{stages:{name:S0e.stages,defaultValue:[]}},superTypes:[]},EvolutionStage:{name:eS.$type,properties:{boundary:{name:eS.boundary},name:{name:eS.name},secondName:{name:eS.secondName}},superTypes:[]},Evolve:{name:AO.$type,properties:{component:{name:AO.component},target:{name:AO.target}},superTypes:[]},GitGraph:{name:Uf.$type,properties:{accDescr:{name:Uf.accDescr},accTitle:{name:Uf.accTitle},statements:{name:Uf.statements,defaultValue:[]},title:{name:Uf.title}},superTypes:[]},Group:{name:MT.$type,properties:{icon:{name:MT.icon},id:{name:MT.id},in:{name:MT.in},title:{name:MT.title}},superTypes:[]},Info:{name:NT.$type,properties:{accDescr:{name:NT.accDescr},accTitle:{name:NT.accTitle},title:{name:NT.title}},superTypes:[]},Item:{name:OT.$type,properties:{classSelector:{name:OT.classSelector},name:{name:OT.name}},superTypes:[]},Junction:{name:_O.$type,properties:{id:{name:_O.id},in:{name:_O.in}},superTypes:[]},Label:{name:$T.$type,properties:{negX:{name:$T.negX,defaultValue:!1},negY:{name:$T.negY,defaultValue:!1},offsetX:{name:$T.offsetX},offsetY:{name:$T.offsetY}},superTypes:[]},Leaf:{name:tS.$type,properties:{classSelector:{name:tS.classSelector},name:{name:tS.name},value:{name:tS.value}},superTypes:[OT.$type]},Link:{name:Hf.$type,properties:{arrow:{name:Hf.arrow},from:{name:Hf.from},fromPort:{name:Hf.fromPort},linkLabel:{name:Hf.linkLabel},to:{name:Hf.to},toPort:{name:Hf.toPort}},superTypes:[]},Merge:{name:Bg.$type,properties:{branch:{name:Bg.branch},id:{name:Bg.id},tags:{name:Bg.tags,defaultValue:[]},type:{name:Bg.type}},superTypes:[Hg.$type]},Note:{name:rS.$type,properties:{evolution:{name:rS.evolution},text:{name:rS.text},visibility:{name:rS.visibility}},superTypes:[]},Option:{name:RO.$type,properties:{name:{name:RO.name},value:{name:RO.value,defaultValue:!1}},superTypes:[]},Packet:{name:Fg.$type,properties:{accDescr:{name:Fg.accDescr},accTitle:{name:Fg.accTitle},blocks:{name:Fg.blocks,defaultValue:[]},title:{name:Fg.title}},superTypes:[]},PacketBlock:{name:zg.$type,properties:{bits:{name:zg.bits},end:{name:zg.end},label:{name:zg.label},start:{name:zg.start}},superTypes:[]},PegAny:{name:A0e.$type,properties:{dot:{name:A0e.dot}},superTypes:[PT.$type]},PegGroup:{name:_0e.$type,properties:{element:{name:_0e.element}},superTypes:[PT.$type]},PegIdentifier:{name:R0e.$type,properties:{name:{name:R0e.name}},superTypes:[PT.$type]},PegLiteral:{name:L0e.$type,properties:{value:{name:L0e.value}},superTypes:[PT.$type]},PegOrderedChoice:{name:I0e.$type,properties:{alternatives:{name:I0e.alternatives,defaultValue:[]}},superTypes:[]},PegPrefix:{name:LO.$type,properties:{operator:{name:LO.operator},suffix:{name:LO.suffix}},superTypes:[]},PegPrimary:{name:PT.$type,properties:{},superTypes:[]},PegRule:{name:IO.$type,properties:{definition:{name:IO.definition},name:{name:IO.name}},superTypes:[]},PegSequence:{name:D0e.$type,properties:{elements:{name:D0e.elements,defaultValue:[]}},superTypes:[]},PegSuffix:{name:DO.$type,properties:{operator:{name:DO.operator},primary:{name:DO.primary}},superTypes:[]},Pie:{name:Yf.$type,properties:{accDescr:{name:Yf.accDescr},accTitle:{name:Yf.accTitle},sections:{name:Yf.sections,defaultValue:[]},showData:{name:Yf.showData,defaultValue:!1},title:{name:Yf.title}},superTypes:[]},PieSection:{name:nS.$type,properties:{label:{name:nS.label},value:{name:nS.value}},superTypes:[]},Pipeline:{name:MO.$type,properties:{components:{name:MO.components,defaultValue:[]},parent:{name:MO.parent}},superTypes:[]},PipelineComponent:{name:iS.$type,properties:{evolution:{name:iS.evolution},label:{name:iS.label},name:{name:iS.name}},superTypes:[]},Radar:{name:Xf.$type,properties:{accDescr:{name:Xf.accDescr},accTitle:{name:Xf.accTitle},axes:{name:Xf.axes,defaultValue:[]},curves:{name:Xf.curves,defaultValue:[]},options:{name:Xf.options,defaultValue:[]},title:{name:Xf.title}},superTypes:[]},Railroad:{name:Gg.$type,properties:{accDescr:{name:Gg.accDescr},accTitle:{name:Gg.accTitle},rules:{name:Gg.rules,defaultValue:[]},title:{name:Gg.title}},superTypes:[]},RailroadAbnf:{name:qg.$type,properties:{accDescr:{name:qg.accDescr},accTitle:{name:qg.accTitle},rules:{name:qg.rules,defaultValue:[]},title:{name:qg.title}},superTypes:[]},RailroadChoiceExpr:{name:M0e.$type,properties:{alternatives:{name:M0e.alternatives,defaultValue:[]}},superTypes:[cu.$type]},RailroadEbnf:{name:Vg.$type,properties:{accDescr:{name:Vg.accDescr},accTitle:{name:Vg.accTitle},rules:{name:Vg.rules,defaultValue:[]},title:{name:Vg.title}},superTypes:[]},RailroadExpression:{name:cu.$type,properties:{},superTypes:[]},RailroadNonTerminalExpr:{name:N0e.$type,properties:{name:{name:N0e.name}},superTypes:[cu.$type]},RailroadOneOrMoreExpr:{name:O0e.$type,properties:{element:{name:O0e.element}},superTypes:[cu.$type]},RailroadOptionalExpr:{name:$0e.$type,properties:{element:{name:$0e.element}},superTypes:[cu.$type]},RailroadPeg:{name:Wg.$type,properties:{accDescr:{name:Wg.accDescr},accTitle:{name:Wg.accTitle},rules:{name:Wg.rules,defaultValue:[]},title:{name:Wg.title}},superTypes:[]},RailroadRule:{name:NO.$type,properties:{definition:{name:NO.definition},name:{name:NO.name}},superTypes:[]},RailroadSequenceExpr:{name:P0e.$type,properties:{elements:{name:P0e.elements,defaultValue:[]}},superTypes:[cu.$type]},RailroadSpecialExpr:{name:B0e.$type,properties:{text:{name:B0e.text}},superTypes:[cu.$type]},RailroadTerminalExpr:{name:F0e.$type,properties:{value:{name:F0e.value}},superTypes:[cu.$type]},RailroadZeroOrMoreExpr:{name:z0e.$type,properties:{element:{name:z0e.element}},superTypes:[cu.$type]},Section:{name:OO.$type,properties:{classSelector:{name:OO.classSelector},name:{name:OO.name}},superTypes:[OT.$type]},Service:{name:Ug.$type,properties:{icon:{name:Ug.icon},iconText:{name:Ug.iconText},id:{name:Ug.id},in:{name:Ug.in},title:{name:Ug.title}},superTypes:[]},Size:{name:$O.$type,properties:{height:{name:$O.height},width:{name:$O.width}},superTypes:[]},Statement:{name:Hg.$type,properties:{},superTypes:[]},Transition:{name:BT.$type,properties:{from:{name:BT.from},label:{name:BT.label},to:{name:BT.to}},superTypes:[]},TreeNode:{name:Xg.$type,properties:{classAnnotation:{name:Xg.classAnnotation},descAnnotation:{name:Xg.descAnnotation},iconAnnotation:{name:Xg.iconAnnotation},indent:{name:Xg.indent},name:{name:Xg.name}},superTypes:[]},TreeView:{name:FT.$type,properties:{accDescr:{name:FT.accDescr},accTitle:{name:FT.accTitle},nodes:{name:FT.nodes,defaultValue:[]},title:{name:FT.title}},superTypes:[]},Treemap:{name:Yg.$type,properties:{accDescr:{name:Yg.accDescr},accTitle:{name:Yg.accTitle},title:{name:Yg.title},TreemapRows:{name:Yg.TreemapRows,defaultValue:[]}},superTypes:[]},TreemapRow:{name:PO.$type,properties:{indent:{name:PO.indent},item:{name:PO.item}},superTypes:[]},Wardley:{name:xa.$type,properties:{accDescr:{name:xa.accDescr},accelerators:{name:xa.accelerators,defaultValue:[]},accTitle:{name:xa.accTitle},anchors:{name:xa.anchors,defaultValue:[]},annotation:{name:xa.annotation,defaultValue:[]},annotations:{name:xa.annotations,defaultValue:[]},components:{name:xa.components,defaultValue:[]},deaccelerators:{name:xa.deaccelerators,defaultValue:[]},evolution:{name:xa.evolution},evolves:{name:xa.evolves,defaultValue:[]},links:{name:xa.links,defaultValue:[]},notes:{name:xa.notes,defaultValue:[]},pipelines:{name:xa.pipelines,defaultValue:[]},size:{name:xa.size},title:{name:xa.title}},superTypes:[]}}}},E(jy,"MermaidAstReflection"),jy),gi=new G0e,q0e,Ynt=E(()=>q0e??(q0e=aa(`{"$type":"Grammar","isDeclared":true,"name":"ArchitectureGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Architecture","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"architecture-beta"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"Statement","definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"groups","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"services","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"junctions","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}},{"$type":"Assignment","feature":"edges","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}},{"$type":"Assignment","feature":"alignments","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}}]},"entry":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"LeftPort","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"lhsDir","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}]},"entry":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"RightPort","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"rhsDir","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Keyword","value":":"}]},"entry":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"Arrow","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]},{"$type":"Assignment","feature":"lhsInto","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"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@30"},"arguments":[]}},{"$type":"Keyword","value":"-"}]}]},{"$type":"Assignment","feature":"rhsInto","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}]},"entry":false,"parameters":[]},{"$type":"ParserRule","name":"Group","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"group"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Assignment","feature":"icon","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@30"},"arguments":[]},"cardinality":"?"},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Service","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"service"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"iconText","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Assignment","feature":"icon","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]}}],"cardinality":"?"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@30"},"arguments":[]},"cardinality":"?"},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Junction","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"junction"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Edge","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"lhsId","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Assignment","feature":"lhsGroup","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"Assignment","feature":"rhsId","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Assignment","feature":"rhsGroup","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Alignment","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"align"},{"$type":"Assignment","feature":"direction","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"row"},{"$type":"Keyword","value":"column"}]}},{"$type":"Assignment","feature":"members","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Assignment","feature":"members","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]},"cardinality":"+"},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"ARROW_DIRECTION","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"L"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"R"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"T"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"B"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARROW_GROUP","definition":{"$type":"RegexToken","regex":"/\\\\{group\\\\}/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARROW_INTO","definition":{"$type":"RegexToken","regex":"/<|>/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@19"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@20"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","name":"ARCH_ICON","definition":{"$type":"RegexToken","regex":"/\\\\([\\\\w-:]+\\\\)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARCH_TITLE","definition":{"$type":"RegexToken","regex":"/\\\\[(?:\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'|[\\\\w ]+)\\\\]/","parenthesized":false},"fragment":false,"hidden":false}],"interfaces":[],"types":[]}`)),"ArchitectureGrammarGrammar"),V0e,Xnt=E(()=>V0e??(V0e=aa(`{"$type":"Grammar","isDeclared":true,"name":"CynefinGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Cynefin","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"cynefin-beta"},{"$type":"Keyword","value":"cynefin-beta:"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"Assignment","feature":"domains","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"transitions","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"DomainBlock","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"domain","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"Assignment","feature":"items","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"*"}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"DomainItem","definition":{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Transition","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"from","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Keyword","value":"-->"},{"$type":"Assignment","feature":"to","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"DOMAIN_NAME","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"complex"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"complicated"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"clear"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"chaotic"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"confusion"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@11"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@12"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[],"types":[]}`)),"CynefinGrammarGrammar"),W0e,Knt=E(()=>W0e??(W0e=aa('{"$type":"Grammar","isDeclared":true,"name":"EventModeling","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","entry":true,"name":"EventModel","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"eventmodeling"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Assignment","feature":"modelEntities","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Assignment","feature":"frames","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}},{"$type":"Assignment","feature":"dataEntities","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Assignment","feature":"noteEntities","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"Assignment","feature":"gwtEntities","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmModelEntityType","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"rmo"},{"$type":"Keyword","value":"readmodel"},{"$type":"Keyword","value":"ui"},{"$type":"Keyword","value":"cmd"},{"$type":"Keyword","value":"command"},{"$type":"Keyword","value":"evt"},{"$type":"Keyword","value":"event"},{"$type":"Keyword","value":"pcr"},{"$type":"Keyword","value":"processor"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmDataType","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"json"},{"$type":"Keyword","value":"jsobj"},{"$type":"Keyword","value":"figma"},{"$type":"Keyword","value":"salt"},{"$type":"Keyword","value":"uri"},{"$type":"Keyword","value":"md"},{"$type":"Keyword","value":"html"},{"$type":"Keyword","value":"text"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"EmDataInline","definition":{"$type":"Group","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"`"},{"$type":"Assignment","feature":"dataType","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Keyword","value":"`"}],"cardinality":"?"},{"$type":"Assignment","feature":"dataInlineValue","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}}]},"entry":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"EmDataBlock","definition":{"$type":"Group","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"`"},{"$type":"Assignment","feature":"dataType","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Keyword","value":"`"}],"cardinality":"?"},{"$type":"Assignment","feature":"dataBlockValue","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}}]},"entry":false,"parameters":[]},{"$type":"ParserRule","name":"QualifiedName","dataType":"string","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Keyword","value":"."},{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmTimeFrame","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"tf"},{"$type":"Keyword","value":"timeframe"}]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Assignment","feature":"modelEntityType","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"entityIdentifier","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"->>"},{"$type":"Assignment","feature":"sourceFrames","operator":"+=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@8"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}}],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"Keyword","value":"[["},{"$type":"Assignment","feature":"dataReference","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@10"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"Keyword","value":"]]"}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmResetFrame","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"rf"},{"$type":"Keyword","value":"resetframe"}]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Assignment","feature":"modelEntityType","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"entityIdentifier","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"->>"},{"$type":"Assignment","feature":"sourceFrames","operator":"+=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@8"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}}],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"Keyword","value":"[["},{"$type":"Assignment","feature":"dataReference","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@10"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"Keyword","value":"]]"}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmFrame","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmModelEntity","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"entity"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmDataEntity","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"data"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmNoteEntity","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"note"},{"$type":"Assignment","feature":"sourceFrame","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@8"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmGwt","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"gwt"},{"$type":"Assignment","feature":"sourceFrame","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@8"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"Keyword","value":"given"},{"$type":"Assignment","feature":"givenStatements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},"cardinality":"+"},{"$type":"Group","elements":[{"$type":"Keyword","value":"when"},{"$type":"Assignment","feature":"whenStatements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},"cardinality":"+"}],"cardinality":"?"},{"$type":"Keyword","value":"then"},{"$type":"Assignment","feature":"thenStatements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},"cardinality":"+"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmGwtStatement","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]},{"$type":"Assignment","feature":"entityIdentifier","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@9"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EM_EID","dataType":"string","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EM_FI","dataType":"string","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"EM_ID","definition":{"$type":"RegexToken","regex":"/[_a-zA-Z][\\\\w_]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EM_FID","definition":{"$type":"RegexToken","regex":"/\\\\d{1,3}/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EM_DATA_INLINE","definition":{"$type":"RegexToken","regex":"/\\\\{(.*)\\\\}|\\"(.*)\\"|\'(.*)\'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EM_DATA_BLOCK","definition":{"$type":"RegexToken","regex":"/\\\\{[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?\\\\}(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EM_ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EM_ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EM_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"EM_WS","definition":{"$type":"RegexToken","regex":"/\\\\s+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EM_YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EM_DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EM_SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EM_ML_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\/\\\\*[\\\\s\\\\S]*?\\\\*\\\\//","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EM_SL_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\/\\\\/[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"imports":[],"types":[]}')),"EventModelingGrammar"),U0e,jnt=E(()=>U0e??(U0e=aa(`{"$type":"Grammar","isDeclared":true,"name":"GitGraphGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"GitGraph","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"gitGraph"},{"$type":"Group","elements":[{"$type":"Keyword","value":"gitGraph"},{"$type":"Keyword","value":":"}]},{"$type":"Keyword","value":"gitGraph:"},{"$type":"Group","elements":[{"$type":"Keyword","value":"gitGraph"},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]},{"$type":"Keyword","value":":"}]}]},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]},{"$type":"Assignment","feature":"statements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Statement","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$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"}]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Commit","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"commit"},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"id:"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"msg:","cardinality":"?"},{"$type":"Assignment","feature":"message","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"type:"},{"$type":"Assignment","feature":"type","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"NORMAL"},{"$type":"Keyword","value":"REVERSE"},{"$type":"Keyword","value":"HIGHLIGHT"}]}}]}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Branch","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"branch"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"order:"},{"$type":"Assignment","feature":"order","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Merge","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"merge"},{"$type":"Assignment","feature":"branch","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]}},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"id:"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"type:"},{"$type":"Assignment","feature":"type","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"NORMAL"},{"$type":"Keyword","value":"REVERSE"},{"$type":"Keyword","value":"HIGHLIGHT"}]}}]}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Checkout","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"checkout"},{"$type":"Keyword","value":"switch"}]},{"$type":"Assignment","feature":"branch","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"CherryPicking","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"cherry-pick"},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"id:"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"parent:"},{"$type":"Assignment","feature":"parent","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@14"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@15"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","name":"REFERENCE","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\\\w([-\\\\./\\\\w]*[-\\\\w])?/","parenthesized":false},"fragment":false,"hidden":false}],"interfaces":[],"types":[]}`)),"GitGraphGrammarGrammar"),H0e,Znt=E(()=>H0e??(H0e=aa(`{"$type":"Grammar","isDeclared":true,"name":"InfoGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Info","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"info"},{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"Keyword","value":"showInfo"},{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[],"cardinality":"*"}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"?"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@7"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@8"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[],"types":[]}`)),"InfoGrammarGrammar"),Y0e,Qnt=E(()=>Y0e??(Y0e=aa(`{"$type":"Grammar","isDeclared":true,"name":"PacketGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Packet","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"packet"},{"$type":"Keyword","value":"packet-beta"}]},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]},{"$type":"Assignment","feature":"blocks","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PacketBlock","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Assignment","feature":"start","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"-"},{"$type":"Assignment","feature":"end","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}}],"cardinality":"?"}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"+"},{"$type":"Assignment","feature":"bits","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}}]}]},{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@8"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@9"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[],"types":[]}`)),"PacketGrammarGrammar"),X0e,Jnt=E(()=>X0e??(X0e=aa(`{"$type":"Grammar","isDeclared":true,"name":"PieGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Pie","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"pie"},{"$type":"Assignment","feature":"showData","operator":"?=","terminal":{"$type":"Keyword","value":"showData"},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"Assignment","feature":"sections","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PieSection","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"FLOAT_PIE","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/-?[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT_PIE","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/-?(0|[1-9][0-9]*)(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER_PIE","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@2"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@3"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@11"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@12"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[],"types":[]}`)),"PieGrammarGrammar"),K0e,eit=E(()=>K0e??(K0e=aa(`{"$type":"Grammar","isDeclared":true,"name":"RadarGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Radar","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"radar-beta"},{"$type":"Keyword","value":"radar-beta:"},{"$type":"Group","elements":[{"$type":"Keyword","value":"radar-beta"},{"$type":"Keyword","value":":"}]}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Keyword","value":"axis"},{"$type":"Assignment","feature":"axes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"axes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"curve"},{"$type":"Assignment","feature":"curves","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"curves","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}}],"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"options","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"options","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}}],"cardinality":"*"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"Label","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}},{"$type":"Keyword","value":"]"}]},"entry":false,"parameters":[]},{"$type":"ParserRule","name":"Axis","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Curve","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[],"cardinality":"?"},{"$type":"Keyword","value":"{"},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"Keyword","value":"}"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"Entries","definition":{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"}]}]},"entry":false,"parameters":[]},{"$type":"ParserRule","name":"DetailedEntry","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"axis","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@2"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"NumberEntry","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Option","definition":{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"showLegend"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"ticks"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"max"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"min"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"graticule"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}}]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"GRATICULE","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"circle"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"polygon"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@15"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@16"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[{"$type":"Interface","name":"Entry","attributes":[{"$type":"TypeAttribute","name":"axis","isOptional":true,"type":{"$type":"ReferenceType","referenceType":{"$type":"SimpleType","typeRef":{"$ref":"#/rules@2"}},"isMulti":false}},{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"number"},"isOptional":false}],"superTypes":[]}],"types":[]}`)),"RadarGrammarGrammar"),j0e,tit=E(()=>j0e??(j0e=aa('{"$type":"Grammar","isDeclared":true,"name":"RailroadAbnfGrammar","rules":[{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ABNF_RULENAME","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[A-Za-z][A-Za-z0-9-]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ABNF_STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"[^\\"]*\\"/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ABNF_NUMVAL","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/%[xXdDbB][0-9A-Fa-f]+(?:-[0-9A-Fa-f]+|\\\\.[0-9A-Fa-f]+)*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ABNF_REPEAT","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[0-9]*\\\\*[0-9]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ABNF_EXACT_REPEAT","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[0-9]+/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"ABNF_WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t \\\\r\\\\n]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ABNF_YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ABNF_DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ABNF_SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ABNF_COMMENT","definition":{"$type":"RegexToken","regex":"/;[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"ParserRule","entry":true,"name":"RailroadAbnf","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"railroad-abnf-beta"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"*"},{"$type":"Assignment","feature":"rules","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfRule","returnType":{"$ref":"#/interfaces@1"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Keyword","value":"="},{"$type":"Assignment","feature":"definition","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Keyword","value":";"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfAlternation","returnType":{"$ref":"#/interfaces@2"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"/"},{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfConcatenation","returnType":{"$ref":"#/interfaces@3"},"definition":{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]},"cardinality":"+"},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfElement","returnType":{"$ref":"#/interfaces@4"},"definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"repeat","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"repeat","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}}],"cardinality":"?"},{"$type":"Assignment","feature":"primary","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfPrimary","returnType":{"$ref":"#/interfaces@5"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfStringLiteral","returnType":{"$ref":"#/interfaces@6"},"definition":{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfNumVal","returnType":{"$ref":"#/interfaces@7"},"definition":{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfRuleName","returnType":{"$ref":"#/interfaces@8"},"definition":{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfGroup","returnType":{"$ref":"#/interfaces@9"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfOptionalGroup","returnType":{"$ref":"#/interfaces@10"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Keyword","value":"]"}]},"entry":false,"fragment":false,"parameters":[]}],"interfaces":[{"$type":"Interface","name":"RailroadAbnf","attributes":[{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"rules","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@1"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"AbnfRule","attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"definition","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"AbnfAlternation","attributes":[{"$type":"TypeAttribute","name":"alternatives","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@3"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"AbnfConcatenation","attributes":[{"$type":"TypeAttribute","name":"elements","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@4"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"AbnfElement","attributes":[{"$type":"TypeAttribute","name":"repeat","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"primary","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@5"}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"AbnfPrimary","attributes":[],"superTypes":[]},{"$type":"Interface","name":"AbnfStringLiteral","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"AbnfNumVal","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"AbnfRuleName","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"AbnfGroup","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"AbnfOptionalGroup","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]}],"imports":[],"types":[]}')),"RailroadAbnfGrammarGrammar"),Z0e,rit=E(()=>Z0e??(Z0e=aa(`{"$type":"Grammar","isDeclared":true,"name":"RailroadEbnfGrammar","rules":[{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EBNF_ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[A-Z_a-z][\\\\w-]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EBNF_STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EBNF_SPECIAL_SEQUENCE","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\\\?(?=[^?;]*[^?\\\\s;][^?;]*\\\\?)[^?;]*\\\\?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"EBNF_WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t \\\\r\\\\n]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EBNF_YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EBNF_DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EBNF_SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EBNF_BLOCK_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\/\\\\*[\\\\s\\\\S]*?\\\\*\\\\//","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EBNF_ISO_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\(\\\\*[\\\\s\\\\S]*?\\\\*\\\\)/","parenthesized":false},"fragment":false},{"$type":"ParserRule","entry":true,"name":"RailroadEbnf","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"railroad-ebnf-beta"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"*"},{"$type":"Assignment","feature":"rules","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfRule","returnType":{"$ref":"#/interfaces@1"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"="},{"$type":"Keyword","value":"::="}]},{"$type":"Assignment","feature":"definition","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Keyword","value":";"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfChoice","returnType":{"$ref":"#/interfaces@2"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"|"},{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfSequence","returnType":{"$ref":"#/interfaces@3"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":",","cardinality":"?"},{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfTerm","returnType":{"$ref":"#/interfaces@4"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"base","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},{"$type":"Assignment","feature":"postfixes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfPrimary","returnType":{"$ref":"#/interfaces@5"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfTerminal","returnType":{"$ref":"#/interfaces@7"},"definition":{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfNonTerminal","returnType":{"$ref":"#/interfaces@8"},"definition":{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfSpecial","returnType":{"$ref":"#/interfaces@9"},"definition":{"$type":"Assignment","feature":"text","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfGroup","returnType":{"$ref":"#/interfaces@10"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfOptional","returnType":{"$ref":"#/interfaces@11"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Keyword","value":"]"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfRepetition","returnType":{"$ref":"#/interfaces@12"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Keyword","value":"}"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfPostfix","returnType":{"$ref":"#/interfaces@6"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@25"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@26"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@27"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@28"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfOptionalPostfix","returnType":{"$ref":"#/interfaces@13"},"definition":{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"?"}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfZeroOrMorePostfix","returnType":{"$ref":"#/interfaces@14"},"definition":{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"*"}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfOneOrMorePostfix","returnType":{"$ref":"#/interfaces@15"},"definition":{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"+"}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfExceptionPostfix","returnType":{"$ref":"#/interfaces@16"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"-"},{"$type":"Assignment","feature":"except","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},"entry":false,"fragment":false,"parameters":[]}],"interfaces":[{"$type":"Interface","name":"RailroadEbnf","attributes":[{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"rules","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@1"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"EbnfRule","attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"definition","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"EbnfChoice","attributes":[{"$type":"TypeAttribute","name":"alternatives","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@3"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"EbnfSequence","attributes":[{"$type":"TypeAttribute","name":"elements","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@4"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"EbnfTerm","attributes":[{"$type":"TypeAttribute","name":"base","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@5"}},"isOptional":false},{"$type":"TypeAttribute","name":"postfixes","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@6"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"EbnfPrimary","attributes":[],"superTypes":[]},{"$type":"Interface","name":"EbnfPostfix","attributes":[],"superTypes":[]},{"$type":"Interface","name":"EbnfTerminal","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"EbnfNonTerminal","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"EbnfSpecial","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"text","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"EbnfGroup","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"EbnfOptional","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"EbnfRepetition","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"EbnfOptionalPostfix","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"operator","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"EbnfZeroOrMorePostfix","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"operator","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"EbnfOneOrMorePostfix","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"operator","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"EbnfExceptionPostfix","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"except","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@5"}},"isOptional":false}]}],"imports":[],"types":[]}`)),"RailroadEbnfGrammarGrammar"),Q0e,nit=E(()=>Q0e??(Q0e=aa(`{"$type":"Grammar","isDeclared":true,"name":"RailroadGrammar","rules":[{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"RR_ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[A-Z_a-z][\\\\w-]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"RR_STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"RR_WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t \\\\r\\\\n]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"RR_YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"RR_DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"RR_SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"RR_BLOCK_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\/\\\\*[\\\\s\\\\S]*?\\\\*\\\\//","parenthesized":false},"fragment":false},{"$type":"ParserRule","entry":true,"name":"Railroad","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"railroad-beta"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"*"},{"$type":"Assignment","feature":"rules","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]},"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadRule","returnType":{"$ref":"#/interfaces@1"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Keyword","value":"="},{"$type":"Assignment","feature":"definition","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Keyword","value":";"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadExpression","returnType":{"$ref":"#/interfaces@2"},"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":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadSequenceExpr","returnType":{"$ref":"#/interfaces@3"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"sequence"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}}],"cardinality":"*"},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadChoiceExpr","returnType":{"$ref":"#/interfaces@4"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"choice"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}}],"cardinality":"*"},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadOptionalExpr","returnType":{"$ref":"#/interfaces@5"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"optional"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadOneOrMoreExpr","returnType":{"$ref":"#/interfaces@6"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"oneOrMore"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadZeroOrMoreExpr","returnType":{"$ref":"#/interfaces@7"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"zeroOrMore"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadTerminalExpr","returnType":{"$ref":"#/interfaces@8"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"terminal"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadNonTerminalExpr","returnType":{"$ref":"#/interfaces@9"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"nonterminal"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadSpecialExpr","returnType":{"$ref":"#/interfaces@10"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"special"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"text","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]}],"interfaces":[{"$type":"Interface","name":"Railroad","attributes":[{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"rules","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@1"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"RailroadRule","attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"definition","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"RailroadExpression","attributes":[],"superTypes":[]},{"$type":"Interface","name":"RailroadSequenceExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"elements","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}}},"isOptional":false}]},{"$type":"Interface","name":"RailroadChoiceExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"alternatives","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}}},"isOptional":false}]},{"$type":"Interface","name":"RailroadOptionalExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"RailroadOneOrMoreExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"RailroadZeroOrMoreExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"RailroadTerminalExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"RailroadNonTerminalExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"RailroadSpecialExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"text","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]}],"imports":[],"types":[]}`)),"RailroadGrammarGrammar"),J0e,iit=E(()=>J0e??(J0e=aa(`{"$type":"Grammar","isDeclared":true,"name":"RailroadPegGrammar","rules":[{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"PEG_ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[A-Z_a-z][\\\\w-]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"PEG_STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"PEG_WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t \\\\r\\\\n]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"PEG_YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"PEG_DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"PEG_SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"PEG_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/#[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"ParserRule","entry":true,"name":"RailroadPeg","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"railroad-peg-beta"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"*"},{"$type":"Assignment","feature":"rules","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]},"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegRule","returnType":{"$ref":"#/interfaces@1"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Keyword","value":"<-"},{"$type":"Assignment","feature":"definition","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Keyword","value":";"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegOrderedChoice","returnType":{"$ref":"#/interfaces@2"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"/"},{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegSequence","returnType":{"$ref":"#/interfaces@3"},"definition":{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"cardinality":"+"},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegPrefix","returnType":{"$ref":"#/interfaces@4"},"definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"&"}},{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"!"}}],"cardinality":"?"},{"$type":"Assignment","feature":"suffix","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegSuffix","returnType":{"$ref":"#/interfaces@5"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"primary","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"?"}},{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"*"}},{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"+"}}],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegPrimary","returnType":{"$ref":"#/interfaces@6"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegLiteral","returnType":{"$ref":"#/interfaces@7"},"definition":{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegIdentifier","returnType":{"$ref":"#/interfaces@8"},"definition":{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegGroup","returnType":{"$ref":"#/interfaces@9"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegAny","returnType":{"$ref":"#/interfaces@10"},"definition":{"$type":"Assignment","feature":"dot","operator":"=","terminal":{"$type":"Keyword","value":"."}},"entry":false,"fragment":false,"parameters":[]}],"interfaces":[{"$type":"Interface","name":"RailroadPeg","attributes":[{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"rules","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@1"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"PegRule","attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"definition","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"PegOrderedChoice","attributes":[{"$type":"TypeAttribute","name":"alternatives","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@3"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"PegSequence","attributes":[{"$type":"TypeAttribute","name":"elements","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@4"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"PegPrefix","attributes":[{"$type":"TypeAttribute","name":"operator","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"suffix","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@5"}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"PegSuffix","attributes":[{"$type":"TypeAttribute","name":"primary","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@6"}},"isOptional":false},{"$type":"TypeAttribute","name":"operator","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]},{"$type":"Interface","name":"PegPrimary","attributes":[],"superTypes":[]},{"$type":"Interface","name":"PegLiteral","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"PegIdentifier","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"PegGroup","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"PegAny","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"dot","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]}],"imports":[],"types":[]}`)),"RailroadPegGrammarGrammar"),epe,ait=E(()=>epe??(epe=aa(`{"$type":"Grammar","isDeclared":true,"name":"TreemapGrammar","rules":[{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","entry":true,"name":"Treemap","returnType":{"$ref":"#/interfaces@4"},"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]},{"$type":"Assignment","feature":"TreemapRows","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"TREEMAP_KEYWORD","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"treemap-beta"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"treemap"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"CLASS_DEF","definition":{"$type":"RegexToken","regex":"/classDef\\\\s+([a-zA-Z_][a-zA-Z0-9_]+)(?:\\\\s+([^;\\\\r\\\\n]*))?(?:;)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STYLE_SEPARATOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":":::"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"SEPARATOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":":"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"COMMA","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":","},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INDENTATION","definition":{"$type":"RegexToken","regex":"/[ \\\\t]{1,}/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WS","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ML_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\%\\\\%[^\\\\n]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"NL","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false},{"$type":"ParserRule","name":"TreemapRow","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"indent","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"item","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"ClassDef","dataType":"string","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Item","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Section","returnType":{"$ref":"#/interfaces@1"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]},{"$type":"Assignment","feature":"classSelector","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Leaf","returnType":{"$ref":"#/interfaces@2"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[],"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[],"cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]},{"$type":"Assignment","feature":"classSelector","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"ID2","definition":{"$type":"RegexToken","regex":"/[a-zA-Z_][a-zA-Z0-9_]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER2","definition":{"$type":"RegexToken","regex":"/[0-9_\\\\.\\\\,]+/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"MyNumber","dataType":"number","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"STRING2","definition":{"$type":"RegexToken","regex":"/\\"[^\\"]*\\"|'[^']*'/","parenthesized":false},"fragment":false,"hidden":false}],"interfaces":[{"$type":"Interface","name":"Item","attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"classSelector","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]},{"$type":"Interface","name":"Section","superTypes":[{"$ref":"#/interfaces@0"}],"attributes":[]},{"$type":"Interface","name":"Leaf","superTypes":[{"$ref":"#/interfaces@0"}],"attributes":[{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"number"},"isOptional":false}]},{"$type":"Interface","name":"ClassDefStatement","attributes":[{"$type":"TypeAttribute","name":"className","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"styleText","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"Treemap","attributes":[{"$type":"TypeAttribute","name":"TreemapRows","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/rules@15"}}},"isOptional":false},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"imports":[],"types":[],"$comment":"/**\\n * Treemap grammar for Langium\\n * Converted from mindmap grammar\\n *\\n * The ML_COMMENT and NL hidden terminals handle whitespace, comments, and newlines\\n * before the treemap keyword, allowing for empty lines and comments before the\\n * treemap declaration.\\n */"}`)),"TreemapGrammarGrammar"),tpe,sit=E(()=>tpe??(tpe=aa(`{"$type":"Grammar","isDeclared":true,"name":"TreeViewGrammar","rules":[{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","entry":true,"name":"TreeView","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"treeView-beta"},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[],"cardinality":"?"},{"$type":"Assignment","feature":"nodes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"CLASS_ANNOTATION","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+:::[ \\\\t]*[A-Za-z_][\\\\w-]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ICON_ANNOTATION","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+icon\\\\([\\\\w-]*(?::[\\\\w-]+)?\\\\)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"DESC_ANNOTATION","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+##[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INDENTATION","definition":{"$type":"RegexToken","regex":"/[ \\\\t]{1,}/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"QUOTED_NAME","definition":{"$type":"RegexToken","regex":"/\\"[^\\"]*\\"|'[^']*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WS","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ML_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\%\\\\%[^\\\\n]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"NL","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","name":"BARE_NAME","definition":{"$type":"RegexToken","regex":"/(?!:::|icon\\\\(|##)[^ \\\\t\\\\n\\\\r\\"'](?:(?![ \\\\t]+:::[ \\\\t]*[A-Za-z_]|[ \\\\t]+icon\\\\(|[ \\\\t]+##)[^\\\\n\\\\r])*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"TreeNode","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"indent","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}}]},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"classAnnotation","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"iconAnnotation","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"descAnnotation","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]}],"interfaces":[{"$type":"Interface","name":"TreeView","attributes":[{"$type":"TypeAttribute","name":"nodes","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/rules@14"}}},"isOptional":false},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"imports":[],"types":[],"$comment":"/**\\n * TreeView grammar for Langium\\n *\\n * Supports both quoted labels (\\"my file\\") and bare labels (index.js).\\n * Annotations (:::class, icon(), ## description) are parsed directly into\\n * AST fields by the grammar. Value conversion for stripping quotes, extracting\\n * class names, icon names, and description text happens in valueConverter.ts.\\n *\\n * The ML_COMMENT and NL hidden terminals handle whitespace, comments, and newlines\\n * before the treeView keyword, allowing for empty lines and comments before the\\n * treeView declaration.\\n */"}`)),"TreeViewGrammarGrammar"),rpe,oit=E(()=>rpe??(rpe=aa(`{"$type":"Grammar","isDeclared":true,"name":"WardleyGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Wardley","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@52"},"arguments":[],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@25"},"arguments":[]},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@52"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@42"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"Statement","definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"size","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Assignment","feature":"evolution","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Assignment","feature":"anchors","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"components","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"links","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Assignment","feature":"evolves","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Assignment","feature":"pipelines","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"Assignment","feature":"notes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}},{"$type":"Assignment","feature":"annotations","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Assignment","feature":"annotation","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Assignment","feature":"accelerators","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},{"$type":"Assignment","feature":"deaccelerators","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}}]},"entry":false,"parameters":[]},{"$type":"ParserRule","name":"Size","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@26"},"arguments":[]},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"width","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"height","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Evolution","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@27"},"arguments":[]},{"$type":"Assignment","feature":"stages","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]},{"$type":"Assignment","feature":"stages","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}}],"cardinality":"+"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EvolutionStage","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"@"},{"$type":"Assignment","feature":"boundary","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}}],"cardinality":"?"},{"$type":"Group","elements":[{"$type":"Keyword","value":"/"},{"$type":"Assignment","feature":"secondName","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}}],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Anchor","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@28"},"arguments":[]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"visibility","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"evolution","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Component","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"visibility","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"evolution","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"decorator","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"inertia","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@31"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"inertia","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@31"},"arguments":[]}},{"$type":"Keyword","value":")"}]}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Label","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@30"},"arguments":[]},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"negX","operator":"?=","terminal":{"$type":"Keyword","value":"-"},"cardinality":"?"},{"$type":"Assignment","feature":"offsetX","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"negY","operator":"?=","terminal":{"$type":"Keyword","value":"-"},"cardinality":"?"},{"$type":"Assignment","feature":"offsetY","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}},{"$type":"Keyword","value":"]"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Decorator","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"strategy","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Link","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"from","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Assignment","feature":"fromPort","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"arrow","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}]},"cardinality":"?"},{"$type":"Assignment","feature":"to","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Assignment","feature":"toPort","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"linkLabel","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Evolve","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@32"},"arguments":[]},{"$type":"Assignment","feature":"component","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Assignment","feature":"target","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Pipeline","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@33"},"arguments":[]},{"$type":"Assignment","feature":"parent","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"{"},{"$type":"RuleCall","rule":{"$ref":"#/rules@52"},"arguments":[],"cardinality":"+"},{"$type":"Assignment","feature":"components","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]},"cardinality":"+"},{"$type":"Keyword","value":"}"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PipelineComponent","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"evolution","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Note","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@34"},"arguments":[]},{"$type":"Assignment","feature":"text","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"visibility","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"evolution","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Annotations","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@35"},"arguments":[]},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"x","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"y","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Annotation","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@36"},"arguments":[]},{"$type":"Assignment","feature":"number","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"x","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"y","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"Assignment","feature":"text","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"CoordinateValue","dataType":"number","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Accelerator","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@37"},"arguments":[]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"x","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"y","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Deaccelerator","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@38"},"arguments":[]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"x","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"y","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"WARDLEY_NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARROW","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"->"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"LINK_PORT","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"+<>"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"+>"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"+<"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"LINK_ARROW","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"-->"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"-.->"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":">"},"parenthesized":false}],"parenthesized":false},{"$type":"RegexToken","regex":"/\\\\+'[^']*'<>/","parenthesized":false}],"parenthesized":false},{"$type":"RegexToken","regex":"/\\\\+'[^']*'/","parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"LINK_LABEL","definition":{"$type":"RegexToken","regex":"/;[^\\\\n\\\\r]+/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRATEGY","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"build"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"buy"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"outsource"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"market"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_WARDLEY","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"wardley-beta"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_SIZE","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"size"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_EVOLUTION","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"evolution"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_ANCHOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"anchor"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_COMPONENT","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"component"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_LABEL","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"label"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_INERTIA","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"inertia"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_EVOLVE","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"evolve"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_PIPELINE","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"pipeline"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_NOTE","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"note"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_ANNOTATIONS","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"annotations"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_ANNOTATION","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"annotation"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_ACCELERATOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"accelerator"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_DEACCELERATOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"deaccelerator"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NAME_WITH_SPACES","definition":{"$type":"RegexToken","regex":"/(?!title\\\\s|accTitle|accDescr)[A-Za-z](?:[A-Za-z0-9_()&]|-(?!>))*(?:[ \\\\t]+[A-Za-z(](?:[A-Za-z0-9_()&]|-(?!>))*)*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WS","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+/","parenthesized":false},"fragment":false},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@52"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@44"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@45"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@46"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@47"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@48"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[],"types":[]}`)),"WardleyGrammarGrammar"),lit={languageId:"architecture",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},cit={languageId:"cynefin",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},uit={languageId:"eventmodeling",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},hit={languageId:"gitGraph",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},dit={languageId:"info",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},fit={languageId:"packet",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},pit={languageId:"pie",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},git={languageId:"radar",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},mit={languageId:"railroadAbnf",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},yit={languageId:"railroadEbnf",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},vit={languageId:"railroad",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},bit={languageId:"railroadPeg",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},xit={languageId:"treemap",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Tit={languageId:"treeView",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},wit={languageId:"wardley",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},cs={AstReflection:E(()=>new G0e,"AstReflection")},Cit={Grammar:E(()=>Ynt(),"Grammar"),LanguageMetaData:E(()=>lit,"LanguageMetaData"),parser:{}},kit={Grammar:E(()=>Xnt(),"Grammar"),LanguageMetaData:E(()=>cit,"LanguageMetaData"),parser:{}},Eit={Grammar:E(()=>Knt(),"Grammar"),LanguageMetaData:E(()=>uit,"LanguageMetaData"),parser:{}},Sit={Grammar:E(()=>jnt(),"Grammar"),LanguageMetaData:E(()=>hit,"LanguageMetaData"),parser:{}},Ait={Grammar:E(()=>Znt(),"Grammar"),LanguageMetaData:E(()=>dit,"LanguageMetaData"),parser:{}},_it={Grammar:E(()=>Qnt(),"Grammar"),LanguageMetaData:E(()=>fit,"LanguageMetaData"),parser:{}},Rit={Grammar:E(()=>Jnt(),"Grammar"),LanguageMetaData:E(()=>pit,"LanguageMetaData"),parser:{}},Lit={Grammar:E(()=>eit(),"Grammar"),LanguageMetaData:E(()=>git,"LanguageMetaData"),parser:{}},Iit={Grammar:E(()=>tit(),"Grammar"),LanguageMetaData:E(()=>mit,"LanguageMetaData"),parser:{}},Dit={Grammar:E(()=>rit(),"Grammar"),LanguageMetaData:E(()=>yit,"LanguageMetaData"),parser:{}},Mit={Grammar:E(()=>nit(),"Grammar"),LanguageMetaData:E(()=>vit,"LanguageMetaData"),parser:{}},Nit={Grammar:E(()=>iit(),"Grammar"),LanguageMetaData:E(()=>bit,"LanguageMetaData"),parser:{}},Oit={Grammar:E(()=>ait(),"Grammar"),LanguageMetaData:E(()=>xit,"LanguageMetaData"),parser:{}},$it={Grammar:E(()=>sit(),"Grammar"),LanguageMetaData:E(()=>Tit,"LanguageMetaData"),parser:{}},Pit={Grammar:E(()=>oit(),"Grammar"),LanguageMetaData:E(()=>wit,"LanguageMetaData"),parser:{}},Bit=/accDescr(?:[\t ]*:([^\n\r]*)|\s*{([^}]*)})/,Fit=/accTitle[\t ]*:([^\n\r]*)/,zit=/title([\t ][^\n\r]*|)/,Git={ACC_DESCR:Bit,ACC_TITLE:Fit,TITLE:zit},rc=(Zy=class extends EN{runConverter(e,r,n){let i=this.runCommonConverter(e,r,n);return i===void 0&&(i=this.runCustomConverter(e,r,n)),i===void 0?super.runConverter(e,r,n):i}runCommonConverter(e,r,n){const i=Git[e.name];if(i===void 0)return;const a=i.exec(r);if(a!==null){if(a[1]!==void 0)return a[1].trim().replace(/[\t ]{2,}/gm," ");if(a[2]!==void 0)return a[2].replace(/^\s*/gm,"").replace(/\s+$/gm,"").replace(/[\t ]{2,}/gm," ").replace(/[\n\r]{2,}/gm,` -`)}}},E(Zy,"AbstractMermaidValueConverter"),Zy),Kg=(Qy=class extends rc{runCustomConverter(e,r,n){}},E(Qy,"CommonValueConverter"),Qy),us=(Jy=class extends SE{constructor(e){super(),this.keywords=new Set(e)}buildKeywordTokens(e,r,n){const i=super.buildKeywordTokens(e,r,n);return i.forEach(a=>{this.keywords.has(a.name)&&a.PATTERN!==void 0&&(a.PATTERN=new RegExp(a.PATTERN.toString()+"(?:(?=%%)|(?!\\S))"))}),i}},E(Jy,"AbstractMermaidTokenBuilder"),Jy);ev=class extends us{},E(ev,"CommonTokenBuilder");/*! Bundled license information: +`}E(kF,"fillNewlines");var c2e=(y2=class{constructor(e){this.indexManager=e.shared.workspace.IndexManager,this.commentProvider=e.documentation.CommentProvider}getDocumentation(e){const r=this.commentProvider.getComment(e);if(r&&yF(r))return mF(r).toMarkdown({renderLink:E((i,a)=>this.documentationLinkRenderer(e,i,a),"renderLink"),renderTag:E(i=>this.documentationTagRenderer(e,i),"renderTag")})}documentationLinkRenderer(e,r,n){const i=this.findNameInLocalSymbols(e,r)??this.findNameInGlobalScope(e,r);if(i&&i.nameSegment){const a=i.nameSegment.range.start.line+1,s=i.nameSegment.range.start.character+1,o=i.documentUri.with({fragment:`L${a},${s}`});return`[${n}](${o.toString()})`}else return}documentationTagRenderer(e,r){}findNameInLocalSymbols(e,r){const i=Al(e).localSymbols;if(!i)return;let a=e;do{const o=i.getStream(a).find(l=>l.name===r);if(o)return o;a=a.$container}while(a)}findNameInGlobalScope(e,r){return this.indexManager.allElements().find(i=>i.name===r)}},E(y2,"JSDocDocumentationProvider"),y2),u2e=(v2=class{constructor(e){this.grammarConfig=()=>e.parser.GrammarConfig}getComment(e){var r;return uF(e)?e.$comment:(r=NO(e.$cstNode,this.grammarConfig().multilineCommentRules))==null?void 0:r.text}},E(v2,"DefaultCommentProvider"),v2),h2e=(b2=class{constructor(e){this.syncParser=e.parser.LangiumParser}parse(e,r){return Promise.resolve(this.syncParser.parse(e))}},E(b2,"DefaultAsyncParser"),b2),sft=(x2=class{constructor(e){this.threadCount=8,this.terminationDelay=200,this.workerPool=[],this.queue=[],this.hydrator=e.serializer.Hydrator}initializeWorkers(){for(;this.workerPool.length{if(this.queue.length>0){const r=this.queue.shift();r&&(e.lock(),r.resolve(e))}}),this.workerPool.push(e)}}async parse(e,r){const n=await this.acquireParserWorker(r),i=new ih;let a;const s=r.onCancellationRequested(()=>{a=setTimeout(()=>{this.terminateWorker(n)},this.terminationDelay)});return n.parse(e).then(o=>{const l=this.hydrator.hydrate(o);i.resolve(l)}).catch(o=>{i.reject(o)}).finally(()=>{s.dispose(),clearTimeout(a)}),i.promise}terminateWorker(e){e.terminate();const r=this.workerPool.indexOf(e);r>=0&&this.workerPool.splice(r,1)}async acquireParserWorker(e){this.initializeWorkers();for(const n of this.workerPool)if(n.ready)return n.lock(),n;const r=new ih;return e.onCancellationRequested(()=>{const n=this.queue.indexOf(r);n>=0&&this.queue.splice(n,1),r.reject(qc)}),this.queue.push(r),r.promise}},E(x2,"AbstractThreadedAsyncParser"),x2),oft=(T2=class{get ready(){return this._ready}get onReady(){return this.onReadyEmitter.event}constructor(e,r,n,i){this.onReadyEmitter=new $6.Emitter,this.deferred=new ih,this._ready=!0,this._parsing=!1,this.sendMessage=e,this._terminate=i,r(a=>{const s=a;this.deferred.resolve(s),this.unlock()}),n(a=>{this.deferred.reject(a),this.unlock()})}terminate(){this.deferred.reject(qc),this._terminate()}lock(){this._ready=!1}unlock(){this._parsing=!1,this._ready=!0,this.onReadyEmitter.fire()}parse(e){if(this._parsing)throw new Error("Parser worker is busy");return this._parsing=!0,this.deferred=new ih,this.sendMessage(e),this.deferred.promise}},E(T2,"ParserWorker"),T2),d2e=(w2=class{constructor(){this.previousTokenSource=new Vn.CancellationTokenSource,this.writeQueue=[],this.readQueue=[],this.done=!0}write(e){this.cancelWrite();const r=A6();return this.previousTokenSource=r,this.enqueue(this.writeQueue,e,r.token)}read(e){return this.enqueue(this.readQueue,e)}enqueue(e,r,n=Vn.CancellationToken.None){const i=new ih,a={action:r,deferred:i,cancellationToken:n};return e.push(a),this.performNextOperation(),i.promise}async performNextOperation(){if(!this.done)return;const e=[];if(this.writeQueue.length>0)e.push(this.writeQueue.shift());else if(this.readQueue.length>0)e.push(...this.readQueue.splice(0,this.readQueue.length));else return;this.done=!1,await Promise.all(e.map(async({action:r,deferred:n,cancellationToken:i})=>{try{const a=await Promise.resolve().then(()=>r(i));n.resolve(a)}catch(a){Qp(a)?n.resolve(void 0):n.reject(a)}})),this.done=!0,this.performNextOperation()}cancelWrite(){this.previousTokenSource.cancel()}},E(w2,"DefaultWorkspaceLock"),w2),f2e=(C2=class{constructor(e){this.grammarElementIdMap=new I6,this.tokenTypeIdMap=new I6,this.grammar=e.Grammar,this.lexer=e.parser.Lexer,this.linker=e.references.Linker}dehydrate(e){return{lexerErrors:e.lexerErrors,lexerReport:e.lexerReport?this.dehydrateLexerReport(e.lexerReport):void 0,parserErrors:e.parserErrors.map(r=>({...r,message:r.message})),value:this.dehydrateAstNode(e.value,this.createDehyrationContext(e.value))}}dehydrateLexerReport(e){return e}createDehyrationContext(e){const r=new Map,n=new Map;for(const i of Rl(e))r.set(i,{});if(e.$cstNode)for(const i of Ym(e.$cstNode))n.set(i,{});return{astNodes:r,cstNodes:n}}dehydrateAstNode(e,r){const n=r.astNodes.get(e);n.$type=e.$type,n.$containerIndex=e.$containerIndex,n.$containerProperty=e.$containerProperty,e.$cstNode!==void 0&&(n.$cstNode=this.dehydrateCstNode(e.$cstNode,r));for(const[i,a]of Object.entries(e))if(!i.startsWith("$"))if(Array.isArray(a)){const s=[];n[i]=s;for(const o of a)ea(o)?s.push(this.dehydrateAstNode(o,r)):Ls(o)?s.push(this.dehydrateReference(o,r)):s.push(o)}else ea(a)?n[i]=this.dehydrateAstNode(a,r):Ls(a)?n[i]=this.dehydrateReference(a,r):a!==void 0&&(n[i]=a);return n}dehydrateReference(e,r){const n={};return n.$refText=e.$refText,e.$refNode&&(n.$refNode=r.cstNodes.get(e.$refNode)),n}dehydrateCstNode(e,r){const n=r.cstNodes.get(e);return LS(e)?n.fullText=e.fullText:n.grammarSource=this.getGrammarElementId(e.grammarSource),n.hidden=e.hidden,n.astNode=r.astNodes.get(e.astNode),Vu(e)?n.content=e.content.map(i=>this.dehydrateCstNode(i,r)):dp(e)&&(n.tokenType=e.tokenType.name,n.offset=e.offset,n.length=e.length,n.startLine=e.range.start.line,n.startColumn=e.range.start.character,n.endLine=e.range.end.line,n.endColumn=e.range.end.character),n}hydrate(e){const r=e.value,n=this.createHydrationContext(r);return"$cstNode"in r&&this.hydrateCstNode(r.$cstNode,n),{lexerErrors:e.lexerErrors,lexerReport:e.lexerReport,parserErrors:e.parserErrors,value:this.hydrateAstNode(r,n)}}createHydrationContext(e){const r=new Map,n=new Map;for(const a of Rl(e))r.set(a,{});let i;if(e.$cstNode)for(const a of Ym(e.$cstNode)){let s;"fullText"in a?(s=new HB(a.fullText),i=s):"content"in a?s=new b6:"tokenType"in a&&(s=this.hydrateCstLeafNode(a)),s&&(n.set(a,s),s.root=i)}return{astNodes:r,cstNodes:n}}hydrateAstNode(e,r){const n=r.astNodes.get(e);n.$type=e.$type,n.$containerIndex=e.$containerIndex,n.$containerProperty=e.$containerProperty,e.$cstNode&&(n.$cstNode=r.cstNodes.get(e.$cstNode));for(const[i,a]of Object.entries(e))if(!i.startsWith("$"))if(Array.isArray(a)){const s=[];n[i]=s;for(const o of a)ea(o)?s.push(this.setParent(this.hydrateAstNode(o,r),n)):Ls(o)?s.push(this.hydrateReference(o,n,i,r)):s.push(o)}else ea(a)?n[i]=this.setParent(this.hydrateAstNode(a,r),n):Ls(a)?n[i]=this.hydrateReference(a,n,i,r):a!==void 0&&(n[i]=a);return n}setParent(e,r){return e.$container=r,e}hydrateReference(e,r,n,i){return this.linker.buildReference(r,n,i.cstNodes.get(e.$refNode),e.$refText)}hydrateCstNode(e,r,n=0){const i=r.cstNodes.get(e);if(typeof e.grammarSource=="number"&&(i.grammarSource=this.getGrammarElement(e.grammarSource)),i.astNode=r.astNodes.get(e.astNode),Vu(i))for(const a of e.content){const s=this.hydrateCstNode(a,r,n++);i.content.push(s)}return i}hydrateCstLeafNode(e){const r=this.getTokenType(e.tokenType),n=e.offset,i=e.length,a=e.startLine,s=e.startColumn,o=e.endLine,l=e.endColumn,u=e.hidden;return new v6(n,i,{start:{line:a,character:s},end:{line:o,character:l}},r,u)}getTokenType(e){return this.lexer.definition[e]}getGrammarElementId(e){if(e)return this.grammarElementIdMap.size===0&&this.createGrammarElementIdMap(),this.grammarElementIdMap.get(e)}getGrammarElement(e){return this.grammarElementIdMap.size===0&&this.createGrammarElementIdMap(),this.grammarElementIdMap.getKey(e)}createGrammarElementIdMap(){let e=0;for(const r of Rl(this.grammar))NS(r)&&this.grammarElementIdMap.set(r,e++)}},E(C2,"DefaultHydrator"),C2);function Sa(t){return{documentation:{CommentProvider:E(e=>new u2e(e),"CommentProvider"),DocumentationProvider:E(e=>new c2e(e),"DocumentationProvider")},parser:{AsyncParser:E(e=>new h2e(e),"AsyncParser"),GrammarConfig:E(e=>sP(e),"GrammarConfig"),LangiumParser:E(e=>QB(e),"LangiumParser"),CompletionParser:E(e=>ZB(e),"CompletionParser"),ValueConverter:E(()=>new eF,"ValueConverter"),TokenBuilder:E(()=>new E6,"TokenBuilder"),Lexer:E(e=>new gF(e),"Lexer"),ParserErrorMessageProvider:E(()=>new XB,"ParserErrorMessageProvider"),LexerErrorMessageProvider:E(()=>new Kve,"LexerErrorMessageProvider")},workspace:{AstNodeLocator:E(()=>new Uve,"AstNodeLocator"),AstNodeDescriptionProvider:E(e=>new Vve(e),"AstNodeDescriptionProvider"),ReferenceDescriptionProvider:E(e=>new Wve(e),"ReferenceDescriptionProvider")},references:{Linker:E(e=>new Ive(e),"Linker"),NameProvider:E(()=>new Dve,"NameProvider"),ScopeProvider:E(e=>new Pve(e),"ScopeProvider"),ScopeComputation:E(e=>new Nve(e),"ScopeComputation"),References:E(e=>new Mve(e),"References")},serializer:{Hydrator:E(e=>new f2e(e),"Hydrator"),JsonSerializer:E(e=>new Bve(e),"JsonSerializer")},validation:{DocumentValidator:E(e=>new qve(e),"DocumentValidator"),ValidationRegistry:E(e=>new zve(e),"ValidationRegistry")},shared:E(()=>t.shared,"shared")}}E(Sa,"createDefaultCoreModule");function _a(t){return{ServiceRegistry:E(e=>new Fve(e),"ServiceRegistry"),workspace:{LangiumDocuments:E(e=>new Lve(e),"LangiumDocuments"),LangiumDocumentFactory:E(e=>new Rve(e),"LangiumDocumentFactory"),DocumentBuilder:E(e=>new Yve(e),"DocumentBuilder"),IndexManager:E(e=>new Xve(e),"IndexManager"),WorkspaceManager:E(e=>new jve(e),"WorkspaceManager"),FileSystemProvider:E(e=>t.fileSystemProvider(e),"FileSystemProvider"),WorkspaceLock:E(()=>new d2e,"WorkspaceLock"),ConfigurationProvider:E(e=>new Hve(e),"ConfigurationProvider")},profilers:{}}}E(_a,"createDefaultSharedCoreModule");var EF;(function(t){t.merge=(e,r)=>d1(d1({},e),r)})(EF||(EF={}));function nn(t,e,r,n,i,a,s,o,l){const u=[t,e,r,n,i,a,s,o,l].reduce(d1,{});return _F(u)}E(nn,"inject");var p2e=Symbol("isProxy");function SF(t){if(t&&t[p2e])for(const e of Object.values(t))SF(e);return t}E(SF,"eagerLoad");function _F(t,e){const r=new Proxy({},{deleteProperty:E(()=>!1,"deleteProperty"),set:E(()=>{throw new Error("Cannot set property on injected service container")},"set"),get:E((n,i)=>i===p2e?!0:AF(n,i,t,e||r),"get"),getOwnPropertyDescriptor:E((n,i)=>(AF(n,i,t,e||r),Object.getOwnPropertyDescriptor(n,i)),"getOwnPropertyDescriptor"),has:E((n,i)=>i in t,"has"),ownKeys:E(()=>[...Object.getOwnPropertyNames(t)],"ownKeys")});return r}E(_F,"_inject");var g2e=Symbol();function AF(t,e,r,n){if(e in t){if(t[e]instanceof Error)throw new Error("Construction failure. Please make sure that your dependencies are constructable. Cause: "+t[e]);if(t[e]===g2e)throw new Error('Cycle detected. Please make "'+String(e)+'" lazy. Visit https://langium.org/docs/reference/configuration-services/#resolving-cyclic-dependencies');return t[e]}else if(e in r){const i=r[e];t[e]=g2e;try{t[e]=typeof i=="function"?i(n):_F(i,n)}catch(a){throw t[e]=a instanceof Error?a:void 0,a}return t[e]}else return}E(AF,"_resolve");function d1(t,e){if(e){for(const[r,n]of Object.entries(e))if(n!=null)if(typeof n=="object"){const i=t[r];typeof i=="object"&&i!==null?t[r]=d1(i,n):t[r]=d1({},n)}else t[r]=n}return t}E(d1,"_merge");var RF={indentTokenName:"INDENT",dedentTokenName:"DEDENT",whitespaceTokenName:"WS",ignoreIndentationDelimiters:[]},r0;(function(t){t.REGULAR="indentation-sensitive",t.IGNORE_INDENTATION="ignore-indentation"})(r0||(r0={}));var m2e=(k2=class extends E6{constructor(e=RF){super(),this.indentationStack=[0],this.whitespaceRegExp=/[ \t]+/y,this.options={...RF,...e},this.indentTokenType=a1({name:this.options.indentTokenName,pattern:this.indentMatcher.bind(this),line_breaks:!1}),this.dedentTokenType=a1({name:this.options.dedentTokenName,pattern:this.dedentMatcher.bind(this),line_breaks:!1})}buildTokens(e,r){const n=super.buildTokens(e,r);if(!P6(n))throw new Error("Invalid tokens built by default builder");const{indentTokenName:i,dedentTokenName:a,whitespaceTokenName:s,ignoreIndentationDelimiters:o}=this.options;let l,u,h;const d=[];for(const f of n){for(const[p,g]of o)f.name===p?f.PUSH_MODE=r0.IGNORE_INDENTATION:f.name===g&&(f.POP_MODE=!0);f.name===a?l=f:f.name===i?u=f:f.name===s?h=f:d.push(f)}if(!l||!u||!h)throw new Error("Some indentation/whitespace tokens not found!");return o.length>0?{modes:{[r0.REGULAR]:[l,u,...d,h],[r0.IGNORE_INDENTATION]:[...d,h]},defaultMode:r0.REGULAR}:[l,u,h,...d]}flushLexingReport(e){return{...super.flushLexingReport(e),remainingDedents:this.flushRemainingDedents(e)}}isStartOfLine(e,r){return r===0||`\r +`.includes(e[r-1])}matchWhitespace(e,r,n,i){this.whitespaceRegExp.lastIndex=r;const a=this.whitespaceRegExp.exec(e);return{currIndentLevel:(a==null?void 0:a[0].length)??0,prevIndentLevel:this.indentationStack.at(-1),match:a}}createIndentationTokenInstance(e,r,n,i){const a=this.getLineNumber(r,i);return TC(e,n,i,i+n.length,a,a,1,n.length)}getLineNumber(e,r){return e.substring(0,r).split(/\r\n|\r|\n/).length}indentMatcher(e,r,n,i){if(!this.isStartOfLine(e,r))return null;const{currIndentLevel:a,prevIndentLevel:s,match:o}=this.matchWhitespace(e,r,n,i);return a<=s?null:(this.indentationStack.push(a),o)}dedentMatcher(e,r,n,i){var d,f;if(!this.isStartOfLine(e,r))return null;const{currIndentLevel:a,prevIndentLevel:s,match:o}=this.matchWhitespace(e,r,n,i);if(a>=s)return null;const l=this.indentationStack.lastIndexOf(a);if(l===-1)return this.diagnostics.push({severity:"error",message:`Invalid dedent level ${a} at offset: ${r}. Current indentation stack: ${this.indentationStack}`,offset:r,length:((d=o==null?void 0:o[0])==null?void 0:d.length)??0,line:this.getLineNumber(e,r),column:1}),null;const u=this.indentationStack.length-l-1,h=((f=e.substring(0,r).match(/[\r\n]+$/))==null?void 0:f[0].length)??1;for(let p=0;p1;)r.push(this.createIndentationTokenInstance(this.dedentTokenType,e,"",e.length)),this.indentationStack.pop();return this.indentationStack=[0],r}},E(k2,"IndentationAwareTokenBuilder"),k2),lft=(E2=class extends gF{constructor(e){if(super(e),e.parser.TokenBuilder instanceof m2e)this.indentationTokenBuilder=e.parser.TokenBuilder;else throw new Error("IndentationAwareLexer requires an accompanying IndentationAwareTokenBuilder")}tokenize(e,r=pF){const n=super.tokenize(e),i=n.report;(r==null?void 0:r.mode)==="full"&&n.tokens.push(...i.remainingDedents),i.remainingDedents=[];const{indentTokenType:a,dedentTokenType:s}=this.indentationTokenBuilder,o=a.tokenTypeIdx,l=s.tokenTypeIdx,u=[],h=n.tokens.length-1;for(let d=0;d=0&&u.push(n.tokens[h]),n.tokens=u,n}},E(E2,"IndentationAwareLexer"),E2),LF={};gd(LF,{AstUtils:()=>lO,BiMap:()=>I6,Cancellation:()=>Vn,ContextCache:()=>M6,CstUtils:()=>aO,DONE_RESULT:()=>Is,Deferred:()=>ih,Disposable:()=>t0,DisposableCache:()=>D6,DocumentCache:()=>Ove,EMPTY_STREAM:()=>Nm,ErrorWithLocation:()=>t_,GrammarUtils:()=>FO,MultiMap:()=>ah,OperationCancelled:()=>qc,Reduction:()=>Nw,RegExpUtils:()=>GO,SimpleCache:()=>lF,StreamImpl:()=>Dc,TreeStreamImpl:()=>$m,URI:()=>Oo,UriTrie:()=>aF,UriUtils:()=>Bs,WorkspaceCache:()=>cF,assertCondition:()=>zO,assertUnreachable:()=>wd,delayNextTick:()=>S6,interruptAndCheck:()=>Ea,isOperationCancelled:()=>Qp,loadGrammarFromJson:()=>Aa,setInterruptionPeriod:()=>tF,startCancelableOperation:()=>A6,stream:()=>En}),xS(LF,$6);var y2e=(S2=class{stat(e){throw new Error("No file system is available.")}statSync(e){throw new Error("No file system is available.")}async exists(){return!1}existsSync(){return!1}readBinary(){throw new Error("No file system is available.")}readBinarySync(){throw new Error("No file system is available.")}readFile(){throw new Error("No file system is available.")}readFileSync(){throw new Error("No file system is available.")}async readDirectory(){return[]}readDirectorySync(){return[]}},E(S2,"EmptyFileSystemProvider"),S2),Wa={fileSystemProvider:E(()=>new y2e,"fileSystemProvider")},cft={Grammar:E(()=>{},"Grammar"),LanguageMetaData:E(()=>({caseInsensitive:!1,fileExtensions:[".langium"],languageId:"langium"}),"LanguageMetaData")},uft={AstReflection:E(()=>new RO,"AstReflection")};function v2e(){const t=nn(_a(Wa),uft),e=nn(Sa({shared:t}),cft);return t.ServiceRegistry.register(e),e}E(v2e,"createMinimalGrammarServices");function Aa(t){const e=v2e(),r=e.serializer.JsonSerializer.deserialize(t);return e.shared.workspace.LangiumDocumentFactory.fromModel(r,Oo.parse(`memory:/${r.name??"grammar"}.langium`)),r}E(Aa,"loadGrammarFromJson"),xS(ace,LF);var hft=(_2=class{constructor(e){this.activeCategories=new Set,this.allCategories=new Set(["validating","parsing","linking"]),this.activeCategories=e??new Set(this.allCategories),this.records=new ah}isActive(e){return this.activeCategories.has(e)}start(...e){e?e.forEach(r=>this.activeCategories.add(r)):this.activeCategories=new Set(this.allCategories)}stop(...e){e?e.forEach(r=>this.activeCategories.delete(r)):this.activeCategories.clear()}createTask(e,r){if(!this.isActive(e))throw new Error(`Category "${e}" is not active.`);return console.log(`Creating profiling task for '${e}.${r}'.`),new b2e(n=>this.records.add(e,this.dumpRecord(e,n)),r)}dumpRecord(e,r){console.info(`Task ${e}.${r.identifier} executed in ${r.duration.toFixed(2)}ms and ended at ${r.date.toISOString()}`);const n=[];for(const s of r.entries.keys()){const o=r.entries.get(s),l=o.reduce((u,h)=>u+h);n.push({name:`${r.identifier}.${s}`,count:o.length,duration:l})}const i=r.duration-n.map(s=>s.duration).reduce((s,o)=>s+o,0);n.push({name:r.identifier,count:1,duration:i}),n.sort((s,o)=>o.duration-s.duration);function a(s){return Math.round(100*s)/100}return E(a,"Round"),console.table(n.map(s=>({Element:s.name,Count:s.count,"Self %":a(100*s.duration/r.duration),"Time (ms)":a(s.duration)}))),r}getRecords(...e){return e.length===0?this.records.values():this.records.entries().filter(r=>e.some(n=>n===r[0])).flatMap(r=>r[1])}},E(_2,"DefaultLangiumProfiler"),_2),b2e=(A2=class{constructor(e,r){this.stack=[],this.entries=new ah,this.addRecord=e,this.identifier=r}start(){if(this.startTime!==void 0)throw new Error(`Task "${this.identifier}" is already started.`);this.startTime=performance.now()}stop(){if(this.startTime===void 0)throw new Error(`Task "${this.identifier}" was not started.`);if(this.stack.length!==0)throw new Error(`Task "${this.identifier}" cannot be stopped before sub-task(s): ${this.stack.map(r=>r.id).join(", ")}.`);const e={identifier:this.identifier,date:new Date,duration:performance.now()-this.startTime,entries:this.entries};this.addRecord(e),this.startTime=void 0,this.entries.clear()}startSubTask(e){this.stack.push({id:e,start:performance.now(),content:0})}stopSubTask(e){const r=this.stack.pop();if(!r)throw new Error(`Task "${this.identifier}.${e}" was not started.`);if(r.id!==e)throw new Error(`Sub-Task "${r.id}" is not already stopped.`);const n=performance.now()-r.start;this.stack.at(-1)!==void 0&&(this.stack[this.stack.length-1].content+=n);const i=n-r.content;this.entries.add(e,i)}},E(A2,"ProfilingTask"),A2),IF;(t=>{t.Terminals={ARROW_DIRECTION:/L|R|T|B/,ARROW_GROUP:/\{group\}/,ARROW_INTO:/<|>/,ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,ID:/[\w]([-\w]*\w)?/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,ARCH_ICON:/\([\w-:]+\)/,ARCH_TITLE:/\[(?:"([^"\\]|\\.)*"|'([^'\\]|\\.)*'|[\w ]+)\]/}})(IF||(IF={}));var DF;(t=>{t.Terminals={DOMAIN_NAME:/complex|complicated|clear|chaotic|confusion/,ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(DF||(DF={}));var MF;(t=>{t.Terminals={EM_ID:/[_a-zA-Z][\w_]*/,EM_FID:/\d{1,3}/,EM_DATA_INLINE:/\{(.*)\}|"(.*)"|'(.*)'/,EM_DATA_BLOCK:/\{[\t ]*\r?\n(?:[\S\s]*?\r?\n)?\}(?:\r?\n|(?!\S))/,EM_ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,EM_ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,EM_TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,EM_WS:/\s+/,EM_YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,EM_DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,EM_SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,EM_ML_COMMENT:/\/\*[\s\S]*?\*\//,EM_SL_COMMENT:/\/\/[^\n\r]*/}})(MF||(MF={}));var NF;(t=>{t.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,INT:/0|[1-9][0-9]*(?!\.)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,REFERENCE:/\w([-\./\w]*[-\w])?/}})(NF||(NF={}));var $F;(t=>{t.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})($F||($F={}));var OF;(t=>{t.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,INT:/0|[1-9][0-9]*(?!\.)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(OF||(OF={}));var PF;(t=>{t.Terminals={NUMBER_PIE:/(?:-?[0-9]+\.[0-9]+(?!\.))|(?:-?(0|[1-9][0-9]*)(?!\.))/,ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(PF||(PF={}));var BF;(t=>{t.Terminals={GRATICULE:/circle|polygon/,BOOLEAN:/true|false/,ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,NUMBER:/(?:[0-9]+\.[0-9]+(?!\.))|(?:0|[1-9][0-9]*(?!\.))/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,ID:/[\w]([-\w]*\w)?/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(BF||(BF={}));var FF;(t=>{t.Terminals={TITLE:/title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,ACC_TITLE:/accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,ACC_DESCR:/accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ABNF_RULENAME:/[A-Za-z][A-Za-z0-9-]*/,ABNF_STRING:/"[^"]*"/,ABNF_NUMVAL:/%[xXdDbB][0-9A-Fa-f]+(?:-[0-9A-Fa-f]+|\.[0-9A-Fa-f]+)*/,ABNF_REPEAT:/[0-9]*\*[0-9]*/,ABNF_EXACT_REPEAT:/[0-9]+/,ABNF_WHITESPACE:/[\t \r\n]+/,ABNF_YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,ABNF_DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,ABNF_SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,ABNF_COMMENT:/;[^\n\r]*/}})(FF||(FF={}));var zF;(t=>{t.Terminals={TITLE:/title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,ACC_TITLE:/accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,ACC_DESCR:/accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,EBNF_ID:/[A-Z_a-z][\w-]*/,EBNF_STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,EBNF_SPECIAL_SEQUENCE:/\?(?=[^?;]*[^?\s;][^?;]*\?)[^?;]*\?/,EBNF_WHITESPACE:/[\t \r\n]+/,EBNF_YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,EBNF_DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,EBNF_SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,EBNF_BLOCK_COMMENT:/\/\*[\s\S]*?\*\//,EBNF_ISO_COMMENT:/\(\*[\s\S]*?\*\)/}})(zF||(zF={}));var GF;(t=>{t.Terminals={TITLE:/title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,ACC_TITLE:/accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,ACC_DESCR:/accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,RR_ID:/[A-Z_a-z][\w-]*/,RR_STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,RR_WHITESPACE:/[\t \r\n]+/,RR_YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,RR_DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,RR_SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,RR_BLOCK_COMMENT:/\/\*[\s\S]*?\*\//}})(GF||(GF={}));var qF;(t=>{t.Terminals={TITLE:/title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,ACC_TITLE:/accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,ACC_DESCR:/accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,PEG_ID:/[A-Z_a-z][\w-]*/,PEG_STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,PEG_WHITESPACE:/[\t \r\n]+/,PEG_YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,PEG_DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,PEG_SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,PEG_LINE_COMMENT:/#[^\n\r]*/}})(qF||(qF={}));var VF;(t=>{t.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,TREEMAP_KEYWORD:/treemap-beta|treemap/,CLASS_DEF:/classDef\s+([a-zA-Z_][a-zA-Z0-9_]+)(?:\s+([^;\r\n]*))?(?:;)?/,STYLE_SEPARATOR:/:::/,SEPARATOR:/:/,COMMA:/,/,INDENTATION:/[ \t]{1,}/,WS:/[ \t]+/,ML_COMMENT:/\%\%[^\n]*/,NL:/\r?\n/,ID2:/[a-zA-Z_][a-zA-Z0-9_]*/,NUMBER2:/[0-9_\.\,]+/,STRING2:/"[^"]*"|'[^']*'/}})(VF||(VF={}));var WF;(t=>{t.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,CLASS_ANNOTATION:/[ \t]+:::[ \t]*[A-Za-z_][\w-]*/,ICON_ANNOTATION:/[ \t]+icon\([\w-]*(?::[\w-]+)?\)/,DESC_ANNOTATION:/[ \t]+##[^\n\r]*/,INDENTATION:/[ \t]{1,}/,QUOTED_NAME:/"[^"]*"|'[^']*'/,WS:/[ \t]+/,ML_COMMENT:/\%\%[^\n]*/,NL:/\r?\n/,BARE_NAME:/(?!:::|icon\(|##)[^ \t\n\r"'](?:(?![ \t]+:::[ \t]*[A-Za-z_]|[ \t]+icon\(|[ \t]+##)[^\n\r])*/}})(WF||(WF={}));var UF;(t=>{t.Terminals={WARDLEY_NUMBER:/[0-9]+\.[0-9]+/,ARROW:/->/,LINK_PORT:/\+<>|\+>|\+|-\.->|>|\+'[^']*'<>|\+'[^']*'<|\+'[^']*'>/,LINK_LABEL:/;[^\n\r]+/,STRATEGY:/build|buy|outsource|market/,KW_WARDLEY:/wardley-beta/,KW_SIZE:/size/,KW_EVOLUTION:/evolution/,KW_ANCHOR:/anchor/,KW_COMPONENT:/component/,KW_LABEL:/label/,KW_INERTIA:/inertia/,KW_EVOLVE:/evolve/,KW_PIPELINE:/pipeline/,KW_NOTE:/note/,KW_ANNOTATIONS:/annotations/,KW_ANNOTATION:/annotation/,KW_ACCELERATOR:/accelerator/,KW_DEACCELERATOR:/deaccelerator/,NAME_WITH_SPACES:/(?!title\s|accTitle|accDescr)[A-Za-z](?:[A-Za-z0-9_()&]|-(?!>))*(?:[ \t]+[A-Za-z(](?:[A-Za-z0-9_()&]|-(?!>))*)*/,WS:/[ \t]+/,ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,INT:/0|[1-9][0-9]*(?!\.)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,ID:/[\w]([-\w]*\w)?/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(UF||(UF={})),{...IF.Terminals,...DF.Terminals,...MF.Terminals,...NF.Terminals,...$F.Terminals,...OF.Terminals,...PF.Terminals,...BF.Terminals,...FF.Terminals,...zF.Terminals,...GF.Terminals,...qF.Terminals,...WF.Terminals,...VF.Terminals,...UF.Terminals};var x2e={$type:"AbnfAlternation",alternatives:"alternatives"},T2e={$type:"AbnfConcatenation",elements:"elements"},HF={$type:"AbnfElement",primary:"primary",repeat:"repeat"},w2e={$type:"AbnfGroup",element:"element"},C2e={$type:"AbnfNumVal",value:"value"},k2e={$type:"AbnfOptionalGroup",element:"element"},f1={$type:"AbnfPrimary"},YF={$type:"AbnfRule",definition:"definition",name:"name"},E2e={$type:"AbnfRuleName",name:"name"},S2e={$type:"AbnfStringLiteral",value:"value"},V6={$type:"Accelerator",name:"name",x:"x",y:"y"},XF={$type:"Alignment",direction:"direction",members:"members"},W6={$type:"Anchor",evolution:"evolution",name:"name",visibility:"visibility"},PC={$type:"Annotation",number:"number",text:"text",x:"x",y:"y"},jF={$type:"Annotations",x:"x",y:"y"},Vc={$type:"Architecture",accDescr:"accDescr",accTitle:"accTitle",alignments:"alignments",edges:"edges",groups:"groups",junctions:"junctions",services:"services",title:"title"};function dft(t){return Pi.isInstance(t,Vc.$type)}E(dft,"isArchitecture");var U6={$type:"Axis",label:"label",name:"name"},H6={$type:"Branch",name:"name",order:"order"};function fft(t){return Pi.isInstance(t,H6.$type)}E(fft,"isBranch");var _2e={$type:"Checkout",branch:"branch"},Y6={$type:"CherryPicking",id:"id",parent:"parent",tags:"tags"},KF={$type:"ClassDefStatement",className:"className",styleText:"styleText"},p1={$type:"Commit",id:"id",message:"message",tags:"tags",type:"type"};function pft(t){return Pi.isInstance(t,p1.$type)}E(pft,"isCommit");var X6={$type:"Common",accDescr:"accDescr",accTitle:"accTitle",title:"title"},n0={$type:"Component",decorator:"decorator",evolution:"evolution",inertia:"inertia",label:"label",name:"name",visibility:"visibility"},j6={$type:"Curve",entries:"entries",label:"label",name:"name"},i0={$type:"Cynefin",accDescr:"accDescr",accTitle:"accTitle",domains:"domains",title:"title",transitions:"transitions"};function gft(t){return Pi.isInstance(t,i0.$type)}E(gft,"isCynefin");var K6={$type:"Deaccelerator",name:"name",x:"x",y:"y"},A2e={$type:"Decorator",strategy:"strategy"},g1={$type:"Direction",accDescr:"accDescr",accTitle:"accTitle",dir:"dir",statements:"statements",title:"title"},Z6={$type:"DomainBlock",domain:"domain",items:"items"};function mft(t){return Pi.isInstance(t,Z6.$type)}E(mft,"isDomainBlock");var ZF={$type:"DomainItem",label:"label"};function yft(t){return Pi.isInstance(t,ZF.$type)}E(yft,"isDomainItem");var R2e={$type:"EbnfChoice",alternatives:"alternatives"},L2e={$type:"EbnfExceptionPostfix",except:"except"},I2e={$type:"EbnfGroup",element:"element"},D2e={$type:"EbnfNonTerminal",name:"name"},M2e={$type:"EbnfOneOrMorePostfix",operator:"operator"},N2e={$type:"EbnfOptional",element:"element"},$2e={$type:"EbnfOptionalPostfix",operator:"operator"},BC={$type:"EbnfPostfix"},a0={$type:"EbnfPrimary"},O2e={$type:"EbnfRepetition",element:"element"},QF={$type:"EbnfRule",definition:"definition",name:"name"},P2e={$type:"EbnfSequence",elements:"elements"},B2e={$type:"EbnfSpecial",text:"text"},JF={$type:"EbnfTerm",base:"base",postfixes:"postfixes"},F2e={$type:"EbnfTerminal",value:"value"},z2e={$type:"EbnfZeroOrMorePostfix",operator:"operator"},Wc={$type:"Edge",lhsDir:"lhsDir",lhsGroup:"lhsGroup",lhsId:"lhsId",lhsInto:"lhsInto",rhsDir:"rhsDir",rhsGroup:"rhsGroup",rhsId:"rhsId",rhsInto:"rhsInto",title:"title"},m1={$type:"EmDataEntity",dataBlockValue:"dataBlockValue",dataType:"dataType",name:"name"},s0={$type:"EmFrame"},FC={$type:"EmGwt",givenStatements:"givenStatements",sourceFrame:"sourceFrame",thenStatements:"thenStatements",whenStatements:"whenStatements"},G2e={$type:"EmGwtStatement",entityIdentifier:"entityIdentifier"},ez={$type:"EmModelEntity",name:"name"};function vft(t){return t==="rmo"||t==="readmodel"||t==="ui"||t==="cmd"||t==="command"||t==="evt"||t==="event"||t==="pcr"||t==="processor"}E(vft,"isEmModelEntityType");var Q6={$type:"EmNoteEntity",dataBlockValue:"dataBlockValue",dataType:"dataType",sourceFrame:"sourceFrame"},sh={$type:"EmResetFrame",dataInlineValue:"dataInlineValue",dataReference:"dataReference",dataType:"dataType",entityIdentifier:"entityIdentifier",modelEntityType:"modelEntityType",name:"name",sourceFrames:"sourceFrames"};function q2e(t){return Pi.isInstance(t,sh.$type)}E(q2e,"isEmResetFrame");var Ld={$type:"EmTimeFrame",dataInlineValue:"dataInlineValue",dataReference:"dataReference",dataType:"dataType",entityIdentifier:"entityIdentifier",modelEntityType:"modelEntityType",name:"name",sourceFrames:"sourceFrames"},tz={$type:"Entry",axis:"axis",value:"value"},oh={$type:"EventModel",accDescr:"accDescr",accTitle:"accTitle",dataEntities:"dataEntities",frames:"frames",gwtEntities:"gwtEntities",modelEntities:"modelEntities",noteEntities:"noteEntities",title:"title"},V2e={$type:"Evolution",stages:"stages"},J6={$type:"EvolutionStage",boundary:"boundary",name:"name",secondName:"secondName"},rz={$type:"Evolve",component:"component",target:"target"},o0={$type:"GitGraph",accDescr:"accDescr",accTitle:"accTitle",statements:"statements",title:"title"};function bft(t){return Pi.isInstance(t,o0.$type)}E(bft,"isGitGraph");var zC={$type:"Group",icon:"icon",id:"id",in:"in",title:"title"},GC={$type:"Info",accDescr:"accDescr",accTitle:"accTitle",title:"title"};function xft(t){return Pi.isInstance(t,GC.$type)}E(xft,"isInfo");var qC={$type:"Item",classSelector:"classSelector",name:"name"},nz={$type:"Junction",id:"id",in:"in"},VC={$type:"Label",negX:"negX",negY:"negY",offsetX:"offsetX",offsetY:"offsetY"},eA={$type:"Leaf",classSelector:"classSelector",name:"name",value:"value"},l0={$type:"Link",arrow:"arrow",from:"from",fromPort:"fromPort",linkLabel:"linkLabel",to:"to",toPort:"toPort"},y1={$type:"Merge",branch:"branch",id:"id",tags:"tags",type:"type"};function Tft(t){return Pi.isInstance(t,y1.$type)}E(Tft,"isMerge");var tA={$type:"Note",evolution:"evolution",text:"text",visibility:"visibility"},iz={$type:"Option",name:"name",value:"value"},v1={$type:"Packet",accDescr:"accDescr",accTitle:"accTitle",blocks:"blocks",title:"title"};function wft(t){return Pi.isInstance(t,v1.$type)}E(wft,"isPacket");var b1={$type:"PacketBlock",bits:"bits",end:"end",label:"label",start:"start"};function Cft(t){return Pi.isInstance(t,b1.$type)}E(Cft,"isPacketBlock");var W2e={$type:"PegAny",dot:"dot"},U2e={$type:"PegGroup",element:"element"},H2e={$type:"PegIdentifier",name:"name"},Y2e={$type:"PegLiteral",value:"value"},X2e={$type:"PegOrderedChoice",alternatives:"alternatives"},az={$type:"PegPrefix",operator:"operator",suffix:"suffix"},WC={$type:"PegPrimary"},sz={$type:"PegRule",definition:"definition",name:"name"},j2e={$type:"PegSequence",elements:"elements"},oz={$type:"PegSuffix",operator:"operator",primary:"primary"},c0={$type:"Pie",accDescr:"accDescr",accTitle:"accTitle",sections:"sections",showData:"showData",title:"title"};function kft(t){return Pi.isInstance(t,c0.$type)}E(kft,"isPie");var rA={$type:"PieSection",label:"label",value:"value"};function Eft(t){return Pi.isInstance(t,rA.$type)}E(Eft,"isPieSection");var lz={$type:"Pipeline",components:"components",parent:"parent"},nA={$type:"PipelineComponent",evolution:"evolution",label:"label",name:"name"},u0={$type:"Radar",accDescr:"accDescr",accTitle:"accTitle",axes:"axes",curves:"curves",options:"options",title:"title"},x1={$type:"Railroad",accDescr:"accDescr",accTitle:"accTitle",rules:"rules",title:"title"};function Sft(t){return Pi.isInstance(t,x1.$type)}E(Sft,"isRailroad");var T1={$type:"RailroadAbnf",accDescr:"accDescr",accTitle:"accTitle",rules:"rules",title:"title"};function _ft(t){return Pi.isInstance(t,T1.$type)}E(_ft,"isRailroadAbnf");var K2e={$type:"RailroadChoiceExpr",alternatives:"alternatives"},w1={$type:"RailroadEbnf",accDescr:"accDescr",accTitle:"accTitle",rules:"rules",title:"title"};function Aft(t){return Pi.isInstance(t,w1.$type)}E(Aft,"isRailroadEbnf");var lh={$type:"RailroadExpression"},Z2e={$type:"RailroadNonTerminalExpr",name:"name"},Q2e={$type:"RailroadOneOrMoreExpr",element:"element"},J2e={$type:"RailroadOptionalExpr",element:"element"},C1={$type:"RailroadPeg",accDescr:"accDescr",accTitle:"accTitle",rules:"rules",title:"title"};function Rft(t){return Pi.isInstance(t,C1.$type)}E(Rft,"isRailroadPeg");var cz={$type:"RailroadRule",definition:"definition",name:"name"},ebe={$type:"RailroadSequenceExpr",elements:"elements"},tbe={$type:"RailroadSpecialExpr",text:"text"},rbe={$type:"RailroadTerminalExpr",value:"value"},nbe={$type:"RailroadZeroOrMoreExpr",element:"element"},uz={$type:"Section",classSelector:"classSelector",name:"name"},k1={$type:"Service",icon:"icon",iconText:"iconText",id:"id",in:"in",title:"title"},hz={$type:"Size",height:"height",width:"width"},E1={$type:"Statement"},UC={$type:"Transition",from:"from",label:"label",to:"to"};function Lft(t){return Pi.isInstance(t,UC.$type)}E(Lft,"isTransition");var S1={$type:"Treemap",accDescr:"accDescr",accTitle:"accTitle",title:"title",TreemapRows:"TreemapRows"};function Ift(t){return Pi.isInstance(t,S1.$type)}E(Ift,"isTreemap");var dz={$type:"TreemapRow",indent:"indent",item:"item"},_1={$type:"TreeNode",classAnnotation:"classAnnotation",descAnnotation:"descAnnotation",iconAnnotation:"iconAnnotation",indent:"indent",name:"name"},HC={$type:"TreeView",accDescr:"accDescr",accTitle:"accTitle",nodes:"nodes",title:"title"},Ua={$type:"Wardley",accDescr:"accDescr",accelerators:"accelerators",accTitle:"accTitle",anchors:"anchors",annotation:"annotation",annotations:"annotations",components:"components",deaccelerators:"deaccelerators",evolution:"evolution",evolves:"evolves",links:"links",notes:"notes",pipelines:"pipelines",size:"size",title:"title"};function Dft(t){return Pi.isInstance(t,Ua.$type)}E(Dft,"isWardley");var ibe=(R2=class extends oO{constructor(){super(...arguments),this.types={AbnfAlternation:{name:x2e.$type,properties:{alternatives:{name:x2e.alternatives,defaultValue:[]}},superTypes:[]},AbnfConcatenation:{name:T2e.$type,properties:{elements:{name:T2e.elements,defaultValue:[]}},superTypes:[]},AbnfElement:{name:HF.$type,properties:{primary:{name:HF.primary},repeat:{name:HF.repeat}},superTypes:[]},AbnfGroup:{name:w2e.$type,properties:{element:{name:w2e.element}},superTypes:[f1.$type]},AbnfNumVal:{name:C2e.$type,properties:{value:{name:C2e.value}},superTypes:[f1.$type]},AbnfOptionalGroup:{name:k2e.$type,properties:{element:{name:k2e.element}},superTypes:[f1.$type]},AbnfPrimary:{name:f1.$type,properties:{},superTypes:[]},AbnfRule:{name:YF.$type,properties:{definition:{name:YF.definition},name:{name:YF.name}},superTypes:[]},AbnfRuleName:{name:E2e.$type,properties:{name:{name:E2e.name}},superTypes:[f1.$type]},AbnfStringLiteral:{name:S2e.$type,properties:{value:{name:S2e.value}},superTypes:[f1.$type]},Accelerator:{name:V6.$type,properties:{name:{name:V6.name},x:{name:V6.x},y:{name:V6.y}},superTypes:[]},Alignment:{name:XF.$type,properties:{direction:{name:XF.direction},members:{name:XF.members,defaultValue:[]}},superTypes:[]},Anchor:{name:W6.$type,properties:{evolution:{name:W6.evolution},name:{name:W6.name},visibility:{name:W6.visibility}},superTypes:[]},Annotation:{name:PC.$type,properties:{number:{name:PC.number},text:{name:PC.text},x:{name:PC.x},y:{name:PC.y}},superTypes:[]},Annotations:{name:jF.$type,properties:{x:{name:jF.x},y:{name:jF.y}},superTypes:[]},Architecture:{name:Vc.$type,properties:{accDescr:{name:Vc.accDescr},accTitle:{name:Vc.accTitle},alignments:{name:Vc.alignments,defaultValue:[]},edges:{name:Vc.edges,defaultValue:[]},groups:{name:Vc.groups,defaultValue:[]},junctions:{name:Vc.junctions,defaultValue:[]},services:{name:Vc.services,defaultValue:[]},title:{name:Vc.title}},superTypes:[]},Axis:{name:U6.$type,properties:{label:{name:U6.label},name:{name:U6.name}},superTypes:[]},Branch:{name:H6.$type,properties:{name:{name:H6.name},order:{name:H6.order}},superTypes:[E1.$type]},Checkout:{name:_2e.$type,properties:{branch:{name:_2e.branch}},superTypes:[E1.$type]},CherryPicking:{name:Y6.$type,properties:{id:{name:Y6.id},parent:{name:Y6.parent},tags:{name:Y6.tags,defaultValue:[]}},superTypes:[E1.$type]},ClassDefStatement:{name:KF.$type,properties:{className:{name:KF.className},styleText:{name:KF.styleText}},superTypes:[]},Commit:{name:p1.$type,properties:{id:{name:p1.id},message:{name:p1.message},tags:{name:p1.tags,defaultValue:[]},type:{name:p1.type}},superTypes:[E1.$type]},Common:{name:X6.$type,properties:{accDescr:{name:X6.accDescr},accTitle:{name:X6.accTitle},title:{name:X6.title}},superTypes:[]},Component:{name:n0.$type,properties:{decorator:{name:n0.decorator},evolution:{name:n0.evolution},inertia:{name:n0.inertia,defaultValue:!1},label:{name:n0.label},name:{name:n0.name},visibility:{name:n0.visibility}},superTypes:[]},Curve:{name:j6.$type,properties:{entries:{name:j6.entries,defaultValue:[]},label:{name:j6.label},name:{name:j6.name}},superTypes:[]},Cynefin:{name:i0.$type,properties:{accDescr:{name:i0.accDescr},accTitle:{name:i0.accTitle},domains:{name:i0.domains,defaultValue:[]},title:{name:i0.title},transitions:{name:i0.transitions,defaultValue:[]}},superTypes:[]},Deaccelerator:{name:K6.$type,properties:{name:{name:K6.name},x:{name:K6.x},y:{name:K6.y}},superTypes:[]},Decorator:{name:A2e.$type,properties:{strategy:{name:A2e.strategy}},superTypes:[]},Direction:{name:g1.$type,properties:{accDescr:{name:g1.accDescr},accTitle:{name:g1.accTitle},dir:{name:g1.dir},statements:{name:g1.statements,defaultValue:[]},title:{name:g1.title}},superTypes:[o0.$type]},DomainBlock:{name:Z6.$type,properties:{domain:{name:Z6.domain},items:{name:Z6.items,defaultValue:[]}},superTypes:[]},DomainItem:{name:ZF.$type,properties:{label:{name:ZF.label}},superTypes:[]},EbnfChoice:{name:R2e.$type,properties:{alternatives:{name:R2e.alternatives,defaultValue:[]}},superTypes:[]},EbnfExceptionPostfix:{name:L2e.$type,properties:{except:{name:L2e.except}},superTypes:[BC.$type]},EbnfGroup:{name:I2e.$type,properties:{element:{name:I2e.element}},superTypes:[a0.$type]},EbnfNonTerminal:{name:D2e.$type,properties:{name:{name:D2e.name}},superTypes:[a0.$type]},EbnfOneOrMorePostfix:{name:M2e.$type,properties:{operator:{name:M2e.operator}},superTypes:[BC.$type]},EbnfOptional:{name:N2e.$type,properties:{element:{name:N2e.element}},superTypes:[a0.$type]},EbnfOptionalPostfix:{name:$2e.$type,properties:{operator:{name:$2e.operator}},superTypes:[BC.$type]},EbnfPostfix:{name:BC.$type,properties:{},superTypes:[]},EbnfPrimary:{name:a0.$type,properties:{},superTypes:[]},EbnfRepetition:{name:O2e.$type,properties:{element:{name:O2e.element}},superTypes:[a0.$type]},EbnfRule:{name:QF.$type,properties:{definition:{name:QF.definition},name:{name:QF.name}},superTypes:[]},EbnfSequence:{name:P2e.$type,properties:{elements:{name:P2e.elements,defaultValue:[]}},superTypes:[]},EbnfSpecial:{name:B2e.$type,properties:{text:{name:B2e.text}},superTypes:[a0.$type]},EbnfTerm:{name:JF.$type,properties:{base:{name:JF.base},postfixes:{name:JF.postfixes,defaultValue:[]}},superTypes:[]},EbnfTerminal:{name:F2e.$type,properties:{value:{name:F2e.value}},superTypes:[a0.$type]},EbnfZeroOrMorePostfix:{name:z2e.$type,properties:{operator:{name:z2e.operator}},superTypes:[BC.$type]},Edge:{name:Wc.$type,properties:{lhsDir:{name:Wc.lhsDir},lhsGroup:{name:Wc.lhsGroup,defaultValue:!1},lhsId:{name:Wc.lhsId},lhsInto:{name:Wc.lhsInto,defaultValue:!1},rhsDir:{name:Wc.rhsDir},rhsGroup:{name:Wc.rhsGroup,defaultValue:!1},rhsId:{name:Wc.rhsId},rhsInto:{name:Wc.rhsInto,defaultValue:!1},title:{name:Wc.title}},superTypes:[]},EmDataEntity:{name:m1.$type,properties:{dataBlockValue:{name:m1.dataBlockValue},dataType:{name:m1.dataType},name:{name:m1.name}},superTypes:[]},EmFrame:{name:s0.$type,properties:{},superTypes:[]},EmGwt:{name:FC.$type,properties:{givenStatements:{name:FC.givenStatements,defaultValue:[]},sourceFrame:{name:FC.sourceFrame,referenceType:s0.$type},thenStatements:{name:FC.thenStatements,defaultValue:[]},whenStatements:{name:FC.whenStatements,defaultValue:[]}},superTypes:[]},EmGwtStatement:{name:G2e.$type,properties:{entityIdentifier:{name:G2e.entityIdentifier,referenceType:ez.$type}},superTypes:[]},EmModelEntity:{name:ez.$type,properties:{name:{name:ez.name}},superTypes:[]},EmNoteEntity:{name:Q6.$type,properties:{dataBlockValue:{name:Q6.dataBlockValue},dataType:{name:Q6.dataType},sourceFrame:{name:Q6.sourceFrame,referenceType:s0.$type}},superTypes:[]},EmResetFrame:{name:sh.$type,properties:{dataInlineValue:{name:sh.dataInlineValue},dataReference:{name:sh.dataReference,referenceType:m1.$type},dataType:{name:sh.dataType},entityIdentifier:{name:sh.entityIdentifier},modelEntityType:{name:sh.modelEntityType},name:{name:sh.name},sourceFrames:{name:sh.sourceFrames,defaultValue:[],referenceType:s0.$type}},superTypes:[s0.$type]},EmTimeFrame:{name:Ld.$type,properties:{dataInlineValue:{name:Ld.dataInlineValue},dataReference:{name:Ld.dataReference,referenceType:m1.$type},dataType:{name:Ld.dataType},entityIdentifier:{name:Ld.entityIdentifier},modelEntityType:{name:Ld.modelEntityType},name:{name:Ld.name},sourceFrames:{name:Ld.sourceFrames,defaultValue:[],referenceType:s0.$type}},superTypes:[s0.$type]},Entry:{name:tz.$type,properties:{axis:{name:tz.axis,referenceType:U6.$type},value:{name:tz.value}},superTypes:[]},EventModel:{name:oh.$type,properties:{accDescr:{name:oh.accDescr},accTitle:{name:oh.accTitle},dataEntities:{name:oh.dataEntities,defaultValue:[]},frames:{name:oh.frames,defaultValue:[]},gwtEntities:{name:oh.gwtEntities,defaultValue:[]},modelEntities:{name:oh.modelEntities,defaultValue:[]},noteEntities:{name:oh.noteEntities,defaultValue:[]},title:{name:oh.title}},superTypes:[]},Evolution:{name:V2e.$type,properties:{stages:{name:V2e.stages,defaultValue:[]}},superTypes:[]},EvolutionStage:{name:J6.$type,properties:{boundary:{name:J6.boundary},name:{name:J6.name},secondName:{name:J6.secondName}},superTypes:[]},Evolve:{name:rz.$type,properties:{component:{name:rz.component},target:{name:rz.target}},superTypes:[]},GitGraph:{name:o0.$type,properties:{accDescr:{name:o0.accDescr},accTitle:{name:o0.accTitle},statements:{name:o0.statements,defaultValue:[]},title:{name:o0.title}},superTypes:[]},Group:{name:zC.$type,properties:{icon:{name:zC.icon},id:{name:zC.id},in:{name:zC.in},title:{name:zC.title}},superTypes:[]},Info:{name:GC.$type,properties:{accDescr:{name:GC.accDescr},accTitle:{name:GC.accTitle},title:{name:GC.title}},superTypes:[]},Item:{name:qC.$type,properties:{classSelector:{name:qC.classSelector},name:{name:qC.name}},superTypes:[]},Junction:{name:nz.$type,properties:{id:{name:nz.id},in:{name:nz.in}},superTypes:[]},Label:{name:VC.$type,properties:{negX:{name:VC.negX,defaultValue:!1},negY:{name:VC.negY,defaultValue:!1},offsetX:{name:VC.offsetX},offsetY:{name:VC.offsetY}},superTypes:[]},Leaf:{name:eA.$type,properties:{classSelector:{name:eA.classSelector},name:{name:eA.name},value:{name:eA.value}},superTypes:[qC.$type]},Link:{name:l0.$type,properties:{arrow:{name:l0.arrow},from:{name:l0.from},fromPort:{name:l0.fromPort},linkLabel:{name:l0.linkLabel},to:{name:l0.to},toPort:{name:l0.toPort}},superTypes:[]},Merge:{name:y1.$type,properties:{branch:{name:y1.branch},id:{name:y1.id},tags:{name:y1.tags,defaultValue:[]},type:{name:y1.type}},superTypes:[E1.$type]},Note:{name:tA.$type,properties:{evolution:{name:tA.evolution},text:{name:tA.text},visibility:{name:tA.visibility}},superTypes:[]},Option:{name:iz.$type,properties:{name:{name:iz.name},value:{name:iz.value,defaultValue:!1}},superTypes:[]},Packet:{name:v1.$type,properties:{accDescr:{name:v1.accDescr},accTitle:{name:v1.accTitle},blocks:{name:v1.blocks,defaultValue:[]},title:{name:v1.title}},superTypes:[]},PacketBlock:{name:b1.$type,properties:{bits:{name:b1.bits},end:{name:b1.end},label:{name:b1.label},start:{name:b1.start}},superTypes:[]},PegAny:{name:W2e.$type,properties:{dot:{name:W2e.dot}},superTypes:[WC.$type]},PegGroup:{name:U2e.$type,properties:{element:{name:U2e.element}},superTypes:[WC.$type]},PegIdentifier:{name:H2e.$type,properties:{name:{name:H2e.name}},superTypes:[WC.$type]},PegLiteral:{name:Y2e.$type,properties:{value:{name:Y2e.value}},superTypes:[WC.$type]},PegOrderedChoice:{name:X2e.$type,properties:{alternatives:{name:X2e.alternatives,defaultValue:[]}},superTypes:[]},PegPrefix:{name:az.$type,properties:{operator:{name:az.operator},suffix:{name:az.suffix}},superTypes:[]},PegPrimary:{name:WC.$type,properties:{},superTypes:[]},PegRule:{name:sz.$type,properties:{definition:{name:sz.definition},name:{name:sz.name}},superTypes:[]},PegSequence:{name:j2e.$type,properties:{elements:{name:j2e.elements,defaultValue:[]}},superTypes:[]},PegSuffix:{name:oz.$type,properties:{operator:{name:oz.operator},primary:{name:oz.primary}},superTypes:[]},Pie:{name:c0.$type,properties:{accDescr:{name:c0.accDescr},accTitle:{name:c0.accTitle},sections:{name:c0.sections,defaultValue:[]},showData:{name:c0.showData,defaultValue:!1},title:{name:c0.title}},superTypes:[]},PieSection:{name:rA.$type,properties:{label:{name:rA.label},value:{name:rA.value}},superTypes:[]},Pipeline:{name:lz.$type,properties:{components:{name:lz.components,defaultValue:[]},parent:{name:lz.parent}},superTypes:[]},PipelineComponent:{name:nA.$type,properties:{evolution:{name:nA.evolution},label:{name:nA.label},name:{name:nA.name}},superTypes:[]},Radar:{name:u0.$type,properties:{accDescr:{name:u0.accDescr},accTitle:{name:u0.accTitle},axes:{name:u0.axes,defaultValue:[]},curves:{name:u0.curves,defaultValue:[]},options:{name:u0.options,defaultValue:[]},title:{name:u0.title}},superTypes:[]},Railroad:{name:x1.$type,properties:{accDescr:{name:x1.accDescr},accTitle:{name:x1.accTitle},rules:{name:x1.rules,defaultValue:[]},title:{name:x1.title}},superTypes:[]},RailroadAbnf:{name:T1.$type,properties:{accDescr:{name:T1.accDescr},accTitle:{name:T1.accTitle},rules:{name:T1.rules,defaultValue:[]},title:{name:T1.title}},superTypes:[]},RailroadChoiceExpr:{name:K2e.$type,properties:{alternatives:{name:K2e.alternatives,defaultValue:[]}},superTypes:[lh.$type]},RailroadEbnf:{name:w1.$type,properties:{accDescr:{name:w1.accDescr},accTitle:{name:w1.accTitle},rules:{name:w1.rules,defaultValue:[]},title:{name:w1.title}},superTypes:[]},RailroadExpression:{name:lh.$type,properties:{},superTypes:[]},RailroadNonTerminalExpr:{name:Z2e.$type,properties:{name:{name:Z2e.name}},superTypes:[lh.$type]},RailroadOneOrMoreExpr:{name:Q2e.$type,properties:{element:{name:Q2e.element}},superTypes:[lh.$type]},RailroadOptionalExpr:{name:J2e.$type,properties:{element:{name:J2e.element}},superTypes:[lh.$type]},RailroadPeg:{name:C1.$type,properties:{accDescr:{name:C1.accDescr},accTitle:{name:C1.accTitle},rules:{name:C1.rules,defaultValue:[]},title:{name:C1.title}},superTypes:[]},RailroadRule:{name:cz.$type,properties:{definition:{name:cz.definition},name:{name:cz.name}},superTypes:[]},RailroadSequenceExpr:{name:ebe.$type,properties:{elements:{name:ebe.elements,defaultValue:[]}},superTypes:[lh.$type]},RailroadSpecialExpr:{name:tbe.$type,properties:{text:{name:tbe.text}},superTypes:[lh.$type]},RailroadTerminalExpr:{name:rbe.$type,properties:{value:{name:rbe.value}},superTypes:[lh.$type]},RailroadZeroOrMoreExpr:{name:nbe.$type,properties:{element:{name:nbe.element}},superTypes:[lh.$type]},Section:{name:uz.$type,properties:{classSelector:{name:uz.classSelector},name:{name:uz.name}},superTypes:[qC.$type]},Service:{name:k1.$type,properties:{icon:{name:k1.icon},iconText:{name:k1.iconText},id:{name:k1.id},in:{name:k1.in},title:{name:k1.title}},superTypes:[]},Size:{name:hz.$type,properties:{height:{name:hz.height},width:{name:hz.width}},superTypes:[]},Statement:{name:E1.$type,properties:{},superTypes:[]},Transition:{name:UC.$type,properties:{from:{name:UC.from},label:{name:UC.label},to:{name:UC.to}},superTypes:[]},TreeNode:{name:_1.$type,properties:{classAnnotation:{name:_1.classAnnotation},descAnnotation:{name:_1.descAnnotation},iconAnnotation:{name:_1.iconAnnotation},indent:{name:_1.indent},name:{name:_1.name}},superTypes:[]},TreeView:{name:HC.$type,properties:{accDescr:{name:HC.accDescr},accTitle:{name:HC.accTitle},nodes:{name:HC.nodes,defaultValue:[]},title:{name:HC.title}},superTypes:[]},Treemap:{name:S1.$type,properties:{accDescr:{name:S1.accDescr},accTitle:{name:S1.accTitle},title:{name:S1.title},TreemapRows:{name:S1.TreemapRows,defaultValue:[]}},superTypes:[]},TreemapRow:{name:dz.$type,properties:{indent:{name:dz.indent},item:{name:dz.item}},superTypes:[]},Wardley:{name:Ua.$type,properties:{accDescr:{name:Ua.accDescr},accelerators:{name:Ua.accelerators,defaultValue:[]},accTitle:{name:Ua.accTitle},anchors:{name:Ua.anchors,defaultValue:[]},annotation:{name:Ua.annotation,defaultValue:[]},annotations:{name:Ua.annotations,defaultValue:[]},components:{name:Ua.components,defaultValue:[]},deaccelerators:{name:Ua.deaccelerators,defaultValue:[]},evolution:{name:Ua.evolution},evolves:{name:Ua.evolves,defaultValue:[]},links:{name:Ua.links,defaultValue:[]},notes:{name:Ua.notes,defaultValue:[]},pipelines:{name:Ua.pipelines,defaultValue:[]},size:{name:Ua.size},title:{name:Ua.title}},superTypes:[]}}}},E(R2,"MermaidAstReflection"),R2),Pi=new ibe,abe,Mft=E(()=>abe??(abe=Aa(`{"$type":"Grammar","isDeclared":true,"name":"ArchitectureGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Architecture","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"architecture-beta"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"Statement","definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"groups","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"services","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"junctions","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}},{"$type":"Assignment","feature":"edges","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}},{"$type":"Assignment","feature":"alignments","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}}]},"entry":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"LeftPort","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"lhsDir","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}]},"entry":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"RightPort","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"rhsDir","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Keyword","value":":"}]},"entry":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"Arrow","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]},{"$type":"Assignment","feature":"lhsInto","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"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@30"},"arguments":[]}},{"$type":"Keyword","value":"-"}]}]},{"$type":"Assignment","feature":"rhsInto","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}]},"entry":false,"parameters":[]},{"$type":"ParserRule","name":"Group","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"group"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Assignment","feature":"icon","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@30"},"arguments":[]},"cardinality":"?"},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Service","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"service"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"iconText","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Assignment","feature":"icon","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]}}],"cardinality":"?"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@30"},"arguments":[]},"cardinality":"?"},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Junction","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"junction"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Edge","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"lhsId","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Assignment","feature":"lhsGroup","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"Assignment","feature":"rhsId","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Assignment","feature":"rhsGroup","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Alignment","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"align"},{"$type":"Assignment","feature":"direction","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"row"},{"$type":"Keyword","value":"column"}]}},{"$type":"Assignment","feature":"members","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Assignment","feature":"members","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]},"cardinality":"+"},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"ARROW_DIRECTION","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"L"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"R"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"T"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"B"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARROW_GROUP","definition":{"$type":"RegexToken","regex":"/\\\\{group\\\\}/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARROW_INTO","definition":{"$type":"RegexToken","regex":"/<|>/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@19"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@20"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","name":"ARCH_ICON","definition":{"$type":"RegexToken","regex":"/\\\\([\\\\w-:]+\\\\)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARCH_TITLE","definition":{"$type":"RegexToken","regex":"/\\\\[(?:\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'|[\\\\w ]+)\\\\]/","parenthesized":false},"fragment":false,"hidden":false}],"interfaces":[],"types":[]}`)),"ArchitectureGrammarGrammar"),sbe,Nft=E(()=>sbe??(sbe=Aa(`{"$type":"Grammar","isDeclared":true,"name":"CynefinGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Cynefin","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"cynefin-beta"},{"$type":"Keyword","value":"cynefin-beta:"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"Assignment","feature":"domains","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"transitions","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"DomainBlock","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"domain","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"Assignment","feature":"items","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"*"}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"DomainItem","definition":{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Transition","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"from","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Keyword","value":"-->"},{"$type":"Assignment","feature":"to","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"DOMAIN_NAME","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"complex"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"complicated"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"clear"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"chaotic"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"confusion"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@11"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@12"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[],"types":[]}`)),"CynefinGrammarGrammar"),obe,$ft=E(()=>obe??(obe=Aa('{"$type":"Grammar","isDeclared":true,"name":"EventModeling","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","entry":true,"name":"EventModel","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"eventmodeling"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Assignment","feature":"modelEntities","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Assignment","feature":"frames","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}},{"$type":"Assignment","feature":"dataEntities","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Assignment","feature":"noteEntities","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"Assignment","feature":"gwtEntities","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmModelEntityType","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"rmo"},{"$type":"Keyword","value":"readmodel"},{"$type":"Keyword","value":"ui"},{"$type":"Keyword","value":"cmd"},{"$type":"Keyword","value":"command"},{"$type":"Keyword","value":"evt"},{"$type":"Keyword","value":"event"},{"$type":"Keyword","value":"pcr"},{"$type":"Keyword","value":"processor"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmDataType","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"json"},{"$type":"Keyword","value":"jsobj"},{"$type":"Keyword","value":"figma"},{"$type":"Keyword","value":"salt"},{"$type":"Keyword","value":"uri"},{"$type":"Keyword","value":"md"},{"$type":"Keyword","value":"html"},{"$type":"Keyword","value":"text"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"EmDataInline","definition":{"$type":"Group","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"`"},{"$type":"Assignment","feature":"dataType","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Keyword","value":"`"}],"cardinality":"?"},{"$type":"Assignment","feature":"dataInlineValue","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}}]},"entry":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"EmDataBlock","definition":{"$type":"Group","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"`"},{"$type":"Assignment","feature":"dataType","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Keyword","value":"`"}],"cardinality":"?"},{"$type":"Assignment","feature":"dataBlockValue","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}}]},"entry":false,"parameters":[]},{"$type":"ParserRule","name":"QualifiedName","dataType":"string","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Keyword","value":"."},{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmTimeFrame","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"tf"},{"$type":"Keyword","value":"timeframe"}]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Assignment","feature":"modelEntityType","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"entityIdentifier","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"->>"},{"$type":"Assignment","feature":"sourceFrames","operator":"+=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@8"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}}],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"Keyword","value":"[["},{"$type":"Assignment","feature":"dataReference","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@10"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"Keyword","value":"]]"}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmResetFrame","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"rf"},{"$type":"Keyword","value":"resetframe"}]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Assignment","feature":"modelEntityType","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"entityIdentifier","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"->>"},{"$type":"Assignment","feature":"sourceFrames","operator":"+=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@8"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}}],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"Keyword","value":"[["},{"$type":"Assignment","feature":"dataReference","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@10"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"Keyword","value":"]]"}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmFrame","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmModelEntity","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"entity"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmDataEntity","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"data"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmNoteEntity","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"note"},{"$type":"Assignment","feature":"sourceFrame","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@8"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmGwt","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"gwt"},{"$type":"Assignment","feature":"sourceFrame","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@8"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"Keyword","value":"given"},{"$type":"Assignment","feature":"givenStatements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},"cardinality":"+"},{"$type":"Group","elements":[{"$type":"Keyword","value":"when"},{"$type":"Assignment","feature":"whenStatements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},"cardinality":"+"}],"cardinality":"?"},{"$type":"Keyword","value":"then"},{"$type":"Assignment","feature":"thenStatements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},"cardinality":"+"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmGwtStatement","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]},{"$type":"Assignment","feature":"entityIdentifier","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@9"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EM_EID","dataType":"string","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EM_FI","dataType":"string","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"EM_ID","definition":{"$type":"RegexToken","regex":"/[_a-zA-Z][\\\\w_]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EM_FID","definition":{"$type":"RegexToken","regex":"/\\\\d{1,3}/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EM_DATA_INLINE","definition":{"$type":"RegexToken","regex":"/\\\\{(.*)\\\\}|\\"(.*)\\"|\'(.*)\'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EM_DATA_BLOCK","definition":{"$type":"RegexToken","regex":"/\\\\{[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?\\\\}(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EM_ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EM_ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EM_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"EM_WS","definition":{"$type":"RegexToken","regex":"/\\\\s+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EM_YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EM_DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EM_SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EM_ML_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\/\\\\*[\\\\s\\\\S]*?\\\\*\\\\//","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EM_SL_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\/\\\\/[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"imports":[],"types":[]}')),"EventModelingGrammar"),lbe,Oft=E(()=>lbe??(lbe=Aa(`{"$type":"Grammar","isDeclared":true,"name":"GitGraphGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"GitGraph","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"gitGraph"},{"$type":"Group","elements":[{"$type":"Keyword","value":"gitGraph"},{"$type":"Keyword","value":":"}]},{"$type":"Keyword","value":"gitGraph:"},{"$type":"Group","elements":[{"$type":"Keyword","value":"gitGraph"},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]},{"$type":"Keyword","value":":"}]}]},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]},{"$type":"Assignment","feature":"statements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Statement","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$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"}]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Commit","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"commit"},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"id:"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"msg:","cardinality":"?"},{"$type":"Assignment","feature":"message","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"type:"},{"$type":"Assignment","feature":"type","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"NORMAL"},{"$type":"Keyword","value":"REVERSE"},{"$type":"Keyword","value":"HIGHLIGHT"}]}}]}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Branch","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"branch"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"order:"},{"$type":"Assignment","feature":"order","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Merge","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"merge"},{"$type":"Assignment","feature":"branch","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]}},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"id:"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"type:"},{"$type":"Assignment","feature":"type","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"NORMAL"},{"$type":"Keyword","value":"REVERSE"},{"$type":"Keyword","value":"HIGHLIGHT"}]}}]}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Checkout","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"checkout"},{"$type":"Keyword","value":"switch"}]},{"$type":"Assignment","feature":"branch","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"CherryPicking","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"cherry-pick"},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"id:"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"parent:"},{"$type":"Assignment","feature":"parent","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@14"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@15"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","name":"REFERENCE","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\\\w([-\\\\./\\\\w]*[-\\\\w])?/","parenthesized":false},"fragment":false,"hidden":false}],"interfaces":[],"types":[]}`)),"GitGraphGrammarGrammar"),cbe,Pft=E(()=>cbe??(cbe=Aa(`{"$type":"Grammar","isDeclared":true,"name":"InfoGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Info","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"info"},{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"Keyword","value":"showInfo"},{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[],"cardinality":"*"}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"?"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@7"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@8"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[],"types":[]}`)),"InfoGrammarGrammar"),ube,Bft=E(()=>ube??(ube=Aa(`{"$type":"Grammar","isDeclared":true,"name":"PacketGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Packet","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"packet"},{"$type":"Keyword","value":"packet-beta"}]},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]},{"$type":"Assignment","feature":"blocks","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PacketBlock","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Assignment","feature":"start","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"-"},{"$type":"Assignment","feature":"end","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}}],"cardinality":"?"}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"+"},{"$type":"Assignment","feature":"bits","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}}]}]},{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@8"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@9"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[],"types":[]}`)),"PacketGrammarGrammar"),hbe,Fft=E(()=>hbe??(hbe=Aa(`{"$type":"Grammar","isDeclared":true,"name":"PieGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Pie","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"pie"},{"$type":"Assignment","feature":"showData","operator":"?=","terminal":{"$type":"Keyword","value":"showData"},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"Assignment","feature":"sections","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PieSection","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"FLOAT_PIE","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/-?[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT_PIE","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/-?(0|[1-9][0-9]*)(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER_PIE","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@2"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@3"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@11"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@12"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[],"types":[]}`)),"PieGrammarGrammar"),dbe,zft=E(()=>dbe??(dbe=Aa(`{"$type":"Grammar","isDeclared":true,"name":"RadarGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Radar","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"radar-beta"},{"$type":"Keyword","value":"radar-beta:"},{"$type":"Group","elements":[{"$type":"Keyword","value":"radar-beta"},{"$type":"Keyword","value":":"}]}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Keyword","value":"axis"},{"$type":"Assignment","feature":"axes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"axes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"curve"},{"$type":"Assignment","feature":"curves","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"curves","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}}],"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"options","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"options","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}}],"cardinality":"*"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"Label","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}},{"$type":"Keyword","value":"]"}]},"entry":false,"parameters":[]},{"$type":"ParserRule","name":"Axis","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Curve","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[],"cardinality":"?"},{"$type":"Keyword","value":"{"},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"Keyword","value":"}"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"Entries","definition":{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"}]}]},"entry":false,"parameters":[]},{"$type":"ParserRule","name":"DetailedEntry","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"axis","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@2"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"NumberEntry","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Option","definition":{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"showLegend"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"ticks"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"max"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"min"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"graticule"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}}]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"GRATICULE","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"circle"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"polygon"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@15"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@16"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[{"$type":"Interface","name":"Entry","attributes":[{"$type":"TypeAttribute","name":"axis","isOptional":true,"type":{"$type":"ReferenceType","referenceType":{"$type":"SimpleType","typeRef":{"$ref":"#/rules@2"}},"isMulti":false}},{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"number"},"isOptional":false}],"superTypes":[]}],"types":[]}`)),"RadarGrammarGrammar"),fbe,Gft=E(()=>fbe??(fbe=Aa('{"$type":"Grammar","isDeclared":true,"name":"RailroadAbnfGrammar","rules":[{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ABNF_RULENAME","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[A-Za-z][A-Za-z0-9-]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ABNF_STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"[^\\"]*\\"/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ABNF_NUMVAL","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/%[xXdDbB][0-9A-Fa-f]+(?:-[0-9A-Fa-f]+|\\\\.[0-9A-Fa-f]+)*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ABNF_REPEAT","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[0-9]*\\\\*[0-9]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ABNF_EXACT_REPEAT","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[0-9]+/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"ABNF_WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t \\\\r\\\\n]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ABNF_YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ABNF_DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ABNF_SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ABNF_COMMENT","definition":{"$type":"RegexToken","regex":"/;[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"ParserRule","entry":true,"name":"RailroadAbnf","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"railroad-abnf-beta"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"*"},{"$type":"Assignment","feature":"rules","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfRule","returnType":{"$ref":"#/interfaces@1"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Keyword","value":"="},{"$type":"Assignment","feature":"definition","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Keyword","value":";"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfAlternation","returnType":{"$ref":"#/interfaces@2"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"/"},{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfConcatenation","returnType":{"$ref":"#/interfaces@3"},"definition":{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]},"cardinality":"+"},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfElement","returnType":{"$ref":"#/interfaces@4"},"definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"repeat","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"repeat","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}}],"cardinality":"?"},{"$type":"Assignment","feature":"primary","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfPrimary","returnType":{"$ref":"#/interfaces@5"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfStringLiteral","returnType":{"$ref":"#/interfaces@6"},"definition":{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfNumVal","returnType":{"$ref":"#/interfaces@7"},"definition":{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfRuleName","returnType":{"$ref":"#/interfaces@8"},"definition":{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfGroup","returnType":{"$ref":"#/interfaces@9"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfOptionalGroup","returnType":{"$ref":"#/interfaces@10"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Keyword","value":"]"}]},"entry":false,"fragment":false,"parameters":[]}],"interfaces":[{"$type":"Interface","name":"RailroadAbnf","attributes":[{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"rules","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@1"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"AbnfRule","attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"definition","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"AbnfAlternation","attributes":[{"$type":"TypeAttribute","name":"alternatives","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@3"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"AbnfConcatenation","attributes":[{"$type":"TypeAttribute","name":"elements","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@4"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"AbnfElement","attributes":[{"$type":"TypeAttribute","name":"repeat","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"primary","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@5"}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"AbnfPrimary","attributes":[],"superTypes":[]},{"$type":"Interface","name":"AbnfStringLiteral","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"AbnfNumVal","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"AbnfRuleName","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"AbnfGroup","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"AbnfOptionalGroup","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]}],"imports":[],"types":[]}')),"RailroadAbnfGrammarGrammar"),pbe,qft=E(()=>pbe??(pbe=Aa(`{"$type":"Grammar","isDeclared":true,"name":"RailroadEbnfGrammar","rules":[{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EBNF_ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[A-Z_a-z][\\\\w-]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EBNF_STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EBNF_SPECIAL_SEQUENCE","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\\\?(?=[^?;]*[^?\\\\s;][^?;]*\\\\?)[^?;]*\\\\?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"EBNF_WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t \\\\r\\\\n]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EBNF_YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EBNF_DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EBNF_SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EBNF_BLOCK_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\/\\\\*[\\\\s\\\\S]*?\\\\*\\\\//","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EBNF_ISO_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\(\\\\*[\\\\s\\\\S]*?\\\\*\\\\)/","parenthesized":false},"fragment":false},{"$type":"ParserRule","entry":true,"name":"RailroadEbnf","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"railroad-ebnf-beta"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"*"},{"$type":"Assignment","feature":"rules","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfRule","returnType":{"$ref":"#/interfaces@1"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"="},{"$type":"Keyword","value":"::="}]},{"$type":"Assignment","feature":"definition","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Keyword","value":";"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfChoice","returnType":{"$ref":"#/interfaces@2"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"|"},{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfSequence","returnType":{"$ref":"#/interfaces@3"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":",","cardinality":"?"},{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfTerm","returnType":{"$ref":"#/interfaces@4"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"base","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},{"$type":"Assignment","feature":"postfixes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfPrimary","returnType":{"$ref":"#/interfaces@5"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfTerminal","returnType":{"$ref":"#/interfaces@7"},"definition":{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfNonTerminal","returnType":{"$ref":"#/interfaces@8"},"definition":{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfSpecial","returnType":{"$ref":"#/interfaces@9"},"definition":{"$type":"Assignment","feature":"text","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfGroup","returnType":{"$ref":"#/interfaces@10"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfOptional","returnType":{"$ref":"#/interfaces@11"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Keyword","value":"]"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfRepetition","returnType":{"$ref":"#/interfaces@12"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Keyword","value":"}"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfPostfix","returnType":{"$ref":"#/interfaces@6"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@25"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@26"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@27"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@28"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfOptionalPostfix","returnType":{"$ref":"#/interfaces@13"},"definition":{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"?"}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfZeroOrMorePostfix","returnType":{"$ref":"#/interfaces@14"},"definition":{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"*"}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfOneOrMorePostfix","returnType":{"$ref":"#/interfaces@15"},"definition":{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"+"}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfExceptionPostfix","returnType":{"$ref":"#/interfaces@16"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"-"},{"$type":"Assignment","feature":"except","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},"entry":false,"fragment":false,"parameters":[]}],"interfaces":[{"$type":"Interface","name":"RailroadEbnf","attributes":[{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"rules","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@1"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"EbnfRule","attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"definition","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"EbnfChoice","attributes":[{"$type":"TypeAttribute","name":"alternatives","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@3"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"EbnfSequence","attributes":[{"$type":"TypeAttribute","name":"elements","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@4"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"EbnfTerm","attributes":[{"$type":"TypeAttribute","name":"base","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@5"}},"isOptional":false},{"$type":"TypeAttribute","name":"postfixes","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@6"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"EbnfPrimary","attributes":[],"superTypes":[]},{"$type":"Interface","name":"EbnfPostfix","attributes":[],"superTypes":[]},{"$type":"Interface","name":"EbnfTerminal","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"EbnfNonTerminal","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"EbnfSpecial","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"text","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"EbnfGroup","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"EbnfOptional","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"EbnfRepetition","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"EbnfOptionalPostfix","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"operator","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"EbnfZeroOrMorePostfix","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"operator","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"EbnfOneOrMorePostfix","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"operator","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"EbnfExceptionPostfix","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"except","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@5"}},"isOptional":false}]}],"imports":[],"types":[]}`)),"RailroadEbnfGrammarGrammar"),gbe,Vft=E(()=>gbe??(gbe=Aa(`{"$type":"Grammar","isDeclared":true,"name":"RailroadGrammar","rules":[{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"RR_ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[A-Z_a-z][\\\\w-]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"RR_STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"RR_WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t \\\\r\\\\n]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"RR_YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"RR_DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"RR_SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"RR_BLOCK_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\/\\\\*[\\\\s\\\\S]*?\\\\*\\\\//","parenthesized":false},"fragment":false},{"$type":"ParserRule","entry":true,"name":"Railroad","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"railroad-beta"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"*"},{"$type":"Assignment","feature":"rules","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]},"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadRule","returnType":{"$ref":"#/interfaces@1"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Keyword","value":"="},{"$type":"Assignment","feature":"definition","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Keyword","value":";"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadExpression","returnType":{"$ref":"#/interfaces@2"},"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":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadSequenceExpr","returnType":{"$ref":"#/interfaces@3"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"sequence"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}}],"cardinality":"*"},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadChoiceExpr","returnType":{"$ref":"#/interfaces@4"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"choice"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}}],"cardinality":"*"},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadOptionalExpr","returnType":{"$ref":"#/interfaces@5"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"optional"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadOneOrMoreExpr","returnType":{"$ref":"#/interfaces@6"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"oneOrMore"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadZeroOrMoreExpr","returnType":{"$ref":"#/interfaces@7"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"zeroOrMore"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadTerminalExpr","returnType":{"$ref":"#/interfaces@8"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"terminal"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadNonTerminalExpr","returnType":{"$ref":"#/interfaces@9"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"nonterminal"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadSpecialExpr","returnType":{"$ref":"#/interfaces@10"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"special"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"text","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]}],"interfaces":[{"$type":"Interface","name":"Railroad","attributes":[{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"rules","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@1"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"RailroadRule","attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"definition","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"RailroadExpression","attributes":[],"superTypes":[]},{"$type":"Interface","name":"RailroadSequenceExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"elements","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}}},"isOptional":false}]},{"$type":"Interface","name":"RailroadChoiceExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"alternatives","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}}},"isOptional":false}]},{"$type":"Interface","name":"RailroadOptionalExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"RailroadOneOrMoreExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"RailroadZeroOrMoreExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"RailroadTerminalExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"RailroadNonTerminalExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"RailroadSpecialExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"text","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]}],"imports":[],"types":[]}`)),"RailroadGrammarGrammar"),mbe,Wft=E(()=>mbe??(mbe=Aa(`{"$type":"Grammar","isDeclared":true,"name":"RailroadPegGrammar","rules":[{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"PEG_ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[A-Z_a-z][\\\\w-]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"PEG_STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"PEG_WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t \\\\r\\\\n]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"PEG_YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"PEG_DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"PEG_SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"PEG_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/#[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"ParserRule","entry":true,"name":"RailroadPeg","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"railroad-peg-beta"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"*"},{"$type":"Assignment","feature":"rules","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]},"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegRule","returnType":{"$ref":"#/interfaces@1"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Keyword","value":"<-"},{"$type":"Assignment","feature":"definition","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Keyword","value":";"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegOrderedChoice","returnType":{"$ref":"#/interfaces@2"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"/"},{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegSequence","returnType":{"$ref":"#/interfaces@3"},"definition":{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"cardinality":"+"},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegPrefix","returnType":{"$ref":"#/interfaces@4"},"definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"&"}},{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"!"}}],"cardinality":"?"},{"$type":"Assignment","feature":"suffix","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegSuffix","returnType":{"$ref":"#/interfaces@5"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"primary","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"?"}},{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"*"}},{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"+"}}],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegPrimary","returnType":{"$ref":"#/interfaces@6"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegLiteral","returnType":{"$ref":"#/interfaces@7"},"definition":{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegIdentifier","returnType":{"$ref":"#/interfaces@8"},"definition":{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegGroup","returnType":{"$ref":"#/interfaces@9"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegAny","returnType":{"$ref":"#/interfaces@10"},"definition":{"$type":"Assignment","feature":"dot","operator":"=","terminal":{"$type":"Keyword","value":"."}},"entry":false,"fragment":false,"parameters":[]}],"interfaces":[{"$type":"Interface","name":"RailroadPeg","attributes":[{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"rules","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@1"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"PegRule","attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"definition","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"PegOrderedChoice","attributes":[{"$type":"TypeAttribute","name":"alternatives","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@3"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"PegSequence","attributes":[{"$type":"TypeAttribute","name":"elements","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@4"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"PegPrefix","attributes":[{"$type":"TypeAttribute","name":"operator","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"suffix","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@5"}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"PegSuffix","attributes":[{"$type":"TypeAttribute","name":"primary","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@6"}},"isOptional":false},{"$type":"TypeAttribute","name":"operator","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]},{"$type":"Interface","name":"PegPrimary","attributes":[],"superTypes":[]},{"$type":"Interface","name":"PegLiteral","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"PegIdentifier","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"PegGroup","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"PegAny","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"dot","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]}],"imports":[],"types":[]}`)),"RailroadPegGrammarGrammar"),ybe,Uft=E(()=>ybe??(ybe=Aa(`{"$type":"Grammar","isDeclared":true,"name":"TreemapGrammar","rules":[{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","entry":true,"name":"Treemap","returnType":{"$ref":"#/interfaces@4"},"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]},{"$type":"Assignment","feature":"TreemapRows","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"TREEMAP_KEYWORD","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"treemap-beta"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"treemap"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"CLASS_DEF","definition":{"$type":"RegexToken","regex":"/classDef\\\\s+([a-zA-Z_][a-zA-Z0-9_]+)(?:\\\\s+([^;\\\\r\\\\n]*))?(?:;)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STYLE_SEPARATOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":":::"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"SEPARATOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":":"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"COMMA","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":","},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INDENTATION","definition":{"$type":"RegexToken","regex":"/[ \\\\t]{1,}/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WS","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ML_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\%\\\\%[^\\\\n]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"NL","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false},{"$type":"ParserRule","name":"TreemapRow","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"indent","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"item","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"ClassDef","dataType":"string","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Item","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Section","returnType":{"$ref":"#/interfaces@1"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]},{"$type":"Assignment","feature":"classSelector","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Leaf","returnType":{"$ref":"#/interfaces@2"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[],"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[],"cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]},{"$type":"Assignment","feature":"classSelector","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"ID2","definition":{"$type":"RegexToken","regex":"/[a-zA-Z_][a-zA-Z0-9_]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER2","definition":{"$type":"RegexToken","regex":"/[0-9_\\\\.\\\\,]+/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"MyNumber","dataType":"number","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"STRING2","definition":{"$type":"RegexToken","regex":"/\\"[^\\"]*\\"|'[^']*'/","parenthesized":false},"fragment":false,"hidden":false}],"interfaces":[{"$type":"Interface","name":"Item","attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"classSelector","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]},{"$type":"Interface","name":"Section","superTypes":[{"$ref":"#/interfaces@0"}],"attributes":[]},{"$type":"Interface","name":"Leaf","superTypes":[{"$ref":"#/interfaces@0"}],"attributes":[{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"number"},"isOptional":false}]},{"$type":"Interface","name":"ClassDefStatement","attributes":[{"$type":"TypeAttribute","name":"className","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"styleText","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"Treemap","attributes":[{"$type":"TypeAttribute","name":"TreemapRows","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/rules@15"}}},"isOptional":false},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"imports":[],"types":[],"$comment":"/**\\n * Treemap grammar for Langium\\n * Converted from mindmap grammar\\n *\\n * The ML_COMMENT and NL hidden terminals handle whitespace, comments, and newlines\\n * before the treemap keyword, allowing for empty lines and comments before the\\n * treemap declaration.\\n */"}`)),"TreemapGrammarGrammar"),vbe,Hft=E(()=>vbe??(vbe=Aa(`{"$type":"Grammar","isDeclared":true,"name":"TreeViewGrammar","rules":[{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","entry":true,"name":"TreeView","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"treeView-beta"},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[],"cardinality":"?"},{"$type":"Assignment","feature":"nodes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"CLASS_ANNOTATION","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+:::[ \\\\t]*[A-Za-z_][\\\\w-]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ICON_ANNOTATION","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+icon\\\\([\\\\w-]*(?::[\\\\w-]+)?\\\\)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"DESC_ANNOTATION","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+##[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INDENTATION","definition":{"$type":"RegexToken","regex":"/[ \\\\t]{1,}/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"QUOTED_NAME","definition":{"$type":"RegexToken","regex":"/\\"[^\\"]*\\"|'[^']*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WS","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ML_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\%\\\\%[^\\\\n]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"NL","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","name":"BARE_NAME","definition":{"$type":"RegexToken","regex":"/(?!:::|icon\\\\(|##)[^ \\\\t\\\\n\\\\r\\"'](?:(?![ \\\\t]+:::[ \\\\t]*[A-Za-z_]|[ \\\\t]+icon\\\\(|[ \\\\t]+##)[^\\\\n\\\\r])*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"TreeNode","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"indent","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}}]},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"classAnnotation","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"iconAnnotation","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"descAnnotation","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]}],"interfaces":[{"$type":"Interface","name":"TreeView","attributes":[{"$type":"TypeAttribute","name":"nodes","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/rules@14"}}},"isOptional":false},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"imports":[],"types":[],"$comment":"/**\\n * TreeView grammar for Langium\\n *\\n * Supports both quoted labels (\\"my file\\") and bare labels (index.js).\\n * Annotations (:::class, icon(), ## description) are parsed directly into\\n * AST fields by the grammar. Value conversion for stripping quotes, extracting\\n * class names, icon names, and description text happens in valueConverter.ts.\\n *\\n * The ML_COMMENT and NL hidden terminals handle whitespace, comments, and newlines\\n * before the treeView keyword, allowing for empty lines and comments before the\\n * treeView declaration.\\n */"}`)),"TreeViewGrammarGrammar"),bbe,Yft=E(()=>bbe??(bbe=Aa(`{"$type":"Grammar","isDeclared":true,"name":"WardleyGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Wardley","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@52"},"arguments":[],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@25"},"arguments":[]},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@52"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@42"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"Statement","definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"size","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Assignment","feature":"evolution","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Assignment","feature":"anchors","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"components","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"links","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Assignment","feature":"evolves","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Assignment","feature":"pipelines","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"Assignment","feature":"notes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}},{"$type":"Assignment","feature":"annotations","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Assignment","feature":"annotation","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Assignment","feature":"accelerators","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},{"$type":"Assignment","feature":"deaccelerators","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}}]},"entry":false,"parameters":[]},{"$type":"ParserRule","name":"Size","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@26"},"arguments":[]},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"width","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"height","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Evolution","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@27"},"arguments":[]},{"$type":"Assignment","feature":"stages","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]},{"$type":"Assignment","feature":"stages","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}}],"cardinality":"+"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EvolutionStage","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"@"},{"$type":"Assignment","feature":"boundary","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}}],"cardinality":"?"},{"$type":"Group","elements":[{"$type":"Keyword","value":"/"},{"$type":"Assignment","feature":"secondName","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}}],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Anchor","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@28"},"arguments":[]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"visibility","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"evolution","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Component","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"visibility","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"evolution","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"decorator","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"inertia","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@31"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"inertia","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@31"},"arguments":[]}},{"$type":"Keyword","value":")"}]}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Label","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@30"},"arguments":[]},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"negX","operator":"?=","terminal":{"$type":"Keyword","value":"-"},"cardinality":"?"},{"$type":"Assignment","feature":"offsetX","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"negY","operator":"?=","terminal":{"$type":"Keyword","value":"-"},"cardinality":"?"},{"$type":"Assignment","feature":"offsetY","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}},{"$type":"Keyword","value":"]"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Decorator","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"strategy","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Link","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"from","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Assignment","feature":"fromPort","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"arrow","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}]},"cardinality":"?"},{"$type":"Assignment","feature":"to","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Assignment","feature":"toPort","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"linkLabel","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Evolve","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@32"},"arguments":[]},{"$type":"Assignment","feature":"component","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Assignment","feature":"target","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Pipeline","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@33"},"arguments":[]},{"$type":"Assignment","feature":"parent","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"{"},{"$type":"RuleCall","rule":{"$ref":"#/rules@52"},"arguments":[],"cardinality":"+"},{"$type":"Assignment","feature":"components","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]},"cardinality":"+"},{"$type":"Keyword","value":"}"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PipelineComponent","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"evolution","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Note","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@34"},"arguments":[]},{"$type":"Assignment","feature":"text","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"visibility","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"evolution","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Annotations","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@35"},"arguments":[]},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"x","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"y","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Annotation","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@36"},"arguments":[]},{"$type":"Assignment","feature":"number","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"x","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"y","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"Assignment","feature":"text","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"CoordinateValue","dataType":"number","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Accelerator","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@37"},"arguments":[]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"x","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"y","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Deaccelerator","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@38"},"arguments":[]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"x","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"y","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"WARDLEY_NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARROW","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"->"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"LINK_PORT","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"+<>"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"+>"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"+<"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"LINK_ARROW","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"-->"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"-.->"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":">"},"parenthesized":false}],"parenthesized":false},{"$type":"RegexToken","regex":"/\\\\+'[^']*'<>/","parenthesized":false}],"parenthesized":false},{"$type":"RegexToken","regex":"/\\\\+'[^']*'/","parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"LINK_LABEL","definition":{"$type":"RegexToken","regex":"/;[^\\\\n\\\\r]+/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRATEGY","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"build"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"buy"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"outsource"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"market"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_WARDLEY","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"wardley-beta"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_SIZE","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"size"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_EVOLUTION","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"evolution"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_ANCHOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"anchor"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_COMPONENT","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"component"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_LABEL","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"label"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_INERTIA","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"inertia"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_EVOLVE","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"evolve"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_PIPELINE","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"pipeline"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_NOTE","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"note"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_ANNOTATIONS","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"annotations"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_ANNOTATION","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"annotation"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_ACCELERATOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"accelerator"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_DEACCELERATOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"deaccelerator"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NAME_WITH_SPACES","definition":{"$type":"RegexToken","regex":"/(?!title\\\\s|accTitle|accDescr)[A-Za-z](?:[A-Za-z0-9_()&]|-(?!>))*(?:[ \\\\t]+[A-Za-z(](?:[A-Za-z0-9_()&]|-(?!>))*)*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WS","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+/","parenthesized":false},"fragment":false},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@52"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@44"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@45"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@46"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@47"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@48"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[],"types":[]}`)),"WardleyGrammarGrammar"),Xft={languageId:"architecture",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},jft={languageId:"cynefin",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Kft={languageId:"eventmodeling",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Zft={languageId:"gitGraph",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Qft={languageId:"info",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Jft={languageId:"packet",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},ept={languageId:"pie",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},tpt={languageId:"radar",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},rpt={languageId:"railroadAbnf",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},npt={languageId:"railroadEbnf",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},ipt={languageId:"railroad",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},apt={languageId:"railroadPeg",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},spt={languageId:"treemap",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},opt={languageId:"treeView",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},lpt={languageId:"wardley",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Fs={AstReflection:E(()=>new ibe,"AstReflection")},cpt={Grammar:E(()=>Mft(),"Grammar"),LanguageMetaData:E(()=>Xft,"LanguageMetaData"),parser:{}},upt={Grammar:E(()=>Nft(),"Grammar"),LanguageMetaData:E(()=>jft,"LanguageMetaData"),parser:{}},hpt={Grammar:E(()=>$ft(),"Grammar"),LanguageMetaData:E(()=>Kft,"LanguageMetaData"),parser:{}},dpt={Grammar:E(()=>Oft(),"Grammar"),LanguageMetaData:E(()=>Zft,"LanguageMetaData"),parser:{}},fpt={Grammar:E(()=>Pft(),"Grammar"),LanguageMetaData:E(()=>Qft,"LanguageMetaData"),parser:{}},ppt={Grammar:E(()=>Bft(),"Grammar"),LanguageMetaData:E(()=>Jft,"LanguageMetaData"),parser:{}},gpt={Grammar:E(()=>Fft(),"Grammar"),LanguageMetaData:E(()=>ept,"LanguageMetaData"),parser:{}},mpt={Grammar:E(()=>zft(),"Grammar"),LanguageMetaData:E(()=>tpt,"LanguageMetaData"),parser:{}},ypt={Grammar:E(()=>Gft(),"Grammar"),LanguageMetaData:E(()=>rpt,"LanguageMetaData"),parser:{}},vpt={Grammar:E(()=>qft(),"Grammar"),LanguageMetaData:E(()=>npt,"LanguageMetaData"),parser:{}},bpt={Grammar:E(()=>Vft(),"Grammar"),LanguageMetaData:E(()=>ipt,"LanguageMetaData"),parser:{}},xpt={Grammar:E(()=>Wft(),"Grammar"),LanguageMetaData:E(()=>apt,"LanguageMetaData"),parser:{}},Tpt={Grammar:E(()=>Uft(),"Grammar"),LanguageMetaData:E(()=>spt,"LanguageMetaData"),parser:{}},wpt={Grammar:E(()=>Hft(),"Grammar"),LanguageMetaData:E(()=>opt,"LanguageMetaData"),parser:{}},Cpt={Grammar:E(()=>Yft(),"Grammar"),LanguageMetaData:E(()=>lpt,"LanguageMetaData"),parser:{}},kpt=/accDescr(?:[\t ]*:([^\n\r]*)|\s*{([^}]*)})/,Ept=/accTitle[\t ]*:([^\n\r]*)/,Spt=/title([\t ][^\n\r]*|)/,_pt={ACC_DESCR:kpt,ACC_TITLE:Ept,TITLE:Spt},Uc=(L2=class extends eF{runConverter(e,r,n){let i=this.runCommonConverter(e,r,n);return i===void 0&&(i=this.runCustomConverter(e,r,n)),i===void 0?super.runConverter(e,r,n):i}runCommonConverter(e,r,n){const i=_pt[e.name];if(i===void 0)return;const a=i.exec(r);if(a!==null){if(a[1]!==void 0)return a[1].trim().replace(/[\t ]{2,}/gm," ");if(a[2]!==void 0)return a[2].replace(/^\s*/gm,"").replace(/\s+$/gm,"").replace(/[\t ]{2,}/gm," ").replace(/[\n\r]{2,}/gm,` +`)}}},E(L2,"AbstractMermaidValueConverter"),L2),A1=(I2=class extends Uc{runCustomConverter(e,r,n){}},E(I2,"CommonValueConverter"),I2),zs=(D2=class extends E6{constructor(e){super(),this.keywords=new Set(e)}buildKeywordTokens(e,r,n){const i=super.buildKeywordTokens(e,r,n);return i.forEach(a=>{this.keywords.has(a.name)&&a.PATTERN!==void 0&&(a.PATTERN=new RegExp(a.PATTERN.toString()+"(?:(?=%%)|(?!\\S))"))}),i}},E(D2,"AbstractMermaidTokenBuilder"),D2);M2=class extends zs{},E(M2,"CommonTokenBuilder");/*! Bundled license information: lodash-es/lodash.js: (** @@ -1334,39 +1335,39 @@ ${r}`),this.inline?`{${i}}`:i}},E(Oy,"JSDocTagImpl"),Oy);function Vfe(t,e,r){var * Based on Underscore.js 1.8.3 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors *) - */var qit=(tv=class extends us{constructor(){super(["radar-beta"])}},E(tv,"RadarTokenBuilder"),tv),npe={parser:{TokenBuilder:E(()=>new qit,"TokenBuilder"),ValueConverter:E(()=>new Kg,"ValueConverter")}};function ipe(t=ba){const e=Xr(ia(t),cs),r=Xr(na({shared:e}),Lit,npe);return e.ServiceRegistry.register(r),{shared:e,Radar:r}}E(ipe,"createRadarServices");var Vit=(rv=class extends us{constructor(){super(["railroad-beta"])}},E(rv,"RailroadTokenBuilder"),rv),ape=E(t=>{const e=t.slice(1,-1);let r="";for(let n=0;nnew Vit,"TokenBuilder"),ValueConverter:E(()=>new Wit,"ValueConverter")}};function ope(t=ba){const e=Xr(ia(t),cs),r=Xr(na({shared:e}),Mit,spe);return e.ServiceRegistry.register(r),{shared:e,Railroad:r}}E(ope,"createRailroadServices");var Uit=(iv=class extends us{constructor(){super(["railroad-ebnf-beta"])}},E(iv,"RailroadEbnfTokenBuilder"),iv),lpe=E(t=>{const e=t.slice(1,-1);let r="";for(let n=0;nnew Uit,"TokenBuilder"),ValueConverter:E(()=>new Hit,"ValueConverter")}};function upe(t=ba){const e=Xr(ia(t),cs),r=Xr(na({shared:e}),Dit,cpe);return e.ServiceRegistry.register(r),{shared:e,RailroadEbnf:r}}E(upe,"createRailroadEbnfServices");var Yit=(sv=class extends us{constructor(){super(["railroad-abnf-beta"])}},E(sv,"RailroadAbnfTokenBuilder"),sv),Xit=(ov=class extends rc{runConverter(e,r,n){const i=super.runConverter(e,r,n);if(e.name==="TITLE"&&typeof i=="string"){const a=i.trim();if(a.startsWith('"')&&a.endsWith('"')||a.startsWith("'")&&a.endsWith("'"))return a.slice(1,-1)}return i}runCustomConverter(e,r,n){if(e.name==="ABNF_STRING")return r.slice(1,-1)}},E(ov,"RailroadAbnfValueConverter"),ov),hpe={parser:{TokenBuilder:E(()=>new Yit,"TokenBuilder"),ValueConverter:E(()=>new Xit,"ValueConverter")}};function dpe(t=ba){const e=Xr(ia(t),cs),r=Xr(na({shared:e}),Iit,hpe);return e.ServiceRegistry.register(r),{shared:e,RailroadAbnf:r}}E(dpe,"createRailroadAbnfServices");var Kit=(lv=class extends us{constructor(){super(["railroad-peg-beta"])}},E(lv,"RailroadPegTokenBuilder"),lv),fpe=E(t=>{const e=t.slice(1,-1);let r="";for(let n=0;nnew Kit,"TokenBuilder"),ValueConverter:E(()=>new jit,"ValueConverter")}};function gpe(t=ba){const e=Xr(ia(t),cs),r=Xr(na({shared:e}),Nit,ppe);return e.ServiceRegistry.register(r),{shared:e,RailroadPeg:r}}E(gpe,"createRailroadPegServices");var Zit=(uv=class extends us{constructor(){super(["treemap"])}},E(uv,"TreemapTokenBuilder"),uv),Qit=/classDef\s+([A-Z_a-z]\w+)(?:\s+([^\n\r;]*))?;?/,Jit=(hv=class extends rc{runCustomConverter(e,r,n){if(e.name==="NUMBER2")return parseFloat(r.replace(/,/g,""));if(e.name==="SEPARATOR")return r.substring(1,r.length-1);if(e.name==="STRING2")return r.substring(1,r.length-1);if(e.name==="INDENTATION")return r.length;if(e.name==="ClassDef"){if(typeof r!="string")return r;const i=Qit.exec(r);if(i)return{$type:"ClassDefStatement",className:i[1],styleText:i[2]||void 0}}}},E(hv,"TreemapValueConverter"),hv);function mpe(t){const e=t.validation.TreemapValidator,r=t.validation.ValidationRegistry;if(r){const n={Treemap:e.checkSingleRoot.bind(e)};r.register(n,e)}}E(mpe,"registerValidationChecks");var eat=(dv=class{checkSingleRoot(e,r){let n;for(const i of e.TreemapRows)i.item&&(n===void 0&&i.indent===void 0?n=0:i.indent===void 0?r("error","Multiple root nodes are not allowed in a treemap.",{node:i,property:"item"}):n!==void 0&&n>=parseInt(i.indent,10)&&r("error","Multiple root nodes are not allowed in a treemap.",{node:i,property:"item"}))}},E(dv,"TreemapValidator"),dv),ype={parser:{TokenBuilder:E(()=>new Zit,"TokenBuilder"),ValueConverter:E(()=>new Jit,"ValueConverter")},validation:{TreemapValidator:E(()=>new eat,"TreemapValidator")}};function vpe(t=ba){const e=Xr(ia(t),cs),r=Xr(na({shared:e}),Oit,ype);return e.ServiceRegistry.register(r),mpe(r),{shared:e,Treemap:r}}E(vpe,"createTreemapServices");var tat=(fv=class extends rc{runCustomConverter(e,r,n){switch(e.name.toUpperCase()){case"LINK_LABEL":return r.substring(1).trim();default:return}}},E(fv,"WardleyValueConverter"),fv),bpe={parser:{ValueConverter:E(()=>new tat,"ValueConverter")}};function xpe(t=ba){const e=Xr(ia(t),cs),r=Xr(na({shared:e}),Pit,bpe);return e.ServiceRegistry.register(r),{shared:e,Wardley:r}}E(xpe,"createWardleyServices");var rat=(pv=class extends us{constructor(){super(["cynefin-beta"])}},E(pv,"CynefinTokenBuilder"),pv),Tpe={parser:{TokenBuilder:E(()=>new rat,"TokenBuilder"),ValueConverter:E(()=>new Kg,"ValueConverter")}};function wpe(t=ba){const e=Xr(ia(t),cs),r=Xr(na({shared:e}),kit,Tpe);return e.ServiceRegistry.register(r),{shared:e,Cynefin:r}}E(wpe,"createCynefinServices");var nat=(gv=class extends us{constructor(){super(["gitGraph"])}},E(gv,"GitGraphTokenBuilder"),gv),Cpe={parser:{TokenBuilder:E(()=>new nat,"TokenBuilder"),ValueConverter:E(()=>new Kg,"ValueConverter")}};function kpe(t=ba){const e=Xr(ia(t),cs),r=Xr(na({shared:e}),Sit,Cpe);return e.ServiceRegistry.register(r),{shared:e,GitGraph:r}}E(kpe,"createGitGraphServices");var iat=(mv=class extends us{constructor(){super(["info","showInfo"])}},E(mv,"InfoTokenBuilder"),mv),Epe={parser:{TokenBuilder:E(()=>new iat,"TokenBuilder"),ValueConverter:E(()=>new Kg,"ValueConverter")}};function Spe(t=ba){const e=Xr(ia(t),cs),r=Xr(na({shared:e}),Ait,Epe);return e.ServiceRegistry.register(r),{shared:e,Info:r}}E(Spe,"createInfoServices");var aat=(yv=class extends us{constructor(){super(["packet"])}},E(yv,"PacketTokenBuilder"),yv),Ape={parser:{TokenBuilder:E(()=>new aat,"TokenBuilder"),ValueConverter:E(()=>new Kg,"ValueConverter")}};function _pe(t=ba){const e=Xr(ia(t),cs),r=Xr(na({shared:e}),_it,Ape);return e.ServiceRegistry.register(r),{shared:e,Packet:r}}E(_pe,"createPacketServices");var sat=(vv=class extends us{constructor(){super(["pie","showData"])}},E(vv,"PieTokenBuilder"),vv),oat=(bv=class extends rc{runCustomConverter(e,r,n){if(e.name==="PIE_SECTION_LABEL")return r.replace(/"/g,"").trim()}},E(bv,"PieValueConverter"),bv),Rpe={parser:{TokenBuilder:E(()=>new sat,"TokenBuilder"),ValueConverter:E(()=>new oat,"ValueConverter")}};function Lpe(t=ba){const e=Xr(ia(t),cs),r=Xr(na({shared:e}),Rit,Rpe);return e.ServiceRegistry.register(r),{shared:e,Pie:r}}E(Lpe,"createPieServices");var lat=(xv=class extends rc{runCustomConverter(e,r,n){if(e.name==="INDENTATION")return(r==null?void 0:r.length)||0;if(e.name==="QUOTED_NAME")return r.substring(1,r.length-1);if(e.name==="BARE_NAME")return r.replace(/[\t ]+$/,"");if(e.name==="CLASS_ANNOTATION")return r.trim().substring(3).trim();if(e.name==="ICON_ANNOTATION"){const i=r.trim();return i.substring(5,i.length-1)}if(e.name==="DESC_ANNOTATION")return r.trim().substring(2).trim()}},E(xv,"TreeViewValueConverter"),xv),cat=(Tv=class extends us{constructor(){super(["treeView-beta"])}},E(Tv,"TreeViewTokenBuilder"),Tv),Ipe={parser:{TokenBuilder:E(()=>new cat,"TokenBuilder"),ValueConverter:E(()=>new lat,"ValueConverter")}};function Dpe(t=ba){const e=Xr(ia(t),cs),r=Xr(na({shared:e}),$it,Ipe);return e.ServiceRegistry.register(r),{shared:e,TreeView:r}}E(Dpe,"createTreeViewServices");var uat=(wv=class extends us{constructor(){super(["architecture"])}},E(wv,"ArchitectureTokenBuilder"),wv),hat=(Cv=class extends rc{runCustomConverter(e,r,n){if(e.name==="ARCH_ICON")return r.replace(/[()]/g,"").trim();if(e.name==="ARCH_TEXT_ICON")return r.replace(/["()]/g,"");if(e.name==="ARCH_TITLE"){let i=r.replace(/^\[|]$/g,"").trim();return(i.startsWith('"')&&i.endsWith('"')||i.startsWith("'")&&i.endsWith("'"))&&(i=i.slice(1,-1),i=i.replace(/\\"/g,'"').replace(/\\'/g,"'")),i.trim()}}},E(Cv,"ArchitectureValueConverter"),Cv),Mpe={parser:{TokenBuilder:E(()=>new uat,"TokenBuilder"),ValueConverter:E(()=>new hat,"ValueConverter")}};function Npe(t=ba){const e=Xr(ia(t),cs),r=Xr(na({shared:e}),Cit,Mpe);return e.ServiceRegistry.register(r),{shared:e,Architecture:r}}E(Npe,"createArchitectureServices");var dat=(kv=class extends us{constructor(){super(["eventmodeling"])}},E(kv,"EventModelingTokenBuilder"),kv),Ope=new Set(["cmd","command"]),$pe=new Set(["evt","event"]),BO=new Set(["rmo","readmodel"]),Ppe=new Set(["pcr","processor"]),Bpe=new Set(["ui"]);function Fpe(t){const e=t.validation.EventModelingValidator,r=t.validation.ValidationRegistry;if(r){const n={EmTimeFrame:e.checkSourceFrameTypes.bind(e),EmResetFrame:e.checkSourceFrameTypes.bind(e)};r.register(n,e)}}E(Fpe,"registerValidationChecks");var fat=(Ev=class{checkSourceFrameTypes(e,r){e.sourceFrames.length!==0&&(Ope.has(e.modelEntityType)?this.validateSources(e,new Set([...Bpe,...Ppe]),"command","ui or processor",r):$pe.has(e.modelEntityType)?this.validateSources(e,Ope,"event","command",r):BO.has(e.modelEntityType)?this.validateSources(e,$pe,"read model","event",r):Ppe.has(e.modelEntityType)?this.validateSources(e,BO,"processor","read model",r):Bpe.has(e.modelEntityType)&&this.validateSources(e,BO,"ui","read model",r))}validateSources(e,r,n,i,a){for(const s of e.sourceFrames){const o=s.ref;o!==void 0&&!r.has(o.modelEntityType)&&a("error",`A ${n} can only receive input from a ${i}, not from '${o.modelEntityType}'.`,{node:e,property:"sourceFrames"})}}},E(Ev,"EventModelingValidator"),Ev),zpe={parser:{TokenBuilder:E(()=>new dat,"TokenBuilder"),ValueConverter:E(()=>new Kg,"ValueConverter")},validation:{EventModelingValidator:E(()=>new fat,"EventModelingValidator")}};function Gpe(t=ba){const e=Xr(ia(t),cs),r=Xr(na({shared:e}),Eit,zpe);return e.ServiceRegistry.register(r),Fpe(r),{shared:e,EventModel:r}}E(Gpe,"createEventModelingServices");var Ta={},pat={info:E(async()=>{const{createInfoServices:t}=await Promise.resolve().then(()=>Amt),e=t().Info.parser.LangiumParser;Ta.info=e},"info"),packet:E(async()=>{const{createPacketServices:t}=await Promise.resolve().then(()=>_mt),e=t().Packet.parser.LangiumParser;Ta.packet=e},"packet"),pie:E(async()=>{const{createPieServices:t}=await Promise.resolve().then(()=>Rmt),e=t().Pie.parser.LangiumParser;Ta.pie=e},"pie"),treeView:E(async()=>{const{createTreeViewServices:t}=await Promise.resolve().then(()=>Lmt),e=t().TreeView.parser.LangiumParser;Ta.treeView=e},"treeView"),architecture:E(async()=>{const{createArchitectureServices:t}=await Promise.resolve().then(()=>Imt),e=t().Architecture.parser.LangiumParser;Ta.architecture=e},"architecture"),gitGraph:E(async()=>{const{createGitGraphServices:t}=await Promise.resolve().then(()=>Dmt),e=t().GitGraph.parser.LangiumParser;Ta.gitGraph=e},"gitGraph"),eventmodeling:E(async()=>{const{createEventModelingServices:t}=await Promise.resolve().then(()=>Mmt),e=t().EventModel.parser.LangiumParser;Ta.eventmodeling=e},"eventmodeling"),radar:E(async()=>{const{createRadarServices:t}=await Promise.resolve().then(()=>Nmt),e=t().Radar.parser.LangiumParser;Ta.radar=e},"radar"),railroad:E(async()=>{const{createRailroadServices:t}=await Promise.resolve().then(()=>Omt),e=t().Railroad.parser.LangiumParser;Ta.railroad=e},"railroad"),railroadEbnf:E(async()=>{const{createRailroadEbnfServices:t}=await Promise.resolve().then(()=>$mt),e=t().RailroadEbnf.parser.LangiumParser;Ta.railroadEbnf=e},"railroadEbnf"),railroadAbnf:E(async()=>{const{createRailroadAbnfServices:t}=await Promise.resolve().then(()=>Pmt),e=t().RailroadAbnf.parser.LangiumParser;Ta.railroadAbnf=e},"railroadAbnf"),railroadPeg:E(async()=>{const{createRailroadPegServices:t}=await Promise.resolve().then(()=>Bmt),e=t().RailroadPeg.parser.LangiumParser;Ta.railroadPeg=e},"railroadPeg"),treemap:E(async()=>{const{createTreemapServices:t}=await Promise.resolve().then(()=>Fmt),e=t().Treemap.parser.LangiumParser;Ta.treemap=e},"treemap"),wardley:E(async()=>{const{createWardleyServices:t}=await Promise.resolve().then(()=>zmt),e=t().Wardley.parser.LangiumParser;Ta.wardley=e},"wardley"),cynefin:E(async()=>{const{createCynefinServices:t}=await Promise.resolve().then(()=>Gmt),e=t().Cynefin.parser.LangiumParser;Ta.cynefin=e},"cynefin")};async function Qo(t,e){const r=pat[t];if(!r)throw new Error(`Unknown diagram type: ${t}`);Ta[t]||await r();const i=Ta[t].parse(e);if(i.lexerErrors.length>0||i.parserErrors.length>0)throw new gat(i);return i.value}E(Qo,"parse");var gat=(Sv=class extends Error{constructor(e){const r=e.lexerErrors.map(i=>{const a=i.line!==void 0&&!isNaN(i.line)?i.line:"?",s=i.column!==void 0&&!isNaN(i.column)?i.column:"?";return`Lexer error on line ${a}, column ${s}: ${i.message}`}).join(` + */var Apt=(N2=class extends zs{constructor(){super(["radar-beta"])}},E(N2,"RadarTokenBuilder"),N2),xbe={parser:{TokenBuilder:E(()=>new Apt,"TokenBuilder"),ValueConverter:E(()=>new A1,"ValueConverter")}};function Tbe(t=Wa){const e=nn(_a(t),Fs),r=nn(Sa({shared:e}),mpt,xbe);return e.ServiceRegistry.register(r),{shared:e,Radar:r}}E(Tbe,"createRadarServices");var Rpt=($2=class extends zs{constructor(){super(["railroad-beta"])}},E($2,"RailroadTokenBuilder"),$2),wbe=E(t=>{const e=t.slice(1,-1);let r="";for(let n=0;nnew Rpt,"TokenBuilder"),ValueConverter:E(()=>new Lpt,"ValueConverter")}};function kbe(t=Wa){const e=nn(_a(t),Fs),r=nn(Sa({shared:e}),bpt,Cbe);return e.ServiceRegistry.register(r),{shared:e,Railroad:r}}E(kbe,"createRailroadServices");var Ipt=(P2=class extends zs{constructor(){super(["railroad-ebnf-beta"])}},E(P2,"RailroadEbnfTokenBuilder"),P2),Ebe=E(t=>{const e=t.slice(1,-1);let r="";for(let n=0;nnew Ipt,"TokenBuilder"),ValueConverter:E(()=>new Dpt,"ValueConverter")}};function _be(t=Wa){const e=nn(_a(t),Fs),r=nn(Sa({shared:e}),vpt,Sbe);return e.ServiceRegistry.register(r),{shared:e,RailroadEbnf:r}}E(_be,"createRailroadEbnfServices");var Mpt=(F2=class extends zs{constructor(){super(["railroad-abnf-beta"])}},E(F2,"RailroadAbnfTokenBuilder"),F2),Npt=(z2=class extends Uc{runConverter(e,r,n){const i=super.runConverter(e,r,n);if(e.name==="TITLE"&&typeof i=="string"){const a=i.trim();if(a.startsWith('"')&&a.endsWith('"')||a.startsWith("'")&&a.endsWith("'"))return a.slice(1,-1)}return i}runCustomConverter(e,r,n){if(e.name==="ABNF_STRING")return r.slice(1,-1)}},E(z2,"RailroadAbnfValueConverter"),z2),Abe={parser:{TokenBuilder:E(()=>new Mpt,"TokenBuilder"),ValueConverter:E(()=>new Npt,"ValueConverter")}};function Rbe(t=Wa){const e=nn(_a(t),Fs),r=nn(Sa({shared:e}),ypt,Abe);return e.ServiceRegistry.register(r),{shared:e,RailroadAbnf:r}}E(Rbe,"createRailroadAbnfServices");var $pt=(G2=class extends zs{constructor(){super(["railroad-peg-beta"])}},E(G2,"RailroadPegTokenBuilder"),G2),Lbe=E(t=>{const e=t.slice(1,-1);let r="";for(let n=0;nnew $pt,"TokenBuilder"),ValueConverter:E(()=>new Opt,"ValueConverter")}};function Dbe(t=Wa){const e=nn(_a(t),Fs),r=nn(Sa({shared:e}),xpt,Ibe);return e.ServiceRegistry.register(r),{shared:e,RailroadPeg:r}}E(Dbe,"createRailroadPegServices");var Ppt=(V2=class extends zs{constructor(){super(["treemap"])}},E(V2,"TreemapTokenBuilder"),V2),Bpt=/classDef\s+([A-Z_a-z]\w+)(?:\s+([^\n\r;]*))?;?/,Fpt=(W2=class extends Uc{runCustomConverter(e,r,n){if(e.name==="NUMBER2")return parseFloat(r.replace(/,/g,""));if(e.name==="SEPARATOR")return r.substring(1,r.length-1);if(e.name==="STRING2")return r.substring(1,r.length-1);if(e.name==="INDENTATION")return r.length;if(e.name==="ClassDef"){if(typeof r!="string")return r;const i=Bpt.exec(r);if(i)return{$type:"ClassDefStatement",className:i[1],styleText:i[2]||void 0}}}},E(W2,"TreemapValueConverter"),W2);function Mbe(t){const e=t.validation.TreemapValidator,r=t.validation.ValidationRegistry;if(r){const n={Treemap:e.checkSingleRoot.bind(e)};r.register(n,e)}}E(Mbe,"registerValidationChecks");var zpt=(U2=class{checkSingleRoot(e,r){let n;for(const i of e.TreemapRows)i.item&&(n===void 0&&i.indent===void 0?n=0:i.indent===void 0?r("error","Multiple root nodes are not allowed in a treemap.",{node:i,property:"item"}):n!==void 0&&n>=parseInt(i.indent,10)&&r("error","Multiple root nodes are not allowed in a treemap.",{node:i,property:"item"}))}},E(U2,"TreemapValidator"),U2),Nbe={parser:{TokenBuilder:E(()=>new Ppt,"TokenBuilder"),ValueConverter:E(()=>new Fpt,"ValueConverter")},validation:{TreemapValidator:E(()=>new zpt,"TreemapValidator")}};function $be(t=Wa){const e=nn(_a(t),Fs),r=nn(Sa({shared:e}),Tpt,Nbe);return e.ServiceRegistry.register(r),Mbe(r),{shared:e,Treemap:r}}E($be,"createTreemapServices");var Gpt=(H2=class extends Uc{runCustomConverter(e,r,n){switch(e.name.toUpperCase()){case"LINK_LABEL":return r.substring(1).trim();default:return}}},E(H2,"WardleyValueConverter"),H2),Obe={parser:{ValueConverter:E(()=>new Gpt,"ValueConverter")}};function Pbe(t=Wa){const e=nn(_a(t),Fs),r=nn(Sa({shared:e}),Cpt,Obe);return e.ServiceRegistry.register(r),{shared:e,Wardley:r}}E(Pbe,"createWardleyServices");var qpt=(Y2=class extends zs{constructor(){super(["cynefin-beta"])}},E(Y2,"CynefinTokenBuilder"),Y2),Bbe={parser:{TokenBuilder:E(()=>new qpt,"TokenBuilder"),ValueConverter:E(()=>new A1,"ValueConverter")}};function Fbe(t=Wa){const e=nn(_a(t),Fs),r=nn(Sa({shared:e}),upt,Bbe);return e.ServiceRegistry.register(r),{shared:e,Cynefin:r}}E(Fbe,"createCynefinServices");var Vpt=(X2=class extends zs{constructor(){super(["gitGraph"])}},E(X2,"GitGraphTokenBuilder"),X2),zbe={parser:{TokenBuilder:E(()=>new Vpt,"TokenBuilder"),ValueConverter:E(()=>new A1,"ValueConverter")}};function Gbe(t=Wa){const e=nn(_a(t),Fs),r=nn(Sa({shared:e}),dpt,zbe);return e.ServiceRegistry.register(r),{shared:e,GitGraph:r}}E(Gbe,"createGitGraphServices");var Wpt=(j2=class extends zs{constructor(){super(["info","showInfo"])}},E(j2,"InfoTokenBuilder"),j2),qbe={parser:{TokenBuilder:E(()=>new Wpt,"TokenBuilder"),ValueConverter:E(()=>new A1,"ValueConverter")}};function Vbe(t=Wa){const e=nn(_a(t),Fs),r=nn(Sa({shared:e}),fpt,qbe);return e.ServiceRegistry.register(r),{shared:e,Info:r}}E(Vbe,"createInfoServices");var Upt=(K2=class extends zs{constructor(){super(["packet"])}},E(K2,"PacketTokenBuilder"),K2),Wbe={parser:{TokenBuilder:E(()=>new Upt,"TokenBuilder"),ValueConverter:E(()=>new A1,"ValueConverter")}};function Ube(t=Wa){const e=nn(_a(t),Fs),r=nn(Sa({shared:e}),ppt,Wbe);return e.ServiceRegistry.register(r),{shared:e,Packet:r}}E(Ube,"createPacketServices");var Hpt=(Z2=class extends zs{constructor(){super(["pie","showData"])}},E(Z2,"PieTokenBuilder"),Z2),Ypt=(Q2=class extends Uc{runCustomConverter(e,r,n){if(e.name==="PIE_SECTION_LABEL")return r.replace(/"/g,"").trim()}},E(Q2,"PieValueConverter"),Q2),Hbe={parser:{TokenBuilder:E(()=>new Hpt,"TokenBuilder"),ValueConverter:E(()=>new Ypt,"ValueConverter")}};function Ybe(t=Wa){const e=nn(_a(t),Fs),r=nn(Sa({shared:e}),gpt,Hbe);return e.ServiceRegistry.register(r),{shared:e,Pie:r}}E(Ybe,"createPieServices");var Xpt=(J2=class extends Uc{runCustomConverter(e,r,n){if(e.name==="INDENTATION")return(r==null?void 0:r.length)||0;if(e.name==="QUOTED_NAME")return r.substring(1,r.length-1);if(e.name==="BARE_NAME")return r.replace(/[\t ]+$/,"");if(e.name==="CLASS_ANNOTATION")return r.trim().substring(3).trim();if(e.name==="ICON_ANNOTATION"){const i=r.trim();return i.substring(5,i.length-1)}if(e.name==="DESC_ANNOTATION")return r.trim().substring(2).trim()}},E(J2,"TreeViewValueConverter"),J2),jpt=(eb=class extends zs{constructor(){super(["treeView-beta"])}},E(eb,"TreeViewTokenBuilder"),eb),Xbe={parser:{TokenBuilder:E(()=>new jpt,"TokenBuilder"),ValueConverter:E(()=>new Xpt,"ValueConverter")}};function jbe(t=Wa){const e=nn(_a(t),Fs),r=nn(Sa({shared:e}),wpt,Xbe);return e.ServiceRegistry.register(r),{shared:e,TreeView:r}}E(jbe,"createTreeViewServices");var Kpt=(tb=class extends zs{constructor(){super(["architecture"])}},E(tb,"ArchitectureTokenBuilder"),tb),Zpt=(rb=class extends Uc{runCustomConverter(e,r,n){if(e.name==="ARCH_ICON")return r.replace(/[()]/g,"").trim();if(e.name==="ARCH_TEXT_ICON")return r.replace(/["()]/g,"");if(e.name==="ARCH_TITLE"){let i=r.replace(/^\[|]$/g,"").trim();return(i.startsWith('"')&&i.endsWith('"')||i.startsWith("'")&&i.endsWith("'"))&&(i=i.slice(1,-1),i=i.replace(/\\"/g,'"').replace(/\\'/g,"'")),i.trim()}}},E(rb,"ArchitectureValueConverter"),rb),Kbe={parser:{TokenBuilder:E(()=>new Kpt,"TokenBuilder"),ValueConverter:E(()=>new Zpt,"ValueConverter")}};function Zbe(t=Wa){const e=nn(_a(t),Fs),r=nn(Sa({shared:e}),cpt,Kbe);return e.ServiceRegistry.register(r),{shared:e,Architecture:r}}E(Zbe,"createArchitectureServices");var Qpt=(nb=class extends zs{constructor(){super(["eventmodeling"])}},E(nb,"EventModelingTokenBuilder"),nb),Qbe=new Set(["cmd","command"]),Jbe=new Set(["evt","event"]),fz=new Set(["rmo","readmodel"]),exe=new Set(["pcr","processor"]),txe=new Set(["ui"]);function rxe(t){const e=t.validation.EventModelingValidator,r=t.validation.ValidationRegistry;if(r){const n={EmTimeFrame:e.checkSourceFrameTypes.bind(e),EmResetFrame:e.checkSourceFrameTypes.bind(e)};r.register(n,e)}}E(rxe,"registerValidationChecks");var Jpt=(ib=class{checkSourceFrameTypes(e,r){e.sourceFrames.length!==0&&(Qbe.has(e.modelEntityType)?this.validateSources(e,new Set([...txe,...exe]),"command","ui or processor",r):Jbe.has(e.modelEntityType)?this.validateSources(e,Qbe,"event","command",r):fz.has(e.modelEntityType)?this.validateSources(e,Jbe,"read model","event",r):exe.has(e.modelEntityType)?this.validateSources(e,fz,"processor","read model",r):txe.has(e.modelEntityType)&&this.validateSources(e,fz,"ui","read model",r))}validateSources(e,r,n,i,a){for(const s of e.sourceFrames){const o=s.ref;o!==void 0&&!r.has(o.modelEntityType)&&a("error",`A ${n} can only receive input from a ${i}, not from '${o.modelEntityType}'.`,{node:e,property:"sourceFrames"})}}},E(ib,"EventModelingValidator"),ib),nxe={parser:{TokenBuilder:E(()=>new Qpt,"TokenBuilder"),ValueConverter:E(()=>new A1,"ValueConverter")},validation:{EventModelingValidator:E(()=>new Jpt,"EventModelingValidator")}};function ixe(t=Wa){const e=nn(_a(t),Fs),r=nn(Sa({shared:e}),hpt,nxe);return e.ServiceRegistry.register(r),rxe(r),{shared:e,EventModel:r}}E(ixe,"createEventModelingServices");var Ha={},e0t={info:E(async()=>{const{createInfoServices:t}=await Promise.resolve().then(()=>f4t),e=t().Info.parser.LangiumParser;Ha.info=e},"info"),packet:E(async()=>{const{createPacketServices:t}=await Promise.resolve().then(()=>p4t),e=t().Packet.parser.LangiumParser;Ha.packet=e},"packet"),pie:E(async()=>{const{createPieServices:t}=await Promise.resolve().then(()=>g4t),e=t().Pie.parser.LangiumParser;Ha.pie=e},"pie"),treeView:E(async()=>{const{createTreeViewServices:t}=await Promise.resolve().then(()=>m4t),e=t().TreeView.parser.LangiumParser;Ha.treeView=e},"treeView"),architecture:E(async()=>{const{createArchitectureServices:t}=await Promise.resolve().then(()=>y4t),e=t().Architecture.parser.LangiumParser;Ha.architecture=e},"architecture"),gitGraph:E(async()=>{const{createGitGraphServices:t}=await Promise.resolve().then(()=>v4t),e=t().GitGraph.parser.LangiumParser;Ha.gitGraph=e},"gitGraph"),eventmodeling:E(async()=>{const{createEventModelingServices:t}=await Promise.resolve().then(()=>b4t),e=t().EventModel.parser.LangiumParser;Ha.eventmodeling=e},"eventmodeling"),radar:E(async()=>{const{createRadarServices:t}=await Promise.resolve().then(()=>x4t),e=t().Radar.parser.LangiumParser;Ha.radar=e},"radar"),railroad:E(async()=>{const{createRailroadServices:t}=await Promise.resolve().then(()=>T4t),e=t().Railroad.parser.LangiumParser;Ha.railroad=e},"railroad"),railroadEbnf:E(async()=>{const{createRailroadEbnfServices:t}=await Promise.resolve().then(()=>w4t),e=t().RailroadEbnf.parser.LangiumParser;Ha.railroadEbnf=e},"railroadEbnf"),railroadAbnf:E(async()=>{const{createRailroadAbnfServices:t}=await Promise.resolve().then(()=>C4t),e=t().RailroadAbnf.parser.LangiumParser;Ha.railroadAbnf=e},"railroadAbnf"),railroadPeg:E(async()=>{const{createRailroadPegServices:t}=await Promise.resolve().then(()=>k4t),e=t().RailroadPeg.parser.LangiumParser;Ha.railroadPeg=e},"railroadPeg"),treemap:E(async()=>{const{createTreemapServices:t}=await Promise.resolve().then(()=>E4t),e=t().Treemap.parser.LangiumParser;Ha.treemap=e},"treemap"),wardley:E(async()=>{const{createWardleyServices:t}=await Promise.resolve().then(()=>S4t),e=t().Wardley.parser.LangiumParser;Ha.wardley=e},"wardley"),cynefin:E(async()=>{const{createCynefinServices:t}=await Promise.resolve().then(()=>_4t),e=t().Cynefin.parser.LangiumParser;Ha.cynefin=e},"cynefin")};async function Bl(t,e){const r=e0t[t];if(!r)throw new Error(`Unknown diagram type: ${t}`);Ha[t]||await r();const i=Ha[t].parse(e);if(i.lexerErrors.length>0||i.parserErrors.length>0)throw new t0t(i);return i.value}E(Bl,"parse");var t0t=(ab=class extends Error{constructor(e){const r=e.lexerErrors.map(i=>{const a=i.line!==void 0&&!isNaN(i.line)?i.line:"?",s=i.column!==void 0&&!isNaN(i.column)?i.column:"?";return`Lexer error on line ${a}, column ${s}: ${i.message}`}).join(` `),n=e.parserErrors.map(i=>{const a=i.token.startLine!==void 0&&!isNaN(i.token.startLine)?i.token.startLine:"?",s=i.token.startColumn!==void 0&&!isNaN(i.token.startColumn)?i.token.startColumn:"?";return`Parse error on line ${a}, column ${s}: ${i.message}`}).join(` -`);super(`Parsing failed: ${r} ${n}`),this.result=e}},E(Sv,"MermaidParseError"),Sv),bn={NORMAL:0,REVERSE:1,HIGHLIGHT:2,MERGE:3,CHERRY_PICK:4},mat=Fr.gitGraph,Kf=x(()=>ti({...mat,...lr().gitGraph}),"getConfig"),qt=new wI(()=>{const t=Kf(),e=t.mainBranchName,r=t.mainBranchOrder;return{mainBranchName:e,commits:new Map,head:null,branchConfig:new Map([[e,{name:e,order:r}]]),branches:new Map([[e,null]]),currBranch:e,direction:"LR",seq:0,options:{}}});function aS(){return cV({length:7})}x(aS,"getID");function qpe(t,e){const r=Object.create(null);return t.reduce((n,i)=>{const a=e(i);return r[a]||(r[a]=!0,n.push(i)),n},[])}x(qpe,"uniqBy");var yat=x(function(t){qt.records.direction=t},"setDirection"),vat=x(function(t){ae.debug("options str",t),t=t==null?void 0:t.trim(),t=t||"{}";try{qt.records.options=JSON.parse(t)}catch(e){ae.error("error while parsing gitGraph options",e.message)}},"setOptions"),bat=x(function(){return qt.records.options},"getOptions"),xat=x(function(t){let e=t.msg,r=t.id;const n=t.type;let i=t.tags;ae.info("commit",e,r,n,i),ae.debug("Entering commit:",e,r,n,i);const a=Kf();r=Lt.sanitizeText(r,a),e=Lt.sanitizeText(e,a),i=i==null?void 0:i.map(o=>Lt.sanitizeText(o,a));const s={id:r||qt.records.seq+"-"+aS(),message:e,seq:qt.records.seq++,type:n??bn.NORMAL,tags:i??[],parents:qt.records.head==null?[]:[qt.records.head.id],branch:qt.records.currBranch};qt.records.head=s,ae.info("main branch",a.mainBranchName),qt.records.commits.has(s.id)&&ae.warn(`Commit ID ${s.id} already exists`),qt.records.commits.set(s.id,s),qt.records.branches.set(qt.records.currBranch,s.id),ae.debug("in pushCommit "+s.id)},"commit"),Tat=x(function(t){let e=t.name;const r=t.order;if(e=Lt.sanitizeText(e,Kf()),qt.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}")`);qt.records.branches.set(e,qt.records.head!=null?qt.records.head.id:null),qt.records.branchConfig.set(e,{name:e,order:r}),Vpe(e),ae.debug("in createBranch")},"branch"),wat=x(t=>{let e=t.branch,r=t.id;const n=t.type,i=t.tags,a=Kf();e=Lt.sanitizeText(e,a),r&&(r=Lt.sanitizeText(r,a));const s=qt.records.branches.get(qt.records.currBranch),o=qt.records.branches.get(e),l=s?qt.records.commits.get(s):void 0,u=o?qt.records.commits.get(o):void 0;if(l&&u&&l.branch===e)throw new Error(`Cannot merge branch '${e}' into itself.`);if(qt.records.currBranch===e){const f=new Error('Incorrect usage of "merge". Cannot merge a branch to itself');throw f.hash={text:`merge ${e}`,token:`merge ${e}`,expected:["branch abc"]},f}if(l===void 0||!l){const f=new Error(`Incorrect usage of "merge". Current branch (${qt.records.currBranch})has no commits`);throw f.hash={text:`merge ${e}`,token:`merge ${e}`,expected:["commit"]},f}if(!qt.records.branches.has(e)){const f=new Error('Incorrect usage of "merge". Branch to be merged ('+e+") does not exist");throw f.hash={text:`merge ${e}`,token:`merge ${e}`,expected:[`branch ${e}`]},f}if(u===void 0||!u){const f=new Error('Incorrect usage of "merge". Branch to be merged ('+e+") has no commits");throw f.hash={text:`merge ${e}`,token:`merge ${e}`,expected:['"commit"']},f}if(l===u){const f=new Error('Incorrect usage of "merge". Both branches have same head');throw f.hash={text:`merge ${e}`,token:`merge ${e}`,expected:["branch abc"]},f}if(r&&qt.records.commits.has(r)){const f=new Error('Incorrect usage of "merge". Commit with id:'+r+" already exists, use different custom id");throw f.hash={text:`merge ${e} ${r} ${n} ${i==null?void 0:i.join(" ")}`,token:`merge ${e} ${r} ${n} ${i==null?void 0:i.join(" ")}`,expected:[`merge ${e} ${r}_UNIQUE ${n} ${i==null?void 0:i.join(" ")}`]},f}const h=o||"",d={id:r||`${qt.records.seq}-${aS()}`,message:`merged branch ${e} into ${qt.records.currBranch}`,seq:qt.records.seq++,parents:qt.records.head==null?[]:[qt.records.head.id,h],branch:qt.records.currBranch,type:bn.MERGE,customType:n,customId:!!r,tags:i??[]};qt.records.head=d,qt.records.commits.set(d.id,d),qt.records.branches.set(qt.records.currBranch,d.id),ae.debug(qt.records.branches),ae.debug("in mergeBranch")},"merge"),Cat=x(function(t){let e=t.id,r=t.targetId,n=t.tags,i=t.parent;ae.debug("Entering cherryPick:",e,r,n);const a=Kf();if(e=Lt.sanitizeText(e,a),r=Lt.sanitizeText(r,a),n=n==null?void 0:n.map(l=>Lt.sanitizeText(l,a)),i=Lt.sanitizeText(i,a),!e||!qt.records.commits.has(e)){const l=new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');throw l.hash={text:`cherryPick ${e} ${r}`,token:`cherryPick ${e} ${r}`,expected:["cherry-pick abc"]},l}const s=qt.records.commits.get(e);if(s===void 0||!s)throw new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');if(i&&!(Array.isArray(s.parents)&&s.parents.includes(i)))throw new Error("Invalid operation: The specified parent commit is not an immediate parent of the cherry-picked commit.");const o=s.branch;if(s.type===bn.MERGE&&!i)throw new Error("Incorrect usage of cherry-pick: If the source commit is a merge commit, an immediate parent commit must be specified.");if(!r||!qt.records.commits.has(r)){if(o===qt.records.currBranch){const d=new Error('Incorrect usage of "cherryPick". Source commit is already on current branch');throw d.hash={text:`cherryPick ${e} ${r}`,token:`cherryPick ${e} ${r}`,expected:["cherry-pick abc"]},d}const l=qt.records.branches.get(qt.records.currBranch);if(l===void 0||!l){const d=new Error(`Incorrect usage of "cherry-pick". Current branch (${qt.records.currBranch})has no commits`);throw d.hash={text:`cherryPick ${e} ${r}`,token:`cherryPick ${e} ${r}`,expected:["cherry-pick abc"]},d}const u=qt.records.commits.get(l);if(u===void 0||!u){const d=new Error(`Incorrect usage of "cherry-pick". Current branch (${qt.records.currBranch})has no commits`);throw d.hash={text:`cherryPick ${e} ${r}`,token:`cherryPick ${e} ${r}`,expected:["cherry-pick abc"]},d}const h={id:qt.records.seq+"-"+aS(),message:`cherry-picked ${s==null?void 0:s.message} into ${qt.records.currBranch}`,seq:qt.records.seq++,parents:qt.records.head==null?[]:[qt.records.head.id,s.id],branch:qt.records.currBranch,type:bn.CHERRY_PICK,tags:n?n.filter(Boolean):[`cherry-pick:${s.id}${s.type===bn.MERGE?`|parent:${i}`:""}`]};qt.records.head=h,qt.records.commits.set(h.id,h),qt.records.branches.set(qt.records.currBranch,h.id),ae.debug(qt.records.branches),ae.debug("in cherryPick")}},"cherryPick"),Vpe=x(function(t){if(t=Lt.sanitizeText(t,Kf()),qt.records.branches.has(t)){qt.records.currBranch=t;const e=qt.records.branches.get(qt.records.currBranch);e===void 0||!e?qt.records.head=null:qt.records.head=qt.records.commits.get(e)??null}else{const e=new Error(`Trying to checkout branch which is not yet created. (Help try using "branch ${t}")`);throw e.hash={text:`checkout ${t}`,token:`checkout ${t}`,expected:[`branch ${t}`]},e}},"checkout");function FO(t,e,r){const n=t.indexOf(e);n===-1?t.push(r):t.splice(n,1,r)}x(FO,"upsert");function zO(t){const e=t.reduce((i,a)=>i.seq>a.seq?i:a,t[0]);let r="";t.forEach(function(i){i===e?r+=" *":r+=" |"});const n=[r,e.id,e.seq];for(const i in qt.records.branches)qt.records.branches.get(i)===e.id&&n.push(i);if(ae.debug(n.join(" ")),e.parents&&e.parents.length==2&&e.parents[0]&&e.parents[1]){const i=qt.records.commits.get(e.parents[0]);FO(t,e,i),e.parents[1]&&t.push(qt.records.commits.get(e.parents[1]))}else{if(e.parents.length==0)return;if(e.parents[0]){const i=qt.records.commits.get(e.parents[0]);FO(t,e,i)}}t=qpe(t,i=>i.id),zO(t)}x(zO,"prettyPrintCommitHistory");var kat=x(function(){ae.debug(qt.records.commits);const t=Wpe()[0];zO([t])},"prettyPrint"),Eat=x(function(){qt.reset(),In()},"clear"),Sat=x(function(){return[...qt.records.branchConfig.values()].map((e,r)=>e.order!==null&&e.order!==void 0?e:{...e,order:parseFloat(`0.${r}`)}).sort((e,r)=>(e.order??0)-(r.order??0)).map(({name:e})=>({name:e}))},"getBranchesAsObjArray"),Aat=x(function(){return qt.records.branches},"getBranches"),_at=x(function(){return qt.records.commits},"getCommits"),Wpe=x(function(){const t=[...qt.records.commits.values()];return t.forEach(function(e){ae.debug(e.id)}),t.sort((e,r)=>e.seq-r.seq),t},"getCommitsArray"),Rat=x(function(){return qt.records.currBranch},"getCurrentBranch"),Lat=x(function(){return qt.records.direction},"getDirection"),Iat=x(function(){return qt.records.head},"getHead"),Upe={commitType:bn,getConfig:Kf,setDirection:yat,setOptions:vat,getOptions:bat,commit:xat,branch:Tat,merge:wat,cherryPick:Cat,checkout:Vpe,prettyPrint:kat,clear:Eat,getBranchesAsObjArray:Sat,getBranches:Aat,getCommits:_at,getCommitsArray:Wpe,getCurrentBranch:Rat,getDirection:Lat,getHead:Iat,setAccTitle:Dn,getAccTitle:Fn,getAccDescription:Gn,setAccDescription:zn,setDiagramTitle:qn,getDiagramTitle:Mn},Dat=x((t,e)=>{zl(t,e),t.dir&&e.setDirection(t.dir);for(const r of t.statements)Mat(r,e)},"populate"),Mat=x((t,e)=>{const n={Commit:x(i=>e.commit(Nat(i)),"Commit"),Branch:x(i=>e.branch(Oat(i)),"Branch"),Merge:x(i=>e.merge($at(i)),"Merge"),Checkout:x(i=>e.checkout(Pat(i)),"Checkout"),CherryPicking:x(i=>e.cherryPick(Bat(i)),"CherryPicking")}[t.$type];n?n(t):ae.error(`Unknown statement type: ${t.$type}`)},"parseStatement"),Nat=x(t=>({id:t.id,msg:t.message??"",type:t.type!==void 0?bn[t.type]:bn.NORMAL,tags:t.tags??void 0}),"parseCommit"),Oat=x(t=>({name:t.name,order:t.order??0}),"parseBranch"),$at=x(t=>({branch:t.branch,id:t.id??"",type:t.type!==void 0?bn[t.type]:void 0,tags:t.tags??void 0}),"parseMerge"),Pat=x(t=>t.branch,"parseCheckout"),Bat=x(t=>{var r;return{id:t.id,targetId:"",tags:((r=t.tags)==null?void 0:r.length)===0?void 0:t.tags,parent:t.parent}},"parseCherryPicking"),Fat={parse:x(async t=>{const e=await Qo("gitGraph",t);ae.debug(e),Dat(e,Upe)},"parse")},Rh=10,Lh=40,nc=4,uu=2,jf=8,sS=new Set(["redux","redux-dark","redux-color","redux-dark-color"]),GO=12,qO=new Set(["redux-color","redux-dark-color"]),zat=new Set(["dark","redux-dark","redux-dark-color","neo-dark"]),Zf=x((t,e,r=!1)=>r&&t>0?(t-1)%(e-1)+1:t%e,"calcColorIndex"),Ls=new Map,Is=new Map,oS=30,zT=new Map,lS=[],hu=0,Gr="LR",Gat=x(()=>{Ls.clear(),Is.clear(),zT.clear(),hu=0,lS=[],Gr="LR"},"clear"),Hpe=x(t=>{const e=document.createElementNS("http://www.w3.org/2000/svg","text");return(typeof t=="string"?t.split(/\\n|\n|/gi):t).forEach(n=>{const i=document.createElementNS("http://www.w3.org/2000/svg","tspan");i.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),i.setAttribute("dy","1em"),i.setAttribute("x","0"),i.setAttribute("class","row"),i.textContent=n.trim(),e.appendChild(i)}),e},"drawText"),Ype=x(t=>{let e,r,n;return Gr==="BT"?(r=x((i,a)=>i<=a,"comparisonFunc"),n=1/0):(r=x((i,a)=>i>=a,"comparisonFunc"),n=0),t.forEach(i=>{var s,o;const a=Gr==="TB"||Gr=="BT"?(s=Is.get(i))==null?void 0:s.y:(o=Is.get(i))==null?void 0:o.x;a!==void 0&&r(a,n)&&(e=i,n=a)}),e},"findClosestParent"),qat=x(t=>{let e="",r=1/0;return t.forEach(n=>{const i=Is.get(n).y;i<=r&&(e=n,r=i)}),e||void 0},"findClosestParentBT"),Vat=x((t,e,r)=>{let n=r,i=r;const a=[];t.forEach(s=>{const o=e.get(s);if(!o)throw new Error(`Commit not found for key ${s}`);o.parents.length?(n=Uat(o),i=Math.max(n,i)):a.push(o),Hat(o,n)}),n=i,a.forEach(s=>{Yat(s,n,r)}),t.forEach(s=>{const o=e.get(s);if(o!=null&&o.parents.length){const l=qat(o.parents);n=Is.get(l).y-Lh,n<=i&&(i=n);const u=Ls.get(o.branch).pos,h=n-Rh;Is.set(o.id,{x:u,y:h})}})},"setParallelBTPos"),Wat=x(t=>{var n;const e=Ype(t.parents.filter(i=>i!==null));if(!e)throw new Error(`Closest parent not found for commit ${t.id}`);const r=(n=Is.get(e))==null?void 0:n.y;if(r===void 0)throw new Error(`Closest parent position not found for commit ${t.id}`);return r},"findClosestParentPos"),Uat=x(t=>Wat(t)+Lh,"calculateCommitPosition"),Hat=x((t,e)=>{const r=Ls.get(t.branch);if(!r)throw new Error(`Branch not found for commit ${t.id}`);const n=r.pos,i=e+Rh;return Is.set(t.id,{x:n,y:i}),{x:n,y:i}},"setCommitPosition"),Yat=x((t,e,r)=>{const n=Ls.get(t.branch);if(!n)throw new Error(`Branch not found for commit ${t.id}`);const i=e+r,a=n.pos;Is.set(t.id,{x:a,y:i})},"setRootPosition"),Xat=x((t,e,r,n,i,a)=>{const{theme:s}=Pe(),o=sS.has(s??""),l=qO.has(s??""),u=zat.has(s??"");if(a===bn.HIGHLIGHT)t.append("rect").attr("x",r.x-10+(o?3:0)).attr("y",r.y-10+(o?3:0)).attr("width",o?14:20).attr("height",o?14:20).attr("class",`commit ${e.id} commit-highlight${Zf(i,jf,l)} ${n}-outer`),t.append("rect").attr("x",r.x-6+(o?2:0)).attr("y",r.y-6+(o?2:0)).attr("width",o?8:12).attr("height",o?8:12).attr("class",`commit ${e.id} commit${Zf(i,jf,l)} ${n}-inner`);else if(a===bn.CHERRY_PICK)t.append("circle").attr("cx",r.x).attr("cy",r.y).attr("r",o?7:10).attr("class",`commit ${e.id} ${n}`),t.append("circle").attr("cx",r.x-3).attr("cy",r.y+2).attr("r",o?2.5:2.75).attr("fill",u?"#000000":"#fff").attr("class",`commit ${e.id} ${n}`),t.append("circle").attr("cx",r.x+3).attr("cy",r.y+2).attr("r",o?2.5:2.75).attr("fill",u?"#000000":"#fff").attr("class",`commit ${e.id} ${n}`),t.append("line").attr("x1",r.x+3).attr("y1",r.y+1).attr("x2",r.x).attr("y2",r.y-5).attr("stroke",u?"#000000":"#fff").attr("class",`commit ${e.id} ${n}`),t.append("line").attr("x1",r.x-3).attr("y1",r.y+1).attr("x2",r.x).attr("y2",r.y-5).attr("stroke",u?"#000000":"#fff").attr("class",`commit ${e.id} ${n}`);else{const h=t.append("circle");if(h.attr("cx",r.x),h.attr("cy",r.y),h.attr("r",o?7:10),h.attr("class",`commit ${e.id} commit${Zf(i,jf,l)}`),a===bn.MERGE){const d=t.append("circle");d.attr("cx",r.x),d.attr("cy",r.y),d.attr("r",o?5:6),d.attr("class",`commit ${n} ${e.id} commit${Zf(i,jf,l)}`)}if(a===bn.REVERSE){const d=t.append("path"),f=o?4:5;d.attr("d",`M ${r.x-f},${r.y-f}L${r.x+f},${r.y+f}M${r.x-f},${r.y+f}L${r.x+f},${r.y-f}`).attr("class",`commit ${n} ${e.id} commit${Zf(i,jf,l)}`)}}},"drawCommitBullet"),Kat=x((t,e,r,n,i)=>{var a;if(e.type!==bn.CHERRY_PICK&&(e.customId&&e.type===bn.MERGE||e.type!==bn.MERGE)&&i.showCommitLabel){const s=t.append("g"),o=s.insert("rect").attr("class","commit-label-bkg"),l=s.append("text").attr("x",n).attr("y",r.y+25).attr("class","commit-label").text(e.id),u=(a=l.node())==null?void 0:a.getBBox();if(u&&(o.attr("x",r.posWithOffset-u.width/2-uu).attr("y",r.y+13.5).attr("width",u.width+2*uu).attr("height",u.height+2*uu),Gr==="TB"||Gr==="BT"?(o.attr("x",r.x-(u.width+4*nc+5)).attr("y",r.y-12),l.attr("x",r.x-(u.width+4*nc)).attr("y",r.y+u.height-12)):l.attr("x",r.posWithOffset-u.width/2),i.rotateCommitLabel))if(Gr==="TB"||Gr==="BT")l.attr("transform","rotate(-45, "+r.x+", "+r.y+")"),o.attr("transform","rotate(-45, "+r.x+", "+r.y+")");else{const h=-7.5-(u.width+10)/25*9.5,d=10+u.width/25*8.5;s.attr("transform","translate("+h+", "+d+") rotate(-45, "+n+", "+r.y+")")}}},"drawCommitLabel"),jat=x((t,e,r,n)=>{var i;if(e.tags.length>0){let a=0,s=0,o=0;const l=[];for(const u of e.tags.reverse()){const h=t.insert("polygon"),d=t.append("circle"),f=t.append("text").attr("y",r.y-16-a).attr("class","tag-label").text(u),p=(i=f.node())==null?void 0:i.getBBox();if(!p)throw new Error("Tag bbox not found");s=Math.max(s,p.width),o=Math.max(o,p.height),f.attr("x",r.posWithOffset-p.width/2),l.push({tag:f,hole:d,rect:h,yOffset:a}),a+=20}for(const{tag:u,hole:h,rect:d,yOffset:f}of l){const p=o/2,g=r.y-19.2-f;if(d.attr("class","tag-label-bkg").attr("points",` - ${n-s/2-nc/2},${g+uu} - ${n-s/2-nc/2},${g-uu} - ${r.posWithOffset-s/2-nc},${g-p-uu} - ${r.posWithOffset+s/2+nc},${g-p-uu} - ${r.posWithOffset+s/2+nc},${g+p+uu} - ${r.posWithOffset-s/2-nc},${g+p+uu}`),h.attr("cy",g).attr("cx",n-s/2+nc/2).attr("r",1.5).attr("class","tag-hole"),Gr==="TB"||Gr==="BT"){const m=n+f;d.attr("class","tag-label-bkg").attr("points",` +`);super(`Parsing failed: ${r} ${n}`),this.result=e}},E(ab,"MermaidParseError"),ab),Dn={NORMAL:0,REVERSE:1,HIGHLIGHT:2,MERGE:3,CHERRY_PICK:4},r0t=Xr.gitGraph,h0=T(()=>wi({...r0t,...pr().gitGraph}),"getConfig"),Yt=new ZN(()=>{const t=h0(),e=t.mainBranchName,r=t.mainBranchOrder;return{mainBranchName:e,commits:new Map,head:null,branchConfig:new Map([[e,{name:e,order:r}]]),branches:new Map([[e,null]]),currBranch:e,direction:"LR",seq:0,options:{}}});function iA(){return BY({length:7})}T(iA,"getID");function axe(t,e){const r=Object.create(null);return t.reduce((n,i)=>{const a=e(i);return r[a]||(r[a]=!0,n.push(i)),n},[])}T(axe,"uniqBy");var n0t=T(function(t){Yt.records.direction=t},"setDirection"),i0t=T(function(t){se.debug("options str",t),t=t==null?void 0:t.trim(),t=t||"{}";try{Yt.records.options=JSON.parse(t)}catch(e){se.error("error while parsing gitGraph options",e.message)}},"setOptions"),a0t=T(function(){return Yt.records.options},"getOptions"),s0t=T(function(t){let e=t.msg,r=t.id;const n=t.type;let i=t.tags;se.info("commit",e,r,n,i),se.debug("Entering commit:",e,r,n,i);const a=h0();r=Dt.sanitizeText(r,a),e=Dt.sanitizeText(e,a),i=i==null?void 0:i.map(o=>Dt.sanitizeText(o,a));const s={id:r||Yt.records.seq+"-"+iA(),message:e,seq:Yt.records.seq++,type:n??Dn.NORMAL,tags:i??[],parents:Yt.records.head==null?[]:[Yt.records.head.id],branch:Yt.records.currBranch};Yt.records.head=s,se.info("main branch",a.mainBranchName),Yt.records.commits.has(s.id)&&se.warn(`Commit ID ${s.id} already exists`),Yt.records.commits.set(s.id,s),Yt.records.branches.set(Yt.records.currBranch,s.id),se.debug("in pushCommit "+s.id)},"commit"),o0t=T(function(t){let e=t.name;const r=t.order;if(e=Dt.sanitizeText(e,h0()),Yt.records.branches.has(e))throw new Error(`Trying to create an existing branch. (Help: Either use a new name if you want create a new branch or try using "checkout ${e}")`);Yt.records.branches.set(e,Yt.records.head!=null?Yt.records.head.id:null),Yt.records.branchConfig.set(e,{name:e,order:r}),sxe(e),se.debug("in createBranch")},"branch"),l0t=T(t=>{let e=t.branch,r=t.id;const n=t.type,i=t.tags,a=h0();e=Dt.sanitizeText(e,a),r&&(r=Dt.sanitizeText(r,a));const s=Yt.records.branches.get(Yt.records.currBranch),o=Yt.records.branches.get(e),l=s?Yt.records.commits.get(s):void 0,u=o?Yt.records.commits.get(o):void 0;if(l&&u&&l.branch===e)throw new Error(`Cannot merge branch '${e}' into itself.`);if(Yt.records.currBranch===e){const f=new Error('Incorrect usage of "merge". Cannot merge a branch to itself');throw f.hash={text:`merge ${e}`,token:`merge ${e}`,expected:["branch abc"]},f}if(l===void 0||!l){const f=new Error(`Incorrect usage of "merge". Current branch (${Yt.records.currBranch})has no commits`);throw f.hash={text:`merge ${e}`,token:`merge ${e}`,expected:["commit"]},f}if(!Yt.records.branches.has(e)){const f=new Error('Incorrect usage of "merge". Branch to be merged ('+e+") does not exist");throw f.hash={text:`merge ${e}`,token:`merge ${e}`,expected:[`branch ${e}`]},f}if(u===void 0||!u){const f=new Error('Incorrect usage of "merge". Branch to be merged ('+e+") has no commits");throw f.hash={text:`merge ${e}`,token:`merge ${e}`,expected:['"commit"']},f}if(l===u){const f=new Error('Incorrect usage of "merge". Both branches have same head');throw f.hash={text:`merge ${e}`,token:`merge ${e}`,expected:["branch abc"]},f}if(r&&Yt.records.commits.has(r)){const f=new Error('Incorrect usage of "merge". Commit with id:'+r+" already exists, use different custom id");throw f.hash={text:`merge ${e} ${r} ${n} ${i==null?void 0:i.join(" ")}`,token:`merge ${e} ${r} ${n} ${i==null?void 0:i.join(" ")}`,expected:[`merge ${e} ${r}_UNIQUE ${n} ${i==null?void 0:i.join(" ")}`]},f}const h=o||"",d={id:r||`${Yt.records.seq}-${iA()}`,message:`merged branch ${e} into ${Yt.records.currBranch}`,seq:Yt.records.seq++,parents:Yt.records.head==null?[]:[Yt.records.head.id,h],branch:Yt.records.currBranch,type:Dn.MERGE,customType:n,customId:!!r,tags:i??[]};Yt.records.head=d,Yt.records.commits.set(d.id,d),Yt.records.branches.set(Yt.records.currBranch,d.id),se.debug(Yt.records.branches),se.debug("in mergeBranch")},"merge"),c0t=T(function(t){let e=t.id,r=t.targetId,n=t.tags,i=t.parent;se.debug("Entering cherryPick:",e,r,n);const a=h0();if(e=Dt.sanitizeText(e,a),r=Dt.sanitizeText(r,a),n=n==null?void 0:n.map(l=>Dt.sanitizeText(l,a)),i=Dt.sanitizeText(i,a),!e||!Yt.records.commits.has(e)){const l=new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');throw l.hash={text:`cherryPick ${e} ${r}`,token:`cherryPick ${e} ${r}`,expected:["cherry-pick abc"]},l}const s=Yt.records.commits.get(e);if(s===void 0||!s)throw new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');if(i&&!(Array.isArray(s.parents)&&s.parents.includes(i)))throw new Error("Invalid operation: The specified parent commit is not an immediate parent of the cherry-picked commit.");const o=s.branch;if(s.type===Dn.MERGE&&!i)throw new Error("Incorrect usage of cherry-pick: If the source commit is a merge commit, an immediate parent commit must be specified.");if(!r||!Yt.records.commits.has(r)){if(o===Yt.records.currBranch){const d=new Error('Incorrect usage of "cherryPick". Source commit is already on current branch');throw d.hash={text:`cherryPick ${e} ${r}`,token:`cherryPick ${e} ${r}`,expected:["cherry-pick abc"]},d}const l=Yt.records.branches.get(Yt.records.currBranch);if(l===void 0||!l){const d=new Error(`Incorrect usage of "cherry-pick". Current branch (${Yt.records.currBranch})has no commits`);throw d.hash={text:`cherryPick ${e} ${r}`,token:`cherryPick ${e} ${r}`,expected:["cherry-pick abc"]},d}const u=Yt.records.commits.get(l);if(u===void 0||!u){const d=new Error(`Incorrect usage of "cherry-pick". Current branch (${Yt.records.currBranch})has no commits`);throw d.hash={text:`cherryPick ${e} ${r}`,token:`cherryPick ${e} ${r}`,expected:["cherry-pick abc"]},d}const h={id:Yt.records.seq+"-"+iA(),message:`cherry-picked ${s==null?void 0:s.message} into ${Yt.records.currBranch}`,seq:Yt.records.seq++,parents:Yt.records.head==null?[]:[Yt.records.head.id,s.id],branch:Yt.records.currBranch,type:Dn.CHERRY_PICK,tags:n?n.filter(Boolean):[`cherry-pick:${s.id}${s.type===Dn.MERGE?`|parent:${i}`:""}`]};Yt.records.head=h,Yt.records.commits.set(h.id,h),Yt.records.branches.set(Yt.records.currBranch,h.id),se.debug(Yt.records.branches),se.debug("in cherryPick")}},"cherryPick"),sxe=T(function(t){if(t=Dt.sanitizeText(t,h0()),Yt.records.branches.has(t)){Yt.records.currBranch=t;const e=Yt.records.branches.get(Yt.records.currBranch);e===void 0||!e?Yt.records.head=null:Yt.records.head=Yt.records.commits.get(e)??null}else{const e=new Error(`Trying to checkout branch which is not yet created. (Help try using "branch ${t}")`);throw e.hash={text:`checkout ${t}`,token:`checkout ${t}`,expected:[`branch ${t}`]},e}},"checkout");function pz(t,e,r){const n=t.indexOf(e);n===-1?t.push(r):t.splice(n,1,r)}T(pz,"upsert");function gz(t){const e=t.reduce((i,a)=>i.seq>a.seq?i:a,t[0]);let r="";t.forEach(function(i){i===e?r+=" *":r+=" |"});const n=[r,e.id,e.seq];for(const i in Yt.records.branches)Yt.records.branches.get(i)===e.id&&n.push(i);if(se.debug(n.join(" ")),e.parents&&e.parents.length==2&&e.parents[0]&&e.parents[1]){const i=Yt.records.commits.get(e.parents[0]);pz(t,e,i),e.parents[1]&&t.push(Yt.records.commits.get(e.parents[1]))}else{if(e.parents.length==0)return;if(e.parents[0]){const i=Yt.records.commits.get(e.parents[0]);pz(t,e,i)}}t=axe(t,i=>i.id),gz(t)}T(gz,"prettyPrintCommitHistory");var u0t=T(function(){se.debug(Yt.records.commits);const t=oxe()[0];gz([t])},"prettyPrint"),h0t=T(function(){Yt.reset(),Hn()},"clear"),d0t=T(function(){return[...Yt.records.branchConfig.values()].map((e,r)=>e.order!==null&&e.order!==void 0?e:{...e,order:parseFloat(`0.${r}`)}).sort((e,r)=>(e.order??0)-(r.order??0)).map(({name:e})=>({name:e}))},"getBranchesAsObjArray"),f0t=T(function(){return Yt.records.branches},"getBranches"),p0t=T(function(){return Yt.records.commits},"getCommits"),oxe=T(function(){const t=[...Yt.records.commits.values()];return t.forEach(function(e){se.debug(e.id)}),t.sort((e,r)=>e.seq-r.seq),t},"getCommitsArray"),g0t=T(function(){return Yt.records.currBranch},"getCurrentBranch"),m0t=T(function(){return Yt.records.direction},"getDirection"),y0t=T(function(){return Yt.records.head},"getHead"),lxe={commitType:Dn,getConfig:h0,setDirection:n0t,setOptions:i0t,getOptions:a0t,commit:s0t,branch:o0t,merge:l0t,cherryPick:c0t,checkout:sxe,prettyPrint:u0t,clear:h0t,getBranchesAsObjArray:d0t,getBranches:f0t,getCommits:p0t,getCommitsArray:oxe,getCurrentBranch:g0t,getDirection:m0t,getHead:y0t,setAccTitle:Yn,getAccTitle:ii,getAccDescription:si,setAccDescription:ai,setDiagramTitle:oi,getDiagramTitle:Xn},v0t=T((t,e)=>{Rc(t,e),t.dir&&e.setDirection(t.dir);for(const r of t.statements)b0t(r,e)},"populate"),b0t=T((t,e)=>{const n={Commit:T(i=>e.commit(x0t(i)),"Commit"),Branch:T(i=>e.branch(T0t(i)),"Branch"),Merge:T(i=>e.merge(w0t(i)),"Merge"),Checkout:T(i=>e.checkout(C0t(i)),"Checkout"),CherryPicking:T(i=>e.cherryPick(k0t(i)),"CherryPicking")}[t.$type];n?n(t):se.error(`Unknown statement type: ${t.$type}`)},"parseStatement"),x0t=T(t=>({id:t.id,msg:t.message??"",type:t.type!==void 0?Dn[t.type]:Dn.NORMAL,tags:t.tags??void 0}),"parseCommit"),T0t=T(t=>({name:t.name,order:t.order??0}),"parseBranch"),w0t=T(t=>({branch:t.branch,id:t.id??"",type:t.type!==void 0?Dn[t.type]:void 0,tags:t.tags??void 0}),"parseMerge"),C0t=T(t=>t.branch,"parseCheckout"),k0t=T(t=>{var r;return{id:t.id,targetId:"",tags:((r=t.tags)==null?void 0:r.length)===0?void 0:t.tags,parent:t.parent}},"parseCherryPicking"),E0t={parse:T(async t=>{const e=await Bl("gitGraph",t);se.debug(e),v0t(e,lxe)},"parse")},Id=10,Dd=40,Hc=4,ch=2,d0=8,aA=new Set(["redux","redux-dark","redux-color","redux-dark-color"]),mz=12,yz=new Set(["redux-color","redux-dark-color"]),S0t=new Set(["dark","redux-dark","redux-dark-color","neo-dark"]),f0=T((t,e,r=!1)=>r&&t>0?(t-1)%(e-1)+1:t%e,"calcColorIndex"),lo=new Map,co=new Map,sA=30,YC=new Map,oA=[],uh=0,Kr="LR",_0t=T(()=>{lo.clear(),co.clear(),YC.clear(),uh=0,oA=[],Kr="LR"},"clear"),cxe=T(t=>{const e=document.createElementNS("http://www.w3.org/2000/svg","text");return(typeof t=="string"?t.split(/\\n|\n|/gi):t).forEach(n=>{const i=document.createElementNS("http://www.w3.org/2000/svg","tspan");i.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),i.setAttribute("dy","1em"),i.setAttribute("x","0"),i.setAttribute("class","row"),i.textContent=n.trim(),e.appendChild(i)}),e},"drawText"),uxe=T(t=>{let e,r,n;return Kr==="BT"?(r=T((i,a)=>i<=a,"comparisonFunc"),n=1/0):(r=T((i,a)=>i>=a,"comparisonFunc"),n=0),t.forEach(i=>{var s,o;const a=Kr==="TB"||Kr=="BT"?(s=co.get(i))==null?void 0:s.y:(o=co.get(i))==null?void 0:o.x;a!==void 0&&r(a,n)&&(e=i,n=a)}),e},"findClosestParent"),A0t=T(t=>{let e="",r=1/0;return t.forEach(n=>{const i=co.get(n).y;i<=r&&(e=n,r=i)}),e||void 0},"findClosestParentBT"),R0t=T((t,e,r)=>{let n=r,i=r;const a=[];t.forEach(s=>{const o=e.get(s);if(!o)throw new Error(`Commit not found for key ${s}`);o.parents.length?(n=I0t(o),i=Math.max(n,i)):a.push(o),D0t(o,n)}),n=i,a.forEach(s=>{M0t(s,n,r)}),t.forEach(s=>{const o=e.get(s);if(o!=null&&o.parents.length){const l=A0t(o.parents);n=co.get(l).y-Dd,n<=i&&(i=n);const u=lo.get(o.branch).pos,h=n-Id;co.set(o.id,{x:u,y:h})}})},"setParallelBTPos"),L0t=T(t=>{var n;const e=uxe(t.parents.filter(i=>i!==null));if(!e)throw new Error(`Closest parent not found for commit ${t.id}`);const r=(n=co.get(e))==null?void 0:n.y;if(r===void 0)throw new Error(`Closest parent position not found for commit ${t.id}`);return r},"findClosestParentPos"),I0t=T(t=>L0t(t)+Dd,"calculateCommitPosition"),D0t=T((t,e)=>{const r=lo.get(t.branch);if(!r)throw new Error(`Branch not found for commit ${t.id}`);const n=r.pos,i=e+Id;return co.set(t.id,{x:n,y:i}),{x:n,y:i}},"setCommitPosition"),M0t=T((t,e,r)=>{const n=lo.get(t.branch);if(!n)throw new Error(`Branch not found for commit ${t.id}`);const i=e+r,a=n.pos;co.set(t.id,{x:a,y:i})},"setRootPosition"),N0t=T((t,e,r,n,i,a)=>{const{theme:s}=Pe(),o=aA.has(s??""),l=yz.has(s??""),u=S0t.has(s??"");if(a===Dn.HIGHLIGHT)t.append("rect").attr("x",r.x-10+(o?3:0)).attr("y",r.y-10+(o?3:0)).attr("width",o?14:20).attr("height",o?14:20).attr("class",`commit ${e.id} commit-highlight${f0(i,d0,l)} ${n}-outer`),t.append("rect").attr("x",r.x-6+(o?2:0)).attr("y",r.y-6+(o?2:0)).attr("width",o?8:12).attr("height",o?8:12).attr("class",`commit ${e.id} commit${f0(i,d0,l)} ${n}-inner`);else if(a===Dn.CHERRY_PICK)t.append("circle").attr("cx",r.x).attr("cy",r.y).attr("r",o?7:10).attr("class",`commit ${e.id} ${n}`),t.append("circle").attr("cx",r.x-3).attr("cy",r.y+2).attr("r",o?2.5:2.75).attr("fill",u?"#000000":"#fff").attr("class",`commit ${e.id} ${n}`),t.append("circle").attr("cx",r.x+3).attr("cy",r.y+2).attr("r",o?2.5:2.75).attr("fill",u?"#000000":"#fff").attr("class",`commit ${e.id} ${n}`),t.append("line").attr("x1",r.x+3).attr("y1",r.y+1).attr("x2",r.x).attr("y2",r.y-5).attr("stroke",u?"#000000":"#fff").attr("class",`commit ${e.id} ${n}`),t.append("line").attr("x1",r.x-3).attr("y1",r.y+1).attr("x2",r.x).attr("y2",r.y-5).attr("stroke",u?"#000000":"#fff").attr("class",`commit ${e.id} ${n}`);else{const h=t.append("circle");if(h.attr("cx",r.x),h.attr("cy",r.y),h.attr("r",o?7:10),h.attr("class",`commit ${e.id} commit${f0(i,d0,l)}`),a===Dn.MERGE){const d=t.append("circle");d.attr("cx",r.x),d.attr("cy",r.y),d.attr("r",o?5:6),d.attr("class",`commit ${n} ${e.id} commit${f0(i,d0,l)}`)}if(a===Dn.REVERSE){const d=t.append("path"),f=o?4:5;d.attr("d",`M ${r.x-f},${r.y-f}L${r.x+f},${r.y+f}M${r.x-f},${r.y+f}L${r.x+f},${r.y-f}`).attr("class",`commit ${n} ${e.id} commit${f0(i,d0,l)}`)}}},"drawCommitBullet"),$0t=T((t,e,r,n,i)=>{var a;if(e.type!==Dn.CHERRY_PICK&&(e.customId&&e.type===Dn.MERGE||e.type!==Dn.MERGE)&&i.showCommitLabel){const s=t.append("g"),o=s.insert("rect").attr("class","commit-label-bkg"),l=s.append("text").attr("x",n).attr("y",r.y+25).attr("class","commit-label").text(e.id),u=(a=l.node())==null?void 0:a.getBBox();if(u&&(o.attr("x",r.posWithOffset-u.width/2-ch).attr("y",r.y+13.5).attr("width",u.width+2*ch).attr("height",u.height+2*ch),Kr==="TB"||Kr==="BT"?(o.attr("x",r.x-(u.width+4*Hc+5)).attr("y",r.y-12),l.attr("x",r.x-(u.width+4*Hc)).attr("y",r.y+u.height-12)):l.attr("x",r.posWithOffset-u.width/2),i.rotateCommitLabel))if(Kr==="TB"||Kr==="BT")l.attr("transform","rotate(-45, "+r.x+", "+r.y+")"),o.attr("transform","rotate(-45, "+r.x+", "+r.y+")");else{const h=-7.5-(u.width+10)/25*9.5,d=10+u.width/25*8.5;s.attr("transform","translate("+h+", "+d+") rotate(-45, "+n+", "+r.y+")")}}},"drawCommitLabel"),O0t=T((t,e,r,n)=>{var i;if(e.tags.length>0){let a=0,s=0,o=0;const l=[];for(const u of e.tags.reverse()){const h=t.insert("polygon"),d=t.append("circle"),f=t.append("text").attr("y",r.y-16-a).attr("class","tag-label").text(u),p=(i=f.node())==null?void 0:i.getBBox();if(!p)throw new Error("Tag bbox not found");s=Math.max(s,p.width),o=Math.max(o,p.height),f.attr("x",r.posWithOffset-p.width/2),l.push({tag:f,hole:d,rect:h,yOffset:a}),a+=20}for(const{tag:u,hole:h,rect:d,yOffset:f}of l){const p=o/2,g=r.y-19.2-f;if(d.attr("class","tag-label-bkg").attr("points",` + ${n-s/2-Hc/2},${g+ch} + ${n-s/2-Hc/2},${g-ch} + ${r.posWithOffset-s/2-Hc},${g-p-ch} + ${r.posWithOffset+s/2+Hc},${g-p-ch} + ${r.posWithOffset+s/2+Hc},${g+p+ch} + ${r.posWithOffset-s/2-Hc},${g+p+ch}`),h.attr("cy",g).attr("cx",n-s/2+Hc/2).attr("r",1.5).attr("class","tag-hole"),Kr==="TB"||Kr==="BT"){const m=n+f;d.attr("class","tag-label-bkg").attr("points",` ${r.x},${m+2} ${r.x},${m-2} - ${r.x+Rh},${m-p-2} - ${r.x+Rh+s+4},${m-p-2} - ${r.x+Rh+s+4},${m+p+2} - ${r.x+Rh},${m+p+2}`).attr("transform","translate(12,12) rotate(45, "+r.x+","+n+")"),h.attr("cx",r.x+nc/2).attr("cy",m).attr("transform","translate(12,12) rotate(45, "+r.x+","+n+")"),u.attr("x",r.x+5).attr("y",m+3).attr("transform","translate(14,14) rotate(45, "+r.x+","+n+")")}}}},"drawCommitTags"),Zat=x(t=>{switch(t.customType??t.type){case bn.NORMAL:return"commit-normal";case bn.REVERSE:return"commit-reverse";case bn.HIGHLIGHT:return"commit-highlight";case bn.MERGE:return"commit-merge";case bn.CHERRY_PICK:return"commit-cherry-pick";default:return"commit-normal"}},"getCommitClassType"),Qat=x((t,e,r,n)=>{const i={x:0,y:0};if(t.parents.length>0){const a=Ype(t.parents);if(a){const s=n.get(a)??i;return e==="TB"?s.y+Lh:e==="BT"?(n.get(t.id)??i).y-Lh:s.x+Lh}}else return e==="TB"?oS:e==="BT"?(n.get(t.id)??i).y-Lh:0;return 0},"calculatePosition"),Jat=x((t,e,r)=>{var l,u;const n=Gr==="BT"&&r?e:e+Rh,i=(l=Ls.get(t.branch))==null?void 0:l.pos,a=Gr==="TB"||Gr==="BT"?(u=Ls.get(t.branch))==null?void 0:u.pos:n;if(a===void 0||i===void 0)throw new Error(`Position were undefined for commit ${t.id}`);const s=sS.has(Pe().theme??""),o=Gr==="TB"||Gr==="BT"?n:i+(s?GO/2+1:-2);return{x:a,y:o,posWithOffset:n}},"getCommitPosition"),Xpe=x((t,e,r,n)=>{const i=t.append("g").attr("class","commit-bullets"),a=t.append("g").attr("class","commit-labels");let s=Gr==="TB"||Gr==="BT"?oS:0;const o=[...e.keys()],l=n.parallelCommits??!1,u=x((d,f)=>{var m,y;const p=(m=e.get(d))==null?void 0:m.seq,g=(y=e.get(f))==null?void 0:y.seq;return p!==void 0&&g!==void 0?p-g:0},"sortKeys");let h=o.sort(u);Gr==="BT"&&(l&&Vat(h,e,s),h=h.reverse()),h.forEach(d=>{var g;const f=e.get(d);if(!f)throw new Error(`Commit not found for key ${d}`);l&&(s=Qat(f,Gr,s,Is));const p=Jat(f,s,l);if(r){const m=Zat(f),y=f.customType??f.type,v=((g=Ls.get(f.branch))==null?void 0:g.index)??0;Xat(i,f,p,m,v,y),Kat(a,f,p,s,n),jat(a,f,p,s)}Gr==="TB"||Gr==="BT"?Is.set(f.id,{x:p.x,y:p.posWithOffset}):Is.set(f.id,{x:p.posWithOffset,y:p.y}),s=Gr==="BT"&&l?s+Lh:s+Lh+Rh,s>hu&&(hu=s)})},"drawCommits"),est=x((t,e,r,n,i)=>{const s=(Gr==="TB"||Gr==="BT"?r.xu.branch===s,"isOnBranchToGetCurve"),l=x(u=>u.seq>t.seq&&u.seql(u)&&o(u))},"shouldRerouteArrow"),GT=x((t,e,r=0)=>{const n=t+Math.abs(t-e)/2;if(r>5)return n;if(lS.every(s=>Math.abs(s-n)>=10))return lS.push(n),n;const a=Math.abs(t-e);return GT(t,e-a/5,r+1)},"findLane"),tst=x((t,e,r,n)=>{var m,y,v,T,b;const{theme:i}=Pe(),a=qO.has(i??""),s=Is.get(e.id),o=Is.get(r.id);if(s===void 0||o===void 0)throw new Error(`Commit positions not found for commits ${e.id} and ${r.id}`);const l=est(e,r,s,o,n);let u="",h="",d=0,f=0,p=(m=Ls.get(r.branch))==null?void 0:m.index;r.type===bn.MERGE&&e.id!==r.parents[0]&&(p=(y=Ls.get(e.branch))==null?void 0:y.index);let g;if(l){u="A 10 10, 0, 0, 0,",h="A 10 10, 0, 0, 1,",d=10,f=10;const w=s.yo.x&&(u="A 20 20, 0, 0, 0,",h="A 20 20, 0, 0, 1,",d=20,f=20,r.type===bn.MERGE&&e.id!==r.parents[0]?g=`M ${s.x} ${s.y} L ${s.x} ${o.y-d} ${h} ${s.x-f} ${o.y} L ${o.x} ${o.y}`:g=`M ${s.x} ${s.y} L ${o.x+d} ${s.y} ${u} ${o.x} ${s.y+f} L ${o.x} ${o.y}`),s.x===o.x&&(g=`M ${s.x} ${s.y} L ${o.x} ${o.y}`)):Gr==="BT"?(s.xo.x&&(u="A 20 20, 0, 0, 0,",h="A 20 20, 0, 0, 1,",d=20,f=20,r.type===bn.MERGE&&e.id!==r.parents[0]?g=`M ${s.x} ${s.y} L ${s.x} ${o.y+d} ${u} ${s.x-f} ${o.y} L ${o.x} ${o.y}`:g=`M ${s.x} ${s.y} L ${o.x+d} ${s.y} ${h} ${o.x} ${s.y-f} L ${o.x} ${o.y}`),s.x===o.x&&(g=`M ${s.x} ${s.y} L ${o.x} ${o.y}`)):(s.yo.y&&(r.type===bn.MERGE&&e.id!==r.parents[0]?g=`M ${s.x} ${s.y} L ${o.x-d} ${s.y} ${u} ${o.x} ${s.y-f} L ${o.x} ${o.y}`:g=`M ${s.x} ${s.y} L ${s.x} ${o.y+d} ${h} ${s.x+f} ${o.y} L ${o.x} ${o.y}`),s.y===o.y&&(g=`M ${s.x} ${s.y} L ${o.x} ${o.y}`));if(g===void 0)throw new Error("Line definition not found");t.append("path").attr("d",g).attr("class","arrow arrow"+Zf(p,jf,a))},"drawArrow"),rst=x((t,e)=>{const r=t.append("g").attr("class","commit-arrows");[...e.keys()].forEach(n=>{const i=e.get(n);i.parents&&i.parents.length>0&&i.parents.forEach(a=>{tst(r,e.get(a),i,e)})})},"drawArrows"),nst=x((t,e,r,n)=>{const{look:i,theme:a,themeVariables:s}=Pe(),{dropShadow:o,THEME_COLOR_LIMIT:l}=s,u=sS.has(a??""),h=qO.has(a??""),d=t.append("g");e.forEach((f,p)=>{var M;const g=Zf(p,u?l:jf,h),m=(M=Ls.get(f.name))==null?void 0:M.pos;if(m===void 0)throw new Error(`Position not found for branch ${f.name}`);const y=Gr==="TB"||Gr==="BT"?m:u?m+GO/2+1:m-2,v=d.append("line");v.attr("x1",0),v.attr("y1",y),v.attr("x2",hu),v.attr("y2",y),v.attr("class","branch branch"+g),Gr==="TB"?(v.attr("y1",oS),v.attr("x1",m),v.attr("y2",hu),v.attr("x2",m)):Gr==="BT"&&(v.attr("y1",hu),v.attr("x1",m),v.attr("y2",oS),v.attr("x2",m)),lS.push(y);const T=f.name,b=Hpe(T),w=d.insert("rect"),A=d.insert("g").attr("class","branchLabel").insert("g").attr("class","label branch-label"+g);A.node().appendChild(b);const C=b.getBBox(),_=u?0:4,L=u?16:0,O=u?GO:0;i==="neo"&&w.attr("data-look","neo"),w.attr("class","branchLabelBkg label"+g).attr("style",i==="neo"?`filter:${u?`url(#${n}-drop-shadow)`:o}`:"").attr("rx",_).attr("ry",_).attr("x",-C.width-4-(r.rotateCommitLabel===!0?30:0)).attr("y",-C.height/2+10).attr("width",C.width+18+L).attr("height",C.height+4+O),A.attr("transform","translate("+(-C.width-14-(r.rotateCommitLabel===!0?30:0)+L/2)+", "+(y-C.height/2-2)+")"),Gr==="TB"?(w.attr("x",m-C.width/2-10).attr("y",0),A.attr("transform","translate("+(m-C.width/2-5)+", 0)"),u&&(w.attr("transform",`translate(${-L/2-3}, ${-O-10})`),A.attr("transform","translate("+(m-C.width/2-5)+", "+(-O*2+7)+")"))):Gr==="BT"?(w.attr("x",m-C.width/2-10).attr("y",hu),A.attr("transform","translate("+(m-C.width/2-5)+", "+hu+")"),u&&(w.attr("transform",`translate(${-L/2-3}, ${O+10})`),A.attr("transform","translate("+(m-C.width/2-5)+", "+(hu+O*2+4)+")"))):w.attr("transform","translate(-19, "+(y-12-O/2)+")")})},"drawBranches"),ist=x(function(t,e,r,n,i){return Ls.set(t,{pos:e,index:r}),e+=50+(i?40:0)+(Gr==="TB"||Gr==="BT"?n.width/2:0),e},"setBranchPosition"),ast=x(function(t,e,r,n){Gat(),ae.debug("in gitgraph renderer",t+` -`,"id:",e,r);const i=n.db;if(!i.getConfig){ae.error("getConfig method is not available on db");return}const a=i.getConfig(),s=a.rotateCommitLabel??!1;zT=i.getCommits();const o=i.getBranchesAsObjArray();Gr=i.getDirection();const l=pt(`[id="${e}"]`),{look:u,theme:h,themeVariables:d}=Pe(),{useGradient:f,gradientStart:p,gradientStop:g,filterColor:m}=d;if(f){const v=l.append("defs").append("linearGradient").attr("id",e+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");v.append("stop").attr("offset","0%").attr("stop-color",p).attr("stop-opacity",1),v.append("stop").attr("offset","100%").attr("stop-color",g).attr("stop-opacity",1)}u==="neo"&&sS.has(h??"")&&l.append("defs").append("filter").attr("id",e+"-drop-shadow").attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",m);let y=0;o.forEach((v,T)=>{var _;const b=Hpe(v.name),w=l.append("g"),k=w.insert("g").attr("class","branchLabel"),A=k.insert("g").attr("class","label branch-label");(_=A.node())==null||_.appendChild(b);const C=b.getBBox();y=ist(v.name,y,T,C,s),A.remove(),k.remove(),w.remove()}),Xpe(l,zT,!1,a),a.showBranches&&nst(l,o,a,e),rst(l,zT),Xpe(l,zT,!0,a),Lr.insertTitle(l,"gitTitleText",a.titleTopMargin??0,i.getDiagramTitle()),P6(void 0,l,a.diagramPadding,a.useMaxWidth)},"draw"),sst={draw:ast},Kpe=8,jpe=new Set(["redux","redux-dark","redux-color","redux-dark-color"]),ost=new Set(["redux-color","redux-dark-color"]),lst=new Set(["neo","neo-dark"]),cst=new Set(["dark","redux-dark","redux-dark-color","neo-dark"]),ust=new Set(["redux","redux-dark","redux-color","redux-dark-color","neo","neo-dark"]),hst=x(t=>{const{svgId:e}=t;let r="";if(t.useGradient&&e)for(let n=0;n{switch(t.customType??t.type){case Dn.NORMAL:return"commit-normal";case Dn.REVERSE:return"commit-reverse";case Dn.HIGHLIGHT:return"commit-highlight";case Dn.MERGE:return"commit-merge";case Dn.CHERRY_PICK:return"commit-cherry-pick";default:return"commit-normal"}},"getCommitClassType"),B0t=T((t,e,r,n)=>{const i={x:0,y:0};if(t.parents.length>0){const a=uxe(t.parents);if(a){const s=n.get(a)??i;return e==="TB"?s.y+Dd:e==="BT"?(n.get(t.id)??i).y-Dd:s.x+Dd}}else return e==="TB"?sA:e==="BT"?(n.get(t.id)??i).y-Dd:0;return 0},"calculatePosition"),F0t=T((t,e,r)=>{var l,u;const n=Kr==="BT"&&r?e:e+Id,i=(l=lo.get(t.branch))==null?void 0:l.pos,a=Kr==="TB"||Kr==="BT"?(u=lo.get(t.branch))==null?void 0:u.pos:n;if(a===void 0||i===void 0)throw new Error(`Position were undefined for commit ${t.id}`);const s=aA.has(Pe().theme??""),o=Kr==="TB"||Kr==="BT"?n:i+(s?mz/2+1:-2);return{x:a,y:o,posWithOffset:n}},"getCommitPosition"),hxe=T((t,e,r,n)=>{const i=t.append("g").attr("class","commit-bullets"),a=t.append("g").attr("class","commit-labels");let s=Kr==="TB"||Kr==="BT"?sA:0;const o=[...e.keys()],l=n.parallelCommits??!1,u=T((d,f)=>{var m,y;const p=(m=e.get(d))==null?void 0:m.seq,g=(y=e.get(f))==null?void 0:y.seq;return p!==void 0&&g!==void 0?p-g:0},"sortKeys");let h=o.sort(u);Kr==="BT"&&(l&&R0t(h,e,s),h=h.reverse()),h.forEach(d=>{var g;const f=e.get(d);if(!f)throw new Error(`Commit not found for key ${d}`);l&&(s=B0t(f,Kr,s,co));const p=F0t(f,s,l);if(r){const m=P0t(f),y=f.customType??f.type,v=((g=lo.get(f.branch))==null?void 0:g.index)??0;N0t(i,f,p,m,v,y),$0t(a,f,p,s,n),O0t(a,f,p,s)}Kr==="TB"||Kr==="BT"?co.set(f.id,{x:p.x,y:p.posWithOffset}):co.set(f.id,{x:p.posWithOffset,y:p.y}),s=Kr==="BT"&&l?s+Dd:s+Dd+Id,s>uh&&(uh=s)})},"drawCommits"),z0t=T((t,e,r,n,i)=>{const s=(Kr==="TB"||Kr==="BT"?r.xu.branch===s,"isOnBranchToGetCurve"),l=T(u=>u.seq>t.seq&&u.seql(u)&&o(u))},"shouldRerouteArrow"),XC=T((t,e,r=0)=>{const n=t+Math.abs(t-e)/2;if(r>5)return n;if(oA.every(s=>Math.abs(s-n)>=10))return oA.push(n),n;const a=Math.abs(t-e);return XC(t,e-a/5,r+1)},"findLane"),G0t=T((t,e,r,n)=>{var m,y,v,x,b;const{theme:i}=Pe(),a=yz.has(i??""),s=co.get(e.id),o=co.get(r.id);if(s===void 0||o===void 0)throw new Error(`Commit positions not found for commits ${e.id} and ${r.id}`);const l=z0t(e,r,s,o,n);let u="",h="",d=0,f=0,p=(m=lo.get(r.branch))==null?void 0:m.index;r.type===Dn.MERGE&&e.id!==r.parents[0]&&(p=(y=lo.get(e.branch))==null?void 0:y.index);let g;if(l){u="A 10 10, 0, 0, 0,",h="A 10 10, 0, 0, 1,",d=10,f=10;const w=s.yo.x&&(u="A 20 20, 0, 0, 0,",h="A 20 20, 0, 0, 1,",d=20,f=20,r.type===Dn.MERGE&&e.id!==r.parents[0]?g=`M ${s.x} ${s.y} L ${s.x} ${o.y-d} ${h} ${s.x-f} ${o.y} L ${o.x} ${o.y}`:g=`M ${s.x} ${s.y} L ${o.x+d} ${s.y} ${u} ${o.x} ${s.y+f} L ${o.x} ${o.y}`),s.x===o.x&&(g=`M ${s.x} ${s.y} L ${o.x} ${o.y}`)):Kr==="BT"?(s.xo.x&&(u="A 20 20, 0, 0, 0,",h="A 20 20, 0, 0, 1,",d=20,f=20,r.type===Dn.MERGE&&e.id!==r.parents[0]?g=`M ${s.x} ${s.y} L ${s.x} ${o.y+d} ${u} ${s.x-f} ${o.y} L ${o.x} ${o.y}`:g=`M ${s.x} ${s.y} L ${o.x+d} ${s.y} ${h} ${o.x} ${s.y-f} L ${o.x} ${o.y}`),s.x===o.x&&(g=`M ${s.x} ${s.y} L ${o.x} ${o.y}`)):(s.yo.y&&(r.type===Dn.MERGE&&e.id!==r.parents[0]?g=`M ${s.x} ${s.y} L ${o.x-d} ${s.y} ${u} ${o.x} ${s.y-f} L ${o.x} ${o.y}`:g=`M ${s.x} ${s.y} L ${s.x} ${o.y+d} ${h} ${s.x+f} ${o.y} L ${o.x} ${o.y}`),s.y===o.y&&(g=`M ${s.x} ${s.y} L ${o.x} ${o.y}`));if(g===void 0)throw new Error("Line definition not found");t.append("path").attr("d",g).attr("class","arrow arrow"+f0(p,d0,a))},"drawArrow"),q0t=T((t,e)=>{const r=t.append("g").attr("class","commit-arrows");[...e.keys()].forEach(n=>{const i=e.get(n);i.parents&&i.parents.length>0&&i.parents.forEach(a=>{G0t(r,e.get(a),i,e)})})},"drawArrows"),V0t=T((t,e,r,n)=>{const{look:i,theme:a,themeVariables:s}=Pe(),{dropShadow:o,THEME_COLOR_LIMIT:l}=s,u=aA.has(a??""),h=yz.has(a??""),d=t.append("g");e.forEach((f,p)=>{var I;const g=f0(p,u?l:d0,h),m=(I=lo.get(f.name))==null?void 0:I.pos;if(m===void 0)throw new Error(`Position not found for branch ${f.name}`);const y=Kr==="TB"||Kr==="BT"?m:u?m+mz/2+1:m-2,v=d.append("line");v.attr("x1",0),v.attr("y1",y),v.attr("x2",uh),v.attr("y2",y),v.attr("class","branch branch"+g),Kr==="TB"?(v.attr("y1",sA),v.attr("x1",m),v.attr("y2",uh),v.attr("x2",m)):Kr==="BT"&&(v.attr("y1",uh),v.attr("x1",m),v.attr("y2",sA),v.attr("x2",m)),oA.push(y);const x=f.name,b=cxe(x),w=d.insert("rect"),_=d.insert("g").attr("class","branchLabel").insert("g").attr("class","label branch-label"+g);_.node().appendChild(b);const k=b.getBBox(),S=u?0:4,L=u?16:0,$=u?mz:0;i==="neo"&&w.attr("data-look","neo"),w.attr("class","branchLabelBkg label"+g).attr("style",i==="neo"?`filter:${u?`url(#${n}-drop-shadow)`:o}`:"").attr("rx",S).attr("ry",S).attr("x",-k.width-4-(r.rotateCommitLabel===!0?30:0)).attr("y",-k.height/2+10).attr("width",k.width+18+L).attr("height",k.height+4+$),_.attr("transform","translate("+(-k.width-14-(r.rotateCommitLabel===!0?30:0)+L/2)+", "+(y-k.height/2-2)+")"),Kr==="TB"?(w.attr("x",m-k.width/2-10).attr("y",0),_.attr("transform","translate("+(m-k.width/2-5)+", 0)"),u&&(w.attr("transform",`translate(${-L/2-3}, ${-$-10})`),_.attr("transform","translate("+(m-k.width/2-5)+", "+(-$*2+7)+")"))):Kr==="BT"?(w.attr("x",m-k.width/2-10).attr("y",uh),_.attr("transform","translate("+(m-k.width/2-5)+", "+uh+")"),u&&(w.attr("transform",`translate(${-L/2-3}, ${$+10})`),_.attr("transform","translate("+(m-k.width/2-5)+", "+(uh+$*2+4)+")"))):w.attr("transform","translate(-19, "+(y-12-$/2)+")")})},"drawBranches"),W0t=T(function(t,e,r,n,i){return lo.set(t,{pos:e,index:r}),e+=50+(i?40:0)+(Kr==="TB"||Kr==="BT"?n.width/2:0),e},"setBranchPosition"),U0t=T(function(t,e,r,n){_0t(),se.debug("in gitgraph renderer",t+` +`,"id:",e,r);const i=n.db;if(!i.getConfig){se.error("getConfig method is not available on db");return}const a=i.getConfig(),s=a.rotateCommitLabel??!1;YC=i.getCommits();const o=i.getBranchesAsObjArray();Kr=i.getDirection();const l=gt(`[id="${e}"]`),{look:u,theme:h,themeVariables:d}=Pe(),{useGradient:f,gradientStart:p,gradientStop:g,filterColor:m}=d;if(f){const v=l.append("defs").append("linearGradient").attr("id",e+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");v.append("stop").attr("offset","0%").attr("stop-color",p).attr("stop-opacity",1),v.append("stop").attr("offset","100%").attr("stop-color",g).attr("stop-opacity",1)}u==="neo"&&aA.has(h??"")&&l.append("defs").append("filter").attr("id",e+"-drop-shadow").attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",m);let y=0;o.forEach((v,x)=>{var S;const b=cxe(v.name),w=l.append("g"),C=w.insert("g").attr("class","branchLabel"),_=C.insert("g").attr("class","label branch-label");(S=_.node())==null||S.appendChild(b);const k=b.getBBox();y=W0t(v.name,y,x,k,s),_.remove(),C.remove(),w.remove()}),hxe(l,YC,!1,a),a.showBranches&&V0t(l,o,a,e),q0t(l,YC),hxe(l,YC,!0,a),Pr.insertTitle(l,"gitTitleText",a.titleTopMargin??0,i.getDiagramTitle()),O7(void 0,l,a.diagramPadding,a.useMaxWidth)},"draw"),H0t={draw:U0t},dxe=8,fxe=new Set(["redux","redux-dark","redux-color","redux-dark-color"]),Y0t=new Set(["redux-color","redux-dark-color"]),X0t=new Set(["neo","neo-dark"]),j0t=new Set(["dark","redux-dark","redux-dark-color","neo-dark"]),K0t=new Set(["redux","redux-dark","redux-color","redux-dark-color","neo","neo-dark"]),Z0t=T(t=>{const{svgId:e}=t;let r="";if(t.useGradient&&e)for(let n=0;n{const e=lr(),{theme:r,themeVariables:n}=e,{borderColorArray:i}=n,a=jpe.has(r);if(lst.has(r)){let s="";for(let o=0;o{const e=pr(),{theme:r,themeVariables:n}=e,{borderColorArray:i}=n,a=fxe.has(r);if(X0t.has(r)){let s="";for(let o=0;o`${Array.from({length:t.THEME_COLOR_LIMIT},(e,r)=>r).map(e=>{const r=e%Kpe;return` + `;return s}},"genColor"),J0t=T(t=>`${Array.from({length:t.THEME_COLOR_LIMIT},(e,r)=>r).map(e=>{const r=e%dxe;return` .branch-label${e} { fill: ${t["gitBranchLabel"+r]}; } .commit${e} { stroke: ${t["git"+r]}; fill: ${t["git"+r]}; } .commit-highlight${e} { stroke: ${t["gitInv"+r]}; fill: ${t["gitInv"+r]}; } .label${e} { fill: ${t["git"+r]}; } .arrow${e} { stroke: ${t["git"+r]}; } `}).join(` -`)}`,"normalTheme"),pst=x(t=>{const e=lr(),{theme:r}=e,n=ust.has(r);return` +`)}`,"normalTheme"),egt=T(t=>{const e=pr(),{theme:r}=e,n=K0t.has(r);return` .commit-id, .commit-msg, .branch-label { @@ -1403,8 +1404,8 @@ ${r}`),this.inline?`{${i}}`:i}},E(Oy,"JSDocTagImpl"),Oy);function Vfe(t,e,r){var font-family: 'trebuchet ms', verdana, arial, sans-serif; font-family: var(--mermaid-font-family); } - - ${n?dst(t):fst(t)} + + ${n?Q0t(t):J0t(t)} .branch { stroke-width: ${t.strokeWidth}; @@ -1435,7 +1436,7 @@ ${r}`),this.inline?`{${i}}`:i}},E(Oy,"JSDocTagImpl"),Oy);function Vfe(t,e,r){var .arrow { /* Intentional: neo themes keep the bold 8px arrow (like classic themes); only redux-geometry themes use the thinner options.strokeWidth. */ - stroke-width: ${jpe.has(r)?t.strokeWidth:8}; + stroke-width: ${fxe.has(r)?t.strokeWidth:8}; stroke-linecap: round; fill: none } @@ -1444,12 +1445,12 @@ ${r}`),this.inline?`{${i}}`:i}},E(Oy,"JSDocTagImpl"),Oy);function Vfe(t,e,r){var font-size: 18px; fill: ${t.textColor}; } -`},"getStyles"),gst=pst,mst={parser:Fat,db:Upe,renderer:sst,styles:gst};const yst=Object.freeze(Object.defineProperty({__proto__:null,diagram:mst},Symbol.toStringTag,{value:"Module"}));var cS={exports:{}},vst=cS.exports,Zpe;function bst(){return Zpe||(Zpe=1,(function(t,e){(function(r,n){t.exports=n()})(vst,(function(){var r="day";return function(n,i,a){var s=function(u){return u.add(4-u.isoWeekday(),r)},o=i.prototype;o.isoWeekYear=function(){return s(this).year()},o.isoWeek=function(u){if(!this.$utils().u(u))return this.add(7*(u-this.isoWeek()),r);var h,d,f,p,g=s(this),m=(h=this.isoWeekYear(),d=this.$u,f=(d?a.utc:a)().year(h).startOf("year"),p=4-f.isoWeekday(),f.isoWeekday()>4&&(p+=7),f.add(p,r));return g.diff(m,"week")+1},o.isoWeekday=function(u){return this.$utils().u(u)?this.day()||7:this.day(this.day()%7?u:u-7)};var l=o.startOf;o.startOf=function(u,h){var d=this.$utils(),f=!!d.u(h)||h;return d.p(u)==="isoweek"?f?this.date(this.date()-(this.isoWeekday()-1)).startOf("day"):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf("day"):l.bind(this)(u,h)}}}))})(cS)),cS.exports}var xst=bst();const Tst=Os(xst);var uS={exports:{}},wst=uS.exports,Qpe;function Cst(){return Qpe||(Qpe=1,(function(t,e){(function(r,n){t.exports=n()})(wst,(function(){var r={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},n=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,i=/\d/,a=/\d\d/,s=/\d\d?/,o=/\d*[^-_:/,()\s\d]+/,l={},u=function(y){return(y=+y)+(y>68?1900:2e3)},h=function(y){return function(v){this[y]=+v}},d=[/[+-]\d\d:?(\d\d)?|Z/,function(y){(this.zone||(this.zone={})).offset=(function(v){if(!v||v==="Z")return 0;var T=v.match(/([+-]|\d\d)/g),b=60*T[1]+(+T[2]||0);return b===0?0:T[0]==="+"?-b:b})(y)}],f=function(y){var v=l[y];return v&&(v.indexOf?v:v.s.concat(v.f))},p=function(y,v){var T,b=l.meridiem;if(b){for(var w=1;w<=24;w+=1)if(y.indexOf(b(w,0,v))>-1){T=w>12;break}}else T=y===(v?"pm":"PM");return T},g={A:[o,function(y){this.afternoon=p(y,!1)}],a:[o,function(y){this.afternoon=p(y,!0)}],Q:[i,function(y){this.month=3*(y-1)+1}],S:[i,function(y){this.milliseconds=100*+y}],SS:[a,function(y){this.milliseconds=10*+y}],SSS:[/\d{3}/,function(y){this.milliseconds=+y}],s:[s,h("seconds")],ss:[s,h("seconds")],m:[s,h("minutes")],mm:[s,h("minutes")],H:[s,h("hours")],h:[s,h("hours")],HH:[s,h("hours")],hh:[s,h("hours")],D:[s,h("day")],DD:[a,h("day")],Do:[o,function(y){var v=l.ordinal,T=y.match(/\d+/);if(this.day=T[0],v)for(var b=1;b<=31;b+=1)v(b).replace(/\[|\]/g,"")===y&&(this.day=b)}],w:[s,h("week")],ww:[a,h("week")],M:[s,h("month")],MM:[a,h("month")],MMM:[o,function(y){var v=f("months"),T=(f("monthsShort")||v.map((function(b){return b.slice(0,3)}))).indexOf(y)+1;if(T<1)throw new Error;this.month=T%12||T}],MMMM:[o,function(y){var v=f("months").indexOf(y)+1;if(v<1)throw new Error;this.month=v%12||v}],Y:[/[+-]?\d+/,h("year")],YY:[a,function(y){this.year=u(y)}],YYYY:[/\d{4}/,h("year")],Z:d,ZZ:d};function m(y){var v,T;v=y,T=l&&l.formats;for(var b=(y=v.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(O,M,z){var F=z&&z.toUpperCase();return M||T[z]||r[z]||T[F].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(S,R,N){return R||N.slice(1)}))}))).match(n),w=b.length,k=0;k-1)return new Date((I==="X"?1e3:1)*D);var P=m(I)(D),G=P.year,V=P.month,Y=P.day,W=P.hours,ie=P.minutes,K=P.seconds,se=P.milliseconds,J=P.zone,Z=P.week,ee=new Date,ne=Y||(G||V?1:ee.getDate()),ue=G||ee.getFullYear(),fe=0;G&&!V||(fe=V>0?V-1:ee.getMonth());var _e,Ae=W||0,Ne=ie||0,me=K||0,ve=se||0;return J?new Date(Date.UTC(ue,fe,ne,Ae,Ne,me,ve+60*J.offset*1e3)):$?new Date(Date.UTC(ue,fe,ne,Ae,Ne,me,ve)):(_e=new Date(ue,fe,ne,Ae,Ne,me,ve),Z&&(_e=B(_e).week(Z).toDate()),_e)}catch{return new Date("")}})(A,L,C,T),this.init(),F&&F!==!0&&(this.$L=this.locale(F).$L),z&&A!=this.format(L)&&(this.$d=new Date("")),l={}}else if(L instanceof Array)for(var S=L.length,R=1;R<=S;R+=1){_[1]=L[R-1];var N=T.apply(this,_);if(N.isValid()){this.$d=N.$d,this.$L=N.$L,this.init();break}R===S&&(this.$d=new Date(""))}else w.call(this,k)}}}))})(uS)),uS.exports}var kst=Cst();const Est=Os(kst);var hS={exports:{}},Sst=hS.exports,Jpe;function Ast(){return Jpe||(Jpe=1,(function(t,e){(function(r,n){t.exports=n()})(Sst,(function(){return function(r,n){var i=n.prototype,a=i.format;i.format=function(s){var o=this,l=this.$locale();if(!this.isValid())return a.bind(this)(s);var u=this.$utils(),h=(s||"YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g,(function(d){switch(d){case"Q":return Math.ceil((o.$M+1)/3);case"Do":return l.ordinal(o.$D);case"gggg":return o.weekYear();case"GGGG":return o.isoWeekYear();case"wo":return l.ordinal(o.week(),"W");case"w":case"ww":return u.s(o.week(),d==="w"?1:2,"0");case"W":case"WW":return u.s(o.isoWeek(),d==="W"?1:2,"0");case"k":case"kk":return u.s(String(o.$H===0?24:o.$H),d==="k"?1:2,"0");case"X":return Math.floor(o.$d.getTime()/1e3);case"x":return o.$d.getTime();case"z":return"["+o.offsetName()+"]";case"zzz":return"["+o.offsetName("long")+"]";default:return d}}));return a.bind(this)(h)}}}))})(hS)),hS.exports}var _st=Ast();const Rst=Os(_st);var dS={exports:{}},Lst=dS.exports,ege;function Ist(){return ege||(ege=1,(function(t,e){(function(r,n){t.exports=n()})(Lst,(function(){var r,n,i=1e3,a=6e4,s=36e5,o=864e5,l=31536e6,u=2628e6,h=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,d=/\[([^\]]+)]|YYYY|YY|Y|M{1,2}|D{1,2}|H{1,2}|m{1,2}|s{1,2}|SSS/g,f={years:l,months:u,days:o,hours:s,minutes:a,seconds:i,milliseconds:1,weeks:6048e5},p=function(A){return A instanceof w},g=function(A,C,_){return new w(A,_,C.$l)},m=function(A){return n.p(A)+"s"},y=function(A){return A<0},v=function(A){return y(A)?Math.ceil(A):Math.floor(A)},T=function(A){return Math.abs(A)},b=function(A,C){return A?y(A)?{negative:!0,format:""+T(A)+C}:{negative:!1,format:""+A+C}:{negative:!1,format:""}},w=(function(){function A(_,L,O){var M=this;if(this.$d={},this.$l=O,_===void 0&&(this.$ms=0,this.parseFromMilliseconds()),L)return g(_*f[m(L)],this);if(typeof _=="number")return this.$ms=_,this.parseFromMilliseconds(),this;if(typeof _=="object")return Object.keys(_).forEach((function(S){M.$d[m(S)]=_[S]})),this.calMilliseconds(),this;if(typeof _=="string"){var z=_.match(h);if(z){var F=z.slice(2).map((function(S){return S!=null?Number(S):0}));return this.$d.years=F[0],this.$d.months=F[1],this.$d.weeks=F[2],this.$d.days=F[3],this.$d.hours=F[4],this.$d.minutes=F[5],this.$d.seconds=F[6],this.calMilliseconds(),this}}return this}var C=A.prototype;return C.calMilliseconds=function(){var _=this;this.$ms=Object.keys(this.$d).reduce((function(L,O){return L+(_.$d[O]||0)*f[O]}),0)},C.parseFromMilliseconds=function(){var _=this.$ms;this.$d.years=v(_/l),_%=l,this.$d.months=v(_/u),_%=u,this.$d.days=v(_/o),_%=o,this.$d.hours=v(_/s),_%=s,this.$d.minutes=v(_/a),_%=a,this.$d.seconds=v(_/i),_%=i,this.$d.milliseconds=_},C.toISOString=function(){var _=b(this.$d.years,"Y"),L=b(this.$d.months,"M"),O=+this.$d.days||0;this.$d.weeks&&(O+=7*this.$d.weeks);var M=b(O,"D"),z=b(this.$d.hours,"H"),F=b(this.$d.minutes,"M"),S=this.$d.seconds||0;this.$d.milliseconds&&(S+=this.$d.milliseconds/1e3,S=Math.round(1e3*S)/1e3);var R=b(S,"S"),N=_.negative||L.negative||M.negative||z.negative||F.negative||R.negative,D=z.format||F.format||R.format?"T":"",I=(N?"-":"")+"P"+_.format+L.format+M.format+D+z.format+F.format+R.format;return I==="P"||I==="-P"?"P0D":I},C.toJSON=function(){return this.toISOString()},C.format=function(_){var L=_||"YYYY-MM-DDTHH:mm:ss",O={Y:this.$d.years,YY:n.s(this.$d.years,2,"0"),YYYY:n.s(this.$d.years,4,"0"),M:this.$d.months,MM:n.s(this.$d.months,2,"0"),D:this.$d.days,DD:n.s(this.$d.days,2,"0"),H:this.$d.hours,HH:n.s(this.$d.hours,2,"0"),m:this.$d.minutes,mm:n.s(this.$d.minutes,2,"0"),s:this.$d.seconds,ss:n.s(this.$d.seconds,2,"0"),SSS:n.s(this.$d.milliseconds,3,"0")};return L.replace(d,(function(M,z){return z||String(O[M])}))},C.as=function(_){return this.$ms/f[m(_)]},C.get=function(_){var L=this.$ms,O=m(_);return O==="milliseconds"?L%=1e3:L=O==="weeks"?v(L/f[O]):this.$d[O],L||0},C.add=function(_,L,O){var M;return M=L?_*f[m(L)]:p(_)?_.$ms:g(_,this).$ms,g(this.$ms+M*(O?-1:1),this)},C.subtract=function(_,L){return this.add(_,L,!0)},C.locale=function(_){var L=this.clone();return L.$l=_,L},C.clone=function(){return g(this.$ms,this)},C.humanize=function(_){return r().add(this.$ms,"ms").locale(this.$l).fromNow(!_)},C.valueOf=function(){return this.asMilliseconds()},C.milliseconds=function(){return this.get("milliseconds")},C.asMilliseconds=function(){return this.as("milliseconds")},C.seconds=function(){return this.get("seconds")},C.asSeconds=function(){return this.as("seconds")},C.minutes=function(){return this.get("minutes")},C.asMinutes=function(){return this.as("minutes")},C.hours=function(){return this.get("hours")},C.asHours=function(){return this.as("hours")},C.days=function(){return this.get("days")},C.asDays=function(){return this.as("days")},C.weeks=function(){return this.get("weeks")},C.asWeeks=function(){return this.as("weeks")},C.months=function(){return this.get("months")},C.asMonths=function(){return this.as("months")},C.years=function(){return this.get("years")},C.asYears=function(){return this.as("years")},A})(),k=function(A,C,_){return A.add(C.years()*_,"y").add(C.months()*_,"M").add(C.days()*_,"d").add(C.hours()*_,"h").add(C.minutes()*_,"m").add(C.seconds()*_,"s").add(C.milliseconds()*_,"ms")};return function(A,C,_){r=_,n=_().$utils(),_.duration=function(M,z){var F=_.locale();return g(M,{$l:F},z)},_.isDuration=p;var L=C.prototype.add,O=C.prototype.subtract;C.prototype.add=function(M,z){return p(M)?k(this,M,1):L.bind(this)(M,z)},C.prototype.subtract=function(M,z){return p(M)?k(this,M,-1):O.bind(this)(M,z)}}}))})(dS)),dS.exports}var Dst=Ist();const Mst=Os(Dst);var VO=(function(){var t=x(function(F,S,R,N){for(R=R||{},N=F.length;N--;R[F[N]]=S);return R},"o"),e=[6,8,10,12,13,14,15,16,17,18,20,21,22,23,24,25,26,27,28,29,30,31,33,35,36,38,40],r=[1,26],n=[1,27],i=[1,28],a=[1,29],s=[1,30],o=[1,31],l=[1,32],u=[1,33],h=[1,34],d=[1,9],f=[1,10],p=[1,11],g=[1,12],m=[1,13],y=[1,14],v=[1,15],T=[1,16],b=[1,19],w=[1,20],k=[1,21],A=[1,22],C=[1,23],_=[1,25],L=[1,35],O={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,start:3,gantt:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NL:10,weekday:11,weekday_monday:12,weekday_tuesday:13,weekday_wednesday:14,weekday_thursday:15,weekday_friday:16,weekday_saturday:17,weekday_sunday:18,weekend:19,weekend_friday:20,weekend_saturday:21,dateFormat:22,inclusiveEndDates:23,topAxis:24,axisFormat:25,tickInterval:26,excludes:27,includes:28,todayMarker:29,title:30,acc_title:31,acc_title_value:32,acc_descr:33,acc_descr_value:34,acc_descr_multiline_value:35,section:36,clickStatement:37,taskTxt:38,taskData:39,click:40,callbackname:41,callbackargs:42,href:43,clickStatementDebug:44,$accept:0,$end:1},terminals_:{2:"error",4:"gantt",6:"EOF",8:"SPACE",10:"NL",12:"weekday_monday",13:"weekday_tuesday",14:"weekday_wednesday",15:"weekday_thursday",16:"weekday_friday",17:"weekday_saturday",18:"weekday_sunday",20:"weekend_friday",21:"weekend_saturday",22:"dateFormat",23:"inclusiveEndDates",24:"topAxis",25:"axisFormat",26:"tickInterval",27:"excludes",28:"includes",29:"todayMarker",30:"title",31:"acc_title",32:"acc_title_value",33:"acc_descr",34:"acc_descr_value",35:"acc_descr_multiline_value",36:"section",38:"taskTxt",39:"taskData",40:"click",41:"callbackname",42:"callbackargs",43:"href"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[11,1],[11,1],[11,1],[11,1],[11,1],[11,1],[11,1],[19,1],[19,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,1],[9,2],[37,2],[37,3],[37,3],[37,4],[37,3],[37,4],[37,2],[44,2],[44,3],[44,3],[44,4],[44,3],[44,4],[44,2]],performAction:x(function(S,R,N,D,I,$,B){var P=$.length-1;switch(I){case 1:return $[P-1];case 2:this.$=[];break;case 3:$[P-1].push($[P]),this.$=$[P-1];break;case 4:case 5:this.$=$[P];break;case 6:case 7:this.$=[];break;case 8:D.setWeekday("monday");break;case 9:D.setWeekday("tuesday");break;case 10:D.setWeekday("wednesday");break;case 11:D.setWeekday("thursday");break;case 12:D.setWeekday("friday");break;case 13:D.setWeekday("saturday");break;case 14:D.setWeekday("sunday");break;case 15:D.setWeekend("friday");break;case 16:D.setWeekend("saturday");break;case 17:D.setDateFormat($[P].substr(11)),this.$=$[P].substr(11);break;case 18:D.enableInclusiveEndDates(),this.$=$[P].substr(18);break;case 19:D.TopAxis(),this.$=$[P].substr(8);break;case 20:D.setAxisFormat($[P].substr(11)),this.$=$[P].substr(11);break;case 21:D.setTickInterval($[P].substr(13)),this.$=$[P].substr(13);break;case 22:D.setExcludes($[P].substr(9)),this.$=$[P].substr(9);break;case 23:D.setIncludes($[P].substr(9)),this.$=$[P].substr(9);break;case 24:D.setTodayMarker($[P].substr(12)),this.$=$[P].substr(12);break;case 27:D.setDiagramTitle($[P].substr(6)),this.$=$[P].substr(6);break;case 28:this.$=$[P].trim(),D.setAccTitle(this.$);break;case 29:case 30:this.$=$[P].trim(),D.setAccDescription(this.$);break;case 31:D.addSection($[P].substr(8)),this.$=$[P].substr(8);break;case 33:D.addTask($[P-1],$[P]),this.$="task";break;case 34:this.$=$[P-1],D.setClickEvent($[P-1],$[P],null);break;case 35:this.$=$[P-2],D.setClickEvent($[P-2],$[P-1],$[P]);break;case 36:this.$=$[P-2],D.setClickEvent($[P-2],$[P-1],null),D.setLink($[P-2],$[P]);break;case 37:this.$=$[P-3],D.setClickEvent($[P-3],$[P-2],$[P-1]),D.setLink($[P-3],$[P]);break;case 38:this.$=$[P-2],D.setClickEvent($[P-2],$[P],null),D.setLink($[P-2],$[P-1]);break;case 39:this.$=$[P-3],D.setClickEvent($[P-3],$[P-1],$[P]),D.setLink($[P-3],$[P-2]);break;case 40:this.$=$[P-1],D.setLink($[P-1],$[P]);break;case 41:case 47:this.$=$[P-1]+" "+$[P];break;case 42:case 43:case 45:this.$=$[P-2]+" "+$[P-1]+" "+$[P];break;case 44:case 46:this.$=$[P-3]+" "+$[P-2]+" "+$[P-1]+" "+$[P];break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:17,12:r,13:n,14:i,15:a,16:s,17:o,18:l,19:18,20:u,21:h,22:d,23:f,24:p,25:g,26:m,27:y,28:v,29:T,30:b,31:w,33:k,35:A,36:C,37:24,38:_,40:L},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:36,11:17,12:r,13:n,14:i,15:a,16:s,17:o,18:l,19:18,20:u,21:h,22:d,23:f,24:p,25:g,26:m,27:y,28:v,29:T,30:b,31:w,33:k,35:A,36:C,37:24,38:_,40:L},t(e,[2,5]),t(e,[2,6]),t(e,[2,17]),t(e,[2,18]),t(e,[2,19]),t(e,[2,20]),t(e,[2,21]),t(e,[2,22]),t(e,[2,23]),t(e,[2,24]),t(e,[2,25]),t(e,[2,26]),t(e,[2,27]),{32:[1,37]},{34:[1,38]},t(e,[2,30]),t(e,[2,31]),t(e,[2,32]),{39:[1,39]},t(e,[2,8]),t(e,[2,9]),t(e,[2,10]),t(e,[2,11]),t(e,[2,12]),t(e,[2,13]),t(e,[2,14]),t(e,[2,15]),t(e,[2,16]),{41:[1,40],43:[1,41]},t(e,[2,4]),t(e,[2,28]),t(e,[2,29]),t(e,[2,33]),t(e,[2,34],{42:[1,42],43:[1,43]}),t(e,[2,40],{41:[1,44]}),t(e,[2,35],{43:[1,45]}),t(e,[2,36]),t(e,[2,38],{42:[1,46]}),t(e,[2,37]),t(e,[2,39])],defaultActions:{},parseError:x(function(S,R){if(R.recoverable)this.trace(S);else{var N=new Error(S);throw N.hash=R,N}},"parseError"),parse:x(function(S){var R=this,N=[0],D=[],I=[null],$=[],B=this.table,P="",G=0,V=0,Y=2,W=1,ie=$.slice.call(arguments,1),K=Object.create(this.lexer),se={yy:{}};for(var J in this.yy)Object.prototype.hasOwnProperty.call(this.yy,J)&&(se.yy[J]=this.yy[J]);K.setInput(S,se.yy),se.yy.lexer=K,se.yy.parser=this,typeof K.yylloc>"u"&&(K.yylloc={});var Z=K.yylloc;$.push(Z);var ee=K.options&&K.options.ranges;typeof se.yy.parseError=="function"?this.parseError=se.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ne(Ve){N.length=N.length-2*Ve,I.length=I.length-Ve,$.length=$.length-Ve}x(ne,"popStack");function ue(){var Ve;return Ve=D.pop()||K.lex()||W,typeof Ve!="number"&&(Ve instanceof Array&&(D=Ve,Ve=D.pop()),Ve=R.symbols_[Ve]||Ve),Ve}x(ue,"lex");for(var fe,_e,Ae,Ne,me={},ve,Ge,Te,Ze;;){if(_e=N[N.length-1],this.defaultActions[_e]?Ae=this.defaultActions[_e]:((fe===null||typeof fe>"u")&&(fe=ue()),Ae=B[_e]&&B[_e][fe]),typeof Ae>"u"||!Ae.length||!Ae[0]){var ke="";Ze=[];for(ve in B[_e])this.terminals_[ve]&&ve>Y&&Ze.push("'"+this.terminals_[ve]+"'");K.showPosition?ke="Parse error on line "+(G+1)+`: -`+K.showPosition()+` -Expecting `+Ze.join(", ")+", got '"+(this.terminals_[fe]||fe)+"'":ke="Parse error on line "+(G+1)+": Unexpected "+(fe==W?"end of input":"'"+(this.terminals_[fe]||fe)+"'"),this.parseError(ke,{text:K.match,token:this.terminals_[fe]||fe,line:K.yylineno,loc:Z,expected:Ze})}if(Ae[0]instanceof Array&&Ae.length>1)throw new Error("Parse Error: multiple actions possible at state: "+_e+", token: "+fe);switch(Ae[0]){case 1:N.push(fe),I.push(K.yytext),$.push(K.yylloc),N.push(Ae[1]),fe=null,V=K.yyleng,P=K.yytext,G=K.yylineno,Z=K.yylloc;break;case 2:if(Ge=this.productions_[Ae[1]][1],me.$=I[I.length-Ge],me._$={first_line:$[$.length-(Ge||1)].first_line,last_line:$[$.length-1].last_line,first_column:$[$.length-(Ge||1)].first_column,last_column:$[$.length-1].last_column},ee&&(me._$.range=[$[$.length-(Ge||1)].range[0],$[$.length-1].range[1]]),Ne=this.performAction.apply(me,[P,V,G,se.yy,Ae[1],I,$].concat(ie)),typeof Ne<"u")return Ne;Ge&&(N=N.slice(0,-1*Ge*2),I=I.slice(0,-1*Ge),$=$.slice(0,-1*Ge)),N.push(this.productions_[Ae[1]][0]),I.push(me.$),$.push(me._$),Te=B[N[N.length-2]][N[N.length-1]],N.push(Te);break;case 3:return!0}}return!0},"parse")},M=(function(){var F={EOF:1,parseError:x(function(R,N){if(this.yy.parser)this.yy.parser.parseError(R,N);else throw new Error(R)},"parseError"),setInput:x(function(S,R){return this.yy=R||this.yy||{},this._input=S,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:x(function(){var S=this._input[0];this.yytext+=S,this.yyleng++,this.offset++,this.match+=S,this.matched+=S;var R=S.match(/(?:\r\n?|\n).*/g);return R?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),S},"input"),unput:x(function(S){var R=S.length,N=S.split(/(?:\r\n?|\n)/g);this._input=S+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-R),this.offset-=R;var D=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),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===D.length?this.yylloc.first_column:0)+D[D.length-N.length].length-N[0].length:this.yylloc.first_column-R},this.options.ranges&&(this.yylloc.range=[I[0],I[0]+this.yyleng-R]),this.yyleng=this.yytext.length,this},"unput"),more:x(function(){return this._more=!0,this},"more"),reject:x(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). -`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:x(function(S){this.unput(this.match.slice(S))},"less"),pastInput:x(function(){var S=this.matched.substr(0,this.matched.length-this.match.length);return(S.length>20?"...":"")+S.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:x(function(){var S=this.match;return S.length<20&&(S+=this._input.substr(0,20-S.length)),(S.substr(0,20)+(S.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:x(function(){var S=this.pastInput(),R=new Array(S.length+1).join("-");return S+this.upcomingInput()+` -`+R+"^"},"showPosition"),test_match:x(function(S,R){var N,D,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))),D=S[0].match(/(?:\r\n?|\n).*/g),D&&(this.yylineno+=D.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:D?D[D.length-1].length-D[D.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+S[0].length},this.yytext+=S[0],this.match+=S[0],this.matches=S,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(S[0].length),this.matched+=S[0],N=this.performAction.call(this,this.yy,this,R,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),N)return N;if(this._backtrack){for(var $ in I)this[$]=I[$];return!1}return!1},"test_match"),next:x(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var S,R,N,D;this._more||(this.yytext="",this.match="");for(var I=this._currentRules(),$=0;$R[0].length)){if(R=N,D=$,this.options.backtrack_lexer){if(S=this.test_match(N,I[$]),S!==!1)return S;if(this._backtrack){R=!1;continue}else return!1}else if(!this.options.flex)break}return R?(S=this.test_match(R,I[D]),S!==!1?S:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var R=this.next();return R||this.lex()},"lex"),begin:x(function(R){this.conditionStack.push(R)},"begin"),popState:x(function(){var R=this.conditionStack.length-1;return R>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(R){return R=this.conditionStack.length-1-Math.abs(R||0),R>=0?this.conditionStack[R]:"INITIAL"},"topState"),pushState:x(function(R){this.begin(R)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:x(function(R,N,D,I){switch(D){case 0:return this.begin("open_directive"),"open_directive";case 1:return this.begin("acc_title"),31;case 2:return this.popState(),"acc_title_value";case 3:return this.begin("acc_descr"),33;case 4:return this.popState(),"acc_descr_value";case 5:this.begin("acc_descr_multiline");break;case 6:this.popState();break;case 7:return"acc_descr_multiline_value";case 8:break;case 9:break;case 10:break;case 11:return 10;case 12:break;case 13:break;case 14:this.begin("href");break;case 15:this.popState();break;case 16:return 43;case 17:this.begin("callbackname");break;case 18:this.popState();break;case 19:this.popState(),this.begin("callbackargs");break;case 20:return 41;case 21:this.popState();break;case 22:return 42;case 23:this.begin("click");break;case 24:this.popState();break;case 25:return 40;case 26:return 4;case 27:return 22;case 28:return 23;case 29:return 24;case 30:return 25;case 31:return 26;case 32:return 28;case 33:return 27;case 34:return 29;case 35:return 12;case 36:return 13;case 37:return 14;case 38:return 15;case 39:return 16;case 40:return 17;case 41:return 18;case 42:return 20;case 43:return 21;case 44:return"date";case 45:return 30;case 46:return"accDescription";case 47:return 36;case 48:return 38;case 49:return 39;case 50:return":";case 51:return 6;case 52:return"INVALID"}},"anonymous"),rules:[/^(?:%%\{)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:%%(?!\{)*[^\n]*)/i,/^(?:[^\}]%%*[^\n]*)/i,/^(?:%%*[^\n]*[\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:%[^\n]*)/i,/^(?:href[\s]+["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:call[\s]+)/i,/^(?:\([\s]*\))/i,/^(?:\()/i,/^(?:[^(]*)/i,/^(?:\))/i,/^(?:[^)]*)/i,/^(?:click[\s]+)/i,/^(?:[\s\n])/i,/^(?:[^\s\n]*)/i,/^(?:gantt\b)/i,/^(?:dateFormat\s[^#\n;]+)/i,/^(?:inclusiveEndDates\b)/i,/^(?:topAxis\b)/i,/^(?:axisFormat\s[^#\n;]+)/i,/^(?:tickInterval\s[^#\n;]+)/i,/^(?:includes\s[^#\n;]+)/i,/^(?:excludes\s[^#\n;]+)/i,/^(?:todayMarker\s[^\n;]+)/i,/^(?:weekday\s+monday\b)/i,/^(?:weekday\s+tuesday\b)/i,/^(?:weekday\s+wednesday\b)/i,/^(?:weekday\s+thursday\b)/i,/^(?:weekday\s+friday\b)/i,/^(?:weekday\s+saturday\b)/i,/^(?:weekday\s+sunday\b)/i,/^(?:weekend\s+friday\b)/i,/^(?:weekend\s+saturday\b)/i,/^(?:\d\d\d\d-\d\d-\d\d\b)/i,/^(?:title\s[^\n]+)/i,/^(?:accDescription\s[^#\n;]+)/i,/^(?:section\s[^\n]+)/i,/^(?:[^:\n]+)/i,/^(?::[^#\n;]+)/i,/^(?::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[6,7],inclusive:!1},acc_descr:{rules:[4],inclusive:!1},acc_title:{rules:[2],inclusive:!1},callbackargs:{rules:[21,22],inclusive:!1},callbackname:{rules:[18,19,20],inclusive:!1},href:{rules:[15,16],inclusive:!1},click:{rules:[24,25],inclusive:!1},INITIAL:{rules:[0,1,3,5,8,9,10,11,12,13,14,17,23,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52],inclusive:!0}}};return F})();O.lexer=M;function z(){this.yy={}}return x(z,"Parser"),z.prototype=O,O.Parser=z,new z})();VO.parser=VO;var Nst=VO;Yi.extend(Tst),Yi.extend(Est),Yi.extend(Rst);var tge={friday:5,saturday:6},ic="",WO="",UO=void 0,HO="",qT=[],VT=[],YO=new Map,XO=[],fS=[],jg="",KO="",rge=["active","done","crit","milestone","vert"],jO=[],Zg="",WT=!1,ZO=!1,QO="sunday",pS="saturday",JO=0,Ost=x(function(){XO=[],fS=[],jg="",jO=[],gS=0,t$=void 0,mS=void 0,Ui=[],ic="",WO="",KO="",UO=void 0,HO="",qT=[],VT=[],WT=!1,ZO=!1,JO=0,YO=new Map,Zg="",In(),QO="sunday",pS="saturday"},"clear"),$st=x(function(t){Zg=t},"setDiagramId"),Pst=x(function(t){WO=t},"setAxisFormat"),Bst=x(function(){return WO},"getAxisFormat"),Fst=x(function(t){UO=t},"setTickInterval"),zst=x(function(){return UO},"getTickInterval"),Gst=x(function(t){HO=t},"setTodayMarker"),qst=x(function(){return HO},"getTodayMarker"),Vst=x(function(t){ic=t},"setDateFormat"),Wst=x(function(){WT=!0},"enableInclusiveEndDates"),Ust=x(function(){return WT},"endDatesAreInclusive"),Hst=x(function(){ZO=!0},"enableTopAxis"),Yst=x(function(){return ZO},"topAxisEnabled"),Xst=x(function(t){KO=t},"setDisplayMode"),Kst=x(function(){return KO},"getDisplayMode"),jst=x(function(){return ic},"getDateFormat"),Zst=x(function(t){qT=t.toLowerCase().split(/[\s,]+/)},"setIncludes"),Qst=x(function(){return qT},"getIncludes"),Jst=x(function(t){VT=t.toLowerCase().split(/[\s,]+/)},"setExcludes"),eot=x(function(){return VT},"getExcludes"),tot=x(function(){return YO},"getLinks"),rot=x(function(t){jg=t,XO.push(t)},"addSection"),not=x(function(){return XO},"getSections"),iot=x(function(){let t=lge();const e=10;let r=0;for(;!t&&ro))throw new Error("Failed to find a valid date that was not excluded by `excludes` after 10,000 iterations.");t=t.add(1,"d")}return[e,s]},"fixTaskDates"),e$=x(function(t,e,r){if(r=r.trim(),x(o=>{const l=o.trim();return l==="x"||l==="X"},"isTimestampFormat")(e)&&/^\d+$/.test(r))return new Date(Number(r));const a=/^after\s+(?[\d\w- ]+)/.exec(r);if(a!==null){let o=null;for(const u of a.groups.ids.split(" ")){let h=Qf(u);h!==void 0&&(!o||h.endTime>o.endTime)&&(o=h)}if(o)return o.endTime;const l=new Date;return l.setHours(0,0,0,0),l}let s=Yi(r,e.trim(),!0);if(s.isValid())return s.toDate();{ae.debug("Invalid date:"+r),ae.debug("With date format:"+e.trim());const o=new Date(r);if(o===void 0||isNaN(o.getTime())||o.getFullYear()<-1e4||o.getFullYear()>1e4)throw new Error("Invalid date:"+r);return o}},"getStartDate"),age=x(function(t){const e=/^(\d+(?:\.\d+)?)([Mdhmswy]|ms)$/.exec(t.trim());return e!==null?[Number.parseFloat(e[1]),e[2]]:[NaN,"ms"]},"parseDuration"),sge=x(function(t,e,r,n=!1){r=r.trim();const a=/^until\s+(?[\d\w- ]+)/.exec(r);if(a!==null){let h=null;for(const f of a.groups.ids.split(" ")){let p=Qf(f);p!==void 0&&(!h||p.startTime{window.open(r,"_self")}),YO.set(n,r))}),cge(t,"clickable")},"setLink"),cge=x(function(t,e){t.split(",").forEach(function(r){let n=Qf(r);n!==void 0&&n.classes.push(e)})},"setClass"),pot=x(function(t,e,r){if(Pe().securityLevel!=="loose"||e===void 0)return;let n=[];if(typeof r=="string"){n=r.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let a=0;a{Lr.runFunc(e,...n)})},"setClickFun"),uge=x(function(t,e){jO.push(function(){const r=Zg?`${Zg}-${t}`:t,n=document.querySelector(`[id="${r}"]`);n!==null&&n.addEventListener("click",function(){e()})},function(){const r=Zg?`${Zg}-${t}`:t,n=document.querySelector(`[id="${r}-text"]`);n!==null&&n.addEventListener("click",function(){e()})})},"pushFun"),got=x(function(t,e,r){t.split(",").forEach(function(n){pot(n,e,r)}),cge(t,"clickable")},"setClickEvent"),mot=x(function(t){jO.forEach(function(e){e(t)})},"bindFunctions"),yot={getConfig:x(()=>Pe().gantt,"getConfig"),clear:Ost,setDateFormat:Vst,getDateFormat:jst,enableInclusiveEndDates:Wst,endDatesAreInclusive:Ust,enableTopAxis:Hst,topAxisEnabled:Yst,setAxisFormat:Pst,getAxisFormat:Bst,setTickInterval:Fst,getTickInterval:zst,setTodayMarker:Gst,getTodayMarker:qst,setAccTitle:Dn,getAccTitle:Fn,setDiagramTitle:qn,getDiagramTitle:Mn,setDiagramId:$st,setDisplayMode:Xst,getDisplayMode:Kst,setAccDescription:zn,getAccDescription:Gn,addSection:rot,getSections:not,getTasks:iot,addTask:hot,findTaskById:Qf,addTaskOrg:dot,setIncludes:Zst,getIncludes:Qst,setExcludes:Jst,getExcludes:eot,setClickEvent:got,setLink:fot,getLinks:tot,bindFunctions:mot,parseDuration:age,isInvalidDate:nge,setWeekday:aot,getWeekday:sot,setWeekend:oot};function r$(t,e,r){let n=!0;for(;n;)n=!1,r.forEach(function(i){const a="^\\s*"+i+"\\s*$",s=new RegExp(a);t[0].match(s)&&(e[i]=!0,t.shift(1),n=!0)})}x(r$,"getTaskTags"),Yi.extend(Mst);var vot=x(function(){ae.debug("Something is calling, setConf, remove the call")},"setConf"),hge={monday:S2,tuesday:YF,wednesday:XF,thursday:td,friday:KF,saturday:jF,sunday:E2},bot=x((t,e)=>{let r=[...t].map(()=>-1/0),n=[...t].sort((a,s)=>a.startTime-s.startTime||a.order-s.order),i=0;for(const a of n)for(let s=0;s=r[s]){r[s]=a.endTime,a.order=s+e,s>i&&(i=s);break}return i},"getMaxIntersections"),du,n$=1e4,xot=x(function(t,e,r,n){const i=Pe().gantt;n.db.setDiagramId(e);const a=Pe().securityLevel;let s;a==="sandbox"&&(s=pt("#i"+e));const o=pt(a==="sandbox"?s.nodes()[0].contentDocument.body:"body"),l=a==="sandbox"?s.nodes()[0].contentDocument:document,u=l.getElementById(e);du=u.parentElement.offsetWidth,du===void 0&&(du=1200),i.useWidth!==void 0&&(du=i.useWidth);const h=n.db.getTasks();let d=[];for(const L of h)d.push(L.type);d=_(d);const f={};let p=2*i.topPadding;if(n.db.getDisplayMode()==="compact"||i.displayMode==="compact"){const L={};for(const M of h)L[M.section]===void 0?L[M.section]=[M]:L[M.section].push(M);let O=0;for(const M of Object.keys(L)){const z=bot(L[M],O)+1;O+=z,p+=z*(i.barHeight+i.barGap),f[M]=z}}else{p+=h.length*(i.barHeight+i.barGap);for(const L of d)f[L]=h.filter(O=>O.type===L).length}u.setAttribute("viewBox","0 0 "+du+" "+p);const g=o.select(`[id="${e}"]`),m=_3e().domain([Fxe(h,function(L){return L.startTime}),Bxe(h,function(L){return L.endTime})]).rangeRound([0,du-i.leftPadding-i.rightPadding]);function y(L,O){const M=L.startTime,z=O.startTime;let F=0;return M>z?F=1:MP.vert===G.vert?0:P.vert?1:-1);const D=[...new Set(L.map(P=>P.order))].map(P=>L.find(G=>G.order===P));g.append("g").selectAll("rect").data(D).enter().append("rect").attr("x",0).attr("y",function(P,G){return G=P.order,G*O+M-2}).attr("width",function(){return R-i.rightPadding/2}).attr("height",O).attr("class",function(P){for(const[G,V]of d.entries())if(P.type===V)return"section section"+G%i.numberSectionStyles;return"section section0"}).enter();const I=g.append("g").selectAll("rect").data(L).enter(),$=n.db.getLinks();if(I.append("rect").attr("id",function(P){return e+"-"+P.id}).attr("rx",3).attr("ry",3).attr("x",function(P){return P.milestone?m(P.startTime)+z+.5*(m(P.endTime)-m(P.startTime))-.5*F:m(P.startTime)+z}).attr("y",function(P,G){return G=P.order,P.vert?i.gridLineStartPadding:G*O+M}).attr("width",function(P){return P.milestone?F:P.vert?.08*F:m(P.renderEndTime||P.endTime)-m(P.startTime)}).attr("height",function(P){return P.vert?h.length*(i.barHeight+i.barGap)+i.barHeight*2:F}).attr("transform-origin",function(P,G){return G=P.order,(m(P.startTime)+z+.5*(m(P.endTime)-m(P.startTime))).toString()+"px "+(G*O+M+.5*F).toString()+"px"}).attr("class",function(P){const G="task";let V="";P.classes.length>0&&(V=P.classes.join(" "));let Y=0;for(const[ie,K]of d.entries())P.type===K&&(Y=ie%i.numberSectionStyles);let W="";return P.active?P.crit?W+=" activeCrit":W=" active":P.done?P.crit?W=" doneCrit":W=" done":P.crit&&(W+=" crit"),W.length===0&&(W=" task"),P.milestone&&(W=" milestone "+W),P.vert&&(W=" vert "+W),W+=Y,W+=" "+V,G+W}),I.append("text").attr("id",function(P){return e+"-"+P.id+"-text"}).text(function(P){return P.task}).attr("font-size",i.fontSize).attr("x",function(P){let G=m(P.startTime),V=m(P.renderEndTime||P.endTime);if(P.milestone&&(G+=.5*(m(P.endTime)-m(P.startTime))-.5*F,V=G+F),P.vert)return m(P.startTime)+z;const Y=this.getBBox().width;return Y>V-G?V+Y+1.5*i.leftPadding>R?G+z-5:V+z+5:(V-G)/2+G+z}).attr("y",function(P,G){return P.vert?i.gridLineStartPadding+h.length*(i.barHeight+i.barGap)+60:(G=P.order,G*O+i.barHeight/2+(i.fontSize/2-2)+M)}).attr("text-height",F).attr("class",function(P){const G=m(P.startTime);let V=m(P.endTime);P.milestone&&(V=G+F);const Y=this.getBBox().width;let W="";P.classes.length>0&&(W=P.classes.join(" "));let ie=0;for(const[se,J]of d.entries())P.type===J&&(ie=se%i.numberSectionStyles);let K="";return P.active&&(P.crit?K="activeCritText"+ie:K="activeText"+ie),P.done?P.crit?K=K+" doneCritText"+ie:K=K+" doneText"+ie:P.crit&&(K=K+" critText"+ie),P.milestone&&(K+=" milestoneText"),P.vert&&(K+=" vertText"),Y>V-G?V+Y+1.5*i.leftPadding>R?W+" taskTextOutsideLeft taskTextOutside"+ie+" "+K:W+" taskTextOutsideRight taskTextOutside"+ie+" "+K+" width-"+Y:W+" taskText taskText"+ie+" "+K+" width-"+Y}),Pe().securityLevel==="sandbox"){let P;P=pt("#i"+e);const G=P.nodes()[0].contentDocument;I.filter(function(V){return $.has(V.id)}).each(function(V){var Y=G.querySelector("#"+CSS.escape(e+"-"+V.id)),W=G.querySelector("#"+CSS.escape(e+"-"+V.id+"-text"));const ie=Y.parentNode;var K=G.createElement("a");K.setAttribute("xlink:href",$.get(V.id)),K.setAttribute("target","_top"),ie.appendChild(K),K.appendChild(Y),K.appendChild(W)})}}x(T,"drawRects");function b(L,O,M,z,F,S,R,N){if(R.length===0&&N.length===0)return;let D,I;for(const{startTime:Y,endTime:W}of S)(D===void 0||YI)&&(I=W);if(!D||!I)return;if(Yi(I).diff(Yi(D),"year")>5){ae.warn("The difference between the min and max time is more than 5 years. This will cause performance issues. Skipping drawing exclude days.");return}const $=n.db.getDateFormat(),B=[];let P=null,G=Yi(D);for(;G.valueOf()<=I;)n.db.isInvalidDate(G,$,R,N)?P?P.end=G:P={start:G,end:G}:P&&(B.push(P),P=null),G=G.add(1,"d");g.append("g").selectAll("rect").data(B).enter().append("rect").attr("id",Y=>e+"-exclude-"+Y.start.format("YYYY-MM-DD")).attr("x",Y=>m(Y.start.startOf("day"))+M).attr("y",i.gridLineStartPadding).attr("width",Y=>m(Y.end.endOf("day"))-m(Y.start.startOf("day"))).attr("height",F-O-i.gridLineStartPadding).attr("transform-origin",function(Y,W){return(m(Y.start)+M+.5*(m(Y.end)-m(Y.start))).toString()+"px "+(W*L+.5*F).toString()+"px"}).attr("class","exclude-range")}x(b,"drawExcludeDays");function w(L,O,M,z){if(M<=0||L>O)return 1/0;const F=O-L,S=Yi.duration({[z??"day"]:M}).asMilliseconds();return S<=0?1/0:Math.ceil(F/S)}x(w,"getEstimatedTickCount");function k(L,O,M,z){const F=n.db.getDateFormat(),S=n.db.getAxisFormat();let R;S?R=S:F==="D"?R="%d":R=i.axisFormat??"%Y-%m-%d";let N=Xxe(m).tickSize(-z+O+i.gridLineStartPadding).tickFormat(l4(R));const I=/^([1-9]\d*)(millisecond|second|minute|hour|day|week|month)$/.exec(n.db.getTickInterval()||i.tickInterval);if(I!==null){const $=parseInt(I[1],10);if(isNaN($)||$<=0)ae.warn(`Invalid tick interval value: "${I[1]}". Skipping custom tick interval.`);else{const B=I[2],P=n.db.getWeekday()||i.weekday,G=m.domain(),V=G[0],Y=G[1],W=w(V,Y,$,B);if(W>n$)ae.warn(`The tick interval "${$}${B}" would generate ${W} ticks, which exceeds the maximum allowed (${n$}). This may indicate an invalid date or time range. Skipping custom tick interval.`);else switch(B){case"millisecond":N.ticks(M0.every($));break;case"second":N.ticks(Su.every($));break;case"minute":N.ticks(C2.every($));break;case"hour":N.ticks(k2.every($));break;case"day":N.ticks(Jh.every($));break;case"week":N.ticks(hge[P].every($));break;case"month":N.ticks(A2.every($));break}}}if(g.append("g").attr("class","grid").attr("transform","translate("+L+", "+(z-50)+")").call(N).selectAll("text").style("text-anchor","middle").attr("fill","#000").attr("stroke","none").attr("font-size",10).attr("dy","1em"),n.db.topAxisEnabled()||i.topAxis){let $=Yxe(m).tickSize(-z+O+i.gridLineStartPadding).tickFormat(l4(R));if(I!==null){const B=parseInt(I[1],10);if(isNaN(B)||B<=0)ae.warn(`Invalid tick interval value: "${I[1]}". Skipping custom tick interval.`);else{const P=I[2],G=n.db.getWeekday()||i.weekday,V=m.domain(),Y=V[0],W=V[1];if(w(Y,W,B,P)<=n$)switch(P){case"millisecond":$.ticks(M0.every(B));break;case"second":$.ticks(Su.every(B));break;case"minute":$.ticks(C2.every(B));break;case"hour":$.ticks(k2.every(B));break;case"day":$.ticks(Jh.every(B));break;case"week":$.ticks(hge[G].every(B));break;case"month":$.ticks(A2.every(B));break}}}g.append("g").attr("class","grid").attr("transform","translate("+L+", "+O+")").call($).selectAll("text").style("text-anchor","middle").attr("fill","#000").attr("stroke","none").attr("font-size",10)}}x(k,"makeGrid");function A(L,O){let M=0;const z=Object.keys(f).map(F=>[F,f[F]]);g.append("g").selectAll("text").data(z).enter().append(function(F){const S=F[0].split(Lt.lineBreakRegex),R=-(S.length-1)/2,N=l.createElementNS("http://www.w3.org/2000/svg","text");N.setAttribute("dy",R+"em");for(const[D,I]of S.entries()){const $=l.createElementNS("http://www.w3.org/2000/svg","tspan");$.setAttribute("alignment-baseline","central"),$.setAttribute("x","10"),D>0&&$.setAttribute("dy","1em"),$.textContent=I,N.appendChild($)}return N}).attr("x",10).attr("y",function(F,S){if(S>0)for(let R=0;R` +`},"getStyles"),tgt=egt,rgt={parser:E0t,db:lxe,renderer:H0t,styles:tgt};const ngt=Object.freeze(Object.defineProperty({__proto__:null,diagram:rgt},Symbol.toStringTag,{value:"Module"}));var lA={exports:{}},igt=lA.exports,pxe;function agt(){return pxe||(pxe=1,(function(t,e){(function(r,n){t.exports=n()})(igt,(function(){var r="day";return function(n,i,a){var s=function(u){return u.add(4-u.isoWeekday(),r)},o=i.prototype;o.isoWeekYear=function(){return s(this).year()},o.isoWeek=function(u){if(!this.$utils().u(u))return this.add(7*(u-this.isoWeek()),r);var h,d,f,p,g=s(this),m=(h=this.isoWeekYear(),d=this.$u,f=(d?a.utc:a)().year(h).startOf("year"),p=4-f.isoWeekday(),f.isoWeekday()>4&&(p+=7),f.add(p,r));return g.diff(m,"week")+1},o.isoWeekday=function(u){return this.$utils().u(u)?this.day()||7:this.day(this.day()%7?u:u-7)};var l=o.startOf;o.startOf=function(u,h){var d=this.$utils(),f=!!d.u(h)||h;return d.p(u)==="isoweek"?f?this.date(this.date()-(this.isoWeekday()-1)).startOf("day"):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf("day"):l.bind(this)(u,h)}}}))})(lA)),lA.exports}var sgt=agt();const ogt=po(sgt);var cA={exports:{}},lgt=cA.exports,gxe;function cgt(){return gxe||(gxe=1,(function(t,e){(function(r,n){t.exports=n()})(lgt,(function(){var r={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},n=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,i=/\d/,a=/\d\d/,s=/\d\d?/,o=/\d*[^-_:/,()\s\d]+/,l={},u=function(y){return(y=+y)+(y>68?1900:2e3)},h=function(y){return function(v){this[y]=+v}},d=[/[+-]\d\d:?(\d\d)?|Z/,function(y){(this.zone||(this.zone={})).offset=(function(v){if(!v||v==="Z")return 0;var x=v.match(/([+-]|\d\d)/g),b=60*x[1]+(+x[2]||0);return b===0?0:x[0]==="+"?-b:b})(y)}],f=function(y){var v=l[y];return v&&(v.indexOf?v:v.s.concat(v.f))},p=function(y,v){var x,b=l.meridiem;if(b){for(var w=1;w<=24;w+=1)if(y.indexOf(b(w,0,v))>-1){x=w>12;break}}else x=y===(v?"pm":"PM");return x},g={A:[o,function(y){this.afternoon=p(y,!1)}],a:[o,function(y){this.afternoon=p(y,!0)}],Q:[i,function(y){this.month=3*(y-1)+1}],S:[i,function(y){this.milliseconds=100*+y}],SS:[a,function(y){this.milliseconds=10*+y}],SSS:[/\d{3}/,function(y){this.milliseconds=+y}],s:[s,h("seconds")],ss:[s,h("seconds")],m:[s,h("minutes")],mm:[s,h("minutes")],H:[s,h("hours")],h:[s,h("hours")],HH:[s,h("hours")],hh:[s,h("hours")],D:[s,h("day")],DD:[a,h("day")],Do:[o,function(y){var v=l.ordinal,x=y.match(/\d+/);if(this.day=x[0],v)for(var b=1;b<=31;b+=1)v(b).replace(/\[|\]/g,"")===y&&(this.day=b)}],w:[s,h("week")],ww:[a,h("week")],M:[s,h("month")],MM:[a,h("month")],MMM:[o,function(y){var v=f("months"),x=(f("monthsShort")||v.map((function(b){return b.slice(0,3)}))).indexOf(y)+1;if(x<1)throw new Error;this.month=x%12||x}],MMMM:[o,function(y){var v=f("months").indexOf(y)+1;if(v<1)throw new Error;this.month=v%12||v}],Y:[/[+-]?\d+/,h("year")],YY:[a,function(y){this.year=u(y)}],YYYY:[/\d{4}/,h("year")],Z:d,ZZ:d};function m(y){var v,x;v=y,x=l&&l.formats;for(var b=(y=v.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function($,I,z){var F=z&&z.toUpperCase();return I||x[z]||r[z]||x[F].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(A,R,N){return R||N.slice(1)}))}))).match(n),w=b.length,C=0;C-1)return new Date((D==="X"?1e3:1)*M);var P=m(D)(M),G=P.year,V=P.month,H=P.day,W=P.hours,ie=P.minutes,j=P.seconds,ae=P.milliseconds,J=P.zone,K=P.week,Q=new Date,re=H||(G||V?1:Q.getDate()),le=G||Q.getFullYear(),fe=0;G&&!V||(fe=V>0?V-1:Q.getMonth());var Ae,Se=W||0,Ne=ie||0,ge=j||0,ve=ae||0;return J?new Date(Date.UTC(le,fe,re,Se,Ne,ge,ve+60*J.offset*1e3)):O?new Date(Date.UTC(le,fe,re,Se,Ne,ge,ve)):(Ae=new Date(le,fe,re,Se,Ne,ge,ve),K&&(Ae=B(Ae).week(K).toDate()),Ae)}catch{return new Date("")}})(_,L,k,x),this.init(),F&&F!==!0&&(this.$L=this.locale(F).$L),z&&_!=this.format(L)&&(this.$d=new Date("")),l={}}else if(L instanceof Array)for(var A=L.length,R=1;R<=A;R+=1){S[1]=L[R-1];var N=x.apply(this,S);if(N.isValid()){this.$d=N.$d,this.$L=N.$L,this.init();break}R===A&&(this.$d=new Date(""))}else w.call(this,C)}}}))})(cA)),cA.exports}var ugt=cgt();const hgt=po(ugt);var uA={exports:{}},dgt=uA.exports,mxe;function fgt(){return mxe||(mxe=1,(function(t,e){(function(r,n){t.exports=n()})(dgt,(function(){return function(r,n){var i=n.prototype,a=i.format;i.format=function(s){var o=this,l=this.$locale();if(!this.isValid())return a.bind(this)(s);var u=this.$utils(),h=(s||"YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g,(function(d){switch(d){case"Q":return Math.ceil((o.$M+1)/3);case"Do":return l.ordinal(o.$D);case"gggg":return o.weekYear();case"GGGG":return o.isoWeekYear();case"wo":return l.ordinal(o.week(),"W");case"w":case"ww":return u.s(o.week(),d==="w"?1:2,"0");case"W":case"WW":return u.s(o.isoWeek(),d==="W"?1:2,"0");case"k":case"kk":return u.s(String(o.$H===0?24:o.$H),d==="k"?1:2,"0");case"X":return Math.floor(o.$d.getTime()/1e3);case"x":return o.$d.getTime();case"z":return"["+o.offsetName()+"]";case"zzz":return"["+o.offsetName("long")+"]";default:return d}}));return a.bind(this)(h)}}}))})(uA)),uA.exports}var pgt=fgt();const ggt=po(pgt);var hA={exports:{}},mgt=hA.exports,yxe;function ygt(){return yxe||(yxe=1,(function(t,e){(function(r,n){t.exports=n()})(mgt,(function(){var r,n,i=1e3,a=6e4,s=36e5,o=864e5,l=31536e6,u=2628e6,h=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,d=/\[([^\]]+)]|YYYY|YY|Y|M{1,2}|D{1,2}|H{1,2}|m{1,2}|s{1,2}|SSS/g,f={years:l,months:u,days:o,hours:s,minutes:a,seconds:i,milliseconds:1,weeks:6048e5},p=function(_){return _ instanceof w},g=function(_,k,S){return new w(_,S,k.$l)},m=function(_){return n.p(_)+"s"},y=function(_){return _<0},v=function(_){return y(_)?Math.ceil(_):Math.floor(_)},x=function(_){return Math.abs(_)},b=function(_,k){return _?y(_)?{negative:!0,format:""+x(_)+k}:{negative:!1,format:""+_+k}:{negative:!1,format:""}},w=(function(){function _(S,L,$){var I=this;if(this.$d={},this.$l=$,S===void 0&&(this.$ms=0,this.parseFromMilliseconds()),L)return g(S*f[m(L)],this);if(typeof S=="number")return this.$ms=S,this.parseFromMilliseconds(),this;if(typeof S=="object")return Object.keys(S).forEach((function(A){I.$d[m(A)]=S[A]})),this.calMilliseconds(),this;if(typeof S=="string"){var z=S.match(h);if(z){var F=z.slice(2).map((function(A){return A!=null?Number(A):0}));return this.$d.years=F[0],this.$d.months=F[1],this.$d.weeks=F[2],this.$d.days=F[3],this.$d.hours=F[4],this.$d.minutes=F[5],this.$d.seconds=F[6],this.calMilliseconds(),this}}return this}var k=_.prototype;return k.calMilliseconds=function(){var S=this;this.$ms=Object.keys(this.$d).reduce((function(L,$){return L+(S.$d[$]||0)*f[$]}),0)},k.parseFromMilliseconds=function(){var S=this.$ms;this.$d.years=v(S/l),S%=l,this.$d.months=v(S/u),S%=u,this.$d.days=v(S/o),S%=o,this.$d.hours=v(S/s),S%=s,this.$d.minutes=v(S/a),S%=a,this.$d.seconds=v(S/i),S%=i,this.$d.milliseconds=S},k.toISOString=function(){var S=b(this.$d.years,"Y"),L=b(this.$d.months,"M"),$=+this.$d.days||0;this.$d.weeks&&($+=7*this.$d.weeks);var I=b($,"D"),z=b(this.$d.hours,"H"),F=b(this.$d.minutes,"M"),A=this.$d.seconds||0;this.$d.milliseconds&&(A+=this.$d.milliseconds/1e3,A=Math.round(1e3*A)/1e3);var R=b(A,"S"),N=S.negative||L.negative||I.negative||z.negative||F.negative||R.negative,M=z.format||F.format||R.format?"T":"",D=(N?"-":"")+"P"+S.format+L.format+I.format+M+z.format+F.format+R.format;return D==="P"||D==="-P"?"P0D":D},k.toJSON=function(){return this.toISOString()},k.format=function(S){var L=S||"YYYY-MM-DDTHH:mm:ss",$={Y:this.$d.years,YY:n.s(this.$d.years,2,"0"),YYYY:n.s(this.$d.years,4,"0"),M:this.$d.months,MM:n.s(this.$d.months,2,"0"),D:this.$d.days,DD:n.s(this.$d.days,2,"0"),H:this.$d.hours,HH:n.s(this.$d.hours,2,"0"),m:this.$d.minutes,mm:n.s(this.$d.minutes,2,"0"),s:this.$d.seconds,ss:n.s(this.$d.seconds,2,"0"),SSS:n.s(this.$d.milliseconds,3,"0")};return L.replace(d,(function(I,z){return z||String($[I])}))},k.as=function(S){return this.$ms/f[m(S)]},k.get=function(S){var L=this.$ms,$=m(S);return $==="milliseconds"?L%=1e3:L=$==="weeks"?v(L/f[$]):this.$d[$],L||0},k.add=function(S,L,$){var I;return I=L?S*f[m(L)]:p(S)?S.$ms:g(S,this).$ms,g(this.$ms+I*($?-1:1),this)},k.subtract=function(S,L){return this.add(S,L,!0)},k.locale=function(S){var L=this.clone();return L.$l=S,L},k.clone=function(){return g(this.$ms,this)},k.humanize=function(S){return r().add(this.$ms,"ms").locale(this.$l).fromNow(!S)},k.valueOf=function(){return this.asMilliseconds()},k.milliseconds=function(){return this.get("milliseconds")},k.asMilliseconds=function(){return this.as("milliseconds")},k.seconds=function(){return this.get("seconds")},k.asSeconds=function(){return this.as("seconds")},k.minutes=function(){return this.get("minutes")},k.asMinutes=function(){return this.as("minutes")},k.hours=function(){return this.get("hours")},k.asHours=function(){return this.as("hours")},k.days=function(){return this.get("days")},k.asDays=function(){return this.as("days")},k.weeks=function(){return this.get("weeks")},k.asWeeks=function(){return this.as("weeks")},k.months=function(){return this.get("months")},k.asMonths=function(){return this.as("months")},k.years=function(){return this.get("years")},k.asYears=function(){return this.as("years")},_})(),C=function(_,k,S){return _.add(k.years()*S,"y").add(k.months()*S,"M").add(k.days()*S,"d").add(k.hours()*S,"h").add(k.minutes()*S,"m").add(k.seconds()*S,"s").add(k.milliseconds()*S,"ms")};return function(_,k,S){r=S,n=S().$utils(),S.duration=function(I,z){var F=S.locale();return g(I,{$l:F},z)},S.isDuration=p;var L=k.prototype.add,$=k.prototype.subtract;k.prototype.add=function(I,z){return p(I)?C(this,I,1):L.bind(this)(I,z)},k.prototype.subtract=function(I,z){return p(I)?C(this,I,-1):$.bind(this)(I,z)}}}))})(hA)),hA.exports}var vgt=ygt();const bgt=po(vgt);var vz=(function(){var t=T(function(F,A,R,N){for(R=R||{},N=F.length;N--;R[F[N]]=A);return R},"o"),e=[6,8,10,12,13,14,15,16,17,18,20,21,22,23,24,25,26,27,28,29,30,31,33,35,36,38,40],r=[1,26],n=[1,27],i=[1,28],a=[1,29],s=[1,30],o=[1,31],l=[1,32],u=[1,33],h=[1,34],d=[1,9],f=[1,10],p=[1,11],g=[1,12],m=[1,13],y=[1,14],v=[1,15],x=[1,16],b=[1,19],w=[1,20],C=[1,21],_=[1,22],k=[1,23],S=[1,25],L=[1,35],$={trace:T(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:T(function(A,R,N,M,D,O,B){var P=O.length-1;switch(D){case 1:return O[P-1];case 2:this.$=[];break;case 3:O[P-1].push(O[P]),this.$=O[P-1];break;case 4:case 5:this.$=O[P];break;case 6:case 7:this.$=[];break;case 8:M.setWeekday("monday");break;case 9:M.setWeekday("tuesday");break;case 10:M.setWeekday("wednesday");break;case 11:M.setWeekday("thursday");break;case 12:M.setWeekday("friday");break;case 13:M.setWeekday("saturday");break;case 14:M.setWeekday("sunday");break;case 15:M.setWeekend("friday");break;case 16:M.setWeekend("saturday");break;case 17:M.setDateFormat(O[P].substr(11)),this.$=O[P].substr(11);break;case 18:M.enableInclusiveEndDates(),this.$=O[P].substr(18);break;case 19:M.TopAxis(),this.$=O[P].substr(8);break;case 20:M.setAxisFormat(O[P].substr(11)),this.$=O[P].substr(11);break;case 21:M.setTickInterval(O[P].substr(13)),this.$=O[P].substr(13);break;case 22:M.setExcludes(O[P].substr(9)),this.$=O[P].substr(9);break;case 23:M.setIncludes(O[P].substr(9)),this.$=O[P].substr(9);break;case 24:M.setTodayMarker(O[P].substr(12)),this.$=O[P].substr(12);break;case 27:M.setDiagramTitle(O[P].substr(6)),this.$=O[P].substr(6);break;case 28:this.$=O[P].trim(),M.setAccTitle(this.$);break;case 29:case 30:this.$=O[P].trim(),M.setAccDescription(this.$);break;case 31:M.addSection(O[P].substr(8)),this.$=O[P].substr(8);break;case 33:M.addTask(O[P-1],O[P]),this.$="task";break;case 34:this.$=O[P-1],M.setClickEvent(O[P-1],O[P],null);break;case 35:this.$=O[P-2],M.setClickEvent(O[P-2],O[P-1],O[P]);break;case 36:this.$=O[P-2],M.setClickEvent(O[P-2],O[P-1],null),M.setLink(O[P-2],O[P]);break;case 37:this.$=O[P-3],M.setClickEvent(O[P-3],O[P-2],O[P-1]),M.setLink(O[P-3],O[P]);break;case 38:this.$=O[P-2],M.setClickEvent(O[P-2],O[P],null),M.setLink(O[P-2],O[P-1]);break;case 39:this.$=O[P-3],M.setClickEvent(O[P-3],O[P-1],O[P]),M.setLink(O[P-3],O[P-2]);break;case 40:this.$=O[P-1],M.setLink(O[P-1],O[P]);break;case 41:case 47:this.$=O[P-1]+" "+O[P];break;case 42:case 43:case 45:this.$=O[P-2]+" "+O[P-1]+" "+O[P];break;case 44:case 46:this.$=O[P-3]+" "+O[P-2]+" "+O[P-1]+" "+O[P];break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:17,12:r,13:n,14:i,15:a,16:s,17:o,18:l,19:18,20:u,21:h,22:d,23:f,24:p,25:g,26:m,27:y,28:v,29:x,30:b,31:w,33:C,35:_,36:k,37:24,38:S,40:L},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:36,11:17,12:r,13:n,14:i,15:a,16:s,17:o,18:l,19:18,20:u,21:h,22:d,23:f,24:p,25:g,26:m,27:y,28:v,29:x,30:b,31:w,33:C,35:_,36:k,37:24,38:S,40:L},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:T(function(A,R){if(R.recoverable)this.trace(A);else{var N=new Error(A);throw N.hash=R,N}},"parseError"),parse:T(function(A){var R=this,N=[0],M=[],D=[null],O=[],B=this.table,P="",G=0,V=0,H=2,W=1,ie=O.slice.call(arguments,1),j=Object.create(this.lexer),ae={yy:{}};for(var J in this.yy)Object.prototype.hasOwnProperty.call(this.yy,J)&&(ae.yy[J]=this.yy[J]);j.setInput(A,ae.yy),ae.yy.lexer=j,ae.yy.parser=this,typeof j.yylloc>"u"&&(j.yylloc={});var K=j.yylloc;O.push(K);var Q=j.options&&j.options.ranges;typeof ae.yy.parseError=="function"?this.parseError=ae.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function re(Ve){N.length=N.length-2*Ve,D.length=D.length-Ve,O.length=O.length-Ve}T(re,"popStack");function le(){var Ve;return Ve=M.pop()||j.lex()||W,typeof Ve!="number"&&(Ve instanceof Array&&(M=Ve,Ve=M.pop()),Ve=R.symbols_[Ve]||Ve),Ve}T(le,"lex");for(var fe,Ae,Se,Ne,ge={},ve,ze,xe,Ke;;){if(Ae=N[N.length-1],this.defaultActions[Ae]?Se=this.defaultActions[Ae]:((fe===null||typeof fe>"u")&&(fe=le()),Se=B[Ae]&&B[Ae][fe]),typeof Se>"u"||!Se.length||!Se[0]){var Ce="";Ke=[];for(ve in B[Ae])this.terminals_[ve]&&ve>H&&Ke.push("'"+this.terminals_[ve]+"'");j.showPosition?Ce="Parse error on line "+(G+1)+`: +`+j.showPosition()+` +Expecting `+Ke.join(", ")+", got '"+(this.terminals_[fe]||fe)+"'":Ce="Parse error on line "+(G+1)+": Unexpected "+(fe==W?"end of input":"'"+(this.terminals_[fe]||fe)+"'"),this.parseError(Ce,{text:j.match,token:this.terminals_[fe]||fe,line:j.yylineno,loc:K,expected:Ke})}if(Se[0]instanceof Array&&Se.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Ae+", token: "+fe);switch(Se[0]){case 1:N.push(fe),D.push(j.yytext),O.push(j.yylloc),N.push(Se[1]),fe=null,V=j.yyleng,P=j.yytext,G=j.yylineno,K=j.yylloc;break;case 2:if(ze=this.productions_[Se[1]][1],ge.$=D[D.length-ze],ge._$={first_line:O[O.length-(ze||1)].first_line,last_line:O[O.length-1].last_line,first_column:O[O.length-(ze||1)].first_column,last_column:O[O.length-1].last_column},Q&&(ge._$.range=[O[O.length-(ze||1)].range[0],O[O.length-1].range[1]]),Ne=this.performAction.apply(ge,[P,V,G,ae.yy,Se[1],D,O].concat(ie)),typeof Ne<"u")return Ne;ze&&(N=N.slice(0,-1*ze*2),D=D.slice(0,-1*ze),O=O.slice(0,-1*ze)),N.push(this.productions_[Se[1]][0]),D.push(ge.$),O.push(ge._$),xe=B[N[N.length-2]][N[N.length-1]],N.push(xe);break;case 3:return!0}}return!0},"parse")},I=(function(){var F={EOF:1,parseError:T(function(R,N){if(this.yy.parser)this.yy.parser.parseError(R,N);else throw new Error(R)},"parseError"),setInput:T(function(A,R){return this.yy=R||this.yy||{},this._input=A,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:T(function(){var A=this._input[0];this.yytext+=A,this.yyleng++,this.offset++,this.match+=A,this.matched+=A;var R=A.match(/(?:\r\n?|\n).*/g);return R?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),A},"input"),unput:T(function(A){var R=A.length,N=A.split(/(?:\r\n?|\n)/g);this._input=A+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-R),this.offset-=R;var M=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),N.length-1&&(this.yylineno-=N.length-1);var D=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:N?(N.length===M.length?this.yylloc.first_column:0)+M[M.length-N.length].length-N[0].length:this.yylloc.first_column-R},this.options.ranges&&(this.yylloc.range=[D[0],D[0]+this.yyleng-R]),this.yyleng=this.yytext.length,this},"unput"),more:T(function(){return this._more=!0,this},"more"),reject:T(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). +`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:T(function(A){this.unput(this.match.slice(A))},"less"),pastInput:T(function(){var A=this.matched.substr(0,this.matched.length-this.match.length);return(A.length>20?"...":"")+A.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:T(function(){var A=this.match;return A.length<20&&(A+=this._input.substr(0,20-A.length)),(A.substr(0,20)+(A.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:T(function(){var A=this.pastInput(),R=new Array(A.length+1).join("-");return A+this.upcomingInput()+` +`+R+"^"},"showPosition"),test_match:T(function(A,R){var N,M,D;if(this.options.backtrack_lexer&&(D={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(D.yylloc.range=this.yylloc.range.slice(0))),M=A[0].match(/(?:\r\n?|\n).*/g),M&&(this.yylineno+=M.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:M?M[M.length-1].length-M[M.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+A[0].length},this.yytext+=A[0],this.match+=A[0],this.matches=A,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(A[0].length),this.matched+=A[0],N=this.performAction.call(this,this.yy,this,R,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),N)return N;if(this._backtrack){for(var O in D)this[O]=D[O];return!1}return!1},"test_match"),next:T(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var A,R,N,M;this._more||(this.yytext="",this.match="");for(var D=this._currentRules(),O=0;OR[0].length)){if(R=N,M=O,this.options.backtrack_lexer){if(A=this.test_match(N,D[O]),A!==!1)return A;if(this._backtrack){R=!1;continue}else return!1}else if(!this.options.flex)break}return R?(A=this.test_match(R,D[M]),A!==!1?A:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:T(function(){var R=this.next();return R||this.lex()},"lex"),begin:T(function(R){this.conditionStack.push(R)},"begin"),popState:T(function(){var R=this.conditionStack.length-1;return R>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:T(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:T(function(R){return R=this.conditionStack.length-1-Math.abs(R||0),R>=0?this.conditionStack[R]:"INITIAL"},"topState"),pushState:T(function(R){this.begin(R)},"pushState"),stateStackSize:T(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:T(function(R,N,M,D){switch(M){case 0:return this.begin("open_directive"),"open_directive";case 1:return this.begin("acc_title"),31;case 2:return this.popState(),"acc_title_value";case 3:return this.begin("acc_descr"),33;case 4:return this.popState(),"acc_descr_value";case 5:this.begin("acc_descr_multiline");break;case 6:this.popState();break;case 7:return"acc_descr_multiline_value";case 8:break;case 9:break;case 10:break;case 11:return 10;case 12:break;case 13:break;case 14:this.begin("href");break;case 15:this.popState();break;case 16:return 43;case 17:this.begin("callbackname");break;case 18:this.popState();break;case 19:this.popState(),this.begin("callbackargs");break;case 20:return 41;case 21:this.popState();break;case 22:return 42;case 23:this.begin("click");break;case 24:this.popState();break;case 25:return 40;case 26:return 4;case 27:return 22;case 28:return 23;case 29:return 24;case 30:return 25;case 31:return 26;case 32:return 28;case 33:return 27;case 34:return 29;case 35:return 12;case 36:return 13;case 37:return 14;case 38:return 15;case 39:return 16;case 40:return 17;case 41:return 18;case 42:return 20;case 43:return 21;case 44:return"date";case 45:return 30;case 46:return"accDescription";case 47:return 36;case 48:return 38;case 49:return 39;case 50:return":";case 51:return 6;case 52:return"INVALID"}},"anonymous"),rules:[/^(?:%%\{)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:%%(?!\{)*[^\n]*)/i,/^(?:[^\}]%%*[^\n]*)/i,/^(?:%%*[^\n]*[\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:%[^\n]*)/i,/^(?:href[\s]+["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:call[\s]+)/i,/^(?:\([\s]*\))/i,/^(?:\()/i,/^(?:[^(]*)/i,/^(?:\))/i,/^(?:[^)]*)/i,/^(?:click[\s]+)/i,/^(?:[\s\n])/i,/^(?:[^\s\n]*)/i,/^(?:gantt\b)/i,/^(?:dateFormat\s[^#\n;]+)/i,/^(?:inclusiveEndDates\b)/i,/^(?:topAxis\b)/i,/^(?:axisFormat\s[^#\n;]+)/i,/^(?:tickInterval\s[^#\n;]+)/i,/^(?:includes\s[^#\n;]+)/i,/^(?:excludes\s[^#\n;]+)/i,/^(?:todayMarker\s[^\n;]+)/i,/^(?:weekday\s+monday\b)/i,/^(?:weekday\s+tuesday\b)/i,/^(?:weekday\s+wednesday\b)/i,/^(?:weekday\s+thursday\b)/i,/^(?:weekday\s+friday\b)/i,/^(?:weekday\s+saturday\b)/i,/^(?:weekday\s+sunday\b)/i,/^(?:weekend\s+friday\b)/i,/^(?:weekend\s+saturday\b)/i,/^(?:\d\d\d\d-\d\d-\d\d\b)/i,/^(?:title\s[^\n]+)/i,/^(?:accDescription\s[^#\n;]+)/i,/^(?:section\s[^\n]+)/i,/^(?:[^:\n]+)/i,/^(?::[^#\n;]+)/i,/^(?::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[6,7],inclusive:!1},acc_descr:{rules:[4],inclusive:!1},acc_title:{rules:[2],inclusive:!1},callbackargs:{rules:[21,22],inclusive:!1},callbackname:{rules:[18,19,20],inclusive:!1},href:{rules:[15,16],inclusive:!1},click:{rules:[24,25],inclusive:!1},INITIAL:{rules:[0,1,3,5,8,9,10,11,12,13,14,17,23,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52],inclusive:!0}}};return F})();$.lexer=I;function z(){this.yy={}}return T(z,"Parser"),z.prototype=$,$.Parser=z,new z})();vz.parser=vz;var xgt=vz;ma.extend(ogt),ma.extend(hgt),ma.extend(ggt);var vxe={friday:5,saturday:6},Yc="",bz="",xz=void 0,Tz="",jC=[],KC=[],wz=new Map,Cz=[],dA=[],R1="",kz="",bxe=["active","done","crit","milestone","vert"],Ez=[],L1="",ZC=!1,Sz=!1,_z="sunday",fA="saturday",Az=0,Tgt=T(function(){Cz=[],dA=[],R1="",Ez=[],pA=0,Lz=void 0,gA=void 0,pa=[],Yc="",bz="",kz="",xz=void 0,Tz="",jC=[],KC=[],ZC=!1,Sz=!1,Az=0,wz=new Map,L1="",Hn(),_z="sunday",fA="saturday"},"clear"),wgt=T(function(t){L1=t},"setDiagramId"),Cgt=T(function(t){bz=t},"setAxisFormat"),kgt=T(function(){return bz},"getAxisFormat"),Egt=T(function(t){xz=t},"setTickInterval"),Sgt=T(function(){return xz},"getTickInterval"),_gt=T(function(t){Tz=t},"setTodayMarker"),Agt=T(function(){return Tz},"getTodayMarker"),Rgt=T(function(t){Yc=t},"setDateFormat"),Lgt=T(function(){ZC=!0},"enableInclusiveEndDates"),Igt=T(function(){return ZC},"endDatesAreInclusive"),Dgt=T(function(){Sz=!0},"enableTopAxis"),Mgt=T(function(){return Sz},"topAxisEnabled"),Ngt=T(function(t){kz=t},"setDisplayMode"),$gt=T(function(){return kz},"getDisplayMode"),Ogt=T(function(){return Yc},"getDateFormat"),Pgt=T(function(t){jC=t.toLowerCase().split(/[\s,]+/)},"setIncludes"),Bgt=T(function(){return jC},"getIncludes"),Fgt=T(function(t){KC=t.toLowerCase().split(/[\s,]+/)},"setExcludes"),zgt=T(function(){return KC},"getExcludes"),Ggt=T(function(){return wz},"getLinks"),qgt=T(function(t){R1=t,Cz.push(t)},"addSection"),Vgt=T(function(){return Cz},"getSections"),Wgt=T(function(){let t=Exe();const e=10;let r=0;for(;!t&&ro))throw new Error("Failed to find a valid date that was not excluded by `excludes` after 10,000 iterations.");t=t.add(1,"d")}return[e,s]},"fixTaskDates"),Rz=T(function(t,e,r){if(r=r.trim(),T(o=>{const l=o.trim();return l==="x"||l==="X"},"isTimestampFormat")(e)&&/^\d+$/.test(r))return new Date(Number(r));const a=/^after\s+(?[\d\w- ]+)/.exec(r);if(a!==null){let o=null;for(const u of a.groups.ids.split(" ")){let h=p0(u);h!==void 0&&(!o||h.endTime>o.endTime)&&(o=h)}if(o)return o.endTime;const l=new Date;return l.setHours(0,0,0,0),l}let s=ma(r,e.trim(),!0);if(s.isValid())return s.toDate();{se.debug("Invalid date:"+r),se.debug("With date format:"+e.trim());const o=new Date(r);if(o===void 0||isNaN(o.getTime())||o.getFullYear()<-1e4||o.getFullYear()>1e4)throw new Error("Invalid date:"+r);return o}},"getStartDate"),wxe=T(function(t){const e=/^(\d+(?:\.\d+)?)([Mdhmswy]|ms)$/.exec(t.trim());return e!==null?[Number.parseFloat(e[1]),e[2]]:[NaN,"ms"]},"parseDuration"),Cxe=T(function(t,e,r,n=!1){r=r.trim();const a=/^until\s+(?[\d\w- ]+)/.exec(r);if(a!==null){let h=null;for(const f of a.groups.ids.split(" ")){let p=p0(f);p!==void 0&&(!h||p.startTime{window.open(r,"_self")}),wz.set(n,r))}),Sxe(t,"clickable")},"setLink"),Sxe=T(function(t,e){t.split(",").forEach(function(r){let n=p0(r);n!==void 0&&n.classes.push(e)})},"setClass"),emt=T(function(t,e,r){if(Pe().securityLevel!=="loose"||e===void 0)return;let n=[];if(typeof r=="string"){n=r.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let a=0;a{Pr.runFunc(e,...n)})},"setClickFun"),_xe=T(function(t,e){Ez.push(function(){const r=L1?`${L1}-${t}`:t,n=document.querySelector(`[id="${r}"]`);n!==null&&n.addEventListener("click",function(){e()})},function(){const r=L1?`${L1}-${t}`:t,n=document.querySelector(`[id="${r}-text"]`);n!==null&&n.addEventListener("click",function(){e()})})},"pushFun"),tmt=T(function(t,e,r){t.split(",").forEach(function(n){emt(n,e,r)}),Sxe(t,"clickable")},"setClickEvent"),rmt=T(function(t){Ez.forEach(function(e){e(t)})},"bindFunctions"),nmt={getConfig:T(()=>Pe().gantt,"getConfig"),clear:Tgt,setDateFormat:Rgt,getDateFormat:Ogt,enableInclusiveEndDates:Lgt,endDatesAreInclusive:Igt,enableTopAxis:Dgt,topAxisEnabled:Mgt,setAxisFormat:Cgt,getAxisFormat:kgt,setTickInterval:Egt,getTickInterval:Sgt,setTodayMarker:_gt,getTodayMarker:Agt,setAccTitle:Yn,getAccTitle:ii,setDiagramTitle:oi,getDiagramTitle:Xn,setDiagramId:wgt,setDisplayMode:Ngt,getDisplayMode:$gt,setAccDescription:ai,getAccDescription:si,addSection:qgt,getSections:Vgt,getTasks:Wgt,addTask:Zgt,findTaskById:p0,addTaskOrg:Qgt,setIncludes:Pgt,getIncludes:Bgt,setExcludes:Fgt,getExcludes:zgt,setClickEvent:tmt,setLink:Jgt,getLinks:Ggt,bindFunctions:rmt,parseDuration:wxe,isInvalidDate:xxe,setWeekday:Ugt,getWeekday:Hgt,setWeekend:Ygt};function Iz(t,e,r){let n=!0;for(;n;)n=!1,r.forEach(function(i){const a="^\\s*"+i+"\\s*$",s=new RegExp(a);t[0].match(s)&&(e[i]=!0,t.shift(1),n=!0)})}T(Iz,"getTaskTags"),ma.extend(bgt);var imt=T(function(){se.debug("Something is calling, setConf, remove the call")},"setConf"),Axe={monday:ax,tuesday:wW,wednesday:CW,thursday:nf,friday:kW,saturday:EW,sunday:ix},amt=T((t,e)=>{let r=[...t].map(()=>-1/0),n=[...t].sort((a,s)=>a.startTime-s.startTime||a.order-s.order),i=0;for(const a of n)for(let s=0;s=r[s]){r[s]=a.endTime,a.order=s+e,s>i&&(i=s);break}return i},"getMaxIntersections"),hh,Dz=1e4,smt=T(function(t,e,r,n){const i=Pe().gantt;n.db.setDiagramId(e);const a=Pe().securityLevel;let s;a==="sandbox"&&(s=gt("#i"+e));const o=gt(a==="sandbox"?s.nodes()[0].contentDocument.body:"body"),l=a==="sandbox"?s.nodes()[0].contentDocument:document,u=l.getElementById(e);hh=u.parentElement.offsetWidth,hh===void 0&&(hh=1200),i.useWidth!==void 0&&(hh=i.useWidth);const h=n.db.getTasks();let d=[];for(const L of h)d.push(L.type);d=S(d);const f={};let p=2*i.topPadding;if(n.db.getDisplayMode()==="compact"||i.displayMode==="compact"){const L={};for(const I of h)L[I.section]===void 0?L[I.section]=[I]:L[I.section].push(I);let $=0;for(const I of Object.keys(L)){const z=amt(L[I],$)+1;$+=z,p+=z*(i.barHeight+i.barGap),f[I]=z}}else{p+=h.length*(i.barHeight+i.barGap);for(const L of d)f[L]=h.filter($=>$.type===L).length}u.setAttribute("viewBox","0 0 "+hh+" "+p);const g=o.select(`[id="${e}"]`),m=U7e().domain([r3e(h,function(L){return L.startTime}),t3e(h,function(L){return L.endTime})]).rangeRound([0,hh-i.leftPadding-i.rightPadding]);function y(L,$){const I=L.startTime,z=$.startTime;let F=0;return I>z?F=1:IP.vert===G.vert?0:P.vert?1:-1);const M=[...new Set(L.map(P=>P.order))].map(P=>L.find(G=>G.order===P));g.append("g").selectAll("rect").data(M).enter().append("rect").attr("x",0).attr("y",function(P,G){return G=P.order,G*$+I-2}).attr("width",function(){return R-i.rightPadding/2}).attr("height",$).attr("class",function(P){for(const[G,V]of d.entries())if(P.type===V)return"section section"+G%i.numberSectionStyles;return"section section0"}).enter();const D=g.append("g").selectAll("rect").data(L).enter(),O=n.db.getLinks();if(D.append("rect").attr("id",function(P){return e+"-"+P.id}).attr("rx",3).attr("ry",3).attr("x",function(P){return P.milestone?m(P.startTime)+z+.5*(m(P.endTime)-m(P.startTime))-.5*F:m(P.startTime)+z}).attr("y",function(P,G){return G=P.order,P.vert?i.gridLineStartPadding:G*$+I}).attr("width",function(P){return P.milestone?F:P.vert?.08*F:m(P.renderEndTime||P.endTime)-m(P.startTime)}).attr("height",function(P){return P.vert?h.length*(i.barHeight+i.barGap)+i.barHeight*2:F}).attr("transform-origin",function(P,G){return G=P.order,(m(P.startTime)+z+.5*(m(P.endTime)-m(P.startTime))).toString()+"px "+(G*$+I+.5*F).toString()+"px"}).attr("class",function(P){const G="task";let V="";P.classes.length>0&&(V=P.classes.join(" "));let H=0;for(const[ie,j]of d.entries())P.type===j&&(H=ie%i.numberSectionStyles);let W="";return P.active?P.crit?W+=" activeCrit":W=" active":P.done?P.crit?W=" doneCrit":W=" done":P.crit&&(W+=" crit"),W.length===0&&(W=" task"),P.milestone&&(W=" milestone "+W),P.vert&&(W=" vert "+W),W+=H,W+=" "+V,G+W}),D.append("text").attr("id",function(P){return e+"-"+P.id+"-text"}).text(function(P){return P.task}).attr("font-size",i.fontSize).attr("x",function(P){let G=m(P.startTime),V=m(P.renderEndTime||P.endTime);if(P.milestone&&(G+=.5*(m(P.endTime)-m(P.startTime))-.5*F,V=G+F),P.vert)return m(P.startTime)+z;const H=this.getBBox().width;return H>V-G?V+H+1.5*i.leftPadding>R?G+z-5:V+z+5:(V-G)/2+G+z}).attr("y",function(P,G){return P.vert?i.gridLineStartPadding+h.length*(i.barHeight+i.barGap)+60:(G=P.order,G*$+i.barHeight/2+(i.fontSize/2-2)+I)}).attr("text-height",F).attr("class",function(P){const G=m(P.startTime);let V=m(P.endTime);P.milestone&&(V=G+F);const H=this.getBBox().width;let W="";P.classes.length>0&&(W=P.classes.join(" "));let ie=0;for(const[ae,J]of d.entries())P.type===J&&(ie=ae%i.numberSectionStyles);let j="";return P.active&&(P.crit?j="activeCritText"+ie:j="activeText"+ie),P.done?P.crit?j=j+" doneCritText"+ie:j=j+" doneText"+ie:P.crit&&(j=j+" critText"+ie),P.milestone&&(j+=" milestoneText"),P.vert&&(j+=" vertText"),H>V-G?V+H+1.5*i.leftPadding>R?W+" taskTextOutsideLeft taskTextOutside"+ie+" "+j:W+" taskTextOutsideRight taskTextOutside"+ie+" "+j+" width-"+H:W+" taskText taskText"+ie+" "+j+" width-"+H}),Pe().securityLevel==="sandbox"){let P;P=gt("#i"+e);const G=P.nodes()[0].contentDocument;D.filter(function(V){return O.has(V.id)}).each(function(V){var H=G.querySelector("#"+CSS.escape(e+"-"+V.id)),W=G.querySelector("#"+CSS.escape(e+"-"+V.id+"-text"));const ie=H.parentNode;var j=G.createElement("a");j.setAttribute("xlink:href",O.get(V.id)),j.setAttribute("target","_top"),ie.appendChild(j),j.appendChild(H),j.appendChild(W)})}}T(x,"drawRects");function b(L,$,I,z,F,A,R,N){if(R.length===0&&N.length===0)return;let M,D;for(const{startTime:H,endTime:W}of A)(M===void 0||HD)&&(D=W);if(!M||!D)return;if(ma(D).diff(ma(M),"year")>5){se.warn("The difference between the min and max time is more than 5 years. This will cause performance issues. Skipping drawing exclude days.");return}const O=n.db.getDateFormat(),B=[];let P=null,G=ma(M);for(;G.valueOf()<=D;)n.db.isInvalidDate(G,O,R,N)?P?P.end=G:P={start:G,end:G}:P&&(B.push(P),P=null),G=G.add(1,"d");g.append("g").selectAll("rect").data(B).enter().append("rect").attr("id",H=>e+"-exclude-"+H.start.format("YYYY-MM-DD")).attr("x",H=>m(H.start.startOf("day"))+I).attr("y",i.gridLineStartPadding).attr("width",H=>m(H.end.endOf("day"))-m(H.start.startOf("day"))).attr("height",F-$-i.gridLineStartPadding).attr("transform-origin",function(H,W){return(m(H.start)+I+.5*(m(H.end)-m(H.start))).toString()+"px "+(W*L+.5*F).toString()+"px"}).attr("class","exclude-range")}T(b,"drawExcludeDays");function w(L,$,I,z){if(I<=0||L>$)return 1/0;const F=$-L,A=ma.duration({[z??"day"]:I}).asMilliseconds();return A<=0?1/0:Math.ceil(F/A)}T(w,"getEstimatedTickCount");function C(L,$,I,z){const F=n.db.getDateFormat(),A=n.db.getAxisFormat();let R;A?R=A:F==="D"?R="%d":R=i.axisFormat??"%Y-%m-%d";let N=h3e(m).tickSize(-z+$+i.gridLineStartPadding).tickFormat(gk(R));const D=/^([1-9]\d*)(millisecond|second|minute|hour|day|week|month)$/.exec(n.db.getTickInterval()||i.tickInterval);if(D!==null){const O=parseInt(D[1],10);if(isNaN(O)||O<=0)se.warn(`Invalid tick interval value: "${D[1]}". Skipping custom tick interval.`);else{const B=D[2],P=n.db.getWeekday()||i.weekday,G=m.domain(),V=G[0],H=G[1],W=w(V,H,O,B);if(W>Dz)se.warn(`The tick interval "${O}${B}" would generate ${W} ticks, which exceeds the maximum allowed (${Dz}). This may indicate an invalid date or time range. Skipping custom tick interval.`);else switch(B){case"millisecond":N.ticks(j0.every(O));break;case"second":N.ticks(Eh.every(O));break;case"minute":N.ticks(rx.every(O));break;case"hour":N.ticks(nx.every(O));break;case"day":N.ticks(tf.every(O));break;case"week":N.ticks(Axe[P].every(O));break;case"month":N.ticks(sx.every(O));break}}}if(g.append("g").attr("class","grid").attr("transform","translate("+L+", "+(z-50)+")").call(N).selectAll("text").style("text-anchor","middle").attr("fill","#000").attr("stroke","none").attr("font-size",10).attr("dy","1em"),n.db.topAxisEnabled()||i.topAxis){let O=u3e(m).tickSize(-z+$+i.gridLineStartPadding).tickFormat(gk(R));if(D!==null){const B=parseInt(D[1],10);if(isNaN(B)||B<=0)se.warn(`Invalid tick interval value: "${D[1]}". Skipping custom tick interval.`);else{const P=D[2],G=n.db.getWeekday()||i.weekday,V=m.domain(),H=V[0],W=V[1];if(w(H,W,B,P)<=Dz)switch(P){case"millisecond":O.ticks(j0.every(B));break;case"second":O.ticks(Eh.every(B));break;case"minute":O.ticks(rx.every(B));break;case"hour":O.ticks(nx.every(B));break;case"day":O.ticks(tf.every(B));break;case"week":O.ticks(Axe[G].every(B));break;case"month":O.ticks(sx.every(B));break}}}g.append("g").attr("class","grid").attr("transform","translate("+L+", "+$+")").call(O).selectAll("text").style("text-anchor","middle").attr("fill","#000").attr("stroke","none").attr("font-size",10)}}T(C,"makeGrid");function _(L,$){let I=0;const z=Object.keys(f).map(F=>[F,f[F]]);g.append("g").selectAll("text").data(z).enter().append(function(F){const A=F[0].split(Dt.lineBreakRegex),R=-(A.length-1)/2,N=l.createElementNS("http://www.w3.org/2000/svg","text");N.setAttribute("dy",R+"em");for(const[M,D]of A.entries()){const O=l.createElementNS("http://www.w3.org/2000/svg","tspan");O.setAttribute("alignment-baseline","central"),O.setAttribute("x","10"),M>0&&O.setAttribute("dy","1em"),O.textContent=D,N.appendChild(O)}return N}).attr("x",10).attr("y",function(F,A){if(A>0)for(let R=0;R` .mermaid-main-font { font-family: ${t.fontFamily}; } @@ -1735,8 +1736,8 @@ Expecting `+Ze.join(", ")+", got '"+(this.terminals_[fe]||fe)+"'":ke="Parse erro fill: ${t.titleColor||t.textColor}; font-family: ${t.fontFamily}; } -`,"getStyles"),Cot=wot,kot={parser:Nst,db:yot,renderer:Tot,styles:Cot};const Eot=Object.freeze(Object.defineProperty({__proto__:null,diagram:kot},Symbol.toStringTag,{value:"Module"}));var Sot={parse:x(async t=>{const e=await Qo("info",t);ae.debug(e)},"parse")},Aot={version:"11.15.0"},_ot=x(()=>Aot.version,"getVersion"),Rot={getVersion:_ot},Lot=x((t,e,r)=>{ae.debug(`rendering info diagram -`+t);const n=ys(e);wi(n,100,400,!0),n.append("g").append("text").attr("x",100).attr("y",40).attr("class","version").attr("font-size",32).style("text-anchor","middle").text(`v${r}`)},"draw"),Iot={draw:Lot},Dot={parser:Sot,db:Rot,renderer:Iot};const Mot=Object.freeze(Object.defineProperty({__proto__:null,diagram:Dot},Symbol.toStringTag,{value:"Module"}));var Not=Fr.pie,i$={sections:new Map,showData:!1},yS=i$.sections,a$=i$.showData,Oot=structuredClone(Not),$ot=x(()=>structuredClone(Oot),"getConfig"),Pot=x(()=>{yS=new Map,a$=i$.showData,In()},"clear"),Bot=x(({label:t,value:e})=>{if(e<0)throw new Error(`"${t}" has invalid value: ${e}. Negative values are not allowed in pie charts. All slice values must be >= 0.`);yS.has(t)||(yS.set(t,e),ae.debug(`added new section: ${t}, with value: ${e}`))},"addSection"),Fot=x(()=>yS,"getSections"),zot=x(t=>{a$=t},"setShowData"),Got=x(()=>a$,"getShowData"),dge={getConfig:$ot,clear:Pot,setDiagramTitle:qn,getDiagramTitle:Mn,setAccTitle:Dn,getAccTitle:Fn,setAccDescription:zn,getAccDescription:Gn,addSection:Bot,getSections:Fot,setShowData:zot,getShowData:Got},qot=x((t,e)=>{zl(t,e),e.setShowData(t.showData),t.sections.map(e.addSection)},"populateDb"),Vot={parse:x(async t=>{const e=await Qo("pie",t);ae.debug(e),qot(e,dge)},"parse")},Wot=x(t=>` +`,"getStyles"),cmt=lmt,umt={parser:xgt,db:nmt,renderer:omt,styles:cmt};const hmt=Object.freeze(Object.defineProperty({__proto__:null,diagram:umt},Symbol.toStringTag,{value:"Module"}));var dmt={parse:T(async t=>{const e=await Bl("info",t);se.debug(e)},"parse")},fmt={version:"11.15.0"},pmt=T(()=>fmt.version,"getVersion"),gmt={getVersion:pmt},mmt=T((t,e,r)=>{se.debug(`rendering info diagram +`+t);const n=Ys(e);Wi(n,100,400,!0),n.append("g").append("text").attr("x",100).attr("y",40).attr("class","version").attr("font-size",32).style("text-anchor","middle").text(`v${r}`)},"draw"),ymt={draw:mmt},vmt={parser:dmt,db:gmt,renderer:ymt};const bmt=Object.freeze(Object.defineProperty({__proto__:null,diagram:vmt},Symbol.toStringTag,{value:"Module"}));var xmt=Xr.pie,Mz={sections:new Map,showData:!1},mA=Mz.sections,Nz=Mz.showData,Tmt=structuredClone(xmt),wmt=T(()=>structuredClone(Tmt),"getConfig"),Cmt=T(()=>{mA=new Map,Nz=Mz.showData,Hn()},"clear"),kmt=T(({label:t,value:e})=>{if(e<0)throw new Error(`"${t}" has invalid value: ${e}. Negative values are not allowed in pie charts. All slice values must be >= 0.`);mA.has(t)||(mA.set(t,e),se.debug(`added new section: ${t}, with value: ${e}`))},"addSection"),Emt=T(()=>mA,"getSections"),Smt=T(t=>{Nz=t},"setShowData"),_mt=T(()=>Nz,"getShowData"),Rxe={getConfig:wmt,clear:Cmt,setDiagramTitle:oi,getDiagramTitle:Xn,setAccTitle:Yn,getAccTitle:ii,setAccDescription:ai,getAccDescription:si,addSection:kmt,getSections:Emt,setShowData:Smt,getShowData:_mt},Amt=T((t,e)=>{Rc(t,e),e.setShowData(t.showData),t.sections.map(e.addSection)},"populateDb"),Rmt={parse:T(async t=>{const e=await Bl("pie",t);se.debug(e),Amt(e,Rxe)},"parse")},Lmt=T(t=>` .pieCircle{ stroke: ${t.pieStrokeColor}; stroke-width : ${t.pieStrokeWidth}; @@ -1764,25 +1765,25 @@ Expecting `+Ze.join(", ")+", got '"+(this.terminals_[fe]||fe)+"'":ke="Parse erro font-family: ${t.fontFamily}; font-size: ${t.pieLegendTextSize}; } -`,"getStyles"),Uot=Wot,Hot=x(t=>{const e=[...t.values()].reduce((i,a)=>i+a,0),r=[...t.entries()].map(([i,a])=>({label:i,value:a})).filter(i=>i.value/e*100>=1);return V3e().value(i=>i.value).sort(null)(r)},"createPieArcs"),Yot=x((t,e,r,n)=>{var P;ae.debug(`rendering pie chart -`+t);const i=n.db,a=Pe(),s=ti(i.getConfig(),a.pie),o=40,l=18,u=4,h=450,d=h,f=ys(e),p=f.append("g");p.attr("transform","translate("+d/2+","+h/2+")");const{themeVariables:g}=a;let[m]=xc(g.pieOuterStrokeWidth);m??(m=2);const y=s.textPosition,v=Math.min(d,h)/2-o,T=P0().innerRadius(0).outerRadius(v),b=P0().innerRadius(v*y).outerRadius(v*y);p.append("circle").attr("cx",0).attr("cy",0).attr("r",v+m/2).attr("class","pieOuterCircle");const w=i.getSections(),k=Hot(w),A=[g.pie1,g.pie2,g.pie3,g.pie4,g.pie5,g.pie6,g.pie7,g.pie8,g.pie9,g.pie10,g.pie11,g.pie12];let C=0;w.forEach(G=>{C+=G});const _=k.filter(G=>(G.data.value/C*100).toFixed(0)!=="0"),L=Qh(A).domain([...w.keys()]);p.selectAll("mySlices").data(_).enter().append("path").attr("d",T).attr("fill",G=>L(G.data.label)).attr("class","pieCircle"),p.selectAll("mySlices").data(_).enter().append("text").text(G=>(G.data.value/C*100).toFixed(0)+"%").attr("transform",G=>"translate("+b.centroid(G)+")").style("text-anchor","middle").attr("class","slice");const O=p.append("text").text(i.getDiagramTitle()).attr("x",0).attr("y",-400/2).attr("class","pieTitleText"),M=[...w.entries()].map(([G,V])=>({label:G,value:V})),z=p.selectAll(".legend").data(M).enter().append("g").attr("class","legend").attr("transform",(G,V)=>{const Y=l+u,W=Y*M.length/2,ie=12*l,K=V*Y-W;return"translate("+ie+","+K+")"});z.append("rect").attr("width",l).attr("height",l).style("fill",G=>L(G.label)).style("stroke",G=>L(G.label)),z.append("text").attr("x",l+u).attr("y",l-u).text(G=>i.getShowData()?`${G.label} [${G.value}]`:G.label);const F=Math.max(...z.selectAll("text").nodes().map(G=>(G==null?void 0:G.getBoundingClientRect().width)??0)),S=d+o+l+u+F,R=((P=O.node())==null?void 0:P.getBoundingClientRect().width)??0,N=d/2-R/2,D=d/2+R/2,I=Math.min(0,N),B=Math.max(S,D)-I;f.attr("viewBox",`${I} 0 ${B} ${h}`),wi(f,h,B,s.useMaxWidth)},"draw"),Xot={draw:Yot},Kot={parser:Vot,db:dge,renderer:Xot,styles:Uot};const jot=Object.freeze(Object.defineProperty({__proto__:null,diagram:Kot},Symbol.toStringTag,{value:"Module"}));var s$=(function(){var t=x(function(j,pe,re,Be){for(re=re||{},Be=j.length;Be--;re[j[Be]]=pe);return re},"o"),e=[1,3],r=[1,4],n=[1,5],i=[1,6],a=[1,7],s=[1,4,5,10,12,13,14,15,18,25,35,37,39,41,42,48,50,51,52,53,54,55,56,57,60,61,63,64,65,66,67],o=[1,4,5,10,12,13,14,15,18,25,28,35,37,39,41,42,48,50,51,52,53,54,55,56,57,60,61,63,64,65,66,67],l=[55,56,57],u=[2,36],h=[1,37],d=[1,36],f=[1,38],p=[1,35],g=[1,43],m=[1,41],y=[1,45],v=[1,14],T=[1,23],b=[1,18],w=[1,19],k=[1,20],A=[1,21],C=[1,22],_=[1,24],L=[1,25],O=[1,26],M=[1,27],z=[1,28],F=[1,29],S=[1,32],R=[1,33],N=[1,34],D=[1,39],I=[1,40],$=[1,42],B=[1,44],P=[1,63],G=[1,62],V=[4,5,8,10,12,13,14,15,18,44,47,49,55,56,57,63,64,65,66,67],Y=[1,66],W=[1,67],ie=[1,68],K=[1,69],se=[1,70],J=[1,71],Z=[1,72],ee=[1,73],ne=[1,74],ue=[1,75],fe=[1,76],_e=[1,77],Ae=[4,5,6,7,8,9,10,11,12,13,14,15,18],Ne=[1,91],me=[1,92],ve=[1,93],Ge=[1,100],Te=[1,94],Ze=[1,97],ke=[1,95],Ve=[1,96],Qe=[1,98],nt=[1,99],tt=[1,103],je=[10,55,56,57],Ce=[4,5,6,8,10,11,13,17,18,19,20,55,56,57],Se={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,idStringToken:3,ALPHA:4,NUM:5,NODE_STRING:6,DOWN:7,MINUS:8,DEFAULT:9,COMMA:10,COLON:11,AMP:12,BRKT:13,MULT:14,UNICODE_TEXT:15,styleComponent:16,UNIT:17,SPACE:18,STYLE:19,PCT:20,idString:21,style:22,stylesOpt:23,classDefStatement:24,CLASSDEF:25,start:26,eol:27,QUADRANT:28,document:29,line:30,statement:31,axisDetails:32,quadrantDetails:33,points:34,title:35,title_value:36,acc_title:37,acc_title_value:38,acc_descr:39,acc_descr_value:40,acc_descr_multiline_value:41,section:42,text:43,point_start:44,point_x:45,point_y:46,class_name:47,"X-AXIS":48,"AXIS-TEXT-DELIMITER":49,"Y-AXIS":50,QUADRANT_1:51,QUADRANT_2:52,QUADRANT_3:53,QUADRANT_4:54,NEWLINE:55,SEMI:56,EOF:57,alphaNumToken:58,textNoTagsToken:59,STR:60,MD_STR:61,alphaNum:62,PUNCTUATION:63,PLUS:64,EQUALS:65,DOT:66,UNDERSCORE:67,$accept:0,$end:1},terminals_:{2:"error",4:"ALPHA",5:"NUM",6:"NODE_STRING",7:"DOWN",8:"MINUS",9:"DEFAULT",10:"COMMA",11:"COLON",12:"AMP",13:"BRKT",14:"MULT",15:"UNICODE_TEXT",17:"UNIT",18:"SPACE",19:"STYLE",20:"PCT",25:"CLASSDEF",28:"QUADRANT",35:"title",36:"title_value",37:"acc_title",38:"acc_title_value",39:"acc_descr",40:"acc_descr_value",41:"acc_descr_multiline_value",42:"section",44:"point_start",45:"point_x",46:"point_y",47:"class_name",48:"X-AXIS",49:"AXIS-TEXT-DELIMITER",50:"Y-AXIS",51:"QUADRANT_1",52:"QUADRANT_2",53:"QUADRANT_3",54:"QUADRANT_4",55:"NEWLINE",56:"SEMI",57:"EOF",60:"STR",61:"MD_STR",63:"PUNCTUATION",64:"PLUS",65:"EQUALS",66:"DOT",67:"UNDERSCORE"},productions_:[0,[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[21,1],[21,2],[22,1],[22,2],[23,1],[23,3],[24,5],[26,2],[26,2],[26,2],[29,0],[29,2],[30,2],[31,0],[31,1],[31,2],[31,1],[31,1],[31,1],[31,2],[31,2],[31,2],[31,1],[31,1],[34,4],[34,5],[34,5],[34,6],[32,4],[32,3],[32,2],[32,4],[32,3],[32,2],[33,2],[33,2],[33,2],[33,2],[27,1],[27,1],[27,1],[43,1],[43,2],[43,1],[43,1],[62,1],[62,2],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[59,1],[59,1],[59,1]],performAction:x(function(pe,re,Be,xe,Ue,De,qe){var Le=De.length-1;switch(Ue){case 23:this.$=De[Le];break;case 24:this.$=De[Le-1]+""+De[Le];break;case 26:this.$=De[Le-1]+De[Le];break;case 27:this.$=[De[Le].trim()];break;case 28:De[Le-2].push(De[Le].trim()),this.$=De[Le-2];break;case 29:this.$=De[Le-4],xe.addClass(De[Le-2],De[Le]);break;case 37:this.$=[];break;case 42:this.$=De[Le].trim(),xe.setDiagramTitle(this.$);break;case 43:this.$=De[Le].trim(),xe.setAccTitle(this.$);break;case 44:case 45:this.$=De[Le].trim(),xe.setAccDescription(this.$);break;case 46:xe.addSection(De[Le].substr(8)),this.$=De[Le].substr(8);break;case 47:xe.addPoint(De[Le-3],"",De[Le-1],De[Le],[]);break;case 48:xe.addPoint(De[Le-4],De[Le-3],De[Le-1],De[Le],[]);break;case 49:xe.addPoint(De[Le-4],"",De[Le-2],De[Le-1],De[Le]);break;case 50:xe.addPoint(De[Le-5],De[Le-4],De[Le-2],De[Le-1],De[Le]);break;case 51:xe.setXAxisLeftText(De[Le-2]),xe.setXAxisRightText(De[Le]);break;case 52:De[Le-1].text+=" ⟶ ",xe.setXAxisLeftText(De[Le-1]);break;case 53:xe.setXAxisLeftText(De[Le]);break;case 54:xe.setYAxisBottomText(De[Le-2]),xe.setYAxisTopText(De[Le]);break;case 55:De[Le-1].text+=" ⟶ ",xe.setYAxisBottomText(De[Le-1]);break;case 56:xe.setYAxisBottomText(De[Le]);break;case 57:xe.setQuadrant1Text(De[Le]);break;case 58:xe.setQuadrant2Text(De[Le]);break;case 59:xe.setQuadrant3Text(De[Le]);break;case 60:xe.setQuadrant4Text(De[Le]);break;case 64:this.$={text:De[Le],type:"text"};break;case 65:this.$={text:De[Le-1].text+""+De[Le],type:De[Le-1].type};break;case 66:this.$={text:De[Le],type:"text"};break;case 67:this.$={text:De[Le],type:"markdown"};break;case 68:this.$=De[Le];break;case 69:this.$=De[Le-1]+""+De[Le];break}},"anonymous"),table:[{18:e,26:1,27:2,28:r,55:n,56:i,57:a},{1:[3]},{18:e,26:8,27:2,28:r,55:n,56:i,57:a},{18:e,26:9,27:2,28:r,55:n,56:i,57:a},t(s,[2,33],{29:10}),t(o,[2,61]),t(o,[2,62]),t(o,[2,63]),{1:[2,30]},{1:[2,31]},t(l,u,{30:11,31:12,24:13,32:15,33:16,34:17,43:30,58:31,1:[2,32],4:h,5:d,10:f,12:p,13:g,14:m,15:y,18:v,25:T,35:b,37:w,39:k,41:A,42:C,48:_,50:L,51:O,52:M,53:z,54:F,60:S,61:R,63:N,64:D,65:I,66:$,67:B}),t(s,[2,34]),{27:46,55:n,56:i,57:a},t(l,[2,37]),t(l,u,{24:13,32:15,33:16,34:17,43:30,58:31,31:47,4:h,5:d,10:f,12:p,13:g,14:m,15:y,18:v,25:T,35:b,37:w,39:k,41:A,42:C,48:_,50:L,51:O,52:M,53:z,54:F,60:S,61:R,63:N,64:D,65:I,66:$,67:B}),t(l,[2,39]),t(l,[2,40]),t(l,[2,41]),{36:[1,48]},{38:[1,49]},{40:[1,50]},t(l,[2,45]),t(l,[2,46]),{18:[1,51]},{4:h,5:d,10:f,12:p,13:g,14:m,15:y,43:52,58:31,60:S,61:R,63:N,64:D,65:I,66:$,67:B},{4:h,5:d,10:f,12:p,13:g,14:m,15:y,43:53,58:31,60:S,61:R,63:N,64:D,65:I,66:$,67:B},{4:h,5:d,10:f,12:p,13:g,14:m,15:y,43:54,58:31,60:S,61:R,63:N,64:D,65:I,66:$,67:B},{4:h,5:d,10:f,12:p,13:g,14:m,15:y,43:55,58:31,60:S,61:R,63:N,64:D,65:I,66:$,67:B},{4:h,5:d,10:f,12:p,13:g,14:m,15:y,43:56,58:31,60:S,61:R,63:N,64:D,65:I,66:$,67:B},{4:h,5:d,10:f,12:p,13:g,14:m,15:y,43:57,58:31,60:S,61:R,63:N,64:D,65:I,66:$,67:B},{4:h,5:d,8:P,10:f,12:p,13:g,14:m,15:y,18:G,44:[1,58],47:[1,59],58:61,59:60,63:N,64:D,65:I,66:$,67:B},t(V,[2,64]),t(V,[2,66]),t(V,[2,67]),t(V,[2,70]),t(V,[2,71]),t(V,[2,72]),t(V,[2,73]),t(V,[2,74]),t(V,[2,75]),t(V,[2,76]),t(V,[2,77]),t(V,[2,78]),t(V,[2,79]),t(V,[2,80]),t(V,[2,81]),t(s,[2,35]),t(l,[2,38]),t(l,[2,42]),t(l,[2,43]),t(l,[2,44]),{3:65,4:Y,5:W,6:ie,7:K,8:se,9:J,10:Z,11:ee,12:ne,13:ue,14:fe,15:_e,21:64},t(l,[2,53],{59:60,58:61,4:h,5:d,8:P,10:f,12:p,13:g,14:m,15:y,18:G,49:[1,78],63:N,64:D,65:I,66:$,67:B}),t(l,[2,56],{59:60,58:61,4:h,5:d,8:P,10:f,12:p,13:g,14:m,15:y,18:G,49:[1,79],63:N,64:D,65:I,66:$,67:B}),t(l,[2,57],{59:60,58:61,4:h,5:d,8:P,10:f,12:p,13:g,14:m,15:y,18:G,63:N,64:D,65:I,66:$,67:B}),t(l,[2,58],{59:60,58:61,4:h,5:d,8:P,10:f,12:p,13:g,14:m,15:y,18:G,63:N,64:D,65:I,66:$,67:B}),t(l,[2,59],{59:60,58:61,4:h,5:d,8:P,10:f,12:p,13:g,14:m,15:y,18:G,63:N,64:D,65:I,66:$,67:B}),t(l,[2,60],{59:60,58:61,4:h,5:d,8:P,10:f,12:p,13:g,14:m,15:y,18:G,63:N,64:D,65:I,66:$,67:B}),{45:[1,80]},{44:[1,81]},t(V,[2,65]),t(V,[2,82]),t(V,[2,83]),t(V,[2,84]),{3:83,4:Y,5:W,6:ie,7:K,8:se,9:J,10:Z,11:ee,12:ne,13:ue,14:fe,15:_e,18:[1,82]},t(Ae,[2,23]),t(Ae,[2,1]),t(Ae,[2,2]),t(Ae,[2,3]),t(Ae,[2,4]),t(Ae,[2,5]),t(Ae,[2,6]),t(Ae,[2,7]),t(Ae,[2,8]),t(Ae,[2,9]),t(Ae,[2,10]),t(Ae,[2,11]),t(Ae,[2,12]),t(l,[2,52],{58:31,43:84,4:h,5:d,10:f,12:p,13:g,14:m,15:y,60:S,61:R,63:N,64:D,65:I,66:$,67:B}),t(l,[2,55],{58:31,43:85,4:h,5:d,10:f,12:p,13:g,14:m,15:y,60:S,61:R,63:N,64:D,65:I,66:$,67:B}),{46:[1,86]},{45:[1,87]},{4:Ne,5:me,6:ve,8:Ge,11:Te,13:Ze,16:90,17:ke,18:Ve,19:Qe,20:nt,22:89,23:88},t(Ae,[2,24]),t(l,[2,51],{59:60,58:61,4:h,5:d,8:P,10:f,12:p,13:g,14:m,15:y,18:G,63:N,64:D,65:I,66:$,67:B}),t(l,[2,54],{59:60,58:61,4:h,5:d,8:P,10:f,12:p,13:g,14:m,15:y,18:G,63:N,64:D,65:I,66:$,67:B}),t(l,[2,47],{22:89,16:90,23:101,4:Ne,5:me,6:ve,8:Ge,11:Te,13:Ze,17:ke,18:Ve,19:Qe,20:nt}),{46:[1,102]},t(l,[2,29],{10:tt}),t(je,[2,27],{16:104,4:Ne,5:me,6:ve,8:Ge,11:Te,13:Ze,17:ke,18:Ve,19:Qe,20:nt}),t(Ce,[2,25]),t(Ce,[2,13]),t(Ce,[2,14]),t(Ce,[2,15]),t(Ce,[2,16]),t(Ce,[2,17]),t(Ce,[2,18]),t(Ce,[2,19]),t(Ce,[2,20]),t(Ce,[2,21]),t(Ce,[2,22]),t(l,[2,49],{10:tt}),t(l,[2,48],{22:89,16:90,23:105,4:Ne,5:me,6:ve,8:Ge,11:Te,13:Ze,17:ke,18:Ve,19:Qe,20:nt}),{4:Ne,5:me,6:ve,8:Ge,11:Te,13:Ze,16:90,17:ke,18:Ve,19:Qe,20:nt,22:106},t(Ce,[2,26]),t(l,[2,50],{10:tt}),t(je,[2,28],{16:104,4:Ne,5:me,6:ve,8:Ge,11:Te,13:Ze,17:ke,18:Ve,19:Qe,20:nt})],defaultActions:{8:[2,30],9:[2,31]},parseError:x(function(pe,re){if(re.recoverable)this.trace(pe);else{var Be=new Error(pe);throw Be.hash=re,Be}},"parseError"),parse:x(function(pe){var re=this,Be=[0],xe=[],Ue=[null],De=[],qe=this.table,Le="",Xe=0,Ie=0,it=2,we=1,lt=De.slice.call(arguments,1),be=Object.create(this.lexer),Et={yy:{}};for(var vt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,vt)&&(Et.yy[vt]=this.yy[vt]);be.setInput(pe,Et.yy),Et.yy.lexer=be,Et.yy.parser=this,typeof be.yylloc>"u"&&(be.yylloc={});var ot=be.yylloc;De.push(ot);var It=be.options&&be.options.ranges;typeof Et.yy.parseError=="function"?this.parseError=Et.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function xt(Ft){Be.length=Be.length-2*Ft,Ue.length=Ue.length-Ft,De.length=De.length-Ft}x(xt,"popStack");function ht(){var Ft;return Ft=xe.pop()||be.lex()||we,typeof Ft!="number"&&(Ft instanceof Array&&(xe=Ft,Ft=xe.pop()),Ft=re.symbols_[Ft]||Ft),Ft}x(ht,"lex");for(var oe,At,dt,ut,wt={},Mr,ye,et,ct;;){if(At=Be[Be.length-1],this.defaultActions[At]?dt=this.defaultActions[At]:((oe===null||typeof oe>"u")&&(oe=ht()),dt=qe[At]&&qe[At][oe]),typeof dt>"u"||!dt.length||!dt[0]){var _t="";ct=[];for(Mr in qe[At])this.terminals_[Mr]&&Mr>it&&ct.push("'"+this.terminals_[Mr]+"'");be.showPosition?_t="Parse error on line "+(Xe+1)+`: +`,"getStyles"),Imt=Lmt,Dmt=T(t=>{const e=[...t.values()].reduce((i,a)=>i+a,0),r=[...t.entries()].map(([i,a])=>({label:i,value:a})).filter(i=>i.value/e*100>=1);return sRe().value(i=>i.value).sort(null)(r)},"createPieArcs"),Mmt=T((t,e,r,n)=>{var P;se.debug(`rendering pie chart +`+t);const i=n.db,a=Pe(),s=wi(i.getConfig(),a.pie),o=40,l=18,u=4,h=450,d=h,f=Ys(e),p=f.append("g");p.attr("transform","translate("+d/2+","+h/2+")");const{themeVariables:g}=a;let[m]=cu(g.pieOuterStrokeWidth);m??(m=2);const y=s.textPosition,v=Math.min(d,h)/2-o,x=J0().innerRadius(0).outerRadius(v),b=J0().innerRadius(v*y).outerRadius(v*y);p.append("circle").attr("cx",0).attr("cy",0).attr("r",v+m/2).attr("class","pieOuterCircle");const w=i.getSections(),C=Dmt(w),_=[g.pie1,g.pie2,g.pie3,g.pie4,g.pie5,g.pie6,g.pie7,g.pie8,g.pie9,g.pie10,g.pie11,g.pie12];let k=0;w.forEach(G=>{k+=G});const S=C.filter(G=>(G.data.value/k*100).toFixed(0)!=="0"),L=ef(_).domain([...w.keys()]);p.selectAll("mySlices").data(S).enter().append("path").attr("d",x).attr("fill",G=>L(G.data.label)).attr("class","pieCircle"),p.selectAll("mySlices").data(S).enter().append("text").text(G=>(G.data.value/k*100).toFixed(0)+"%").attr("transform",G=>"translate("+b.centroid(G)+")").style("text-anchor","middle").attr("class","slice");const $=p.append("text").text(i.getDiagramTitle()).attr("x",0).attr("y",-400/2).attr("class","pieTitleText"),I=[...w.entries()].map(([G,V])=>({label:G,value:V})),z=p.selectAll(".legend").data(I).enter().append("g").attr("class","legend").attr("transform",(G,V)=>{const H=l+u,W=H*I.length/2,ie=12*l,j=V*H-W;return"translate("+ie+","+j+")"});z.append("rect").attr("width",l).attr("height",l).style("fill",G=>L(G.label)).style("stroke",G=>L(G.label)),z.append("text").attr("x",l+u).attr("y",l-u).text(G=>i.getShowData()?`${G.label} [${G.value}]`:G.label);const F=Math.max(...z.selectAll("text").nodes().map(G=>(G==null?void 0:G.getBoundingClientRect().width)??0)),A=d+o+l+u+F,R=((P=$.node())==null?void 0:P.getBoundingClientRect().width)??0,N=d/2-R/2,M=d/2+R/2,D=Math.min(0,N),B=Math.max(A,M)-D;f.attr("viewBox",`${D} 0 ${B} ${h}`),Wi(f,h,B,s.useMaxWidth)},"draw"),Nmt={draw:Mmt},$mt={parser:Rmt,db:Rxe,renderer:Nmt,styles:Imt};const Omt=Object.freeze(Object.defineProperty({__proto__:null,diagram:$mt},Symbol.toStringTag,{value:"Module"}));var $z=(function(){var t=T(function(Z,pe,ne,Be){for(ne=ne||{},Be=Z.length;Be--;ne[Z[Be]]=pe);return ne},"o"),e=[1,3],r=[1,4],n=[1,5],i=[1,6],a=[1,7],s=[1,4,5,10,12,13,14,15,18,25,35,37,39,41,42,48,50,51,52,53,54,55,56,57,60,61,63,64,65,66,67],o=[1,4,5,10,12,13,14,15,18,25,28,35,37,39,41,42,48,50,51,52,53,54,55,56,57,60,61,63,64,65,66,67],l=[55,56,57],u=[2,36],h=[1,37],d=[1,36],f=[1,38],p=[1,35],g=[1,43],m=[1,41],y=[1,45],v=[1,14],x=[1,23],b=[1,18],w=[1,19],C=[1,20],_=[1,21],k=[1,22],S=[1,24],L=[1,25],$=[1,26],I=[1,27],z=[1,28],F=[1,29],A=[1,32],R=[1,33],N=[1,34],M=[1,39],D=[1,40],O=[1,42],B=[1,44],P=[1,63],G=[1,62],V=[4,5,8,10,12,13,14,15,18,44,47,49,55,56,57,63,64,65,66,67],H=[1,66],W=[1,67],ie=[1,68],j=[1,69],ae=[1,70],J=[1,71],K=[1,72],Q=[1,73],re=[1,74],le=[1,75],fe=[1,76],Ae=[1,77],Se=[4,5,6,7,8,9,10,11,12,13,14,15,18],Ne=[1,91],ge=[1,92],ve=[1,93],ze=[1,100],xe=[1,94],Ke=[1,97],Ce=[1,95],Ve=[1,96],Qe=[1,98],nt=[1,99],tt=[1,103],Ze=[10,55,56,57],ke=[4,5,6,8,10,11,13,17,18,19,20,55,56,57],_e={trace:T(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],[58,1],[59,1],[59,1],[59,1]],performAction:T(function(pe,ne,Be,Te,Ue,De,qe){var Le=De.length-1;switch(Ue){case 23:this.$=De[Le];break;case 24:this.$=De[Le-1]+""+De[Le];break;case 26:this.$=De[Le-1]+De[Le];break;case 27:this.$=[De[Le].trim()];break;case 28:De[Le-2].push(De[Le].trim()),this.$=De[Le-2];break;case 29:this.$=De[Le-4],Te.addClass(De[Le-2],De[Le]);break;case 37:this.$=[];break;case 42:this.$=De[Le].trim(),Te.setDiagramTitle(this.$);break;case 43:this.$=De[Le].trim(),Te.setAccTitle(this.$);break;case 44:case 45:this.$=De[Le].trim(),Te.setAccDescription(this.$);break;case 46:Te.addSection(De[Le].substr(8)),this.$=De[Le].substr(8);break;case 47:Te.addPoint(De[Le-3],"",De[Le-1],De[Le],[]);break;case 48:Te.addPoint(De[Le-4],De[Le-3],De[Le-1],De[Le],[]);break;case 49:Te.addPoint(De[Le-4],"",De[Le-2],De[Le-1],De[Le]);break;case 50:Te.addPoint(De[Le-5],De[Le-4],De[Le-2],De[Le-1],De[Le]);break;case 51:Te.setXAxisLeftText(De[Le-2]),Te.setXAxisRightText(De[Le]);break;case 52:De[Le-1].text+=" ⟶ ",Te.setXAxisLeftText(De[Le-1]);break;case 53:Te.setXAxisLeftText(De[Le]);break;case 54:Te.setYAxisBottomText(De[Le-2]),Te.setYAxisTopText(De[Le]);break;case 55:De[Le-1].text+=" ⟶ ",Te.setYAxisBottomText(De[Le-1]);break;case 56:Te.setYAxisBottomText(De[Le]);break;case 57:Te.setQuadrant1Text(De[Le]);break;case 58:Te.setQuadrant2Text(De[Le]);break;case 59:Te.setQuadrant3Text(De[Le]);break;case 60:Te.setQuadrant4Text(De[Le]);break;case 64:this.$={text:De[Le],type:"text"};break;case 65:this.$={text:De[Le-1].text+""+De[Le],type:De[Le-1].type};break;case 66:this.$={text:De[Le],type:"text"};break;case 67:this.$={text:De[Le],type:"markdown"};break;case 68:this.$=De[Le];break;case 69:this.$=De[Le-1]+""+De[Le];break}},"anonymous"),table:[{18:e,26:1,27:2,28:r,55:n,56:i,57:a},{1:[3]},{18:e,26:8,27:2,28:r,55:n,56:i,57:a},{18:e,26:9,27:2,28:r,55:n,56:i,57:a},t(s,[2,33],{29:10}),t(o,[2,61]),t(o,[2,62]),t(o,[2,63]),{1:[2,30]},{1:[2,31]},t(l,u,{30:11,31:12,24:13,32:15,33:16,34:17,43:30,58:31,1:[2,32],4:h,5:d,10:f,12:p,13:g,14:m,15:y,18:v,25:x,35:b,37:w,39:C,41:_,42:k,48:S,50:L,51:$,52:I,53:z,54:F,60:A,61:R,63:N,64:M,65:D,66:O,67:B}),t(s,[2,34]),{27:46,55:n,56:i,57:a},t(l,[2,37]),t(l,u,{24:13,32:15,33:16,34:17,43:30,58:31,31:47,4:h,5:d,10:f,12:p,13:g,14:m,15:y,18:v,25:x,35:b,37:w,39:C,41:_,42:k,48:S,50:L,51:$,52:I,53:z,54:F,60:A,61:R,63:N,64:M,65:D,66:O,67:B}),t(l,[2,39]),t(l,[2,40]),t(l,[2,41]),{36:[1,48]},{38:[1,49]},{40:[1,50]},t(l,[2,45]),t(l,[2,46]),{18:[1,51]},{4:h,5:d,10:f,12:p,13:g,14:m,15:y,43:52,58:31,60:A,61:R,63:N,64:M,65:D,66:O,67:B},{4:h,5:d,10:f,12:p,13:g,14:m,15:y,43:53,58:31,60:A,61:R,63:N,64:M,65:D,66:O,67:B},{4:h,5:d,10:f,12:p,13:g,14:m,15:y,43:54,58:31,60:A,61:R,63:N,64:M,65:D,66:O,67:B},{4:h,5:d,10:f,12:p,13:g,14:m,15:y,43:55,58:31,60:A,61:R,63:N,64:M,65:D,66:O,67:B},{4:h,5:d,10:f,12:p,13:g,14:m,15:y,43:56,58:31,60:A,61:R,63:N,64:M,65:D,66:O,67:B},{4:h,5:d,10:f,12:p,13:g,14:m,15:y,43:57,58:31,60:A,61:R,63:N,64:M,65:D,66:O,67:B},{4:h,5:d,8:P,10:f,12:p,13:g,14:m,15:y,18:G,44:[1,58],47:[1,59],58:61,59:60,63:N,64:M,65:D,66:O,67:B},t(V,[2,64]),t(V,[2,66]),t(V,[2,67]),t(V,[2,70]),t(V,[2,71]),t(V,[2,72]),t(V,[2,73]),t(V,[2,74]),t(V,[2,75]),t(V,[2,76]),t(V,[2,77]),t(V,[2,78]),t(V,[2,79]),t(V,[2,80]),t(V,[2,81]),t(s,[2,35]),t(l,[2,38]),t(l,[2,42]),t(l,[2,43]),t(l,[2,44]),{3:65,4:H,5:W,6:ie,7:j,8:ae,9:J,10:K,11:Q,12:re,13:le,14:fe,15:Ae,21:64},t(l,[2,53],{59:60,58:61,4:h,5:d,8:P,10:f,12:p,13:g,14:m,15:y,18:G,49:[1,78],63:N,64:M,65:D,66:O,67:B}),t(l,[2,56],{59:60,58:61,4:h,5:d,8:P,10:f,12:p,13:g,14:m,15:y,18:G,49:[1,79],63:N,64:M,65:D,66:O,67:B}),t(l,[2,57],{59:60,58:61,4:h,5:d,8:P,10:f,12:p,13:g,14:m,15:y,18:G,63:N,64:M,65:D,66:O,67:B}),t(l,[2,58],{59:60,58:61,4:h,5:d,8:P,10:f,12:p,13:g,14:m,15:y,18:G,63:N,64:M,65:D,66:O,67:B}),t(l,[2,59],{59:60,58:61,4:h,5:d,8:P,10:f,12:p,13:g,14:m,15:y,18:G,63:N,64:M,65:D,66:O,67:B}),t(l,[2,60],{59:60,58:61,4:h,5:d,8:P,10:f,12:p,13:g,14:m,15:y,18:G,63:N,64:M,65:D,66:O,67:B}),{45:[1,80]},{44:[1,81]},t(V,[2,65]),t(V,[2,82]),t(V,[2,83]),t(V,[2,84]),{3:83,4:H,5:W,6:ie,7:j,8:ae,9:J,10:K,11:Q,12:re,13:le,14:fe,15:Ae,18:[1,82]},t(Se,[2,23]),t(Se,[2,1]),t(Se,[2,2]),t(Se,[2,3]),t(Se,[2,4]),t(Se,[2,5]),t(Se,[2,6]),t(Se,[2,7]),t(Se,[2,8]),t(Se,[2,9]),t(Se,[2,10]),t(Se,[2,11]),t(Se,[2,12]),t(l,[2,52],{58:31,43:84,4:h,5:d,10:f,12:p,13:g,14:m,15:y,60:A,61:R,63:N,64:M,65:D,66:O,67:B}),t(l,[2,55],{58:31,43:85,4:h,5:d,10:f,12:p,13:g,14:m,15:y,60:A,61:R,63:N,64:M,65:D,66:O,67:B}),{46:[1,86]},{45:[1,87]},{4:Ne,5:ge,6:ve,8:ze,11:xe,13:Ke,16:90,17:Ce,18:Ve,19:Qe,20:nt,22:89,23:88},t(Se,[2,24]),t(l,[2,51],{59:60,58:61,4:h,5:d,8:P,10:f,12:p,13:g,14:m,15:y,18:G,63:N,64:M,65:D,66:O,67:B}),t(l,[2,54],{59:60,58:61,4:h,5:d,8:P,10:f,12:p,13:g,14:m,15:y,18:G,63:N,64:M,65:D,66:O,67:B}),t(l,[2,47],{22:89,16:90,23:101,4:Ne,5:ge,6:ve,8:ze,11:xe,13:Ke,17:Ce,18:Ve,19:Qe,20:nt}),{46:[1,102]},t(l,[2,29],{10:tt}),t(Ze,[2,27],{16:104,4:Ne,5:ge,6:ve,8:ze,11:xe,13:Ke,17:Ce,18:Ve,19:Qe,20:nt}),t(ke,[2,25]),t(ke,[2,13]),t(ke,[2,14]),t(ke,[2,15]),t(ke,[2,16]),t(ke,[2,17]),t(ke,[2,18]),t(ke,[2,19]),t(ke,[2,20]),t(ke,[2,21]),t(ke,[2,22]),t(l,[2,49],{10:tt}),t(l,[2,48],{22:89,16:90,23:105,4:Ne,5:ge,6:ve,8:ze,11:xe,13:Ke,17:Ce,18:Ve,19:Qe,20:nt}),{4:Ne,5:ge,6:ve,8:ze,11:xe,13:Ke,16:90,17:Ce,18:Ve,19:Qe,20:nt,22:106},t(ke,[2,26]),t(l,[2,50],{10:tt}),t(Ze,[2,28],{16:104,4:Ne,5:ge,6:ve,8:ze,11:xe,13:Ke,17:Ce,18:Ve,19:Qe,20:nt})],defaultActions:{8:[2,30],9:[2,31]},parseError:T(function(pe,ne){if(ne.recoverable)this.trace(pe);else{var Be=new Error(pe);throw Be.hash=ne,Be}},"parseError"),parse:T(function(pe){var ne=this,Be=[0],Te=[],Ue=[null],De=[],qe=this.table,Le="",Xe=0,Ie=0,it=2,we=1,ct=De.slice.call(arguments,1),be=Object.create(this.lexer),_t={yy:{}};for(var bt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,bt)&&(_t.yy[bt]=this.yy[bt]);be.setInput(pe,_t.yy),_t.yy.lexer=be,_t.yy.parser=this,typeof be.yylloc>"u"&&(be.yylloc={});var lt=be.yylloc;De.push(lt);var Mt=be.options&&be.options.ranges;typeof _t.yy.parseError=="function"?this.parseError=_t.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Tt(Vt){Be.length=Be.length-2*Vt,Ue.length=Ue.length-Vt,De.length=De.length-Vt}T(Tt,"popStack");function dt(){var Vt;return Vt=Te.pop()||be.lex()||we,typeof Vt!="number"&&(Vt instanceof Array&&(Te=Vt,Vt=Te.pop()),Vt=ne.symbols_[Vt]||Vt),Vt}T(dt,"lex");for(var oe,Rt,ft,ht,kt={},qr,ye,et,ut;;){if(Rt=Be[Be.length-1],this.defaultActions[Rt]?ft=this.defaultActions[Rt]:((oe===null||typeof oe>"u")&&(oe=dt()),ft=qe[Rt]&&qe[Rt][oe]),typeof ft>"u"||!ft.length||!ft[0]){var Lt="";ut=[];for(qr in qe[Rt])this.terminals_[qr]&&qr>it&&ut.push("'"+this.terminals_[qr]+"'");be.showPosition?Lt="Parse error on line "+(Xe+1)+`: `+be.showPosition()+` -Expecting `+ct.join(", ")+", got '"+(this.terminals_[oe]||oe)+"'":_t="Parse error on line "+(Xe+1)+": Unexpected "+(oe==we?"end of input":"'"+(this.terminals_[oe]||oe)+"'"),this.parseError(_t,{text:be.match,token:this.terminals_[oe]||oe,line:be.yylineno,loc:ot,expected:ct})}if(dt[0]instanceof Array&&dt.length>1)throw new Error("Parse Error: multiple actions possible at state: "+At+", token: "+oe);switch(dt[0]){case 1:Be.push(oe),Ue.push(be.yytext),De.push(be.yylloc),Be.push(dt[1]),oe=null,Ie=be.yyleng,Le=be.yytext,Xe=be.yylineno,ot=be.yylloc;break;case 2:if(ye=this.productions_[dt[1]][1],wt.$=Ue[Ue.length-ye],wt._$={first_line:De[De.length-(ye||1)].first_line,last_line:De[De.length-1].last_line,first_column:De[De.length-(ye||1)].first_column,last_column:De[De.length-1].last_column},It&&(wt._$.range=[De[De.length-(ye||1)].range[0],De[De.length-1].range[1]]),ut=this.performAction.apply(wt,[Le,Ie,Xe,Et.yy,dt[1],Ue,De].concat(lt)),typeof ut<"u")return ut;ye&&(Be=Be.slice(0,-1*ye*2),Ue=Ue.slice(0,-1*ye),De=De.slice(0,-1*ye)),Be.push(this.productions_[dt[1]][0]),Ue.push(wt.$),De.push(wt._$),et=qe[Be[Be.length-2]][Be[Be.length-1]],Be.push(et);break;case 3:return!0}}return!0},"parse")},H=(function(){var j={EOF:1,parseError:x(function(re,Be){if(this.yy.parser)this.yy.parser.parseError(re,Be);else throw new Error(re)},"parseError"),setInput:x(function(pe,re){return this.yy=re||this.yy||{},this._input=pe,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:x(function(){var pe=this._input[0];this.yytext+=pe,this.yyleng++,this.offset++,this.match+=pe,this.matched+=pe;var re=pe.match(/(?:\r\n?|\n).*/g);return re?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),pe},"input"),unput:x(function(pe){var re=pe.length,Be=pe.split(/(?:\r\n?|\n)/g);this._input=pe+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-re),this.offset-=re;var xe=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),Be.length-1&&(this.yylineno-=Be.length-1);var Ue=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:Be?(Be.length===xe.length?this.yylloc.first_column:0)+xe[xe.length-Be.length].length-Be[0].length:this.yylloc.first_column-re},this.options.ranges&&(this.yylloc.range=[Ue[0],Ue[0]+this.yyleng-re]),this.yyleng=this.yytext.length,this},"unput"),more:x(function(){return this._more=!0,this},"more"),reject:x(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). -`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:x(function(pe){this.unput(this.match.slice(pe))},"less"),pastInput:x(function(){var pe=this.matched.substr(0,this.matched.length-this.match.length);return(pe.length>20?"...":"")+pe.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:x(function(){var pe=this.match;return pe.length<20&&(pe+=this._input.substr(0,20-pe.length)),(pe.substr(0,20)+(pe.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:x(function(){var pe=this.pastInput(),re=new Array(pe.length+1).join("-");return pe+this.upcomingInput()+` -`+re+"^"},"showPosition"),test_match:x(function(pe,re){var Be,xe,Ue;if(this.options.backtrack_lexer&&(Ue={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&&(Ue.yylloc.range=this.yylloc.range.slice(0))),xe=pe[0].match(/(?:\r\n?|\n).*/g),xe&&(this.yylineno+=xe.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:xe?xe[xe.length-1].length-xe[xe.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+pe[0].length},this.yytext+=pe[0],this.match+=pe[0],this.matches=pe,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(pe[0].length),this.matched+=pe[0],Be=this.performAction.call(this,this.yy,this,re,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),Be)return Be;if(this._backtrack){for(var De in Ue)this[De]=Ue[De];return!1}return!1},"test_match"),next:x(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var pe,re,Be,xe;this._more||(this.yytext="",this.match="");for(var Ue=this._currentRules(),De=0;Dere[0].length)){if(re=Be,xe=De,this.options.backtrack_lexer){if(pe=this.test_match(Be,Ue[De]),pe!==!1)return pe;if(this._backtrack){re=!1;continue}else return!1}else if(!this.options.flex)break}return re?(pe=this.test_match(re,Ue[xe]),pe!==!1?pe:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var re=this.next();return re||this.lex()},"lex"),begin:x(function(re){this.conditionStack.push(re)},"begin"),popState:x(function(){var re=this.conditionStack.length-1;return re>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(re){return re=this.conditionStack.length-1-Math.abs(re||0),re>=0?this.conditionStack[re]:"INITIAL"},"topState"),pushState:x(function(re){this.begin(re)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:x(function(re,Be,xe,Ue){switch(xe){case 0:break;case 1:break;case 2:return 55;case 3:break;case 4:return this.begin("title"),35;case 5:return this.popState(),"title_value";case 6:return this.begin("acc_title"),37;case 7:return this.popState(),"acc_title_value";case 8:return this.begin("acc_descr"),39;case 9:return this.popState(),"acc_descr_value";case 10:this.begin("acc_descr_multiline");break;case 11:this.popState();break;case 12:return"acc_descr_multiline_value";case 13:return 48;case 14:return 50;case 15:return 49;case 16:return 51;case 17:return 52;case 18:return 53;case 19:return 54;case 20:return 25;case 21:this.begin("md_string");break;case 22:return"MD_STR";case 23:this.popState();break;case 24:this.begin("string");break;case 25:this.popState();break;case 26:return"STR";case 27:this.begin("class_name");break;case 28:return this.popState(),47;case 29:return this.begin("point_start"),44;case 30:return this.begin("point_x"),45;case 31:this.popState();break;case 32:this.popState(),this.begin("point_y");break;case 33:return this.popState(),46;case 34:return 28;case 35:return 4;case 36:return 15;case 37:return 11;case 38:return 64;case 39:return 10;case 40:return 65;case 41:return 65;case 42:return 14;case 43:return 13;case 44:return 67;case 45:return 66;case 46:return 12;case 47:return 8;case 48:return 5;case 49:return 18;case 50:return 56;case 51:return 63;case 52: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,/^(?:[^\x00-\x7F]+)/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,52],inclusive:!0}}};return j})();Se.lexer=H;function he(){this.yy={}}return x(he,"Parser"),he.prototype=Se,Se.Parser=he,new he})();s$.parser=s$;var Zot=s$,hs=w0(),Qot=(Av=class{constructor(){this.classes=new Map,this.config=this.getDefaultConfig(),this.themeConfig=this.getDefaultThemeConfig(),this.data=this.getDefaultData()}getDefaultData(){return{titleText:"",quadrant1Text:"",quadrant2Text:"",quadrant3Text:"",quadrant4Text:"",xAxisLeftText:"",xAxisRightText:"",yAxisBottomText:"",yAxisTopText:"",points:[]}}getDefaultConfig(){var e,r,n,i,a,s,o,l,u,h,d,f,p,g,m,y,v,T;return{showXAxis:!0,showYAxis:!0,showTitle:!0,chartHeight:((e=Fr.quadrantChart)==null?void 0:e.chartWidth)||500,chartWidth:((r=Fr.quadrantChart)==null?void 0:r.chartHeight)||500,titlePadding:((n=Fr.quadrantChart)==null?void 0:n.titlePadding)||10,titleFontSize:((i=Fr.quadrantChart)==null?void 0:i.titleFontSize)||20,quadrantPadding:((a=Fr.quadrantChart)==null?void 0:a.quadrantPadding)||5,xAxisLabelPadding:((s=Fr.quadrantChart)==null?void 0:s.xAxisLabelPadding)||5,yAxisLabelPadding:((o=Fr.quadrantChart)==null?void 0:o.yAxisLabelPadding)||5,xAxisLabelFontSize:((l=Fr.quadrantChart)==null?void 0:l.xAxisLabelFontSize)||16,yAxisLabelFontSize:((u=Fr.quadrantChart)==null?void 0:u.yAxisLabelFontSize)||16,quadrantLabelFontSize:((h=Fr.quadrantChart)==null?void 0:h.quadrantLabelFontSize)||16,quadrantTextTopPadding:((d=Fr.quadrantChart)==null?void 0:d.quadrantTextTopPadding)||5,pointTextPadding:((f=Fr.quadrantChart)==null?void 0:f.pointTextPadding)||5,pointLabelFontSize:((p=Fr.quadrantChart)==null?void 0:p.pointLabelFontSize)||12,pointRadius:((g=Fr.quadrantChart)==null?void 0:g.pointRadius)||5,xAxisPosition:((m=Fr.quadrantChart)==null?void 0:m.xAxisPosition)||"top",yAxisPosition:((y=Fr.quadrantChart)==null?void 0:y.yAxisPosition)||"left",quadrantInternalBorderStrokeWidth:((v=Fr.quadrantChart)==null?void 0:v.quadrantInternalBorderStrokeWidth)||1,quadrantExternalBorderStrokeWidth:((T=Fr.quadrantChart)==null?void 0:T.quadrantExternalBorderStrokeWidth)||2}}getDefaultThemeConfig(){return{quadrant1Fill:hs.quadrant1Fill,quadrant2Fill:hs.quadrant2Fill,quadrant3Fill:hs.quadrant3Fill,quadrant4Fill:hs.quadrant4Fill,quadrant1TextFill:hs.quadrant1TextFill,quadrant2TextFill:hs.quadrant2TextFill,quadrant3TextFill:hs.quadrant3TextFill,quadrant4TextFill:hs.quadrant4TextFill,quadrantPointFill:hs.quadrantPointFill,quadrantPointTextFill:hs.quadrantPointTextFill,quadrantXAxisTextFill:hs.quadrantXAxisTextFill,quadrantYAxisTextFill:hs.quadrantYAxisTextFill,quadrantTitleFill:hs.quadrantTitleFill,quadrantInternalBorderStrokeFill:hs.quadrantInternalBorderStrokeFill,quadrantExternalBorderStrokeFill:hs.quadrantExternalBorderStrokeFill}}clear(){this.config=this.getDefaultConfig(),this.themeConfig=this.getDefaultThemeConfig(),this.data=this.getDefaultData(),this.classes=new Map,ae.info("clear called")}setData(e){this.data={...this.data,...e}}addPoints(e){this.data.points=[...e,...this.data.points]}addClass(e,r){this.classes.set(e,r)}setConfig(e){ae.trace("setConfig called with: ",e),this.config={...this.config,...e}}setThemeConfig(e){ae.trace("setThemeConfig called with: ",e),this.themeConfig={...this.themeConfig,...e}}calculateSpace(e,r,n,i){const a=this.config.xAxisLabelPadding*2+this.config.xAxisLabelFontSize,s={top:e==="top"&&r?a:0,bottom:e==="bottom"&&r?a:0},o=this.config.yAxisLabelPadding*2+this.config.yAxisLabelFontSize,l={left:this.config.yAxisPosition==="left"&&n?o:0,right:this.config.yAxisPosition==="right"&&n?o:0},u=this.config.titleFontSize+this.config.titlePadding*2,h={top:i?u:0},d=this.config.quadrantPadding+l.left,f=this.config.quadrantPadding+s.top+h.top,p=this.config.chartWidth-this.config.quadrantPadding*2-l.left-l.right,g=this.config.chartHeight-this.config.quadrantPadding*2-s.top-s.bottom-h.top,m=p/2,y=g/2;return{xAxisSpace:s,yAxisSpace:l,titleSpace:h,quadrantSpace:{quadrantLeft:d,quadrantTop:f,quadrantWidth:p,quadrantHalfWidth:m,quadrantHeight:g,quadrantHalfHeight:y}}}getAxisLabels(e,r,n,i){const{quadrantSpace:a,titleSpace:s}=i,{quadrantHalfHeight:o,quadrantHeight:l,quadrantLeft:u,quadrantHalfWidth:h,quadrantTop:d,quadrantWidth:f}=a,p=!!this.data.xAxisRightText,g=!!this.data.yAxisTopText,m=[];return this.data.xAxisLeftText&&r&&m.push({text:this.data.xAxisLeftText,fill:this.themeConfig.quadrantXAxisTextFill,x:u+(p?h/2:0),y:e==="top"?this.config.xAxisLabelPadding+s.top:this.config.xAxisLabelPadding+d+l+this.config.quadrantPadding,fontSize:this.config.xAxisLabelFontSize,verticalPos:p?"center":"left",horizontalPos:"top",rotation:0}),this.data.xAxisRightText&&r&&m.push({text:this.data.xAxisRightText,fill:this.themeConfig.quadrantXAxisTextFill,x:u+h+(p?h/2:0),y:e==="top"?this.config.xAxisLabelPadding+s.top:this.config.xAxisLabelPadding+d+l+this.config.quadrantPadding,fontSize:this.config.xAxisLabelFontSize,verticalPos:p?"center":"left",horizontalPos:"top",rotation:0}),this.data.yAxisBottomText&&n&&m.push({text:this.data.yAxisBottomText,fill:this.themeConfig.quadrantYAxisTextFill,x:this.config.yAxisPosition==="left"?this.config.yAxisLabelPadding:this.config.yAxisLabelPadding+u+f+this.config.quadrantPadding,y:d+l-(g?o/2:0),fontSize:this.config.yAxisLabelFontSize,verticalPos:g?"center":"left",horizontalPos:"top",rotation:-90}),this.data.yAxisTopText&&n&&m.push({text:this.data.yAxisTopText,fill:this.themeConfig.quadrantYAxisTextFill,x:this.config.yAxisPosition==="left"?this.config.yAxisLabelPadding:this.config.yAxisLabelPadding+u+f+this.config.quadrantPadding,y:d+o-(g?o/2:0),fontSize:this.config.yAxisLabelFontSize,verticalPos:g?"center":"left",horizontalPos:"top",rotation:-90}),m}getQuadrants(e){const{quadrantSpace:r}=e,{quadrantHalfHeight:n,quadrantLeft:i,quadrantHalfWidth:a,quadrantTop:s}=r,o=[{text:{text:this.data.quadrant1Text,fill:this.themeConfig.quadrant1TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:"center",horizontalPos:"middle",rotation:0},x:i+a,y:s,width:a,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:i,y:s,width:a,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:i,y:s+n,width:a,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:i+a,y:s+n,width:a,height:n,fill:this.themeConfig.quadrant4Fill}];for(const l of o)l.text.x=l.x+l.width/2,this.data.points.length===0?(l.text.y=l.y+l.height/2,l.text.horizontalPos="middle"):(l.text.y=l.y+this.config.quadrantTextTopPadding,l.text.horizontalPos="top");return o}getQuadrantPoints(e){const{quadrantSpace:r}=e,{quadrantHeight:n,quadrantLeft:i,quadrantTop:a,quadrantWidth:s}=r,o=D0().domain([0,1]).range([i,s+i]),l=D0().domain([0,1]).range([n+a,a]);return this.data.points.map(h=>{const d=this.classes.get(h.className);return d&&(h={...d,...h}),{x:o(h.x),y:l(h.y),fill:h.color??this.themeConfig.quadrantPointFill,radius:h.radius??this.config.pointRadius,text:{text:h.text,fill:this.themeConfig.quadrantPointTextFill,x:o(h.x),y:l(h.y)+this.config.pointTextPadding,verticalPos:"center",horizontalPos:"top",fontSize:this.config.pointLabelFontSize,rotation:0},strokeColor:h.strokeColor??this.themeConfig.quadrantPointFill,strokeWidth:h.strokeWidth??"0px"}})}getBorders(e){const r=this.config.quadrantExternalBorderStrokeWidth/2,{quadrantSpace:n}=e,{quadrantHalfHeight:i,quadrantHeight:a,quadrantLeft:s,quadrantHalfWidth:o,quadrantTop:l,quadrantWidth:u}=n;return[{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:s-r,y1:l,x2:s+u+r,y2:l},{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:s+u,y1:l+r,x2:s+u,y2:l+a-r},{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:s-r,y1:l+a,x2:s+u+r,y2:l+a},{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:s,y1:l+r,x2:s,y2:l+a-r},{strokeFill:this.themeConfig.quadrantInternalBorderStrokeFill,strokeWidth:this.config.quadrantInternalBorderStrokeWidth,x1:s+o,y1:l+r,x2:s+o,y2:l+a-r},{strokeFill:this.themeConfig.quadrantInternalBorderStrokeFill,strokeWidth:this.config.quadrantInternalBorderStrokeWidth,x1:s+r,y1:l+i,x2:s+u-r,y2:l+i}]}getTitle(e){if(e)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 e=this.config.showXAxis&&!!(this.data.xAxisLeftText||this.data.xAxisRightText),r=this.config.showYAxis&&!!(this.data.yAxisTopText||this.data.yAxisBottomText),n=this.config.showTitle&&!!this.data.titleText,i=this.data.points.length>0?"bottom":this.config.xAxisPosition,a=this.calculateSpace(i,e,r,n);return{points:this.getQuadrantPoints(a),quadrants:this.getQuadrants(a),axisLabels:this.getAxisLabels(i,e,r,a),borderLines:this.getBorders(a),title:this.getTitle(n)}}},x(Av,"QuadrantBuilder"),Av),vS=(_v=class extends Error{constructor(e,r,n){super(`value for ${e} ${r} is invalid, please use a valid ${n}`),this.name="InvalidStyleError"}},x(_v,"InvalidStyleError"),_v);function o$(t){return!/^#?([\dA-Fa-f]{6}|[\dA-Fa-f]{3})$/.test(t)}x(o$,"validateHexCode");function fge(t){return!/^\d+$/.test(t)}x(fge,"validateNumber");function pge(t){return!/^\d+px$/.test(t)}x(pge,"validateSizeInPixels");var Jot=Pe();function ac(t){return qr(t.trim(),Jot)}x(ac,"textSanitizer");var wa=new Qot;function gge(t){wa.setData({quadrant1Text:ac(t.text)})}x(gge,"setQuadrant1Text");function mge(t){wa.setData({quadrant2Text:ac(t.text)})}x(mge,"setQuadrant2Text");function yge(t){wa.setData({quadrant3Text:ac(t.text)})}x(yge,"setQuadrant3Text");function vge(t){wa.setData({quadrant4Text:ac(t.text)})}x(vge,"setQuadrant4Text");function bge(t){wa.setData({xAxisLeftText:ac(t.text)})}x(bge,"setXAxisLeftText");function xge(t){wa.setData({xAxisRightText:ac(t.text)})}x(xge,"setXAxisRightText");function Tge(t){wa.setData({yAxisTopText:ac(t.text)})}x(Tge,"setYAxisTopText");function wge(t){wa.setData({yAxisBottomText:ac(t.text)})}x(wge,"setYAxisBottomText");function bS(t){const e={};for(const r of t){const[n,i]=r.trim().split(/\s*:\s*/);if(n==="radius"){if(fge(i))throw new vS(n,i,"number");e.radius=parseInt(i)}else if(n==="color"){if(o$(i))throw new vS(n,i,"hex code");e.color=i}else if(n==="stroke-color"){if(o$(i))throw new vS(n,i,"hex code");e.strokeColor=i}else if(n==="stroke-width"){if(pge(i))throw new vS(n,i,"number of pixels (eg. 10px)");e.strokeWidth=i}else throw new Error(`style named ${n} is not supported.`)}return e}x(bS,"parseStyles");function Cge(t,e,r,n,i){const a=bS(i);wa.addPoints([{x:r,y:n,text:ac(t.text),className:e,...a}])}x(Cge,"addPoint");function kge(t,e){wa.addClass(t,bS(e))}x(kge,"addClass");function Ege(t){wa.setConfig({chartWidth:t})}x(Ege,"setWidth");function Sge(t){wa.setConfig({chartHeight:t})}x(Sge,"setHeight");function Age(){const t=Pe(),{themeVariables:e,quadrantChart:r}=t;return r&&wa.setConfig(r),wa.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}),wa.setData({titleText:Mn()}),wa.build()}x(Age,"getQuadrantData");var elt=x(function(){wa.clear(),In()},"clear"),tlt={setWidth:Ege,setHeight:Sge,setQuadrant1Text:gge,setQuadrant2Text:mge,setQuadrant3Text:yge,setQuadrant4Text:vge,setXAxisLeftText:bge,setXAxisRightText:xge,setYAxisTopText:Tge,setYAxisBottomText:wge,parseStyles:bS,addPoint:Cge,addClass:kge,getQuadrantData:Age,clear:elt,setAccTitle:Dn,getAccTitle:Fn,setDiagramTitle:qn,getDiagramTitle:Mn,getAccDescription:Gn,setAccDescription:zn},rlt=x((t,e,r,n)=>{var _,L,O;function i(M){return M==="top"?"hanging":"middle"}x(i,"getDominantBaseLine");function a(M){return M==="left"?"start":"middle"}x(a,"getTextAnchor");function s(M){return`translate(${M.x}, ${M.y}) rotate(${M.rotation||0})`}x(s,"getTransformation");const o=Pe();ae.debug(`Rendering quadrant chart -`+t);const l=o.securityLevel;let u;l==="sandbox"&&(u=pt("#i"+e));const d=pt(l==="sandbox"?u.nodes()[0].contentDocument.body:"body").select(`[id="${e}"]`),f=d.append("g").attr("class","main"),p=((_=o.quadrantChart)==null?void 0:_.chartWidth)??500,g=((L=o.quadrantChart)==null?void 0:L.chartHeight)??500;wi(d,g,p,((O=o.quadrantChart)==null?void 0:O.useMaxWidth)??!0),d.attr("viewBox","0 0 "+p+" "+g),n.db.setHeight(g),n.db.setWidth(p);const m=n.db.getQuadrantData(),y=f.append("g").attr("class","quadrants"),v=f.append("g").attr("class","border"),T=f.append("g").attr("class","data-points"),b=f.append("g").attr("class","labels"),w=f.append("g").attr("class","title");m.title&&w.append("text").attr("x",0).attr("y",0).attr("fill",m.title.fill).attr("font-size",m.title.fontSize).attr("dominant-baseline",i(m.title.horizontalPos)).attr("text-anchor",a(m.title.verticalPos)).attr("transform",s(m.title)).text(m.title.text),m.borderLines&&v.selectAll("line").data(m.borderLines).enter().append("line").attr("x1",M=>M.x1).attr("y1",M=>M.y1).attr("x2",M=>M.x2).attr("y2",M=>M.y2).style("stroke",M=>M.strokeFill).style("stroke-width",M=>M.strokeWidth);const k=y.selectAll("g.quadrant").data(m.quadrants).enter().append("g").attr("class","quadrant");k.append("rect").attr("x",M=>M.x).attr("y",M=>M.y).attr("width",M=>M.width).attr("height",M=>M.height).attr("fill",M=>M.fill),k.append("text").attr("x",0).attr("y",0).attr("fill",M=>M.text.fill).attr("font-size",M=>M.text.fontSize).attr("dominant-baseline",M=>i(M.text.horizontalPos)).attr("text-anchor",M=>a(M.text.verticalPos)).attr("transform",M=>s(M.text)).text(M=>M.text.text),b.selectAll("g.label").data(m.axisLabels).enter().append("g").attr("class","label").append("text").attr("x",0).attr("y",0).text(M=>M.text).attr("fill",M=>M.fill).attr("font-size",M=>M.fontSize).attr("dominant-baseline",M=>i(M.horizontalPos)).attr("text-anchor",M=>a(M.verticalPos)).attr("transform",M=>s(M));const C=T.selectAll("g.data-point").data(m.points).enter().append("g").attr("class","data-point");C.append("circle").attr("cx",M=>M.x).attr("cy",M=>M.y).attr("r",M=>M.radius).attr("fill",M=>M.fill).attr("stroke",M=>M.strokeColor).attr("stroke-width",M=>M.strokeWidth),C.append("text").attr("x",0).attr("y",0).text(M=>M.text.text).attr("fill",M=>M.text.fill).attr("font-size",M=>M.text.fontSize).attr("dominant-baseline",M=>i(M.text.horizontalPos)).attr("text-anchor",M=>a(M.text.verticalPos)).attr("transform",M=>s(M.text))},"draw"),nlt={draw:rlt},ilt={parser:Zot,db:tlt,renderer:nlt,styles:x(()=>"","styles")};const alt=Object.freeze(Object.defineProperty({__proto__:null,diagram:ilt},Symbol.toStringTag,{value:"Module"}));var l$=(function(){var t=x(function(R,N,D,I){for(D=D||{},I=R.length;I--;D[R[I]]=N);return D},"o"),e=[1,10,12,14,16,18,19,21,23],r=[2,6],n=[1,3],i=[1,5],a=[1,6],s=[1,7],o=[1,5,10,12,14,16,18,19,21,23,34,35,36],l=[1,25],u=[1,26],h=[1,28],d=[1,29],f=[1,30],p=[1,31],g=[1,32],m=[1,33],y=[1,34],v=[1,35],T=[1,36],b=[1,37],w=[1,43],k=[1,42],A=[1,47],C=[1,50],_=[1,10,12,14,16,18,19,21,23,34,35,36],L=[1,10,12,14,16,18,19,21,23,24,26,27,28,34,35,36],O=[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],M=[1,64],z={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,start:3,eol:4,XYCHART:5,chartConfig:6,document:7,CHART_ORIENTATION:8,statement:9,title:10,text:11,X_AXIS:12,parseXAxis:13,Y_AXIS:14,parseYAxis:15,LINE:16,plotData:17,BAR:18,acc_title:19,acc_title_value:20,acc_descr:21,acc_descr_value:22,acc_descr_multiline_value:23,SQUARE_BRACES_START:24,commaSeparatedNumbers:25,SQUARE_BRACES_END:26,NUMBER_WITH_DECIMAL:27,COMMA:28,xAxisData:29,bandData:30,ARROW_DELIMITER:31,commaSeparatedTexts:32,yAxisData:33,NEWLINE:34,SEMI:35,EOF:36,alphaNum:37,STR:38,MD_STR:39,alphaNumToken:40,AMP:41,NUM:42,ALPHA:43,PLUS:44,EQUALS:45,MULT:46,DOT:47,BRKT:48,MINUS:49,UNDERSCORE:50,$accept:0,$end:1},terminals_:{2:"error",5:"XYCHART",8:"CHART_ORIENTATION",10:"title",12:"X_AXIS",14:"Y_AXIS",16:"LINE",18:"BAR",19:"acc_title",20:"acc_title_value",21:"acc_descr",22:"acc_descr_value",23:"acc_descr_multiline_value",24:"SQUARE_BRACES_START",26:"SQUARE_BRACES_END",27:"NUMBER_WITH_DECIMAL",28:"COMMA",31:"ARROW_DELIMITER",34:"NEWLINE",35:"SEMI",36:"EOF",38:"STR",39:"MD_STR",41:"AMP",42:"NUM",43:"ALPHA",44:"PLUS",45:"EQUALS",46:"MULT",47:"DOT",48:"BRKT",49:"MINUS",50:"UNDERSCORE"},productions_:[0,[3,2],[3,3],[3,2],[3,1],[6,1],[7,0],[7,2],[9,2],[9,2],[9,2],[9,2],[9,2],[9,3],[9,2],[9,3],[9,2],[9,2],[9,1],[17,3],[25,3],[25,1],[13,1],[13,2],[13,1],[29,1],[29,3],[30,3],[32,3],[32,1],[15,1],[15,2],[15,1],[33,3],[4,1],[4,1],[4,1],[11,1],[11,1],[11,1],[37,1],[37,2],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1]],performAction:x(function(N,D,I,$,B,P,G){var V=P.length-1;switch(B){case 5:$.setOrientation(P[V]);break;case 9:$.setDiagramTitle(P[V].text.trim());break;case 12:$.setLineData({text:"",type:"text"},P[V]);break;case 13:$.setLineData(P[V-1],P[V]);break;case 14:$.setBarData({text:"",type:"text"},P[V]);break;case 15:$.setBarData(P[V-1],P[V]);break;case 16:this.$=P[V].trim(),$.setAccTitle(this.$);break;case 17:case 18:this.$=P[V].trim(),$.setAccDescription(this.$);break;case 19:this.$=P[V-1];break;case 20:this.$=[Number(P[V-2]),...P[V]];break;case 21:this.$=[Number(P[V])];break;case 22:$.setXAxisTitle(P[V]);break;case 23:$.setXAxisTitle(P[V-1]);break;case 24:$.setXAxisTitle({type:"text",text:""});break;case 25:$.setXAxisBand(P[V]);break;case 26:$.setXAxisRangeData(Number(P[V-2]),Number(P[V]));break;case 27:this.$=P[V-1];break;case 28:this.$=[P[V-2],...P[V]];break;case 29:this.$=[P[V]];break;case 30:$.setYAxisTitle(P[V]);break;case 31:$.setYAxisTitle(P[V-1]);break;case 32:$.setYAxisTitle({type:"text",text:""});break;case 33:$.setYAxisRangeData(Number(P[V-2]),Number(P[V]));break;case 37:this.$={text:P[V],type:"text"};break;case 38:this.$={text:P[V],type:"text"};break;case 39:this.$={text:P[V],type:"markdown"};break;case 40:this.$=P[V];break;case 41:this.$=P[V-1]+""+P[V];break}},"anonymous"),table:[t(e,r,{3:1,4:2,7:4,5:n,34:i,35:a,36:s}),{1:[3]},t(e,r,{4:2,7:4,3:8,5:n,34:i,35:a,36:s}),t(e,r,{4:2,7:4,6:9,3:10,5:n,8:[1,11],34:i,35:a,36:s}),{1:[2,4],9:12,10:[1,13],12:[1,14],14:[1,15],16:[1,16],18:[1,17],19:[1,18],21:[1,19],23:[1,20]},t(o,[2,34]),t(o,[2,35]),t(o,[2,36]),{1:[2,1]},t(e,r,{4:2,7:4,3:21,5:n,34:i,35:a,36:s}),{1:[2,3]},t(o,[2,5]),t(e,[2,7],{4:22,34:i,35:a,36:s}),{11:23,37:24,38:l,39:u,40:27,41:h,42:d,43:f,44:p,45:g,46:m,47:y,48:v,49:T,50:b},{11:39,13:38,24:w,27:k,29:40,30:41,37:24,38:l,39:u,40:27,41:h,42:d,43:f,44:p,45:g,46:m,47:y,48:v,49:T,50:b},{11:45,15:44,27:A,33:46,37:24,38:l,39:u,40:27,41:h,42:d,43:f,44:p,45:g,46:m,47:y,48:v,49:T,50:b},{11:49,17:48,24:C,37:24,38:l,39:u,40:27,41:h,42:d,43:f,44:p,45:g,46:m,47:y,48:v,49:T,50:b},{11:52,17:51,24:C,37:24,38:l,39:u,40:27,41:h,42:d,43:f,44:p,45:g,46:m,47:y,48:v,49:T,50:b},{20:[1,53]},{22:[1,54]},t(_,[2,18]),{1:[2,2]},t(_,[2,8]),t(_,[2,9]),t(L,[2,37],{40:55,41:h,42:d,43:f,44:p,45:g,46:m,47:y,48:v,49:T,50:b}),t(L,[2,38]),t(L,[2,39]),t(O,[2,40]),t(O,[2,42]),t(O,[2,43]),t(O,[2,44]),t(O,[2,45]),t(O,[2,46]),t(O,[2,47]),t(O,[2,48]),t(O,[2,49]),t(O,[2,50]),t(O,[2,51]),t(_,[2,10]),t(_,[2,22],{30:41,29:56,24:w,27:k}),t(_,[2,24]),t(_,[2,25]),{31:[1,57]},{11:59,32:58,37:24,38:l,39:u,40:27,41:h,42:d,43:f,44:p,45:g,46:m,47:y,48:v,49:T,50:b},t(_,[2,11]),t(_,[2,30],{33:60,27:A}),t(_,[2,32]),{31:[1,61]},t(_,[2,12]),{17:62,24:C},{25:63,27:M},t(_,[2,14]),{17:65,24:C},t(_,[2,16]),t(_,[2,17]),t(O,[2,41]),t(_,[2,23]),{27:[1,66]},{26:[1,67]},{26:[2,29],28:[1,68]},t(_,[2,31]),{27:[1,69]},t(_,[2,13]),{26:[1,70]},{26:[2,21],28:[1,71]},t(_,[2,15]),t(_,[2,26]),t(_,[2,27]),{11:59,32:72,37:24,38:l,39:u,40:27,41:h,42:d,43:f,44:p,45:g,46:m,47:y,48:v,49:T,50:b},t(_,[2,33]),t(_,[2,19]),{25:73,27:M},{26:[2,28]},{26:[2,20]}],defaultActions:{8:[2,1],10:[2,3],21:[2,2],72:[2,28],73:[2,20]},parseError:x(function(N,D){if(D.recoverable)this.trace(N);else{var I=new Error(N);throw I.hash=D,I}},"parseError"),parse:x(function(N){var D=this,I=[0],$=[],B=[null],P=[],G=this.table,V="",Y=0,W=0,ie=2,K=1,se=P.slice.call(arguments,1),J=Object.create(this.lexer),Z={yy:{}};for(var ee in this.yy)Object.prototype.hasOwnProperty.call(this.yy,ee)&&(Z.yy[ee]=this.yy[ee]);J.setInput(N,Z.yy),Z.yy.lexer=J,Z.yy.parser=this,typeof J.yylloc>"u"&&(J.yylloc={});var ne=J.yylloc;P.push(ne);var ue=J.options&&J.options.ranges;typeof Z.yy.parseError=="function"?this.parseError=Z.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function fe(nt){I.length=I.length-2*nt,B.length=B.length-nt,P.length=P.length-nt}x(fe,"popStack");function _e(){var nt;return nt=$.pop()||J.lex()||K,typeof nt!="number"&&(nt instanceof Array&&($=nt,nt=$.pop()),nt=D.symbols_[nt]||nt),nt}x(_e,"lex");for(var Ae,Ne,me,ve,Ge={},Te,Ze,ke,Ve;;){if(Ne=I[I.length-1],this.defaultActions[Ne]?me=this.defaultActions[Ne]:((Ae===null||typeof Ae>"u")&&(Ae=_e()),me=G[Ne]&&G[Ne][Ae]),typeof me>"u"||!me.length||!me[0]){var Qe="";Ve=[];for(Te in G[Ne])this.terminals_[Te]&&Te>ie&&Ve.push("'"+this.terminals_[Te]+"'");J.showPosition?Qe="Parse error on line "+(Y+1)+`: +Expecting `+ut.join(", ")+", got '"+(this.terminals_[oe]||oe)+"'":Lt="Parse error on line "+(Xe+1)+": Unexpected "+(oe==we?"end of input":"'"+(this.terminals_[oe]||oe)+"'"),this.parseError(Lt,{text:be.match,token:this.terminals_[oe]||oe,line:be.yylineno,loc:lt,expected:ut})}if(ft[0]instanceof Array&&ft.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Rt+", token: "+oe);switch(ft[0]){case 1:Be.push(oe),Ue.push(be.yytext),De.push(be.yylloc),Be.push(ft[1]),oe=null,Ie=be.yyleng,Le=be.yytext,Xe=be.yylineno,lt=be.yylloc;break;case 2:if(ye=this.productions_[ft[1]][1],kt.$=Ue[Ue.length-ye],kt._$={first_line:De[De.length-(ye||1)].first_line,last_line:De[De.length-1].last_line,first_column:De[De.length-(ye||1)].first_column,last_column:De[De.length-1].last_column},Mt&&(kt._$.range=[De[De.length-(ye||1)].range[0],De[De.length-1].range[1]]),ht=this.performAction.apply(kt,[Le,Ie,Xe,_t.yy,ft[1],Ue,De].concat(ct)),typeof ht<"u")return ht;ye&&(Be=Be.slice(0,-1*ye*2),Ue=Ue.slice(0,-1*ye),De=De.slice(0,-1*ye)),Be.push(this.productions_[ft[1]][0]),Ue.push(kt.$),De.push(kt._$),et=qe[Be[Be.length-2]][Be[Be.length-1]],Be.push(et);break;case 3:return!0}}return!0},"parse")},Y=(function(){var Z={EOF:1,parseError:T(function(ne,Be){if(this.yy.parser)this.yy.parser.parseError(ne,Be);else throw new Error(ne)},"parseError"),setInput:T(function(pe,ne){return this.yy=ne||this.yy||{},this._input=pe,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:T(function(){var pe=this._input[0];this.yytext+=pe,this.yyleng++,this.offset++,this.match+=pe,this.matched+=pe;var ne=pe.match(/(?:\r\n?|\n).*/g);return ne?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),pe},"input"),unput:T(function(pe){var ne=pe.length,Be=pe.split(/(?:\r\n?|\n)/g);this._input=pe+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-ne),this.offset-=ne;var Te=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),Be.length-1&&(this.yylineno-=Be.length-1);var Ue=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:Be?(Be.length===Te.length?this.yylloc.first_column:0)+Te[Te.length-Be.length].length-Be[0].length:this.yylloc.first_column-ne},this.options.ranges&&(this.yylloc.range=[Ue[0],Ue[0]+this.yyleng-ne]),this.yyleng=this.yytext.length,this},"unput"),more:T(function(){return this._more=!0,this},"more"),reject:T(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). +`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:T(function(pe){this.unput(this.match.slice(pe))},"less"),pastInput:T(function(){var pe=this.matched.substr(0,this.matched.length-this.match.length);return(pe.length>20?"...":"")+pe.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:T(function(){var pe=this.match;return pe.length<20&&(pe+=this._input.substr(0,20-pe.length)),(pe.substr(0,20)+(pe.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:T(function(){var pe=this.pastInput(),ne=new Array(pe.length+1).join("-");return pe+this.upcomingInput()+` +`+ne+"^"},"showPosition"),test_match:T(function(pe,ne){var Be,Te,Ue;if(this.options.backtrack_lexer&&(Ue={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&&(Ue.yylloc.range=this.yylloc.range.slice(0))),Te=pe[0].match(/(?:\r\n?|\n).*/g),Te&&(this.yylineno+=Te.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:Te?Te[Te.length-1].length-Te[Te.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+pe[0].length},this.yytext+=pe[0],this.match+=pe[0],this.matches=pe,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(pe[0].length),this.matched+=pe[0],Be=this.performAction.call(this,this.yy,this,ne,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),Be)return Be;if(this._backtrack){for(var De in Ue)this[De]=Ue[De];return!1}return!1},"test_match"),next:T(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var pe,ne,Be,Te;this._more||(this.yytext="",this.match="");for(var Ue=this._currentRules(),De=0;Dene[0].length)){if(ne=Be,Te=De,this.options.backtrack_lexer){if(pe=this.test_match(Be,Ue[De]),pe!==!1)return pe;if(this._backtrack){ne=!1;continue}else return!1}else if(!this.options.flex)break}return ne?(pe=this.test_match(ne,Ue[Te]),pe!==!1?pe:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:T(function(){var ne=this.next();return ne||this.lex()},"lex"),begin:T(function(ne){this.conditionStack.push(ne)},"begin"),popState:T(function(){var ne=this.conditionStack.length-1;return ne>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:T(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:T(function(ne){return ne=this.conditionStack.length-1-Math.abs(ne||0),ne>=0?this.conditionStack[ne]:"INITIAL"},"topState"),pushState:T(function(ne){this.begin(ne)},"pushState"),stateStackSize:T(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:T(function(ne,Be,Te,Ue){switch(Te){case 0:break;case 1:break;case 2:return 55;case 3:break;case 4:return this.begin("title"),35;case 5:return this.popState(),"title_value";case 6:return this.begin("acc_title"),37;case 7:return this.popState(),"acc_title_value";case 8:return this.begin("acc_descr"),39;case 9:return this.popState(),"acc_descr_value";case 10:this.begin("acc_descr_multiline");break;case 11:this.popState();break;case 12:return"acc_descr_multiline_value";case 13:return 48;case 14:return 50;case 15:return 49;case 16:return 51;case 17:return 52;case 18:return 53;case 19:return 54;case 20:return 25;case 21:this.begin("md_string");break;case 22:return"MD_STR";case 23:this.popState();break;case 24:this.begin("string");break;case 25:this.popState();break;case 26:return"STR";case 27:this.begin("class_name");break;case 28:return this.popState(),47;case 29:return this.begin("point_start"),44;case 30:return this.begin("point_x"),45;case 31:this.popState();break;case 32:this.popState(),this.begin("point_y");break;case 33:return this.popState(),46;case 34:return 28;case 35:return 4;case 36:return 15;case 37:return 11;case 38:return 64;case 39:return 10;case 40:return 65;case 41:return 65;case 42:return 14;case 43:return 13;case 44:return 67;case 45:return 66;case 46:return 12;case 47:return 8;case 48:return 5;case 49:return 18;case 50:return 56;case 51:return 63;case 52: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,/^(?:[^\x00-\x7F]+)/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,52],inclusive:!0}}};return Z})();_e.lexer=Y;function he(){this.yy={}}return T(he,"Parser"),he.prototype=_e,_e.Parser=he,new he})();$z.parser=$z;var Pmt=$z,Gs=B0(),Bmt=(sb=class{constructor(){this.classes=new Map,this.config=this.getDefaultConfig(),this.themeConfig=this.getDefaultThemeConfig(),this.data=this.getDefaultData()}getDefaultData(){return{titleText:"",quadrant1Text:"",quadrant2Text:"",quadrant3Text:"",quadrant4Text:"",xAxisLeftText:"",xAxisRightText:"",yAxisBottomText:"",yAxisTopText:"",points:[]}}getDefaultConfig(){var e,r,n,i,a,s,o,l,u,h,d,f,p,g,m,y,v,x;return{showXAxis:!0,showYAxis:!0,showTitle:!0,chartHeight:((e=Xr.quadrantChart)==null?void 0:e.chartWidth)||500,chartWidth:((r=Xr.quadrantChart)==null?void 0:r.chartHeight)||500,titlePadding:((n=Xr.quadrantChart)==null?void 0:n.titlePadding)||10,titleFontSize:((i=Xr.quadrantChart)==null?void 0:i.titleFontSize)||20,quadrantPadding:((a=Xr.quadrantChart)==null?void 0:a.quadrantPadding)||5,xAxisLabelPadding:((s=Xr.quadrantChart)==null?void 0:s.xAxisLabelPadding)||5,yAxisLabelPadding:((o=Xr.quadrantChart)==null?void 0:o.yAxisLabelPadding)||5,xAxisLabelFontSize:((l=Xr.quadrantChart)==null?void 0:l.xAxisLabelFontSize)||16,yAxisLabelFontSize:((u=Xr.quadrantChart)==null?void 0:u.yAxisLabelFontSize)||16,quadrantLabelFontSize:((h=Xr.quadrantChart)==null?void 0:h.quadrantLabelFontSize)||16,quadrantTextTopPadding:((d=Xr.quadrantChart)==null?void 0:d.quadrantTextTopPadding)||5,pointTextPadding:((f=Xr.quadrantChart)==null?void 0:f.pointTextPadding)||5,pointLabelFontSize:((p=Xr.quadrantChart)==null?void 0:p.pointLabelFontSize)||12,pointRadius:((g=Xr.quadrantChart)==null?void 0:g.pointRadius)||5,xAxisPosition:((m=Xr.quadrantChart)==null?void 0:m.xAxisPosition)||"top",yAxisPosition:((y=Xr.quadrantChart)==null?void 0:y.yAxisPosition)||"left",quadrantInternalBorderStrokeWidth:((v=Xr.quadrantChart)==null?void 0:v.quadrantInternalBorderStrokeWidth)||1,quadrantExternalBorderStrokeWidth:((x=Xr.quadrantChart)==null?void 0:x.quadrantExternalBorderStrokeWidth)||2}}getDefaultThemeConfig(){return{quadrant1Fill:Gs.quadrant1Fill,quadrant2Fill:Gs.quadrant2Fill,quadrant3Fill:Gs.quadrant3Fill,quadrant4Fill:Gs.quadrant4Fill,quadrant1TextFill:Gs.quadrant1TextFill,quadrant2TextFill:Gs.quadrant2TextFill,quadrant3TextFill:Gs.quadrant3TextFill,quadrant4TextFill:Gs.quadrant4TextFill,quadrantPointFill:Gs.quadrantPointFill,quadrantPointTextFill:Gs.quadrantPointTextFill,quadrantXAxisTextFill:Gs.quadrantXAxisTextFill,quadrantYAxisTextFill:Gs.quadrantYAxisTextFill,quadrantTitleFill:Gs.quadrantTitleFill,quadrantInternalBorderStrokeFill:Gs.quadrantInternalBorderStrokeFill,quadrantExternalBorderStrokeFill:Gs.quadrantExternalBorderStrokeFill}}clear(){this.config=this.getDefaultConfig(),this.themeConfig=this.getDefaultThemeConfig(),this.data=this.getDefaultData(),this.classes=new Map,se.info("clear called")}setData(e){this.data={...this.data,...e}}addPoints(e){this.data.points=[...e,...this.data.points]}addClass(e,r){this.classes.set(e,r)}setConfig(e){se.trace("setConfig called with: ",e),this.config={...this.config,...e}}setThemeConfig(e){se.trace("setThemeConfig called with: ",e),this.themeConfig={...this.themeConfig,...e}}calculateSpace(e,r,n,i){const a=this.config.xAxisLabelPadding*2+this.config.xAxisLabelFontSize,s={top:e==="top"&&r?a:0,bottom:e==="bottom"&&r?a:0},o=this.config.yAxisLabelPadding*2+this.config.yAxisLabelFontSize,l={left:this.config.yAxisPosition==="left"&&n?o:0,right:this.config.yAxisPosition==="right"&&n?o:0},u=this.config.titleFontSize+this.config.titlePadding*2,h={top:i?u:0},d=this.config.quadrantPadding+l.left,f=this.config.quadrantPadding+s.top+h.top,p=this.config.chartWidth-this.config.quadrantPadding*2-l.left-l.right,g=this.config.chartHeight-this.config.quadrantPadding*2-s.top-s.bottom-h.top,m=p/2,y=g/2;return{xAxisSpace:s,yAxisSpace:l,titleSpace:h,quadrantSpace:{quadrantLeft:d,quadrantTop:f,quadrantWidth:p,quadrantHalfWidth:m,quadrantHeight:g,quadrantHalfHeight:y}}}getAxisLabels(e,r,n,i){const{quadrantSpace:a,titleSpace:s}=i,{quadrantHalfHeight:o,quadrantHeight:l,quadrantLeft:u,quadrantHalfWidth:h,quadrantTop:d,quadrantWidth:f}=a,p=!!this.data.xAxisRightText,g=!!this.data.yAxisTopText,m=[];return this.data.xAxisLeftText&&r&&m.push({text:this.data.xAxisLeftText,fill:this.themeConfig.quadrantXAxisTextFill,x:u+(p?h/2:0),y:e==="top"?this.config.xAxisLabelPadding+s.top:this.config.xAxisLabelPadding+d+l+this.config.quadrantPadding,fontSize:this.config.xAxisLabelFontSize,verticalPos:p?"center":"left",horizontalPos:"top",rotation:0}),this.data.xAxisRightText&&r&&m.push({text:this.data.xAxisRightText,fill:this.themeConfig.quadrantXAxisTextFill,x:u+h+(p?h/2:0),y:e==="top"?this.config.xAxisLabelPadding+s.top:this.config.xAxisLabelPadding+d+l+this.config.quadrantPadding,fontSize:this.config.xAxisLabelFontSize,verticalPos:p?"center":"left",horizontalPos:"top",rotation:0}),this.data.yAxisBottomText&&n&&m.push({text:this.data.yAxisBottomText,fill:this.themeConfig.quadrantYAxisTextFill,x:this.config.yAxisPosition==="left"?this.config.yAxisLabelPadding:this.config.yAxisLabelPadding+u+f+this.config.quadrantPadding,y:d+l-(g?o/2:0),fontSize:this.config.yAxisLabelFontSize,verticalPos:g?"center":"left",horizontalPos:"top",rotation:-90}),this.data.yAxisTopText&&n&&m.push({text:this.data.yAxisTopText,fill:this.themeConfig.quadrantYAxisTextFill,x:this.config.yAxisPosition==="left"?this.config.yAxisLabelPadding:this.config.yAxisLabelPadding+u+f+this.config.quadrantPadding,y:d+o-(g?o/2:0),fontSize:this.config.yAxisLabelFontSize,verticalPos:g?"center":"left",horizontalPos:"top",rotation:-90}),m}getQuadrants(e){const{quadrantSpace:r}=e,{quadrantHalfHeight:n,quadrantLeft:i,quadrantHalfWidth:a,quadrantTop:s}=r,o=[{text:{text:this.data.quadrant1Text,fill:this.themeConfig.quadrant1TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:"center",horizontalPos:"middle",rotation:0},x:i+a,y:s,width:a,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:i,y:s,width:a,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:i,y:s+n,width:a,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:i+a,y:s+n,width:a,height:n,fill:this.themeConfig.quadrant4Fill}];for(const l of o)l.text.x=l.x+l.width/2,this.data.points.length===0?(l.text.y=l.y+l.height/2,l.text.horizontalPos="middle"):(l.text.y=l.y+this.config.quadrantTextTopPadding,l.text.horizontalPos="top");return o}getQuadrantPoints(e){const{quadrantSpace:r}=e,{quadrantHeight:n,quadrantLeft:i,quadrantTop:a,quadrantWidth:s}=r,o=X0().domain([0,1]).range([i,s+i]),l=X0().domain([0,1]).range([n+a,a]);return this.data.points.map(h=>{const d=this.classes.get(h.className);return d&&(h={...d,...h}),{x:o(h.x),y:l(h.y),fill:h.color??this.themeConfig.quadrantPointFill,radius:h.radius??this.config.pointRadius,text:{text:h.text,fill:this.themeConfig.quadrantPointTextFill,x:o(h.x),y:l(h.y)+this.config.pointTextPadding,verticalPos:"center",horizontalPos:"top",fontSize:this.config.pointLabelFontSize,rotation:0},strokeColor:h.strokeColor??this.themeConfig.quadrantPointFill,strokeWidth:h.strokeWidth??"0px"}})}getBorders(e){const r=this.config.quadrantExternalBorderStrokeWidth/2,{quadrantSpace:n}=e,{quadrantHalfHeight:i,quadrantHeight:a,quadrantLeft:s,quadrantHalfWidth:o,quadrantTop:l,quadrantWidth:u}=n;return[{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:s-r,y1:l,x2:s+u+r,y2:l},{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:s+u,y1:l+r,x2:s+u,y2:l+a-r},{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:s-r,y1:l+a,x2:s+u+r,y2:l+a},{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:s,y1:l+r,x2:s,y2:l+a-r},{strokeFill:this.themeConfig.quadrantInternalBorderStrokeFill,strokeWidth:this.config.quadrantInternalBorderStrokeWidth,x1:s+o,y1:l+r,x2:s+o,y2:l+a-r},{strokeFill:this.themeConfig.quadrantInternalBorderStrokeFill,strokeWidth:this.config.quadrantInternalBorderStrokeWidth,x1:s+r,y1:l+i,x2:s+u-r,y2:l+i}]}getTitle(e){if(e)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 e=this.config.showXAxis&&!!(this.data.xAxisLeftText||this.data.xAxisRightText),r=this.config.showYAxis&&!!(this.data.yAxisTopText||this.data.yAxisBottomText),n=this.config.showTitle&&!!this.data.titleText,i=this.data.points.length>0?"bottom":this.config.xAxisPosition,a=this.calculateSpace(i,e,r,n);return{points:this.getQuadrantPoints(a),quadrants:this.getQuadrants(a),axisLabels:this.getAxisLabels(i,e,r,a),borderLines:this.getBorders(a),title:this.getTitle(n)}}},T(sb,"QuadrantBuilder"),sb),yA=(ob=class extends Error{constructor(e,r,n){super(`value for ${e} ${r} is invalid, please use a valid ${n}`),this.name="InvalidStyleError"}},T(ob,"InvalidStyleError"),ob);function Oz(t){return!/^#?([\dA-Fa-f]{6}|[\dA-Fa-f]{3})$/.test(t)}T(Oz,"validateHexCode");function Lxe(t){return!/^\d+$/.test(t)}T(Lxe,"validateNumber");function Ixe(t){return!/^\d+px$/.test(t)}T(Ixe,"validateSizeInPixels");var Fmt=Pe();function Xc(t){return Zr(t.trim(),Fmt)}T(Xc,"textSanitizer");var Ya=new Bmt;function Dxe(t){Ya.setData({quadrant1Text:Xc(t.text)})}T(Dxe,"setQuadrant1Text");function Mxe(t){Ya.setData({quadrant2Text:Xc(t.text)})}T(Mxe,"setQuadrant2Text");function Nxe(t){Ya.setData({quadrant3Text:Xc(t.text)})}T(Nxe,"setQuadrant3Text");function $xe(t){Ya.setData({quadrant4Text:Xc(t.text)})}T($xe,"setQuadrant4Text");function Oxe(t){Ya.setData({xAxisLeftText:Xc(t.text)})}T(Oxe,"setXAxisLeftText");function Pxe(t){Ya.setData({xAxisRightText:Xc(t.text)})}T(Pxe,"setXAxisRightText");function Bxe(t){Ya.setData({yAxisTopText:Xc(t.text)})}T(Bxe,"setYAxisTopText");function Fxe(t){Ya.setData({yAxisBottomText:Xc(t.text)})}T(Fxe,"setYAxisBottomText");function vA(t){const e={};for(const r of t){const[n,i]=r.trim().split(/\s*:\s*/);if(n==="radius"){if(Lxe(i))throw new yA(n,i,"number");e.radius=parseInt(i)}else if(n==="color"){if(Oz(i))throw new yA(n,i,"hex code");e.color=i}else if(n==="stroke-color"){if(Oz(i))throw new yA(n,i,"hex code");e.strokeColor=i}else if(n==="stroke-width"){if(Ixe(i))throw new yA(n,i,"number of pixels (eg. 10px)");e.strokeWidth=i}else throw new Error(`style named ${n} is not supported.`)}return e}T(vA,"parseStyles");function zxe(t,e,r,n,i){const a=vA(i);Ya.addPoints([{x:r,y:n,text:Xc(t.text),className:e,...a}])}T(zxe,"addPoint");function Gxe(t,e){Ya.addClass(t,vA(e))}T(Gxe,"addClass");function qxe(t){Ya.setConfig({chartWidth:t})}T(qxe,"setWidth");function Vxe(t){Ya.setConfig({chartHeight:t})}T(Vxe,"setHeight");function Wxe(){const t=Pe(),{themeVariables:e,quadrantChart:r}=t;return r&&Ya.setConfig(r),Ya.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}),Ya.setData({titleText:Xn()}),Ya.build()}T(Wxe,"getQuadrantData");var zmt=T(function(){Ya.clear(),Hn()},"clear"),Gmt={setWidth:qxe,setHeight:Vxe,setQuadrant1Text:Dxe,setQuadrant2Text:Mxe,setQuadrant3Text:Nxe,setQuadrant4Text:$xe,setXAxisLeftText:Oxe,setXAxisRightText:Pxe,setYAxisTopText:Bxe,setYAxisBottomText:Fxe,parseStyles:vA,addPoint:zxe,addClass:Gxe,getQuadrantData:Wxe,clear:zmt,setAccTitle:Yn,getAccTitle:ii,setDiagramTitle:oi,getDiagramTitle:Xn,getAccDescription:si,setAccDescription:ai},qmt=T((t,e,r,n)=>{var S,L,$;function i(I){return I==="top"?"hanging":"middle"}T(i,"getDominantBaseLine");function a(I){return I==="left"?"start":"middle"}T(a,"getTextAnchor");function s(I){return`translate(${I.x}, ${I.y}) rotate(${I.rotation||0})`}T(s,"getTransformation");const o=Pe();se.debug(`Rendering quadrant chart +`+t);const l=o.securityLevel;let u;l==="sandbox"&&(u=gt("#i"+e));const d=gt(l==="sandbox"?u.nodes()[0].contentDocument.body:"body").select(`[id="${e}"]`),f=d.append("g").attr("class","main"),p=((S=o.quadrantChart)==null?void 0:S.chartWidth)??500,g=((L=o.quadrantChart)==null?void 0:L.chartHeight)??500;Wi(d,g,p,(($=o.quadrantChart)==null?void 0:$.useMaxWidth)??!0),d.attr("viewBox","0 0 "+p+" "+g),n.db.setHeight(g),n.db.setWidth(p);const m=n.db.getQuadrantData(),y=f.append("g").attr("class","quadrants"),v=f.append("g").attr("class","border"),x=f.append("g").attr("class","data-points"),b=f.append("g").attr("class","labels"),w=f.append("g").attr("class","title");m.title&&w.append("text").attr("x",0).attr("y",0).attr("fill",m.title.fill).attr("font-size",m.title.fontSize).attr("dominant-baseline",i(m.title.horizontalPos)).attr("text-anchor",a(m.title.verticalPos)).attr("transform",s(m.title)).text(m.title.text),m.borderLines&&v.selectAll("line").data(m.borderLines).enter().append("line").attr("x1",I=>I.x1).attr("y1",I=>I.y1).attr("x2",I=>I.x2).attr("y2",I=>I.y2).style("stroke",I=>I.strokeFill).style("stroke-width",I=>I.strokeWidth);const C=y.selectAll("g.quadrant").data(m.quadrants).enter().append("g").attr("class","quadrant");C.append("rect").attr("x",I=>I.x).attr("y",I=>I.y).attr("width",I=>I.width).attr("height",I=>I.height).attr("fill",I=>I.fill),C.append("text").attr("x",0).attr("y",0).attr("fill",I=>I.text.fill).attr("font-size",I=>I.text.fontSize).attr("dominant-baseline",I=>i(I.text.horizontalPos)).attr("text-anchor",I=>a(I.text.verticalPos)).attr("transform",I=>s(I.text)).text(I=>I.text.text),b.selectAll("g.label").data(m.axisLabels).enter().append("g").attr("class","label").append("text").attr("x",0).attr("y",0).text(I=>I.text).attr("fill",I=>I.fill).attr("font-size",I=>I.fontSize).attr("dominant-baseline",I=>i(I.horizontalPos)).attr("text-anchor",I=>a(I.verticalPos)).attr("transform",I=>s(I));const k=x.selectAll("g.data-point").data(m.points).enter().append("g").attr("class","data-point");k.append("circle").attr("cx",I=>I.x).attr("cy",I=>I.y).attr("r",I=>I.radius).attr("fill",I=>I.fill).attr("stroke",I=>I.strokeColor).attr("stroke-width",I=>I.strokeWidth),k.append("text").attr("x",0).attr("y",0).text(I=>I.text.text).attr("fill",I=>I.text.fill).attr("font-size",I=>I.text.fontSize).attr("dominant-baseline",I=>i(I.text.horizontalPos)).attr("text-anchor",I=>a(I.text.verticalPos)).attr("transform",I=>s(I.text))},"draw"),Vmt={draw:qmt},Wmt={parser:Pmt,db:Gmt,renderer:Vmt,styles:T(()=>"","styles")};const Umt=Object.freeze(Object.defineProperty({__proto__:null,diagram:Wmt},Symbol.toStringTag,{value:"Module"}));var Pz=(function(){var t=T(function(R,N,M,D){for(M=M||{},D=R.length;D--;M[R[D]]=N);return M},"o"),e=[1,10,12,14,16,18,19,21,23],r=[2,6],n=[1,3],i=[1,5],a=[1,6],s=[1,7],o=[1,5,10,12,14,16,18,19,21,23,34,35,36],l=[1,25],u=[1,26],h=[1,28],d=[1,29],f=[1,30],p=[1,31],g=[1,32],m=[1,33],y=[1,34],v=[1,35],x=[1,36],b=[1,37],w=[1,43],C=[1,42],_=[1,47],k=[1,50],S=[1,10,12,14,16,18,19,21,23,34,35,36],L=[1,10,12,14,16,18,19,21,23,24,26,27,28,34,35,36],$=[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],I=[1,64],z={trace:T(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:T(function(N,M,D,O,B,P,G){var V=P.length-1;switch(B){case 5:O.setOrientation(P[V]);break;case 9:O.setDiagramTitle(P[V].text.trim());break;case 12:O.setLineData({text:"",type:"text"},P[V]);break;case 13:O.setLineData(P[V-1],P[V]);break;case 14:O.setBarData({text:"",type:"text"},P[V]);break;case 15:O.setBarData(P[V-1],P[V]);break;case 16:this.$=P[V].trim(),O.setAccTitle(this.$);break;case 17:case 18:this.$=P[V].trim(),O.setAccDescription(this.$);break;case 19:this.$=P[V-1];break;case 20:this.$=[Number(P[V-2]),...P[V]];break;case 21:this.$=[Number(P[V])];break;case 22:O.setXAxisTitle(P[V]);break;case 23:O.setXAxisTitle(P[V-1]);break;case 24:O.setXAxisTitle({type:"text",text:""});break;case 25:O.setXAxisBand(P[V]);break;case 26:O.setXAxisRangeData(Number(P[V-2]),Number(P[V]));break;case 27:this.$=P[V-1];break;case 28:this.$=[P[V-2],...P[V]];break;case 29:this.$=[P[V]];break;case 30:O.setYAxisTitle(P[V]);break;case 31:O.setYAxisTitle(P[V-1]);break;case 32:O.setYAxisTitle({type:"text",text:""});break;case 33:O.setYAxisRangeData(Number(P[V-2]),Number(P[V]));break;case 37:this.$={text:P[V],type:"text"};break;case 38:this.$={text:P[V],type:"text"};break;case 39:this.$={text:P[V],type:"markdown"};break;case 40:this.$=P[V];break;case 41:this.$=P[V-1]+""+P[V];break}},"anonymous"),table:[t(e,r,{3:1,4:2,7:4,5:n,34:i,35:a,36:s}),{1:[3]},t(e,r,{4:2,7:4,3:8,5:n,34:i,35:a,36:s}),t(e,r,{4:2,7:4,6:9,3:10,5:n,8:[1,11],34:i,35:a,36:s}),{1:[2,4],9:12,10:[1,13],12:[1,14],14:[1,15],16:[1,16],18:[1,17],19:[1,18],21:[1,19],23:[1,20]},t(o,[2,34]),t(o,[2,35]),t(o,[2,36]),{1:[2,1]},t(e,r,{4:2,7:4,3:21,5:n,34:i,35:a,36:s}),{1:[2,3]},t(o,[2,5]),t(e,[2,7],{4:22,34:i,35:a,36:s}),{11:23,37:24,38:l,39:u,40:27,41:h,42:d,43:f,44:p,45:g,46:m,47:y,48:v,49:x,50:b},{11:39,13:38,24:w,27:C,29:40,30:41,37:24,38:l,39:u,40:27,41:h,42:d,43:f,44:p,45:g,46:m,47:y,48:v,49:x,50:b},{11:45,15:44,27:_,33:46,37:24,38:l,39:u,40:27,41:h,42:d,43:f,44:p,45:g,46:m,47:y,48:v,49:x,50:b},{11:49,17:48,24:k,37:24,38:l,39:u,40:27,41:h,42:d,43:f,44:p,45:g,46:m,47:y,48:v,49:x,50:b},{11:52,17:51,24:k,37:24,38:l,39:u,40:27,41:h,42:d,43:f,44:p,45:g,46:m,47:y,48:v,49:x,50:b},{20:[1,53]},{22:[1,54]},t(S,[2,18]),{1:[2,2]},t(S,[2,8]),t(S,[2,9]),t(L,[2,37],{40:55,41:h,42:d,43:f,44:p,45:g,46:m,47:y,48:v,49:x,50:b}),t(L,[2,38]),t(L,[2,39]),t($,[2,40]),t($,[2,42]),t($,[2,43]),t($,[2,44]),t($,[2,45]),t($,[2,46]),t($,[2,47]),t($,[2,48]),t($,[2,49]),t($,[2,50]),t($,[2,51]),t(S,[2,10]),t(S,[2,22],{30:41,29:56,24:w,27:C}),t(S,[2,24]),t(S,[2,25]),{31:[1,57]},{11:59,32:58,37:24,38:l,39:u,40:27,41:h,42:d,43:f,44:p,45:g,46:m,47:y,48:v,49:x,50:b},t(S,[2,11]),t(S,[2,30],{33:60,27:_}),t(S,[2,32]),{31:[1,61]},t(S,[2,12]),{17:62,24:k},{25:63,27:I},t(S,[2,14]),{17:65,24:k},t(S,[2,16]),t(S,[2,17]),t($,[2,41]),t(S,[2,23]),{27:[1,66]},{26:[1,67]},{26:[2,29],28:[1,68]},t(S,[2,31]),{27:[1,69]},t(S,[2,13]),{26:[1,70]},{26:[2,21],28:[1,71]},t(S,[2,15]),t(S,[2,26]),t(S,[2,27]),{11:59,32:72,37:24,38:l,39:u,40:27,41:h,42:d,43:f,44:p,45:g,46:m,47:y,48:v,49:x,50:b},t(S,[2,33]),t(S,[2,19]),{25:73,27:I},{26:[2,28]},{26:[2,20]}],defaultActions:{8:[2,1],10:[2,3],21:[2,2],72:[2,28],73:[2,20]},parseError:T(function(N,M){if(M.recoverable)this.trace(N);else{var D=new Error(N);throw D.hash=M,D}},"parseError"),parse:T(function(N){var M=this,D=[0],O=[],B=[null],P=[],G=this.table,V="",H=0,W=0,ie=2,j=1,ae=P.slice.call(arguments,1),J=Object.create(this.lexer),K={yy:{}};for(var Q in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Q)&&(K.yy[Q]=this.yy[Q]);J.setInput(N,K.yy),K.yy.lexer=J,K.yy.parser=this,typeof J.yylloc>"u"&&(J.yylloc={});var re=J.yylloc;P.push(re);var le=J.options&&J.options.ranges;typeof K.yy.parseError=="function"?this.parseError=K.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function fe(nt){D.length=D.length-2*nt,B.length=B.length-nt,P.length=P.length-nt}T(fe,"popStack");function Ae(){var nt;return nt=O.pop()||J.lex()||j,typeof nt!="number"&&(nt instanceof Array&&(O=nt,nt=O.pop()),nt=M.symbols_[nt]||nt),nt}T(Ae,"lex");for(var Se,Ne,ge,ve,ze={},xe,Ke,Ce,Ve;;){if(Ne=D[D.length-1],this.defaultActions[Ne]?ge=this.defaultActions[Ne]:((Se===null||typeof Se>"u")&&(Se=Ae()),ge=G[Ne]&&G[Ne][Se]),typeof ge>"u"||!ge.length||!ge[0]){var Qe="";Ve=[];for(xe in G[Ne])this.terminals_[xe]&&xe>ie&&Ve.push("'"+this.terminals_[xe]+"'");J.showPosition?Qe="Parse error on line "+(H+1)+`: `+J.showPosition()+` -Expecting `+Ve.join(", ")+", got '"+(this.terminals_[Ae]||Ae)+"'":Qe="Parse error on line "+(Y+1)+": Unexpected "+(Ae==K?"end of input":"'"+(this.terminals_[Ae]||Ae)+"'"),this.parseError(Qe,{text:J.match,token:this.terminals_[Ae]||Ae,line:J.yylineno,loc:ne,expected:Ve})}if(me[0]instanceof Array&&me.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Ne+", token: "+Ae);switch(me[0]){case 1:I.push(Ae),B.push(J.yytext),P.push(J.yylloc),I.push(me[1]),Ae=null,W=J.yyleng,V=J.yytext,Y=J.yylineno,ne=J.yylloc;break;case 2:if(Ze=this.productions_[me[1]][1],Ge.$=B[B.length-Ze],Ge._$={first_line:P[P.length-(Ze||1)].first_line,last_line:P[P.length-1].last_line,first_column:P[P.length-(Ze||1)].first_column,last_column:P[P.length-1].last_column},ue&&(Ge._$.range=[P[P.length-(Ze||1)].range[0],P[P.length-1].range[1]]),ve=this.performAction.apply(Ge,[V,W,Y,Z.yy,me[1],B,P].concat(se)),typeof ve<"u")return ve;Ze&&(I=I.slice(0,-1*Ze*2),B=B.slice(0,-1*Ze),P=P.slice(0,-1*Ze)),I.push(this.productions_[me[1]][0]),B.push(Ge.$),P.push(Ge._$),ke=G[I[I.length-2]][I[I.length-1]],I.push(ke);break;case 3:return!0}}return!0},"parse")},F=(function(){var R={EOF:1,parseError:x(function(D,I){if(this.yy.parser)this.yy.parser.parseError(D,I);else throw new Error(D)},"parseError"),setInput:x(function(N,D){return this.yy=D||this.yy||{},this._input=N,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:x(function(){var N=this._input[0];this.yytext+=N,this.yyleng++,this.offset++,this.match+=N,this.matched+=N;var D=N.match(/(?:\r\n?|\n).*/g);return D?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),N},"input"),unput:x(function(N){var D=N.length,I=N.split(/(?:\r\n?|\n)/g);this._input=N+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-D),this.offset-=D;var $=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),I.length-1&&(this.yylineno-=I.length-1);var B=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:I?(I.length===$.length?this.yylloc.first_column:0)+$[$.length-I.length].length-I[0].length:this.yylloc.first_column-D},this.options.ranges&&(this.yylloc.range=[B[0],B[0]+this.yyleng-D]),this.yyleng=this.yytext.length,this},"unput"),more:x(function(){return this._more=!0,this},"more"),reject:x(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). -`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:x(function(N){this.unput(this.match.slice(N))},"less"),pastInput:x(function(){var N=this.matched.substr(0,this.matched.length-this.match.length);return(N.length>20?"...":"")+N.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:x(function(){var N=this.match;return N.length<20&&(N+=this._input.substr(0,20-N.length)),(N.substr(0,20)+(N.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:x(function(){var N=this.pastInput(),D=new Array(N.length+1).join("-");return N+this.upcomingInput()+` -`+D+"^"},"showPosition"),test_match:x(function(N,D){var I,$,B;if(this.options.backtrack_lexer&&(B={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&&(B.yylloc.range=this.yylloc.range.slice(0))),$=N[0].match(/(?:\r\n?|\n).*/g),$&&(this.yylineno+=$.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:$?$[$.length-1].length-$[$.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+N[0].length},this.yytext+=N[0],this.match+=N[0],this.matches=N,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(N[0].length),this.matched+=N[0],I=this.performAction.call(this,this.yy,this,D,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),I)return I;if(this._backtrack){for(var P in B)this[P]=B[P];return!1}return!1},"test_match"),next:x(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var N,D,I,$;this._more||(this.yytext="",this.match="");for(var B=this._currentRules(),P=0;PD[0].length)){if(D=I,$=P,this.options.backtrack_lexer){if(N=this.test_match(I,B[P]),N!==!1)return N;if(this._backtrack){D=!1;continue}else return!1}else if(!this.options.flex)break}return D?(N=this.test_match(D,B[$]),N!==!1?N:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var D=this.next();return D||this.lex()},"lex"),begin:x(function(D){this.conditionStack.push(D)},"begin"),popState:x(function(){var D=this.conditionStack.length-1;return D>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(D){return D=this.conditionStack.length-1-Math.abs(D||0),D>=0?this.conditionStack[D]:"INITIAL"},"topState"),pushState:x(function(D){this.begin(D)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:x(function(D,I,$,B){switch($){case 0:break;case 1:break;case 2:return this.popState(),34;case 3:return this.popState(),34;case 4:return 34;case 5:break;case 6:return 10;case 7:return this.pushState("acc_title"),19;case 8:return this.popState(),"acc_title_value";case 9:return this.pushState("acc_descr"),21;case 10:return this.popState(),"acc_descr_value";case 11:this.pushState("acc_descr_multiline");break;case 12:this.popState();break;case 13:return"acc_descr_multiline_value";case 14:return 5;case 15:return 5;case 16:return 8;case 17:return this.pushState("axis_data"),"X_AXIS";case 18:return this.pushState("axis_data"),"Y_AXIS";case 19:return this.pushState("axis_band_data"),24;case 20:return 31;case 21:return this.pushState("data"),16;case 22:return this.pushState("data"),18;case 23:return this.pushState("data_inner"),24;case 24:return 27;case 25:return this.popState(),26;case 26:this.popState();break;case 27:this.pushState("string");break;case 28:this.popState();break;case 29:return"STR";case 30:return 24;case 31:return 26;case 32:return 43;case 33:return"COLON";case 34:return 44;case 35:return 28;case 36:return 45;case 37:return 46;case 38:return 48;case 39:return 50;case 40:return 47;case 41:return 41;case 42:return 49;case 43:return 42;case 44:break;case 45:return 35;case 46:return 36}},"anonymous"),rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:(\r?\n))/i,/^(?:(\r?\n))/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:title\b)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:\})/i,/^(?:[^\}]*)/i,/^(?:xychart-beta\b)/i,/^(?:xychart\b)/i,/^(?:(?:vertical|horizontal))/i,/^(?:x-axis\b)/i,/^(?:y-axis\b)/i,/^(?:\[)/i,/^(?:-->)/i,/^(?:line\b)/i,/^(?:bar\b)/i,/^(?:\[)/i,/^(?:[+-]?(?:\d+(?:\.\d+)?|\.\d+))/i,/^(?:\])/i,/^(?:(?:`\) \{ this\.pushState\(md_string\); \}\n\(\?:\(\?!`"\)\.\)\+ \{ return MD_STR; \}\n\(\?:`))/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:\[)/i,/^(?:\])/i,/^(?:[A-Za-z]+)/i,/^(?::)/i,/^(?:\+)/i,/^(?:,)/i,/^(?:=)/i,/^(?:\*)/i,/^(?:#)/i,/^(?:[\_])/i,/^(?:\.)/i,/^(?:&)/i,/^(?:-)/i,/^(?:[0-9]+)/i,/^(?:\s+)/i,/^(?:;)/i,/^(?:$)/i],conditions:{data_inner:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,24,25,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},data:{rules:[0,1,3,4,5,6,7,9,11,14,15,16,17,18,21,22,23,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},axis_band_data:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,25,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},axis_data:{rules:[0,1,2,4,5,6,7,9,11,14,15,16,17,18,19,20,21,22,24,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},acc_descr_multiline:{rules:[12,13],inclusive:!1},acc_descr:{rules:[10],inclusive:!1},acc_title:{rules:[8],inclusive:!1},title:{rules:[],inclusive:!1},md_string:{rules:[],inclusive:!1},string:{rules:[28,29],inclusive:!1},INITIAL:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0}}};return R})();z.lexer=F;function S(){this.yy={}}return x(S,"Parser"),S.prototype=z,z.Parser=S,new S})();l$.parser=l$;var slt=l$;function c$(t){return t.type==="bar"}x(c$,"isBarPlot");function u$(t){return t.type==="band"}x(u$,"isBandAxisData");function Jg(t){return t.type==="linear"}x(Jg,"isLinearAxisData");var _ge=(Rv=class{constructor(e){this.parentGroup=e}getMaxDimension(e,r){if(!this.parentGroup)return{width:e.reduce((a,s)=>Math.max(s.length,a),0)*r,height:r};const n={width:0,height:0},i=this.parentGroup.append("g").attr("visibility","hidden").attr("font-size",r);for(const a of e){const s=KV(i,1,a),o=s?s.width:a.length*r,l=s?s.height:r;n.width=Math.max(n.width,o),n.height=Math.max(n.height,l)}return i.remove(),n}},x(Rv,"TextDimensionCalculatorWithFont"),Rv),Rge=.7,Lge=.2,Ige=(Lv=class{constructor(e,r,n,i){this.axisConfig=e,this.title=r,this.textDimensionCalculator=n,this.axisThemeConfig=i,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"}setRange(e){this.range=e,this.axisPosition==="left"||this.axisPosition==="right"?this.boundingRect.height=e[1]-e[0]:this.boundingRect.width=e[1]-e[0],this.recalculateScale()}getRange(){return[this.range[0]+this.outerPadding,this.range[1]-this.outerPadding]}setAxisPosition(e){this.axisPosition=e,this.setRange(this.range)}getTickDistance(){const e=this.getRange();return Math.abs(e[0]-e[1])/this.getTickValues().length}getAxisOuterPadding(){return this.outerPadding}getLabelDimension(){return this.textDimensionCalculator.getMaxDimension(this.getTickValues().map(e=>e.toString()),this.axisConfig.labelFontSize)}recalculateOuterPaddingToDrawBar(){Rge*this.getTickDistance()>this.outerPadding*2&&(this.outerPadding=Math.floor(Rge*this.getTickDistance()/2)),this.recalculateScale()}calculateSpaceIfDrawnHorizontally(e){let r=e.height;if(this.axisConfig.showAxisLine&&r>this.axisConfig.axisLineWidth&&(r-=this.axisConfig.axisLineWidth,this.showAxisLine=!0),this.axisConfig.showLabel){const n=this.getLabelDimension(),i=Lge*e.width;this.outerPadding=Math.min(n.width/2,i);const a=n.height+this.axisConfig.labelPadding*2;this.labelTextHeight=n.height,a<=r&&(r-=a,this.showLabel=!0)}if(this.axisConfig.showTick&&r>=this.axisConfig.tickLength&&(this.showTick=!0,r-=this.axisConfig.tickLength),this.axisConfig.showTitle&&this.title){const n=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),i=n.height+this.axisConfig.titlePadding*2;this.titleTextHeight=n.height,i<=r&&(r-=i,this.showTitle=!0)}this.boundingRect.width=e.width,this.boundingRect.height=e.height-r}calculateSpaceIfDrawnVertical(e){let r=e.width;if(this.axisConfig.showAxisLine&&r>this.axisConfig.axisLineWidth&&(r-=this.axisConfig.axisLineWidth,this.showAxisLine=!0),this.axisConfig.showLabel){const n=this.getLabelDimension(),i=Lge*e.height;this.outerPadding=Math.min(n.height/2,i);const a=n.width+this.axisConfig.labelPadding*2;a<=r&&(r-=a,this.showLabel=!0)}if(this.axisConfig.showTick&&r>=this.axisConfig.tickLength&&(this.showTick=!0,r-=this.axisConfig.tickLength),this.axisConfig.showTitle&&this.title){const n=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),i=n.height+this.axisConfig.titlePadding*2;this.titleTextHeight=n.height,i<=r&&(r-=i,this.showTitle=!0)}this.boundingRect.width=e.width-r,this.boundingRect.height=e.height}calculateSpace(e){return this.axisPosition==="left"||this.axisPosition==="right"?this.calculateSpaceIfDrawnVertical(e):this.calculateSpaceIfDrawnHorizontally(e),this.recalculateScale(),{width:this.boundingRect.width,height:this.boundingRect.height}}setBoundingBoxXY(e){this.boundingRect.x=e.x,this.boundingRect.y=e.y}getDrawableElementsForLeftAxis(){const e=[];if(this.showAxisLine){const r=this.boundingRect.x+this.boundingRect.width-this.axisConfig.axisLineWidth/2;e.push({type:"path",groupTexts:["left-axis","axisl-line"],data:[{path:`M ${r},${this.boundingRect.y} L ${r},${this.boundingRect.y+this.boundingRect.height} `,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&e.push({type:"text",groupTexts:["left-axis","label"],data:this.getTickValues().map(r=>({text:r.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(r),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"middle",horizontalPos:"right"}))}),this.showTick){const r=this.boundingRect.x+this.boundingRect.width-(this.showAxisLine?this.axisConfig.axisLineWidth:0);e.push({type:"path",groupTexts:["left-axis","ticks"],data:this.getTickValues().map(n=>({path:`M ${r},${this.getScaleValue(n)} L ${r-this.axisConfig.tickLength},${this.getScaleValue(n)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&e.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"}]}),e}getDrawableElementsForBottomAxis(){const e=[];if(this.showAxisLine){const r=this.boundingRect.y+this.axisConfig.axisLineWidth/2;e.push({type:"path",groupTexts:["bottom-axis","axis-line"],data:[{path:`M ${this.boundingRect.x},${r} L ${this.boundingRect.x+this.boundingRect.width},${r}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&e.push({type:"text",groupTexts:["bottom-axis","label"],data:this.getTickValues().map(r=>({text:r.toString(),x:this.getScaleValue(r),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 r=this.boundingRect.y+(this.showAxisLine?this.axisConfig.axisLineWidth:0);e.push({type:"path",groupTexts:["bottom-axis","ticks"],data:this.getTickValues().map(n=>({path:`M ${this.getScaleValue(n)},${r} L ${this.getScaleValue(n)},${r+this.axisConfig.tickLength}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&e.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"}]}),e}getDrawableElementsForTopAxis(){const e=[];if(this.showAxisLine){const r=this.boundingRect.y+this.boundingRect.height-this.axisConfig.axisLineWidth/2;e.push({type:"path",groupTexts:["top-axis","axis-line"],data:[{path:`M ${this.boundingRect.x},${r} L ${this.boundingRect.x+this.boundingRect.width},${r}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&e.push({type:"text",groupTexts:["top-axis","label"],data:this.getTickValues().map(r=>({text:r.toString(),x:this.getScaleValue(r),y:this.boundingRect.y+(this.showTitle?this.titleTextHeight+this.axisConfig.titlePadding*2:0)+this.axisConfig.labelPadding,fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}))}),this.showTick){const r=this.boundingRect.y;e.push({type:"path",groupTexts:["top-axis","ticks"],data:this.getTickValues().map(n=>({path:`M ${this.getScaleValue(n)},${r+this.boundingRect.height-(this.showAxisLine?this.axisConfig.axisLineWidth:0)} L ${this.getScaleValue(n)},${r+this.boundingRect.height-this.axisConfig.tickLength-(this.showAxisLine?this.axisConfig.axisLineWidth:0)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&e.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"}]}),e}getDrawableElements(){if(this.axisPosition==="left")return this.getDrawableElementsForLeftAxis();if(this.axisPosition==="right")throw Error("Drawing of right axis is not implemented");return this.axisPosition==="bottom"?this.getDrawableElementsForBottomAxis():this.axisPosition==="top"?this.getDrawableElementsForTopAxis():[]}},x(Lv,"BaseAxis"),Lv),olt=(Iv=class extends Ige{constructor(e,r,n,i,a){super(e,i,a,r),this.categories=n,this.scale=pA().domain(this.categories).range(this.getRange())}setRange(e){super.setRange(e)}recalculateScale(){this.scale=pA().domain(this.categories).range(this.getRange()).paddingInner(1).paddingOuter(0).align(.5),ae.trace("BandAxis axis final categories, range: ",this.categories,this.getRange())}getTickValues(){return this.categories}getScaleValue(e){return this.scale(e)??this.getRange()[0]}},x(Iv,"BandAxis"),Iv),llt=(Dv=class extends Ige{constructor(e,r,n,i,a){super(e,i,a,r),this.domain=n,this.scale=D0().domain(this.domain).range(this.getRange())}getTickValues(){return this.scale.ticks()}recalculateScale(){const e=[...this.domain];this.axisPosition==="left"&&e.reverse(),this.scale=D0().domain(e).range(this.getRange())}getScaleValue(e){return this.scale(e)}},x(Dv,"LinearAxis"),Dv);function h$(t,e,r,n){const i=new _ge(n);return u$(t)?new olt(e,r,t.categories,t.title,i):new llt(e,r,[t.min,t.max],t.title,i)}x(h$,"getAxis");var clt=(Mv=class{constructor(e,r,n,i){this.textDimensionCalculator=e,this.chartConfig=r,this.chartData=n,this.chartThemeConfig=i,this.boundingRect={x:0,y:0,width:0,height:0},this.showChartTitle=!1}setBoundingBoxXY(e){this.boundingRect.x=e.x,this.boundingRect.y=e.y}calculateSpace(e){const r=this.textDimensionCalculator.getMaxDimension([this.chartData.title],this.chartConfig.titleFontSize),n=Math.max(r.width,e.width),i=r.height+2*this.chartConfig.titlePadding;return r.width<=n&&r.height<=i&&this.chartConfig.showTitle&&this.chartData.title&&(this.boundingRect.width=n,this.boundingRect.height=i,this.showChartTitle=!0),{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){const e=[];return this.showChartTitle&&e.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}]}),e}},x(Mv,"ChartTitle"),Mv);function Dge(t,e,r,n){const i=new _ge(n);return new clt(i,t,e,r)}x(Dge,"getChartTitleComponent");var ult=(Nv=class{constructor(e,r,n,i,a){this.plotData=e,this.xAxis=r,this.yAxis=n,this.orientation=i,this.plotIndex=a}getDrawableElement(){const e=this.plotData.data.map(n=>[this.xAxis.getScaleValue(n[0]),this.yAxis.getScaleValue(n[1])]);let r;return this.orientation==="horizontal"?r=M2().y(n=>n[0]).x(n=>n[1])(e):r=M2().x(n=>n[0]).y(n=>n[1])(e),r?[{groupTexts:["plot",`line-plot-${this.plotIndex}`],type:"path",data:[{path:r,strokeFill:this.plotData.strokeFill,strokeWidth:this.plotData.strokeWidth}]}]:[]}},x(Nv,"LinePlot"),Nv),hlt=(Ov=class{constructor(e,r,n,i,a,s){this.barData=e,this.boundingRect=r,this.xAxis=n,this.yAxis=i,this.orientation=a,this.plotIndex=s}getDrawableElement(){const e=this.barData.data.map(a=>[this.xAxis.getScaleValue(a[0]),this.yAxis.getScaleValue(a[1])]),n=Math.min(this.xAxis.getAxisOuterPadding()*2,this.xAxis.getTickDistance())*(1-.05),i=n/2;return this.orientation==="horizontal"?[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:e.map(a=>({x:this.boundingRect.x,y:a[0]-i,height:n,width:a[1]-this.boundingRect.x,fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}]:[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:e.map(a=>({x:a[0]-i,y:a[1],width:n,height:this.boundingRect.y+this.boundingRect.height-a[1],fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}]}},x(Ov,"BarPlot"),Ov),dlt=($v=class{constructor(e,r,n){this.chartConfig=e,this.chartData=r,this.chartThemeConfig=n,this.boundingRect={x:0,y:0,width:0,height:0}}setAxes(e,r){this.xAxis=e,this.yAxis=r}setBoundingBoxXY(e){this.boundingRect.x=e.x,this.boundingRect.y=e.y}calculateSpace(e){return this.boundingRect.width=e.width,this.boundingRect.height=e.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 e=[];for(const[r,n]of this.chartData.plots.entries())switch(n.type){case"line":{const i=new ult(n,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,r);e.push(...i.getDrawableElement())}break;case"bar":{const i=new hlt(n,this.boundingRect,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,r);e.push(...i.getDrawableElement())}break}return e}},x($v,"BasePlot"),$v);function Mge(t,e,r){return new dlt(t,e,r)}x(Mge,"getPlotComponent");var flt=(Pv=class{constructor(e,r,n,i){this.chartConfig=e,this.chartData=r,this.componentStore={title:Dge(e,r,n,i),plot:Mge(e,r,n),xAxis:h$(r.xAxis,e.xAxis,{titleColor:n.xAxisTitleColor,labelColor:n.xAxisLabelColor,tickColor:n.xAxisTickColor,axisLineColor:n.xAxisLineColor},i),yAxis:h$(r.yAxis,e.yAxis,{titleColor:n.yAxisTitleColor,labelColor:n.yAxisLabelColor,tickColor:n.yAxisTickColor,axisLineColor:n.yAxisLineColor},i)}}calculateVerticalSpace(){let e=this.chartConfig.width,r=this.chartConfig.height,n=0,i=0,a=Math.floor(e*this.chartConfig.plotReservedSpacePercent/100),s=Math.floor(r*this.chartConfig.plotReservedSpacePercent/100),o=this.componentStore.plot.calculateSpace({width:a,height:s});e-=o.width,r-=o.height,o=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:r}),i=o.height,r-=o.height,this.componentStore.xAxis.setAxisPosition("bottom"),o=this.componentStore.xAxis.calculateSpace({width:e,height:r}),r-=o.height,this.componentStore.yAxis.setAxisPosition("left"),o=this.componentStore.yAxis.calculateSpace({width:e,height:r}),n=o.width,e-=o.width,e>0&&(a+=e,e=0),r>0&&(s+=r,r=0),this.componentStore.plot.calculateSpace({width:a,height:s}),this.componentStore.plot.setBoundingBoxXY({x:n,y:i}),this.componentStore.xAxis.setRange([n,n+a]),this.componentStore.xAxis.setBoundingBoxXY({x:n,y:i+s}),this.componentStore.yAxis.setRange([i,i+s]),this.componentStore.yAxis.setBoundingBoxXY({x:0,y:i}),this.chartData.plots.some(l=>c$(l))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateHorizontalSpace(){let e=this.chartConfig.width,r=this.chartConfig.height,n=0,i=0,a=0,s=Math.floor(e*this.chartConfig.plotReservedSpacePercent/100),o=Math.floor(r*this.chartConfig.plotReservedSpacePercent/100),l=this.componentStore.plot.calculateSpace({width:s,height:o});e-=l.width,r-=l.height,l=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:r}),n=l.height,r-=l.height,this.componentStore.xAxis.setAxisPosition("left"),l=this.componentStore.xAxis.calculateSpace({width:e,height:r}),e-=l.width,i=l.width,this.componentStore.yAxis.setAxisPosition("top"),l=this.componentStore.yAxis.calculateSpace({width:e,height:r}),r-=l.height,a=n+l.height,e>0&&(s+=e,e=0),r>0&&(o+=r,r=0),this.componentStore.plot.calculateSpace({width:s,height:o}),this.componentStore.plot.setBoundingBoxXY({x:i,y:a}),this.componentStore.yAxis.setRange([i,i+s]),this.componentStore.yAxis.setBoundingBoxXY({x:i,y:n}),this.componentStore.xAxis.setRange([a,a+o]),this.componentStore.xAxis.setBoundingBoxXY({x:0,y:a}),this.chartData.plots.some(u=>c$(u))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateSpace(){this.chartConfig.chartOrientation==="horizontal"?this.calculateHorizontalSpace():this.calculateVerticalSpace()}getDrawableElement(){this.calculateSpace();const e=[];this.componentStore.plot.setAxes(this.componentStore.xAxis,this.componentStore.yAxis);for(const r of Object.values(this.componentStore))e.push(...r.getDrawableElements());return e}},x(Pv,"Orchestrator"),Pv),plt=(Bv=class{static build(e,r,n,i){return new flt(e,r,n,i).getDrawableElement()}},x(Bv,"XYChartBuilder"),Bv),UT=0,Nge,HT=g$(),YT=p$(),hn=m$(),d$=YT.plotColorPalette.split(",").map(t=>t.trim()),xS=!1,f$=!1;function p$(){const t=w0(),e=lr();return ti(t.xyChart,e.themeVariables.xyChart)}x(p$,"getChartDefaultThemeConfig");function g$(){const t=lr();return ti(Fr.xyChart,t.xyChart)}x(g$,"getChartDefaultConfig");function m$(){return{yAxis:{type:"linear",title:"",min:1/0,max:-1/0},xAxis:{type:"band",title:"",categories:[]},title:"",plots:[]}}x(m$,"getChartDefaultData");function TS(t){const e=lr();return qr(t.trim(),e)}x(TS,"textSanitizer");function Oge(t){Nge=t}x(Oge,"setTmpSVGG");function $ge(t){t==="horizontal"?HT.chartOrientation="horizontal":HT.chartOrientation="vertical"}x($ge,"setOrientation");function Pge(t){hn.xAxis.title=TS(t.text)}x(Pge,"setXAxisTitle");function y$(t,e){hn.xAxis={type:"linear",title:hn.xAxis.title,min:t,max:e},xS=!0}x(y$,"setXAxisRangeData");function Bge(t){hn.xAxis={type:"band",title:hn.xAxis.title,categories:t.map(e=>TS(e.text))},xS=!0}x(Bge,"setXAxisBand");function Fge(t){hn.yAxis.title=TS(t.text)}x(Fge,"setYAxisTitle");function zge(t,e){hn.yAxis={type:"linear",title:hn.yAxis.title,min:t,max:e},f$=!0}x(zge,"setYAxisRangeData");function Gge(t){const e=Math.min(...t),r=Math.max(...t),n=Jg(hn.yAxis)?hn.yAxis.min:1/0,i=Jg(hn.yAxis)?hn.yAxis.max:-1/0;hn.yAxis={type:"linear",title:hn.yAxis.title,min:Math.min(n,e),max:Math.max(i,r)}}x(Gge,"setYAxisRangeFromPlotData");function v$(t){let e=[];if(t.length===0)return e;if(!xS){const r=Jg(hn.xAxis)?hn.xAxis.min:1/0,n=Jg(hn.xAxis)?hn.xAxis.max:-1/0;y$(Math.min(r,1),Math.max(n,t.length))}if(f$||Gge(t),u$(hn.xAxis)&&(e=hn.xAxis.categories.map((r,n)=>[r,t[n]])),Jg(hn.xAxis)){const r=hn.xAxis.min,n=hn.xAxis.max,i=(n-r)/(t.length-1),a=[];for(let s=r;s<=n;s+=i)a.push(`${s}`);e=a.map((s,o)=>[s,t[o]])}return e}x(v$,"transformDataWithoutCategory");function b$(t){return d$[t===0?0:t%d$.length]}x(b$,"getPlotColorFromPalette");function qge(t,e){const r=v$(e);hn.plots.push({type:"line",strokeFill:b$(UT),strokeWidth:2,data:r}),UT++}x(qge,"setLineData");function Vge(t,e){const r=v$(e);hn.plots.push({type:"bar",fill:b$(UT),data:r}),UT++}x(Vge,"setBarData");function Wge(){if(hn.plots.length===0)throw Error("No Plot to render, please provide a plot with some data");return hn.title=Mn(),plt.build(HT,hn,YT,Nge)}x(Wge,"getDrawableElem");function Uge(){return YT}x(Uge,"getChartThemeConfig");function Hge(){return HT}x(Hge,"getChartConfig");function Yge(){return hn}x(Yge,"getXYChartData");var glt=x(function(){In(),UT=0,HT=g$(),hn=m$(),YT=p$(),d$=YT.plotColorPalette.split(",").map(t=>t.trim()),xS=!1,f$=!1},"clear"),mlt={getDrawableElem:Wge,clear:glt,setAccTitle:Dn,getAccTitle:Fn,setDiagramTitle:qn,getDiagramTitle:Mn,getAccDescription:Gn,setAccDescription:zn,setOrientation:$ge,setXAxisTitle:Pge,setXAxisRangeData:y$,setXAxisBand:Bge,setYAxisTitle:Fge,setYAxisRangeData:zge,setLineData:qge,setBarData:Vge,setTmpSVGG:Oge,getChartThemeConfig:Uge,getChartConfig:Hge,getXYChartData:Yge},ylt=x((t,e,r,n)=>{const i=n.db,a=i.getChartThemeConfig(),s=i.getChartConfig(),o=i.getXYChartData().plots[0].data.map(v=>v[1]);function l(v){return v==="top"?"text-before-edge":"middle"}x(l,"getDominantBaseLine");function u(v){return v==="left"?"start":v==="right"?"end":"middle"}x(u,"getTextAnchor");function h(v){return`translate(${v.x}, ${v.y}) rotate(${v.rotation||0})`}x(h,"getTextTransformation"),ae.debug(`Rendering xychart chart -`+t);const d=ys(e),f=d.append("g").attr("class","main"),p=f.append("rect").attr("width",s.width).attr("height",s.height).attr("class","background");wi(d,s.height,s.width,!0),d.attr("viewBox",`0 0 ${s.width} ${s.height}`),p.attr("fill",a.backgroundColor),i.setTmpSVGG(d.append("g").attr("class","mermaid-tmp-group"));const g=i.getDrawableElem(),m={};function y(v){let T=f,b="";for(const[w]of v.entries()){let k=f;w>0&&m[b]&&(k=m[b]),b+=v[w],T=m[b],T||(T=m[b]=k.append("g").attr("class",v[w]))}return T}x(y,"getGroup");for(const v of g){if(v.data.length===0)continue;const T=y(v.groupTexts);switch(v.type){case"rect":if(T.selectAll("rect").data(v.data).enter().append("rect").attr("x",b=>b.x).attr("y",b=>b.y).attr("width",b=>b.width).attr("height",b=>b.height).attr("fill",b=>b.fill).attr("stroke",b=>b.strokeFill).attr("stroke-width",b=>b.strokeWidth),s.showDataLabel){const b=s.showDataLabelOutsideBar;if(s.chartOrientation==="horizontal"){let w=function(M,z){const{data:F,label:S}=M;return z*S.length*k<=F.width-A};x(w,"fitsHorizontally");const k=.7,A=10,C=v.data.map((M,z)=>({data:M,label:o[z].toString()})).filter(M=>M.data.width>0&&M.data.height>0),_=C.map(M=>{const{data:z}=M;let F=z.height*.7;for(;!w(M,F)&&F>0;)F-=1;return F}),L=Math.floor(Math.min(..._)),O=x(M=>b?M.data.x+M.data.width+A:M.data.x+M.data.width-A,"determineLabelXPosition");T.selectAll("text").data(C).enter().append("text").attr("x",O).attr("y",M=>M.data.y+M.data.height/2).attr("text-anchor",b?"start":"end").attr("dominant-baseline","middle").attr("fill",a.dataLabelColor).attr("font-size",`${L}px`).text(M=>M.label)}else{let w=function(O,M,z){const{data:F,label:S}=O,N=M*S.length*.7,D=F.x+F.width/2,I=D-N/2,$=D+N/2,B=I>=F.x&&$<=F.x+F.width,P=F.y+z+M<=F.y+F.height;return B&&P};x(w,"fitsInBar");const k=10,A=v.data.map((O,M)=>({data:O,label:o[M].toString()})).filter(O=>O.data.width>0&&O.data.height>0),C=A.map(O=>{const{data:M,label:z}=O;let F=M.width/(z.length*.7);for(;!w(O,F,k)&&F>0;)F-=1;return F}),_=Math.floor(Math.min(...C)),L=x(O=>b?O.data.y-k:O.data.y+k,"determineLabelYPosition");T.selectAll("text").data(A).enter().append("text").attr("x",O=>O.data.x+O.data.width/2).attr("y",L).attr("text-anchor","middle").attr("dominant-baseline",b?"auto":"hanging").attr("fill",a.dataLabelColor).attr("font-size",`${_}px`).text(O=>O.label)}}break;case"text":T.selectAll("text").data(v.data).enter().append("text").attr("x",0).attr("y",0).attr("fill",b=>b.fill).attr("font-size",b=>b.fontSize).attr("dominant-baseline",b=>l(b.verticalPos)).attr("text-anchor",b=>u(b.horizontalPos)).attr("transform",b=>h(b)).text(b=>b.text);break;case"path":T.selectAll("path").data(v.data).enter().append("path").attr("d",b=>b.path).attr("fill",b=>b.fill?b.fill:"none").attr("stroke",b=>b.strokeFill).attr("stroke-width",b=>b.strokeWidth);break}}},"draw"),vlt={draw:ylt},blt={parser:slt,db:mlt,renderer:vlt};const xlt=Object.freeze(Object.defineProperty({__proto__:null,diagram:blt},Symbol.toStringTag,{value:"Module"}));var x$=(function(){var t=x(function(Ce,Se,H,he){for(H=H||{},he=Ce.length;he--;H[Ce[he]]=Se);return H},"o"),e=[1,3],r=[1,4],n=[1,5],i=[1,6],a=[5,6,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,77,89,90],s=[1,22],o=[2,7],l=[1,26],u=[1,27],h=[1,28],d=[1,29],f=[1,33],p=[1,34],g=[1,35],m=[1,36],y=[1,37],v=[1,38],T=[1,24],b=[1,31],w=[1,32],k=[1,30],A=[1,39],C=[1,40],_=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,77,89,90],L=[1,61],O=[89,90],M=[5,8,9,11,13,21,22,23,24,27,29,41,42,43,44,45,46,54,61,63,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],z=[27,29],F=[1,70],S=[1,71],R=[1,72],N=[1,73],D=[1,74],I=[1,75],$=[1,76],B=[1,83],P=[1,80],G=[1,84],V=[1,85],Y=[1,86],W=[1,87],ie=[1,88],K=[1,89],se=[1,90],J=[1,91],Z=[1,92],ee=[5,8,9,11,13,21,22,23,24,27,41,42,43,44,45,46,54,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],ne=[63,64],ue=[1,101],fe=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,76,77,89,90],_e=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],Ae=[1,110],Ne=[1,106],me=[1,107],ve=[1,108],Ge=[1,109],Te=[1,111],Ze=[1,116],ke=[1,117],Ve=[1,114],Qe=[1,115],nt={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,start:3,directive:4,NEWLINE:5,RD:6,diagram:7,EOF:8,acc_title:9,acc_title_value:10,acc_descr:11,acc_descr_value:12,acc_descr_multiline_value:13,requirementDef:14,elementDef:15,relationshipDef:16,direction:17,styleStatement:18,classDefStatement:19,classStatement:20,direction_tb:21,direction_bt:22,direction_rl:23,direction_lr:24,requirementType:25,requirementName:26,STRUCT_START:27,requirementBody:28,STYLE_SEPARATOR:29,idList:30,ID:31,COLONSEP:32,id:33,TEXT:34,text:35,RISK:36,riskLevel:37,VERIFYMTHD:38,verifyType:39,STRUCT_STOP:40,REQUIREMENT:41,FUNCTIONAL_REQUIREMENT:42,INTERFACE_REQUIREMENT:43,PERFORMANCE_REQUIREMENT:44,PHYSICAL_REQUIREMENT:45,DESIGN_CONSTRAINT:46,LOW_RISK:47,MED_RISK:48,HIGH_RISK:49,VERIFY_ANALYSIS:50,VERIFY_DEMONSTRATION:51,VERIFY_INSPECTION:52,VERIFY_TEST:53,ELEMENT:54,elementName:55,elementBody:56,TYPE:57,type:58,DOCREF:59,ref:60,END_ARROW_L:61,relationship:62,LINE:63,END_ARROW_R:64,CONTAINS:65,COPIES:66,DERIVES:67,SATISFIES:68,VERIFIES:69,REFINES:70,TRACES:71,CLASSDEF:72,stylesOpt:73,CLASS:74,ALPHA:75,COMMA:76,STYLE:77,style:78,styleComponent:79,NUM:80,COLON:81,UNIT:82,SPACE:83,BRKT:84,PCT:85,MINUS:86,LABEL:87,SEMICOLON:88,unqString:89,qString:90,$accept:0,$end:1},terminals_:{2:"error",5:"NEWLINE",6:"RD",8:"EOF",9:"acc_title",10:"acc_title_value",11:"acc_descr",12:"acc_descr_value",13:"acc_descr_multiline_value",21:"direction_tb",22:"direction_bt",23:"direction_rl",24:"direction_lr",27:"STRUCT_START",29:"STYLE_SEPARATOR",31:"ID",32:"COLONSEP",34:"TEXT",36:"RISK",38:"VERIFYMTHD",40:"STRUCT_STOP",41:"REQUIREMENT",42:"FUNCTIONAL_REQUIREMENT",43:"INTERFACE_REQUIREMENT",44:"PERFORMANCE_REQUIREMENT",45:"PHYSICAL_REQUIREMENT",46:"DESIGN_CONSTRAINT",47:"LOW_RISK",48:"MED_RISK",49:"HIGH_RISK",50:"VERIFY_ANALYSIS",51:"VERIFY_DEMONSTRATION",52:"VERIFY_INSPECTION",53:"VERIFY_TEST",54:"ELEMENT",57:"TYPE",59:"DOCREF",61:"END_ARROW_L",63:"LINE",64:"END_ARROW_R",65:"CONTAINS",66:"COPIES",67:"DERIVES",68:"SATISFIES",69:"VERIFIES",70:"REFINES",71:"TRACES",72:"CLASSDEF",74:"CLASS",75:"ALPHA",76:"COMMA",77:"STYLE",80:"NUM",81:"COLON",82:"UNIT",83:"SPACE",84:"BRKT",85:"PCT",86:"MINUS",87:"LABEL",88:"SEMICOLON",89:"unqString",90:"qString"},productions_:[0,[3,3],[3,2],[3,4],[4,2],[4,2],[4,1],[7,0],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[17,1],[17,1],[17,1],[17,1],[14,5],[14,7],[28,5],[28,5],[28,5],[28,5],[28,2],[28,1],[25,1],[25,1],[25,1],[25,1],[25,1],[25,1],[37,1],[37,1],[37,1],[39,1],[39,1],[39,1],[39,1],[15,5],[15,7],[56,5],[56,5],[56,2],[56,1],[16,5],[16,5],[62,1],[62,1],[62,1],[62,1],[62,1],[62,1],[62,1],[19,3],[20,3],[20,3],[30,1],[30,3],[30,1],[30,3],[18,3],[73,1],[73,3],[78,1],[78,2],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[26,1],[26,1],[33,1],[33,1],[35,1],[35,1],[55,1],[55,1],[58,1],[58,1],[60,1],[60,1]],performAction:x(function(Se,H,he,j,pe,re,Be){var xe=re.length-1;switch(pe){case 4:this.$=re[xe].trim(),j.setAccTitle(this.$);break;case 5:case 6:this.$=re[xe].trim(),j.setAccDescription(this.$);break;case 7:this.$=[];break;case 17:j.setDirection("TB");break;case 18:j.setDirection("BT");break;case 19:j.setDirection("RL");break;case 20:j.setDirection("LR");break;case 21:j.addRequirement(re[xe-3],re[xe-4]);break;case 22:j.addRequirement(re[xe-5],re[xe-6]),j.setClass([re[xe-5]],re[xe-3]);break;case 23:j.setNewReqId(re[xe-2]);break;case 24:j.setNewReqText(re[xe-2]);break;case 25:j.setNewReqRisk(re[xe-2]);break;case 26:j.setNewReqVerifyMethod(re[xe-2]);break;case 29:this.$=j.RequirementType.REQUIREMENT;break;case 30:this.$=j.RequirementType.FUNCTIONAL_REQUIREMENT;break;case 31:this.$=j.RequirementType.INTERFACE_REQUIREMENT;break;case 32:this.$=j.RequirementType.PERFORMANCE_REQUIREMENT;break;case 33:this.$=j.RequirementType.PHYSICAL_REQUIREMENT;break;case 34:this.$=j.RequirementType.DESIGN_CONSTRAINT;break;case 35:this.$=j.RiskLevel.LOW_RISK;break;case 36:this.$=j.RiskLevel.MED_RISK;break;case 37:this.$=j.RiskLevel.HIGH_RISK;break;case 38:this.$=j.VerifyType.VERIFY_ANALYSIS;break;case 39:this.$=j.VerifyType.VERIFY_DEMONSTRATION;break;case 40:this.$=j.VerifyType.VERIFY_INSPECTION;break;case 41:this.$=j.VerifyType.VERIFY_TEST;break;case 42:j.addElement(re[xe-3]);break;case 43:j.addElement(re[xe-5]),j.setClass([re[xe-5]],re[xe-3]);break;case 44:j.setNewElementType(re[xe-2]);break;case 45:j.setNewElementDocRef(re[xe-2]);break;case 48:j.addRelationship(re[xe-2],re[xe],re[xe-4]);break;case 49:j.addRelationship(re[xe-2],re[xe-4],re[xe]);break;case 50:this.$=j.Relationships.CONTAINS;break;case 51:this.$=j.Relationships.COPIES;break;case 52:this.$=j.Relationships.DERIVES;break;case 53:this.$=j.Relationships.SATISFIES;break;case 54:this.$=j.Relationships.VERIFIES;break;case 55:this.$=j.Relationships.REFINES;break;case 56:this.$=j.Relationships.TRACES;break;case 57:this.$=re[xe-2],j.defineClass(re[xe-1],re[xe]);break;case 58:j.setClass(re[xe-1],re[xe]);break;case 59:j.setClass([re[xe-2]],re[xe]);break;case 60:case 62:this.$=[re[xe]];break;case 61:case 63:this.$=re[xe-2].concat([re[xe]]);break;case 64:this.$=re[xe-2],j.setCssStyle(re[xe-1],re[xe]);break;case 65:this.$=[re[xe]];break;case 66:re[xe-2].push(re[xe]),this.$=re[xe-2];break;case 68:this.$=re[xe-1]+re[xe];break}},"anonymous"),table:[{3:1,4:2,6:e,9:r,11:n,13:i},{1:[3]},{3:8,4:2,5:[1,7],6:e,9:r,11:n,13:i},{5:[1,9]},{10:[1,10]},{12:[1,11]},t(a,[2,6]),{3:12,4:2,6:e,9:r,11:n,13:i},{1:[2,2]},{4:17,5:s,7:13,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:y,46:v,54:T,72:b,74:w,77:k,89:A,90:C},t(a,[2,4]),t(a,[2,5]),{1:[2,1]},{8:[1,41]},{4:17,5:s,7:42,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:y,46:v,54:T,72:b,74:w,77:k,89:A,90:C},{4:17,5:s,7:43,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:y,46:v,54:T,72:b,74:w,77:k,89:A,90:C},{4:17,5:s,7:44,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:y,46:v,54:T,72:b,74:w,77:k,89:A,90:C},{4:17,5:s,7:45,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:y,46:v,54:T,72:b,74:w,77:k,89:A,90:C},{4:17,5:s,7:46,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:y,46:v,54:T,72:b,74:w,77:k,89:A,90:C},{4:17,5:s,7:47,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:y,46:v,54:T,72:b,74:w,77:k,89:A,90:C},{4:17,5:s,7:48,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:y,46:v,54:T,72:b,74:w,77:k,89:A,90:C},{4:17,5:s,7:49,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:y,46:v,54:T,72:b,74:w,77:k,89:A,90:C},{4:17,5:s,7:50,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:y,46:v,54:T,72:b,74:w,77:k,89:A,90:C},{26:51,89:[1,52],90:[1,53]},{55:54,89:[1,55],90:[1,56]},{29:[1,59],61:[1,57],63:[1,58]},t(_,[2,17]),t(_,[2,18]),t(_,[2,19]),t(_,[2,20]),{30:60,33:62,75:L,89:A,90:C},{30:63,33:62,75:L,89:A,90:C},{30:64,33:62,75:L,89:A,90:C},t(O,[2,29]),t(O,[2,30]),t(O,[2,31]),t(O,[2,32]),t(O,[2,33]),t(O,[2,34]),t(M,[2,81]),t(M,[2,82]),{1:[2,3]},{8:[2,8]},{8:[2,9]},{8:[2,10]},{8:[2,11]},{8:[2,12]},{8:[2,13]},{8:[2,14]},{8:[2,15]},{8:[2,16]},{27:[1,65],29:[1,66]},t(z,[2,79]),t(z,[2,80]),{27:[1,67],29:[1,68]},t(z,[2,85]),t(z,[2,86]),{62:69,65:F,66:S,67:R,68:N,69:D,70:I,71:$},{62:77,65:F,66:S,67:R,68:N,69:D,70:I,71:$},{30:78,33:62,75:L,89:A,90:C},{73:79,75:B,76:P,78:81,79:82,80:G,81:V,82:Y,83:W,84:ie,85:K,86:se,87:J,88:Z},t(ee,[2,60]),t(ee,[2,62]),{73:93,75:B,76:P,78:81,79:82,80:G,81:V,82:Y,83:W,84:ie,85:K,86:se,87:J,88:Z},{30:94,33:62,75:L,76:P,89:A,90:C},{5:[1,95]},{30:96,33:62,75:L,89:A,90:C},{5:[1,97]},{30:98,33:62,75:L,89:A,90:C},{63:[1,99]},t(ne,[2,50]),t(ne,[2,51]),t(ne,[2,52]),t(ne,[2,53]),t(ne,[2,54]),t(ne,[2,55]),t(ne,[2,56]),{64:[1,100]},t(_,[2,59],{76:P}),t(_,[2,64],{76:ue}),{33:103,75:[1,102],89:A,90:C},t(fe,[2,65],{79:104,75:B,80:G,81:V,82:Y,83:W,84:ie,85:K,86:se,87:J,88:Z}),t(_e,[2,67]),t(_e,[2,69]),t(_e,[2,70]),t(_e,[2,71]),t(_e,[2,72]),t(_e,[2,73]),t(_e,[2,74]),t(_e,[2,75]),t(_e,[2,76]),t(_e,[2,77]),t(_e,[2,78]),t(_,[2,57],{76:ue}),t(_,[2,58],{76:P}),{5:Ae,28:105,31:Ne,34:me,36:ve,38:Ge,40:Te},{27:[1,112],76:P},{5:Ze,40:ke,56:113,57:Ve,59:Qe},{27:[1,118],76:P},{33:119,89:A,90:C},{33:120,89:A,90:C},{75:B,78:121,79:82,80:G,81:V,82:Y,83:W,84:ie,85:K,86:se,87:J,88:Z},t(ee,[2,61]),t(ee,[2,63]),t(_e,[2,68]),t(_,[2,21]),{32:[1,122]},{32:[1,123]},{32:[1,124]},{32:[1,125]},{5:Ae,28:126,31:Ne,34:me,36:ve,38:Ge,40:Te},t(_,[2,28]),{5:[1,127]},t(_,[2,42]),{32:[1,128]},{32:[1,129]},{5:Ze,40:ke,56:130,57:Ve,59:Qe},t(_,[2,47]),{5:[1,131]},t(_,[2,48]),t(_,[2,49]),t(fe,[2,66],{79:104,75:B,80:G,81:V,82:Y,83:W,84:ie,85:K,86:se,87:J,88:Z}),{33:132,89:A,90:C},{35:133,89:[1,134],90:[1,135]},{37:136,47:[1,137],48:[1,138],49:[1,139]},{39:140,50:[1,141],51:[1,142],52:[1,143],53:[1,144]},t(_,[2,27]),{5:Ae,28:145,31:Ne,34:me,36:ve,38:Ge,40:Te},{58:146,89:[1,147],90:[1,148]},{60:149,89:[1,150],90:[1,151]},t(_,[2,46]),{5:Ze,40:ke,56:152,57:Ve,59:Qe},{5:[1,153]},{5:[1,154]},{5:[2,83]},{5:[2,84]},{5:[1,155]},{5:[2,35]},{5:[2,36]},{5:[2,37]},{5:[1,156]},{5:[2,38]},{5:[2,39]},{5:[2,40]},{5:[2,41]},t(_,[2,22]),{5:[1,157]},{5:[2,87]},{5:[2,88]},{5:[1,158]},{5:[2,89]},{5:[2,90]},t(_,[2,43]),{5:Ae,28:159,31:Ne,34:me,36:ve,38:Ge,40:Te},{5:Ae,28:160,31:Ne,34:me,36:ve,38:Ge,40:Te},{5:Ae,28:161,31:Ne,34:me,36:ve,38:Ge,40:Te},{5:Ae,28:162,31:Ne,34:me,36:ve,38:Ge,40:Te},{5:Ze,40:ke,56:163,57:Ve,59:Qe},{5:Ze,40:ke,56:164,57:Ve,59:Qe},t(_,[2,23]),t(_,[2,24]),t(_,[2,25]),t(_,[2,26]),t(_,[2,44]),t(_,[2,45])],defaultActions:{8:[2,2],12:[2,1],41:[2,3],42:[2,8],43:[2,9],44:[2,10],45:[2,11],46:[2,12],47:[2,13],48:[2,14],49:[2,15],50:[2,16],134:[2,83],135:[2,84],137:[2,35],138:[2,36],139:[2,37],141:[2,38],142:[2,39],143:[2,40],144:[2,41],147:[2,87],148:[2,88],150:[2,89],151:[2,90]},parseError:x(function(Se,H){if(H.recoverable)this.trace(Se);else{var he=new Error(Se);throw he.hash=H,he}},"parseError"),parse:x(function(Se){var H=this,he=[0],j=[],pe=[null],re=[],Be=this.table,xe="",Ue=0,De=0,qe=2,Le=1,Xe=re.slice.call(arguments,1),Ie=Object.create(this.lexer),it={yy:{}};for(var we in this.yy)Object.prototype.hasOwnProperty.call(this.yy,we)&&(it.yy[we]=this.yy[we]);Ie.setInput(Se,it.yy),it.yy.lexer=Ie,it.yy.parser=this,typeof Ie.yylloc>"u"&&(Ie.yylloc={});var lt=Ie.yylloc;re.push(lt);var be=Ie.options&&Ie.options.ranges;typeof it.yy.parseError=="function"?this.parseError=it.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Et(ye){he.length=he.length-2*ye,pe.length=pe.length-ye,re.length=re.length-ye}x(Et,"popStack");function vt(){var ye;return ye=j.pop()||Ie.lex()||Le,typeof ye!="number"&&(ye instanceof Array&&(j=ye,ye=j.pop()),ye=H.symbols_[ye]||ye),ye}x(vt,"lex");for(var ot,It,xt,ht,oe={},At,dt,ut,wt;;){if(It=he[he.length-1],this.defaultActions[It]?xt=this.defaultActions[It]:((ot===null||typeof ot>"u")&&(ot=vt()),xt=Be[It]&&Be[It][ot]),typeof xt>"u"||!xt.length||!xt[0]){var Mr="";wt=[];for(At in Be[It])this.terminals_[At]&&At>qe&&wt.push("'"+this.terminals_[At]+"'");Ie.showPosition?Mr="Parse error on line "+(Ue+1)+`: +Expecting `+Ve.join(", ")+", got '"+(this.terminals_[Se]||Se)+"'":Qe="Parse error on line "+(H+1)+": Unexpected "+(Se==j?"end of input":"'"+(this.terminals_[Se]||Se)+"'"),this.parseError(Qe,{text:J.match,token:this.terminals_[Se]||Se,line:J.yylineno,loc:re,expected:Ve})}if(ge[0]instanceof Array&&ge.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Ne+", token: "+Se);switch(ge[0]){case 1:D.push(Se),B.push(J.yytext),P.push(J.yylloc),D.push(ge[1]),Se=null,W=J.yyleng,V=J.yytext,H=J.yylineno,re=J.yylloc;break;case 2:if(Ke=this.productions_[ge[1]][1],ze.$=B[B.length-Ke],ze._$={first_line:P[P.length-(Ke||1)].first_line,last_line:P[P.length-1].last_line,first_column:P[P.length-(Ke||1)].first_column,last_column:P[P.length-1].last_column},le&&(ze._$.range=[P[P.length-(Ke||1)].range[0],P[P.length-1].range[1]]),ve=this.performAction.apply(ze,[V,W,H,K.yy,ge[1],B,P].concat(ae)),typeof ve<"u")return ve;Ke&&(D=D.slice(0,-1*Ke*2),B=B.slice(0,-1*Ke),P=P.slice(0,-1*Ke)),D.push(this.productions_[ge[1]][0]),B.push(ze.$),P.push(ze._$),Ce=G[D[D.length-2]][D[D.length-1]],D.push(Ce);break;case 3:return!0}}return!0},"parse")},F=(function(){var R={EOF:1,parseError:T(function(M,D){if(this.yy.parser)this.yy.parser.parseError(M,D);else throw new Error(M)},"parseError"),setInput:T(function(N,M){return this.yy=M||this.yy||{},this._input=N,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:T(function(){var N=this._input[0];this.yytext+=N,this.yyleng++,this.offset++,this.match+=N,this.matched+=N;var M=N.match(/(?:\r\n?|\n).*/g);return M?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),N},"input"),unput:T(function(N){var M=N.length,D=N.split(/(?:\r\n?|\n)/g);this._input=N+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-M),this.offset-=M;var O=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),D.length-1&&(this.yylineno-=D.length-1);var B=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:D?(D.length===O.length?this.yylloc.first_column:0)+O[O.length-D.length].length-D[0].length:this.yylloc.first_column-M},this.options.ranges&&(this.yylloc.range=[B[0],B[0]+this.yyleng-M]),this.yyleng=this.yytext.length,this},"unput"),more:T(function(){return this._more=!0,this},"more"),reject:T(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). +`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:T(function(N){this.unput(this.match.slice(N))},"less"),pastInput:T(function(){var N=this.matched.substr(0,this.matched.length-this.match.length);return(N.length>20?"...":"")+N.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:T(function(){var N=this.match;return N.length<20&&(N+=this._input.substr(0,20-N.length)),(N.substr(0,20)+(N.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:T(function(){var N=this.pastInput(),M=new Array(N.length+1).join("-");return N+this.upcomingInput()+` +`+M+"^"},"showPosition"),test_match:T(function(N,M){var D,O,B;if(this.options.backtrack_lexer&&(B={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&&(B.yylloc.range=this.yylloc.range.slice(0))),O=N[0].match(/(?:\r\n?|\n).*/g),O&&(this.yylineno+=O.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:O?O[O.length-1].length-O[O.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+N[0].length},this.yytext+=N[0],this.match+=N[0],this.matches=N,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(N[0].length),this.matched+=N[0],D=this.performAction.call(this,this.yy,this,M,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),D)return D;if(this._backtrack){for(var P in B)this[P]=B[P];return!1}return!1},"test_match"),next:T(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var N,M,D,O;this._more||(this.yytext="",this.match="");for(var B=this._currentRules(),P=0;PM[0].length)){if(M=D,O=P,this.options.backtrack_lexer){if(N=this.test_match(D,B[P]),N!==!1)return N;if(this._backtrack){M=!1;continue}else return!1}else if(!this.options.flex)break}return M?(N=this.test_match(M,B[O]),N!==!1?N:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:T(function(){var M=this.next();return M||this.lex()},"lex"),begin:T(function(M){this.conditionStack.push(M)},"begin"),popState:T(function(){var M=this.conditionStack.length-1;return M>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:T(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:T(function(M){return M=this.conditionStack.length-1-Math.abs(M||0),M>=0?this.conditionStack[M]:"INITIAL"},"topState"),pushState:T(function(M){this.begin(M)},"pushState"),stateStackSize:T(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:T(function(M,D,O,B){switch(O){case 0:break;case 1:break;case 2:return this.popState(),34;case 3:return this.popState(),34;case 4:return 34;case 5:break;case 6:return 10;case 7:return this.pushState("acc_title"),19;case 8:return this.popState(),"acc_title_value";case 9:return this.pushState("acc_descr"),21;case 10:return this.popState(),"acc_descr_value";case 11:this.pushState("acc_descr_multiline");break;case 12:this.popState();break;case 13:return"acc_descr_multiline_value";case 14:return 5;case 15:return 5;case 16:return 8;case 17:return this.pushState("axis_data"),"X_AXIS";case 18:return this.pushState("axis_data"),"Y_AXIS";case 19:return this.pushState("axis_band_data"),24;case 20:return 31;case 21:return this.pushState("data"),16;case 22:return this.pushState("data"),18;case 23:return this.pushState("data_inner"),24;case 24:return 27;case 25:return this.popState(),26;case 26:this.popState();break;case 27:this.pushState("string");break;case 28:this.popState();break;case 29:return"STR";case 30:return 24;case 31:return 26;case 32:return 43;case 33:return"COLON";case 34:return 44;case 35:return 28;case 36:return 45;case 37:return 46;case 38:return 48;case 39:return 50;case 40:return 47;case 41:return 41;case 42:return 49;case 43:return 42;case 44:break;case 45:return 35;case 46:return 36}},"anonymous"),rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:(\r?\n))/i,/^(?:(\r?\n))/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:title\b)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:\})/i,/^(?:[^\}]*)/i,/^(?:xychart-beta\b)/i,/^(?:xychart\b)/i,/^(?:(?:vertical|horizontal))/i,/^(?:x-axis\b)/i,/^(?:y-axis\b)/i,/^(?:\[)/i,/^(?:-->)/i,/^(?:line\b)/i,/^(?:bar\b)/i,/^(?:\[)/i,/^(?:[+-]?(?:\d+(?:\.\d+)?|\.\d+))/i,/^(?:\])/i,/^(?:(?:`\) \{ this\.pushState\(md_string\); \}\n\(\?:\(\?!`"\)\.\)\+ \{ return MD_STR; \}\n\(\?:`))/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:\[)/i,/^(?:\])/i,/^(?:[A-Za-z]+)/i,/^(?::)/i,/^(?:\+)/i,/^(?:,)/i,/^(?:=)/i,/^(?:\*)/i,/^(?:#)/i,/^(?:[\_])/i,/^(?:\.)/i,/^(?:&)/i,/^(?:-)/i,/^(?:[0-9]+)/i,/^(?:\s+)/i,/^(?:;)/i,/^(?:$)/i],conditions:{data_inner:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,24,25,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},data:{rules:[0,1,3,4,5,6,7,9,11,14,15,16,17,18,21,22,23,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},axis_band_data:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,25,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},axis_data:{rules:[0,1,2,4,5,6,7,9,11,14,15,16,17,18,19,20,21,22,24,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},acc_descr_multiline:{rules:[12,13],inclusive:!1},acc_descr:{rules:[10],inclusive:!1},acc_title:{rules:[8],inclusive:!1},title:{rules:[],inclusive:!1},md_string:{rules:[],inclusive:!1},string:{rules:[28,29],inclusive:!1},INITIAL:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0}}};return R})();z.lexer=F;function A(){this.yy={}}return T(A,"Parser"),A.prototype=z,z.Parser=A,new A})();Pz.parser=Pz;var Hmt=Pz;function Bz(t){return t.type==="bar"}T(Bz,"isBarPlot");function Fz(t){return t.type==="band"}T(Fz,"isBandAxisData");function D1(t){return t.type==="linear"}T(D1,"isLinearAxisData");var Uxe=(lb=class{constructor(e){this.parentGroup=e}getMaxDimension(e,r){if(!this.parentGroup)return{width:e.reduce((a,s)=>Math.max(s.length,a),0)*r,height:r};const n={width:0,height:0},i=this.parentGroup.append("g").attr("visibility","hidden").attr("font-size",r);for(const a of e){const s=kX(i,1,a),o=s?s.width:a.length*r,l=s?s.height:r;n.width=Math.max(n.width,o),n.height=Math.max(n.height,l)}return i.remove(),n}},T(lb,"TextDimensionCalculatorWithFont"),lb),Hxe=.7,Yxe=.2,Xxe=(cb=class{constructor(e,r,n,i){this.axisConfig=e,this.title=r,this.textDimensionCalculator=n,this.axisThemeConfig=i,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"}setRange(e){this.range=e,this.axisPosition==="left"||this.axisPosition==="right"?this.boundingRect.height=e[1]-e[0]:this.boundingRect.width=e[1]-e[0],this.recalculateScale()}getRange(){return[this.range[0]+this.outerPadding,this.range[1]-this.outerPadding]}setAxisPosition(e){this.axisPosition=e,this.setRange(this.range)}getTickDistance(){const e=this.getRange();return Math.abs(e[0]-e[1])/this.getTickValues().length}getAxisOuterPadding(){return this.outerPadding}getLabelDimension(){return this.textDimensionCalculator.getMaxDimension(this.getTickValues().map(e=>e.toString()),this.axisConfig.labelFontSize)}recalculateOuterPaddingToDrawBar(){Hxe*this.getTickDistance()>this.outerPadding*2&&(this.outerPadding=Math.floor(Hxe*this.getTickDistance()/2)),this.recalculateScale()}calculateSpaceIfDrawnHorizontally(e){let r=e.height;if(this.axisConfig.showAxisLine&&r>this.axisConfig.axisLineWidth&&(r-=this.axisConfig.axisLineWidth,this.showAxisLine=!0),this.axisConfig.showLabel){const n=this.getLabelDimension(),i=Yxe*e.width;this.outerPadding=Math.min(n.width/2,i);const a=n.height+this.axisConfig.labelPadding*2;this.labelTextHeight=n.height,a<=r&&(r-=a,this.showLabel=!0)}if(this.axisConfig.showTick&&r>=this.axisConfig.tickLength&&(this.showTick=!0,r-=this.axisConfig.tickLength),this.axisConfig.showTitle&&this.title){const n=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),i=n.height+this.axisConfig.titlePadding*2;this.titleTextHeight=n.height,i<=r&&(r-=i,this.showTitle=!0)}this.boundingRect.width=e.width,this.boundingRect.height=e.height-r}calculateSpaceIfDrawnVertical(e){let r=e.width;if(this.axisConfig.showAxisLine&&r>this.axisConfig.axisLineWidth&&(r-=this.axisConfig.axisLineWidth,this.showAxisLine=!0),this.axisConfig.showLabel){const n=this.getLabelDimension(),i=Yxe*e.height;this.outerPadding=Math.min(n.height/2,i);const a=n.width+this.axisConfig.labelPadding*2;a<=r&&(r-=a,this.showLabel=!0)}if(this.axisConfig.showTick&&r>=this.axisConfig.tickLength&&(this.showTick=!0,r-=this.axisConfig.tickLength),this.axisConfig.showTitle&&this.title){const n=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),i=n.height+this.axisConfig.titlePadding*2;this.titleTextHeight=n.height,i<=r&&(r-=i,this.showTitle=!0)}this.boundingRect.width=e.width-r,this.boundingRect.height=e.height}calculateSpace(e){return this.axisPosition==="left"||this.axisPosition==="right"?this.calculateSpaceIfDrawnVertical(e):this.calculateSpaceIfDrawnHorizontally(e),this.recalculateScale(),{width:this.boundingRect.width,height:this.boundingRect.height}}setBoundingBoxXY(e){this.boundingRect.x=e.x,this.boundingRect.y=e.y}getDrawableElementsForLeftAxis(){const e=[];if(this.showAxisLine){const r=this.boundingRect.x+this.boundingRect.width-this.axisConfig.axisLineWidth/2;e.push({type:"path",groupTexts:["left-axis","axisl-line"],data:[{path:`M ${r},${this.boundingRect.y} L ${r},${this.boundingRect.y+this.boundingRect.height} `,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&e.push({type:"text",groupTexts:["left-axis","label"],data:this.getTickValues().map(r=>({text:r.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(r),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"middle",horizontalPos:"right"}))}),this.showTick){const r=this.boundingRect.x+this.boundingRect.width-(this.showAxisLine?this.axisConfig.axisLineWidth:0);e.push({type:"path",groupTexts:["left-axis","ticks"],data:this.getTickValues().map(n=>({path:`M ${r},${this.getScaleValue(n)} L ${r-this.axisConfig.tickLength},${this.getScaleValue(n)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&e.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"}]}),e}getDrawableElementsForBottomAxis(){const e=[];if(this.showAxisLine){const r=this.boundingRect.y+this.axisConfig.axisLineWidth/2;e.push({type:"path",groupTexts:["bottom-axis","axis-line"],data:[{path:`M ${this.boundingRect.x},${r} L ${this.boundingRect.x+this.boundingRect.width},${r}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&e.push({type:"text",groupTexts:["bottom-axis","label"],data:this.getTickValues().map(r=>({text:r.toString(),x:this.getScaleValue(r),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 r=this.boundingRect.y+(this.showAxisLine?this.axisConfig.axisLineWidth:0);e.push({type:"path",groupTexts:["bottom-axis","ticks"],data:this.getTickValues().map(n=>({path:`M ${this.getScaleValue(n)},${r} L ${this.getScaleValue(n)},${r+this.axisConfig.tickLength}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&e.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"}]}),e}getDrawableElementsForTopAxis(){const e=[];if(this.showAxisLine){const r=this.boundingRect.y+this.boundingRect.height-this.axisConfig.axisLineWidth/2;e.push({type:"path",groupTexts:["top-axis","axis-line"],data:[{path:`M ${this.boundingRect.x},${r} L ${this.boundingRect.x+this.boundingRect.width},${r}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&e.push({type:"text",groupTexts:["top-axis","label"],data:this.getTickValues().map(r=>({text:r.toString(),x:this.getScaleValue(r),y:this.boundingRect.y+(this.showTitle?this.titleTextHeight+this.axisConfig.titlePadding*2:0)+this.axisConfig.labelPadding,fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}))}),this.showTick){const r=this.boundingRect.y;e.push({type:"path",groupTexts:["top-axis","ticks"],data:this.getTickValues().map(n=>({path:`M ${this.getScaleValue(n)},${r+this.boundingRect.height-(this.showAxisLine?this.axisConfig.axisLineWidth:0)} L ${this.getScaleValue(n)},${r+this.boundingRect.height-this.axisConfig.tickLength-(this.showAxisLine?this.axisConfig.axisLineWidth:0)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&e.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"}]}),e}getDrawableElements(){if(this.axisPosition==="left")return this.getDrawableElementsForLeftAxis();if(this.axisPosition==="right")throw Error("Drawing of right axis is not implemented");return this.axisPosition==="bottom"?this.getDrawableElementsForBottomAxis():this.axisPosition==="top"?this.getDrawableElementsForTopAxis():[]}},T(cb,"BaseAxis"),cb),Ymt=(ub=class extends Xxe{constructor(e,r,n,i,a){super(e,i,a,r),this.categories=n,this.scale=fR().domain(this.categories).range(this.getRange())}setRange(e){super.setRange(e)}recalculateScale(){this.scale=fR().domain(this.categories).range(this.getRange()).paddingInner(1).paddingOuter(0).align(.5),se.trace("BandAxis axis final categories, range: ",this.categories,this.getRange())}getTickValues(){return this.categories}getScaleValue(e){return this.scale(e)??this.getRange()[0]}},T(ub,"BandAxis"),ub),Xmt=(hb=class extends Xxe{constructor(e,r,n,i,a){super(e,i,a,r),this.domain=n,this.scale=X0().domain(this.domain).range(this.getRange())}getTickValues(){return this.scale.ticks()}recalculateScale(){const e=[...this.domain];this.axisPosition==="left"&&e.reverse(),this.scale=X0().domain(e).range(this.getRange())}getScaleValue(e){return this.scale(e)}},T(hb,"LinearAxis"),hb);function zz(t,e,r,n){const i=new Uxe(n);return Fz(t)?new Ymt(e,r,t.categories,t.title,i):new Xmt(e,r,[t.min,t.max],t.title,i)}T(zz,"getAxis");var jmt=(db=class{constructor(e,r,n,i){this.textDimensionCalculator=e,this.chartConfig=r,this.chartData=n,this.chartThemeConfig=i,this.boundingRect={x:0,y:0,width:0,height:0},this.showChartTitle=!1}setBoundingBoxXY(e){this.boundingRect.x=e.x,this.boundingRect.y=e.y}calculateSpace(e){const r=this.textDimensionCalculator.getMaxDimension([this.chartData.title],this.chartConfig.titleFontSize),n=Math.max(r.width,e.width),i=r.height+2*this.chartConfig.titlePadding;return r.width<=n&&r.height<=i&&this.chartConfig.showTitle&&this.chartData.title&&(this.boundingRect.width=n,this.boundingRect.height=i,this.showChartTitle=!0),{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){const e=[];return this.showChartTitle&&e.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}]}),e}},T(db,"ChartTitle"),db);function jxe(t,e,r,n){const i=new Uxe(n);return new jmt(i,t,e,r)}T(jxe,"getChartTitleComponent");var Kmt=(fb=class{constructor(e,r,n,i,a){this.plotData=e,this.xAxis=r,this.yAxis=n,this.orientation=i,this.plotIndex=a}getDrawableElement(){const e=this.plotData.data.map(n=>[this.xAxis.getScaleValue(n[0]),this.yAxis.getScaleValue(n[1])]);let r;return this.orientation==="horizontal"?r=dx().y(n=>n[0]).x(n=>n[1])(e):r=dx().x(n=>n[0]).y(n=>n[1])(e),r?[{groupTexts:["plot",`line-plot-${this.plotIndex}`],type:"path",data:[{path:r,strokeFill:this.plotData.strokeFill,strokeWidth:this.plotData.strokeWidth}]}]:[]}},T(fb,"LinePlot"),fb),Zmt=(pb=class{constructor(e,r,n,i,a,s){this.barData=e,this.boundingRect=r,this.xAxis=n,this.yAxis=i,this.orientation=a,this.plotIndex=s}getDrawableElement(){const e=this.barData.data.map(a=>[this.xAxis.getScaleValue(a[0]),this.yAxis.getScaleValue(a[1])]),n=Math.min(this.xAxis.getAxisOuterPadding()*2,this.xAxis.getTickDistance())*(1-.05),i=n/2;return this.orientation==="horizontal"?[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:e.map(a=>({x:this.boundingRect.x,y:a[0]-i,height:n,width:a[1]-this.boundingRect.x,fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}]:[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:e.map(a=>({x:a[0]-i,y:a[1],width:n,height:this.boundingRect.y+this.boundingRect.height-a[1],fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}]}},T(pb,"BarPlot"),pb),Qmt=(gb=class{constructor(e,r,n){this.chartConfig=e,this.chartData=r,this.chartThemeConfig=n,this.boundingRect={x:0,y:0,width:0,height:0}}setAxes(e,r){this.xAxis=e,this.yAxis=r}setBoundingBoxXY(e){this.boundingRect.x=e.x,this.boundingRect.y=e.y}calculateSpace(e){return this.boundingRect.width=e.width,this.boundingRect.height=e.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 e=[];for(const[r,n]of this.chartData.plots.entries())switch(n.type){case"line":{const i=new Kmt(n,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,r);e.push(...i.getDrawableElement())}break;case"bar":{const i=new Zmt(n,this.boundingRect,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,r);e.push(...i.getDrawableElement())}break}return e}},T(gb,"BasePlot"),gb);function Kxe(t,e,r){return new Qmt(t,e,r)}T(Kxe,"getPlotComponent");var Jmt=(mb=class{constructor(e,r,n,i){this.chartConfig=e,this.chartData=r,this.componentStore={title:jxe(e,r,n,i),plot:Kxe(e,r,n),xAxis:zz(r.xAxis,e.xAxis,{titleColor:n.xAxisTitleColor,labelColor:n.xAxisLabelColor,tickColor:n.xAxisTickColor,axisLineColor:n.xAxisLineColor},i),yAxis:zz(r.yAxis,e.yAxis,{titleColor:n.yAxisTitleColor,labelColor:n.yAxisLabelColor,tickColor:n.yAxisTickColor,axisLineColor:n.yAxisLineColor},i)}}calculateVerticalSpace(){let e=this.chartConfig.width,r=this.chartConfig.height,n=0,i=0,a=Math.floor(e*this.chartConfig.plotReservedSpacePercent/100),s=Math.floor(r*this.chartConfig.plotReservedSpacePercent/100),o=this.componentStore.plot.calculateSpace({width:a,height:s});e-=o.width,r-=o.height,o=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:r}),i=o.height,r-=o.height,this.componentStore.xAxis.setAxisPosition("bottom"),o=this.componentStore.xAxis.calculateSpace({width:e,height:r}),r-=o.height,this.componentStore.yAxis.setAxisPosition("left"),o=this.componentStore.yAxis.calculateSpace({width:e,height:r}),n=o.width,e-=o.width,e>0&&(a+=e,e=0),r>0&&(s+=r,r=0),this.componentStore.plot.calculateSpace({width:a,height:s}),this.componentStore.plot.setBoundingBoxXY({x:n,y:i}),this.componentStore.xAxis.setRange([n,n+a]),this.componentStore.xAxis.setBoundingBoxXY({x:n,y:i+s}),this.componentStore.yAxis.setRange([i,i+s]),this.componentStore.yAxis.setBoundingBoxXY({x:0,y:i}),this.chartData.plots.some(l=>Bz(l))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateHorizontalSpace(){let e=this.chartConfig.width,r=this.chartConfig.height,n=0,i=0,a=0,s=Math.floor(e*this.chartConfig.plotReservedSpacePercent/100),o=Math.floor(r*this.chartConfig.plotReservedSpacePercent/100),l=this.componentStore.plot.calculateSpace({width:s,height:o});e-=l.width,r-=l.height,l=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:r}),n=l.height,r-=l.height,this.componentStore.xAxis.setAxisPosition("left"),l=this.componentStore.xAxis.calculateSpace({width:e,height:r}),e-=l.width,i=l.width,this.componentStore.yAxis.setAxisPosition("top"),l=this.componentStore.yAxis.calculateSpace({width:e,height:r}),r-=l.height,a=n+l.height,e>0&&(s+=e,e=0),r>0&&(o+=r,r=0),this.componentStore.plot.calculateSpace({width:s,height:o}),this.componentStore.plot.setBoundingBoxXY({x:i,y:a}),this.componentStore.yAxis.setRange([i,i+s]),this.componentStore.yAxis.setBoundingBoxXY({x:i,y:n}),this.componentStore.xAxis.setRange([a,a+o]),this.componentStore.xAxis.setBoundingBoxXY({x:0,y:a}),this.chartData.plots.some(u=>Bz(u))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateSpace(){this.chartConfig.chartOrientation==="horizontal"?this.calculateHorizontalSpace():this.calculateVerticalSpace()}getDrawableElement(){this.calculateSpace();const e=[];this.componentStore.plot.setAxes(this.componentStore.xAxis,this.componentStore.yAxis);for(const r of Object.values(this.componentStore))e.push(...r.getDrawableElements());return e}},T(mb,"Orchestrator"),mb),e1t=(yb=class{static build(e,r,n,i){return new Jmt(e,r,n,i).getDrawableElement()}},T(yb,"XYChartBuilder"),yb),QC=0,Zxe,JC=Wz(),e4=Vz(),Tn=Uz(),Gz=e4.plotColorPalette.split(",").map(t=>t.trim()),bA=!1,qz=!1;function Vz(){const t=B0(),e=pr();return wi(t.xyChart,e.themeVariables.xyChart)}T(Vz,"getChartDefaultThemeConfig");function Wz(){const t=pr();return wi(Xr.xyChart,t.xyChart)}T(Wz,"getChartDefaultConfig");function Uz(){return{yAxis:{type:"linear",title:"",min:1/0,max:-1/0},xAxis:{type:"band",title:"",categories:[]},title:"",plots:[]}}T(Uz,"getChartDefaultData");function xA(t){const e=pr();return Zr(t.trim(),e)}T(xA,"textSanitizer");function Qxe(t){Zxe=t}T(Qxe,"setTmpSVGG");function Jxe(t){t==="horizontal"?JC.chartOrientation="horizontal":JC.chartOrientation="vertical"}T(Jxe,"setOrientation");function eTe(t){Tn.xAxis.title=xA(t.text)}T(eTe,"setXAxisTitle");function Hz(t,e){Tn.xAxis={type:"linear",title:Tn.xAxis.title,min:t,max:e},bA=!0}T(Hz,"setXAxisRangeData");function tTe(t){Tn.xAxis={type:"band",title:Tn.xAxis.title,categories:t.map(e=>xA(e.text))},bA=!0}T(tTe,"setXAxisBand");function rTe(t){Tn.yAxis.title=xA(t.text)}T(rTe,"setYAxisTitle");function nTe(t,e){Tn.yAxis={type:"linear",title:Tn.yAxis.title,min:t,max:e},qz=!0}T(nTe,"setYAxisRangeData");function iTe(t){const e=Math.min(...t),r=Math.max(...t),n=D1(Tn.yAxis)?Tn.yAxis.min:1/0,i=D1(Tn.yAxis)?Tn.yAxis.max:-1/0;Tn.yAxis={type:"linear",title:Tn.yAxis.title,min:Math.min(n,e),max:Math.max(i,r)}}T(iTe,"setYAxisRangeFromPlotData");function Yz(t){let e=[];if(t.length===0)return e;if(!bA){const r=D1(Tn.xAxis)?Tn.xAxis.min:1/0,n=D1(Tn.xAxis)?Tn.xAxis.max:-1/0;Hz(Math.min(r,1),Math.max(n,t.length))}if(qz||iTe(t),Fz(Tn.xAxis)&&(e=Tn.xAxis.categories.map((r,n)=>[r,t[n]])),D1(Tn.xAxis)){const r=Tn.xAxis.min,n=Tn.xAxis.max,i=(n-r)/(t.length-1),a=[];for(let s=r;s<=n;s+=i)a.push(`${s}`);e=a.map((s,o)=>[s,t[o]])}return e}T(Yz,"transformDataWithoutCategory");function Xz(t){return Gz[t===0?0:t%Gz.length]}T(Xz,"getPlotColorFromPalette");function aTe(t,e){const r=Yz(e);Tn.plots.push({type:"line",strokeFill:Xz(QC),strokeWidth:2,data:r}),QC++}T(aTe,"setLineData");function sTe(t,e){const r=Yz(e);Tn.plots.push({type:"bar",fill:Xz(QC),data:r}),QC++}T(sTe,"setBarData");function oTe(){if(Tn.plots.length===0)throw Error("No Plot to render, please provide a plot with some data");return Tn.title=Xn(),e1t.build(JC,Tn,e4,Zxe)}T(oTe,"getDrawableElem");function lTe(){return e4}T(lTe,"getChartThemeConfig");function cTe(){return JC}T(cTe,"getChartConfig");function uTe(){return Tn}T(uTe,"getXYChartData");var t1t=T(function(){Hn(),QC=0,JC=Wz(),Tn=Uz(),e4=Vz(),Gz=e4.plotColorPalette.split(",").map(t=>t.trim()),bA=!1,qz=!1},"clear"),r1t={getDrawableElem:oTe,clear:t1t,setAccTitle:Yn,getAccTitle:ii,setDiagramTitle:oi,getDiagramTitle:Xn,getAccDescription:si,setAccDescription:ai,setOrientation:Jxe,setXAxisTitle:eTe,setXAxisRangeData:Hz,setXAxisBand:tTe,setYAxisTitle:rTe,setYAxisRangeData:nTe,setLineData:aTe,setBarData:sTe,setTmpSVGG:Qxe,getChartThemeConfig:lTe,getChartConfig:cTe,getXYChartData:uTe},n1t=T((t,e,r,n)=>{const i=n.db,a=i.getChartThemeConfig(),s=i.getChartConfig(),o=i.getXYChartData().plots[0].data.map(v=>v[1]);function l(v){return v==="top"?"text-before-edge":"middle"}T(l,"getDominantBaseLine");function u(v){return v==="left"?"start":v==="right"?"end":"middle"}T(u,"getTextAnchor");function h(v){return`translate(${v.x}, ${v.y}) rotate(${v.rotation||0})`}T(h,"getTextTransformation"),se.debug(`Rendering xychart chart +`+t);const d=Ys(e),f=d.append("g").attr("class","main"),p=f.append("rect").attr("width",s.width).attr("height",s.height).attr("class","background");Wi(d,s.height,s.width,!0),d.attr("viewBox",`0 0 ${s.width} ${s.height}`),p.attr("fill",a.backgroundColor),i.setTmpSVGG(d.append("g").attr("class","mermaid-tmp-group"));const g=i.getDrawableElem(),m={};function y(v){let x=f,b="";for(const[w]of v.entries()){let C=f;w>0&&m[b]&&(C=m[b]),b+=v[w],x=m[b],x||(x=m[b]=C.append("g").attr("class",v[w]))}return x}T(y,"getGroup");for(const v of g){if(v.data.length===0)continue;const x=y(v.groupTexts);switch(v.type){case"rect":if(x.selectAll("rect").data(v.data).enter().append("rect").attr("x",b=>b.x).attr("y",b=>b.y).attr("width",b=>b.width).attr("height",b=>b.height).attr("fill",b=>b.fill).attr("stroke",b=>b.strokeFill).attr("stroke-width",b=>b.strokeWidth),s.showDataLabel){const b=s.showDataLabelOutsideBar;if(s.chartOrientation==="horizontal"){let w=function(I,z){const{data:F,label:A}=I;return z*A.length*C<=F.width-_};T(w,"fitsHorizontally");const C=.7,_=10,k=v.data.map((I,z)=>({data:I,label:o[z].toString()})).filter(I=>I.data.width>0&&I.data.height>0),S=k.map(I=>{const{data:z}=I;let F=z.height*.7;for(;!w(I,F)&&F>0;)F-=1;return F}),L=Math.floor(Math.min(...S)),$=T(I=>b?I.data.x+I.data.width+_:I.data.x+I.data.width-_,"determineLabelXPosition");x.selectAll("text").data(k).enter().append("text").attr("x",$).attr("y",I=>I.data.y+I.data.height/2).attr("text-anchor",b?"start":"end").attr("dominant-baseline","middle").attr("fill",a.dataLabelColor).attr("font-size",`${L}px`).text(I=>I.label)}else{let w=function($,I,z){const{data:F,label:A}=$,N=I*A.length*.7,M=F.x+F.width/2,D=M-N/2,O=M+N/2,B=D>=F.x&&O<=F.x+F.width,P=F.y+z+I<=F.y+F.height;return B&&P};T(w,"fitsInBar");const C=10,_=v.data.map(($,I)=>({data:$,label:o[I].toString()})).filter($=>$.data.width>0&&$.data.height>0),k=_.map($=>{const{data:I,label:z}=$;let F=I.width/(z.length*.7);for(;!w($,F,C)&&F>0;)F-=1;return F}),S=Math.floor(Math.min(...k)),L=T($=>b?$.data.y-C:$.data.y+C,"determineLabelYPosition");x.selectAll("text").data(_).enter().append("text").attr("x",$=>$.data.x+$.data.width/2).attr("y",L).attr("text-anchor","middle").attr("dominant-baseline",b?"auto":"hanging").attr("fill",a.dataLabelColor).attr("font-size",`${S}px`).text($=>$.label)}}break;case"text":x.selectAll("text").data(v.data).enter().append("text").attr("x",0).attr("y",0).attr("fill",b=>b.fill).attr("font-size",b=>b.fontSize).attr("dominant-baseline",b=>l(b.verticalPos)).attr("text-anchor",b=>u(b.horizontalPos)).attr("transform",b=>h(b)).text(b=>b.text);break;case"path":x.selectAll("path").data(v.data).enter().append("path").attr("d",b=>b.path).attr("fill",b=>b.fill?b.fill:"none").attr("stroke",b=>b.strokeFill).attr("stroke-width",b=>b.strokeWidth);break}}},"draw"),i1t={draw:n1t},a1t={parser:Hmt,db:r1t,renderer:i1t};const s1t=Object.freeze(Object.defineProperty({__proto__:null,diagram:a1t},Symbol.toStringTag,{value:"Module"}));var jz=(function(){var t=T(function(ke,_e,Y,he){for(Y=Y||{},he=ke.length;he--;Y[ke[he]]=_e);return Y},"o"),e=[1,3],r=[1,4],n=[1,5],i=[1,6],a=[5,6,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,77,89,90],s=[1,22],o=[2,7],l=[1,26],u=[1,27],h=[1,28],d=[1,29],f=[1,33],p=[1,34],g=[1,35],m=[1,36],y=[1,37],v=[1,38],x=[1,24],b=[1,31],w=[1,32],C=[1,30],_=[1,39],k=[1,40],S=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,77,89,90],L=[1,61],$=[89,90],I=[5,8,9,11,13,21,22,23,24,27,29,41,42,43,44,45,46,54,61,63,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],z=[27,29],F=[1,70],A=[1,71],R=[1,72],N=[1,73],M=[1,74],D=[1,75],O=[1,76],B=[1,83],P=[1,80],G=[1,84],V=[1,85],H=[1,86],W=[1,87],ie=[1,88],j=[1,89],ae=[1,90],J=[1,91],K=[1,92],Q=[5,8,9,11,13,21,22,23,24,27,41,42,43,44,45,46,54,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],re=[63,64],le=[1,101],fe=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,76,77,89,90],Ae=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],Se=[1,110],Ne=[1,106],ge=[1,107],ve=[1,108],ze=[1,109],xe=[1,111],Ke=[1,116],Ce=[1,117],Ve=[1,114],Qe=[1,115],nt={trace:T(function(){},"trace"),yy:{},symbols_:{error:2,start:3,directive:4,NEWLINE:5,RD:6,diagram:7,EOF:8,acc_title:9,acc_title_value:10,acc_descr:11,acc_descr_value:12,acc_descr_multiline_value:13,requirementDef:14,elementDef:15,relationshipDef:16,direction:17,styleStatement:18,classDefStatement:19,classStatement:20,direction_tb:21,direction_bt:22,direction_rl:23,direction_lr:24,requirementType:25,requirementName:26,STRUCT_START:27,requirementBody:28,STYLE_SEPARATOR:29,idList:30,ID:31,COLONSEP:32,id:33,TEXT:34,text:35,RISK:36,riskLevel:37,VERIFYMTHD:38,verifyType:39,STRUCT_STOP:40,REQUIREMENT:41,FUNCTIONAL_REQUIREMENT:42,INTERFACE_REQUIREMENT:43,PERFORMANCE_REQUIREMENT:44,PHYSICAL_REQUIREMENT:45,DESIGN_CONSTRAINT:46,LOW_RISK:47,MED_RISK:48,HIGH_RISK:49,VERIFY_ANALYSIS:50,VERIFY_DEMONSTRATION:51,VERIFY_INSPECTION:52,VERIFY_TEST:53,ELEMENT:54,elementName:55,elementBody:56,TYPE:57,type:58,DOCREF:59,ref:60,END_ARROW_L:61,relationship:62,LINE:63,END_ARROW_R:64,CONTAINS:65,COPIES:66,DERIVES:67,SATISFIES:68,VERIFIES:69,REFINES:70,TRACES:71,CLASSDEF:72,stylesOpt:73,CLASS:74,ALPHA:75,COMMA:76,STYLE:77,style:78,styleComponent:79,NUM:80,COLON:81,UNIT:82,SPACE:83,BRKT:84,PCT:85,MINUS:86,LABEL:87,SEMICOLON:88,unqString:89,qString:90,$accept:0,$end:1},terminals_:{2:"error",5:"NEWLINE",6:"RD",8:"EOF",9:"acc_title",10:"acc_title_value",11:"acc_descr",12:"acc_descr_value",13:"acc_descr_multiline_value",21:"direction_tb",22:"direction_bt",23:"direction_rl",24:"direction_lr",27:"STRUCT_START",29:"STYLE_SEPARATOR",31:"ID",32:"COLONSEP",34:"TEXT",36:"RISK",38:"VERIFYMTHD",40:"STRUCT_STOP",41:"REQUIREMENT",42:"FUNCTIONAL_REQUIREMENT",43:"INTERFACE_REQUIREMENT",44:"PERFORMANCE_REQUIREMENT",45:"PHYSICAL_REQUIREMENT",46:"DESIGN_CONSTRAINT",47:"LOW_RISK",48:"MED_RISK",49:"HIGH_RISK",50:"VERIFY_ANALYSIS",51:"VERIFY_DEMONSTRATION",52:"VERIFY_INSPECTION",53:"VERIFY_TEST",54:"ELEMENT",57:"TYPE",59:"DOCREF",61:"END_ARROW_L",63:"LINE",64:"END_ARROW_R",65:"CONTAINS",66:"COPIES",67:"DERIVES",68:"SATISFIES",69:"VERIFIES",70:"REFINES",71:"TRACES",72:"CLASSDEF",74:"CLASS",75:"ALPHA",76:"COMMA",77:"STYLE",80:"NUM",81:"COLON",82:"UNIT",83:"SPACE",84:"BRKT",85:"PCT",86:"MINUS",87:"LABEL",88:"SEMICOLON",89:"unqString",90:"qString"},productions_:[0,[3,3],[3,2],[3,4],[4,2],[4,2],[4,1],[7,0],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[17,1],[17,1],[17,1],[17,1],[14,5],[14,7],[28,5],[28,5],[28,5],[28,5],[28,2],[28,1],[25,1],[25,1],[25,1],[25,1],[25,1],[25,1],[37,1],[37,1],[37,1],[39,1],[39,1],[39,1],[39,1],[15,5],[15,7],[56,5],[56,5],[56,2],[56,1],[16,5],[16,5],[62,1],[62,1],[62,1],[62,1],[62,1],[62,1],[62,1],[19,3],[20,3],[20,3],[30,1],[30,3],[30,1],[30,3],[18,3],[73,1],[73,3],[78,1],[78,2],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[26,1],[26,1],[33,1],[33,1],[35,1],[35,1],[55,1],[55,1],[58,1],[58,1],[60,1],[60,1]],performAction:T(function(_e,Y,he,Z,pe,ne,Be){var Te=ne.length-1;switch(pe){case 4:this.$=ne[Te].trim(),Z.setAccTitle(this.$);break;case 5:case 6:this.$=ne[Te].trim(),Z.setAccDescription(this.$);break;case 7:this.$=[];break;case 17:Z.setDirection("TB");break;case 18:Z.setDirection("BT");break;case 19:Z.setDirection("RL");break;case 20:Z.setDirection("LR");break;case 21:Z.addRequirement(ne[Te-3],ne[Te-4]);break;case 22:Z.addRequirement(ne[Te-5],ne[Te-6]),Z.setClass([ne[Te-5]],ne[Te-3]);break;case 23:Z.setNewReqId(ne[Te-2]);break;case 24:Z.setNewReqText(ne[Te-2]);break;case 25:Z.setNewReqRisk(ne[Te-2]);break;case 26:Z.setNewReqVerifyMethod(ne[Te-2]);break;case 29:this.$=Z.RequirementType.REQUIREMENT;break;case 30:this.$=Z.RequirementType.FUNCTIONAL_REQUIREMENT;break;case 31:this.$=Z.RequirementType.INTERFACE_REQUIREMENT;break;case 32:this.$=Z.RequirementType.PERFORMANCE_REQUIREMENT;break;case 33:this.$=Z.RequirementType.PHYSICAL_REQUIREMENT;break;case 34:this.$=Z.RequirementType.DESIGN_CONSTRAINT;break;case 35:this.$=Z.RiskLevel.LOW_RISK;break;case 36:this.$=Z.RiskLevel.MED_RISK;break;case 37:this.$=Z.RiskLevel.HIGH_RISK;break;case 38:this.$=Z.VerifyType.VERIFY_ANALYSIS;break;case 39:this.$=Z.VerifyType.VERIFY_DEMONSTRATION;break;case 40:this.$=Z.VerifyType.VERIFY_INSPECTION;break;case 41:this.$=Z.VerifyType.VERIFY_TEST;break;case 42:Z.addElement(ne[Te-3]);break;case 43:Z.addElement(ne[Te-5]),Z.setClass([ne[Te-5]],ne[Te-3]);break;case 44:Z.setNewElementType(ne[Te-2]);break;case 45:Z.setNewElementDocRef(ne[Te-2]);break;case 48:Z.addRelationship(ne[Te-2],ne[Te],ne[Te-4]);break;case 49:Z.addRelationship(ne[Te-2],ne[Te-4],ne[Te]);break;case 50:this.$=Z.Relationships.CONTAINS;break;case 51:this.$=Z.Relationships.COPIES;break;case 52:this.$=Z.Relationships.DERIVES;break;case 53:this.$=Z.Relationships.SATISFIES;break;case 54:this.$=Z.Relationships.VERIFIES;break;case 55:this.$=Z.Relationships.REFINES;break;case 56:this.$=Z.Relationships.TRACES;break;case 57:this.$=ne[Te-2],Z.defineClass(ne[Te-1],ne[Te]);break;case 58:Z.setClass(ne[Te-1],ne[Te]);break;case 59:Z.setClass([ne[Te-2]],ne[Te]);break;case 60:case 62:this.$=[ne[Te]];break;case 61:case 63:this.$=ne[Te-2].concat([ne[Te]]);break;case 64:this.$=ne[Te-2],Z.setCssStyle(ne[Te-1],ne[Te]);break;case 65:this.$=[ne[Te]];break;case 66:ne[Te-2].push(ne[Te]),this.$=ne[Te-2];break;case 68:this.$=ne[Te-1]+ne[Te];break}},"anonymous"),table:[{3:1,4:2,6:e,9:r,11:n,13:i},{1:[3]},{3:8,4:2,5:[1,7],6:e,9:r,11:n,13:i},{5:[1,9]},{10:[1,10]},{12:[1,11]},t(a,[2,6]),{3:12,4:2,6:e,9:r,11:n,13:i},{1:[2,2]},{4:17,5:s,7:13,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:y,46:v,54:x,72:b,74:w,77:C,89:_,90:k},t(a,[2,4]),t(a,[2,5]),{1:[2,1]},{8:[1,41]},{4:17,5:s,7:42,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:y,46:v,54:x,72:b,74:w,77:C,89:_,90:k},{4:17,5:s,7:43,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:y,46:v,54:x,72:b,74:w,77:C,89:_,90:k},{4:17,5:s,7:44,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:y,46:v,54:x,72:b,74:w,77:C,89:_,90:k},{4:17,5:s,7:45,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:y,46:v,54:x,72:b,74:w,77:C,89:_,90:k},{4:17,5:s,7:46,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:y,46:v,54:x,72:b,74:w,77:C,89:_,90:k},{4:17,5:s,7:47,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:y,46:v,54:x,72:b,74:w,77:C,89:_,90:k},{4:17,5:s,7:48,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:y,46:v,54:x,72:b,74:w,77:C,89:_,90:k},{4:17,5:s,7:49,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:y,46:v,54:x,72:b,74:w,77:C,89:_,90:k},{4:17,5:s,7:50,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:y,46:v,54:x,72:b,74:w,77:C,89:_,90:k},{26:51,89:[1,52],90:[1,53]},{55:54,89:[1,55],90:[1,56]},{29:[1,59],61:[1,57],63:[1,58]},t(S,[2,17]),t(S,[2,18]),t(S,[2,19]),t(S,[2,20]),{30:60,33:62,75:L,89:_,90:k},{30:63,33:62,75:L,89:_,90:k},{30:64,33:62,75:L,89:_,90:k},t($,[2,29]),t($,[2,30]),t($,[2,31]),t($,[2,32]),t($,[2,33]),t($,[2,34]),t(I,[2,81]),t(I,[2,82]),{1:[2,3]},{8:[2,8]},{8:[2,9]},{8:[2,10]},{8:[2,11]},{8:[2,12]},{8:[2,13]},{8:[2,14]},{8:[2,15]},{8:[2,16]},{27:[1,65],29:[1,66]},t(z,[2,79]),t(z,[2,80]),{27:[1,67],29:[1,68]},t(z,[2,85]),t(z,[2,86]),{62:69,65:F,66:A,67:R,68:N,69:M,70:D,71:O},{62:77,65:F,66:A,67:R,68:N,69:M,70:D,71:O},{30:78,33:62,75:L,89:_,90:k},{73:79,75:B,76:P,78:81,79:82,80:G,81:V,82:H,83:W,84:ie,85:j,86:ae,87:J,88:K},t(Q,[2,60]),t(Q,[2,62]),{73:93,75:B,76:P,78:81,79:82,80:G,81:V,82:H,83:W,84:ie,85:j,86:ae,87:J,88:K},{30:94,33:62,75:L,76:P,89:_,90:k},{5:[1,95]},{30:96,33:62,75:L,89:_,90:k},{5:[1,97]},{30:98,33:62,75:L,89:_,90:k},{63:[1,99]},t(re,[2,50]),t(re,[2,51]),t(re,[2,52]),t(re,[2,53]),t(re,[2,54]),t(re,[2,55]),t(re,[2,56]),{64:[1,100]},t(S,[2,59],{76:P}),t(S,[2,64],{76:le}),{33:103,75:[1,102],89:_,90:k},t(fe,[2,65],{79:104,75:B,80:G,81:V,82:H,83:W,84:ie,85:j,86:ae,87:J,88:K}),t(Ae,[2,67]),t(Ae,[2,69]),t(Ae,[2,70]),t(Ae,[2,71]),t(Ae,[2,72]),t(Ae,[2,73]),t(Ae,[2,74]),t(Ae,[2,75]),t(Ae,[2,76]),t(Ae,[2,77]),t(Ae,[2,78]),t(S,[2,57],{76:le}),t(S,[2,58],{76:P}),{5:Se,28:105,31:Ne,34:ge,36:ve,38:ze,40:xe},{27:[1,112],76:P},{5:Ke,40:Ce,56:113,57:Ve,59:Qe},{27:[1,118],76:P},{33:119,89:_,90:k},{33:120,89:_,90:k},{75:B,78:121,79:82,80:G,81:V,82:H,83:W,84:ie,85:j,86:ae,87:J,88:K},t(Q,[2,61]),t(Q,[2,63]),t(Ae,[2,68]),t(S,[2,21]),{32:[1,122]},{32:[1,123]},{32:[1,124]},{32:[1,125]},{5:Se,28:126,31:Ne,34:ge,36:ve,38:ze,40:xe},t(S,[2,28]),{5:[1,127]},t(S,[2,42]),{32:[1,128]},{32:[1,129]},{5:Ke,40:Ce,56:130,57:Ve,59:Qe},t(S,[2,47]),{5:[1,131]},t(S,[2,48]),t(S,[2,49]),t(fe,[2,66],{79:104,75:B,80:G,81:V,82:H,83:W,84:ie,85:j,86:ae,87:J,88:K}),{33:132,89:_,90:k},{35:133,89:[1,134],90:[1,135]},{37:136,47:[1,137],48:[1,138],49:[1,139]},{39:140,50:[1,141],51:[1,142],52:[1,143],53:[1,144]},t(S,[2,27]),{5:Se,28:145,31:Ne,34:ge,36:ve,38:ze,40:xe},{58:146,89:[1,147],90:[1,148]},{60:149,89:[1,150],90:[1,151]},t(S,[2,46]),{5:Ke,40:Ce,56:152,57:Ve,59:Qe},{5:[1,153]},{5:[1,154]},{5:[2,83]},{5:[2,84]},{5:[1,155]},{5:[2,35]},{5:[2,36]},{5:[2,37]},{5:[1,156]},{5:[2,38]},{5:[2,39]},{5:[2,40]},{5:[2,41]},t(S,[2,22]),{5:[1,157]},{5:[2,87]},{5:[2,88]},{5:[1,158]},{5:[2,89]},{5:[2,90]},t(S,[2,43]),{5:Se,28:159,31:Ne,34:ge,36:ve,38:ze,40:xe},{5:Se,28:160,31:Ne,34:ge,36:ve,38:ze,40:xe},{5:Se,28:161,31:Ne,34:ge,36:ve,38:ze,40:xe},{5:Se,28:162,31:Ne,34:ge,36:ve,38:ze,40:xe},{5:Ke,40:Ce,56:163,57:Ve,59:Qe},{5:Ke,40:Ce,56:164,57:Ve,59:Qe},t(S,[2,23]),t(S,[2,24]),t(S,[2,25]),t(S,[2,26]),t(S,[2,44]),t(S,[2,45])],defaultActions:{8:[2,2],12:[2,1],41:[2,3],42:[2,8],43:[2,9],44:[2,10],45:[2,11],46:[2,12],47:[2,13],48:[2,14],49:[2,15],50:[2,16],134:[2,83],135:[2,84],137:[2,35],138:[2,36],139:[2,37],141:[2,38],142:[2,39],143:[2,40],144:[2,41],147:[2,87],148:[2,88],150:[2,89],151:[2,90]},parseError:T(function(_e,Y){if(Y.recoverable)this.trace(_e);else{var he=new Error(_e);throw he.hash=Y,he}},"parseError"),parse:T(function(_e){var Y=this,he=[0],Z=[],pe=[null],ne=[],Be=this.table,Te="",Ue=0,De=0,qe=2,Le=1,Xe=ne.slice.call(arguments,1),Ie=Object.create(this.lexer),it={yy:{}};for(var we in this.yy)Object.prototype.hasOwnProperty.call(this.yy,we)&&(it.yy[we]=this.yy[we]);Ie.setInput(_e,it.yy),it.yy.lexer=Ie,it.yy.parser=this,typeof Ie.yylloc>"u"&&(Ie.yylloc={});var ct=Ie.yylloc;ne.push(ct);var be=Ie.options&&Ie.options.ranges;typeof it.yy.parseError=="function"?this.parseError=it.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function _t(ye){he.length=he.length-2*ye,pe.length=pe.length-ye,ne.length=ne.length-ye}T(_t,"popStack");function bt(){var ye;return ye=Z.pop()||Ie.lex()||Le,typeof ye!="number"&&(ye instanceof Array&&(Z=ye,ye=Z.pop()),ye=Y.symbols_[ye]||ye),ye}T(bt,"lex");for(var lt,Mt,Tt,dt,oe={},Rt,ft,ht,kt;;){if(Mt=he[he.length-1],this.defaultActions[Mt]?Tt=this.defaultActions[Mt]:((lt===null||typeof lt>"u")&&(lt=bt()),Tt=Be[Mt]&&Be[Mt][lt]),typeof Tt>"u"||!Tt.length||!Tt[0]){var qr="";kt=[];for(Rt in Be[Mt])this.terminals_[Rt]&&Rt>qe&&kt.push("'"+this.terminals_[Rt]+"'");Ie.showPosition?qr="Parse error on line "+(Ue+1)+`: `+Ie.showPosition()+` -Expecting `+wt.join(", ")+", got '"+(this.terminals_[ot]||ot)+"'":Mr="Parse error on line "+(Ue+1)+": Unexpected "+(ot==Le?"end of input":"'"+(this.terminals_[ot]||ot)+"'"),this.parseError(Mr,{text:Ie.match,token:this.terminals_[ot]||ot,line:Ie.yylineno,loc:lt,expected:wt})}if(xt[0]instanceof Array&&xt.length>1)throw new Error("Parse Error: multiple actions possible at state: "+It+", token: "+ot);switch(xt[0]){case 1:he.push(ot),pe.push(Ie.yytext),re.push(Ie.yylloc),he.push(xt[1]),ot=null,De=Ie.yyleng,xe=Ie.yytext,Ue=Ie.yylineno,lt=Ie.yylloc;break;case 2:if(dt=this.productions_[xt[1]][1],oe.$=pe[pe.length-dt],oe._$={first_line:re[re.length-(dt||1)].first_line,last_line:re[re.length-1].last_line,first_column:re[re.length-(dt||1)].first_column,last_column:re[re.length-1].last_column},be&&(oe._$.range=[re[re.length-(dt||1)].range[0],re[re.length-1].range[1]]),ht=this.performAction.apply(oe,[xe,De,Ue,it.yy,xt[1],pe,re].concat(Xe)),typeof ht<"u")return ht;dt&&(he=he.slice(0,-1*dt*2),pe=pe.slice(0,-1*dt),re=re.slice(0,-1*dt)),he.push(this.productions_[xt[1]][0]),pe.push(oe.$),re.push(oe._$),ut=Be[he[he.length-2]][he[he.length-1]],he.push(ut);break;case 3:return!0}}return!0},"parse")},tt=(function(){var Ce={EOF:1,parseError:x(function(H,he){if(this.yy.parser)this.yy.parser.parseError(H,he);else throw new Error(H)},"parseError"),setInput:x(function(Se,H){return this.yy=H||this.yy||{},this._input=Se,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:x(function(){var Se=this._input[0];this.yytext+=Se,this.yyleng++,this.offset++,this.match+=Se,this.matched+=Se;var H=Se.match(/(?:\r\n?|\n).*/g);return H?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),Se},"input"),unput:x(function(Se){var H=Se.length,he=Se.split(/(?:\r\n?|\n)/g);this._input=Se+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-H),this.offset-=H;var j=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),he.length-1&&(this.yylineno-=he.length-1);var pe=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:he?(he.length===j.length?this.yylloc.first_column:0)+j[j.length-he.length].length-he[0].length:this.yylloc.first_column-H},this.options.ranges&&(this.yylloc.range=[pe[0],pe[0]+this.yyleng-H]),this.yyleng=this.yytext.length,this},"unput"),more:x(function(){return this._more=!0,this},"more"),reject:x(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). -`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:x(function(Se){this.unput(this.match.slice(Se))},"less"),pastInput:x(function(){var Se=this.matched.substr(0,this.matched.length-this.match.length);return(Se.length>20?"...":"")+Se.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:x(function(){var Se=this.match;return Se.length<20&&(Se+=this._input.substr(0,20-Se.length)),(Se.substr(0,20)+(Se.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:x(function(){var Se=this.pastInput(),H=new Array(Se.length+1).join("-");return Se+this.upcomingInput()+` -`+H+"^"},"showPosition"),test_match:x(function(Se,H){var he,j,pe;if(this.options.backtrack_lexer&&(pe={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&&(pe.yylloc.range=this.yylloc.range.slice(0))),j=Se[0].match(/(?:\r\n?|\n).*/g),j&&(this.yylineno+=j.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:j?j[j.length-1].length-j[j.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+Se[0].length},this.yytext+=Se[0],this.match+=Se[0],this.matches=Se,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(Se[0].length),this.matched+=Se[0],he=this.performAction.call(this,this.yy,this,H,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),he)return he;if(this._backtrack){for(var re in pe)this[re]=pe[re];return!1}return!1},"test_match"),next:x(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var Se,H,he,j;this._more||(this.yytext="",this.match="");for(var pe=this._currentRules(),re=0;reH[0].length)){if(H=he,j=re,this.options.backtrack_lexer){if(Se=this.test_match(he,pe[re]),Se!==!1)return Se;if(this._backtrack){H=!1;continue}else return!1}else if(!this.options.flex)break}return H?(Se=this.test_match(H,pe[j]),Se!==!1?Se:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var H=this.next();return H||this.lex()},"lex"),begin:x(function(H){this.conditionStack.push(H)},"begin"),popState:x(function(){var H=this.conditionStack.length-1;return H>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(H){return H=this.conditionStack.length-1-Math.abs(H||0),H>=0?this.conditionStack[H]:"INITIAL"},"topState"),pushState:x(function(H){this.begin(H)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:x(function(H,he,j,pe){switch(j){case 0:return"title";case 1:return this.begin("acc_title"),9;case 2:return this.popState(),"acc_title_value";case 3:return this.begin("acc_descr"),11;case 4:return this.popState(),"acc_descr_value";case 5:this.begin("acc_descr_multiline");break;case 6:this.popState();break;case 7:return"acc_descr_multiline_value";case 8:return 21;case 9:return 22;case 10:return 23;case 11:return 24;case 12:return 5;case 13:break;case 14:break;case 15:break;case 16:return 8;case 17:return 6;case 18:return 27;case 19:return 40;case 20:return 29;case 21:return 32;case 22:return 31;case 23:return 34;case 24:return 36;case 25:return 38;case 26:return 41;case 27:return 42;case 28:return 43;case 29:return 44;case 30:return 45;case 31:return 46;case 32:return 47;case 33:return 48;case 34:return 49;case 35:return 50;case 36:return 51;case 37:return 52;case 38:return 53;case 39:return 54;case 40:return 65;case 41:return 66;case 42:return 67;case 43:return 68;case 44:return 69;case 45:return 70;case 46:return 71;case 47:return 57;case 48:return 59;case 49:return this.begin("style"),77;case 50:return 75;case 51:return 81;case 52:return 88;case 53:return"PERCENT";case 54:return 86;case 55:return 84;case 56:break;case 57:this.begin("string");break;case 58:this.popState();break;case 59:return this.begin("style"),72;case 60:return this.begin("style"),74;case 61:return 61;case 62:return 64;case 63:return 63;case 64:this.begin("string");break;case 65:this.popState();break;case 66:return"qString";case 67:return he.yytext=he.yytext.trim(),89;case 68:return 75;case 69:return 80;case 70:return 76}},"anonymous"),rules:[/^(?:title\s[^#\n;]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:(\r?\n)+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:%[^\n]*)/i,/^(?:$)/i,/^(?:requirementDiagram\b)/i,/^(?:\{)/i,/^(?:\})/i,/^(?::{3})/i,/^(?::)/i,/^(?:id\b)/i,/^(?:text\b)/i,/^(?:risk\b)/i,/^(?:verifyMethod\b)/i,/^(?:requirement\b)/i,/^(?:functionalRequirement\b)/i,/^(?:interfaceRequirement\b)/i,/^(?:performanceRequirement\b)/i,/^(?:physicalRequirement\b)/i,/^(?:designConstraint\b)/i,/^(?:low\b)/i,/^(?:medium\b)/i,/^(?:high\b)/i,/^(?:analysis\b)/i,/^(?:demonstration\b)/i,/^(?:inspection\b)/i,/^(?:test\b)/i,/^(?:element\b)/i,/^(?:contains\b)/i,/^(?:copies\b)/i,/^(?:derives\b)/i,/^(?:satisfies\b)/i,/^(?:verifies\b)/i,/^(?:refines\b)/i,/^(?:traces\b)/i,/^(?:type\b)/i,/^(?:docref\b)/i,/^(?:style\b)/i,/^(?:\w+)/i,/^(?::)/i,/^(?:;)/i,/^(?:%)/i,/^(?:-)/i,/^(?:#)/i,/^(?: )/i,/^(?:["])/i,/^(?:\n)/i,/^(?:classDef\b)/i,/^(?:class\b)/i,/^(?:<-)/i,/^(?:->)/i,/^(?:-)/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[\w][^:,\r\n\{\<\>\-\=]*)/i,/^(?:\w+)/i,/^(?:[0-9]+)/i,/^(?:,)/i],conditions:{acc_descr_multiline:{rules:[6,7,68,69,70],inclusive:!1},acc_descr:{rules:[4,68,69,70],inclusive:!1},acc_title:{rules:[2,68,69,70],inclusive:!1},style:{rules:[50,51,52,53,54,55,56,57,58,68,69,70],inclusive:!1},unqString:{rules:[68,69,70],inclusive:!1},token:{rules:[68,69,70],inclusive:!1},string:{rules:[65,66,68,69,70],inclusive:!1},INITIAL:{rules:[0,1,3,5,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,59,60,61,62,63,64,67,68,69,70],inclusive:!0}}};return Ce})();nt.lexer=tt;function je(){this.yy={}}return x(je,"Parser"),je.prototype=nt,nt.Parser=je,new je})();x$.parser=x$;var Tlt=x$,wlt=(Fv=class{constructor(){this.relations=[],this.latestRequirement=this.getInitialRequirement(),this.requirements=new Map,this.latestElement=this.getInitialElement(),this.elements=new Map,this.classes=new Map,this.direction="TB",this.RequirementType={REQUIREMENT:"Requirement",FUNCTIONAL_REQUIREMENT:"Functional Requirement",INTERFACE_REQUIREMENT:"Interface Requirement",PERFORMANCE_REQUIREMENT:"Performance Requirement",PHYSICAL_REQUIREMENT:"Physical Requirement",DESIGN_CONSTRAINT:"Design Constraint"},this.RiskLevel={LOW_RISK:"Low",MED_RISK:"Medium",HIGH_RISK:"High"},this.VerifyType={VERIFY_ANALYSIS:"Analysis",VERIFY_DEMONSTRATION:"Demonstration",VERIFY_INSPECTION:"Inspection",VERIFY_TEST:"Test"},this.Relationships={CONTAINS:"contains",COPIES:"copies",DERIVES:"derives",SATISFIES:"satisfies",VERIFIES:"verifies",REFINES:"refines",TRACES:"traces"},this.setAccTitle=Dn,this.getAccTitle=Fn,this.setAccDescription=zn,this.getAccDescription=Gn,this.setDiagramTitle=qn,this.getDiagramTitle=Mn,this.getConfig=x(()=>Pe().requirement,"getConfig"),this.clear(),this.setDirection=this.setDirection.bind(this),this.addRequirement=this.addRequirement.bind(this),this.setNewReqId=this.setNewReqId.bind(this),this.setNewReqRisk=this.setNewReqRisk.bind(this),this.setNewReqText=this.setNewReqText.bind(this),this.setNewReqVerifyMethod=this.setNewReqVerifyMethod.bind(this),this.addElement=this.addElement.bind(this),this.setNewElementType=this.setNewElementType.bind(this),this.setNewElementDocRef=this.setNewElementDocRef.bind(this),this.addRelationship=this.addRelationship.bind(this),this.setCssStyle=this.setCssStyle.bind(this),this.setClass=this.setClass.bind(this),this.defineClass=this.defineClass.bind(this),this.setAccTitle=this.setAccTitle.bind(this),this.setAccDescription=this.setAccDescription.bind(this)}getDirection(){return this.direction}setDirection(e){this.direction=e}resetLatestRequirement(){this.latestRequirement=this.getInitialRequirement()}resetLatestElement(){this.latestElement=this.getInitialElement()}getInitialRequirement(){return{requirementId:"",text:"",risk:"",verifyMethod:"",name:"",type:"",cssStyles:[],classes:["default"]}}getInitialElement(){return{name:"",type:"",docRef:"",cssStyles:[],classes:["default"]}}addRequirement(e,r){return this.requirements.has(e)||this.requirements.set(e,{name:e,type:r,requirementId:this.latestRequirement.requirementId,text:this.latestRequirement.text,risk:this.latestRequirement.risk,verifyMethod:this.latestRequirement.verifyMethod,cssStyles:[],classes:["default"]}),this.resetLatestRequirement(),this.requirements.get(e)}getRequirements(){return this.requirements}setNewReqId(e){this.latestRequirement!==void 0&&(this.latestRequirement.requirementId=e)}setNewReqText(e){this.latestRequirement!==void 0&&(this.latestRequirement.text=e)}setNewReqRisk(e){this.latestRequirement!==void 0&&(this.latestRequirement.risk=e)}setNewReqVerifyMethod(e){this.latestRequirement!==void 0&&(this.latestRequirement.verifyMethod=e)}addElement(e){return this.elements.has(e)||(this.elements.set(e,{name:e,type:this.latestElement.type,docRef:this.latestElement.docRef,cssStyles:[],classes:["default"]}),ae.info("Added new element: ",e)),this.resetLatestElement(),this.elements.get(e)}getElements(){return this.elements}setNewElementType(e){this.latestElement!==void 0&&(this.latestElement.type=e)}setNewElementDocRef(e){this.latestElement!==void 0&&(this.latestElement.docRef=e)}addRelationship(e,r,n){this.relations.push({type:e,src:r,dst:n})}getRelationships(){return this.relations}clear(){this.relations=[],this.resetLatestRequirement(),this.requirements=new Map,this.resetLatestElement(),this.elements=new Map,this.classes=new Map,In()}setCssStyle(e,r){for(const n of e){const i=this.requirements.get(n)??this.elements.get(n);if(!r||!i)return;for(const a of r)a.includes(",")?i.cssStyles.push(...a.split(",")):i.cssStyles.push(a)}}setClass(e,r){var n;for(const i of e){const a=this.requirements.get(i)??this.elements.get(i);if(a)for(const s of r){a.classes.push(s);const o=(n=this.classes.get(s))==null?void 0:n.styles;o&&a.cssStyles.push(...o)}}}defineClass(e,r){for(const n of e){let i=this.classes.get(n);i===void 0&&(i={id:n,styles:[],textStyles:[]},this.classes.set(n,i)),r&&r.forEach(function(a){if(/color/.exec(a)){const s=a.replace("fill","bgFill");i.textStyles.push(s)}i.styles.push(a)}),this.requirements.forEach(a=>{a.classes.includes(n)&&a.cssStyles.push(...r.flatMap(s=>s.split(",")))}),this.elements.forEach(a=>{a.classes.includes(n)&&a.cssStyles.push(...r.flatMap(s=>s.split(",")))})}}getClasses(){return this.classes}getData(){var i,a,s,o;const e=Pe(),r=[],n=[];for(const l of this.requirements.values()){const u=l;u.id=l.name,u.cssStyles=l.cssStyles,u.cssClasses=l.classes.join(" "),u.shape="requirementBox",u.look=e.look,u.colorIndex=r.length,r.push(u)}for(const l of this.elements.values()){const u=l;u.shape="requirementBox",u.look=e.look,u.id=l.name,u.cssStyles=l.cssStyles,u.cssClasses=l.classes.join(" "),u.colorIndex=r.length,r.push(u)}for(const l of this.relations){let u=0;const h=l.type===this.Relationships.CONTAINS,d={id:`${l.src}-${l.dst}-${u}`,start:((i=this.requirements.get(l.src))==null?void 0:i.name)??((a=this.elements.get(l.src))==null?void 0:a.name),end:((s=this.requirements.get(l.dst))==null?void 0:s.name)??((o=this.elements.get(l.dst))==null?void 0:o.name),label:`<<${l.type}>>`,classes:"relationshipLine",style:["fill:none",h?"":"stroke-dasharray: 10,7"],labelpos:"c",thickness:"normal",type:"normal",pattern:h?"normal":"dashed",arrowTypeStart:h?"requirement_contains":"",arrowTypeEnd:h?"":"requirement_arrow",look:e.look,labelType:"markdown"};n.push(d),u++}return{nodes:r,edges:n,other:{},config:e,direction:this.getDirection()}}},x(Fv,"RequirementDB"),Fv),Clt=x(t=>{const e=lr(),{themeVariables:r,look:n}=e,{bkgColorArray:i,borderColorArray:a}=r;if(!(a!=null&&a.length))return"";let s="";for(let o=0;o1)throw new Error("Parse Error: multiple actions possible at state: "+Mt+", token: "+lt);switch(Tt[0]){case 1:he.push(lt),pe.push(Ie.yytext),ne.push(Ie.yylloc),he.push(Tt[1]),lt=null,De=Ie.yyleng,Te=Ie.yytext,Ue=Ie.yylineno,ct=Ie.yylloc;break;case 2:if(ft=this.productions_[Tt[1]][1],oe.$=pe[pe.length-ft],oe._$={first_line:ne[ne.length-(ft||1)].first_line,last_line:ne[ne.length-1].last_line,first_column:ne[ne.length-(ft||1)].first_column,last_column:ne[ne.length-1].last_column},be&&(oe._$.range=[ne[ne.length-(ft||1)].range[0],ne[ne.length-1].range[1]]),dt=this.performAction.apply(oe,[Te,De,Ue,it.yy,Tt[1],pe,ne].concat(Xe)),typeof dt<"u")return dt;ft&&(he=he.slice(0,-1*ft*2),pe=pe.slice(0,-1*ft),ne=ne.slice(0,-1*ft)),he.push(this.productions_[Tt[1]][0]),pe.push(oe.$),ne.push(oe._$),ht=Be[he[he.length-2]][he[he.length-1]],he.push(ht);break;case 3:return!0}}return!0},"parse")},tt=(function(){var ke={EOF:1,parseError:T(function(Y,he){if(this.yy.parser)this.yy.parser.parseError(Y,he);else throw new Error(Y)},"parseError"),setInput:T(function(_e,Y){return this.yy=Y||this.yy||{},this._input=_e,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:T(function(){var _e=this._input[0];this.yytext+=_e,this.yyleng++,this.offset++,this.match+=_e,this.matched+=_e;var Y=_e.match(/(?:\r\n?|\n).*/g);return Y?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),_e},"input"),unput:T(function(_e){var Y=_e.length,he=_e.split(/(?:\r\n?|\n)/g);this._input=_e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-Y),this.offset-=Y;var Z=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),he.length-1&&(this.yylineno-=he.length-1);var pe=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:he?(he.length===Z.length?this.yylloc.first_column:0)+Z[Z.length-he.length].length-he[0].length:this.yylloc.first_column-Y},this.options.ranges&&(this.yylloc.range=[pe[0],pe[0]+this.yyleng-Y]),this.yyleng=this.yytext.length,this},"unput"),more:T(function(){return this._more=!0,this},"more"),reject:T(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). +`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:T(function(_e){this.unput(this.match.slice(_e))},"less"),pastInput:T(function(){var _e=this.matched.substr(0,this.matched.length-this.match.length);return(_e.length>20?"...":"")+_e.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:T(function(){var _e=this.match;return _e.length<20&&(_e+=this._input.substr(0,20-_e.length)),(_e.substr(0,20)+(_e.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:T(function(){var _e=this.pastInput(),Y=new Array(_e.length+1).join("-");return _e+this.upcomingInput()+` +`+Y+"^"},"showPosition"),test_match:T(function(_e,Y){var he,Z,pe;if(this.options.backtrack_lexer&&(pe={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&&(pe.yylloc.range=this.yylloc.range.slice(0))),Z=_e[0].match(/(?:\r\n?|\n).*/g),Z&&(this.yylineno+=Z.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:Z?Z[Z.length-1].length-Z[Z.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+_e[0].length},this.yytext+=_e[0],this.match+=_e[0],this.matches=_e,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(_e[0].length),this.matched+=_e[0],he=this.performAction.call(this,this.yy,this,Y,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),he)return he;if(this._backtrack){for(var ne in pe)this[ne]=pe[ne];return!1}return!1},"test_match"),next:T(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var _e,Y,he,Z;this._more||(this.yytext="",this.match="");for(var pe=this._currentRules(),ne=0;neY[0].length)){if(Y=he,Z=ne,this.options.backtrack_lexer){if(_e=this.test_match(he,pe[ne]),_e!==!1)return _e;if(this._backtrack){Y=!1;continue}else return!1}else if(!this.options.flex)break}return Y?(_e=this.test_match(Y,pe[Z]),_e!==!1?_e:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:T(function(){var Y=this.next();return Y||this.lex()},"lex"),begin:T(function(Y){this.conditionStack.push(Y)},"begin"),popState:T(function(){var Y=this.conditionStack.length-1;return Y>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:T(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:T(function(Y){return Y=this.conditionStack.length-1-Math.abs(Y||0),Y>=0?this.conditionStack[Y]:"INITIAL"},"topState"),pushState:T(function(Y){this.begin(Y)},"pushState"),stateStackSize:T(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:T(function(Y,he,Z,pe){switch(Z){case 0:return"title";case 1:return this.begin("acc_title"),9;case 2:return this.popState(),"acc_title_value";case 3:return this.begin("acc_descr"),11;case 4:return this.popState(),"acc_descr_value";case 5:this.begin("acc_descr_multiline");break;case 6:this.popState();break;case 7:return"acc_descr_multiline_value";case 8:return 21;case 9:return 22;case 10:return 23;case 11:return 24;case 12:return 5;case 13:break;case 14:break;case 15:break;case 16:return 8;case 17:return 6;case 18:return 27;case 19:return 40;case 20:return 29;case 21:return 32;case 22:return 31;case 23:return 34;case 24:return 36;case 25:return 38;case 26:return 41;case 27:return 42;case 28:return 43;case 29:return 44;case 30:return 45;case 31:return 46;case 32:return 47;case 33:return 48;case 34:return 49;case 35:return 50;case 36:return 51;case 37:return 52;case 38:return 53;case 39:return 54;case 40:return 65;case 41:return 66;case 42:return 67;case 43:return 68;case 44:return 69;case 45:return 70;case 46:return 71;case 47:return 57;case 48:return 59;case 49:return this.begin("style"),77;case 50:return 75;case 51:return 81;case 52:return 88;case 53:return"PERCENT";case 54:return 86;case 55:return 84;case 56:break;case 57:this.begin("string");break;case 58:this.popState();break;case 59:return this.begin("style"),72;case 60:return this.begin("style"),74;case 61:return 61;case 62:return 64;case 63:return 63;case 64:this.begin("string");break;case 65:this.popState();break;case 66:return"qString";case 67:return he.yytext=he.yytext.trim(),89;case 68:return 75;case 69:return 80;case 70:return 76}},"anonymous"),rules:[/^(?:title\s[^#\n;]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:(\r?\n)+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:%[^\n]*)/i,/^(?:$)/i,/^(?:requirementDiagram\b)/i,/^(?:\{)/i,/^(?:\})/i,/^(?::{3})/i,/^(?::)/i,/^(?:id\b)/i,/^(?:text\b)/i,/^(?:risk\b)/i,/^(?:verifyMethod\b)/i,/^(?:requirement\b)/i,/^(?:functionalRequirement\b)/i,/^(?:interfaceRequirement\b)/i,/^(?:performanceRequirement\b)/i,/^(?:physicalRequirement\b)/i,/^(?:designConstraint\b)/i,/^(?:low\b)/i,/^(?:medium\b)/i,/^(?:high\b)/i,/^(?:analysis\b)/i,/^(?:demonstration\b)/i,/^(?:inspection\b)/i,/^(?:test\b)/i,/^(?:element\b)/i,/^(?:contains\b)/i,/^(?:copies\b)/i,/^(?:derives\b)/i,/^(?:satisfies\b)/i,/^(?:verifies\b)/i,/^(?:refines\b)/i,/^(?:traces\b)/i,/^(?:type\b)/i,/^(?:docref\b)/i,/^(?:style\b)/i,/^(?:\w+)/i,/^(?::)/i,/^(?:;)/i,/^(?:%)/i,/^(?:-)/i,/^(?:#)/i,/^(?: )/i,/^(?:["])/i,/^(?:\n)/i,/^(?:classDef\b)/i,/^(?:class\b)/i,/^(?:<-)/i,/^(?:->)/i,/^(?:-)/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[\w][^:,\r\n\{\<\>\-\=]*)/i,/^(?:\w+)/i,/^(?:[0-9]+)/i,/^(?:,)/i],conditions:{acc_descr_multiline:{rules:[6,7,68,69,70],inclusive:!1},acc_descr:{rules:[4,68,69,70],inclusive:!1},acc_title:{rules:[2,68,69,70],inclusive:!1},style:{rules:[50,51,52,53,54,55,56,57,58,68,69,70],inclusive:!1},unqString:{rules:[68,69,70],inclusive:!1},token:{rules:[68,69,70],inclusive:!1},string:{rules:[65,66,68,69,70],inclusive:!1},INITIAL:{rules:[0,1,3,5,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,59,60,61,62,63,64,67,68,69,70],inclusive:!0}}};return ke})();nt.lexer=tt;function Ze(){this.yy={}}return T(Ze,"Parser"),Ze.prototype=nt,nt.Parser=Ze,new Ze})();jz.parser=jz;var o1t=jz,l1t=(vb=class{constructor(){this.relations=[],this.latestRequirement=this.getInitialRequirement(),this.requirements=new Map,this.latestElement=this.getInitialElement(),this.elements=new Map,this.classes=new Map,this.direction="TB",this.RequirementType={REQUIREMENT:"Requirement",FUNCTIONAL_REQUIREMENT:"Functional Requirement",INTERFACE_REQUIREMENT:"Interface Requirement",PERFORMANCE_REQUIREMENT:"Performance Requirement",PHYSICAL_REQUIREMENT:"Physical Requirement",DESIGN_CONSTRAINT:"Design Constraint"},this.RiskLevel={LOW_RISK:"Low",MED_RISK:"Medium",HIGH_RISK:"High"},this.VerifyType={VERIFY_ANALYSIS:"Analysis",VERIFY_DEMONSTRATION:"Demonstration",VERIFY_INSPECTION:"Inspection",VERIFY_TEST:"Test"},this.Relationships={CONTAINS:"contains",COPIES:"copies",DERIVES:"derives",SATISFIES:"satisfies",VERIFIES:"verifies",REFINES:"refines",TRACES:"traces"},this.setAccTitle=Yn,this.getAccTitle=ii,this.setAccDescription=ai,this.getAccDescription=si,this.setDiagramTitle=oi,this.getDiagramTitle=Xn,this.getConfig=T(()=>Pe().requirement,"getConfig"),this.clear(),this.setDirection=this.setDirection.bind(this),this.addRequirement=this.addRequirement.bind(this),this.setNewReqId=this.setNewReqId.bind(this),this.setNewReqRisk=this.setNewReqRisk.bind(this),this.setNewReqText=this.setNewReqText.bind(this),this.setNewReqVerifyMethod=this.setNewReqVerifyMethod.bind(this),this.addElement=this.addElement.bind(this),this.setNewElementType=this.setNewElementType.bind(this),this.setNewElementDocRef=this.setNewElementDocRef.bind(this),this.addRelationship=this.addRelationship.bind(this),this.setCssStyle=this.setCssStyle.bind(this),this.setClass=this.setClass.bind(this),this.defineClass=this.defineClass.bind(this),this.setAccTitle=this.setAccTitle.bind(this),this.setAccDescription=this.setAccDescription.bind(this)}getDirection(){return this.direction}setDirection(e){this.direction=e}resetLatestRequirement(){this.latestRequirement=this.getInitialRequirement()}resetLatestElement(){this.latestElement=this.getInitialElement()}getInitialRequirement(){return{requirementId:"",text:"",risk:"",verifyMethod:"",name:"",type:"",cssStyles:[],classes:["default"]}}getInitialElement(){return{name:"",type:"",docRef:"",cssStyles:[],classes:["default"]}}addRequirement(e,r){return this.requirements.has(e)||this.requirements.set(e,{name:e,type:r,requirementId:this.latestRequirement.requirementId,text:this.latestRequirement.text,risk:this.latestRequirement.risk,verifyMethod:this.latestRequirement.verifyMethod,cssStyles:[],classes:["default"]}),this.resetLatestRequirement(),this.requirements.get(e)}getRequirements(){return this.requirements}setNewReqId(e){this.latestRequirement!==void 0&&(this.latestRequirement.requirementId=e)}setNewReqText(e){this.latestRequirement!==void 0&&(this.latestRequirement.text=e)}setNewReqRisk(e){this.latestRequirement!==void 0&&(this.latestRequirement.risk=e)}setNewReqVerifyMethod(e){this.latestRequirement!==void 0&&(this.latestRequirement.verifyMethod=e)}addElement(e){return this.elements.has(e)||(this.elements.set(e,{name:e,type:this.latestElement.type,docRef:this.latestElement.docRef,cssStyles:[],classes:["default"]}),se.info("Added new element: ",e)),this.resetLatestElement(),this.elements.get(e)}getElements(){return this.elements}setNewElementType(e){this.latestElement!==void 0&&(this.latestElement.type=e)}setNewElementDocRef(e){this.latestElement!==void 0&&(this.latestElement.docRef=e)}addRelationship(e,r,n){this.relations.push({type:e,src:r,dst:n})}getRelationships(){return this.relations}clear(){this.relations=[],this.resetLatestRequirement(),this.requirements=new Map,this.resetLatestElement(),this.elements=new Map,this.classes=new Map,Hn()}setCssStyle(e,r){for(const n of e){const i=this.requirements.get(n)??this.elements.get(n);if(!r||!i)return;for(const a of r)a.includes(",")?i.cssStyles.push(...a.split(",")):i.cssStyles.push(a)}}setClass(e,r){var n;for(const i of e){const a=this.requirements.get(i)??this.elements.get(i);if(a)for(const s of r){a.classes.push(s);const o=(n=this.classes.get(s))==null?void 0:n.styles;o&&a.cssStyles.push(...o)}}}defineClass(e,r){for(const n of e){let i=this.classes.get(n);i===void 0&&(i={id:n,styles:[],textStyles:[]},this.classes.set(n,i)),r&&r.forEach(function(a){if(/color/.exec(a)){const s=a.replace("fill","bgFill");i.textStyles.push(s)}i.styles.push(a)}),this.requirements.forEach(a=>{a.classes.includes(n)&&a.cssStyles.push(...r.flatMap(s=>s.split(",")))}),this.elements.forEach(a=>{a.classes.includes(n)&&a.cssStyles.push(...r.flatMap(s=>s.split(",")))})}}getClasses(){return this.classes}getData(){var i,a,s,o;const e=Pe(),r=[],n=[];for(const l of this.requirements.values()){const u=l;u.id=l.name,u.cssStyles=l.cssStyles,u.cssClasses=l.classes.join(" "),u.shape="requirementBox",u.look=e.look,u.colorIndex=r.length,r.push(u)}for(const l of this.elements.values()){const u=l;u.shape="requirementBox",u.look=e.look,u.id=l.name,u.cssStyles=l.cssStyles,u.cssClasses=l.classes.join(" "),u.colorIndex=r.length,r.push(u)}for(const l of this.relations){let u=0;const h=l.type===this.Relationships.CONTAINS,d={id:`${l.src}-${l.dst}-${u}`,start:((i=this.requirements.get(l.src))==null?void 0:i.name)??((a=this.elements.get(l.src))==null?void 0:a.name),end:((s=this.requirements.get(l.dst))==null?void 0:s.name)??((o=this.elements.get(l.dst))==null?void 0:o.name),label:`<<${l.type}>>`,classes:"relationshipLine",style:["fill:none",h?"":"stroke-dasharray: 10,7"],labelpos:"c",thickness:"normal",type:"normal",pattern:h?"normal":"dashed",arrowTypeStart:h?"requirement_contains":"",arrowTypeEnd:h?"":"requirement_arrow",look:e.look,labelType:"markdown"};n.push(d),u++}return{nodes:r,edges:n,other:{},config:e,direction:this.getDirection()}}},T(vb,"RequirementDB"),vb),c1t=T(t=>{const e=pr(),{themeVariables:r,look:n}=e,{bkgColorArray:i,borderColorArray:a}=r;if(!(a!=null&&a.length))return"";let s="";for(let o=0;o{const e=lr(),{look:r,themeVariables:n}=e,{requirementEdgeLabelBackground:i}=n;return` - ${Clt(t)} + `;return s},"genColor"),u1t=T(t=>{const e=pr(),{look:r,themeVariables:n}=e,{requirementEdgeLabelBackground:i}=n;return` + ${c1t(t)} marker { fill: ${t.relationColor}; stroke: ${t.relationColor}; @@ -1815,7 +1816,7 @@ Expecting `+wt.join(", ")+", got '"+(this.terminals_[ot]||ot)+"'":Mr="Parse erro stroke: ${t.requirementBorderColor}; stroke-width: ${t.requirementBorderSize}; } - + .reqTitle, .reqLabel{ fill: ${t.requirementTextColor}; } @@ -1860,16 +1861,16 @@ Expecting `+wt.join(", ")+", got '"+(this.terminals_[ot]||ot)+"'":Mr="Parse erro background-color: ${i??t.edgeLabelBackground}; } -`},"getStyles"),Elt=klt,Xge={};bw(Xge,{draw:()=>Slt});var Slt=x(async function(t,e,r,n){ae.info("REF0:"),ae.info("Drawing requirement diagram (unified)",e);const{securityLevel:i,state:a,layout:s,look:o}=Pe(),l=n.db.getData(),u=Xp(e,i);l.type=n.type,l.layoutAlgorithm=sb(s),l.nodeSpacing=(a==null?void 0:a.nodeSpacing)??50,l.rankSpacing=(a==null?void 0:a.rankSpacing)??50,l.markers=o==="neo"?["requirement_contains_neo","requirement_arrow_neo"]:["requirement_contains","requirement_arrow"],l.diagramId=e,await Z0(l,u);const h=8;Lr.insertTitle(u,"requirementDiagramTitleText",(a==null?void 0:a.titleTopMargin)??25,n.db.getDiagramTitle()),Wd(u,h,"requirementDiagram",(a==null?void 0:a.useMaxWidth)??!0)},"draw"),Alt={parser:Tlt,get db(){return new wlt},renderer:Xge,styles:Elt};const _lt=Object.freeze(Object.defineProperty({__proto__:null,diagram:Alt},Symbol.toStringTag,{value:"Module"}));var T$=(function(){var t=x(function(De,qe,Le,Xe){for(Le=Le||{},Xe=De.length;Xe--;Le[De[Xe]]=qe);return Le},"o"),e=[1,2],r=[1,3],n=[1,4],i=[2,4],a=[1,9],s=[1,11],o=[1,12],l=[1,14],u=[1,15],h=[1,17],d=[1,18],f=[1,19],p=[1,25],g=[1,26],m=[1,27],y=[1,28],v=[1,29],T=[1,30],b=[1,31],w=[1,32],k=[1,33],A=[1,34],C=[1,35],_=[1,36],L=[1,37],O=[1,38],M=[1,39],z=[1,40],F=[1,42],S=[1,43],R=[1,44],N=[1,45],D=[1,46],I=[1,47],$=[1,4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,48,49,50,51,53,54,56,61,62,63,64,73],B=[1,74],P=[1,80],G=[1,81],V=[1,82],Y=[1,83],W=[1,84],ie=[1,85],K=[1,86],se=[1,87],J=[1,88],Z=[1,89],ee=[1,90],ne=[1,91],ue=[1,92],fe=[1,93],_e=[1,94],Ae=[1,95],Ne=[1,96],me=[1,97],ve=[1,98],Ge=[1,99],Te=[1,100],Ze=[1,101],ke=[1,102],Ve=[1,103],Qe=[1,104],nt=[1,105],tt=[2,78],je=[4,5,17,51,53,54],Ce=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,51,53,54,56,61,62,63,64,73],Se=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,50,51,53,54,56,61,62,63,64,73],H=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,49,51,53,54,56,61,62,63,64,73],he=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,48,51,53,54,56,61,62,63,64,73],j=[5,52],pe=[70,71,72,73],re=[1,151],Be={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SPACE:4,NEWLINE:5,SD:6,document:7,line:8,statement:9,INVALID:10,box_section:11,box_line:12,participant_statement:13,create:14,box:15,restOfLine:16,end:17,signal:18,autonumber:19,NUM:20,off:21,activate:22,actor:23,deactivate:24,note_statement:25,links_statement:26,link_statement:27,properties_statement:28,details_statement: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:40,else_sections:41,par:42,par_sections:43,par_over:44,critical:45,option_sections:46,break:47,option:48,and:49,else:50,participant:51,AS:52,participant_actor:53,destroy:54,actor_with_config:55,note:56,placement:57,text2:58,over:59,actor_pair:60,links:61,link:62,properties:63,details:64,spaceList:65,",":66,left_of:67,right_of:68,signaltype:69,"+":70,"-":71,"()":72,ACTOR:73,config_object:74,CONFIG_START:75,CONFIG_CONTENT:76,CONFIG_END:77,SOLID_OPEN_ARROW:78,DOTTED_OPEN_ARROW:79,SOLID_ARROW:80,SOLID_ARROW_TOP:81,SOLID_ARROW_BOTTOM:82,STICK_ARROW_TOP:83,STICK_ARROW_BOTTOM:84,SOLID_ARROW_TOP_DOTTED:85,SOLID_ARROW_BOTTOM_DOTTED:86,STICK_ARROW_TOP_DOTTED:87,STICK_ARROW_BOTTOM_DOTTED:88,SOLID_ARROW_TOP_REVERSE:89,SOLID_ARROW_BOTTOM_REVERSE:90,STICK_ARROW_TOP_REVERSE:91,STICK_ARROW_BOTTOM_REVERSE:92,SOLID_ARROW_TOP_REVERSE_DOTTED:93,SOLID_ARROW_BOTTOM_REVERSE_DOTTED:94,STICK_ARROW_TOP_REVERSE_DOTTED:95,STICK_ARROW_BOTTOM_REVERSE_DOTTED:96,BIDIRECTIONAL_SOLID_ARROW:97,DOTTED_ARROW:98,BIDIRECTIONAL_DOTTED_ARROW:99,SOLID_CROSS:100,DOTTED_CROSS:101,SOLID_POINT:102,DOTTED_POINT:103,TXT:104,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NEWLINE",6:"SD",10:"INVALID",14:"create",15:"box",16:"restOfLine",17:"end",19:"autonumber",20:"NUM",21:"off",22:"activate",24:"deactivate",30:"title",31:"legacy_title",32:"acc_title",33:"acc_title_value",34:"acc_descr",35:"acc_descr_value",36:"acc_descr_multiline_value",37:"loop",38:"rect",39:"opt",40:"alt",42:"par",44:"par_over",45:"critical",47:"break",48:"option",49:"and",50:"else",51:"participant",52:"AS",53:"participant_actor",54:"destroy",56:"note",59:"over",61:"links",62:"link",63:"properties",64:"details",66:",",67:"left_of",68:"right_of",70:"+",71:"-",72:"()",73:"ACTOR",75:"CONFIG_START",76:"CONFIG_CONTENT",77:"CONFIG_END",78:"SOLID_OPEN_ARROW",79:"DOTTED_OPEN_ARROW",80:"SOLID_ARROW",81:"SOLID_ARROW_TOP",82:"SOLID_ARROW_BOTTOM",83:"STICK_ARROW_TOP",84:"STICK_ARROW_BOTTOM",85:"SOLID_ARROW_TOP_DOTTED",86:"SOLID_ARROW_BOTTOM_DOTTED",87:"STICK_ARROW_TOP_DOTTED",88:"STICK_ARROW_BOTTOM_DOTTED",89:"SOLID_ARROW_TOP_REVERSE",90:"SOLID_ARROW_BOTTOM_REVERSE",91:"STICK_ARROW_TOP_REVERSE",92:"STICK_ARROW_BOTTOM_REVERSE",93:"SOLID_ARROW_TOP_REVERSE_DOTTED",94:"SOLID_ARROW_BOTTOM_REVERSE_DOTTED",95:"STICK_ARROW_TOP_REVERSE_DOTTED",96:"STICK_ARROW_BOTTOM_REVERSE_DOTTED",97:"BIDIRECTIONAL_SOLID_ARROW",98:"DOTTED_ARROW",99:"BIDIRECTIONAL_DOTTED_ARROW",100:"SOLID_CROSS",101:"DOTTED_CROSS",102:"SOLID_POINT",103:"DOTTED_POINT",104:"TXT"},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[8,1],[11,0],[11,2],[12,2],[12,1],[12,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],[46,1],[46,4],[43,1],[43,4],[41,1],[41,4],[13,5],[13,3],[13,5],[13,3],[13,3],[13,5],[13,3],[13,5],[13,3],[25,4],[25,4],[26,3],[27,3],[28,3],[29,3],[65,2],[65,1],[60,3],[60,1],[57,1],[57,1],[18,5],[18,5],[18,5],[18,5],[18,6],[18,4],[55,2],[74,3],[23,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[58,1]],performAction:x(function(qe,Le,Xe,Ie,it,we,lt){var be=we.length-1;switch(it){case 3:return Ie.apply(we[be]),we[be];case 4:case 10:this.$=[];break;case 5:case 11:we[be-1].push(we[be]),this.$=we[be-1];break;case 6:case 7:case 12:case 13:this.$=we[be];break;case 8:case 9:case 14:this.$=[];break;case 16:we[be].type="createParticipant",this.$=we[be];break;case 17:we[be-1].unshift({type:"boxStart",boxData:Ie.parseBoxData(we[be-2])}),we[be-1].push({type:"boxEnd",boxText:we[be-2]}),this.$=we[be-1];break;case 19:this.$={type:"sequenceIndex",sequenceIndex:Number(we[be-2]),sequenceIndexStep:Number(we[be-1]),sequenceVisible:!0,signalType:Ie.LINETYPE.AUTONUMBER};break;case 20:this.$={type:"sequenceIndex",sequenceIndex:Number(we[be-1]),sequenceIndexStep:1,sequenceVisible:!0,signalType:Ie.LINETYPE.AUTONUMBER};break;case 21:this.$={type:"sequenceIndex",sequenceVisible:!1,signalType:Ie.LINETYPE.AUTONUMBER};break;case 22:this.$={type:"sequenceIndex",sequenceVisible:!0,signalType:Ie.LINETYPE.AUTONUMBER};break;case 23:this.$={type:"activeStart",signalType:Ie.LINETYPE.ACTIVE_START,actor:we[be-1].actor};break;case 24:this.$={type:"activeEnd",signalType:Ie.LINETYPE.ACTIVE_END,actor:we[be-1].actor};break;case 30:Ie.setDiagramTitle(we[be].substring(6)),this.$=we[be].substring(6);break;case 31:Ie.setDiagramTitle(we[be].substring(7)),this.$=we[be].substring(7);break;case 32:this.$=we[be].trim(),Ie.setAccTitle(this.$);break;case 33:case 34:this.$=we[be].trim(),Ie.setAccDescription(this.$);break;case 35:we[be-1].unshift({type:"loopStart",loopText:Ie.parseMessage(we[be-2]),signalType:Ie.LINETYPE.LOOP_START}),we[be-1].push({type:"loopEnd",loopText:we[be-2],signalType:Ie.LINETYPE.LOOP_END}),this.$=we[be-1];break;case 36:we[be-1].unshift({type:"rectStart",color:Ie.parseMessage(we[be-2]),signalType:Ie.LINETYPE.RECT_START}),we[be-1].push({type:"rectEnd",color:Ie.parseMessage(we[be-2]),signalType:Ie.LINETYPE.RECT_END}),this.$=we[be-1];break;case 37:we[be-1].unshift({type:"optStart",optText:Ie.parseMessage(we[be-2]),signalType:Ie.LINETYPE.OPT_START}),we[be-1].push({type:"optEnd",optText:Ie.parseMessage(we[be-2]),signalType:Ie.LINETYPE.OPT_END}),this.$=we[be-1];break;case 38:we[be-1].unshift({type:"altStart",altText:Ie.parseMessage(we[be-2]),signalType:Ie.LINETYPE.ALT_START}),we[be-1].push({type:"altEnd",signalType:Ie.LINETYPE.ALT_END}),this.$=we[be-1];break;case 39:we[be-1].unshift({type:"parStart",parText:Ie.parseMessage(we[be-2]),signalType:Ie.LINETYPE.PAR_START}),we[be-1].push({type:"parEnd",signalType:Ie.LINETYPE.PAR_END}),this.$=we[be-1];break;case 40:we[be-1].unshift({type:"parStart",parText:Ie.parseMessage(we[be-2]),signalType:Ie.LINETYPE.PAR_OVER_START}),we[be-1].push({type:"parEnd",signalType:Ie.LINETYPE.PAR_END}),this.$=we[be-1];break;case 41:we[be-1].unshift({type:"criticalStart",criticalText:Ie.parseMessage(we[be-2]),signalType:Ie.LINETYPE.CRITICAL_START}),we[be-1].push({type:"criticalEnd",signalType:Ie.LINETYPE.CRITICAL_END}),this.$=we[be-1];break;case 42:we[be-1].unshift({type:"breakStart",breakText:Ie.parseMessage(we[be-2]),signalType:Ie.LINETYPE.BREAK_START}),we[be-1].push({type:"breakEnd",optText:Ie.parseMessage(we[be-2]),signalType:Ie.LINETYPE.BREAK_END}),this.$=we[be-1];break;case 44:this.$=we[be-3].concat([{type:"option",optionText:Ie.parseMessage(we[be-1]),signalType:Ie.LINETYPE.CRITICAL_OPTION},we[be]]);break;case 46:this.$=we[be-3].concat([{type:"and",parText:Ie.parseMessage(we[be-1]),signalType:Ie.LINETYPE.PAR_AND},we[be]]);break;case 48:this.$=we[be-3].concat([{type:"else",altText:Ie.parseMessage(we[be-1]),signalType:Ie.LINETYPE.ALT_ELSE},we[be]]);break;case 49:we[be-3].draw="participant",we[be-3].type="addParticipant",we[be-3].description=Ie.parseMessage(we[be-1]),this.$=we[be-3];break;case 50:we[be-1].draw="participant",we[be-1].type="addParticipant",this.$=we[be-1];break;case 51:we[be-3].draw="actor",we[be-3].type="addParticipant",we[be-3].description=Ie.parseMessage(we[be-1]),this.$=we[be-3];break;case 52:case 57:we[be-1].draw="actor",we[be-1].type="addParticipant",this.$=we[be-1];break;case 53:we[be-1].type="destroyParticipant",this.$=we[be-1];break;case 54:we[be-3].draw="participant",we[be-3].type="addParticipant",we[be-3].description=Ie.parseMessage(we[be-1]),this.$=we[be-3];break;case 55:we[be-1].draw="participant",we[be-1].type="addParticipant",this.$=we[be-1];break;case 56:we[be-3].draw="actor",we[be-3].type="addParticipant",we[be-3].description=Ie.parseMessage(we[be-1]),this.$=we[be-3];break;case 58:this.$=[we[be-1],{type:"addNote",placement:we[be-2],actor:we[be-1].actor,text:we[be]}];break;case 59:we[be-2]=[].concat(we[be-1],we[be-1]).slice(0,2),we[be-2][0]=we[be-2][0].actor,we[be-2][1]=we[be-2][1].actor,this.$=[we[be-1],{type:"addNote",placement:Ie.PLACEMENT.OVER,actor:we[be-2].slice(0,2),text:we[be]}];break;case 60:this.$=[we[be-1],{type:"addLinks",actor:we[be-1].actor,text:we[be]}];break;case 61:this.$=[we[be-1],{type:"addALink",actor:we[be-1].actor,text:we[be]}];break;case 62:this.$=[we[be-1],{type:"addProperties",actor:we[be-1].actor,text:we[be]}];break;case 63:this.$=[we[be-1],{type:"addDetails",actor:we[be-1].actor,text:we[be]}];break;case 66:this.$=[we[be-2],we[be]];break;case 67:this.$=we[be];break;case 68:this.$=Ie.PLACEMENT.LEFTOF;break;case 69:this.$=Ie.PLACEMENT.RIGHTOF;break;case 70:this.$=[we[be-4],we[be-1],{type:"addMessage",from:we[be-4].actor,to:we[be-1].actor,signalType:we[be-3],msg:we[be],activate:!0},{type:"activeStart",signalType:Ie.LINETYPE.ACTIVE_START,actor:we[be-1].actor}];break;case 71:this.$=[we[be-4],we[be-1],{type:"addMessage",from:we[be-4].actor,to:we[be-1].actor,signalType:we[be-3],msg:we[be]},{type:"activeEnd",signalType:Ie.LINETYPE.ACTIVE_END,actor:we[be-4].actor}];break;case 72:this.$=[we[be-4],we[be-1],{type:"addMessage",from:we[be-4].actor,to:we[be-1].actor,signalType:we[be-3],msg:we[be],activate:!0,centralConnection:Ie.LINETYPE.CENTRAL_CONNECTION},{type:"centralConnection",signalType:Ie.LINETYPE.CENTRAL_CONNECTION,actor:we[be-1].actor}];break;case 73:this.$=[we[be-4],we[be-1],{type:"addMessage",from:we[be-4].actor,to:we[be-1].actor,signalType:we[be-2],msg:we[be],activate:!1,centralConnection:Ie.LINETYPE.CENTRAL_CONNECTION_REVERSE},{type:"centralConnectionReverse",signalType:Ie.LINETYPE.CENTRAL_CONNECTION_REVERSE,actor:we[be-4].actor}];break;case 74:this.$=[we[be-5],we[be-1],{type:"addMessage",from:we[be-5].actor,to:we[be-1].actor,signalType:we[be-3],msg:we[be],activate:!0,centralConnection:Ie.LINETYPE.CENTRAL_CONNECTION_DUAL},{type:"centralConnection",signalType:Ie.LINETYPE.CENTRAL_CONNECTION,actor:we[be-1].actor},{type:"centralConnectionReverse",signalType:Ie.LINETYPE.CENTRAL_CONNECTION_REVERSE,actor:we[be-5].actor}];break;case 75:this.$=[we[be-3],we[be-1],{type:"addMessage",from:we[be-3].actor,to:we[be-1].actor,signalType:we[be-2],msg:we[be]}];break;case 76:this.$={type:"addParticipant",actor:we[be-1],config:we[be]};break;case 77:this.$=we[be-1].trim();break;case 78:this.$={type:"addParticipant",actor:we[be]};break;case 79:this.$=Ie.LINETYPE.SOLID_OPEN;break;case 80:this.$=Ie.LINETYPE.DOTTED_OPEN;break;case 81:this.$=Ie.LINETYPE.SOLID;break;case 82:this.$=Ie.LINETYPE.SOLID_TOP;break;case 83:this.$=Ie.LINETYPE.SOLID_BOTTOM;break;case 84:this.$=Ie.LINETYPE.STICK_TOP;break;case 85:this.$=Ie.LINETYPE.STICK_BOTTOM;break;case 86:this.$=Ie.LINETYPE.SOLID_TOP_DOTTED;break;case 87:this.$=Ie.LINETYPE.SOLID_BOTTOM_DOTTED;break;case 88:this.$=Ie.LINETYPE.STICK_TOP_DOTTED;break;case 89:this.$=Ie.LINETYPE.STICK_BOTTOM_DOTTED;break;case 90:this.$=Ie.LINETYPE.SOLID_ARROW_TOP_REVERSE;break;case 91:this.$=Ie.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE;break;case 92:this.$=Ie.LINETYPE.STICK_ARROW_TOP_REVERSE;break;case 93:this.$=Ie.LINETYPE.STICK_ARROW_BOTTOM_REVERSE;break;case 94:this.$=Ie.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED;break;case 95:this.$=Ie.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED;break;case 96:this.$=Ie.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED;break;case 97:this.$=Ie.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED;break;case 98:this.$=Ie.LINETYPE.BIDIRECTIONAL_SOLID;break;case 99:this.$=Ie.LINETYPE.DOTTED;break;case 100:this.$=Ie.LINETYPE.BIDIRECTIONAL_DOTTED;break;case 101:this.$=Ie.LINETYPE.SOLID_CROSS;break;case 102:this.$=Ie.LINETYPE.DOTTED_CROSS;break;case 103:this.$=Ie.LINETYPE.SOLID_POINT;break;case 104:this.$=Ie.LINETYPE.DOTTED_POINT;break;case 105:this.$=Ie.parseMessage(we[be].trim().substring(1));break}},"anonymous"),table:[{3:1,4:e,5:r,6:n},{1:[3]},{3:5,4:e,5:r,6:n},{3:6,4:e,5:r,6:n},t([1,4,5,10,14,15,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,51,53,54,56,61,62,63,64,73],i,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:a,5:s,8:8,9:10,10:o,13:13,14:l,15:u,18:16,19:h,22:d,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:g,32:m,34:y,36:v,37:T,38:b,39:w,40:k,42:A,44:C,45:_,47:L,51:O,53:M,54:z,56:F,61:S,62:R,63:N,64:D,73:I},t($,[2,5]),{9:48,13:13,14:l,15:u,18:16,19:h,22:d,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:g,32:m,34:y,36:v,37:T,38:b,39:w,40:k,42:A,44:C,45:_,47:L,51:O,53:M,54:z,56:F,61:S,62:R,63:N,64:D,73:I},t($,[2,7]),t($,[2,8]),t($,[2,9]),t($,[2,15]),{13:49,51:O,53:M,54:z},{16:[1,50]},{5:[1,51]},{5:[1,54],20:[1,52],21:[1,53]},{23:55,73:I},{23:56,73:I},{5:[1,57]},{5:[1,58]},{5:[1,59]},{5:[1,60]},{5:[1,61]},t($,[2,30]),t($,[2,31]),{33:[1,62]},{35:[1,63]},t($,[2,34]),{16:[1,64]},{16:[1,65]},{16:[1,66]},{16:[1,67]},{16:[1,68]},{16:[1,69]},{16:[1,70]},{16:[1,71]},{23:72,55:73,73:B},{23:75,55:76,73:B},{23:77,73:I},{69:78,72:[1,79],78:P,79:G,80:V,81:Y,82:W,83:ie,84:K,85:se,86:J,87:Z,88:ee,89:ne,90:ue,91:fe,92:_e,93:Ae,94:Ne,95:me,96:ve,97:Ge,98:Te,99:Ze,100:ke,101:Ve,102:Qe,103:nt},{57:106,59:[1,107],67:[1,108],68:[1,109]},{23:110,73:I},{23:111,73:I},{23:112,73:I},{23:113,73:I},t([5,66,72,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104],tt),t($,[2,6]),t($,[2,16]),t(je,[2,10],{11:114}),t($,[2,18]),{5:[1,116],20:[1,115]},{5:[1,117]},t($,[2,22]),{5:[1,118]},{5:[1,119]},t($,[2,25]),t($,[2,26]),t($,[2,27]),t($,[2,28]),t($,[2,29]),t($,[2,32]),t($,[2,33]),t(Ce,i,{7:120}),t(Ce,i,{7:121}),t(Ce,i,{7:122}),t(Se,i,{41:123,7:124}),t(H,i,{43:125,7:126}),t(H,i,{7:126,43:127}),t(he,i,{46:128,7:129}),t(Ce,i,{7:130}),{5:[1,132],52:[1,131]},{5:[1,134],52:[1,133]},t(j,tt,{74:135,75:[1,136]}),{5:[1,138],52:[1,137]},{5:[1,140],52:[1,139]},{5:[1,141]},{23:145,70:[1,142],71:[1,143],72:[1,144],73:I},{69:146,78:P,79:G,80:V,81:Y,82:W,83:ie,84:K,85:se,86:J,87:Z,88:ee,89:ne,90:ue,91:fe,92:_e,93:Ae,94:Ne,95:me,96:ve,97:Ge,98:Te,99:Ze,100:ke,101:Ve,102:Qe,103:nt},t(pe,[2,79]),t(pe,[2,80]),t(pe,[2,81]),t(pe,[2,82]),t(pe,[2,83]),t(pe,[2,84]),t(pe,[2,85]),t(pe,[2,86]),t(pe,[2,87]),t(pe,[2,88]),t(pe,[2,89]),t(pe,[2,90]),t(pe,[2,91]),t(pe,[2,92]),t(pe,[2,93]),t(pe,[2,94]),t(pe,[2,95]),t(pe,[2,96]),t(pe,[2,97]),t(pe,[2,98]),t(pe,[2,99]),t(pe,[2,100]),t(pe,[2,101]),t(pe,[2,102]),t(pe,[2,103]),t(pe,[2,104]),{23:147,73:I},{23:149,60:148,73:I},{73:[2,68]},{73:[2,69]},{58:150,104:re},{58:152,104:re},{58:153,104:re},{58:154,104:re},{4:[1,157],5:[1,159],12:156,13:158,17:[1,155],51:O,53:M,54:z},{5:[1,160]},t($,[2,20]),t($,[2,21]),t($,[2,23]),t($,[2,24]),{4:a,5:s,8:8,9:10,10:o,13:13,14:l,15:u,17:[1,161],18:16,19:h,22:d,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:g,32:m,34:y,36:v,37:T,38:b,39:w,40:k,42:A,44:C,45:_,47:L,51:O,53:M,54:z,56:F,61:S,62:R,63:N,64:D,73:I},{4:a,5:s,8:8,9:10,10:o,13:13,14:l,15:u,17:[1,162],18:16,19:h,22:d,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:g,32:m,34:y,36:v,37:T,38:b,39:w,40:k,42:A,44:C,45:_,47:L,51:O,53:M,54:z,56:F,61:S,62:R,63:N,64:D,73:I},{4:a,5:s,8:8,9:10,10:o,13:13,14:l,15:u,17:[1,163],18:16,19:h,22:d,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:g,32:m,34:y,36:v,37:T,38:b,39:w,40:k,42:A,44:C,45:_,47:L,51:O,53:M,54:z,56:F,61:S,62:R,63:N,64:D,73:I},{17:[1,164]},{4:a,5:s,8:8,9:10,10:o,13:13,14:l,15:u,17:[2,47],18:16,19:h,22:d,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:g,32:m,34:y,36:v,37:T,38:b,39:w,40:k,42:A,44:C,45:_,47:L,50:[1,165],51:O,53:M,54:z,56:F,61:S,62:R,63:N,64:D,73:I},{17:[1,166]},{4:a,5:s,8:8,9:10,10:o,13:13,14:l,15:u,17:[2,45],18:16,19:h,22:d,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:g,32:m,34:y,36:v,37:T,38:b,39:w,40:k,42:A,44:C,45:_,47:L,49:[1,167],51:O,53:M,54:z,56:F,61:S,62:R,63:N,64:D,73:I},{17:[1,168]},{17:[1,169]},{4:a,5:s,8:8,9:10,10:o,13:13,14:l,15:u,17:[2,43],18:16,19:h,22:d,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:g,32:m,34:y,36:v,37:T,38:b,39:w,40:k,42:A,44:C,45:_,47:L,48:[1,170],51:O,53:M,54:z,56:F,61:S,62:R,63:N,64:D,73:I},{4:a,5:s,8:8,9:10,10:o,13:13,14:l,15:u,17:[1,171],18:16,19:h,22:d,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:g,32:m,34:y,36:v,37:T,38:b,39:w,40:k,42:A,44:C,45:_,47:L,51:O,53:M,54:z,56:F,61:S,62:R,63:N,64:D,73:I},{16:[1,172]},t($,[2,50]),{16:[1,173]},t($,[2,55]),t(j,[2,76]),{76:[1,174]},{16:[1,175]},t($,[2,52]),{16:[1,176]},t($,[2,57]),t($,[2,53]),{23:177,73:I},{23:178,73:I},{23:179,73:I},{58:180,104:re},{23:181,72:[1,182],73:I},{58:183,104:re},{58:184,104:re},{66:[1,185],104:[2,67]},{5:[2,60]},{5:[2,105]},{5:[2,61]},{5:[2,62]},{5:[2,63]},t($,[2,17]),t(je,[2,11]),{13:186,51:O,53:M,54:z},t(je,[2,13]),t(je,[2,14]),t($,[2,19]),t($,[2,35]),t($,[2,36]),t($,[2,37]),t($,[2,38]),{16:[1,187]},t($,[2,39]),{16:[1,188]},t($,[2,40]),t($,[2,41]),{16:[1,189]},t($,[2,42]),{5:[1,190]},{5:[1,191]},{77:[1,192]},{5:[1,193]},{5:[1,194]},{58:195,104:re},{58:196,104:re},{58:197,104:re},{5:[2,75]},{58:198,104:re},{23:199,73:I},{5:[2,58]},{5:[2,59]},{23:200,73:I},t(je,[2,12]),t(Se,i,{7:124,41:201}),t(H,i,{7:126,43:202}),t(he,i,{7:129,46:203}),t($,[2,49]),t($,[2,54]),t(j,[2,77]),t($,[2,51]),t($,[2,56]),{5:[2,70]},{5:[2,71]},{5:[2,72]},{5:[2,73]},{58:204,104:re},{104:[2,66]},{17:[2,48]},{17:[2,46]},{17:[2,44]},{5:[2,74]}],defaultActions:{5:[2,1],6:[2,2],108:[2,68],109:[2,69],150:[2,60],151:[2,105],152:[2,61],153:[2,62],154:[2,63],180:[2,75],183:[2,58],184:[2,59],195:[2,70],196:[2,71],197:[2,72],198:[2,73],200:[2,66],201:[2,48],202:[2,46],203:[2,44],204:[2,74]},parseError:x(function(qe,Le){if(Le.recoverable)this.trace(qe);else{var Xe=new Error(qe);throw Xe.hash=Le,Xe}},"parseError"),parse:x(function(qe){var Le=this,Xe=[0],Ie=[],it=[null],we=[],lt=this.table,be="",Et=0,vt=0,ot=2,It=1,xt=we.slice.call(arguments,1),ht=Object.create(this.lexer),oe={yy:{}};for(var At in this.yy)Object.prototype.hasOwnProperty.call(this.yy,At)&&(oe.yy[At]=this.yy[At]);ht.setInput(qe,oe.yy),oe.yy.lexer=ht,oe.yy.parser=this,typeof ht.yylloc>"u"&&(ht.yylloc={});var dt=ht.yylloc;we.push(dt);var ut=ht.options&&ht.options.ranges;typeof oe.yy.parseError=="function"?this.parseError=oe.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function wt(Jt){Xe.length=Xe.length-2*Jt,it.length=it.length-Jt,we.length=we.length-Jt}x(wt,"popStack");function Mr(){var Jt;return Jt=Ie.pop()||ht.lex()||It,typeof Jt!="number"&&(Jt instanceof Array&&(Ie=Jt,Jt=Ie.pop()),Jt=Le.symbols_[Jt]||Jt),Jt}x(Mr,"lex");for(var ye,et,ct,_t,Ft={},nr,ir,_r,or;;){if(et=Xe[Xe.length-1],this.defaultActions[et]?ct=this.defaultActions[et]:((ye===null||typeof ye>"u")&&(ye=Mr()),ct=lt[et]&<[et][ye]),typeof ct>"u"||!ct.length||!ct[0]){var Rr="";or=[];for(nr in lt[et])this.terminals_[nr]&&nr>ot&&or.push("'"+this.terminals_[nr]+"'");ht.showPosition?Rr="Parse error on line "+(Et+1)+`: -`+ht.showPosition()+` -Expecting `+or.join(", ")+", got '"+(this.terminals_[ye]||ye)+"'":Rr="Parse error on line "+(Et+1)+": Unexpected "+(ye==It?"end of input":"'"+(this.terminals_[ye]||ye)+"'"),this.parseError(Rr,{text:ht.match,token:this.terminals_[ye]||ye,line:ht.yylineno,loc:dt,expected:or})}if(ct[0]instanceof Array&&ct.length>1)throw new Error("Parse Error: multiple actions possible at state: "+et+", token: "+ye);switch(ct[0]){case 1:Xe.push(ye),it.push(ht.yytext),we.push(ht.yylloc),Xe.push(ct[1]),ye=null,vt=ht.yyleng,be=ht.yytext,Et=ht.yylineno,dt=ht.yylloc;break;case 2:if(ir=this.productions_[ct[1]][1],Ft.$=it[it.length-ir],Ft._$={first_line:we[we.length-(ir||1)].first_line,last_line:we[we.length-1].last_line,first_column:we[we.length-(ir||1)].first_column,last_column:we[we.length-1].last_column},ut&&(Ft._$.range=[we[we.length-(ir||1)].range[0],we[we.length-1].range[1]]),_t=this.performAction.apply(Ft,[be,vt,Et,oe.yy,ct[1],it,we].concat(xt)),typeof _t<"u")return _t;ir&&(Xe=Xe.slice(0,-1*ir*2),it=it.slice(0,-1*ir),we=we.slice(0,-1*ir)),Xe.push(this.productions_[ct[1]][0]),it.push(Ft.$),we.push(Ft._$),_r=lt[Xe[Xe.length-2]][Xe[Xe.length-1]],Xe.push(_r);break;case 3:return!0}}return!0},"parse")},xe=(function(){var De={EOF:1,parseError:x(function(Le,Xe){if(this.yy.parser)this.yy.parser.parseError(Le,Xe);else throw new Error(Le)},"parseError"),setInput:x(function(qe,Le){return this.yy=Le||this.yy||{},this._input=qe,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:x(function(){var qe=this._input[0];this.yytext+=qe,this.yyleng++,this.offset++,this.match+=qe,this.matched+=qe;var Le=qe.match(/(?:\r\n?|\n).*/g);return Le?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),qe},"input"),unput:x(function(qe){var Le=qe.length,Xe=qe.split(/(?:\r\n?|\n)/g);this._input=qe+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-Le),this.offset-=Le;var Ie=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),Xe.length-1&&(this.yylineno-=Xe.length-1);var it=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:Xe?(Xe.length===Ie.length?this.yylloc.first_column:0)+Ie[Ie.length-Xe.length].length-Xe[0].length:this.yylloc.first_column-Le},this.options.ranges&&(this.yylloc.range=[it[0],it[0]+this.yyleng-Le]),this.yyleng=this.yytext.length,this},"unput"),more:x(function(){return this._more=!0,this},"more"),reject:x(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). -`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:x(function(qe){this.unput(this.match.slice(qe))},"less"),pastInput:x(function(){var qe=this.matched.substr(0,this.matched.length-this.match.length);return(qe.length>20?"...":"")+qe.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:x(function(){var qe=this.match;return qe.length<20&&(qe+=this._input.substr(0,20-qe.length)),(qe.substr(0,20)+(qe.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:x(function(){var qe=this.pastInput(),Le=new Array(qe.length+1).join("-");return qe+this.upcomingInput()+` -`+Le+"^"},"showPosition"),test_match:x(function(qe,Le){var Xe,Ie,it;if(this.options.backtrack_lexer&&(it={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&&(it.yylloc.range=this.yylloc.range.slice(0))),Ie=qe[0].match(/(?:\r\n?|\n).*/g),Ie&&(this.yylineno+=Ie.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:Ie?Ie[Ie.length-1].length-Ie[Ie.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+qe[0].length},this.yytext+=qe[0],this.match+=qe[0],this.matches=qe,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(qe[0].length),this.matched+=qe[0],Xe=this.performAction.call(this,this.yy,this,Le,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),Xe)return Xe;if(this._backtrack){for(var we in it)this[we]=it[we];return!1}return!1},"test_match"),next:x(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var qe,Le,Xe,Ie;this._more||(this.yytext="",this.match="");for(var it=this._currentRules(),we=0;weLe[0].length)){if(Le=Xe,Ie=we,this.options.backtrack_lexer){if(qe=this.test_match(Xe,it[we]),qe!==!1)return qe;if(this._backtrack){Le=!1;continue}else return!1}else if(!this.options.flex)break}return Le?(qe=this.test_match(Le,it[Ie]),qe!==!1?qe:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var Le=this.next();return Le||this.lex()},"lex"),begin:x(function(Le){this.conditionStack.push(Le)},"begin"),popState:x(function(){var Le=this.conditionStack.length-1;return Le>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(Le){return Le=this.conditionStack.length-1-Math.abs(Le||0),Le>=0?this.conditionStack[Le]:"INITIAL"},"topState"),pushState:x(function(Le){this.begin(Le)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:x(function(Le,Xe,Ie,it){switch(Ie){case 0:return 5;case 1:break;case 2:break;case 3:break;case 4:break;case 5:break;case 6:return 20;case 7:return this.begin("CONFIG"),75;case 8:return 76;case 9:return this.popState(),this.begin("ALIAS"),77;case 10:return this.popState(),this.popState(),77;case 11:return Xe.yytext=Xe.yytext.trim(),73;case 12:return Xe.yytext=Xe.yytext.trim(),this.begin("ALIAS"),73;case 13:return Xe.yytext=Xe.yytext.trim(),this.popState(),73;case 14:return this.popState(),10;case 15:return Xe.yytext=Xe.yytext.trim(),this.popState(),10;case 16:return this.begin("LINE"),15;case 17:return this.begin("ID"),51;case 18:return this.begin("ID"),53;case 19:return 14;case 20:return this.begin("ID"),54;case 21:return this.popState(),this.popState(),this.begin("LINE"),52;case 22:return this.popState(),this.popState(),5;case 23:return this.begin("LINE"),37;case 24:return this.begin("LINE"),38;case 25:return this.begin("LINE"),39;case 26:return this.begin("LINE"),40;case 27:return this.begin("LINE"),50;case 28:return this.begin("LINE"),42;case 29:return this.begin("LINE"),44;case 30:return this.begin("LINE"),49;case 31:return this.begin("LINE"),45;case 32:return this.begin("LINE"),48;case 33:return this.begin("LINE"),47;case 34:return this.popState(),16;case 35:return 17;case 36:return 67;case 37:return 68;case 38:return 61;case 39:return 62;case 40:return 63;case 41:return 64;case 42:return 59;case 43:return 56;case 44:return this.begin("ID"),22;case 45:return this.begin("ID"),24;case 46:return 30;case 47:return 31;case 48:return this.begin("acc_title"),32;case 49:return this.popState(),"acc_title_value";case 50:return this.begin("acc_descr"),34;case 51:return this.popState(),"acc_descr_value";case 52:this.begin("acc_descr_multiline");break;case 53:this.popState();break;case 54:return"acc_descr_multiline_value";case 55:return 6;case 56:return 19;case 57:return 21;case 58:return 66;case 59:return 5;case 60:return Xe.yytext=Xe.yytext.trim(),73;case 61:return 80;case 62:return 97;case 63:return 98;case 64:return 99;case 65:return 78;case 66:return 79;case 67:return 100;case 68:return 101;case 69:return 102;case 70:return 103;case 71:return 85;case 72:return 86;case 73:return 87;case 74:return 88;case 75:return 93;case 76:return 94;case 77:return 95;case 78:return 96;case 79:return 81;case 80:return 82;case 81:return 83;case 82:return 84;case 83:return 89;case 84:return 90;case 85:return 91;case 86:return 92;case 87:return 104;case 88:return 104;case 89:return 70;case 90:return 71;case 91:return 72;case 92:return 5;case 93:return 10}},"anonymous"),rules:[/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:([0-9]+(\.[0-9]{1,2})?|\.[0-9]{1,2})(?=[ \n]+))/i,/^(?:@\{)/i,/^(?:[^\}]+)/i,/^(?:\}(?=\s+as\s))/i,/^(?:\})/i,/^(?:[^\<->\->:\n,;@\s]+(?=@\{))/i,/^(?:[^<>:\n,;@\s]+(?=\s+as\s))/i,/^(?:[^<>:\n,;@]+(?=\s*[\n;#]|$))/i,/^(?:[^<>:\n,;@]*<[^\n]*)/i,/^(?:[^\n]+)/i,/^(?:box\b)/i,/^(?:participant\b)/i,/^(?:actor\b)/i,/^(?:create\b)/i,/^(?:destroy\b)/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,/^(?:--\|\\)/i,/^(?:--\|\/)/i,/^(?:--\\\\)/i,/^(?:--\/\/)/i,/^(?:\/\|--)/i,/^(?:\\\|--)/i,/^(?:\/\/--)/i,/^(?:\\\\--)/i,/^(?:-\|\\)/i,/^(?:-\|\/)/i,/^(?:-\\\\)/i,/^(?:-\/\/)/i,/^(?:\/\|-)/i,/^(?:\\\|-)/i,/^(?:\/\/-)/i,/^(?:\\\\-)/i,/^(?::(?:(?:no)?wrap)?[^#\n;]*)/i,/^(?::)/i,/^(?:\+)/i,/^(?:-)/i,/^(?:\(\))/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[53,54],inclusive:!1},acc_descr:{rules:[51],inclusive:!1},acc_title:{rules:[49],inclusive:!1},ID:{rules:[2,3,7,11,12,13,14,15],inclusive:!1},ALIAS:{rules:[2,3,21,22],inclusive:!1},LINE:{rules:[2,3,34],inclusive:!1},CONFIG:{rules:[8,9,10],inclusive:!1},CONFIG_DATA:{rules:[],inclusive:!1},INITIAL:{rules:[0,1,3,4,5,6,16,17,18,19,20,23,24,25,26,27,28,29,30,31,32,33,35,36,37,38,39,40,41,42,43,44,45,46,47,48,50,52,55,56,57,58,59,60,61,62,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],inclusive:!0}}};return De})();Be.lexer=xe;function Ue(){this.yy={}}return x(Ue,"Parser"),Ue.prototype=Be,Be.Parser=Ue,new Ue})();T$.parser=T$;var Rlt=T$,Llt={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,SOLID_TOP:41,SOLID_BOTTOM:42,STICK_TOP:43,STICK_BOTTOM:44,SOLID_ARROW_TOP_REVERSE:45,SOLID_ARROW_BOTTOM_REVERSE:46,STICK_ARROW_TOP_REVERSE:47,STICK_ARROW_BOTTOM_REVERSE:48,SOLID_TOP_DOTTED:51,SOLID_BOTTOM_DOTTED:52,STICK_TOP_DOTTED:53,STICK_BOTTOM_DOTTED:54,SOLID_ARROW_TOP_REVERSE_DOTTED:55,SOLID_ARROW_BOTTOM_REVERSE_DOTTED:56,STICK_ARROW_TOP_REVERSE_DOTTED:57,STICK_ARROW_BOTTOM_REVERSE_DOTTED:58,CENTRAL_CONNECTION:59,CENTRAL_CONNECTION_REVERSE:60,CENTRAL_CONNECTION_DUAL:61},Ilt={FILLED:0,OPEN:1},Dlt={LEFTOF:0,RIGHTOF:1,OVER:2},wS={ACTOR:"actor",CONTROL:"control",DATABASE:"database",ENTITY:"entity"},Mlt=(zv=class{constructor(){this.state=new wI(()=>({prevActor:void 0,actors:new Map,createdActors:new Map,destroyedActors:new Map,boxes:[],messages:[],notes:[],sequenceNumbersEnabled:!1,wrapEnabled:void 0,currentBox:void 0,lastCreated:void 0,lastDestroyed:void 0})),this.setAccTitle=Dn,this.setAccDescription=zn,this.setDiagramTitle=qn,this.getAccTitle=Fn,this.getAccDescription=Gn,this.getDiagramTitle=Mn,this.apply=this.apply.bind(this),this.parseBoxData=this.parseBoxData.bind(this),this.parseMessage=this.parseMessage.bind(this),this.clear(),this.setWrap(Pe().wrap),this.LINETYPE=Llt,this.ARROWTYPE=Ilt,this.PLACEMENT=Dlt}addBox(e){this.state.records.boxes.push({name:e.text,wrap:e.wrap??this.autoWrap(),fill:e.color,actorKeys:[]}),this.state.records.currentBox=this.state.records.boxes.slice(-1)[0]}addActor(e,r,n,i,a){let s=this.state.records.currentBox,o;if(a!==void 0){let u;a.includes(` +`},"getStyles"),h1t=u1t,hTe={};S4(hTe,{draw:()=>d1t});var d1t=T(async function(t,e,r,n){se.info("REF0:"),se.info("Drawing requirement diagram (unified)",e);const{securityLevel:i,state:a,layout:s,look:o}=Pe(),l=n.db.getData(),u=_m(e,i);l.type=n.type,l.layoutAlgorithm=Fx(s),l.nodeSpacing=(a==null?void 0:a.nodeSpacing)??50,l.rankSpacing=(a==null?void 0:a.rankSpacing)??50,l.markers=o==="neo"?["requirement_contains_neo","requirement_arrow_neo"]:["requirement_contains","requirement_arrow"],l.diagramId=e,await fg(l,u);const h=8;Pr.insertTitle(u,"requirementDiagramTitleText",(a==null?void 0:a.titleTopMargin)??25,n.db.getDiagramTitle()),op(u,h,"requirementDiagram",(a==null?void 0:a.useMaxWidth)??!0)},"draw"),f1t={parser:o1t,get db(){return new l1t},renderer:hTe,styles:h1t};const p1t=Object.freeze(Object.defineProperty({__proto__:null,diagram:f1t},Symbol.toStringTag,{value:"Module"}));var Kz=(function(){var t=T(function(De,qe,Le,Xe){for(Le=Le||{},Xe=De.length;Xe--;Le[De[Xe]]=qe);return Le},"o"),e=[1,2],r=[1,3],n=[1,4],i=[2,4],a=[1,9],s=[1,11],o=[1,12],l=[1,14],u=[1,15],h=[1,17],d=[1,18],f=[1,19],p=[1,25],g=[1,26],m=[1,27],y=[1,28],v=[1,29],x=[1,30],b=[1,31],w=[1,32],C=[1,33],_=[1,34],k=[1,35],S=[1,36],L=[1,37],$=[1,38],I=[1,39],z=[1,40],F=[1,42],A=[1,43],R=[1,44],N=[1,45],M=[1,46],D=[1,47],O=[1,4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,48,49,50,51,53,54,56,61,62,63,64,73],B=[1,74],P=[1,80],G=[1,81],V=[1,82],H=[1,83],W=[1,84],ie=[1,85],j=[1,86],ae=[1,87],J=[1,88],K=[1,89],Q=[1,90],re=[1,91],le=[1,92],fe=[1,93],Ae=[1,94],Se=[1,95],Ne=[1,96],ge=[1,97],ve=[1,98],ze=[1,99],xe=[1,100],Ke=[1,101],Ce=[1,102],Ve=[1,103],Qe=[1,104],nt=[1,105],tt=[2,78],Ze=[4,5,17,51,53,54],ke=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,51,53,54,56,61,62,63,64,73],_e=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,50,51,53,54,56,61,62,63,64,73],Y=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,49,51,53,54,56,61,62,63,64,73],he=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,48,51,53,54,56,61,62,63,64,73],Z=[5,52],pe=[70,71,72,73],ne=[1,151],Be={trace:T(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SPACE:4,NEWLINE:5,SD:6,document:7,line:8,statement:9,INVALID:10,box_section:11,box_line:12,participant_statement:13,create:14,box:15,restOfLine:16,end:17,signal:18,autonumber:19,NUM:20,off:21,activate:22,actor:23,deactivate:24,note_statement:25,links_statement:26,link_statement:27,properties_statement:28,details_statement: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:40,else_sections:41,par:42,par_sections:43,par_over:44,critical:45,option_sections:46,break:47,option:48,and:49,else:50,participant:51,AS:52,participant_actor:53,destroy:54,actor_with_config:55,note:56,placement:57,text2:58,over:59,actor_pair:60,links:61,link:62,properties:63,details:64,spaceList:65,",":66,left_of:67,right_of:68,signaltype:69,"+":70,"-":71,"()":72,ACTOR:73,config_object:74,CONFIG_START:75,CONFIG_CONTENT:76,CONFIG_END:77,SOLID_OPEN_ARROW:78,DOTTED_OPEN_ARROW:79,SOLID_ARROW:80,SOLID_ARROW_TOP:81,SOLID_ARROW_BOTTOM:82,STICK_ARROW_TOP:83,STICK_ARROW_BOTTOM:84,SOLID_ARROW_TOP_DOTTED:85,SOLID_ARROW_BOTTOM_DOTTED:86,STICK_ARROW_TOP_DOTTED:87,STICK_ARROW_BOTTOM_DOTTED:88,SOLID_ARROW_TOP_REVERSE:89,SOLID_ARROW_BOTTOM_REVERSE:90,STICK_ARROW_TOP_REVERSE:91,STICK_ARROW_BOTTOM_REVERSE:92,SOLID_ARROW_TOP_REVERSE_DOTTED:93,SOLID_ARROW_BOTTOM_REVERSE_DOTTED:94,STICK_ARROW_TOP_REVERSE_DOTTED:95,STICK_ARROW_BOTTOM_REVERSE_DOTTED:96,BIDIRECTIONAL_SOLID_ARROW:97,DOTTED_ARROW:98,BIDIRECTIONAL_DOTTED_ARROW:99,SOLID_CROSS:100,DOTTED_CROSS:101,SOLID_POINT:102,DOTTED_POINT:103,TXT:104,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NEWLINE",6:"SD",10:"INVALID",14:"create",15:"box",16:"restOfLine",17:"end",19:"autonumber",20:"NUM",21:"off",22:"activate",24:"deactivate",30:"title",31:"legacy_title",32:"acc_title",33:"acc_title_value",34:"acc_descr",35:"acc_descr_value",36:"acc_descr_multiline_value",37:"loop",38:"rect",39:"opt",40:"alt",42:"par",44:"par_over",45:"critical",47:"break",48:"option",49:"and",50:"else",51:"participant",52:"AS",53:"participant_actor",54:"destroy",56:"note",59:"over",61:"links",62:"link",63:"properties",64:"details",66:",",67:"left_of",68:"right_of",70:"+",71:"-",72:"()",73:"ACTOR",75:"CONFIG_START",76:"CONFIG_CONTENT",77:"CONFIG_END",78:"SOLID_OPEN_ARROW",79:"DOTTED_OPEN_ARROW",80:"SOLID_ARROW",81:"SOLID_ARROW_TOP",82:"SOLID_ARROW_BOTTOM",83:"STICK_ARROW_TOP",84:"STICK_ARROW_BOTTOM",85:"SOLID_ARROW_TOP_DOTTED",86:"SOLID_ARROW_BOTTOM_DOTTED",87:"STICK_ARROW_TOP_DOTTED",88:"STICK_ARROW_BOTTOM_DOTTED",89:"SOLID_ARROW_TOP_REVERSE",90:"SOLID_ARROW_BOTTOM_REVERSE",91:"STICK_ARROW_TOP_REVERSE",92:"STICK_ARROW_BOTTOM_REVERSE",93:"SOLID_ARROW_TOP_REVERSE_DOTTED",94:"SOLID_ARROW_BOTTOM_REVERSE_DOTTED",95:"STICK_ARROW_TOP_REVERSE_DOTTED",96:"STICK_ARROW_BOTTOM_REVERSE_DOTTED",97:"BIDIRECTIONAL_SOLID_ARROW",98:"DOTTED_ARROW",99:"BIDIRECTIONAL_DOTTED_ARROW",100:"SOLID_CROSS",101:"DOTTED_CROSS",102:"SOLID_POINT",103:"DOTTED_POINT",104:"TXT"},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[8,1],[11,0],[11,2],[12,2],[12,1],[12,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],[46,1],[46,4],[43,1],[43,4],[41,1],[41,4],[13,5],[13,3],[13,5],[13,3],[13,3],[13,5],[13,3],[13,5],[13,3],[25,4],[25,4],[26,3],[27,3],[28,3],[29,3],[65,2],[65,1],[60,3],[60,1],[57,1],[57,1],[18,5],[18,5],[18,5],[18,5],[18,6],[18,4],[55,2],[74,3],[23,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[58,1]],performAction:T(function(qe,Le,Xe,Ie,it,we,ct){var be=we.length-1;switch(it){case 3:return Ie.apply(we[be]),we[be];case 4:case 10:this.$=[];break;case 5:case 11:we[be-1].push(we[be]),this.$=we[be-1];break;case 6:case 7:case 12:case 13:this.$=we[be];break;case 8:case 9:case 14:this.$=[];break;case 16:we[be].type="createParticipant",this.$=we[be];break;case 17:we[be-1].unshift({type:"boxStart",boxData:Ie.parseBoxData(we[be-2])}),we[be-1].push({type:"boxEnd",boxText:we[be-2]}),this.$=we[be-1];break;case 19:this.$={type:"sequenceIndex",sequenceIndex:Number(we[be-2]),sequenceIndexStep:Number(we[be-1]),sequenceVisible:!0,signalType:Ie.LINETYPE.AUTONUMBER};break;case 20:this.$={type:"sequenceIndex",sequenceIndex:Number(we[be-1]),sequenceIndexStep:1,sequenceVisible:!0,signalType:Ie.LINETYPE.AUTONUMBER};break;case 21:this.$={type:"sequenceIndex",sequenceVisible:!1,signalType:Ie.LINETYPE.AUTONUMBER};break;case 22:this.$={type:"sequenceIndex",sequenceVisible:!0,signalType:Ie.LINETYPE.AUTONUMBER};break;case 23:this.$={type:"activeStart",signalType:Ie.LINETYPE.ACTIVE_START,actor:we[be-1].actor};break;case 24:this.$={type:"activeEnd",signalType:Ie.LINETYPE.ACTIVE_END,actor:we[be-1].actor};break;case 30:Ie.setDiagramTitle(we[be].substring(6)),this.$=we[be].substring(6);break;case 31:Ie.setDiagramTitle(we[be].substring(7)),this.$=we[be].substring(7);break;case 32:this.$=we[be].trim(),Ie.setAccTitle(this.$);break;case 33:case 34:this.$=we[be].trim(),Ie.setAccDescription(this.$);break;case 35:we[be-1].unshift({type:"loopStart",loopText:Ie.parseMessage(we[be-2]),signalType:Ie.LINETYPE.LOOP_START}),we[be-1].push({type:"loopEnd",loopText:we[be-2],signalType:Ie.LINETYPE.LOOP_END}),this.$=we[be-1];break;case 36:we[be-1].unshift({type:"rectStart",color:Ie.parseMessage(we[be-2]),signalType:Ie.LINETYPE.RECT_START}),we[be-1].push({type:"rectEnd",color:Ie.parseMessage(we[be-2]),signalType:Ie.LINETYPE.RECT_END}),this.$=we[be-1];break;case 37:we[be-1].unshift({type:"optStart",optText:Ie.parseMessage(we[be-2]),signalType:Ie.LINETYPE.OPT_START}),we[be-1].push({type:"optEnd",optText:Ie.parseMessage(we[be-2]),signalType:Ie.LINETYPE.OPT_END}),this.$=we[be-1];break;case 38:we[be-1].unshift({type:"altStart",altText:Ie.parseMessage(we[be-2]),signalType:Ie.LINETYPE.ALT_START}),we[be-1].push({type:"altEnd",signalType:Ie.LINETYPE.ALT_END}),this.$=we[be-1];break;case 39:we[be-1].unshift({type:"parStart",parText:Ie.parseMessage(we[be-2]),signalType:Ie.LINETYPE.PAR_START}),we[be-1].push({type:"parEnd",signalType:Ie.LINETYPE.PAR_END}),this.$=we[be-1];break;case 40:we[be-1].unshift({type:"parStart",parText:Ie.parseMessage(we[be-2]),signalType:Ie.LINETYPE.PAR_OVER_START}),we[be-1].push({type:"parEnd",signalType:Ie.LINETYPE.PAR_END}),this.$=we[be-1];break;case 41:we[be-1].unshift({type:"criticalStart",criticalText:Ie.parseMessage(we[be-2]),signalType:Ie.LINETYPE.CRITICAL_START}),we[be-1].push({type:"criticalEnd",signalType:Ie.LINETYPE.CRITICAL_END}),this.$=we[be-1];break;case 42:we[be-1].unshift({type:"breakStart",breakText:Ie.parseMessage(we[be-2]),signalType:Ie.LINETYPE.BREAK_START}),we[be-1].push({type:"breakEnd",optText:Ie.parseMessage(we[be-2]),signalType:Ie.LINETYPE.BREAK_END}),this.$=we[be-1];break;case 44:this.$=we[be-3].concat([{type:"option",optionText:Ie.parseMessage(we[be-1]),signalType:Ie.LINETYPE.CRITICAL_OPTION},we[be]]);break;case 46:this.$=we[be-3].concat([{type:"and",parText:Ie.parseMessage(we[be-1]),signalType:Ie.LINETYPE.PAR_AND},we[be]]);break;case 48:this.$=we[be-3].concat([{type:"else",altText:Ie.parseMessage(we[be-1]),signalType:Ie.LINETYPE.ALT_ELSE},we[be]]);break;case 49:we[be-3].draw="participant",we[be-3].type="addParticipant",we[be-3].description=Ie.parseMessage(we[be-1]),this.$=we[be-3];break;case 50:we[be-1].draw="participant",we[be-1].type="addParticipant",this.$=we[be-1];break;case 51:we[be-3].draw="actor",we[be-3].type="addParticipant",we[be-3].description=Ie.parseMessage(we[be-1]),this.$=we[be-3];break;case 52:case 57:we[be-1].draw="actor",we[be-1].type="addParticipant",this.$=we[be-1];break;case 53:we[be-1].type="destroyParticipant",this.$=we[be-1];break;case 54:we[be-3].draw="participant",we[be-3].type="addParticipant",we[be-3].description=Ie.parseMessage(we[be-1]),this.$=we[be-3];break;case 55:we[be-1].draw="participant",we[be-1].type="addParticipant",this.$=we[be-1];break;case 56:we[be-3].draw="actor",we[be-3].type="addParticipant",we[be-3].description=Ie.parseMessage(we[be-1]),this.$=we[be-3];break;case 58:this.$=[we[be-1],{type:"addNote",placement:we[be-2],actor:we[be-1].actor,text:we[be]}];break;case 59:we[be-2]=[].concat(we[be-1],we[be-1]).slice(0,2),we[be-2][0]=we[be-2][0].actor,we[be-2][1]=we[be-2][1].actor,this.$=[we[be-1],{type:"addNote",placement:Ie.PLACEMENT.OVER,actor:we[be-2].slice(0,2),text:we[be]}];break;case 60:this.$=[we[be-1],{type:"addLinks",actor:we[be-1].actor,text:we[be]}];break;case 61:this.$=[we[be-1],{type:"addALink",actor:we[be-1].actor,text:we[be]}];break;case 62:this.$=[we[be-1],{type:"addProperties",actor:we[be-1].actor,text:we[be]}];break;case 63:this.$=[we[be-1],{type:"addDetails",actor:we[be-1].actor,text:we[be]}];break;case 66:this.$=[we[be-2],we[be]];break;case 67:this.$=we[be];break;case 68:this.$=Ie.PLACEMENT.LEFTOF;break;case 69:this.$=Ie.PLACEMENT.RIGHTOF;break;case 70:this.$=[we[be-4],we[be-1],{type:"addMessage",from:we[be-4].actor,to:we[be-1].actor,signalType:we[be-3],msg:we[be],activate:!0},{type:"activeStart",signalType:Ie.LINETYPE.ACTIVE_START,actor:we[be-1].actor}];break;case 71:this.$=[we[be-4],we[be-1],{type:"addMessage",from:we[be-4].actor,to:we[be-1].actor,signalType:we[be-3],msg:we[be]},{type:"activeEnd",signalType:Ie.LINETYPE.ACTIVE_END,actor:we[be-4].actor}];break;case 72:this.$=[we[be-4],we[be-1],{type:"addMessage",from:we[be-4].actor,to:we[be-1].actor,signalType:we[be-3],msg:we[be],activate:!0,centralConnection:Ie.LINETYPE.CENTRAL_CONNECTION},{type:"centralConnection",signalType:Ie.LINETYPE.CENTRAL_CONNECTION,actor:we[be-1].actor}];break;case 73:this.$=[we[be-4],we[be-1],{type:"addMessage",from:we[be-4].actor,to:we[be-1].actor,signalType:we[be-2],msg:we[be],activate:!1,centralConnection:Ie.LINETYPE.CENTRAL_CONNECTION_REVERSE},{type:"centralConnectionReverse",signalType:Ie.LINETYPE.CENTRAL_CONNECTION_REVERSE,actor:we[be-4].actor}];break;case 74:this.$=[we[be-5],we[be-1],{type:"addMessage",from:we[be-5].actor,to:we[be-1].actor,signalType:we[be-3],msg:we[be],activate:!0,centralConnection:Ie.LINETYPE.CENTRAL_CONNECTION_DUAL},{type:"centralConnection",signalType:Ie.LINETYPE.CENTRAL_CONNECTION,actor:we[be-1].actor},{type:"centralConnectionReverse",signalType:Ie.LINETYPE.CENTRAL_CONNECTION_REVERSE,actor:we[be-5].actor}];break;case 75:this.$=[we[be-3],we[be-1],{type:"addMessage",from:we[be-3].actor,to:we[be-1].actor,signalType:we[be-2],msg:we[be]}];break;case 76:this.$={type:"addParticipant",actor:we[be-1],config:we[be]};break;case 77:this.$=we[be-1].trim();break;case 78:this.$={type:"addParticipant",actor:we[be]};break;case 79:this.$=Ie.LINETYPE.SOLID_OPEN;break;case 80:this.$=Ie.LINETYPE.DOTTED_OPEN;break;case 81:this.$=Ie.LINETYPE.SOLID;break;case 82:this.$=Ie.LINETYPE.SOLID_TOP;break;case 83:this.$=Ie.LINETYPE.SOLID_BOTTOM;break;case 84:this.$=Ie.LINETYPE.STICK_TOP;break;case 85:this.$=Ie.LINETYPE.STICK_BOTTOM;break;case 86:this.$=Ie.LINETYPE.SOLID_TOP_DOTTED;break;case 87:this.$=Ie.LINETYPE.SOLID_BOTTOM_DOTTED;break;case 88:this.$=Ie.LINETYPE.STICK_TOP_DOTTED;break;case 89:this.$=Ie.LINETYPE.STICK_BOTTOM_DOTTED;break;case 90:this.$=Ie.LINETYPE.SOLID_ARROW_TOP_REVERSE;break;case 91:this.$=Ie.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE;break;case 92:this.$=Ie.LINETYPE.STICK_ARROW_TOP_REVERSE;break;case 93:this.$=Ie.LINETYPE.STICK_ARROW_BOTTOM_REVERSE;break;case 94:this.$=Ie.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED;break;case 95:this.$=Ie.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED;break;case 96:this.$=Ie.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED;break;case 97:this.$=Ie.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED;break;case 98:this.$=Ie.LINETYPE.BIDIRECTIONAL_SOLID;break;case 99:this.$=Ie.LINETYPE.DOTTED;break;case 100:this.$=Ie.LINETYPE.BIDIRECTIONAL_DOTTED;break;case 101:this.$=Ie.LINETYPE.SOLID_CROSS;break;case 102:this.$=Ie.LINETYPE.DOTTED_CROSS;break;case 103:this.$=Ie.LINETYPE.SOLID_POINT;break;case 104:this.$=Ie.LINETYPE.DOTTED_POINT;break;case 105:this.$=Ie.parseMessage(we[be].trim().substring(1));break}},"anonymous"),table:[{3:1,4:e,5:r,6:n},{1:[3]},{3:5,4:e,5:r,6:n},{3:6,4:e,5:r,6:n},t([1,4,5,10,14,15,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,51,53,54,56,61,62,63,64,73],i,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:a,5:s,8:8,9:10,10:o,13:13,14:l,15:u,18:16,19:h,22:d,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:g,32:m,34:y,36:v,37:x,38:b,39:w,40:C,42:_,44:k,45:S,47:L,51:$,53:I,54:z,56:F,61:A,62:R,63:N,64:M,73:D},t(O,[2,5]),{9:48,13:13,14:l,15:u,18:16,19:h,22:d,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:g,32:m,34:y,36:v,37:x,38:b,39:w,40:C,42:_,44:k,45:S,47:L,51:$,53:I,54:z,56:F,61:A,62:R,63:N,64:M,73:D},t(O,[2,7]),t(O,[2,8]),t(O,[2,9]),t(O,[2,15]),{13:49,51:$,53:I,54:z},{16:[1,50]},{5:[1,51]},{5:[1,54],20:[1,52],21:[1,53]},{23:55,73:D},{23:56,73:D},{5:[1,57]},{5:[1,58]},{5:[1,59]},{5:[1,60]},{5:[1,61]},t(O,[2,30]),t(O,[2,31]),{33:[1,62]},{35:[1,63]},t(O,[2,34]),{16:[1,64]},{16:[1,65]},{16:[1,66]},{16:[1,67]},{16:[1,68]},{16:[1,69]},{16:[1,70]},{16:[1,71]},{23:72,55:73,73:B},{23:75,55:76,73:B},{23:77,73:D},{69:78,72:[1,79],78:P,79:G,80:V,81:H,82:W,83:ie,84:j,85:ae,86:J,87:K,88:Q,89:re,90:le,91:fe,92:Ae,93:Se,94:Ne,95:ge,96:ve,97:ze,98:xe,99:Ke,100:Ce,101:Ve,102:Qe,103:nt},{57:106,59:[1,107],67:[1,108],68:[1,109]},{23:110,73:D},{23:111,73:D},{23:112,73:D},{23:113,73:D},t([5,66,72,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104],tt),t(O,[2,6]),t(O,[2,16]),t(Ze,[2,10],{11:114}),t(O,[2,18]),{5:[1,116],20:[1,115]},{5:[1,117]},t(O,[2,22]),{5:[1,118]},{5:[1,119]},t(O,[2,25]),t(O,[2,26]),t(O,[2,27]),t(O,[2,28]),t(O,[2,29]),t(O,[2,32]),t(O,[2,33]),t(ke,i,{7:120}),t(ke,i,{7:121}),t(ke,i,{7:122}),t(_e,i,{41:123,7:124}),t(Y,i,{43:125,7:126}),t(Y,i,{7:126,43:127}),t(he,i,{46:128,7:129}),t(ke,i,{7:130}),{5:[1,132],52:[1,131]},{5:[1,134],52:[1,133]},t(Z,tt,{74:135,75:[1,136]}),{5:[1,138],52:[1,137]},{5:[1,140],52:[1,139]},{5:[1,141]},{23:145,70:[1,142],71:[1,143],72:[1,144],73:D},{69:146,78:P,79:G,80:V,81:H,82:W,83:ie,84:j,85:ae,86:J,87:K,88:Q,89:re,90:le,91:fe,92:Ae,93:Se,94:Ne,95:ge,96:ve,97:ze,98:xe,99:Ke,100:Ce,101:Ve,102:Qe,103:nt},t(pe,[2,79]),t(pe,[2,80]),t(pe,[2,81]),t(pe,[2,82]),t(pe,[2,83]),t(pe,[2,84]),t(pe,[2,85]),t(pe,[2,86]),t(pe,[2,87]),t(pe,[2,88]),t(pe,[2,89]),t(pe,[2,90]),t(pe,[2,91]),t(pe,[2,92]),t(pe,[2,93]),t(pe,[2,94]),t(pe,[2,95]),t(pe,[2,96]),t(pe,[2,97]),t(pe,[2,98]),t(pe,[2,99]),t(pe,[2,100]),t(pe,[2,101]),t(pe,[2,102]),t(pe,[2,103]),t(pe,[2,104]),{23:147,73:D},{23:149,60:148,73:D},{73:[2,68]},{73:[2,69]},{58:150,104:ne},{58:152,104:ne},{58:153,104:ne},{58:154,104:ne},{4:[1,157],5:[1,159],12:156,13:158,17:[1,155],51:$,53:I,54:z},{5:[1,160]},t(O,[2,20]),t(O,[2,21]),t(O,[2,23]),t(O,[2,24]),{4:a,5:s,8:8,9:10,10:o,13:13,14:l,15:u,17:[1,161],18:16,19:h,22:d,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:g,32:m,34:y,36:v,37:x,38:b,39:w,40:C,42:_,44:k,45:S,47:L,51:$,53:I,54:z,56:F,61:A,62:R,63:N,64:M,73:D},{4:a,5:s,8:8,9:10,10:o,13:13,14:l,15:u,17:[1,162],18:16,19:h,22:d,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:g,32:m,34:y,36:v,37:x,38:b,39:w,40:C,42:_,44:k,45:S,47:L,51:$,53:I,54:z,56:F,61:A,62:R,63:N,64:M,73:D},{4:a,5:s,8:8,9:10,10:o,13:13,14:l,15:u,17:[1,163],18:16,19:h,22:d,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:g,32:m,34:y,36:v,37:x,38:b,39:w,40:C,42:_,44:k,45:S,47:L,51:$,53:I,54:z,56:F,61:A,62:R,63:N,64:M,73:D},{17:[1,164]},{4:a,5:s,8:8,9:10,10:o,13:13,14:l,15:u,17:[2,47],18:16,19:h,22:d,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:g,32:m,34:y,36:v,37:x,38:b,39:w,40:C,42:_,44:k,45:S,47:L,50:[1,165],51:$,53:I,54:z,56:F,61:A,62:R,63:N,64:M,73:D},{17:[1,166]},{4:a,5:s,8:8,9:10,10:o,13:13,14:l,15:u,17:[2,45],18:16,19:h,22:d,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:g,32:m,34:y,36:v,37:x,38:b,39:w,40:C,42:_,44:k,45:S,47:L,49:[1,167],51:$,53:I,54:z,56:F,61:A,62:R,63:N,64:M,73:D},{17:[1,168]},{17:[1,169]},{4:a,5:s,8:8,9:10,10:o,13:13,14:l,15:u,17:[2,43],18:16,19:h,22:d,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:g,32:m,34:y,36:v,37:x,38:b,39:w,40:C,42:_,44:k,45:S,47:L,48:[1,170],51:$,53:I,54:z,56:F,61:A,62:R,63:N,64:M,73:D},{4:a,5:s,8:8,9:10,10:o,13:13,14:l,15:u,17:[1,171],18:16,19:h,22:d,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:g,32:m,34:y,36:v,37:x,38:b,39:w,40:C,42:_,44:k,45:S,47:L,51:$,53:I,54:z,56:F,61:A,62:R,63:N,64:M,73:D},{16:[1,172]},t(O,[2,50]),{16:[1,173]},t(O,[2,55]),t(Z,[2,76]),{76:[1,174]},{16:[1,175]},t(O,[2,52]),{16:[1,176]},t(O,[2,57]),t(O,[2,53]),{23:177,73:D},{23:178,73:D},{23:179,73:D},{58:180,104:ne},{23:181,72:[1,182],73:D},{58:183,104:ne},{58:184,104:ne},{66:[1,185],104:[2,67]},{5:[2,60]},{5:[2,105]},{5:[2,61]},{5:[2,62]},{5:[2,63]},t(O,[2,17]),t(Ze,[2,11]),{13:186,51:$,53:I,54:z},t(Ze,[2,13]),t(Ze,[2,14]),t(O,[2,19]),t(O,[2,35]),t(O,[2,36]),t(O,[2,37]),t(O,[2,38]),{16:[1,187]},t(O,[2,39]),{16:[1,188]},t(O,[2,40]),t(O,[2,41]),{16:[1,189]},t(O,[2,42]),{5:[1,190]},{5:[1,191]},{77:[1,192]},{5:[1,193]},{5:[1,194]},{58:195,104:ne},{58:196,104:ne},{58:197,104:ne},{5:[2,75]},{58:198,104:ne},{23:199,73:D},{5:[2,58]},{5:[2,59]},{23:200,73:D},t(Ze,[2,12]),t(_e,i,{7:124,41:201}),t(Y,i,{7:126,43:202}),t(he,i,{7:129,46:203}),t(O,[2,49]),t(O,[2,54]),t(Z,[2,77]),t(O,[2,51]),t(O,[2,56]),{5:[2,70]},{5:[2,71]},{5:[2,72]},{5:[2,73]},{58:204,104:ne},{104:[2,66]},{17:[2,48]},{17:[2,46]},{17:[2,44]},{5:[2,74]}],defaultActions:{5:[2,1],6:[2,2],108:[2,68],109:[2,69],150:[2,60],151:[2,105],152:[2,61],153:[2,62],154:[2,63],180:[2,75],183:[2,58],184:[2,59],195:[2,70],196:[2,71],197:[2,72],198:[2,73],200:[2,66],201:[2,48],202:[2,46],203:[2,44],204:[2,74]},parseError:T(function(qe,Le){if(Le.recoverable)this.trace(qe);else{var Xe=new Error(qe);throw Xe.hash=Le,Xe}},"parseError"),parse:T(function(qe){var Le=this,Xe=[0],Ie=[],it=[null],we=[],ct=this.table,be="",_t=0,bt=0,lt=2,Mt=1,Tt=we.slice.call(arguments,1),dt=Object.create(this.lexer),oe={yy:{}};for(var Rt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Rt)&&(oe.yy[Rt]=this.yy[Rt]);dt.setInput(qe,oe.yy),oe.yy.lexer=dt,oe.yy.parser=this,typeof dt.yylloc>"u"&&(dt.yylloc={});var ft=dt.yylloc;we.push(ft);var ht=dt.options&&dt.options.ranges;typeof oe.yy.parseError=="function"?this.parseError=oe.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function kt(ir){Xe.length=Xe.length-2*ir,it.length=it.length-ir,we.length=we.length-ir}T(kt,"popStack");function qr(){var ir;return ir=Ie.pop()||dt.lex()||Mt,typeof ir!="number"&&(ir instanceof Array&&(Ie=ir,ir=Ie.pop()),ir=Le.symbols_[ir]||ir),ir}T(qr,"lex");for(var ye,et,ut,Lt,Vt={},lr,cr,$r,dr;;){if(et=Xe[Xe.length-1],this.defaultActions[et]?ut=this.defaultActions[et]:((ye===null||typeof ye>"u")&&(ye=qr()),ut=ct[et]&&ct[et][ye]),typeof ut>"u"||!ut.length||!ut[0]){var Or="";dr=[];for(lr in ct[et])this.terminals_[lr]&&lr>lt&&dr.push("'"+this.terminals_[lr]+"'");dt.showPosition?Or="Parse error on line "+(_t+1)+`: +`+dt.showPosition()+` +Expecting `+dr.join(", ")+", got '"+(this.terminals_[ye]||ye)+"'":Or="Parse error on line "+(_t+1)+": Unexpected "+(ye==Mt?"end of input":"'"+(this.terminals_[ye]||ye)+"'"),this.parseError(Or,{text:dt.match,token:this.terminals_[ye]||ye,line:dt.yylineno,loc:ft,expected:dr})}if(ut[0]instanceof Array&&ut.length>1)throw new Error("Parse Error: multiple actions possible at state: "+et+", token: "+ye);switch(ut[0]){case 1:Xe.push(ye),it.push(dt.yytext),we.push(dt.yylloc),Xe.push(ut[1]),ye=null,bt=dt.yyleng,be=dt.yytext,_t=dt.yylineno,ft=dt.yylloc;break;case 2:if(cr=this.productions_[ut[1]][1],Vt.$=it[it.length-cr],Vt._$={first_line:we[we.length-(cr||1)].first_line,last_line:we[we.length-1].last_line,first_column:we[we.length-(cr||1)].first_column,last_column:we[we.length-1].last_column},ht&&(Vt._$.range=[we[we.length-(cr||1)].range[0],we[we.length-1].range[1]]),Lt=this.performAction.apply(Vt,[be,bt,_t,oe.yy,ut[1],it,we].concat(Tt)),typeof Lt<"u")return Lt;cr&&(Xe=Xe.slice(0,-1*cr*2),it=it.slice(0,-1*cr),we=we.slice(0,-1*cr)),Xe.push(this.productions_[ut[1]][0]),it.push(Vt.$),we.push(Vt._$),$r=ct[Xe[Xe.length-2]][Xe[Xe.length-1]],Xe.push($r);break;case 3:return!0}}return!0},"parse")},Te=(function(){var De={EOF:1,parseError:T(function(Le,Xe){if(this.yy.parser)this.yy.parser.parseError(Le,Xe);else throw new Error(Le)},"parseError"),setInput:T(function(qe,Le){return this.yy=Le||this.yy||{},this._input=qe,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:T(function(){var qe=this._input[0];this.yytext+=qe,this.yyleng++,this.offset++,this.match+=qe,this.matched+=qe;var Le=qe.match(/(?:\r\n?|\n).*/g);return Le?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),qe},"input"),unput:T(function(qe){var Le=qe.length,Xe=qe.split(/(?:\r\n?|\n)/g);this._input=qe+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-Le),this.offset-=Le;var Ie=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),Xe.length-1&&(this.yylineno-=Xe.length-1);var it=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:Xe?(Xe.length===Ie.length?this.yylloc.first_column:0)+Ie[Ie.length-Xe.length].length-Xe[0].length:this.yylloc.first_column-Le},this.options.ranges&&(this.yylloc.range=[it[0],it[0]+this.yyleng-Le]),this.yyleng=this.yytext.length,this},"unput"),more:T(function(){return this._more=!0,this},"more"),reject:T(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). +`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:T(function(qe){this.unput(this.match.slice(qe))},"less"),pastInput:T(function(){var qe=this.matched.substr(0,this.matched.length-this.match.length);return(qe.length>20?"...":"")+qe.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:T(function(){var qe=this.match;return qe.length<20&&(qe+=this._input.substr(0,20-qe.length)),(qe.substr(0,20)+(qe.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:T(function(){var qe=this.pastInput(),Le=new Array(qe.length+1).join("-");return qe+this.upcomingInput()+` +`+Le+"^"},"showPosition"),test_match:T(function(qe,Le){var Xe,Ie,it;if(this.options.backtrack_lexer&&(it={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&&(it.yylloc.range=this.yylloc.range.slice(0))),Ie=qe[0].match(/(?:\r\n?|\n).*/g),Ie&&(this.yylineno+=Ie.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:Ie?Ie[Ie.length-1].length-Ie[Ie.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+qe[0].length},this.yytext+=qe[0],this.match+=qe[0],this.matches=qe,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(qe[0].length),this.matched+=qe[0],Xe=this.performAction.call(this,this.yy,this,Le,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),Xe)return Xe;if(this._backtrack){for(var we in it)this[we]=it[we];return!1}return!1},"test_match"),next:T(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var qe,Le,Xe,Ie;this._more||(this.yytext="",this.match="");for(var it=this._currentRules(),we=0;weLe[0].length)){if(Le=Xe,Ie=we,this.options.backtrack_lexer){if(qe=this.test_match(Xe,it[we]),qe!==!1)return qe;if(this._backtrack){Le=!1;continue}else return!1}else if(!this.options.flex)break}return Le?(qe=this.test_match(Le,it[Ie]),qe!==!1?qe:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:T(function(){var Le=this.next();return Le||this.lex()},"lex"),begin:T(function(Le){this.conditionStack.push(Le)},"begin"),popState:T(function(){var Le=this.conditionStack.length-1;return Le>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:T(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:T(function(Le){return Le=this.conditionStack.length-1-Math.abs(Le||0),Le>=0?this.conditionStack[Le]:"INITIAL"},"topState"),pushState:T(function(Le){this.begin(Le)},"pushState"),stateStackSize:T(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:T(function(Le,Xe,Ie,it){switch(Ie){case 0:return 5;case 1:break;case 2:break;case 3:break;case 4:break;case 5:break;case 6:return 20;case 7:return this.begin("CONFIG"),75;case 8:return 76;case 9:return this.popState(),this.begin("ALIAS"),77;case 10:return this.popState(),this.popState(),77;case 11:return Xe.yytext=Xe.yytext.trim(),73;case 12:return Xe.yytext=Xe.yytext.trim(),this.begin("ALIAS"),73;case 13:return Xe.yytext=Xe.yytext.trim(),this.popState(),73;case 14:return this.popState(),10;case 15:return Xe.yytext=Xe.yytext.trim(),this.popState(),10;case 16:return this.begin("LINE"),15;case 17:return this.begin("ID"),51;case 18:return this.begin("ID"),53;case 19:return 14;case 20:return this.begin("ID"),54;case 21:return this.popState(),this.popState(),this.begin("LINE"),52;case 22:return this.popState(),this.popState(),5;case 23:return this.begin("LINE"),37;case 24:return this.begin("LINE"),38;case 25:return this.begin("LINE"),39;case 26:return this.begin("LINE"),40;case 27:return this.begin("LINE"),50;case 28:return this.begin("LINE"),42;case 29:return this.begin("LINE"),44;case 30:return this.begin("LINE"),49;case 31:return this.begin("LINE"),45;case 32:return this.begin("LINE"),48;case 33:return this.begin("LINE"),47;case 34:return this.popState(),16;case 35:return 17;case 36:return 67;case 37:return 68;case 38:return 61;case 39:return 62;case 40:return 63;case 41:return 64;case 42:return 59;case 43:return 56;case 44:return this.begin("ID"),22;case 45:return this.begin("ID"),24;case 46:return 30;case 47:return 31;case 48:return this.begin("acc_title"),32;case 49:return this.popState(),"acc_title_value";case 50:return this.begin("acc_descr"),34;case 51:return this.popState(),"acc_descr_value";case 52:this.begin("acc_descr_multiline");break;case 53:this.popState();break;case 54:return"acc_descr_multiline_value";case 55:return 6;case 56:return 19;case 57:return 21;case 58:return 66;case 59:return 5;case 60:return Xe.yytext=Xe.yytext.trim(),73;case 61:return 80;case 62:return 97;case 63:return 98;case 64:return 99;case 65:return 78;case 66:return 79;case 67:return 100;case 68:return 101;case 69:return 102;case 70:return 103;case 71:return 85;case 72:return 86;case 73:return 87;case 74:return 88;case 75:return 93;case 76:return 94;case 77:return 95;case 78:return 96;case 79:return 81;case 80:return 82;case 81:return 83;case 82:return 84;case 83:return 89;case 84:return 90;case 85:return 91;case 86:return 92;case 87:return 104;case 88:return 104;case 89:return 70;case 90:return 71;case 91:return 72;case 92:return 5;case 93:return 10}},"anonymous"),rules:[/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:([0-9]+(\.[0-9]{1,2})?|\.[0-9]{1,2})(?=[ \n]+))/i,/^(?:@\{)/i,/^(?:[^\}]+)/i,/^(?:\}(?=\s+as\s))/i,/^(?:\})/i,/^(?:[^\<->\->:\n,;@\s]+(?=@\{))/i,/^(?:[^<>:\n,;@\s]+(?=\s+as\s))/i,/^(?:[^<>:\n,;@]+(?=\s*[\n;#]|$))/i,/^(?:[^<>:\n,;@]*<[^\n]*)/i,/^(?:[^\n]+)/i,/^(?:box\b)/i,/^(?:participant\b)/i,/^(?:actor\b)/i,/^(?:create\b)/i,/^(?:destroy\b)/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,/^(?:--\|\\)/i,/^(?:--\|\/)/i,/^(?:--\\\\)/i,/^(?:--\/\/)/i,/^(?:\/\|--)/i,/^(?:\\\|--)/i,/^(?:\/\/--)/i,/^(?:\\\\--)/i,/^(?:-\|\\)/i,/^(?:-\|\/)/i,/^(?:-\\\\)/i,/^(?:-\/\/)/i,/^(?:\/\|-)/i,/^(?:\\\|-)/i,/^(?:\/\/-)/i,/^(?:\\\\-)/i,/^(?::(?:(?:no)?wrap)?[^#\n;]*)/i,/^(?::)/i,/^(?:\+)/i,/^(?:-)/i,/^(?:\(\))/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[53,54],inclusive:!1},acc_descr:{rules:[51],inclusive:!1},acc_title:{rules:[49],inclusive:!1},ID:{rules:[2,3,7,11,12,13,14,15],inclusive:!1},ALIAS:{rules:[2,3,21,22],inclusive:!1},LINE:{rules:[2,3,34],inclusive:!1},CONFIG:{rules:[8,9,10],inclusive:!1},CONFIG_DATA:{rules:[],inclusive:!1},INITIAL:{rules:[0,1,3,4,5,6,16,17,18,19,20,23,24,25,26,27,28,29,30,31,32,33,35,36,37,38,39,40,41,42,43,44,45,46,47,48,50,52,55,56,57,58,59,60,61,62,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],inclusive:!0}}};return De})();Be.lexer=Te;function Ue(){this.yy={}}return T(Ue,"Parser"),Ue.prototype=Be,Be.Parser=Ue,new Ue})();Kz.parser=Kz;var g1t=Kz,m1t={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,SOLID_TOP:41,SOLID_BOTTOM:42,STICK_TOP:43,STICK_BOTTOM:44,SOLID_ARROW_TOP_REVERSE:45,SOLID_ARROW_BOTTOM_REVERSE:46,STICK_ARROW_TOP_REVERSE:47,STICK_ARROW_BOTTOM_REVERSE:48,SOLID_TOP_DOTTED:51,SOLID_BOTTOM_DOTTED:52,STICK_TOP_DOTTED:53,STICK_BOTTOM_DOTTED:54,SOLID_ARROW_TOP_REVERSE_DOTTED:55,SOLID_ARROW_BOTTOM_REVERSE_DOTTED:56,STICK_ARROW_TOP_REVERSE_DOTTED:57,STICK_ARROW_BOTTOM_REVERSE_DOTTED:58,CENTRAL_CONNECTION:59,CENTRAL_CONNECTION_REVERSE:60,CENTRAL_CONNECTION_DUAL:61},y1t={FILLED:0,OPEN:1},v1t={LEFTOF:0,RIGHTOF:1,OVER:2},TA={ACTOR:"actor",CONTROL:"control",DATABASE:"database",ENTITY:"entity"},b1t=(bb=class{constructor(){this.state=new ZN(()=>({prevActor:void 0,actors:new Map,createdActors:new Map,destroyedActors:new Map,boxes:[],messages:[],notes:[],sequenceNumbersEnabled:!1,wrapEnabled:void 0,currentBox:void 0,lastCreated:void 0,lastDestroyed:void 0})),this.setAccTitle=Yn,this.setAccDescription=ai,this.setDiagramTitle=oi,this.getAccTitle=ii,this.getAccDescription=si,this.getDiagramTitle=Xn,this.apply=this.apply.bind(this),this.parseBoxData=this.parseBoxData.bind(this),this.parseMessage=this.parseMessage.bind(this),this.clear(),this.setWrap(Pe().wrap),this.LINETYPE=m1t,this.ARROWTYPE=y1t,this.PLACEMENT=v1t}addBox(e){this.state.records.boxes.push({name:e.text,wrap:e.wrap??this.autoWrap(),fill:e.color,actorKeys:[]}),this.state.records.currentBox=this.state.records.boxes.slice(-1)[0]}addActor(e,r,n,i,a){let s=this.state.records.currentBox,o;if(a!==void 0){let u;a.includes(` `)?u=a+` `:u=`{ `+a+` -}`,o=_4(u,{schema:A4})}i=(o==null?void 0:o.type)??i,o!=null&&o.alias&&(!n||n.text===r)&&(n={text:o.alias,wrap:n==null?void 0:n.wrap,type:i});const l=this.state.records.actors.get(e);if(l){if(this.state.records.currentBox&&l.box&&this.state.records.currentBox!==l.box)throw new Error(`A same participant should only be defined in one Box: ${l.name} can't be in '${l.box.name}' and in '${this.state.records.currentBox.name}' at the same time.`);if(s=l.box?l.box:this.state.records.currentBox,l.box=s,l&&r===l.name&&n==null)return}if((n==null?void 0:n.text)==null&&(n={text:r,type:i}),(i==null||n.text==null)&&(n={text:r,type:i}),this.state.records.actors.set(e,{box:s,name:r,description:n.text,wrap:n.wrap??this.autoWrap(),prevActor:this.state.records.prevActor,links:{},properties:{},actorCnt:null,rectData:null,type:i??"participant"}),this.state.records.prevActor){const u=this.state.records.actors.get(this.state.records.prevActor);u&&(u.nextActor=e)}this.state.records.currentBox&&this.state.records.currentBox.actorKeys.push(e),this.state.records.prevActor=e}activationCount(e){let r,n=0;if(!e)return 0;for(r=0;r>-",token:"->>-",line:"1",loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:["'ACTIVE_PARTICIPANT'"]},l}return this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:e,to:r,message:(n==null?void 0:n.text)??"",wrap:(n==null?void 0:n.wrap)??this.autoWrap(),type:i,activate:a,centralConnection:s??0}),!0}hasAtLeastOneBox(){return this.state.records.boxes.length>0}hasAtLeastOneBoxWithTitle(){return this.state.records.boxes.some(e=>e.name)}getMessages(){return this.state.records.messages}getBoxes(){return this.state.records.boxes}getActors(){return this.state.records.actors}getCreatedActors(){return this.state.records.createdActors}getDestroyedActors(){return this.state.records.destroyedActors}getActor(e){return this.state.records.actors.get(e)}getActorKeys(){return[...this.state.records.actors.keys()]}enableSequenceNumbers(){this.state.records.sequenceNumbersEnabled=!0}disableSequenceNumbers(){this.state.records.sequenceNumbersEnabled=!1}showSequenceNumbers(){return this.state.records.sequenceNumbersEnabled}setWrap(e){this.state.records.wrapEnabled=e}extractWrap(e){if(e===void 0)return{};e=e.trim();const r=/^:?wrap:/.exec(e)!==null?!0:/^:?nowrap:/.exec(e)!==null?!1:void 0;return{cleanedText:(r===void 0?e:e.replace(/^:?(?:no)?wrap:/,"")).trim(),wrap:r}}autoWrap(){var e;return this.state.records.wrapEnabled!==void 0?this.state.records.wrapEnabled:((e=Pe().sequence)==null?void 0:e.wrap)??!1}clear(){this.state.reset(),In()}parseMessage(e){const r=e.trim(),{wrap:n,cleanedText:i}=this.extractWrap(r),a={text:i,wrap:n};return ae.debug(`parseMessage: ${JSON.stringify(a)}`),a}parseBoxData(e){const r=/^((?:rgba?|hsla?)\s*\(.*\)|\w*)(.*)$/.exec(e);let n=r!=null&&r[1]?r[1].trim():"transparent",i=r!=null&&r[2]?r[2].trim():void 0;if(window!=null&&window.CSS)window.CSS.supports("color",n)||(n="transparent",i=e.trim());else{const o=new Option().style;o.color=n,o.color!==n&&(n="transparent",i=e.trim())}const{wrap:a,cleanedText:s}=this.extractWrap(i);return{text:s?qr(s,Pe()):void 0,color:n,wrap:a}}addNote(e,r,n){const i={actor:e,placement:r,message:n.text,wrap:n.wrap??this.autoWrap()},a=[].concat(e,e);this.state.records.notes.push(i),this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:a[0],to:a[1],message:n.text,wrap:n.wrap??this.autoWrap(),type:this.LINETYPE.NOTE,placement:r})}addLinks(e,r){const n=this.getActor(e);try{let i=qr(r.text,Pe());i=i.replace(/=/g,"="),i=i.replace(/&/g,"&");const a=JSON.parse(i);this.insertLinks(n,a)}catch(i){ae.error("error while parsing actor link text",i)}}addALink(e,r){const n=this.getActor(e);try{const i={};let a=qr(r.text,Pe());const s=a.indexOf("@");a=a.replace(/=/g,"="),a=a.replace(/&/g,"&");const o=a.slice(0,s-1).trim(),l=a.slice(s+1).trim();i[o]=l,this.insertLinks(n,i)}catch(i){ae.error("error while parsing actor link text",i)}}insertLinks(e,r){if(e.links==null)e.links=r;else for(const n in r)e.links[n]=r[n]}addProperties(e,r){const n=this.getActor(e);try{const i=qr(r.text,Pe()),a=JSON.parse(i);this.insertProperties(n,a)}catch(i){ae.error("error while parsing actor properties text",i)}}insertProperties(e,r){if(e.properties==null)e.properties=r;else for(const n in r)e.properties[n]=r[n]}boxEnd(){this.state.records.currentBox=void 0}addDetails(e,r){const n=this.getActor(e),i=document.getElementById(r.text);try{const a=i.innerHTML,s=JSON.parse(a);s.properties&&this.insertProperties(n,s.properties),s.links&&this.insertLinks(n,s.links)}catch(a){ae.error("error while parsing actor details text",a)}}getActorProperty(e,r){if((e==null?void 0:e.properties)!==void 0)return e.properties[r]}apply(e){if(Array.isArray(e))e.forEach(r=>{this.apply(r)});else switch(e.type){case"sequenceIndex":this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:void 0,to:void 0,message:{start:e.sequenceIndex,step:e.sequenceIndexStep,visible:e.sequenceVisible},wrap:!1,type:e.signalType});break;case"addParticipant":this.addActor(e.actor,e.actor,e.description,e.draw,e.config);break;case"createParticipant":if(this.state.records.actors.has(e.actor))throw new Error("It is not possible to have actors with the same id, even if one is destroyed before the next is created. Use 'AS' aliases to simulate the behavior");this.state.records.lastCreated=e.actor,this.addActor(e.actor,e.actor,e.description,e.draw,e.config),this.state.records.createdActors.set(e.actor,this.state.records.messages.length);break;case"destroyParticipant":this.state.records.lastDestroyed=e.actor,this.state.records.destroyedActors.set(e.actor,this.state.records.messages.length);break;case"activeStart":this.addSignal(e.actor,void 0,void 0,e.signalType);break;case"centralConnection":this.addSignal(e.actor,void 0,void 0,e.signalType);break;case"centralConnectionReverse":this.addSignal(e.actor,void 0,void 0,e.signalType);break;case"activeEnd":this.addSignal(e.actor,void 0,void 0,e.signalType);break;case"addNote":this.addNote(e.actor,e.placement,e.text);break;case"addLinks":this.addLinks(e.actor,e.text);break;case"addALink":this.addALink(e.actor,e.text);break;case"addProperties":this.addProperties(e.actor,e.text);break;case"addDetails":this.addDetails(e.actor,e.text);break;case"addMessage":if(this.state.records.lastCreated){if(e.to!==this.state.records.lastCreated)throw new Error("The created participant "+this.state.records.lastCreated.name+" does not have an associated creating message after its declaration. Please check the sequence diagram.");this.state.records.lastCreated=void 0}else if(this.state.records.lastDestroyed){if(e.to!==this.state.records.lastDestroyed&&e.from!==this.state.records.lastDestroyed)throw new Error("The destroyed participant "+this.state.records.lastDestroyed.name+" does not have an associated destroying message after its declaration. Please check the sequence diagram.");this.state.records.lastDestroyed=void 0}this.addSignal(e.from,e.to,e.msg,e.signalType,e.activate,e.centralConnection);break;case"boxStart":this.addBox(e.boxData);break;case"boxEnd":this.boxEnd();break;case"loopStart":this.addSignal(void 0,void 0,e.loopText,e.signalType);break;case"loopEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break;case"rectStart":this.addSignal(void 0,void 0,e.color,e.signalType);break;case"rectEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break;case"optStart":this.addSignal(void 0,void 0,e.optText,e.signalType);break;case"optEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break;case"altStart":this.addSignal(void 0,void 0,e.altText,e.signalType);break;case"else":this.addSignal(void 0,void 0,e.altText,e.signalType);break;case"altEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break;case"setAccTitle":Dn(e.text);break;case"parStart":this.addSignal(void 0,void 0,e.parText,e.signalType);break;case"and":this.addSignal(void 0,void 0,e.parText,e.signalType);break;case"parEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break;case"criticalStart":this.addSignal(void 0,void 0,e.criticalText,e.signalType);break;case"option":this.addSignal(void 0,void 0,e.optionText,e.signalType);break;case"criticalEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break;case"breakStart":this.addSignal(void 0,void 0,e.breakText,e.signalType);break;case"breakEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break}}getConfig(){return Pe().sequence}},x(zv,"SequenceDB"),zv),Nlt=x(t=>{const e=t.dropShadow??"none",{look:r}=Pe();return`.actor { +}`,o=$k(u,{schema:Nk})}i=(o==null?void 0:o.type)??i,o!=null&&o.alias&&(!n||n.text===r)&&(n={text:o.alias,wrap:n==null?void 0:n.wrap,type:i});const l=this.state.records.actors.get(e);if(l){if(this.state.records.currentBox&&l.box&&this.state.records.currentBox!==l.box)throw new Error(`A same participant should only be defined in one Box: ${l.name} can't be in '${l.box.name}' and in '${this.state.records.currentBox.name}' at the same time.`);if(s=l.box?l.box:this.state.records.currentBox,l.box=s,l&&r===l.name&&n==null)return}if((n==null?void 0:n.text)==null&&(n={text:r,type:i}),(i==null||n.text==null)&&(n={text:r,type:i}),this.state.records.actors.set(e,{box:s,name:r,description:n.text,wrap:n.wrap??this.autoWrap(),prevActor:this.state.records.prevActor,links:{},properties:{},actorCnt:null,rectData:null,type:i??"participant"}),this.state.records.prevActor){const u=this.state.records.actors.get(this.state.records.prevActor);u&&(u.nextActor=e)}this.state.records.currentBox&&this.state.records.currentBox.actorKeys.push(e),this.state.records.prevActor=e}activationCount(e){let r,n=0;if(!e)return 0;for(r=0;r>-",token:"->>-",line:"1",loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:["'ACTIVE_PARTICIPANT'"]},l}return this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:e,to:r,message:(n==null?void 0:n.text)??"",wrap:(n==null?void 0:n.wrap)??this.autoWrap(),type:i,activate:a,centralConnection:s??0}),!0}hasAtLeastOneBox(){return this.state.records.boxes.length>0}hasAtLeastOneBoxWithTitle(){return this.state.records.boxes.some(e=>e.name)}getMessages(){return this.state.records.messages}getBoxes(){return this.state.records.boxes}getActors(){return this.state.records.actors}getCreatedActors(){return this.state.records.createdActors}getDestroyedActors(){return this.state.records.destroyedActors}getActor(e){return this.state.records.actors.get(e)}getActorKeys(){return[...this.state.records.actors.keys()]}enableSequenceNumbers(){this.state.records.sequenceNumbersEnabled=!0}disableSequenceNumbers(){this.state.records.sequenceNumbersEnabled=!1}showSequenceNumbers(){return this.state.records.sequenceNumbersEnabled}setWrap(e){this.state.records.wrapEnabled=e}extractWrap(e){if(e===void 0)return{};e=e.trim();const r=/^:?wrap:/.exec(e)!==null?!0:/^:?nowrap:/.exec(e)!==null?!1:void 0;return{cleanedText:(r===void 0?e:e.replace(/^:?(?:no)?wrap:/,"")).trim(),wrap:r}}autoWrap(){var e;return this.state.records.wrapEnabled!==void 0?this.state.records.wrapEnabled:((e=Pe().sequence)==null?void 0:e.wrap)??!1}clear(){this.state.reset(),Hn()}parseMessage(e){const r=e.trim(),{wrap:n,cleanedText:i}=this.extractWrap(r),a={text:i,wrap:n};return se.debug(`parseMessage: ${JSON.stringify(a)}`),a}parseBoxData(e){const r=/^((?:rgba?|hsla?)\s*\(.*\)|\w*)(.*)$/.exec(e);let n=r!=null&&r[1]?r[1].trim():"transparent",i=r!=null&&r[2]?r[2].trim():void 0;if(window!=null&&window.CSS)window.CSS.supports("color",n)||(n="transparent",i=e.trim());else{const o=new Option().style;o.color=n,o.color!==n&&(n="transparent",i=e.trim())}const{wrap:a,cleanedText:s}=this.extractWrap(i);return{text:s?Zr(s,Pe()):void 0,color:n,wrap:a}}addNote(e,r,n){const i={actor:e,placement:r,message:n.text,wrap:n.wrap??this.autoWrap()},a=[].concat(e,e);this.state.records.notes.push(i),this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:a[0],to:a[1],message:n.text,wrap:n.wrap??this.autoWrap(),type:this.LINETYPE.NOTE,placement:r})}addLinks(e,r){const n=this.getActor(e);try{let i=Zr(r.text,Pe());i=i.replace(/=/g,"="),i=i.replace(/&/g,"&");const a=JSON.parse(i);this.insertLinks(n,a)}catch(i){se.error("error while parsing actor link text",i)}}addALink(e,r){const n=this.getActor(e);try{const i={};let a=Zr(r.text,Pe());const s=a.indexOf("@");a=a.replace(/=/g,"="),a=a.replace(/&/g,"&");const o=a.slice(0,s-1).trim(),l=a.slice(s+1).trim();i[o]=l,this.insertLinks(n,i)}catch(i){se.error("error while parsing actor link text",i)}}insertLinks(e,r){if(e.links==null)e.links=r;else for(const n in r)e.links[n]=r[n]}addProperties(e,r){const n=this.getActor(e);try{const i=Zr(r.text,Pe()),a=JSON.parse(i);this.insertProperties(n,a)}catch(i){se.error("error while parsing actor properties text",i)}}insertProperties(e,r){if(e.properties==null)e.properties=r;else for(const n in r)e.properties[n]=r[n]}boxEnd(){this.state.records.currentBox=void 0}addDetails(e,r){const n=this.getActor(e),i=document.getElementById(r.text);try{const a=i.innerHTML,s=JSON.parse(a);s.properties&&this.insertProperties(n,s.properties),s.links&&this.insertLinks(n,s.links)}catch(a){se.error("error while parsing actor details text",a)}}getActorProperty(e,r){if((e==null?void 0:e.properties)!==void 0)return e.properties[r]}apply(e){if(Array.isArray(e))e.forEach(r=>{this.apply(r)});else switch(e.type){case"sequenceIndex":this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:void 0,to:void 0,message:{start:e.sequenceIndex,step:e.sequenceIndexStep,visible:e.sequenceVisible},wrap:!1,type:e.signalType});break;case"addParticipant":this.addActor(e.actor,e.actor,e.description,e.draw,e.config);break;case"createParticipant":if(this.state.records.actors.has(e.actor))throw new Error("It is not possible to have actors with the same id, even if one is destroyed before the next is created. Use 'AS' aliases to simulate the behavior");this.state.records.lastCreated=e.actor,this.addActor(e.actor,e.actor,e.description,e.draw,e.config),this.state.records.createdActors.set(e.actor,this.state.records.messages.length);break;case"destroyParticipant":this.state.records.lastDestroyed=e.actor,this.state.records.destroyedActors.set(e.actor,this.state.records.messages.length);break;case"activeStart":this.addSignal(e.actor,void 0,void 0,e.signalType);break;case"centralConnection":this.addSignal(e.actor,void 0,void 0,e.signalType);break;case"centralConnectionReverse":this.addSignal(e.actor,void 0,void 0,e.signalType);break;case"activeEnd":this.addSignal(e.actor,void 0,void 0,e.signalType);break;case"addNote":this.addNote(e.actor,e.placement,e.text);break;case"addLinks":this.addLinks(e.actor,e.text);break;case"addALink":this.addALink(e.actor,e.text);break;case"addProperties":this.addProperties(e.actor,e.text);break;case"addDetails":this.addDetails(e.actor,e.text);break;case"addMessage":if(this.state.records.lastCreated){if(e.to!==this.state.records.lastCreated)throw new Error("The created participant "+this.state.records.lastCreated.name+" does not have an associated creating message after its declaration. Please check the sequence diagram.");this.state.records.lastCreated=void 0}else if(this.state.records.lastDestroyed){if(e.to!==this.state.records.lastDestroyed&&e.from!==this.state.records.lastDestroyed)throw new Error("The destroyed participant "+this.state.records.lastDestroyed.name+" does not have an associated destroying message after its declaration. Please check the sequence diagram.");this.state.records.lastDestroyed=void 0}this.addSignal(e.from,e.to,e.msg,e.signalType,e.activate,e.centralConnection);break;case"boxStart":this.addBox(e.boxData);break;case"boxEnd":this.boxEnd();break;case"loopStart":this.addSignal(void 0,void 0,e.loopText,e.signalType);break;case"loopEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break;case"rectStart":this.addSignal(void 0,void 0,e.color,e.signalType);break;case"rectEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break;case"optStart":this.addSignal(void 0,void 0,e.optText,e.signalType);break;case"optEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break;case"altStart":this.addSignal(void 0,void 0,e.altText,e.signalType);break;case"else":this.addSignal(void 0,void 0,e.altText,e.signalType);break;case"altEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break;case"setAccTitle":Yn(e.text);break;case"parStart":this.addSignal(void 0,void 0,e.parText,e.signalType);break;case"and":this.addSignal(void 0,void 0,e.parText,e.signalType);break;case"parEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break;case"criticalStart":this.addSignal(void 0,void 0,e.criticalText,e.signalType);break;case"option":this.addSignal(void 0,void 0,e.optionText,e.signalType);break;case"criticalEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break;case"breakStart":this.addSignal(void 0,void 0,e.breakText,e.signalType);break;case"breakEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break}}getConfig(){return Pe().sequence}},T(bb,"SequenceDB"),bb),x1t=T(t=>{const e=t.dropShadow??"none",{look:r}=Pe();return`.actor { stroke: ${t.actorBorder}; fill: ${t.actorBkg}; stroke-width: ${t.strokeWidth??1}; @@ -2008,25 +2009,25 @@ Expecting `+or.join(", ")+", got '"+(this.terminals_[ye]||ye)+"'":Rr="Parse erro filter: ${e}; stroke: ${t.nodeBorder}; } -`},"getStyles"),Olt=Nlt,Jf=36,Ih="actor-top",Dh="actor-bottom",CS="actor-box",e0="actor-man",fu=new Set(["redux-color","redux-dark-color"]),XT=x(function(t,e){const r=f3(t,e);return lr().look==="neo"&&r.attr("data-look","neo"),r},"drawRect"),$lt=x(function(t,e,r,n,i){if(e.links===void 0||e.links===null||Object.keys(e.links).length===0)return{height:0,width:0};const a=e.links,s=e.actorCnt,o=e.rectData;var l="none";i&&(l="block !important");const u=t.append("g");u.attr("id","actor"+s+"_popup"),u.attr("class","actorPopupMenu"),u.attr("display",l);var h="";o.class!==void 0&&(h=" "+o.class);let d=o.width>r?o.width:r;const f=u.append("rect");if(f.attr("class","actorPopupMenuPanel"+h),f.attr("x",o.x),f.attr("y",o.height),f.attr("fill",o.fill),f.attr("stroke",o.stroke),f.attr("width",d),f.attr("height",o.height),f.attr("rx",o.rx),f.attr("ry",o.ry),a!=null){var p=20;for(let y in a){var g=u.append("a"),m=cd.sanitizeUrl(a[y]);g.attr("xlink:href",m),g.attr("target","_blank"),act(n)(y,g,o.x+10,o.height+p,d,20,{class:"actor"},n),p+=30}}return f.attr("height",p),{height:o.height+p,width:d}},"drawPopup"),kS=x(function(t){return"var pu = document.getElementById('"+t+"'); if (pu != null) { pu.style.display = pu.style.display == 'block' ? 'none' : 'block'; }"},"popupMenuToggle"),ES=x(async function(t,e,r=null){let n=t.append("foreignObject");const i=await _w(e.text,lr()),s=n.append("xhtml:div").attr("style","width: fit-content;").attr("xmlns","http://www.w3.org/1999/xhtml").html(i).node().getBoundingClientRect();if(n.attr("height",Math.round(s.height)).attr("width",Math.round(s.width)),e.class==="noteText"){const o=t.node().firstChild;o.setAttribute("height",s.height+2*e.textMargin);const l=o.getBBox();n.attr("x",Math.round(l.x+l.width/2-s.width/2)).attr("y",Math.round(l.y+l.height/2-s.height/2))}else if(r){let{startx:o,stopx:l,starty:u}=r;if(o>l){const h=o;o=l,l=h}n.attr("x",Math.round(o+Math.abs(o-l)/2-s.width/2)),e.class==="loopText"?n.attr("y",Math.round(u)):n.attr("y",Math.round(u-s.height))}return[n]},"drawKatex"),em=x(function(t,e){let r=0,n=0;const i=e.text.split(Lt.lineBreakRegex),[a,s]=xc(e.fontSize);let o=[],l=0,u=x(()=>e.y,"yfunc");if(e.valign!==void 0&&e.textMargin!==void 0&&e.textMargin>0)switch(e.valign){case"top":case"start":u=x(()=>Math.round(e.y+e.textMargin),"yfunc");break;case"middle":case"center":u=x(()=>Math.round(e.y+(r+n+e.textMargin)/2),"yfunc");break;case"bottom":case"end":u=x(()=>Math.round(e.y+(r+n+2*e.textMargin)-e.textMargin),"yfunc");break}if(e.anchor!==void 0&&e.textMargin!==void 0&&e.width!==void 0)switch(e.anchor){case"left":case"start":e.x=Math.round(e.x+e.textMargin),e.anchor="start",e.dominantBaseline="middle",e.alignmentBaseline="middle";break;case"middle":case"center":e.x=Math.round(e.x+e.width/2),e.anchor="middle",e.dominantBaseline="middle",e.alignmentBaseline="middle";break;case"right":case"end":e.x=Math.round(e.x+e.width-e.textMargin),e.anchor="end",e.dominantBaseline="middle",e.alignmentBaseline="middle";break}for(let[h,d]of i.entries()){e.textMargin!==void 0&&e.textMargin===0&&a!==void 0&&(l=h*a);const f=t.append("text");f.attr("x",e.x),f.attr("y",u()),e.anchor!==void 0&&f.attr("text-anchor",e.anchor).attr("dominant-baseline",e.dominantBaseline).attr("alignment-baseline",e.alignmentBaseline),e.fontFamily!==void 0&&f.style("font-family",e.fontFamily),s!==void 0&&f.style("font-size",s),e.fontWeight!==void 0&&f.style("font-weight",e.fontWeight),e.fill!==void 0&&f.attr("fill",e.fill),e.class!==void 0&&f.attr("class",e.class),e.dy!==void 0?f.attr("dy",e.dy):l!==0&&f.attr("dy",l);const p=d||Jq;if(e.tspan){const g=f.append("tspan");g.attr("x",e.x),e.fill!==void 0&&g.attr("fill",e.fill),g.text(p)}else f.text(p);e.valign!==void 0&&e.textMargin!==void 0&&e.textMargin>0&&(n+=(f._groups||f)[0][0].getBBox().height,r=n),o.push(f)}return o},"drawText"),Kge=x(function(t,e){function r(i,a,s,o,l){return i+","+a+" "+(i+s)+","+a+" "+(i+s)+","+(a+o-l)+" "+(i+s-l*1.2)+","+(a+o)+" "+i+","+(a+o)}x(r,"genPoints");const n=t.append("polygon");return n.attr("points",r(e.x,e.y,e.width,e.height,7)),n.attr("class","labelBox"),e.y=e.y+e.height/2,em(t,e),n},"drawLabel"),Vr=-1,jge=x((t,e,r,n)=>{t.select&&r.forEach(i=>{const a=e.get(i),s=t.select("#actor"+a.actorCnt);!n.mirrorActors&&a.stopy?s.attr("y2",a.stopy+a.height/2):n.mirrorActors&&s.attr("y2",a.stopy)})},"fixLifeLineHeights"),Plt=x(function(t,e,r,n,i){var w,k;const a=n?e.stopy:e.starty,s=e.x+e.width/2,o=a+e.height,{look:l,theme:u,themeVariables:h}=r,{bkgColorArray:d,borderColorArray:f}=h,p=t.append("g").lower();var g=p;n||(Vr++,Object.keys(e.links||{}).length&&!r.forceMenus&&g.attr("onclick",kS(`actor${Vr}_popup`)).attr("cursor","pointer"),g.append("line").attr("id","actor"+Vr).attr("x1",s).attr("y1",o).attr("x2",s).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name).attr("data-et","life-line").attr("data-id",e.name),g=p.append("g"),e.actorCnt=Vr,e.links!=null&&g.attr("id","root-"+Vr),l==="neo"&&g.attr("data-look","neo"));const m=Ys();var y="actor";(w=e.properties)!=null&&w.class?y=e.properties.class:m.fill="#eaeaea",n?y+=` ${Dh}`:y+=` ${Ih}`,m.x=e.x,m.y=a,m.width=e.width,m.height=e.height,m.class=y,m.rx=3,m.ry=3,m.name=e.name,l==="neo"&&(m.rx=6,m.ry=6);const v=XT(g,m),T=i.get(e.name)??0;if(fu.has(u)&&(v.style("stroke",f[T%f.length]),v.style("fill",d[T%f.length])),l==="neo"&&v.attr("filter","url(#drop-shadow)"),e.rectData=m,(k=e.properties)!=null&&k.icon){const A=e.properties.icon.trim();A.charAt(0)==="@"?uI(g,m.x+m.width-20,m.y+10,A.substr(1)):cI(g,m.x+m.width-20,m.y+10,A)}n||(g.attr("data-et","participant"),g.attr("data-type","participant"),g.attr("data-id",e.name)),pu(r,ui(e.description))(e.description,g,m.x,m.y,m.width,m.height,{class:`actor ${CS}`},r);let b=e.height;if(v.node){const A=v.node().getBBox();e.height=A.height,b=A.height}return b},"drawActorTypeParticipant"),Blt=x(function(t,e,r,n,i){var C,_;const a=n?e.stopy:e.starty,s=e.x+e.width/2,o=a+e.height,{look:l,theme:u,themeVariables:h}=r,{bkgColorArray:d,borderColorArray:f}=h,p=t.append("g").lower();var g=p;n||(Vr++,Object.keys(e.links||{}).length&&!r.forceMenus&&g.attr("onclick",kS(`actor${Vr}_popup`)).attr("cursor","pointer"),g.append("line").attr("id","actor"+Vr).attr("x1",s).attr("y1",o).attr("x2",s).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name).attr("data-et","life-line").attr("data-id",e.name),g=p.append("g"),e.actorCnt=Vr,e.links!=null&&g.attr("id","root-"+Vr),l==="neo"&&g.attr("data-look","neo"));const m=Ys();var y="actor";(C=e.properties)!=null&&C.class?y=e.properties.class:m.fill="#eaeaea",n?y+=` ${Dh}`:y+=` ${Ih}`,m.x=e.x,m.y=a,m.width=e.width,m.height=e.height,m.class=y,m.name=e.name;const v=6,T={...m,x:m.x+-v,y:m.y+ +v,class:"actor"},b=XT(g,m),w=XT(g,T);e.rectData=m,l==="neo"&&g.attr("filter","url(#drop-shadow)");const k=i.get(e.name)??0;if(fu.has(u)&&(b.style("stroke",f[k%f.length]),b.style("fill",d[k%f.length]),w.style("stroke",f[k%f.length]),w.style("fill",d[k%f.length])),(_=e.properties)!=null&&_.icon){const L=e.properties.icon.trim();L.charAt(0)==="@"?uI(g,m.x+m.width-20,m.y+10,L.substr(1)):cI(g,m.x+m.width-20,m.y+10,L)}pu(r,ui(e.description))(e.description,g,m.x-v,m.y+v,m.width,m.height,{class:`actor ${CS}`},r);let A=e.height;if(b.node){const L=b.node().getBBox();e.height=L.height,A=L.height}return n||(g.attr("data-et","participant"),g.attr("data-type","collections"),g.attr("data-id",e.name)),A},"drawActorTypeCollections"),Flt=x(function(t,e,r,n,i){var L,O;const a=n?e.stopy:e.starty,s=e.x+e.width/2,o=a+e.height,{look:l,theme:u,themeVariables:h}=r,{bkgColorArray:d,borderColorArray:f}=h,p=t.append("g").lower();let g=p;n||(Vr++,Object.keys(e.links||{}).length&&!r.forceMenus&&g.attr("onclick",kS(`actor${Vr}_popup`)).attr("cursor","pointer"),g.append("line").attr("id","actor"+Vr).attr("x1",s).attr("y1",o).attr("x2",s).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name).attr("data-et","life-line").attr("data-id",e.name),g=p.append("g"),e.actorCnt=Vr,e.links!=null&&g.attr("id","root-"+Vr),l==="neo"&&g.attr("data-look","neo"));const m=Ys();let y="actor";(L=e.properties)!=null&&L.class?y=e.properties.class:m.fill="#eaeaea",n?y+=` ${Dh}`:y+=` ${Ih}`,g.attr("class",y),m.x=e.x,m.y=a,m.width=e.width,m.height=e.height,m.name=e.name;const v=m.height/2,T=v/(2.5+m.height/50),b=g.append("g"),w=g.append("g"),k=`M ${m.x},${m.y+v} - a ${T},${v} 0 0 0 0,${m.height} - h ${m.width-2*T} - a ${T},${v} 0 0 0 0,-${m.height} +`},"getStyles"),T1t=x1t,g0=36,Md="actor-top",Nd="actor-bottom",wA="actor-box",m0="actor-man",dh=new Set(["redux-color","redux-dark-color"]),t4=T(function(t,e){const r=dS(t,e);return pr().look==="neo"&&r.attr("data-look","neo"),r},"drawRect"),w1t=T(function(t,e,r,n,i){if(e.links===void 0||e.links===null||Object.keys(e.links).length===0)return{height:0,width:0};const a=e.links,s=e.actorCnt,o=e.rectData;var l="none";i&&(l="block !important");const u=t.append("g");u.attr("id","actor"+s+"_popup"),u.attr("class","actorPopupMenu"),u.attr("display",l);var h="";o.class!==void 0&&(h=" "+o.class);let d=o.width>r?o.width:r;const f=u.append("rect");if(f.attr("class","actorPopupMenuPanel"+h),f.attr("x",o.x),f.attr("y",o.height),f.attr("fill",o.fill),f.attr("stroke",o.stroke),f.attr("width",d),f.attr("height",o.height),f.attr("rx",o.rx),f.attr("ry",o.ry),a!=null){var p=20;for(let y in a){var g=u.append("a"),m=df.sanitizeUrl(a[y]);g.attr("xlink:href",m),g.attr("target","_blank"),U1t(n)(y,g,o.x+10,o.height+p,d,20,{class:"actor"},n),p+=30}}return f.attr("height",p),{height:o.height+p,width:d}},"drawPopup"),CA=T(function(t){return"var pu = document.getElementById('"+t+"'); if (pu != null) { pu.style.display = pu.style.display == 'block' ? 'none' : 'block'; }"},"popupMenuToggle"),kA=T(async function(t,e,r=null){let n=t.append("foreignObject");const i=await $4(e.text,pr()),s=n.append("xhtml:div").attr("style","width: fit-content;").attr("xmlns","http://www.w3.org/1999/xhtml").html(i).node().getBoundingClientRect();if(n.attr("height",Math.round(s.height)).attr("width",Math.round(s.width)),e.class==="noteText"){const o=t.node().firstChild;o.setAttribute("height",s.height+2*e.textMargin);const l=o.getBBox();n.attr("x",Math.round(l.x+l.width/2-s.width/2)).attr("y",Math.round(l.y+l.height/2-s.height/2))}else if(r){let{startx:o,stopx:l,starty:u}=r;if(o>l){const h=o;o=l,l=h}n.attr("x",Math.round(o+Math.abs(o-l)/2-s.width/2)),e.class==="loopText"?n.attr("y",Math.round(u)):n.attr("y",Math.round(u-s.height))}return[n]},"drawKatex"),M1=T(function(t,e){let r=0,n=0;const i=e.text.split(Dt.lineBreakRegex),[a,s]=cu(e.fontSize);let o=[],l=0,u=T(()=>e.y,"yfunc");if(e.valign!==void 0&&e.textMargin!==void 0&&e.textMargin>0)switch(e.valign){case"top":case"start":u=T(()=>Math.round(e.y+e.textMargin),"yfunc");break;case"middle":case"center":u=T(()=>Math.round(e.y+(r+n+e.textMargin)/2),"yfunc");break;case"bottom":case"end":u=T(()=>Math.round(e.y+(r+n+2*e.textMargin)-e.textMargin),"yfunc");break}if(e.anchor!==void 0&&e.textMargin!==void 0&&e.width!==void 0)switch(e.anchor){case"left":case"start":e.x=Math.round(e.x+e.textMargin),e.anchor="start",e.dominantBaseline="middle",e.alignmentBaseline="middle";break;case"middle":case"center":e.x=Math.round(e.x+e.width/2),e.anchor="middle",e.dominantBaseline="middle",e.alignmentBaseline="middle";break;case"right":case"end":e.x=Math.round(e.x+e.width-e.textMargin),e.anchor="end",e.dominantBaseline="middle",e.alignmentBaseline="middle";break}for(let[h,d]of i.entries()){e.textMargin!==void 0&&e.textMargin===0&&a!==void 0&&(l=h*a);const f=t.append("text");f.attr("x",e.x),f.attr("y",u()),e.anchor!==void 0&&f.attr("text-anchor",e.anchor).attr("dominant-baseline",e.dominantBaseline).attr("alignment-baseline",e.alignmentBaseline),e.fontFamily!==void 0&&f.style("font-family",e.fontFamily),s!==void 0&&f.style("font-size",s),e.fontWeight!==void 0&&f.style("font-weight",e.fontWeight),e.fill!==void 0&&f.attr("fill",e.fill),e.class!==void 0&&f.attr("class",e.class),e.dy!==void 0?f.attr("dy",e.dy):l!==0&&f.attr("dy",l);const p=d||AY;if(e.tspan){const g=f.append("tspan");g.attr("x",e.x),e.fill!==void 0&&g.attr("fill",e.fill),g.text(p)}else f.text(p);e.valign!==void 0&&e.textMargin!==void 0&&e.textMargin>0&&(n+=(f._groups||f)[0][0].getBBox().height,r=n),o.push(f)}return o},"drawText"),dTe=T(function(t,e){function r(i,a,s,o,l){return i+","+a+" "+(i+s)+","+a+" "+(i+s)+","+(a+o-l)+" "+(i+s-l*1.2)+","+(a+o)+" "+i+","+(a+o)}T(r,"genPoints");const n=t.append("polygon");return n.attr("points",r(e.x,e.y,e.width,e.height,7)),n.attr("class","labelBox"),e.y=e.y+e.height/2,M1(t,e),n},"drawLabel"),Qr=-1,fTe=T((t,e,r,n)=>{t.select&&r.forEach(i=>{const a=e.get(i),s=t.select("#actor"+a.actorCnt);!n.mirrorActors&&a.stopy?s.attr("y2",a.stopy+a.height/2):n.mirrorActors&&s.attr("y2",a.stopy)})},"fixLifeLineHeights"),C1t=T(function(t,e,r,n,i){var w,C;const a=n?e.stopy:e.starty,s=e.x+e.width/2,o=a+e.height,{look:l,theme:u,themeVariables:h}=r,{bkgColorArray:d,borderColorArray:f}=h,p=t.append("g").lower();var g=p;n||(Qr++,Object.keys(e.links||{}).length&&!r.forceMenus&&g.attr("onclick",CA(`actor${Qr}_popup`)).attr("cursor","pointer"),g.append("line").attr("id","actor"+Qr).attr("x1",s).attr("y1",o).attr("x2",s).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name).attr("data-et","life-line").attr("data-id",e.name),g=p.append("g"),e.actorCnt=Qr,e.links!=null&&g.attr("id","root-"+Qr),l==="neo"&&g.attr("data-look","neo"));const m=Ro();var y="actor";(w=e.properties)!=null&&w.class?y=e.properties.class:m.fill="#eaeaea",n?y+=` ${Nd}`:y+=` ${Md}`,m.x=e.x,m.y=a,m.width=e.width,m.height=e.height,m.class=y,m.rx=3,m.ry=3,m.name=e.name,l==="neo"&&(m.rx=6,m.ry=6);const v=t4(g,m),x=i.get(e.name)??0;if(dh.has(u)&&(v.style("stroke",f[x%f.length]),v.style("fill",d[x%f.length])),l==="neo"&&v.attr("filter","url(#drop-shadow)"),e.rectData=m,(C=e.properties)!=null&&C.icon){const _=e.properties.icon.trim();_.charAt(0)==="@"?FN(g,m.x+m.width-20,m.y+10,_.substr(1)):BN(g,m.x+m.width-20,m.y+10,_)}n||(g.attr("data-et","participant"),g.attr("data-type","participant"),g.attr("data-id",e.name)),fh(r,Ii(e.description))(e.description,g,m.x,m.y,m.width,m.height,{class:`actor ${wA}`},r);let b=e.height;if(v.node){const _=v.node().getBBox();e.height=_.height,b=_.height}return b},"drawActorTypeParticipant"),k1t=T(function(t,e,r,n,i){var k,S;const a=n?e.stopy:e.starty,s=e.x+e.width/2,o=a+e.height,{look:l,theme:u,themeVariables:h}=r,{bkgColorArray:d,borderColorArray:f}=h,p=t.append("g").lower();var g=p;n||(Qr++,Object.keys(e.links||{}).length&&!r.forceMenus&&g.attr("onclick",CA(`actor${Qr}_popup`)).attr("cursor","pointer"),g.append("line").attr("id","actor"+Qr).attr("x1",s).attr("y1",o).attr("x2",s).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name).attr("data-et","life-line").attr("data-id",e.name),g=p.append("g"),e.actorCnt=Qr,e.links!=null&&g.attr("id","root-"+Qr),l==="neo"&&g.attr("data-look","neo"));const m=Ro();var y="actor";(k=e.properties)!=null&&k.class?y=e.properties.class:m.fill="#eaeaea",n?y+=` ${Nd}`:y+=` ${Md}`,m.x=e.x,m.y=a,m.width=e.width,m.height=e.height,m.class=y,m.name=e.name;const v=6,x={...m,x:m.x+-v,y:m.y+ +v,class:"actor"},b=t4(g,m),w=t4(g,x);e.rectData=m,l==="neo"&&g.attr("filter","url(#drop-shadow)");const C=i.get(e.name)??0;if(dh.has(u)&&(b.style("stroke",f[C%f.length]),b.style("fill",d[C%f.length]),w.style("stroke",f[C%f.length]),w.style("fill",d[C%f.length])),(S=e.properties)!=null&&S.icon){const L=e.properties.icon.trim();L.charAt(0)==="@"?FN(g,m.x+m.width-20,m.y+10,L.substr(1)):BN(g,m.x+m.width-20,m.y+10,L)}fh(r,Ii(e.description))(e.description,g,m.x-v,m.y+v,m.width,m.height,{class:`actor ${wA}`},r);let _=e.height;if(b.node){const L=b.node().getBBox();e.height=L.height,_=L.height}return n||(g.attr("data-et","participant"),g.attr("data-type","collections"),g.attr("data-id",e.name)),_},"drawActorTypeCollections"),E1t=T(function(t,e,r,n,i){var L,$;const a=n?e.stopy:e.starty,s=e.x+e.width/2,o=a+e.height,{look:l,theme:u,themeVariables:h}=r,{bkgColorArray:d,borderColorArray:f}=h,p=t.append("g").lower();let g=p;n||(Qr++,Object.keys(e.links||{}).length&&!r.forceMenus&&g.attr("onclick",CA(`actor${Qr}_popup`)).attr("cursor","pointer"),g.append("line").attr("id","actor"+Qr).attr("x1",s).attr("y1",o).attr("x2",s).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name).attr("data-et","life-line").attr("data-id",e.name),g=p.append("g"),e.actorCnt=Qr,e.links!=null&&g.attr("id","root-"+Qr),l==="neo"&&g.attr("data-look","neo"));const m=Ro();let y="actor";(L=e.properties)!=null&&L.class?y=e.properties.class:m.fill="#eaeaea",n?y+=` ${Nd}`:y+=` ${Md}`,g.attr("class",y),m.x=e.x,m.y=a,m.width=e.width,m.height=e.height,m.name=e.name;const v=m.height/2,x=v/(2.5+m.height/50),b=g.append("g"),w=g.append("g"),C=`M ${m.x},${m.y+v} + a ${x},${v} 0 0 0 0,${m.height} + h ${m.width-2*x} + a ${x},${v} 0 0 0 0,-${m.height} Z - `;b.append("path").attr("d",k),w.append("path").attr("d",`M ${m.x},${m.y+v} - a ${T},${v} 0 0 0 0,${m.height}`),b.attr("transform",`translate(${T}, ${-(m.height/2)})`),w.attr("transform",`translate(${m.width-T}, ${-m.height/2})`),e.rectData=m,l==="neo"&&b.attr("filter","url(#drop-shadow)");const A=i.get(e.name)??0;if(fu.has(u)&&(b.style("stroke",f[A%f.length]),b.style("fill",d[A%f.length]),w.style("stroke",f[A%f.length]),w.style("fill",d[A%f.length])),(O=e.properties)!=null&&O.icon){const M=e.properties.icon.trim(),z=m.x+m.width-20,F=m.y+10;M.charAt(0)==="@"?uI(g,z,F,M.substr(1)):cI(g,z,F,M)}pu(r,ui(e.description))(e.description,g,m.x,m.y,m.width,m.height,{class:`actor ${CS}`},r);let C=e.height;const _=b.select("path:last-child");if(_.node()){const M=_.node().getBBox();e.height=M.height,C=M.height}return n||(g.attr("data-et","participant"),g.attr("data-type","queue"),g.attr("data-id",e.name)),C},"drawActorTypeQueue"),zlt=x(function(t,e,r,n,i,a){var L;const s=n?e.stopy:e.starty,o=e.x+e.width/2,l=s+75,{look:u,theme:h,themeVariables:d}=r,{bkgColorArray:f,borderColorArray:p,actorBorder:g,actorBkg:m}=d,y=t.append("g").lower();n||(Vr++,y.append("line").attr("id","actor"+Vr).attr("x1",o).attr("y1",l).attr("x2",o).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name).attr("data-et","life-line").attr("data-id",e.name),e.actorCnt=Vr);const v=t.append("g");let T=e0;n?T+=` ${Dh}`:T+=` ${Ih}`,v.attr("class",T),v.attr("name",e.name);const b=Ys();b.x=e.x,b.y=s,b.fill="#eaeaea",b.width=e.width,b.height=e.height,b.class="actor";const w=e.x+e.width/2,k=s+32,A=22;v.append("defs").append("marker").attr("id",i+"-filled-head-control").attr("refX",11).attr("refY",5.8).attr("markerWidth",20).attr("markerHeight",28).attr("orient","172.5").attr("stroke-width",1.2).append("path").attr("d","M 14.4 5.6 L 7.2 10.4 L 8.8 5.6 L 7.2 0.8 Z"),v.append("circle").attr("cx",w).attr("cy",k).attr("r",A).attr("filter",`${u==="neo"?"url(#drop-shadow)":""}`),v.append("line").attr("marker-end","url(#"+i+"-filled-head-control)").attr("transform",`translate(${w}, ${k-A})`);const C=a.get(e.name)??0;fu.has(h)?(v.style("stroke",p[C%p.length]),v.style("fill",f[C%p.length])):(v.style("stroke",g),v.style("fill",m));const _=v.node().getBBox();return e.height=_.height+2*(((L=r==null?void 0:r.sequence)==null?void 0:L.labelBoxHeight)??0),pu(r,ui(e.description))(e.description,v,b.x,b.y+A+(n?5:12),b.width,b.height,{class:`actor ${e0}`},r),n||(v.attr("data-et","participant"),v.attr("data-type","control"),v.attr("data-id",e.name)),e.height},"drawActorTypeControl"),Glt=x(function(t,e,r,n,i){var A;const a=n?e.stopy:e.starty,s=e.x+e.width/2,o=a+75,{look:l,theme:u,themeVariables:h}=r,{bkgColorArray:d,borderColorArray:f}=h,p=t.append("g").lower(),g=t.append("g");let m="actor";n?m+=` ${Dh}`:m+=` ${Ih}`,g.attr("class",m),g.attr("name",e.name);const y=Ys();y.x=e.x,y.y=a,y.fill="#eaeaea",y.width=e.width,y.height=e.height,y.class="actor";const v=e.x+e.width/2,T=a+(n?10:25),b=22;g.append("circle").attr("cx",v).attr("cy",T).attr("r",b).attr("width",e.width).attr("height",e.height),g.append("line").attr("x1",v-b).attr("x2",v+b).attr("y1",T+b).attr("y2",T+b).attr("stroke-width",2),l==="neo"&&g.attr("filter","url(#drop-shadow)");const w=i.get(e.name)??0;fu.has(u)&&(g.style("stroke",f[w%f.length]),g.style("fill",d[w%f.length]));const k=g.node().getBBox();return e.height=k.height+(((A=r==null?void 0:r.sequence)==null?void 0:A.labelBoxHeight)??0),n||(Vr++,p.append("line").attr("id","actor"+Vr).attr("x1",s).attr("y1",o).attr("x2",s).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name).attr("data-et","life-line").attr("data-id",e.name),e.actorCnt=Vr),pu(r,ui(e.description))(e.description,g,y.x,y.y+(n?15:30),y.width,y.height,{class:`actor ${e0}`},r),n?g.attr("transform",`translate(0, ${b})`):(g.attr("transform",`translate(0, ${b/2-5})`),g.attr("data-et","participant"),g.attr("data-type","entity"),g.attr("data-id",e.name)),e.height},"drawActorTypeEntity"),qlt=x(function(t,e,r,n,i){var O;const a=n?e.stopy:e.starty,s=e.x+e.width/2,o=a+e.height+2*r.boxTextMargin,{theme:l,themeVariables:u,look:h}=r,{bkgColorArray:d,borderColorArray:f,actorBorder:p}=u,g=t.append("g").lower();let m=g;n||(Vr++,Object.keys(e.links||{}).length&&!r.forceMenus&&m.attr("onclick",kS(`actor${Vr}_popup`)).attr("cursor","pointer"),m.append("line").attr("id","actor"+Vr).attr("x1",s).attr("y1",o).attr("x2",s).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name).attr("data-et","life-line").attr("data-id",e.name),m=g.append("g"),e.actorCnt=Vr,e.links!=null&&m.attr("id","root-"+Vr),h==="neo"&&m.attr("data-look","neo"));const y=Ys();let v="actor";(O=e.properties)!=null&&O.class?v=e.properties.class:y.fill="#eaeaea",n?v+=` ${Dh}`:v+=` ${Ih}`,y.x=e.x,y.y=a,y.width=e.width,y.height=e.height,y.class=v,y.name=e.name,y.x=e.x,y.y=a;const T=y.width/3,b=y.width/3,w=T/2,k=w/(2.5+T/50),A=m.append("g");A.attr("class",v);const C=` - M ${y.x},${y.y+k} - a ${w},${k} 0 0 0 ${T},0 - a ${w},${k} 0 0 0 -${T},0 - l 0,${b-2*k} - a ${w},${k} 0 0 0 ${T},0 - l 0,-${b-2*k} -`;A.append("path").attr("d",C),h==="neo"&&A.attr("filter","url(#drop-shadow)");const _=i.get(e.name)??0;fu.has(l)?(A.style("stroke",f[_%f.length]),A.style("fill",d[_%f.length])):A.style("stroke",p),A.attr("transform",`translate(${T}, ${k})`),e.rectData=y,pu(r,ui(e.description))(e.description,m,y.x,y.y+35,y.width,y.height,{class:`actor ${CS}`},r);const L=A.select("path:last-child");if(L.node()){const M=L.node().getBBox();e.height=M.height+(r.sequence.labelBoxHeight??0)}return n||(m.attr("data-et","participant"),m.attr("data-type","database"),m.attr("data-id",e.name)),e.height},"drawActorTypeDatabase"),Vlt=x(function(t,e,r,n,i){const a=n?e.stopy:e.starty,s=e.x+e.width/2,o=a+80,l=22,u=t.append("g").lower(),{look:h,theme:d,themeVariables:f}=r,{bkgColorArray:p,borderColorArray:g,actorBorder:m}=f;n||(Vr++,u.append("line").attr("id","actor"+Vr).attr("x1",s).attr("y1",o).attr("x2",s).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name).attr("data-et","life-line").attr("data-id",e.name),e.actorCnt=Vr);const y=t.append("g");let v=e0;n?v+=` ${Dh}`:v+=` ${Ih}`,y.attr("class",v),y.attr("name",e.name);const T=Ys();T.x=e.x,T.y=a,T.fill="#eaeaea",T.width=e.width,T.height=e.height,T.class="actor",y.append("line").attr("id","actor-man-torso"+Vr).attr("x1",e.x+e.width/2-l*2.5).attr("y1",a+12).attr("x2",e.x+e.width/2-15).attr("y2",a+12),y.append("line").attr("id","actor-man-arms"+Vr).attr("x1",e.x+e.width/2-l*2.5).attr("y1",a+2).attr("x2",e.x+e.width/2-l*2.5).attr("y2",a+22),y.append("circle").attr("cx",e.x+e.width/2).attr("cy",a+12).attr("r",l),h==="neo"&&y.attr("filter","url(#drop-shadow)");const b=i.get(e.name)??0;fu.has(d)?(y.style("stroke",g[b%g.length]),y.style("fill",p[b%g.length])):y.style("stroke",m);const w=y.node().getBBox();return e.height=w.height+(r.sequence.labelBoxHeight??0),pu(r,ui(e.description))(e.description,y,T.x,T.y+15,T.width,T.height,{class:`actor ${e0}`},r),y.attr("transform",`translate(0,${l/2+10})`),n||(y.attr("data-et","participant"),y.attr("data-type","boundary"),y.attr("data-id",e.name)),e.height},"drawActorTypeBoundary"),Wlt=x(function(t,e,r,n,i){const a=n?e.stopy:e.starty,s=e.x+e.width/2,o=a+80,{look:l,theme:u,themeVariables:h}=r,{bkgColorArray:d,borderColorArray:f,actorBorder:p}=h,g=t.append("g").lower();n||(Vr++,g.append("line").attr("id","actor"+Vr).attr("x1",s).attr("y1",o).attr("x2",s).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name).attr("data-et","life-line").attr("data-id",e.name),e.actorCnt=Vr);const m=t.append("g");let y=e0;n?y+=` ${Dh}`:y+=` ${Ih}`,m.attr("class",y),m.attr("name",e.name),n||m.attr("data-et","participant").attr("data-type","actor").attr("data-id",e.name);const v=l==="neo"?.5:1,T=l==="neo"?a+(1-v)*30:a;m.append("line").attr("id","actor-man-torso"+Vr).attr("x1",s).attr("y1",T+25*v).attr("x2",s).attr("y2",T+45*v),m.append("line").attr("id","actor-man-arms"+Vr).attr("x1",s-Jf/2*v).attr("y1",T+33*v).attr("x2",s+Jf/2*v).attr("y2",T+33*v),m.append("line").attr("x1",s-Jf/2*v).attr("y1",T+60*v).attr("x2",s).attr("y2",T+45*v),m.append("line").attr("x1",s).attr("y1",T+45*v).attr("x2",s+(Jf/2-2)*v).attr("y2",T+60*v);const b=m.append("circle");b.attr("cx",e.x+e.width/2),b.attr("cy",T+10*v),b.attr("r",15*v),b.attr("width",e.width*v),b.attr("height",e.height*v);const w=m.node().getBBox();e.height=w.height;const k=Ys();k.x=e.x,k.y=T,k.fill="#eaeaea",k.width=e.width,k.height=e.height/v,k.class="actor",k.rx=3,k.ry=3;const A=i.get(e.name)??0;return fu.has(u)?(m.style("stroke",f[A%f.length]),m.style("fill",d[A%f.length])):m.style("stroke",p),pu(r,ui(e.description))(e.description,m,k.x,T+35*v-(l==="neo"?10:0),k.width,k.height,{class:`actor ${e0}`},r),e.height},"drawActorTypeActor"),Ult=x(async function(t,e,r,n,i,a,s){const o=s??new Map([...a.db.getActors().values()].map((l,u)=>[l.name,u]));switch(e.type){case"actor":return await Wlt(t,e,r,n,o);case"participant":return await Plt(t,e,r,n,o);case"boundary":return await Vlt(t,e,r,n,o);case"control":return await zlt(t,e,r,n,i,o);case"entity":return await Glt(t,e,r,n,o);case"database":return await qlt(t,e,r,n,o);case"collections":return await Blt(t,e,r,n,o);case"queue":return await Flt(t,e,r,n,o)}},"drawActor"),Hlt=x(function(t,e,r){const i=t.append("g");Zge(i,e),e.name&&pu(r)(e.name,i,e.x,e.y+r.boxTextMargin+(e.textMaxHeight||0)/2,e.width,0,{class:"text"},r),i.lower()},"drawBox"),Ylt=x(function(t){return t.append("g")},"anchorElement"),Xlt=x(function(t,e,r,n,i,a,s){const{theme:o,themeVariables:l}=n,{bkgColorArray:u,borderColorArray:h,mainBkg:d}=l,f=Ys(),p=e.anchored,g=e.actor;f.x=e.startx,f.y=e.starty,f.class="activation"+i%3,f.width=e.stopx-e.startx,f.height=r-e.starty;const m=XT(p,f),v=(s??new Map([...a.db.getActors().values()].map((T,b)=>[T.name,b]))).get(g)??0;fu.has(o)&&(m.style("stroke",h[v%h.length]),m.style("fill",u[v%h.length]??d))},"drawActivation"),Klt=x(async function(t,e,r,n,i){const{boxMargin:a,boxTextMargin:s,labelBoxHeight:o,labelBoxWidth:l,messageFontFamily:u,messageFontSize:h,messageFontWeight:d}=n,f=t.append("g").attr("data-et","control-structure").attr("data-id","i"+i.id),p=x(function(y,v,T,b){return f.append("line").attr("x1",y).attr("y1",v).attr("x2",T).attr("y2",b).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),e.sections!==void 0&&e.sections.forEach(function(y){p(e.startx,y.y,e.stopx,y.y).style("stroke-dasharray","3, 3")});let g=hI();g.text=r,g.x=e.startx,g.y=e.starty,g.fontFamily=u,g.fontSize=h,g.fontWeight=d,g.anchor="middle",g.valign="middle",g.tspan=!1,g.width=Math.max(l??0,50),g.height=o+(n.look==="neo"?15:0)||20,g.textMargin=s,g.class="labelText",Kge(f,g),g=Qge(),g.text=e.title,g.x=e.startx+l/2+(e.stopx-e.startx)/2,g.y=e.starty+a+s,g.anchor="middle",g.valign="middle",g.textMargin=s,g.class="loopText",g.fontFamily=u,g.fontSize=h,g.fontWeight=d,g.wrap=!0;let m=ui(g.text)?await ES(f,g,e):em(f,g);if(e.sectionTitles!==void 0){for(const[y,v]of Object.entries(e.sectionTitles))if(v.message){g.text=v.message,g.x=e.startx+(e.stopx-e.startx)/2,g.y=e.sections[y].y+a+s,g.class="sectionTitle",g.anchor="middle",g.valign="middle",g.tspan=!1,g.fontFamily=u,g.fontSize=h,g.fontWeight=d,g.wrap=e.wrap,ui(g.text)?(e.starty=e.sections[y].y,await ES(f,g,e)):em(f,g);let T=Math.round(m.map(b=>(b._groups||b)[0][0].getBBox().height).reduce((b,w)=>b+w));e.sections[y].height+=T-(a+s)}}return e.height=Math.round(e.stopy-e.starty),f},"drawLoop"),Zge=x(function(t,e){bte(t,e)},"drawBackgroundRect"),jlt=x(function(t,e){t.append("defs").append("symbol").attr("id",e+"-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"),Zlt=x(function(t,e){t.append("defs").append("symbol").attr("id",e+"-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"),Qlt=x(function(t,e){t.append("defs").append("symbol").attr("id",e+"-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"),Jlt=x(function(t,e){t.append("defs").append("marker").attr("id",e+"-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"),ect=x(function(t,e){t.append("defs").append("marker").attr("id",e+"-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"),tct=x(function(t,e){t.append("defs").append("marker").attr("id",e+"-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"),rct=x(function(t,e){t.append("defs").append("marker").attr("id",e+"-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"),nct=x(function(t,e){const{theme:r}=e;t.append("defs").append("filter").attr("id","drop-shadow").attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",`${r==="redux"||r==="redux-color"?"#000000":"#FFFFFF"}`)},"insertDropShadow"),Qge=x(function(){return{x:0,y:0,fill:void 0,anchor:void 0,style:"#666",width:void 0,height:void 0,textMargin:0,rx:0,ry:0,tspan:!0,valign:void 0}},"getTextObj"),ict=x(function(){return{x:0,y:0,fill:"#EDF2AE",stroke:"#666",width:100,anchor:"start",height:100,rx:0,ry:0}},"getNoteRect"),pu=(function(){function t(a,s,o,l,u,h,d){const f=s.append("text").attr("x",o+u/2).attr("y",l+h/2+5).style("text-anchor","middle").text(a);i(f,d)}x(t,"byText");function e(a,s,o,l,u,h,d,f){const{actorFontSize:p,actorFontFamily:g,actorFontWeight:m}=f,[y,v]=xc(p),T=a.split(Lt.lineBreakRegex);for(let b=0;bt.height||0))+(this.loops.length===0?0:this.loops.map(t=>t.height||0).reduce((t,e)=>t+e))+(this.messages.length===0?0:this.messages.map(t=>t.height||0).reduce((t,e)=>t+e))+(this.notes.length===0?0:this.notes.map(t=>t.height||0).reduce((t,e)=>t+e))},"getHeight"),clear:x(function(){this.actors=[],this.boxes=[],this.loops=[],this.messages=[],this.notes=[]},"clear"),addBox:x(function(t){this.boxes.push(t)},"addBox"),addActor:x(function(t){this.actors.push(t)},"addActor"),addLoop:x(function(t){this.loops.push(t)},"addLoop"),addMessage:x(function(t){this.messages.push(t)},"addMessage"),addNote:x(function(t){this.notes.push(t)},"addNote"),lastActor:x(function(){return this.actors[this.actors.length-1]},"lastActor"),lastLoop:x(function(){return this.loops[this.loops.length-1]},"lastLoop"),lastMessage:x(function(){return this.messages[this.messages.length-1]},"lastMessage"),lastNote:x(function(){return this.notes[this.notes.length-1]},"lastNote"),actors:[],boxes:[],loops:[],messages:[],notes:[]},init:x(function(){this.sequenceItems=[],this.activations=[],this.models.clear(),this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},this.verticalPos=0,rme(Pe())},"init"),updateVal:x(function(t,e,r,n){t[e]===void 0?t[e]=r:t[e]=n(r,t[e])},"updateVal"),updateBounds:x(function(t,e,r,n){const i=this;let a=0;function s(o){return x(function(u){a++;const h=i.sequenceItems.length-a+1;i.updateVal(u,"starty",e-h*Ye.boxMargin,Math.min),i.updateVal(u,"stopy",n+h*Ye.boxMargin,Math.max),i.updateVal(Tt.data,"startx",t-h*Ye.boxMargin,Math.min),i.updateVal(Tt.data,"stopx",r+h*Ye.boxMargin,Math.max),o!=="activation"&&(i.updateVal(u,"startx",t-h*Ye.boxMargin,Math.min),i.updateVal(u,"stopx",r+h*Ye.boxMargin,Math.max),i.updateVal(Tt.data,"starty",e-h*Ye.boxMargin,Math.min),i.updateVal(Tt.data,"stopy",n+h*Ye.boxMargin,Math.max))},"updateItemBounds")}x(s,"updateFn"),this.sequenceItems.forEach(s()),this.activations.forEach(s("activation"))},"updateBounds"),insert:x(function(t,e,r,n){const i=Lt.getMin(t,r),a=Lt.getMax(t,r),s=Lt.getMin(e,n),o=Lt.getMax(e,n);this.updateVal(Tt.data,"startx",i,Math.min),this.updateVal(Tt.data,"starty",s,Math.min),this.updateVal(Tt.data,"stopx",a,Math.max),this.updateVal(Tt.data,"stopy",o,Math.max),this.updateBounds(i,s,a,o)},"insert"),newActivation:x(function(t,e,r){const n=r.get(t.from),i=SS(t.from).length||0,a=n.x+n.width/2+(i-1)*Ye.activationWidth/2;this.activations.push({startx:a,starty:this.verticalPos+2,stopx:a+Ye.activationWidth,stopy:void 0,actor:t.from,anchored:Rn.anchorElement(e)})},"newActivation"),endActivation:x(function(t){const e=this.activations.map(function(r){return r.actor}).lastIndexOf(t.from);return this.activations.splice(e,1)[0]},"endActivation"),createLoop:x(function(t={message:void 0,wrap:!1,width:void 0},e){return{startx:void 0,starty:this.verticalPos,stopx:void 0,stopy:void 0,title:t.message,wrap:t.wrap,width:t.width,height:0,fill:e}},"createLoop"),newLoop:x(function(t={message:void 0,wrap:!1,width:void 0},e){this.sequenceItems.push(this.createLoop(t,e))},"newLoop"),endLoop:x(function(){return this.sequenceItems.pop()},"endLoop"),isLoopOverlap:x(function(){return this.sequenceItems.length?this.sequenceItems[this.sequenceItems.length-1].overlap:!1},"isLoopOverlap"),addSectionToLoop:x(function(t){const e=this.sequenceItems.pop();e.sections=e.sections||[],e.sectionTitles=e.sectionTitles||[],e.sections.push({y:Tt.getVerticalPos(),height:0}),e.sectionTitles.push(t),this.sequenceItems.push(e)},"addSectionToLoop"),saveVerticalPos:x(function(){this.isLoopOverlap()&&(this.savedVerticalPos=this.verticalPos)},"saveVerticalPos"),resetVerticalPos:x(function(){this.isLoopOverlap()&&(this.verticalPos=this.savedVerticalPos)},"resetVerticalPos"),bumpVerticalPos:x(function(t){this.verticalPos=this.verticalPos+t,this.data.stopy=Lt.getMax(this.data.stopy,this.verticalPos)},"bumpVerticalPos"),getVerticalPos:x(function(){return this.verticalPos},"getVerticalPos"),getBounds:x(function(){return{bounds:this.data,models:this.models}},"getBounds")},uct=x(async function(t,e,r){Tt.bumpVerticalPos(Ye.boxMargin),e.height=Ye.boxMargin,e.starty=Tt.getVerticalPos();const n=Ys();n.x=e.startx,n.y=e.starty,n.width=e.width||Ye.width,n.class="note";const i=t.append("g");i.attr("data-et","note"),i.attr("data-id","i"+r);const a=Rn.drawRect(i,n),s=hI();s.x=e.startx,s.y=e.starty,s.width=n.width,s.dy="1em",s.text=e.message,s.class="noteText",s.fontFamily=Ye.noteFontFamily,s.fontSize=Ye.noteFontSize,s.fontWeight=Ye.noteFontWeight,s.anchor=Ye.noteAlign,s.textMargin=Ye.noteMargin,s.valign="center";const o=ui(s.text)?await ES(i,s):em(i,s),l=Math.round(o.map(u=>(u._groups||u)[0][0].getBBox().height).reduce((u,h)=>u+h));a.attr("height",l+2*Ye.noteMargin),e.height+=l+2*Ye.noteMargin,Tt.bumpVerticalPos(l+2*Ye.noteMargin),e.stopy=e.starty+l+2*Ye.noteMargin,e.stopx=e.startx+n.width,Tt.insert(e.startx,e.starty,e.stopx,e.stopy),Tt.models.addNote(e)},"drawNote"),Jge=x(function(t,e,r,n,i,a,s){const o=n.db.getActors(),l=o.get(e.from),u=o.get(e.to),h=r.sequenceVisible;let d=l.x+l.width/2,f=u.x+u.width/2;const p=d<=f,g=ome(e,n),m=t.append("g"),y=16.5,v=x((A,C)=>{const _=A?y:-y;return C?-_:_},"getCircleOffset"),T=x(A=>{m.append("circle").attr("cx",A).attr("cy",s).attr("r",5).attr("width",10).attr("height",10)},"drawCircle"),{CENTRAL_CONNECTION:b,CENTRAL_CONNECTION_REVERSE:w,CENTRAL_CONNECTION_DUAL:k}=n.db.LINETYPE;if(h)switch(e.centralConnection){case b:g&&(f+=v(p,!0));break;case w:g||(d+=v(p,!1));break;case k:g?f+=v(p,!0):d+=v(p,!1);break}switch(e.centralConnection){case b:T(f);break;case w:T(d);break;case k:T(d),T(f);break}},"drawCentralConnection"),t0=x(t=>({fontFamily:t.messageFontFamily,fontSize:t.messageFontSize,fontWeight:t.messageFontWeight}),"messageFont"),tm=x(t=>({fontFamily:t.noteFontFamily,fontSize:t.noteFontSize,fontWeight:t.noteFontWeight}),"noteFont"),w$=x(t=>({fontFamily:t.actorFontFamily,fontSize:t.actorFontSize,fontWeight:t.actorFontWeight}),"actorFont");async function eme(t,e){Tt.bumpVerticalPos(10);const{startx:r,stopx:n,message:i}=e,a=Lt.splitBreaks(i).length,s=ui(i),o=s?await h2(i,Pe()):Lr.calculateTextDimensions(i,t0(Ye));if(!s){const d=o.height/a;e.height+=d,Tt.bumpVerticalPos(d)}let l,u=o.height-10;const h=o.width;if(r===n){l=Tt.getVerticalPos()+u,Ye.rightAngles||(u+=Ye.boxMargin,l=Tt.getVerticalPos()+u),u+=30;const d=Lt.getMax(h/2,Ye.width/2);Tt.insert(r-d,Tt.getVerticalPos()-10+u,n+d,Tt.getVerticalPos()+30+u)}else u+=Ye.boxMargin,l=Tt.getVerticalPos()+u,Tt.insert(r,l-10,n,l);return Tt.bumpVerticalPos(u),e.height+=u,e.stopy=e.starty+e.height,Tt.insert(e.fromBounds,e.starty,e.toBounds,e.stopy),l}x(eme,"boundMessage");var hct=x(async function(t,e,r,n,i,a){const{startx:s,stopx:o,starty:l,message:u,type:h,sequenceIndex:d,sequenceVisible:f}=e,p=Lr.calculateTextDimensions(u,t0(Ye)),g=hI();g.x=Math.min(s,o),g.y=l+10,g.width=Math.abs(o-s),g.class="messageText",g.dy="1em",g.text=u,g.fontFamily=Ye.messageFontFamily,g.fontSize=Ye.messageFontSize,g.fontWeight=Ye.messageFontWeight,g.anchor=Ye.messageAlign,g.valign="center",g.textMargin=Ye.wrapPadding,g.tspan=!1,ui(g.text)?await ES(t,g,{startx:s,stopx:o,starty:r}):em(t,g);const m=p.width;let y;if(s===o){const T=f||Ye.showSequenceNumbers,b=ome(i,n),w=vct(i,n),k=s+(T&&(b||w)?10:0);Ye.rightAngles?y=t.append("path").attr("d",`M ${k},${r} H ${s+Lt.getMax(Ye.width/2,m/2)} V ${r+25} H ${s}`):y=t.append("path").attr("d","M "+k+","+r+" C "+(k+60)+","+(r-10)+" "+(s+60)+","+(r+30)+" "+s+","+(r+20)),k$(i,n)&&Jge(t,i,e,n,s,o,r)}else y=t.append("line"),y.attr("x1",s),y.attr("y1",r),y.attr("x2",o),y.attr("y2",r),k$(i,n)&&Jge(t,i,e,n,s,o,r);h===n.db.LINETYPE.DOTTED||h===n.db.LINETYPE.DOTTED_CROSS||h===n.db.LINETYPE.DOTTED_POINT||h===n.db.LINETYPE.DOTTED_OPEN||h===n.db.LINETYPE.BIDIRECTIONAL_DOTTED||h===n.db.LINETYPE.SOLID_TOP_DOTTED||h===n.db.LINETYPE.SOLID_BOTTOM_DOTTED||h===n.db.LINETYPE.STICK_TOP_DOTTED||h===n.db.LINETYPE.STICK_BOTTOM_DOTTED||h===n.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED||h===n.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED||h===n.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED||h===n.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED?(y.style("stroke-dasharray","3, 3"),y.attr("class","messageLine1")):y.attr("class","messageLine0"),y.attr("data-et","message"),y.attr("data-id","i"+e.id),y.attr("data-from",e.from),y.attr("data-to",e.to);let v="";if(Ye.arrowMarkerAbsolute&&(v=Aw(!0)),y.attr("stroke-width",2),y.attr("stroke","none"),y.style("fill","none"),(h===n.db.LINETYPE.SOLID_TOP||h===n.db.LINETYPE.SOLID_TOP_DOTTED)&&y.attr("marker-end","url("+v+"#"+a+"-solidTopArrowHead)"),(h===n.db.LINETYPE.SOLID_BOTTOM||h===n.db.LINETYPE.SOLID_BOTTOM_DOTTED)&&y.attr("marker-end","url("+v+"#"+a+"-solidBottomArrowHead)"),(h===n.db.LINETYPE.STICK_TOP||h===n.db.LINETYPE.STICK_TOP_DOTTED)&&y.attr("marker-end","url("+v+"#"+a+"-stickTopArrowHead)"),(h===n.db.LINETYPE.STICK_BOTTOM||h===n.db.LINETYPE.STICK_BOTTOM_DOTTED)&&y.attr("marker-end","url("+v+"#"+a+"-stickBottomArrowHead)"),(h===n.db.LINETYPE.SOLID_ARROW_TOP_REVERSE||h===n.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED)&&y.attr("marker-start","url("+v+"#"+a+"-solidBottomArrowHead)"),(h===n.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE||h===n.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED)&&y.attr("marker-start","url("+v+"#"+a+"-solidTopArrowHead)"),(h===n.db.LINETYPE.STICK_ARROW_TOP_REVERSE||h===n.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED)&&y.attr("marker-start","url("+v+"#"+a+"-stickBottomArrowHead)"),(h===n.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE||h===n.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED)&&y.attr("marker-start","url("+v+"#"+a+"-stickTopArrowHead)"),(h===n.db.LINETYPE.SOLID||h===n.db.LINETYPE.DOTTED)&&y.attr("marker-end","url("+v+"#"+a+"-arrowhead)"),(h===n.db.LINETYPE.BIDIRECTIONAL_SOLID||h===n.db.LINETYPE.BIDIRECTIONAL_DOTTED)&&(y.attr("marker-start","url("+v+"#"+a+"-arrowhead)"),y.attr("marker-end","url("+v+"#"+a+"-arrowhead)")),(h===n.db.LINETYPE.SOLID_POINT||h===n.db.LINETYPE.DOTTED_POINT)&&y.attr("marker-end","url("+v+"#"+a+"-filled-head)"),(h===n.db.LINETYPE.SOLID_CROSS||h===n.db.LINETYPE.DOTTED_CROSS)&&y.attr("marker-end","url("+v+"#"+a+"-crosshead)"),f||Ye.showSequenceNumbers){const T=h===n.db.LINETYPE.BIDIRECTIONAL_SOLID||h===n.db.LINETYPE.BIDIRECTIONAL_DOTTED,b=h===n.db.LINETYPE.SOLID_ARROW_TOP_REVERSE||h===n.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED||h===n.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE||h===n.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED||h===n.db.LINETYPE.STICK_ARROW_TOP_REVERSE||h===n.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED||h===n.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE||h===n.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED,w=6,k=k$(i,n);let A=s,C=o;T?(ss?C=o-2*w:(C=o-w,A+=(i==null?void 0:i.centralConnection)===n.db.LINETYPE.CENTRAL_CONNECTION_DUAL||(i==null?void 0:i.centralConnection)===n.db.LINETYPE.CENTRAL_CONNECTION_REVERSE?-7.5:0),C+=k?15:0,y.attr("x2",C),y.attr("x1",A)):y.attr("x1",s+w);let _=0;const L=s===o,O=s<=o;L?_=e.fromBounds+1:b?_=O?e.toBounds-1:e.fromBounds+1:_=O?e.fromBounds+1:e.toBounds-1;let M="12px";const z=d.toString().length;z>5?M="7px":z>3&&(M="9px"),t.append("line").attr("x1",_).attr("y1",r).attr("x2",_).attr("y2",r).attr("stroke-width",0).attr("marker-start","url("+v+"#"+a+"-sequencenumber)"),t.append("text").attr("x",_).attr("y",r+4).attr("font-family","sans-serif").attr("font-size",M).attr("text-anchor","middle").attr("class","sequenceNumber").text(d)}},"drawMessage"),dct=x(function(t,e,r,n,i,a,s){let o=0,l=0,u,h=0;for(const d of n){const f=e.get(d),p=f.box;u&&u!=p&&(s||Tt.models.addBox(u),l+=Ye.boxMargin+u.margin),p&&p!=u&&(s||(p.x=o+l,p.y=i),l+=p.margin),f.width=Lt.getMax(f.width||Ye.width,Ye.width),f.height=Lt.getMax(f.height||Ye.height,Ye.height),f.margin=f.margin||Ye.actorMargin,h=Lt.getMax(h,f.height),r.get(f.name)&&(l+=f.width/2),f.x=o+l,f.starty=Tt.getVerticalPos(),Tt.insert(f.x,i,f.x+f.width,f.height),o+=f.width+l,f.box&&(f.box.width=o+p.margin-f.box.x),l=f.margin,u=f.box,Tt.models.addActor(f)}u&&!s&&Tt.models.addBox(u),Tt.bumpVerticalPos(h)},"addActorRenderingData"),C$=x(async function(t,e,r,n,i,a,s){if(n){let o=0;Tt.bumpVerticalPos(Ye.boxMargin*2);for(const l of r){const u=e.get(l);u.stopy||(u.stopy=Tt.getVerticalPos());const h=await Rn.drawActor(t,u,Ye,!0,i,a,s);o=Lt.getMax(o,h)}Tt.bumpVerticalPos(o+Ye.boxMargin)}else for(const o of r){const l=e.get(o);await Rn.drawActor(t,l,Ye,!1,i,a,s)}},"drawActors"),tme=x(function(t,e,r,n){let i=0,a=0;for(const s of r){const o=e.get(s),l=pct(o),u=Rn.drawPopup(t,o,l,Ye,Ye.forceMenus,n);u.height>i&&(i=u.height),u.width+o.x>a&&(a=u.width+o.x)}return{maxHeight:i,maxWidth:a}},"drawActorsPopup"),rme=x(function(t){ci(Ye,t),t.fontFamily&&(Ye.actorFontFamily=Ye.noteFontFamily=Ye.messageFontFamily=t.fontFamily),t.fontSize&&(Ye.actorFontSize=Ye.noteFontSize=Ye.messageFontSize=t.fontSize),t.fontWeight&&(Ye.actorFontWeight=Ye.noteFontWeight=Ye.messageFontWeight=t.fontWeight)},"setConf"),SS=x(function(t){return Tt.activations.filter(function(e){return e.actor===t})},"actorActivations"),nme=x(function(t,e){const r=e.get(t),n=SS(t),i=n.reduce(function(s,o){return Lt.getMin(s,o.startx)},r.x+r.width/2-1),a=n.reduce(function(s,o){return Lt.getMax(s,o.stopx)},r.x+r.width/2+1);return[i,a]},"activationBounds");function Jo(t,e,r,n,i){Tt.bumpVerticalPos(r);let a=n;if(e.id&&e.message&&t[e.id]){const s=t[e.id].width,o=t0(Ye);e.message=Lr.wrapLabel(`[${e.message}]`,s-2*Ye.wrapPadding,o),e.width=s,e.wrap=!0;const l=Lr.calculateTextDimensions(e.message,o),u=Lt.getMax(l.height,Ye.labelBoxHeight);a=n+u,ae.debug(`${u} - ${e.message}`)}i(e),Tt.bumpVerticalPos(a)}x(Jo,"adjustLoopHeightForWrap");function ime(t,e,r,n,i,a,s){function o(h,d){h.x{P.add(G.from),P.add(G.to)}),m=m.filter(G=>P.has(G))}const k=new Map(m.map((P,G)=>{var V;return[((V=d.get(P))==null?void 0:V.name)??P,G]}));dct(h,d,f,m,0,y,!1);const A=await xct(y,d,w,n);Rn.insertArrowHead(h,e),Rn.insertArrowCrossHead(h,e),Rn.insertArrowFilledHead(h,e),Rn.insertSequenceNumber(h,e),Rn.insertSolidTopArrowHead(h,e),Rn.insertSolidBottomArrowHead(h,e),Rn.insertStickTopArrowHead(h,e),Rn.insertStickBottomArrowHead(h,e),s==="neo"&&Rn.insertDropShadow(h,Ye);function C(P,G){const V=Tt.endActivation(P);V.starty+18>G&&(V.starty=G-6,G+=12),Rn.drawActivation(h,V,G,Ye,SS(P.from).length,n,k),Tt.insert(V.startx,G-10,V.stopx,G)}x(C,"activeEnd");let _=1,L=1;const O=[],M=[];let z=0;for(const P of y){let G,V,Y;switch(P.type){case n.db.LINETYPE.NOTE:Tt.resetVerticalPos(),V=P.noteModel,await uct(h,V,P.id);break;case n.db.LINETYPE.ACTIVE_START:Tt.newActivation(P,h,d);break;case n.db.LINETYPE.CENTRAL_CONNECTION:Tt.newActivation(P,h,d);break;case n.db.LINETYPE.CENTRAL_CONNECTION_REVERSE:Tt.newActivation(P,h,d);break;case n.db.LINETYPE.ACTIVE_END:C(P,Tt.getVerticalPos());break;case n.db.LINETYPE.LOOP_START:Jo(A,P,Ye.boxMargin,Ye.boxMargin+Ye.boxTextMargin,W=>Tt.newLoop(W));break;case n.db.LINETYPE.LOOP_END:G=Tt.endLoop(),await Rn.drawLoop(h,G,"loop",Ye,P),Tt.bumpVerticalPos(G.stopy-Tt.getVerticalPos()),Tt.models.addLoop(G);break;case n.db.LINETYPE.RECT_START:Jo(A,P,Ye.boxMargin,Ye.boxMargin,W=>Tt.newLoop(void 0,W.message));break;case n.db.LINETYPE.RECT_END:G=Tt.endLoop(),M.push(G),Tt.models.addLoop(G),Tt.bumpVerticalPos(G.stopy-Tt.getVerticalPos());break;case n.db.LINETYPE.OPT_START:Jo(A,P,Ye.boxMargin,Ye.boxMargin+Ye.boxTextMargin,W=>Tt.newLoop(W));break;case n.db.LINETYPE.OPT_END:G=Tt.endLoop(),await Rn.drawLoop(h,G,"opt",Ye,P),Tt.bumpVerticalPos(G.stopy-Tt.getVerticalPos()),Tt.models.addLoop(G);break;case n.db.LINETYPE.ALT_START:Jo(A,P,Ye.boxMargin,Ye.boxMargin+Ye.boxTextMargin,W=>Tt.newLoop(W));break;case n.db.LINETYPE.ALT_ELSE:Jo(A,P,Ye.boxMargin+Ye.boxTextMargin,Ye.boxMargin,W=>Tt.addSectionToLoop(W));break;case n.db.LINETYPE.ALT_END:G=Tt.endLoop(),await Rn.drawLoop(h,G,"alt",Ye,P),Tt.bumpVerticalPos(G.stopy-Tt.getVerticalPos()),Tt.models.addLoop(G);break;case n.db.LINETYPE.PAR_START:case n.db.LINETYPE.PAR_OVER_START:Jo(A,P,Ye.boxMargin,Ye.boxMargin+Ye.boxTextMargin,W=>Tt.newLoop(W)),Tt.saveVerticalPos();break;case n.db.LINETYPE.PAR_AND:Jo(A,P,Ye.boxMargin+Ye.boxTextMargin,Ye.boxMargin,W=>Tt.addSectionToLoop(W));break;case n.db.LINETYPE.PAR_END:G=Tt.endLoop(),await Rn.drawLoop(h,G,"par",Ye,P),Tt.bumpVerticalPos(G.stopy-Tt.getVerticalPos()),Tt.models.addLoop(G);break;case n.db.LINETYPE.AUTONUMBER:_=P.message.start||_,L=P.message.step||L,P.message.visible?n.db.enableSequenceNumbers():n.db.disableSequenceNumbers();break;case n.db.LINETYPE.CRITICAL_START:Jo(A,P,Ye.boxMargin,Ye.boxMargin+Ye.boxTextMargin,W=>Tt.newLoop(W));break;case n.db.LINETYPE.CRITICAL_OPTION:Jo(A,P,Ye.boxMargin+Ye.boxTextMargin,Ye.boxMargin,W=>Tt.addSectionToLoop(W));break;case n.db.LINETYPE.CRITICAL_END:G=Tt.endLoop(),await Rn.drawLoop(h,G,"critical",Ye,P),Tt.bumpVerticalPos(G.stopy-Tt.getVerticalPos()),Tt.models.addLoop(G);break;case n.db.LINETYPE.BREAK_START:Jo(A,P,Ye.boxMargin,Ye.boxMargin+Ye.boxTextMargin,W=>Tt.newLoop(W));break;case n.db.LINETYPE.BREAK_END:G=Tt.endLoop(),await Rn.drawLoop(h,G,"break",Ye,P),Tt.bumpVerticalPos(G.stopy-Tt.getVerticalPos()),Tt.models.addLoop(G);break;default:try{Y=P.msgModel,Y.starty=Tt.getVerticalPos(),Y.sequenceIndex=_,Y.sequenceVisible=n.db.showSequenceNumbers(),Y.id=P.id,Y.from=P.from,Y.to=P.to;const W=await eme(h,Y);ime(P,Y,W,z,d,f,p),O.push({messageModel:Y,lineStartY:W,msg:P}),Tt.models.addMessage(Y)}catch(W){ae.error("error while drawing message",W)}}[n.db.LINETYPE.SOLID_OPEN,n.db.LINETYPE.DOTTED_OPEN,n.db.LINETYPE.SOLID,n.db.LINETYPE.SOLID_TOP,n.db.LINETYPE.SOLID_BOTTOM,n.db.LINETYPE.STICK_TOP,n.db.LINETYPE.STICK_BOTTOM,n.db.LINETYPE.SOLID_TOP_DOTTED,n.db.LINETYPE.SOLID_BOTTOM_DOTTED,n.db.LINETYPE.STICK_TOP_DOTTED,n.db.LINETYPE.STICK_BOTTOM_DOTTED,n.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,n.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE,n.db.LINETYPE.STICK_ARROW_TOP_REVERSE,n.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE,n.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,n.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,n.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED,n.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED,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(P.type)&&(_=Math.round((_+L)*100)/100),z++}ae.debug("createdActors",f),ae.debug("destroyedActors",p),await C$(h,d,m,!1,e,n,k);for(const P of O)await hct(h,P.messageModel,P.lineStartY,n,P.msg,e);Ye.mirrorActors&&await C$(h,d,m,!0,e,n,k),M.forEach(P=>Rn.drawBackgroundRect(h,P)),jge(h,d,m,Ye);for(const P of Tt.models.boxes){P.height=Tt.getVerticalPos()-P.y,Tt.insert(P.x,P.y,P.x+P.width,P.height);const G=Ye.boxMargin*2;P.startx=P.x-G,P.starty=P.y-G*.25,P.stopx=P.startx+P.width+2*G,P.stopy=P.starty+P.height+G*.75,P.stroke="rgb(0,0,0, 0.5)",Rn.drawBox(h,P,Ye)}T&&Tt.bumpVerticalPos(Ye.boxMargin);const F=tme(h,d,m,u),{bounds:S}=Tt.getBounds();S.startx===void 0&&(S.startx=0),S.starty===void 0&&(S.starty=0),S.stopx===void 0&&(S.stopx=0),S.stopy===void 0&&(S.stopy=0);let R=S.stopy-S.starty;R{const s=t0(Ye);let o=a.actorKeys.reduce((d,f)=>d+=t.get(f).width+(t.get(f).margin||0),0);const l=Ye.boxMargin*8;o+=l,o-=2*Ye.boxTextMargin,a.wrap&&(a.name=Lr.wrapLabel(a.name,o-2*Ye.wrapPadding,s));const u=Lr.calculateTextDimensions(a.name,s);i=Lt.getMax(u.height,i);const h=Lt.getMax(o,u.width+2*Ye.wrapPadding);if(a.margin=Ye.boxTextMargin,oa.textMaxHeight=i),Lt.getMax(n,Ye.height)}x(sme,"calculateActorMargins");var gct=x(async function(t,e,r){const n=e.get(t.from),i=e.get(t.to),a=n.x,s=i.x,o=t.wrap&&t.message;let l=ui(t.message)?await h2(t.message,Pe()):Lr.calculateTextDimensions(o?Lr.wrapLabel(t.message,Ye.width,tm(Ye)):t.message,tm(Ye));const u={width:o?Ye.width:Lt.getMax(Ye.width,l.width+2*Ye.noteMargin),height:0,startx:n.x,stopx:0,starty:0,stopy:0,message:t.message};return t.placement===r.db.PLACEMENT.RIGHTOF?(u.width=o?Lt.getMax(Ye.width,l.width):Lt.getMax(n.width/2+i.width/2,l.width+2*Ye.noteMargin),u.startx=a+(n.width+Ye.actorMargin)/2):t.placement===r.db.PLACEMENT.LEFTOF?(u.width=o?Lt.getMax(Ye.width,l.width+2*Ye.noteMargin):Lt.getMax(n.width/2+i.width/2,l.width+2*Ye.noteMargin),u.startx=a-u.width+(n.width-Ye.actorMargin)/2):t.to===t.from?(l=Lr.calculateTextDimensions(o?Lr.wrapLabel(t.message,Lt.getMax(Ye.width,n.width),tm(Ye)):t.message,tm(Ye)),u.width=o?Lt.getMax(Ye.width,n.width):Lt.getMax(n.width,Ye.width,l.width+2*Ye.noteMargin),u.startx=a+(n.width-u.width)/2):(u.width=Math.abs(a+n.width/2-(s+i.width/2))+Ye.actorMargin,u.startx=a2,f=x(y=>l?-y:y,"adjustValue");t.from===t.to?h=u:(t.activate&&!d&&(h+=f(Ye.activationWidth/2-1)),[r.db.LINETYPE.SOLID_OPEN,r.db.LINETYPE.DOTTED_OPEN,r.db.LINETYPE.STICK_TOP,r.db.LINETYPE.STICK_BOTTOM,r.db.LINETYPE.STICK_TOP_DOTTED,r.db.LINETYPE.STICK_BOTTOM_DOTTED,r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,r.db.LINETYPE.STICK_ARROW_TOP_REVERSE,r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE,r.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED,r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED,r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE].includes(t.type)||(h+=f(3)),[r.db.LINETYPE.BIDIRECTIONAL_SOLID,r.db.LINETYPE.BIDIRECTIONAL_DOTTED,r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE].includes(t.type)&&(u-=f(3)));const p=[i,a,s,o],g=Math.abs(u-h);t.wrap&&t.message&&(t.message=Lr.wrapLabel(t.message,Lt.getMax(g+2*Ye.wrapPadding,Ye.width),t0(Ye)));const m=Lr.calculateTextDimensions(t.message,t0(Ye));return{width:Lt.getMax(t.wrap?0:m.width+2*Ye.wrapPadding,g+2*Ye.wrapPadding,Ye.width),height:0,startx:u,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"),xct=x(async function(t,e,r,n){const i={},a=[];let s,o,l;for(const u of t){switch(u.type){case n.db.LINETYPE.LOOP_START:case n.db.LINETYPE.ALT_START:case n.db.LINETYPE.OPT_START:case n.db.LINETYPE.PAR_START:case n.db.LINETYPE.PAR_OVER_START:case n.db.LINETYPE.CRITICAL_START:case n.db.LINETYPE.BREAK_START:a.push({id:u.id,msg:u.message,from:Number.MAX_SAFE_INTEGER,to:Number.MIN_SAFE_INTEGER,width:0});break;case n.db.LINETYPE.ALT_ELSE:case n.db.LINETYPE.PAR_AND:case n.db.LINETYPE.CRITICAL_OPTION:u.message&&(s=a.pop(),i[s.id]=s,i[u.id]=s,a.push(s));break;case n.db.LINETYPE.LOOP_END:case n.db.LINETYPE.ALT_END:case n.db.LINETYPE.OPT_END:case n.db.LINETYPE.PAR_END:case n.db.LINETYPE.CRITICAL_END:case n.db.LINETYPE.BREAK_END:s=a.pop(),i[s.id]=s;break;case n.db.LINETYPE.ACTIVE_START:{const d=e.get(u.from?u.from:u.to.actor),f=SS(u.from?u.from:u.to.actor).length,p=d.x+d.width/2+(f-1)*Ye.activationWidth/2,g={startx:p,stopx:p+Ye.activationWidth,actor:u.from,enabled:!0};Tt.activations.push(g)}break;case n.db.LINETYPE.ACTIVE_END:{const d=Tt.activations.map(f=>f.actor).lastIndexOf(u.from);Tt.activations.splice(d,1).splice(0,1)}break}u.placement!==void 0?(o=await gct(u,e,n),u.noteModel=o,a.forEach(d=>{s=d,s.from=Lt.getMin(s.from,o.startx),s.to=Lt.getMax(s.to,o.startx+o.width),s.width=Lt.getMax(s.width,Math.abs(s.from-s.to))-Ye.labelBoxWidth})):(l=bct(u,e,n),u.msgModel=l,l.startx&&l.stopx&&a.length>0&&a.forEach(d=>{if(s=d,l.startx===l.stopx){const f=e.get(u.from),p=e.get(u.to);s.from=Lt.getMin(f.x-l.width/2,f.x-f.width/2,s.from),s.to=Lt.getMax(p.x+l.width/2,p.x+f.width/2,s.to),s.width=Lt.getMax(s.width,Math.abs(s.to-s.from))-Ye.labelBoxWidth}else s.from=Lt.getMin(l.startx,s.from),s.to=Lt.getMax(l.stopx,s.to),s.width=Lt.getMax(s.width,l.width)-Ye.labelBoxWidth}))}return Tt.activations=[],ae.debug("Loop type widths:",i),i},"calculateLoopBounds"),Tct={bounds:Tt,drawActors:C$,drawActorsPopup:tme,setConf:rme,draw:fct},wct={parser:Rlt,get db(){return new Mlt},renderer:Tct,styles:Olt,init:x(t=>{t.sequence||(t.sequence={}),t.wrap&&(t.sequence.wrap=t.wrap,O6({sequence:{wrap:t.wrap}}))},"init")};const Cct=Object.freeze(Object.defineProperty({__proto__:null,diagram:wct},Symbol.toStringTag,{value:"Module"}));var E$=(function(){var t=x(function(tt,je,Ce,Se){for(Ce=Ce||{},Se=tt.length;Se--;Ce[tt[Se]]=je);return Ce},"o"),e=[1,18],r=[1,19],n=[1,20],i=[1,41],a=[1,26],s=[1,42],o=[1,24],l=[1,25],u=[1,32],h=[1,33],d=[1,34],f=[1,45],p=[1,35],g=[1,36],m=[1,37],y=[1,38],v=[1,27],T=[1,28],b=[1,29],w=[1,30],k=[1,31],A=[1,44],C=[1,46],_=[1,43],L=[1,47],O=[1,9],M=[1,8,9],z=[1,58],F=[1,59],S=[1,60],R=[1,61],N=[1,62],D=[1,63],I=[1,64],$=[1,8,9,41],B=[1,77],P=[1,8,9,12,13,22,39,41,44,46,68,69,70,71,72,73,74,79,81],G=[1,8,9,12,13,18,20,22,39,41,44,46,47,60,68,69,70,71,72,73,74,79,81,86,100,102,103],V=[13,60,86,100,102,103],Y=[13,60,73,74,86,100,102,103],W=[13,60,68,69,70,71,72,86,100,102,103],ie=[1,103],K=[1,121],se=[1,117],J=[1,113],Z=[1,119],ee=[1,114],ne=[1,115],ue=[1,116],fe=[1,118],_e=[1,120],Ae=[22,50,60,61,82,86,87,88,89,90],Ne=[1,128],me=[12,39],ve=[1,8,9,39,41,44,46],Ge=[1,8,9,22],Te=[1,153],Ze=[1,8,9,61],ke=[1,8,9,22,50,60,61,82,86,87,88,89,90],Ve={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mermaidDoc:4,statements:5,graphConfig:6,CLASS_DIAGRAM:7,NEWLINE:8,EOF:9,statement:10,classLabel:11,SQS:12,STR:13,SQE:14,namespaceName:15,alphaNumToken:16,classLiteralName:17,DOT:18,className:19,GENERICTYPE:20,relationStatement:21,LABEL:22,namespaceStatement:23,classStatement:24,memberStatement:25,annotationStatement:26,clickStatement:27,styleStatement:28,cssClassStatement:29,noteStatement:30,classDefStatement:31,direction:32,acc_title:33,acc_title_value:34,acc_descr:35,acc_descr_value:36,acc_descr_multiline_value:37,namespaceIdentifier:38,STRUCT_START:39,classStatements:40,STRUCT_STOP:41,NAMESPACE:42,classIdentifier:43,STYLE_SEPARATOR:44,members:45,ANNOTATION_START:46,ANNOTATION_END:47,CLASS:48,emptyBody:49,SPACE:50,MEMBER:51,SEPARATOR:52,relation:53,NOTE_FOR:54,noteText:55,NOTE:56,CLASSDEF:57,classList:58,stylesOpt:59,ALPHA:60,COMMA:61,direction_tb:62,direction_bt:63,direction_rl:64,direction_lr:65,relationType:66,lineType:67,AGGREGATION:68,EXTENSION:69,COMPOSITION:70,DEPENDENCY:71,LOLLIPOP:72,LINE:73,DOTTED_LINE:74,CALLBACK:75,LINK:76,LINK_TARGET:77,CLICK:78,CALLBACK_NAME:79,CALLBACK_ARGS:80,HREF:81,STYLE:82,CSSCLASS:83,style:84,styleComponent:85,NUM:86,COLON:87,UNIT:88,BRKT:89,PCT:90,commentToken:91,textToken:92,graphCodeTokens:93,textNoTagsToken:94,TAGSTART:95,TAGEND:96,"==":97,"--":98,DEFAULT:99,MINUS:100,keywords:101,UNICODE_TEXT:102,BQUOTE_STR:103,$accept:0,$end:1},terminals_:{2:"error",7:"CLASS_DIAGRAM",8:"NEWLINE",9:"EOF",12:"SQS",13:"STR",14:"SQE",18:"DOT",20:"GENERICTYPE",22:"LABEL",33:"acc_title",34:"acc_title_value",35:"acc_descr",36:"acc_descr_value",37:"acc_descr_multiline_value",39:"STRUCT_START",41:"STRUCT_STOP",42:"NAMESPACE",44:"STYLE_SEPARATOR",46:"ANNOTATION_START",47:"ANNOTATION_END",48:"CLASS",50:"SPACE",51:"MEMBER",52:"SEPARATOR",54:"NOTE_FOR",56:"NOTE",57:"CLASSDEF",60:"ALPHA",61:"COMMA",62:"direction_tb",63:"direction_bt",64:"direction_rl",65:"direction_lr",68:"AGGREGATION",69:"EXTENSION",70:"COMPOSITION",71:"DEPENDENCY",72:"LOLLIPOP",73:"LINE",74:"DOTTED_LINE",75:"CALLBACK",76:"LINK",77:"LINK_TARGET",78:"CLICK",79:"CALLBACK_NAME",80:"CALLBACK_ARGS",81:"HREF",82:"STYLE",83:"CSSCLASS",86:"NUM",87:"COLON",88:"UNIT",89:"BRKT",90:"PCT",93:"graphCodeTokens",95:"TAGSTART",96:"TAGEND",97:"==",98:"--",99:"DEFAULT",100:"MINUS",101:"keywords",102:"UNICODE_TEXT",103:"BQUOTE_STR"},productions_:[0,[3,1],[3,1],[4,1],[6,4],[5,1],[5,2],[5,3],[11,3],[15,1],[15,1],[15,3],[15,2],[19,1],[19,3],[19,1],[19,2],[19,2],[19,2],[10,1],[10,2],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,2],[10,2],[10,1],[23,4],[23,5],[38,2],[38,3],[40,1],[40,2],[40,3],[40,1],[40,2],[40,3],[40,1],[40,2],[40,3],[24,1],[24,3],[24,4],[24,3],[24,6],[24,4],[24,7],[24,6],[43,2],[43,3],[49,0],[49,2],[49,2],[26,4],[45,1],[45,2],[25,1],[25,2],[25,1],[25,1],[21,3],[21,4],[21,4],[21,5],[30,3],[30,2],[31,3],[58,1],[58,3],[32,1],[32,1],[32,1],[32,1],[53,3],[53,2],[53,2],[53,1],[66,1],[66,1],[66,1],[66,1],[66,1],[67,1],[67,1],[27,3],[27,4],[27,3],[27,4],[27,4],[27,5],[27,3],[27,4],[27,4],[27,5],[27,4],[27,5],[27,5],[27,6],[28,3],[29,3],[59,1],[59,3],[84,1],[84,2],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[91,1],[91,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[94,1],[94,1],[94,1],[94,1],[16,1],[16,1],[16,1],[16,1],[17,1],[55,1]],performAction:x(function(je,Ce,Se,H,he,j,pe){var re=j.length-1;switch(he){case 8:this.$=j[re-1];break;case 9:case 10:case 13:case 15:this.$=j[re];break;case 11:case 14:this.$=j[re-2]+"."+j[re];break;case 12:case 16:this.$=j[re-1]+j[re];break;case 17:case 18:this.$=j[re-1]+"~"+j[re]+"~";break;case 19:H.addRelation(j[re]);break;case 20:j[re-1].title=H.cleanupLabel(j[re]),H.addRelation(j[re-1]);break;case 31:this.$=j[re].trim(),H.setAccTitle(this.$);break;case 32:case 33:this.$=j[re].trim(),H.setAccDescription(this.$);break;case 34:H.addClassesToNamespace(j[re-3],j[re-1][0],j[re-1][1]),H.popNamespace();break;case 35:H.addClassesToNamespace(j[re-4],j[re-1][0],j[re-1][1]),H.popNamespace();break;case 36:this.$=H.addNamespace(j[re]);break;case 37:this.$=H.addNamespace(j[re-1],j[re]);break;case 38:this.$=[[j[re]],[]];break;case 39:this.$=[[j[re-1]],[]];break;case 40:j[re][0].unshift(j[re-2]),this.$=j[re];break;case 41:this.$=[[],[j[re]]];break;case 42:this.$=[[],[j[re-1]]];break;case 43:j[re][1].unshift(j[re-2]),this.$=j[re];break;case 44:case 45:this.$=[[],[]];break;case 46:this.$=j[re];break;case 48:H.setCssClass(j[re-2],j[re]);break;case 49:H.addMembers(j[re-3],j[re-1]);break;case 51:H.setCssClass(j[re-5],j[re-3]),H.addMembers(j[re-5],j[re-1]);break;case 52:H.addAnnotation(j[re-3],j[re-1]);break;case 53:H.addAnnotation(j[re-6],j[re-4]),H.addMembers(j[re-6],j[re-1]);break;case 54:H.addAnnotation(j[re-5],j[re-3]);break;case 55:this.$=j[re],H.addClass(j[re]);break;case 56:this.$=j[re-1],H.addClass(j[re-1]),H.setClassLabel(j[re-1],j[re]);break;case 60:H.addAnnotation(j[re],j[re-2]);break;case 61:case 74:this.$=[j[re]];break;case 62:j[re].push(j[re-1]),this.$=j[re];break;case 63:break;case 64:H.addMember(j[re-1],H.cleanupLabel(j[re]));break;case 65:break;case 66:break;case 67:this.$={id1:j[re-2],id2:j[re],relation:j[re-1],relationTitle1:"none",relationTitle2:"none"};break;case 68:this.$={id1:j[re-3],id2:j[re],relation:j[re-1],relationTitle1:j[re-2],relationTitle2:"none"};break;case 69:this.$={id1:j[re-3],id2:j[re],relation:j[re-2],relationTitle1:"none",relationTitle2:j[re-1]};break;case 70:this.$={id1:j[re-4],id2:j[re],relation:j[re-2],relationTitle1:j[re-3],relationTitle2:j[re-1]};break;case 71:this.$=H.addNote(j[re],j[re-1]);break;case 72:this.$=H.addNote(j[re]);break;case 73:this.$=j[re-2],H.defineClass(j[re-1],j[re]);break;case 75:this.$=j[re-2].concat([j[re]]);break;case 76:H.setDirection("TB");break;case 77:H.setDirection("BT");break;case 78:H.setDirection("RL");break;case 79:H.setDirection("LR");break;case 80:this.$={type1:j[re-2],type2:j[re],lineType:j[re-1]};break;case 81:this.$={type1:"none",type2:j[re],lineType:j[re-1]};break;case 82:this.$={type1:j[re-1],type2:"none",lineType:j[re]};break;case 83:this.$={type1:"none",type2:"none",lineType:j[re]};break;case 84:this.$=H.relationType.AGGREGATION;break;case 85:this.$=H.relationType.EXTENSION;break;case 86:this.$=H.relationType.COMPOSITION;break;case 87:this.$=H.relationType.DEPENDENCY;break;case 88:this.$=H.relationType.LOLLIPOP;break;case 89:this.$=H.lineType.LINE;break;case 90:this.$=H.lineType.DOTTED_LINE;break;case 91:case 97:this.$=j[re-2],H.setClickEvent(j[re-1],j[re]);break;case 92:case 98:this.$=j[re-3],H.setClickEvent(j[re-2],j[re-1]),H.setTooltip(j[re-2],j[re]);break;case 93:this.$=j[re-2],H.setLink(j[re-1],j[re]);break;case 94:this.$=j[re-3],H.setLink(j[re-2],j[re-1],j[re]);break;case 95:this.$=j[re-3],H.setLink(j[re-2],j[re-1]),H.setTooltip(j[re-2],j[re]);break;case 96:this.$=j[re-4],H.setLink(j[re-3],j[re-2],j[re]),H.setTooltip(j[re-3],j[re-1]);break;case 99:this.$=j[re-3],H.setClickEvent(j[re-2],j[re-1],j[re]);break;case 100:this.$=j[re-4],H.setClickEvent(j[re-3],j[re-2],j[re-1]),H.setTooltip(j[re-3],j[re]);break;case 101:this.$=j[re-3],H.setLink(j[re-2],j[re]);break;case 102:this.$=j[re-4],H.setLink(j[re-3],j[re-1],j[re]);break;case 103:this.$=j[re-4],H.setLink(j[re-3],j[re-1]),H.setTooltip(j[re-3],j[re]);break;case 104:this.$=j[re-5],H.setLink(j[re-4],j[re-2],j[re]),H.setTooltip(j[re-4],j[re-1]);break;case 105:this.$=j[re-2],H.setCssStyle(j[re-1],j[re]);break;case 106:H.setCssClass(j[re-1],j[re]);break;case 107:this.$=[j[re]];break;case 108:j[re-2].push(j[re]),this.$=j[re-2];break;case 110:this.$=j[re-1]+j[re];break}},"anonymous"),table:[{3:1,4:2,5:3,6:4,7:[1,6],10:5,16:39,17:40,19:21,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,33:e,35:r,37:n,38:22,42:i,43:23,46:a,48:s,51:o,52:l,54:u,56:h,57:d,60:f,62:p,63:g,64:m,65:y,75:v,76:T,78:b,82:w,83:k,86:A,100:C,102:_,103:L},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,3]},t(O,[2,5],{8:[1,48]}),{8:[1,49]},t(M,[2,19],{22:[1,50]}),t(M,[2,21]),t(M,[2,22]),t(M,[2,23]),t(M,[2,24]),t(M,[2,25]),t(M,[2,26]),t(M,[2,27]),t(M,[2,28]),t(M,[2,29]),t(M,[2,30]),{34:[1,51]},{36:[1,52]},t(M,[2,33]),t(M,[2,63],{53:53,66:56,67:57,13:[1,54],22:[1,55],68:z,69:F,70:S,71:R,72:N,73:D,74:I}),{39:[1,65]},t($,[2,47],{39:[1,67],44:[1,66],46:[1,68]}),t(M,[2,65]),t(M,[2,66]),{16:69,60:f,86:A,100:C,102:_},{16:39,17:40,19:70,60:f,86:A,100:C,102:_,103:L},{16:39,17:40,19:71,60:f,86:A,100:C,102:_,103:L},{16:39,17:40,19:72,60:f,86:A,100:C,102:_,103:L},{60:[1,73]},{13:[1,74]},{16:39,17:40,19:75,60:f,86:A,100:C,102:_,103:L},{13:B,55:76},{58:78,60:[1,79]},t(M,[2,76]),t(M,[2,77]),t(M,[2,78]),t(M,[2,79]),t(P,[2,13],{16:39,17:40,19:81,18:[1,80],20:[1,82],60:f,86:A,100:C,102:_,103:L}),t(P,[2,15],{20:[1,83]}),{15:84,16:85,17:86,60:f,86:A,100:C,102:_,103:L},{16:39,17:40,19:87,60:f,86:A,100:C,102:_,103:L},t(G,[2,133]),t(G,[2,134]),t(G,[2,135]),t(G,[2,136]),t([1,8,9,12,13,20,22,39,41,44,46,68,69,70,71,72,73,74,79,81],[2,137]),t(O,[2,6],{10:5,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,19:21,38:22,43:23,16:39,17:40,5:88,33:e,35:r,37:n,42:i,46:a,48:s,51:o,52:l,54:u,56:h,57:d,60:f,62:p,63:g,64:m,65:y,75:v,76:T,78:b,82:w,83:k,86:A,100:C,102:_,103:L}),{5:89,10:5,16:39,17:40,19:21,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,33:e,35:r,37:n,38:22,42:i,43:23,46:a,48:s,51:o,52:l,54:u,56:h,57:d,60:f,62:p,63:g,64:m,65:y,75:v,76:T,78:b,82:w,83:k,86:A,100:C,102:_,103:L},t(M,[2,20]),t(M,[2,31]),t(M,[2,32]),{13:[1,91],16:39,17:40,19:90,60:f,86:A,100:C,102:_,103:L},{53:92,66:56,67:57,68:z,69:F,70:S,71:R,72:N,73:D,74:I},t(M,[2,64]),{67:93,73:D,74:I},t(V,[2,83],{66:94,68:z,69:F,70:S,71:R,72:N}),t(Y,[2,84]),t(Y,[2,85]),t(Y,[2,86]),t(Y,[2,87]),t(Y,[2,88]),t(W,[2,89]),t(W,[2,90]),{8:[1,96],23:99,24:97,30:98,38:22,40:95,42:i,43:23,48:s,54:u,56:h},{16:100,60:f,86:A,100:C,102:_},{41:[1,102],45:101,51:ie},{16:104,60:f,86:A,100:C,102:_},{47:[1,105]},{13:[1,106]},{13:[1,107]},{79:[1,108],81:[1,109]},{22:K,50:se,59:110,60:J,82:Z,84:111,85:112,86:ee,87:ne,88:ue,89:fe,90:_e},{60:[1,122]},{13:B,55:123},t($,[2,72]),t($,[2,138]),{22:K,50:se,59:124,60:J,61:[1,125],82:Z,84:111,85:112,86:ee,87:ne,88:ue,89:fe,90:_e},t(Ae,[2,74]),{16:39,17:40,19:126,60:f,86:A,100:C,102:_,103:L},t(P,[2,16]),t(P,[2,17]),t(P,[2,18]),{11:127,12:Ne,39:[2,36]},t(me,[2,9],{16:85,17:86,15:130,18:[1,129],60:f,86:A,100:C,102:_,103:L}),t(me,[2,10]),t(ve,[2,55],{11:131,12:Ne}),t(O,[2,7]),{9:[1,132]},t(Ge,[2,67]),{16:39,17:40,19:133,60:f,86:A,100:C,102:_,103:L},{13:[1,135],16:39,17:40,19:134,60:f,86:A,100:C,102:_,103:L},t(V,[2,82],{66:136,68:z,69:F,70:S,71:R,72:N}),t(V,[2,81]),{41:[1,137]},{23:99,24:97,30:98,38:22,40:138,42:i,43:23,48:s,54:u,56:h},{8:[1,139],41:[2,38]},{8:[1,140],41:[2,41]},{8:[1,141],41:[2,44]},t($,[2,48],{39:[1,142]}),{41:[1,143]},t($,[2,50]),{41:[2,61],45:144,51:ie},{47:[1,145]},{16:39,17:40,19:146,60:f,86:A,100:C,102:_,103:L},t(M,[2,91],{13:[1,147]}),t(M,[2,93],{13:[1,149],77:[1,148]}),t(M,[2,97],{13:[1,150],80:[1,151]}),{13:[1,152]},t(M,[2,105],{61:Te}),t(Ze,[2,107],{85:154,22:K,50:se,60:J,82:Z,86:ee,87:ne,88:ue,89:fe,90:_e}),t(ke,[2,109]),t(ke,[2,111]),t(ke,[2,112]),t(ke,[2,113]),t(ke,[2,114]),t(ke,[2,115]),t(ke,[2,116]),t(ke,[2,117]),t(ke,[2,118]),t(ke,[2,119]),t(M,[2,106]),t($,[2,71]),t(M,[2,73],{61:Te}),{60:[1,155]},t(P,[2,14]),{39:[2,37]},{13:[1,156]},{15:157,16:85,17:86,60:f,86:A,100:C,102:_,103:L},t(me,[2,12]),t(ve,[2,56]),{1:[2,4]},t(Ge,[2,69]),t(Ge,[2,68]),{16:39,17:40,19:158,60:f,86:A,100:C,102:_,103:L},t(V,[2,80]),t($,[2,34]),{41:[1,159]},{23:99,24:97,30:98,38:22,40:160,41:[2,39],42:i,43:23,48:s,54:u,56:h},{23:99,24:97,30:98,38:22,40:161,41:[2,42],42:i,43:23,48:s,54:u,56:h},{23:99,24:97,30:98,38:22,40:162,41:[2,45],42:i,43:23,48:s,54:u,56:h},{45:163,51:ie},t($,[2,49]),{41:[2,62]},t($,[2,52],{39:[1,164]}),t(M,[2,60]),t(M,[2,92]),t(M,[2,94]),t(M,[2,95],{77:[1,165]}),t(M,[2,98]),t(M,[2,99],{13:[1,166]}),t(M,[2,101],{13:[1,168],77:[1,167]}),{22:K,50:se,60:J,82:Z,84:169,85:112,86:ee,87:ne,88:ue,89:fe,90:_e},t(ke,[2,110]),t(Ae,[2,75]),{14:[1,170]},t(me,[2,11]),t(Ge,[2,70]),t($,[2,35]),{41:[2,40]},{41:[2,43]},{41:[2,46]},{41:[1,171]},{41:[1,173],45:172,51:ie},t(M,[2,96]),t(M,[2,100]),t(M,[2,102]),t(M,[2,103],{77:[1,174]}),t(Ze,[2,108],{85:154,22:K,50:se,60:J,82:Z,86:ee,87:ne,88:ue,89:fe,90:_e}),t(ve,[2,8]),t($,[2,51]),{41:[1,175]},t($,[2,54]),t(M,[2,104]),t($,[2,53])],defaultActions:{2:[2,1],3:[2,2],4:[2,3],127:[2,37],132:[2,4],144:[2,62],160:[2,40],161:[2,43],162:[2,46]},parseError:x(function(je,Ce){if(Ce.recoverable)this.trace(je);else{var Se=new Error(je);throw Se.hash=Ce,Se}},"parseError"),parse:x(function(je){var Ce=this,Se=[0],H=[],he=[null],j=[],pe=this.table,re="",Be=0,xe=0,Ue=2,De=1,qe=j.slice.call(arguments,1),Le=Object.create(this.lexer),Xe={yy:{}};for(var Ie in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Ie)&&(Xe.yy[Ie]=this.yy[Ie]);Le.setInput(je,Xe.yy),Xe.yy.lexer=Le,Xe.yy.parser=this,typeof Le.yylloc>"u"&&(Le.yylloc={});var it=Le.yylloc;j.push(it);var we=Le.options&&Le.options.ranges;typeof Xe.yy.parseError=="function"?this.parseError=Xe.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function lt(wt){Se.length=Se.length-2*wt,he.length=he.length-wt,j.length=j.length-wt}x(lt,"popStack");function be(){var wt;return wt=H.pop()||Le.lex()||De,typeof wt!="number"&&(wt instanceof Array&&(H=wt,wt=H.pop()),wt=Ce.symbols_[wt]||wt),wt}x(be,"lex");for(var Et,vt,ot,It,xt={},ht,oe,At,dt;;){if(vt=Se[Se.length-1],this.defaultActions[vt]?ot=this.defaultActions[vt]:((Et===null||typeof Et>"u")&&(Et=be()),ot=pe[vt]&&pe[vt][Et]),typeof ot>"u"||!ot.length||!ot[0]){var ut="";dt=[];for(ht in pe[vt])this.terminals_[ht]&&ht>Ue&&dt.push("'"+this.terminals_[ht]+"'");Le.showPosition?ut="Parse error on line "+(Be+1)+`: + `;b.append("path").attr("d",C),w.append("path").attr("d",`M ${m.x},${m.y+v} + a ${x},${v} 0 0 0 0,${m.height}`),b.attr("transform",`translate(${x}, ${-(m.height/2)})`),w.attr("transform",`translate(${m.width-x}, ${-m.height/2})`),e.rectData=m,l==="neo"&&b.attr("filter","url(#drop-shadow)");const _=i.get(e.name)??0;if(dh.has(u)&&(b.style("stroke",f[_%f.length]),b.style("fill",d[_%f.length]),w.style("stroke",f[_%f.length]),w.style("fill",d[_%f.length])),($=e.properties)!=null&&$.icon){const I=e.properties.icon.trim(),z=m.x+m.width-20,F=m.y+10;I.charAt(0)==="@"?FN(g,z,F,I.substr(1)):BN(g,z,F,I)}fh(r,Ii(e.description))(e.description,g,m.x,m.y,m.width,m.height,{class:`actor ${wA}`},r);let k=e.height;const S=b.select("path:last-child");if(S.node()){const I=S.node().getBBox();e.height=I.height,k=I.height}return n||(g.attr("data-et","participant"),g.attr("data-type","queue"),g.attr("data-id",e.name)),k},"drawActorTypeQueue"),S1t=T(function(t,e,r,n,i,a){var L;const s=n?e.stopy:e.starty,o=e.x+e.width/2,l=s+75,{look:u,theme:h,themeVariables:d}=r,{bkgColorArray:f,borderColorArray:p,actorBorder:g,actorBkg:m}=d,y=t.append("g").lower();n||(Qr++,y.append("line").attr("id","actor"+Qr).attr("x1",o).attr("y1",l).attr("x2",o).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name).attr("data-et","life-line").attr("data-id",e.name),e.actorCnt=Qr);const v=t.append("g");let x=m0;n?x+=` ${Nd}`:x+=` ${Md}`,v.attr("class",x),v.attr("name",e.name);const b=Ro();b.x=e.x,b.y=s,b.fill="#eaeaea",b.width=e.width,b.height=e.height,b.class="actor";const w=e.x+e.width/2,C=s+32,_=22;v.append("defs").append("marker").attr("id",i+"-filled-head-control").attr("refX",11).attr("refY",5.8).attr("markerWidth",20).attr("markerHeight",28).attr("orient","172.5").attr("stroke-width",1.2).append("path").attr("d","M 14.4 5.6 L 7.2 10.4 L 8.8 5.6 L 7.2 0.8 Z"),v.append("circle").attr("cx",w).attr("cy",C).attr("r",_).attr("filter",`${u==="neo"?"url(#drop-shadow)":""}`),v.append("line").attr("marker-end","url(#"+i+"-filled-head-control)").attr("transform",`translate(${w}, ${C-_})`);const k=a.get(e.name)??0;dh.has(h)?(v.style("stroke",p[k%p.length]),v.style("fill",f[k%p.length])):(v.style("stroke",g),v.style("fill",m));const S=v.node().getBBox();return e.height=S.height+2*(((L=r==null?void 0:r.sequence)==null?void 0:L.labelBoxHeight)??0),fh(r,Ii(e.description))(e.description,v,b.x,b.y+_+(n?5:12),b.width,b.height,{class:`actor ${m0}`},r),n||(v.attr("data-et","participant"),v.attr("data-type","control"),v.attr("data-id",e.name)),e.height},"drawActorTypeControl"),_1t=T(function(t,e,r,n,i){var _;const a=n?e.stopy:e.starty,s=e.x+e.width/2,o=a+75,{look:l,theme:u,themeVariables:h}=r,{bkgColorArray:d,borderColorArray:f}=h,p=t.append("g").lower(),g=t.append("g");let m="actor";n?m+=` ${Nd}`:m+=` ${Md}`,g.attr("class",m),g.attr("name",e.name);const y=Ro();y.x=e.x,y.y=a,y.fill="#eaeaea",y.width=e.width,y.height=e.height,y.class="actor";const v=e.x+e.width/2,x=a+(n?10:25),b=22;g.append("circle").attr("cx",v).attr("cy",x).attr("r",b).attr("width",e.width).attr("height",e.height),g.append("line").attr("x1",v-b).attr("x2",v+b).attr("y1",x+b).attr("y2",x+b).attr("stroke-width",2),l==="neo"&&g.attr("filter","url(#drop-shadow)");const w=i.get(e.name)??0;dh.has(u)&&(g.style("stroke",f[w%f.length]),g.style("fill",d[w%f.length]));const C=g.node().getBBox();return e.height=C.height+(((_=r==null?void 0:r.sequence)==null?void 0:_.labelBoxHeight)??0),n||(Qr++,p.append("line").attr("id","actor"+Qr).attr("x1",s).attr("y1",o).attr("x2",s).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name).attr("data-et","life-line").attr("data-id",e.name),e.actorCnt=Qr),fh(r,Ii(e.description))(e.description,g,y.x,y.y+(n?15:30),y.width,y.height,{class:`actor ${m0}`},r),n?g.attr("transform",`translate(0, ${b})`):(g.attr("transform",`translate(0, ${b/2-5})`),g.attr("data-et","participant"),g.attr("data-type","entity"),g.attr("data-id",e.name)),e.height},"drawActorTypeEntity"),A1t=T(function(t,e,r,n,i){var $;const a=n?e.stopy:e.starty,s=e.x+e.width/2,o=a+e.height+2*r.boxTextMargin,{theme:l,themeVariables:u,look:h}=r,{bkgColorArray:d,borderColorArray:f,actorBorder:p}=u,g=t.append("g").lower();let m=g;n||(Qr++,Object.keys(e.links||{}).length&&!r.forceMenus&&m.attr("onclick",CA(`actor${Qr}_popup`)).attr("cursor","pointer"),m.append("line").attr("id","actor"+Qr).attr("x1",s).attr("y1",o).attr("x2",s).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name).attr("data-et","life-line").attr("data-id",e.name),m=g.append("g"),e.actorCnt=Qr,e.links!=null&&m.attr("id","root-"+Qr),h==="neo"&&m.attr("data-look","neo"));const y=Ro();let v="actor";($=e.properties)!=null&&$.class?v=e.properties.class:y.fill="#eaeaea",n?v+=` ${Nd}`:v+=` ${Md}`,y.x=e.x,y.y=a,y.width=e.width,y.height=e.height,y.class=v,y.name=e.name,y.x=e.x,y.y=a;const x=y.width/3,b=y.width/3,w=x/2,C=w/(2.5+x/50),_=m.append("g");_.attr("class",v);const k=` + M ${y.x},${y.y+C} + a ${w},${C} 0 0 0 ${x},0 + a ${w},${C} 0 0 0 -${x},0 + l 0,${b-2*C} + a ${w},${C} 0 0 0 ${x},0 + l 0,-${b-2*C} +`;_.append("path").attr("d",k),h==="neo"&&_.attr("filter","url(#drop-shadow)");const S=i.get(e.name)??0;dh.has(l)?(_.style("stroke",f[S%f.length]),_.style("fill",d[S%f.length])):_.style("stroke",p),_.attr("transform",`translate(${x}, ${C})`),e.rectData=y,fh(r,Ii(e.description))(e.description,m,y.x,y.y+35,y.width,y.height,{class:`actor ${wA}`},r);const L=_.select("path:last-child");if(L.node()){const I=L.node().getBBox();e.height=I.height+(r.sequence.labelBoxHeight??0)}return n||(m.attr("data-et","participant"),m.attr("data-type","database"),m.attr("data-id",e.name)),e.height},"drawActorTypeDatabase"),R1t=T(function(t,e,r,n,i){const a=n?e.stopy:e.starty,s=e.x+e.width/2,o=a+80,l=22,u=t.append("g").lower(),{look:h,theme:d,themeVariables:f}=r,{bkgColorArray:p,borderColorArray:g,actorBorder:m}=f;n||(Qr++,u.append("line").attr("id","actor"+Qr).attr("x1",s).attr("y1",o).attr("x2",s).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name).attr("data-et","life-line").attr("data-id",e.name),e.actorCnt=Qr);const y=t.append("g");let v=m0;n?v+=` ${Nd}`:v+=` ${Md}`,y.attr("class",v),y.attr("name",e.name);const x=Ro();x.x=e.x,x.y=a,x.fill="#eaeaea",x.width=e.width,x.height=e.height,x.class="actor",y.append("line").attr("id","actor-man-torso"+Qr).attr("x1",e.x+e.width/2-l*2.5).attr("y1",a+12).attr("x2",e.x+e.width/2-15).attr("y2",a+12),y.append("line").attr("id","actor-man-arms"+Qr).attr("x1",e.x+e.width/2-l*2.5).attr("y1",a+2).attr("x2",e.x+e.width/2-l*2.5).attr("y2",a+22),y.append("circle").attr("cx",e.x+e.width/2).attr("cy",a+12).attr("r",l),h==="neo"&&y.attr("filter","url(#drop-shadow)");const b=i.get(e.name)??0;dh.has(d)?(y.style("stroke",g[b%g.length]),y.style("fill",p[b%g.length])):y.style("stroke",m);const w=y.node().getBBox();return e.height=w.height+(r.sequence.labelBoxHeight??0),fh(r,Ii(e.description))(e.description,y,x.x,x.y+15,x.width,x.height,{class:`actor ${m0}`},r),y.attr("transform",`translate(0,${l/2+10})`),n||(y.attr("data-et","participant"),y.attr("data-type","boundary"),y.attr("data-id",e.name)),e.height},"drawActorTypeBoundary"),L1t=T(function(t,e,r,n,i){const a=n?e.stopy:e.starty,s=e.x+e.width/2,o=a+80,{look:l,theme:u,themeVariables:h}=r,{bkgColorArray:d,borderColorArray:f,actorBorder:p}=h,g=t.append("g").lower();n||(Qr++,g.append("line").attr("id","actor"+Qr).attr("x1",s).attr("y1",o).attr("x2",s).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name).attr("data-et","life-line").attr("data-id",e.name),e.actorCnt=Qr);const m=t.append("g");let y=m0;n?y+=` ${Nd}`:y+=` ${Md}`,m.attr("class",y),m.attr("name",e.name),n||m.attr("data-et","participant").attr("data-type","actor").attr("data-id",e.name);const v=l==="neo"?.5:1,x=l==="neo"?a+(1-v)*30:a;m.append("line").attr("id","actor-man-torso"+Qr).attr("x1",s).attr("y1",x+25*v).attr("x2",s).attr("y2",x+45*v),m.append("line").attr("id","actor-man-arms"+Qr).attr("x1",s-g0/2*v).attr("y1",x+33*v).attr("x2",s+g0/2*v).attr("y2",x+33*v),m.append("line").attr("x1",s-g0/2*v).attr("y1",x+60*v).attr("x2",s).attr("y2",x+45*v),m.append("line").attr("x1",s).attr("y1",x+45*v).attr("x2",s+(g0/2-2)*v).attr("y2",x+60*v);const b=m.append("circle");b.attr("cx",e.x+e.width/2),b.attr("cy",x+10*v),b.attr("r",15*v),b.attr("width",e.width*v),b.attr("height",e.height*v);const w=m.node().getBBox();e.height=w.height;const C=Ro();C.x=e.x,C.y=x,C.fill="#eaeaea",C.width=e.width,C.height=e.height/v,C.class="actor",C.rx=3,C.ry=3;const _=i.get(e.name)??0;return dh.has(u)?(m.style("stroke",f[_%f.length]),m.style("fill",d[_%f.length])):m.style("stroke",p),fh(r,Ii(e.description))(e.description,m,C.x,x+35*v-(l==="neo"?10:0),C.width,C.height,{class:`actor ${m0}`},r),e.height},"drawActorTypeActor"),I1t=T(async function(t,e,r,n,i,a,s){const o=s??new Map([...a.db.getActors().values()].map((l,u)=>[l.name,u]));switch(e.type){case"actor":return await L1t(t,e,r,n,o);case"participant":return await C1t(t,e,r,n,o);case"boundary":return await R1t(t,e,r,n,o);case"control":return await S1t(t,e,r,n,i,o);case"entity":return await _1t(t,e,r,n,o);case"database":return await A1t(t,e,r,n,o);case"collections":return await k1t(t,e,r,n,o);case"queue":return await E1t(t,e,r,n,o)}},"drawActor"),D1t=T(function(t,e,r){const i=t.append("g");pTe(i,e),e.name&&fh(r)(e.name,i,e.x,e.y+r.boxTextMargin+(e.textMaxHeight||0)/2,e.width,0,{class:"text"},r),i.lower()},"drawBox"),M1t=T(function(t){return t.append("g")},"anchorElement"),N1t=T(function(t,e,r,n,i,a,s){const{theme:o,themeVariables:l}=n,{bkgColorArray:u,borderColorArray:h,mainBkg:d}=l,f=Ro(),p=e.anchored,g=e.actor;f.x=e.startx,f.y=e.starty,f.class="activation"+i%3,f.width=e.stopx-e.startx,f.height=r-e.starty;const m=t4(p,f),v=(s??new Map([...a.db.getActors().values()].map((x,b)=>[x.name,b]))).get(g)??0;dh.has(o)&&(m.style("stroke",h[v%h.length]),m.style("fill",u[v%h.length]??d))},"drawActivation"),$1t=T(async function(t,e,r,n,i){const{boxMargin:a,boxTextMargin:s,labelBoxHeight:o,labelBoxWidth:l,messageFontFamily:u,messageFontSize:h,messageFontWeight:d}=n,f=t.append("g").attr("data-et","control-structure").attr("data-id","i"+i.id),p=T(function(y,v,x,b){return f.append("line").attr("x1",y).attr("y1",v).attr("x2",x).attr("y2",b).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),e.sections!==void 0&&e.sections.forEach(function(y){p(e.startx,y.y,e.stopx,y.y).style("stroke-dasharray","3, 3")});let g=zN();g.text=r,g.x=e.startx,g.y=e.starty,g.fontFamily=u,g.fontSize=h,g.fontWeight=d,g.anchor="middle",g.valign="middle",g.tspan=!1,g.width=Math.max(l??0,50),g.height=o+(n.look==="neo"?15:0)||20,g.textMargin=s,g.class="labelText",dTe(f,g),g=gTe(),g.text=e.title,g.x=e.startx+l/2+(e.stopx-e.startx)/2,g.y=e.starty+a+s,g.anchor="middle",g.valign="middle",g.textMargin=s,g.class="loopText",g.fontFamily=u,g.fontSize=h,g.fontWeight=d,g.wrap=!0;let m=Ii(g.text)?await kA(f,g,e):M1(f,g);if(e.sectionTitles!==void 0){for(const[y,v]of Object.entries(e.sectionTitles))if(v.message){g.text=v.message,g.x=e.startx+(e.stopx-e.startx)/2,g.y=e.sections[y].y+a+s,g.class="sectionTitle",g.anchor="middle",g.valign="middle",g.tspan=!1,g.fontFamily=u,g.fontSize=h,g.fontWeight=d,g.wrap=e.wrap,Ii(g.text)?(e.starty=e.sections[y].y,await kA(f,g,e)):M1(f,g);let x=Math.round(m.map(b=>(b._groups||b)[0][0].getBBox().height).reduce((b,w)=>b+w));e.sections[y].height+=x-(a+s)}}return e.height=Math.round(e.stopy-e.starty),f},"drawLoop"),pTe=T(function(t,e){Ole(t,e)},"drawBackgroundRect"),O1t=T(function(t,e){t.append("defs").append("symbol").attr("id",e+"-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"),P1t=T(function(t,e){t.append("defs").append("symbol").attr("id",e+"-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"),B1t=T(function(t,e){t.append("defs").append("symbol").attr("id",e+"-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"),F1t=T(function(t,e){t.append("defs").append("marker").attr("id",e+"-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"),z1t=T(function(t,e){t.append("defs").append("marker").attr("id",e+"-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"),G1t=T(function(t,e){t.append("defs").append("marker").attr("id",e+"-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"),q1t=T(function(t,e){t.append("defs").append("marker").attr("id",e+"-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"),V1t=T(function(t,e){const{theme:r}=e;t.append("defs").append("filter").attr("id","drop-shadow").attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",`${r==="redux"||r==="redux-color"?"#000000":"#FFFFFF"}`)},"insertDropShadow"),gTe=T(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"),W1t=T(function(){return{x:0,y:0,fill:"#EDF2AE",stroke:"#666",width:100,anchor:"start",height:100,rx:0,ry:0}},"getNoteRect"),fh=(function(){function t(a,s,o,l,u,h,d){const f=s.append("text").attr("x",o+u/2).attr("y",l+h/2+5).style("text-anchor","middle").text(a);i(f,d)}T(t,"byText");function e(a,s,o,l,u,h,d,f){const{actorFontSize:p,actorFontFamily:g,actorFontWeight:m}=f,[y,v]=cu(p),x=a.split(Dt.lineBreakRegex);for(let b=0;bt.height||0))+(this.loops.length===0?0:this.loops.map(t=>t.height||0).reduce((t,e)=>t+e))+(this.messages.length===0?0:this.messages.map(t=>t.height||0).reduce((t,e)=>t+e))+(this.notes.length===0?0:this.notes.map(t=>t.height||0).reduce((t,e)=>t+e))},"getHeight"),clear:T(function(){this.actors=[],this.boxes=[],this.loops=[],this.messages=[],this.notes=[]},"clear"),addBox:T(function(t){this.boxes.push(t)},"addBox"),addActor:T(function(t){this.actors.push(t)},"addActor"),addLoop:T(function(t){this.loops.push(t)},"addLoop"),addMessage:T(function(t){this.messages.push(t)},"addMessage"),addNote:T(function(t){this.notes.push(t)},"addNote"),lastActor:T(function(){return this.actors[this.actors.length-1]},"lastActor"),lastLoop:T(function(){return this.loops[this.loops.length-1]},"lastLoop"),lastMessage:T(function(){return this.messages[this.messages.length-1]},"lastMessage"),lastNote:T(function(){return this.notes[this.notes.length-1]},"lastNote"),actors:[],boxes:[],loops:[],messages:[],notes:[]},init:T(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,bTe(Pe())},"init"),updateVal:T(function(t,e,r,n){t[e]===void 0?t[e]=r:t[e]=n(r,t[e])},"updateVal"),updateBounds:T(function(t,e,r,n){const i=this;let a=0;function s(o){return T(function(u){a++;const h=i.sequenceItems.length-a+1;i.updateVal(u,"starty",e-h*Ye.boxMargin,Math.min),i.updateVal(u,"stopy",n+h*Ye.boxMargin,Math.max),i.updateVal(Ct.data,"startx",t-h*Ye.boxMargin,Math.min),i.updateVal(Ct.data,"stopx",r+h*Ye.boxMargin,Math.max),o!=="activation"&&(i.updateVal(u,"startx",t-h*Ye.boxMargin,Math.min),i.updateVal(u,"stopx",r+h*Ye.boxMargin,Math.max),i.updateVal(Ct.data,"starty",e-h*Ye.boxMargin,Math.min),i.updateVal(Ct.data,"stopy",n+h*Ye.boxMargin,Math.max))},"updateItemBounds")}T(s,"updateFn"),this.sequenceItems.forEach(s()),this.activations.forEach(s("activation"))},"updateBounds"),insert:T(function(t,e,r,n){const i=Dt.getMin(t,r),a=Dt.getMax(t,r),s=Dt.getMin(e,n),o=Dt.getMax(e,n);this.updateVal(Ct.data,"startx",i,Math.min),this.updateVal(Ct.data,"starty",s,Math.min),this.updateVal(Ct.data,"stopx",a,Math.max),this.updateVal(Ct.data,"stopy",o,Math.max),this.updateBounds(i,s,a,o)},"insert"),newActivation:T(function(t,e,r){const n=r.get(t.from),i=EA(t.from).length||0,a=n.x+n.width/2+(i-1)*Ye.activationWidth/2;this.activations.push({startx:a,starty:this.verticalPos+2,stopx:a+Ye.activationWidth,stopy:void 0,actor:t.from,anchored:Wn.anchorElement(e)})},"newActivation"),endActivation:T(function(t){const e=this.activations.map(function(r){return r.actor}).lastIndexOf(t.from);return this.activations.splice(e,1)[0]},"endActivation"),createLoop:T(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:T(function(t={message:void 0,wrap:!1,width:void 0},e){this.sequenceItems.push(this.createLoop(t,e))},"newLoop"),endLoop:T(function(){return this.sequenceItems.pop()},"endLoop"),isLoopOverlap:T(function(){return this.sequenceItems.length?this.sequenceItems[this.sequenceItems.length-1].overlap:!1},"isLoopOverlap"),addSectionToLoop:T(function(t){const e=this.sequenceItems.pop();e.sections=e.sections||[],e.sectionTitles=e.sectionTitles||[],e.sections.push({y:Ct.getVerticalPos(),height:0}),e.sectionTitles.push(t),this.sequenceItems.push(e)},"addSectionToLoop"),saveVerticalPos:T(function(){this.isLoopOverlap()&&(this.savedVerticalPos=this.verticalPos)},"saveVerticalPos"),resetVerticalPos:T(function(){this.isLoopOverlap()&&(this.verticalPos=this.savedVerticalPos)},"resetVerticalPos"),bumpVerticalPos:T(function(t){this.verticalPos=this.verticalPos+t,this.data.stopy=Dt.getMax(this.data.stopy,this.verticalPos)},"bumpVerticalPos"),getVerticalPos:T(function(){return this.verticalPos},"getVerticalPos"),getBounds:T(function(){return{bounds:this.data,models:this.models}},"getBounds")},K1t=T(async function(t,e,r){Ct.bumpVerticalPos(Ye.boxMargin),e.height=Ye.boxMargin,e.starty=Ct.getVerticalPos();const n=Ro();n.x=e.startx,n.y=e.starty,n.width=e.width||Ye.width,n.class="note";const i=t.append("g");i.attr("data-et","note"),i.attr("data-id","i"+r);const a=Wn.drawRect(i,n),s=zN();s.x=e.startx,s.y=e.starty,s.width=n.width,s.dy="1em",s.text=e.message,s.class="noteText",s.fontFamily=Ye.noteFontFamily,s.fontSize=Ye.noteFontSize,s.fontWeight=Ye.noteFontWeight,s.anchor=Ye.noteAlign,s.textMargin=Ye.noteMargin,s.valign="center";const o=Ii(s.text)?await kA(i,s):M1(i,s),l=Math.round(o.map(u=>(u._groups||u)[0][0].getBBox().height).reduce((u,h)=>u+h));a.attr("height",l+2*Ye.noteMargin),e.height+=l+2*Ye.noteMargin,Ct.bumpVerticalPos(l+2*Ye.noteMargin),e.stopy=e.starty+l+2*Ye.noteMargin,e.stopx=e.startx+n.width,Ct.insert(e.startx,e.starty,e.stopx,e.stopy),Ct.models.addNote(e)},"drawNote"),mTe=T(function(t,e,r,n,i,a,s){const o=n.db.getActors(),l=o.get(e.from),u=o.get(e.to),h=r.sequenceVisible;let d=l.x+l.width/2,f=u.x+u.width/2;const p=d<=f,g=kTe(e,n),m=t.append("g"),y=16.5,v=T((_,k)=>{const S=_?y:-y;return k?-S:S},"getCircleOffset"),x=T(_=>{m.append("circle").attr("cx",_).attr("cy",s).attr("r",5).attr("width",10).attr("height",10)},"drawCircle"),{CENTRAL_CONNECTION:b,CENTRAL_CONNECTION_REVERSE:w,CENTRAL_CONNECTION_DUAL:C}=n.db.LINETYPE;if(h)switch(e.centralConnection){case b:g&&(f+=v(p,!0));break;case w:g||(d+=v(p,!1));break;case C:g?f+=v(p,!0):d+=v(p,!1);break}switch(e.centralConnection){case b:x(f);break;case w:x(d);break;case C:x(d),x(f);break}},"drawCentralConnection"),y0=T(t=>({fontFamily:t.messageFontFamily,fontSize:t.messageFontSize,fontWeight:t.messageFontWeight}),"messageFont"),N1=T(t=>({fontFamily:t.noteFontFamily,fontSize:t.noteFontSize,fontWeight:t.noteFontWeight}),"noteFont"),Zz=T(t=>({fontFamily:t.actorFontFamily,fontSize:t.actorFontSize,fontWeight:t.actorFontWeight}),"actorFont");async function yTe(t,e){Ct.bumpVerticalPos(10);const{startx:r,stopx:n,message:i}=e,a=Dt.splitBreaks(i).length,s=Ii(i),o=s?await Wb(i,Pe()):Pr.calculateTextDimensions(i,y0(Ye));if(!s){const d=o.height/a;e.height+=d,Ct.bumpVerticalPos(d)}let l,u=o.height-10;const h=o.width;if(r===n){l=Ct.getVerticalPos()+u,Ye.rightAngles||(u+=Ye.boxMargin,l=Ct.getVerticalPos()+u),u+=30;const d=Dt.getMax(h/2,Ye.width/2);Ct.insert(r-d,Ct.getVerticalPos()-10+u,n+d,Ct.getVerticalPos()+30+u)}else u+=Ye.boxMargin,l=Ct.getVerticalPos()+u,Ct.insert(r,l-10,n,l);return Ct.bumpVerticalPos(u),e.height+=u,e.stopy=e.starty+e.height,Ct.insert(e.fromBounds,e.starty,e.toBounds,e.stopy),l}T(yTe,"boundMessage");var Z1t=T(async function(t,e,r,n,i,a){const{startx:s,stopx:o,starty:l,message:u,type:h,sequenceIndex:d,sequenceVisible:f}=e,p=Pr.calculateTextDimensions(u,y0(Ye)),g=zN();g.x=Math.min(s,o),g.y=l+10,g.width=Math.abs(o-s),g.class="messageText",g.dy="1em",g.text=u,g.fontFamily=Ye.messageFontFamily,g.fontSize=Ye.messageFontSize,g.fontWeight=Ye.messageFontWeight,g.anchor=Ye.messageAlign,g.valign="center",g.textMargin=Ye.wrapPadding,g.tspan=!1,Ii(g.text)?await kA(t,g,{startx:s,stopx:o,starty:r}):M1(t,g);const m=p.width;let y;if(s===o){const x=f||Ye.showSequenceNumbers,b=kTe(i,n),w=iyt(i,n),C=s+(x&&(b||w)?10:0);Ye.rightAngles?y=t.append("path").attr("d",`M ${C},${r} H ${s+Dt.getMax(Ye.width/2,m/2)} V ${r+25} H ${s}`):y=t.append("path").attr("d","M "+C+","+r+" C "+(C+60)+","+(r-10)+" "+(s+60)+","+(r+30)+" "+s+","+(r+20)),Jz(i,n)&&mTe(t,i,e,n,s,o,r)}else y=t.append("line"),y.attr("x1",s),y.attr("y1",r),y.attr("x2",o),y.attr("y2",r),Jz(i,n)&&mTe(t,i,e,n,s,o,r);h===n.db.LINETYPE.DOTTED||h===n.db.LINETYPE.DOTTED_CROSS||h===n.db.LINETYPE.DOTTED_POINT||h===n.db.LINETYPE.DOTTED_OPEN||h===n.db.LINETYPE.BIDIRECTIONAL_DOTTED||h===n.db.LINETYPE.SOLID_TOP_DOTTED||h===n.db.LINETYPE.SOLID_BOTTOM_DOTTED||h===n.db.LINETYPE.STICK_TOP_DOTTED||h===n.db.LINETYPE.STICK_BOTTOM_DOTTED||h===n.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED||h===n.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED||h===n.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED||h===n.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED?(y.style("stroke-dasharray","3, 3"),y.attr("class","messageLine1")):y.attr("class","messageLine0"),y.attr("data-et","message"),y.attr("data-id","i"+e.id),y.attr("data-from",e.from),y.attr("data-to",e.to);let v="";if(Ye.arrowMarkerAbsolute&&(v=N4(!0)),y.attr("stroke-width",2),y.attr("stroke","none"),y.style("fill","none"),(h===n.db.LINETYPE.SOLID_TOP||h===n.db.LINETYPE.SOLID_TOP_DOTTED)&&y.attr("marker-end","url("+v+"#"+a+"-solidTopArrowHead)"),(h===n.db.LINETYPE.SOLID_BOTTOM||h===n.db.LINETYPE.SOLID_BOTTOM_DOTTED)&&y.attr("marker-end","url("+v+"#"+a+"-solidBottomArrowHead)"),(h===n.db.LINETYPE.STICK_TOP||h===n.db.LINETYPE.STICK_TOP_DOTTED)&&y.attr("marker-end","url("+v+"#"+a+"-stickTopArrowHead)"),(h===n.db.LINETYPE.STICK_BOTTOM||h===n.db.LINETYPE.STICK_BOTTOM_DOTTED)&&y.attr("marker-end","url("+v+"#"+a+"-stickBottomArrowHead)"),(h===n.db.LINETYPE.SOLID_ARROW_TOP_REVERSE||h===n.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED)&&y.attr("marker-start","url("+v+"#"+a+"-solidBottomArrowHead)"),(h===n.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE||h===n.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED)&&y.attr("marker-start","url("+v+"#"+a+"-solidTopArrowHead)"),(h===n.db.LINETYPE.STICK_ARROW_TOP_REVERSE||h===n.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED)&&y.attr("marker-start","url("+v+"#"+a+"-stickBottomArrowHead)"),(h===n.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE||h===n.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED)&&y.attr("marker-start","url("+v+"#"+a+"-stickTopArrowHead)"),(h===n.db.LINETYPE.SOLID||h===n.db.LINETYPE.DOTTED)&&y.attr("marker-end","url("+v+"#"+a+"-arrowhead)"),(h===n.db.LINETYPE.BIDIRECTIONAL_SOLID||h===n.db.LINETYPE.BIDIRECTIONAL_DOTTED)&&(y.attr("marker-start","url("+v+"#"+a+"-arrowhead)"),y.attr("marker-end","url("+v+"#"+a+"-arrowhead)")),(h===n.db.LINETYPE.SOLID_POINT||h===n.db.LINETYPE.DOTTED_POINT)&&y.attr("marker-end","url("+v+"#"+a+"-filled-head)"),(h===n.db.LINETYPE.SOLID_CROSS||h===n.db.LINETYPE.DOTTED_CROSS)&&y.attr("marker-end","url("+v+"#"+a+"-crosshead)"),f||Ye.showSequenceNumbers){const x=h===n.db.LINETYPE.BIDIRECTIONAL_SOLID||h===n.db.LINETYPE.BIDIRECTIONAL_DOTTED,b=h===n.db.LINETYPE.SOLID_ARROW_TOP_REVERSE||h===n.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED||h===n.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE||h===n.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED||h===n.db.LINETYPE.STICK_ARROW_TOP_REVERSE||h===n.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED||h===n.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE||h===n.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED,w=6,C=Jz(i,n);let _=s,k=o;x?(ss?k=o-2*w:(k=o-w,_+=(i==null?void 0:i.centralConnection)===n.db.LINETYPE.CENTRAL_CONNECTION_DUAL||(i==null?void 0:i.centralConnection)===n.db.LINETYPE.CENTRAL_CONNECTION_REVERSE?-7.5:0),k+=C?15:0,y.attr("x2",k),y.attr("x1",_)):y.attr("x1",s+w);let S=0;const L=s===o,$=s<=o;L?S=e.fromBounds+1:b?S=$?e.toBounds-1:e.fromBounds+1:S=$?e.fromBounds+1:e.toBounds-1;let I="12px";const z=d.toString().length;z>5?I="7px":z>3&&(I="9px"),t.append("line").attr("x1",S).attr("y1",r).attr("x2",S).attr("y2",r).attr("stroke-width",0).attr("marker-start","url("+v+"#"+a+"-sequencenumber)"),t.append("text").attr("x",S).attr("y",r+4).attr("font-family","sans-serif").attr("font-size",I).attr("text-anchor","middle").attr("class","sequenceNumber").text(d)}},"drawMessage"),Q1t=T(function(t,e,r,n,i,a,s){let o=0,l=0,u,h=0;for(const d of n){const f=e.get(d),p=f.box;u&&u!=p&&(s||Ct.models.addBox(u),l+=Ye.boxMargin+u.margin),p&&p!=u&&(s||(p.x=o+l,p.y=i),l+=p.margin),f.width=Dt.getMax(f.width||Ye.width,Ye.width),f.height=Dt.getMax(f.height||Ye.height,Ye.height),f.margin=f.margin||Ye.actorMargin,h=Dt.getMax(h,f.height),r.get(f.name)&&(l+=f.width/2),f.x=o+l,f.starty=Ct.getVerticalPos(),Ct.insert(f.x,i,f.x+f.width,f.height),o+=f.width+l,f.box&&(f.box.width=o+p.margin-f.box.x),l=f.margin,u=f.box,Ct.models.addActor(f)}u&&!s&&Ct.models.addBox(u),Ct.bumpVerticalPos(h)},"addActorRenderingData"),Qz=T(async function(t,e,r,n,i,a,s){if(n){let o=0;Ct.bumpVerticalPos(Ye.boxMargin*2);for(const l of r){const u=e.get(l);u.stopy||(u.stopy=Ct.getVerticalPos());const h=await Wn.drawActor(t,u,Ye,!0,i,a,s);o=Dt.getMax(o,h)}Ct.bumpVerticalPos(o+Ye.boxMargin)}else for(const o of r){const l=e.get(o);await Wn.drawActor(t,l,Ye,!1,i,a,s)}},"drawActors"),vTe=T(function(t,e,r,n){let i=0,a=0;for(const s of r){const o=e.get(s),l=eyt(o),u=Wn.drawPopup(t,o,l,Ye,Ye.forceMenus,n);u.height>i&&(i=u.height),u.width+o.x>a&&(a=u.width+o.x)}return{maxHeight:i,maxWidth:a}},"drawActorsPopup"),bTe=T(function(t){Li(Ye,t),t.fontFamily&&(Ye.actorFontFamily=Ye.noteFontFamily=Ye.messageFontFamily=t.fontFamily),t.fontSize&&(Ye.actorFontSize=Ye.noteFontSize=Ye.messageFontSize=t.fontSize),t.fontWeight&&(Ye.actorFontWeight=Ye.noteFontWeight=Ye.messageFontWeight=t.fontWeight)},"setConf"),EA=T(function(t){return Ct.activations.filter(function(e){return e.actor===t})},"actorActivations"),xTe=T(function(t,e){const r=e.get(t),n=EA(t),i=n.reduce(function(s,o){return Dt.getMin(s,o.startx)},r.x+r.width/2-1),a=n.reduce(function(s,o){return Dt.getMax(s,o.stopx)},r.x+r.width/2+1);return[i,a]},"activationBounds");function Fl(t,e,r,n,i){Ct.bumpVerticalPos(r);let a=n;if(e.id&&e.message&&t[e.id]){const s=t[e.id].width,o=y0(Ye);e.message=Pr.wrapLabel(`[${e.message}]`,s-2*Ye.wrapPadding,o),e.width=s,e.wrap=!0;const l=Pr.calculateTextDimensions(e.message,o),u=Dt.getMax(l.height,Ye.labelBoxHeight);a=n+u,se.debug(`${u} - ${e.message}`)}i(e),Ct.bumpVerticalPos(a)}T(Fl,"adjustLoopHeightForWrap");function TTe(t,e,r,n,i,a,s){function o(h,d){h.x{P.add(G.from),P.add(G.to)}),m=m.filter(G=>P.has(G))}const C=new Map(m.map((P,G)=>{var V;return[((V=d.get(P))==null?void 0:V.name)??P,G]}));Q1t(h,d,f,m,0,y,!1);const _=await syt(y,d,w,n);Wn.insertArrowHead(h,e),Wn.insertArrowCrossHead(h,e),Wn.insertArrowFilledHead(h,e),Wn.insertSequenceNumber(h,e),Wn.insertSolidTopArrowHead(h,e),Wn.insertSolidBottomArrowHead(h,e),Wn.insertStickTopArrowHead(h,e),Wn.insertStickBottomArrowHead(h,e),s==="neo"&&Wn.insertDropShadow(h,Ye);function k(P,G){const V=Ct.endActivation(P);V.starty+18>G&&(V.starty=G-6,G+=12),Wn.drawActivation(h,V,G,Ye,EA(P.from).length,n,C),Ct.insert(V.startx,G-10,V.stopx,G)}T(k,"activeEnd");let S=1,L=1;const $=[],I=[];let z=0;for(const P of y){let G,V,H;switch(P.type){case n.db.LINETYPE.NOTE:Ct.resetVerticalPos(),V=P.noteModel,await K1t(h,V,P.id);break;case n.db.LINETYPE.ACTIVE_START:Ct.newActivation(P,h,d);break;case n.db.LINETYPE.CENTRAL_CONNECTION:Ct.newActivation(P,h,d);break;case n.db.LINETYPE.CENTRAL_CONNECTION_REVERSE:Ct.newActivation(P,h,d);break;case n.db.LINETYPE.ACTIVE_END:k(P,Ct.getVerticalPos());break;case n.db.LINETYPE.LOOP_START:Fl(_,P,Ye.boxMargin,Ye.boxMargin+Ye.boxTextMargin,W=>Ct.newLoop(W));break;case n.db.LINETYPE.LOOP_END:G=Ct.endLoop(),await Wn.drawLoop(h,G,"loop",Ye,P),Ct.bumpVerticalPos(G.stopy-Ct.getVerticalPos()),Ct.models.addLoop(G);break;case n.db.LINETYPE.RECT_START:Fl(_,P,Ye.boxMargin,Ye.boxMargin,W=>Ct.newLoop(void 0,W.message));break;case n.db.LINETYPE.RECT_END:G=Ct.endLoop(),I.push(G),Ct.models.addLoop(G),Ct.bumpVerticalPos(G.stopy-Ct.getVerticalPos());break;case n.db.LINETYPE.OPT_START:Fl(_,P,Ye.boxMargin,Ye.boxMargin+Ye.boxTextMargin,W=>Ct.newLoop(W));break;case n.db.LINETYPE.OPT_END:G=Ct.endLoop(),await Wn.drawLoop(h,G,"opt",Ye,P),Ct.bumpVerticalPos(G.stopy-Ct.getVerticalPos()),Ct.models.addLoop(G);break;case n.db.LINETYPE.ALT_START:Fl(_,P,Ye.boxMargin,Ye.boxMargin+Ye.boxTextMargin,W=>Ct.newLoop(W));break;case n.db.LINETYPE.ALT_ELSE:Fl(_,P,Ye.boxMargin+Ye.boxTextMargin,Ye.boxMargin,W=>Ct.addSectionToLoop(W));break;case n.db.LINETYPE.ALT_END:G=Ct.endLoop(),await Wn.drawLoop(h,G,"alt",Ye,P),Ct.bumpVerticalPos(G.stopy-Ct.getVerticalPos()),Ct.models.addLoop(G);break;case n.db.LINETYPE.PAR_START:case n.db.LINETYPE.PAR_OVER_START:Fl(_,P,Ye.boxMargin,Ye.boxMargin+Ye.boxTextMargin,W=>Ct.newLoop(W)),Ct.saveVerticalPos();break;case n.db.LINETYPE.PAR_AND:Fl(_,P,Ye.boxMargin+Ye.boxTextMargin,Ye.boxMargin,W=>Ct.addSectionToLoop(W));break;case n.db.LINETYPE.PAR_END:G=Ct.endLoop(),await Wn.drawLoop(h,G,"par",Ye,P),Ct.bumpVerticalPos(G.stopy-Ct.getVerticalPos()),Ct.models.addLoop(G);break;case n.db.LINETYPE.AUTONUMBER:S=P.message.start||S,L=P.message.step||L,P.message.visible?n.db.enableSequenceNumbers():n.db.disableSequenceNumbers();break;case n.db.LINETYPE.CRITICAL_START:Fl(_,P,Ye.boxMargin,Ye.boxMargin+Ye.boxTextMargin,W=>Ct.newLoop(W));break;case n.db.LINETYPE.CRITICAL_OPTION:Fl(_,P,Ye.boxMargin+Ye.boxTextMargin,Ye.boxMargin,W=>Ct.addSectionToLoop(W));break;case n.db.LINETYPE.CRITICAL_END:G=Ct.endLoop(),await Wn.drawLoop(h,G,"critical",Ye,P),Ct.bumpVerticalPos(G.stopy-Ct.getVerticalPos()),Ct.models.addLoop(G);break;case n.db.LINETYPE.BREAK_START:Fl(_,P,Ye.boxMargin,Ye.boxMargin+Ye.boxTextMargin,W=>Ct.newLoop(W));break;case n.db.LINETYPE.BREAK_END:G=Ct.endLoop(),await Wn.drawLoop(h,G,"break",Ye,P),Ct.bumpVerticalPos(G.stopy-Ct.getVerticalPos()),Ct.models.addLoop(G);break;default:try{H=P.msgModel,H.starty=Ct.getVerticalPos(),H.sequenceIndex=S,H.sequenceVisible=n.db.showSequenceNumbers(),H.id=P.id,H.from=P.from,H.to=P.to;const W=await yTe(h,H);TTe(P,H,W,z,d,f,p),$.push({messageModel:H,lineStartY:W,msg:P}),Ct.models.addMessage(H)}catch(W){se.error("error while drawing message",W)}}[n.db.LINETYPE.SOLID_OPEN,n.db.LINETYPE.DOTTED_OPEN,n.db.LINETYPE.SOLID,n.db.LINETYPE.SOLID_TOP,n.db.LINETYPE.SOLID_BOTTOM,n.db.LINETYPE.STICK_TOP,n.db.LINETYPE.STICK_BOTTOM,n.db.LINETYPE.SOLID_TOP_DOTTED,n.db.LINETYPE.SOLID_BOTTOM_DOTTED,n.db.LINETYPE.STICK_TOP_DOTTED,n.db.LINETYPE.STICK_BOTTOM_DOTTED,n.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,n.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE,n.db.LINETYPE.STICK_ARROW_TOP_REVERSE,n.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE,n.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,n.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,n.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED,n.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED,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(P.type)&&(S=Math.round((S+L)*100)/100),z++}se.debug("createdActors",f),se.debug("destroyedActors",p),await Qz(h,d,m,!1,e,n,C);for(const P of $)await Z1t(h,P.messageModel,P.lineStartY,n,P.msg,e);Ye.mirrorActors&&await Qz(h,d,m,!0,e,n,C),I.forEach(P=>Wn.drawBackgroundRect(h,P)),fTe(h,d,m,Ye);for(const P of Ct.models.boxes){P.height=Ct.getVerticalPos()-P.y,Ct.insert(P.x,P.y,P.x+P.width,P.height);const G=Ye.boxMargin*2;P.startx=P.x-G,P.starty=P.y-G*.25,P.stopx=P.startx+P.width+2*G,P.stopy=P.starty+P.height+G*.75,P.stroke="rgb(0,0,0, 0.5)",Wn.drawBox(h,P,Ye)}x&&Ct.bumpVerticalPos(Ye.boxMargin);const F=vTe(h,d,m,u),{bounds:A}=Ct.getBounds();A.startx===void 0&&(A.startx=0),A.starty===void 0&&(A.starty=0),A.stopx===void 0&&(A.stopx=0),A.stopy===void 0&&(A.stopy=0);let R=A.stopy-A.starty;R{const s=y0(Ye);let o=a.actorKeys.reduce((d,f)=>d+=t.get(f).width+(t.get(f).margin||0),0);const l=Ye.boxMargin*8;o+=l,o-=2*Ye.boxTextMargin,a.wrap&&(a.name=Pr.wrapLabel(a.name,o-2*Ye.wrapPadding,s));const u=Pr.calculateTextDimensions(a.name,s);i=Dt.getMax(u.height,i);const h=Dt.getMax(o,u.width+2*Ye.wrapPadding);if(a.margin=Ye.boxTextMargin,oa.textMaxHeight=i),Dt.getMax(n,Ye.height)}T(CTe,"calculateActorMargins");var tyt=T(async function(t,e,r){const n=e.get(t.from),i=e.get(t.to),a=n.x,s=i.x,o=t.wrap&&t.message;let l=Ii(t.message)?await Wb(t.message,Pe()):Pr.calculateTextDimensions(o?Pr.wrapLabel(t.message,Ye.width,N1(Ye)):t.message,N1(Ye));const u={width:o?Ye.width:Dt.getMax(Ye.width,l.width+2*Ye.noteMargin),height:0,startx:n.x,stopx:0,starty:0,stopy:0,message:t.message};return t.placement===r.db.PLACEMENT.RIGHTOF?(u.width=o?Dt.getMax(Ye.width,l.width):Dt.getMax(n.width/2+i.width/2,l.width+2*Ye.noteMargin),u.startx=a+(n.width+Ye.actorMargin)/2):t.placement===r.db.PLACEMENT.LEFTOF?(u.width=o?Dt.getMax(Ye.width,l.width+2*Ye.noteMargin):Dt.getMax(n.width/2+i.width/2,l.width+2*Ye.noteMargin),u.startx=a-u.width+(n.width-Ye.actorMargin)/2):t.to===t.from?(l=Pr.calculateTextDimensions(o?Pr.wrapLabel(t.message,Dt.getMax(Ye.width,n.width),N1(Ye)):t.message,N1(Ye)),u.width=o?Dt.getMax(Ye.width,n.width):Dt.getMax(n.width,Ye.width,l.width+2*Ye.noteMargin),u.startx=a+(n.width-u.width)/2):(u.width=Math.abs(a+n.width/2-(s+i.width/2))+Ye.actorMargin,u.startx=a2,f=T(y=>l?-y:y,"adjustValue");t.from===t.to?h=u:(t.activate&&!d&&(h+=f(Ye.activationWidth/2-1)),[r.db.LINETYPE.SOLID_OPEN,r.db.LINETYPE.DOTTED_OPEN,r.db.LINETYPE.STICK_TOP,r.db.LINETYPE.STICK_BOTTOM,r.db.LINETYPE.STICK_TOP_DOTTED,r.db.LINETYPE.STICK_BOTTOM_DOTTED,r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,r.db.LINETYPE.STICK_ARROW_TOP_REVERSE,r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE,r.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED,r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED,r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE].includes(t.type)||(h+=f(3)),[r.db.LINETYPE.BIDIRECTIONAL_SOLID,r.db.LINETYPE.BIDIRECTIONAL_DOTTED,r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE].includes(t.type)&&(u-=f(3)));const p=[i,a,s,o],g=Math.abs(u-h);t.wrap&&t.message&&(t.message=Pr.wrapLabel(t.message,Dt.getMax(g+2*Ye.wrapPadding,Ye.width),y0(Ye)));const m=Pr.calculateTextDimensions(t.message,y0(Ye));return{width:Dt.getMax(t.wrap?0:m.width+2*Ye.wrapPadding,g+2*Ye.wrapPadding,Ye.width),height:0,startx:u,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"),syt=T(async function(t,e,r,n){const i={},a=[];let s,o,l;for(const u of t){switch(u.type){case n.db.LINETYPE.LOOP_START:case n.db.LINETYPE.ALT_START:case n.db.LINETYPE.OPT_START:case n.db.LINETYPE.PAR_START:case n.db.LINETYPE.PAR_OVER_START:case n.db.LINETYPE.CRITICAL_START:case n.db.LINETYPE.BREAK_START:a.push({id:u.id,msg:u.message,from:Number.MAX_SAFE_INTEGER,to:Number.MIN_SAFE_INTEGER,width:0});break;case n.db.LINETYPE.ALT_ELSE:case n.db.LINETYPE.PAR_AND:case n.db.LINETYPE.CRITICAL_OPTION:u.message&&(s=a.pop(),i[s.id]=s,i[u.id]=s,a.push(s));break;case n.db.LINETYPE.LOOP_END:case n.db.LINETYPE.ALT_END:case n.db.LINETYPE.OPT_END:case n.db.LINETYPE.PAR_END:case n.db.LINETYPE.CRITICAL_END:case n.db.LINETYPE.BREAK_END:s=a.pop(),i[s.id]=s;break;case n.db.LINETYPE.ACTIVE_START:{const d=e.get(u.from?u.from:u.to.actor),f=EA(u.from?u.from:u.to.actor).length,p=d.x+d.width/2+(f-1)*Ye.activationWidth/2,g={startx:p,stopx:p+Ye.activationWidth,actor:u.from,enabled:!0};Ct.activations.push(g)}break;case n.db.LINETYPE.ACTIVE_END:{const d=Ct.activations.map(f=>f.actor).lastIndexOf(u.from);Ct.activations.splice(d,1).splice(0,1)}break}u.placement!==void 0?(o=await tyt(u,e,n),u.noteModel=o,a.forEach(d=>{s=d,s.from=Dt.getMin(s.from,o.startx),s.to=Dt.getMax(s.to,o.startx+o.width),s.width=Dt.getMax(s.width,Math.abs(s.from-s.to))-Ye.labelBoxWidth})):(l=ayt(u,e,n),u.msgModel=l,l.startx&&l.stopx&&a.length>0&&a.forEach(d=>{if(s=d,l.startx===l.stopx){const f=e.get(u.from),p=e.get(u.to);s.from=Dt.getMin(f.x-l.width/2,f.x-f.width/2,s.from),s.to=Dt.getMax(p.x+l.width/2,p.x+f.width/2,s.to),s.width=Dt.getMax(s.width,Math.abs(s.to-s.from))-Ye.labelBoxWidth}else s.from=Dt.getMin(l.startx,s.from),s.to=Dt.getMax(l.stopx,s.to),s.width=Dt.getMax(s.width,l.width)-Ye.labelBoxWidth}))}return Ct.activations=[],se.debug("Loop type widths:",i),i},"calculateLoopBounds"),oyt={bounds:Ct,drawActors:Qz,drawActorsPopup:vTe,setConf:bTe,draw:J1t},lyt={parser:g1t,get db(){return new b1t},renderer:oyt,styles:T1t,init:T(t=>{t.sequence||(t.sequence={}),t.wrap&&(t.sequence.wrap=t.wrap,N7({sequence:{wrap:t.wrap}}))},"init")};const cyt=Object.freeze(Object.defineProperty({__proto__:null,diagram:lyt},Symbol.toStringTag,{value:"Module"}));var eG=(function(){var t=T(function(tt,Ze,ke,_e){for(ke=ke||{},_e=tt.length;_e--;ke[tt[_e]]=Ze);return ke},"o"),e=[1,18],r=[1,19],n=[1,20],i=[1,41],a=[1,26],s=[1,42],o=[1,24],l=[1,25],u=[1,32],h=[1,33],d=[1,34],f=[1,45],p=[1,35],g=[1,36],m=[1,37],y=[1,38],v=[1,27],x=[1,28],b=[1,29],w=[1,30],C=[1,31],_=[1,44],k=[1,46],S=[1,43],L=[1,47],$=[1,9],I=[1,8,9],z=[1,58],F=[1,59],A=[1,60],R=[1,61],N=[1,62],M=[1,63],D=[1,64],O=[1,8,9,41],B=[1,77],P=[1,8,9,12,13,22,39,41,44,46,68,69,70,71,72,73,74,79,81],G=[1,8,9,12,13,18,20,22,39,41,44,46,47,60,68,69,70,71,72,73,74,79,81,86,100,102,103],V=[13,60,86,100,102,103],H=[13,60,73,74,86,100,102,103],W=[13,60,68,69,70,71,72,86,100,102,103],ie=[1,103],j=[1,121],ae=[1,117],J=[1,113],K=[1,119],Q=[1,114],re=[1,115],le=[1,116],fe=[1,118],Ae=[1,120],Se=[22,50,60,61,82,86,87,88,89,90],Ne=[1,128],ge=[12,39],ve=[1,8,9,39,41,44,46],ze=[1,8,9,22],xe=[1,153],Ke=[1,8,9,61],Ce=[1,8,9,22,50,60,61,82,86,87,88,89,90],Ve={trace:T(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mermaidDoc:4,statements:5,graphConfig:6,CLASS_DIAGRAM:7,NEWLINE:8,EOF:9,statement:10,classLabel:11,SQS:12,STR:13,SQE:14,namespaceName:15,alphaNumToken:16,classLiteralName:17,DOT:18,className:19,GENERICTYPE:20,relationStatement:21,LABEL:22,namespaceStatement:23,classStatement:24,memberStatement:25,annotationStatement:26,clickStatement:27,styleStatement:28,cssClassStatement:29,noteStatement:30,classDefStatement:31,direction:32,acc_title:33,acc_title_value:34,acc_descr:35,acc_descr_value:36,acc_descr_multiline_value:37,namespaceIdentifier:38,STRUCT_START:39,classStatements:40,STRUCT_STOP:41,NAMESPACE:42,classIdentifier:43,STYLE_SEPARATOR:44,members:45,ANNOTATION_START:46,ANNOTATION_END:47,CLASS:48,emptyBody:49,SPACE:50,MEMBER:51,SEPARATOR:52,relation:53,NOTE_FOR:54,noteText:55,NOTE:56,CLASSDEF:57,classList:58,stylesOpt:59,ALPHA:60,COMMA:61,direction_tb:62,direction_bt:63,direction_rl:64,direction_lr:65,relationType:66,lineType:67,AGGREGATION:68,EXTENSION:69,COMPOSITION:70,DEPENDENCY:71,LOLLIPOP:72,LINE:73,DOTTED_LINE:74,CALLBACK:75,LINK:76,LINK_TARGET:77,CLICK:78,CALLBACK_NAME:79,CALLBACK_ARGS:80,HREF:81,STYLE:82,CSSCLASS:83,style:84,styleComponent:85,NUM:86,COLON:87,UNIT:88,BRKT:89,PCT:90,commentToken:91,textToken:92,graphCodeTokens:93,textNoTagsToken:94,TAGSTART:95,TAGEND:96,"==":97,"--":98,DEFAULT:99,MINUS:100,keywords:101,UNICODE_TEXT:102,BQUOTE_STR:103,$accept:0,$end:1},terminals_:{2:"error",7:"CLASS_DIAGRAM",8:"NEWLINE",9:"EOF",12:"SQS",13:"STR",14:"SQE",18:"DOT",20:"GENERICTYPE",22:"LABEL",33:"acc_title",34:"acc_title_value",35:"acc_descr",36:"acc_descr_value",37:"acc_descr_multiline_value",39:"STRUCT_START",41:"STRUCT_STOP",42:"NAMESPACE",44:"STYLE_SEPARATOR",46:"ANNOTATION_START",47:"ANNOTATION_END",48:"CLASS",50:"SPACE",51:"MEMBER",52:"SEPARATOR",54:"NOTE_FOR",56:"NOTE",57:"CLASSDEF",60:"ALPHA",61:"COMMA",62:"direction_tb",63:"direction_bt",64:"direction_rl",65:"direction_lr",68:"AGGREGATION",69:"EXTENSION",70:"COMPOSITION",71:"DEPENDENCY",72:"LOLLIPOP",73:"LINE",74:"DOTTED_LINE",75:"CALLBACK",76:"LINK",77:"LINK_TARGET",78:"CLICK",79:"CALLBACK_NAME",80:"CALLBACK_ARGS",81:"HREF",82:"STYLE",83:"CSSCLASS",86:"NUM",87:"COLON",88:"UNIT",89:"BRKT",90:"PCT",93:"graphCodeTokens",95:"TAGSTART",96:"TAGEND",97:"==",98:"--",99:"DEFAULT",100:"MINUS",101:"keywords",102:"UNICODE_TEXT",103:"BQUOTE_STR"},productions_:[0,[3,1],[3,1],[4,1],[6,4],[5,1],[5,2],[5,3],[11,3],[15,1],[15,1],[15,3],[15,2],[19,1],[19,3],[19,1],[19,2],[19,2],[19,2],[10,1],[10,2],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,2],[10,2],[10,1],[23,4],[23,5],[38,2],[38,3],[40,1],[40,2],[40,3],[40,1],[40,2],[40,3],[40,1],[40,2],[40,3],[24,1],[24,3],[24,4],[24,3],[24,6],[24,4],[24,7],[24,6],[43,2],[43,3],[49,0],[49,2],[49,2],[26,4],[45,1],[45,2],[25,1],[25,2],[25,1],[25,1],[21,3],[21,4],[21,4],[21,5],[30,3],[30,2],[31,3],[58,1],[58,3],[32,1],[32,1],[32,1],[32,1],[53,3],[53,2],[53,2],[53,1],[66,1],[66,1],[66,1],[66,1],[66,1],[67,1],[67,1],[27,3],[27,4],[27,3],[27,4],[27,4],[27,5],[27,3],[27,4],[27,4],[27,5],[27,4],[27,5],[27,5],[27,6],[28,3],[29,3],[59,1],[59,3],[84,1],[84,2],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[91,1],[91,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[94,1],[94,1],[94,1],[94,1],[16,1],[16,1],[16,1],[16,1],[17,1],[55,1]],performAction:T(function(Ze,ke,_e,Y,he,Z,pe){var ne=Z.length-1;switch(he){case 8:this.$=Z[ne-1];break;case 9:case 10:case 13:case 15:this.$=Z[ne];break;case 11:case 14:this.$=Z[ne-2]+"."+Z[ne];break;case 12:case 16:this.$=Z[ne-1]+Z[ne];break;case 17:case 18:this.$=Z[ne-1]+"~"+Z[ne]+"~";break;case 19:Y.addRelation(Z[ne]);break;case 20:Z[ne-1].title=Y.cleanupLabel(Z[ne]),Y.addRelation(Z[ne-1]);break;case 31:this.$=Z[ne].trim(),Y.setAccTitle(this.$);break;case 32:case 33:this.$=Z[ne].trim(),Y.setAccDescription(this.$);break;case 34:Y.addClassesToNamespace(Z[ne-3],Z[ne-1][0],Z[ne-1][1]),Y.popNamespace();break;case 35:Y.addClassesToNamespace(Z[ne-4],Z[ne-1][0],Z[ne-1][1]),Y.popNamespace();break;case 36:this.$=Y.addNamespace(Z[ne]);break;case 37:this.$=Y.addNamespace(Z[ne-1],Z[ne]);break;case 38:this.$=[[Z[ne]],[]];break;case 39:this.$=[[Z[ne-1]],[]];break;case 40:Z[ne][0].unshift(Z[ne-2]),this.$=Z[ne];break;case 41:this.$=[[],[Z[ne]]];break;case 42:this.$=[[],[Z[ne-1]]];break;case 43:Z[ne][1].unshift(Z[ne-2]),this.$=Z[ne];break;case 44:case 45:this.$=[[],[]];break;case 46:this.$=Z[ne];break;case 48:Y.setCssClass(Z[ne-2],Z[ne]);break;case 49:Y.addMembers(Z[ne-3],Z[ne-1]);break;case 51:Y.setCssClass(Z[ne-5],Z[ne-3]),Y.addMembers(Z[ne-5],Z[ne-1]);break;case 52:Y.addAnnotation(Z[ne-3],Z[ne-1]);break;case 53:Y.addAnnotation(Z[ne-6],Z[ne-4]),Y.addMembers(Z[ne-6],Z[ne-1]);break;case 54:Y.addAnnotation(Z[ne-5],Z[ne-3]);break;case 55:this.$=Z[ne],Y.addClass(Z[ne]);break;case 56:this.$=Z[ne-1],Y.addClass(Z[ne-1]),Y.setClassLabel(Z[ne-1],Z[ne]);break;case 60:Y.addAnnotation(Z[ne],Z[ne-2]);break;case 61:case 74:this.$=[Z[ne]];break;case 62:Z[ne].push(Z[ne-1]),this.$=Z[ne];break;case 63:break;case 64:Y.addMember(Z[ne-1],Y.cleanupLabel(Z[ne]));break;case 65:break;case 66:break;case 67:this.$={id1:Z[ne-2],id2:Z[ne],relation:Z[ne-1],relationTitle1:"none",relationTitle2:"none"};break;case 68:this.$={id1:Z[ne-3],id2:Z[ne],relation:Z[ne-1],relationTitle1:Z[ne-2],relationTitle2:"none"};break;case 69:this.$={id1:Z[ne-3],id2:Z[ne],relation:Z[ne-2],relationTitle1:"none",relationTitle2:Z[ne-1]};break;case 70:this.$={id1:Z[ne-4],id2:Z[ne],relation:Z[ne-2],relationTitle1:Z[ne-3],relationTitle2:Z[ne-1]};break;case 71:this.$=Y.addNote(Z[ne],Z[ne-1]);break;case 72:this.$=Y.addNote(Z[ne]);break;case 73:this.$=Z[ne-2],Y.defineClass(Z[ne-1],Z[ne]);break;case 75:this.$=Z[ne-2].concat([Z[ne]]);break;case 76:Y.setDirection("TB");break;case 77:Y.setDirection("BT");break;case 78:Y.setDirection("RL");break;case 79:Y.setDirection("LR");break;case 80:this.$={type1:Z[ne-2],type2:Z[ne],lineType:Z[ne-1]};break;case 81:this.$={type1:"none",type2:Z[ne],lineType:Z[ne-1]};break;case 82:this.$={type1:Z[ne-1],type2:"none",lineType:Z[ne]};break;case 83:this.$={type1:"none",type2:"none",lineType:Z[ne]};break;case 84:this.$=Y.relationType.AGGREGATION;break;case 85:this.$=Y.relationType.EXTENSION;break;case 86:this.$=Y.relationType.COMPOSITION;break;case 87:this.$=Y.relationType.DEPENDENCY;break;case 88:this.$=Y.relationType.LOLLIPOP;break;case 89:this.$=Y.lineType.LINE;break;case 90:this.$=Y.lineType.DOTTED_LINE;break;case 91:case 97:this.$=Z[ne-2],Y.setClickEvent(Z[ne-1],Z[ne]);break;case 92:case 98:this.$=Z[ne-3],Y.setClickEvent(Z[ne-2],Z[ne-1]),Y.setTooltip(Z[ne-2],Z[ne]);break;case 93:this.$=Z[ne-2],Y.setLink(Z[ne-1],Z[ne]);break;case 94:this.$=Z[ne-3],Y.setLink(Z[ne-2],Z[ne-1],Z[ne]);break;case 95:this.$=Z[ne-3],Y.setLink(Z[ne-2],Z[ne-1]),Y.setTooltip(Z[ne-2],Z[ne]);break;case 96:this.$=Z[ne-4],Y.setLink(Z[ne-3],Z[ne-2],Z[ne]),Y.setTooltip(Z[ne-3],Z[ne-1]);break;case 99:this.$=Z[ne-3],Y.setClickEvent(Z[ne-2],Z[ne-1],Z[ne]);break;case 100:this.$=Z[ne-4],Y.setClickEvent(Z[ne-3],Z[ne-2],Z[ne-1]),Y.setTooltip(Z[ne-3],Z[ne]);break;case 101:this.$=Z[ne-3],Y.setLink(Z[ne-2],Z[ne]);break;case 102:this.$=Z[ne-4],Y.setLink(Z[ne-3],Z[ne-1],Z[ne]);break;case 103:this.$=Z[ne-4],Y.setLink(Z[ne-3],Z[ne-1]),Y.setTooltip(Z[ne-3],Z[ne]);break;case 104:this.$=Z[ne-5],Y.setLink(Z[ne-4],Z[ne-2],Z[ne]),Y.setTooltip(Z[ne-4],Z[ne-1]);break;case 105:this.$=Z[ne-2],Y.setCssStyle(Z[ne-1],Z[ne]);break;case 106:Y.setCssClass(Z[ne-1],Z[ne]);break;case 107:this.$=[Z[ne]];break;case 108:Z[ne-2].push(Z[ne]),this.$=Z[ne-2];break;case 110:this.$=Z[ne-1]+Z[ne];break}},"anonymous"),table:[{3:1,4:2,5:3,6:4,7:[1,6],10:5,16:39,17:40,19:21,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,33:e,35:r,37:n,38:22,42:i,43:23,46:a,48:s,51:o,52:l,54:u,56:h,57:d,60:f,62:p,63:g,64:m,65:y,75:v,76:x,78:b,82:w,83:C,86:_,100:k,102:S,103:L},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,3]},t($,[2,5],{8:[1,48]}),{8:[1,49]},t(I,[2,19],{22:[1,50]}),t(I,[2,21]),t(I,[2,22]),t(I,[2,23]),t(I,[2,24]),t(I,[2,25]),t(I,[2,26]),t(I,[2,27]),t(I,[2,28]),t(I,[2,29]),t(I,[2,30]),{34:[1,51]},{36:[1,52]},t(I,[2,33]),t(I,[2,63],{53:53,66:56,67:57,13:[1,54],22:[1,55],68:z,69:F,70:A,71:R,72:N,73:M,74:D}),{39:[1,65]},t(O,[2,47],{39:[1,67],44:[1,66],46:[1,68]}),t(I,[2,65]),t(I,[2,66]),{16:69,60:f,86:_,100:k,102:S},{16:39,17:40,19:70,60:f,86:_,100:k,102:S,103:L},{16:39,17:40,19:71,60:f,86:_,100:k,102:S,103:L},{16:39,17:40,19:72,60:f,86:_,100:k,102:S,103:L},{60:[1,73]},{13:[1,74]},{16:39,17:40,19:75,60:f,86:_,100:k,102:S,103:L},{13:B,55:76},{58:78,60:[1,79]},t(I,[2,76]),t(I,[2,77]),t(I,[2,78]),t(I,[2,79]),t(P,[2,13],{16:39,17:40,19:81,18:[1,80],20:[1,82],60:f,86:_,100:k,102:S,103:L}),t(P,[2,15],{20:[1,83]}),{15:84,16:85,17:86,60:f,86:_,100:k,102:S,103:L},{16:39,17:40,19:87,60:f,86:_,100:k,102:S,103:L},t(G,[2,133]),t(G,[2,134]),t(G,[2,135]),t(G,[2,136]),t([1,8,9,12,13,20,22,39,41,44,46,68,69,70,71,72,73,74,79,81],[2,137]),t($,[2,6],{10:5,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,19:21,38:22,43:23,16:39,17:40,5:88,33:e,35:r,37:n,42:i,46:a,48:s,51:o,52:l,54:u,56:h,57:d,60:f,62:p,63:g,64:m,65:y,75:v,76:x,78:b,82:w,83:C,86:_,100:k,102:S,103:L}),{5:89,10:5,16:39,17:40,19:21,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,33:e,35:r,37:n,38:22,42:i,43:23,46:a,48:s,51:o,52:l,54:u,56:h,57:d,60:f,62:p,63:g,64:m,65:y,75:v,76:x,78:b,82:w,83:C,86:_,100:k,102:S,103:L},t(I,[2,20]),t(I,[2,31]),t(I,[2,32]),{13:[1,91],16:39,17:40,19:90,60:f,86:_,100:k,102:S,103:L},{53:92,66:56,67:57,68:z,69:F,70:A,71:R,72:N,73:M,74:D},t(I,[2,64]),{67:93,73:M,74:D},t(V,[2,83],{66:94,68:z,69:F,70:A,71:R,72:N}),t(H,[2,84]),t(H,[2,85]),t(H,[2,86]),t(H,[2,87]),t(H,[2,88]),t(W,[2,89]),t(W,[2,90]),{8:[1,96],23:99,24:97,30:98,38:22,40:95,42:i,43:23,48:s,54:u,56:h},{16:100,60:f,86:_,100:k,102:S},{41:[1,102],45:101,51:ie},{16:104,60:f,86:_,100:k,102:S},{47:[1,105]},{13:[1,106]},{13:[1,107]},{79:[1,108],81:[1,109]},{22:j,50:ae,59:110,60:J,82:K,84:111,85:112,86:Q,87:re,88:le,89:fe,90:Ae},{60:[1,122]},{13:B,55:123},t(O,[2,72]),t(O,[2,138]),{22:j,50:ae,59:124,60:J,61:[1,125],82:K,84:111,85:112,86:Q,87:re,88:le,89:fe,90:Ae},t(Se,[2,74]),{16:39,17:40,19:126,60:f,86:_,100:k,102:S,103:L},t(P,[2,16]),t(P,[2,17]),t(P,[2,18]),{11:127,12:Ne,39:[2,36]},t(ge,[2,9],{16:85,17:86,15:130,18:[1,129],60:f,86:_,100:k,102:S,103:L}),t(ge,[2,10]),t(ve,[2,55],{11:131,12:Ne}),t($,[2,7]),{9:[1,132]},t(ze,[2,67]),{16:39,17:40,19:133,60:f,86:_,100:k,102:S,103:L},{13:[1,135],16:39,17:40,19:134,60:f,86:_,100:k,102:S,103:L},t(V,[2,82],{66:136,68:z,69:F,70:A,71:R,72:N}),t(V,[2,81]),{41:[1,137]},{23:99,24:97,30:98,38:22,40:138,42:i,43:23,48:s,54:u,56:h},{8:[1,139],41:[2,38]},{8:[1,140],41:[2,41]},{8:[1,141],41:[2,44]},t(O,[2,48],{39:[1,142]}),{41:[1,143]},t(O,[2,50]),{41:[2,61],45:144,51:ie},{47:[1,145]},{16:39,17:40,19:146,60:f,86:_,100:k,102:S,103:L},t(I,[2,91],{13:[1,147]}),t(I,[2,93],{13:[1,149],77:[1,148]}),t(I,[2,97],{13:[1,150],80:[1,151]}),{13:[1,152]},t(I,[2,105],{61:xe}),t(Ke,[2,107],{85:154,22:j,50:ae,60:J,82:K,86:Q,87:re,88:le,89:fe,90:Ae}),t(Ce,[2,109]),t(Ce,[2,111]),t(Ce,[2,112]),t(Ce,[2,113]),t(Ce,[2,114]),t(Ce,[2,115]),t(Ce,[2,116]),t(Ce,[2,117]),t(Ce,[2,118]),t(Ce,[2,119]),t(I,[2,106]),t(O,[2,71]),t(I,[2,73],{61:xe}),{60:[1,155]},t(P,[2,14]),{39:[2,37]},{13:[1,156]},{15:157,16:85,17:86,60:f,86:_,100:k,102:S,103:L},t(ge,[2,12]),t(ve,[2,56]),{1:[2,4]},t(ze,[2,69]),t(ze,[2,68]),{16:39,17:40,19:158,60:f,86:_,100:k,102:S,103:L},t(V,[2,80]),t(O,[2,34]),{41:[1,159]},{23:99,24:97,30:98,38:22,40:160,41:[2,39],42:i,43:23,48:s,54:u,56:h},{23:99,24:97,30:98,38:22,40:161,41:[2,42],42:i,43:23,48:s,54:u,56:h},{23:99,24:97,30:98,38:22,40:162,41:[2,45],42:i,43:23,48:s,54:u,56:h},{45:163,51:ie},t(O,[2,49]),{41:[2,62]},t(O,[2,52],{39:[1,164]}),t(I,[2,60]),t(I,[2,92]),t(I,[2,94]),t(I,[2,95],{77:[1,165]}),t(I,[2,98]),t(I,[2,99],{13:[1,166]}),t(I,[2,101],{13:[1,168],77:[1,167]}),{22:j,50:ae,60:J,82:K,84:169,85:112,86:Q,87:re,88:le,89:fe,90:Ae},t(Ce,[2,110]),t(Se,[2,75]),{14:[1,170]},t(ge,[2,11]),t(ze,[2,70]),t(O,[2,35]),{41:[2,40]},{41:[2,43]},{41:[2,46]},{41:[1,171]},{41:[1,173],45:172,51:ie},t(I,[2,96]),t(I,[2,100]),t(I,[2,102]),t(I,[2,103],{77:[1,174]}),t(Ke,[2,108],{85:154,22:j,50:ae,60:J,82:K,86:Q,87:re,88:le,89:fe,90:Ae}),t(ve,[2,8]),t(O,[2,51]),{41:[1,175]},t(O,[2,54]),t(I,[2,104]),t(O,[2,53])],defaultActions:{2:[2,1],3:[2,2],4:[2,3],127:[2,37],132:[2,4],144:[2,62],160:[2,40],161:[2,43],162:[2,46]},parseError:T(function(Ze,ke){if(ke.recoverable)this.trace(Ze);else{var _e=new Error(Ze);throw _e.hash=ke,_e}},"parseError"),parse:T(function(Ze){var ke=this,_e=[0],Y=[],he=[null],Z=[],pe=this.table,ne="",Be=0,Te=0,Ue=2,De=1,qe=Z.slice.call(arguments,1),Le=Object.create(this.lexer),Xe={yy:{}};for(var Ie in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Ie)&&(Xe.yy[Ie]=this.yy[Ie]);Le.setInput(Ze,Xe.yy),Xe.yy.lexer=Le,Xe.yy.parser=this,typeof Le.yylloc>"u"&&(Le.yylloc={});var it=Le.yylloc;Z.push(it);var we=Le.options&&Le.options.ranges;typeof Xe.yy.parseError=="function"?this.parseError=Xe.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ct(kt){_e.length=_e.length-2*kt,he.length=he.length-kt,Z.length=Z.length-kt}T(ct,"popStack");function be(){var kt;return kt=Y.pop()||Le.lex()||De,typeof kt!="number"&&(kt instanceof Array&&(Y=kt,kt=Y.pop()),kt=ke.symbols_[kt]||kt),kt}T(be,"lex");for(var _t,bt,lt,Mt,Tt={},dt,oe,Rt,ft;;){if(bt=_e[_e.length-1],this.defaultActions[bt]?lt=this.defaultActions[bt]:((_t===null||typeof _t>"u")&&(_t=be()),lt=pe[bt]&&pe[bt][_t]),typeof lt>"u"||!lt.length||!lt[0]){var ht="";ft=[];for(dt in pe[bt])this.terminals_[dt]&&dt>Ue&&ft.push("'"+this.terminals_[dt]+"'");Le.showPosition?ht="Parse error on line "+(Be+1)+`: `+Le.showPosition()+` -Expecting `+dt.join(", ")+", got '"+(this.terminals_[Et]||Et)+"'":ut="Parse error on line "+(Be+1)+": Unexpected "+(Et==De?"end of input":"'"+(this.terminals_[Et]||Et)+"'"),this.parseError(ut,{text:Le.match,token:this.terminals_[Et]||Et,line:Le.yylineno,loc:it,expected:dt})}if(ot[0]instanceof Array&&ot.length>1)throw new Error("Parse Error: multiple actions possible at state: "+vt+", token: "+Et);switch(ot[0]){case 1:Se.push(Et),he.push(Le.yytext),j.push(Le.yylloc),Se.push(ot[1]),Et=null,xe=Le.yyleng,re=Le.yytext,Be=Le.yylineno,it=Le.yylloc;break;case 2:if(oe=this.productions_[ot[1]][1],xt.$=he[he.length-oe],xt._$={first_line:j[j.length-(oe||1)].first_line,last_line:j[j.length-1].last_line,first_column:j[j.length-(oe||1)].first_column,last_column:j[j.length-1].last_column},we&&(xt._$.range=[j[j.length-(oe||1)].range[0],j[j.length-1].range[1]]),It=this.performAction.apply(xt,[re,xe,Be,Xe.yy,ot[1],he,j].concat(qe)),typeof It<"u")return It;oe&&(Se=Se.slice(0,-1*oe*2),he=he.slice(0,-1*oe),j=j.slice(0,-1*oe)),Se.push(this.productions_[ot[1]][0]),he.push(xt.$),j.push(xt._$),At=pe[Se[Se.length-2]][Se[Se.length-1]],Se.push(At);break;case 3:return!0}}return!0},"parse")},Qe=(function(){var tt={EOF:1,parseError:x(function(Ce,Se){if(this.yy.parser)this.yy.parser.parseError(Ce,Se);else throw new Error(Ce)},"parseError"),setInput:x(function(je,Ce){return this.yy=Ce||this.yy||{},this._input=je,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:x(function(){var je=this._input[0];this.yytext+=je,this.yyleng++,this.offset++,this.match+=je,this.matched+=je;var Ce=je.match(/(?:\r\n?|\n).*/g);return Ce?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),je},"input"),unput:x(function(je){var Ce=je.length,Se=je.split(/(?:\r\n?|\n)/g);this._input=je+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-Ce),this.offset-=Ce;var H=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),Se.length-1&&(this.yylineno-=Se.length-1);var he=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:Se?(Se.length===H.length?this.yylloc.first_column:0)+H[H.length-Se.length].length-Se[0].length:this.yylloc.first_column-Ce},this.options.ranges&&(this.yylloc.range=[he[0],he[0]+this.yyleng-Ce]),this.yyleng=this.yytext.length,this},"unput"),more:x(function(){return this._more=!0,this},"more"),reject:x(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). -`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:x(function(je){this.unput(this.match.slice(je))},"less"),pastInput:x(function(){var je=this.matched.substr(0,this.matched.length-this.match.length);return(je.length>20?"...":"")+je.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:x(function(){var je=this.match;return je.length<20&&(je+=this._input.substr(0,20-je.length)),(je.substr(0,20)+(je.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:x(function(){var je=this.pastInput(),Ce=new Array(je.length+1).join("-");return je+this.upcomingInput()+` -`+Ce+"^"},"showPosition"),test_match:x(function(je,Ce){var Se,H,he;if(this.options.backtrack_lexer&&(he={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(he.yylloc.range=this.yylloc.range.slice(0))),H=je[0].match(/(?:\r\n?|\n).*/g),H&&(this.yylineno+=H.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:H?H[H.length-1].length-H[H.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+je[0].length},this.yytext+=je[0],this.match+=je[0],this.matches=je,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(je[0].length),this.matched+=je[0],Se=this.performAction.call(this,this.yy,this,Ce,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),Se)return Se;if(this._backtrack){for(var j in he)this[j]=he[j];return!1}return!1},"test_match"),next:x(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var je,Ce,Se,H;this._more||(this.yytext="",this.match="");for(var he=this._currentRules(),j=0;jCe[0].length)){if(Ce=Se,H=j,this.options.backtrack_lexer){if(je=this.test_match(Se,he[j]),je!==!1)return je;if(this._backtrack){Ce=!1;continue}else return!1}else if(!this.options.flex)break}return Ce?(je=this.test_match(Ce,he[H]),je!==!1?je:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var Ce=this.next();return Ce||this.lex()},"lex"),begin:x(function(Ce){this.conditionStack.push(Ce)},"begin"),popState:x(function(){var Ce=this.conditionStack.length-1;return Ce>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(Ce){return Ce=this.conditionStack.length-1-Math.abs(Ce||0),Ce>=0?this.conditionStack[Ce]:"INITIAL"},"topState"),pushState:x(function(Ce){this.begin(Ce)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:x(function(Ce,Se,H,he){switch(H){case 0:return 62;case 1:return 63;case 2:return 64;case 3:return 65;case 4:break;case 5:break;case 6:return this.begin("acc_title"),33;case 7:return this.popState(),"acc_title_value";case 8:return this.begin("acc_descr"),35;case 9:return this.popState(),"acc_descr_value";case 10:this.begin("acc_descr_multiline");break;case 11:this.popState();break;case 12:return"acc_descr_multiline_value";case 13:return 8;case 14:break;case 15:return 7;case 16:return 7;case 17:return"EDGE_STATE";case 18:this.begin("callback_name");break;case 19:this.popState();break;case 20:this.popState(),this.begin("callback_args");break;case 21:return 79;case 22:this.popState();break;case 23:return 80;case 24:this.popState();break;case 25:return"STR";case 26:this.begin("string");break;case 27:return 82;case 28:return 57;case 29:return this.begin("namespace"),42;case 30:return this.popState(),8;case 31:break;case 32:return this.begin("namespace-body"),39;case 33:this.popState(),this.less(0);break;case 34:return this.popState(),41;case 35:return"EOF_IN_STRUCT";case 36:return 8;case 37:break;case 38:return"EDGE_STATE";case 39:return this.begin("class"),48;case 40:return this.popState(),8;case 41:break;case 42:return this.popState(),this.popState(),41;case 43:return this.begin("class-body"),39;case 44:return this.popState(),41;case 45:return"EOF_IN_STRUCT";case 46:return"EDGE_STATE";case 47:return"OPEN_IN_STRUCT";case 48:break;case 49:return"MEMBER";case 50:return 83;case 51:return 75;case 52:return 76;case 53:return 78;case 54:return 54;case 55:return 56;case 56:return 46;case 57:return 47;case 58:return 81;case 59:this.popState();break;case 60:return"GENERICTYPE";case 61:this.begin("generic");break;case 62:this.popState();break;case 63:return"BQUOTE_STR";case 64:this.begin("bqstring");break;case 65:return 77;case 66:return 77;case 67:return 77;case 68:return 77;case 69:return 69;case 70:return 69;case 71:return 71;case 72:return 71;case 73:return 70;case 74:return 68;case 75:return 72;case 76:return 73;case 77:return 74;case 78:return 22;case 79:return 44;case 80:return 100;case 81:return 18;case 82:return"PLUS";case 83:return 87;case 84:return 61;case 85:return 89;case 86:return 89;case 87:return 90;case 88:return"EQUALS";case 89:return"EQUALS";case 90:return 60;case 91:return 12;case 92:return 14;case 93:return"PUNCTUATION";case 94:return 86;case 95:return 102;case 96:return 50;case 97:return 50;case 98: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,29,34,35,36,37,38,39,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},namespace:{rules:[26,29,30,31,32,33,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},"class-body":{rules:[26,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},class:{rules:[26,40,41,42,43,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},acc_descr_multiline:{rules:[11,12,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},acc_descr:{rules:[9,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},acc_title:{rules:[7,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},callback_args:{rules:[22,23,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},callback_name:{rules:[19,20,21,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},href:{rules:[26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},struct:{rules:[26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},generic:{rules:[26,50,51,52,53,54,55,56,57,58,59,60,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},bqstring:{rules:[26,50,51,52,53,54,55,56,57,58,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},string:{rules:[24,25,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,8,10,13,14,15,16,17,18,26,27,28,29,39,50,51,52,53,54,55,56,57,58,61,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,98],inclusive:!0}}};return tt})();Ve.lexer=Qe;function nt(){this.yy={}}return x(nt,"Parser"),nt.prototype=Ve,Ve.Parser=nt,new nt})();E$.parser=E$;var lme=E$,cme=["#","+","~","-",""],ume=(Gv=class{constructor(e,r){this.memberType=r,this.visibility="",this.classifier="",this.text="";const n=qr(e,Pe());this.parseMember(n)}getDisplayDetails(){let e=this.visibility+Eu(this.id);this.memberType==="method"&&(e+=`(${Eu(this.parameters.trim())})`,this.returnType&&(e+=" : "+Eu(this.returnType))),e=e.trim();const r=this.parseClassifier();return{displayText:e,cssStyle:r}}parseMember(e){let r="";if(this.memberType==="method"){const a=/([#+~-])?(.+)\((.*)\)([\s$*])?(.*)([$*])?/.exec(e);if(a){const s=a[1]?a[1].trim():"";if(cme.includes(s)&&(this.visibility=s),this.id=a[2],this.parameters=a[3]?a[3].trim():"",r=a[4]?a[4].trim():"",this.returnType=a[5]?a[5].trim():"",r===""){const o=this.returnType.substring(this.returnType.length-1);/[$*]/.exec(o)&&(r=o,this.returnType=this.returnType.substring(0,this.returnType.length-1))}}}else{const i=e.length,a=e.substring(0,1),s=e.substring(i-1);cme.includes(a)&&(this.visibility=a),/[$*]/.exec(s)&&(r=s),this.id=e.substring(this.visibility===""?0:1,r===""?i:i-1)}this.classifier=r,this.id=this.id.startsWith(" ")?" "+this.id.trim():this.id.trim();const n=`${this.visibility?"\\"+this.visibility:""}${Eu(this.id)}${this.memberType==="method"?`(${Eu(this.parameters)})${this.returnType?" : "+Eu(this.returnType):""}`:""}`;this.text=n.replaceAll("<","<").replaceAll(">",">"),this.text.startsWith("\\<")&&(this.text=this.text.replace("\\<","~"))}parseClassifier(){switch(this.classifier){case"*":return"font-style:italic;";case"$":return"text-decoration:underline;";default:return""}}},x(Gv,"ClassMember"),Gv),AS="classId-",hme=0,r0=x(t=>Lt.sanitizeText(t,Pe()),"sanitizeText"),dme=(Bh=class{constructor(){this.relations=[],this.classes=new Map,this.styleClasses=new Map,this.notes=new Map,this.interfaces=[],this.namespaces=new Map,this.namespaceCounter=0,this.namespaceStack=[],this.diagramId="",this.functions=[],this.lineType={LINE:0,DOTTED_LINE:1},this.relationType={AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3,LOLLIPOP:4},this.setupToolTips=x(e=>{const r=xte();pt(e).select("svg").selectAll("g").filter(function(){return pt(this).attr("title")!==null}).on("mouseover",a=>{const s=pt(a.currentTarget),o=s.attr("title");if(!o)return;const l=a.currentTarget.getBoundingClientRect();r.transition().duration(200).style("opacity",".9"),r.html(ku.sanitize(o)).style("left",`${window.scrollX+l.left+l.width/2}px`).style("top",`${window.scrollY+l.bottom+4}px`),s.classed("hover",!0)}).on("mouseout",a=>{r.transition().duration(500).style("opacity",0),pt(a.currentTarget).classed("hover",!1)})},"setupToolTips"),this.direction="TB",this.setAccTitle=Dn,this.getAccTitle=Fn,this.setAccDescription=zn,this.getAccDescription=Gn,this.setDiagramTitle=qn,this.getDiagramTitle=Mn,this.getConfig=x(()=>Pe().class,"getConfig"),this.functions.push(this.setupToolTips.bind(this)),this.clear(),this.addRelation=this.addRelation.bind(this),this.addClassesToNamespace=this.addClassesToNamespace.bind(this),this.addNamespace=this.addNamespace.bind(this),this.popNamespace=this.popNamespace.bind(this),this.setCssClass=this.setCssClass.bind(this),this.addMembers=this.addMembers.bind(this),this.addClass=this.addClass.bind(this),this.setClassLabel=this.setClassLabel.bind(this),this.addAnnotation=this.addAnnotation.bind(this),this.addMember=this.addMember.bind(this),this.cleanupLabel=this.cleanupLabel.bind(this),this.addNote=this.addNote.bind(this),this.defineClass=this.defineClass.bind(this),this.setDirection=this.setDirection.bind(this),this.setLink=this.setLink.bind(this),this.bindFunctions=this.bindFunctions.bind(this),this.clear=this.clear.bind(this),this.setTooltip=this.setTooltip.bind(this),this.setClickEvent=this.setClickEvent.bind(this),this.setCssStyle=this.setCssStyle.bind(this)}splitClassNameAndType(e){const r=Lt.sanitizeText(e,Pe());let n="",i=r;if(r.indexOf("~")>0){const a=r.split("~");i=r0(a[0]),n=r0(a[1])}return{className:i,type:n}}setClassLabel(e,r){const n=Lt.sanitizeText(e,Pe());r&&(r=r0(r));const{className:i}=this.splitClassNameAndType(n);this.classes.get(i).label=r,this.classes.get(i).text=`${r}${this.classes.get(i).type?`<${this.classes.get(i).type}>`:""}`}addClass(e){const r=Lt.sanitizeText(e,Pe()),{className:n,type:i}=this.splitClassNameAndType(r);if(this.classes.has(n))return;const a=Lt.sanitizeText(n,Pe());this.classes.set(a,{id:a,type:i,label:a,text:`${a}${i?`<${i}>`:""}`,shape:"classBox",cssClasses:"default",methods:[],members:[],annotations:[],styles:[],domId:AS+a+"-"+hme}),hme++}addInterface(e,r){const n={id:`interface${this.interfaces.length}`,label:e,classId:r};this.interfaces.push(n)}setDiagramId(e){this.diagramId=e}lookUpDomId(e){const r=Lt.sanitizeText(e,Pe());if(this.classes.has(r)){const n=this.classes.get(r).domId;return this.diagramId?`${this.diagramId}-${n}`:n}throw new Error("Class not found: "+r)}clear(){this.relations=[],this.classes=new Map,this.notes=new Map,this.interfaces=[],this.functions=[],this.functions.push(this.setupToolTips.bind(this)),this.namespaces=new Map,this.namespaceCounter=0,this.namespaceStack=[],this.diagramId="",this.direction="TB",In()}getClass(e){return this.classes.get(e)}getClasses(){return this.classes}getRelations(){return this.relations}getNote(e){const r=typeof e=="number"?`note${e}`:e;return this.notes.get(r)}getNotes(){return this.notes}addRelation(e){ae.debug("Adding relation: "+JSON.stringify(e));const r=[this.relationType.LOLLIPOP,this.relationType.AGGREGATION,this.relationType.COMPOSITION,this.relationType.DEPENDENCY,this.relationType.EXTENSION];e.relation.type1===this.relationType.LOLLIPOP&&!r.includes(e.relation.type2)?(this.addClass(e.id2),this.addInterface(e.id1,e.id2),e.id1=`interface${this.interfaces.length-1}`):e.relation.type2===this.relationType.LOLLIPOP&&!r.includes(e.relation.type1)?(this.addClass(e.id1),this.addInterface(e.id2,e.id1),e.id2=`interface${this.interfaces.length-1}`):(this.addClass(e.id1),this.addClass(e.id2)),e.id1=this.splitClassNameAndType(e.id1).className,e.id2=this.splitClassNameAndType(e.id2).className,e.relationTitle1=Lt.sanitizeText(e.relationTitle1.trim(),Pe()),e.relationTitle2=Lt.sanitizeText(e.relationTitle2.trim(),Pe()),this.relations.push(e)}addAnnotation(e,r){const n=this.splitClassNameAndType(e).className;this.classes.get(n).annotations.push(r)}addMember(e,r){this.addClass(e);const n=this.splitClassNameAndType(e).className,i=this.classes.get(n);if(typeof r=="string"){const a=r.trim();a.startsWith("<<")&&a.endsWith(">>")?i.annotations.push(r0(a.substring(2,a.length-2))):a.indexOf(")")>0?i.methods.push(new ume(a,"method")):a&&i.members.push(new ume(a,"attribute"))}}addMembers(e,r){Array.isArray(r)&&(r.reverse(),r.forEach(n=>this.addMember(e,n)))}addNote(e,r){const n=this.notes.size,i={id:`note${n}`,class:r,text:e,index:n};return this.notes.set(i.id,i),i.id}cleanupLabel(e){return e.startsWith(":")&&(e=e.substring(1)),r0(e.trim())}setCssClass(e,r){e.split(",").forEach(n=>{let i=n;/\d/.exec(n[0])&&(i=AS+i);const a=this.classes.get(i);a&&(a.cssClasses+=" "+r)})}defineClass(e,r){for(const n of e){let i=this.styleClasses.get(n);i===void 0&&(i={id:n,styles:[],textStyles:[]},this.styleClasses.set(n,i)),r&&r.forEach(a=>{if(/color/.exec(a)){const s=a.replace("fill","bgFill");i.textStyles.push(s)}i.styles.push(a)}),this.classes.forEach(a=>{a.cssClasses.includes(n)&&a.styles.push(...r.flatMap(s=>s.split(",")))})}}setTooltip(e,r){e.split(",").forEach(n=>{r!==void 0&&(this.classes.get(n).tooltip=r0(r))})}getTooltip(e,r){return r&&this.namespaces.has(r)?this.namespaces.get(r).classes.get(e).tooltip:this.classes.get(e).tooltip}setLink(e,r,n){const i=Pe();e.split(",").forEach(a=>{let s=a;/\d/.exec(a[0])&&(s=AS+s);const o=this.classes.get(s);o&&(o.link=Lr.formatUrl(r,i),i.securityLevel==="sandbox"?o.linkTarget="_top":typeof n=="string"?o.linkTarget=r0(n):o.linkTarget="_blank")}),this.setCssClass(e,"clickable")}setClickEvent(e,r,n){e.split(",").forEach(i=>{this.setClickFunc(i,r,n),this.classes.get(i).haveCallback=!0}),this.setCssClass(e,"clickable")}setClickFunc(e,r,n){const i=Lt.sanitizeText(e,Pe());if(Pe().securityLevel!=="loose"||r===void 0)return;const s=i;if(this.classes.has(s)){let o=[];if(typeof n=="string"){o=n.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let l=0;l{const l=this.lookUpDomId(s),u=document.querySelector(`[id="${l}"]`);u!==null&&u.addEventListener("click",()=>{Lr.runFunc(r,...o)},!1)})}}bindFunctions(e){this.functions.forEach(r=>{r(e)})}escapeHtml(e){return e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}getDirection(){return this.direction}setDirection(e){this.direction=e}static resolveQualifiedId(e,r){const n=r.at(-1);return n?`${n}.${e}`:e}static getAncestorIds(e){const r=e.split("."),n=new Array(r.length);n[0]=r[0];for(let i=1;i0?a[s-1]:void 0,u=s===a.length-1,h=u&&r?r:i[s];this.namespaces.has(o)?u&&(this.namespaces.get(o).explicit=!0):this.namespaces.set(o,this.createNamespaceNode(o,h,l,u)),l&&this.linkParentChild(l,o)}return n}popNamespace(){this.namespaceStack.pop()}getNamespace(e){return this.namespaces.get(e)}getNamespaces(){return this.namespaces}addClassesToNamespace(e,r,n){if(this.namespaces.has(e)){for(const i of r){const{className:a}=this.splitClassNameAndType(i),s=this.getClass(a);s.parent=e,this.namespaces.get(e).classes.set(a,s)}for(const i of n){const a=this.getNote(i);a.parent=e,this.namespaces.get(e).notes.set(i,a)}}}setCssStyle(e,r){const n=this.classes.get(e);if(!(!r||!n))for(const i of r)i.includes(",")?n.styles.push(...i.split(",")):n.styles.push(i)}getArrowMarker(e){let r;switch(e){case 0:r="aggregation";break;case 1:r="extension";break;case 2:r="composition";break;case 3:r="dependency";break;case 4:r="lollipop";break;default:r="none"}return r}resolveExplicitAncestor(e){let r=e;for(;r;){const n=this.namespaces.get(r);if(!n)return;if(n.explicit)return r;r=n.parent}}getData(){var s,o;const e=[],r=[],n=Pe(),i=((s=n.class)==null?void 0:s.hierarchicalNamespaces)??!0;for(const l of this.namespaces.values()){if(!i&&!l.explicit)continue;const u={id:l.id,label:i?l.label:l.id,isGroup:!0,padding:n.class.padding??16,shape:"rect",cssStyles:[],look:n.look,parentId:i?l.parent:void 0};e.push(u)}for(const l of this.classes.values()){const u=i?l.parent:this.resolveExplicitAncestor(l.parent),h={...l,type:void 0,isGroup:!1,parentId:u,look:n.look};e.push(h)}for(const l of this.notes.values()){const u=i?l.parent:this.resolveExplicitAncestor(l.parent),h={id:l.id,label:l.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,parentId:u,labelType:"markdown"};e.push(h);const d=(o=this.classes.get(l.class))==null?void 0:o.id;if(d){const f={id:`edgeNote${l.index}`,start:l.id,end:d,type:"normal",thickness:"normal",classes:"relation",arrowTypeStart:"none",arrowTypeEnd:"none",arrowheadStyle:"",labelStyle:[""],style:["fill: none"],pattern:"dotted",look:n.look};r.push(f)}}for(const l of this.interfaces){const u={id:l.id,label:l.label,isGroup:!1,shape:"rect",cssStyles:["opacity: 0;"],look:n.look};e.push(u)}let a=0;for(const l of this.relations){a++;const u={id:V0(l.id1,l.id2,{prefix:"id",counter:a}),start:l.id1,end:l.id2,type:"normal",label:l.title,labelpos:"c",thickness:"normal",classes:"relation",arrowTypeStart:this.getArrowMarker(l.relation.type1),arrowTypeEnd:this.getArrowMarker(l.relation.type2),startLabelRight:l.relationTitle1==="none"?"":l.relationTitle1,endLabelLeft:l.relationTitle2==="none"?"":l.relationTitle2,arrowheadStyle:"",labelStyle:["display: inline-block"],style:l.style||"",pattern:l.relation.lineType==1?"dashed":"solid",look:n.look,labelType:"markdown"};r.push(u)}return{nodes:e,edges:r,other:{},config:n,direction:this.getDirection()}}},x(Bh,"ClassDB"),Bh),kct=x(t=>`g.classGroup text { +Expecting `+ft.join(", ")+", got '"+(this.terminals_[_t]||_t)+"'":ht="Parse error on line "+(Be+1)+": Unexpected "+(_t==De?"end of input":"'"+(this.terminals_[_t]||_t)+"'"),this.parseError(ht,{text:Le.match,token:this.terminals_[_t]||_t,line:Le.yylineno,loc:it,expected:ft})}if(lt[0]instanceof Array&<.length>1)throw new Error("Parse Error: multiple actions possible at state: "+bt+", token: "+_t);switch(lt[0]){case 1:_e.push(_t),he.push(Le.yytext),Z.push(Le.yylloc),_e.push(lt[1]),_t=null,Te=Le.yyleng,ne=Le.yytext,Be=Le.yylineno,it=Le.yylloc;break;case 2:if(oe=this.productions_[lt[1]][1],Tt.$=he[he.length-oe],Tt._$={first_line:Z[Z.length-(oe||1)].first_line,last_line:Z[Z.length-1].last_line,first_column:Z[Z.length-(oe||1)].first_column,last_column:Z[Z.length-1].last_column},we&&(Tt._$.range=[Z[Z.length-(oe||1)].range[0],Z[Z.length-1].range[1]]),Mt=this.performAction.apply(Tt,[ne,Te,Be,Xe.yy,lt[1],he,Z].concat(qe)),typeof Mt<"u")return Mt;oe&&(_e=_e.slice(0,-1*oe*2),he=he.slice(0,-1*oe),Z=Z.slice(0,-1*oe)),_e.push(this.productions_[lt[1]][0]),he.push(Tt.$),Z.push(Tt._$),Rt=pe[_e[_e.length-2]][_e[_e.length-1]],_e.push(Rt);break;case 3:return!0}}return!0},"parse")},Qe=(function(){var tt={EOF:1,parseError:T(function(ke,_e){if(this.yy.parser)this.yy.parser.parseError(ke,_e);else throw new Error(ke)},"parseError"),setInput:T(function(Ze,ke){return this.yy=ke||this.yy||{},this._input=Ze,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:T(function(){var Ze=this._input[0];this.yytext+=Ze,this.yyleng++,this.offset++,this.match+=Ze,this.matched+=Ze;var ke=Ze.match(/(?:\r\n?|\n).*/g);return ke?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),Ze},"input"),unput:T(function(Ze){var ke=Ze.length,_e=Ze.split(/(?:\r\n?|\n)/g);this._input=Ze+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-ke),this.offset-=ke;var Y=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),_e.length-1&&(this.yylineno-=_e.length-1);var he=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:_e?(_e.length===Y.length?this.yylloc.first_column:0)+Y[Y.length-_e.length].length-_e[0].length:this.yylloc.first_column-ke},this.options.ranges&&(this.yylloc.range=[he[0],he[0]+this.yyleng-ke]),this.yyleng=this.yytext.length,this},"unput"),more:T(function(){return this._more=!0,this},"more"),reject:T(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). +`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:T(function(Ze){this.unput(this.match.slice(Ze))},"less"),pastInput:T(function(){var Ze=this.matched.substr(0,this.matched.length-this.match.length);return(Ze.length>20?"...":"")+Ze.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:T(function(){var Ze=this.match;return Ze.length<20&&(Ze+=this._input.substr(0,20-Ze.length)),(Ze.substr(0,20)+(Ze.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:T(function(){var Ze=this.pastInput(),ke=new Array(Ze.length+1).join("-");return Ze+this.upcomingInput()+` +`+ke+"^"},"showPosition"),test_match:T(function(Ze,ke){var _e,Y,he;if(this.options.backtrack_lexer&&(he={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(he.yylloc.range=this.yylloc.range.slice(0))),Y=Ze[0].match(/(?:\r\n?|\n).*/g),Y&&(this.yylineno+=Y.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:Y?Y[Y.length-1].length-Y[Y.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+Ze[0].length},this.yytext+=Ze[0],this.match+=Ze[0],this.matches=Ze,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(Ze[0].length),this.matched+=Ze[0],_e=this.performAction.call(this,this.yy,this,ke,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),_e)return _e;if(this._backtrack){for(var Z in he)this[Z]=he[Z];return!1}return!1},"test_match"),next:T(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var Ze,ke,_e,Y;this._more||(this.yytext="",this.match="");for(var he=this._currentRules(),Z=0;Zke[0].length)){if(ke=_e,Y=Z,this.options.backtrack_lexer){if(Ze=this.test_match(_e,he[Z]),Ze!==!1)return Ze;if(this._backtrack){ke=!1;continue}else return!1}else if(!this.options.flex)break}return ke?(Ze=this.test_match(ke,he[Y]),Ze!==!1?Ze:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:T(function(){var ke=this.next();return ke||this.lex()},"lex"),begin:T(function(ke){this.conditionStack.push(ke)},"begin"),popState:T(function(){var ke=this.conditionStack.length-1;return ke>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:T(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:T(function(ke){return ke=this.conditionStack.length-1-Math.abs(ke||0),ke>=0?this.conditionStack[ke]:"INITIAL"},"topState"),pushState:T(function(ke){this.begin(ke)},"pushState"),stateStackSize:T(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:T(function(ke,_e,Y,he){switch(Y){case 0:return 62;case 1:return 63;case 2:return 64;case 3:return 65;case 4:break;case 5:break;case 6:return this.begin("acc_title"),33;case 7:return this.popState(),"acc_title_value";case 8:return this.begin("acc_descr"),35;case 9:return this.popState(),"acc_descr_value";case 10:this.begin("acc_descr_multiline");break;case 11:this.popState();break;case 12:return"acc_descr_multiline_value";case 13:return 8;case 14:break;case 15:return 7;case 16:return 7;case 17:return"EDGE_STATE";case 18:this.begin("callback_name");break;case 19:this.popState();break;case 20:this.popState(),this.begin("callback_args");break;case 21:return 79;case 22:this.popState();break;case 23:return 80;case 24:this.popState();break;case 25:return"STR";case 26:this.begin("string");break;case 27:return 82;case 28:return 57;case 29:return this.begin("namespace"),42;case 30:return this.popState(),8;case 31:break;case 32:return this.begin("namespace-body"),39;case 33:this.popState(),this.less(0);break;case 34:return this.popState(),41;case 35:return"EOF_IN_STRUCT";case 36:return 8;case 37:break;case 38:return"EDGE_STATE";case 39:return this.begin("class"),48;case 40:return this.popState(),8;case 41:break;case 42:return this.popState(),this.popState(),41;case 43:return this.begin("class-body"),39;case 44:return this.popState(),41;case 45:return"EOF_IN_STRUCT";case 46:return"EDGE_STATE";case 47:return"OPEN_IN_STRUCT";case 48:break;case 49:return"MEMBER";case 50:return 83;case 51:return 75;case 52:return 76;case 53:return 78;case 54:return 54;case 55:return 56;case 56:return 46;case 57:return 47;case 58:return 81;case 59:this.popState();break;case 60:return"GENERICTYPE";case 61:this.begin("generic");break;case 62:this.popState();break;case 63:return"BQUOTE_STR";case 64:this.begin("bqstring");break;case 65:return 77;case 66:return 77;case 67:return 77;case 68:return 77;case 69:return 69;case 70:return 69;case 71:return 71;case 72:return 71;case 73:return 70;case 74:return 68;case 75:return 72;case 76:return 73;case 77:return 74;case 78:return 22;case 79:return 44;case 80:return 100;case 81:return 18;case 82:return"PLUS";case 83:return 87;case 84:return 61;case 85:return 89;case 86:return 89;case 87:return 90;case 88:return"EQUALS";case 89:return"EQUALS";case 90:return 60;case 91:return 12;case 92:return 14;case 93:return"PUNCTUATION";case 94:return 86;case 95:return 102;case 96:return 50;case 97:return 50;case 98: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,29,34,35,36,37,38,39,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},namespace:{rules:[26,29,30,31,32,33,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},"class-body":{rules:[26,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},class:{rules:[26,40,41,42,43,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},acc_descr_multiline:{rules:[11,12,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},acc_descr:{rules:[9,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},acc_title:{rules:[7,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},callback_args:{rules:[22,23,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},callback_name:{rules:[19,20,21,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},href:{rules:[26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},struct:{rules:[26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},generic:{rules:[26,50,51,52,53,54,55,56,57,58,59,60,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},bqstring:{rules:[26,50,51,52,53,54,55,56,57,58,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},string:{rules:[24,25,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,8,10,13,14,15,16,17,18,26,27,28,29,39,50,51,52,53,54,55,56,57,58,61,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,98],inclusive:!0}}};return tt})();Ve.lexer=Qe;function nt(){this.yy={}}return T(nt,"Parser"),nt.prototype=Ve,Ve.Parser=nt,new nt})();eG.parser=eG;var ETe=eG,STe=["#","+","~","-",""],_Te=(xb=class{constructor(e,r){this.memberType=r,this.visibility="",this.classifier="",this.text="";const n=Zr(e,Pe());this.parseMember(n)}getDisplayDetails(){let e=this.visibility+kh(this.id);this.memberType==="method"&&(e+=`(${kh(this.parameters.trim())})`,this.returnType&&(e+=" : "+kh(this.returnType))),e=e.trim();const r=this.parseClassifier();return{displayText:e,cssStyle:r}}parseMember(e){let r="";if(this.memberType==="method"){const a=/([#+~-])?(.+)\((.*)\)([\s$*])?(.*)([$*])?/.exec(e);if(a){const s=a[1]?a[1].trim():"";if(STe.includes(s)&&(this.visibility=s),this.id=a[2],this.parameters=a[3]?a[3].trim():"",r=a[4]?a[4].trim():"",this.returnType=a[5]?a[5].trim():"",r===""){const o=this.returnType.substring(this.returnType.length-1);/[$*]/.exec(o)&&(r=o,this.returnType=this.returnType.substring(0,this.returnType.length-1))}}}else{const i=e.length,a=e.substring(0,1),s=e.substring(i-1);STe.includes(a)&&(this.visibility=a),/[$*]/.exec(s)&&(r=s),this.id=e.substring(this.visibility===""?0:1,r===""?i:i-1)}this.classifier=r,this.id=this.id.startsWith(" ")?" "+this.id.trim():this.id.trim();const n=`${this.visibility?"\\"+this.visibility:""}${kh(this.id)}${this.memberType==="method"?`(${kh(this.parameters)})${this.returnType?" : "+kh(this.returnType):""}`:""}`;this.text=n.replaceAll("<","<").replaceAll(">",">"),this.text.startsWith("\\<")&&(this.text=this.text.replace("\\<","~"))}parseClassifier(){switch(this.classifier){case"*":return"font-style:italic;";case"$":return"text-decoration:underline;";default:return""}}},T(xb,"ClassMember"),xb),SA="classId-",ATe=0,v0=T(t=>Dt.sanitizeText(t,Pe()),"sanitizeText"),RTe=(zd=class{constructor(){this.relations=[],this.classes=new Map,this.styleClasses=new Map,this.notes=new Map,this.interfaces=[],this.namespaces=new Map,this.namespaceCounter=0,this.namespaceStack=[],this.diagramId="",this.functions=[],this.lineType={LINE:0,DOTTED_LINE:1},this.relationType={AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3,LOLLIPOP:4},this.setupToolTips=T(e=>{const r=Ple();gt(e).select("svg").selectAll("g").filter(function(){return gt(this).attr("title")!==null}).on("mouseover",a=>{const s=gt(a.currentTarget),o=s.attr("title");if(!o)return;const l=a.currentTarget.getBoundingClientRect();r.transition().duration(200).style("opacity",".9"),r.html(Ch.sanitize(o)).style("left",`${window.scrollX+l.left+l.width/2}px`).style("top",`${window.scrollY+l.bottom+4}px`),s.classed("hover",!0)}).on("mouseout",a=>{r.transition().duration(500).style("opacity",0),gt(a.currentTarget).classed("hover",!1)})},"setupToolTips"),this.direction="TB",this.setAccTitle=Yn,this.getAccTitle=ii,this.setAccDescription=ai,this.getAccDescription=si,this.setDiagramTitle=oi,this.getDiagramTitle=Xn,this.getConfig=T(()=>Pe().class,"getConfig"),this.functions.push(this.setupToolTips.bind(this)),this.clear(),this.addRelation=this.addRelation.bind(this),this.addClassesToNamespace=this.addClassesToNamespace.bind(this),this.addNamespace=this.addNamespace.bind(this),this.popNamespace=this.popNamespace.bind(this),this.setCssClass=this.setCssClass.bind(this),this.addMembers=this.addMembers.bind(this),this.addClass=this.addClass.bind(this),this.setClassLabel=this.setClassLabel.bind(this),this.addAnnotation=this.addAnnotation.bind(this),this.addMember=this.addMember.bind(this),this.cleanupLabel=this.cleanupLabel.bind(this),this.addNote=this.addNote.bind(this),this.defineClass=this.defineClass.bind(this),this.setDirection=this.setDirection.bind(this),this.setLink=this.setLink.bind(this),this.bindFunctions=this.bindFunctions.bind(this),this.clear=this.clear.bind(this),this.setTooltip=this.setTooltip.bind(this),this.setClickEvent=this.setClickEvent.bind(this),this.setCssStyle=this.setCssStyle.bind(this)}splitClassNameAndType(e){const r=Dt.sanitizeText(e,Pe());let n="",i=r;if(r.indexOf("~")>0){const a=r.split("~");i=v0(a[0]),n=v0(a[1])}return{className:i,type:n}}setClassLabel(e,r){const n=Dt.sanitizeText(e,Pe());r&&(r=v0(r));const{className:i}=this.splitClassNameAndType(n);this.classes.get(i).label=r,this.classes.get(i).text=`${r}${this.classes.get(i).type?`<${this.classes.get(i).type}>`:""}`}addClass(e){const r=Dt.sanitizeText(e,Pe()),{className:n,type:i}=this.splitClassNameAndType(r);if(this.classes.has(n))return;const a=Dt.sanitizeText(n,Pe());this.classes.set(a,{id:a,type:i,label:a,text:`${a}${i?`<${i}>`:""}`,shape:"classBox",cssClasses:"default",methods:[],members:[],annotations:[],styles:[],domId:SA+a+"-"+ATe}),ATe++}addInterface(e,r){const n={id:`interface${this.interfaces.length}`,label:e,classId:r};this.interfaces.push(n)}setDiagramId(e){this.diagramId=e}lookUpDomId(e){const r=Dt.sanitizeText(e,Pe());if(this.classes.has(r)){const n=this.classes.get(r).domId;return this.diagramId?`${this.diagramId}-${n}`:n}throw new Error("Class not found: "+r)}clear(){this.relations=[],this.classes=new Map,this.notes=new Map,this.interfaces=[],this.functions=[],this.functions.push(this.setupToolTips.bind(this)),this.namespaces=new Map,this.namespaceCounter=0,this.namespaceStack=[],this.diagramId="",this.direction="TB",Hn()}getClass(e){return this.classes.get(e)}getClasses(){return this.classes}getRelations(){return this.relations}getNote(e){const r=typeof e=="number"?`note${e}`:e;return this.notes.get(r)}getNotes(){return this.notes}addRelation(e){se.debug("Adding relation: "+JSON.stringify(e));const r=[this.relationType.LOLLIPOP,this.relationType.AGGREGATION,this.relationType.COMPOSITION,this.relationType.DEPENDENCY,this.relationType.EXTENSION];e.relation.type1===this.relationType.LOLLIPOP&&!r.includes(e.relation.type2)?(this.addClass(e.id2),this.addInterface(e.id1,e.id2),e.id1=`interface${this.interfaces.length-1}`):e.relation.type2===this.relationType.LOLLIPOP&&!r.includes(e.relation.type1)?(this.addClass(e.id1),this.addInterface(e.id2,e.id1),e.id2=`interface${this.interfaces.length-1}`):(this.addClass(e.id1),this.addClass(e.id2)),e.id1=this.splitClassNameAndType(e.id1).className,e.id2=this.splitClassNameAndType(e.id2).className,e.relationTitle1=Dt.sanitizeText(e.relationTitle1.trim(),Pe()),e.relationTitle2=Dt.sanitizeText(e.relationTitle2.trim(),Pe()),this.relations.push(e)}addAnnotation(e,r){const n=this.splitClassNameAndType(e).className;this.classes.get(n).annotations.push(r)}addMember(e,r){this.addClass(e);const n=this.splitClassNameAndType(e).className,i=this.classes.get(n);if(typeof r=="string"){const a=r.trim();a.startsWith("<<")&&a.endsWith(">>")?i.annotations.push(v0(a.substring(2,a.length-2))):a.indexOf(")")>0?i.methods.push(new _Te(a,"method")):a&&i.members.push(new _Te(a,"attribute"))}}addMembers(e,r){Array.isArray(r)&&(r.reverse(),r.forEach(n=>this.addMember(e,n)))}addNote(e,r){const n=this.notes.size,i={id:`note${n}`,class:r,text:e,index:n};return this.notes.set(i.id,i),i.id}cleanupLabel(e){return e.startsWith(":")&&(e=e.substring(1)),v0(e.trim())}setCssClass(e,r){e.split(",").forEach(n=>{let i=n;/\d/.exec(n[0])&&(i=SA+i);const a=this.classes.get(i);a&&(a.cssClasses+=" "+r)})}defineClass(e,r){for(const n of e){let i=this.styleClasses.get(n);i===void 0&&(i={id:n,styles:[],textStyles:[]},this.styleClasses.set(n,i)),r&&r.forEach(a=>{if(/color/.exec(a)){const s=a.replace("fill","bgFill");i.textStyles.push(s)}i.styles.push(a)}),this.classes.forEach(a=>{a.cssClasses.includes(n)&&a.styles.push(...r.flatMap(s=>s.split(",")))})}}setTooltip(e,r){e.split(",").forEach(n=>{r!==void 0&&(this.classes.get(n).tooltip=v0(r))})}getTooltip(e,r){return r&&this.namespaces.has(r)?this.namespaces.get(r).classes.get(e).tooltip:this.classes.get(e).tooltip}setLink(e,r,n){const i=Pe();e.split(",").forEach(a=>{let s=a;/\d/.exec(a[0])&&(s=SA+s);const o=this.classes.get(s);o&&(o.link=Pr.formatUrl(r,i),i.securityLevel==="sandbox"?o.linkTarget="_top":typeof n=="string"?o.linkTarget=v0(n):o.linkTarget="_blank")}),this.setCssClass(e,"clickable")}setClickEvent(e,r,n){e.split(",").forEach(i=>{this.setClickFunc(i,r,n),this.classes.get(i).haveCallback=!0}),this.setCssClass(e,"clickable")}setClickFunc(e,r,n){const i=Dt.sanitizeText(e,Pe());if(Pe().securityLevel!=="loose"||r===void 0)return;const s=i;if(this.classes.has(s)){let o=[];if(typeof n=="string"){o=n.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let l=0;l{const l=this.lookUpDomId(s),u=document.querySelector(`[id="${l}"]`);u!==null&&u.addEventListener("click",()=>{Pr.runFunc(r,...o)},!1)})}}bindFunctions(e){this.functions.forEach(r=>{r(e)})}escapeHtml(e){return e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}getDirection(){return this.direction}setDirection(e){this.direction=e}static resolveQualifiedId(e,r){const n=r.at(-1);return n?`${n}.${e}`:e}static getAncestorIds(e){const r=e.split("."),n=new Array(r.length);n[0]=r[0];for(let i=1;i0?a[s-1]:void 0,u=s===a.length-1,h=u&&r?r:i[s];this.namespaces.has(o)?u&&(this.namespaces.get(o).explicit=!0):this.namespaces.set(o,this.createNamespaceNode(o,h,l,u)),l&&this.linkParentChild(l,o)}return n}popNamespace(){this.namespaceStack.pop()}getNamespace(e){return this.namespaces.get(e)}getNamespaces(){return this.namespaces}addClassesToNamespace(e,r,n){if(this.namespaces.has(e)){for(const i of r){const{className:a}=this.splitClassNameAndType(i),s=this.getClass(a);s.parent=e,this.namespaces.get(e).classes.set(a,s)}for(const i of n){const a=this.getNote(i);a.parent=e,this.namespaces.get(e).notes.set(i,a)}}}setCssStyle(e,r){const n=this.classes.get(e);if(!(!r||!n))for(const i of r)i.includes(",")?n.styles.push(...i.split(",")):n.styles.push(i)}getArrowMarker(e){let r;switch(e){case 0:r="aggregation";break;case 1:r="extension";break;case 2:r="composition";break;case 3:r="dependency";break;case 4:r="lollipop";break;default:r="none"}return r}resolveExplicitAncestor(e){let r=e;for(;r;){const n=this.namespaces.get(r);if(!n)return;if(n.explicit)return r;r=n.parent}}getData(){var s,o;const e=[],r=[],n=Pe(),i=((s=n.class)==null?void 0:s.hierarchicalNamespaces)??!0;for(const l of this.namespaces.values()){if(!i&&!l.explicit)continue;const u={id:l.id,label:i?l.label:l.id,isGroup:!0,padding:n.class.padding??16,shape:"rect",cssStyles:[],look:n.look,parentId:i?l.parent:void 0};e.push(u)}for(const l of this.classes.values()){const u=i?l.parent:this.resolveExplicitAncestor(l.parent),h={...l,type:void 0,isGroup:!1,parentId:u,look:n.look};e.push(h)}for(const l of this.notes.values()){const u=i?l.parent:this.resolveExplicitAncestor(l.parent),h={id:l.id,label:l.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,parentId:u,labelType:"markdown"};e.push(h);const d=(o=this.classes.get(l.class))==null?void 0:o.id;if(d){const f={id:`edgeNote${l.index}`,start:l.id,end:d,type:"normal",thickness:"normal",classes:"relation",arrowTypeStart:"none",arrowTypeEnd:"none",arrowheadStyle:"",labelStyle:[""],style:["fill: none"],pattern:"dotted",look:n.look};r.push(f)}}for(const l of this.interfaces){const u={id:l.id,label:l.label,isGroup:!1,shape:"rect",cssStyles:["opacity: 0;"],look:n.look};e.push(u)}let a=0;for(const l of this.relations){a++;const u={id:ag(l.id1,l.id2,{prefix:"id",counter:a}),start:l.id1,end:l.id2,type:"normal",label:l.title,labelpos:"c",thickness:"normal",classes:"relation",arrowTypeStart:this.getArrowMarker(l.relation.type1),arrowTypeEnd:this.getArrowMarker(l.relation.type2),startLabelRight:l.relationTitle1==="none"?"":l.relationTitle1,endLabelLeft:l.relationTitle2==="none"?"":l.relationTitle2,arrowheadStyle:"",labelStyle:["display: inline-block"],style:l.style||"",pattern:l.relation.lineType==1?"dashed":"solid",look:n.look,labelType:"markdown"};r.push(u)}return{nodes:e,edges:r,other:{},config:n,direction:this.getDirection()}}},T(zd,"ClassDB"),zd),uyt=T(t=>`g.classGroup text { fill: ${t.nodeBorder||t.classText}; stroke: none; font-family: ${t.fontFamily}; @@ -2225,13 +2226,13 @@ g.classGroup line { } text-align: center; } - ${px()} -`,"getStyles"),fme=kct,Ect=x((t,e="TB")=>{if(!t.doc)return e;let r=e;for(const n of t.doc)n.stmt==="dir"&&(r=n.value);return r},"getDir"),Sct=x(function(t,e){return e.db.getClasses()},"getClasses"),Act=x(async function(t,e,r,n){ae.info("REF0:"),ae.info("Drawing class diagram (v3)",e);const{securityLevel:i,state:a,layout:s}=Pe();n.db.setDiagramId(e);const o=n.db.getData(),l=Xp(e,i);o.type=n.type,o.layoutAlgorithm=sb(s),o.nodeSpacing=(a==null?void 0:a.nodeSpacing)||50,o.rankSpacing=(a==null?void 0:a.rankSpacing)||50,o.markers=["aggregation","extension","composition","dependency","lollipop"],o.diagramId=e,await Z0(o,l);const u=8;Lr.insertTitle(l,"classDiagramTitleText",(a==null?void 0:a.titleTopMargin)??25,n.db.getDiagramTitle()),Wd(l,u,"classDiagram",(a==null?void 0:a.useMaxWidth)??!0)},"draw"),pme={getClasses:Sct,draw:Act,getDir:Ect},_ct={parser:lme,get db(){return new dme},renderer:pme,styles:fme,init:x(t=>{t.class||(t.class={}),t.class.arrowMarkerAbsolute=t.arrowMarkerAbsolute},"init")};const Rct=Object.freeze(Object.defineProperty({__proto__:null,diagram:_ct},Symbol.toStringTag,{value:"Module"}));var Lct={parser:lme,get db(){return new dme},renderer:pme,styles:fme,init:x(t=>{t.class||(t.class={}),t.class.arrowMarkerAbsolute=t.arrowMarkerAbsolute},"init")};const Ict=Object.freeze(Object.defineProperty({__proto__:null,diagram:Lct},Symbol.toStringTag,{value:"Module"}));var S$=(function(){var t=x(function($,B,P,G){for(P=P||{},G=$.length;G--;P[$[G]]=B);return P},"o"),e=[1,2],r=[1,3],n=[1,4],i=[2,4],a=[1,9],s=[1,11],o=[1,16],l=[1,17],u=[1,18],h=[1,19],d=[1,33],f=[1,20],p=[1,21],g=[1,22],m=[1,23],y=[1,24],v=[1,26],T=[1,27],b=[1,28],w=[1,29],k=[1,30],A=[1,31],C=[1,32],_=[1,35],L=[1,36],O=[1,37],M=[1,38],z=[1,34],F=[1,4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],S=[1,4,5,14,15,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,39,40,41,45,48,51,52,53,54,57],R=[4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],N={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SPACE:4,NL:5,SD:6,document:7,line:8,statement:9,classDefStatement:10,styleStatement:11,cssClassStatement:12,idStatement:13,DESCR:14,"-->":15,HIDE_EMPTY:16,scale:17,WIDTH:18,COMPOSIT_STATE:19,STRUCT_START:20,STRUCT_STOP:21,STATE_DESCR:22,AS:23,ID:24,FORK:25,JOIN:26,CHOICE:27,CONCURRENT:28,note:29,notePosition:30,NOTE_TEXT:31,direction:32,acc_title:33,acc_title_value:34,acc_descr:35,acc_descr_value:36,acc_descr_multiline_value:37,CLICK:38,STRING:39,HREF:40,classDef:41,CLASSDEF_ID:42,CLASSDEF_STYLEOPTS:43,DEFAULT:44,style:45,STYLE_IDS:46,STYLEDEF_STYLEOPTS:47,class:48,CLASSENTITY_IDS:49,STYLECLASS:50,direction_tb:51,direction_bt:52,direction_rl:53,direction_lr:54,eol:55,";":56,EDGE_STATE:57,STYLE_SEPARATOR:58,left_of:59,right_of:60,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NL",6:"SD",14:"DESCR",15:"-->",16:"HIDE_EMPTY",17:"scale",18:"WIDTH",19:"COMPOSIT_STATE",20:"STRUCT_START",21:"STRUCT_STOP",22:"STATE_DESCR",23:"AS",24:"ID",25:"FORK",26:"JOIN",27:"CHOICE",28:"CONCURRENT",29:"note",31:"NOTE_TEXT",33:"acc_title",34:"acc_title_value",35:"acc_descr",36:"acc_descr_value",37:"acc_descr_multiline_value",38:"CLICK",39:"STRING",40:"HREF",41:"classDef",42:"CLASSDEF_ID",43:"CLASSDEF_STYLEOPTS",44:"DEFAULT",45:"style",46:"STYLE_IDS",47:"STYLEDEF_STYLEOPTS",48:"class",49:"CLASSENTITY_IDS",50:"STYLECLASS",51:"direction_tb",52:"direction_bt",53:"direction_rl",54:"direction_lr",56:";",57:"EDGE_STATE",58:"STYLE_SEPARATOR",59:"left_of",60:"right_of"},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,3],[9,4],[9,1],[9,2],[9,1],[9,4],[9,3],[9,6],[9,1],[9,1],[9,1],[9,1],[9,4],[9,4],[9,1],[9,2],[9,2],[9,1],[9,5],[9,5],[10,3],[10,3],[11,3],[12,3],[32,1],[32,1],[32,1],[32,1],[55,1],[55,1],[13,1],[13,1],[13,3],[13,3],[30,1],[30,1]],performAction:x(function(B,P,G,V,Y,W,ie){var K=W.length-1;switch(Y){case 3:return V.setRootDoc(W[K]),W[K];case 4:this.$=[];break;case 5:W[K]!="nl"&&(W[K-1].push(W[K]),this.$=W[K-1]);break;case 6:case 7:this.$=W[K];break;case 8:this.$="nl";break;case 12:this.$=W[K];break;case 13:const ee=W[K-1];ee.description=V.trimColon(W[K]),this.$=ee;break;case 14:this.$={stmt:"relation",state1:W[K-2],state2:W[K]};break;case 15:const ne=V.trimColon(W[K]);this.$={stmt:"relation",state1:W[K-3],state2:W[K-1],description:ne};break;case 19:this.$={stmt:"state",id:W[K-3],type:"default",description:"",doc:W[K-1]};break;case 20:var se=W[K],J=W[K-2].trim();if(W[K].match(":")){var Z=W[K].split(":");se=Z[0],J=[J,Z[1]]}this.$={stmt:"state",id:se,type:"default",description:J};break;case 21:this.$={stmt:"state",id:W[K-3],type:"default",description:W[K-5],doc:W[K-1]};break;case 22:this.$={stmt:"state",id:W[K],type:"fork"};break;case 23:this.$={stmt:"state",id:W[K],type:"join"};break;case 24:this.$={stmt:"state",id:W[K],type:"choice"};break;case 25:this.$={stmt:"state",id:V.getDividerId(),type:"divider"};break;case 26:this.$={stmt:"state",id:W[K-1].trim(),note:{position:W[K-2].trim(),text:W[K].trim()}};break;case 29:this.$=W[K].trim(),V.setAccTitle(this.$);break;case 30:case 31:this.$=W[K].trim(),V.setAccDescription(this.$);break;case 32:this.$={stmt:"click",id:W[K-3],url:W[K-2],tooltip:W[K-1]};break;case 33:this.$={stmt:"click",id:W[K-3],url:W[K-1],tooltip:""};break;case 34:case 35:this.$={stmt:"classDef",id:W[K-1].trim(),classes:W[K].trim()};break;case 36:this.$={stmt:"style",id:W[K-1].trim(),styleClass:W[K].trim()};break;case 37:this.$={stmt:"applyClass",id:W[K-1].trim(),styleClass:W[K].trim()};break;case 38:V.setDirection("TB"),this.$={stmt:"dir",value:"TB"};break;case 39:V.setDirection("BT"),this.$={stmt:"dir",value:"BT"};break;case 40:V.setDirection("RL"),this.$={stmt:"dir",value:"RL"};break;case 41:V.setDirection("LR"),this.$={stmt:"dir",value:"LR"};break;case 44:case 45:this.$={stmt:"state",id:W[K].trim(),type:"default",description:""};break;case 46:this.$={stmt:"state",id:W[K-2].trim(),classes:[W[K].trim()],type:"default",description:""};break;case 47:this.$={stmt:"state",id:W[K-2].trim(),classes:[W[K].trim()],type:"default",description:""};break}},"anonymous"),table:[{3:1,4:e,5:r,6:n},{1:[3]},{3:5,4:e,5:r,6:n},{3:6,4:e,5:r,6:n},t([1,4,5,16,17,19,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],i,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:a,5:s,8:8,9:10,10:12,11:13,12:14,13:15,16:o,17:l,19:u,22:h,24:d,25:f,26:p,27:g,28:m,29:y,32:25,33:v,35:T,37:b,38:w,41:k,45:A,48:C,51:_,52:L,53:O,54:M,57:z},t(F,[2,5]),{9:39,10:12,11:13,12:14,13:15,16:o,17:l,19:u,22:h,24:d,25:f,26:p,27:g,28:m,29:y,32:25,33:v,35:T,37:b,38:w,41:k,45:A,48:C,51:_,52:L,53:O,54:M,57:z},t(F,[2,7]),t(F,[2,8]),t(F,[2,9]),t(F,[2,10]),t(F,[2,11]),t(F,[2,12],{14:[1,40],15:[1,41]}),t(F,[2,16]),{18:[1,42]},t(F,[2,18],{20:[1,43]}),{23:[1,44]},t(F,[2,22]),t(F,[2,23]),t(F,[2,24]),t(F,[2,25]),{30:45,31:[1,46],59:[1,47],60:[1,48]},t(F,[2,28]),{34:[1,49]},{36:[1,50]},t(F,[2,31]),{13:51,24:d,57:z},{42:[1,52],44:[1,53]},{46:[1,54]},{49:[1,55]},t(S,[2,44],{58:[1,56]}),t(S,[2,45],{58:[1,57]}),t(F,[2,38]),t(F,[2,39]),t(F,[2,40]),t(F,[2,41]),t(F,[2,6]),t(F,[2,13]),{13:58,24:d,57:z},t(F,[2,17]),t(R,i,{7:59}),{24:[1,60]},{24:[1,61]},{23:[1,62]},{24:[2,48]},{24:[2,49]},t(F,[2,29]),t(F,[2,30]),{39:[1,63],40:[1,64]},{43:[1,65]},{43:[1,66]},{47:[1,67]},{50:[1,68]},{24:[1,69]},{24:[1,70]},t(F,[2,14],{14:[1,71]}),{4:a,5:s,8:8,9:10,10:12,11:13,12:14,13:15,16:o,17:l,19:u,21:[1,72],22:h,24:d,25:f,26:p,27:g,28:m,29:y,32:25,33:v,35:T,37:b,38:w,41:k,45:A,48:C,51:_,52:L,53:O,54:M,57:z},t(F,[2,20],{20:[1,73]}),{31:[1,74]},{24:[1,75]},{39:[1,76]},{39:[1,77]},t(F,[2,34]),t(F,[2,35]),t(F,[2,36]),t(F,[2,37]),t(S,[2,46]),t(S,[2,47]),t(F,[2,15]),t(F,[2,19]),t(R,i,{7:78}),t(F,[2,26]),t(F,[2,27]),{5:[1,79]},{5:[1,80]},{4:a,5:s,8:8,9:10,10:12,11:13,12:14,13:15,16:o,17:l,19:u,21:[1,81],22:h,24:d,25:f,26:p,27:g,28:m,29:y,32:25,33:v,35:T,37:b,38:w,41:k,45:A,48:C,51:_,52:L,53:O,54:M,57:z},t(F,[2,32]),t(F,[2,33]),t(F,[2,21])],defaultActions:{5:[2,1],6:[2,2],47:[2,48],48:[2,49]},parseError:x(function(B,P){if(P.recoverable)this.trace(B);else{var G=new Error(B);throw G.hash=P,G}},"parseError"),parse:x(function(B){var P=this,G=[0],V=[],Y=[null],W=[],ie=this.table,K="",se=0,J=0,Z=2,ee=1,ne=W.slice.call(arguments,1),ue=Object.create(this.lexer),fe={yy:{}};for(var _e in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_e)&&(fe.yy[_e]=this.yy[_e]);ue.setInput(B,fe.yy),fe.yy.lexer=ue,fe.yy.parser=this,typeof ue.yylloc>"u"&&(ue.yylloc={});var Ae=ue.yylloc;W.push(Ae);var Ne=ue.options&&ue.options.ranges;typeof fe.yy.parseError=="function"?this.parseError=fe.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function me(Se){G.length=G.length-2*Se,Y.length=Y.length-Se,W.length=W.length-Se}x(me,"popStack");function ve(){var Se;return Se=V.pop()||ue.lex()||ee,typeof Se!="number"&&(Se instanceof Array&&(V=Se,Se=V.pop()),Se=P.symbols_[Se]||Se),Se}x(ve,"lex");for(var Ge,Te,Ze,ke,Ve={},Qe,nt,tt,je;;){if(Te=G[G.length-1],this.defaultActions[Te]?Ze=this.defaultActions[Te]:((Ge===null||typeof Ge>"u")&&(Ge=ve()),Ze=ie[Te]&&ie[Te][Ge]),typeof Ze>"u"||!Ze.length||!Ze[0]){var Ce="";je=[];for(Qe in ie[Te])this.terminals_[Qe]&&Qe>Z&&je.push("'"+this.terminals_[Qe]+"'");ue.showPosition?Ce="Parse error on line "+(se+1)+`: -`+ue.showPosition()+` -Expecting `+je.join(", ")+", got '"+(this.terminals_[Ge]||Ge)+"'":Ce="Parse error on line "+(se+1)+": Unexpected "+(Ge==ee?"end of input":"'"+(this.terminals_[Ge]||Ge)+"'"),this.parseError(Ce,{text:ue.match,token:this.terminals_[Ge]||Ge,line:ue.yylineno,loc:Ae,expected:je})}if(Ze[0]instanceof Array&&Ze.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Te+", token: "+Ge);switch(Ze[0]){case 1:G.push(Ge),Y.push(ue.yytext),W.push(ue.yylloc),G.push(Ze[1]),Ge=null,J=ue.yyleng,K=ue.yytext,se=ue.yylineno,Ae=ue.yylloc;break;case 2:if(nt=this.productions_[Ze[1]][1],Ve.$=Y[Y.length-nt],Ve._$={first_line:W[W.length-(nt||1)].first_line,last_line:W[W.length-1].last_line,first_column:W[W.length-(nt||1)].first_column,last_column:W[W.length-1].last_column},Ne&&(Ve._$.range=[W[W.length-(nt||1)].range[0],W[W.length-1].range[1]]),ke=this.performAction.apply(Ve,[K,J,se,fe.yy,Ze[1],Y,W].concat(ne)),typeof ke<"u")return ke;nt&&(G=G.slice(0,-1*nt*2),Y=Y.slice(0,-1*nt),W=W.slice(0,-1*nt)),G.push(this.productions_[Ze[1]][0]),Y.push(Ve.$),W.push(Ve._$),tt=ie[G[G.length-2]][G[G.length-1]],G.push(tt);break;case 3:return!0}}return!0},"parse")},D=(function(){var $={EOF:1,parseError:x(function(P,G){if(this.yy.parser)this.yy.parser.parseError(P,G);else throw new Error(P)},"parseError"),setInput:x(function(B,P){return this.yy=P||this.yy||{},this._input=B,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:x(function(){var B=this._input[0];this.yytext+=B,this.yyleng++,this.offset++,this.match+=B,this.matched+=B;var P=B.match(/(?:\r\n?|\n).*/g);return P?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),B},"input"),unput:x(function(B){var P=B.length,G=B.split(/(?:\r\n?|\n)/g);this._input=B+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-P),this.offset-=P;var V=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),G.length-1&&(this.yylineno-=G.length-1);var Y=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:G?(G.length===V.length?this.yylloc.first_column:0)+V[V.length-G.length].length-G[0].length:this.yylloc.first_column-P},this.options.ranges&&(this.yylloc.range=[Y[0],Y[0]+this.yyleng-P]),this.yyleng=this.yytext.length,this},"unput"),more:x(function(){return this._more=!0,this},"more"),reject:x(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). -`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:x(function(B){this.unput(this.match.slice(B))},"less"),pastInput:x(function(){var B=this.matched.substr(0,this.matched.length-this.match.length);return(B.length>20?"...":"")+B.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:x(function(){var B=this.match;return B.length<20&&(B+=this._input.substr(0,20-B.length)),(B.substr(0,20)+(B.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:x(function(){var B=this.pastInput(),P=new Array(B.length+1).join("-");return B+this.upcomingInput()+` -`+P+"^"},"showPosition"),test_match:x(function(B,P){var G,V,Y;if(this.options.backtrack_lexer&&(Y={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(Y.yylloc.range=this.yylloc.range.slice(0))),V=B[0].match(/(?:\r\n?|\n).*/g),V&&(this.yylineno+=V.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:V?V[V.length-1].length-V[V.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+B[0].length},this.yytext+=B[0],this.match+=B[0],this.matches=B,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(B[0].length),this.matched+=B[0],G=this.performAction.call(this,this.yy,this,P,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),G)return G;if(this._backtrack){for(var W in Y)this[W]=Y[W];return!1}return!1},"test_match"),next:x(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var B,P,G,V;this._more||(this.yytext="",this.match="");for(var Y=this._currentRules(),W=0;WP[0].length)){if(P=G,V=W,this.options.backtrack_lexer){if(B=this.test_match(G,Y[W]),B!==!1)return B;if(this._backtrack){P=!1;continue}else return!1}else if(!this.options.flex)break}return P?(B=this.test_match(P,Y[V]),B!==!1?B:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var P=this.next();return P||this.lex()},"lex"),begin:x(function(P){this.conditionStack.push(P)},"begin"),popState:x(function(){var P=this.conditionStack.length-1;return P>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(P){return P=this.conditionStack.length-1-Math.abs(P||0),P>=0?this.conditionStack[P]:"INITIAL"},"topState"),pushState:x(function(P){this.begin(P)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:x(function(P,G,V,Y){function W(){const ie=G.yytext.indexOf("%%");if(ie===0)return!1;if(ie>0){const K=G.yytext.slice(0,ie),se=G.yytext.slice(ie);se&&P.lexer.unput(se),G.yytext=K}return!0}switch(x(W,"processId"),V){case 0:return 38;case 1:return 40;case 2:return 39;case 3:return 44;case 4:return 51;case 5:return 52;case 6:return 53;case 7:return 54;case 8:return 5;case 9:break;case 10:break;case 11:break;case 12:break;case 13:return this.pushState("SCALE"),17;case 14:return 18;case 15:this.popState();break;case 16:return this.begin("acc_title"),33;case 17:return this.popState(),"acc_title_value";case 18:return this.begin("acc_descr"),35;case 19:return this.popState(),"acc_descr_value";case 20:this.begin("acc_descr_multiline");break;case 21:this.popState();break;case 22:return"acc_descr_multiline_value";case 23:return this.pushState("CLASSDEF"),41;case 24:return this.popState(),this.pushState("CLASSDEFID"),"DEFAULT_CLASSDEF_ID";case 25:return this.popState(),this.pushState("CLASSDEFID"),42;case 26:return this.popState(),43;case 27:return this.pushState("CLASS"),48;case 28:return this.popState(),this.pushState("CLASS_STYLE"),49;case 29:return this.popState(),50;case 30:return this.pushState("STYLE"),45;case 31:return this.popState(),this.pushState("STYLEDEF_STYLES"),46;case 32:return this.popState(),47;case 33:return this.pushState("SCALE"),17;case 34:return 18;case 35:this.popState();break;case 36:this.pushState("STATE");break;case 37:return this.popState(),G.yytext=G.yytext.slice(0,-8).trim(),25;case 38:return this.popState(),G.yytext=G.yytext.slice(0,-8).trim(),26;case 39:return this.popState(),G.yytext=G.yytext.slice(0,-10).trim(),27;case 40:return this.popState(),G.yytext=G.yytext.slice(0,-8).trim(),25;case 41:return this.popState(),G.yytext=G.yytext.slice(0,-8).trim(),26;case 42:return this.popState(),G.yytext=G.yytext.slice(0,-10).trim(),27;case 43:return 51;case 44:return 52;case 45:return 53;case 46:return 54;case 47:this.pushState("STATE_STRING");break;case 48:return this.pushState("STATE_ID"),"AS";case 49:return W()?(this.popState(),"ID"):void 0;case 50:this.popState();break;case 51:return"STATE_DESCR";case 52:return 19;case 53:this.popState();break;case 54:return this.popState(),this.pushState("struct"),20;case 55:return this.popState(),21;case 56:break;case 57:return this.begin("NOTE"),29;case 58:return this.popState(),this.pushState("NOTE_ID"),59;case 59:return this.popState(),this.pushState("NOTE_ID"),60;case 60:this.popState(),this.pushState("FLOATING_NOTE");break;case 61:return this.popState(),this.pushState("FLOATING_NOTE_ID"),"AS";case 62:break;case 63:return"NOTE_TEXT";case 64:return W()?(this.popState(),"ID"):void 0;case 65:return W()?(this.popState(),this.pushState("NOTE_TEXT"),24):void 0;case 66:return this.popState(),G.yytext=G.yytext.substr(2).trim(),31;case 67:return this.popState(),G.yytext=G.yytext.slice(0,-8).trim(),31;case 68:return 6;case 69:return 6;case 70:return 16;case 71:return 57;case 72:return W()?24:void 0;case 73:return G.yytext=G.yytext.trim(),14;case 74:return 15;case 75:return 28;case 76:return 58;case 77:return 5;case 78:return"INVALID"}},"anonymous"),rules:[/^(?:click\b)/i,/^(?:href\b)/i,/^(?:"[^"]*")/i,/^(?:default\b)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:[\n]+)/i,/^(?:[\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,/^(?:.*<>)/i,/^(?:.*<>)/i,/^(?:.*<>)/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,/^(?:\})/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]*?\n\s*end note\b)/i,/^(?:stateDiagram\s+)/i,/^(?:stateDiagram-v2\s+)/i,/^(?:hide empty description\b)/i,/^(?:\[\*\])/i,/^(?:[^:\n\s\-\{]+)/i,/^(?:\s*:(?:[^:\n;]|:[^:\n;])+)/i,/^(?:-->)/i,/^(?:--)/i,/^(?::::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{LINE:{rules:[10,11,12],inclusive:!1},struct:{rules:[10,11,12,23,27,30,36,43,44,45,46,55,56,57,71,72,73,74,75,76],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:[32],inclusive:!1},STYLE_IDS:{rules:[],inclusive:!1},STYLE:{rules:[31],inclusive:!1},CLASS_STYLE:{rules:[29],inclusive:!1},CLASS:{rules:[28],inclusive:!1},CLASSDEFID:{rules:[26],inclusive:!1},CLASSDEF:{rules:[24,25],inclusive:!1},acc_descr_multiline:{rules:[21,22],inclusive:!1},acc_descr:{rules:[19],inclusive:!1},acc_title:{rules:[17],inclusive:!1},SCALE:{rules:[14,15,34,35],inclusive:!1},ALIAS:{rules:[],inclusive:!1},STATE_ID:{rules:[49],inclusive:!1},STATE_STRING:{rules:[50,51],inclusive:!1},FORK_STATE:{rules:[],inclusive:!1},STATE:{rules:[10,11,12,37,38,39,40,41,42,47,48,52,53,54],inclusive:!1},ID:{rules:[10,11,12],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,11,12,13,16,18,20,23,27,30,33,36,54,57,68,69,70,71,72,73,74,76,77,78],inclusive:!0}}};return $})();N.lexer=D;function I(){this.yy={}}return x(I,"Parser"),I.prototype=N,N.Parser=I,new I})();S$.parser=S$;var gme=S$,Dct="TB",mme="TB",yme="dir",rm="state",nm="root",A$="relation",Mct="classDef",Nct="style",Oct="applyClass",KT="default",vme="divider",bme="fill:none",xme="fill: #333",Tme="c",wme="markdown",Cme="normal",_$="rect",R$="rectWithTitle",$ct="stateStart",Pct="stateEnd",kme="divider",Eme="roundedWithTitle",Bct="note",Fct="noteGroup",jT="statediagram",zct="state",Gct=`${jT}-${zct}`,Sme="transition",qct="note",Vct="note-edge",Wct=`${Sme} ${Vct}`,Uct=`${jT}-${qct}`,Hct="cluster",Yct=`${jT}-${Hct}`,Xct="cluster-alt",Kct=`${jT}-${Xct}`,Ame="parent",_me="note",jct="state",L$="----",Zct=`${L$}${_me}`,Rme=`${L$}${Ame}`,Lme=x((t,e=mme)=>{if(!t.doc)return e;let r=e;for(const n of t.doc)n.stmt==="dir"&&(r=n.value);return r},"getDir"),Qct=x(function(t,e){return e.db.getClasses()},"getClasses"),Jct=x(async function(t,e,r,n){ae.info("REF0:"),ae.info("Drawing state diagram (v2)",e);const{securityLevel:i,state:a,layout:s}=Pe();n.db.extract(n.db.getRootDocV2());const o=n.db.getData(),l=Xp(e,i);o.type=n.type,o.layoutAlgorithm=s,o.nodeSpacing=(a==null?void 0:a.nodeSpacing)||50,o.rankSpacing=(a==null?void 0:a.rankSpacing)||50,Pe().look==="neo"?o.markers=["barbNeo"]:o.markers=["barb"],o.diagramId=e,await Z0(o,l);const h=8;try{(typeof n.db.getLinks=="function"?n.db.getLinks():new Map).forEach((f,p)=>{var w;const g=typeof p=="string"?p:typeof(p==null?void 0:p.id)=="string"?p.id:"";if(!g){ae.warn("⚠️ Invalid or missing stateId from key:",JSON.stringify(p));return}const m=(w=l.node())==null?void 0:w.querySelectorAll("g");let y;if(m==null||m.forEach(k=>{var C;((C=k.textContent)==null?void 0:C.trim())===g&&(y=k)}),!y){ae.warn("⚠️ Could not find node matching text:",g);return}const v=y.parentNode;if(!v){ae.warn("⚠️ Node has no parent, cannot wrap:",g);return}const T=document.createElementNS("http://www.w3.org/2000/svg","a"),b=f.url.replace(/^"+|"+$/g,"");if(T.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",b),T.setAttribute("target","_blank"),f.tooltip){const k=f.tooltip.replace(/^"+|"+$/g,"");T.setAttribute("title",k)}v.replaceChild(T,y),T.appendChild(y),ae.info("🔗 Wrapped node in
    tag for:",g,f.url)})}catch(d){ae.error("❌ Error injecting clickable links:",d)}Lr.insertTitle(l,"statediagramTitleText",(a==null?void 0:a.titleTopMargin)??25,n.db.getDiagramTitle()),Wd(l,h,jT,(a==null?void 0:a.useMaxWidth)??!0)},"draw"),eut={getClasses:Qct,draw:Jct,getDir:Lme},_S=new Map,Mh=0;function RS(t="",e=0,r="",n=L$){const i=r!==null&&r.length>0?`${n}${r}`:"";return`${jct}-${t}${i}-${e}`}x(RS,"stateDomId");var tut=x((t,e,r,n,i,a,s,o)=>{ae.trace("items",e),e.forEach(l=>{switch(l.stmt){case rm:QT(t,l,r,n,i,a,s,o);break;case KT:QT(t,l,r,n,i,a,s,o);break;case A$:{QT(t,l.state1,r,n,i,a,s,o),QT(t,l.state2,r,n,i,a,s,o);const u=s==="neo",h={id:"edge"+Mh,start:l.state1.id,end:l.state2.id,arrowhead:"normal",arrowTypeEnd:u?"arrow_barb_neo":"arrow_barb",style:bme,labelStyle:"",label:Lt.sanitizeText(l.description??"",Pe()),arrowheadStyle:xme,labelpos:Tme,labelType:wme,thickness:Cme,classes:Sme,look:s};i.push(h),Mh++}break}})},"setupDoc"),Ime=x((t,e=mme)=>{let r=e;if(t.doc)for(const n of t.doc)n.stmt==="dir"&&(r=n.value);return r},"getDir");function ZT(t,e,r){if(!e.id||e.id===""||e.id==="")return;e.cssClasses&&(Array.isArray(e.cssCompiledStyles)||(e.cssCompiledStyles=[]),e.cssClasses.split(" ").forEach(i=>{const a=r.get(i);a&&(e.cssCompiledStyles=[...e.cssCompiledStyles??[],...a.styles])}));const n=t.find(i=>i.id===e.id);n?Object.assign(n,e):t.push(e)}x(ZT,"insertOrUpdateNode");function Dme(t){var e;return((e=t==null?void 0:t.classes)==null?void 0:e.join(" "))??""}x(Dme,"getClassesFromDbInfo");function Mme(t){return(t==null?void 0:t.styles)??[]}x(Mme,"getStylesFromDbInfo");var QT=x((t,e,r,n,i,a,s,o)=>{var p,g,m;const l=e.id,u=r.get(l),h=Dme(u),d=Mme(u),f=Pe();if(ae.info("dataFetcher parsedItem",e,u,d),l!=="root"){let y=_$;e.start===!0?y=$ct:e.start===!1&&(y=Pct),e.type!==KT&&(y=e.type),_S.get(l)||_S.set(l,{id:l,shape:y,description:Lt.sanitizeText(l,f),cssClasses:`${h} ${Gct}`,cssStyles:d});const v=_S.get(l);e.description&&(Array.isArray(v.description)?(v.shape=R$,v.description.push(e.description)):(p=v.description)!=null&&p.length&&v.description.length>0?(v.shape=R$,v.description===l?v.description=[e.description]:v.description=[v.description,e.description]):(v.shape=_$,v.description=e.description),v.description=Lt.sanitizeTextOrArray(v.description,f)),((g=v.description)==null?void 0:g.length)===1&&v.shape===R$&&(v.type==="group"?v.shape=Eme:v.shape=_$),!v.type&&e.doc&&(ae.info("Setting cluster for XCX",l,Ime(e)),v.type="group",v.isGroup=!0,v.dir=Ime(e),v.shape=e.type===vme?kme:Eme,v.cssClasses=`${v.cssClasses} ${Yct} ${a?Kct:""}`);const T={labelStyle:"",shape:v.shape,label:v.description,cssClasses:v.cssClasses,cssCompiledStyles:[],cssStyles:v.cssStyles,id:l,dir:v.dir,domId:RS(l,Mh),type:v.type,isGroup:v.type==="group",padding:8,rx:10,ry:10,look:s,labelType:"markdown"};if(T.shape===kme&&(T.label=""),t&&t.id!=="root"&&(ae.trace("Setting node ",l," to be child of its parent ",t.id),T.parentId=t.id),T.centerLabel=!0,e.note){const b={labelStyle:"",shape:Bct,label:e.note.text,labelType:"markdown",cssClasses:Uct,cssStyles:[],cssCompiledStyles:[],id:l+Zct+"-"+Mh,domId:RS(l,Mh,_me),type:v.type,isGroup:v.type==="group",padding:(m=f.flowchart)==null?void 0:m.padding,look:s,position:e.note.position},w=l+Rme,k={labelStyle:"",shape:Fct,label:e.note.text,cssClasses:v.cssClasses,cssStyles:[],id:l+Rme,domId:RS(l,Mh,Ame),type:"group",isGroup:!0,padding:16,look:s,position:e.note.position};Mh++,k.id=w,b.parentId=w,ZT(n,k,o),ZT(n,b,o),ZT(n,T,o);let A=l,C=b.id;e.note.position==="left of"&&(A=b.id,C=l),i.push({id:A+"-"+C,start:A,end:C,arrowhead:"none",arrowTypeEnd:"",style:bme,labelStyle:"",classes:Wct,arrowheadStyle:xme,labelpos:Tme,labelType:wme,thickness:Cme,look:s})}else ZT(n,T,o)}e.doc&&(ae.trace("Adding nodes children "),tut(e,e.doc,r,n,i,!a,s,o))},"dataFetcher"),rut=x(()=>{_S.clear(),Mh=0},"reset"),ds={START_NODE:"[*]",START_TYPE:"start",END_NODE:"[*]",END_TYPE:"end",COLOR_KEYWORD:"color",FILL_KEYWORD:"fill",BG_FILL:"bgFill",STYLECLASS_SEP:","},Nme=x(()=>new Map,"newClassesList"),Ome=x(()=>({relations:[],states:new Map,documents:{}}),"newDoc"),LS=x(t=>JSON.parse(JSON.stringify(t)),"clone"),n0=(u0=class{constructor(e){this.version=e,this.nodes=[],this.edges=[],this.rootDoc=[],this.classes=Nme(),this.documents={root:Ome()},this.currentDocument=this.documents.root,this.startEndCount=0,this.dividerCnt=0,this.links=new Map,this.getAccTitle=Fn,this.setAccTitle=Dn,this.getAccDescription=Gn,this.setAccDescription=zn,this.setDiagramTitle=qn,this.getDiagramTitle=Mn,this.clear(),this.setRootDoc=this.setRootDoc.bind(this),this.getDividerId=this.getDividerId.bind(this),this.setDirection=this.setDirection.bind(this),this.trimColon=this.trimColon.bind(this)}extract(e){this.clear(!0);for(const i of Array.isArray(e)?e:e.doc)switch(i.stmt){case rm:this.addState(i.id.trim(),i.type,i.doc,i.description,i.note);break;case A$:this.addRelation(i.state1,i.state2,i.description);break;case Mct:this.addStyleClass(i.id.trim(),i.classes);break;case Nct:this.handleStyleDef(i);break;case Oct:this.setCssClass(i.id.trim(),i.styleClass);break;case"click":this.addLink(i.id,i.url,i.tooltip);break}const r=this.getStates(),n=Pe();rut(),QT(void 0,this.getRootDocV2(),r,this.nodes,this.edges,!0,n.look,this.classes);for(const i of this.nodes)if(Array.isArray(i.label)){if(i.description=i.label.slice(1),i.isGroup&&i.description.length>0)throw new Error(`Group nodes can only have label. Remove the additional description for node [${i.id}]`);i.label=i.label[0]}}handleStyleDef(e){const r=e.id.trim().split(","),n=e.styleClass.split(",");for(const i of r){let a=this.getState(i);if(!a){const s=i.trim();this.addState(s),a=this.getState(s)}a&&(a.styles=n.map(s=>{var o;return(o=s.replace(/;/g,""))==null?void 0:o.trim()}))}}setRootDoc(e){ae.info("Setting root doc",e),this.rootDoc=e,this.version===1?this.extract(e):this.extract(this.getRootDocV2())}docTranslator(e,r,n){if(r.stmt===A$){this.docTranslator(e,r.state1,!0),this.docTranslator(e,r.state2,!1);return}if(r.stmt===rm&&(r.id===ds.START_NODE?(r.id=e.id+(n?"_start":"_end"),r.start=n):r.id=r.id.trim()),r.stmt!==nm&&r.stmt!==rm||!r.doc)return;const i=[];let a=[];for(const s of r.doc)if(s.type===vme){const o=LS(s);o.doc=LS(a),i.push(o),a=[]}else a.push(s);if(i.length>0&&a.length>0){const s={stmt:rm,id:oV(),type:"divider",doc:LS(a)};i.push(LS(s)),r.doc=i}r.doc.forEach(s=>this.docTranslator(r,s,!0))}getRootDocV2(){return this.docTranslator({id:nm,stmt:nm},{id:nm,stmt:nm,doc:this.rootDoc},!0),{id:nm,doc:this.rootDoc}}addState(e,r=KT,n=void 0,i=void 0,a=void 0,s=void 0,o=void 0,l=void 0){const u=e==null?void 0:e.trim();if(!this.currentDocument.states.has(u))ae.info("Adding state ",u,i),this.currentDocument.states.set(u,{stmt:rm,id:u,descriptions:[],type:r,doc:n,note:a,classes:[],styles:[],textStyles:[]});else{const h=this.currentDocument.states.get(u);if(!h)throw new Error(`State not found: ${u}`);h.doc||(h.doc=n),h.type||(h.type=r)}if(i&&(ae.info("Setting state description",u,i),(Array.isArray(i)?i:[i]).forEach(d=>this.addDescription(u,d.trim()))),a){const h=this.currentDocument.states.get(u);if(!h)throw new Error(`State not found: ${u}`);h.note=a,h.note.text=Lt.sanitizeText(h.note.text,Pe())}s&&(ae.info("Setting state classes",u,s),(Array.isArray(s)?s:[s]).forEach(d=>this.setCssClass(u,d.trim()))),o&&(ae.info("Setting state styles",u,o),(Array.isArray(o)?o:[o]).forEach(d=>this.setStyle(u,d.trim()))),l&&(ae.info("Setting state styles",u,o),(Array.isArray(l)?l:[l]).forEach(d=>this.setTextStyle(u,d.trim())))}clear(e){this.nodes=[],this.edges=[],this.documents={root:Ome()},this.currentDocument=this.documents.root,this.startEndCount=0,this.classes=Nme(),e||(this.links=new Map,In())}getState(e){return this.currentDocument.states.get(e)}getStates(){return this.currentDocument.states}logDocuments(){ae.info("Documents = ",this.documents)}getRelations(){return this.currentDocument.relations}addLink(e,r,n){this.links.set(e,{url:r,tooltip:n}),ae.warn("Adding link",e,r,n)}getLinks(){return this.links}startIdIfNeeded(e=""){return e===ds.START_NODE?(this.startEndCount++,`${ds.START_TYPE}${this.startEndCount}`):e}startTypeIfNeeded(e="",r=KT){return e===ds.START_NODE?ds.START_TYPE:r}endIdIfNeeded(e=""){return e===ds.END_NODE?(this.startEndCount++,`${ds.END_TYPE}${this.startEndCount}`):e}endTypeIfNeeded(e="",r=KT){return e===ds.END_NODE?ds.END_TYPE:r}addRelationObjs(e,r,n=""){const i=this.startIdIfNeeded(e.id.trim()),a=this.startTypeIfNeeded(e.id.trim(),e.type),s=this.startIdIfNeeded(r.id.trim()),o=this.startTypeIfNeeded(r.id.trim(),r.type);this.addState(i,a,e.doc,e.description,e.note,e.classes,e.styles,e.textStyles),this.addState(s,o,r.doc,r.description,r.note,r.classes,r.styles,r.textStyles),this.currentDocument.relations.push({id1:i,id2:s,relationTitle:Lt.sanitizeText(n,Pe())})}addRelation(e,r,n){if(typeof e=="object"&&typeof r=="object")this.addRelationObjs(e,r,n);else if(typeof e=="string"&&typeof r=="string"){const i=this.startIdIfNeeded(e.trim()),a=this.startTypeIfNeeded(e),s=this.endIdIfNeeded(r.trim()),o=this.endTypeIfNeeded(r);this.addState(i,a),this.addState(s,o),this.currentDocument.relations.push({id1:i,id2:s,relationTitle:n?Lt.sanitizeText(n,Pe()):void 0})}}addDescription(e,r){var a;const n=this.currentDocument.states.get(e),i=r.startsWith(":")?r.replace(":","").trim():r;(a=n==null?void 0:n.descriptions)==null||a.push(Lt.sanitizeText(i,Pe()))}cleanupLabel(e){return e.startsWith(":")?e.slice(2).trim():e.trim()}getDividerId(){return this.dividerCnt++,`divider-id-${this.dividerCnt}`}addStyleClass(e,r=""){this.classes.has(e)||this.classes.set(e,{id:e,styles:[],textStyles:[]});const n=this.classes.get(e);r&&n&&r.split(ds.STYLECLASS_SEP).forEach(i=>{const a=i.replace(/([^;]*);/,"$1").trim();if(RegExp(ds.COLOR_KEYWORD).exec(i)){const o=a.replace(ds.FILL_KEYWORD,ds.BG_FILL).replace(ds.COLOR_KEYWORD,ds.FILL_KEYWORD);n.textStyles.push(o)}n.styles.push(a)})}getClasses(){return this.classes}setCssClass(e,r){e.split(",").forEach(n=>{var a;let i=this.getState(n);if(!i){const s=n.trim();this.addState(s),i=this.getState(s)}(a=i==null?void 0:i.classes)==null||a.push(r)})}setStyle(e,r){var n,i;(i=(n=this.getState(e))==null?void 0:n.styles)==null||i.push(r)}setTextStyle(e,r){var n,i;(i=(n=this.getState(e))==null?void 0:n.textStyles)==null||i.push(r)}getDirectionStatement(){return this.rootDoc.find(e=>e.stmt===yme)}getDirection(){var e;return((e=this.getDirectionStatement())==null?void 0:e.value)??Dct}setDirection(e){const r=this.getDirectionStatement();r?r.value=e:this.rootDoc.unshift({stmt:yme,value:e})}trimColon(e){return e.startsWith(":")?e.slice(1).trim():e.trim()}getData(){const e=Pe();return{nodes:this.nodes,edges:this.edges,other:{},config:e,direction:Lme(this.getRootDocV2())}}getConfig(){return Pe().state}},x(u0,"StateDB"),u0.relationType={AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3},u0),nut=x(t=>` + ${Tw()} +`,"getStyles"),LTe=uyt,hyt=T((t,e="TB")=>{if(!t.doc)return e;let r=e;for(const n of t.doc)n.stmt==="dir"&&(r=n.value);return r},"getDir"),dyt=T(function(t,e){return e.db.getClasses()},"getClasses"),fyt=T(async function(t,e,r,n){se.info("REF0:"),se.info("Drawing class diagram (v3)",e);const{securityLevel:i,state:a,layout:s}=Pe();n.db.setDiagramId(e);const o=n.db.getData(),l=_m(e,i);o.type=n.type,o.layoutAlgorithm=Fx(s),o.nodeSpacing=(a==null?void 0:a.nodeSpacing)||50,o.rankSpacing=(a==null?void 0:a.rankSpacing)||50,o.markers=["aggregation","extension","composition","dependency","lollipop"],o.diagramId=e,await fg(o,l);const u=8;Pr.insertTitle(l,"classDiagramTitleText",(a==null?void 0:a.titleTopMargin)??25,n.db.getDiagramTitle()),op(l,u,"classDiagram",(a==null?void 0:a.useMaxWidth)??!0)},"draw"),ITe={getClasses:dyt,draw:fyt,getDir:hyt},pyt={parser:ETe,get db(){return new RTe},renderer:ITe,styles:LTe,init:T(t=>{t.class||(t.class={}),t.class.arrowMarkerAbsolute=t.arrowMarkerAbsolute},"init")};const gyt=Object.freeze(Object.defineProperty({__proto__:null,diagram:pyt},Symbol.toStringTag,{value:"Module"}));var myt={parser:ETe,get db(){return new RTe},renderer:ITe,styles:LTe,init:T(t=>{t.class||(t.class={}),t.class.arrowMarkerAbsolute=t.arrowMarkerAbsolute},"init")};const yyt=Object.freeze(Object.defineProperty({__proto__:null,diagram:myt},Symbol.toStringTag,{value:"Module"}));var tG=(function(){var t=T(function(O,B,P,G){for(P=P||{},G=O.length;G--;P[O[G]]=B);return P},"o"),e=[1,2],r=[1,3],n=[1,4],i=[2,4],a=[1,9],s=[1,11],o=[1,16],l=[1,17],u=[1,18],h=[1,19],d=[1,33],f=[1,20],p=[1,21],g=[1,22],m=[1,23],y=[1,24],v=[1,26],x=[1,27],b=[1,28],w=[1,29],C=[1,30],_=[1,31],k=[1,32],S=[1,35],L=[1,36],$=[1,37],I=[1,38],z=[1,34],F=[1,4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],A=[1,4,5,14,15,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,39,40,41,45,48,51,52,53,54,57],R=[4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],N={trace:T(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SPACE:4,NL:5,SD:6,document:7,line:8,statement:9,classDefStatement:10,styleStatement:11,cssClassStatement:12,idStatement:13,DESCR:14,"-->":15,HIDE_EMPTY:16,scale:17,WIDTH:18,COMPOSIT_STATE:19,STRUCT_START:20,STRUCT_STOP:21,STATE_DESCR:22,AS:23,ID:24,FORK:25,JOIN:26,CHOICE:27,CONCURRENT:28,note:29,notePosition:30,NOTE_TEXT:31,direction:32,acc_title:33,acc_title_value:34,acc_descr:35,acc_descr_value:36,acc_descr_multiline_value:37,CLICK:38,STRING:39,HREF:40,classDef:41,CLASSDEF_ID:42,CLASSDEF_STYLEOPTS:43,DEFAULT:44,style:45,STYLE_IDS:46,STYLEDEF_STYLEOPTS:47,class:48,CLASSENTITY_IDS:49,STYLECLASS:50,direction_tb:51,direction_bt:52,direction_rl:53,direction_lr:54,eol:55,";":56,EDGE_STATE:57,STYLE_SEPARATOR:58,left_of:59,right_of:60,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NL",6:"SD",14:"DESCR",15:"-->",16:"HIDE_EMPTY",17:"scale",18:"WIDTH",19:"COMPOSIT_STATE",20:"STRUCT_START",21:"STRUCT_STOP",22:"STATE_DESCR",23:"AS",24:"ID",25:"FORK",26:"JOIN",27:"CHOICE",28:"CONCURRENT",29:"note",31:"NOTE_TEXT",33:"acc_title",34:"acc_title_value",35:"acc_descr",36:"acc_descr_value",37:"acc_descr_multiline_value",38:"CLICK",39:"STRING",40:"HREF",41:"classDef",42:"CLASSDEF_ID",43:"CLASSDEF_STYLEOPTS",44:"DEFAULT",45:"style",46:"STYLE_IDS",47:"STYLEDEF_STYLEOPTS",48:"class",49:"CLASSENTITY_IDS",50:"STYLECLASS",51:"direction_tb",52:"direction_bt",53:"direction_rl",54:"direction_lr",56:";",57:"EDGE_STATE",58:"STYLE_SEPARATOR",59:"left_of",60:"right_of"},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,3],[9,4],[9,1],[9,2],[9,1],[9,4],[9,3],[9,6],[9,1],[9,1],[9,1],[9,1],[9,4],[9,4],[9,1],[9,2],[9,2],[9,1],[9,5],[9,5],[10,3],[10,3],[11,3],[12,3],[32,1],[32,1],[32,1],[32,1],[55,1],[55,1],[13,1],[13,1],[13,3],[13,3],[30,1],[30,1]],performAction:T(function(B,P,G,V,H,W,ie){var j=W.length-1;switch(H){case 3:return V.setRootDoc(W[j]),W[j];case 4:this.$=[];break;case 5:W[j]!="nl"&&(W[j-1].push(W[j]),this.$=W[j-1]);break;case 6:case 7:this.$=W[j];break;case 8:this.$="nl";break;case 12:this.$=W[j];break;case 13:const Q=W[j-1];Q.description=V.trimColon(W[j]),this.$=Q;break;case 14:this.$={stmt:"relation",state1:W[j-2],state2:W[j]};break;case 15:const re=V.trimColon(W[j]);this.$={stmt:"relation",state1:W[j-3],state2:W[j-1],description:re};break;case 19:this.$={stmt:"state",id:W[j-3],type:"default",description:"",doc:W[j-1]};break;case 20:var ae=W[j],J=W[j-2].trim();if(W[j].match(":")){var K=W[j].split(":");ae=K[0],J=[J,K[1]]}this.$={stmt:"state",id:ae,type:"default",description:J};break;case 21:this.$={stmt:"state",id:W[j-3],type:"default",description:W[j-5],doc:W[j-1]};break;case 22:this.$={stmt:"state",id:W[j],type:"fork"};break;case 23:this.$={stmt:"state",id:W[j],type:"join"};break;case 24:this.$={stmt:"state",id:W[j],type:"choice"};break;case 25:this.$={stmt:"state",id:V.getDividerId(),type:"divider"};break;case 26:this.$={stmt:"state",id:W[j-1].trim(),note:{position:W[j-2].trim(),text:W[j].trim()}};break;case 29:this.$=W[j].trim(),V.setAccTitle(this.$);break;case 30:case 31:this.$=W[j].trim(),V.setAccDescription(this.$);break;case 32:this.$={stmt:"click",id:W[j-3],url:W[j-2],tooltip:W[j-1]};break;case 33:this.$={stmt:"click",id:W[j-3],url:W[j-1],tooltip:""};break;case 34:case 35:this.$={stmt:"classDef",id:W[j-1].trim(),classes:W[j].trim()};break;case 36:this.$={stmt:"style",id:W[j-1].trim(),styleClass:W[j].trim()};break;case 37:this.$={stmt:"applyClass",id:W[j-1].trim(),styleClass:W[j].trim()};break;case 38:V.setDirection("TB"),this.$={stmt:"dir",value:"TB"};break;case 39:V.setDirection("BT"),this.$={stmt:"dir",value:"BT"};break;case 40:V.setDirection("RL"),this.$={stmt:"dir",value:"RL"};break;case 41:V.setDirection("LR"),this.$={stmt:"dir",value:"LR"};break;case 44:case 45:this.$={stmt:"state",id:W[j].trim(),type:"default",description:""};break;case 46:this.$={stmt:"state",id:W[j-2].trim(),classes:[W[j].trim()],type:"default",description:""};break;case 47:this.$={stmt:"state",id:W[j-2].trim(),classes:[W[j].trim()],type:"default",description:""};break}},"anonymous"),table:[{3:1,4:e,5:r,6:n},{1:[3]},{3:5,4:e,5:r,6:n},{3:6,4:e,5:r,6:n},t([1,4,5,16,17,19,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],i,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:a,5:s,8:8,9:10,10:12,11:13,12:14,13:15,16:o,17:l,19:u,22:h,24:d,25:f,26:p,27:g,28:m,29:y,32:25,33:v,35:x,37:b,38:w,41:C,45:_,48:k,51:S,52:L,53:$,54:I,57:z},t(F,[2,5]),{9:39,10:12,11:13,12:14,13:15,16:o,17:l,19:u,22:h,24:d,25:f,26:p,27:g,28:m,29:y,32:25,33:v,35:x,37:b,38:w,41:C,45:_,48:k,51:S,52:L,53:$,54:I,57:z},t(F,[2,7]),t(F,[2,8]),t(F,[2,9]),t(F,[2,10]),t(F,[2,11]),t(F,[2,12],{14:[1,40],15:[1,41]}),t(F,[2,16]),{18:[1,42]},t(F,[2,18],{20:[1,43]}),{23:[1,44]},t(F,[2,22]),t(F,[2,23]),t(F,[2,24]),t(F,[2,25]),{30:45,31:[1,46],59:[1,47],60:[1,48]},t(F,[2,28]),{34:[1,49]},{36:[1,50]},t(F,[2,31]),{13:51,24:d,57:z},{42:[1,52],44:[1,53]},{46:[1,54]},{49:[1,55]},t(A,[2,44],{58:[1,56]}),t(A,[2,45],{58:[1,57]}),t(F,[2,38]),t(F,[2,39]),t(F,[2,40]),t(F,[2,41]),t(F,[2,6]),t(F,[2,13]),{13:58,24:d,57:z},t(F,[2,17]),t(R,i,{7:59}),{24:[1,60]},{24:[1,61]},{23:[1,62]},{24:[2,48]},{24:[2,49]},t(F,[2,29]),t(F,[2,30]),{39:[1,63],40:[1,64]},{43:[1,65]},{43:[1,66]},{47:[1,67]},{50:[1,68]},{24:[1,69]},{24:[1,70]},t(F,[2,14],{14:[1,71]}),{4:a,5:s,8:8,9:10,10:12,11:13,12:14,13:15,16:o,17:l,19:u,21:[1,72],22:h,24:d,25:f,26:p,27:g,28:m,29:y,32:25,33:v,35:x,37:b,38:w,41:C,45:_,48:k,51:S,52:L,53:$,54:I,57:z},t(F,[2,20],{20:[1,73]}),{31:[1,74]},{24:[1,75]},{39:[1,76]},{39:[1,77]},t(F,[2,34]),t(F,[2,35]),t(F,[2,36]),t(F,[2,37]),t(A,[2,46]),t(A,[2,47]),t(F,[2,15]),t(F,[2,19]),t(R,i,{7:78}),t(F,[2,26]),t(F,[2,27]),{5:[1,79]},{5:[1,80]},{4:a,5:s,8:8,9:10,10:12,11:13,12:14,13:15,16:o,17:l,19:u,21:[1,81],22:h,24:d,25:f,26:p,27:g,28:m,29:y,32:25,33:v,35:x,37:b,38:w,41:C,45:_,48:k,51:S,52:L,53:$,54:I,57:z},t(F,[2,32]),t(F,[2,33]),t(F,[2,21])],defaultActions:{5:[2,1],6:[2,2],47:[2,48],48:[2,49]},parseError:T(function(B,P){if(P.recoverable)this.trace(B);else{var G=new Error(B);throw G.hash=P,G}},"parseError"),parse:T(function(B){var P=this,G=[0],V=[],H=[null],W=[],ie=this.table,j="",ae=0,J=0,K=2,Q=1,re=W.slice.call(arguments,1),le=Object.create(this.lexer),fe={yy:{}};for(var Ae in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Ae)&&(fe.yy[Ae]=this.yy[Ae]);le.setInput(B,fe.yy),fe.yy.lexer=le,fe.yy.parser=this,typeof le.yylloc>"u"&&(le.yylloc={});var Se=le.yylloc;W.push(Se);var Ne=le.options&&le.options.ranges;typeof fe.yy.parseError=="function"?this.parseError=fe.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ge(_e){G.length=G.length-2*_e,H.length=H.length-_e,W.length=W.length-_e}T(ge,"popStack");function ve(){var _e;return _e=V.pop()||le.lex()||Q,typeof _e!="number"&&(_e instanceof Array&&(V=_e,_e=V.pop()),_e=P.symbols_[_e]||_e),_e}T(ve,"lex");for(var ze,xe,Ke,Ce,Ve={},Qe,nt,tt,Ze;;){if(xe=G[G.length-1],this.defaultActions[xe]?Ke=this.defaultActions[xe]:((ze===null||typeof ze>"u")&&(ze=ve()),Ke=ie[xe]&&ie[xe][ze]),typeof Ke>"u"||!Ke.length||!Ke[0]){var ke="";Ze=[];for(Qe in ie[xe])this.terminals_[Qe]&&Qe>K&&Ze.push("'"+this.terminals_[Qe]+"'");le.showPosition?ke="Parse error on line "+(ae+1)+`: +`+le.showPosition()+` +Expecting `+Ze.join(", ")+", got '"+(this.terminals_[ze]||ze)+"'":ke="Parse error on line "+(ae+1)+": Unexpected "+(ze==Q?"end of input":"'"+(this.terminals_[ze]||ze)+"'"),this.parseError(ke,{text:le.match,token:this.terminals_[ze]||ze,line:le.yylineno,loc:Se,expected:Ze})}if(Ke[0]instanceof Array&&Ke.length>1)throw new Error("Parse Error: multiple actions possible at state: "+xe+", token: "+ze);switch(Ke[0]){case 1:G.push(ze),H.push(le.yytext),W.push(le.yylloc),G.push(Ke[1]),ze=null,J=le.yyleng,j=le.yytext,ae=le.yylineno,Se=le.yylloc;break;case 2:if(nt=this.productions_[Ke[1]][1],Ve.$=H[H.length-nt],Ve._$={first_line:W[W.length-(nt||1)].first_line,last_line:W[W.length-1].last_line,first_column:W[W.length-(nt||1)].first_column,last_column:W[W.length-1].last_column},Ne&&(Ve._$.range=[W[W.length-(nt||1)].range[0],W[W.length-1].range[1]]),Ce=this.performAction.apply(Ve,[j,J,ae,fe.yy,Ke[1],H,W].concat(re)),typeof Ce<"u")return Ce;nt&&(G=G.slice(0,-1*nt*2),H=H.slice(0,-1*nt),W=W.slice(0,-1*nt)),G.push(this.productions_[Ke[1]][0]),H.push(Ve.$),W.push(Ve._$),tt=ie[G[G.length-2]][G[G.length-1]],G.push(tt);break;case 3:return!0}}return!0},"parse")},M=(function(){var O={EOF:1,parseError:T(function(P,G){if(this.yy.parser)this.yy.parser.parseError(P,G);else throw new Error(P)},"parseError"),setInput:T(function(B,P){return this.yy=P||this.yy||{},this._input=B,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:T(function(){var B=this._input[0];this.yytext+=B,this.yyleng++,this.offset++,this.match+=B,this.matched+=B;var P=B.match(/(?:\r\n?|\n).*/g);return P?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),B},"input"),unput:T(function(B){var P=B.length,G=B.split(/(?:\r\n?|\n)/g);this._input=B+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-P),this.offset-=P;var V=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),G.length-1&&(this.yylineno-=G.length-1);var H=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:G?(G.length===V.length?this.yylloc.first_column:0)+V[V.length-G.length].length-G[0].length:this.yylloc.first_column-P},this.options.ranges&&(this.yylloc.range=[H[0],H[0]+this.yyleng-P]),this.yyleng=this.yytext.length,this},"unput"),more:T(function(){return this._more=!0,this},"more"),reject:T(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). +`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:T(function(B){this.unput(this.match.slice(B))},"less"),pastInput:T(function(){var B=this.matched.substr(0,this.matched.length-this.match.length);return(B.length>20?"...":"")+B.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:T(function(){var B=this.match;return B.length<20&&(B+=this._input.substr(0,20-B.length)),(B.substr(0,20)+(B.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:T(function(){var B=this.pastInput(),P=new Array(B.length+1).join("-");return B+this.upcomingInput()+` +`+P+"^"},"showPosition"),test_match:T(function(B,P){var G,V,H;if(this.options.backtrack_lexer&&(H={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&&(H.yylloc.range=this.yylloc.range.slice(0))),V=B[0].match(/(?:\r\n?|\n).*/g),V&&(this.yylineno+=V.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:V?V[V.length-1].length-V[V.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+B[0].length},this.yytext+=B[0],this.match+=B[0],this.matches=B,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(B[0].length),this.matched+=B[0],G=this.performAction.call(this,this.yy,this,P,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),G)return G;if(this._backtrack){for(var W in H)this[W]=H[W];return!1}return!1},"test_match"),next:T(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var B,P,G,V;this._more||(this.yytext="",this.match="");for(var H=this._currentRules(),W=0;WP[0].length)){if(P=G,V=W,this.options.backtrack_lexer){if(B=this.test_match(G,H[W]),B!==!1)return B;if(this._backtrack){P=!1;continue}else return!1}else if(!this.options.flex)break}return P?(B=this.test_match(P,H[V]),B!==!1?B:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:T(function(){var P=this.next();return P||this.lex()},"lex"),begin:T(function(P){this.conditionStack.push(P)},"begin"),popState:T(function(){var P=this.conditionStack.length-1;return P>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:T(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:T(function(P){return P=this.conditionStack.length-1-Math.abs(P||0),P>=0?this.conditionStack[P]:"INITIAL"},"topState"),pushState:T(function(P){this.begin(P)},"pushState"),stateStackSize:T(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:T(function(P,G,V,H){function W(){const ie=G.yytext.indexOf("%%");if(ie===0)return!1;if(ie>0){const j=G.yytext.slice(0,ie),ae=G.yytext.slice(ie);ae&&P.lexer.unput(ae),G.yytext=j}return!0}switch(T(W,"processId"),V){case 0:return 38;case 1:return 40;case 2:return 39;case 3:return 44;case 4:return 51;case 5:return 52;case 6:return 53;case 7:return 54;case 8:return 5;case 9:break;case 10:break;case 11:break;case 12:break;case 13:return this.pushState("SCALE"),17;case 14:return 18;case 15:this.popState();break;case 16:return this.begin("acc_title"),33;case 17:return this.popState(),"acc_title_value";case 18:return this.begin("acc_descr"),35;case 19:return this.popState(),"acc_descr_value";case 20:this.begin("acc_descr_multiline");break;case 21:this.popState();break;case 22:return"acc_descr_multiline_value";case 23:return this.pushState("CLASSDEF"),41;case 24:return this.popState(),this.pushState("CLASSDEFID"),"DEFAULT_CLASSDEF_ID";case 25:return this.popState(),this.pushState("CLASSDEFID"),42;case 26:return this.popState(),43;case 27:return this.pushState("CLASS"),48;case 28:return this.popState(),this.pushState("CLASS_STYLE"),49;case 29:return this.popState(),50;case 30:return this.pushState("STYLE"),45;case 31:return this.popState(),this.pushState("STYLEDEF_STYLES"),46;case 32:return this.popState(),47;case 33:return this.pushState("SCALE"),17;case 34:return 18;case 35:this.popState();break;case 36:this.pushState("STATE");break;case 37:return this.popState(),G.yytext=G.yytext.slice(0,-8).trim(),25;case 38:return this.popState(),G.yytext=G.yytext.slice(0,-8).trim(),26;case 39:return this.popState(),G.yytext=G.yytext.slice(0,-10).trim(),27;case 40:return this.popState(),G.yytext=G.yytext.slice(0,-8).trim(),25;case 41:return this.popState(),G.yytext=G.yytext.slice(0,-8).trim(),26;case 42:return this.popState(),G.yytext=G.yytext.slice(0,-10).trim(),27;case 43:return 51;case 44:return 52;case 45:return 53;case 46:return 54;case 47:this.pushState("STATE_STRING");break;case 48:return this.pushState("STATE_ID"),"AS";case 49:return W()?(this.popState(),"ID"):void 0;case 50:this.popState();break;case 51:return"STATE_DESCR";case 52:return 19;case 53:this.popState();break;case 54:return this.popState(),this.pushState("struct"),20;case 55:return this.popState(),21;case 56:break;case 57:return this.begin("NOTE"),29;case 58:return this.popState(),this.pushState("NOTE_ID"),59;case 59:return this.popState(),this.pushState("NOTE_ID"),60;case 60:this.popState(),this.pushState("FLOATING_NOTE");break;case 61:return this.popState(),this.pushState("FLOATING_NOTE_ID"),"AS";case 62:break;case 63:return"NOTE_TEXT";case 64:return W()?(this.popState(),"ID"):void 0;case 65:return W()?(this.popState(),this.pushState("NOTE_TEXT"),24):void 0;case 66:return this.popState(),G.yytext=G.yytext.substr(2).trim(),31;case 67:return this.popState(),G.yytext=G.yytext.slice(0,-8).trim(),31;case 68:return 6;case 69:return 6;case 70:return 16;case 71:return 57;case 72:return W()?24:void 0;case 73:return G.yytext=G.yytext.trim(),14;case 74:return 15;case 75:return 28;case 76:return 58;case 77:return 5;case 78:return"INVALID"}},"anonymous"),rules:[/^(?:click\b)/i,/^(?:href\b)/i,/^(?:"[^"]*")/i,/^(?:default\b)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:[\n]+)/i,/^(?:[\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,/^(?:.*<>)/i,/^(?:.*<>)/i,/^(?:.*<>)/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,/^(?:\})/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]*?\n\s*end note\b)/i,/^(?:stateDiagram\s+)/i,/^(?:stateDiagram-v2\s+)/i,/^(?:hide empty description\b)/i,/^(?:\[\*\])/i,/^(?:[^:\n\s\-\{]+)/i,/^(?:\s*:(?:[^:\n;]|:[^:\n;])+)/i,/^(?:-->)/i,/^(?:--)/i,/^(?::::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{LINE:{rules:[10,11,12],inclusive:!1},struct:{rules:[10,11,12,23,27,30,36,43,44,45,46,55,56,57,71,72,73,74,75,76],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:[32],inclusive:!1},STYLE_IDS:{rules:[],inclusive:!1},STYLE:{rules:[31],inclusive:!1},CLASS_STYLE:{rules:[29],inclusive:!1},CLASS:{rules:[28],inclusive:!1},CLASSDEFID:{rules:[26],inclusive:!1},CLASSDEF:{rules:[24,25],inclusive:!1},acc_descr_multiline:{rules:[21,22],inclusive:!1},acc_descr:{rules:[19],inclusive:!1},acc_title:{rules:[17],inclusive:!1},SCALE:{rules:[14,15,34,35],inclusive:!1},ALIAS:{rules:[],inclusive:!1},STATE_ID:{rules:[49],inclusive:!1},STATE_STRING:{rules:[50,51],inclusive:!1},FORK_STATE:{rules:[],inclusive:!1},STATE:{rules:[10,11,12,37,38,39,40,41,42,47,48,52,53,54],inclusive:!1},ID:{rules:[10,11,12],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,11,12,13,16,18,20,23,27,30,33,36,54,57,68,69,70,71,72,73,74,76,77,78],inclusive:!0}}};return O})();N.lexer=M;function D(){this.yy={}}return T(D,"Parser"),D.prototype=N,N.Parser=D,new D})();tG.parser=tG;var DTe=tG,vyt="TB",MTe="TB",NTe="dir",$1="state",O1="root",rG="relation",byt="classDef",xyt="style",Tyt="applyClass",r4="default",$Te="divider",OTe="fill:none",PTe="fill: #333",BTe="c",FTe="markdown",zTe="normal",nG="rect",iG="rectWithTitle",wyt="stateStart",Cyt="stateEnd",GTe="divider",qTe="roundedWithTitle",kyt="note",Eyt="noteGroup",n4="statediagram",Syt="state",_yt=`${n4}-${Syt}`,VTe="transition",Ayt="note",Ryt="note-edge",Lyt=`${VTe} ${Ryt}`,Iyt=`${n4}-${Ayt}`,Dyt="cluster",Myt=`${n4}-${Dyt}`,Nyt="cluster-alt",$yt=`${n4}-${Nyt}`,WTe="parent",UTe="note",Oyt="state",aG="----",Pyt=`${aG}${UTe}`,HTe=`${aG}${WTe}`,YTe=T((t,e=MTe)=>{if(!t.doc)return e;let r=e;for(const n of t.doc)n.stmt==="dir"&&(r=n.value);return r},"getDir"),Byt=T(function(t,e){return e.db.getClasses()},"getClasses"),Fyt=T(async function(t,e,r,n){se.info("REF0:"),se.info("Drawing state diagram (v2)",e);const{securityLevel:i,state:a,layout:s}=Pe();n.db.extract(n.db.getRootDocV2());const o=n.db.getData(),l=_m(e,i);o.type=n.type,o.layoutAlgorithm=s,o.nodeSpacing=(a==null?void 0:a.nodeSpacing)||50,o.rankSpacing=(a==null?void 0:a.rankSpacing)||50,Pe().look==="neo"?o.markers=["barbNeo"]:o.markers=["barb"],o.diagramId=e,await fg(o,l);const h=8;try{(typeof n.db.getLinks=="function"?n.db.getLinks():new Map).forEach((f,p)=>{var w;const g=typeof p=="string"?p:typeof(p==null?void 0:p.id)=="string"?p.id:"";if(!g){se.warn("⚠️ Invalid or missing stateId from key:",JSON.stringify(p));return}const m=(w=l.node())==null?void 0:w.querySelectorAll("g");let y;if(m==null||m.forEach(C=>{var k;((k=C.textContent)==null?void 0:k.trim())===g&&(y=C)}),!y){se.warn("⚠️ Could not find node matching text:",g);return}const v=y.parentNode;if(!v){se.warn("⚠️ Node has no parent, cannot wrap:",g);return}const x=document.createElementNS("http://www.w3.org/2000/svg","a"),b=f.url.replace(/^"+|"+$/g,"");if(x.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",b),x.setAttribute("target","_blank"),f.tooltip){const C=f.tooltip.replace(/^"+|"+$/g,"");x.setAttribute("title",C)}v.replaceChild(x,y),x.appendChild(y),se.info("🔗 Wrapped node in tag for:",g,f.url)})}catch(d){se.error("❌ Error injecting clickable links:",d)}Pr.insertTitle(l,"statediagramTitleText",(a==null?void 0:a.titleTopMargin)??25,n.db.getDiagramTitle()),op(l,h,n4,(a==null?void 0:a.useMaxWidth)??!0)},"draw"),zyt={getClasses:Byt,draw:Fyt,getDir:YTe},_A=new Map,$d=0;function AA(t="",e=0,r="",n=aG){const i=r!==null&&r.length>0?`${n}${r}`:"";return`${Oyt}-${t}${i}-${e}`}T(AA,"stateDomId");var Gyt=T((t,e,r,n,i,a,s,o)=>{se.trace("items",e),e.forEach(l=>{switch(l.stmt){case $1:a4(t,l,r,n,i,a,s,o);break;case r4:a4(t,l,r,n,i,a,s,o);break;case rG:{a4(t,l.state1,r,n,i,a,s,o),a4(t,l.state2,r,n,i,a,s,o);const u=s==="neo",h={id:"edge"+$d,start:l.state1.id,end:l.state2.id,arrowhead:"normal",arrowTypeEnd:u?"arrow_barb_neo":"arrow_barb",style:OTe,labelStyle:"",label:Dt.sanitizeText(l.description??"",Pe()),arrowheadStyle:PTe,labelpos:BTe,labelType:FTe,thickness:zTe,classes:VTe,look:s};i.push(h),$d++}break}})},"setupDoc"),XTe=T((t,e=MTe)=>{let r=e;if(t.doc)for(const n of t.doc)n.stmt==="dir"&&(r=n.value);return r},"getDir");function i4(t,e,r){if(!e.id||e.id===""||e.id==="")return;e.cssClasses&&(Array.isArray(e.cssCompiledStyles)||(e.cssCompiledStyles=[]),e.cssClasses.split(" ").forEach(i=>{const a=r.get(i);a&&(e.cssCompiledStyles=[...e.cssCompiledStyles??[],...a.styles])}));const n=t.find(i=>i.id===e.id);n?Object.assign(n,e):t.push(e)}T(i4,"insertOrUpdateNode");function jTe(t){var e;return((e=t==null?void 0:t.classes)==null?void 0:e.join(" "))??""}T(jTe,"getClassesFromDbInfo");function KTe(t){return(t==null?void 0:t.styles)??[]}T(KTe,"getStylesFromDbInfo");var a4=T((t,e,r,n,i,a,s,o)=>{var p,g,m;const l=e.id,u=r.get(l),h=jTe(u),d=KTe(u),f=Pe();if(se.info("dataFetcher parsedItem",e,u,d),l!=="root"){let y=nG;e.start===!0?y=wyt:e.start===!1&&(y=Cyt),e.type!==r4&&(y=e.type),_A.get(l)||_A.set(l,{id:l,shape:y,description:Dt.sanitizeText(l,f),cssClasses:`${h} ${_yt}`,cssStyles:d});const v=_A.get(l);e.description&&(Array.isArray(v.description)?(v.shape=iG,v.description.push(e.description)):(p=v.description)!=null&&p.length&&v.description.length>0?(v.shape=iG,v.description===l?v.description=[e.description]:v.description=[v.description,e.description]):(v.shape=nG,v.description=e.description),v.description=Dt.sanitizeTextOrArray(v.description,f)),((g=v.description)==null?void 0:g.length)===1&&v.shape===iG&&(v.type==="group"?v.shape=qTe:v.shape=nG),!v.type&&e.doc&&(se.info("Setting cluster for XCX",l,XTe(e)),v.type="group",v.isGroup=!0,v.dir=XTe(e),v.shape=e.type===$Te?GTe:qTe,v.cssClasses=`${v.cssClasses} ${Myt} ${a?$yt:""}`);const x={labelStyle:"",shape:v.shape,label:v.description,cssClasses:v.cssClasses,cssCompiledStyles:[],cssStyles:v.cssStyles,id:l,dir:v.dir,domId:AA(l,$d),type:v.type,isGroup:v.type==="group",padding:8,rx:10,ry:10,look:s,labelType:"markdown"};if(x.shape===GTe&&(x.label=""),t&&t.id!=="root"&&(se.trace("Setting node ",l," to be child of its parent ",t.id),x.parentId=t.id),x.centerLabel=!0,e.note){const b={labelStyle:"",shape:kyt,label:e.note.text,labelType:"markdown",cssClasses:Iyt,cssStyles:[],cssCompiledStyles:[],id:l+Pyt+"-"+$d,domId:AA(l,$d,UTe),type:v.type,isGroup:v.type==="group",padding:(m=f.flowchart)==null?void 0:m.padding,look:s,position:e.note.position},w=l+HTe,C={labelStyle:"",shape:Eyt,label:e.note.text,cssClasses:v.cssClasses,cssStyles:[],id:l+HTe,domId:AA(l,$d,WTe),type:"group",isGroup:!0,padding:16,look:s,position:e.note.position};$d++,C.id=w,b.parentId=w,i4(n,C,o),i4(n,b,o),i4(n,x,o);let _=l,k=b.id;e.note.position==="left of"&&(_=b.id,k=l),i.push({id:_+"-"+k,start:_,end:k,arrowhead:"none",arrowTypeEnd:"",style:OTe,labelStyle:"",classes:Lyt,arrowheadStyle:PTe,labelpos:BTe,labelType:FTe,thickness:zTe,look:s})}else i4(n,x,o)}e.doc&&(se.trace("Adding nodes children "),Gyt(e,e.doc,r,n,i,!a,s,o))},"dataFetcher"),qyt=T(()=>{_A.clear(),$d=0},"reset"),qs={START_NODE:"[*]",START_TYPE:"start",END_NODE:"[*]",END_TYPE:"end",COLOR_KEYWORD:"color",FILL_KEYWORD:"fill",BG_FILL:"bgFill",STYLECLASS_SEP:","},ZTe=T(()=>new Map,"newClassesList"),QTe=T(()=>({relations:[],states:new Map,documents:{}}),"newDoc"),RA=T(t=>JSON.parse(JSON.stringify(t)),"clone"),b0=(S0=class{constructor(e){this.version=e,this.nodes=[],this.edges=[],this.rootDoc=[],this.classes=ZTe(),this.documents={root:QTe()},this.currentDocument=this.documents.root,this.startEndCount=0,this.dividerCnt=0,this.links=new Map,this.getAccTitle=ii,this.setAccTitle=Yn,this.getAccDescription=si,this.setAccDescription=ai,this.setDiagramTitle=oi,this.getDiagramTitle=Xn,this.clear(),this.setRootDoc=this.setRootDoc.bind(this),this.getDividerId=this.getDividerId.bind(this),this.setDirection=this.setDirection.bind(this),this.trimColon=this.trimColon.bind(this)}extract(e){this.clear(!0);for(const i of Array.isArray(e)?e:e.doc)switch(i.stmt){case $1:this.addState(i.id.trim(),i.type,i.doc,i.description,i.note);break;case rG:this.addRelation(i.state1,i.state2,i.description);break;case byt:this.addStyleClass(i.id.trim(),i.classes);break;case xyt:this.handleStyleDef(i);break;case Tyt:this.setCssClass(i.id.trim(),i.styleClass);break;case"click":this.addLink(i.id,i.url,i.tooltip);break}const r=this.getStates(),n=Pe();qyt(),a4(void 0,this.getRootDocV2(),r,this.nodes,this.edges,!0,n.look,this.classes);for(const i of this.nodes)if(Array.isArray(i.label)){if(i.description=i.label.slice(1),i.isGroup&&i.description.length>0)throw new Error(`Group nodes can only have label. Remove the additional description for node [${i.id}]`);i.label=i.label[0]}}handleStyleDef(e){const r=e.id.trim().split(","),n=e.styleClass.split(",");for(const i of r){let a=this.getState(i);if(!a){const s=i.trim();this.addState(s),a=this.getState(s)}a&&(a.styles=n.map(s=>{var o;return(o=s.replace(/;/g,""))==null?void 0:o.trim()}))}}setRootDoc(e){se.info("Setting root doc",e),this.rootDoc=e,this.version===1?this.extract(e):this.extract(this.getRootDocV2())}docTranslator(e,r,n){if(r.stmt===rG){this.docTranslator(e,r.state1,!0),this.docTranslator(e,r.state2,!1);return}if(r.stmt===$1&&(r.id===qs.START_NODE?(r.id=e.id+(n?"_start":"_end"),r.start=n):r.id=r.id.trim()),r.stmt!==O1&&r.stmt!==$1||!r.doc)return;const i=[];let a=[];for(const s of r.doc)if(s.type===$Te){const o=RA(s);o.doc=RA(a),i.push(o),a=[]}else a.push(s);if(i.length>0&&a.length>0){const s={stmt:$1,id:OY(),type:"divider",doc:RA(a)};i.push(RA(s)),r.doc=i}r.doc.forEach(s=>this.docTranslator(r,s,!0))}getRootDocV2(){return this.docTranslator({id:O1,stmt:O1},{id:O1,stmt:O1,doc:this.rootDoc},!0),{id:O1,doc:this.rootDoc}}addState(e,r=r4,n=void 0,i=void 0,a=void 0,s=void 0,o=void 0,l=void 0){const u=e==null?void 0:e.trim();if(!this.currentDocument.states.has(u))se.info("Adding state ",u,i),this.currentDocument.states.set(u,{stmt:$1,id:u,descriptions:[],type:r,doc:n,note:a,classes:[],styles:[],textStyles:[]});else{const h=this.currentDocument.states.get(u);if(!h)throw new Error(`State not found: ${u}`);h.doc||(h.doc=n),h.type||(h.type=r)}if(i&&(se.info("Setting state description",u,i),(Array.isArray(i)?i:[i]).forEach(d=>this.addDescription(u,d.trim()))),a){const h=this.currentDocument.states.get(u);if(!h)throw new Error(`State not found: ${u}`);h.note=a,h.note.text=Dt.sanitizeText(h.note.text,Pe())}s&&(se.info("Setting state classes",u,s),(Array.isArray(s)?s:[s]).forEach(d=>this.setCssClass(u,d.trim()))),o&&(se.info("Setting state styles",u,o),(Array.isArray(o)?o:[o]).forEach(d=>this.setStyle(u,d.trim()))),l&&(se.info("Setting state styles",u,o),(Array.isArray(l)?l:[l]).forEach(d=>this.setTextStyle(u,d.trim())))}clear(e){this.nodes=[],this.edges=[],this.documents={root:QTe()},this.currentDocument=this.documents.root,this.startEndCount=0,this.classes=ZTe(),e||(this.links=new Map,Hn())}getState(e){return this.currentDocument.states.get(e)}getStates(){return this.currentDocument.states}logDocuments(){se.info("Documents = ",this.documents)}getRelations(){return this.currentDocument.relations}addLink(e,r,n){this.links.set(e,{url:r,tooltip:n}),se.warn("Adding link",e,r,n)}getLinks(){return this.links}startIdIfNeeded(e=""){return e===qs.START_NODE?(this.startEndCount++,`${qs.START_TYPE}${this.startEndCount}`):e}startTypeIfNeeded(e="",r=r4){return e===qs.START_NODE?qs.START_TYPE:r}endIdIfNeeded(e=""){return e===qs.END_NODE?(this.startEndCount++,`${qs.END_TYPE}${this.startEndCount}`):e}endTypeIfNeeded(e="",r=r4){return e===qs.END_NODE?qs.END_TYPE:r}addRelationObjs(e,r,n=""){const i=this.startIdIfNeeded(e.id.trim()),a=this.startTypeIfNeeded(e.id.trim(),e.type),s=this.startIdIfNeeded(r.id.trim()),o=this.startTypeIfNeeded(r.id.trim(),r.type);this.addState(i,a,e.doc,e.description,e.note,e.classes,e.styles,e.textStyles),this.addState(s,o,r.doc,r.description,r.note,r.classes,r.styles,r.textStyles),this.currentDocument.relations.push({id1:i,id2:s,relationTitle:Dt.sanitizeText(n,Pe())})}addRelation(e,r,n){if(typeof e=="object"&&typeof r=="object")this.addRelationObjs(e,r,n);else if(typeof e=="string"&&typeof r=="string"){const i=this.startIdIfNeeded(e.trim()),a=this.startTypeIfNeeded(e),s=this.endIdIfNeeded(r.trim()),o=this.endTypeIfNeeded(r);this.addState(i,a),this.addState(s,o),this.currentDocument.relations.push({id1:i,id2:s,relationTitle:n?Dt.sanitizeText(n,Pe()):void 0})}}addDescription(e,r){var a;const n=this.currentDocument.states.get(e),i=r.startsWith(":")?r.replace(":","").trim():r;(a=n==null?void 0:n.descriptions)==null||a.push(Dt.sanitizeText(i,Pe()))}cleanupLabel(e){return e.startsWith(":")?e.slice(2).trim():e.trim()}getDividerId(){return this.dividerCnt++,`divider-id-${this.dividerCnt}`}addStyleClass(e,r=""){this.classes.has(e)||this.classes.set(e,{id:e,styles:[],textStyles:[]});const n=this.classes.get(e);r&&n&&r.split(qs.STYLECLASS_SEP).forEach(i=>{const a=i.replace(/([^;]*);/,"$1").trim();if(RegExp(qs.COLOR_KEYWORD).exec(i)){const o=a.replace(qs.FILL_KEYWORD,qs.BG_FILL).replace(qs.COLOR_KEYWORD,qs.FILL_KEYWORD);n.textStyles.push(o)}n.styles.push(a)})}getClasses(){return this.classes}setCssClass(e,r){e.split(",").forEach(n=>{var a;let i=this.getState(n);if(!i){const s=n.trim();this.addState(s),i=this.getState(s)}(a=i==null?void 0:i.classes)==null||a.push(r)})}setStyle(e,r){var n,i;(i=(n=this.getState(e))==null?void 0:n.styles)==null||i.push(r)}setTextStyle(e,r){var n,i;(i=(n=this.getState(e))==null?void 0:n.textStyles)==null||i.push(r)}getDirectionStatement(){return this.rootDoc.find(e=>e.stmt===NTe)}getDirection(){var e;return((e=this.getDirectionStatement())==null?void 0:e.value)??vyt}setDirection(e){const r=this.getDirectionStatement();r?r.value=e:this.rootDoc.unshift({stmt:NTe,value:e})}trimColon(e){return e.startsWith(":")?e.slice(1).trim():e.trim()}getData(){const e=Pe();return{nodes:this.nodes,edges:this.edges,other:{},config:e,direction:YTe(this.getRootDocV2())}}getConfig(){return Pe().state}},T(S0,"StateDB"),S0.relationType={AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3},S0),Vyt=T(t=>` defs [id$="-barbEnd"] { fill: ${t.transitionColor}; stroke: ${t.transitionColor}; @@ -2456,12 +2457,12 @@ g.stateGroup line { ry: ${t.radius}px; filter: ${t.dropShadow?t.dropShadow.replace("url(#drop-shadow)",`url(${t.svgId}-drop-shadow)`):"none"} } -`,"getStyles"),$me=nut,iut=x(t=>t.append("circle").attr("class","start-state").attr("r",Pe().state.sizeUnit).attr("cx",Pe().state.padding+Pe().state.sizeUnit).attr("cy",Pe().state.padding+Pe().state.sizeUnit),"drawStartState"),aut=x(t=>t.append("line").style("stroke","grey").style("stroke-dasharray","3").attr("x1",Pe().state.textHeight).attr("class","divider").attr("x2",Pe().state.textHeight*2).attr("y1",0).attr("y2",0),"drawDivider"),sut=x((t,e)=>{const r=t.append("text").attr("x",2*Pe().state.padding).attr("y",Pe().state.textHeight+2*Pe().state.padding).attr("font-size",Pe().state.fontSize).attr("class","state-title").text(e.id),n=r.node().getBBox();return t.insert("rect",":first-child").attr("x",Pe().state.padding).attr("y",Pe().state.padding).attr("width",n.width+2*Pe().state.padding).attr("height",n.height+2*Pe().state.padding).attr("rx",Pe().state.radius),r},"drawSimpleState"),out=x((t,e)=>{const r=x(function(f,p,g){const m=f.append("tspan").attr("x",2*Pe().state.padding).text(p);g||m.attr("dy",Pe().state.textHeight)},"addTspan"),i=t.append("text").attr("x",2*Pe().state.padding).attr("y",Pe().state.textHeight+1.3*Pe().state.padding).attr("font-size",Pe().state.fontSize).attr("class","state-title").text(e.descriptions[0]).node().getBBox(),a=i.height,s=t.append("text").attr("x",Pe().state.padding).attr("y",a+Pe().state.padding*.4+Pe().state.dividerMargin+Pe().state.textHeight).attr("class","state-description");let o=!0,l=!0;e.descriptions.forEach(function(f){o||(r(s,f,l),l=!1),o=!1});const u=t.append("line").attr("x1",Pe().state.padding).attr("y1",Pe().state.padding+a+Pe().state.dividerMargin/2).attr("y2",Pe().state.padding+a+Pe().state.dividerMargin/2).attr("class","descr-divider"),h=s.node().getBBox(),d=Math.max(h.width,i.width);return u.attr("x2",d+3*Pe().state.padding),t.insert("rect",":first-child").attr("x",Pe().state.padding).attr("y",Pe().state.padding).attr("width",d+2*Pe().state.padding).attr("height",h.height+a+2*Pe().state.padding).attr("rx",Pe().state.radius),t},"drawDescrState"),lut=x((t,e,r)=>{const n=Pe().state.padding,i=2*Pe().state.padding,a=t.node().getBBox(),s=a.width,o=a.x,l=t.append("text").attr("x",0).attr("y",Pe().state.titleShift).attr("font-size",Pe().state.fontSize).attr("class","state-title").text(e.id),h=l.node().getBBox().width+i;let d=Math.max(h,s);d===s&&(d=d+i);let f;const p=t.node().getBBox();e.doc,f=o-n,h>s&&(f=(s-d)/2+n),Math.abs(o-p.x)s&&(f=o-(h-s)/2);const g=1-Pe().state.textHeight;return t.insert("rect",":first-child").attr("x",f).attr("y",g).attr("class",r?"alt-composit":"composit").attr("width",d).attr("height",p.height+Pe().state.textHeight+Pe().state.titleShift+1).attr("rx","0"),l.attr("x",f+n),h<=s&&l.attr("x",o+(d-i)/2-h/2+n),t.insert("rect",":first-child").attr("x",f).attr("y",Pe().state.titleShift-Pe().state.textHeight-Pe().state.padding).attr("width",d).attr("height",Pe().state.textHeight*3).attr("rx",Pe().state.radius),t.insert("rect",":first-child").attr("x",f).attr("y",Pe().state.titleShift-Pe().state.textHeight-Pe().state.padding).attr("width",d).attr("height",p.height+3+2*Pe().state.textHeight).attr("rx",Pe().state.radius),t},"addTitleAndBox"),cut=x(t=>(t.append("circle").attr("class","end-state-outer").attr("r",Pe().state.sizeUnit+Pe().state.miniPadding).attr("cx",Pe().state.padding+Pe().state.sizeUnit+Pe().state.miniPadding).attr("cy",Pe().state.padding+Pe().state.sizeUnit+Pe().state.miniPadding),t.append("circle").attr("class","end-state-inner").attr("r",Pe().state.sizeUnit).attr("cx",Pe().state.padding+Pe().state.sizeUnit+2).attr("cy",Pe().state.padding+Pe().state.sizeUnit+2)),"drawEndState"),uut=x((t,e)=>{let r=Pe().state.forkWidth,n=Pe().state.forkHeight;if(e.parentId){let i=r;r=n,n=i}return t.append("rect").style("stroke","black").style("fill","black").attr("width",r).attr("height",n).attr("x",Pe().state.padding).attr("y",Pe().state.padding)},"drawForkJoinState"),hut=x((t,e,r,n)=>{let i=0;const a=n.append("text");a.style("text-anchor","start"),a.attr("class","noteText");let s=t.replace(/\r\n/g,"
    ");s=s.replace(/\n/g,"
    ");const o=s.split(Lt.lineBreakRegex);let l=1.25*Pe().state.noteMargin;for(const u of o){const h=u.trim();if(h.length>0){const d=a.append("tspan");if(d.text(h),l===0){const f=d.node().getBBox();l+=f.height}i+=l,d.attr("x",e+Pe().state.noteMargin),d.attr("y",r+i+1.25*Pe().state.noteMargin)}}return{textWidth:a.node().getBBox().width,textHeight:i}},"_drawLongText"),dut=x((t,e)=>{e.attr("class","state-note");const r=e.append("rect").attr("x",0).attr("y",Pe().state.padding),n=e.append("g"),{textWidth:i,textHeight:a}=hut(t,0,0,n);return r.attr("height",a+2*Pe().state.noteMargin),r.attr("width",i+Pe().state.noteMargin*2),r},"drawNote"),Pme=x(function(t,e){const r=e.id,n={id:r,label:e.id,width:0,height:0},i=t.append("g").attr("id",r).attr("class","stateGroup");e.type==="start"&&iut(i),e.type==="end"&&cut(i),(e.type==="fork"||e.type==="join")&&uut(i,e),e.type==="note"&&dut(e.note.text,i),e.type==="divider"&&aut(i),e.type==="default"&&e.descriptions.length===0&&sut(i,e),e.type==="default"&&e.descriptions.length>0&&out(i,e);const a=i.node().getBBox();return n.width=a.width+2*Pe().state.padding,n.height=a.height+2*Pe().state.padding,n},"drawState"),Bme=0,fut=x(function(t,e,r){const n=x(function(l){switch(l){case n0.relationType.AGGREGATION:return"aggregation";case n0.relationType.EXTENSION:return"extension";case n0.relationType.COMPOSITION:return"composition";case n0.relationType.DEPENDENCY:return"dependency"}},"getRelationType");e.points=e.points.filter(l=>!Number.isNaN(l.y));const i=e.points,a=M2().x(function(l){return l.x}).y(function(l){return l.y}).curve(N2),s=t.append("path").attr("d",a(i)).attr("id","edge"+Bme).attr("class","transition");let o="";if(Pe().state.arrowMarkerAbsolute&&(o=Aw(!0)),s.attr("marker-end","url("+o+"#"+n(n0.relationType.DEPENDENCY)+"End)"),r.title!==void 0){const l=t.append("g").attr("class","stateLabel"),{x:u,y:h}=Lr.calcLabelPosition(e.points),d=Lt.getRows(r.title);let f=0;const p=[];let g=0,m=0;for(let T=0;T<=d.length;T++){const b=l.append("text").attr("text-anchor","middle").text(d[T]).attr("x",u).attr("y",h+f),w=b.node().getBBox();g=Math.max(g,w.width),m=Math.min(m,w.x),ae.info(w.x,u,h+f),f===0&&(f=b.node().getBBox().height,ae.info("Title height",f,h)),p.push(b)}let y=f*d.length;if(d.length>1){const T=(d.length-1)*f*.5;p.forEach((b,w)=>b.attr("y",h+w*f-T)),y=f*d.length}const v=l.node().getBBox();l.insert("rect",":first-child").attr("class","box").attr("x",u-g/2-Pe().state.padding/2).attr("y",h-y/2-Pe().state.padding/2-3.5).attr("width",g+Pe().state.padding).attr("height",y+Pe().state.padding),ae.info(v)}Bme++},"drawEdge"),to,I$={},put=x(function(){},"setConf"),gut=x(function(t){t.append("defs").append("marker").attr("id","dependencyEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"insertMarkers"),mut=x(function(t,e,r,n){to=Pe().state;const i=Pe().securityLevel;let a;i==="sandbox"&&(a=pt("#i"+e));const s=pt(i==="sandbox"?a.nodes()[0].contentDocument.body:"body"),o=i==="sandbox"?a.nodes()[0].contentDocument:document;ae.debug("Rendering diagram "+t);const l=s.select(`[id='${e}']`);gut(l);const u=n.db.getRootDoc(),h=l.append("g").attr("id",e+"-root");Fme(u,h,void 0,!1,s,o,n);const d=to.padding,f=l.node().getBBox(),p=f.width+d*2,g=f.height+d*2,m=p*1.75;wi(l,g,m,to.useMaxWidth),l.attr("viewBox",`${f.x-to.padding} ${f.y-to.padding} `+p+" "+g)},"draw"),yut=x(t=>t?t.length*to.fontSizeFactor:1,"getLabelWidth"),Fme=x((t,e,r,n,i,a,s)=>{const o=new Ts({compound:!0,multigraph:!0});let l,u=!0;for(l=0;l{const w=b.parentElement;let k=0,A=0;w&&(w.parentElement&&(k=w.parentElement.getBBox().width),A=parseInt(w.getAttribute("data-x-shift"),10),Number.isNaN(A)&&(A=0)),b.setAttribute("x1",0-A+8),b.setAttribute("x2",k-A-8)})):ae.debug("No Node "+v+": "+JSON.stringify(o.node(v)))});let m=g.getBBox();o.edges().forEach(function(v){v!==void 0&&o.edge(v)!==void 0&&(ae.debug("Edge "+v.v+" -> "+v.w+": "+JSON.stringify(o.edge(v))),fut(e,o.edge(v),o.edge(v).relation))}),m=g.getBBox();const y={id:r||"root",label:r||"root",width:0,height:0};return y.width=m.width+2*to.padding,y.height=m.height+2*to.padding,ae.debug("Doc rendered",y,o),y},"renderDoc"),vut={setConf:put,draw:mut},but={parser:gme,get db(){return new n0(1)},renderer:vut,styles:$me,init:x(t=>{t.state||(t.state={}),t.state.arrowMarkerAbsolute=t.arrowMarkerAbsolute},"init")};const xut=Object.freeze(Object.defineProperty({__proto__:null,diagram:but},Symbol.toStringTag,{value:"Module"}));var Tut={parser:gme,get db(){return new n0(2)},renderer:eut,styles:$me,init:x(t=>{t.state||(t.state={}),t.state.arrowMarkerAbsolute=t.arrowMarkerAbsolute},"init")};const wut=Object.freeze(Object.defineProperty({__proto__:null,diagram:Tut},Symbol.toStringTag,{value:"Module"}));var D$=(function(){var t=x(function(d,f,p,g){for(p=p||{},g=d.length;g--;p[d[g]]=f);return p},"o"),e=[6,8,10,11,12,14,16,17,18],r=[1,9],n=[1,10],i=[1,11],a=[1,12],s=[1,13],o=[1,14],l={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,start:3,journey:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,title:11,acc_title:12,acc_title_value:13,acc_descr:14,acc_descr_value:15,acc_descr_multiline_value:16,section:17,taskName:18,taskData:19,$accept:0,$end:1},terminals_:{2:"error",4:"journey",6:"EOF",8:"SPACE",10:"NEWLINE",11:"title",12:"acc_title",13:"acc_title_value",14:"acc_descr",15:"acc_descr_value",16:"acc_descr_multiline_value",17:"section",18:"taskName",19:"taskData"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,2]],performAction:x(function(f,p,g,m,y,v,T){var b=v.length-1;switch(y){case 1:return v[b-1];case 2:this.$=[];break;case 3:v[b-1].push(v[b]),this.$=v[b-1];break;case 4:case 5:this.$=v[b];break;case 6:case 7:this.$=[];break;case 8:m.setDiagramTitle(v[b].substr(6)),this.$=v[b].substr(6);break;case 9:this.$=v[b].trim(),m.setAccTitle(this.$);break;case 10:case 11:this.$=v[b].trim(),m.setAccDescription(this.$);break;case 12:m.addSection(v[b].substr(8)),this.$=v[b].substr(8);break;case 13:m.addTask(v[b-1],v[b]),this.$="task";break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:r,12:n,14:i,16:a,17:s,18:o},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:15,11:r,12:n,14:i,16:a,17:s,18:o},t(e,[2,5]),t(e,[2,6]),t(e,[2,8]),{13:[1,16]},{15:[1,17]},t(e,[2,11]),t(e,[2,12]),{19:[1,18]},t(e,[2,4]),t(e,[2,9]),t(e,[2,10]),t(e,[2,13])],defaultActions:{},parseError:x(function(f,p){if(p.recoverable)this.trace(f);else{var g=new Error(f);throw g.hash=p,g}},"parseError"),parse:x(function(f){var p=this,g=[0],m=[],y=[null],v=[],T=this.table,b="",w=0,k=0,A=2,C=1,_=v.slice.call(arguments,1),L=Object.create(this.lexer),O={yy:{}};for(var M in this.yy)Object.prototype.hasOwnProperty.call(this.yy,M)&&(O.yy[M]=this.yy[M]);L.setInput(f,O.yy),O.yy.lexer=L,O.yy.parser=this,typeof L.yylloc>"u"&&(L.yylloc={});var z=L.yylloc;v.push(z);var F=L.options&&L.options.ranges;typeof O.yy.parseError=="function"?this.parseError=O.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function S(ie){g.length=g.length-2*ie,y.length=y.length-ie,v.length=v.length-ie}x(S,"popStack");function R(){var ie;return ie=m.pop()||L.lex()||C,typeof ie!="number"&&(ie instanceof Array&&(m=ie,ie=m.pop()),ie=p.symbols_[ie]||ie),ie}x(R,"lex");for(var N,D,I,$,B={},P,G,V,Y;;){if(D=g[g.length-1],this.defaultActions[D]?I=this.defaultActions[D]:((N===null||typeof N>"u")&&(N=R()),I=T[D]&&T[D][N]),typeof I>"u"||!I.length||!I[0]){var W="";Y=[];for(P in T[D])this.terminals_[P]&&P>A&&Y.push("'"+this.terminals_[P]+"'");L.showPosition?W="Parse error on line "+(w+1)+`: +`,"getStyles"),JTe=Vyt,Wyt=T(t=>t.append("circle").attr("class","start-state").attr("r",Pe().state.sizeUnit).attr("cx",Pe().state.padding+Pe().state.sizeUnit).attr("cy",Pe().state.padding+Pe().state.sizeUnit),"drawStartState"),Uyt=T(t=>t.append("line").style("stroke","grey").style("stroke-dasharray","3").attr("x1",Pe().state.textHeight).attr("class","divider").attr("x2",Pe().state.textHeight*2).attr("y1",0).attr("y2",0),"drawDivider"),Hyt=T((t,e)=>{const r=t.append("text").attr("x",2*Pe().state.padding).attr("y",Pe().state.textHeight+2*Pe().state.padding).attr("font-size",Pe().state.fontSize).attr("class","state-title").text(e.id),n=r.node().getBBox();return t.insert("rect",":first-child").attr("x",Pe().state.padding).attr("y",Pe().state.padding).attr("width",n.width+2*Pe().state.padding).attr("height",n.height+2*Pe().state.padding).attr("rx",Pe().state.radius),r},"drawSimpleState"),Yyt=T((t,e)=>{const r=T(function(f,p,g){const m=f.append("tspan").attr("x",2*Pe().state.padding).text(p);g||m.attr("dy",Pe().state.textHeight)},"addTspan"),i=t.append("text").attr("x",2*Pe().state.padding).attr("y",Pe().state.textHeight+1.3*Pe().state.padding).attr("font-size",Pe().state.fontSize).attr("class","state-title").text(e.descriptions[0]).node().getBBox(),a=i.height,s=t.append("text").attr("x",Pe().state.padding).attr("y",a+Pe().state.padding*.4+Pe().state.dividerMargin+Pe().state.textHeight).attr("class","state-description");let o=!0,l=!0;e.descriptions.forEach(function(f){o||(r(s,f,l),l=!1),o=!1});const u=t.append("line").attr("x1",Pe().state.padding).attr("y1",Pe().state.padding+a+Pe().state.dividerMargin/2).attr("y2",Pe().state.padding+a+Pe().state.dividerMargin/2).attr("class","descr-divider"),h=s.node().getBBox(),d=Math.max(h.width,i.width);return u.attr("x2",d+3*Pe().state.padding),t.insert("rect",":first-child").attr("x",Pe().state.padding).attr("y",Pe().state.padding).attr("width",d+2*Pe().state.padding).attr("height",h.height+a+2*Pe().state.padding).attr("rx",Pe().state.radius),t},"drawDescrState"),Xyt=T((t,e,r)=>{const n=Pe().state.padding,i=2*Pe().state.padding,a=t.node().getBBox(),s=a.width,o=a.x,l=t.append("text").attr("x",0).attr("y",Pe().state.titleShift).attr("font-size",Pe().state.fontSize).attr("class","state-title").text(e.id),h=l.node().getBBox().width+i;let d=Math.max(h,s);d===s&&(d=d+i);let f;const p=t.node().getBBox();e.doc,f=o-n,h>s&&(f=(s-d)/2+n),Math.abs(o-p.x)s&&(f=o-(h-s)/2);const g=1-Pe().state.textHeight;return t.insert("rect",":first-child").attr("x",f).attr("y",g).attr("class",r?"alt-composit":"composit").attr("width",d).attr("height",p.height+Pe().state.textHeight+Pe().state.titleShift+1).attr("rx","0"),l.attr("x",f+n),h<=s&&l.attr("x",o+(d-i)/2-h/2+n),t.insert("rect",":first-child").attr("x",f).attr("y",Pe().state.titleShift-Pe().state.textHeight-Pe().state.padding).attr("width",d).attr("height",Pe().state.textHeight*3).attr("rx",Pe().state.radius),t.insert("rect",":first-child").attr("x",f).attr("y",Pe().state.titleShift-Pe().state.textHeight-Pe().state.padding).attr("width",d).attr("height",p.height+3+2*Pe().state.textHeight).attr("rx",Pe().state.radius),t},"addTitleAndBox"),jyt=T(t=>(t.append("circle").attr("class","end-state-outer").attr("r",Pe().state.sizeUnit+Pe().state.miniPadding).attr("cx",Pe().state.padding+Pe().state.sizeUnit+Pe().state.miniPadding).attr("cy",Pe().state.padding+Pe().state.sizeUnit+Pe().state.miniPadding),t.append("circle").attr("class","end-state-inner").attr("r",Pe().state.sizeUnit).attr("cx",Pe().state.padding+Pe().state.sizeUnit+2).attr("cy",Pe().state.padding+Pe().state.sizeUnit+2)),"drawEndState"),Kyt=T((t,e)=>{let r=Pe().state.forkWidth,n=Pe().state.forkHeight;if(e.parentId){let i=r;r=n,n=i}return t.append("rect").style("stroke","black").style("fill","black").attr("width",r).attr("height",n).attr("x",Pe().state.padding).attr("y",Pe().state.padding)},"drawForkJoinState"),Zyt=T((t,e,r,n)=>{let i=0;const a=n.append("text");a.style("text-anchor","start"),a.attr("class","noteText");let s=t.replace(/\r\n/g,"
    ");s=s.replace(/\n/g,"
    ");const o=s.split(Dt.lineBreakRegex);let l=1.25*Pe().state.noteMargin;for(const u of o){const h=u.trim();if(h.length>0){const d=a.append("tspan");if(d.text(h),l===0){const f=d.node().getBBox();l+=f.height}i+=l,d.attr("x",e+Pe().state.noteMargin),d.attr("y",r+i+1.25*Pe().state.noteMargin)}}return{textWidth:a.node().getBBox().width,textHeight:i}},"_drawLongText"),Qyt=T((t,e)=>{e.attr("class","state-note");const r=e.append("rect").attr("x",0).attr("y",Pe().state.padding),n=e.append("g"),{textWidth:i,textHeight:a}=Zyt(t,0,0,n);return r.attr("height",a+2*Pe().state.noteMargin),r.attr("width",i+Pe().state.noteMargin*2),r},"drawNote"),ewe=T(function(t,e){const r=e.id,n={id:r,label:e.id,width:0,height:0},i=t.append("g").attr("id",r).attr("class","stateGroup");e.type==="start"&&Wyt(i),e.type==="end"&&jyt(i),(e.type==="fork"||e.type==="join")&&Kyt(i,e),e.type==="note"&&Qyt(e.note.text,i),e.type==="divider"&&Uyt(i),e.type==="default"&&e.descriptions.length===0&&Hyt(i,e),e.type==="default"&&e.descriptions.length>0&&Yyt(i,e);const a=i.node().getBBox();return n.width=a.width+2*Pe().state.padding,n.height=a.height+2*Pe().state.padding,n},"drawState"),twe=0,Jyt=T(function(t,e,r){const n=T(function(l){switch(l){case b0.relationType.AGGREGATION:return"aggregation";case b0.relationType.EXTENSION:return"extension";case b0.relationType.COMPOSITION:return"composition";case b0.relationType.DEPENDENCY:return"dependency"}},"getRelationType");e.points=e.points.filter(l=>!Number.isNaN(l.y));const i=e.points,a=dx().x(function(l){return l.x}).y(function(l){return l.y}).curve(fx),s=t.append("path").attr("d",a(i)).attr("id","edge"+twe).attr("class","transition");let o="";if(Pe().state.arrowMarkerAbsolute&&(o=N4(!0)),s.attr("marker-end","url("+o+"#"+n(b0.relationType.DEPENDENCY)+"End)"),r.title!==void 0){const l=t.append("g").attr("class","stateLabel"),{x:u,y:h}=Pr.calcLabelPosition(e.points),d=Dt.getRows(r.title);let f=0;const p=[];let g=0,m=0;for(let x=0;x<=d.length;x++){const b=l.append("text").attr("text-anchor","middle").text(d[x]).attr("x",u).attr("y",h+f),w=b.node().getBBox();g=Math.max(g,w.width),m=Math.min(m,w.x),se.info(w.x,u,h+f),f===0&&(f=b.node().getBBox().height,se.info("Title height",f,h)),p.push(b)}let y=f*d.length;if(d.length>1){const x=(d.length-1)*f*.5;p.forEach((b,w)=>b.attr("y",h+w*f-x)),y=f*d.length}const v=l.node().getBBox();l.insert("rect",":first-child").attr("class","box").attr("x",u-g/2-Pe().state.padding/2).attr("y",h-y/2-Pe().state.padding/2-3.5).attr("width",g+Pe().state.padding).attr("height",y+Pe().state.padding),se.info(v)}twe++},"drawEdge"),Po,sG={},evt=T(function(){},"setConf"),tvt=T(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"),rvt=T(function(t,e,r,n){Po=Pe().state;const i=Pe().securityLevel;let a;i==="sandbox"&&(a=gt("#i"+e));const s=gt(i==="sandbox"?a.nodes()[0].contentDocument.body:"body"),o=i==="sandbox"?a.nodes()[0].contentDocument:document;se.debug("Rendering diagram "+t);const l=s.select(`[id='${e}']`);tvt(l);const u=n.db.getRootDoc(),h=l.append("g").attr("id",e+"-root");rwe(u,h,void 0,!1,s,o,n);const d=Po.padding,f=l.node().getBBox(),p=f.width+d*2,g=f.height+d*2,m=p*1.75;Wi(l,g,m,Po.useMaxWidth),l.attr("viewBox",`${f.x-Po.padding} ${f.y-Po.padding} `+p+" "+g)},"draw"),nvt=T(t=>t?t.length*Po.fontSizeFactor:1,"getLabelWidth"),rwe=T((t,e,r,n,i,a,s)=>{const o=new Js({compound:!0,multigraph:!0});let l,u=!0;for(l=0;l{const w=b.parentElement;let C=0,_=0;w&&(w.parentElement&&(C=w.parentElement.getBBox().width),_=parseInt(w.getAttribute("data-x-shift"),10),Number.isNaN(_)&&(_=0)),b.setAttribute("x1",0-_+8),b.setAttribute("x2",C-_-8)})):se.debug("No Node "+v+": "+JSON.stringify(o.node(v)))});let m=g.getBBox();o.edges().forEach(function(v){v!==void 0&&o.edge(v)!==void 0&&(se.debug("Edge "+v.v+" -> "+v.w+": "+JSON.stringify(o.edge(v))),Jyt(e,o.edge(v),o.edge(v).relation))}),m=g.getBBox();const y={id:r||"root",label:r||"root",width:0,height:0};return y.width=m.width+2*Po.padding,y.height=m.height+2*Po.padding,se.debug("Doc rendered",y,o),y},"renderDoc"),ivt={setConf:evt,draw:rvt},avt={parser:DTe,get db(){return new b0(1)},renderer:ivt,styles:JTe,init:T(t=>{t.state||(t.state={}),t.state.arrowMarkerAbsolute=t.arrowMarkerAbsolute},"init")};const svt=Object.freeze(Object.defineProperty({__proto__:null,diagram:avt},Symbol.toStringTag,{value:"Module"}));var ovt={parser:DTe,get db(){return new b0(2)},renderer:zyt,styles:JTe,init:T(t=>{t.state||(t.state={}),t.state.arrowMarkerAbsolute=t.arrowMarkerAbsolute},"init")};const lvt=Object.freeze(Object.defineProperty({__proto__:null,diagram:ovt},Symbol.toStringTag,{value:"Module"}));var oG=(function(){var t=T(function(d,f,p,g){for(p=p||{},g=d.length;g--;p[d[g]]=f);return p},"o"),e=[6,8,10,11,12,14,16,17,18],r=[1,9],n=[1,10],i=[1,11],a=[1,12],s=[1,13],o=[1,14],l={trace:T(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:T(function(f,p,g,m,y,v,x){var b=v.length-1;switch(y){case 1:return v[b-1];case 2:this.$=[];break;case 3:v[b-1].push(v[b]),this.$=v[b-1];break;case 4:case 5:this.$=v[b];break;case 6:case 7:this.$=[];break;case 8:m.setDiagramTitle(v[b].substr(6)),this.$=v[b].substr(6);break;case 9:this.$=v[b].trim(),m.setAccTitle(this.$);break;case 10:case 11:this.$=v[b].trim(),m.setAccDescription(this.$);break;case 12:m.addSection(v[b].substr(8)),this.$=v[b].substr(8);break;case 13:m.addTask(v[b-1],v[b]),this.$="task";break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:r,12:n,14:i,16:a,17:s,18:o},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:15,11:r,12:n,14:i,16:a,17:s,18:o},t(e,[2,5]),t(e,[2,6]),t(e,[2,8]),{13:[1,16]},{15:[1,17]},t(e,[2,11]),t(e,[2,12]),{19:[1,18]},t(e,[2,4]),t(e,[2,9]),t(e,[2,10]),t(e,[2,13])],defaultActions:{},parseError:T(function(f,p){if(p.recoverable)this.trace(f);else{var g=new Error(f);throw g.hash=p,g}},"parseError"),parse:T(function(f){var p=this,g=[0],m=[],y=[null],v=[],x=this.table,b="",w=0,C=0,_=2,k=1,S=v.slice.call(arguments,1),L=Object.create(this.lexer),$={yy:{}};for(var I in this.yy)Object.prototype.hasOwnProperty.call(this.yy,I)&&($.yy[I]=this.yy[I]);L.setInput(f,$.yy),$.yy.lexer=L,$.yy.parser=this,typeof L.yylloc>"u"&&(L.yylloc={});var z=L.yylloc;v.push(z);var F=L.options&&L.options.ranges;typeof $.yy.parseError=="function"?this.parseError=$.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function A(ie){g.length=g.length-2*ie,y.length=y.length-ie,v.length=v.length-ie}T(A,"popStack");function R(){var ie;return ie=m.pop()||L.lex()||k,typeof ie!="number"&&(ie instanceof Array&&(m=ie,ie=m.pop()),ie=p.symbols_[ie]||ie),ie}T(R,"lex");for(var N,M,D,O,B={},P,G,V,H;;){if(M=g[g.length-1],this.defaultActions[M]?D=this.defaultActions[M]:((N===null||typeof N>"u")&&(N=R()),D=x[M]&&x[M][N]),typeof D>"u"||!D.length||!D[0]){var W="";H=[];for(P in x[M])this.terminals_[P]&&P>_&&H.push("'"+this.terminals_[P]+"'");L.showPosition?W="Parse error on line "+(w+1)+`: `+L.showPosition()+` -Expecting `+Y.join(", ")+", got '"+(this.terminals_[N]||N)+"'":W="Parse error on line "+(w+1)+": Unexpected "+(N==C?"end of input":"'"+(this.terminals_[N]||N)+"'"),this.parseError(W,{text:L.match,token:this.terminals_[N]||N,line:L.yylineno,loc:z,expected:Y})}if(I[0]instanceof Array&&I.length>1)throw new Error("Parse Error: multiple actions possible at state: "+D+", token: "+N);switch(I[0]){case 1:g.push(N),y.push(L.yytext),v.push(L.yylloc),g.push(I[1]),N=null,k=L.yyleng,b=L.yytext,w=L.yylineno,z=L.yylloc;break;case 2:if(G=this.productions_[I[1]][1],B.$=y[y.length-G],B._$={first_line:v[v.length-(G||1)].first_line,last_line:v[v.length-1].last_line,first_column:v[v.length-(G||1)].first_column,last_column:v[v.length-1].last_column},F&&(B._$.range=[v[v.length-(G||1)].range[0],v[v.length-1].range[1]]),$=this.performAction.apply(B,[b,k,w,O.yy,I[1],y,v].concat(_)),typeof $<"u")return $;G&&(g=g.slice(0,-1*G*2),y=y.slice(0,-1*G),v=v.slice(0,-1*G)),g.push(this.productions_[I[1]][0]),y.push(B.$),v.push(B._$),V=T[g[g.length-2]][g[g.length-1]],g.push(V);break;case 3:return!0}}return!0},"parse")},u=(function(){var d={EOF:1,parseError:x(function(p,g){if(this.yy.parser)this.yy.parser.parseError(p,g);else throw new Error(p)},"parseError"),setInput:x(function(f,p){return this.yy=p||this.yy||{},this._input=f,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:x(function(){var f=this._input[0];this.yytext+=f,this.yyleng++,this.offset++,this.match+=f,this.matched+=f;var p=f.match(/(?:\r\n?|\n).*/g);return p?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),f},"input"),unput:x(function(f){var p=f.length,g=f.split(/(?:\r\n?|\n)/g);this._input=f+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-p),this.offset-=p;var m=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),g.length-1&&(this.yylineno-=g.length-1);var y=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:g?(g.length===m.length?this.yylloc.first_column:0)+m[m.length-g.length].length-g[0].length:this.yylloc.first_column-p},this.options.ranges&&(this.yylloc.range=[y[0],y[0]+this.yyleng-p]),this.yyleng=this.yytext.length,this},"unput"),more:x(function(){return this._more=!0,this},"more"),reject:x(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). -`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:x(function(f){this.unput(this.match.slice(f))},"less"),pastInput:x(function(){var f=this.matched.substr(0,this.matched.length-this.match.length);return(f.length>20?"...":"")+f.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:x(function(){var f=this.match;return f.length<20&&(f+=this._input.substr(0,20-f.length)),(f.substr(0,20)+(f.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:x(function(){var f=this.pastInput(),p=new Array(f.length+1).join("-");return f+this.upcomingInput()+` -`+p+"^"},"showPosition"),test_match:x(function(f,p){var g,m,y;if(this.options.backtrack_lexer&&(y={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(y.yylloc.range=this.yylloc.range.slice(0))),m=f[0].match(/(?:\r\n?|\n).*/g),m&&(this.yylineno+=m.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:m?m[m.length-1].length-m[m.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+f[0].length},this.yytext+=f[0],this.match+=f[0],this.matches=f,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(f[0].length),this.matched+=f[0],g=this.performAction.call(this,this.yy,this,p,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),g)return g;if(this._backtrack){for(var v in y)this[v]=y[v];return!1}return!1},"test_match"),next:x(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var f,p,g,m;this._more||(this.yytext="",this.match="");for(var y=this._currentRules(),v=0;vp[0].length)){if(p=g,m=v,this.options.backtrack_lexer){if(f=this.test_match(g,y[v]),f!==!1)return f;if(this._backtrack){p=!1;continue}else return!1}else if(!this.options.flex)break}return p?(f=this.test_match(p,y[m]),f!==!1?f:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var p=this.next();return p||this.lex()},"lex"),begin:x(function(p){this.conditionStack.push(p)},"begin"),popState:x(function(){var p=this.conditionStack.length-1;return p>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(p){return p=this.conditionStack.length-1-Math.abs(p||0),p>=0?this.conditionStack[p]:"INITIAL"},"topState"),pushState:x(function(p){this.begin(p)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:x(function(p,g,m,y){switch(m){case 0:break;case 1:break;case 2:return 10;case 3:break;case 4:break;case 5:return 4;case 6:return 11;case 7:return this.begin("acc_title"),12;case 8:return this.popState(),"acc_title_value";case 9:return this.begin("acc_descr"),14;case 10:return this.popState(),"acc_descr_value";case 11:this.begin("acc_descr_multiline");break;case 12:this.popState();break;case 13:return"acc_descr_multiline_value";case 14:return 17;case 15:return 18;case 16:return 19;case 17:return":";case 18:return 6;case 19:return"INVALID"}},"anonymous"),rules:[/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:journey\b)/i,/^(?:title\s[^#\n;]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:section\s[^#:\n;]+)/i,/^(?:[^#:\n;]+)/i,/^(?::[^#\n;]+)/i,/^(?::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[12,13],inclusive:!1},acc_descr:{rules:[10],inclusive:!1},acc_title:{rules:[8],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,9,11,14,15,16,17,18,19],inclusive:!0}}};return d})();l.lexer=u;function h(){this.yy={}}return x(h,"Parser"),h.prototype=l,l.Parser=h,new h})();D$.parser=D$;var Cut=D$,im="",M$=[],JT=[],ew=[],kut=x(function(){M$.length=0,JT.length=0,im="",ew.length=0,In()},"clear"),Eut=x(function(t){im=t,M$.push(t)},"addSection"),Sut=x(function(){return M$},"getSections"),Aut=x(function(){let t=zme();const e=100;let r=0;for(;!t&&r{r.people&&t.push(...r.people)}),[...new Set(t)].sort()},"updateActors"),Rut=x(function(t,e){const r=e.substr(1).split(":");let n=0,i=[];r.length===1?(n=Number(r[0]),i=[]):(n=Number(r[0]),i=r[1].split(","));const a=i.map(o=>o.trim()),s={section:im,type:im,people:a,task:t,score:n};ew.push(s)},"addTask"),Lut=x(function(t){const e={section:im,type:im,description:t,task:t,classes:[]};JT.push(e)},"addTaskOrg"),zme=x(function(){const t=x(function(r){return ew[r].processed},"compileTask");let e=!0;for(const[r,n]of ew.entries())t(r),e=e&&n.processed;return e},"compileTasks"),Iut=x(function(){return _ut()},"getActors"),Gme={getConfig:x(()=>Pe().journey,"getConfig"),clear:kut,setDiagramTitle:qn,getDiagramTitle:Mn,setAccTitle:Dn,getAccTitle:Fn,setAccDescription:zn,getAccDescription:Gn,addSection:Eut,getSections:Sut,getTasks:Aut,addTask:Rut,addTaskOrg:Lut,getActors:Iut},Dut=x(t=>`.label { +Expecting `+H.join(", ")+", got '"+(this.terminals_[N]||N)+"'":W="Parse error on line "+(w+1)+": Unexpected "+(N==k?"end of input":"'"+(this.terminals_[N]||N)+"'"),this.parseError(W,{text:L.match,token:this.terminals_[N]||N,line:L.yylineno,loc:z,expected:H})}if(D[0]instanceof Array&&D.length>1)throw new Error("Parse Error: multiple actions possible at state: "+M+", token: "+N);switch(D[0]){case 1:g.push(N),y.push(L.yytext),v.push(L.yylloc),g.push(D[1]),N=null,C=L.yyleng,b=L.yytext,w=L.yylineno,z=L.yylloc;break;case 2:if(G=this.productions_[D[1]][1],B.$=y[y.length-G],B._$={first_line:v[v.length-(G||1)].first_line,last_line:v[v.length-1].last_line,first_column:v[v.length-(G||1)].first_column,last_column:v[v.length-1].last_column},F&&(B._$.range=[v[v.length-(G||1)].range[0],v[v.length-1].range[1]]),O=this.performAction.apply(B,[b,C,w,$.yy,D[1],y,v].concat(S)),typeof O<"u")return O;G&&(g=g.slice(0,-1*G*2),y=y.slice(0,-1*G),v=v.slice(0,-1*G)),g.push(this.productions_[D[1]][0]),y.push(B.$),v.push(B._$),V=x[g[g.length-2]][g[g.length-1]],g.push(V);break;case 3:return!0}}return!0},"parse")},u=(function(){var d={EOF:1,parseError:T(function(p,g){if(this.yy.parser)this.yy.parser.parseError(p,g);else throw new Error(p)},"parseError"),setInput:T(function(f,p){return this.yy=p||this.yy||{},this._input=f,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:T(function(){var f=this._input[0];this.yytext+=f,this.yyleng++,this.offset++,this.match+=f,this.matched+=f;var p=f.match(/(?:\r\n?|\n).*/g);return p?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),f},"input"),unput:T(function(f){var p=f.length,g=f.split(/(?:\r\n?|\n)/g);this._input=f+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-p),this.offset-=p;var m=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),g.length-1&&(this.yylineno-=g.length-1);var y=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:g?(g.length===m.length?this.yylloc.first_column:0)+m[m.length-g.length].length-g[0].length:this.yylloc.first_column-p},this.options.ranges&&(this.yylloc.range=[y[0],y[0]+this.yyleng-p]),this.yyleng=this.yytext.length,this},"unput"),more:T(function(){return this._more=!0,this},"more"),reject:T(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). +`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:T(function(f){this.unput(this.match.slice(f))},"less"),pastInput:T(function(){var f=this.matched.substr(0,this.matched.length-this.match.length);return(f.length>20?"...":"")+f.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:T(function(){var f=this.match;return f.length<20&&(f+=this._input.substr(0,20-f.length)),(f.substr(0,20)+(f.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:T(function(){var f=this.pastInput(),p=new Array(f.length+1).join("-");return f+this.upcomingInput()+` +`+p+"^"},"showPosition"),test_match:T(function(f,p){var g,m,y;if(this.options.backtrack_lexer&&(y={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(y.yylloc.range=this.yylloc.range.slice(0))),m=f[0].match(/(?:\r\n?|\n).*/g),m&&(this.yylineno+=m.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:m?m[m.length-1].length-m[m.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+f[0].length},this.yytext+=f[0],this.match+=f[0],this.matches=f,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(f[0].length),this.matched+=f[0],g=this.performAction.call(this,this.yy,this,p,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),g)return g;if(this._backtrack){for(var v in y)this[v]=y[v];return!1}return!1},"test_match"),next:T(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var f,p,g,m;this._more||(this.yytext="",this.match="");for(var y=this._currentRules(),v=0;vp[0].length)){if(p=g,m=v,this.options.backtrack_lexer){if(f=this.test_match(g,y[v]),f!==!1)return f;if(this._backtrack){p=!1;continue}else return!1}else if(!this.options.flex)break}return p?(f=this.test_match(p,y[m]),f!==!1?f:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:T(function(){var p=this.next();return p||this.lex()},"lex"),begin:T(function(p){this.conditionStack.push(p)},"begin"),popState:T(function(){var p=this.conditionStack.length-1;return p>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:T(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:T(function(p){return p=this.conditionStack.length-1-Math.abs(p||0),p>=0?this.conditionStack[p]:"INITIAL"},"topState"),pushState:T(function(p){this.begin(p)},"pushState"),stateStackSize:T(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:T(function(p,g,m,y){switch(m){case 0:break;case 1:break;case 2:return 10;case 3:break;case 4:break;case 5:return 4;case 6:return 11;case 7:return this.begin("acc_title"),12;case 8:return this.popState(),"acc_title_value";case 9:return this.begin("acc_descr"),14;case 10:return this.popState(),"acc_descr_value";case 11:this.begin("acc_descr_multiline");break;case 12:this.popState();break;case 13:return"acc_descr_multiline_value";case 14:return 17;case 15:return 18;case 16:return 19;case 17:return":";case 18:return 6;case 19:return"INVALID"}},"anonymous"),rules:[/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:journey\b)/i,/^(?:title\s[^#\n;]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:section\s[^#:\n;]+)/i,/^(?:[^#:\n;]+)/i,/^(?::[^#\n;]+)/i,/^(?::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[12,13],inclusive:!1},acc_descr:{rules:[10],inclusive:!1},acc_title:{rules:[8],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,9,11,14,15,16,17,18,19],inclusive:!0}}};return d})();l.lexer=u;function h(){this.yy={}}return T(h,"Parser"),h.prototype=l,l.Parser=h,new h})();oG.parser=oG;var cvt=oG,P1="",lG=[],s4=[],o4=[],uvt=T(function(){lG.length=0,s4.length=0,P1="",o4.length=0,Hn()},"clear"),hvt=T(function(t){P1=t,lG.push(t)},"addSection"),dvt=T(function(){return lG},"getSections"),fvt=T(function(){let t=nwe();const e=100;let r=0;for(;!t&&r{r.people&&t.push(...r.people)}),[...new Set(t)].sort()},"updateActors"),gvt=T(function(t,e){const r=e.substr(1).split(":");let n=0,i=[];r.length===1?(n=Number(r[0]),i=[]):(n=Number(r[0]),i=r[1].split(","));const a=i.map(o=>o.trim()),s={section:P1,type:P1,people:a,task:t,score:n};o4.push(s)},"addTask"),mvt=T(function(t){const e={section:P1,type:P1,description:t,task:t,classes:[]};s4.push(e)},"addTaskOrg"),nwe=T(function(){const t=T(function(r){return o4[r].processed},"compileTask");let e=!0;for(const[r,n]of o4.entries())t(r),e=e&&n.processed;return e},"compileTasks"),yvt=T(function(){return pvt()},"getActors"),iwe={getConfig:T(()=>Pe().journey,"getConfig"),clear:uvt,setDiagramTitle:oi,getDiagramTitle:Xn,setAccTitle:Yn,getAccTitle:ii,setAccDescription:ai,getAccDescription:si,addSection:hvt,getSections:dvt,getTasks:fvt,addTask:gvt,addTaskOrg:mvt,getActors:yvt},vvt=T(t=>`.label { font-family: ${t.fontFamily}; color: ${t.textColor}; } @@ -2593,13 +2594,13 @@ Expecting `+Y.join(", ")+", got '"+(this.terminals_[N]||N)+"'":W="Parse error on .actor-5 { ${t.actor5?`fill: ${t.actor5}`:""}; } - ${px()} -`,"getStyles"),Mut=Dut,N$=x(function(t,e){return f3(t,e)},"drawRect"),Nut=x(function(t,e){const n=t.append("circle").attr("cx",e.cx).attr("cy",e.cy).attr("class","face").attr("r",15).attr("stroke-width",2).attr("overflow","visible"),i=t.append("g");i.append("circle").attr("cx",e.cx-15/3).attr("cy",e.cy-15/3).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),i.append("circle").attr("cx",e.cx+15/3).attr("cy",e.cy-15/3).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666");function a(l){const u=P0().startAngle(Math.PI/2).endAngle(3*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);l.append("path").attr("class","mouth").attr("d",u).attr("transform","translate("+e.cx+","+(e.cy+2)+")")}x(a,"smile");function s(l){const u=P0().startAngle(3*Math.PI/2).endAngle(5*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);l.append("path").attr("class","mouth").attr("d",u).attr("transform","translate("+e.cx+","+(e.cy+7)+")")}x(s,"sad");function o(l){l.append("line").attr("class","mouth").attr("stroke",2).attr("x1",e.cx-5).attr("y1",e.cy+7).attr("x2",e.cx+5).attr("y2",e.cy+7).attr("class","mouth").attr("stroke-width","1px").attr("stroke","#666")}return x(o,"ambivalent"),e.score>3?a(i):e.score<3?s(i):o(i),n},"drawFace"),qme=x(function(t,e){const r=t.append("circle");return r.attr("cx",e.cx),r.attr("cy",e.cy),r.attr("class","actor-"+e.pos),r.attr("fill",e.fill),r.attr("stroke",e.stroke),r.attr("r",e.r),r.class!==void 0&&r.attr("class",r.class),e.title!==void 0&&r.append("title").text(e.title),r},"drawCircle"),Vme=x(function(t,e){return ZVe(t,e)},"drawText"),Out=x(function(t,e){function r(i,a,s,o,l){return i+","+a+" "+(i+s)+","+a+" "+(i+s)+","+(a+o-l)+" "+(i+s-l*1.2)+","+(a+o)+" "+i+","+(a+o)}x(r,"genPoints");const n=t.append("polygon");n.attr("points",r(e.x,e.y,50,20,7)),n.attr("class","labelBox"),e.y=e.y+e.labelMargin,e.x=e.x+.5*e.labelMargin,Vme(t,e)},"drawLabel"),$ut=x(function(t,e,r){const n=t.append("g"),i=Ys();i.x=e.x,i.y=e.y,i.fill=e.fill,i.width=r.width*e.taskCount+r.diagramMarginX*(e.taskCount-1),i.height=r.height,i.class="journey-section section-type-"+e.num,i.rx=3,i.ry=3,N$(n,i),Wme(r)(e.text,n,i.x,i.y,i.width,i.height,{class:"journey-section section-type-"+e.num},r,e.colour)},"drawSection"),O$=-1,Put=x(function(t,e,r,n){const i=e.x+r.width/2,a=t.append("g");O$++,a.append("line").attr("id",n+"-task"+O$).attr("x1",i).attr("y1",e.y).attr("x2",i).attr("y2",450).attr("class","task-line").attr("stroke-width","1px").attr("stroke-dasharray","4 2").attr("stroke","#666"),Nut(a,{cx:i,cy:300+(5-e.score)*30,score:e.score});const o=Ys();o.x=e.x,o.y=e.y,o.fill=e.fill,o.width=r.width,o.height=r.height,o.class="task task-type-"+e.num,o.rx=3,o.ry=3,N$(a,o);let l=e.x+14;e.people.forEach(u=>{const h=e.actors[u].color,d={cx:l,cy:e.y,r:7,fill:h,stroke:"#000",title:u,pos:e.actors[u].position};qme(a,d),l+=10}),Wme(r)(e.task,a,o.x,o.y,o.width,o.height,{class:"task"},r,e.colour)},"drawTask"),But=x(function(t,e){bte(t,e)},"drawBackgroundRect"),Wme=(function(){function t(i,a,s,o,l,u,h,d){const f=a.append("text").attr("x",s+l/2).attr("y",o+u/2+5).style("font-color",d).style("text-anchor","middle").text(i);n(f,h)}x(t,"byText");function e(i,a,s,o,l,u,h,d,f){const{taskFontSize:p,taskFontFamily:g}=d,m=i.split(//gi);for(let y=0;y{const a=gu[i].color,s={cx:20,cy:n,r:7,fill:a,stroke:"#000",pos:gu[i].position};tw.drawCircle(t,s);let o=t.append("text").attr("visibility","hidden").text(i);const l=o.node().getBoundingClientRect().width;o.remove();let u=[];if(l<=r)u=[i];else{const h=i.split(" ");let d="";o=t.append("text").attr("visibility","hidden"),h.forEach(f=>{const p=d?`${d} ${f}`:f;if(o.text(p),o.node().getBoundingClientRect().width>r){if(d&&u.push(d),d=f,o.text(f),o.node().getBoundingClientRect().width>r){let m="";for(const y of f)m+=y,o.text(m+"-"),o.node().getBoundingClientRect().width>r&&(u.push(m.slice(0,-1)+"-"),m=y);d=m}}else d=p}),d&&u.push(d),o.remove()}u.forEach((h,d)=>{const f={x:40,y:n+7+d*20,fill:"#666",text:h,textMargin:e.boxTextMargin??5},g=tw.drawText(t,f).node().getBoundingClientRect().width;g>IS&&g>e.leftMargin-g&&(IS=g)}),n+=Math.max(20,u.length*20)})}x(Ume,"drawActorLegend");var el=Pe().journey,Nh=0,Gut=x(function(t,e,r,n){const i=Pe(),a=i.journey.titleColor,s=i.journey.titleFontSize,o=i.journey.titleFontFamily,l=i.securityLevel;let u;l==="sandbox"&&(u=pt("#i"+e));const h=pt(l==="sandbox"?u.nodes()[0].contentDocument.body:"body");Co.init();const d=h.select("#"+e);tw.initGraphics(d,e);const f=n.db.getTasks(),p=n.db.getDiagramTitle(),g=n.db.getActors();for(const w in gu)delete gu[w];let m=0;g.forEach(w=>{gu[w]={color:el.actorColours[m%el.actorColours.length],position:m},m++}),Ume(d),Nh=el.leftMargin+IS,Co.insert(0,0,Nh,Object.keys(gu).length*50),qut(d,f,0,e);const y=Co.getBounds();p&&d.append("text").text(p).attr("x",Nh).attr("font-size",s).attr("font-weight","bold").attr("y",25).attr("fill",a).attr("font-family",o);const v=y.stopy-y.starty+2*el.diagramMarginY,T=Nh+y.stopx+2*el.diagramMarginX;wi(d,v,T,el.useMaxWidth),d.append("line").attr("x1",Nh).attr("y1",el.height*4).attr("x2",T-Nh-4).attr("y2",el.height*4).attr("stroke-width",4).attr("stroke","black").attr("marker-end","url(#"+e+"-arrowhead)");const b=p?70:0;d.attr("viewBox",`${y.startx} -25 ${T} ${v+b}`),d.attr("preserveAspectRatio","xMinYMin meet"),d.attr("height",v+b+25)},"draw"),Co={data:{startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},verticalPos:0,sequenceItems:[],init:x(function(){this.sequenceItems=[],this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},this.verticalPos=0},"init"),updateVal:x(function(t,e,r,n){t[e]===void 0?t[e]=r:t[e]=n(r,t[e])},"updateVal"),updateBounds:x(function(t,e,r,n){const i=Pe().journey,a=this;let s=0;function o(l){return x(function(h){s++;const d=a.sequenceItems.length-s+1;a.updateVal(h,"starty",e-d*i.boxMargin,Math.min),a.updateVal(h,"stopy",n+d*i.boxMargin,Math.max),a.updateVal(Co.data,"startx",t-d*i.boxMargin,Math.min),a.updateVal(Co.data,"stopx",r+d*i.boxMargin,Math.max),l!=="activation"&&(a.updateVal(h,"startx",t-d*i.boxMargin,Math.min),a.updateVal(h,"stopx",r+d*i.boxMargin,Math.max),a.updateVal(Co.data,"starty",e-d*i.boxMargin,Math.min),a.updateVal(Co.data,"stopy",n+d*i.boxMargin,Math.max))},"updateItemBounds")}x(o,"updateFn"),this.sequenceItems.forEach(o())},"updateBounds"),insert:x(function(t,e,r,n){const i=Math.min(t,r),a=Math.max(t,r),s=Math.min(e,n),o=Math.max(e,n);this.updateVal(Co.data,"startx",i,Math.min),this.updateVal(Co.data,"starty",s,Math.min),this.updateVal(Co.data,"stopx",a,Math.max),this.updateVal(Co.data,"stopy",o,Math.max),this.updateBounds(i,s,a,o)},"insert"),bumpVerticalPos:x(function(t){this.verticalPos=this.verticalPos+t,this.data.stopy=this.verticalPos},"bumpVerticalPos"),getVerticalPos:x(function(){return this.verticalPos},"getVerticalPos"),getBounds:x(function(){return this.data},"getBounds")},$$=el.sectionFills,Hme=el.sectionColours,qut=x(function(t,e,r,n){const i=Pe().journey;let a="";const s=i.height*2+i.diagramMarginY,o=r+s;let l=0,u="#CCC",h="black",d=0;for(const[f,p]of e.entries()){if(a!==p.section){u=$$[l%$$.length],d=l%$$.length,h=Hme[l%Hme.length];let m=0;const y=p.section;for(let T=f;T(gu[y]&&(m[y]=gu[y]),m),{});p.x=f*i.taskMargin+f*i.width+Nh,p.y=o,p.width=i.diagramMarginX,p.height=i.diagramMarginY,p.colour=h,p.fill=u,p.num=d,p.actors=g,tw.drawTask(t,p,i,n),Co.insert(p.x,p.y,p.x+p.width+i.taskMargin,450)}},"drawTasks"),Yme={setConf:zut,draw:Gut},Vut={parser:Cut,db:Gme,renderer:Yme,styles:Mut,init:x(t=>{Yme.setConf(t.journey),Gme.clear()},"init")};const Wut=Object.freeze(Object.defineProperty({__proto__:null,diagram:Vut},Symbol.toStringTag,{value:"Module"}));var P$=(function(){var t=x(function(f,p,g,m){for(g=g||{},m=f.length;m--;g[f[m]]=p);return g},"o"),e=[6,11,13,14,15,17,19,20,23,24],r=[1,12],n=[1,13],i=[1,14],a=[1,15],s=[1,16],o=[1,19],l=[1,20],u={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,start:3,timeline_header:4,document:5,EOF:6,timeline:7,timeline_lr:8,timeline_td:9,line:10,SPACE:11,statement:12,NEWLINE:13,title:14,acc_title:15,acc_title_value:16,acc_descr:17,acc_descr_value:18,acc_descr_multiline_value:19,section:20,period_statement:21,event_statement:22,period:23,event:24,$accept:0,$end:1},terminals_:{2:"error",6:"EOF",7:"timeline",8:"timeline_lr",9:"timeline_td",11:"SPACE",13:"NEWLINE",14:"title",15:"acc_title",16:"acc_title_value",17:"acc_descr",18:"acc_descr_value",19:"acc_descr_multiline_value",20:"section",23:"period",24:"event"},productions_:[0,[3,3],[4,1],[4,1],[4,1],[5,0],[5,2],[10,2],[10,1],[10,1],[10,1],[12,1],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[21,1],[22,1]],performAction:x(function(p,g,m,y,v,T,b){var w=T.length-1;switch(v){case 1:return T[w-1];case 3:y.setDirection("LR");break;case 4:y.setDirection("TD");break;case 5:this.$=[];break;case 6:T[w-1].push(T[w]),this.$=T[w-1];break;case 7:case 8:this.$=T[w];break;case 9:case 10:this.$=[];break;case 11:y.getCommonDb().setDiagramTitle(T[w].substr(6)),this.$=T[w].substr(6);break;case 12:this.$=T[w].trim(),y.getCommonDb().setAccTitle(this.$);break;case 13:case 14:this.$=T[w].trim(),y.getCommonDb().setAccDescription(this.$);break;case 15:y.addSection(T[w].substr(8)),this.$=T[w].substr(8);break;case 18:y.addTask(T[w],0,""),this.$=T[w];break;case 19:y.addEvent(T[w].substr(2)),this.$=T[w];break}},"anonymous"),table:[{3:1,4:2,7:[1,3],8:[1,4],9:[1,5]},{1:[3]},t(e,[2,5],{5:6}),t(e,[2,2]),t(e,[2,3]),t(e,[2,4]),{6:[1,7],10:8,11:[1,9],12:10,13:[1,11],14:r,15:n,17:i,19:a,20:s,21:17,22:18,23:o,24:l},t(e,[2,10],{1:[2,1]}),t(e,[2,6]),{12:21,14:r,15:n,17:i,19:a,20:s,21:17,22:18,23:o,24:l},t(e,[2,8]),t(e,[2,9]),t(e,[2,11]),{16:[1,22]},{18:[1,23]},t(e,[2,14]),t(e,[2,15]),t(e,[2,16]),t(e,[2,17]),t(e,[2,18]),t(e,[2,19]),t(e,[2,7]),t(e,[2,12]),t(e,[2,13])],defaultActions:{},parseError:x(function(p,g){if(g.recoverable)this.trace(p);else{var m=new Error(p);throw m.hash=g,m}},"parseError"),parse:x(function(p){var g=this,m=[0],y=[],v=[null],T=[],b=this.table,w="",k=0,A=0,C=2,_=1,L=T.slice.call(arguments,1),O=Object.create(this.lexer),M={yy:{}};for(var z in this.yy)Object.prototype.hasOwnProperty.call(this.yy,z)&&(M.yy[z]=this.yy[z]);O.setInput(p,M.yy),M.yy.lexer=O,M.yy.parser=this,typeof O.yylloc>"u"&&(O.yylloc={});var F=O.yylloc;T.push(F);var S=O.options&&O.options.ranges;typeof M.yy.parseError=="function"?this.parseError=M.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function R(K){m.length=m.length-2*K,v.length=v.length-K,T.length=T.length-K}x(R,"popStack");function N(){var K;return K=y.pop()||O.lex()||_,typeof K!="number"&&(K instanceof Array&&(y=K,K=y.pop()),K=g.symbols_[K]||K),K}x(N,"lex");for(var D,I,$,B,P={},G,V,Y,W;;){if(I=m[m.length-1],this.defaultActions[I]?$=this.defaultActions[I]:((D===null||typeof D>"u")&&(D=N()),$=b[I]&&b[I][D]),typeof $>"u"||!$.length||!$[0]){var ie="";W=[];for(G in b[I])this.terminals_[G]&&G>C&&W.push("'"+this.terminals_[G]+"'");O.showPosition?ie="Parse error on line "+(k+1)+`: -`+O.showPosition()+` -Expecting `+W.join(", ")+", got '"+(this.terminals_[D]||D)+"'":ie="Parse error on line "+(k+1)+": Unexpected "+(D==_?"end of input":"'"+(this.terminals_[D]||D)+"'"),this.parseError(ie,{text:O.match,token:this.terminals_[D]||D,line:O.yylineno,loc:F,expected:W})}if($[0]instanceof Array&&$.length>1)throw new Error("Parse Error: multiple actions possible at state: "+I+", token: "+D);switch($[0]){case 1:m.push(D),v.push(O.yytext),T.push(O.yylloc),m.push($[1]),D=null,A=O.yyleng,w=O.yytext,k=O.yylineno,F=O.yylloc;break;case 2:if(V=this.productions_[$[1]][1],P.$=v[v.length-V],P._$={first_line:T[T.length-(V||1)].first_line,last_line:T[T.length-1].last_line,first_column:T[T.length-(V||1)].first_column,last_column:T[T.length-1].last_column},S&&(P._$.range=[T[T.length-(V||1)].range[0],T[T.length-1].range[1]]),B=this.performAction.apply(P,[w,A,k,M.yy,$[1],v,T].concat(L)),typeof B<"u")return B;V&&(m=m.slice(0,-1*V*2),v=v.slice(0,-1*V),T=T.slice(0,-1*V)),m.push(this.productions_[$[1]][0]),v.push(P.$),T.push(P._$),Y=b[m[m.length-2]][m[m.length-1]],m.push(Y);break;case 3:return!0}}return!0},"parse")},h=(function(){var f={EOF:1,parseError:x(function(g,m){if(this.yy.parser)this.yy.parser.parseError(g,m);else throw new Error(g)},"parseError"),setInput:x(function(p,g){return this.yy=g||this.yy||{},this._input=p,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:x(function(){var p=this._input[0];this.yytext+=p,this.yyleng++,this.offset++,this.match+=p,this.matched+=p;var g=p.match(/(?:\r\n?|\n).*/g);return g?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),p},"input"),unput:x(function(p){var g=p.length,m=p.split(/(?:\r\n?|\n)/g);this._input=p+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-g),this.offset-=g;var y=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),m.length-1&&(this.yylineno-=m.length-1);var v=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:m?(m.length===y.length?this.yylloc.first_column:0)+y[y.length-m.length].length-m[0].length:this.yylloc.first_column-g},this.options.ranges&&(this.yylloc.range=[v[0],v[0]+this.yyleng-g]),this.yyleng=this.yytext.length,this},"unput"),more:x(function(){return this._more=!0,this},"more"),reject:x(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). -`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:x(function(p){this.unput(this.match.slice(p))},"less"),pastInput:x(function(){var p=this.matched.substr(0,this.matched.length-this.match.length);return(p.length>20?"...":"")+p.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:x(function(){var p=this.match;return p.length<20&&(p+=this._input.substr(0,20-p.length)),(p.substr(0,20)+(p.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:x(function(){var p=this.pastInput(),g=new Array(p.length+1).join("-");return p+this.upcomingInput()+` -`+g+"^"},"showPosition"),test_match:x(function(p,g){var m,y,v;if(this.options.backtrack_lexer&&(v={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(v.yylloc.range=this.yylloc.range.slice(0))),y=p[0].match(/(?:\r\n?|\n).*/g),y&&(this.yylineno+=y.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:y?y[y.length-1].length-y[y.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+p[0].length},this.yytext+=p[0],this.match+=p[0],this.matches=p,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(p[0].length),this.matched+=p[0],m=this.performAction.call(this,this.yy,this,g,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),m)return m;if(this._backtrack){for(var T in v)this[T]=v[T];return!1}return!1},"test_match"),next:x(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var p,g,m,y;this._more||(this.yytext="",this.match="");for(var v=this._currentRules(),T=0;Tg[0].length)){if(g=m,y=T,this.options.backtrack_lexer){if(p=this.test_match(m,v[T]),p!==!1)return p;if(this._backtrack){g=!1;continue}else return!1}else if(!this.options.flex)break}return g?(p=this.test_match(g,v[y]),p!==!1?p:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var g=this.next();return g||this.lex()},"lex"),begin:x(function(g){this.conditionStack.push(g)},"begin"),popState:x(function(){var g=this.conditionStack.length-1;return g>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(g){return g=this.conditionStack.length-1-Math.abs(g||0),g>=0?this.conditionStack[g]:"INITIAL"},"topState"),pushState:x(function(g){this.begin(g)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:x(function(g,m,y,v){switch(y){case 0:break;case 1:break;case 2:return 13;case 3:break;case 4:break;case 5:return 8;case 6:return 9;case 7:return 7;case 8:return 14;case 9:return this.begin("acc_title"),15;case 10:return this.popState(),"acc_title_value";case 11:return this.begin("acc_descr"),17;case 12:return this.popState(),"acc_descr_value";case 13:this.begin("acc_descr_multiline");break;case 14:this.popState();break;case 15:return"acc_descr_multiline_value";case 16:return 20;case 17:return 24;case 18:return 23;case 19:return 6;case 20:return"INVALID"}},"anonymous"),rules:[/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:timeline[ \t]+LR\b)/i,/^(?:timeline[ \t]+TD\b)/i,/^(?:timeline\b)/i,/^(?:title\s[^\n]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:section\s[^:\n]+)/i,/^(?::\s(?:[^:\n]|:(?!\s))+)/i,/^(?:[^#:\n]+)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[14,15],inclusive:!1},acc_descr:{rules:[12],inclusive:!1},acc_title:{rules:[10],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,11,13,16,17,18,19,20],inclusive:!0}}};return f})();u.lexer=h;function d(){this.yy={}}return x(d,"Parser"),d.prototype=u,u.Parser=d,new d})();P$.parser=P$;var Uut=P$,Xme={};bw(Xme,{addEvent:()=>i1e,addSection:()=>e1e,addTask:()=>n1e,addTaskOrg:()=>a1e,clear:()=>Zme,default:()=>Hut,getCommonDb:()=>jme,getDirection:()=>Jme,getSections:()=>t1e,getTasks:()=>r1e,setDirection:()=>Qme});var am="",Kme=0,B$="LR",F$=[],DS=[],sm=[],jme=x(()=>L6,"getCommonDb"),Zme=x(function(){F$.length=0,DS.length=0,am="",sm.length=0,B$="LR",In()},"clear"),Qme=x(function(t){B$=t},"setDirection"),Jme=x(function(){return B$},"getDirection"),e1e=x(function(t){am=t,F$.push(t)},"addSection"),t1e=x(function(){return F$},"getSections"),r1e=x(function(){let t=s1e();const e=100;let r=0;for(;!t&&rr.id===Kme-1).events.push(t)},"addEvent"),a1e=x(function(t){const e={section:am,type:am,description:t,task:t,classes:[]};DS.push(e)},"addTaskOrg"),s1e=x(function(){const t=x(function(r){return sm[r].processed},"compileTask");let e=!0;for(const[r,n]of sm.entries())t(r),e=e&&n.processed;return e},"compileTasks"),Hut={clear:Zme,getCommonDb:jme,getDirection:Jme,setDirection:Qme,addSection:e1e,getSections:t1e,getTasks:r1e,addTask:n1e,addTaskOrg:a1e,addEvent:i1e},o1e=0,MS=x(function(t,e){const r=t.append("rect");return r.attr("x",e.x),r.attr("y",e.y),r.attr("fill",e.fill),r.attr("stroke",e.stroke),r.attr("width",e.width),r.attr("height",e.height),r.attr("rx",e.rx),r.attr("ry",e.ry),e.class!==void 0&&r.attr("class",e.class),r},"drawRect"),Yut=x(function(t,e){const n=t.append("circle").attr("cx",e.cx).attr("cy",e.cy).attr("class","face").attr("r",15).attr("stroke-width",2).attr("overflow","visible"),i=t.append("g");i.append("circle").attr("cx",e.cx-15/3).attr("cy",e.cy-15/3).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),i.append("circle").attr("cx",e.cx+15/3).attr("cy",e.cy-15/3).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666");function a(l){const u=P0().startAngle(Math.PI/2).endAngle(3*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);l.append("path").attr("class","mouth").attr("d",u).attr("transform","translate("+e.cx+","+(e.cy+2)+")")}x(a,"smile");function s(l){const u=P0().startAngle(3*Math.PI/2).endAngle(5*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);l.append("path").attr("class","mouth").attr("d",u).attr("transform","translate("+e.cx+","+(e.cy+7)+")")}x(s,"sad");function o(l){l.append("line").attr("class","mouth").attr("stroke",2).attr("x1",e.cx-5).attr("y1",e.cy+7).attr("x2",e.cx+5).attr("y2",e.cy+7).attr("class","mouth").attr("stroke-width","1px").attr("stroke","#666")}return x(o,"ambivalent"),e.score>3?a(i):e.score<3?s(i):o(i),n},"drawFace"),Xut=x(function(t,e){const r=t.append("circle");return r.attr("cx",e.cx),r.attr("cy",e.cy),r.attr("class","actor-"+e.pos),r.attr("fill",e.fill),r.attr("stroke",e.stroke),r.attr("r",e.r),r.class!==void 0&&r.attr("class",r.class),e.title!==void 0&&r.append("title").text(e.title),r},"drawCircle"),l1e=x(function(t,e){const r=e.text.replace(//gi," "),n=t.append("text");n.attr("x",e.x),n.attr("y",e.y),n.attr("class","legend"),n.style("text-anchor",e.anchor),e.class!==void 0&&n.attr("class",e.class);const i=n.append("tspan");return i.attr("x",e.x+e.textMargin*2),i.text(r),n},"drawText"),Kut=x(function(t,e){function r(i,a,s,o,l){return i+","+a+" "+(i+s)+","+a+" "+(i+s)+","+(a+o-l)+" "+(i+s-l*1.2)+","+(a+o)+" "+i+","+(a+o)}x(r,"genPoints");const n=t.append("polygon");n.attr("points",r(e.x,e.y,50,20,7)),n.attr("class","labelBox"),e.y=e.y+e.labelMargin,e.x=e.x+.5*e.labelMargin,l1e(t,e)},"drawLabel"),jut=x(function(t,e,r){const n=t.append("g"),i=G$();i.x=e.x,i.y=e.y,i.fill=e.fill,i.width=r.width,i.height=r.height,i.class="journey-section section-type-"+e.num,i.rx=3,i.ry=3,MS(n,i),c1e(r)(e.text,n,i.x,i.y,i.width,i.height,{class:"journey-section section-type-"+e.num},r,e.colour)},"drawSection"),z$=-1,Zut=x(function(t,e,r,n){const i=e.x+r.width/2,a=t.append("g");z$++,a.append("line").attr("id",n+"-task"+z$).attr("x1",i).attr("y1",e.y).attr("x2",i).attr("y2",450).attr("class","task-line").attr("stroke-width","1px").attr("stroke-dasharray","4 2").attr("stroke","#666"),Yut(a,{cx:i,cy:300+(5-e.score)*30,score:e.score});const o=G$();o.x=e.x,o.y=e.y,o.fill=e.fill,o.width=r.width,o.height=r.height,o.class="task task-type-"+e.num,o.rx=3,o.ry=3,MS(a,o),c1e(r)(e.task,a,o.x,o.y,o.width,o.height,{class:"task"},r,e.colour)},"drawTask"),Qut=x(function(t,e){MS(t,{x:e.startx,y:e.starty,width:e.stopx-e.startx,height:e.stopy-e.starty,fill:e.fill,class:"rect"}).lower()},"drawBackgroundRect"),Jut=x(function(){return{x:0,y:0,fill:void 0,"text-anchor":"start",width:100,height:100,textMargin:0,rx:0,ry:0}},"getTextObj"),G$=x(function(){return{x:0,y:0,width:100,anchor:"start",height:100,rx:0,ry:0}},"getNoteRect"),c1e=(function(){function t(i,a,s,o,l,u,h,d){const f=a.append("text").attr("x",s+l/2).attr("y",o+u/2+5).style("font-color",d).style("text-anchor","middle").text(i);n(f,h)}x(t,"byText");function e(i,a,s,o,l,u,h,d,f){const{taskFontSize:p,taskFontFamily:g}=d,m=i.split(//gi);for(let y=0;y)/).reverse(),i,a=[],s=1.1,o=r.attr("y"),l=parseFloat(r.attr("dy")),u=r.text(null).append("tspan").attr("x",0).attr("y",o).attr("dy",l+"em");for(let h=0;he||i==="
    ")&&(a.pop(),u.text(a.join(" ").trim()),i==="
    "?a=[""]:a=[i],u=r.append("tspan").attr("x",0).attr("y",o).attr("dy",s+"em").text(i))})}x(q$,"wrap");var tht=x(function(t,e,r,n,i,a=!1){var v,T,b;const{theme:s,look:o}=n,l=s==null?void 0:s.includes("redux"),u=((v=n==null?void 0:n.themeVariables)==null?void 0:v.THEME_COLOR_LIMIT)??12,h=r%u-1,d=t.append("g");e.section=h,d.attr("class",(e.class?e.class+" ":"")+"timeline-node "+("section-"+h));const f=d.append("g"),p=d.append("g"),m=p.append("text").text(e.descr).attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle").call(q$,e.width).node().getBBox(),y=(T=n.fontSize)!=null&&T.replace?n.fontSize.replace("px",""):n.fontSize;if(e.height=m.height+y*1.1*.5+e.padding,e.height=Math.max(e.height,e.maxHeight),e.width=e.width+2*e.padding,p.attr("transform","translate("+e.width/2+", "+e.padding/2+")"),l&&p.attr("transform",`translate(${e.width/2}, ${a?e.padding/2+3:e.padding})`),nht(f,e,h,i,n),o==="neo"&&(d.attr("data-look","neo"),l)){const w=s.includes("dark"),k=((b=t.node())==null?void 0:b.ownerSVGElement)??t.node(),A=pt(k),C=A.attr("id")??"",_=C?`${C}-drop-shadow`:"drop-shadow";if(A.select(`#${_}`).empty()){const L=A.select("defs");(L.empty()?A.append("defs"):L).append("filter").attr("id",_).attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity",w?"0.2":"0.06").attr("flood-color",w?"#FFFFFF":"#000000")}}return e},"drawNode"),rht=x(function(t,e,r){var o;const n=t.append("g"),a=n.append("text").text(e.descr).attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle").call(q$,e.width).node().getBBox(),s=(o=r.fontSize)!=null&&o.replace?r.fontSize.replace("px",""):r.fontSize;return n.remove(),a.height+s*1.1*.5+e.padding},"getVirtualNodeHeight"),nht=x(function(t,e,r,n,i){const{theme:a}=i,s=a!=null&&a.includes("redux")?0:5,o=5,l=s>0?`M0 ${e.height-o} v${-e.height+2*o} q0,-${s},${s},-${s} h${e.width-2*o} q${s},0,${s},${s} v${e.height-o} H0 Z`:`M0 ${e.height-o} v${-(e.height-o)} h${e.width} v${e.height} H0 Z`;t.append("path").attr("id",n+"-node-"+o1e++).attr("class","node-bkg node-"+e.type).attr("d",l),a!=null&&a.includes("redux")||t.append("line").attr("class","node-line-"+r).attr("x1",0).attr("y1",e.height).attr("x2",e.width).attr("y2",e.height)},"defaultBkg"),Ds={drawRect:MS,drawCircle:Xut,drawSection:jut,drawText:l1e,drawLabel:Kut,drawTask:Zut,drawBackgroundRect:Qut,getTextObj:Jut,getNoteRect:G$,initGraphics:eht,drawNode:tht,getVirtualNodeHeight:rht},iht=x(function(t,e,r,n){var R,N,D;const i=Pe(),{look:a,theme:s,themeVariables:o}=i,{useGradient:l,gradientStart:u,gradientStop:h}=o,d=((R=i.timeline)==null?void 0:R.leftMargin)??50;ae.debug("timeline",n.db);const f=i.securityLevel;let p;f==="sandbox"&&(p=pt("#i"+e));const m=pt(f==="sandbox"?p.nodes()[0].contentDocument.body:"body").select("#"+e);m.append("g");const y=n.db.getTasks(),v=n.db.getCommonDb().getDiagramTitle();ae.debug("task",y),Ds.initGraphics(m,e);const T=n.db.getSections();ae.debug("sections",T);let b=0,w=0,k=0,A=0,C=50+d,_=50;A=50;let L=0,O=!0;T.forEach(function(I){const $={number:L,descr:I,section:L,width:150,padding:20,maxHeight:b},B=Ds.getVirtualNodeHeight(m,$,i);ae.debug("sectionHeight before draw",B),b=Math.max(b,B+20)});let M=0,z=0;ae.debug("tasks.length",y.length);for(const[I,$]of y.entries()){const B={number:I,descr:$,section:$.section,width:150,padding:20,maxHeight:w},P=Ds.getVirtualNodeHeight(m,B,i);ae.debug("taskHeight before draw",P),w=Math.max(w,P+20),M=Math.max(M,$.events.length);let G=0;for(const V of $.events){const Y={descr:V,section:$.section,number:$.section,width:150,padding:20,maxHeight:50};G+=Ds.getVirtualNodeHeight(m,Y,i)}$.events.length>0&&(G+=($.events.length-1)*10),z=Math.max(z,G)}ae.debug("maxSectionHeight before draw",b),ae.debug("maxTaskHeight before draw",w),T&&T.length>0?T.forEach(I=>{const $=y.filter(V=>V.section===I),B={number:L,descr:I,section:L,width:200*Math.max($.length,1)-50,padding:20,maxHeight:b};ae.debug("sectionNode",B);const P=m.append("g"),G=Ds.drawNode(P,B,L,i,e);ae.debug("sectionNode output",G),P.attr("transform",`translate(${C}, ${A})`),_+=b+50,$.length>0&&u1e(m,$,L,C,_,w,i,M,z,b,!1,e),C+=200*Math.max($.length,1),_=A,L++}):(O=!1,u1e(m,y,L,C,_,w,i,M,z,b,!0,e));const F=m.node().getBBox();if(ae.debug("bounds",F),v&&m.append("text").text(v).attr("x",a==="neo"?F.x*2+d:F.width/2-d).attr("font-size","4ex").attr("font-weight","bold").attr("y",20),k=O?b+w+150:w+100,m.append("g").attr("class","lineWrapper").append("line").attr("x1",d).attr("y1",k).attr("x2",F.width+3*d).attr("y2",k).attr("stroke-width",4).attr("stroke","black").attr("marker-end",`url(#${e}-arrowhead)`),a==="neo"&&l&&s!=="neutral"){const I=m.select("defs"),B=(I.empty()?m.append("defs"):I).append("linearGradient").attr("id",m.attr("id")+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");B.append("stop").attr("offset","0%").attr("stop-color",u).attr("stop-opacity",1),B.append("stop").attr("offset","100%").attr("stop-color",h).attr("stop-opacity",1)}E0(void 0,m,((N=i.timeline)==null?void 0:N.padding)??50,((D=i.timeline)==null?void 0:D.useMaxWidth)??!1)},"draw"),u1e=x(function(t,e,r,n,i,a,s,o,l,u,h,d){var f;for(const p of e){const g={descr:p.task,section:r,number:r,width:150,padding:20,maxHeight:a};ae.debug("taskNode",g);const m=t.append("g").attr("class","taskWrapper"),v=Ds.drawNode(m,g,r,s,d).height;if(ae.debug("taskHeight after draw",v),m.attr("transform",`translate(${n}, ${i})`),a=Math.max(a,v),p.events){const T=t.append("g").attr("class","lineWrapper");let b=a;i+=100,b=b+aht(t,p.events,r,n,i,s,d),i-=100,T.append("line").attr("x1",n+190/2).attr("y1",i+a).attr("x2",n+190/2).attr("y2",i+a+100+l+100).attr("stroke-width",2).attr("stroke","black").attr("marker-end",`url(#${d}-arrowhead)`).attr("stroke-dasharray","5,5")}n=n+200,h&&!((f=s.timeline)!=null&&f.disableMulticolor)&&r++}i=i-10},"drawTasks"),aht=x(function(t,e,r,n,i,a,s){let o=0;const l=i;i=i+100;for(const u of e){const h={descr:u,section:r,number:r,width:150,padding:20,maxHeight:50};ae.debug("eventNode",h);const d=t.append("g").attr("class","eventWrapper"),p=Ds.drawNode(d,h,r,a,s,!0).height;o=o+p,d.attr("transform",`translate(${n}, ${i})`),i=i+10+p}return i=l,o},"drawEvents"),sht={setConf:x(()=>{},"setConf"),draw:iht},NS=200,mu=5,oht=NS+mu*2,V$=NS+100,lht=V$+mu*2,h1e=10,cht=0,d1e=20,f1e=20,p1e=30,g1e=50,uht=x(function(t,e,r,n){var R,N,D,I,$;const i=Pe(),a=((R=i.timeline)==null?void 0:R.leftMargin)??50;ae.debug("timeline",n.db);const s=ys(e);s.append("g");const o=n.db.getTasks(),l=n.db.getCommonDb().getDiagramTitle();ae.debug("task",o),Ds.initGraphics(s);const u=n.db.getSections();ae.debug("sections",u);let h=0,d=0;const f=50+a;let p=50;const g=p,m=f,y=oht+f1e,v=lht+g1e,T=m+y;let b=0;const w=u&&u.length>0,k=w?T:f+y,A=Math.max(50,y+v-mu*2);u.forEach(function(B){const P={number:b,descr:B,section:b,width:A,padding:mu,maxHeight:h},G=Ds.getVirtualNodeHeight(s,P,i);ae.debug("sectionHeight before draw",G),h=Math.max(h,G)});let C=0;ae.debug("tasks.length",o.length);for(const[B,P]of o.entries()){const G={number:B,descr:P,section:P.section,width:NS,padding:mu,maxHeight:d},V=Ds.getVirtualNodeHeight(s,G,i);ae.debug("taskHeight before draw",V),d=Math.max(d,V);let Y=0;for(const W of P.events){const ie={descr:W,section:P.section,number:P.section,width:V$,padding:mu,maxHeight:50};Y+=Ds.getVirtualNodeHeight(s,ie,i)}P.events.length>0&&(Y+=(P.events.length-1)*h1e),C=Math.max(C,Y)+cht}ae.debug("maxSectionHeight before draw",h),ae.debug("maxTaskHeight before draw",d);const L=Math.max(d,C)+p1e;w?u.forEach(B=>{const P=o.filter(J=>J.section===B),G={number:b,descr:B,section:b,width:A,padding:mu,maxHeight:h};ae.debug("sectionNode",G);const V=s.append("g"),Y=Ds.drawNode(V,G,b,i);ae.debug("sectionNode output",Y);const W=k-y;V.attr("transform",`translate(${W}, ${p})`);const ie=p+Y.height+d1e;P.length>0&&m1e(s,P,b,k,ie,d,i,L,!1);const K=P.length,se=Y.height+d1e+L*Math.max(K,1)-(K>0?p1e*2:0);p+=se,b++}):m1e(s,o,b,k,p,d,i,L,!0);let O=(N=s.node())==null?void 0:N.getBBox();if(!O)throw new Error("bbox not found");if(ae.debug("bounds",O),l){if(s.append("text").text(l).attr("x",O.width/2-a).attr("font-size","4ex").attr("font-weight","bold").attr("y",20),O=(D=s.node())==null?void 0:D.getBBox(),!O)throw new Error("bbox not found");ae.debug("bounds after title",O)}const[M]=xc(i.fontSize),z=(M??16)*2,F=(M??16)*.5+20,S=s.append("g").attr("class","lineWrapper");S.append("line").attr("x1",k).attr("y1",g-z).attr("x2",k).attr("y2",O.y+O.height+F).attr("stroke-width",4).attr("stroke","black").attr("marker-end","url(#arrowhead)"),S.lower(),E0(void 0,s,((I=i.timeline)==null?void 0:I.padding)??50,(($=i.timeline)==null?void 0:$.useMaxWidth)??!1)},"draw"),m1e=x(function(t,e,r,n,i,a,s,o,l){var u;for(const h of e){const d={descr:h.task,section:r,number:r,width:NS,padding:mu,maxHeight:a};ae.debug("taskNode",d);const f=t.append("g").attr("class","taskWrapper"),p=Ds.drawNode(f,d,r,s),g=p.height;ae.debug("taskHeight after draw",g);const m=n-f1e-p.width;if(f.attr("transform",`translate(${m}, ${i})`),a=Math.max(a,g),h.events&&h.events.length>0){const y=i,v=n+g1e;hht(t,h.events,r,n,v,y,s)}i=i+o,l&&!((u=s.timeline)!=null&&u.disableMulticolor)&&r++}},"drawTasks"),hht=x(function(t,e,r,n,i,a,s){let o=a;for(const l of e){const u={descr:l,section:r,number:r,width:V$,padding:mu,maxHeight:0};ae.debug("eventNode",u);const h=t.append("g").attr("class","eventWrapper"),f=Ds.drawNode(h,u,r,s).height;h.attr("transform",`translate(${i}, ${o})`);const p=t.append("g").attr("class","lineWrapper"),g=o+f/2;p.append("line").attr("x1",n).attr("y1",g).attr("x2",i).attr("y2",g).attr("stroke-width",2).attr("stroke","black").attr("marker-end","url(#arrowhead)").attr("stroke-dasharray","5,5"),o=o+f+h1e}return o-a},"drawEvents"),dht={setConf:x(()=>{},"setConf"),draw:uht},fht=x(t=>{var o;const{theme:e}=lr(),r=e==null?void 0:e.includes("dark"),n=e==null?void 0:e.includes("color"),i=((o=t.svgId)==null?void 0:o.replace(/^#/,""))??"",a=i?`url(#${i}-drop-shadow)`:t.dropShadow??"none";let s="";for(let l=0;l3?a(i):e.score<3?s(i):o(i),n},"drawFace"),awe=T(function(t,e){const r=t.append("circle");return r.attr("cx",e.cx),r.attr("cy",e.cy),r.attr("class","actor-"+e.pos),r.attr("fill",e.fill),r.attr("stroke",e.stroke),r.attr("r",e.r),r.class!==void 0&&r.attr("class",r.class),e.title!==void 0&&r.append("title").text(e.title),r},"drawCircle"),swe=T(function(t,e){return PJe(t,e)},"drawText"),Tvt=T(function(t,e){function r(i,a,s,o,l){return i+","+a+" "+(i+s)+","+a+" "+(i+s)+","+(a+o-l)+" "+(i+s-l*1.2)+","+(a+o)+" "+i+","+(a+o)}T(r,"genPoints");const n=t.append("polygon");n.attr("points",r(e.x,e.y,50,20,7)),n.attr("class","labelBox"),e.y=e.y+e.labelMargin,e.x=e.x+.5*e.labelMargin,swe(t,e)},"drawLabel"),wvt=T(function(t,e,r){const n=t.append("g"),i=Ro();i.x=e.x,i.y=e.y,i.fill=e.fill,i.width=r.width*e.taskCount+r.diagramMarginX*(e.taskCount-1),i.height=r.height,i.class="journey-section section-type-"+e.num,i.rx=3,i.ry=3,cG(n,i),owe(r)(e.text,n,i.x,i.y,i.width,i.height,{class:"journey-section section-type-"+e.num},r,e.colour)},"drawSection"),uG=-1,Cvt=T(function(t,e,r,n){const i=e.x+r.width/2,a=t.append("g");uG++,a.append("line").attr("id",n+"-task"+uG).attr("x1",i).attr("y1",e.y).attr("x2",i).attr("y2",450).attr("class","task-line").attr("stroke-width","1px").attr("stroke-dasharray","4 2").attr("stroke","#666"),xvt(a,{cx:i,cy:300+(5-e.score)*30,score:e.score});const o=Ro();o.x=e.x,o.y=e.y,o.fill=e.fill,o.width=r.width,o.height=r.height,o.class="task task-type-"+e.num,o.rx=3,o.ry=3,cG(a,o);let l=e.x+14;e.people.forEach(u=>{const h=e.actors[u].color,d={cx:l,cy:e.y,r:7,fill:h,stroke:"#000",title:u,pos:e.actors[u].position};awe(a,d),l+=10}),owe(r)(e.task,a,o.x,o.y,o.width,o.height,{class:"task"},r,e.colour)},"drawTask"),kvt=T(function(t,e){Ole(t,e)},"drawBackgroundRect"),owe=(function(){function t(i,a,s,o,l,u,h,d){const f=a.append("text").attr("x",s+l/2).attr("y",o+u/2+5).style("font-color",d).style("text-anchor","middle").text(i);n(f,h)}T(t,"byText");function e(i,a,s,o,l,u,h,d,f){const{taskFontSize:p,taskFontFamily:g}=d,m=i.split(//gi);for(let y=0;y{const a=ph[i].color,s={cx:20,cy:n,r:7,fill:a,stroke:"#000",pos:ph[i].position};l4.drawCircle(t,s);let o=t.append("text").attr("visibility","hidden").text(i);const l=o.node().getBoundingClientRect().width;o.remove();let u=[];if(l<=r)u=[i];else{const h=i.split(" ");let d="";o=t.append("text").attr("visibility","hidden"),h.forEach(f=>{const p=d?`${d} ${f}`:f;if(o.text(p),o.node().getBoundingClientRect().width>r){if(d&&u.push(d),d=f,o.text(f),o.node().getBoundingClientRect().width>r){let m="";for(const y of f)m+=y,o.text(m+"-"),o.node().getBoundingClientRect().width>r&&(u.push(m.slice(0,-1)+"-"),m=y);d=m}}else d=p}),d&&u.push(d),o.remove()}u.forEach((h,d)=>{const f={x:40,y:n+7+d*20,fill:"#666",text:h,textMargin:e.boxTextMargin??5},g=l4.drawText(t,f).node().getBoundingClientRect().width;g>LA&&g>e.leftMargin-g&&(LA=g)}),n+=Math.max(20,u.length*20)})}T(lwe,"drawActorLegend");var zl=Pe().journey,Od=0,_vt=T(function(t,e,r,n){const i=Pe(),a=i.journey.titleColor,s=i.journey.titleFontSize,o=i.journey.titleFontFamily,l=i.securityLevel;let u;l==="sandbox"&&(u=gt("#i"+e));const h=gt(l==="sandbox"?u.nodes()[0].contentDocument.body:"body");ll.init();const d=h.select("#"+e);l4.initGraphics(d,e);const f=n.db.getTasks(),p=n.db.getDiagramTitle(),g=n.db.getActors();for(const w in ph)delete ph[w];let m=0;g.forEach(w=>{ph[w]={color:zl.actorColours[m%zl.actorColours.length],position:m},m++}),lwe(d),Od=zl.leftMargin+LA,ll.insert(0,0,Od,Object.keys(ph).length*50),Avt(d,f,0,e);const y=ll.getBounds();p&&d.append("text").text(p).attr("x",Od).attr("font-size",s).attr("font-weight","bold").attr("y",25).attr("fill",a).attr("font-family",o);const v=y.stopy-y.starty+2*zl.diagramMarginY,x=Od+y.stopx+2*zl.diagramMarginX;Wi(d,v,x,zl.useMaxWidth),d.append("line").attr("x1",Od).attr("y1",zl.height*4).attr("x2",x-Od-4).attr("y2",zl.height*4).attr("stroke-width",4).attr("stroke","black").attr("marker-end","url(#"+e+"-arrowhead)");const b=p?70:0;d.attr("viewBox",`${y.startx} -25 ${x} ${v+b}`),d.attr("preserveAspectRatio","xMinYMin meet"),d.attr("height",v+b+25)},"draw"),ll={data:{startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},verticalPos:0,sequenceItems:[],init:T(function(){this.sequenceItems=[],this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},this.verticalPos=0},"init"),updateVal:T(function(t,e,r,n){t[e]===void 0?t[e]=r:t[e]=n(r,t[e])},"updateVal"),updateBounds:T(function(t,e,r,n){const i=Pe().journey,a=this;let s=0;function o(l){return T(function(h){s++;const d=a.sequenceItems.length-s+1;a.updateVal(h,"starty",e-d*i.boxMargin,Math.min),a.updateVal(h,"stopy",n+d*i.boxMargin,Math.max),a.updateVal(ll.data,"startx",t-d*i.boxMargin,Math.min),a.updateVal(ll.data,"stopx",r+d*i.boxMargin,Math.max),l!=="activation"&&(a.updateVal(h,"startx",t-d*i.boxMargin,Math.min),a.updateVal(h,"stopx",r+d*i.boxMargin,Math.max),a.updateVal(ll.data,"starty",e-d*i.boxMargin,Math.min),a.updateVal(ll.data,"stopy",n+d*i.boxMargin,Math.max))},"updateItemBounds")}T(o,"updateFn"),this.sequenceItems.forEach(o())},"updateBounds"),insert:T(function(t,e,r,n){const i=Math.min(t,r),a=Math.max(t,r),s=Math.min(e,n),o=Math.max(e,n);this.updateVal(ll.data,"startx",i,Math.min),this.updateVal(ll.data,"starty",s,Math.min),this.updateVal(ll.data,"stopx",a,Math.max),this.updateVal(ll.data,"stopy",o,Math.max),this.updateBounds(i,s,a,o)},"insert"),bumpVerticalPos:T(function(t){this.verticalPos=this.verticalPos+t,this.data.stopy=this.verticalPos},"bumpVerticalPos"),getVerticalPos:T(function(){return this.verticalPos},"getVerticalPos"),getBounds:T(function(){return this.data},"getBounds")},hG=zl.sectionFills,cwe=zl.sectionColours,Avt=T(function(t,e,r,n){const i=Pe().journey;let a="";const s=i.height*2+i.diagramMarginY,o=r+s;let l=0,u="#CCC",h="black",d=0;for(const[f,p]of e.entries()){if(a!==p.section){u=hG[l%hG.length],d=l%hG.length,h=cwe[l%cwe.length];let m=0;const y=p.section;for(let x=f;x(ph[y]&&(m[y]=ph[y]),m),{});p.x=f*i.taskMargin+f*i.width+Od,p.y=o,p.width=i.diagramMarginX,p.height=i.diagramMarginY,p.colour=h,p.fill=u,p.num=d,p.actors=g,l4.drawTask(t,p,i,n),ll.insert(p.x,p.y,p.x+p.width+i.taskMargin,450)}},"drawTasks"),uwe={setConf:Svt,draw:_vt},Rvt={parser:cvt,db:iwe,renderer:uwe,styles:bvt,init:T(t=>{uwe.setConf(t.journey),iwe.clear()},"init")};const Lvt=Object.freeze(Object.defineProperty({__proto__:null,diagram:Rvt},Symbol.toStringTag,{value:"Module"}));var dG=(function(){var t=T(function(f,p,g,m){for(g=g||{},m=f.length;m--;g[f[m]]=p);return g},"o"),e=[6,11,13,14,15,17,19,20,23,24],r=[1,12],n=[1,13],i=[1,14],a=[1,15],s=[1,16],o=[1,19],l=[1,20],u={trace:T(function(){},"trace"),yy:{},symbols_:{error:2,start:3,timeline_header:4,document:5,EOF:6,timeline:7,timeline_lr:8,timeline_td:9,line:10,SPACE:11,statement:12,NEWLINE:13,title:14,acc_title:15,acc_title_value:16,acc_descr:17,acc_descr_value:18,acc_descr_multiline_value:19,section:20,period_statement:21,event_statement:22,period:23,event:24,$accept:0,$end:1},terminals_:{2:"error",6:"EOF",7:"timeline",8:"timeline_lr",9:"timeline_td",11:"SPACE",13:"NEWLINE",14:"title",15:"acc_title",16:"acc_title_value",17:"acc_descr",18:"acc_descr_value",19:"acc_descr_multiline_value",20:"section",23:"period",24:"event"},productions_:[0,[3,3],[4,1],[4,1],[4,1],[5,0],[5,2],[10,2],[10,1],[10,1],[10,1],[12,1],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[21,1],[22,1]],performAction:T(function(p,g,m,y,v,x,b){var w=x.length-1;switch(v){case 1:return x[w-1];case 3:y.setDirection("LR");break;case 4:y.setDirection("TD");break;case 5:this.$=[];break;case 6:x[w-1].push(x[w]),this.$=x[w-1];break;case 7:case 8:this.$=x[w];break;case 9:case 10:this.$=[];break;case 11:y.getCommonDb().setDiagramTitle(x[w].substr(6)),this.$=x[w].substr(6);break;case 12:this.$=x[w].trim(),y.getCommonDb().setAccTitle(this.$);break;case 13:case 14:this.$=x[w].trim(),y.getCommonDb().setAccDescription(this.$);break;case 15:y.addSection(x[w].substr(8)),this.$=x[w].substr(8);break;case 18:y.addTask(x[w],0,""),this.$=x[w];break;case 19:y.addEvent(x[w].substr(2)),this.$=x[w];break}},"anonymous"),table:[{3:1,4:2,7:[1,3],8:[1,4],9:[1,5]},{1:[3]},t(e,[2,5],{5:6}),t(e,[2,2]),t(e,[2,3]),t(e,[2,4]),{6:[1,7],10:8,11:[1,9],12:10,13:[1,11],14:r,15:n,17:i,19:a,20:s,21:17,22:18,23:o,24:l},t(e,[2,10],{1:[2,1]}),t(e,[2,6]),{12:21,14:r,15:n,17:i,19:a,20:s,21:17,22:18,23:o,24:l},t(e,[2,8]),t(e,[2,9]),t(e,[2,11]),{16:[1,22]},{18:[1,23]},t(e,[2,14]),t(e,[2,15]),t(e,[2,16]),t(e,[2,17]),t(e,[2,18]),t(e,[2,19]),t(e,[2,7]),t(e,[2,12]),t(e,[2,13])],defaultActions:{},parseError:T(function(p,g){if(g.recoverable)this.trace(p);else{var m=new Error(p);throw m.hash=g,m}},"parseError"),parse:T(function(p){var g=this,m=[0],y=[],v=[null],x=[],b=this.table,w="",C=0,_=0,k=2,S=1,L=x.slice.call(arguments,1),$=Object.create(this.lexer),I={yy:{}};for(var z in this.yy)Object.prototype.hasOwnProperty.call(this.yy,z)&&(I.yy[z]=this.yy[z]);$.setInput(p,I.yy),I.yy.lexer=$,I.yy.parser=this,typeof $.yylloc>"u"&&($.yylloc={});var F=$.yylloc;x.push(F);var A=$.options&&$.options.ranges;typeof I.yy.parseError=="function"?this.parseError=I.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function R(j){m.length=m.length-2*j,v.length=v.length-j,x.length=x.length-j}T(R,"popStack");function N(){var j;return j=y.pop()||$.lex()||S,typeof j!="number"&&(j instanceof Array&&(y=j,j=y.pop()),j=g.symbols_[j]||j),j}T(N,"lex");for(var M,D,O,B,P={},G,V,H,W;;){if(D=m[m.length-1],this.defaultActions[D]?O=this.defaultActions[D]:((M===null||typeof M>"u")&&(M=N()),O=b[D]&&b[D][M]),typeof O>"u"||!O.length||!O[0]){var ie="";W=[];for(G in b[D])this.terminals_[G]&&G>k&&W.push("'"+this.terminals_[G]+"'");$.showPosition?ie="Parse error on line "+(C+1)+`: +`+$.showPosition()+` +Expecting `+W.join(", ")+", got '"+(this.terminals_[M]||M)+"'":ie="Parse error on line "+(C+1)+": Unexpected "+(M==S?"end of input":"'"+(this.terminals_[M]||M)+"'"),this.parseError(ie,{text:$.match,token:this.terminals_[M]||M,line:$.yylineno,loc:F,expected:W})}if(O[0]instanceof Array&&O.length>1)throw new Error("Parse Error: multiple actions possible at state: "+D+", token: "+M);switch(O[0]){case 1:m.push(M),v.push($.yytext),x.push($.yylloc),m.push(O[1]),M=null,_=$.yyleng,w=$.yytext,C=$.yylineno,F=$.yylloc;break;case 2:if(V=this.productions_[O[1]][1],P.$=v[v.length-V],P._$={first_line:x[x.length-(V||1)].first_line,last_line:x[x.length-1].last_line,first_column:x[x.length-(V||1)].first_column,last_column:x[x.length-1].last_column},A&&(P._$.range=[x[x.length-(V||1)].range[0],x[x.length-1].range[1]]),B=this.performAction.apply(P,[w,_,C,I.yy,O[1],v,x].concat(L)),typeof B<"u")return B;V&&(m=m.slice(0,-1*V*2),v=v.slice(0,-1*V),x=x.slice(0,-1*V)),m.push(this.productions_[O[1]][0]),v.push(P.$),x.push(P._$),H=b[m[m.length-2]][m[m.length-1]],m.push(H);break;case 3:return!0}}return!0},"parse")},h=(function(){var f={EOF:1,parseError:T(function(g,m){if(this.yy.parser)this.yy.parser.parseError(g,m);else throw new Error(g)},"parseError"),setInput:T(function(p,g){return this.yy=g||this.yy||{},this._input=p,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:T(function(){var p=this._input[0];this.yytext+=p,this.yyleng++,this.offset++,this.match+=p,this.matched+=p;var g=p.match(/(?:\r\n?|\n).*/g);return g?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),p},"input"),unput:T(function(p){var g=p.length,m=p.split(/(?:\r\n?|\n)/g);this._input=p+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-g),this.offset-=g;var y=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),m.length-1&&(this.yylineno-=m.length-1);var v=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:m?(m.length===y.length?this.yylloc.first_column:0)+y[y.length-m.length].length-m[0].length:this.yylloc.first_column-g},this.options.ranges&&(this.yylloc.range=[v[0],v[0]+this.yyleng-g]),this.yyleng=this.yytext.length,this},"unput"),more:T(function(){return this._more=!0,this},"more"),reject:T(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). +`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:T(function(p){this.unput(this.match.slice(p))},"less"),pastInput:T(function(){var p=this.matched.substr(0,this.matched.length-this.match.length);return(p.length>20?"...":"")+p.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:T(function(){var p=this.match;return p.length<20&&(p+=this._input.substr(0,20-p.length)),(p.substr(0,20)+(p.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:T(function(){var p=this.pastInput(),g=new Array(p.length+1).join("-");return p+this.upcomingInput()+` +`+g+"^"},"showPosition"),test_match:T(function(p,g){var m,y,v;if(this.options.backtrack_lexer&&(v={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(v.yylloc.range=this.yylloc.range.slice(0))),y=p[0].match(/(?:\r\n?|\n).*/g),y&&(this.yylineno+=y.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:y?y[y.length-1].length-y[y.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+p[0].length},this.yytext+=p[0],this.match+=p[0],this.matches=p,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(p[0].length),this.matched+=p[0],m=this.performAction.call(this,this.yy,this,g,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),m)return m;if(this._backtrack){for(var x in v)this[x]=v[x];return!1}return!1},"test_match"),next:T(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var p,g,m,y;this._more||(this.yytext="",this.match="");for(var v=this._currentRules(),x=0;xg[0].length)){if(g=m,y=x,this.options.backtrack_lexer){if(p=this.test_match(m,v[x]),p!==!1)return p;if(this._backtrack){g=!1;continue}else return!1}else if(!this.options.flex)break}return g?(p=this.test_match(g,v[y]),p!==!1?p:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:T(function(){var g=this.next();return g||this.lex()},"lex"),begin:T(function(g){this.conditionStack.push(g)},"begin"),popState:T(function(){var g=this.conditionStack.length-1;return g>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:T(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:T(function(g){return g=this.conditionStack.length-1-Math.abs(g||0),g>=0?this.conditionStack[g]:"INITIAL"},"topState"),pushState:T(function(g){this.begin(g)},"pushState"),stateStackSize:T(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:T(function(g,m,y,v){switch(y){case 0:break;case 1:break;case 2:return 13;case 3:break;case 4:break;case 5:return 8;case 6:return 9;case 7:return 7;case 8:return 14;case 9:return this.begin("acc_title"),15;case 10:return this.popState(),"acc_title_value";case 11:return this.begin("acc_descr"),17;case 12:return this.popState(),"acc_descr_value";case 13:this.begin("acc_descr_multiline");break;case 14:this.popState();break;case 15:return"acc_descr_multiline_value";case 16:return 20;case 17:return 24;case 18:return 23;case 19:return 6;case 20:return"INVALID"}},"anonymous"),rules:[/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:timeline[ \t]+LR\b)/i,/^(?:timeline[ \t]+TD\b)/i,/^(?:timeline\b)/i,/^(?:title\s[^\n]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:section\s[^:\n]+)/i,/^(?::\s(?:[^:\n]|:(?!\s))+)/i,/^(?:[^#:\n]+)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[14,15],inclusive:!1},acc_descr:{rules:[12],inclusive:!1},acc_title:{rules:[10],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,11,13,16,17,18,19,20],inclusive:!0}}};return f})();u.lexer=h;function d(){this.yy={}}return T(d,"Parser"),d.prototype=u,u.Parser=d,new d})();dG.parser=dG;var Ivt=dG,hwe={};S4(hwe,{addEvent:()=>Twe,addSection:()=>ywe,addTask:()=>xwe,addTaskOrg:()=>wwe,clear:()=>pwe,default:()=>Dvt,getCommonDb:()=>fwe,getDirection:()=>mwe,getSections:()=>vwe,getTasks:()=>bwe,setDirection:()=>gwe});var B1="",dwe=0,fG="LR",pG=[],IA=[],F1=[],fwe=T(()=>R7,"getCommonDb"),pwe=T(function(){pG.length=0,IA.length=0,B1="",F1.length=0,fG="LR",Hn()},"clear"),gwe=T(function(t){fG=t},"setDirection"),mwe=T(function(){return fG},"getDirection"),ywe=T(function(t){B1=t,pG.push(t)},"addSection"),vwe=T(function(){return pG},"getSections"),bwe=T(function(){let t=Cwe();const e=100;let r=0;for(;!t&&rr.id===dwe-1).events.push(t)},"addEvent"),wwe=T(function(t){const e={section:B1,type:B1,description:t,task:t,classes:[]};IA.push(e)},"addTaskOrg"),Cwe=T(function(){const t=T(function(r){return F1[r].processed},"compileTask");let e=!0;for(const[r,n]of F1.entries())t(r),e=e&&n.processed;return e},"compileTasks"),Dvt={clear:pwe,getCommonDb:fwe,getDirection:mwe,setDirection:gwe,addSection:ywe,getSections:vwe,getTasks:bwe,addTask:xwe,addTaskOrg:wwe,addEvent:Twe},kwe=0,DA=T(function(t,e){const r=t.append("rect");return r.attr("x",e.x),r.attr("y",e.y),r.attr("fill",e.fill),r.attr("stroke",e.stroke),r.attr("width",e.width),r.attr("height",e.height),r.attr("rx",e.rx),r.attr("ry",e.ry),e.class!==void 0&&r.attr("class",e.class),r},"drawRect"),Mvt=T(function(t,e){const n=t.append("circle").attr("cx",e.cx).attr("cy",e.cy).attr("class","face").attr("r",15).attr("stroke-width",2).attr("overflow","visible"),i=t.append("g");i.append("circle").attr("cx",e.cx-15/3).attr("cy",e.cy-15/3).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),i.append("circle").attr("cx",e.cx+15/3).attr("cy",e.cy-15/3).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666");function a(l){const u=J0().startAngle(Math.PI/2).endAngle(3*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);l.append("path").attr("class","mouth").attr("d",u).attr("transform","translate("+e.cx+","+(e.cy+2)+")")}T(a,"smile");function s(l){const u=J0().startAngle(3*Math.PI/2).endAngle(5*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);l.append("path").attr("class","mouth").attr("d",u).attr("transform","translate("+e.cx+","+(e.cy+7)+")")}T(s,"sad");function o(l){l.append("line").attr("class","mouth").attr("stroke",2).attr("x1",e.cx-5).attr("y1",e.cy+7).attr("x2",e.cx+5).attr("y2",e.cy+7).attr("class","mouth").attr("stroke-width","1px").attr("stroke","#666")}return T(o,"ambivalent"),e.score>3?a(i):e.score<3?s(i):o(i),n},"drawFace"),Nvt=T(function(t,e){const r=t.append("circle");return r.attr("cx",e.cx),r.attr("cy",e.cy),r.attr("class","actor-"+e.pos),r.attr("fill",e.fill),r.attr("stroke",e.stroke),r.attr("r",e.r),r.class!==void 0&&r.attr("class",r.class),e.title!==void 0&&r.append("title").text(e.title),r},"drawCircle"),Ewe=T(function(t,e){const r=e.text.replace(//gi," "),n=t.append("text");n.attr("x",e.x),n.attr("y",e.y),n.attr("class","legend"),n.style("text-anchor",e.anchor),e.class!==void 0&&n.attr("class",e.class);const i=n.append("tspan");return i.attr("x",e.x+e.textMargin*2),i.text(r),n},"drawText"),$vt=T(function(t,e){function r(i,a,s,o,l){return i+","+a+" "+(i+s)+","+a+" "+(i+s)+","+(a+o-l)+" "+(i+s-l*1.2)+","+(a+o)+" "+i+","+(a+o)}T(r,"genPoints");const n=t.append("polygon");n.attr("points",r(e.x,e.y,50,20,7)),n.attr("class","labelBox"),e.y=e.y+e.labelMargin,e.x=e.x+.5*e.labelMargin,Ewe(t,e)},"drawLabel"),Ovt=T(function(t,e,r){const n=t.append("g"),i=mG();i.x=e.x,i.y=e.y,i.fill=e.fill,i.width=r.width,i.height=r.height,i.class="journey-section section-type-"+e.num,i.rx=3,i.ry=3,DA(n,i),Swe(r)(e.text,n,i.x,i.y,i.width,i.height,{class:"journey-section section-type-"+e.num},r,e.colour)},"drawSection"),gG=-1,Pvt=T(function(t,e,r,n){const i=e.x+r.width/2,a=t.append("g");gG++,a.append("line").attr("id",n+"-task"+gG).attr("x1",i).attr("y1",e.y).attr("x2",i).attr("y2",450).attr("class","task-line").attr("stroke-width","1px").attr("stroke-dasharray","4 2").attr("stroke","#666"),Mvt(a,{cx:i,cy:300+(5-e.score)*30,score:e.score});const o=mG();o.x=e.x,o.y=e.y,o.fill=e.fill,o.width=r.width,o.height=r.height,o.class="task task-type-"+e.num,o.rx=3,o.ry=3,DA(a,o),Swe(r)(e.task,a,o.x,o.y,o.width,o.height,{class:"task"},r,e.colour)},"drawTask"),Bvt=T(function(t,e){DA(t,{x:e.startx,y:e.starty,width:e.stopx-e.startx,height:e.stopy-e.starty,fill:e.fill,class:"rect"}).lower()},"drawBackgroundRect"),Fvt=T(function(){return{x:0,y:0,fill:void 0,"text-anchor":"start",width:100,height:100,textMargin:0,rx:0,ry:0}},"getTextObj"),mG=T(function(){return{x:0,y:0,width:100,anchor:"start",height:100,rx:0,ry:0}},"getNoteRect"),Swe=(function(){function t(i,a,s,o,l,u,h,d){const f=a.append("text").attr("x",s+l/2).attr("y",o+u/2+5).style("font-color",d).style("text-anchor","middle").text(i);n(f,h)}T(t,"byText");function e(i,a,s,o,l,u,h,d,f){const{taskFontSize:p,taskFontFamily:g}=d,m=i.split(//gi);for(let y=0;y)/).reverse(),i,a=[],s=1.1,o=r.attr("y"),l=parseFloat(r.attr("dy")),u=r.text(null).append("tspan").attr("x",0).attr("y",o).attr("dy",l+"em");for(let h=0;he||i==="
    ")&&(a.pop(),u.text(a.join(" ").trim()),i==="
    "?a=[""]:a=[i],u=r.append("tspan").attr("x",0).attr("y",o).attr("dy",s+"em").text(i))})}T(yG,"wrap");var Gvt=T(function(t,e,r,n,i,a=!1){var v,x,b;const{theme:s,look:o}=n,l=s==null?void 0:s.includes("redux"),u=((v=n==null?void 0:n.themeVariables)==null?void 0:v.THEME_COLOR_LIMIT)??12,h=r%u-1,d=t.append("g");e.section=h,d.attr("class",(e.class?e.class+" ":"")+"timeline-node "+("section-"+h));const f=d.append("g"),p=d.append("g"),m=p.append("text").text(e.descr).attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle").call(yG,e.width).node().getBBox(),y=(x=n.fontSize)!=null&&x.replace?n.fontSize.replace("px",""):n.fontSize;if(e.height=m.height+y*1.1*.5+e.padding,e.height=Math.max(e.height,e.maxHeight),e.width=e.width+2*e.padding,p.attr("transform","translate("+e.width/2+", "+e.padding/2+")"),l&&p.attr("transform",`translate(${e.width/2}, ${a?e.padding/2+3:e.padding})`),Vvt(f,e,h,i,n),o==="neo"&&(d.attr("data-look","neo"),l)){const w=s.includes("dark"),C=((b=t.node())==null?void 0:b.ownerSVGElement)??t.node(),_=gt(C),k=_.attr("id")??"",S=k?`${k}-drop-shadow`:"drop-shadow";if(_.select(`#${S}`).empty()){const L=_.select("defs");(L.empty()?_.append("defs"):L).append("filter").attr("id",S).attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity",w?"0.2":"0.06").attr("flood-color",w?"#FFFFFF":"#000000")}}return e},"drawNode"),qvt=T(function(t,e,r){var o;const n=t.append("g"),a=n.append("text").text(e.descr).attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle").call(yG,e.width).node().getBBox(),s=(o=r.fontSize)!=null&&o.replace?r.fontSize.replace("px",""):r.fontSize;return n.remove(),a.height+s*1.1*.5+e.padding},"getVirtualNodeHeight"),Vvt=T(function(t,e,r,n,i){const{theme:a}=i,s=a!=null&&a.includes("redux")?0:5,o=5,l=s>0?`M0 ${e.height-o} v${-e.height+2*o} q0,-${s},${s},-${s} h${e.width-2*o} q${s},0,${s},${s} v${e.height-o} H0 Z`:`M0 ${e.height-o} v${-(e.height-o)} h${e.width} v${e.height} H0 Z`;t.append("path").attr("id",n+"-node-"+kwe++).attr("class","node-bkg node-"+e.type).attr("d",l),a!=null&&a.includes("redux")||t.append("line").attr("class","node-line-"+r).attr("x1",0).attr("y1",e.height).attr("x2",e.width).attr("y2",e.height)},"defaultBkg"),uo={drawRect:DA,drawCircle:Nvt,drawSection:Ovt,drawText:Ewe,drawLabel:$vt,drawTask:Pvt,drawBackgroundRect:Bvt,getTextObj:Fvt,getNoteRect:mG,initGraphics:zvt,drawNode:Gvt,getVirtualNodeHeight:qvt},Wvt=T(function(t,e,r,n){var R,N,M;const i=Pe(),{look:a,theme:s,themeVariables:o}=i,{useGradient:l,gradientStart:u,gradientStop:h}=o,d=((R=i.timeline)==null?void 0:R.leftMargin)??50;se.debug("timeline",n.db);const f=i.securityLevel;let p;f==="sandbox"&&(p=gt("#i"+e));const m=gt(f==="sandbox"?p.nodes()[0].contentDocument.body:"body").select("#"+e);m.append("g");const y=n.db.getTasks(),v=n.db.getCommonDb().getDiagramTitle();se.debug("task",y),uo.initGraphics(m,e);const x=n.db.getSections();se.debug("sections",x);let b=0,w=0,C=0,_=0,k=50+d,S=50;_=50;let L=0,$=!0;x.forEach(function(D){const O={number:L,descr:D,section:L,width:150,padding:20,maxHeight:b},B=uo.getVirtualNodeHeight(m,O,i);se.debug("sectionHeight before draw",B),b=Math.max(b,B+20)});let I=0,z=0;se.debug("tasks.length",y.length);for(const[D,O]of y.entries()){const B={number:D,descr:O,section:O.section,width:150,padding:20,maxHeight:w},P=uo.getVirtualNodeHeight(m,B,i);se.debug("taskHeight before draw",P),w=Math.max(w,P+20),I=Math.max(I,O.events.length);let G=0;for(const V of O.events){const H={descr:V,section:O.section,number:O.section,width:150,padding:20,maxHeight:50};G+=uo.getVirtualNodeHeight(m,H,i)}O.events.length>0&&(G+=(O.events.length-1)*10),z=Math.max(z,G)}se.debug("maxSectionHeight before draw",b),se.debug("maxTaskHeight before draw",w),x&&x.length>0?x.forEach(D=>{const O=y.filter(V=>V.section===D),B={number:L,descr:D,section:L,width:200*Math.max(O.length,1)-50,padding:20,maxHeight:b};se.debug("sectionNode",B);const P=m.append("g"),G=uo.drawNode(P,B,L,i,e);se.debug("sectionNode output",G),P.attr("transform",`translate(${k}, ${_})`),S+=b+50,O.length>0&&_we(m,O,L,k,S,w,i,I,z,b,!1,e),k+=200*Math.max(O.length,1),S=_,L++}):($=!1,_we(m,y,L,k,S,w,i,I,z,b,!0,e));const F=m.node().getBBox();if(se.debug("bounds",F),v&&m.append("text").text(v).attr("x",a==="neo"?F.x*2+d:F.width/2-d).attr("font-size","4ex").attr("font-weight","bold").attr("y",20),C=$?b+w+150:w+100,m.append("g").attr("class","lineWrapper").append("line").attr("x1",d).attr("y1",C).attr("x2",F.width+3*d).attr("y2",C).attr("stroke-width",4).attr("stroke","black").attr("marker-end",`url(#${e}-arrowhead)`),a==="neo"&&l&&s!=="neutral"){const D=m.select("defs"),B=(D.empty()?m.append("defs"):D).append("linearGradient").attr("id",m.attr("id")+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");B.append("stop").attr("offset","0%").attr("stop-color",u).attr("stop-opacity",1),B.append("stop").attr("offset","100%").attr("stop-color",h).attr("stop-opacity",1)}G0(void 0,m,((N=i.timeline)==null?void 0:N.padding)??50,((M=i.timeline)==null?void 0:M.useMaxWidth)??!1)},"draw"),_we=T(function(t,e,r,n,i,a,s,o,l,u,h,d){var f;for(const p of e){const g={descr:p.task,section:r,number:r,width:150,padding:20,maxHeight:a};se.debug("taskNode",g);const m=t.append("g").attr("class","taskWrapper"),v=uo.drawNode(m,g,r,s,d).height;if(se.debug("taskHeight after draw",v),m.attr("transform",`translate(${n}, ${i})`),a=Math.max(a,v),p.events){const x=t.append("g").attr("class","lineWrapper");let b=a;i+=100,b=b+Uvt(t,p.events,r,n,i,s,d),i-=100,x.append("line").attr("x1",n+190/2).attr("y1",i+a).attr("x2",n+190/2).attr("y2",i+a+100+l+100).attr("stroke-width",2).attr("stroke","black").attr("marker-end",`url(#${d}-arrowhead)`).attr("stroke-dasharray","5,5")}n=n+200,h&&!((f=s.timeline)!=null&&f.disableMulticolor)&&r++}i=i-10},"drawTasks"),Uvt=T(function(t,e,r,n,i,a,s){let o=0;const l=i;i=i+100;for(const u of e){const h={descr:u,section:r,number:r,width:150,padding:20,maxHeight:50};se.debug("eventNode",h);const d=t.append("g").attr("class","eventWrapper"),p=uo.drawNode(d,h,r,a,s,!0).height;o=o+p,d.attr("transform",`translate(${n}, ${i})`),i=i+10+p}return i=l,o},"drawEvents"),Hvt={setConf:T(()=>{},"setConf"),draw:Wvt},MA=200,gh=5,Yvt=MA+gh*2,vG=MA+100,Xvt=vG+gh*2,Awe=10,jvt=0,Rwe=20,Lwe=20,Iwe=30,Dwe=50,Kvt=T(function(t,e,r,n){var R,N,M,D,O;const i=Pe(),a=((R=i.timeline)==null?void 0:R.leftMargin)??50;se.debug("timeline",n.db);const s=Ys(e);s.append("g");const o=n.db.getTasks(),l=n.db.getCommonDb().getDiagramTitle();se.debug("task",o),uo.initGraphics(s);const u=n.db.getSections();se.debug("sections",u);let h=0,d=0;const f=50+a;let p=50;const g=p,m=f,y=Yvt+Lwe,v=Xvt+Dwe,x=m+y;let b=0;const w=u&&u.length>0,C=w?x:f+y,_=Math.max(50,y+v-gh*2);u.forEach(function(B){const P={number:b,descr:B,section:b,width:_,padding:gh,maxHeight:h},G=uo.getVirtualNodeHeight(s,P,i);se.debug("sectionHeight before draw",G),h=Math.max(h,G)});let k=0;se.debug("tasks.length",o.length);for(const[B,P]of o.entries()){const G={number:B,descr:P,section:P.section,width:MA,padding:gh,maxHeight:d},V=uo.getVirtualNodeHeight(s,G,i);se.debug("taskHeight before draw",V),d=Math.max(d,V);let H=0;for(const W of P.events){const ie={descr:W,section:P.section,number:P.section,width:vG,padding:gh,maxHeight:50};H+=uo.getVirtualNodeHeight(s,ie,i)}P.events.length>0&&(H+=(P.events.length-1)*Awe),k=Math.max(k,H)+jvt}se.debug("maxSectionHeight before draw",h),se.debug("maxTaskHeight before draw",d);const L=Math.max(d,k)+Iwe;w?u.forEach(B=>{const P=o.filter(J=>J.section===B),G={number:b,descr:B,section:b,width:_,padding:gh,maxHeight:h};se.debug("sectionNode",G);const V=s.append("g"),H=uo.drawNode(V,G,b,i);se.debug("sectionNode output",H);const W=C-y;V.attr("transform",`translate(${W}, ${p})`);const ie=p+H.height+Rwe;P.length>0&&Mwe(s,P,b,C,ie,d,i,L,!1);const j=P.length,ae=H.height+Rwe+L*Math.max(j,1)-(j>0?Iwe*2:0);p+=ae,b++}):Mwe(s,o,b,C,p,d,i,L,!0);let $=(N=s.node())==null?void 0:N.getBBox();if(!$)throw new Error("bbox not found");if(se.debug("bounds",$),l){if(s.append("text").text(l).attr("x",$.width/2-a).attr("font-size","4ex").attr("font-weight","bold").attr("y",20),$=(M=s.node())==null?void 0:M.getBBox(),!$)throw new Error("bbox not found");se.debug("bounds after title",$)}const[I]=cu(i.fontSize),z=(I??16)*2,F=(I??16)*.5+20,A=s.append("g").attr("class","lineWrapper");A.append("line").attr("x1",C).attr("y1",g-z).attr("x2",C).attr("y2",$.y+$.height+F).attr("stroke-width",4).attr("stroke","black").attr("marker-end","url(#arrowhead)"),A.lower(),G0(void 0,s,((D=i.timeline)==null?void 0:D.padding)??50,((O=i.timeline)==null?void 0:O.useMaxWidth)??!1)},"draw"),Mwe=T(function(t,e,r,n,i,a,s,o,l){var u;for(const h of e){const d={descr:h.task,section:r,number:r,width:MA,padding:gh,maxHeight:a};se.debug("taskNode",d);const f=t.append("g").attr("class","taskWrapper"),p=uo.drawNode(f,d,r,s),g=p.height;se.debug("taskHeight after draw",g);const m=n-Lwe-p.width;if(f.attr("transform",`translate(${m}, ${i})`),a=Math.max(a,g),h.events&&h.events.length>0){const y=i,v=n+Dwe;Zvt(t,h.events,r,n,v,y,s)}i=i+o,l&&!((u=s.timeline)!=null&&u.disableMulticolor)&&r++}},"drawTasks"),Zvt=T(function(t,e,r,n,i,a,s){let o=a;for(const l of e){const u={descr:l,section:r,number:r,width:vG,padding:gh,maxHeight:0};se.debug("eventNode",u);const h=t.append("g").attr("class","eventWrapper"),f=uo.drawNode(h,u,r,s).height;h.attr("transform",`translate(${i}, ${o})`);const p=t.append("g").attr("class","lineWrapper"),g=o+f/2;p.append("line").attr("x1",n).attr("y1",g).attr("x2",i).attr("y2",g).attr("stroke-width",2).attr("stroke","black").attr("marker-end","url(#arrowhead)").attr("stroke-dasharray","5,5"),o=o+f+Awe}return o-a},"drawEvents"),Qvt={setConf:T(()=>{},"setConf"),draw:Kvt},Jvt=T(t=>{var o;const{theme:e}=pr(),r=e==null?void 0:e.includes("dark"),n=e==null?void 0:e.includes("color"),i=((o=t.svgId)==null?void 0:o.replace(/^#/,""))??"",a=i?`url(#${i}-drop-shadow)`:t.dropShadow??"none";let s="";for(let l=0;l{let e="";for(let r=0;r{let e="";for(let r=0;r{var s;const{theme:e}=lr(),r=e==null?void 0:e.includes("redux"),n=e==="neutral",i=((s=t.svgId)==null?void 0:s.replace(/^#/,""))??"";let a="";if(t.useGradient&&i&&t.THEME_COLOR_LIMIT&&!n)for(let o=0;o{var s;const{theme:e}=pr(),r=e==null?void 0:e.includes("redux"),n=e==="neutral",i=((s=t.svgId)==null?void 0:s.replace(/^#/,""))??"";let a="";if(t.useGradient&&i&&t.THEME_COLOR_LIMIT&&!n)for(let o=0;o{},"setConf"),draw:x((t,e,r,n)=>{var a,s;return(((s=(a=n==null?void 0:n.db)==null?void 0:a.getDirection)==null?void 0:s.call(a))??"LR")==="TD"?dht.draw(t,e,r,n):sht.draw(t,e,r,n)},"draw")},vht={db:Xme,renderer:yht,parser:Uut,styles:mht};const bht=Object.freeze(Object.defineProperty({__proto__:null,diagram:vht},Symbol.toStringTag,{value:"Module"})),Ca=[];for(let t=0;t<256;++t)Ca.push((t+256).toString(16).slice(1));function xht(t,e=0){return(Ca[t[e+0]]+Ca[t[e+1]]+Ca[t[e+2]]+Ca[t[e+3]]+"-"+Ca[t[e+4]]+Ca[t[e+5]]+"-"+Ca[t[e+6]]+Ca[t[e+7]]+"-"+Ca[t[e+8]]+Ca[t[e+9]]+"-"+Ca[t[e+10]]+Ca[t[e+11]]+Ca[t[e+12]]+Ca[t[e+13]]+Ca[t[e+14]]+Ca[t[e+15]]).toLowerCase()}const Tht=new Uint8Array(16);function wht(){return crypto.getRandomValues(Tht)}function Cht(t,e,r){return crypto.randomUUID?crypto.randomUUID():kht(t)}function kht(t,e,r){var i;t=t||{};const n=t.random??((i=t.rng)==null?void 0:i.call(t))??wht();if(n.length<16)throw new Error("Random bytes length must be >= 16");return n[6]=n[6]&15|64,n[8]=n[8]&63|128,xht(n)}var W$=(function(){var t=x(function(w,k,A,C){for(A=A||{},C=w.length;C--;A[w[C]]=k);return A},"o"),e=[1,4],r=[1,13],n=[1,12],i=[1,15],a=[1,16],s=[1,20],o=[1,19],l=[6,7,8],u=[1,26],h=[1,24],d=[1,25],f=[6,7,11],p=[1,6,13,15,16,19,22],g=[1,33],m=[1,34],y=[1,6,7,11,13,15,16,19,22],v={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,MINDMAP:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,ICON:15,CLASS:16,nodeWithId:17,nodeWithoutId:18,NODE_DSTART:19,NODE_DESCR:20,NODE_DEND:21,NODE_ID:22,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"MINDMAP",11:"EOF",13:"SPACELIST",15:"ICON",16:"CLASS",19:"NODE_DSTART",20:"NODE_DESCR",21:"NODE_DEND",22:"NODE_ID"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[18,3],[17,1],[17,4]],performAction:x(function(k,A,C,_,L,O,M){var z=O.length-1;switch(L){case 6:case 7:return _;case 8:_.getLogger().trace("Stop NL ");break;case 9:_.getLogger().trace("Stop EOF ");break;case 11:_.getLogger().trace("Stop NL2 ");break;case 12:_.getLogger().trace("Stop EOF2 ");break;case 15:_.getLogger().info("Node: ",O[z].id),_.addNode(O[z-1].length,O[z].id,O[z].descr,O[z].type);break;case 16:_.getLogger().trace("Icon: ",O[z]),_.decorateNode({icon:O[z]});break;case 17:case 21:_.decorateNode({class:O[z]});break;case 18:_.getLogger().trace("SPACELIST");break;case 19:_.getLogger().trace("Node: ",O[z].id),_.addNode(0,O[z].id,O[z].descr,O[z].type);break;case 20:_.decorateNode({icon:O[z]});break;case 25:_.getLogger().trace("node found ..",O[z-2]),this.$={id:O[z-1],descr:O[z-1],type:_.getType(O[z-2],O[z])};break;case 26:this.$={id:O[z],descr:O[z],type:_.nodeType.DEFAULT};break;case 27:_.getLogger().trace("node found ..",O[z-3]),this.$={id:O[z-3],descr:O[z-1],type:_.getType(O[z-2],O[z])};break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:e},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:e},{6:r,7:[1,10],9:9,12:11,13:n,14:14,15:i,16:a,17:17,18:18,19:s,22:o},t(l,[2,3]),{1:[2,2]},t(l,[2,4]),t(l,[2,5]),{1:[2,6],6:r,12:21,13:n,14:14,15:i,16:a,17:17,18:18,19:s,22:o},{6:r,9:22,12:11,13:n,14:14,15:i,16:a,17:17,18:18,19:s,22:o},{6:u,7:h,10:23,11:d},t(f,[2,22],{17:17,18:18,14:27,15:[1,28],16:[1,29],19:s,22:o}),t(f,[2,18]),t(f,[2,19]),t(f,[2,20]),t(f,[2,21]),t(f,[2,23]),t(f,[2,24]),t(f,[2,26],{19:[1,30]}),{20:[1,31]},{6:u,7:h,10:32,11:d},{1:[2,7],6:r,12:21,13:n,14:14,15:i,16:a,17:17,18:18,19:s,22:o},t(p,[2,14],{7:g,11:m}),t(y,[2,8]),t(y,[2,9]),t(y,[2,10]),t(f,[2,15]),t(f,[2,16]),t(f,[2,17]),{20:[1,35]},{21:[1,36]},t(p,[2,13],{7:g,11:m}),t(y,[2,11]),t(y,[2,12]),{21:[1,37]},t(f,[2,25]),t(f,[2,27])],defaultActions:{2:[2,1],6:[2,2]},parseError:x(function(k,A){if(A.recoverable)this.trace(k);else{var C=new Error(k);throw C.hash=A,C}},"parseError"),parse:x(function(k){var A=this,C=[0],_=[],L=[null],O=[],M=this.table,z="",F=0,S=0,R=2,N=1,D=O.slice.call(arguments,1),I=Object.create(this.lexer),$={yy:{}};for(var B in this.yy)Object.prototype.hasOwnProperty.call(this.yy,B)&&($.yy[B]=this.yy[B]);I.setInput(k,$.yy),$.yy.lexer=I,$.yy.parser=this,typeof I.yylloc>"u"&&(I.yylloc={});var P=I.yylloc;O.push(P);var G=I.options&&I.options.ranges;typeof $.yy.parseError=="function"?this.parseError=$.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function V(_e){C.length=C.length-2*_e,L.length=L.length-_e,O.length=O.length-_e}x(V,"popStack");function Y(){var _e;return _e=_.pop()||I.lex()||N,typeof _e!="number"&&(_e instanceof Array&&(_=_e,_e=_.pop()),_e=A.symbols_[_e]||_e),_e}x(Y,"lex");for(var W,ie,K,se,J={},Z,ee,ne,ue;;){if(ie=C[C.length-1],this.defaultActions[ie]?K=this.defaultActions[ie]:((W===null||typeof W>"u")&&(W=Y()),K=M[ie]&&M[ie][W]),typeof K>"u"||!K.length||!K[0]){var fe="";ue=[];for(Z in M[ie])this.terminals_[Z]&&Z>R&&ue.push("'"+this.terminals_[Z]+"'");I.showPosition?fe="Parse error on line "+(F+1)+`: -`+I.showPosition()+` -Expecting `+ue.join(", ")+", got '"+(this.terminals_[W]||W)+"'":fe="Parse error on line "+(F+1)+": Unexpected "+(W==N?"end of input":"'"+(this.terminals_[W]||W)+"'"),this.parseError(fe,{text:I.match,token:this.terminals_[W]||W,line:I.yylineno,loc:P,expected:ue})}if(K[0]instanceof Array&&K.length>1)throw new Error("Parse Error: multiple actions possible at state: "+ie+", token: "+W);switch(K[0]){case 1:C.push(W),L.push(I.yytext),O.push(I.yylloc),C.push(K[1]),W=null,S=I.yyleng,z=I.yytext,F=I.yylineno,P=I.yylloc;break;case 2:if(ee=this.productions_[K[1]][1],J.$=L[L.length-ee],J._$={first_line:O[O.length-(ee||1)].first_line,last_line:O[O.length-1].last_line,first_column:O[O.length-(ee||1)].first_column,last_column:O[O.length-1].last_column},G&&(J._$.range=[O[O.length-(ee||1)].range[0],O[O.length-1].range[1]]),se=this.performAction.apply(J,[z,S,F,$.yy,K[1],L,O].concat(D)),typeof se<"u")return se;ee&&(C=C.slice(0,-1*ee*2),L=L.slice(0,-1*ee),O=O.slice(0,-1*ee)),C.push(this.productions_[K[1]][0]),L.push(J.$),O.push(J._$),ne=M[C[C.length-2]][C[C.length-1]],C.push(ne);break;case 3:return!0}}return!0},"parse")},T=(function(){var w={EOF:1,parseError:x(function(A,C){if(this.yy.parser)this.yy.parser.parseError(A,C);else throw new Error(A)},"parseError"),setInput:x(function(k,A){return this.yy=A||this.yy||{},this._input=k,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:x(function(){var k=this._input[0];this.yytext+=k,this.yyleng++,this.offset++,this.match+=k,this.matched+=k;var A=k.match(/(?:\r\n?|\n).*/g);return A?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),k},"input"),unput:x(function(k){var A=k.length,C=k.split(/(?:\r\n?|\n)/g);this._input=k+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-A),this.offset-=A;var _=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),C.length-1&&(this.yylineno-=C.length-1);var L=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:C?(C.length===_.length?this.yylloc.first_column:0)+_[_.length-C.length].length-C[0].length:this.yylloc.first_column-A},this.options.ranges&&(this.yylloc.range=[L[0],L[0]+this.yyleng-A]),this.yyleng=this.yytext.length,this},"unput"),more:x(function(){return this._more=!0,this},"more"),reject:x(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). -`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:x(function(k){this.unput(this.match.slice(k))},"less"),pastInput:x(function(){var k=this.matched.substr(0,this.matched.length-this.match.length);return(k.length>20?"...":"")+k.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:x(function(){var k=this.match;return k.length<20&&(k+=this._input.substr(0,20-k.length)),(k.substr(0,20)+(k.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:x(function(){var k=this.pastInput(),A=new Array(k.length+1).join("-");return k+this.upcomingInput()+` -`+A+"^"},"showPosition"),test_match:x(function(k,A){var C,_,L;if(this.options.backtrack_lexer&&(L={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&&(L.yylloc.range=this.yylloc.range.slice(0))),_=k[0].match(/(?:\r\n?|\n).*/g),_&&(this.yylineno+=_.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:_?_[_.length-1].length-_[_.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+k[0].length},this.yytext+=k[0],this.match+=k[0],this.matches=k,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(k[0].length),this.matched+=k[0],C=this.performAction.call(this,this.yy,this,A,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),C)return C;if(this._backtrack){for(var O in L)this[O]=L[O];return!1}return!1},"test_match"),next:x(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var k,A,C,_;this._more||(this.yytext="",this.match="");for(var L=this._currentRules(),O=0;OA[0].length)){if(A=C,_=O,this.options.backtrack_lexer){if(k=this.test_match(C,L[O]),k!==!1)return k;if(this._backtrack){A=!1;continue}else return!1}else if(!this.options.flex)break}return A?(k=this.test_match(A,L[_]),k!==!1?k:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var A=this.next();return A||this.lex()},"lex"),begin:x(function(A){this.conditionStack.push(A)},"begin"),popState:x(function(){var A=this.conditionStack.length-1;return A>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(A){return A=this.conditionStack.length-1-Math.abs(A||0),A>=0?this.conditionStack[A]:"INITIAL"},"topState"),pushState:x(function(A){this.begin(A)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:x(function(A,C,_,L){switch(_){case 0:return A.getLogger().trace("Found comment",C.yytext),6;case 1:return 8;case 2:this.begin("CLASS");break;case 3:return this.popState(),16;case 4:this.popState();break;case 5:A.getLogger().trace("Begin icon"),this.begin("ICON");break;case 6:return A.getLogger().trace("SPACELINE"),6;case 7:return 7;case 8:return 15;case 9:A.getLogger().trace("end icon"),this.popState();break;case 10:return A.getLogger().trace("Exploding node"),this.begin("NODE"),19;case 11:return A.getLogger().trace("Cloud"),this.begin("NODE"),19;case 12:return A.getLogger().trace("Explosion Bang"),this.begin("NODE"),19;case 13:return A.getLogger().trace("Cloud Bang"),this.begin("NODE"),19;case 14:return this.begin("NODE"),19;case 15:return this.begin("NODE"),19;case 16:return this.begin("NODE"),19;case 17:return this.begin("NODE"),19;case 18:return 13;case 19:return 22;case 20:return 11;case 21:this.begin("NSTR2");break;case 22:return"NODE_DESCR";case 23:this.popState();break;case 24:A.getLogger().trace("Starting NSTR"),this.begin("NSTR");break;case 25:return A.getLogger().trace("description:",C.yytext),"NODE_DESCR";case 26:this.popState();break;case 27:return this.popState(),A.getLogger().trace("node end ))"),"NODE_DEND";case 28:return this.popState(),A.getLogger().trace("node end )"),"NODE_DEND";case 29:return this.popState(),A.getLogger().trace("node end ...",C.yytext),"NODE_DEND";case 30:return this.popState(),A.getLogger().trace("node end (("),"NODE_DEND";case 31:return this.popState(),A.getLogger().trace("node end (-"),"NODE_DEND";case 32:return this.popState(),A.getLogger().trace("node end (-"),"NODE_DEND";case 33:return this.popState(),A.getLogger().trace("node end (("),"NODE_DEND";case 34:return this.popState(),A.getLogger().trace("node end (("),"NODE_DEND";case 35:return A.getLogger().trace("Long description:",C.yytext),20;case 36:return A.getLogger().trace("Long description:",C.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 w})();v.lexer=T;function b(){this.yy={}}return x(b,"Parser"),b.prototype=v,v.Parser=b,new b})();W$.parser=W$;var Eht=W$,Sht=12,yu={DEFAULT:0,NO_BORDER:0,ROUNDED_RECT:1,RECT:2,CIRCLE:3,CLOUD:4,BANG:5,HEXAGON:6},Aht=(qv=class{constructor(){this.nodes=[],this.count=0,this.elements={},this.getLogger=this.getLogger.bind(this),this.nodeType=yu,this.clear(),this.getType=this.getType.bind(this),this.getElementById=this.getElementById.bind(this),this.getParent=this.getParent.bind(this),this.getMindmap=this.getMindmap.bind(this),this.addNode=this.addNode.bind(this),this.decorateNode=this.decorateNode.bind(this)}clear(){this.nodes=[],this.count=0,this.elements={},this.baseLevel=void 0}getParent(e){for(let r=this.nodes.length-1;r>=0;r--)if(this.nodes[r].level0?this.nodes[0]:null}addNode(e,r,n,i){var h,d;ae.info("addNode",e,r,n,i);let a=!1;this.nodes.length===0?(this.baseLevel=e,e=0,a=!0):this.baseLevel!==void 0&&(e=e-this.baseLevel,a=!1);const s=Pe();let o=((h=s.mindmap)==null?void 0:h.padding)??Fr.mindmap.padding;switch(i){case this.nodeType.ROUNDED_RECT:case this.nodeType.RECT:case this.nodeType.HEXAGON:o*=2;break}const l={id:this.count++,nodeId:qr(r,s),level:e,descr:qr(n,s),type:i,children:[],width:((d=s.mindmap)==null?void 0:d.maxNodeWidth)??Fr.mindmap.maxNodeWidth,padding:o,isRoot:a},u=this.getParent(e);if(u)u.children.push(l),this.nodes.push(l);else if(a)this.nodes.push(l);else throw new Error(`There can be only one root. No parent could be found for ("${l.descr}")`)}getType(e,r){switch(ae.debug("In get type",e,r),e){case"[":return this.nodeType.RECT;case"(":return r===")"?this.nodeType.ROUNDED_RECT:this.nodeType.CLOUD;case"((":return this.nodeType.CIRCLE;case")":return this.nodeType.CLOUD;case"))":return this.nodeType.BANG;case"{{":return this.nodeType.HEXAGON;default:return this.nodeType.DEFAULT}}setElementForId(e,r){this.elements[e]=r}getElementById(e){return this.elements[e]}decorateNode(e){if(!e)return;const r=Pe(),n=this.nodes[this.nodes.length-1];e.icon&&(n.icon=qr(e.icon,r)),e.class&&(n.class=qr(e.class,r))}type2Str(e){switch(e){case this.nodeType.DEFAULT:return"no-border";case this.nodeType.RECT:return"rect";case this.nodeType.ROUNDED_RECT:return"rounded-rect";case this.nodeType.CIRCLE:return"circle";case this.nodeType.CLOUD:return"cloud";case this.nodeType.BANG:return"bang";case this.nodeType.HEXAGON:return"hexgon";default:return"no-border"}}assignSections(e,r){if(e.level===0?e.section=void 0:e.section=r,e.children)for(const[n,i]of e.children.entries()){const a=e.level===0?n%(Sht-1):r;this.assignSections(i,a)}}flattenNodes(e,r){const n=Pe(),i=["mindmap-node"];e.isRoot===!0?i.push("section-root","section--1"):e.section!==void 0&&i.push(`section-${e.section}`),e.class&&i.push(e.class);const a=i.join(" "),s=x(l=>{var d;const h=(((d=n.theme)==null?void 0:d.toLowerCase())??"").includes("redux");switch(l){case yu.CIRCLE:return"mindmapCircle";case yu.RECT:return"rect";case yu.ROUNDED_RECT:return"rounded";case yu.CLOUD:return"cloud";case yu.BANG:return"bang";case yu.HEXAGON:return"hexagon";case yu.DEFAULT:return h?"rounded":"defaultMindmapNode";case yu.NO_BORDER:default:return"rect"}},"getShapeFromType"),o={id:e.id.toString(),domId:"node_"+e.id.toString(),label:e.descr,labelType:"markdown",isGroup:!1,shape:s(e.type),width:e.width,height:e.height??0,padding:e.padding,cssClasses:a,cssStyles:[],look:n.look,icon:e.icon,x:e.x,y:e.y,level:e.level,nodeId:e.nodeId,type:e.type,section:e.section};if(r.push(o),e.children)for(const l of e.children)this.flattenNodes(l,r)}generateEdges(e,r){if(!e.children)return;const n=Pe();for(const i of e.children){let a="edge";i.section!==void 0&&(a+=` section-edge-${i.section}`);const s=e.level+1;a+=` edge-depth-${s}`;const o={id:`edge_${e.id}_${i.id}`,start:e.id.toString(),end:i.id.toString(),type:"normal",curve:"basis",thickness:"normal",look:n.look,classes:a,depth:e.level,section:i.section};r.push(o),this.generateEdges(i,r)}}getData(){const e=this.getMindmap(),r=Pe(),i=oxe().layout!==void 0,a=r;if(i||(a.layout="cose-bilkent"),!e)return{nodes:[],edges:[],config:a};ae.debug("getData: mindmapRoot",e,r),this.assignSections(e);const s=[],o=[];this.flattenNodes(e,s),this.generateEdges(e,o),ae.debug(`getData: processed ${s.length} nodes and ${o.length} edges`);const l=new Map;for(const u of s)l.set(u.id,{shape:u.shape,width:u.width,height:u.height,padding:u.padding});return{nodes:s,edges:o,config:a,rootNode:e,markers:["point"],direction:"TB",nodeSpacing:50,rankSpacing:50,shapes:Object.fromEntries(l),type:"mindmap",diagramId:"mindmap-"+Cht()}}getLogger(){return ae}},x(qv,"MindmapDB"),qv),_ht=x(async(t,e,r,n)=>{var f,p;ae.debug(`Rendering mindmap diagram -`+t);const i=n.db,a=i.getData(),s=Xp(e,a.config.securityLevel);if(a.type=n.type,a.layoutAlgorithm=sb(a.config.layout,{fallback:"cose-bilkent"}),a.diagramId=e,!i.getMindmap())return;a.nodes.forEach(g=>{g.shape==="rounded"?(g.radius=15,g.taper=15,g.stroke="none",g.width=0,g.padding=15):g.shape==="circle"?g.padding=10:g.shape==="rect"?(g.width=0,g.padding=10):g.shape==="hexagon"&&(g.width=0,g.height=0)}),await Z0(a,s);const{themeVariables:l}=lr(),{useGradient:u,gradientStart:h,gradientStop:d}=l;if(u&&h&&d){const g=s.attr("id"),m=s.append("defs").append("linearGradient").attr("id",`${g}-gradient`).attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");m.append("stop").attr("offset","0%").attr("stop-color",h).attr("stop-opacity",1),m.append("stop").attr("offset","100%").attr("stop-color",d).attr("stop-opacity",1)}Wd(s,((f=a.config.mindmap)==null?void 0:f.padding)??Fr.mindmap.padding,"mindmapDiagram",((p=a.config.mindmap)==null?void 0:p.useMaxWidth)??Fr.mindmap.useMaxWidth)},"draw"),Rht={draw:_ht},Lht=x(t=>{const{theme:e,look:r}=t;let n="";for(let i=0;i{},"setConf"),draw:T((t,e,r,n)=>{var a,s;return(((s=(a=n==null?void 0:n.db)==null?void 0:a.getDirection)==null?void 0:s.call(a))??"LR")==="TD"?Qvt.draw(t,e,r,n):Hvt.draw(t,e,r,n)},"draw")},i2t={db:hwe,renderer:n2t,parser:Ivt,styles:r2t};const a2t=Object.freeze(Object.defineProperty({__proto__:null,diagram:i2t},Symbol.toStringTag,{value:"Module"})),Xa=[];for(let t=0;t<256;++t)Xa.push((t+256).toString(16).slice(1));function s2t(t,e=0){return(Xa[t[e+0]]+Xa[t[e+1]]+Xa[t[e+2]]+Xa[t[e+3]]+"-"+Xa[t[e+4]]+Xa[t[e+5]]+"-"+Xa[t[e+6]]+Xa[t[e+7]]+"-"+Xa[t[e+8]]+Xa[t[e+9]]+"-"+Xa[t[e+10]]+Xa[t[e+11]]+Xa[t[e+12]]+Xa[t[e+13]]+Xa[t[e+14]]+Xa[t[e+15]]).toLowerCase()}const o2t=new Uint8Array(16);function l2t(){return crypto.getRandomValues(o2t)}function c2t(t,e,r){return crypto.randomUUID?crypto.randomUUID():u2t(t)}function u2t(t,e,r){var i;t=t||{};const n=t.random??((i=t.rng)==null?void 0:i.call(t))??l2t();if(n.length<16)throw new Error("Random bytes length must be >= 16");return n[6]=n[6]&15|64,n[8]=n[8]&63|128,s2t(n)}var bG=(function(){var t=T(function(w,C,_,k){for(_=_||{},k=w.length;k--;_[w[k]]=C);return _},"o"),e=[1,4],r=[1,13],n=[1,12],i=[1,15],a=[1,16],s=[1,20],o=[1,19],l=[6,7,8],u=[1,26],h=[1,24],d=[1,25],f=[6,7,11],p=[1,6,13,15,16,19,22],g=[1,33],m=[1,34],y=[1,6,7,11,13,15,16,19,22],v={trace:T(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:T(function(C,_,k,S,L,$,I){var z=$.length-1;switch(L){case 6:case 7:return S;case 8:S.getLogger().trace("Stop NL ");break;case 9:S.getLogger().trace("Stop EOF ");break;case 11:S.getLogger().trace("Stop NL2 ");break;case 12:S.getLogger().trace("Stop EOF2 ");break;case 15:S.getLogger().info("Node: ",$[z].id),S.addNode($[z-1].length,$[z].id,$[z].descr,$[z].type);break;case 16:S.getLogger().trace("Icon: ",$[z]),S.decorateNode({icon:$[z]});break;case 17:case 21:S.decorateNode({class:$[z]});break;case 18:S.getLogger().trace("SPACELIST");break;case 19:S.getLogger().trace("Node: ",$[z].id),S.addNode(0,$[z].id,$[z].descr,$[z].type);break;case 20:S.decorateNode({icon:$[z]});break;case 25:S.getLogger().trace("node found ..",$[z-2]),this.$={id:$[z-1],descr:$[z-1],type:S.getType($[z-2],$[z])};break;case 26:this.$={id:$[z],descr:$[z],type:S.nodeType.DEFAULT};break;case 27:S.getLogger().trace("node found ..",$[z-3]),this.$={id:$[z-3],descr:$[z-1],type:S.getType($[z-2],$[z])};break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:e},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:e},{6:r,7:[1,10],9:9,12:11,13:n,14:14,15:i,16:a,17:17,18:18,19:s,22:o},t(l,[2,3]),{1:[2,2]},t(l,[2,4]),t(l,[2,5]),{1:[2,6],6:r,12:21,13:n,14:14,15:i,16:a,17:17,18:18,19:s,22:o},{6:r,9:22,12:11,13:n,14:14,15:i,16:a,17:17,18:18,19:s,22:o},{6:u,7:h,10:23,11:d},t(f,[2,22],{17:17,18:18,14:27,15:[1,28],16:[1,29],19:s,22:o}),t(f,[2,18]),t(f,[2,19]),t(f,[2,20]),t(f,[2,21]),t(f,[2,23]),t(f,[2,24]),t(f,[2,26],{19:[1,30]}),{20:[1,31]},{6:u,7:h,10:32,11:d},{1:[2,7],6:r,12:21,13:n,14:14,15:i,16:a,17:17,18:18,19:s,22:o},t(p,[2,14],{7:g,11:m}),t(y,[2,8]),t(y,[2,9]),t(y,[2,10]),t(f,[2,15]),t(f,[2,16]),t(f,[2,17]),{20:[1,35]},{21:[1,36]},t(p,[2,13],{7:g,11:m}),t(y,[2,11]),t(y,[2,12]),{21:[1,37]},t(f,[2,25]),t(f,[2,27])],defaultActions:{2:[2,1],6:[2,2]},parseError:T(function(C,_){if(_.recoverable)this.trace(C);else{var k=new Error(C);throw k.hash=_,k}},"parseError"),parse:T(function(C){var _=this,k=[0],S=[],L=[null],$=[],I=this.table,z="",F=0,A=0,R=2,N=1,M=$.slice.call(arguments,1),D=Object.create(this.lexer),O={yy:{}};for(var B in this.yy)Object.prototype.hasOwnProperty.call(this.yy,B)&&(O.yy[B]=this.yy[B]);D.setInput(C,O.yy),O.yy.lexer=D,O.yy.parser=this,typeof D.yylloc>"u"&&(D.yylloc={});var P=D.yylloc;$.push(P);var G=D.options&&D.options.ranges;typeof O.yy.parseError=="function"?this.parseError=O.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function V(Ae){k.length=k.length-2*Ae,L.length=L.length-Ae,$.length=$.length-Ae}T(V,"popStack");function H(){var Ae;return Ae=S.pop()||D.lex()||N,typeof Ae!="number"&&(Ae instanceof Array&&(S=Ae,Ae=S.pop()),Ae=_.symbols_[Ae]||Ae),Ae}T(H,"lex");for(var W,ie,j,ae,J={},K,Q,re,le;;){if(ie=k[k.length-1],this.defaultActions[ie]?j=this.defaultActions[ie]:((W===null||typeof W>"u")&&(W=H()),j=I[ie]&&I[ie][W]),typeof j>"u"||!j.length||!j[0]){var fe="";le=[];for(K in I[ie])this.terminals_[K]&&K>R&&le.push("'"+this.terminals_[K]+"'");D.showPosition?fe="Parse error on line "+(F+1)+`: +`+D.showPosition()+` +Expecting `+le.join(", ")+", got '"+(this.terminals_[W]||W)+"'":fe="Parse error on line "+(F+1)+": Unexpected "+(W==N?"end of input":"'"+(this.terminals_[W]||W)+"'"),this.parseError(fe,{text:D.match,token:this.terminals_[W]||W,line:D.yylineno,loc:P,expected:le})}if(j[0]instanceof Array&&j.length>1)throw new Error("Parse Error: multiple actions possible at state: "+ie+", token: "+W);switch(j[0]){case 1:k.push(W),L.push(D.yytext),$.push(D.yylloc),k.push(j[1]),W=null,A=D.yyleng,z=D.yytext,F=D.yylineno,P=D.yylloc;break;case 2:if(Q=this.productions_[j[1]][1],J.$=L[L.length-Q],J._$={first_line:$[$.length-(Q||1)].first_line,last_line:$[$.length-1].last_line,first_column:$[$.length-(Q||1)].first_column,last_column:$[$.length-1].last_column},G&&(J._$.range=[$[$.length-(Q||1)].range[0],$[$.length-1].range[1]]),ae=this.performAction.apply(J,[z,A,F,O.yy,j[1],L,$].concat(M)),typeof ae<"u")return ae;Q&&(k=k.slice(0,-1*Q*2),L=L.slice(0,-1*Q),$=$.slice(0,-1*Q)),k.push(this.productions_[j[1]][0]),L.push(J.$),$.push(J._$),re=I[k[k.length-2]][k[k.length-1]],k.push(re);break;case 3:return!0}}return!0},"parse")},x=(function(){var w={EOF:1,parseError:T(function(_,k){if(this.yy.parser)this.yy.parser.parseError(_,k);else throw new Error(_)},"parseError"),setInput:T(function(C,_){return this.yy=_||this.yy||{},this._input=C,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:T(function(){var C=this._input[0];this.yytext+=C,this.yyleng++,this.offset++,this.match+=C,this.matched+=C;var _=C.match(/(?:\r\n?|\n).*/g);return _?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),C},"input"),unput:T(function(C){var _=C.length,k=C.split(/(?:\r\n?|\n)/g);this._input=C+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-_),this.offset-=_;var S=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),k.length-1&&(this.yylineno-=k.length-1);var L=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:k?(k.length===S.length?this.yylloc.first_column:0)+S[S.length-k.length].length-k[0].length:this.yylloc.first_column-_},this.options.ranges&&(this.yylloc.range=[L[0],L[0]+this.yyleng-_]),this.yyleng=this.yytext.length,this},"unput"),more:T(function(){return this._more=!0,this},"more"),reject:T(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). +`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:T(function(C){this.unput(this.match.slice(C))},"less"),pastInput:T(function(){var C=this.matched.substr(0,this.matched.length-this.match.length);return(C.length>20?"...":"")+C.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:T(function(){var C=this.match;return C.length<20&&(C+=this._input.substr(0,20-C.length)),(C.substr(0,20)+(C.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:T(function(){var C=this.pastInput(),_=new Array(C.length+1).join("-");return C+this.upcomingInput()+` +`+_+"^"},"showPosition"),test_match:T(function(C,_){var k,S,L;if(this.options.backtrack_lexer&&(L={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&&(L.yylloc.range=this.yylloc.range.slice(0))),S=C[0].match(/(?:\r\n?|\n).*/g),S&&(this.yylineno+=S.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:S?S[S.length-1].length-S[S.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+C[0].length},this.yytext+=C[0],this.match+=C[0],this.matches=C,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(C[0].length),this.matched+=C[0],k=this.performAction.call(this,this.yy,this,_,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),k)return k;if(this._backtrack){for(var $ in L)this[$]=L[$];return!1}return!1},"test_match"),next:T(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var C,_,k,S;this._more||(this.yytext="",this.match="");for(var L=this._currentRules(),$=0;$_[0].length)){if(_=k,S=$,this.options.backtrack_lexer){if(C=this.test_match(k,L[$]),C!==!1)return C;if(this._backtrack){_=!1;continue}else return!1}else if(!this.options.flex)break}return _?(C=this.test_match(_,L[S]),C!==!1?C:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:T(function(){var _=this.next();return _||this.lex()},"lex"),begin:T(function(_){this.conditionStack.push(_)},"begin"),popState:T(function(){var _=this.conditionStack.length-1;return _>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:T(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:T(function(_){return _=this.conditionStack.length-1-Math.abs(_||0),_>=0?this.conditionStack[_]:"INITIAL"},"topState"),pushState:T(function(_){this.begin(_)},"pushState"),stateStackSize:T(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:T(function(_,k,S,L){switch(S){case 0:return _.getLogger().trace("Found comment",k.yytext),6;case 1:return 8;case 2:this.begin("CLASS");break;case 3:return this.popState(),16;case 4:this.popState();break;case 5:_.getLogger().trace("Begin icon"),this.begin("ICON");break;case 6:return _.getLogger().trace("SPACELINE"),6;case 7:return 7;case 8:return 15;case 9:_.getLogger().trace("end icon"),this.popState();break;case 10:return _.getLogger().trace("Exploding node"),this.begin("NODE"),19;case 11:return _.getLogger().trace("Cloud"),this.begin("NODE"),19;case 12:return _.getLogger().trace("Explosion Bang"),this.begin("NODE"),19;case 13:return _.getLogger().trace("Cloud Bang"),this.begin("NODE"),19;case 14:return this.begin("NODE"),19;case 15:return this.begin("NODE"),19;case 16:return this.begin("NODE"),19;case 17:return this.begin("NODE"),19;case 18:return 13;case 19:return 22;case 20:return 11;case 21:this.begin("NSTR2");break;case 22:return"NODE_DESCR";case 23:this.popState();break;case 24:_.getLogger().trace("Starting NSTR"),this.begin("NSTR");break;case 25:return _.getLogger().trace("description:",k.yytext),"NODE_DESCR";case 26:this.popState();break;case 27:return this.popState(),_.getLogger().trace("node end ))"),"NODE_DEND";case 28:return this.popState(),_.getLogger().trace("node end )"),"NODE_DEND";case 29:return this.popState(),_.getLogger().trace("node end ...",k.yytext),"NODE_DEND";case 30:return this.popState(),_.getLogger().trace("node end (("),"NODE_DEND";case 31:return this.popState(),_.getLogger().trace("node end (-"),"NODE_DEND";case 32:return this.popState(),_.getLogger().trace("node end (-"),"NODE_DEND";case 33:return this.popState(),_.getLogger().trace("node end (("),"NODE_DEND";case 34:return this.popState(),_.getLogger().trace("node end (("),"NODE_DEND";case 35:return _.getLogger().trace("Long description:",k.yytext),20;case 36:return _.getLogger().trace("Long description:",k.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 w})();v.lexer=x;function b(){this.yy={}}return T(b,"Parser"),b.prototype=v,v.Parser=b,new b})();bG.parser=bG;var h2t=bG,d2t=12,mh={DEFAULT:0,NO_BORDER:0,ROUNDED_RECT:1,RECT:2,CIRCLE:3,CLOUD:4,BANG:5,HEXAGON:6},f2t=(Tb=class{constructor(){this.nodes=[],this.count=0,this.elements={},this.getLogger=this.getLogger.bind(this),this.nodeType=mh,this.clear(),this.getType=this.getType.bind(this),this.getElementById=this.getElementById.bind(this),this.getParent=this.getParent.bind(this),this.getMindmap=this.getMindmap.bind(this),this.addNode=this.addNode.bind(this),this.decorateNode=this.decorateNode.bind(this)}clear(){this.nodes=[],this.count=0,this.elements={},this.baseLevel=void 0}getParent(e){for(let r=this.nodes.length-1;r>=0;r--)if(this.nodes[r].level0?this.nodes[0]:null}addNode(e,r,n,i){var h,d;se.info("addNode",e,r,n,i);let a=!1;this.nodes.length===0?(this.baseLevel=e,e=0,a=!0):this.baseLevel!==void 0&&(e=e-this.baseLevel,a=!1);const s=Pe();let o=((h=s.mindmap)==null?void 0:h.padding)??Xr.mindmap.padding;switch(i){case this.nodeType.ROUNDED_RECT:case this.nodeType.RECT:case this.nodeType.HEXAGON:o*=2;break}const l={id:this.count++,nodeId:Zr(r,s),level:e,descr:Zr(n,s),type:i,children:[],width:((d=s.mindmap)==null?void 0:d.maxNodeWidth)??Xr.mindmap.maxNodeWidth,padding:o,isRoot:a},u=this.getParent(e);if(u)u.children.push(l),this.nodes.push(l);else if(a)this.nodes.push(l);else throw new Error(`There can be only one root. No parent could be found for ("${l.descr}")`)}getType(e,r){switch(se.debug("In get type",e,r),e){case"[":return this.nodeType.RECT;case"(":return r===")"?this.nodeType.ROUNDED_RECT:this.nodeType.CLOUD;case"((":return this.nodeType.CIRCLE;case")":return this.nodeType.CLOUD;case"))":return this.nodeType.BANG;case"{{":return this.nodeType.HEXAGON;default:return this.nodeType.DEFAULT}}setElementForId(e,r){this.elements[e]=r}getElementById(e){return this.elements[e]}decorateNode(e){if(!e)return;const r=Pe(),n=this.nodes[this.nodes.length-1];e.icon&&(n.icon=Zr(e.icon,r)),e.class&&(n.class=Zr(e.class,r))}type2Str(e){switch(e){case this.nodeType.DEFAULT:return"no-border";case this.nodeType.RECT:return"rect";case this.nodeType.ROUNDED_RECT:return"rounded-rect";case this.nodeType.CIRCLE:return"circle";case this.nodeType.CLOUD:return"cloud";case this.nodeType.BANG:return"bang";case this.nodeType.HEXAGON:return"hexgon";default:return"no-border"}}assignSections(e,r){if(e.level===0?e.section=void 0:e.section=r,e.children)for(const[n,i]of e.children.entries()){const a=e.level===0?n%(d2t-1):r;this.assignSections(i,a)}}flattenNodes(e,r){const n=Pe(),i=["mindmap-node"];e.isRoot===!0?i.push("section-root","section--1"):e.section!==void 0&&i.push(`section-${e.section}`),e.class&&i.push(e.class);const a=i.join(" "),s=T(l=>{var d;const h=(((d=n.theme)==null?void 0:d.toLowerCase())??"").includes("redux");switch(l){case mh.CIRCLE:return"mindmapCircle";case mh.RECT:return"rect";case mh.ROUNDED_RECT:return"rounded";case mh.CLOUD:return"cloud";case mh.BANG:return"bang";case mh.HEXAGON:return"hexagon";case mh.DEFAULT:return h?"rounded":"defaultMindmapNode";case mh.NO_BORDER:default:return"rect"}},"getShapeFromType"),o={id:e.id.toString(),domId:"node_"+e.id.toString(),label:e.descr,labelType:"markdown",isGroup:!1,shape:s(e.type),width:e.width,height:e.height??0,padding:e.padding,cssClasses:a,cssStyles:[],look:n.look,icon:e.icon,x:e.x,y:e.y,level:e.level,nodeId:e.nodeId,type:e.type,section:e.section};if(r.push(o),e.children)for(const l of e.children)this.flattenNodes(l,r)}generateEdges(e,r){if(!e.children)return;const n=Pe();for(const i of e.children){let a="edge";i.section!==void 0&&(a+=` section-edge-${i.section}`);const s=e.level+1;a+=` edge-depth-${s}`;const o={id:`edge_${e.id}_${i.id}`,start:e.id.toString(),end:i.id.toString(),type:"normal",curve:"basis",thickness:"normal",look:n.look,classes:a,depth:e.level,section:i.section};r.push(o),this.generateEdges(i,r)}}getData(){const e=this.getMindmap(),r=Pe(),i=k5e().layout!==void 0,a=r;if(i||(a.layout="cose-bilkent"),!e)return{nodes:[],edges:[],config:a};se.debug("getData: mindmapRoot",e,r),this.assignSections(e);const s=[],o=[];this.flattenNodes(e,s),this.generateEdges(e,o),se.debug(`getData: processed ${s.length} nodes and ${o.length} edges`);const l=new Map;for(const u of s)l.set(u.id,{shape:u.shape,width:u.width,height:u.height,padding:u.padding});return{nodes:s,edges:o,config:a,rootNode:e,markers:["point"],direction:"TB",nodeSpacing:50,rankSpacing:50,shapes:Object.fromEntries(l),type:"mindmap",diagramId:"mindmap-"+c2t()}}getLogger(){return se}},T(Tb,"MindmapDB"),Tb),p2t=T(async(t,e,r,n)=>{var f,p;se.debug(`Rendering mindmap diagram +`+t);const i=n.db,a=i.getData(),s=_m(e,a.config.securityLevel);if(a.type=n.type,a.layoutAlgorithm=Fx(a.config.layout,{fallback:"cose-bilkent"}),a.diagramId=e,!i.getMindmap())return;a.nodes.forEach(g=>{g.shape==="rounded"?(g.radius=15,g.taper=15,g.stroke="none",g.width=0,g.padding=15):g.shape==="circle"?g.padding=10:g.shape==="rect"?(g.width=0,g.padding=10):g.shape==="hexagon"&&(g.width=0,g.height=0)}),await fg(a,s);const{themeVariables:l}=pr(),{useGradient:u,gradientStart:h,gradientStop:d}=l;if(u&&h&&d){const g=s.attr("id"),m=s.append("defs").append("linearGradient").attr("id",`${g}-gradient`).attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");m.append("stop").attr("offset","0%").attr("stop-color",h).attr("stop-opacity",1),m.append("stop").attr("offset","100%").attr("stop-color",d).attr("stop-opacity",1)}op(s,((f=a.config.mindmap)==null?void 0:f.padding)??Xr.mindmap.padding,"mindmapDiagram",((p=a.config.mindmap)==null?void 0:p.useMaxWidth)??Xr.mindmap.useMaxWidth)},"draw"),g2t={draw:p2t},m2t=T(t=>{const{theme:e,look:r}=t;let n="";for(let i=0;i{let n="";for(let i=0;i{let n="";for(let i=0;i{const{theme:e}=t,r=t.svgId,n=t.dropShadow?t.dropShadow.replace("url(#drop-shadow)",`url(${r}-drop-shadow)`):"none";return` + }`;return n},"genGradient"),v2t=T(t=>{const{theme:e}=t,r=t.svgId,n=t.dropShadow?t.dropShadow.replace("url(#drop-shadow)",`url(${r}-drop-shadow)`):"none";return` .edge { stroke-width: 3; } - ${Lht(t)} + ${m2t(t)} .section-root rect, .section-root path, .section-root circle, .section-root polygon { fill: ${t.git0}; } @@ -2807,18 +2808,18 @@ Expecting `+ue.join(", ")+", got '"+(this.terminals_[W]||W)+"'":fe="Parse error [data-look="neo"].mindmap-node.section-root .text-inner-tspan { fill: ${e!=null&&e.includes("redux")?t.nodeBorder:t["cScaleLabel"+(e==="neutral"?1:0)]}; } - ${t.useGradient&&r&&t.mainBkg?Iht(t.THEME_COLOR_LIMIT,r,t.mainBkg):""} -`},"getStyles"),Mht=Dht,Nht={get db(){return new Aht},renderer:Rht,parser:Eht,styles:Mht};const Oht=Object.freeze(Object.defineProperty({__proto__:null,diagram:Nht},Symbol.toStringTag,{value:"Module"}));var U$=(function(){var t=x(function(C,_,L,O){for(L=L||{},O=C.length;O--;L[C[O]]=_);return L},"o"),e=[1,4],r=[1,13],n=[1,12],i=[1,15],a=[1,16],s=[1,20],o=[1,19],l=[6,7,8],u=[1,26],h=[1,24],d=[1,25],f=[6,7,11],p=[1,31],g=[6,7,11,24],m=[1,6,13,16,17,20,23],y=[1,35],v=[1,36],T=[1,6,7,11,13,16,17,20,23],b=[1,38],w={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,KANBAN:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,shapeData:15,ICON:16,CLASS:17,nodeWithId:18,nodeWithoutId:19,NODE_DSTART:20,NODE_DESCR:21,NODE_DEND:22,NODE_ID:23,SHAPE_DATA:24,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"KANBAN",11:"EOF",13:"SPACELIST",16:"ICON",17:"CLASS",20:"NODE_DSTART",21:"NODE_DESCR",22:"NODE_DEND",23:"NODE_ID",24:"SHAPE_DATA"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,3],[12,2],[12,2],[12,2],[12,1],[12,2],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[19,3],[18,1],[18,4],[15,2],[15,1]],performAction:x(function(_,L,O,M,z,F,S){var R=F.length-1;switch(z){case 6:case 7:return M;case 8:M.getLogger().trace("Stop NL ");break;case 9:M.getLogger().trace("Stop EOF ");break;case 11:M.getLogger().trace("Stop NL2 ");break;case 12:M.getLogger().trace("Stop EOF2 ");break;case 15:M.getLogger().info("Node: ",F[R-1].id),M.addNode(F[R-2].length,F[R-1].id,F[R-1].descr,F[R-1].type,F[R]);break;case 16:M.getLogger().info("Node: ",F[R].id),M.addNode(F[R-1].length,F[R].id,F[R].descr,F[R].type);break;case 17:M.getLogger().trace("Icon: ",F[R]),M.decorateNode({icon:F[R]});break;case 18:case 23:M.decorateNode({class:F[R]});break;case 19:M.getLogger().trace("SPACELIST");break;case 20:M.getLogger().trace("Node: ",F[R-1].id),M.addNode(0,F[R-1].id,F[R-1].descr,F[R-1].type,F[R]);break;case 21:M.getLogger().trace("Node: ",F[R].id),M.addNode(0,F[R].id,F[R].descr,F[R].type);break;case 22:M.decorateNode({icon:F[R]});break;case 27:M.getLogger().trace("node found ..",F[R-2]),this.$={id:F[R-1],descr:F[R-1],type:M.getType(F[R-2],F[R])};break;case 28:this.$={id:F[R],descr:F[R],type:0};break;case 29:M.getLogger().trace("node found ..",F[R-3]),this.$={id:F[R-3],descr:F[R-1],type:M.getType(F[R-2],F[R])};break;case 30:this.$=F[R-1]+F[R];break;case 31:this.$=F[R];break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:e},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:e},{6:r,7:[1,10],9:9,12:11,13:n,14:14,16:i,17:a,18:17,19:18,20:s,23:o},t(l,[2,3]),{1:[2,2]},t(l,[2,4]),t(l,[2,5]),{1:[2,6],6:r,12:21,13:n,14:14,16:i,17:a,18:17,19:18,20:s,23:o},{6:r,9:22,12:11,13:n,14:14,16:i,17:a,18:17,19:18,20:s,23:o},{6:u,7:h,10:23,11:d},t(f,[2,24],{18:17,19:18,14:27,16:[1,28],17:[1,29],20:s,23:o}),t(f,[2,19]),t(f,[2,21],{15:30,24:p}),t(f,[2,22]),t(f,[2,23]),t(g,[2,25]),t(g,[2,26]),t(g,[2,28],{20:[1,32]}),{21:[1,33]},{6:u,7:h,10:34,11:d},{1:[2,7],6:r,12:21,13:n,14:14,16:i,17:a,18:17,19:18,20:s,23:o},t(m,[2,14],{7:y,11:v}),t(T,[2,8]),t(T,[2,9]),t(T,[2,10]),t(f,[2,16],{15:37,24:p}),t(f,[2,17]),t(f,[2,18]),t(f,[2,20],{24:b}),t(g,[2,31]),{21:[1,39]},{22:[1,40]},t(m,[2,13],{7:y,11:v}),t(T,[2,11]),t(T,[2,12]),t(f,[2,15],{24:b}),t(g,[2,30]),{22:[1,41]},t(g,[2,27]),t(g,[2,29])],defaultActions:{2:[2,1],6:[2,2]},parseError:x(function(_,L){if(L.recoverable)this.trace(_);else{var O=new Error(_);throw O.hash=L,O}},"parseError"),parse:x(function(_){var L=this,O=[0],M=[],z=[null],F=[],S=this.table,R="",N=0,D=0,I=2,$=1,B=F.slice.call(arguments,1),P=Object.create(this.lexer),G={yy:{}};for(var V in this.yy)Object.prototype.hasOwnProperty.call(this.yy,V)&&(G.yy[V]=this.yy[V]);P.setInput(_,G.yy),G.yy.lexer=P,G.yy.parser=this,typeof P.yylloc>"u"&&(P.yylloc={});var Y=P.yylloc;F.push(Y);var W=P.options&&P.options.ranges;typeof G.yy.parseError=="function"?this.parseError=G.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ie(me){O.length=O.length-2*me,z.length=z.length-me,F.length=F.length-me}x(ie,"popStack");function K(){var me;return me=M.pop()||P.lex()||$,typeof me!="number"&&(me instanceof Array&&(M=me,me=M.pop()),me=L.symbols_[me]||me),me}x(K,"lex");for(var se,J,Z,ee,ne={},ue,fe,_e,Ae;;){if(J=O[O.length-1],this.defaultActions[J]?Z=this.defaultActions[J]:((se===null||typeof se>"u")&&(se=K()),Z=S[J]&&S[J][se]),typeof Z>"u"||!Z.length||!Z[0]){var Ne="";Ae=[];for(ue in S[J])this.terminals_[ue]&&ue>I&&Ae.push("'"+this.terminals_[ue]+"'");P.showPosition?Ne="Parse error on line "+(N+1)+`: + ${t.useGradient&&r&&t.mainBkg?y2t(t.THEME_COLOR_LIMIT,r,t.mainBkg):""} +`},"getStyles"),b2t=v2t,x2t={get db(){return new f2t},renderer:g2t,parser:h2t,styles:b2t};const T2t=Object.freeze(Object.defineProperty({__proto__:null,diagram:x2t},Symbol.toStringTag,{value:"Module"}));var xG=(function(){var t=T(function(k,S,L,$){for(L=L||{},$=k.length;$--;L[k[$]]=S);return L},"o"),e=[1,4],r=[1,13],n=[1,12],i=[1,15],a=[1,16],s=[1,20],o=[1,19],l=[6,7,8],u=[1,26],h=[1,24],d=[1,25],f=[6,7,11],p=[1,31],g=[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:T(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:T(function(S,L,$,I,z,F,A){var R=F.length-1;switch(z){case 6:case 7:return I;case 8:I.getLogger().trace("Stop NL ");break;case 9:I.getLogger().trace("Stop EOF ");break;case 11:I.getLogger().trace("Stop NL2 ");break;case 12:I.getLogger().trace("Stop EOF2 ");break;case 15:I.getLogger().info("Node: ",F[R-1].id),I.addNode(F[R-2].length,F[R-1].id,F[R-1].descr,F[R-1].type,F[R]);break;case 16:I.getLogger().info("Node: ",F[R].id),I.addNode(F[R-1].length,F[R].id,F[R].descr,F[R].type);break;case 17:I.getLogger().trace("Icon: ",F[R]),I.decorateNode({icon:F[R]});break;case 18:case 23:I.decorateNode({class:F[R]});break;case 19:I.getLogger().trace("SPACELIST");break;case 20:I.getLogger().trace("Node: ",F[R-1].id),I.addNode(0,F[R-1].id,F[R-1].descr,F[R-1].type,F[R]);break;case 21:I.getLogger().trace("Node: ",F[R].id),I.addNode(0,F[R].id,F[R].descr,F[R].type);break;case 22:I.decorateNode({icon:F[R]});break;case 27:I.getLogger().trace("node found ..",F[R-2]),this.$={id:F[R-1],descr:F[R-1],type:I.getType(F[R-2],F[R])};break;case 28:this.$={id:F[R],descr:F[R],type:0};break;case 29:I.getLogger().trace("node found ..",F[R-3]),this.$={id:F[R-3],descr:F[R-1],type:I.getType(F[R-2],F[R])};break;case 30:this.$=F[R-1]+F[R];break;case 31:this.$=F[R];break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:e},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:e},{6:r,7:[1,10],9:9,12:11,13:n,14:14,16:i,17:a,18:17,19:18,20:s,23:o},t(l,[2,3]),{1:[2,2]},t(l,[2,4]),t(l,[2,5]),{1:[2,6],6:r,12:21,13:n,14:14,16:i,17:a,18:17,19:18,20:s,23:o},{6:r,9:22,12:11,13:n,14:14,16:i,17:a,18:17,19:18,20:s,23:o},{6:u,7:h,10:23,11:d},t(f,[2,24],{18:17,19:18,14:27,16:[1,28],17:[1,29],20:s,23:o}),t(f,[2,19]),t(f,[2,21],{15:30,24:p}),t(f,[2,22]),t(f,[2,23]),t(g,[2,25]),t(g,[2,26]),t(g,[2,28],{20:[1,32]}),{21:[1,33]},{6:u,7:h,10:34,11:d},{1:[2,7],6:r,12:21,13:n,14:14,16:i,17:a,18:17,19:18,20:s,23:o},t(m,[2,14],{7:y,11:v}),t(x,[2,8]),t(x,[2,9]),t(x,[2,10]),t(f,[2,16],{15:37,24:p}),t(f,[2,17]),t(f,[2,18]),t(f,[2,20],{24:b}),t(g,[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(f,[2,15],{24:b}),t(g,[2,30]),{22:[1,41]},t(g,[2,27]),t(g,[2,29])],defaultActions:{2:[2,1],6:[2,2]},parseError:T(function(S,L){if(L.recoverable)this.trace(S);else{var $=new Error(S);throw $.hash=L,$}},"parseError"),parse:T(function(S){var L=this,$=[0],I=[],z=[null],F=[],A=this.table,R="",N=0,M=0,D=2,O=1,B=F.slice.call(arguments,1),P=Object.create(this.lexer),G={yy:{}};for(var V in this.yy)Object.prototype.hasOwnProperty.call(this.yy,V)&&(G.yy[V]=this.yy[V]);P.setInput(S,G.yy),G.yy.lexer=P,G.yy.parser=this,typeof P.yylloc>"u"&&(P.yylloc={});var H=P.yylloc;F.push(H);var W=P.options&&P.options.ranges;typeof G.yy.parseError=="function"?this.parseError=G.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ie(ge){$.length=$.length-2*ge,z.length=z.length-ge,F.length=F.length-ge}T(ie,"popStack");function j(){var ge;return ge=I.pop()||P.lex()||O,typeof ge!="number"&&(ge instanceof Array&&(I=ge,ge=I.pop()),ge=L.symbols_[ge]||ge),ge}T(j,"lex");for(var ae,J,K,Q,re={},le,fe,Ae,Se;;){if(J=$[$.length-1],this.defaultActions[J]?K=this.defaultActions[J]:((ae===null||typeof ae>"u")&&(ae=j()),K=A[J]&&A[J][ae]),typeof K>"u"||!K.length||!K[0]){var Ne="";Se=[];for(le in A[J])this.terminals_[le]&&le>D&&Se.push("'"+this.terminals_[le]+"'");P.showPosition?Ne="Parse error on line "+(N+1)+`: `+P.showPosition()+` -Expecting `+Ae.join(", ")+", got '"+(this.terminals_[se]||se)+"'":Ne="Parse error on line "+(N+1)+": Unexpected "+(se==$?"end of input":"'"+(this.terminals_[se]||se)+"'"),this.parseError(Ne,{text:P.match,token:this.terminals_[se]||se,line:P.yylineno,loc:Y,expected:Ae})}if(Z[0]instanceof Array&&Z.length>1)throw new Error("Parse Error: multiple actions possible at state: "+J+", token: "+se);switch(Z[0]){case 1:O.push(se),z.push(P.yytext),F.push(P.yylloc),O.push(Z[1]),se=null,D=P.yyleng,R=P.yytext,N=P.yylineno,Y=P.yylloc;break;case 2:if(fe=this.productions_[Z[1]][1],ne.$=z[z.length-fe],ne._$={first_line:F[F.length-(fe||1)].first_line,last_line:F[F.length-1].last_line,first_column:F[F.length-(fe||1)].first_column,last_column:F[F.length-1].last_column},W&&(ne._$.range=[F[F.length-(fe||1)].range[0],F[F.length-1].range[1]]),ee=this.performAction.apply(ne,[R,D,N,G.yy,Z[1],z,F].concat(B)),typeof ee<"u")return ee;fe&&(O=O.slice(0,-1*fe*2),z=z.slice(0,-1*fe),F=F.slice(0,-1*fe)),O.push(this.productions_[Z[1]][0]),z.push(ne.$),F.push(ne._$),_e=S[O[O.length-2]][O[O.length-1]],O.push(_e);break;case 3:return!0}}return!0},"parse")},k=(function(){var C={EOF:1,parseError:x(function(L,O){if(this.yy.parser)this.yy.parser.parseError(L,O);else throw new Error(L)},"parseError"),setInput:x(function(_,L){return this.yy=L||this.yy||{},this._input=_,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:x(function(){var _=this._input[0];this.yytext+=_,this.yyleng++,this.offset++,this.match+=_,this.matched+=_;var L=_.match(/(?:\r\n?|\n).*/g);return L?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),_},"input"),unput:x(function(_){var L=_.length,O=_.split(/(?:\r\n?|\n)/g);this._input=_+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-L),this.offset-=L;var M=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),O.length-1&&(this.yylineno-=O.length-1);var z=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:O?(O.length===M.length?this.yylloc.first_column:0)+M[M.length-O.length].length-O[0].length:this.yylloc.first_column-L},this.options.ranges&&(this.yylloc.range=[z[0],z[0]+this.yyleng-L]),this.yyleng=this.yytext.length,this},"unput"),more:x(function(){return this._more=!0,this},"more"),reject:x(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). -`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:x(function(_){this.unput(this.match.slice(_))},"less"),pastInput:x(function(){var _=this.matched.substr(0,this.matched.length-this.match.length);return(_.length>20?"...":"")+_.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:x(function(){var _=this.match;return _.length<20&&(_+=this._input.substr(0,20-_.length)),(_.substr(0,20)+(_.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:x(function(){var _=this.pastInput(),L=new Array(_.length+1).join("-");return _+this.upcomingInput()+` -`+L+"^"},"showPosition"),test_match:x(function(_,L){var O,M,z;if(this.options.backtrack_lexer&&(z={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&&(z.yylloc.range=this.yylloc.range.slice(0))),M=_[0].match(/(?:\r\n?|\n).*/g),M&&(this.yylineno+=M.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:M?M[M.length-1].length-M[M.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+_[0].length},this.yytext+=_[0],this.match+=_[0],this.matches=_,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(_[0].length),this.matched+=_[0],O=this.performAction.call(this,this.yy,this,L,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),O)return O;if(this._backtrack){for(var F in z)this[F]=z[F];return!1}return!1},"test_match"),next:x(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var _,L,O,M;this._more||(this.yytext="",this.match="");for(var z=this._currentRules(),F=0;FL[0].length)){if(L=O,M=F,this.options.backtrack_lexer){if(_=this.test_match(O,z[F]),_!==!1)return _;if(this._backtrack){L=!1;continue}else return!1}else if(!this.options.flex)break}return L?(_=this.test_match(L,z[M]),_!==!1?_:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var L=this.next();return L||this.lex()},"lex"),begin:x(function(L){this.conditionStack.push(L)},"begin"),popState:x(function(){var L=this.conditionStack.length-1;return L>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(L){return L=this.conditionStack.length-1-Math.abs(L||0),L>=0?this.conditionStack[L]:"INITIAL"},"topState"),pushState:x(function(L){this.begin(L)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:x(function(L,O,M,z){switch(M){case 0:return this.pushState("shapeData"),O.yytext="",24;case 1:return this.pushState("shapeDataStr"),24;case 2:return this.popState(),24;case 3:const F=/\n\s*/g;return O.yytext=O.yytext.replace(F,"
    "),24;case 4:return 24;case 5:this.popState();break;case 6:return L.getLogger().trace("Found comment",O.yytext),6;case 7:return 8;case 8:this.begin("CLASS");break;case 9:return this.popState(),17;case 10:this.popState();break;case 11:L.getLogger().trace("Begin icon"),this.begin("ICON");break;case 12:return L.getLogger().trace("SPACELINE"),6;case 13:return 7;case 14:return 16;case 15:L.getLogger().trace("end icon"),this.popState();break;case 16:return L.getLogger().trace("Exploding node"),this.begin("NODE"),20;case 17:return L.getLogger().trace("Cloud"),this.begin("NODE"),20;case 18:return L.getLogger().trace("Explosion Bang"),this.begin("NODE"),20;case 19:return L.getLogger().trace("Cloud Bang"),this.begin("NODE"),20;case 20:return this.begin("NODE"),20;case 21:return this.begin("NODE"),20;case 22:return this.begin("NODE"),20;case 23:return this.begin("NODE"),20;case 24:return 13;case 25:return 23;case 26:return 11;case 27:this.begin("NSTR2");break;case 28:return"NODE_DESCR";case 29:this.popState();break;case 30:L.getLogger().trace("Starting NSTR"),this.begin("NSTR");break;case 31:return L.getLogger().trace("description:",O.yytext),"NODE_DESCR";case 32:this.popState();break;case 33:return this.popState(),L.getLogger().trace("node end ))"),"NODE_DEND";case 34:return this.popState(),L.getLogger().trace("node end )"),"NODE_DEND";case 35:return this.popState(),L.getLogger().trace("node end ...",O.yytext),"NODE_DEND";case 36:return this.popState(),L.getLogger().trace("node end (("),"NODE_DEND";case 37:return this.popState(),L.getLogger().trace("node end (-"),"NODE_DEND";case 38:return this.popState(),L.getLogger().trace("node end (-"),"NODE_DEND";case 39:return this.popState(),L.getLogger().trace("node end (("),"NODE_DEND";case 40:return this.popState(),L.getLogger().trace("node end (("),"NODE_DEND";case 41:return L.getLogger().trace("Long description:",O.yytext),21;case 42:return L.getLogger().trace("Long description:",O.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 C})();w.lexer=k;function A(){this.yy={}}return x(A,"Parser"),A.prototype=w,w.Parser=A,new A})();U$.parser=U$;var $ht=U$,ko=[],H$=[],Y$=0,X$={},Pht=x(()=>{ko=[],H$=[],Y$=0,X$={}},"clear"),Bht=x(t=>{if(ko.length===0)return null;const e=ko[0].level;let r=null;for(let n=ko.length-1;n>=0;n--)if(ko[n].level===e&&!r&&(r=ko[n]),ko[n].levelo.parentId===i.id);for(const o of s){const l={id:o.id,parentId:i.id,label:qr(o.label??"",n),labelType:"markdown",isGroup:!1,ticket:o==null?void 0:o.ticket,priority:o==null?void 0:o.priority,assigned:o==null?void 0:o.assigned,icon:o==null?void 0:o.icon,shape:"kanbanItem",level:o.level,rx:5,ry:5,cssStyles:["text-align: left"]};e.push(l)}}return{nodes:e,edges:t,other:{},config:Pe()}},"getData"),zht=x((t,e,r,n,i)=>{var u,h;const a=Pe();let s=((u=a.mindmap)==null?void 0:u.padding)??Fr.mindmap.padding;switch(n){case Hi.ROUNDED_RECT:case Hi.RECT:case Hi.HEXAGON:s*=2}const o={id:qr(e,a)||"kbn"+Y$++,level:t,label:qr(r,a),width:((h=a.mindmap)==null?void 0:h.maxNodeWidth)??Fr.mindmap.maxNodeWidth,padding:s,isGroup:!1};if(i!==void 0){let d;i.includes(` +Expecting `+Se.join(", ")+", got '"+(this.terminals_[ae]||ae)+"'":Ne="Parse error on line "+(N+1)+": Unexpected "+(ae==O?"end of input":"'"+(this.terminals_[ae]||ae)+"'"),this.parseError(Ne,{text:P.match,token:this.terminals_[ae]||ae,line:P.yylineno,loc:H,expected:Se})}if(K[0]instanceof Array&&K.length>1)throw new Error("Parse Error: multiple actions possible at state: "+J+", token: "+ae);switch(K[0]){case 1:$.push(ae),z.push(P.yytext),F.push(P.yylloc),$.push(K[1]),ae=null,M=P.yyleng,R=P.yytext,N=P.yylineno,H=P.yylloc;break;case 2:if(fe=this.productions_[K[1]][1],re.$=z[z.length-fe],re._$={first_line:F[F.length-(fe||1)].first_line,last_line:F[F.length-1].last_line,first_column:F[F.length-(fe||1)].first_column,last_column:F[F.length-1].last_column},W&&(re._$.range=[F[F.length-(fe||1)].range[0],F[F.length-1].range[1]]),Q=this.performAction.apply(re,[R,M,N,G.yy,K[1],z,F].concat(B)),typeof Q<"u")return Q;fe&&($=$.slice(0,-1*fe*2),z=z.slice(0,-1*fe),F=F.slice(0,-1*fe)),$.push(this.productions_[K[1]][0]),z.push(re.$),F.push(re._$),Ae=A[$[$.length-2]][$[$.length-1]],$.push(Ae);break;case 3:return!0}}return!0},"parse")},C=(function(){var k={EOF:1,parseError:T(function(L,$){if(this.yy.parser)this.yy.parser.parseError(L,$);else throw new Error(L)},"parseError"),setInput:T(function(S,L){return this.yy=L||this.yy||{},this._input=S,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:T(function(){var S=this._input[0];this.yytext+=S,this.yyleng++,this.offset++,this.match+=S,this.matched+=S;var L=S.match(/(?:\r\n?|\n).*/g);return L?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),S},"input"),unput:T(function(S){var L=S.length,$=S.split(/(?:\r\n?|\n)/g);this._input=S+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-L),this.offset-=L;var I=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),$.length-1&&(this.yylineno-=$.length-1);var z=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:$?($.length===I.length?this.yylloc.first_column:0)+I[I.length-$.length].length-$[0].length:this.yylloc.first_column-L},this.options.ranges&&(this.yylloc.range=[z[0],z[0]+this.yyleng-L]),this.yyleng=this.yytext.length,this},"unput"),more:T(function(){return this._more=!0,this},"more"),reject:T(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). +`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:T(function(S){this.unput(this.match.slice(S))},"less"),pastInput:T(function(){var S=this.matched.substr(0,this.matched.length-this.match.length);return(S.length>20?"...":"")+S.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:T(function(){var S=this.match;return S.length<20&&(S+=this._input.substr(0,20-S.length)),(S.substr(0,20)+(S.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:T(function(){var S=this.pastInput(),L=new Array(S.length+1).join("-");return S+this.upcomingInput()+` +`+L+"^"},"showPosition"),test_match:T(function(S,L){var $,I,z;if(this.options.backtrack_lexer&&(z={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&&(z.yylloc.range=this.yylloc.range.slice(0))),I=S[0].match(/(?:\r\n?|\n).*/g),I&&(this.yylineno+=I.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:I?I[I.length-1].length-I[I.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+S[0].length},this.yytext+=S[0],this.match+=S[0],this.matches=S,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(S[0].length),this.matched+=S[0],$=this.performAction.call(this,this.yy,this,L,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),$)return $;if(this._backtrack){for(var F in z)this[F]=z[F];return!1}return!1},"test_match"),next:T(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var S,L,$,I;this._more||(this.yytext="",this.match="");for(var z=this._currentRules(),F=0;FL[0].length)){if(L=$,I=F,this.options.backtrack_lexer){if(S=this.test_match($,z[F]),S!==!1)return S;if(this._backtrack){L=!1;continue}else return!1}else if(!this.options.flex)break}return L?(S=this.test_match(L,z[I]),S!==!1?S:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:T(function(){var L=this.next();return L||this.lex()},"lex"),begin:T(function(L){this.conditionStack.push(L)},"begin"),popState:T(function(){var L=this.conditionStack.length-1;return L>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:T(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:T(function(L){return L=this.conditionStack.length-1-Math.abs(L||0),L>=0?this.conditionStack[L]:"INITIAL"},"topState"),pushState:T(function(L){this.begin(L)},"pushState"),stateStackSize:T(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:T(function(L,$,I,z){switch(I){case 0:return this.pushState("shapeData"),$.yytext="",24;case 1:return this.pushState("shapeDataStr"),24;case 2:return this.popState(),24;case 3:const F=/\n\s*/g;return $.yytext=$.yytext.replace(F,"
    "),24;case 4:return 24;case 5:this.popState();break;case 6:return L.getLogger().trace("Found comment",$.yytext),6;case 7:return 8;case 8:this.begin("CLASS");break;case 9:return this.popState(),17;case 10:this.popState();break;case 11:L.getLogger().trace("Begin icon"),this.begin("ICON");break;case 12:return L.getLogger().trace("SPACELINE"),6;case 13:return 7;case 14:return 16;case 15:L.getLogger().trace("end icon"),this.popState();break;case 16:return L.getLogger().trace("Exploding node"),this.begin("NODE"),20;case 17:return L.getLogger().trace("Cloud"),this.begin("NODE"),20;case 18:return L.getLogger().trace("Explosion Bang"),this.begin("NODE"),20;case 19:return L.getLogger().trace("Cloud Bang"),this.begin("NODE"),20;case 20:return this.begin("NODE"),20;case 21:return this.begin("NODE"),20;case 22:return this.begin("NODE"),20;case 23:return this.begin("NODE"),20;case 24:return 13;case 25:return 23;case 26:return 11;case 27:this.begin("NSTR2");break;case 28:return"NODE_DESCR";case 29:this.popState();break;case 30:L.getLogger().trace("Starting NSTR"),this.begin("NSTR");break;case 31:return L.getLogger().trace("description:",$.yytext),"NODE_DESCR";case 32:this.popState();break;case 33:return this.popState(),L.getLogger().trace("node end ))"),"NODE_DEND";case 34:return this.popState(),L.getLogger().trace("node end )"),"NODE_DEND";case 35:return this.popState(),L.getLogger().trace("node end ...",$.yytext),"NODE_DEND";case 36:return this.popState(),L.getLogger().trace("node end (("),"NODE_DEND";case 37:return this.popState(),L.getLogger().trace("node end (-"),"NODE_DEND";case 38:return this.popState(),L.getLogger().trace("node end (-"),"NODE_DEND";case 39:return this.popState(),L.getLogger().trace("node end (("),"NODE_DEND";case 40:return this.popState(),L.getLogger().trace("node end (("),"NODE_DEND";case 41:return L.getLogger().trace("Long description:",$.yytext),21;case 42:return L.getLogger().trace("Long description:",$.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 k})();w.lexer=C;function _(){this.yy={}}return T(_,"Parser"),_.prototype=w,w.Parser=_,new _})();xG.parser=xG;var w2t=xG,cl=[],TG=[],wG=0,CG={},C2t=T(()=>{cl=[],TG=[],wG=0,CG={}},"clear"),k2t=T(t=>{if(cl.length===0)return null;const e=cl[0].level;let r=null;for(let n=cl.length-1;n>=0;n--)if(cl[n].level===e&&!r&&(r=cl[n]),cl[n].levelo.parentId===i.id);for(const o of s){const l={id:o.id,parentId:i.id,label:Zr(o.label??"",n),labelType:"markdown",isGroup:!1,ticket:o==null?void 0:o.ticket,priority:o==null?void 0:o.priority,assigned:o==null?void 0:o.assigned,icon:o==null?void 0:o.icon,shape:"kanbanItem",level:o.level,rx:5,ry:5,cssStyles:["text-align: left"]};e.push(l)}}return{nodes:e,edges:t,other:{},config:Pe()}},"getData"),S2t=T((t,e,r,n,i)=>{var u,h;const a=Pe();let s=((u=a.mindmap)==null?void 0:u.padding)??Xr.mindmap.padding;switch(n){case ga.ROUNDED_RECT:case ga.RECT:case ga.HEXAGON:s*=2}const o={id:Zr(e,a)||"kbn"+wG++,level:t,label:Zr(r,a),width:((h=a.mindmap)==null?void 0:h.maxNodeWidth)??Xr.mindmap.maxNodeWidth,padding:s,isGroup:!1};if(i!==void 0){let d;i.includes(` `)?d=i+` `:d=`{ `+i+` -}`;const f=_4(d,{schema:A4});if(f.shape&&(f.shape!==f.shape.toLowerCase()||f.shape.includes("_")))throw new Error(`No such shape: ${f.shape}. Shape names should be lowercase.`);f!=null&&f.shape&&f.shape==="kanbanItem"&&(o.shape=f==null?void 0:f.shape),f!=null&&f.label&&(o.label=f==null?void 0:f.label),f!=null&&f.icon&&(o.icon=f==null?void 0:f.icon.toString()),f!=null&&f.assigned&&(o.assigned=f==null?void 0:f.assigned.toString()),f!=null&&f.ticket&&(o.ticket=f==null?void 0:f.ticket.toString()),f!=null&&f.priority&&(o.priority=f==null?void 0:f.priority)}const l=Bht(t);l?o.parentId=l.id||"kbn"+Y$++:H$.push(o),ko.push(o)},"addNode"),Hi={DEFAULT:0,NO_BORDER:0,ROUNDED_RECT:1,RECT:2,CIRCLE:3,CLOUD:4,BANG:5,HEXAGON:6},Ght=x((t,e)=>{switch(ae.debug("In get type",t,e),t){case"[":return Hi.RECT;case"(":return e===")"?Hi.ROUNDED_RECT:Hi.CLOUD;case"((":return Hi.CIRCLE;case")":return Hi.CLOUD;case"))":return Hi.BANG;case"{{":return Hi.HEXAGON;default:return Hi.DEFAULT}},"getType"),qht=x((t,e)=>{X$[t]=e},"setElementForId"),Vht=x(t=>{if(!t)return;const e=Pe(),r=ko[ko.length-1];t.icon&&(r.icon=qr(t.icon,e)),t.class&&(r.cssClasses=qr(t.class,e))},"decorateNode"),Wht=x(t=>{switch(t){case Hi.DEFAULT:return"no-border";case Hi.RECT:return"rect";case Hi.ROUNDED_RECT:return"rounded-rect";case Hi.CIRCLE:return"circle";case Hi.CLOUD:return"cloud";case Hi.BANG:return"bang";case Hi.HEXAGON:return"hexgon";default:return"no-border"}},"type2Str"),Uht=x(()=>ae,"getLogger"),Hht=x(t=>X$[t],"getElementById"),Yht={clear:Pht,addNode:zht,getSections:y1e,getData:Fht,nodeType:Hi,getType:Ght,setElementForId:qht,decorateNode:Vht,type2Str:Wht,getLogger:Uht,getElementById:Hht},Xht=Yht,Kht=x(async(t,e,r,n)=>{var y,v,T,b,w;ae.debug(`Rendering kanban diagram -`+t);const a=n.db.getData(),s=Pe();s.htmlLabels=!1;const o=ys(e);for(const k of a.nodes)k.domId=`${e}-${k.id}`;const l=o.append("g");l.attr("class","sections");const u=o.append("g");u.attr("class","items");const h=a.nodes.filter(k=>k.isGroup);let d=0;const f=10,p=[];let g=25;for(const k of h){const A=((y=s==null?void 0:s.kanban)==null?void 0:y.sectionWidth)||200;d=d+1,k.x=A*d+(d-1)*f/2,k.width=A,k.y=0,k.height=A*3,k.rx=5,k.ry=5,k.cssClasses=k.cssClasses+" section-"+d;const C=await V_(l,k);g=Math.max(g,(v=C==null?void 0:C.labelBBox)==null?void 0:v.height),p.push(C)}let m=0;for(const k of h){const A=p[m];m=m+1;const C=((T=s==null?void 0:s.kanban)==null?void 0:T.sectionWidth)||200,_=-C*3/2+g;let L=_;const O=a.nodes.filter(F=>F.parentId===k.id);for(const F of O){if(F.isGroup)throw new Error("Groups within groups are not allowed in Kanban diagrams");F.x=k.x,F.width=C-1.5*f;const R=(await nC(u,F,{config:s})).node().getBBox();F.y=L+R.height/2,await K_(F),L=F.y+R.height/2+f/2}const M=A.cluster.select("rect"),z=Math.max(L-_+3*f,50)+(g-25);M.attr("height",z)}E0(void 0,o,((b=s.mindmap)==null?void 0:b.padding)??Fr.kanban.padding,((w=s.mindmap)==null?void 0:w.useMaxWidth)??Fr.kanban.useMaxWidth)},"draw"),jht={draw:Kht},Zht=x(t=>{let e="";for(let n=0;nt.darkMode?st(n,i):at(n,i),"adjuster");for(let n=0;n{switch(se.debug("In get type",t,e),t){case"[":return ga.RECT;case"(":return e===")"?ga.ROUNDED_RECT:ga.CLOUD;case"((":return ga.CIRCLE;case")":return ga.CLOUD;case"))":return ga.BANG;case"{{":return ga.HEXAGON;default:return ga.DEFAULT}},"getType"),A2t=T((t,e)=>{CG[t]=e},"setElementForId"),R2t=T(t=>{if(!t)return;const e=Pe(),r=cl[cl.length-1];t.icon&&(r.icon=Zr(t.icon,e)),t.class&&(r.cssClasses=Zr(t.class,e))},"decorateNode"),L2t=T(t=>{switch(t){case ga.DEFAULT:return"no-border";case ga.RECT:return"rect";case ga.ROUNDED_RECT:return"rounded-rect";case ga.CIRCLE:return"circle";case ga.CLOUD:return"cloud";case ga.BANG:return"bang";case ga.HEXAGON:return"hexgon";default:return"no-border"}},"type2Str"),I2t=T(()=>se,"getLogger"),D2t=T(t=>CG[t],"getElementById"),M2t={clear:C2t,addNode:S2t,getSections:Nwe,getData:E2t,nodeType:ga,getType:_2t,setElementForId:A2t,decorateNode:R2t,type2Str:L2t,getLogger:I2t,getElementById:D2t},N2t=M2t,$2t=T(async(t,e,r,n)=>{var y,v,x,b,w;se.debug(`Rendering kanban diagram +`+t);const a=n.db.getData(),s=Pe();s.htmlLabels=!1;const o=Ys(e);for(const C of a.nodes)C.domId=`${e}-${C.id}`;const l=o.append("g");l.attr("class","sections");const u=o.append("g");u.attr("class","items");const h=a.nodes.filter(C=>C.isGroup);let d=0;const f=10,p=[];let g=25;for(const C of h){const _=((y=s==null?void 0:s.kanban)==null?void 0:y.sectionWidth)||200;d=d+1,C.x=_*d+(d-1)*f/2,C.width=_,C.y=0,C.height=_*3,C.rx=5,C.ry=5,C.cssClasses=C.cssClasses+" section-"+d;const k=await q8(l,C);g=Math.max(g,(v=k==null?void 0:k.labelBBox)==null?void 0:v.height),p.push(k)}let m=0;for(const C of h){const _=p[m];m=m+1;const k=((x=s==null?void 0:s.kanban)==null?void 0:x.sectionWidth)||200,S=-k*3/2+g;let L=S;const $=a.nodes.filter(F=>F.parentId===C.id);for(const F of $){if(F.isGroup)throw new Error("Groups within groups are not allowed in Kanban diagrams");F.x=C.x,F.width=k-1.5*f;const R=(await uE(u,F,{config:s})).node().getBBox();F.y=L+R.height/2,await X8(F),L=F.y+R.height/2+f/2}const I=_.cluster.select("rect"),z=Math.max(L-S+3*f,50)+(g-25);I.attr("height",z)}G0(void 0,o,((b=s.mindmap)==null?void 0:b.padding)??Xr.kanban.padding,((w=s.mindmap)==null?void 0:w.useMaxWidth)??Xr.kanban.useMaxWidth)},"draw"),O2t={draw:$2t},P2t=T(t=>{let e="";for(let n=0;nt.darkMode?ot(n,i):st(n,i),"adjuster");for(let n=0;n` + `}return e},"genSections"),B2t=T(t=>` .edge { stroke-width: 3; } - ${Zht(t)} + ${P2t(t)} .section-root rect, .section-root path, .section-root circle, .section-root polygon { fill: ${t.git0}; } @@ -2895,15 +2896,15 @@ Expecting `+Ae.join(", ")+", got '"+(this.terminals_[se]||se)+"'":Ne="Parse erro dominant-baseline: middle; text-align: center; } - ${px()} -`,"getStyles"),Jht=Qht,edt={db:Xht,renderer:jht,parser:$ht,styles:Jht};const tdt=Object.freeze(Object.defineProperty({__proto__:null,diagram:edt},Symbol.toStringTag,{value:"Module"}));function v1e(t,e){let r;if(e===void 0)for(const n of t)n!=null&&(r=n)&&(r=n);else{let n=-1;for(let i of t)(i=e(i,++n,t))!=null&&(r=i)&&(r=i)}return r}function b1e(t,e){let r;if(e===void 0)for(const n of t)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);else{let n=-1;for(let i of t)(i=e(i,++n,t))!=null&&(r>i||r===void 0&&i>=i)&&(r=i)}return r}function K$(t,e){let r=0;if(e===void 0)for(let n of t)(n=+n)&&(r+=n);else{let n=-1;for(let i of t)(i=+e(i,++n,t))&&(r+=i)}return r}function rdt(t){return t.target.depth}function ndt(t){return t.depth}function idt(t,e){return e-1-t.height}function x1e(t,e){return t.sourceLinks.length?t.depth:e-1}function adt(t){return t.targetLinks.length?t.depth:t.sourceLinks.length?b1e(t.sourceLinks,rdt)-1:0}function OS(t){return function(){return t}}function T1e(t,e){return $S(t.source,e.source)||t.index-e.index}function w1e(t,e){return $S(t.target,e.target)||t.index-e.index}function $S(t,e){return t.y0-e.y0}function j$(t){return t.value}function sdt(t){return t.index}function odt(t){return t.nodes}function ldt(t){return t.links}function C1e(t,e){const r=t.get(e);if(!r)throw new Error("missing: "+e);return r}function k1e({nodes:t}){for(const e of t){let r=e.y0,n=r;for(const i of e.sourceLinks)i.y0=r+i.width/2,r+=i.width;for(const i of e.targetLinks)i.y1=n+i.width/2,n+=i.width}}function cdt(){let t=0,e=0,r=1,n=1,i=24,a=8,s,o=sdt,l=x1e,u,h,d=odt,f=ldt,p=6;function g(){const R={nodes:d.apply(null,arguments),links:f.apply(null,arguments)};return m(R),y(R),v(R),T(R),k(R),k1e(R),R}g.update=function(R){return k1e(R),R},g.nodeId=function(R){return arguments.length?(o=typeof R=="function"?R:OS(R),g):o},g.nodeAlign=function(R){return arguments.length?(l=typeof R=="function"?R:OS(R),g):l},g.nodeSort=function(R){return arguments.length?(u=R,g):u},g.nodeWidth=function(R){return arguments.length?(i=+R,g):i},g.nodePadding=function(R){return arguments.length?(a=s=+R,g):a},g.nodes=function(R){return arguments.length?(d=typeof R=="function"?R:OS(R),g):d},g.links=function(R){return arguments.length?(f=typeof R=="function"?R:OS(R),g):f},g.linkSort=function(R){return arguments.length?(h=R,g):h},g.size=function(R){return arguments.length?(t=e=0,r=+R[0],n=+R[1],g):[r-t,n-e]},g.extent=function(R){return arguments.length?(t=+R[0][0],r=+R[1][0],e=+R[0][1],n=+R[1][1],g):[[t,e],[r,n]]},g.iterations=function(R){return arguments.length?(p=+R,g):p};function m({nodes:R,links:N}){for(const[I,$]of R.entries())$.index=I,$.sourceLinks=[],$.targetLinks=[];const D=new Map(R.map((I,$)=>[o(I,$,R),I]));for(const[I,$]of N.entries()){$.index=I;let{source:B,target:P}=$;typeof B!="object"&&(B=$.source=C1e(D,B)),typeof P!="object"&&(P=$.target=C1e(D,P)),B.sourceLinks.push($),P.targetLinks.push($)}if(h!=null)for(const{sourceLinks:I,targetLinks:$}of R)I.sort(h),$.sort(h)}function y({nodes:R}){for(const N of R)N.value=N.fixedValue===void 0?Math.max(K$(N.sourceLinks,j$),K$(N.targetLinks,j$)):N.fixedValue}function v({nodes:R}){const N=R.length;let D=new Set(R),I=new Set,$=0;for(;D.size;){for(const B of D){B.depth=$;for(const{target:P}of B.sourceLinks)I.add(P)}if(++$>N)throw new Error("circular link");D=I,I=new Set}}function T({nodes:R}){const N=R.length;let D=new Set(R),I=new Set,$=0;for(;D.size;){for(const B of D){B.height=$;for(const{source:P}of B.targetLinks)I.add(P)}if(++$>N)throw new Error("circular link");D=I,I=new Set}}function b({nodes:R}){const N=v1e(R,$=>$.depth)+1,D=(r-t-i)/(N-1),I=new Array(N);for(const $ of R){const B=Math.max(0,Math.min(N-1,Math.floor(l.call(null,$,N))));$.layer=B,$.x0=t+B*D,$.x1=$.x0+i,I[B]?I[B].push($):I[B]=[$]}if(u)for(const $ of I)$.sort(u);return I}function w(R){const N=b1e(R,D=>(n-e-(D.length-1)*s)/K$(D,j$));for(const D of R){let I=e;for(const $ of D){$.y0=I,$.y1=I+$.value*N,I=$.y1+s;for(const B of $.sourceLinks)B.width=B.value*N}I=(n-I+s)/(D.length+1);for(let $=0;$D.length)-1)),w(N);for(let D=0;D0))continue;let Y=(G/V-P.y0)*N;P.y0+=Y,P.y1+=Y,M(P)}u===void 0&&B.sort($S),_(B,D)}}function C(R,N,D){for(let I=R.length,$=I-2;$>=0;--$){const B=R[$];for(const P of B){let G=0,V=0;for(const{target:W,value:ie}of P.sourceLinks){let K=ie*(W.layer-P.layer);G+=S(P,W)*K,V+=K}if(!(V>0))continue;let Y=(G/V-P.y0)*N;P.y0+=Y,P.y1+=Y,M(P)}u===void 0&&B.sort($S),_(B,D)}}function _(R,N){const D=R.length>>1,I=R[D];O(R,I.y0-s,D-1,N),L(R,I.y1+s,D+1,N),O(R,n,R.length-1,N),L(R,e,0,N)}function L(R,N,D,I){for(;D1e-6&&($.y0+=B,$.y1+=B),N=$.y1+s}}function O(R,N,D,I){for(;D>=0;--D){const $=R[D],B=($.y1-N)*I;B>1e-6&&($.y0-=B,$.y1-=B),N=$.y0-s}}function M({sourceLinks:R,targetLinks:N}){if(h===void 0){for(const{source:{sourceLinks:D}}of N)D.sort(w1e);for(const{target:{targetLinks:D}}of R)D.sort(T1e)}}function z(R){if(h===void 0)for(const{sourceLinks:N,targetLinks:D}of R)N.sort(w1e),D.sort(T1e)}function F(R,N){let D=R.y0-(R.sourceLinks.length-1)*s/2;for(const{target:I,width:$}of R.sourceLinks){if(I===N)break;D+=$+s}for(const{source:I,width:$}of N.targetLinks){if(I===R)break;D-=$}return D}function S(R,N){let D=N.y0-(N.targetLinks.length-1)*s/2;for(const{source:I,width:$}of N.targetLinks){if(I===R)break;D+=$+s}for(const{target:I,width:$}of R.sourceLinks){if(I===N)break;D-=$}return D}return g}var Z$=Math.PI,Q$=2*Z$,i0=1e-6,udt=Q$-i0;function J$(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function E1e(){return new J$}J$.prototype=E1e.prototype={constructor:J$,moveTo:function(t,e){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)},closePath:function(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(t,e){this._+="L"+(this._x1=+t)+","+(this._y1=+e)},quadraticCurveTo:function(t,e,r,n){this._+="Q"+ +t+","+ +e+","+(this._x1=+r)+","+(this._y1=+n)},bezierCurveTo:function(t,e,r,n,i,a){this._+="C"+ +t+","+ +e+","+ +r+","+ +n+","+(this._x1=+i)+","+(this._y1=+a)},arcTo:function(t,e,r,n,i){t=+t,e=+e,r=+r,n=+n,i=+i;var a=this._x1,s=this._y1,o=r-t,l=n-e,u=a-t,h=s-e,d=u*u+h*h;if(i<0)throw new Error("negative radius: "+i);if(this._x1===null)this._+="M"+(this._x1=t)+","+(this._y1=e);else if(d>i0)if(!(Math.abs(h*o-l*u)>i0)||!i)this._+="L"+(this._x1=t)+","+(this._y1=e);else{var f=r-a,p=n-s,g=o*o+l*l,m=f*f+p*p,y=Math.sqrt(g),v=Math.sqrt(d),T=i*Math.tan((Z$-Math.acos((g+d-m)/(2*y*v)))/2),b=T/v,w=T/y;Math.abs(b-1)>i0&&(this._+="L"+(t+b*u)+","+(e+b*h)),this._+="A"+i+","+i+",0,0,"+ +(h*f>u*p)+","+(this._x1=t+w*o)+","+(this._y1=e+w*l)}},arc:function(t,e,r,n,i,a){t=+t,e=+e,r=+r,a=!!a;var s=r*Math.cos(n),o=r*Math.sin(n),l=t+s,u=e+o,h=1^a,d=a?n-i:i-n;if(r<0)throw new Error("negative radius: "+r);this._x1===null?this._+="M"+l+","+u:(Math.abs(this._x1-l)>i0||Math.abs(this._y1-u)>i0)&&(this._+="L"+l+","+u),r&&(d<0&&(d=d%Q$+Q$),d>udt?this._+="A"+r+","+r+",0,1,"+h+","+(t-s)+","+(e-o)+"A"+r+","+r+",0,1,"+h+","+(this._x1=l)+","+(this._y1=u):d>i0&&(this._+="A"+r+","+r+",0,"+ +(d>=Z$)+","+h+","+(this._x1=t+r*Math.cos(i))+","+(this._y1=e+r*Math.sin(i))))},rect:function(t,e,r,n){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)+"h"+ +r+"v"+ +n+"h"+-r+"Z"},toString:function(){return this._}};function S1e(t){return function(){return t}}function hdt(t){return t[0]}function ddt(t){return t[1]}var fdt=Array.prototype.slice;function pdt(t){return t.source}function gdt(t){return t.target}function mdt(t){var e=pdt,r=gdt,n=hdt,i=ddt,a=null;function s(){var o,l=fdt.call(arguments),u=e.apply(this,l),h=r.apply(this,l);if(a||(a=o=E1e()),t(a,+n.apply(this,(l[0]=u,l)),+i.apply(this,l),+n.apply(this,(l[0]=h,l)),+i.apply(this,l)),o)return a=null,o+""||null}return s.source=function(o){return arguments.length?(e=o,s):e},s.target=function(o){return arguments.length?(r=o,s):r},s.x=function(o){return arguments.length?(n=typeof o=="function"?o:S1e(+o),s):n},s.y=function(o){return arguments.length?(i=typeof o=="function"?o:S1e(+o),s):i},s.context=function(o){return arguments.length?(a=o??null,s):a},s}function ydt(t,e,r,n,i){t.moveTo(e,r),t.bezierCurveTo(e=(e+n)/2,r,e,i,n,i)}function vdt(){return mdt(ydt)}function bdt(t){return[t.source.x1,t.y0]}function xdt(t){return[t.target.x0,t.y1]}function Tdt(){return vdt().source(bdt).target(xdt)}var eP=(function(){var t=x(function(o,l,u,h){for(u=u||{},h=o.length;h--;u[o[h]]=l);return u},"o"),e=[1,9],r=[1,10],n=[1,5,10,12],i={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SANKEY:4,NEWLINE:5,csv:6,opt_eof:7,record:8,csv_tail:9,EOF:10,"field[source]":11,COMMA:12,"field[target]":13,"field[value]":14,field:15,escaped:16,non_escaped:17,DQUOTE:18,ESCAPED_TEXT:19,NON_ESCAPED_TEXT:20,$accept:0,$end:1},terminals_:{2:"error",4:"SANKEY",5:"NEWLINE",10:"EOF",11:"field[source]",12:"COMMA",13:"field[target]",14:"field[value]",18:"DQUOTE",19:"ESCAPED_TEXT",20:"NON_ESCAPED_TEXT"},productions_:[0,[3,4],[6,2],[9,2],[9,0],[7,1],[7,0],[8,5],[15,1],[15,1],[16,3],[17,1]],performAction:x(function(l,u,h,d,f,p,g){var m=p.length-1;switch(f){case 7:const y=d.findOrCreateNode(p[m-4].trim().replaceAll('""','"')),v=d.findOrCreateNode(p[m-2].trim().replaceAll('""','"')),T=parseFloat(p[m].trim());d.addLink(y,v,T);break;case 8:case 9:case 11:this.$=p[m];break;case 10:this.$=p[m-1];break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},{5:[1,3]},{6:4,8:5,15:6,16:7,17:8,18:e,20:r},{1:[2,6],7:11,10:[1,12]},t(r,[2,4],{9:13,5:[1,14]}),{12:[1,15]},t(n,[2,8]),t(n,[2,9]),{19:[1,16]},t(n,[2,11]),{1:[2,1]},{1:[2,5]},t(r,[2,2]),{6:17,8:5,15:6,16:7,17:8,18:e,20:r},{15:18,16:7,17:8,18:e,20:r},{18:[1,19]},t(r,[2,3]),{12:[1,20]},t(n,[2,10]),{15:21,16:7,17:8,18:e,20:r},t([1,5,10],[2,7])],defaultActions:{11:[2,1],12:[2,5]},parseError:x(function(l,u){if(u.recoverable)this.trace(l);else{var h=new Error(l);throw h.hash=u,h}},"parseError"),parse:x(function(l){var u=this,h=[0],d=[],f=[null],p=[],g=this.table,m="",y=0,v=0,T=2,b=1,w=p.slice.call(arguments,1),k=Object.create(this.lexer),A={yy:{}};for(var C in this.yy)Object.prototype.hasOwnProperty.call(this.yy,C)&&(A.yy[C]=this.yy[C]);k.setInput(l,A.yy),A.yy.lexer=k,A.yy.parser=this,typeof k.yylloc>"u"&&(k.yylloc={});var _=k.yylloc;p.push(_);var L=k.options&&k.options.ranges;typeof A.yy.parseError=="function"?this.parseError=A.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function O(G){h.length=h.length-2*G,f.length=f.length-G,p.length=p.length-G}x(O,"popStack");function M(){var G;return G=d.pop()||k.lex()||b,typeof G!="number"&&(G instanceof Array&&(d=G,G=d.pop()),G=u.symbols_[G]||G),G}x(M,"lex");for(var z,F,S,R,N={},D,I,$,B;;){if(F=h[h.length-1],this.defaultActions[F]?S=this.defaultActions[F]:((z===null||typeof z>"u")&&(z=M()),S=g[F]&&g[F][z]),typeof S>"u"||!S.length||!S[0]){var P="";B=[];for(D in g[F])this.terminals_[D]&&D>T&&B.push("'"+this.terminals_[D]+"'");k.showPosition?P="Parse error on line "+(y+1)+`: -`+k.showPosition()+` -Expecting `+B.join(", ")+", got '"+(this.terminals_[z]||z)+"'":P="Parse error on line "+(y+1)+": Unexpected "+(z==b?"end of input":"'"+(this.terminals_[z]||z)+"'"),this.parseError(P,{text:k.match,token:this.terminals_[z]||z,line:k.yylineno,loc:_,expected:B})}if(S[0]instanceof Array&&S.length>1)throw new Error("Parse Error: multiple actions possible at state: "+F+", token: "+z);switch(S[0]){case 1:h.push(z),f.push(k.yytext),p.push(k.yylloc),h.push(S[1]),z=null,v=k.yyleng,m=k.yytext,y=k.yylineno,_=k.yylloc;break;case 2:if(I=this.productions_[S[1]][1],N.$=f[f.length-I],N._$={first_line:p[p.length-(I||1)].first_line,last_line:p[p.length-1].last_line,first_column:p[p.length-(I||1)].first_column,last_column:p[p.length-1].last_column},L&&(N._$.range=[p[p.length-(I||1)].range[0],p[p.length-1].range[1]]),R=this.performAction.apply(N,[m,v,y,A.yy,S[1],f,p].concat(w)),typeof R<"u")return R;I&&(h=h.slice(0,-1*I*2),f=f.slice(0,-1*I),p=p.slice(0,-1*I)),h.push(this.productions_[S[1]][0]),f.push(N.$),p.push(N._$),$=g[h[h.length-2]][h[h.length-1]],h.push($);break;case 3:return!0}}return!0},"parse")},a=(function(){var o={EOF:1,parseError:x(function(u,h){if(this.yy.parser)this.yy.parser.parseError(u,h);else throw new Error(u)},"parseError"),setInput:x(function(l,u){return this.yy=u||this.yy||{},this._input=l,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:x(function(){var l=this._input[0];this.yytext+=l,this.yyleng++,this.offset++,this.match+=l,this.matched+=l;var u=l.match(/(?:\r\n?|\n).*/g);return u?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),l},"input"),unput:x(function(l){var u=l.length,h=l.split(/(?:\r\n?|\n)/g);this._input=l+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-u),this.offset-=u;var d=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),h.length-1&&(this.yylineno-=h.length-1);var f=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:h?(h.length===d.length?this.yylloc.first_column:0)+d[d.length-h.length].length-h[0].length:this.yylloc.first_column-u},this.options.ranges&&(this.yylloc.range=[f[0],f[0]+this.yyleng-u]),this.yyleng=this.yytext.length,this},"unput"),more:x(function(){return this._more=!0,this},"more"),reject:x(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). -`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:x(function(l){this.unput(this.match.slice(l))},"less"),pastInput:x(function(){var l=this.matched.substr(0,this.matched.length-this.match.length);return(l.length>20?"...":"")+l.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:x(function(){var l=this.match;return l.length<20&&(l+=this._input.substr(0,20-l.length)),(l.substr(0,20)+(l.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:x(function(){var l=this.pastInput(),u=new Array(l.length+1).join("-");return l+this.upcomingInput()+` -`+u+"^"},"showPosition"),test_match:x(function(l,u){var h,d,f;if(this.options.backtrack_lexer&&(f={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(f.yylloc.range=this.yylloc.range.slice(0))),d=l[0].match(/(?:\r\n?|\n).*/g),d&&(this.yylineno+=d.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:d?d[d.length-1].length-d[d.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+l[0].length},this.yytext+=l[0],this.match+=l[0],this.matches=l,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(l[0].length),this.matched+=l[0],h=this.performAction.call(this,this.yy,this,u,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),h)return h;if(this._backtrack){for(var p in f)this[p]=f[p];return!1}return!1},"test_match"),next:x(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var l,u,h,d;this._more||(this.yytext="",this.match="");for(var f=this._currentRules(),p=0;pu[0].length)){if(u=h,d=p,this.options.backtrack_lexer){if(l=this.test_match(h,f[p]),l!==!1)return l;if(this._backtrack){u=!1;continue}else return!1}else if(!this.options.flex)break}return u?(l=this.test_match(u,f[d]),l!==!1?l:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var u=this.next();return u||this.lex()},"lex"),begin:x(function(u){this.conditionStack.push(u)},"begin"),popState:x(function(){var u=this.conditionStack.length-1;return u>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(u){return u=this.conditionStack.length-1-Math.abs(u||0),u>=0?this.conditionStack[u]:"INITIAL"},"topState"),pushState:x(function(u){this.begin(u)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:x(function(u,h,d,f){switch(d){case 0:return this.pushState("csv"),4;case 1:return this.pushState("csv"),4;case 2:return 10;case 3:return 5;case 4:return 12;case 5:return this.pushState("escaped_text"),18;case 6:return 20;case 7:return this.popState("escaped_text"),18;case 8:return 19}},"anonymous"),rules:[/^(?:sankey-beta\b)/i,/^(?:sankey\b)/i,/^(?:$)/i,/^(?:((\u000D\u000A)|(\u000A)))/i,/^(?:(\u002C))/i,/^(?:(\u0022))/i,/^(?:([\u0020-\u0021\u0023-\u002B\u002D-\u007E])*)/i,/^(?:(\u0022)(?!(\u0022)))/i,/^(?:(([\u0020-\u0021\u0023-\u002B\u002D-\u007E])|(\u002C)|(\u000D)|(\u000A)|(\u0022)(\u0022))*)/i],conditions:{csv:{rules:[2,3,4,5,6,7,8],inclusive:!1},escaped_text:{rules:[7,8],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8],inclusive:!0}}};return o})();i.lexer=a;function s(){this.yy={}}return x(s,"Parser"),s.prototype=i,i.Parser=s,new s})();eP.parser=eP;var PS=eP,BS=[],FS=[],zS=new Map,wdt=x(()=>{BS=[],FS=[],zS=new Map,In()},"clear"),Cdt=(Vv=class{constructor(e,r,n=0){this.source=e,this.target=r,this.value=n}},x(Vv,"SankeyLink"),Vv),kdt=x((t,e,r)=>{BS.push(new Cdt(t,e,r))},"addLink"),Edt=(Wv=class{constructor(e){this.ID=e}},x(Wv,"SankeyNode"),Wv),Sdt=x(t=>{t=Lt.sanitizeText(t,Pe());let e=zS.get(t);return e===void 0&&(e=new Edt(t),zS.set(t,e),FS.push(e)),e},"findOrCreateNode"),Adt=x(()=>FS,"getNodes"),_dt=x(()=>BS,"getLinks"),Rdt=x(()=>({nodes:FS.map(t=>({id:t.ID})),links:BS.map(t=>({source:t.source.ID,target:t.target.ID,value:t.value}))}),"getGraph"),Ldt={nodesMap:zS,getConfig:x(()=>Pe().sankey,"getConfig"),getNodes:Adt,getLinks:_dt,getGraph:Rdt,addLink:kdt,findOrCreateNode:Sdt,getAccTitle:Fn,setAccTitle:Dn,getAccDescription:Gn,setAccDescription:zn,getDiagramTitle:Mn,setDiagramTitle:qn,clear:wdt},A1e=(bu=class{static next(e){return new bu(e+ ++bu.count)}constructor(e){this.id=e,this.href=`#${e}`}toString(){return"url("+this.href+")"}},x(bu,"Uid"),bu.count=0,bu),Idt={left:ndt,right:idt,center:adt,justify:x1e},Ddt=x(t=>{let e=0,r=0;for(const n of t){const i=n.value??0;i>e&&(e=i,r=n.layer??0)}return r},"findCentralNodeLayer"),Mdt=x(function(t,e,r,n){const{securityLevel:i,sankey:a}=Pe(),s=$B.sankey;let o;i==="sandbox"&&(o=pt("#i"+e));const l=pt(i==="sandbox"?o.nodes()[0].contentDocument.body:"body"),u=i==="sandbox"?l.select(`[id="${e}"]`):pt(`[id="${e}"]`),h=(a==null?void 0:a.width)??s.width,d=(a==null?void 0:a.height)??s.width,f=(a==null?void 0:a.useMaxWidth)??s.useMaxWidth,p=(a==null?void 0:a.nodeAlignment)??s.nodeAlignment,g=(a==null?void 0:a.prefix)??s.prefix,m=(a==null?void 0:a.suffix)??s.suffix,y=(a==null?void 0:a.showValues)??s.showValues,v=(a==null?void 0:a.nodeWidth)??s.nodeWidth??10,T=(a==null?void 0:a.nodePadding)??s.nodePadding??12,b=(a==null?void 0:a.labelStyle)??s.labelStyle??"legacy",w=(a==null?void 0:a.nodeColors)??{},k=n.db.getGraph(),A=Idt[p];cdt().nodeId(I=>I.id).nodeWidth(v).nodePadding(T+(y?15:0)).nodeAlign(A).extent([[0,0],[h,d]])(k);const _=Ddt(k.nodes),L=Qh(L3e),O=x(I=>w[I]??L(I),"getNodeColor");u.append("g").attr("class","nodes").selectAll(".node").data(k.nodes).join("g").attr("class","node").attr("id",I=>(I.uid=A1e.next("node-")).id).attr("transform",function(I){return"translate("+I.x0+","+I.y0+")"}).attr("x",I=>I.x0).attr("y",I=>I.y0).append("rect").attr("height",I=>I.y1-I.y0).attr("width",I=>I.x1-I.x0).attr("fill",I=>O(I.id));const M=x(({id:I,value:$})=>y?`${I} -${g}${Math.round($*100)/100}${m}`:I,"getText"),z=x(I=>b==="outlined"?(I.layer??0)<_?{x:I.x0-6,anchor:"end"}:{x:I.x1+6,anchor:"start"}:I.x0F.selectAll(I?`.${I}`:"text").data(k.nodes).join("text").attr("class",I??null).attr("x",$=>z($).x).attr("y",$=>($.y1+$.y0)/2).attr("dy",`${y?"0":"0.35"}em`).attr("text-anchor",$=>z($).anchor).text(M),"appendLabel");b==="outlined"?(S("sankey-label-bg"),S("sankey-label-fg")):S();const R=u.append("g").attr("class","links").attr("fill","none").attr("stroke-opacity",.5).selectAll(".link").data(k.links).join("g").attr("class","link").style("mix-blend-mode","multiply"),N=(a==null?void 0:a.linkColor)??"gradient";if(N==="gradient"){const I=R.append("linearGradient").attr("id",$=>($.uid=A1e.next("linearGradient-")).id).attr("gradientUnits","userSpaceOnUse").attr("x1",$=>$.source.x1).attr("x2",$=>$.target.x0);I.append("stop").attr("offset","0%").attr("stop-color",$=>O($.source.id)),I.append("stop").attr("offset","100%").attr("stop-color",$=>O($.target.id))}let D;switch(N){case"gradient":D=x(I=>I.uid,"coloring");break;case"source":D=x(I=>O(I.source.id),"coloring");break;case"target":D=x(I=>O(I.target.id),"coloring");break;default:D=N}R.append("path").attr("d",Tdt()).attr("stroke",D).attr("stroke-width",I=>Math.max(1,I.width)),E0(void 0,u,0,f)},"draw"),Ndt={draw:Mdt},Odt=x(t=>t.replaceAll(/^[^\S\n\r]+|[^\S\n\r]+$/g,"").replaceAll(/([\n\r])+/g,` -`).trim(),"prepareTextForParsing"),$dt=x(t=>`.label { + ${Tw()} +`,"getStyles"),F2t=B2t,z2t={db:N2t,renderer:O2t,parser:w2t,styles:F2t};const G2t=Object.freeze(Object.defineProperty({__proto__:null,diagram:z2t},Symbol.toStringTag,{value:"Module"}));function $we(t,e){let r;if(e===void 0)for(const n of t)n!=null&&(r=n)&&(r=n);else{let n=-1;for(let i of t)(i=e(i,++n,t))!=null&&(r=i)&&(r=i)}return r}function Owe(t,e){let r;if(e===void 0)for(const n of t)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);else{let n=-1;for(let i of t)(i=e(i,++n,t))!=null&&(r>i||r===void 0&&i>=i)&&(r=i)}return r}function kG(t,e){let r=0;if(e===void 0)for(let n of t)(n=+n)&&(r+=n);else{let n=-1;for(let i of t)(i=+e(i,++n,t))&&(r+=i)}return r}function q2t(t){return t.target.depth}function V2t(t){return t.depth}function W2t(t,e){return e-1-t.height}function Pwe(t,e){return t.sourceLinks.length?t.depth:e-1}function U2t(t){return t.targetLinks.length?t.depth:t.sourceLinks.length?Owe(t.sourceLinks,q2t)-1:0}function NA(t){return function(){return t}}function Bwe(t,e){return $A(t.source,e.source)||t.index-e.index}function Fwe(t,e){return $A(t.target,e.target)||t.index-e.index}function $A(t,e){return t.y0-e.y0}function EG(t){return t.value}function H2t(t){return t.index}function Y2t(t){return t.nodes}function X2t(t){return t.links}function zwe(t,e){const r=t.get(e);if(!r)throw new Error("missing: "+e);return r}function Gwe({nodes:t}){for(const e of t){let r=e.y0,n=r;for(const i of e.sourceLinks)i.y0=r+i.width/2,r+=i.width;for(const i of e.targetLinks)i.y1=n+i.width/2,n+=i.width}}function j2t(){let t=0,e=0,r=1,n=1,i=24,a=8,s,o=H2t,l=Pwe,u,h,d=Y2t,f=X2t,p=6;function g(){const R={nodes:d.apply(null,arguments),links:f.apply(null,arguments)};return m(R),y(R),v(R),x(R),C(R),Gwe(R),R}g.update=function(R){return Gwe(R),R},g.nodeId=function(R){return arguments.length?(o=typeof R=="function"?R:NA(R),g):o},g.nodeAlign=function(R){return arguments.length?(l=typeof R=="function"?R:NA(R),g):l},g.nodeSort=function(R){return arguments.length?(u=R,g):u},g.nodeWidth=function(R){return arguments.length?(i=+R,g):i},g.nodePadding=function(R){return arguments.length?(a=s=+R,g):a},g.nodes=function(R){return arguments.length?(d=typeof R=="function"?R:NA(R),g):d},g.links=function(R){return arguments.length?(f=typeof R=="function"?R:NA(R),g):f},g.linkSort=function(R){return arguments.length?(h=R,g):h},g.size=function(R){return arguments.length?(t=e=0,r=+R[0],n=+R[1],g):[r-t,n-e]},g.extent=function(R){return arguments.length?(t=+R[0][0],r=+R[1][0],e=+R[0][1],n=+R[1][1],g):[[t,e],[r,n]]},g.iterations=function(R){return arguments.length?(p=+R,g):p};function m({nodes:R,links:N}){for(const[D,O]of R.entries())O.index=D,O.sourceLinks=[],O.targetLinks=[];const M=new Map(R.map((D,O)=>[o(D,O,R),D]));for(const[D,O]of N.entries()){O.index=D;let{source:B,target:P}=O;typeof B!="object"&&(B=O.source=zwe(M,B)),typeof P!="object"&&(P=O.target=zwe(M,P)),B.sourceLinks.push(O),P.targetLinks.push(O)}if(h!=null)for(const{sourceLinks:D,targetLinks:O}of R)D.sort(h),O.sort(h)}function y({nodes:R}){for(const N of R)N.value=N.fixedValue===void 0?Math.max(kG(N.sourceLinks,EG),kG(N.targetLinks,EG)):N.fixedValue}function v({nodes:R}){const N=R.length;let M=new Set(R),D=new Set,O=0;for(;M.size;){for(const B of M){B.depth=O;for(const{target:P}of B.sourceLinks)D.add(P)}if(++O>N)throw new Error("circular link");M=D,D=new Set}}function x({nodes:R}){const N=R.length;let M=new Set(R),D=new Set,O=0;for(;M.size;){for(const B of M){B.height=O;for(const{source:P}of B.targetLinks)D.add(P)}if(++O>N)throw new Error("circular link");M=D,D=new Set}}function b({nodes:R}){const N=$we(R,O=>O.depth)+1,M=(r-t-i)/(N-1),D=new Array(N);for(const O of R){const B=Math.max(0,Math.min(N-1,Math.floor(l.call(null,O,N))));O.layer=B,O.x0=t+B*M,O.x1=O.x0+i,D[B]?D[B].push(O):D[B]=[O]}if(u)for(const O of D)O.sort(u);return D}function w(R){const N=Owe(R,M=>(n-e-(M.length-1)*s)/kG(M,EG));for(const M of R){let D=e;for(const O of M){O.y0=D,O.y1=D+O.value*N,D=O.y1+s;for(const B of O.sourceLinks)B.width=B.value*N}D=(n-D+s)/(M.length+1);for(let O=0;OM.length)-1)),w(N);for(let M=0;M0))continue;let H=(G/V-P.y0)*N;P.y0+=H,P.y1+=H,I(P)}u===void 0&&B.sort($A),S(B,M)}}function k(R,N,M){for(let D=R.length,O=D-2;O>=0;--O){const B=R[O];for(const P of B){let G=0,V=0;for(const{target:W,value:ie}of P.sourceLinks){let j=ie*(W.layer-P.layer);G+=A(P,W)*j,V+=j}if(!(V>0))continue;let H=(G/V-P.y0)*N;P.y0+=H,P.y1+=H,I(P)}u===void 0&&B.sort($A),S(B,M)}}function S(R,N){const M=R.length>>1,D=R[M];$(R,D.y0-s,M-1,N),L(R,D.y1+s,M+1,N),$(R,n,R.length-1,N),L(R,e,0,N)}function L(R,N,M,D){for(;M1e-6&&(O.y0+=B,O.y1+=B),N=O.y1+s}}function $(R,N,M,D){for(;M>=0;--M){const O=R[M],B=(O.y1-N)*D;B>1e-6&&(O.y0-=B,O.y1-=B),N=O.y0-s}}function I({sourceLinks:R,targetLinks:N}){if(h===void 0){for(const{source:{sourceLinks:M}}of N)M.sort(Fwe);for(const{target:{targetLinks:M}}of R)M.sort(Bwe)}}function z(R){if(h===void 0)for(const{sourceLinks:N,targetLinks:M}of R)N.sort(Fwe),M.sort(Bwe)}function F(R,N){let M=R.y0-(R.sourceLinks.length-1)*s/2;for(const{target:D,width:O}of R.sourceLinks){if(D===N)break;M+=O+s}for(const{source:D,width:O}of N.targetLinks){if(D===R)break;M-=O}return M}function A(R,N){let M=N.y0-(N.targetLinks.length-1)*s/2;for(const{source:D,width:O}of N.targetLinks){if(D===R)break;M+=O+s}for(const{target:D,width:O}of R.sourceLinks){if(D===N)break;M-=O}return M}return g}var SG=Math.PI,_G=2*SG,x0=1e-6,K2t=_G-x0;function AG(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function qwe(){return new AG}AG.prototype=qwe.prototype={constructor:AG,moveTo:function(t,e){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)},closePath:function(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(t,e){this._+="L"+(this._x1=+t)+","+(this._y1=+e)},quadraticCurveTo:function(t,e,r,n){this._+="Q"+ +t+","+ +e+","+(this._x1=+r)+","+(this._y1=+n)},bezierCurveTo:function(t,e,r,n,i,a){this._+="C"+ +t+","+ +e+","+ +r+","+ +n+","+(this._x1=+i)+","+(this._y1=+a)},arcTo:function(t,e,r,n,i){t=+t,e=+e,r=+r,n=+n,i=+i;var a=this._x1,s=this._y1,o=r-t,l=n-e,u=a-t,h=s-e,d=u*u+h*h;if(i<0)throw new Error("negative radius: "+i);if(this._x1===null)this._+="M"+(this._x1=t)+","+(this._y1=e);else if(d>x0)if(!(Math.abs(h*o-l*u)>x0)||!i)this._+="L"+(this._x1=t)+","+(this._y1=e);else{var f=r-a,p=n-s,g=o*o+l*l,m=f*f+p*p,y=Math.sqrt(g),v=Math.sqrt(d),x=i*Math.tan((SG-Math.acos((g+d-m)/(2*y*v)))/2),b=x/v,w=x/y;Math.abs(b-1)>x0&&(this._+="L"+(t+b*u)+","+(e+b*h)),this._+="A"+i+","+i+",0,0,"+ +(h*f>u*p)+","+(this._x1=t+w*o)+","+(this._y1=e+w*l)}},arc:function(t,e,r,n,i,a){t=+t,e=+e,r=+r,a=!!a;var s=r*Math.cos(n),o=r*Math.sin(n),l=t+s,u=e+o,h=1^a,d=a?n-i:i-n;if(r<0)throw new Error("negative radius: "+r);this._x1===null?this._+="M"+l+","+u:(Math.abs(this._x1-l)>x0||Math.abs(this._y1-u)>x0)&&(this._+="L"+l+","+u),r&&(d<0&&(d=d%_G+_G),d>K2t?this._+="A"+r+","+r+",0,1,"+h+","+(t-s)+","+(e-o)+"A"+r+","+r+",0,1,"+h+","+(this._x1=l)+","+(this._y1=u):d>x0&&(this._+="A"+r+","+r+",0,"+ +(d>=SG)+","+h+","+(this._x1=t+r*Math.cos(i))+","+(this._y1=e+r*Math.sin(i))))},rect:function(t,e,r,n){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)+"h"+ +r+"v"+ +n+"h"+-r+"Z"},toString:function(){return this._}};function Vwe(t){return function(){return t}}function Z2t(t){return t[0]}function Q2t(t){return t[1]}var J2t=Array.prototype.slice;function ebt(t){return t.source}function tbt(t){return t.target}function rbt(t){var e=ebt,r=tbt,n=Z2t,i=Q2t,a=null;function s(){var o,l=J2t.call(arguments),u=e.apply(this,l),h=r.apply(this,l);if(a||(a=o=qwe()),t(a,+n.apply(this,(l[0]=u,l)),+i.apply(this,l),+n.apply(this,(l[0]=h,l)),+i.apply(this,l)),o)return a=null,o+""||null}return s.source=function(o){return arguments.length?(e=o,s):e},s.target=function(o){return arguments.length?(r=o,s):r},s.x=function(o){return arguments.length?(n=typeof o=="function"?o:Vwe(+o),s):n},s.y=function(o){return arguments.length?(i=typeof o=="function"?o:Vwe(+o),s):i},s.context=function(o){return arguments.length?(a=o??null,s):a},s}function nbt(t,e,r,n,i){t.moveTo(e,r),t.bezierCurveTo(e=(e+n)/2,r,e,i,n,i)}function ibt(){return rbt(nbt)}function abt(t){return[t.source.x1,t.y0]}function sbt(t){return[t.target.x0,t.y1]}function obt(){return ibt().source(abt).target(sbt)}var RG=(function(){var t=T(function(o,l,u,h){for(u=u||{},h=o.length;h--;u[o[h]]=l);return u},"o"),e=[1,9],r=[1,10],n=[1,5,10,12],i={trace:T(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:T(function(l,u,h,d,f,p,g){var m=p.length-1;switch(f){case 7:const y=d.findOrCreateNode(p[m-4].trim().replaceAll('""','"')),v=d.findOrCreateNode(p[m-2].trim().replaceAll('""','"')),x=parseFloat(p[m].trim());d.addLink(y,v,x);break;case 8:case 9:case 11:this.$=p[m];break;case 10:this.$=p[m-1];break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},{5:[1,3]},{6:4,8:5,15:6,16:7,17:8,18:e,20:r},{1:[2,6],7:11,10:[1,12]},t(r,[2,4],{9:13,5:[1,14]}),{12:[1,15]},t(n,[2,8]),t(n,[2,9]),{19:[1,16]},t(n,[2,11]),{1:[2,1]},{1:[2,5]},t(r,[2,2]),{6:17,8:5,15:6,16:7,17:8,18:e,20:r},{15:18,16:7,17:8,18:e,20:r},{18:[1,19]},t(r,[2,3]),{12:[1,20]},t(n,[2,10]),{15:21,16:7,17:8,18:e,20:r},t([1,5,10],[2,7])],defaultActions:{11:[2,1],12:[2,5]},parseError:T(function(l,u){if(u.recoverable)this.trace(l);else{var h=new Error(l);throw h.hash=u,h}},"parseError"),parse:T(function(l){var u=this,h=[0],d=[],f=[null],p=[],g=this.table,m="",y=0,v=0,x=2,b=1,w=p.slice.call(arguments,1),C=Object.create(this.lexer),_={yy:{}};for(var k in this.yy)Object.prototype.hasOwnProperty.call(this.yy,k)&&(_.yy[k]=this.yy[k]);C.setInput(l,_.yy),_.yy.lexer=C,_.yy.parser=this,typeof C.yylloc>"u"&&(C.yylloc={});var S=C.yylloc;p.push(S);var L=C.options&&C.options.ranges;typeof _.yy.parseError=="function"?this.parseError=_.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function $(G){h.length=h.length-2*G,f.length=f.length-G,p.length=p.length-G}T($,"popStack");function I(){var G;return G=d.pop()||C.lex()||b,typeof G!="number"&&(G instanceof Array&&(d=G,G=d.pop()),G=u.symbols_[G]||G),G}T(I,"lex");for(var z,F,A,R,N={},M,D,O,B;;){if(F=h[h.length-1],this.defaultActions[F]?A=this.defaultActions[F]:((z===null||typeof z>"u")&&(z=I()),A=g[F]&&g[F][z]),typeof A>"u"||!A.length||!A[0]){var P="";B=[];for(M in g[F])this.terminals_[M]&&M>x&&B.push("'"+this.terminals_[M]+"'");C.showPosition?P="Parse error on line "+(y+1)+`: +`+C.showPosition()+` +Expecting `+B.join(", ")+", got '"+(this.terminals_[z]||z)+"'":P="Parse error on line "+(y+1)+": Unexpected "+(z==b?"end of input":"'"+(this.terminals_[z]||z)+"'"),this.parseError(P,{text:C.match,token:this.terminals_[z]||z,line:C.yylineno,loc:S,expected:B})}if(A[0]instanceof Array&&A.length>1)throw new Error("Parse Error: multiple actions possible at state: "+F+", token: "+z);switch(A[0]){case 1:h.push(z),f.push(C.yytext),p.push(C.yylloc),h.push(A[1]),z=null,v=C.yyleng,m=C.yytext,y=C.yylineno,S=C.yylloc;break;case 2:if(D=this.productions_[A[1]][1],N.$=f[f.length-D],N._$={first_line:p[p.length-(D||1)].first_line,last_line:p[p.length-1].last_line,first_column:p[p.length-(D||1)].first_column,last_column:p[p.length-1].last_column},L&&(N._$.range=[p[p.length-(D||1)].range[0],p[p.length-1].range[1]]),R=this.performAction.apply(N,[m,v,y,_.yy,A[1],f,p].concat(w)),typeof R<"u")return R;D&&(h=h.slice(0,-1*D*2),f=f.slice(0,-1*D),p=p.slice(0,-1*D)),h.push(this.productions_[A[1]][0]),f.push(N.$),p.push(N._$),O=g[h[h.length-2]][h[h.length-1]],h.push(O);break;case 3:return!0}}return!0},"parse")},a=(function(){var o={EOF:1,parseError:T(function(u,h){if(this.yy.parser)this.yy.parser.parseError(u,h);else throw new Error(u)},"parseError"),setInput:T(function(l,u){return this.yy=u||this.yy||{},this._input=l,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:T(function(){var l=this._input[0];this.yytext+=l,this.yyleng++,this.offset++,this.match+=l,this.matched+=l;var u=l.match(/(?:\r\n?|\n).*/g);return u?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),l},"input"),unput:T(function(l){var u=l.length,h=l.split(/(?:\r\n?|\n)/g);this._input=l+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-u),this.offset-=u;var d=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),h.length-1&&(this.yylineno-=h.length-1);var f=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:h?(h.length===d.length?this.yylloc.first_column:0)+d[d.length-h.length].length-h[0].length:this.yylloc.first_column-u},this.options.ranges&&(this.yylloc.range=[f[0],f[0]+this.yyleng-u]),this.yyleng=this.yytext.length,this},"unput"),more:T(function(){return this._more=!0,this},"more"),reject:T(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). +`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:T(function(l){this.unput(this.match.slice(l))},"less"),pastInput:T(function(){var l=this.matched.substr(0,this.matched.length-this.match.length);return(l.length>20?"...":"")+l.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:T(function(){var l=this.match;return l.length<20&&(l+=this._input.substr(0,20-l.length)),(l.substr(0,20)+(l.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:T(function(){var l=this.pastInput(),u=new Array(l.length+1).join("-");return l+this.upcomingInput()+` +`+u+"^"},"showPosition"),test_match:T(function(l,u){var h,d,f;if(this.options.backtrack_lexer&&(f={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(f.yylloc.range=this.yylloc.range.slice(0))),d=l[0].match(/(?:\r\n?|\n).*/g),d&&(this.yylineno+=d.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:d?d[d.length-1].length-d[d.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+l[0].length},this.yytext+=l[0],this.match+=l[0],this.matches=l,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(l[0].length),this.matched+=l[0],h=this.performAction.call(this,this.yy,this,u,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),h)return h;if(this._backtrack){for(var p in f)this[p]=f[p];return!1}return!1},"test_match"),next:T(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var l,u,h,d;this._more||(this.yytext="",this.match="");for(var f=this._currentRules(),p=0;pu[0].length)){if(u=h,d=p,this.options.backtrack_lexer){if(l=this.test_match(h,f[p]),l!==!1)return l;if(this._backtrack){u=!1;continue}else return!1}else if(!this.options.flex)break}return u?(l=this.test_match(u,f[d]),l!==!1?l:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:T(function(){var u=this.next();return u||this.lex()},"lex"),begin:T(function(u){this.conditionStack.push(u)},"begin"),popState:T(function(){var u=this.conditionStack.length-1;return u>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:T(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:T(function(u){return u=this.conditionStack.length-1-Math.abs(u||0),u>=0?this.conditionStack[u]:"INITIAL"},"topState"),pushState:T(function(u){this.begin(u)},"pushState"),stateStackSize:T(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:T(function(u,h,d,f){switch(d){case 0:return this.pushState("csv"),4;case 1:return this.pushState("csv"),4;case 2:return 10;case 3:return 5;case 4:return 12;case 5:return this.pushState("escaped_text"),18;case 6:return 20;case 7:return this.popState("escaped_text"),18;case 8:return 19}},"anonymous"),rules:[/^(?:sankey-beta\b)/i,/^(?:sankey\b)/i,/^(?:$)/i,/^(?:((\u000D\u000A)|(\u000A)))/i,/^(?:(\u002C))/i,/^(?:(\u0022))/i,/^(?:([\u0020-\u0021\u0023-\u002B\u002D-\u007E])*)/i,/^(?:(\u0022)(?!(\u0022)))/i,/^(?:(([\u0020-\u0021\u0023-\u002B\u002D-\u007E])|(\u002C)|(\u000D)|(\u000A)|(\u0022)(\u0022))*)/i],conditions:{csv:{rules:[2,3,4,5,6,7,8],inclusive:!1},escaped_text:{rules:[7,8],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8],inclusive:!0}}};return o})();i.lexer=a;function s(){this.yy={}}return T(s,"Parser"),s.prototype=i,i.Parser=s,new s})();RG.parser=RG;var OA=RG,PA=[],BA=[],FA=new Map,lbt=T(()=>{PA=[],BA=[],FA=new Map,Hn()},"clear"),cbt=(wb=class{constructor(e,r,n=0){this.source=e,this.target=r,this.value=n}},T(wb,"SankeyLink"),wb),ubt=T((t,e,r)=>{PA.push(new cbt(t,e,r))},"addLink"),hbt=(Cb=class{constructor(e){this.ID=e}},T(Cb,"SankeyNode"),Cb),dbt=T(t=>{t=Dt.sanitizeText(t,Pe());let e=FA.get(t);return e===void 0&&(e=new hbt(t),FA.set(t,e),BA.push(e)),e},"findOrCreateNode"),fbt=T(()=>BA,"getNodes"),pbt=T(()=>PA,"getLinks"),gbt=T(()=>({nodes:BA.map(t=>({id:t.ID})),links:PA.map(t=>({source:t.source.ID,target:t.target.ID,value:t.value}))}),"getGraph"),mbt={nodesMap:FA,getConfig:T(()=>Pe().sankey,"getConfig"),getNodes:fbt,getLinks:pbt,getGraph:gbt,addLink:ubt,findOrCreateNode:dbt,getAccTitle:ii,setAccTitle:Yn,getAccDescription:si,setAccDescription:ai,getDiagramTitle:Xn,setDiagramTitle:oi,clear:lbt},Wwe=(vh=class{static next(e){return new vh(e+ ++vh.count)}constructor(e){this.id=e,this.href=`#${e}`}toString(){return"url("+this.href+")"}},T(vh,"Uid"),vh.count=0,vh),ybt={left:V2t,right:W2t,center:U2t,justify:Pwe},vbt=T(t=>{let e=0,r=0;for(const n of t){const i=n.value??0;i>e&&(e=i,r=n.layer??0)}return r},"findCentralNodeLayer"),bbt=T(function(t,e,r,n){const{securityLevel:i,sankey:a}=Pe(),s=hV.sankey;let o;i==="sandbox"&&(o=gt("#i"+e));const l=gt(i==="sandbox"?o.nodes()[0].contentDocument.body:"body"),u=i==="sandbox"?l.select(`[id="${e}"]`):gt(`[id="${e}"]`),h=(a==null?void 0:a.width)??s.width,d=(a==null?void 0:a.height)??s.width,f=(a==null?void 0:a.useMaxWidth)??s.useMaxWidth,p=(a==null?void 0:a.nodeAlignment)??s.nodeAlignment,g=(a==null?void 0:a.prefix)??s.prefix,m=(a==null?void 0:a.suffix)??s.suffix,y=(a==null?void 0:a.showValues)??s.showValues,v=(a==null?void 0:a.nodeWidth)??s.nodeWidth??10,x=(a==null?void 0:a.nodePadding)??s.nodePadding??12,b=(a==null?void 0:a.labelStyle)??s.labelStyle??"legacy",w=(a==null?void 0:a.nodeColors)??{},C=n.db.getGraph(),_=ybt[p];j2t().nodeId(D=>D.id).nodeWidth(v).nodePadding(x+(y?15:0)).nodeAlign(_).extent([[0,0],[h,d]])(C);const S=vbt(C.nodes),L=ef(Y7e),$=T(D=>w[D]??L(D),"getNodeColor");u.append("g").attr("class","nodes").selectAll(".node").data(C.nodes).join("g").attr("class","node").attr("id",D=>(D.uid=Wwe.next("node-")).id).attr("transform",function(D){return"translate("+D.x0+","+D.y0+")"}).attr("x",D=>D.x0).attr("y",D=>D.y0).append("rect").attr("height",D=>D.y1-D.y0).attr("width",D=>D.x1-D.x0).attr("fill",D=>$(D.id));const I=T(({id:D,value:O})=>y?`${D} +${g}${Math.round(O*100)/100}${m}`:D,"getText"),z=T(D=>b==="outlined"?(D.layer??0)F.selectAll(D?`.${D}`:"text").data(C.nodes).join("text").attr("class",D??null).attr("x",O=>z(O).x).attr("y",O=>(O.y1+O.y0)/2).attr("dy",`${y?"0":"0.35"}em`).attr("text-anchor",O=>z(O).anchor).text(I),"appendLabel");b==="outlined"?(A("sankey-label-bg"),A("sankey-label-fg")):A();const R=u.append("g").attr("class","links").attr("fill","none").attr("stroke-opacity",.5).selectAll(".link").data(C.links).join("g").attr("class","link").style("mix-blend-mode","multiply"),N=(a==null?void 0:a.linkColor)??"gradient";if(N==="gradient"){const D=R.append("linearGradient").attr("id",O=>(O.uid=Wwe.next("linearGradient-")).id).attr("gradientUnits","userSpaceOnUse").attr("x1",O=>O.source.x1).attr("x2",O=>O.target.x0);D.append("stop").attr("offset","0%").attr("stop-color",O=>$(O.source.id)),D.append("stop").attr("offset","100%").attr("stop-color",O=>$(O.target.id))}let M;switch(N){case"gradient":M=T(D=>D.uid,"coloring");break;case"source":M=T(D=>$(D.source.id),"coloring");break;case"target":M=T(D=>$(D.target.id),"coloring");break;default:M=N}R.append("path").attr("d",obt()).attr("stroke",M).attr("stroke-width",D=>Math.max(1,D.width)),G0(void 0,u,0,f)},"draw"),xbt={draw:bbt},Tbt=T(t=>t.replaceAll(/^[^\S\n\r]+|[^\S\n\r]+$/g,"").replaceAll(/([\n\r])+/g,` +`).trim(),"prepareTextForParsing"),wbt=T(t=>`.label { font-family: ${t.fontFamily}; } @@ -2935,7 +2936,7 @@ ${g}${Math.round($*100)/100}${m}`:I,"getText"),z=x(I=>b==="outlined"?(I.layer??0 stroke-opacity: 0.5; mix-blend-mode: multiply; } -`,"getStyles"),Pdt=$dt,Bdt=PS.parse.bind(PS);PS.parse=t=>Bdt(Odt(t));var Fdt={styles:Pdt,parser:PS,db:Ldt,renderer:Ndt};const zdt=Object.freeze(Object.defineProperty({__proto__:null,diagram:Fdt},Symbol.toStringTag,{value:"Module"}));var Gdt=Fr.packet,_1e=(Uv=class{constructor(){this.packet=[],this.setAccTitle=Dn,this.getAccTitle=Fn,this.setDiagramTitle=qn,this.getDiagramTitle=Mn,this.getAccDescription=Gn,this.setAccDescription=zn}getConfig(){const e=ti({...Gdt,...lr().packet});return e.showBits&&(e.paddingY+=10),e}getPacket(){return this.packet}pushWord(e){e.length>0&&this.packet.push(e)}clear(){In(),this.packet=[]}},x(Uv,"PacketDB"),Uv),qdt=1e4,Vdt=x((t,e)=>{zl(t,e);let r=-1,n=[],i=1;const{bitsPerRow:a}=e.getConfig();for(let{start:s,end:o,bits:l,label:u}of t.blocks){if(s!==void 0&&o!==void 0&&o{if(t.start===void 0)throw new Error("start should have been set during first phase");if(t.end===void 0)throw new Error("end should have been set during first phase");if(t.start>t.end)throw new Error(`Block start ${t.start} is greater than block end ${t.end}.`);if(t.end+1<=e*r)return[t,void 0];const n=e*r-1,i=e*r;return[{start:t.start,end:n,label:t.label,bits:n-t.start},{start:i,end:t.end,label:t.label,bits:t.end-i}]},"getNextFittingBlock"),R1e={parser:{yy:void 0},parse:x(async t=>{var n;const e=await Qo("packet",t),r=(n=R1e.parser)==null?void 0:n.yy;if(!(r instanceof _1e))throw new Error("parser.parser?.yy was not a PacketDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");ae.debug(e),Vdt(e,r)},"parse")},Udt=x((t,e,r,n)=>{const i=n.db,a=i.getConfig(),{rowHeight:s,paddingY:o,bitWidth:l,bitsPerRow:u}=a,h=i.getPacket(),d=i.getDiagramTitle(),f=s+o,p=f*(h.length+1)-(d?0:s),g=l*u+2,m=ys(e);m.attr("viewBox",`0 0 ${g} ${p}`),wi(m,p,g,a.useMaxWidth);for(const[y,v]of h.entries())Hdt(m,v,y,a);m.append("text").text(d).attr("x",g/2).attr("y",p-f/2).attr("dominant-baseline","middle").attr("text-anchor","middle").attr("class","packetTitle")},"draw"),Hdt=x((t,e,r,{rowHeight:n,paddingX:i,paddingY:a,bitWidth:s,bitsPerRow:o,showBits:l})=>{const u=t.append("g"),h=r*(n+a)+a;for(const d of e){const f=d.start%o*s+1,p=(d.end-d.start+1)*s-i;if(u.append("rect").attr("x",f).attr("y",h).attr("width",p).attr("height",n).attr("class","packetBlock"),u.append("text").attr("x",f+p/2).attr("y",h+n/2).attr("class","packetLabel").attr("dominant-baseline","middle").attr("text-anchor","middle").text(d.label),!l)continue;const g=d.end===d.start,m=h-2;u.append("text").attr("x",f+(g?p/2:0)).attr("y",m).attr("class","packetByte start").attr("dominant-baseline","auto").attr("text-anchor",g?"middle":"start").text(d.start),g||u.append("text").attr("x",f+p).attr("y",m).attr("class","packetByte end").attr("dominant-baseline","auto").attr("text-anchor","end").text(d.end)}},"drawWord"),Ydt={draw:Udt},Xdt={byteFontSize:"10px",startByteColor:"black",endByteColor:"black",labelColor:"black",labelFontSize:"12px",titleColor:"black",titleFontSize:"14px",blockStrokeColor:"black",blockStrokeWidth:"1",blockFillColor:"#efefef"},Kdt=x(({packet:t}={})=>{const e=ti(Xdt,t);return` +`,"getStyles"),Cbt=wbt,kbt=OA.parse.bind(OA);OA.parse=t=>kbt(Tbt(t));var Ebt={styles:Cbt,parser:OA,db:mbt,renderer:xbt};const Sbt=Object.freeze(Object.defineProperty({__proto__:null,diagram:Ebt},Symbol.toStringTag,{value:"Module"}));var _bt=Xr.packet,Uwe=(kb=class{constructor(){this.packet=[],this.setAccTitle=Yn,this.getAccTitle=ii,this.setDiagramTitle=oi,this.getDiagramTitle=Xn,this.getAccDescription=si,this.setAccDescription=ai}getConfig(){const e=wi({..._bt,...pr().packet});return e.showBits&&(e.paddingY+=10),e}getPacket(){return this.packet}pushWord(e){e.length>0&&this.packet.push(e)}clear(){Hn(),this.packet=[]}},T(kb,"PacketDB"),kb),Abt=1e4,Rbt=T((t,e)=>{Rc(t,e);let r=-1,n=[],i=1;const{bitsPerRow:a}=e.getConfig();for(let{start:s,end:o,bits:l,label:u}of t.blocks){if(s!==void 0&&o!==void 0&&o{if(t.start===void 0)throw new Error("start should have been set during first phase");if(t.end===void 0)throw new Error("end should have been set during first phase");if(t.start>t.end)throw new Error(`Block start ${t.start} is greater than block end ${t.end}.`);if(t.end+1<=e*r)return[t,void 0];const n=e*r-1,i=e*r;return[{start:t.start,end:n,label:t.label,bits:n-t.start},{start:i,end:t.end,label:t.label,bits:t.end-i}]},"getNextFittingBlock"),Hwe={parser:{yy:void 0},parse:T(async t=>{var n;const e=await Bl("packet",t),r=(n=Hwe.parser)==null?void 0:n.yy;if(!(r instanceof Uwe))throw new Error("parser.parser?.yy was not a PacketDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");se.debug(e),Rbt(e,r)},"parse")},Ibt=T((t,e,r,n)=>{const i=n.db,a=i.getConfig(),{rowHeight:s,paddingY:o,bitWidth:l,bitsPerRow:u}=a,h=i.getPacket(),d=i.getDiagramTitle(),f=s+o,p=f*(h.length+1)-(d?0:s),g=l*u+2,m=Ys(e);m.attr("viewBox",`0 0 ${g} ${p}`),Wi(m,p,g,a.useMaxWidth);for(const[y,v]of h.entries())Dbt(m,v,y,a);m.append("text").text(d).attr("x",g/2).attr("y",p-f/2).attr("dominant-baseline","middle").attr("text-anchor","middle").attr("class","packetTitle")},"draw"),Dbt=T((t,e,r,{rowHeight:n,paddingX:i,paddingY:a,bitWidth:s,bitsPerRow:o,showBits:l})=>{const u=t.append("g"),h=r*(n+a)+a;for(const d of e){const f=d.start%o*s+1,p=(d.end-d.start+1)*s-i;if(u.append("rect").attr("x",f).attr("y",h).attr("width",p).attr("height",n).attr("class","packetBlock"),u.append("text").attr("x",f+p/2).attr("y",h+n/2).attr("class","packetLabel").attr("dominant-baseline","middle").attr("text-anchor","middle").text(d.label),!l)continue;const g=d.end===d.start,m=h-2;u.append("text").attr("x",f+(g?p/2:0)).attr("y",m).attr("class","packetByte start").attr("dominant-baseline","auto").attr("text-anchor",g?"middle":"start").text(d.start),g||u.append("text").attr("x",f+p).attr("y",m).attr("class","packetByte end").attr("dominant-baseline","auto").attr("text-anchor","end").text(d.end)}},"drawWord"),Mbt={draw:Ibt},Nbt={byteFontSize:"10px",startByteColor:"black",endByteColor:"black",labelColor:"black",labelFontSize:"12px",titleColor:"black",titleFontSize:"14px",blockStrokeColor:"black",blockStrokeWidth:"1",blockFillColor:"#efefef"},$bt=T(({packet:t}={})=>{const e=wi(Nbt,t);return` .packetByte { font-size: ${e.byteFontSize}; } @@ -2958,7 +2959,7 @@ ${g}${Math.round($*100)/100}${m}`:I,"getText"),z=x(I=>b==="outlined"?(I.layer??0 stroke-width: ${e.blockStrokeWidth}; fill: ${e.blockFillColor}; } - `},"styles"),jdt={parser:R1e,get db(){return new _1e},renderer:Ydt,styles:Kdt};const Zdt=Object.freeze(Object.defineProperty({__proto__:null,diagram:jdt},Symbol.toStringTag,{value:"Module"}));var om={showLegend:!0,ticks:5,max:null,min:0,graticule:"circle"},L1e={axes:[],curves:[],options:om},a0=structuredClone(L1e),Qdt=Fr.radar,Jdt=x(()=>ti({...Qdt,...lr().radar}),"getConfig"),I1e=x(()=>a0.axes,"getAxes"),eft=x(()=>a0.curves,"getCurves"),tft=x(()=>a0.options,"getOptions"),rft=x(t=>{a0.axes=t.map(e=>({name:e.name,label:e.label??e.name}))},"setAxes"),nft=x(t=>{a0.curves=t.map(e=>({name:e.name,label:e.label??e.name,entries:ift(e.entries)}))},"setCurves"),ift=x(t=>{if(t[0].axis==null)return t.map(r=>r.value);const e=I1e();if(e.length===0)throw new Error("Axes must be populated before curves for reference entries");return e.map(r=>{const n=t.find(i=>{var a;return((a=i.axis)==null?void 0:a.$refText)===r.name});if(n===void 0)throw new Error("Missing entry for axis "+r.label);return n.value})},"computeCurveEntries"),aft=x(t=>{var r,n,i,a,s;const e=t.reduce((o,l)=>(o[l.name]=l,o),{});a0.options={showLegend:((r=e.showLegend)==null?void 0:r.value)??om.showLegend,ticks:((n=e.ticks)==null?void 0:n.value)??om.ticks,max:((i=e.max)==null?void 0:i.value)??om.max,min:((a=e.min)==null?void 0:a.value)??om.min,graticule:((s=e.graticule)==null?void 0:s.value)??om.graticule}},"setOptions"),sft=x(()=>{In(),a0=structuredClone(L1e)},"clear"),rw={getAxes:I1e,getCurves:eft,getOptions:tft,setAxes:rft,setCurves:nft,setOptions:aft,getConfig:Jdt,clear:sft,setAccTitle:Dn,getAccTitle:Fn,setDiagramTitle:qn,getDiagramTitle:Mn,getAccDescription:Gn,setAccDescription:zn},oft=x(t=>{zl(t,rw);const{axes:e,curves:r,options:n}=t;rw.setAxes(e),rw.setCurves(r),rw.setOptions(n)},"populate"),lft={parse:x(async t=>{const e=await Qo("radar",t);ae.debug(e),oft(e)},"parse")},cft=x((t,e,r,n)=>{const i=n.db,a=i.getAxes(),s=i.getCurves(),o=i.getOptions(),l=i.getConfig(),u=i.getDiagramTitle(),h=ys(e),d=uft(h,l),f=o.max??Math.max(...s.map(m=>Math.max(...m.entries))),p=o.min,g=Math.min(l.width,l.height)/2;hft(d,a,g,o.ticks,o.graticule),dft(d,a,g,l),D1e(d,a,s,p,f,o.graticule,l),O1e(d,s,o.showLegend,l),d.append("text").attr("class","radarTitle").text(u).attr("x",0).attr("y",-l.height/2-l.marginTop)},"draw"),uft=x((t,e)=>{const r=e.width+e.marginLeft+e.marginRight,n=e.height+e.marginTop+e.marginBottom,i={x:e.marginLeft+e.width/2,y:e.marginTop+e.height/2};return wi(t,n,r,e.useMaxWidth??!0),t.attr("viewBox",`0 0 ${r} ${n}`),t.append("g").attr("transform",`translate(${i.x}, ${i.y})`)},"drawFrame"),hft=x((t,e,r,n,i)=>{if(i==="circle")for(let a=0;a{const d=2*h*Math.PI/a-Math.PI/2,f=o*Math.cos(d),p=o*Math.sin(d);return`${f},${p}`}).join(" ");t.append("polygon").attr("points",l).attr("class","radarGraticule")}}},"drawGraticule"),dft=x((t,e,r,n)=>{const i=e.length;for(let a=0;a{if(u.entries.length!==o)return;const d=u.entries.map((f,p)=>{const g=2*Math.PI*p/o-Math.PI/2,m=M1e(f,n,i,l),y=m*Math.cos(g),v=m*Math.sin(g);return{x:y,y:v}});a==="circle"?t.append("path").attr("d",N1e(d,s.curveTension)).attr("class",`radarCurve-${h}`):a==="polygon"&&t.append("polygon").attr("points",d.map(f=>`${f.x},${f.y}`).join(" ")).attr("class",`radarCurve-${h}`)})}x(D1e,"drawCurves");function M1e(t,e,r,n){const i=Math.min(Math.max(t,e),r);return n*(i-e)/(r-e)}x(M1e,"relativeRadius");function N1e(t,e){const r=t.length;let n=`M${t[0].x},${t[0].y}`;for(let i=0;i{const u=t.append("g").attr("transform",`translate(${i}, ${a+l*s})`);u.append("rect").attr("width",12).attr("height",12).attr("class",`radarLegendBox-${l}`),u.append("text").attr("x",16).attr("y",0).attr("class","radarLegendText").text(o.label)})}x(O1e,"drawLegend");var fft={draw:cft},pft=x((t,e)=>{let r="";for(let n=0;nwi({...Bbt,...pr().radar}),"getConfig"),Xwe=T(()=>T0.axes,"getAxes"),zbt=T(()=>T0.curves,"getCurves"),Gbt=T(()=>T0.options,"getOptions"),qbt=T(t=>{T0.axes=t.map(e=>({name:e.name,label:e.label??e.name}))},"setAxes"),Vbt=T(t=>{T0.curves=t.map(e=>({name:e.name,label:e.label??e.name,entries:Wbt(e.entries)}))},"setCurves"),Wbt=T(t=>{if(t[0].axis==null)return t.map(r=>r.value);const e=Xwe();if(e.length===0)throw new Error("Axes must be populated before curves for reference entries");return e.map(r=>{const n=t.find(i=>{var a;return((a=i.axis)==null?void 0:a.$refText)===r.name});if(n===void 0)throw new Error("Missing entry for axis "+r.label);return n.value})},"computeCurveEntries"),Ubt=T(t=>{var r,n,i,a,s;const e=t.reduce((o,l)=>(o[l.name]=l,o),{});T0.options={showLegend:((r=e.showLegend)==null?void 0:r.value)??z1.showLegend,ticks:((n=e.ticks)==null?void 0:n.value)??z1.ticks,max:((i=e.max)==null?void 0:i.value)??z1.max,min:((a=e.min)==null?void 0:a.value)??z1.min,graticule:((s=e.graticule)==null?void 0:s.value)??z1.graticule}},"setOptions"),Hbt=T(()=>{Hn(),T0=structuredClone(Ywe)},"clear"),c4={getAxes:Xwe,getCurves:zbt,getOptions:Gbt,setAxes:qbt,setCurves:Vbt,setOptions:Ubt,getConfig:Fbt,clear:Hbt,setAccTitle:Yn,getAccTitle:ii,setDiagramTitle:oi,getDiagramTitle:Xn,getAccDescription:si,setAccDescription:ai},Ybt=T(t=>{Rc(t,c4);const{axes:e,curves:r,options:n}=t;c4.setAxes(e),c4.setCurves(r),c4.setOptions(n)},"populate"),Xbt={parse:T(async t=>{const e=await Bl("radar",t);se.debug(e),Ybt(e)},"parse")},jbt=T((t,e,r,n)=>{const i=n.db,a=i.getAxes(),s=i.getCurves(),o=i.getOptions(),l=i.getConfig(),u=i.getDiagramTitle(),h=Ys(e),d=Kbt(h,l),f=o.max??Math.max(...s.map(m=>Math.max(...m.entries))),p=o.min,g=Math.min(l.width,l.height)/2;Zbt(d,a,g,o.ticks,o.graticule),Qbt(d,a,g,l),jwe(d,a,s,p,f,o.graticule,l),Qwe(d,s,o.showLegend,l),d.append("text").attr("class","radarTitle").text(u).attr("x",0).attr("y",-l.height/2-l.marginTop)},"draw"),Kbt=T((t,e)=>{const r=e.width+e.marginLeft+e.marginRight,n=e.height+e.marginTop+e.marginBottom,i={x:e.marginLeft+e.width/2,y:e.marginTop+e.height/2};return Wi(t,n,r,e.useMaxWidth??!0),t.attr("viewBox",`0 0 ${r} ${n}`),t.append("g").attr("transform",`translate(${i.x}, ${i.y})`)},"drawFrame"),Zbt=T((t,e,r,n,i)=>{if(i==="circle")for(let a=0;a{const d=2*h*Math.PI/a-Math.PI/2,f=o*Math.cos(d),p=o*Math.sin(d);return`${f},${p}`}).join(" ");t.append("polygon").attr("points",l).attr("class","radarGraticule")}}},"drawGraticule"),Qbt=T((t,e,r,n)=>{const i=e.length;for(let a=0;a{if(u.entries.length!==o)return;const d=u.entries.map((f,p)=>{const g=2*Math.PI*p/o-Math.PI/2,m=Kwe(f,n,i,l),y=m*Math.cos(g),v=m*Math.sin(g);return{x:y,y:v}});a==="circle"?t.append("path").attr("d",Zwe(d,s.curveTension)).attr("class",`radarCurve-${h}`):a==="polygon"&&t.append("polygon").attr("points",d.map(f=>`${f.x},${f.y}`).join(" ")).attr("class",`radarCurve-${h}`)})}T(jwe,"drawCurves");function Kwe(t,e,r,n){const i=Math.min(Math.max(t,e),r);return n*(i-e)/(r-e)}T(Kwe,"relativeRadius");function Zwe(t,e){const r=t.length;let n=`M${t[0].x},${t[0].y}`;for(let i=0;i{const u=t.append("g").attr("transform",`translate(${i}, ${a+l*s})`);u.append("rect").attr("width",12).attr("height",12).attr("class",`radarLegendBox-${l}`),u.append("text").attr("x",16).attr("y",0).attr("class","radarLegendText").text(o.label)})}T(Qwe,"drawLegend");var Jbt={draw:jbt},ext=T((t,e)=>{let r="";for(let n=0;nb==="outlined"?(I.layer??0 fill-opacity: ${e.curveOpacity}; stroke: ${i}; } - `}return r},"genIndexStyles"),gft=x(t=>{const e=w0(),r=lr(),n=ti(e,r.themeVariables),i=ti(n.radar,t);return{themeVariables:n,radarOptions:i}},"buildRadarStyleOptions"),mft=x(({radar:t}={})=>{const{themeVariables:e,radarOptions:r}=gft(t);return` + `}return r},"genIndexStyles"),txt=T(t=>{const e=B0(),r=pr(),n=wi(e,r.themeVariables),i=wi(n.radar,t);return{themeVariables:n,radarOptions:i}},"buildRadarStyleOptions"),rxt=T(({radar:t}={})=>{const{themeVariables:e,radarOptions:r}=txt(t);return` .radarTitle { font-size: ${e.fontSize}; color: ${e.titleColor}; @@ -2999,13 +3000,13 @@ ${g}${Math.round($*100)/100}${m}`:I,"getText"),z=x(I=>b==="outlined"?(I.layer??0 font-size: ${r.legendFontSize}px; dominant-baseline: hanging; } - ${pft(e,r)} - `},"styles"),yft={parser:lft,db:rw,renderer:fft,styles:mft};const vft=Object.freeze(Object.defineProperty({__proto__:null,diagram:yft},Symbol.toStringTag,{value:"Module"}));var tP=(function(){var t=x(function(b,w,k,A){for(k=k||{},A=b.length;A--;k[b[A]]=w);return k},"o"),e=[1,15],r=[1,7],n=[1,13],i=[1,14],a=[1,19],s=[1,16],o=[1,17],l=[1,18],u=[8,30],h=[8,10,21,28,29,30,31,39,43,46],d=[1,23],f=[1,24],p=[8,10,15,16,21,28,29,30,31,39,43,46],g=[8,10,15,16,21,27,28,29,30,31,39,43,46],m=[1,49],y={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,spaceLines:3,SPACELINE:4,NL:5,separator:6,SPACE:7,EOF:8,start:9,BLOCK_DIAGRAM_KEY:10,document:11,stop:12,statement:13,link:14,LINK:15,START_LINK:16,LINK_LABEL:17,STR:18,nodeStatement:19,columnsStatement:20,SPACE_BLOCK:21,blockStatement:22,classDefStatement:23,cssClassStatement:24,styleStatement:25,node:26,SIZE:27,COLUMNS:28,"id-block":29,end:30,NODE_ID:31,nodeShapeNLabel:32,dirList:33,DIR:34,NODE_DSTART:35,NODE_DEND:36,BLOCK_ARROW_START:37,BLOCK_ARROW_END:38,classDef:39,CLASSDEF_ID:40,CLASSDEF_STYLEOPTS:41,DEFAULT:42,class:43,CLASSENTITY_IDS:44,STYLECLASS:45,style:46,STYLE_ENTITY_IDS:47,STYLE_DEFINITION_DATA:48,$accept:0,$end:1},terminals_:{2:"error",4:"SPACELINE",5:"NL",7:"SPACE",8:"EOF",10:"BLOCK_DIAGRAM_KEY",15:"LINK",16:"START_LINK",17:"LINK_LABEL",18:"STR",21:"SPACE_BLOCK",27:"SIZE",28:"COLUMNS",29:"id-block",30:"end",31:"NODE_ID",34:"DIR",35:"NODE_DSTART",36:"NODE_DEND",37:"BLOCK_ARROW_START",38:"BLOCK_ARROW_END",39:"classDef",40:"CLASSDEF_ID",41:"CLASSDEF_STYLEOPTS",42:"DEFAULT",43:"class",44:"CLASSENTITY_IDS",45:"STYLECLASS",46:"style",47:"STYLE_ENTITY_IDS",48:"STYLE_DEFINITION_DATA"},productions_:[0,[3,1],[3,2],[3,2],[6,1],[6,1],[6,1],[9,3],[12,1],[12,1],[12,2],[12,2],[11,1],[11,2],[14,1],[14,4],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[19,3],[19,2],[19,1],[20,1],[22,4],[22,3],[26,1],[26,2],[33,1],[33,2],[32,3],[32,4],[23,3],[23,3],[24,3],[25,3]],performAction:x(function(w,k,A,C,_,L,O){var M=L.length-1;switch(_){case 4:C.getLogger().debug("Rule: separator (NL) ");break;case 5:C.getLogger().debug("Rule: separator (Space) ");break;case 6:C.getLogger().debug("Rule: separator (EOF) ");break;case 7:C.getLogger().debug("Rule: hierarchy: ",L[M-1]),C.setHierarchy(L[M-1]);break;case 8:C.getLogger().debug("Stop NL ");break;case 9:C.getLogger().debug("Stop EOF ");break;case 10:C.getLogger().debug("Stop NL2 ");break;case 11:C.getLogger().debug("Stop EOF2 ");break;case 12:C.getLogger().debug("Rule: statement: ",L[M]),typeof L[M].length=="number"?this.$=L[M]:this.$=[L[M]];break;case 13:C.getLogger().debug("Rule: statement #2: ",L[M-1]),this.$=[L[M-1]].concat(L[M]);break;case 14:C.getLogger().debug("Rule: link: ",L[M],w),this.$={edgeTypeStr:L[M],label:""};break;case 15:C.getLogger().debug("Rule: LABEL link: ",L[M-3],L[M-1],L[M]),this.$={edgeTypeStr:L[M],label:L[M-1]};break;case 18:const z=parseInt(L[M]),F=C.generateId();this.$={id:F,type:"space",label:"",width:z,children:[]};break;case 23:C.getLogger().debug("Rule: (nodeStatement link node) ",L[M-2],L[M-1],L[M]," typestr: ",L[M-1].edgeTypeStr);const S=C.edgeStrToEdgeData(L[M-1].edgeTypeStr),R=C.edgeStrToEdgeStartData(L[M-1].edgeTypeStr),N=C.edgeStrToThickness(L[M-1].edgeTypeStr),D=C.edgeStrToPattern(L[M-1].edgeTypeStr);this.$=[{id:L[M-2].id,label:L[M-2].label,type:L[M-2].type,directions:L[M-2].directions},{id:L[M-2].id+"-"+L[M].id,start:L[M-2].id,end:L[M].id,label:L[M-1].label,type:"edge",thickness:N,pattern:D,directions:L[M].directions,arrowTypeEnd:S,arrowTypeStart:R},{id:L[M].id,label:L[M].label,type:C.typeStr2Type(L[M].typeStr),directions:L[M].directions}];break;case 24:C.getLogger().debug("Rule: nodeStatement (abc88 node size) ",L[M-1],L[M]),this.$={id:L[M-1].id,label:L[M-1].label,type:C.typeStr2Type(L[M-1].typeStr),directions:L[M-1].directions,widthInColumns:parseInt(L[M],10)};break;case 25:C.getLogger().debug("Rule: nodeStatement (node) ",L[M]),this.$={id:L[M].id,label:L[M].label,type:C.typeStr2Type(L[M].typeStr),directions:L[M].directions,widthInColumns:1};break;case 26:C.getLogger().debug("APA123",this?this:"na"),C.getLogger().debug("COLUMNS: ",L[M]),this.$={type:"column-setting",columns:L[M]==="auto"?-1:parseInt(L[M])};break;case 27:C.getLogger().debug("Rule: id-block statement : ",L[M-2],L[M-1]),C.generateId(),this.$={...L[M-2],type:"composite",children:L[M-1]};break;case 28:C.getLogger().debug("Rule: blockStatement : ",L[M-2],L[M-1],L[M]);const I=C.generateId();this.$={id:I,type:"composite",label:"",children:L[M-1]};break;case 29:C.getLogger().debug("Rule: node (NODE_ID separator): ",L[M]),this.$={id:L[M]};break;case 30:C.getLogger().debug("Rule: node (NODE_ID nodeShapeNLabel separator): ",L[M-1],L[M]),this.$={id:L[M-1],label:L[M].label,typeStr:L[M].typeStr,directions:L[M].directions};break;case 31:C.getLogger().debug("Rule: dirList: ",L[M]),this.$=[L[M]];break;case 32:C.getLogger().debug("Rule: dirList: ",L[M-1],L[M]),this.$=[L[M-1]].concat(L[M]);break;case 33:C.getLogger().debug("Rule: nodeShapeNLabel: ",L[M-2],L[M-1],L[M]),this.$={typeStr:L[M-2]+L[M],label:L[M-1]};break;case 34:C.getLogger().debug("Rule: BLOCK_ARROW nodeShapeNLabel: ",L[M-3],L[M-2]," #3:",L[M-1],L[M]),this.$={typeStr:L[M-3]+L[M],label:L[M-2],directions:L[M-1]};break;case 35:case 36:this.$={type:"classDef",id:L[M-1].trim(),css:L[M].trim()};break;case 37:this.$={type:"applyClass",id:L[M-1].trim(),styleClass:L[M].trim()};break;case 38:this.$={type:"applyStyles",id:L[M-1].trim(),stylesStr:L[M].trim()};break}},"anonymous"),table:[{9:1,10:[1,2]},{1:[3]},{10:e,11:3,13:4,19:5,20:6,21:r,22:8,23:9,24:10,25:11,26:12,28:n,29:i,31:a,39:s,43:o,46:l},{8:[1,20]},t(u,[2,12],{13:4,19:5,20:6,22:8,23:9,24:10,25:11,26:12,11:21,10:e,21:r,28:n,29:i,31:a,39:s,43:o,46:l}),t(h,[2,16],{14:22,15:d,16:f}),t(h,[2,17]),t(h,[2,18]),t(h,[2,19]),t(h,[2,20]),t(h,[2,21]),t(h,[2,22]),t(p,[2,25],{27:[1,25]}),t(h,[2,26]),{19:26,26:12,31:a},{10:e,11:27,13:4,19:5,20:6,21:r,22:8,23:9,24:10,25:11,26:12,28:n,29:i,31:a,39:s,43:o,46:l},{40:[1,28],42:[1,29]},{44:[1,30]},{47:[1,31]},t(g,[2,29],{32:32,35:[1,33],37:[1,34]}),{1:[2,7]},t(u,[2,13]),{26:35,31:a},{31:[2,14]},{17:[1,36]},t(p,[2,24]),{10:e,11:37,13:4,14:22,15:d,16:f,19:5,20:6,21:r,22:8,23:9,24:10,25:11,26:12,28:n,29:i,31:a,39:s,43:o,46:l},{30:[1,38]},{41:[1,39]},{41:[1,40]},{45:[1,41]},{48:[1,42]},t(g,[2,30]),{18:[1,43]},{18:[1,44]},t(p,[2,23]),{18:[1,45]},{30:[1,46]},t(h,[2,28]),t(h,[2,35]),t(h,[2,36]),t(h,[2,37]),t(h,[2,38]),{36:[1,47]},{33:48,34:m},{15:[1,50]},t(h,[2,27]),t(g,[2,33]),{38:[1,51]},{33:52,34:m,38:[2,31]},{31:[2,15]},t(g,[2,34]),{38:[2,32]}],defaultActions:{20:[2,7],23:[2,14],50:[2,15],52:[2,32]},parseError:x(function(w,k){if(k.recoverable)this.trace(w);else{var A=new Error(w);throw A.hash=k,A}},"parseError"),parse:x(function(w){var k=this,A=[0],C=[],_=[null],L=[],O=this.table,M="",z=0,F=0,S=2,R=1,N=L.slice.call(arguments,1),D=Object.create(this.lexer),I={yy:{}};for(var $ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,$)&&(I.yy[$]=this.yy[$]);D.setInput(w,I.yy),I.yy.lexer=D,I.yy.parser=this,typeof D.yylloc>"u"&&(D.yylloc={});var B=D.yylloc;L.push(B);var P=D.options&&D.options.ranges;typeof I.yy.parseError=="function"?this.parseError=I.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function G(fe){A.length=A.length-2*fe,_.length=_.length-fe,L.length=L.length-fe}x(G,"popStack");function V(){var fe;return fe=C.pop()||D.lex()||R,typeof fe!="number"&&(fe instanceof Array&&(C=fe,fe=C.pop()),fe=k.symbols_[fe]||fe),fe}x(V,"lex");for(var Y,W,ie,K,se={},J,Z,ee,ne;;){if(W=A[A.length-1],this.defaultActions[W]?ie=this.defaultActions[W]:((Y===null||typeof Y>"u")&&(Y=V()),ie=O[W]&&O[W][Y]),typeof ie>"u"||!ie.length||!ie[0]){var ue="";ne=[];for(J in O[W])this.terminals_[J]&&J>S&&ne.push("'"+this.terminals_[J]+"'");D.showPosition?ue="Parse error on line "+(z+1)+`: -`+D.showPosition()+` -Expecting `+ne.join(", ")+", got '"+(this.terminals_[Y]||Y)+"'":ue="Parse error on line "+(z+1)+": Unexpected "+(Y==R?"end of input":"'"+(this.terminals_[Y]||Y)+"'"),this.parseError(ue,{text:D.match,token:this.terminals_[Y]||Y,line:D.yylineno,loc:B,expected:ne})}if(ie[0]instanceof Array&&ie.length>1)throw new Error("Parse Error: multiple actions possible at state: "+W+", token: "+Y);switch(ie[0]){case 1:A.push(Y),_.push(D.yytext),L.push(D.yylloc),A.push(ie[1]),Y=null,F=D.yyleng,M=D.yytext,z=D.yylineno,B=D.yylloc;break;case 2:if(Z=this.productions_[ie[1]][1],se.$=_[_.length-Z],se._$={first_line:L[L.length-(Z||1)].first_line,last_line:L[L.length-1].last_line,first_column:L[L.length-(Z||1)].first_column,last_column:L[L.length-1].last_column},P&&(se._$.range=[L[L.length-(Z||1)].range[0],L[L.length-1].range[1]]),K=this.performAction.apply(se,[M,F,z,I.yy,ie[1],_,L].concat(N)),typeof K<"u")return K;Z&&(A=A.slice(0,-1*Z*2),_=_.slice(0,-1*Z),L=L.slice(0,-1*Z)),A.push(this.productions_[ie[1]][0]),_.push(se.$),L.push(se._$),ee=O[A[A.length-2]][A[A.length-1]],A.push(ee);break;case 3:return!0}}return!0},"parse")},v=(function(){var b={EOF:1,parseError:x(function(k,A){if(this.yy.parser)this.yy.parser.parseError(k,A);else throw new Error(k)},"parseError"),setInput:x(function(w,k){return this.yy=k||this.yy||{},this._input=w,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:x(function(){var w=this._input[0];this.yytext+=w,this.yyleng++,this.offset++,this.match+=w,this.matched+=w;var k=w.match(/(?:\r\n?|\n).*/g);return k?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),w},"input"),unput:x(function(w){var k=w.length,A=w.split(/(?:\r\n?|\n)/g);this._input=w+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-k),this.offset-=k;var C=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),A.length-1&&(this.yylineno-=A.length-1);var _=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:A?(A.length===C.length?this.yylloc.first_column:0)+C[C.length-A.length].length-A[0].length:this.yylloc.first_column-k},this.options.ranges&&(this.yylloc.range=[_[0],_[0]+this.yyleng-k]),this.yyleng=this.yytext.length,this},"unput"),more:x(function(){return this._more=!0,this},"more"),reject:x(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). -`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:x(function(w){this.unput(this.match.slice(w))},"less"),pastInput:x(function(){var w=this.matched.substr(0,this.matched.length-this.match.length);return(w.length>20?"...":"")+w.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:x(function(){var w=this.match;return w.length<20&&(w+=this._input.substr(0,20-w.length)),(w.substr(0,20)+(w.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:x(function(){var w=this.pastInput(),k=new Array(w.length+1).join("-");return w+this.upcomingInput()+` -`+k+"^"},"showPosition"),test_match:x(function(w,k){var A,C,_;if(this.options.backtrack_lexer&&(_={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(_.yylloc.range=this.yylloc.range.slice(0))),C=w[0].match(/(?:\r\n?|\n).*/g),C&&(this.yylineno+=C.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:C?C[C.length-1].length-C[C.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+w[0].length},this.yytext+=w[0],this.match+=w[0],this.matches=w,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(w[0].length),this.matched+=w[0],A=this.performAction.call(this,this.yy,this,k,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),A)return A;if(this._backtrack){for(var L in _)this[L]=_[L];return!1}return!1},"test_match"),next:x(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var w,k,A,C;this._more||(this.yytext="",this.match="");for(var _=this._currentRules(),L=0;L<_.length;L++)if(A=this._input.match(this.rules[_[L]]),A&&(!k||A[0].length>k[0].length)){if(k=A,C=L,this.options.backtrack_lexer){if(w=this.test_match(A,_[L]),w!==!1)return w;if(this._backtrack){k=!1;continue}else return!1}else if(!this.options.flex)break}return k?(w=this.test_match(k,_[C]),w!==!1?w:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var k=this.next();return k||this.lex()},"lex"),begin:x(function(k){this.conditionStack.push(k)},"begin"),popState:x(function(){var k=this.conditionStack.length-1;return k>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(k){return k=this.conditionStack.length-1-Math.abs(k||0),k>=0?this.conditionStack[k]:"INITIAL"},"topState"),pushState:x(function(k){this.begin(k)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:x(function(k,A,C,_){switch(C){case 0:return k.getLogger().debug("Found block-beta"),10;case 1:return k.getLogger().debug("Found id-block"),29;case 2:return k.getLogger().debug("Found block"),10;case 3:k.getLogger().debug(".",A.yytext);break;case 4:k.getLogger().debug("_",A.yytext);break;case 5:return 5;case 6:return A.yytext=-1,28;case 7:return A.yytext=A.yytext.replace(/columns\s+/,""),k.getLogger().debug("COLUMNS (LEX)",A.yytext),28;case 8:this.pushState("md_string");break;case 9:return"MD_STR";case 10:this.popState();break;case 11:this.pushState("string");break;case 12:k.getLogger().debug("LEX: POPPING STR:",A.yytext),this.popState();break;case 13:return k.getLogger().debug("LEX: STR end:",A.yytext),"STR";case 14:return A.yytext=A.yytext.replace(/space\:/,""),k.getLogger().debug("SPACE NUM (LEX)",A.yytext),21;case 15:return A.yytext="1",k.getLogger().debug("COLUMNS (LEX)",A.yytext),21;case 16:return 42;case 17:return"LINKSTYLE";case 18:return"INTERPOLATE";case 19:return this.pushState("CLASSDEF"),39;case 20:return this.popState(),this.pushState("CLASSDEFID"),"DEFAULT_CLASSDEF_ID";case 21:return this.popState(),this.pushState("CLASSDEFID"),40;case 22:return this.popState(),41;case 23:return this.pushState("CLASS"),43;case 24:return this.popState(),this.pushState("CLASS_STYLE"),44;case 25:return this.popState(),45;case 26:return this.pushState("STYLE_STMNT"),46;case 27:return this.popState(),this.pushState("STYLE_DEFINITION"),47;case 28:return this.popState(),48;case 29:return this.pushState("acc_title"),"acc_title";case 30:return this.popState(),"acc_title_value";case 31:return this.pushState("acc_descr"),"acc_descr";case 32:return this.popState(),"acc_descr_value";case 33:this.pushState("acc_descr_multiline");break;case 34:this.popState();break;case 35:return"acc_descr_multiline_value";case 36:return 30;case 37:return this.popState(),k.getLogger().debug("Lex: (("),"NODE_DEND";case 38:return this.popState(),k.getLogger().debug("Lex: (("),"NODE_DEND";case 39:return this.popState(),k.getLogger().debug("Lex: ))"),"NODE_DEND";case 40:return this.popState(),k.getLogger().debug("Lex: (("),"NODE_DEND";case 41:return this.popState(),k.getLogger().debug("Lex: (("),"NODE_DEND";case 42:return this.popState(),k.getLogger().debug("Lex: (-"),"NODE_DEND";case 43:return this.popState(),k.getLogger().debug("Lex: -)"),"NODE_DEND";case 44:return this.popState(),k.getLogger().debug("Lex: (("),"NODE_DEND";case 45:return this.popState(),k.getLogger().debug("Lex: ]]"),"NODE_DEND";case 46:return this.popState(),k.getLogger().debug("Lex: ("),"NODE_DEND";case 47:return this.popState(),k.getLogger().debug("Lex: ])"),"NODE_DEND";case 48:return this.popState(),k.getLogger().debug("Lex: /]"),"NODE_DEND";case 49:return this.popState(),k.getLogger().debug("Lex: /]"),"NODE_DEND";case 50:return this.popState(),k.getLogger().debug("Lex: )]"),"NODE_DEND";case 51:return this.popState(),k.getLogger().debug("Lex: )"),"NODE_DEND";case 52:return this.popState(),k.getLogger().debug("Lex: ]>"),"NODE_DEND";case 53:return this.popState(),k.getLogger().debug("Lex: ]"),"NODE_DEND";case 54:return k.getLogger().debug("Lexa: -)"),this.pushState("NODE"),35;case 55:return k.getLogger().debug("Lexa: (-"),this.pushState("NODE"),35;case 56:return k.getLogger().debug("Lexa: ))"),this.pushState("NODE"),35;case 57:return k.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 58:return k.getLogger().debug("Lex: ((("),this.pushState("NODE"),35;case 59:return k.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 60:return k.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 61:return k.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 62:return k.getLogger().debug("Lexc: >"),this.pushState("NODE"),35;case 63:return k.getLogger().debug("Lexa: (["),this.pushState("NODE"),35;case 64:return k.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 65:return this.pushState("NODE"),35;case 66:return this.pushState("NODE"),35;case 67:return this.pushState("NODE"),35;case 68:return this.pushState("NODE"),35;case 69:return this.pushState("NODE"),35;case 70:return this.pushState("NODE"),35;case 71:return this.pushState("NODE"),35;case 72:return k.getLogger().debug("Lexa: ["),this.pushState("NODE"),35;case 73:return this.pushState("BLOCK_ARROW"),k.getLogger().debug("LEX ARR START"),37;case 74:return k.getLogger().debug("Lex: NODE_ID",A.yytext),31;case 75:return k.getLogger().debug("Lex: EOF",A.yytext),8;case 76:this.pushState("md_string");break;case 77:this.pushState("md_string");break;case 78:return"NODE_DESCR";case 79:this.popState();break;case 80:k.getLogger().debug("Lex: Starting string"),this.pushState("string");break;case 81:k.getLogger().debug("LEX ARR: Starting string"),this.pushState("string");break;case 82:return k.getLogger().debug("LEX: NODE_DESCR:",A.yytext),"NODE_DESCR";case 83:k.getLogger().debug("LEX POPPING"),this.popState();break;case 84:k.getLogger().debug("Lex: =>BAE"),this.pushState("ARROW_DIR");break;case 85:return A.yytext=A.yytext.replace(/^,\s*/,""),k.getLogger().debug("Lex (right): dir:",A.yytext),"DIR";case 86:return A.yytext=A.yytext.replace(/^,\s*/,""),k.getLogger().debug("Lex (left):",A.yytext),"DIR";case 87:return A.yytext=A.yytext.replace(/^,\s*/,""),k.getLogger().debug("Lex (x):",A.yytext),"DIR";case 88:return A.yytext=A.yytext.replace(/^,\s*/,""),k.getLogger().debug("Lex (y):",A.yytext),"DIR";case 89:return A.yytext=A.yytext.replace(/^,\s*/,""),k.getLogger().debug("Lex (up):",A.yytext),"DIR";case 90:return A.yytext=A.yytext.replace(/^,\s*/,""),k.getLogger().debug("Lex (down):",A.yytext),"DIR";case 91:return A.yytext="]>",k.getLogger().debug("Lex (ARROW_DIR end):",A.yytext),this.popState(),this.popState(),"BLOCK_ARROW_END";case 92:return k.getLogger().debug("Lex: LINK","#"+A.yytext+"#"),15;case 93:return k.getLogger().debug("Lex: LINK",A.yytext),15;case 94:return k.getLogger().debug("Lex: LINK",A.yytext),15;case 95:return k.getLogger().debug("Lex: LINK",A.yytext),15;case 96:return k.getLogger().debug("Lex: START_LINK",A.yytext),this.pushState("LLABEL"),16;case 97:return k.getLogger().debug("Lex: START_LINK",A.yytext),this.pushState("LLABEL"),16;case 98:return k.getLogger().debug("Lex: START_LINK",A.yytext),this.pushState("LLABEL"),16;case 99:this.pushState("md_string");break;case 100:return k.getLogger().debug("Lex: Starting string"),this.pushState("string"),"LINK_LABEL";case 101:return this.popState(),k.getLogger().debug("Lex: LINK","#"+A.yytext+"#"),15;case 102:return this.popState(),k.getLogger().debug("Lex: LINK",A.yytext),15;case 103:return this.popState(),k.getLogger().debug("Lex: LINK",A.yytext),15;case 104:return k.getLogger().debug("Lex: COLON",A.yytext),A.yytext=A.yytext.slice(1),27}},"anonymous"),rules:[/^(?:block-beta\b)/,/^(?:block:)/,/^(?:block\b)/,/^(?:[\s]+)/,/^(?:[\n]+)/,/^(?:((\u000D\u000A)|(\u000A)))/,/^(?:columns\s+auto\b)/,/^(?:columns\s+[\d]+)/,/^(?:["][`])/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:space[:]\d+)/,/^(?:space\b)/,/^(?:default\b)/,/^(?:linkStyle\b)/,/^(?:interpolate\b)/,/^(?:classDef\s+)/,/^(?:DEFAULT\s+)/,/^(?:\w+\s+)/,/^(?:[^\n]*)/,/^(?:class\s+)/,/^(?:(\w+)+((,\s*\w+)*))/,/^(?:[^\n]*)/,/^(?:style\s+)/,/^(?:(\w+)+((,\s*\w+)*))/,/^(?:[^\n]*)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:end\b\s*)/,/^(?:\(\(\()/,/^(?:\)\)\))/,/^(?:[\)]\))/,/^(?:\}\})/,/^(?:\})/,/^(?:\(-)/,/^(?:-\))/,/^(?:\(\()/,/^(?:\]\])/,/^(?:\()/,/^(?:\]\))/,/^(?:\\\])/,/^(?:\/\])/,/^(?:\)\])/,/^(?:[\)])/,/^(?:\]>)/,/^(?:[\]])/,/^(?:-\))/,/^(?:\(-)/,/^(?:\)\))/,/^(?:\))/,/^(?:\(\(\()/,/^(?:\(\()/,/^(?:\{\{)/,/^(?:\{)/,/^(?:>)/,/^(?:\(\[)/,/^(?:\()/,/^(?:\[\[)/,/^(?:\[\|)/,/^(?:\[\()/,/^(?:\)\)\))/,/^(?:\[\\)/,/^(?:\[\/)/,/^(?:\[\\)/,/^(?:\[)/,/^(?:<\[)/,/^(?:[^\(\[\n\-\)\{\}\s\<\>:=]+)/,/^(?:$)/,/^(?:["][`])/,/^(?:["][`])/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["])/,/^(?:["])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:\]>\s*\()/,/^(?:,?\s*right\s*)/,/^(?:,?\s*left\s*)/,/^(?:,?\s*x\s*)/,/^(?:,?\s*y\s*)/,/^(?:,?\s*up\s*)/,/^(?:,?\s*down\s*)/,/^(?:\)\s*)/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?:\s*~~[\~]+\s*)/,/^(?:\s*[xo<]?--\s*)/,/^(?:\s*[xo<]?==\s*)/,/^(?:\s*[xo<]?-\.\s*)/,/^(?:["][`])/,/^(?:["])/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?::\d+)/],conditions:{STYLE_DEFINITION:{rules:[28],inclusive:!1},STYLE_STMNT:{rules:[27],inclusive:!1},CLASSDEFID:{rules:[22],inclusive:!1},CLASSDEF:{rules:[20,21],inclusive:!1},CLASS_STYLE:{rules:[25],inclusive:!1},CLASS:{rules:[24],inclusive:!1},LLABEL:{rules:[99,100,101,102,103],inclusive:!1},ARROW_DIR:{rules:[85,86,87,88,89,90,91],inclusive:!1},BLOCK_ARROW:{rules:[76,81,84],inclusive:!1},NODE:{rules:[37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,77,80],inclusive:!1},md_string:{rules:[9,10,78,79],inclusive:!1},space:{rules:[],inclusive:!1},string:{rules:[12,13,82,83],inclusive:!1},acc_descr_multiline:{rules:[34,35],inclusive:!1},acc_descr:{rules:[32],inclusive:!1},acc_title:{rules:[30],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,11,14,15,16,17,18,19,23,26,29,31,33,36,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,92,93,94,95,96,97,98,104],inclusive:!0}}};return b})();y.lexer=v;function T(){this.yy={}}return x(T,"Parser"),T.prototype=y,y.Parser=T,new T})();tP.parser=tP;var bft=tP,tl=new Map,rP=[],nP=new Map,$1e="color",P1e="fill",xft="bgFill",B1e=",",Tft=Pe(),GS=new Map,iP="",wft=x(t=>Lt.sanitizeText(t,Tft),"sanitizeText"),Cft=x(function(t,e=""){let r=GS.get(t);r||(r={id:t,styles:[],textStyles:[]},GS.set(t,r)),e!=null&&e.split(B1e).forEach(n=>{const i=n.replace(/([^;]*);/,"$1").trim();if(RegExp($1e).exec(n)){const s=i.replace(P1e,xft).replace($1e,P1e);r.textStyles.push(s)}r.styles.push(i)})},"addStyleClass"),kft=x(function(t,e=""){const r=tl.get(t);e!=null&&(r.styles=e.split(B1e))},"addStyle2Node"),Eft=x(function(t,e){t.split(",").forEach(function(r){let n=tl.get(r);if(n===void 0){const i=r.trim();n={id:i,type:"na",children:[]},tl.set(i,n)}n.classes||(n.classes=[]),n.classes.push(e)})},"setCssClass"),F1e=x((t,e)=>{const r=t.flat(),n=[],i=r.find(s=>(s==null?void 0:s.type)==="column-setting"),a=(i==null?void 0:i.columns)??-1;for(const s of r){if(typeof a=="number"&&a>0&&s.type!=="column-setting"&&typeof s.widthInColumns=="number"&&s.widthInColumns>a&&ae.warn(`Block ${s.id} width ${s.widthInColumns} exceeds configured column width ${a}`),s.label&&(s.label=wft(s.label)),s.type==="classDef"){Cft(s.id,s.css);continue}if(s.type==="applyClass"){Eft(s.id,(s==null?void 0:s.styleClass)??"");continue}if(s.type==="applyStyles"){s!=null&&s.stylesStr&&kft(s.id,s==null?void 0:s.stylesStr);continue}if(s.type==="column-setting")e.columns=s.columns??-1;else if(s.type==="edge"){const o=(nP.get(s.id)??0)+1;nP.set(s.id,o),s.id=o+"-"+s.id,rP.push(s)}else{s.label||(s.type==="composite"?s.label="":s.label=s.id);const o=tl.get(s.id);if(o===void 0?tl.set(s.id,s):(s.type!=="na"&&(o.type=s.type),s.label!==s.id&&(o.label=s.label)),s.children&&F1e(s.children,s),s.type==="space"){const l=s.width??1;for(let u=0;u{ae.debug("Clear called"),In(),nw={id:"root",type:"composite",children:[],columns:-1},tl=new Map([["root",nw]]),aP=[],GS=new Map,rP=[],nP=new Map,iP=""},"clear");function z1e(t){switch(ae.debug("typeStr2Type",t),t){case"[]":return"square";case"()":return ae.debug("we have a round"),"round";case"(())":return"circle";case">]":return"rect_left_inv_arrow";case"{}":return"diamond";case"{{}}":return"hexagon";case"([])":return"stadium";case"[[]]":return"subroutine";case"[()]":return"cylinder";case"((()))":return"doublecircle";case"[//]":return"lean_right";case"[\\\\]":return"lean_left";case"[/\\]":return"trapezoid";case"[\\/]":return"inv_trapezoid";case"<[]>":return"block_arrow";default:return"na"}}x(z1e,"typeStr2Type");function G1e(t){switch(ae.debug("typeStr2Type",t),t){case"==":return"thick";default:return"normal"}}x(G1e,"edgeTypeStr2Type");function q1e(t){switch(t.trim().slice(-1)){case"x":return"arrow_cross";case"o":return"arrow_circle";case">":return"arrow_point";default:return""}}x(q1e,"edgeStrToEdgeData");function V1e(t){switch(t.trim().charAt(0)){case"x":return"arrow_cross";case"o":return"arrow_circle";case"<":return"arrow_point";default:return"arrow_open"}}x(V1e,"edgeStrToEdgeStartData");function W1e(t){return t.includes("==")?"thick":"normal"}x(W1e,"edgeStrToThickness");function U1e(t){return t.includes(".-")?"dotted":"solid"}x(U1e,"edgeStrToPattern");var H1e=0,Aft=x(()=>(H1e++,"id-"+Math.random().toString(36).substr(2,12)+"-"+H1e),"generateId"),_ft=x(t=>{nw.children=t,F1e(t,nw),aP=nw.children},"setHierarchy"),Rft=x(t=>{const e=tl.get(t);return e?e.columns?e.columns:e.children?e.children.length:-1:-1},"getColumns"),Lft=x(()=>[...tl.values()],"getBlocksFlat"),Ift=x(()=>aP||[],"getBlocks"),Dft=x(()=>rP,"getEdges"),Mft=x(t=>tl.get(t),"getBlock"),Nft=x(t=>{tl.set(t.id,t)},"setBlock"),Oft=x(t=>{iP=t},"setDiagramId"),$ft=x(()=>iP,"getDiagramId"),Pft=x(()=>ae,"getLogger"),Bft=x(function(){return GS},"getClasses"),Fft={getConfig:x(()=>lr().block,"getConfig"),typeStr2Type:z1e,edgeTypeStr2Type:G1e,edgeStrToEdgeData:q1e,edgeStrToEdgeStartData:V1e,edgeStrToThickness:W1e,edgeStrToPattern:U1e,getLogger:Pft,getBlocksFlat:Lft,getBlocks:Ift,getEdges:Dft,setHierarchy:_ft,getBlock:Mft,setBlock:Nft,getColumns:Rft,getClasses:Bft,clear:Sft,generateId:Aft,setDiagramId:Oft,getDiagramId:$ft},zft=Fft,sP=x((t,e)=>{const r=g6,n=r(t,"r"),i=r(t,"g"),a=r(t,"b");return Ao(n,i,a,e)},"fade"),Gft=x(t=>`.label { + ${ext(e,r)} + `},"styles"),nxt={parser:Xbt,db:c4,renderer:Jbt,styles:rxt};const ixt=Object.freeze(Object.defineProperty({__proto__:null,diagram:nxt},Symbol.toStringTag,{value:"Module"}));var LG=(function(){var t=T(function(b,w,C,_){for(C=C||{},_=b.length;_--;C[b[_]]=w);return C},"o"),e=[1,15],r=[1,7],n=[1,13],i=[1,14],a=[1,19],s=[1,16],o=[1,17],l=[1,18],u=[8,30],h=[8,10,21,28,29,30,31,39,43,46],d=[1,23],f=[1,24],p=[8,10,15,16,21,28,29,30,31,39,43,46],g=[8,10,15,16,21,27,28,29,30,31,39,43,46],m=[1,49],y={trace:T(function(){},"trace"),yy:{},symbols_:{error:2,spaceLines:3,SPACELINE:4,NL:5,separator:6,SPACE:7,EOF:8,start:9,BLOCK_DIAGRAM_KEY:10,document:11,stop:12,statement:13,link:14,LINK:15,START_LINK:16,LINK_LABEL:17,STR:18,nodeStatement:19,columnsStatement:20,SPACE_BLOCK:21,blockStatement:22,classDefStatement:23,cssClassStatement:24,styleStatement:25,node:26,SIZE:27,COLUMNS:28,"id-block":29,end:30,NODE_ID:31,nodeShapeNLabel:32,dirList:33,DIR:34,NODE_DSTART:35,NODE_DEND:36,BLOCK_ARROW_START:37,BLOCK_ARROW_END:38,classDef:39,CLASSDEF_ID:40,CLASSDEF_STYLEOPTS:41,DEFAULT:42,class:43,CLASSENTITY_IDS:44,STYLECLASS:45,style:46,STYLE_ENTITY_IDS:47,STYLE_DEFINITION_DATA:48,$accept:0,$end:1},terminals_:{2:"error",4:"SPACELINE",5:"NL",7:"SPACE",8:"EOF",10:"BLOCK_DIAGRAM_KEY",15:"LINK",16:"START_LINK",17:"LINK_LABEL",18:"STR",21:"SPACE_BLOCK",27:"SIZE",28:"COLUMNS",29:"id-block",30:"end",31:"NODE_ID",34:"DIR",35:"NODE_DSTART",36:"NODE_DEND",37:"BLOCK_ARROW_START",38:"BLOCK_ARROW_END",39:"classDef",40:"CLASSDEF_ID",41:"CLASSDEF_STYLEOPTS",42:"DEFAULT",43:"class",44:"CLASSENTITY_IDS",45:"STYLECLASS",46:"style",47:"STYLE_ENTITY_IDS",48:"STYLE_DEFINITION_DATA"},productions_:[0,[3,1],[3,2],[3,2],[6,1],[6,1],[6,1],[9,3],[12,1],[12,1],[12,2],[12,2],[11,1],[11,2],[14,1],[14,4],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[19,3],[19,2],[19,1],[20,1],[22,4],[22,3],[26,1],[26,2],[33,1],[33,2],[32,3],[32,4],[23,3],[23,3],[24,3],[25,3]],performAction:T(function(w,C,_,k,S,L,$){var I=L.length-1;switch(S){case 4:k.getLogger().debug("Rule: separator (NL) ");break;case 5:k.getLogger().debug("Rule: separator (Space) ");break;case 6:k.getLogger().debug("Rule: separator (EOF) ");break;case 7:k.getLogger().debug("Rule: hierarchy: ",L[I-1]),k.setHierarchy(L[I-1]);break;case 8:k.getLogger().debug("Stop NL ");break;case 9:k.getLogger().debug("Stop EOF ");break;case 10:k.getLogger().debug("Stop NL2 ");break;case 11:k.getLogger().debug("Stop EOF2 ");break;case 12:k.getLogger().debug("Rule: statement: ",L[I]),typeof L[I].length=="number"?this.$=L[I]:this.$=[L[I]];break;case 13:k.getLogger().debug("Rule: statement #2: ",L[I-1]),this.$=[L[I-1]].concat(L[I]);break;case 14:k.getLogger().debug("Rule: link: ",L[I],w),this.$={edgeTypeStr:L[I],label:""};break;case 15:k.getLogger().debug("Rule: LABEL link: ",L[I-3],L[I-1],L[I]),this.$={edgeTypeStr:L[I],label:L[I-1]};break;case 18:const z=parseInt(L[I]),F=k.generateId();this.$={id:F,type:"space",label:"",width:z,children:[]};break;case 23:k.getLogger().debug("Rule: (nodeStatement link node) ",L[I-2],L[I-1],L[I]," typestr: ",L[I-1].edgeTypeStr);const A=k.edgeStrToEdgeData(L[I-1].edgeTypeStr),R=k.edgeStrToEdgeStartData(L[I-1].edgeTypeStr),N=k.edgeStrToThickness(L[I-1].edgeTypeStr),M=k.edgeStrToPattern(L[I-1].edgeTypeStr);this.$=[{id:L[I-2].id,label:L[I-2].label,type:L[I-2].type,directions:L[I-2].directions},{id:L[I-2].id+"-"+L[I].id,start:L[I-2].id,end:L[I].id,label:L[I-1].label,type:"edge",thickness:N,pattern:M,directions:L[I].directions,arrowTypeEnd:A,arrowTypeStart:R},{id:L[I].id,label:L[I].label,type:k.typeStr2Type(L[I].typeStr),directions:L[I].directions}];break;case 24:k.getLogger().debug("Rule: nodeStatement (abc88 node size) ",L[I-1],L[I]),this.$={id:L[I-1].id,label:L[I-1].label,type:k.typeStr2Type(L[I-1].typeStr),directions:L[I-1].directions,widthInColumns:parseInt(L[I],10)};break;case 25:k.getLogger().debug("Rule: nodeStatement (node) ",L[I]),this.$={id:L[I].id,label:L[I].label,type:k.typeStr2Type(L[I].typeStr),directions:L[I].directions,widthInColumns:1};break;case 26:k.getLogger().debug("APA123",this?this:"na"),k.getLogger().debug("COLUMNS: ",L[I]),this.$={type:"column-setting",columns:L[I]==="auto"?-1:parseInt(L[I])};break;case 27:k.getLogger().debug("Rule: id-block statement : ",L[I-2],L[I-1]),k.generateId(),this.$={...L[I-2],type:"composite",children:L[I-1]};break;case 28:k.getLogger().debug("Rule: blockStatement : ",L[I-2],L[I-1],L[I]);const D=k.generateId();this.$={id:D,type:"composite",label:"",children:L[I-1]};break;case 29:k.getLogger().debug("Rule: node (NODE_ID separator): ",L[I]),this.$={id:L[I]};break;case 30:k.getLogger().debug("Rule: node (NODE_ID nodeShapeNLabel separator): ",L[I-1],L[I]),this.$={id:L[I-1],label:L[I].label,typeStr:L[I].typeStr,directions:L[I].directions};break;case 31:k.getLogger().debug("Rule: dirList: ",L[I]),this.$=[L[I]];break;case 32:k.getLogger().debug("Rule: dirList: ",L[I-1],L[I]),this.$=[L[I-1]].concat(L[I]);break;case 33:k.getLogger().debug("Rule: nodeShapeNLabel: ",L[I-2],L[I-1],L[I]),this.$={typeStr:L[I-2]+L[I],label:L[I-1]};break;case 34:k.getLogger().debug("Rule: BLOCK_ARROW nodeShapeNLabel: ",L[I-3],L[I-2]," #3:",L[I-1],L[I]),this.$={typeStr:L[I-3]+L[I],label:L[I-2],directions:L[I-1]};break;case 35:case 36:this.$={type:"classDef",id:L[I-1].trim(),css:L[I].trim()};break;case 37:this.$={type:"applyClass",id:L[I-1].trim(),styleClass:L[I].trim()};break;case 38:this.$={type:"applyStyles",id:L[I-1].trim(),stylesStr:L[I].trim()};break}},"anonymous"),table:[{9:1,10:[1,2]},{1:[3]},{10:e,11:3,13:4,19:5,20:6,21:r,22:8,23:9,24:10,25:11,26:12,28:n,29:i,31:a,39:s,43:o,46:l},{8:[1,20]},t(u,[2,12],{13:4,19:5,20:6,22:8,23:9,24:10,25:11,26:12,11:21,10:e,21:r,28:n,29:i,31:a,39:s,43:o,46:l}),t(h,[2,16],{14:22,15:d,16:f}),t(h,[2,17]),t(h,[2,18]),t(h,[2,19]),t(h,[2,20]),t(h,[2,21]),t(h,[2,22]),t(p,[2,25],{27:[1,25]}),t(h,[2,26]),{19:26,26:12,31:a},{10:e,11:27,13:4,19:5,20:6,21:r,22:8,23:9,24:10,25:11,26:12,28:n,29:i,31:a,39:s,43:o,46:l},{40:[1,28],42:[1,29]},{44:[1,30]},{47:[1,31]},t(g,[2,29],{32:32,35:[1,33],37:[1,34]}),{1:[2,7]},t(u,[2,13]),{26:35,31:a},{31:[2,14]},{17:[1,36]},t(p,[2,24]),{10:e,11:37,13:4,14:22,15:d,16:f,19:5,20:6,21:r,22:8,23:9,24:10,25:11,26:12,28:n,29:i,31:a,39:s,43:o,46:l},{30:[1,38]},{41:[1,39]},{41:[1,40]},{45:[1,41]},{48:[1,42]},t(g,[2,30]),{18:[1,43]},{18:[1,44]},t(p,[2,23]),{18:[1,45]},{30:[1,46]},t(h,[2,28]),t(h,[2,35]),t(h,[2,36]),t(h,[2,37]),t(h,[2,38]),{36:[1,47]},{33:48,34:m},{15:[1,50]},t(h,[2,27]),t(g,[2,33]),{38:[1,51]},{33:52,34:m,38:[2,31]},{31:[2,15]},t(g,[2,34]),{38:[2,32]}],defaultActions:{20:[2,7],23:[2,14],50:[2,15],52:[2,32]},parseError:T(function(w,C){if(C.recoverable)this.trace(w);else{var _=new Error(w);throw _.hash=C,_}},"parseError"),parse:T(function(w){var C=this,_=[0],k=[],S=[null],L=[],$=this.table,I="",z=0,F=0,A=2,R=1,N=L.slice.call(arguments,1),M=Object.create(this.lexer),D={yy:{}};for(var O in this.yy)Object.prototype.hasOwnProperty.call(this.yy,O)&&(D.yy[O]=this.yy[O]);M.setInput(w,D.yy),D.yy.lexer=M,D.yy.parser=this,typeof M.yylloc>"u"&&(M.yylloc={});var B=M.yylloc;L.push(B);var P=M.options&&M.options.ranges;typeof D.yy.parseError=="function"?this.parseError=D.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function G(fe){_.length=_.length-2*fe,S.length=S.length-fe,L.length=L.length-fe}T(G,"popStack");function V(){var fe;return fe=k.pop()||M.lex()||R,typeof fe!="number"&&(fe instanceof Array&&(k=fe,fe=k.pop()),fe=C.symbols_[fe]||fe),fe}T(V,"lex");for(var H,W,ie,j,ae={},J,K,Q,re;;){if(W=_[_.length-1],this.defaultActions[W]?ie=this.defaultActions[W]:((H===null||typeof H>"u")&&(H=V()),ie=$[W]&&$[W][H]),typeof ie>"u"||!ie.length||!ie[0]){var le="";re=[];for(J in $[W])this.terminals_[J]&&J>A&&re.push("'"+this.terminals_[J]+"'");M.showPosition?le="Parse error on line "+(z+1)+`: +`+M.showPosition()+` +Expecting `+re.join(", ")+", got '"+(this.terminals_[H]||H)+"'":le="Parse error on line "+(z+1)+": Unexpected "+(H==R?"end of input":"'"+(this.terminals_[H]||H)+"'"),this.parseError(le,{text:M.match,token:this.terminals_[H]||H,line:M.yylineno,loc:B,expected:re})}if(ie[0]instanceof Array&&ie.length>1)throw new Error("Parse Error: multiple actions possible at state: "+W+", token: "+H);switch(ie[0]){case 1:_.push(H),S.push(M.yytext),L.push(M.yylloc),_.push(ie[1]),H=null,F=M.yyleng,I=M.yytext,z=M.yylineno,B=M.yylloc;break;case 2:if(K=this.productions_[ie[1]][1],ae.$=S[S.length-K],ae._$={first_line:L[L.length-(K||1)].first_line,last_line:L[L.length-1].last_line,first_column:L[L.length-(K||1)].first_column,last_column:L[L.length-1].last_column},P&&(ae._$.range=[L[L.length-(K||1)].range[0],L[L.length-1].range[1]]),j=this.performAction.apply(ae,[I,F,z,D.yy,ie[1],S,L].concat(N)),typeof j<"u")return j;K&&(_=_.slice(0,-1*K*2),S=S.slice(0,-1*K),L=L.slice(0,-1*K)),_.push(this.productions_[ie[1]][0]),S.push(ae.$),L.push(ae._$),Q=$[_[_.length-2]][_[_.length-1]],_.push(Q);break;case 3:return!0}}return!0},"parse")},v=(function(){var b={EOF:1,parseError:T(function(C,_){if(this.yy.parser)this.yy.parser.parseError(C,_);else throw new Error(C)},"parseError"),setInput:T(function(w,C){return this.yy=C||this.yy||{},this._input=w,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:T(function(){var w=this._input[0];this.yytext+=w,this.yyleng++,this.offset++,this.match+=w,this.matched+=w;var C=w.match(/(?:\r\n?|\n).*/g);return C?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),w},"input"),unput:T(function(w){var C=w.length,_=w.split(/(?:\r\n?|\n)/g);this._input=w+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-C),this.offset-=C;var k=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),_.length-1&&(this.yylineno-=_.length-1);var S=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:_?(_.length===k.length?this.yylloc.first_column:0)+k[k.length-_.length].length-_[0].length:this.yylloc.first_column-C},this.options.ranges&&(this.yylloc.range=[S[0],S[0]+this.yyleng-C]),this.yyleng=this.yytext.length,this},"unput"),more:T(function(){return this._more=!0,this},"more"),reject:T(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). +`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:T(function(w){this.unput(this.match.slice(w))},"less"),pastInput:T(function(){var w=this.matched.substr(0,this.matched.length-this.match.length);return(w.length>20?"...":"")+w.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:T(function(){var w=this.match;return w.length<20&&(w+=this._input.substr(0,20-w.length)),(w.substr(0,20)+(w.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:T(function(){var w=this.pastInput(),C=new Array(w.length+1).join("-");return w+this.upcomingInput()+` +`+C+"^"},"showPosition"),test_match:T(function(w,C){var _,k,S;if(this.options.backtrack_lexer&&(S={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&&(S.yylloc.range=this.yylloc.range.slice(0))),k=w[0].match(/(?:\r\n?|\n).*/g),k&&(this.yylineno+=k.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:k?k[k.length-1].length-k[k.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+w[0].length},this.yytext+=w[0],this.match+=w[0],this.matches=w,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(w[0].length),this.matched+=w[0],_=this.performAction.call(this,this.yy,this,C,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),_)return _;if(this._backtrack){for(var L in S)this[L]=S[L];return!1}return!1},"test_match"),next:T(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var w,C,_,k;this._more||(this.yytext="",this.match="");for(var S=this._currentRules(),L=0;LC[0].length)){if(C=_,k=L,this.options.backtrack_lexer){if(w=this.test_match(_,S[L]),w!==!1)return w;if(this._backtrack){C=!1;continue}else return!1}else if(!this.options.flex)break}return C?(w=this.test_match(C,S[k]),w!==!1?w:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:T(function(){var C=this.next();return C||this.lex()},"lex"),begin:T(function(C){this.conditionStack.push(C)},"begin"),popState:T(function(){var C=this.conditionStack.length-1;return C>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:T(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:T(function(C){return C=this.conditionStack.length-1-Math.abs(C||0),C>=0?this.conditionStack[C]:"INITIAL"},"topState"),pushState:T(function(C){this.begin(C)},"pushState"),stateStackSize:T(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:T(function(C,_,k,S){switch(k){case 0:return C.getLogger().debug("Found block-beta"),10;case 1:return C.getLogger().debug("Found id-block"),29;case 2:return C.getLogger().debug("Found block"),10;case 3:C.getLogger().debug(".",_.yytext);break;case 4:C.getLogger().debug("_",_.yytext);break;case 5:return 5;case 6:return _.yytext=-1,28;case 7:return _.yytext=_.yytext.replace(/columns\s+/,""),C.getLogger().debug("COLUMNS (LEX)",_.yytext),28;case 8:this.pushState("md_string");break;case 9:return"MD_STR";case 10:this.popState();break;case 11:this.pushState("string");break;case 12:C.getLogger().debug("LEX: POPPING STR:",_.yytext),this.popState();break;case 13:return C.getLogger().debug("LEX: STR end:",_.yytext),"STR";case 14:return _.yytext=_.yytext.replace(/space\:/,""),C.getLogger().debug("SPACE NUM (LEX)",_.yytext),21;case 15:return _.yytext="1",C.getLogger().debug("COLUMNS (LEX)",_.yytext),21;case 16:return 42;case 17:return"LINKSTYLE";case 18:return"INTERPOLATE";case 19:return this.pushState("CLASSDEF"),39;case 20:return this.popState(),this.pushState("CLASSDEFID"),"DEFAULT_CLASSDEF_ID";case 21:return this.popState(),this.pushState("CLASSDEFID"),40;case 22:return this.popState(),41;case 23:return this.pushState("CLASS"),43;case 24:return this.popState(),this.pushState("CLASS_STYLE"),44;case 25:return this.popState(),45;case 26:return this.pushState("STYLE_STMNT"),46;case 27:return this.popState(),this.pushState("STYLE_DEFINITION"),47;case 28:return this.popState(),48;case 29:return this.pushState("acc_title"),"acc_title";case 30:return this.popState(),"acc_title_value";case 31:return this.pushState("acc_descr"),"acc_descr";case 32:return this.popState(),"acc_descr_value";case 33:this.pushState("acc_descr_multiline");break;case 34:this.popState();break;case 35:return"acc_descr_multiline_value";case 36:return 30;case 37:return this.popState(),C.getLogger().debug("Lex: (("),"NODE_DEND";case 38:return this.popState(),C.getLogger().debug("Lex: (("),"NODE_DEND";case 39:return this.popState(),C.getLogger().debug("Lex: ))"),"NODE_DEND";case 40:return this.popState(),C.getLogger().debug("Lex: (("),"NODE_DEND";case 41:return this.popState(),C.getLogger().debug("Lex: (("),"NODE_DEND";case 42:return this.popState(),C.getLogger().debug("Lex: (-"),"NODE_DEND";case 43:return this.popState(),C.getLogger().debug("Lex: -)"),"NODE_DEND";case 44:return this.popState(),C.getLogger().debug("Lex: (("),"NODE_DEND";case 45:return this.popState(),C.getLogger().debug("Lex: ]]"),"NODE_DEND";case 46:return this.popState(),C.getLogger().debug("Lex: ("),"NODE_DEND";case 47:return this.popState(),C.getLogger().debug("Lex: ])"),"NODE_DEND";case 48:return this.popState(),C.getLogger().debug("Lex: /]"),"NODE_DEND";case 49:return this.popState(),C.getLogger().debug("Lex: /]"),"NODE_DEND";case 50:return this.popState(),C.getLogger().debug("Lex: )]"),"NODE_DEND";case 51:return this.popState(),C.getLogger().debug("Lex: )"),"NODE_DEND";case 52:return this.popState(),C.getLogger().debug("Lex: ]>"),"NODE_DEND";case 53:return this.popState(),C.getLogger().debug("Lex: ]"),"NODE_DEND";case 54:return C.getLogger().debug("Lexa: -)"),this.pushState("NODE"),35;case 55:return C.getLogger().debug("Lexa: (-"),this.pushState("NODE"),35;case 56:return C.getLogger().debug("Lexa: ))"),this.pushState("NODE"),35;case 57:return C.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 58:return C.getLogger().debug("Lex: ((("),this.pushState("NODE"),35;case 59:return C.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 60:return C.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 61:return C.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 62:return C.getLogger().debug("Lexc: >"),this.pushState("NODE"),35;case 63:return C.getLogger().debug("Lexa: (["),this.pushState("NODE"),35;case 64:return C.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 65:return this.pushState("NODE"),35;case 66:return this.pushState("NODE"),35;case 67:return this.pushState("NODE"),35;case 68:return this.pushState("NODE"),35;case 69:return this.pushState("NODE"),35;case 70:return this.pushState("NODE"),35;case 71:return this.pushState("NODE"),35;case 72:return C.getLogger().debug("Lexa: ["),this.pushState("NODE"),35;case 73:return this.pushState("BLOCK_ARROW"),C.getLogger().debug("LEX ARR START"),37;case 74:return C.getLogger().debug("Lex: NODE_ID",_.yytext),31;case 75:return C.getLogger().debug("Lex: EOF",_.yytext),8;case 76:this.pushState("md_string");break;case 77:this.pushState("md_string");break;case 78:return"NODE_DESCR";case 79:this.popState();break;case 80:C.getLogger().debug("Lex: Starting string"),this.pushState("string");break;case 81:C.getLogger().debug("LEX ARR: Starting string"),this.pushState("string");break;case 82:return C.getLogger().debug("LEX: NODE_DESCR:",_.yytext),"NODE_DESCR";case 83:C.getLogger().debug("LEX POPPING"),this.popState();break;case 84:C.getLogger().debug("Lex: =>BAE"),this.pushState("ARROW_DIR");break;case 85:return _.yytext=_.yytext.replace(/^,\s*/,""),C.getLogger().debug("Lex (right): dir:",_.yytext),"DIR";case 86:return _.yytext=_.yytext.replace(/^,\s*/,""),C.getLogger().debug("Lex (left):",_.yytext),"DIR";case 87:return _.yytext=_.yytext.replace(/^,\s*/,""),C.getLogger().debug("Lex (x):",_.yytext),"DIR";case 88:return _.yytext=_.yytext.replace(/^,\s*/,""),C.getLogger().debug("Lex (y):",_.yytext),"DIR";case 89:return _.yytext=_.yytext.replace(/^,\s*/,""),C.getLogger().debug("Lex (up):",_.yytext),"DIR";case 90:return _.yytext=_.yytext.replace(/^,\s*/,""),C.getLogger().debug("Lex (down):",_.yytext),"DIR";case 91:return _.yytext="]>",C.getLogger().debug("Lex (ARROW_DIR end):",_.yytext),this.popState(),this.popState(),"BLOCK_ARROW_END";case 92:return C.getLogger().debug("Lex: LINK","#"+_.yytext+"#"),15;case 93:return C.getLogger().debug("Lex: LINK",_.yytext),15;case 94:return C.getLogger().debug("Lex: LINK",_.yytext),15;case 95:return C.getLogger().debug("Lex: LINK",_.yytext),15;case 96:return C.getLogger().debug("Lex: START_LINK",_.yytext),this.pushState("LLABEL"),16;case 97:return C.getLogger().debug("Lex: START_LINK",_.yytext),this.pushState("LLABEL"),16;case 98:return C.getLogger().debug("Lex: START_LINK",_.yytext),this.pushState("LLABEL"),16;case 99:this.pushState("md_string");break;case 100:return C.getLogger().debug("Lex: Starting string"),this.pushState("string"),"LINK_LABEL";case 101:return this.popState(),C.getLogger().debug("Lex: LINK","#"+_.yytext+"#"),15;case 102:return this.popState(),C.getLogger().debug("Lex: LINK",_.yytext),15;case 103:return this.popState(),C.getLogger().debug("Lex: LINK",_.yytext),15;case 104:return C.getLogger().debug("Lex: COLON",_.yytext),_.yytext=_.yytext.slice(1),27}},"anonymous"),rules:[/^(?:block-beta\b)/,/^(?:block:)/,/^(?:block\b)/,/^(?:[\s]+)/,/^(?:[\n]+)/,/^(?:((\u000D\u000A)|(\u000A)))/,/^(?:columns\s+auto\b)/,/^(?:columns\s+[\d]+)/,/^(?:["][`])/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:space[:]\d+)/,/^(?:space\b)/,/^(?:default\b)/,/^(?:linkStyle\b)/,/^(?:interpolate\b)/,/^(?:classDef\s+)/,/^(?:DEFAULT\s+)/,/^(?:\w+\s+)/,/^(?:[^\n]*)/,/^(?:class\s+)/,/^(?:(\w+)+((,\s*\w+)*))/,/^(?:[^\n]*)/,/^(?:style\s+)/,/^(?:(\w+)+((,\s*\w+)*))/,/^(?:[^\n]*)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:end\b\s*)/,/^(?:\(\(\()/,/^(?:\)\)\))/,/^(?:[\)]\))/,/^(?:\}\})/,/^(?:\})/,/^(?:\(-)/,/^(?:-\))/,/^(?:\(\()/,/^(?:\]\])/,/^(?:\()/,/^(?:\]\))/,/^(?:\\\])/,/^(?:\/\])/,/^(?:\)\])/,/^(?:[\)])/,/^(?:\]>)/,/^(?:[\]])/,/^(?:-\))/,/^(?:\(-)/,/^(?:\)\))/,/^(?:\))/,/^(?:\(\(\()/,/^(?:\(\()/,/^(?:\{\{)/,/^(?:\{)/,/^(?:>)/,/^(?:\(\[)/,/^(?:\()/,/^(?:\[\[)/,/^(?:\[\|)/,/^(?:\[\()/,/^(?:\)\)\))/,/^(?:\[\\)/,/^(?:\[\/)/,/^(?:\[\\)/,/^(?:\[)/,/^(?:<\[)/,/^(?:[^\(\[\n\-\)\{\}\s\<\>:=]+)/,/^(?:$)/,/^(?:["][`])/,/^(?:["][`])/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["])/,/^(?:["])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:\]>\s*\()/,/^(?:,?\s*right\s*)/,/^(?:,?\s*left\s*)/,/^(?:,?\s*x\s*)/,/^(?:,?\s*y\s*)/,/^(?:,?\s*up\s*)/,/^(?:,?\s*down\s*)/,/^(?:\)\s*)/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?:\s*~~[\~]+\s*)/,/^(?:\s*[xo<]?--\s*)/,/^(?:\s*[xo<]?==\s*)/,/^(?:\s*[xo<]?-\.\s*)/,/^(?:["][`])/,/^(?:["])/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?::\d+)/],conditions:{STYLE_DEFINITION:{rules:[28],inclusive:!1},STYLE_STMNT:{rules:[27],inclusive:!1},CLASSDEFID:{rules:[22],inclusive:!1},CLASSDEF:{rules:[20,21],inclusive:!1},CLASS_STYLE:{rules:[25],inclusive:!1},CLASS:{rules:[24],inclusive:!1},LLABEL:{rules:[99,100,101,102,103],inclusive:!1},ARROW_DIR:{rules:[85,86,87,88,89,90,91],inclusive:!1},BLOCK_ARROW:{rules:[76,81,84],inclusive:!1},NODE:{rules:[37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,77,80],inclusive:!1},md_string:{rules:[9,10,78,79],inclusive:!1},space:{rules:[],inclusive:!1},string:{rules:[12,13,82,83],inclusive:!1},acc_descr_multiline:{rules:[34,35],inclusive:!1},acc_descr:{rules:[32],inclusive:!1},acc_title:{rules:[30],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,11,14,15,16,17,18,19,23,26,29,31,33,36,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,92,93,94,95,96,97,98,104],inclusive:!0}}};return b})();y.lexer=v;function x(){this.yy={}}return T(x,"Parser"),x.prototype=y,y.Parser=x,new x})();LG.parser=LG;var axt=LG,Gl=new Map,IG=[],DG=new Map,Jwe="color",eCe="fill",sxt="bgFill",tCe=",",oxt=Pe(),zA=new Map,MG="",lxt=T(t=>Dt.sanitizeText(t,oxt),"sanitizeText"),cxt=T(function(t,e=""){let r=zA.get(t);r||(r={id:t,styles:[],textStyles:[]},zA.set(t,r)),e!=null&&e.split(tCe).forEach(n=>{const i=n.replace(/([^;]*);/,"$1").trim();if(RegExp(Jwe).exec(n)){const s=i.replace(eCe,sxt).replace(Jwe,eCe);r.textStyles.push(s)}r.styles.push(i)})},"addStyleClass"),uxt=T(function(t,e=""){const r=Gl.get(t);e!=null&&(r.styles=e.split(tCe))},"addStyle2Node"),hxt=T(function(t,e){t.split(",").forEach(function(r){let n=Gl.get(r);if(n===void 0){const i=r.trim();n={id:i,type:"na",children:[]},Gl.set(i,n)}n.classes||(n.classes=[]),n.classes.push(e)})},"setCssClass"),rCe=T((t,e)=>{const r=t.flat(),n=[],i=r.find(s=>(s==null?void 0:s.type)==="column-setting"),a=(i==null?void 0:i.columns)??-1;for(const s of r){if(typeof a=="number"&&a>0&&s.type!=="column-setting"&&typeof s.widthInColumns=="number"&&s.widthInColumns>a&&se.warn(`Block ${s.id} width ${s.widthInColumns} exceeds configured column width ${a}`),s.label&&(s.label=lxt(s.label)),s.type==="classDef"){cxt(s.id,s.css);continue}if(s.type==="applyClass"){hxt(s.id,(s==null?void 0:s.styleClass)??"");continue}if(s.type==="applyStyles"){s!=null&&s.stylesStr&&uxt(s.id,s==null?void 0:s.stylesStr);continue}if(s.type==="column-setting")e.columns=s.columns??-1;else if(s.type==="edge"){const o=(DG.get(s.id)??0)+1;DG.set(s.id,o),s.id=o+"-"+s.id,IG.push(s)}else{s.label||(s.type==="composite"?s.label="":s.label=s.id);const o=Gl.get(s.id);if(o===void 0?Gl.set(s.id,s):(s.type!=="na"&&(o.type=s.type),s.label!==s.id&&(o.label=s.label)),s.children&&rCe(s.children,s),s.type==="space"){const l=s.width??1;for(let u=0;u{se.debug("Clear called"),Hn(),u4={id:"root",type:"composite",children:[],columns:-1},Gl=new Map([["root",u4]]),NG=[],zA=new Map,IG=[],DG=new Map,MG=""},"clear");function nCe(t){switch(se.debug("typeStr2Type",t),t){case"[]":return"square";case"()":return se.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"}}T(nCe,"typeStr2Type");function iCe(t){switch(se.debug("typeStr2Type",t),t){case"==":return"thick";default:return"normal"}}T(iCe,"edgeTypeStr2Type");function aCe(t){switch(t.trim().slice(-1)){case"x":return"arrow_cross";case"o":return"arrow_circle";case">":return"arrow_point";default:return""}}T(aCe,"edgeStrToEdgeData");function sCe(t){switch(t.trim().charAt(0)){case"x":return"arrow_cross";case"o":return"arrow_circle";case"<":return"arrow_point";default:return"arrow_open"}}T(sCe,"edgeStrToEdgeStartData");function oCe(t){return t.includes("==")?"thick":"normal"}T(oCe,"edgeStrToThickness");function lCe(t){return t.includes(".-")?"dotted":"solid"}T(lCe,"edgeStrToPattern");var cCe=0,fxt=T(()=>(cCe++,"id-"+Math.random().toString(36).substr(2,12)+"-"+cCe),"generateId"),pxt=T(t=>{u4.children=t,rCe(t,u4),NG=u4.children},"setHierarchy"),gxt=T(t=>{const e=Gl.get(t);return e?e.columns?e.columns:e.children?e.children.length:-1:-1},"getColumns"),mxt=T(()=>[...Gl.values()],"getBlocksFlat"),yxt=T(()=>NG||[],"getBlocks"),vxt=T(()=>IG,"getEdges"),bxt=T(t=>Gl.get(t),"getBlock"),xxt=T(t=>{Gl.set(t.id,t)},"setBlock"),Txt=T(t=>{MG=t},"setDiagramId"),wxt=T(()=>MG,"getDiagramId"),Cxt=T(()=>se,"getLogger"),kxt=T(function(){return zA},"getClasses"),Ext={getConfig:T(()=>pr().block,"getConfig"),typeStr2Type:nCe,edgeTypeStr2Type:iCe,edgeStrToEdgeData:aCe,edgeStrToEdgeStartData:sCe,edgeStrToThickness:oCe,edgeStrToPattern:lCe,getLogger:Cxt,getBlocksFlat:mxt,getBlocks:yxt,getEdges:vxt,setHierarchy:pxt,getBlock:bxt,setBlock:xxt,getColumns:gxt,getClasses:kxt,clear:dxt,generateId:fxt,setDiagramId:Txt,getDiagramId:wxt},Sxt=Ext,$G=T((t,e)=>{const r=p7,n=r(t,"r"),i=r(t,"g"),a=r(t,"b");return dl(n,i,a,e)},"fade"),_xt=T(t=>`.label { font-family: ${t.fontFamily}; color: ${t.nodeTextColor||t.textColor}; } @@ -3090,9 +3091,9 @@ Expecting `+ne.join(", ")+", got '"+(this.terminals_[Y]||Y)+"'":ue="Parse error } .node .cluster { - // fill: ${sP(t.mainBkg,.5)}; - fill: ${sP(t.clusterBkg,.5)}; - stroke: ${sP(t.clusterBorder,.2)}; + // fill: ${$G(t.mainBkg,.5)}; + fill: ${$G(t.clusterBkg,.5)}; + stroke: ${$G(t.clusterBorder,.2)}; box-shadow: rgba(50, 50, 93, 0.25) 0px 13px 27px -5px, rgba(0, 0, 0, 0.3) 0px 8px 16px -8px; stroke-width: 1px; } @@ -3127,12 +3128,12 @@ Expecting `+ne.join(", ")+", got '"+(this.terminals_[Y]||Y)+"'":ue="Parse error font-size: 18px; fill: ${t.textColor}; } - ${px()} -`,"getStyles"),qft=Gft,Vft=x((t,e,r,n)=>{e.forEach(i=>{Jft[i](t,r,n)})},"insertMarkers"),Wft=x((t,e,r)=>{ae.trace("Making markers for ",r),t.append("defs").append("marker").attr("id",r+"_"+e+"-extensionStart").attr("class","marker extension "+e).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 1,7 L18,13 V 1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-extensionEnd").attr("class","marker extension "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 1,1 V 13 L18,7 Z")},"extension"),Uft=x((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-compositionStart").attr("class","marker composition "+e).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-compositionEnd").attr("class","marker composition "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"composition"),Hft=x((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-aggregationStart").attr("class","marker aggregation "+e).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-aggregationEnd").attr("class","marker aggregation "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"aggregation"),Yft=x((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-dependencyStart").attr("class","marker dependency "+e).attr("refX",6).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-dependencyEnd").attr("class","marker dependency "+e).attr("refX",13).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"dependency"),Xft=x((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-lollipopStart").attr("class","marker lollipop "+e).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),t.append("defs").append("marker").attr("id",r+"_"+e+"-lollipopEnd").attr("class","marker lollipop "+e).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6)},"lollipop"),Kft=x((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-pointEnd").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",6).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-pointStart").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",4.5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 0 5 L 10 10 L 10 0 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},"point"),jft=x((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-circleEnd").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",11).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-circleStart").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",-1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},"circle"),Zft=x((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-crossEnd").attr("class","marker cross "+e).attr("viewBox","0 0 11 11").attr("refX",12).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-crossStart").attr("class","marker cross "+e).attr("viewBox","0 0 11 11").attr("refX",-1).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0")},"cross"),Qft=x((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","strokeWidth").attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"barb"),Jft={extension:Wft,composition:Uft,aggregation:Hft,dependency:Yft,lollipop:Xft,point:Kft,circle:jft,cross:Zft,barb:Qft},e0t=Vft,mi=((Jve=(Qve=Pe())==null?void 0:Qve.block)==null?void 0:Jve.padding)??8;function oP(t,e){if(t===0||!Number.isInteger(t))throw new Error("Columns must be an integer !== 0.");if(e<0||!Number.isInteger(e))throw new Error("Position must be a non-negative integer."+e);if(t<0)return{px:e,py:0};if(t===1)return{px:0,py:e};const r=e%t,n=Math.floor(e/t);return{px:r,py:n}}x(oP,"calculateBlockPosition");var t0t=x(t=>{let e=0,r=0;for(const n of t.children){const{width:i,height:a,x:s,y:o}=n.size??{width:0,height:0,x:0,y:0};if(ae.debug("getMaxChildSize abc95 child:",n.id,"width:",i,"height:",a,"x:",s,"y:",o,n.type),n.type==="space")continue;const l=i/(n.widthInColumns??1);l>e&&(e=l),a>r&&(r=a)}return{width:e,height:r}},"getMaxChildSize");function qS(t,e,r=0,n=0){var s,o,l,u,h,d,f,p,g,m,y;ae.debug("setBlockSizes abc95 (start)",t.id,(s=t==null?void 0:t.size)==null?void 0:s.x,"block width =",t==null?void 0:t.size,"siblingWidth",r),(o=t==null?void 0:t.size)!=null&&o.width||(t.size={width:r,height:n,x:0,y:0});let i=0,a=0;if(((l=t.children)==null?void 0:l.length)>0){for(const _ of t.children)qS(_,e);const v=t0t(t);i=v.width,a=v.height,ae.debug("setBlockSizes abc95 maxWidth of",t.id,":s children is ",i,a);for(const _ of t.children)_.size&&(ae.debug(`abc95 Setting size of children of ${t.id} id=${_.id} ${i} ${a} ${JSON.stringify(_.size)}`),_.size.width=i*(_.widthInColumns??1)+mi*((_.widthInColumns??1)-1),_.size.height=a,_.size.x=0,_.size.y=0,ae.debug(`abc95 updating size of ${t.id} children child:${_.id} maxWidth:${i} maxHeight:${a}`));for(const _ of t.children)qS(_,e,i,a);const T=t.columns??-1;let b=0;for(const _ of t.children)b+=_.widthInColumns??1;let w=t.children.length;T>0&&T0?Math.min(t.children.length,T):t.children.length;if(_>0){const L=(A-_*mi-mi)/_;ae.debug("abc95 (growing to fit) width",t.id,A,(f=t.size)==null?void 0:f.width,L);for(const O of t.children)O.size&&(O.size.width=L)}}t.size={width:A,height:C,x:0,y:0}}ae.debug("setBlockSizes abc94 (done)",t.id,(p=t==null?void 0:t.size)==null?void 0:p.x,(g=t==null?void 0:t.size)==null?void 0:g.width,(m=t==null?void 0:t.size)==null?void 0:m.y,(y=t==null?void 0:t.size)==null?void 0:y.height)}x(qS,"setBlockSizes");function lP(t,e){var n,i,a,s,o,l,u,h,d,f,p,g,m,y,v,T,b;ae.debug(`abc85 layout blocks (=>layoutBlocks) ${t.id} x: ${(n=t==null?void 0:t.size)==null?void 0:n.x} y: ${(i=t==null?void 0:t.size)==null?void 0:i.y} width: ${(a=t==null?void 0:t.size)==null?void 0:a.width}`);const r=t.columns??-1;if(ae.debug("layoutBlocks columns abc95",t.id,"=>",r,t),t.children&&t.children.length>0){const w=((o=(s=t==null?void 0:t.children[0])==null?void 0:s.size)==null?void 0:o.width)??0,k=t.children.length*w+(t.children.length-1)*mi;ae.debug("widthOfChildren 88",k,"posX");const A=new Map;{let M=0;for(const z of t.children){if(!z.size)continue;const{py:F}=oP(r,M),S=A.get(F)??0;z.size.height>S&&A.set(F,z.size.height);let R=(z==null?void 0:z.widthInColumns)??1;r>0&&(R=Math.min(R,r-M%r)),M+=R}}const C=new Map;{let M=0;const z=[...A.keys()].sort((F,S)=>F-S);for(const F of z)C.set(F,M),M+=(A.get(F)??0)+mi}let _=0;ae.debug("abc91 block?.size?.x",t.id,(l=t==null?void 0:t.size)==null?void 0:l.x);let L=(u=t==null?void 0:t.size)!=null&&u.x?((h=t==null?void 0:t.size)==null?void 0:h.x)+(-((d=t==null?void 0:t.size)==null?void 0:d.width)/2||0):-mi,O=0;for(const M of t.children){const z=t;if(!M.size)continue;const{width:F,height:S}=M.size,{px:R,py:N}=oP(r,_);if(N!=O&&(O=N,L=(f=t==null?void 0:t.size)!=null&&f.x?((p=t==null?void 0:t.size)==null?void 0:p.x)+(-((g=t==null?void 0:t.size)==null?void 0:g.width)/2||0):-mi,ae.debug("New row in layout for block",t.id," and child ",M.id,O)),ae.debug(`abc89 layout blocks (child) id: ${M.id} Pos: ${_} (px, py) ${R},${N} (${(m=z==null?void 0:z.size)==null?void 0:m.x},${(y=z==null?void 0:z.size)==null?void 0:y.y}) parent: ${z.id} width: ${F}${mi}`),z.size){const I=F/2;M.size.x=L+mi+I,ae.debug(`abc91 layout blocks (calc) px, pyid:${M.id} startingPos=X${L} new startingPosX${M.size.x} ${I} padding=${mi} width=${F} halfWidth=${I} => x:${M.size.x} y:${M.size.y} ${M.widthInColumns} (width * (child?.w || 1)) / 2 ${F*((M==null?void 0:M.widthInColumns)??1)/2}`),L=M.size.x+I;const $=C.get(N)??0,B=A.get(N)??S;M.size.y=z.size.y-z.size.height/2+$+B/2+mi,ae.debug(`abc88 layout blocks (calc) px, pyid:${M.id}startingPosX${L}${mi}${I}=>x:${M.size.x}y:${M.size.y}${M.widthInColumns}(width * (child?.w || 1)) / 2${F*((M==null?void 0:M.widthInColumns)??1)/2}`)}M.children&&lP(M);let D=(M==null?void 0:M.widthInColumns)??1;r>0&&(D=Math.min(D,r-_%r)),_+=D,ae.debug("abc88 columnsPos",M,_)}}ae.debug(`layout blocks (<==layoutBlocks) ${t.id} x: ${(v=t==null?void 0:t.size)==null?void 0:v.x} y: ${(T=t==null?void 0:t.size)==null?void 0:T.y} width: ${(b=t==null?void 0:t.size)==null?void 0:b.width}`)}x(lP,"layoutBlocks");function cP(t,{minX:e,minY:r,maxX:n,maxY:i}={minX:0,minY:0,maxX:0,maxY:0}){if(t.size&&t.id!=="root"){const{x:a,y:s,width:o,height:l}=t.size;a-o/2n&&(n=a+o/2),s+l/2>i&&(i=s+l/2)}if(t.children)for(const a of t.children)({minX:e,minY:r,maxX:n,maxY:i}=cP(a,{minX:e,minY:r,maxX:n,maxY:i}));return{minX:e,minY:r,maxX:n,maxY:i}}x(cP,"findBounds");function Y1e(t){const e=t.getBlock("root");if(!e)return;qS(e,t,0,0),lP(e),ae.debug("getBlocks",JSON.stringify(e,null,2));const{minX:r,minY:n,maxX:i,maxY:a}=cP(e),s=a-n,o=i-r;return{x:r,y:n,width:o,height:s}}x(Y1e,"layout");var r0t=x(async(t,e,r,n=!1,i=!1)=>{let a=e||"";typeof a=="object"&&(a=a[0]);const s=Pe(),o=on(s);return await Wa(t,a,{style:r,isTitle:n,useHtmlLabels:o,markdown:!1,isNode:i,width:Number.POSITIVE_INFINITY},s)},"createLabel"),rl=r0t,n0t=x((t,e,r,n,i)=>{e.arrowTypeStart&&X1e(t,"start",e.arrowTypeStart,r,n,i),e.arrowTypeEnd&&X1e(t,"end",e.arrowTypeEnd,r,n,i)},"addEdgeMarkers"),i0t={arrow_cross:"cross",arrow_point:"point",arrow_barb:"barb",arrow_circle:"circle",aggregation:"aggregation",extension:"extension",composition:"composition",dependency:"dependency",lollipop:"lollipop"},X1e=x((t,e,r,n,i,a)=>{const s=i0t[r];if(!s){ae.warn(`Unknown arrow type: ${r}`);return}const o=e==="start"?"Start":"End";t.attr(`marker-${e}`,`url(${n}#${i}_${a}-${s}${o})`)},"addEdgeMarker"),uP={},Oa={},a0t=x(async(t,e)=>{const r=Pe(),n=on(r),i=t.insert("g").attr("class","edgeLabel"),a=i.insert("g").attr("class","label"),s=e.labelType==="markdown",o=await Wa(t,e.label,{style:e.labelStyle,useHtmlLabels:n,addSvgBackground:s,isNode:!1,markdown:s,width:s?void 0:Number.POSITIVE_INFINITY},r);a.node().appendChild(o);let l=o.getBBox(),u=l;if(n){const d=o.children[0],f=pt(o);l=d.getBoundingClientRect(),u=l,f.attr("width",l.width),f.attr("height",l.height)}else{const d=pt(o).select("text").node();d&&typeof d.getBBox=="function"&&(u=d.getBBox())}a.attr("transform",yl(u,n)),uP[e.id]=i,e.width=l.width,e.height=l.height;let h;if(e.startLabelLeft){const d=t.insert("g").attr("class","edgeTerminals"),f=d.insert("g").attr("class","inner"),p=await rl(f,e.startLabelLeft,e.labelStyle);h=p;let g=p.getBBox();if(n){const m=p.children[0],y=pt(p);g=m.getBoundingClientRect(),y.attr("width",g.width),y.attr("height",g.height)}f.attr("transform",yl(g,n)),Oa[e.id]||(Oa[e.id]={}),Oa[e.id].startLeft=d,iw(h,e.startLabelLeft)}if(e.startLabelRight){const d=t.insert("g").attr("class","edgeTerminals"),f=d.insert("g").attr("class","inner"),p=await rl(f,e.startLabelRight,e.labelStyle);h=p;let g=p.getBBox();if(n){const m=p.children[0],y=pt(p);g=m.getBoundingClientRect(),y.attr("width",g.width),y.attr("height",g.height)}f.attr("transform",yl(g,n)),Oa[e.id]||(Oa[e.id]={}),Oa[e.id].startRight=d,iw(h,e.startLabelRight)}if(e.endLabelLeft){const d=t.insert("g").attr("class","edgeTerminals"),f=d.insert("g").attr("class","inner"),p=await rl(d,e.endLabelLeft,e.labelStyle);h=p;let g=p.getBBox();if(n){const m=p.children[0],y=pt(p);g=m.getBoundingClientRect(),y.attr("width",g.width),y.attr("height",g.height)}f.attr("transform",yl(g,n)),Oa[e.id]||(Oa[e.id]={}),Oa[e.id].endLeft=d,iw(h,e.endLabelLeft)}if(e.endLabelRight){const d=t.insert("g").attr("class","edgeTerminals"),f=d.insert("g").attr("class","inner"),p=await rl(d,e.endLabelRight,e.labelStyle);h=p;let g=p.getBBox();if(n){const m=p.children[0],y=pt(p);g=m.getBoundingClientRect(),y.attr("width",g.width),y.attr("height",g.height)}f.attr("transform",yl(g,n)),Oa[e.id]||(Oa[e.id]={}),Oa[e.id].endRight=d,iw(h,e.endLabelRight)}return o},"insertEdgeLabel");function iw(t,e){on(Pe())&&t&&(t.style.width=e.length*9+"px",t.style.height="12px")}x(iw,"setTerminalWidth");var s0t=x((t,e)=>{ae.debug("Moving label abc88 ",t.id,t.label,uP[t.id],e);let r=e.updatedPath?e.updatedPath:e.originalPath;const n=Pe(),{subGraphTitleTotalMargin:i}=H2(n);if(t.label){const a=uP[t.id];let s=t.x,o=t.y;if(r){const l=Lr.calcLabelPosition(r);ae.debug("Moving label "+t.label+" from (",s,",",o,") to (",l.x,",",l.y,") abc88"),e.updatedPath&&(s=l.x,o=l.y)}a.attr("transform",`translate(${s}, ${o+i/2})`)}if(t.startLabelLeft){const a=Oa[t.id].startLeft;let s=t.x,o=t.y;if(r){const l=Lr.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_left",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}if(t.startLabelRight){const a=Oa[t.id].startRight;let s=t.x,o=t.y;if(r){const l=Lr.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_right",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}if(t.endLabelLeft){const a=Oa[t.id].endLeft;let s=t.x,o=t.y;if(r){const l=Lr.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_left",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}if(t.endLabelRight){const a=Oa[t.id].endRight;let s=t.x,o=t.y;if(r){const l=Lr.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_right",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}},"positionEdgeLabel"),o0t=x((t,e)=>{const r=t.x,n=t.y,i=Math.abs(e.x-r),a=Math.abs(e.y-n),s=t.width/2,o=t.height/2;return i>=s||a>=o},"outsideNode"),l0t=x((t,e,r)=>{ae.debug(`intersection calc abc89: + ${Tw()} +`,"getStyles"),Axt=_xt,Rxt=T((t,e,r,n)=>{e.forEach(i=>{Fxt[i](t,r,n)})},"insertMarkers"),Lxt=T((t,e,r)=>{se.trace("Making markers for ",r),t.append("defs").append("marker").attr("id",r+"_"+e+"-extensionStart").attr("class","marker extension "+e).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 1,7 L18,13 V 1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-extensionEnd").attr("class","marker extension "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 1,1 V 13 L18,7 Z")},"extension"),Ixt=T((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-compositionStart").attr("class","marker composition "+e).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-compositionEnd").attr("class","marker composition "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"composition"),Dxt=T((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-aggregationStart").attr("class","marker aggregation "+e).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-aggregationEnd").attr("class","marker aggregation "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"aggregation"),Mxt=T((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-dependencyStart").attr("class","marker dependency "+e).attr("refX",6).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-dependencyEnd").attr("class","marker dependency "+e).attr("refX",13).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"dependency"),Nxt=T((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-lollipopStart").attr("class","marker lollipop "+e).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),t.append("defs").append("marker").attr("id",r+"_"+e+"-lollipopEnd").attr("class","marker lollipop "+e).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6)},"lollipop"),$xt=T((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-pointEnd").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",6).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-pointStart").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",4.5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 0 5 L 10 10 L 10 0 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},"point"),Oxt=T((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-circleEnd").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",11).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-circleStart").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",-1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},"circle"),Pxt=T((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-crossEnd").attr("class","marker cross "+e).attr("viewBox","0 0 11 11").attr("refX",12).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-crossStart").attr("class","marker cross "+e).attr("viewBox","0 0 11 11").attr("refX",-1).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0")},"cross"),Bxt=T((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","strokeWidth").attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"barb"),Fxt={extension:Lxt,composition:Ixt,aggregation:Dxt,dependency:Mxt,lollipop:Nxt,point:$xt,circle:Oxt,cross:Pxt,barb:Bxt},zxt=Rxt,Bi=((mke=(gke=Pe())==null?void 0:gke.block)==null?void 0:mke.padding)??8;function OG(t,e){if(t===0||!Number.isInteger(t))throw new Error("Columns must be an integer !== 0.");if(e<0||!Number.isInteger(e))throw new Error("Position must be a non-negative integer."+e);if(t<0)return{px:e,py:0};if(t===1)return{px:0,py:e};const r=e%t,n=Math.floor(e/t);return{px:r,py:n}}T(OG,"calculateBlockPosition");var Gxt=T(t=>{let e=0,r=0;for(const n of t.children){const{width:i,height:a,x:s,y:o}=n.size??{width:0,height:0,x:0,y:0};if(se.debug("getMaxChildSize abc95 child:",n.id,"width:",i,"height:",a,"x:",s,"y:",o,n.type),n.type==="space")continue;const l=i/(n.widthInColumns??1);l>e&&(e=l),a>r&&(r=a)}return{width:e,height:r}},"getMaxChildSize");function GA(t,e,r=0,n=0){var s,o,l,u,h,d,f,p,g,m,y;se.debug("setBlockSizes abc95 (start)",t.id,(s=t==null?void 0:t.size)==null?void 0:s.x,"block width =",t==null?void 0:t.size,"siblingWidth",r),(o=t==null?void 0:t.size)!=null&&o.width||(t.size={width:r,height:n,x:0,y:0});let i=0,a=0;if(((l=t.children)==null?void 0:l.length)>0){for(const S of t.children)GA(S,e);const v=Gxt(t);i=v.width,a=v.height,se.debug("setBlockSizes abc95 maxWidth of",t.id,":s children is ",i,a);for(const S of t.children)S.size&&(se.debug(`abc95 Setting size of children of ${t.id} id=${S.id} ${i} ${a} ${JSON.stringify(S.size)}`),S.size.width=i*(S.widthInColumns??1)+Bi*((S.widthInColumns??1)-1),S.size.height=a,S.size.x=0,S.size.y=0,se.debug(`abc95 updating size of ${t.id} children child:${S.id} maxWidth:${i} maxHeight:${a}`));for(const S of t.children)GA(S,e,i,a);const x=t.columns??-1;let b=0;for(const S of t.children)b+=S.widthInColumns??1;let w=t.children.length;x>0&&x0?Math.min(t.children.length,x):t.children.length;if(S>0){const L=(_-S*Bi-Bi)/S;se.debug("abc95 (growing to fit) width",t.id,_,(f=t.size)==null?void 0:f.width,L);for(const $ of t.children)$.size&&($.size.width=L)}}t.size={width:_,height:k,x:0,y:0}}se.debug("setBlockSizes abc94 (done)",t.id,(p=t==null?void 0:t.size)==null?void 0:p.x,(g=t==null?void 0:t.size)==null?void 0:g.width,(m=t==null?void 0:t.size)==null?void 0:m.y,(y=t==null?void 0:t.size)==null?void 0:y.height)}T(GA,"setBlockSizes");function PG(t,e){var n,i,a,s,o,l,u,h,d,f,p,g,m,y,v,x,b;se.debug(`abc85 layout blocks (=>layoutBlocks) ${t.id} x: ${(n=t==null?void 0:t.size)==null?void 0:n.x} y: ${(i=t==null?void 0:t.size)==null?void 0:i.y} width: ${(a=t==null?void 0:t.size)==null?void 0:a.width}`);const r=t.columns??-1;if(se.debug("layoutBlocks columns abc95",t.id,"=>",r,t),t.children&&t.children.length>0){const w=((o=(s=t==null?void 0:t.children[0])==null?void 0:s.size)==null?void 0:o.width)??0,C=t.children.length*w+(t.children.length-1)*Bi;se.debug("widthOfChildren 88",C,"posX");const _=new Map;{let I=0;for(const z of t.children){if(!z.size)continue;const{py:F}=OG(r,I),A=_.get(F)??0;z.size.height>A&&_.set(F,z.size.height);let R=(z==null?void 0:z.widthInColumns)??1;r>0&&(R=Math.min(R,r-I%r)),I+=R}}const k=new Map;{let I=0;const z=[..._.keys()].sort((F,A)=>F-A);for(const F of z)k.set(F,I),I+=(_.get(F)??0)+Bi}let S=0;se.debug("abc91 block?.size?.x",t.id,(l=t==null?void 0:t.size)==null?void 0:l.x);let L=(u=t==null?void 0:t.size)!=null&&u.x?((h=t==null?void 0:t.size)==null?void 0:h.x)+(-((d=t==null?void 0:t.size)==null?void 0:d.width)/2||0):-Bi,$=0;for(const I of t.children){const z=t;if(!I.size)continue;const{width:F,height:A}=I.size,{px:R,py:N}=OG(r,S);if(N!=$&&($=N,L=(f=t==null?void 0:t.size)!=null&&f.x?((p=t==null?void 0:t.size)==null?void 0:p.x)+(-((g=t==null?void 0:t.size)==null?void 0:g.width)/2||0):-Bi,se.debug("New row in layout for block",t.id," and child ",I.id,$)),se.debug(`abc89 layout blocks (child) id: ${I.id} Pos: ${S} (px, py) ${R},${N} (${(m=z==null?void 0:z.size)==null?void 0:m.x},${(y=z==null?void 0:z.size)==null?void 0:y.y}) parent: ${z.id} width: ${F}${Bi}`),z.size){const D=F/2;I.size.x=L+Bi+D,se.debug(`abc91 layout blocks (calc) px, pyid:${I.id} startingPos=X${L} new startingPosX${I.size.x} ${D} padding=${Bi} width=${F} halfWidth=${D} => x:${I.size.x} y:${I.size.y} ${I.widthInColumns} (width * (child?.w || 1)) / 2 ${F*((I==null?void 0:I.widthInColumns)??1)/2}`),L=I.size.x+D;const O=k.get(N)??0,B=_.get(N)??A;I.size.y=z.size.y-z.size.height/2+O+B/2+Bi,se.debug(`abc88 layout blocks (calc) px, pyid:${I.id}startingPosX${L}${Bi}${D}=>x:${I.size.x}y:${I.size.y}${I.widthInColumns}(width * (child?.w || 1)) / 2${F*((I==null?void 0:I.widthInColumns)??1)/2}`)}I.children&&PG(I);let M=(I==null?void 0:I.widthInColumns)??1;r>0&&(M=Math.min(M,r-S%r)),S+=M,se.debug("abc88 columnsPos",I,S)}}se.debug(`layout blocks (<==layoutBlocks) ${t.id} x: ${(v=t==null?void 0:t.size)==null?void 0:v.x} y: ${(x=t==null?void 0:t.size)==null?void 0:x.y} width: ${(b=t==null?void 0:t.size)==null?void 0:b.width}`)}T(PG,"layoutBlocks");function BG(t,{minX:e,minY:r,maxX:n,maxY:i}={minX:0,minY:0,maxX:0,maxY:0}){if(t.size&&t.id!=="root"){const{x:a,y:s,width:o,height:l}=t.size;a-o/2n&&(n=a+o/2),s+l/2>i&&(i=s+l/2)}if(t.children)for(const a of t.children)({minX:e,minY:r,maxX:n,maxY:i}=BG(a,{minX:e,minY:r,maxX:n,maxY:i}));return{minX:e,minY:r,maxX:n,maxY:i}}T(BG,"findBounds");function uCe(t){const e=t.getBlock("root");if(!e)return;GA(e,t,0,0),PG(e),se.debug("getBlocks",JSON.stringify(e,null,2));const{minX:r,minY:n,maxX:i,maxY:a}=BG(e),s=a-n,o=i-r;return{x:r,y:n,width:o,height:s}}T(uCe,"layout");var qxt=T(async(t,e,r,n=!1,i=!1)=>{let a=e||"";typeof a=="object"&&(a=a[0]);const s=Pe(),o=mn(s);return await ys(t,a,{style:r,isTitle:n,useHtmlLabels:o,markdown:!1,isNode:i,width:Number.POSITIVE_INFINITY},s)},"createLabel"),ql=qxt,Vxt=T((t,e,r,n,i)=>{e.arrowTypeStart&&hCe(t,"start",e.arrowTypeStart,r,n,i),e.arrowTypeEnd&&hCe(t,"end",e.arrowTypeEnd,r,n,i)},"addEdgeMarkers"),Wxt={arrow_cross:"cross",arrow_point:"point",arrow_barb:"barb",arrow_circle:"circle",aggregation:"aggregation",extension:"extension",composition:"composition",dependency:"dependency",lollipop:"lollipop"},hCe=T((t,e,r,n,i,a)=>{const s=Wxt[r];if(!s){se.warn(`Unknown arrow type: ${r}`);return}const o=e==="start"?"Start":"End";t.attr(`marker-${e}`,`url(${n}#${i}_${a}-${s}${o})`)},"addEdgeMarker"),FG={},ls={},Uxt=T(async(t,e)=>{const r=Pe(),n=mn(r),i=t.insert("g").attr("class","edgeLabel"),a=i.insert("g").attr("class","label"),s=e.labelType==="markdown",o=await ys(t,e.label,{style:e.labelStyle,useHtmlLabels:n,addSvgBackground:s,isNode:!1,markdown:s,width:s?void 0:Number.POSITIVE_INFINITY},r);a.node().appendChild(o);let l=o.getBBox(),u=l;if(n){const d=o.children[0],f=gt(o);l=d.getBoundingClientRect(),u=l,f.attr("width",l.width),f.attr("height",l.height)}else{const d=gt(o).select("text").node();d&&typeof d.getBBox=="function"&&(u=d.getBBox())}a.attr("transform",nc(u,n)),FG[e.id]=i,e.width=l.width,e.height=l.height;let h;if(e.startLabelLeft){const d=t.insert("g").attr("class","edgeTerminals"),f=d.insert("g").attr("class","inner"),p=await ql(f,e.startLabelLeft,e.labelStyle);h=p;let g=p.getBBox();if(n){const m=p.children[0],y=gt(p);g=m.getBoundingClientRect(),y.attr("width",g.width),y.attr("height",g.height)}f.attr("transform",nc(g,n)),ls[e.id]||(ls[e.id]={}),ls[e.id].startLeft=d,h4(h,e.startLabelLeft)}if(e.startLabelRight){const d=t.insert("g").attr("class","edgeTerminals"),f=d.insert("g").attr("class","inner"),p=await ql(f,e.startLabelRight,e.labelStyle);h=p;let g=p.getBBox();if(n){const m=p.children[0],y=gt(p);g=m.getBoundingClientRect(),y.attr("width",g.width),y.attr("height",g.height)}f.attr("transform",nc(g,n)),ls[e.id]||(ls[e.id]={}),ls[e.id].startRight=d,h4(h,e.startLabelRight)}if(e.endLabelLeft){const d=t.insert("g").attr("class","edgeTerminals"),f=d.insert("g").attr("class","inner"),p=await ql(d,e.endLabelLeft,e.labelStyle);h=p;let g=p.getBBox();if(n){const m=p.children[0],y=gt(p);g=m.getBoundingClientRect(),y.attr("width",g.width),y.attr("height",g.height)}f.attr("transform",nc(g,n)),ls[e.id]||(ls[e.id]={}),ls[e.id].endLeft=d,h4(h,e.endLabelLeft)}if(e.endLabelRight){const d=t.insert("g").attr("class","edgeTerminals"),f=d.insert("g").attr("class","inner"),p=await ql(d,e.endLabelRight,e.labelStyle);h=p;let g=p.getBBox();if(n){const m=p.children[0],y=gt(p);g=m.getBoundingClientRect(),y.attr("width",g.width),y.attr("height",g.height)}f.attr("transform",nc(g,n)),ls[e.id]||(ls[e.id]={}),ls[e.id].endRight=d,h4(h,e.endLabelRight)}return o},"insertEdgeLabel");function h4(t,e){mn(Pe())&&t&&(t.style.width=e.length*9+"px",t.style.height="12px")}T(h4,"setTerminalWidth");var Hxt=T((t,e)=>{se.debug("Moving label abc88 ",t.id,t.label,FG[t.id],e);let r=e.updatedPath?e.updatedPath:e.originalPath;const n=Pe(),{subGraphTitleTotalMargin:i}=Ex(n);if(t.label){const a=FG[t.id];let s=t.x,o=t.y;if(r){const l=Pr.calcLabelPosition(r);se.debug("Moving label "+t.label+" from (",s,",",o,") to (",l.x,",",l.y,") abc88"),e.updatedPath&&(s=l.x,o=l.y)}a.attr("transform",`translate(${s}, ${o+i/2})`)}if(t.startLabelLeft){const a=ls[t.id].startLeft;let s=t.x,o=t.y;if(r){const l=Pr.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_left",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}if(t.startLabelRight){const a=ls[t.id].startRight;let s=t.x,o=t.y;if(r){const l=Pr.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_right",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}if(t.endLabelLeft){const a=ls[t.id].endLeft;let s=t.x,o=t.y;if(r){const l=Pr.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_left",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}if(t.endLabelRight){const a=ls[t.id].endRight;let s=t.x,o=t.y;if(r){const l=Pr.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_right",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}},"positionEdgeLabel"),Yxt=T((t,e)=>{const r=t.x,n=t.y,i=Math.abs(e.x-r),a=Math.abs(e.y-n),s=t.width/2,o=t.height/2;return i>=s||a>=o},"outsideNode"),Xxt=T((t,e,r)=>{se.debug(`intersection calc abc89: outsidePoint: ${JSON.stringify(e)} insidePoint : ${JSON.stringify(r)} - node : x:${t.x} y:${t.y} w:${t.width} h:${t.height}`);const n=t.x,i=t.y,a=Math.abs(n-r.x),s=t.width/2;let o=r.xMath.abs(n-e.x)*l){let d=r.y{ae.debug("abc88 cutPathAtIntersect",t,e);let r=[],n=t[0],i=!1;return t.forEach(a=>{if(!o0t(e,a)&&!i){const s=l0t(e,n,a);let o=!1;r.forEach(l=>{o=o||l.x===s.x&&l.y===s.y}),r.some(l=>l.x===s.x&&l.y===s.y)||r.push(s),i=!0}else n=a,i||r.push(a)}),r},"cutPathAtIntersect"),c0t=x(function(t,e,r,n,i,a,s){let o=r.points;ae.debug("abc88 InsertEdge: edge=",r,"e=",e);let l=!1;const u=a.node(e.v);var h=a.node(e.w);h!=null&&h.intersect&&(u!=null&&u.intersect)&&(o=o.slice(1,r.points.length-1),o.unshift(u.intersect(o[0])),o.push(h.intersect(o[o.length-1]))),r.toCluster&&(ae.debug("to cluster abc88",n[r.toCluster]),o=K1e(r.points,n[r.toCluster].node),l=!0),r.fromCluster&&(ae.debug("from cluster abc88",n[r.fromCluster]),o=K1e(o.reverse(),n[r.fromCluster].node).reverse(),l=!0);const d=o.filter(w=>!Number.isNaN(w.y));let f=N2;r.curve&&(i==="graph"||i==="flowchart")&&(f=r.curve);const{x:p,y:g}=Aq(r),m=M2().x(p).y(g).curve(f);let y;switch(r.thickness){case"normal":y="edge-thickness-normal";break;case"thick":y="edge-thickness-thick";break;case"invisible":y="edge-thickness-thick";break;default:y=""}switch(r.pattern){case"solid":y+=" edge-pattern-solid";break;case"dotted":y+=" edge-pattern-dotted";break;case"dashed":y+=" edge-pattern-dashed";break}const v=t.append("path").attr("d",m(d)).attr("id",r.id).attr("class"," "+y+(r.classes?" "+r.classes:"")).attr("style",r.style);let T="";(Pe().flowchart.arrowMarkerAbsolute||Pe().state.arrowMarkerAbsolute)&&(T=Aw(!0)),n0t(v,r,T,s,i);let b={};return l&&(b.updatedPath=o),b.originalPath=r.points,b},"insertEdge"),u0t=x(t=>{const e=new Set;for(const r of t)switch(r){case"x":e.add("right"),e.add("left");break;case"y":e.add("up"),e.add("down");break;default:e.add(r);break}return e},"expandAndDeduplicateDirections"),h0t=x((t,e,r,n)=>{const i=u0t(t),a=2,s=e.height+2*r.padding,o=s/a,l=n??e.width+2*o+r.padding,u=r.padding/2;return i.has("right")&&i.has("left")&&i.has("up")&&i.has("down")?[{x:0,y:0},{x:o,y:0},{x:l/2,y:2*u},{x:l-o,y:0},{x:l,y:0},{x:l,y:-s/3},{x:l+2*u,y:-s/2},{x:l,y:-2*s/3},{x:l,y:-s},{x:l-o,y:-s},{x:l/2,y:-s-2*u},{x:o,y:-s},{x:0,y:-s},{x:0,y:-2*s/3},{x:-2*u,y:-s/2},{x:0,y:-s/3}]:i.has("right")&&i.has("left")&&i.has("up")?[{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}]:i.has("right")&&i.has("left")&&i.has("down")?[{x:0,y:0},{x:o,y:-s},{x:l-o,y:-s},{x:l,y:0}]:i.has("right")&&i.has("up")&&i.has("down")?[{x:0,y:0},{x:l,y:-o},{x:l,y:-s+o},{x:0,y:-s}]:i.has("left")&&i.has("up")&&i.has("down")?[{x:l,y:0},{x:0,y:-o},{x:0,y:-s+o},{x:l,y:-s}]:i.has("right")&&i.has("left")?[{x:o,y:0},{x:o,y:-u},{x:l-o,y:-u},{x:l-o,y:0},{x:l,y:-s/2},{x:l-o,y:-s},{x:l-o,y:-s+u},{x:o,y:-s+u},{x:o,y:-s},{x:0,y:-s/2}]:i.has("up")&&i.has("down")?[{x:l/2,y:0},{x:0,y:-u},{x:o,y:-u},{x:o,y:-s+u},{x:0,y:-s+u},{x:l/2,y:-s},{x:l,y:-s+u},{x:l-o,y:-s+u},{x:l-o,y:-u},{x:l,y:-u}]:i.has("right")&&i.has("up")?[{x:0,y:0},{x:l,y:-o},{x:0,y:-s}]:i.has("right")&&i.has("down")?[{x:0,y:0},{x:l,y:0},{x:0,y:-s}]:i.has("left")&&i.has("up")?[{x:l,y:0},{x:0,y:-o},{x:l,y:-s}]:i.has("left")&&i.has("down")?[{x:l,y:0},{x:0,y:0},{x:l,y:-s}]:i.has("right")?[{x:o,y:-u},{x:o,y:-u},{x:l-o,y:-u},{x:l-o,y:0},{x:l,y:-s/2},{x:l-o,y:-s},{x:l-o,y:-s+u},{x:o,y:-s+u},{x:o,y:-s+u}]:i.has("left")?[{x:o,y:0},{x:o,y:-u},{x:l-o,y:-u},{x:l-o,y:-s+u},{x:o,y:-s+u},{x:o,y:-s},{x:0,y:-s/2}]:i.has("up")?[{x:o,y:-u},{x:o,y:-s+u},{x:0,y:-s+u},{x:l/2,y:-s},{x:l,y:-s+u},{x:l-o,y:-s+u},{x:l-o,y:-u}]:i.has("down")?[{x:l/2,y:0},{x:0,y:-u},{x:o,y:-u},{x:o,y:-s+u},{x:l-o,y:-s+u},{x:l-o,y:-u},{x:l,y:-u}]:[{x:0,y:0}]},"getArrowPoints");function j1e(t,e){return t.intersect(e)}x(j1e,"intersectNode");var d0t=j1e;function Z1e(t,e,r,n){var i=t.x,a=t.y,s=i-n.x,o=a-n.y,l=Math.sqrt(e*e*o*o+r*r*s*s),u=Math.abs(e*r*s/l);n.x0}x(hP,"sameSign");var p0t=eye,g0t=tye;function tye(t,e,r){var n=t.x,i=t.y,a=[],s=Number.POSITIVE_INFINITY,o=Number.POSITIVE_INFINITY;typeof e.forEach=="function"?e.forEach(function(g){s=Math.min(s,g.x),o=Math.min(o,g.y)}):(s=Math.min(s,e.x),o=Math.min(o,e.y));for(var l=n-t.width/2-s,u=i-t.height/2-o,h=0;h1&&a.sort(function(g,m){var y=g.x-r.x,v=g.y-r.y,T=Math.sqrt(y*y+v*v),b=m.x-r.x,w=m.y-r.y,k=Math.sqrt(b*b+w*w);return T{var r=t.x,n=t.y,i=e.x-r,a=e.y-n,s=t.width/2,o=t.height/2,l,u;return Math.abs(a)*s>Math.abs(i)*o?(a<0&&(o=-o),l=a===0?0:o*i/a,u=o):(i<0&&(s=-s),l=s,u=i===0?0:s*a/i),{x:r+l,y:n+u}},"intersectRect"),y0t=m0t,Yn={node:d0t,circle:f0t,ellipse:Q1e,polygon:g0t,rect:y0t},sa=x(async(t,e,r,n)=>{const i=Pe();let a;const s=e.useHtmlLabels||on(i);r?a=r:a="node default";const o=t.insert("g").attr("class",a).attr("id",e.domId||e.id),l=o.insert("g").attr("class","label").attr("style",e.labelStyle);let u;e.labelText===void 0?u="":u=typeof e.labelText=="string"?e.labelText:e.labelText[0];let h;e.labelType==="markdown"?h=Wa(l,qr(Tc(u),i),{useHtmlLabels:s,width:e.width||i.flowchart.wrappingWidth,classes:"markdown-node-label"},i):h=await rl(l,qr(Tc(u),i),e.labelStyle,!1,n);let d=h.getBBox();const f=e.padding/2;if(on(i)){const p=h.children[0],g=pt(h);await p_(p,u),d=p.getBoundingClientRect(),g.attr("width",d.width),g.attr("height",d.height)}return s?l.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"):l.attr("transform","translate(0, "+-d.height/2+")"),e.centerLabel&&l.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"),l.insert("rect",":first-child"),{shapeSvg:o,bbox:d,halfPadding:f,label:l}},"labelHelper"),oi=x((t,e)=>{const r=e.node().getBBox();t.width=r.width,t.height=r.height},"updateNodeBounds");function nl(t,e,r,n){return t.insert("polygon",":first-child").attr("points",n.map(function(i){return i.x+","+i.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-e/2+","+r/2+")")}x(nl,"insertPolygonShape");var v0t=x(async(t,e)=>{e.useHtmlLabels||on(Pe())||(e.centerLabel=!0);const{shapeSvg:n,bbox:i,halfPadding:a}=await sa(t,e,"node "+e.classes,!0);ae.info("Classes = ",e.classes);const s=n.insert("rect",":first-child");return s.attr("rx",e.rx).attr("ry",e.ry).attr("x",-i.width/2-a).attr("y",-i.height/2-a).attr("width",i.width+e.padding).attr("height",i.height+e.padding),oi(e,s),e.intersect=function(o){return Yn.rect(e,o)},n},"note"),b0t=v0t,rye=x(t=>t?" "+t:"","formatClass"),ro=x((t,e)=>`${e||"node default"}${rye(t.classes)} ${rye(t.class)}`,"getClassesFromNode"),nye=x(async(t,e)=>{const{shapeSvg:r,bbox:n}=await sa(t,e,ro(e,void 0),!0),i=n.width+e.padding,a=n.height+e.padding,s=i+a,o=[{x:s/2,y:0},{x:s,y:-s/2},{x:s/2,y:-s},{x:0,y:-s/2}];ae.info("Question main (Circle)");const l=nl(r,s,s,o);return l.attr("style",e.style),oi(e,l),e.intersect=function(u){return ae.warn("Intersect called"),Yn.polygon(e,o,u)},r},"question"),x0t=x((t,e)=>{const r=t.insert("g").attr("class","node default").attr("id",e.domId||e.id),n=28,i=[{x:0,y:n/2},{x:n/2,y:0},{x:0,y:-n/2},{x:-n/2,y:0}];return r.insert("polygon",":first-child").attr("points",i.map(function(s){return s.x+","+s.y}).join(" ")).attr("class","state-start").attr("r",7).attr("width",28).attr("height",28),e.width=28,e.height=28,e.intersect=function(s){return Yn.circle(e,14,s)},r},"choice"),T0t=x(async(t,e)=>{const{shapeSvg:r,bbox:n}=await sa(t,e,ro(e,void 0),!0),i=4,a=e.positioned?e.height:n.height+e.padding,s=a/i,o=e.positioned?e.width:n.width+2*s+e.padding,l=[{x:s,y:0},{x:o-s,y:0},{x:o,y:-a/2},{x:o-s,y:-a},{x:s,y:-a},{x:0,y:-a/2}],u=nl(r,o,a,l);return u.attr("style",e.style),oi(e,u),e.intersect=function(h){return Yn.polygon(e,l,h)},r},"hexagon"),w0t=x(async(t,e)=>{const{shapeSvg:r,bbox:n}=await sa(t,e,void 0,!0),i=2,a=n.height+2*e.padding,s=a/i,o=n.width+2*s+e.padding,u=e.positioned&&(e.widthInColumns??1)>1&&e.width>o?e.width:o,h=h0t(e.directions,n,e,u),d=nl(r,u,a,h);return d.attr("style",e.style),oi(e,d),e.intersect=function(f){return Yn.polygon(e,h,f)},r},"block_arrow"),C0t=x(async(t,e)=>{const{shapeSvg:r,bbox:n}=await sa(t,e,ro(e,void 0),!0),i=n.width+e.padding,a=n.height+e.padding,s=[{x:-a/2,y:0},{x:i,y:0},{x:i,y:-a},{x:-a/2,y:-a},{x:0,y:-a/2}];return nl(r,i,a,s).attr("style",e.style),e.width=i+a,e.height=a,e.intersect=function(l){return Yn.polygon(e,s,l)},r},"rect_left_inv_arrow"),k0t=x(async(t,e)=>{const{shapeSvg:r,bbox:n}=await sa(t,e,ro(e),!0),i=n.width+e.padding,a=n.height+e.padding,s=[{x:-2*a/6,y:0},{x:i-a/6,y:0},{x:i+2*a/6,y:-a},{x:a/6,y:-a}],o=nl(r,i,a,s);return o.attr("style",e.style),oi(e,o),e.intersect=function(l){return Yn.polygon(e,s,l)},r},"lean_right"),E0t=x(async(t,e)=>{const{shapeSvg:r,bbox:n}=await sa(t,e,ro(e,void 0),!0),i=n.width+e.padding,a=n.height+e.padding,s=[{x:2*a/6,y:0},{x:i+a/6,y:0},{x:i-2*a/6,y:-a},{x:-a/6,y:-a}],o=nl(r,i,a,s);return o.attr("style",e.style),oi(e,o),e.intersect=function(l){return Yn.polygon(e,s,l)},r},"lean_left"),S0t=x(async(t,e)=>{const{shapeSvg:r,bbox:n}=await sa(t,e,ro(e,void 0),!0),i=n.width+e.padding,a=n.height+e.padding,s=[{x:-2*a/6,y:0},{x:i+2*a/6,y:0},{x:i-a/6,y:-a},{x:a/6,y:-a}],o=nl(r,i,a,s);return o.attr("style",e.style),oi(e,o),e.intersect=function(l){return Yn.polygon(e,s,l)},r},"trapezoid"),A0t=x(async(t,e)=>{const{shapeSvg:r,bbox:n}=await sa(t,e,ro(e,void 0),!0),i=n.width+e.padding,a=n.height+e.padding,s=[{x:a/6,y:0},{x:i-a/6,y:0},{x:i+2*a/6,y:-a},{x:-2*a/6,y:-a}],o=nl(r,i,a,s);return o.attr("style",e.style),oi(e,o),e.intersect=function(l){return Yn.polygon(e,s,l)},r},"inv_trapezoid"),_0t=x(async(t,e)=>{const{shapeSvg:r,bbox:n}=await sa(t,e,ro(e,void 0),!0),i=n.width+e.padding,a=n.height+e.padding,s=[{x:0,y:0},{x:i+a/2,y:0},{x:i,y:-a/2},{x:i+a/2,y:-a},{x:0,y:-a}],o=nl(r,i,a,s);return o.attr("style",e.style),oi(e,o),e.intersect=function(l){return Yn.polygon(e,s,l)},r},"rect_right_inv_arrow"),R0t=x(async(t,e)=>{const{shapeSvg:r,bbox:n}=await sa(t,e,ro(e,void 0),!0),i=n.width+e.padding,a=i/2,s=a/(2.5+i/50),o=n.height+s+e.padding,l="M 0,"+s+" a "+a+","+s+" 0,0,0 "+i+" 0 a "+a+","+s+" 0,0,0 "+-i+" 0 l 0,"+o+" a "+a+","+s+" 0,0,0 "+i+" 0 l 0,"+-o,u=r.attr("label-offset-y",s).insert("path",":first-child").attr("style",e.style).attr("d",l).attr("transform","translate("+-i/2+","+-(o/2+s)+")");return oi(e,u),e.intersect=function(h){const d=Yn.rect(e,h),f=d.x-e.x;if(a!=0&&(Math.abs(f)e.height/2-s)){let p=s*s*(1-f*f/(a*a));p!=0&&(p=Math.sqrt(p)),p=s-p,h.y-e.y>0&&(p=-p),d.y+=p}return d},r},"cylinder"),L0t=x(async(t,e)=>{const{shapeSvg:r,bbox:n,halfPadding:i}=await sa(t,e,"node "+e.classes+" "+e.class,!0),a=r.insert("rect",":first-child"),s=e.positioned?e.width:n.width+e.padding,o=e.positioned?e.height:n.height+e.padding,l=e.positioned?-s/2:-n.width/2-i,u=e.positioned?-o/2:-n.height/2-i;if(a.attr("class","basic label-container").attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("x",l).attr("y",u).attr("width",s).attr("height",o),e.props){const h=new Set(Object.keys(e.props));e.props.borders&&(VS(a,e.props.borders,s,o),h.delete("borders")),h.forEach(d=>{ae.warn(`Unknown node property ${d}`)})}return oi(e,a),e.intersect=function(h){return Yn.rect(e,h)},r},"rect"),I0t=x(async(t,e)=>{const{shapeSvg:r,bbox:n,halfPadding:i}=await sa(t,e,"node "+e.classes,!0),a=r.insert("rect",":first-child"),s=e.positioned?e.width:n.width+e.padding,o=e.positioned?e.height:n.height+e.padding,l=e.positioned?-s/2:-n.width/2-i,u=e.positioned?-o/2:-n.height/2-i;if(a.attr("class","basic cluster composite label-container").attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("x",l).attr("y",u).attr("width",s).attr("height",o),e.props){const h=new Set(Object.keys(e.props));e.props.borders&&(VS(a,e.props.borders,s,o),h.delete("borders")),h.forEach(d=>{ae.warn(`Unknown node property ${d}`)})}return oi(e,a),e.intersect=function(h){return Yn.rect(e,h)},r},"composite"),D0t=x(async(t,e)=>{const{shapeSvg:r}=await sa(t,e,"label",!0);ae.trace("Classes = ",e.class);const n=r.insert("rect",":first-child"),i=0,a=0;if(n.attr("width",i).attr("height",a),r.attr("class","label edgeLabel"),e.props){const s=new Set(Object.keys(e.props));e.props.borders&&(VS(n,e.props.borders,i,a),s.delete("borders")),s.forEach(o=>{ae.warn(`Unknown node property ${o}`)})}return oi(e,n),e.intersect=function(s){return Yn.rect(e,s)},r},"labelRect");function VS(t,e,r,n){const i=[],a=x(o=>{i.push(o,0)},"addBorder"),s=x(o=>{i.push(0,o)},"skipBorder");e.includes("t")?(ae.debug("add top border"),a(r)):s(r),e.includes("r")?(ae.debug("add right border"),a(n)):s(n),e.includes("b")?(ae.debug("add bottom border"),a(r)):s(r),e.includes("l")?(ae.debug("add left border"),a(n)):s(n),t.attr("stroke-dasharray",i.join(" "))}x(VS,"applyNodePropertyBorders");var M0t=x(async(t,e)=>{let r;e.classes?r="node "+e.classes:r="node default";const n=t.insert("g").attr("class",r).attr("id",e.domId||e.id),i=n.insert("rect",":first-child"),a=n.insert("line"),s=n.insert("g").attr("class","label"),o=e.labelText.flat?e.labelText.flat():e.labelText;let l="";typeof o=="object"?l=o[0]:l=o,ae.info("Label text abc79",l,o,typeof o=="object");const u=await rl(s,l,e.labelStyle,!0,!0);let h={width:0,height:0};if(on(Pe())){const m=u.children[0],y=pt(u);h=m.getBoundingClientRect(),y.attr("width",h.width),y.attr("height",h.height)}ae.info("Text 2",o);const d=o.slice(1,o.length);let f=u.getBBox();const p=await rl(s,d.join?d.join("
    "):d,e.labelStyle,!0,!0);if(on(Pe())){const m=p.children[0],y=pt(p);h=m.getBoundingClientRect(),y.attr("width",h.width),y.attr("height",h.height)}const g=e.padding/2;return pt(p).attr("transform","translate( "+(h.width>f.width?0:(f.width-h.width)/2)+", "+(f.height+g+5)+")"),pt(u).attr("transform","translate( "+(h.width{const{shapeSvg:r,bbox:n}=await sa(t,e,ro(e,void 0),!0),i=n.height+e.padding,a=n.width+i/4+e.padding,s=r.insert("rect",":first-child").attr("style",e.style).attr("rx",i/2).attr("ry",i/2).attr("x",-a/2).attr("y",-i/2).attr("width",a).attr("height",i);return oi(e,s),e.intersect=function(o){return Yn.rect(e,o)},r},"stadium"),O0t=x(async(t,e)=>{const{shapeSvg:r,bbox:n,halfPadding:i}=await sa(t,e,ro(e,void 0),!0),a=r.insert("circle",":first-child");return a.attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("r",n.width/2+i).attr("width",n.width+e.padding).attr("height",n.height+e.padding),ae.info("Circle main"),oi(e,a),e.intersect=function(s){return ae.info("Circle intersect",e,n.width/2+i,s),Yn.circle(e,n.width/2+i,s)},r},"circle"),$0t=x(async(t,e)=>{const{shapeSvg:r,bbox:n,halfPadding:i}=await sa(t,e,ro(e,void 0),!0),a=5,s=r.insert("g",":first-child"),o=s.insert("circle"),l=s.insert("circle");return s.attr("class",e.class),o.attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("r",n.width/2+i+a).attr("width",n.width+e.padding+a*2).attr("height",n.height+e.padding+a*2),l.attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("r",n.width/2+i).attr("width",n.width+e.padding).attr("height",n.height+e.padding),ae.info("DoubleCircle main"),oi(e,o),e.intersect=function(u){return ae.info("DoubleCircle intersect",e,n.width/2+i+a,u),Yn.circle(e,n.width/2+i+a,u)},r},"doublecircle"),P0t=x(async(t,e)=>{const{shapeSvg:r,bbox:n}=await sa(t,e,ro(e,void 0),!0),i=n.width+e.padding,a=n.height+e.padding,s=[{x:0,y:0},{x:i,y:0},{x:i,y:-a},{x:0,y:-a},{x:0,y:0},{x:-8,y:0},{x:i+8,y:0},{x:i+8,y:-a},{x:-8,y:-a},{x:-8,y:0}],o=nl(r,i,a,s);return o.attr("style",e.style),oi(e,o),e.intersect=function(l){return Yn.polygon(e,s,l)},r},"subroutine"),B0t=x((t,e)=>{const r=t.insert("g").attr("class","node default").attr("id",e.domId||e.id),n=r.insert("circle",":first-child");return n.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),oi(e,n),e.intersect=function(i){return Yn.circle(e,7,i)},r},"start"),iye=x((t,e,r)=>{const n=t.insert("g").attr("class","node default").attr("id",e.domId||e.id);let i=70,a=10;r==="LR"&&(i=10,a=70);const s=n.append("rect").attr("x",-1*i/2).attr("y",-1*a/2).attr("width",i).attr("height",a).attr("class","fork-join");return oi(e,s),e.height=e.height+e.padding/2,e.width=e.width+e.padding/2,e.intersect=function(o){return Yn.rect(e,o)},n},"forkJoin"),F0t=x((t,e)=>{const r=t.insert("g").attr("class","node default").attr("id",e.domId||e.id),n=r.insert("circle",":first-child"),i=r.insert("circle",":first-child");return i.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),n.attr("class","state-end").attr("r",5).attr("width",10).attr("height",10),oi(e,i),e.intersect=function(a){return Yn.circle(e,7,a)},r},"end"),z0t=x(async(t,e)=>{var _;const r=e.padding/2,n=4,i=8;let a;e.classes?a="node "+e.classes:a="node default";const s=t.insert("g").attr("class",a).attr("id",e.domId||e.id),o=s.insert("rect",":first-child"),l=s.insert("line"),u=s.insert("line");let h=0,d=n;const f=s.insert("g").attr("class","label");let p=0;const g=(_=e.classData.annotations)==null?void 0:_[0],m=e.classData.annotations[0]?"«"+e.classData.annotations[0]+"»":"",y=await rl(f,m,e.labelStyle,!0,!0);let v=y.getBBox();if(on(Pe())){const L=y.children[0],O=pt(y);v=L.getBoundingClientRect(),O.attr("width",v.width),O.attr("height",v.height)}e.classData.annotations[0]&&(d+=v.height+n,h+=v.width);let T=e.classData.label;e.classData.type!==void 0&&e.classData.type!==""&&(on(Pe())?T+="<"+e.classData.type+">":T+="<"+e.classData.type+">");const b=await rl(f,T,e.labelStyle,!0,!0);pt(b).attr("class","classTitle");let w=b.getBBox();if(on(Pe())){const L=b.children[0],O=pt(b);w=L.getBoundingClientRect(),O.attr("width",w.width),O.attr("height",w.height)}d+=w.height+n,w.width>h&&(h=w.width);const k=[];e.classData.members.forEach(async L=>{const O=L.getDisplayDetails();let M=O.displayText;on(Pe())&&(M=M.replace(//g,">"));const z=await rl(f,M,O.cssStyle?O.cssStyle:e.labelStyle,!0,!0);let F=z.getBBox();if(on(Pe())){const S=z.children[0],R=pt(z);F=S.getBoundingClientRect(),R.attr("width",F.width),R.attr("height",F.height)}F.width>h&&(h=F.width),d+=F.height+n,k.push(z)}),d+=i;const A=[];if(e.classData.methods.forEach(async L=>{const O=L.getDisplayDetails();let M=O.displayText;on(Pe())&&(M=M.replace(//g,">"));const z=await rl(f,M,O.cssStyle?O.cssStyle:e.labelStyle,!0,!0);let F=z.getBBox();if(on(Pe())){const S=z.children[0],R=pt(z);F=S.getBoundingClientRect(),R.attr("width",F.width),R.attr("height",F.height)}F.width>h&&(h=F.width),d+=F.height+n,A.push(z)}),d+=i,g){let L=(h-v.width)/2;pt(y).attr("transform","translate( "+(-1*h/2+L)+", "+-1*d/2+")"),p=v.height+n}let C=(h-w.width)/2;return pt(b).attr("transform","translate( "+(-1*h/2+C)+", "+(-1*d/2+p)+")"),p+=w.height+n,l.attr("class","divider").attr("x1",-h/2-r).attr("x2",h/2+r).attr("y1",-d/2-r+i+p).attr("y2",-d/2-r+i+p),p+=i,k.forEach(L=>{pt(L).attr("transform","translate( "+-h/2+", "+(-1*d/2+p+i/2)+")");const O=L==null?void 0:L.getBBox();p+=((O==null?void 0:O.height)??0)+n}),p+=i,u.attr("class","divider").attr("x1",-h/2-r).attr("x2",h/2+r).attr("y1",-d/2-r+i+p).attr("y2",-d/2-r+i+p),p+=i,A.forEach(L=>{pt(L).attr("transform","translate( "+-h/2+", "+(-1*d/2+p)+")");const O=L==null?void 0:L.getBBox();p+=((O==null?void 0:O.height)??0)+n}),o.attr("style",e.style).attr("class","outer title-state").attr("x",-h/2-r).attr("y",-(d/2)-r).attr("width",h+e.padding).attr("height",d+e.padding),oi(e,o),e.intersect=function(L){return Yn.rect(e,L)},s},"class_box"),aye={rhombus:nye,composite:I0t,question:nye,rect:L0t,labelRect:D0t,rectWithTitle:M0t,choice:x0t,circle:O0t,doublecircle:$0t,stadium:N0t,hexagon:T0t,block_arrow:w0t,rect_left_inv_arrow:C0t,lean_right:k0t,lean_left:E0t,trapezoid:S0t,inv_trapezoid:A0t,rect_right_inv_arrow:_0t,cylinder:R0t,start:B0t,end:F0t,note:b0t,subroutine:P0t,fork:iye,join:iye,class_box:z0t},WS={},sye=x(async(t,e,r)=>{let n,i;if(e.link){let a;Pe().securityLevel==="sandbox"?a="_top":e.linkTarget&&(a=e.linkTarget||"_blank"),n=t.insert("svg:a").attr("xlink:href",e.link).attr("target",a),i=await aye[e.shape](n,e,r)}else i=await aye[e.shape](t,e,r),n=i;return e.tooltip&&i.attr("title",e.tooltip),e.class&&i.attr("class","node default "+e.class),WS[e.id]=n,e.haveCallback&&WS[e.id].attr("class",WS[e.id].attr("class")+" clickable"),n},"insertNode"),G0t=x(t=>{const e=WS[t.id];ae.trace("Transforming node",t.diff,t,"translate("+(t.x-t.width/2-5)+", "+t.width/2+")");const r=8,n=t.diff||0;return t.clusterNode?e.attr("transform","translate("+(t.x+n-t.width/2)+", "+(t.y-t.height/2-r)+")"):e.attr("transform","translate("+t.x+", "+t.y+")"),n},"positionNode");function dP(t,e,r=!1){var p,g,m;const n=t;let i="default";(((p=n==null?void 0:n.classes)==null?void 0:p.length)||0)>0&&(i=((n==null?void 0:n.classes)??[]).join(" ")),i=i+" flowchart-label";let a=0,s="",o;switch(n.type){case"round":a=5,s="rect";break;case"composite":a=0,s="composite",o=0;break;case"square":s="rect";break;case"diamond":s="question";break;case"hexagon":s="hexagon";break;case"block_arrow":s="block_arrow";break;case"odd":s="rect_left_inv_arrow";break;case"lean_right":s="lean_right";break;case"lean_left":s="lean_left";break;case"trapezoid":s="trapezoid";break;case"inv_trapezoid":s="inv_trapezoid";break;case"rect_left_inv_arrow":s="rect_left_inv_arrow";break;case"circle":s="circle";break;case"ellipse":s="ellipse";break;case"stadium":s="stadium";break;case"subroutine":s="subroutine";break;case"cylinder":s="cylinder";break;case"group":s="rect";break;case"doublecircle":s="doublecircle";break;default:s="rect"}const l=d_((n==null?void 0:n.styles)??[]),u=n.label,h=n.size??{width:0,height:0,x:0,y:0},d=e.getDiagramId();return{labelStyle:l.labelStyle,shape:s,labelText:u,rx:a,ry:a,class:i,style:l.style,id:n.id,domId:d?`${d}-${n.id}`:n.id,directions:n.directions,width:h.width,height:h.height,x:h.x,y:h.y,positioned:r,intersect:void 0,type:n.type,padding:o??((m=(g=lr())==null?void 0:g.block)==null?void 0:m.padding)??0,widthInColumns:n.widthInColumns??1}}x(dP,"getNodeFromBlock");async function oye(t,e,r){const n=dP(e,r,!1);if(n.type==="group")return;const i=lr(),a=await sye(t,n,{config:i}),s=a.node().getBBox(),o=r.getBlock(n.id);o.size={width:s.width,height:s.height,x:0,y:0,node:a},r.setBlock(o),a.remove()}x(oye,"calculateBlockSize");async function lye(t,e,r){const n=dP(e,r,!0);if(r.getBlock(n.id).type!=="space"){const a=lr();await sye(t,n,{config:a}),e.intersect=n==null?void 0:n.intersect,G0t(n)}}x(lye,"insertBlockPositioned");async function US(t,e,r,n){for(const i of e)await n(t,i,r),i.children&&await US(t,i.children,r,n)}x(US,"performOperations");async function cye(t,e,r){await US(t,e,r,oye)}x(cye,"calculateBlockSizes");async function uye(t,e,r){await US(t,e,r,lye)}x(uye,"insertBlocks");async function hye(t,e,r,n,i){const a=new Ts({multigraph:!0,compound:!0});a.setGraph({rankdir:"TB",nodesep:10,ranksep:10,marginx:8,marginy:8});for(const s of r)s.size&&a.setNode(s.id,{width:s.size.width,height:s.size.height,intersect:s.intersect});for(const s of e)if(s.start&&s.end){const o=n.getBlock(s.start),l=n.getBlock(s.end);if(o!=null&&o.size&&(l!=null&&l.size)){const u=o.size,h=l.size,d=[{x:u.x,y:u.y},{x:u.x+(h.x-u.x)/2,y:u.y+(h.y-u.y)/2},{x:h.x,y:h.y}],f=i?`${i}-${s.id}`:s.id,p=s.thickness==="thick"?"edge-thickness-thick":"edge-thickness-normal",g=s.pattern==="dotted"?"edge-pattern-dotted":"edge-pattern-solid",m=`${p} ${g} flowchart-link LS-a1 LE-b1`;c0t(t,{v:s.start,w:s.end,name:f},{...s,id:f,arrowTypeEnd:s.arrowTypeEnd,arrowTypeStart:s.arrowTypeStart,points:d,classes:m},void 0,"block",a,i),s.label&&(await a0t(t,{...s,label:s.label,labelStyle:"stroke: #333; stroke-width: 1.5px;fill:none;",arrowTypeEnd:s.arrowTypeEnd,arrowTypeStart:s.arrowTypeStart,points:d,classes:m}),s0t({...s,x:d[1].x,y:d[1].y},{originalPath:d}))}}}x(hye,"insertEdges");var q0t=x(function(t,e){return e.db.getClasses()},"getClasses"),V0t=x(async function(t,e,r,n){const{securityLevel:i,block:a}=lr(),s=n.db;s.setDiagramId(e);let o;i==="sandbox"&&(o=pt("#i"+e));const l=pt(i==="sandbox"?o.nodes()[0].contentDocument.body:"body"),u=i==="sandbox"?l.select(`[id="${e}"]`):pt(`[id="${e}"]`);e0t(u,["point","circle","cross"],n.type,e);const d=s.getBlocks(),f=s.getBlocksFlat(),p=s.getEdges(),g=u.insert("g").attr("class","block");await cye(g,d,s);const m=Y1e(s);if(await uye(g,d,s),await hye(g,p,f,s,e),m){const y=m,v=Math.max(1,Math.round(.125*(y.width/y.height))),T=y.height+v+10,b=y.width+10,{useMaxWidth:w}=a;wi(u,T,b,!!w),ae.debug("Here Bounds",m,y),u.attr("viewBox",`${y.x-5} ${y.y-5} ${y.width+10} ${y.height+10}`)}},"draw"),W0t={draw:V0t,getClasses:q0t},U0t={parser:bft,db:zft,renderer:W0t,styles:qft};const H0t=Object.freeze(Object.defineProperty({__proto__:null,diagram:U0t},Symbol.toStringTag,{value:"Module"}));var sc=new wI(()=>({cnt:1,stack:[{id:0,level:-1,name:"/",children:[]}]})),Y0t=x(()=>{sc.reset(),In()},"clear"),X0t=x(()=>sc.records.stack[0],"getRoot"),K0t=x(()=>sc.records.cnt,"getCount"),j0t=Fr.treeView,Z0t=x(()=>ti(j0t,lr().treeView),"getConfig"),Q0t=x((t,e)=>{for(;t<=sc.records.stack[sc.records.stack.length-1].level;)sc.records.stack.pop();const r={id:sc.records.cnt++,level:t,name:e,children:[]};sc.records.stack[sc.records.stack.length-1].children.push(r),sc.records.stack.push(r)},"addNode"),J0t={clear:Y0t,addNode:Q0t,getRoot:X0t,getCount:K0t,getConfig:Z0t,getAccTitle:Fn,getAccDescription:Gn,getDiagramTitle:Mn,setAccDescription:zn,setAccTitle:Dn,setDiagramTitle:qn},fP=J0t,ept=x(t=>{zl(t,fP),t.nodes.map(e=>fP.addNode(e.indent?parseInt(e.indent):0,e.name))},"populate"),tpt={parse:x(async t=>{const e=await Qo("treeView",t);ae.debug(e),ept(e)},"parse")},rpt=x((t,e,r,n,i)=>{const a=n.append("text").text(r.name).attr("dominant-baseline","middle").attr("class","treeView-node-label"),{height:s,width:o}=a.node().getBBox(),l=s+i.paddingY*2,u=o+i.paddingX*2;a.attr("x",t+i.paddingX),a.attr("y",e+l/2),r.BBox={x:t,y:e,width:u,height:l}},"positionLabel"),dye=x((t,e,r,n,i,a)=>t.append("line").attr("x1",e).attr("y1",r).attr("x2",n).attr("y2",i).attr("stroke-width",a).attr("class","treeView-node-line"),"positionLine"),npt=x((t,e,r)=>{let n=0,i=0;const a=x((o,l,u,h)=>{const d=h*(u.rowIndent+u.paddingX);rpt(d,n,l,o,u);const{height:f,width:p}=l.BBox;dye(o,d-u.rowIndent,n+f/2,d,n+f/2,u.lineThickness),i=Math.max(i,d+p),n+=f},"drawNode"),s=x((o,l=0)=>{a(t,o,r,l),o.children.forEach(f=>{s(f,l+1)});const{x:u,y:h,height:d}=o.BBox;if(o.children.length){const{y:f,height:p}=o.children[o.children.length-1].BBox;dye(t,u+r.paddingX,h+d,u+r.paddingX,f+p/2+r.lineThickness/2,r.lineThickness)}},"processNode");return s(e),{totalHeight:n,totalWidth:i}},"drawTree"),ipt=x((t,e,r,n)=>{ae.debug(`Rendering treeView diagram -`+t);const i=n.db,a=i.getRoot(),s=i.getConfig(),o=ys(e),l=o.append("g");l.attr("class","tree-view");const{totalHeight:u,totalWidth:h}=npt(l,a,s);o.attr("viewBox",`-${s.lineThickness/2} 0 ${h} ${u}`),wi(o,u,h,s.useMaxWidth)},"draw"),apt={draw:ipt},spt=apt,opt={labelFontSize:"16px",labelColor:"black",lineColor:"black"},lpt=x(({treeView:t})=>{const{labelFontSize:e,labelColor:r,lineColor:n}=ti(opt,t);return` + node : x:${t.x} y:${t.y} w:${t.width} h:${t.height}`);const n=t.x,i=t.y,a=Math.abs(n-r.x),s=t.width/2;let o=r.xMath.abs(n-e.x)*l){let d=r.y{se.debug("abc88 cutPathAtIntersect",t,e);let r=[],n=t[0],i=!1;return t.forEach(a=>{if(!Yxt(e,a)&&!i){const s=Xxt(e,n,a);let o=!1;r.forEach(l=>{o=o||l.x===s.x&&l.y===s.y}),r.some(l=>l.x===s.x&&l.y===s.y)||r.push(s),i=!0}else n=a,i||r.push(a)}),r},"cutPathAtIntersect"),jxt=T(function(t,e,r,n,i,a,s){let o=r.points;se.debug("abc88 InsertEdge: edge=",r,"e=",e);let l=!1;const u=a.node(e.v);var h=a.node(e.w);h!=null&&h.intersect&&(u!=null&&u.intersect)&&(o=o.slice(1,r.points.length-1),o.unshift(u.intersect(o[0])),o.push(h.intersect(o[o.length-1]))),r.toCluster&&(se.debug("to cluster abc88",n[r.toCluster]),o=dCe(r.points,n[r.toCluster].node),l=!0),r.fromCluster&&(se.debug("from cluster abc88",n[r.fromCluster]),o=dCe(o.reverse(),n[r.fromCluster].node).reverse(),l=!0);const d=o.filter(w=>!Number.isNaN(w.y));let f=fx;r.curve&&(i==="graph"||i==="flowchart")&&(f=r.curve);const{x:p,y:g}=rY(r),m=dx().x(p).y(g).curve(f);let y;switch(r.thickness){case"normal":y="edge-thickness-normal";break;case"thick":y="edge-thickness-thick";break;case"invisible":y="edge-thickness-thick";break;default:y=""}switch(r.pattern){case"solid":y+=" edge-pattern-solid";break;case"dotted":y+=" edge-pattern-dotted";break;case"dashed":y+=" edge-pattern-dashed";break}const v=t.append("path").attr("d",m(d)).attr("id",r.id).attr("class"," "+y+(r.classes?" "+r.classes:"")).attr("style",r.style);let x="";(Pe().flowchart.arrowMarkerAbsolute||Pe().state.arrowMarkerAbsolute)&&(x=N4(!0)),Vxt(v,r,x,s,i);let b={};return l&&(b.updatedPath=o),b.originalPath=r.points,b},"insertEdge"),Kxt=T(t=>{const e=new Set;for(const r of t)switch(r){case"x":e.add("right"),e.add("left");break;case"y":e.add("up"),e.add("down");break;default:e.add(r);break}return e},"expandAndDeduplicateDirections"),Zxt=T((t,e,r,n)=>{const i=Kxt(t),a=2,s=e.height+2*r.padding,o=s/a,l=n??e.width+2*o+r.padding,u=r.padding/2;return i.has("right")&&i.has("left")&&i.has("up")&&i.has("down")?[{x:0,y:0},{x:o,y:0},{x:l/2,y:2*u},{x:l-o,y:0},{x:l,y:0},{x:l,y:-s/3},{x:l+2*u,y:-s/2},{x:l,y:-2*s/3},{x:l,y:-s},{x:l-o,y:-s},{x:l/2,y:-s-2*u},{x:o,y:-s},{x:0,y:-s},{x:0,y:-2*s/3},{x:-2*u,y:-s/2},{x:0,y:-s/3}]:i.has("right")&&i.has("left")&&i.has("up")?[{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}]:i.has("right")&&i.has("left")&&i.has("down")?[{x:0,y:0},{x:o,y:-s},{x:l-o,y:-s},{x:l,y:0}]:i.has("right")&&i.has("up")&&i.has("down")?[{x:0,y:0},{x:l,y:-o},{x:l,y:-s+o},{x:0,y:-s}]:i.has("left")&&i.has("up")&&i.has("down")?[{x:l,y:0},{x:0,y:-o},{x:0,y:-s+o},{x:l,y:-s}]:i.has("right")&&i.has("left")?[{x:o,y:0},{x:o,y:-u},{x:l-o,y:-u},{x:l-o,y:0},{x:l,y:-s/2},{x:l-o,y:-s},{x:l-o,y:-s+u},{x:o,y:-s+u},{x:o,y:-s},{x:0,y:-s/2}]:i.has("up")&&i.has("down")?[{x:l/2,y:0},{x:0,y:-u},{x:o,y:-u},{x:o,y:-s+u},{x:0,y:-s+u},{x:l/2,y:-s},{x:l,y:-s+u},{x:l-o,y:-s+u},{x:l-o,y:-u},{x:l,y:-u}]:i.has("right")&&i.has("up")?[{x:0,y:0},{x:l,y:-o},{x:0,y:-s}]:i.has("right")&&i.has("down")?[{x:0,y:0},{x:l,y:0},{x:0,y:-s}]:i.has("left")&&i.has("up")?[{x:l,y:0},{x:0,y:-o},{x:l,y:-s}]:i.has("left")&&i.has("down")?[{x:l,y:0},{x:0,y:0},{x:l,y:-s}]:i.has("right")?[{x:o,y:-u},{x:o,y:-u},{x:l-o,y:-u},{x:l-o,y:0},{x:l,y:-s/2},{x:l-o,y:-s},{x:l-o,y:-s+u},{x:o,y:-s+u},{x:o,y:-s+u}]:i.has("left")?[{x:o,y:0},{x:o,y:-u},{x:l-o,y:-u},{x:l-o,y:-s+u},{x:o,y:-s+u},{x:o,y:-s},{x:0,y:-s/2}]:i.has("up")?[{x:o,y:-u},{x:o,y:-s+u},{x:0,y:-s+u},{x:l/2,y:-s},{x:l,y:-s+u},{x:l-o,y:-s+u},{x:l-o,y:-u}]:i.has("down")?[{x:l/2,y:0},{x:0,y:-u},{x:o,y:-u},{x:o,y:-s+u},{x:l-o,y:-s+u},{x:l-o,y:-u},{x:l,y:-u}]:[{x:0,y:0}]},"getArrowPoints");function fCe(t,e){return t.intersect(e)}T(fCe,"intersectNode");var Qxt=fCe;function pCe(t,e,r,n){var i=t.x,a=t.y,s=i-n.x,o=a-n.y,l=Math.sqrt(e*e*o*o+r*r*s*s),u=Math.abs(e*r*s/l);n.x0}T(zG,"sameSign");var eTt=yCe,tTt=vCe;function vCe(t,e,r){var n=t.x,i=t.y,a=[],s=Number.POSITIVE_INFINITY,o=Number.POSITIVE_INFINITY;typeof e.forEach=="function"?e.forEach(function(g){s=Math.min(s,g.x),o=Math.min(o,g.y)}):(s=Math.min(s,e.x),o=Math.min(o,e.y));for(var l=n-t.width/2-s,u=i-t.height/2-o,h=0;h1&&a.sort(function(g,m){var y=g.x-r.x,v=g.y-r.y,x=Math.sqrt(y*y+v*v),b=m.x-r.x,w=m.y-r.y,C=Math.sqrt(b*b+w*w);return x{var r=t.x,n=t.y,i=e.x-r,a=e.y-n,s=t.width/2,o=t.height/2,l,u;return Math.abs(a)*s>Math.abs(i)*o?(a<0&&(o=-o),l=a===0?0:o*i/a,u=o):(i<0&&(s=-s),l=s,u=i===0?0:s*a/i),{x:r+l,y:n+u}},"intersectRect"),nTt=rTt,pi={node:Qxt,circle:Jxt,ellipse:gCe,polygon:tTt,rect:nTt},Ra=T(async(t,e,r,n)=>{const i=Pe();let a;const s=e.useHtmlLabels||mn(i);r?a=r:a="node default";const o=t.insert("g").attr("class",a).attr("id",e.domId||e.id),l=o.insert("g").attr("class","label").attr("style",e.labelStyle);let u;e.labelText===void 0?u="":u=typeof e.labelText=="string"?e.labelText:e.labelText[0];let h;e.labelType==="markdown"?h=ys(l,Zr(uu(u),i),{useHtmlLabels:s,width:e.width||i.flowchart.wrappingWidth,classes:"markdown-node-label"},i):h=await ql(l,Zr(uu(u),i),e.labelStyle,!1,n);let d=h.getBBox();const f=e.padding/2;if(mn(i)){const p=h.children[0],g=gt(h);await f8(p,u),d=p.getBoundingClientRect(),g.attr("width",d.width),g.attr("height",d.height)}return s?l.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"):l.attr("transform","translate(0, "+-d.height/2+")"),e.centerLabel&&l.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"),l.insert("rect",":first-child"),{shapeSvg:o,bbox:d,halfPadding:f,label:l}},"labelHelper"),Ai=T((t,e)=>{const r=e.node().getBBox();t.width=r.width,t.height=r.height},"updateNodeBounds");function Vl(t,e,r,n){return t.insert("polygon",":first-child").attr("points",n.map(function(i){return i.x+","+i.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-e/2+","+r/2+")")}T(Vl,"insertPolygonShape");var iTt=T(async(t,e)=>{e.useHtmlLabels||mn(Pe())||(e.centerLabel=!0);const{shapeSvg:n,bbox:i,halfPadding:a}=await Ra(t,e,"node "+e.classes,!0);se.info("Classes = ",e.classes);const s=n.insert("rect",":first-child");return s.attr("rx",e.rx).attr("ry",e.ry).attr("x",-i.width/2-a).attr("y",-i.height/2-a).attr("width",i.width+e.padding).attr("height",i.height+e.padding),Ai(e,s),e.intersect=function(o){return pi.rect(e,o)},n},"note"),aTt=iTt,bCe=T(t=>t?" "+t:"","formatClass"),Bo=T((t,e)=>`${e||"node default"}${bCe(t.classes)} ${bCe(t.class)}`,"getClassesFromNode"),xCe=T(async(t,e)=>{const{shapeSvg:r,bbox:n}=await Ra(t,e,Bo(e,void 0),!0),i=n.width+e.padding,a=n.height+e.padding,s=i+a,o=[{x:s/2,y:0},{x:s,y:-s/2},{x:s/2,y:-s},{x:0,y:-s/2}];se.info("Question main (Circle)");const l=Vl(r,s,s,o);return l.attr("style",e.style),Ai(e,l),e.intersect=function(u){return se.warn("Intersect called"),pi.polygon(e,o,u)},r},"question"),sTt=T((t,e)=>{const r=t.insert("g").attr("class","node default").attr("id",e.domId||e.id),n=28,i=[{x:0,y:n/2},{x:n/2,y:0},{x:0,y:-n/2},{x:-n/2,y:0}];return r.insert("polygon",":first-child").attr("points",i.map(function(s){return s.x+","+s.y}).join(" ")).attr("class","state-start").attr("r",7).attr("width",28).attr("height",28),e.width=28,e.height=28,e.intersect=function(s){return pi.circle(e,14,s)},r},"choice"),oTt=T(async(t,e)=>{const{shapeSvg:r,bbox:n}=await Ra(t,e,Bo(e,void 0),!0),i=4,a=e.positioned?e.height:n.height+e.padding,s=a/i,o=e.positioned?e.width:n.width+2*s+e.padding,l=[{x:s,y:0},{x:o-s,y:0},{x:o,y:-a/2},{x:o-s,y:-a},{x:s,y:-a},{x:0,y:-a/2}],u=Vl(r,o,a,l);return u.attr("style",e.style),Ai(e,u),e.intersect=function(h){return pi.polygon(e,l,h)},r},"hexagon"),lTt=T(async(t,e)=>{const{shapeSvg:r,bbox:n}=await Ra(t,e,void 0,!0),i=2,a=n.height+2*e.padding,s=a/i,o=n.width+2*s+e.padding,u=e.positioned&&(e.widthInColumns??1)>1&&e.width>o?e.width:o,h=Zxt(e.directions,n,e,u),d=Vl(r,u,a,h);return d.attr("style",e.style),Ai(e,d),e.intersect=function(f){return pi.polygon(e,h,f)},r},"block_arrow"),cTt=T(async(t,e)=>{const{shapeSvg:r,bbox:n}=await Ra(t,e,Bo(e,void 0),!0),i=n.width+e.padding,a=n.height+e.padding,s=[{x:-a/2,y:0},{x:i,y:0},{x:i,y:-a},{x:-a/2,y:-a},{x:0,y:-a/2}];return Vl(r,i,a,s).attr("style",e.style),e.width=i+a,e.height=a,e.intersect=function(l){return pi.polygon(e,s,l)},r},"rect_left_inv_arrow"),uTt=T(async(t,e)=>{const{shapeSvg:r,bbox:n}=await Ra(t,e,Bo(e),!0),i=n.width+e.padding,a=n.height+e.padding,s=[{x:-2*a/6,y:0},{x:i-a/6,y:0},{x:i+2*a/6,y:-a},{x:a/6,y:-a}],o=Vl(r,i,a,s);return o.attr("style",e.style),Ai(e,o),e.intersect=function(l){return pi.polygon(e,s,l)},r},"lean_right"),hTt=T(async(t,e)=>{const{shapeSvg:r,bbox:n}=await Ra(t,e,Bo(e,void 0),!0),i=n.width+e.padding,a=n.height+e.padding,s=[{x:2*a/6,y:0},{x:i+a/6,y:0},{x:i-2*a/6,y:-a},{x:-a/6,y:-a}],o=Vl(r,i,a,s);return o.attr("style",e.style),Ai(e,o),e.intersect=function(l){return pi.polygon(e,s,l)},r},"lean_left"),dTt=T(async(t,e)=>{const{shapeSvg:r,bbox:n}=await Ra(t,e,Bo(e,void 0),!0),i=n.width+e.padding,a=n.height+e.padding,s=[{x:-2*a/6,y:0},{x:i+2*a/6,y:0},{x:i-a/6,y:-a},{x:a/6,y:-a}],o=Vl(r,i,a,s);return o.attr("style",e.style),Ai(e,o),e.intersect=function(l){return pi.polygon(e,s,l)},r},"trapezoid"),fTt=T(async(t,e)=>{const{shapeSvg:r,bbox:n}=await Ra(t,e,Bo(e,void 0),!0),i=n.width+e.padding,a=n.height+e.padding,s=[{x:a/6,y:0},{x:i-a/6,y:0},{x:i+2*a/6,y:-a},{x:-2*a/6,y:-a}],o=Vl(r,i,a,s);return o.attr("style",e.style),Ai(e,o),e.intersect=function(l){return pi.polygon(e,s,l)},r},"inv_trapezoid"),pTt=T(async(t,e)=>{const{shapeSvg:r,bbox:n}=await Ra(t,e,Bo(e,void 0),!0),i=n.width+e.padding,a=n.height+e.padding,s=[{x:0,y:0},{x:i+a/2,y:0},{x:i,y:-a/2},{x:i+a/2,y:-a},{x:0,y:-a}],o=Vl(r,i,a,s);return o.attr("style",e.style),Ai(e,o),e.intersect=function(l){return pi.polygon(e,s,l)},r},"rect_right_inv_arrow"),gTt=T(async(t,e)=>{const{shapeSvg:r,bbox:n}=await Ra(t,e,Bo(e,void 0),!0),i=n.width+e.padding,a=i/2,s=a/(2.5+i/50),o=n.height+s+e.padding,l="M 0,"+s+" a "+a+","+s+" 0,0,0 "+i+" 0 a "+a+","+s+" 0,0,0 "+-i+" 0 l 0,"+o+" a "+a+","+s+" 0,0,0 "+i+" 0 l 0,"+-o,u=r.attr("label-offset-y",s).insert("path",":first-child").attr("style",e.style).attr("d",l).attr("transform","translate("+-i/2+","+-(o/2+s)+")");return Ai(e,u),e.intersect=function(h){const d=pi.rect(e,h),f=d.x-e.x;if(a!=0&&(Math.abs(f)e.height/2-s)){let p=s*s*(1-f*f/(a*a));p!=0&&(p=Math.sqrt(p)),p=s-p,h.y-e.y>0&&(p=-p),d.y+=p}return d},r},"cylinder"),mTt=T(async(t,e)=>{const{shapeSvg:r,bbox:n,halfPadding:i}=await Ra(t,e,"node "+e.classes+" "+e.class,!0),a=r.insert("rect",":first-child"),s=e.positioned?e.width:n.width+e.padding,o=e.positioned?e.height:n.height+e.padding,l=e.positioned?-s/2:-n.width/2-i,u=e.positioned?-o/2:-n.height/2-i;if(a.attr("class","basic label-container").attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("x",l).attr("y",u).attr("width",s).attr("height",o),e.props){const h=new Set(Object.keys(e.props));e.props.borders&&(qA(a,e.props.borders,s,o),h.delete("borders")),h.forEach(d=>{se.warn(`Unknown node property ${d}`)})}return Ai(e,a),e.intersect=function(h){return pi.rect(e,h)},r},"rect"),yTt=T(async(t,e)=>{const{shapeSvg:r,bbox:n,halfPadding:i}=await Ra(t,e,"node "+e.classes,!0),a=r.insert("rect",":first-child"),s=e.positioned?e.width:n.width+e.padding,o=e.positioned?e.height:n.height+e.padding,l=e.positioned?-s/2:-n.width/2-i,u=e.positioned?-o/2:-n.height/2-i;if(a.attr("class","basic cluster composite label-container").attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("x",l).attr("y",u).attr("width",s).attr("height",o),e.props){const h=new Set(Object.keys(e.props));e.props.borders&&(qA(a,e.props.borders,s,o),h.delete("borders")),h.forEach(d=>{se.warn(`Unknown node property ${d}`)})}return Ai(e,a),e.intersect=function(h){return pi.rect(e,h)},r},"composite"),vTt=T(async(t,e)=>{const{shapeSvg:r}=await Ra(t,e,"label",!0);se.trace("Classes = ",e.class);const n=r.insert("rect",":first-child"),i=0,a=0;if(n.attr("width",i).attr("height",a),r.attr("class","label edgeLabel"),e.props){const s=new Set(Object.keys(e.props));e.props.borders&&(qA(n,e.props.borders,i,a),s.delete("borders")),s.forEach(o=>{se.warn(`Unknown node property ${o}`)})}return Ai(e,n),e.intersect=function(s){return pi.rect(e,s)},r},"labelRect");function qA(t,e,r,n){const i=[],a=T(o=>{i.push(o,0)},"addBorder"),s=T(o=>{i.push(0,o)},"skipBorder");e.includes("t")?(se.debug("add top border"),a(r)):s(r),e.includes("r")?(se.debug("add right border"),a(n)):s(n),e.includes("b")?(se.debug("add bottom border"),a(r)):s(r),e.includes("l")?(se.debug("add left border"),a(n)):s(n),t.attr("stroke-dasharray",i.join(" "))}T(qA,"applyNodePropertyBorders");var bTt=T(async(t,e)=>{let r;e.classes?r="node "+e.classes:r="node default";const n=t.insert("g").attr("class",r).attr("id",e.domId||e.id),i=n.insert("rect",":first-child"),a=n.insert("line"),s=n.insert("g").attr("class","label"),o=e.labelText.flat?e.labelText.flat():e.labelText;let l="";typeof o=="object"?l=o[0]:l=o,se.info("Label text abc79",l,o,typeof o=="object");const u=await ql(s,l,e.labelStyle,!0,!0);let h={width:0,height:0};if(mn(Pe())){const m=u.children[0],y=gt(u);h=m.getBoundingClientRect(),y.attr("width",h.width),y.attr("height",h.height)}se.info("Text 2",o);const d=o.slice(1,o.length);let f=u.getBBox();const p=await ql(s,d.join?d.join("
    "):d,e.labelStyle,!0,!0);if(mn(Pe())){const m=p.children[0],y=gt(p);h=m.getBoundingClientRect(),y.attr("width",h.width),y.attr("height",h.height)}const g=e.padding/2;return gt(p).attr("transform","translate( "+(h.width>f.width?0:(f.width-h.width)/2)+", "+(f.height+g+5)+")"),gt(u).attr("transform","translate( "+(h.width{const{shapeSvg:r,bbox:n}=await Ra(t,e,Bo(e,void 0),!0),i=n.height+e.padding,a=n.width+i/4+e.padding,s=r.insert("rect",":first-child").attr("style",e.style).attr("rx",i/2).attr("ry",i/2).attr("x",-a/2).attr("y",-i/2).attr("width",a).attr("height",i);return Ai(e,s),e.intersect=function(o){return pi.rect(e,o)},r},"stadium"),TTt=T(async(t,e)=>{const{shapeSvg:r,bbox:n,halfPadding:i}=await Ra(t,e,Bo(e,void 0),!0),a=r.insert("circle",":first-child");return a.attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("r",n.width/2+i).attr("width",n.width+e.padding).attr("height",n.height+e.padding),se.info("Circle main"),Ai(e,a),e.intersect=function(s){return se.info("Circle intersect",e,n.width/2+i,s),pi.circle(e,n.width/2+i,s)},r},"circle"),wTt=T(async(t,e)=>{const{shapeSvg:r,bbox:n,halfPadding:i}=await Ra(t,e,Bo(e,void 0),!0),a=5,s=r.insert("g",":first-child"),o=s.insert("circle"),l=s.insert("circle");return s.attr("class",e.class),o.attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("r",n.width/2+i+a).attr("width",n.width+e.padding+a*2).attr("height",n.height+e.padding+a*2),l.attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("r",n.width/2+i).attr("width",n.width+e.padding).attr("height",n.height+e.padding),se.info("DoubleCircle main"),Ai(e,o),e.intersect=function(u){return se.info("DoubleCircle intersect",e,n.width/2+i+a,u),pi.circle(e,n.width/2+i+a,u)},r},"doublecircle"),CTt=T(async(t,e)=>{const{shapeSvg:r,bbox:n}=await Ra(t,e,Bo(e,void 0),!0),i=n.width+e.padding,a=n.height+e.padding,s=[{x:0,y:0},{x:i,y:0},{x:i,y:-a},{x:0,y:-a},{x:0,y:0},{x:-8,y:0},{x:i+8,y:0},{x:i+8,y:-a},{x:-8,y:-a},{x:-8,y:0}],o=Vl(r,i,a,s);return o.attr("style",e.style),Ai(e,o),e.intersect=function(l){return pi.polygon(e,s,l)},r},"subroutine"),kTt=T((t,e)=>{const r=t.insert("g").attr("class","node default").attr("id",e.domId||e.id),n=r.insert("circle",":first-child");return n.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),Ai(e,n),e.intersect=function(i){return pi.circle(e,7,i)},r},"start"),TCe=T((t,e,r)=>{const n=t.insert("g").attr("class","node default").attr("id",e.domId||e.id);let i=70,a=10;r==="LR"&&(i=10,a=70);const s=n.append("rect").attr("x",-1*i/2).attr("y",-1*a/2).attr("width",i).attr("height",a).attr("class","fork-join");return Ai(e,s),e.height=e.height+e.padding/2,e.width=e.width+e.padding/2,e.intersect=function(o){return pi.rect(e,o)},n},"forkJoin"),ETt=T((t,e)=>{const r=t.insert("g").attr("class","node default").attr("id",e.domId||e.id),n=r.insert("circle",":first-child"),i=r.insert("circle",":first-child");return i.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),n.attr("class","state-end").attr("r",5).attr("width",10).attr("height",10),Ai(e,i),e.intersect=function(a){return pi.circle(e,7,a)},r},"end"),STt=T(async(t,e)=>{var S;const r=e.padding/2,n=4,i=8;let a;e.classes?a="node "+e.classes:a="node default";const s=t.insert("g").attr("class",a).attr("id",e.domId||e.id),o=s.insert("rect",":first-child"),l=s.insert("line"),u=s.insert("line");let h=0,d=n;const f=s.insert("g").attr("class","label");let p=0;const g=(S=e.classData.annotations)==null?void 0:S[0],m=e.classData.annotations[0]?"«"+e.classData.annotations[0]+"»":"",y=await ql(f,m,e.labelStyle,!0,!0);let v=y.getBBox();if(mn(Pe())){const L=y.children[0],$=gt(y);v=L.getBoundingClientRect(),$.attr("width",v.width),$.attr("height",v.height)}e.classData.annotations[0]&&(d+=v.height+n,h+=v.width);let x=e.classData.label;e.classData.type!==void 0&&e.classData.type!==""&&(mn(Pe())?x+="<"+e.classData.type+">":x+="<"+e.classData.type+">");const b=await ql(f,x,e.labelStyle,!0,!0);gt(b).attr("class","classTitle");let w=b.getBBox();if(mn(Pe())){const L=b.children[0],$=gt(b);w=L.getBoundingClientRect(),$.attr("width",w.width),$.attr("height",w.height)}d+=w.height+n,w.width>h&&(h=w.width);const C=[];e.classData.members.forEach(async L=>{const $=L.getDisplayDetails();let I=$.displayText;mn(Pe())&&(I=I.replace(//g,">"));const z=await ql(f,I,$.cssStyle?$.cssStyle:e.labelStyle,!0,!0);let F=z.getBBox();if(mn(Pe())){const A=z.children[0],R=gt(z);F=A.getBoundingClientRect(),R.attr("width",F.width),R.attr("height",F.height)}F.width>h&&(h=F.width),d+=F.height+n,C.push(z)}),d+=i;const _=[];if(e.classData.methods.forEach(async L=>{const $=L.getDisplayDetails();let I=$.displayText;mn(Pe())&&(I=I.replace(//g,">"));const z=await ql(f,I,$.cssStyle?$.cssStyle:e.labelStyle,!0,!0);let F=z.getBBox();if(mn(Pe())){const A=z.children[0],R=gt(z);F=A.getBoundingClientRect(),R.attr("width",F.width),R.attr("height",F.height)}F.width>h&&(h=F.width),d+=F.height+n,_.push(z)}),d+=i,g){let L=(h-v.width)/2;gt(y).attr("transform","translate( "+(-1*h/2+L)+", "+-1*d/2+")"),p=v.height+n}let k=(h-w.width)/2;return gt(b).attr("transform","translate( "+(-1*h/2+k)+", "+(-1*d/2+p)+")"),p+=w.height+n,l.attr("class","divider").attr("x1",-h/2-r).attr("x2",h/2+r).attr("y1",-d/2-r+i+p).attr("y2",-d/2-r+i+p),p+=i,C.forEach(L=>{gt(L).attr("transform","translate( "+-h/2+", "+(-1*d/2+p+i/2)+")");const $=L==null?void 0:L.getBBox();p+=(($==null?void 0:$.height)??0)+n}),p+=i,u.attr("class","divider").attr("x1",-h/2-r).attr("x2",h/2+r).attr("y1",-d/2-r+i+p).attr("y2",-d/2-r+i+p),p+=i,_.forEach(L=>{gt(L).attr("transform","translate( "+-h/2+", "+(-1*d/2+p)+")");const $=L==null?void 0:L.getBBox();p+=(($==null?void 0:$.height)??0)+n}),o.attr("style",e.style).attr("class","outer title-state").attr("x",-h/2-r).attr("y",-(d/2)-r).attr("width",h+e.padding).attr("height",d+e.padding),Ai(e,o),e.intersect=function(L){return pi.rect(e,L)},s},"class_box"),wCe={rhombus:xCe,composite:yTt,question:xCe,rect:mTt,labelRect:vTt,rectWithTitle:bTt,choice:sTt,circle:TTt,doublecircle:wTt,stadium:xTt,hexagon:oTt,block_arrow:lTt,rect_left_inv_arrow:cTt,lean_right:uTt,lean_left:hTt,trapezoid:dTt,inv_trapezoid:fTt,rect_right_inv_arrow:pTt,cylinder:gTt,start:kTt,end:ETt,note:aTt,subroutine:CTt,fork:TCe,join:TCe,class_box:STt},VA={},CCe=T(async(t,e,r)=>{let n,i;if(e.link){let a;Pe().securityLevel==="sandbox"?a="_top":e.linkTarget&&(a=e.linkTarget||"_blank"),n=t.insert("svg:a").attr("xlink:href",e.link).attr("target",a),i=await wCe[e.shape](n,e,r)}else i=await wCe[e.shape](t,e,r),n=i;return e.tooltip&&i.attr("title",e.tooltip),e.class&&i.attr("class","node default "+e.class),VA[e.id]=n,e.haveCallback&&VA[e.id].attr("class",VA[e.id].attr("class")+" clickable"),n},"insertNode"),_Tt=T(t=>{const e=VA[t.id];se.trace("Transforming node",t.diff,t,"translate("+(t.x-t.width/2-5)+", "+t.width/2+")");const r=8,n=t.diff||0;return t.clusterNode?e.attr("transform","translate("+(t.x+n-t.width/2)+", "+(t.y-t.height/2-r)+")"):e.attr("transform","translate("+t.x+", "+t.y+")"),n},"positionNode");function GG(t,e,r=!1){var p,g,m;const n=t;let i="default";(((p=n==null?void 0:n.classes)==null?void 0:p.length)||0)>0&&(i=((n==null?void 0:n.classes)??[]).join(" ")),i=i+" flowchart-label";let a=0,s="",o;switch(n.type){case"round":a=5,s="rect";break;case"composite":a=0,s="composite",o=0;break;case"square":s="rect";break;case"diamond":s="question";break;case"hexagon":s="hexagon";break;case"block_arrow":s="block_arrow";break;case"odd":s="rect_left_inv_arrow";break;case"lean_right":s="lean_right";break;case"lean_left":s="lean_left";break;case"trapezoid":s="trapezoid";break;case"inv_trapezoid":s="inv_trapezoid";break;case"rect_left_inv_arrow":s="rect_left_inv_arrow";break;case"circle":s="circle";break;case"ellipse":s="ellipse";break;case"stadium":s="stadium";break;case"subroutine":s="subroutine";break;case"cylinder":s="cylinder";break;case"group":s="rect";break;case"doublecircle":s="doublecircle";break;default:s="rect"}const l=h8((n==null?void 0:n.styles)??[]),u=n.label,h=n.size??{width:0,height:0,x:0,y:0},d=e.getDiagramId();return{labelStyle:l.labelStyle,shape:s,labelText:u,rx:a,ry:a,class:i,style:l.style,id:n.id,domId:d?`${d}-${n.id}`:n.id,directions:n.directions,width:h.width,height:h.height,x:h.x,y:h.y,positioned:r,intersect:void 0,type:n.type,padding:o??((m=(g=pr())==null?void 0:g.block)==null?void 0:m.padding)??0,widthInColumns:n.widthInColumns??1}}T(GG,"getNodeFromBlock");async function kCe(t,e,r){const n=GG(e,r,!1);if(n.type==="group")return;const i=pr(),a=await CCe(t,n,{config:i}),s=a.node().getBBox(),o=r.getBlock(n.id);o.size={width:s.width,height:s.height,x:0,y:0,node:a},r.setBlock(o),a.remove()}T(kCe,"calculateBlockSize");async function ECe(t,e,r){const n=GG(e,r,!0);if(r.getBlock(n.id).type!=="space"){const a=pr();await CCe(t,n,{config:a}),e.intersect=n==null?void 0:n.intersect,_Tt(n)}}T(ECe,"insertBlockPositioned");async function WA(t,e,r,n){for(const i of e)await n(t,i,r),i.children&&await WA(t,i.children,r,n)}T(WA,"performOperations");async function SCe(t,e,r){await WA(t,e,r,kCe)}T(SCe,"calculateBlockSizes");async function _Ce(t,e,r){await WA(t,e,r,ECe)}T(_Ce,"insertBlocks");async function ACe(t,e,r,n,i){const a=new Js({multigraph:!0,compound:!0});a.setGraph({rankdir:"TB",nodesep:10,ranksep:10,marginx:8,marginy:8});for(const s of r)s.size&&a.setNode(s.id,{width:s.size.width,height:s.size.height,intersect:s.intersect});for(const s of e)if(s.start&&s.end){const o=n.getBlock(s.start),l=n.getBlock(s.end);if(o!=null&&o.size&&(l!=null&&l.size)){const u=o.size,h=l.size,d=[{x:u.x,y:u.y},{x:u.x+(h.x-u.x)/2,y:u.y+(h.y-u.y)/2},{x:h.x,y:h.y}],f=i?`${i}-${s.id}`:s.id,p=s.thickness==="thick"?"edge-thickness-thick":"edge-thickness-normal",g=s.pattern==="dotted"?"edge-pattern-dotted":"edge-pattern-solid",m=`${p} ${g} flowchart-link LS-a1 LE-b1`;jxt(t,{v:s.start,w:s.end,name:f},{...s,id:f,arrowTypeEnd:s.arrowTypeEnd,arrowTypeStart:s.arrowTypeStart,points:d,classes:m},void 0,"block",a,i),s.label&&(await Uxt(t,{...s,label:s.label,labelStyle:"stroke: #333; stroke-width: 1.5px;fill:none;",arrowTypeEnd:s.arrowTypeEnd,arrowTypeStart:s.arrowTypeStart,points:d,classes:m}),Hxt({...s,x:d[1].x,y:d[1].y},{originalPath:d}))}}}T(ACe,"insertEdges");var ATt=T(function(t,e){return e.db.getClasses()},"getClasses"),RTt=T(async function(t,e,r,n){const{securityLevel:i,block:a}=pr(),s=n.db;s.setDiagramId(e);let o;i==="sandbox"&&(o=gt("#i"+e));const l=gt(i==="sandbox"?o.nodes()[0].contentDocument.body:"body"),u=i==="sandbox"?l.select(`[id="${e}"]`):gt(`[id="${e}"]`);zxt(u,["point","circle","cross"],n.type,e);const d=s.getBlocks(),f=s.getBlocksFlat(),p=s.getEdges(),g=u.insert("g").attr("class","block");await SCe(g,d,s);const m=uCe(s);if(await _Ce(g,d,s),await ACe(g,p,f,s,e),m){const y=m,v=Math.max(1,Math.round(.125*(y.width/y.height))),x=y.height+v+10,b=y.width+10,{useMaxWidth:w}=a;Wi(u,x,b,!!w),se.debug("Here Bounds",m,y),u.attr("viewBox",`${y.x-5} ${y.y-5} ${y.width+10} ${y.height+10}`)}},"draw"),LTt={draw:RTt,getClasses:ATt},ITt={parser:axt,db:Sxt,renderer:LTt,styles:Axt};const DTt=Object.freeze(Object.defineProperty({__proto__:null,diagram:ITt},Symbol.toStringTag,{value:"Module"}));var jc=new ZN(()=>({cnt:1,stack:[{id:0,level:-1,name:"/",children:[]}]})),MTt=T(()=>{jc.reset(),Hn()},"clear"),NTt=T(()=>jc.records.stack[0],"getRoot"),$Tt=T(()=>jc.records.cnt,"getCount"),OTt=Xr.treeView,PTt=T(()=>wi(OTt,pr().treeView),"getConfig"),BTt=T((t,e)=>{for(;t<=jc.records.stack[jc.records.stack.length-1].level;)jc.records.stack.pop();const r={id:jc.records.cnt++,level:t,name:e,children:[]};jc.records.stack[jc.records.stack.length-1].children.push(r),jc.records.stack.push(r)},"addNode"),FTt={clear:MTt,addNode:BTt,getRoot:NTt,getCount:$Tt,getConfig:PTt,getAccTitle:ii,getAccDescription:si,getDiagramTitle:Xn,setAccDescription:ai,setAccTitle:Yn,setDiagramTitle:oi},qG=FTt,zTt=T(t=>{Rc(t,qG),t.nodes.map(e=>qG.addNode(e.indent?parseInt(e.indent):0,e.name))},"populate"),GTt={parse:T(async t=>{const e=await Bl("treeView",t);se.debug(e),zTt(e)},"parse")},qTt=T((t,e,r,n,i)=>{const a=n.append("text").text(r.name).attr("dominant-baseline","middle").attr("class","treeView-node-label"),{height:s,width:o}=a.node().getBBox(),l=s+i.paddingY*2,u=o+i.paddingX*2;a.attr("x",t+i.paddingX),a.attr("y",e+l/2),r.BBox={x:t,y:e,width:u,height:l}},"positionLabel"),RCe=T((t,e,r,n,i,a)=>t.append("line").attr("x1",e).attr("y1",r).attr("x2",n).attr("y2",i).attr("stroke-width",a).attr("class","treeView-node-line"),"positionLine"),VTt=T((t,e,r)=>{let n=0,i=0;const a=T((o,l,u,h)=>{const d=h*(u.rowIndent+u.paddingX);qTt(d,n,l,o,u);const{height:f,width:p}=l.BBox;RCe(o,d-u.rowIndent,n+f/2,d,n+f/2,u.lineThickness),i=Math.max(i,d+p),n+=f},"drawNode"),s=T((o,l=0)=>{a(t,o,r,l),o.children.forEach(f=>{s(f,l+1)});const{x:u,y:h,height:d}=o.BBox;if(o.children.length){const{y:f,height:p}=o.children[o.children.length-1].BBox;RCe(t,u+r.paddingX,h+d,u+r.paddingX,f+p/2+r.lineThickness/2,r.lineThickness)}},"processNode");return s(e),{totalHeight:n,totalWidth:i}},"drawTree"),WTt=T((t,e,r,n)=>{se.debug(`Rendering treeView diagram +`+t);const i=n.db,a=i.getRoot(),s=i.getConfig(),o=Ys(e),l=o.append("g");l.attr("class","tree-view");const{totalHeight:u,totalWidth:h}=VTt(l,a,s);o.attr("viewBox",`-${s.lineThickness/2} 0 ${h} ${u}`),Wi(o,u,h,s.useMaxWidth)},"draw"),UTt={draw:WTt},HTt=UTt,YTt={labelFontSize:"16px",labelColor:"black",lineColor:"black"},XTt=T(({treeView:t})=>{const{labelFontSize:e,labelColor:r,lineColor:n}=wi(YTt,t);return` .treeView-node-label { font-size: ${e}; fill: ${r}; @@ -3140,7 +3141,7 @@ Expecting `+ne.join(", ")+", got '"+(this.terminals_[Y]||Y)+"'":ue="Parse error .treeView-node-line { stroke: ${n}; } - `},"styles"),cpt=lpt,upt={db:fP,renderer:spt,parser:tpt,styles:cpt};const hpt=Object.freeze(Object.defineProperty({__proto__:null,diagram:upt},Symbol.toStringTag,{value:"Module"}));var HS={exports:{}},YS={exports:{}},XS={exports:{}},dpt=XS.exports,fye;function fpt(){return fye||(fye=1,(function(t,e){(function(n,i){t.exports=i()})(dpt,function(){return(function(r){var n={};function i(a){if(n[a])return n[a].exports;var s=n[a]={i:a,l:!1,exports:{}};return r[a].call(s.exports,s,s.exports,i),s.l=!0,s.exports}return i.m=r,i.c=n,i.i=function(a){return a},i.d=function(a,s,o){i.o(a,s)||Object.defineProperty(a,s,{configurable:!1,enumerable:!0,get:o})},i.n=function(a){var s=a&&a.__esModule?function(){return a.default}:function(){return a};return i.d(s,"a",s),s},i.o=function(a,s){return Object.prototype.hasOwnProperty.call(a,s)},i.p="",i(i.s=28)})([(function(r,n,i){function a(){}a.QUALITY=1,a.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,a.DEFAULT_INCREMENTAL=!1,a.DEFAULT_ANIMATION_ON_LAYOUT=!0,a.DEFAULT_ANIMATION_DURING_LAYOUT=!1,a.DEFAULT_ANIMATION_PERIOD=50,a.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,a.DEFAULT_GRAPH_MARGIN=15,a.NODE_DIMENSIONS_INCLUDE_LABELS=!1,a.SIMPLE_NODE_SIZE=40,a.SIMPLE_NODE_HALF_SIZE=a.SIMPLE_NODE_SIZE/2,a.EMPTY_COMPOUND_NODE_SIZE=40,a.MIN_EDGE_LENGTH=1,a.WORLD_BOUNDARY=1e6,a.INITIAL_WORLD_BOUNDARY=a.WORLD_BOUNDARY/1e3,a.WORLD_CENTER_X=1200,a.WORLD_CENTER_Y=900,r.exports=a}),(function(r,n,i){var a=i(2),s=i(8),o=i(9);function l(h,d,f){a.call(this,f),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=f,this.bendpoints=[],this.source=h,this.target=d}l.prototype=Object.create(a.prototype);for(var u in a)l[u]=a[u];l.prototype.getSource=function(){return this.source},l.prototype.getTarget=function(){return this.target},l.prototype.isInterGraph=function(){return this.isInterGraph},l.prototype.getLength=function(){return this.length},l.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},l.prototype.getBendpoints=function(){return this.bendpoints},l.prototype.getLca=function(){return this.lca},l.prototype.getSourceInLca=function(){return this.sourceInLca},l.prototype.getTargetInLca=function(){return this.targetInLca},l.prototype.getOtherEnd=function(h){if(this.source===h)return this.target;if(this.target===h)return this.source;throw"Node is not incident with this edge"},l.prototype.getOtherEndInGraph=function(h,d){for(var f=this.getOtherEnd(h),p=d.getGraphManager().getRoot();;){if(f.getOwner()==d)return f;if(f.getOwner()==p)break;f=f.getOwner().getParent()}return null},l.prototype.updateLength=function(){var h=new Array(4);this.isOverlapingSourceAndTarget=s.getIntersection(this.target.getRect(),this.source.getRect(),h),this.isOverlapingSourceAndTarget||(this.lengthX=h[0]-h[2],this.lengthY=h[1]-h[3],Math.abs(this.lengthX)<1&&(this.lengthX=o.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=o.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},l.prototype.updateLengthSimple=function(){this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),Math.abs(this.lengthX)<1&&(this.lengthX=o.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=o.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},r.exports=l}),(function(r,n,i){function a(s){this.vGraphObject=s}r.exports=a}),(function(r,n,i){var a=i(2),s=i(10),o=i(13),l=i(0),u=i(16),h=i(5);function d(p,g,m,y){m==null&&y==null&&(y=g),a.call(this,y),p.graphManager!=null&&(p=p.graphManager),this.estimatedSize=s.MIN_VALUE,this.inclusionTreeDepth=s.MAX_VALUE,this.vGraphObject=y,this.edges=[],this.graphManager=p,m!=null&&g!=null?this.rect=new o(g.x,g.y,m.width,m.height):this.rect=new o}d.prototype=Object.create(a.prototype);for(var f in a)d[f]=a[f];d.prototype.getEdges=function(){return this.edges},d.prototype.getChild=function(){return this.child},d.prototype.getOwner=function(){return this.owner},d.prototype.getWidth=function(){return this.rect.width},d.prototype.setWidth=function(p){this.rect.width=p},d.prototype.getHeight=function(){return this.rect.height},d.prototype.setHeight=function(p){this.rect.height=p},d.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},d.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},d.prototype.getCenter=function(){return new h(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},d.prototype.getLocation=function(){return new h(this.rect.x,this.rect.y)},d.prototype.getRect=function(){return this.rect},d.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},d.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},d.prototype.setRect=function(p,g){this.rect.x=p.x,this.rect.y=p.y,this.rect.width=g.width,this.rect.height=g.height},d.prototype.setCenter=function(p,g){this.rect.x=p-this.rect.width/2,this.rect.y=g-this.rect.height/2},d.prototype.setLocation=function(p,g){this.rect.x=p,this.rect.y=g},d.prototype.moveBy=function(p,g){this.rect.x+=p,this.rect.y+=g},d.prototype.getEdgeListToNode=function(p){var g=[],m=this;return m.edges.forEach(function(y){if(y.target==p){if(y.source!=m)throw"Incorrect edge source!";g.push(y)}}),g},d.prototype.getEdgesBetween=function(p){var g=[],m=this;return m.edges.forEach(function(y){if(!(y.source==m||y.target==m))throw"Incorrect edge source and/or target";(y.target==p||y.source==p)&&g.push(y)}),g},d.prototype.getNeighborsList=function(){var p=new Set,g=this;return g.edges.forEach(function(m){if(m.source==g)p.add(m.target);else{if(m.target!=g)throw"Incorrect incidency!";p.add(m.source)}}),p},d.prototype.withChildren=function(){var p=new Set,g,m;if(p.add(this),this.child!=null)for(var y=this.child.getNodes(),v=0;vg?(this.rect.x-=(this.labelWidth-g)/2,this.setWidth(this.labelWidth)):this.labelPosHorizontal=="right"&&this.setWidth(g+this.labelWidth)),this.labelHeight&&(this.labelPosVertical=="top"?(this.rect.y-=this.labelHeight,this.setHeight(m+this.labelHeight)):this.labelPosVertical=="center"&&this.labelHeight>m?(this.rect.y-=(this.labelHeight-m)/2,this.setHeight(this.labelHeight)):this.labelPosVertical=="bottom"&&this.setHeight(m+this.labelHeight))}}},d.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==s.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},d.prototype.transform=function(p){var g=this.rect.x;g>l.WORLD_BOUNDARY?g=l.WORLD_BOUNDARY:g<-l.WORLD_BOUNDARY&&(g=-l.WORLD_BOUNDARY);var m=this.rect.y;m>l.WORLD_BOUNDARY?m=l.WORLD_BOUNDARY:m<-l.WORLD_BOUNDARY&&(m=-l.WORLD_BOUNDARY);var y=new h(g,m),v=p.inverseTransformPoint(y);this.setLocation(v.x,v.y)},d.prototype.getLeft=function(){return this.rect.x},d.prototype.getRight=function(){return this.rect.x+this.rect.width},d.prototype.getTop=function(){return this.rect.y},d.prototype.getBottom=function(){return this.rect.y+this.rect.height},d.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},r.exports=d}),(function(r,n,i){var a=i(0);function s(){}for(var o in a)s[o]=a[o];s.MAX_ITERATIONS=2500,s.DEFAULT_EDGE_LENGTH=50,s.DEFAULT_SPRING_STRENGTH=.45,s.DEFAULT_REPULSION_STRENGTH=4500,s.DEFAULT_GRAVITY_STRENGTH=.4,s.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,s.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,s.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,s.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,s.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,s.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,s.COOLING_ADAPTATION_FACTOR=.33,s.ADAPTATION_LOWER_NODE_LIMIT=1e3,s.ADAPTATION_UPPER_NODE_LIMIT=5e3,s.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,s.MAX_NODE_DISPLACEMENT=s.MAX_NODE_DISPLACEMENT_INCREMENTAL*3,s.MIN_REPULSION_DIST=s.DEFAULT_EDGE_LENGTH/10,s.CONVERGENCE_CHECK_PERIOD=100,s.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,s.MIN_EDGE_LENGTH=1,s.GRID_CALCULATION_CHECK_PERIOD=10,r.exports=s}),(function(r,n,i){function a(s,o){s==null&&o==null?(this.x=0,this.y=0):(this.x=s,this.y=o)}a.prototype.getX=function(){return this.x},a.prototype.getY=function(){return this.y},a.prototype.setX=function(s){this.x=s},a.prototype.setY=function(s){this.y=s},a.prototype.getDifference=function(s){return new DimensionD(this.x-s.x,this.y-s.y)},a.prototype.getCopy=function(){return new a(this.x,this.y)},a.prototype.translate=function(s){return this.x+=s.width,this.y+=s.height,this},r.exports=a}),(function(r,n,i){var a=i(2),s=i(10),o=i(0),l=i(7),u=i(3),h=i(1),d=i(13),f=i(12),p=i(11);function g(y,v,T){a.call(this,T),this.estimatedSize=s.MIN_VALUE,this.margin=o.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=y,v!=null&&v instanceof l?this.graphManager=v:v!=null&&v instanceof Layout&&(this.graphManager=v.graphManager)}g.prototype=Object.create(a.prototype);for(var m in a)g[m]=a[m];g.prototype.getNodes=function(){return this.nodes},g.prototype.getEdges=function(){return this.edges},g.prototype.getGraphManager=function(){return this.graphManager},g.prototype.getParent=function(){return this.parent},g.prototype.getLeft=function(){return this.left},g.prototype.getRight=function(){return this.right},g.prototype.getTop=function(){return this.top},g.prototype.getBottom=function(){return this.bottom},g.prototype.isConnected=function(){return this.isConnected},g.prototype.add=function(y,v,T){if(v==null&&T==null){var b=y;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(b)>-1)throw"Node already in graph!";return b.owner=this,this.getNodes().push(b),b}else{var w=y;if(!(this.getNodes().indexOf(v)>-1&&this.getNodes().indexOf(T)>-1))throw"Source or target not in graph!";if(!(v.owner==T.owner&&v.owner==this))throw"Both owners must be this graph!";return v.owner!=T.owner?null:(w.source=v,w.target=T,w.isInterGraph=!1,this.getEdges().push(w),v.edges.push(w),T!=v&&T.edges.push(w),w)}},g.prototype.remove=function(y){var v=y;if(y instanceof u){if(v==null)throw"Node is null!";if(!(v.owner!=null&&v.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";for(var T=v.edges.slice(),b,w=T.length,k=0;k-1&&_>-1))throw"Source and/or target doesn't know this edge!";b.source.edges.splice(C,1),b.target!=b.source&&b.target.edges.splice(_,1);var A=b.source.owner.getEdges().indexOf(b);if(A==-1)throw"Not in owner's edge list!";b.source.owner.getEdges().splice(A,1)}},g.prototype.updateLeftTop=function(){for(var y=s.MAX_VALUE,v=s.MAX_VALUE,T,b,w,k=this.getNodes(),A=k.length,C=0;CT&&(y=T),v>b&&(v=b)}return y==s.MAX_VALUE?null:(k[0].getParent().paddingLeft!=null?w=k[0].getParent().paddingLeft:w=this.margin,this.left=v-w,this.top=y-w,new f(this.left,this.top))},g.prototype.updateBounds=function(y){for(var v=s.MAX_VALUE,T=-s.MAX_VALUE,b=s.MAX_VALUE,w=-s.MAX_VALUE,k,A,C,_,L,O=this.nodes,M=O.length,z=0;zk&&(v=k),TC&&(b=C),w<_&&(w=_)}var S=new d(v,b,T-v,w-b);v==s.MAX_VALUE&&(this.left=this.parent.getLeft(),this.right=this.parent.getRight(),this.top=this.parent.getTop(),this.bottom=this.parent.getBottom()),O[0].getParent().paddingLeft!=null?L=O[0].getParent().paddingLeft:L=this.margin,this.left=S.x-L,this.right=S.x+S.width+L,this.top=S.y-L,this.bottom=S.y+S.height+L},g.calculateBounds=function(y){for(var v=s.MAX_VALUE,T=-s.MAX_VALUE,b=s.MAX_VALUE,w=-s.MAX_VALUE,k,A,C,_,L=y.length,O=0;Ok&&(v=k),TC&&(b=C),w<_&&(w=_)}var z=new d(v,b,T-v,w-b);return z},g.prototype.getInclusionTreeDepth=function(){return this==this.graphManager.getRoot()?1:this.parent.getInclusionTreeDepth()},g.prototype.getEstimatedSize=function(){if(this.estimatedSize==s.MIN_VALUE)throw"assert failed";return this.estimatedSize},g.prototype.calcEstimatedSize=function(){for(var y=0,v=this.nodes,T=v.length,b=0;b=this.nodes.length){var M=0;T.forEach(function(z){z.owner==y&&M++}),M==this.nodes.length&&(this.isConnected=!0)}},r.exports=g}),(function(r,n,i){var a,s=i(1);function o(l){a=i(6),this.layout=l,this.graphs=[],this.edges=[]}o.prototype.addRoot=function(){var l=this.layout.newGraph(),u=this.layout.newNode(null),h=this.add(l,u);return this.setRootGraph(h),this.rootGraph},o.prototype.add=function(l,u,h,d,f){if(h==null&&d==null&&f==null){if(l==null)throw"Graph is null!";if(u==null)throw"Parent node is null!";if(this.graphs.indexOf(l)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(l),l.parent!=null)throw"Already has a parent!";if(u.child!=null)throw"Already has a child!";return l.parent=u,u.child=l,l}else{f=h,d=u,h=l;var p=d.getOwner(),g=f.getOwner();if(!(p!=null&&p.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(g!=null&&g.getGraphManager()==this))throw"Target not in this graph mgr!";if(p==g)return h.isInterGraph=!1,p.add(h,d,f);if(h.isInterGraph=!0,h.source=d,h.target=f,this.edges.indexOf(h)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(h),!(h.source!=null&&h.target!=null))throw"Edge source and/or target is null!";if(!(h.source.edges.indexOf(h)==-1&&h.target.edges.indexOf(h)==-1))throw"Edge already in source and/or target incidency list!";return h.source.edges.push(h),h.target.edges.push(h),h}},o.prototype.remove=function(l){if(l instanceof a){var u=l;if(u.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(u==this.rootGraph||u.parent!=null&&u.parent.graphManager==this))throw"Invalid parent node!";var h=[];h=h.concat(u.getEdges());for(var d,f=h.length,p=0;p=l.getRight()?u[0]+=Math.min(l.getX()-o.getX(),o.getRight()-l.getRight()):l.getX()<=o.getX()&&l.getRight()>=o.getRight()&&(u[0]+=Math.min(o.getX()-l.getX(),l.getRight()-o.getRight())),o.getY()<=l.getY()&&o.getBottom()>=l.getBottom()?u[1]+=Math.min(l.getY()-o.getY(),o.getBottom()-l.getBottom()):l.getY()<=o.getY()&&l.getBottom()>=o.getBottom()&&(u[1]+=Math.min(o.getY()-l.getY(),l.getBottom()-o.getBottom()));var f=Math.abs((l.getCenterY()-o.getCenterY())/(l.getCenterX()-o.getCenterX()));l.getCenterY()===o.getCenterY()&&l.getCenterX()===o.getCenterX()&&(f=1);var p=f*u[0],g=u[1]/f;u[0]p)return u[0]=h,u[1]=m,u[2]=f,u[3]=O,!1;if(df)return u[0]=g,u[1]=d,u[2]=_,u[3]=p,!1;if(hf?(u[0]=v,u[1]=T,S=!0):(u[0]=y,u[1]=m,S=!0):N===I&&(h>f?(u[0]=g,u[1]=m,S=!0):(u[0]=b,u[1]=T,S=!0)),-D===I?f>h?(u[2]=L,u[3]=O,R=!0):(u[2]=_,u[3]=C,R=!0):D===I&&(f>h?(u[2]=A,u[3]=C,R=!0):(u[2]=M,u[3]=O,R=!0)),S&&R)return!1;if(h>f?d>p?($=this.getCardinalDirection(N,I,4),B=this.getCardinalDirection(D,I,2)):($=this.getCardinalDirection(-N,I,3),B=this.getCardinalDirection(-D,I,1)):d>p?($=this.getCardinalDirection(-N,I,1),B=this.getCardinalDirection(-D,I,3)):($=this.getCardinalDirection(N,I,2),B=this.getCardinalDirection(D,I,4)),!S)switch($){case 1:G=m,P=h+-k/I,u[0]=P,u[1]=G;break;case 2:P=b,G=d+w*I,u[0]=P,u[1]=G;break;case 3:G=T,P=h+k/I,u[0]=P,u[1]=G;break;case 4:P=v,G=d+-w*I,u[0]=P,u[1]=G;break}if(!R)switch(B){case 1:Y=C,V=f+-F/I,u[2]=V,u[3]=Y;break;case 2:V=M,Y=p+z*I,u[2]=V,u[3]=Y;break;case 3:Y=O,V=f+F/I,u[2]=V,u[3]=Y;break;case 4:V=L,Y=p+-z*I,u[2]=V,u[3]=Y;break}}return!1},s.getCardinalDirection=function(o,l,u){return o>l?u:1+u%4},s.getIntersection=function(o,l,u,h){if(h==null)return this.getIntersection2(o,l,u);var d=o.x,f=o.y,p=l.x,g=l.y,m=u.x,y=u.y,v=h.x,T=h.y,b=void 0,w=void 0,k=void 0,A=void 0,C=void 0,_=void 0,L=void 0,O=void 0,M=void 0;return k=g-f,C=d-p,L=p*f-d*g,A=T-y,_=m-v,O=v*y-m*T,M=k*_-A*C,M===0?null:(b=(C*O-_*L)/M,w=(A*L-k*O)/M,new a(b,w))},s.angleOfVector=function(o,l,u,h){var d=void 0;return o!==u?(d=Math.atan((h-l)/(u-o)),u=0){var T=(-m+Math.sqrt(m*m-4*g*y))/(2*g),b=(-m-Math.sqrt(m*m-4*g*y))/(2*g),w=null;return T>=0&&T<=1?[T]:b>=0&&b<=1?[b]:w}else return null},s.HALF_PI=.5*Math.PI,s.ONE_AND_HALF_PI=1.5*Math.PI,s.TWO_PI=2*Math.PI,s.THREE_PI=3*Math.PI,r.exports=s}),(function(r,n,i){function a(){}a.sign=function(s){return s>0?1:s<0?-1:0},a.floor=function(s){return s<0?Math.ceil(s):Math.floor(s)},a.ceil=function(s){return s<0?Math.floor(s):Math.ceil(s)},r.exports=a}),(function(r,n,i){function a(){}a.MAX_VALUE=2147483647,a.MIN_VALUE=-2147483648,r.exports=a}),(function(r,n,i){var a=(function(){function d(f,p){for(var g=0;g"u"?"undefined":a(o);return o==null||l!="object"&&l!="function"},r.exports=s}),(function(r,n,i){function a(m){if(Array.isArray(m)){for(var y=0,v=Array(m.length);y0&&y;){for(k.push(C[0]);k.length>0&&y;){var _=k[0];k.splice(0,1),w.add(_);for(var L=_.getEdges(),b=0;b-1&&C.splice(F,1)}w=new Set,A=new Map}}return m},g.prototype.createDummyNodesForBendpoints=function(m){for(var y=[],v=m.source,T=this.graphManager.calcLowestCommonAncestor(m.source,m.target),b=0;b0){for(var T=this.edgeToDummyNodes.get(v),b=0;b=0&&y.splice(O,1);var M=A.getNeighborsList();M.forEach(function(S){if(v.indexOf(S)<0){var R=T.get(S),N=R-1;N==1&&_.push(S),T.set(S,N)}})}v=v.concat(_),(y.length==1||y.length==2)&&(b=!0,w=y[0])}return w},g.prototype.setGraphManager=function(m){this.graphManager=m},r.exports=g}),(function(r,n,i){function a(){}a.seed=1,a.x=0,a.nextDouble=function(){return a.x=Math.sin(a.seed++)*1e4,a.x-Math.floor(a.x)},r.exports=a}),(function(r,n,i){var a=i(5);function s(o,l){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}s.prototype.getWorldOrgX=function(){return this.lworldOrgX},s.prototype.setWorldOrgX=function(o){this.lworldOrgX=o},s.prototype.getWorldOrgY=function(){return this.lworldOrgY},s.prototype.setWorldOrgY=function(o){this.lworldOrgY=o},s.prototype.getWorldExtX=function(){return this.lworldExtX},s.prototype.setWorldExtX=function(o){this.lworldExtX=o},s.prototype.getWorldExtY=function(){return this.lworldExtY},s.prototype.setWorldExtY=function(o){this.lworldExtY=o},s.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},s.prototype.setDeviceOrgX=function(o){this.ldeviceOrgX=o},s.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},s.prototype.setDeviceOrgY=function(o){this.ldeviceOrgY=o},s.prototype.getDeviceExtX=function(){return this.ldeviceExtX},s.prototype.setDeviceExtX=function(o){this.ldeviceExtX=o},s.prototype.getDeviceExtY=function(){return this.ldeviceExtY},s.prototype.setDeviceExtY=function(o){this.ldeviceExtY=o},s.prototype.transformX=function(o){var l=0,u=this.lworldExtX;return u!=0&&(l=this.ldeviceOrgX+(o-this.lworldOrgX)*this.ldeviceExtX/u),l},s.prototype.transformY=function(o){var l=0,u=this.lworldExtY;return u!=0&&(l=this.ldeviceOrgY+(o-this.lworldOrgY)*this.ldeviceExtY/u),l},s.prototype.inverseTransformX=function(o){var l=0,u=this.ldeviceExtX;return u!=0&&(l=this.lworldOrgX+(o-this.ldeviceOrgX)*this.lworldExtX/u),l},s.prototype.inverseTransformY=function(o){var l=0,u=this.ldeviceExtY;return u!=0&&(l=this.lworldOrgY+(o-this.ldeviceOrgY)*this.lworldExtY/u),l},s.prototype.inverseTransformPoint=function(o){var l=new a(this.inverseTransformX(o.x),this.inverseTransformY(o.y));return l},r.exports=s}),(function(r,n,i){function a(p){if(Array.isArray(p)){for(var g=0,m=Array(p.length);go.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*o.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(p-o.ADAPTATION_LOWER_NODE_LIMIT)/(o.ADAPTATION_UPPER_NODE_LIMIT-o.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-o.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=o.MAX_NODE_DISPLACEMENT_INCREMENTAL):(p>o.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(o.COOLING_ADAPTATION_FACTOR,1-(p-o.ADAPTATION_LOWER_NODE_LIMIT)/(o.ADAPTATION_UPPER_NODE_LIMIT-o.ADAPTATION_LOWER_NODE_LIMIT)*(1-o.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=o.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.displacementThresholdPerNode=3*o.DEFAULT_EDGE_LENGTH/100,this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},d.prototype.calcSpringForces=function(){for(var p=this.getAllEdges(),g,m=0;m0&&arguments[0]!==void 0?arguments[0]:!0,g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,m,y,v,T,b=this.getAllNodes(),w;if(this.useFRGridVariant)for(this.totalIterations%o.GRID_CALCULATION_CHECK_PERIOD==1&&p&&this.updateGrid(),w=new Set,m=0;mk||w>k)&&(p.gravitationForceX=-this.gravityConstant*v,p.gravitationForceY=-this.gravityConstant*T)):(k=g.getEstimatedSize()*this.compoundGravityRangeFactor,(b>k||w>k)&&(p.gravitationForceX=-this.gravityConstant*v*this.compoundGravityConstant,p.gravitationForceY=-this.gravityConstant*T*this.compoundGravityConstant))},d.prototype.isConverged=function(){var p,g=!1;return this.totalIterations>this.maxIterations/3&&(g=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),p=this.totalDisplacement=b.length||k>=b[0].length)){for(var A=0;Ad}}]),u})();r.exports=l}),(function(r,n,i){function a(){}a.svd=function(s){this.U=null,this.V=null,this.s=null,this.m=0,this.n=0,this.m=s.length,this.n=s[0].length;var o=Math.min(this.m,this.n);this.s=(function(xt){for(var ht=[];xt-- >0;)ht.push(0);return ht})(Math.min(this.m+1,this.n)),this.U=(function(xt){var ht=function oe(At){if(At.length==0)return 0;for(var dt=[],ut=0;ut0;)ht.push(0);return ht})(this.n),u=(function(xt){for(var ht=[];xt-- >0;)ht.push(0);return ht})(this.m),h=!0,d=Math.min(this.m-1,this.n),f=Math.max(0,Math.min(this.n-2,this.m)),p=0;p=0;D--)if(this.s[D]!==0){for(var I=D+1;I=0;W--){if((function(xt,ht){return xt&&ht})(W0;){var fe=void 0,_e=void 0;for(fe=S-2;fe>=-1&&fe!==-1;fe--)if(Math.abs(l[fe])<=ue+ne*(Math.abs(this.s[fe])+Math.abs(this.s[fe+1]))){l[fe]=0;break}if(fe===S-2)_e=4;else{var Ae=void 0;for(Ae=S-1;Ae>=fe&&Ae!==fe;Ae--){var Ne=(Ae!==S?Math.abs(l[Ae]):0)+(Ae!==fe+1?Math.abs(l[Ae-1]):0);if(Math.abs(this.s[Ae])<=ue+ne*Ne){this.s[Ae]=0;break}}Ae===fe?_e=3:Ae===S-1?_e=1:(_e=2,fe=Ae)}switch(fe++,_e){case 1:{var me=l[S-2];l[S-2]=0;for(var ve=S-2;ve>=fe;ve--){var Ge=a.hypot(this.s[ve],me),Te=this.s[ve]/Ge,Ze=me/Ge;this.s[ve]=Ge,ve!==fe&&(me=-Ze*l[ve-1],l[ve-1]=Te*l[ve-1]);for(var ke=0;ke=this.s[fe+1]);){var Et=this.s[fe];if(this.s[fe]=this.s[fe+1],this.s[fe+1]=Et,feMath.abs(o)?(l=o/s,l=Math.abs(s)*Math.sqrt(1+l*l)):o!=0?(l=s/o,l=Math.abs(o)*Math.sqrt(1+l*l)):l=0,l},r.exports=a}),(function(r,n,i){var a=(function(){function l(u,h){for(var d=0;d2&&arguments[2]!==void 0?arguments[2]:1,f=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,p=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;s(this,l),this.sequence1=u,this.sequence2=h,this.match_score=d,this.mismatch_penalty=f,this.gap_penalty=p,this.iMax=u.length+1,this.jMax=h.length+1,this.grid=new Array(this.iMax);for(var g=0;g=0;u--){var h=this.listeners[u];h.event===o&&h.callback===l&&this.listeners.splice(u,1)}},s.emit=function(o,l){for(var u=0;u{var n={45:((o,l,u)=>{var h={};h.layoutBase=u(551),h.CoSEConstants=u(806),h.CoSEEdge=u(767),h.CoSEGraph=u(880),h.CoSEGraphManager=u(578),h.CoSELayout=u(765),h.CoSENode=u(991),h.ConstraintHandler=u(902),o.exports=h}),806:((o,l,u)=>{var h=u(551).FDLayoutConstants;function d(){}for(var f in h)d[f]=h[f];d.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,d.DEFAULT_RADIAL_SEPARATION=h.DEFAULT_EDGE_LENGTH,d.DEFAULT_COMPONENT_SEPERATION=60,d.TILE=!0,d.TILING_PADDING_VERTICAL=10,d.TILING_PADDING_HORIZONTAL=10,d.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,d.ENFORCE_CONSTRAINTS=!0,d.APPLY_LAYOUT=!0,d.RELAX_MOVEMENT_ON_CONSTRAINTS=!0,d.TREE_REDUCTION_ON_INCREMENTAL=!0,d.PURE_INCREMENTAL=d.DEFAULT_INCREMENTAL,o.exports=d}),767:((o,l,u)=>{var h=u(551).FDLayoutEdge;function d(p,g,m){h.call(this,p,g,m)}d.prototype=Object.create(h.prototype);for(var f in h)d[f]=h[f];o.exports=d}),880:((o,l,u)=>{var h=u(551).LGraph;function d(p,g,m){h.call(this,p,g,m)}d.prototype=Object.create(h.prototype);for(var f in h)d[f]=h[f];o.exports=d}),578:((o,l,u)=>{var h=u(551).LGraphManager;function d(p){h.call(this,p)}d.prototype=Object.create(h.prototype);for(var f in h)d[f]=h[f];o.exports=d}),765:((o,l,u)=>{var h=u(551).FDLayout,d=u(578),f=u(880),p=u(991),g=u(767),m=u(806),y=u(902),v=u(551).FDLayoutConstants,T=u(551).LayoutConstants,b=u(551).Point,w=u(551).PointD,k=u(551).DimensionD,A=u(551).Layout,C=u(551).Integer,_=u(551).IGeometry,L=u(551).LGraph,O=u(551).Transform,M=u(551).LinkedList;function z(){h.call(this),this.toBeTiled={},this.constraints={}}z.prototype=Object.create(h.prototype);for(var F in h)z[F]=h[F];z.prototype.newGraphManager=function(){var S=new d(this);return this.graphManager=S,S},z.prototype.newGraph=function(S){return new f(null,this.graphManager,S)},z.prototype.newNode=function(S){return new p(this.graphManager,S)},z.prototype.newEdge=function(S){return new g(null,null,S)},z.prototype.initParameters=function(){h.prototype.initParameters.call(this,arguments),this.isSubLayout||(m.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=m.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=m.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=v.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=v.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=v.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=v.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1)},z.prototype.initSpringEmbedder=function(){h.prototype.initSpringEmbedder.call(this),this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/v.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=.04,this.coolingAdjuster=1},z.prototype.layout=function(){var S=T.DEFAULT_CREATE_BENDS_AS_NEEDED;return S&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},z.prototype.classicLayout=function(){if(this.nodesWithGravity=this.calculateNodesToApplyGravitationTo(),this.graphManager.setAllNodesToApplyGravitation(this.nodesWithGravity),this.calcNoOfChildrenForAllNodes(),this.graphManager.calcLowestCommonAncestors(),this.graphManager.calcInclusionTreeDepths(),this.graphManager.getRoot().calcEstimatedSize(),this.calcIdealEdgeLengths(),this.incremental){if(m.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var R=new Set(this.getAllNodes()),N=this.nodesWithGravity.filter(function($){return R.has($)});this.graphManager.setAllNodesToApplyGravitation(N)}}else{var S=this.getFlatForest();if(S.length>0)this.positionNodesRadially(S);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var R=new Set(this.getAllNodes()),N=this.nodesWithGravity.filter(function(D){return R.has(D)});this.graphManager.setAllNodesToApplyGravitation(N),this.positionNodesRandomly()}}return Object.keys(this.constraints).length>0&&(y.handleConstraints(this),this.initConstraintVariables()),this.initSpringEmbedder(),m.APPLY_LAYOUT&&this.runSpringEmbedder(),!0},z.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished)if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.totalIterations%v.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;this.coolingCycle++,this.layoutQuality==0?this.coolingAdjuster=this.coolingCycle:this.layoutQuality==1&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var S=new Set(this.getAllNodes()),R=this.nodesWithGravity.filter(function(I){return S.has(I)});this.graphManager.setAllNodesToApplyGravitation(R),this.graphManager.updateBounds(),this.updateGrid(),m.PURE_INCREMENTAL?this.coolingFactor=v.DEFAULT_COOLING_FACTOR_INCREMENTAL/2:this.coolingFactor=v.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),m.PURE_INCREMENTAL?this.coolingFactor=v.DEFAULT_COOLING_FACTOR_INCREMENTAL/2*((100-this.afterGrowthIterations)/100):this.coolingFactor=v.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var N=!this.isTreeGrowing&&!this.isGrowthFinished,D=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(N,D),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},z.prototype.getPositionsData=function(){for(var S=this.graphManager.getAllNodes(),R={},N=0;N0&&this.updateDisplacements();for(var N=0;N0&&(D.fixedNodeWeight=$)}}if(this.constraints.relativePlacementConstraint){var B=new Map,P=new Map;if(this.dummyToNodeForVerticalAlignment=new Map,this.dummyToNodeForHorizontalAlignment=new Map,this.fixedNodesOnHorizontal=new Set,this.fixedNodesOnVertical=new Set,this.fixedNodeSet.forEach(function(J){S.fixedNodesOnHorizontal.add(J),S.fixedNodesOnVertical.add(J)}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var G=this.constraints.alignmentConstraint.vertical,N=0;N=2*J.length/3;ne--)Z=Math.floor(Math.random()*(ne+1)),ee=J[ne],J[ne]=J[Z],J[Z]=ee;return J},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(J){if(J.left){var Z=B.has(J.left)?B.get(J.left):J.left,ee=B.has(J.right)?B.get(J.right):J.right;S.nodesInRelativeHorizontal.includes(Z)||(S.nodesInRelativeHorizontal.push(Z),S.nodeToRelativeConstraintMapHorizontal.set(Z,[]),S.dummyToNodeForVerticalAlignment.has(Z)?S.nodeToTempPositionMapHorizontal.set(Z,S.idToNodeMap.get(S.dummyToNodeForVerticalAlignment.get(Z)[0]).getCenterX()):S.nodeToTempPositionMapHorizontal.set(Z,S.idToNodeMap.get(Z).getCenterX())),S.nodesInRelativeHorizontal.includes(ee)||(S.nodesInRelativeHorizontal.push(ee),S.nodeToRelativeConstraintMapHorizontal.set(ee,[]),S.dummyToNodeForVerticalAlignment.has(ee)?S.nodeToTempPositionMapHorizontal.set(ee,S.idToNodeMap.get(S.dummyToNodeForVerticalAlignment.get(ee)[0]).getCenterX()):S.nodeToTempPositionMapHorizontal.set(ee,S.idToNodeMap.get(ee).getCenterX())),S.nodeToRelativeConstraintMapHorizontal.get(Z).push({right:ee,gap:J.gap}),S.nodeToRelativeConstraintMapHorizontal.get(ee).push({left:Z,gap:J.gap})}else{var ne=P.has(J.top)?P.get(J.top):J.top,ue=P.has(J.bottom)?P.get(J.bottom):J.bottom;S.nodesInRelativeVertical.includes(ne)||(S.nodesInRelativeVertical.push(ne),S.nodeToRelativeConstraintMapVertical.set(ne,[]),S.dummyToNodeForHorizontalAlignment.has(ne)?S.nodeToTempPositionMapVertical.set(ne,S.idToNodeMap.get(S.dummyToNodeForHorizontalAlignment.get(ne)[0]).getCenterY()):S.nodeToTempPositionMapVertical.set(ne,S.idToNodeMap.get(ne).getCenterY())),S.nodesInRelativeVertical.includes(ue)||(S.nodesInRelativeVertical.push(ue),S.nodeToRelativeConstraintMapVertical.set(ue,[]),S.dummyToNodeForHorizontalAlignment.has(ue)?S.nodeToTempPositionMapVertical.set(ue,S.idToNodeMap.get(S.dummyToNodeForHorizontalAlignment.get(ue)[0]).getCenterY()):S.nodeToTempPositionMapVertical.set(ue,S.idToNodeMap.get(ue).getCenterY())),S.nodeToRelativeConstraintMapVertical.get(ne).push({bottom:ue,gap:J.gap}),S.nodeToRelativeConstraintMapVertical.get(ue).push({top:ne,gap:J.gap})}});else{var Y=new Map,W=new Map;this.constraints.relativePlacementConstraint.forEach(function(J){if(J.left){var Z=B.has(J.left)?B.get(J.left):J.left,ee=B.has(J.right)?B.get(J.right):J.right;Y.has(Z)?Y.get(Z).push(ee):Y.set(Z,[ee]),Y.has(ee)?Y.get(ee).push(Z):Y.set(ee,[Z])}else{var ne=P.has(J.top)?P.get(J.top):J.top,ue=P.has(J.bottom)?P.get(J.bottom):J.bottom;W.has(ne)?W.get(ne).push(ue):W.set(ne,[ue]),W.has(ue)?W.get(ue).push(ne):W.set(ue,[ne])}});var ie=function(Z,ee){var ne=[],ue=[],fe=new M,_e=new Set,Ae=0;return Z.forEach(function(Ne,me){if(!_e.has(me)){ne[Ae]=[],ue[Ae]=!1;var ve=me;for(fe.push(ve),_e.add(ve),ne[Ae].push(ve);fe.length!=0;){ve=fe.shift(),ee.has(ve)&&(ue[Ae]=!0);var Ge=Z.get(ve);Ge.forEach(function(Te){_e.has(Te)||(fe.push(Te),_e.add(Te),ne[Ae].push(Te))})}Ae++}}),{components:ne,isFixed:ue}},K=ie(Y,S.fixedNodesOnHorizontal);this.componentsOnHorizontal=K.components,this.fixedComponentsOnHorizontal=K.isFixed;var se=ie(W,S.fixedNodesOnVertical);this.componentsOnVertical=se.components,this.fixedComponentsOnVertical=se.isFixed}}},z.prototype.updateDisplacements=function(){var S=this;if(this.constraints.fixedNodeConstraint&&this.constraints.fixedNodeConstraint.forEach(function(se){var J=S.idToNodeMap.get(se.nodeId);J.displacementX=0,J.displacementY=0}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var R=this.constraints.alignmentConstraint.vertical,N=0;N1){var P;for(P=0;PD&&(D=Math.floor(B.y)),$=Math.floor(B.x+m.DEFAULT_COMPONENT_SEPERATION)}this.transform(new w(T.WORLD_CENTER_X-B.x/2,T.WORLD_CENTER_Y-B.y/2))},z.radialLayout=function(S,R,N){var D=Math.max(this.maxDiagonalInTree(S),m.DEFAULT_RADIAL_SEPARATION);z.branchRadialLayout(R,null,0,359,0,D);var I=L.calculateBounds(S),$=new O;$.setDeviceOrgX(I.getMinX()),$.setDeviceOrgY(I.getMinY()),$.setWorldOrgX(N.x),$.setWorldOrgY(N.y);for(var B=0;B1;){var ee=Z[0];Z.splice(0,1);var ne=W.indexOf(ee);ne>=0&&W.splice(ne,1),se--,ie--}R!=null?J=(W.indexOf(Z[0])+1)%se:J=0;for(var ue=Math.abs(D-N)/ie,fe=J;K!=ie;fe=++fe%se){var _e=W[fe].getOtherEnd(S);if(_e!=R){var Ae=(N+K*ue)%360,Ne=(Ae+ue)%360;z.branchRadialLayout(_e,S,Ae,Ne,I+$,$),K++}}},z.maxDiagonalInTree=function(S){for(var R=C.MIN_VALUE,N=0;NR&&(R=I)}return R},z.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},z.prototype.groupZeroDegreeMembers=function(){var S=this,R={};this.memberGroups={},this.idToDummyNode={};for(var N=[],D=this.graphManager.getAllNodes(),I=0;I"u"&&(R[P]=[]),R[P]=R[P].concat($)}Object.keys(R).forEach(function(G){if(R[G].length>1){var V="DummyCompound_"+G;S.memberGroups[V]=R[G];var Y=R[G][0].getParent(),W=new p(S.graphManager);W.id=V,W.paddingLeft=Y.paddingLeft||0,W.paddingRight=Y.paddingRight||0,W.paddingBottom=Y.paddingBottom||0,W.paddingTop=Y.paddingTop||0,S.idToDummyNode[V]=W;var ie=S.getGraphManager().add(S.newGraph(),W),K=Y.getChild();K.add(W);for(var se=0;seI?(D.rect.x-=(D.labelWidth-I)/2,D.setWidth(D.labelWidth),D.labelMarginLeft=(D.labelWidth-I)/2):D.labelPosHorizontal=="right"&&D.setWidth(I+D.labelWidth)),D.labelHeight&&(D.labelPosVertical=="top"?(D.rect.y-=D.labelHeight,D.setHeight($+D.labelHeight),D.labelMarginTop=D.labelHeight):D.labelPosVertical=="center"&&D.labelHeight>$?(D.rect.y-=(D.labelHeight-$)/2,D.setHeight(D.labelHeight),D.labelMarginTop=(D.labelHeight-$)/2):D.labelPosVertical=="bottom"&&D.setHeight($+D.labelHeight))}})},z.prototype.repopulateCompounds=function(){for(var S=this.compoundOrder.length-1;S>=0;S--){var R=this.compoundOrder[S],N=R.id,D=R.paddingLeft,I=R.paddingTop,$=R.labelMarginLeft,B=R.labelMarginTop;this.adjustLocations(this.tiledMemberPack[N],R.rect.x,R.rect.y,D,I,$,B)}},z.prototype.repopulateZeroDegreeMembers=function(){var S=this,R=this.tiledZeroDegreePack;Object.keys(R).forEach(function(N){var D=S.idToDummyNode[N],I=D.paddingLeft,$=D.paddingTop,B=D.labelMarginLeft,P=D.labelMarginTop;S.adjustLocations(R[N],D.rect.x,D.rect.y,I,$,B,P)})},z.prototype.getToBeTiled=function(S){var R=S.id;if(this.toBeTiled[R]!=null)return this.toBeTiled[R];var N=S.getChild();if(N==null)return this.toBeTiled[R]=!1,!1;for(var D=N.getNodes(),I=0;I0)return this.toBeTiled[R]=!1,!1;if($.getChild()==null){this.toBeTiled[$.id]=!1;continue}if(!this.getToBeTiled($))return this.toBeTiled[R]=!1,!1}return this.toBeTiled[R]=!0,!0},z.prototype.getNodeDegree=function(S){S.id;for(var R=S.getEdges(),N=0,D=0;DY&&(Y=ie.rect.height)}N+=Y+S.verticalPadding}},z.prototype.tileCompoundMembers=function(S,R){var N=this;this.tiledMemberPack=[],Object.keys(S).forEach(function(D){var I=R[D];if(N.tiledMemberPack[D]=N.tileNodes(S[D],I.paddingLeft+I.paddingRight),I.rect.width=N.tiledMemberPack[D].width,I.rect.height=N.tiledMemberPack[D].height,I.setCenter(N.tiledMemberPack[D].centerX,N.tiledMemberPack[D].centerY),I.labelMarginLeft=0,I.labelMarginTop=0,m.NODE_DIMENSIONS_INCLUDE_LABELS){var $=I.rect.width,B=I.rect.height;I.labelWidth&&(I.labelPosHorizontal=="left"?(I.rect.x-=I.labelWidth,I.setWidth($+I.labelWidth),I.labelMarginLeft=I.labelWidth):I.labelPosHorizontal=="center"&&I.labelWidth>$?(I.rect.x-=(I.labelWidth-$)/2,I.setWidth(I.labelWidth),I.labelMarginLeft=(I.labelWidth-$)/2):I.labelPosHorizontal=="right"&&I.setWidth($+I.labelWidth)),I.labelHeight&&(I.labelPosVertical=="top"?(I.rect.y-=I.labelHeight,I.setHeight(B+I.labelHeight),I.labelMarginTop=I.labelHeight):I.labelPosVertical=="center"&&I.labelHeight>B?(I.rect.y-=(I.labelHeight-B)/2,I.setHeight(I.labelHeight),I.labelMarginTop=(I.labelHeight-B)/2):I.labelPosVertical=="bottom"&&I.setHeight(B+I.labelHeight))}})},z.prototype.tileNodes=function(S,R){var N=this.tileNodesByFavoringDim(S,R,!0),D=this.tileNodesByFavoringDim(S,R,!1),I=this.getOrgRatio(N),$=this.getOrgRatio(D),B;return $P&&(P=se.getWidth())});var G=$/I,V=B/I,Y=Math.pow(N-D,2)+4*(G+D)*(V+N)*I,W=(D-N+Math.sqrt(Y))/(2*(G+D)),ie;R?(ie=Math.ceil(W),ie==W&&ie++):ie=Math.floor(W);var K=ie*(G+D)-D;return P>K&&(K=P),K+=D*2,K},z.prototype.tileNodesByFavoringDim=function(S,R,N){var D=m.TILING_PADDING_VERTICAL,I=m.TILING_PADDING_HORIZONTAL,$=m.TILING_COMPARE_BY,B={rows:[],rowWidth:[],rowHeight:[],width:0,height:R,verticalPadding:D,horizontalPadding:I,centerX:0,centerY:0};$&&(B.idealRowWidth=this.calcIdealRowWidth(S,N));var P=function(J){return J.rect.width*J.rect.height},G=function(J,Z){return P(Z)-P(J)};S.sort(function(se,J){var Z=G;return B.idealRowWidth?(Z=$,Z(se.id,J.id)):Z(se,J)});for(var V=0,Y=0,W=0;W0&&(B+=S.horizontalPadding),S.rowWidth[N]=B,S.width0&&(P+=S.verticalPadding);var G=0;P>S.rowHeight[N]&&(G=S.rowHeight[N],S.rowHeight[N]=P,G=S.rowHeight[N]-G),S.height+=G,S.rows[N].push(R)},z.prototype.getShortestRowIndex=function(S){for(var R=-1,N=Number.MAX_VALUE,D=0;DN&&(R=D,N=S.rowWidth[D]);return R},z.prototype.canAddHorizontal=function(S,R,N){if(S.idealRowWidth){var D=S.rows.length-1,I=S.rowWidth[D];return I+R+S.horizontalPadding<=S.idealRowWidth}var $=this.getShortestRowIndex(S);if($<0)return!0;var B=S.rowWidth[$];if(B+S.horizontalPadding+R<=S.width)return!0;var P=0;S.rowHeight[$]0&&(P=N+S.verticalPadding-S.rowHeight[$]);var G;S.width-B>=R+S.horizontalPadding?G=(S.height+P)/(B+R+S.horizontalPadding):G=(S.height+P)/S.width,P=N+S.verticalPadding;var V;return S.width$&&R!=N){D.splice(-1,1),S.rows[N].push(I),S.rowWidth[R]=S.rowWidth[R]-$,S.rowWidth[N]=S.rowWidth[N]+$,S.width=S.rowWidth[instance.getLongestRowIndex(S)];for(var B=Number.MIN_VALUE,P=0;PB&&(B=D[P].height);R>0&&(B+=S.verticalPadding);var G=S.rowHeight[R]+S.rowHeight[N];S.rowHeight[R]=B,S.rowHeight[N]0)for(var K=I;K<=$;K++)ie[0]+=this.grid[K][B-1].length+this.grid[K][B].length-1;if($0)for(var K=B;K<=P;K++)ie[3]+=this.grid[I-1][K].length+this.grid[I][K].length-1;for(var se=C.MAX_VALUE,J,Z,ee=0;ee{var h=u(551).FDLayoutNode,d=u(551).IMath;function f(g,m,y,v){h.call(this,g,m,y,v)}f.prototype=Object.create(h.prototype);for(var p in h)f[p]=h[p];f.prototype.calculateDisplacement=function(){var g=this.graphManager.getLayout();this.getChild()!=null&&this.fixedNodeWeight?(this.displacementX+=g.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.fixedNodeWeight,this.displacementY+=g.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.fixedNodeWeight):(this.displacementX+=g.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY+=g.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren),Math.abs(this.displacementX)>g.coolingFactor*g.maxNodeDisplacement&&(this.displacementX=g.coolingFactor*g.maxNodeDisplacement*d.sign(this.displacementX)),Math.abs(this.displacementY)>g.coolingFactor*g.maxNodeDisplacement&&(this.displacementY=g.coolingFactor*g.maxNodeDisplacement*d.sign(this.displacementY)),this.child&&this.child.getNodes().length>0&&this.propogateDisplacementToChildren(this.displacementX,this.displacementY)},f.prototype.propogateDisplacementToChildren=function(g,m){for(var y=this.getChild().getNodes(),v,T=0;T{function h(y){if(Array.isArray(y)){for(var v=0,T=Array(y.length);v0){var Et=0;be.forEach(function(ot){pe=="horizontal"?(qe.set(ot,b.has(ot)?w[b.get(ot)]:Be.get(ot)),Et+=qe.get(ot)):(qe.set(ot,b.has(ot)?k[b.get(ot)]:Be.get(ot)),Et+=qe.get(ot))}),Et=Et/be.length,lt.forEach(function(ot){re.has(ot)||qe.set(ot,Et)})}else{var vt=0;lt.forEach(function(ot){pe=="horizontal"?vt+=b.has(ot)?w[b.get(ot)]:Be.get(ot):vt+=b.has(ot)?k[b.get(ot)]:Be.get(ot)}),vt=vt/lt.length,lt.forEach(function(ot){qe.set(ot,vt)})}});for(var Ie=function(){var be=Xe.shift(),Et=j.get(be);Et.forEach(function(vt){if(qe.get(vt.id)ot&&(ot=wt),MrIt&&(It=Mr)}}catch(_r){ht=!0,oe=_r}finally{try{!xt&&At.return&&At.return()}finally{if(ht)throw oe}}var ye=(Et+ot)/2-(vt+It)/2,et=!0,ct=!1,_t=void 0;try{for(var Ft=lt[Symbol.iterator](),nr;!(et=(nr=Ft.next()).done);et=!0){var ir=nr.value;qe.set(ir,qe.get(ir)+ye)}}catch(_r){ct=!0,_t=_r}finally{try{!et&&Ft.return&&Ft.return()}finally{if(ct)throw _t}}})}return qe},F=function(j){var pe=0,re=0,Be=0,xe=0;if(j.forEach(function(Le){Le.left?w[b.get(Le.left)]-w[b.get(Le.right)]>=0?pe++:re++:k[b.get(Le.top)]-k[b.get(Le.bottom)]>=0?Be++:xe++}),pe>re&&Be>xe)for(var Ue=0;Uere)for(var De=0;Dexe)for(var qe=0;qe1)v.fixedNodeConstraint.forEach(function(he,j){D[j]=[he.position.x,he.position.y],I[j]=[w[b.get(he.nodeId)],k[b.get(he.nodeId)]]}),$=!0;else if(v.alignmentConstraint)(function(){var he=0;if(v.alignmentConstraint.vertical){for(var j=v.alignmentConstraint.vertical,pe=function(qe){var Le=new Set;j[qe].forEach(function(it){Le.add(it)});var Xe=new Set([].concat(h(Le)).filter(function(it){return P.has(it)})),Ie=void 0;Xe.size>0?Ie=w[b.get(Xe.values().next().value)]:Ie=M(Le).x,j[qe].forEach(function(it){D[he]=[Ie,k[b.get(it)]],I[he]=[w[b.get(it)],k[b.get(it)]],he++})},re=0;re0?Ie=w[b.get(Xe.values().next().value)]:Ie=M(Le).y,Be[qe].forEach(function(it){D[he]=[w[b.get(it)],Ie],I[he]=[w[b.get(it)],k[b.get(it)]],he++})},Ue=0;UeW&&(W=Y[K].length,ie=K);if(W0){var ke={x:0,y:0};v.fixedNodeConstraint.forEach(function(he,j){var pe={x:w[b.get(he.nodeId)],y:k[b.get(he.nodeId)]},re=he.position,Be=O(re,pe);ke.x+=Be.x,ke.y+=Be.y}),ke.x/=v.fixedNodeConstraint.length,ke.y/=v.fixedNodeConstraint.length,w.forEach(function(he,j){w[j]+=ke.x}),k.forEach(function(he,j){k[j]+=ke.y}),v.fixedNodeConstraint.forEach(function(he){w[b.get(he.nodeId)]=he.position.x,k[b.get(he.nodeId)]=he.position.y})}if(v.alignmentConstraint){if(v.alignmentConstraint.vertical)for(var Ve=v.alignmentConstraint.vertical,Qe=function(j){var pe=new Set;Ve[j].forEach(function(xe){pe.add(xe)});var re=new Set([].concat(h(pe)).filter(function(xe){return P.has(xe)})),Be=void 0;re.size>0?Be=w[b.get(re.values().next().value)]:Be=M(pe).x,pe.forEach(function(xe){P.has(xe)||(w[b.get(xe)]=Be)})},nt=0;nt0?Be=k[b.get(re.values().next().value)]:Be=M(pe).y,pe.forEach(function(xe){P.has(xe)||(k[b.get(xe)]=Be)})},Ce=0;Ce{o.exports=r})},i={};function a(o){var l=i[o];if(l!==void 0)return l.exports;var u=i[o]={exports:{}};return n[o](u,u.exports,a),u.exports}var s=a(45);return s})()})})(YS)),YS.exports}var mpt=HS.exports,gye;function ypt(){return gye||(gye=1,(function(t,e){(function(n,i){t.exports=i(gpt())})(mpt,function(r){return(()=>{var n={658:(o=>{o.exports=Object.assign!=null?Object.assign.bind(Object):function(l){for(var u=arguments.length,h=Array(u>1?u-1:0),d=1;d{var h=(function(){function p(g,m){var y=[],v=!0,T=!1,b=void 0;try{for(var w=g[Symbol.iterator](),k;!(v=(k=w.next()).done)&&(y.push(k.value),!(m&&y.length===m));v=!0);}catch(A){T=!0,b=A}finally{try{!v&&w.return&&w.return()}finally{if(T)throw b}}return y}return function(g,m){if(Array.isArray(g))return g;if(Symbol.iterator in Object(g))return p(g,m);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),d=u(140).layoutBase.LinkedList,f={};f.getTopMostNodes=function(p){for(var g={},m=0;m0&&$.merge(V)});for(var B=0;B<$.length;B++){var P=$[B];if(w=m.intersection(P.union(P.ancestors())),w!=null&&!T.has(w[0])){var G=w.union(w.descendants());G.forEach(function(V){v.push(V),T.add(V),F.merge(V),m.has(V)&&b.push(V)})}}};v.length!=0;)N();if(F.forEach(function(I){g.intersection(I.connectedEdges()).forEach(function($){F.has($.source())&&F.has($.target())&&F.merge($)})}),b.length==m.length&&(C=!0),!C||C&&_>1){k=b[0],A=k.connectedEdges().length,b.forEach(function(I){I.connectedEdges().length0&&y.set("dummy"+(y.size+1),L),O},f.relocateComponent=function(p,g,m){if(!m.fixedNodeConstraint){var y=Number.POSITIVE_INFINITY,v=Number.NEGATIVE_INFINITY,T=Number.POSITIVE_INFINITY,b=Number.NEGATIVE_INFINITY;if(m.quality=="draft"){var w=!0,k=!1,A=void 0;try{for(var C=g.nodeIndexes[Symbol.iterator](),_;!(w=(_=C.next()).done);w=!0){var L=_.value,O=h(L,2),M=O[0],z=O[1],F=m.cy.getElementById(M);if(F){var S=F.boundingBox(),R=g.xCoords[z]-S.w/2,N=g.xCoords[z]+S.w/2,D=g.yCoords[z]-S.h/2,I=g.yCoords[z]+S.h/2;Rv&&(v=N),Db&&(b=I)}}}catch(V){k=!0,A=V}finally{try{!w&&C.return&&C.return()}finally{if(k)throw A}}var $=p.x-(v+y)/2,B=p.y-(b+T)/2;g.xCoords=g.xCoords.map(function(V){return V+$}),g.yCoords=g.yCoords.map(function(V){return V+B})}else{Object.keys(g).forEach(function(V){var Y=g[V],W=Y.getRect().x,ie=Y.getRect().x+Y.getRect().width,K=Y.getRect().y,se=Y.getRect().y+Y.getRect().height;Wv&&(v=ie),Kb&&(b=se)});var P=p.x-(v+y)/2,G=p.y-(b+T)/2;Object.keys(g).forEach(function(V){var Y=g[V];Y.setCenter(Y.getCenterX()+P,Y.getCenterY()+G)})}}},f.calcBoundingBox=function(p,g,m,y){for(var v=Number.MAX_SAFE_INTEGER,T=Number.MIN_SAFE_INTEGER,b=Number.MAX_SAFE_INTEGER,w=Number.MIN_SAFE_INTEGER,k=void 0,A=void 0,C=void 0,_=void 0,L=p.descendants().not(":parent"),O=L.length,M=0;Mk&&(v=k),TC&&(b=C),w<_&&(w=_)}var F={};return F.topLeftX=v,F.topLeftY=b,F.width=T-v,F.height=w-b,F},f.calcParentsWithoutChildren=function(p,g){var m=p.collection();return g.nodes(":parent").forEach(function(y){var v=!1;y.children().forEach(function(T){T.css("display")!="none"&&(v=!0)}),v||m.merge(y)}),m},o.exports=f}),816:((o,l,u)=>{var h=u(548),d=u(140).CoSELayout,f=u(140).CoSENode,p=u(140).layoutBase.PointD,g=u(140).layoutBase.DimensionD,m=u(140).layoutBase.LayoutConstants,y=u(140).layoutBase.FDLayoutConstants,v=u(140).CoSEConstants,T=function(w,k){var A=w.cy,C=w.eles,_=C.nodes(),L=C.edges(),O=void 0,M=void 0,z=void 0,F={};w.randomize&&(O=k.nodeIndexes,M=k.xCoords,z=k.yCoords);var S=function(V){return typeof V=="function"},R=function(V,Y){return S(V)?V(Y):V},N=h.calcParentsWithoutChildren(A,C),D=function G(V,Y,W,ie){for(var K=Y.length,se=0;se0){var fe=void 0;fe=W.getGraphManager().add(W.newGraph(),ee),G(fe,Z,W,ie)}}},I=function(V,Y,W){for(var ie=0,K=0,se=0;se0?v.DEFAULT_EDGE_LENGTH=y.DEFAULT_EDGE_LENGTH=ie/K:S(w.idealEdgeLength)?v.DEFAULT_EDGE_LENGTH=y.DEFAULT_EDGE_LENGTH=50:v.DEFAULT_EDGE_LENGTH=y.DEFAULT_EDGE_LENGTH=w.idealEdgeLength,v.MIN_REPULSION_DIST=y.MIN_REPULSION_DIST=y.DEFAULT_EDGE_LENGTH/10,v.DEFAULT_RADIAL_SEPARATION=y.DEFAULT_EDGE_LENGTH)},$=function(V,Y){Y.fixedNodeConstraint&&(V.constraints.fixedNodeConstraint=Y.fixedNodeConstraint),Y.alignmentConstraint&&(V.constraints.alignmentConstraint=Y.alignmentConstraint),Y.relativePlacementConstraint&&(V.constraints.relativePlacementConstraint=Y.relativePlacementConstraint)};w.nestingFactor!=null&&(v.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=y.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=w.nestingFactor),w.gravity!=null&&(v.DEFAULT_GRAVITY_STRENGTH=y.DEFAULT_GRAVITY_STRENGTH=w.gravity),w.numIter!=null&&(v.MAX_ITERATIONS=y.MAX_ITERATIONS=w.numIter),w.gravityRange!=null&&(v.DEFAULT_GRAVITY_RANGE_FACTOR=y.DEFAULT_GRAVITY_RANGE_FACTOR=w.gravityRange),w.gravityCompound!=null&&(v.DEFAULT_COMPOUND_GRAVITY_STRENGTH=y.DEFAULT_COMPOUND_GRAVITY_STRENGTH=w.gravityCompound),w.gravityRangeCompound!=null&&(v.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=y.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=w.gravityRangeCompound),w.initialEnergyOnIncremental!=null&&(v.DEFAULT_COOLING_FACTOR_INCREMENTAL=y.DEFAULT_COOLING_FACTOR_INCREMENTAL=w.initialEnergyOnIncremental),w.tilingCompareBy!=null&&(v.TILING_COMPARE_BY=w.tilingCompareBy),w.quality=="proof"?m.QUALITY=2:m.QUALITY=0,v.NODE_DIMENSIONS_INCLUDE_LABELS=y.NODE_DIMENSIONS_INCLUDE_LABELS=m.NODE_DIMENSIONS_INCLUDE_LABELS=w.nodeDimensionsIncludeLabels,v.DEFAULT_INCREMENTAL=y.DEFAULT_INCREMENTAL=m.DEFAULT_INCREMENTAL=!w.randomize,v.ANIMATE=y.ANIMATE=m.ANIMATE=w.animate,v.TILE=w.tile,v.TILING_PADDING_VERTICAL=typeof w.tilingPaddingVertical=="function"?w.tilingPaddingVertical.call():w.tilingPaddingVertical,v.TILING_PADDING_HORIZONTAL=typeof w.tilingPaddingHorizontal=="function"?w.tilingPaddingHorizontal.call():w.tilingPaddingHorizontal,v.DEFAULT_INCREMENTAL=y.DEFAULT_INCREMENTAL=m.DEFAULT_INCREMENTAL=!0,v.PURE_INCREMENTAL=!w.randomize,m.DEFAULT_UNIFORM_LEAF_NODE_SIZES=w.uniformNodeDimensions,w.step=="transformed"&&(v.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,v.ENFORCE_CONSTRAINTS=!1,v.APPLY_LAYOUT=!1),w.step=="enforced"&&(v.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,v.ENFORCE_CONSTRAINTS=!0,v.APPLY_LAYOUT=!1),w.step=="cose"&&(v.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,v.ENFORCE_CONSTRAINTS=!1,v.APPLY_LAYOUT=!0),w.step=="all"&&(w.randomize?v.TRANSFORM_ON_CONSTRAINT_HANDLING=!0:v.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,v.ENFORCE_CONSTRAINTS=!0,v.APPLY_LAYOUT=!0),w.fixedNodeConstraint||w.alignmentConstraint||w.relativePlacementConstraint?v.TREE_REDUCTION_ON_INCREMENTAL=!1:v.TREE_REDUCTION_ON_INCREMENTAL=!0;var B=new d,P=B.newGraphManager();return D(P.addRoot(),h.getTopMostNodes(_),B,w),I(B,P,L),$(B,w),B.runLayout(),F};o.exports={coseLayout:T}}),212:((o,l,u)=>{var h=(function(){function w(k,A){for(var C=0;C0)if(N){var $=p.getTopMostNodes(C.eles.nodes());if(z=p.connectComponents(_,C.eles,$),z.forEach(function(Ne){var me=Ne.boundingBox();F.push({x:me.x1+me.w/2,y:me.y1+me.h/2})}),C.randomize&&z.forEach(function(Ne){C.eles=Ne,O.push(m(C))}),C.quality=="default"||C.quality=="proof"){var B=_.collection();if(C.tile){var P=new Map,G=[],V=[],Y=0,W={nodeIndexes:P,xCoords:G,yCoords:V},ie=[];if(z.forEach(function(Ne,me){Ne.edges().length==0&&(Ne.nodes().forEach(function(ve,Ge){B.merge(Ne.nodes()[Ge]),ve.isParent()||(W.nodeIndexes.set(Ne.nodes()[Ge].id(),Y++),W.xCoords.push(Ne.nodes()[0].position().x),W.yCoords.push(Ne.nodes()[0].position().y))}),ie.push(me))}),B.length>1){var K=B.boundingBox();F.push({x:K.x1+K.w/2,y:K.y1+K.h/2}),z.push(B),O.push(W);for(var se=ie.length-1;se>=0;se--)z.splice(ie[se],1),O.splice(ie[se],1),F.splice(ie[se],1)}}z.forEach(function(Ne,me){C.eles=Ne,M.push(v(C,O[me])),p.relocateComponent(F[me],M[me],C)})}else z.forEach(function(Ne,me){p.relocateComponent(F[me],O[me],C)});var J=new Set;if(z.length>1){var Z=[],ee=L.filter(function(Ne){return Ne.css("display")=="none"});z.forEach(function(Ne,me){var ve=void 0;if(C.quality=="draft"&&(ve=O[me].nodeIndexes),Ne.nodes().not(ee).length>0){var Ge={};Ge.edges=[],Ge.nodes=[];var Te=void 0;Ne.nodes().not(ee).forEach(function(Ze){if(C.quality=="draft")if(!Ze.isParent())Te=ve.get(Ze.id()),Ge.nodes.push({x:O[me].xCoords[Te]-Ze.boundingbox().w/2,y:O[me].yCoords[Te]-Ze.boundingbox().h/2,width:Ze.boundingbox().w,height:Ze.boundingbox().h});else{var ke=p.calcBoundingBox(Ze,O[me].xCoords,O[me].yCoords,ve);Ge.nodes.push({x:ke.topLeftX,y:ke.topLeftY,width:ke.width,height:ke.height})}else M[me][Ze.id()]&&Ge.nodes.push({x:M[me][Ze.id()].getLeft(),y:M[me][Ze.id()].getTop(),width:M[me][Ze.id()].getWidth(),height:M[me][Ze.id()].getHeight()})}),Ne.edges().forEach(function(Ze){var ke=Ze.source(),Ve=Ze.target();if(ke.css("display")!="none"&&Ve.css("display")!="none")if(C.quality=="draft"){var Qe=ve.get(ke.id()),nt=ve.get(Ve.id()),tt=[],je=[];if(ke.isParent()){var Ce=p.calcBoundingBox(ke,O[me].xCoords,O[me].yCoords,ve);tt.push(Ce.topLeftX+Ce.width/2),tt.push(Ce.topLeftY+Ce.height/2)}else tt.push(O[me].xCoords[Qe]),tt.push(O[me].yCoords[Qe]);if(Ve.isParent()){var Se=p.calcBoundingBox(Ve,O[me].xCoords,O[me].yCoords,ve);je.push(Se.topLeftX+Se.width/2),je.push(Se.topLeftY+Se.height/2)}else je.push(O[me].xCoords[nt]),je.push(O[me].yCoords[nt]);Ge.edges.push({startX:tt[0],startY:tt[1],endX:je[0],endY:je[1]})}else M[me][ke.id()]&&M[me][Ve.id()]&&Ge.edges.push({startX:M[me][ke.id()].getCenterX(),startY:M[me][ke.id()].getCenterY(),endX:M[me][Ve.id()].getCenterX(),endY:M[me][Ve.id()].getCenterY()})}),Ge.nodes.length>0&&(Z.push(Ge),J.add(me))}});var ne=R.packComponents(Z,C.randomize).shifts;if(C.quality=="draft")O.forEach(function(Ne,me){var ve=Ne.xCoords.map(function(Te){return Te+ne[me].dx}),Ge=Ne.yCoords.map(function(Te){return Te+ne[me].dy});Ne.xCoords=ve,Ne.yCoords=Ge});else{var ue=0;J.forEach(function(Ne){Object.keys(M[Ne]).forEach(function(me){var ve=M[Ne][me];ve.setCenter(ve.getCenterX()+ne[ue].dx,ve.getCenterY()+ne[ue].dy)}),ue++})}}}else{var D=C.eles.boundingBox();if(F.push({x:D.x1+D.w/2,y:D.y1+D.h/2}),C.randomize){var I=m(C);O.push(I)}C.quality=="default"||C.quality=="proof"?(M.push(v(C,O[0])),p.relocateComponent(F[0],M[0],C)):p.relocateComponent(F[0],O[0],C)}var fe=function(me,ve){if(C.quality=="default"||C.quality=="proof"){typeof me=="number"&&(me=ve);var Ge=void 0,Te=void 0,Ze=me.data("id");return M.forEach(function(Ve){Ze in Ve&&(Ge={x:Ve[Ze].getRect().getCenterX(),y:Ve[Ze].getRect().getCenterY()},Te=Ve[Ze])}),C.nodeDimensionsIncludeLabels&&(Te.labelWidth&&(Te.labelPosHorizontal=="left"?Ge.x+=Te.labelWidth/2:Te.labelPosHorizontal=="right"&&(Ge.x-=Te.labelWidth/2)),Te.labelHeight&&(Te.labelPosVertical=="top"?Ge.y+=Te.labelHeight/2:Te.labelPosVertical=="bottom"&&(Ge.y-=Te.labelHeight/2))),Ge==null&&(Ge={x:me.position("x"),y:me.position("y")}),{x:Ge.x,y:Ge.y}}else{var ke=void 0;return O.forEach(function(Ve){var Qe=Ve.nodeIndexes.get(me.id());Qe!=null&&(ke={x:Ve.xCoords[Qe],y:Ve.yCoords[Qe]})}),ke==null&&(ke={x:me.position("x"),y:me.position("y")}),{x:ke.x,y:ke.y}}};if(C.quality=="default"||C.quality=="proof"||C.randomize){var _e=p.calcParentsWithoutChildren(_,L),Ae=L.filter(function(Ne){return Ne.css("display")=="none"});C.eles=L.not(Ae),L.nodes().not(":parent").not(Ae).layoutPositions(A,C,fe),_e.length>0&&_e.forEach(function(Ne){Ne.position(fe(Ne))})}else console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'.")}}]),w})();o.exports=b}),657:((o,l,u)=>{var h=u(548),d=u(140).layoutBase.Matrix,f=u(140).layoutBase.SVD,p=function(m){var y=m.cy,v=m.eles,T=v.nodes(),b=v.nodes(":parent"),w=new Map,k=new Map,A=new Map,C=[],_=[],L=[],O=[],M=[],z=[],F=[],S=[],R=void 0,N=1e8,D=1e-9,I=m.piTol,$=m.samplingType,B=m.nodeSeparation,P=void 0,G=function(){for(var j=0,pe=0,re=!1;pe=xe;){De=Be[xe++];for(var we=C[De],lt=0;ltXe&&(Xe=M[Et],Ie=Et)}return Ie},Y=function(j){var pe=void 0;if(j){pe=Math.floor(Math.random()*R);for(var Be=0;Be=1)break;Le=qe}for(var it=0;it=1)break;Le=qe}for(var lt=0;lt0&&(pe.isParent()?C[j].push(A.get(pe.id())):C[j].push(pe.id()))})});var Ae=function(j){var pe=k.get(j),re=void 0;w.get(j).forEach(function(Be){y.getElementById(Be).isParent()?re=A.get(Be):re=Be,C[pe].push(re),C[k.get(re)].push(j)})},Ne=!0,me=!1,ve=void 0;try{for(var Ge=w.keys()[Symbol.iterator](),Te;!(Ne=(Te=Ge.next()).done);Ne=!0){var Ze=Te.value;Ae(Ze)}}catch(he){me=!0,ve=he}finally{try{!Ne&&Ge.return&&Ge.return()}finally{if(me)throw ve}}R=k.size;var ke=void 0;if(R>2){P=R{var h=u(212),d=function(p){p&&p("layout","fcose",h)};typeof cytoscape<"u"&&d(cytoscape),o.exports=d}),140:(o=>{o.exports=r})},i={};function a(o){var l=i[o];if(l!==void 0)return l.exports;var u=i[o]={exports:{}};return n[o](u,u.exports,a),u.exports}var s=a(579);return s})()})})(HS)),HS.exports}var vpt=ypt();const bpt=Os(vpt);var mye={L:"left",R:"right",T:"top",B:"bottom"},yye={L:x(t=>`${t},${t/2} 0,${t} 0,0`,"L"),R:x(t=>`0,${t/2} ${t},0 ${t},${t}`,"R"),T:x(t=>`0,0 ${t},0 ${t/2},${t}`,"T"),B:x(t=>`${t/2},0 ${t},${t} 0,${t}`,"B")},KS={L:x((t,e)=>t-e+2,"L"),R:x((t,e)=>t-2,"R"),T:x((t,e)=>t-e+2,"T"),B:x((t,e)=>t-2,"B")},xpt=x(function(t){return fs(t)?t==="L"?"R":"L":t==="T"?"B":"T"},"getOppositeArchitectureDirection"),vye=x(function(t){const e=t;return e==="L"||e==="R"||e==="T"||e==="B"},"isArchitectureDirection"),fs=x(function(t){const e=t;return e==="L"||e==="R"},"isArchitectureDirectionX"),Oh=x(function(t){const e=t;return e==="T"||e==="B"},"isArchitectureDirectionY"),pP=x(function(t,e){const r=fs(t)&&Oh(e),n=Oh(t)&&fs(e);return r||n},"isArchitectureDirectionXY"),Tpt=x(function(t){const e=t[0],r=t[1],n=fs(e)&&Oh(r),i=Oh(e)&&fs(r);return n||i},"isArchitecturePairXY"),wpt=x(function(t){return t!=="LL"&&t!=="RR"&&t!=="TT"&&t!=="BB"},"isValidArchitectureDirectionPair"),gP=x(function(t,e){const r=`${t}${e}`;return wpt(r)?r:void 0},"getArchitectureDirectionPair"),Cpt=x(function([t,e],r){const n=r[0],i=r[1];return fs(n)?Oh(i)?[t+(n==="L"?-1:1),e+(i==="T"?1:-1)]:[t+(n==="L"?-1:1),e]:fs(i)?[t+(i==="L"?1:-1),e+(n==="T"?1:-1)]:[t,e+(n==="T"?1:-1)]},"shiftPositionByArchitectureDirectionPair"),kpt=x(function(t){return t==="LT"||t==="TL"?[1,1]:t==="BL"||t==="LB"?[1,-1]:t==="BR"||t==="RB"?[-1,-1]:[-1,1]},"getArchitectureDirectionXYFactors"),Ept=x(function(t,e){return pP(t,e)?"bend":fs(t)?"horizontal":"vertical"},"getArchitectureDirectionAlignment"),Spt=x(function(t){return t.type==="service"},"isArchitectureService"),Apt=x(function(t){return t.type==="junction"},"isArchitectureJunction"),bye=x(t=>t.data(),"edgeData"),lm=x(t=>t.data(),"nodeData"),_pt=Fr.architecture,xye=(Hv=class{constructor(){this.nodes={},this.groups={},this.edges=[],this.registeredIds={},this.elements={},this.diagramId="",this.setAccTitle=Dn,this.getAccTitle=Fn,this.setDiagramTitle=qn,this.getDiagramTitle=Mn,this.getAccDescription=Gn,this.setAccDescription=zn,this.clear()}setDiagramId(e){this.diagramId=e}getDiagramId(){return this.diagramId}clear(){this.nodes={},this.groups={},this.edges=[],this.registeredIds={},this.dataStructures=void 0,this.elements={},this.diagramId="",In()}addService({id:e,icon:r,in:n,title:i,iconText:a}){if(this.registeredIds[e]!==void 0)throw new Error(`The service id [${e}] is already in use by another ${this.registeredIds[e]}`);if(n!==void 0){if(e===n)throw new Error(`The service [${e}] cannot be placed within itself`);if(this.registeredIds[n]===void 0)throw new Error(`The service [${e}]'s parent does not exist. Please make sure the parent is created before this service`);if(this.registeredIds[n]==="node")throw new Error(`The service [${e}]'s parent is not a group`)}this.registeredIds[e]="node",this.nodes[e]={id:e,type:"service",icon:r,iconText:a,title:i,edges:[],in:n}}getServices(){return Object.values(this.nodes).filter(Spt)}addJunction({id:e,in:r}){if(this.registeredIds[e]!==void 0)throw new Error(`The junction id [${e}] is already in use by another ${this.registeredIds[e]}`);if(r!==void 0){if(e===r)throw new Error(`The junction [${e}] cannot be placed within itself`);if(this.registeredIds[r]===void 0)throw new Error(`The junction [${e}]'s parent does not exist. Please make sure the parent is created before this junction`);if(this.registeredIds[r]==="node")throw new Error(`The junction [${e}]'s parent is not a group`)}this.registeredIds[e]="node",this.nodes[e]={id:e,type:"junction",edges:[],in:r}}getJunctions(){return Object.values(this.nodes).filter(Apt)}getNodes(){return Object.values(this.nodes)}getNode(e){return this.nodes[e]??null}addGroup({id:e,icon:r,in:n,title:i}){var a,s,o;if(((a=this.registeredIds)==null?void 0:a[e])!==void 0)throw new Error(`The group id [${e}] is already in use by another ${this.registeredIds[e]}`);if(n!==void 0){if(e===n)throw new Error(`The group [${e}] cannot be placed within itself`);if(((s=this.registeredIds)==null?void 0:s[n])===void 0)throw new Error(`The group [${e}]'s parent does not exist. Please make sure the parent is created before this group`);if(((o=this.registeredIds)==null?void 0:o[n])==="node")throw new Error(`The group [${e}]'s parent is not a group`)}this.registeredIds[e]="group",this.groups[e]={id:e,icon:r,title:i,in:n}}getGroups(){return Object.values(this.groups)}addEdge({lhsId:e,rhsId:r,lhsDir:n,rhsDir:i,lhsInto:a,rhsInto:s,lhsGroup:o,rhsGroup:l,title:u}){if(!vye(n))throw new Error(`Invalid direction given for left hand side of edge ${e}--${r}. Expected (L,R,T,B) got ${String(n)}`);if(!vye(i))throw new Error(`Invalid direction given for right hand side of edge ${e}--${r}. Expected (L,R,T,B) got ${String(i)}`);if(this.nodes[e]===void 0&&this.groups[e]===void 0)throw new Error(`The left-hand id [${e}] does not yet exist. Please create the service/group before declaring an edge to it.`);if(this.nodes[r]===void 0&&this.groups[r]===void 0)throw new Error(`The right-hand id [${r}] does not yet exist. Please create the service/group before declaring an edge to it.`);const h=this.nodes[e].in,d=this.nodes[r].in;if(o&&h&&d&&h==d)throw new Error(`The left-hand id [${e}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);if(l&&h&&d&&h==d)throw new Error(`The right-hand id [${r}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);const f={lhsId:e,lhsDir:n,lhsInto:a,lhsGroup:o,rhsId:r,rhsDir:i,rhsInto:s,rhsGroup:l,title:u};this.edges.push(f),this.nodes[e]&&this.nodes[r]&&(this.nodes[e].edges.push(this.edges[this.edges.length-1]),this.nodes[r].edges.push(this.edges[this.edges.length-1]))}getEdges(){return this.edges}getDataStructures(){if(this.dataStructures===void 0){const e={},r=Object.entries(this.nodes).reduce((l,[u,h])=>(l[u]=h.edges.reduce((d,f)=>{var m,y;const p=(m=this.getNode(f.lhsId))==null?void 0:m.in,g=(y=this.getNode(f.rhsId))==null?void 0:y.in;if(p&&g&&p!==g){const v=Ept(f.lhsDir,f.rhsDir);v!=="bend"&&(e[p]??(e[p]={}),e[p][g]=v,e[g]??(e[g]={}),e[g][p]=v)}if(f.lhsId===u){const v=gP(f.lhsDir,f.rhsDir);v&&(d[v]=f.rhsId)}else{const v=gP(f.rhsDir,f.lhsDir);v&&(d[v]=f.lhsId)}return d},{}),l),{}),n=Object.keys(r)[0],i={[n]:1},a=Object.keys(r).reduce((l,u)=>u===n?l:{...l,[u]:1},{}),s=x(l=>{const u={[l]:[0,0]},h=[l];for(;h.length>0;){const d=h.shift();if(d){i[d]=1,delete a[d];const f=r[d],[p,g]=u[d];Object.entries(f).forEach(([m,y])=>{i[y]||(u[y]=Cpt([p,g],m),h.push(y))})}}return u},"BFS"),o=[s(n)];for(;Object.keys(a).length>0;)o.push(s(Object.keys(a)[0]));this.dataStructures={adjList:r,spatialMaps:o,groupAlignments:e}}return this.dataStructures}setElementForId(e,r){this.elements[e]=r}getElementById(e){return this.elements[e]}getConfig(){return ti({..._pt,...lr().architecture})}getConfigField(e){return this.getConfig()[e]}},x(Hv,"ArchitectureDB"),Hv),Rpt=x((t,e)=>{zl(t,e),t.groups.map(r=>e.addGroup(r)),t.services.map(r=>e.addService({...r,type:"service"})),t.junctions.map(r=>e.addJunction({...r,type:"junction"})),t.edges.map(r=>e.addEdge(r))},"populateDb"),Tye={parser:{yy:void 0},parse:x(async t=>{var n;const e=await Qo("architecture",t);ae.debug(e);const r=(n=Tye.parser)==null?void 0:n.yy;if(!(r instanceof xye))throw new Error("parser.parser?.yy was not a ArchitectureDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");Rpt(e,r)},"parse")},Lpt=x(t=>` + `},"styles"),jTt=XTt,KTt={db:qG,renderer:HTt,parser:GTt,styles:jTt};const ZTt=Object.freeze(Object.defineProperty({__proto__:null,diagram:KTt},Symbol.toStringTag,{value:"Module"}));var UA={exports:{}},HA={exports:{}},YA={exports:{}},QTt=YA.exports,LCe;function JTt(){return LCe||(LCe=1,(function(t,e){(function(n,i){t.exports=i()})(QTt,function(){return(function(r){var n={};function i(a){if(n[a])return n[a].exports;var s=n[a]={i:a,l:!1,exports:{}};return r[a].call(s.exports,s,s.exports,i),s.l=!0,s.exports}return i.m=r,i.c=n,i.i=function(a){return a},i.d=function(a,s,o){i.o(a,s)||Object.defineProperty(a,s,{configurable:!1,enumerable:!0,get:o})},i.n=function(a){var s=a&&a.__esModule?function(){return a.default}:function(){return a};return i.d(s,"a",s),s},i.o=function(a,s){return Object.prototype.hasOwnProperty.call(a,s)},i.p="",i(i.s=28)})([(function(r,n,i){function a(){}a.QUALITY=1,a.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,a.DEFAULT_INCREMENTAL=!1,a.DEFAULT_ANIMATION_ON_LAYOUT=!0,a.DEFAULT_ANIMATION_DURING_LAYOUT=!1,a.DEFAULT_ANIMATION_PERIOD=50,a.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,a.DEFAULT_GRAPH_MARGIN=15,a.NODE_DIMENSIONS_INCLUDE_LABELS=!1,a.SIMPLE_NODE_SIZE=40,a.SIMPLE_NODE_HALF_SIZE=a.SIMPLE_NODE_SIZE/2,a.EMPTY_COMPOUND_NODE_SIZE=40,a.MIN_EDGE_LENGTH=1,a.WORLD_BOUNDARY=1e6,a.INITIAL_WORLD_BOUNDARY=a.WORLD_BOUNDARY/1e3,a.WORLD_CENTER_X=1200,a.WORLD_CENTER_Y=900,r.exports=a}),(function(r,n,i){var a=i(2),s=i(8),o=i(9);function l(h,d,f){a.call(this,f),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=f,this.bendpoints=[],this.source=h,this.target=d}l.prototype=Object.create(a.prototype);for(var u in a)l[u]=a[u];l.prototype.getSource=function(){return this.source},l.prototype.getTarget=function(){return this.target},l.prototype.isInterGraph=function(){return this.isInterGraph},l.prototype.getLength=function(){return this.length},l.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},l.prototype.getBendpoints=function(){return this.bendpoints},l.prototype.getLca=function(){return this.lca},l.prototype.getSourceInLca=function(){return this.sourceInLca},l.prototype.getTargetInLca=function(){return this.targetInLca},l.prototype.getOtherEnd=function(h){if(this.source===h)return this.target;if(this.target===h)return this.source;throw"Node is not incident with this edge"},l.prototype.getOtherEndInGraph=function(h,d){for(var f=this.getOtherEnd(h),p=d.getGraphManager().getRoot();;){if(f.getOwner()==d)return f;if(f.getOwner()==p)break;f=f.getOwner().getParent()}return null},l.prototype.updateLength=function(){var h=new Array(4);this.isOverlapingSourceAndTarget=s.getIntersection(this.target.getRect(),this.source.getRect(),h),this.isOverlapingSourceAndTarget||(this.lengthX=h[0]-h[2],this.lengthY=h[1]-h[3],Math.abs(this.lengthX)<1&&(this.lengthX=o.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=o.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},l.prototype.updateLengthSimple=function(){this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),Math.abs(this.lengthX)<1&&(this.lengthX=o.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=o.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},r.exports=l}),(function(r,n,i){function a(s){this.vGraphObject=s}r.exports=a}),(function(r,n,i){var a=i(2),s=i(10),o=i(13),l=i(0),u=i(16),h=i(5);function d(p,g,m,y){m==null&&y==null&&(y=g),a.call(this,y),p.graphManager!=null&&(p=p.graphManager),this.estimatedSize=s.MIN_VALUE,this.inclusionTreeDepth=s.MAX_VALUE,this.vGraphObject=y,this.edges=[],this.graphManager=p,m!=null&&g!=null?this.rect=new o(g.x,g.y,m.width,m.height):this.rect=new o}d.prototype=Object.create(a.prototype);for(var f in a)d[f]=a[f];d.prototype.getEdges=function(){return this.edges},d.prototype.getChild=function(){return this.child},d.prototype.getOwner=function(){return this.owner},d.prototype.getWidth=function(){return this.rect.width},d.prototype.setWidth=function(p){this.rect.width=p},d.prototype.getHeight=function(){return this.rect.height},d.prototype.setHeight=function(p){this.rect.height=p},d.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},d.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},d.prototype.getCenter=function(){return new h(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},d.prototype.getLocation=function(){return new h(this.rect.x,this.rect.y)},d.prototype.getRect=function(){return this.rect},d.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},d.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},d.prototype.setRect=function(p,g){this.rect.x=p.x,this.rect.y=p.y,this.rect.width=g.width,this.rect.height=g.height},d.prototype.setCenter=function(p,g){this.rect.x=p-this.rect.width/2,this.rect.y=g-this.rect.height/2},d.prototype.setLocation=function(p,g){this.rect.x=p,this.rect.y=g},d.prototype.moveBy=function(p,g){this.rect.x+=p,this.rect.y+=g},d.prototype.getEdgeListToNode=function(p){var g=[],m=this;return m.edges.forEach(function(y){if(y.target==p){if(y.source!=m)throw"Incorrect edge source!";g.push(y)}}),g},d.prototype.getEdgesBetween=function(p){var g=[],m=this;return m.edges.forEach(function(y){if(!(y.source==m||y.target==m))throw"Incorrect edge source and/or target";(y.target==p||y.source==p)&&g.push(y)}),g},d.prototype.getNeighborsList=function(){var p=new Set,g=this;return g.edges.forEach(function(m){if(m.source==g)p.add(m.target);else{if(m.target!=g)throw"Incorrect incidency!";p.add(m.source)}}),p},d.prototype.withChildren=function(){var p=new Set,g,m;if(p.add(this),this.child!=null)for(var y=this.child.getNodes(),v=0;vg?(this.rect.x-=(this.labelWidth-g)/2,this.setWidth(this.labelWidth)):this.labelPosHorizontal=="right"&&this.setWidth(g+this.labelWidth)),this.labelHeight&&(this.labelPosVertical=="top"?(this.rect.y-=this.labelHeight,this.setHeight(m+this.labelHeight)):this.labelPosVertical=="center"&&this.labelHeight>m?(this.rect.y-=(this.labelHeight-m)/2,this.setHeight(this.labelHeight)):this.labelPosVertical=="bottom"&&this.setHeight(m+this.labelHeight))}}},d.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==s.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},d.prototype.transform=function(p){var g=this.rect.x;g>l.WORLD_BOUNDARY?g=l.WORLD_BOUNDARY:g<-l.WORLD_BOUNDARY&&(g=-l.WORLD_BOUNDARY);var m=this.rect.y;m>l.WORLD_BOUNDARY?m=l.WORLD_BOUNDARY:m<-l.WORLD_BOUNDARY&&(m=-l.WORLD_BOUNDARY);var y=new h(g,m),v=p.inverseTransformPoint(y);this.setLocation(v.x,v.y)},d.prototype.getLeft=function(){return this.rect.x},d.prototype.getRight=function(){return this.rect.x+this.rect.width},d.prototype.getTop=function(){return this.rect.y},d.prototype.getBottom=function(){return this.rect.y+this.rect.height},d.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},r.exports=d}),(function(r,n,i){var a=i(0);function s(){}for(var o in a)s[o]=a[o];s.MAX_ITERATIONS=2500,s.DEFAULT_EDGE_LENGTH=50,s.DEFAULT_SPRING_STRENGTH=.45,s.DEFAULT_REPULSION_STRENGTH=4500,s.DEFAULT_GRAVITY_STRENGTH=.4,s.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,s.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,s.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,s.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,s.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,s.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,s.COOLING_ADAPTATION_FACTOR=.33,s.ADAPTATION_LOWER_NODE_LIMIT=1e3,s.ADAPTATION_UPPER_NODE_LIMIT=5e3,s.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,s.MAX_NODE_DISPLACEMENT=s.MAX_NODE_DISPLACEMENT_INCREMENTAL*3,s.MIN_REPULSION_DIST=s.DEFAULT_EDGE_LENGTH/10,s.CONVERGENCE_CHECK_PERIOD=100,s.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,s.MIN_EDGE_LENGTH=1,s.GRID_CALCULATION_CHECK_PERIOD=10,r.exports=s}),(function(r,n,i){function a(s,o){s==null&&o==null?(this.x=0,this.y=0):(this.x=s,this.y=o)}a.prototype.getX=function(){return this.x},a.prototype.getY=function(){return this.y},a.prototype.setX=function(s){this.x=s},a.prototype.setY=function(s){this.y=s},a.prototype.getDifference=function(s){return new DimensionD(this.x-s.x,this.y-s.y)},a.prototype.getCopy=function(){return new a(this.x,this.y)},a.prototype.translate=function(s){return this.x+=s.width,this.y+=s.height,this},r.exports=a}),(function(r,n,i){var a=i(2),s=i(10),o=i(0),l=i(7),u=i(3),h=i(1),d=i(13),f=i(12),p=i(11);function g(y,v,x){a.call(this,x),this.estimatedSize=s.MIN_VALUE,this.margin=o.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=y,v!=null&&v instanceof l?this.graphManager=v:v!=null&&v instanceof Layout&&(this.graphManager=v.graphManager)}g.prototype=Object.create(a.prototype);for(var m in a)g[m]=a[m];g.prototype.getNodes=function(){return this.nodes},g.prototype.getEdges=function(){return this.edges},g.prototype.getGraphManager=function(){return this.graphManager},g.prototype.getParent=function(){return this.parent},g.prototype.getLeft=function(){return this.left},g.prototype.getRight=function(){return this.right},g.prototype.getTop=function(){return this.top},g.prototype.getBottom=function(){return this.bottom},g.prototype.isConnected=function(){return this.isConnected},g.prototype.add=function(y,v,x){if(v==null&&x==null){var b=y;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(b)>-1)throw"Node already in graph!";return b.owner=this,this.getNodes().push(b),b}else{var w=y;if(!(this.getNodes().indexOf(v)>-1&&this.getNodes().indexOf(x)>-1))throw"Source or target not in graph!";if(!(v.owner==x.owner&&v.owner==this))throw"Both owners must be this graph!";return v.owner!=x.owner?null:(w.source=v,w.target=x,w.isInterGraph=!1,this.getEdges().push(w),v.edges.push(w),x!=v&&x.edges.push(w),w)}},g.prototype.remove=function(y){var v=y;if(y instanceof u){if(v==null)throw"Node is null!";if(!(v.owner!=null&&v.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";for(var x=v.edges.slice(),b,w=x.length,C=0;C-1&&S>-1))throw"Source and/or target doesn't know this edge!";b.source.edges.splice(k,1),b.target!=b.source&&b.target.edges.splice(S,1);var _=b.source.owner.getEdges().indexOf(b);if(_==-1)throw"Not in owner's edge list!";b.source.owner.getEdges().splice(_,1)}},g.prototype.updateLeftTop=function(){for(var y=s.MAX_VALUE,v=s.MAX_VALUE,x,b,w,C=this.getNodes(),_=C.length,k=0;k<_;k++){var S=C[k];x=S.getTop(),b=S.getLeft(),y>x&&(y=x),v>b&&(v=b)}return y==s.MAX_VALUE?null:(C[0].getParent().paddingLeft!=null?w=C[0].getParent().paddingLeft:w=this.margin,this.left=v-w,this.top=y-w,new f(this.left,this.top))},g.prototype.updateBounds=function(y){for(var v=s.MAX_VALUE,x=-s.MAX_VALUE,b=s.MAX_VALUE,w=-s.MAX_VALUE,C,_,k,S,L,$=this.nodes,I=$.length,z=0;zC&&(v=C),x<_&&(x=_),b>k&&(b=k),wC&&(v=C),x<_&&(x=_),b>k&&(b=k),w=this.nodes.length){var I=0;x.forEach(function(z){z.owner==y&&I++}),I==this.nodes.length&&(this.isConnected=!0)}},r.exports=g}),(function(r,n,i){var a,s=i(1);function o(l){a=i(6),this.layout=l,this.graphs=[],this.edges=[]}o.prototype.addRoot=function(){var l=this.layout.newGraph(),u=this.layout.newNode(null),h=this.add(l,u);return this.setRootGraph(h),this.rootGraph},o.prototype.add=function(l,u,h,d,f){if(h==null&&d==null&&f==null){if(l==null)throw"Graph is null!";if(u==null)throw"Parent node is null!";if(this.graphs.indexOf(l)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(l),l.parent!=null)throw"Already has a parent!";if(u.child!=null)throw"Already has a child!";return l.parent=u,u.child=l,l}else{f=h,d=u,h=l;var p=d.getOwner(),g=f.getOwner();if(!(p!=null&&p.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(g!=null&&g.getGraphManager()==this))throw"Target not in this graph mgr!";if(p==g)return h.isInterGraph=!1,p.add(h,d,f);if(h.isInterGraph=!0,h.source=d,h.target=f,this.edges.indexOf(h)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(h),!(h.source!=null&&h.target!=null))throw"Edge source and/or target is null!";if(!(h.source.edges.indexOf(h)==-1&&h.target.edges.indexOf(h)==-1))throw"Edge already in source and/or target incidency list!";return h.source.edges.push(h),h.target.edges.push(h),h}},o.prototype.remove=function(l){if(l instanceof a){var u=l;if(u.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(u==this.rootGraph||u.parent!=null&&u.parent.graphManager==this))throw"Invalid parent node!";var h=[];h=h.concat(u.getEdges());for(var d,f=h.length,p=0;p=l.getRight()?u[0]+=Math.min(l.getX()-o.getX(),o.getRight()-l.getRight()):l.getX()<=o.getX()&&l.getRight()>=o.getRight()&&(u[0]+=Math.min(o.getX()-l.getX(),l.getRight()-o.getRight())),o.getY()<=l.getY()&&o.getBottom()>=l.getBottom()?u[1]+=Math.min(l.getY()-o.getY(),o.getBottom()-l.getBottom()):l.getY()<=o.getY()&&l.getBottom()>=o.getBottom()&&(u[1]+=Math.min(o.getY()-l.getY(),l.getBottom()-o.getBottom()));var f=Math.abs((l.getCenterY()-o.getCenterY())/(l.getCenterX()-o.getCenterX()));l.getCenterY()===o.getCenterY()&&l.getCenterX()===o.getCenterX()&&(f=1);var p=f*u[0],g=u[1]/f;u[0]p)return u[0]=h,u[1]=m,u[2]=f,u[3]=$,!1;if(df)return u[0]=g,u[1]=d,u[2]=S,u[3]=p,!1;if(hf?(u[0]=v,u[1]=x,A=!0):(u[0]=y,u[1]=m,A=!0):N===D&&(h>f?(u[0]=g,u[1]=m,A=!0):(u[0]=b,u[1]=x,A=!0)),-M===D?f>h?(u[2]=L,u[3]=$,R=!0):(u[2]=S,u[3]=k,R=!0):M===D&&(f>h?(u[2]=_,u[3]=k,R=!0):(u[2]=I,u[3]=$,R=!0)),A&&R)return!1;if(h>f?d>p?(O=this.getCardinalDirection(N,D,4),B=this.getCardinalDirection(M,D,2)):(O=this.getCardinalDirection(-N,D,3),B=this.getCardinalDirection(-M,D,1)):d>p?(O=this.getCardinalDirection(-N,D,1),B=this.getCardinalDirection(-M,D,3)):(O=this.getCardinalDirection(N,D,2),B=this.getCardinalDirection(M,D,4)),!A)switch(O){case 1:G=m,P=h+-C/D,u[0]=P,u[1]=G;break;case 2:P=b,G=d+w*D,u[0]=P,u[1]=G;break;case 3:G=x,P=h+C/D,u[0]=P,u[1]=G;break;case 4:P=v,G=d+-w*D,u[0]=P,u[1]=G;break}if(!R)switch(B){case 1:H=k,V=f+-F/D,u[2]=V,u[3]=H;break;case 2:V=I,H=p+z*D,u[2]=V,u[3]=H;break;case 3:H=$,V=f+F/D,u[2]=V,u[3]=H;break;case 4:V=L,H=p+-z*D,u[2]=V,u[3]=H;break}}return!1},s.getCardinalDirection=function(o,l,u){return o>l?u:1+u%4},s.getIntersection=function(o,l,u,h){if(h==null)return this.getIntersection2(o,l,u);var d=o.x,f=o.y,p=l.x,g=l.y,m=u.x,y=u.y,v=h.x,x=h.y,b=void 0,w=void 0,C=void 0,_=void 0,k=void 0,S=void 0,L=void 0,$=void 0,I=void 0;return C=g-f,k=d-p,L=p*f-d*g,_=x-y,S=m-v,$=v*y-m*x,I=C*S-_*k,I===0?null:(b=(k*$-S*L)/I,w=(_*L-C*$)/I,new a(b,w))},s.angleOfVector=function(o,l,u,h){var d=void 0;return o!==u?(d=Math.atan((h-l)/(u-o)),u=0){var x=(-m+Math.sqrt(m*m-4*g*y))/(2*g),b=(-m-Math.sqrt(m*m-4*g*y))/(2*g),w=null;return x>=0&&x<=1?[x]:b>=0&&b<=1?[b]:w}else return null},s.HALF_PI=.5*Math.PI,s.ONE_AND_HALF_PI=1.5*Math.PI,s.TWO_PI=2*Math.PI,s.THREE_PI=3*Math.PI,r.exports=s}),(function(r,n,i){function a(){}a.sign=function(s){return s>0?1:s<0?-1:0},a.floor=function(s){return s<0?Math.ceil(s):Math.floor(s)},a.ceil=function(s){return s<0?Math.floor(s):Math.ceil(s)},r.exports=a}),(function(r,n,i){function a(){}a.MAX_VALUE=2147483647,a.MIN_VALUE=-2147483648,r.exports=a}),(function(r,n,i){var a=(function(){function d(f,p){for(var g=0;g"u"?"undefined":a(o);return o==null||l!="object"&&l!="function"},r.exports=s}),(function(r,n,i){function a(m){if(Array.isArray(m)){for(var y=0,v=Array(m.length);y0&&y;){for(C.push(k[0]);C.length>0&&y;){var S=C[0];C.splice(0,1),w.add(S);for(var L=S.getEdges(),b=0;b-1&&k.splice(F,1)}w=new Set,_=new Map}}return m},g.prototype.createDummyNodesForBendpoints=function(m){for(var y=[],v=m.source,x=this.graphManager.calcLowestCommonAncestor(m.source,m.target),b=0;b0){for(var x=this.edgeToDummyNodes.get(v),b=0;b=0&&y.splice($,1);var I=_.getNeighborsList();I.forEach(function(A){if(v.indexOf(A)<0){var R=x.get(A),N=R-1;N==1&&S.push(A),x.set(A,N)}})}v=v.concat(S),(y.length==1||y.length==2)&&(b=!0,w=y[0])}return w},g.prototype.setGraphManager=function(m){this.graphManager=m},r.exports=g}),(function(r,n,i){function a(){}a.seed=1,a.x=0,a.nextDouble=function(){return a.x=Math.sin(a.seed++)*1e4,a.x-Math.floor(a.x)},r.exports=a}),(function(r,n,i){var a=i(5);function s(o,l){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}s.prototype.getWorldOrgX=function(){return this.lworldOrgX},s.prototype.setWorldOrgX=function(o){this.lworldOrgX=o},s.prototype.getWorldOrgY=function(){return this.lworldOrgY},s.prototype.setWorldOrgY=function(o){this.lworldOrgY=o},s.prototype.getWorldExtX=function(){return this.lworldExtX},s.prototype.setWorldExtX=function(o){this.lworldExtX=o},s.prototype.getWorldExtY=function(){return this.lworldExtY},s.prototype.setWorldExtY=function(o){this.lworldExtY=o},s.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},s.prototype.setDeviceOrgX=function(o){this.ldeviceOrgX=o},s.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},s.prototype.setDeviceOrgY=function(o){this.ldeviceOrgY=o},s.prototype.getDeviceExtX=function(){return this.ldeviceExtX},s.prototype.setDeviceExtX=function(o){this.ldeviceExtX=o},s.prototype.getDeviceExtY=function(){return this.ldeviceExtY},s.prototype.setDeviceExtY=function(o){this.ldeviceExtY=o},s.prototype.transformX=function(o){var l=0,u=this.lworldExtX;return u!=0&&(l=this.ldeviceOrgX+(o-this.lworldOrgX)*this.ldeviceExtX/u),l},s.prototype.transformY=function(o){var l=0,u=this.lworldExtY;return u!=0&&(l=this.ldeviceOrgY+(o-this.lworldOrgY)*this.ldeviceExtY/u),l},s.prototype.inverseTransformX=function(o){var l=0,u=this.ldeviceExtX;return u!=0&&(l=this.lworldOrgX+(o-this.ldeviceOrgX)*this.lworldExtX/u),l},s.prototype.inverseTransformY=function(o){var l=0,u=this.ldeviceExtY;return u!=0&&(l=this.lworldOrgY+(o-this.ldeviceOrgY)*this.lworldExtY/u),l},s.prototype.inverseTransformPoint=function(o){var l=new a(this.inverseTransformX(o.x),this.inverseTransformY(o.y));return l},r.exports=s}),(function(r,n,i){function a(p){if(Array.isArray(p)){for(var g=0,m=Array(p.length);go.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*o.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(p-o.ADAPTATION_LOWER_NODE_LIMIT)/(o.ADAPTATION_UPPER_NODE_LIMIT-o.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-o.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=o.MAX_NODE_DISPLACEMENT_INCREMENTAL):(p>o.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(o.COOLING_ADAPTATION_FACTOR,1-(p-o.ADAPTATION_LOWER_NODE_LIMIT)/(o.ADAPTATION_UPPER_NODE_LIMIT-o.ADAPTATION_LOWER_NODE_LIMIT)*(1-o.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=o.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.displacementThresholdPerNode=3*o.DEFAULT_EDGE_LENGTH/100,this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},d.prototype.calcSpringForces=function(){for(var p=this.getAllEdges(),g,m=0;m0&&arguments[0]!==void 0?arguments[0]:!0,g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,m,y,v,x,b=this.getAllNodes(),w;if(this.useFRGridVariant)for(this.totalIterations%o.GRID_CALCULATION_CHECK_PERIOD==1&&p&&this.updateGrid(),w=new Set,m=0;mC||w>C)&&(p.gravitationForceX=-this.gravityConstant*v,p.gravitationForceY=-this.gravityConstant*x)):(C=g.getEstimatedSize()*this.compoundGravityRangeFactor,(b>C||w>C)&&(p.gravitationForceX=-this.gravityConstant*v*this.compoundGravityConstant,p.gravitationForceY=-this.gravityConstant*x*this.compoundGravityConstant))},d.prototype.isConverged=function(){var p,g=!1;return this.totalIterations>this.maxIterations/3&&(g=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),p=this.totalDisplacement=b.length||C>=b[0].length)){for(var _=0;_d}}]),u})();r.exports=l}),(function(r,n,i){function a(){}a.svd=function(s){this.U=null,this.V=null,this.s=null,this.m=0,this.n=0,this.m=s.length,this.n=s[0].length;var o=Math.min(this.m,this.n);this.s=(function(Tt){for(var dt=[];Tt-- >0;)dt.push(0);return dt})(Math.min(this.m+1,this.n)),this.U=(function(Tt){var dt=function oe(Rt){if(Rt.length==0)return 0;for(var ft=[],ht=0;ht0;)dt.push(0);return dt})(this.n),u=(function(Tt){for(var dt=[];Tt-- >0;)dt.push(0);return dt})(this.m),h=!0,d=Math.min(this.m-1,this.n),f=Math.max(0,Math.min(this.n-2,this.m)),p=0;p=0;M--)if(this.s[M]!==0){for(var D=M+1;D=0;W--){if((function(Tt,dt){return Tt&&dt})(W0;){var fe=void 0,Ae=void 0;for(fe=A-2;fe>=-1&&fe!==-1;fe--)if(Math.abs(l[fe])<=le+re*(Math.abs(this.s[fe])+Math.abs(this.s[fe+1]))){l[fe]=0;break}if(fe===A-2)Ae=4;else{var Se=void 0;for(Se=A-1;Se>=fe&&Se!==fe;Se--){var Ne=(Se!==A?Math.abs(l[Se]):0)+(Se!==fe+1?Math.abs(l[Se-1]):0);if(Math.abs(this.s[Se])<=le+re*Ne){this.s[Se]=0;break}}Se===fe?Ae=3:Se===A-1?Ae=1:(Ae=2,fe=Se)}switch(fe++,Ae){case 1:{var ge=l[A-2];l[A-2]=0;for(var ve=A-2;ve>=fe;ve--){var ze=a.hypot(this.s[ve],ge),xe=this.s[ve]/ze,Ke=ge/ze;this.s[ve]=ze,ve!==fe&&(ge=-Ke*l[ve-1],l[ve-1]=xe*l[ve-1]);for(var Ce=0;Ce=this.s[fe+1]);){var _t=this.s[fe];if(this.s[fe]=this.s[fe+1],this.s[fe+1]=_t,feMath.abs(o)?(l=o/s,l=Math.abs(s)*Math.sqrt(1+l*l)):o!=0?(l=s/o,l=Math.abs(o)*Math.sqrt(1+l*l)):l=0,l},r.exports=a}),(function(r,n,i){var a=(function(){function l(u,h){for(var d=0;d2&&arguments[2]!==void 0?arguments[2]:1,f=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,p=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;s(this,l),this.sequence1=u,this.sequence2=h,this.match_score=d,this.mismatch_penalty=f,this.gap_penalty=p,this.iMax=u.length+1,this.jMax=h.length+1,this.grid=new Array(this.iMax);for(var g=0;g=0;u--){var h=this.listeners[u];h.event===o&&h.callback===l&&this.listeners.splice(u,1)}},s.emit=function(o,l){for(var u=0;u{var n={45:((o,l,u)=>{var h={};h.layoutBase=u(551),h.CoSEConstants=u(806),h.CoSEEdge=u(767),h.CoSEGraph=u(880),h.CoSEGraphManager=u(578),h.CoSELayout=u(765),h.CoSENode=u(991),h.ConstraintHandler=u(902),o.exports=h}),806:((o,l,u)=>{var h=u(551).FDLayoutConstants;function d(){}for(var f in h)d[f]=h[f];d.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,d.DEFAULT_RADIAL_SEPARATION=h.DEFAULT_EDGE_LENGTH,d.DEFAULT_COMPONENT_SEPERATION=60,d.TILE=!0,d.TILING_PADDING_VERTICAL=10,d.TILING_PADDING_HORIZONTAL=10,d.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,d.ENFORCE_CONSTRAINTS=!0,d.APPLY_LAYOUT=!0,d.RELAX_MOVEMENT_ON_CONSTRAINTS=!0,d.TREE_REDUCTION_ON_INCREMENTAL=!0,d.PURE_INCREMENTAL=d.DEFAULT_INCREMENTAL,o.exports=d}),767:((o,l,u)=>{var h=u(551).FDLayoutEdge;function d(p,g,m){h.call(this,p,g,m)}d.prototype=Object.create(h.prototype);for(var f in h)d[f]=h[f];o.exports=d}),880:((o,l,u)=>{var h=u(551).LGraph;function d(p,g,m){h.call(this,p,g,m)}d.prototype=Object.create(h.prototype);for(var f in h)d[f]=h[f];o.exports=d}),578:((o,l,u)=>{var h=u(551).LGraphManager;function d(p){h.call(this,p)}d.prototype=Object.create(h.prototype);for(var f in h)d[f]=h[f];o.exports=d}),765:((o,l,u)=>{var h=u(551).FDLayout,d=u(578),f=u(880),p=u(991),g=u(767),m=u(806),y=u(902),v=u(551).FDLayoutConstants,x=u(551).LayoutConstants,b=u(551).Point,w=u(551).PointD,C=u(551).DimensionD,_=u(551).Layout,k=u(551).Integer,S=u(551).IGeometry,L=u(551).LGraph,$=u(551).Transform,I=u(551).LinkedList;function z(){h.call(this),this.toBeTiled={},this.constraints={}}z.prototype=Object.create(h.prototype);for(var F in h)z[F]=h[F];z.prototype.newGraphManager=function(){var A=new d(this);return this.graphManager=A,A},z.prototype.newGraph=function(A){return new f(null,this.graphManager,A)},z.prototype.newNode=function(A){return new p(this.graphManager,A)},z.prototype.newEdge=function(A){return new g(null,null,A)},z.prototype.initParameters=function(){h.prototype.initParameters.call(this,arguments),this.isSubLayout||(m.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=m.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=m.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=v.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=v.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=v.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=v.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1)},z.prototype.initSpringEmbedder=function(){h.prototype.initSpringEmbedder.call(this),this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/v.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=.04,this.coolingAdjuster=1},z.prototype.layout=function(){var A=x.DEFAULT_CREATE_BENDS_AS_NEEDED;return A&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},z.prototype.classicLayout=function(){if(this.nodesWithGravity=this.calculateNodesToApplyGravitationTo(),this.graphManager.setAllNodesToApplyGravitation(this.nodesWithGravity),this.calcNoOfChildrenForAllNodes(),this.graphManager.calcLowestCommonAncestors(),this.graphManager.calcInclusionTreeDepths(),this.graphManager.getRoot().calcEstimatedSize(),this.calcIdealEdgeLengths(),this.incremental){if(m.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var R=new Set(this.getAllNodes()),N=this.nodesWithGravity.filter(function(O){return R.has(O)});this.graphManager.setAllNodesToApplyGravitation(N)}}else{var A=this.getFlatForest();if(A.length>0)this.positionNodesRadially(A);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var R=new Set(this.getAllNodes()),N=this.nodesWithGravity.filter(function(M){return R.has(M)});this.graphManager.setAllNodesToApplyGravitation(N),this.positionNodesRandomly()}}return Object.keys(this.constraints).length>0&&(y.handleConstraints(this),this.initConstraintVariables()),this.initSpringEmbedder(),m.APPLY_LAYOUT&&this.runSpringEmbedder(),!0},z.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished)if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.totalIterations%v.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;this.coolingCycle++,this.layoutQuality==0?this.coolingAdjuster=this.coolingCycle:this.layoutQuality==1&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var A=new Set(this.getAllNodes()),R=this.nodesWithGravity.filter(function(D){return A.has(D)});this.graphManager.setAllNodesToApplyGravitation(R),this.graphManager.updateBounds(),this.updateGrid(),m.PURE_INCREMENTAL?this.coolingFactor=v.DEFAULT_COOLING_FACTOR_INCREMENTAL/2:this.coolingFactor=v.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),m.PURE_INCREMENTAL?this.coolingFactor=v.DEFAULT_COOLING_FACTOR_INCREMENTAL/2*((100-this.afterGrowthIterations)/100):this.coolingFactor=v.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var N=!this.isTreeGrowing&&!this.isGrowthFinished,M=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(N,M),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},z.prototype.getPositionsData=function(){for(var A=this.graphManager.getAllNodes(),R={},N=0;N0&&this.updateDisplacements();for(var N=0;N0&&(M.fixedNodeWeight=O)}}if(this.constraints.relativePlacementConstraint){var B=new Map,P=new Map;if(this.dummyToNodeForVerticalAlignment=new Map,this.dummyToNodeForHorizontalAlignment=new Map,this.fixedNodesOnHorizontal=new Set,this.fixedNodesOnVertical=new Set,this.fixedNodeSet.forEach(function(J){A.fixedNodesOnHorizontal.add(J),A.fixedNodesOnVertical.add(J)}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var G=this.constraints.alignmentConstraint.vertical,N=0;N=2*J.length/3;re--)K=Math.floor(Math.random()*(re+1)),Q=J[re],J[re]=J[K],J[K]=Q;return J},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(J){if(J.left){var K=B.has(J.left)?B.get(J.left):J.left,Q=B.has(J.right)?B.get(J.right):J.right;A.nodesInRelativeHorizontal.includes(K)||(A.nodesInRelativeHorizontal.push(K),A.nodeToRelativeConstraintMapHorizontal.set(K,[]),A.dummyToNodeForVerticalAlignment.has(K)?A.nodeToTempPositionMapHorizontal.set(K,A.idToNodeMap.get(A.dummyToNodeForVerticalAlignment.get(K)[0]).getCenterX()):A.nodeToTempPositionMapHorizontal.set(K,A.idToNodeMap.get(K).getCenterX())),A.nodesInRelativeHorizontal.includes(Q)||(A.nodesInRelativeHorizontal.push(Q),A.nodeToRelativeConstraintMapHorizontal.set(Q,[]),A.dummyToNodeForVerticalAlignment.has(Q)?A.nodeToTempPositionMapHorizontal.set(Q,A.idToNodeMap.get(A.dummyToNodeForVerticalAlignment.get(Q)[0]).getCenterX()):A.nodeToTempPositionMapHorizontal.set(Q,A.idToNodeMap.get(Q).getCenterX())),A.nodeToRelativeConstraintMapHorizontal.get(K).push({right:Q,gap:J.gap}),A.nodeToRelativeConstraintMapHorizontal.get(Q).push({left:K,gap:J.gap})}else{var re=P.has(J.top)?P.get(J.top):J.top,le=P.has(J.bottom)?P.get(J.bottom):J.bottom;A.nodesInRelativeVertical.includes(re)||(A.nodesInRelativeVertical.push(re),A.nodeToRelativeConstraintMapVertical.set(re,[]),A.dummyToNodeForHorizontalAlignment.has(re)?A.nodeToTempPositionMapVertical.set(re,A.idToNodeMap.get(A.dummyToNodeForHorizontalAlignment.get(re)[0]).getCenterY()):A.nodeToTempPositionMapVertical.set(re,A.idToNodeMap.get(re).getCenterY())),A.nodesInRelativeVertical.includes(le)||(A.nodesInRelativeVertical.push(le),A.nodeToRelativeConstraintMapVertical.set(le,[]),A.dummyToNodeForHorizontalAlignment.has(le)?A.nodeToTempPositionMapVertical.set(le,A.idToNodeMap.get(A.dummyToNodeForHorizontalAlignment.get(le)[0]).getCenterY()):A.nodeToTempPositionMapVertical.set(le,A.idToNodeMap.get(le).getCenterY())),A.nodeToRelativeConstraintMapVertical.get(re).push({bottom:le,gap:J.gap}),A.nodeToRelativeConstraintMapVertical.get(le).push({top:re,gap:J.gap})}});else{var H=new Map,W=new Map;this.constraints.relativePlacementConstraint.forEach(function(J){if(J.left){var K=B.has(J.left)?B.get(J.left):J.left,Q=B.has(J.right)?B.get(J.right):J.right;H.has(K)?H.get(K).push(Q):H.set(K,[Q]),H.has(Q)?H.get(Q).push(K):H.set(Q,[K])}else{var re=P.has(J.top)?P.get(J.top):J.top,le=P.has(J.bottom)?P.get(J.bottom):J.bottom;W.has(re)?W.get(re).push(le):W.set(re,[le]),W.has(le)?W.get(le).push(re):W.set(le,[re])}});var ie=function(K,Q){var re=[],le=[],fe=new I,Ae=new Set,Se=0;return K.forEach(function(Ne,ge){if(!Ae.has(ge)){re[Se]=[],le[Se]=!1;var ve=ge;for(fe.push(ve),Ae.add(ve),re[Se].push(ve);fe.length!=0;){ve=fe.shift(),Q.has(ve)&&(le[Se]=!0);var ze=K.get(ve);ze.forEach(function(xe){Ae.has(xe)||(fe.push(xe),Ae.add(xe),re[Se].push(xe))})}Se++}}),{components:re,isFixed:le}},j=ie(H,A.fixedNodesOnHorizontal);this.componentsOnHorizontal=j.components,this.fixedComponentsOnHorizontal=j.isFixed;var ae=ie(W,A.fixedNodesOnVertical);this.componentsOnVertical=ae.components,this.fixedComponentsOnVertical=ae.isFixed}}},z.prototype.updateDisplacements=function(){var A=this;if(this.constraints.fixedNodeConstraint&&this.constraints.fixedNodeConstraint.forEach(function(ae){var J=A.idToNodeMap.get(ae.nodeId);J.displacementX=0,J.displacementY=0}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var R=this.constraints.alignmentConstraint.vertical,N=0;N1){var P;for(P=0;PM&&(M=Math.floor(B.y)),O=Math.floor(B.x+m.DEFAULT_COMPONENT_SEPERATION)}this.transform(new w(x.WORLD_CENTER_X-B.x/2,x.WORLD_CENTER_Y-B.y/2))},z.radialLayout=function(A,R,N){var M=Math.max(this.maxDiagonalInTree(A),m.DEFAULT_RADIAL_SEPARATION);z.branchRadialLayout(R,null,0,359,0,M);var D=L.calculateBounds(A),O=new $;O.setDeviceOrgX(D.getMinX()),O.setDeviceOrgY(D.getMinY()),O.setWorldOrgX(N.x),O.setWorldOrgY(N.y);for(var B=0;B1;){var Q=K[0];K.splice(0,1);var re=W.indexOf(Q);re>=0&&W.splice(re,1),ae--,ie--}R!=null?J=(W.indexOf(K[0])+1)%ae:J=0;for(var le=Math.abs(M-N)/ie,fe=J;j!=ie;fe=++fe%ae){var Ae=W[fe].getOtherEnd(A);if(Ae!=R){var Se=(N+j*le)%360,Ne=(Se+le)%360;z.branchRadialLayout(Ae,A,Se,Ne,D+O,O),j++}}},z.maxDiagonalInTree=function(A){for(var R=k.MIN_VALUE,N=0;NR&&(R=D)}return R},z.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},z.prototype.groupZeroDegreeMembers=function(){var A=this,R={};this.memberGroups={},this.idToDummyNode={};for(var N=[],M=this.graphManager.getAllNodes(),D=0;D"u"&&(R[P]=[]),R[P]=R[P].concat(O)}Object.keys(R).forEach(function(G){if(R[G].length>1){var V="DummyCompound_"+G;A.memberGroups[V]=R[G];var H=R[G][0].getParent(),W=new p(A.graphManager);W.id=V,W.paddingLeft=H.paddingLeft||0,W.paddingRight=H.paddingRight||0,W.paddingBottom=H.paddingBottom||0,W.paddingTop=H.paddingTop||0,A.idToDummyNode[V]=W;var ie=A.getGraphManager().add(A.newGraph(),W),j=H.getChild();j.add(W);for(var ae=0;aeD?(M.rect.x-=(M.labelWidth-D)/2,M.setWidth(M.labelWidth),M.labelMarginLeft=(M.labelWidth-D)/2):M.labelPosHorizontal=="right"&&M.setWidth(D+M.labelWidth)),M.labelHeight&&(M.labelPosVertical=="top"?(M.rect.y-=M.labelHeight,M.setHeight(O+M.labelHeight),M.labelMarginTop=M.labelHeight):M.labelPosVertical=="center"&&M.labelHeight>O?(M.rect.y-=(M.labelHeight-O)/2,M.setHeight(M.labelHeight),M.labelMarginTop=(M.labelHeight-O)/2):M.labelPosVertical=="bottom"&&M.setHeight(O+M.labelHeight))}})},z.prototype.repopulateCompounds=function(){for(var A=this.compoundOrder.length-1;A>=0;A--){var R=this.compoundOrder[A],N=R.id,M=R.paddingLeft,D=R.paddingTop,O=R.labelMarginLeft,B=R.labelMarginTop;this.adjustLocations(this.tiledMemberPack[N],R.rect.x,R.rect.y,M,D,O,B)}},z.prototype.repopulateZeroDegreeMembers=function(){var A=this,R=this.tiledZeroDegreePack;Object.keys(R).forEach(function(N){var M=A.idToDummyNode[N],D=M.paddingLeft,O=M.paddingTop,B=M.labelMarginLeft,P=M.labelMarginTop;A.adjustLocations(R[N],M.rect.x,M.rect.y,D,O,B,P)})},z.prototype.getToBeTiled=function(A){var R=A.id;if(this.toBeTiled[R]!=null)return this.toBeTiled[R];var N=A.getChild();if(N==null)return this.toBeTiled[R]=!1,!1;for(var M=N.getNodes(),D=0;D0)return this.toBeTiled[R]=!1,!1;if(O.getChild()==null){this.toBeTiled[O.id]=!1;continue}if(!this.getToBeTiled(O))return this.toBeTiled[R]=!1,!1}return this.toBeTiled[R]=!0,!0},z.prototype.getNodeDegree=function(A){A.id;for(var R=A.getEdges(),N=0,M=0;MH&&(H=ie.rect.height)}N+=H+A.verticalPadding}},z.prototype.tileCompoundMembers=function(A,R){var N=this;this.tiledMemberPack=[],Object.keys(A).forEach(function(M){var D=R[M];if(N.tiledMemberPack[M]=N.tileNodes(A[M],D.paddingLeft+D.paddingRight),D.rect.width=N.tiledMemberPack[M].width,D.rect.height=N.tiledMemberPack[M].height,D.setCenter(N.tiledMemberPack[M].centerX,N.tiledMemberPack[M].centerY),D.labelMarginLeft=0,D.labelMarginTop=0,m.NODE_DIMENSIONS_INCLUDE_LABELS){var O=D.rect.width,B=D.rect.height;D.labelWidth&&(D.labelPosHorizontal=="left"?(D.rect.x-=D.labelWidth,D.setWidth(O+D.labelWidth),D.labelMarginLeft=D.labelWidth):D.labelPosHorizontal=="center"&&D.labelWidth>O?(D.rect.x-=(D.labelWidth-O)/2,D.setWidth(D.labelWidth),D.labelMarginLeft=(D.labelWidth-O)/2):D.labelPosHorizontal=="right"&&D.setWidth(O+D.labelWidth)),D.labelHeight&&(D.labelPosVertical=="top"?(D.rect.y-=D.labelHeight,D.setHeight(B+D.labelHeight),D.labelMarginTop=D.labelHeight):D.labelPosVertical=="center"&&D.labelHeight>B?(D.rect.y-=(D.labelHeight-B)/2,D.setHeight(D.labelHeight),D.labelMarginTop=(D.labelHeight-B)/2):D.labelPosVertical=="bottom"&&D.setHeight(B+D.labelHeight))}})},z.prototype.tileNodes=function(A,R){var N=this.tileNodesByFavoringDim(A,R,!0),M=this.tileNodesByFavoringDim(A,R,!1),D=this.getOrgRatio(N),O=this.getOrgRatio(M),B;return OP&&(P=ae.getWidth())});var G=O/D,V=B/D,H=Math.pow(N-M,2)+4*(G+M)*(V+N)*D,W=(M-N+Math.sqrt(H))/(2*(G+M)),ie;R?(ie=Math.ceil(W),ie==W&&ie++):ie=Math.floor(W);var j=ie*(G+M)-M;return P>j&&(j=P),j+=M*2,j},z.prototype.tileNodesByFavoringDim=function(A,R,N){var M=m.TILING_PADDING_VERTICAL,D=m.TILING_PADDING_HORIZONTAL,O=m.TILING_COMPARE_BY,B={rows:[],rowWidth:[],rowHeight:[],width:0,height:R,verticalPadding:M,horizontalPadding:D,centerX:0,centerY:0};O&&(B.idealRowWidth=this.calcIdealRowWidth(A,N));var P=function(J){return J.rect.width*J.rect.height},G=function(J,K){return P(K)-P(J)};A.sort(function(ae,J){var K=G;return B.idealRowWidth?(K=O,K(ae.id,J.id)):K(ae,J)});for(var V=0,H=0,W=0;W0&&(B+=A.horizontalPadding),A.rowWidth[N]=B,A.width0&&(P+=A.verticalPadding);var G=0;P>A.rowHeight[N]&&(G=A.rowHeight[N],A.rowHeight[N]=P,G=A.rowHeight[N]-G),A.height+=G,A.rows[N].push(R)},z.prototype.getShortestRowIndex=function(A){for(var R=-1,N=Number.MAX_VALUE,M=0;MN&&(R=M,N=A.rowWidth[M]);return R},z.prototype.canAddHorizontal=function(A,R,N){if(A.idealRowWidth){var M=A.rows.length-1,D=A.rowWidth[M];return D+R+A.horizontalPadding<=A.idealRowWidth}var O=this.getShortestRowIndex(A);if(O<0)return!0;var B=A.rowWidth[O];if(B+A.horizontalPadding+R<=A.width)return!0;var P=0;A.rowHeight[O]0&&(P=N+A.verticalPadding-A.rowHeight[O]);var G;A.width-B>=R+A.horizontalPadding?G=(A.height+P)/(B+R+A.horizontalPadding):G=(A.height+P)/A.width,P=N+A.verticalPadding;var V;return A.widthO&&R!=N){M.splice(-1,1),A.rows[N].push(D),A.rowWidth[R]=A.rowWidth[R]-O,A.rowWidth[N]=A.rowWidth[N]+O,A.width=A.rowWidth[instance.getLongestRowIndex(A)];for(var B=Number.MIN_VALUE,P=0;PB&&(B=M[P].height);R>0&&(B+=A.verticalPadding);var G=A.rowHeight[R]+A.rowHeight[N];A.rowHeight[R]=B,A.rowHeight[N]0)for(var j=D;j<=O;j++)ie[0]+=this.grid[j][B-1].length+this.grid[j][B].length-1;if(O0)for(var j=B;j<=P;j++)ie[3]+=this.grid[D-1][j].length+this.grid[D][j].length-1;for(var ae=k.MAX_VALUE,J,K,Q=0;Q{var h=u(551).FDLayoutNode,d=u(551).IMath;function f(g,m,y,v){h.call(this,g,m,y,v)}f.prototype=Object.create(h.prototype);for(var p in h)f[p]=h[p];f.prototype.calculateDisplacement=function(){var g=this.graphManager.getLayout();this.getChild()!=null&&this.fixedNodeWeight?(this.displacementX+=g.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.fixedNodeWeight,this.displacementY+=g.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.fixedNodeWeight):(this.displacementX+=g.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY+=g.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren),Math.abs(this.displacementX)>g.coolingFactor*g.maxNodeDisplacement&&(this.displacementX=g.coolingFactor*g.maxNodeDisplacement*d.sign(this.displacementX)),Math.abs(this.displacementY)>g.coolingFactor*g.maxNodeDisplacement&&(this.displacementY=g.coolingFactor*g.maxNodeDisplacement*d.sign(this.displacementY)),this.child&&this.child.getNodes().length>0&&this.propogateDisplacementToChildren(this.displacementX,this.displacementY)},f.prototype.propogateDisplacementToChildren=function(g,m){for(var y=this.getChild().getNodes(),v,x=0;x{function h(y){if(Array.isArray(y)){for(var v=0,x=Array(y.length);v0){var _t=0;be.forEach(function(lt){pe=="horizontal"?(qe.set(lt,b.has(lt)?w[b.get(lt)]:Be.get(lt)),_t+=qe.get(lt)):(qe.set(lt,b.has(lt)?C[b.get(lt)]:Be.get(lt)),_t+=qe.get(lt))}),_t=_t/be.length,ct.forEach(function(lt){ne.has(lt)||qe.set(lt,_t)})}else{var bt=0;ct.forEach(function(lt){pe=="horizontal"?bt+=b.has(lt)?w[b.get(lt)]:Be.get(lt):bt+=b.has(lt)?C[b.get(lt)]:Be.get(lt)}),bt=bt/ct.length,ct.forEach(function(lt){qe.set(lt,bt)})}});for(var Ie=function(){var be=Xe.shift(),_t=Z.get(be);_t.forEach(function(bt){if(qe.get(bt.id)lt&&(lt=kt),qrMt&&(Mt=qr)}}catch($r){dt=!0,oe=$r}finally{try{!Tt&&Rt.return&&Rt.return()}finally{if(dt)throw oe}}var ye=(_t+lt)/2-(bt+Mt)/2,et=!0,ut=!1,Lt=void 0;try{for(var Vt=ct[Symbol.iterator](),lr;!(et=(lr=Vt.next()).done);et=!0){var cr=lr.value;qe.set(cr,qe.get(cr)+ye)}}catch($r){ut=!0,Lt=$r}finally{try{!et&&Vt.return&&Vt.return()}finally{if(ut)throw Lt}}})}return qe},F=function(Z){var pe=0,ne=0,Be=0,Te=0;if(Z.forEach(function(Le){Le.left?w[b.get(Le.left)]-w[b.get(Le.right)]>=0?pe++:ne++:C[b.get(Le.top)]-C[b.get(Le.bottom)]>=0?Be++:Te++}),pe>ne&&Be>Te)for(var Ue=0;Uene)for(var De=0;DeTe)for(var qe=0;qe1)v.fixedNodeConstraint.forEach(function(he,Z){M[Z]=[he.position.x,he.position.y],D[Z]=[w[b.get(he.nodeId)],C[b.get(he.nodeId)]]}),O=!0;else if(v.alignmentConstraint)(function(){var he=0;if(v.alignmentConstraint.vertical){for(var Z=v.alignmentConstraint.vertical,pe=function(qe){var Le=new Set;Z[qe].forEach(function(it){Le.add(it)});var Xe=new Set([].concat(h(Le)).filter(function(it){return P.has(it)})),Ie=void 0;Xe.size>0?Ie=w[b.get(Xe.values().next().value)]:Ie=I(Le).x,Z[qe].forEach(function(it){M[he]=[Ie,C[b.get(it)]],D[he]=[w[b.get(it)],C[b.get(it)]],he++})},ne=0;ne0?Ie=w[b.get(Xe.values().next().value)]:Ie=I(Le).y,Be[qe].forEach(function(it){M[he]=[w[b.get(it)],Ie],D[he]=[w[b.get(it)],C[b.get(it)]],he++})},Ue=0;UeW&&(W=H[j].length,ie=j);if(W0){var Ce={x:0,y:0};v.fixedNodeConstraint.forEach(function(he,Z){var pe={x:w[b.get(he.nodeId)],y:C[b.get(he.nodeId)]},ne=he.position,Be=$(ne,pe);Ce.x+=Be.x,Ce.y+=Be.y}),Ce.x/=v.fixedNodeConstraint.length,Ce.y/=v.fixedNodeConstraint.length,w.forEach(function(he,Z){w[Z]+=Ce.x}),C.forEach(function(he,Z){C[Z]+=Ce.y}),v.fixedNodeConstraint.forEach(function(he){w[b.get(he.nodeId)]=he.position.x,C[b.get(he.nodeId)]=he.position.y})}if(v.alignmentConstraint){if(v.alignmentConstraint.vertical)for(var Ve=v.alignmentConstraint.vertical,Qe=function(Z){var pe=new Set;Ve[Z].forEach(function(Te){pe.add(Te)});var ne=new Set([].concat(h(pe)).filter(function(Te){return P.has(Te)})),Be=void 0;ne.size>0?Be=w[b.get(ne.values().next().value)]:Be=I(pe).x,pe.forEach(function(Te){P.has(Te)||(w[b.get(Te)]=Be)})},nt=0;nt0?Be=C[b.get(ne.values().next().value)]:Be=I(pe).y,pe.forEach(function(Te){P.has(Te)||(C[b.get(Te)]=Be)})},ke=0;ke{o.exports=r})},i={};function a(o){var l=i[o];if(l!==void 0)return l.exports;var u=i[o]={exports:{}};return n[o](u,u.exports,a),u.exports}var s=a(45);return s})()})})(HA)),HA.exports}var rwt=UA.exports,DCe;function nwt(){return DCe||(DCe=1,(function(t,e){(function(n,i){t.exports=i(twt())})(rwt,function(r){return(()=>{var n={658:(o=>{o.exports=Object.assign!=null?Object.assign.bind(Object):function(l){for(var u=arguments.length,h=Array(u>1?u-1:0),d=1;d{var h=(function(){function p(g,m){var y=[],v=!0,x=!1,b=void 0;try{for(var w=g[Symbol.iterator](),C;!(v=(C=w.next()).done)&&(y.push(C.value),!(m&&y.length===m));v=!0);}catch(_){x=!0,b=_}finally{try{!v&&w.return&&w.return()}finally{if(x)throw b}}return y}return function(g,m){if(Array.isArray(g))return g;if(Symbol.iterator in Object(g))return p(g,m);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),d=u(140).layoutBase.LinkedList,f={};f.getTopMostNodes=function(p){for(var g={},m=0;m0&&O.merge(V)});for(var B=0;B1){C=b[0],_=C.connectedEdges().length,b.forEach(function(D){D.connectedEdges().length<_&&(_=D.connectedEdges().length,C=D)}),L.push(C.id());var M=p.collection();M.merge(b[0]),b.forEach(function(D){M.merge(D)}),b=[],m=m.difference(M),S++}};do I();while(!k);return y&&L.length>0&&y.set("dummy"+(y.size+1),L),$},f.relocateComponent=function(p,g,m){if(!m.fixedNodeConstraint){var y=Number.POSITIVE_INFINITY,v=Number.NEGATIVE_INFINITY,x=Number.POSITIVE_INFINITY,b=Number.NEGATIVE_INFINITY;if(m.quality=="draft"){var w=!0,C=!1,_=void 0;try{for(var k=g.nodeIndexes[Symbol.iterator](),S;!(w=(S=k.next()).done);w=!0){var L=S.value,$=h(L,2),I=$[0],z=$[1],F=m.cy.getElementById(I);if(F){var A=F.boundingBox(),R=g.xCoords[z]-A.w/2,N=g.xCoords[z]+A.w/2,M=g.yCoords[z]-A.h/2,D=g.yCoords[z]+A.h/2;Rv&&(v=N),Mb&&(b=D)}}}catch(V){C=!0,_=V}finally{try{!w&&k.return&&k.return()}finally{if(C)throw _}}var O=p.x-(v+y)/2,B=p.y-(b+x)/2;g.xCoords=g.xCoords.map(function(V){return V+O}),g.yCoords=g.yCoords.map(function(V){return V+B})}else{Object.keys(g).forEach(function(V){var H=g[V],W=H.getRect().x,ie=H.getRect().x+H.getRect().width,j=H.getRect().y,ae=H.getRect().y+H.getRect().height;Wv&&(v=ie),jb&&(b=ae)});var P=p.x-(v+y)/2,G=p.y-(b+x)/2;Object.keys(g).forEach(function(V){var H=g[V];H.setCenter(H.getCenterX()+P,H.getCenterY()+G)})}}},f.calcBoundingBox=function(p,g,m,y){for(var v=Number.MAX_SAFE_INTEGER,x=Number.MIN_SAFE_INTEGER,b=Number.MAX_SAFE_INTEGER,w=Number.MIN_SAFE_INTEGER,C=void 0,_=void 0,k=void 0,S=void 0,L=p.descendants().not(":parent"),$=L.length,I=0;I<$;I++){var z=L[I];C=g[y.get(z.id())]-z.width()/2,_=g[y.get(z.id())]+z.width()/2,k=m[y.get(z.id())]-z.height()/2,S=m[y.get(z.id())]+z.height()/2,v>C&&(v=C),x<_&&(x=_),b>k&&(b=k),w{var h=u(548),d=u(140).CoSELayout,f=u(140).CoSENode,p=u(140).layoutBase.PointD,g=u(140).layoutBase.DimensionD,m=u(140).layoutBase.LayoutConstants,y=u(140).layoutBase.FDLayoutConstants,v=u(140).CoSEConstants,x=function(w,C){var _=w.cy,k=w.eles,S=k.nodes(),L=k.edges(),$=void 0,I=void 0,z=void 0,F={};w.randomize&&($=C.nodeIndexes,I=C.xCoords,z=C.yCoords);var A=function(V){return typeof V=="function"},R=function(V,H){return A(V)?V(H):V},N=h.calcParentsWithoutChildren(_,k),M=function G(V,H,W,ie){for(var j=H.length,ae=0;ae0){var fe=void 0;fe=W.getGraphManager().add(W.newGraph(),Q),G(fe,K,W,ie)}}},D=function(V,H,W){for(var ie=0,j=0,ae=0;ae0?v.DEFAULT_EDGE_LENGTH=y.DEFAULT_EDGE_LENGTH=ie/j:A(w.idealEdgeLength)?v.DEFAULT_EDGE_LENGTH=y.DEFAULT_EDGE_LENGTH=50:v.DEFAULT_EDGE_LENGTH=y.DEFAULT_EDGE_LENGTH=w.idealEdgeLength,v.MIN_REPULSION_DIST=y.MIN_REPULSION_DIST=y.DEFAULT_EDGE_LENGTH/10,v.DEFAULT_RADIAL_SEPARATION=y.DEFAULT_EDGE_LENGTH)},O=function(V,H){H.fixedNodeConstraint&&(V.constraints.fixedNodeConstraint=H.fixedNodeConstraint),H.alignmentConstraint&&(V.constraints.alignmentConstraint=H.alignmentConstraint),H.relativePlacementConstraint&&(V.constraints.relativePlacementConstraint=H.relativePlacementConstraint)};w.nestingFactor!=null&&(v.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=y.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=w.nestingFactor),w.gravity!=null&&(v.DEFAULT_GRAVITY_STRENGTH=y.DEFAULT_GRAVITY_STRENGTH=w.gravity),w.numIter!=null&&(v.MAX_ITERATIONS=y.MAX_ITERATIONS=w.numIter),w.gravityRange!=null&&(v.DEFAULT_GRAVITY_RANGE_FACTOR=y.DEFAULT_GRAVITY_RANGE_FACTOR=w.gravityRange),w.gravityCompound!=null&&(v.DEFAULT_COMPOUND_GRAVITY_STRENGTH=y.DEFAULT_COMPOUND_GRAVITY_STRENGTH=w.gravityCompound),w.gravityRangeCompound!=null&&(v.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=y.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=w.gravityRangeCompound),w.initialEnergyOnIncremental!=null&&(v.DEFAULT_COOLING_FACTOR_INCREMENTAL=y.DEFAULT_COOLING_FACTOR_INCREMENTAL=w.initialEnergyOnIncremental),w.tilingCompareBy!=null&&(v.TILING_COMPARE_BY=w.tilingCompareBy),w.quality=="proof"?m.QUALITY=2:m.QUALITY=0,v.NODE_DIMENSIONS_INCLUDE_LABELS=y.NODE_DIMENSIONS_INCLUDE_LABELS=m.NODE_DIMENSIONS_INCLUDE_LABELS=w.nodeDimensionsIncludeLabels,v.DEFAULT_INCREMENTAL=y.DEFAULT_INCREMENTAL=m.DEFAULT_INCREMENTAL=!w.randomize,v.ANIMATE=y.ANIMATE=m.ANIMATE=w.animate,v.TILE=w.tile,v.TILING_PADDING_VERTICAL=typeof w.tilingPaddingVertical=="function"?w.tilingPaddingVertical.call():w.tilingPaddingVertical,v.TILING_PADDING_HORIZONTAL=typeof w.tilingPaddingHorizontal=="function"?w.tilingPaddingHorizontal.call():w.tilingPaddingHorizontal,v.DEFAULT_INCREMENTAL=y.DEFAULT_INCREMENTAL=m.DEFAULT_INCREMENTAL=!0,v.PURE_INCREMENTAL=!w.randomize,m.DEFAULT_UNIFORM_LEAF_NODE_SIZES=w.uniformNodeDimensions,w.step=="transformed"&&(v.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,v.ENFORCE_CONSTRAINTS=!1,v.APPLY_LAYOUT=!1),w.step=="enforced"&&(v.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,v.ENFORCE_CONSTRAINTS=!0,v.APPLY_LAYOUT=!1),w.step=="cose"&&(v.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,v.ENFORCE_CONSTRAINTS=!1,v.APPLY_LAYOUT=!0),w.step=="all"&&(w.randomize?v.TRANSFORM_ON_CONSTRAINT_HANDLING=!0:v.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,v.ENFORCE_CONSTRAINTS=!0,v.APPLY_LAYOUT=!0),w.fixedNodeConstraint||w.alignmentConstraint||w.relativePlacementConstraint?v.TREE_REDUCTION_ON_INCREMENTAL=!1:v.TREE_REDUCTION_ON_INCREMENTAL=!0;var B=new d,P=B.newGraphManager();return M(P.addRoot(),h.getTopMostNodes(S),B,w),D(B,P,L),O(B,w),B.runLayout(),F};o.exports={coseLayout:x}}),212:((o,l,u)=>{var h=(function(){function w(C,_){for(var k=0;k<_.length;k++){var S=_[k];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(C,S.key,S)}}return function(C,_,k){return _&&w(C.prototype,_),k&&w(C,k),C}})();function d(w,C){if(!(w instanceof C))throw new TypeError("Cannot call a class as a function")}var f=u(658),p=u(548),g=u(657),m=g.spectralLayout,y=u(816),v=y.coseLayout,x=Object.freeze({quality:"default",randomize:!0,animate:!0,animationDuration:1e3,animationEasing:void 0,fit:!0,padding:30,nodeDimensionsIncludeLabels:!1,uniformNodeDimensions:!1,packComponents:!0,step:"all",samplingType:!0,sampleSize:25,nodeSeparation:75,piTol:1e-7,nodeRepulsion:function(C){return 4500},idealEdgeLength:function(C){return 50},edgeElasticity:function(C){return .45},nestingFactor:.1,gravity:.25,numIter:2500,tile:!0,tilingCompareBy:void 0,tilingPaddingVertical:10,tilingPaddingHorizontal:10,gravityRangeCompound:1.5,gravityCompound:1,gravityRange:3.8,initialEnergyOnIncremental:.3,fixedNodeConstraint:void 0,alignmentConstraint:void 0,relativePlacementConstraint:void 0,ready:function(){},stop:function(){}}),b=(function(){function w(C){d(this,w),this.options=f({},x,C)}return h(w,[{key:"run",value:function(){var _=this,k=this.options,S=k.cy,L=k.eles,$=[],I=[],z=void 0,F=[];k.fixedNodeConstraint&&(!Array.isArray(k.fixedNodeConstraint)||k.fixedNodeConstraint.length==0)&&(k.fixedNodeConstraint=void 0),k.alignmentConstraint&&(k.alignmentConstraint.vertical&&(!Array.isArray(k.alignmentConstraint.vertical)||k.alignmentConstraint.vertical.length==0)&&(k.alignmentConstraint.vertical=void 0),k.alignmentConstraint.horizontal&&(!Array.isArray(k.alignmentConstraint.horizontal)||k.alignmentConstraint.horizontal.length==0)&&(k.alignmentConstraint.horizontal=void 0)),k.relativePlacementConstraint&&(!Array.isArray(k.relativePlacementConstraint)||k.relativePlacementConstraint.length==0)&&(k.relativePlacementConstraint=void 0);var A=k.fixedNodeConstraint||k.alignmentConstraint||k.relativePlacementConstraint;A&&(k.tile=!1,k.packComponents=!1);var R=void 0,N=!1;if(S.layoutUtilities&&k.packComponents&&(R=S.layoutUtilities("get"),R||(R=S.layoutUtilities()),N=!0),L.nodes().length>0)if(N){var O=p.getTopMostNodes(k.eles.nodes());if(z=p.connectComponents(S,k.eles,O),z.forEach(function(Ne){var ge=Ne.boundingBox();F.push({x:ge.x1+ge.w/2,y:ge.y1+ge.h/2})}),k.randomize&&z.forEach(function(Ne){k.eles=Ne,$.push(m(k))}),k.quality=="default"||k.quality=="proof"){var B=S.collection();if(k.tile){var P=new Map,G=[],V=[],H=0,W={nodeIndexes:P,xCoords:G,yCoords:V},ie=[];if(z.forEach(function(Ne,ge){Ne.edges().length==0&&(Ne.nodes().forEach(function(ve,ze){B.merge(Ne.nodes()[ze]),ve.isParent()||(W.nodeIndexes.set(Ne.nodes()[ze].id(),H++),W.xCoords.push(Ne.nodes()[0].position().x),W.yCoords.push(Ne.nodes()[0].position().y))}),ie.push(ge))}),B.length>1){var j=B.boundingBox();F.push({x:j.x1+j.w/2,y:j.y1+j.h/2}),z.push(B),$.push(W);for(var ae=ie.length-1;ae>=0;ae--)z.splice(ie[ae],1),$.splice(ie[ae],1),F.splice(ie[ae],1)}}z.forEach(function(Ne,ge){k.eles=Ne,I.push(v(k,$[ge])),p.relocateComponent(F[ge],I[ge],k)})}else z.forEach(function(Ne,ge){p.relocateComponent(F[ge],$[ge],k)});var J=new Set;if(z.length>1){var K=[],Q=L.filter(function(Ne){return Ne.css("display")=="none"});z.forEach(function(Ne,ge){var ve=void 0;if(k.quality=="draft"&&(ve=$[ge].nodeIndexes),Ne.nodes().not(Q).length>0){var ze={};ze.edges=[],ze.nodes=[];var xe=void 0;Ne.nodes().not(Q).forEach(function(Ke){if(k.quality=="draft")if(!Ke.isParent())xe=ve.get(Ke.id()),ze.nodes.push({x:$[ge].xCoords[xe]-Ke.boundingbox().w/2,y:$[ge].yCoords[xe]-Ke.boundingbox().h/2,width:Ke.boundingbox().w,height:Ke.boundingbox().h});else{var Ce=p.calcBoundingBox(Ke,$[ge].xCoords,$[ge].yCoords,ve);ze.nodes.push({x:Ce.topLeftX,y:Ce.topLeftY,width:Ce.width,height:Ce.height})}else I[ge][Ke.id()]&&ze.nodes.push({x:I[ge][Ke.id()].getLeft(),y:I[ge][Ke.id()].getTop(),width:I[ge][Ke.id()].getWidth(),height:I[ge][Ke.id()].getHeight()})}),Ne.edges().forEach(function(Ke){var Ce=Ke.source(),Ve=Ke.target();if(Ce.css("display")!="none"&&Ve.css("display")!="none")if(k.quality=="draft"){var Qe=ve.get(Ce.id()),nt=ve.get(Ve.id()),tt=[],Ze=[];if(Ce.isParent()){var ke=p.calcBoundingBox(Ce,$[ge].xCoords,$[ge].yCoords,ve);tt.push(ke.topLeftX+ke.width/2),tt.push(ke.topLeftY+ke.height/2)}else tt.push($[ge].xCoords[Qe]),tt.push($[ge].yCoords[Qe]);if(Ve.isParent()){var _e=p.calcBoundingBox(Ve,$[ge].xCoords,$[ge].yCoords,ve);Ze.push(_e.topLeftX+_e.width/2),Ze.push(_e.topLeftY+_e.height/2)}else Ze.push($[ge].xCoords[nt]),Ze.push($[ge].yCoords[nt]);ze.edges.push({startX:tt[0],startY:tt[1],endX:Ze[0],endY:Ze[1]})}else I[ge][Ce.id()]&&I[ge][Ve.id()]&&ze.edges.push({startX:I[ge][Ce.id()].getCenterX(),startY:I[ge][Ce.id()].getCenterY(),endX:I[ge][Ve.id()].getCenterX(),endY:I[ge][Ve.id()].getCenterY()})}),ze.nodes.length>0&&(K.push(ze),J.add(ge))}});var re=R.packComponents(K,k.randomize).shifts;if(k.quality=="draft")$.forEach(function(Ne,ge){var ve=Ne.xCoords.map(function(xe){return xe+re[ge].dx}),ze=Ne.yCoords.map(function(xe){return xe+re[ge].dy});Ne.xCoords=ve,Ne.yCoords=ze});else{var le=0;J.forEach(function(Ne){Object.keys(I[Ne]).forEach(function(ge){var ve=I[Ne][ge];ve.setCenter(ve.getCenterX()+re[le].dx,ve.getCenterY()+re[le].dy)}),le++})}}}else{var M=k.eles.boundingBox();if(F.push({x:M.x1+M.w/2,y:M.y1+M.h/2}),k.randomize){var D=m(k);$.push(D)}k.quality=="default"||k.quality=="proof"?(I.push(v(k,$[0])),p.relocateComponent(F[0],I[0],k)):p.relocateComponent(F[0],$[0],k)}var fe=function(ge,ve){if(k.quality=="default"||k.quality=="proof"){typeof ge=="number"&&(ge=ve);var ze=void 0,xe=void 0,Ke=ge.data("id");return I.forEach(function(Ve){Ke in Ve&&(ze={x:Ve[Ke].getRect().getCenterX(),y:Ve[Ke].getRect().getCenterY()},xe=Ve[Ke])}),k.nodeDimensionsIncludeLabels&&(xe.labelWidth&&(xe.labelPosHorizontal=="left"?ze.x+=xe.labelWidth/2:xe.labelPosHorizontal=="right"&&(ze.x-=xe.labelWidth/2)),xe.labelHeight&&(xe.labelPosVertical=="top"?ze.y+=xe.labelHeight/2:xe.labelPosVertical=="bottom"&&(ze.y-=xe.labelHeight/2))),ze==null&&(ze={x:ge.position("x"),y:ge.position("y")}),{x:ze.x,y:ze.y}}else{var Ce=void 0;return $.forEach(function(Ve){var Qe=Ve.nodeIndexes.get(ge.id());Qe!=null&&(Ce={x:Ve.xCoords[Qe],y:Ve.yCoords[Qe]})}),Ce==null&&(Ce={x:ge.position("x"),y:ge.position("y")}),{x:Ce.x,y:Ce.y}}};if(k.quality=="default"||k.quality=="proof"||k.randomize){var Ae=p.calcParentsWithoutChildren(S,L),Se=L.filter(function(Ne){return Ne.css("display")=="none"});k.eles=L.not(Se),L.nodes().not(":parent").not(Se).layoutPositions(_,k,fe),Ae.length>0&&Ae.forEach(function(Ne){Ne.position(fe(Ne))})}else console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'.")}}]),w})();o.exports=b}),657:((o,l,u)=>{var h=u(548),d=u(140).layoutBase.Matrix,f=u(140).layoutBase.SVD,p=function(m){var y=m.cy,v=m.eles,x=v.nodes(),b=v.nodes(":parent"),w=new Map,C=new Map,_=new Map,k=[],S=[],L=[],$=[],I=[],z=[],F=[],A=[],R=void 0,N=1e8,M=1e-9,D=m.piTol,O=m.samplingType,B=m.nodeSeparation,P=void 0,G=function(){for(var Z=0,pe=0,ne=!1;pe=Te;){De=Be[Te++];for(var we=k[De],ct=0;ctXe&&(Xe=I[_t],Ie=_t)}return Ie},H=function(Z){var pe=void 0;if(Z){pe=Math.floor(Math.random()*R);for(var Be=0;Be=1)break;Le=qe}for(var it=0;it=1)break;Le=qe}for(var ct=0;ct0&&(pe.isParent()?k[Z].push(_.get(pe.id())):k[Z].push(pe.id()))})});var Se=function(Z){var pe=C.get(Z),ne=void 0;w.get(Z).forEach(function(Be){y.getElementById(Be).isParent()?ne=_.get(Be):ne=Be,k[pe].push(ne),k[C.get(ne)].push(Z)})},Ne=!0,ge=!1,ve=void 0;try{for(var ze=w.keys()[Symbol.iterator](),xe;!(Ne=(xe=ze.next()).done);Ne=!0){var Ke=xe.value;Se(Ke)}}catch(he){ge=!0,ve=he}finally{try{!Ne&&ze.return&&ze.return()}finally{if(ge)throw ve}}R=C.size;var Ce=void 0;if(R>2){P=R{var h=u(212),d=function(p){p&&p("layout","fcose",h)};typeof cytoscape<"u"&&d(cytoscape),o.exports=d}),140:(o=>{o.exports=r})},i={};function a(o){var l=i[o];if(l!==void 0)return l.exports;var u=i[o]={exports:{}};return n[o](u,u.exports,a),u.exports}var s=a(579);return s})()})})(UA)),UA.exports}var iwt=nwt();const awt=po(iwt);var MCe={L:"left",R:"right",T:"top",B:"bottom"},NCe={L:T(t=>`${t},${t/2} 0,${t} 0,0`,"L"),R:T(t=>`0,${t/2} ${t},0 ${t},${t}`,"R"),T:T(t=>`0,0 ${t},0 ${t/2},${t}`,"T"),B:T(t=>`${t/2},0 ${t},${t} 0,${t}`,"B")},XA={L:T((t,e)=>t-e+2,"L"),R:T((t,e)=>t-2,"R"),T:T((t,e)=>t-e+2,"T"),B:T((t,e)=>t-2,"B")},swt=T(function(t){return Vs(t)?t==="L"?"R":"L":t==="T"?"B":"T"},"getOppositeArchitectureDirection"),$Ce=T(function(t){const e=t;return e==="L"||e==="R"||e==="T"||e==="B"},"isArchitectureDirection"),Vs=T(function(t){const e=t;return e==="L"||e==="R"},"isArchitectureDirectionX"),Pd=T(function(t){const e=t;return e==="T"||e==="B"},"isArchitectureDirectionY"),VG=T(function(t,e){const r=Vs(t)&&Pd(e),n=Pd(t)&&Vs(e);return r||n},"isArchitectureDirectionXY"),owt=T(function(t){const e=t[0],r=t[1],n=Vs(e)&&Pd(r),i=Pd(e)&&Vs(r);return n||i},"isArchitecturePairXY"),lwt=T(function(t){return t!=="LL"&&t!=="RR"&&t!=="TT"&&t!=="BB"},"isValidArchitectureDirectionPair"),WG=T(function(t,e){const r=`${t}${e}`;return lwt(r)?r:void 0},"getArchitectureDirectionPair"),cwt=T(function([t,e],r){const n=r[0],i=r[1];return Vs(n)?Pd(i)?[t+(n==="L"?-1:1),e+(i==="T"?1:-1)]:[t+(n==="L"?-1:1),e]:Vs(i)?[t+(i==="L"?1:-1),e+(n==="T"?1:-1)]:[t,e+(n==="T"?1:-1)]},"shiftPositionByArchitectureDirectionPair"),uwt=T(function(t){return t==="LT"||t==="TL"?[1,1]:t==="BL"||t==="LB"?[1,-1]:t==="BR"||t==="RB"?[-1,-1]:[-1,1]},"getArchitectureDirectionXYFactors"),hwt=T(function(t,e){return VG(t,e)?"bend":Vs(t)?"horizontal":"vertical"},"getArchitectureDirectionAlignment"),dwt=T(function(t){return t.type==="service"},"isArchitectureService"),fwt=T(function(t){return t.type==="junction"},"isArchitectureJunction"),OCe=T(t=>t.data(),"edgeData"),G1=T(t=>t.data(),"nodeData"),pwt=Xr.architecture,PCe=(Eb=class{constructor(){this.nodes={},this.groups={},this.edges=[],this.registeredIds={},this.elements={},this.diagramId="",this.setAccTitle=Yn,this.getAccTitle=ii,this.setDiagramTitle=oi,this.getDiagramTitle=Xn,this.getAccDescription=si,this.setAccDescription=ai,this.clear()}setDiagramId(e){this.diagramId=e}getDiagramId(){return this.diagramId}clear(){this.nodes={},this.groups={},this.edges=[],this.registeredIds={},this.dataStructures=void 0,this.elements={},this.diagramId="",Hn()}addService({id:e,icon:r,in:n,title:i,iconText:a}){if(this.registeredIds[e]!==void 0)throw new Error(`The service id [${e}] is already in use by another ${this.registeredIds[e]}`);if(n!==void 0){if(e===n)throw new Error(`The service [${e}] cannot be placed within itself`);if(this.registeredIds[n]===void 0)throw new Error(`The service [${e}]'s parent does not exist. Please make sure the parent is created before this service`);if(this.registeredIds[n]==="node")throw new Error(`The service [${e}]'s parent is not a group`)}this.registeredIds[e]="node",this.nodes[e]={id:e,type:"service",icon:r,iconText:a,title:i,edges:[],in:n}}getServices(){return Object.values(this.nodes).filter(dwt)}addJunction({id:e,in:r}){if(this.registeredIds[e]!==void 0)throw new Error(`The junction id [${e}] is already in use by another ${this.registeredIds[e]}`);if(r!==void 0){if(e===r)throw new Error(`The junction [${e}] cannot be placed within itself`);if(this.registeredIds[r]===void 0)throw new Error(`The junction [${e}]'s parent does not exist. Please make sure the parent is created before this junction`);if(this.registeredIds[r]==="node")throw new Error(`The junction [${e}]'s parent is not a group`)}this.registeredIds[e]="node",this.nodes[e]={id:e,type:"junction",edges:[],in:r}}getJunctions(){return Object.values(this.nodes).filter(fwt)}getNodes(){return Object.values(this.nodes)}getNode(e){return this.nodes[e]??null}addGroup({id:e,icon:r,in:n,title:i}){var a,s,o;if(((a=this.registeredIds)==null?void 0:a[e])!==void 0)throw new Error(`The group id [${e}] is already in use by another ${this.registeredIds[e]}`);if(n!==void 0){if(e===n)throw new Error(`The group [${e}] cannot be placed within itself`);if(((s=this.registeredIds)==null?void 0:s[n])===void 0)throw new Error(`The group [${e}]'s parent does not exist. Please make sure the parent is created before this group`);if(((o=this.registeredIds)==null?void 0:o[n])==="node")throw new Error(`The group [${e}]'s parent is not a group`)}this.registeredIds[e]="group",this.groups[e]={id:e,icon:r,title:i,in:n}}getGroups(){return Object.values(this.groups)}addEdge({lhsId:e,rhsId:r,lhsDir:n,rhsDir:i,lhsInto:a,rhsInto:s,lhsGroup:o,rhsGroup:l,title:u}){if(!$Ce(n))throw new Error(`Invalid direction given for left hand side of edge ${e}--${r}. Expected (L,R,T,B) got ${String(n)}`);if(!$Ce(i))throw new Error(`Invalid direction given for right hand side of edge ${e}--${r}. Expected (L,R,T,B) got ${String(i)}`);if(this.nodes[e]===void 0&&this.groups[e]===void 0)throw new Error(`The left-hand id [${e}] does not yet exist. Please create the service/group before declaring an edge to it.`);if(this.nodes[r]===void 0&&this.groups[r]===void 0)throw new Error(`The right-hand id [${r}] does not yet exist. Please create the service/group before declaring an edge to it.`);const h=this.nodes[e].in,d=this.nodes[r].in;if(o&&h&&d&&h==d)throw new Error(`The left-hand id [${e}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);if(l&&h&&d&&h==d)throw new Error(`The right-hand id [${r}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);const f={lhsId:e,lhsDir:n,lhsInto:a,lhsGroup:o,rhsId:r,rhsDir:i,rhsInto:s,rhsGroup:l,title:u};this.edges.push(f),this.nodes[e]&&this.nodes[r]&&(this.nodes[e].edges.push(this.edges[this.edges.length-1]),this.nodes[r].edges.push(this.edges[this.edges.length-1]))}getEdges(){return this.edges}getDataStructures(){if(this.dataStructures===void 0){const e={},r=Object.entries(this.nodes).reduce((l,[u,h])=>(l[u]=h.edges.reduce((d,f)=>{var m,y;const p=(m=this.getNode(f.lhsId))==null?void 0:m.in,g=(y=this.getNode(f.rhsId))==null?void 0:y.in;if(p&&g&&p!==g){const v=hwt(f.lhsDir,f.rhsDir);v!=="bend"&&(e[p]??(e[p]={}),e[p][g]=v,e[g]??(e[g]={}),e[g][p]=v)}if(f.lhsId===u){const v=WG(f.lhsDir,f.rhsDir);v&&(d[v]=f.rhsId)}else{const v=WG(f.rhsDir,f.lhsDir);v&&(d[v]=f.lhsId)}return d},{}),l),{}),n=Object.keys(r)[0],i={[n]:1},a=Object.keys(r).reduce((l,u)=>u===n?l:{...l,[u]:1},{}),s=T(l=>{const u={[l]:[0,0]},h=[l];for(;h.length>0;){const d=h.shift();if(d){i[d]=1,delete a[d];const f=r[d],[p,g]=u[d];Object.entries(f).forEach(([m,y])=>{i[y]||(u[y]=cwt([p,g],m),h.push(y))})}}return u},"BFS"),o=[s(n)];for(;Object.keys(a).length>0;)o.push(s(Object.keys(a)[0]));this.dataStructures={adjList:r,spatialMaps:o,groupAlignments:e}}return this.dataStructures}setElementForId(e,r){this.elements[e]=r}getElementById(e){return this.elements[e]}getConfig(){return wi({...pwt,...pr().architecture})}getConfigField(e){return this.getConfig()[e]}},T(Eb,"ArchitectureDB"),Eb),gwt=T((t,e)=>{Rc(t,e),t.groups.map(r=>e.addGroup(r)),t.services.map(r=>e.addService({...r,type:"service"})),t.junctions.map(r=>e.addJunction({...r,type:"junction"})),t.edges.map(r=>e.addEdge(r))},"populateDb"),BCe={parser:{yy:void 0},parse:T(async t=>{var n;const e=await Bl("architecture",t);se.debug(e);const r=(n=BCe.parser)==null?void 0:n.yy;if(!(r instanceof PCe))throw new Error("parser.parser?.yy was not a ArchitectureDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");gwt(e,r)},"parse")},mwt=T(t=>` .edge { stroke-width: ${t.archEdgeWidth}; stroke: ${t.archEdgeColor}; @@ -3158,10 +3159,10 @@ Expecting `+ne.join(", ")+", got '"+(this.terminals_[Y]||Y)+"'":ue="Parse error stroke-dasharray: 8; } .node-icon-text { - display: flex; + display: flex; align-items: center; } - + .node-icon-text > div { color: #fff; margin: 1px; @@ -3171,19 +3172,19 @@ Expecting `+ne.join(", ")+", got '"+(this.terminals_[Y]||Y)+"'":ue="Parse error display: -webkit-box; -webkit-box-orient: vertical; } -`,"getStyles"),Ipt=Lpt,cm=x(t=>`${t}`,"wrapIcon"),aw={prefix:"mermaid-architecture",height:80,width:80,icons:{database:{body:cm('')},server:{body:cm('')},disk:{body:cm('')},internet:{body:cm('')},cloud:{body:cm('')},unknown:NV,blank:{body:cm("")}}},Dpt=x(async function(t,e,r,n){const i=r.getConfigField("padding"),a=r.getConfigField("iconSize"),s=a/2,o=a/6,l=o/2;await Promise.all(e.edges().map(async u=>{var O,M;const{source:h,sourceDir:d,sourceArrow:f,sourceGroup:p,target:g,targetDir:m,targetArrow:y,targetGroup:v,label:T}=bye(u);let{x:b,y:w}=u[0].sourceEndpoint();const{x:k,y:A}=u[0].midpoint();let{x:C,y:_}=u[0].targetEndpoint();const L=i+4;if(p&&(fs(d)?b+=d==="L"?-L:L:w+=d==="T"?-L:L+18),v&&(fs(m)?C+=m==="L"?-L:L:_+=m==="T"?-L:L+18),!p&&((O=r.getNode(h))==null?void 0:O.type)==="junction"&&(fs(d)?b+=d==="L"?s:-s:w+=d==="T"?s:-s),!v&&((M=r.getNode(g))==null?void 0:M.type)==="junction"&&(fs(m)?C+=m==="L"?s:-s:_+=m==="T"?s:-s),u[0]._private.rscratch){const z=t.insert("g");if(z.insert("path").attr("d",`M ${b},${w} L ${k},${A} L${C},${_} `).attr("class","edge").attr("id",`${n}-${V0(h,g,{prefix:"L"})}`),f){const F=fs(d)?KS[d](b,o):b-l,S=Oh(d)?KS[d](w,o):w-l;z.insert("polygon").attr("points",yye[d](o)).attr("transform",`translate(${F},${S})`).attr("class","arrow")}if(y){const F=fs(m)?KS[m](C,o):C-l,S=Oh(m)?KS[m](_,o):_-l;z.insert("polygon").attr("points",yye[m](o)).attr("transform",`translate(${F},${S})`).attr("class","arrow")}if(T){const F=pP(d,m)?"XY":fs(d)?"X":"Y";let S=0;F==="X"?S=Math.abs(b-C):F==="Y"?S=Math.abs(w-_)/1.5:S=Math.abs(b-C)/2;const R=z.append("g");if(await Wa(R,T,{useHtmlLabels:!1,width:S,classes:"architecture-service-label"},Pe()),R.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),F==="X")R.attr("transform","translate("+k+", "+A+")");else if(F==="Y")R.attr("transform","translate("+k+", "+A+") rotate(-90)");else if(F==="XY"){const N=gP(d,m);if(N&&Tpt(N)){const D=R.node().getBoundingClientRect(),[I,$]=kpt(N);R.attr("dominant-baseline","auto").attr("transform",`rotate(${-1*I*$*45})`);const B=R.node().getBoundingClientRect();R.attr("transform",` - translate(${k}, ${A-D.height/2}) - translate(${I*B.width/2}, ${$*B.height/2}) - rotate(${-1*I*$*45}, 0, ${D.height/2}) - `)}}}}}))},"drawEdges"),Mpt=x(async function(t,e,r,n){const a=r.getConfigField("padding")*.75,s=r.getConfigField("fontSize"),l=r.getConfigField("iconSize")/2;await Promise.all(e.nodes().map(async u=>{const h=lm(u);if(h.type==="group"){const{h:d,w:f,x1:p,y1:g}=u.boundingBox(),m=t.append("rect");m.attr("id",`${n}-group-${h.id}`).attr("x",p+l).attr("y",g+l).attr("width",f).attr("height",d).attr("class","node-bkg");const y=t.append("g");let v=p,T=g;if(h.icon){const b=y.append("g");b.html(`${await Lu(h.icon,{height:a,width:a,fallbackPrefix:aw.prefix})}`),b.attr("transform","translate("+(v+l+1)+", "+(T+l+1)+")"),v+=a,T+=s/2-1-2}if(h.label){const b=y.append("g");await Wa(b,h.label,{useHtmlLabels:!1,width:f,classes:"architecture-service-label"},Pe()),b.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","start").attr("text-anchor","start"),b.attr("transform","translate("+(v+l+4)+", "+(T+l+2)+")")}r.setElementForId(h.id,m)}}))},"drawGroups"),Npt=x(async function(t,e,r,n){const i=Pe();for(const a of r){const s=e.append("g"),o=t.getConfigField("iconSize");if(a.title){const d=s.append("g");await Wa(d,a.title,{useHtmlLabels:!1,width:o*1.5,classes:"architecture-service-label"},i),d.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),d.attr("transform","translate("+o/2+", "+o+")")}const l=s.append("g");if(a.icon)l.html(`${await Lu(a.icon,{height:o,width:o,fallbackPrefix:aw.prefix})}`);else if(a.iconText){l.html(`${await Lu("blank",{height:o,width:o,fallbackPrefix:aw.prefix})}`);const p=l.append("g").append("foreignObject").attr("width",o).attr("height",o).append("div").attr("class","node-icon-text").attr("style",`height: ${o}px;`).append("div").html(qr(a.iconText,i)),g=parseInt(window.getComputedStyle(p.node(),null).getPropertyValue("font-size").replace(/\D/g,""))??16;p.attr("style",`-webkit-line-clamp: ${Math.floor((o-2)/g)};`)}else l.append("path").attr("class","node-bkg").attr("id",`${n}-node-${a.id}`).attr("d",`M0,${o} V5 Q0,0 5,0 H${o-5} Q${o},0 ${o},5 V${o} Z`);s.attr("id",`${n}-service-${a.id}`).attr("class","architecture-service");const{width:u,height:h}=s.node().getBBox();a.width=u,a.height=h,t.setElementForId(a.id,s)}return 0},"drawServices"),Opt=x(function(t,e,r,n){r.forEach(i=>{const a=e.append("g"),s=t.getConfigField("iconSize");a.append("g").append("rect").attr("id",`${n}-node-${i.id}`).attr("fill-opacity","0").attr("width",s).attr("height",s),a.attr("class","architecture-junction");const{width:l,height:u}=a._groups[0][0].getBBox();a.width=l,a.height=u,t.setElementForId(i.id,a)})},"drawJunctions");$V([{name:aw.prefix,icons:aw}]),Pl.use(bpt);function wye(t,e,r){t.forEach(n=>{e.add({group:"nodes",data:{type:"service",id:n.id,icon:n.icon,label:n.title,parent:n.in,width:r.getConfigField("iconSize"),height:r.getConfigField("iconSize")},classes:"node-service"})})}x(wye,"addServices");function Cye(t,e,r){t.forEach(n=>{e.add({group:"nodes",data:{type:"junction",id:n.id,parent:n.in,width:r.getConfigField("iconSize"),height:r.getConfigField("iconSize")},classes:"node-junction"})})}x(Cye,"addJunctions");function kye(t,e){e.nodes().map(r=>{const n=lm(r);if(n.type==="group")return;n.x=r.position().x,n.y=r.position().y,t.getElementById(n.id).attr("transform","translate("+(n.x||0)+","+(n.y||0)+")")})}x(kye,"positionNodes");function Eye(t,e){t.forEach(r=>{e.add({group:"nodes",data:{type:"group",id:r.id,icon:r.icon,label:r.title,parent:r.in},classes:"node-group"})})}x(Eye,"addGroups");function Sye(t,e){t.forEach(r=>{const{lhsId:n,rhsId:i,lhsInto:a,lhsGroup:s,rhsInto:o,lhsDir:l,rhsDir:u,rhsGroup:h,title:d}=r,f=pP(r.lhsDir,r.rhsDir)?"segments":"straight",p={id:`${n}-${i}`,label:d,source:n,sourceDir:l,sourceArrow:a,sourceGroup:s,sourceEndpoint:l==="L"?"0 50%":l==="R"?"100% 50%":l==="T"?"50% 0":"50% 100%",target:i,targetDir:u,targetArrow:o,targetGroup:h,targetEndpoint:u==="L"?"0 50%":u==="R"?"100% 50%":u==="T"?"50% 0":"50% 100%"};e.add({group:"edges",data:p,classes:f})})}x(Sye,"addEdges");function Aye(t,e,r){const n=x((o,l)=>Object.entries(o).reduce((u,[h,d])=>{var g;let f=0;const p=Object.entries(d);if(p.length===1)return u[h]=p[0][1],u;for(let m=0;m{const l={},u={};return Object.entries(o).forEach(([h,[d,f]])=>{var g,m,y;const p=((g=t.getNode(h))==null?void 0:g.in)??"default";l[f]??(l[f]={}),(m=l[f])[p]??(m[p]=[]),l[f][p].push(h),u[d]??(u[d]={}),(y=u[d])[p]??(y[p]=[]),u[d][p].push(h)}),{horiz:Object.values(n(l,"horizontal")).filter(h=>h.length>1),vert:Object.values(n(u,"vertical")).filter(h=>h.length>1)}}),[a,s]=i.reduce(([o,l],{horiz:u,vert:h})=>[[...o,...u],[...l,...h]],[[],[]]);return{horizontal:a,vertical:s}}x(Aye,"getAlignments");function _ye(t,e){const r=[],n=x(a=>`${a[0]},${a[1]}`,"posToStr"),i=x(a=>a.split(",").map(s=>parseInt(s)),"strToPos");return t.forEach(a=>{const s=Object.fromEntries(Object.entries(a).map(([h,d])=>[n(d),h])),o=[n([0,0])],l={},u={L:[-1,0],R:[1,0],T:[0,1],B:[0,-1]};for(;o.length>0;){const h=o.shift();if(h){l[h]=1;const d=s[h];if(d){const f=i(h);Object.entries(u).forEach(([p,g])=>{const m=n([f[0]+g[0],f[1]+g[1]]),y=s[m];y&&!l[m]&&(o.push(m),r.push({[mye[p]]:y,[mye[xpt(p)]]:d,gap:1.5*e.getConfigField("iconSize")}))})}}}}),r}x(_ye,"getRelativeConstraints");function Rye(t,e,r,n,i,{spatialMaps:a,groupAlignments:s}){return new Promise(o=>{const l=pt("body").append("div").attr("id","cy").attr("style","display:none"),u=Pl({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"straight","source-endpoint":"data(sourceEndpoint)","target-endpoint":"data(targetEndpoint)"}},{selector:"edge[label]",style:{label:"data(label)"}},{selector:"edge.segments",style:{"curve-style":"segments","segment-weights":"0","segment-distances":[.5],"edge-distances":"endpoints","source-endpoint":"data(sourceEndpoint)","target-endpoint":"data(targetEndpoint)"}},{selector:"node",style:{"compound-sizing-wrt-labels":"include"}},{selector:"node[label]",style:{"text-valign":"bottom","text-halign":"center","font-size":`${i.getConfigField("fontSize")}px`}},{selector:".node-service",style:{label:"data(label)",width:"data(width)",height:"data(height)"}},{selector:".node-junction",style:{width:"data(width)",height:"data(height)"}},{selector:".node-group",style:{padding:`${i.getConfigField("padding")}px`}}],layout:{name:"grid",boundingBox:{x1:0,x2:100,y1:0,y2:100}}});l.remove(),Eye(r,u),wye(t,u,i),Cye(e,u,i),Sye(n,u);const h=Aye(i,a,s),d=_ye(a,i),f=i.getConfigField("iconSize"),p=i.getConfigField("idealEdgeLengthMultiplier")*f,g=.5*f,m=i.getConfigField("edgeElasticity"),y=u.layout({name:"fcose",quality:"proof",randomize:i.getConfigField("randomize"),nodeSeparation:i.getConfigField("nodeSeparation"),numIter:i.getConfigField("numIter"),styleEnabled:!1,animate:!1,nodeDimensionsIncludeLabels:!1,idealEdgeLength(v){const[T,b]=v.connectedNodes(),{parent:w}=lm(T),{parent:k}=lm(b);return w===k?p:g},edgeElasticity(v){const[T,b]=v.connectedNodes(),{parent:w}=lm(T),{parent:k}=lm(b);return w===k?m:.001},alignmentConstraint:h,relativePlacementConstraint:d});y.one("layoutstop",()=>{var T;function v(b,w,k,A){let C,_;const{x:L,y:O}=b,{x:M,y:z}=w;_=(A-O+(L-k)*(O-z)/(L-M))/Math.sqrt(1+Math.pow((O-z)/(L-M),2)),C=Math.sqrt(Math.pow(A-O,2)+Math.pow(k-L,2)-Math.pow(_,2));const F=Math.sqrt(Math.pow(M-L,2)+Math.pow(z-O,2));C=C/F;let S=(M-L)*(A-O)-(z-O)*(k-L);switch(!0){case S>=0:S=1;break;case S<0:S=-1;break}let R=(M-L)*(k-L)+(z-O)*(A-O);switch(!0){case R>=0:R=1;break;case R<0:R=-1;break}return _=Math.abs(_)*S,C=C*R,{distances:_,weights:C}}x(v,"getSegmentWeights"),u.startBatch();for(const b of Object.values(u.edges()))if((T=b.data)!=null&&T.call(b)){const{x:w,y:k}=b.source().position(),{x:A,y:C}=b.target().position();if(w!==A&&k!==C){const _=b.sourceEndpoint(),L=b.targetEndpoint(),{sourceDir:O}=bye(b),[M,z]=Oh(O)?[_.x,L.y]:[L.x,_.y],{weights:F,distances:S}=v(_,L,M,z);b.style("segment-distances",S),b.style("segment-weights",F)}}u.endBatch(),y.run()}),y.run(),u.ready(v=>{ae.info("Ready",v),o(u)})})}x(Rye,"layoutArchitecture");var $pt=x(async(t,e,r,n)=>{const i=n.db;i.setDiagramId(e);const a=i.getServices(),s=i.getJunctions(),o=i.getGroups(),l=i.getEdges(),u=i.getDataStructures(),h=ys(e),d=h.append("g");d.attr("class","architecture-edges");const f=h.append("g");f.attr("class","architecture-services");const p=h.append("g");p.attr("class","architecture-groups"),await Npt(i,f,a,e),Opt(i,f,s,e);const g=await Rye(a,s,o,l,i,u);await Dpt(d,g,i,e),await Mpt(p,g,i,e),kye(i,g),E0(void 0,h,i.getConfigField("padding"),i.getConfigField("useMaxWidth"))},"draw"),Ppt={draw:$pt},Bpt={parser:Tye,get db(){return new xye},renderer:Ppt,styles:Ipt};const Fpt=Object.freeze(Object.defineProperty({__proto__:null,diagram:Bpt},Symbol.toStringTag,{value:"Module"}));var Lye="position frame",Iye="frame positioned",mP="position relation",Dye="relation positioned",zpt=x(function(t){ae.debug("options str",t)},"setOptions"),Gpt=x(function(){return{}},"getOptions"),qpt=x(function(){Mye(),In()},"clear");function Mye(){yP={}}x(Mye,"reset");var Vpt=Fr.eventmodeling,Wpt=x(()=>ti({...Vpt,...lr().eventmodeling}),"getConfig"),yP={};function Nye(){let t=Upt;const{ast:e}=yP,r=vP();if(!e)throw new Error("No data for EventModel");return e.frames.forEach((n,i)=>{const a=Gye(n,e.dataEntities,r);t=ZS(t,{$kind:Lye,index:i,frame:n,textProps:a});let s;Yye(n)?(ae.debug("source frame",n.sourceFrames),s=e.frames.filter(o=>n.sourceFrames.some(l=>l.$refText===o.name)),s.forEach(o=>{t=ZS(t,{$kind:mP,index:i,frame:n,sourceFrame:o})})):t=ZS(t,{$kind:mP,index:i,frame:n})}),t={...t,sortedSwimlanesArray:bP(t.swimlanes)},t}x(Nye,"getState");function Oye(t){yP.ast=t}x(Oye,"setAst");var rn={swimlaneMinHeight:70,swimlanePadding:15,swimlaneGap:10,boxPadding:10,boxOverlap:90,boxDefaultY:0,boxMinWidth:80,boxMaxWidth:450,boxMinHeight:80,boxMaxHeight:750,contentStartX:250,textMaxWidth:430,boxTextFontWeight:"bold",boxTextPadding:10,swimlaneTextFontWeight:"bold",labelUiAutomation:"UI/Automation",labelUiAutomationPrefix:"UI/A: ",labelCommandReadModel:"Command/Read Model",labelCommandReadModelPrefix:"C/RM: ",labelEvents:"Events",labelEventsPrefix:"Stream: "};function vP(){return rn}x(vP,"getDiagramProps");var Upt={boxes:[],swimlanes:{},relations:[],maxR:0,sortedSwimlanesArray:[]};function $ye(t){const e=t.split(".");if(e.length===2)return e[0]}x($ye,"extractNamespace");function Pye(t){const e=t.split(".");return e.length===2?e[1]:t}x(Pye,"extractName");function Bye(t,e){if(!(!e||e.length===0))return Object.values(t).find(r=>r.namespace===e)}x(Bye,"findSwimlaneByNamespace");function jS(t,e,r){return Math.max(e,...Object.keys(t).filter(n=>{const i=Number.parseInt(n);return i>e&&iNumber.parseInt(n)))+1}x(jS,"findNextAvailableIndex");function Fye(t,e){const r=$ye(t.entityIdentifier),n=Bye(e,r);switch(t.modelEntityType){case"ui":case"pcr":case"processor":return n?{index:n.index,label:n.namespace||rn.labelUiAutomation}:r?{index:jS(e,0,100),label:rn.labelUiAutomationPrefix+r}:{index:0,label:rn.labelUiAutomation};case"rmo":case"readmodel":case"cmd":case"command":return n?{index:n.index,label:n.namespace||rn.labelCommandReadModel}:r?{index:jS(e,100,200),label:rn.labelCommandReadModelPrefix+r}:{index:100,label:rn.labelCommandReadModel};case"evt":case"event":default:return n?{index:n.index,label:n.namespace||rn.labelEvents}:r?{index:jS(e,200,300),label:rn.labelEventsPrefix+r}:{index:200,label:rn.labelEvents}}}x(Fye,"calculateSwimlaneProps");function zye(t){const{themeVariables:e}=lr();switch(t.modelEntityType){case"ui":return{fill:e.emUiFill??"white",stroke:e.emUiStroke??"#dbdada"};case"pcr":case"processor":return{fill:e.emProcessorFill??"#edb3f6",stroke:e.emProcessorStroke??"#b88cbf"};case"rmo":case"readmodel":return{fill:e.emReadModelFill??"#d3f1a2",stroke:e.emReadModelStroke??"#a3b732"};case"cmd":case"command":return{fill:e.emCommandFill??"#bcd6fe",stroke:e.emCommandStroke??"#679ac3"};case"evt":case"event":return{fill:e.emEventFill??"#ffb778",stroke:e.emEventStroke??"#c19a0f"};default:return{fill:"red",stroke:"black"}}}x(zye,"calculateEntityVisualProps");function Gye(t,e,r){const n=lr(),i=qr(Pye(t.entityIdentifier)??"",n);let a;const s={fontSize:16,fontWeight:700,fontFamily:'"trebuchet ms", verdana, arial, sans-serif',joinWith:"
    "};let l=`${U2(i,r.textMaxWidth,s)}`;if(t.dataInlineValue&&(a=t.dataInlineValue,a=a.substring(a.indexOf("{")+1),a=a.substring(0,a.lastIndexOf("}")-1),a=qr(a,n),a=U2(a,r.textMaxWidth,s),a=a.replaceAll(" "," ")),t.dataReference){const g=e.find(m=>{var y;return m.name===((y=t.dataReference)==null?void 0:y.$refText)});g&&(a=g.dataBlockValue,a=a.substring(a.indexOf(`{ -`)+2),a=a.substring(0,a.lastIndexOf("}")-1),a=qr(a,n),a=U2(a,r.textMaxWidth,s),a=a.replaceAll(" "," "),a+="
    ")}const u=a!==void 0;u&&(l+=`

    ${a}`);const h={fontSize:s.fontSize,fontWeight:s.fontWeight,fontFamily:s.fontFamily},d=M4(l,h),f=u?d.width/3:d.width,p={content:l,width:f,height:d.height};return ae.debug(`[${t.name}] ${t.entityIdentifier} text`,p),p}x(Gye,"calculateTextProps");function qye(t,e){const r=e,n=zye(r.frame),i={width:r.textProps.width+2*rn.boxTextPadding,height:r.textProps.height+2*rn.boxTextPadding};return[{$kind:Iye,frame:r.frame,index:r.index,visual:n,dimension:i,textProps:r.textProps}]}x(qye,"decidePositionFrame");function Vye(t,e,r){return e===void 0?rn.contentStartX:e.index===t.index&&t.r?t.r+rn.boxPadding:r===void 0?rn.contentStartX:r.r-rn.boxOverlap+rn.boxPadding}x(Vye,"calculateX");function Wye(t,e){const r=[...t.map(n=>n.r),e];return Math.max(...r)}x(Wye,"calculateMaxRight");function bP(t){return Object.values(t).sort((e,r)=>e.index-r.index)}x(bP,"sortedSwimlanesArray");function Uye(t,e){const r=e,n=Fye(r.frame,t.swimlanes);let i;n.index in t.swimlanes?i=t.swimlanes[n.index]:i={index:n.index,label:n.label,r:0,y:n.index*rn.swimlaneMinHeight+rn.swimlaneGap,height:rn.swimlaneMinHeight,maxHeight:rn.swimlaneMinHeight};const a=t.boxes.length>0?t.boxes[t.boxes.length-1]:void 0,s=t.previousSwimlaneNumber!==void 0?t.swimlanes[t.previousSwimlaneNumber]:void 0,o={width:Math.max(rn.boxMinWidth,Math.min(rn.boxMaxWidth,r.dimension.width))+2*rn.boxPadding,height:Math.max(rn.boxMinHeight,Math.min(rn.boxMaxHeight,r.dimension.height))+2*rn.boxPadding},l=Vye(i,s,a),u=l+o.width+rn.boxPadding,h=Wye(Object.values(t.swimlanes),u);i.r=l+o.width,i.maxHeight=Math.max(i.maxHeight,o.height),i.height=Math.max(rn.swimlaneMinHeight,i.maxHeight)+2*rn.swimlanePadding;const d={x:l,y:rn.swimlanePadding+i.y,r:u,dimension:o,leftSibling:!1,swimlane:i,visual:r.visual,text:r.textProps.content,frame:r.frame,index:r.index},f={...t,boxes:[...t.boxes,d],swimlanes:{...t.swimlanes,[`${i.index}`]:i},previousSwimlaneNumber:n.index,previousFrame:r.frame,maxR:h},p=bP(f.swimlanes);p.length>0&&(p[0].y=0);for(let g=1;g0}x(Yye,"hasSourceFrame");function xP(t,e){if(e!=null)return t.find(r=>r.frame.name===e.name)}x(xP,"findBoxByFrame");function Xye(t,e,r){if(!(r<0))for(let n=r;n>=0;n--){const i=t[n];if(i.swimlane.index!==e)return i}}x(Xye,"findBoxByLineIndex");function Kye(t,e){const r=e;if(E0e(r.frame)||Hye(r.index,r.frame))return[];const n=xP(t.boxes,r.frame);if(n===void 0)throw new Error(`Target box not found for frame ${r.frame.name}`);let i;return r.sourceFrame?i=xP(t.boxes,r.sourceFrame):i=Xye(t.boxes,n.swimlane.index,r.index-1),i===void 0?[]:[{$kind:Dye,frame:r.frame,index:r.index,sourceBox:i,targetBox:n}]}x(Kye,"decidePositionRelation");function jye(t,e){const r=e,n={visual:{fill:"none",stroke:"#000"},source:{x:r.sourceBox.x,y:r.sourceBox.y},target:{x:r.targetBox.x,y:r.targetBox.y},sourceBox:r.sourceBox,targetBox:r.targetBox};return{...t,relations:[...t.relations,n]}}x(jye,"evolveRelationPositioned");var Hpt={[Lye]:qye,[mP]:Kye},Ypt={[Iye]:Uye,[Dye]:jye};function Zye(t,e){const r=Hpt[e.$kind];if(r==null)return[];const n=r(t,e);return ae.debug("decided events",n),n}x(Zye,"decide");function Qye(t,e){const r=e.reduce((n,i)=>{const a=Ypt[i.$kind];return a==null?n:a(n,i)},t);return ae.debug("evolve events",{state:t,newState:r,events:e}),r}x(Qye,"evolve");function ZS(t,e){const r=Zye(t,e);return Qye(t,r)}x(ZS,"dispatch");var TP={getConfig:Wpt,setOptions:zpt,getOptions:Gpt,clear:qpt,setAccTitle:Dn,getAccTitle:Fn,getAccDescription:Gn,setAccDescription:zn,setDiagramTitle:qn,getDiagramTitle:Mn,setAst:Oye,getDiagramProps:vP,getState:Nye},Xpt={parse:x(async t=>{const e=await Qo("eventmodeling",t);ae.debug(e),TP.setAst(e),zl(e,TP)},"parse")},wP=Pe(),Kpt=wP==null?void 0:wP.eventmodeling;function Jye(t,e){return r=>{const n=r.swimlane.y+e.swimlanePadding,i=t.append("g").attr("class","em-box");i.append("rect").attr("x",r.x).attr("y",n).attr("rx","3").attr("width",r.dimension.width).attr("height",r.dimension.height).attr("stroke",r.visual.stroke).attr("fill",r.visual.fill),i.append("foreignObject").attr("x",r.x+e.boxPadding).attr("y",n+10).attr("width",r.dimension.width-2*e.boxPadding).attr("height",r.dimension.height-2*e.boxPadding).append("xhtml:div").style("display","table").style("height","100%").style("width","100%").append("span").style("display","table-cell").style("text-align","center").style("vertical-align","middle").html(r.text)}}x(Jye,"renderD3Box");function eve(t,e){return t>e}x(eve,"dirUpwards");function tve(t,e,r,n){return i=>{const a=i.sourceBox.swimlane.y+e.swimlanePadding,s=i.targetBox.swimlane.y+e.swimlanePadding,o=eve(a,s),l=i.sourceBox.x+i.sourceBox.dimension.width*2/3,u=i.targetBox.x+i.targetBox.dimension.width/3;let h,d;ae.debug(`rendering relation up=${o} for `,{sourceBox:i.sourceBox,targetBox:i.targetBox}),o?(h=a,d=s+i.targetBox.dimension.height):(h=a+i.sourceBox.dimension.height,d=s);const f=n.emRelationStroke??i.visual.stroke;t.append("path").attr("class","em-relation").attr("fill",i.visual.fill).attr("stroke",f).attr("stroke-width","1").attr("marker-end",`url(#${r})`).attr("d",`M${l} ${h} L${u} ${d}`)}}x(tve,"renderD3Relation");function rve(t,e,r,n){return i=>{const a=t.append("g").attr("class","em-swimlane"),s=n.emSwimlaneBackgroundOdd??"rgb(250,250,250)",o=n.emSwimlaneBackgroundStroke??"rgb(240,240,240)";a.append("rect").attr("x",0).attr("y",i.y).attr("rx","3").attr("width",e+r.swimlanePadding).attr("height",i.height).attr("fill",s).attr("stroke",o),a.append("text").attr("font-weight",r.swimlaneTextFontWeight).attr("x",30).attr("y",i.y+30).text(i.label)}}x(rve,"renderD3Swimlane");var jpt=x(function(t,e,r,n){if(ae.debug("in eventmodeling renderer",t+` -`,"id:",e,r),!Kpt)throw new Error("EventModeling config not found");const i=n.db,{themeVariables:a,eventmodeling:s}=Pe(),o=pt(`[id="${e}"]`),l=i.getDiagramProps(),u=i.getState(),h=`em-arrowhead-${e}`,d=a.emArrowhead??"#000000";u.sortedSwimlanesArray.forEach(rve(o,u.maxR,l,a)),u.boxes.forEach(Jye(o,l)),u.relations.forEach(tve(o,l,h,a)),o.append("defs").append("marker").attr("id",h).attr("markerWidth","10").attr("markerHeight","7").attr("refX","10").attr("refY","3.5").attr("orient","auto").append("polygon").attr("points","0 0, 10 3.5, 0 7").attr("fill",d),P6(void 0,o,(s==null?void 0:s.padding)??30,s==null?void 0:s.useMaxWidth)},"draw"),Zpt={draw:jpt},Qpt=x(t=>"","getStyles"),Jpt=Qpt,egt={parser:Xpt,db:TP,renderer:Zpt,styles:Jpt};const tgt=Object.freeze(Object.defineProperty({__proto__:null,diagram:egt},Symbol.toStringTag,{value:"Module"}));var CP=(function(){var t=x(function(v,T,b,w){for(b=b||{},w=v.length;w--;b[v[w]]=T);return b},"o"),e=[1,4],r=[1,14],n=[1,12],i=[1,13],a=[6,7,8],s=[1,20],o=[1,18],l=[1,19],u=[6,7,11],h=[1,6,13,14],d=[1,23],f=[1,24],p=[1,6,7,11,13,14],g={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ishikawa:4,spaceLines:5,SPACELINE:6,NL:7,ISHIKAWA:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,TEXT:14,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"ISHIKAWA",11:"EOF",13:"SPACELIST",14:"TEXT"},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,1],[12,1],[12,1]],performAction:x(function(T,b,w,k,A,C,_){var L=C.length-1;switch(A){case 6:case 7:return k;case 15:k.addNode(C[L-1].length,C[L].trim());break;case 16:k.addNode(0,C[L].trim());break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:e},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:e},{6:r,7:[1,10],9:9,12:11,13:n,14:i},t(a,[2,3]),{1:[2,2]},t(a,[2,4]),t(a,[2,5]),{1:[2,6],6:r,12:15,13:n,14:i},{6:r,9:16,12:11,13:n,14:i},{6:s,7:o,10:17,11:l},t(u,[2,18],{14:[1,21]}),t(u,[2,16]),t(u,[2,17]),{6:s,7:o,10:22,11:l},{1:[2,7],6:r,12:15,13:n,14:i},t(h,[2,14],{7:d,11:f}),t(p,[2,8]),t(p,[2,9]),t(p,[2,10]),t(u,[2,15]),t(h,[2,13],{7:d,11:f}),t(p,[2,11]),t(p,[2,12])],defaultActions:{2:[2,1],6:[2,2]},parseError:x(function(T,b){if(b.recoverable)this.trace(T);else{var w=new Error(T);throw w.hash=b,w}},"parseError"),parse:x(function(T){var b=this,w=[0],k=[],A=[null],C=[],_=this.table,L="",O=0,M=0,z=2,F=1,S=C.slice.call(arguments,1),R=Object.create(this.lexer),N={yy:{}};for(var D in this.yy)Object.prototype.hasOwnProperty.call(this.yy,D)&&(N.yy[D]=this.yy[D]);R.setInput(T,N.yy),N.yy.lexer=R,N.yy.parser=this,typeof R.yylloc>"u"&&(R.yylloc={});var I=R.yylloc;C.push(I);var $=R.options&&R.options.ranges;typeof N.yy.parseError=="function"?this.parseError=N.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function B(ne){w.length=w.length-2*ne,A.length=A.length-ne,C.length=C.length-ne}x(B,"popStack");function P(){var ne;return ne=k.pop()||R.lex()||F,typeof ne!="number"&&(ne instanceof Array&&(k=ne,ne=k.pop()),ne=b.symbols_[ne]||ne),ne}x(P,"lex");for(var G,V,Y,W,ie={},K,se,J,Z;;){if(V=w[w.length-1],this.defaultActions[V]?Y=this.defaultActions[V]:((G===null||typeof G>"u")&&(G=P()),Y=_[V]&&_[V][G]),typeof Y>"u"||!Y.length||!Y[0]){var ee="";Z=[];for(K in _[V])this.terminals_[K]&&K>z&&Z.push("'"+this.terminals_[K]+"'");R.showPosition?ee="Parse error on line "+(O+1)+`: +`,"getStyles"),ywt=mwt,q1=T(t=>`${t}`,"wrapIcon"),d4={prefix:"mermaid-architecture",height:80,width:80,icons:{database:{body:q1('')},server:{body:q1('')},disk:{body:q1('')},internet:{body:q1('')},cloud:{body:q1('')},unknown:cX,blank:{body:q1("")}}},vwt=T(async function(t,e,r,n){const i=r.getConfigField("padding"),a=r.getConfigField("iconSize"),s=a/2,o=a/6,l=o/2;await Promise.all(e.edges().map(async u=>{var $,I;const{source:h,sourceDir:d,sourceArrow:f,sourceGroup:p,target:g,targetDir:m,targetArrow:y,targetGroup:v,label:x}=OCe(u);let{x:b,y:w}=u[0].sourceEndpoint();const{x:C,y:_}=u[0].midpoint();let{x:k,y:S}=u[0].targetEndpoint();const L=i+4;if(p&&(Vs(d)?b+=d==="L"?-L:L:w+=d==="T"?-L:L+18),v&&(Vs(m)?k+=m==="L"?-L:L:S+=m==="T"?-L:L+18),!p&&(($=r.getNode(h))==null?void 0:$.type)==="junction"&&(Vs(d)?b+=d==="L"?s:-s:w+=d==="T"?s:-s),!v&&((I=r.getNode(g))==null?void 0:I.type)==="junction"&&(Vs(m)?k+=m==="L"?s:-s:S+=m==="T"?s:-s),u[0]._private.rscratch){const z=t.insert("g");if(z.insert("path").attr("d",`M ${b},${w} L ${C},${_} L${k},${S} `).attr("class","edge").attr("id",`${n}-${ag(h,g,{prefix:"L"})}`),f){const F=Vs(d)?XA[d](b,o):b-l,A=Pd(d)?XA[d](w,o):w-l;z.insert("polygon").attr("points",NCe[d](o)).attr("transform",`translate(${F},${A})`).attr("class","arrow")}if(y){const F=Vs(m)?XA[m](k,o):k-l,A=Pd(m)?XA[m](S,o):S-l;z.insert("polygon").attr("points",NCe[m](o)).attr("transform",`translate(${F},${A})`).attr("class","arrow")}if(x){const F=VG(d,m)?"XY":Vs(d)?"X":"Y";let A=0;F==="X"?A=Math.abs(b-k):F==="Y"?A=Math.abs(w-S)/1.5:A=Math.abs(b-k)/2;const R=z.append("g");if(await ys(R,x,{useHtmlLabels:!1,width:A,classes:"architecture-service-label"},Pe()),R.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),F==="X")R.attr("transform","translate("+C+", "+_+")");else if(F==="Y")R.attr("transform","translate("+C+", "+_+") rotate(-90)");else if(F==="XY"){const N=WG(d,m);if(N&&owt(N)){const M=R.node().getBoundingClientRect(),[D,O]=uwt(N);R.attr("dominant-baseline","auto").attr("transform",`rotate(${-1*D*O*45})`);const B=R.node().getBoundingClientRect();R.attr("transform",` + translate(${C}, ${_-M.height/2}) + translate(${D*B.width/2}, ${O*B.height/2}) + rotate(${-1*D*O*45}, 0, ${M.height/2}) + `)}}}}}))},"drawEdges"),bwt=T(async function(t,e,r,n){const a=r.getConfigField("padding")*.75,s=r.getConfigField("fontSize"),l=r.getConfigField("iconSize")/2;await Promise.all(e.nodes().map(async u=>{const h=G1(u);if(h.type==="group"){const{h:d,w:f,x1:p,y1:g}=u.boundingBox(),m=t.append("rect");m.attr("id",`${n}-group-${h.id}`).attr("x",p+l).attr("y",g+l).attr("width",f).attr("height",d).attr("class","node-bkg");const y=t.append("g");let v=p,x=g;if(h.icon){const b=y.append("g");b.html(`${await Rh(h.icon,{height:a,width:a,fallbackPrefix:d4.prefix})}`),b.attr("transform","translate("+(v+l+1)+", "+(x+l+1)+")"),v+=a,x+=s/2-1-2}if(h.label){const b=y.append("g");await ys(b,h.label,{useHtmlLabels:!1,width:f,classes:"architecture-service-label"},Pe()),b.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","start").attr("text-anchor","start"),b.attr("transform","translate("+(v+l+4)+", "+(x+l+2)+")")}r.setElementForId(h.id,m)}}))},"drawGroups"),xwt=T(async function(t,e,r,n){const i=Pe();for(const a of r){const s=e.append("g"),o=t.getConfigField("iconSize");if(a.title){const d=s.append("g");await ys(d,a.title,{useHtmlLabels:!1,width:o*1.5,classes:"architecture-service-label"},i),d.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),d.attr("transform","translate("+o/2+", "+o+")")}const l=s.append("g");if(a.icon)l.html(`${await Rh(a.icon,{height:o,width:o,fallbackPrefix:d4.prefix})}`);else if(a.iconText){l.html(`${await Rh("blank",{height:o,width:o,fallbackPrefix:d4.prefix})}`);const p=l.append("g").append("foreignObject").attr("width",o).attr("height",o).append("div").attr("class","node-icon-text").attr("style",`height: ${o}px;`).append("div").html(Zr(a.iconText,i)),g=parseInt(window.getComputedStyle(p.node(),null).getPropertyValue("font-size").replace(/\D/g,""))??16;p.attr("style",`-webkit-line-clamp: ${Math.floor((o-2)/g)};`)}else l.append("path").attr("class","node-bkg").attr("id",`${n}-node-${a.id}`).attr("d",`M0,${o} V5 Q0,0 5,0 H${o-5} Q${o},0 ${o},5 V${o} Z`);s.attr("id",`${n}-service-${a.id}`).attr("class","architecture-service");const{width:u,height:h}=s.node().getBBox();a.width=u,a.height=h,t.setElementForId(a.id,s)}return 0},"drawServices"),Twt=T(function(t,e,r,n){r.forEach(i=>{const a=e.append("g"),s=t.getConfigField("iconSize");a.append("g").append("rect").attr("id",`${n}-node-${i.id}`).attr("fill-opacity","0").attr("width",s).attr("height",s),a.attr("class","architecture-junction");const{width:l,height:u}=a._groups[0][0].getBBox();a.width=l,a.height=u,t.setElementForId(i.id,a)})},"drawJunctions");hX([{name:d4.prefix,icons:d4}]),Sc.use(awt);function FCe(t,e,r){t.forEach(n=>{e.add({group:"nodes",data:{type:"service",id:n.id,icon:n.icon,label:n.title,parent:n.in,width:r.getConfigField("iconSize"),height:r.getConfigField("iconSize")},classes:"node-service"})})}T(FCe,"addServices");function zCe(t,e,r){t.forEach(n=>{e.add({group:"nodes",data:{type:"junction",id:n.id,parent:n.in,width:r.getConfigField("iconSize"),height:r.getConfigField("iconSize")},classes:"node-junction"})})}T(zCe,"addJunctions");function GCe(t,e){e.nodes().map(r=>{const n=G1(r);if(n.type==="group")return;n.x=r.position().x,n.y=r.position().y,t.getElementById(n.id).attr("transform","translate("+(n.x||0)+","+(n.y||0)+")")})}T(GCe,"positionNodes");function qCe(t,e){t.forEach(r=>{e.add({group:"nodes",data:{type:"group",id:r.id,icon:r.icon,label:r.title,parent:r.in},classes:"node-group"})})}T(qCe,"addGroups");function VCe(t,e){t.forEach(r=>{const{lhsId:n,rhsId:i,lhsInto:a,lhsGroup:s,rhsInto:o,lhsDir:l,rhsDir:u,rhsGroup:h,title:d}=r,f=VG(r.lhsDir,r.rhsDir)?"segments":"straight",p={id:`${n}-${i}`,label:d,source:n,sourceDir:l,sourceArrow:a,sourceGroup:s,sourceEndpoint:l==="L"?"0 50%":l==="R"?"100% 50%":l==="T"?"50% 0":"50% 100%",target:i,targetDir:u,targetArrow:o,targetGroup:h,targetEndpoint:u==="L"?"0 50%":u==="R"?"100% 50%":u==="T"?"50% 0":"50% 100%"};e.add({group:"edges",data:p,classes:f})})}T(VCe,"addEdges");function WCe(t,e,r){const n=T((o,l)=>Object.entries(o).reduce((u,[h,d])=>{var g;let f=0;const p=Object.entries(d);if(p.length===1)return u[h]=p[0][1],u;for(let m=0;m{const l={},u={};return Object.entries(o).forEach(([h,[d,f]])=>{var g,m,y;const p=((g=t.getNode(h))==null?void 0:g.in)??"default";l[f]??(l[f]={}),(m=l[f])[p]??(m[p]=[]),l[f][p].push(h),u[d]??(u[d]={}),(y=u[d])[p]??(y[p]=[]),u[d][p].push(h)}),{horiz:Object.values(n(l,"horizontal")).filter(h=>h.length>1),vert:Object.values(n(u,"vertical")).filter(h=>h.length>1)}}),[a,s]=i.reduce(([o,l],{horiz:u,vert:h})=>[[...o,...u],[...l,...h]],[[],[]]);return{horizontal:a,vertical:s}}T(WCe,"getAlignments");function UCe(t,e){const r=[],n=T(a=>`${a[0]},${a[1]}`,"posToStr"),i=T(a=>a.split(",").map(s=>parseInt(s)),"strToPos");return t.forEach(a=>{const s=Object.fromEntries(Object.entries(a).map(([h,d])=>[n(d),h])),o=[n([0,0])],l={},u={L:[-1,0],R:[1,0],T:[0,1],B:[0,-1]};for(;o.length>0;){const h=o.shift();if(h){l[h]=1;const d=s[h];if(d){const f=i(h);Object.entries(u).forEach(([p,g])=>{const m=n([f[0]+g[0],f[1]+g[1]]),y=s[m];y&&!l[m]&&(o.push(m),r.push({[MCe[p]]:y,[MCe[swt(p)]]:d,gap:1.5*e.getConfigField("iconSize")}))})}}}}),r}T(UCe,"getRelativeConstraints");function HCe(t,e,r,n,i,{spatialMaps:a,groupAlignments:s}){return new Promise(o=>{const l=gt("body").append("div").attr("id","cy").attr("style","display:none"),u=Sc({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"straight","source-endpoint":"data(sourceEndpoint)","target-endpoint":"data(targetEndpoint)"}},{selector:"edge[label]",style:{label:"data(label)"}},{selector:"edge.segments",style:{"curve-style":"segments","segment-weights":"0","segment-distances":[.5],"edge-distances":"endpoints","source-endpoint":"data(sourceEndpoint)","target-endpoint":"data(targetEndpoint)"}},{selector:"node",style:{"compound-sizing-wrt-labels":"include"}},{selector:"node[label]",style:{"text-valign":"bottom","text-halign":"center","font-size":`${i.getConfigField("fontSize")}px`}},{selector:".node-service",style:{label:"data(label)",width:"data(width)",height:"data(height)"}},{selector:".node-junction",style:{width:"data(width)",height:"data(height)"}},{selector:".node-group",style:{padding:`${i.getConfigField("padding")}px`}}],layout:{name:"grid",boundingBox:{x1:0,x2:100,y1:0,y2:100}}});l.remove(),qCe(r,u),FCe(t,u,i),zCe(e,u,i),VCe(n,u);const h=WCe(i,a,s),d=UCe(a,i),f=i.getConfigField("iconSize"),p=i.getConfigField("idealEdgeLengthMultiplier")*f,g=.5*f,m=i.getConfigField("edgeElasticity"),y=u.layout({name:"fcose",quality:"proof",randomize:i.getConfigField("randomize"),nodeSeparation:i.getConfigField("nodeSeparation"),numIter:i.getConfigField("numIter"),styleEnabled:!1,animate:!1,nodeDimensionsIncludeLabels:!1,idealEdgeLength(v){const[x,b]=v.connectedNodes(),{parent:w}=G1(x),{parent:C}=G1(b);return w===C?p:g},edgeElasticity(v){const[x,b]=v.connectedNodes(),{parent:w}=G1(x),{parent:C}=G1(b);return w===C?m:.001},alignmentConstraint:h,relativePlacementConstraint:d});y.one("layoutstop",()=>{var x;function v(b,w,C,_){let k,S;const{x:L,y:$}=b,{x:I,y:z}=w;S=(_-$+(L-C)*($-z)/(L-I))/Math.sqrt(1+Math.pow(($-z)/(L-I),2)),k=Math.sqrt(Math.pow(_-$,2)+Math.pow(C-L,2)-Math.pow(S,2));const F=Math.sqrt(Math.pow(I-L,2)+Math.pow(z-$,2));k=k/F;let A=(I-L)*(_-$)-(z-$)*(C-L);switch(!0){case A>=0:A=1;break;case A<0:A=-1;break}let R=(I-L)*(C-L)+(z-$)*(_-$);switch(!0){case R>=0:R=1;break;case R<0:R=-1;break}return S=Math.abs(S)*A,k=k*R,{distances:S,weights:k}}T(v,"getSegmentWeights"),u.startBatch();for(const b of Object.values(u.edges()))if((x=b.data)!=null&&x.call(b)){const{x:w,y:C}=b.source().position(),{x:_,y:k}=b.target().position();if(w!==_&&C!==k){const S=b.sourceEndpoint(),L=b.targetEndpoint(),{sourceDir:$}=OCe(b),[I,z]=Pd($)?[S.x,L.y]:[L.x,S.y],{weights:F,distances:A}=v(S,L,I,z);b.style("segment-distances",A),b.style("segment-weights",F)}}u.endBatch(),y.run()}),y.run(),u.ready(v=>{se.info("Ready",v),o(u)})})}T(HCe,"layoutArchitecture");var wwt=T(async(t,e,r,n)=>{const i=n.db;i.setDiagramId(e);const a=i.getServices(),s=i.getJunctions(),o=i.getGroups(),l=i.getEdges(),u=i.getDataStructures(),h=Ys(e),d=h.append("g");d.attr("class","architecture-edges");const f=h.append("g");f.attr("class","architecture-services");const p=h.append("g");p.attr("class","architecture-groups"),await xwt(i,f,a,e),Twt(i,f,s,e);const g=await HCe(a,s,o,l,i,u);await vwt(d,g,i,e),await bwt(p,g,i,e),GCe(i,g),G0(void 0,h,i.getConfigField("padding"),i.getConfigField("useMaxWidth"))},"draw"),Cwt={draw:wwt},kwt={parser:BCe,get db(){return new PCe},renderer:Cwt,styles:ywt};const Ewt=Object.freeze(Object.defineProperty({__proto__:null,diagram:kwt},Symbol.toStringTag,{value:"Module"}));var YCe="position frame",XCe="frame positioned",UG="position relation",jCe="relation positioned",Swt=T(function(t){se.debug("options str",t)},"setOptions"),_wt=T(function(){return{}},"getOptions"),Awt=T(function(){KCe(),Hn()},"clear");function KCe(){HG={}}T(KCe,"reset");var Rwt=Xr.eventmodeling,Lwt=T(()=>wi({...Rwt,...pr().eventmodeling}),"getConfig"),HG={};function ZCe(){let t=Iwt;const{ast:e}=HG,r=YG();if(!e)throw new Error("No data for EventModel");return e.frames.forEach((n,i)=>{const a=i4e(n,e.dataEntities,r);t=KA(t,{$kind:YCe,index:i,frame:n,textProps:a});let s;u4e(n)?(se.debug("source frame",n.sourceFrames),s=e.frames.filter(o=>n.sourceFrames.some(l=>l.$refText===o.name)),s.forEach(o=>{t=KA(t,{$kind:UG,index:i,frame:n,sourceFrame:o})})):t=KA(t,{$kind:UG,index:i,frame:n})}),t={...t,sortedSwimlanesArray:XG(t.swimlanes)},t}T(ZCe,"getState");function QCe(t){HG.ast=t}T(QCe,"setAst");var dn={swimlaneMinHeight:70,swimlanePadding:15,swimlaneGap:10,boxPadding:10,boxOverlap:90,boxDefaultY:0,boxMinWidth:80,boxMaxWidth:450,boxMinHeight:80,boxMaxHeight:750,contentStartX:250,textMaxWidth:430,boxTextFontWeight:"bold",boxTextPadding:10,swimlaneTextFontWeight:"bold",labelUiAutomation:"UI/Automation",labelUiAutomationPrefix:"UI/A: ",labelCommandReadModel:"Command/Read Model",labelCommandReadModelPrefix:"C/RM: ",labelEvents:"Events",labelEventsPrefix:"Stream: "};function YG(){return dn}T(YG,"getDiagramProps");var Iwt={boxes:[],swimlanes:{},relations:[],maxR:0,sortedSwimlanesArray:[]};function JCe(t){const e=t.split(".");if(e.length===2)return e[0]}T(JCe,"extractNamespace");function e4e(t){const e=t.split(".");return e.length===2?e[1]:t}T(e4e,"extractName");function t4e(t,e){if(!(!e||e.length===0))return Object.values(t).find(r=>r.namespace===e)}T(t4e,"findSwimlaneByNamespace");function jA(t,e,r){return Math.max(e,...Object.keys(t).filter(n=>{const i=Number.parseInt(n);return i>e&&iNumber.parseInt(n)))+1}T(jA,"findNextAvailableIndex");function r4e(t,e){const r=JCe(t.entityIdentifier),n=t4e(e,r);switch(t.modelEntityType){case"ui":case"pcr":case"processor":return n?{index:n.index,label:n.namespace||dn.labelUiAutomation}:r?{index:jA(e,0,100),label:dn.labelUiAutomationPrefix+r}:{index:0,label:dn.labelUiAutomation};case"rmo":case"readmodel":case"cmd":case"command":return n?{index:n.index,label:n.namespace||dn.labelCommandReadModel}:r?{index:jA(e,100,200),label:dn.labelCommandReadModelPrefix+r}:{index:100,label:dn.labelCommandReadModel};case"evt":case"event":default:return n?{index:n.index,label:n.namespace||dn.labelEvents}:r?{index:jA(e,200,300),label:dn.labelEventsPrefix+r}:{index:200,label:dn.labelEvents}}}T(r4e,"calculateSwimlaneProps");function n4e(t){const{themeVariables:e}=pr();switch(t.modelEntityType){case"ui":return{fill:e.emUiFill??"white",stroke:e.emUiStroke??"#dbdada"};case"pcr":case"processor":return{fill:e.emProcessorFill??"#edb3f6",stroke:e.emProcessorStroke??"#b88cbf"};case"rmo":case"readmodel":return{fill:e.emReadModelFill??"#d3f1a2",stroke:e.emReadModelStroke??"#a3b732"};case"cmd":case"command":return{fill:e.emCommandFill??"#bcd6fe",stroke:e.emCommandStroke??"#679ac3"};case"evt":case"event":return{fill:e.emEventFill??"#ffb778",stroke:e.emEventStroke??"#c19a0f"};default:return{fill:"red",stroke:"black"}}}T(n4e,"calculateEntityVisualProps");function i4e(t,e,r){const n=pr(),i=Zr(e4e(t.entityIdentifier)??"",n);let a;const s={fontSize:16,fontWeight:700,fontFamily:'"trebuchet ms", verdana, arial, sans-serif',joinWith:"
    "};let l=`${kx(i,r.textMaxWidth,s)}`;if(t.dataInlineValue&&(a=t.dataInlineValue,a=a.substring(a.indexOf("{")+1),a=a.substring(0,a.lastIndexOf("}")-1),a=Zr(a,n),a=kx(a,r.textMaxWidth,s),a=a.replaceAll(" "," ")),t.dataReference){const g=e.find(m=>{var y;return m.name===((y=t.dataReference)==null?void 0:y.$refText)});g&&(a=g.dataBlockValue,a=a.substring(a.indexOf(`{ +`)+2),a=a.substring(0,a.lastIndexOf("}")-1),a=Zr(a,n),a=kx(a,r.textMaxWidth,s),a=a.replaceAll(" "," "),a+="
    ")}const u=a!==void 0;u&&(l+=`

    ${a}`);const h={fontSize:s.fontSize,fontWeight:s.fontWeight,fontFamily:s.fontFamily},d=zk(l,h),f=u?d.width/3:d.width,p={content:l,width:f,height:d.height};return se.debug(`[${t.name}] ${t.entityIdentifier} text`,p),p}T(i4e,"calculateTextProps");function a4e(t,e){const r=e,n=n4e(r.frame),i={width:r.textProps.width+2*dn.boxTextPadding,height:r.textProps.height+2*dn.boxTextPadding};return[{$kind:XCe,frame:r.frame,index:r.index,visual:n,dimension:i,textProps:r.textProps}]}T(a4e,"decidePositionFrame");function s4e(t,e,r){return e===void 0?dn.contentStartX:e.index===t.index&&t.r?t.r+dn.boxPadding:r===void 0?dn.contentStartX:r.r-dn.boxOverlap+dn.boxPadding}T(s4e,"calculateX");function o4e(t,e){const r=[...t.map(n=>n.r),e];return Math.max(...r)}T(o4e,"calculateMaxRight");function XG(t){return Object.values(t).sort((e,r)=>e.index-r.index)}T(XG,"sortedSwimlanesArray");function l4e(t,e){const r=e,n=r4e(r.frame,t.swimlanes);let i;n.index in t.swimlanes?i=t.swimlanes[n.index]:i={index:n.index,label:n.label,r:0,y:n.index*dn.swimlaneMinHeight+dn.swimlaneGap,height:dn.swimlaneMinHeight,maxHeight:dn.swimlaneMinHeight};const a=t.boxes.length>0?t.boxes[t.boxes.length-1]:void 0,s=t.previousSwimlaneNumber!==void 0?t.swimlanes[t.previousSwimlaneNumber]:void 0,o={width:Math.max(dn.boxMinWidth,Math.min(dn.boxMaxWidth,r.dimension.width))+2*dn.boxPadding,height:Math.max(dn.boxMinHeight,Math.min(dn.boxMaxHeight,r.dimension.height))+2*dn.boxPadding},l=s4e(i,s,a),u=l+o.width+dn.boxPadding,h=o4e(Object.values(t.swimlanes),u);i.r=l+o.width,i.maxHeight=Math.max(i.maxHeight,o.height),i.height=Math.max(dn.swimlaneMinHeight,i.maxHeight)+2*dn.swimlanePadding;const d={x:l,y:dn.swimlanePadding+i.y,r:u,dimension:o,leftSibling:!1,swimlane:i,visual:r.visual,text:r.textProps.content,frame:r.frame,index:r.index},f={...t,boxes:[...t.boxes,d],swimlanes:{...t.swimlanes,[`${i.index}`]:i},previousSwimlaneNumber:n.index,previousFrame:r.frame,maxR:h},p=XG(f.swimlanes);p.length>0&&(p[0].y=0);for(let g=1;g0}T(u4e,"hasSourceFrame");function jG(t,e){if(e!=null)return t.find(r=>r.frame.name===e.name)}T(jG,"findBoxByFrame");function h4e(t,e,r){if(!(r<0))for(let n=r;n>=0;n--){const i=t[n];if(i.swimlane.index!==e)return i}}T(h4e,"findBoxByLineIndex");function d4e(t,e){const r=e;if(q2e(r.frame)||c4e(r.index,r.frame))return[];const n=jG(t.boxes,r.frame);if(n===void 0)throw new Error(`Target box not found for frame ${r.frame.name}`);let i;return r.sourceFrame?i=jG(t.boxes,r.sourceFrame):i=h4e(t.boxes,n.swimlane.index,r.index-1),i===void 0?[]:[{$kind:jCe,frame:r.frame,index:r.index,sourceBox:i,targetBox:n}]}T(d4e,"decidePositionRelation");function f4e(t,e){const r=e,n={visual:{fill:"none",stroke:"#000"},source:{x:r.sourceBox.x,y:r.sourceBox.y},target:{x:r.targetBox.x,y:r.targetBox.y},sourceBox:r.sourceBox,targetBox:r.targetBox};return{...t,relations:[...t.relations,n]}}T(f4e,"evolveRelationPositioned");var Dwt={[YCe]:a4e,[UG]:d4e},Mwt={[XCe]:l4e,[jCe]:f4e};function p4e(t,e){const r=Dwt[e.$kind];if(r==null)return[];const n=r(t,e);return se.debug("decided events",n),n}T(p4e,"decide");function g4e(t,e){const r=e.reduce((n,i)=>{const a=Mwt[i.$kind];return a==null?n:a(n,i)},t);return se.debug("evolve events",{state:t,newState:r,events:e}),r}T(g4e,"evolve");function KA(t,e){const r=p4e(t,e);return g4e(t,r)}T(KA,"dispatch");var KG={getConfig:Lwt,setOptions:Swt,getOptions:_wt,clear:Awt,setAccTitle:Yn,getAccTitle:ii,getAccDescription:si,setAccDescription:ai,setDiagramTitle:oi,getDiagramTitle:Xn,setAst:QCe,getDiagramProps:YG,getState:ZCe},Nwt={parse:T(async t=>{const e=await Bl("eventmodeling",t);se.debug(e),KG.setAst(e),Rc(e,KG)},"parse")},ZG=Pe(),$wt=ZG==null?void 0:ZG.eventmodeling;function m4e(t,e){return r=>{const n=r.swimlane.y+e.swimlanePadding,i=t.append("g").attr("class","em-box");i.append("rect").attr("x",r.x).attr("y",n).attr("rx","3").attr("width",r.dimension.width).attr("height",r.dimension.height).attr("stroke",r.visual.stroke).attr("fill",r.visual.fill),i.append("foreignObject").attr("x",r.x+e.boxPadding).attr("y",n+10).attr("width",r.dimension.width-2*e.boxPadding).attr("height",r.dimension.height-2*e.boxPadding).append("xhtml:div").style("display","table").style("height","100%").style("width","100%").append("span").style("display","table-cell").style("text-align","center").style("vertical-align","middle").html(r.text)}}T(m4e,"renderD3Box");function y4e(t,e){return t>e}T(y4e,"dirUpwards");function v4e(t,e,r,n){return i=>{const a=i.sourceBox.swimlane.y+e.swimlanePadding,s=i.targetBox.swimlane.y+e.swimlanePadding,o=y4e(a,s),l=i.sourceBox.x+i.sourceBox.dimension.width*2/3,u=i.targetBox.x+i.targetBox.dimension.width/3;let h,d;se.debug(`rendering relation up=${o} for `,{sourceBox:i.sourceBox,targetBox:i.targetBox}),o?(h=a,d=s+i.targetBox.dimension.height):(h=a+i.sourceBox.dimension.height,d=s);const f=n.emRelationStroke??i.visual.stroke;t.append("path").attr("class","em-relation").attr("fill",i.visual.fill).attr("stroke",f).attr("stroke-width","1").attr("marker-end",`url(#${r})`).attr("d",`M${l} ${h} L${u} ${d}`)}}T(v4e,"renderD3Relation");function b4e(t,e,r,n){return i=>{const a=t.append("g").attr("class","em-swimlane"),s=n.emSwimlaneBackgroundOdd??"rgb(250,250,250)",o=n.emSwimlaneBackgroundStroke??"rgb(240,240,240)";a.append("rect").attr("x",0).attr("y",i.y).attr("rx","3").attr("width",e+r.swimlanePadding).attr("height",i.height).attr("fill",s).attr("stroke",o),a.append("text").attr("font-weight",r.swimlaneTextFontWeight).attr("x",30).attr("y",i.y+30).text(i.label)}}T(b4e,"renderD3Swimlane");var Owt=T(function(t,e,r,n){if(se.debug("in eventmodeling renderer",t+` +`,"id:",e,r),!$wt)throw new Error("EventModeling config not found");const i=n.db,{themeVariables:a,eventmodeling:s}=Pe(),o=gt(`[id="${e}"]`),l=i.getDiagramProps(),u=i.getState(),h=`em-arrowhead-${e}`,d=a.emArrowhead??"#000000";u.sortedSwimlanesArray.forEach(b4e(o,u.maxR,l,a)),u.boxes.forEach(m4e(o,l)),u.relations.forEach(v4e(o,l,h,a)),o.append("defs").append("marker").attr("id",h).attr("markerWidth","10").attr("markerHeight","7").attr("refX","10").attr("refY","3.5").attr("orient","auto").append("polygon").attr("points","0 0, 10 3.5, 0 7").attr("fill",d),O7(void 0,o,(s==null?void 0:s.padding)??30,s==null?void 0:s.useMaxWidth)},"draw"),Pwt={draw:Owt},Bwt=T(t=>"","getStyles"),Fwt=Bwt,zwt={parser:Nwt,db:KG,renderer:Pwt,styles:Fwt};const Gwt=Object.freeze(Object.defineProperty({__proto__:null,diagram:zwt},Symbol.toStringTag,{value:"Module"}));var QG=(function(){var t=T(function(v,x,b,w){for(b=b||{},w=v.length;w--;b[v[w]]=x);return b},"o"),e=[1,4],r=[1,14],n=[1,12],i=[1,13],a=[6,7,8],s=[1,20],o=[1,18],l=[1,19],u=[6,7,11],h=[1,6,13,14],d=[1,23],f=[1,24],p=[1,6,7,11,13,14],g={trace:T(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ishikawa:4,spaceLines:5,SPACELINE:6,NL:7,ISHIKAWA:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,TEXT:14,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"ISHIKAWA",11:"EOF",13:"SPACELIST",14:"TEXT"},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,1],[12,1],[12,1]],performAction:T(function(x,b,w,C,_,k,S){var L=k.length-1;switch(_){case 6:case 7:return C;case 15:C.addNode(k[L-1].length,k[L].trim());break;case 16:C.addNode(0,k[L].trim());break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:e},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:e},{6:r,7:[1,10],9:9,12:11,13:n,14:i},t(a,[2,3]),{1:[2,2]},t(a,[2,4]),t(a,[2,5]),{1:[2,6],6:r,12:15,13:n,14:i},{6:r,9:16,12:11,13:n,14:i},{6:s,7:o,10:17,11:l},t(u,[2,18],{14:[1,21]}),t(u,[2,16]),t(u,[2,17]),{6:s,7:o,10:22,11:l},{1:[2,7],6:r,12:15,13:n,14:i},t(h,[2,14],{7:d,11:f}),t(p,[2,8]),t(p,[2,9]),t(p,[2,10]),t(u,[2,15]),t(h,[2,13],{7:d,11:f}),t(p,[2,11]),t(p,[2,12])],defaultActions:{2:[2,1],6:[2,2]},parseError:T(function(x,b){if(b.recoverable)this.trace(x);else{var w=new Error(x);throw w.hash=b,w}},"parseError"),parse:T(function(x){var b=this,w=[0],C=[],_=[null],k=[],S=this.table,L="",$=0,I=0,z=2,F=1,A=k.slice.call(arguments,1),R=Object.create(this.lexer),N={yy:{}};for(var M in this.yy)Object.prototype.hasOwnProperty.call(this.yy,M)&&(N.yy[M]=this.yy[M]);R.setInput(x,N.yy),N.yy.lexer=R,N.yy.parser=this,typeof R.yylloc>"u"&&(R.yylloc={});var D=R.yylloc;k.push(D);var O=R.options&&R.options.ranges;typeof N.yy.parseError=="function"?this.parseError=N.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function B(re){w.length=w.length-2*re,_.length=_.length-re,k.length=k.length-re}T(B,"popStack");function P(){var re;return re=C.pop()||R.lex()||F,typeof re!="number"&&(re instanceof Array&&(C=re,re=C.pop()),re=b.symbols_[re]||re),re}T(P,"lex");for(var G,V,H,W,ie={},j,ae,J,K;;){if(V=w[w.length-1],this.defaultActions[V]?H=this.defaultActions[V]:((G===null||typeof G>"u")&&(G=P()),H=S[V]&&S[V][G]),typeof H>"u"||!H.length||!H[0]){var Q="";K=[];for(j in S[V])this.terminals_[j]&&j>z&&K.push("'"+this.terminals_[j]+"'");R.showPosition?Q="Parse error on line "+($+1)+`: `+R.showPosition()+` -Expecting `+Z.join(", ")+", got '"+(this.terminals_[G]||G)+"'":ee="Parse error on line "+(O+1)+": Unexpected "+(G==F?"end of input":"'"+(this.terminals_[G]||G)+"'"),this.parseError(ee,{text:R.match,token:this.terminals_[G]||G,line:R.yylineno,loc:I,expected:Z})}if(Y[0]instanceof Array&&Y.length>1)throw new Error("Parse Error: multiple actions possible at state: "+V+", token: "+G);switch(Y[0]){case 1:w.push(G),A.push(R.yytext),C.push(R.yylloc),w.push(Y[1]),G=null,M=R.yyleng,L=R.yytext,O=R.yylineno,I=R.yylloc;break;case 2:if(se=this.productions_[Y[1]][1],ie.$=A[A.length-se],ie._$={first_line:C[C.length-(se||1)].first_line,last_line:C[C.length-1].last_line,first_column:C[C.length-(se||1)].first_column,last_column:C[C.length-1].last_column},$&&(ie._$.range=[C[C.length-(se||1)].range[0],C[C.length-1].range[1]]),W=this.performAction.apply(ie,[L,M,O,N.yy,Y[1],A,C].concat(S)),typeof W<"u")return W;se&&(w=w.slice(0,-1*se*2),A=A.slice(0,-1*se),C=C.slice(0,-1*se)),w.push(this.productions_[Y[1]][0]),A.push(ie.$),C.push(ie._$),J=_[w[w.length-2]][w[w.length-1]],w.push(J);break;case 3:return!0}}return!0},"parse")},m=(function(){var v={EOF:1,parseError:x(function(b,w){if(this.yy.parser)this.yy.parser.parseError(b,w);else throw new Error(b)},"parseError"),setInput:x(function(T,b){return this.yy=b||this.yy||{},this._input=T,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:x(function(){var T=this._input[0];this.yytext+=T,this.yyleng++,this.offset++,this.match+=T,this.matched+=T;var b=T.match(/(?:\r\n?|\n).*/g);return b?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),T},"input"),unput:x(function(T){var b=T.length,w=T.split(/(?:\r\n?|\n)/g);this._input=T+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-b),this.offset-=b;var k=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),w.length-1&&(this.yylineno-=w.length-1);var A=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:w?(w.length===k.length?this.yylloc.first_column:0)+k[k.length-w.length].length-w[0].length:this.yylloc.first_column-b},this.options.ranges&&(this.yylloc.range=[A[0],A[0]+this.yyleng-b]),this.yyleng=this.yytext.length,this},"unput"),more:x(function(){return this._more=!0,this},"more"),reject:x(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). -`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:x(function(T){this.unput(this.match.slice(T))},"less"),pastInput:x(function(){var T=this.matched.substr(0,this.matched.length-this.match.length);return(T.length>20?"...":"")+T.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:x(function(){var T=this.match;return T.length<20&&(T+=this._input.substr(0,20-T.length)),(T.substr(0,20)+(T.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:x(function(){var T=this.pastInput(),b=new Array(T.length+1).join("-");return T+this.upcomingInput()+` -`+b+"^"},"showPosition"),test_match:x(function(T,b){var w,k,A;if(this.options.backtrack_lexer&&(A={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(A.yylloc.range=this.yylloc.range.slice(0))),k=T[0].match(/(?:\r\n?|\n).*/g),k&&(this.yylineno+=k.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:k?k[k.length-1].length-k[k.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],w=this.performAction.call(this,this.yy,this,b,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),w)return w;if(this._backtrack){for(var C in A)this[C]=A[C];return!1}return!1},"test_match"),next:x(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var T,b,w,k;this._more||(this.yytext="",this.match="");for(var A=this._currentRules(),C=0;Cb[0].length)){if(b=w,k=C,this.options.backtrack_lexer){if(T=this.test_match(w,A[C]),T!==!1)return T;if(this._backtrack){b=!1;continue}else return!1}else if(!this.options.flex)break}return b?(T=this.test_match(b,A[k]),T!==!1?T:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var b=this.next();return b||this.lex()},"lex"),begin:x(function(b){this.conditionStack.push(b)},"begin"),popState:x(function(){var b=this.conditionStack.length-1;return b>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(b){return b=this.conditionStack.length-1-Math.abs(b||0),b>=0?this.conditionStack[b]:"INITIAL"},"topState"),pushState:x(function(b){this.begin(b)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:x(function(b,w,k,A){switch(k){case 0:return 6;case 1:return 8;case 2:return 8;case 3:return 6;case 4:return 7;case 5:return 13;case 6:return 14;case 7:return 11}},"anonymous"),rules:[/^(?:\s*%%.*)/i,/^(?:ishikawa-beta\b)/i,/^(?:ishikawa\b)/i,/^(?:[\s]+[\n])/i,/^(?:[\n]+)/i,/^(?:[\s]+)/i,/^(?:[^\n]+)/i,/^(?:$)/i],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7],inclusive:!0}}};return v})();g.lexer=m;function y(){this.yy={}}return x(y,"Parser"),y.prototype=g,g.Parser=y,new y})();CP.parser=CP;var rgt=CP,ngt=(Yv=class{constructor(){this.stack=[],this.clear=this.clear.bind(this),this.addNode=this.addNode.bind(this),this.getRoot=this.getRoot.bind(this)}clear(){this.root=void 0,this.stack=[],this.baseLevel=void 0,In()}getRoot(){return this.root}addNode(e,r){const n=Lt.sanitizeText(r,Pe());if(!this.root){this.root={text:n,children:[]},this.stack=[{level:0,node:this.root}],qn(n);return}this.baseLevel??(this.baseLevel=e);let i=e-this.baseLevel+1;for(i<=0&&(i=1);this.stack.length>1&&this.stack[this.stack.length-1].level>=i;)this.stack.pop();const a=this.stack[this.stack.length-1].node,s={text:n,children:[]};a.children.push(s),this.stack.push({level:i,node:s})}getAccTitle(){return Fn()}setAccTitle(e){Dn(e)}getAccDescription(){return Gn()}setAccDescription(e){zn(e)}getDiagramTitle(){return Mn()}setDiagramTitle(e){qn(e)}},x(Yv,"IshikawaDB"),Yv),igt=14,um=250,agt=30,sgt=60,ogt=5,nve=82*Math.PI/180,ive=Math.cos(nve),ave=Math.sin(nve),sve=x((t,e,r)=>{const n=t.node().getBBox(),i=n.width+e*2,a=n.height+e*2;wi(t,a,i,r),t.attr("viewBox",`${n.x-e} ${n.y-e} ${i} ${a}`)},"applyPaddedViewBox"),lgt=x((t,e,r,n)=>{var N,D;const a=n.db.getRoot();if(!a)return;const s=Pe(),{look:o,handDrawnSeed:l,themeVariables:u}=s,h=xc(s.fontSize)[0]??igt,d=o==="handDrawn",f=a.children??[],p=((N=s.ishikawa)==null?void 0:N.diagramPadding)??20,g=((D=s.ishikawa)==null?void 0:D.useMaxWidth)??!1,m=ys(e),y=m.append("g").attr("class","ishikawa"),v=d?Kt.svg(m.node()):void 0,T=v?{roughSvg:v,seed:l??0,lineColor:(u==null?void 0:u.lineColor)??"#333",fillColor:(u==null?void 0:u.mainBkg)??"#fff"}:void 0,b=`ishikawa-arrow-${e}`;d||y.append("defs").append("marker").attr("id",b).attr("viewBox","0 0 10 10").attr("refX",0).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto").append("path").attr("d","M 10 0 L 0 5 L 10 10 Z").attr("class","ishikawa-arrow");let w=0,k=um;const A=d?void 0:hm(y,w,k,w,k,"ishikawa-spine");if(cgt(y,w,k,a.text,h,T),!f.length){d&&hm(y,w,k,w,k,"ishikawa-spine",T),sve(m,p,g);return}w-=20;const C=f.filter((I,$)=>$%2===0),_=f.filter((I,$)=>$%2===1),L=ove(C),O=ove(_),M=L.total+O.total;let z=um,F=um;if(M>0){const I=um*2,$=um*.3;z=Math.max($,I*(L.total/M)),F=Math.max($,I*(O.total/M))}const S=h*2;z=Math.max(z,L.max*S),F=Math.max(F,O.max*S),k=Math.max(z,um),A&&A.attr("y1",k).attr("y2",k),y.select(".ishikawa-head-group").attr("transform",`translate(0,${k})`);const R=Math.ceil(f.length/2);for(let I=0;IMath.min(B,P.getBBox().x),1/0)}if(d)hm(y,w,k,0,k,"ishikawa-spine",T);else{A.attr("x1",w);const I=`url(#${b})`;y.selectAll("line.ishikawa-branch, line.ishikawa-sub-branch").attr("marker-start",I)}sve(m,p,g)},"draw"),ove=x(t=>{const e=x(r=>r.children.reduce((n,i)=>n+1+e(i),0),"countDescendants");return t.reduce((r,n)=>{const i=e(n);return r.total+=i,r.max=Math.max(r.max,i),r},{total:0,max:0})},"sideStats"),cgt=x((t,e,r,n,i,a)=>{const s=Math.max(6,Math.floor(110/(i*.6))),o=t.append("g").attr("class","ishikawa-head-group").attr("transform",`translate(${e},${r})`),l=QS(o,lve(n,s),0,0,"ishikawa-head-label","start",i),u=l.node().getBBox(),h=Math.max(60,u.width+6),d=Math.max(40,u.height*2+40),f=`M 0 ${-d/2} L 0 ${d/2} Q ${h*2.4} 0 0 ${-d/2} Z`;if(a){const p=a.roughSvg.path(f,{roughness:1.5,seed:a.seed,fill:a.fillColor,fillStyle:"hachure",fillWeight:2.5,hachureGap:5,stroke:a.lineColor,strokeWidth:2});o.insert(()=>p,":first-child").attr("class","ishikawa-head")}else o.insert("path",":first-child").attr("class","ishikawa-head").attr("d",f);l.attr("transform",`translate(${(h-u.width)/2-u.x+3},${-u.y-u.height/2})`)},"drawHead"),ugt=x((t,e)=>{const r=[],n=[],i=x((a,s,o)=>{const l=e===-1?[...a].reverse():a;for(const u of l){const h=r.length,d=u.children??[];r.push({depth:o,text:lve(u.text,15),parentIndex:s,childCount:d.length}),o%2===0?(n.push(h),d.length&&i(d,h,o+1)):(d.length&&i(d,h,o+1),n.push(h))}},"walk");return i(t,-1,2),{entries:r,yOrder:n}},"flattenTree"),hgt=x((t,e,r,n,i,a,s)=>{const o=t.append("g").attr("class","ishikawa-label-group"),u=QS(o,e,r,n+11*i,"ishikawa-label cause","middle",a).node().getBBox();if(s){const h=s.roughSvg.rectangle(u.x-20,u.y-2,u.width+40,u.height+4,{roughness:1.5,seed:s.seed,fill:s.fillColor,fillStyle:"hachure",fillWeight:2.5,hachureGap:5,stroke:s.lineColor,strokeWidth:2});o.insert(()=>h,":first-child").attr("class","ishikawa-label-box")}else o.insert("rect",":first-child").attr("class","ishikawa-label-box").attr("x",u.x-20).attr("y",u.y-2).attr("width",u.width+40).attr("height",u.height+4)},"drawCauseLabel"),kP=x((t,e,r,n,i,a)=>{const s=Math.sqrt(n*n+i*i);if(s===0)return;const o=n/s,l=i/s,u=6,h=-l*u,d=o*u,f=e,p=r,g=`M ${f} ${p} L ${f-o*u*2+h} ${p-l*u*2+d} L ${f-o*u*2-h} ${p-l*u*2-d} Z`,m=a.roughSvg.path(g,{roughness:1,seed:a.seed,fill:a.lineColor,fillStyle:"solid",stroke:a.lineColor,strokeWidth:1});t.append(()=>m)},"drawArrowMarker"),dgt=x((t,e,r,n,i,a,s,o)=>{const l=e.children??[],u=a*(l.length?1:.2),h=-ive*u,d=ave*u*i,f=r+h,p=n+d;if(hm(t,r,n,f,p,"ishikawa-branch",o),o&&kP(t,r,n,r-f,n-p,o),hgt(t,e.text,f,p,i,s,o),!l.length)return;const{entries:g,yOrder:m}=ugt(l,i),y=g.length,v=new Array(y);for(const[A,C]of m.entries())v[C]=n+d*((A+1)/(y+1));const T=new Map;T.set(-1,{x0:r,y0:n,x1:f,y1:p,childCount:l.length,childrenDrawn:0});const b=-ive,w=ave*i,k=i<0?"ishikawa-label up":"ishikawa-label down";for(const[A,C]of g.entries()){const _=v[A],L=T.get(C.parentIndex),O=t.append("g").attr("class","ishikawa-sub-group");let M=0,z=0,F=0;if(C.depth%2===0){const S=L.y1-L.y0;M=cve(L.x0,L.x1,S?(_-L.y0)/S:.5),z=_,F=M-(C.childCount>0?sgt+C.childCount*ogt:agt),hm(O,M,_,F,_,"ishikawa-sub-branch",o),o&&kP(O,M,_,1,0,o),QS(O,C.text,F,_,"ishikawa-label align","end",s)}else{const S=L.childrenDrawn++;M=cve(L.x0,L.x1,(L.childCount-S)/(L.childCount+1)),z=L.y0,F=M+b*((_-z)/w),hm(O,M,z,F,_,"ishikawa-sub-branch",o),o&&kP(O,M,z,M-F,z-_,o),QS(O,C.text,F,_,k,"end",s)}C.childCount>0&&T.set(A,{x0:M,y0:z,x1:F,y1:_,childCount:C.childCount,childrenDrawn:0})}},"drawBranch"),fgt=x(t=>t.split(/|\n/),"splitLines"),lve=x((t,e)=>{if(t.length<=e)return t;const r=[];for(const n of t.split(/\s+/)){const i=r.length-1;i>=0&&r[i].length+1+n.length<=e?r[i]+=" "+n:r.push(n)}return r.join(` -`)},"wrapText"),QS=x((t,e,r,n,i,a,s)=>{const o=fgt(e),l=s*1.05,u=t.append("text").attr("class",i).attr("text-anchor",a).attr("x",r).attr("y",n-(o.length-1)*l/2);for(const[h,d]of o.entries())u.append("tspan").attr("x",r).attr("dy",h===0?0:l).text(d);return u},"drawMultilineText"),cve=x((t,e,r)=>t+(e-t)*r,"lerp"),hm=x((t,e,r,n,i,a,s)=>{if(s){const o=s.roughSvg.line(e,r,n,i,{roughness:1.5,seed:s.seed,stroke:s.lineColor,strokeWidth:2});t.append(()=>o).attr("class",a);return}return t.append("line").attr("class",a).attr("x1",e).attr("y1",r).attr("x2",n).attr("y2",i)},"drawLine"),pgt={draw:lgt},ggt=x(t=>` +Expecting `+K.join(", ")+", got '"+(this.terminals_[G]||G)+"'":Q="Parse error on line "+($+1)+": Unexpected "+(G==F?"end of input":"'"+(this.terminals_[G]||G)+"'"),this.parseError(Q,{text:R.match,token:this.terminals_[G]||G,line:R.yylineno,loc:D,expected:K})}if(H[0]instanceof Array&&H.length>1)throw new Error("Parse Error: multiple actions possible at state: "+V+", token: "+G);switch(H[0]){case 1:w.push(G),_.push(R.yytext),k.push(R.yylloc),w.push(H[1]),G=null,I=R.yyleng,L=R.yytext,$=R.yylineno,D=R.yylloc;break;case 2:if(ae=this.productions_[H[1]][1],ie.$=_[_.length-ae],ie._$={first_line:k[k.length-(ae||1)].first_line,last_line:k[k.length-1].last_line,first_column:k[k.length-(ae||1)].first_column,last_column:k[k.length-1].last_column},O&&(ie._$.range=[k[k.length-(ae||1)].range[0],k[k.length-1].range[1]]),W=this.performAction.apply(ie,[L,I,$,N.yy,H[1],_,k].concat(A)),typeof W<"u")return W;ae&&(w=w.slice(0,-1*ae*2),_=_.slice(0,-1*ae),k=k.slice(0,-1*ae)),w.push(this.productions_[H[1]][0]),_.push(ie.$),k.push(ie._$),J=S[w[w.length-2]][w[w.length-1]],w.push(J);break;case 3:return!0}}return!0},"parse")},m=(function(){var v={EOF:1,parseError:T(function(b,w){if(this.yy.parser)this.yy.parser.parseError(b,w);else throw new Error(b)},"parseError"),setInput:T(function(x,b){return this.yy=b||this.yy||{},this._input=x,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:T(function(){var x=this._input[0];this.yytext+=x,this.yyleng++,this.offset++,this.match+=x,this.matched+=x;var b=x.match(/(?:\r\n?|\n).*/g);return b?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),x},"input"),unput:T(function(x){var b=x.length,w=x.split(/(?:\r\n?|\n)/g);this._input=x+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-b),this.offset-=b;var C=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),w.length-1&&(this.yylineno-=w.length-1);var _=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:w?(w.length===C.length?this.yylloc.first_column:0)+C[C.length-w.length].length-w[0].length:this.yylloc.first_column-b},this.options.ranges&&(this.yylloc.range=[_[0],_[0]+this.yyleng-b]),this.yyleng=this.yytext.length,this},"unput"),more:T(function(){return this._more=!0,this},"more"),reject:T(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). +`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:T(function(x){this.unput(this.match.slice(x))},"less"),pastInput:T(function(){var x=this.matched.substr(0,this.matched.length-this.match.length);return(x.length>20?"...":"")+x.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:T(function(){var x=this.match;return x.length<20&&(x+=this._input.substr(0,20-x.length)),(x.substr(0,20)+(x.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:T(function(){var x=this.pastInput(),b=new Array(x.length+1).join("-");return x+this.upcomingInput()+` +`+b+"^"},"showPosition"),test_match:T(function(x,b){var w,C,_;if(this.options.backtrack_lexer&&(_={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(_.yylloc.range=this.yylloc.range.slice(0))),C=x[0].match(/(?:\r\n?|\n).*/g),C&&(this.yylineno+=C.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:C?C[C.length-1].length-C[C.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+x[0].length},this.yytext+=x[0],this.match+=x[0],this.matches=x,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(x[0].length),this.matched+=x[0],w=this.performAction.call(this,this.yy,this,b,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),w)return w;if(this._backtrack){for(var k in _)this[k]=_[k];return!1}return!1},"test_match"),next:T(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var x,b,w,C;this._more||(this.yytext="",this.match="");for(var _=this._currentRules(),k=0;k<_.length;k++)if(w=this._input.match(this.rules[_[k]]),w&&(!b||w[0].length>b[0].length)){if(b=w,C=k,this.options.backtrack_lexer){if(x=this.test_match(w,_[k]),x!==!1)return x;if(this._backtrack){b=!1;continue}else return!1}else if(!this.options.flex)break}return b?(x=this.test_match(b,_[C]),x!==!1?x:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:T(function(){var b=this.next();return b||this.lex()},"lex"),begin:T(function(b){this.conditionStack.push(b)},"begin"),popState:T(function(){var b=this.conditionStack.length-1;return b>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:T(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:T(function(b){return b=this.conditionStack.length-1-Math.abs(b||0),b>=0?this.conditionStack[b]:"INITIAL"},"topState"),pushState:T(function(b){this.begin(b)},"pushState"),stateStackSize:T(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:T(function(b,w,C,_){switch(C){case 0:return 6;case 1:return 8;case 2:return 8;case 3:return 6;case 4:return 7;case 5:return 13;case 6:return 14;case 7:return 11}},"anonymous"),rules:[/^(?:\s*%%.*)/i,/^(?:ishikawa-beta\b)/i,/^(?:ishikawa\b)/i,/^(?:[\s]+[\n])/i,/^(?:[\n]+)/i,/^(?:[\s]+)/i,/^(?:[^\n]+)/i,/^(?:$)/i],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7],inclusive:!0}}};return v})();g.lexer=m;function y(){this.yy={}}return T(y,"Parser"),y.prototype=g,g.Parser=y,new y})();QG.parser=QG;var qwt=QG,Vwt=(Sb=class{constructor(){this.stack=[],this.clear=this.clear.bind(this),this.addNode=this.addNode.bind(this),this.getRoot=this.getRoot.bind(this)}clear(){this.root=void 0,this.stack=[],this.baseLevel=void 0,Hn()}getRoot(){return this.root}addNode(e,r){const n=Dt.sanitizeText(r,Pe());if(!this.root){this.root={text:n,children:[]},this.stack=[{level:0,node:this.root}],oi(n);return}this.baseLevel??(this.baseLevel=e);let i=e-this.baseLevel+1;for(i<=0&&(i=1);this.stack.length>1&&this.stack[this.stack.length-1].level>=i;)this.stack.pop();const a=this.stack[this.stack.length-1].node,s={text:n,children:[]};a.children.push(s),this.stack.push({level:i,node:s})}getAccTitle(){return ii()}setAccTitle(e){Yn(e)}getAccDescription(){return si()}setAccDescription(e){ai(e)}getDiagramTitle(){return Xn()}setDiagramTitle(e){oi(e)}},T(Sb,"IshikawaDB"),Sb),Wwt=14,V1=250,Uwt=30,Hwt=60,Ywt=5,x4e=82*Math.PI/180,T4e=Math.cos(x4e),w4e=Math.sin(x4e),C4e=T((t,e,r)=>{const n=t.node().getBBox(),i=n.width+e*2,a=n.height+e*2;Wi(t,a,i,r),t.attr("viewBox",`${n.x-e} ${n.y-e} ${i} ${a}`)},"applyPaddedViewBox"),Xwt=T((t,e,r,n)=>{var N,M;const a=n.db.getRoot();if(!a)return;const s=Pe(),{look:o,handDrawnSeed:l,themeVariables:u}=s,h=cu(s.fontSize)[0]??Wwt,d=o==="handDrawn",f=a.children??[],p=((N=s.ishikawa)==null?void 0:N.diagramPadding)??20,g=((M=s.ishikawa)==null?void 0:M.useMaxWidth)??!1,m=Ys(e),y=m.append("g").attr("class","ishikawa"),v=d?er.svg(m.node()):void 0,x=v?{roughSvg:v,seed:l??0,lineColor:(u==null?void 0:u.lineColor)??"#333",fillColor:(u==null?void 0:u.mainBkg)??"#fff"}:void 0,b=`ishikawa-arrow-${e}`;d||y.append("defs").append("marker").attr("id",b).attr("viewBox","0 0 10 10").attr("refX",0).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto").append("path").attr("d","M 10 0 L 0 5 L 10 10 Z").attr("class","ishikawa-arrow");let w=0,C=V1;const _=d?void 0:W1(y,w,C,w,C,"ishikawa-spine");if(jwt(y,w,C,a.text,h,x),!f.length){d&&W1(y,w,C,w,C,"ishikawa-spine",x),C4e(m,p,g);return}w-=20;const k=f.filter((D,O)=>O%2===0),S=f.filter((D,O)=>O%2===1),L=k4e(k),$=k4e(S),I=L.total+$.total;let z=V1,F=V1;if(I>0){const D=V1*2,O=V1*.3;z=Math.max(O,D*(L.total/I)),F=Math.max(O,D*($.total/I))}const A=h*2;z=Math.max(z,L.max*A),F=Math.max(F,$.max*A),C=Math.max(z,V1),_&&_.attr("y1",C).attr("y2",C),y.select(".ishikawa-head-group").attr("transform",`translate(0,${C})`);const R=Math.ceil(f.length/2);for(let D=0;DMath.min(B,P.getBBox().x),1/0)}if(d)W1(y,w,C,0,C,"ishikawa-spine",x);else{_.attr("x1",w);const D=`url(#${b})`;y.selectAll("line.ishikawa-branch, line.ishikawa-sub-branch").attr("marker-start",D)}C4e(m,p,g)},"draw"),k4e=T(t=>{const e=T(r=>r.children.reduce((n,i)=>n+1+e(i),0),"countDescendants");return t.reduce((r,n)=>{const i=e(n);return r.total+=i,r.max=Math.max(r.max,i),r},{total:0,max:0})},"sideStats"),jwt=T((t,e,r,n,i,a)=>{const s=Math.max(6,Math.floor(110/(i*.6))),o=t.append("g").attr("class","ishikawa-head-group").attr("transform",`translate(${e},${r})`),l=ZA(o,E4e(n,s),0,0,"ishikawa-head-label","start",i),u=l.node().getBBox(),h=Math.max(60,u.width+6),d=Math.max(40,u.height*2+40),f=`M 0 ${-d/2} L 0 ${d/2} Q ${h*2.4} 0 0 ${-d/2} Z`;if(a){const p=a.roughSvg.path(f,{roughness:1.5,seed:a.seed,fill:a.fillColor,fillStyle:"hachure",fillWeight:2.5,hachureGap:5,stroke:a.lineColor,strokeWidth:2});o.insert(()=>p,":first-child").attr("class","ishikawa-head")}else o.insert("path",":first-child").attr("class","ishikawa-head").attr("d",f);l.attr("transform",`translate(${(h-u.width)/2-u.x+3},${-u.y-u.height/2})`)},"drawHead"),Kwt=T((t,e)=>{const r=[],n=[],i=T((a,s,o)=>{const l=e===-1?[...a].reverse():a;for(const u of l){const h=r.length,d=u.children??[];r.push({depth:o,text:E4e(u.text,15),parentIndex:s,childCount:d.length}),o%2===0?(n.push(h),d.length&&i(d,h,o+1)):(d.length&&i(d,h,o+1),n.push(h))}},"walk");return i(t,-1,2),{entries:r,yOrder:n}},"flattenTree"),Zwt=T((t,e,r,n,i,a,s)=>{const o=t.append("g").attr("class","ishikawa-label-group"),u=ZA(o,e,r,n+11*i,"ishikawa-label cause","middle",a).node().getBBox();if(s){const h=s.roughSvg.rectangle(u.x-20,u.y-2,u.width+40,u.height+4,{roughness:1.5,seed:s.seed,fill:s.fillColor,fillStyle:"hachure",fillWeight:2.5,hachureGap:5,stroke:s.lineColor,strokeWidth:2});o.insert(()=>h,":first-child").attr("class","ishikawa-label-box")}else o.insert("rect",":first-child").attr("class","ishikawa-label-box").attr("x",u.x-20).attr("y",u.y-2).attr("width",u.width+40).attr("height",u.height+4)},"drawCauseLabel"),JG=T((t,e,r,n,i,a)=>{const s=Math.sqrt(n*n+i*i);if(s===0)return;const o=n/s,l=i/s,u=6,h=-l*u,d=o*u,f=e,p=r,g=`M ${f} ${p} L ${f-o*u*2+h} ${p-l*u*2+d} L ${f-o*u*2-h} ${p-l*u*2-d} Z`,m=a.roughSvg.path(g,{roughness:1,seed:a.seed,fill:a.lineColor,fillStyle:"solid",stroke:a.lineColor,strokeWidth:1});t.append(()=>m)},"drawArrowMarker"),Qwt=T((t,e,r,n,i,a,s,o)=>{const l=e.children??[],u=a*(l.length?1:.2),h=-T4e*u,d=w4e*u*i,f=r+h,p=n+d;if(W1(t,r,n,f,p,"ishikawa-branch",o),o&&JG(t,r,n,r-f,n-p,o),Zwt(t,e.text,f,p,i,s,o),!l.length)return;const{entries:g,yOrder:m}=Kwt(l,i),y=g.length,v=new Array(y);for(const[_,k]of m.entries())v[k]=n+d*((_+1)/(y+1));const x=new Map;x.set(-1,{x0:r,y0:n,x1:f,y1:p,childCount:l.length,childrenDrawn:0});const b=-T4e,w=w4e*i,C=i<0?"ishikawa-label up":"ishikawa-label down";for(const[_,k]of g.entries()){const S=v[_],L=x.get(k.parentIndex),$=t.append("g").attr("class","ishikawa-sub-group");let I=0,z=0,F=0;if(k.depth%2===0){const A=L.y1-L.y0;I=S4e(L.x0,L.x1,A?(S-L.y0)/A:.5),z=S,F=I-(k.childCount>0?Hwt+k.childCount*Ywt:Uwt),W1($,I,S,F,S,"ishikawa-sub-branch",o),o&&JG($,I,S,1,0,o),ZA($,k.text,F,S,"ishikawa-label align","end",s)}else{const A=L.childrenDrawn++;I=S4e(L.x0,L.x1,(L.childCount-A)/(L.childCount+1)),z=L.y0,F=I+b*((S-z)/w),W1($,I,z,F,S,"ishikawa-sub-branch",o),o&&JG($,I,z,I-F,z-S,o),ZA($,k.text,F,S,C,"end",s)}k.childCount>0&&x.set(_,{x0:I,y0:z,x1:F,y1:S,childCount:k.childCount,childrenDrawn:0})}},"drawBranch"),Jwt=T(t=>t.split(/|\n/),"splitLines"),E4e=T((t,e)=>{if(t.length<=e)return t;const r=[];for(const n of t.split(/\s+/)){const i=r.length-1;i>=0&&r[i].length+1+n.length<=e?r[i]+=" "+n:r.push(n)}return r.join(` +`)},"wrapText"),ZA=T((t,e,r,n,i,a,s)=>{const o=Jwt(e),l=s*1.05,u=t.append("text").attr("class",i).attr("text-anchor",a).attr("x",r).attr("y",n-(o.length-1)*l/2);for(const[h,d]of o.entries())u.append("tspan").attr("x",r).attr("dy",h===0?0:l).text(d);return u},"drawMultilineText"),S4e=T((t,e,r)=>t+(e-t)*r,"lerp"),W1=T((t,e,r,n,i,a,s)=>{if(s){const o=s.roughSvg.line(e,r,n,i,{roughness:1.5,seed:s.seed,stroke:s.lineColor,strokeWidth:2});t.append(()=>o).attr("class",a);return}return t.append("line").attr("class",a).attr("x1",e).attr("y1",r).attr("x2",n).attr("y2",i)},"drawLine"),eCt={draw:Xwt},tCt=T(t=>` .ishikawa .ishikawa-spine, .ishikawa .ishikawa-branch, .ishikawa .ishikawa-sub-branch { @@ -3246,18 +3247,18 @@ Expecting `+Z.join(", ")+", got '"+(this.terminals_[G]||G)+"'":ee="Parse error o .ishikawa .ishikawa-label.down { dominant-baseline: hanging; } -`,"getStyles"),mgt=ggt,ygt={parser:rgt,get db(){return new ngt},renderer:pgt,styles:mgt};const vgt=Object.freeze(Object.defineProperty({__proto__:null,diagram:ygt},Symbol.toStringTag,{value:"Module"})),uve=1e-10;function JS(t,e){const r=xgt(t),n=r.filter(o=>bgt(o,t));let i=0,a=0;const s=[];if(n.length>1){const o=dve(n);for(let u=0;uh.angle-u.angle);let l=n[n.length-1];for(let u=0;ug.radius*2&&(b=g.radius*2),(f==null||f.width>b)&&(f={circle:g,width:b,p1:h,p2:l,large:b>g.radius,sweep:!0})}f!=null&&(s.push(f),i+=EP(f.circle.radius,f.width),l=h)}}else{let o=t[0];for(let u=1;uMath.abs(o.radius-t[u].radius)){l=!0;break}l?i=a=0:(i=o.radius*o.radius*Math.PI,s.push({circle:o,p1:{x:o.x,y:o.y+o.radius},p2:{x:o.x-uve,y:o.y+o.radius},width:o.radius*2,large:!0,sweep:!0}))}return a/=2,e&&(e.area=i+a,e.arcArea=i,e.polygonArea=a,e.arcs=s,e.innerPoints=n,e.intersectionPoints=r),i+a}function bgt(t,e){return e.every(r=>Ms(t,r)=t+e)return 0;if(r<=Math.abs(t-e))return Math.PI*Math.min(t,e)*Math.min(t,e);const n=t-(r*r-e*e+t*t)/(2*r),i=e-(r*r-t*t+e*e)/(2*r);return EP(t,n)+EP(e,i)}function hve(t,e){const r=Ms(t,e),n=t.radius,i=e.radius;if(r>=n+i||r<=Math.abs(n-i))return[];const a=(n*n-i*i+r*r)/(2*r),s=Math.sqrt(n*n-a*a),o=t.x+a*(e.x-t.x)/r,l=t.y+a*(e.y-t.y)/r,u=-(e.y-t.y)*(s/r),h=-(e.x-t.x)*(s/r);return[{x:o+u,y:l-h},{x:o-u,y:l+h}]}function dve(t){const e={x:0,y:0};for(const r of t)e.x+=r.x,e.y+=r.y;return e.x/=t.length,e.y/=t.length,e}function Tgt(t,e,r,n){n=n||{};const i=n.maxIterations||100,a=n.tolerance||1e-10,s=t(e),o=t(r);let l=r-e;if(s*o>0)throw"Initial bisect points must have opposite signs";if(s===0)return e;if(o===0)return r;for(let u=0;u=0&&(e=h),Math.abs(l)AP(e))}function dm(t,e){let r=0;for(let n=0;nk.fx-A.fx,v=e.slice(),T=e.slice(),b=e.slice(),w=e.slice();for(let k=0;k{const L=_.slice();return L.fx=_.fx,L.id=_.id,L});C.sort((_,L)=>_.id-L.id),r.history.push({x:g[0].slice(),fx:g[0].fx,simplex:C})}f=0;for(let C=0;C=g[p-1].fx){let C=!1;if(T.fx>A.fx?(vu(b,1+h,v,-h,A),b.fx=t(b),b.fx=1)break;for(let _=1;_o+a*i*l||u>=y)m=i;else{if(Math.abs(d)<=-s*l)return i;d*(m-g)>=0&&(m=g),g=i,y=u}return 0}for(let g=0;g<10;++g){if(vu(n.x,1,r.x,i,e),u=n.fx=t(n.x,n.fxprime),d=dm(n.fxprime,e),u>o+a*i*l||g&&u>=h)return p(f,i,h);if(Math.abs(d)<=-s*l)return i;if(d>=0)return p(i,f,u);h=u,f=i,i*=2}return i}function Cgt(t,e,r){let n={x:e.slice(),fx:0,fxprime:e.slice()},i={x:e.slice(),fx:0,fxprime:e.slice()};const a=e.slice();let s,o,l=1,u;r=r||{},u=r.maxIterations||e.length*20,n.fx=t(n.x,n.fxprime),s=n.fxprime.slice(),RP(s,n.fxprime,-1);for(let h=0;h{const d={};for(let f=0;fSP(t,e,n)-r,0,t+e)}function kgt(t,e={}){const r=e.distinct,n=t.map(o=>Object.assign({},o));function i(o){return o.join(";")}if(r){const o=new Map;for(const l of n)for(let u=0;uo===l?0:oa.sets.length===2).forEach(a=>{const s=r[a.sets[0]],o=r[a.sets[1]],l=Math.sqrt(e[s].size/Math.PI),u=Math.sqrt(e[o].size/Math.PI),h=LP(l,u,a.size);n[s][o]=n[o][s]=h;let d=0;a.size+1e-10>=Math.min(e[s].size,e[o].size)?d=1:a.size<=1e-10&&(d=-1),i[s][o]=i[o][s]=d}),{distances:n,constraints:i}}function Sgt(t,e,r,n){for(let a=0;a0&&g<=d||f<0&&g>=d||(i+=2*m*m,e[2*a]+=4*m*(s-u),e[2*a+1]+=4*m*(o-h),e[2*l]+=4*m*(u-s),e[2*l+1]+=4*m*(h-o))}}return i}function Agt(t,e={}){let r=Rgt(t,e);const n=e.lossFunction||fm;if(t.length>=8){const i=_gt(t,e),a=n(i,t),s=n(r,t);a+1e-8f.map(p=>p/o));const l=(f,p)=>Sgt(f,p,a,s);let u=null;for(let f=0;fd.sets.length===2);for(const d of t){let f=d.weight!=null?d.weight:1;const p=d.sets[0],g=d.sets[1];d.size+mve>=Math.min(n[p].size,n[g].size)&&(f=0),i[p].push({set:g,size:d.size,weight:f}),i[g].push({set:p,size:d.size,weight:f})}const a=[];Object.keys(i).forEach(d=>{let f=0;for(let p=0;pt[s]));const a=n.weight!=null?n.weight:1;r+=a*(i-n.size)*(i-n.size)}return r}function yve(t,e){let r=0;for(const n of e){if(n.sets.length===1)continue;let i;if(n.sets.length===2){const o=t[n.sets[0]],l=t[n.sets[1]];i=SP(o.radius,l.radius,Ms(o,l))}else i=JS(n.sets.map(o=>t[o]));const a=n.weight!=null?n.weight:1,s=Math.log((i+1)/(n.size+1));r+=a*s*s}return r}function Lgt(t,e,r){if(r==null?t.sort((i,a)=>a.radius-i.radius):t.sort(r),t.length>0){const i=t[0].x,a=t[0].y;for(const s of t)s.x-=i,s.y-=a}if(t.length===2&&Ms(t[0],t[1])1){const i=Math.atan2(t[1].x,t[1].y)-e,a=Math.cos(i),s=Math.sin(i);for(const o of t){const l=o.x,u=o.y;o.x=a*l-s*u,o.y=s*l+a*u}}if(t.length>2){let i=Math.atan2(t[2].x,t[2].y)-e;for(;i<0;)i+=2*Math.PI;for(;i>2*Math.PI;)i-=2*Math.PI;if(i>Math.PI){const a=t[1].y/(1e-10+t[1].x);for(const s of t){var n=(s.x+a*s.y)/(1+a*a);s.x=2*n-s.x,s.y=2*n*a-s.y}}}}function Igt(t){t.forEach(i=>{i.parent=i});function e(i){return i.parent!==i&&(i.parent=e(i.parent)),i.parent}function r(i,a){const s=e(i),o=e(a);s.parent=o}for(let i=0;i{delete i.parent}),Array.from(n.values())}function IP(t){const e=r=>{const n=t.reduce((a,s)=>Math.max(a,s[r]+s.radius),Number.NEGATIVE_INFINITY),i=t.reduce((a,s)=>Math.min(a,s[r]-s.radius),Number.POSITIVE_INFINITY);return{max:n,min:i}};return{xRange:e("x"),yRange:e("y")}}function vve(t,e,r){e==null&&(e=Math.PI/2);let n=Tve(t).map(u=>Object.assign({},u));const i=Igt(n);for(const u of i){Lgt(u,e,r);const h=IP(u);u.size=(h.xRange.max-h.xRange.min)*(h.yRange.max-h.yRange.min),u.bounds=h}i.sort((u,h)=>h.size-u.size),n=i[0];let a=n.bounds;const s=(a.xRange.max-a.xRange.min)/50;function o(u,h,d){if(!u)return;const f=u.bounds;let p,g;if(h)p=a.xRange.max-f.xRange.min+s;else{p=a.xRange.max-f.xRange.max;const m=(f.xRange.max-f.xRange.min)/2-(a.xRange.max-a.xRange.min)/2;m<0&&(p+=m)}if(d)g=a.yRange.max-f.yRange.min+s;else{g=a.yRange.max-f.yRange.max;const m=(f.yRange.max-f.yRange.min)/2-(a.yRange.max-a.yRange.min)/2;m<0&&(g+=m)}for(const m of u)m.x+=p,m.y+=g,n.push(m)}let l=1;for(;l({radius:h*p.radius,x:n+d+(p.x-s.min)*h,y:n+f+(p.y-o.min)*h,setid:p.setid})))}function xve(t){const e={};for(const r of t)e[r.setid]=r;return e}function Tve(t){return Object.keys(t).map(r=>Object.assign(t[r],{setid:r}))}function Dgt(t={}){let e=!1,r=600,n=350,i=15,a=1e3,s=Math.PI/2,o=!0,l=null,u=!0,h=!0,d=null,f=null,p=!1,g=null,m=t&&t.symmetricalTextCentre?t.symmetricalTextCentre:!1,y={},v=t&&t.colourScheme?t.colourScheme:t&&t.colorScheme?t.colorScheme:["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],T=0,b=function(C){if(C in y)return y[C];var _=y[C]=v[T];return T+=1,T>=v.length&&(T=0),_},w=gve,k=fm;function A(C){let _=C.datum();const L=new Set;_.forEach(K=>{K.size==0&&K.sets.length==1&&L.add(K.sets[0])}),_=_.filter(K=>!K.sets.some(se=>L.has(se)));let O={},M={};if(_.length>0){let K=w(_,{lossFunction:k,distinct:p});o&&(K=vve(K,s,f)),O=bve(K,r,n,i,l),M=Cve(O,_,m)}const z={};_.forEach(K=>{K.label&&(z[K.sets]=K.label)});function F(K){if(K.sets in z)return z[K.sets];if(K.sets.length==1)return""+K.sets[0]}C.selectAll("svg").data([O]).enter().append("svg");const S=C.select("svg");e?S.attr("viewBox",`0 0 ${r} ${n}`):S.attr("width",r).attr("height",n);const R={};let N=!1;S.selectAll(".venn-area path").each(function(K){const se=this.getAttribute("d");K.sets.length==1&&se&&!p&&(N=!0,R[K.sets[0]]=Ogt(se))});function D(K){return se=>{const J=K.sets.map(Z=>{let ee=R[Z],ne=O[Z];return ee||(ee={x:r/2,y:n/2,radius:1}),ne||(ne={x:r/2,y:n/2,radius:1}),{x:ee.x*(1-se)+ne.x*se,y:ee.y*(1-se)+ne.y*se,radius:ee.radius*(1-se)+ne.radius*se}});return Sve(J,g)}}const I=S.selectAll(".venn-area").data(_,K=>K.sets),$=I.enter().append("g").attr("class",K=>`venn-area venn-${K.sets.length==1?"circle":"intersection"}${K.colour||K.color?" venn-coloured":""}`).attr("data-venn-sets",K=>K.sets.join("_")),B=$.append("path"),P=$.append("text").attr("class","label").text(K=>F(K)).attr("text-anchor","middle").attr("dy",".35em").attr("x",r/2).attr("y",n/2);h&&(B.style("fill-opacity","0").filter(K=>K.sets.length==1).style("fill",K=>K.colour?K.colour:K.color?K.color:b(K.sets)).style("fill-opacity",".25"),P.style("fill",K=>K.colour||K.color?"#FFF":t.textFill?t.textFill:K.sets.length==1?b(K.sets):"#444"));function G(K){return typeof K.transition=="function"?K.transition("venn").duration(a):K}let V=C;N&&typeof V.transition=="function"?(V=G(C),V.selectAll("path").attrTween("d",D)):V.selectAll("path").attr("d",K=>Sve(K.sets.map(se=>O[se])),g);const Y=V.selectAll("text").filter(K=>K.sets in M).text(K=>F(K)).attr("x",K=>Math.floor(M[K.sets].x)).attr("y",K=>Math.floor(M[K.sets].y));u&&(N?"on"in Y?Y.on("end",DP(O,F)):Y.each("end",DP(O,F)):Y.each(DP(O,F)));const W=G(I.exit()).remove();typeof I.transition=="function"&&W.selectAll("path").attrTween("d",D);const ie=W.selectAll("text").attr("x",r/2).attr("y",n/2);return d!==null&&(P.style("font-size","0px"),Y.style("font-size",d),ie.style("font-size","0px")),{circles:O,textCentres:M,nodes:I,enter:$,update:V,exit:W}}return A.wrap=function(C){return arguments.length?(u=C,A):u},A.useViewBox=function(){return e=!0,A},A.width=function(C){return arguments.length?(r=C,A):r},A.height=function(C){return arguments.length?(n=C,A):n},A.padding=function(C){return arguments.length?(i=C,A):i},A.distinct=function(C){return arguments.length?(p=C,A):p},A.colours=function(C){return arguments.length?(b=C,A):b},A.colors=function(C){return arguments.length?(b=C,A):b},A.fontSize=function(C){return arguments.length?(d=C,A):d},A.round=function(C){return arguments.length?(g=C,A):g},A.duration=function(C){return arguments.length?(a=C,A):a},A.layoutFunction=function(C){return arguments.length?(w=C,A):w},A.normalize=function(C){return arguments.length?(o=C,A):o},A.scaleToFit=function(C){return arguments.length?(l=C,A):l},A.styled=function(C){return arguments.length?(h=C,A):h},A.orientation=function(C){return arguments.length?(s=C,A):s},A.orientationOrder=function(C){return arguments.length?(f=C,A):f},A.lossFunction=function(C){return arguments.length?(k=C==="default"?fm:C==="logRatio"?yve:C,A):k},A}function DP(t,e){return function(r){const n=this,i=t[r.sets[0]].radius||50,a=e(r)||"",s=a.split(/\s+/).reverse(),l=(a.length+s.length)/3;let u=s.pop(),h=[u],d=0;const f=1.1;n.textContent=null;const p=[];function g(b){const w=n.ownerDocument.createElementNS(n.namespaceURI,"tspan");return w.textContent=b,p.push(w),n.append(w),w}let m=g(u);for(;u=s.pop(),!!u;){h.push(u);const b=h.join(" ");m.textContent=b,b.length>l&&m.getComputedTextLength()>i&&(h.pop(),m.textContent=h.join(" "),h=[u],m=g(u),d++)}const y=.35-d*f/2,v=n.getAttribute("x"),T=n.getAttribute("y");p.forEach((b,w)=>{b.setAttribute("x",v),b.setAttribute("y",T),b.setAttribute("dy",`${y+w*f}em`)})}}function MP(t,e,r){let n=e[0].radius-Ms(e[0],t);for(let i=1;i=a&&(i=n[h],a=d)}const s=pve(h=>-1*MP({x:h[0],y:h[1]},t,e),[i.x,i.y],{maxIterations:500,minErrorDelta:1e-10}).x,o={x:r?0:s[0],y:s[1]};let l=!0;for(const h of t)if(Ms(o,h)>h.radius){l=!1;break}for(const h of e)if(Ms(o,h)h.p1))}function Mgt(t){const e={},r=Object.keys(t);for(const n of r)e[n]=[];for(let n=0;n0&&console.log("WARNING: area "+s+" not represented on screen")}return n}function Ngt(t,e,r){const n=[];return n.push(` +`,"getStyles"),rCt=tCt,nCt={parser:qwt,get db(){return new Vwt},renderer:eCt,styles:rCt};const iCt=Object.freeze(Object.defineProperty({__proto__:null,diagram:nCt},Symbol.toStringTag,{value:"Module"})),_4e=1e-10;function QA(t,e){const r=sCt(t),n=r.filter(o=>aCt(o,t));let i=0,a=0;const s=[];if(n.length>1){const o=R4e(n);for(let u=0;uh.angle-u.angle);let l=n[n.length-1];for(let u=0;ug.radius*2&&(b=g.radius*2),(f==null||f.width>b)&&(f={circle:g,width:b,p1:h,p2:l,large:b>g.radius,sweep:!0})}f!=null&&(s.push(f),i+=eq(f.circle.radius,f.width),l=h)}}else{let o=t[0];for(let u=1;uMath.abs(o.radius-t[u].radius)){l=!0;break}l?i=a=0:(i=o.radius*o.radius*Math.PI,s.push({circle:o,p1:{x:o.x,y:o.y+o.radius},p2:{x:o.x-_4e,y:o.y+o.radius},width:o.radius*2,large:!0,sweep:!0}))}return a/=2,e&&(e.area=i+a,e.arcArea=i,e.polygonArea=a,e.arcs=s,e.innerPoints=n,e.intersectionPoints=r),i+a}function aCt(t,e){return e.every(r=>ho(t,r)=t+e)return 0;if(r<=Math.abs(t-e))return Math.PI*Math.min(t,e)*Math.min(t,e);const n=t-(r*r-e*e+t*t)/(2*r),i=e-(r*r-t*t+e*e)/(2*r);return eq(t,n)+eq(e,i)}function A4e(t,e){const r=ho(t,e),n=t.radius,i=e.radius;if(r>=n+i||r<=Math.abs(n-i))return[];const a=(n*n-i*i+r*r)/(2*r),s=Math.sqrt(n*n-a*a),o=t.x+a*(e.x-t.x)/r,l=t.y+a*(e.y-t.y)/r,u=-(e.y-t.y)*(s/r),h=-(e.x-t.x)*(s/r);return[{x:o+u,y:l-h},{x:o-u,y:l+h}]}function R4e(t){const e={x:0,y:0};for(const r of t)e.x+=r.x,e.y+=r.y;return e.x/=t.length,e.y/=t.length,e}function oCt(t,e,r,n){n=n||{};const i=n.maxIterations||100,a=n.tolerance||1e-10,s=t(e),o=t(r);let l=r-e;if(s*o>0)throw"Initial bisect points must have opposite signs";if(s===0)return e;if(o===0)return r;for(let u=0;u=0&&(e=h),Math.abs(l)rq(e))}function U1(t,e){let r=0;for(let n=0;nC.fx-_.fx,v=e.slice(),x=e.slice(),b=e.slice(),w=e.slice();for(let C=0;C{const L=S.slice();return L.fx=S.fx,L.id=S.id,L});k.sort((S,L)=>S.id-L.id),r.history.push({x:g[0].slice(),fx:g[0].fx,simplex:k})}f=0;for(let k=0;k=g[p-1].fx){let k=!1;if(x.fx>_.fx?(yh(b,1+h,v,-h,_),b.fx=t(b),b.fx<_.fx?m(b):k=!0):(yh(b,1-h*l,v,h*l,_),b.fx=t(b),b.fx=1)break;for(let S=1;So+a*i*l||u>=y)m=i;else{if(Math.abs(d)<=-s*l)return i;d*(m-g)>=0&&(m=g),g=i,y=u}return 0}for(let g=0;g<10;++g){if(yh(n.x,1,r.x,i,e),u=n.fx=t(n.x,n.fxprime),d=U1(n.fxprime,e),u>o+a*i*l||g&&u>=h)return p(f,i,h);if(Math.abs(d)<=-s*l)return i;if(d>=0)return p(i,f,u);h=u,f=i,i*=2}return i}function cCt(t,e,r){let n={x:e.slice(),fx:0,fxprime:e.slice()},i={x:e.slice(),fx:0,fxprime:e.slice()};const a=e.slice();let s,o,l=1,u;r=r||{},u=r.maxIterations||e.length*20,n.fx=t(n.x,n.fxprime),s=n.fxprime.slice(),iq(s,n.fxprime,-1);for(let h=0;h{const d={};for(let f=0;ftq(t,e,n)-r,0,t+e)}function uCt(t,e={}){const r=e.distinct,n=t.map(o=>Object.assign({},o));function i(o){return o.join(";")}if(r){const o=new Map;for(const l of n)for(let u=0;uo===l?0:oa.sets.length===2).forEach(a=>{const s=r[a.sets[0]],o=r[a.sets[1]],l=Math.sqrt(e[s].size/Math.PI),u=Math.sqrt(e[o].size/Math.PI),h=aq(l,u,a.size);n[s][o]=n[o][s]=h;let d=0;a.size+1e-10>=Math.min(e[s].size,e[o].size)?d=1:a.size<=1e-10&&(d=-1),i[s][o]=i[o][s]=d}),{distances:n,constraints:i}}function dCt(t,e,r,n){for(let a=0;a0&&g<=d||f<0&&g>=d||(i+=2*m*m,e[2*a]+=4*m*(s-u),e[2*a+1]+=4*m*(o-h),e[2*l]+=4*m*(u-s),e[2*l+1]+=4*m*(h-o))}}return i}function fCt(t,e={}){let r=gCt(t,e);const n=e.lossFunction||H1;if(t.length>=8){const i=pCt(t,e),a=n(i,t),s=n(r,t);a+1e-8f.map(p=>p/o));const l=(f,p)=>dCt(f,p,a,s);let u=null;for(let f=0;fd.sets.length===2);for(const d of t){let f=d.weight!=null?d.weight:1;const p=d.sets[0],g=d.sets[1];d.size+M4e>=Math.min(n[p].size,n[g].size)&&(f=0),i[p].push({set:g,size:d.size,weight:f}),i[g].push({set:p,size:d.size,weight:f})}const a=[];Object.keys(i).forEach(d=>{let f=0;for(let p=0;pt[s]));const a=n.weight!=null?n.weight:1;r+=a*(i-n.size)*(i-n.size)}return r}function N4e(t,e){let r=0;for(const n of e){if(n.sets.length===1)continue;let i;if(n.sets.length===2){const o=t[n.sets[0]],l=t[n.sets[1]];i=tq(o.radius,l.radius,ho(o,l))}else i=QA(n.sets.map(o=>t[o]));const a=n.weight!=null?n.weight:1,s=Math.log((i+1)/(n.size+1));r+=a*s*s}return r}function mCt(t,e,r){if(r==null?t.sort((i,a)=>a.radius-i.radius):t.sort(r),t.length>0){const i=t[0].x,a=t[0].y;for(const s of t)s.x-=i,s.y-=a}if(t.length===2&&ho(t[0],t[1])1){const i=Math.atan2(t[1].x,t[1].y)-e,a=Math.cos(i),s=Math.sin(i);for(const o of t){const l=o.x,u=o.y;o.x=a*l-s*u,o.y=s*l+a*u}}if(t.length>2){let i=Math.atan2(t[2].x,t[2].y)-e;for(;i<0;)i+=2*Math.PI;for(;i>2*Math.PI;)i-=2*Math.PI;if(i>Math.PI){const a=t[1].y/(1e-10+t[1].x);for(const s of t){var n=(s.x+a*s.y)/(1+a*a);s.x=2*n-s.x,s.y=2*n*a-s.y}}}}function yCt(t){t.forEach(i=>{i.parent=i});function e(i){return i.parent!==i&&(i.parent=e(i.parent)),i.parent}function r(i,a){const s=e(i),o=e(a);s.parent=o}for(let i=0;i{delete i.parent}),Array.from(n.values())}function sq(t){const e=r=>{const n=t.reduce((a,s)=>Math.max(a,s[r]+s.radius),Number.NEGATIVE_INFINITY),i=t.reduce((a,s)=>Math.min(a,s[r]-s.radius),Number.POSITIVE_INFINITY);return{max:n,min:i}};return{xRange:e("x"),yRange:e("y")}}function $4e(t,e,r){e==null&&(e=Math.PI/2);let n=B4e(t).map(u=>Object.assign({},u));const i=yCt(n);for(const u of i){mCt(u,e,r);const h=sq(u);u.size=(h.xRange.max-h.xRange.min)*(h.yRange.max-h.yRange.min),u.bounds=h}i.sort((u,h)=>h.size-u.size),n=i[0];let a=n.bounds;const s=(a.xRange.max-a.xRange.min)/50;function o(u,h,d){if(!u)return;const f=u.bounds;let p,g;if(h)p=a.xRange.max-f.xRange.min+s;else{p=a.xRange.max-f.xRange.max;const m=(f.xRange.max-f.xRange.min)/2-(a.xRange.max-a.xRange.min)/2;m<0&&(p+=m)}if(d)g=a.yRange.max-f.yRange.min+s;else{g=a.yRange.max-f.yRange.max;const m=(f.yRange.max-f.yRange.min)/2-(a.yRange.max-a.yRange.min)/2;m<0&&(g+=m)}for(const m of u)m.x+=p,m.y+=g,n.push(m)}let l=1;for(;l({radius:h*p.radius,x:n+d+(p.x-s.min)*h,y:n+f+(p.y-o.min)*h,setid:p.setid})))}function P4e(t){const e={};for(const r of t)e[r.setid]=r;return e}function B4e(t){return Object.keys(t).map(r=>Object.assign(t[r],{setid:r}))}function vCt(t={}){let e=!1,r=600,n=350,i=15,a=1e3,s=Math.PI/2,o=!0,l=null,u=!0,h=!0,d=null,f=null,p=!1,g=null,m=t&&t.symmetricalTextCentre?t.symmetricalTextCentre:!1,y={},v=t&&t.colourScheme?t.colourScheme:t&&t.colorScheme?t.colorScheme:["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],x=0,b=function(k){if(k in y)return y[k];var S=y[k]=v[x];return x+=1,x>=v.length&&(x=0),S},w=D4e,C=H1;function _(k){let S=k.datum();const L=new Set;S.forEach(j=>{j.size==0&&j.sets.length==1&&L.add(j.sets[0])}),S=S.filter(j=>!j.sets.some(ae=>L.has(ae)));let $={},I={};if(S.length>0){let j=w(S,{lossFunction:C,distinct:p});o&&(j=$4e(j,s,f)),$=O4e(j,r,n,i,l),I=z4e($,S,m)}const z={};S.forEach(j=>{j.label&&(z[j.sets]=j.label)});function F(j){if(j.sets in z)return z[j.sets];if(j.sets.length==1)return""+j.sets[0]}k.selectAll("svg").data([$]).enter().append("svg");const A=k.select("svg");e?A.attr("viewBox",`0 0 ${r} ${n}`):A.attr("width",r).attr("height",n);const R={};let N=!1;A.selectAll(".venn-area path").each(function(j){const ae=this.getAttribute("d");j.sets.length==1&&ae&&!p&&(N=!0,R[j.sets[0]]=TCt(ae))});function M(j){return ae=>{const J=j.sets.map(K=>{let Q=R[K],re=$[K];return Q||(Q={x:r/2,y:n/2,radius:1}),re||(re={x:r/2,y:n/2,radius:1}),{x:Q.x*(1-ae)+re.x*ae,y:Q.y*(1-ae)+re.y*ae,radius:Q.radius*(1-ae)+re.radius*ae}});return V4e(J,g)}}const D=A.selectAll(".venn-area").data(S,j=>j.sets),O=D.enter().append("g").attr("class",j=>`venn-area venn-${j.sets.length==1?"circle":"intersection"}${j.colour||j.color?" venn-coloured":""}`).attr("data-venn-sets",j=>j.sets.join("_")),B=O.append("path"),P=O.append("text").attr("class","label").text(j=>F(j)).attr("text-anchor","middle").attr("dy",".35em").attr("x",r/2).attr("y",n/2);h&&(B.style("fill-opacity","0").filter(j=>j.sets.length==1).style("fill",j=>j.colour?j.colour:j.color?j.color:b(j.sets)).style("fill-opacity",".25"),P.style("fill",j=>j.colour||j.color?"#FFF":t.textFill?t.textFill:j.sets.length==1?b(j.sets):"#444"));function G(j){return typeof j.transition=="function"?j.transition("venn").duration(a):j}let V=k;N&&typeof V.transition=="function"?(V=G(k),V.selectAll("path").attrTween("d",M)):V.selectAll("path").attr("d",j=>V4e(j.sets.map(ae=>$[ae])),g);const H=V.selectAll("text").filter(j=>j.sets in I).text(j=>F(j)).attr("x",j=>Math.floor(I[j.sets].x)).attr("y",j=>Math.floor(I[j.sets].y));u&&(N?"on"in H?H.on("end",oq($,F)):H.each("end",oq($,F)):H.each(oq($,F)));const W=G(D.exit()).remove();typeof D.transition=="function"&&W.selectAll("path").attrTween("d",M);const ie=W.selectAll("text").attr("x",r/2).attr("y",n/2);return d!==null&&(P.style("font-size","0px"),H.style("font-size",d),ie.style("font-size","0px")),{circles:$,textCentres:I,nodes:D,enter:O,update:V,exit:W}}return _.wrap=function(k){return arguments.length?(u=k,_):u},_.useViewBox=function(){return e=!0,_},_.width=function(k){return arguments.length?(r=k,_):r},_.height=function(k){return arguments.length?(n=k,_):n},_.padding=function(k){return arguments.length?(i=k,_):i},_.distinct=function(k){return arguments.length?(p=k,_):p},_.colours=function(k){return arguments.length?(b=k,_):b},_.colors=function(k){return arguments.length?(b=k,_):b},_.fontSize=function(k){return arguments.length?(d=k,_):d},_.round=function(k){return arguments.length?(g=k,_):g},_.duration=function(k){return arguments.length?(a=k,_):a},_.layoutFunction=function(k){return arguments.length?(w=k,_):w},_.normalize=function(k){return arguments.length?(o=k,_):o},_.scaleToFit=function(k){return arguments.length?(l=k,_):l},_.styled=function(k){return arguments.length?(h=k,_):h},_.orientation=function(k){return arguments.length?(s=k,_):s},_.orientationOrder=function(k){return arguments.length?(f=k,_):f},_.lossFunction=function(k){return arguments.length?(C=k==="default"?H1:k==="logRatio"?N4e:k,_):C},_}function oq(t,e){return function(r){const n=this,i=t[r.sets[0]].radius||50,a=e(r)||"",s=a.split(/\s+/).reverse(),l=(a.length+s.length)/3;let u=s.pop(),h=[u],d=0;const f=1.1;n.textContent=null;const p=[];function g(b){const w=n.ownerDocument.createElementNS(n.namespaceURI,"tspan");return w.textContent=b,p.push(w),n.append(w),w}let m=g(u);for(;u=s.pop(),!!u;){h.push(u);const b=h.join(" ");m.textContent=b,b.length>l&&m.getComputedTextLength()>i&&(h.pop(),m.textContent=h.join(" "),h=[u],m=g(u),d++)}const y=.35-d*f/2,v=n.getAttribute("x"),x=n.getAttribute("y");p.forEach((b,w)=>{b.setAttribute("x",v),b.setAttribute("y",x),b.setAttribute("dy",`${y+w*f}em`)})}}function lq(t,e,r){let n=e[0].radius-ho(e[0],t);for(let i=1;i=a&&(i=n[h],a=d)}const s=I4e(h=>-1*lq({x:h[0],y:h[1]},t,e),[i.x,i.y],{maxIterations:500,minErrorDelta:1e-10}).x,o={x:r?0:s[0],y:s[1]};let l=!0;for(const h of t)if(ho(o,h)>h.radius){l=!1;break}for(const h of e)if(ho(o,h)h.p1))}function bCt(t){const e={},r=Object.keys(t);for(const n of r)e[n]=[];for(let n=0;n0&&console.log("WARNING: area "+s+" not represented on screen")}return n}function xCt(t,e,r){const n=[];return n.push(` M`,t,e),n.push(` m`,-r,0),n.push(` a`,r,r,0,1,0,r*2,0),n.push(` -a`,r,r,0,1,0,-r*2,0),n.join(" ")}function Ogt(t){const e=t.split(" ");return{x:Number.parseFloat(e[1]),y:Number.parseFloat(e[2]),radius:-Number.parseFloat(e[4])}}function kve(t){if(t.length===0)return[];const e={};return JS(t,e),e.arcs}function Eve(t,e){if(t.length===0)return"M 0 0";const r=Math.pow(10,e||0),n=e!=null?a=>Math.round(a*r)/r:a=>a;if(t.length==1){const a=t[0].circle;return Ngt(n(a.x),n(a.y),n(a.radius))}const i=[` +a`,r,r,0,1,0,-r*2,0),n.join(" ")}function TCt(t){const e=t.split(" ");return{x:Number.parseFloat(e[1]),y:Number.parseFloat(e[2]),radius:-Number.parseFloat(e[4])}}function G4e(t){if(t.length===0)return[];const e={};return QA(t,e),e.arcs}function q4e(t,e){if(t.length===0)return"M 0 0";const r=Math.pow(10,e||0),n=e!=null?a=>Math.round(a*r)/r:a=>a;if(t.length==1){const a=t[0].circle;return xCt(n(a.x),n(a.y),n(a.radius))}const i=[` M`,n(t[0].p2.x),n(t[0].p2.y)];for(const a of t){const s=n(a.circle.radius);i.push(` -A`,s,s,0,a.large?1:0,a.sweep?1:0,n(a.p1.x),n(a.p1.y))}return i.join(" ")}function Sve(t,e){return Eve(kve(t),e)}function $gt(t,e={}){const{lossFunction:r,layoutFunction:n=gve,normalize:i=!0,orientation:a=Math.PI/2,orientationOrder:s,width:o=600,height:l=350,padding:u=15,scaleToFit:h=!1,symmetricalTextCentre:d=!1,distinct:f,round:p=2}=e;let g=n(t,{lossFunction:r==="default"||!r?fm:r==="logRatio"?yve:r,distinct:f});i&&(g=vve(g,a,s));const m=bve(g,o,l,u,h),y=Cve(m,t,d),v=new Map(Object.keys(m).map(w=>[w,{set:w,x:m[w].x,y:m[w].y,radius:m[w].radius}])),T=t.map(w=>{const k=w.sets.map(_=>v.get(_)),A=kve(k),C=Eve(A,p);return{circles:k,arcs:A,path:C,area:w,has:new Set(w.sets)}});function b(w){let k="";for(const A of T)A.has.size>w.length&&w.every(C=>A.has.has(C))&&(k+=" "+A.path);return k}return T.map(({circles:w,arcs:k,path:A,area:C})=>({data:C,text:y[C.sets],circles:w,arcs:k,path:A,distinctPath:A+b(C.sets)}))}var NP=(function(){var t=x(function(T,b,w,k){for(w=w||{},k=T.length;k--;w[T[k]]=b);return w},"o"),e=[5,8],r=[7,8,11,12,17,19,22,24],n=[1,17],i=[1,18],a=[7,8,11,12,14,15,16,17,19,20,21,22,24,27],s=[1,31],o=[1,39],l=[7,8,11,12,17,19,22,24,27],u=[1,57],h=[1,56],d=[1,58],f=[1,59],p=[1,60],g=[7,8,11,12,16,17,19,20,22,24,27,31,32,33],m={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,start:3,optNewlines:4,VENN:5,document:6,EOF:7,NEWLINE:8,line:9,statement:10,TITLE:11,SET:12,identifier:13,BRACKET_LABEL:14,COLON:15,NUMERIC:16,UNION:17,identifierList:18,TEXT:19,IDENTIFIER:20,STRING:21,INDENT_TEXT:22,indentedTextTail:23,STYLE:24,stylesOpt:25,styleField:26,COMMA:27,styleValue:28,valueTokens:29,valueToken:30,HEXCOLOR:31,RGBCOLOR:32,RGBACOLOR:33,$accept:0,$end:1},terminals_:{2:"error",5:"VENN",7:"EOF",8:"NEWLINE",11:"TITLE",12:"SET",14:"BRACKET_LABEL",15:"COLON",16:"NUMERIC",17:"UNION",19:"TEXT",20:"IDENTIFIER",21:"STRING",22:"INDENT_TEXT",24:"STYLE",27:"COMMA",31:"HEXCOLOR",32:"RGBCOLOR",33:"RGBACOLOR"},productions_:[0,[3,4],[4,0],[4,2],[6,0],[6,2],[9,1],[9,1],[10,1],[10,2],[10,3],[10,4],[10,5],[10,2],[10,3],[10,4],[10,5],[10,3],[10,3],[10,3],[10,4],[10,4],[10,2],[10,3],[23,1],[23,1],[23,1],[23,2],[23,2],[25,1],[25,3],[26,3],[28,1],[28,1],[29,1],[29,2],[30,1],[30,1],[30,1],[30,1],[30,1],[18,1],[18,3],[13,1],[13,1]],performAction:x(function(b,w,k,A,C,_,L){var O=_.length-1;switch(C){case 1:return _[O-1];case 2:case 3:case 4:this.$=[];break;case 5:_[O-1].push(_[O]),this.$=_[O-1];break;case 6:this.$=[];break;case 7:case 22:case 32:case 36:case 37:case 38:case 39:case 40:this.$=_[O];break;case 8:A.setDiagramTitle(_[O].substr(6)),this.$=_[O].substr(6);break;case 9:A.addSubsetData([_[O]],void 0,void 0),A.setIndentMode&&A.setIndentMode(!0);break;case 10:A.addSubsetData([_[O-1]],_[O],void 0),A.setIndentMode&&A.setIndentMode(!0);break;case 11:A.addSubsetData([_[O-2]],void 0,parseFloat(_[O])),A.setIndentMode&&A.setIndentMode(!0);break;case 12:A.addSubsetData([_[O-3]],_[O-2],parseFloat(_[O])),A.setIndentMode&&A.setIndentMode(!0);break;case 13:if(_[O].length<2)throw new Error("union requires multiple identifiers");A.validateUnionIdentifiers&&A.validateUnionIdentifiers(_[O]),A.addSubsetData(_[O],void 0,void 0),A.setIndentMode&&A.setIndentMode(!0);break;case 14:if(_[O-1].length<2)throw new Error("union requires multiple identifiers");A.validateUnionIdentifiers&&A.validateUnionIdentifiers(_[O-1]),A.addSubsetData(_[O-1],_[O],void 0),A.setIndentMode&&A.setIndentMode(!0);break;case 15:if(_[O-2].length<2)throw new Error("union requires multiple identifiers");A.validateUnionIdentifiers&&A.validateUnionIdentifiers(_[O-2]),A.addSubsetData(_[O-2],void 0,parseFloat(_[O])),A.setIndentMode&&A.setIndentMode(!0);break;case 16:if(_[O-3].length<2)throw new Error("union requires multiple identifiers");A.validateUnionIdentifiers&&A.validateUnionIdentifiers(_[O-3]),A.addSubsetData(_[O-3],_[O-2],parseFloat(_[O])),A.setIndentMode&&A.setIndentMode(!0);break;case 17:case 18:case 19:A.addTextData(_[O-1],_[O],void 0);break;case 20:case 21:A.addTextData(_[O-2],_[O-1],_[O]);break;case 23:A.addStyleData(_[O-1],_[O]);break;case 24:case 25:case 26:var M=A.getCurrentSets();if(!M)throw new Error("text requires set");A.addTextData(M,_[O],void 0);break;case 27:case 28:var M=A.getCurrentSets();if(!M)throw new Error("text requires set");A.addTextData(M,_[O-1],_[O]);break;case 29:case 41:this.$=[_[O]];break;case 30:case 42:this.$=[..._[O-2],_[O]];break;case 31:this.$=[_[O-2],_[O]];break;case 33:this.$=_[O].join(" ");break;case 34:this.$=[_[O]];break;case 35:_[O-1].push(_[O]),this.$=_[O-1];break;case 43:case 44:this.$=_[O];break}},"anonymous"),table:[t(e,[2,2],{3:1,4:2}),{1:[3]},{5:[1,3],8:[1,4]},t(r,[2,4],{6:5}),t(e,[2,3]),{7:[1,6],8:[1,8],9:7,10:9,11:[1,10],12:[1,11],17:[1,12],19:[1,13],22:[1,14],24:[1,15]},{1:[2,1]},t(r,[2,5]),t(r,[2,6]),t(r,[2,7]),t(r,[2,8]),{13:16,20:n,21:i},{13:20,18:19,20:n,21:i},{13:20,18:21,20:n,21:i},{16:[1,25],20:[1,23],21:[1,24],23:22},{13:20,18:26,20:n,21:i},t(r,[2,9],{14:[1,27],15:[1,28]}),t(a,[2,43]),t(a,[2,44]),t(r,[2,13],{14:[1,29],15:[1,30],27:s}),t(a,[2,41]),{16:[1,34],20:[1,32],21:[1,33],27:s},t(r,[2,22]),t(r,[2,24],{14:[1,35]}),t(r,[2,25],{14:[1,36]}),t(r,[2,26]),{20:o,25:37,26:38,27:s},t(r,[2,10],{15:[1,40]}),{16:[1,41]},t(r,[2,14],{15:[1,42]}),{16:[1,43]},{13:44,20:n,21:i},t(r,[2,17],{14:[1,45]}),t(r,[2,18],{14:[1,46]}),t(r,[2,19]),t(r,[2,27]),t(r,[2,28]),t(r,[2,23],{27:[1,47]}),t(l,[2,29]),{15:[1,48]},{16:[1,49]},t(r,[2,11]),{16:[1,50]},t(r,[2,15]),t(a,[2,42]),t(r,[2,20]),t(r,[2,21]),{20:o,26:51},{16:u,20:h,21:[1,53],28:52,29:54,30:55,31:d,32:f,33:p},t(r,[2,12]),t(r,[2,16]),t(l,[2,30]),t(l,[2,31]),t(l,[2,32]),t(l,[2,33],{30:61,16:u,20:h,31:d,32:f,33:p}),t(g,[2,34]),t(g,[2,36]),t(g,[2,37]),t(g,[2,38]),t(g,[2,39]),t(g,[2,40]),t(g,[2,35])],defaultActions:{6:[2,1]},parseError:x(function(b,w){if(w.recoverable)this.trace(b);else{var k=new Error(b);throw k.hash=w,k}},"parseError"),parse:x(function(b){var w=this,k=[0],A=[],C=[null],_=[],L=this.table,O="",M=0,z=0,F=2,S=1,R=_.slice.call(arguments,1),N=Object.create(this.lexer),D={yy:{}};for(var I in this.yy)Object.prototype.hasOwnProperty.call(this.yy,I)&&(D.yy[I]=this.yy[I]);N.setInput(b,D.yy),D.yy.lexer=N,D.yy.parser=this,typeof N.yylloc>"u"&&(N.yylloc={});var $=N.yylloc;_.push($);var B=N.options&&N.options.ranges;typeof D.yy.parseError=="function"?this.parseError=D.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function P(ue){k.length=k.length-2*ue,C.length=C.length-ue,_.length=_.length-ue}x(P,"popStack");function G(){var ue;return ue=A.pop()||N.lex()||S,typeof ue!="number"&&(ue instanceof Array&&(A=ue,ue=A.pop()),ue=w.symbols_[ue]||ue),ue}x(G,"lex");for(var V,Y,W,ie,K={},se,J,Z,ee;;){if(Y=k[k.length-1],this.defaultActions[Y]?W=this.defaultActions[Y]:((V===null||typeof V>"u")&&(V=G()),W=L[Y]&&L[Y][V]),typeof W>"u"||!W.length||!W[0]){var ne="";ee=[];for(se in L[Y])this.terminals_[se]&&se>F&&ee.push("'"+this.terminals_[se]+"'");N.showPosition?ne="Parse error on line "+(M+1)+`: +A`,s,s,0,a.large?1:0,a.sweep?1:0,n(a.p1.x),n(a.p1.y))}return i.join(" ")}function V4e(t,e){return q4e(G4e(t),e)}function wCt(t,e={}){const{lossFunction:r,layoutFunction:n=D4e,normalize:i=!0,orientation:a=Math.PI/2,orientationOrder:s,width:o=600,height:l=350,padding:u=15,scaleToFit:h=!1,symmetricalTextCentre:d=!1,distinct:f,round:p=2}=e;let g=n(t,{lossFunction:r==="default"||!r?H1:r==="logRatio"?N4e:r,distinct:f});i&&(g=$4e(g,a,s));const m=O4e(g,o,l,u,h),y=z4e(m,t,d),v=new Map(Object.keys(m).map(w=>[w,{set:w,x:m[w].x,y:m[w].y,radius:m[w].radius}])),x=t.map(w=>{const C=w.sets.map(S=>v.get(S)),_=G4e(C),k=q4e(_,p);return{circles:C,arcs:_,path:k,area:w,has:new Set(w.sets)}});function b(w){let C="";for(const _ of x)_.has.size>w.length&&w.every(k=>_.has.has(k))&&(C+=" "+_.path);return C}return x.map(({circles:w,arcs:C,path:_,area:k})=>({data:k,text:y[k.sets],circles:w,arcs:C,path:_,distinctPath:_+b(k.sets)}))}var cq=(function(){var t=T(function(x,b,w,C){for(w=w||{},C=x.length;C--;w[x[C]]=b);return w},"o"),e=[5,8],r=[7,8,11,12,17,19,22,24],n=[1,17],i=[1,18],a=[7,8,11,12,14,15,16,17,19,20,21,22,24,27],s=[1,31],o=[1,39],l=[7,8,11,12,17,19,22,24,27],u=[1,57],h=[1,56],d=[1,58],f=[1,59],p=[1,60],g=[7,8,11,12,16,17,19,20,22,24,27,31,32,33],m={trace:T(function(){},"trace"),yy:{},symbols_:{error:2,start:3,optNewlines:4,VENN:5,document:6,EOF:7,NEWLINE:8,line:9,statement:10,TITLE:11,SET:12,identifier:13,BRACKET_LABEL:14,COLON:15,NUMERIC:16,UNION:17,identifierList:18,TEXT:19,IDENTIFIER:20,STRING:21,INDENT_TEXT:22,indentedTextTail:23,STYLE:24,stylesOpt:25,styleField:26,COMMA:27,styleValue:28,valueTokens:29,valueToken:30,HEXCOLOR:31,RGBCOLOR:32,RGBACOLOR:33,$accept:0,$end:1},terminals_:{2:"error",5:"VENN",7:"EOF",8:"NEWLINE",11:"TITLE",12:"SET",14:"BRACKET_LABEL",15:"COLON",16:"NUMERIC",17:"UNION",19:"TEXT",20:"IDENTIFIER",21:"STRING",22:"INDENT_TEXT",24:"STYLE",27:"COMMA",31:"HEXCOLOR",32:"RGBCOLOR",33:"RGBACOLOR"},productions_:[0,[3,4],[4,0],[4,2],[6,0],[6,2],[9,1],[9,1],[10,1],[10,2],[10,3],[10,4],[10,5],[10,2],[10,3],[10,4],[10,5],[10,3],[10,3],[10,3],[10,4],[10,4],[10,2],[10,3],[23,1],[23,1],[23,1],[23,2],[23,2],[25,1],[25,3],[26,3],[28,1],[28,1],[29,1],[29,2],[30,1],[30,1],[30,1],[30,1],[30,1],[18,1],[18,3],[13,1],[13,1]],performAction:T(function(b,w,C,_,k,S,L){var $=S.length-1;switch(k){case 1:return S[$-1];case 2:case 3:case 4:this.$=[];break;case 5:S[$-1].push(S[$]),this.$=S[$-1];break;case 6:this.$=[];break;case 7:case 22:case 32:case 36:case 37:case 38:case 39:case 40:this.$=S[$];break;case 8:_.setDiagramTitle(S[$].substr(6)),this.$=S[$].substr(6);break;case 9:_.addSubsetData([S[$]],void 0,void 0),_.setIndentMode&&_.setIndentMode(!0);break;case 10:_.addSubsetData([S[$-1]],S[$],void 0),_.setIndentMode&&_.setIndentMode(!0);break;case 11:_.addSubsetData([S[$-2]],void 0,parseFloat(S[$])),_.setIndentMode&&_.setIndentMode(!0);break;case 12:_.addSubsetData([S[$-3]],S[$-2],parseFloat(S[$])),_.setIndentMode&&_.setIndentMode(!0);break;case 13:if(S[$].length<2)throw new Error("union requires multiple identifiers");_.validateUnionIdentifiers&&_.validateUnionIdentifiers(S[$]),_.addSubsetData(S[$],void 0,void 0),_.setIndentMode&&_.setIndentMode(!0);break;case 14:if(S[$-1].length<2)throw new Error("union requires multiple identifiers");_.validateUnionIdentifiers&&_.validateUnionIdentifiers(S[$-1]),_.addSubsetData(S[$-1],S[$],void 0),_.setIndentMode&&_.setIndentMode(!0);break;case 15:if(S[$-2].length<2)throw new Error("union requires multiple identifiers");_.validateUnionIdentifiers&&_.validateUnionIdentifiers(S[$-2]),_.addSubsetData(S[$-2],void 0,parseFloat(S[$])),_.setIndentMode&&_.setIndentMode(!0);break;case 16:if(S[$-3].length<2)throw new Error("union requires multiple identifiers");_.validateUnionIdentifiers&&_.validateUnionIdentifiers(S[$-3]),_.addSubsetData(S[$-3],S[$-2],parseFloat(S[$])),_.setIndentMode&&_.setIndentMode(!0);break;case 17:case 18:case 19:_.addTextData(S[$-1],S[$],void 0);break;case 20:case 21:_.addTextData(S[$-2],S[$-1],S[$]);break;case 23:_.addStyleData(S[$-1],S[$]);break;case 24:case 25:case 26:var I=_.getCurrentSets();if(!I)throw new Error("text requires set");_.addTextData(I,S[$],void 0);break;case 27:case 28:var I=_.getCurrentSets();if(!I)throw new Error("text requires set");_.addTextData(I,S[$-1],S[$]);break;case 29:case 41:this.$=[S[$]];break;case 30:case 42:this.$=[...S[$-2],S[$]];break;case 31:this.$=[S[$-2],S[$]];break;case 33:this.$=S[$].join(" ");break;case 34:this.$=[S[$]];break;case 35:S[$-1].push(S[$]),this.$=S[$-1];break;case 43:case 44:this.$=S[$];break}},"anonymous"),table:[t(e,[2,2],{3:1,4:2}),{1:[3]},{5:[1,3],8:[1,4]},t(r,[2,4],{6:5}),t(e,[2,3]),{7:[1,6],8:[1,8],9:7,10:9,11:[1,10],12:[1,11],17:[1,12],19:[1,13],22:[1,14],24:[1,15]},{1:[2,1]},t(r,[2,5]),t(r,[2,6]),t(r,[2,7]),t(r,[2,8]),{13:16,20:n,21:i},{13:20,18:19,20:n,21:i},{13:20,18:21,20:n,21:i},{16:[1,25],20:[1,23],21:[1,24],23:22},{13:20,18:26,20:n,21:i},t(r,[2,9],{14:[1,27],15:[1,28]}),t(a,[2,43]),t(a,[2,44]),t(r,[2,13],{14:[1,29],15:[1,30],27:s}),t(a,[2,41]),{16:[1,34],20:[1,32],21:[1,33],27:s},t(r,[2,22]),t(r,[2,24],{14:[1,35]}),t(r,[2,25],{14:[1,36]}),t(r,[2,26]),{20:o,25:37,26:38,27:s},t(r,[2,10],{15:[1,40]}),{16:[1,41]},t(r,[2,14],{15:[1,42]}),{16:[1,43]},{13:44,20:n,21:i},t(r,[2,17],{14:[1,45]}),t(r,[2,18],{14:[1,46]}),t(r,[2,19]),t(r,[2,27]),t(r,[2,28]),t(r,[2,23],{27:[1,47]}),t(l,[2,29]),{15:[1,48]},{16:[1,49]},t(r,[2,11]),{16:[1,50]},t(r,[2,15]),t(a,[2,42]),t(r,[2,20]),t(r,[2,21]),{20:o,26:51},{16:u,20:h,21:[1,53],28:52,29:54,30:55,31:d,32:f,33:p},t(r,[2,12]),t(r,[2,16]),t(l,[2,30]),t(l,[2,31]),t(l,[2,32]),t(l,[2,33],{30:61,16:u,20:h,31:d,32:f,33:p}),t(g,[2,34]),t(g,[2,36]),t(g,[2,37]),t(g,[2,38]),t(g,[2,39]),t(g,[2,40]),t(g,[2,35])],defaultActions:{6:[2,1]},parseError:T(function(b,w){if(w.recoverable)this.trace(b);else{var C=new Error(b);throw C.hash=w,C}},"parseError"),parse:T(function(b){var w=this,C=[0],_=[],k=[null],S=[],L=this.table,$="",I=0,z=0,F=2,A=1,R=S.slice.call(arguments,1),N=Object.create(this.lexer),M={yy:{}};for(var D in this.yy)Object.prototype.hasOwnProperty.call(this.yy,D)&&(M.yy[D]=this.yy[D]);N.setInput(b,M.yy),M.yy.lexer=N,M.yy.parser=this,typeof N.yylloc>"u"&&(N.yylloc={});var O=N.yylloc;S.push(O);var B=N.options&&N.options.ranges;typeof M.yy.parseError=="function"?this.parseError=M.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function P(le){C.length=C.length-2*le,k.length=k.length-le,S.length=S.length-le}T(P,"popStack");function G(){var le;return le=_.pop()||N.lex()||A,typeof le!="number"&&(le instanceof Array&&(_=le,le=_.pop()),le=w.symbols_[le]||le),le}T(G,"lex");for(var V,H,W,ie,j={},ae,J,K,Q;;){if(H=C[C.length-1],this.defaultActions[H]?W=this.defaultActions[H]:((V===null||typeof V>"u")&&(V=G()),W=L[H]&&L[H][V]),typeof W>"u"||!W.length||!W[0]){var re="";Q=[];for(ae in L[H])this.terminals_[ae]&&ae>F&&Q.push("'"+this.terminals_[ae]+"'");N.showPosition?re="Parse error on line "+(I+1)+`: `+N.showPosition()+` -Expecting `+ee.join(", ")+", got '"+(this.terminals_[V]||V)+"'":ne="Parse error on line "+(M+1)+": Unexpected "+(V==S?"end of input":"'"+(this.terminals_[V]||V)+"'"),this.parseError(ne,{text:N.match,token:this.terminals_[V]||V,line:N.yylineno,loc:$,expected:ee})}if(W[0]instanceof Array&&W.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Y+", token: "+V);switch(W[0]){case 1:k.push(V),C.push(N.yytext),_.push(N.yylloc),k.push(W[1]),V=null,z=N.yyleng,O=N.yytext,M=N.yylineno,$=N.yylloc;break;case 2:if(J=this.productions_[W[1]][1],K.$=C[C.length-J],K._$={first_line:_[_.length-(J||1)].first_line,last_line:_[_.length-1].last_line,first_column:_[_.length-(J||1)].first_column,last_column:_[_.length-1].last_column},B&&(K._$.range=[_[_.length-(J||1)].range[0],_[_.length-1].range[1]]),ie=this.performAction.apply(K,[O,z,M,D.yy,W[1],C,_].concat(R)),typeof ie<"u")return ie;J&&(k=k.slice(0,-1*J*2),C=C.slice(0,-1*J),_=_.slice(0,-1*J)),k.push(this.productions_[W[1]][0]),C.push(K.$),_.push(K._$),Z=L[k[k.length-2]][k[k.length-1]],k.push(Z);break;case 3:return!0}}return!0},"parse")},y=(function(){var T={EOF:1,parseError:x(function(w,k){if(this.yy.parser)this.yy.parser.parseError(w,k);else throw new Error(w)},"parseError"),setInput:x(function(b,w){return this.yy=w||this.yy||{},this._input=b,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:x(function(){var b=this._input[0];this.yytext+=b,this.yyleng++,this.offset++,this.match+=b,this.matched+=b;var w=b.match(/(?:\r\n?|\n).*/g);return w?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),b},"input"),unput:x(function(b){var w=b.length,k=b.split(/(?:\r\n?|\n)/g);this._input=b+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-w),this.offset-=w;var A=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),k.length-1&&(this.yylineno-=k.length-1);var C=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:k?(k.length===A.length?this.yylloc.first_column:0)+A[A.length-k.length].length-k[0].length:this.yylloc.first_column-w},this.options.ranges&&(this.yylloc.range=[C[0],C[0]+this.yyleng-w]),this.yyleng=this.yytext.length,this},"unput"),more:x(function(){return this._more=!0,this},"more"),reject:x(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). -`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:x(function(b){this.unput(this.match.slice(b))},"less"),pastInput:x(function(){var b=this.matched.substr(0,this.matched.length-this.match.length);return(b.length>20?"...":"")+b.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:x(function(){var b=this.match;return b.length<20&&(b+=this._input.substr(0,20-b.length)),(b.substr(0,20)+(b.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:x(function(){var b=this.pastInput(),w=new Array(b.length+1).join("-");return b+this.upcomingInput()+` -`+w+"^"},"showPosition"),test_match:x(function(b,w){var k,A,C;if(this.options.backtrack_lexer&&(C={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(C.yylloc.range=this.yylloc.range.slice(0))),A=b[0].match(/(?:\r\n?|\n).*/g),A&&(this.yylineno+=A.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:A?A[A.length-1].length-A[A.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+b[0].length},this.yytext+=b[0],this.match+=b[0],this.matches=b,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(b[0].length),this.matched+=b[0],k=this.performAction.call(this,this.yy,this,w,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),k)return k;if(this._backtrack){for(var _ in C)this[_]=C[_];return!1}return!1},"test_match"),next:x(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var b,w,k,A;this._more||(this.yytext="",this.match="");for(var C=this._currentRules(),_=0;_w[0].length)){if(w=k,A=_,this.options.backtrack_lexer){if(b=this.test_match(k,C[_]),b!==!1)return b;if(this._backtrack){w=!1;continue}else return!1}else if(!this.options.flex)break}return w?(b=this.test_match(w,C[A]),b!==!1?b:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var w=this.next();return w||this.lex()},"lex"),begin:x(function(w){this.conditionStack.push(w)},"begin"),popState:x(function(){var w=this.conditionStack.length-1;return w>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(w){return w=this.conditionStack.length-1-Math.abs(w||0),w>=0?this.conditionStack[w]:"INITIAL"},"topState"),pushState:x(function(w){this.begin(w)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:x(function(w,k,A,C){switch(A){case 0:break;case 1:break;case 2:break;case 3:if(w.getIndentMode&&w.getIndentMode())return w.consumeIndentText=!0,this.begin("INITIAL"),22;break;case 4:break;case 5:w.setIndentMode&&w.setIndentMode(!1),this.begin("INITIAL"),this.unput(k.yytext);break;case 6:return this.begin("bol"),8;case 7:break;case 8:break;case 9:return 7;case 10:return 11;case 11:return 5;case 12:return 12;case 13:return 17;case 14:if(w.consumeIndentText)w.consumeIndentText=!1;else return 19;break;case 15:return 24;case 16:return k.yytext=k.yytext.slice(2,-2),14;case 17:return k.yytext=k.yytext.slice(1,-1).trim(),14;case 18:return 16;case 19:return 31;case 20:return 33;case 21:return 32;case 22:return 20;case 23:return 21;case 24:return 27;case 25:return 15}},"anonymous"),rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[ \t]+(?=[\n\r]))/i,/^(?:[ \t]+(?=text\b))/i,/^(?:[ \t]+)/i,/^(?:[^ \t\n\r])/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:[ \t]+)/i,/^(?:$)/i,/^(?:title\s[^#\n;]+)/i,/^(?:venn-beta\b)/i,/^(?:set\b)/i,/^(?:union\b)/i,/^(?:text\b)/i,/^(?:style\b)/i,/^(?:\["[^\"]*"\])/i,/^(?:\[[^\]\"]+\])/i,/^(?:[+-]?(\d+(\.\d+)?|\.\d+))/i,/^(?:#[0-9a-fA-F]{3,8})/i,/^(?:rgba\(\s*[0-9.]+\s*[,]\s*[0-9.]+\s*[,]\s*[0-9.]+\s*[,]\s*[0-9.]+\s*\))/i,/^(?:rgb\(\s*[0-9.]+\s*[,]\s*[0-9.]+\s*[,]\s*[0-9.]+\s*\))/i,/^(?:[A-Za-z_][A-Za-z0-9\-_]*)/i,/^(?:"[^\"]*")/i,/^(?:,)/i,/^(?::)/i],conditions:{bol:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25],inclusive:!0},INITIAL:{rules:[0,1,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25],inclusive:!0}}};return T})();m.lexer=y;function v(){this.yy={}}return x(v,"Parser"),v.prototype=m,m.Parser=v,new v})();NP.parser=NP;var Pgt=NP,OP=[],$P=[],PP=[],BP=new Set,FP,zP=!1,Bgt=x((t,e,r)=>{const n=e6(t).sort(),i=r??10/Math.pow(t.length,2);FP=n,n.length===1&&BP.add(n[0]),OP.push({sets:n,size:i,label:e?sw(e):void 0})},"addSubsetData"),Fgt=x(()=>OP,"getSubsetData"),sw=x(t=>{const e=t.trim();return e.length>=2&&e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):e},"normalizeText"),zgt=x(t=>t&&sw(t),"normalizeStyleValue"),Ggt=x((t,e,r)=>{const n=sw(e);$P.push({sets:e6(t).sort(),id:n,label:r?sw(r):void 0})},"addTextData"),qgt=x((t,e)=>{const r=e6(t).sort(),n={};for(const[i,a]of e)n[i]=zgt(a)??a;PP.push({targets:r,styles:n})},"addStyleData"),Vgt=x(()=>PP,"getStyleData"),e6=x(t=>t.map(e=>sw(e)),"normalizeIdentifierList"),Wgt=x(t=>{const r=e6(t).filter(n=>!BP.has(n));if(r.length>0)throw new Error(`unknown set identifier: ${r.join(", ")}`)},"validateUnionIdentifiers"),Ugt=x(()=>$P,"getTextData"),Hgt=x(()=>FP,"getCurrentSets"),Ygt=x(()=>zP,"getIndentMode"),Xgt=x(t=>{zP=t},"setIndentMode"),Kgt=Fr.venn;function Ave(){return ti(Kgt,lr().venn)}x(Ave,"getConfig");var jgt=x(()=>{In(),OP.length=0,$P.length=0,PP.length=0,BP.clear(),FP=void 0,zP=!1},"customClear"),Zgt={getConfig:Ave,clear:jgt,setAccTitle:Dn,getAccTitle:Fn,setDiagramTitle:qn,getDiagramTitle:Mn,getAccDescription:Gn,setAccDescription:zn,addSubsetData:Bgt,getSubsetData:Fgt,addTextData:Ggt,addStyleData:qgt,validateUnionIdentifiers:Wgt,getTextData:Ugt,getStyleData:Vgt,getCurrentSets:Hgt,getIndentMode:Ygt,setIndentMode:Xgt},Qgt=x(t=>` +Expecting `+Q.join(", ")+", got '"+(this.terminals_[V]||V)+"'":re="Parse error on line "+(I+1)+": Unexpected "+(V==A?"end of input":"'"+(this.terminals_[V]||V)+"'"),this.parseError(re,{text:N.match,token:this.terminals_[V]||V,line:N.yylineno,loc:O,expected:Q})}if(W[0]instanceof Array&&W.length>1)throw new Error("Parse Error: multiple actions possible at state: "+H+", token: "+V);switch(W[0]){case 1:C.push(V),k.push(N.yytext),S.push(N.yylloc),C.push(W[1]),V=null,z=N.yyleng,$=N.yytext,I=N.yylineno,O=N.yylloc;break;case 2:if(J=this.productions_[W[1]][1],j.$=k[k.length-J],j._$={first_line:S[S.length-(J||1)].first_line,last_line:S[S.length-1].last_line,first_column:S[S.length-(J||1)].first_column,last_column:S[S.length-1].last_column},B&&(j._$.range=[S[S.length-(J||1)].range[0],S[S.length-1].range[1]]),ie=this.performAction.apply(j,[$,z,I,M.yy,W[1],k,S].concat(R)),typeof ie<"u")return ie;J&&(C=C.slice(0,-1*J*2),k=k.slice(0,-1*J),S=S.slice(0,-1*J)),C.push(this.productions_[W[1]][0]),k.push(j.$),S.push(j._$),K=L[C[C.length-2]][C[C.length-1]],C.push(K);break;case 3:return!0}}return!0},"parse")},y=(function(){var x={EOF:1,parseError:T(function(w,C){if(this.yy.parser)this.yy.parser.parseError(w,C);else throw new Error(w)},"parseError"),setInput:T(function(b,w){return this.yy=w||this.yy||{},this._input=b,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:T(function(){var b=this._input[0];this.yytext+=b,this.yyleng++,this.offset++,this.match+=b,this.matched+=b;var w=b.match(/(?:\r\n?|\n).*/g);return w?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),b},"input"),unput:T(function(b){var w=b.length,C=b.split(/(?:\r\n?|\n)/g);this._input=b+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-w),this.offset-=w;var _=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),C.length-1&&(this.yylineno-=C.length-1);var k=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:C?(C.length===_.length?this.yylloc.first_column:0)+_[_.length-C.length].length-C[0].length:this.yylloc.first_column-w},this.options.ranges&&(this.yylloc.range=[k[0],k[0]+this.yyleng-w]),this.yyleng=this.yytext.length,this},"unput"),more:T(function(){return this._more=!0,this},"more"),reject:T(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). +`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:T(function(b){this.unput(this.match.slice(b))},"less"),pastInput:T(function(){var b=this.matched.substr(0,this.matched.length-this.match.length);return(b.length>20?"...":"")+b.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:T(function(){var b=this.match;return b.length<20&&(b+=this._input.substr(0,20-b.length)),(b.substr(0,20)+(b.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:T(function(){var b=this.pastInput(),w=new Array(b.length+1).join("-");return b+this.upcomingInput()+` +`+w+"^"},"showPosition"),test_match:T(function(b,w){var C,_,k;if(this.options.backtrack_lexer&&(k={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&&(k.yylloc.range=this.yylloc.range.slice(0))),_=b[0].match(/(?:\r\n?|\n).*/g),_&&(this.yylineno+=_.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:_?_[_.length-1].length-_[_.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+b[0].length},this.yytext+=b[0],this.match+=b[0],this.matches=b,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(b[0].length),this.matched+=b[0],C=this.performAction.call(this,this.yy,this,w,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),C)return C;if(this._backtrack){for(var S in k)this[S]=k[S];return!1}return!1},"test_match"),next:T(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var b,w,C,_;this._more||(this.yytext="",this.match="");for(var k=this._currentRules(),S=0;Sw[0].length)){if(w=C,_=S,this.options.backtrack_lexer){if(b=this.test_match(C,k[S]),b!==!1)return b;if(this._backtrack){w=!1;continue}else return!1}else if(!this.options.flex)break}return w?(b=this.test_match(w,k[_]),b!==!1?b:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:T(function(){var w=this.next();return w||this.lex()},"lex"),begin:T(function(w){this.conditionStack.push(w)},"begin"),popState:T(function(){var w=this.conditionStack.length-1;return w>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:T(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:T(function(w){return w=this.conditionStack.length-1-Math.abs(w||0),w>=0?this.conditionStack[w]:"INITIAL"},"topState"),pushState:T(function(w){this.begin(w)},"pushState"),stateStackSize:T(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:T(function(w,C,_,k){switch(_){case 0:break;case 1:break;case 2:break;case 3:if(w.getIndentMode&&w.getIndentMode())return w.consumeIndentText=!0,this.begin("INITIAL"),22;break;case 4:break;case 5:w.setIndentMode&&w.setIndentMode(!1),this.begin("INITIAL"),this.unput(C.yytext);break;case 6:return this.begin("bol"),8;case 7:break;case 8:break;case 9:return 7;case 10:return 11;case 11:return 5;case 12:return 12;case 13:return 17;case 14:if(w.consumeIndentText)w.consumeIndentText=!1;else return 19;break;case 15:return 24;case 16:return C.yytext=C.yytext.slice(2,-2),14;case 17:return C.yytext=C.yytext.slice(1,-1).trim(),14;case 18:return 16;case 19:return 31;case 20:return 33;case 21:return 32;case 22:return 20;case 23:return 21;case 24:return 27;case 25:return 15}},"anonymous"),rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[ \t]+(?=[\n\r]))/i,/^(?:[ \t]+(?=text\b))/i,/^(?:[ \t]+)/i,/^(?:[^ \t\n\r])/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:[ \t]+)/i,/^(?:$)/i,/^(?:title\s[^#\n;]+)/i,/^(?:venn-beta\b)/i,/^(?:set\b)/i,/^(?:union\b)/i,/^(?:text\b)/i,/^(?:style\b)/i,/^(?:\["[^\"]*"\])/i,/^(?:\[[^\]\"]+\])/i,/^(?:[+-]?(\d+(\.\d+)?|\.\d+))/i,/^(?:#[0-9a-fA-F]{3,8})/i,/^(?:rgba\(\s*[0-9.]+\s*[,]\s*[0-9.]+\s*[,]\s*[0-9.]+\s*[,]\s*[0-9.]+\s*\))/i,/^(?:rgb\(\s*[0-9.]+\s*[,]\s*[0-9.]+\s*[,]\s*[0-9.]+\s*\))/i,/^(?:[A-Za-z_][A-Za-z0-9\-_]*)/i,/^(?:"[^\"]*")/i,/^(?:,)/i,/^(?::)/i],conditions:{bol:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25],inclusive:!0},INITIAL:{rules:[0,1,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25],inclusive:!0}}};return x})();m.lexer=y;function v(){this.yy={}}return T(v,"Parser"),v.prototype=m,m.Parser=v,new v})();cq.parser=cq;var CCt=cq,uq=[],hq=[],dq=[],fq=new Set,pq,gq=!1,kCt=T((t,e,r)=>{const n=JA(t).sort(),i=r??10/Math.pow(t.length,2);pq=n,n.length===1&&fq.add(n[0]),uq.push({sets:n,size:i,label:e?f4(e):void 0})},"addSubsetData"),ECt=T(()=>uq,"getSubsetData"),f4=T(t=>{const e=t.trim();return e.length>=2&&e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):e},"normalizeText"),SCt=T(t=>t&&f4(t),"normalizeStyleValue"),_Ct=T((t,e,r)=>{const n=f4(e);hq.push({sets:JA(t).sort(),id:n,label:r?f4(r):void 0})},"addTextData"),ACt=T((t,e)=>{const r=JA(t).sort(),n={};for(const[i,a]of e)n[i]=SCt(a)??a;dq.push({targets:r,styles:n})},"addStyleData"),RCt=T(()=>dq,"getStyleData"),JA=T(t=>t.map(e=>f4(e)),"normalizeIdentifierList"),LCt=T(t=>{const r=JA(t).filter(n=>!fq.has(n));if(r.length>0)throw new Error(`unknown set identifier: ${r.join(", ")}`)},"validateUnionIdentifiers"),ICt=T(()=>hq,"getTextData"),DCt=T(()=>pq,"getCurrentSets"),MCt=T(()=>gq,"getIndentMode"),NCt=T(t=>{gq=t},"setIndentMode"),$Ct=Xr.venn;function W4e(){return wi($Ct,pr().venn)}T(W4e,"getConfig");var OCt=T(()=>{Hn(),uq.length=0,hq.length=0,dq.length=0,fq.clear(),pq=void 0,gq=!1},"customClear"),PCt={getConfig:W4e,clear:OCt,setAccTitle:Yn,getAccTitle:ii,setDiagramTitle:oi,getDiagramTitle:Xn,getAccDescription:si,setAccDescription:ai,addSubsetData:kCt,getSubsetData:ECt,addTextData:_Ct,addStyleData:ACt,validateUnionIdentifiers:LCt,getTextData:ICt,getStyleData:RCt,getCurrentSets:DCt,getIndentMode:MCt,setIndentMode:NCt},BCt=T(t=>` .venn-title { font-size: 32px; fill: ${t.vennTitleTextColor}; @@ -3279,7 +3280,7 @@ Expecting `+ee.join(", ")+", got '"+(this.terminals_[V]||V)+"'":ne="Parse error font-family: ${t.fontFamily}; color: ${t.vennSetTextColor}; } -`,"getStyles"),Jgt=Qgt;function _ve(t){const e=new Map;for(const r of t){const n=r.targets.join("|"),i=e.get(n);i?Object.assign(i,r.styles):e.set(n,{...r.styles})}return e}x(_ve,"buildStyleByKey");var emt=x((t,e,r,n)=>{var S,R,N;const i=n.db,a=(S=i.getConfig)==null?void 0:S.call(i),{themeVariables:s,look:o,handDrawnSeed:l}=lr(),u=o==="handDrawn",h=[s.venn1,s.venn2,s.venn3,s.venn4,s.venn5,s.venn6,s.venn7,s.venn8].filter(Boolean),d=(R=i.getDiagramTitle)==null?void 0:R.call(i),f=i.getSubsetData(),p=i.getTextData(),g=_ve(i.getStyleData()),m=(a==null?void 0:a.width)??800,y=(a==null?void 0:a.height)??450,T=m/1600,b=d?48*T:0,w=s.primaryTextColor??s.textColor,k=ys(e);k.attr("viewBox",`0 0 ${m} ${y}`),d&&k.append("text").text(d).attr("class","venn-title").attr("font-size",`${32*T}px`).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("x","50%").attr("y",32*T).style("fill",s.vennTitleTextColor||s.titleColor);const A=pt(document.createElement("div")),C=Dgt().width(m).height(y-b);A.datum(f).call(C);const _=u?Kt.svg(A.select("svg").node()):void 0,L=$gt(f,{width:m,height:y-b,padding:(a==null?void 0:a.padding)??15}),O=new Map;for(const D of L){const I=$h([...D.data.sets].sort());O.set(I,D)}p.length>0&&Rve(a,O,A,p,T,g);const M=Ba(s.background||"#f4f4f4");A.selectAll(".venn-circle").each(function(D,I){var se;const $=pt(this),P=$h([...D.sets].sort()),G=g.get(P),V=(G==null?void 0:G.fill)||h[I%h.length]||s.primaryColor;$.classed(`venn-set-${I%8}`,!0);const Y=(G==null?void 0:G["fill-opacity"])??.1,W=(G==null?void 0:G.stroke)||V,ie=(G==null?void 0:G["stroke-width"])||`${5*T}`;if(u&&_){const J=O.get(P);if(J&&J.circles.length>0){const Z=J.circles[0],ee=_.circle(Z.x,Z.y,Z.radius*2,{roughness:.7,seed:l,fill:JP(V,.7),fillStyle:"hachure",fillWeight:2,hachureGap:8,hachureAngle:-41+I*60,stroke:W,strokeWidth:parseFloat(String(ie))});$.select("path").remove(),(se=$.node())==null||se.insertBefore(ee,$.select("text").node())}}else $.select("path").style("fill",V).style("fill-opacity",Y).style("stroke",W).style("stroke-width",ie).style("stroke-opacity",.95);const K=(G==null?void 0:G.color)||(M?at(V,30):st(V,30));$.select("text").style("font-size",`${48*T}px`).style("fill",K)}),u&&_?A.selectAll(".venn-intersection").each(function(D){var V;const I=pt(this),B=$h([...D.sets].sort()),P=g.get(B),G=P==null?void 0:P.fill;if(G){const Y=I.select("path"),W=Y.attr("d");if(W){const ie=_.path(W,{roughness:.7,seed:l,fill:JP(G,.3),fillStyle:"cross-hatch",fillWeight:2,hachureGap:6,hachureAngle:60,stroke:"none"}),K=Y.node();(V=K==null?void 0:K.parentNode)==null||V.insertBefore(ie,K),Y.remove()}}else I.select("path").style("fill-opacity",0);I.select("text").style("font-size",`${48*T}px`).style("fill",(P==null?void 0:P.color)??s.vennSetTextColor??w)}):(A.selectAll(".venn-intersection text").style("font-size",`${48*T}px`).style("fill",D=>{var B;const $=$h([...D.sets].sort());return((B=g.get($))==null?void 0:B.color)??s.vennSetTextColor??w}),A.selectAll(".venn-intersection path").style("fill-opacity",D=>{var B;const $=$h([...D.sets].sort());return(B=g.get($))!=null&&B.fill?1:0}).style("fill",D=>{var B;const $=$h([...D.sets].sort());return((B=g.get($))==null?void 0:B.fill)??"transparent"}));const z=k.append("g").attr("transform",`translate(0, ${b})`),F=A.select("svg").node();if(F&&"childNodes"in F)for(const D of[...F.childNodes])(N=z.node())==null||N.appendChild(D);wi(k,y,m,(a==null?void 0:a.useMaxWidth)??!0)},"draw");function $h(t){return t.join("|")}x($h,"stableSetsKey");function Rve(t,e,r,n,i,a){var h;const s=(t==null?void 0:t.useDebugLayout)??!1,l=r.select("svg").append("g").attr("class","venn-text-nodes"),u=new Map;for(const d of n){const f=$h(d.sets),p=u.get(f);p?p.push(d):u.set(f,[d])}for(const[d,f]of u.entries()){const p=e.get(d);if(!(p!=null&&p.text))continue;const g=p.text.x,m=p.text.y,y=Math.min(...p.circles.map(R=>R.radius)),v=Math.min(...p.circles.map(R=>R.radius-Math.hypot(g-R.x,m-R.y)));let T=Number.isFinite(v)?Math.max(0,v):0;T===0&&Number.isFinite(y)&&(T=y*.6);const b=l.append("g").attr("class","venn-text-area").attr("font-size",`${40*i}px`);s&&b.append("circle").attr("class","venn-text-debug-circle").attr("cx",g).attr("cy",m).attr("r",T).attr("fill","none").attr("stroke","purple").attr("stroke-width",1.5*i).attr("stroke-dasharray",`${6*i} ${4*i}`);const w=Math.max(80*i,T*2*.95),k=Math.max(60*i,T*2*.95),_=(p.data.label&&p.data.label.length>0?Math.min(32*i,T*.25):0)+(f.length<=2?30*i:0),L=g-w/2,O=m-k/2+_,M=Math.max(1,Math.ceil(Math.sqrt(f.length))),z=Math.max(1,Math.ceil(f.length/M)),F=w/M,S=k/z;for(const[R,N]of f.entries()){const D=R%M,I=Math.floor(R/M),$=L+F*(D+.5),B=O+S*(I+.5);s&&b.append("rect").attr("class","venn-text-debug-cell").attr("x",L+F*D).attr("y",O+S*I).attr("width",F).attr("height",S).attr("fill","none").attr("stroke","teal").attr("stroke-width",1*i).attr("stroke-dasharray",`${4*i} ${3*i}`);const P=F*.9,G=S*.9,V=b.append("foreignObject").attr("class","venn-text-node-fo").attr("width",P).attr("height",G).attr("x",$-P/2).attr("y",B-G/2).attr("overflow","visible"),Y=(h=a.get(N.id))==null?void 0:h.color,W=V.append("xhtml:span").attr("class","venn-text-node").style("display","flex").style("width","100%").style("height","100%").style("white-space","normal").style("align-items","center").style("justify-content","center").style("text-align","center").style("overflow-wrap","normal").style("word-break","normal").text(N.label??N.id);Y&&W.style("color",Y)}}}x(Rve,"renderTextNodes");var tmt={draw:emt},rmt={parser:Pgt,db:Zgt,renderer:tmt,styles:Jgt};const nmt=Object.freeze(Object.defineProperty({__proto__:null,diagram:rmt},Symbol.toStringTag,{value:"Module"}));var Lve=(Xv=class{constructor(){this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.setAccTitle=Dn,this.getAccTitle=Fn,this.setDiagramTitle=qn,this.getDiagramTitle=Mn,this.getAccDescription=Gn,this.setAccDescription=zn}getNodes(){return this.nodes}getConfig(){const e=Fr,r=lr();return ti({...e.treemap,...r.treemap??{}})}addNode(e,r){this.nodes.push(e),this.levels.set(e,r),r===0&&(this.outerNodes.push(e),this.root??(this.root=e))}getRoot(){return{name:"",children:this.outerNodes}}addClass(e,r){const n=this.classes.get(e)??{id:e,styles:[],textStyles:[]},i=r.replace(/\\,/g,"§§§").replace(/,/g,";").replace(/§§§/g,",").split(";");i&&i.forEach(a=>{g_(a)&&(n!=null&&n.textStyles?n.textStyles.push(a):n.textStyles=[a]),n!=null&&n.styles?n.styles.push(a):n.styles=[a]}),this.classes.set(e,n)}getClasses(){return this.classes}getStylesForClass(e){var r;return((r=this.classes.get(e))==null?void 0:r.styles)??[]}clear(){In(),this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.root=void 0}},x(Xv,"TreeMapDB"),Xv);function Ive(t){if(!t.length)return[];const e=[],r=[];return t.forEach(n=>{const i={name:n.name,children:n.type==="Leaf"?void 0:[]};for(i.classSelector=n==null?void 0:n.classSelector,n!=null&&n.cssCompiledStyles&&(i.cssCompiledStyles=n.cssCompiledStyles),n.type==="Leaf"&&n.value!==void 0&&(i.value=n.value);r.length>0&&r[r.length-1].level>=n.level;)r.pop();if(r.length===0)e.push(i);else{const a=r[r.length-1].node;a.children?a.children.push(i):a.children=[i]}n.type!=="Leaf"&&r.push({node:i,level:n.level})}),e}x(Ive,"buildHierarchy");var imt=x((t,e)=>{zl(t,e);const r=[];for(const a of t.TreemapRows??[])a.$type==="ClassDefStatement"&&e.addClass(a.className??"",a.styleText??"");for(const a of t.TreemapRows??[]){const s=a.item;if(!s)continue;const o=a.indent?parseInt(a.indent):0,l=amt(s),u=s.classSelector?e.getStylesForClass(s.classSelector):[],h=u.length>0?u:void 0,d={level:o,name:l,type:s.$type,value:s.value,classSelector:s.classSelector,cssCompiledStyles:h};r.push(d)}const n=Ive(r),i=x((a,s)=>{for(const o of a)e.addNode(o,s),o.children&&o.children.length>0&&i(o.children,s+1)},"addNodesRecursively");i(n,0)},"populate"),amt=x(t=>t.name?String(t.name):"","getItemName"),Dve={parser:{yy:void 0},parse:x(async t=>{var e;try{const n=await Qo("treemap",t);ae.debug("Treemap AST:",n);const i=(e=Dve.parser)==null?void 0:e.yy;if(!(i instanceof Lve))throw new Error("parser.parser?.yy was not a TreemapDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");imt(n,i)}catch(r){throw ae.error("Error parsing treemap:",r),r}},"parse")},smt=10,pm=10,ow=25,omt=x((t,e,r,n)=>{const i=n.db,a=i.getConfig(),s=a.padding??smt,o=i.getDiagramTitle(),l=i.getRoot(),{themeVariables:u}=lr();if(!l)return;const h=o?30:0,d=ys(e),f=a.nodeWidth?a.nodeWidth*pm:960,p=a.nodeHeight?a.nodeHeight*pm:500,g=f,m=p+h;d.attr("viewBox",`0 0 ${g} ${m}`),wi(d,m,g,a.useMaxWidth);let y;try{const S=a.valueFormat||",";if(S==="$0,0")y=x(R=>"$"+Zh(",")(R),"valueFormat");else if(S.startsWith("$")&&S.includes(",")){const R=/\.\d+/.exec(S),N=R?R[0]:"";y=x(D=>"$"+Zh(","+N)(D),"valueFormat")}else if(S.startsWith("$")){const R=S.substring(1);y=x(N=>"$"+Zh(R||"")(N),"valueFormat")}else y=Zh(S)}catch(S){ae.error("Error creating format function:",S),y=Zh(",")}const v=Qh().range(["transparent",u.cScale0,u.cScale1,u.cScale2,u.cScale3,u.cScale4,u.cScale5,u.cScale6,u.cScale7,u.cScale8,u.cScale9,u.cScale10,u.cScale11]),T=Qh().range(["transparent",u.cScalePeer0,u.cScalePeer1,u.cScalePeer2,u.cScalePeer3,u.cScalePeer4,u.cScalePeer5,u.cScalePeer6,u.cScalePeer7,u.cScalePeer8,u.cScalePeer9,u.cScalePeer10,u.cScalePeer11]),b=Qh().range([u.cScaleLabel0,u.cScaleLabel1,u.cScaleLabel2,u.cScaleLabel3,u.cScaleLabel4,u.cScaleLabel5,u.cScaleLabel6,u.cScaleLabel7,u.cScaleLabel8,u.cScaleLabel9,u.cScaleLabel10,u.cScaleLabel11]);o&&d.append("text").attr("x",g/2).attr("y",h/2).attr("class","treemapTitle").attr("text-anchor","middle").attr("dominant-baseline","middle").text(o);const w=d.append("g").attr("transform",`translate(0, ${h})`).attr("class","treemapContainer"),k=fA(l).sum(S=>S.value??0).sort((S,R)=>(R.value??0)-(S.value??0)),C=l5e().size([f,p]).paddingTop(S=>S.children&&S.children.length>0?ow+pm:0).paddingInner(s).paddingLeft(S=>S.children&&S.children.length>0?pm:0).paddingRight(S=>S.children&&S.children.length>0?pm:0).paddingBottom(S=>S.children&&S.children.length>0?pm:0).round(!0)(k),_=C.descendants().filter(S=>S.children&&S.children.length>0),L=w.selectAll(".treemapSection").data(_).enter().append("g").attr("class","treemapSection").attr("transform",S=>`translate(${S.x0},${S.y0})`);L.append("rect").attr("width",S=>S.x1-S.x0).attr("height",ow).attr("class","treemapSectionHeader").attr("fill","none").attr("fill-opacity",.6).attr("stroke-width",.6).attr("style",S=>S.depth===0?"display: none;":""),L.append("clipPath").attr("id",(S,R)=>`clip-section-${e}-${R}`).append("rect").attr("width",S=>Math.max(0,S.x1-S.x0-12)).attr("height",ow),L.append("rect").attr("width",S=>S.x1-S.x0).attr("height",S=>S.y1-S.y0).attr("class",(S,R)=>`treemapSection section${R}`).attr("fill",S=>v(S.data.name)).attr("fill-opacity",.6).attr("stroke",S=>T(S.data.name)).attr("stroke-width",2).attr("stroke-opacity",.4).attr("style",S=>{if(S.depth===0)return"display: none;";const R=Xt({cssCompiledStyles:S.data.cssCompiledStyles});return R.nodeStyles+";"+R.borderStyles.join(";")}),L.append("text").attr("class","treemapSectionLabel").attr("x",6).attr("y",ow/2).attr("dominant-baseline","middle").text(S=>S.depth===0?"":S.data.name).attr("font-weight","bold").attr("style",S=>{if(S.depth===0)return"display: none;";const R="dominant-baseline: middle; font-size: 12px; fill:"+b(S.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",N=Xt({cssCompiledStyles:S.data.cssCompiledStyles});return R+N.labelStyles.replace("color:","fill:")}).each(function(S){if(S.depth===0)return;const R=pt(this),N=S.data.name;R.text(N);const D=S.x1-S.x0,I=6;let $;a.showValues!==!1&&S.value?$=D-10-30-10-I:$=D-I-6;const P=Math.max(15,$),G=R.node();if(G.getComputedTextLength()>P){let W=N;for(;W.length>0;){if(W=N.substring(0,W.length-1),W.length===0){R.text("..."),G.getComputedTextLength()>P&&R.text("");break}if(R.text(W+"..."),G.getComputedTextLength()<=P)break}}}),a.showValues!==!1&&L.append("text").attr("class","treemapSectionValue").attr("x",S=>S.x1-S.x0-10).attr("y",ow/2).attr("text-anchor","end").attr("dominant-baseline","middle").text(S=>S.value?y(S.value):"").attr("font-style","italic").attr("style",S=>{if(S.depth===0)return"display: none;";const R="text-anchor: end; dominant-baseline: middle; font-size: 10px; fill:"+b(S.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",N=Xt({cssCompiledStyles:S.data.cssCompiledStyles});return R+N.labelStyles.replace("color:","fill:")});const O=C.leaves(),M=w.selectAll(".treemapLeafGroup").data(O).enter().append("g").attr("class",(S,R)=>`treemapNode treemapLeafGroup leaf${R}${S.data.classSelector?` ${S.data.classSelector}`:""}x`).attr("transform",S=>`translate(${S.x0},${S.y0})`);M.append("rect").attr("width",S=>S.x1-S.x0).attr("height",S=>S.y1-S.y0).attr("class","treemapLeaf").attr("fill",S=>S.parent?v(S.parent.data.name):v(S.data.name)).attr("style",S=>Xt({cssCompiledStyles:S.data.cssCompiledStyles}).nodeStyles).attr("fill-opacity",.3).attr("stroke",S=>S.parent?v(S.parent.data.name):v(S.data.name)).attr("stroke-width",3),M.append("clipPath").attr("id",(S,R)=>`clip-${e}-${R}`).append("rect").attr("width",S=>Math.max(0,S.x1-S.x0-4)).attr("height",S=>Math.max(0,S.y1-S.y0-4)),M.append("text").attr("class","treemapLabel").attr("x",S=>(S.x1-S.x0)/2).attr("y",S=>(S.y1-S.y0)/2).attr("style",S=>{const R="text-anchor: middle; dominant-baseline: middle; font-size: 38px;fill:"+b(S.data.name)+";",N=Xt({cssCompiledStyles:S.data.cssCompiledStyles});return R+N.labelStyles.replace("color:","fill:")}).attr("clip-path",(S,R)=>`url(#clip-${e}-${R})`).text(S=>S.data.name).each(function(S){const R=pt(this),N=S.x1-S.x0,D=S.y1-S.y0,I=R.node(),$=4,B=N-2*$,P=D-2*$;if(B<10||P<10){R.style("display","none");return}let G=parseInt(R.style("font-size"),10);const V=8,Y=28,W=.6,ie=6,K=2;for(;I.getComputedTextLength()>B&&G>V;)G--,R.style("font-size",`${G}px`);let se=Math.max(ie,Math.min(Y,Math.round(G*W))),J=G+K+se;for(;J>P&&G>V&&(G--,se=Math.max(ie,Math.min(Y,Math.round(G*W))),!(seB||G(R.x1-R.x0)/2).attr("y",function(R){return(R.y1-R.y0)/2}).attr("style",R=>{const N="text-anchor: middle; dominant-baseline: hanging; font-size: 28px;fill:"+b(R.data.name)+";",D=Xt({cssCompiledStyles:R.data.cssCompiledStyles});return N+D.labelStyles.replace("color:","fill:")}).attr("clip-path",(R,N)=>`url(#clip-${e}-${N})`).text(R=>R.value?y(R.value):"").each(function(R){const N=pt(this),D=this.parentNode;if(!D){N.style("display","none");return}const I=pt(D).select(".treemapLabel");if(I.empty()||I.style("display")==="none"){N.style("display","none");return}const $=parseFloat(I.style("font-size")),B=28,P=.6,G=6,V=2,Y=Math.max(G,Math.min(B,Math.round($*P)));N.style("font-size",`${Y}px`);const ie=(R.y1-R.y0)/2+$/2+V;N.attr("y",ie);const K=R.x1-R.x0,Z=R.y1-R.y0-4,ee=K-8;N.node().getComputedTextLength()>ee||ie+Y>Z||Y{const e=w0(),r=lr(),n=ti(e,r.themeVariables),i=ti(umt,t),a=i.titleColor??n.titleColor,s=i.labelColor??n.textColor,o=i.valueColor??n.textColor;return` +`,"getStyles"),FCt=BCt;function U4e(t){const e=new Map;for(const r of t){const n=r.targets.join("|"),i=e.get(n);i?Object.assign(i,r.styles):e.set(n,{...r.styles})}return e}T(U4e,"buildStyleByKey");var zCt=T((t,e,r,n)=>{var A,R,N;const i=n.db,a=(A=i.getConfig)==null?void 0:A.call(i),{themeVariables:s,look:o,handDrawnSeed:l}=pr(),u=o==="handDrawn",h=[s.venn1,s.venn2,s.venn3,s.venn4,s.venn5,s.venn6,s.venn7,s.venn8].filter(Boolean),d=(R=i.getDiagramTitle)==null?void 0:R.call(i),f=i.getSubsetData(),p=i.getTextData(),g=U4e(i.getStyleData()),m=(a==null?void 0:a.width)??800,y=(a==null?void 0:a.height)??450,x=m/1600,b=d?48*x:0,w=s.primaryTextColor??s.textColor,C=Ys(e);C.attr("viewBox",`0 0 ${m} ${y}`),d&&C.append("text").text(d).attr("class","venn-title").attr("font-size",`${32*x}px`).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("x","50%").attr("y",32*x).style("fill",s.vennTitleTextColor||s.titleColor);const _=gt(document.createElement("div")),k=vCt().width(m).height(y-b);_.datum(f).call(k);const S=u?er.svg(_.select("svg").node()):void 0,L=wCt(f,{width:m,height:y-b,padding:(a==null?void 0:a.padding)??15}),$=new Map;for(const M of L){const D=Bd([...M.data.sets].sort());$.set(D,M)}p.length>0&&H4e(a,$,_,p,x,g);const I=hs(s.background||"#f4f4f4");_.selectAll(".venn-circle").each(function(M,D){var ae;const O=gt(this),P=Bd([...M.sets].sort()),G=g.get(P),V=(G==null?void 0:G.fill)||h[D%h.length]||s.primaryColor;O.classed(`venn-set-${D%8}`,!0);const H=(G==null?void 0:G["fill-opacity"])??.1,W=(G==null?void 0:G.stroke)||V,ie=(G==null?void 0:G["stroke-width"])||`${5*x}`;if(u&&S){const J=$.get(P);if(J&&J.circles.length>0){const K=J.circles[0],Q=S.circle(K.x,K.y,K.radius*2,{roughness:.7,seed:l,fill:Aq(V,.7),fillStyle:"hachure",fillWeight:2,hachureGap:8,hachureAngle:-41+D*60,stroke:W,strokeWidth:parseFloat(String(ie))});O.select("path").remove(),(ae=O.node())==null||ae.insertBefore(Q,O.select("text").node())}}else O.select("path").style("fill",V).style("fill-opacity",H).style("stroke",W).style("stroke-width",ie).style("stroke-opacity",.95);const j=(G==null?void 0:G.color)||(I?st(V,30):ot(V,30));O.select("text").style("font-size",`${48*x}px`).style("fill",j)}),u&&S?_.selectAll(".venn-intersection").each(function(M){var V;const D=gt(this),B=Bd([...M.sets].sort()),P=g.get(B),G=P==null?void 0:P.fill;if(G){const H=D.select("path"),W=H.attr("d");if(W){const ie=S.path(W,{roughness:.7,seed:l,fill:Aq(G,.3),fillStyle:"cross-hatch",fillWeight:2,hachureGap:6,hachureAngle:60,stroke:"none"}),j=H.node();(V=j==null?void 0:j.parentNode)==null||V.insertBefore(ie,j),H.remove()}}else D.select("path").style("fill-opacity",0);D.select("text").style("font-size",`${48*x}px`).style("fill",(P==null?void 0:P.color)??s.vennSetTextColor??w)}):(_.selectAll(".venn-intersection text").style("font-size",`${48*x}px`).style("fill",M=>{var B;const O=Bd([...M.sets].sort());return((B=g.get(O))==null?void 0:B.color)??s.vennSetTextColor??w}),_.selectAll(".venn-intersection path").style("fill-opacity",M=>{var B;const O=Bd([...M.sets].sort());return(B=g.get(O))!=null&&B.fill?1:0}).style("fill",M=>{var B;const O=Bd([...M.sets].sort());return((B=g.get(O))==null?void 0:B.fill)??"transparent"}));const z=C.append("g").attr("transform",`translate(0, ${b})`),F=_.select("svg").node();if(F&&"childNodes"in F)for(const M of[...F.childNodes])(N=z.node())==null||N.appendChild(M);Wi(C,y,m,(a==null?void 0:a.useMaxWidth)??!0)},"draw");function Bd(t){return t.join("|")}T(Bd,"stableSetsKey");function H4e(t,e,r,n,i,a){var h;const s=(t==null?void 0:t.useDebugLayout)??!1,l=r.select("svg").append("g").attr("class","venn-text-nodes"),u=new Map;for(const d of n){const f=Bd(d.sets),p=u.get(f);p?p.push(d):u.set(f,[d])}for(const[d,f]of u.entries()){const p=e.get(d);if(!(p!=null&&p.text))continue;const g=p.text.x,m=p.text.y,y=Math.min(...p.circles.map(R=>R.radius)),v=Math.min(...p.circles.map(R=>R.radius-Math.hypot(g-R.x,m-R.y)));let x=Number.isFinite(v)?Math.max(0,v):0;x===0&&Number.isFinite(y)&&(x=y*.6);const b=l.append("g").attr("class","venn-text-area").attr("font-size",`${40*i}px`);s&&b.append("circle").attr("class","venn-text-debug-circle").attr("cx",g).attr("cy",m).attr("r",x).attr("fill","none").attr("stroke","purple").attr("stroke-width",1.5*i).attr("stroke-dasharray",`${6*i} ${4*i}`);const w=Math.max(80*i,x*2*.95),C=Math.max(60*i,x*2*.95),S=(p.data.label&&p.data.label.length>0?Math.min(32*i,x*.25):0)+(f.length<=2?30*i:0),L=g-w/2,$=m-C/2+S,I=Math.max(1,Math.ceil(Math.sqrt(f.length))),z=Math.max(1,Math.ceil(f.length/I)),F=w/I,A=C/z;for(const[R,N]of f.entries()){const M=R%I,D=Math.floor(R/I),O=L+F*(M+.5),B=$+A*(D+.5);s&&b.append("rect").attr("class","venn-text-debug-cell").attr("x",L+F*M).attr("y",$+A*D).attr("width",F).attr("height",A).attr("fill","none").attr("stroke","teal").attr("stroke-width",1*i).attr("stroke-dasharray",`${4*i} ${3*i}`);const P=F*.9,G=A*.9,V=b.append("foreignObject").attr("class","venn-text-node-fo").attr("width",P).attr("height",G).attr("x",O-P/2).attr("y",B-G/2).attr("overflow","visible"),H=(h=a.get(N.id))==null?void 0:h.color,W=V.append("xhtml:span").attr("class","venn-text-node").style("display","flex").style("width","100%").style("height","100%").style("white-space","normal").style("align-items","center").style("justify-content","center").style("text-align","center").style("overflow-wrap","normal").style("word-break","normal").text(N.label??N.id);H&&W.style("color",H)}}}T(H4e,"renderTextNodes");var GCt={draw:zCt},qCt={parser:CCt,db:PCt,renderer:GCt,styles:FCt};const VCt=Object.freeze(Object.defineProperty({__proto__:null,diagram:qCt},Symbol.toStringTag,{value:"Module"}));var Y4e=(_b=class{constructor(){this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.setAccTitle=Yn,this.getAccTitle=ii,this.setDiagramTitle=oi,this.getDiagramTitle=Xn,this.getAccDescription=si,this.setAccDescription=ai}getNodes(){return this.nodes}getConfig(){const e=Xr,r=pr();return wi({...e.treemap,...r.treemap??{}})}addNode(e,r){this.nodes.push(e),this.levels.set(e,r),r===0&&(this.outerNodes.push(e),this.root??(this.root=e))}getRoot(){return{name:"",children:this.outerNodes}}addClass(e,r){const n=this.classes.get(e)??{id:e,styles:[],textStyles:[]},i=r.replace(/\\,/g,"§§§").replace(/,/g,";").replace(/§§§/g,",").split(";");i&&i.forEach(a=>{p8(a)&&(n!=null&&n.textStyles?n.textStyles.push(a):n.textStyles=[a]),n!=null&&n.styles?n.styles.push(a):n.styles=[a]}),this.classes.set(e,n)}getClasses(){return this.classes}getStylesForClass(e){var r;return((r=this.classes.get(e))==null?void 0:r.styles)??[]}clear(){Hn(),this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.root=void 0}},T(_b,"TreeMapDB"),_b);function X4e(t){if(!t.length)return[];const e=[],r=[];return t.forEach(n=>{const i={name:n.name,children:n.type==="Leaf"?void 0:[]};for(i.classSelector=n==null?void 0:n.classSelector,n!=null&&n.cssCompiledStyles&&(i.cssCompiledStyles=n.cssCompiledStyles),n.type==="Leaf"&&n.value!==void 0&&(i.value=n.value);r.length>0&&r[r.length-1].level>=n.level;)r.pop();if(r.length===0)e.push(i);else{const a=r[r.length-1].node;a.children?a.children.push(i):a.children=[i]}n.type!=="Leaf"&&r.push({node:i,level:n.level})}),e}T(X4e,"buildHierarchy");var WCt=T((t,e)=>{Rc(t,e);const r=[];for(const a of t.TreemapRows??[])a.$type==="ClassDefStatement"&&e.addClass(a.className??"",a.styleText??"");for(const a of t.TreemapRows??[]){const s=a.item;if(!s)continue;const o=a.indent?parseInt(a.indent):0,l=UCt(s),u=s.classSelector?e.getStylesForClass(s.classSelector):[],h=u.length>0?u:void 0,d={level:o,name:l,type:s.$type,value:s.value,classSelector:s.classSelector,cssCompiledStyles:h};r.push(d)}const n=X4e(r),i=T((a,s)=>{for(const o of a)e.addNode(o,s),o.children&&o.children.length>0&&i(o.children,s+1)},"addNodesRecursively");i(n,0)},"populate"),UCt=T(t=>t.name?String(t.name):"","getItemName"),j4e={parser:{yy:void 0},parse:T(async t=>{var e;try{const n=await Bl("treemap",t);se.debug("Treemap AST:",n);const i=(e=j4e.parser)==null?void 0:e.yy;if(!(i instanceof Y4e))throw new Error("parser.parser?.yy was not a TreemapDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");WCt(n,i)}catch(r){throw se.error("Error parsing treemap:",r),r}},"parse")},HCt=10,Y1=10,p4=25,YCt=T((t,e,r,n)=>{const i=n.db,a=i.getConfig(),s=a.padding??HCt,o=i.getDiagramTitle(),l=i.getRoot(),{themeVariables:u}=pr();if(!l)return;const h=o?30:0,d=Ys(e),f=a.nodeWidth?a.nodeWidth*Y1:960,p=a.nodeHeight?a.nodeHeight*Y1:500,g=f,m=p+h;d.attr("viewBox",`0 0 ${g} ${m}`),Wi(d,m,g,a.useMaxWidth);let y;try{const A=a.valueFormat||",";if(A==="$0,0")y=T(R=>"$"+Jd(",")(R),"valueFormat");else if(A.startsWith("$")&&A.includes(",")){const R=/\.\d+/.exec(A),N=R?R[0]:"";y=T(M=>"$"+Jd(","+N)(M),"valueFormat")}else if(A.startsWith("$")){const R=A.substring(1);y=T(N=>"$"+Jd(R||"")(N),"valueFormat")}else y=Jd(A)}catch(A){se.error("Error creating format function:",A),y=Jd(",")}const v=ef().range(["transparent",u.cScale0,u.cScale1,u.cScale2,u.cScale3,u.cScale4,u.cScale5,u.cScale6,u.cScale7,u.cScale8,u.cScale9,u.cScale10,u.cScale11]),x=ef().range(["transparent",u.cScalePeer0,u.cScalePeer1,u.cScalePeer2,u.cScalePeer3,u.cScalePeer4,u.cScalePeer5,u.cScalePeer6,u.cScalePeer7,u.cScalePeer8,u.cScalePeer9,u.cScalePeer10,u.cScalePeer11]),b=ef().range([u.cScaleLabel0,u.cScaleLabel1,u.cScaleLabel2,u.cScaleLabel3,u.cScaleLabel4,u.cScaleLabel5,u.cScaleLabel6,u.cScaleLabel7,u.cScaleLabel8,u.cScaleLabel9,u.cScaleLabel10,u.cScaleLabel11]);o&&d.append("text").attr("x",g/2).attr("y",h/2).attr("class","treemapTitle").attr("text-anchor","middle").attr("dominant-baseline","middle").text(o);const w=d.append("g").attr("transform",`translate(0, ${h})`).attr("class","treemapContainer"),C=dR(l).sum(A=>A.value??0).sort((A,R)=>(R.value??0)-(A.value??0)),k=EAe().size([f,p]).paddingTop(A=>A.children&&A.children.length>0?p4+Y1:0).paddingInner(s).paddingLeft(A=>A.children&&A.children.length>0?Y1:0).paddingRight(A=>A.children&&A.children.length>0?Y1:0).paddingBottom(A=>A.children&&A.children.length>0?Y1:0).round(!0)(C),S=k.descendants().filter(A=>A.children&&A.children.length>0),L=w.selectAll(".treemapSection").data(S).enter().append("g").attr("class","treemapSection").attr("transform",A=>`translate(${A.x0},${A.y0})`);L.append("rect").attr("width",A=>A.x1-A.x0).attr("height",p4).attr("class","treemapSectionHeader").attr("fill","none").attr("fill-opacity",.6).attr("stroke-width",.6).attr("style",A=>A.depth===0?"display: none;":""),L.append("clipPath").attr("id",(A,R)=>`clip-section-${e}-${R}`).append("rect").attr("width",A=>Math.max(0,A.x1-A.x0-12)).attr("height",p4),L.append("rect").attr("width",A=>A.x1-A.x0).attr("height",A=>A.y1-A.y0).attr("class",(A,R)=>`treemapSection section${R}`).attr("fill",A=>v(A.data.name)).attr("fill-opacity",.6).attr("stroke",A=>x(A.data.name)).attr("stroke-width",2).attr("stroke-opacity",.4).attr("style",A=>{if(A.depth===0)return"display: none;";const R=Jt({cssCompiledStyles:A.data.cssCompiledStyles});return R.nodeStyles+";"+R.borderStyles.join(";")}),L.append("text").attr("class","treemapSectionLabel").attr("x",6).attr("y",p4/2).attr("dominant-baseline","middle").text(A=>A.depth===0?"":A.data.name).attr("font-weight","bold").attr("style",A=>{if(A.depth===0)return"display: none;";const R="dominant-baseline: middle; font-size: 12px; fill:"+b(A.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",N=Jt({cssCompiledStyles:A.data.cssCompiledStyles});return R+N.labelStyles.replace("color:","fill:")}).each(function(A){if(A.depth===0)return;const R=gt(this),N=A.data.name;R.text(N);const M=A.x1-A.x0,D=6;let O;a.showValues!==!1&&A.value?O=M-10-30-10-D:O=M-D-6;const P=Math.max(15,O),G=R.node();if(G.getComputedTextLength()>P){let W=N;for(;W.length>0;){if(W=N.substring(0,W.length-1),W.length===0){R.text("..."),G.getComputedTextLength()>P&&R.text("");break}if(R.text(W+"..."),G.getComputedTextLength()<=P)break}}}),a.showValues!==!1&&L.append("text").attr("class","treemapSectionValue").attr("x",A=>A.x1-A.x0-10).attr("y",p4/2).attr("text-anchor","end").attr("dominant-baseline","middle").text(A=>A.value?y(A.value):"").attr("font-style","italic").attr("style",A=>{if(A.depth===0)return"display: none;";const R="text-anchor: end; dominant-baseline: middle; font-size: 10px; fill:"+b(A.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",N=Jt({cssCompiledStyles:A.data.cssCompiledStyles});return R+N.labelStyles.replace("color:","fill:")});const $=k.leaves(),I=w.selectAll(".treemapLeafGroup").data($).enter().append("g").attr("class",(A,R)=>`treemapNode treemapLeafGroup leaf${R}${A.data.classSelector?` ${A.data.classSelector}`:""}x`).attr("transform",A=>`translate(${A.x0},${A.y0})`);I.append("rect").attr("width",A=>A.x1-A.x0).attr("height",A=>A.y1-A.y0).attr("class","treemapLeaf").attr("fill",A=>A.parent?v(A.parent.data.name):v(A.data.name)).attr("style",A=>Jt({cssCompiledStyles:A.data.cssCompiledStyles}).nodeStyles).attr("fill-opacity",.3).attr("stroke",A=>A.parent?v(A.parent.data.name):v(A.data.name)).attr("stroke-width",3),I.append("clipPath").attr("id",(A,R)=>`clip-${e}-${R}`).append("rect").attr("width",A=>Math.max(0,A.x1-A.x0-4)).attr("height",A=>Math.max(0,A.y1-A.y0-4)),I.append("text").attr("class","treemapLabel").attr("x",A=>(A.x1-A.x0)/2).attr("y",A=>(A.y1-A.y0)/2).attr("style",A=>{const R="text-anchor: middle; dominant-baseline: middle; font-size: 38px;fill:"+b(A.data.name)+";",N=Jt({cssCompiledStyles:A.data.cssCompiledStyles});return R+N.labelStyles.replace("color:","fill:")}).attr("clip-path",(A,R)=>`url(#clip-${e}-${R})`).text(A=>A.data.name).each(function(A){const R=gt(this),N=A.x1-A.x0,M=A.y1-A.y0,D=R.node(),O=4,B=N-2*O,P=M-2*O;if(B<10||P<10){R.style("display","none");return}let G=parseInt(R.style("font-size"),10);const V=8,H=28,W=.6,ie=6,j=2;for(;D.getComputedTextLength()>B&&G>V;)G--,R.style("font-size",`${G}px`);let ae=Math.max(ie,Math.min(H,Math.round(G*W))),J=G+j+ae;for(;J>P&&G>V&&(G--,ae=Math.max(ie,Math.min(H,Math.round(G*W))),!(aeB||G(R.x1-R.x0)/2).attr("y",function(R){return(R.y1-R.y0)/2}).attr("style",R=>{const N="text-anchor: middle; dominant-baseline: hanging; font-size: 28px;fill:"+b(R.data.name)+";",M=Jt({cssCompiledStyles:R.data.cssCompiledStyles});return N+M.labelStyles.replace("color:","fill:")}).attr("clip-path",(R,N)=>`url(#clip-${e}-${N})`).text(R=>R.value?y(R.value):"").each(function(R){const N=gt(this),M=this.parentNode;if(!M){N.style("display","none");return}const D=gt(M).select(".treemapLabel");if(D.empty()||D.style("display")==="none"){N.style("display","none");return}const O=parseFloat(D.style("font-size")),B=28,P=.6,G=6,V=2,H=Math.max(G,Math.min(B,Math.round(O*P)));N.style("font-size",`${H}px`);const ie=(R.y1-R.y0)/2+O/2+V;N.attr("y",ie);const j=R.x1-R.x0,K=R.y1-R.y0-4,Q=j-8;N.node().getComputedTextLength()>Q||ie+H>K||H{const e=B0(),r=pr(),n=wi(e,r.themeVariables),i=wi(KCt,t),a=i.titleColor??n.titleColor,s=i.labelColor??n.textColor,o=i.valueColor??n.textColor;return` .treemapNode.section { stroke: ${i.sectionStrokeColor}; stroke-width: ${i.sectionStrokeWidth}; @@ -3302,26 +3303,26 @@ Expecting `+ee.join(", ")+", got '"+(this.terminals_[V]||V)+"'":ne="Parse error fill: ${a}; font-size: ${i.titleFontSize}; } - `},"getStyles"),dmt=hmt,fmt={parser:Dve,get db(){return new Lve},renderer:cmt,styles:dmt};const pmt=Object.freeze(Object.defineProperty({__proto__:null,diagram:fmt},Symbol.toStringTag,{value:"Module"}));var t6=x((t,e)=>{const r=t<=1?t*100:t;if(r<0||r>100)throw new Error(`${e} must be between 0-1 (decimal) or 0-100 (percentage). Received: ${t}`);return r},"toPercent"),s0=x((t,e,r)=>({x:t6(e,`${r} evolution`),y:t6(t,`${r} visibility`)}),"toCoordinates"),Mve=x(t=>{if(t){if(t==="+<>")return"bidirectional";if(t==="+<")return"backward";if(t==="+>")return"forward"}},"getFlowFromPort"),gmt=x(t=>{if(!(t!=null&&t.startsWith("+")))return{};const e=/^\+'([^']*)'/.exec(t),r=e==null?void 0:e[1];return t.includes("<>")?{flow:"bidirectional",label:r}:t.includes("<")?{flow:"backward",label:r}:t.includes(">")?{flow:"forward",label:r}:{label:r}},"extractFlowFromArrow"),mmt=x((t,e)=>{if(zl(t,e),t.size&&e.setSize(t.size.width,t.size.height),t.evolution){const r=t.evolution.stages.map(i=>i.secondName?`${i.name.trim()} / ${i.secondName.trim()}`:i.name.trim()),n=t.evolution.stages.filter(i=>i.boundary!==void 0).map(i=>i.boundary);e.updateAxes({stages:r,stageBoundaries:n})}if(t.anchors.forEach(r=>{const n=s0(r.visibility,r.evolution,`Anchor "${r.name}"`);e.addNode(r.name,r.name,n.x,n.y,"anchor")}),t.components.forEach(r=>{var o;const n=s0(r.visibility,r.evolution,`Component "${r.name}"`),i=r.label?(r.label.negX?-1:1)*r.label.offsetX:void 0,a=r.label?(r.label.negY?-1:1)*r.label.offsetY:void 0,s=(o=r.decorator)==null?void 0:o.strategy;e.addNode(r.name,r.name,n.x,n.y,"component",i,a,r.inertia,s)}),t.notes.forEach(r=>{const n=s0(r.visibility,r.evolution,`Note "${r.text}"`);e.addNote(r.text,n.x,n.y)}),t.pipelines.forEach(r=>{const n=e.getNode(r.parent);if(!n||typeof n.y!="number")throw new Error(`Pipeline "${r.parent}" must reference an existing component with coordinates.`);const i=n.y;e.startPipeline(r.parent),r.components.forEach(a=>{const s=`${r.parent}_${a.name}`,o=a.label?(a.label.negX?-1:1)*a.label.offsetX:void 0,l=a.label?(a.label.negY?-1:1)*a.label.offsetY:void 0,u=t6(a.evolution,`Pipeline component "${a.name}" evolution`);e.addNode(s,a.name,u,i,"pipeline-component",o,l),e.addPipelineComponent(r.parent,s)})}),t.links.forEach(r=>{const n=!!r.arrow&&(r.arrow.includes("-.->")||r.arrow.includes(".-."));let i=Mve(r.fromPort)??Mve(r.toPort);const{flow:a,label:s}=gmt(r.arrow);!i&&a&&(i=a);const o=r.linkLabel,l=s??o;e.addLink(e.resolveNodeId(r.from),e.resolveNodeId(r.to),n,l,i)}),t.evolves.forEach(r=>{const n=e.getNode(r.component);if((n==null?void 0:n.y)!==void 0){const i=t6(r.target,`Evolve target for "${r.component}"`);e.addTrend(r.component,i,n.y)}}),t.annotations.length>0){const r=t.annotations[0],n=s0(r.x,r.y,"Annotations box");e.setAnnotationsBox(n.x,n.y)}t.annotation.forEach(r=>{const n=s0(r.x,r.y,`Annotation ${r.number}`);e.addAnnotation(r.number,[{x:n.x,y:n.y}],r.text)}),t.accelerators.forEach(r=>{const n=s0(r.x,r.y,`Accelerator "${r.name}"`);e.addAccelerator(r.name,n.x,n.y)}),t.deaccelerators.forEach(r=>{const n=s0(r.x,r.y,`Deaccelerator "${r.name}"`);e.addDeaccelerator(r.name,n.x,n.y)})},"populateDb"),Nve={parser:{yy:void 0},parse:x(async t=>{var n;const e=await Qo("wardley",t);ae.debug(e);const r=(n=Nve.parser)==null?void 0:n.yy;if(!r||typeof r.addNode!="function")throw new Error("parser.parser?.yy was not a WardleyDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");mmt(e,r)},"parse")},ymt=(Kv=class{constructor(){this.nodes=new Map,this.links=[],this.trends=new Map,this.pipelines=new Map,this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.axes={}}addNode(e){const r=this.nodes.get(e.id)??{id:e.id,label:e.label},n={...r,...e,className:e.className??r.className,labelOffsetX:e.labelOffsetX??r.labelOffsetX,labelOffsetY:e.labelOffsetY??r.labelOffsetY};this.nodes.set(e.id,n)}addLink(e){this.links.push(e)}addTrend(e){this.trends.set(e.nodeId,e)}startPipeline(e){this.pipelines.set(e,{nodeId:e,componentIds:[]});const r=this.nodes.get(e);r&&(r.isPipelineParent=!0)}addPipelineComponent(e,r){const n=this.pipelines.get(e);n&&n.componentIds.push(r);const i=this.nodes.get(r);i&&(i.inPipeline=!0)}addAnnotation(e){this.annotations.push(e)}addNote(e){this.notes.push(e)}addAccelerator(e){this.accelerators.push(e)}addDeaccelerator(e){this.deaccelerators.push(e)}setAnnotationsBox(e,r){this.annotationsBox={x:e,y:r}}setAxes(e){this.axes={...this.axes,...e}}setSize(e,r){this.size={width:e,height:r}}getNode(e){return this.nodes.get(e)}resolveNodeId(e){if(this.nodes.has(e))return e;for(const[r,n]of this.nodes)if(n.label===e)return r;return e}build(){const e=[];for(const r of this.nodes.values()){if(typeof r.x!="number"||typeof r.y!="number")throw new Error(`Node "${r.label}" is missing coordinates`);e.push(r)}return{nodes:e,links:[...this.links],trends:[...this.trends.values()],pipelines:[...this.pipelines.values()],annotations:[...this.annotations],notes:[...this.notes],accelerators:[...this.accelerators],deaccelerators:[...this.deaccelerators],annotationsBox:this.annotationsBox,axes:{...this.axes},size:this.size}}clear(){this.nodes.clear(),this.links=[],this.trends.clear(),this.pipelines.clear(),this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.annotationsBox=void 0,this.axes={},this.size=void 0}},x(Kv,"WardleyBuilder"),Kv),$a=new ymt;function Ove(){return Pe()["wardley-beta"]}x(Ove,"getConfig");function $ve(t,e,r,n,i,a,s,o,l){$a.addNode({id:t,label:e,x:r,y:n,className:i,labelOffsetX:a,labelOffsetY:s,inertia:o,sourceStrategy:l})}x($ve,"addNode");function Pve(t,e,r=!1,n,i){$a.addLink({source:t,target:e,dashed:r,label:n,flow:i})}x(Pve,"addLink");function Bve(t,e,r){$a.addTrend({nodeId:t,targetX:e,targetY:r})}x(Bve,"addTrend");function Fve(t,e,r){$a.addAnnotation({number:t,coordinates:e,text:r})}x(Fve,"addAnnotation");function zve(t,e,r){$a.addNote({text:t,x:e,y:r})}x(zve,"addNote");function Gve(t,e,r){$a.addAccelerator({name:t,x:e,y:r})}x(Gve,"addAccelerator");function qve(t,e,r){$a.addDeaccelerator({name:t,x:e,y:r})}x(qve,"addDeaccelerator");function Vve(t,e){$a.setAnnotationsBox(t,e)}x(Vve,"setAnnotationsBox");function Wve(t,e){$a.setSize(t,e)}x(Wve,"setSize");function Uve(t){$a.startPipeline(t)}x(Uve,"startPipeline");function Hve(t,e){$a.addPipelineComponent(t,e)}x(Hve,"addPipelineComponent");function Yve(t){$a.setAxes(t)}x(Yve,"updateAxes");function Xve(t){return $a.getNode(t)}x(Xve,"getNode");function Kve(t){return $a.resolveNodeId(t)}x(Kve,"resolveNodeId");function jve(){return $a.build()}x(jve,"getWardleyData");function Zve(){$a.clear(),In()}x(Zve,"clear");var vmt={getConfig:Ove,addNode:$ve,addLink:Pve,addTrend:Bve,addAnnotation:Fve,addNote:zve,addAccelerator:Gve,addDeaccelerator:qve,setAnnotationsBox:Vve,setSize:Wve,startPipeline:Uve,addPipelineComponent:Hve,updateAxes:Yve,getNode:Xve,resolveNodeId:Kve,getWardleyData:jve,clear:Zve,setAccTitle:Dn,getAccTitle:Fn,setDiagramTitle:qn,getDiagramTitle:Mn,getAccDescription:Gn,setAccDescription:zn},bmt=["Genesis","Custom Built","Product","Commodity"],xmt=x(()=>{var e,r,n,i,a,s,o,l,u,h,d,f;const{themeVariables:t}=Pe();return{backgroundColor:((e=t.wardley)==null?void 0:e.backgroundColor)??t.background??"#fff",axisColor:((r=t.wardley)==null?void 0:r.axisColor)??"#000",axisTextColor:((n=t.wardley)==null?void 0:n.axisTextColor)??t.primaryTextColor??"#222",gridColor:((i=t.wardley)==null?void 0:i.gridColor)??"rgba(100, 100, 100, 0.2)",componentFill:((a=t.wardley)==null?void 0:a.componentFill)??"#fff",componentStroke:((s=t.wardley)==null?void 0:s.componentStroke)??"#000",componentLabelColor:((o=t.wardley)==null?void 0:o.componentLabelColor)??t.primaryTextColor??"#222",linkStroke:((l=t.wardley)==null?void 0:l.linkStroke)??"#000",evolutionStroke:((u=t.wardley)==null?void 0:u.evolutionStroke)??"#dc3545",annotationStroke:((h=t.wardley)==null?void 0:h.annotationStroke)??"#000",annotationTextColor:((d=t.wardley)==null?void 0:d.annotationTextColor)??t.primaryTextColor??"#222",annotationFill:((f=t.wardley)==null?void 0:f.annotationFill)??t.background??"#fff"}},"getTheme"),Tmt=x(()=>{const t=Pe()["wardley-beta"];return{width:(t==null?void 0:t.width)??900,height:(t==null?void 0:t.height)??600,padding:(t==null?void 0:t.padding)??48,nodeRadius:(t==null?void 0:t.nodeRadius)??6,nodeLabelOffset:(t==null?void 0:t.nodeLabelOffset)??8,axisFontSize:(t==null?void 0:t.axisFontSize)??12,labelFontSize:(t==null?void 0:t.labelFontSize)??10,showGrid:(t==null?void 0:t.showGrid)??!1,useMaxWidth:(t==null?void 0:t.useMaxWidth)??!0}},"getConfigValues"),wmt=x((t,e,r,n)=>{var I,$;ae.debug(`Rendering Wardley map -`+t);const i=Tmt(),a=xmt(),s=i.nodeRadius*1.6,o=n.db,l=o.getWardleyData(),u=o.getDiagramTitle(),h=((I=l.size)==null?void 0:I.width)??i.width,d=(($=l.size)==null?void 0:$.height)??i.height,f=ys(e);f.selectAll("*").remove(),wi(f,d,h,i.useMaxWidth),f.attr("viewBox",`0 0 ${h} ${d}`);const p=f.append("g").attr("class","wardley-map"),g=f.append("defs");g.append("marker").attr("id",`arrow-${e}`).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto-start-reverse").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("fill",a.evolutionStroke).attr("stroke","none"),g.append("marker").attr("id",`link-arrow-end-${e}`).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",5).attr("markerHeight",5).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("fill",a.linkStroke).attr("stroke","none"),g.append("marker").attr("id",`link-arrow-start-${e}`).attr("viewBox","0 0 10 10").attr("refX",1).attr("refY",5).attr("markerWidth",5).attr("markerHeight",5).attr("orient","auto").append("path").attr("d","M 10 0 L 0 5 L 10 10 z").attr("fill",a.linkStroke).attr("stroke","none"),p.append("rect").attr("class","wardley-background").attr("width",h).attr("height",d).attr("fill",a.backgroundColor);const m=h-i.padding*2,y=d-i.padding*2;u&&p.append("text").attr("class","wardley-title").attr("x",h/2).attr("y",i.padding/2).attr("fill",a.axisTextColor).attr("font-size",i.axisFontSize*1.05).attr("font-weight","bold").attr("text-anchor","middle").attr("dominant-baseline","middle").text(u);const v=x(B=>i.padding+B/100*m,"projectX"),T=x(B=>d-i.padding-B/100*y,"projectY"),b=p.append("g").attr("class","wardley-axes");b.append("line").attr("x1",i.padding).attr("x2",h-i.padding).attr("y1",d-i.padding).attr("y2",d-i.padding).attr("stroke",a.axisColor).attr("stroke-width",1),b.append("line").attr("x1",i.padding).attr("x2",i.padding).attr("y1",i.padding).attr("y2",d-i.padding).attr("stroke",a.axisColor).attr("stroke-width",1);const w=l.axes.xLabel??"Evolution",k=l.axes.yLabel??"Visibility";b.append("text").attr("class","wardley-axis-label wardley-axis-label-x").attr("x",i.padding+m/2).attr("y",d-i.padding/4).attr("fill",a.axisTextColor).attr("font-size",i.axisFontSize).attr("font-weight","bold").attr("text-anchor","middle").text(w),b.append("text").attr("class","wardley-axis-label wardley-axis-label-y").attr("x",i.padding/3).attr("y",i.padding+y/2).attr("fill",a.axisTextColor).attr("font-size",i.axisFontSize).attr("font-weight","bold").attr("text-anchor","middle").attr("transform",`rotate(-90 ${i.padding/3} ${i.padding+y/2})`).text(k);const A=l.axes.stages&&l.axes.stages.length>0?l.axes.stages:bmt;if(A.length>0){const B=p.append("g").attr("class","wardley-stages"),P=l.axes.stageBoundaries,G=[];if(P&&P.length===A.length){let V=0;P.forEach(Y=>{G.push({start:V,end:Y}),V=Y})}else{const V=1/A.length;A.forEach((Y,W)=>{G.push({start:W*V,end:(W+1)*V})})}A.forEach((V,Y)=>{const W=G[Y],ie=i.padding+W.start*m,K=i.padding+W.end*m,se=(ie+K)/2;Y>0&&B.append("line").attr("x1",ie).attr("x2",ie).attr("y1",i.padding).attr("y2",d-i.padding).attr("stroke","#000").attr("stroke-width",1).attr("stroke-dasharray","5 5").attr("opacity",.8),B.append("text").attr("class","wardley-stage-label").attr("x",se).attr("y",d-i.padding/1.5).attr("fill",a.axisTextColor).attr("font-size",i.axisFontSize-2).attr("text-anchor","middle").text(V)})}if(i.showGrid){const B=p.append("g").attr("class","wardley-grid");for(let P=1;P<4;P++){const G=P/4,V=i.padding+m*G;B.append("line").attr("x1",V).attr("x2",V).attr("y1",i.padding).attr("y2",d-i.padding).attr("stroke",a.gridColor).attr("stroke-dasharray","2 6"),B.append("line").attr("x1",i.padding).attr("x2",h-i.padding).attr("y1",d-i.padding-y*G).attr("y2",d-i.padding-y*G).attr("stroke",a.gridColor).attr("stroke-dasharray","2 6")}}const C=new Map;if(l.nodes.forEach(B=>{C.set(B.id,{x:v(B.x),y:T(B.y),node:B})}),l.pipelines.length>0){const B=p.append("g").attr("class","wardley-pipelines"),P=p.append("g").attr("class","wardley-pipeline-links");l.pipelines.forEach(G=>{if(G.componentIds.length===0)return;const V=G.componentIds.map(K=>({id:K,pos:C.get(K),node:l.nodes.find(se=>se.id===K)})).filter(K=>K.pos&&K.node).sort((K,se)=>K.node.x-se.node.x);for(let K=0;K{const se=C.get(K);se&&(Y=Math.min(Y,se.x),W=Math.max(W,se.x),ie=se.y)}),Y!==1/0&&W!==-1/0){const se=i.nodeRadius*4,J=ie-se/2,Z=C.get(G.nodeId);if(Z){const ee=(Y+W)/2;Z.x=ee,Z.y=J-s/6}B.append("rect").attr("class","wardley-pipeline-box").attr("x",Y-15).attr("y",J).attr("width",W-Y+30).attr("height",se).attr("fill","none").attr("stroke",a.axisColor).attr("stroke-width",1.5).attr("rx",4).attr("ry",4)}})}const _=p.append("g").attr("class","wardley-links"),L=new Map;l.pipelines.forEach(B=>{L.set(B.nodeId,new Set(B.componentIds))});const O=l.links.filter(B=>{if(!C.has(B.source)||!C.has(B.target))return!1;const P=L.get(B.target);return!(P!=null&&P.has(B.source))});_.selectAll("line").data(O).enter().append("line").attr("class",B=>`wardley-link${B.dashed?" wardley-link--dashed":""}`).attr("x1",B=>{const P=C.get(B.source),G=C.get(B.target),Y=l.nodes.find(se=>se.id===B.source).isPipelineParent?s/Math.sqrt(2):i.nodeRadius,W=G.x-P.x,ie=G.y-P.y,K=Math.sqrt(W*W+ie*ie);return P.x+W/K*Y}).attr("y1",B=>{const P=C.get(B.source),G=C.get(B.target),Y=l.nodes.find(se=>se.id===B.source).isPipelineParent?s/Math.sqrt(2):i.nodeRadius,W=G.x-P.x,ie=G.y-P.y,K=Math.sqrt(W*W+ie*ie);return P.y+ie/K*Y}).attr("x2",B=>{const P=C.get(B.source),G=C.get(B.target),Y=l.nodes.find(se=>se.id===B.target).isPipelineParent?s/Math.sqrt(2):i.nodeRadius,W=P.x-G.x,ie=P.y-G.y,K=Math.sqrt(W*W+ie*ie);return G.x+W/K*Y}).attr("y2",B=>{const P=C.get(B.source),G=C.get(B.target),Y=l.nodes.find(se=>se.id===B.target).isPipelineParent?s/Math.sqrt(2):i.nodeRadius,W=P.x-G.x,ie=P.y-G.y,K=Math.sqrt(W*W+ie*ie);return G.y+ie/K*Y}).attr("stroke",a.linkStroke).attr("stroke-width",1).attr("stroke-dasharray",B=>B.dashed?"6 6":null).attr("marker-end",B=>B.flow==="forward"||B.flow==="bidirectional"?`url(#link-arrow-end-${e})`:null).attr("marker-start",B=>B.flow==="backward"||B.flow==="bidirectional"?`url(#link-arrow-start-${e})`:null),_.selectAll("text").data(O.filter(B=>B.label)).enter().append("text").attr("class","wardley-link-label").attr("x",B=>{const P=C.get(B.source),G=C.get(B.target),V=(P.x+G.x)/2,Y=G.y-P.y,W=G.x-P.x,ie=Math.sqrt(W*W+Y*Y),K=8,se=Y/ie;return V+se*K}).attr("y",B=>{const P=C.get(B.source),G=C.get(B.target),V=(P.y+G.y)/2,Y=G.x-P.x,W=G.y-P.y,ie=Math.sqrt(Y*Y+W*W),K=8,se=-Y/ie;return V+se*K}).attr("fill",a.axisTextColor).attr("font-size",i.labelFontSize).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("transform",B=>{const P=C.get(B.source),G=C.get(B.target),V=(P.x+G.x)/2,Y=(P.y+G.y)/2,W=G.x-P.x,ie=G.y-P.y,K=Math.sqrt(W*W+ie*ie),se=8,J=ie/K,Z=-W/K,ee=V+J*se,ne=Y+Z*se;let ue=Math.atan2(ie,W)*180/Math.PI;return(ue>90||ue<-90)&&(ue+=180),`rotate(${ue} ${ee} ${ne})`}).text(B=>B.label);const M=p.append("g").attr("class","wardley-trends"),z=l.trends.map(B=>{const P=C.get(B.nodeId);if(!P)return null;const G=v(B.targetX),V=T(B.targetY),Y=G-P.x,W=V-P.y,ie=Math.sqrt(Y*Y+W*W),K=i.nodeRadius+2,se=ie>K?G-Y/ie*K:G,J=ie>K?V-W/ie*K:V;return{origin:P,targetX:G,targetY:V,adjustedX2:se,adjustedY2:J}}).filter(B=>B!==null);M.selectAll("line").data(z).enter().append("line").attr("class","wardley-trend").attr("x1",B=>B.origin.x).attr("y1",B=>B.origin.y).attr("x2",B=>B.adjustedX2).attr("y2",B=>B.adjustedY2).attr("stroke",a.evolutionStroke).attr("stroke-width",1).attr("stroke-dasharray","4 4").attr("marker-end",`url(#arrow-${e})`);const S=p.append("g").attr("class","wardley-nodes").selectAll("g").data(l.nodes).enter().append("g").attr("class",B=>["wardley-node",B.className?`wardley-node--${B.className}`:""].filter(Boolean).join(" "));S.filter(B=>B.sourceStrategy==="outsource").append("circle").attr("class","wardley-outsource-overlay").attr("cx",B=>C.get(B.id).x).attr("cy",B=>C.get(B.id).y).attr("r",i.nodeRadius*2).attr("fill","#666").attr("stroke",a.componentStroke).attr("stroke-width",1),S.filter(B=>B.sourceStrategy==="buy").append("circle").attr("class","wardley-buy-overlay").attr("cx",B=>C.get(B.id).x).attr("cy",B=>C.get(B.id).y).attr("r",i.nodeRadius*2).attr("fill","#ccc").attr("stroke",a.componentStroke).attr("stroke-width",1),S.filter(B=>B.sourceStrategy==="build").append("circle").attr("class","wardley-build-overlay").attr("cx",B=>C.get(B.id).x).attr("cy",B=>C.get(B.id).y).attr("r",i.nodeRadius*2).attr("fill","#eee").attr("stroke","#000").attr("stroke-width",1);const R=S.filter(B=>B.sourceStrategy==="market");R.append("circle").attr("class","wardley-market-overlay").attr("cx",B=>C.get(B.id).x).attr("cy",B=>C.get(B.id).y).attr("r",i.nodeRadius*2).attr("fill","white").attr("stroke",a.componentStroke).attr("stroke-width",1),S.filter(B=>!B.isPipelineParent&&B.sourceStrategy!=="market"&&B.className!=="anchor").append("circle").attr("cx",B=>C.get(B.id).x).attr("cy",B=>C.get(B.id).y).attr("r",i.nodeRadius).attr("fill",a.componentFill).attr("stroke",a.componentStroke).attr("stroke-width",1);const N=i.nodeRadius*.7,D=i.nodeRadius*1.2;if(R.append("line").attr("class","wardley-market-line").attr("x1",B=>C.get(B.id).x).attr("y1",B=>C.get(B.id).y-D).attr("x2",B=>C.get(B.id).x-D*Math.cos(Math.PI/6)).attr("y2",B=>C.get(B.id).y+D*Math.sin(Math.PI/6)).attr("stroke",a.componentStroke).attr("stroke-width",1),R.append("line").attr("class","wardley-market-line").attr("x1",B=>C.get(B.id).x-D*Math.cos(Math.PI/6)).attr("y1",B=>C.get(B.id).y+D*Math.sin(Math.PI/6)).attr("x2",B=>C.get(B.id).x+D*Math.cos(Math.PI/6)).attr("y2",B=>C.get(B.id).y+D*Math.sin(Math.PI/6)).attr("stroke",a.componentStroke).attr("stroke-width",1),R.append("line").attr("class","wardley-market-line").attr("x1",B=>C.get(B.id).x+D*Math.cos(Math.PI/6)).attr("y1",B=>C.get(B.id).y+D*Math.sin(Math.PI/6)).attr("x2",B=>C.get(B.id).x).attr("y2",B=>C.get(B.id).y-D).attr("stroke",a.componentStroke).attr("stroke-width",1),R.append("circle").attr("class","wardley-market-dot").attr("cx",B=>C.get(B.id).x).attr("cy",B=>C.get(B.id).y-D).attr("r",N).attr("fill","white").attr("stroke",a.componentStroke).attr("stroke-width",2),R.append("circle").attr("class","wardley-market-dot").attr("cx",B=>C.get(B.id).x-D*Math.cos(Math.PI/6)).attr("cy",B=>C.get(B.id).y+D*Math.sin(Math.PI/6)).attr("r",N).attr("fill","white").attr("stroke",a.componentStroke).attr("stroke-width",2),R.append("circle").attr("class","wardley-market-dot").attr("cx",B=>C.get(B.id).x+D*Math.cos(Math.PI/6)).attr("cy",B=>C.get(B.id).y+D*Math.sin(Math.PI/6)).attr("r",N).attr("fill","white").attr("stroke",a.componentStroke).attr("stroke-width",2),S.filter(B=>B.isPipelineParent===!0).append("rect").attr("x",B=>C.get(B.id).x-s/2).attr("y",B=>C.get(B.id).y-s/2).attr("width",s).attr("height",s).attr("fill",a.componentFill).attr("stroke",a.componentStroke).attr("stroke-width",1),S.filter(B=>B.inertia===!0).append("line").attr("class","wardley-inertia").attr("x1",B=>{const P=C.get(B.id);let G=B.isPipelineParent?s/2+15:i.nodeRadius+15;return B.sourceStrategy&&(G+=i.nodeRadius+10),P.x+G}).attr("y1",B=>{const P=C.get(B.id),G=B.isPipelineParent?s:i.nodeRadius*2;return P.y-G/2}).attr("x2",B=>{const P=C.get(B.id);let G=B.isPipelineParent?s/2+15:i.nodeRadius+15;return B.sourceStrategy&&(G+=i.nodeRadius+10),P.x+G}).attr("y2",B=>{const P=C.get(B.id),G=B.isPipelineParent?s:i.nodeRadius*2;return P.y+G/2}).attr("stroke",a.componentStroke).attr("stroke-width",6),S.append("text").attr("x",B=>{const P=C.get(B.id);if(B.className==="anchor")return B.labelOffsetX!==void 0?P.x+B.labelOffsetX:P.x;let G=i.nodeLabelOffset;B.sourceStrategy&&B.labelOffsetX===void 0&&(G+=10);const V=B.labelOffsetX??G;return P.x+V}).attr("y",B=>{const P=C.get(B.id);if(B.className==="anchor")return B.labelOffsetY!==void 0?P.y+B.labelOffsetY:P.y-3;let G=-i.nodeLabelOffset;B.sourceStrategy&&B.labelOffsetY===void 0&&(G-=10);const V=B.labelOffsetY??G;return P.y+V}).attr("class","wardley-node-label").attr("fill",B=>B.className==="evolved"?a.evolutionStroke:B.className==="anchor"?"#000":a.componentLabelColor).attr("font-size",i.labelFontSize).attr("font-weight",B=>B.className==="anchor"?"bold":"normal").attr("text-anchor",B=>B.className==="anchor"?"middle":"start").attr("dominant-baseline",B=>B.className==="anchor"?"middle":"auto").text(B=>B.label),l.annotations.length>0){const B=p.append("g").attr("class","wardley-annotations");if(l.annotations.forEach(P=>{const G=P.coordinates.map(V=>({x:v(V.x),y:T(V.y)}));if(G.length>1)for(let V=0;V{const Y=B.append("g").attr("class","wardley-annotation");Y.append("circle").attr("cx",V.x).attr("cy",V.y).attr("r",10).attr("fill","white").attr("stroke",a.axisColor).attr("stroke-width",1.5),Y.append("text").attr("x",V.x).attr("y",V.y).attr("text-anchor","middle").attr("dominant-baseline","central").attr("font-size",10).attr("fill",a.axisTextColor).attr("font-weight","bold").text(P.number)})}),l.annotationsBox){let P=v(l.annotationsBox.x),G=T(l.annotationsBox.y);const V=10,Y=16,W=11,ie=B.append("g").attr("class","wardley-annotations-box"),K=[...l.annotations].filter(J=>J.text).sort((J,Z)=>J.number-Z.number),se=[];if(K.forEach((J,Z)=>{const ee=ie.append("text").attr("x",P+V).attr("y",G+V+(Z+1)*Y).attr("font-size",W).attr("fill",a.axisTextColor).attr("text-anchor","start").attr("dominant-baseline","middle").text(`${J.number}. ${J.text}`);se.push(ee)}),se.length>0){let J=0,Z=0;se.forEach(Ne=>{const me=Ne.node(),ve=me.getComputedTextLength();J=Math.max(J,ve);const Ge=me.getBBox();Z=Math.max(Z,Ge.height)});const ee=J+V*2+105,ne=K.length*Y+V*2+Z/2,ue=i.padding,fe=h-i.padding-ee,_e=i.padding,Ae=d-i.padding-ne;P=Math.max(ue,Math.min(P,fe)),G=Math.max(_e,Math.min(G,Ae)),se.forEach((Ne,me)=>{Ne.attr("x",P+V).attr("y",G+V+(me+1)*Y)}),ie.insert("rect","text").attr("x",P).attr("y",G).attr("width",ee).attr("height",ne).attr("fill","white").attr("stroke",a.axisColor).attr("stroke-width",1.5).attr("rx",4).attr("ry",4)}}}if(l.notes.length>0){const B=p.append("g").attr("class","wardley-notes");l.notes.forEach(P=>{const G=v(P.x),V=T(P.y);B.append("text").attr("x",G).attr("y",V).attr("text-anchor","start").attr("font-size",11).attr("fill",a.axisTextColor).attr("font-weight","bold").text(P.text)})}if(l.accelerators.length>0){const B=p.append("g").attr("class","wardley-accelerators");l.accelerators.forEach(P=>{const G=v(P.x),V=T(P.y),Y=60,W=30,ie=20,K=` + `},"getStyles"),QCt=ZCt,JCt={parser:j4e,get db(){return new Y4e},renderer:jCt,styles:QCt};const e4t=Object.freeze(Object.defineProperty({__proto__:null,diagram:JCt},Symbol.toStringTag,{value:"Module"}));var e7=T((t,e)=>{const r=t<=1?t*100:t;if(r<0||r>100)throw new Error(`${e} must be between 0-1 (decimal) or 0-100 (percentage). Received: ${t}`);return r},"toPercent"),w0=T((t,e,r)=>({x:e7(e,`${r} evolution`),y:e7(t,`${r} visibility`)}),"toCoordinates"),K4e=T(t=>{if(t){if(t==="+<>")return"bidirectional";if(t==="+<")return"backward";if(t==="+>")return"forward"}},"getFlowFromPort"),t4t=T(t=>{if(!(t!=null&&t.startsWith("+")))return{};const e=/^\+'([^']*)'/.exec(t),r=e==null?void 0:e[1];return t.includes("<>")?{flow:"bidirectional",label:r}:t.includes("<")?{flow:"backward",label:r}:t.includes(">")?{flow:"forward",label:r}:{label:r}},"extractFlowFromArrow"),r4t=T((t,e)=>{if(Rc(t,e),t.size&&e.setSize(t.size.width,t.size.height),t.evolution){const r=t.evolution.stages.map(i=>i.secondName?`${i.name.trim()} / ${i.secondName.trim()}`:i.name.trim()),n=t.evolution.stages.filter(i=>i.boundary!==void 0).map(i=>i.boundary);e.updateAxes({stages:r,stageBoundaries:n})}if(t.anchors.forEach(r=>{const n=w0(r.visibility,r.evolution,`Anchor "${r.name}"`);e.addNode(r.name,r.name,n.x,n.y,"anchor")}),t.components.forEach(r=>{var o;const n=w0(r.visibility,r.evolution,`Component "${r.name}"`),i=r.label?(r.label.negX?-1:1)*r.label.offsetX:void 0,a=r.label?(r.label.negY?-1:1)*r.label.offsetY:void 0,s=(o=r.decorator)==null?void 0:o.strategy;e.addNode(r.name,r.name,n.x,n.y,"component",i,a,r.inertia,s)}),t.notes.forEach(r=>{const n=w0(r.visibility,r.evolution,`Note "${r.text}"`);e.addNote(r.text,n.x,n.y)}),t.pipelines.forEach(r=>{const n=e.getNode(r.parent);if(!n||typeof n.y!="number")throw new Error(`Pipeline "${r.parent}" must reference an existing component with coordinates.`);const i=n.y;e.startPipeline(r.parent),r.components.forEach(a=>{const s=`${r.parent}_${a.name}`,o=a.label?(a.label.negX?-1:1)*a.label.offsetX:void 0,l=a.label?(a.label.negY?-1:1)*a.label.offsetY:void 0,u=e7(a.evolution,`Pipeline component "${a.name}" evolution`);e.addNode(s,a.name,u,i,"pipeline-component",o,l),e.addPipelineComponent(r.parent,s)})}),t.links.forEach(r=>{const n=!!r.arrow&&(r.arrow.includes("-.->")||r.arrow.includes(".-."));let i=K4e(r.fromPort)??K4e(r.toPort);const{flow:a,label:s}=t4t(r.arrow);!i&&a&&(i=a);const o=r.linkLabel,l=s??o;e.addLink(e.resolveNodeId(r.from),e.resolveNodeId(r.to),n,l,i)}),t.evolves.forEach(r=>{const n=e.getNode(r.component);if((n==null?void 0:n.y)!==void 0){const i=e7(r.target,`Evolve target for "${r.component}"`);e.addTrend(r.component,i,n.y)}}),t.annotations.length>0){const r=t.annotations[0],n=w0(r.x,r.y,"Annotations box");e.setAnnotationsBox(n.x,n.y)}t.annotation.forEach(r=>{const n=w0(r.x,r.y,`Annotation ${r.number}`);e.addAnnotation(r.number,[{x:n.x,y:n.y}],r.text)}),t.accelerators.forEach(r=>{const n=w0(r.x,r.y,`Accelerator "${r.name}"`);e.addAccelerator(r.name,n.x,n.y)}),t.deaccelerators.forEach(r=>{const n=w0(r.x,r.y,`Deaccelerator "${r.name}"`);e.addDeaccelerator(r.name,n.x,n.y)})},"populateDb"),Z4e={parser:{yy:void 0},parse:T(async t=>{var n;const e=await Bl("wardley",t);se.debug(e);const r=(n=Z4e.parser)==null?void 0:n.yy;if(!r||typeof r.addNode!="function")throw new Error("parser.parser?.yy was not a WardleyDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");r4t(e,r)},"parse")},n4t=(Ab=class{constructor(){this.nodes=new Map,this.links=[],this.trends=new Map,this.pipelines=new Map,this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.axes={}}addNode(e){const r=this.nodes.get(e.id)??{id:e.id,label:e.label},n={...r,...e,className:e.className??r.className,labelOffsetX:e.labelOffsetX??r.labelOffsetX,labelOffsetY:e.labelOffsetY??r.labelOffsetY};this.nodes.set(e.id,n)}addLink(e){this.links.push(e)}addTrend(e){this.trends.set(e.nodeId,e)}startPipeline(e){this.pipelines.set(e,{nodeId:e,componentIds:[]});const r=this.nodes.get(e);r&&(r.isPipelineParent=!0)}addPipelineComponent(e,r){const n=this.pipelines.get(e);n&&n.componentIds.push(r);const i=this.nodes.get(r);i&&(i.inPipeline=!0)}addAnnotation(e){this.annotations.push(e)}addNote(e){this.notes.push(e)}addAccelerator(e){this.accelerators.push(e)}addDeaccelerator(e){this.deaccelerators.push(e)}setAnnotationsBox(e,r){this.annotationsBox={x:e,y:r}}setAxes(e){this.axes={...this.axes,...e}}setSize(e,r){this.size={width:e,height:r}}getNode(e){return this.nodes.get(e)}resolveNodeId(e){if(this.nodes.has(e))return e;for(const[r,n]of this.nodes)if(n.label===e)return r;return e}build(){const e=[];for(const r of this.nodes.values()){if(typeof r.x!="number"||typeof r.y!="number")throw new Error(`Node "${r.label}" is missing coordinates`);e.push(r)}return{nodes:e,links:[...this.links],trends:[...this.trends.values()],pipelines:[...this.pipelines.values()],annotations:[...this.annotations],notes:[...this.notes],accelerators:[...this.accelerators],deaccelerators:[...this.deaccelerators],annotationsBox:this.annotationsBox,axes:{...this.axes},size:this.size}}clear(){this.nodes.clear(),this.links=[],this.trends.clear(),this.pipelines.clear(),this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.annotationsBox=void 0,this.axes={},this.size=void 0}},T(Ab,"WardleyBuilder"),Ab),cs=new n4t;function Q4e(){return Pe()["wardley-beta"]}T(Q4e,"getConfig");function J4e(t,e,r,n,i,a,s,o,l){cs.addNode({id:t,label:e,x:r,y:n,className:i,labelOffsetX:a,labelOffsetY:s,inertia:o,sourceStrategy:l})}T(J4e,"addNode");function eke(t,e,r=!1,n,i){cs.addLink({source:t,target:e,dashed:r,label:n,flow:i})}T(eke,"addLink");function tke(t,e,r){cs.addTrend({nodeId:t,targetX:e,targetY:r})}T(tke,"addTrend");function rke(t,e,r){cs.addAnnotation({number:t,coordinates:e,text:r})}T(rke,"addAnnotation");function nke(t,e,r){cs.addNote({text:t,x:e,y:r})}T(nke,"addNote");function ike(t,e,r){cs.addAccelerator({name:t,x:e,y:r})}T(ike,"addAccelerator");function ake(t,e,r){cs.addDeaccelerator({name:t,x:e,y:r})}T(ake,"addDeaccelerator");function ske(t,e){cs.setAnnotationsBox(t,e)}T(ske,"setAnnotationsBox");function oke(t,e){cs.setSize(t,e)}T(oke,"setSize");function lke(t){cs.startPipeline(t)}T(lke,"startPipeline");function cke(t,e){cs.addPipelineComponent(t,e)}T(cke,"addPipelineComponent");function uke(t){cs.setAxes(t)}T(uke,"updateAxes");function hke(t){return cs.getNode(t)}T(hke,"getNode");function dke(t){return cs.resolveNodeId(t)}T(dke,"resolveNodeId");function fke(){return cs.build()}T(fke,"getWardleyData");function pke(){cs.clear(),Hn()}T(pke,"clear");var i4t={getConfig:Q4e,addNode:J4e,addLink:eke,addTrend:tke,addAnnotation:rke,addNote:nke,addAccelerator:ike,addDeaccelerator:ake,setAnnotationsBox:ske,setSize:oke,startPipeline:lke,addPipelineComponent:cke,updateAxes:uke,getNode:hke,resolveNodeId:dke,getWardleyData:fke,clear:pke,setAccTitle:Yn,getAccTitle:ii,setDiagramTitle:oi,getDiagramTitle:Xn,getAccDescription:si,setAccDescription:ai},a4t=["Genesis","Custom Built","Product","Commodity"],s4t=T(()=>{var e,r,n,i,a,s,o,l,u,h,d,f;const{themeVariables:t}=Pe();return{backgroundColor:((e=t.wardley)==null?void 0:e.backgroundColor)??t.background??"#fff",axisColor:((r=t.wardley)==null?void 0:r.axisColor)??"#000",axisTextColor:((n=t.wardley)==null?void 0:n.axisTextColor)??t.primaryTextColor??"#222",gridColor:((i=t.wardley)==null?void 0:i.gridColor)??"rgba(100, 100, 100, 0.2)",componentFill:((a=t.wardley)==null?void 0:a.componentFill)??"#fff",componentStroke:((s=t.wardley)==null?void 0:s.componentStroke)??"#000",componentLabelColor:((o=t.wardley)==null?void 0:o.componentLabelColor)??t.primaryTextColor??"#222",linkStroke:((l=t.wardley)==null?void 0:l.linkStroke)??"#000",evolutionStroke:((u=t.wardley)==null?void 0:u.evolutionStroke)??"#dc3545",annotationStroke:((h=t.wardley)==null?void 0:h.annotationStroke)??"#000",annotationTextColor:((d=t.wardley)==null?void 0:d.annotationTextColor)??t.primaryTextColor??"#222",annotationFill:((f=t.wardley)==null?void 0:f.annotationFill)??t.background??"#fff"}},"getTheme"),o4t=T(()=>{const t=Pe()["wardley-beta"];return{width:(t==null?void 0:t.width)??900,height:(t==null?void 0:t.height)??600,padding:(t==null?void 0:t.padding)??48,nodeRadius:(t==null?void 0:t.nodeRadius)??6,nodeLabelOffset:(t==null?void 0:t.nodeLabelOffset)??8,axisFontSize:(t==null?void 0:t.axisFontSize)??12,labelFontSize:(t==null?void 0:t.labelFontSize)??10,showGrid:(t==null?void 0:t.showGrid)??!1,useMaxWidth:(t==null?void 0:t.useMaxWidth)??!0}},"getConfigValues"),l4t=T((t,e,r,n)=>{var D,O;se.debug(`Rendering Wardley map +`+t);const i=o4t(),a=s4t(),s=i.nodeRadius*1.6,o=n.db,l=o.getWardleyData(),u=o.getDiagramTitle(),h=((D=l.size)==null?void 0:D.width)??i.width,d=((O=l.size)==null?void 0:O.height)??i.height,f=Ys(e);f.selectAll("*").remove(),Wi(f,d,h,i.useMaxWidth),f.attr("viewBox",`0 0 ${h} ${d}`);const p=f.append("g").attr("class","wardley-map"),g=f.append("defs");g.append("marker").attr("id",`arrow-${e}`).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto-start-reverse").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("fill",a.evolutionStroke).attr("stroke","none"),g.append("marker").attr("id",`link-arrow-end-${e}`).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",5).attr("markerHeight",5).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("fill",a.linkStroke).attr("stroke","none"),g.append("marker").attr("id",`link-arrow-start-${e}`).attr("viewBox","0 0 10 10").attr("refX",1).attr("refY",5).attr("markerWidth",5).attr("markerHeight",5).attr("orient","auto").append("path").attr("d","M 10 0 L 0 5 L 10 10 z").attr("fill",a.linkStroke).attr("stroke","none"),p.append("rect").attr("class","wardley-background").attr("width",h).attr("height",d).attr("fill",a.backgroundColor);const m=h-i.padding*2,y=d-i.padding*2;u&&p.append("text").attr("class","wardley-title").attr("x",h/2).attr("y",i.padding/2).attr("fill",a.axisTextColor).attr("font-size",i.axisFontSize*1.05).attr("font-weight","bold").attr("text-anchor","middle").attr("dominant-baseline","middle").text(u);const v=T(B=>i.padding+B/100*m,"projectX"),x=T(B=>d-i.padding-B/100*y,"projectY"),b=p.append("g").attr("class","wardley-axes");b.append("line").attr("x1",i.padding).attr("x2",h-i.padding).attr("y1",d-i.padding).attr("y2",d-i.padding).attr("stroke",a.axisColor).attr("stroke-width",1),b.append("line").attr("x1",i.padding).attr("x2",i.padding).attr("y1",i.padding).attr("y2",d-i.padding).attr("stroke",a.axisColor).attr("stroke-width",1);const w=l.axes.xLabel??"Evolution",C=l.axes.yLabel??"Visibility";b.append("text").attr("class","wardley-axis-label wardley-axis-label-x").attr("x",i.padding+m/2).attr("y",d-i.padding/4).attr("fill",a.axisTextColor).attr("font-size",i.axisFontSize).attr("font-weight","bold").attr("text-anchor","middle").text(w),b.append("text").attr("class","wardley-axis-label wardley-axis-label-y").attr("x",i.padding/3).attr("y",i.padding+y/2).attr("fill",a.axisTextColor).attr("font-size",i.axisFontSize).attr("font-weight","bold").attr("text-anchor","middle").attr("transform",`rotate(-90 ${i.padding/3} ${i.padding+y/2})`).text(C);const _=l.axes.stages&&l.axes.stages.length>0?l.axes.stages:a4t;if(_.length>0){const B=p.append("g").attr("class","wardley-stages"),P=l.axes.stageBoundaries,G=[];if(P&&P.length===_.length){let V=0;P.forEach(H=>{G.push({start:V,end:H}),V=H})}else{const V=1/_.length;_.forEach((H,W)=>{G.push({start:W*V,end:(W+1)*V})})}_.forEach((V,H)=>{const W=G[H],ie=i.padding+W.start*m,j=i.padding+W.end*m,ae=(ie+j)/2;H>0&&B.append("line").attr("x1",ie).attr("x2",ie).attr("y1",i.padding).attr("y2",d-i.padding).attr("stroke","#000").attr("stroke-width",1).attr("stroke-dasharray","5 5").attr("opacity",.8),B.append("text").attr("class","wardley-stage-label").attr("x",ae).attr("y",d-i.padding/1.5).attr("fill",a.axisTextColor).attr("font-size",i.axisFontSize-2).attr("text-anchor","middle").text(V)})}if(i.showGrid){const B=p.append("g").attr("class","wardley-grid");for(let P=1;P<4;P++){const G=P/4,V=i.padding+m*G;B.append("line").attr("x1",V).attr("x2",V).attr("y1",i.padding).attr("y2",d-i.padding).attr("stroke",a.gridColor).attr("stroke-dasharray","2 6"),B.append("line").attr("x1",i.padding).attr("x2",h-i.padding).attr("y1",d-i.padding-y*G).attr("y2",d-i.padding-y*G).attr("stroke",a.gridColor).attr("stroke-dasharray","2 6")}}const k=new Map;if(l.nodes.forEach(B=>{k.set(B.id,{x:v(B.x),y:x(B.y),node:B})}),l.pipelines.length>0){const B=p.append("g").attr("class","wardley-pipelines"),P=p.append("g").attr("class","wardley-pipeline-links");l.pipelines.forEach(G=>{if(G.componentIds.length===0)return;const V=G.componentIds.map(j=>({id:j,pos:k.get(j),node:l.nodes.find(ae=>ae.id===j)})).filter(j=>j.pos&&j.node).sort((j,ae)=>j.node.x-ae.node.x);for(let j=0;j{const ae=k.get(j);ae&&(H=Math.min(H,ae.x),W=Math.max(W,ae.x),ie=ae.y)}),H!==1/0&&W!==-1/0){const ae=i.nodeRadius*4,J=ie-ae/2,K=k.get(G.nodeId);if(K){const Q=(H+W)/2;K.x=Q,K.y=J-s/6}B.append("rect").attr("class","wardley-pipeline-box").attr("x",H-15).attr("y",J).attr("width",W-H+30).attr("height",ae).attr("fill","none").attr("stroke",a.axisColor).attr("stroke-width",1.5).attr("rx",4).attr("ry",4)}})}const S=p.append("g").attr("class","wardley-links"),L=new Map;l.pipelines.forEach(B=>{L.set(B.nodeId,new Set(B.componentIds))});const $=l.links.filter(B=>{if(!k.has(B.source)||!k.has(B.target))return!1;const P=L.get(B.target);return!(P!=null&&P.has(B.source))});S.selectAll("line").data($).enter().append("line").attr("class",B=>`wardley-link${B.dashed?" wardley-link--dashed":""}`).attr("x1",B=>{const P=k.get(B.source),G=k.get(B.target),H=l.nodes.find(ae=>ae.id===B.source).isPipelineParent?s/Math.sqrt(2):i.nodeRadius,W=G.x-P.x,ie=G.y-P.y,j=Math.sqrt(W*W+ie*ie);return P.x+W/j*H}).attr("y1",B=>{const P=k.get(B.source),G=k.get(B.target),H=l.nodes.find(ae=>ae.id===B.source).isPipelineParent?s/Math.sqrt(2):i.nodeRadius,W=G.x-P.x,ie=G.y-P.y,j=Math.sqrt(W*W+ie*ie);return P.y+ie/j*H}).attr("x2",B=>{const P=k.get(B.source),G=k.get(B.target),H=l.nodes.find(ae=>ae.id===B.target).isPipelineParent?s/Math.sqrt(2):i.nodeRadius,W=P.x-G.x,ie=P.y-G.y,j=Math.sqrt(W*W+ie*ie);return G.x+W/j*H}).attr("y2",B=>{const P=k.get(B.source),G=k.get(B.target),H=l.nodes.find(ae=>ae.id===B.target).isPipelineParent?s/Math.sqrt(2):i.nodeRadius,W=P.x-G.x,ie=P.y-G.y,j=Math.sqrt(W*W+ie*ie);return G.y+ie/j*H}).attr("stroke",a.linkStroke).attr("stroke-width",1).attr("stroke-dasharray",B=>B.dashed?"6 6":null).attr("marker-end",B=>B.flow==="forward"||B.flow==="bidirectional"?`url(#link-arrow-end-${e})`:null).attr("marker-start",B=>B.flow==="backward"||B.flow==="bidirectional"?`url(#link-arrow-start-${e})`:null),S.selectAll("text").data($.filter(B=>B.label)).enter().append("text").attr("class","wardley-link-label").attr("x",B=>{const P=k.get(B.source),G=k.get(B.target),V=(P.x+G.x)/2,H=G.y-P.y,W=G.x-P.x,ie=Math.sqrt(W*W+H*H),j=8,ae=H/ie;return V+ae*j}).attr("y",B=>{const P=k.get(B.source),G=k.get(B.target),V=(P.y+G.y)/2,H=G.x-P.x,W=G.y-P.y,ie=Math.sqrt(H*H+W*W),j=8,ae=-H/ie;return V+ae*j}).attr("fill",a.axisTextColor).attr("font-size",i.labelFontSize).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("transform",B=>{const P=k.get(B.source),G=k.get(B.target),V=(P.x+G.x)/2,H=(P.y+G.y)/2,W=G.x-P.x,ie=G.y-P.y,j=Math.sqrt(W*W+ie*ie),ae=8,J=ie/j,K=-W/j,Q=V+J*ae,re=H+K*ae;let le=Math.atan2(ie,W)*180/Math.PI;return(le>90||le<-90)&&(le+=180),`rotate(${le} ${Q} ${re})`}).text(B=>B.label);const I=p.append("g").attr("class","wardley-trends"),z=l.trends.map(B=>{const P=k.get(B.nodeId);if(!P)return null;const G=v(B.targetX),V=x(B.targetY),H=G-P.x,W=V-P.y,ie=Math.sqrt(H*H+W*W),j=i.nodeRadius+2,ae=ie>j?G-H/ie*j:G,J=ie>j?V-W/ie*j:V;return{origin:P,targetX:G,targetY:V,adjustedX2:ae,adjustedY2:J}}).filter(B=>B!==null);I.selectAll("line").data(z).enter().append("line").attr("class","wardley-trend").attr("x1",B=>B.origin.x).attr("y1",B=>B.origin.y).attr("x2",B=>B.adjustedX2).attr("y2",B=>B.adjustedY2).attr("stroke",a.evolutionStroke).attr("stroke-width",1).attr("stroke-dasharray","4 4").attr("marker-end",`url(#arrow-${e})`);const A=p.append("g").attr("class","wardley-nodes").selectAll("g").data(l.nodes).enter().append("g").attr("class",B=>["wardley-node",B.className?`wardley-node--${B.className}`:""].filter(Boolean).join(" "));A.filter(B=>B.sourceStrategy==="outsource").append("circle").attr("class","wardley-outsource-overlay").attr("cx",B=>k.get(B.id).x).attr("cy",B=>k.get(B.id).y).attr("r",i.nodeRadius*2).attr("fill","#666").attr("stroke",a.componentStroke).attr("stroke-width",1),A.filter(B=>B.sourceStrategy==="buy").append("circle").attr("class","wardley-buy-overlay").attr("cx",B=>k.get(B.id).x).attr("cy",B=>k.get(B.id).y).attr("r",i.nodeRadius*2).attr("fill","#ccc").attr("stroke",a.componentStroke).attr("stroke-width",1),A.filter(B=>B.sourceStrategy==="build").append("circle").attr("class","wardley-build-overlay").attr("cx",B=>k.get(B.id).x).attr("cy",B=>k.get(B.id).y).attr("r",i.nodeRadius*2).attr("fill","#eee").attr("stroke","#000").attr("stroke-width",1);const R=A.filter(B=>B.sourceStrategy==="market");R.append("circle").attr("class","wardley-market-overlay").attr("cx",B=>k.get(B.id).x).attr("cy",B=>k.get(B.id).y).attr("r",i.nodeRadius*2).attr("fill","white").attr("stroke",a.componentStroke).attr("stroke-width",1),A.filter(B=>!B.isPipelineParent&&B.sourceStrategy!=="market"&&B.className!=="anchor").append("circle").attr("cx",B=>k.get(B.id).x).attr("cy",B=>k.get(B.id).y).attr("r",i.nodeRadius).attr("fill",a.componentFill).attr("stroke",a.componentStroke).attr("stroke-width",1);const N=i.nodeRadius*.7,M=i.nodeRadius*1.2;if(R.append("line").attr("class","wardley-market-line").attr("x1",B=>k.get(B.id).x).attr("y1",B=>k.get(B.id).y-M).attr("x2",B=>k.get(B.id).x-M*Math.cos(Math.PI/6)).attr("y2",B=>k.get(B.id).y+M*Math.sin(Math.PI/6)).attr("stroke",a.componentStroke).attr("stroke-width",1),R.append("line").attr("class","wardley-market-line").attr("x1",B=>k.get(B.id).x-M*Math.cos(Math.PI/6)).attr("y1",B=>k.get(B.id).y+M*Math.sin(Math.PI/6)).attr("x2",B=>k.get(B.id).x+M*Math.cos(Math.PI/6)).attr("y2",B=>k.get(B.id).y+M*Math.sin(Math.PI/6)).attr("stroke",a.componentStroke).attr("stroke-width",1),R.append("line").attr("class","wardley-market-line").attr("x1",B=>k.get(B.id).x+M*Math.cos(Math.PI/6)).attr("y1",B=>k.get(B.id).y+M*Math.sin(Math.PI/6)).attr("x2",B=>k.get(B.id).x).attr("y2",B=>k.get(B.id).y-M).attr("stroke",a.componentStroke).attr("stroke-width",1),R.append("circle").attr("class","wardley-market-dot").attr("cx",B=>k.get(B.id).x).attr("cy",B=>k.get(B.id).y-M).attr("r",N).attr("fill","white").attr("stroke",a.componentStroke).attr("stroke-width",2),R.append("circle").attr("class","wardley-market-dot").attr("cx",B=>k.get(B.id).x-M*Math.cos(Math.PI/6)).attr("cy",B=>k.get(B.id).y+M*Math.sin(Math.PI/6)).attr("r",N).attr("fill","white").attr("stroke",a.componentStroke).attr("stroke-width",2),R.append("circle").attr("class","wardley-market-dot").attr("cx",B=>k.get(B.id).x+M*Math.cos(Math.PI/6)).attr("cy",B=>k.get(B.id).y+M*Math.sin(Math.PI/6)).attr("r",N).attr("fill","white").attr("stroke",a.componentStroke).attr("stroke-width",2),A.filter(B=>B.isPipelineParent===!0).append("rect").attr("x",B=>k.get(B.id).x-s/2).attr("y",B=>k.get(B.id).y-s/2).attr("width",s).attr("height",s).attr("fill",a.componentFill).attr("stroke",a.componentStroke).attr("stroke-width",1),A.filter(B=>B.inertia===!0).append("line").attr("class","wardley-inertia").attr("x1",B=>{const P=k.get(B.id);let G=B.isPipelineParent?s/2+15:i.nodeRadius+15;return B.sourceStrategy&&(G+=i.nodeRadius+10),P.x+G}).attr("y1",B=>{const P=k.get(B.id),G=B.isPipelineParent?s:i.nodeRadius*2;return P.y-G/2}).attr("x2",B=>{const P=k.get(B.id);let G=B.isPipelineParent?s/2+15:i.nodeRadius+15;return B.sourceStrategy&&(G+=i.nodeRadius+10),P.x+G}).attr("y2",B=>{const P=k.get(B.id),G=B.isPipelineParent?s:i.nodeRadius*2;return P.y+G/2}).attr("stroke",a.componentStroke).attr("stroke-width",6),A.append("text").attr("x",B=>{const P=k.get(B.id);if(B.className==="anchor")return B.labelOffsetX!==void 0?P.x+B.labelOffsetX:P.x;let G=i.nodeLabelOffset;B.sourceStrategy&&B.labelOffsetX===void 0&&(G+=10);const V=B.labelOffsetX??G;return P.x+V}).attr("y",B=>{const P=k.get(B.id);if(B.className==="anchor")return B.labelOffsetY!==void 0?P.y+B.labelOffsetY:P.y-3;let G=-i.nodeLabelOffset;B.sourceStrategy&&B.labelOffsetY===void 0&&(G-=10);const V=B.labelOffsetY??G;return P.y+V}).attr("class","wardley-node-label").attr("fill",B=>B.className==="evolved"?a.evolutionStroke:B.className==="anchor"?"#000":a.componentLabelColor).attr("font-size",i.labelFontSize).attr("font-weight",B=>B.className==="anchor"?"bold":"normal").attr("text-anchor",B=>B.className==="anchor"?"middle":"start").attr("dominant-baseline",B=>B.className==="anchor"?"middle":"auto").text(B=>B.label),l.annotations.length>0){const B=p.append("g").attr("class","wardley-annotations");if(l.annotations.forEach(P=>{const G=P.coordinates.map(V=>({x:v(V.x),y:x(V.y)}));if(G.length>1)for(let V=0;V{const H=B.append("g").attr("class","wardley-annotation");H.append("circle").attr("cx",V.x).attr("cy",V.y).attr("r",10).attr("fill","white").attr("stroke",a.axisColor).attr("stroke-width",1.5),H.append("text").attr("x",V.x).attr("y",V.y).attr("text-anchor","middle").attr("dominant-baseline","central").attr("font-size",10).attr("fill",a.axisTextColor).attr("font-weight","bold").text(P.number)})}),l.annotationsBox){let P=v(l.annotationsBox.x),G=x(l.annotationsBox.y);const V=10,H=16,W=11,ie=B.append("g").attr("class","wardley-annotations-box"),j=[...l.annotations].filter(J=>J.text).sort((J,K)=>J.number-K.number),ae=[];if(j.forEach((J,K)=>{const Q=ie.append("text").attr("x",P+V).attr("y",G+V+(K+1)*H).attr("font-size",W).attr("fill",a.axisTextColor).attr("text-anchor","start").attr("dominant-baseline","middle").text(`${J.number}. ${J.text}`);ae.push(Q)}),ae.length>0){let J=0,K=0;ae.forEach(Ne=>{const ge=Ne.node(),ve=ge.getComputedTextLength();J=Math.max(J,ve);const ze=ge.getBBox();K=Math.max(K,ze.height)});const Q=J+V*2+105,re=j.length*H+V*2+K/2,le=i.padding,fe=h-i.padding-Q,Ae=i.padding,Se=d-i.padding-re;P=Math.max(le,Math.min(P,fe)),G=Math.max(Ae,Math.min(G,Se)),ae.forEach((Ne,ge)=>{Ne.attr("x",P+V).attr("y",G+V+(ge+1)*H)}),ie.insert("rect","text").attr("x",P).attr("y",G).attr("width",Q).attr("height",re).attr("fill","white").attr("stroke",a.axisColor).attr("stroke-width",1.5).attr("rx",4).attr("ry",4)}}}if(l.notes.length>0){const B=p.append("g").attr("class","wardley-notes");l.notes.forEach(P=>{const G=v(P.x),V=x(P.y);B.append("text").attr("x",G).attr("y",V).attr("text-anchor","start").attr("font-size",11).attr("fill",a.axisTextColor).attr("font-weight","bold").text(P.text)})}if(l.accelerators.length>0){const B=p.append("g").attr("class","wardley-accelerators");l.accelerators.forEach(P=>{const G=v(P.x),V=x(P.y),H=60,W=30,ie=20,j=` M ${G} ${V-W/2} - L ${G+Y-ie} ${V-W/2} - L ${G+Y-ie} ${V-W/2-8} - L ${G+Y} ${V} - L ${G+Y-ie} ${V+W/2+8} - L ${G+Y-ie} ${V+W/2} + L ${G+H-ie} ${V-W/2} + L ${G+H-ie} ${V-W/2-8} + L ${G+H} ${V} + L ${G+H-ie} ${V+W/2+8} + L ${G+H-ie} ${V+W/2} L ${G} ${V+W/2} Z - `;B.append("path").attr("d",K).attr("fill","white").attr("stroke",a.componentStroke).attr("stroke-width",1),B.append("text").attr("x",G+Y/2).attr("y",V+W/2+15).attr("text-anchor","middle").attr("font-size",10).attr("fill",a.axisTextColor).attr("font-weight","bold").text(P.name)})}if(l.deaccelerators.length>0){const B=p.append("g").attr("class","wardley-deaccelerators");l.deaccelerators.forEach(P=>{const G=v(P.x),V=T(P.y),Y=60,W=30,ie=20,K=` - M ${G+Y} ${V-W/2} + `;B.append("path").attr("d",j).attr("fill","white").attr("stroke",a.componentStroke).attr("stroke-width",1),B.append("text").attr("x",G+H/2).attr("y",V+W/2+15).attr("text-anchor","middle").attr("font-size",10).attr("fill",a.axisTextColor).attr("font-weight","bold").text(P.name)})}if(l.deaccelerators.length>0){const B=p.append("g").attr("class","wardley-deaccelerators");l.deaccelerators.forEach(P=>{const G=v(P.x),V=x(P.y),H=60,W=30,ie=20,j=` + M ${G+H} ${V-W/2} L ${G+ie} ${V-W/2} L ${G+ie} ${V-W/2-8} L ${G} ${V} L ${G+ie} ${V+W/2+8} L ${G+ie} ${V+W/2} - L ${G+Y} ${V+W/2} + L ${G+H} ${V+W/2} Z - `;B.append("path").attr("d",K).attr("fill","white").attr("stroke",a.componentStroke).attr("stroke-width",1),B.append("text").attr("x",G+Y/2).attr("y",V+W/2+15).attr("text-anchor","middle").attr("font-size",10).attr("fill",a.axisTextColor).attr("font-weight","bold").text(P.name)})}},"draw"),Cmt={draw:wmt},kmt=x(({wardley:t}={})=>{const e=w0(),r=lr(),n=ti(e,r.themeVariables),i=ti(n.wardley,t);return` + `;B.append("path").attr("d",j).attr("fill","white").attr("stroke",a.componentStroke).attr("stroke-width",1),B.append("text").attr("x",G+H/2).attr("y",V+W/2+15).attr("text-anchor","middle").attr("font-size",10).attr("fill",a.axisTextColor).attr("font-weight","bold").text(P.name)})}},"draw"),c4t={draw:l4t},u4t=T(({wardley:t}={})=>{const e=B0(),r=pr(),n=wi(e,r.themeVariables),i=wi(n.wardley,t);return` .wardley-background { fill: ${i.backgroundColor}; } @@ -3379,4 +3380,4 @@ Expecting `+ee.join(", ")+", got '"+(this.terminals_[V]||V)+"'":ne="Parse error .wardley-notes text { fill: ${i.axisTextColor}; } - `},"styles"),Emt={parser:Nve,db:vmt,renderer:Cmt,styles:kmt};const Smt=Object.freeze(Object.defineProperty({__proto__:null,diagram:Emt},Symbol.toStringTag,{value:"Module"})),Amt=Object.freeze(Object.defineProperty({__proto__:null,InfoModule:Epe,createInfoServices:Spe},Symbol.toStringTag,{value:"Module"})),_mt=Object.freeze(Object.defineProperty({__proto__:null,PacketModule:Ape,createPacketServices:_pe},Symbol.toStringTag,{value:"Module"})),Rmt=Object.freeze(Object.defineProperty({__proto__:null,PieModule:Rpe,createPieServices:Lpe},Symbol.toStringTag,{value:"Module"})),Lmt=Object.freeze(Object.defineProperty({__proto__:null,TreeViewModule:Ipe,createTreeViewServices:Dpe},Symbol.toStringTag,{value:"Module"})),Imt=Object.freeze(Object.defineProperty({__proto__:null,ArchitectureModule:Mpe,createArchitectureServices:Npe},Symbol.toStringTag,{value:"Module"})),Dmt=Object.freeze(Object.defineProperty({__proto__:null,GitGraphModule:Cpe,createGitGraphServices:kpe},Symbol.toStringTag,{value:"Module"})),Mmt=Object.freeze(Object.defineProperty({__proto__:null,EventModelingModule:zpe,createEventModelingServices:Gpe},Symbol.toStringTag,{value:"Module"})),Nmt=Object.freeze(Object.defineProperty({__proto__:null,RadarModule:npe,createRadarServices:ipe},Symbol.toStringTag,{value:"Module"})),Omt=Object.freeze(Object.defineProperty({__proto__:null,RailroadModule:spe,createRailroadServices:ope},Symbol.toStringTag,{value:"Module"})),$mt=Object.freeze(Object.defineProperty({__proto__:null,RailroadEbnfModule:cpe,createRailroadEbnfServices:upe},Symbol.toStringTag,{value:"Module"})),Pmt=Object.freeze(Object.defineProperty({__proto__:null,RailroadAbnfModule:hpe,createRailroadAbnfServices:dpe},Symbol.toStringTag,{value:"Module"})),Bmt=Object.freeze(Object.defineProperty({__proto__:null,RailroadPegModule:ppe,createRailroadPegServices:gpe},Symbol.toStringTag,{value:"Module"})),Fmt=Object.freeze(Object.defineProperty({__proto__:null,TreemapModule:ype,createTreemapServices:vpe},Symbol.toStringTag,{value:"Module"})),zmt=Object.freeze(Object.defineProperty({__proto__:null,WardleyModule:bpe,createWardleyServices:xpe},Symbol.toStringTag,{value:"Module"})),Gmt=Object.freeze(Object.defineProperty({__proto__:null,CynefinModule:Tpe,createCynefinServices:wpe},Symbol.toStringTag,{value:"Module"}))})(); + `},"styles"),h4t={parser:Z4e,db:i4t,renderer:c4t,styles:u4t};const d4t=Object.freeze(Object.defineProperty({__proto__:null,diagram:h4t},Symbol.toStringTag,{value:"Module"})),f4t=Object.freeze(Object.defineProperty({__proto__:null,InfoModule:qbe,createInfoServices:Vbe},Symbol.toStringTag,{value:"Module"})),p4t=Object.freeze(Object.defineProperty({__proto__:null,PacketModule:Wbe,createPacketServices:Ube},Symbol.toStringTag,{value:"Module"})),g4t=Object.freeze(Object.defineProperty({__proto__:null,PieModule:Hbe,createPieServices:Ybe},Symbol.toStringTag,{value:"Module"})),m4t=Object.freeze(Object.defineProperty({__proto__:null,TreeViewModule:Xbe,createTreeViewServices:jbe},Symbol.toStringTag,{value:"Module"})),y4t=Object.freeze(Object.defineProperty({__proto__:null,ArchitectureModule:Kbe,createArchitectureServices:Zbe},Symbol.toStringTag,{value:"Module"})),v4t=Object.freeze(Object.defineProperty({__proto__:null,GitGraphModule:zbe,createGitGraphServices:Gbe},Symbol.toStringTag,{value:"Module"})),b4t=Object.freeze(Object.defineProperty({__proto__:null,EventModelingModule:nxe,createEventModelingServices:ixe},Symbol.toStringTag,{value:"Module"})),x4t=Object.freeze(Object.defineProperty({__proto__:null,RadarModule:xbe,createRadarServices:Tbe},Symbol.toStringTag,{value:"Module"})),T4t=Object.freeze(Object.defineProperty({__proto__:null,RailroadModule:Cbe,createRailroadServices:kbe},Symbol.toStringTag,{value:"Module"})),w4t=Object.freeze(Object.defineProperty({__proto__:null,RailroadEbnfModule:Sbe,createRailroadEbnfServices:_be},Symbol.toStringTag,{value:"Module"})),C4t=Object.freeze(Object.defineProperty({__proto__:null,RailroadAbnfModule:Abe,createRailroadAbnfServices:Rbe},Symbol.toStringTag,{value:"Module"})),k4t=Object.freeze(Object.defineProperty({__proto__:null,RailroadPegModule:Ibe,createRailroadPegServices:Dbe},Symbol.toStringTag,{value:"Module"})),E4t=Object.freeze(Object.defineProperty({__proto__:null,TreemapModule:Nbe,createTreemapServices:$be},Symbol.toStringTag,{value:"Module"})),S4t=Object.freeze(Object.defineProperty({__proto__:null,WardleyModule:Obe,createWardleyServices:Pbe},Symbol.toStringTag,{value:"Module"})),_4t=Object.freeze(Object.defineProperty({__proto__:null,CynefinModule:Bbe,createCynefinServices:Fbe},Symbol.toStringTag,{value:"Module"}))})(); diff --git a/packages/web/package.json b/packages/web/package.json index b67550a..7bdbaea 100644 --- a/packages/web/package.json +++ b/packages/web/package.json @@ -18,7 +18,8 @@ "node": ">=18" }, "dependencies": { - "mermaid": "11.15.0" + "mermaid": "11.15.0", + "posthog-js": "^1.409.5" }, "devDependencies": { "@types/node": "^20.19.43", diff --git a/packages/web/src/main.ts b/packages/web/src/main.ts index e5b8c3b..55a0be4 100644 --- a/packages/web/src/main.ts +++ b/packages/web/src/main.ts @@ -1,3 +1,5 @@ +import { posthog } from "./posthog"; + const copyButtons = Array.from(document.querySelectorAll(".copy-command")); const copiedTimers = new WeakMap>(); const releaseBadge = document.querySelector("[data-release-badge]"); @@ -39,6 +41,7 @@ for (const copy of copyButtons) { label.textContent = "Copied"; clearTimeout(copiedTimers.get(copy)); await copyText(text); + posthog.capture("command_copied"); copiedTimers.set( copy, setTimeout(() => { diff --git a/packages/web/src/posthog.ts b/packages/web/src/posthog.ts new file mode 100644 index 0000000..e0740d6 --- /dev/null +++ b/packages/web/src/posthog.ts @@ -0,0 +1,29 @@ +import posthog from "posthog-js"; + +const token = import.meta.env.VITE_PUBLIC_POSTHOG_KEY; +const host = import.meta.env.VITE_PUBLIC_POSTHOG_HOST; + +if (!token) { + if (import.meta.env.DEV) { + throw new Error( + "VITE_PUBLIC_POSTHOG_KEY variable required by PostHog is missing or un-configured, this causes events to be silently missed. This error stops appearing once VITE_PUBLIC_POSTHOG_KEY is configured", + ); + } +} else if (!host) { + if (import.meta.env.DEV) { + throw new Error( + "VITE_PUBLIC_POSTHOG_HOST variable required by PostHog is missing or un-configured, this causes events to be silently missed. This error stops appearing once VITE_PUBLIC_POSTHOG_HOST is configured", + ); + } +} else { + posthog.init(token, { + api_host: host, + capture_exceptions: { + capture_unhandled_errors: true, + capture_unhandled_rejections: true, + capture_console_errors: false, + }, + }); +} + +export { posthog }; diff --git a/packages/web/src/viewer/app.js b/packages/web/src/viewer/app.js index 374d0dd..4b8d965 100644 --- a/packages/web/src/viewer/app.js +++ b/packages/web/src/viewer/app.js @@ -1,4 +1,6 @@ +import { posthog } from "../posthog"; + (function () { const workspace = document.querySelector("[data-note-workspace]"); const stackEl = document.querySelector("[data-note-stack]"); @@ -3531,6 +3533,9 @@ async function openTarget(targetPath, pushHistory, openBeside, highlightText, sourcePanel) { const source = sourcePanel || activePanel(); + posthog.capture("note_opened", { + open_mode: openBeside ? "beside" : "replace", + }); if (!source) { await openInitialNote(targetPath, pushHistory, highlightText); return; @@ -3568,6 +3573,7 @@ } async function closePanel(panel, pushHistory) { + posthog.capture("note_closed"); const before = panels(); const index = before.indexOf(panel); let nextPanel; @@ -4195,6 +4201,7 @@ const shiftOverride = event.shiftKey || searchResult.dataset.openBeside === "true"; const openBeside = shouldOpenBeside(shiftOverride); delete searchResult.dataset.openBeside; + posthog.capture("search_result_opened"); closeSearchResults(searchResult); openTarget(targetPath, true, openBeside, highlightFromHref(searchResult.getAttribute("href") || searchResult.href), activePanel()); return; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 4cb2e4d..c5ece8f 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -19,6 +19,9 @@ importers: mermaid: specifier: 11.15.0 version: 11.15.0 + posthog-js: + specifier: ^1.409.5 + version: 1.409.5 devDependencies: '@types/node': specifier: ^20.19.43 @@ -259,6 +262,15 @@ packages: cpu: [x64] os: [win32] + '@posthog/browser-common@0.3.1': + resolution: {integrity: sha512-1nhMVY1wnHADTg8tR9yvm+lPAz5ROxznfQlBtLzB2FFo4lp/LU8lk9KyFPsARDkBxCfYachsJfvRjocL1G/AJQ==} + + '@posthog/core@1.46.1': + resolution: {integrity: sha512-EoCFduRkvrg9E5ylMi4QnZCjlAdRJCq6tJouWfngBVR79XSI4iPvIWYA+CdzokAjk+TfSVBFVJ++4Im3r+T0Dg==} + + '@posthog/types@1.399.0': + resolution: {integrity: sha512-/WDwBzqIPko8VJ1B+0rlso2XQEz9+2sqtsY9Tqy3p1GhgTqsFakcz/PmMpAnA321LTEZVRcO6x5hAwABV4yrDw==} + '@rollup/rollup-android-arm-eabi@4.62.3': resolution: {integrity: sha512-c0wdcekXtQvvn5Tsrk/+op/gUArrbWaFduBnTLP2l1cKLSQs4diMWjJw3m6A0DdzT8dAAX95KpkJ3qynCePbmw==} cpu: [arm] @@ -567,6 +579,9 @@ packages: resolution: {integrity: sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww==} engines: {node: '>= 12'} + core-js@3.49.0: + resolution: {integrity: sha512-es1U2+YTtzpwkxVLwAFdSpaIMyQaq0PBgm3YD1W3Qpsn1NAmO3KSgZfu+oGSWVu6NvLHoHCV/aYcsE5wiB7ALg==} + cose-base@1.0.3: resolution: {integrity: sha512-s9whTXInMSgAp/NVXVNuVxVKzGH2qck3aQlVHxDCdAEPgtMKwc4Wq6/QKhgdEdgbLSi9rBTAcPoRa6JpiG4ksg==} @@ -778,6 +793,9 @@ packages: picomatch: optional: true + fflate@0.4.9: + resolution: {integrity: sha512-zdxgIEddhfsyCaWpJ2SdXEP8ZMrKJ6+5jl4OupODcywU0IhRk6gdXuVGcPICyfx2H97hVK7xmJtRLPjkxAX8Vw==} + fsevents@2.3.2: resolution: {integrity: sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==} engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} @@ -896,6 +914,20 @@ packages: resolution: {integrity: sha512-8RyVklq0owXUTa4xlpzu4l9AaVKIdQvAcOHZWaMh98HgySsUtxRVf/chRe3dsSLqb6i40BzGRzEUddRaI+9TSw==} engines: {node: ^10 || ^12 || >=14} + posthog-js@1.409.5: + resolution: {integrity: sha512-s1iJz+vq0YAluUD4OwLjUFIJt/9pqiiB6MITvHWIS16a7pqTJqbSLXsd5/8kJcIgfrOSZHe+mdYAXLYcJCS4LQ==} + + preact@10.29.7: + resolution: {integrity: sha512-DCHYrK/B10yUD3ZjLfhZ3WIE/9Vf9VFUODcRE2dRomTYDpJk6z6L9wecSfhfE6M9ZTHUdyQkoC46arIDhEV84Q==} + peerDependencies: + preact-render-to-string: '>=5' + peerDependenciesMeta: + preact-render-to-string: + optional: true + + query-selector-shadow-dom@1.0.1: + resolution: {integrity: sha512-lT5yCqEBgfoMYpf3F2xQRK7zEr1rhIIZuceDK6+xRkJQ4NMbHTwXqk4NkwDwQMNqXgG9r9fyHnzwNVs6zV5KRw==} + robust-predicates@3.0.3: resolution: {integrity: sha512-NS3levdsRIUOmiJ8FZWCP7LG3QpJyrs/TE0Zpf1yvZu8cAJJ6QMW92H1c7kWpdIHo8RvmLxN/o2JXTKHp74lUA==} @@ -1047,6 +1079,9 @@ packages: jsdom: optional: true + web-vitals@5.3.0: + resolution: {integrity: sha512-q6LWsLatGYZp5VGBIOvbTj6JBV2nOmC8KvWztXBmwJcfFAzhwKwbOxhUH306XY3CcaZDUlSmSuNPBsCn0bFu+g==} + why-is-node-running@2.3.0: resolution: {integrity: sha512-hUrmaWBdVDcxvYqnyh09zunKzROWjbZTiNy8dBEjkS7ehEDQibXJ7XvlmtbwuTclUiIyN+CyXQD4Vmko8fNm8w==} engines: {node: '>=8'} @@ -1179,6 +1214,17 @@ snapshots: '@oxlint/win32-x64@1.15.0': optional: true + '@posthog/browser-common@0.3.1': + dependencies: + '@posthog/core': 1.46.1 + '@posthog/types': 1.399.0 + + '@posthog/core@1.46.1': + dependencies: + '@posthog/types': 1.399.0 + + '@posthog/types@1.399.0': {} + '@rollup/rollup-android-arm-eabi@4.62.3': optional: true @@ -1458,6 +1504,8 @@ snapshots: commander@8.3.0: {} + core-js@3.49.0: {} + cose-base@1.0.3: dependencies: layout-base: 1.0.2 @@ -1709,6 +1757,8 @@ snapshots: optionalDependencies: picomatch: 4.0.5 + fflate@0.4.9: {} + fsevents@2.3.2: optional: true @@ -1821,6 +1871,24 @@ snapshots: picocolors: 1.1.1 source-map-js: 1.2.1 + posthog-js@1.409.5: + dependencies: + '@posthog/browser-common': 0.3.1 + '@posthog/core': 1.46.1 + '@posthog/types': 1.399.0 + core-js: 3.49.0 + dompurify: 3.4.12 + fflate: 0.4.9 + preact: 10.29.7 + query-selector-shadow-dom: 1.0.1 + web-vitals: 5.3.0 + transitivePeerDependencies: + - preact-render-to-string + + preact@10.29.7: {} + + query-selector-shadow-dom@1.0.1: {} + robust-predicates@3.0.3: {} rollup@4.62.3: @@ -1978,6 +2046,8 @@ snapshots: - tsx - yaml + web-vitals@5.3.0: {} + why-is-node-running@2.3.0: dependencies: siginfo: 2.0.0 diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 3337eaa..56d4a7e 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -1,5 +1,9 @@ packages: - "packages/*" +allowBuilds: + core-js: set this to true or false + esbuild: set this to true or false + onlyBuiltDependencies: - esbuild From 0ad6c2b9222ef1c48128e3e1bd90f6f4349a7dd7 Mon Sep 17 00:00:00 2001 From: "posthog-eu[bot]" <226701856+posthog-eu[bot]@users.noreply.github.com> Date: Sun, 2 Aug 2026 08:17:21 +0000 Subject: [PATCH 2/2] chore: configure PostHog environment variables for production Generated-By: PostHog Code Task-Id: 51fb10f1-b921-420e-909f-d184ae1d34c5 --- packages/web/.env | 2 ++ packages/web/.env.example | 2 ++ 2 files changed, 4 insertions(+) create mode 100644 packages/web/.env create mode 100644 packages/web/.env.example diff --git a/packages/web/.env b/packages/web/.env new file mode 100644 index 0000000..f2c51ed --- /dev/null +++ b/packages/web/.env @@ -0,0 +1,2 @@ +VITE_PUBLIC_POSTHOG_KEY=phc_DdrSDBCkEZqVKPSeTdgAFPjj2xhJrbWWoLJfGW8Wkp39 +VITE_PUBLIC_POSTHOG_HOST=https://eu.i.posthog.com diff --git a/packages/web/.env.example b/packages/web/.env.example new file mode 100644 index 0000000..7825511 --- /dev/null +++ b/packages/web/.env.example @@ -0,0 +1,2 @@ +VITE_PUBLIC_POSTHOG_KEY=phc_your_project_token +VITE_PUBLIC_POSTHOG_HOST=https://eu.i.posthog.com