You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
NewEduCoderBuild/96344.381edab0.async.js

10 lines
315 KiB

This file contains invisible Unicode characters!

This file contains invisible Unicode characters that may be processed differently from what appears below. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to reveal hidden characters.

!(function(){var $u=Object.defineProperty,Xu=Object.defineProperties;var Ku=Object.getOwnPropertyDescriptors;var ti=Object.getOwnPropertySymbols;var _u=Object.prototype.hasOwnProperty,Zu=Object.prototype.propertyIsEnumerable;var ur=Math.pow,Yr=(Ke,je,me)=>je in Ke?$u(Ke,je,{enumerable:!0,configurable:!0,writable:!0,value:me}):Ke[je]=me,kn=(Ke,je)=>{for(var me in je||(je={}))_u.call(je,me)&&Yr(Ke,me,je[me]);if(ti)for(var me of ti(je))Zu.call(je,me)&&Yr(Ke,me,je[me]);return Ke},$r=(Ke,je)=>Xu(Ke,Ku(je));var be=(Ke,je,me)=>Yr(Ke,typeof je!="symbol"?je+"":je,me);(function(){var Ke={78585:function(w,P,a){"use strict";var f,x=Object.defineProperty,E=T=>{throw TypeError(T)},b=Math.pow,v=(T,u,c)=>u in T?x(T,u,{enumerable:!0,configurable:!0,writable:!0,value:c}):T[u]=c,N=(T,u,c)=>v(T,typeof u!="symbol"?u+"":u,c),S=(T,u,c)=>u.has(T)||E("Cannot "+c),M=(T,u,c)=>(S(T,u,"read from private field"),c?c.call(T):u.get(T)),A=(T,u,c)=>u.has(T)?E("Cannot add the same private member more than once"):u instanceof WeakSet?u.add(T):u.set(T,c),I=(T,u,c,i)=>(S(T,u,"write to private field"),i?i.call(T,c):u.set(T,c),c),j=(T,u,c)=>(S(T,u,"access private method"),c),D,Y,K;f={value:!0};var ot=a(34634),nt=a(34402);const Q=" ".repeat(2),et=" ".repeat(4);function H(){return it(this)}function it(T,u={}){const{maxRows:c=15,maxColumns:i=10,maxNumSize:l=8,padMinus:m="auto"}=u;return`${T.constructor.name} {
${Q}[
${et}${at(T,c,i,l,m)}
${Q}]
${Q}rows: ${T.rows}
${Q}columns: ${T.columns}
}`}function at(T,u,c,i,l){const{rows:m,columns:B}=T,U=Math.min(m,u),V=Math.min(B,c),G=[];if(l==="auto"){l=!1;t:for(let rt=0;rt<U;rt++)for(let _=0;_<V;_++)if(T.get(rt,_)<0){l=!0;break t}}for(let rt=0;rt<U;rt++){let _=[];for(let lt=0;lt<V;lt++)_.push(ft(T.get(rt,lt),i,l));G.push(`${_.join(" ")}`)}return V!==B&&(G[G.length-1]+=` ... ${B-c} more columns`),U!==m&&G.push(`... ${m-u} more rows`),G.join(`
${et}`)}function ft(T,u,c){return(T>=0&&c?` ${ht(T,u-1)}`:ht(T,u)).padEnd(u)}function ht(T,u){let c=T.toString();if(c.length<=u)return c;let i=T.toFixed(u);if(i.length>u&&(i=T.toFixed(Math.max(0,u-(i.length-u)))),i.length<=u&&!i.startsWith("0.000")&&!i.startsWith("-0.000"))return i;let l=T.toExponential(u);return l.length>u&&(l=T.toExponential(Math.max(0,u-(l.length-u)))),l.slice(0)}function dt(T,u){T.prototype.add=function(i){return typeof i=="number"?this.addS(i):this.addM(i)},T.prototype.addS=function(i){for(let l=0;l<this.rows;l++)for(let m=0;m<this.columns;m++)this.set(l,m,this.get(l,m)+i);return this},T.prototype.addM=function(i){if(i=u.checkMatrix(i),this.rows!==i.rows||this.columns!==i.columns)throw new RangeError("Matrices dimensions must be equal");for(let l=0;l<this.rows;l++)for(let m=0;m<this.columns;m++)this.set(l,m,this.get(l,m)+i.get(l,m));return this},T.add=function(i,l){return new u(i).add(l)},T.prototype.sub=function(i){return typeof i=="number"?this.subS(i):this.subM(i)},T.prototype.subS=function(i){for(let l=0;l<this.rows;l++)for(let m=0;m<this.columns;m++)this.set(l,m,this.get(l,m)-i);return this},T.prototype.subM=function(i){if(i=u.checkMatrix(i),this.rows!==i.rows||this.columns!==i.columns)throw new RangeError("Matrices dimensions must be equal");for(let l=0;l<this.rows;l++)for(let m=0;m<this.columns;m++)this.set(l,m,this.get(l,m)-i.get(l,m));return this},T.sub=function(i,l){return new u(i).sub(l)},T.prototype.subtract=T.prototype.sub,T.prototype.subtractS=T.prototype.subS,T.prototype.subtractM=T.prototype.subM,T.subtract=T.sub,T.prototype.mul=function(i){return typeof i=="number"?this.mulS(i):this.mulM(i)},T.prototype.mulS=function(i){for(let l=0;l<this.rows;l++)for(let m=0;m<this.columns;m++)this.set(l,m,this.get(l,m)*i);return this},T.prototype.mulM=function(i){if(i=u.checkMatrix(i),this.rows!==i.rows||this.columns!==i.columns)throw new RangeError("Matrices dimensions must be equal");for(let l=0;l<this.rows;l++)for(let m=0;m<this.columns;m++)this.set(l,m,this.get(l,m)*i.get(l,m));return this},T.mul=function(i,l){return new u(i).mul(l)},T.prototype.multiply=T.prototype.mul,T.prototype.multiplyS=T.prototype.mulS,T.prototype.multiplyM=T.prototype.mulM,T.multiply=T.mul,T.prototype.div=function(i){return typeof i=="number"?this.divS(i):this.divM(i)},T.prototype.divS=function(i){for(let l=0;l<this.rows;l++)for(let m=0;m<this.columns;m++)this.set(l,m,this.get(l,m)/i);return this},T.prototype.divM=function(i){if(i=u.checkMatrix(i),this.rows!==i.rows||this.columns!==i.columns)throw new RangeError("Matrices dimensions must be equal");for(let l=0;l<this.rows;l++)for(let m=0;m<this.columns;m++)this.set(l,m,this.get(l,m)/i.get(l,m));return this},T.div=function(i,l){return new u(i).div(l)},T.prototype.divide=T.prototype.div,T.prototype.divideS=T.prototype.divS,T.prototype.divideM=T.prototype.divM,T.divide=T.div,T.prototype.mod=function(i){return typeof i=="number"?this.modS(i):this.modM(i)},T.prototype.modS=function(i){for(let l=0;l<this.rows;l++)for(let m=0;m<this.columns;m++)this.set(l,m,this.get(l,m)%i);return this},T.prototype.modM=function(i){if(i=u.checkMatrix(i),this.rows!==i.rows||this.columns!==i.columns)throw new RangeError("Matrices dimensions must be equal");for(let l=0;l<this.rows;l++)for(let m=0;m<this.columns;m++)this.set(l,m,this.get(l,m)%i.get(l,m));return this},T.mod=function(i,l){return new u(i).mod(l)},T.prototype.modulus=T.prototype.mod,T.prototype.modulusS=T.prototype.modS,T.prototype.modulusM=T.prototype.modM,T.modulus=T.mod,T.prototype.and=function(i){return typeof i=="number"?this.andS(i):this.andM(i)},T.prototype.andS=function(i){for(let l=0;l<this.rows;l++)for(let m=0;m<this.columns;m++)this.set(l,m,this.get(l,m)&i);return this},T.prototype.andM=function(i){if(i=u.checkMatrix(i),this.rows!==i.rows||this.columns!==i.columns)throw new RangeError("Matrices dimensions must be equal");for(let l=0;l<this.rows;l++)for(let m=0;m<this.columns;m++)this.set(l,m,this.get(l,m)&i.get(l,m));return this},T.and=function(i,l){return new u(i).and(l)},T.prototype.or=function(i){return typeof i=="number"?this.orS(i):this.orM(i)},T.prototype.orS=function(i){for(let l=0;l<this.rows;l++)for(let m=0;m<this.columns;m++)this.set(l,m,this.get(l,m)|i);return this},T.prototype.orM=function(i){if(i=u.checkMatrix(i),this.rows!==i.rows||this.columns!==i.columns)throw new RangeError("Matrices dimensions must be equal");for(let l=0;l<this.rows;l++)for(let m=0;m<this.columns;m++)this.set(l,m,this.get(l,m)|i.get(l,m));return this},T.or=function(i,l){return new u(i).or(l)},T.prototype.xor=function(i){return typeof i=="number"?this.xorS(i):this.xorM(i)},T.prototype.xorS=function(i){for(let l=0;l<this.rows;l++)for(let m=0;m<this.columns;m++)this.set(l,m,this.get(l,m)^i);return this},T.prototype.xorM=function(i){if(i=u.checkMatrix(i),this.rows!==i.rows||this.columns!==i.columns)throw new RangeError("Matrices dimensions must be equal");for(let l=0;l<this.rows;l++)for(let m=0;m<this.columns;m++)this.set(l,m,this.get(l,m)^i.get(l,m));return this},T.xor=function(i,l){return new u(i).xor(l)},T.prototype.leftShift=function(i){return typeof i=="number"?this.leftShiftS(i):this.leftShiftM(i)},T.prototype.leftShiftS=function(i){for(let l=0;l<this.rows;l++)for(let m=0;m<this.columns;m++)this.set(l,m,this.get(l,m)<<i);return this},T.prototype.leftShiftM=function(i){if(i=u.checkMatrix(i),this.rows!==i.rows||this.columns!==i.columns)throw new RangeError("Matrices dimensions must be equal");for(let l=0;l<this.rows;l++)for(let m=0;m<this.columns;m++)this.set(l,m,this.get(l,m)<<i.get(l,m));return this},T.leftShift=function(i,l){return new u(i).leftShift(l)},T.prototype.signPropagatingRightShift=function(i){return typeof i=="number"?this.signPropagatingRightShiftS(i):this.signPropagatingRightShiftM(i)},T.prototype.signPropagatingRightShiftS=function(i){for(let l=0;l<this.rows;l++)for(let m=0;m<this.columns;m++)this.set(l,m,this.get(l,m)>>i);return this},T.prototype.signPropagatingRightShiftM=function(i){if(i=u.checkMatrix(i),this.rows!==i.rows||this.columns!==i.columns)throw new RangeError("Matrices dimensions must be equal");for(let l=0;l<this.rows;l++)for(let m=0;m<this.columns;m++)this.set(l,m,this.get(l,m)>>i.get(l,m));return this},T.signPropagatingRightShift=function(i,l){return new u(i).signPropagatingRightShift(l)},T.prototype.rightShift=function(i){return typeof i=="number"?this.rightShiftS(i):this.rightShiftM(i)},T.prototype.rightShiftS=function(i){for(let l=0;l<this.rows;l++)for(let m=0;m<this.columns;m++)this.set(l,m,this.get(l,m)>>>i);return this},T.prototype.rightShiftM=function(i){if(i=u.checkMatrix(i),this.rows!==i.rows||this.columns!==i.columns)throw new RangeError("Matrices dimensions must be equal");for(let l=0;l<this.rows;l++)for(let m=0;m<this.columns;m++)this.set(l,m,this.get(l,m)>>>i.get(l,m));return this},T.rightShift=function(i,l){return new u(i).rightShift(l)},T.prototype.zeroFillRightShift=T.prototype.rightShift,T.prototype.zeroFillRightShiftS=T.prototype.rightShiftS,T.prototype.zeroFillRightShiftM=T.prototype.rightShiftM,T.zeroFillRightShift=T.rightShift,T.prototype.not=function(){for(let i=0;i<this.rows;i++)for(let l=0;l<this.columns;l++)this.set(i,l,~this.get(i,l));return this},T.not=function(i){return new u(i).not()},T.prototype.abs=function(){for(let i=0;i<this.rows;i++)for(let l=0;l<this.columns;l++)this.set(i,l,Math.abs(this.get(i,l)));return this},T.abs=function(i){return new u(i).abs()},T.prototype.acos=function(){for(let i=0;i<this.rows;i++)for(let l=0;l<this.columns;l++)this.set(i,l,Math.acos(this.get(i,l)));return this},T.acos=function(i){return new u(i).acos()},T.prototype.acosh=function(){for(let i=0;i<this.rows;i++)for(let l=0;l<this.columns;l++)this.set(i,l,Math.acosh(this.get(i,l)));return this},T.acosh=function(i){return new u(i).acosh()},T.prototype.asin=function(){for(let i=0;i<this.rows;i++)for(let l=0;l<this.columns;l++)this.set(i,l,Math.asin(this.get(i,l)));return this},T.asin=function(i){return new u(i).asin()},T.prototype.asinh=function(){for(let i=0;i<this.rows;i++)for(let l=0;l<this.columns;l++)this.set(i,l,Math.asinh(this.get(i,l)));return this},T.asinh=function(i){return new u(i).asinh()},T.prototype.atan=function(){for(let i=0;i<this.rows;i++)for(let l=0;l<this.columns;l++)this.set(i,l,Math.atan(this.get(i,l)));return this},T.atan=function(i){return new u(i).atan()},T.prototype.atanh=function(){for(let i=0;i<this.rows;i++)for(let l=0;l<this.columns;l++)this.set(i,l,Math.atanh(this.get(i,l)));return this},T.atanh=function(i){return new u(i).atanh()},T.prototype.cbrt=function(){for(let i=0;i<this.rows;i++)for(let l=0;l<this.columns;l++)this.set(i,l,Math.cbrt(this.get(i,l)));return this},T.cbrt=function(i){return new u(i).cbrt()},T.prototype.ceil=function(){for(let i=0;i<this.rows;i++)for(let l=0;l<this.columns;l++)this.set(i,l,Math.ceil(this.get(i,l)));return this},T.ceil=function(i){return new u(i).ceil()},T.prototype.clz32=function(){for(let i=0;i<this.rows;i++)for(let l=0;l<this.columns;l++)this.set(i,l,Math.clz32(this.get(i,l)));return this},T.clz32=function(i){return new u(i).clz32()},T.prototype.cos=function(){for(let i=0;i<this.rows;i++)for(let l=0;l<this.columns;l++)this.set(i,l,Math.cos(this.get(i,l)));return this},T.cos=function(i){return new u(i).cos()},T.prototype.cosh=function(){for(let i=0;i<this.rows;i++)for(let l=0;l<this.columns;l++)this.set(i,l,Math.cosh(this.get(i,l)));return this},T.cosh=function(i){return new u(i).cosh()},T.prototype.exp=function(){for(let i=0;i<this.rows;i++)for(let l=0;l<this.columns;l++)this.set(i,l,Math.exp(this.get(i,l)));return this},T.exp=function(i){return new u(i).exp()},T.prototype.expm1=function(){for(let i=0;i<this.rows;i++)for(let l=0;l<this.columns;l++)this.set(i,l,Math.expm1(this.get(i,l)));return this},T.expm1=function(i){return new u(i).expm1()},T.prototype.floor=function(){for(let i=0;i<this.rows;i++)for(let l=0;l<this.columns;l++)this.set(i,l,Math.floor(this.get(i,l)));return this},T.floor=function(i){return new u(i).floor()},T.prototype.fround=function(){for(let i=0;i<this.rows;i++)for(let l=0;l<this.columns;l++)this.set(i,l,Math.fround(this.get(i,l)));return this},T.fround=function(i){return new u(i).fround()},T.prototype.log=function(){for(let i=0;i<this.rows;i++)for(let l=0;l<this.columns;l++)this.set(i,l,Math.log(this.get(i,l)));return this},T.log=function(i){return new u(i).log()},T.prototype.log1p=function(){for(let i=0;i<this.rows;i++)for(let l=0;l<this.columns;l++)this.set(i,l,Math.log1p(this.get(i,l)));return this},T.log1p=function(i){return new u(i).log1p()},T.prototype.log10=function(){for(let i=0;i<this.rows;i++)for(let l=0;l<this.columns;l++)this.set(i,l,Math.log10(this.get(i,l)));return this},T.log10=function(i){return new u(i).log10()},T.prototype.log2=function(){for(let i=0;i<this.rows;i++)for(let l=0;l<this.columns;l++)this.set(i,l,Math.log2(this.get(i,l)));return this},T.log2=function(i){return new u(i).log2()},T.prototype.round=function(){for(let i=0;i<this.rows;i++)for(let l=0;l<this.columns;l++)this.set(i,l,Math.round(this.get(i,l)));return this},T.round=function(i){return new u(i).round()},T.prototype.sign=function(){for(let i=0;i<this.rows;i++)for(let l=0;l<this.columns;l++)this.set(i,l,Math.sign(this.get(i,l)));return this},T.sign=function(i){return new u(i).sign()},T.prototype.sin=function(){for(let i=0;i<this.rows;i++)for(let l=0;l<this.columns;l++)this.set(i,l,Math.sin(this.get(i,l)));return this},T.sin=function(i){return new u(i).sin()},T.prototype.sinh=function(){for(let i=0;i<this.rows;i++)for(let l=0;l<this.columns;l++)this.set(i,l,Math.sinh(this.get(i,l)));return this},T.sinh=function(i){return new u(i).sinh()},T.prototype.sqrt=function(){for(let i=0;i<this.rows;i++)for(let l=0;l<this.columns;l++)this.set(i,l,Math.sqrt(this.get(i,l)));return this},T.sqrt=function(i){return new u(i).sqrt()},T.prototype.tan=function(){for(let i=0;i<this.rows;i++)for(let l=0;l<this.columns;l++)this.set(i,l,Math.tan(this.get(i,l)));return this},T.tan=function(i){return new u(i).tan()},T.prototype.tanh=function(){for(let i=0;i<this.rows;i++)for(let l=0;l<this.columns;l++)this.set(i,l,Math.tanh(this.get(i,l)));return this},T.tanh=function(i){return new u(i).tanh()},T.prototype.trunc=function(){for(let i=0;i<this.rows;i++)for(let l=0;l<this.columns;l++)this.set(i,l,Math.trunc(this.get(i,l)));return this},T.trunc=function(i){return new u(i).trunc()},T.pow=function(i,l){return new u(i).pow(l)},T.prototype.pow=function(i){return typeof i=="number"?this.powS(i):this.powM(i)},T.prototype.powS=function(i){for(let l=0;l<this.rows;l++)for(let m=0;m<this.columns;m++)this.set(l,m,b(this.get(l,m),i));return this},T.prototype.powM=function(i){if(i=u.checkMatrix(i),this.rows!==i.rows||this.columns!==i.columns)throw new RangeError("Matrices dimensions must be equal");for(let l=0;l<this.rows;l++)for(let m=0;m<this.columns;m++)this.set(l,m,b(this.get(l,m),i.get(l,m)));return this}}function xt(T,u,c){let i=c?T.rows:T.rows-1;if(u<0||u>i)throw new RangeError("Row index out of range")}function yt(T,u,c){let i=c?T.columns:T.columns-1;if(u<0||u>i)throw new RangeError("Column index out of range")}function Nt(T,u){if(u.to1DArray&&(u=u.to1DArray()),u.length!==T.columns)throw new RangeError("vector size must be the same as the number of columns");return u}function Ot(T,u){if(u.to1DArray&&(u=u.to1DArray()),u.length!==T.rows)throw new RangeError("vector size must be the same as the number of rows");return u}function Bt(T,u){if(!ot.isAnyArray(u))throw new TypeError("row indices must be an array");for(let c=0;c<u.length;c++)if(u[c]<0||u[c]>=T.rows)throw new RangeError("row indices are out of range")}function Vt(T,u){if(!ot.isAnyArray(u))throw new TypeError("column indices must be an array");for(let c=0;c<u.length;c++)if(u[c]<0||u[c]>=T.columns)throw new RangeError("column indices are out of range")}function Ht(T,u,c,i,l){if(arguments.length!==5)throw new RangeError("expected 4 arguments");if(ye("startRow",u),ye("endRow",c),ye("startColumn",i),ye("endColumn",l),u>c||i>l||u<0||u>=T.rows||c<0||c>=T.rows||i<0||i>=T.columns||l<0||l>=T.columns)throw new RangeError("Submatrix indices are out of range")}function ee(T,u=0){let c=[];for(let i=0;i<T;i++)c.push(u);return c}function ye(T,u){if(typeof u!="number")throw new TypeError(`${T} must be a number`)}function $e(T){if(T.isEmpty())throw new Error("Empty matrix has no elements to index")}function nn(T){let u=ee(T.rows);for(let c=0;c<T.rows;++c)for(let i=0;i<T.columns;++i)u[c]+=T.get(c,i);return u}function Mn(T){let u=ee(T.columns);for(let c=0;c<T.rows;++c)for(let i=0;i<T.columns;++i)u[i]+=T.get(c,i);return u}function Sn(T){let u=0;for(let c=0;c<T.rows;c++)for(let i=0;i<T.columns;i++)u+=T.get(c,i);return u}function cn(T){let u=ee(T.rows,1);for(let c=0;c<T.rows;++c)for(let i=0;i<T.columns;++i)u[c]*=T.get(c,i);return u}function Je(T){let u=ee(T.columns,1);for(let c=0;c<T.rows;++c)for(let i=0;i<T.columns;++i)u[i]*=T.get(c,i);return u}function an(T){let u=1;for(let c=0;c<T.rows;c++)for(let i=0;i<T.columns;i++)u*=T.get(c,i);return u}function gt(T,u,c){const i=T.rows,l=T.columns,m=[];for(let B=0;B<i;B++){let U=0,V=0,G=0;for(let rt=0;rt<l;rt++)G=T.get(B,rt)-c[B],U+=G,V+=G*G;u?m.push((V-U*U/l)/(l-1)):m.push((V-U*U/l)/l)}return m}function vt(T,u,c){const i=T.rows,l=T.columns,m=[];for(let B=0;B<l;B++){let U=0,V=0,G=0;for(let rt=0;rt<i;rt++)G=T.get(rt,B)-c[B],U+=G,V+=G*G;u?m.push((V-U*U/i)/(i-1)):m.push((V-U*U/i)/i)}return m}function At(T,u,c){const i=T.rows,l=T.columns,m=i*l;let B=0,U=0,V=0;for(let G=0;G<i;G++)for(let rt=0;rt<l;rt++)V=T.get(G,rt)-c,B+=V,U+=V*V;return u?(U-B*B/m)/(m-1):(U-B*B/m)/m}function Ft(T,u){for(let c=0;c<T.rows;c++)for(let i=0;i<T.columns;i++)T.set(c,i,T.get(c,i)-u[c])}function qt(T,u){for(let c=0;c<T.rows;c++)for(let i=0;i<T.columns;i++)T.set(c,i,T.get(c,i)-u[i])}function ue(T,u){for(let c=0;c<T.rows;c++)for(let i=0;i<T.columns;i++)T.set(c,i,T.get(c,i)-u)}function he(T){const u=[];for(let c=0;c<T.rows;c++){let i=0;for(let l=0;l<T.columns;l++)i+=b(T.get(c,l),2)/(T.columns-1);u.push(Math.sqrt(i))}return u}function Ie(T,u){for(let c=0;c<T.rows;c++)for(let i=0;i<T.columns;i++)T.set(c,i,T.get(c,i)/u[c])}function pn(T){const u=[];for(let c=0;c<T.columns;c++){let i=0;for(let l=0;l<T.rows;l++)i+=b(T.get(l,c),2)/(T.rows-1);u.push(Math.sqrt(i))}return u}function De(T,u){for(let c=0;c<T.rows;c++)for(let i=0;i<T.columns;i++)T.set(c,i,T.get(c,i)/u[i])}function Me(T){const u=T.size-1;let c=0;for(let i=0;i<T.columns;i++)for(let l=0;l<T.rows;l++)c+=b(T.get(l,i),2)/u;return Math.sqrt(c)}function se(T,u){for(let c=0;c<T.rows;c++)for(let i=0;i<T.columns;i++)T.set(c,i,T.get(c,i)/u)}class Wt{static from1DArray(u,c,i){if(u*c!==i.length)throw new RangeError("data length does not match given dimensions");let m=new It(u,c);for(let B=0;B<u;B++)for(let U=0;U<c;U++)m.set(B,U,i[B*c+U]);return m}static rowVector(u){let c=new It(1,u.length);for(let i=0;i<u.length;i++)c.set(0,i,u[i]);return c}static columnVector(u){let c=new It(u.length,1);for(let i=0;i<u.length;i++)c.set(i,0,u[i]);return c}static zeros(u,c){return new It(u,c)}static ones(u,c){return new It(u,c).fill(1)}static rand(u,c,i={}){if(typeof i!="object")throw new TypeError("options must be an object");const{random:l=Math.random}=i;let m=new It(u,c);for(let B=0;B<u;B++)for(let U=0;U<c;U++)m.set(B,U,l());return m}static randInt(u,c,i={}){if(typeof i!="object")throw new TypeError("options must be an object");const{min:l=0,max:m=1e3,random:B=Math.random}=i;if(!Number.isInteger(l))throw new TypeError("min must be an integer");if(!Number.isInteger(m))throw new TypeError("max must be an integer");if(l>=m)throw new RangeError("min must be smaller than max");let U=m-l,V=new It(u,c);for(let G=0;G<u;G++)for(let rt=0;rt<c;rt++){let _=l+Math.round(B()*U);V.set(G,rt,_)}return V}static eye(u,c,i){c===void 0&&(c=u),i===void 0&&(i=1);let l=Math.min(u,c),m=this.zeros(u,c);for(let B=0;B<l;B++)m.set(B,B,i);return m}static diag(u,c,i){let l=u.length;c===void 0&&(c=l),i===void 0&&(i=c);let m=Math.min(l,c,i),B=this.zeros(c,i);for(let U=0;U<m;U++)B.set(U,U,u[U]);return B}static min(u,c){u=this.checkMatrix(u),c=this.checkMatrix(c);let i=u.rows,l=u.columns,m=new It(i,l);for(let B=0;B<i;B++)for(let U=0;U<l;U++)m.set(B,U,Math.min(u.get(B,U),c.get(B,U)));return m}static max(u,c){u=this.checkMatrix(u),c=this.checkMatrix(c);let i=u.rows,l=u.columns,m=new this(i,l);for(let B=0;B<i;B++)for(let U=0;U<l;U++)m.set(B,U,Math.max(u.get(B,U),c.get(B,U)));return m}static checkMatrix(u){return Wt.isMatrix(u)?u:new It(u)}static isMatrix(u){return u!=null&&u.klass==="Matrix"}get size(){return this.rows*this.columns}apply(u){if(typeof u!="function")throw new TypeError("callback must be a function");for(let c=0;c<this.rows;c++)for(let i=0;i<this.columns;i++)u.call(this,c,i);return this}to1DArray(){let u=[];for(let c=0;c<this.rows;c++)for(let i=0;i<this.columns;i++)u.push(this.get(c,i));return u}to2DArray(){let u=[];for(let c=0;c<this.rows;c++){u.push([]);for(let i=0;i<this.columns;i++)u[c].push(this.get(c,i))}return u}toJSON(){return this.to2DArray()}isRowVector(){return this.rows===1}isColumnVector(){return this.columns===1}isVector(){return this.rows===1||this.columns===1}isSquare(){return this.rows===this.columns}isEmpty(){return this.rows===0||this.columns===0}isSymmetric(){if(this.isSquare()){for(let u=0;u<this.rows;u++)for(let c=0;c<=u;c++)if(this.get(u,c)!==this.get(c,u))return!1;return!0}return!1}isDistance(){if(!this.isSymmetric())return!1;for(let u=0;u<this.rows;u++)if(this.get(u,u)!==0)return!1;return!0}isEchelonForm(){let u=0,c=0,i=-1,l=!0,m=!1;for(;u<this.rows&&l;){for(c=0,m=!1;c<this.columns&&m===!1;)this.get(u,c)===0?c++:this.get(u,c)===1&&c>i?(m=!0,i=c):(l=!1,m=!0);u++}return l}isReducedEchelonForm(){let u=0,c=0,i=-1,l=!0,m=!1;for(;u<this.rows&&l;){for(c=0,m=!1;c<this.columns&&m===!1;)this.get(u,c)===0?c++:this.get(u,c)===1&&c>i?(m=!0,i=c):(l=!1,m=!0);for(let B=c+1;B<this.rows;B++)this.get(u,B)!==0&&(l=!1);u++}return l}echelonForm(){let u=this.clone(),c=0,i=0;for(;c<u.rows&&i<u.columns;){let l=c;for(let m=c;m<u.rows;m++)u.get(m,i)>u.get(l,i)&&(l=m);if(u.get(l,i)===0)i++;else{u.swapRows(c,l);let m=u.get(c,i);for(let B=i;B<u.columns;B++)u.set(c,B,u.get(c,B)/m);for(let B=c+1;B<u.rows;B++){let U=u.get(B,i)/u.get(c,i);u.set(B,i,0);for(let V=i+1;V<u.columns;V++)u.set(B,V,u.get(B,V)-u.get(c,V)*U)}c++,i++}}return u}reducedEchelonForm(){let u=this.echelonForm(),c=u.columns,i=u.rows,l=i-1;for(;l>=0;)if(u.maxRow(l)===0)l--;else{let m=0,B=!1;for(;m<i&&B===!1;)u.get(l,m)===1?B=!0:m++;for(let U=0;U<l;U++){let V=u.get(U,m);for(let G=m;G<c;G++){let rt=u.get(U,G)-V*u.get(l,G);u.set(U,G,rt)}}l--}return u}set(){throw new Error("set method is unimplemented")}get(){throw new Error("get method is unimplemented")}repeat(u={}){if(typeof u!="object")throw new TypeError("options must be an object");const{rows:c=1,columns:i=1}=u;if(!Number.isInteger(c)||c<=0)throw new TypeError("rows must be a positive integer");if(!Number.isInteger(i)||i<=0)throw new TypeError("columns must be a positive integer");let l=new It(this.rows*c,this.columns*i);for(let m=0;m<c;m++)for(let B=0;B<i;B++)l.setSubMatrix(this,this.rows*m,this.columns*B);return l}fill(u){for(let c=0;c<this.rows;c++)for(let i=0;i<this.columns;i++)this.set(c,i,u);return this}neg(){return this.mulS(-1)}getRow(u){xt(this,u);let c=[];for(let i=0;i<this.columns;i++)c.push(this.get(u,i));return c}getRowVector(u){return It.rowVector(this.getRow(u))}setRow(u,c){xt(this,u),c=Nt(this,c);for(let i=0;i<this.columns;i++)this.set(u,i,c[i]);return this}swapRows(u,c){xt(this,u),xt(this,c);for(let i=0;i<this.columns;i++){let l=this.get(u,i);this.set(u,i,this.get(c,i)),this.set(c,i,l)}return this}getColumn(u){yt(this,u);let c=[];for(let i=0;i<this.rows;i++)c.push(this.get(i,u));return c}getColumnVector(u){return It.columnVector(this.getColumn(u))}setColumn(u,c){yt(this,u),c=Ot(this,c);for(let i=0;i<this.rows;i++)this.set(i,u,c[i]);return this}swapColumns(u,c){yt(this,u),yt(this,c);for(let i=0;i<this.rows;i++){let l=this.get(i,u);this.set(i,u,this.get(i,c)),this.set(i,c,l)}return this}addRowVector(u){u=Nt(this,u);for(let c=0;c<this.rows;c++)for(let i=0;i<this.columns;i++)this.set(c,i,this.get(c,i)+u[i]);return this}subRowVector(u){u=Nt(this,u);for(let c=0;c<this.rows;c++)for(let i=0;i<this.columns;i++)this.set(c,i,this.get(c,i)-u[i]);return this}mulRowVector(u){u=Nt(this,u);for(let c=0;c<this.rows;c++)for(let i=0;i<this.columns;i++)this.set(c,i,this.get(c,i)*u[i]);return this}divRowVector(u){u=Nt(this,u);for(let c=0;c<this.rows;c++)for(let i=0;i<this.columns;i++)this.set(c,i,this.get(c,i)/u[i]);return this}addColumnVector(u){u=Ot(this,u);for(let c=0;c<this.rows;c++)for(let i=0;i<this.columns;i++)this.set(c,i,this.get(c,i)+u[c]);return this}subColumnVector(u){u=Ot(this,u);for(let c=0;c<this.rows;c++)for(let i=0;i<this.columns;i++)this.set(c,i,this.get(c,i)-u[c]);return this}mulColumnVector(u){u=Ot(this,u);for(let c=0;c<this.rows;c++)for(let i=0;i<this.columns;i++)this.set(c,i,this.get(c,i)*u[c]);return this}divColumnVector(u){u=Ot(this,u);for(let c=0;c<this.rows;c++)for(let i=0;i<this.columns;i++)this.set(c,i,this.get(c,i)/u[c]);return this}mulRow(u,c){xt(this,u);for(let i=0;i<this.columns;i++)this.set(u,i,this.get(u,i)*c);return this}mulColumn(u,c){yt(this,u);for(let i=0;i<this.rows;i++)this.set(i,u,this.get(i,u)*c);return this}max(u){if(this.isEmpty())return NaN;switch(u){case"row":{const c=new Array(this.rows).fill(Number.NEGATIVE_INFINITY);for(let i=0;i<this.rows;i++)for(let l=0;l<this.columns;l++)this.get(i,l)>c[i]&&(c[i]=this.get(i,l));return c}case"column":{const c=new Array(this.columns).fill(Number.NEGATIVE_INFINITY);for(let i=0;i<this.rows;i++)for(let l=0;l<this.columns;l++)this.get(i,l)>c[l]&&(c[l]=this.get(i,l));return c}case void 0:{let c=this.get(0,0);for(let i=0;i<this.rows;i++)for(let l=0;l<this.columns;l++)this.get(i,l)>c&&(c=this.get(i,l));return c}default:throw new Error(`invalid option: ${u}`)}}maxIndex(){$e(this);let u=this.get(0,0),c=[0,0];for(let i=0;i<this.rows;i++)for(let l=0;l<this.columns;l++)this.get(i,l)>u&&(u=this.get(i,l),c[0]=i,c[1]=l);return c}min(u){if(this.isEmpty())return NaN;switch(u){case"row":{const c=new Array(this.rows).fill(Number.POSITIVE_INFINITY);for(let i=0;i<this.rows;i++)for(let l=0;l<this.columns;l++)this.get(i,l)<c[i]&&(c[i]=this.get(i,l));return c}case"column":{const c=new Array(this.columns).fill(Number.POSITIVE_INFINITY);for(let i=0;i<this.rows;i++)for(let l=0;l<this.columns;l++)this.get(i,l)<c[l]&&(c[l]=this.get(i,l));return c}case void 0:{let c=this.get(0,0);for(let i=0;i<this.rows;i++)for(let l=0;l<this.columns;l++)this.get(i,l)<c&&(c=this.get(i,l));return c}default:throw new Error(`invalid option: ${u}`)}}minIndex(){$e(this);let u=this.get(0,0),c=[0,0];for(let i=0;i<this.rows;i++)for(let l=0;l<this.columns;l++)this.get(i,l)<u&&(u=this.get(i,l),c[0]=i,c[1]=l);return c}maxRow(u){if(xt(this,u),this.isEmpty())return NaN;let c=this.get(u,0);for(let i=1;i<this.columns;i++)this.get(u,i)>c&&(c=this.get(u,i));return c}maxRowIndex(u){xt(this,u),$e(this);let c=this.get(u,0),i=[u,0];for(let l=1;l<this.columns;l++)this.get(u,l)>c&&(c=this.get(u,l),i[1]=l);return i}minRow(u){if(xt(this,u),this.isEmpty())return NaN;let c=this.get(u,0);for(let i=1;i<this.columns;i++)this.get(u,i)<c&&(c=this.get(u,i));return c}minRowIndex(u){xt(this,u),$e(this);let c=this.get(u,0),i=[u,0];for(let l=1;l<this.columns;l++)this.get(u,l)<c&&(c=this.get(u,l),i[1]=l);return i}maxColumn(u){if(yt(this,u),this.isEmpty())return NaN;let c=this.get(0,u);for(let i=1;i<this.rows;i++)this.get(i,u)>c&&(c=this.get(i,u));return c}maxColumnIndex(u){yt(this,u),$e(this);let c=this.get(0,u),i=[0,u];for(let l=1;l<this.rows;l++)this.get(l,u)>c&&(c=this.get(l,u),i[0]=l);return i}minColumn(u){if(yt(this,u),this.isEmpty())return NaN;let c=this.get(0,u);for(let i=1;i<this.rows;i++)this.get(i,u)<c&&(c=this.get(i,u));return c}minColumnIndex(u){yt(this,u),$e(this);let c=this.get(0,u),i=[0,u];for(let l=1;l<this.rows;l++)this.get(l,u)<c&&(c=this.get(l,u),i[0]=l);return i}diag(){let u=Math.min(this.rows,this.columns),c=[];for(let i=0;i<u;i++)c.push(this.get(i,i));return c}norm(u="frobenius"){switch(u){case"max":return this.max();case"frobenius":return Math.sqrt(this.dot(this));default:throw new RangeError(`unknown norm type: ${u}`)}}cumulativeSum(){let u=0;for(let c=0;c<this.rows;c++)for(let i=0;i<this.columns;i++)u+=this.get(c,i),this.set(c,i,u);return this}dot(u){Wt.isMatrix(u)&&(u=u.to1DArray());let c=this.to1DArray();if(c.length!==u.length)throw new RangeError("vectors do not have the same size");let i=0;for(let l=0;l<c.length;l++)i+=c[l]*u[l];return i}mmul(u){u=It.checkMatrix(u);let c=this.rows,i=this.columns,l=u.columns,m=new It(c,l),B=new Float64Array(i);for(let U=0;U<l;U++){for(let V=0;V<i;V++)B[V]=u.get(V,U);for(let V=0;V<c;V++){let G=0;for(let rt=0;rt<i;rt++)G+=this.get(V,rt)*B[rt];m.set(V,U,G)}}return m}mpow(u){if(!this.isSquare())throw new RangeError("Matrix must be square");if(!Number.isInteger(u)||u<0)throw new RangeError("Exponent must be a non-negative integer");let c=It.eye(this.rows),i=this;for(let l=u;l>=1;l/=2)l&1&&(c=c.mmul(i)),i=i.mmul(i);return c}strassen2x2(u){u=It.checkMatrix(u);let c=new It(2,2);const i=this.get(0,0),l=u.get(0,0),m=this.get(0,1),B=u.get(0,1),U=this.get(1,0),V=u.get(1,0),G=this.get(1,1),rt=u.get(1,1),_=(i+G)*(l+rt),lt=(U+G)*l,Tt=i*(B-rt),ct=G*(V-l),pt=(i+m)*rt,Rt=(U-i)*(l+B),Z=(m-G)*(V+rt),St=_+ct-pt+Z,Ct=Tt+pt,Kt=lt+ct,Zt=_-lt+Tt+Rt;return c.set(0,0,St),c.set(0,1,Ct),c.set(1,0,Kt),c.set(1,1,Zt),c}strassen3x3(u){u=It.checkMatrix(u);let c=new It(3,3);const i=this.get(0,0),l=this.get(0,1),m=this.get(0,2),B=this.get(1,0),U=this.get(1,1),V=this.get(1,2),G=this.get(2,0),rt=this.get(2,1),_=this.get(2,2),lt=u.get(0,0),Tt=u.get(0,1),ct=u.get(0,2),pt=u.get(1,0),Rt=u.get(1,1),Z=u.get(1,2),St=u.get(2,0),Ct=u.get(2,1),Kt=u.get(2,2),Zt=(i+l+m-B-U-rt-_)*Rt,ge=(i-B)*(-Tt+Rt),Ut=U*(-lt+Tt+pt-Rt-Z-St+Kt),Yt=(-i+B+U)*(lt-Tt+Rt),ce=(B+U)*(-lt+Tt),tt=i*lt,wt=(-i+G+rt)*(lt-ct+Z),Lt=(-i+G)*(ct-Z),Mt=(G+rt)*(-lt+ct),we=(i+l+m-U-V-G-rt)*Z,ae=rt*(-lt+ct+pt-Rt-Z-St+Ct),fe=(-m+rt+_)*(Rt+St-Ct),pe=(m-_)*(Rt-Ct),Re=m*St,_e=(rt+_)*(-St+Ct),Se=(-m+U+V)*(Z+St-Kt),Qe=(m-V)*(Z-Kt),He=(U+V)*(-St+Kt),te=l*pt,Le=V*Ct,Ue=B*ct,Ve=G*Tt,Oe=_*Kt,wr=tt+Re+te,xr=Zt+Yt+ce+tt+fe+Re+_e,Qn=tt+wt+Mt+we+Re+Se+He,Er=ge+Ut+Yt+tt+Re+Se+Qe,Hn=ge+Yt+ce+tt+Le,br=Re+Se+Qe+He+Ue,Nr=tt+wt+Lt+ae+fe+pe+Re,Mr=fe+pe+Re+_e+Ve,qn=tt+wt+Lt+Mt+Oe;return c.set(0,0,wr),c.set(0,1,xr),c.set(0,2,Qn),c.set(1,0,Er),c.set(1,1,Hn),c.set(1,2,br),c.set(2,0,Nr),c.set(2,1,Mr),c.set(2,2,qn),c}mmulStrassen(u){u=It.checkMatrix(u);let c=this.clone(),i=c.rows,l=c.columns,m=u.rows,B=u.columns;l!==m&&console.warn(`Multiplying ${i} x ${l} and ${m} x ${B} matrix: dimensions do not match.`);function U(_,lt,Tt){let ct=_.rows,pt=_.columns;if(ct===lt&&pt===Tt)return _;{let Rt=Wt.zeros(lt,Tt);return Rt=Rt.setSubMatrix(_,0,0),Rt}}let V=Math.max(i,m),G=Math.max(l,B);c=U(c,V,G),u=U(u,V,G);function rt(_,lt,Tt,ct){if(Tt<=512||ct<=512)return _.mmul(lt);Tt%2===1&&ct%2===1?(_=U(_,Tt+1,ct+1),lt=U(lt,Tt+1,ct+1)):Tt%2===1?(_=U(_,Tt+1,ct),lt=U(lt,Tt+1,ct)):ct%2===1&&(_=U(_,Tt,ct+1),lt=U(lt,Tt,ct+1));let pt=parseInt(_.rows/2,10),Rt=parseInt(_.columns/2,10),Z=_.subMatrix(0,pt-1,0,Rt-1),St=lt.subMatrix(0,pt-1,0,Rt-1),Ct=_.subMatrix(0,pt-1,Rt,_.columns-1),Kt=lt.subMatrix(0,pt-1,Rt,lt.columns-1),Zt=_.subMatrix(pt,_.rows-1,0,Rt-1),ge=lt.subMatrix(pt,lt.rows-1,0,Rt-1),Ut=_.subMatrix(pt,_.rows-1,Rt,_.columns-1),Yt=lt.subMatrix(pt,lt.rows-1,Rt,lt.columns-1),ce=rt(Wt.add(Z,Ut),Wt.add(St,Yt),pt,Rt),tt=rt(Wt.add(Zt,Ut),St,pt,Rt),wt=rt(Z,Wt.sub(Kt,Yt),pt,Rt),Lt=rt(Ut,Wt.sub(ge,St),pt,Rt),Mt=rt(Wt.add(Z,Ct),Yt,pt,Rt),we=rt(Wt.sub(Zt,Z),Wt.add(St,Kt),pt,Rt),ae=rt(Wt.sub(Ct,Ut),Wt.add(ge,Yt),pt,Rt),fe=Wt.add(ce,Lt);fe.sub(Mt),fe.add(ae);let pe=Wt.add(wt,Mt),Re=Wt.add(tt,Lt),_e=Wt.sub(ce,tt);_e.add(wt),_e.add(we);let Se=Wt.zeros(2*fe.rows,2*fe.columns);return Se=Se.setSubMatrix(fe,0,0),Se=Se.setSubMatrix(pe,fe.rows,0),Se=Se.setSubMatrix(Re,0,fe.columns),Se=Se.setSubMatrix(_e,fe.rows,fe.columns),Se.subMatrix(0,Tt-1,0,ct-1)}return rt(c,u,V,G)}scaleRows(u={}){if(typeof u!="object")throw new TypeError("options must be an object");const{min:c=0,max:i=1}=u;if(!Number.isFinite(c))throw new TypeError("min must be a number");if(!Number.isFinite(i))throw new TypeError("max must be a number");if(c>=i)throw new RangeError("min must be smaller than max");let l=new It(this.rows,this.columns);for(let m=0;m<this.rows;m++){const B=this.getRow(m);B.length>0&&nt(B,{min:c,max:i,output:B}),l.setRow(m,B)}return l}scaleColumns(u={}){if(typeof u!="object")throw new TypeError("options must be an object");const{min:c=0,max:i=1}=u;if(!Number.isFinite(c))throw new TypeError("min must be a number");if(!Number.isFinite(i))throw new TypeError("max must be a number");if(c>=i)throw new RangeError("min must be smaller than max");let l=new It(this.rows,this.columns);for(let m=0;m<this.columns;m++){const B=this.getColumn(m);B.length&&nt(B,{min:c,max:i,output:B}),l.setColumn(m,B)}return l}flipRows(){const u=Math.ceil(this.columns/2);for(let c=0;c<this.rows;c++)for(let i=0;i<u;i++){let l=this.get(c,i),m=this.get(c,this.columns-1-i);this.set(c,i,m),this.set(c,this.columns-1-i,l)}return this}flipColumns(){const u=Math.ceil(this.rows/2);for(let c=0;c<this.columns;c++)for(let i=0;i<u;i++){let l=this.get(i,c),m=this.get(this.rows-1-i,c);this.set(i,c,m),this.set(this.rows-1-i,c,l)}return this}kroneckerProduct(u){u=It.checkMatrix(u);let c=this.rows,i=this.columns,l=u.rows,m=u.columns,B=new It(c*l,i*m);for(let U=0;U<c;U++)for(let V=0;V<i;V++)for(let G=0;G<l;G++)for(let rt=0;rt<m;rt++)B.set(l*U+G,m*V+rt,this.get(U,V)*u.get(G,rt));return B}kroneckerSum(u){if(u=It.checkMatrix(u),!this.isSquare()||!u.isSquare())throw new Error("Kronecker Sum needs two Square Matrices");let c=this.rows,i=u.rows,l=this.kroneckerProduct(It.eye(i,i)),m=It.eye(c,c).kroneckerProduct(u);return l.add(m)}transpose(){let u=new It(this.columns,this.rows);for(let c=0;c<this.rows;c++)for(let i=0;i<this.columns;i++)u.set(i,c,this.get(c,i));return u}sortRows(u=re){for(let c=0;c<this.rows;c++)this.setRow(c,this.getRow(c).sort(u));return this}sortColumns(u=re){for(let c=0;c<this.columns;c++)this.setColumn(c,this.getColumn(c).sort(u));return this}subMatrix(u,c,i,l){Ht(this,u,c,i,l);let m=new It(c-u+1,l-i+1);for(let B=u;B<=c;B++)for(let U=i;U<=l;U++)m.set(B-u,U-i,this.get(B,U));return m}subMatrixRow(u,c,i){if(c===void 0&&(c=0),i===void 0&&(i=this.columns-1),c>i||c<0||c>=this.columns||i<0||i>=this.columns)throw new RangeError("Argument out of range");let l=new It(u.length,i-c+1);for(let m=0;m<u.length;m++)for(let B=c;B<=i;B++){if(u[m]<0||u[m]>=this.rows)throw new RangeError(`Row index out of range: ${u[m]}`);l.set(m,B-c,this.get(u[m],B))}return l}subMatrixColumn(u,c,i){if(c===void 0&&(c=0),i===void 0&&(i=this.rows-1),c>i||c<0||c>=this.rows||i<0||i>=this.rows)throw new RangeError("Argument out of range");let l=new It(i-c+1,u.length);for(let m=0;m<u.length;m++)for(let B=c;B<=i;B++){if(u[m]<0||u[m]>=this.columns)throw new RangeError(`Column index out of range: ${u[m]}`);l.set(B-c,m,this.get(B,u[m]))}return l}setSubMatrix(u,c,i){if(u=It.checkMatrix(u),u.isEmpty())return this;let l=c+u.rows-1,m=i+u.columns-1;Ht(this,c,l,i,m);for(let B=0;B<u.rows;B++)for(let U=0;U<u.columns;U++)this.set(c+B,i+U,u.get(B,U));return this}selection(u,c){Bt(this,u),Vt(this,c);let i=new It(u.length,c.length);for(let l=0;l<u.length;l++){let m=u[l];for(let B=0;B<c.length;B++){let U=c[B];i.set(l,B,this.get(m,U))}}return i}trace(){let u=Math.min(this.rows,this.columns),c=0;for(let i=0;i<u;i++)c+=this.get(i,i);return c}clone(){return this.constructor.copy(this,new It(this.rows,this.columns))}static copy(u,c){for(const[i,l,m]of u.entries())c.set(i,l,m);return c}sum(u){switch(u){case"row":return nn(this);case"column":return Mn(this);case void 0:return Sn(this);default:throw new Error(`invalid option: ${u}`)}}product(u){switch(u){case"row":return cn(this);case"column":return Je(this);case void 0:return an(this);default:throw new Error(`invalid option: ${u}`)}}mean(u){const c=this.sum(u);switch(u){case"row":{for(let i=0;i<this.rows;i++)c[i]/=this.columns;return c}case"column":{for(let i=0;i<this.columns;i++)c[i]/=this.rows;return c}case void 0:return c/this.size;default:throw new Error(`invalid option: ${u}`)}}variance(u,c={}){if(typeof u=="object"&&(c=u,u=void 0),typeof c!="object")throw new TypeError("options must be an object");const{unbiased:i=!0,mean:l=this.mean(u)}=c;if(typeof i!="boolean")throw new TypeError("unbiased must be a boolean");switch(u){case"row":{if(!ot.isAnyArray(l))throw new TypeError("mean must be an array");return gt(this,i,l)}case"column":{if(!ot.isAnyArray(l))throw new TypeError("mean must be an array");return vt(this,i,l)}case void 0:{if(typeof l!="number")throw new TypeError("mean must be a number");return At(this,i,l)}default:throw new Error(`invalid option: ${u}`)}}standardDeviation(u,c){typeof u=="object"&&(c=u,u=void 0);const i=this.variance(u,c);if(u===void 0)return Math.sqrt(i);for(let l=0;l<i.length;l++)i[l]=Math.sqrt(i[l]);return i}center(u,c={}){if(typeof u=="object"&&(c=u,u=void 0),typeof c!="object")throw new TypeError("options must be an object");const{center:i=this.mean(u)}=c;switch(u){case"row":{if(!ot.isAnyArray(i))throw new TypeError("center must be an array");return Ft(this,i),this}case"column":{if(!ot.isAnyArray(i))throw new TypeError("center must be an array");return qt(this,i),this}case void 0:{if(typeof i!="number")throw new TypeError("center must be a number");return ue(this,i),this}default:throw new Error(`invalid option: ${u}`)}}scale(u,c={}){if(typeof u=="object"&&(c=u,u=void 0),typeof c!="object")throw new TypeError("options must be an object");let i=c.scale;switch(u){case"row":{if(i===void 0)i=he(this);else if(!ot.isAnyArray(i))throw new TypeError("scale must be an array");return Ie(this,i),this}case"column":{if(i===void 0)i=pn(this);else if(!ot.isAnyArray(i))throw new TypeError("scale must be an array");return De(this,i),this}case void 0:{if(i===void 0)i=Me(this);else if(typeof i!="number")throw new TypeError("scale must be a number");return se(this,i),this}default:throw new Error(`invalid option: ${u}`)}}toString(u){return it(this,u)}[Symbol.iterator](){return this.entries()}*entries(){for(let u=0;u<this.rows;u++)for(let c=0;c<this.columns;c++)yield[u,c,this.get(u,c)]}*values(){for(let u=0;u<this.rows;u++)for(let c=0;c<this.columns;c++)yield this.get(u,c)}}Wt.prototype.klass="Matrix",typeof Symbol!="undefined"&&(Wt.prototype[Symbol.for("nodejs.util.inspect.custom")]=H);function re(T,u){return T-u}function rn(T){return T.every(u=>typeof u=="number")}Wt.random=Wt.rand,Wt.randomInt=Wt.randInt,Wt.diagonal=Wt.diag,Wt.prototype.diagonal=Wt.prototype.diag,Wt.identity=Wt.eye,Wt.prototype.negate=Wt.prototype.neg,Wt.prototype.tensorProduct=Wt.prototype.kroneckerProduct;const un=class Xr extends Wt{constructor(u,c){if(super(),A(this,D),N(this,"data"),Xr.isMatrix(u))j(this,D,Y).call(this,u.rows,u.columns),Xr.copy(u,this);else if(Number.isInteger(u)&&u>=0)j(this,D,Y).call(this,u,c);else if(ot.isAnyArray(u)){const i=u;if(u=i.length,c=u?i[0].length:0,typeof c!="number")throw new TypeError("Data must be a 2D array with at least one element");this.data=[];for(let l=0;l<u;l++){if(i[l].length!==c)throw new RangeError("Inconsistent array dimensions");if(!rn(i[l]))throw new TypeError("Input data contains non-numeric values");this.data.push(Float64Array.from(i[l]))}this.rows=u,this.columns=c}else throw new TypeError("First argument must be a positive number or an array")}set(u,c,i){return this.data[u][c]=i,this}get(u,c){return this.data[u][c]}removeRow(u){return xt(this,u),this.data.splice(u,1),this.rows-=1,this}addRow(u,c){return c===void 0&&(c=u,u=this.rows),xt(this,u,!0),c=Float64Array.from(Nt(this,c)),this.data.splice(u,0,c),this.rows+=1,this}removeColumn(u){yt(this,u);for(let c=0;c<this.rows;c++){const i=new Float64Array(this.columns-1);for(let l=0;l<u;l++)i[l]=this.data[c][l];for(let l=u+1;l<this.columns;l++)i[l-1]=this.data[c][l];this.data[c]=i}return this.columns-=1,this}addColumn(u,c){typeof c=="undefined"&&(c=u,u=this.columns),yt(this,u,!0),c=Ot(this,c);for(let i=0;i<this.rows;i++){const l=new Float64Array(this.columns+1);let m=0;for(;m<u;m++)l[m]=this.data[i][m];for(l[m++]=c[i];m<this.columns+1;m++)l[m]=this.data[i][m-1];this.data[i]=l}return this.columns+=1,this}};D=new WeakSet,Y=function(T,u){if(this.data=[],Number.isInteger(u)&&u>=0)for(let c=0;c<T;c++)this.data.push(new Float64Array(u));else throw new TypeError("nColumns must be a positive integer");this.rows=T,this.columns=u};let It=un;dt(Wt,It);const fn=class Kr extends Wt{constructor(u){if(super(),A(this,K),It.isMatrix(u)){if(!u.isSymmetric())throw new TypeError("not symmetric data");I(this,K,It.copy(u,new It(u.rows,u.rows)))}else if(Number.isInteger(u)&&u>=0)I(this,K,new It(u,u));else if(I(this,K,new It(u)),!this.isSymmetric())throw new TypeError("not symmetric data")}get size(){return M(this,K).size}get rows(){return M(this,K).rows}get columns(){return M(this,K).columns}get diagonalSize(){return this.rows}static isSymmetricMatrix(u){return It.isMatrix(u)&&u.klassType==="SymmetricMatrix"}static zeros(u){return new this(u)}static ones(u){return new this(u).fill(1)}clone(){const u=new Kr(this.diagonalSize);for(const[c,i,l]of this.upperRightEntries())u.set(c,i,l);return u}toMatrix(){return new It(this)}get(u,c){return M(this,K).get(u,c)}set(u,c,i){return M(this,K).set(u,c,i),M(this,K).set(c,u,i),this}removeCross(u){return M(this,K).removeRow(u),M(this,K).removeColumn(u),this}addCross(u,c){c===void 0&&(c=u,u=this.diagonalSize);const i=c.slice();return i.splice(u,1),M(this,K).addRow(u,i),M(this,K).addColumn(u,c),this}applyMask(u){if(u.length!==this.diagonalSize)throw new RangeError("Mask size do not match with matrix size");const c=[];for(const[i,l]of u.entries())l||c.push(i);c.reverse();for(const i of c)this.removeCross(i);return this}toCompact(){const{diagonalSize:u}=this,c=new Array(u*(u+1)/2);for(let i=0,l=0,m=0;m<c.length;m++)c[m]=this.get(l,i),++i>=u&&(i=++l);return c}static fromCompact(u){const c=u.length,i=(Math.sqrt(8*c+1)-1)/2;if(!Number.isInteger(i))throw new TypeError(`This array is not a compact representation of a Symmetric Matrix, ${JSON.stringify(u)}`);const l=new Kr(i);for(let m=0,B=0,U=0;U<c;U++)l.set(m,B,u[U]),++m>=i&&(m=++B);return l}*upperRightEntries(){for(let u=0,c=0;u<this.diagonalSize;void 0){const i=this.get(u,c);yield[u,c,i],++c>=this.diagonalSize&&(c=++u)}}*upperRightValues(){for(let u=0,c=0;u<this.diagonalSize;void 0)yield this.get(u,c),++c>=this.diagonalSize&&(c=++u)}};K=new WeakMap;let Pe=fn;Pe.prototype.klassType="SymmetricMatrix";class xe extends Pe{static isDistanceMatrix(u){return Pe.isSymmetricMatrix(u)&&u.klassSubType==="DistanceMatrix"}constructor(u){if(super(u),!this.isDistance())throw new TypeError("Provided arguments do no produce a distance matrix")}set(u,c,i){return u===c&&(i=0),super.set(u,c,i)}addCross(u,c){return c===void 0&&(c=u,u=this.diagonalSize),c=c.slice(),c[u]=0,super.addCross(u,c)}toSymmetricMatrix(){return new Pe(this)}clone(){const u=new xe(this.diagonalSize);for(const[c,i,l]of this.upperRightEntries())c!==i&&u.set(c,i,l);return u}toCompact(){const{diagonalSize:u}=this,c=(u-1)*u/2,i=new Array(c);for(let l=1,m=0,B=0;B<i.length;B++)i[B]=this.get(m,l),++l>=u&&(l=++m+1);return i}static fromCompact(u){const c=u.length;if(c===0)return new this(0);const i=(Math.sqrt(8*c+1)+1)/2;if(!Number.isInteger(i))throw new TypeError(`This array is not a compact representation of a DistanceMatrix, ${JSON.stringify(u)}`);const l=new this(i);for(let m=1,B=0,U=0;U<c;U++)l.set(m,B,u[U]),++m>=i&&(m=++B+1);return l}}xe.prototype.klassSubType="DistanceMatrix";class ke extends Wt{constructor(u,c,i){super(),this.matrix=u,this.rows=c,this.columns=i}}class vn extends ke{constructor(u,c){yt(u,c),super(u,u.rows,1),this.column=c}set(u,c,i){return this.matrix.set(u,this.column,i),this}get(u){return this.matrix.get(u,this.column)}}class On extends ke{constructor(u,c){Vt(u,c),super(u,u.rows,c.length),this.columnIndices=c}set(u,c,i){return this.matrix.set(u,this.columnIndices[c],i),this}get(u,c){return this.matrix.get(u,this.columnIndices[c])}}class Pn extends ke{constructor(u){super(u,u.rows,u.columns)}set(u,c,i){return this.matrix.set(u,this.columns-c-1,i),this}get(u,c){return this.matrix.get(u,this.columns-c-1)}}class sn extends ke{constructor(u){super(u,u.rows,u.columns)}set(u,c,i){return this.matrix.set(this.rows-u-1,c,i),this}get(u,c){return this.matrix.get(this.rows-u-1,c)}}class An extends ke{constructor(u,c){xt(u,c),super(u,1,u.columns),this.row=c}set(u,c,i){return this.matrix.set(this.row,c,i),this}get(u,c){return this.matrix.get(this.row,c)}}class Rn extends ke{constructor(u,c){Bt(u,c),super(u,c.length,u.columns),this.rowIndices=c}set(u,c,i){return this.matrix.set(this.rowIndices[u],c,i),this}get(u,c){return this.matrix.get(this.rowIndices[u],c)}}class mn extends ke{constructor(u,c,i){Bt(u,c),Vt(u,i),super(u,c.length,i.length),this.rowIndices=c,this.columnIndices=i}set(u,c,i){return this.matrix.set(this.rowIndices[u],this.columnIndices[c],i),this}get(u,c){return this.matrix.get(this.rowIndices[u],this.columnIndices[c])}}class Bn extends ke{constructor(u,c,i,l,m){Ht(u,c,i,l,m),super(u,i-c+1,m-l+1),this.startRow=c,this.startColumn=l}set(u,c,i){return this.matrix.set(this.startRow+u,this.startColumn+c,i),this}get(u,c){return this.matrix.get(this.startRow+u,this.startColumn+c)}}class Be extends ke{constructor(u){super(u,u.columns,u.rows)}set(u,c,i){return this.matrix.set(c,u,i),this}get(u,c){return this.matrix.get(c,u)}}class ze extends Wt{constructor(u,c={}){const{rows:i=1}=c;if(u.length%i!==0)throw new Error("the data length is not divisible by the number of rows");super(),this.rows=i,this.columns=u.length/i,this.data=u}set(u,c,i){let l=this._calculateIndex(u,c);return this.data[l]=i,this}get(u,c){let i=this._calculateIndex(u,c);return this.data[i]}_calculateIndex(u,c){return u*this.columns+c}}class Ae extends Wt{constructor(u){super(),this.data=u,this.rows=u.length,this.columns=u[0].length}set(u,c,i){return this.data[u][c]=i,this}get(u,c){return this.data[u][c]}}function cr(T,u){if(ot.isAnyArray(T))return T[0]&&ot.isAnyArray(T[0])?new Ae(T):new ze(T,u);throw new Error("the argument is not an array")}class $t{constructor(u){u=Ae.checkMatrix(u);let c=u.clone(),i=c.rows,l=c.columns,m=new Float64Array(i),B=1,U,V,G,rt,_,lt,Tt,ct,pt;for(U=0;U<i;U++)m[U]=U;for(ct=new Float64Array(i),V=0;V<l;V++){for(U=0;U<i;U++)ct[U]=c.get(U,V);for(U=0;U<i;U++){for(pt=Math.min(U,V),_=0,G=0;G<pt;G++)_+=c.get(U,G)*ct[G];ct[U]-=_,c.set(U,V,ct[U])}for(rt=V,U=V+1;U<i;U++)Math.abs(ct[U])>Math.abs(ct[rt])&&(rt=U);if(rt!==V){for(G=0;G<l;G++)lt=c.get(rt,G),c.set(rt,G,c.get(V,G)),c.set(V,G,lt);Tt=m[rt],m[rt]=m[V],m[V]=Tt,B=-B}if(V<i&&c.get(V,V)!==0)for(U=V+1;U<i;U++)c.set(U,V,c.get(U,V)/c.get(V,V))}this.LU=c,this.pivotVector=m,this.pivotSign=B}isSingular(){let u=this.LU,c=u.columns;for(let i=0;i<c;i++)if(u.get(i,i)===0)return!0;return!1}solve(u){u=It.checkMatrix(u);let c=this.LU;if(c.rows!==u.rows)throw new Error("Invalid matrix dimensions");if(this.isSingular())throw new Error("LU matrix is singular");let l=u.columns,m=u.subMatrixRow(this.pivotVector,0,l-1),B=c.columns,U,V,G;for(G=0;G<B;G++)for(U=G+1;U<B;U++)for(V=0;V<l;V++)m.set(U,V,m.get(U,V)-m.get(G,V)*c.get(U,G));for(G=B-1;G>=0;G--){for(V=0;V<l;V++)m.set(G,V,m.get(G,V)/c.get(G,G));for(U=0;U<G;U++)for(V=0;V<l;V++)m.set(U,V,m.get(U,V)-m.get(G,V)*c.get(U,G))}return m}get determinant(){let u=this.LU;if(!u.isSquare())throw new Error("Matrix must be square");let c=this.pivotSign,i=u.columns;for(let l=0;l<i;l++)c*=u.get(l,l);return c}get lowerTriangularMatrix(){let u=this.LU,c=u.rows,i=u.columns,l=new It(c,i);for(let m=0;m<c;m++)for(let B=0;B<i;B++)m>B?l.set(m,B,u.get(m,B)):m===B?l.set(m,B,1):l.set(m,B,0);return l}get upperTriangularMatrix(){let u=this.LU,c=u.rows,i=u.columns,l=new It(c,i);for(let m=0;m<c;m++)for(let B=0;B<i;B++)m<=B?l.set(m,B,u.get(m,B)):l.set(m,B,0);return l}get pivotPermutationVector(){return Array.from(this.pivotVector)}}function on(T,u){let c=0;return Math.abs(T)>Math.abs(u)?(c=u/T,Math.abs(T)*Math.sqrt(1+c*c)):u!==0?(c=T/u,Math.abs(u)*Math.sqrt(1+c*c)):0}class Un{constructor(u){u=Ae.checkMatrix(u);let c=u.clone(),i=u.rows,l=u.columns,m=new Float64Array(l),B,U,V,G;for(V=0;V<l;V++){let rt=0;for(B=V;B<i;B++)rt=on(rt,c.get(B,V));if(rt!==0){for(c.get(V,V)<0&&(rt=-rt),B=V;B<i;B++)c.set(B,V,c.get(B,V)/rt);for(c.set(V,V,c.get(V,V)+1),U=V+1;U<l;U++){for(G=0,B=V;B<i;B++)G+=c.get(B,V)*c.get(B,U);for(G=-G/c.get(V,V),B=V;B<i;B++)c.set(B,U,c.get(B,U)+G*c.get(B,V))}}m[V]=-rt}this.QR=c,this.Rdiag=m}solve(u){u=It.checkMatrix(u);let c=this.QR,i=c.rows;if(u.rows!==i)throw new Error("Matrix row dimensions must agree");if(!this.isFullRank())throw new Error("Matrix is rank deficient");let l=u.columns,m=u.clone(),B=c.columns,U,V,G,rt;for(G=0;G<B;G++)for(V=0;V<l;V++){for(rt=0,U=G;U<i;U++)rt+=c.get(U,G)*m.get(U,V);for(rt=-rt/c.get(G,G),U=G;U<i;U++)m.set(U,V,m.get(U,V)+rt*c.get(U,G))}for(G=B-1;G>=0;G--){for(V=0;V<l;V++)m.set(G,V,m.get(G,V)/this.Rdiag[G]);for(U=0;U<G;U++)for(V=0;V<l;V++)m.set(U,V,m.get(U,V)-m.get(G,V)*c.get(U,G))}return m.subMatrix(0,B-1,0,l-1)}isFullRank(){let u=this.QR.columns;for(let c=0;c<u;c++)if(this.Rdiag[c]===0)return!1;return!0}get upperTriangularMatrix(){let u=this.QR,c=u.columns,i=new It(c,c),l,m;for(l=0;l<c;l++)for(m=0;m<c;m++)l<m?i.set(l,m,u.get(l,m)):l===m?i.set(l,m,this.Rdiag[l]):i.set(l,m,0);return i}get orthogonalMatrix(){let u=this.QR,c=u.rows,i=u.columns,l=new It(c,i),m,B,U,V;for(U=i-1;U>=0;U--){for(m=0;m<c;m++)l.set(m,U,0);for(l.set(U,U,1),B=U;B<i;B++)if(u.get(U,U)!==0){for(V=0,m=U;m<c;m++)V+=u.get(m,U)*l.get(m,B);for(V=-V/u.get(U,U),m=U;m<c;m++)l.set(m,B,l.get(m,B)+V*u.get(m,U))}}return l}}class ln{constructor(u,c={}){if(u=Ae.checkMatrix(u),u.isEmpty())throw new Error("Matrix must be non-empty");let i=u.rows,l=u.columns;const{computeLeftSingularVectors:m=!0,computeRightSingularVectors:B=!0,autoTranspose:U=!1}=c;let V=!!m,G=!!B,rt=!1,_;if(i<l)if(!U)_=u.clone(),console.warn("Computing SVD on a matrix with more columns than rows. Consider enabling autoTranspose");else{_=u.transpose(),i=_.rows,l=_.columns,rt=!0;let tt=V;V=G,G=tt}else _=u.clone();let lt=Math.min(i,l),Tt=Math.min(i+1,l),ct=new Float64Array(Tt),pt=new It(i,lt),Rt=new It(l,l),Z=new Float64Array(l),St=new Float64Array(i),Ct=new Float64Array(Tt);for(let tt=0;tt<Tt;tt++)Ct[tt]=tt;let Kt=Math.min(i-1,l),Zt=Math.max(0,Math.min(l-2,i)),ge=Math.max(Kt,Zt);for(let tt=0;tt<ge;tt++){if(tt<Kt){ct[tt]=0;for(let wt=tt;wt<i;wt++)ct[tt]=on(ct[tt],_.get(wt,tt));if(ct[tt]!==0){_.get(tt,tt)<0&&(ct[tt]=-ct[tt]);for(let wt=tt;wt<i;wt++)_.set(wt,tt,_.get(wt,tt)/ct[tt]);_.set(tt,tt,_.get(tt,tt)+1)}ct[tt]=-ct[tt]}for(let wt=tt+1;wt<l;wt++){if(tt<Kt&&ct[tt]!==0){let Lt=0;for(let Mt=tt;Mt<i;Mt++)Lt+=_.get(Mt,tt)*_.get(Mt,wt);Lt=-Lt/_.get(tt,tt);for(let Mt=tt;Mt<i;Mt++)_.set(Mt,wt,_.get(Mt,wt)+Lt*_.get(Mt,tt))}Z[wt]=_.get(tt,wt)}if(V&&tt<Kt)for(let wt=tt;wt<i;wt++)pt.set(wt,tt,_.get(wt,tt));if(tt<Zt){Z[tt]=0;for(let wt=tt+1;wt<l;wt++)Z[tt]=on(Z[tt],Z[wt]);if(Z[tt]!==0){Z[tt+1]<0&&(Z[tt]=0-Z[tt]);for(let wt=tt+1;wt<l;wt++)Z[wt]/=Z[tt];Z[tt+1]+=1}if(Z[tt]=-Z[tt],tt+1<i&&Z[tt]!==0){for(let wt=tt+1;wt<i;wt++)St[wt]=0;for(let wt=tt+1;wt<i;wt++)for(let Lt=tt+1;Lt<l;Lt++)St[wt]+=Z[Lt]*_.get(wt,Lt);for(let wt=tt+1;wt<l;wt++){let Lt=-Z[wt]/Z[tt+1];for(let Mt=tt+1;Mt<i;Mt++)_.set(Mt,wt,_.get(Mt,wt)+Lt*St[Mt])}}if(G)for(let wt=tt+1;wt<l;wt++)Rt.set(wt,tt,Z[wt])}}let Ut=Math.min(l,i+1);if(Kt<l&&(ct[Kt]=_.get(Kt,Kt)),i<Ut&&(ct[Ut-1]=0),Zt+1<Ut&&(Z[Zt]=_.get(Zt,Ut-1)),Z[Ut-1]=0,V){for(let tt=Kt;tt<lt;tt++){for(let wt=0;wt<i;wt++)pt.set(wt,tt,0);pt.set(tt,tt,1)}for(let tt=Kt-1;tt>=0;tt--)if(ct[tt]!==0){for(let wt=tt+1;wt<lt;wt++){let Lt=0;for(let Mt=tt;Mt<i;Mt++)Lt+=pt.get(Mt,tt)*pt.get(Mt,wt);Lt=-Lt/pt.get(tt,tt);for(let Mt=tt;Mt<i;Mt++)pt.set(Mt,wt,pt.get(Mt,wt)+Lt*pt.get(Mt,tt))}for(let wt=tt;wt<i;wt++)pt.set(wt,tt,-pt.get(wt,tt));pt.set(tt,tt,1+pt.get(tt,tt));for(let wt=0;wt<tt-1;wt++)pt.set(wt,tt,0)}else{for(let wt=0;wt<i;wt++)pt.set(wt,tt,0);pt.set(tt,tt,1)}}if(G)for(let tt=l-1;tt>=0;tt--){if(tt<Zt&&Z[tt]!==0)for(let wt=tt+1;wt<l;wt++){let Lt=0;for(let Mt=tt+1;Mt<l;Mt++)Lt+=Rt.get(Mt,tt)*Rt.get(Mt,wt);Lt=-Lt/Rt.get(tt+1,tt);for(let Mt=tt+1;Mt<l;Mt++)Rt.set(Mt,wt,Rt.get(Mt,wt)+Lt*Rt.get(Mt,tt))}for(let wt=0;wt<l;wt++)Rt.set(wt,tt,0);Rt.set(tt,tt,1)}let Yt=Ut-1,ce=Number.EPSILON;for(;Ut>0;){let tt,wt;for(tt=Ut-2;tt>=-1&&tt!==-1;tt--){const Lt=Number.MIN_VALUE+ce*Math.abs(ct[tt]+Math.abs(ct[tt+1]));if(Math.abs(Z[tt])<=Lt||Number.isNaN(Z[tt])){Z[tt]=0;break}}if(tt===Ut-2)wt=4;else{let Lt;for(Lt=Ut-1;Lt>=tt&&Lt!==tt;Lt--){let Mt=(Lt!==Ut?Math.abs(Z[Lt]):0)+(Lt!==tt+1?Math.abs(Z[Lt-1]):0);if(Math.abs(ct[Lt])<=ce*Mt){ct[Lt]=0;break}}Lt===tt?wt=3:Lt===Ut-1?wt=1:(wt=2,tt=Lt)}switch(tt++,wt){case 1:{let Lt=Z[Ut-2];Z[Ut-2]=0;for(let Mt=Ut-2;Mt>=tt;Mt--){let we=on(ct[Mt],Lt),ae=ct[Mt]/we,fe=Lt/we;if(ct[Mt]=we,Mt!==tt&&(Lt=-fe*Z[Mt-1],Z[Mt-1]=ae*Z[Mt-1]),G)for(let pe=0;pe<l;pe++)we=ae*Rt.get(pe,Mt)+fe*Rt.get(pe,Ut-1),Rt.set(pe,Ut-1,-fe*Rt.get(pe,Mt)+ae*Rt.get(pe,Ut-1)),Rt.set(pe,Mt,we)}break}case 2:{let Lt=Z[tt-1];Z[tt-1]=0;for(let Mt=tt;Mt<Ut;Mt++){let we=on(ct[Mt],Lt),ae=ct[Mt]/we,fe=Lt/we;if(ct[Mt]=we,Lt=-fe*Z[Mt],Z[Mt]=ae*Z[Mt],V)for(let pe=0;pe<i;pe++)we=ae*pt.get(pe,Mt)+fe*pt.get(pe,tt-1),pt.set(pe,tt-1,-fe*pt.get(pe,Mt)+ae*pt.get(pe,tt-1)),pt.set(pe,Mt,we)}break}case 3:{const Lt=Math.max(Math.abs(ct[Ut-1]),Math.abs(ct[Ut-2]),Math.abs(Z[Ut-2]),Math.abs(ct[tt]),Math.abs(Z[tt])),Mt=ct[Ut-1]/Lt,we=ct[Ut-2]/Lt,ae=Z[Ut-2]/Lt,fe=ct[tt]/Lt,pe=Z[tt]/Lt,Re=((we+Mt)*(we-Mt)+ae*ae)/2,_e=Mt*ae*(Mt*ae);let Se=0;(Re!==0||_e!==0)&&(Re<0?Se=0-Math.sqrt(Re*Re+_e):Se=Math.sqrt(Re*Re+_e),Se=_e/(Re+Se));let Qe=(fe+Mt)*(fe-Mt)+Se,He=fe*pe;for(let te=tt;te<Ut-1;te++){let Le=on(Qe,He);Le===0&&(Le=Number.MIN_VALUE);let Ue=Qe/Le,Ve=He/Le;if(te!==tt&&(Z[te-1]=Le),Qe=Ue*ct[te]+Ve*Z[te],Z[te]=Ue*Z[te]-Ve*ct[te],He=Ve*ct[te+1],ct[te+1]=Ue*ct[te+1],G)for(let Oe=0;Oe<l;Oe++)Le=Ue*Rt.get(Oe,te)+Ve*Rt.get(Oe,te+1),Rt.set(Oe,te+1,-Ve*Rt.get(Oe,te)+Ue*Rt.get(Oe,te+1)),Rt.set(Oe,te,Le);if(Le=on(Qe,He),Le===0&&(Le=Number.MIN_VALUE),Ue=Qe/Le,Ve=He/Le,ct[te]=Le,Qe=Ue*Z[te]+Ve*ct[te+1],ct[te+1]=-Ve*Z[te]+Ue*ct[te+1],He=Ve*Z[te+1],Z[te+1]=Ue*Z[te+1],V&&te<i-1)for(let Oe=0;Oe<i;Oe++)Le=Ue*pt.get(Oe,te)+Ve*pt.get(Oe,te+1),pt.set(Oe,te+1,-Ve*pt.get(Oe,te)+Ue*pt.get(Oe,te+1)),pt.set(Oe,te,Le)}Z[Ut-2]=Qe;break}case 4:{if(ct[tt]<=0&&(ct[tt]=ct[tt]<0?-ct[tt]:0,G))for(let Lt=0;Lt<=Yt;Lt++)Rt.set(Lt,tt,-Rt.get(Lt,tt));for(;tt<Yt&&!(ct[tt]>=ct[tt+1]);){let Lt=ct[tt];if(ct[tt]=ct[tt+1],ct[tt+1]=Lt,G&&tt<l-1)for(let Mt=0;Mt<l;Mt++)Lt=Rt.get(Mt,tt+1),Rt.set(Mt,tt+1,Rt.get(Mt,tt)),Rt.set(Mt,tt,Lt);if(V&&tt<i-1)for(let Mt=0;Mt<i;Mt++)Lt=pt.get(Mt,tt+1),pt.set(Mt,tt+1,pt.get(Mt,tt)),pt.set(Mt,tt,Lt);tt++}Ut--;break}}}if(rt){let tt=Rt;Rt=pt,pt=tt}this.m=i,this.n=l,this.s=ct,this.U=pt,this.V=Rt}solve(u){let c=u,i=this.threshold,l=this.s.length,m=It.zeros(l,l);for(let lt=0;lt<l;lt++)Math.abs(this.s[lt])<=i?m.set(lt,lt,0):m.set(lt,lt,1/this.s[lt]);let B=this.U,U=this.rightSingularVectors,V=U.mmul(m),G=U.rows,rt=B.rows,_=It.zeros(G,rt);for(let lt=0;lt<G;lt++)for(let Tt=0;Tt<rt;Tt++){let ct=0;for(let pt=0;pt<l;pt++)ct+=V.get(lt,pt)*B.get(Tt,pt);_.set(lt,Tt,ct)}return _.mmul(c)}solveForDiagonal(u){return this.solve(It.diag(u))}inverse(){let u=this.V,c=this.threshold,i=u.rows,l=u.columns,m=new It(i,this.s.length);for(let rt=0;rt<i;rt++)for(let _=0;_<l;_++)Math.abs(this.s[_])>c&&m.set(rt,_,u.get(rt,_)/this.s[_]);let B=this.U,U=B.rows,V=B.columns,G=new It(i,U);for(let rt=0;rt<i;rt++)for(let _=0;_<U;_++){let lt=0;for(let Tt=0;Tt<V;Tt++)lt+=m.get(rt,Tt)*B.get(_,Tt);G.set(rt,_,lt)}return G}get condition(){return this.s[0]/this.s[Math.min(this.m,this.n)-1]}get norm2(){return this.s[0]}get rank(){let u=Math.max(this.m,this.n)*this.s[0]*Number.EPSILON,c=0,i=this.s;for(let l=0,m=i.length;l<m;l++)i[l]>u&&c++;return c}get diagonal(){return Array.from(this.s)}get threshold(){return Number.EPSILON/2*Math.max(this.m,this.n)*this.s[0]}get leftSingularVectors(){return this.U}get rightSingularVectors(){return this.V}get diagonalMatrix(){return It.diag(this.s)}}function fr(T,u=!1){return T=Ae.checkMatrix(T),u?new ln(T).inverse():Zn(T,It.eye(T.rows))}function Zn(T,u,c=!1){return T=Ae.checkMatrix(T),u=Ae.checkMatrix(u),c?new ln(T).solve(u):T.isSquare()?new $t(T).solve(u):new Un(T).solve(u)}function Ln(T){if(T=It.checkMatrix(T),T.isSquare()){if(T.columns===0)return 1;let u,c,i,l;if(T.columns===2)return u=T.get(0,0),c=T.get(0,1),i=T.get(1,0),l=T.get(1,1),u*l-c*i;if(T.columns===3){let m,B,U;return m=new mn(T,[1,2],[1,2]),B=new mn(T,[1,2],[0,2]),U=new mn(T,[1,2],[0,1]),u=T.get(0,0),c=T.get(0,1),i=T.get(0,2),u*Ln(m)-c*Ln(B)+i*Ln(U)}else return new $t(T).determinant}else throw Error("determinant can only be calculated for a square matrix")}function lr(T,u){let c=[];for(let i=0;i<T;i++)i!==u&&c.push(i);return c}function dr(T,u,c,i=1e-9,l=1e-9){if(T>l)return new Array(u.rows+1).fill(0);{let m=u.addRow(c,[0]);for(let B=0;B<m.rows;B++)Math.abs(m.get(B,0))<i&&m.set(B,0,0);return m.to1DArray()}}function Vn(T,u={}){const{thresholdValue:c=1e-9,thresholdError:i=1e-9}=u;T=It.checkMatrix(T);let l=T.rows,m=new It(l,l);for(let B=0;B<l;B++){let U=It.columnVector(T.getRow(B)),V=T.subMatrixRow(lr(l,B)).transpose(),rt=new ln(V).solve(U),_=It.sub(U,V.mmul(rt)).abs().max();m.setRow(B,dr(_,rt,B,c,i))}return m}function hr(T,u=Number.EPSILON){if(T=It.checkMatrix(T),T.isEmpty())return T.transpose();let c=new ln(T,{autoTranspose:!0}),i=c.leftSingularVectors,l=c.rightSingularVectors,m=c.diagonal;for(let B=0;B<m.length;B++)Math.abs(m[B])>u?m[B]=1/m[B]:m[B]=0;return l.mmul(It.diag(m).mmul(i.transpose()))}function Gn(T,u=T,c={}){T=new It(T);let i=!1;if(typeof u=="object"&&!It.isMatrix(u)&&!ot.isAnyArray(u)?(c=u,u=T,i=!0):u=new It(u),T.rows!==u.rows)throw new TypeError("Both matrices must have the same number of rows");const{center:l=!0}=c;l&&(T=T.center("column"),i||(u=u.center("column")));const m=T.transpose().mmul(u);for(let B=0;B<m.rows;B++)for(let U=0;U<m.columns;U++)m.set(B,U,m.get(B,U)*(1/(T.rows-1)));return m}function gr(T,u=T,c={}){T=new It(T);let i=!1;if(typeof u=="object"&&!It.isMatrix(u)&&!ot.isAnyArray(u)?(c=u,u=T,i=!0):u=new It(u),T.rows!==u.rows)throw new TypeError("Both matrices must have the same number of rows");const{center:l=!0,scale:m=!0}=c;l&&(T.center("column"),i||u.center("column")),m&&(T.scale("column"),i||u.scale("column"));const B=T.standardDeviation("column",{unbiased:!0}),U=i?B:u.standardDeviation("column",{unbiased:!0}),V=T.transpose().mmul(u);for(let G=0;G<V.rows;G++)for(let rt=0;rt<V.columns;rt++)V.set(G,rt,V.get(G,rt)*(1/(B[G]*U[rt]))*(1/(T.rows-1)));return V}class Jn{constructor(u,c={}){const{assumeSymmetric:i=!1}=c;if(u=Ae.checkMatrix(u),!u.isSquare())throw new Error("Matrix is not a square matrix");if(u.isEmpty())throw new Error("Matrix must be non-empty");let l=u.columns,m=new It(l,l),B=new Float64Array(l),U=new Float64Array(l),V=u,G,rt,_=!1;if(i?_=!0:_=u.isSymmetric(),_){for(G=0;G<l;G++)for(rt=0;rt<l;rt++)m.set(G,rt,V.get(G,rt));pr(l,U,B,m),vr(l,U,B,m)}else{let lt=new It(l,l),Tt=new Float64Array(l);for(rt=0;rt<l;rt++)for(G=0;G<l;G++)lt.set(G,rt,V.get(G,rt));yn(l,lt,Tt,m),mr(l,U,B,m,lt)}this.n=l,this.e=U,this.d=B,this.V=m}get realEigenvalues(){return Array.from(this.d)}get imaginaryEigenvalues(){return Array.from(this.e)}get eigenvectorMatrix(){return this.V}get diagonalMatrix(){let u=this.n,c=this.e,i=this.d,l=new It(u,u),m,B;for(m=0;m<u;m++){for(B=0;B<u;B++)l.set(m,B,0);l.set(m,m,i[m]),c[m]>0?l.set(m,m+1,c[m]):c[m]<0&&l.set(m,m-1,c[m])}return l}}function pr(T,u,c,i){let l,m,B,U,V,G,rt,_;for(V=0;V<T;V++)c[V]=i.get(T-1,V);for(U=T-1;U>0;U--){for(_=0,B=0,G=0;G<U;G++)_=_+Math.abs(c[G]);if(_===0)for(u[U]=c[U-1],V=0;V<U;V++)c[V]=i.get(U-1,V),i.set(U,V,0),i.set(V,U,0);else{for(G=0;G<U;G++)c[G]/=_,B+=c[G]*c[G];for(l=c[U-1],m=Math.sqrt(B),l>0&&(m=-m),u[U]=_*m,B=B-l*m,c[U-1]=l-m,V=0;V<U;V++)u[V]=0;for(V=0;V<U;V++){for(l=c[V],i.set(V,U,l),m=u[V]+i.get(V,V)*l,G=V+1;G<=U-1;G++)m+=i.get(G,V)*c[G],u[G]+=i.get(G,V)*l;u[V]=m}for(l=0,V=0;V<U;V++)u[V]/=B,l+=u[V]*c[V];for(rt=l/(B+B),V=0;V<U;V++)u[V]-=rt*c[V];for(V=0;V<U;V++){for(l=c[V],m=u[V],G=V;G<=U-1;G++)i.set(G,V,i.get(G,V)-(l*u[G]+m*c[G]));c[V]=i.get(U-1,V),i.set(U,V,0)}}c[U]=B}for(U=0;U<T-1;U++){if(i.set(T-1,U,i.get(U,U)),i.set(U,U,1),B=c[U+1],B!==0){for(G=0;G<=U;G++)c[G]=i.get(G,U+1)/B;for(V=0;V<=U;V++){for(m=0,G=0;G<=U;G++)m+=i.get(G,U+1)*i.get(G,V);for(G=0;G<=U;G++)i.set(G,V,i.get(G,V)-m*c[G])}}for(G=0;G<=U;G++)i.set(G,U+1,0)}for(V=0;V<T;V++)c[V]=i.get(T-1,V),i.set(T-1,V,0);i.set(T-1,T-1,1),u[0]=0}function vr(T,u,c,i){let l,m,B,U,V,G,rt,_,lt,Tt,ct,pt,Rt,Z,St,Ct;for(B=1;B<T;B++)u[B-1]=u[B];u[T-1]=0;let Kt=0,Zt=0,ge=Number.EPSILON;for(G=0;G<T;G++){for(Zt=Math.max(Zt,Math.abs(c[G])+Math.abs(u[G])),rt=G;rt<T&&!(Math.abs(u[rt])<=ge*Zt);)rt++;if(rt>G)do{for(l=c[G],_=(c[G+1]-l)/(2*u[G]),lt=on(_,1),_<0&&(lt=-lt),c[G]=u[G]/(_+lt),c[G+1]=u[G]*(_+lt),Tt=c[G+1],m=l-c[G],B=G+2;B<T;B++)c[B]-=m;for(Kt=Kt+m,_=c[rt],ct=1,pt=ct,Rt=ct,Z=u[G+1],St=0,Ct=0,B=rt-1;B>=G;B--)for(Rt=pt,pt=ct,Ct=St,l=ct*u[B],m=ct*_,lt=on(_,u[B]),u[B+1]=St*lt,St=u[B]/lt,ct=_/lt,_=ct*c[B]-St*l,c[B+1]=m+St*(ct*l+St*c[B]),V=0;V<T;V++)m=i.get(V,B+1),i.set(V,B+1,St*i.get(V,B)+ct*m),i.set(V,B,ct*i.get(V,B)-St*m);_=-St*Ct*Rt*Z*u[G]/Tt,u[G]=St*_,c[G]=ct*_}while(Math.abs(u[G])>ge*Zt);c[G]=c[G]+Kt,u[G]=0}for(B=0;B<T-1;B++){for(V=B,_=c[B],U=B+1;U<T;U++)c[U]<_&&(V=U,_=c[U]);if(V!==B)for(c[V]=c[B],c[B]=_,U=0;U<T;U++)_=i.get(U,B),i.set(U,B,i.get(U,V)),i.set(U,V,_)}}function yn(T,u,c,i){let l=0,m=T-1,B,U,V,G,rt,_,lt;for(_=l+1;_<=m-1;_++){for(lt=0,G=_;G<=m;G++)lt=lt+Math.abs(u.get(G,_-1));if(lt!==0){for(V=0,G=m;G>=_;G--)c[G]=u.get(G,_-1)/lt,V+=c[G]*c[G];for(U=Math.sqrt(V),c[_]>0&&(U=-U),V=V-c[_]*U,c[_]=c[_]-U,rt=_;rt<T;rt++){for(B=0,G=m;G>=_;G--)B+=c[G]*u.get(G,rt);for(B=B/V,G=_;G<=m;G++)u.set(G,rt,u.get(G,rt)-B*c[G])}for(G=0;G<=m;G++){for(B=0,rt=m;rt>=_;rt--)B+=c[rt]*u.get(G,rt);for(B=B/V,rt=_;rt<=m;rt++)u.set(G,rt,u.get(G,rt)-B*c[rt])}c[_]=lt*c[_],u.set(_,_-1,lt*U)}}for(G=0;G<T;G++)for(rt=0;rt<T;rt++)i.set(G,rt,G===rt?1:0);for(_=m-1;_>=l+1;_--)if(u.get(_,_-1)!==0){for(G=_+1;G<=m;G++)c[G]=u.get(G,_-1);for(rt=_;rt<=m;rt++){for(U=0,G=_;G<=m;G++)U+=c[G]*i.get(G,rt);for(U=U/c[_]/u.get(_,_-1),G=_;G<=m;G++)i.set(G,rt,i.get(G,rt)+U*c[G])}}}function mr(T,u,c,i,l){let m=T-1,B=0,U=T-1,V=Number.EPSILON,G=0,rt=0,_=0,lt=0,Tt=0,ct=0,pt=0,Rt=0,Z,St,Ct,Kt,Zt,ge,Ut,Yt,ce,tt,wt,Lt,Mt,we,ae;for(Z=0;Z<T;Z++)for((Z<B||Z>U)&&(c[Z]=l.get(Z,Z),u[Z]=0),St=Math.max(Z-1,0);St<T;St++)rt=rt+Math.abs(l.get(Z,St));for(;m>=B;){for(Kt=m;Kt>B&&(ct=Math.abs(l.get(Kt-1,Kt-1))+Math.abs(l.get(Kt,Kt)),ct===0&&(ct=rt),!(Math.abs(l.get(Kt,Kt-1))<V*ct));)Kt--;if(Kt===m)l.set(m,m,l.get(m,m)+G),c[m]=l.get(m,m),u[m]=0,m--,Rt=0;else if(Kt===m-1){if(Ut=l.get(m,m-1)*l.get(m-1,m),_=(l.get(m-1,m-1)-l.get(m,m))/2,lt=_*_+Ut,pt=Math.sqrt(Math.abs(lt)),l.set(m,m,l.get(m,m)+G),l.set(m-1,m-1,l.get(m-1,m-1)+G),Yt=l.get(m,m),lt>=0){for(pt=_>=0?_+pt:_-pt,c[m-1]=Yt+pt,c[m]=c[m-1],pt!==0&&(c[m]=Yt-Ut/pt),u[m-1]=0,u[m]=0,Yt=l.get(m,m-1),ct=Math.abs(Yt)+Math.abs(pt),_=Yt/ct,lt=pt/ct,Tt=Math.sqrt(_*_+lt*lt),_=_/Tt,lt=lt/Tt,St=m-1;St<T;St++)pt=l.get(m-1,St),l.set(m-1,St,lt*pt+_*l.get(m,St)),l.set(m,St,lt*l.get(m,St)-_*pt);for(Z=0;Z<=m;Z++)pt=l.get(Z,m-1),l.set(Z,m-1,lt*pt+_*l.get(Z,m)),l.set(Z,m,lt*l.get(Z,m)-_*pt);for(Z=B;Z<=U;Z++)pt=i.get(Z,m-1),i.set(Z,m-1,lt*pt+_*i.get(Z,m)),i.set(Z,m,lt*i.get(Z,m)-_*pt)}else c[m-1]=Yt+_,c[m]=Yt+_,u[m-1]=pt,u[m]=-pt;m=m-2,Rt=0}else{if(Yt=l.get(m,m),ce=0,Ut=0,Kt<m&&(ce=l.get(m-1,m-1),Ut=l.get(m,m-1)*l.get(m-1,m)),Rt===10){for(G+=Yt,Z=B;Z<=m;Z++)l.set(Z,Z,l.get(Z,Z)-Yt);ct=Math.abs(l.get(m,m-1))+Math.abs(l.get(m-1,m-2)),Yt=ce=.75*ct,Ut=-.4375*ct*ct}if(Rt===30&&(ct=(ce-Yt)/2,ct=ct*ct+Ut,ct>0)){for(ct=Math.sqrt(ct),ce<Yt&&(ct=-ct),ct=Yt-Ut/((ce-Yt)/2+ct),Z=B;Z<=m;Z++)l.set(Z,Z,l.get(Z,Z)-ct);G+=ct,Yt=ce=Ut=.964}for(Rt=Rt+1,Zt=m-2;Zt>=Kt&&(pt=l.get(Zt,Zt),Tt=Yt-pt,ct=ce-pt,_=(Tt*ct-Ut)/l.get(Zt+1,Zt)+l.get(Zt,Zt+1),lt=l.get(Zt+1,Zt+1)-pt-Tt-ct,Tt=l.get(Zt+2,Zt+1),ct=Math.abs(_)+Math.abs(lt)+Math.abs(Tt),_=_/ct,lt=lt/ct,Tt=Tt/ct,!(Zt===Kt||Math.abs(l.get(Zt,Zt-1))*(Math.abs(lt)+Math.abs(Tt))<V*(Math.abs(_)*(Math.abs(l.get(Zt-1,Zt-1))+Math.abs(pt)+Math.abs(l.get(Zt+1,Zt+1))))));)Zt--;for(Z=Zt+2;Z<=m;Z++)l.set(Z,Z-2,0),Z>Zt+2&&l.set(Z,Z-3,0);for(Ct=Zt;Ct<=m-1&&(we=Ct!==m-1,Ct!==Zt&&(_=l.get(Ct,Ct-1),lt=l.get(Ct+1,Ct-1),Tt=we?l.get(Ct+2,Ct-1):0,Yt=Math.abs(_)+Math.abs(lt)+Math.abs(Tt),Yt!==0&&(_=_/Yt,lt=lt/Yt,Tt=Tt/Yt)),Yt!==0);Ct++)if(ct=Math.sqrt(_*_+lt*lt+Tt*Tt),_<0&&(ct=-ct),ct!==0){for(Ct!==Zt?l.set(Ct,Ct-1,-ct*Yt):Kt!==Zt&&l.set(Ct,Ct-1,-l.get(Ct,Ct-1)),_=_+ct,Yt=_/ct,ce=lt/ct,pt=Tt/ct,lt=lt/_,Tt=Tt/_,St=Ct;St<T;St++)_=l.get(Ct,St)+lt*l.get(Ct+1,St),we&&(_=_+Tt*l.get(Ct+2,St),l.set(Ct+2,St,l.get(Ct+2,St)-_*pt)),l.set(Ct,St,l.get(Ct,St)-_*Yt),l.set(Ct+1,St,l.get(Ct+1,St)-_*ce);for(Z=0;Z<=Math.min(m,Ct+3);Z++)_=Yt*l.get(Z,Ct)+ce*l.get(Z,Ct+1),we&&(_=_+pt*l.get(Z,Ct+2),l.set(Z,Ct+2,l.get(Z,Ct+2)-_*Tt)),l.set(Z,Ct,l.get(Z,Ct)-_),l.set(Z,Ct+1,l.get(Z,Ct+1)-_*lt);for(Z=B;Z<=U;Z++)_=Yt*i.get(Z,Ct)+ce*i.get(Z,Ct+1),we&&(_=_+pt*i.get(Z,Ct+2),i.set(Z,Ct+2,i.get(Z,Ct+2)-_*Tt)),i.set(Z,Ct,i.get(Z,Ct)-_),i.set(Z,Ct+1,i.get(Z,Ct+1)-_*lt)}}}if(rt!==0){for(m=T-1;m>=0;m--)if(_=c[m],lt=u[m],lt===0)for(Kt=m,l.set(m,m,1),Z=m-1;Z>=0;Z--){for(Ut=l.get(Z,Z)-_,Tt=0,St=Kt;St<=m;St++)Tt=Tt+l.get(Z,St)*l.get(St,m);if(u[Z]<0)pt=Ut,ct=Tt;else if(Kt=Z,u[Z]===0?l.set(Z,m,Ut!==0?-Tt/Ut:-Tt/(V*rt)):(Yt=l.get(Z,Z+1),ce=l.get(Z+1,Z),lt=(c[Z]-_)*(c[Z]-_)+u[Z]*u[Z],ge=(Yt*ct-pt*Tt)/lt,l.set(Z,m,ge),l.set(Z+1,m,Math.abs(Yt)>Math.abs(pt)?(-Tt-Ut*ge)/Yt:(-ct-ce*ge)/pt)),ge=Math.abs(l.get(Z,m)),V*ge*ge>1)for(St=Z;St<=m;St++)l.set(St,m,l.get(St,m)/ge)}else if(lt<0)for(Kt=m-1,Math.abs(l.get(m,m-1))>Math.abs(l.get(m-1,m))?(l.set(m-1,m-1,lt/l.get(m,m-1)),l.set(m-1,m,-(l.get(m,m)-_)/l.get(m,m-1))):(ae=Tn(0,-l.get(m-1,m),l.get(m-1,m-1)-_,lt),l.set(m-1,m-1,ae[0]),l.set(m-1,m,ae[1])),l.set(m,m-1,0),l.set(m,m,1),Z=m-2;Z>=0;Z--){for(tt=0,wt=0,St=Kt;St<=m;St++)tt=tt+l.get(Z,St)*l.get(St,m-1),wt=wt+l.get(Z,St)*l.get(St,m);if(Ut=l.get(Z,Z)-_,u[Z]<0)pt=Ut,Tt=tt,ct=wt;else if(Kt=Z,u[Z]===0?(ae=Tn(-tt,-wt,Ut,lt),l.set(Z,m-1,ae[0]),l.set(Z,m,ae[1])):(Yt=l.get(Z,Z+1),ce=l.get(Z+1,Z),Lt=(c[Z]-_)*(c[Z]-_)+u[Z]*u[Z]-lt*lt,Mt=(c[Z]-_)*2*lt,Lt===0&&Mt===0&&(Lt=V*rt*(Math.abs(Ut)+Math.abs(lt)+Math.abs(Yt)+Math.abs(ce)+Math.abs(pt))),ae=Tn(Yt*Tt-pt*tt+lt*wt,Yt*ct-pt*wt-lt*tt,Lt,Mt),l.set(Z,m-1,ae[0]),l.set(Z,m,ae[1]),Math.abs(Yt)>Math.abs(pt)+Math.abs(lt)?(l.set(Z+1,m-1,(-tt-Ut*l.get(Z,m-1)+lt*l.get(Z,m))/Yt),l.set(Z+1,m,(-wt-Ut*l.get(Z,m)-lt*l.get(Z,m-1))/Yt)):(ae=Tn(-Tt-ce*l.get(Z,m-1),-ct-ce*l.get(Z,m),pt,lt),l.set(Z+1,m-1,ae[0]),l.set(Z+1,m,ae[1]))),ge=Math.max(Math.abs(l.get(Z,m-1)),Math.abs(l.get(Z,m))),V*ge*ge>1)for(St=Z;St<=m;St++)l.set(St,m-1,l.get(St,m-1)/ge),l.set(St,m,l.get(St,m)/ge)}for(Z=0;Z<T;Z++)if(Z<B||Z>U)for(St=Z;St<T;St++)i.set(Z,St,l.get(Z,St));for(St=T-1;St>=B;St--)for(Z=B;Z<=U;Z++){for(pt=0,Ct=B;Ct<=Math.min(St,U);Ct++)pt=pt+i.get(Z,Ct)*l.get(Ct,St);i.set(Z,St,pt)}}}function Tn(T,u,c,i){let l,m;return Math.abs(c)>Math.abs(i)?(l=i/c,m=c+l*i,[(T+l*u)/m,(u-l*T)/m]):(l=c/i,m=i+l*c,[(l*T+u)/m,(l*u-T)/m])}class Wn{constructor(u){if(u=Ae.checkMatrix(u),!u.isSymmetric())throw new Error("Matrix is not symmetric");let c=u,i=c.rows,l=new It(i,i),m=!0,B,U,V;for(U=0;U<i;U++){let G=0;for(V=0;V<U;V++){let rt=0;for(B=0;B<V;B++)rt+=l.get(V,B)*l.get(U,B);rt=(c.get(U,V)-rt)/l.get(V,V),l.set(U,V,rt),G=G+rt*rt}for(G=c.get(U,U)-G,m&&(m=G>0),l.set(U,U,Math.sqrt(Math.max(G,0))),V=U+1;V<i;V++)l.set(U,V,0)}this.L=l,this.positiveDefinite=m}isPositiveDefinite(){return this.positiveDefinite}solve(u){u=Ae.checkMatrix(u);let c=this.L,i=c.rows;if(u.rows!==i)throw new Error("Matrix dimensions do not match");if(this.isPositiveDefinite()===!1)throw new Error("Matrix is not positive definite");let l=u.columns,m=u.clone(),B,U,V;for(V=0;V<i;V++)for(U=0;U<l;U++){for(B=0;B<V;B++)m.set(V,U,m.get(V,U)-m.get(B,U)*c.get(V,B));m.set(V,U,m.get(V,U)/c.get(V,V))}for(V=i-1;V>=0;V--)for(U=0;U<l;U++){for(B=V+1;B<i;B++)m.set(V,U,m.get(V,U)-m.get(B,U)*c.get(B,V));m.set(V,U,m.get(V,U)/c.get(V,V))}return m}get lowerTriangularMatrix(){return this.L}}class yr{constructor(u,c={}){u=Ae.checkMatrix(u);let{Y:i}=c;const{scaleScores:l=!1,maxIterations:m=1e3,terminationCriteria:B=1e-10}=c;let U;if(i){if(ot.isAnyArray(i)&&typeof i[0]=="number"?i=It.columnVector(i):i=Ae.checkMatrix(i),i.rows!==u.rows)throw new Error("Y should have the same number of rows as X");U=i.getColumnVector(0)}else U=u.getColumnVector(0);let V=1,G,rt,_,lt;for(let Tt=0;Tt<m&&V>B;Tt++)_=u.transpose().mmul(U).div(U.transpose().mmul(U).get(0,0)),_=_.div(_.norm()),G=u.mmul(_).div(_.transpose().mmul(_).get(0,0)),Tt>0&&(V=G.clone().sub(lt).pow(2).sum()),lt=G.clone(),i?(rt=i.transpose().mmul(G).div(G.transpose().mmul(G).get(0,0)),rt=rt.div(rt.norm()),U=i.mmul(rt).div(rt.transpose().mmul(rt).get(0,0))):U=G;if(i){let Tt=u.transpose().mmul(G).div(G.transpose().mmul(G).get(0,0));Tt=Tt.div(Tt.norm());let ct=u.clone().sub(G.clone().mmul(Tt.transpose())),pt=U.transpose().mmul(G).div(G.transpose().mmul(G).get(0,0)),Rt=i.clone().sub(G.clone().mulS(pt.get(0,0)).mmul(rt.transpose()));this.t=G,this.p=Tt.transpose(),this.w=_.transpose(),this.q=rt,this.u=U,this.s=G.transpose().mmul(G),this.xResidual=ct,this.yResidual=Rt,this.betas=pt}else this.w=_.transpose(),this.s=G.transpose().mmul(G).sqrt(),l?this.t=G.clone().div(this.s.get(0,0)):this.t=G,this.xResidual=u.sub(G.mmul(_.transpose()))}}P.XA=Wt,P.a_=Wn,P.yQ=Wn,P.Hs=xe,P.Ec=Jn,P.dx=Jn,P.LU=$t,P.Rm=$t,P.y3=It,P.qK=On,P.pb=vn,P.j=Pn,P.sO=sn,P.BZ=Rn,P.EK=An,P.Db=mn,P.Fx=Bn,P.tU=Be,P.Ym=yr,P.rs=yr,P.QR=Un,P.TB=Un,P.oH=ln,P.Sc=ln,P.BN=Pe,P.it=ze,P.$r=Ae,P.QM=gr,P.AV=Gn,f=It,P.GH=Ln,P.SO=fr,P.uZ=Vn,P.yU=hr,P.F1=Zn,P.re=cr},92546:function(w,P,a){w.exports={graphlib:a(76626),layout:a(47194),debug:a(11303),util:{time:a(53063).time,notime:a(53063).notime},version:a(11897)}},81255:function(w,P,a){"use strict";var f=a(72361),x=a(39240);w.exports={run:E,undo:v};function E(N){var S=N.graph().acyclicer==="greedy"?x(N,M(N)):b(N);f.forEach(S,function(A){var I=N.edge(A);N.removeEdge(A),I.forwardName=A.name,I.reversed=!0,N.setEdge(A.w,A.v,I,f.uniqueId("rev"))});function M(A){return function(I){return A.edge(I).weight}}}function b(N){var S=[],M={},A={};function I(j){f.has(A,j)||(A[j]=!0,M[j]=!0,f.forEach(N.outEdges(j),function(D){f.has(M,D.w)?S.push(D):I(D.w)}),delete M[j])}return f.forEach(N.nodes(),I),S}function v(N){f.forEach(N.edges(),function(S){var M=N.edge(S);if(M.reversed){N.removeEdge(S);var A=M.forwardName;delete M.reversed,delete M.forwardName,N.setEdge(S.w,S.v,M,A)}})}},60765:function(w,P,a){var f=a(72361),x=a(53063);w.exports=E;function E(v){function N(S){var M=v.children(S),A=v.node(S);if(M.length&&f.forEach(M,N),f.has(A,"minRank")){A.borderLeft=[],A.borderRight=[];for(var I=A.minRank,j=A.maxRank+1;I<j;++I)b(v,"borderLeft","_bl",S,A,I),b(v,"borderRight","_br",S,A,I)}}f.forEach(v.children(),N)}function b(v,N,S,M,A,I){var j={width:0,height:0,rank:I,borderType:N},D=A[N][I-1],Y=x.addDummyNode(v,"border",j,S);A[N][I]=Y,v.setParent(Y,M),D&&v.setEdge(D,Y,{weight:1})}},13257:function(w,P,a){"use strict";var f=a(72361);w.exports={adjust:x,undo:E};function x(I){var j=I.graph().rankdir.toLowerCase();(j==="lr"||j==="rl")&&b(I)}function E(I){var j=I.graph().rankdir.toLowerCase();(j==="bt"||j==="rl")&&N(I),(j==="lr"||j==="rl")&&(M(I),b(I))}function b(I){f.forEach(I.nodes(),function(j){v(I.node(j))}),f.forEach(I.edges(),function(j){v(I.edge(j))})}function v(I){var j=I.width;I.width=I.height,I.height=j}function N(I){f.forEach(I.nodes(),function(j){S(I.node(j))}),f.forEach(I.edges(),function(j){var D=I.edge(j);f.forEach(D.points,S),f.has(D,"y")&&S(D)})}function S(I){I.y=-I.y}function M(I){f.forEach(I.nodes(),function(j){A(I.node(j))}),f.forEach(I.edges(),function(j){var D=I.edge(j);f.forEach(D.points,A),f.has(D,"x")&&A(D)})}function A(I){var j=I.x;I.x=I.y,I.y=j}},21135:function(w){w.exports=P;function P(){var x={};x._next=x._prev=x,this._sentinel=x}P.prototype.dequeue=function(){var x=this._sentinel,E=x._prev;if(E!==x)return a(E),E},P.prototype.enqueue=function(x){var E=this._sentinel;x._prev&&x._next&&a(x),x._next=E._next,E._next._prev=x,E._next=x,x._prev=E},P.prototype.toString=function(){for(var x=[],E=this._sentinel,b=E._prev;b!==E;)x.push(JSON.stringify(b,f)),b=b._prev;return"["+x.join(", ")+"]"};function a(x){x._prev._next=x._next,x._next._prev=x._prev,delete x._next,delete x._prev}function f(x,E){if(x!=="_next"&&x!=="_prev")return E}},11303:function(w,P,a){var f=a(72361),x=a(53063),E=a(76626).Graph;w.exports={debugOrdering:b};function b(v){var N=x.buildLayerMatrix(v),S=new E({compound:!0,multigraph:!0}).setGraph({});return f.forEach(v.nodes(),function(M){S.setNode(M,{label:M}),S.setParent(M,"layer"+v.node(M).rank)}),f.forEach(v.edges(),function(M){S.setEdge(M.v,M.w,{},M.name)}),f.forEach(N,function(M,A){var I="layer"+A;S.setNode(I,{rank:"same"}),f.reduce(M,function(j,D){return S.setEdge(j,D,{style:"invis"}),D})}),S}},76626:function(w,P,a){var f;try{f=a(75172)}catch(x){}f||(f=window.graphlib),w.exports=f},39240:function(w,P,a){var f=a(72361),x=a(76626).Graph,E=a(21135);w.exports=v;var b=f.constant(1);function v(I,j){if(I.nodeCount()<=1)return[];var D=M(I,j||b),Y=N(D.graph,D.buckets,D.zeroIdx);return f.flatten(f.map(Y,function(K){return I.outEdges(K.v,K.w)}),!0)}function N(I,j,D){for(var Y=[],K=j[j.length-1],ot=j[0],nt;I.nodeCount();){for(;nt=ot.dequeue();)S(I,j,D,nt);for(;nt=K.dequeue();)S(I,j,D,nt);if(I.nodeCount()){for(var Q=j.length-2;Q>0;--Q)if(nt=j[Q].dequeue(),nt){Y=Y.concat(S(I,j,D,nt,!0));break}}}return Y}function S(I,j,D,Y,K){var ot=K?[]:void 0;return f.forEach(I.inEdges(Y.v),function(nt){var Q=I.edge(nt),et=I.node(nt.v);K&&ot.push({v:nt.v,w:nt.w}),et.out-=Q,A(j,D,et)}),f.forEach(I.outEdges(Y.v),function(nt){var Q=I.edge(nt),et=nt.w,H=I.node(et);H.in-=Q,A(j,D,H)}),I.removeNode(Y.v),ot}function M(I,j){var D=new x,Y=0,K=0;f.forEach(I.nodes(),function(Q){D.setNode(Q,{v:Q,in:0,out:0})}),f.forEach(I.edges(),function(Q){var et=D.edge(Q.v,Q.w)||0,H=j(Q),it=et+H;D.setEdge(Q.v,Q.w,it),K=Math.max(K,D.node(Q.v).out+=H),Y=Math.max(Y,D.node(Q.w).in+=H)});var ot=f.range(K+Y+3).map(function(){return new E}),nt=Y+1;return f.forEach(D.nodes(),function(Q){A(ot,nt,D.node(Q))}),{graph:D,buckets:ot,zeroIdx:nt}}function A(I,j,D){D.out?D.in?I[D.out-D.in+j].enqueue(D):I[I.length-1].enqueue(D):I[0].enqueue(D)}},47194:function(w,P,a){"use strict";var f=a(72361),x=a(81255),E=a(27163),b=a(64505),v=a(53063).normalizeRanks,N=a(71970),S=a(53063).removeEmptyRanks,M=a(31733),A=a(60765),I=a(13257),j=a(62852),D=a(93021),Y=a(53063),K=a(76626).Graph;w.exports=ot;function ot(gt,vt){var At=vt&&vt.debugTiming?Y.time:Y.notime;At("layout",function(){var Ft=At(" buildLayoutGraph",function(){return yt(gt)});At(" runLayout",function(){nt(Ft,At)}),At(" updateInputGraph",function(){Q(gt,Ft)})})}function nt(gt,vt){vt(" makeSpaceForEdgeLabels",function(){Nt(gt)}),vt(" removeSelfEdges",function(){Mn(gt)}),vt(" acyclic",function(){x.run(gt)}),vt(" nestingGraph.run",function(){M.run(gt)}),vt(" rank",function(){b(Y.asNonCompoundGraph(gt))}),vt(" injectEdgeLabelProxies",function(){Ot(gt)}),vt(" removeEmptyRanks",function(){S(gt)}),vt(" nestingGraph.cleanup",function(){M.cleanup(gt)}),vt(" normalizeRanks",function(){v(gt)}),vt(" assignRankMinMax",function(){Bt(gt)}),vt(" removeEdgeLabelProxies",function(){Vt(gt)}),vt(" normalize.run",function(){E.run(gt)}),vt(" parentDummyChains",function(){N(gt)}),vt(" addBorderSegments",function(){A(gt)}),vt(" order",function(){j(gt)}),vt(" insertSelfEdges",function(){Sn(gt)}),vt(" adjustCoordinateSystem",function(){I.adjust(gt)}),vt(" position",function(){D(gt)}),vt(" positionSelfEdges",function(){cn(gt)}),vt(" removeBorderNodes",function(){nn(gt)}),vt(" normalize.undo",function(){E.undo(gt)}),vt(" fixupEdgeLabelCoords",function(){ye(gt)}),vt(" undoCoordinateSystem",function(){I.undo(gt)}),vt(" translateGraph",function(){Ht(gt)}),vt(" assignNodeIntersects",function(){ee(gt)}),vt(" reversePoints",function(){$e(gt)}),vt(" acyclic.undo",function(){x.undo(gt)})}function Q(gt,vt){f.forEach(gt.nodes(),function(At){var Ft=gt.node(At),qt=vt.node(At);Ft&&(Ft.x=qt.x,Ft.y=qt.y,vt.children(At).length&&(Ft.width=qt.width,Ft.height=qt.height))}),f.forEach(gt.edges(),function(At){var Ft=gt.edge(At),qt=vt.edge(At);Ft.points=qt.points,f.has(qt,"x")&&(Ft.x=qt.x,Ft.y=qt.y)}),gt.graph().width=vt.graph().width,gt.graph().height=vt.graph().height}var et=["nodesep","edgesep","ranksep","marginx","marginy"],H={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},it=["acyclicer","ranker","rankdir","align"],at=["width","height"],ft={width:0,height:0},ht=["minlen","weight","width","height","labeloffset"],dt={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},xt=["labelpos"];function yt(gt){var vt=new K({multigraph:!0,compound:!0}),At=an(gt.graph());return vt.setGraph(f.merge({},H,Je(At,et),f.pick(At,it))),f.forEach(gt.nodes(),function(Ft){var qt=an(gt.node(Ft));vt.setNode(Ft,f.defaults(Je(qt,at),ft)),vt.setParent(Ft,gt.parent(Ft))}),f.forEach(gt.edges(),function(Ft){var qt=an(gt.edge(Ft));vt.setEdge(Ft,f.merge({},dt,Je(qt,ht),f.pick(qt,xt)))}),vt}function Nt(gt){var vt=gt.graph();vt.ranksep/=2,f.forEach(gt.edges(),function(At){var Ft=gt.edge(At);Ft.minlen*=2,Ft.labelpos.toLowerCase()!=="c"&&(vt.rankdir==="TB"||vt.rankdir==="BT"?Ft.width+=Ft.labeloffset:Ft.height+=Ft.labeloffset)})}function Ot(gt){f.forEach(gt.edges(),function(vt){var At=gt.edge(vt);if(At.width&&At.height){var Ft=gt.node(vt.v),qt=gt.node(vt.w),ue={rank:(qt.rank-Ft.rank)/2+Ft.rank,e:vt};Y.addDummyNode(gt,"edge-proxy",ue,"_ep")}})}function Bt(gt){var vt=0;f.forEach(gt.nodes(),function(At){var Ft=gt.node(At);Ft.borderTop&&(Ft.minRank=gt.node(Ft.borderTop).rank,Ft.maxRank=gt.node(Ft.borderBottom).rank,vt=f.max(vt,Ft.maxRank))}),gt.graph().maxRank=vt}function Vt(gt){f.forEach(gt.nodes(),function(vt){var At=gt.node(vt);At.dummy==="edge-proxy"&&(gt.edge(At.e).labelRank=At.rank,gt.removeNode(vt))})}function Ht(gt){var vt=Number.POSITIVE_INFINITY,At=0,Ft=Number.POSITIVE_INFINITY,qt=0,ue=gt.graph(),he=ue.marginx||0,Ie=ue.marginy||0;function pn(De){var Me=De.x,se=De.y,Wt=De.width,re=De.height;vt=Math.min(vt,Me-Wt/2),At=Math.max(At,Me+Wt/2),Ft=Math.min(Ft,se-re/2),qt=Math.max(qt,se+re/2)}f.forEach(gt.nodes(),function(De){pn(gt.node(De))}),f.forEach(gt.edges(),function(De){var Me=gt.edge(De);f.has(Me,"x")&&pn(Me)}),vt-=he,Ft-=Ie,f.forEach(gt.nodes(),function(De){var Me=gt.node(De);Me.x-=vt,Me.y-=Ft}),f.forEach(gt.edges(),function(De){var Me=gt.edge(De);f.forEach(Me.points,function(se){se.x-=vt,se.y-=Ft}),f.has(Me,"x")&&(Me.x-=vt),f.has(Me,"y")&&(Me.y-=Ft)}),ue.width=At-vt+he,ue.height=qt-Ft+Ie}function ee(gt){f.forEach(gt.edges(),function(vt){var At=gt.edge(vt),Ft=gt.node(vt.v),qt=gt.node(vt.w),ue,he;At.points?(ue=At.points[0],he=At.points[At.points.length-1]):(At.points=[],ue=qt,he=Ft),At.points.unshift(Y.intersectRect(Ft,ue)),At.points.push(Y.intersectRect(qt,he))})}function ye(gt){f.forEach(gt.edges(),function(vt){var At=gt.edge(vt);if(f.has(At,"x"))switch((At.labelpos==="l"||At.labelpos==="r")&&(At.width-=At.labeloffset),At.labelpos){case"l":At.x-=At.width/2+At.labeloffset;break;case"r":At.x+=At.width/2+At.labeloffset;break}})}function $e(gt){f.forEach(gt.edges(),function(vt){var At=gt.edge(vt);At.reversed&&At.points.reverse()})}function nn(gt){f.forEach(gt.nodes(),function(vt){if(gt.children(vt).length){var At=gt.node(vt),Ft=gt.node(At.borderTop),qt=gt.node(At.borderBottom),ue=gt.node(f.last(At.borderLeft)),he=gt.node(f.last(At.borderRight));At.width=Math.abs(he.x-ue.x),At.height=Math.abs(qt.y-Ft.y),At.x=ue.x+At.width/2,At.y=Ft.y+At.height/2}}),f.forEach(gt.nodes(),function(vt){gt.node(vt).dummy==="border"&&gt.removeNode(vt)})}function Mn(gt){f.forEach(gt.edges(),function(vt){if(vt.v===vt.w){var At=gt.node(vt.v);At.selfEdges||(At.selfEdges=[]),At.selfEdges.push({e:vt,label:gt.edge(vt)}),gt.removeEdge(vt)}})}function Sn(gt){var vt=Y.buildLayerMatrix(gt);f.forEach(vt,function(At){var Ft=0;f.forEach(At,function(qt,ue){var he=gt.node(qt);he.order=ue+Ft,f.forEach(he.selfEdges,function(Ie){Y.addDummyNode(gt,"selfedge",{width:Ie.label.width,height:Ie.label.height,rank:he.rank,order:ue+ ++Ft,e:Ie.e,label:Ie.label},"_se")}),delete he.selfEdges})})}function cn(gt){f.forEach(gt.nodes(),function(vt){var At=gt.node(vt);if(At.dummy==="selfedge"){var Ft=gt.node(At.e.v),qt=Ft.x+Ft.width/2,ue=Ft.y,he=At.x-qt,Ie=Ft.height/2;gt.setEdge(At.e,At.label),gt.removeNode(vt),At.label.points=[{x:qt+2*he/3,y:ue-Ie},{x:qt+5*he/6,y:ue-Ie},{x:qt+he,y:ue},{x:qt+5*he/6,y:ue+Ie},{x:qt+2*he/3,y:ue+Ie}],At.label.x=At.x,At.label.y=At.y}})}function Je(gt,vt){return f.mapValues(f.pick(gt,vt),Number)}function an(gt){var vt={};return f.forEach(gt,function(At,Ft){vt[Ft.toLowerCase()]=At}),vt}},72361:function(w,P,a){var f;try{f={cloneDeep:a(44187),constant:a(46221),defaults:a(34981),each:a(61475),filter:a(3130),find:a(48835),flatten:a(1332),forEach:a(47177),forIn:a(59946),has:a(64760),isUndefined:a(68408),last:a(47522),map:a(81426),mapValues:a(60032),max:a(18038),merge:a(55056),min:a(60169),minBy:a(13604),now:a(76308),pick:a(72333),range:a(69235),reduce:a(9695),sortBy:a(35020),uniqueId:a(69624),values:a(72834),zipObject:a(79261)}}catch(x){}f||(f=window._),w.exports=f},31733:function(w,P,a){var f=a(72361),x=a(53063);w.exports={run:E,cleanup:S};function E(M){var A=x.addDummyNode(M,"root",{},"_root"),I=v(M),j=f.max(f.values(I))-1,D=2*j+1;M.graph().nestingRoot=A,f.forEach(M.edges(),function(K){M.edge(K).minlen*=D});var Y=N(M)+1;f.forEach(M.children(),function(K){b(M,A,D,Y,j,I,K)}),M.graph().nodeRankFactor=D}function b(M,A,I,j,D,Y,K){var ot=M.children(K);if(!ot.length){K!==A&&M.setEdge(A,K,{weight:0,minlen:I});return}var nt=x.addBorderNode(M,"_bt"),Q=x.addBorderNode(M,"_bb"),et=M.node(K);M.setParent(nt,K),et.borderTop=nt,M.setParent(Q,K),et.borderBottom=Q,f.forEach(ot,function(H){b(M,A,I,j,D,Y,H);var it=M.node(H),at=it.borderTop?it.borderTop:H,ft=it.borderBottom?it.borderBottom:H,ht=it.borderTop?j:2*j,dt=at!==ft?1:D-Y[K]+1;M.setEdge(nt,at,{weight:ht,minlen:dt,nestingEdge:!0}),M.setEdge(ft,Q,{weight:ht,minlen:dt,nestingEdge:!0})}),M.parent(K)||M.setEdge(A,nt,{weight:0,minlen:D+Y[K]})}function v(M){var A={};function I(j,D){var Y=M.children(j);Y&&Y.length&&f.forEach(Y,function(K){I(K,D+1)}),A[j]=D}return f.forEach(M.children(),function(j){I(j,1)}),A}function N(M){return f.reduce(M.edges(),function(A,I){return A+M.edge(I).weight},0)}function S(M){var A=M.graph();M.removeNode(A.nestingRoot),delete A.nestingRoot,f.forEach(M.edges(),function(I){var j=M.edge(I);j.nestingEdge&&M.removeEdge(I)})}},27163:function(w,P,a){"use strict";var f=a(72361),x=a(53063);w.exports={run:E,undo:v};function E(N){N.graph().dummyChains=[],f.forEach(N.edges(),function(S){b(N,S)})}function b(N,S){var M=S.v,A=N.node(M).rank,I=S.w,j=N.node(I).rank,D=S.name,Y=N.edge(S),K=Y.labelRank;if(j!==A+1){N.removeEdge(S);var ot,nt,Q;for(Q=0,++A;A<j;++Q,++A)Y.points=[],nt={width:0,height:0,edgeLabel:Y,edgeObj:S,rank:A},ot=x.addDummyNode(N,"edge",nt,"_d"),A===K&&(nt.width=Y.width,nt.height=Y.height,nt.dummy="edge-label",nt.labelpos=Y.labelpos),N.setEdge(M,ot,{weight:Y.weight},D),Q===0&&N.graph().dummyChains.push(ot),M=ot;N.setEdge(M,I,{weight:Y.weight},D)}}function v(N){f.forEach(N.graph().dummyChains,function(S){var M=N.node(S),A=M.edgeLabel,I;for(N.setEdge(M.edgeObj,A);M.dummy;)I=N.successors(S)[0],N.removeNode(S),A.points.push({x:M.x,y:M.y}),M.dummy==="edge-label"&&(A.x=M.x,A.y=M.y,A.width=M.width,A.height=M.height),S=I,M=N.node(S)})}},52205:function(w,P,a){var f=a(72361);w.exports=x;function x(E,b,v){var N={},S;f.forEach(v,function(M){for(var A=E.parent(M),I,j;A;){if(I=E.parent(A),I?(j=N[I],N[I]=A):(j=S,S=A),j&&j!==A){b.setEdge(j,A);return}A=I}})}},99506:function(w,P,a){var f=a(72361);w.exports=x;function x(E,b){return f.map(b,function(v){var N=E.inEdges(v);if(N.length){var S=f.reduce(N,function(M,A){var I=E.edge(A),j=E.node(A.v);return{sum:M.sum+I.weight*j.order,weight:M.weight+I.weight}},{sum:0,weight:0});return{v,barycenter:S.sum/S.weight,weight:S.weight}}else return{v}})}},59105:function(w,P,a){var f=a(72361),x=a(76626).Graph;w.exports=E;function E(v,N,S){var M=b(v),A=new x({compound:!0}).setGraph({root:M}).setDefaultNodeLabel(function(I){return v.node(I)});return f.forEach(v.nodes(),function(I){var j=v.node(I),D=v.parent(I);(j.rank===N||j.minRank<=N&&N<=j.maxRank)&&(A.setNode(I),A.setParent(I,D||M),f.forEach(v[S](I),function(Y){var K=Y.v===I?Y.w:Y.v,ot=A.edge(K,I),nt=f.isUndefined(ot)?0:ot.weight;A.setEdge(K,I,{weight:v.edge(Y).weight+nt})}),f.has(j,"minRank")&&A.setNode(I,{borderLeft:j.borderLeft[N],borderRight:j.borderRight[N]}))}),A}function b(v){for(var N;v.hasNode(N=f.uniqueId("_root")););return N}},45456:function(w,P,a){"use strict";var f=a(72361);w.exports=x;function x(b,v){for(var N=0,S=1;S<v.length;++S)N+=E(b,v[S-1],v[S]);return N}function E(b,v,N){for(var S=f.zipObject(N,f.map(N,function(Y,K){return K})),M=f.flatten(f.map(v,function(Y){return f.sortBy(f.map(b.outEdges(Y),function(K){return{pos:S[K.w],weight:b.edge(K).weight}}),"pos")}),!0),A=1;A<N.length;)A<<=1;var I=2*A-1;A-=1;var j=f.map(new Array(I),function(){return 0}),D=0;return f.forEach(M.forEach(function(Y){var K=Y.pos+A;j[K]+=Y.weight;for(var ot=0;K>0;)K%2&&(ot+=j[K+1]),K=K-1>>1,j[K]+=Y.weight;D+=Y.weight*ot})),D}},62852:function(w,P,a){"use strict";var f=a(72361),x=a(18043),E=a(45456),b=a(86490),v=a(59105),N=a(52205),S=a(76626).Graph,M=a(53063);w.exports=A;function A(Y){var K=M.maxRank(Y),ot=I(Y,f.range(1,K+1),"inEdges"),nt=I(Y,f.range(K-1,-1,-1),"outEdges"),Q=x(Y);D(Y,Q);for(var et=Number.POSITIVE_INFINITY,H,it=0,at=0;at<4;++it,++at){j(it%2?ot:nt,it%4>=2),Q=M.buildLayerMatrix(Y);var ft=E(Y,Q);ft<et&&(at=0,H=f.cloneDeep(Q),et=ft)}D(Y,H)}function I(Y,K,ot){return f.map(K,function(nt){return v(Y,nt,ot)})}function j(Y,K){var ot=new S;f.forEach(Y,function(nt){var Q=nt.graph().root,et=b(nt,Q,ot,K);f.forEach(et.vs,function(H,it){nt.node(H).order=it}),N(nt,ot,et.vs)})}function D(Y,K){f.forEach(K,function(ot){f.forEach(ot,function(nt,Q){Y.node(nt).order=Q})})}},18043:function(w,P,a){"use strict";var f=a(72361);w.exports=x;function x(E){var b={},v=f.filter(E.nodes(),function(I){return!E.children(I).length}),N=f.max(f.map(v,function(I){return E.node(I).rank})),S=f.map(f.range(N+1),function(){return[]});function M(I){if(!f.has(b,I)){b[I]=!0;var j=E.node(I);S[j.rank].push(I),f.forEach(E.successors(I),M)}}var A=f.sortBy(v,function(I){return E.node(I).rank});return f.forEach(A,M),S}},45926:function(w,P,a){"use strict";var f=a(72361);w.exports=x;function x(v,N){var S={};f.forEach(v,function(A,I){var j=S[A.v]={indegree:0,in:[],out:[],vs:[A.v],i:I};f.isUndefined(A.barycenter)||(j.barycenter=A.barycenter,j.weight=A.weight)}),f.forEach(N.edges(),function(A){var I=S[A.v],j=S[A.w];!f.isUndefined(I)&&!f.isUndefined(j)&&(j.indegree++,I.out.push(S[A.w]))});var M=f.filter(S,function(A){return!A.indegree});return E(M)}function E(v){var N=[];function S(I){return function(j){j.merged||(f.isUndefined(j.barycenter)||f.isUndefined(I.barycenter)||j.barycenter>=I.barycenter)&&b(I,j)}}function M(I){return function(j){j.in.push(I),--j.indegree===0&&v.push(j)}}for(;v.length;){var A=v.pop();N.push(A),f.forEach(A.in.reverse(),S(A)),f.forEach(A.out,M(A))}return f.map(f.filter(N,function(I){return!I.merged}),function(I){return f.pick(I,["vs","i","barycenter","weight"])})}function b(v,N){var S=0,M=0;v.weight&&(S+=v.barycenter*v.weight,M+=v.weight),N.weight&&(S+=N.barycenter*N.weight,M+=N.weight),v.vs=N.vs.concat(v.vs),v.barycenter=S/M,v.weight=M,v.i=Math.min(N.i,v.i),N.merged=!0}},86490:function(w,P,a){var f=a(72361),x=a(99506),E=a(45926),b=a(1349);w.exports=v;function v(M,A,I,j){var D=M.children(A),Y=M.node(A),K=Y?Y.borderLeft:void 0,ot=Y?Y.borderRight:void 0,nt={};K&&(D=f.filter(D,function(ft){return ft!==K&&ft!==ot}));var Q=x(M,D);f.forEach(Q,function(ft){if(M.children(ft.v).length){var ht=v(M,ft.v,I,j);nt[ft.v]=ht,f.has(ht,"barycenter")&&S(ft,ht)}});var et=E(Q,I);N(et,nt);var H=b(et,j);if(K&&(H.vs=f.flatten([K,H.vs,ot],!0),M.predecessors(K).length)){var it=M.node(M.predecessors(K)[0]),at=M.node(M.predecessors(ot)[0]);f.has(H,"barycenter")||(H.barycenter=0,H.weight=0),H.barycenter=(H.barycenter*H.weight+it.order+at.order)/(H.weight+2),H.weight+=2}return H}function N(M,A){f.forEach(M,function(I){I.vs=f.flatten(I.vs.map(function(j){return A[j]?A[j].vs:j}),!0)})}function S(M,A){f.isUndefined(M.barycenter)?(M.barycenter=A.barycenter,M.weight=A.weight):(M.barycenter=(M.barycenter*M.weight+A.barycenter*A.weight)/(M.weight+A.weight),M.weight+=A.weight)}},1349:function(w,P,a){var f=a(72361),x=a(53063);w.exports=E;function E(N,S){var M=x.partition(N,function(nt){return f.has(nt,"barycenter")}),A=M.lhs,I=f.sortBy(M.rhs,function(nt){return-nt.i}),j=[],D=0,Y=0,K=0;A.sort(v(!!S)),K=b(j,I,K),f.forEach(A,function(nt){K+=nt.vs.length,j.push(nt.vs),D+=nt.barycenter*nt.weight,Y+=nt.weight,K=b(j,I,K)});var ot={vs:f.flatten(j,!0)};return Y&&(ot.barycenter=D/Y,ot.weight=Y),ot}function b(N,S,M){for(var A;S.length&&(A=f.last(S)).i<=M;)S.pop(),N.push(A.vs),M++;return M}function v(N){return function(S,M){return S.barycenter<M.barycenter?-1:S.barycenter>M.barycenter?1:N?M.i-S.i:S.i-M.i}}},71970:function(w,P,a){var f=a(72361);w.exports=x;function x(v){var N=b(v);f.forEach(v.graph().dummyChains,function(S){for(var M=v.node(S),A=M.edgeObj,I=E(v,N,A.v,A.w),j=I.path,D=I.lca,Y=0,K=j[Y],ot=!0;S!==A.w;){if(M=v.node(S),ot){for(;(K=j[Y])!==D&&v.node(K).maxRank<M.rank;)Y++;K===D&&(ot=!1)}if(!ot){for(;Y<j.length-1&&v.node(K=j[Y+1]).minRank<=M.rank;)Y++;K=j[Y]}v.setParent(S,K),S=v.successors(S)[0]}})}function E(v,N,S,M){var A=[],I=[],j=Math.min(N[S].low,N[M].low),D=Math.max(N[S].lim,N[M].lim),Y,K;Y=S;do Y=v.parent(Y),A.push(Y);while(Y&&(N[Y].low>j||D>N[Y].lim));for(K=Y,Y=M;(Y=v.parent(Y))!==K;)I.push(Y);return{path:A.concat(I.reverse()),lca:K}}function b(v){var N={},S=0;function M(A){var I=S;f.forEach(v.children(A),M),N[A]={low:I,lim:S++}}return f.forEach(v.children(),M),N}},25515:function(w,P,a){"use strict";var f=a(72361),x=a(76626).Graph,E=a(53063);w.exports={positionX:ot,findType1Conflicts:b,findType2Conflicts:v,addConflict:S,hasConflict:M,verticalAlignment:A,horizontalCompaction:I,alignCoordinates:Y,findSmallestWidthAlignment:D,balance:K};function b(et,H){var it={};function at(ft,ht){var dt=0,xt=0,yt=ft.length,Nt=f.last(ht);return f.forEach(ht,function(Ot,Bt){var Vt=N(et,Ot),Ht=Vt?et.node(Vt).order:yt;(Vt||Ot===Nt)&&(f.forEach(ht.slice(xt,Bt+1),function(ee){f.forEach(et.predecessors(ee),function(ye){var $e=et.node(ye),nn=$e.order;(nn<dt||Ht<nn)&&!($e.dummy&&et.node(ee).dummy)&&S(it,ye,ee)})}),xt=Bt+1,dt=Ht)}),ht}return f.reduce(H,at),it}function v(et,H){var it={};function at(ht,dt,xt,yt,Nt){var Ot;f.forEach(f.range(dt,xt),function(Bt){Ot=ht[Bt],et.node(Ot).dummy&&f.forEach(et.predecessors(Ot),function(Vt){var Ht=et.node(Vt);Ht.dummy&&(Ht.order<yt||Ht.order>Nt)&&S(it,Vt,Ot)})})}function ft(ht,dt){var xt=-1,yt,Nt=0;return f.forEach(dt,function(Ot,Bt){if(et.node(Ot).dummy==="border"){var Vt=et.predecessors(Ot);Vt.length&&(yt=et.node(Vt[0]).order,at(dt,Nt,Bt,xt,yt),Nt=Bt,xt=yt)}at(dt,Nt,dt.length,yt,ht.length)}),dt}return f.reduce(H,ft),it}function N(et,H){if(et.node(H).dummy)return f.find(et.predecessors(H),function(it){return et.node(it).dummy})}function S(et,H,it){if(H>it){var at=H;H=it,it=at}var ft=et[H];ft||(et[H]=ft={}),ft[it]=!0}function M(et,H,it){if(H>it){var at=H;H=it,it=at}return f.has(et[H],it)}function A(et,H,it,at){var ft={},ht={},dt={};return f.forEach(H,function(xt){f.forEach(xt,function(yt,Nt){ft[yt]=yt,ht[yt]=yt,dt[yt]=Nt})}),f.forEach(H,function(xt){var yt=-1;f.forEach(xt,function(Nt){var Ot=at(Nt);if(Ot.length){Ot=f.sortBy(Ot,function(ye){return dt[ye]});for(var Bt=(Ot.length-1)/2,Vt=Math.floor(Bt),Ht=Math.ceil(Bt);Vt<=Ht;++Vt){var ee=Ot[Vt];ht[Nt]===Nt&&yt<dt[ee]&&!M(it,Nt,ee)&&(ht[ee]=Nt,ht[Nt]=ft[Nt]=ft[ee],yt=dt[ee])}}})}),{root:ft,align:ht}}function I(et,H,it,at,ft){var ht={},dt=j(et,H,it,ft),xt=ft?"borderLeft":"borderRight";function yt(Bt,Vt){for(var Ht=dt.nodes(),ee=Ht.pop(),ye={};ee;)ye[ee]?Bt(ee):(ye[ee]=!0,Ht.push(ee),Ht=Ht.concat(Vt(ee))),ee=Ht.pop()}function Nt(Bt){ht[Bt]=dt.inEdges(Bt).reduce(function(Vt,Ht){return Math.max(Vt,ht[Ht.v]+dt.edge(Ht))},0)}function Ot(Bt){var Vt=dt.outEdges(Bt).reduce(function(ee,ye){return Math.min(ee,ht[ye.w]-dt.edge(ye))},Number.POSITIVE_INFINITY),Ht=et.node(Bt);Vt!==Number.POSITIVE_INFINITY&&Ht.borderType!==xt&&(ht[Bt]=Math.max(ht[Bt],Vt))}return yt(Nt,dt.predecessors.bind(dt)),yt(Ot,dt.successors.bind(dt)),f.forEach(at,function(Bt){ht[Bt]=ht[it[Bt]]}),ht}function j(et,H,it,at){var ft=new x,ht=et.graph(),dt=nt(ht.nodesep,ht.edgesep,at);return f.forEach(H,function(xt){var yt;f.forEach(xt,function(Nt){var Ot=it[Nt];if(ft.setNode(Ot),yt){var Bt=it[yt],Vt=ft.edge(Bt,Ot);ft.setEdge(Bt,Ot,Math.max(dt(et,Nt,yt),Vt||0))}yt=Nt})}),ft}function D(et,H){return f.minBy(f.values(H),function(it){var at=Number.NEGATIVE_INFINITY,ft=Number.POSITIVE_INFINITY;return f.forIn(it,function(ht,dt){var xt=Q(et,dt)/2;at=Math.max(ht+xt,at),ft=Math.min(ht-xt,ft)}),at-ft})}function Y(et,H){var it=f.values(H),at=f.min(it),ft=f.max(it);f.forEach(["u","d"],function(ht){f.forEach(["l","r"],function(dt){var xt=ht+dt,yt=et[xt],Nt;if(yt!==H){var Ot=f.values(yt);Nt=dt==="l"?at-f.min(Ot):ft-f.max(Ot),Nt&&(et[xt]=f.mapValues(yt,function(Bt){return Bt+Nt}))}})})}function K(et,H){return f.mapValues(et.ul,function(it,at){if(H)return et[H.toLowerCase()][at];var ft=f.sortBy(f.map(et,at));return(ft[1]+ft[2])/2})}function ot(et){var H=E.buildLayerMatrix(et),it=f.merge(b(et,H),v(et,H)),at={},ft;f.forEach(["u","d"],function(dt){ft=dt==="u"?H:f.values(H).reverse(),f.forEach(["l","r"],function(xt){xt==="r"&&(ft=f.map(ft,function(Bt){return f.values(Bt).reverse()}));var yt=(dt==="u"?et.predecessors:et.successors).bind(et),Nt=A(et,ft,it,yt),Ot=I(et,ft,Nt.root,Nt.align,xt==="r");xt==="r"&&(Ot=f.mapValues(Ot,function(Bt){return-Bt})),at[dt+xt]=Ot})});var ht=D(et,at);return Y(at,ht),K(at,et.graph().align)}function nt(et,H,it){return function(at,ft,ht){var dt=at.node(ft),xt=at.node(ht),yt=0,Nt;if(yt+=dt.width/2,f.has(dt,"labelpos"))switch(dt.labelpos.toLowerCase()){case"l":Nt=-dt.width/2;break;case"r":Nt=dt.width/2;break}if(Nt&&(yt+=it?Nt:-Nt),Nt=0,yt+=(dt.dummy?H:et)/2,yt+=(xt.dummy?H:et)/2,yt+=xt.width/2,f.has(xt,"labelpos"))switch(xt.labelpos.toLowerCase()){case"l":Nt=xt.width/2;break;case"r":Nt=-xt.width/2;break}return Nt&&(yt+=it?Nt:-Nt),Nt=0,yt}}function Q(et,H){return et.node(H).width}},93021:function(w,P,a){"use strict";var f=a(72361),x=a(53063),E=a(25515).positionX;w.exports=b;function b(N){N=x.asNonCompoundGraph(N),v(N),f.forEach(E(N),function(S,M){N.node(M).x=S})}function v(N){var S=x.buildLayerMatrix(N),M=N.graph().ranksep,A=0;f.forEach(S,function(I){var j=f.max(f.map(I,function(D){return N.node(D).height}));f.forEach(I,function(D){N.node(D).y=A+j/2}),A+=j+M})}},61031:function(w,P,a){"use strict";var f=a(72361),x=a(76626).Graph,E=a(2416).slack;w.exports=b;function b(M){var A=new x({directed:!1}),I=M.nodes()[0],j=M.nodeCount();A.setNode(I,{});for(var D,Y;v(A,M)<j;)D=N(A,M),Y=A.hasNode(D.v)?E(M,D):-E(M,D),S(A,M,Y);return A}function v(M,A){function I(j){f.forEach(A.nodeEdges(j),function(D){var Y=D.v,K=j===Y?D.w:Y;!M.hasNode(K)&&!E(A,D)&&(M.setNode(K,{}),M.setEdge(j,K,{}),I(K))})}return f.forEach(M.nodes(),I),M.nodeCount()}function N(M,A){return f.minBy(A.edges(),function(I){if(M.hasNode(I.v)!==M.hasNode(I.w))return E(A,I)})}function S(M,A,I){f.forEach(M.nodes(),function(j){A.node(j).rank+=I})}},64505:function(w,P,a){"use strict";var f=a(2416),x=f.longestPath,E=a(61031),b=a(77076);w.exports=v;function v(A){switch(A.graph().ranker){case"network-simplex":M(A);break;case"tight-tree":S(A);break;case"longest-path":N(A);break;default:M(A)}}var N=x;function S(A){x(A),E(A)}function M(A){b(A)}},77076:function(w,P,a){"use strict";var f=a(72361),x=a(61031),E=a(2416).slack,b=a(2416).longestPath,v=a(76626).alg.preorder,N=a(76626).alg.postorder,S=a(53063).simplify;w.exports=M,M.initLowLimValues=D,M.initCutValues=A,M.calcCutValue=j,M.leaveEdge=K,M.enterEdge=ot,M.exchangeEdges=nt;function M(it){it=S(it),b(it);var at=x(it);D(at),A(at,it);for(var ft,ht;ft=K(at);)ht=ot(at,it,ft),nt(at,it,ft,ht)}function A(it,at){var ft=N(it,it.nodes());ft=ft.slice(0,ft.length-1),f.forEach(ft,function(ht){I(it,at,ht)})}function I(it,at,ft){var ht=it.node(ft),dt=ht.parent;it.edge(ft,dt).cutvalue=j(it,at,ft)}function j(it,at,ft){var ht=it.node(ft),dt=ht.parent,xt=!0,yt=at.edge(ft,dt),Nt=0;return yt||(xt=!1,yt=at.edge(dt,ft)),Nt=yt.weight,f.forEach(at.nodeEdges(ft),function(Ot){var Bt=Ot.v===ft,Vt=Bt?Ot.w:Ot.v;if(Vt!==dt){var Ht=Bt===xt,ee=at.edge(Ot).weight;if(Nt+=Ht?ee:-ee,et(it,ft,Vt)){var ye=it.edge(ft,Vt).cutvalue;Nt+=Ht?-ye:ye}}}),Nt}function D(it,at){arguments.length<2&&(at=it.nodes()[0]),Y(it,{},1,at)}function Y(it,at,ft,ht,dt){var xt=ft,yt=it.node(ht);return at[ht]=!0,f.forEach(it.neighbors(ht),function(Nt){f.has(at,Nt)||(ft=Y(it,at,ft,Nt,ht))}),yt.low=xt,yt.lim=ft++,dt?yt.parent=dt:delete yt.parent,ft}function K(it){return f.find(it.edges(),function(at){return it.edge(at).cutvalue<0})}function ot(it,at,ft){var ht=ft.v,dt=ft.w;at.hasEdge(ht,dt)||(ht=ft.w,dt=ft.v);var xt=it.node(ht),yt=it.node(dt),Nt=xt,Ot=!1;xt.lim>yt.lim&&(Nt=yt,Ot=!0);var Bt=f.filter(at.edges(),function(Vt){return Ot===H(it,it.node(Vt.v),Nt)&&Ot!==H(it,it.node(Vt.w),Nt)});return f.minBy(Bt,function(Vt){return E(at,Vt)})}function nt(it,at,ft,ht){var dt=ft.v,xt=ft.w;it.removeEdge(dt,xt),it.setEdge(ht.v,ht.w,{}),D(it),A(it,at),Q(it,at)}function Q(it,at){var ft=f.find(it.nodes(),function(dt){return!at.node(dt).parent}),ht=v(it,ft);ht=ht.slice(1),f.forEach(ht,function(dt){var xt=it.node(dt).parent,yt=at.edge(dt,xt),Nt=!1;yt||(yt=at.edge(xt,dt),Nt=!0),at.node(dt).rank=at.node(xt).rank+(Nt?yt.minlen:-yt.minlen)})}function et(it,at,ft){return it.hasEdge(at,ft)}function H(it,at,ft){return ft.low<=at.lim&&at.lim<=ft.lim}},2416:function(w,P,a){"use strict";var f=a(72361);w.exports={longestPath:x,slack:E};function x(b){var v={};function N(S){var M=b.node(S);if(f.has(v,S))return M.rank;v[S]=!0;var A=f.min(f.map(b.outEdges(S),function(I){return N(I.w)-b.edge(I).minlen}));return(A===Number.POSITIVE_INFINITY||A===void 0||A===null)&&(A=0),M.rank=A}f.forEach(b.sources(),N)}function E(b,v){return b.node(v.w).rank-b.node(v.v).rank-b.edge(v).minlen}},53063:function(w,P,a){"use strict";var f=a(72361),x=a(76626).Graph;w.exports={addDummyNode:E,simplify:b,asNonCompoundGraph:v,successorWeights:N,predecessorWeights:S,intersectRect:M,buildLayerMatrix:A,normalizeRanks:I,removeEmptyRanks:j,addBorderNode:D,maxRank:Y,partition:K,time:ot,notime:nt};function E(Q,et,H,it){var at;do at=f.uniqueId(it);while(Q.hasNode(at));return H.dummy=et,Q.setNode(at,H),at}function b(Q){var et=new x().setGraph(Q.graph());return f.forEach(Q.nodes(),function(H){et.setNode(H,Q.node(H))}),f.forEach(Q.edges(),function(H){var it=et.edge(H.v,H.w)||{weight:0,minlen:1},at=Q.edge(H);et.setEdge(H.v,H.w,{weight:it.weight+at.weight,minlen:Math.max(it.minlen,at.minlen)})}),et}function v(Q){var et=new x({multigraph:Q.isMultigraph()}).setGraph(Q.graph());return f.forEach(Q.nodes(),function(H){Q.children(H).length||et.setNode(H,Q.node(H))}),f.forEach(Q.edges(),function(H){et.setEdge(H,Q.edge(H))}),et}function N(Q){var et=f.map(Q.nodes(),function(H){var it={};return f.forEach(Q.outEdges(H),function(at){it[at.w]=(it[at.w]||0)+Q.edge(at).weight}),it});return f.zipObject(Q.nodes(),et)}function S(Q){var et=f.map(Q.nodes(),function(H){var it={};return f.forEach(Q.inEdges(H),function(at){it[at.v]=(it[at.v]||0)+Q.edge(at).weight}),it});return f.zipObject(Q.nodes(),et)}function M(Q,et){var H=Q.x,it=Q.y,at=et.x-H,ft=et.y-it,ht=Q.width/2,dt=Q.height/2;if(!at&&!ft)throw new Error("Not possible to find intersection inside of the rectangle");var xt,yt;return Math.abs(ft)*ht>Math.abs(at)*dt?(ft<0&&(dt=-dt),xt=dt*at/ft,yt=dt):(at<0&&(ht=-ht),xt=ht,yt=ht*ft/at),{x:H+xt,y:it+yt}}function A(Q){var et=f.map(f.range(Y(Q)+1),function(){return[]});return f.forEach(Q.nodes(),function(H){var it=Q.node(H),at=it.rank;f.isUndefined(at)||(et[at][it.order]=H)}),et}function I(Q){var et=f.min(f.map(Q.nodes(),function(H){return Q.node(H).rank}));f.forEach(Q.nodes(),function(H){var it=Q.node(H);f.has(it,"rank")&&(it.rank-=et)})}function j(Q){var et=f.min(f.map(Q.nodes(),function(ft){return Q.node(ft).rank})),H=[];f.forEach(Q.nodes(),function(ft){var ht=Q.node(ft).rank-et;H[ht]||(H[ht]=[]),H[ht].push(ft)});var it=0,at=Q.graph().nodeRankFactor;f.forEach(H,function(ft,ht){f.isUndefined(ft)&&ht%at!==0?--it:it&&f.forEach(ft,function(dt){Q.node(dt).rank+=it})})}function D(Q,et,H,it){var at={width:0,height:0};return arguments.length>=4&&(at.rank=H,at.order=it),E(Q,"border",at,et)}function Y(Q){return f.max(f.map(Q.nodes(),function(et){var H=Q.node(et).rank;if(!f.isUndefined(H))return H}))}function K(Q,et){var H={lhs:[],rhs:[]};return f.forEach(Q,function(it){et(it)?H.lhs.push(it):H.rhs.push(it)}),H}function ot(Q,et){var H=f.now();try{return et()}finally{console.log(Q+" time: "+(f.now()-H)+"ms")}}function nt(Q,et){return et()}},11897:function(w){w.exports="0.8.5"},75172:function(w,P,a){var f=a(89224);w.exports={Graph:f.Graph,json:a(17401),alg:a(54613),version:f.version}},91606:function(w,P,a){var f=a(95329);w.exports=x;function x(E){var b={},v=[],N;function S(M){f.has(b,M)||(b[M]=!0,N.push(M),f.each(E.successors(M),S),f.each(E.predecessors(M),S))}return f.each(E.nodes(),function(M){N=[],S(M),N.length&&v.push(N)}),v}},21482:function(w,P,a){var f=a(95329);w.exports=x;function x(b,v,N){f.isArray(v)||(v=[v]);var S=(b.isDirected()?b.successors:b.neighbors).bind(b),M=[],A={};return f.each(v,function(I){if(!b.hasNode(I))throw new Error("Graph does not have node: "+I);E(b,I,N==="post",A,S,M)}),M}function E(b,v,N,S,M,A){f.has(S,v)||(S[v]=!0,N||A.push(v),f.each(M(v),function(I){E(b,I,N,S,M,A)}),N&&A.push(v))}},40845:function(w,P,a){var f=a(13746),x=a(95329);w.exports=E;function E(b,v,N){return x.transform(b.nodes(),function(S,M){S[M]=f(b,M,v,N)},{})}},13746:function(w,P,a){var f=a(95329),x=a(36614);w.exports=b;var E=f.constant(1);function b(N,S,M,A){return v(N,String(S),M||E,A||function(I){return N.outEdges(I)})}function v(N,S,M,A){var I={},j=new x,D,Y,K=function(ot){var nt=ot.v!==D?ot.v:ot.w,Q=I[nt],et=M(ot),H=Y.distance+et;if(et<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+ot+" Weight: "+et);H<Q.distance&&(Q.distance=H,Q.predecessor=D,j.decrease(nt,H))};for(N.nodes().forEach(function(ot){var nt=ot===S?0:Number.POSITIVE_INFINITY;I[ot]={distance:nt},j.add(ot,nt)});j.size()>0&&(D=j.removeMin(),Y=I[D],Y.distance!==Number.POSITIVE_INFINITY);)A(D).forEach(K);return I}},59324:function(w,P,a){var f=a(95329),x=a(94558);w.exports=E;function E(b){return f.filter(x(b),function(v){return v.length>1||v.length===1&&b.hasEdge(v[0],v[0])})}},22893:function(w,P,a){var f=a(95329);w.exports=E;var x=f.constant(1);function E(v,N,S){return b(v,N||x,S||function(M){return v.outEdges(M)})}function b(v,N,S){var M={},A=v.nodes();return A.forEach(function(I){M[I]={},M[I][I]={distance:0},A.forEach(function(j){I!==j&&(M[I][j]={distance:Number.POSITIVE_INFINITY})}),S(I).forEach(function(j){var D=j.v===I?j.w:j.v,Y=N(j);M[I][D]={distance:Y,predecessor:I}})}),A.forEach(function(I){var j=M[I];A.forEach(function(D){var Y=M[D];A.forEach(function(K){var ot=Y[I],nt=j[K],Q=Y[K],et=ot.distance+nt.distance;et<Q.distance&&(Q.distance=et,Q.predecessor=nt.predecessor)})})}),M}},54613:function(w,P,a){w.exports={components:a(91606),dijkstra:a(13746),dijkstraAll:a(40845),findCycles:a(59324),floydWarshall:a(22893),isAcyclic:a(588),postorder:a(98049),preorder:a(67158),prim:a(66058),tarjan:a(94558),topsort:a(7793)}},588:function(w,P,a){var f=a(7793);w.exports=x;function x(E){try{f(E)}catch(b){if(b instanceof f.CycleException)return!1;throw b}return!0}},98049:function(w,P,a){var f=a(21482);w.exports=x;function x(E,b){return f(E,b,"post")}},67158:function(w,P,a){var f=a(21482);w.exports=x;function x(E,b){return f(E,b,"pre")}},66058:function(w,P,a){var f=a(95329),x=a(6349),E=a(36614);w.exports=b;function b(v,N){var S=new x,M={},A=new E,I;function j(Y){var K=Y.v===I?Y.w:Y.v,ot=A.priority(K);if(ot!==void 0){var nt=N(Y);nt<ot&&(M[K]=I,A.decrease(K,nt))}}if(v.nodeCount()===0)return S;f.each(v.nodes(),function(Y){A.add(Y,Number.POSITIVE_INFINITY),S.setNode(Y)}),A.decrease(v.nodes()[0],0);for(var D=!1;A.size()>0;){if(I=A.removeMin(),f.has(M,I))S.setEdge(I,M[I]);else{if(D)throw new Error("Input graph is not connected: "+v);D=!0}v.nodeEdges(I).forEach(j)}return S}},94558:function(w,P,a){var f=a(95329);w.exports=x;function x(E){var b=0,v=[],N={},S=[];function M(A){var I=N[A]={onStack:!0,lowlink:b,index:b++};if(v.push(A),E.successors(A).forEach(function(Y){f.has(N,Y)?N[Y].onStack&&(I.lowlink=Math.min(I.lowlink,N[Y].index)):(M(Y),I.lowlink=Math.min(I.lowlink,N[Y].lowlink))}),I.lowlink===I.index){var j=[],D;do D=v.pop(),N[D].onStack=!1,j.push(D);while(A!==D);S.push(j)}}return E.nodes().forEach(function(A){f.has(N,A)||M(A)}),S}},7793:function(w,P,a){var f=a(95329);w.exports=x,x.CycleException=E;function x(b){var v={},N={},S=[];function M(A){if(f.has(N,A))throw new E;f.has(v,A)||(N[A]=!0,v[A]=!0,f.each(b.predecessors(A),M),delete N[A],S.push(A))}if(f.each(b.sinks(),M),f.size(v)!==b.nodeCount())throw new E;return S}function E(){}E.prototype=new Error},36614:function(w,P,a){var f=a(95329);w.exports=x;function x(){this._arr=[],this._keyIndices={}}x.prototype.size=function(){return this._arr.length},x.prototype.keys=function(){return this._arr.map(function(E){return E.key})},x.prototype.has=function(E){return f.has(this._keyIndices,E)},x.prototype.priority=function(E){var b=this._keyIndices[E];if(b!==void 0)return this._arr[b].priority},x.prototype.min=function(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key},x.prototype.add=function(E,b){var v=this._keyIndices;if(E=String(E),!f.has(v,E)){var N=this._arr,S=N.length;return v[E]=S,N.push({key:E,priority:b}),this._decrease(S),!0}return!1},x.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var E=this._arr.pop();return delete this._keyIndices[E.key],this._heapify(0),E.key},x.prototype.decrease=function(E,b){var v=this._keyIndices[E];if(b>this._arr[v].priority)throw new Error("New priority is greater than current priority. Key: "+E+" Old: "+this._arr[v].priority+" New: "+b);this._arr[v].priority=b,this._decrease(v)},x.prototype._heapify=function(E){var b=this._arr,v=2*E,N=v+1,S=E;v<b.length&&(S=b[v].priority<b[S].priority?v:S,N<b.length&&(S=b[N].priority<b[S].priority?N:S),S!==E&&(this._swap(E,S),this._heapify(S)))},x.prototype._decrease=function(E){for(var b=this._arr,v=b[E].priority,N;E!==0&&(N=E>>1,!(b[N].priority<v));)this._swap(E,N),E=N},x.prototype._swap=function(E,b){var v=this._arr,N=this._keyIndices,S=v[E],M=v[b];v[E]=M,v[b]=S,N[M.key]=E,N[S.key]=b}},6349:function(w,P,a){"use strict";var f=a(95329);w.exports=v;var x="\0",E="\0",b="";function v(j){this._isDirected=f.has(j,"directed")?j.directed:!0,this._isMultigraph=f.has(j,"multigraph")?j.multigraph:!1,this._isCompound=f.has(j,"compound")?j.compound:!1,this._label=void 0,this._defaultNodeLabelFn=f.constant(void 0),this._defaultEdgeLabelFn=f.constant(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children[E]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}v.prototype._nodeCount=0,v.prototype._edgeCount=0,v.prototype.isDirected=function(){return this._isDirected},v.prototype.isMultigraph=function(){return this._isMultigraph},v.prototype.isCompound=function(){return this._isCompound},v.prototype.setGraph=function(j){return this._label=j,this},v.prototype.graph=function(){return this._label},v.prototype.setDefaultNodeLabel=function(j){return f.isFunction(j)||(j=f.constant(j)),this._defaultNodeLabelFn=j,this},v.prototype.nodeCount=function(){return this._nodeCount},v.prototype.nodes=function(){return f.keys(this._nodes)},v.prototype.sources=function(){var j=this;return f.filter(this.nodes(),function(D){return f.isEmpty(j._in[D])})},v.prototype.sinks=function(){var j=this;return f.filter(this.nodes(),function(D){return f.isEmpty(j._out[D])})},v.prototype.setNodes=function(j,D){var Y=arguments,K=this;return f.each(j,function(ot){Y.length>1?K.setNode(ot,D):K.setNode(ot)}),this},v.prototype.setNode=function(j,D){return f.has(this._nodes,j)?(arguments.length>1&&(this._nodes[j]=D),this):(this._nodes[j]=arguments.length>1?D:this._defaultNodeLabelFn(j),this._isCompound&&(this._parent[j]=E,this._children[j]={},this._children[E][j]=!0),this._in[j]={},this._preds[j]={},this._out[j]={},this._sucs[j]={},++this._nodeCount,this)},v.prototype.node=function(j){return this._nodes[j]},v.prototype.hasNode=function(j){return f.has(this._nodes,j)},v.prototype.removeNode=function(j){var D=this;if(f.has(this._nodes,j)){var Y=function(K){D.removeEdge(D._edgeObjs[K])};delete this._nodes[j],this._isCompound&&(this._removeFromParentsChildList(j),delete this._parent[j],f.each(this.children(j),function(K){D.setParent(K)}),delete this._children[j]),f.each(f.keys(this._in[j]),Y),delete this._in[j],delete this._preds[j],f.each(f.keys(this._out[j]),Y),delete this._out[j],delete this._sucs[j],--this._nodeCount}return this},v.prototype.setParent=function(j,D){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(f.isUndefined(D))D=E;else{D+="";for(var Y=D;!f.isUndefined(Y);Y=this.parent(Y))if(Y===j)throw new Error("Setting "+D+" as parent of "+j+" would create a cycle");this.setNode(D)}return this.setNode(j),this._removeFromParentsChildList(j),this._parent[j]=D,this._children[D][j]=!0,this},v.prototype._removeFromParentsChildList=function(j){delete this._children[this._parent[j]][j]},v.prototype.parent=function(j){if(this._isCompound){var D=this._parent[j];if(D!==E)return D}},v.prototype.children=function(j){if(f.isUndefined(j)&&(j=E),this._isCompound){var D=this._children[j];if(D)return f.keys(D)}else{if(j===E)return this.nodes();if(this.hasNode(j))return[]}},v.prototype.predecessors=function(j){var D=this._preds[j];if(D)return f.keys(D)},v.prototype.successors=function(j){var D=this._sucs[j];if(D)return f.keys(D)},v.prototype.neighbors=function(j){var D=this.predecessors(j);if(D)return f.union(D,this.successors(j))},v.prototype.isLeaf=function(j){var D;return this.isDirected()?D=this.successors(j):D=this.neighbors(j),D.length===0},v.prototype.filterNodes=function(j){var D=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});D.setGraph(this.graph());var Y=this;f.each(this._nodes,function(nt,Q){j(Q)&&D.setNode(Q,nt)}),f.each(this._edgeObjs,function(nt){D.hasNode(nt.v)&&D.hasNode(nt.w)&&D.setEdge(nt,Y.edge(nt))});var K={};function ot(nt){var Q=Y.parent(nt);return Q===void 0||D.hasNode(Q)?(K[nt]=Q,Q):Q in K?K[Q]:ot(Q)}return this._isCompound&&f.each(D.nodes(),function(nt){D.setParent(nt,ot(nt))}),D},v.prototype.setDefaultEdgeLabel=function(j){return f.isFunction(j)||(j=f.constant(j)),this._defaultEdgeLabelFn=j,this},v.prototype.edgeCount=function(){return this._edgeCount},v.prototype.edges=function(){return f.values(this._edgeObjs)},v.prototype.setPath=function(j,D){var Y=this,K=arguments;return f.reduce(j,function(ot,nt){return K.length>1?Y.setEdge(ot,nt,D):Y.setEdge(ot,nt),nt}),this},v.prototype.setEdge=function(){var j,D,Y,K,ot=!1,nt=arguments[0];typeof nt=="object"&&nt!==null&&"v"in nt?(j=nt.v,D=nt.w,Y=nt.name,arguments.length===2&&(K=arguments[1],ot=!0)):(j=nt,D=arguments[1],Y=arguments[3],arguments.length>2&&(K=arguments[2],ot=!0)),j=""+j,D=""+D,f.isUndefined(Y)||(Y=""+Y);var Q=M(this._isDirected,j,D,Y);if(f.has(this._edgeLabels,Q))return ot&&(this._edgeLabels[Q]=K),this;if(!f.isUndefined(Y)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(j),this.setNode(D),this._edgeLabels[Q]=ot?K:this._defaultEdgeLabelFn(j,D,Y);var et=A(this._isDirected,j,D,Y);return j=et.v,D=et.w,Object.freeze(et),this._edgeObjs[Q]=et,N(this._preds[D],j),N(this._sucs[j],D),this._in[D][Q]=et,this._out[j][Q]=et,this._edgeCount++,this},v.prototype.edge=function(j,D,Y){var K=arguments.length===1?I(this._isDirected,arguments[0]):M(this._isDirected,j,D,Y);return this._edgeLabels[K]},v.prototype.hasEdge=function(j,D,Y){var K=arguments.length===1?I(this._isDirected,arguments[0]):M(this._isDirected,j,D,Y);return f.has(this._edgeLabels,K)},v.prototype.removeEdge=function(j,D,Y){var K=arguments.length===1?I(this._isDirected,arguments[0]):M(this._isDirected,j,D,Y),ot=this._edgeObjs[K];return ot&&(j=ot.v,D=ot.w,delete this._edgeLabels[K],delete this._edgeObjs[K],S(this._preds[D],j),S(this._sucs[j],D),delete this._in[D][K],delete this._out[j][K],this._edgeCount--),this},v.prototype.inEdges=function(j,D){var Y=this._in[j];if(Y){var K=f.values(Y);return D?f.filter(K,function(ot){return ot.v===D}):K}},v.prototype.outEdges=function(j,D){var Y=this._out[j];if(Y){var K=f.values(Y);return D?f.filter(K,function(ot){return ot.w===D}):K}},v.prototype.nodeEdges=function(j,D){var Y=this.inEdges(j,D);if(Y)return Y.concat(this.outEdges(j,D))};function N(j,D){j[D]?j[D]++:j[D]=1}function S(j,D){--j[D]||delete j[D]}function M(j,D,Y,K){var ot=""+D,nt=""+Y;if(!j&&ot>nt){var Q=ot;ot=nt,nt=Q}return ot+b+nt+b+(f.isUndefined(K)?x:K)}function A(j,D,Y,K){var ot=""+D,nt=""+Y;if(!j&&ot>nt){var Q=ot;ot=nt,nt=Q}var et={v:ot,w:nt};return K&&(et.name=K),et}function I(j,D){return M(j,D.v,D.w,D.name)}},89224:function(w,P,a){w.exports={Graph:a(6349),version:a(16544)}},17401:function(w,P,a){var f=a(95329),x=a(6349);w.exports={write:E,read:N};function E(S){var M={options:{directed:S.isDirected(),multigraph:S.isMultigraph(),compound:S.isCompound()},nodes:b(S),edges:v(S)};return f.isUndefined(S.graph())||(M.value=f.clone(S.graph())),M}function b(S){return f.map(S.nodes(),function(M){var A=S.node(M),I=S.parent(M),j={v:M};return f.isUndefined(A)||(j.value=A),f.isUndefined(I)||(j.parent=I),j})}function v(S){return f.map(S.edges(),function(M){var A=S.edge(M),I={v:M.v,w:M.w};return f.isUndefined(M.name)||(I.name=M.name),f.isUndefined(A)||(I.value=A),I})}function N(S){var M=new x(S.options).setGraph(S.value);return f.each(S.nodes,function(A){M.setNode(A.v,A.value),A.parent&&M.setParent(A.v,A.parent)}),f.each(S.edges,function(A){M.setEdge({v:A.v,w:A.w,name:A.name},A.value)}),M}},95329:function(w,P,a){var f;try{f={clone:a(40633),constant:a(46221),each:a(61475),filter:a(3130),has:a(64760),isArray:a(41594),isEmpty:a(74336),isFunction:a(92581),isUndefined:a(68408),keys:a(66357),map:a(81426),reduce:a(9695),size:a(24727),transform:a(61477),union:a(99477),values:a(72834)}}catch(x){}f||(f=window._),w.exports=f},16544:function(w){w.exports="2.1.8"},34634:function(w,P,a){"use strict";a.r(P),a.d(P,{isAnyArray:function(){return x}});const f=Object.prototype.toString;function x(E){const b=f.call(E);return b.endsWith("Array]")&&!b.includes("Big")}},23346:function(w,P,a){var f=a(93454),x=a(40911),E=f(x,"DataView");w.exports=E},79955:function(w,P,a){var f=a(65812),x=a(87e3),E=a(66198),b=a(64800),v=a(8602);function N(S){var M=-1,A=S==null?0:S.length;for(this.clear();++M<A;){var I=S[M];this.set(I[0],I[1])}}N.prototype.clear=f,N.prototype.delete=x,N.prototype.get=E,N.prototype.has=b,N.prototype.set=v,w.exports=N},53110:function(w,P,a){var f=a(62238),x=a(65652),E=a(75965),b=a(83895),v=a(43475);function N(S){var M=-1,A=S==null?0:S.length;for(this.clear();++M<A;){var I=S[M];this.set(I[0],I[1])}}N.prototype.clear=f,N.prototype.delete=x,N.prototype.get=E,N.prototype.has=b,N.prototype.set=v,w.exports=N},25281:function(w,P,a){var f=a(93454),x=a(40911),E=f(x,"Map");w.exports=E},97800:function(w,P,a){var f=a(91642),x=a(71646),E=a(70200),b=a(85304),v=a(57862);function N(S){var M=-1,A=S==null?0:S.length;for(this.clear();++M<A;){var I=S[M];this.set(I[0],I[1])}}N.prototype.clear=f,N.prototype.delete=x,N.prototype.get=E,N.prototype.has=b,N.prototype.set=v,w.exports=N},36025:function(w,P,a){var f=a(93454),x=a(40911),E=f(x,"Promise");w.exports=E},73230:function(w,P,a){var f=a(93454),x=a(40911),E=f(x,"Set");w.exports=E},66643:function(w,P,a){var f=a(97800),x=a(81685),E=a(1324);function b(v){var N=-1,S=v==null?0:v.length;for(this.__data__=new f;++N<S;)this.add(v[N])}b.prototype.add=b.prototype.push=x,b.prototype.has=E,w.exports=b},26163:function(w,P,a){var f=a(53110),x=a(83214),E=a(52806),b=a(52032),v=a(51118),N=a(36321);function S(M){var A=this.__data__=new f(M);this.size=A.size}S.prototype.clear=x,S.prototype.delete=E,S.prototype.get=b,S.prototype.has=v,S.prototype.set=N,w.exports=S},33140:function(w,P,a){var f=a(40911),x=f.Symbol;w.exports=x},85015:function(w,P,a){var f=a(40911),x=f.Uint8Array;w.exports=x},89516:function(w,P,a){var f=a(93454),x=a(40911),E=f(x,"WeakMap");w.exports=E},33546:function(w){function P(a,f,x){switch(x.length){case 0:return a.call(f);case 1:return a.call(f,x[0]);case 2:return a.call(f,x[0],x[1]);case 3:return a.call(f,x[0],x[1],x[2])}return a.apply(f,x)}w.exports=P},22899:function(w){function P(a,f){for(var x=-1,E=a==null?0:a.length;++x<E&&f(a[x],x,a)!==!1;);return a}w.exports=P},72280:function(w){function P(a,f){for(var x=-1,E=a==null?0:a.length,b=0,v=[];++x<E;){var N=a[x];f(N,x,a)&&(v[b++]=N)}return v}w.exports=P},55295:function(w,P,a){var f=a(17713);function x(E,b){var v=E==null?0:E.length;return!!v&&f(E,b,0)>-1}w.exports=x},90746:function(w){function P(a,f,x){for(var E=-1,b=a==null?0:a.length;++E<b;)if(x(f,a[E]))return!0;return!1}w.exports=P},91762:function(w,P,a){var f=a(16564),x=a(30516),E=a(41594),b=a(33636),v=a(65068),N=a(53745),S=Object.prototype,M=S.hasOwnProperty;function A(I,j){var D=E(I),Y=!D&&x(I),K=!D&&!Y&&b(I),ot=!D&&!Y&&!K&&N(I),nt=D||Y||K||ot,Q=nt?f(I.length,String):[],et=Q.length;for(var H in I)(j||M.call(I,H))&&!(nt&&(H=="length"||K&&(H=="offset"||H=="parent")||ot&&(H=="buffer"||H=="byteLength"||H=="byteOffset")||v(H,et)))&&Q.push(H);return Q}w.exports=A},43453:function(w){function P(a,f){for(var x=-1,E=a==null?0:a.length,b=Array(E);++x<E;)b[x]=f(a[x],x,a);return b}w.exports=P},10451:function(w){function P(a,f){for(var x=-1,E=f.length,b=a.length;++x<E;)a[b+x]=f[x];return a}w.exports=P},85665:function(w){function P(a,f,x,E){var b=-1,v=a==null?0:a.length;for(E&&v&&(x=a[++b]);++b<v;)x=f(x,a[b],b,a);return x}w.exports=P},16604:function(w){function P(a,f){for(var x=-1,E=a==null?0:a.length;++x<E;)if(f(a[x],x,a))return!0;return!1}w.exports=P},8483:function(w,P,a){var f=a(11372),x=f("length");w.exports=x},25538:function(w,P,a){var f=a(67109),x=a(83914);function E(b,v,N){(N!==void 0&&!x(b[v],N)||N===void 0&&!(v in b))&&f(b,v,N)}w.exports=E},78436:function(w,P,a){var f=a(67109),x=a(83914),E=Object.prototype,b=E.hasOwnProperty;function v(N,S,M){var A=N[S];(!(b.call(N,S)&&x(A,M))||M===void 0&&!(S in N))&&f(N,S,M)}w.exports=v},82249:function(w,P,a){var f=a(83914);function x(E,b){for(var v=E.length;v--;)if(f(E[v][0],b))return v;return-1}w.exports=x},52961:function(w,P,a){var f=a(39408),x=a(66357);function E(b,v){return b&&f(v,x(v),b)}w.exports=E},56903:function(w,P,a){var f=a(39408),x=a(331);function E(b,v){return b&&f(v,x(v),b)}w.exports=E},67109:function(w,P,a){var f=a(49962);function x(E,b,v){b=="__proto__"&&f?f(E,b,{configurable:!0,enumerable:!0,value:v,writable:!0}):E[b]=v}w.exports=x},51024:function(w,P,a){var f=a(26163),x=a(22899),E=a(78436),b=a(52961),v=a(56903),N=a(6151),S=a(63272),M=a(45280),A=a(24299),I=a(29921),j=a(53904),D=a(29148),Y=a(83505),K=a(44723),ot=a(71349),nt=a(41594),Q=a(33636),et=a(32455),H=a(71721),it=a(60437),at=a(66357),ft=a(331),ht=1,dt=2,xt=4,yt="[object Arguments]",Nt="[object Array]",Ot="[object Boolean]",Bt="[object Date]",Vt="[object Error]",Ht="[object Function]",ee="[object GeneratorFunction]",ye="[object Map]",$e="[object Number]",nn="[object Object]",Mn="[object RegExp]",Sn="[object Set]",cn="[object String]",Je="[object Symbol]",an="[object WeakMap]",gt="[object ArrayBuffer]",vt="[object DataView]",At="[object Float32Array]",Ft="[object Float64Array]",qt="[object Int8Array]",ue="[object Int16Array]",he="[object Int32Array]",Ie="[object Uint8Array]",pn="[object Uint8ClampedArray]",De="[object Uint16Array]",Me="[object Uint32Array]",se={};se[yt]=se[Nt]=se[gt]=se[vt]=se[Ot]=se[Bt]=se[At]=se[Ft]=se[qt]=se[ue]=se[he]=se[ye]=se[$e]=se[nn]=se[Mn]=se[Sn]=se[cn]=se[Je]=se[Ie]=se[pn]=se[De]=se[Me]=!0,se[Vt]=se[Ht]=se[an]=!1;function Wt(re,rn,un,It,fn,Pe){var xe,ke=rn&ht,vn=rn&dt,On=rn&xt;if(un&&(xe=fn?un(re,It,fn,Pe):un(re)),xe!==void 0)return xe;if(!H(re))return re;var Pn=nt(re);if(Pn){if(xe=Y(re),!ke)return S(re,xe)}else{var sn=D(re),An=sn==Ht||sn==ee;if(Q(re))return N(re,ke);if(sn==nn||sn==yt||An&&!fn){if(xe=vn||An?{}:ot(re),!ke)return vn?A(re,v(xe,re)):M(re,b(xe,re))}else{if(!se[sn])return fn?re:{};xe=K(re,sn,ke)}}Pe||(Pe=new f);var Rn=Pe.get(re);if(Rn)return Rn;Pe.set(re,xe),it(re)?re.forEach(function(Be){xe.add(Wt(Be,rn,un,Be,re,Pe))}):et(re)&&re.forEach(function(Be,ze){xe.set(ze,Wt(Be,rn,un,ze,re,Pe))});var mn=On?vn?j:I:vn?ft:at,Bn=Pn?void 0:mn(re);return x(Bn||re,function(Be,ze){Bn&&(ze=Be,Be=re[ze]),E(xe,ze,Wt(Be,rn,un,ze,re,Pe))}),xe}w.exports=Wt},93511:function(w,P,a){var f=a(71721),x=Object.create,E=function(){function b(){}return function(v){if(!f(v))return{};if(x)return x(v);b.prototype=v;var N=new b;return b.prototype=void 0,N}}();w.exports=E},89264:function(w,P,a){var f=a(23543),x=a(26503),E=x(f);w.exports=E},87542:function(w,P,a){var f=a(66459);function x(E,b,v){for(var N=-1,S=E.length;++N<S;){var M=E[N],A=b(M);if(A!=null&&(I===void 0?A===A&&!f(A):v(A,I)))var I=A,j=M}return j}w.exports=x},22307:function(w,P,a){var f=a(89264);function x(E,b){var v=[];return f(E,function(N,S,M){b(N,S,M)&&v.push(N)}),v}w.exports=x},33405:function(w){function P(a,f,x,E){for(var b=a.length,v=x+(E?1:-1);E?v--:++v<b;)if(f(a[v],v,a))return v;return-1}w.exports=P},27417:function(w,P,a){var f=a(10451),x=a(32111);function E(b,v,N,S,M){var A=-1,I=b.length;for(N||(N=x),M||(M=[]);++A<I;){var j=b[A];v>0&&N(j)?v>1?E(j,v-1,N,S,M):f(M,j):S||(M[M.length]=j)}return M}w.exports=E},43294:function(w,P,a){var f=a(78323),x=f();w.exports=x},23543:function(w,P,a){var f=a(43294),x=a(66357);function E(b,v){return b&&f(b,v,x)}w.exports=E},96980:function(w,P,a){var f=a(89382),x=a(90370);function E(b,v){v=f(v,b);for(var N=0,S=v.length;b!=null&&N<S;)b=b[x(v[N++])];return N&&N==S?b:void 0}w.exports=E},76674:function(w,P,a){var f=a(10451),x=a(41594);function E(b,v,N){var S=v(b);return x(b)?S:f(S,N(b))}w.exports=E},17325:function(w,P,a){var f=a(33140),x=a(84723),E=a(92631),b="[object Null]",v="[object Undefined]",N=f?f.toStringTag:void 0;function S(M){return M==null?M===void 0?v:b:N&&N in Object(M)?x(M):E(M)}w.exports=S},52538:function(w){function P(a,f){return a>f}w.exports=P},11874:function(w){var P=Object.prototype,a=P.hasOwnProperty;function f(x,E){return x!=null&&a.call(x,E)}w.exports=f},45146:function(w){function P(a,f){return a!=null&&f in Object(a)}w.exports=P},17713:function(w,P,a){var f=a(33405),x=a(17406),E=a(68048);function b(v,N,S){return N===N?E(v,N,S):f(v,x,S)}w.exports=b},3841:function(w,P,a){var f=a(17325),x=a(71161),E="[object Arguments]";function b(v){return x(v)&&f(v)==E}w.exports=b},30433:function(w,P,a){var f=a(98317),x=a(71161);function E(b,v,N,S,M){return b===v?!0:b==null||v==null||!x(b)&&!x(v)?b!==b&&v!==v:f(b,v,N,S,E,M)}w.exports=E},98317:function(w,P,a){var f=a(26163),x=a(70670),E=a(23499),b=a(83544),v=a(29148),N=a(41594),S=a(33636),M=a(53745),A=1,I="[object Arguments]",j="[object Array]",D="[object Object]",Y=Object.prototype,K=Y.hasOwnProperty;function ot(nt,Q,et,H,it,at){var ft=N(nt),ht=N(Q),dt=ft?j:v(nt),xt=ht?j:v(Q);dt=dt==I?D:dt,xt=xt==I?D:xt;var yt=dt==D,Nt=xt==D,Ot=dt==xt;if(Ot&&S(nt)){if(!S(Q))return!1;ft=!0,yt=!1}if(Ot&&!yt)return at||(at=new f),ft||M(nt)?x(nt,Q,et,H,it,at):E(nt,Q,dt,et,H,it,at);if(!(et&A)){var Bt=yt&&K.call(nt,"__wrapped__"),Vt=Nt&&K.call(Q,"__wrapped__");if(Bt||Vt){var Ht=Bt?nt.value():nt,ee=Vt?Q.value():Q;return at||(at=new f),it(Ht,ee,et,H,at)}}return Ot?(at||(at=new f),b(nt,Q,et,H,it,at)):!1}w.exports=ot},9961:function(w,P,a){var f=a(29148),x=a(71161),E="[object Map]";function b(v){return x(v)&&f(v)==E}w.exports=b},44626:function(w,P,a){var f=a(26163),x=a(30433),E=1,b=2;function v(N,S,M,A){var I=M.length,j=I,D=!A;if(N==null)return!j;for(N=Object(N);I--;){var Y=M[I];if(D&&Y[2]?Y[1]!==N[Y[0]]:!(Y[0]in N))return!1}for(;++I<j;){Y=M[I];var K=Y[0],ot=N[K],nt=Y[1];if(D&&Y[2]){if(ot===void 0&&!(K in N))return!1}else{var Q=new f;if(A)var et=A(ot,nt,K,N,S,Q);if(!(et===void 0?x(nt,ot,E|b,A,Q):et))return!1}}return!0}w.exports=v},17406:function(w){function P(a){return a!==a}w.exports=P},64023:function(w,P,a){var f=a(92581),x=a(42469),E=a(71721),b=a(89614),v=/[\\^$.*+?()[\]{}|]/g,N=/^\[object .+?Constructor\]$/,S=Function.prototype,M=Object.prototype,A=S.toString,I=M.hasOwnProperty,j=RegExp("^"+A.call(I).replace(v,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function D(Y){if(!E(Y)||x(Y))return!1;var K=f(Y)?j:N;return K.test(b(Y))}w.exports=D},65562:function(w,P,a){var f=a(29148),x=a(71161),E="[object Set]";function b(v){return x(v)&&f(v)==E}w.exports=b},61651:function(w,P,a){var f=a(17325),x=a(41199),E=a(71161),b="[object Arguments]",v="[object Array]",N="[object Boolean]",S="[object Date]",M="[object Error]",A="[object Function]",I="[object Map]",j="[object Number]",D="[object Object]",Y="[object RegExp]",K="[object Set]",ot="[object String]",nt="[object WeakMap]",Q="[object ArrayBuffer]",et="[object DataView]",H="[object Float32Array]",it="[object Float64Array]",at="[object Int8Array]",ft="[object Int16Array]",ht="[object Int32Array]",dt="[object Uint8Array]",xt="[object Uint8ClampedArray]",yt="[object Uint16Array]",Nt="[object Uint32Array]",Ot={};Ot[H]=Ot[it]=Ot[at]=Ot[ft]=Ot[ht]=Ot[dt]=Ot[xt]=Ot[yt]=Ot[Nt]=!0,Ot[b]=Ot[v]=Ot[Q]=Ot[N]=Ot[et]=Ot[S]=Ot[M]=Ot[A]=Ot[I]=Ot[j]=Ot[D]=Ot[Y]=Ot[K]=Ot[ot]=Ot[nt]=!1;function Bt(Vt){return E(Vt)&&x(Vt.length)&&!!Ot[f(Vt)]}w.exports=Bt},71499:function(w,P,a){var f=a(37472),x=a(9859),E=a(44525),b=a(41594),v=a(59932);function N(S){return typeof S=="function"?S:S==null?E:typeof S=="object"?b(S)?x(S[0],S[1]):f(S):v(S)}w.exports=N},63427:function(w,P,a){var f=a(46024),x=a(90535),E=Object.prototype,b=E.hasOwnProperty;function v(N){if(!f(N))return x(N);var S=[];for(var M in Object(N))b.call(N,M)&&M!="constructor"&&S.push(M);return S}w.exports=v},54193:function(w,P,a){var f=a(71721),x=a(46024),E=a(54229),b=Object.prototype,v=b.hasOwnProperty;function N(S){if(!f(S))return E(S);var M=x(S),A=[];for(var I in S)I=="constructor"&&(M||!v.call(S,I))||A.push(I);return A}w.exports=N},85679:function(w){function P(a,f){return a<f}w.exports=P},27592:function(w,P,a){var f=a(89264),x=a(9015);function E(b,v){var N=-1,S=x(b)?Array(b.length):[];return f(b,function(M,A,I){S[++N]=v(M,A,I)}),S}w.exports=E},37472:function(w,P,a){var f=a(44626),x=a(86162),E=a(47366);function b(v){var N=x(v);return N.length==1&&N[0][2]?E(N[0][0],N[0][1]):function(S){return S===v||f(S,v,N)}}w.exports=b},9859:function(w,P,a){var f=a(30433),x=a(3239),E=a(35339),b=a(10866),v=a(63286),N=a(47366),S=a(90370),M=1,A=2;function I(j,D){return b(j)&&v(D)?N(S(j),D):function(Y){var K=x(Y,j);return K===void 0&&K===D?E(Y,j):f(D,K,M|A)}}w.exports=I},37111:function(w,P,a){var f=a(26163),x=a(25538),E=a(43294),b=a(55112),v=a(71721),N=a(331),S=a(10943);function M(A,I,j,D,Y){A!==I&&E(I,function(K,ot){if(Y||(Y=new f),v(K))b(A,I,ot,j,M,D,Y);else{var nt=D?D(S(A,ot),K,ot+"",A,I,Y):void 0;nt===void 0&&(nt=K),x(A,ot,nt)}},N)}w.exports=M},55112:function(w,P,a){var f=a(25538),x=a(6151),E=a(89577),b=a(63272),v=a(71349),N=a(30516),S=a(41594),M=a(20577),A=a(33636),I=a(92581),j=a(71721),D=a(29538),Y=a(53745),K=a(10943),ot=a(8416);function nt(Q,et,H,it,at,ft,ht){var dt=K(Q,H),xt=K(et,H),yt=ht.get(xt);if(yt){f(Q,H,yt);return}var Nt=ft?ft(dt,xt,H+"",Q,et,ht):void 0,Ot=Nt===void 0;if(Ot){var Bt=S(xt),Vt=!Bt&&A(xt),Ht=!Bt&&!Vt&&Y(xt);Nt=xt,Bt||Vt||Ht?S(dt)?Nt=dt:M(dt)?Nt=b(dt):Vt?(Ot=!1,Nt=x(xt,!0)):Ht?(Ot=!1,Nt=E(xt,!0)):Nt=[]:D(xt)||N(xt)?(Nt=dt,N(dt)?Nt=ot(dt):(!j(dt)||I(dt))&&(Nt=v(xt))):Ot=!1}Ot&&(ht.set(xt,Nt),at(Nt,xt,it,ft,ht),ht.delete(xt)),f(Q,H,Nt)}w.exports=nt},50447:function(w,P,a){var f=a(43453),x=a(96980),E=a(71499),b=a(27592),v=a(24327),N=a(82230),S=a(47936),M=a(44525),A=a(41594);function I(j,D,Y){D.length?D=f(D,function(nt){return A(nt)?function(Q){return x(Q,nt.length===1?nt[0]:nt)}:nt}):D=[M];var K=-1;D=f(D,N(E));var ot=b(j,function(nt,Q,et){var H=f(D,function(it){return it(nt)});return{criteria:H,index:++K,value:nt}});return v(ot,function(nt,Q){return S(nt,Q,Y)})}w.exports=I},80073:function(w,P,a){var f=a(59967),x=a(35339);function E(b,v){return f(b,v,function(N,S){return x(b,S)})}w.exports=E},59967:function(w,P,a){var f=a(96980),x=a(63077),E=a(89382);function b(v,N,S){for(var M=-1,A=N.length,I={};++M<A;){var j=N[M],D=f(v,j);S(D,j)&&x(I,E(j,v),D)}return I}w.exports=b},11372:function(w){function P(a){return function(f){return f==null?void 0:f[a]}}w.exports=P},91315:function(w,P,a){var f=a(96980);function x(E){return function(b){return f(b,E)}}w.exports=x},91018:function(w){var P=Math.ceil,a=Math.max;function f(x,E,b,v){for(var N=-1,S=a(P((E-x)/(b||1)),0),M=Array(S);S--;)M[v?S:++N]=x,x+=b;return M}w.exports=f},88120:function(w){function P(a,f,x,E,b){return b(a,function(v,N,S){x=E?(E=!1,v):f(x,v,N,S)}),x}w.exports=P},2440:function(w,P,a){var f=a(44525),x=a(9291),E=a(48815);function b(v,N){return E(x(v,N,f),v+"")}w.exports=b},63077:function(w,P,a){var f=a(78436),x=a(89382),E=a(65068),b=a(71721),v=a(90370);function N(S,M,A,I){if(!b(S))return S;M=x(M,S);for(var j=-1,D=M.length,Y=D-1,K=S;K!=null&&++j<D;){var ot=v(M[j]),nt=A;if(ot==="__proto__"||ot==="constructor"||ot==="prototype")return S;if(j!=Y){var Q=K[ot];nt=I?I(Q,ot,K):void 0,nt===void 0&&(nt=b(Q)?Q:E(M[j+1])?[]:{})}f(K,ot,nt),K=K[ot]}return S}w.exports=N},57916:function(w,P,a){var f=a(46221),x=a(49962),E=a(44525),b=x?function(v,N){return x(v,"toString",{configurable:!0,enumerable:!1,value:f(N),writable:!0})}:E;w.exports=b},24327:function(w){function P(a,f){var x=a.length;for(a.sort(f);x--;)a[x]=a[x].value;return a}w.exports=P},16564:function(w){function P(a,f){for(var x=-1,E=Array(a);++x<a;)E[x]=f(x);return E}w.exports=P},12580:function(w,P,a){var f=a(33140),x=a(43453),E=a(41594),b=a(66459),v=1/0,N=f?f.prototype:void 0,S=N?N.toString:void 0;function M(A){if(typeof A=="string")return A;if(E(A))return x(A,M)+"";if(b(A))return S?S.call(A):"";var I=A+"";return I=="0"&&1/A==-v?"-0":I}w.exports=M},8944:function(w,P,a){var f=a(10242),x=/^\s+/;function E(b){return b&&b.slice(0,f(b)+1).replace(x,"")}w.exports=E},82230:function(w){function P(a){return function(f){return a(f)}}w.exports=P},75996:function(w,P,a){var f=a(66643),x=a(55295),E=a(90746),b=a(53257),v=a(82241),N=a(25008),S=200;function M(A,I,j){var D=-1,Y=x,K=A.length,ot=!0,nt=[],Q=nt;if(j)ot=!1,Y=E;else if(K>=S){var et=I?null:v(A);if(et)return N(et);ot=!1,Y=b,Q=new f}else Q=I?[]:nt;t:for(;++D<K;){var H=A[D],it=I?I(H):H;if(H=j||H!==0?H:0,ot&&it===it){for(var at=Q.length;at--;)if(Q[at]===it)continue t;I&&Q.push(it),nt.push(H)}else Y(Q,it,j)||(Q!==nt&&Q.push(it),nt.push(H))}return nt}w.exports=M},98030:function(w,P,a){var f=a(43453);function x(E,b){return f(b,function(v){return E[v]})}w.exports=x},30232:function(w){function P(a,f,x){for(var E=-1,b=a.length,v=f.length,N={};++E<b;){var S=E<v?f[E]:void 0;x(N,a[E],S)}return N}w.exports=P},53257:function(w){function P(a,f){return a.has(f)}w.exports=P},764:function(w,P,a){var f=a(44525);function x(E){return typeof E=="function"?E:f}w.exports=x},89382:function(w,P,a){var f=a(41594),x=a(10866),E=a(80048),b=a(14135);function v(N,S){return f(N)?N:x(N,S)?[N]:E(b(N))}w.exports=v},507:function(w,P,a){var f=a(85015);function x(E){var b=new E.constructor(E.byteLength);return new f(b).set(new f(E)),b}w.exports=x},6151:function(w,P,a){w=a.nmd(w);var f=a(40911),x=P&&!P.nodeType&&P,E=x&&!0&&w&&!w.nodeType&&w,b=E&&E.exports===x,v=b?f.Buffer:void 0,N=v?v.allocUnsafe:void 0;function S(M,A){if(A)return M.slice();var I=M.length,j=N?N(I):new M.constructor(I);return M.copy(j),j}w.exports=S},449:function(w,P,a){var f=a(507);function x(E,b){var v=b?f(E.buffer):E.buffer;return new E.constructor(v,E.byteOffset,E.byteLength)}w.exports=x},63472:function(w){var P=/\w*$/;function a(f){var x=new f.constructor(f.source,P.exec(f));return x.lastIndex=f.lastIndex,x}w.exports=a},66922:function(w,P,a){var f=a(33140),x=f?f.prototype:void 0,E=x?x.valueOf:void 0;function b(v){return E?Object(E.call(v)):{}}w.exports=b},89577:function(w,P,a){var f=a(507);function x(E,b){var v=b?f(E.buffer):E.buffer;return new E.constructor(v,E.byteOffset,E.length)}w.exports=x},11885:function(w,P,a){var f=a(66459);function x(E,b){if(E!==b){var v=E!==void 0,N=E===null,S=E===E,M=f(E),A=b!==void 0,I=b===null,j=b===b,D=f(b);if(!I&&!D&&!M&&E>b||M&&A&&j&&!I&&!D||N&&A&&j||!v&&j||!S)return 1;if(!N&&!M&&!D&&E<b||D&&v&&S&&!N&&!M||I&&v&&S||!A&&S||!j)return-1}return 0}w.exports=x},47936:function(w,P,a){var f=a(11885);function x(E,b,v){for(var N=-1,S=E.criteria,M=b.criteria,A=S.length,I=v.length;++N<A;){var j=f(S[N],M[N]);if(j){if(N>=I)return j;var D=v[N];return j*(D=="desc"?-1:1)}}return E.index-b.index}w.exports=x},63272:function(w){function P(a,f){var x=-1,E=a.length;for(f||(f=Array(E));++x<E;)f[x]=a[x];return f}w.exports=P},39408:function(w,P,a){var f=a(78436),x=a(67109);function E(b,v,N,S){var M=!N;N||(N={});for(var A=-1,I=v.length;++A<I;){var j=v[A],D=S?S(N[j],b[j],j,N,b):void 0;D===void 0&&(D=b[j]),M?x(N,j,D):f(N,j,D)}return N}w.exports=E},45280:function(w,P,a){var f=a(39408),x=a(69601);function E(b,v){return f(b,x(b),v)}w.exports=E},24299:function(w,P,a){var f=a(39408),x=a(72426);function E(b,v){return f(b,x(b),v)}w.exports=E},4377:function(w,P,a){var f=a(40911),x=f["__core-js_shared__"];w.exports=x},94792:function(w,P,a){var f=a(2440),x=a(20688);function E(b){return f(function(v,N){var S=-1,M=N.length,A=M>1?N[M-1]:void 0,I=M>2?N[2]:void 0;for(A=b.length>3&&typeof A=="function"?(M--,A):void 0,I&&x(N[0],N[1],I)&&(A=M<3?void 0:A,M=1),v=Object(v);++S<M;){var j=N[S];j&&b(v,j,S,A)}return v})}w.exports=E},26503:function(w,P,a){var f=a(9015);function x(E,b){return function(v,N){if(v==null)return v;if(!f(v))return E(v,N);for(var S=v.length,M=b?S:-1,A=Object(v);(b?M--:++M<S)&&N(A[M],M,A)!==!1;);return v}}w.exports=x},78323:function(w){function P(a){return function(f,x,E){for(var b=-1,v=Object(f),N=E(f),S=N.length;S--;){var M=N[a?S:++b];if(x(v[M],M,v)===!1)break}return f}}w.exports=P},76470:function(w,P,a){var f=a(71499),x=a(9015),E=a(66357);function b(v){return function(N,S,M){var A=Object(N);if(!x(N)){var I=f(S,3);N=E(N),S=function(D){return I(A[D],D,A)}}var j=v(N,S,M);return j>-1?A[I?N[j]:j]:void 0}}w.exports=b},6651:function(w,P,a){var f=a(91018),x=a(20688),E=a(925);function b(v){return function(N,S,M){return M&&typeof M!="number"&&x(N,S,M)&&(S=M=void 0),N=E(N),S===void 0?(S=N,N=0):S=E(S),M=M===void 0?N<S?1:-1:E(M),f(N,S,M,v)}}w.exports=b},82241:function(w,P,a){var f=a(73230),x=a(65075),E=a(25008),b=1/0,v=f&&1/E(new f([,-0]))[1]==b?function(N){return new f(N)}:x;w.exports=v},49962:function(w,P,a){var f=a(93454),x=function(){try{var E=f(Object,"defineProperty");return E({},"",{}),E}catch(b){}}();w.exports=x},70670:function(w,P,a){var f=a(66643),x=a(16604),E=a(53257),b=1,v=2;function N(S,M,A,I,j,D){var Y=A&b,K=S.length,ot=M.length;if(K!=ot&&!(Y&&ot>K))return!1;var nt=D.get(S),Q=D.get(M);if(nt&&Q)return nt==M&&Q==S;var et=-1,H=!0,it=A&v?new f:void 0;for(D.set(S,M),D.set(M,S);++et<K;){var at=S[et],ft=M[et];if(I)var ht=Y?I(ft,at,et,M,S,D):I(at,ft,et,S,M,D);if(ht!==void 0){if(ht)continue;H=!1;break}if(it){if(!x(M,function(dt,xt){if(!E(it,xt)&&(at===dt||j(at,dt,A,I,D)))return it.push(xt)})){H=!1;break}}else if(!(at===ft||j(at,ft,A,I,D))){H=!1;break}}return D.delete(S),D.delete(M),H}w.exports=N},23499:function(w,P,a){var f=a(33140),x=a(85015),E=a(83914),b=a(70670),v=a(85120),N=a(25008),S=1,M=2,A="[object Boolean]",I="[object Date]",j="[object Error]",D="[object Map]",Y="[object Number]",K="[object RegExp]",ot="[object Set]",nt="[object String]",Q="[object Symbol]",et="[object ArrayBuffer]",H="[object DataView]",it=f?f.prototype:void 0,at=it?it.valueOf:void 0;function ft(ht,dt,xt,yt,Nt,Ot,Bt){switch(xt){case H:if(ht.byteLength!=dt.byteLength||ht.byteOffset!=dt.byteOffset)return!1;ht=ht.buffer,dt=dt.buffer;case et:return!(ht.byteLength!=dt.byteLength||!Ot(new x(ht),new x(dt)));case A:case I:case Y:return E(+ht,+dt);case j:return ht.name==dt.name&&ht.message==dt.message;case K:case nt:return ht==dt+"";case D:var Vt=v;case ot:var Ht=yt&S;if(Vt||(Vt=N),ht.size!=dt.size&&!Ht)return!1;var ee=Bt.get(ht);if(ee)return ee==dt;yt|=M,Bt.set(ht,dt);var ye=b(Vt(ht),Vt(dt),yt,Nt,Ot,Bt);return Bt.delete(ht),ye;case Q:if(at)return at.call(ht)==at.call(dt)}return!1}w.exports=ft},83544:function(w,P,a){var f=a(29921),x=1,E=Object.prototype,b=E.hasOwnProperty;function v(N,S,M,A,I,j){var D=M&x,Y=f(N),K=Y.length,ot=f(S),nt=ot.length;if(K!=nt&&!D)return!1;for(var Q=K;Q--;){var et=Y[Q];if(!(D?et in S:b.call(S,et)))return!1}var H=j.get(N),it=j.get(S);if(H&&it)return H==S&&it==N;var at=!0;j.set(N,S),j.set(S,N);for(var ft=D;++Q<K;){et=Y[Q];var ht=N[et],dt=S[et];if(A)var xt=D?A(dt,ht,et,S,N,j):A(ht,dt,et,N,S,j);if(!(xt===void 0?ht===dt||I(ht,dt,M,A,j):xt)){at=!1;break}ft||(ft=et=="constructor")}if(at&&!ft){var yt=N.constructor,Nt=S.constructor;yt!=Nt&&"constructor"in N&&"constructor"in S&&!(typeof yt=="function"&&yt instanceof yt&&typeof Nt=="function"&&Nt instanceof Nt)&&(at=!1)}return j.delete(N),j.delete(S),at}w.exports=v},33944:function(w,P,a){var f=a(1332),x=a(9291),E=a(48815);function b(v){return E(x(v,void 0,f),v+"")}w.exports=b},89413:function(w,P,a){var f=typeof a.g=="object"&&a.g&&a.g.Object===Object&&a.g;w.exports=f},29921:function(w,P,a){var f=a(76674),x=a(69601),E=a(66357);function b(v){return f(v,E,x)}w.exports=b},53904:function(w,P,a){var f=a(76674),x=a(72426),E=a(331);function b(v){return f(v,E,x)}w.exports=b},27856:function(w,P,a){var f=a(99595);function x(E,b){var v=E.__data__;return f(b)?v[typeof b=="string"?"string":"hash"]:v.map}w.exports=x},86162:function(w,P,a){var f=a(63286),x=a(66357);function E(b){for(var v=x(b),N=v.length;N--;){var S=v[N],M=b[S];v[N]=[S,M,f(M)]}return v}w.exports=E},93454:function(w,P,a){var f=a(64023),x=a(31094);function E(b,v){var N=x(b,v);return f(N)?N:void 0}w.exports=E},13530:function(w,P,a){var f=a(1276),x=f(Object.getPrototypeOf,Object);w.exports=x},84723:function(w,P,a){var f=a(33140),x=Object.prototype,E=x.hasOwnProperty,b=x.toString,v=f?f.toStringTag:void 0;function N(S){var M=E.call(S,v),A=S[v];try{S[v]=void 0;var I=!0}catch(D){}var j=b.call(S);return I&&(M?S[v]=A:delete S[v]),j}w.exports=N},69601:function(w,P,a){var f=a(72280),x=a(57004),E=Object.prototype,b=E.propertyIsEnumerable,v=Object.getOwnPropertySymbols,N=v?function(S){return S==null?[]:(S=Object(S),f(v(S),function(M){return b.call(S,M)}))}:x;w.exports=N},72426:function(w,P,a){var f=a(10451),x=a(13530),E=a(69601),b=a(57004),v=Object.getOwnPropertySymbols,N=v?function(S){for(var M=[];S;)f(M,E(S)),S=x(S);return M}:b;w.exports=N},29148:function(w,P,a){var f=a(23346),x=a(25281),E=a(36025),b=a(73230),v=a(89516),N=a(17325),S=a(89614),M="[object Map]",A="[object Object]",I="[object Promise]",j="[object Set]",D="[object WeakMap]",Y="[object DataView]",K=S(f),ot=S(x),nt=S(E),Q=S(b),et=S(v),H=N;(f&&H(new f(new ArrayBuffer(1)))!=Y||x&&H(new x)!=M||E&&H(E.resolve())!=I||b&&H(new b)!=j||v&&H(new v)!=D)&&(H=function(it){var at=N(it),ft=at==A?it.constructor:void 0,ht=ft?S(ft):"";if(ht)switch(ht){case K:return Y;case ot:return M;case nt:return I;case Q:return j;case et:return D}return at}),w.exports=H},31094:function(w){function P(a,f){return a==null?void 0:a[f]}w.exports=P},37073:function(w,P,a){var f=a(89382),x=a(30516),E=a(41594),b=a(65068),v=a(41199),N=a(90370);function S(M,A,I){A=f(A,M);for(var j=-1,D=A.length,Y=!1;++j<D;){var K=N(A[j]);if(!(Y=M!=null&&I(M,K)))break;M=M[K]}return Y||++j!=D?Y:(D=M==null?0:M.length,!!D&&v(D)&&b(K,D)&&(E(M)||x(M)))}w.exports=S},19406:function(w){var P="\\ud800-\\udfff",a="\\u0300-\\u036f",f="\\ufe20-\\ufe2f",x="\\u20d0-\\u20ff",E=a+f+x,b="\\ufe0e\\ufe0f",v="\\u200d",N=RegExp("["+v+P+E+b+"]");function S(M){return N.test(M)}w.exports=S},65812:function(w,P,a){var f=a(60865);function x(){this.__data__=f?f(null):{},this.size=0}w.exports=x},87e3:function(w){function P(a){var f=this.has(a)&&delete this.__data__[a];return this.size-=f?1:0,f}w.exports=P},66198:function(w,P,a){var f=a(60865),x="__lodash_hash_undefined__",E=Object.prototype,b=E.hasOwnProperty;function v(N){var S=this.__data__;if(f){var M=S[N];return M===x?void 0:M}return b.call(S,N)?S[N]:void 0}w.exports=v},64800:function(w,P,a){var f=a(60865),x=Object.prototype,E=x.hasOwnProperty;function b(v){var N=this.__data__;return f?N[v]!==void 0:E.call(N,v)}w.exports=b},8602:function(w,P,a){var f=a(60865),x="__lodash_hash_undefined__";function E(b,v){var N=this.__data__;return this.size+=this.has(b)?0:1,N[b]=f&&v===void 0?x:v,this}w.exports=E},83505:function(w){var P=Object.prototype,a=P.hasOwnProperty;function f(x){var E=x.length,b=new x.constructor(E);return E&&typeof x[0]=="string"&&a.call(x,"index")&&(b.index=x.index,b.input=x.input),b}w.exports=f},44723:function(w,P,a){var f=a(507),x=a(449),E=a(63472),b=a(66922),v=a(89577),N="[object Boolean]",S="[object Date]",M="[object Map]",A="[object Number]",I="[object RegExp]",j="[object Set]",D="[object String]",Y="[object Symbol]",K="[object ArrayBuffer]",ot="[object DataView]",nt="[object Float32Array]",Q="[object Float64Array]",et="[object Int8Array]",H="[object Int16Array]",it="[object Int32Array]",at="[object Uint8Array]",ft="[object Uint8ClampedArray]",ht="[object Uint16Array]",dt="[object Uint32Array]";function xt(yt,Nt,Ot){var Bt=yt.constructor;switch(Nt){case K:return f(yt);case N:case S:return new Bt(+yt);case ot:return x(yt,Ot);case nt:case Q:case et:case H:case it:case at:case ft:case ht:case dt:return v(yt,Ot);case M:return new Bt;case A:case D:return new Bt(yt);case I:return E(yt);case j:return new Bt;case Y:return b(yt)}}w.exports=xt},71349:function(w,P,a){var f=a(93511),x=a(13530),E=a(46024);function b(v){return typeof v.constructor=="function"&&!E(v)?f(x(v)):{}}w.exports=b},32111:function(w,P,a){var f=a(33140),x=a(30516),E=a(41594),b=f?f.isConcatSpreadable:void 0;function v(N){return E(N)||x(N)||!!(b&&N&&N[b])}w.exports=v},65068:function(w){var P=9007199254740991,a=/^(?:0|[1-9]\d*)$/;function f(x,E){var b=typeof x;return E=E==null?P:E,!!E&&(b=="number"||b!="symbol"&&a.test(x))&&x>-1&&x%1==0&&x<E}w.exports=f},20688:function(w,P,a){var f=a(83914),x=a(9015),E=a(65068),b=a(71721);function v(N,S,M){if(!b(M))return!1;var A=typeof S;return(A=="number"?x(M)&&E(S,M.length):A=="string"&&S in M)?f(M[S],N):!1}w.exports=v},10866:function(w,P,a){var f=a(41594),x=a(66459),E=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,b=/^\w*$/;function v(N,S){if(f(N))return!1;var M=typeof N;return M=="number"||M=="symbol"||M=="boolean"||N==null||x(N)?!0:b.test(N)||!E.test(N)||S!=null&&N in Object(S)}w.exports=v},99595:function(w){function P(a){var f=typeof a;return f=="string"||f=="number"||f=="symbol"||f=="boolean"?a!=="__proto__":a===null}w.exports=P},42469:function(w,P,a){var f=a(4377),x=function(){var b=/[^.]+$/.exec(f&&f.keys&&f.keys.IE_PROTO||"");return b?"Symbol(src)_1."+b:""}();function E(b){return!!x&&x in b}w.exports=E},46024:function(w){var P=Object.prototype;function a(f){var x=f&&f.constructor,E=typeof x=="function"&&x.prototype||P;return f===E}w.exports=a},63286:function(w,P,a){var f=a(71721);function x(E){return E===E&&!f(E)}w.exports=x},62238:function(w){function P(){this.__data__=[],this.size=0}w.exports=P},65652:function(w,P,a){var f=a(82249),x=Array.prototype,E=x.splice;function b(v){var N=this.__data__,S=f(N,v);if(S<0)return!1;var M=N.length-1;return S==M?N.pop():E.call(N,S,1),--this.size,!0}w.exports=b},75965:function(w,P,a){var f=a(82249);function x(E){var b=this.__data__,v=f(b,E);return v<0?void 0:b[v][1]}w.exports=x},83895:function(w,P,a){var f=a(82249);function x(E){return f(this.__data__,E)>-1}w.exports=x},43475:function(w,P,a){var f=a(82249);function x(E,b){var v=this.__data__,N=f(v,E);return N<0?(++this.size,v.push([E,b])):v[N][1]=b,this}w.exports=x},91642:function(w,P,a){var f=a(79955),x=a(53110),E=a(25281);function b(){this.size=0,this.__data__={hash:new f,map:new(E||x),string:new f}}w.exports=b},71646:function(w,P,a){var f=a(27856);function x(E){var b=f(this,E).delete(E);return this.size-=b?1:0,b}w.exports=x},70200:function(w,P,a){var f=a(27856);function x(E){return f(this,E).get(E)}w.exports=x},85304:function(w,P,a){var f=a(27856);function x(E){return f(this,E).has(E)}w.exports=x},57862:function(w,P,a){var f=a(27856);function x(E,b){var v=f(this,E),N=v.size;return v.set(E,b),this.size+=v.size==N?0:1,this}w.exports=x},85120:function(w){function P(a){var f=-1,x=Array(a.size);return a.forEach(function(E,b){x[++f]=[b,E]}),x}w.exports=P},47366:function(w){function P(a,f){return function(x){return x==null?!1:x[a]===f&&(f!==void 0||a in Object(x))}}w.exports=P},72902:function(w,P,a){var f=a(88530),x=500;function E(b){var v=f(b,function(S){return N.size===x&&N.clear(),S}),N=v.cache;return v}w.exports=E},60865:function(w,P,a){var f=a(93454),x=f(Object,"create");w.exports=x},90535:function(w,P,a){var f=a(1276),x=f(Object.keys,Object);w.exports=x},54229:function(w){function P(a){var f=[];if(a!=null)for(var x in Object(a))f.push(x);return f}w.exports=P},37340:function(w,P,a){w=a.nmd(w);var f=a(89413),x=P&&!P.nodeType&&P,E=x&&!0&&w&&!w.nodeType&&w,b=E&&E.exports===x,v=b&&f.process,N=function(){try{var S=E&&E.require&&E.require("util").types;return S||v&&v.binding&&v.binding("util")}catch(M){}}();w.exports=N},92631:function(w){var P=Object.prototype,a=P.toString;function f(x){return a.call(x)}w.exports=f},1276:function(w){function P(a,f){return function(x){return a(f(x))}}w.exports=P},9291:function(w,P,a){var f=a(33546),x=Math.max;function E(b,v,N){return v=x(v===void 0?b.length-1:v,0),function(){for(var S=arguments,M=-1,A=x(S.length-v,0),I=Array(A);++M<A;)I[M]=S[v+M];M=-1;for(var j=Array(v+1);++M<v;)j[M]=S[M];return j[v]=N(I),f(b,this,j)}}w.exports=E},40911:function(w,P,a){var f=a(89413),x=typeof self=="object"&&self&&self.Object===Object&&self,E=f||x||Function("return this")();w.exports=E},10943:function(w){function P(a,f){if(!(f==="constructor"&&typeof a[f]=="function")&&f!="__proto__")return a[f]}w.exports=P},81685:function(w){var P="__lodash_hash_undefined__";function a(f){return this.__data__.set(f,P),this}w.exports=a},1324:function(w){function P(a){return this.__data__.has(a)}w.exports=P},25008:function(w){function P(a){var f=-1,x=Array(a.size);return a.forEach(function(E){x[++f]=E}),x}w.exports=P},48815:function(w,P,a){var f=a(57916),x=a(23031),E=x(f);w.exports=E},23031:function(w){var P=800,a=16,f=Date.now;function x(E){var b=0,v=0;return function(){var N=f(),S=a-(N-v);if(v=N,S>0){if(++b>=P)return arguments[0]}else b=0;return E.apply(void 0,arguments)}}w.exports=x},83214:function(w,P,a){var f=a(53110);function x(){this.__data__=new f,this.size=0}w.exports=x},52806:function(w){function P(a){var f=this.__data__,x=f.delete(a);return this.size=f.size,x}w.exports=P},52032:function(w){function P(a){return this.__data__.get(a)}w.exports=P},51118:function(w){function P(a){return this.__data__.has(a)}w.exports=P},36321:function(w,P,a){var f=a(53110),x=a(25281),E=a(97800),b=200;function v(N,S){var M=this.__data__;if(M instanceof f){var A=M.__data__;if(!x||A.length<b-1)return A.push([N,S]),this.size=++M.size,this;M=this.__data__=new E(A)}return M.set(N,S),this.size=M.size,this}w.exports=v},68048:function(w){function P(a,f,x){for(var E=x-1,b=a.length;++E<b;)if(a[E]===f)return E;return-1}w.exports=P},62961:function(w,P,a){var f=a(8483),x=a(19406),E=a(22174);function b(v){return x(v)?E(v):f(v)}w.exports=b},80048:function(w,P,a){var f=a(72902),x=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,E=/\\(\\)?/g,b=f(function(v){var N=[];return v.charCodeAt(0)===46&&N.push(""),v.replace(x,function(S,M,A,I){N.push(A?I.replace(E,"$1"):M||S)}),N});w.exports=b},90370:function(w,P,a){var f=a(66459),x=1/0;function E(b){if(typeof b=="string"||f(b))return b;var v=b+"";return v=="0"&&1/b==-x?"-0":v}w.exports=E},89614:function(w){var P=Function.prototype,a=P.toString;function f(x){if(x!=null){try{return a.call(x)}catch(E){}try{return x+""}catch(E){}}return""}w.exports=f},10242:function(w){var P=/\s/;function a(f){for(var x=f.length;x--&&P.test(f.charAt(x)););return x}w.exports=a},22174:function(w){var P="\\ud800-\\udfff",a="\\u0300-\\u036f",f="\\ufe20-\\ufe2f",x="\\u20d0-\\u20ff",E=a+f+x,b="\\ufe0e\\ufe0f",v="["+P+"]",N="["+E+"]",S="\\ud83c[\\udffb-\\udfff]",M="(?:"+N+"|"+S+")",A="[^"+P+"]",I="(?:\\ud83c[\\udde6-\\uddff]){2}",j="[\\ud800-\\udbff][\\udc00-\\udfff]",D="\\u200d",Y=M+"?",K="["+b+"]?",ot="(?:"+D+"(?:"+[A,I,j].join("|")+")"+K+Y+")*",nt=K+Y+ot,Q="(?:"+[A+N+"?",N,I,j,v].join("|")+")",et=RegExp(S+"(?="+S+")|"+Q+nt,"g");function H(it){for(var at=et.lastIndex=0;et.test(it);)++at;return at}w.exports=H},40633:function(w,P,a){var f=a(51024),x=4;function E(b){return f(b,x)}w.exports=E},44187:function(w,P,a){var f=a(51024),x=1,E=4;function b(v){return f(v,x|E)}w.exports=b},46221:function(w){function P(a){return function(){return a}}w.exports=P},34981:function(w,P,a){var f=a(2440),x=a(83914),E=a(20688),b=a(331),v=Object.prototype,N=v.hasOwnProperty,S=f(function(M,A){M=Object(M);var I=-1,j=A.length,D=j>2?A[2]:void 0;for(D&&E(A[0],A[1],D)&&(j=1);++I<j;)for(var Y=A[I],K=b(Y),ot=-1,nt=K.length;++ot<nt;){var Q=K[ot],et=M[Q];(et===void 0||x(et,v[Q])&&!N.call(M,Q))&&(M[Q]=Y[Q])}return M});w.exports=S},61475:function(w,P,a){w.exports=a(47177)},83914:function(w){function P(a,f){return a===f||a!==a&&f!==f}w.exports=P},3130:function(w,P,a){var f=a(72280),x=a(22307),E=a(71499),b=a(41594);function v(N,S){var M=b(N)?f:x;return M(N,E(S,3))}w.exports=v},48835:function(w,P,a){var f=a(76470),x=a(45796),E=f(x);w.exports=E},45796:function(w,P,a){var f=a(33405),x=a(71499),E=a(46588),b=Math.max;function v(N,S,M){var A=N==null?0:N.length;if(!A)return-1;var I=M==null?0:E(M);return I<0&&(I=b(A+I,0)),f(N,x(S,3),I)}w.exports=v},1332:function(w,P,a){var f=a(27417);function x(E){var b=E==null?0:E.length;return b?f(E,1):[]}w.exports=x},47177:function(w,P,a){var f=a(22899),x=a(89264),E=a(764),b=a(41594);function v(N,S){var M=b(N)?f:x;return M(N,E(S))}w.exports=v},59946:function(w,P,a){var f=a(43294),x=a(764),E=a(331);function b(v,N){return v==null?v:f(v,x(N),E)}w.exports=b},3239:function(w,P,a){var f=a(96980);function x(E,b,v){var N=E==null?void 0:f(E,b);return N===void 0?v:N}w.exports=x},64760:function(w,P,a){var f=a(11874),x=a(37073);function E(b,v){return b!=null&&x(b,v,f)}w.exports=E},35339:function(w,P,a){var f=a(45146),x=a(37073);function E(b,v){return b!=null&&x(b,v,f)}w.exports=E},44525:function(w){function P(a){return a}w.exports=P},30516:function(w,P,a){var f=a(3841),x=a(71161),E=Object.prototype,b=E.hasOwnProperty,v=E.propertyIsEnumerable,N=f(function(){return arguments}())?f:function(S){return x(S)&&b.call(S,"callee")&&!v.call(S,"callee")};w.exports=N},41594:function(w){var P=Array.isArray;w.exports=P},9015:function(w,P,a){var f=a(92581),x=a(41199);function E(b){return b!=null&&x(b.length)&&!f(b)}w.exports=E},20577:function(w,P,a){var f=a(9015),x=a(71161);function E(b){return x(b)&&f(b)}w.exports=E},33636:function(w,P,a){w=a.nmd(w);var f=a(40911),x=a(75374),E=P&&!P.nodeType&&P,b=E&&!0&&w&&!w.nodeType&&w,v=b&&b.exports===E,N=v?f.Buffer:void 0,S=N?N.isBuffer:void 0,M=S||x;w.exports=M},74336:function(w,P,a){var f=a(63427),x=a(29148),E=a(30516),b=a(41594),v=a(9015),N=a(33636),S=a(46024),M=a(53745),A="[object Map]",I="[object Set]",j=Object.prototype,D=j.hasOwnProperty;function Y(K){if(K==null)return!0;if(v(K)&&(b(K)||typeof K=="string"||typeof K.splice=="function"||N(K)||M(K)||E(K)))return!K.length;var ot=x(K);if(ot==A||ot==I)return!K.size;if(S(K))return!f(K).length;for(var nt in K)if(D.call(K,nt))return!1;return!0}w.exports=Y},92581:function(w,P,a){var f=a(17325),x=a(71721),E="[object AsyncFunction]",b="[object Function]",v="[object GeneratorFunction]",N="[object Proxy]";function S(M){if(!x(M))return!1;var A=f(M);return A==b||A==v||A==E||A==N}w.exports=S},41199:function(w){var P=9007199254740991;function a(f){return typeof f=="number"&&f>-1&&f%1==0&&f<=P}w.exports=a},32455:function(w,P,a){var f=a(9961),x=a(82230),E=a(37340),b=E&&E.isMap,v=b?x(b):f;w.exports=v},71721:function(w){function P(a){var f=typeof a;return a!=null&&(f=="object"||f=="function")}w.exports=P},71161:function(w){function P(a){return a!=null&&typeof a=="object"}w.exports=P},29538:function(w,P,a){var f=a(17325),x=a(13530),E=a(71161),b="[object Object]",v=Function.prototype,N=Object.prototype,S=v.toString,M=N.hasOwnProperty,A=S.call(Object);function I(j){if(!E(j)||f(j)!=b)return!1;var D=x(j);if(D===null)return!0;var Y=M.call(D,"constructor")&&D.constructor;return typeof Y=="function"&&Y instanceof Y&&S.call(Y)==A}w.exports=I},60437:function(w,P,a){var f=a(65562),x=a(82230),E=a(37340),b=E&&E.isSet,v=b?x(b):f;w.exports=v},13720:function(w,P,a){var f=a(17325),x=a(41594),E=a(71161),b="[object String]";function v(N){return typeof N=="string"||!x(N)&&E(N)&&f(N)==b}w.exports=v},66459:function(w,P,a){var f=a(17325),x=a(71161),E="[object Symbol]";function b(v){return typeof v=="symbol"||x(v)&&f(v)==E}w.exports=b},53745:function(w,P,a){var f=a(61651),x=a(82230),E=a(37340),b=E&&E.isTypedArray,v=b?x(b):f;w.exports=v},68408:function(w){function P(a){return a===void 0}w.exports=P},66357:function(w,P,a){var f=a(91762),x=a(63427),E=a(9015);function b(v){return E(v)?f(v):x(v)}w.exports=b},331:function(w,P,a){var f=a(91762),x=a(54193),E=a(9015);function b(v){return E(v)?f(v,!0):x(v)}w.exports=b},47522:function(w){function P(a){var f=a==null?0:a.length;return f?a[f-1]:void 0}w.exports=P},81426:function(w,P,a){var f=a(43453),x=a(71499),E=a(27592),b=a(41594);function v(N,S){var M=b(N)?f:E;return M(N,x(S,3))}w.exports=v},60032:function(w,P,a){var f=a(67109),x=a(23543),E=a(71499);function b(v,N){var S={};return N=E(N,3),x(v,function(M,A,I){f(S,A,N(M,A,I))}),S}w.exports=b},18038:function(w,P,a){var f=a(87542),x=a(52538),E=a(44525);function b(v){return v&&v.length?f(v,E,x):void 0}w.exports=b},88530:function(w,P,a){var f=a(97800),x="Expected a function";function E(b,v){if(typeof b!="function"||v!=null&&typeof v!="function")throw new TypeError(x);var N=function(){var S=arguments,M=v?v.apply(this,S):S[0],A=N.cache;if(A.has(M))return A.get(M);var I=b.apply(this,S);return N.cache=A.set(M,I)||A,I};return N.cache=new(E.Cache||f),N}E.Cache=f,w.exports=E},55056:function(w,P,a){var f=a(37111),x=a(94792),E=x(function(b,v,N){f(b,v,N)});w.exports=E},60169:function(w,P,a){var f=a(87542),x=a(85679),E=a(44525);function b(v){return v&&v.length?f(v,E,x):void 0}w.exports=b},13604:function(w,P,a){var f=a(87542),x=a(71499),E=a(85679);function b(v,N){return v&&v.length?f(v,x(N,2),E):void 0}w.exports=b},65075:function(w){function P(){}w.exports=P},76308:function(w,P,a){var f=a(40911),x=function(){return f.Date.now()};w.exports=x},72333:function(w,P,a){var f=a(80073),x=a(33944),E=x(function(b,v){return b==null?{}:f(b,v)});w.exports=E},59932:function(w,P,a){var f=a(11372),x=a(91315),E=a(10866),b=a(90370);function v(N){return E(N)?f(b(N)):x(N)}w.exports=v},69235:function(w,P,a){var f=a(6651),x=f();w.exports=x},9695:function(w,P,a){var f=a(85665),x=a(89264),E=a(71499),b=a(88120),v=a(41594);function N(S,M,A){var I=v(S)?f:b,j=arguments.length<3;return I(S,E(M,4),A,j,x)}w.exports=N},24727:function(w,P,a){var f=a(63427),x=a(29148),E=a(9015),b=a(13720),v=a(62961),N="[object Map]",S="[object Set]";function M(A){if(A==null)return 0;if(E(A))return b(A)?v(A):A.length;var I=x(A);return I==N||I==S?A.size:f(A).length}w.exports=M},35020:function(w,P,a){var f=a(27417),x=a(50447),E=a(2440),b=a(20688),v=E(function(N,S){if(N==null)return[];var M=S.length;return M>1&&b(N,S[0],S[1])?S=[]:M>2&&b(S[0],S[1],S[2])&&(S=[S[0]]),x(N,f(S,1),[])});w.exports=v},57004:function(w){function P(){return[]}w.exports=P},75374:function(w){function P(){return!1}w.exports=P},925:function(w,P,a){var f=a(13933),x=1/0,E=17976931348623157e292;function b(v){if(!v)return v===0?v:0;if(v=f(v),v===x||v===-x){var N=v<0?-1:1;return N*E}return v===v?v:0}w.exports=b},46588:function(w,P,a){var f=a(925);function x(E){var b=f(E),v=b%1;return b===b?v?b-v:b:0}w.exports=x},13933:function(w,P,a){var f=a(8944),x=a(71721),E=a(66459),b=NaN,v=/^[-+]0x[0-9a-f]+$/i,N=/^0b[01]+$/i,S=/^0o[0-7]+$/i,M=parseInt;function A(I){if(typeof I=="number")return I;if(E(I))return b;if(x(I)){var j=typeof I.valueOf=="function"?I.valueOf():I;I=x(j)?j+"":j}if(typeof I!="string")return I===0?I:+I;I=f(I);var D=N.test(I);return D||S.test(I)?M(I.slice(2),D?2:8):v.test(I)?b:+I}w.exports=A},8416:function(w,P,a){var f=a(39408),x=a(331);function E(b){return f(b,x(b))}w.exports=E},14135:function(w,P,a){var f=a(12580);function x(E){return E==null?"":f(E)}w.exports=x},61477:function(w,P,a){var f=a(22899),x=a(93511),E=a(23543),b=a(71499),v=a(13530),N=a(41594),S=a(33636),M=a(92581),A=a(71721),I=a(53745);function j(D,Y,K){var ot=N(D),nt=ot||S(D)||I(D);if(Y=b(Y,4),K==null){var Q=D&&D.constructor;nt?K=ot?new Q:[]:A(D)?K=M(Q)?x(v(D)):{}:K={}}return(nt?f:E)(D,function(et,H,it){return Y(K,et,H,it)}),K}w.exports=j},99477:function(w,P,a){var f=a(27417),x=a(2440),E=a(75996),b=a(20577),v=x(function(N){return E(f(N,1,b,!0))});w.exports=v},69624:function(w,P,a){var f=a(14135),x=0;function E(b){var v=++x;return f(b)+v}w.exports=E},72834:function(w,P,a){var f=a(98030),x=a(66357);function E(b){return b==null?[]:f(b,x(b))}w.exports=E},79261:function(w,P,a){var f=a(78436),x=a(30232);function E(b,v){return x(b||[],v||[],f)}w.exports=E},34402:function(w,P,a){"use strict";a.r(P),a.d(P,{default:function(){return b}});var f=a(34634);function x(v){var N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!(0,f.isAnyArray)(v))throw new TypeError("input must be an array");if(v.length===0)throw new TypeError("input must not be empty");var S=N.fromIndex,M=S===void 0?0:S,A=N.toIndex,I=A===void 0?v.length:A;if(M<0||M>=v.length||!Number.isInteger(M))throw new Error("fromIndex must be a positive integer smaller than length");if(I<=M||I>v.length||!Number.isInteger(I))throw new Error("toIndex must be an integer greater than fromIndex and at most equal to length");for(var j=v[M],D=M+1;D<I;D++)v[D]>j&&(j=v[D]);return j}function E(v){var N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!(0,f.isAnyArray)(v))throw new TypeError("input must be an array");if(v.length===0)throw new TypeError("input must not be empty");var S=N.fromIndex,M=S===void 0?0:S,A=N.toIndex,I=A===void 0?v.length:A;if(M<0||M>=v.length||!Number.isInteger(M))throw new Error("fromIndex must be a positive integer smaller than length");if(I<=M||I>v.length||!Number.isInteger(I))throw new Error("toIndex must be an integer greater than fromIndex and at most equal to length");for(var j=v[M],D=M+1;D<I;D++)v[D]<j&&(j=v[D]);return j}function b(v){var N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if((0,f.isAnyArray)(v)){if(v.length===0)throw new TypeError("input must not be empty")}else throw new TypeError("input must be an array");var S;if(N.output!==void 0){if(!(0,f.isAnyArray)(N.output))throw new TypeError("output option must be an array if specified");S=N.output}else S=new Array(v.length);var M=E(v),A=x(v);if(M===A)throw new RangeError("minimum and maximum input values are equal. Cannot rescale a constant array");var I=N.min,j=I===void 0?N.autoMinMax?M:0:I,D=N.max,Y=D===void 0?N.autoMinMax?A:1:D;if(j>=Y)throw new RangeError("min option must be smaller than max option");for(var K=(Y-j)/(A-M),ot=0;ot<v.length;ot++)S[ot]=(v[ot]-M)*K+j;return S}}},je={};function me(w){var P=je[w];if(P!==void 0)return P.exports;var a=je[w]={id:w,loaded:!1,exports:{}};return Ke[w](a,a.exports,me),a.loaded=!0,a.exports}(function(){me.n=function(w){var P=w&&w.__esModule?function(){return w.default}:function(){return w};return me.d(P,{a:P}),P}})(),function(){me.d=function(w,P){for(var a in P)me.o(P,a)&&!me.o(w,a)&&Object.defineProperty(w,a,{enumerable:!0,get:P[a]})}}(),function(){me.g=function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch(w){if(typeof window=="object")return window}}()}(),function(){me.o=function(w,P){return Object.prototype.hasOwnProperty.call(w,P)}}(),function(){me.r=function(w){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(w,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(w,"__esModule",{value:!0})}}(),function(){me.nmd=function(w){return w.paths=[],w.children||(w.children=[]),w}}();var Ju={};(function(){"use strict";var w=function(n,e){return w=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(t[s]=r[s])},w(n,e)};function P(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");w(n,e);function t(){this.constructor=n}n.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var a=function(){return a=Object.assign||function(e){for(var t,r=1,s=arguments.length;r<s;r++){t=arguments[r];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},a.apply(this,arguments)};function f(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(n);s<r.length;s++)e.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(n,r[s])&&(t[r[s]]=n[r[s]]);return t}function x(n,e,t,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,r);else for(var d=n.length-1;d>=0;d--)(h=n[d])&&(o=(s<3?h(o):s>3?h(e,t,o):h(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o}function E(n,e){return function(t,r){e(t,r,n)}}function b(n,e,t,r,s,o){function h(C){if(C!==void 0&&typeof C!="function")throw new TypeError("Function expected");return C}for(var d=r.kind,p=d==="getter"?"get":d==="setter"?"set":"value",g=!e&&n?r.static?n:n.prototype:null,y=e||(g?Object.getOwnPropertyDescriptor(g,r.name):{}),O,L=!1,R=t.length-1;R>=0;R--){var k={};for(var F in r)k[F]=F==="access"?{}:r[F];for(var F in r.access)k.access[F]=r.access[F];k.addInitializer=function(C){if(L)throw new TypeError("Cannot add initializers after decoration has completed");o.push(h(C||null))};var z=(0,t[R])(d==="accessor"?{get:y.get,set:y.set}:y[p],k);if(d==="accessor"){if(z===void 0)continue;if(z===null||typeof z!="object")throw new TypeError("Object expected");(O=h(z.get))&&(y.get=O),(O=h(z.set))&&(y.set=O),(O=h(z.init))&&s.unshift(O)}else(O=h(z))&&(d==="field"?s.unshift(O):y[p]=O)}g&&Object.defineProperty(g,r.name,y),L=!0}function v(n,e,t){for(var r=arguments.length>2,s=0;s<e.length;s++)t=r?e[s].call(n,t):e[s].call(n);return r?t:void 0}function N(n){return typeof n=="symbol"?n:"".concat(n)}function S(n,e,t){return typeof e=="symbol"&&(e=e.description?"[".concat(e.description,"]"):""),Object.defineProperty(n,"name",{configurable:!0,value:t?"".concat(t," ",e):e})}function M(n,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,e)}function A(n,e,t,r){function s(o){return o instanceof t?o:new t(function(h){h(o)})}return new(t||(t=Promise))(function(o,h){function d(y){try{g(r.next(y))}catch(O){h(O)}}function p(y){try{g(r.throw(y))}catch(O){h(O)}}function g(y){y.done?o(y.value):s(y.value).then(d,p)}g((r=r.apply(n,e||[])).next())})}function I(n,e){var t={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,s,o,h=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return h.next=d(0),h.throw=d(1),h.return=d(2),typeof Symbol=="function"&&(h[Symbol.iterator]=function(){return this}),h;function d(g){return function(y){return p([g,y])}}function p(g){if(r)throw new TypeError("Generator is already executing.");for(;h&&(h=0,g[0]&&(t=0)),t;)try{if(r=1,s&&(o=g[0]&2?s.return:g[0]?s.throw||((o=s.return)&&o.call(s),0):s.next)&&!(o=o.call(s,g[1])).done)return o;switch(s=0,o&&(g=[g[0]&2,o.value]),g[0]){case 0:case 1:o=g;break;case 4:return t.label++,{value:g[1],done:!1};case 5:t.label++,s=g[1],g=[0];continue;case 7:g=t.ops.pop(),t.trys.pop();continue;default:if(o=t.trys,!(o=o.length>0&&o[o.length-1])&&(g[0]===6||g[0]===2)){t=0;continue}if(g[0]===3&&(!o||g[1]>o[0]&&g[1]<o[3])){t.label=g[1];break}if(g[0]===6&&t.label<o[1]){t.label=o[1],o=g;break}if(o&&t.label<o[2]){t.label=o[2],t.ops.push(g);break}o[2]&&t.ops.pop(),t.trys.pop();continue}g=e.call(n,t)}catch(y){g=[6,y],s=0}finally{r=o=0}if(g[0]&5)throw g[1];return{value:g[0]?g[1]:void 0,done:!0}}}var j=Object.create?function(n,e,t,r){r===void 0&&(r=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(n,r,s)}:function(n,e,t,r){r===void 0&&(r=t),n[r]=e[t]};function D(n,e){for(var t in n)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&j(e,n,t)}function Y(n){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&n[e],r=0;if(t)return t.call(n);if(n&&typeof n.length=="number")return{next:function(){return n&&r>=n.length&&(n=void 0),{value:n&&n[r++],done:!n}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function K(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var r=t.call(n),s,o=[],h;try{for(;(e===void 0||e-- >0)&&!(s=r.next()).done;)o.push(s.value)}catch(d){h={error:d}}finally{try{s&&!s.done&&(t=r.return)&&t.call(r)}finally{if(h)throw h.error}}return o}function ot(){for(var n=[],e=0;e<arguments.length;e++)n=n.concat(K(arguments[e]));return n}function nt(){for(var n=0,e=0,t=arguments.length;e<t;e++)n+=arguments[e].length;for(var r=Array(n),s=0,e=0;e<t;e++)for(var o=arguments[e],h=0,d=o.length;h<d;h++,s++)r[s]=o[h];return r}function Q(n,e,t){if(t||arguments.length===2)for(var r=0,s=e.length,o;r<s;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return n.concat(o||Array.prototype.slice.call(e))}function et(n){return this instanceof et?(this.v=n,this):new et(n)}function H(n,e,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=t.apply(n,e||[]),s,o=[];return s=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),d("next"),d("throw"),d("return",h),s[Symbol.asyncIterator]=function(){return this},s;function h(R){return function(k){return Promise.resolve(k).then(R,O)}}function d(R,k){r[R]&&(s[R]=function(F){return new Promise(function(z,C){o.push([R,F,z,C])>1||p(R,F)})},k&&(s[R]=k(s[R])))}function p(R,k){try{g(r[R](k))}catch(F){L(o[0][3],F)}}function g(R){R.value instanceof et?Promise.resolve(R.value.v).then(y,O):L(o[0][2],R)}function y(R){p("next",R)}function O(R){p("throw",R)}function L(R,k){R(k),o.shift(),o.length&&p(o[0][0],o[0][1])}}function it(n){var e,t;return e={},r("next"),r("throw",function(s){throw s}),r("return"),e[Symbol.iterator]=function(){return this},e;function r(s,o){e[s]=n[s]?function(h){return(t=!t)?{value:et(n[s](h)),done:!1}:o?o(h):h}:o}}function at(n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=n[Symbol.asyncIterator],t;return e?e.call(n):(n=typeof Y=="function"?Y(n):n[Symbol.iterator](),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(o){t[o]=n[o]&&function(h){return new Promise(function(d,p){h=n[o](h),s(d,p,h.done,h.value)})}}function s(o,h,d,p){Promise.resolve(p).then(function(g){o({value:g,done:d})},h)}}function ft(n,e){return Object.defineProperty?Object.defineProperty(n,"raw",{value:e}):n.raw=e,n}var ht=Object.create?function(n,e){Object.defineProperty(n,"default",{enumerable:!0,value:e})}:function(n,e){n.default=e},dt=function(n){return dt=Object.getOwnPropertyNames||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[t.length]=r);return t},dt(n)};function xt(n){if(n&&n.__esModule)return n;var e={};if(n!=null)for(var t=dt(n),r=0;r<t.length;r++)t[r]!=="default"&&j(e,n,t[r]);return ht(e,n),e}function yt(n){return n&&n.__esModule?n:{default:n}}function Nt(n,e,t,r){if(t==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?n!==e||!r:!e.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?r:t==="a"?r.call(n):r?r.value:e.get(n)}function Ot(n,e,t,r,s){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?n!==e||!s:!e.has(n))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?s.call(n,t):s?s.value=t:e.set(n,t),t}function Bt(n,e){if(e===null||typeof e!="object"&&typeof e!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof n=="function"?e===n:n.has(e)}function Vt(n,e,t){if(e!=null){if(typeof e!="object"&&typeof e!="function")throw new TypeError("Object expected.");var r,s;if(t){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");r=e[Symbol.asyncDispose]}if(r===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");r=e[Symbol.dispose],t&&(s=r)}if(typeof r!="function")throw new TypeError("Object not disposable.");s&&(r=function(){try{s.call(this)}catch(o){return Promise.reject(o)}}),n.stack.push({value:e,dispose:r,async:t})}else t&&n.stack.push({async:!0});return e}var Ht=typeof SuppressedError=="function"?SuppressedError:function(n,e,t){var r=new Error(t);return r.name="SuppressedError",r.error=n,r.suppressed=e,r};function ee(n){function e(o){n.error=n.hasError?new Ht(o,n.error,"An error was suppressed during disposal."):o,n.hasError=!0}var t,r=0;function s(){for(;t=n.stack.pop();)try{if(!t.async&&r===1)return r=0,n.stack.push(t),Promise.resolve().then(s);if(t.dispose){var o=t.dispose.call(t.value);if(t.async)return r|=2,Promise.resolve(o).then(s,function(h){return e(h),s()})}else r|=1}catch(h){e(h)}if(r===1)return n.hasError?Promise.reject(n.error):Promise.resolve();if(n.hasError)throw n.error}return s()}function ye(n,e){return typeof n=="string"&&/^\.\.?\//.test(n)?n.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(t,r,s,o,h){return r?e?".jsx":".js":s&&(!o||!h)?t:s+o+"."+h.toLowerCase()+"js"}):n}var $e={__extends:P,__assign:a,__rest:f,__decorate:x,__param:E,__esDecorate:b,__runInitializers:v,__propKey:N,__setFunctionName:S,__metadata:M,__awaiter:A,__generator:I,__createBinding:j,__exportStar:D,__values:Y,__read:K,__spread:ot,__spreadArrays:nt,__spreadArray:Q,__await:et,__asyncGenerator:H,__asyncDelegator:it,__asyncValues:at,__makeTemplateObject:ft,__importStar:xt,__importDefault:yt,__classPrivateFieldGet:Nt,__classPrivateFieldSet:Ot,__classPrivateFieldIn:Bt,__addDisposableResource:Vt,__disposeResources:ee,__rewriteRelativeImportExtension:ye},nn="*",Mn=function(){function n(){this._events={}}return n.prototype.on=function(e,t,r){return this._events[e]||(this._events[e]=[]),this._events[e].push({callback:t,once:!!r}),this},n.prototype.once=function(e,t){return this.on(e,t,!0)},n.prototype.emit=function(e){for(var t=this,r=[],s=1;s<arguments.length;s++)r[s-1]=arguments[s];var o=this._events[e]||[],h=this._events[nn]||[],d=function(p){for(var g=p.length,y=0;y<g;y++)if(p[y]){var O=p[y],L=O.callback,R=O.once;R&&(p.splice(y,1),p.length===0&&delete t._events[e],g--,y--),L.apply(t,r)}};d(o),d(h)},n.prototype.off=function(e,t){if(!e)this._events={};else if(!t)delete this._events[e];else{for(var r=this._events[e]||[],s=r.length,o=0;o<s;o++)r[o].callback===t&&(r.splice(o,1),s--,o--);r.length===0&&delete this._events[e]}return this},n.prototype.getEvents=function(){return this._events},n}(),Sn=Mn;function cn(n,e,t,r){for(;n.length;){const s=n.shift();if(t(s))return!0;e.add(s.id),r(s.id).forEach(h=>{e.has(h.id)||(e.add(h.id),n.push(h))})}return!1}function Je(n,e,t,r){if(t(n))return!0;e.add(n.id);for(const o of r(n.id))if(!e.has(o.id)&&Je(o,e,t,r))return!0;return!1}const an=()=>!0;class gt{constructor(e){be(this,"graph");be(this,"nodeFilter");be(this,"edgeFilter");be(this,"cacheEnabled");be(this,"inEdgesMap",new Map);be(this,"outEdgesMap",new Map);be(this,"bothEdgesMap",new Map);be(this,"allNodesMap",new Map);be(this,"allEdgesMap",new Map);be(this,"clearCache",()=>{this.inEdgesMap.clear(),this.outEdgesMap.clear(),this.bothEdgesMap.clear(),this.allNodesMap.clear(),this.allEdgesMap.clear()});be(this,"refreshCache",()=>{this.clearCache(),this.updateCache(this.graph.getAllNodes().map(e=>e.id))});be(this,"updateCache",e=>{const t=new Set;e.forEach(r=>{const s=this.bothEdgesMap.get(r);if(s&&s.forEach(o=>t.add(o.id)),!this.hasNode(r))this.inEdgesMap.delete(r),this.outEdgesMap.delete(r),this.bothEdgesMap.delete(r),this.allNodesMap.delete(r);else{const o=this.graph.getRelatedEdges(r,"in").filter(this.edgeFilter),h=this.graph.getRelatedEdges(r,"out").filter(this.edgeFilter),d=Array.from(new Set([...o,...h]));d.forEach(p=>t.add(p.id)),this.inEdgesMap.set(r,o),this.outEdgesMap.set(r,h),this.bothEdgesMap.set(r,d),this.allNodesMap.set(r,this.graph.getNode(r))}}),t.forEach(r=>{this.hasEdge(r)?this.allEdgesMap.set(r,this.graph.getEdge(r)):this.allEdgesMap.delete(r)})});be(this,"handleGraphChanged",e=>{const t=new Set;e.changes.forEach(r=>{switch(r.type){case"NodeAdded":t.add(r.value.id);break;case"NodeDataUpdated":t.add(r.id);break;case"EdgeAdded":t.add(r.value.source),t.add(r.value.target);break;case"EdgeUpdated":(r.propertyName==="source"||r.propertyName==="target")&&(t.add(r.oldValue),t.add(r.newValue));break;case"EdgeDataUpdated":if(e.graph.hasEdge(r.id)){const s=e.graph.getEdge(r.id);t.add(s.source),t.add(s.target)}break;case"EdgeRemoved":t.add(r.value.source),t.add(r.value.target);break;case"NodeRemoved":t.add(r.value.id);break;default:break}}),this.updateCache(t)});this.graph=e.graph;const t=e.nodeFilter||an,r=e.edgeFilter||an;this.nodeFilter=t,this.edgeFilter=s=>{const{source:o,target:h}=this.graph.getEdgeDetail(s.id);return!t(o)||!t(h)?!1:r(s,o,h)},e.cache==="auto"?(this.cacheEnabled=!0,this.startAutoCache()):e.cache==="manual"?this.cacheEnabled=!0:this.cacheEnabled=!1}startAutoCache(){this.refreshCache(),this.graph.on("changed",this.handleGraphChanged)}stopAutoCache(){this.graph.off("changed",this.handleGraphChanged)}checkNodeExistence(e){this.getNode(e)}hasNode(e){if(!this.graph.hasNode(e))return!1;const t=this.graph.getNode(e);return this.nodeFilter(t)}areNeighbors(e,t){return this.checkNodeExistence(e),this.getNeighbors(t).some(r=>r.id===e)}getNode(e){const t=this.graph.getNode(e);if(!this.nodeFilter(t))throw new Error("Node not found for id: "+e);return t}getRelatedEdges(e,t){return this.checkNodeExistence(e),this.cacheEnabled?t==="in"?this.inEdgesMap.get(e):t==="out"?this.outEdgesMap.get(e):this.bothEdgesMap.get(e):this.graph.getRelatedEdges(e,t).filter(this.edgeFilter)}getDegree(e,t){return this.getRelatedEdges(e,t).length}getSuccessors(e){const r=this.getRelatedEdges(e,"out").map(s=>this.getNode(s.target));return Array.from(new Set(r))}getPredecessors(e){const r=this.getRelatedEdges(e,"in").map(s=>this.getNode(s.source));return Array.from(new Set(r))}getNeighbors(e){const t=this.getPredecessors(e),r=this.getSuccessors(e);return Array.from(new Set([...t,...r]))}hasEdge(e){if(!this.graph.hasEdge(e))return!1;const t=this.graph.getEdge(e);return this.edgeFilter(t)}getEdge(e){const t=this.graph.getEdge(e);if(!this.edgeFilter(t))throw new Error("Edge not found for id: "+e);return t}getEdgeDetail(e){const t=this.getEdge(e);return{edge:t,source:this.getNode(t.source),target:this.getNode(t.target)}}hasTreeStructure(e){return this.graph.hasTreeStructure(e)}getRoots(e){return this.graph.getRoots(e).filter(this.nodeFilter)}getChildren(e,t){return this.checkNodeExistence(e),this.graph.getChildren(e,t).filter(this.nodeFilter)}getParent(e,t){this.checkNodeExistence(e);const r=this.graph.getParent(e,t);return!r||!this.nodeFilter(r)?null:r}getAllNodes(){return this.cacheEnabled?Array.from(this.allNodesMap.values()):this.graph.getAllNodes().filter(this.nodeFilter)}getAllEdges(){return this.cacheEnabled?Array.from(this.allEdgesMap.values()):this.graph.getAllEdges().filter(this.edgeFilter)}bfs(e,t,r="out"){const s={in:this.getPredecessors.bind(this),out:this.getSuccessors.bind(this),both:this.getNeighbors.bind(this)}[r];cn([this.getNode(e)],new Set,t,s)}dfs(e,t,r="out"){const s={in:this.getPredecessors.bind(this),out:this.getSuccessors.bind(this),both:this.getNeighbors.bind(this)}[r];Je(this.getNode(e),new Set,t,s)}}class vt extends Sn{constructor(t){super();be(this,"nodeMap",new Map);be(this,"edgeMap",new Map);be(this,"inEdgesMap",new Map);be(this,"outEdgesMap",new Map);be(this,"bothEdgesMap",new Map);be(this,"treeIndices",new Map);be(this,"changes",[]);be(this,"batchCount",0);be(this,"onChanged",()=>{});be(this,"batch",t=>{this.batchCount+=1,t(),this.batchCount-=1,this.batchCount||this.commit()});t&&(t.nodes&&this.addNodes(t.nodes),t.edges&&this.addEdges(t.edges),t.tree&&this.addTree(t.tree),t.onChanged&&(this.onChanged=t.onChanged))}commit(){const t=this.changes;this.changes=[];const r={graph:this,changes:t};this.emit("changed",r),this.onChanged(r)}reduceChanges(t){let r=[];return t.forEach(s=>{switch(s.type){case"NodeRemoved":{let o=!1;r=r.filter(h=>{if(h.type==="NodeAdded"){const d=h.value.id===s.value.id;return d&&(o=!0),!d}else{if(h.type==="NodeDataUpdated")return h.id!==s.value.id;if(h.type==="TreeStructureChanged")return h.nodeId!==s.value.id}return!0}),o||r.push(s);break}case"EdgeRemoved":{let o=!1;r=r.filter(h=>{if(h.type==="EdgeAdded"){const d=h.value.id===s.value.id;return d&&(o=!0),!d}else if(h.type==="EdgeDataUpdated"||h.type==="EdgeUpdated")return h.id!==s.value.id;return!0}),o||r.push(s);break}case"NodeDataUpdated":case"EdgeDataUpdated":case"EdgeUpdated":{const o=r.findIndex(d=>d.type===s.type&&d.id===s.id&&(s.propertyName===void 0||d.propertyName===s.propertyName)),h=r[o];h?s.propertyName!==void 0?h.newValue=s.newValue:(r.splice(o,1),r.push(s)):r.push(s);break}case"TreeStructureDetached":{r=r.filter(o=>o.type==="TreeStructureAttached"||o.type==="TreeStructureChanged"?o.treeKey!==s.treeKey:!0),r.push(s);break}case"TreeStructureChanged":{const o=r.find(h=>h.type==="TreeStructureChanged"&&h.treeKey===s.treeKey&&h.nodeId===s.nodeId);o?o.newParentId=s.newParentId:r.push(s);break}default:r.push(s);break}}),r}checkNodeExistence(t){this.getNode(t)}hasNode(t){return this.nodeMap.has(t)}areNeighbors(t,r){return this.getNeighbors(r).some(s=>s.id===t)}getNode(t){const r=this.nodeMap.get(t);if(!r)throw new Error("Node not found for id: "+t);return r}getRelatedEdges(t,r){if(this.checkNodeExistence(t),r==="in"){const s=this.inEdgesMap.get(t);return Array.from(s)}else if(r==="out"){const s=this.outEdgesMap.get(t);return Array.from(s)}else{const s=this.bothEdgesMap.get(t);return Array.from(s)}}getDegree(t,r){return this.getRelatedEdges(t,r).length}getSuccessors(t){const s=this.getRelatedEdges(t,"out").map(o=>this.getNode(o.target));return Array.from(new Set(s))}getPredecessors(t){const s=this.getRelatedEdges(t,"in").map(o=>this.getNode(o.source));return Array.from(new Set(s))}getNeighbors(t){const r=this.getPredecessors(t),s=this.getSuccessors(t);return Array.from(new Set([...r,...s]))}doAddNode(t){if(this.hasNode(t.id))throw new Error("Node already exists: "+t.id);this.nodeMap.set(t.id,t),this.inEdgesMap.set(t.id,new Set),this.outEdgesMap.set(t.id,new Set),this.bothEdgesMap.set(t.id,new Set),this.treeIndices.forEach(r=>{r.childrenMap.set(t.id,new Set)}),this.changes.push({type:"NodeAdded",value:t})}addNodes(t){this.batch(()=>{for(const r of t)this.doAddNode(r)})}addNode(t){this.addNodes([t])}doRemoveNode(t){const r=this.getNode(t),s=this.bothEdgesMap.get(t);s==null||s.forEach(o=>this.doRemoveEdge(o.id)),this.nodeMap.delete(t),this.treeIndices.forEach(o=>{var d,p;(d=o.childrenMap.get(t))==null||d.forEach(g=>{o.parentMap.delete(g.id)});const h=o.parentMap.get(t);h&&((p=o.childrenMap.get(h.id))==null||p.delete(r)),o.parentMap.delete(t),o.childrenMap.delete(t)}),this.bothEdgesMap.delete(t),this.inEdgesMap.delete(t),this.outEdgesMap.delete(t),this.changes.push({type:"NodeRemoved",value:r})}removeNodes(t){this.batch(()=>{t.forEach(r=>this.doRemoveNode(r))})}removeNode(t){this.removeNodes([t])}updateNodeDataProperty(t,r,s){const o=this.getNode(t);this.batch(()=>{const h=o.data[r],d=s;o.data[r]=d,this.changes.push({type:"NodeDataUpdated",id:t,propertyName:r,oldValue:h,newValue:d})})}mergeNodeData(t,r){this.batch(()=>{Object.entries(r).forEach(([s,o])=>{this.updateNodeDataProperty(t,s,o)})})}updateNodeData(...t){const r=t[0],s=this.getNode(r);if(typeof t[1]=="string"){this.updateNodeDataProperty(r,t[1],t[2]);return}let o;if(typeof t[1]=="function"){const h=t[1];o=h(s.data)}else typeof t[1]=="object"&&(o=t[1]);this.batch(()=>{const h=s.data,d=o;s.data=o,this.changes.push({type:"NodeDataUpdated",id:r,oldValue:h,newValue:d})})}checkEdgeExistence(t){if(!this.hasEdge(t))throw new Error("Edge not found for id: "+t)}hasEdge(t){return this.edgeMap.has(t)}getEdge(t){return this.checkEdgeExistence(t),this.edgeMap.get(t)}getEdgeDetail(t){const r=this.getEdge(t);return{edge:r,source:this.getNode(r.source),target:this.getNode(r.target)}}doAddEdge(t){if(this.hasEdge(t.id))throw new Error("Edge already exists: "+t.id);this.checkNodeExistence(t.source),this.checkNodeExistence(t.target),this.edgeMap.set(t.id,t);const r=this.inEdgesMap.get(t.target),s=this.outEdgesMap.get(t.source),o=this.bothEdgesMap.get(t.source),h=this.bothEdgesMap.get(t.target);r.add(t),s.add(t),o.add(t),h.add(t),this.changes.push({type:"EdgeAdded",value:t})}addEdges(t){this.batch(()=>{for(const r of t)this.doAddEdge(r)})}addEdge(t){this.addEdges([t])}doRemoveEdge(t){const r=this.getEdge(t),s=this.outEdgesMap.get(r.source),o=this.inEdgesMap.get(r.target),h=this.bothEdgesMap.get(r.source),d=this.bothEdgesMap.get(r.target);s.delete(r),o.delete(r),h.delete(r),d.delete(r),this.edgeMap.delete(t),this.changes.push({type:"EdgeRemoved",value:r})}removeEdges(t){this.batch(()=>{t.forEach(r=>this.doRemoveEdge(r))})}removeEdge(t){this.removeEdges([t])}updateEdgeSource(t,r){const s=this.getEdge(t);this.checkNodeExistence(r);const o=s.source,h=r;this.outEdgesMap.get(o).delete(s),this.bothEdgesMap.get(o).delete(s),this.outEdgesMap.get(h).add(s),this.bothEdgesMap.get(h).add(s),s.source=r,this.batch(()=>{this.changes.push({type:"EdgeUpdated",id:t,propertyName:"source",oldValue:o,newValue:h})})}updateEdgeTarget(t,r){const s=this.getEdge(t);this.checkNodeExistence(r);const o=s.target,h=r;this.inEdgesMap.get(o).delete(s),this.bothEdgesMap.get(o).delete(s),this.inEdgesMap.get(h).add(s),this.bothEdgesMap.get(h).add(s),s.target=r,this.batch(()=>{this.changes.push({type:"EdgeUpdated",id:t,propertyName:"target",oldValue:o,newValue:h})})}updateEdgeDataProperty(t,r,s){const o=this.getEdge(t);this.batch(()=>{const h=o.data[r],d=s;o.data[r]=d,this.changes.push({type:"EdgeDataUpdated",id:t,propertyName:r,oldValue:h,newValue:d})})}updateEdgeData(...t){const r=t[0],s=this.getEdge(r);if(typeof t[1]=="string"){this.updateEdgeDataProperty(r,t[1],t[2]);return}let o;if(typeof t[1]=="function"){const h=t[1];o=h(s.data)}else typeof t[1]=="object"&&(o=t[1]);this.batch(()=>{const h=s.data,d=o;s.data=o,this.changes.push({type:"EdgeDataUpdated",id:r,oldValue:h,newValue:d})})}mergeEdgeData(t,r){this.batch(()=>{Object.entries(r).forEach(([s,o])=>{this.updateEdgeDataProperty(t,s,o)})})}checkTreeExistence(t){if(!this.hasTreeStructure(t))throw new Error("Tree structure not found for treeKey: "+t)}hasTreeStructure(t){return this.treeIndices.has(t)}attachTreeStructure(t){this.treeIndices.has(t)||(this.treeIndices.set(t,{parentMap:new Map,childrenMap:new Map}),this.batch(()=>{this.changes.push({type:"TreeStructureAttached",treeKey:t})}))}detachTreeStructure(t){this.checkTreeExistence(t),this.treeIndices.delete(t),this.batch(()=>{this.changes.push({type:"TreeStructureDetached",treeKey:t})})}addTree(t,r){this.batch(()=>{this.attachTreeStructure(r);const s=[],o=Array.isArray(t)?t:[t];for(;o.length;){const h=o.shift();s.push(h),h.children&&o.push(...h.children)}this.addNodes(s),s.forEach(h=>{var d;(d=h.children)==null||d.forEach(p=>{this.setParent(p.id,h.id,r)})})})}getRoots(t){return this.checkTreeExistence(t),this.getAllNodes().filter(r=>!this.getParent(r.id,t))}getChildren(t,r){this.checkNodeExistence(t),this.checkTreeExistence(r);const o=this.treeIndices.get(r).childrenMap.get(t);return Array.from(o||[])}getParent(t,r){return this.checkNodeExistence(t),this.checkTreeExistence(r),this.treeIndices.get(r).parentMap.get(t)||null}getAncestors(t,r){const s=[];let o=this.getNode(t),h;for(;h=this.getParent(o.id,r);)s.push(h),o=h;return s}setParent(t,r,s){var y,O;this.checkTreeExistence(s);const o=this.treeIndices.get(s);if(!o)return;const h=this.getNode(t),d=o.parentMap.get(t);if((d==null?void 0:d.id)===r)return;if(r==null){d&&((y=o.childrenMap.get(d.id))==null||y.delete(h)),o.parentMap.delete(t);return}const p=this.getNode(r);o.parentMap.set(t,p),d&&((O=o.childrenMap.get(d.id))==null||O.delete(h));let g=o.childrenMap.get(p.id);g||(g=new Set,o.childrenMap.set(p.id,g)),g.add(h),this.batch(()=>{this.changes.push({type:"TreeStructureChanged",treeKey:s,nodeId:t,oldParentId:d==null?void 0:d.id,newParentId:p.id})})}dfsTree(t,r,s){const o=h=>this.getChildren(h,s);return Je(this.getNode(t),new Set,r,o)}bfsTree(t,r,s){const o=h=>this.getChildren(h,s);return cn([this.getNode(t)],new Set,r,o)}getAllNodes(){return Array.from(this.nodeMap.values())}getAllEdges(){return Array.from(this.edgeMap.values())}bfs(t,r,s="out"){const o={in:this.getPredecessors.bind(this),out:this.getSuccessors.bind(this),both:this.getNeighbors.bind(this)}[s];return cn([this.getNode(t)],new Set,r,o)}dfs(t,r,s="out"){const o={in:this.getPredecessors.bind(this),out:this.getSuccessors.bind(this),both:this.getNeighbors.bind(this)}[s];return Je(this.getNode(t),new Set,r,o)}clone(){const t=this.getAllNodes().map(o=>$r(kn({},o),{data:kn({},o.data)})),r=this.getAllEdges().map(o=>$r(kn({},o),{data:kn({},o.data)})),s=new vt({nodes:t,edges:r});return this.treeIndices.forEach(({parentMap:o,childrenMap:h},d)=>{const p=new Map;o.forEach((y,O)=>{p.set(O,s.getNode(y.id))});const g=new Map;h.forEach((y,O)=>{g.set(O,new Set(Array.from(y).map(L=>s.getNode(L.id))))}),s.treeIndices.set(d,{parentMap:p,childrenMap:g})}),s}toJSON(){return JSON.stringify({nodes:this.getAllNodes(),edges:this.getAllEdges()})}createView(t){return new gt(kn({graph:this},t))}}const At=Symbol("Comlink.proxy"),Ft=Symbol("Comlink.endpoint"),qt=Symbol("Comlink.releaseProxy"),ue=Symbol("Comlink.finalizer"),he=Symbol("Comlink.thrown"),Ie=n=>typeof n=="object"&&n!==null||typeof n=="function",pn={canHandle:n=>Ie(n)&&n[At],serialize(n){const{port1:e,port2:t}=new MessageChannel;return Wt(n,e),[t,[t]]},deserialize(n){return n.start(),un(n)}},De={canHandle:n=>Ie(n)&&he in n,serialize({value:n}){let e;return n instanceof Error?e={isError:!0,value:{message:n.message,name:n.name,stack:n.stack}}:e={isError:!1,value:n},[e,[]]},deserialize(n){throw n.isError?Object.assign(new Error(n.value.message),n.value):n.value}},Me=new Map([["proxy",pn],["throw",De]]);function se(n,e){for(const t of n)if(e===t||t==="*"||t instanceof RegExp&&t.test(e))return!0;return!1}function Wt(n,e=globalThis,t=["*"]){e.addEventListener("message",function r(s){if(!s||!s.data)return;if(!se(t,s.origin)){console.warn(`Invalid origin '${s.origin}' for comlink proxy`);return}const{id:o,type:h,path:d}=Object.assign({path:[]},s.data),p=(s.data.argumentList||[]).map(ze);let g;try{const y=d.slice(0,-1).reduce((L,R)=>L[R],n),O=d.reduce((L,R)=>L[R],n);switch(h){case"GET":g=O;break;case"SET":y[d.slice(-1)[0]]=ze(s.data.value),g=!0;break;case"APPLY":g=O.apply(y,p);break;case"CONSTRUCT":{const L=new O(...p);g=mn(L)}break;case"ENDPOINT":{const{port1:L,port2:R}=new MessageChannel;Wt(n,R),g=Rn(L,[L])}break;case"RELEASE":g=void 0;break;default:return}}catch(y){g={value:y,[he]:0}}Promise.resolve(g).catch(y=>({value:y,[he]:0})).then(y=>{const[O,L]=Be(y);e.postMessage(Object.assign(Object.assign({},O),{id:o}),L),h==="RELEASE"&&(e.removeEventListener("message",r),rn(e),ue in n&&typeof n[ue]=="function"&&n[ue]())}).catch(y=>{const[O,L]=Be({value:new TypeError("Unserializable return value"),[he]:0});e.postMessage(Object.assign(Object.assign({},O),{id:o}),L)})}),e.start&&e.start()}function re(n){return n.constructor.name==="MessagePort"}function rn(n){re(n)&&n.close()}function un(n,e){const t=new Map;return n.addEventListener("message",function(s){const{data:o}=s;if(!o||!o.id)return;const h=t.get(o.id);if(h)try{h(o)}finally{t.delete(o.id)}}),On(n,t,[],e)}function It(n){if(n)throw new Error("Proxy has been released and is not useable")}function fn(n){return Ae(n,new Map,{type:"RELEASE"}).then(()=>{rn(n)})}const Pe=new WeakMap,xe="FinalizationRegistry"in globalThis&&new FinalizationRegistry(n=>{const e=(Pe.get(n)||0)-1;Pe.set(n,e),e===0&&fn(n)});function ke(n,e){const t=(Pe.get(e)||0)+1;Pe.set(e,t),xe&&xe.register(n,e,n)}function vn(n){xe&&xe.unregister(n)}function On(n,e,t=[],r=function(){}){let s=!1;const o=new Proxy(r,{get(h,d){if(It(s),d===qt)return()=>{vn(o),fn(n),e.clear(),s=!0};if(d==="then"){if(t.length===0)return{then:()=>o};const p=Ae(n,e,{type:"GET",path:t.map(g=>g.toString())}).then(ze);return p.then.bind(p)}return On(n,e,[...t,d])},set(h,d,p){It(s);const[g,y]=Be(p);return Ae(n,e,{type:"SET",path:[...t,d].map(O=>O.toString()),value:g},y).then(ze)},apply(h,d,p){It(s);const g=t[t.length-1];if(g===Ft)return Ae(n,e,{type:"ENDPOINT"}).then(ze);if(g==="bind")return On(n,e,t.slice(0,-1));const[y,O]=sn(p);return Ae(n,e,{type:"APPLY",path:t.map(L=>L.toString()),argumentList:y},O).then(ze)},construct(h,d){It(s);const[p,g]=sn(d);return Ae(n,e,{type:"CONSTRUCT",path:t.map(y=>y.toString()),argumentList:p},g).then(ze)}});return ke(o,n),o}function Pn(n){return Array.prototype.concat.apply([],n)}function sn(n){const e=n.map(Be);return[e.map(t=>t[0]),Pn(e.map(t=>t[1]))]}const An=new WeakMap;function Rn(n,e){return An.set(n,e),n}function mn(n){return Object.assign(n,{[At]:!0})}function Bn(n,e=globalThis,t="*"){return{postMessage:(r,s)=>n.postMessage(r,t,s),addEventListener:e.addEventListener.bind(e),removeEventListener:e.removeEventListener.bind(e)}}function Be(n){for(const[e,t]of Me)if(t.canHandle(n)){const[r,s]=t.serialize(n);return[{type:"HANDLER",name:e,value:r},s]}return[{type:"RAW",value:n},An.get(n)||[]]}function ze(n){switch(n.type){case"HANDLER":return Me.get(n.name).deserialize(n.value);case"RAW":return n.value}}function Ae(n,e,t,r){return new Promise(s=>{const o=cr();e.set(o,s),n.start&&n.start(),n.postMessage(Object.assign({id:o},t),r)})}function cr(){return new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-")}function $t(n){return typeof n=="number"}function on(n){return n==null}const Un=(n,e)=>{if(n!=="next"&&n!=="prev")return e},ln=n=>{n.prev.next=n.next,n.next.prev=n.prev,delete n.next,delete n.prev};class fr{constructor(){const e={};e.prev=e,e.next=e.prev,this.shortcut=e}dequeue(){const e=this.shortcut,t=e.prev;if(t&&t!==e)return ln(t),t}enqueue(e){const t=this.shortcut;e.prev&&e.next&&ln(e),e.next=t.next,t.next.prev=e,t.next=e,e.prev=t}toString(){const e=[],t=this.shortcut;let r=t.prev;for(;r!==t;)e.push(JSON.stringify(r,Un)),r=r==null?void 0:r.prev;return`[${e.join(", ")}]`}}class Zn extends fr{}const Ln=()=>1,lr=(n,e)=>{var t;if(n.getAllNodes().length<=1)return[];const r=hr(n,e||Ln);return(t=dr(r.graph,r.buckets,r.zeroIdx).map(o=>n.getRelatedEdges(o.v,"out").filter(({target:h})=>h===o.w)))===null||t===void 0?void 0:t.flat()},dr=(n,e,t)=>{let r=[];const s=e[e.length-1],o=e[0];let h;for(;n.getAllNodes().length;){for(;h=o.dequeue();)Vn(n,e,t,h);for(;h=s.dequeue();)Vn(n,e,t,h);if(n.getAllNodes().length){for(let d=e.length-2;d>0;--d)if(h=e[d].dequeue(),h){r=r.concat(Vn(n,e,t,h,!0));break}}}return r},Vn=(n,e,t,r,s)=>{var o,h;const d=[];return n.hasNode(r.v)&&((o=n.getRelatedEdges(r.v,"in"))===null||o===void 0||o.forEach(p=>{const g=p.data.weight,y=n.getNode(p.source);s&&d.push({v:p.source,w:p.target,in:0,out:0}),y.data.out===void 0&&(y.data.out=0),y.data.out-=g,Gn(e,t,Object.assign({v:y.id},y.data))}),(h=n.getRelatedEdges(r.v,"out"))===null||h===void 0||h.forEach(p=>{const g=p.data.weight,y=p.target,O=n.getNode(y);O.data.in===void 0&&(O.data.in=0),O.data.in-=g,Gn(e,t,Object.assign({v:O.id},O.data))}),n.removeNode(r.v)),s?d:void 0},hr=(n,e)=>{const t=new vt;let r=0,s=0;n.getAllNodes().forEach(p=>{t.addNode({id:p.id,data:{v:p.id,in:0,out:0}})}),n.getAllEdges().forEach(p=>{const g=t.getRelatedEdges(p.source,"out").find(O=>O.target===p.target),y=(e==null?void 0:e(p))||1;g?t.updateEdgeData(g==null?void 0:g.id,Object.assign(Object.assign({},g.data),{weight:g.data.weight+y})):t.addEdge({id:p.id,source:p.source,target:p.target,data:{weight:y}}),s=Math.max(s,t.getNode(p.source).data.out+=y),r=Math.max(r,t.getNode(p.target).data.in+=y)});const o=[],h=s+r+3;for(let p=0;p<h;p++)o.push(new Zn);const d=r+1;return t.getAllNodes().forEach(p=>{Gn(o,d,Object.assign({v:p.id},t.getNode(p.id).data))}),{buckets:o,zeroIdx:d,graph:t}},Gn=(n,e,t)=>{t.out?t.in?n[t.out-t.in+e].enqueue(t):n[n.length-1].enqueue(t):n[0].enqueue(t)},gr=(n,e)=>{const r=e==="greedy"?lr(n,(s=>o=>o.data.weight||1)(n)):Jn(n);r==null||r.forEach(s=>{const o=s.data;n.removeEdge(s.id),o.forwardName=s.data.name,o.reversed=!0,n.addEdge({id:s.id,source:s.target,target:s.source,data:Object.assign({},o)})})},Jn=n=>{const e=[],t={},r={},s=o=>{r[o]||(r[o]=!0,t[o]=!0,n.getRelatedEdges(o,"out").forEach(h=>{t[h.target]?e.push(h):s(h.target)}),delete t[o])};return n.getAllNodes().forEach(o=>s(o.id)),e},pr=n=>{n.getAllEdges().forEach(e=>{const t=e.data;if(t.reversed){n.removeEdge(e.id);const r=t.forwardName;delete t.reversed,delete t.forwardName,n.addEdge({id:e.id,source:e.target,target:e.source,data:Object.assign(Object.assign({},t),{forwardName:r})})}})},vr=(n,e)=>Number(n)-Number(e),yn=(n,e,t,r)=>{let s;do s=`${r}${Math.random()}`;while(n.hasNode(s));return t.dummy=e,n.addNode({id:s,data:t}),s},mr=n=>{const e=new vt;return n.getAllNodes().forEach(t=>{e.addNode(Object.assign({},t))}),n.getAllEdges().forEach(t=>{const r=e.getRelatedEdges(t.source,"out").find(s=>s.target===t.target);r?e.updateEdgeData(r==null?void 0:r.id,Object.assign(Object.assign({},r.data),{weight:r.data.weight+t.data.weight||0,minlen:Math.max(r.data.minlen,t.data.minlen||1)})):e.addEdge({id:t.id,source:t.source,target:t.target,data:{weight:t.data.weight||0,minlen:t.data.minlen||1}})}),e},Tn=n=>{const e=new vt;return n.getAllNodes().forEach(t=>{n.getChildren(t.id).length||e.addNode(Object.assign({},t))}),n.getAllEdges().forEach(t=>{e.addEdge(t)}),e},Wn=(n,e)=>n==null?void 0:n.reduce((t,r,s)=>(t[r]=e[s],t),{}),yr=n=>{const e={};return n.getAllNodes().forEach(t=>{const r={};n.getRelatedEdges(t.id,"out").forEach(s=>{r[s.target]=(r[s.target]||0)+(s.data.weight||0)}),e[t.id]=r}),e},T=n=>{const e=n.getAllNodes(),t=e.map(r=>{const s={};return n.getRelatedEdges(r.id,"in").forEach(o=>{s[o.source]=(s[o.source]||0)+o.data.weight}),s});return Wn(e.map(r=>r.id),t)},u=(n,e)=>{const t=Number(n.x),r=Number(n.y),s=Number(e.x)-t,o=Number(e.y)-r;let h=Number(n.width)/2,d=Number(n.height)/2;if(!s&&!o)return{x:0,y:0};let p,g;return Math.abs(o)*h>Math.abs(s)*d?(o<0&&(d=-d),p=d*s/o,g=d):(s<0&&(h=-h),p=h,g=h*o/s),{x:t+p,y:r+g}},c=n=>{const e=[],t=B(n)+1;for(let r=0;r<t;r++)e.push([]);n.getAllNodes().forEach(r=>{const s=r.data.rank;s!==void 0&&e[s]&&e[s].push(r.id)});for(let r=0;r<t;r++)e[r]=e[r].sort((s,o)=>vr(n.getNode(s).data.order,n.getNode(o).data.order));return e},i=n=>{const e=n.getAllNodes().filter(r=>r.data.rank!==void 0).map(r=>r.data.rank),t=Math.min(...e);n.getAllNodes().forEach(r=>{r.data.hasOwnProperty("rank")&&t!==1/0&&(r.data.rank-=t)})},l=(n,e=0)=>{const t=n.getAllNodes(),r=t.filter(d=>d.data.rank!==void 0).map(d=>d.data.rank),s=Math.min(...r),o=[];t.forEach(d=>{const p=(d.data.rank||0)-s;o[p]||(o[p]=[]),o[p].push(d.id)});let h=0;for(let d=0;d<o.length;d++){const p=o[d];p===void 0?d%e!==0&&(h-=1):h&&(p==null||p.forEach(g=>{const y=n.getNode(g);y&&(y.data.rank=y.data.rank||0,y.data.rank+=h)}))}},m=(n,e,t,r)=>{const s={width:0,height:0};return $t(t)&&$t(r)&&(s.rank=t,s.order=r),yn(n,"border",s,e)},B=n=>{let e;return n.getAllNodes().forEach(t=>{const r=t.data.rank;r!==void 0&&(e===void 0||r>e)&&(e=r)}),e||(e=0),e},U=(n,e)=>{const t={lhs:[],rhs:[]};return n==null||n.forEach(r=>{e(r)?t.lhs.push(r):t.rhs.push(r)}),t},V=(n,e)=>n.reduce((t,r)=>{const s=e(t),o=e(r);return s>o?r:t}),G=(n,e,t,r,s,o)=>{r.includes(e.id)||(r.push(e.id),t||o.push(e.id),s(e.id).forEach(h=>G(n,h,t,r,s,o)),t&&o.push(e.id))},rt=(n,e,t,r)=>{const s=Array.isArray(e)?e:[e],o=p=>r?n.getSuccessors(p):n.getNeighbors(p),h=[],d=[];return s.forEach(p=>{if(n.hasNode(p.id))G(n,p,t==="post",d,o,h);else throw new Error(`Graph does not have node: ${p}`)}),h},_=n=>{const e=t=>{const r=n.getChildren(t),s=n.getNode(t);if(r!=null&&r.length&&r.forEach(o=>e(o.id)),s.data.hasOwnProperty("minRank")){s.data.borderLeft=[],s.data.borderRight=[];for(let o=s.data.minRank,h=s.data.maxRank+1;o<h;o+=1)lt(n,"borderLeft","_bl",t,s,o),lt(n,"borderRight","_br",t,s,o)}};n.getRoots().forEach(t=>e(t.id))},lt=(n,e,t,r,s,o)=>{const h={rank:o,borderType:e,width:0,height:0},d=s.data[e][o-1],p=yn(n,"border",h,t);s.data[e][o]=p,n.setParent(p,r),d&&n.addEdge({id:`e${Math.random()}`,source:d,target:p,data:{weight:1}})},Tt=(n,e)=>{const t=e.toLowerCase();(t==="lr"||t==="rl")&&pt(n)},ct=(n,e)=>{const t=e.toLowerCase();(t==="bt"||t==="rl")&&Z(n),(t==="lr"||t==="rl")&&(Ct(n),pt(n))},pt=n=>{n.getAllNodes().forEach(e=>{Rt(e)}),n.getAllEdges().forEach(e=>{Rt(e)})},Rt=n=>{const e=n.data.width;n.data.width=n.data.height,n.data.height=e},Z=n=>{n.getAllNodes().forEach(e=>{St(e.data)}),n.getAllEdges().forEach(e=>{var t;(t=e.data.points)===null||t===void 0||t.forEach(r=>St(r)),e.data.hasOwnProperty("y")&&St(e.data)})},St=n=>{n!=null&&n.y&&(n.y=-n.y)},Ct=n=>{n.getAllNodes().forEach(e=>{Kt(e.data)}),n.getAllEdges().forEach(e=>{var t;(t=e.data.points)===null||t===void 0||t.forEach(r=>Kt(r)),e.data.hasOwnProperty("x")&&Kt(e.data)})},Kt=n=>{const e=n.x;n.x=n.y,n.y=e},Zt=n=>{const e=yn(n,"root",{},"_root"),t=Ut(n);let r=Math.max(...Object.values(t));Math.abs(r)===1/0&&(r=1);const s=r-1,o=2*s+1;n.getAllEdges().forEach(d=>{d.data.minlen*=o});const h=Yt(n)+1;return n.getRoots().forEach(d=>{ge(n,e,o,h,s,t,d.id)}),{nestingRoot:e,nodeRankFactor:o}},ge=(n,e,t,r,s,o,h)=>{const d=n.getChildren(h);if(!(d!=null&&d.length)){h!==e&&n.addEdge({id:`e${Math.random()}`,source:e,target:h,data:{weight:0,minlen:t}});return}const p=m(n,"_bt"),g=m(n,"_bb"),y=n.getNode(h);n.setParent(p,h),y.data.borderTop=p,n.setParent(g,h),y.data.borderBottom=g,d==null||d.forEach(O=>{ge(n,e,t,r,s,o,O.id);const L=O.data.borderTop?O.data.borderTop:O.id,R=O.data.borderBottom?O.data.borderBottom:O.id,k=O.data.borderTop?r:2*r,F=L!==R?1:s-o[h]+1;n.addEdge({id:`e${Math.random()}`,source:p,target:L,data:{minlen:F,weight:k,nestingEdge:!0}}),n.addEdge({id:`e${Math.random()}`,source:R,target:g,data:{minlen:F,weight:k,nestingEdge:!0}})}),n.getParent(h)||n.addEdge({id:`e${Math.random()}`,source:e,target:p,data:{weight:0,minlen:s+o[h]}})},Ut=n=>{const e={},t=(r,s)=>{const o=n.getChildren(r);o==null||o.forEach(h=>t(h.id,s+1)),e[r]=s};return n.getRoots().forEach(r=>t(r.id,1)),e},Yt=n=>{let e=0;return n.getAllEdges().forEach(t=>{e+=t.data.weight}),e},ce=(n,e)=>{e&&n.removeNode(e),n.getAllEdges().forEach(t=>{t.data.nestingEdge&&n.removeEdge(t.id)})},tt="edge",wt="edge-label",Lt=(n,e)=>{n.getAllEdges().forEach(t=>Mt(n,t,e))},Mt=(n,e,t)=>{let r=e.source,s=n.getNode(r).data.rank;const o=e.target,h=n.getNode(o).data.rank,d=e.data.labelRank;if(h===s+1)return;n.removeEdge(e.id);let p,g,y;for(y=0,++s;s<h;++y,++s)e.data.points=[],g={originalEdge:e,width:0,height:0,rank:s},p=yn(n,tt,g,"_d"),s===d&&(g.width=e.data.width,g.height=e.data.height,g.dummy=wt,g.labelpos=e.data.labelpos),n.addEdge({id:`e${Math.random()}`,source:r,target:p,data:{weight:e.data.weight}}),y===0&&t.push(p),r=p;n.addEdge({id:`e${Math.random()}`,source:r,target:o,data:{weight:e.data.weight}})},we=(n,e)=>{e.forEach(t=>{let r=n.getNode(t);const{data:s}=r,o=s.originalEdge;let h;o&&n.addEdge(o);let d=t;for(;r.data.dummy;)h=n.getSuccessors(d)[0],n.removeNode(d),o.data.points.push({x:r.data.x,y:r.data.y}),r.data.dummy===wt&&(o.data.x=r.data.x,o.data.y=r.data.y,o.data.width=r.data.width,o.data.height=r.data.height),d=h.id,r=n.getNode(d)})};function ae(n){return Array.isArray(n)}var fe=function(n){if(typeof n!="object"||n===null)return n;var e;if(ae(n)){e=[];for(var t=0,r=n.length;t<r;t++)typeof n[t]=="object"&&n[t]!=null?e[t]=fe(n[t]):e[t]=n[t]}else{e={};for(var s in n)typeof n[s]=="object"&&n[s]!=null?e[s]=fe(n[s]):e[s]=n[s]}return e},pe=fe;const Re=(n,e,t)=>{const r={};let s;t==null||t.forEach(o=>{let h=n.getParent(o),d,p;for(;h;){if(d=n.getParent(h.id),d?(p=r[d.id],r[d.id]=h.id):(p=s,s=h.id),p&&p!==h.id){e.hasNode(p)||e.addNode({id:p,data:{}}),e.hasNode(h.id)||e.addNode({id:h.id,data:{}}),e.hasEdge(`e${p}-${h.id}`)||e.addEdge({id:`e${p}-${h.id}`,source:p,target:h.id,data:{}});return}h=d}})},_e=(n,e,t)=>{const r=Se(n),s=new vt({tree:[{id:r,children:[],data:{}}]});return n.getAllNodes().forEach(o=>{const h=n.getParent(o.id);(o.data.rank===e||o.data.minRank<=e&&e<=o.data.maxRank)&&(s.hasNode(o.id)||s.addNode(Object.assign({},o)),h!=null&&h.id&&!s.hasNode(h==null?void 0:h.id)&&s.addNode(Object.assign({},h)),s.setParent(o.id,(h==null?void 0:h.id)||r),n.getRelatedEdges(o.id,t).forEach(d=>{const p=d.source===o.id?d.target:d.source;s.hasNode(p)||s.addNode(Object.assign({},n.getNode(p)));const g=s.getRelatedEdges(p,"out").find(({target:O})=>O===o.id),y=g!==void 0?g.data.weight:0;g?s.updateEdgeData(g.id,Object.assign(Object.assign({},g.data),{weight:d.data.weight+y})):s.addEdge({id:d.id,source:p,target:o.id,data:{weight:d.data.weight+y}})}),o.data.hasOwnProperty("minRank")&&s.updateNodeData(o.id,Object.assign(Object.assign({},o.data),{borderLeft:o.data.borderLeft[e],borderRight:o.data.borderRight[e]})))}),s},Se=n=>{let e;for(;n.hasNode(e=`_root${Math.random()}`););return e},Qe=(n,e,t)=>{const r=Wn(t,t.map((y,O)=>O)),o=e.map(y=>{const O=n.getRelatedEdges(y,"out").map(L=>({pos:r[L.target]||0,weight:L.data.weight}));return O==null?void 0:O.sort((L,R)=>L.pos-R.pos)}).flat().filter(y=>y!==void 0);let h=1;for(;h<t.length;)h<<=1;const d=2*h-1;h-=1;const p=Array(d).fill(0,0,d);let g=0;return o==null||o.forEach(y=>{if(y){let O=y.pos+h;p[O]+=y.weight;let L=0;for(;O>0;)O%2&&(L+=p[O+1]),O=O-1>>1,p[O]+=y.weight;g+=y.weight*L}}),g},He=(n,e)=>{let t=0;for(let r=1;r<(e==null?void 0:e.length);r+=1)t+=Qe(n,e[r-1],e[r]);return t},te=n=>{const e={},t=n.getAllNodes(),r=t.map(g=>{var y;return(y=g.data.rank)!==null&&y!==void 0?y:-1/0}),s=Math.max(...r),o=[];for(let g=0;g<s+1;g++)o.push([]);const h=t.sort((g,y)=>n.getNode(g.id).data.rank-n.getNode(y.id).data.rank),p=h.filter(g=>n.getNode(g.id).data.fixorder!==void 0).sort((g,y)=>n.getNode(g.id).data.fixorder-n.getNode(y.id).data.fixorder);return p==null||p.forEach(g=>{isNaN(n.getNode(g.id).data.rank)||o[n.getNode(g.id).data.rank].push(g.id),e[g.id]=!0}),h==null||h.forEach(g=>n.dfsTree(g.id,y=>{if(e.hasOwnProperty(y.id))return!0;e[y.id]=!0,isNaN(y.data.rank)||o[y.data.rank].push(y.id)})),o},Le=(n,e)=>e.map(t=>{const r=n.getRelatedEdges(t,"in");if(!(r!=null&&r.length))return{v:t};const s={sum:0,weight:0};return r==null||r.forEach(o=>{const h=n.getNode(o.source);s.sum+=o.data.weight*h.data.order,s.weight+=o.data.weight}),{v:t,barycenter:s.sum/s.weight,weight:s.weight}}),Ue=(n,e)=>{var t,r,s;const o={};n==null||n.forEach((d,p)=>{o[d.v]={i:p,indegree:0,in:[],out:[],vs:[d.v]};const g=o[d.v];d.barycenter!==void 0&&(g.barycenter=d.barycenter,g.weight=d.weight)}),(t=e.getAllEdges())===null||t===void 0||t.forEach(d=>{const p=o[d.source],g=o[d.target];p!==void 0&&g!==void 0&&(g.indegree++,p.out.push(o[d.target]))});const h=(s=(r=Object.values(o)).filter)===null||s===void 0?void 0:s.call(r,d=>!d.indegree);return Ve(h)},Ve=n=>{var e,t;const r=[],s=p=>g=>{g.merged||(g.barycenter===void 0||p.barycenter===void 0||g.barycenter>=p.barycenter)&&Oe(p,g)},o=p=>g=>{g.in.push(p),--g.indegree===0&&n.push(g)};for(;n!=null&&n.length;){const p=n.pop();r.push(p),(e=p.in.reverse())===null||e===void 0||e.forEach(g=>s(p)(g)),(t=p.out)===null||t===void 0||t.forEach(g=>o(p)(g))}const h=r.filter(p=>!p.merged),d=["vs","i","barycenter","weight"];return h.map(p=>{const g={};return d==null||d.forEach(y=>{p[y]!==void 0&&(g[y]=p[y])}),g})},Oe=(n,e)=>{var t;let r=0,s=0;n.weight&&(r+=n.barycenter*n.weight,s+=n.weight),e.weight&&(r+=e.barycenter*e.weight,s+=e.weight),n.vs=(t=e.vs)===null||t===void 0?void 0:t.concat(n.vs),n.barycenter=r/s,n.weight=s,n.i=Math.min(e.i,n.i),e.merged=!0};var wr=Ue;const xr=(n,e,t,r)=>{const s=U(n,L=>{const R=L.hasOwnProperty("fixorder")&&!isNaN(L.fixorder);return r?!R&&L.hasOwnProperty("barycenter"):R||L.hasOwnProperty("barycenter")}),o=s.lhs,h=s.rhs.sort((L,R)=>-L.i- -R.i),d=[];let p=0,g=0,y=0;o==null||o.sort(Er(!!e,!!t)),y=Qn(d,h,y),o==null||o.forEach(L=>{var R;y+=(R=L.vs)===null||R===void 0?void 0:R.length,d.push(L.vs),p+=L.barycenter*L.weight,g+=L.weight,y=Qn(d,h,y)});const O={vs:d.flat()};return g&&(O.barycenter=p/g,O.weight=g),O},Qn=(n,e,t)=>{let r=t,s;for(;e.length&&(s=e[e.length-1]).i<=r;)e.pop(),n==null||n.push(s.vs),r++;return r},Er=(n,e)=>(t,r)=>{if(t.fixorder!==void 0&&r.fixorder!==void 0)return t.fixorder-r.fixorder;if(t.barycenter<r.barycenter)return-1;if(t.barycenter>r.barycenter)return 1;if(e&&t.order!==void 0&&r.order!==void 0){if(t.order<r.order)return-1;if(t.order>r.order)return 1}return n?r.i-t.i:t.i-r.i},Hn=(n,e,t,r,s,o)=>{var h,d,p,g;let y=n.getChildren(e).map(W=>W.id);const O=n.getNode(e),L=O?O.data.borderLeft:void 0,R=O?O.data.borderRight:void 0,k={};L&&(y=y==null?void 0:y.filter(W=>W!==L&&W!==R));const F=Le(n,y||[]);F==null||F.forEach(W=>{var $;if(!(($=n.getChildren(W.v))===null||$===void 0)&&$.length){const X=Hn(n,W.v,t,r,o);k[W.v]=X,X.hasOwnProperty("barycenter")&&Nr(W,X)}});const z=wr(F,t);br(z,k),(h=z.filter(W=>W.vs.length>0))===null||h===void 0||h.forEach(W=>{const $=n.getNode(W.vs[0]);$&&(W.fixorder=$.data.fixorder,W.order=$.data.order)});const C=xr(z,r,s,o);if(L&&(C.vs=[L,C.vs,R].flat(),!((d=n.getPredecessors(L))===null||d===void 0)&&d.length)){const W=n.getNode(((p=n.getPredecessors(L))===null||p===void 0?void 0:p[0].id)||""),$=n.getNode(((g=n.getPredecessors(R))===null||g===void 0?void 0:g[0].id)||"");C.hasOwnProperty("barycenter")||(C.barycenter=0,C.weight=0),C.barycenter=(C.barycenter*C.weight+W.data.order+$.data.order)/(C.weight+2),C.weight+=2}return C},br=(n,e)=>{n==null||n.forEach(t=>{var r;const s=(r=t.vs)===null||r===void 0?void 0:r.map(o=>e[o]?e[o].vs:o);t.vs=s.flat()})},Nr=(n,e)=>{n.barycenter!==void 0?(n.barycenter=(n.barycenter*n.weight+e.barycenter*e.weight)/(n.weight+e.weight),n.weight+=e.weight):(n.barycenter=e.barycenter,n.weight=e.weight)},Mr=(n,e)=>{const t=B(n),r=[],s=[];for(let y=1;y<t+1;y++)r.push(y);for(let y=t-1;y>-1;y--)s.push(y);const o=qn(n,r,"in"),h=qn(n,s,"out");let d=te(n);Sr(n,d);let p=Number.POSITIVE_INFINITY,g;for(let y=0,O=0;O<4;++y,++O){_r(y%2?o:h,y%4>=2,!1,e),d=c(n);const L=He(n,d);L<p&&(O=0,g=pe(d),p=L)}d=te(n),Sr(n,d);for(let y=0,O=0;O<4;++y,++O){_r(y%2?o:h,y%4>=2,!0,e),d=c(n);const L=He(n,d);L<p&&(O=0,g=pe(d),p=L)}Sr(n,g)},qn=(n,e,t)=>e.map(r=>_e(n,r,t)),_r=(n,e,t,r)=>{const s=new vt;n==null||n.forEach(o=>{var h;const d=o.getRoots()[0].id,p=Hn(o,d,s,e,t,r);for(let g=0;g<((h=p.vs)===null||h===void 0?void 0:h.length);g++){const y=o.getNode(p.vs[g]);y&&(y.data.order=g)}Re(o,s,p.vs)})},Sr=(n,e)=>{e==null||e.forEach(t=>{t==null||t.forEach((r,s)=>{n.getNode(r).data.order=s})})},ei=(n,e)=>{const r=n.getAllNodes().filter(h=>{var d;return!(!((d=n.getChildren(h.id))===null||d===void 0)&&d.length)}).map(h=>h.data.rank),s=Math.max(...r),o=[];for(let h=0;h<s+1;h++)o[h]=[];e==null||e.forEach(h=>{const d=n.getNode(h);!d||d.data.dummy||isNaN(d.data.rank)||(d.data.fixorder=o[d.data.rank].length,o[d.data.rank].push(h))})},ni=n=>{const e={};let t=0;const r=s=>{const o=t;n.getChildren(s).forEach(h=>r(h.id)),e[s]={low:o,lim:t++}};return n.getRoots().forEach(s=>r(s.id)),e},ri=(n,e,t,r)=>{var s,o;const h=[],d=[],p=Math.min(e[t].low,e[r].low),g=Math.max(e[t].lim,e[r].lim);let y,O;y=t;do y=(s=n.getParent(y))===null||s===void 0?void 0:s.id,h.push(y);while(y&&(e[y].low>p||g>e[y].lim));for(O=y,y=r;y&&y!==O;)d.push(y),y=(o=n.getParent(y))===null||o===void 0?void 0:o.id;return{lca:O,path:h.concat(d.reverse())}},si=(n,e)=>{const t=ni(n);e.forEach(r=>{var s,o;let h=r,d=n.getNode(h);const p=d.data.originalEdge;if(!p)return;const g=ri(n,t,p.source,p.target),y=g.path,O=g.lca;let L=0,R=y[L],k=!0;for(;h!==p.target;){if(d=n.getNode(h),k){for(;R!==O&&((s=n.getNode(R))===null||s===void 0?void 0:s.data.maxRank)<d.data.rank;)L++,R=y[L];R===O&&(k=!1)}if(!k){for(;L<y.length-1&&((o=n.getNode(y[L+1]))===null||o===void 0?void 0:o.data.minRank)<=d.data.rank;)L++;R=y[L]}n.hasNode(R)&&n.setParent(h,R),h=n.getSuccessors(h)[0].id}})},Zr=(n,e)=>{const t={},r=(s,o)=>{let h=0,d=0;const p=s.length,g=o==null?void 0:o[(o==null?void 0:o.length)-1];return o==null||o.forEach((y,O)=>{var L;const R=ii(n,y),k=R?n.getNode(R.id).data.order:p;(R||y===g)&&((L=o.slice(d,O+1))===null||L===void 0||L.forEach(F=>{var z;(z=n.getPredecessors(F))===null||z===void 0||z.forEach(C=>{var W;const $=n.getNode(C.id),X=$.data.order;(X<h||k<X)&&!($.data.dummy&&(!((W=n.getNode(F))===null||W===void 0)&&W.data.dummy))&&Qr(t,C.id,F)})}),d=O+1,h=k)}),o};return e!=null&&e.length&&e.reduce(r),t},Jr=(n,e)=>{const t={};function r(d,p,g,y,O){var L,R;let k;for(let F=p;F<g;F++)k=d[F],!((L=n.getNode(k))===null||L===void 0)&&L.data.dummy&&((R=n.getPredecessors(k))===null||R===void 0||R.forEach(z=>{const C=n.getNode(z.id);C.data.dummy&&(C.data.order<y||C.data.order>O)&&Qr(t,z.id,k)}))}function s(d){return JSON.stringify(d.slice(1))}function o(d,p){const g=s(d);p.get(g)||(r(...d),p.set(g,!0))}const h=(d,p)=>{let g=-1,y,O=0;const L=new Map;return p==null||p.forEach((R,k)=>{var F;if(((F=n.getNode(R))===null||F===void 0?void 0:F.data.dummy)==="border"){const z=n.getPredecessors(R)||[];z.length&&(y=n.getNode(z[0].id).data.order,o([p,O,k,g,y],L),O=k,g=y)}o([p,O,p.length,y,d.length],L)}),p};return e!=null&&e.length&&e.reduce(h),t},ii=(n,e)=>{var t,r;if(!((t=n.getNode(e))===null||t===void 0)&&t.data.dummy)return(r=n.getPredecessors(e))===null||r===void 0?void 0:r.find(s=>n.getNode(s.id).data.dummy)},Qr=(n,e,t)=>{let r=e,s=t;if(r>s){const h=r;r=s,s=h}let o=n[r];o||(n[r]=o={}),o[s]=!0},oi=(n,e,t)=>{let r=e,s=t;if(r>s){const o=e;r=s,s=o}return!!n[r]},Hr=(n,e,t,r)=>{const s={},o={},h={};return e==null||e.forEach(d=>{d==null||d.forEach((p,g)=>{s[p]=p,o[p]=p,h[p]=g})}),e==null||e.forEach(d=>{let p=-1;d==null||d.forEach(g=>{let y=r(g).map(O=>O.id);if(y.length){y=y.sort((L,R)=>h[L]-h[R]);const O=(y.length-1)/2;for(let L=Math.floor(O),R=Math.ceil(O);L<=R;++L){const k=y[L];o[g]===g&&p<h[k]&&!oi(t,g,k)&&(o[k]=g,o[g]=s[g]=s[k],p=h[k])}}})}),{root:s,align:o}},qr=(n,e,t,r,s,o,h)=>{var d;const p={},g=ai(n,e,t,s,o,h),y=h?"borderLeft":"borderRight",O=(k,F)=>{let z=g.getAllNodes(),C=z.pop();const W={};for(;C;)W[C.id]?k(C.id):(W[C.id]=!0,z.push(C),z=z.concat(F(C.id))),C=z.pop()},L=k=>{p[k]=(g.getRelatedEdges(k,"in")||[]).reduce((F,z)=>Math.max(F,(p[z.source]||0)+z.data.weight),0)},R=k=>{const F=(g.getRelatedEdges(k,"out")||[]).reduce((C,W)=>Math.min(C,(p[W.target]||0)-W.data.weight),Number.POSITIVE_INFINITY),z=n.getNode(k);F!==Number.POSITIVE_INFINITY&&z.data.borderType!==y&&(p[k]=Math.max(p[k],F))};return O(L,g.getPredecessors.bind(g)),O(R,g.getSuccessors.bind(g)),(d=Object.values(r))===null||d===void 0||d.forEach(k=>{p[k]=p[t[k]]}),p},ai=(n,e,t,r,s,o)=>{const h=new vt,d=ui(r,s,o);return e==null||e.forEach(p=>{let g;p==null||p.forEach(y=>{const O=t[y];if(h.hasNode(O)||h.addNode({id:O,data:{}}),g){const L=t[g],R=h.getRelatedEdges(L,"out").find(k=>k.target===O);R?h.updateEdgeData(R.id,Object.assign(Object.assign({},R.data),{weight:Math.max(d(n,y,g),R.data.weight||0)})):h.addEdge({id:`e${Math.random()}`,source:L,target:O,data:{weight:Math.max(d(n,y,g),0)}})}g=y})}),h},ts=(n,e)=>V(Object.values(e),t=>{var r;let s=Number.NEGATIVE_INFINITY,o=Number.POSITIVE_INFINITY;return(r=Object.keys(t))===null||r===void 0||r.forEach(h=>{const d=t[h],p=ci(n,h)/2;s=Math.max(d+p,s),o=Math.min(d-p,o)}),s-o});function es(n,e){const t=Object.values(e),r=Math.min(...t),s=Math.max(...t);["u","d"].forEach(o=>{["l","r"].forEach(h=>{const d=o+h,p=n[d];let g;if(p===e)return;const y=Object.values(p);g=h==="l"?r-Math.min(...y):s-Math.max(...y),g&&(n[d]={},Object.keys(p).forEach(O=>{n[d][O]=p[O]+g}))})})}const ns=(n,e)=>{const t={};return Object.keys(n.ul).forEach(r=>{if(e)t[r]=n[e.toLowerCase()][r];else{const s=Object.values(n).map(o=>o[r]);t[r]=(s[0]+s[1])/2}}),t},Qu=(n,e)=>{const{align:t,nodesep:r=0,edgesep:s=0}=e||{},o=buildLayerMatrix(n),h=Object.assign(Zr(n,o),Jr(n,o)),d={};let p;["u","d"].forEach(y=>{p=y==="u"?o:Object.values(o).reverse(),["l","r"].forEach(O=>{O==="r"&&(p=p.map(F=>Object.values(F).reverse()));const L=(y==="u"?n.getPredecessors:n.getSuccessors).bind(n),R=Hr(n,p,h,L),k=qr(n,p,R.root,R.align,r,s,O==="r");O==="r"&&Object.keys(k).forEach(F=>{k[F]=-k[F]}),d[y+O]=k})});const g=ts(n,d);return es(d,g),ns(d,t)},ui=(n,e,t)=>(r,s,o)=>{const h=r.getNode(s),d=r.getNode(o);let p=0,g=0;if(p+=h.data.width/2,h.data.hasOwnProperty("labelpos"))switch((h.data.labelpos||"").toLowerCase()){case"l":g=-h.data.width/2;break;case"r":g=h.data.width/2;break}if(g&&(p+=t?g:-g),g=0,p+=(h.data.dummy?e:n)/2,p+=(d.data.dummy?e:n)/2,p+=d.data.width/2,d.data.labelpos)switch((d.data.labelpos||"").toLowerCase()){case"l":g=d.data.width/2;break;case"r":g=-d.data.width/2;break}return g&&(p+=t?g:-g),g=0,p},ci=(n,e)=>n.getNode(e).data.width||0,fi=(n,e)=>{const{ranksep:t=0}=e||{},r=c(n);let s=0;r==null||r.forEach(o=>{const h=o.map(p=>n.getNode(p).data.height),d=Math.max(...h,0);o==null||o.forEach(p=>{n.getNode(p).data.y=s+d/2}),s+=d+t})},li=(n,e)=>{const{align:t,nodesep:r=0,edgesep:s=0}=e||{},o=c(n),h=Object.assign(Zr(n,o),Jr(n,o)),d={};let p=[];["u","d"].forEach(y=>{p=y==="u"?o:Object.values(o).reverse(),["l","r"].forEach(O=>{O==="r"&&(p=p.map(F=>Object.values(F).reverse()));const L=(y==="u"?n.getPredecessors:n.getSuccessors).bind(n),R=Hr(n,p,h,L),k=qr(n,p,R.root,R.align,r,s,O==="r");O==="r"&&Object.keys(k).forEach(F=>k[F]=-k[F]),d[y+O]=k})});const g=ts(n,d);return g&&es(d,g),ns(d,t)},di=(n,e)=>{var t;const r=Tn(n);fi(r,e);const s=li(r,e);(t=Object.keys(s))===null||t===void 0||t.forEach(o=>{r.getNode(o).data.x=s[o]})},rs=n=>{const e={},t=r=>{var s;const o=n.getNode(r);if(!o)return 0;if(e[r])return o.data.rank;e[r]=!0;let h;return(s=n.getRelatedEdges(r,"out"))===null||s===void 0||s.forEach(d=>{const p=t(d.target),g=d.data.minlen,y=p-g;y&&(h===void 0||y<h)&&(h=y)}),h||(h=0),o.data.rank=h,h};n.getAllNodes().filter(r=>n.getRelatedEdges(r.id,"in").length===0).forEach(r=>t(r.id))},hi=n=>{const e={};let t;const r=h=>{var d;const p=n.getNode(h);if(!p)return 0;if(e[h])return p.data.rank;e[h]=!0;let g;return(d=n.getRelatedEdges(h,"out"))===null||d===void 0||d.forEach(y=>{const O=r(y.target),L=y.data.minlen,R=O-L;R&&(g===void 0||R<g)&&(g=R)}),g||(g=0),(t===void 0||g<t)&&(t=g),p.data.rank=g,g};n.getAllNodes().filter(h=>n.getRelatedEdges(h.id,"in").length===0).forEach(h=>{h&&r(h.id)}),t===void 0&&(t=0);const s={},o=(h,d)=>{var p;const g=n.getNode(h),y=isNaN(g.data.layer)?d:g.data.layer;(g.data.rank===void 0||g.data.rank<y)&&(g.data.rank=y),!s[h]&&(s[h]=!0,(p=n.getRelatedEdges(h,"out"))===null||p===void 0||p.forEach(O=>{o(O.target,y+O.data.minlen)}))};n.getAllNodes().forEach(h=>{const d=h.data;d&&(isNaN(d.layer)?d.rank-=t:o(h.id,d.layer))})},wn=(n,e)=>n.getNode(e.target).data.rank-n.getNode(e.source).data.rank-e.data.minlen,gi=n=>{const e=new vt({tree:[]}),t=n.getAllNodes()[0],r=n.getAllNodes().length;e.addNode(t);let s,o;for(;pi(e,n)<r;)s=ss(e,n),o=e.hasNode(s.source)?wn(n,s):-wn(n,s),is(e,n,o);return e},pi=(n,e)=>{const t=r=>{e.getRelatedEdges(r,"both").forEach(s=>{const o=s.source,h=r===o?s.target:o;!n.hasNode(h)&&!wn(e,s)&&(n.addNode({id:h,data:{}}),n.addEdge({id:s.id,source:r,target:h,data:{}}),t(h))})};return n.getAllNodes().forEach(r=>t(r.id)),n.getAllNodes().length},vi=n=>{const e=new vt({tree:[]}),t=n.getAllNodes()[0],r=n.getAllNodes().length;e.addNode(t);let s,o;for(;mi(e,n)<r;)s=ss(e,n),o=e.hasNode(s.source)?wn(n,s):-wn(n,s),is(e,n,o);return e},mi=(n,e)=>{const t=r=>{var s;(s=e.getRelatedEdges(r,"both"))===null||s===void 0||s.forEach(o=>{const h=o.source,d=r===h?o.target:h;!n.hasNode(d)&&(e.getNode(d).data.layer!==void 0||!wn(e,o))&&(n.addNode({id:d,data:{}}),n.addEdge({id:o.id,source:r,target:d,data:{}}),t(d))})};return n.getAllNodes().forEach(r=>t(r.id)),n.getAllNodes().length},ss=(n,e)=>V(e.getAllEdges(),t=>n.hasNode(t.source)!==n.hasNode(t.target)?wn(e,t):1/0),is=(n,e,t)=>{n.getAllNodes().forEach(r=>{const s=e.getNode(r.id);s.data.rank||(s.data.rank=0),s.data.rank+=t})},yi=n=>{const e=mr(n);rs(e);const t=gi(e);as(t),os(t,e);let r,s;for(;r=Ei(t);)s=bi(t,e,r),Ni(t,e,r,s)},os=(n,e)=>{let t=rt(n,n.getAllNodes(),"post",!1);t=t.slice(0,(t==null?void 0:t.length)-1),t.forEach(r=>{wi(n,e,r)})},wi=(n,e,t)=>{const s=n.getNode(t).data.parent,o=n.getRelatedEdges(t,"both").find(h=>h.target===s||h.source===s);o.data.cutvalue=xi(n,e,t)},xi=(n,e,t)=>{const s=n.getNode(t).data.parent;let o=!0,h=e.getRelatedEdges(t,"out").find(p=>p.target===s),d=0;return h||(o=!1,h=e.getRelatedEdges(s,"out").find(p=>p.target===t)),d=h.data.weight,e.getRelatedEdges(t,"both").forEach(p=>{const g=p.source===t,y=g?p.target:p.source;if(y!==s){const O=g===o,L=p.data.weight;if(d+=O?L:-L,Si(n,t,y)){const R=n.getRelatedEdges(t,"both").find(k=>k.source===y||k.target===y).data.cutvalue;d+=O?-R:R}}}),d},as=(n,e=n.getAllNodes()[0].id)=>{us(n,{},1,e)},us=(n,e,t,r,s)=>{var o;const h=t;let d=t;const p=n.getNode(r);return e[r]=!0,(o=n.getNeighbors(r))===null||o===void 0||o.forEach(g=>{e[g.id]||(d=us(n,e,d,g.id,r))}),p.data.low=h,p.data.lim=d++,s?p.data.parent=s:delete p.data.parent,d},Ei=n=>n.getAllEdges().find(e=>e.data.cutvalue<0),bi=(n,e,t)=>{let r=t.source,s=t.target;e.getRelatedEdges(r,"out").find(y=>y.target===s)||(r=t.target,s=t.source);const o=n.getNode(r),h=n.getNode(s);let d=o,p=!1;o.data.lim>h.data.lim&&(d=h,p=!0);const g=e.getAllEdges().filter(y=>p===cs(n.getNode(y.source),d)&&p!==cs(n.getNode(y.target),d));return V(g,y=>wn(e,y))},Ni=(n,e,t,r)=>{const s=n.getRelatedEdges(t.source,"both").find(o=>o.source===t.target||o.target===t.target);s&&n.removeEdge(s.id),n.addEdge({id:`e${Math.random()}`,source:r.source,target:r.target,data:{}}),as(n),os(n,e),Mi(n,e)},Mi=(n,e)=>{const t=n.getAllNodes().find(s=>!s.data.parent);let r=rt(n,t,"pre",!1);r=r.slice(1),r.forEach(s=>{const o=n.getNode(s).data.parent;let h=e.getRelatedEdges(s,"out").find(p=>p.target===o),d=!1;!h&&e.hasNode(o)&&(h=e.getRelatedEdges(o,"out").find(p=>p.target===s),d=!0),e.getNode(s).data.rank=(e.hasNode(o)&&e.getNode(o).data.rank||0)+(d?h==null?void 0:h.data.minlen:-(h==null?void 0:h.data.minlen))})},Si=(n,e,t)=>n.getRelatedEdges(e,"both").find(r=>r.source===t||r.target===t),cs=(n,e)=>e.data.low<=n.data.lim&&n.data.lim<=e.data.lim,Oi=(n,e)=>{switch(e){case"network-simplex":Ti(n);break;case"tight-tree":fs(n);break;case"longest-path":Ai(n);break;default:fs(n)}},Ai=rs,fs=n=>{hi(n),vi(n)},Ti=n=>{yi(n)},ji=(n,e)=>{const{edgeLabelSpace:t,keepNodeOrder:r,prevGraph:s,rankdir:o,ranksep:h}=e;!r&&s&&Pi(n,s);const d=Fi(n);t&&(e.ranksep=ki(d,{rankdir:o,ranksep:h}));let p;try{p=Ii(d,e)}catch(g){if(g.message==="Not possible to find intersection inside of the rectangle"){console.error(`The following error may be caused by improper layer setting, please make sure your manual layer setting does not violate the graph's structure:
`,g);return}throw g}return Ri(n,d),p},Ii=(n,e)=>{const{acyclicer:t,ranker:r,rankdir:s="tb",nodeOrder:o,keepNodeOrder:h,align:d,nodesep:p=50,edgesep:g=20,ranksep:y=50}=e;Ki(n),gr(n,t);const{nestingRoot:O,nodeRankFactor:L}=Zt(n);Oi(Tn(n),r),Bi(n),l(n,L),ce(n,O),i(n),Ui(n),Vi(n);const R=[];Lt(n,R),si(n,R),_(n),h&&ei(n,o),Mr(n,h),_i(n),Tt(n,s),di(n,{align:d,nodesep:p,edgesep:g,ranksep:y}),Zi(n),Xi(n),we(n,R),Yi(n),ct(n,s);const{width:k,height:F}=Gi(n);return Wi(n),$i(n),pr(n),{width:k,height:F}},Pi=(n,e)=>{n.getAllNodes().forEach(t=>{const r=n.getNode(t.id);if(e.hasNode(t.id)){const s=e.getNode(t.id);r.data.fixorder=s.data._order,delete s.data._order}else delete r.data.fixorder})},Ri=(n,e)=>{n.getAllNodes().forEach(t=>{var r;const s=n.getNode(t.id);if(s){const o=e.getNode(t.id);s.data.x=o.data.x,s.data.y=o.data.y,s.data._order=o.data.order,s.data._rank=o.data.rank,!((r=e.getChildren(t.id))===null||r===void 0)&&r.length&&(s.data.width=o.data.width,s.data.height=o.data.height)}}),n.getAllEdges().forEach(t=>{const r=n.getEdge(t.id),s=e.getEdge(t.id);r.data.points=s?s.data.points:[],s&&s.data.hasOwnProperty("x")&&(r.data.x=s.data.x,r.data.y=s.data.y)})},Li=["width","height","layer","fixorder"],Ci={width:0,height:0},Di=["minlen","weight","width","height","labeloffset"],zi={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},Or=["labelpos"],Fi=n=>{const e=new vt({tree:[]});return n.getAllNodes().forEach(t=>{const r=ds(n.getNode(t.id).data),s=Object.assign(Object.assign({},Ci),r),o=ls(s,Li);e.hasNode(t.id)||e.addNode({id:t.id,data:Object.assign({},o)});const h=n.hasTreeStructure("combo")?n.getParent(t.id,"combo"):n.getParent(t.id);on(h)||(e.hasNode(h.id)||e.addNode(Object.assign({},h)),e.setParent(t.id,h.id))}),n.getAllEdges().forEach(t=>{const r=ds(n.getEdge(t.id).data),s={};Or==null||Or.forEach(o=>{r[o]!==void 0&&(s[o]=r[o])}),e.addEdge({id:t.id,source:t.source,target:t.target,data:Object.assign({},zi,ls(r,Di),s)})}),e},ki=(n,e)=>{const{ranksep:t=0,rankdir:r}=e;return n.getAllNodes().forEach(s=>{isNaN(s.data.layer)||s.data.layer||(s.data.layer=0)}),n.getAllEdges().forEach(s=>{var o;s.data.minlen*=2,((o=s.data.labelpos)===null||o===void 0?void 0:o.toLowerCase())!=="c"&&(r==="TB"||r==="BT"?s.data.width+=s.data.labeloffset:s.data.height+=s.data.labeloffset)}),t/2},Bi=n=>{n.getAllEdges().forEach(e=>{if(e.data.width&&e.data.height){const t=n.getNode(e.source),r=n.getNode(e.target),s={e,rank:(r.data.rank-t.data.rank)/2+t.data.rank};yn(n,"edge-proxy",s,"_ep")}})},Ui=n=>{let e=0;return n.getAllNodes().forEach(t=>{var r,s;t.data.borderTop&&(t.data.minRank=(r=n.getNode(t.data.borderTop))===null||r===void 0?void 0:r.data.rank,t.data.maxRank=(s=n.getNode(t.data.borderBottom))===null||s===void 0?void 0:s.data.rank,e=Math.max(e,t.data.maxRank||-1/0))}),e},Vi=n=>{n.getAllNodes().forEach(e=>{e.data.dummy==="edge-proxy"&&(n.getEdge(e.data.e.id).data.labelRank=e.data.rank,n.removeNode(e.id))})},Gi=(n,e)=>{let t,r=0,s,o=0;const{marginx:h=0,marginy:d=0}=e||{},p=g=>{if(!g.data)return;const y=g.data.x,O=g.data.y,L=g.data.width,R=g.data.height;!isNaN(y)&&!isNaN(L)&&(t===void 0&&(t=y-L/2),t=Math.min(t,y-L/2),r=Math.max(r,y+L/2)),!isNaN(O)&&!isNaN(R)&&(s===void 0&&(s=O-R/2),s=Math.min(s,O-R/2),o=Math.max(o,O+R/2))};return n.getAllNodes().forEach(g=>{p(g)}),n.getAllEdges().forEach(g=>{g!=null&&g.data.hasOwnProperty("x")&&p(g)}),t-=h,s-=d,n.getAllNodes().forEach(g=>{g.data.x-=t,g.data.y-=s}),n.getAllEdges().forEach(g=>{var y;(y=g.data.points)===null||y===void 0||y.forEach(O=>{O.x-=t,O.y-=s}),g.data.hasOwnProperty("x")&&(g.data.x-=t),g.data.hasOwnProperty("y")&&(g.data.y-=s)}),{width:r-t+h,height:o-s+d}},Wi=n=>{n.getAllEdges().forEach(e=>{const t=n.getNode(e.source),r=n.getNode(e.target);let s,o;e.data.points?(s=e.data.points[0],o=e.data.points[e.data.points.length-1]):(e.data.points=[],s={x:r.data.x,y:r.data.y},o={x:t.data.x,y:t.data.y}),e.data.points.unshift(u(t.data,s)),e.data.points.push(u(r.data,o))})},Yi=n=>{n.getAllEdges().forEach(e=>{if(e.data.hasOwnProperty("x"))switch((e.data.labelpos==="l"||e.data.labelpos==="r")&&(e.data.width-=e.data.labeloffset),e.data.labelpos){case"l":e.data.x-=e.data.width/2+e.data.labeloffset;break;case"r":e.data.x+=e.data.width/2+e.data.labeloffset;break}})},$i=n=>{n.getAllEdges().forEach(e=>{var t;e.data.reversed&&((t=e.data.points)===null||t===void 0||t.reverse())})},Xi=n=>{n.getAllNodes().forEach(e=>{var t,r,s;if(!((t=n.getChildren(e.id))===null||t===void 0)&&t.length){const o=n.getNode(e.id),h=n.getNode(o.data.borderTop),d=n.getNode(o.data.borderBottom),p=n.getNode(o.data.borderLeft[((r=o.data.borderLeft)===null||r===void 0?void 0:r.length)-1]),g=n.getNode(o.data.borderRight[((s=o.data.borderRight)===null||s===void 0?void 0:s.length)-1]);o.data.width=Math.abs((g==null?void 0:g.data.x)-(p==null?void 0:p.data.x))||10,o.data.height=Math.abs((d==null?void 0:d.data.y)-(h==null?void 0:h.data.y))||10,o.data.x=((p==null?void 0:p.data.x)||0)+o.data.width/2,o.data.y=((h==null?void 0:h.data.y)||0)+o.data.height/2}}),n.getAllNodes().forEach(e=>{e.data.dummy==="border"&&n.removeNode(e.id)})},Ki=n=>{n.getAllEdges().forEach(e=>{if(e.source===e.target){const t=n.getNode(e.source);t.data.selfEdges||(t.data.selfEdges=[]),t.data.selfEdges.push(e),n.removeEdge(e.id)}})},_i=n=>{const e=c(n);e==null||e.forEach(t=>{let r=0;t==null||t.forEach((s,o)=>{var h;const d=n.getNode(s);d.data.order=o+r,(h=d.data.selfEdges)===null||h===void 0||h.forEach(p=>{yn(n,"selfedge",{width:p.data.width,height:p.data.height,rank:d.data.rank,order:o+ ++r,e:p},"_se")}),delete d.data.selfEdges})})},Zi=n=>{n.getAllNodes().forEach(e=>{const t=n.getNode(e.id);if(t.data.dummy==="selfedge"){const r=n.getNode(t.data.e.source),s=r.data.x+r.data.width/2,o=r.data.y,h=t.data.x-s,d=r.data.height/2;n.hasEdge(t.data.e.id)?n.updateEdgeData(t.data.e.id,t.data.e.data):n.addEdge({id:t.data.e.id,source:t.data.e.source,target:t.data.e.target,data:t.data.e.data}),n.removeNode(e.id),t.data.e.data.points=[{x:s+2*h/3,y:o-d},{x:s+5*h/6,y:o-d},{y:o,x:s+h},{x:s+5*h/6,y:o+d},{x:s+2*h/3,y:o+d}],t.data.e.data.x=t.data.x,t.data.e.data.y=t.data.y}})},ls=(n,e)=>{const t={};return e==null||e.forEach(r=>{n[r]!==void 0&&(t[r]=+n[r])}),t},ds=(n={})=>{const e={};return Object.keys(n).forEach(t=>{e[t.toLowerCase()]=n[t]}),e};function qe(n){return typeof n=="function"}var xn=function(n){var e=typeof n;return n!==null&&e==="object"||e==="function"};function En(n,e){let t;return qe(e)?t=e:$t(e)?t=()=>e:t=()=>n,t}function hs(n,e,t=!0){return!e&&e!==0?r=>{const{size:s}=r.data||{};return s?Array.isArray(s)?s[0]>s[1]?s[0]:s[1]:xn(s)?s.width>s.height?s.width:s.height:s:n}:qe(e)?e:$t(e)?()=>e:Array.isArray(e)?()=>{if(t){const r=Math.max(...e);return isNaN(r)?n:r}return e}:xn(e)?()=>{if(t){const r=Math.max(e.width,e.height);return isNaN(r)?n:r}return[e.width,e.height]}:()=>n}const gs=(n,e)=>{let t,r;return $t(e)?r=()=>e:qe(e)?r=e:r=()=>0,n?Array.isArray(n)?t=s=>(n[0]>n[1]?n[0]:n[1])+r(s):qe(n)?t=n:t=s=>n+r(s):t=s=>{var o,h;if(!((o=s.data)===null||o===void 0)&&o.bboxSize)return Math.max(s.data.bboxSize[0],s.data.bboxSize[1])+r(s);if(!((h=s.data)===null||h===void 0)&&h.size){if(Array.isArray(s.data.size))return Math.max(s.data.size[0],s.data.size[1])+r(s);const d=s.data.size;return xn(d)?(d.width>d.height?d.width:d.height)+r(s):d+r(s)}return 10+r(s)},t},Ar=n=>{if(n===null)return n;if(n instanceof Date)return new Date(n.getTime());if(n instanceof Array){const e=[];return n.forEach(t=>{e.push(t)}),e.map(t=>Ar(t))}if(typeof n=="object"){const e={};return Object.keys(n).forEach(t=>{e[t]=Ar(n[t])}),e}return n},Ze=(n,e)=>{const t=Ar(n);return t.data=t.data||{},e&&($t(t.data.x)||(t.data.x=Math.random()*e[0]),$t(t.data.y)||(t.data.y=Math.random()*e[1])),t},Ji={rankdir:"TB",nodesep:50,ranksep:50,edgeLabelSpace:!0,ranker:"tight-tree",controlPoints:!1,radial:!1,focusNode:null};class Qi{constructor(e={}){this.options=e,this.id="antv-dagre",this.options=Object.assign(Object.assign({},Ji),e)}execute(e,t){return A(this,void 0,void 0,function*(){return this.genericDagreLayout(!1,e,t)})}assign(e,t){return A(this,void 0,void 0,function*(){yield this.genericDagreLayout(!0,e,t)})}genericDagreLayout(e,t,r){return A(this,void 0,void 0,function*(){const s=Object.assign(Object.assign({},this.options),r),{nodeSize:o,align:h,rankdir:d="TB",ranksep:p,nodesep:g,ranksepFunc:y,nodesepFunc:O,edgeLabelSpace:L,ranker:R,nodeOrder:k,begin:F,controlPoints:z,radial:C,sortByCombo:W,preset:$}=s,X=new vt({tree:[]}),q=En(p||50,y),st=En(g||50,O);let ut=st,J=q;(d==="LR"||d==="RL")&&(ut=q,J=st);const mt=gs(o,void 0),Et=t.getAllNodes(),jt=t.getAllEdges();Et.forEach(bt=>{const kt=mt(bt),Qt=J(bt),Xt=ut(bt),ie=kt+2*Xt,de=kt+2*Qt,Jt=bt.data.layer;$t(Jt)?X.addNode({id:bt.id,data:{width:ie,height:de,layer:Jt}}):X.addNode({id:bt.id,data:{width:ie,height:de}})}),W&&(X.attachTreeStructure("combo"),Et.forEach(bt=>{const{parentId:kt}=bt.data;kt!==void 0&&X.hasNode(kt)&&X.setParent(bt.id,kt,"combo")})),jt.forEach(bt=>{X.addEdge({id:bt.id,source:bt.source,target:bt.target,data:{weight:bt.data.weight||1}})});let Pt;$!=null&&$.length&&(Pt=new vt({nodes:$})),ji(X,{prevGraph:Pt,edgeLabelSpace:L,keepNodeOrder:!!k,nodeOrder:k||[],acyclicer:"greedy",ranker:R,rankdir:d,nodesep:g,align:h});const Dt=[0,0];if(F){let bt=1/0,kt=1/0;X.getAllNodes().forEach(Qt=>{bt>Qt.data.x&&(bt=Qt.data.x),kt>Qt.data.y&&(kt=Qt.data.y)}),X.getAllEdges().forEach(Qt=>{var Xt;(Xt=Qt.data.points)===null||Xt===void 0||Xt.forEach(ie=>{bt>ie.x&&(bt=ie.x),kt>ie.y&&(kt=ie.y)})}),Dt[0]=F[0]-bt,Dt[1]=F[1]-kt}const Gt=d==="LR"||d==="RL";if(!C){const bt=new Set,Qt=d==="BT"||d==="RL"?(Jt,oe)=>oe-Jt:(Jt,oe)=>Jt-oe;X.getAllNodes().forEach(Jt=>{Jt.data.x=Jt.data.x+Dt[0],Jt.data.y=Jt.data.y+Dt[1],bt.add(Gt?Jt.data.x:Jt.data.y)});const Xt=Array.from(bt).sort(Qt),ie=Gt?(Jt,oe)=>Jt.x!==oe.x:(Jt,oe)=>Jt.y!==oe.y,de=Gt?(Jt,oe,Te)=>{const Ee=Math.max(oe.y,Te.y),en=Math.min(oe.y,Te.y);return Jt.filter(gn=>gn.y<=Ee&&gn.y>=en)}:(Jt,oe,Te)=>{const Ee=Math.max(oe.x,Te.x),en=Math.min(oe.x,Te.x);return Jt.filter(gn=>gn.x<=Ee&&gn.x>=en)};X.getAllEdges().forEach((Jt,oe)=>{var Te;L&&z&&Jt.data.type!=="loop"&&(Jt.data.controlPoints=Hi((Te=Jt.data.points)===null||Te===void 0?void 0:Te.map(({x:Ee,y:en})=>({x:Ee+Dt[0],y:en+Dt[1]})),X.getNode(Jt.source),X.getNode(Jt.target),Xt,Gt,ie,de))})}let zt=[];zt=X.getAllNodes().map(bt=>Ze(bt));const _t=X.getAllEdges();return e&&(zt.forEach(bt=>{t.mergeNodeData(bt.id,{x:bt.data.x,y:bt.data.y})}),_t.forEach(bt=>{t.mergeEdgeData(bt.id,{controlPoints:bt.data.controlPoints})})),{nodes:zt,edges:_t}})}}const Hi=(n,e,t,r,s,o,h)=>{let d=(n==null?void 0:n.slice(1,n.length-1))||[];if(e&&t){let{x:p,y:g}=e.data,{x:y,y:O}=t.data;if(s&&(p=e.data.y,g=e.data.x,y=t.data.y,O=t.data.x),O!==g&&p!==y){const L=r.indexOf(g),R=r[L+1];if(R){const z=d[0],C=s?{x:(g+R)/2,y:(z==null?void 0:z.y)||y}:{x:(z==null?void 0:z.x)||y,y:(g+R)/2};(!z||o(z,C))&&d.unshift(C)}const k=r.indexOf(O),F=Math.abs(k-L);if(F===1)d=h(d,e.data,t.data),d.length||d.push(s?{x:(g+O)/2,y:p}:{x:p,y:(g+O)/2});else if(F>1){const z=r[k-1];if(z){const C=d[d.length-1],W=s?{x:(O+z)/2,y:(C==null?void 0:C.y)||y}:{x:(C==null?void 0:C.x)||p,y:(O+z)/2};(!C||o(C,W))&&d.push(W)}}}}return d},jn=(n,e,t)=>{const r=n.getAllNodes(),s=n.getAllEdges();if(!(r!=null&&r.length))return{nodes:[],edges:s};if(r.length===1)return e&&n.mergeNodeData(r[0].id,{x:t[0],y:t[1]}),{nodes:[Object.assign(Object.assign({},r[0]),{data:Object.assign(Object.assign({},r[0].data),{x:t[0],y:t[1]})})],edges:s}},qi={radius:null,startRadius:null,endRadius:null,startAngle:0,endAngle:2*Math.PI,clockwise:!0,divisions:1,ordering:null,angleRatio:1};class to{constructor(e={}){this.options=e,this.id="circular",this.options=Object.assign(Object.assign({},qi),e)}execute(e,t){return A(this,void 0,void 0,function*(){return this.genericCircularLayout(!1,e,t)})}assign(e,t){return A(this,void 0,void 0,function*(){yield this.genericCircularLayout(!0,e,t)})}genericCircularLayout(e,t,r){return A(this,void 0,void 0,function*(){const s=Object.assign(Object.assign({},this.options),r),{width:o,height:h,center:d,divisions:p,startAngle:g=0,endAngle:y=2*Math.PI,angleRatio:O,ordering:L,clockwise:R,nodeSpacing:k,nodeSize:F}=s,z=t.getAllNodes(),C=t.getAllEdges(),[W,$,X]=no(o,h,d),q=z==null?void 0:z.length;if(!q||q===1)return jn(t,e,X);const st=(y-g)/q;let{radius:ut,startRadius:J,endRadius:mt}=s;if(k){const Gt=En(10,k),zt=hs(10,F);let _t=-1/0;z.forEach(bt=>{const kt=zt(bt);_t<kt&&(_t=kt)});let le=0;z.forEach((bt,kt)=>{kt===0?le+=_t||10:le+=(Gt(bt)||0)+(_t||10)}),ut=le/(2*Math.PI)}else!ut&&!J&&!mt?ut=Math.min($,W)/2:!J&&mt?J=mt:J&&!mt&&(mt=J);const Et=st*O;let jt=[];L==="topology"?jt=ps(t,z):L==="topology-directed"?jt=ps(t,z,!0):L==="degree"?jt=eo(t,z):jt=z.map(Gt=>Ze(Gt));const Pt=Math.ceil(q/p);for(let Gt=0;Gt<q;++Gt){let zt=ut;!zt&&J!==null&&mt!==null&&(zt=J+Gt*(mt-J)/(q-1)),zt||(zt=10+Gt*100/(q-1));let _t=g+Gt%Pt*Et+2*Math.PI/p*Math.floor(Gt/Pt);R||(_t=y-Gt%Pt*Et-2*Math.PI/p*Math.floor(Gt/Pt)),jt[Gt].data.x=X[0]+Math.cos(_t)*zt,jt[Gt].data.y=X[1]+Math.sin(_t)*zt}return e&&jt.forEach(Gt=>{t.mergeNodeData(Gt.id,{x:Gt.data.x,y:Gt.data.y})}),{nodes:jt,edges:C}})}}const ps=(n,e,t=!1)=>{const r=[Ze(e[0])],s={},o=e.length;s[e[0].id]=!0;let h=0;return e.forEach((d,p)=>{if(p!==0)if((p===o-1||n.getDegree(d.id,"both")!==n.getDegree(e[p+1].id,"both")||n.areNeighbors(r[h].id,d.id))&&!s[d.id])r.push(Ze(d)),s[d.id]=!0,h++;else{const g=t?n.getSuccessors(r[h].id):n.getNeighbors(r[h].id);let y=!1;for(let L=0;L<g.length;L++){const R=g[L];if(n.getDegree(R.id)===n.getDegree(d.id)&&!s[R.id]){r.push(Ze(R)),s[R.id]=!0,y=!0;break}}let O=0;for(;!y&&(s[e[O].id]||(r.push(Ze(e[O])),s[e[O].id]=!0,y=!0),O++,O!==o););}}),r};function eo(n,e){const t=[];return e.forEach((r,s)=>{t.push(Ze(r))}),t.sort((r,s)=>n.getDegree(r.id,"both")-n.getDegree(s.id,"both")),t}const no=(n,e,t)=>{let r=n,s=e,o=t;return!r&&typeof window!="undefined"&&(r=window.innerWidth),!s&&typeof window!="undefined"&&(s=window.innerHeight),o||(o=[r/2,s/2]),[r,s,o]};function Yn(n){return typeof n=="string"}const Ge=Array.isArray,ro={nodeSize:30,nodeSpacing:10,preventOverlap:!1,sweep:void 0,equidistant:!1,startAngle:3/2*Math.PI,clockwise:!0,maxLevelDiff:void 0,sortBy:"degree"};class Tr{constructor(e={}){this.options=e,this.id="concentric",this.options=Object.assign(Object.assign({},ro),e)}execute(e,t){return A(this,void 0,void 0,function*(){return this.genericConcentricLayout(!1,e,t)})}assign(e,t){return A(this,void 0,void 0,function*(){yield this.genericConcentricLayout(!0,e,t)})}genericConcentricLayout(e,t,r){return A(this,void 0,void 0,function*(){const s=Object.assign(Object.assign({},this.options),r),{center:o,width:h,height:d,sortBy:p,maxLevelDiff:g,sweep:y,clockwise:O,equidistant:L,preventOverlap:R,startAngle:k=3/2*Math.PI,nodeSize:F,nodeSpacing:z}=s,C=t.getAllNodes(),W=t.getAllEdges(),$=!h&&typeof window!="undefined"?window.innerWidth:h,X=!d&&typeof window!="undefined"?window.innerHeight:d,q=o||[$/2,X/2];if(!(C!=null&&C.length)||C.length===1)return jn(t,e,q);const st=[];let ut,J=0;Ge(F)?ut=Math.max(F[0],F[1]):qe(F)?(ut=-1/0,C.forEach(bt=>{const kt=F(bt);kt>ut&&(ut=kt)})):ut=F,Ge(z)?J=Math.max(z[0],z[1]):$t(z)&&(J=z),C.forEach(bt=>{const kt=Ze(bt);st.push(kt);let Qt=ut;const{data:Xt}=kt;Ge(Xt.size)?Qt=Math.max(Xt.size[0],Xt.size[1]):$t(Xt.size)?Qt=Xt.size:xn(Xt.size)&&(Qt=Math.max(Xt.size.width,Xt.size.height)),ut=Math.max(ut,Qt),qe(z)&&(J=Math.max(z(bt),J))});const mt={};st.forEach((bt,kt)=>{mt[bt.id]=kt});let Et=p;(!Yn(Et)||st[0].data[Et]===void 0)&&(Et="degree"),Et==="degree"?st.sort((bt,kt)=>t.getDegree(kt.id,"both")-t.getDegree(bt.id,"both")):st.sort((bt,kt)=>kt.data[Et]-bt.data[Et]);const jt=st[0],Pt=(g||(Et==="degree"?t.getDegree(jt.id,"both"):jt.data[Et]))/4,Dt=[{nodes:[]}];let Gt=Dt[0];st.forEach(bt=>{if(Gt.nodes.length>0){const kt=Math.abs(Et==="degree"?t.getDegree(Gt.nodes[0].id,"both")-t.getDegree(bt.id,"both"):Gt.nodes[0].data[Et]-bt.data[Et]);Pt&&kt>=Pt&&(Gt={nodes:[]},Dt.push(Gt))}Gt.nodes.push(bt)});let zt=ut+J;if(!R){const bt=Dt.length>0&&Dt[0].nodes.length>1,Qt=(Math.min($,X)/2-zt)/(Dt.length+(bt?1:0));zt=Math.min(zt,Qt)}let _t=0;if(Dt.forEach(bt=>{const kt=y===void 0?2*Math.PI-2*Math.PI/bt.nodes.length:y;if(bt.dTheta=kt/Math.max(1,bt.nodes.length-1),bt.nodes.length>1&&R){const Qt=Math.cos(bt.dTheta)-Math.cos(0),Xt=Math.sin(bt.dTheta)-Math.sin(0),ie=Math.sqrt(zt*zt/(Qt*Qt+Xt*Xt));_t=Math.max(ie,_t)}bt.r=_t,_t+=zt}),L){let bt=0,kt=0;for(let Qt=0;Qt<Dt.length;Qt++){const ie=(Dt[Qt].r||0)-kt;bt=Math.max(bt,ie)}kt=0,Dt.forEach((Qt,Xt)=>{Xt===0&&(kt=Qt.r||0),Qt.r=kt,kt+=bt})}return Dt.forEach(bt=>{const kt=bt.dTheta||0,Qt=bt.r||0;bt.nodes.forEach((Xt,ie)=>{const de=k+(O?1:-1)*kt*ie;Xt.data.x=q[0]+Qt*Math.cos(de),Xt.data.y=q[1]+Qt*Math.sin(de)})}),e&&st.forEach(bt=>t.mergeNodeData(bt.id,{x:bt.data.x,y:bt.data.y})),{nodes:st,edges:W}})}}function so(n){const e=+this._x.call(null,n),t=+this._y.call(null,n);return vs(this.cover(e,t),e,t,n)}function vs(n,e,t,r){if(isNaN(e)||isNaN(t))return n;var s,o=n._root,h={data:r},d=n._x0,p=n._y0,g=n._x1,y=n._y1,O,L,R,k,F,z,C,W;if(!o)return n._root=h,n;for(;o.length;)if((F=e>=(O=(d+g)/2))?d=O:g=O,(z=t>=(L=(p+y)/2))?p=L:y=L,s=o,!(o=o[C=z<<1|F]))return s[C]=h,n;if(R=+n._x.call(null,o.data),k=+n._y.call(null,o.data),e===R&&t===k)return h.next=o,s?s[C]=h:n._root=h,n;do s=s?s[C]=new Array(4):n._root=new Array(4),(F=e>=(O=(d+g)/2))?d=O:g=O,(z=t>=(L=(p+y)/2))?p=L:y=L;while((C=z<<1|F)===(W=(k>=L)<<1|R>=O));return s[W]=o,s[C]=h,n}function io(n){var e,t,r=n.length,s,o,h=new Array(r),d=new Array(r),p=1/0,g=1/0,y=-1/0,O=-1/0;for(t=0;t<r;++t)isNaN(s=+this._x.call(null,e=n[t]))||isNaN(o=+this._y.call(null,e))||(h[t]=s,d[t]=o,s<p&&(p=s),s>y&&(y=s),o<g&&(g=o),o>O&&(O=o));if(p>y||g>O)return this;for(this.cover(p,g).cover(y,O),t=0;t<r;++t)vs(this,h[t],d[t],n[t]);return this}function oo(n,e){if(isNaN(n=+n)||isNaN(e=+e))return this;var t=this._x0,r=this._y0,s=this._x1,o=this._y1;if(isNaN(t))s=(t=Math.floor(n))+1,o=(r=Math.floor(e))+1;else{for(var h=s-t||1,d=this._root,p,g;t>n||n>=s||r>e||e>=o;)switch(g=(e<r)<<1|n<t,p=new Array(4),p[g]=d,d=p,h*=2,g){case 0:s=t+h,o=r+h;break;case 1:t=s-h,o=r+h;break;case 2:s=t+h,r=o-h;break;case 3:t=s-h,r=o-h;break}this._root&&this._root.length&&(this._root=d)}return this._x0=t,this._y0=r,this._x1=s,this._y1=o,this}function ao(){var n=[];return this.visit(function(e){if(!e.length)do n.push(e.data);while(e=e.next)}),n}function uo(n){return arguments.length?this.cover(+n[0][0],+n[0][1]).cover(+n[1][0],+n[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}function We(n,e,t,r,s){this.node=n,this.x0=e,this.y0=t,this.x1=r,this.y1=s}function co(n,e,t){var r,s=this._x0,o=this._y0,h,d,p,g,y=this._x1,O=this._y1,L=[],R=this._root,k,F;for(R&&L.push(new We(R,s,o,y,O)),t==null?t=1/0:(s=n-t,o=e-t,y=n+t,O=e+t,t*=t);k=L.pop();)if(!(!(R=k.node)||(h=k.x0)>y||(d=k.y0)>O||(p=k.x1)<s||(g=k.y1)<o))if(R.length){var z=(h+p)/2,C=(d+g)/2;L.push(new We(R[3],z,C,p,g),new We(R[2],h,C,z,g),new We(R[1],z,d,p,C),new We(R[0],h,d,z,C)),(F=(e>=C)<<1|n>=z)&&(k=L[L.length-1],L[L.length-1]=L[L.length-1-F],L[L.length-1-F]=k)}else{var W=n-+this._x.call(null,R.data),$=e-+this._y.call(null,R.data),X=W*W+$*$;if(X<t){var q=Math.sqrt(t=X);s=n-q,o=e-q,y=n+q,O=e+q,r=R.data}}return r}function fo(n){if(isNaN(y=+this._x.call(null,n))||isNaN(O=+this._y.call(null,n)))return this;var e,t=this._root,r,s,o,h=this._x0,d=this._y0,p=this._x1,g=this._y1,y,O,L,R,k,F,z,C;if(!t)return this;if(t.length)for(;;){if((k=y>=(L=(h+p)/2))?h=L:p=L,(F=O>=(R=(d+g)/2))?d=R:g=R,e=t,!(t=t[z=F<<1|k]))return this;if(!t.length)break;(e[z+1&3]||e[z+2&3]||e[z+3&3])&&(r=e,C=z)}for(;t.data!==n;)if(s=t,!(t=t.next))return this;return(o=t.next)&&delete t.next,s?(o?s.next=o:delete s.next,this):e?(o?e[z]=o:delete e[z],(t=e[0]||e[1]||e[2]||e[3])&&t===(e[3]||e[2]||e[1]||e[0])&&!t.length&&(r?r[C]=t:this._root=t),this):(this._root=o,this)}function lo(n){for(var e=0,t=n.length;e<t;++e)this.remove(n[e]);return this}function ho(){return this._root}function go(){var n=0;return this.visit(function(e){if(!e.length)do++n;while(e=e.next)}),n}function po(n){var e=[],t,r=this._root,s,o,h,d,p;for(r&&e.push(new We(r,this._x0,this._y0,this._x1,this._y1));t=e.pop();)if(!n(r=t.node,o=t.x0,h=t.y0,d=t.x1,p=t.y1)&&r.length){var g=(o+d)/2,y=(h+p)/2;(s=r[3])&&e.push(new We(s,g,y,d,p)),(s=r[2])&&e.push(new We(s,o,y,g,p)),(s=r[1])&&e.push(new We(s,g,h,d,y)),(s=r[0])&&e.push(new We(s,o,h,g,y))}return this}function vo(n){var e=[],t=[],r;for(this._root&&e.push(new We(this._root,this._x0,this._y0,this._x1,this._y1));r=e.pop();){var s=r.node;if(s.length){var o,h=r.x0,d=r.y0,p=r.x1,g=r.y1,y=(h+p)/2,O=(d+g)/2;(o=s[0])&&e.push(new We(o,h,d,y,O)),(o=s[1])&&e.push(new We(o,y,d,p,O)),(o=s[2])&&e.push(new We(o,h,O,y,g)),(o=s[3])&&e.push(new We(o,y,O,p,g))}t.push(r)}for(;r=t.pop();)n(r.node,r.x0,r.y0,r.x1,r.y1);return this}function mo(n){return n[0]}function yo(n){return arguments.length?(this._x=n,this):this._x}function wo(n){return n[1]}function xo(n){return arguments.length?(this._y=n,this):this._y}function Cn(n,e,t){var r=new jr(e==null?mo:e,t==null?wo:t,NaN,NaN,NaN,NaN);return n==null?r:r.addAll(n)}function jr(n,e,t,r,s,o){this._x=n,this._y=e,this._x0=t,this._y0=r,this._x1=s,this._y1=o,this._root=void 0}function ms(n){for(var e={data:n.data},t=e;n=n.next;)t=t.next={data:n.data};return e}var Ye=Cn.prototype=jr.prototype;Ye.copy=function(){var n=new jr(this._x,this._y,this._x0,this._y0,this._x1,this._y1),e=this._root,t,r;if(!e)return n;if(!e.length)return n._root=ms(e),n;for(t=[{source:e,target:n._root=new Array(4)}];e=t.pop();)for(var s=0;s<4;++s)(r=e.source[s])&&(r.length?t.push({source:r,target:e.target[s]=new Array(4)}):e.target[s]=ms(r));return n},Ye.add=so,Ye.addAll=io,Ye.cover=oo,Ye.data=ao,Ye.extent=uo,Ye.find=co,Ye.remove=fo,Ye.removeAll=lo,Ye.root=ho,Ye.size=go,Ye.visit=po,Ye.visitAfter=vo,Ye.x=yo,Ye.y=xo;function Eo(n){const e=+this._x.call(null,n),t=+this._y.call(null,n),r=+this._z.call(null,n);return ys(this.cover(e,t,r),e,t,r,n)}function ys(n,e,t,r,s){if(isNaN(e)||isNaN(t)||isNaN(r))return n;var o,h=n._root,d={data:s},p=n._x0,g=n._y0,y=n._z0,O=n._x1,L=n._y1,R=n._z1,k,F,z,C,W,$,X,q,st,ut,J;if(!h)return n._root=d,n;for(;h.length;)if((X=e>=(k=(p+O)/2))?p=k:O=k,(q=t>=(F=(g+L)/2))?g=F:L=F,(st=r>=(z=(y+R)/2))?y=z:R=z,o=h,!(h=h[ut=st<<2|q<<1|X]))return o[ut]=d,n;if(C=+n._x.call(null,h.data),W=+n._y.call(null,h.data),$=+n._z.call(null,h.data),e===C&&t===W&&r===$)return d.next=h,o?o[ut]=d:n._root=d,n;do o=o?o[ut]=new Array(8):n._root=new Array(8),(X=e>=(k=(p+O)/2))?p=k:O=k,(q=t>=(F=(g+L)/2))?g=F:L=F,(st=r>=(z=(y+R)/2))?y=z:R=z;while((ut=st<<2|q<<1|X)===(J=($>=z)<<2|(W>=F)<<1|C>=k));return o[J]=h,o[ut]=d,n}function bo(n){Array.isArray(n)||(n=Array.from(n));const e=n.length,t=new Float64Array(e),r=new Float64Array(e),s=new Float64Array(e);let o=1/0,h=1/0,d=1/0,p=-1/0,g=-1/0,y=-1/0;for(let O=0,L,R,k,F;O<e;++O)isNaN(R=+this._x.call(null,L=n[O]))||isNaN(k=+this._y.call(null,L))||isNaN(F=+this._z.call(null,L))||(t[O]=R,r[O]=k,s[O]=F,R<o&&(o=R),R>p&&(p=R),k<h&&(h=k),k>g&&(g=k),F<d&&(d=F),F>y&&(y=F));if(o>p||h>g||d>y)return this;this.cover(o,h,d).cover(p,g,y);for(let O=0;O<e;++O)ys(this,t[O],r[O],s[O],n[O]);return this}function No(n,e,t){if(isNaN(n=+n)||isNaN(e=+e)||isNaN(t=+t))return this;var r=this._x0,s=this._y0,o=this._z0,h=this._x1,d=this._y1,p=this._z1;if(isNaN(r))h=(r=Math.floor(n))+1,d=(s=Math.floor(e))+1,p=(o=Math.floor(t))+1;else{for(var g=h-r||1,y=this._root,O,L;r>n||n>=h||s>e||e>=d||o>t||t>=p;)switch(L=(t<o)<<2|(e<s)<<1|n<r,O=new Array(8),O[L]=y,y=O,g*=2,L){case 0:h=r+g,d=s+g,p=o+g;break;case 1:r=h-g,d=s+g,p=o+g;break;case 2:h=r+g,s=d-g,p=o+g;break;case 3:r=h-g,s=d-g,p=o+g;break;case 4:h=r+g,d=s+g,o=p-g;break;case 5:r=h-g,d=s+g,o=p-g;break;case 6:h=r+g,s=d-g,o=p-g;break;case 7:r=h-g,s=d-g,o=p-g;break}this._root&&this._root.length&&(this._root=y)}return this._x0=r,this._y0=s,this._z0=o,this._x1=h,this._y1=d,this._z1=p,this}function Mo(){var n=[];return this.visit(function(e){if(!e.length)do n.push(e.data);while(e=e.next)}),n}function So(n){return arguments.length?this.cover(+n[0][0],+n[0][1],+n[0][2]).cover(+n[1][0],+n[1][1],+n[1][2]):isNaN(this._x0)?void 0:[[this._x0,this._y0,this._z0],[this._x1,this._y1,this._z1]]}function ve(n,e,t,r,s,o,h){this.node=n,this.x0=e,this.y0=t,this.z0=r,this.x1=s,this.y1=o,this.z1=h}function Oo(n,e,t,r){var s,o=this._x0,h=this._y0,d=this._z0,p,g,y,O,L,R,k=this._x1,F=this._y1,z=this._z1,C=[],W=this._root,$,X;for(W&&C.push(new ve(W,o,h,d,k,F,z)),r==null?r=1/0:(o=n-r,h=e-r,d=t-r,k=n+r,F=e+r,z=t+r,r*=r);$=C.pop();)if(!(!(W=$.node)||(p=$.x0)>k||(g=$.y0)>F||(y=$.z0)>z||(O=$.x1)<o||(L=$.y1)<h||(R=$.z1)<d))if(W.length){var q=(p+O)/2,st=(g+L)/2,ut=(y+R)/2;C.push(new ve(W[7],q,st,ut,O,L,R),new ve(W[6],p,st,ut,q,L,R),new ve(W[5],q,g,ut,O,st,R),new ve(W[4],p,g,ut,q,st,R),new ve(W[3],q,st,y,O,L,ut),new ve(W[2],p,st,y,q,L,ut),new ve(W[1],q,g,y,O,st,ut),new ve(W[0],p,g,y,q,st,ut)),(X=(t>=ut)<<2|(e>=st)<<1|n>=q)&&($=C[C.length-1],C[C.length-1]=C[C.length-1-X],C[C.length-1-X]=$)}else{var J=n-+this._x.call(null,W.data),mt=e-+this._y.call(null,W.data),Et=t-+this._z.call(null,W.data),jt=J*J+mt*mt+Et*Et;if(jt<r){var Pt=Math.sqrt(r=jt);o=n-Pt,h=e-Pt,d=t-Pt,k=n+Pt,F=e+Pt,z=t+Pt,s=W.data}}return s}const Ao=(n,e,t,r,s,o)=>Math.sqrt(ur(n-r,2)+ur(e-s,2)+ur(t-o,2));function To(n,e,t,r){const s=[],o=n-r,h=e-r,d=t-r,p=n+r,g=e+r,y=t+r;return this.visit((O,L,R,k,F,z,C)=>{if(!O.length)do{const W=O.data;Ao(n,e,t,this._x(W),this._y(W),this._z(W))<=r&&s.push(W)}while(O=O.next);return L>p||R>g||k>y||F<o||z<h||C<d}),s}function jo(n){if(isNaN(L=+this._x.call(null,n))||isNaN(R=+this._y.call(null,n))||isNaN(k=+this._z.call(null,n)))return this;var e,t=this._root,r,s,o,h=this._x0,d=this._y0,p=this._z0,g=this._x1,y=this._y1,O=this._z1,L,R,k,F,z,C,W,$,X,q,st;if(!t)return this;if(t.length)for(;;){if((W=L>=(F=(h+g)/2))?h=F:g=F,($=R>=(z=(d+y)/2))?d=z:y=z,(X=k>=(C=(p+O)/2))?p=C:O=C,e=t,!(t=t[q=X<<2|$<<1|W]))return this;if(!t.length)break;(e[q+1&7]||e[q+2&7]||e[q+3&7]||e[q+4&7]||e[q+5&7]||e[q+6&7]||e[q+7&7])&&(r=e,st=q)}for(;t.data!==n;)if(s=t,!(t=t.next))return this;return(o=t.next)&&delete t.next,s?(o?s.next=o:delete s.next,this):e?(o?e[q]=o:delete e[q],(t=e[0]||e[1]||e[2]||e[3]||e[4]||e[5]||e[6]||e[7])&&t===(e[7]||e[6]||e[5]||e[4]||e[3]||e[2]||e[1]||e[0])&&!t.length&&(r?r[st]=t:this._root=t),this):(this._root=o,this)}function Io(n){for(var e=0,t=n.length;e<t;++e)this.remove(n[e]);return this}function Po(){return this._root}function Ro(){var n=0;return this.visit(function(e){if(!e.length)do++n;while(e=e.next)}),n}function Lo(n){var e=[],t,r=this._root,s,o,h,d,p,g,y;for(r&&e.push(new ve(r,this._x0,this._y0,this._z0,this._x1,this._y1,this._z1));t=e.pop();)if(!n(r=t.node,o=t.x0,h=t.y0,d=t.z0,p=t.x1,g=t.y1,y=t.z1)&&r.length){var O=(o+p)/2,L=(h+g)/2,R=(d+y)/2;(s=r[7])&&e.push(new ve(s,O,L,R,p,g,y)),(s=r[6])&&e.push(new ve(s,o,L,R,O,g,y)),(s=r[5])&&e.push(new ve(s,O,h,R,p,L,y)),(s=r[4])&&e.push(new ve(s,o,h,R,O,L,y)),(s=r[3])&&e.push(new ve(s,O,L,d,p,g,R)),(s=r[2])&&e.push(new ve(s,o,L,d,O,g,R)),(s=r[1])&&e.push(new ve(s,O,h,d,p,L,R)),(s=r[0])&&e.push(new ve(s,o,h,d,O,L,R))}return this}function Co(n){var e=[],t=[],r;for(this._root&&e.push(new ve(this._root,this._x0,this._y0,this._z0,this._x1,this._y1,this._z1));r=e.pop();){var s=r.node;if(s.length){var o,h=r.x0,d=r.y0,p=r.z0,g=r.x1,y=r.y1,O=r.z1,L=(h+g)/2,R=(d+y)/2,k=(p+O)/2;(o=s[0])&&e.push(new ve(o,h,d,p,L,R,k)),(o=s[1])&&e.push(new ve(o,L,d,p,g,R,k)),(o=s[2])&&e.push(new ve(o,h,R,p,L,y,k)),(o=s[3])&&e.push(new ve(o,L,R,p,g,y,k)),(o=s[4])&&e.push(new ve(o,h,d,k,L,R,O)),(o=s[5])&&e.push(new ve(o,L,d,k,g,R,O)),(o=s[6])&&e.push(new ve(o,h,R,k,L,y,O)),(o=s[7])&&e.push(new ve(o,L,R,k,g,y,O))}t.push(r)}for(;r=t.pop();)n(r.node,r.x0,r.y0,r.z0,r.x1,r.y1,r.z1);return this}function Do(n){return n[0]}function zo(n){return arguments.length?(this._x=n,this):this._x}function Fo(n){return n[1]}function ko(n){return arguments.length?(this._y=n,this):this._y}function Bo(n){return n[2]}function Uo(n){return arguments.length?(this._z=n,this):this._z}function tr(n,e,t,r){var s=new Ir(e==null?Do:e,t==null?Fo:t,r==null?Bo:r,NaN,NaN,NaN,NaN,NaN,NaN);return n==null?s:s.addAll(n)}function Ir(n,e,t,r,s,o,h,d,p){this._x=n,this._y=e,this._z=t,this._x0=r,this._y0=s,this._z0=o,this._x1=h,this._y1=d,this._z1=p,this._root=void 0}function ws(n){for(var e={data:n.data},t=e;n=n.next;)t=t.next={data:n.data};return e}var Fe=tr.prototype=Ir.prototype;Fe.copy=function(){var n=new Ir(this._x,this._y,this._z,this._x0,this._y0,this._z0,this._x1,this._y1,this._z1),e=this._root,t,r;if(!e)return n;if(!e.length)return n._root=ws(e),n;for(t=[{source:e,target:n._root=new Array(8)}];e=t.pop();)for(var s=0;s<8;++s)(r=e.source[s])&&(r.length?t.push({source:r,target:e.target[s]=new Array(8)}):e.target[s]=ws(r));return n},Fe.add=Eo,Fe.addAll=bo,Fe.cover=No,Fe.data=Mo,Fe.extent=So,Fe.find=Oo,Fe.findAllWithinRadius=To,Fe.remove=jo,Fe.removeAll=Io,Fe.root=Po,Fe.size=Ro,Fe.visit=Lo,Fe.visitAfter=Co,Fe.x=zo,Fe.y=ko,Fe.z=Uo;const Vo=.81,Pr=.1;function Go(n,e,t,r,s=2){const o=e/t,h=n.getAllNodes(),d=h.map((y,O)=>{const{nodeStrength:L,x:R,y:k,z:F,size:z}=y.data;return{x:R,y:k,z:F,size:z,index:O,id:y.id,vx:0,vy:0,vz:0,weight:o*L}}),p=(s===2?Cn(d,y=>y.x,y=>y.y):tr(d,y=>y.x,y=>y.y,y=>y.z)).visitAfter(Wo),g=new Map;return d.forEach(y=>{g.set(y.id,y),$o(y,p,s)}),d.map((y,O)=>{const{id:L,data:R}=h[O],{mass:k=1}=R;r[L]={x:y.vx/k,y:y.vy/k,z:y.vz/k}}),r}function Wo(n){let e=0,t=0,r=0,s=0,o=0;const h=n.length;if(h){for(let d=0;d<h;d++){const p=n[d];p&&p.weight&&(e+=p.weight,t+=p.x*p.weight,r+=p.y*p.weight,s+=p.z*p.weight,o+=p.size*p.weight)}n.x=t/e,n.y=r/e,n.z=s/e,n.size=o/e,n.weight=e}else{const d=n;n.x=d.data.x,n.y=d.data.y,n.z=d.data.z,n.size=d.data.size,n.weight=d.data.weight}}const Yo=(n,e,t,r,s,o,h)=>{var d;if(((d=n.data)===null||d===void 0?void 0:d.id)===o.id)return;const p=[t,r,s][h-1],g=o.x-n.x||Pr,y=o.y-n.y||Pr,O=o.z-n.z||Pr,L=[g,y,O],R=p-e;let k=0;for(let C=0;C<h;C++)k+=L[C]*L[C];const z=Math.sqrt(k)*k;if(R*R*Vo<k){const C=n.weight/z;return o.vx+=g*C,o.vy+=y*C,o.vz+=O*C,!0}if(n.length)return!1;if(n.data!==o){const C=n.data.weight/z;o.vx+=g*C,o.vy+=y*C,o.vz+=O*C}};function $o(n,e,t){e.visit((r,s,o,h,d)=>Yo(r,s,o,h,d,n,t))}const Xo={dimensions:2,maxIteration:500,gravity:10,factor:1,edgeStrength:50,nodeStrength:1e3,coulombDisScale:.005,damping:.9,maxSpeed:200,minMovement:.4,interval:.02,linkDistance:200,clusterNodeStrength:20,preventOverlap:!0,distanceThresholdMode:"mean"};class xs{constructor(e={}){this.options=e,this.id="force",this.timeInterval=0,this.judgingDistance=0,this.running=!1,this.options=Object.assign(Object.assign({},Xo),e)}execute(e,t){return A(this,void 0,void 0,function*(){return this.genericForceLayout(!1,e,t)})}assign(e,t){return A(this,void 0,void 0,function*(){yield this.genericForceLayout(!0,e,t)})}stop(){this.timeInterval&&typeof window!="undefined"&&window.clearInterval(this.timeInterval),this.running=!1}tick(e=this.options.maxIteration||1){if(this.lastResult)return this.lastResult;for(let r=0;(this.judgingDistance>this.lastOptions.minMovement||r<1)&&r<e;r++)this.runOneStep(this.lastCalcGraph,this.lastGraph,r,this.lastVelMap,this.lastOptions),this.updatePosition(this.lastGraph,this.lastCalcGraph,this.lastVelMap,this.lastOptions);const t={nodes:this.lastLayoutNodes,edges:this.lastLayoutEdges};return this.lastAssign&&t.nodes.forEach(r=>this.lastGraph.mergeNodeData(r.id,{x:r.data.x,y:r.data.y,z:this.options.dimensions===3?r.data.z:void 0})),t}genericForceLayout(e,t,r){return A(this,void 0,void 0,function*(){const s=Object.assign(Object.assign({},this.options),r),o=t.getAllNodes(),h=t.getAllEdges(),d=this.formatOptions(s,t),{dimensions:p,width:g,height:y,nodeSize:O,getMass:L,nodeStrength:R,edgeStrength:k,linkDistance:F}=d,z=o.map((J,mt)=>Object.assign(Object.assign({},J),{data:Object.assign(Object.assign({},J.data),{x:$t(J.data.x)?J.data.x:Math.random()*g,y:$t(J.data.y)?J.data.y:Math.random()*y,z:$t(J.data.z)?J.data.z:Math.random()*Math.sqrt(g*y),size:O(J)||30,mass:L(J),nodeStrength:R(J)})})),C=h.map(J=>Object.assign(Object.assign({},J),{data:Object.assign(Object.assign({},J.data),{edgeStrength:k(J),linkDistance:F(J,t.getNode(J.source),t.getNode(J.target))})}));if(!(o!=null&&o.length))return this.lastResult={nodes:[],edges:h},{nodes:[],edges:h};const W={};o.forEach((J,mt)=>{W[J.id]={x:0,y:0,z:0}});const $=new vt({nodes:z,edges:C});this.formatCentripetal(d,$);const{maxIteration:X,minMovement:q,onTick:st}=d;if(this.lastLayoutNodes=z,this.lastLayoutEdges=C,this.lastAssign=e,this.lastGraph=t,this.lastCalcGraph=$,this.lastOptions=d,this.lastVelMap=W,typeof window=="undefined")return;let ut=0;return new Promise(J=>{this.timeInterval=window.setInterval(()=>{(!o||!this.running)&&J({nodes:Rr(t,z),edges:h}),this.runOneStep($,t,ut,W,d),this.updatePosition(t,$,W,d),e&&z.forEach(mt=>t.mergeNodeData(mt.id,{x:mt.data.x,y:mt.data.y,z:p===3?mt.data.z:void 0})),st==null||st({nodes:Rr(t,z),edges:h}),ut++,(ut>=X||this.judgingDistance<q)&&(window.clearInterval(this.timeInterval),J({nodes:Rr(t,z),edges:h}))},0),this.running=!0})})}formatOptions(e,t){const r=Object.assign({},e),{width:s,height:o,getMass:h,nodeSize:d}=e;r.width=!s&&typeof window!="undefined"?window.innerWidth:s,r.height=!o&&typeof window!="undefined"?window.innerHeight:o,e.center||(r.center=[r.width/2,r.height/2]),h||(r.getMass=O=>{let L=1;$t(O==null?void 0:O.data.mass)&&(L=O==null?void 0:O.data.mass);const R=t.getDegree(O.id,"both");return!R||R<5?L:R*5*L});const p=En(0,e.nodeSpacing);let g;d?qe(d)?g=O=>d(O)+p(O):Ge(d)?g=O=>{const L=d;return Math.max(L[0],L[1])+p(O)}:g=O=>d+p(O):g=O=>{const{size:L}=(O==null?void 0:O.data)||{};return L?Ge(L)?Math.max(L[0],L[1])+p(O):xn(L)?Math.max(L.width,L.height)+p(O):L+p(O):10+p(O)},r.nodeSize=g;const y=e.linkDistance?En(1,e.linkDistance):O=>1+r.nodeSize(t.getNode(O.source))+r.nodeSize(t.getNode(O.target));return r.linkDistance=y,r.nodeStrength=En(1,e.nodeStrength),r.edgeStrength=En(1,e.edgeStrength),r}formatCentripetal(e,t){const{dimensions:r,centripetalOptions:s,center:o,clusterNodeStrength:h,leafCluster:d,clustering:p,nodeClusterBy:g}=e,y=t.getAllNodes(),O=s||{leaf:2,single:2,others:1,center:C=>({x:o[0],y:o[1],z:r===3?o[2]:void 0})};typeof h!="function"&&(e.clusterNodeStrength=C=>h);let L,R;if(d&&g&&(L=Es(t,g),R=Array.from(new Set(y==null?void 0:y.map(C=>C.data[g])))||[],e.centripetalOptions=Object.assign(O,{single:100,leaf:C=>{const{siblingLeaves:W,sameTypeLeaves:$}=L[C.id]||{};return($==null?void 0:$.length)===(W==null?void 0:W.length)||(R==null?void 0:R.length)===1?1:e.clusterNodeStrength(C)},others:1,center:C=>{const W=t.getDegree(C.id,"both");if(!W)return{x:100,y:100,z:0};let $;if(W===1){const{sameTypeLeaves:X=[]}=L[C.id]||{};X.length===1?$=void 0:X.length>1&&($=bs(X))}else $=void 0;return{x:$==null?void 0:$.x,y:$==null?void 0:$.y,z:$==null?void 0:$.z}}})),p&&g){L||(L=Es(t,g)),R||(R=Array.from(new Set(y.map(W=>W.data[g])))),R=R.filter(W=>W!==void 0);const C={};R.forEach(W=>{const $=y.filter(X=>X.data[g]===W).map(X=>t.getNode(X.id));C[W]=bs($)}),e.centripetalOptions=Object.assign(O,{single:W=>e.clusterNodeStrength(W),leaf:W=>e.clusterNodeStrength(W),others:W=>e.clusterNodeStrength(W),center:W=>{const $=C[W.data[g]];return{x:$==null?void 0:$.x,y:$==null?void 0:$.y,z:$==null?void 0:$.z}}})}const{leaf:k,single:F,others:z}=e.centripetalOptions||{};k&&typeof k!="function"&&(e.centripetalOptions.leaf=()=>k),F&&typeof F!="function"&&(e.centripetalOptions.single=()=>F),z&&typeof z!="function"&&(e.centripetalOptions.others=()=>z)}runOneStep(e,t,r,s,o){const h={},d=e.getAllNodes(),p=e.getAllEdges();if(!(d!=null&&d.length))return;const{monitor:g}=o;if(this.calRepulsive(e,h,o),p&&this.calAttractive(e,h,o),this.calGravity(e,t,h,o),this.updateVelocity(e,h,s,o),g){const y=this.calTotalEnergy(h,d);g({energy:y,nodes:t.getAllNodes(),edges:t.getAllEdges(),iterations:r})}}calTotalEnergy(e,t){if(!(t!=null&&t.length))return 0;let r=0;return t.forEach((s,o)=>{const h=e[s.id].x,d=e[s.id].y,p=this.options.dimensions===3?e[s.id].z:0,g=h*h+d*d+p*p,{mass:y=1}=s.data;r+=y*g*.5}),r}calRepulsive(e,t,r){const{dimensions:s,factor:o,coulombDisScale:h}=r;Go(e,o,h*h,t,s)}calAttractive(e,t,r){const{dimensions:s,nodeSize:o}=r;e.getAllEdges().forEach((h,d)=>{const{source:p,target:g}=h,y=e.getNode(p),O=e.getNode(g);if(!y||!O)return;let L=O.data.x-y.data.x,R=O.data.y-y.data.y,k=s===3?O.data.z-y.data.z:0;!L&&!R&&(L=Math.random()*.01,R=Math.random()*.01,s===3&&!k&&(k=Math.random()*.01));const F=Math.sqrt(L*L+R*R+k*k);if(F<o(y)+o(O))return;const z=L/F,C=R/F,W=k/F,{linkDistance:$=200,edgeStrength:X=200}=h.data||{},st=($-F)*X,ut=y.data.mass||1,J=O.data.mass||1,mt=1/ut,Et=1/J,jt=z*st,Pt=C*st,Dt=W*st;t[p].x-=jt*mt,t[p].y-=Pt*mt,t[p].z-=Dt*mt,t[g].x+=jt*Et,t[g].y+=Pt*Et,t[g].z+=Dt*Et})}calGravity(e,t,r,s){const{getCenter:o}=s,h=e.getAllNodes(),d=t.getAllNodes(),p=t.getAllEdges(),{width:g,height:y,center:O,gravity:L,centripetalOptions:R}=s;h&&h.forEach(k=>{const{id:F,data:z}=k,{mass:C,x:W,y:$,z:X}=z,q=t.getNode(F);let st=0,ut=0,J=0,mt=L;const Et=e.getDegree(F,"in"),jt=e.getDegree(F,"out"),Pt=e.getDegree(F,"both"),Dt=o==null?void 0:o(q,Pt);if(Dt){const[Gt,zt,_t]=Dt;st=W-Gt,ut=$-zt,mt=_t}else st=W-O[0],ut=$-O[1],J=X-O[2];if(mt&&(r[F].x-=mt*st/C,r[F].y-=mt*ut/C,r[F].z-=mt*J/C),R){const{leaf:Gt,single:zt,others:_t,center:le}=R,{x:bt,y:kt,z:Qt,centerStrength:Xt}=(le==null?void 0:le(q,d,p,g,y))||{x:0,y:0,z:0,centerStrength:0};if(!$t(bt)||!$t(kt))return;const ie=(W-bt)/C,de=($-kt)/C,Jt=(X-Qt)/C;if(Xt&&(r[F].x-=Xt*ie,r[F].y-=Xt*de,r[F].z-=Xt*Jt),Pt===0){const Te=zt(q);if(!Te)return;r[F].x-=Te*ie,r[F].y-=Te*de,r[F].z-=Te*Jt;return}if(Et===0||jt===0){const Te=Gt(q,d,p);if(!Te)return;r[F].x-=Te*ie,r[F].y-=Te*de,r[F].z-=Te*Jt;return}const oe=_t(q);if(!oe)return;r[F].x-=oe*ie,r[F].y-=oe*de,r[F].z-=oe*Jt}})}updateVelocity(e,t,r,s){const{damping:o,maxSpeed:h,interval:d,dimensions:p}=s,g=e.getAllNodes();g!=null&&g.length&&g.forEach(y=>{const{id:O}=y;let L=(r[O].x+t[O].x*d)*o||.01,R=(r[O].y+t[O].y*d)*o||.01,k=p===3?(r[O].z+t[O].z*d)*o||.01:0;const F=Math.sqrt(L*L+R*R+k*k);if(F>h){const z=h/F;L=z*L,R=z*R,k=z*k}r[O]={x:L,y:R,z:k}})}updatePosition(e,t,r,s){const{distanceThresholdMode:o,interval:h,dimensions:d}=s,p=t.getAllNodes();if(!(p!=null&&p.length)){this.judgingDistance=0;return}let g=0;o==="max"?this.judgingDistance=-1/0:o==="min"&&(this.judgingDistance=1/0),p.forEach(y=>{const{id:O}=y,L=e.getNode(O);if($t(L.data.fx)&&$t(L.data.fy)){t.mergeNodeData(O,{x:L.data.fx,y:L.data.fy,z:d===3?L.data.fz:void 0});return}const R=r[O].x*h,k=r[O].y*h,F=d===3?r[O].z*h:0;t.mergeNodeData(O,{x:y.data.x+R,y:y.data.y+k,z:y.data.z+F});const z=Math.sqrt(R*R+k*k+F*F);switch(o){case"max":this.judgingDistance<z&&(this.judgingDistance=z);break;case"min":this.judgingDistance>z&&(this.judgingDistance=z);break;default:g=g+z;break}}),(!o||o==="mean")&&(this.judgingDistance=g/p.length)}}const Es=(n,e)=>{const t=n.getAllNodes();if(!(t!=null&&t.length))return{};const r={};return t.forEach((s,o)=>{n.getDegree(s.id,"both")===1&&(r[s.id]=Ko(n,"leaf",s,e))}),r},Ko=(n,e,t,r)=>{const s=n.getDegree(t.id,"in"),o=n.getDegree(t.id,"out");let h=t,d=[];s===0?(h=n.getSuccessors(t.id)[0],d=n.getNeighbors(h.id)):o===0&&(h=n.getPredecessors(t.id)[0],d=n.getNeighbors(h.id)),d=d.filter(g=>n.getDegree(g.id,"in")===0||n.getDegree(g.id,"out")===0);const p=_o(n,e,r,t,d);return{coreNode:h,siblingLeaves:d,sameTypeLeaves:p}},_o=(n,e,t,r,s)=>{const o=r.data[t]||"";let h=(s==null?void 0:s.filter(d=>d.data[t]===o))||[];return e==="leaf"&&(h=h.filter(d=>n.getDegree(d.id,"in")===0||n.getDegree(d.id,"out")===0)),h},bs=n=>{const e={x:0,y:0};n.forEach(r=>{const{x:s,y:o}=r.data;e.x+=s||0,e.y+=o||0});const t=n.length||1;return{x:e.x/t,y:e.y/t}},Rr=(n,e)=>e.map(t=>{const{id:r,data:s}=t,o=n.getNode(r);return Object.assign(Object.assign({},o),{data:Object.assign(Object.assign({},o.data),{x:s.x,y:s.y,z:s.z})})});var ne=me(78585);const Hu=ne.XA,qu=ne.a_,tc=ne.yQ,ec=ne.Hs,nc=ne.Ec,rc=ne.dx,sc=ne.LU,ic=ne.Rm,bn=ne.y3,oc=ne.qK,ac=ne.pb,uc=ne.j,cc=ne.sO,fc=ne.BZ,lc=ne.EK,dc=ne.Db,hc=ne.Fx,gc=ne.tU,pc=ne.Ym,vc=ne.rs,mc=ne.QR,yc=ne.TB,wc=ne.oH,Ns=ne.Sc,xc=ne.BN,Ec=ne.it,bc=ne.$r,Nc=ne.QM,Mc=ne.AV;var Sc=(ne.y3,ne.y3);const Oc=ne.GH,Ac=ne.SO,Tc=ne.uZ,jc=ne.yU,Ic=ne.F1,Pc=ne.re,Ms=n=>{const e=[],t=n.length;for(let r=0;r<t;r+=1){e[r]=[];for(let s=0;s<t;s+=1)r===s?e[r][s]=0:n[r][s]===0||!n[r][s]?e[r][s]=1/0:e[r][s]=n[r][s]}for(let r=0;r<t;r+=1)for(let s=0;s<t;s+=1)for(let o=0;o<t;o+=1)e[s][o]>e[s][r]+e[r][o]&&(e[s][o]=e[s][r]+e[r][o]);return e},Ss=(n,e)=>{const{nodes:t,edges:r}=n,s=[],o={};if(!t)throw new Error("invalid nodes data!");return t&&t.forEach((h,d)=>{o[h.id]=d;const p=[];s.push(p)}),r==null||r.forEach(h=>{const{source:d,target:p}=h,g=o[d],y=o[p];g===void 0||y===void 0||(s[g][y]=1,e||(s[y][g]=1))}),s},Zo=(n,e)=>{const t=[];return n.forEach(r=>{const s=[];r.forEach(o=>{s.push(o*e)}),t.push(s)}),t},Jo=n=>{let e=1/0,t=1/0,r=-1/0,s=-1/0;return n.forEach(o=>{let h=o.data.size;Ge(h)?h.length===1&&(h=[h[0],h[0]]):$t(h)?h=[h,h]:(h===void 0||isNaN(h))&&(h=[30,30]);const d=[h[0]/2,h[1]/2],p=o.data.x-d[0],g=o.data.x+d[0],y=o.data.y-d[1],O=o.data.y+d[1];e>p&&(e=p),t>y&&(t=y),r<g&&(r=g),s<O&&(s=O)}),{minX:e,minY:t,maxX:r,maxY:s}},Os=(n,e)=>Math.sqrt((n.x-e.x)*(n.x-e.x)+(n.y-e.y)*(n.y-e.y)),Lr=(n,e,t,r="TB",s,o={})=>{if(!(e!=null&&e.length))return;const{stopBranchFn:h,stopAllFn:d}=o;for(let p=0;p<e.length;p++){const g=e[p];if(n.hasNode(g.id)&&!(h!=null&&h(g))){if(d!=null&&d(g))return;r==="TB"&&t(g),Lr(n,n.getChildren(g.id,s),t,r,s,o),r!=="TB"&&t(g)}}},Qo={center:[0,0],linkDistance:50};class As{constructor(e={}){this.options=e,this.id="mds",this.options=Object.assign(Object.assign({},Qo),e)}execute(e,t){return A(this,void 0,void 0,function*(){return this.genericMDSLayout(!1,e,t)})}assign(e,t){return A(this,void 0,void 0,function*(){yield this.genericMDSLayout(!0,e,t)})}genericMDSLayout(e,t,r){return A(this,void 0,void 0,function*(){const s=Object.assign(Object.assign({},this.options),r),{center:o=[0,0],linkDistance:h=50}=s,d=t.getAllNodes(),p=t.getAllEdges();if(!(d!=null&&d.length)||d.length===1)return jn(t,e,o);const g=Ss({nodes:d,edges:p},!1),y=Ms(g);Ho(y);const O=Zo(y,h),L=qo(O),R=[];return L.forEach((F,z)=>{const C=Ze(d[z]);C.data.x=F[0]+o[0],C.data.y=F[1]+o[1],R.push(C)}),e&&R.forEach(F=>t.mergeNodeData(F.id,{x:F.data.x,y:F.data.y})),{nodes:R,edges:p}})}}const Ho=n=>{let e=-999999;n.forEach(t=>{t.forEach(r=>{r!==1/0&&e<r&&(e=r)})}),n.forEach((t,r)=>{t.forEach((s,o)=>{s===1/0&&(n[r][o]=e)})})},qo=n=>{const t=bn.mul(bn.pow(n,2),-.5),r=t.mean("row"),s=t.mean("column"),o=t.mean();t.add(o).subRowVector(r).subColumnVector(s);const h=new Ns(t),d=bn.sqrt(h.diagonalMatrix).diagonal();return h.leftSingularVectors.toJSON().map(p=>bn.mul([p],[d]).toJSON()[0].splice(0,2))};function Ts(n){return!!n.tick&&!!n.stop}const ta={gForce:!0,force2:!0,d3force:!0,fruchterman:!0,forceAtlas2:!0,force:!0,"graphin-force":!0},ea={center:[0,0],comboPadding:10,treeKey:"combo"};class na{constructor(e={}){this.options=e,this.id="comboCombined",this.options=Object.assign(Object.assign({},ea),e)}execute(e,t){return A(this,void 0,void 0,function*(){return this.genericComboCombinedLayout(!1,e,t)})}assign(e,t){return A(this,void 0,void 0,function*(){yield this.genericComboCombinedLayout(!0,e,t)})}genericComboCombinedLayout(e,t,r){return A(this,void 0,void 0,function*(){const s=this.initVals(Object.assign(Object.assign({},this.options),r)),{center:o,treeKey:h,outerLayout:d}=s,p=t.getAllNodes().filter(J=>!J.data._isCombo),g=t.getAllNodes().filter(J=>J.data._isCombo),y=t.getAllEdges(),O=p==null?void 0:p.length;if(!O||O===1)return jn(t,e,o);const L=[],R=new Map;p.forEach(J=>{R.set(J.id,J)});const k=new Map;g.forEach(J=>{k.set(J.id,J)});const F=new Map,z=this.getInnerGraphs(t,h,R,k,y,s,F);yield Promise.all(z);const C=new Map,W=[],$=new Map;let X=!0;t.getRoots(h).forEach(J=>{const mt=F.get(J.id),Et=k.get(J.id)||R.get(J.id),jt={id:J.id,data:Object.assign(Object.assign({},J.data),{x:mt.data.x||Et.data.x,y:mt.data.y||Et.data.y,fx:mt.data.fx||Et.data.fx,fy:mt.data.fy||Et.data.fy,mass:mt.data.mass||Et.data.mass,size:mt.data.size})};W.push(jt),C.set(J.id,!0),!isNaN(jt.data.x)&&jt.data.x!==0&&!isNaN(jt.data.y)&&jt.data.y!==0?X=!1:(jt.data.x=Math.random()*100,jt.data.y=Math.random()*100),Lr(t,[J],Pt=>{Pt.id!==J.id&&$.set(Pt.id,J.id)},"TB",h)});const q=[];y.forEach(J=>{const mt=$.get(J.source)||J.source,Et=$.get(J.target)||J.target;mt!==Et&&C.has(mt)&&C.has(Et)&&q.push({id:J.id,source:mt,target:Et,data:{}})});let st;if(W!=null&&W.length){if(W.length===1)W[0].data.x=o[0],W[0].data.y=o[1];else{const J=new vt({nodes:W,edges:q}),mt=d||new xs;X&&ta[mt.id]&&(yield(W.length<100?new As:new Tr).assign(J));const Et=Object.assign({center:o,kg:5,preventOverlap:!0,animate:!1},mt.id==="force"?{gravity:1,factor:4,linkDistance:(jt,Pt,Dt)=>{const Gt=Math.max(...Pt.data.size)||32,zt=Math.max(...Dt.data.size)||32;return Gt/2+zt/2+200}}:{});st=yield js(mt,J,Et)}F.forEach(J=>{var mt;const Et=st.nodes.find(Dt=>Dt.id===J.id);if(Et){const{x:Dt,y:Gt}=Et.data;J.data.visited=!0,J.data.x=Dt,J.data.y=Gt,L.push({id:J.id,data:{x:Dt,y:Gt}})}const{x:jt,y:Pt}=J.data;(mt=J.data.nodes)===null||mt===void 0||mt.forEach(Dt=>{L.push({id:Dt.id,data:{x:Dt.data.x+jt,y:Dt.data.y+Pt}})})}),F.forEach(({data:J})=>{const{x:mt,y:Et,visited:jt,nodes:Pt}=J;Pt==null||Pt.forEach(Dt=>{if(!jt){const Gt=L.find(zt=>zt.id===Dt.id);Gt.data.x+=mt||0,Gt.data.y+=Et||0}})})}return e&&L.forEach(J=>{t.mergeNodeData(J.id,{x:J.data.x,y:J.data.y})}),{nodes:L,edges:y}})}initVals(e){const t=Object.assign({},e),{nodeSize:r,spacing:s,comboPadding:o}=e;let h,d;if($t(s)?d=()=>s:qe(s)?d=s:d=()=>0,t.spacing=d,!r)h=g=>{const y=d(g);return g.size?Ge(g.size)?((g.size[0]>g.size[1]?g.size[0]:g.size[1])+y)/2:xn(g.size)?((g.size.width>g.size.height?g.size.width:g.size.height)+y)/2:(g.size+y)/2:32+y/2};else if(qe(r))h=g=>{const y=r(g),O=d(g);return Ge(g.size)?((g.size[0]>g.size[1]?g.size[0]:g.size[1])+O)/2:((y||32)+O)/2};else if(Ge(r)){const y=(r[0]>r[1]?r[0]:r[1])/2;h=O=>y+d(O)/2}else{const g=r/2;h=y=>g+d(y)/2}t.nodeSize=h;let p;return $t(o)?p=()=>o:Ge(o)?p=()=>Math.max.apply(null,o):qe(o)?p=o:p=()=>0,t.comboPadding=p,t}getInnerGraphs(e,t,r,s,o,h,d){const{nodeSize:p,comboPadding:g,spacing:y,innerLayout:O}=h,L=O||new Tr({}),R={center:[0,0],preventOverlap:!0,nodeSpacing:y},k=[],F=z=>{let C=(g==null?void 0:g(z))||10;return Ge(C)&&(C=Math.max(...C)),{size:C?[C*2,C*2]:[30,30],padding:C}};return e.getRoots(t).forEach(z=>{d.set(z.id,{id:z.id,data:{nodes:[],size:F(z).size}});let C=Promise.resolve();Lr(e,[z],W=>{var $;if(!W.data._isCombo)return;const{size:X,padding:q}=F(W);if(!(!(($=e.getChildren(W.id,t))===null||$===void 0)&&$.length))d.set(W.id,{id:W.id,data:Object.assign(Object.assign({},W.data),{size:X})});else{const st=d.get(W.id);d.set(W.id,{id:W.id,data:Object.assign({nodes:[]},st==null?void 0:st.data)});const ut=new Map,J=e.getChildren(W.id,t).map(jt=>{if(jt.data._isCombo)return d.has(jt.id)||d.set(jt.id,{id:jt.id,data:Object.assign({},jt.data)}),ut.set(jt.id,!0),d.get(jt.id);const Pt=r.get(jt.id)||s.get(jt.id);return ut.set(jt.id,!0),{id:jt.id,data:Object.assign(Object.assign({},Pt.data),jt.data)}}),mt={nodes:J,edges:o.filter(jt=>ut.has(jt.source)&&ut.has(jt.target))};let Et=1/0;J.forEach(jt=>{var Pt;let{size:Dt}=jt.data;Dt||(Dt=((Pt=d.get(jt.id))===null||Pt===void 0?void 0:Pt.data.size)||(p==null?void 0:p(jt))||[30,30]),$t(Dt)&&(Dt=[Dt,Dt]);const[Gt,zt]=Dt;Et>Gt&&(Et=Gt),Et>zt&&(Et=zt),jt.data.size=Dt}),C=C.then(()=>A(this,void 0,void 0,function*(){const jt=new vt(mt);yield js(L,jt,R,!0);const{minX:Pt,minY:Dt,maxX:Gt,maxY:zt}=Jo(J),_t={x:(Gt+Pt)/2,y:(zt+Dt)/2};mt.nodes.forEach(bt=>{bt.data.x-=_t.x,bt.data.y-=_t.y});const le=[Math.max(Gt-Pt,Et)+q*2,Math.max(zt-Dt,Et)+q*2];d.get(W.id).data.size=le,d.get(W.id).data.nodes=J}))}return!0},"BT",t),k.push(C)}),k}}function js(n,e,t,r){var s;return A(this,void 0,void 0,function*(){return Ts(n)?(n.execute(e,t),n.stop(),n.tick((s=t.iterations)!==null&&s!==void 0?s:300)):r?yield n.assign(e,t):yield n.execute(e,t)})}var ra=function(n){return typeof n=="object"&&n!==null},sa=ra,ia={}.toString,oa=function(n,e){return ia.call(n)==="[object "+e+"]"},aa=oa,ua=function(n){if(!sa(n)||!aa(n,"Object"))return!1;if(Object.getPrototypeOf(n)===null)return!0;for(var e=n;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(n)===e},Cr=ua,ca=5;function fa(n,e){if(Object.hasOwn)return Object.hasOwn(n,e);if(n==null)throw new TypeError("Cannot convert undefined or null to object");return Object.prototype.hasOwnProperty.call(Object(n),e)}function Is(n,e,t,r){t=t||0,r=r||ca;for(var s in e)if(fa(e,s)){var o=e[s];o!==null&&Cr(o)?(Cr(n[s])||(n[s]={}),t<r?Is(n[s],o,t+1,r):n[s]=e[s]):ae(o)?(n[s]=[],n[s]=n[s].concat(o)):o!==void 0&&(n[s]=o)}}var la=function(n){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];for(var r=0;r<e.length;r+=1)Is(n,e[r]);return n},Ps=la;function da(n,e){if(n){var t;if(ae(n))for(var r=0,s=n.length;r<s&&(t=e(n[r],r),t!==!1);r++);else if(xn(n)){for(var o in n)if(n.hasOwnProperty(o)&&(t=e(n[o],o),t===!1))break}}}var ha=da,ga=Object.prototype.hasOwnProperty,Rs=function(n,e){if(n===null||!Cr(n))return{};var t={};return ha(e,function(r){ga.call(n,r)&&(t[r]=n[r])}),t};function Ce(n){return function(){return n}}function Nn(n){return(n()-.5)*1e-6}function pa(n){return n.index}function Ls(n,e){var t=n.get(e);if(!t)throw new Error("node not found: "+e);return t}function va(n){var e=pa,t=O,r,s=Ce(30),o,h,d,p,g,y=1;n==null&&(n=[]);function O(z){return 1/Math.min(d[z.source.index],d[z.target.index])}function L(z){for(var C=0,W=n.length;C<y;++C)for(var $=0,X,q,st,ut,J,mt,Et;$<W;++$)X=n[$],q=X.source,st=X.target,ut=st.x+st.vx-q.x-q.vx||Nn(g),J=st.y+st.vy-q.y-q.vy||Nn(g),mt=Math.sqrt(ut*ut+J*J),mt=(mt-o[$])/mt*z*r[$],ut*=mt,J*=mt,st.vx-=ut*(Et=p[$]),st.vy-=J*Et,q.vx+=ut*(Et=1-Et),q.vy+=J*Et}function R(){if(h){var z,C=h.length,W=n.length,$=new Map(h.map((q,st)=>[e(q,st,h),q])),X;for(z=0,d=new Array(C);z<W;++z)X=n[z],X.index=z,typeof X.source!="object"&&(X.source=Ls($,X.source)),typeof X.target!="object"&&(X.target=Ls($,X.target)),d[X.source.index]=(d[X.source.index]||0)+1,d[X.target.index]=(d[X.target.index]||0)+1;for(z=0,p=new Array(W);z<W;++z)X=n[z],p[z]=d[X.source.index]/(d[X.source.index]+d[X.target.index]);r=new Array(W),k(),o=new Array(W),F()}}function k(){if(h)for(var z=0,C=n.length;z<C;++z)r[z]=+t(n[z],z,n)}function F(){if(h)for(var z=0,C=n.length;z<C;++z)o[z]=+s(n[z],z,n)}return L.initialize=function(z,C){h=z,g=C,R()},L.links=function(z){return arguments.length?(n=z,R(),L):n},L.id=function(z){return arguments.length?(e=z,L):e},L.iterations=function(z){return arguments.length?(y=+z,L):y},L.strength=function(z){return arguments.length?(t=typeof z=="function"?z:Ce(+z),k(),L):t},L.distance=function(z){return arguments.length?(s=typeof z=="function"?z:Ce(+z),F(),L):s},L}var ma={value:()=>{}};function Cs(){for(var n=0,e=arguments.length,t={},r;n<e;++n){if(!(r=arguments[n]+"")||r in t||/[\s.]/.test(r))throw new Error("illegal type: "+r);t[r]=[]}return new er(t)}function er(n){this._=n}function ya(n,e){return n.trim().split(/^|\s+/).map(function(t){var r="",s=t.indexOf(".");if(s>=0&&(r=t.slice(s+1),t=t.slice(0,s)),t&&!e.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:r}})}er.prototype=Cs.prototype={constructor:er,on:function(n,e){var t=this._,r=ya(n+"",t),s,o=-1,h=r.length;if(arguments.length<2){for(;++o<h;)if((s=(n=r[o]).type)&&(s=wa(t[s],n.name)))return s;return}if(e!=null&&typeof e!="function")throw new Error("invalid callback: "+e);for(;++o<h;)if(s=(n=r[o]).type)t[s]=Ds(t[s],n.name,e);else if(e==null)for(s in t)t[s]=Ds(t[s],n.name,null);return this},copy:function(){var n={},e=this._;for(var t in e)n[t]=e[t].slice();return new er(n)},call:function(n,e){if((s=arguments.length-2)>0)for(var t=new Array(s),r=0,s,o;r<s;++r)t[r]=arguments[r+2];if(!this._.hasOwnProperty(n))throw new Error("unknown type: "+n);for(o=this._[n],r=0,s=o.length;r<s;++r)o[r].value.apply(e,t)},apply:function(n,e,t){if(!this._.hasOwnProperty(n))throw new Error("unknown type: "+n);for(var r=this._[n],s=0,o=r.length;s<o;++s)r[s].value.apply(e,t)}};function wa(n,e){for(var t=0,r=n.length,s;t<r;++t)if((s=n[t]).name===e)return s.value}function Ds(n,e,t){for(var r=0,s=n.length;r<s;++r)if(n[r].name===e){n[r]=ma,n=n.slice(0,r).concat(n.slice(r+1));break}return t!=null&&n.push({name:e,value:t}),n}var zs=Cs,Dn=0,$n=0,Xn=0,Fs=1e3,nr,Kn,rr=0,In=0,sr=0,_n=typeof performance=="object"&&performance.now?performance:Date,ks=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(n){setTimeout(n,17)};function Bs(){return In||(ks(xa),In=_n.now()+sr)}function xa(){In=0}function Dr(){this._call=this._time=this._next=null}Dr.prototype=zr.prototype={constructor:Dr,restart:function(n,e,t){if(typeof n!="function")throw new TypeError("callback is not a function");t=(t==null?Bs():+t)+(e==null?0:+e),!this._next&&Kn!==this&&(Kn?Kn._next=this:nr=this,Kn=this),this._call=n,this._time=t,Fr()},stop:function(){this._call&&(this._call=null,this._time=1/0,Fr())}};function zr(n,e,t){var r=new Dr;return r.restart(n,e,t),r}function Ea(){Bs(),++Dn;for(var n=nr,e;n;)(e=In-n._time)>=0&&n._call.call(void 0,e),n=n._next;--Dn}function Us(){In=(rr=_n.now())+sr,Dn=$n=0;try{Ea()}finally{Dn=0,Na(),In=0}}function ba(){var n=_n.now(),e=n-rr;e>Fs&&(sr-=e,rr=n)}function Na(){for(var n,e=nr,t,r=1/0;e;)e._call?(r>e._time&&(r=e._time),n=e,e=e._next):(t=e._next,e._next=null,e=n?n._next=t:nr=t);Kn=n,Fr(r)}function Fr(n){if(!Dn){$n&&($n=clearTimeout($n));var e=n-In;e>24?(n<1/0&&($n=setTimeout(Us,n-_n.now()-sr)),Xn&&(Xn=clearInterval(Xn))):(Xn||(rr=_n.now(),Xn=setInterval(ba,Fs)),Dn=1,ks(Us))}}const Ma=1664525,Sa=1013904223,Vs=4294967296;function Oa(){let n=1;return()=>(n=(Ma*n+Sa)%Vs)/Vs}function Aa(n){return n.x}function Ta(n){return n.y}var ja=10,Ia=Math.PI*(3-Math.sqrt(5));function Pa(n){var e,t=1,r=.001,s=1-Math.pow(r,1/300),o=0,h=.6,d=new Map,p=zr(O),g=zs("tick","end"),y=Oa();n==null&&(n=[]);function O(){L(),g.call("tick",e),t<r&&(p.stop(),g.call("end",e))}function L(F){var z,C=n.length,W;F===void 0&&(F=1);for(var $=0;$<F;++$)for(t+=(o-t)*s,d.forEach(function(X){X(t)}),z=0;z<C;++z)W=n[z],W.fx==null?W.x+=W.vx*=h:(W.x=W.fx,W.vx=0),W.fy==null?W.y+=W.vy*=h:(W.y=W.fy,W.vy=0);return e}function R(){for(var F=0,z=n.length,C;F<z;++F){if(C=n[F],C.index=F,C.fx!=null&&(C.x=C.fx),C.fy!=null&&(C.y=C.fy),isNaN(C.x)||isNaN(C.y)){var W=ja*Math.sqrt(.5+F),$=F*Ia;C.x=W*Math.cos($),C.y=W*Math.sin($)}(isNaN(C.vx)||isNaN(C.vy))&&(C.vx=C.vy=0)}}function k(F){return F.initialize&&F.initialize(n,y),F}return R(),e={tick:L,restart:function(){return p.restart(O),e},stop:function(){return p.stop(),e},nodes:function(F){return arguments.length?(n=F,R(),d.forEach(k),e):n},alpha:function(F){return arguments.length?(t=+F,e):t},alphaMin:function(F){return arguments.length?(r=+F,e):r},alphaDecay:function(F){return arguments.length?(s=+F,e):+s},alphaTarget:function(F){return arguments.length?(o=+F,e):o},velocityDecay:function(F){return arguments.length?(h=1-F,e):1-h},randomSource:function(F){return arguments.length?(y=F,d.forEach(k),e):y},force:function(F,z){return arguments.length>1?(z==null?d.delete(F):d.set(F,k(z)),e):d.get(F)},find:function(F,z,C){var W=0,$=n.length,X,q,st,ut,J;for(C==null?C=1/0:C*=C,W=0;W<$;++W)ut=n[W],X=F-ut.x,q=z-ut.y,st=X*X+q*q,st<C&&(J=ut,C=st);return J},on:function(F,z){return arguments.length>1?(g.on(F,z),e):g.on(F)}}}function Ra(){var n,e,t,r,s=Ce(-30),o,h=1,d=1/0,p=.81;function g(R){var k,F=n.length,z=Cn(n,Aa,Ta).visitAfter(O);for(r=R,k=0;k<F;++k)e=n[k],z.visit(L)}function y(){if(n){var R,k=n.length,F;for(o=new Array(k),R=0;R<k;++R)F=n[R],o[F.index]=+s(F,R,n)}}function O(R){var k=0,F,z,C=0,W,$,X;if(R.length){for(W=$=X=0;X<4;++X)(F=R[X])&&(z=Math.abs(F.value))&&(k+=F.value,C+=z,W+=z*F.x,$+=z*F.y);R.x=W/C,R.y=$/C}else{F=R,F.x=F.data.x,F.y=F.data.y;do k+=o[F.data.index];while(F=F.next)}R.value=k}function L(R,k,F,z){if(!R.value)return!0;var C=R.x-e.x,W=R.y-e.y,$=z-k,X=C*C+W*W;if($*$/p<X)return X<d&&(C===0&&(C=Nn(t),X+=C*C),W===0&&(W=Nn(t),X+=W*W),X<h&&(X=Math.sqrt(h*X)),e.vx+=C*R.value*r/X,e.vy+=W*R.value*r/X),!0;if(R.length||X>=d)return;(R.data!==e||R.next)&&(C===0&&(C=Nn(t),X+=C*C),W===0&&(W=Nn(t),X+=W*W),X<h&&(X=Math.sqrt(h*X)));do R.data!==e&&($=o[R.data.index]*r/X,e.vx+=C*$,e.vy+=W*$);while(R=R.next)}return g.initialize=function(R,k){n=R,t=k,y()},g.strength=function(R){return arguments.length?(s=typeof R=="function"?R:Ce(+R),y(),g):s},g.distanceMin=function(R){return arguments.length?(h=R*R,g):Math.sqrt(h)},g.distanceMax=function(R){return arguments.length?(d=R*R,g):Math.sqrt(d)},g.theta=function(R){return arguments.length?(p=R*R,g):Math.sqrt(p)},g}function La(n,e){var t,r=1;n==null&&(n=0),e==null&&(e=0);function s(){var o,h=t.length,d,p=0,g=0;for(o=0;o<h;++o)d=t[o],p+=d.x,g+=d.y;for(p=(p/h-n)*r,g=(g/h-e)*r,o=0;o<h;++o)d=t[o],d.x-=p,d.y-=g}return s.initialize=function(o){t=o},s.x=function(o){return arguments.length?(n=+o,s):n},s.y=function(o){return arguments.length?(e=+o,s):e},s.strength=function(o){return arguments.length?(r=+o,s):r},s}function Ca(n){return n.x+n.vx}function Da(n){return n.y+n.vy}function za(n){var e,t,r,s=1,o=1;typeof n!="function"&&(n=Ce(n==null?1:+n));function h(){for(var g,y=e.length,O,L,R,k,F,z,C=0;C<o;++C)for(O=Cn(e,Ca,Da).visitAfter(d),g=0;g<y;++g)L=e[g],F=t[L.index],z=F*F,R=L.x+L.vx,k=L.y+L.vy,O.visit(W);function W($,X,q,st,ut){var J=$.data,mt=$.r,Et=F+mt;if(J){if(J.index>L.index){var jt=R-J.x-J.vx,Pt=k-J.y-J.vy,Dt=jt*jt+Pt*Pt;Dt<Et*Et&&(jt===0&&(jt=Nn(r),Dt+=jt*jt),Pt===0&&(Pt=Nn(r),Dt+=Pt*Pt),Dt=(Et-(Dt=Math.sqrt(Dt)))/Dt*s,L.vx+=(jt*=Dt)*(Et=(mt*=mt)/(z+mt)),L.vy+=(Pt*=Dt)*Et,J.vx-=jt*(Et=1-Et),J.vy-=Pt*Et)}return}return X>R+Et||st<R-Et||q>k+Et||ut<k-Et}}function d(g){if(g.data)return g.r=t[g.data.index];for(var y=g.r=0;y<4;++y)g[y]&&g[y].r>g.r&&(g.r=g[y].r)}function p(){if(e){var g,y=e.length,O;for(t=new Array(y),g=0;g<y;++g)O=e[g],t[O.index]=+n(O,g,e)}}return h.initialize=function(g,y){e=g,r=y,p()},h.iterations=function(g){return arguments.length?(o=+g,h):o},h.strength=function(g){return arguments.length?(s=+g,h):s},h.radius=function(g){return arguments.length?(n=typeof g=="function"?g:Ce(+g),p(),h):n},h}function Fa(n,e,t){var r,s=Ce(.1),o,h;typeof n!="function"&&(n=Ce(+n)),e==null&&(e=0),t==null&&(t=0);function d(g){for(var y=0,O=r.length;y<O;++y){var L=r[y],R=L.x-e||1e-6,k=L.y-t||1e-6,F=Math.sqrt(R*R+k*k),z=(h[y]-F)*o[y]*g/F;L.vx+=R*z,L.vy+=k*z}}function p(){if(r){var g,y=r.length;for(o=new Array(y),h=new Array(y),g=0;g<y;++g)h[g]=+n(r[g],g,r),o[g]=isNaN(h[g])?0:+s(r[g],g,r)}}return d.initialize=function(g){r=g,p()},d.strength=function(g){return arguments.length?(s=typeof g=="function"?g:Ce(+g),p(),d):s},d.radius=function(g){return arguments.length?(n=typeof g=="function"?g:Ce(+g),p(),d):n},d.x=function(g){return arguments.length?(e=+g,d):e},d.y=function(g){return arguments.length?(t=+g,d):t},d}function ka(n){var e=Ce(.1),t,r,s;typeof n!="function"&&(n=Ce(n==null?0:+n));function o(d){for(var p=0,g=t.length,y;p<g;++p)y=t[p],y.vx+=(s[p]-y.x)*r[p]*d}function h(){if(t){var d,p=t.length;for(r=new Array(p),s=new Array(p),d=0;d<p;++d)r[d]=isNaN(s[d]=+n(t[d],d,t))?0:+e(t[d],d,t)}}return o.initialize=function(d){t=d,h()},o.strength=function(d){return arguments.length?(e=typeof d=="function"?d:Ce(+d),h(),o):e},o.x=function(d){return arguments.length?(n=typeof d=="function"?d:Ce(+d),h(),o):n},o}function Ba(n){var e=Ce(.1),t,r,s;typeof n!="function"&&(n=Ce(n==null?0:+n));function o(d){for(var p=0,g=t.length,y;p<g;++p)y=t[p],y.vy+=(s[p]-y.y)*r[p]*d}function h(){if(t){var d,p=t.length;for(r=new Array(p),s=new Array(p),d=0;d<p;++d)r[d]=isNaN(s[d]=+n(t[d],d,t))?0:+e(t[d],d,t)}}return o.initialize=function(d){t=d,h()},o.strength=function(d){return arguments.length?(e=typeof d=="function"?d:Ce(+d),h(),o):e},o.y=function(d){return arguments.length?(n=typeof d=="function"?d:Ce(+d),h(),o):n},o}class Gs{constructor(e){this.id="d3-force",this.config={inputNodeAttrs:["x","y","vx","vy","fx","fy"],outputNodeAttrs:["x","y","vx","vy"],simulationAttrs:["alpha","alphaMin","alphaDecay","alphaTarget","velocityDecay","randomSource"]},this.forceMap={link:va,manyBody:Ra,center:La,collide:za,radial:Fa,x:ka,y:Ba},this.options={link:{id:t=>t.id},manyBody:{},center:{x:0,y:0}},this.context={options:{},assign:!1,nodes:[],edges:[]},Ps(this.options,e),this.options.forceSimulation&&(this.simulation=this.options.forceSimulation)}execute(e,t){return A(this,void 0,void 0,function*(){return this.genericLayout(!1,e,t)})}assign(e,t){return A(this,void 0,void 0,function*(){yield this.genericLayout(!0,e,t)})}stop(){this.simulation.stop()}tick(e){return this.simulation.tick(e),this.getResult()}restart(){this.simulation.restart()}setFixedPosition(e,t){const r=this.context.nodes.find(s=>s.id===e);r&&t.forEach((s,o)=>{if(typeof s=="number"||s===null){const h=["fx","fy","fz"][o];r[h]=s}})}getOptions(e){var t,r;const s=Ps({},this.options,e);return s.collide&&((t=s.collide)===null||t===void 0?void 0:t.radius)===void 0&&(s.collide=s.collide||{},s.collide.radius=(r=s.nodeSize)!==null&&r!==void 0?r:10),s.iterations===void 0&&(s.link&&s.link.iterations===void 0&&(s.iterations=s.link.iterations),s.collide&&s.collide.iterations===void 0&&(s.iterations=s.collide.iterations)),this.context.options=s,s}genericLayout(e,t,r){var s;return A(this,void 0,void 0,function*(){const o=this.getOptions(r),h=t.getAllNodes().map(({id:y,data:O})=>Object.assign(Object.assign({id:y},O),Rs(O.data,this.config.inputNodeAttrs))),d=t.getAllEdges().map(y=>Object.assign({},y));Object.assign(this.context,{assign:e,nodes:h,edges:d,graph:t});const p=new Promise(y=>{this.resolver=y}),g=this.setSimulation(o);return g.nodes(h),(s=g.force("link"))===null||s===void 0||s.links(d),p})}getResult(){const{assign:e,nodes:t,edges:r,graph:s}=this.context,o=t.map(d=>({id:d.id,data:Object.assign(Object.assign({},d.data),Rs(d,this.config.outputNodeAttrs))})),h=r.map(({id:d,source:p,target:g,data:y})=>({id:d,source:typeof p=="object"?p.id:p,target:typeof g=="object"?g.id:g,data:y}));return e&&o.forEach(d=>s.mergeNodeData(d.id,d.data)),{nodes:o,edges:h}}initSimulation(){return Pa()}setSimulation(e){const t=this.simulation||this.options.forceSimulation||this.initSimulation();return this.simulation||(this.simulation=t.on("tick",()=>{var r;return(r=e.onTick)===null||r===void 0?void 0:r.call(e,this.getResult())}).on("end",()=>{var r;return(r=this.resolver)===null||r===void 0?void 0:r.call(this,this.getResult())})),Ws(t,this.config.simulationAttrs.map(r=>[r,e[r]])),Object.entries(this.forceMap).forEach(([r,s])=>{const o=r;if(e[r]){let h=t.force(o);h||(h=s(),t.force(o,h)),Ws(h,Object.entries(e[o]))}else t.force(o,null)}),t}}const Ws=(n,e)=>e.reduce((t,[r,s])=>!t[r]||s===void 0?t:t[r].call(n,s),n);function Ne(n){return function(){return n}}function tn(n){return(n()-.5)*1e-6}function Ua(n){return n.index}function Ys(n,e){var t=n.get(e);if(!t)throw new Error("node not found: "+e);return t}function Va(n){var e=Ua,t=L,r,s=Ne(30),o,h,d,p,g,y,O=1;n==null&&(n=[]);function L(C){return 1/Math.min(p[C.source.index],p[C.target.index])}function R(C){for(var W=0,$=n.length;W<O;++W)for(var X=0,q,st,ut,J=0,mt=0,Et=0,jt,Pt;X<$;++X)q=n[X],st=q.source,ut=q.target,J=ut.x+ut.vx-st.x-st.vx||tn(y),d>1&&(mt=ut.y+ut.vy-st.y-st.vy||tn(y)),d>2&&(Et=ut.z+ut.vz-st.z-st.vz||tn(y)),jt=Math.sqrt(J*J+mt*mt+Et*Et),jt=(jt-o[X])/jt*C*r[X],J*=jt,mt*=jt,Et*=jt,ut.vx-=J*(Pt=g[X]),d>1&&(ut.vy-=mt*Pt),d>2&&(ut.vz-=Et*Pt),st.vx+=J*(Pt=1-Pt),d>1&&(st.vy+=mt*Pt),d>2&&(st.vz+=Et*Pt)}function k(){if(h){var C,W=h.length,$=n.length,X=new Map(h.map((st,ut)=>[e(st,ut,h),st])),q;for(C=0,p=new Array(W);C<$;++C)q=n[C],q.index=C,typeof q.source!="object"&&(q.source=Ys(X,q.source)),typeof q.target!="object"&&(q.target=Ys(X,q.target)),p[q.source.index]=(p[q.source.index]||0)+1,p[q.target.index]=(p[q.target.index]||0)+1;for(C=0,g=new Array($);C<$;++C)q=n[C],g[C]=p[q.source.index]/(p[q.source.index]+p[q.target.index]);r=new Array($),F(),o=new Array($),z()}}function F(){if(h)for(var C=0,W=n.length;C<W;++C)r[C]=+t(n[C],C,n)}function z(){if(h)for(var C=0,W=n.length;C<W;++C)o[C]=+s(n[C],C,n)}return R.initialize=function(C,...W){h=C,y=W.find($=>typeof $=="function")||Math.random,d=W.find($=>[1,2,3].includes($))||2,k()},R.links=function(C){return arguments.length?(n=C,k(),R):n},R.id=function(C){return arguments.length?(e=C,R):e},R.iterations=function(C){return arguments.length?(O=+C,R):O},R.strength=function(C){return arguments.length?(t=typeof C=="function"?C:Ne(+C),F(),R):t},R.distance=function(C){return arguments.length?(s=typeof C=="function"?C:Ne(+C),z(),R):s},R}function Ga(n){const e=+this._x.call(null,n);return $s(this.cover(e),e,n)}function $s(n,e,t){if(isNaN(e))return n;var r,s=n._root,o={data:t},h=n._x0,d=n._x1,p,g,y,O,L;if(!s)return n._root=o,n;for(;s.length;)if((y=e>=(p=(h+d)/2))?h=p:d=p,r=s,!(s=s[O=+y]))return r[O]=o,n;if(g=+n._x.call(null,s.data),e===g)return o.next=s,r?r[O]=o:n._root=o,n;do r=r?r[O]=new Array(2):n._root=new Array(2),(y=e>=(p=(h+d)/2))?h=p:d=p;while((O=+y)==(L=+(g>=p)));return r[L]=s,r[O]=o,n}function Wa(n){Array.isArray(n)||(n=Array.from(n));const e=n.length,t=new Float64Array(e);let r=1/0,s=-1/0;for(let o=0,h;o<e;++o)isNaN(h=+this._x.call(null,n[o]))||(t[o]=h,h<r&&(r=h),h>s&&(s=h));if(r>s)return this;this.cover(r).cover(s);for(let o=0;o<e;++o)$s(this,t[o],n[o]);return this}function Ya(n){if(isNaN(n=+n))return this;var e=this._x0,t=this._x1;if(isNaN(e))t=(e=Math.floor(n))+1;else{for(var r=t-e||1,s=this._root,o,h;e>n||n>=t;)switch(h=+(n<e),o=new Array(2),o[h]=s,s=o,r*=2,h){case 0:t=e+r;break;case 1:e=t-r;break}this._root&&this._root.length&&(this._root=s)}return this._x0=e,this._x1=t,this}function $a(){var n=[];return this.visit(function(e){if(!e.length)do n.push(e.data);while(e=e.next)}),n}function Xa(n){return arguments.length?this.cover(+n[0][0]).cover(+n[1][0]):isNaN(this._x0)?void 0:[[this._x0],[this._x1]]}function dn(n,e,t){this.node=n,this.x0=e,this.x1=t}function Ka(n,e){var t,r=this._x0,s,o,h=this._x1,d=[],p=this._root,g,y;for(p&&d.push(new dn(p,r,h)),e==null?e=1/0:(r=n-e,h=n+e);g=d.pop();)if(!(!(p=g.node)||(s=g.x0)>h||(o=g.x1)<r))if(p.length){var O=(s+o)/2;d.push(new dn(p[1],O,o),new dn(p[0],s,O)),(y=+(n>=O))&&(g=d[d.length-1],d[d.length-1]=d[d.length-1-y],d[d.length-1-y]=g)}else{var L=Math.abs(n-+this._x.call(null,p.data));L<e&&(e=L,r=n-L,h=n+L,t=p.data)}return t}function _a(n){if(isNaN(p=+this._x.call(null,n)))return this;var e,t=this._root,r,s,o,h=this._x0,d=this._x1,p,g,y,O,L;if(!t)return this;if(t.length)for(;;){if((y=p>=(g=(h+d)/2))?h=g:d=g,e=t,!(t=t[O=+y]))return this;if(!t.length)break;e[O+1&1]&&(r=e,L=O)}for(;t.data!==n;)if(s=t,!(t=t.next))return this;return(o=t.next)&&delete t.next,s?(o?s.next=o:delete s.next,this):e?(o?e[O]=o:delete e[O],(t=e[0]||e[1])&&t===(e[1]||e[0])&&!t.length&&(r?r[L]=t:this._root=t),this):(this._root=o,this)}function Za(n){for(var e=0,t=n.length;e<t;++e)this.remove(n[e]);return this}function Ja(){return this._root}function Qa(){var n=0;return this.visit(function(e){if(!e.length)do++n;while(e=e.next)}),n}function Ha(n){var e=[],t,r=this._root,s,o,h;for(r&&e.push(new dn(r,this._x0,this._x1));t=e.pop();)if(!n(r=t.node,o=t.x0,h=t.x1)&&r.length){var d=(o+h)/2;(s=r[1])&&e.push(new dn(s,d,h)),(s=r[0])&&e.push(new dn(s,o,d))}return this}function qa(n){var e=[],t=[],r;for(this._root&&e.push(new dn(this._root,this._x0,this._x1));r=e.pop();){var s=r.node;if(s.length){var o,h=r.x0,d=r.x1,p=(h+d)/2;(o=s[0])&&e.push(new dn(o,h,p)),(o=s[1])&&e.push(new dn(o,p,d))}t.push(r)}for(;r=t.pop();)n(r.node,r.x0,r.x1);return this}function tu(n){return n[0]}function eu(n){return arguments.length?(this._x=n,this):this._x}function kr(n,e){var t=new Br(e==null?tu:e,NaN,NaN);return n==null?t:t.addAll(n)}function Br(n,e,t){this._x=n,this._x0=e,this._x1=t,this._root=void 0}function Xs(n){for(var e={data:n.data},t=e;n=n.next;)t=t.next={data:n.data};return e}var Xe=kr.prototype=Br.prototype;Xe.copy=function(){var n=new Br(this._x,this._x0,this._x1),e=this._root,t,r;if(!e)return n;if(!e.length)return n._root=Xs(e),n;for(t=[{source:e,target:n._root=new Array(2)}];e=t.pop();)for(var s=0;s<2;++s)(r=e.source[s])&&(r.length?t.push({source:r,target:e.target[s]=new Array(2)}):e.target[s]=Xs(r));return n},Xe.add=Ga,Xe.addAll=Wa,Xe.cover=Ya,Xe.data=$a,Xe.extent=Xa,Xe.find=Ka,Xe.remove=_a,Xe.removeAll=Za,Xe.root=Ja,Xe.size=Qa,Xe.visit=Ha,Xe.visitAfter=qa,Xe.x=eu;const nu=1664525,ru=1013904223,Ks=4294967296;function su(){let n=1;return()=>(n=(nu*n+ru)%Ks)/Ks}var _s=3;function Ur(n){return n.x}function Zs(n){return n.y}function iu(n){return n.z}var ou=10,au=Math.PI*(3-Math.sqrt(5)),uu=Math.PI*20/(9+Math.sqrt(221));function cu(n,e){e=e||2;var t=Math.min(_s,Math.max(1,Math.round(e))),r,s=1,o=.001,h=1-Math.pow(o,1/300),d=0,p=.6,g=new Map,y=zr(R),O=zs("tick","end"),L=su();n==null&&(n=[]);function R(){k(),O.call("tick",r),s<o&&(y.stop(),O.call("end",r))}function k(C){var W,$=n.length,X;C===void 0&&(C=1);for(var q=0;q<C;++q)for(s+=(d-s)*h,g.forEach(function(st){st(s)}),W=0;W<$;++W)X=n[W],X.fx==null?X.x+=X.vx*=p:(X.x=X.fx,X.vx=0),t>1&&(X.fy==null?X.y+=X.vy*=p:(X.y=X.fy,X.vy=0)),t>2&&(X.fz==null?X.z+=X.vz*=p:(X.z=X.fz,X.vz=0));return r}function F(){for(var C=0,W=n.length,$;C<W;++C){if($=n[C],$.index=C,$.fx!=null&&($.x=$.fx),$.fy!=null&&($.y=$.fy),$.fz!=null&&($.z=$.fz),isNaN($.x)||t>1&&isNaN($.y)||t>2&&isNaN($.z)){var X=ou*(t>2?Math.cbrt(.5+C):t>1?Math.sqrt(.5+C):C),q=C*au,st=C*uu;t===1?$.x=X:t===2?($.x=X*Math.cos(q),$.y=X*Math.sin(q)):($.x=X*Math.sin(q)*Math.cos(st),$.y=X*Math.cos(q),$.z=X*Math.sin(q)*Math.sin(st))}(isNaN($.vx)||t>1&&isNaN($.vy)||t>2&&isNaN($.vz))&&($.vx=0,t>1&&($.vy=0),t>2&&($.vz=0))}}function z(C){return C.initialize&&C.initialize(n,L,t),C}return F(),r={tick:k,restart:function(){return y.restart(R),r},stop:function(){return y.stop(),r},numDimensions:function(C){return arguments.length?(t=Math.min(_s,Math.max(1,Math.round(C))),g.forEach(z),r):t},nodes:function(C){return arguments.length?(n=C,F(),g.forEach(z),r):n},alpha:function(C){return arguments.length?(s=+C,r):s},alphaMin:function(C){return arguments.length?(o=+C,r):o},alphaDecay:function(C){return arguments.length?(h=+C,r):+h},alphaTarget:function(C){return arguments.length?(d=+C,r):d},velocityDecay:function(C){return arguments.length?(p=1-C,r):1-p},randomSource:function(C){return arguments.length?(L=C,g.forEach(z),r):L},force:function(C,W){return arguments.length>1?(W==null?g.delete(C):g.set(C,z(W)),r):g.get(C)},find:function(){var C=Array.prototype.slice.call(arguments),W=C.shift()||0,$=(t>1?C.shift():null)||0,X=(t>2?C.shift():null)||0,q=C.shift()||1/0,st=0,ut=n.length,J,mt,Et,jt,Pt,Dt;for(q*=q,st=0;st<ut;++st)Pt=n[st],J=W-Pt.x,mt=$-(Pt.y||0),Et=X-(Pt.z||0),jt=J*J+mt*mt+Et*Et,jt<q&&(Dt=Pt,q=jt);return Dt},on:function(C,W){return arguments.length>1?(O.on(C,W),r):O.on(C)}}}function fu(){var n,e,t,r,s,o=Ne(-30),h,d=1,p=1/0,g=.81;function y(k){var F,z=n.length,C=(e===1?kr(n,Ur):e===2?Cn(n,Ur,Zs):e===3?tr(n,Ur,Zs,iu):null).visitAfter(L);for(s=k,F=0;F<z;++F)t=n[F],C.visit(R)}function O(){if(n){var k,F=n.length,z;for(h=new Array(F),k=0;k<F;++k)z=n[k],h[z.index]=+o(z,k,n)}}function L(k){var F=0,z,C,W=0,$,X,q,st,ut=k.length;if(ut){for($=X=q=st=0;st<ut;++st)(z=k[st])&&(C=Math.abs(z.value))&&(F+=z.value,W+=C,$+=C*(z.x||0),X+=C*(z.y||0),q+=C*(z.z||0));F*=Math.sqrt(4/ut),k.x=$/W,e>1&&(k.y=X/W),e>2&&(k.z=q/W)}else{z=k,z.x=z.data.x,e>1&&(z.y=z.data.y),e>2&&(z.z=z.data.z);do F+=h[z.data.index];while(z=z.next)}k.value=F}function R(k,F,z,C,W){if(!k.value)return!0;var $=[z,C,W][e-1],X=k.x-t.x,q=e>1?k.y-t.y:0,st=e>2?k.z-t.z:0,ut=$-F,J=X*X+q*q+st*st;if(ut*ut/g<J)return J<p&&(X===0&&(X=tn(r),J+=X*X),e>1&&q===0&&(q=tn(r),J+=q*q),e>2&&st===0&&(st=tn(r),J+=st*st),J<d&&(J=Math.sqrt(d*J)),t.vx+=X*k.value*s/J,e>1&&(t.vy+=q*k.value*s/J),e>2&&(t.vz+=st*k.value*s/J)),!0;if(k.length||J>=p)return;(k.data!==t||k.next)&&(X===0&&(X=tn(r),J+=X*X),e>1&&q===0&&(q=tn(r),J+=q*q),e>2&&st===0&&(st=tn(r),J+=st*st),J<d&&(J=Math.sqrt(d*J)));do k.data!==t&&(ut=h[k.data.index]*s/J,t.vx+=X*ut,e>1&&(t.vy+=q*ut),e>2&&(t.vz+=st*ut));while(k=k.next)}return y.initialize=function(k,...F){n=k,r=F.find(z=>typeof z=="function")||Math.random,e=F.find(z=>[1,2,3].includes(z))||2,O()},y.strength=function(k){return arguments.length?(o=typeof k=="function"?k:Ne(+k),O(),y):o},y.distanceMin=function(k){return arguments.length?(d=k*k,y):Math.sqrt(d)},y.distanceMax=function(k){return arguments.length?(p=k*k,y):Math.sqrt(p)},y.theta=function(k){return arguments.length?(g=k*k,y):Math.sqrt(g)},y}function lu(n,e,t){var r,s=1;n==null&&(n=0),e==null&&(e=0),t==null&&(t=0);function o(){var h,d=r.length,p,g=0,y=0,O=0;for(h=0;h<d;++h)p=r[h],g+=p.x||0,y+=p.y||0,O+=p.z||0;for(g=(g/d-n)*s,y=(y/d-e)*s,O=(O/d-t)*s,h=0;h<d;++h)p=r[h],g&&(p.x-=g),y&&(p.y-=y),O&&(p.z-=O)}return o.initialize=function(h){r=h},o.x=function(h){return arguments.length?(n=+h,o):n},o.y=function(h){return arguments.length?(e=+h,o):e},o.z=function(h){return arguments.length?(t=+h,o):t},o.strength=function(h){return arguments.length?(s=+h,o):s},o}function Vr(n){return n.x+n.vx}function Js(n){return n.y+n.vy}function du(n){return n.z+n.vz}function hu(n){var e,t,r,s,o=1,h=1;typeof n!="function"&&(n=Ne(n==null?1:+n));function d(){for(var y,O=e.length,L,R,k,F,z,C,W,$=0;$<h;++$)for(L=(t===1?kr(e,Vr):t===2?Cn(e,Vr,Js):t===3?tr(e,Vr,Js,du):null).visitAfter(p),y=0;y<O;++y)R=e[y],C=r[R.index],W=C*C,k=R.x+R.vx,t>1&&(F=R.y+R.vy),t>2&&(z=R.z+R.vz),L.visit(X);function X(q,st,ut,J,mt,Et,jt){var Pt=[st,ut,J,mt,Et,jt],Dt=Pt[0],Gt=Pt[1],zt=Pt[2],_t=Pt[t],le=Pt[t+1],bt=Pt[t+2],kt=q.data,Qt=q.r,Xt=C+Qt;if(kt){if(kt.index>R.index){var ie=k-kt.x-kt.vx,de=t>1?F-kt.y-kt.vy:0,Jt=t>2?z-kt.z-kt.vz:0,oe=ie*ie+de*de+Jt*Jt;oe<Xt*Xt&&(ie===0&&(ie=tn(s),oe+=ie*ie),t>1&&de===0&&(de=tn(s),oe+=de*de),t>2&&Jt===0&&(Jt=tn(s),oe+=Jt*Jt),oe=(Xt-(oe=Math.sqrt(oe)))/oe*o,R.vx+=(ie*=oe)*(Xt=(Qt*=Qt)/(W+Qt)),t>1&&(R.vy+=(de*=oe)*Xt),t>2&&(R.vz+=(Jt*=oe)*Xt),kt.vx-=ie*(Xt=1-Xt),t>1&&(kt.vy-=de*Xt),t>2&&(kt.vz-=Jt*Xt))}return}return Dt>k+Xt||_t<k-Xt||t>1&&(Gt>F+Xt||le<F-Xt)||t>2&&(zt>z+Xt||bt<z-Xt)}}function p(y){if(y.data)return y.r=r[y.data.index];for(var O=y.r=0;O<Math.pow(2,t);++O)y[O]&&y[O].r>y.r&&(y.r=y[O].r)}function g(){if(e){var y,O=e.length,L;for(r=new Array(O),y=0;y<O;++y)L=e[y],r[L.index]=+n(L,y,e)}}return d.initialize=function(y,...O){e=y,s=O.find(L=>typeof L=="function")||Math.random,t=O.find(L=>[1,2,3].includes(L))||2,g()},d.iterations=function(y){return arguments.length?(h=+y,d):h},d.strength=function(y){return arguments.length?(o=+y,d):o},d.radius=function(y){return arguments.length?(n=typeof y=="function"?y:Ne(+y),g(),d):n},d}function gu(n,e,t,r){var s,o,h=Ne(.1),d,p;typeof n!="function"&&(n=Ne(+n)),e==null&&(e=0),t==null&&(t=0),r==null&&(r=0);function g(O){for(var L=0,R=s.length;L<R;++L){var k=s[L],F=k.x-e||1e-6,z=(k.y||0)-t||1e-6,C=(k.z||0)-r||1e-6,W=Math.sqrt(F*F+z*z+C*C),$=(p[L]-W)*d[L]*O/W;k.vx+=F*$,o>1&&(k.vy+=z*$),o>2&&(k.vz+=C*$)}}function y(){if(s){var O,L=s.length;for(d=new Array(L),p=new Array(L),O=0;O<L;++O)p[O]=+n(s[O],O,s),d[O]=isNaN(p[O])?0:+h(s[O],O,s)}}return g.initialize=function(O,...L){s=O,o=L.find(R=>[1,2,3].includes(R))||2,y()},g.strength=function(O){return arguments.length?(h=typeof O=="function"?O:Ne(+O),y(),g):h},g.radius=function(O){return arguments.length?(n=typeof O=="function"?O:Ne(+O),y(),g):n},g.x=function(O){return arguments.length?(e=+O,g):e},g.y=function(O){return arguments.length?(t=+O,g):t},g.z=function(O){return arguments.length?(r=+O,g):r},g}function pu(n){var e=Ne(.1),t,r,s;typeof n!="function"&&(n=Ne(n==null?0:+n));function o(d){for(var p=0,g=t.length,y;p<g;++p)y=t[p],y.vx+=(s[p]-y.x)*r[p]*d}function h(){if(t){var d,p=t.length;for(r=new Array(p),s=new Array(p),d=0;d<p;++d)r[d]=isNaN(s[d]=+n(t[d],d,t))?0:+e(t[d],d,t)}}return o.initialize=function(d){t=d,h()},o.strength=function(d){return arguments.length?(e=typeof d=="function"?d:Ne(+d),h(),o):e},o.x=function(d){return arguments.length?(n=typeof d=="function"?d:Ne(+d),h(),o):n},o}function vu(n){var e=Ne(.1),t,r,s;typeof n!="function"&&(n=Ne(n==null?0:+n));function o(d){for(var p=0,g=t.length,y;p<g;++p)y=t[p],y.vy+=(s[p]-y.y)*r[p]*d}function h(){if(t){var d,p=t.length;for(r=new Array(p),s=new Array(p),d=0;d<p;++d)r[d]=isNaN(s[d]=+n(t[d],d,t))?0:+e(t[d],d,t)}}return o.initialize=function(d){t=d,h()},o.strength=function(d){return arguments.length?(e=typeof d=="function"?d:Ne(+d),h(),o):e},o.y=function(d){return arguments.length?(n=typeof d=="function"?d:Ne(+d),h(),o):n},o}function mu(n){var e=Ne(.1),t,r,s;typeof n!="function"&&(n=Ne(n==null?0:+n));function o(d){for(var p=0,g=t.length,y;p<g;++p)y=t[p],y.vz+=(s[p]-y.z)*r[p]*d}function h(){if(t){var d,p=t.length;for(r=new Array(p),s=new Array(p),d=0;d<p;++d)r[d]=isNaN(s[d]=+n(t[d],d,t))?0:+e(t[d],d,t)}}return o.initialize=function(d){t=d,h()},o.strength=function(d){return arguments.length?(e=typeof d=="function"?d:Ne(+d),h(),o):e},o.z=function(d){return arguments.length?(n=typeof d=="function"?d:Ne(+d),h(),o):n},o}class yu extends Gs{constructor(){super(...arguments),this.id="d3-force-3d",this.config={inputNodeAttrs:["x","y","z","vx","vy","vz","fx","fy","fz"],outputNodeAttrs:["x","y","z","vx","vy","vz"],simulationAttrs:["alpha","alphaMin","alphaDecay","alphaTarget","velocityDecay","randomSource","numDimensions"]},this.forceMap={link:Va,manyBody:fu,center:lu,collide:hu,radial:gu,x:pu,y:vu,z:mu},this.options={numDimensions:3,link:{id:e=>e.id},manyBody:{},center:{x:0,y:0,z:0}}}initSimulation(){return cu()}}var Qs=me(92546),wu=me.n(Qs);function xu(n){if(!n)return[0,0,0];if($t(n))return[n,n,n];if(n.length===0)return[0,0,0];const[e,t=e,r=e]=n;return[e,t,r]}class ir{constructor(e){this.id="dagre",this.options={},Object.assign(this.options,ir.defaultOptions,e)}execute(e,t){return A(this,void 0,void 0,function*(){return this.genericDagreLayout(!1,e,Object.assign(Object.assign({},this.options),t))})}assign(e,t){return A(this,void 0,void 0,function*(){yield this.genericDagreLayout(!0,e,Object.assign(Object.assign({},this.options),t))})}genericDagreLayout(e,t,r){return A(this,void 0,void 0,function*(){const{nodeSize:s}=r,o=new Qs.graphlib.Graph;o.setGraph(r),o.setDefaultEdgeLabel(()=>({}));const h=t.getAllNodes(),d=t.getAllEdges();[...h,...d].some(({id:g})=>$t(g))&&console.error("Dagre layout only support string id, it will convert number to string."),t.getAllNodes().forEach(g=>{const{id:y}=g,O=Object.assign({},g.data);if(s!==void 0){const[L,R]=xu(qe(s)?s(g):s);Object.assign(O,{width:L,height:R})}o.setNode(y.toString(),O)}),t.getAllEdges().forEach(({id:g,source:y,target:O})=>{o.setEdge(y.toString(),O.toString(),{id:g})}),wu().layout(o);const p={nodes:[],edges:[]};return o.nodes().forEach(g=>{const y=o.node(g);p.nodes.push({id:g,data:y}),e&&t.mergeNodeData(g,y)}),o.edges().forEach(g=>{const y=o.edge(g),{id:O}=y,L=f(y,["id"]),{v:R,w:k}=g;p.edges.push({id:O,source:R,target:k,data:L}),e&&t.mergeEdgeData(O,L)}),p})}}ir.defaultOptions={};class Gr{constructor(e){this.id=e.id||0,this.rx=e.rx,this.ry=e.ry,this.fx=0,this.fy=0,this.mass=e.mass,this.degree=e.degree,this.g=e.g||0}distanceTo(e){const t=this.rx-e.rx,r=this.ry-e.ry;return Math.hypot(t,r)}setPos(e,t){this.rx=e,this.ry=t}resetForce(){this.fx=0,this.fy=0}addForce(e){const t=e.rx-this.rx,r=e.ry-this.ry;let s=Math.hypot(t,r);s=s<1e-4?1e-4:s;const o=this.g*(this.degree+1)*(e.degree+1)/s;this.fx+=o*t/s,this.fy+=o*r/s}in(e){return e.contains(this.rx,this.ry)}add(e){const t=this.mass+e.mass,r=(this.rx*this.mass+e.rx*e.mass)/t,s=(this.ry*this.mass+e.ry*e.mass)/t,o=this.degree+e.degree,h={rx:r,ry:s,mass:t,degree:o};return new Gr(h)}}class zn{constructor(e){this.xmid=e.xmid,this.ymid=e.ymid,this.length=e.length,this.massCenter=e.massCenter||[0,0],this.mass=e.mass||1}getLength(){return this.length}contains(e,t){const r=this.length/2;return e<=this.xmid+r&&e>=this.xmid-r&&t<=this.ymid+r&&t>=this.ymid-r}NW(){const e=this.xmid-this.length/4,t=this.ymid+this.length/4,r=this.length/2,s={xmid:e,ymid:t,length:r};return new zn(s)}NE(){const e=this.xmid+this.length/4,t=this.ymid+this.length/4,r=this.length/2,s={xmid:e,ymid:t,length:r};return new zn(s)}SW(){const e=this.xmid-this.length/4,t=this.ymid-this.length/4,r=this.length/2,s={xmid:e,ymid:t,length:r};return new zn(s)}SE(){const e=this.xmid+this.length/4,t=this.ymid-this.length/4,r=this.length/2,s={xmid:e,ymid:t,length:r};return new zn(s)}}class Fn{constructor(e){this.body=null,this.quad=null,this.NW=null,this.NE=null,this.SW=null,this.SE=null,this.theta=.5,e!=null&&(this.quad=e)}insert(e){if(this.body==null){this.body=e;return}this._isExternal()?(this.quad&&(this.NW=new Fn(this.quad.NW()),this.NE=new Fn(this.quad.NE()),this.SW=new Fn(this.quad.SW()),this.SE=new Fn(this.quad.SE())),this._putBody(this.body),this._putBody(e),this.body=this.body.add(e)):(this.body=this.body.add(e),this._putBody(e))}_putBody(e){this.quad&&(e.in(this.quad.NW())&&this.NW?this.NW.insert(e):e.in(this.quad.NE())&&this.NE?this.NE.insert(e):e.in(this.quad.SW())&&this.SW?this.SW.insert(e):e.in(this.quad.SE())&&this.SE&&this.SE.insert(e))}_isExternal(){return this.NW==null&&this.NE==null&&this.SW==null&&this.SE==null}updateForce(e){if(!(this.body==null||e===this.body))if(this._isExternal())e.addForce(this.body);else{const t=this.quad?this.quad.getLength():0,r=this.body.distanceTo(e);t/r<this.theta?e.addForce(this.body):(this.NW&&this.NW.updateForce(e),this.NE&&this.NE.updateForce(e),this.SW&&this.SW.updateForce(e),this.SE&&this.SE.updateForce(e))}}}const Eu={center:[0,0],width:300,height:300,kr:5,kg:1,mode:"normal",preventOverlap:!1,dissuadeHubs:!1,maxIteration:0,ks:.1,ksmax:10,tao:.1};class bu{constructor(e={}){this.options=e,this.id="forceAtlas2",this.options=Object.assign(Object.assign({},Eu),e)}execute(e,t){return A(this,void 0,void 0,function*(){return this.genericForceAtlas2Layout(!1,e,t)})}assign(e,t){return A(this,void 0,void 0,function*(){yield this.genericForceAtlas2Layout(!0,e,t)})}genericForceAtlas2Layout(e,t,r){return A(this,void 0,void 0,function*(){const s=t.getAllEdges(),o=t.getAllNodes(),h=this.formatOptions(r,o.length),{width:d,height:p,prune:g,maxIteration:y,nodeSize:O,center:L}=h;if(!(o!=null&&o.length)||o.length===1)return jn(t,e,L);const R=o.map(C=>Ze(C,[d,p])),k=s.filter(C=>{const{source:W,target:$}=C;return W!==$}),F=new vt({nodes:R,edges:k}),z=this.getSizes(F,t,O);if(this.run(F,t,y,z,e,h),g){for(let W=0;W<k.length;W+=1){const{source:$,target:X}=k[W],q=F.getDegree($),st=F.getDegree($);if(q<=1){const ut=F.getNode(X);F.mergeNodeData($,{x:ut.data.x,y:ut.data.y})}else if(st<=1){const ut=F.getNode($);F.mergeNodeData(X,{x:ut.data.x,y:ut.data.y})}}const C=Object.assign(Object.assign({},h),{prune:!1,barnesHut:!1});this.run(F,t,100,z,e,C)}return{nodes:R,edges:s}})}getSizes(e,t,r){const s=e.getAllNodes(),o={};for(let h=0;h<s.length;h+=1){const{id:d,data:p}=s[h];if(o[d]=10,$t(p.size))o[d]=p.size;else if(Ge(p.size))isNaN(p.size[0])||(o[d]=Math.max(p.size[0])),isNaN(p.size[1])||(o[d]=Math.max(p.size[1]));else if(xn(p.size))o[d]=Math.max(p.size.width,p.size.height);else if(qe(r)){const g=t.getNode(d),y=r(g);Ge(y)?o[d]=Math.max(...y):o[d]=y}else Ge(r)?o[d]=Math.max(...r):$t(r)&&(o[d]=r)}return o}formatOptions(e={},t){const r=Object.assign(Object.assign({},this.options),e),{center:s,width:o,height:h,barnesHut:d,prune:p,maxIteration:g,kr:y,kg:O}=r;return r.width=!o&&typeof window!="undefined"?window.innerWidth:o,r.height=!h&&typeof window!="undefined"?window.innerHeight:h,r.center=s||[r.width/2,r.height/2],d===void 0&&t>250&&(r.barnesHut=!0),p===void 0&&t>100&&(r.prune=!0),g===0&&!p?(r.maxIteration=250,t<=200&&t>100?r.maxIteration=1e3:t>200&&(r.maxIteration=1200)):g===0&&p&&(r.maxIteration=100,t<=200&&t>100?r.maxIteration=500:t>200&&(r.maxIteration=950)),y||(r.kr=50,t>100&&t<=500?r.kr=20:t>500&&(r.kr=1)),O||(r.kg=20,t>100&&t<=500?r.kg=10:t>500&&(r.kg=1)),r}run(e,t,r,s,o,h){const{kr:d,barnesHut:p,onTick:g}=h,y=e.getAllNodes();let O=0,L=r;const R={},k={},F={};for(let z=0;z<y.length;z+=1){const{data:C,id:W}=y[z];if(R[W]=[0,0],p){const $={id:z,rx:C.x,ry:C.y,mass:1,g:d,degree:e.getDegree(W)};F[W]=new Gr($)}}for(;L>0;)O=this.oneStep(e,{iter:L,preventOverlapIters:50,krPrime:100,sg:O,forces:R,preForces:k,bodies:F,sizes:s},h),L--,g==null||g({nodes:y,edges:t.getAllEdges()});return e}oneStep(e,t,r){const{iter:s,preventOverlapIters:o,krPrime:h,sg:d,preForces:p,bodies:g,sizes:y}=t;let{forces:O}=t;const{preventOverlap:L,barnesHut:R}=r,k=e.getAllNodes();for(let F=0;F<k.length;F+=1){const{id:z}=k[F];p[z]=[...O[z]],O[z]=[0,0]}return O=this.getAttrForces(e,s,o,y,O,r),R&&(L&&s>o||!L)?O=this.getOptRepGraForces(e,O,g,r):O=this.getRepGraForces(e,s,o,O,h,y,r),this.updatePos(e,O,p,d,r)}getAttrForces(e,t,r,s,o,h){const{preventOverlap:d,dissuadeHubs:p,mode:g,prune:y}=h,O=e.getAllEdges();for(let L=0;L<O.length;L+=1){const{source:R,target:k}=O[L],F=e.getNode(R),z=e.getNode(k),C=e.getDegree(R),W=e.getDegree(k);if(y&&(C<=1||W<=1))continue;const $=[z.data.x-F.data.x,z.data.y-F.data.y];let X=Math.hypot($[0],$[1]);X=X<1e-4?1e-4:X,$[0]=$[0]/X,$[1]=$[1]/X,d&&t<r&&(X=X-s[R]-s[k]);let q=X,st=q;g==="linlog"&&(q=Math.log(1+X),st=q),p&&(q=X/C,st=X/W),d&&t<r&&X<=0?(q=0,st=0):d&&t<r&&X>0&&(q=X,st=X),o[R][0]+=q*$[0],o[k][0]-=st*$[0],o[R][1]+=q*$[1],o[k][1]-=st*$[1]}return o}getOptRepGraForces(e,t,r,s){const{kg:o,center:h,prune:d}=s,p=e.getAllNodes(),g=p.length;let y=9e10,O=-9e10,L=9e10,R=-9e10;for(let W=0;W<g;W+=1){const{id:$,data:X}=p[W];d&&e.getDegree($)<=1||(r[$].setPos(X.x,X.y),X.x>=O&&(O=X.x),X.x<=y&&(y=X.x),X.y>=R&&(R=X.y),X.y<=L&&(L=X.y))}const k=Math.max(O-y,R-L),F={xmid:(O+y)/2,ymid:(R+L)/2,length:k,massCenter:h,mass:g},z=new zn(F),C=new Fn(z);for(let W=0;W<g;W+=1){const{id:$}=p[W];d&&e.getDegree($)<=1||r[$].in(z)&&C.insert(r[$])}for(let W=0;W<g;W+=1){const{id:$,data:X}=p[W],q=e.getDegree($);if(d&&q<=1)continue;r[$].resetForce(),C.updateForce(r[$]),t[$][0]-=r[$].fx,t[$][1]-=r[$].fy;const st=[X.x-h[0],X.y-h[1]];let ut=Math.hypot(st[0],st[1]);ut=ut<1e-4?1e-4:ut,st[0]=st[0]/ut,st[1]=st[1]/ut;const J=o*(q+1);t[$][0]-=J*st[0],t[$][1]-=J*st[1]}return t}getRepGraForces(e,t,r,s,o,h,d){const{preventOverlap:p,kr:g,kg:y,center:O,prune:L}=d,R=e.getAllNodes(),k=R.length;for(let F=0;F<k;F+=1){const z=R[F],C=e.getDegree(z.id);for(let q=F+1;q<k;q+=1){const st=R[q],ut=e.getDegree(st.id);if(L&&(C<=1||ut<=1))continue;const J=[st.data.x-z.data.x,st.data.y-z.data.y];let mt=Math.hypot(J[0],J[1]);mt=mt<1e-4?1e-4:mt,J[0]=J[0]/mt,J[1]=J[1]/mt,p&&t<r&&(mt=mt-h[z.id]-h[st.id]);let Et=g*(C+1)*(ut+1)/mt;p&&t<r&&mt<0?Et=o*(C+1)*(ut+1):p&&t<r&&mt===0?Et=0:p&&t<r&&mt>0&&(Et=g*(C+1)*(ut+1)/mt),s[z.id][0]-=Et*J[0],s[st.id][0]+=Et*J[0],s[z.id][1]-=Et*J[1],s[st.id][1]+=Et*J[1]}const W=[z.data.x-O[0],z.data.y-O[1]],$=Math.hypot(W[0],W[1]);W[0]=W[0]/$,W[1]=W[1]/$;const X=y*(C+1);s[z.id][0]-=X*W[0],s[z.id][1]-=X*W[1]}return s}updatePos(e,t,r,s,o){const{ks:h,tao:d,prune:p,ksmax:g}=o,y=e.getAllNodes(),O=y.length,L=[],R=[];let k=0,F=0,z=s;for(let W=0;W<O;W+=1){const{id:$}=y[W],X=e.getDegree($);if(p&&X<=1)continue;const q=[t[$][0]-r[$][0],t[$][1]-r[$][1]],st=Math.hypot(q[0],q[1]),ut=[t[$][0]+r[$][0],t[$][1]+r[$][1]],J=Math.hypot(ut[0],ut[1]);L[W]=st,R[W]=J/2,k+=(X+1)*L[W],F+=(X+1)*R[W]}const C=z;z=d*F/k,C!==0&&(z=z>1.5*C?1.5*C:z);for(let W=0;W<O;W+=1){const{id:$,data:X}=y[W],q=e.getDegree($);if(p&&q<=1||$t(X.fx)&&$t(X.fy))continue;let st=h*z/(1+z*Math.sqrt(L[W])),ut=Math.hypot(t[$][0],t[$][1]);ut=ut<1e-4?1e-4:ut;const J=g/ut;st=st>J?J:st;const mt=st*t[$][0],Et=st*t[$][1];e.mergeNodeData($,{x:X.x+mt,y:X.y+Et})}return z}}const Nu={maxIteration:1e3,gravity:10,speed:5,clustering:!1,clusterGravity:10,width:300,height:300,nodeClusterBy:"cluster"},Mu=800;class Su{constructor(e={}){this.options=e,this.id="fruchterman",this.timeInterval=0,this.running=!1,this.options=Object.assign(Object.assign({},Nu),e)}execute(e,t){return A(this,void 0,void 0,function*(){return this.genericFruchtermanLayout(!1,e,t)})}assign(e,t){return A(this,void 0,void 0,function*(){yield this.genericFruchtermanLayout(!0,e,t)})}stop(){this.timeInterval&&typeof window!="undefined"&&window.clearInterval(this.timeInterval),this.running=!1}tick(e=this.options.maxIteration||1){if(this.lastResult)return this.lastResult;for(let r=0;r<e;r++)this.runOneStep(this.lastGraph,this.lastClusterMap,this.lastOptions);const t={nodes:this.lastLayoutNodes,edges:this.lastLayoutEdges};return this.lastAssign&&t.nodes.forEach(r=>this.lastGraph.mergeNodeData(r.id,{x:r.data.x,y:r.data.y,z:this.options.dimensions===3?r.data.z:void 0})),t}genericFruchtermanLayout(e,t,r){return A(this,void 0,void 0,function*(){if(this.running)return;const s=this.formatOptions(r),{dimensions:o,width:h,height:d,center:p,clustering:g,nodeClusterBy:y,maxIteration:O,onTick:L}=s,R=t.getAllNodes(),k=t.getAllEdges();if(!(R!=null&&R.length)){const $={nodes:[],edges:k};return this.lastResult=$,$}if(R.length===1){e&&t.mergeNodeData(R[0].id,{x:p[0],y:p[1],z:o===3?p[2]:void 0});const $={nodes:[Object.assign(Object.assign({},R[0]),{data:Object.assign(Object.assign({},R[0].data),{x:p[0],y:p[1],z:o===3?p[2]:void 0})})],edges:k};return this.lastResult=$,$}const F=R.map($=>Ze($,[h,d])),z=new vt({nodes:F,edges:k}),C={};if(g&&F.forEach($=>{const X=$.data[y];C[X]||(C[X]={name:X,cx:0,cy:0,count:0})}),this.lastLayoutNodes=F,this.lastLayoutEdges=k,this.lastAssign=e,this.lastGraph=z,this.lastOptions=s,this.lastClusterMap=C,typeof window=="undefined")return;let W=0;return new Promise($=>{this.timeInterval=window.setInterval(()=>{if(!this.running){$({nodes:F,edges:k});return}this.runOneStep(z,C,s),e&&F.forEach(({id:X,data:q})=>t.mergeNodeData(X,{x:q.x,y:q.y,z:o===3?q.z:void 0})),L==null||L({nodes:F,edges:k}),W++,W>=O&&(window.clearInterval(this.timeInterval),$({nodes:F,edges:k}))},0),this.running=!0})})}formatOptions(e={}){const t=Object.assign(Object.assign({},this.options),e),{clustering:r,nodeClusterBy:s}=t,{center:o,width:h,height:d}=t;return t.width=!h&&typeof window!="undefined"?window.innerWidth:h,t.height=!d&&typeof window!="undefined"?window.innerHeight:d,t.center=o||[t.width/2,t.height/2],t.clustering=r&&!!s,t}runOneStep(e,t,r){const{dimensions:s,height:o,width:h,gravity:d,center:p,speed:g,clustering:y,nodeClusterBy:O,clusterGravity:L}=r,R=o*h,k=Math.sqrt(R)/10,F=e.getAllNodes(),z=R/(F.length+1),C=Math.sqrt(z),W={};if(this.applyCalculate(e,W,C,z),y){for(const X in t)t[X].cx=0,t[X].cy=0,t[X].count=0;F.forEach(X=>{const{data:q}=X,st=t[q[O]];$t(q.x)&&(st.cx+=q.x),$t(q.y)&&(st.cy+=q.y),st.count++});for(const X in t)t[X].cx/=t[X].count,t[X].cy/=t[X].count;const $=L||d;F.forEach((X,q)=>{const{id:st,data:ut}=X;if(!$t(ut.x)||!$t(ut.y))return;const J=t[ut[O]],mt=Math.sqrt((ut.x-J.cx)*(ut.x-J.cx)+(ut.y-J.cy)*(ut.y-J.cy)),Et=C*$;W[st].x-=Et*(ut.x-J.cx)/mt,W[st].y-=Et*(ut.y-J.cy)/mt})}F.forEach(($,X)=>{const{id:q,data:st}=$;if(!$t(st.x)||!$t(st.y))return;const ut=.01*C*d;W[q].x-=ut*(st.x-p[0]),W[q].y-=ut*(st.y-p[1]),s===3&&(W[q].z-=ut*(st.z-p[2]))}),F.forEach(($,X)=>{const{id:q,data:st}=$;if($t(st.fx)&&$t(st.fy)){st.x=st.fx,st.y=st.fy,s===3&&(st.z=st.fz);return}if(!$t(st.x)||!$t(st.y))return;const ut=Math.sqrt(W[q].x*W[q].x+W[q].y*W[q].y+(s===3?W[q].z*W[q].z:0));if(ut>0){const J=Math.min(k*(g/Mu),ut);e.mergeNodeData(q,{x:st.x+W[q].x/ut*J,y:st.y+W[q].y/ut*J,z:s===3?st.z+W[q].z/ut*J:void 0})}})}applyCalculate(e,t,r,s){this.calRepulsive(e,t,s),this.calAttractive(e,t,r)}calRepulsive(e,t,r){const s=e.getAllNodes();s.forEach(({data:o,id:h},d)=>{t[h]={x:0,y:0,z:0},s.forEach(({data:p,id:g},y)=>{if(d<=y||!$t(o.x)||!$t(p.x)||!$t(o.y)||!$t(p.y))return;let O=o.x-p.x,L=o.y-p.y,R=this.options.dimensions===3?o.z-p.z:0,k=O*O+L*L+R*R;k===0&&(k=1,O=.01,L=.01,R=.01);const F=r/k,z=O*F,C=L*F,W=R*F;t[h].x+=z,t[h].y+=C,t[g].x-=z,t[g].y-=C,this.options.dimensions===3&&(t[h].z+=W,t[g].z-=W)})})}calAttractive(e,t,r){e.getAllEdges().forEach(o=>{const{source:h,target:d}=o;if(!h||!d||h===d)return;const{data:p}=e.getNode(h),{data:g}=e.getNode(d);if(!$t(g.x)||!$t(p.x)||!$t(g.y)||!$t(p.y))return;const y=g.x-p.x,O=g.y-p.y,L=this.options.dimensions===3?g.z-p.z:0,R=Math.sqrt(y*y+O*O+L*L)/r,k=y*R,F=O*R,z=L*R;t[h].x+=k,t[h].y+=F,t[d].x-=k,t[d].y-=F,this.options.dimensions===3&&(t[h].z+=z,t[d].z-=z)})}}const Ou={begin:[0,0],preventOverlap:!0,preventOverlapPadding:10,condense:!1,rows:void 0,cols:void 0,position:void 0,sortBy:"degree",nodeSize:30,width:300,height:300};class Au{constructor(e={}){this.options=e,this.id="grid",this.options=Object.assign(Object.assign({},Ou),e)}execute(e,t){return A(this,void 0,void 0,function*(){return this.genericGridLayout(!1,e,t)})}assign(e,t){return A(this,void 0,void 0,function*(){yield this.genericGridLayout(!0,e,t)})}genericGridLayout(e,t,r){return A(this,void 0,void 0,function*(){const s=Object.assign(Object.assign({},this.options),r),{begin:o=[0,0],condense:h,preventOverlapPadding:d,preventOverlap:p,rows:g,cols:y,nodeSpacing:O,nodeSize:L,width:R,height:k,position:F}=s;let{sortBy:z}=s;const C=t.getAllNodes(),W=t.getAllEdges(),$=C==null?void 0:C.length;if(!$||$===1)return jn(t,e,o);const X=C.map(zt=>Ze(zt));z!=="id"&&(!Yn(z)||X[0].data[z]===void 0)&&(z="degree"),z==="degree"?X.sort((zt,_t)=>t.getDegree(_t.id,"both")-t.getDegree(zt.id,"both")):z==="id"?X.sort((zt,_t)=>$t(_t.id)&&$t(zt.id)?_t.id-zt.id:`${zt.id}`.localeCompare(`${_t.id}`)):X.sort((zt,_t)=>_t.data[z]-zt.data[z]);const q=!R&&typeof window!="undefined"?window.innerWidth:R,st=!k&&typeof window!="undefined"?window.innerHeight:k,ut=$,J={rows:g,cols:y};if(g!=null&&y!=null)J.rows=g,J.cols=y;else if(g!=null&&y==null)J.rows=g,J.cols=Math.ceil(ut/J.rows);else if(g==null&&y!=null)J.cols=y,J.rows=Math.ceil(ut/J.cols);else{const zt=Math.sqrt(ut*st/q);J.rows=Math.round(zt),J.cols=Math.round(q/st*zt)}if(J.rows=Math.max(J.rows,1),J.cols=Math.max(J.cols,1),J.cols*J.rows>ut){const zt=or(J),_t=ar(J);(zt-1)*_t>=ut?or(J,zt-1):(_t-1)*zt>=ut&&ar(J,_t-1)}else for(;J.cols*J.rows<ut;){const zt=or(J),_t=ar(J);(_t+1)*zt>=ut?ar(J,_t+1):or(J,zt+1)}let mt=h?0:q/J.cols,Et=h?0:st/J.rows;if(p||O){const zt=En(10,O),_t=hs(30,L,!1);X.forEach(le=>{(!le.data.x||!le.data.y)&&(le.data.x=0,le.data.y=0);const bt=t.getNode(le.id),kt=_t(bt)||30;let Qt,Xt;Ge(kt)?(Qt=kt[0],Xt=kt[1]):(Qt=kt,Xt=kt);const ie=zt!==void 0?zt(le):d,de=Qt+ie,Jt=Xt+ie;mt=Math.max(mt,de),Et=Math.max(Et,Jt)})}const jt={},Pt={row:0,col:0},Dt={};for(let zt=0;zt<X.length;zt++){const _t=X[zt];let le;if(F&&(le=F(t.getNode(_t.id))),le&&(le.row!==void 0||le.col!==void 0)){const bt={row:le.row,col:le.col};if(bt.col===void 0)for(bt.col=0;Wr(jt,bt);)bt.col++;else if(bt.row===void 0)for(bt.row=0;Wr(jt,bt);)bt.row++;Dt[_t.id]=bt,Hs(jt,bt)}Tu(_t,o,mt,Et,Dt,J,Pt,jt)}const Gt={nodes:X,edges:W};return e&&X.forEach(zt=>{t.mergeNodeData(zt.id,{x:zt.data.x,y:zt.data.y})}),Gt})}}const or=(n,e)=>{let t;const r=n.rows||5,s=n.cols||5;return e==null?t=Math.min(r,s):Math.min(r,s)===n.rows?n.rows=e:n.cols=e,t},ar=(n,e)=>{let t;const r=n.rows||5,s=n.cols||5;return e==null?t=Math.max(r,s):Math.max(r,s)===n.rows?n.rows=e:n.cols=e,t},Wr=(n,e)=>n[`c-${e.row}-${e.col}`]||!1,Hs=(n,e)=>n[`c-${e.row}-${e.col}`]=!0,qs=(n,e)=>{const t=n.cols||5;e.col++,e.col>=t&&(e.col=0,e.row++)},Tu=(n,e,t,r,s,o,h,d)=>{let p,g;const y=s[n.id];if(y)p=y.col*t+t/2+e[0],g=y.row*r+r/2+e[1];else{for(;Wr(d,h);)qs(o,h);p=h.col*t+t/2+e[0],g=h.row*r+r/2+e[1],Hs(d,h),qs(o,h)}n.data.x=p,n.data.y=g},ju=(n,e,t)=>{try{const r=bn.mul(bn.pow(e,2),-.5),s=r.mean("row"),o=r.mean("column"),h=r.mean();r.add(h).subRowVector(s).subColumnVector(o);const d=new Ns(r),p=bn.sqrt(d.diagonalMatrix).diagonal();return d.leftSingularVectors.toJSON().map(g=>bn.mul([g],[p]).toJSON()[0].splice(0,n))}catch(r){const s=[];for(let o=0;o<e.length;o++){const h=Math.random()*t,d=Math.random()*t;s.push([h,d])}return s}},Iu=800,Pu={iterations:10,height:10,width:10,speed:100,gravity:10,k:5},Ru=(n,e)=>{const t=Object.assign(Object.assign({},Pu),e),{positions:r,iterations:s,width:o,k:h,speed:d=100,strictRadial:p,focusIdx:g,radii:y=[],nodeSizeFunc:O}=t,L=n.getAllNodes(),R=[],k=o/10;for(let F=0;F<s;F++)r.forEach((z,C)=>{R[C]={x:0,y:0}}),Lu(L,r,R,h,y,O),Cu(r,R,d,p,g,k,o,y);return r},Lu=(n,e,t,r,s,o)=>{e.forEach((h,d)=>{t[d]={x:0,y:0},e.forEach((p,g)=>{if(d===g||s[d]!==s[g])return;let y=h.x-p.x,O=h.y-p.y,L=Math.sqrt(y*y+O*O);if(L===0){L=1;const R=d>g?1:-1;y=.01*R,O=.01*R}if(L<o(n[d])/2+o(n[g])/2){const R=r*r/L;t[d].x+=y/L*R,t[d].y+=O/L*R}})})},Cu=(n,e,t,r,s,o,h,d)=>{const p=o||h/10;return r&&e.forEach((g,y)=>{const O=n[y].x-n[s].x,L=n[y].y-n[s].y,R=Math.sqrt(O*O+L*L);let k=L/R,F=-O/R;const z=Math.sqrt(g.x*g.x+g.y*g.y);let C=Math.acos((k*g.x+F*g.y)/z);C>Math.PI/2&&(C-=Math.PI/2,k*=-1,F*=-1);const W=Math.cos(C)*z;g.x=k*W,g.y=F*W}),n.forEach((g,y)=>{if(y===s)return;const O=Math.sqrt(e[y].x*e[y].x+e[y].y*e[y].y);if(O>0&&y!==s){const L=Math.min(p*(t/Iu),O);if(g.x+=e[y].x/O*L,g.y+=e[y].y/O*L,r){let R=g.x-n[s].x,k=g.y-n[s].y;const F=Math.sqrt(R*R+k*k);R=R/F*d[y],k=k/F*d[y],g.x=n[s].x+R,g.y=n[s].y+k}}}),n},Du={maxIteration:1e3,focusNode:null,unitRadius:null,linkDistance:50,preventOverlap:!1,strictRadial:!0,maxPreventOverlapIteration:200,sortStrength:10};class zu{constructor(e={}){this.options=e,this.id="radial",this.options=Object.assign(Object.assign({},Du),e)}execute(e,t){return A(this,void 0,void 0,function*(){return this.genericRadialLayout(!1,e,t)})}assign(e,t){return A(this,void 0,void 0,function*(){yield this.genericRadialLayout(!0,e,t)})}genericRadialLayout(e,t,r){return A(this,void 0,void 0,function*(){const s=Object.assign(Object.assign({},this.options),r),{width:o,height:h,center:d,focusNode:p,unitRadius:g,nodeSize:y,nodeSpacing:O,strictRadial:L,preventOverlap:R,maxPreventOverlapIteration:k,sortBy:F,linkDistance:z=50,sortStrength:C=10,maxIteration:W=1e3}=s,$=t.getAllNodes(),X=t.getAllEdges(),q=!o&&typeof window!="undefined"?window.innerWidth:o,st=!h&&typeof window!="undefined"?window.innerHeight:h,ut=d||[q/2,st/2];if(!($!=null&&$.length)||$.length===1)return jn(t,e,ut);let J=$[0];if(Yn(p)){for(let Ee=0;Ee<$.length;Ee++)if($[Ee].id===p){J=$[Ee];break}}else J=p||$[0];const mt=Bu($,J.id),Et=Ss({nodes:$,edges:X},!1),jt=Ms(Et),Pt=Vu(jt,mt);Uu(jt,mt,Pt+1);const Dt=jt[mt];let Gt=q-ut[0]>ut[0]?ut[0]:q-ut[0],zt=st-ut[1]>ut[1]?ut[1]:st-ut[1];Gt===0&&(Gt=q/2),zt===0&&(zt=st/2);const _t=Math.min(Gt,zt),le=Math.max(...Dt),bt=[],kt=g||_t/le;Dt.forEach((Ee,en)=>{bt[en]=Ee*kt});const Qt=Fu($,jt,z,bt,kt,F,C),Xt=ku(Qt),ie=ju(z,Qt,z);let de=ie.map(([Ee,en])=>({x:(isNaN(Ee)?Math.random()*z:Ee)-ie[mt][0],y:(isNaN(en)?Math.random()*z:en)-ie[mt][1]}));this.run(W,de,Xt,Qt,bt,mt);let Jt;if(R){Jt=gs(y,O);const Ee={nodes:$,nodeSizeFunc:Jt,positions:de,radii:bt,height:st,width:q,strictRadial:!!L,focusIdx:mt,iterations:k||200,k:de.length/4.5};de=Ru(t,Ee)}const oe=[];return de.forEach((Ee,en)=>{const gn=Ze($[en]);gn.data.x=Ee.x+ut[0],gn.data.y=Ee.y+ut[1],oe.push(gn)}),e&&oe.forEach(Ee=>t.mergeNodeData(Ee.id,{x:Ee.data.x,y:Ee.data.y})),{nodes:oe,edges:X}})}run(e,t,r,s,o,h){for(let d=0;d<=e;d++){const p=d/e;this.oneIteration(p,t,o,s,r,h)}}oneIteration(e,t,r,s,o,h){const d=1-e;t.forEach((p,g)=>{const y=Os(p,{x:0,y:0}),O=y===0?0:1/y;if(g===h)return;let L=0,R=0,k=0;t.forEach((z,C)=>{if(g===C)return;const W=Os(p,z),$=W===0?0:1/W,X=s[C][g];k+=o[g][C],L+=o[g][C]*(z.x+X*(p.x-z.x)*$),R+=o[g][C]*(z.y+X*(p.y-z.y)*$)});const F=r[g]===0?0:1/r[g];k*=d,k+=e*F*F,L*=d,L+=e*F*p.x*O,p.x=L/k,R*=d,R+=e*F*p.y*O,p.y=R/k})}}const Fu=(n,e,t,r,s,o,h)=>{if(!n)return[];const d=[];if(e){const p={};e.forEach((g,y)=>{const O=[];g.forEach((L,R)=>{var k,F;if(y===R)O.push(0);else if(r[y]===r[R])if(o==="data")O.push(L*(Math.abs(y-R)*h)/(r[y]/s));else if(o){let z,C;if(p[n[y].id])z=p[n[y].id];else{const W=(o==="id"?n[y].id:(k=n[y].data)===null||k===void 0?void 0:k[o])||0;Yn(W)?z=W.charCodeAt(0):z=W,p[n[y].id]=z}if(p[n[R].id])C=p[n[R].id];else{const W=(o==="id"?n[R].id:(F=n[R].data)===null||F===void 0?void 0:F[o])||0;Yn(W)?C=W.charCodeAt(0):C=W,p[n[R].id]=C}O.push(L*(Math.abs(z-C)*h)/(r[y]/s))}else O.push(L*t/(r[y]/s));else{const z=(t+s)/2;O.push(L*z)}}),d.push(O)})}return d},ku=n=>{const e=n.length,t=n[0].length,r=[];for(let s=0;s<e;s++){const o=[];for(let h=0;h<t;h++)n[s][h]!==0?o.push(1/(n[s][h]*n[s][h])):o.push(0);r.push(o)}return r},Bu=(n,e)=>{let t=-1;return n.forEach((r,s)=>{r.id===e&&(t=s)}),Math.max(t,0)},Uu=(n,e,t)=>{const r=n.length;for(let s=0;s<r;s++)if(n[e][s]===1/0){n[e][s]=t,n[s][e]=t;for(let o=0;o<r;o++)n[s][o]!==1/0&&n[e][o]===1/0&&(n[e][o]=t+n[s][o],n[o][e]=t+n[s][o])}for(let s=0;s<r;s++)if(s!==e){for(let o=0;o<r;o++)if(n[s][o]===1/0){let h=Math.abs(n[e][s]-n[e][o]);h=h===0?1:h,n[s][o]=h}}},Vu=(n,e)=>{let t=0;for(let r=0;r<n[e].length;r++)n[e][r]!==1/0&&(t=n[e][r]>t?n[e][r]:t);return t},Gu={center:[0,0],width:300,height:300};class Wu{constructor(e={}){this.options=e,this.id="random",this.options=Object.assign(Object.assign({},Gu),e)}execute(e,t){return A(this,void 0,void 0,function*(){return this.genericRandomLayout(!1,e,t)})}assign(e,t){return A(this,void 0,void 0,function*(){yield this.genericRandomLayout(!0,e,t)})}genericRandomLayout(e,t,r){return A(this,void 0,void 0,function*(){const s=Object.assign(Object.assign({},this.options),r),{center:o,width:h,height:d}=s,p=t.getAllNodes(),g=.9,y=!h&&typeof window!="undefined"?window.innerWidth:h,O=!d&&typeof window!="undefined"?window.innerHeight:d,L=o||[y/2,O/2],R=[];return p&&p.forEach(F=>{R.push({id:F.id,data:{x:(Math.random()-.5)*g*y+L[0],y:(Math.random()-.5)*g*O+L[1]}})}),e&&R.forEach(F=>t.mergeNodeData(F.id,{x:F.data.x,y:F.data.y})),{nodes:R,edges:t.getAllEdges()}})}}const Yu={circular:to,concentric:Tr,mds:As,random:Wu,grid:Au,radial:zu,force:xs,d3force:Gs,"d3-force-3d":yu,fruchterman:Su,forceAtlas2:bu,dagre:ir,antvDagre:Qi,comboCombined:na};let hn;Wt({stopLayout(){hn!=null&&hn.stop&&hn.stop()},calculateLayout(n,e){return A(this,void 0,void 0,function*(){const{layout:{id:t,options:r,iterations:s},nodes:o,edges:h}=n,d=new vt({nodes:o,edges:h}),p=Yu[t];if(p)hn=new p(r);else throw new Error(`Unknown layout id: ${t}`);let g=yield hn.execute(d);return Ts(hn)&&(hn.stop(),g=hn.tick(s)),[g,e]})}})})()})();
}());